From: support Date: Fri, 25 Mar 2022 10:28:43 +0000 (+0000) Subject: Built motion from commit 076b6d01.|2.6.7 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=a242f66ebc533f5e1a3391d3a60c5d130a93a53d;p=motion2.git Built motion from commit 076b6d01.|2.6.7 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 0880204..998f392 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-25T09:50:30.537Z", + "time": "2022-03-25T10:20:45.080Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f04c917..f63628a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-25T09:50:30.537Z", + "time": "2022-03-25T10:20:45.080Z", "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 7fc7ce1..18c2667 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 _0x820a=['urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','getDataValue','contactManager','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x241161,_0x3589e0){var _0x4d6dfb=function(_0x36cd25){while(--_0x36cd25){_0x241161['push'](_0x241161['shift']());}};_0x4d6dfb(++_0x3589e0);}(_0x820a,0x187));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa820('0x0'));module[_0xa820('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ae6f8){return this[_0xa820('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xa820('0x3'),_0xa820('0x4'),_0xa820('0x5'),'jscripty',_0xa820('0x6'),'browser',_0xa820('0x7'),_0xa820('0x8')]],'msg':_0xa820('0x9')}},'comment':_0xa820('0x9')},'data1':{'type':Sequelize[_0xa820('0xa')](0x1000),'comment':_0xa820('0xb')},'data2':{'type':Sequelize[_0xa820('0xa')](0x1000),'comment':_0xa820('0xc')},'data3':{'type':Sequelize[_0xa820('0xa')](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[_0xa820('0xa')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa820('0xd')},'data6':{'type':Sequelize[_0xa820('0xa')],'comments':_0xa820('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xcefd=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xcefd,0x1e1));var _0xdcef=function(_0x3333bb,_0x1df222){_0x3333bb=_0x3333bb-0x0;var _0x273d39=_0xcefd[_0x3333bb];return _0x273d39;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'name':{'type':Sequelize[_0xdcef('0x2')],'get':function(_0x2c0f36){return this[_0xdcef('0x3')](_0xdcef('0x4'));}},'action':{'type':Sequelize[_0xdcef('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdcef('0x6'),'integration',_0xdcef('0x7'),_0xdcef('0x8'),_0xdcef('0x9'),_0xdcef('0xa'),'bot','script']],'msg':_0xdcef('0xb')}},'comment':_0xdcef('0xb')},'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[_0xdcef('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comments':_0xdcef('0xc')},'data5':{'type':Sequelize[_0xdcef('0x5')](0x1000),'comments':_0xdcef('0xd')},'data6':{'type':Sequelize[_0xdcef('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xdcef('0xe')],'comments':_0xdcef('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6f8a920..6e2015c 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 _0x4c0e=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','body','find','params','then','catch','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2eade4,_0x4998e2){var _0x384fe2=function(_0x56a623){while(--_0x56a623){_0x2eade4['push'](_0x2eade4['shift']());}};_0x384fe2(++_0x4998e2);}(_0x4c0e,0xad));var _0xe4c0=function(_0x20ff64,_0x5c3677){_0x20ff64=_0x20ff64-0x0;var _0x5580db=_0x4c0e[_0x20ff64];return _0x5580db;};'use strict';var emlformat=require(_0xe4c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c0('0x1'));var jsonpatch=require(_0xe4c0('0x2'));var rp=require(_0xe4c0('0x3'));var moment=require(_0xe4c0('0x4'));var BPromise=require(_0xe4c0('0x5'));var Mustache=require('mustache');var util=require(_0xe4c0('0x6'));var path=require('path');var sox=require(_0xe4c0('0x7'));var csv=require(_0xe4c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4c0('0x9'));var squel=require(_0xe4c0('0xa'));var crypto=require(_0xe4c0('0xb'));var jsforce=require(_0xe4c0('0xc'));var deskjs=require(_0xe4c0('0xd'));var toCsv=require(_0xe4c0('0x8'));var querystring=require(_0xe4c0('0xe'));var Papa=require(_0xe4c0('0xf'));var Redis=require('ioredis');var authService=require(_0xe4c0('0x10'));var qs=require(_0xe4c0('0x11'));var as=require(_0xe4c0('0x12'));var hardwareService=require(_0xe4c0('0x13'));var logger=require(_0xe4c0('0x14'))(_0xe4c0('0x15'));var utils=require('../../config/utils');var config=require(_0xe4c0('0x16'));var licenseUtil=require(_0xe4c0('0x17'));var db=require(_0xe4c0('0x18'))['db'];function respondWithStatusCode(_0x5888a2,_0x8f278e){_0x8f278e=_0x8f278e||0xcc;return function(_0x3624c6){if(_0x3624c6){return _0x5888a2['sendStatus'](_0x8f278e);}return _0x5888a2[_0xe4c0('0x19')](_0x8f278e)['end']();};}function respondWithResult(_0x3daf05,_0x4c1642){_0x4c1642=_0x4c1642||0xc8;return function(_0x115a75){if(_0x115a75){return _0x3daf05[_0xe4c0('0x19')](_0x4c1642)[_0xe4c0('0x1a')](_0x115a75);}};}function respondWithFilteredResult(_0x43d6d0,_0x56d7c7){return function(_0x469297){if(_0x469297){var _0x1a3adc=typeof _0x56d7c7[_0xe4c0('0x1b')]===_0xe4c0('0x1c')&&typeof _0x56d7c7[_0xe4c0('0x1d')]==='undefined';var _0xdad8db=_0x469297['count'];var _0x48caa4=_0x1a3adc?0x0:_0x56d7c7[_0xe4c0('0x1b')];var _0x507692=_0x1a3adc?_0x469297['count']:_0x56d7c7[_0xe4c0('0x1b')]+_0x56d7c7['limit'];var _0x4e4e14;if(_0x507692>=_0xdad8db){_0x507692=_0xdad8db;_0x4e4e14=0xc8;}else{_0x4e4e14=0xce;}_0x43d6d0[_0xe4c0('0x19')](_0x4e4e14);return _0x43d6d0[_0xe4c0('0x1e')]('Content-Range',_0x48caa4+'-'+_0x507692+'/'+_0xdad8db)['json'](_0x469297);}return null;};}function patchUpdates(_0x864d9f){return function(_0x2f1a1f){try{jsonpatch[_0xe4c0('0x1f')](_0x2f1a1f,_0x864d9f,!![]);}catch(_0x42da93){return BPromise[_0xe4c0('0x20')](_0x42da93);}return _0x2f1a1f[_0xe4c0('0x21')]();};}function saveUpdates(_0x9634b6,_0x55ee79){return function(_0x5d19b4){if(_0x5d19b4){return _0x5d19b4[_0xe4c0('0x22')](_0x9634b6)['then'](function(_0x185d5e){return _0x185d5e;});}return null;};}function removeEntity(_0x15f0bd,_0x4e61e8){return function(_0xf3ed34){if(_0xf3ed34){return _0xf3ed34[_0xe4c0('0x23')]()['then'](function(){_0x15f0bd[_0xe4c0('0x19')](0xcc)[_0xe4c0('0x24')]();});}};}function handleEntityNotFound(_0x58736d,_0x108ebd){return function(_0x4ffc5d){if(!_0x4ffc5d){_0x58736d[_0xe4c0('0x25')](0x194);}return _0x4ffc5d;};}function handleError(_0x49af5c,_0xa9def){_0xa9def=_0xa9def||0x1f4;return function(_0x399ab6){logger[_0xe4c0('0x26')](_0x399ab6[_0xe4c0('0x27')]);if(_0x399ab6[_0xe4c0('0x28')]){delete _0x399ab6['name'];}_0x49af5c['status'](_0xa9def)['send'](_0x399ab6);};}exports['update']=function(_0x158ecc,_0x30271e){if(_0x158ecc[_0xe4c0('0x29')]['id']){delete _0x158ecc[_0xe4c0('0x29')]['id'];}return db['Action'][_0xe4c0('0x2a')]({'where':{'id':_0x158ecc[_0xe4c0('0x2b')]['id']}})[_0xe4c0('0x2c')](handleEntityNotFound(_0x30271e,null))[_0xe4c0('0x2c')](saveUpdates(_0x158ecc[_0xe4c0('0x29')],null))[_0xe4c0('0x2c')](respondWithResult(_0x30271e,null))[_0xe4c0('0x2d')](handleError(_0x30271e,null));};exports['destroy']=function(_0x583ea5,_0x2cb107){return db[_0xe4c0('0x2e')]['find']({'where':{'id':_0x583ea5[_0xe4c0('0x2b')]['id']}})[_0xe4c0('0x2c')](handleEntityNotFound(_0x2cb107,null))['then'](removeEntity(_0x2cb107,null))[_0xe4c0('0x2d')](handleError(_0x2cb107,null));}; \ No newline at end of file +var _0x67a4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','end','stack','name','send','body','Action','find','params','catch','eml-format'];(function(_0x388550,_0x3fd74b){var _0x735860=function(_0x50783c){while(--_0x50783c){_0x388550['push'](_0x388550['shift']());}};_0x735860(++_0x3fd74b);}(_0x67a4,0x141));var _0x467a=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x67a4[_0x15d18f];return _0xd12bf7;};'use strict';var emlformat=require(_0x467a('0x0'));var rimraf=require(_0x467a('0x1'));var zipdir=require(_0x467a('0x2'));var jsonpatch=require(_0x467a('0x3'));var rp=require(_0x467a('0x4'));var moment=require(_0x467a('0x5'));var BPromise=require(_0x467a('0x6'));var Mustache=require(_0x467a('0x7'));var util=require(_0x467a('0x8'));var path=require(_0x467a('0x9'));var sox=require(_0x467a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x467a('0xb'));var _=require('lodash');var squel=require(_0x467a('0xc'));var crypto=require(_0x467a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x467a('0xe'));var toCsv=require(_0x467a('0xf'));var querystring=require(_0x467a('0x10'));var Papa=require(_0x467a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x467a('0x12'));var as=require(_0x467a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x467a('0x14'))(_0x467a('0x15'));var utils=require('../../config/utils');var config=require(_0x467a('0x16'));var licenseUtil=require(_0x467a('0x17'));var db=require(_0x467a('0x18'))['db'];function respondWithStatusCode(_0x3464e9,_0x43e280){_0x43e280=_0x43e280||0xcc;return function(_0x8a5bc8){if(_0x8a5bc8){return _0x3464e9[_0x467a('0x19')](_0x43e280);}return _0x3464e9[_0x467a('0x1a')](_0x43e280)['end']();};}function respondWithResult(_0x289312,_0x52221b){_0x52221b=_0x52221b||0xc8;return function(_0x105392){if(_0x105392){return _0x289312[_0x467a('0x1a')](_0x52221b)['json'](_0x105392);}};}function respondWithFilteredResult(_0x498f4c,_0x4920d7){return function(_0x4e9f44){if(_0x4e9f44){var _0x198d21=typeof _0x4920d7['offset']==='undefined'&&typeof _0x4920d7[_0x467a('0x1b')]===_0x467a('0x1c');var _0x1f626f=_0x4e9f44[_0x467a('0x1d')];var _0x48ba0c=_0x198d21?0x0:_0x4920d7[_0x467a('0x1e')];var _0x3898e8=_0x198d21?_0x4e9f44[_0x467a('0x1d')]:_0x4920d7[_0x467a('0x1e')]+_0x4920d7[_0x467a('0x1b')];var _0x238e89;if(_0x3898e8>=_0x1f626f){_0x3898e8=_0x1f626f;_0x238e89=0xc8;}else{_0x238e89=0xce;}_0x498f4c[_0x467a('0x1a')](_0x238e89);return _0x498f4c['set'](_0x467a('0x1f'),_0x48ba0c+'-'+_0x3898e8+'/'+_0x1f626f)['json'](_0x4e9f44);}return null;};}function patchUpdates(_0x25e997){return function(_0xd40754){try{jsonpatch['apply'](_0xd40754,_0x25e997,!![]);}catch(_0x58b98c){return BPromise[_0x467a('0x20')](_0x58b98c);}return _0xd40754[_0x467a('0x21')]();};}function saveUpdates(_0x31f2b3,_0x292b53){return function(_0x2d6f7a){if(_0x2d6f7a){return _0x2d6f7a[_0x467a('0x22')](_0x31f2b3)[_0x467a('0x23')](function(_0x280be4){return _0x280be4;});}return null;};}function removeEntity(_0x33e8d0,_0x54a88a){return function(_0x4d70b4){if(_0x4d70b4){return _0x4d70b4[_0x467a('0x24')]()['then'](function(){_0x33e8d0['status'](0xcc)[_0x467a('0x25')]();});}};}function handleEntityNotFound(_0x3d6dd1,_0x28dd19){return function(_0xff2f){if(!_0xff2f){_0x3d6dd1[_0x467a('0x19')](0x194);}return _0xff2f;};}function handleError(_0x52db3c,_0x19b1f9){_0x19b1f9=_0x19b1f9||0x1f4;return function(_0x3c4fac){logger['error'](_0x3c4fac[_0x467a('0x26')]);if(_0x3c4fac[_0x467a('0x27')]){delete _0x3c4fac[_0x467a('0x27')];}_0x52db3c[_0x467a('0x1a')](_0x19b1f9)[_0x467a('0x28')](_0x3c4fac);};}exports[_0x467a('0x22')]=function(_0x4be1f4,_0xb8ef06){if(_0x4be1f4[_0x467a('0x29')]['id']){delete _0x4be1f4[_0x467a('0x29')]['id'];}return db[_0x467a('0x2a')][_0x467a('0x2b')]({'where':{'id':_0x4be1f4[_0x467a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xb8ef06,null))[_0x467a('0x23')](saveUpdates(_0x4be1f4[_0x467a('0x29')],null))[_0x467a('0x23')](respondWithResult(_0xb8ef06,null))[_0x467a('0x2d')](handleError(_0xb8ef06,null));};exports['destroy']=function(_0x433735,_0x4dbe8f){return db[_0x467a('0x2a')][_0x467a('0x2b')]({'where':{'id':_0x433735['params']['id']}})[_0x467a('0x23')](handleEntityNotFound(_0x4dbe8f,null))[_0x467a('0x23')](removeEntity(_0x4dbe8f,null))[_0x467a('0x2d')](handleError(_0x4dbe8f,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e867cd1..709c211 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 _0xc9ed=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc9ed,0x12b));var _0xdc9e=function(_0x74c392,_0x29cc28){_0x74c392=_0x74c392-0x0;var _0x306791=_0xc9ed[_0x74c392];return _0x306791;};'use strict';var _=require(_0xdc9e('0x0'));var util=require(_0xdc9e('0x1'));var logger=require(_0xdc9e('0x2'))('api');var moment=require(_0xdc9e('0x3'));var BPromise=require(_0xdc9e('0x4'));var rp=require(_0xdc9e('0x5'));var fs=require('fs');var path=require(_0xdc9e('0x6'));var rimraf=require(_0xdc9e('0x7'));var config=require(_0xdc9e('0x8'));var attributes=require(_0xdc9e('0x9'));module[_0xdc9e('0xa')]=function(_0x49e145,_0x3d579c){return _0x49e145[_0xdc9e('0xb')](_0xdc9e('0xc'),attributes,{'tableName':_0xdc9e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x045c=['bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x25d94f,_0x32630c){var _0x54ac19=function(_0x6afe25){while(--_0x6afe25){_0x25d94f['push'](_0x25d94f['shift']());}};_0x54ac19(++_0x32630c);}(_0x045c,0x8a));var _0xc045=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x045c[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xc045('0x0'));var util=require(_0xc045('0x1'));var logger=require(_0xc045('0x2'))(_0xc045('0x3'));var moment=require(_0xc045('0x4'));var BPromise=require(_0xc045('0x5'));var rp=require(_0xc045('0x6'));var fs=require('fs');var path=require(_0xc045('0x7'));var rimraf=require('rimraf');var config=require(_0xc045('0x8'));var attributes=require('./action.attributes');module[_0xc045('0x9')]=function(_0xa1d0a6,_0x40ae6c){return _0xa1d0a6[_0xc045('0xa')](_0xc045('0xb'),attributes,{'tableName':_0xc045('0xc'),'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 2bbde6a..276e52e 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xf494,0x1c6));var _0x4f49=function(_0x5a0c65,_0x11cba1){_0x5a0c65=_0x5a0c65-0x0;var _0x4f1ccd=_0xf494[_0x5a0c65];return _0x4f1ccd;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x5a0735,_0x1bfc03){var _0x53fa8c=function(_0x2bf3b3){while(--_0x2bf3b3){_0x5a0735['push'](_0x5a0735['shift']());}};_0x53fa8c(++_0x1bfc03);}(_0x1261,0x144));var _0x1126=function(_0x5ebe63,_0x2956bc){_0x5ebe63=_0x5ebe63-0x0;var _0x1f91ee=_0x1261[_0x5ebe63];return _0x1f91ee;};'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')]('Action,\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/action/index.js b/server/api/action/index.js index 7561a42..d5fe78a 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 _0x038f=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','path','fs-extra'];(function(_0x4b4844,_0x2f0dfb){var _0x575192=function(_0x13ee1b){while(--_0x13ee1b){_0x4b4844['push'](_0x4b4844['shift']());}};_0x575192(++_0x2f0dfb);}(_0x038f,0x1d7));var _0xf038=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x038f[_0x597484];return _0x218e64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf038('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf038('0x1'));var auth=require(_0xf038('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf038('0x3'));var controller=require(_0xf038('0x4'));router[_0xf038('0x5')](_0xf038('0x6'),auth[_0xf038('0x7')](),controller[_0xf038('0x8')]);router['delete']('/:id',auth[_0xf038('0x7')](),controller[_0xf038('0x9')]);module[_0xf038('0xa')]=router; \ No newline at end of file +var _0x7f86=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x240ebb,_0x1c2de3){var _0x1e6842=function(_0x10b804){while(--_0x10b804){_0x240ebb['push'](_0x240ebb['shift']());}};_0x1e6842(++_0x1c2de3);}(_0x7f86,0x174));var _0x67f8=function(_0x3c1080,_0x376fad){_0x3c1080=_0x3c1080-0x0;var _0x2f9f3c=_0x7f86[_0x3c1080];return _0x2f9f3c;};'use strict';var multer=require(_0x67f8('0x0'));var util=require(_0x67f8('0x1'));var path=require('path');var timeout=require(_0x67f8('0x2'));var express=require(_0x67f8('0x3'));var router=express[_0x67f8('0x4')]();var fs_extra=require(_0x67f8('0x5'));var auth=require(_0x67f8('0x6'));var interaction=require(_0x67f8('0x7'));var config=require(_0x67f8('0x8'));var controller=require(_0x67f8('0x9'));router['put'](_0x67f8('0xa'),auth['isAuthenticated'](),controller[_0x67f8('0xb')]);router[_0x67f8('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x67f8('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9a3f865..60da572 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3560d8,_0x5d93f5){_0x3560d8=_0x3560d8-0x0;var _0x15cf4d=_0xdc97[_0x3560d8];return _0x15cf4d;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x3ee5f2,_0x1e4594){var _0x4300f4=function(_0x510b8a){while(--_0x510b8a){_0x3ee5f2['push'](_0x3ee5f2['shift']());}};_0x4300f4(++_0x1e4594);}(_0xd8fb,0x99));var _0xbd8f=function(_0x56c760,_0x7594c0){_0x56c760=_0x56c760-0x0;var _0x28060a=_0xd8fb[_0x56c760];return _0x28060a;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a90a686..120c72e 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 _0xf590=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','keys','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','select','table','MetricId','metric','replace','function','groupBy','orderBy','alias','joins','parse','type','includes','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','toString','sequelize','join','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','web','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','SELECT','QueryTypes','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','options','AnalyticMetric','DESC','eml-format','zip-dir','request-promise','moment'];(function(_0x5e6871,_0x2d36a0){var _0x4f4a0a=function(_0x550926){while(--_0x550926){_0x5e6871['push'](_0x5e6871['shift']());}};_0x4f4a0a(++_0x2d36a0);}(_0xf590,0x1e2));var _0x0f59=function(_0x493376,_0x49d7f7){_0x493376=_0x493376-0x0;var _0x29520c=_0xf590[_0x493376];return _0x29520c;};'use strict';var emlformat=require(_0x0f59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f59('0x2'));var moment=require(_0x0f59('0x3'));var BPromise=require(_0x0f59('0x4'));var Mustache=require(_0x0f59('0x5'));var util=require(_0x0f59('0x6'));var path=require(_0x0f59('0x7'));var sox=require(_0x0f59('0x8'));var csv=require(_0x0f59('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f59('0xa'));var _=require(_0x0f59('0xb'));var squel=require(_0x0f59('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f59('0xd'));var deskjs=require(_0x0f59('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f59('0xf'));var Papa=require(_0x0f59('0x10'));var Redis=require(_0x0f59('0x11'));var authService=require(_0x0f59('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0f59('0x13'));var hardwareService=require(_0x0f59('0x14'));var logger=require(_0x0f59('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0f59('0x16'));var licenseUtil=require(_0x0f59('0x17'));var db=require(_0x0f59('0x18'))['db'];var dbH=require(_0x0f59('0x18'))[_0x0f59('0x19')];function respondWithStatusCode(_0x54fee2,_0x4c1f86){_0x4c1f86=_0x4c1f86||0xcc;return function(_0x5e1a21){if(_0x5e1a21){return _0x54fee2[_0x0f59('0x1a')](_0x4c1f86);}return _0x54fee2[_0x0f59('0x1b')](_0x4c1f86)[_0x0f59('0x1c')]();};}function respondWithResult(_0x4ec714,_0x2b8f42){_0x2b8f42=_0x2b8f42||0xc8;return function(_0x4bad2c){if(_0x4bad2c){return _0x4ec714[_0x0f59('0x1b')](_0x2b8f42)['json'](_0x4bad2c);}};}function respondWithFilteredResult(_0x26911e,_0x190ac5){return function(_0x4ecb66){if(_0x4ecb66){var _0x14242c=typeof _0x190ac5[_0x0f59('0x1d')]===_0x0f59('0x1e')&&typeof _0x190ac5[_0x0f59('0x1f')]==='undefined';var _0x24f766=_0x4ecb66[_0x0f59('0x20')];var _0x3fe737=_0x14242c?0x0:_0x190ac5['offset'];var _0x572bcb=_0x14242c?_0x4ecb66[_0x0f59('0x20')]:_0x190ac5[_0x0f59('0x1d')]+_0x190ac5['limit'];var _0x5910ef;if(_0x572bcb>=_0x24f766){_0x572bcb=_0x24f766;_0x5910ef=0xc8;}else{_0x5910ef=0xce;}_0x26911e[_0x0f59('0x1b')](_0x5910ef);return _0x26911e[_0x0f59('0x21')](_0x0f59('0x22'),_0x3fe737+'-'+_0x572bcb+'/'+_0x24f766)[_0x0f59('0x23')](_0x4ecb66);}return null;};}function patchUpdates(_0xf5acc4){return function(_0x4f1b45){try{jsonpatch['apply'](_0x4f1b45,_0xf5acc4,!![]);}catch(_0x5a75ff){return BPromise[_0x0f59('0x24')](_0x5a75ff);}return _0x4f1b45['save']();};}function saveUpdates(_0x1651e8,_0x49bfa8){return function(_0x4020d1){if(_0x4020d1){return _0x4020d1[_0x0f59('0x25')](_0x1651e8)['then'](function(_0x3754a3){return _0x3754a3;});}return null;};}function removeEntity(_0x548362,_0x30904a){return function(_0x46b6c2){if(_0x46b6c2){return _0x46b6c2[_0x0f59('0x26')]()[_0x0f59('0x27')](function(){var _0x93d02b=_0x46b6c2[_0x0f59('0x28')]({'plain':!![]});var _0xcd1189=_0x0f59('0x29');return db[_0x0f59('0x2a')][_0x0f59('0x26')]({'where':{'type':_0xcd1189,'resourceId':_0x93d02b['id']}})['then'](function(){return _0x46b6c2;});})['then'](function(){_0x548362[_0x0f59('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1b01e,_0x43e684){return function(_0x92a83f){if(!_0x92a83f){_0xd1b01e['sendStatus'](0x194);}return _0x92a83f;};}function handleError(_0x9368b9,_0xd1b4a1){_0xd1b4a1=_0xd1b4a1||0x1f4;return function(_0x1120b3){logger['error'](_0x1120b3[_0x0f59('0x2b')]);if(_0x1120b3[_0x0f59('0x2c')]){delete _0x1120b3['name'];}_0x9368b9[_0x0f59('0x1b')](_0xd1b4a1)[_0x0f59('0x2d')](_0x1120b3);};}exports[_0x0f59('0x2e')]=function(_0x21f167,_0xca733f){var _0x31cdf8={},_0x377c63={},_0x3a8db0={'count':0x0,'rows':[]};var _0x596272=_[_0x0f59('0x2f')](db[_0x0f59('0x30')][_0x0f59('0x31')],function(_0x22ffbe){return{'name':_0x22ffbe[_0x0f59('0x32')],'type':_0x22ffbe['type'][_0x0f59('0x33')]};});_0x377c63['model']=_[_0x0f59('0x2f')](_0x596272,'name');_0x377c63[_0x0f59('0x34')]=_['keys'](_0x21f167[_0x0f59('0x34')]);_0x377c63[_0x0f59('0x35')]=_[_0x0f59('0x36')](_0x377c63[_0x0f59('0x37')],_0x377c63[_0x0f59('0x34')]);_0x31cdf8['attributes']=_['intersection'](_0x377c63[_0x0f59('0x37')],qs['fields'](_0x21f167[_0x0f59('0x34')][_0x0f59('0x38')]));_0x31cdf8[_0x0f59('0x39')]=_0x31cdf8[_0x0f59('0x39')]['length']?_0x31cdf8[_0x0f59('0x39')]:_0x377c63[_0x0f59('0x37')];if(!_0x21f167[_0x0f59('0x34')]['hasOwnProperty'](_0x0f59('0x3a'))){_0x31cdf8[_0x0f59('0x1f')]=qs[_0x0f59('0x1f')](_0x21f167['query']['limit']);_0x31cdf8[_0x0f59('0x1d')]=qs['offset'](_0x21f167[_0x0f59('0x34')][_0x0f59('0x1d')]);}_0x31cdf8[_0x0f59('0x3b')]=qs[_0x0f59('0x3c')](_0x21f167[_0x0f59('0x34')][_0x0f59('0x3c')]);_0x31cdf8[_0x0f59('0x3d')]=qs['filters'](_['pick'](_0x21f167[_0x0f59('0x34')],_0x377c63['filters']),_0x596272);if(_0x21f167['query'][_0x0f59('0x3e')]){_0x31cdf8['where']=_['merge'](_0x31cdf8['where'],{'$or':_[_0x0f59('0x2f')](_0x596272,function(_0x3cae52){if(_0x3cae52['type']!==_0x0f59('0x3f')){var _0x4906bc={};_0x4906bc[_0x3cae52[_0x0f59('0x2c')]]={'$like':'%'+_0x21f167['query'][_0x0f59('0x3e')]+'%'};return _0x4906bc;}})});}_0x31cdf8=_[_0x0f59('0x40')]({},_0x31cdf8,_0x21f167['options']);var _0x12b2ca={'where':_0x31cdf8[_0x0f59('0x3d')]};return db[_0x0f59('0x30')]['count'](_0x12b2ca)[_0x0f59('0x27')](function(_0x1ef492){_0x3a8db0['count']=_0x1ef492;if(_0x21f167[_0x0f59('0x34')][_0x0f59('0x41')]){_0x31cdf8[_0x0f59('0x42')]=[{'all':!![]}];}return db[_0x0f59('0x30')][_0x0f59('0x43')](_0x31cdf8);})[_0x0f59('0x27')](function(_0x3b2e46){_0x3a8db0[_0x0f59('0x44')]=_0x3b2e46;return _0x3a8db0;})['then'](respondWithFilteredResult(_0xca733f,_0x31cdf8))['catch'](handleError(_0xca733f,null));};exports[_0x0f59('0x45')]=function(_0x5639e6,_0x4f580b){var _0x1f6ba0={'raw':![],'where':{'id':_0x5639e6['params']['id']}},_0x537911={};_0x537911[_0x0f59('0x37')]=_[_0x0f59('0x46')](db[_0x0f59('0x30')][_0x0f59('0x31')]);_0x537911[_0x0f59('0x34')]=_[_0x0f59('0x46')](_0x5639e6[_0x0f59('0x34')]);_0x537911[_0x0f59('0x35')]=_[_0x0f59('0x36')](_0x537911[_0x0f59('0x37')],_0x537911[_0x0f59('0x34')]);_0x1f6ba0[_0x0f59('0x39')]=_[_0x0f59('0x36')](_0x537911[_0x0f59('0x37')],qs['fields'](_0x5639e6['query'][_0x0f59('0x38')]));_0x1f6ba0['attributes']=_0x1f6ba0['attributes'][_0x0f59('0x47')]?_0x1f6ba0[_0x0f59('0x39')]:_0x537911[_0x0f59('0x37')];if(_0x5639e6[_0x0f59('0x34')]['includeAll']){_0x1f6ba0[_0x0f59('0x42')]=[{'all':!![]}];}_0x1f6ba0=_['merge']({},_0x1f6ba0,_0x5639e6['options']);return db[_0x0f59('0x30')]['find'](_0x1f6ba0)['then'](handleEntityNotFound(_0x4f580b,null))[_0x0f59('0x27')](respondWithResult(_0x4f580b,null))[_0x0f59('0x48')](handleError(_0x4f580b,null));};exports['create']=function(_0x391dfe,_0x1751fa){return db[_0x0f59('0x30')][_0x0f59('0x49')](_0x391dfe[_0x0f59('0x4a')],{})[_0x0f59('0x27')](function(_0x4d173d){var _0x392b19=_0x391dfe[_0x0f59('0x4b')][_0x0f59('0x28')]({'plain':!![]});if(!_0x392b19)throw new Error(_0x0f59('0x4c'));if(_0x392b19[_0x0f59('0x4d')]===_0x0f59('0x4b')){var _0x30a54e=_0x4d173d['get']({'plain':!![]});var _0x35971c=_0x0f59('0x4e');return db[_0x0f59('0x4f')]['find']({'where':{'name':_0x35971c,'userProfileId':_0x392b19['userProfileId']},'raw':!![]})[_0x0f59('0x27')](function(_0x247a6d){if(_0x247a6d&&_0x247a6d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x30a54e[_0x0f59('0x2c')],'resourceId':_0x30a54e['id'],'type':_0x0f59('0x29'),'sectionId':_0x247a6d['id']},{})[_0x0f59('0x27')](function(){return _0x4d173d;});}else{return _0x4d173d;}})['catch'](function(_0x39eade){logger[_0x0f59('0x50')](_0x0f59('0x51'),_0x39eade);throw _0x39eade;});}return _0x4d173d;})['then'](respondWithResult(_0x1751fa,0xc9))[_0x0f59('0x48')](handleError(_0x1751fa,null));};exports[_0x0f59('0x25')]=function(_0x4d0d51,_0xa5c2c){if(_0x4d0d51[_0x0f59('0x4a')]['id']){delete _0x4d0d51[_0x0f59('0x4a')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x4d0d51[_0x0f59('0x52')]['id']}})['then'](handleEntityNotFound(_0xa5c2c,null))[_0x0f59('0x27')](saveUpdates(_0x4d0d51[_0x0f59('0x4a')],null))[_0x0f59('0x27')](respondWithResult(_0xa5c2c,null))[_0x0f59('0x48')](handleError(_0xa5c2c,null));};exports[_0x0f59('0x26')]=function(_0x307dbd,_0x604cc9){return db[_0x0f59('0x30')][_0x0f59('0x53')]({'where':{'id':_0x307dbd[_0x0f59('0x52')]['id']}})[_0x0f59('0x27')](handleEntityNotFound(_0x604cc9,null))['then'](removeEntity(_0x604cc9,null))['catch'](handleError(_0x604cc9,null));};exports[_0x0f59('0x54')]=function(_0x5d74d8,_0x345899){var _0x13a3de=0xa;var _0x3f43c6=['join',_0x0f59('0x55'),'right_join',_0x0f59('0x56')];var _0xa1c112={'SUM':_0x0f59('0x57'),'COUNT':_0x0f59('0x58'),'COUNT DISTINCT':_0x0f59('0x59'),'MAX':_0x0f59('0x5a'),'MIN':_0x0f59('0x5b'),'AVG':_0x0f59('0x5c'),'GROUP_CONCAT':_0x0f59('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21ca6c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0f59('0x5e'),'HOUR':_0x0f59('0x5f'),'ROUND':_0x0f59('0x60'),'UNIX_TIMESTAMP':_0x0f59('0x61')};var _0x77c571=function(_0x4fee9d){return!_['includes'](['IS\x20NULL',_0x0f59('0x62'),'IS\x20EMPTY',_0x0f59('0x63')],_0x4fee9d);};var _0x1482c7=function(_0x2cc050){if(!_0x2cc050||!_0x2cc050[_0x0f59('0x64')]['length']){return'';}for(var _0x52c258='(',_0xfa80a4=0x0;_0xfa80a4<_0x2cc050[_0x0f59('0x64')][_0x0f59('0x47')];_0xfa80a4+=0x1){_0xfa80a4>0x0&&(_0x52c258+='\x20'+_0x2cc050[_0x0f59('0x65')]+'\x20');_0x52c258+=_0x2cc050[_0x0f59('0x64')][_0xfa80a4][_0x0f59('0x66')]?_0x1482c7(_0x2cc050[_0x0f59('0x64')][_0xfa80a4][_0x0f59('0x66')]):_0x2cc050[_0x0f59('0x64')][_0xfa80a4][_0x0f59('0x67')]+'\x20'+_0x2cc050['rules'][_0xfa80a4]['condition']+(_0x77c571(_0x2cc050['rules'][_0xfa80a4][_0x0f59('0x68')])?'\x20'+_0x2cc050[_0x0f59('0x64')][_0xfa80a4]['value']:'');}return _0x52c258+')';};var _0x25912b={'where':{'id':_0x5d74d8[_0x0f59('0x52')]['id']}},_0xeb5777,_0x591e82,_0x2aab89,_0x263ef9,_0x5bc1cb;_0x25912b=_[_0x0f59('0x40')]({},_0x25912b,_0x5d74d8['options']);return db['AnalyticCustomReport']['find'](_0x25912b)[_0x0f59('0x27')](function(_0x123241){if(_0x123241){_0xeb5777=_0x123241;return _0x123241[_0x0f59('0x69')]();}return null;})[_0x0f59('0x27')](function(_0x19729b){if(_0x19729b){if(!_0x19729b[_0x0f59('0x47')]){throw new db[(_0x0f59('0x6a'))][(_0x0f59('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x591e82=_0x19729b;return db['AnalyticMetric'][_0x0f59('0x43')]({'raw':!![]});}return null;})[_0x0f59('0x27')](function(_0x62cb20){if(_0x62cb20){_0x2aab89=_['keyBy'](_0x62cb20,'id');var _0xbbed75;var _0xbe25fa=squel[_0x0f59('0x6c')]();_0xbe25fa['from'](_0xeb5777[_0x0f59('0x6d')]);for(var _0xf83c28=0x0;_0xf83c28<_0x591e82[_0x0f59('0x47')];_0xf83c28+=0x1){_0xbbed75=_0x591e82[_0xf83c28][_0x0f59('0x6e')]?_0x2aab89[_0x591e82[_0xf83c28]['MetricId']][_0x0f59('0x6f')]:_0x591e82[_0xf83c28][_0x0f59('0x67')];_0xbbed75=_0x591e82[_0xf83c28]['function']?_[_0x0f59('0x70')](_0xa1c112[_0x591e82[_0xf83c28][_0x0f59('0x71')]],'%s',_0xbbed75):_0xbbed75;_0xbbed75=_0x591e82[_0xf83c28]['format']?_[_0x0f59('0x70')](_0x21ca6c[_0x591e82[_0xf83c28]['format']],'%s',_0xbbed75):_0xbbed75;if(_0x591e82[_0xf83c28][_0x0f59('0x72')]){_0xbe25fa[_0x0f59('0x66')](_0xbbed75);}_0x591e82[_0xf83c28][_0x0f59('0x73')]&&_0xbe25fa[_0x0f59('0x3b')](_0xbbed75,_0x591e82[_0xf83c28][_0x0f59('0x73')]==='DESC'?![]:!![]);_0xbe25fa[_0x0f59('0x67')](_0xbbed75,_0x591e82[_0xf83c28][_0x0f59('0x74')]||_0xbbed75);}if(_0xeb5777['joins']){_0xeb5777[_0x0f59('0x75')]=JSON[_0x0f59('0x76')](_0xeb5777[_0x0f59('0x75')]);for(var _0x144358=0x0;_0x144358<_0xeb5777[_0x0f59('0x75')][_0x0f59('0x47')];_0x144358+=0x1){if(_0xeb5777[_0x0f59('0x75')][_0x144358][_0x0f59('0x77')]&&_[_0x0f59('0x78')](_0x3f43c6,_0xeb5777[_0x0f59('0x75')][_0x144358][_0x0f59('0x77')])&&_0xeb5777[_0x0f59('0x75')][_0x144358]['parentKey']&&_0xeb5777[_0x0f59('0x75')][_0x144358][_0x0f59('0x79')]&&_0xeb5777['joins'][_0x144358][_0x0f59('0x7a')]){_0xbe25fa[_0xeb5777['joins'][_0x144358]['type']](_0xeb5777[_0x0f59('0x75')][_0x144358]['foreignTable'],null,util[_0x0f59('0x7b')](_0x0f59('0x7c'),_0xeb5777[_0x0f59('0x6d')],_0xeb5777[_0x0f59('0x75')][_0x144358][_0x0f59('0x7d')],_0xeb5777[_0x0f59('0x75')][_0x144358]['foreignTable'],_0xeb5777[_0x0f59('0x75')][_0x144358][_0x0f59('0x7a')]));}}}if(_0xeb5777['conditions']){_0xeb5777[_0x0f59('0x7e')]=JSON[_0x0f59('0x76')](_0xeb5777['conditions']);_0xbe25fa[_0x0f59('0x3d')](_0x1482c7(_0xeb5777['conditions']['group']));}_0x5bc1cb=_0xbe25fa[_0x0f59('0x7f')]();_0xbe25fa[_0x0f59('0x1f')](_0x13a3de);_0xbe25fa[_0x0f59('0x1d')](0x0);logger[_0x0f59('0x80')]('Limited\x20Query:',_0xbe25fa[_0x0f59('0x81')]());return dbH[_0x0f59('0x82')][_0x0f59('0x34')](_0xbe25fa['toString'](),{'type':dbH[_0x0f59('0x82')]['QueryTypes']['SELECT']});}})[_0x0f59('0x27')](respondWithResult(_0x345899,null))[_0x0f59('0x48')](handleError(_0x345899,null));};function runReport(_0x213140,_0x465438,_0x43542f){var _0x1e528f=_0x465438[_0x0f59('0x2c')];var _0xc45e26=0xa;var _0x11918e=[_0x0f59('0x83'),_0x0f59('0x55'),_0x0f59('0x84'),'cross_join'];var _0x1f775c={'SUM':'SUM(%s)','COUNT':_0x0f59('0x58'),'COUNT DISTINCT':_0x0f59('0x59'),'MAX':_0x0f59('0x5a'),'MIN':_0x0f59('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0f59('0x5d'),'GROUP_CONCAT ASC':_0x0f59('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xc0dfe5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f59('0x61')};var _0x5e93f3=function(_0x37a422){return!_[_0x0f59('0x78')]([_0x0f59('0x86'),_0x0f59('0x62'),'IS\x20EMPTY',_0x0f59('0x63')],_0x37a422);};var _0x20f228=function(_0x4fc2a0){if(!_0x4fc2a0||!_0x4fc2a0[_0x0f59('0x64')][_0x0f59('0x47')]){return'';}for(var _0x164fcc='(',_0x4c841b=0x0;_0x4c841b<_0x4fc2a0[_0x0f59('0x64')][_0x0f59('0x47')];_0x4c841b+=0x1){_0x4c841b>0x0&&(_0x164fcc+='\x20'+_0x4fc2a0['operator']+'\x20');_0x164fcc+=_0x4fc2a0[_0x0f59('0x64')][_0x4c841b][_0x0f59('0x66')]?_0x20f228(_0x4fc2a0[_0x0f59('0x64')][_0x4c841b][_0x0f59('0x66')]):_0x4fc2a0['rules'][_0x4c841b]['field']+'\x20'+_0x4fc2a0['rules'][_0x4c841b][_0x0f59('0x68')]+(_0x5e93f3(_0x4fc2a0[_0x0f59('0x64')][_0x4c841b][_0x0f59('0x68')])?'\x20'+_0x4fc2a0[_0x0f59('0x64')][_0x4c841b][_0x0f59('0x87')]:'');}return _0x164fcc+')';};var _0x55094c={'where':{'id':_0x213140['id']}},_0x310b22,_0x5d2449,_0x567198,_0x163214,_0x5b67b1;_0x55094c=_[_0x0f59('0x40')]({},_0x55094c,_0x43542f);return db[_0x0f59('0x30')][_0x0f59('0x53')](_0x55094c)[_0x0f59('0x27')](function(_0x59a2c0){if(_0x59a2c0){_0x310b22=_0x59a2c0;return _0x59a2c0[_0x0f59('0x69')]();}return null;})[_0x0f59('0x27')](function(_0x4e7610){if(_0x4e7610){if(!_0x4e7610[_0x0f59('0x47')]){throw new db[(_0x0f59('0x6a'))]['ValidationErrorItem'](_0x0f59('0x88'),0x193);}_0x5d2449=_0x4e7610;return db['AnalyticMetric'][_0x0f59('0x43')]({'raw':!![]});}return null;})[_0x0f59('0x27')](function(_0xdbf29b){if(_0xdbf29b){_0x567198=_[_0x0f59('0x89')](_0xdbf29b,'id');var _0x39f7fa;var _0x5e7ecc=squel[_0x0f59('0x6c')]();_0x5e7ecc[_0x0f59('0x8a')](_0x310b22[_0x0f59('0x6d')]);for(var _0x4c9f2b=0x0;_0x4c9f2b<_0x5d2449[_0x0f59('0x47')];_0x4c9f2b+=0x1){_0x39f7fa=_0x5d2449[_0x4c9f2b]['MetricId']?_0x567198[_0x5d2449[_0x4c9f2b]['MetricId']][_0x0f59('0x6f')]:_0x5d2449[_0x4c9f2b][_0x0f59('0x67')];_0x39f7fa=_0x5d2449[_0x4c9f2b]['function']?_['replace'](_0x1f775c[_0x5d2449[_0x4c9f2b]['function']],'%s',_0x39f7fa):_0x39f7fa;_0x39f7fa=_0x5d2449[_0x4c9f2b][_0x0f59('0x7b')]?_[_0x0f59('0x70')](_0xc0dfe5[_0x5d2449[_0x4c9f2b][_0x0f59('0x7b')]],'%s',_0x39f7fa):_0x39f7fa;if(_0x5d2449[_0x4c9f2b][_0x0f59('0x72')]){_0x5e7ecc['group'](_0x39f7fa);}_0x5d2449[_0x4c9f2b][_0x0f59('0x73')]&&_0x5e7ecc[_0x0f59('0x3b')](_0x39f7fa,_0x5d2449[_0x4c9f2b][_0x0f59('0x73')]==='DESC'?![]:!![]);_0x5e7ecc[_0x0f59('0x67')](_0x39f7fa,_0x5d2449[_0x4c9f2b][_0x0f59('0x74')]||_0x39f7fa);}if(_0x310b22['joins']){_0x310b22['joins']=JSON[_0x0f59('0x76')](_0x310b22['joins']);for(var _0x2c2be2=0x0;_0x2c2be2<_0x310b22['joins']['length'];_0x2c2be2+=0x1){if(_0x310b22[_0x0f59('0x75')][_0x2c2be2][_0x0f59('0x77')]&&_[_0x0f59('0x78')](_0x11918e,_0x310b22[_0x0f59('0x75')][_0x2c2be2][_0x0f59('0x77')])&&_0x310b22['joins'][_0x2c2be2][_0x0f59('0x7d')]&&_0x310b22['joins'][_0x2c2be2][_0x0f59('0x79')]&&_0x310b22[_0x0f59('0x75')][_0x2c2be2]['foreignKey']){_0x5e7ecc[_0x310b22[_0x0f59('0x75')][_0x2c2be2][_0x0f59('0x77')]](_0x310b22['joins'][_0x2c2be2][_0x0f59('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x310b22[_0x0f59('0x6d')],_0x310b22[_0x0f59('0x75')][_0x2c2be2][_0x0f59('0x7d')],_0x310b22[_0x0f59('0x75')][_0x2c2be2][_0x0f59('0x79')],_0x310b22['joins'][_0x2c2be2][_0x0f59('0x7a')]));}}}if(_0x310b22[_0x0f59('0x7e')]){_0x310b22['conditions']=JSON[_0x0f59('0x76')](_0x310b22[_0x0f59('0x7e')]);_0x5e7ecc['where'](_0x20f228(_0x310b22[_0x0f59('0x7e')][_0x0f59('0x66')]));}_0x5b67b1=_0x5e7ecc[_0x0f59('0x7f')]();_0x5e7ecc['limit'](_0xc45e26);_0x5e7ecc['offset'](0x0);return;}})[_0x0f59('0x27')](function(){if(_0x465438['output']===_0x0f59('0x8b')){return null;}var _0x208a40=_[_0x0f59('0x40')](_0x465438,{'name':_0x465438['fullPath']||_0x465438['name']||_0x310b22[_0x0f59('0x2c')],'basename':_0x1e528f,'savename':util[_0x0f59('0x7b')](_0x0f59('0x8c'),_0x465438[_0x0f59('0x2c')]||_0x310b22['name'],require(_0x0f59('0x8d'))['generate'](0x4),_0x465438['output']||_0x0f59('0x8e')),'reportId':_0x310b22['id'],'reportType':_0x0f59('0x8f')});return db['AnalyticExtractedReport']['create'](_0x208a40,{'raw':!![]});})[_0x0f59('0x27')](function(_0x211ab9){if(_0x310b22[_0x0f59('0x6d')]===_0x0f59('0x90')){_0x5b67b1['where'](_0x310b22['table']+_0x0f59('0x91'),_0x465438['startDate'],_0x465438['endDate']);}else{_0x5b67b1[_0x0f59('0x3d')](_0x310b22[_0x0f59('0x6d')]+_0x0f59('0x92'),_0x465438['startDate'],_0x465438['endDate']);}if(_0x211ab9){logger[_0x0f59('0x93')]('Run\x20Query:',_0x5b67b1['toString']());require(_0x0f59('0x94'))[_0x0f59('0x95')](path[_0x0f59('0x83')](__dirname,_0x0f59('0x96'),_0x211ab9['output']),[_0x211ab9['id'],_0x5b67b1[_0x0f59('0x81')](),path[_0x0f59('0x83')](__dirname,_0x0f59('0x97'),_0x211ab9[_0x0f59('0x98')]),_0x1e528f]);return _0x211ab9;}else{var _0x3ada0d=squel['select']();_0x3ada0d[_0x0f59('0x8a')]('('+_0x5b67b1[_0x0f59('0x81')]()+')',_0x0f59('0x99'));_0x3ada0d[_0x0f59('0x67')]('COUNT(*)',_0x0f59('0x20'));_0x5b67b1[_0x0f59('0x1f')](_0x465438[_0x0f59('0x1f')]||_0xc45e26);_0x5b67b1[_0x0f59('0x1d')](_0x465438[_0x0f59('0x1d')]||0x0);return dbH[_0x0f59('0x82')]['query'](_0x3ada0d['toString'](),{'type':dbH[_0x0f59('0x82')]['QueryTypes'][_0x0f59('0x9a')]})[_0x0f59('0x27')](function(_0x46210d){if(!_0x46210d[_0x0f59('0x47')]){_0x163214=0x0;}else{_0x163214=_0x46210d[0x0][_0x0f59('0x20')]||0x0;}return dbH[_0x0f59('0x82')][_0x0f59('0x34')](_0x5b67b1[_0x0f59('0x81')](),{'type':dbH[_0x0f59('0x82')][_0x0f59('0x9b')][_0x0f59('0x9a')]});})[_0x0f59('0x27')](function(_0xcd9e22){return{'rows':_0xcd9e22||[],'count':_0x163214};});}});}exports[_0x0f59('0x9c')]=function(_0xd8126,_0x414893){return runReport(_0xd8126[_0x0f59('0x52')],_0xd8126[_0x0f59('0x34')],_0xd8126['options'])[_0x0f59('0x27')](respondWithResult(_0x414893,null))[_0x0f59('0x48')](handleError(_0x414893,null));};exports['runReport']=runReport;exports[_0x0f59('0x34')]=function(_0x23abff,_0x2525c2){var _0x2d37b1=0xa;var _0x20d621=['join',_0x0f59('0x55'),_0x0f59('0x84'),'cross_join'];var _0x37ea60={'SUM':_0x0f59('0x57'),'COUNT':_0x0f59('0x58'),'COUNT DISTINCT':_0x0f59('0x59'),'MAX':'MAX(%s)','MIN':_0x0f59('0x5b'),'AVG':_0x0f59('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0f59('0x9d')};var _0x3d925d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0f59('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x0f59('0x60'),'UNIX_TIMESTAMP':_0x0f59('0x61')};var _0x341ebb=function(_0x2b5be1){return!_['includes'](['IS\x20NULL',_0x0f59('0x62'),_0x0f59('0x9e'),_0x0f59('0x63')],_0x2b5be1);};var _0xeb8fc2=function(_0x18a2f8){if(!_0x18a2f8||!_0x18a2f8[_0x0f59('0x64')][_0x0f59('0x47')]){return'';}for(var _0x3bd905='(',_0x468b04=0x0;_0x468b04<_0x18a2f8['rules'][_0x0f59('0x47')];_0x468b04+=0x1){_0x468b04>0x0&&(_0x3bd905+='\x20'+_0x18a2f8['operator']+'\x20');_0x3bd905+=_0x18a2f8[_0x0f59('0x64')][_0x468b04][_0x0f59('0x66')]?_0xeb8fc2(_0x18a2f8['rules'][_0x468b04][_0x0f59('0x66')]):_0x18a2f8[_0x0f59('0x64')][_0x468b04][_0x0f59('0x67')]+'\x20'+_0x18a2f8['rules'][_0x468b04][_0x0f59('0x68')]+(_0x341ebb(_0x18a2f8[_0x0f59('0x64')][_0x468b04][_0x0f59('0x68')])?'\x20'+_0x18a2f8['rules'][_0x468b04][_0x0f59('0x87')]:'');}return _0x3bd905+')';};var _0x58c72a={'where':{'id':_0x23abff[_0x0f59('0x52')]['id']}},_0x470e00,_0x40785b,_0x5d462f,_0x21bb9f,_0x3c947a;_0x58c72a=_[_0x0f59('0x40')]({},_0x58c72a,_0x23abff[_0x0f59('0x9f')]);return db[_0x0f59('0x30')]['find'](_0x58c72a)[_0x0f59('0x27')](function(_0x2b1e0c){if(_0x2b1e0c){_0x470e00=_0x2b1e0c;return _0x2b1e0c[_0x0f59('0x69')]();}return null;})[_0x0f59('0x27')](function(_0x255c39){if(_0x255c39){if(!_0x255c39['length']){throw new db[(_0x0f59('0x6a'))][(_0x0f59('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x40785b=_0x255c39;return db[_0x0f59('0xa0')][_0x0f59('0x43')]({'raw':!![]});}return null;})[_0x0f59('0x27')](function(_0x3fd4b4){if(_0x3fd4b4){_0x5d462f=_[_0x0f59('0x89')](_0x3fd4b4,'id');var _0x1468b5;var _0xdbc20a=squel[_0x0f59('0x6c')]();_0xdbc20a[_0x0f59('0x8a')](_0x470e00[_0x0f59('0x6d')]);for(var _0xf34dfb=0x0;_0xf34dfb<_0x40785b[_0x0f59('0x47')];_0xf34dfb+=0x1){_0x1468b5=_0x40785b[_0xf34dfb][_0x0f59('0x6e')]?_0x5d462f[_0x40785b[_0xf34dfb][_0x0f59('0x6e')]][_0x0f59('0x6f')]:_0x40785b[_0xf34dfb]['field'];_0x1468b5=_0x40785b[_0xf34dfb][_0x0f59('0x71')]?_[_0x0f59('0x70')](_0x37ea60[_0x40785b[_0xf34dfb][_0x0f59('0x71')]],'%s',_0x1468b5):_0x1468b5;_0x1468b5=_0x40785b[_0xf34dfb][_0x0f59('0x7b')]?_[_0x0f59('0x70')](_0x3d925d[_0x40785b[_0xf34dfb][_0x0f59('0x7b')]],'%s',_0x1468b5):_0x1468b5;if(_0x40785b[_0xf34dfb][_0x0f59('0x72')]){_0xdbc20a['group'](_0x1468b5);}_0x40785b[_0xf34dfb]['orderBy']&&_0xdbc20a[_0x0f59('0x3b')](_0x1468b5,_0x40785b[_0xf34dfb]['orderBy']===_0x0f59('0xa1')?![]:!![]);_0xdbc20a[_0x0f59('0x67')](_0x1468b5,_0x40785b[_0xf34dfb][_0x0f59('0x74')]||_0x1468b5);}if(_0x470e00[_0x0f59('0x75')]){_0x470e00['joins']=JSON[_0x0f59('0x76')](_0x470e00[_0x0f59('0x75')]);for(var _0x4752f7=0x0;_0x4752f7<_0x470e00[_0x0f59('0x75')]['length'];_0x4752f7+=0x1){if(_0x470e00[_0x0f59('0x75')][_0x4752f7]['type']&&_['includes'](_0x20d621,_0x470e00[_0x0f59('0x75')][_0x4752f7][_0x0f59('0x77')])&&_0x470e00['joins'][_0x4752f7][_0x0f59('0x7d')]&&_0x470e00[_0x0f59('0x75')][_0x4752f7][_0x0f59('0x79')]&&_0x470e00['joins'][_0x4752f7]['foreignKey']){_0xdbc20a[_0x470e00[_0x0f59('0x75')][_0x4752f7][_0x0f59('0x77')]](_0x470e00[_0x0f59('0x75')][_0x4752f7][_0x0f59('0x79')],null,util[_0x0f59('0x7b')](_0x0f59('0x7c'),_0x470e00[_0x0f59('0x6d')],_0x470e00[_0x0f59('0x75')][_0x4752f7][_0x0f59('0x7d')],_0x470e00['joins'][_0x4752f7][_0x0f59('0x79')],_0x470e00['joins'][_0x4752f7][_0x0f59('0x7a')]));}}}if(_0x470e00['conditions']){_0x470e00[_0x0f59('0x7e')]=JSON['parse'](_0x470e00[_0x0f59('0x7e')]);_0xdbc20a['where'](_0xeb8fc2(_0x470e00['conditions'][_0x0f59('0x66')]));}_0x3c947a=_0xdbc20a['clone']();_0xdbc20a['limit'](_0x2d37b1);_0xdbc20a['offset'](0x0);logger[_0x0f59('0x80')]('Limited\x20Query:',_0xdbc20a[_0x0f59('0x81')]());return dbH[_0x0f59('0x82')][_0x0f59('0x34')](_0xdbc20a[_0x0f59('0x81')](),{'type':dbH[_0x0f59('0x82')]['QueryTypes'][_0x0f59('0x9a')]});}})['then'](function(){return{'sql':_0x3c947a[_0x0f59('0x81')]()};})[_0x0f59('0x27')](respondWithResult(_0x2525c2,null))[_0x0f59('0x48')](handleError(_0x2525c2,null));}; \ No newline at end of file +var _0x6a45=['name','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','options','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','Sequelize','findAll','select','from','table','MetricId','metric','function','replace','format','groupBy','group','orderBy','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','DESC','clone','web','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','left_join','MAX(%s)','IS\x20EMPTY','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x6a45,0x11e));var _0x56a4=function(_0x260009,_0x47327e){_0x260009=_0x260009-0x0;var _0x338deb=_0x6a45[_0x260009];return _0x338deb;};'use strict';var emlformat=require(_0x56a4('0x0'));var rimraf=require(_0x56a4('0x1'));var zipdir=require(_0x56a4('0x2'));var jsonpatch=require(_0x56a4('0x3'));var rp=require('request-promise');var moment=require(_0x56a4('0x4'));var BPromise=require(_0x56a4('0x5'));var Mustache=require(_0x56a4('0x6'));var util=require(_0x56a4('0x7'));var path=require('path');var sox=require(_0x56a4('0x8'));var csv=require(_0x56a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56a4('0xa'));var _=require('lodash');var squel=require(_0x56a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x56a4('0xc'));var deskjs=require(_0x56a4('0xd'));var toCsv=require(_0x56a4('0x9'));var querystring=require(_0x56a4('0xe'));var Papa=require(_0x56a4('0xf'));var Redis=require(_0x56a4('0x10'));var authService=require(_0x56a4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x56a4('0x12'));var hardwareService=require(_0x56a4('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x56a4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x56a4('0x15'))['db'];var dbH=require(_0x56a4('0x15'))[_0x56a4('0x16')];function respondWithStatusCode(_0x450984,_0x16a941){_0x16a941=_0x16a941||0xcc;return function(_0x51795e){if(_0x51795e){return _0x450984[_0x56a4('0x17')](_0x16a941);}return _0x450984[_0x56a4('0x18')](_0x16a941)[_0x56a4('0x19')]();};}function respondWithResult(_0x47b505,_0x27dcb8){_0x27dcb8=_0x27dcb8||0xc8;return function(_0x38e12a){if(_0x38e12a){return _0x47b505[_0x56a4('0x18')](_0x27dcb8)[_0x56a4('0x1a')](_0x38e12a);}};}function respondWithFilteredResult(_0x245345,_0x553d37){return function(_0x362b4d){if(_0x362b4d){var _0x5dff0e=typeof _0x553d37[_0x56a4('0x1b')]===_0x56a4('0x1c')&&typeof _0x553d37['limit']===_0x56a4('0x1c');var _0x5ac07c=_0x362b4d[_0x56a4('0x1d')];var _0x13d569=_0x5dff0e?0x0:_0x553d37['offset'];var _0xb44f9=_0x5dff0e?_0x362b4d[_0x56a4('0x1d')]:_0x553d37[_0x56a4('0x1b')]+_0x553d37['limit'];var _0x5c314c;if(_0xb44f9>=_0x5ac07c){_0xb44f9=_0x5ac07c;_0x5c314c=0xc8;}else{_0x5c314c=0xce;}_0x245345['status'](_0x5c314c);return _0x245345[_0x56a4('0x1e')](_0x56a4('0x1f'),_0x13d569+'-'+_0xb44f9+'/'+_0x5ac07c)[_0x56a4('0x1a')](_0x362b4d);}return null;};}function patchUpdates(_0x211172){return function(_0x596ee6){try{jsonpatch['apply'](_0x596ee6,_0x211172,!![]);}catch(_0x9db61a){return BPromise[_0x56a4('0x20')](_0x9db61a);}return _0x596ee6[_0x56a4('0x21')]();};}function saveUpdates(_0x2bcfd8,_0x5d7f4d){return function(_0x2333b9){if(_0x2333b9){return _0x2333b9[_0x56a4('0x22')](_0x2bcfd8)[_0x56a4('0x23')](function(_0x56e267){return _0x56e267;});}return null;};}function removeEntity(_0x3f590e,_0x320c26){return function(_0x373e55){if(_0x373e55){return _0x373e55['destroy']()[_0x56a4('0x23')](function(){var _0x390581=_0x373e55[_0x56a4('0x24')]({'plain':!![]});var _0x227f57=_0x56a4('0x25');return db[_0x56a4('0x26')][_0x56a4('0x27')]({'where':{'type':_0x227f57,'resourceId':_0x390581['id']}})[_0x56a4('0x23')](function(){return _0x373e55;});})[_0x56a4('0x23')](function(){_0x3f590e[_0x56a4('0x18')](0xcc)[_0x56a4('0x19')]();});}};}function handleEntityNotFound(_0x6709fa,_0x353cb3){return function(_0x45b8d8){if(!_0x45b8d8){_0x6709fa[_0x56a4('0x17')](0x194);}return _0x45b8d8;};}function handleError(_0x322263,_0x50a42a){_0x50a42a=_0x50a42a||0x1f4;return function(_0x37e989){logger[_0x56a4('0x28')](_0x37e989[_0x56a4('0x29')]);if(_0x37e989[_0x56a4('0x2a')]){delete _0x37e989[_0x56a4('0x2a')];}_0x322263['status'](_0x50a42a)['send'](_0x37e989);};}exports['index']=function(_0x1cc1a0,_0x1e0e46){var _0x133b31={},_0x581e32={},_0x1c7a79={'count':0x0,'rows':[]};var _0x49de73=_['map'](db[_0x56a4('0x2b')][_0x56a4('0x2c')],function(_0x5e8185){return{'name':_0x5e8185[_0x56a4('0x2d')],'type':_0x5e8185[_0x56a4('0x2e')][_0x56a4('0x2f')]};});_0x581e32[_0x56a4('0x30')]=_[_0x56a4('0x31')](_0x49de73,_0x56a4('0x2a'));_0x581e32[_0x56a4('0x32')]=_[_0x56a4('0x33')](_0x1cc1a0[_0x56a4('0x32')]);_0x581e32[_0x56a4('0x34')]=_['intersection'](_0x581e32[_0x56a4('0x30')],_0x581e32[_0x56a4('0x32')]);_0x133b31[_0x56a4('0x35')]=_[_0x56a4('0x36')](_0x581e32[_0x56a4('0x30')],qs[_0x56a4('0x37')](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x37')]));_0x133b31[_0x56a4('0x35')]=_0x133b31[_0x56a4('0x35')][_0x56a4('0x38')]?_0x133b31[_0x56a4('0x35')]:_0x581e32[_0x56a4('0x30')];if(!_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x39')](_0x56a4('0x3a'))){_0x133b31['limit']=qs[_0x56a4('0x3b')](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x3b')]);_0x133b31[_0x56a4('0x1b')]=qs['offset'](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x1b')]);}_0x133b31[_0x56a4('0x3c')]=qs['sort'](_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x3d')]);_0x133b31[_0x56a4('0x3e')]=qs[_0x56a4('0x34')](_[_0x56a4('0x3f')](_0x1cc1a0['query'],_0x581e32[_0x56a4('0x34')]),_0x49de73);if(_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x40')]){_0x133b31[_0x56a4('0x3e')]=_[_0x56a4('0x41')](_0x133b31[_0x56a4('0x3e')],{'$or':_[_0x56a4('0x31')](_0x49de73,function(_0x5375e4){if(_0x5375e4[_0x56a4('0x2e')]!==_0x56a4('0x42')){var _0x11a06a={};_0x11a06a[_0x5375e4[_0x56a4('0x2a')]]={'$like':'%'+_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x40')]+'%'};return _0x11a06a;}})});}_0x133b31=_[_0x56a4('0x41')]({},_0x133b31,_0x1cc1a0['options']);var _0xbf2d1b={'where':_0x133b31[_0x56a4('0x3e')]};return db[_0x56a4('0x2b')][_0x56a4('0x1d')](_0xbf2d1b)['then'](function(_0x32327e){_0x1c7a79[_0x56a4('0x1d')]=_0x32327e;if(_0x1cc1a0[_0x56a4('0x32')][_0x56a4('0x43')]){_0x133b31[_0x56a4('0x44')]=[{'all':!![]}];}return db[_0x56a4('0x2b')]['findAll'](_0x133b31);})['then'](function(_0x4862f4){_0x1c7a79['rows']=_0x4862f4;return _0x1c7a79;})[_0x56a4('0x23')](respondWithFilteredResult(_0x1e0e46,_0x133b31))['catch'](handleError(_0x1e0e46,null));};exports[_0x56a4('0x45')]=function(_0x2f030e,_0x42c88d){var _0x56a9ea={'raw':![],'where':{'id':_0x2f030e[_0x56a4('0x46')]['id']}},_0xa3585f={};_0xa3585f['model']=_['keys'](db[_0x56a4('0x2b')]['rawAttributes']);_0xa3585f[_0x56a4('0x32')]=_[_0x56a4('0x33')](_0x2f030e[_0x56a4('0x32')]);_0xa3585f[_0x56a4('0x34')]=_['intersection'](_0xa3585f[_0x56a4('0x30')],_0xa3585f[_0x56a4('0x32')]);_0x56a9ea[_0x56a4('0x35')]=_[_0x56a4('0x36')](_0xa3585f[_0x56a4('0x30')],qs['fields'](_0x2f030e['query']['fields']));_0x56a9ea[_0x56a4('0x35')]=_0x56a9ea[_0x56a4('0x35')][_0x56a4('0x38')]?_0x56a9ea[_0x56a4('0x35')]:_0xa3585f[_0x56a4('0x30')];if(_0x2f030e[_0x56a4('0x32')]['includeAll']){_0x56a9ea['include']=[{'all':!![]}];}_0x56a9ea=_[_0x56a4('0x41')]({},_0x56a9ea,_0x2f030e[_0x56a4('0x47')]);return db['AnalyticCustomReport'][_0x56a4('0x48')](_0x56a9ea)['then'](handleEntityNotFound(_0x42c88d,null))['then'](respondWithResult(_0x42c88d,null))[_0x56a4('0x49')](handleError(_0x42c88d,null));};exports[_0x56a4('0x4a')]=function(_0x10de1f,_0x4c6df){return db[_0x56a4('0x2b')][_0x56a4('0x4a')](_0x10de1f[_0x56a4('0x4b')],{})[_0x56a4('0x23')](function(_0x8b9913){var _0x36be71=_0x10de1f[_0x56a4('0x4c')]['get']({'plain':!![]});if(!_0x36be71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36be71[_0x56a4('0x4d')]===_0x56a4('0x4c')){var _0x35071f=_0x8b9913['get']({'plain':!![]});var _0x3af5b1=_0x56a4('0x4e');return db[_0x56a4('0x4f')][_0x56a4('0x48')]({'where':{'name':_0x3af5b1,'userProfileId':_0x36be71[_0x56a4('0x50')]},'raw':!![]})[_0x56a4('0x23')](function(_0x3634d9){if(_0x3634d9&&_0x3634d9['autoAssociation']===0x0){return db[_0x56a4('0x26')]['create']({'name':_0x35071f[_0x56a4('0x2a')],'resourceId':_0x35071f['id'],'type':_0x56a4('0x25'),'sectionId':_0x3634d9['id']},{})['then'](function(){return _0x8b9913;});}else{return _0x8b9913;}})[_0x56a4('0x49')](function(_0x4d9d02){logger['error'](_0x56a4('0x51'),_0x4d9d02);throw _0x4d9d02;});}return _0x8b9913;})[_0x56a4('0x23')](respondWithResult(_0x4c6df,0xc9))[_0x56a4('0x49')](handleError(_0x4c6df,null));};exports[_0x56a4('0x22')]=function(_0x12818c,_0x4faaeb){if(_0x12818c[_0x56a4('0x4b')]['id']){delete _0x12818c[_0x56a4('0x4b')]['id'];}return db[_0x56a4('0x2b')][_0x56a4('0x48')]({'where':{'id':_0x12818c['params']['id']}})[_0x56a4('0x23')](handleEntityNotFound(_0x4faaeb,null))[_0x56a4('0x23')](saveUpdates(_0x12818c[_0x56a4('0x4b')],null))[_0x56a4('0x23')](respondWithResult(_0x4faaeb,null))[_0x56a4('0x49')](handleError(_0x4faaeb,null));};exports['destroy']=function(_0x387774,_0x56c94e){return db['AnalyticCustomReport'][_0x56a4('0x48')]({'where':{'id':_0x387774['params']['id']}})['then'](handleEntityNotFound(_0x56c94e,null))[_0x56a4('0x23')](removeEntity(_0x56c94e,null))[_0x56a4('0x49')](handleError(_0x56c94e,null));};exports[_0x56a4('0x52')]=function(_0xab3ed2,_0x2b236c){var _0x44fc7f=0xa;var _0x5d5cd1=['join','left_join',_0x56a4('0x53'),_0x56a4('0x54')];var _0x1b02d6={'SUM':'SUM(%s)','COUNT':_0x56a4('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x56a4('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x16ec71={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x34956c=function(_0x26612f){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),'IS\x20EMPTY',_0x56a4('0x5f')],_0x26612f);};var _0x5a0825=function(_0x216bfa){if(!_0x216bfa||!_0x216bfa[_0x56a4('0x60')][_0x56a4('0x38')]){return'';}for(var _0x2c418d='(',_0x4690e0=0x0;_0x4690e0<_0x216bfa[_0x56a4('0x60')]['length'];_0x4690e0+=0x1){_0x4690e0>0x0&&(_0x2c418d+='\x20'+_0x216bfa[_0x56a4('0x61')]+'\x20');_0x2c418d+=_0x216bfa[_0x56a4('0x60')][_0x4690e0]['group']?_0x5a0825(_0x216bfa['rules'][_0x4690e0]['group']):_0x216bfa[_0x56a4('0x60')][_0x4690e0][_0x56a4('0x62')]+'\x20'+_0x216bfa['rules'][_0x4690e0][_0x56a4('0x63')]+(_0x34956c(_0x216bfa[_0x56a4('0x60')][_0x4690e0]['condition'])?'\x20'+_0x216bfa[_0x56a4('0x60')][_0x4690e0][_0x56a4('0x64')]:'');}return _0x2c418d+')';};var _0x1c7177={'where':{'id':_0xab3ed2[_0x56a4('0x46')]['id']}},_0x2a089e,_0xdc2848,_0x269e0a,_0x484344,_0x3d25fc;_0x1c7177=_[_0x56a4('0x41')]({},_0x1c7177,_0xab3ed2[_0x56a4('0x47')]);return db[_0x56a4('0x2b')]['find'](_0x1c7177)[_0x56a4('0x23')](function(_0x27d91b){if(_0x27d91b){_0x2a089e=_0x27d91b;return _0x27d91b['getFields']();}return null;})['then'](function(_0xa6c8dc){if(_0xa6c8dc){if(!_0xa6c8dc[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xdc2848=_0xa6c8dc;return db['AnalyticMetric'][_0x56a4('0x66')]({'raw':!![]});}return null;})['then'](function(_0x4dd675){if(_0x4dd675){_0x269e0a=_['keyBy'](_0x4dd675,'id');var _0x254114;var _0x30cac1=squel[_0x56a4('0x67')]();_0x30cac1[_0x56a4('0x68')](_0x2a089e[_0x56a4('0x69')]);for(var _0xf2bf9c=0x0;_0xf2bf9c<_0xdc2848['length'];_0xf2bf9c+=0x1){_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6a')]?_0x269e0a[_0xdc2848[_0xf2bf9c][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0xdc2848[_0xf2bf9c]['field'];_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6c')]?_[_0x56a4('0x6d')](_0x1b02d6[_0xdc2848[_0xf2bf9c][_0x56a4('0x6c')]],'%s',_0x254114):_0x254114;_0x254114=_0xdc2848[_0xf2bf9c][_0x56a4('0x6e')]?_[_0x56a4('0x6d')](_0x16ec71[_0xdc2848[_0xf2bf9c]['format']],'%s',_0x254114):_0x254114;if(_0xdc2848[_0xf2bf9c][_0x56a4('0x6f')]){_0x30cac1[_0x56a4('0x70')](_0x254114);}_0xdc2848[_0xf2bf9c][_0x56a4('0x71')]&&_0x30cac1[_0x56a4('0x3c')](_0x254114,_0xdc2848[_0xf2bf9c][_0x56a4('0x71')]==='DESC'?![]:!![]);_0x30cac1[_0x56a4('0x62')](_0x254114,_0xdc2848[_0xf2bf9c][_0x56a4('0x72')]||_0x254114);}if(_0x2a089e['joins']){_0x2a089e['joins']=JSON['parse'](_0x2a089e[_0x56a4('0x73')]);for(var _0x14df79=0x0;_0x14df79<_0x2a089e[_0x56a4('0x73')][_0x56a4('0x38')];_0x14df79+=0x1){if(_0x2a089e['joins'][_0x14df79][_0x56a4('0x2e')]&&_['includes'](_0x5d5cd1,_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x2e')])&&_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x74')]&&_0x2a089e[_0x56a4('0x73')][_0x14df79]['foreignTable']&&_0x2a089e['joins'][_0x14df79][_0x56a4('0x75')]){_0x30cac1[_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x2e')]](_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x76')],null,util[_0x56a4('0x6e')](_0x56a4('0x77'),_0x2a089e[_0x56a4('0x69')],_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x74')],_0x2a089e[_0x56a4('0x73')][_0x14df79]['foreignTable'],_0x2a089e[_0x56a4('0x73')][_0x14df79][_0x56a4('0x75')]));}}}if(_0x2a089e[_0x56a4('0x78')]){_0x2a089e[_0x56a4('0x78')]=JSON[_0x56a4('0x79')](_0x2a089e[_0x56a4('0x78')]);_0x30cac1[_0x56a4('0x3e')](_0x5a0825(_0x2a089e['conditions'][_0x56a4('0x70')]));}_0x3d25fc=_0x30cac1['clone']();_0x30cac1[_0x56a4('0x3b')](_0x44fc7f);_0x30cac1[_0x56a4('0x1b')](0x0);logger[_0x56a4('0x7a')](_0x56a4('0x7b'),_0x30cac1[_0x56a4('0x7c')]());return dbH[_0x56a4('0x7d')][_0x56a4('0x32')](_0x30cac1[_0x56a4('0x7c')](),{'type':dbH['sequelize'][_0x56a4('0x7e')][_0x56a4('0x7f')]});}})['then'](respondWithResult(_0x2b236c,null))[_0x56a4('0x49')](handleError(_0x2b236c,null));};function runReport(_0x300dff,_0x148f52,_0x561d53){var _0x3b201d=_0x148f52['name'];var _0x1579ab=0xa;var _0x3c5b5b=[_0x56a4('0x80'),'left_join',_0x56a4('0x53'),_0x56a4('0x54')];var _0x32537c={'SUM':_0x56a4('0x81'),'COUNT':_0x56a4('0x55'),'COUNT DISTINCT':_0x56a4('0x82'),'MAX':'MAX(%s)','MIN':_0x56a4('0x56'),'AVG':_0x56a4('0x83'),'GROUP_CONCAT':_0x56a4('0x84'),'GROUP_CONCAT ASC':_0x56a4('0x85'),'GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x17872a={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':_0x56a4('0x86'),'UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x50698d=function(_0x57ab2e){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),'IS\x20EMPTY',_0x56a4('0x5f')],_0x57ab2e);};var _0x3172f9=function(_0x518ce7){if(!_0x518ce7||!_0x518ce7[_0x56a4('0x60')][_0x56a4('0x38')]){return'';}for(var _0x55e605='(',_0x535de2=0x0;_0x535de2<_0x518ce7[_0x56a4('0x60')][_0x56a4('0x38')];_0x535de2+=0x1){_0x535de2>0x0&&(_0x55e605+='\x20'+_0x518ce7[_0x56a4('0x61')]+'\x20');_0x55e605+=_0x518ce7[_0x56a4('0x60')][_0x535de2][_0x56a4('0x70')]?_0x3172f9(_0x518ce7['rules'][_0x535de2][_0x56a4('0x70')]):_0x518ce7['rules'][_0x535de2]['field']+'\x20'+_0x518ce7[_0x56a4('0x60')][_0x535de2][_0x56a4('0x63')]+(_0x50698d(_0x518ce7[_0x56a4('0x60')][_0x535de2]['condition'])?'\x20'+_0x518ce7['rules'][_0x535de2]['value']:'');}return _0x55e605+')';};var _0x1e02aa={'where':{'id':_0x300dff['id']}},_0x236943,_0xf3eba6,_0x2f2a28,_0x58af72,_0x7ea051;_0x1e02aa=_[_0x56a4('0x41')]({},_0x1e02aa,_0x561d53);return db[_0x56a4('0x2b')]['find'](_0x1e02aa)[_0x56a4('0x23')](function(_0x11739d){if(_0x11739d){_0x236943=_0x11739d;return _0x11739d['getFields']();}return null;})[_0x56a4('0x23')](function(_0xb112d7){if(_0xb112d7){if(!_0xb112d7[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))][(_0x56a4('0x87'))](_0x56a4('0x88'),0x193);}_0xf3eba6=_0xb112d7;return db[_0x56a4('0x89')]['findAll']({'raw':!![]});}return null;})[_0x56a4('0x23')](function(_0x3823a6){if(_0x3823a6){_0x2f2a28=_[_0x56a4('0x8a')](_0x3823a6,'id');var _0x440cea;var _0x3603e2=squel['select']();_0x3603e2[_0x56a4('0x68')](_0x236943[_0x56a4('0x69')]);for(var _0x4093f7=0x0;_0x4093f7<_0xf3eba6[_0x56a4('0x38')];_0x4093f7+=0x1){_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6a')]?_0x2f2a28[_0xf3eba6[_0x4093f7][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0xf3eba6[_0x4093f7][_0x56a4('0x62')];_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6c')]?_['replace'](_0x32537c[_0xf3eba6[_0x4093f7]['function']],'%s',_0x440cea):_0x440cea;_0x440cea=_0xf3eba6[_0x4093f7][_0x56a4('0x6e')]?_[_0x56a4('0x6d')](_0x17872a[_0xf3eba6[_0x4093f7][_0x56a4('0x6e')]],'%s',_0x440cea):_0x440cea;if(_0xf3eba6[_0x4093f7][_0x56a4('0x6f')]){_0x3603e2[_0x56a4('0x70')](_0x440cea);}_0xf3eba6[_0x4093f7]['orderBy']&&_0x3603e2[_0x56a4('0x3c')](_0x440cea,_0xf3eba6[_0x4093f7][_0x56a4('0x71')]===_0x56a4('0x8b')?![]:!![]);_0x3603e2['field'](_0x440cea,_0xf3eba6[_0x4093f7]['alias']||_0x440cea);}if(_0x236943[_0x56a4('0x73')]){_0x236943['joins']=JSON['parse'](_0x236943['joins']);for(var _0x5c368e=0x0;_0x5c368e<_0x236943['joins'][_0x56a4('0x38')];_0x5c368e+=0x1){if(_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')]&&_[_0x56a4('0x5c')](_0x3c5b5b,_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')])&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x74')]&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x76')]&&_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x75')]){_0x3603e2[_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x2e')]](_0x236943['joins'][_0x5c368e][_0x56a4('0x76')],null,util[_0x56a4('0x6e')](_0x56a4('0x77'),_0x236943[_0x56a4('0x69')],_0x236943[_0x56a4('0x73')][_0x5c368e][_0x56a4('0x74')],_0x236943[_0x56a4('0x73')][_0x5c368e]['foreignTable'],_0x236943['joins'][_0x5c368e]['foreignKey']));}}}if(_0x236943[_0x56a4('0x78')]){_0x236943[_0x56a4('0x78')]=JSON[_0x56a4('0x79')](_0x236943[_0x56a4('0x78')]);_0x3603e2['where'](_0x3172f9(_0x236943[_0x56a4('0x78')]['group']));}_0x7ea051=_0x3603e2[_0x56a4('0x8c')]();_0x3603e2[_0x56a4('0x3b')](_0x1579ab);_0x3603e2[_0x56a4('0x1b')](0x0);return;}})[_0x56a4('0x23')](function(){if(_0x148f52['output']===_0x56a4('0x8d')){return null;}var _0x47f69e=_['merge'](_0x148f52,{'name':_0x148f52['fullPath']||_0x148f52[_0x56a4('0x2a')]||_0x236943[_0x56a4('0x2a')],'basename':_0x3b201d,'savename':util[_0x56a4('0x6e')](_0x56a4('0x8e'),_0x148f52[_0x56a4('0x2a')]||_0x236943['name'],require(_0x56a4('0x8f'))['generate'](0x4),_0x148f52[_0x56a4('0x90')]||'csv'),'reportId':_0x236943['id'],'reportType':_0x56a4('0x91')});return db[_0x56a4('0x92')][_0x56a4('0x4a')](_0x47f69e,{'raw':!![]});})['then'](function(_0x2f0a06){if(_0x236943[_0x56a4('0x69')]===_0x56a4('0x93')){_0x7ea051[_0x56a4('0x3e')](_0x236943['table']+_0x56a4('0x94'),_0x148f52[_0x56a4('0x95')],_0x148f52['endDate']);}else{_0x7ea051[_0x56a4('0x3e')](_0x236943[_0x56a4('0x69')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x148f52[_0x56a4('0x95')],_0x148f52[_0x56a4('0x96')]);}if(_0x2f0a06){logger[_0x56a4('0x97')](_0x56a4('0x98'),_0x7ea051['toString']());require(_0x56a4('0x99'))['fork'](path[_0x56a4('0x80')](__dirname,'../../components/export/',_0x2f0a06[_0x56a4('0x90')]),[_0x2f0a06['id'],_0x7ea051[_0x56a4('0x7c')](),path[_0x56a4('0x80')](__dirname,_0x56a4('0x9a'),_0x2f0a06[_0x56a4('0x9b')]),_0x3b201d]);return _0x2f0a06;}else{var _0xafb339=squel[_0x56a4('0x67')]();_0xafb339[_0x56a4('0x68')]('('+_0x7ea051[_0x56a4('0x7c')]()+')',_0x56a4('0x9c'));_0xafb339[_0x56a4('0x62')](_0x56a4('0x9d'),'count');_0x7ea051['limit'](_0x148f52['limit']||_0x1579ab);_0x7ea051[_0x56a4('0x1b')](_0x148f52[_0x56a4('0x1b')]||0x0);return dbH['sequelize'][_0x56a4('0x32')](_0xafb339[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')]['QueryTypes'][_0x56a4('0x7f')]})[_0x56a4('0x23')](function(_0x132d0b){if(!_0x132d0b[_0x56a4('0x38')]){_0x58af72=0x0;}else{_0x58af72=_0x132d0b[0x0][_0x56a4('0x1d')]||0x0;}return dbH[_0x56a4('0x7d')][_0x56a4('0x32')](_0x7ea051[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')]['QueryTypes'][_0x56a4('0x7f')]});})[_0x56a4('0x23')](function(_0x4094e5){return{'rows':_0x4094e5||[],'count':_0x58af72};});}});}exports[_0x56a4('0x9e')]=function(_0x343f78,_0x574441){return runReport(_0x343f78[_0x56a4('0x46')],_0x343f78[_0x56a4('0x32')],_0x343f78[_0x56a4('0x47')])[_0x56a4('0x23')](respondWithResult(_0x574441,null))[_0x56a4('0x49')](handleError(_0x574441,null));};exports[_0x56a4('0x9f')]=runReport;exports['query']=function(_0x42de7c,_0x2707cc){var _0x986994=0xa;var _0x4b009c=[_0x56a4('0x80'),_0x56a4('0xa0'),_0x56a4('0x53'),'cross_join'];var _0x59e75a={'SUM':_0x56a4('0x81'),'COUNT':_0x56a4('0x55'),'COUNT DISTINCT':_0x56a4('0x82'),'MAX':_0x56a4('0xa1'),'MIN':_0x56a4('0x56'),'AVG':_0x56a4('0x83'),'GROUP_CONCAT':_0x56a4('0x84'),'GROUP_CONCAT ASC':_0x56a4('0x85'),'GROUP_CONCAT DESC':_0x56a4('0x57')};var _0x88045d={'SEC_TO_TIME':_0x56a4('0x58'),'DATE':_0x56a4('0x59'),'HOUR':_0x56a4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x56a4('0x5b')};var _0x7a2b7c=function(_0x9c32f4){return!_[_0x56a4('0x5c')]([_0x56a4('0x5d'),_0x56a4('0x5e'),_0x56a4('0xa2'),_0x56a4('0x5f')],_0x9c32f4);};var _0x19e1d4=function(_0x2d3f5d){if(!_0x2d3f5d||!_0x2d3f5d['rules'][_0x56a4('0x38')]){return'';}for(var _0x109d21='(',_0x18d0a2=0x0;_0x18d0a2<_0x2d3f5d[_0x56a4('0x60')][_0x56a4('0x38')];_0x18d0a2+=0x1){_0x18d0a2>0x0&&(_0x109d21+='\x20'+_0x2d3f5d[_0x56a4('0x61')]+'\x20');_0x109d21+=_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x70')]?_0x19e1d4(_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x70')]):_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2]['field']+'\x20'+_0x2d3f5d['rules'][_0x18d0a2][_0x56a4('0x63')]+(_0x7a2b7c(_0x2d3f5d['rules'][_0x18d0a2][_0x56a4('0x63')])?'\x20'+_0x2d3f5d[_0x56a4('0x60')][_0x18d0a2][_0x56a4('0x64')]:'');}return _0x109d21+')';};var _0x570ef0={'where':{'id':_0x42de7c[_0x56a4('0x46')]['id']}},_0x50a0e5,_0x3be68b,_0x36567d,_0x36e5dd,_0x29e024;_0x570ef0=_['merge']({},_0x570ef0,_0x42de7c[_0x56a4('0x47')]);return db[_0x56a4('0x2b')][_0x56a4('0x48')](_0x570ef0)[_0x56a4('0x23')](function(_0x12c0cc){if(_0x12c0cc){_0x50a0e5=_0x12c0cc;return _0x12c0cc[_0x56a4('0xa3')]();}return null;})[_0x56a4('0x23')](function(_0x797558){if(_0x797558){if(!_0x797558[_0x56a4('0x38')]){throw new db[(_0x56a4('0x65'))][(_0x56a4('0x87'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3be68b=_0x797558;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x56a4('0x23')](function(_0x31dde1){if(_0x31dde1){_0x36567d=_[_0x56a4('0x8a')](_0x31dde1,'id');var _0x215543;var _0x292959=squel['select']();_0x292959[_0x56a4('0x68')](_0x50a0e5[_0x56a4('0x69')]);for(var _0x5532cb=0x0;_0x5532cb<_0x3be68b[_0x56a4('0x38')];_0x5532cb+=0x1){_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6a')]?_0x36567d[_0x3be68b[_0x5532cb][_0x56a4('0x6a')]][_0x56a4('0x6b')]:_0x3be68b[_0x5532cb][_0x56a4('0x62')];_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6c')]?_[_0x56a4('0x6d')](_0x59e75a[_0x3be68b[_0x5532cb][_0x56a4('0x6c')]],'%s',_0x215543):_0x215543;_0x215543=_0x3be68b[_0x5532cb][_0x56a4('0x6e')]?_['replace'](_0x88045d[_0x3be68b[_0x5532cb]['format']],'%s',_0x215543):_0x215543;if(_0x3be68b[_0x5532cb][_0x56a4('0x6f')]){_0x292959[_0x56a4('0x70')](_0x215543);}_0x3be68b[_0x5532cb][_0x56a4('0x71')]&&_0x292959['order'](_0x215543,_0x3be68b[_0x5532cb][_0x56a4('0x71')]===_0x56a4('0x8b')?![]:!![]);_0x292959[_0x56a4('0x62')](_0x215543,_0x3be68b[_0x5532cb][_0x56a4('0x72')]||_0x215543);}if(_0x50a0e5[_0x56a4('0x73')]){_0x50a0e5[_0x56a4('0x73')]=JSON[_0x56a4('0x79')](_0x50a0e5[_0x56a4('0x73')]);for(var _0x5128e6=0x0;_0x5128e6<_0x50a0e5[_0x56a4('0x73')][_0x56a4('0x38')];_0x5128e6+=0x1){if(_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x2e')]&&_[_0x56a4('0x5c')](_0x4b009c,_0x50a0e5[_0x56a4('0x73')][_0x5128e6]['type'])&&_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x74')]&&_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x76')]&&_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x75')]){_0x292959[_0x50a0e5['joins'][_0x5128e6][_0x56a4('0x2e')]](_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x76')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x50a0e5[_0x56a4('0x69')],_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x74')],_0x50a0e5[_0x56a4('0x73')][_0x5128e6]['foreignTable'],_0x50a0e5[_0x56a4('0x73')][_0x5128e6][_0x56a4('0x75')]));}}}if(_0x50a0e5[_0x56a4('0x78')]){_0x50a0e5['conditions']=JSON['parse'](_0x50a0e5[_0x56a4('0x78')]);_0x292959[_0x56a4('0x3e')](_0x19e1d4(_0x50a0e5[_0x56a4('0x78')]['group']));}_0x29e024=_0x292959[_0x56a4('0x8c')]();_0x292959[_0x56a4('0x3b')](_0x986994);_0x292959[_0x56a4('0x1b')](0x0);logger[_0x56a4('0x7a')](_0x56a4('0x7b'),_0x292959[_0x56a4('0x7c')]());return dbH[_0x56a4('0x7d')]['query'](_0x292959[_0x56a4('0x7c')](),{'type':dbH[_0x56a4('0x7d')][_0x56a4('0x7e')][_0x56a4('0x7f')]});}})[_0x56a4('0x23')](function(){return{'sql':_0x29e024[_0x56a4('0x7c')]()};})[_0x56a4('0x23')](respondWithResult(_0x2707cc,null))[_0x56a4('0x49')](handleError(_0x2707cc,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6f7f81c..800f45b 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 _0x57ee=['../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x57ee,0x15a));var _0xe57e=function(_0x329e24,_0x49a71d){_0x329e24=_0x329e24-0x0;var _0x382256=_0x57ee[_0x329e24];return _0x382256;};'use strict';var _=require(_0xe57e('0x0'));var util=require('util');var logger=require(_0xe57e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe57e('0x2'));var rp=require(_0xe57e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe57e('0x4'));var config=require(_0xe57e('0x5'));var attributes=require(_0xe57e('0x6'));module[_0xe57e('0x7')]=function(_0x9c1f6e,_0x4a73e0){return _0x9c1f6e['define']('AnalyticCustomReport',attributes,{'tableName':_0xe57e('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24d5=['util','../../config/logger','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash'];(function(_0x11e4f3,_0x28f89e){var _0x541e85=function(_0x2999e6){while(--_0x2999e6){_0x11e4f3['push'](_0x11e4f3['shift']());}};_0x541e85(++_0x28f89e);}(_0x24d5,0x1b7));var _0x524d=function(_0xb2dbb2,_0x2a311e){_0xb2dbb2=_0xb2dbb2-0x0;var _0x123734=_0x24d5[_0xb2dbb2];return _0x123734;};'use strict';var _=require(_0x524d('0x0'));var util=require(_0x524d('0x1'));var logger=require(_0x524d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x524d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x524d('0x4'));var config=require(_0x524d('0x5'));var attributes=require(_0x524d('0x6'));module[_0x524d('0x7')]=function(_0x51ada8,_0x5354e8){return _0x51ada8[_0x524d('0x8')](_0x524d('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 841c014..74fc08c 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 _0xc89a=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xc89a,0x13a));var _0xac89=function(_0x53045d,_0xb3467c){_0x53045d=_0x53045d-0x0;var _0x20baea=_0xc89a[_0x53045d];return _0x20baea;};'use strict';var _=require(_0xac89('0x0'));var util=require(_0xac89('0x1'));var moment=require('moment');var BPromise=require(_0xac89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac89('0x3'));var db=require(_0xac89('0x4'))['db'];var utils=require(_0xac89('0x5'));var logger=require(_0xac89('0x6'))(_0xac89('0x7'));var config=require('../../config/environment');var jayson=require(_0xac89('0x8'));var client=jayson[_0xac89('0x9')][_0xac89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209532,_0x301a71,_0x3b1b22){return new BPromise(function(_0x1b61ad,_0x2eafa8){return client[_0xac89('0xb')](_0x209532,_0x3b1b22)[_0xac89('0xc')](function(_0x548be7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x301a71,_0xac89('0xd'));logger[_0xac89('0xe')](_0xac89('0xf'),_0x301a71,_0xac89('0xd'),JSON[_0xac89('0x10')](_0x548be7));if(_0x548be7[_0xac89('0x11')]){if(_0x548be7[_0xac89('0x11')][_0xac89('0x12')]===0x1f4){logger[_0xac89('0x11')](_0xac89('0x13'),_0x301a71,_0x548be7[_0xac89('0x11')][_0xac89('0x14')]);return _0x2eafa8(_0x548be7['error'][_0xac89('0x14')]);}logger['error'](_0xac89('0x13'),_0x301a71,_0x548be7[_0xac89('0x11')]['message']);return _0x1b61ad(_0x548be7['error'][_0xac89('0x14')]);}else{logger[_0xac89('0x15')](_0xac89('0x13'),_0x301a71,_0xac89('0xd'));_0x1b61ad(_0x548be7[_0xac89('0x16')]['message']);}})[_0xac89('0x17')](function(_0x46109a){logger[_0xac89('0x11')](_0xac89('0x13'),_0x301a71,_0x46109a);_0x2eafa8(_0x46109a);});});} \ No newline at end of file +var _0x0c2f=['jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4d3aa6,_0x972c6a){var _0x4014b6=function(_0x48bb6e){while(--_0x48bb6e){_0x4d3aa6['push'](_0x4d3aa6['shift']());}};_0x4014b6(++_0x972c6a);}(_0x0c2f,0x99));var _0xf0c2=function(_0x314397,_0x550526){_0x314397=_0x314397-0x0;var _0x1ec45e=_0x0c2f[_0x314397];return _0x1ec45e;};'use strict';var _=require(_0xf0c2('0x0'));var util=require(_0xf0c2('0x1'));var moment=require(_0xf0c2('0x2'));var BPromise=require(_0xf0c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0c2('0x4'));var db=require(_0xf0c2('0x5'))['db'];var utils=require(_0xf0c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c2('0x7'));var jayson=require(_0xf0c2('0x8'));var client=jayson[_0xf0c2('0x9')][_0xf0c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bb522,_0x56c279,_0x136ddf){return new BPromise(function(_0x3c1cc4,_0x28225e){return client[_0xf0c2('0xb')](_0x4bb522,_0x136ddf)[_0xf0c2('0xc')](function(_0x442d3e){logger['info'](_0xf0c2('0xd'),_0x56c279,_0xf0c2('0xe'));logger[_0xf0c2('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x56c279,_0xf0c2('0xe'),JSON[_0xf0c2('0x10')](_0x442d3e));if(_0x442d3e[_0xf0c2('0x11')]){if(_0x442d3e['error'][_0xf0c2('0x12')]===0x1f4){logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);return _0x28225e(_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);}logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0x442d3e[_0xf0c2('0x11')]['message']);return _0x3c1cc4(_0x442d3e[_0xf0c2('0x11')][_0xf0c2('0x13')]);}else{logger[_0xf0c2('0x14')](_0xf0c2('0xd'),_0x56c279,'request\x20sent');_0x3c1cc4(_0x442d3e[_0xf0c2('0x15')][_0xf0c2('0x13')]);}})[_0xf0c2('0x16')](function(_0xfbde41){logger[_0xf0c2('0x11')](_0xf0c2('0xd'),_0x56c279,_0xfbde41);_0x28225e(_0xfbde41);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2d95c8e..c8f5f13 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 _0x3e28=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','query','put','update','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x33953a,_0x2e8798){var _0x1d099f=function(_0x178d27){while(--_0x178d27){_0x33953a['push'](_0x33953a['shift']());}};_0x1d099f(++_0x2e8798);}(_0x3e28,0xf0));var _0x83e2=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x3e28[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require(_0x83e2('0x0'));var util=require('util');var path=require(_0x83e2('0x1'));var timeout=require('connect-timeout');var express=require(_0x83e2('0x2'));var router=express[_0x83e2('0x3')]();var fs_extra=require(_0x83e2('0x4'));var auth=require(_0x83e2('0x5'));var interaction=require(_0x83e2('0x6'));var config=require(_0x83e2('0x7'));var controller=require(_0x83e2('0x8'));router[_0x83e2('0x9')]('/',auth[_0x83e2('0xa')](),controller[_0x83e2('0xb')]);router[_0x83e2('0x9')](_0x83e2('0xc'),auth[_0x83e2('0xa')](),controller['show']);router[_0x83e2('0x9')](_0x83e2('0xd'),auth[_0x83e2('0xa')](),controller[_0x83e2('0xe')]);router[_0x83e2('0x9')](_0x83e2('0xf'),auth[_0x83e2('0xa')](),controller['run']);router['get']('/:id/query',auth[_0x83e2('0xa')](),controller[_0x83e2('0x10')]);router['post']('/',auth[_0x83e2('0xa')](),controller['create']);router[_0x83e2('0x11')](_0x83e2('0xc'),auth[_0x83e2('0xa')](),controller[_0x83e2('0x12')]);router['delete'](_0x83e2('0xc'),auth[_0x83e2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xefd2=['express','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xefd2,0x1d7));var _0x2efd=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xefd2[_0x26f702];return _0x11417d;};'use strict';var multer=require(_0x2efd('0x0'));var util=require(_0x2efd('0x1'));var path=require(_0x2efd('0x2'));var timeout=require(_0x2efd('0x3'));var express=require(_0x2efd('0x4'));var router=express['Router']();var fs_extra=require(_0x2efd('0x5'));var auth=require(_0x2efd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2efd('0x7'));router[_0x2efd('0x8')]('/',auth[_0x2efd('0x9')](),controller[_0x2efd('0xa')]);router[_0x2efd('0x8')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller['show']);router['get'](_0x2efd('0xc'),auth[_0x2efd('0x9')](),controller[_0x2efd('0xd')]);router[_0x2efd('0x8')](_0x2efd('0xe'),auth['isAuthenticated'](),controller[_0x2efd('0xf')]);router[_0x2efd('0x8')](_0x2efd('0x10'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x11')]);router[_0x2efd('0x12')]('/',auth[_0x2efd('0x9')](),controller[_0x2efd('0x13')]);router[_0x2efd('0x14')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x15')]);router[_0x2efd('0x16')](_0x2efd('0xb'),auth[_0x2efd('0x9')](),controller[_0x2efd('0x17')]);module[_0x2efd('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 956cd2b..b61dfe8 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x21172c,_0x3a2bf0){var _0x4d8591=function(_0x2fe26c){while(--_0x2fe26c){_0x21172c['push'](_0x21172c['shift']());}};_0x4d8591(++_0x3a2bf0);}(_0xe14b,0x93));var _0xbe14=function(_0xc8ef0e,_0x11d492){_0xc8ef0e=_0xc8ef0e-0x0;var _0x3df0e8=_0xe14b[_0xc8ef0e];return _0x3df0e8;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f12cd65..5b79871 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(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xabce[_0x3ff085];return _0x2b68c3;};'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 _0x687b=['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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0x687b[_0x5ea60d];return _0x1d14eb;};'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'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 104714e..5869774 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 _0xda68=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda68,0xed));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8da6('0x0'));var util=require(_0x8da6('0x1'));var logger=require(_0x8da6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8da6('0x3'));var rp=require(_0x8da6('0x4'));var fs=require('fs');var path=require(_0x8da6('0x5'));var rimraf=require(_0x8da6('0x6'));var config=require(_0x8da6('0x7'));var attributes=require(_0x8da6('0x8'));module[_0x8da6('0x9')]=function(_0x5ab20d,_0x5f6ab7){return _0x5ab20d[_0x8da6('0xa')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaafa=['../../config/environment','exports','define','lodash','../../config/logger','api','moment','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaafa,0x12b));var _0xaaaf=function(_0x1443bb,_0x4453bb){_0x1443bb=_0x1443bb-0x0;var _0x5e3690=_0xaafa[_0x1443bb];return _0x5e3690;};'use strict';var _=require(_0xaaaf('0x0'));var util=require('util');var logger=require(_0xaaaf('0x1'))(_0xaaaf('0x2'));var moment=require(_0xaaaf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaaaf('0x4'));var config=require(_0xaaaf('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0xaaaf('0x6')]=function(_0x127f03,_0x3e49bc){return _0x127f03[_0xaaaf('0x7')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','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 dadff73..74dbbe5 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 _0x0c2f=['error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x0c2f,0xc2));var _0xf0c2=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0x0c2f[_0x4944f1];return _0x433494;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0c2('0x0'));var BPromise=require(_0xf0c2('0x1'));var rs=require(_0xf0c2('0x2'));var fs=require('fs');var Redis=require(_0xf0c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c2('0x5'));var jayson=require(_0xf0c2('0x6'));var client=jayson['client'][_0xf0c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dee19,_0x4812a9,_0x26b099){return new BPromise(function(_0x281c66,_0xdb4f07){return client['request'](_0x5dee19,_0x26b099)[_0xf0c2('0x8')](function(_0x452d9c){logger[_0xf0c2('0x9')](_0xf0c2('0xa'),_0x4812a9,_0xf0c2('0xb'));logger[_0xf0c2('0xc')](_0xf0c2('0xd'),_0x4812a9,_0xf0c2('0xb'),JSON[_0xf0c2('0xe')](_0x452d9c));if(_0x452d9c[_0xf0c2('0xf')]){if(_0x452d9c[_0xf0c2('0xf')][_0xf0c2('0x10')]===0x1f4){logger[_0xf0c2('0xf')](_0xf0c2('0xa'),_0x4812a9,_0x452d9c[_0xf0c2('0xf')][_0xf0c2('0x11')]);return _0xdb4f07(_0x452d9c['error'][_0xf0c2('0x11')]);}logger[_0xf0c2('0xf')](_0xf0c2('0xa'),_0x4812a9,_0x452d9c[_0xf0c2('0xf')][_0xf0c2('0x11')]);return _0x281c66(_0x452d9c[_0xf0c2('0xf')][_0xf0c2('0x11')]);}else{logger['info'](_0xf0c2('0xa'),_0x4812a9,_0xf0c2('0xb'));_0x281c66(_0x452d9c[_0xf0c2('0x12')]['message']);}})['catch'](function(_0x5cba2a){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4812a9,_0x5cba2a);_0xdb4f07(_0x5cba2a);});});} \ No newline at end of file +var _0x3c59=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x3c59,0x8c));var _0x93c5=function(_0x56f722,_0x1c137a){_0x56f722=_0x56f722-0x0;var _0x4b2f67=_0x3c59[_0x56f722];return _0x4b2f67;};'use strict';var _=require(_0x93c5('0x0'));var util=require(_0x93c5('0x1'));var moment=require('moment');var BPromise=require(_0x93c5('0x2'));var rs=require(_0x93c5('0x3'));var fs=require('fs');var Redis=require(_0x93c5('0x4'));var db=require(_0x93c5('0x5'))['db'];var utils=require(_0x93c5('0x6'));var logger=require('../../config/logger')(_0x93c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x93c5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c401d,_0x41627d,_0x2deb94){return new BPromise(function(_0x1aaa12,_0x4098c8){return client[_0x93c5('0x9')](_0x3c401d,_0x2deb94)['then'](function(_0x150241){logger[_0x93c5('0xa')](_0x93c5('0xb'),_0x41627d,_0x93c5('0xc'));logger['debug'](_0x93c5('0xd'),_0x41627d,_0x93c5('0xc'),JSON[_0x93c5('0xe')](_0x150241));if(_0x150241[_0x93c5('0xf')]){if(_0x150241[_0x93c5('0xf')]['code']===0x1f4){logger[_0x93c5('0xf')](_0x93c5('0xb'),_0x41627d,_0x150241[_0x93c5('0xf')][_0x93c5('0x10')]);return _0x4098c8(_0x150241['error'][_0x93c5('0x10')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x41627d,_0x150241[_0x93c5('0xf')]['message']);return _0x1aaa12(_0x150241[_0x93c5('0xf')][_0x93c5('0x10')]);}else{logger[_0x93c5('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x41627d,_0x93c5('0xc'));_0x1aaa12(_0x150241[_0x93c5('0x11')]['message']);}})[_0x93c5('0x12')](function(_0x36f343){logger[_0x93c5('0xf')](_0x93c5('0xb'),_0x41627d,_0x36f343);_0x4098c8(_0x36f343);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0665c4f..271749a 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 _0x24c6=['index','/:id','show','isAuthenticated','preview','/:id/run','/:id/query','query','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get'];(function(_0x2aa6ff,_0xa34cd9){var _0x3c040d=function(_0x2b0283){while(--_0x2b0283){_0x2aa6ff['push'](_0x2aa6ff['shift']());}};_0x3c040d(++_0xa34cd9);}(_0x24c6,0x90));var _0x624c=function(_0xd39c08,_0x5ce055){_0xd39c08=_0xd39c08-0x0;var _0x32d1fb=_0x24c6[_0xd39c08];return _0x32d1fb;};'use strict';var multer=require(_0x624c('0x0'));var util=require(_0x624c('0x1'));var path=require(_0x624c('0x2'));var timeout=require(_0x624c('0x3'));var express=require(_0x624c('0x4'));var router=express[_0x624c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x624c('0x6'));var interaction=require(_0x624c('0x7'));var config=require('../../config/environment');var controller=require(_0x624c('0x8'));router[_0x624c('0x9')]('/',auth['isAuthenticated'](),controller[_0x624c('0xa')]);router['get'](_0x624c('0xb'),auth['isAuthenticated'](),controller[_0x624c('0xc')]);router[_0x624c('0x9')]('/:id/preview',auth[_0x624c('0xd')](),controller[_0x624c('0xe')]);router['get'](_0x624c('0xf'),auth[_0x624c('0xd')](),controller['run']);router[_0x624c('0x9')](_0x624c('0x10'),auth[_0x624c('0xd')](),controller[_0x624c('0x11')]);router[_0x624c('0x12')]('/',auth[_0x624c('0xd')](),controller[_0x624c('0x13')]);router['put'](_0x624c('0xb'),auth[_0x624c('0xd')](),controller['update']);router[_0x624c('0x14')](_0x624c('0xb'),auth['isAuthenticated'](),controller[_0x624c('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2f1c=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f1c,0x68));var _0xc2f1=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x2f1c[_0x4bd06e];return _0x85ebb;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require(_0xc2f1('0x2'));var timeout=require(_0xc2f1('0x3'));var express=require(_0xc2f1('0x4'));var router=express[_0xc2f1('0x5')]();var fs_extra=require(_0xc2f1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2f1('0x7'));var controller=require(_0xc2f1('0x8'));router[_0xc2f1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc2f1('0xa')]);router['get'](_0xc2f1('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc2f1('0xc'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0xe')]);router[_0xc2f1('0x9')](_0xc2f1('0xf'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x10')]);router[_0xc2f1('0x9')](_0xc2f1('0x11'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x12')]);router['post']('/',auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x13')]);router[_0xc2f1('0x14')]('/:id',auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x15')]);router[_0xc2f1('0x16')](_0xc2f1('0xb'),auth[_0xc2f1('0xd')](),controller[_0xc2f1('0x17')]);module[_0xc2f1('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index bd73dab..0602a52 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 _0xc218=['DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x4e90f0,_0x3b7e3c){var _0x1a2cee=function(_0xc0c5f5){while(--_0xc0c5f5){_0x4e90f0['push'](_0x4e90f0['shift']());}};_0x1a2cee(++_0x3b7e3c);}(_0xc218,0x94));var _0x8c21=function(_0x47aa23,_0x53fb49){_0x47aa23=_0x47aa23-0x0;var _0x426742=_0xc218[_0x47aa23];return _0x426742;};'use strict';var Sequelize=require(_0x8c21('0x0'));var moment=require(_0x8c21('0x1'));module[_0x8c21('0x2')]={'name':{'type':Sequelize[_0x8c21('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x8c21('0x4')](_0x8c21('0x5'),_0x8c21('0x6'),_0x8c21('0x7')),'allowNull':![],'defaultValue':_0x8c21('0x5')},'savename':{'type':Sequelize[_0x8c21('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8c21('0x8')]},'endDate':{'type':Sequelize[_0x8c21('0x8')]},'status':{'type':Sequelize[_0x8c21('0x3')],'defaultValue':_0x8c21('0x9')},'type':{'type':Sequelize[_0x8c21('0x4')](_0x8c21('0xa'),_0x8c21('0xb')),'allowNull':![],'defaultValue':_0x8c21('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8c21('0xc')]},'reportType':{'type':Sequelize[_0x8c21('0x3')]}}; \ No newline at end of file +var _0xeace=['STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeace,0x15f));var _0xeeac=function(_0x551a6d,_0x3c731d){_0x551a6d=_0x551a6d-0x0;var _0x566129=_0xeace[_0x551a6d];return _0x566129;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xeeac('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xeeac('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeeac('0x2'),_0xeeac('0x3'),_0xeeac('0x4')),'allowNull':![],'defaultValue':_0xeeac('0x2')},'savename':{'type':Sequelize[_0xeeac('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeeac('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xeeac('0x1')],'defaultValue':_0xeeac('0x6')},'type':{'type':Sequelize[_0xeeac('0x7')](_0xeeac('0x8'),_0xeeac('0x9')),'allowNull':![],'defaultValue':_0xeeac('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xeeac('0xa')]},'reportType':{'type':Sequelize[_0xeeac('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c15291e..f98166d 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 _0xe431=['root','Sequelize','Report\x20not\x20found\x20or\x20empty','server/files/reports','savename','format','basename','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','type','filter','merge','include','findAll','rows','params','includeAll','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','existsSync','join'];(function(_0xfeb26f,_0x53d9a7){var _0x1c43a4=function(_0x3026f2){while(--_0x3026f2){_0xfeb26f['push'](_0xfeb26f['shift']());}};_0x1c43a4(++_0x53d9a7);}(_0xe431,0xcb));var _0x1e43=function(_0x54896e,_0x31c597){_0x54896e=_0x54896e-0x0;var _0x4a8631=_0xe431[_0x54896e];return _0x4a8631;};'use strict';var emlformat=require(_0x1e43('0x0'));var rimraf=require(_0x1e43('0x1'));var zipdir=require(_0x1e43('0x2'));var jsonpatch=require(_0x1e43('0x3'));var rp=require(_0x1e43('0x4'));var moment=require(_0x1e43('0x5'));var BPromise=require(_0x1e43('0x6'));var Mustache=require(_0x1e43('0x7'));var util=require(_0x1e43('0x8'));var path=require(_0x1e43('0x9'));var sox=require(_0x1e43('0xa'));var csv=require('to-csv');var ejs=require(_0x1e43('0xb'));var fs=require('fs');var fs_extra=require(_0x1e43('0xc'));var _=require(_0x1e43('0xd'));var squel=require(_0x1e43('0xe'));var crypto=require(_0x1e43('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1e43('0x10'));var Papa=require(_0x1e43('0x11'));var Redis=require(_0x1e43('0x12'));var authService=require(_0x1e43('0x13'));var qs=require(_0x1e43('0x14'));var as=require(_0x1e43('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1e43('0x16'));var licenseUtil=require(_0x1e43('0x17'));var db=require(_0x1e43('0x18'))['db'];function respondWithStatusCode(_0x255928,_0x38635e){_0x38635e=_0x38635e||0xcc;return function(_0x1eed42){if(_0x1eed42){return _0x255928[_0x1e43('0x19')](_0x38635e);}return _0x255928[_0x1e43('0x1a')](_0x38635e)[_0x1e43('0x1b')]();};}function respondWithResult(_0x3572bb,_0x14bc55){_0x14bc55=_0x14bc55||0xc8;return function(_0x39579f){if(_0x39579f){return _0x3572bb['status'](_0x14bc55)[_0x1e43('0x1c')](_0x39579f);}};}function respondWithFilteredResult(_0x11a8b9,_0x14a4e4){return function(_0x2bfd43){if(_0x2bfd43){var _0x5a3d4e=typeof _0x14a4e4[_0x1e43('0x1d')]===_0x1e43('0x1e')&&typeof _0x14a4e4[_0x1e43('0x1f')]===_0x1e43('0x1e');var _0x261712=_0x2bfd43[_0x1e43('0x20')];var _0x220da8=_0x5a3d4e?0x0:_0x14a4e4[_0x1e43('0x1d')];var _0x3c0b00=_0x5a3d4e?_0x2bfd43[_0x1e43('0x20')]:_0x14a4e4[_0x1e43('0x1d')]+_0x14a4e4[_0x1e43('0x1f')];var _0x1992c5;if(_0x3c0b00>=_0x261712){_0x3c0b00=_0x261712;_0x1992c5=0xc8;}else{_0x1992c5=0xce;}_0x11a8b9['status'](_0x1992c5);return _0x11a8b9[_0x1e43('0x21')](_0x1e43('0x22'),_0x220da8+'-'+_0x3c0b00+'/'+_0x261712)[_0x1e43('0x1c')](_0x2bfd43);}return null;};}function patchUpdates(_0x3a4875){return function(_0x2f997e){try{jsonpatch[_0x1e43('0x23')](_0x2f997e,_0x3a4875,!![]);}catch(_0x4aab5b){return BPromise[_0x1e43('0x24')](_0x4aab5b);}return _0x2f997e[_0x1e43('0x25')]();};}function saveUpdates(_0x49ddae,_0x93dbb6){return function(_0x2ed1df){if(_0x2ed1df){return _0x2ed1df[_0x1e43('0x26')](_0x49ddae)['then'](function(_0x3abfdb){return _0x3abfdb;});}return null;};}function removeEntity(_0x399c75,_0x1434e7){return function(_0x4b0457){if(_0x4b0457){return _0x4b0457[_0x1e43('0x27')]()[_0x1e43('0x28')](function(){var _0x1b0f2f=_0x4b0457[_0x1e43('0x29')]({'plain':!![]});var _0x407c26=_0x1e43('0x2a');return db['UserProfileResource'][_0x1e43('0x27')]({'where':{'type':_0x407c26,'resourceId':_0x1b0f2f['id']}})[_0x1e43('0x28')](function(){return _0x4b0457;});})[_0x1e43('0x28')](function(){_0x399c75[_0x1e43('0x1a')](0xcc)[_0x1e43('0x1b')]();});}};}function handleEntityNotFound(_0x1d7a52,_0x4c17f2){return function(_0x110ea4){if(!_0x110ea4){_0x1d7a52[_0x1e43('0x19')](0x194);}return _0x110ea4;};}function handleError(_0x4f3db8,_0x5787ee){_0x5787ee=_0x5787ee||0x1f4;return function(_0xbc34c7){logger['error'](_0xbc34c7[_0x1e43('0x2b')]);if(_0xbc34c7[_0x1e43('0x2c')]){delete _0xbc34c7[_0x1e43('0x2c')];}_0x4f3db8[_0x1e43('0x1a')](_0x5787ee)['send'](_0xbc34c7);};}exports['index']=function(_0x57d407,_0x20b7ae){var _0x5bdfef={},_0x49e84a={},_0x1dc00b={'count':0x0,'rows':[]};var _0x459e5c=_[_0x1e43('0x2d')](db[_0x1e43('0x2e')][_0x1e43('0x2f')],function(_0x589a33){return{'name':_0x589a33[_0x1e43('0x30')],'type':_0x589a33['type'][_0x1e43('0x31')]};});_0x49e84a[_0x1e43('0x32')]=_[_0x1e43('0x2d')](_0x459e5c,_0x1e43('0x2c'));_0x49e84a[_0x1e43('0x33')]=_[_0x1e43('0x34')](_0x57d407['query']);_0x49e84a[_0x1e43('0x35')]=_[_0x1e43('0x36')](_0x49e84a[_0x1e43('0x32')],_0x49e84a[_0x1e43('0x33')]);_0x5bdfef[_0x1e43('0x37')]=_[_0x1e43('0x36')](_0x49e84a[_0x1e43('0x32')],qs['fields'](_0x57d407[_0x1e43('0x33')][_0x1e43('0x38')]));_0x5bdfef[_0x1e43('0x37')]=_0x5bdfef['attributes'][_0x1e43('0x39')]?_0x5bdfef[_0x1e43('0x37')]:_0x49e84a[_0x1e43('0x32')];if(!_0x57d407[_0x1e43('0x33')][_0x1e43('0x3a')](_0x1e43('0x3b'))){_0x5bdfef[_0x1e43('0x1f')]=qs[_0x1e43('0x1f')](_0x57d407['query'][_0x1e43('0x1f')]);_0x5bdfef[_0x1e43('0x1d')]=qs[_0x1e43('0x1d')](_0x57d407[_0x1e43('0x33')][_0x1e43('0x1d')]);}_0x5bdfef[_0x1e43('0x3c')]=qs['sort'](_0x57d407[_0x1e43('0x33')]['sort']);_0x5bdfef[_0x1e43('0x3d')]=qs['filters'](_[_0x1e43('0x3e')](_0x57d407[_0x1e43('0x33')],_0x49e84a[_0x1e43('0x35')]),_0x459e5c);if(_0x57d407[_0x1e43('0x33')]['filter']){_0x5bdfef[_0x1e43('0x3d')]=_['merge'](_0x5bdfef[_0x1e43('0x3d')],{'$or':_[_0x1e43('0x2d')](_0x459e5c,function(_0x5dd06a){if(_0x5dd06a[_0x1e43('0x3f')]!=='VIRTUAL'){var _0x5be90={};_0x5be90[_0x5dd06a[_0x1e43('0x2c')]]={'$like':'%'+_0x57d407['query'][_0x1e43('0x40')]+'%'};return _0x5be90;}})});}_0x5bdfef=_[_0x1e43('0x41')]({},_0x5bdfef,_0x57d407['options']);var _0x59ffcf={'where':_0x5bdfef[_0x1e43('0x3d')]};return db['AnalyticExtractedReport'][_0x1e43('0x20')](_0x59ffcf)[_0x1e43('0x28')](function(_0x3dfddd){_0x1dc00b['count']=_0x3dfddd;if(_0x57d407[_0x1e43('0x33')]['includeAll']){_0x5bdfef[_0x1e43('0x42')]=[{'all':!![]}];}return db[_0x1e43('0x2e')][_0x1e43('0x43')](_0x5bdfef);})[_0x1e43('0x28')](function(_0x1955b8){_0x1dc00b[_0x1e43('0x44')]=_0x1955b8;return _0x1dc00b;})[_0x1e43('0x28')](respondWithFilteredResult(_0x20b7ae,_0x5bdfef))['catch'](handleError(_0x20b7ae,null));};exports['show']=function(_0x4f9daf,_0x420526){var _0x2c04d8={'raw':!![],'where':{'id':_0x4f9daf[_0x1e43('0x45')]['id']}},_0xb2d11b={};_0xb2d11b[_0x1e43('0x32')]=_[_0x1e43('0x34')](db['AnalyticExtractedReport'][_0x1e43('0x2f')]);_0xb2d11b[_0x1e43('0x33')]=_[_0x1e43('0x34')](_0x4f9daf[_0x1e43('0x33')]);_0xb2d11b[_0x1e43('0x35')]=_[_0x1e43('0x36')](_0xb2d11b['model'],_0xb2d11b[_0x1e43('0x33')]);_0x2c04d8['attributes']=_[_0x1e43('0x36')](_0xb2d11b['model'],qs[_0x1e43('0x38')](_0x4f9daf[_0x1e43('0x33')]['fields']));_0x2c04d8[_0x1e43('0x37')]=_0x2c04d8[_0x1e43('0x37')]['length']?_0x2c04d8[_0x1e43('0x37')]:_0xb2d11b[_0x1e43('0x32')];if(_0x4f9daf['query'][_0x1e43('0x46')]){_0x2c04d8[_0x1e43('0x42')]=[{'all':!![]}];}_0x2c04d8=_[_0x1e43('0x41')]({},_0x2c04d8,_0x4f9daf[_0x1e43('0x47')]);return db['AnalyticExtractedReport']['find'](_0x2c04d8)[_0x1e43('0x28')](handleEntityNotFound(_0x420526,null))[_0x1e43('0x28')](respondWithResult(_0x420526,null))[_0x1e43('0x48')](handleError(_0x420526,null));};exports[_0x1e43('0x49')]=function(_0x3a435f,_0x3fcd45){return db['AnalyticExtractedReport'][_0x1e43('0x49')](_0x3a435f['body'],{})[_0x1e43('0x28')](function(_0x722f70){var _0x52b526=_0x3a435f[_0x1e43('0x4a')][_0x1e43('0x29')]({'plain':!![]});if(!_0x52b526)throw new Error(_0x1e43('0x4b'));if(_0x52b526[_0x1e43('0x4c')]==='user'){var _0x4b18f2=_0x722f70[_0x1e43('0x29')]({'plain':!![]});var _0x5c2061='ExtractedReports';return db[_0x1e43('0x4d')][_0x1e43('0x4e')]({'where':{'name':_0x5c2061,'userProfileId':_0x52b526[_0x1e43('0x4f')]},'raw':!![]})[_0x1e43('0x28')](function(_0x28e950){if(_0x28e950&&_0x28e950[_0x1e43('0x50')]===0x0){return db[_0x1e43('0x51')]['create']({'name':_0x4b18f2['name'],'resourceId':_0x4b18f2['id'],'type':_0x28e950[_0x1e43('0x2c')],'sectionId':_0x28e950['id']},{})[_0x1e43('0x28')](function(){return _0x722f70;});}else{return _0x722f70;}})['catch'](function(_0x56c142){logger[_0x1e43('0x52')](_0x1e43('0x53'),_0x56c142);throw _0x56c142;});}return _0x722f70;})[_0x1e43('0x28')](respondWithResult(_0x3fcd45,0xc9))[_0x1e43('0x48')](handleError(_0x3fcd45,null));};exports['update']=function(_0x586694,_0x45715b){if(_0x586694[_0x1e43('0x54')]['id']){delete _0x586694['body']['id'];}return db[_0x1e43('0x2e')]['find']({'where':{'id':_0x586694[_0x1e43('0x45')]['id']}})[_0x1e43('0x28')](handleEntityNotFound(_0x45715b,null))[_0x1e43('0x28')](saveUpdates(_0x586694[_0x1e43('0x54')],null))[_0x1e43('0x28')](respondWithResult(_0x45715b,null))[_0x1e43('0x48')](handleError(_0x45715b,null));};exports['destroy']=function(_0x2adadc,_0x3b9559){return db[_0x1e43('0x2e')][_0x1e43('0x4e')]({'where':{'id':_0x2adadc[_0x1e43('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b9559,null))[_0x1e43('0x28')](removeEntity(_0x3b9559,null))['catch'](handleError(_0x3b9559,null));};exports[_0x1e43('0x55')]=function(_0x3eae44,_0x5fbf2,_0x33ceb9){return db[_0x1e43('0x2e')][_0x1e43('0x4e')]({'where':{'id':_0x3eae44[_0x1e43('0x45')]['id']},'attributes':[_0x1e43('0x2c'),'basename','savename','output'],'raw':!![]})[_0x1e43('0x28')](handleEntityNotFound(_0x5fbf2,null))[_0x1e43('0x28')](function(_0x235581){if(_0x235581){if(!fs[_0x1e43('0x56')](path[_0x1e43('0x57')](config[_0x1e43('0x58')],'server/files/reports',_0x235581['savename']))){throw new db[(_0x1e43('0x59'))]['ValidationError'](_0x1e43('0x5a'));}if(_0x3eae44[_0x1e43('0x33')]['exists']){return _0x5fbf2['sendStatus'](0xc8);}return _0x5fbf2[_0x1e43('0x55')](path['join'](config[_0x1e43('0x58')],_0x1e43('0x5b'),_0x235581[_0x1e43('0x5c')]),util[_0x1e43('0x5d')]('%s.%s',_0x235581[_0x1e43('0x5e')]||_0x235581[_0x1e43('0x2c')],_0x235581[_0x1e43('0x5f')][_0x1e43('0x60')]()));}})[_0x1e43('0x48')](handleError(_0x5fbf2,null));}; \ No newline at end of file +var _0xd41e=['fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','ExtractedReports','UserProfileResource','then','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','catch','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','exists','format','toLowerCase','eml-format','rimraf'];(function(_0xef6b2f,_0x215ee6){var _0x44b6fb=function(_0x33ff6b){while(--_0x33ff6b){_0xef6b2f['push'](_0xef6b2f['shift']());}};_0x44b6fb(++_0x215ee6);}(_0xd41e,0x115));var _0xed41=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd41e[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xed41('0x0'));var rimraf=require(_0xed41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed41('0x2'));var rp=require(_0xed41('0x3'));var moment=require('moment');var BPromise=require(_0xed41('0x4'));var Mustache=require('mustache');var util=require(_0xed41('0x5'));var path=require('path');var sox=require(_0xed41('0x6'));var csv=require(_0xed41('0x7'));var ejs=require(_0xed41('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed41('0x9'));var squel=require(_0xed41('0xa'));var crypto=require('crypto');var jsforce=require(_0xed41('0xb'));var deskjs=require(_0xed41('0xc'));var toCsv=require(_0xed41('0x7'));var querystring=require(_0xed41('0xd'));var Papa=require(_0xed41('0xe'));var Redis=require(_0xed41('0xf'));var authService=require(_0xed41('0x10'));var qs=require(_0xed41('0x11'));var as=require(_0xed41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed41('0x13'))(_0xed41('0x14'));var utils=require('../../config/utils');var config=require(_0xed41('0x15'));var licenseUtil=require(_0xed41('0x16'));var db=require(_0xed41('0x17'))['db'];function respondWithStatusCode(_0x3731df,_0x112771){_0x112771=_0x112771||0xcc;return function(_0x3f4f41){if(_0x3f4f41){return _0x3731df[_0xed41('0x18')](_0x112771);}return _0x3731df[_0xed41('0x19')](_0x112771)[_0xed41('0x1a')]();};}function respondWithResult(_0x38a7f8,_0x15092e){_0x15092e=_0x15092e||0xc8;return function(_0x1c97fa){if(_0x1c97fa){return _0x38a7f8[_0xed41('0x19')](_0x15092e)[_0xed41('0x1b')](_0x1c97fa);}};}function respondWithFilteredResult(_0x249b1c,_0x49843c){return function(_0x4017c2){if(_0x4017c2){var _0x24917b=typeof _0x49843c[_0xed41('0x1c')]==='undefined'&&typeof _0x49843c[_0xed41('0x1d')]===_0xed41('0x1e');var _0x2d1d55=_0x4017c2[_0xed41('0x1f')];var _0x388b33=_0x24917b?0x0:_0x49843c[_0xed41('0x1c')];var _0x4fe58b=_0x24917b?_0x4017c2[_0xed41('0x1f')]:_0x49843c[_0xed41('0x1c')]+_0x49843c[_0xed41('0x1d')];var _0x486d2c;if(_0x4fe58b>=_0x2d1d55){_0x4fe58b=_0x2d1d55;_0x486d2c=0xc8;}else{_0x486d2c=0xce;}_0x249b1c[_0xed41('0x19')](_0x486d2c);return _0x249b1c[_0xed41('0x20')](_0xed41('0x21'),_0x388b33+'-'+_0x4fe58b+'/'+_0x2d1d55)['json'](_0x4017c2);}return null;};}function patchUpdates(_0x272455){return function(_0x4522dd){try{jsonpatch[_0xed41('0x22')](_0x4522dd,_0x272455,!![]);}catch(_0x585721){return BPromise[_0xed41('0x23')](_0x585721);}return _0x4522dd[_0xed41('0x24')]();};}function saveUpdates(_0x2f4013,_0x4a04f8){return function(_0x586c07){if(_0x586c07){return _0x586c07['update'](_0x2f4013)['then'](function(_0x2df4a4){return _0x2df4a4;});}return null;};}function removeEntity(_0x22abb4,_0xdf5953){return function(_0x30c3b8){if(_0x30c3b8){return _0x30c3b8[_0xed41('0x25')]()['then'](function(){var _0x32ae88=_0x30c3b8[_0xed41('0x26')]({'plain':!![]});var _0x3f2b13=_0xed41('0x27');return db[_0xed41('0x28')][_0xed41('0x25')]({'where':{'type':_0x3f2b13,'resourceId':_0x32ae88['id']}})[_0xed41('0x29')](function(){return _0x30c3b8;});})['then'](function(){_0x22abb4[_0xed41('0x19')](0xcc)[_0xed41('0x1a')]();});}};}function handleEntityNotFound(_0x449cb9,_0x43dcd0){return function(_0x192ecb){if(!_0x192ecb){_0x449cb9['sendStatus'](0x194);}return _0x192ecb;};}function handleError(_0x56467a,_0x4e5eff){_0x4e5eff=_0x4e5eff||0x1f4;return function(_0x3f562c){logger[_0xed41('0x2a')](_0x3f562c[_0xed41('0x2b')]);if(_0x3f562c[_0xed41('0x2c')]){delete _0x3f562c['name'];}_0x56467a[_0xed41('0x19')](_0x4e5eff)[_0xed41('0x2d')](_0x3f562c);};}exports[_0xed41('0x2e')]=function(_0x20f6ea,_0x2e0b90){var _0x14680f={},_0x1fefa3={},_0x156123={'count':0x0,'rows':[]};var _0x209813=_[_0xed41('0x2f')](db[_0xed41('0x30')][_0xed41('0x31')],function(_0x5dc907){return{'name':_0x5dc907[_0xed41('0x32')],'type':_0x5dc907[_0xed41('0x33')][_0xed41('0x34')]};});_0x1fefa3[_0xed41('0x35')]=_[_0xed41('0x2f')](_0x209813,_0xed41('0x2c'));_0x1fefa3[_0xed41('0x36')]=_[_0xed41('0x37')](_0x20f6ea['query']);_0x1fefa3[_0xed41('0x38')]=_[_0xed41('0x39')](_0x1fefa3[_0xed41('0x35')],_0x1fefa3[_0xed41('0x36')]);_0x14680f[_0xed41('0x3a')]=_[_0xed41('0x39')](_0x1fefa3[_0xed41('0x35')],qs[_0xed41('0x3b')](_0x20f6ea['query'][_0xed41('0x3b')]));_0x14680f['attributes']=_0x14680f[_0xed41('0x3a')]['length']?_0x14680f[_0xed41('0x3a')]:_0x1fefa3[_0xed41('0x35')];if(!_0x20f6ea[_0xed41('0x36')][_0xed41('0x3c')]('nolimit')){_0x14680f['limit']=qs[_0xed41('0x1d')](_0x20f6ea[_0xed41('0x36')][_0xed41('0x1d')]);_0x14680f[_0xed41('0x1c')]=qs['offset'](_0x20f6ea[_0xed41('0x36')][_0xed41('0x1c')]);}_0x14680f[_0xed41('0x3d')]=qs[_0xed41('0x3e')](_0x20f6ea[_0xed41('0x36')][_0xed41('0x3e')]);_0x14680f[_0xed41('0x3f')]=qs[_0xed41('0x38')](_[_0xed41('0x40')](_0x20f6ea[_0xed41('0x36')],_0x1fefa3[_0xed41('0x38')]),_0x209813);if(_0x20f6ea[_0xed41('0x36')][_0xed41('0x41')]){_0x14680f[_0xed41('0x3f')]=_[_0xed41('0x42')](_0x14680f[_0xed41('0x3f')],{'$or':_[_0xed41('0x2f')](_0x209813,function(_0x2f34c3){if(_0x2f34c3['type']!=='VIRTUAL'){var _0x3574c0={};_0x3574c0[_0x2f34c3[_0xed41('0x2c')]]={'$like':'%'+_0x20f6ea['query'][_0xed41('0x41')]+'%'};return _0x3574c0;}})});}_0x14680f=_['merge']({},_0x14680f,_0x20f6ea[_0xed41('0x43')]);var _0x2765d5={'where':_0x14680f[_0xed41('0x3f')]};return db[_0xed41('0x30')]['count'](_0x2765d5)['then'](function(_0x5e6bcc){_0x156123[_0xed41('0x1f')]=_0x5e6bcc;if(_0x20f6ea[_0xed41('0x36')]['includeAll']){_0x14680f[_0xed41('0x44')]=[{'all':!![]}];}return db[_0xed41('0x30')]['findAll'](_0x14680f);})['then'](function(_0x31b0d9){_0x156123[_0xed41('0x45')]=_0x31b0d9;return _0x156123;})[_0xed41('0x29')](respondWithFilteredResult(_0x2e0b90,_0x14680f))[_0xed41('0x46')](handleError(_0x2e0b90,null));};exports['show']=function(_0x104942,_0x27f1fc){var _0x559080={'raw':!![],'where':{'id':_0x104942[_0xed41('0x47')]['id']}},_0x870ed1={};_0x870ed1[_0xed41('0x35')]=_[_0xed41('0x37')](db[_0xed41('0x30')][_0xed41('0x31')]);_0x870ed1[_0xed41('0x36')]=_['keys'](_0x104942['query']);_0x870ed1['filters']=_[_0xed41('0x39')](_0x870ed1['model'],_0x870ed1[_0xed41('0x36')]);_0x559080['attributes']=_[_0xed41('0x39')](_0x870ed1[_0xed41('0x35')],qs[_0xed41('0x3b')](_0x104942['query'][_0xed41('0x3b')]));_0x559080[_0xed41('0x3a')]=_0x559080[_0xed41('0x3a')][_0xed41('0x48')]?_0x559080['attributes']:_0x870ed1[_0xed41('0x35')];if(_0x104942['query']['includeAll']){_0x559080['include']=[{'all':!![]}];}_0x559080=_['merge']({},_0x559080,_0x104942[_0xed41('0x43')]);return db[_0xed41('0x30')][_0xed41('0x49')](_0x559080)[_0xed41('0x29')](handleEntityNotFound(_0x27f1fc,null))[_0xed41('0x29')](respondWithResult(_0x27f1fc,null))[_0xed41('0x46')](handleError(_0x27f1fc,null));};exports['create']=function(_0x358eff,_0xacc20d){return db[_0xed41('0x30')]['create'](_0x358eff[_0xed41('0x4a')],{})[_0xed41('0x29')](function(_0x27f38b){var _0x42643e=_0x358eff[_0xed41('0x4b')][_0xed41('0x26')]({'plain':!![]});if(!_0x42643e)throw new Error(_0xed41('0x4c'));if(_0x42643e[_0xed41('0x4d')]===_0xed41('0x4b')){var _0x128311=_0x27f38b['get']({'plain':!![]});var _0xa96186=_0xed41('0x27');return db[_0xed41('0x4e')]['find']({'where':{'name':_0xa96186,'userProfileId':_0x42643e[_0xed41('0x4f')]},'raw':!![]})[_0xed41('0x29')](function(_0x54249b){if(_0x54249b&&_0x54249b[_0xed41('0x50')]===0x0){return db[_0xed41('0x28')][_0xed41('0x51')]({'name':_0x128311[_0xed41('0x2c')],'resourceId':_0x128311['id'],'type':_0x54249b[_0xed41('0x2c')],'sectionId':_0x54249b['id']},{})[_0xed41('0x29')](function(){return _0x27f38b;});}else{return _0x27f38b;}})[_0xed41('0x46')](function(_0x430c7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430c7e);throw _0x430c7e;});}return _0x27f38b;})[_0xed41('0x29')](respondWithResult(_0xacc20d,0xc9))[_0xed41('0x46')](handleError(_0xacc20d,null));};exports['update']=function(_0x3f3560,_0x146c70){if(_0x3f3560[_0xed41('0x4a')]['id']){delete _0x3f3560[_0xed41('0x4a')]['id'];}return db[_0xed41('0x30')][_0xed41('0x49')]({'where':{'id':_0x3f3560[_0xed41('0x47')]['id']}})[_0xed41('0x29')](handleEntityNotFound(_0x146c70,null))[_0xed41('0x29')](saveUpdates(_0x3f3560[_0xed41('0x4a')],null))[_0xed41('0x29')](respondWithResult(_0x146c70,null))[_0xed41('0x46')](handleError(_0x146c70,null));};exports[_0xed41('0x25')]=function(_0x457855,_0x3a898e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x457855[_0xed41('0x47')]['id']}})[_0xed41('0x29')](handleEntityNotFound(_0x3a898e,null))[_0xed41('0x29')](removeEntity(_0x3a898e,null))['catch'](handleError(_0x3a898e,null));};exports['download']=function(_0x293482,_0x12630e,_0x5d2cc6){return db['AnalyticExtractedReport'][_0xed41('0x49')]({'where':{'id':_0x293482[_0xed41('0x47')]['id']},'attributes':[_0xed41('0x2c'),_0xed41('0x52'),'savename',_0xed41('0x53')],'raw':!![]})[_0xed41('0x29')](handleEntityNotFound(_0x12630e,null))[_0xed41('0x29')](function(_0x45b28a){if(_0x45b28a){if(!fs[_0xed41('0x54')](path[_0xed41('0x55')](config[_0xed41('0x56')],_0xed41('0x57'),_0x45b28a[_0xed41('0x58')]))){throw new db['Sequelize'][(_0xed41('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x293482[_0xed41('0x36')][_0xed41('0x5a')]){return _0x12630e[_0xed41('0x18')](0xc8);}return _0x12630e['download'](path['join'](config[_0xed41('0x56')],_0xed41('0x57'),_0x45b28a[_0xed41('0x58')]),util[_0xed41('0x5b')]('%s.%s',_0x45b28a[_0xed41('0x52')]||_0x45b28a['name'],_0x45b28a[_0xed41('0x53')][_0xed41('0x5c')]()));}})['catch'](handleError(_0x12630e,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7e5f3c8..a7f5179 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 _0x6e97=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1a49a7,_0x8e8e1b){var _0x319cb1=function(_0x2f6218){while(--_0x2f6218){_0x1a49a7['push'](_0x1a49a7['shift']());}};_0x319cb1(++_0x8e8e1b);}(_0x6e97,0x117));var _0x76e9=function(_0x138330,_0x119e34){_0x138330=_0x138330-0x0;var _0x24435c=_0x6e97[_0x138330];return _0x24435c;};'use strict';var _=require(_0x76e9('0x0'));var util=require(_0x76e9('0x1'));var logger=require('../../config/logger')(_0x76e9('0x2'));var moment=require(_0x76e9('0x3'));var BPromise=require(_0x76e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x76e9('0x5'));var config=require(_0x76e9('0x6'));var attributes=require(_0x76e9('0x7'));module['exports']=function(_0x1dfbb2,_0x41a5ef){return _0x1dfbb2[_0x76e9('0x8')](_0x76e9('0x9'),attributes,{'tableName':_0x76e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a1=['../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0a1,0x176));var _0x1f0a=function(_0x51e9e4,_0x143651){_0x51e9e4=_0x51e9e4-0x0;var _0x454cd7=_0xf0a1[_0x51e9e4];return _0x454cd7;};'use strict';var _=require('lodash');var util=require(_0x1f0a('0x0'));var logger=require(_0x1f0a('0x1'))(_0x1f0a('0x2'));var moment=require(_0x1f0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f0a('0x4'));var rimraf=require(_0x1f0a('0x5'));var config=require(_0x1f0a('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x1f0a('0x7')]=function(_0x55a86e,_0x210b24){return _0x55a86e[_0x1f0a('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x1f0a('0x9'),'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 3f1f33c..5d2e021 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 _0x7fee=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent'];(function(_0x22c2c9,_0x4ce7bb){var _0x29b7a5=function(_0x4397d5){while(--_0x4397d5){_0x22c2c9['push'](_0x22c2c9['shift']());}};_0x29b7a5(++_0x4ce7bb);}(_0x7fee,0x1a6));var _0xe7fe=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x7fee[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xe7fe('0x0'));var util=require(_0xe7fe('0x1'));var moment=require(_0xe7fe('0x2'));var BPromise=require(_0xe7fe('0x3'));var rs=require(_0xe7fe('0x4'));var fs=require('fs');var Redis=require(_0xe7fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7fe('0x6'));var logger=require(_0xe7fe('0x7'))(_0xe7fe('0x8'));var config=require('../../config/environment');var jayson=require(_0xe7fe('0x9'));var client=jayson['client'][_0xe7fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeca7d9,_0x25a6a4,_0x9b55e8){return new BPromise(function(_0x1f3366,_0xf5e41b){return client[_0xe7fe('0xb')](_0xeca7d9,_0x9b55e8)['then'](function(_0x5b8d3f){logger['info'](_0xe7fe('0xc'),_0x25a6a4,'request\x20sent');logger[_0xe7fe('0xd')](_0xe7fe('0xe'),_0x25a6a4,'request\x20sent',JSON['stringify'](_0x5b8d3f));if(_0x5b8d3f[_0xe7fe('0xf')]){if(_0x5b8d3f[_0xe7fe('0xf')]['code']===0x1f4){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')]['message']);return _0xf5e41b(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}logger[_0xe7fe('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);return _0x1f3366(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}else{logger[_0xe7fe('0x11')](_0xe7fe('0xc'),_0x25a6a4,_0xe7fe('0x12'));_0x1f3366(_0x5b8d3f[_0xe7fe('0x13')][_0xe7fe('0x10')]);}})[_0xe7fe('0x14')](function(_0x3616a6){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x3616a6);_0xf5e41b(_0x3616a6);});});} \ No newline at end of file +var _0xe85b=['request\x20sent','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x33ef9f,_0xd7e50e){var _0x2cf757=function(_0x4a7d1a){while(--_0x4a7d1a){_0x33ef9f['push'](_0x33ef9f['shift']());}};_0x2cf757(++_0xd7e50e);}(_0xe85b,0x6f));var _0xbe85=function(_0xa8a57e,_0x27295c){_0xa8a57e=_0xa8a57e-0x0;var _0x53244c=_0xe85b[_0xa8a57e];return _0x53244c;};'use strict';var _=require(_0xbe85('0x0'));var util=require(_0xbe85('0x1'));var moment=require(_0xbe85('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe85('0x3'));var fs=require('fs');var Redis=require(_0xbe85('0x4'));var db=require(_0xbe85('0x5'))['db'];var utils=require(_0xbe85('0x6'));var logger=require(_0xbe85('0x7'))(_0xbe85('0x8'));var config=require(_0xbe85('0x9'));var jayson=require(_0xbe85('0xa'));var client=jayson['client'][_0xbe85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23d7ec,_0x37846f,_0x424508){return new BPromise(function(_0x298d83,_0x5247ac){return client['request'](_0x23d7ec,_0x424508)['then'](function(_0x18ab9b){logger['info'](_0xbe85('0xc'),_0x37846f,'request\x20sent');logger[_0xbe85('0xd')](_0xbe85('0xe'),_0x37846f,_0xbe85('0xf'),JSON['stringify'](_0x18ab9b));if(_0x18ab9b[_0xbe85('0x10')]){if(_0x18ab9b[_0xbe85('0x10')][_0xbe85('0x11')]===0x1f4){logger['error'](_0xbe85('0xc'),_0x37846f,_0x18ab9b['error']['message']);return _0x5247ac(_0x18ab9b[_0xbe85('0x10')]['message']);}logger['error'](_0xbe85('0xc'),_0x37846f,_0x18ab9b[_0xbe85('0x10')][_0xbe85('0x12')]);return _0x298d83(_0x18ab9b['error'][_0xbe85('0x12')]);}else{logger[_0xbe85('0x13')](_0xbe85('0xc'),_0x37846f,_0xbe85('0xf'));_0x298d83(_0x18ab9b['result'][_0xbe85('0x12')]);}})[_0xbe85('0x14')](function(_0x355c65){logger['error'](_0xbe85('0xc'),_0x37846f,_0x355c65);_0x5247ac(_0x355c65);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d5be89e..7c04502 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 _0x0706=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','put','update','delete','destroy','multer','util','path'];(function(_0x1978fc,_0x398da2){var _0x1da73a=function(_0x8f23c2){while(--_0x8f23c2){_0x1978fc['push'](_0x1978fc['shift']());}};_0x1da73a(++_0x398da2);}(_0x0706,0x123));var _0x6070=function(_0x3d50a3,_0x5279e4){_0x3d50a3=_0x3d50a3-0x0;var _0x449c5b=_0x0706[_0x3d50a3];return _0x449c5b;};'use strict';var multer=require(_0x6070('0x0'));var util=require(_0x6070('0x1'));var path=require(_0x6070('0x2'));var timeout=require(_0x6070('0x3'));var express=require(_0x6070('0x4'));var router=express[_0x6070('0x5')]();var fs_extra=require(_0x6070('0x6'));var auth=require(_0x6070('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6070('0x8'));var controller=require(_0x6070('0x9'));router[_0x6070('0xa')]('/',auth[_0x6070('0xb')](),controller[_0x6070('0xc')]);router[_0x6070('0xa')](_0x6070('0xd'),auth['isAuthenticated'](),controller[_0x6070('0xe')]);router['get'](_0x6070('0xf'),auth[_0x6070('0xb')](),controller[_0x6070('0x10')]);router['post']('/',auth[_0x6070('0xb')](),controller['create']);router[_0x6070('0x11')](_0x6070('0xd'),auth[_0x6070('0xb')](),controller[_0x6070('0x12')]);router[_0x6070('0x13')](_0x6070('0xd'),auth[_0x6070('0xb')](),controller[_0x6070('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbd74=['download','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1cc6c9,_0x1be68d){var _0x22c4e2=function(_0x55f99b){while(--_0x55f99b){_0x1cc6c9['push'](_0x1cc6c9['shift']());}};_0x22c4e2(++_0x1be68d);}(_0xbd74,0x1c0));var _0x4bd7=function(_0x4935f7,_0x3c2772){_0x4935f7=_0x4935f7-0x0;var _0x2831de=_0xbd74[_0x4935f7];return _0x2831de;};'use strict';var multer=require('multer');var util=require(_0x4bd7('0x0'));var path=require(_0x4bd7('0x1'));var timeout=require(_0x4bd7('0x2'));var express=require(_0x4bd7('0x3'));var router=express[_0x4bd7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4bd7('0x5'));var interaction=require(_0x4bd7('0x6'));var config=require(_0x4bd7('0x7'));var controller=require(_0x4bd7('0x8'));router[_0x4bd7('0x9')]('/',auth['isAuthenticated'](),controller[_0x4bd7('0xa')]);router['get'](_0x4bd7('0xb'),auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xd')]);router[_0x4bd7('0x9')]('/:id/download',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xe')]);router['post']('/',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0xf')]);router[_0x4bd7('0x10')](_0x4bd7('0xb'),auth[_0x4bd7('0xc')](),controller[_0x4bd7('0x11')]);router[_0x4bd7('0x12')]('/:id',auth[_0x4bd7('0xc')](),controller[_0x4bd7('0x13')]);module[_0x4bd7('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6cc1680..768f3bf 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 _0x3b6b=['BOOLEAN','STRING'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x3b6b,0x1ef));var _0xb3b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b6b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb3b6('0x0')]},'groupBy':{'type':Sequelize[_0xb3b6('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb3b6('0x0')]},'custom':{'type':Sequelize[_0xb3b6('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x9e82=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x9e82,0xe5));var _0x29e8=function(_0x5bf8e8,_0x1797e3){_0x5bf8e8=_0x5bf8e8-0x0;var _0x397b1e=_0x9e82[_0x5bf8e8];return _0x397b1e;};'use strict';var Sequelize=require(_0x29e8('0x0'));module['exports']={'field':{'type':Sequelize[_0x29e8('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x29e8('0x2')]},'format':{'type':Sequelize[_0x29e8('0x2')]},'groupBy':{'type':Sequelize[_0x29e8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x29e8('0x2')]},'custom':{'type':Sequelize[_0x29e8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 717951a..36d397c 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 _0x208c=['sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','crypto','jsforce','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','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0x208c,0x103));var _0xc208=function(_0x3be389,_0x4d9eef){_0x3be389=_0x3be389-0x0;var _0x309763=_0x208c[_0x3be389];return _0x309763;};'use strict';var emlformat=require(_0xc208('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc208('0x1'));var jsonpatch=require(_0xc208('0x2'));var rp=require(_0xc208('0x3'));var moment=require(_0xc208('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc208('0x5'));var util=require(_0xc208('0x6'));var path=require(_0xc208('0x7'));var sox=require('sox');var csv=require(_0xc208('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc208('0x9'));var crypto=require(_0xc208('0xa'));var jsforce=require(_0xc208('0xb'));var deskjs=require(_0xc208('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc208('0xd'));var Papa=require('papaparse');var Redis=require(_0xc208('0xe'));var authService=require(_0xc208('0xf'));var qs=require(_0xc208('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc208('0x11'));var logger=require(_0xc208('0x12'))(_0xc208('0x13'));var utils=require(_0xc208('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc208('0x15'));var db=require(_0xc208('0x16'))['db'];function respondWithStatusCode(_0xeba457,_0x2f534e){_0x2f534e=_0x2f534e||0xcc;return function(_0x3520f5){if(_0x3520f5){return _0xeba457[_0xc208('0x17')](_0x2f534e);}return _0xeba457[_0xc208('0x18')](_0x2f534e)[_0xc208('0x19')]();};}function respondWithResult(_0x595ef6,_0x4005d7){_0x4005d7=_0x4005d7||0xc8;return function(_0x1a5ffa){if(_0x1a5ffa){return _0x595ef6['status'](_0x4005d7)[_0xc208('0x1a')](_0x1a5ffa);}};}function respondWithFilteredResult(_0x1f9ad2,_0x42f6fc){return function(_0x1293eb){if(_0x1293eb){var _0x1a23b5=typeof _0x42f6fc['offset']===_0xc208('0x1b')&&typeof _0x42f6fc['limit']==='undefined';var _0x35dbde=_0x1293eb[_0xc208('0x1c')];var _0x257194=_0x1a23b5?0x0:_0x42f6fc[_0xc208('0x1d')];var _0x1478b2=_0x1a23b5?_0x1293eb[_0xc208('0x1c')]:_0x42f6fc[_0xc208('0x1d')]+_0x42f6fc[_0xc208('0x1e')];var _0x32dfa5;if(_0x1478b2>=_0x35dbde){_0x1478b2=_0x35dbde;_0x32dfa5=0xc8;}else{_0x32dfa5=0xce;}_0x1f9ad2[_0xc208('0x18')](_0x32dfa5);return _0x1f9ad2['set'](_0xc208('0x1f'),_0x257194+'-'+_0x1478b2+'/'+_0x35dbde)[_0xc208('0x1a')](_0x1293eb);}return null;};}function patchUpdates(_0x1ce291){return function(_0x4d80b9){try{jsonpatch[_0xc208('0x20')](_0x4d80b9,_0x1ce291,!![]);}catch(_0xeb2969){return BPromise[_0xc208('0x21')](_0xeb2969);}return _0x4d80b9[_0xc208('0x22')]();};}function saveUpdates(_0x4b99ee,_0x3ce5e8){return function(_0xd5f3d5){if(_0xd5f3d5){return _0xd5f3d5[_0xc208('0x23')](_0x4b99ee)[_0xc208('0x24')](function(_0x59f37c){return _0x59f37c;});}return null;};}function removeEntity(_0x1766a7,_0x4c7378){return function(_0x478711){if(_0x478711){return _0x478711[_0xc208('0x25')]()['then'](function(){_0x1766a7[_0xc208('0x18')](0xcc)[_0xc208('0x19')]();});}};}function handleEntityNotFound(_0x18bef3,_0x10f1e0){return function(_0x753dac){if(!_0x753dac){_0x18bef3[_0xc208('0x17')](0x194);}return _0x753dac;};}function handleError(_0x40f933,_0x3196d1){_0x3196d1=_0x3196d1||0x1f4;return function(_0x55ff6a){logger[_0xc208('0x26')](_0x55ff6a[_0xc208('0x27')]);if(_0x55ff6a[_0xc208('0x28')]){delete _0x55ff6a[_0xc208('0x28')];}_0x40f933[_0xc208('0x18')](_0x3196d1)[_0xc208('0x29')](_0x55ff6a);};}exports[_0xc208('0x2a')]=function(_0xa42b39,_0x40a5ce){var _0xb0e322={},_0x210a28={},_0x5d8a3c={'count':0x0,'rows':[]};var _0x139edd=_['map'](db[_0xc208('0x2b')][_0xc208('0x2c')],function(_0x45f100){return{'name':_0x45f100[_0xc208('0x2d')],'type':_0x45f100[_0xc208('0x2e')]['key']};});_0x210a28[_0xc208('0x2f')]=_[_0xc208('0x30')](_0x139edd,_0xc208('0x28'));_0x210a28[_0xc208('0x31')]=_[_0xc208('0x32')](_0xa42b39[_0xc208('0x31')]);_0x210a28[_0xc208('0x33')]=_[_0xc208('0x34')](_0x210a28[_0xc208('0x2f')],_0x210a28['query']);_0xb0e322[_0xc208('0x35')]=_[_0xc208('0x34')](_0x210a28[_0xc208('0x2f')],qs[_0xc208('0x36')](_0xa42b39['query'][_0xc208('0x36')]));_0xb0e322[_0xc208('0x35')]=_0xb0e322['attributes']['length']?_0xb0e322[_0xc208('0x35')]:_0x210a28[_0xc208('0x2f')];if(!_0xa42b39[_0xc208('0x31')][_0xc208('0x37')](_0xc208('0x38'))){_0xb0e322[_0xc208('0x1e')]=qs[_0xc208('0x1e')](_0xa42b39[_0xc208('0x31')][_0xc208('0x1e')]);_0xb0e322[_0xc208('0x1d')]=qs[_0xc208('0x1d')](_0xa42b39['query'][_0xc208('0x1d')]);}_0xb0e322['order']=qs[_0xc208('0x39')](_0xa42b39[_0xc208('0x31')][_0xc208('0x39')]);_0xb0e322[_0xc208('0x3a')]=qs[_0xc208('0x33')](_[_0xc208('0x3b')](_0xa42b39[_0xc208('0x31')],_0x210a28[_0xc208('0x33')]),_0x139edd);if(_0xa42b39[_0xc208('0x31')]['filter']){_0xb0e322['where']=_[_0xc208('0x3c')](_0xb0e322['where'],{'$or':_[_0xc208('0x30')](_0x139edd,function(_0x26160d){if(_0x26160d[_0xc208('0x2e')]!=='VIRTUAL'){var _0x452a1a={};_0x452a1a[_0x26160d[_0xc208('0x28')]]={'$like':'%'+_0xa42b39[_0xc208('0x31')][_0xc208('0x3d')]+'%'};return _0x452a1a;}})});}_0xb0e322=_['merge']({},_0xb0e322,_0xa42b39[_0xc208('0x3e')]);var _0x1cf0c4={'where':_0xb0e322[_0xc208('0x3a')]};return db[_0xc208('0x2b')][_0xc208('0x1c')](_0x1cf0c4)[_0xc208('0x24')](function(_0x29e82b){_0x5d8a3c[_0xc208('0x1c')]=_0x29e82b;if(_0xa42b39[_0xc208('0x31')]['includeAll']){_0xb0e322[_0xc208('0x3f')]=[{'all':!![]}];}return db[_0xc208('0x2b')][_0xc208('0x40')](_0xb0e322);})[_0xc208('0x24')](function(_0x257787){_0x5d8a3c[_0xc208('0x41')]=_0x257787;return _0x5d8a3c;})['then'](respondWithFilteredResult(_0x40a5ce,_0xb0e322))[_0xc208('0x42')](handleError(_0x40a5ce,null));};exports[_0xc208('0x43')]=function(_0x3ff1aa,_0x13b7de){var _0x3f2d4e={'raw':![],'where':{'id':_0x3ff1aa[_0xc208('0x44')]['id']}},_0x54116b={};_0x54116b[_0xc208('0x2f')]=_[_0xc208('0x32')](db[_0xc208('0x2b')][_0xc208('0x2c')]);_0x54116b[_0xc208('0x31')]=_[_0xc208('0x32')](_0x3ff1aa['query']);_0x54116b[_0xc208('0x33')]=_[_0xc208('0x34')](_0x54116b[_0xc208('0x2f')],_0x54116b[_0xc208('0x31')]);_0x3f2d4e[_0xc208('0x35')]=_['intersection'](_0x54116b[_0xc208('0x2f')],qs[_0xc208('0x36')](_0x3ff1aa['query'][_0xc208('0x36')]));_0x3f2d4e['attributes']=_0x3f2d4e[_0xc208('0x35')]['length']?_0x3f2d4e['attributes']:_0x54116b[_0xc208('0x2f')];if(_0x3ff1aa[_0xc208('0x31')][_0xc208('0x45')]){_0x3f2d4e[_0xc208('0x3f')]=[{'all':!![]}];}_0x3f2d4e=_['merge']({},_0x3f2d4e,_0x3ff1aa['options']);return db[_0xc208('0x2b')][_0xc208('0x46')](_0x3f2d4e)[_0xc208('0x24')](handleEntityNotFound(_0x13b7de,null))['then'](respondWithResult(_0x13b7de,null))[_0xc208('0x42')](handleError(_0x13b7de,null));};exports[_0xc208('0x47')]=function(_0x1f9e01,_0x2aeeaf){return db['AnalyticFieldReport'][_0xc208('0x47')](_0x1f9e01[_0xc208('0x48')],{})[_0xc208('0x24')](respondWithResult(_0x2aeeaf,0xc9))[_0xc208('0x42')](handleError(_0x2aeeaf,null));};exports[_0xc208('0x49')]=function(_0x126d16,_0x486cb7){return db['AnalyticFieldReport']['bulkCreate'](_0x126d16['body'],{'raw':![],'individualHooks':!![]})[_0xc208('0x24')](respondWithResult(_0x486cb7,0xc9))['catch'](handleError(_0x486cb7,null));};exports[_0xc208('0x23')]=function(_0x6174a5,_0x46ecfa){if(_0x6174a5['body']['id']){delete _0x6174a5[_0xc208('0x48')]['id'];}return db['AnalyticFieldReport'][_0xc208('0x46')]({'where':{'id':_0x6174a5[_0xc208('0x44')]['id']}})[_0xc208('0x24')](handleEntityNotFound(_0x46ecfa,null))[_0xc208('0x24')](saveUpdates(_0x6174a5[_0xc208('0x48')],null))[_0xc208('0x24')](respondWithResult(_0x46ecfa,null))[_0xc208('0x42')](handleError(_0x46ecfa,null));};exports[_0xc208('0x25')]=function(_0x46e69d,_0x569635){return db[_0xc208('0x2b')][_0xc208('0x46')]({'where':{'id':_0x46e69d[_0xc208('0x44')]['id']}})['then'](handleEntityNotFound(_0x569635,null))[_0xc208('0x24')](removeEntity(_0x569635,null))[_0xc208('0x42')](handleError(_0x569635,null));};exports[_0xc208('0x4a')]=function(_0x1198f3,_0x44b76f){return db[_0xc208('0x2b')][_0xc208('0x25')]({'where':{'id':_0x1198f3[_0xc208('0x31')][_0xc208('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xc208('0x24')](respondWithResult(_0x44b76f,0xcc))['catch'](handleError(_0x44b76f,null));};exports[_0xc208('0x4c')]=function(_0x206542,_0x41ef3c,_0x90c930){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x206542[_0xc208('0x44')]['id']}})[_0xc208('0x24')](handleEntityNotFound(_0x41ef3c,null))['then'](function(_0x12c437){if(_0x12c437){return db[_0xc208('0x4d')]['transaction'](function(_0x1dfd7d){return db[_0xc208('0x2b')][_0xc208('0x25')]({'where':{'CustomReportId':_0x206542[_0xc208('0x44')]['id']},'transaction':_0x1dfd7d})[_0xc208('0x24')](function(_0x28bf51){var _0x334731=_[_0xc208('0x30')](_0x206542['body'],function(_0x3c113c){delete _0x3c113c['id'];_0x3c113c[_0xc208('0x4e')]=_0x206542['params']['id'];return _0x3c113c;});return db[_0xc208('0x2b')]['bulkCreate'](_0x334731,{'transaction':_0x1dfd7d});});})[_0xc208('0x24')](function(){return db[_0xc208('0x2b')][_0xc208('0x40')]({'where':{'CustomReportId':_0x206542[_0xc208('0x44')]['id']}});});}})['then'](respondWithResult(_0x41ef3c,null))[_0xc208('0x42')](handleError(_0x41ef3c,null));}; \ No newline at end of file +var _0xa386=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','params','length','find','create','body','update','ids','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0xa386,0x1dd));var _0x6a38=function(_0x4309d9,_0x5b0b57){_0x4309d9=_0x4309d9-0x0;var _0x1af166=_0xa386[_0x4309d9];return _0x1af166;};'use strict';var emlformat=require(_0x6a38('0x0'));var rimraf=require(_0x6a38('0x1'));var zipdir=require(_0x6a38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a38('0x3'));var moment=require(_0x6a38('0x4'));var BPromise=require(_0x6a38('0x5'));var Mustache=require(_0x6a38('0x6'));var util=require('util');var path=require(_0x6a38('0x7'));var sox=require(_0x6a38('0x8'));var csv=require(_0x6a38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a38('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a38('0xb'));var jsforce=require(_0x6a38('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a38('0x9'));var querystring=require(_0x6a38('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a38('0xe'));var authService=require(_0x6a38('0xf'));var qs=require(_0x6a38('0x10'));var as=require(_0x6a38('0x11'));var hardwareService=require(_0x6a38('0x12'));var logger=require(_0x6a38('0x13'))(_0x6a38('0x14'));var utils=require(_0x6a38('0x15'));var config=require(_0x6a38('0x16'));var licenseUtil=require(_0x6a38('0x17'));var db=require(_0x6a38('0x18'))['db'];function respondWithStatusCode(_0x2d1ca0,_0x428a45){_0x428a45=_0x428a45||0xcc;return function(_0x109612){if(_0x109612){return _0x2d1ca0['sendStatus'](_0x428a45);}return _0x2d1ca0['status'](_0x428a45)[_0x6a38('0x19')]();};}function respondWithResult(_0x1b7af6,_0x4470e2){_0x4470e2=_0x4470e2||0xc8;return function(_0x49c6f7){if(_0x49c6f7){return _0x1b7af6[_0x6a38('0x1a')](_0x4470e2)['json'](_0x49c6f7);}};}function respondWithFilteredResult(_0x3feb58,_0xdfff10){return function(_0x20377d){if(_0x20377d){var _0x3e1661=typeof _0xdfff10[_0x6a38('0x1b')]===_0x6a38('0x1c')&&typeof _0xdfff10['limit']==='undefined';var _0x510f71=_0x20377d[_0x6a38('0x1d')];var _0x21c000=_0x3e1661?0x0:_0xdfff10[_0x6a38('0x1b')];var _0x473c63=_0x3e1661?_0x20377d[_0x6a38('0x1d')]:_0xdfff10[_0x6a38('0x1b')]+_0xdfff10[_0x6a38('0x1e')];var _0x8e6e8f;if(_0x473c63>=_0x510f71){_0x473c63=_0x510f71;_0x8e6e8f=0xc8;}else{_0x8e6e8f=0xce;}_0x3feb58[_0x6a38('0x1a')](_0x8e6e8f);return _0x3feb58[_0x6a38('0x1f')](_0x6a38('0x20'),_0x21c000+'-'+_0x473c63+'/'+_0x510f71)['json'](_0x20377d);}return null;};}function patchUpdates(_0x53a6e9){return function(_0xe7e39e){try{jsonpatch[_0x6a38('0x21')](_0xe7e39e,_0x53a6e9,!![]);}catch(_0x2dca50){return BPromise[_0x6a38('0x22')](_0x2dca50);}return _0xe7e39e[_0x6a38('0x23')]();};}function saveUpdates(_0x28b7c1,_0x3da6f8){return function(_0x1bf10d){if(_0x1bf10d){return _0x1bf10d['update'](_0x28b7c1)[_0x6a38('0x24')](function(_0x2350de){return _0x2350de;});}return null;};}function removeEntity(_0x15f023,_0x4afa8f){return function(_0x3272a3){if(_0x3272a3){return _0x3272a3[_0x6a38('0x25')]()['then'](function(){_0x15f023[_0x6a38('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b478,_0x3c58b3){return function(_0x40f31e){if(!_0x40f31e){_0x14b478[_0x6a38('0x26')](0x194);}return _0x40f31e;};}function handleError(_0x248f3c,_0x24566b){_0x24566b=_0x24566b||0x1f4;return function(_0xfe890c){logger[_0x6a38('0x27')](_0xfe890c[_0x6a38('0x28')]);if(_0xfe890c[_0x6a38('0x29')]){delete _0xfe890c['name'];}_0x248f3c[_0x6a38('0x1a')](_0x24566b)[_0x6a38('0x2a')](_0xfe890c);};}exports[_0x6a38('0x2b')]=function(_0x2cf69c,_0x3244c3){var _0x50cdbb={},_0x5d3227={},_0x1e4407={'count':0x0,'rows':[]};var _0x5695ab=_[_0x6a38('0x2c')](db['AnalyticFieldReport'][_0x6a38('0x2d')],function(_0x36ab77){return{'name':_0x36ab77['fieldName'],'type':_0x36ab77[_0x6a38('0x2e')][_0x6a38('0x2f')]};});_0x5d3227[_0x6a38('0x30')]=_[_0x6a38('0x2c')](_0x5695ab,_0x6a38('0x29'));_0x5d3227[_0x6a38('0x31')]=_[_0x6a38('0x32')](_0x2cf69c[_0x6a38('0x31')]);_0x5d3227[_0x6a38('0x33')]=_['intersection'](_0x5d3227[_0x6a38('0x30')],_0x5d3227[_0x6a38('0x31')]);_0x50cdbb[_0x6a38('0x34')]=_[_0x6a38('0x35')](_0x5d3227[_0x6a38('0x30')],qs[_0x6a38('0x36')](_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x36')]));_0x50cdbb[_0x6a38('0x34')]=_0x50cdbb[_0x6a38('0x34')]['length']?_0x50cdbb[_0x6a38('0x34')]:_0x5d3227[_0x6a38('0x30')];if(!_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x37')](_0x6a38('0x38'))){_0x50cdbb[_0x6a38('0x1e')]=qs[_0x6a38('0x1e')](_0x2cf69c['query'][_0x6a38('0x1e')]);_0x50cdbb[_0x6a38('0x1b')]=qs['offset'](_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x1b')]);}_0x50cdbb[_0x6a38('0x39')]=qs[_0x6a38('0x3a')](_0x2cf69c['query'][_0x6a38('0x3a')]);_0x50cdbb[_0x6a38('0x3b')]=qs['filters'](_[_0x6a38('0x3c')](_0x2cf69c[_0x6a38('0x31')],_0x5d3227[_0x6a38('0x33')]),_0x5695ab);if(_0x2cf69c['query']['filter']){_0x50cdbb[_0x6a38('0x3b')]=_[_0x6a38('0x3d')](_0x50cdbb[_0x6a38('0x3b')],{'$or':_[_0x6a38('0x2c')](_0x5695ab,function(_0x1c7d49){if(_0x1c7d49[_0x6a38('0x2e')]!==_0x6a38('0x3e')){var _0x13bf6c={};_0x13bf6c[_0x1c7d49[_0x6a38('0x29')]]={'$like':'%'+_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x3f')]+'%'};return _0x13bf6c;}})});}_0x50cdbb=_[_0x6a38('0x3d')]({},_0x50cdbb,_0x2cf69c[_0x6a38('0x40')]);var _0x19b3eb={'where':_0x50cdbb['where']};return db['AnalyticFieldReport'][_0x6a38('0x1d')](_0x19b3eb)[_0x6a38('0x24')](function(_0x29dbc6){_0x1e4407[_0x6a38('0x1d')]=_0x29dbc6;if(_0x2cf69c[_0x6a38('0x31')][_0x6a38('0x41')]){_0x50cdbb[_0x6a38('0x42')]=[{'all':!![]}];}return db[_0x6a38('0x43')][_0x6a38('0x44')](_0x50cdbb);})[_0x6a38('0x24')](function(_0x34fdb9){_0x1e4407[_0x6a38('0x45')]=_0x34fdb9;return _0x1e4407;})[_0x6a38('0x24')](respondWithFilteredResult(_0x3244c3,_0x50cdbb))[_0x6a38('0x46')](handleError(_0x3244c3,null));};exports[_0x6a38('0x47')]=function(_0xdcf0a,_0x3aecfd){var _0x11ae5a={'raw':![],'where':{'id':_0xdcf0a[_0x6a38('0x48')]['id']}},_0x5c2ddf={};_0x5c2ddf[_0x6a38('0x30')]=_['keys'](db[_0x6a38('0x43')][_0x6a38('0x2d')]);_0x5c2ddf[_0x6a38('0x31')]=_[_0x6a38('0x32')](_0xdcf0a['query']);_0x5c2ddf[_0x6a38('0x33')]=_['intersection'](_0x5c2ddf[_0x6a38('0x30')],_0x5c2ddf['query']);_0x11ae5a['attributes']=_[_0x6a38('0x35')](_0x5c2ddf['model'],qs[_0x6a38('0x36')](_0xdcf0a[_0x6a38('0x31')]['fields']));_0x11ae5a['attributes']=_0x11ae5a[_0x6a38('0x34')][_0x6a38('0x49')]?_0x11ae5a[_0x6a38('0x34')]:_0x5c2ddf[_0x6a38('0x30')];if(_0xdcf0a[_0x6a38('0x31')][_0x6a38('0x41')]){_0x11ae5a['include']=[{'all':!![]}];}_0x11ae5a=_[_0x6a38('0x3d')]({},_0x11ae5a,_0xdcf0a[_0x6a38('0x40')]);return db[_0x6a38('0x43')][_0x6a38('0x4a')](_0x11ae5a)[_0x6a38('0x24')](handleEntityNotFound(_0x3aecfd,null))[_0x6a38('0x24')](respondWithResult(_0x3aecfd,null))[_0x6a38('0x46')](handleError(_0x3aecfd,null));};exports['create']=function(_0x310552,_0x30442d){return db['AnalyticFieldReport'][_0x6a38('0x4b')](_0x310552[_0x6a38('0x4c')],{})[_0x6a38('0x24')](respondWithResult(_0x30442d,0xc9))['catch'](handleError(_0x30442d,null));};exports['bulkCreate']=function(_0x5b33a3,_0x430c08){return db[_0x6a38('0x43')]['bulkCreate'](_0x5b33a3[_0x6a38('0x4c')],{'raw':![],'individualHooks':!![]})[_0x6a38('0x24')](respondWithResult(_0x430c08,0xc9))[_0x6a38('0x46')](handleError(_0x430c08,null));};exports[_0x6a38('0x4d')]=function(_0x3aca5c,_0x579121){if(_0x3aca5c[_0x6a38('0x4c')]['id']){delete _0x3aca5c[_0x6a38('0x4c')]['id'];}return db[_0x6a38('0x43')][_0x6a38('0x4a')]({'where':{'id':_0x3aca5c[_0x6a38('0x48')]['id']}})[_0x6a38('0x24')](handleEntityNotFound(_0x579121,null))[_0x6a38('0x24')](saveUpdates(_0x3aca5c['body'],null))['then'](respondWithResult(_0x579121,null))[_0x6a38('0x46')](handleError(_0x579121,null));};exports['destroy']=function(_0x18f131,_0x191f6e){return db['AnalyticFieldReport'][_0x6a38('0x4a')]({'where':{'id':_0x18f131[_0x6a38('0x48')]['id']}})['then'](handleEntityNotFound(_0x191f6e,null))[_0x6a38('0x24')](removeEntity(_0x191f6e,null))['catch'](handleError(_0x191f6e,null));};exports['bulkDestroy']=function(_0x2abb91,_0x53a392){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x2abb91[_0x6a38('0x31')][_0x6a38('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x6a38('0x24')](respondWithResult(_0x53a392,0xcc))[_0x6a38('0x46')](handleError(_0x53a392,null));};exports['addFields']=function(_0x490397,_0x428b6a,_0x5978a0){return db['AnalyticCustomReport'][_0x6a38('0x4f')]({'where':{'id':_0x490397['params']['id']}})['then'](handleEntityNotFound(_0x428b6a,null))[_0x6a38('0x24')](function(_0x1c4670){if(_0x1c4670){return db[_0x6a38('0x50')][_0x6a38('0x51')](function(_0x352a03){return db[_0x6a38('0x43')][_0x6a38('0x25')]({'where':{'CustomReportId':_0x490397['params']['id']},'transaction':_0x352a03})[_0x6a38('0x24')](function(_0xac9aaa){var _0x5c8555=_['map'](_0x490397[_0x6a38('0x4c')],function(_0x449aa5){delete _0x449aa5['id'];_0x449aa5['CustomReportId']=_0x490397['params']['id'];return _0x449aa5;});return db[_0x6a38('0x43')][_0x6a38('0x52')](_0x5c8555,{'transaction':_0x352a03});});})[_0x6a38('0x24')](function(){return db[_0x6a38('0x43')][_0x6a38('0x44')]({'where':{'CustomReportId':_0x490397[_0x6a38('0x48')]['id']}});});}})['then'](respondWithResult(_0x428b6a,null))[_0x6a38('0x46')](handleError(_0x428b6a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ce057d6..6843033 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 _0xcfba=['analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport'];(function(_0x59c703,_0xd196b8){var _0x45ca3f=function(_0x4924a4){while(--_0x4924a4){_0x59c703['push'](_0x59c703['shift']());}};_0x45ca3f(++_0xd196b8);}(_0xcfba,0x6f));var _0xacfb=function(_0x305e7c,_0x598a67){_0x305e7c=_0x305e7c-0x0;var _0x23a4e4=_0xcfba[_0x305e7c];return _0x23a4e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xacfb('0x0'))(_0xacfb('0x1'));var moment=require(_0xacfb('0x2'));var BPromise=require(_0xacfb('0x3'));var rp=require(_0xacfb('0x4'));var fs=require('fs');var path=require(_0xacfb('0x5'));var rimraf=require('rimraf');var config=require(_0xacfb('0x6'));var attributes=require(_0xacfb('0x7'));module['exports']=function(_0x1cc74c,_0x238456){return _0x1cc74c['define'](_0xacfb('0x8'),attributes,{'tableName':_0xacfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73bf=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','path'];(function(_0x406c07,_0x188e1b){var _0x38722c=function(_0x2ab052){while(--_0x2ab052){_0x406c07['push'](_0x406c07['shift']());}};_0x38722c(++_0x188e1b);}(_0x73bf,0x181));var _0xf73b=function(_0x1833dc,_0x121d9d){_0x1833dc=_0x1833dc-0x0;var _0x77da96=_0x73bf[_0x1833dc];return _0x77da96;};'use strict';var _=require(_0xf73b('0x0'));var util=require(_0xf73b('0x1'));var logger=require(_0xf73b('0x2'))(_0xf73b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf73b('0x4'));var rimraf=require('rimraf');var config=require(_0xf73b('0x5'));var attributes=require(_0xf73b('0x6'));module['exports']=function(_0x29ce09,_0x29fbdc){return _0x29ce09[_0xf73b('0x7')](_0xf73b('0x8'),attributes,{'tableName':_0xf73b('0x9'),'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 ddc9629..787cbd5 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 _0x86a0=['http','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d69a4,_0x32935e){var _0xe0705b=function(_0x2a9344){while(--_0x2a9344){_0x2d69a4['push'](_0x2d69a4['shift']());}};_0xe0705b(++_0x32935e);}(_0x86a0,0x91));var _0x086a=function(_0x6d97f7,_0x30f226){_0x6d97f7=_0x6d97f7-0x0;var _0x473049=_0x86a0[_0x6d97f7];return _0x473049;};'use strict';var _=require('lodash');var util=require(_0x086a('0x0'));var moment=require(_0x086a('0x1'));var BPromise=require(_0x086a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x086a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x086a('0x4'));var logger=require(_0x086a('0x5'))(_0x086a('0x6'));var config=require(_0x086a('0x7'));var jayson=require(_0x086a('0x8'));var client=jayson['client'][_0x086a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d2a61,_0x3720cb,_0x359dac){return new BPromise(function(_0x1fa2f0,_0x4e9091){return client[_0x086a('0xa')](_0x2d2a61,_0x359dac)[_0x086a('0xb')](function(_0x2acd67){logger[_0x086a('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3720cb,'request\x20sent');logger[_0x086a('0xd')](_0x086a('0xe'),_0x3720cb,_0x086a('0xf'),JSON['stringify'](_0x2acd67));if(_0x2acd67[_0x086a('0x10')]){if(_0x2acd67[_0x086a('0x10')][_0x086a('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3720cb,_0x2acd67['error'][_0x086a('0x12')]);return _0x4e9091(_0x2acd67[_0x086a('0x10')][_0x086a('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3720cb,_0x2acd67[_0x086a('0x10')][_0x086a('0x12')]);return _0x1fa2f0(_0x2acd67[_0x086a('0x10')]['message']);}else{logger[_0x086a('0xc')](_0x086a('0x13'),_0x3720cb,'request\x20sent');_0x1fa2f0(_0x2acd67[_0x086a('0x14')][_0x086a('0x12')]);}})[_0x086a('0x15')](function(_0x484d7e){logger[_0x086a('0x10')](_0x086a('0x13'),_0x3720cb,_0x484d7e);_0x4e9091(_0x484d7e);});});} \ No newline at end of file +var _0x4050=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x3b3489,_0x1da252){var _0x2a70a3=function(_0x144433){while(--_0x144433){_0x3b3489['push'](_0x3b3489['shift']());}};_0x2a70a3(++_0x1da252);}(_0x4050,0x1a1));var _0x0405=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x4050[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0405('0x0'));var util=require(_0x0405('0x1'));var moment=require('moment');var BPromise=require(_0x0405('0x2'));var rs=require(_0x0405('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0405('0x4'));var logger=require(_0x0405('0x5'))(_0x0405('0x6'));var config=require('../../config/environment');var jayson=require(_0x0405('0x7'));var client=jayson[_0x0405('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7ed1,_0x312bfb,_0x59e59c){return new BPromise(function(_0x18f71c,_0x5e36c6){return client[_0x0405('0x9')](_0x2e7ed1,_0x59e59c)[_0x0405('0xa')](function(_0x1b0d0d){logger[_0x0405('0xb')](_0x0405('0xc'),_0x312bfb,_0x0405('0xd'));logger[_0x0405('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x312bfb,_0x0405('0xd'),JSON[_0x0405('0xf')](_0x1b0d0d));if(_0x1b0d0d[_0x0405('0x10')]){if(_0x1b0d0d['error']['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x312bfb,_0x1b0d0d['error'][_0x0405('0x11')]);return _0x5e36c6(_0x1b0d0d[_0x0405('0x10')]['message']);}logger[_0x0405('0x10')](_0x0405('0xc'),_0x312bfb,_0x1b0d0d[_0x0405('0x10')][_0x0405('0x11')]);return _0x18f71c(_0x1b0d0d[_0x0405('0x10')][_0x0405('0x11')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x312bfb,_0x0405('0xd'));_0x18f71c(_0x1b0d0d[_0x0405('0x12')]['message']);}})[_0x0405('0x13')](function(_0x547b91){logger[_0x0405('0x10')](_0x0405('0xc'),_0x312bfb,_0x547b91);_0x5e36c6(_0x547b91);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e612065..51e01f4 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(_0x4ff7b9,_0x44b182){var _0x307b5e=function(_0x5a7fcc){while(--_0x5a7fcc){_0x4ff7b9['push'](_0x4ff7b9['shift']());}};_0x307b5e(++_0x44b182);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0xfa531c,_0x98e69e){var _0x2eef5a=function(_0x59114b){while(--_0x59114b){_0xfa531c['push'](_0xfa531c['shift']());}};_0x2eef5a(++_0x98e69e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 cf59269..1db5f86 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 _0x3c81=['name','STRING','sequelize','exports'];(function(_0xe08aff,_0x3b55ff){var _0x4ab3df=function(_0x5c6301){while(--_0x5c6301){_0xe08aff['push'](_0xe08aff['shift']());}};_0x4ab3df(++_0x3b55ff);}(_0x3c81,0x102));var _0x13c8=function(_0x28f317,_0x44cf09){_0x28f317=_0x28f317-0x0;var _0x27b7f3=_0x3c81[_0x28f317];return _0x27b7f3;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x13c8('0x2')},'table':{'type':Sequelize[_0x13c8('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9bb4=['STRING','name','TEXT','sequelize','exports'];(function(_0x18ce30,_0x437d06){var _0x4471a3=function(_0x403a4a){while(--_0x403a4a){_0x18ce30['push'](_0x18ce30['shift']());}};_0x4471a3(++_0x437d06);}(_0x9bb4,0xd5));var _0x49bb=function(_0x1b06c8,_0x189e88){_0x1b06c8=_0x1b06c8-0x0;var _0x3977c1=_0x9bb4[_0x1b06c8];return _0x3977c1;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'name':{'type':Sequelize[_0x49bb('0x2')],'allowNull':![],'unique':_0x49bb('0x3')},'table':{'type':Sequelize[_0x49bb('0x2')]},'metric':{'type':Sequelize[_0x49bb('0x4')]},'description':{'type':Sequelize[_0x49bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0445871..7890c02 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x50b53a,_0x50f7bc){var _0x116765=function(_0x7bbdc){while(--_0x7bbdc){_0x50b53a['push'](_0x50b53a['shift']());}};_0x116765(++_0x50f7bc);}(_0x55ca,0x126));var _0xa55c=function(_0x2adf4,_0x5df6de){_0x2adf4=_0x2adf4-0x0;var _0x45d47d=_0x55ca[_0x2adf4];return _0x45d47d;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x84ab,0x12f));var _0xb84a=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x84ab[_0x234ae1];return _0x227ba0;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ce1c326..035f562 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 _0x99a0=['analytics_metrics','lodash','util','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x99a0,0x121));var _0x099a=function(_0x24cc35,_0x41eb06){_0x24cc35=_0x24cc35-0x0;var _0xce1e84=_0x99a0[_0x24cc35];return _0xce1e84;};'use strict';var _=require(_0x099a('0x0'));var util=require(_0x099a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x099a('0x2'));var fs=require('fs');var path=require(_0x099a('0x3'));var rimraf=require('rimraf');var config=require(_0x099a('0x4'));var attributes=require(_0x099a('0x5'));module[_0x099a('0x6')]=function(_0x215a07,_0x2f1aea){return _0x215a07[_0x099a('0x7')]('AnalyticMetric',attributes,{'tableName':_0x099a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x236d=['lodash','util','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var logger=require('../../config/logger')(_0xd236('0x2'));var moment=require('moment');var BPromise=require(_0xd236('0x3'));var rp=require(_0xd236('0x4'));var fs=require('fs');var path=require(_0xd236('0x5'));var rimraf=require(_0xd236('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xd236('0x7')]=function(_0x29a67c,_0x75d84c){return _0x29a67c[_0xd236('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 6f2ff5a..854e90b 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 _0x83c5=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','debug'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x83c5,0x197));var _0x583c=function(_0x47b6b0,_0x47afce){_0x47b6b0=_0x47b6b0-0x0;var _0x3a9bf5=_0x83c5[_0x47b6b0];return _0x3a9bf5;};'use strict';var _=require(_0x583c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x583c('0x1'))['db'];var utils=require(_0x583c('0x2'));var logger=require(_0x583c('0x3'))(_0x583c('0x4'));var config=require('../../config/environment');var jayson=require(_0x583c('0x5'));var client=jayson[_0x583c('0x6')][_0x583c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b6139,_0x5a877d,_0x1e5890){return new BPromise(function(_0x2018bc,_0x111339){return client[_0x583c('0x8')](_0x2b6139,_0x1e5890)['then'](function(_0x232217){logger[_0x583c('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x5a877d,'request\x20sent');logger[_0x583c('0xa')](_0x583c('0xb'),_0x5a877d,_0x583c('0xc'),JSON[_0x583c('0xd')](_0x232217));if(_0x232217['error']){if(_0x232217[_0x583c('0xe')]['code']===0x1f4){logger[_0x583c('0xe')](_0x583c('0xf'),_0x5a877d,_0x232217[_0x583c('0xe')][_0x583c('0x10')]);return _0x111339(_0x232217[_0x583c('0xe')][_0x583c('0x10')]);}logger[_0x583c('0xe')](_0x583c('0xf'),_0x5a877d,_0x232217[_0x583c('0xe')][_0x583c('0x10')]);return _0x2018bc(_0x232217[_0x583c('0xe')][_0x583c('0x10')]);}else{logger[_0x583c('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x5a877d,_0x583c('0xc'));_0x2018bc(_0x232217[_0x583c('0x11')]['message']);}})[_0x583c('0x12')](function(_0x1048f0){logger[_0x583c('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x5a877d,_0x1048f0);_0x111339(_0x1048f0);});});} \ No newline at end of file +var _0x471b=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request\x20sent'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x471b,0x1d1));var _0xb471=function(_0x98f837,_0x4468f2){_0x98f837=_0x98f837-0x0;var _0xee1d27=_0x471b[_0x98f837];return _0xee1d27;};'use strict';var _=require('lodash');var util=require(_0xb471('0x0'));var moment=require(_0xb471('0x1'));var BPromise=require('bluebird');var rs=require(_0xb471('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb471('0x3'))['db'];var utils=require(_0xb471('0x4'));var logger=require('../../config/logger')(_0xb471('0x5'));var config=require('../../config/environment');var jayson=require(_0xb471('0x6'));var client=jayson[_0xb471('0x7')][_0xb471('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2019a1,_0x4db57d,_0xd306e7){return new BPromise(function(_0x1b4b1a,_0x2007c5){return client['request'](_0x2019a1,_0xd306e7)['then'](function(_0x4fce70){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4db57d,_0xb471('0x9'));logger['debug'](_0xb471('0xa'),_0x4db57d,'request\x20sent',JSON[_0xb471('0xb')](_0x4fce70));if(_0x4fce70[_0xb471('0xc')]){if(_0x4fce70[_0xb471('0xc')][_0xb471('0xd')]===0x1f4){logger[_0xb471('0xc')](_0xb471('0xe'),_0x4db57d,_0x4fce70['error'][_0xb471('0xf')]);return _0x2007c5(_0x4fce70[_0xb471('0xc')]['message']);}logger['error'](_0xb471('0xe'),_0x4db57d,_0x4fce70[_0xb471('0xc')]['message']);return _0x1b4b1a(_0x4fce70[_0xb471('0xc')][_0xb471('0xf')]);}else{logger[_0xb471('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4db57d,_0xb471('0x9'));_0x1b4b1a(_0x4fce70[_0xb471('0x11')]['message']);}})[_0xb471('0x12')](function(_0x13a03a){logger[_0xb471('0xc')](_0xb471('0xe'),_0x4db57d,_0x13a03a);_0x2007c5(_0x13a03a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index aa2192d..39e16d6 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 _0x032e=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x12cdc6,_0x5c8793){var _0x3045c1=function(_0x3b3a85){while(--_0x3b3a85){_0x12cdc6['push'](_0x12cdc6['shift']());}};_0x3045c1(++_0x5c8793);}(_0x032e,0x124));var _0xe032=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x032e[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0xd')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0xf')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller['update']);router[_0xe032('0x10')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file +var _0x5a63=['put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a63,0xe3));var _0x35a6=function(_0x1baee9,_0x1792ca){_0x1baee9=_0x1baee9-0x0;var _0xb25557=_0x5a63[_0x1baee9];return _0xb25557;};'use strict';var multer=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router[_0x35a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x35a6('0x8')]);router['get'](_0x35a6('0x9'),auth['isAuthenticated'](),controller[_0x35a6('0xa')]);router['post']('/',auth[_0x35a6('0xb')](),controller[_0x35a6('0xc')]);router[_0x35a6('0xd')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['update']);router[_0x35a6('0xe')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['destroy']);module[_0x35a6('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0402546..a7085a3 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 _0x2d32=['exports','TEXT','sequelize'];(function(_0x4330bc,_0x4854d7){var _0x690d8f=function(_0x57206c){while(--_0x57206c){_0x4330bc['push'](_0x4330bc['shift']());}};_0x690d8f(++_0x4854d7);}(_0x2d32,0xf5));var _0x22d3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2d32[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x22d3('0x0'));module[_0x22d3('0x1')]={'tree':{'type':Sequelize[_0x22d3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9eb4=['exports','TEXT'];(function(_0x1dcd8b,_0x40f175){var _0x61bebf=function(_0x251850){while(--_0x251850){_0x1dcd8b['push'](_0x1dcd8b['shift']());}};_0x61bebf(++_0x40f175);}(_0x9eb4,0x126));var _0x49eb=function(_0x22f53f,_0x14ef66){_0x22f53f=_0x22f53f-0x0;var _0x57bc67=_0x9eb4[_0x22f53f];return _0x57bc67;};'use strict';var Sequelize=require('sequelize');module[_0x49eb('0x0')]={'tree':{'type':Sequelize[_0x49eb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 122f226..313e1c1 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 _0x0bcc=['catch','create','body','rimraf','zip-dir','moment','bluebird','mustache','sox','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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','AnalyticTreeReport','count','include','findAll','rows','show','params','includeAll','find'];(function(_0x398086,_0x143848){var _0xa0b4c3=function(_0x4f91aa){while(--_0x4f91aa){_0x398086['push'](_0x398086['shift']());}};_0xa0b4c3(++_0x143848);}(_0x0bcc,0x127));var _0xc0bc=function(_0x1983a9,_0x4e957a){_0x1983a9=_0x1983a9-0x0;var _0x1612b4=_0x0bcc[_0x1983a9];return _0x1612b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0bc('0x0'));var zipdir=require(_0xc0bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0bc('0x2'));var BPromise=require(_0xc0bc('0x3'));var Mustache=require(_0xc0bc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc0bc('0x5'));var csv=require(_0xc0bc('0x6'));var ejs=require(_0xc0bc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0bc('0x8'));var squel=require('squel');var crypto=require(_0xc0bc('0x9'));var jsforce=require(_0xc0bc('0xa'));var deskjs=require(_0xc0bc('0xb'));var toCsv=require(_0xc0bc('0x6'));var querystring=require('querystring');var Papa=require(_0xc0bc('0xc'));var Redis=require(_0xc0bc('0xd'));var authService=require(_0xc0bc('0xe'));var qs=require(_0xc0bc('0xf'));var as=require(_0xc0bc('0x10'));var hardwareService=require(_0xc0bc('0x11'));var logger=require('../../config/logger')(_0xc0bc('0x12'));var utils=require(_0xc0bc('0x13'));var config=require(_0xc0bc('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0bc('0x15'))['db'];function respondWithStatusCode(_0x1927a3,_0x3843b3){_0x3843b3=_0x3843b3||0xcc;return function(_0x22ddae){if(_0x22ddae){return _0x1927a3[_0xc0bc('0x16')](_0x3843b3);}return _0x1927a3[_0xc0bc('0x17')](_0x3843b3)[_0xc0bc('0x18')]();};}function respondWithResult(_0x3e70d2,_0x447779){_0x447779=_0x447779||0xc8;return function(_0x5241ef){if(_0x5241ef){return _0x3e70d2[_0xc0bc('0x17')](_0x447779)[_0xc0bc('0x19')](_0x5241ef);}};}function respondWithFilteredResult(_0xeb119c,_0x2bda71){return function(_0x50e1ae){if(_0x50e1ae){var _0x13b1ac=typeof _0x2bda71[_0xc0bc('0x1a')]==='undefined'&&typeof _0x2bda71[_0xc0bc('0x1b')]===_0xc0bc('0x1c');var _0x4c596f=_0x50e1ae['count'];var _0x39151c=_0x13b1ac?0x0:_0x2bda71[_0xc0bc('0x1a')];var _0x2389fe=_0x13b1ac?_0x50e1ae['count']:_0x2bda71[_0xc0bc('0x1a')]+_0x2bda71['limit'];var _0x19cc2c;if(_0x2389fe>=_0x4c596f){_0x2389fe=_0x4c596f;_0x19cc2c=0xc8;}else{_0x19cc2c=0xce;}_0xeb119c[_0xc0bc('0x17')](_0x19cc2c);return _0xeb119c[_0xc0bc('0x1d')](_0xc0bc('0x1e'),_0x39151c+'-'+_0x2389fe+'/'+_0x4c596f)[_0xc0bc('0x19')](_0x50e1ae);}return null;};}function patchUpdates(_0x4a1200){return function(_0x5cea23){try{jsonpatch[_0xc0bc('0x1f')](_0x5cea23,_0x4a1200,!![]);}catch(_0x2e7506){return BPromise['reject'](_0x2e7506);}return _0x5cea23[_0xc0bc('0x20')]();};}function saveUpdates(_0x2627ff,_0x2fab41){return function(_0x3bc674){if(_0x3bc674){return _0x3bc674[_0xc0bc('0x21')](_0x2627ff)[_0xc0bc('0x22')](function(_0x43aeb1){return _0x43aeb1;});}return null;};}function removeEntity(_0x40cd3d,_0x492284){return function(_0xfb0b78){if(_0xfb0b78){return _0xfb0b78[_0xc0bc('0x23')]()[_0xc0bc('0x22')](function(){_0x40cd3d[_0xc0bc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9aa6,_0x1a4991){return function(_0x18bf97){if(!_0x18bf97){_0x2e9aa6[_0xc0bc('0x16')](0x194);}return _0x18bf97;};}function handleError(_0x3449a1,_0x10cf15){_0x10cf15=_0x10cf15||0x1f4;return function(_0x48d4c6){logger[_0xc0bc('0x24')](_0x48d4c6[_0xc0bc('0x25')]);if(_0x48d4c6[_0xc0bc('0x26')]){delete _0x48d4c6[_0xc0bc('0x26')];}_0x3449a1[_0xc0bc('0x17')](_0x10cf15)[_0xc0bc('0x27')](_0x48d4c6);};}exports['index']=function(_0x4960ff,_0x2046d6){var _0x381cd1={},_0x551d96={},_0x2b0bd={'count':0x0,'rows':[]};var _0x542ad0=_[_0xc0bc('0x28')](db['AnalyticTreeReport'][_0xc0bc('0x29')],function(_0x28c5f1){return{'name':_0x28c5f1[_0xc0bc('0x2a')],'type':_0x28c5f1[_0xc0bc('0x2b')][_0xc0bc('0x2c')]};});_0x551d96[_0xc0bc('0x2d')]=_[_0xc0bc('0x28')](_0x542ad0,_0xc0bc('0x26'));_0x551d96[_0xc0bc('0x2e')]=_[_0xc0bc('0x2f')](_0x4960ff[_0xc0bc('0x2e')]);_0x551d96['filters']=_[_0xc0bc('0x30')](_0x551d96[_0xc0bc('0x2d')],_0x551d96[_0xc0bc('0x2e')]);_0x381cd1[_0xc0bc('0x31')]=_['intersection'](_0x551d96[_0xc0bc('0x2d')],qs['fields'](_0x4960ff['query'][_0xc0bc('0x32')]));_0x381cd1[_0xc0bc('0x31')]=_0x381cd1[_0xc0bc('0x31')][_0xc0bc('0x33')]?_0x381cd1[_0xc0bc('0x31')]:_0x551d96['model'];if(!_0x4960ff['query'][_0xc0bc('0x34')]('nolimit')){_0x381cd1['limit']=qs[_0xc0bc('0x1b')](_0x4960ff[_0xc0bc('0x2e')][_0xc0bc('0x1b')]);_0x381cd1[_0xc0bc('0x1a')]=qs['offset'](_0x4960ff[_0xc0bc('0x2e')][_0xc0bc('0x1a')]);}_0x381cd1[_0xc0bc('0x35')]=qs[_0xc0bc('0x36')](_0x4960ff['query']['sort']);_0x381cd1[_0xc0bc('0x37')]=qs[_0xc0bc('0x38')](_[_0xc0bc('0x39')](_0x4960ff[_0xc0bc('0x2e')],_0x551d96[_0xc0bc('0x38')]),_0x542ad0);if(_0x4960ff[_0xc0bc('0x2e')][_0xc0bc('0x3a')]){_0x381cd1[_0xc0bc('0x37')]=_[_0xc0bc('0x3b')](_0x381cd1['where'],{'$or':_[_0xc0bc('0x28')](_0x542ad0,function(_0x321048){if(_0x321048[_0xc0bc('0x2b')]!=='VIRTUAL'){var _0x28f99f={};_0x28f99f[_0x321048[_0xc0bc('0x26')]]={'$like':'%'+_0x4960ff['query'][_0xc0bc('0x3a')]+'%'};return _0x28f99f;}})});}_0x381cd1=_[_0xc0bc('0x3b')]({},_0x381cd1,_0x4960ff[_0xc0bc('0x3c')]);var _0x35ad88={'where':_0x381cd1[_0xc0bc('0x37')]};return db[_0xc0bc('0x3d')][_0xc0bc('0x3e')](_0x35ad88)[_0xc0bc('0x22')](function(_0x1eb5fb){_0x2b0bd[_0xc0bc('0x3e')]=_0x1eb5fb;if(_0x4960ff[_0xc0bc('0x2e')]['includeAll']){_0x381cd1[_0xc0bc('0x3f')]=[{'all':!![]}];}return db[_0xc0bc('0x3d')][_0xc0bc('0x40')](_0x381cd1);})[_0xc0bc('0x22')](function(_0x86819d){_0x2b0bd[_0xc0bc('0x41')]=_0x86819d;return _0x2b0bd;})[_0xc0bc('0x22')](respondWithFilteredResult(_0x2046d6,_0x381cd1))['catch'](handleError(_0x2046d6,null));};exports[_0xc0bc('0x42')]=function(_0x1d9c06,_0x2f8084){var _0x411a6f={'raw':!![],'where':{'id':_0x1d9c06[_0xc0bc('0x43')]['id']}},_0x162d1e={};_0x162d1e['model']=_[_0xc0bc('0x2f')](db['AnalyticTreeReport'][_0xc0bc('0x29')]);_0x162d1e[_0xc0bc('0x2e')]=_[_0xc0bc('0x2f')](_0x1d9c06['query']);_0x162d1e[_0xc0bc('0x38')]=_[_0xc0bc('0x30')](_0x162d1e[_0xc0bc('0x2d')],_0x162d1e['query']);_0x411a6f[_0xc0bc('0x31')]=_[_0xc0bc('0x30')](_0x162d1e[_0xc0bc('0x2d')],qs[_0xc0bc('0x32')](_0x1d9c06[_0xc0bc('0x2e')][_0xc0bc('0x32')]));_0x411a6f[_0xc0bc('0x31')]=_0x411a6f['attributes'][_0xc0bc('0x33')]?_0x411a6f[_0xc0bc('0x31')]:_0x162d1e[_0xc0bc('0x2d')];if(_0x1d9c06['query'][_0xc0bc('0x44')]){_0x411a6f[_0xc0bc('0x3f')]=[{'all':!![]}];}_0x411a6f=_[_0xc0bc('0x3b')]({},_0x411a6f,_0x1d9c06[_0xc0bc('0x3c')]);return db[_0xc0bc('0x3d')][_0xc0bc('0x45')](_0x411a6f)[_0xc0bc('0x22')](handleEntityNotFound(_0x2f8084,null))[_0xc0bc('0x22')](respondWithResult(_0x2f8084,null))[_0xc0bc('0x46')](handleError(_0x2f8084,null));};exports[_0xc0bc('0x47')]=function(_0xaf44b5,_0x1ffceb){return db[_0xc0bc('0x3d')][_0xc0bc('0x47')](_0xaf44b5[_0xc0bc('0x48')],{})[_0xc0bc('0x22')](respondWithResult(_0x1ffceb,0xc9))[_0xc0bc('0x46')](handleError(_0x1ffceb,null));};exports[_0xc0bc('0x21')]=function(_0x4ae7f9,_0x54324e){if(_0x4ae7f9[_0xc0bc('0x48')]['id']){delete _0x4ae7f9[_0xc0bc('0x48')]['id'];}return db[_0xc0bc('0x3d')]['find']({'where':{'id':_0x4ae7f9[_0xc0bc('0x43')]['id']}})[_0xc0bc('0x22')](handleEntityNotFound(_0x54324e,null))[_0xc0bc('0x22')](saveUpdates(_0x4ae7f9['body'],null))[_0xc0bc('0x22')](respondWithResult(_0x54324e,null))['catch'](handleError(_0x54324e,null));};exports[_0xc0bc('0x23')]=function(_0x18f380,_0x2af522){return db[_0xc0bc('0x3d')][_0xc0bc('0x45')]({'where':{'id':_0x18f380[_0xc0bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x2af522,null))[_0xc0bc('0x22')](removeEntity(_0x2af522,null))[_0xc0bc('0x46')](handleError(_0x2af522,null));}; \ No newline at end of file +var _0x6414=['stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','count','findAll','catch','show','params','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error'];(function(_0x4d6f3b,_0x169895){var _0x2c3010=function(_0x2cad24){while(--_0x2cad24){_0x4d6f3b['push'](_0x4d6f3b['shift']());}};_0x2c3010(++_0x169895);}(_0x6414,0x6c));var _0x4641=function(_0x52fcc0,_0x537733){_0x52fcc0=_0x52fcc0-0x0;var _0x5e2b3c=_0x6414[_0x52fcc0];return _0x5e2b3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4641('0x0'));var zipdir=require(_0x4641('0x1'));var jsonpatch=require(_0x4641('0x2'));var rp=require(_0x4641('0x3'));var moment=require(_0x4641('0x4'));var BPromise=require(_0x4641('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4641('0x6'));var ejs=require(_0x4641('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4641('0x8'));var crypto=require(_0x4641('0x9'));var jsforce=require(_0x4641('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4641('0x6'));var querystring=require(_0x4641('0xb'));var Papa=require(_0x4641('0xc'));var Redis=require(_0x4641('0xd'));var authService=require(_0x4641('0xe'));var qs=require(_0x4641('0xf'));var as=require(_0x4641('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4641('0x11'))(_0x4641('0x12'));var utils=require(_0x4641('0x13'));var config=require(_0x4641('0x14'));var licenseUtil=require(_0x4641('0x15'));var db=require(_0x4641('0x16'))['db'];function respondWithStatusCode(_0x54f441,_0x21d6d6){_0x21d6d6=_0x21d6d6||0xcc;return function(_0x566e24){if(_0x566e24){return _0x54f441[_0x4641('0x17')](_0x21d6d6);}return _0x54f441[_0x4641('0x18')](_0x21d6d6)[_0x4641('0x19')]();};}function respondWithResult(_0x19ff24,_0x424452){_0x424452=_0x424452||0xc8;return function(_0x557352){if(_0x557352){return _0x19ff24[_0x4641('0x18')](_0x424452)[_0x4641('0x1a')](_0x557352);}};}function respondWithFilteredResult(_0xbb428c,_0x3fb452){return function(_0xa463a0){if(_0xa463a0){var _0x5f4e48=typeof _0x3fb452[_0x4641('0x1b')]===_0x4641('0x1c')&&typeof _0x3fb452[_0x4641('0x1d')]==='undefined';var _0x3a490e=_0xa463a0['count'];var _0x27b8f5=_0x5f4e48?0x0:_0x3fb452['offset'];var _0x2ac169=_0x5f4e48?_0xa463a0['count']:_0x3fb452[_0x4641('0x1b')]+_0x3fb452[_0x4641('0x1d')];var _0x4d68cd;if(_0x2ac169>=_0x3a490e){_0x2ac169=_0x3a490e;_0x4d68cd=0xc8;}else{_0x4d68cd=0xce;}_0xbb428c[_0x4641('0x18')](_0x4d68cd);return _0xbb428c[_0x4641('0x1e')](_0x4641('0x1f'),_0x27b8f5+'-'+_0x2ac169+'/'+_0x3a490e)[_0x4641('0x1a')](_0xa463a0);}return null;};}function patchUpdates(_0x1eda1c){return function(_0x44b778){try{jsonpatch[_0x4641('0x20')](_0x44b778,_0x1eda1c,!![]);}catch(_0x12ec8e){return BPromise[_0x4641('0x21')](_0x12ec8e);}return _0x44b778['save']();};}function saveUpdates(_0x3e7d72,_0x278962){return function(_0xd46390){if(_0xd46390){return _0xd46390[_0x4641('0x22')](_0x3e7d72)['then'](function(_0x374d1f){return _0x374d1f;});}return null;};}function removeEntity(_0xdba891,_0x11502e){return function(_0x3be486){if(_0x3be486){return _0x3be486[_0x4641('0x23')]()[_0x4641('0x24')](function(){_0xdba891[_0x4641('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd69b5d,_0x4b8183){return function(_0x509b8c){if(!_0x509b8c){_0xd69b5d['sendStatus'](0x194);}return _0x509b8c;};}function handleError(_0x293f20,_0x38cd88){_0x38cd88=_0x38cd88||0x1f4;return function(_0x5e1a7d){logger[_0x4641('0x25')](_0x5e1a7d[_0x4641('0x26')]);if(_0x5e1a7d[_0x4641('0x27')]){delete _0x5e1a7d[_0x4641('0x27')];}_0x293f20[_0x4641('0x18')](_0x38cd88)[_0x4641('0x28')](_0x5e1a7d);};}exports[_0x4641('0x29')]=function(_0x3402e3,_0x124b54){var _0x56771e={},_0x27fafe={},_0x11554c={'count':0x0,'rows':[]};var _0x2feb20=_[_0x4641('0x2a')](db[_0x4641('0x2b')][_0x4641('0x2c')],function(_0x39f192){return{'name':_0x39f192[_0x4641('0x2d')],'type':_0x39f192[_0x4641('0x2e')][_0x4641('0x2f')]};});_0x27fafe[_0x4641('0x30')]=_['map'](_0x2feb20,_0x4641('0x27'));_0x27fafe['query']=_[_0x4641('0x31')](_0x3402e3[_0x4641('0x32')]);_0x27fafe[_0x4641('0x33')]=_[_0x4641('0x34')](_0x27fafe['model'],_0x27fafe[_0x4641('0x32')]);_0x56771e[_0x4641('0x35')]=_[_0x4641('0x34')](_0x27fafe[_0x4641('0x30')],qs[_0x4641('0x36')](_0x3402e3['query']['fields']));_0x56771e[_0x4641('0x35')]=_0x56771e['attributes'][_0x4641('0x37')]?_0x56771e[_0x4641('0x35')]:_0x27fafe['model'];if(!_0x3402e3['query']['hasOwnProperty'](_0x4641('0x38'))){_0x56771e[_0x4641('0x1d')]=qs[_0x4641('0x1d')](_0x3402e3['query'][_0x4641('0x1d')]);_0x56771e[_0x4641('0x1b')]=qs[_0x4641('0x1b')](_0x3402e3[_0x4641('0x32')]['offset']);}_0x56771e[_0x4641('0x39')]=qs[_0x4641('0x3a')](_0x3402e3[_0x4641('0x32')][_0x4641('0x3a')]);_0x56771e['where']=qs[_0x4641('0x33')](_[_0x4641('0x3b')](_0x3402e3[_0x4641('0x32')],_0x27fafe[_0x4641('0x33')]),_0x2feb20);if(_0x3402e3[_0x4641('0x32')][_0x4641('0x3c')]){_0x56771e['where']=_[_0x4641('0x3d')](_0x56771e['where'],{'$or':_[_0x4641('0x2a')](_0x2feb20,function(_0x3c0af3){if(_0x3c0af3[_0x4641('0x2e')]!==_0x4641('0x3e')){var _0x336ede={};_0x336ede[_0x3c0af3[_0x4641('0x27')]]={'$like':'%'+_0x3402e3[_0x4641('0x32')][_0x4641('0x3c')]+'%'};return _0x336ede;}})});}_0x56771e=_['merge']({},_0x56771e,_0x3402e3[_0x4641('0x3f')]);var _0x55787b={'where':_0x56771e['where']};return db[_0x4641('0x2b')][_0x4641('0x40')](_0x55787b)[_0x4641('0x24')](function(_0x301ba4){_0x11554c[_0x4641('0x40')]=_0x301ba4;if(_0x3402e3[_0x4641('0x32')]['includeAll']){_0x56771e['include']=[{'all':!![]}];}return db[_0x4641('0x2b')][_0x4641('0x41')](_0x56771e);})[_0x4641('0x24')](function(_0xfd5b84){_0x11554c['rows']=_0xfd5b84;return _0x11554c;})[_0x4641('0x24')](respondWithFilteredResult(_0x124b54,_0x56771e))[_0x4641('0x42')](handleError(_0x124b54,null));};exports[_0x4641('0x43')]=function(_0x290bdd,_0x18ccdc){var _0x4c0bb7={'raw':!![],'where':{'id':_0x290bdd[_0x4641('0x44')]['id']}},_0x490431={};_0x490431[_0x4641('0x30')]=_[_0x4641('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x490431[_0x4641('0x32')]=_['keys'](_0x290bdd[_0x4641('0x32')]);_0x490431[_0x4641('0x33')]=_[_0x4641('0x34')](_0x490431[_0x4641('0x30')],_0x490431[_0x4641('0x32')]);_0x4c0bb7[_0x4641('0x35')]=_[_0x4641('0x34')](_0x490431[_0x4641('0x30')],qs[_0x4641('0x36')](_0x290bdd[_0x4641('0x32')][_0x4641('0x36')]));_0x4c0bb7[_0x4641('0x35')]=_0x4c0bb7[_0x4641('0x35')][_0x4641('0x37')]?_0x4c0bb7[_0x4641('0x35')]:_0x490431[_0x4641('0x30')];if(_0x290bdd[_0x4641('0x32')]['includeAll']){_0x4c0bb7[_0x4641('0x45')]=[{'all':!![]}];}_0x4c0bb7=_[_0x4641('0x3d')]({},_0x4c0bb7,_0x290bdd[_0x4641('0x3f')]);return db[_0x4641('0x2b')]['find'](_0x4c0bb7)['then'](handleEntityNotFound(_0x18ccdc,null))[_0x4641('0x24')](respondWithResult(_0x18ccdc,null))[_0x4641('0x42')](handleError(_0x18ccdc,null));};exports[_0x4641('0x46')]=function(_0x47043c,_0xc5ba49){return db[_0x4641('0x2b')]['create'](_0x47043c[_0x4641('0x47')],{})[_0x4641('0x24')](respondWithResult(_0xc5ba49,0xc9))[_0x4641('0x42')](handleError(_0xc5ba49,null));};exports['update']=function(_0x2e4027,_0x452d93){if(_0x2e4027['body']['id']){delete _0x2e4027['body']['id'];}return db[_0x4641('0x2b')][_0x4641('0x48')]({'where':{'id':_0x2e4027[_0x4641('0x44')]['id']}})[_0x4641('0x24')](handleEntityNotFound(_0x452d93,null))[_0x4641('0x24')](saveUpdates(_0x2e4027[_0x4641('0x47')],null))[_0x4641('0x24')](respondWithResult(_0x452d93,null))[_0x4641('0x42')](handleError(_0x452d93,null));};exports[_0x4641('0x23')]=function(_0x332b4e,_0x103276){return db['AnalyticTreeReport']['find']({'where':{'id':_0x332b4e[_0x4641('0x44')]['id']}})[_0x4641('0x24')](handleEntityNotFound(_0x103276,null))['then'](removeEntity(_0x103276,null))['catch'](handleError(_0x103276,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 70da6a3..175b015 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 _0xd031=['moment','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x599da4,_0x2ec53d){var _0x380805=function(_0x15d390){while(--_0x15d390){_0x599da4['push'](_0x599da4['shift']());}};_0x380805(++_0x2ec53d);}(_0xd031,0x19f));var _0x1d03=function(_0x27e390,_0x3d1837){_0x27e390=_0x27e390-0x0;var _0x3714ec=_0xd031[_0x27e390];return _0x3714ec;};'use strict';var _=require(_0x1d03('0x0'));var util=require(_0x1d03('0x1'));var logger=require(_0x1d03('0x2'))('api');var moment=require(_0x1d03('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1d03('0x4'));var config=require(_0x1d03('0x5'));var attributes=require(_0x1d03('0x6'));module[_0x1d03('0x7')]=function(_0x9835ca,_0x1da631){return _0x9835ca[_0x1d03('0x8')](_0x1d03('0x9'),attributes,{'tableName':_0x1d03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3ab=['rimraf','define','AnalyticTreeReport','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x56ab11,_0x14cba4){var _0x5f3bba=function(_0x35041b){while(--_0x35041b){_0x56ab11['push'](_0x56ab11['shift']());}};_0x5f3bba(++_0x14cba4);}(_0xe3ab,0x1aa));var _0xbe3a=function(_0x5cbdea,_0x3dd0b2){_0x5cbdea=_0x5cbdea-0x0;var _0x12cf7e=_0xe3ab[_0x5cbdea];return _0x12cf7e;};'use strict';var _=require(_0xbe3a('0x0'));var util=require(_0xbe3a('0x1'));var logger=require(_0xbe3a('0x2'))('api');var moment=require(_0xbe3a('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe3a('0x4'));var fs=require('fs');var path=require(_0xbe3a('0x5'));var rimraf=require(_0xbe3a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x10e82e,_0x3808d4){return _0x10e82e[_0xbe3a('0x7')](_0xbe3a('0x8'),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 1e04ab2..98da1ff 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4eb739,_0x4a619e){var _0x3c76f9=function(_0x307f94){while(--_0x307f94){_0x4eb739['push'](_0x4eb739['shift']());}};_0x3c76f9(++_0x4a619e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xc2dccb,_0x5957f2){var _0x3239b3=function(_0x58f337){while(--_0x58f337){_0xc2dccb['push'](_0xc2dccb['shift']());}};_0x3239b3(++_0x5957f2);}(_0xadb5,0xad));var _0x5adb=function(_0x38801f,_0x7c82f8){_0x38801f=_0x38801f-0x0;var _0x571280=_0xadb5[_0x38801f];return _0x571280;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e906b28..63a0277 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 _0xb26f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x52ca83,_0x47f3f9){var _0x4c1bee=function(_0x5a708f){while(--_0x5a708f){_0x52ca83['push'](_0x52ca83['shift']());}};_0x4c1bee(++_0x47f3f9);}(_0xb26f,0x118));var _0xfb26=function(_0x36aad0,_0x3d2e17){_0x36aad0=_0x36aad0-0x0;var _0x31e987=_0xb26f[_0x36aad0];return _0x31e987;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb26('0x0'));var timeout=require(_0xfb26('0x1'));var express=require(_0xfb26('0x2'));var router=express[_0xfb26('0x3')]();var fs_extra=require(_0xfb26('0x4'));var auth=require(_0xfb26('0x5'));var interaction=require(_0xfb26('0x6'));var config=require(_0xfb26('0x7'));var controller=require(_0xfb26('0x8'));router[_0xfb26('0x9')]('/',auth[_0xfb26('0xa')](),controller[_0xfb26('0xb')]);router[_0xfb26('0x9')](_0xfb26('0xc'),auth[_0xfb26('0xa')](),controller[_0xfb26('0xd')]);router['post']('/',auth[_0xfb26('0xa')](),controller[_0xfb26('0xe')]);router[_0xfb26('0xf')](_0xfb26('0xc'),auth[_0xfb26('0xa')](),controller[_0xfb26('0x10')]);router[_0xfb26('0x11')](_0xfb26('0xc'),auth[_0xfb26('0xa')](),controller[_0xfb26('0x12')]);module[_0xfb26('0x13')]=router; \ No newline at end of file +var _0x0ba3=['express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x5b644c,_0x5c4a8a){var _0x30f702=function(_0x14ce92){while(--_0x14ce92){_0x5b644c['push'](_0x5b644c['shift']());}};_0x30f702(++_0x5c4a8a);}(_0x0ba3,0xd6));var _0x30ba=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x0ba3[_0x533528];return _0x3189f1;};'use strict';var multer=require(_0x30ba('0x0'));var util=require('util');var path=require(_0x30ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x30ba('0x2'));var router=express[_0x30ba('0x3')]();var fs_extra=require(_0x30ba('0x4'));var auth=require(_0x30ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x30ba('0x6'));router[_0x30ba('0x7')]('/',auth[_0x30ba('0x8')](),controller[_0x30ba('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x30ba('0xa')]);router['post']('/',auth[_0x30ba('0x8')](),controller[_0x30ba('0xb')]);router[_0x30ba('0xc')](_0x30ba('0xd'),auth[_0x30ba('0x8')](),controller[_0x30ba('0xe')]);router[_0x30ba('0xf')](_0x30ba('0xd'),auth[_0x30ba('0x8')](),controller[_0x30ba('0x10')]);module[_0x30ba('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 0f4f33b..b0c1fdb 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 _0xe009=['exports','STRING','sequelize'];(function(_0x29ef52,_0x2325c9){var _0xeb6a9=function(_0x593751){while(--_0x593751){_0x29ef52['push'](_0x29ef52['shift']());}};_0xeb6a9(++_0x2325c9);}(_0xe009,0x122));var _0x9e00=function(_0x4b0d27,_0x46d18c){_0x4b0d27=_0x4b0d27-0x0;var _0x340975=_0xe009[_0x4b0d27];return _0x340975;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'name':{'type':Sequelize[_0x9e00('0x2')]},'basename':{'type':Sequelize[_0x9e00('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34b2=['exports','STRING','sequelize'];(function(_0x5a7677,_0x23630f){var _0x2da6ef=function(_0x44484c){while(--_0x44484c){_0x5a7677['push'](_0x5a7677['shift']());}};_0x2da6ef(++_0x23630f);}(_0x34b2,0x11c));var _0x234b=function(_0x362ad7,_0x948800){_0x362ad7=_0x362ad7-0x0;var _0x54703b=_0x34b2[_0x362ad7];return _0x54703b;};'use strict';var Sequelize=require(_0x234b('0x0'));module[_0x234b('0x1')]={'name':{'type':Sequelize[_0x234b('0x2')]},'basename':{'type':Sequelize[_0x234b('0x2')]},'type':{'type':Sequelize[_0x234b('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 09341cb..fc6492a 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 _0x1aec=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','rows','catch','params','options','clone','include','updatedAt','body','createdAt','create','find','basename','file','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName'];(function(_0x2ad016,_0x4c3106){var _0x1589be=function(_0x176086){while(--_0x176086){_0x2ad016['push'](_0x2ad016['shift']());}};_0x1589be(++_0x4c3106);}(_0x1aec,0x86));var _0xc1ae=function(_0x478689,_0x257f1a){_0x478689=_0x478689-0x0;var _0x9e4bf1=_0x1aec[_0x478689];return _0x9e4bf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1ae('0x0'));var zipdir=require(_0xc1ae('0x1'));var jsonpatch=require(_0xc1ae('0x2'));var rp=require(_0xc1ae('0x3'));var moment=require(_0xc1ae('0x4'));var BPromise=require(_0xc1ae('0x5'));var Mustache=require(_0xc1ae('0x6'));var util=require(_0xc1ae('0x7'));var path=require(_0xc1ae('0x8'));var sox=require(_0xc1ae('0x9'));var csv=require(_0xc1ae('0xa'));var ejs=require(_0xc1ae('0xb'));var fs=require('fs');var fs_extra=require(_0xc1ae('0xc'));var _=require(_0xc1ae('0xd'));var squel=require('squel');var crypto=require(_0xc1ae('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc1ae('0xf'));var toCsv=require(_0xc1ae('0xa'));var querystring=require(_0xc1ae('0x10'));var Papa=require(_0xc1ae('0x11'));var Redis=require(_0xc1ae('0x12'));var authService=require(_0xc1ae('0x13'));var qs=require(_0xc1ae('0x14'));var as=require(_0xc1ae('0x15'));var hardwareService=require(_0xc1ae('0x16'));var logger=require('../../config/logger')(_0xc1ae('0x17'));var utils=require(_0xc1ae('0x18'));var config=require(_0xc1ae('0x19'));var licenseUtil=require(_0xc1ae('0x1a'));var db=require(_0xc1ae('0x1b'))['db'];function respondWithStatusCode(_0x428a6f,_0x558a09){_0x558a09=_0x558a09||0xcc;return function(_0x5c25e5){if(_0x5c25e5){return _0x428a6f[_0xc1ae('0x1c')](_0x558a09);}return _0x428a6f['status'](_0x558a09)[_0xc1ae('0x1d')]();};}function respondWithResult(_0x547583,_0x292ade){_0x292ade=_0x292ade||0xc8;return function(_0xc9d649){if(_0xc9d649){return _0x547583[_0xc1ae('0x1e')](_0x292ade)['json'](_0xc9d649);}};}function respondWithFilteredResult(_0x1d42f5,_0x3a2601){return function(_0x57d27f){if(_0x57d27f){var _0x5811f7=typeof _0x3a2601[_0xc1ae('0x1f')]===_0xc1ae('0x20')&&typeof _0x3a2601[_0xc1ae('0x21')]===_0xc1ae('0x20');var _0x1b7d69=_0x57d27f['count'];var _0x455fb5=_0x5811f7?0x0:_0x3a2601['offset'];var _0x26b328=_0x5811f7?_0x57d27f['count']:_0x3a2601['offset']+_0x3a2601[_0xc1ae('0x21')];var _0x3ff140;if(_0x26b328>=_0x1b7d69){_0x26b328=_0x1b7d69;_0x3ff140=0xc8;}else{_0x3ff140=0xce;}_0x1d42f5[_0xc1ae('0x1e')](_0x3ff140);return _0x1d42f5[_0xc1ae('0x22')](_0xc1ae('0x23'),_0x455fb5+'-'+_0x26b328+'/'+_0x1b7d69)[_0xc1ae('0x24')](_0x57d27f);}return null;};}function patchUpdates(_0xf1d0e9){return function(_0xbdf517){try{jsonpatch[_0xc1ae('0x25')](_0xbdf517,_0xf1d0e9,!![]);}catch(_0x297fcf){return BPromise[_0xc1ae('0x26')](_0x297fcf);}return _0xbdf517[_0xc1ae('0x27')]();};}function saveUpdates(_0x2fbb95,_0x5b9ed2){return function(_0x21d32b){if(_0x21d32b){return _0x21d32b[_0xc1ae('0x28')](_0x2fbb95)[_0xc1ae('0x29')](function(_0xd42275){return _0xd42275;});}return null;};}function removeEntity(_0x1f7884,_0x313a73){return function(_0x26a95e){if(_0x26a95e){return _0x26a95e[_0xc1ae('0x2a')]()['then'](function(){_0x1f7884[_0xc1ae('0x1e')](0xcc)[_0xc1ae('0x1d')]();});}};}function handleEntityNotFound(_0x281ce2,_0x28d763){return function(_0x5b2e1c){if(!_0x5b2e1c){_0x281ce2[_0xc1ae('0x1c')](0x194);}return _0x5b2e1c;};}function handleError(_0x2ccee2,_0x3ce0a0){_0x3ce0a0=_0x3ce0a0||0x1f4;return function(_0x22c464){logger[_0xc1ae('0x2b')](_0x22c464[_0xc1ae('0x2c')]);if(_0x22c464[_0xc1ae('0x2d')]){delete _0x22c464['name'];}_0x2ccee2[_0xc1ae('0x1e')](_0x3ce0a0)[_0xc1ae('0x2e')](_0x22c464);};}exports[_0xc1ae('0x2f')]=function(_0x3a7c2f,_0x4ab228){var _0x5b3a01={},_0x2a669e={},_0x4383ef={'count':0x0,'rows':[]};var _0x2cce23=_[_0xc1ae('0x30')](db[_0xc1ae('0x31')][_0xc1ae('0x32')],function(_0x29445c){return{'name':_0x29445c[_0xc1ae('0x33')],'type':_0x29445c[_0xc1ae('0x34')][_0xc1ae('0x35')]};});_0x2a669e[_0xc1ae('0x36')]=_['map'](_0x2cce23,'name');_0x2a669e[_0xc1ae('0x37')]=_[_0xc1ae('0x38')](_0x3a7c2f[_0xc1ae('0x37')]);_0x2a669e[_0xc1ae('0x39')]=_[_0xc1ae('0x3a')](_0x2a669e[_0xc1ae('0x36')],_0x2a669e[_0xc1ae('0x37')]);_0x5b3a01[_0xc1ae('0x3b')]=_[_0xc1ae('0x3a')](_0x2a669e[_0xc1ae('0x36')],qs[_0xc1ae('0x3c')](_0x3a7c2f[_0xc1ae('0x37')][_0xc1ae('0x3c')]));_0x5b3a01[_0xc1ae('0x3b')]=_0x5b3a01[_0xc1ae('0x3b')][_0xc1ae('0x3d')]?_0x5b3a01[_0xc1ae('0x3b')]:_0x2a669e[_0xc1ae('0x36')];if(!_0x3a7c2f[_0xc1ae('0x37')][_0xc1ae('0x3e')](_0xc1ae('0x3f'))){_0x5b3a01[_0xc1ae('0x21')]=qs[_0xc1ae('0x21')](_0x3a7c2f[_0xc1ae('0x37')]['limit']);_0x5b3a01[_0xc1ae('0x1f')]=qs[_0xc1ae('0x1f')](_0x3a7c2f[_0xc1ae('0x37')]['offset']);}_0x5b3a01[_0xc1ae('0x40')]=qs[_0xc1ae('0x41')](_0x3a7c2f[_0xc1ae('0x37')][_0xc1ae('0x41')]);_0x5b3a01['where']=qs[_0xc1ae('0x39')](_[_0xc1ae('0x42')](_0x3a7c2f['query'],_0x2a669e[_0xc1ae('0x39')]),_0x2cce23);if(_0x3a7c2f[_0xc1ae('0x37')]['filter']){_0x5b3a01[_0xc1ae('0x43')]=_[_0xc1ae('0x44')](_0x5b3a01[_0xc1ae('0x43')],{'$or':_[_0xc1ae('0x30')](_0x2cce23,function(_0x129ae0){if(_0x129ae0[_0xc1ae('0x34')]!==_0xc1ae('0x45')){var _0x235c31={};_0x235c31[_0x129ae0[_0xc1ae('0x2d')]]={'$like':'%'+_0x3a7c2f['query'][_0xc1ae('0x46')]+'%'};return _0x235c31;}})});}_0x5b3a01=_[_0xc1ae('0x44')]({},_0x5b3a01,_0x3a7c2f['options']);var _0x3b8eb3={'where':_0x5b3a01[_0xc1ae('0x43')]};return db[_0xc1ae('0x31')][_0xc1ae('0x47')](_0x3b8eb3)[_0xc1ae('0x29')](function(_0x37acf0){_0x4383ef[_0xc1ae('0x47')]=_0x37acf0;if(_0x3a7c2f[_0xc1ae('0x37')][_0xc1ae('0x48')]){_0x5b3a01['include']=[{'all':!![]}];}return db[_0xc1ae('0x31')]['findAll'](_0x5b3a01);})[_0xc1ae('0x29')](function(_0xca2e7a){_0x4383ef[_0xc1ae('0x49')]=_0xca2e7a;return _0x4383ef;})['then'](respondWithFilteredResult(_0x4ab228,_0x5b3a01))[_0xc1ae('0x4a')](handleError(_0x4ab228,null));};exports['show']=function(_0x48c04c,_0x1406dd){var _0x1d82dd={'raw':!![],'where':{'id':_0x48c04c[_0xc1ae('0x4b')]['id']}},_0x5e7702={};_0x5e7702['model']=_[_0xc1ae('0x38')](db['Attachment'][_0xc1ae('0x32')]);_0x5e7702['query']=_['keys'](_0x48c04c[_0xc1ae('0x37')]);_0x5e7702['filters']=_[_0xc1ae('0x3a')](_0x5e7702[_0xc1ae('0x36')],_0x5e7702[_0xc1ae('0x37')]);_0x1d82dd['attributes']=_[_0xc1ae('0x3a')](_0x5e7702[_0xc1ae('0x36')],qs[_0xc1ae('0x3c')](_0x48c04c[_0xc1ae('0x37')]['fields']));_0x1d82dd[_0xc1ae('0x3b')]=_0x1d82dd['attributes'][_0xc1ae('0x3d')]?_0x1d82dd['attributes']:_0x5e7702['model'];if(_0x48c04c[_0xc1ae('0x37')][_0xc1ae('0x48')]){_0x1d82dd['include']=[{'all':!![]}];}_0x1d82dd=_[_0xc1ae('0x44')]({},_0x1d82dd,_0x48c04c[_0xc1ae('0x4c')]);return db[_0xc1ae('0x31')]['find'](_0x1d82dd)[_0xc1ae('0x29')](handleEntityNotFound(_0x1406dd,null))[_0xc1ae('0x29')](respondWithResult(_0x1406dd,null))['catch'](handleError(_0x1406dd,null));};exports[_0xc1ae('0x4d')]=function(_0x3e1ac4,_0x845389){var _0xd8ad5c={'where':{'id':_0x3e1ac4['params']['id']}},_0x48b260={};_0x48b260[_0xc1ae('0x36')]=_[_0xc1ae('0x38')](db[_0xc1ae('0x31')][_0xc1ae('0x32')]);_0xd8ad5c[_0xc1ae('0x3b')]=_[_0xc1ae('0x3a')](_0x48b260['model'],qs[_0xc1ae('0x3c')](_0x3e1ac4['query'][_0xc1ae('0x3c')]));_0xd8ad5c[_0xc1ae('0x3b')]=_0xd8ad5c[_0xc1ae('0x3b')][_0xc1ae('0x3d')]?_0xd8ad5c[_0xc1ae('0x3b')]:_0x48b260[_0xc1ae('0x36')];if(_0x3e1ac4[_0xc1ae('0x37')][_0xc1ae('0x48')]){_0xd8ad5c[_0xc1ae('0x4e')]=[{'all':!![]}];}_0xd8ad5c=_['merge']({},_0xd8ad5c,_0x3e1ac4['options']);return db['Attachment']['find'](_0xd8ad5c)[_0xc1ae('0x29')](handleEntityNotFound(_0x845389,null))[_0xc1ae('0x29')](function(_0x5d3df8){if(_0x5d3df8){var _0x4431be=_0x5d3df8['get']({'plain':!![]});_0x4431be=qs['omit'](_0x4431be,['id','createdAt',_0xc1ae('0x4f')]);_0x3e1ac4['body']=_['omit'](_0x3e1ac4[_0xc1ae('0x50')],['id',_0xc1ae('0x51'),'updatedAt']);return db[_0xc1ae('0x31')][_0xc1ae('0x52')](_[_0xc1ae('0x44')](_0x4431be,_0x3e1ac4[_0xc1ae('0x50')]),{'include':_0x3e1ac4[_0xc1ae('0x37')][_0xc1ae('0x48')]?[{'all':!![]}]:undefined});}})[_0xc1ae('0x29')](respondWithResult(_0x845389,0xc9))[_0xc1ae('0x4a')](handleError(_0x845389,null));};exports['update']=function(_0x2ea1f4,_0x45757e){if(_0x2ea1f4[_0xc1ae('0x50')]['id']){delete _0x2ea1f4[_0xc1ae('0x50')]['id'];}return db[_0xc1ae('0x31')][_0xc1ae('0x53')]({'where':{'id':_0x2ea1f4[_0xc1ae('0x4b')]['id']}})[_0xc1ae('0x29')](handleEntityNotFound(_0x45757e,null))[_0xc1ae('0x29')](saveUpdates(_0x2ea1f4['body'],null))[_0xc1ae('0x29')](respondWithResult(_0x45757e,null))[_0xc1ae('0x4a')](handleError(_0x45757e,null));};exports[_0xc1ae('0x2a')]=function(_0x4958c4,_0x493012){return db[_0xc1ae('0x31')][_0xc1ae('0x53')]({'where':{'id':_0x4958c4[_0xc1ae('0x4b')]['id']}})[_0xc1ae('0x29')](handleEntityNotFound(_0x493012,null))[_0xc1ae('0x29')](removeEntity(_0x493012,null))[_0xc1ae('0x4a')](handleError(_0x493012,null));};exports[_0xc1ae('0x52')]=function(_0x33c5f6,_0x42c49c,_0x161e6c){_0x33c5f6['body'][_0xc1ae('0x2d')]=_0x33c5f6['file']['originalname'];_0x33c5f6[_0xc1ae('0x50')][_0xc1ae('0x54')]=_0x33c5f6['file']['filename'];_0x33c5f6[_0xc1ae('0x50')][_0xc1ae('0x34')]=_0x33c5f6[_0xc1ae('0x55')][_0xc1ae('0x56')];return db[_0xc1ae('0x31')][_0xc1ae('0x52')](_0x33c5f6[_0xc1ae('0x50')])['then'](respondWithResult(_0x42c49c,0xc9))['catch'](handleError(_0x42c49c,null));};exports[_0xc1ae('0x57')]=function(_0x54681c,_0x1e4f89,_0x2e1ea3){return db[_0xc1ae('0x31')]['findOne']({'where':{'id':_0x54681c[_0xc1ae('0x4b')]['id']},'raw':!![]})[_0xc1ae('0x29')](handleEntityNotFound(_0x1e4f89,null))[_0xc1ae('0x29')](function(_0xdfec13){if(_0xdfec13){var _0x25eaff=_0xdfec13[_0xc1ae('0x58')]!==null;var _0x37d833=path[_0xc1ae('0x59')](config[_0xc1ae('0x5a')],_0xc1ae('0x5b'));if(_0x25eaff){_0x37d833=path['join'](_0x37d833,_0xc1ae('0x5c'));}var _0x24fbd9=path[_0xc1ae('0x59')](_0x37d833,_0xdfec13[_0xc1ae('0x54')]);return _0x1e4f89[_0xc1ae('0x57')](_0x24fbd9);}})[_0xc1ae('0x4a')](handleError(_0x1e4f89,null));}; \ No newline at end of file +var _0xf3e2=['fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Attachment','includeAll','include','findAll','rows','catch','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','download','findOne','join','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x2eddb9,_0x41e214){var _0x541be9=function(_0x34ace7){while(--_0x34ace7){_0x2eddb9['push'](_0x2eddb9['shift']());}};_0x541be9(++_0x41e214);}(_0xf3e2,0xa1));var _0x2f3e=function(_0x134e6f,_0x58c616){_0x134e6f=_0x134e6f-0x0;var _0x519a52=_0xf3e2[_0x134e6f];return _0x519a52;};'use strict';var emlformat=require(_0x2f3e('0x0'));var rimraf=require(_0x2f3e('0x1'));var zipdir=require(_0x2f3e('0x2'));var jsonpatch=require(_0x2f3e('0x3'));var rp=require(_0x2f3e('0x4'));var moment=require(_0x2f3e('0x5'));var BPromise=require(_0x2f3e('0x6'));var Mustache=require(_0x2f3e('0x7'));var util=require(_0x2f3e('0x8'));var path=require('path');var sox=require(_0x2f3e('0x9'));var csv=require(_0x2f3e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f3e('0xb'));var _=require('lodash');var squel=require(_0x2f3e('0xc'));var crypto=require(_0x2f3e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2f3e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2f3e('0xf'));var Papa=require(_0x2f3e('0x10'));var Redis=require(_0x2f3e('0x11'));var authService=require(_0x2f3e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2f3e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f3e('0x14'));var utils=require(_0x2f3e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f3e('0x16'))['db'];function respondWithStatusCode(_0x390d14,_0x43f407){_0x43f407=_0x43f407||0xcc;return function(_0x679ef0){if(_0x679ef0){return _0x390d14[_0x2f3e('0x17')](_0x43f407);}return _0x390d14[_0x2f3e('0x18')](_0x43f407)[_0x2f3e('0x19')]();};}function respondWithResult(_0x486152,_0x1f6115){_0x1f6115=_0x1f6115||0xc8;return function(_0x3b3460){if(_0x3b3460){return _0x486152[_0x2f3e('0x18')](_0x1f6115)[_0x2f3e('0x1a')](_0x3b3460);}};}function respondWithFilteredResult(_0x5003f1,_0x359ce4){return function(_0x2c1284){if(_0x2c1284){var _0x3c980c=typeof _0x359ce4[_0x2f3e('0x1b')]==='undefined'&&typeof _0x359ce4[_0x2f3e('0x1c')]==='undefined';var _0x56405d=_0x2c1284[_0x2f3e('0x1d')];var _0x1d4456=_0x3c980c?0x0:_0x359ce4[_0x2f3e('0x1b')];var _0x226ded=_0x3c980c?_0x2c1284[_0x2f3e('0x1d')]:_0x359ce4[_0x2f3e('0x1b')]+_0x359ce4[_0x2f3e('0x1c')];var _0x57d8b9;if(_0x226ded>=_0x56405d){_0x226ded=_0x56405d;_0x57d8b9=0xc8;}else{_0x57d8b9=0xce;}_0x5003f1[_0x2f3e('0x18')](_0x57d8b9);return _0x5003f1[_0x2f3e('0x1e')](_0x2f3e('0x1f'),_0x1d4456+'-'+_0x226ded+'/'+_0x56405d)[_0x2f3e('0x1a')](_0x2c1284);}return null;};}function patchUpdates(_0x26bf2){return function(_0x324d73){try{jsonpatch[_0x2f3e('0x20')](_0x324d73,_0x26bf2,!![]);}catch(_0x2915d6){return BPromise[_0x2f3e('0x21')](_0x2915d6);}return _0x324d73[_0x2f3e('0x22')]();};}function saveUpdates(_0x344a3c,_0x26c8e6){return function(_0x170dca){if(_0x170dca){return _0x170dca['update'](_0x344a3c)[_0x2f3e('0x23')](function(_0x87218f){return _0x87218f;});}return null;};}function removeEntity(_0x220981,_0x2703f6){return function(_0xf85ad2){if(_0xf85ad2){return _0xf85ad2[_0x2f3e('0x24')]()[_0x2f3e('0x23')](function(){_0x220981[_0x2f3e('0x18')](0xcc)[_0x2f3e('0x19')]();});}};}function handleEntityNotFound(_0xe71ed7,_0x1bd922){return function(_0x4ae956){if(!_0x4ae956){_0xe71ed7['sendStatus'](0x194);}return _0x4ae956;};}function handleError(_0x304b35,_0x3ebc45){_0x3ebc45=_0x3ebc45||0x1f4;return function(_0x54b93f){logger['error'](_0x54b93f[_0x2f3e('0x25')]);if(_0x54b93f[_0x2f3e('0x26')]){delete _0x54b93f[_0x2f3e('0x26')];}_0x304b35[_0x2f3e('0x18')](_0x3ebc45)[_0x2f3e('0x27')](_0x54b93f);};}exports['index']=function(_0x3e0703,_0x147558){var _0x44d310={},_0x52db0e={},_0x9934a0={'count':0x0,'rows':[]};var _0x214416=_[_0x2f3e('0x28')](db['Attachment']['rawAttributes'],function(_0xd3a9b2){return{'name':_0xd3a9b2[_0x2f3e('0x29')],'type':_0xd3a9b2[_0x2f3e('0x2a')][_0x2f3e('0x2b')]};});_0x52db0e[_0x2f3e('0x2c')]=_[_0x2f3e('0x28')](_0x214416,_0x2f3e('0x26'));_0x52db0e[_0x2f3e('0x2d')]=_[_0x2f3e('0x2e')](_0x3e0703['query']);_0x52db0e[_0x2f3e('0x2f')]=_[_0x2f3e('0x30')](_0x52db0e[_0x2f3e('0x2c')],_0x52db0e[_0x2f3e('0x2d')]);_0x44d310[_0x2f3e('0x31')]=_['intersection'](_0x52db0e[_0x2f3e('0x2c')],qs[_0x2f3e('0x32')](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x32')]));_0x44d310[_0x2f3e('0x31')]=_0x44d310[_0x2f3e('0x31')]['length']?_0x44d310['attributes']:_0x52db0e['model'];if(!_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x33')](_0x2f3e('0x34'))){_0x44d310[_0x2f3e('0x1c')]=qs[_0x2f3e('0x1c')](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x1c')]);_0x44d310[_0x2f3e('0x1b')]=qs[_0x2f3e('0x1b')](_0x3e0703[_0x2f3e('0x2d')]['offset']);}_0x44d310[_0x2f3e('0x35')]=qs['sort'](_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x36')]);_0x44d310[_0x2f3e('0x37')]=qs[_0x2f3e('0x2f')](_[_0x2f3e('0x38')](_0x3e0703[_0x2f3e('0x2d')],_0x52db0e[_0x2f3e('0x2f')]),_0x214416);if(_0x3e0703[_0x2f3e('0x2d')]['filter']){_0x44d310[_0x2f3e('0x37')]=_['merge'](_0x44d310[_0x2f3e('0x37')],{'$or':_[_0x2f3e('0x28')](_0x214416,function(_0x523859){if(_0x523859[_0x2f3e('0x2a')]!=='VIRTUAL'){var _0x41da6c={};_0x41da6c[_0x523859[_0x2f3e('0x26')]]={'$like':'%'+_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x39')]+'%'};return _0x41da6c;}})});}_0x44d310=_[_0x2f3e('0x3a')]({},_0x44d310,_0x3e0703[_0x2f3e('0x3b')]);var _0x402e08={'where':_0x44d310[_0x2f3e('0x37')]};return db[_0x2f3e('0x3c')]['count'](_0x402e08)[_0x2f3e('0x23')](function(_0x38b67d){_0x9934a0['count']=_0x38b67d;if(_0x3e0703[_0x2f3e('0x2d')][_0x2f3e('0x3d')]){_0x44d310[_0x2f3e('0x3e')]=[{'all':!![]}];}return db[_0x2f3e('0x3c')][_0x2f3e('0x3f')](_0x44d310);})[_0x2f3e('0x23')](function(_0x3569e2){_0x9934a0[_0x2f3e('0x40')]=_0x3569e2;return _0x9934a0;})[_0x2f3e('0x23')](respondWithFilteredResult(_0x147558,_0x44d310))[_0x2f3e('0x41')](handleError(_0x147558,null));};exports['show']=function(_0x398761,_0x5b682e){var _0x5f1aa3={'raw':!![],'where':{'id':_0x398761[_0x2f3e('0x42')]['id']}},_0x61132={};_0x61132['model']=_[_0x2f3e('0x2e')](db['Attachment'][_0x2f3e('0x43')]);_0x61132['query']=_['keys'](_0x398761[_0x2f3e('0x2d')]);_0x61132['filters']=_[_0x2f3e('0x30')](_0x61132[_0x2f3e('0x2c')],_0x61132[_0x2f3e('0x2d')]);_0x5f1aa3[_0x2f3e('0x31')]=_[_0x2f3e('0x30')](_0x61132[_0x2f3e('0x2c')],qs[_0x2f3e('0x32')](_0x398761[_0x2f3e('0x2d')][_0x2f3e('0x32')]));_0x5f1aa3[_0x2f3e('0x31')]=_0x5f1aa3['attributes']['length']?_0x5f1aa3[_0x2f3e('0x31')]:_0x61132[_0x2f3e('0x2c')];if(_0x398761[_0x2f3e('0x2d')]['includeAll']){_0x5f1aa3['include']=[{'all':!![]}];}_0x5f1aa3=_[_0x2f3e('0x3a')]({},_0x5f1aa3,_0x398761[_0x2f3e('0x3b')]);return db[_0x2f3e('0x3c')][_0x2f3e('0x44')](_0x5f1aa3)[_0x2f3e('0x23')](handleEntityNotFound(_0x5b682e,null))[_0x2f3e('0x23')](respondWithResult(_0x5b682e,null))[_0x2f3e('0x41')](handleError(_0x5b682e,null));};exports[_0x2f3e('0x45')]=function(_0x455f28,_0x2c8204){var _0x4f6aa1={'where':{'id':_0x455f28[_0x2f3e('0x42')]['id']}},_0x1828fd={};_0x1828fd[_0x2f3e('0x2c')]=_[_0x2f3e('0x2e')](db[_0x2f3e('0x3c')][_0x2f3e('0x43')]);_0x4f6aa1[_0x2f3e('0x31')]=_['intersection'](_0x1828fd[_0x2f3e('0x2c')],qs['fields'](_0x455f28['query'][_0x2f3e('0x32')]));_0x4f6aa1[_0x2f3e('0x31')]=_0x4f6aa1[_0x2f3e('0x31')][_0x2f3e('0x46')]?_0x4f6aa1[_0x2f3e('0x31')]:_0x1828fd[_0x2f3e('0x2c')];if(_0x455f28[_0x2f3e('0x2d')]['includeAll']){_0x4f6aa1[_0x2f3e('0x3e')]=[{'all':!![]}];}_0x4f6aa1=_[_0x2f3e('0x3a')]({},_0x4f6aa1,_0x455f28['options']);return db[_0x2f3e('0x3c')][_0x2f3e('0x44')](_0x4f6aa1)[_0x2f3e('0x23')](handleEntityNotFound(_0x2c8204,null))[_0x2f3e('0x23')](function(_0x336a9b){if(_0x336a9b){var _0x5172e2=_0x336a9b[_0x2f3e('0x47')]({'plain':!![]});_0x5172e2=qs[_0x2f3e('0x48')](_0x5172e2,['id',_0x2f3e('0x49'),_0x2f3e('0x4a')]);_0x455f28[_0x2f3e('0x4b')]=_[_0x2f3e('0x48')](_0x455f28['body'],['id',_0x2f3e('0x49'),'updatedAt']);return db['Attachment']['create'](_['merge'](_0x5172e2,_0x455f28[_0x2f3e('0x4b')]),{'include':_0x455f28[_0x2f3e('0x2d')][_0x2f3e('0x3d')]?[{'all':!![]}]:undefined});}})[_0x2f3e('0x23')](respondWithResult(_0x2c8204,0xc9))[_0x2f3e('0x41')](handleError(_0x2c8204,null));};exports['update']=function(_0x39d049,_0x54ceaa){if(_0x39d049[_0x2f3e('0x4b')]['id']){delete _0x39d049[_0x2f3e('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0x39d049[_0x2f3e('0x42')]['id']}})[_0x2f3e('0x23')](handleEntityNotFound(_0x54ceaa,null))[_0x2f3e('0x23')](saveUpdates(_0x39d049[_0x2f3e('0x4b')],null))[_0x2f3e('0x23')](respondWithResult(_0x54ceaa,null))[_0x2f3e('0x41')](handleError(_0x54ceaa,null));};exports[_0x2f3e('0x24')]=function(_0x3ce7a8,_0x44613a){return db[_0x2f3e('0x3c')][_0x2f3e('0x44')]({'where':{'id':_0x3ce7a8[_0x2f3e('0x42')]['id']}})[_0x2f3e('0x23')](handleEntityNotFound(_0x44613a,null))['then'](removeEntity(_0x44613a,null))[_0x2f3e('0x41')](handleError(_0x44613a,null));};exports[_0x2f3e('0x4c')]=function(_0x1a568b,_0x430c2f,_0x5d78b2){_0x1a568b[_0x2f3e('0x4b')][_0x2f3e('0x26')]=_0x1a568b[_0x2f3e('0x4d')][_0x2f3e('0x4e')];_0x1a568b[_0x2f3e('0x4b')]['basename']=_0x1a568b[_0x2f3e('0x4d')][_0x2f3e('0x4f')];_0x1a568b['body'][_0x2f3e('0x2a')]=_0x1a568b[_0x2f3e('0x4d')]['mimetype'];return db['Attachment'][_0x2f3e('0x4c')](_0x1a568b[_0x2f3e('0x4b')])[_0x2f3e('0x23')](respondWithResult(_0x430c2f,0xc9))[_0x2f3e('0x41')](handleError(_0x430c2f,null));};exports[_0x2f3e('0x50')]=function(_0x476f00,_0x3d4cfd,_0x52342a){return db[_0x2f3e('0x3c')][_0x2f3e('0x51')]({'where':{'id':_0x476f00[_0x2f3e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3d4cfd,null))[_0x2f3e('0x23')](function(_0x3d1016){if(_0x3d1016){var _0x459af0=_0x3d1016['ChatOfflineMessageId']!==null;var _0x20c54e=path[_0x2f3e('0x52')](config['root'],_0x2f3e('0x53'));if(_0x459af0){_0x20c54e=path[_0x2f3e('0x52')](_0x20c54e,_0x2f3e('0x54'));}var _0x1f182c=path[_0x2f3e('0x52')](_0x20c54e,_0x3d1016[_0x2f3e('0x55')]);return _0x3d4cfd['download'](_0x1f182c);}})[_0x2f3e('0x41')](handleError(_0x3d4cfd,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e631940..a446bb8 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 _0x8260=['moment','request-promise','path','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api'];(function(_0x28c15d,_0x41ae5e){var _0x27d1e2=function(_0x5da63f){while(--_0x5da63f){_0x28c15d['push'](_0x28c15d['shift']());}};_0x27d1e2(++_0x41ae5e);}(_0x8260,0x173));var _0x0826=function(_0x4517cf,_0x3aaaca){_0x4517cf=_0x4517cf-0x0;var _0x408bf4=_0x8260[_0x4517cf];return _0x408bf4;};'use strict';var _=require(_0x0826('0x0'));var util=require(_0x0826('0x1'));var logger=require('../../config/logger')(_0x0826('0x2'));var moment=require(_0x0826('0x3'));var BPromise=require('bluebird');var rp=require(_0x0826('0x4'));var fs=require('fs');var path=require(_0x0826('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0826('0x6'));module[_0x0826('0x7')]=function(_0x57f3db,_0x211b40){return _0x57f3db[_0x0826('0x8')](_0x0826('0x9'),attributes,{'tableName':_0x0826('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ba8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x2bcf71,_0x192386){var _0x1d1e37=function(_0x180094){while(--_0x180094){_0x2bcf71['push'](_0x2bcf71['shift']());}};_0x1d1e37(++_0x192386);}(_0x2ba8,0xa5));var _0x82ba=function(_0x2c17b2,_0x486b77){_0x2c17b2=_0x2c17b2-0x0;var _0x40863b=_0x2ba8[_0x2c17b2];return _0x40863b;};'use strict';var _=require(_0x82ba('0x0'));var util=require(_0x82ba('0x1'));var logger=require(_0x82ba('0x2'))('api');var moment=require(_0x82ba('0x3'));var BPromise=require(_0x82ba('0x4'));var rp=require(_0x82ba('0x5'));var fs=require('fs');var path=require(_0x82ba('0x6'));var rimraf=require(_0x82ba('0x7'));var config=require(_0x82ba('0x8'));var attributes=require(_0x82ba('0x9'));module[_0x82ba('0xa')]=function(_0x11efa5,_0x4c1022){return _0x11efa5[_0x82ba('0xb')](_0x82ba('0xc'),attributes,{'tableName':_0x82ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 1388f07..f43e1e5 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 _0x0506=['catch','CreateAttachment','Attachment','raw','then','lodash','util','moment','../../config/utils','rpc','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x0506,0x1d1));var _0x6050=function(_0x5ae265,_0x4f4eb6){_0x5ae265=_0x5ae265-0x0;var _0x60dd92=_0x0506[_0x5ae265];return _0x60dd92;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var moment=require(_0x6050('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6050('0x3'));var logger=require('../../config/logger')(_0x6050('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6050('0x5')][_0x6050('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2a3644,_0x1a89fb,_0x3512ba){return new BPromise(function(_0xf64de5,_0x4068d3){return client[_0x6050('0x7')](_0x2a3644,_0x3512ba)['then'](function(_0x312217){logger['info'](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));logger[_0x6050('0xa')](_0x6050('0xb'),_0x1a89fb,_0x6050('0x9'),JSON[_0x6050('0xc')](_0x312217));if(_0x312217[_0x6050('0xd')]){if(_0x312217[_0x6050('0xd')][_0x6050('0xe')]===0x1f4){logger[_0x6050('0xd')]('Attachment,\x20%s,\x20%s',_0x1a89fb,_0x312217[_0x6050('0xd')]['message']);return _0x4068d3(_0x312217[_0x6050('0xd')][_0x6050('0xf')]);}logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x312217['error'][_0x6050('0xf')]);return _0xf64de5(_0x312217['error'][_0x6050('0xf')]);}else{logger[_0x6050('0x10')](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));_0xf64de5(_0x312217[_0x6050('0x11')][_0x6050('0xf')]);}})[_0x6050('0x12')](function(_0x388de4){logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x388de4);_0x4068d3(_0x388de4);});});}exports[_0x6050('0x13')]=function(_0x347899){var _0x47f33f=this;return new Promise(function(_0x1dd507,_0x3e1ef6){return db[_0x6050('0x14')]['create'](_0x347899['body'],{'raw':_0x347899['options']?_0x347899['options'][_0x6050('0x15')]===undefined?!![]:![]:!![]})[_0x6050('0x16')](function(_0x4c0270){logger[_0x6050('0x10')](_0x6050('0x13'),_0x347899);logger[_0x6050('0xa')](_0x6050('0x13'),_0x347899,JSON[_0x6050('0xc')](_0x4c0270));_0x1dd507(_0x4c0270);})[_0x6050('0x12')](function(_0x50d6f6){logger[_0x6050('0xd')](_0x6050('0x13'),_0x50d6f6[_0x6050('0xf')],_0x347899);_0x3e1ef6(_0x47f33f[_0x6050('0xd')](0x1f4,_0x50d6f6[_0x6050('0xf')]));});});}; \ No newline at end of file +var _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x89e8,0x74));var _0x889e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x89e8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index f55d1df..8f25c41 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x404f6b,_0x21484d){_0x404f6b=_0x404f6b-0x0;var _0x472790=_0xdb28[_0x404f6b];return _0x472790;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index a08a35f..1e59c60 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d13=['../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','undefined','baseDN','url','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','password','role','disabled','blocked','admin','agent','name','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','signToken','online','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util'];(function(_0x29fa8b,_0x23d89){var _0x3f6a1d=function(_0x339e4c){while(--_0x339e4c){_0x29fa8b['push'](_0x29fa8b['shift']());}};_0x3f6a1d(++_0x23d89);}(_0x6d13,0xe4));var _0x36d1=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x6d13[_0x581af1];return _0x54c22e;};'use strict';var passport=require(_0x36d1('0x0'));var LocalStrategy=require(_0x36d1('0x1'))[_0x36d1('0x2')];var moment=require(_0x36d1('0x3'));var ActiveDirectory=require(_0x36d1('0x4'));var BPromise=require(_0x36d1('0x5'));var util=require(_0x36d1('0x6'));var db=require(_0x36d1('0x7'))['db'];var authService=require(_0x36d1('0x8'));var utils=require(_0x36d1('0x9'));var config=require(_0x36d1('0xa'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x480c90){var _0x3dd357=![];if(typeof _0x480c90['activedirectory']!==_0x36d1('0xb')){_0x3dd357=_0x480c90['activedirectory'][_0x36d1('0xc')]&&_0x480c90['activedirectory'][_0x36d1('0xd')]&&_0x480c90[_0x36d1('0xe')][_0x36d1('0xf')];}return _0x3dd357;}function adAuthenticate(_0x232b58,_0x353a11,_0x2ca101){return new BPromise(function(_0x5f06dc,_0x4cf514){try{var _0x310553=new ActiveDirectory(_0x232b58);_0x310553[_0x36d1('0x10')](_0x353a11,_0x2ca101,function(_0x1ee9d4,_0x2b85a2){if(_0x1ee9d4){logger[_0x36d1('0x11')](_0x36d1('0x12'),_0x353a11,util[_0x36d1('0x13')](_0x1ee9d4,{'showHidden':![],'depth':null}));_0x4cf514('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2b85a2){logger[_0x36d1('0x11')](_0x36d1('0x14'),_0x353a11);_0x4cf514(_0x36d1('0x15'));}else{_0x5f06dc(_0x2b85a2);}});}catch(_0x68fd5d){_0x4cf514(_0x68fd5d);}});}function ActiveDirectoryAuthenticate(_0x575b65,_0x3f6035,_0x1632a1,_0x4fb67c){var _0x252498,_0x2722a0;if(!isActiveDirectoryConfigured(config)){logger[_0x36d1('0x11')](_0x36d1('0x16'),_0x3f6035);return _0x4fb67c(null,![],{'message':_0x36d1('0x15')});}return db['Setting'][_0x36d1('0x17')]({'where':{'id':0x1},'attributes':[_0x36d1('0x18'),'blockDuration'],'raw':!![]})[_0x36d1('0x19')](function(_0x19ed9f){_0x252498=_0x19ed9f;if(!_0x252498[_0x36d1('0x18')]){logger[_0x36d1('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3f6035);throw new Error(_0x36d1('0x15'));}return _0x575b65[_0x36d1('0x17')]({'attributes':['id','name',_0x36d1('0x1a'),'salt',_0x36d1('0x1b'),_0x36d1('0x1c'),_0x36d1('0x1d'),'blockedAt','online'],'where':{'name':_0x3f6035,'role':{'$or':[_0x36d1('0x1e'),'user',_0x36d1('0x1f')]},'adSsoEnabled':!![]}});})[_0x36d1('0x19')](function(_0x48fc8f){if(!_0x48fc8f||_0x48fc8f&&_0x48fc8f[_0x36d1('0x20')]!==_0x3f6035){throw new Error(_0x36d1('0x15'));}_0x2722a0=_0x48fc8f;var _0x1fcfde=_0x2722a0[_0x36d1('0x20')]+'@'+config[_0x36d1('0xe')][_0x36d1('0xf')];return adAuthenticate(config[_0x36d1('0xe')],_0x1fcfde,_0x1632a1);})['then'](function(_0x342e42){if(_0x2722a0[_0x36d1('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x252498[_0x36d1('0x21')]>0x0){if(_0x2722a0[_0x36d1('0x1d')]){if(moment(_0x2722a0[_0x36d1('0x22')])[_0x36d1('0x23')](_0x252498[_0x36d1('0x21')],_0x36d1('0x24'))>moment()){throw new Error(_0x36d1('0x15'));}return utils[_0x36d1('0x25')](_0x2722a0,0x0,![],null)[_0x36d1('0x19')](function(){return utils[_0x36d1('0x26')](_0x2722a0);})[_0x36d1('0x19')](function(){return _0x4fb67c(null,_0x2722a0);});}else{return utils[_0x36d1('0x26')](_0x2722a0)['then'](function(){return _0x4fb67c(null,_0x2722a0);});}}else{return utils['getLicense'](_0x2722a0)[_0x36d1('0x19')](function(){return _0x4fb67c(null,_0x2722a0);});}})[_0x36d1('0x27')](function(_0x167d6f){return _0x4fb67c(null,![],_0x167d6f);});}function handleError(_0x3735ee,_0x59955e,_0xd12e83){return _0x3735ee[_0x36d1('0x28')](_0x59955e||0x1f4)[_0x36d1('0x29')]({'message':_0xd12e83?_0xd12e83['message']||_0xd12e83:''});}exports[_0x36d1('0x2a')]=function(_0x61beca,_0x252947,_0x468236){passport[_0x36d1('0x10')](_0x36d1('0x2b'),function(_0x3b0b53,_0x3432f3,_0x381637){var _0x556afe=_0x3b0b53||_0x381637;if(_0x556afe){return handleError(_0x252947,0x191,_0x556afe);}if(!_0x3432f3){return handleError(_0x252947,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2a402c={'payload':{'id':_0x3432f3['id'],'role':_0x3432f3['role']},'options':{'expiresIn':0x15180}};return authService[_0x36d1('0x2c')](_0x2a402c)[_0x36d1('0x19')](function(_0x4f1b60){_0x252947['json']({'id':_0x3432f3['id'],'token':_0x4f1b60,'statusCall':'','isAlreadyLogged':_0x3432f3[_0x36d1('0x2d')]});});}})(_0x61beca,_0x252947,_0x468236);};passport[_0x36d1('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x36d1('0x20'),'passwordField':_0x36d1('0x1a')},function(_0x34bf66,_0x4aab03,_0x5f081d){return ActiveDirectoryAuthenticate(db['User'],_0x34bf66,_0x4aab03,_0x5f081d);})); \ No newline at end of file +var _0xf5ac=['authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','minutes','clearBlockUser','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xf5ac,0x162));var _0xcf5a=function(_0x415ecc,_0x592ba9){_0x415ecc=_0x415ecc-0x0;var _0x475f35=_0xf5ac[_0x415ecc];return _0x475f35;};'use strict';var passport=require(_0xcf5a('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xcf5a('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xcf5a('0x2'));var util=require(_0xcf5a('0x3'));var db=require(_0xcf5a('0x4'))['db'];var authService=require(_0xcf5a('0x5'));var utils=require('../../config/utils');var config=require(_0xcf5a('0x6'));var logger=require(_0xcf5a('0x7'))(_0xcf5a('0x8'));function isActiveDirectoryConfigured(_0x5e9b29){var _0x22fc54=![];if(typeof _0x5e9b29[_0xcf5a('0x9')]!==_0xcf5a('0xa')){_0x22fc54=_0x5e9b29[_0xcf5a('0x9')][_0xcf5a('0xb')]&&_0x5e9b29[_0xcf5a('0x9')][_0xcf5a('0xc')]&&_0x5e9b29['activedirectory'][_0xcf5a('0xd')];}return _0x22fc54;}function adAuthenticate(_0x22a867,_0x1dc0be,_0xdc80d4){return new BPromise(function(_0x398a5a,_0x151372){try{var _0x253b11=new ActiveDirectory(_0x22a867);_0x253b11[_0xcf5a('0xe')](_0x1dc0be,_0xdc80d4,function(_0x224598,_0x38cbf1){if(_0x224598){logger[_0xcf5a('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x1dc0be,util['inspect'](_0x224598,{'showHidden':![],'depth':null}));_0x151372(_0xcf5a('0x10'));}else if(!_0x38cbf1){logger[_0xcf5a('0xf')](_0xcf5a('0x11'),_0x1dc0be);_0x151372(_0xcf5a('0x10'));}else{_0x398a5a(_0x38cbf1);}});}catch(_0x1b2857){_0x151372(_0x1b2857);}});}function ActiveDirectoryAuthenticate(_0xc8e4f1,_0x47705d,_0x1746e0,_0x4f8227){var _0x3372c3,_0x2997d6;if(!isActiveDirectoryConfigured(config)){logger[_0xcf5a('0xf')](_0xcf5a('0x12'),_0x47705d);return _0x4f8227(null,![],{'message':_0xcf5a('0x10')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcf5a('0x13'),_0xcf5a('0x14')],'raw':!![]})[_0xcf5a('0x15')](function(_0x7f179c){_0x3372c3=_0x7f179c;if(!_0x3372c3[_0xcf5a('0x13')]){logger['error'](_0xcf5a('0x16'),_0x47705d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xc8e4f1['findOne']({'attributes':['id',_0xcf5a('0x17'),_0xcf5a('0x18'),_0xcf5a('0x19'),_0xcf5a('0x1a'),_0xcf5a('0x1b'),_0xcf5a('0x1c'),_0xcf5a('0x1d'),_0xcf5a('0x1e')],'where':{'name':_0x47705d,'role':{'$or':[_0xcf5a('0x1f'),'user',_0xcf5a('0x20')]},'adSsoEnabled':!![]}});})[_0xcf5a('0x15')](function(_0x5b5886){if(!_0x5b5886||_0x5b5886&&_0x5b5886['name']!==_0x47705d){throw new Error(_0xcf5a('0x10'));}_0x2997d6=_0x5b5886;var _0x42b65a=_0x2997d6[_0xcf5a('0x17')]+'@'+config[_0xcf5a('0x9')][_0xcf5a('0xd')];return adAuthenticate(config[_0xcf5a('0x9')],_0x42b65a,_0x1746e0);})['then'](function(_0x139aaa){if(_0x2997d6[_0xcf5a('0x1b')]){throw new Error(_0xcf5a('0x10'));}if(_0x3372c3['blockDuration']>0x0){if(_0x2997d6['blocked']){if(moment(_0x2997d6[_0xcf5a('0x1d')])[_0xcf5a('0x21')](_0x3372c3['blockDuration'],_0xcf5a('0x22'))>moment()){throw new Error(_0xcf5a('0x10'));}return utils[_0xcf5a('0x23')](_0x2997d6,0x0,![],null)[_0xcf5a('0x15')](function(){return utils[_0xcf5a('0x24')](_0x2997d6);})[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}else{return utils['getLicense'](_0x2997d6)[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}}else{return utils['getLicense'](_0x2997d6)[_0xcf5a('0x15')](function(){return _0x4f8227(null,_0x2997d6);});}})[_0xcf5a('0x25')](function(_0x4ea9f6){return _0x4f8227(null,![],_0x4ea9f6);});}function handleError(_0x45eaa3,_0x94f43b,_0x4cdcc2){return _0x45eaa3['status'](_0x94f43b||0x1f4)['send']({'message':_0x4cdcc2?_0x4cdcc2[_0xcf5a('0x26')]||_0x4cdcc2:''});}exports[_0xcf5a('0x27')]=function(_0x560efc,_0x40a3d4,_0x12a05f){passport[_0xcf5a('0xe')](_0xcf5a('0x28'),function(_0x12bce7,_0x1edf3a,_0x39fe49){var _0xcb59f5=_0x12bce7||_0x39fe49;if(_0xcb59f5){return handleError(_0x40a3d4,0x191,_0xcb59f5);}if(!_0x1edf3a){return handleError(_0x40a3d4,0x194,{'message':_0xcf5a('0x29')});}else{var _0x4f9070={'payload':{'id':_0x1edf3a['id'],'role':_0x1edf3a[_0xcf5a('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xcf5a('0x2a')](_0x4f9070)[_0xcf5a('0x15')](function(_0x2e4942){_0x40a3d4[_0xcf5a('0x2b')]({'id':_0x1edf3a['id'],'token':_0x2e4942,'statusCall':'','isAlreadyLogged':_0x1edf3a[_0xcf5a('0x1e')]});});}})(_0x560efc,_0x40a3d4,_0x12a05f);};passport[_0xcf5a('0x2c')](_0xcf5a('0x28'),new LocalStrategy({'usernameField':_0xcf5a('0x17'),'passwordField':_0xcf5a('0x18')},function(_0x29bd15,_0x406e0b,_0x1554b0){return ActiveDirectoryAuthenticate(db[_0xcf5a('0x2d')],_0x29bd15,_0x406e0b,_0x1554b0);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 1fb4db0..b5ddbcb 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x762d=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x90604a,_0x478069){var _0x5b517b=function(_0x475f05){while(--_0x475f05){_0x90604a['push'](_0x90604a['shift']());}};_0x5b517b(++_0x478069);}(_0x762d,0xd3));var _0xd762=function(_0x4b31b6,_0x5366d5){_0x4b31b6=_0x4b31b6-0x0;var _0x169a87=_0x762d[_0x4b31b6];return _0x169a87;};'use strict';var express=require(_0xd762('0x0'));var router=express[_0xd762('0x1')]();var controller=require(_0xd762('0x2'));router[_0xd762('0x3')]('/',controller[_0xd762('0x4')]);module[_0xd762('0x5')]=router; \ No newline at end of file +var _0xcd73=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0x53ba99,_0x31d724){var _0xab94e4=function(_0x242935){while(--_0x242935){_0x53ba99['push'](_0x53ba99['shift']());}};_0xab94e4(++_0x31d724);}(_0xcd73,0xa7));var _0x3cd7=function(_0x1c6b54,_0x57304c){_0x1c6b54=_0x1c6b54-0x0;var _0x144008=_0xcd73[_0x1c6b54];return _0x144008;};'use strict';var express=require('express');var router=express[_0x3cd7('0x0')]();var controller=require(_0x3cd7('0x1'));router[_0x3cd7('0x2')]('/',controller[_0x3cd7('0x3')]);module[_0x3cd7('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 601aa6b..63517e0 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x7a54,0x106));var _0x47a5=function(_0x57f044,_0x2be669){_0x57f044=_0x57f044-0x0;var _0x381fb7=_0x7a54[_0x57f044];return _0x381fb7;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x17f65a,_0x24ec2e){var _0x523b7c=function(_0x7b2ce7){while(--_0x7b2ce7){_0x17f65a['push'](_0x17f65a['shift']());}};_0x523b7c(++_0x24ec2e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index cdfc106..fd3270d 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 _0x9d32=['get','/callback','callback','isMiddleware','login','passport','Router','../../components/auth/service'];(function(_0x7e8ffb,_0x272fcc){var _0x1756f6=function(_0x5edd94){while(--_0x5edd94){_0x7e8ffb['push'](_0x7e8ffb['shift']());}};_0x1756f6(++_0x272fcc);}(_0x9d32,0xd5));var _0x29d3=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0x9d32[_0x4b0290];return _0x4bd9f4;};'use strict';var express=require('express');var passport=require(_0x29d3('0x0'));var router=express[_0x29d3('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x29d3('0x2'));router['get']('/',controller['login']);router[_0x29d3('0x3')](_0x29d3('0x4'),controller[_0x29d3('0x5')],authService[_0x29d3('0x6')],userController[_0x29d3('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x4133=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x4bc4f7,_0x32986a){var _0x4aa0c5=function(_0x174914){while(--_0x174914){_0x4bc4f7['push'](_0x4bc4f7['shift']());}};_0x4aa0c5(++_0x32986a);}(_0x4133,0x14a));var _0x3413=function(_0x1214d3,_0x2a3519){_0x1214d3=_0x1214d3-0x0;var _0x3ff802=_0x4133[_0x1214d3];return _0x3ff802;};'use strict';var express=require(_0x3413('0x0'));var passport=require(_0x3413('0x1'));var router=express[_0x3413('0x2')]();var controller=require(_0x3413('0x3'));var userController=require(_0x3413('0x4'));var authService=require(_0x3413('0x5'));router[_0x3413('0x6')]('/',controller[_0x3413('0x7')]);router[_0x3413('0x6')](_0x3413('0x8'),controller[_0x3413('0x9')],authService[_0x3413('0xa')],userController[_0x3413('0x7')],authService[_0x3413('0xb')]);module[_0x3413('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b3c36c0..55a3a94 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 _0xfd61=['json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','status','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x5495e8,_0x588423){var _0x1aaafb=function(_0x5e7dc0){while(--_0x5e7dc0){_0x5495e8['push'](_0x5495e8['shift']());}};_0x1aaafb(++_0x588423);}(_0xfd61,0x78));var _0x1fd6=function(_0x180b71,_0x59ccec){_0x180b71=_0x180b71-0x0;var _0x57c42c=_0xfd61[_0x180b71];return _0x57c42c;};'use strict';var util=require(_0x1fd6('0x0'));var passport=require(_0x1fd6('0x1'));var LocalStrategy=require(_0x1fd6('0x2'))[_0x1fd6('0x3')];var jayson=require('jayson/promise');var _=require(_0x1fd6('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x1fd6('0x5'))['db'];var authService=require(_0x1fd6('0x6'));var utils=require(_0x1fd6('0x7'));var client=jayson[_0x1fd6('0x8')][_0x1fd6('0x9')]({'port':0x232b});function localAuthenticate(_0x26377c,_0x5f31c6,_0x3e4b68,_0x2767ea){var _0x345f73,_0x552779;return db[_0x1fd6('0xa')][_0x1fd6('0xb')]({'where':{'id':0x1},'attributes':[_0x1fd6('0xc'),_0x1fd6('0xd')],'raw':!![]})[_0x1fd6('0xe')](function(_0x36c243){_0x345f73=_0x36c243;return _0x26377c['findOne']({'attributes':['id',_0x1fd6('0xf'),_0x1fd6('0x10'),_0x1fd6('0x11'),_0x1fd6('0x12'),_0x1fd6('0x13'),'blocked',_0x1fd6('0x14'),_0x1fd6('0x15')],'where':{'name':_0x5f31c6,'role':{'$or':[_0x1fd6('0x16'),_0x1fd6('0x17'),'agent']}}});})[_0x1fd6('0xe')](function(_0x409b3b){if(!_0x409b3b||_0x409b3b&&_0x409b3b[_0x1fd6('0xf')]!==_0x5f31c6){throw new Error(_0x1fd6('0x18'));}else{_0x552779=_0x409b3b;return _0x552779;}})[_0x1fd6('0xe')](function(){_0x552779[_0x1fd6('0x19')](_0x3e4b68,function(_0x572d46,_0x14d2b8){var _0x3e84cd=_0x552779[_0x1fd6('0x15')]+0x1;if(_0x572d46){return _0x2767ea(_0x572d46);}else if(!_0x14d2b8){if(_0x552779[_0x1fd6('0x13')]){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}else if(_0x345f73['allowedLoginAttempts']>0x0){if(_0x552779[_0x1fd6('0x1a')]){if(_0x345f73[_0x1fd6('0xd')]>0x0){if(moment(_0x552779['blockedAt'])['add'](_0x345f73[_0x1fd6('0xd')],_0x1fd6('0x1b'))>moment()){return _0x2767ea(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1fd6('0x1c')](_0x552779,_0x3e84cd,![],null)[_0x1fd6('0xe')](function(){return _0x2767ea(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}}else{if(_0x3e84cd>=_0x345f73[_0x1fd6('0xc')]){return utils[_0x1fd6('0x1c')](_0x552779,0x0,!![],moment())[_0x1fd6('0xe')](function(){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});});}else{return utils[_0x1fd6('0x1c')](_0x552779,_0x3e84cd,![],null)[_0x1fd6('0xe')](function(){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});});}}}else{return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}}else{if(_0x552779[_0x1fd6('0x13')]){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}else if(_0x345f73[_0x1fd6('0xc')]>0x0){if(_0x552779['blocked']){if(_0x345f73[_0x1fd6('0xd')]>0x0){if(moment(_0x552779['blockedAt'])['add'](_0x345f73[_0x1fd6('0xd')],_0x1fd6('0x1b'))>moment()){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}else{return utils[_0x1fd6('0x1c')](_0x552779,0x0,![],null)[_0x1fd6('0xe')](function(){return utils[_0x1fd6('0x1d')](_0x552779);})[_0x1fd6('0xe')](function(){return _0x2767ea(null,_0x552779);});}}else{return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}}else{return utils[_0x1fd6('0x1c')](_0x552779,0x0,![],null)[_0x1fd6('0xe')](function(){return utils['getLicense'](_0x552779);})['then'](function(){return _0x2767ea(null,_0x552779);})['catch'](function(_0xeeee2e){return _0x2767ea(null,![],_0xeeee2e);});}}else{if(_0x552779[_0x1fd6('0x1a')]){return _0x2767ea(null,![],{'message':_0x1fd6('0x18')});}else{return utils[_0x1fd6('0x1d')](_0x552779)[_0x1fd6('0xe')](function(){return _0x2767ea(null,_0x552779);});}}}});})[_0x1fd6('0x1e')](function(_0x569693){return _0x2767ea(null,![],_0x569693);});}function sendServiceMail(_0x7c12ec){return db[_0x1fd6('0x1f')][_0x1fd6('0x20')]({'where':{'service':!![]},'attributes':['id',_0x1fd6('0xf'),_0x1fd6('0x21')],'include':[{'model':db[_0x1fd6('0x22')],'as':_0x1fd6('0x23'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x1fd6('0xe')](function(_0x5125ae){if(!_0x5125ae){throw new Error(_0x1fd6('0x24'));}var _0x2dac9f=_0x5125ae[_0x1fd6('0x25')]();var _0x566b36={'account':_0x2dac9f,'message':_[_0x1fd6('0x26')]({'from':util[_0x1fd6('0x27')](_0x1fd6('0x28'),_0x5125ae[_0x1fd6('0xf')],_0x5125ae['email']||_0x5125ae[_0x1fd6('0x23')]['user'])},_0x7c12ec)};return client['request'](_0x1fd6('0x29'),_0x566b36);})[_0x1fd6('0xe')](function(_0x3f9cea){if(_0x3f9cea[_0x1fd6('0x2a')]){throw new Error(util[_0x1fd6('0x27')](_0x1fd6('0x2b'),_0x3f9cea[_0x1fd6('0x2a')][_0x1fd6('0x2c')]||JSON[_0x1fd6('0x2d')](_0x3f9cea['error'])));}return!![];});}function handleError(_0x31b082,_0x367386,_0x21c189){return _0x31b082['status'](_0x367386||0x1f4)[_0x1fd6('0x2e')]({'message':_0x21c189?_0x21c189[_0x1fd6('0x2c')]||_0x21c189:''});}exports[_0x1fd6('0x2f')]=function(_0x19f3de,_0x5bb4ba,_0x33e935){passport[_0x1fd6('0x19')](_0x1fd6('0x30'),function(_0xffaf34,_0x43d183,_0x1a87ef){var _0x183f64=_0xffaf34||_0x1a87ef;if(_0x183f64){return handleError(_0x5bb4ba,0x191,_0x183f64);}if(!_0x43d183){return handleError(_0x5bb4ba,0x194,{'message':_0x1fd6('0x31')});}else{var _0x2ff0e1={'payload':{'id':_0x43d183['id'],'role':_0x43d183[_0x1fd6('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2ff0e1)[_0x1fd6('0xe')](function(_0x5935db){_0x5bb4ba[_0x1fd6('0x32')]({'id':_0x43d183['id'],'token':_0x5935db,'statusCall':'','isAlreadyLogged':_0x43d183[_0x1fd6('0x33')]});});}})(_0x19f3de,_0x5bb4ba,_0x33e935);};exports[_0x1fd6('0x34')]=function(_0x393cd1,_0x4d1327){if(!_0x393cd1[_0x1fd6('0x35')][_0x1fd6('0x21')]){return handleError(_0x4d1327,0x1f4,{'message':_0x1fd6('0x36')});}var _0x15cdf9=rs['generate']();_0x393cd1[_0x1fd6('0x35')][_0x1fd6('0x21')]=_0x393cd1[_0x1fd6('0x35')][_0x1fd6('0x21')][_0x1fd6('0x37')]()[_0x1fd6('0x38')]();var _0x1e214f;return db['Setting'][_0x1fd6('0xb')]({'where':{'id':0x1},'attributes':[_0x1fd6('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x29e0ac){_0x1e214f=_0x29e0ac;return db[_0x1fd6('0x39')]['find']({'where':{'email':_0x393cd1[_0x1fd6('0x35')][_0x1fd6('0x21')]}});})['then'](function(_0x5552ba){if(!_0x5552ba){throw new Error(_0x1fd6('0x3a'));}if(_0x5552ba[_0x1fd6('0x13')]){throw new Error(_0x1fd6('0x3b'));}if(_0x5552ba['blocked']){if(moment(_0x5552ba[_0x1fd6('0x14')])[_0x1fd6('0x3c')](_0x1e214f[_0x1fd6('0xd')],_0x1fd6('0x1b'))>moment()){throw new Error(_0x1fd6('0x3d'));}else{_0x5552ba['blocked']=![];_0x5552ba[_0x1fd6('0x14')]=null;}}_0x5552ba[_0x1fd6('0x3e')]=_0x15cdf9;_0x5552ba[_0x1fd6('0x3f')]=Date[_0x1fd6('0x40')]()+0x36ee80;return _0x5552ba[_0x1fd6('0x41')]();})['then'](function(){return sendServiceMail({'to':_0x393cd1[_0x1fd6('0x35')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1fd6('0x42')+_0x1fd6('0x43')+_0x1fd6('0x44')+_0x393cd1[_0x1fd6('0x45')][_0x1fd6('0x46')]+_0x1fd6('0x47')+_0x15cdf9+'\x0a\x0a'+_0x1fd6('0x48')});})[_0x1fd6('0xe')](function(){_0x4d1327['status'](0xc8)[_0x1fd6('0x2e')]({'message':_0x1fd6('0x49')});})[_0x1fd6('0x1e')](function(_0x15c193){return handleError(_0x4d1327,0x1f4,_0x15c193);});};exports[_0x1fd6('0x4a')]=function(_0x13d8a7,_0x113f4b){return db[_0x1fd6('0x39')]['find']({'where':{'resetPasswordToken':_0x13d8a7['params'][_0x1fd6('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x1fd6('0x40')]()}}})[_0x1fd6('0xe')](function(_0x591529){if(!_0x591529){throw new Error(_0x1fd6('0x4c'));}return db[_0x1fd6('0xa')][_0x1fd6('0xb')]({'attributes':['id',_0x1fd6('0x4d'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x1fd6('0xe')](function(_0x1495c6){if(_0x1495c6['securePassword'])authService['validatePasswordPattern'](_0x13d8a7['body'][_0x1fd6('0x10')]);if(!_0x1495c6[_0x1fd6('0x4e')]||!_0x591529['previousPasswords'])return _0x591529;authService[_0x1fd6('0x4f')](_0x13d8a7[_0x1fd6('0x35')]['password'],_0x591529[_0x1fd6('0x50')],_0x1495c6[_0x1fd6('0x51')]);return _0x591529;})[_0x1fd6('0xe')](function(){_0x591529[_0x1fd6('0x10')]=_0x13d8a7['body'][_0x1fd6('0x10')];_0x591529[_0x1fd6('0x3e')]=null;_0x591529[_0x1fd6('0x3f')]=null;return _0x591529[_0x1fd6('0x41')]();});})['then'](function(){_0x113f4b[_0x1fd6('0x52')](0xc8)[_0x1fd6('0x2e')]({'message':_0x1fd6('0x53')});})[_0x1fd6('0x1e')](function(_0x98de4b){return handleError(_0x113f4b,0x1f4,_0x98de4b);});};passport[_0x1fd6('0x54')](_0x1fd6('0x30'),new LocalStrategy({'usernameField':_0x1fd6('0xf'),'passwordField':_0x1fd6('0x10')},function(_0x3683e5,_0x1795b4,_0x224dc1){return localAuthenticate(db['User'],_0x3683e5,_0x1795b4,_0x224dc1);})); \ No newline at end of file +var _0x8708=['previousPasswords','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','error','message','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password'];(function(_0x8dd6d3,_0x140e5f){var _0x54d89a=function(_0x552e34){while(--_0x552e34){_0x8dd6d3['push'](_0x8dd6d3['shift']());}};_0x54d89a(++_0x140e5f);}(_0x8708,0xa5));var _0x8870=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8708[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x8870('0x0'));var passport=require('passport');var LocalStrategy=require(_0x8870('0x1'))[_0x8870('0x2')];var jayson=require(_0x8870('0x3'));var _=require(_0x8870('0x4'));var rs=require(_0x8870('0x5'));var moment=require(_0x8870('0x6'));var db=require(_0x8870('0x7'))['db'];var authService=require(_0x8870('0x8'));var utils=require(_0x8870('0x9'));var client=jayson[_0x8870('0xa')][_0x8870('0xb')]({'port':0x232b});function localAuthenticate(_0x55a17b,_0x5a2d06,_0x28db38,_0x3bd5d4){var _0x1eb5ed,_0x2cd5f3;return db['Setting'][_0x8870('0xc')]({'where':{'id':0x1},'attributes':[_0x8870('0xd'),_0x8870('0xe')],'raw':!![]})[_0x8870('0xf')](function(_0x2893a5){_0x1eb5ed=_0x2893a5;return _0x55a17b['findOne']({'attributes':['id',_0x8870('0x10'),'password',_0x8870('0x11'),_0x8870('0x12'),'disabled',_0x8870('0x13'),_0x8870('0x14'),'loginAttempts'],'where':{'name':_0x5a2d06,'role':{'$or':['admin',_0x8870('0x15'),_0x8870('0x16')]}}});})[_0x8870('0xf')](function(_0x164bf8){if(!_0x164bf8||_0x164bf8&&_0x164bf8[_0x8870('0x10')]!==_0x5a2d06){throw new Error(_0x8870('0x17'));}else{_0x2cd5f3=_0x164bf8;return _0x2cd5f3;}})[_0x8870('0xf')](function(){_0x2cd5f3[_0x8870('0x18')](_0x28db38,function(_0x3459f0,_0x15829e){var _0x33b0be=_0x2cd5f3[_0x8870('0x19')]+0x1;if(_0x3459f0){return _0x3bd5d4(_0x3459f0);}else if(!_0x15829e){if(_0x2cd5f3[_0x8870('0x1a')]){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else if(_0x1eb5ed[_0x8870('0xd')]>0x0){if(_0x2cd5f3[_0x8870('0x13')]){if(_0x1eb5ed['blockDuration']>0x0){if(moment(_0x2cd5f3[_0x8870('0x14')])[_0x8870('0x1b')](_0x1eb5ed['blockDuration'],_0x8870('0x1c'))>moment()){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,_0x33b0be,![],null)[_0x8870('0xf')](function(){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x33b0be>=_0x1eb5ed[_0x8870('0xd')]){return utils['clearBlockUser'](_0x2cd5f3,0x0,!![],moment())['then'](function(){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,_0x33b0be,![],null)[_0x8870('0xf')](function(){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});});}}}else{return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}}else{if(_0x2cd5f3[_0x8870('0x1a')]){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1eb5ed[_0x8870('0xd')]>0x0){if(_0x2cd5f3[_0x8870('0x13')]){if(_0x1eb5ed[_0x8870('0xe')]>0x0){if(moment(_0x2cd5f3['blockedAt'])[_0x8870('0x1b')](_0x1eb5ed[_0x8870('0xe')],'minutes')>moment()){return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}else{return utils[_0x8870('0x1d')](_0x2cd5f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2cd5f3);})[_0x8870('0xf')](function(){return _0x3bd5d4(null,_0x2cd5f3);});}}else{return _0x3bd5d4(null,![],{'message':_0x8870('0x17')});}}else{return utils[_0x8870('0x1d')](_0x2cd5f3,0x0,![],null)['then'](function(){return utils[_0x8870('0x1e')](_0x2cd5f3);})['then'](function(){return _0x3bd5d4(null,_0x2cd5f3);})[_0x8870('0x1f')](function(_0x18f66b){return _0x3bd5d4(null,![],_0x18f66b);});}}else{if(_0x2cd5f3[_0x8870('0x13')]){return _0x3bd5d4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8870('0x1e')](_0x2cd5f3)[_0x8870('0xf')](function(){return _0x3bd5d4(null,_0x2cd5f3);});}}}});})[_0x8870('0x1f')](function(_0xaf98cd){return _0x3bd5d4(null,![],_0xaf98cd);});}function sendServiceMail(_0x329271){return db['MailAccount'][_0x8870('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x8870('0x21')],'as':_0x8870('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x8870('0x23')}]}]})[_0x8870('0xf')](function(_0x130497){if(!_0x130497){throw new Error(_0x8870('0x24'));}var _0x2468bd=_0x130497[_0x8870('0x25')]();var _0x57856e={'account':_0x2468bd,'message':_['merge']({'from':util[_0x8870('0x26')](_0x8870('0x27'),_0x130497['name'],_0x130497[_0x8870('0x28')]||_0x130497['Smtp'][_0x8870('0x15')])},_0x329271)};return client['request']('SendMail',_0x57856e);})[_0x8870('0xf')](function(_0x1971a2){if(_0x1971a2[_0x8870('0x29')]){throw new Error(util[_0x8870('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1971a2['error'][_0x8870('0x2a')]||JSON[_0x8870('0x2b')](_0x1971a2[_0x8870('0x29')])));}return!![];});}function handleError(_0x3874b1,_0x5d2a50,_0x258121){return _0x3874b1[_0x8870('0x2c')](_0x5d2a50||0x1f4)['send']({'message':_0x258121?_0x258121[_0x8870('0x2a')]||_0x258121:''});}exports[_0x8870('0x2d')]=function(_0x4a560b,_0x50f45b,_0x3f8693){passport[_0x8870('0x18')]('local-login',function(_0xd743eb,_0x3fde51,_0x12eec8){var _0x5f020a=_0xd743eb||_0x12eec8;if(_0x5f020a){return handleError(_0x50f45b,0x191,_0x5f020a);}if(!_0x3fde51){return handleError(_0x50f45b,0x194,{'message':_0x8870('0x2e')});}else{var _0x45a005={'payload':{'id':_0x3fde51['id'],'role':_0x3fde51['role']},'options':{'expiresIn':0x15180}};return authService[_0x8870('0x2f')](_0x45a005)['then'](function(_0x36292f){_0x50f45b[_0x8870('0x30')]({'id':_0x3fde51['id'],'token':_0x36292f,'statusCall':'','isAlreadyLogged':_0x3fde51[_0x8870('0x31')]});});}})(_0x4a560b,_0x50f45b,_0x3f8693);};exports[_0x8870('0x32')]=function(_0x1ae723,_0x3169e6){if(!_0x1ae723['body']['email']){return handleError(_0x3169e6,0x1f4,{'message':_0x8870('0x33')});}var _0x1413e2=rs[_0x8870('0x34')]();_0x1ae723[_0x8870('0x35')][_0x8870('0x28')]=_0x1ae723[_0x8870('0x35')][_0x8870('0x28')][_0x8870('0x36')]()[_0x8870('0x37')]();var _0x85f67;return db[_0x8870('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8870('0xe')],'raw':!![]})[_0x8870('0xf')](function(_0x21caf3){_0x85f67=_0x21caf3;return db['User']['find']({'where':{'email':_0x1ae723[_0x8870('0x35')][_0x8870('0x28')]}});})[_0x8870('0xf')](function(_0x24b2d3){if(!_0x24b2d3){throw new Error(_0x8870('0x39'));}if(_0x24b2d3[_0x8870('0x1a')]){throw new Error(_0x8870('0x3a'));}if(_0x24b2d3[_0x8870('0x13')]){if(moment(_0x24b2d3[_0x8870('0x14')])[_0x8870('0x1b')](_0x85f67['blockDuration'],_0x8870('0x1c'))>moment()){throw new Error(_0x8870('0x3b'));}else{_0x24b2d3[_0x8870('0x13')]=![];_0x24b2d3[_0x8870('0x14')]=null;}}_0x24b2d3['resetPasswordToken']=_0x1413e2;_0x24b2d3[_0x8870('0x3c')]=Date['now']()+0x36ee80;return _0x24b2d3[_0x8870('0x3d')]();})[_0x8870('0xf')](function(){return sendServiceMail({'to':_0x1ae723[_0x8870('0x35')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8870('0x3e')+_0x8870('0x3f')+_0x1ae723['headers'][_0x8870('0x40')]+_0x8870('0x41')+_0x1413e2+'\x0a\x0a'+_0x8870('0x42')});})[_0x8870('0xf')](function(){_0x3169e6[_0x8870('0x2c')](0xc8)[_0x8870('0x43')]({'message':_0x8870('0x44')});})[_0x8870('0x1f')](function(_0x2cd12b){return handleError(_0x3169e6,0x1f4,_0x2cd12b);});};exports['reset']=function(_0x57a18d,_0x32d48b){return db[_0x8870('0x45')][_0x8870('0x20')]({'where':{'resetPasswordToken':_0x57a18d['params'][_0x8870('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x8870('0xf')](function(_0x27b592){if(!_0x27b592){throw new Error(_0x8870('0x47'));}return db['Setting']['findOne']({'attributes':['id',_0x8870('0x48'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x8870('0xf')](function(_0x5c5d76){if(_0x5c5d76[_0x8870('0x48')])authService[_0x8870('0x49')](_0x57a18d['body'][_0x8870('0x4a')]);if(!_0x5c5d76['enforcePasswordHistory']||!_0x27b592[_0x8870('0x4b')])return _0x27b592;authService['validatePasswordHistory'](_0x57a18d[_0x8870('0x35')]['password'],_0x27b592[_0x8870('0x4b')],_0x5c5d76[_0x8870('0x4c')]);return _0x27b592;})[_0x8870('0xf')](function(){_0x27b592['password']=_0x57a18d[_0x8870('0x35')][_0x8870('0x4a')];_0x27b592[_0x8870('0x4d')]=null;_0x27b592['resetPasswordExpires']=null;return _0x27b592[_0x8870('0x3d')]();});})[_0x8870('0xf')](function(){_0x32d48b[_0x8870('0x2c')](0xc8)[_0x8870('0x43')]({'message':_0x8870('0x4e')});})[_0x8870('0x1f')](function(_0x15ec20){return handleError(_0x32d48b,0x1f4,_0x15ec20);});};passport[_0x8870('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x8870('0x4a')},function(_0x57da6f,_0x1d5f50,_0xb2087d){return localAuthenticate(db[_0x8870('0x45')],_0x57da6f,_0x1d5f50,_0xb2087d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 374708d..6fcbb7d 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 _0x3583=['express','Router','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x3583,0x171));var _0x3358=function(_0x12b540,_0x344252){_0x12b540=_0x12b540-0x0;var _0x5927c7=_0x3583[_0x12b540];return _0x5927c7;};'use strict';var express=require(_0x3358('0x0'));var router=express[_0x3358('0x1')]();var controller=require('./authLocal.controller');router[_0x3358('0x2')]('/',controller[_0x3358('0x3')]);router[_0x3358('0x2')](_0x3358('0x4'),controller[_0x3358('0x5')]);router[_0x3358('0x2')](_0x3358('0x6'),controller[_0x3358('0x7')]);module[_0x3358('0x8')]=router; \ No newline at end of file +var _0x7720=['express','./authLocal.controller','login','post','/forgot','forgot','reset','exports'];(function(_0x16de3b,_0x34f93e){var _0x20c869=function(_0x566f2f){while(--_0x566f2f){_0x16de3b['push'](_0x16de3b['shift']());}};_0x20c869(++_0x34f93e);}(_0x7720,0xc0));var _0x0772=function(_0xbefb7d,_0x2688cf){_0xbefb7d=_0xbefb7d-0x0;var _0x36b430=_0x7720[_0xbefb7d];return _0x36b430;};'use strict';var express=require(_0x0772('0x0'));var router=express['Router']();var controller=require(_0x0772('0x1'));router['post']('/',controller[_0x0772('0x2')]);router[_0x0772('0x3')](_0x0772('0x4'),controller[_0x0772('0x5')]);router['post']('/reset/:token',controller[_0x0772('0x6')]);module[_0x0772('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c00c600..2ba02b5 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 _0xd181=['INTEGER','sequelize','exports','STRING'];(function(_0x5193ba,_0x228df7){var _0x1dc738=function(_0x423756){while(--_0x423756){_0x5193ba['push'](_0x5193ba['shift']());}};_0x1dc738(++_0x228df7);}(_0xd181,0x1bd));var _0x1d18=function(_0x2568d7,_0x191448){_0x2568d7=_0x2568d7-0x0;var _0x4b2bda=_0xd181[_0x2568d7];return _0x4b2bda;};'use strict';var Sequelize=require(_0x1d18('0x0'));module[_0x1d18('0x1')]={'name':{'type':Sequelize[_0x1d18('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1d18('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1d18('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2095=['sequelize','exports','STRING'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x2095,0x12f));var _0x5209=function(_0x3498ac,_0x20d2a0){_0x3498ac=_0x3498ac-0x0;var _0x263832=_0x2095[_0x3498ac];return _0x263832;};'use strict';var Sequelize=require(_0x5209('0x0'));module[_0x5209('0x1')]={'name':{'type':Sequelize[_0x5209('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5209('0x2')]},'description':{'type':Sequelize[_0x5209('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index d39b541..bb4413e 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 _0x00ce=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','Automation','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','include','rows','params','rawAttributes','includeAll','options','find','create','body','catch','addConditions','Condition','omit','ids','getConditions','nolimit','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x6caff4,_0x480025){var _0x358739=function(_0x2839ef){while(--_0x2839ef){_0x6caff4['push'](_0x6caff4['shift']());}};_0x358739(++_0x480025);}(_0x00ce,0x8f));var _0xe00c=function(_0x3a39e1,_0x245fb0){_0x3a39e1=_0x3a39e1-0x0;var _0x104e0e=_0x00ce[_0x3a39e1];return _0x104e0e;};'use strict';var emlformat=require(_0xe00c('0x0'));var rimraf=require(_0xe00c('0x1'));var zipdir=require(_0xe00c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe00c('0x3'));var moment=require(_0xe00c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe00c('0x5'));var util=require(_0xe00c('0x6'));var path=require(_0xe00c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe00c('0x8'));var fs=require('fs');var fs_extra=require(_0xe00c('0x9'));var _=require(_0xe00c('0xa'));var squel=require(_0xe00c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe00c('0xc'));var toCsv=require(_0xe00c('0xd'));var querystring=require(_0xe00c('0xe'));var Papa=require(_0xe00c('0xf'));var Redis=require('ioredis');var authService=require(_0xe00c('0x10'));var qs=require(_0xe00c('0x11'));var as=require(_0xe00c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe00c('0x13'))(_0xe00c('0x14'));var utils=require(_0xe00c('0x15'));var config=require(_0xe00c('0x16'));var licenseUtil=require(_0xe00c('0x17'));var db=require(_0xe00c('0x18'))['db'];function respondWithStatusCode(_0x27a853,_0x31ee1c){_0x31ee1c=_0x31ee1c||0xcc;return function(_0x37123c){if(_0x37123c){return _0x27a853[_0xe00c('0x19')](_0x31ee1c);}return _0x27a853[_0xe00c('0x1a')](_0x31ee1c)['end']();};}function respondWithResult(_0x3751a5,_0x47c98f){_0x47c98f=_0x47c98f||0xc8;return function(_0x2c0cd9){if(_0x2c0cd9){return _0x3751a5[_0xe00c('0x1a')](_0x47c98f)[_0xe00c('0x1b')](_0x2c0cd9);}};}function respondWithFilteredResult(_0x1c651e,_0x433405){return function(_0x56e9d7){if(_0x56e9d7){var _0xca2152=typeof _0x433405[_0xe00c('0x1c')]===_0xe00c('0x1d')&&typeof _0x433405[_0xe00c('0x1e')]===_0xe00c('0x1d');var _0x5084ca=_0x56e9d7[_0xe00c('0x1f')];var _0x4be67a=_0xca2152?0x0:_0x433405[_0xe00c('0x1c')];var _0x253712=_0xca2152?_0x56e9d7['count']:_0x433405['offset']+_0x433405[_0xe00c('0x1e')];var _0x66c46;if(_0x253712>=_0x5084ca){_0x253712=_0x5084ca;_0x66c46=0xc8;}else{_0x66c46=0xce;}_0x1c651e[_0xe00c('0x1a')](_0x66c46);return _0x1c651e[_0xe00c('0x20')](_0xe00c('0x21'),_0x4be67a+'-'+_0x253712+'/'+_0x5084ca)[_0xe00c('0x1b')](_0x56e9d7);}return null;};}function patchUpdates(_0x3255c0){return function(_0x54a26b){try{jsonpatch[_0xe00c('0x22')](_0x54a26b,_0x3255c0,!![]);}catch(_0x22bc9e){return BPromise['reject'](_0x22bc9e);}return _0x54a26b[_0xe00c('0x23')]();};}function saveUpdates(_0x2f4866,_0x6a15da){return function(_0x2e4eeb){if(_0x2e4eeb){return _0x2e4eeb[_0xe00c('0x24')](_0x2f4866)[_0xe00c('0x25')](function(_0x3b67e3){return _0x3b67e3;});}return null;};}function removeEntity(_0x2ccc8b,_0x405635){return function(_0x594e2b){if(_0x594e2b){return _0x594e2b[_0xe00c('0x26')]()[_0xe00c('0x25')](function(){_0x2ccc8b['status'](0xcc)[_0xe00c('0x27')]();});}};}function handleEntityNotFound(_0x45667f,_0x2ade6e){return function(_0x185eae){if(!_0x185eae){_0x45667f[_0xe00c('0x19')](0x194);}return _0x185eae;};}function handleError(_0x53bd26,_0x2b5ba4){_0x2b5ba4=_0x2b5ba4||0x1f4;return function(_0x207825){logger[_0xe00c('0x28')](_0x207825[_0xe00c('0x29')]);if(_0x207825[_0xe00c('0x2a')]){delete _0x207825[_0xe00c('0x2a')];}_0x53bd26[_0xe00c('0x1a')](_0x2b5ba4)['send'](_0x207825);};}exports['index']=function(_0x5b2b3e,_0x2ae969){var _0x2e75b4={},_0xb69f12={},_0x54538c={'count':0x0,'rows':[]};var _0x13f330=_[_0xe00c('0x2b')](db[_0xe00c('0x2c')]['rawAttributes'],function(_0x4e8c49){return{'name':_0x4e8c49[_0xe00c('0x2d')],'type':_0x4e8c49[_0xe00c('0x2e')]['key']};});_0xb69f12[_0xe00c('0x2f')]=_[_0xe00c('0x2b')](_0x13f330,_0xe00c('0x2a'));_0xb69f12[_0xe00c('0x30')]=_[_0xe00c('0x31')](_0x5b2b3e[_0xe00c('0x30')]);_0xb69f12[_0xe00c('0x32')]=_['intersection'](_0xb69f12['model'],_0xb69f12[_0xe00c('0x30')]);_0x2e75b4[_0xe00c('0x33')]=_[_0xe00c('0x34')](_0xb69f12['model'],qs['fields'](_0x5b2b3e['query'][_0xe00c('0x35')]));_0x2e75b4[_0xe00c('0x33')]=_0x2e75b4[_0xe00c('0x33')][_0xe00c('0x36')]?_0x2e75b4[_0xe00c('0x33')]:_0xb69f12[_0xe00c('0x2f')];if(!_0x5b2b3e[_0xe00c('0x30')][_0xe00c('0x37')]('nolimit')){_0x2e75b4['limit']=qs['limit'](_0x5b2b3e[_0xe00c('0x30')][_0xe00c('0x1e')]);_0x2e75b4[_0xe00c('0x1c')]=qs[_0xe00c('0x1c')](_0x5b2b3e['query'][_0xe00c('0x1c')]);}_0x2e75b4[_0xe00c('0x38')]=qs[_0xe00c('0x39')](_0x5b2b3e[_0xe00c('0x30')][_0xe00c('0x39')]);_0x2e75b4['where']=qs[_0xe00c('0x32')](_[_0xe00c('0x3a')](_0x5b2b3e[_0xe00c('0x30')],_0xb69f12['filters']),_0x13f330);if(_0x5b2b3e[_0xe00c('0x30')][_0xe00c('0x3b')]){_0x2e75b4[_0xe00c('0x3c')]=_[_0xe00c('0x3d')](_0x2e75b4[_0xe00c('0x3c')],{'$or':_['map'](_0x13f330,function(_0x56499c){if(_0x56499c[_0xe00c('0x2e')]!=='VIRTUAL'){var _0x364750={};_0x364750[_0x56499c[_0xe00c('0x2a')]]={'$like':'%'+_0x5b2b3e[_0xe00c('0x30')][_0xe00c('0x3b')]+'%'};return _0x364750;}})});}_0x2e75b4=_[_0xe00c('0x3d')]({},_0x2e75b4,_0x5b2b3e['options']);var _0x4edd01={'where':_0x2e75b4[_0xe00c('0x3c')]};return db[_0xe00c('0x2c')][_0xe00c('0x1f')](_0x4edd01)[_0xe00c('0x25')](function(_0x4c6265){_0x54538c[_0xe00c('0x1f')]=_0x4c6265;if(_0x5b2b3e[_0xe00c('0x30')]['includeAll']){_0x2e75b4[_0xe00c('0x3e')]=[{'all':!![]}];}return db[_0xe00c('0x2c')]['findAll'](_0x2e75b4);})[_0xe00c('0x25')](function(_0x41ca26){_0x54538c[_0xe00c('0x3f')]=_0x41ca26;return _0x54538c;})['then'](respondWithFilteredResult(_0x2ae969,_0x2e75b4))['catch'](handleError(_0x2ae969,null));};exports['show']=function(_0x295e6a,_0x3fdacf){var _0x4d9a16={'raw':![],'where':{'id':_0x295e6a[_0xe00c('0x40')]['id']}},_0x2042cf={};_0x2042cf[_0xe00c('0x2f')]=_[_0xe00c('0x31')](db[_0xe00c('0x2c')][_0xe00c('0x41')]);_0x2042cf[_0xe00c('0x30')]=_[_0xe00c('0x31')](_0x295e6a[_0xe00c('0x30')]);_0x2042cf[_0xe00c('0x32')]=_[_0xe00c('0x34')](_0x2042cf[_0xe00c('0x2f')],_0x2042cf[_0xe00c('0x30')]);_0x4d9a16[_0xe00c('0x33')]=_[_0xe00c('0x34')](_0x2042cf[_0xe00c('0x2f')],qs[_0xe00c('0x35')](_0x295e6a[_0xe00c('0x30')][_0xe00c('0x35')]));_0x4d9a16[_0xe00c('0x33')]=_0x4d9a16[_0xe00c('0x33')][_0xe00c('0x36')]?_0x4d9a16[_0xe00c('0x33')]:_0x2042cf[_0xe00c('0x2f')];if(_0x295e6a[_0xe00c('0x30')][_0xe00c('0x42')]){_0x4d9a16[_0xe00c('0x3e')]=[{'all':!![]}];}_0x4d9a16=_[_0xe00c('0x3d')]({},_0x4d9a16,_0x295e6a[_0xe00c('0x43')]);return db[_0xe00c('0x2c')][_0xe00c('0x44')](_0x4d9a16)[_0xe00c('0x25')](handleEntityNotFound(_0x3fdacf,null))['then'](respondWithResult(_0x3fdacf,null))['catch'](handleError(_0x3fdacf,null));};exports[_0xe00c('0x45')]=function(_0x5e5d78,_0x274fba){return db[_0xe00c('0x2c')]['create'](_0x5e5d78[_0xe00c('0x46')],{})['then'](respondWithResult(_0x274fba,0xc9))['catch'](handleError(_0x274fba,null));};exports['update']=function(_0xdc8130,_0x4f166e){if(_0xdc8130[_0xe00c('0x46')]['id']){delete _0xdc8130[_0xe00c('0x46')]['id'];}return db[_0xe00c('0x2c')][_0xe00c('0x44')]({'where':{'id':_0xdc8130[_0xe00c('0x40')]['id']}})[_0xe00c('0x25')](handleEntityNotFound(_0x4f166e,null))[_0xe00c('0x25')](saveUpdates(_0xdc8130[_0xe00c('0x46')],null))[_0xe00c('0x25')](respondWithResult(_0x4f166e,null))[_0xe00c('0x47')](handleError(_0x4f166e,null));};exports[_0xe00c('0x26')]=function(_0x278ba2,_0x49c918){return db[_0xe00c('0x2c')][_0xe00c('0x44')]({'where':{'id':_0x278ba2[_0xe00c('0x40')]['id']}})[_0xe00c('0x25')](handleEntityNotFound(_0x49c918,null))[_0xe00c('0x25')](removeEntity(_0x49c918,null))[_0xe00c('0x47')](handleError(_0x49c918,null));};exports[_0xe00c('0x48')]=function(_0x129a10,_0x26d828,_0x2e6262){return db[_0xe00c('0x49')]['find']({'where':{'id':_0x129a10[_0xe00c('0x40')]['id']}})['then'](handleEntityNotFound(_0x26d828,null))[_0xe00c('0x25')](function(_0x4cf1e4){if(_0x4cf1e4){return _0x4cf1e4[_0xe00c('0x48')](_0x129a10[_0xe00c('0x46')]['ids'],_[_0xe00c('0x4a')](_0x129a10[_0xe00c('0x46')],[_0xe00c('0x4b'),'id'])||{});}})[_0xe00c('0x25')](respondWithResult(_0x26d828,null))[_0xe00c('0x47')](handleError(_0x26d828,null));};exports['getConditions']=function(_0xb111b8,_0x994fe6,_0x341524){var _0x2fda7c={};var _0x3c1e98={};var _0x3f4a08;var _0x372a0a;return db[_0xe00c('0x2c')]['findOne']({'where':{'id':_0xb111b8['params']['id']}})[_0xe00c('0x25')](handleEntityNotFound(_0x994fe6,null))[_0xe00c('0x25')](function(_0x3f8102){if(_0x3f8102){_0x3f4a08=_0x3f8102;_0x3c1e98[_0xe00c('0x2f')]=_[_0xe00c('0x31')](db[_0xe00c('0x49')][_0xe00c('0x41')]);_0x3c1e98[_0xe00c('0x30')]=_[_0xe00c('0x31')](_0xb111b8[_0xe00c('0x30')]);_0x3c1e98[_0xe00c('0x32')]=_[_0xe00c('0x34')](_0x3c1e98[_0xe00c('0x2f')],_0x3c1e98[_0xe00c('0x30')]);_0x2fda7c[_0xe00c('0x33')]=_['intersection'](_0x3c1e98[_0xe00c('0x2f')],qs['fields'](_0xb111b8[_0xe00c('0x30')]['fields']));_0x2fda7c[_0xe00c('0x33')]=_0x2fda7c[_0xe00c('0x33')][_0xe00c('0x36')]?_0x2fda7c[_0xe00c('0x33')]:_0x3c1e98['model'];_0x2fda7c[_0xe00c('0x38')]=qs[_0xe00c('0x39')](_0xb111b8[_0xe00c('0x30')][_0xe00c('0x39')]);_0x2fda7c[_0xe00c('0x3c')]=qs[_0xe00c('0x32')](_[_0xe00c('0x3a')](_0xb111b8[_0xe00c('0x30')],_0x3c1e98[_0xe00c('0x32')]));if(_0xb111b8[_0xe00c('0x30')]['filter']){_0x2fda7c[_0xe00c('0x3c')]=_[_0xe00c('0x3d')](_0x2fda7c[_0xe00c('0x3c')],{'$or':_[_0xe00c('0x2b')](_0x2fda7c[_0xe00c('0x33')],function(_0x104fe7){var _0xcb3170={};_0xcb3170[_0x104fe7]={'$like':'%'+_0xb111b8[_0xe00c('0x30')]['filter']+'%'};return _0xcb3170;})});}_0x2fda7c=_['merge']({},_0x2fda7c,_0xb111b8[_0xe00c('0x43')]);return _0x3f4a08[_0xe00c('0x4c')](_0x2fda7c);}})['then'](function(_0x4e1b95){if(_0x4e1b95){_0x372a0a=_0x4e1b95[_0xe00c('0x36')];if(!_0xb111b8['query']['hasOwnProperty'](_0xe00c('0x4d'))){_0x2fda7c[_0xe00c('0x1e')]=qs[_0xe00c('0x1e')](_0xb111b8['query']['limit']);_0x2fda7c['offset']=qs[_0xe00c('0x1c')](_0xb111b8[_0xe00c('0x30')]['offset']);}return _0x3f4a08['getConditions'](_0x2fda7c);}})[_0xe00c('0x25')](function(_0x126785){if(_0x126785){return _0x126785?{'count':_0x372a0a,'rows':_0x126785}:null;}})[_0xe00c('0x25')](respondWithResult(_0x994fe6,null))[_0xe00c('0x47')](handleError(_0x994fe6,null));};exports[_0xe00c('0x4e')]=function(_0x5c0d87,_0x26af4f,_0x947674){return db[_0xe00c('0x4f')][_0xe00c('0x44')]({'where':{'id':_0x5c0d87[_0xe00c('0x40')]['id']}})[_0xe00c('0x25')](handleEntityNotFound(_0x26af4f,null))[_0xe00c('0x25')](function(_0x58cbb1){if(_0x58cbb1){return _0x58cbb1['addActions'](_0x5c0d87[_0xe00c('0x46')][_0xe00c('0x4b')],_[_0xe00c('0x4a')](_0x5c0d87['body'],['ids','id'])||{});}})[_0xe00c('0x25')](respondWithResult(_0x26af4f,null))['catch'](handleError(_0x26af4f,null));};exports[_0xe00c('0x50')]=function(_0x3da251,_0x2f3414,_0x46b3a0){var _0x5dc709={};var _0x5b4a74={};var _0x51cc57;var _0x315bda;return db[_0xe00c('0x2c')][_0xe00c('0x51')]({'where':{'id':_0x3da251['params']['id']}})[_0xe00c('0x25')](handleEntityNotFound(_0x2f3414,null))[_0xe00c('0x25')](function(_0x5ce7ed){if(_0x5ce7ed){_0x51cc57=_0x5ce7ed;_0x5b4a74[_0xe00c('0x2f')]=_[_0xe00c('0x31')](db[_0xe00c('0x4f')]['rawAttributes']);_0x5b4a74[_0xe00c('0x30')]=_[_0xe00c('0x31')](_0x3da251[_0xe00c('0x30')]);_0x5b4a74[_0xe00c('0x32')]=_[_0xe00c('0x34')](_0x5b4a74[_0xe00c('0x2f')],_0x5b4a74['query']);_0x5dc709[_0xe00c('0x33')]=_[_0xe00c('0x34')](_0x5b4a74[_0xe00c('0x2f')],qs[_0xe00c('0x35')](_0x3da251['query'][_0xe00c('0x35')]));_0x5dc709[_0xe00c('0x33')]=_0x5dc709[_0xe00c('0x33')]['length']?_0x5dc709['attributes']:_0x5b4a74['model'];_0x5dc709[_0xe00c('0x38')]=qs[_0xe00c('0x39')](_0x3da251[_0xe00c('0x30')][_0xe00c('0x39')]);_0x5dc709[_0xe00c('0x3c')]=qs['filters'](_[_0xe00c('0x3a')](_0x3da251[_0xe00c('0x30')],_0x5b4a74[_0xe00c('0x32')]));if(_0x3da251[_0xe00c('0x30')][_0xe00c('0x3b')]){_0x5dc709[_0xe00c('0x3c')]=_[_0xe00c('0x3d')](_0x5dc709['where'],{'$or':_[_0xe00c('0x2b')](_0x5dc709[_0xe00c('0x33')],function(_0x1d7186){var _0x1680b4={};_0x1680b4[_0x1d7186]={'$like':'%'+_0x3da251[_0xe00c('0x30')][_0xe00c('0x3b')]+'%'};return _0x1680b4;})});}_0x5dc709=_['merge']({},_0x5dc709,_0x3da251[_0xe00c('0x43')]);return _0x51cc57[_0xe00c('0x50')](_0x5dc709);}})[_0xe00c('0x25')](function(_0x1a6338){if(_0x1a6338){_0x315bda=_0x1a6338[_0xe00c('0x36')];if(!_0x3da251[_0xe00c('0x30')]['hasOwnProperty'](_0xe00c('0x4d'))){_0x5dc709[_0xe00c('0x1e')]=qs[_0xe00c('0x1e')](_0x3da251[_0xe00c('0x30')][_0xe00c('0x1e')]);_0x5dc709['offset']=qs[_0xe00c('0x1c')](_0x3da251['query'][_0xe00c('0x1c')]);}return _0x51cc57[_0xe00c('0x50')](_0x5dc709);}})[_0xe00c('0x25')](function(_0xb129c7){if(_0xb129c7){return _0xb129c7?{'count':_0x315bda,'rows':_0xb129c7}:null;}})[_0xe00c('0x25')](respondWithResult(_0x2f3414,null))[_0xe00c('0x47')](handleError(_0x2f3414,null));}; \ No newline at end of file +var _0x63b7=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','show','keys','includeAll','include','catch','create','body','params','find','addConditions','ids','omit','findOne','nolimit','addActions','Action','getActions','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','Automation','rawAttributes','type','model','query'];(function(_0x25d9fe,_0x54b634){var _0x9da108=function(_0x4f81f6){while(--_0x4f81f6){_0x25d9fe['push'](_0x25d9fe['shift']());}};_0x9da108(++_0x54b634);}(_0x63b7,0x1e8));var _0x763b=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x63b7[_0x4207f4];return _0x29a621;};'use strict';var emlformat=require(_0x763b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x763b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x763b('0x2'));var moment=require('moment');var BPromise=require(_0x763b('0x3'));var Mustache=require(_0x763b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x763b('0x5'));var csv=require(_0x763b('0x6'));var ejs=require(_0x763b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x763b('0x8'));var crypto=require(_0x763b('0x9'));var jsforce=require(_0x763b('0xa'));var deskjs=require(_0x763b('0xb'));var toCsv=require(_0x763b('0x6'));var querystring=require(_0x763b('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x763b('0xd'));var as=require(_0x763b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x763b('0xf'))(_0x763b('0x10'));var utils=require('../../config/utils');var config=require(_0x763b('0x11'));var licenseUtil=require(_0x763b('0x12'));var db=require(_0x763b('0x13'))['db'];function respondWithStatusCode(_0xc0f8f6,_0x1fb02b){_0x1fb02b=_0x1fb02b||0xcc;return function(_0x1f85e8){if(_0x1f85e8){return _0xc0f8f6['sendStatus'](_0x1fb02b);}return _0xc0f8f6[_0x763b('0x14')](_0x1fb02b)[_0x763b('0x15')]();};}function respondWithResult(_0x9ec53,_0x458088){_0x458088=_0x458088||0xc8;return function(_0x30dd93){if(_0x30dd93){return _0x9ec53[_0x763b('0x14')](_0x458088)[_0x763b('0x16')](_0x30dd93);}};}function respondWithFilteredResult(_0x5ee599,_0xb04c57){return function(_0x1febae){if(_0x1febae){var _0x4bc739=typeof _0xb04c57['offset']===_0x763b('0x17')&&typeof _0xb04c57[_0x763b('0x18')]===_0x763b('0x17');var _0x402083=_0x1febae[_0x763b('0x19')];var _0x3abdfb=_0x4bc739?0x0:_0xb04c57[_0x763b('0x1a')];var _0x1c9394=_0x4bc739?_0x1febae['count']:_0xb04c57[_0x763b('0x1a')]+_0xb04c57[_0x763b('0x18')];var _0x49757d;if(_0x1c9394>=_0x402083){_0x1c9394=_0x402083;_0x49757d=0xc8;}else{_0x49757d=0xce;}_0x5ee599[_0x763b('0x14')](_0x49757d);return _0x5ee599['set'](_0x763b('0x1b'),_0x3abdfb+'-'+_0x1c9394+'/'+_0x402083)[_0x763b('0x16')](_0x1febae);}return null;};}function patchUpdates(_0x14f4aa){return function(_0x58651d){try{jsonpatch[_0x763b('0x1c')](_0x58651d,_0x14f4aa,!![]);}catch(_0x32f742){return BPromise[_0x763b('0x1d')](_0x32f742);}return _0x58651d['save']();};}function saveUpdates(_0x2d081b,_0x205763){return function(_0x25e97b){if(_0x25e97b){return _0x25e97b[_0x763b('0x1e')](_0x2d081b)['then'](function(_0x428fc1){return _0x428fc1;});}return null;};}function removeEntity(_0xc8cbbf,_0x3413d0){return function(_0x25a039){if(_0x25a039){return _0x25a039[_0x763b('0x1f')]()[_0x763b('0x20')](function(){_0xc8cbbf[_0x763b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f36f2,_0x2951a9){return function(_0x42c60e){if(!_0x42c60e){_0x1f36f2[_0x763b('0x21')](0x194);}return _0x42c60e;};}function handleError(_0x1f67c1,_0x1903e2){_0x1903e2=_0x1903e2||0x1f4;return function(_0x5acecb){logger['error'](_0x5acecb[_0x763b('0x22')]);if(_0x5acecb[_0x763b('0x23')]){delete _0x5acecb[_0x763b('0x23')];}_0x1f67c1[_0x763b('0x14')](_0x1903e2)[_0x763b('0x24')](_0x5acecb);};}exports[_0x763b('0x25')]=function(_0x10fa31,_0x4b33b6){var _0x4c9800={},_0x2e40aa={},_0x4f3886={'count':0x0,'rows':[]};var _0x51b8f1=_[_0x763b('0x26')](db[_0x763b('0x27')][_0x763b('0x28')],function(_0x4b7afe){return{'name':_0x4b7afe['fieldName'],'type':_0x4b7afe[_0x763b('0x29')]['key']};});_0x2e40aa[_0x763b('0x2a')]=_[_0x763b('0x26')](_0x51b8f1,_0x763b('0x23'));_0x2e40aa[_0x763b('0x2b')]=_['keys'](_0x10fa31[_0x763b('0x2b')]);_0x2e40aa[_0x763b('0x2c')]=_['intersection'](_0x2e40aa[_0x763b('0x2a')],_0x2e40aa[_0x763b('0x2b')]);_0x4c9800[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x2e40aa[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x10fa31['query']['fields']));_0x4c9800[_0x763b('0x2d')]=_0x4c9800[_0x763b('0x2d')][_0x763b('0x30')]?_0x4c9800[_0x763b('0x2d')]:_0x2e40aa[_0x763b('0x2a')];if(!_0x10fa31['query'][_0x763b('0x31')]('nolimit')){_0x4c9800[_0x763b('0x18')]=qs[_0x763b('0x18')](_0x10fa31[_0x763b('0x2b')][_0x763b('0x18')]);_0x4c9800[_0x763b('0x1a')]=qs[_0x763b('0x1a')](_0x10fa31[_0x763b('0x2b')][_0x763b('0x1a')]);}_0x4c9800[_0x763b('0x32')]=qs['sort'](_0x10fa31['query'][_0x763b('0x33')]);_0x4c9800[_0x763b('0x34')]=qs[_0x763b('0x2c')](_[_0x763b('0x35')](_0x10fa31[_0x763b('0x2b')],_0x2e40aa[_0x763b('0x2c')]),_0x51b8f1);if(_0x10fa31[_0x763b('0x2b')]['filter']){_0x4c9800[_0x763b('0x34')]=_[_0x763b('0x36')](_0x4c9800[_0x763b('0x34')],{'$or':_[_0x763b('0x26')](_0x51b8f1,function(_0x3f8d1d){if(_0x3f8d1d[_0x763b('0x29')]!==_0x763b('0x37')){var _0x1f5898={};_0x1f5898[_0x3f8d1d[_0x763b('0x23')]]={'$like':'%'+_0x10fa31[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x1f5898;}})});}_0x4c9800=_[_0x763b('0x36')]({},_0x4c9800,_0x10fa31[_0x763b('0x39')]);var _0x31ef7e={'where':_0x4c9800[_0x763b('0x34')]};return db[_0x763b('0x27')][_0x763b('0x19')](_0x31ef7e)[_0x763b('0x20')](function(_0xe31129){_0x4f3886[_0x763b('0x19')]=_0xe31129;if(_0x10fa31[_0x763b('0x2b')]['includeAll']){_0x4c9800['include']=[{'all':!![]}];}return db[_0x763b('0x27')]['findAll'](_0x4c9800);})[_0x763b('0x20')](function(_0x4ffb5b){_0x4f3886[_0x763b('0x3a')]=_0x4ffb5b;return _0x4f3886;})['then'](respondWithFilteredResult(_0x4b33b6,_0x4c9800))['catch'](handleError(_0x4b33b6,null));};exports[_0x763b('0x3b')]=function(_0x410259,_0x34b6ab){var _0x5f3424={'raw':![],'where':{'id':_0x410259['params']['id']}},_0x5d1409={};_0x5d1409[_0x763b('0x2a')]=_['keys'](db['Automation'][_0x763b('0x28')]);_0x5d1409[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x410259[_0x763b('0x2b')]);_0x5d1409['filters']=_['intersection'](_0x5d1409[_0x763b('0x2a')],_0x5d1409[_0x763b('0x2b')]);_0x5f3424[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x5d1409[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x410259[_0x763b('0x2b')][_0x763b('0x2f')]));_0x5f3424[_0x763b('0x2d')]=_0x5f3424['attributes'][_0x763b('0x30')]?_0x5f3424[_0x763b('0x2d')]:_0x5d1409[_0x763b('0x2a')];if(_0x410259[_0x763b('0x2b')][_0x763b('0x3d')]){_0x5f3424[_0x763b('0x3e')]=[{'all':!![]}];}_0x5f3424=_[_0x763b('0x36')]({},_0x5f3424,_0x410259['options']);return db[_0x763b('0x27')]['find'](_0x5f3424)[_0x763b('0x20')](handleEntityNotFound(_0x34b6ab,null))['then'](respondWithResult(_0x34b6ab,null))[_0x763b('0x3f')](handleError(_0x34b6ab,null));};exports[_0x763b('0x40')]=function(_0x583027,_0x2b2cc2){return db[_0x763b('0x27')][_0x763b('0x40')](_0x583027['body'],{})['then'](respondWithResult(_0x2b2cc2,0xc9))['catch'](handleError(_0x2b2cc2,null));};exports['update']=function(_0xa5f195,_0x75c925){if(_0xa5f195[_0x763b('0x41')]['id']){delete _0xa5f195['body']['id'];}return db[_0x763b('0x27')]['find']({'where':{'id':_0xa5f195[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x75c925,null))[_0x763b('0x20')](saveUpdates(_0xa5f195[_0x763b('0x41')],null))[_0x763b('0x20')](respondWithResult(_0x75c925,null))[_0x763b('0x3f')](handleError(_0x75c925,null));};exports[_0x763b('0x1f')]=function(_0x12c0b0,_0xad67b9){return db[_0x763b('0x27')][_0x763b('0x43')]({'where':{'id':_0x12c0b0[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0xad67b9,null))[_0x763b('0x20')](removeEntity(_0xad67b9,null))['catch'](handleError(_0xad67b9,null));};exports['addConditions']=function(_0x509f58,_0x29d1ff,_0x385fe9){return db['Condition'][_0x763b('0x43')]({'where':{'id':_0x509f58[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x29d1ff,null))[_0x763b('0x20')](function(_0x4e5a3b){if(_0x4e5a3b){return _0x4e5a3b[_0x763b('0x44')](_0x509f58[_0x763b('0x41')][_0x763b('0x45')],_[_0x763b('0x46')](_0x509f58[_0x763b('0x41')],[_0x763b('0x45'),'id'])||{});}})['then'](respondWithResult(_0x29d1ff,null))[_0x763b('0x3f')](handleError(_0x29d1ff,null));};exports['getConditions']=function(_0x59e7c1,_0x19e0a6,_0x9eeb30){var _0x293faa={};var _0x30d643={};var _0x129371;var _0xa29af1;return db[_0x763b('0x27')][_0x763b('0x47')]({'where':{'id':_0x59e7c1[_0x763b('0x42')]['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x19e0a6,null))[_0x763b('0x20')](function(_0x93e619){if(_0x93e619){_0x129371=_0x93e619;_0x30d643[_0x763b('0x2a')]=_[_0x763b('0x3c')](db['Condition'][_0x763b('0x28')]);_0x30d643[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x59e7c1['query']);_0x30d643[_0x763b('0x2c')]=_['intersection'](_0x30d643[_0x763b('0x2a')],_0x30d643[_0x763b('0x2b')]);_0x293faa['attributes']=_[_0x763b('0x2e')](_0x30d643[_0x763b('0x2a')],qs[_0x763b('0x2f')](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x2f')]));_0x293faa['attributes']=_0x293faa[_0x763b('0x2d')][_0x763b('0x30')]?_0x293faa['attributes']:_0x30d643[_0x763b('0x2a')];_0x293faa[_0x763b('0x32')]=qs[_0x763b('0x33')](_0x59e7c1[_0x763b('0x2b')]['sort']);_0x293faa[_0x763b('0x34')]=qs[_0x763b('0x2c')](_['pick'](_0x59e7c1['query'],_0x30d643[_0x763b('0x2c')]));if(_0x59e7c1[_0x763b('0x2b')][_0x763b('0x38')]){_0x293faa[_0x763b('0x34')]=_[_0x763b('0x36')](_0x293faa[_0x763b('0x34')],{'$or':_['map'](_0x293faa[_0x763b('0x2d')],function(_0x4477c5){var _0x5ae04f={};_0x5ae04f[_0x4477c5]={'$like':'%'+_0x59e7c1[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x5ae04f;})});}_0x293faa=_['merge']({},_0x293faa,_0x59e7c1[_0x763b('0x39')]);return _0x129371['getConditions'](_0x293faa);}})[_0x763b('0x20')](function(_0x502789){if(_0x502789){_0xa29af1=_0x502789[_0x763b('0x30')];if(!_0x59e7c1[_0x763b('0x2b')][_0x763b('0x31')](_0x763b('0x48'))){_0x293faa['limit']=qs[_0x763b('0x18')](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x18')]);_0x293faa['offset']=qs['offset'](_0x59e7c1[_0x763b('0x2b')][_0x763b('0x1a')]);}return _0x129371['getConditions'](_0x293faa);}})[_0x763b('0x20')](function(_0x245722){if(_0x245722){return _0x245722?{'count':_0xa29af1,'rows':_0x245722}:null;}})[_0x763b('0x20')](respondWithResult(_0x19e0a6,null))[_0x763b('0x3f')](handleError(_0x19e0a6,null));};exports[_0x763b('0x49')]=function(_0xced089,_0x3a57f9,_0x5cc0f1){return db[_0x763b('0x4a')][_0x763b('0x43')]({'where':{'id':_0xced089['params']['id']}})[_0x763b('0x20')](handleEntityNotFound(_0x3a57f9,null))[_0x763b('0x20')](function(_0x29ba30){if(_0x29ba30){return _0x29ba30[_0x763b('0x49')](_0xced089[_0x763b('0x41')][_0x763b('0x45')],_[_0x763b('0x46')](_0xced089[_0x763b('0x41')],['ids','id'])||{});}})[_0x763b('0x20')](respondWithResult(_0x3a57f9,null))[_0x763b('0x3f')](handleError(_0x3a57f9,null));};exports[_0x763b('0x4b')]=function(_0x337b67,_0x5cddec,_0x217d80){var _0x3b2194={};var _0x5a5159={};var _0x34c2e1;var _0x14676a;return db['Automation'][_0x763b('0x47')]({'where':{'id':_0x337b67[_0x763b('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cddec,null))['then'](function(_0x52c376){if(_0x52c376){_0x34c2e1=_0x52c376;_0x5a5159[_0x763b('0x2a')]=_[_0x763b('0x3c')](db[_0x763b('0x4a')][_0x763b('0x28')]);_0x5a5159[_0x763b('0x2b')]=_[_0x763b('0x3c')](_0x337b67[_0x763b('0x2b')]);_0x5a5159[_0x763b('0x2c')]=_[_0x763b('0x2e')](_0x5a5159[_0x763b('0x2a')],_0x5a5159[_0x763b('0x2b')]);_0x3b2194[_0x763b('0x2d')]=_[_0x763b('0x2e')](_0x5a5159['model'],qs[_0x763b('0x2f')](_0x337b67[_0x763b('0x2b')][_0x763b('0x2f')]));_0x3b2194[_0x763b('0x2d')]=_0x3b2194[_0x763b('0x2d')][_0x763b('0x30')]?_0x3b2194[_0x763b('0x2d')]:_0x5a5159[_0x763b('0x2a')];_0x3b2194[_0x763b('0x32')]=qs['sort'](_0x337b67[_0x763b('0x2b')]['sort']);_0x3b2194[_0x763b('0x34')]=qs['filters'](_['pick'](_0x337b67[_0x763b('0x2b')],_0x5a5159[_0x763b('0x2c')]));if(_0x337b67[_0x763b('0x2b')]['filter']){_0x3b2194['where']=_[_0x763b('0x36')](_0x3b2194['where'],{'$or':_[_0x763b('0x26')](_0x3b2194['attributes'],function(_0xa5e09){var _0x5a0d97={};_0x5a0d97[_0xa5e09]={'$like':'%'+_0x337b67[_0x763b('0x2b')][_0x763b('0x38')]+'%'};return _0x5a0d97;})});}_0x3b2194=_['merge']({},_0x3b2194,_0x337b67[_0x763b('0x39')]);return _0x34c2e1[_0x763b('0x4b')](_0x3b2194);}})[_0x763b('0x20')](function(_0x1b0ed4){if(_0x1b0ed4){_0x14676a=_0x1b0ed4[_0x763b('0x30')];if(!_0x337b67['query'][_0x763b('0x31')](_0x763b('0x48'))){_0x3b2194['limit']=qs[_0x763b('0x18')](_0x337b67[_0x763b('0x2b')][_0x763b('0x18')]);_0x3b2194[_0x763b('0x1a')]=qs[_0x763b('0x1a')](_0x337b67[_0x763b('0x2b')][_0x763b('0x1a')]);}return _0x34c2e1[_0x763b('0x4b')](_0x3b2194);}})[_0x763b('0x20')](function(_0x2f5837){if(_0x2f5837){return _0x2f5837?{'count':_0x14676a,'rows':_0x2f5837}:null;}})[_0x763b('0x20')](respondWithResult(_0x5cddec,null))[_0x763b('0x3f')](handleError(_0x5cddec,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index df5afc4..4419194 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 _0x90c4=['lodash','api','moment','request-promise','path','../../config/environment','exports','define','Automation','tools_automations'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x90c4,0x190));var _0x490c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90c4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x490c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x490c('0x1'));var moment=require(_0x490c('0x2'));var BPromise=require('bluebird');var rp=require(_0x490c('0x3'));var fs=require('fs');var path=require(_0x490c('0x4'));var rimraf=require('rimraf');var config=require(_0x490c('0x5'));var attributes=require('./automation.attributes');module[_0x490c('0x6')]=function(_0x4ac109,_0x568278){return _0x4ac109[_0x490c('0x7')](_0x490c('0x8'),attributes,{'tableName':_0x490c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e7c=['api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x116363,_0x2b5ae4){var _0x21b28d=function(_0x229eec){while(--_0x229eec){_0x116363['push'](_0x116363['shift']());}};_0x21b28d(++_0x2b5ae4);}(_0x2e7c,0xcc));var _0xc2e7=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x2e7c[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc2e7('0x0'));var moment=require(_0xc2e7('0x1'));var BPromise=require(_0xc2e7('0x2'));var rp=require(_0xc2e7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2e7('0x4'));var attributes=require('./automation.attributes');module[_0xc2e7('0x5')]=function(_0x2bb219,_0x42a9f7){return _0x2bb219['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index cecc19d..1e3a596 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 _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x48ad0e,_0x72d175){var _0x1184e3=function(_0x23496){while(--_0x23496){_0x48ad0e['push'](_0x48ad0e['shift']());}};_0x1184e3(++_0x72d175);}(_0x09df,0x164));var _0xf09d=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x09df[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('Automation,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('Automation,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});} \ No newline at end of file +var _0x19cb=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31f5af,_0x9712a5){var _0x1525e4=function(_0x57f7ca){while(--_0x57f7ca){_0x31f5af['push'](_0x31f5af['shift']());}};_0x1525e4(++_0x9712a5);}(_0x19cb,0x146));var _0xb19c=function(_0x2827ef,_0x459de4){_0x2827ef=_0x2827ef-0x0;var _0x4a68b5=_0x19cb[_0x2827ef];return _0x4a68b5;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb19c('0x4'));var jayson=require(_0xb19c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6a30,_0x477ac1,_0x35c200){return new BPromise(function(_0x262354,_0x5d50d4){return client['request'](_0x2d6a30,_0x35c200)[_0xb19c('0x6')](function(_0x3ffb45){logger[_0xb19c('0x7')](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));logger['debug'](_0xb19c('0xa'),_0x477ac1,_0xb19c('0x9'),JSON[_0xb19c('0xb')](_0x3ffb45));if(_0x3ffb45[_0xb19c('0xc')]){if(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xd')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x477ac1,_0x3ffb45['error'][_0xb19c('0xe')]);return _0x5d50d4(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);}logger['error'](_0xb19c('0x8'),_0x477ac1,_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);return _0x262354(_0x3ffb45['error'][_0xb19c('0xe')]);}else{logger['info'](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));_0x262354(_0x3ffb45[_0xb19c('0xf')][_0xb19c('0xe')]);}})[_0xb19c('0x10')](function(_0x5bae0a){logger[_0xb19c('0xc')](_0xb19c('0x8'),_0x477ac1,_0x5bae0a);_0x5d50d4(_0x5bae0a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c40d888..d91fc2c 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 _0xd5ec=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','/:id/actions','getActions','post','put','update','delete','destroy','exports'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xd5ec[_0x49052b];return _0x48c045;};'use strict';var multer=require(_0xcd5e('0x0'));var util=require(_0xcd5e('0x1'));var path=require(_0xcd5e('0x2'));var timeout=require(_0xcd5e('0x3'));var express=require('express');var router=express[_0xcd5e('0x4')]();var fs_extra=require(_0xcd5e('0x5'));var auth=require(_0xcd5e('0x6'));var interaction=require(_0xcd5e('0x7'));var config=require(_0xcd5e('0x8'));var controller=require(_0xcd5e('0x9'));router[_0xcd5e('0xa')]('/',auth[_0xcd5e('0xb')](),controller[_0xcd5e('0xc')]);router[_0xcd5e('0xa')](_0xcd5e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xcd5e('0xa')](_0xcd5e('0xe'),auth[_0xcd5e('0xb')](),controller['getConditions']);router[_0xcd5e('0xa')](_0xcd5e('0xf'),auth[_0xcd5e('0xb')](),controller[_0xcd5e('0x10')]);router['post']('/',auth[_0xcd5e('0xb')](),controller['create']);router[_0xcd5e('0x11')](_0xcd5e('0xe'),auth[_0xcd5e('0xb')](),controller['addConditions']);router[_0xcd5e('0x11')](_0xcd5e('0xf'),auth[_0xcd5e('0xb')](),controller['addActions']);router[_0xcd5e('0x12')](_0xcd5e('0xd'),auth[_0xcd5e('0xb')](),controller[_0xcd5e('0x13')]);router[_0xcd5e('0x14')](_0xcd5e('0xd'),auth['isAuthenticated'](),controller[_0xcd5e('0x15')]);module[_0xcd5e('0x16')]=router; \ No newline at end of file +var _0xe9e8=['/:id/actions','getActions','post','create','addConditions','addActions','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xe9e8,0x179));var _0x8e9e=function(_0x15d3e8,_0x29b660){_0x15d3e8=_0x15d3e8-0x0;var _0xbf593a=_0xe9e8[_0x15d3e8];return _0xbf593a;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0x9')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller['getConditions']);router['get'](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);router[_0x8e9e('0x10')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x12')]);router[_0x8e9e('0x10')](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x13')]);router['put'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x14')]);router[_0x8e9e('0x15')]('/:id',auth[_0x8e9e('0xa')](),controller['destroy']);module[_0x8e9e('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 140b3bc..f1e7a34 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 _0x56a5=['#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','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x3d68cd,_0x466ce4){var _0x4ee014=function(_0xd07499){while(--_0xd07499){_0x3d68cd['push'](_0x3d68cd['shift']());}};_0x4ee014(++_0x466ce4);}(_0x56a5,0xbe));var _0x556a=function(_0x4add14,_0x36ff7e){_0x4add14=_0x4add14-0x0;var _0x27a57c=_0x56a5[_0x4add14];return _0x27a57c;};'use strict';var Sequelize=require(_0x556a('0x0'));module[_0x556a('0x1')]={'name':{'type':Sequelize[_0x556a('0x2')],'unique':_0x556a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x556a('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x556a('0x2')]},'active':{'type':Sequelize[_0x556a('0x5')],'defaultValue':0x0,'comment':_0x556a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x556a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x556a('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x556a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x556a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x3,'comment':_0x556a('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x556a('0x11')},'dialTimezone':{'type':Sequelize[_0x556a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x556a('0x2')],'defaultValue':_0x556a('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x556a('0x13'),_0x556a('0x14'),'onlyIfOpen'),'defaultValue':_0x556a('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x556a('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x556a('0x9')](0x9)[_0x556a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x556a('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x556a('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x556a('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x556a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x556a('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x556a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x556a('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x556a('0x9')](0x9)[_0x556a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x556a('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x556a('0x9')](0x9)[_0x556a('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x556a('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x556a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x556a('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x556a('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x556a('0x9')](0x9)[_0x556a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x556a('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x556a('0x1f')]('DESC',_0x556a('0x20')),'defaultValue':_0x556a('0x21')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x556a('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x556a('0x22')},'dialCutDigit':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x556a('0x23')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0x24')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0x25')},'dialDropRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0x26')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0x27')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)[_0x556a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x556a('0x9')](0x3)[_0x556a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x556a('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x556a('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x556a('0x2a')}}; \ No newline at end of file +var _0x32cc=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)'];(function(_0xd8db53,_0x15928c){var _0x3f0503=function(_0x42d8cc){while(--_0x42d8cc){_0xd8db53['push'](_0xd8db53['shift']());}};_0x3f0503(++_0x15928c);}(_0x32cc,0x1bc));var _0xc32c=function(_0x3441d5,_0x1ba541){_0x3441d5=_0x3441d5-0x0;var _0x45fdeb=_0x32cc[_0x3441d5];return _0x45fdeb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc32c('0x0')],'unique':_0xc32c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x3')),'allowNull':![],'defaultValue':_0xc32c('0x3')},'description':{'type':Sequelize[_0xc32c('0x0')]},'active':{'type':Sequelize[_0xc32c('0x4')],'defaultValue':0x0,'comment':_0xc32c('0x5')},'limitCalls':{'type':Sequelize[_0xc32c('0x6')](0x4)[_0xc32c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc32c('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc32c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc32c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':_0xc32c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x10'),'never',_0xc32c('0x11')),'defaultValue':_0xc32c('0x10')},'dialAMDActive':{'type':Sequelize[_0xc32c('0x4')],'defaultValue':0x0,'comment':_0xc32c('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc32c('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc32c('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc32c('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc32c('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc32c('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc32c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc32c('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc32c('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc32c('0x6')](0x9)[_0xc32c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc32c('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc32c('0x2')](_0xc32c('0x1b'),'ASC'),'defaultValue':_0xc32c('0x1b')},'dialPrefix':{'type':Sequelize[_0xc32c('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc32c('0x1c')},'dialCutDigit':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc32c('0x6')](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc32c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc32c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc32c('0x6')](0x5)[_0xc32c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc32c('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index a72e5aa..9fc9a46 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 _0x89c4=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','Campaign','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','findOne','CmHopper','nolimit','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','CmListId','toString','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','cm_contacts','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x89c4,0x82));var _0x489c=function(_0x4342ea,_0x545268){_0x4342ea=_0x4342ea-0x0;var _0x25d361=_0x89c4[_0x4342ea];return _0x25d361;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x489c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x489c('0x3'));var Mustache=require(_0x489c('0x4'));var util=require(_0x489c('0x5'));var path=require(_0x489c('0x6'));var sox=require(_0x489c('0x7'));var csv=require(_0x489c('0x8'));var ejs=require(_0x489c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x489c('0xa'));var squel=require(_0x489c('0xb'));var crypto=require(_0x489c('0xc'));var jsforce=require(_0x489c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x489c('0xe'));var Papa=require('papaparse');var Redis=require(_0x489c('0xf'));var authService=require(_0x489c('0x10'));var qs=require(_0x489c('0x11'));var as=require(_0x489c('0x12'));var hardwareService=require(_0x489c('0x13'));var logger=require(_0x489c('0x14'))(_0x489c('0x15'));var utils=require(_0x489c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x489c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfdfbcb,_0x4a9f45){_0x4a9f45=_0x4a9f45||0xcc;return function(_0x5340ce){if(_0x5340ce){return _0xfdfbcb[_0x489c('0x18')](_0x4a9f45);}return _0xfdfbcb['status'](_0x4a9f45)[_0x489c('0x19')]();};}function respondWithResult(_0x5d1b10,_0x305e40){_0x305e40=_0x305e40||0xc8;return function(_0x45983e){if(_0x45983e){return _0x5d1b10['status'](_0x305e40)[_0x489c('0x1a')](_0x45983e);}};}function respondWithFilteredResult(_0x39725a,_0x4861e2){return function(_0x4f37c3){if(_0x4f37c3){var _0x1bb98a=typeof _0x4861e2['offset']===_0x489c('0x1b')&&typeof _0x4861e2[_0x489c('0x1c')]===_0x489c('0x1b');var _0x39f9a9=_0x4f37c3[_0x489c('0x1d')];var _0x4519ce=_0x1bb98a?0x0:_0x4861e2[_0x489c('0x1e')];var _0x431782=_0x1bb98a?_0x4f37c3[_0x489c('0x1d')]:_0x4861e2[_0x489c('0x1e')]+_0x4861e2[_0x489c('0x1c')];var _0x19fb45;if(_0x431782>=_0x39f9a9){_0x431782=_0x39f9a9;_0x19fb45=0xc8;}else{_0x19fb45=0xce;}_0x39725a[_0x489c('0x1f')](_0x19fb45);return _0x39725a[_0x489c('0x20')](_0x489c('0x21'),_0x4519ce+'-'+_0x431782+'/'+_0x39f9a9)[_0x489c('0x1a')](_0x4f37c3);}return null;};}function patchUpdates(_0x14677b){return function(_0x381b56){try{jsonpatch['apply'](_0x381b56,_0x14677b,!![]);}catch(_0x4d0e03){return BPromise[_0x489c('0x22')](_0x4d0e03);}return _0x381b56[_0x489c('0x23')]();};}function saveUpdates(_0x1a1b68,_0x18cf8b){return function(_0x5b6ea3){if(_0x5b6ea3){return _0x5b6ea3[_0x489c('0x24')](_0x1a1b68)[_0x489c('0x25')](function(_0x37a59b){return _0x37a59b;});}return null;};}function removeEntity(_0x552384,_0x2a6d5c){return function(_0x1de4bf){if(_0x1de4bf){return _0x1de4bf['destroy']()[_0x489c('0x25')](function(){var _0x7914ad=_0x1de4bf['get']({'plain':!![]});var _0x35db69='IvrCampaigns';return db[_0x489c('0x26')][_0x489c('0x27')]({'where':{'type':_0x35db69,'resourceId':_0x7914ad['id']}})['then'](function(){return _0x1de4bf;});})[_0x489c('0x25')](function(){_0x552384[_0x489c('0x1f')](0xcc)[_0x489c('0x19')]();});}};}function handleEntityNotFound(_0x228c06,_0x5285e4){return function(_0x29c012){if(!_0x29c012){_0x228c06['sendStatus'](0x194);}return _0x29c012;};}function handleError(_0x2ce72c,_0x1f86cb){_0x1f86cb=_0x1f86cb||0x1f4;return function(_0x3b8f79){logger[_0x489c('0x28')](_0x3b8f79[_0x489c('0x29')]);if(_0x3b8f79[_0x489c('0x2a')]){delete _0x3b8f79['name'];}_0x2ce72c[_0x489c('0x1f')](_0x1f86cb)[_0x489c('0x2b')](_0x3b8f79);};}exports['index']=function(_0x445d7d,_0x299fcf){var _0x58b523={},_0x1fe531={},_0x21d1ec={'count':0x0,'rows':[]};var _0x222e1d=_[_0x489c('0x2c')](db['Campaign'][_0x489c('0x2d')],function(_0x335436){return{'name':_0x335436['fieldName'],'type':_0x335436[_0x489c('0x2e')][_0x489c('0x2f')]};});_0x1fe531[_0x489c('0x30')]=_['map'](_0x222e1d,_0x489c('0x2a'));_0x1fe531[_0x489c('0x31')]=_[_0x489c('0x32')](_0x445d7d[_0x489c('0x31')]);_0x1fe531[_0x489c('0x33')]=_[_0x489c('0x34')](_0x1fe531[_0x489c('0x30')],_0x1fe531[_0x489c('0x31')]);_0x58b523['attributes']=_[_0x489c('0x34')](_0x1fe531[_0x489c('0x30')],qs[_0x489c('0x35')](_0x445d7d[_0x489c('0x31')][_0x489c('0x35')]));_0x58b523[_0x489c('0x36')]=_0x58b523[_0x489c('0x36')][_0x489c('0x37')]?_0x58b523[_0x489c('0x36')]:_0x1fe531[_0x489c('0x30')];if(!_0x445d7d['query'][_0x489c('0x38')]('nolimit')){_0x58b523[_0x489c('0x1c')]=qs[_0x489c('0x1c')](_0x445d7d[_0x489c('0x31')][_0x489c('0x1c')]);_0x58b523['offset']=qs[_0x489c('0x1e')](_0x445d7d[_0x489c('0x31')][_0x489c('0x1e')]);}_0x58b523[_0x489c('0x39')]=qs[_0x489c('0x3a')](_0x445d7d[_0x489c('0x31')][_0x489c('0x3a')]);_0x58b523['where']=qs[_0x489c('0x33')](_[_0x489c('0x3b')](_0x445d7d[_0x489c('0x31')],_0x1fe531[_0x489c('0x33')]),_0x222e1d);if(_0x445d7d[_0x489c('0x31')]['filter']){_0x58b523[_0x489c('0x3c')]=_['merge'](_0x58b523[_0x489c('0x3c')],{'$or':_['map'](_0x222e1d,function(_0x410270){if(_0x410270[_0x489c('0x2e')]!==_0x489c('0x3d')){var _0xdcf742={};_0xdcf742[_0x410270[_0x489c('0x2a')]]={'$like':'%'+_0x445d7d[_0x489c('0x31')][_0x489c('0x3e')]+'%'};return _0xdcf742;}})});}_0x58b523=_[_0x489c('0x3f')]({},_0x58b523,_0x445d7d[_0x489c('0x40')]);var _0x44bf35={'where':_0x58b523[_0x489c('0x3c')]};return db[_0x489c('0x41')][_0x489c('0x1d')](_0x44bf35)[_0x489c('0x25')](function(_0x3cccca){_0x21d1ec['count']=_0x3cccca;if(_0x445d7d['query'][_0x489c('0x42')]){_0x58b523[_0x489c('0x43')]=[{'all':!![]}];}return db[_0x489c('0x41')][_0x489c('0x44')](_0x58b523);})['then'](function(_0xea1236){_0x21d1ec[_0x489c('0x45')]=_0xea1236;return _0x21d1ec;})['then'](respondWithFilteredResult(_0x299fcf,_0x58b523))[_0x489c('0x46')](handleError(_0x299fcf,null));};exports['show']=function(_0xc8ded3,_0x5d6692){var _0x2ddf07={'raw':![],'where':{'id':_0xc8ded3[_0x489c('0x47')]['id']}},_0xe374e4={};_0xe374e4[_0x489c('0x30')]=_[_0x489c('0x32')](db[_0x489c('0x41')][_0x489c('0x2d')]);_0xe374e4[_0x489c('0x31')]=_[_0x489c('0x32')](_0xc8ded3[_0x489c('0x31')]);_0xe374e4[_0x489c('0x33')]=_[_0x489c('0x34')](_0xe374e4[_0x489c('0x30')],_0xe374e4[_0x489c('0x31')]);_0x2ddf07[_0x489c('0x36')]=_[_0x489c('0x34')](_0xe374e4[_0x489c('0x30')],qs[_0x489c('0x35')](_0xc8ded3['query'][_0x489c('0x35')]));_0x2ddf07['attributes']=_0x2ddf07[_0x489c('0x36')][_0x489c('0x37')]?_0x2ddf07['attributes']:_0xe374e4[_0x489c('0x30')];if(_0xc8ded3[_0x489c('0x31')][_0x489c('0x42')]){_0x2ddf07['include']=[{'all':!![]}];}_0x2ddf07=_['merge']({},_0x2ddf07,_0xc8ded3[_0x489c('0x40')]);return db[_0x489c('0x41')]['find'](_0x2ddf07)[_0x489c('0x25')](handleEntityNotFound(_0x5d6692,null))[_0x489c('0x25')](respondWithResult(_0x5d6692,null))[_0x489c('0x46')](handleError(_0x5d6692,null));};exports[_0x489c('0x48')]=function(_0x1d4466,_0x81bc95){return db[_0x489c('0x41')][_0x489c('0x48')](_0x1d4466[_0x489c('0x49')],{})[_0x489c('0x25')](function(_0x187ae7){var _0x33ccfc=_0x1d4466[_0x489c('0x4a')][_0x489c('0x4b')]({'plain':!![]});if(!_0x33ccfc)throw new Error(_0x489c('0x4c'));if(_0x33ccfc[_0x489c('0x4d')]===_0x489c('0x4a')){var _0x547926=_0x187ae7[_0x489c('0x4b')]({'plain':!![]});var _0x26c013=_0x489c('0x4e');return db['UserProfileSection'][_0x489c('0x4f')]({'where':{'name':_0x26c013,'userProfileId':_0x33ccfc[_0x489c('0x50')]},'raw':!![]})[_0x489c('0x25')](function(_0x553b4e){if(_0x553b4e&&_0x553b4e['autoAssociation']===0x0){return db[_0x489c('0x26')][_0x489c('0x48')]({'name':_0x547926[_0x489c('0x2a')],'resourceId':_0x547926['id'],'type':_0x553b4e[_0x489c('0x2a')],'sectionId':_0x553b4e['id']},{})['then'](function(){return _0x187ae7;});}else{return _0x187ae7;}})[_0x489c('0x46')](function(_0x216f54){logger['error'](_0x489c('0x51'),_0x216f54);throw _0x216f54;});}return _0x187ae7;})['then'](respondWithResult(_0x81bc95,0xc9))['catch'](handleError(_0x81bc95,null));};exports[_0x489c('0x52')]=function(_0x219d1f,_0x3afdb3){var _0x103208={'where':{'id':_0x219d1f[_0x489c('0x47')]['id']}},_0x37cd8b={};_0x37cd8b[_0x489c('0x30')]=_[_0x489c('0x32')](db[_0x489c('0x41')][_0x489c('0x2d')]);_0x103208[_0x489c('0x36')]=_[_0x489c('0x34')](_0x37cd8b['model'],qs[_0x489c('0x35')](_0x219d1f[_0x489c('0x31')][_0x489c('0x35')]));_0x103208['attributes']=_0x103208[_0x489c('0x36')]['length']?_0x103208['attributes']:_0x37cd8b[_0x489c('0x30')];if(_0x219d1f[_0x489c('0x31')][_0x489c('0x42')]){_0x103208[_0x489c('0x43')]=[{'all':!![]}];}_0x103208=_[_0x489c('0x3f')]({},_0x103208,_0x219d1f[_0x489c('0x40')]);return db[_0x489c('0x41')][_0x489c('0x4f')](_0x103208)[_0x489c('0x25')](handleEntityNotFound(_0x3afdb3,null))[_0x489c('0x25')](function(_0x586e4b){if(_0x586e4b){var _0x3e407a=_0x586e4b[_0x489c('0x4b')]({'plain':!![]});_0x3e407a=qs[_0x489c('0x53')](_0x3e407a,['id','createdAt','updatedAt']);_0x219d1f['body']=_[_0x489c('0x53')](_0x219d1f[_0x489c('0x49')],['id',_0x489c('0x54'),_0x489c('0x55')]);return db[_0x489c('0x41')][_0x489c('0x48')](_[_0x489c('0x3f')](_0x3e407a,_0x219d1f['body']),{'include':_0x219d1f[_0x489c('0x31')][_0x489c('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x511974){var _0x75bfbb=_0x219d1f[_0x489c('0x4a')][_0x489c('0x4b')]({'plain':!![]});if(!_0x75bfbb)throw new Error(_0x489c('0x4c'));if(_0x75bfbb['role']==='user'){var _0x3af689=_0x511974['get']({'plain':!![]});var _0x394114=_0x489c('0x4e');return db[_0x489c('0x56')][_0x489c('0x4f')]({'where':{'name':_0x394114,'userProfileId':_0x75bfbb['userProfileId']},'raw':!![]})['then'](function(_0x256c94){if(_0x256c94&&_0x256c94['autoAssociation']===0x0){return db[_0x489c('0x26')][_0x489c('0x48')]({'name':_0x3af689[_0x489c('0x2a')],'resourceId':_0x3af689['id'],'type':_0x256c94[_0x489c('0x2a')],'sectionId':_0x256c94['id']},{})[_0x489c('0x25')](function(){return _0x511974;});}else{return _0x511974;}})[_0x489c('0x46')](function(_0x267bc0){logger[_0x489c('0x28')](_0x489c('0x51'),_0x267bc0);throw _0x267bc0;});}return _0x511974;});}})[_0x489c('0x25')](respondWithResult(_0x3afdb3,0xc9))[_0x489c('0x46')](handleError(_0x3afdb3,null));};exports['update']=function(_0x3cf07f,_0x5de80c){if(_0x3cf07f[_0x489c('0x49')]['id']){delete _0x3cf07f[_0x489c('0x49')]['id'];}return db['Campaign'][_0x489c('0x4f')]({'where':{'id':_0x3cf07f[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x5de80c,null))['then'](saveUpdates(_0x3cf07f[_0x489c('0x49')],null))['then'](respondWithResult(_0x5de80c,null))[_0x489c('0x46')](handleError(_0x5de80c,null));};exports['destroy']=function(_0x524c49,_0x233ef4){return db[_0x489c('0x41')][_0x489c('0x4f')]({'where':{'id':_0x524c49[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x233ef4,null))['then'](removeEntity(_0x233ef4,null))[_0x489c('0x46')](handleError(_0x233ef4,null));};exports['getHoppers']=function(_0x5f14e4,_0x561876,_0x433df1){var _0x429870={'raw':!![],'where':{}};var _0x5968cf={};var _0x250eb9={'count':0x0,'rows':[]};return db[_0x489c('0x41')][_0x489c('0x57')]({'where':{'id':_0x5f14e4[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x561876,null))[_0x489c('0x25')](function(_0x2458e4){if(_0x2458e4){_0x5968cf[_0x489c('0x30')]=_['keys'](db[_0x489c('0x58')]['rawAttributes']);_0x5968cf[_0x489c('0x31')]=_['keys'](_0x5f14e4[_0x489c('0x31')]);_0x5968cf[_0x489c('0x33')]=_['intersection'](_0x5968cf['model'],_0x5968cf[_0x489c('0x31')]);_0x429870[_0x489c('0x36')]=_['intersection'](_0x5968cf[_0x489c('0x30')],qs[_0x489c('0x35')](_0x5f14e4[_0x489c('0x31')][_0x489c('0x35')]));_0x429870[_0x489c('0x36')]=_0x429870[_0x489c('0x36')]['length']?_0x429870[_0x489c('0x36')]:_0x5968cf[_0x489c('0x30')];if(!_0x5f14e4['query'][_0x489c('0x38')](_0x489c('0x59'))){_0x429870[_0x489c('0x1c')]=qs['limit'](_0x5f14e4[_0x489c('0x31')][_0x489c('0x1c')]);_0x429870[_0x489c('0x1e')]=qs[_0x489c('0x1e')](_0x5f14e4['query'][_0x489c('0x1e')]);}_0x429870['order']=qs[_0x489c('0x3a')](_0x5f14e4[_0x489c('0x31')]['sort']);_0x429870[_0x489c('0x3c')]=qs[_0x489c('0x33')](_['pick'](_0x5f14e4[_0x489c('0x31')],_0x5968cf[_0x489c('0x33')]));_0x429870[_0x489c('0x3c')]['CampaignId']=_0x2458e4['id'];if(_0x5f14e4[_0x489c('0x31')][_0x489c('0x3e')]){_0x429870['where']=_[_0x489c('0x3f')](_0x429870[_0x489c('0x3c')],{'$or':_[_0x489c('0x2c')](_0x429870[_0x489c('0x36')],function(_0x2b483b){var _0x5edf54={};_0x5edf54[_0x2b483b]={'$like':'%'+_0x5f14e4['query']['filter']+'%'};return _0x5edf54;})});}_0x429870=_[_0x489c('0x3f')]({},_0x429870,_0x5f14e4['options']);return db[_0x489c('0x58')][_0x489c('0x1d')]({'where':_0x429870[_0x489c('0x3c')]})['then'](function(_0x5160b1){_0x250eb9[_0x489c('0x1d')]=_0x5160b1;if(_0x5f14e4[_0x489c('0x31')]['includeAll']){_0x429870[_0x489c('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x429870);})[_0x489c('0x25')](function(_0x2a673c){_0x250eb9[_0x489c('0x45')]=_0x2a673c;return _0x250eb9;});}})[_0x489c('0x25')](respondWithFilteredResult(_0x561876,_0x429870))[_0x489c('0x46')](handleError(_0x561876,null));};exports[_0x489c('0x5a')]=function(_0x3a0740,_0x1e2ed1,_0x27ea92){var _0x2b6831={'raw':!![],'where':{}};var _0x589a4c={};var _0x4a0b72={'count':0x0,'rows':[]};return db['Campaign'][_0x489c('0x57')]({'where':{'id':_0x3a0740[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x1e2ed1,null))['then'](function(_0x3e9629){if(_0x3e9629){_0x589a4c[_0x489c('0x30')]=_[_0x489c('0x32')](db['CmHopperHistory'][_0x489c('0x2d')]);_0x589a4c['query']=_[_0x489c('0x32')](_0x3a0740[_0x489c('0x31')]);_0x589a4c[_0x489c('0x33')]=_[_0x489c('0x34')](_0x589a4c[_0x489c('0x30')],_0x589a4c[_0x489c('0x31')]);_0x2b6831['attributes']=_['intersection'](_0x589a4c[_0x489c('0x30')],qs[_0x489c('0x35')](_0x3a0740[_0x489c('0x31')][_0x489c('0x35')]));_0x2b6831['attributes']=_0x2b6831[_0x489c('0x36')][_0x489c('0x37')]?_0x2b6831['attributes']:_0x589a4c[_0x489c('0x30')];if(!_0x3a0740[_0x489c('0x31')][_0x489c('0x38')]('nolimit')){_0x2b6831['limit']=qs['limit'](_0x3a0740[_0x489c('0x31')][_0x489c('0x1c')]);_0x2b6831[_0x489c('0x1e')]=qs[_0x489c('0x1e')](_0x3a0740[_0x489c('0x31')][_0x489c('0x1e')]);}_0x2b6831[_0x489c('0x39')]=qs[_0x489c('0x3a')](_0x3a0740[_0x489c('0x31')]['sort']);_0x2b6831[_0x489c('0x3c')]=qs[_0x489c('0x33')](_[_0x489c('0x3b')](_0x3a0740[_0x489c('0x31')],_0x589a4c[_0x489c('0x33')]));_0x2b6831[_0x489c('0x3c')][_0x489c('0x5b')]=_0x3e9629['id'];if(_0x3a0740[_0x489c('0x31')][_0x489c('0x3e')]){_0x2b6831['where']=_['merge'](_0x2b6831['where'],{'$or':_['map'](_0x2b6831['attributes'],function(_0x402494){var _0x4e0df0={};_0x4e0df0[_0x402494]={'$like':'%'+_0x3a0740[_0x489c('0x31')]['filter']+'%'};return _0x4e0df0;})});}_0x2b6831=_['merge']({},_0x2b6831,_0x3a0740[_0x489c('0x40')]);return db[_0x489c('0x5c')][_0x489c('0x1d')]({'where':_0x2b6831[_0x489c('0x3c')]})[_0x489c('0x25')](function(_0x4300be){_0x4a0b72[_0x489c('0x1d')]=_0x4300be;if(_0x3a0740[_0x489c('0x31')]['includeAll']){_0x2b6831[_0x489c('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x489c('0x44')](_0x2b6831);})[_0x489c('0x25')](function(_0x327c8d){_0x4a0b72[_0x489c('0x45')]=_0x327c8d;return _0x4a0b72;});}})[_0x489c('0x25')](respondWithFilteredResult(_0x1e2ed1,_0x2b6831))[_0x489c('0x46')](handleError(_0x1e2ed1,null));};exports[_0x489c('0x5d')]=function(_0x20e2a8,_0x23d90b,_0x16401d){var _0x3ee9cc={'raw':!![],'where':{}};var _0xc3ca29={};var _0x46e245={'count':0x0,'rows':[]};return db[_0x489c('0x41')]['findOne']({'where':{'id':_0x20e2a8[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x23d90b,null))[_0x489c('0x25')](function(_0x5cc38a){if(_0x5cc38a){_0xc3ca29['model']=_[_0x489c('0x32')](db['CmHopperFinal'][_0x489c('0x2d')]);_0xc3ca29['query']=_[_0x489c('0x32')](_0x20e2a8[_0x489c('0x31')]);_0xc3ca29[_0x489c('0x33')]=_[_0x489c('0x34')](_0xc3ca29[_0x489c('0x30')],_0xc3ca29[_0x489c('0x31')]);_0x3ee9cc[_0x489c('0x36')]=_[_0x489c('0x34')](_0xc3ca29['model'],qs[_0x489c('0x35')](_0x20e2a8[_0x489c('0x31')]['fields']));_0x3ee9cc[_0x489c('0x36')]=_0x3ee9cc[_0x489c('0x36')]['length']?_0x3ee9cc[_0x489c('0x36')]:_0xc3ca29[_0x489c('0x30')];if(!_0x20e2a8[_0x489c('0x31')][_0x489c('0x38')](_0x489c('0x59'))){_0x3ee9cc[_0x489c('0x1c')]=qs['limit'](_0x20e2a8['query'][_0x489c('0x1c')]);_0x3ee9cc[_0x489c('0x1e')]=qs[_0x489c('0x1e')](_0x20e2a8[_0x489c('0x31')][_0x489c('0x1e')]);}_0x3ee9cc[_0x489c('0x39')]=qs['sort'](_0x20e2a8['query'][_0x489c('0x3a')]);_0x3ee9cc[_0x489c('0x3c')]=qs[_0x489c('0x33')](_['pick'](_0x20e2a8[_0x489c('0x31')],_0xc3ca29[_0x489c('0x33')]));_0x3ee9cc[_0x489c('0x3c')]['CampaignId']=_0x5cc38a['id'];if(_0x20e2a8['query'][_0x489c('0x3e')]){_0x3ee9cc[_0x489c('0x3c')]=_[_0x489c('0x3f')](_0x3ee9cc[_0x489c('0x3c')],{'$or':_[_0x489c('0x2c')](_0x3ee9cc['attributes'],function(_0x3819ce){var _0x1ff2d2={};_0x1ff2d2[_0x3819ce]={'$like':'%'+_0x20e2a8[_0x489c('0x31')]['filter']+'%'};return _0x1ff2d2;})});}_0x3ee9cc=_[_0x489c('0x3f')]({},_0x3ee9cc,_0x20e2a8[_0x489c('0x40')]);return db[_0x489c('0x5e')]['count']({'where':_0x3ee9cc[_0x489c('0x3c')]})[_0x489c('0x25')](function(_0x273e41){_0x46e245[_0x489c('0x1d')]=_0x273e41;if(_0x20e2a8[_0x489c('0x31')][_0x489c('0x42')]){_0x3ee9cc[_0x489c('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x489c('0x44')](_0x3ee9cc);})['then'](function(_0x32a8b4){_0x46e245[_0x489c('0x45')]=_0x32a8b4;return _0x46e245;});}})['then'](respondWithFilteredResult(_0x23d90b,_0x3ee9cc))['catch'](handleError(_0x23d90b,null));};exports[_0x489c('0x5f')]=function(_0x262ee8,_0xc3ae02,_0x4672ea){var _0x24606d={'raw':!![],'where':{}};var _0x3be36={};var _0x13b52e={'count':0x0,'rows':[]};return db[_0x489c('0x41')][_0x489c('0x57')]({'where':{'id':_0x262ee8[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0xc3ae02,null))['then'](function(_0x28c651){if(_0x28c651){_0x3be36['model']=_[_0x489c('0x32')](db['CmHopperBlack']['rawAttributes']);_0x3be36[_0x489c('0x31')]=_[_0x489c('0x32')](_0x262ee8['query']);_0x3be36[_0x489c('0x33')]=_[_0x489c('0x34')](_0x3be36[_0x489c('0x30')],_0x3be36[_0x489c('0x31')]);_0x24606d[_0x489c('0x36')]=_['intersection'](_0x3be36[_0x489c('0x30')],qs['fields'](_0x262ee8[_0x489c('0x31')][_0x489c('0x35')]));_0x24606d[_0x489c('0x36')]=_0x24606d[_0x489c('0x36')]['length']?_0x24606d[_0x489c('0x36')]:_0x3be36[_0x489c('0x30')];if(!_0x262ee8[_0x489c('0x31')]['hasOwnProperty'](_0x489c('0x59'))){_0x24606d['limit']=qs[_0x489c('0x1c')](_0x262ee8[_0x489c('0x31')][_0x489c('0x1c')]);_0x24606d[_0x489c('0x1e')]=qs[_0x489c('0x1e')](_0x262ee8[_0x489c('0x31')][_0x489c('0x1e')]);}_0x24606d[_0x489c('0x39')]=qs[_0x489c('0x3a')](_0x262ee8[_0x489c('0x31')][_0x489c('0x3a')]);_0x24606d[_0x489c('0x3c')]=qs[_0x489c('0x33')](_[_0x489c('0x3b')](_0x262ee8[_0x489c('0x31')],_0x3be36[_0x489c('0x33')]));_0x24606d['where'][_0x489c('0x5b')]=_0x28c651['id'];if(_0x262ee8[_0x489c('0x31')][_0x489c('0x3e')]){_0x24606d[_0x489c('0x3c')]=_[_0x489c('0x3f')](_0x24606d[_0x489c('0x3c')],{'$or':_[_0x489c('0x2c')](_0x24606d[_0x489c('0x36')],function(_0x496f9d){var _0x17bf0a={};_0x17bf0a[_0x496f9d]={'$like':'%'+_0x262ee8[_0x489c('0x31')][_0x489c('0x3e')]+'%'};return _0x17bf0a;})});}_0x24606d=_[_0x489c('0x3f')]({},_0x24606d,_0x262ee8['options']);return db['CmHopperBlack'][_0x489c('0x1d')]({'where':_0x24606d[_0x489c('0x3c')]})['then'](function(_0xdd33bb){_0x13b52e[_0x489c('0x1d')]=_0xdd33bb;if(_0x262ee8[_0x489c('0x31')][_0x489c('0x42')]){_0x24606d[_0x489c('0x43')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x489c('0x44')](_0x24606d);})[_0x489c('0x25')](function(_0xb88642){_0x13b52e[_0x489c('0x45')]=_0xb88642;return _0x13b52e;});}})[_0x489c('0x25')](respondWithFilteredResult(_0xc3ae02,_0x24606d))[_0x489c('0x46')](handleError(_0xc3ae02,null));};exports['getLists']=function(_0x2d8c19,_0x1bc60a,_0xe67907){var _0x49472a={};var _0x2afd88={};var _0x34504e;var _0x1f09c0;return db[_0x489c('0x41')][_0x489c('0x57')]({'where':{'id':_0x2d8c19[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x1bc60a,null))[_0x489c('0x25')](function(_0x32f70f){if(_0x32f70f){_0x34504e=_0x32f70f;_0x2afd88['model']=_[_0x489c('0x32')](db[_0x489c('0x60')]['rawAttributes']);_0x2afd88['query']=_[_0x489c('0x32')](_0x2d8c19[_0x489c('0x31')]);_0x2afd88[_0x489c('0x33')]=_[_0x489c('0x34')](_0x2afd88['model'],_0x2afd88[_0x489c('0x31')]);_0x49472a[_0x489c('0x36')]=_['intersection'](_0x2afd88['model'],qs['fields'](_0x2d8c19[_0x489c('0x31')][_0x489c('0x35')]));_0x49472a[_0x489c('0x36')]=_0x49472a[_0x489c('0x36')][_0x489c('0x37')]?_0x49472a[_0x489c('0x36')]:_0x2afd88[_0x489c('0x30')];_0x49472a[_0x489c('0x39')]=qs[_0x489c('0x3a')](_0x2d8c19[_0x489c('0x31')][_0x489c('0x3a')]);_0x49472a[_0x489c('0x3c')]=qs[_0x489c('0x33')](_[_0x489c('0x3b')](_0x2d8c19[_0x489c('0x31')],_0x2afd88['filters']));if(_0x2d8c19[_0x489c('0x31')][_0x489c('0x3e')]){_0x49472a[_0x489c('0x3c')]=_[_0x489c('0x3f')](_0x49472a['where'],{'$or':_[_0x489c('0x2c')](_0x49472a[_0x489c('0x36')],function(_0x5161dc){var _0xbe0eb0={};_0xbe0eb0[_0x5161dc]={'$like':'%'+_0x2d8c19[_0x489c('0x31')][_0x489c('0x3e')]+'%'};return _0xbe0eb0;})});}_0x49472a=_[_0x489c('0x3f')]({},_0x49472a,_0x2d8c19[_0x489c('0x40')]);return _0x34504e[_0x489c('0x61')](_0x49472a);}})[_0x489c('0x25')](function(_0x5d449a){if(_0x5d449a){_0x1f09c0=_0x5d449a[_0x489c('0x37')];if(!_0x2d8c19[_0x489c('0x31')][_0x489c('0x38')](_0x489c('0x59'))){_0x49472a['limit']=qs[_0x489c('0x1c')](_0x2d8c19[_0x489c('0x31')][_0x489c('0x1c')]);_0x49472a['offset']=qs[_0x489c('0x1e')](_0x2d8c19[_0x489c('0x31')][_0x489c('0x1e')]);}return _0x34504e['getLists'](_0x49472a);}})['then'](function(_0x2a3c38){if(_0x2a3c38){return _0x2a3c38?{'count':_0x1f09c0,'rows':_0x2a3c38}:null;}})[_0x489c('0x25')](respondWithResult(_0x1bc60a,null))[_0x489c('0x46')](handleError(_0x1bc60a,null));};exports['addLists']=function(_0x1ef3b6,_0x26d261,_0x4ecf79){var _0x4ac510,_0x3b10dc;var _0x3829e9=[];var _0x579def=moment()['format'](_0x489c('0x62'));return db[_0x489c('0x41')]['find']({'where':{'id':_0x1ef3b6[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x26d261,null))[_0x489c('0x25')](function(_0x479374){if(_0x479374){_0x3b10dc=_0x479374;return _0x479374['addLists'](_0x1ef3b6[_0x489c('0x49')][_0x489c('0x63')],_[_0x489c('0x53')](_0x1ef3b6[_0x489c('0x49')],['ids','id'])||{});}return null;})[_0x489c('0x64')](function(_0x59bb21){var _0x4ef292;var _0x46a15c;_0x4ac510=_0x59bb21||[];var _0x2f8197=[];if(_0x59bb21){for(var _0x24de29=0x0;_0x24de29<_0x59bb21['length'];_0x24de29+=0x1){var _0x57b95a=_0x59bb21[_0x24de29][_0x489c('0x4b')]({'plain':!![]});_0x3b10dc['dialCheckDuplicateType']=_0x1ef3b6[_0x489c('0x49')]['dialCheckDuplicateType']?_0x1ef3b6[_0x489c('0x49')][_0x489c('0x65')]:_0x3b10dc['dialCheckDuplicateType'];switch(_0x3b10dc['dialCheckDuplicateType']){case _0x489c('0x66'):_0x4ef292=squel[_0x489c('0x67')]()[_0x489c('0x68')](_0x489c('0x69'))[_0x489c('0x6a')]([_0x489c('0x6b'),_0x489c('0x6c'),'ContactId','ListId',_0x489c('0x5b'),_0x489c('0x54'),_0x489c('0x55')],squel['select']()[_0x489c('0x6d')](_0x489c('0x6b'),_0x489c('0x6b'))[_0x489c('0x6d')](_0x489c('0x6e'),_0x489c('0x6c'))[_0x489c('0x6d')]('id','ContactId')[_0x489c('0x6d')](_0x57b95a[_0x489c('0x6f')][_0x489c('0x70')](),_0x489c('0x71'))[_0x489c('0x6d')](_0x1ef3b6[_0x489c('0x47')]['id'][_0x489c('0x70')](),_0x489c('0x5b'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x54'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x55'))['from']('cm_contacts')[_0x489c('0x3c')](_0x489c('0x72'))[_0x489c('0x3c')](_0x489c('0x73'),_0x57b95a[_0x489c('0x6f')][_0x489c('0x70')]())['where'](_0x489c('0x74'))[_0x489c('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x489c('0x6d')](_0x489c('0x75'))[_0x489c('0x76')](_0x489c('0x77'))[_0x489c('0x3c')](_0x489c('0x78'),_0x1ef3b6['params']['id'][_0x489c('0x70')]()))['where'](_0x489c('0x79'),squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x7b'))[_0x489c('0x76')]('cm_hopper')[_0x489c('0x3c')](_0x489c('0x78'),_0x1ef3b6[_0x489c('0x47')]['id']['toString']())))['toString']();break;case _0x489c('0x7c'):_0x4ef292=squel[_0x489c('0x67')]()[_0x489c('0x68')]('cm_hopper')['fromQuery']([_0x489c('0x6b'),_0x489c('0x6c'),'ContactId',_0x489c('0x71'),_0x489c('0x5b'),_0x489c('0x54'),_0x489c('0x55')],squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x6b'),_0x489c('0x6b'))[_0x489c('0x6d')](_0x489c('0x6e'),'scheduledAt')['field']('id',_0x489c('0x7d'))['field'](_0x57b95a[_0x489c('0x6f')][_0x489c('0x70')](),_0x489c('0x71'))[_0x489c('0x6d')](_0x1ef3b6['params']['id'][_0x489c('0x70')](),_0x489c('0x5b'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x54'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x55'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x489c('0x3c')](_0x489c('0x73'),_0x57b95a[_0x489c('0x6f')][_0x489c('0x70')]())[_0x489c('0x3c')](_0x489c('0x74'))[_0x489c('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x7b'))[_0x489c('0x76')]('cm_hopper')[_0x489c('0x3c')](_0x489c('0x78'),_0x1ef3b6[_0x489c('0x47')]['id'][_0x489c('0x70')]())))[_0x489c('0x70')]();break;default:_0x4ef292=squel[_0x489c('0x67')]()[_0x489c('0x68')](_0x489c('0x69'))['fromQuery']([_0x489c('0x6b'),_0x489c('0x6c'),'ContactId',_0x489c('0x71'),'CampaignId',_0x489c('0x54'),_0x489c('0x55')],squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x6b'),_0x489c('0x6b'))[_0x489c('0x6d')](_0x489c('0x6e'),'scheduledAt')[_0x489c('0x6d')]('id','ContactId')[_0x489c('0x6d')](_0x57b95a['CmListId'][_0x489c('0x70')](),_0x489c('0x71'))[_0x489c('0x6d')](_0x1ef3b6[_0x489c('0x47')]['id']['toString'](),'CampaignId')[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x54'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x55'))[_0x489c('0x76')](_0x489c('0x7e'))[_0x489c('0x3c')]('deletedAt\x20IS\x20NULL')[_0x489c('0x3c')](_0x489c('0x73'),_0x57b95a[_0x489c('0x6f')][_0x489c('0x70')]())['where'](_0x489c('0x74')))[_0x489c('0x70')]();}_0x46a15c=squel[_0x489c('0x67')]()[_0x489c('0x68')](_0x489c('0x7f'))[_0x489c('0x6a')]([_0x489c('0x80'),_0x489c('0x6c'),'phone',_0x489c('0x81'),_0x489c('0x54'),_0x489c('0x55')],squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x82'),'id')['field'](_0x489c('0x6e'),_0x489c('0x6c'))[_0x489c('0x6d')](_0x489c('0x83'),'phone')[_0x489c('0x6d')](_0x489c('0x84'),'OrderBy')[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x54'))[_0x489c('0x6d')]('\x27'+_0x579def+'\x27',_0x489c('0x55'))['from'](_0x489c('0x85'),'ci')['join'](_0x489c('0x69'),'h',_0x489c('0x86'))[_0x489c('0x3c')](_0x489c('0x87'),_0x57b95a[_0x489c('0x6f')]['toString']())[_0x489c('0x3c')]('h.CampaignId=?',_0x1ef3b6[_0x489c('0x47')]['id']['toString']())['where'](_0x489c('0x88'),_0x579def))[_0x489c('0x70')]();_0x2f8197['push'](db[_0x489c('0x89')][_0x489c('0x31')](_0x4ef292));_0x3829e9[_0x489c('0x8a')](db['sequelize']['query'](_0x46a15c));}return BPromise[_0x489c('0x8b')](_0x2f8197);}})[_0x489c('0x25')](function(){return BPromise[_0x489c('0x8b')](_0x3829e9);})['then'](function(){return _0x4ac510;})[_0x489c('0x25')](respondWithResult(_0x26d261,null))[_0x489c('0x46')](handleError(_0x26d261,null));};exports[_0x489c('0x8c')]=function(_0x527d8a,_0x28ce58,_0x10987e){return db['Campaign']['find']({'where':{'id':_0x527d8a['params']['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x28ce58,null))[_0x489c('0x25')](function(_0x19c0b5){if(_0x19c0b5){return _0x19c0b5['removeLists'](_0x527d8a['query']['ids']);}})[_0x489c('0x25')](function(_0x34bf27){if(_0x34bf27){return db['CmHopper'][_0x489c('0x27')]({'where':{'ListId':_0x527d8a[_0x489c('0x31')][_0x489c('0x63')],'CampaignId':_0x527d8a[_0x489c('0x47')]['id']}})[_0x489c('0x25')](function(){return _0x34bf27;});}})[_0x489c('0x25')](respondWithStatusCode(_0x28ce58,null))[_0x489c('0x46')](handleError(_0x28ce58,null));};exports[_0x489c('0x8d')]=function(_0x51145d,_0x2af121,_0x3d6fee){var _0x14948e={};var _0x459660={};var _0x3aa387;var _0x487f22;return db[_0x489c('0x41')][_0x489c('0x57')]({'where':{'id':_0x51145d[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x2af121,null))[_0x489c('0x25')](function(_0x16a8a9){if(_0x16a8a9){_0x3aa387=_0x16a8a9;_0x459660[_0x489c('0x30')]=_[_0x489c('0x32')](db['CmList'][_0x489c('0x2d')]);_0x459660[_0x489c('0x31')]=_[_0x489c('0x32')](_0x51145d[_0x489c('0x31')]);_0x459660[_0x489c('0x33')]=_[_0x489c('0x34')](_0x459660[_0x489c('0x30')],_0x459660[_0x489c('0x31')]);_0x14948e[_0x489c('0x36')]=_[_0x489c('0x34')](_0x459660['model'],qs[_0x489c('0x35')](_0x51145d[_0x489c('0x31')][_0x489c('0x35')]));_0x14948e[_0x489c('0x36')]=_0x14948e[_0x489c('0x36')][_0x489c('0x37')]?_0x14948e[_0x489c('0x36')]:_0x459660['model'];_0x14948e[_0x489c('0x39')]=qs[_0x489c('0x3a')](_0x51145d[_0x489c('0x31')][_0x489c('0x3a')]);_0x14948e[_0x489c('0x3c')]=qs[_0x489c('0x33')](_['pick'](_0x51145d[_0x489c('0x31')],_0x459660[_0x489c('0x33')]));if(_0x51145d[_0x489c('0x31')][_0x489c('0x3e')]){_0x14948e[_0x489c('0x3c')]=_[_0x489c('0x3f')](_0x14948e['where'],{'$or':_[_0x489c('0x2c')](_0x14948e[_0x489c('0x36')],function(_0x36142b){var _0x443e3e={};_0x443e3e[_0x36142b]={'$like':'%'+_0x51145d[_0x489c('0x31')]['filter']+'%'};return _0x443e3e;})});}_0x14948e=_[_0x489c('0x3f')]({},_0x14948e,_0x51145d['options']);return _0x3aa387[_0x489c('0x8d')](_0x14948e);}})[_0x489c('0x25')](function(_0x2eb5a7){if(_0x2eb5a7){_0x487f22=_0x2eb5a7[_0x489c('0x37')];if(!_0x51145d[_0x489c('0x31')][_0x489c('0x38')]('nolimit')){_0x14948e[_0x489c('0x1c')]=qs[_0x489c('0x1c')](_0x51145d[_0x489c('0x31')][_0x489c('0x1c')]);_0x14948e[_0x489c('0x1e')]=qs[_0x489c('0x1e')](_0x51145d[_0x489c('0x31')][_0x489c('0x1e')]);}return _0x3aa387[_0x489c('0x8d')](_0x14948e);}})['then'](function(_0x28c367){if(_0x28c367){return _0x28c367?{'count':_0x487f22,'rows':_0x28c367}:null;}})[_0x489c('0x25')](respondWithResult(_0x2af121,null))[_0x489c('0x46')](handleError(_0x2af121,null));};exports['addBlackLists']=function(_0x685e6e,_0x2d1860,_0x1e8e0e){var _0x52a09a,_0x4c6e57;var _0x18bc2d=[];var _0x29a5ea=moment()[_0x489c('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x489c('0x41')]['find']({'where':{'id':_0x685e6e[_0x489c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d1860,null))[_0x489c('0x25')](function(_0x19fef2){if(_0x19fef2){_0x4c6e57=_0x19fef2;return _0x19fef2['addBlackLists'](_0x685e6e[_0x489c('0x49')][_0x489c('0x63')],_['omit'](_0x685e6e[_0x489c('0x49')],[_0x489c('0x63'),'id'])||{});}return null;})['spread'](function(_0x304a62){var _0x5bd9bb;var _0x3de88f;_0x52a09a=_0x304a62||[];var _0x52bbd1=[];if(_0x304a62){for(var _0x5d8e48=0x0;_0x5d8e48<_0x304a62[_0x489c('0x37')];_0x5d8e48+=0x1){var _0x2f5785=_0x304a62[_0x5d8e48][_0x489c('0x4b')]({'plain':!![]});_0x5bd9bb=squel[_0x489c('0x67')]()['into'](_0x489c('0x8f'))['fromQuery'](['phone',_0x489c('0x7d'),_0x489c('0x71'),_0x489c('0x5b'),_0x489c('0x54'),'updatedAt'],squel[_0x489c('0x7a')]()[_0x489c('0x6d')](_0x489c('0x6b'),_0x489c('0x6b'))['field']('id',_0x489c('0x7d'))[_0x489c('0x6d')](_0x2f5785[_0x489c('0x6f')][_0x489c('0x70')](),'ListId')['field'](_0x685e6e['params']['id'][_0x489c('0x70')](),_0x489c('0x5b'))[_0x489c('0x6d')](_0x489c('0x6e'),_0x489c('0x54'))['field'](_0x489c('0x6e'),_0x489c('0x55'))[_0x489c('0x76')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x489c('0x3c')](_0x489c('0x73'),_0x2f5785['CmListId'][_0x489c('0x70')]())[_0x489c('0x3c')](_0x489c('0x74')))[_0x489c('0x70')]();_0x52bbd1[_0x489c('0x8a')](db[_0x489c('0x89')][_0x489c('0x31')](_0x5bd9bb));}return BPromise[_0x489c('0x8b')](_0x52bbd1);}})[_0x489c('0x25')](function(){return _0x52a09a;})['then'](respondWithResult(_0x2d1860,null))[_0x489c('0x46')](handleError(_0x2d1860,null));};exports[_0x489c('0x90')]=function(_0x1974dc,_0x9b6d4d,_0x355fe8){return db[_0x489c('0x41')][_0x489c('0x4f')]({'where':{'id':_0x1974dc[_0x489c('0x47')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x9b6d4d,null))[_0x489c('0x25')](function(_0x20423c){if(_0x20423c){return _0x20423c[_0x489c('0x90')](_0x1974dc[_0x489c('0x31')][_0x489c('0x63')]);}})['then'](function(_0x4f6194){if(_0x4f6194){return db[_0x489c('0x91')][_0x489c('0x27')]({'where':{'ListId':_0x1974dc[_0x489c('0x31')]['ids'],'CampaignId':_0x1974dc[_0x489c('0x47')]['id']}})['then'](function(){return _0x4f6194;});}})[_0x489c('0x25')](respondWithStatusCode(_0x9b6d4d,null))[_0x489c('0x46')](handleError(_0x9b6d4d,null));}; \ No newline at end of file +var _0x4483=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','name','index','Campaign','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','find','omit','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','order','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','ContactId','createdAt','NOW()','h.id','ci.item','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x4483,0x1a3));var _0x3448=function(_0x2a6749,_0x331f0d){_0x2a6749=_0x2a6749-0x0;var _0x6498b8=_0x4483[_0x2a6749];return _0x6498b8;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){var _0x566ff5=_0x22ad5c[_0x3448('0x29')]({'plain':!![]});var _0x1b5c49=_0x3448('0x2a');return db[_0x3448('0x2b')][_0x3448('0x27')]({'where':{'type':_0x1b5c49,'resourceId':_0x566ff5['id']}})['then'](function(){return _0x22ad5c;});})[_0x3448('0x28')](function(){_0x2dcd40[_0x3448('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a479,_0x12c22d){return function(_0x310912){if(!_0x310912){_0x19a479[_0x3448('0x1b')](0x194);}return _0x310912;};}function handleError(_0x38fab2,_0x35f026){_0x35f026=_0x35f026||0x1f4;return function(_0x31be64){logger[_0x3448('0x2c')](_0x31be64['stack']);if(_0x31be64[_0x3448('0x2d')]){delete _0x31be64[_0x3448('0x2d')];}_0x38fab2[_0x3448('0x1c')](_0x35f026)['send'](_0x31be64);};}exports[_0x3448('0x2e')]=function(_0x5dfdf7,_0x486f2c){var _0x493898={},_0x52fb48={},_0xff6513={'count':0x0,'rows':[]};var _0x5e96f0=_['map'](db[_0x3448('0x2f')][_0x3448('0x30')],function(_0x32121c){return{'name':_0x32121c[_0x3448('0x31')],'type':_0x32121c['type'][_0x3448('0x32')]};});_0x52fb48[_0x3448('0x33')]=_[_0x3448('0x34')](_0x5e96f0,'name');_0x52fb48[_0x3448('0x35')]=_[_0x3448('0x36')](_0x5dfdf7['query']);_0x52fb48['filters']=_[_0x3448('0x37')](_0x52fb48[_0x3448('0x33')],_0x52fb48[_0x3448('0x35')]);_0x493898[_0x3448('0x38')]=_['intersection'](_0x52fb48[_0x3448('0x33')],qs[_0x3448('0x39')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x39')]));_0x493898['attributes']=_0x493898[_0x3448('0x38')][_0x3448('0x3a')]?_0x493898['attributes']:_0x52fb48[_0x3448('0x33')];if(!_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x493898[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x21')]);_0x493898[_0x3448('0x1f')]=qs['offset'](_0x5dfdf7['query'][_0x3448('0x1f')]);}_0x493898['order']=qs[_0x3448('0x3d')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3d')]);_0x493898[_0x3448('0x3e')]=qs['filters'](_[_0x3448('0x3f')](_0x5dfdf7[_0x3448('0x35')],_0x52fb48[_0x3448('0x40')]),_0x5e96f0);if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x41')]){_0x493898[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x493898[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x5e96f0,function(_0x5a58c5){if(_0x5a58c5[_0x3448('0x43')]!==_0x3448('0x44')){var _0x322b46={};_0x322b46[_0x5a58c5[_0x3448('0x2d')]]={'$like':'%'+_0x5dfdf7[_0x3448('0x35')]['filter']+'%'};return _0x322b46;}})});}_0x493898=_[_0x3448('0x42')]({},_0x493898,_0x5dfdf7[_0x3448('0x45')]);var _0x4a6e5={'where':_0x493898[_0x3448('0x3e')]};return db[_0x3448('0x2f')][_0x3448('0x22')](_0x4a6e5)[_0x3448('0x28')](function(_0x3db5f1){_0xff6513['count']=_0x3db5f1;if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x46')]){_0x493898[_0x3448('0x47')]=[{'all':!![]}];}return db['Campaign'][_0x3448('0x48')](_0x493898);})[_0x3448('0x28')](function(_0x21f989){_0xff6513[_0x3448('0x49')]=_0x21f989;return _0xff6513;})[_0x3448('0x28')](respondWithFilteredResult(_0x486f2c,_0x493898))[_0x3448('0x4a')](handleError(_0x486f2c,null));};exports[_0x3448('0x4b')]=function(_0x4f54e7,_0x2165c7){var _0x46b172={'raw':![],'where':{'id':_0x4f54e7[_0x3448('0x4c')]['id']}},_0x1e7fb7={};_0x1e7fb7[_0x3448('0x33')]=_[_0x3448('0x36')](db['Campaign'][_0x3448('0x30')]);_0x1e7fb7['query']=_['keys'](_0x4f54e7[_0x3448('0x35')]);_0x1e7fb7[_0x3448('0x40')]=_['intersection'](_0x1e7fb7[_0x3448('0x33')],_0x1e7fb7[_0x3448('0x35')]);_0x46b172['attributes']=_[_0x3448('0x37')](_0x1e7fb7[_0x3448('0x33')],qs['fields'](_0x4f54e7[_0x3448('0x35')][_0x3448('0x39')]));_0x46b172[_0x3448('0x38')]=_0x46b172[_0x3448('0x38')][_0x3448('0x3a')]?_0x46b172[_0x3448('0x38')]:_0x1e7fb7[_0x3448('0x33')];if(_0x4f54e7['query']['includeAll']){_0x46b172[_0x3448('0x47')]=[{'all':!![]}];}_0x46b172=_[_0x3448('0x42')]({},_0x46b172,_0x4f54e7[_0x3448('0x45')]);return db[_0x3448('0x2f')]['find'](_0x46b172)[_0x3448('0x28')](handleEntityNotFound(_0x2165c7,null))[_0x3448('0x28')](respondWithResult(_0x2165c7,null))[_0x3448('0x4a')](handleError(_0x2165c7,null));};exports[_0x3448('0x4d')]=function(_0x363374,_0x5d942b){return db[_0x3448('0x2f')]['create'](_0x363374[_0x3448('0x4e')],{})[_0x3448('0x28')](function(_0x5c8e42){var _0x479b79=_0x363374[_0x3448('0x4f')][_0x3448('0x29')]({'plain':!![]});if(!_0x479b79)throw new Error(_0x3448('0x50'));if(_0x479b79[_0x3448('0x51')]===_0x3448('0x4f')){var _0xc769e1=_0x5c8e42['get']({'plain':!![]});var _0x23dbda=_0x3448('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x23dbda,'userProfileId':_0x479b79[_0x3448('0x52')]},'raw':!![]})[_0x3448('0x28')](function(_0x4d20ba){if(_0x4d20ba&&_0x4d20ba['autoAssociation']===0x0){return db[_0x3448('0x2b')][_0x3448('0x4d')]({'name':_0xc769e1[_0x3448('0x2d')],'resourceId':_0xc769e1['id'],'type':_0x4d20ba[_0x3448('0x2d')],'sectionId':_0x4d20ba['id']},{})[_0x3448('0x28')](function(){return _0x5c8e42;});}else{return _0x5c8e42;}})[_0x3448('0x4a')](function(_0x2aea70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aea70);throw _0x2aea70;});}return _0x5c8e42;})['then'](respondWithResult(_0x5d942b,0xc9))[_0x3448('0x4a')](handleError(_0x5d942b,null));};exports[_0x3448('0x53')]=function(_0x5cf3fe,_0x35ce1d){var _0x14ef18={'where':{'id':_0x5cf3fe[_0x3448('0x4c')]['id']}},_0x5a4cde={};_0x5a4cde[_0x3448('0x33')]=_['keys'](db[_0x3448('0x2f')][_0x3448('0x30')]);_0x14ef18[_0x3448('0x38')]=_[_0x3448('0x37')](_0x5a4cde[_0x3448('0x33')],qs[_0x3448('0x39')](_0x5cf3fe[_0x3448('0x35')][_0x3448('0x39')]));_0x14ef18[_0x3448('0x38')]=_0x14ef18['attributes'][_0x3448('0x3a')]?_0x14ef18['attributes']:_0x5a4cde[_0x3448('0x33')];if(_0x5cf3fe[_0x3448('0x35')][_0x3448('0x46')]){_0x14ef18[_0x3448('0x47')]=[{'all':!![]}];}_0x14ef18=_[_0x3448('0x42')]({},_0x14ef18,_0x5cf3fe[_0x3448('0x45')]);return db['Campaign'][_0x3448('0x54')](_0x14ef18)['then'](handleEntityNotFound(_0x35ce1d,null))[_0x3448('0x28')](function(_0xceff06){if(_0xceff06){var _0x3bf4d2=_0xceff06[_0x3448('0x29')]({'plain':!![]});_0x3bf4d2=qs[_0x3448('0x55')](_0x3bf4d2,['id','createdAt','updatedAt']);_0x5cf3fe[_0x3448('0x4e')]=_[_0x3448('0x55')](_0x5cf3fe[_0x3448('0x4e')],['id','createdAt',_0x3448('0x56')]);return db[_0x3448('0x2f')][_0x3448('0x4d')](_[_0x3448('0x42')](_0x3bf4d2,_0x5cf3fe[_0x3448('0x4e')]),{'include':_0x5cf3fe[_0x3448('0x35')][_0x3448('0x46')]?[{'all':!![]}]:undefined})[_0x3448('0x28')](function(_0x36a151){var _0x8ab4f2=_0x5cf3fe[_0x3448('0x4f')][_0x3448('0x29')]({'plain':!![]});if(!_0x8ab4f2)throw new Error(_0x3448('0x50'));if(_0x8ab4f2[_0x3448('0x51')]===_0x3448('0x4f')){var _0x2f3b0e=_0x36a151[_0x3448('0x29')]({'plain':!![]});var _0x2934c7='IvrCampaigns';return db[_0x3448('0x57')]['find']({'where':{'name':_0x2934c7,'userProfileId':_0x8ab4f2[_0x3448('0x52')]},'raw':!![]})['then'](function(_0x1f1e3c){if(_0x1f1e3c&&_0x1f1e3c[_0x3448('0x58')]===0x0){return db['UserProfileResource'][_0x3448('0x4d')]({'name':_0x2f3b0e[_0x3448('0x2d')],'resourceId':_0x2f3b0e['id'],'type':_0x1f1e3c['name'],'sectionId':_0x1f1e3c['id']},{})['then'](function(){return _0x36a151;});}else{return _0x36a151;}})[_0x3448('0x4a')](function(_0x4864ae){logger['error'](_0x3448('0x59'),_0x4864ae);throw _0x4864ae;});}return _0x36a151;});}})[_0x3448('0x28')](respondWithResult(_0x35ce1d,0xc9))['catch'](handleError(_0x35ce1d,null));};exports['update']=function(_0x1385b9,_0x2920fd){if(_0x1385b9[_0x3448('0x4e')]['id']){delete _0x1385b9[_0x3448('0x4e')]['id'];}return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x1385b9[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x2920fd,null))[_0x3448('0x28')](saveUpdates(_0x1385b9[_0x3448('0x4e')],null))[_0x3448('0x28')](respondWithResult(_0x2920fd,null))[_0x3448('0x4a')](handleError(_0x2920fd,null));};exports[_0x3448('0x27')]=function(_0x387ab2,_0x5476dd){return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x387ab2['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5476dd,null))[_0x3448('0x28')](removeEntity(_0x5476dd,null))['catch'](handleError(_0x5476dd,null));};exports[_0x3448('0x5a')]=function(_0x30f0a3,_0xfeb65b,_0x508273){var _0x59902e={'raw':!![],'where':{}};var _0x41d459={};var _0x489b70={'count':0x0,'rows':[]};return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0x30f0a3[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfeb65b,null))[_0x3448('0x28')](function(_0x1f6111){if(_0x1f6111){_0x41d459[_0x3448('0x33')]=_['keys'](db['CmHopper'][_0x3448('0x30')]);_0x41d459[_0x3448('0x35')]=_[_0x3448('0x36')](_0x30f0a3[_0x3448('0x35')]);_0x41d459[_0x3448('0x40')]=_[_0x3448('0x37')](_0x41d459['model'],_0x41d459[_0x3448('0x35')]);_0x59902e['attributes']=_[_0x3448('0x37')](_0x41d459[_0x3448('0x33')],qs['fields'](_0x30f0a3[_0x3448('0x35')][_0x3448('0x39')]));_0x59902e['attributes']=_0x59902e['attributes'][_0x3448('0x3a')]?_0x59902e[_0x3448('0x38')]:_0x41d459[_0x3448('0x33')];if(!_0x30f0a3[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x59902e[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x30f0a3[_0x3448('0x35')][_0x3448('0x21')]);_0x59902e[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x30f0a3[_0x3448('0x35')][_0x3448('0x1f')]);}_0x59902e[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x30f0a3['query']['sort']);_0x59902e[_0x3448('0x3e')]=qs['filters'](_[_0x3448('0x3f')](_0x30f0a3[_0x3448('0x35')],_0x41d459['filters']));_0x59902e[_0x3448('0x3e')]['CampaignId']=_0x1f6111['id'];if(_0x30f0a3[_0x3448('0x35')][_0x3448('0x41')]){_0x59902e[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x59902e[_0x3448('0x3e')],{'$or':_['map'](_0x59902e[_0x3448('0x38')],function(_0x2e2b73){var _0x426032={};_0x426032[_0x2e2b73]={'$like':'%'+_0x30f0a3['query'][_0x3448('0x41')]+'%'};return _0x426032;})});}_0x59902e=_[_0x3448('0x42')]({},_0x59902e,_0x30f0a3[_0x3448('0x45')]);return db['CmHopper'][_0x3448('0x22')]({'where':_0x59902e['where']})['then'](function(_0x395fd5){_0x489b70['count']=_0x395fd5;if(_0x30f0a3[_0x3448('0x35')]['includeAll']){_0x59902e[_0x3448('0x47')]=[{'all':!![]}];}return db[_0x3448('0x5d')]['findAll'](_0x59902e);})['then'](function(_0x2a3e76){_0x489b70[_0x3448('0x49')]=_0x2a3e76;return _0x489b70;});}})['then'](respondWithFilteredResult(_0xfeb65b,_0x59902e))[_0x3448('0x4a')](handleError(_0xfeb65b,null));};exports[_0x3448('0x5e')]=function(_0x513a01,_0x464d27,_0x1aef40){var _0x3a386e={'raw':!![],'where':{}};var _0xc92ddf={};var _0x577570={'count':0x0,'rows':[]};return db[_0x3448('0x2f')]['findOne']({'where':{'id':_0x513a01[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0x464d27,null))[_0x3448('0x28')](function(_0x20a047){if(_0x20a047){_0xc92ddf[_0x3448('0x33')]=_['keys'](db[_0x3448('0x5f')][_0x3448('0x30')]);_0xc92ddf['query']=_[_0x3448('0x36')](_0x513a01['query']);_0xc92ddf['filters']=_[_0x3448('0x37')](_0xc92ddf['model'],_0xc92ddf[_0x3448('0x35')]);_0x3a386e[_0x3448('0x38')]=_[_0x3448('0x37')](_0xc92ddf['model'],qs[_0x3448('0x39')](_0x513a01[_0x3448('0x35')][_0x3448('0x39')]));_0x3a386e[_0x3448('0x38')]=_0x3a386e[_0x3448('0x38')][_0x3448('0x3a')]?_0x3a386e[_0x3448('0x38')]:_0xc92ddf[_0x3448('0x33')];if(!_0x513a01[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x3a386e[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x513a01['query']['limit']);_0x3a386e['offset']=qs[_0x3448('0x1f')](_0x513a01['query']['offset']);}_0x3a386e[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x513a01[_0x3448('0x35')][_0x3448('0x3d')]);_0x3a386e['where']=qs['filters'](_[_0x3448('0x3f')](_0x513a01[_0x3448('0x35')],_0xc92ddf[_0x3448('0x40')]));_0x3a386e['where'][_0x3448('0x60')]=_0x20a047['id'];if(_0x513a01[_0x3448('0x35')][_0x3448('0x41')]){_0x3a386e[_0x3448('0x3e')]=_['merge'](_0x3a386e[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x3a386e['attributes'],function(_0x4f535c){var _0x3240dd={};_0x3240dd[_0x4f535c]={'$like':'%'+_0x513a01[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x3240dd;})});}_0x3a386e=_['merge']({},_0x3a386e,_0x513a01[_0x3448('0x45')]);return db[_0x3448('0x5f')][_0x3448('0x22')]({'where':_0x3a386e[_0x3448('0x3e')]})['then'](function(_0x1c3a03){_0x577570[_0x3448('0x22')]=_0x1c3a03;if(_0x513a01['query'][_0x3448('0x46')]){_0x3a386e[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3a386e);})[_0x3448('0x28')](function(_0xaef9d5){_0x577570[_0x3448('0x49')]=_0xaef9d5;return _0x577570;});}})[_0x3448('0x28')](respondWithFilteredResult(_0x464d27,_0x3a386e))[_0x3448('0x4a')](handleError(_0x464d27,null));};exports[_0x3448('0x61')]=function(_0x37059c,_0x2e4559,_0x1336b6){var _0x392d92={'raw':!![],'where':{}};var _0x4b4cb6={};var _0xe87ce2={'count':0x0,'rows':[]};return db['Campaign'][_0x3448('0x5b')]({'where':{'id':_0x37059c['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x2e4559,null))[_0x3448('0x28')](function(_0x4aef21){if(_0x4aef21){_0x4b4cb6['model']=_['keys'](db[_0x3448('0x62')][_0x3448('0x30')]);_0x4b4cb6[_0x3448('0x35')]=_['keys'](_0x37059c[_0x3448('0x35')]);_0x4b4cb6[_0x3448('0x40')]=_['intersection'](_0x4b4cb6['model'],_0x4b4cb6[_0x3448('0x35')]);_0x392d92[_0x3448('0x38')]=_[_0x3448('0x37')](_0x4b4cb6[_0x3448('0x33')],qs[_0x3448('0x39')](_0x37059c[_0x3448('0x35')][_0x3448('0x39')]));_0x392d92[_0x3448('0x38')]=_0x392d92[_0x3448('0x38')]['length']?_0x392d92['attributes']:_0x4b4cb6[_0x3448('0x33')];if(!_0x37059c['query'][_0x3448('0x3b')]('nolimit')){_0x392d92[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x37059c['query'][_0x3448('0x21')]);_0x392d92[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x37059c[_0x3448('0x35')][_0x3448('0x1f')]);}_0x392d92[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0x37059c[_0x3448('0x35')][_0x3448('0x3d')]);_0x392d92[_0x3448('0x3e')]=qs[_0x3448('0x40')](_['pick'](_0x37059c[_0x3448('0x35')],_0x4b4cb6[_0x3448('0x40')]));_0x392d92[_0x3448('0x3e')]['CampaignId']=_0x4aef21['id'];if(_0x37059c[_0x3448('0x35')][_0x3448('0x41')]){_0x392d92[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x392d92[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x392d92['attributes'],function(_0x504eee){var _0x1e2f04={};_0x1e2f04[_0x504eee]={'$like':'%'+_0x37059c[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x1e2f04;})});}_0x392d92=_[_0x3448('0x42')]({},_0x392d92,_0x37059c[_0x3448('0x45')]);return db[_0x3448('0x62')][_0x3448('0x22')]({'where':_0x392d92[_0x3448('0x3e')]})[_0x3448('0x28')](function(_0x31c83a){_0xe87ce2[_0x3448('0x22')]=_0x31c83a;if(_0x37059c[_0x3448('0x35')][_0x3448('0x46')]){_0x392d92[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x392d92);})['then'](function(_0x34782a){_0xe87ce2[_0x3448('0x49')]=_0x34782a;return _0xe87ce2;});}})[_0x3448('0x28')](respondWithFilteredResult(_0x2e4559,_0x392d92))[_0x3448('0x4a')](handleError(_0x2e4559,null));};exports['getHopperBlacks']=function(_0x3e9da3,_0x5809bf,_0xc01efc){var _0x5e5b43={'raw':!![],'where':{}};var _0x30d73f={};var _0x494fd4={'count':0x0,'rows':[]};return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0x3e9da3[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5809bf,null))[_0x3448('0x28')](function(_0x7d3939){if(_0x7d3939){_0x30d73f[_0x3448('0x33')]=_[_0x3448('0x36')](db[_0x3448('0x63')]['rawAttributes']);_0x30d73f['query']=_[_0x3448('0x36')](_0x3e9da3[_0x3448('0x35')]);_0x30d73f[_0x3448('0x40')]=_[_0x3448('0x37')](_0x30d73f['model'],_0x30d73f[_0x3448('0x35')]);_0x5e5b43[_0x3448('0x38')]=_[_0x3448('0x37')](_0x30d73f['model'],qs[_0x3448('0x39')](_0x3e9da3['query'][_0x3448('0x39')]));_0x5e5b43[_0x3448('0x38')]=_0x5e5b43[_0x3448('0x38')]['length']?_0x5e5b43[_0x3448('0x38')]:_0x30d73f[_0x3448('0x33')];if(!_0x3e9da3[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x5e5b43[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x3e9da3[_0x3448('0x35')][_0x3448('0x21')]);_0x5e5b43[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x3e9da3[_0x3448('0x35')][_0x3448('0x1f')]);}_0x5e5b43[_0x3448('0x5c')]=qs['sort'](_0x3e9da3['query'][_0x3448('0x3d')]);_0x5e5b43[_0x3448('0x3e')]=qs[_0x3448('0x40')](_['pick'](_0x3e9da3['query'],_0x30d73f[_0x3448('0x40')]));_0x5e5b43[_0x3448('0x3e')][_0x3448('0x60')]=_0x7d3939['id'];if(_0x3e9da3[_0x3448('0x35')][_0x3448('0x41')]){_0x5e5b43[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x5e5b43[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x5e5b43[_0x3448('0x38')],function(_0x355cf8){var _0x131b9d={};_0x131b9d[_0x355cf8]={'$like':'%'+_0x3e9da3['query'][_0x3448('0x41')]+'%'};return _0x131b9d;})});}_0x5e5b43=_[_0x3448('0x42')]({},_0x5e5b43,_0x3e9da3[_0x3448('0x45')]);return db[_0x3448('0x63')][_0x3448('0x22')]({'where':_0x5e5b43[_0x3448('0x3e')]})[_0x3448('0x28')](function(_0x2d7b58){_0x494fd4[_0x3448('0x22')]=_0x2d7b58;if(_0x3e9da3[_0x3448('0x35')][_0x3448('0x46')]){_0x5e5b43[_0x3448('0x47')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5e5b43);})[_0x3448('0x28')](function(_0xd6fffc){_0x494fd4[_0x3448('0x49')]=_0xd6fffc;return _0x494fd4;});}})['then'](respondWithFilteredResult(_0x5809bf,_0x5e5b43))[_0x3448('0x4a')](handleError(_0x5809bf,null));};exports[_0x3448('0x64')]=function(_0xb54ad0,_0x4ee6c0,_0x5220f1){var _0x9abd02={};var _0x22a0b4={};var _0x25a053;var _0x1eeab7;return db[_0x3448('0x2f')][_0x3448('0x5b')]({'where':{'id':_0xb54ad0[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x4ee6c0,null))[_0x3448('0x28')](function(_0x2eea10){if(_0x2eea10){_0x25a053=_0x2eea10;_0x22a0b4[_0x3448('0x33')]=_[_0x3448('0x36')](db[_0x3448('0x65')][_0x3448('0x30')]);_0x22a0b4['query']=_[_0x3448('0x36')](_0xb54ad0[_0x3448('0x35')]);_0x22a0b4['filters']=_[_0x3448('0x37')](_0x22a0b4[_0x3448('0x33')],_0x22a0b4[_0x3448('0x35')]);_0x9abd02[_0x3448('0x38')]=_[_0x3448('0x37')](_0x22a0b4[_0x3448('0x33')],qs['fields'](_0xb54ad0[_0x3448('0x35')][_0x3448('0x39')]));_0x9abd02[_0x3448('0x38')]=_0x9abd02['attributes']['length']?_0x9abd02[_0x3448('0x38')]:_0x22a0b4[_0x3448('0x33')];_0x9abd02[_0x3448('0x5c')]=qs[_0x3448('0x3d')](_0xb54ad0[_0x3448('0x35')][_0x3448('0x3d')]);_0x9abd02[_0x3448('0x3e')]=qs[_0x3448('0x40')](_[_0x3448('0x3f')](_0xb54ad0['query'],_0x22a0b4[_0x3448('0x40')]));if(_0xb54ad0[_0x3448('0x35')][_0x3448('0x41')]){_0x9abd02[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x9abd02['where'],{'$or':_[_0x3448('0x34')](_0x9abd02[_0x3448('0x38')],function(_0x2de861){var _0x212f02={};_0x212f02[_0x2de861]={'$like':'%'+_0xb54ad0[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x212f02;})});}_0x9abd02=_[_0x3448('0x42')]({},_0x9abd02,_0xb54ad0[_0x3448('0x45')]);return _0x25a053[_0x3448('0x64')](_0x9abd02);}})[_0x3448('0x28')](function(_0x3fa68f){if(_0x3fa68f){_0x1eeab7=_0x3fa68f[_0x3448('0x3a')];if(!_0xb54ad0[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x9abd02[_0x3448('0x21')]=qs[_0x3448('0x21')](_0xb54ad0[_0x3448('0x35')][_0x3448('0x21')]);_0x9abd02[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0xb54ad0['query'][_0x3448('0x1f')]);}return _0x25a053['getLists'](_0x9abd02);}})[_0x3448('0x28')](function(_0x2a4791){if(_0x2a4791){return _0x2a4791?{'count':_0x1eeab7,'rows':_0x2a4791}:null;}})['then'](respondWithResult(_0x4ee6c0,null))[_0x3448('0x4a')](handleError(_0x4ee6c0,null));};exports['addLists']=function(_0x4310fd,_0x4589d3,_0x527f3e){var _0x8caa8e,_0x258d67;var _0x52b29f=[];var _0x1b7c18=moment()[_0x3448('0x66')](_0x3448('0x67'));return db['Campaign']['find']({'where':{'id':_0x4310fd[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x4589d3,null))[_0x3448('0x28')](function(_0x2b9f8e){if(_0x2b9f8e){_0x258d67=_0x2b9f8e;return _0x2b9f8e[_0x3448('0x68')](_0x4310fd[_0x3448('0x4e')][_0x3448('0x69')],_[_0x3448('0x55')](_0x4310fd['body'],[_0x3448('0x69'),'id'])||{});}return null;})[_0x3448('0x6a')](function(_0x3f9654){var _0x1b0deb;var _0x3348dd;_0x8caa8e=_0x3f9654||[];var _0x329b92=[];if(_0x3f9654){for(var _0x9c0903=0x0;_0x9c0903<_0x3f9654[_0x3448('0x3a')];_0x9c0903+=0x1){var _0x845f88=_0x3f9654[_0x9c0903][_0x3448('0x29')]({'plain':!![]});_0x258d67[_0x3448('0x6b')]=_0x4310fd['body']['dialCheckDuplicateType']?_0x4310fd[_0x3448('0x4e')]['dialCheckDuplicateType']:_0x258d67[_0x3448('0x6b')];switch(_0x258d67['dialCheckDuplicateType']){case _0x3448('0x6c'):_0x1b0deb=squel['insert']()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),'ContactId',_0x3448('0x72'),_0x3448('0x60'),'createdAt',_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')]('phone',_0x3448('0x70'))[_0x3448('0x74')]('NOW()',_0x3448('0x71'))[_0x3448('0x74')]('id','ContactId')[_0x3448('0x74')](_0x845f88['CmListId'][_0x3448('0x75')](),_0x3448('0x72'))[_0x3448('0x74')](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','createdAt')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x56'))['from'](_0x3448('0x76'))['where'](_0x3448('0x77'))['where'](_0x3448('0x78'),_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a'))[_0x3448('0x3e')](_0x3448('0x7b'),squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x7c'))[_0x3448('0x7d')](_0x3448('0x7e'))[_0x3448('0x3e')]('CampaignId\x20=\x20?',_0x4310fd[_0x3448('0x4c')]['id']['toString']()))[_0x3448('0x3e')](_0x3448('0x7b'),squel['select']()[_0x3448('0x74')](_0x3448('0x7f'))['from'](_0x3448('0x6e'))[_0x3448('0x3e')](_0x3448('0x80'),_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')]())))[_0x3448('0x75')]();break;case _0x3448('0x81'):_0x1b0deb=squel[_0x3448('0x82')]()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),_0x3448('0x83'),_0x3448('0x72'),'CampaignId',_0x3448('0x84'),'updatedAt'],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),_0x3448('0x70'))[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x71'))[_0x3448('0x74')]('id','ContactId')[_0x3448('0x74')](_0x845f88[_0x3448('0x79')][_0x3448('0x75')](),_0x3448('0x72'))['field'](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),'CampaignId')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','createdAt')[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x76'))[_0x3448('0x3e')](_0x3448('0x77'))[_0x3448('0x3e')](_0x3448('0x78'),_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a'))[_0x3448('0x3e')](_0x3448('0x7b'),squel[_0x3448('0x73')]()['field'](_0x3448('0x7f'))['from'](_0x3448('0x6e'))[_0x3448('0x3e')]('CampaignId\x20=\x20?',_0x4310fd[_0x3448('0x4c')]['id']['toString']())))[_0x3448('0x75')]();break;default:_0x1b0deb=squel[_0x3448('0x82')]()[_0x3448('0x6d')](_0x3448('0x6e'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x71'),_0x3448('0x83'),_0x3448('0x72'),_0x3448('0x60'),_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),'phone')['field'](_0x3448('0x85'),'scheduledAt')[_0x3448('0x74')]('id',_0x3448('0x83'))[_0x3448('0x74')](_0x845f88[_0x3448('0x79')][_0x3448('0x75')](),_0x3448('0x72'))[_0x3448('0x74')](_0x4310fd[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x84'))['field']('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x76'))[_0x3448('0x3e')](_0x3448('0x77'))[_0x3448('0x3e')]('ListId\x20=\x20?',_0x845f88[_0x3448('0x79')][_0x3448('0x75')]())[_0x3448('0x3e')](_0x3448('0x7a')))['toString']();}_0x3348dd=squel['insert']()[_0x3448('0x6d')]('cm_hopper_additional_phones')[_0x3448('0x6f')](['cmHopperId',_0x3448('0x71'),_0x3448('0x70'),'OrderBy',_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x86'),'id')[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x71'))[_0x3448('0x74')](_0x3448('0x87'),_0x3448('0x70'))[_0x3448('0x74')]('ci.OrderBY',_0x3448('0x88'))[_0x3448('0x74')]('\x27'+_0x1b7c18+'\x27',_0x3448('0x84'))['field']('\x27'+_0x1b7c18+'\x27','updatedAt')[_0x3448('0x7d')](_0x3448('0x89'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x3448('0x3e')](_0x3448('0x8a'),_0x845f88['CmListId'][_0x3448('0x75')]())['where'](_0x3448('0x8b'),_0x4310fd[_0x3448('0x4c')]['id']['toString']())[_0x3448('0x3e')]('h.createdAt\x20=\x20?',_0x1b7c18))['toString']();_0x329b92[_0x3448('0x8c')](db[_0x3448('0x8d')][_0x3448('0x35')](_0x1b0deb));_0x52b29f[_0x3448('0x8c')](db[_0x3448('0x8d')][_0x3448('0x35')](_0x3348dd));}return BPromise[_0x3448('0x8e')](_0x329b92);}})[_0x3448('0x28')](function(){return BPromise['all'](_0x52b29f);})[_0x3448('0x28')](function(){return _0x8caa8e;})[_0x3448('0x28')](respondWithResult(_0x4589d3,null))[_0x3448('0x4a')](handleError(_0x4589d3,null));};exports[_0x3448('0x8f')]=function(_0x3a90b5,_0xd01a38,_0x40793c){return db[_0x3448('0x2f')][_0x3448('0x54')]({'where':{'id':_0x3a90b5[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd01a38,null))[_0x3448('0x28')](function(_0x905854){if(_0x905854){return _0x905854[_0x3448('0x8f')](_0x3a90b5['query'][_0x3448('0x69')]);}})['then'](function(_0x592974){if(_0x592974){return db[_0x3448('0x5d')][_0x3448('0x27')]({'where':{'ListId':_0x3a90b5[_0x3448('0x35')][_0x3448('0x69')],'CampaignId':_0x3a90b5[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](function(){return _0x592974;});}})[_0x3448('0x28')](respondWithStatusCode(_0xd01a38,null))[_0x3448('0x4a')](handleError(_0xd01a38,null));};exports[_0x3448('0x90')]=function(_0x234134,_0x279fca,_0x5d3b42){var _0x44e4a5={};var _0x40c612={};var _0x818a4c;var _0x23e6cc;return db['Campaign'][_0x3448('0x5b')]({'where':{'id':_0x234134[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0x279fca,null))['then'](function(_0x3c56d2){if(_0x3c56d2){_0x818a4c=_0x3c56d2;_0x40c612[_0x3448('0x33')]=_['keys'](db['CmList'][_0x3448('0x30')]);_0x40c612[_0x3448('0x35')]=_[_0x3448('0x36')](_0x234134[_0x3448('0x35')]);_0x40c612[_0x3448('0x40')]=_[_0x3448('0x37')](_0x40c612[_0x3448('0x33')],_0x40c612[_0x3448('0x35')]);_0x44e4a5['attributes']=_[_0x3448('0x37')](_0x40c612[_0x3448('0x33')],qs[_0x3448('0x39')](_0x234134['query']['fields']));_0x44e4a5[_0x3448('0x38')]=_0x44e4a5[_0x3448('0x38')][_0x3448('0x3a')]?_0x44e4a5[_0x3448('0x38')]:_0x40c612[_0x3448('0x33')];_0x44e4a5['order']=qs[_0x3448('0x3d')](_0x234134[_0x3448('0x35')][_0x3448('0x3d')]);_0x44e4a5[_0x3448('0x3e')]=qs[_0x3448('0x40')](_[_0x3448('0x3f')](_0x234134['query'],_0x40c612[_0x3448('0x40')]));if(_0x234134[_0x3448('0x35')][_0x3448('0x41')]){_0x44e4a5[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x44e4a5[_0x3448('0x3e')],{'$or':_['map'](_0x44e4a5[_0x3448('0x38')],function(_0x2420d1){var _0x320fdc={};_0x320fdc[_0x2420d1]={'$like':'%'+_0x234134['query'][_0x3448('0x41')]+'%'};return _0x320fdc;})});}_0x44e4a5=_[_0x3448('0x42')]({},_0x44e4a5,_0x234134[_0x3448('0x45')]);return _0x818a4c['getBlackLists'](_0x44e4a5);}})[_0x3448('0x28')](function(_0x1920d1){if(_0x1920d1){_0x23e6cc=_0x1920d1[_0x3448('0x3a')];if(!_0x234134[_0x3448('0x35')]['hasOwnProperty'](_0x3448('0x3c'))){_0x44e4a5[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x234134['query'][_0x3448('0x21')]);_0x44e4a5[_0x3448('0x1f')]=qs['offset'](_0x234134['query'][_0x3448('0x1f')]);}return _0x818a4c[_0x3448('0x90')](_0x44e4a5);}})['then'](function(_0x28bac0){if(_0x28bac0){return _0x28bac0?{'count':_0x23e6cc,'rows':_0x28bac0}:null;}})['then'](respondWithResult(_0x279fca,null))['catch'](handleError(_0x279fca,null));};exports['addBlackLists']=function(_0x242145,_0x13818d,_0x425089){var _0x542e01,_0x1a56a4;var _0x111f26=[];var _0x48b4ca=moment()['format'](_0x3448('0x67'));return db['Campaign'][_0x3448('0x54')]({'where':{'id':_0x242145[_0x3448('0x4c')]['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x13818d,null))[_0x3448('0x28')](function(_0x1ab2d1){if(_0x1ab2d1){_0x1a56a4=_0x1ab2d1;return _0x1ab2d1['addBlackLists'](_0x242145[_0x3448('0x4e')][_0x3448('0x69')],_[_0x3448('0x55')](_0x242145[_0x3448('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0x19bae9){var _0x48b2b4;var _0x95204d;_0x542e01=_0x19bae9||[];var _0x7da7ea=[];if(_0x19bae9){for(var _0xd59b17=0x0;_0xd59b17<_0x19bae9[_0x3448('0x3a')];_0xd59b17+=0x1){var _0x283751=_0x19bae9[_0xd59b17][_0x3448('0x29')]({'plain':!![]});_0x48b2b4=squel['insert']()[_0x3448('0x6d')](_0x3448('0x91'))[_0x3448('0x6f')]([_0x3448('0x70'),_0x3448('0x83'),_0x3448('0x72'),_0x3448('0x60'),_0x3448('0x84'),_0x3448('0x56')],squel[_0x3448('0x73')]()[_0x3448('0x74')](_0x3448('0x70'),_0x3448('0x70'))['field']('id',_0x3448('0x83'))[_0x3448('0x74')](_0x283751['CmListId'][_0x3448('0x75')](),'ListId')['field'](_0x242145[_0x3448('0x4c')]['id'][_0x3448('0x75')](),_0x3448('0x60'))[_0x3448('0x74')](_0x3448('0x85'),'createdAt')[_0x3448('0x74')](_0x3448('0x85'),_0x3448('0x56'))[_0x3448('0x7d')](_0x3448('0x76'))['where'](_0x3448('0x77'))[_0x3448('0x3e')]('ListId\x20=\x20?',_0x283751[_0x3448('0x79')][_0x3448('0x75')]())['where'](_0x3448('0x7a')))[_0x3448('0x75')]();_0x7da7ea[_0x3448('0x8c')](db[_0x3448('0x8d')]['query'](_0x48b2b4));}return BPromise[_0x3448('0x8e')](_0x7da7ea);}})[_0x3448('0x28')](function(){return _0x542e01;})[_0x3448('0x28')](respondWithResult(_0x13818d,null))[_0x3448('0x4a')](handleError(_0x13818d,null));};exports['removeBlackLists']=function(_0x37c224,_0x177b9f,_0x412fef){return db['Campaign'][_0x3448('0x54')]({'where':{'id':_0x37c224['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x177b9f,null))[_0x3448('0x28')](function(_0x4e4c5d){if(_0x4e4c5d){return _0x4e4c5d[_0x3448('0x92')](_0x37c224['query']['ids']);}})[_0x3448('0x28')](function(_0x271899){if(_0x271899){return db[_0x3448('0x63')][_0x3448('0x27')]({'where':{'ListId':_0x37c224[_0x3448('0x35')][_0x3448('0x69')],'CampaignId':_0x37c224[_0x3448('0x4c')]['id']}})['then'](function(){return _0x271899;});}})[_0x3448('0x28')](respondWithStatusCode(_0x177b9f,null))[_0x3448('0x4a')](handleError(_0x177b9f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 64b8f72..5de6a3c 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_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 b3652b5..9ac1ea8 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 _0x8d97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','util','moment'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x8d97,0x82));var _0x78d9=function(_0x3561d5,_0x269bb9){_0x3561d5=_0x3561d5-0x0;var _0x124ccb=_0x8d97[_0x3561d5];return _0x124ccb;};'use strict';var _=require('lodash');var util=require(_0x78d9('0x0'));var moment=require(_0x78d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x78d9('0x2'));var fs=require('fs');var Redis=require(_0x78d9('0x3'));var db=require(_0x78d9('0x4'))['db'];var utils=require(_0x78d9('0x5'));var logger=require(_0x78d9('0x6'))('rpc');var config=require(_0x78d9('0x7'));var jayson=require(_0x78d9('0x8'));var client=jayson[_0x78d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1934,_0x5b9602,_0x2a2cdb){return new BPromise(function(_0x3b3709,_0x36b8f5){return client[_0x78d9('0xa')](_0x4d1934,_0x2a2cdb)[_0x78d9('0xb')](function(_0x14ca4e){logger['info'](_0x78d9('0xc'),_0x5b9602,_0x78d9('0xd'));logger[_0x78d9('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5b9602,'request\x20sent',JSON[_0x78d9('0xf')](_0x14ca4e));if(_0x14ca4e[_0x78d9('0x10')]){if(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x11')]===0x1f4){logger[_0x78d9('0x10')](_0x78d9('0xc'),_0x5b9602,_0x14ca4e['error'][_0x78d9('0x12')]);return _0x36b8f5(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);}logger[_0x78d9('0x10')](_0x78d9('0xc'),_0x5b9602,_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);return _0x3b3709(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);}else{logger[_0x78d9('0x13')](_0x78d9('0xc'),_0x5b9602,_0x78d9('0xd'));_0x3b3709(_0x14ca4e[_0x78d9('0x14')][_0x78d9('0x12')]);}})[_0x78d9('0x15')](function(_0x156981){logger[_0x78d9('0x10')]('Campaign,\x20%s,\x20%s',_0x5b9602,_0x156981);_0x36b8f5(_0x156981);});});}exports[_0x78d9('0x16')]=function(_0x3b4dde){var _0x36f1e4=this;return new Promise(function(_0x8d0153,_0x43ea59){return db[_0x78d9('0x17')][_0x78d9('0x18')]({'raw':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1b')]||null:null,'attributes':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1c')]||null:null,'limit':_0x3b4dde['options']?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1d')]||null:null,'include':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')]['include']?_[_0x78d9('0x1e')](_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1f')],function(_0x51549d){return{'model':db[_0x51549d['model']],'as':_0x51549d['as'],'attributes':_0x51549d[_0x78d9('0x1c')],'include':_0x51549d['include']?_['map'](_0x51549d['include'],function(_0x28b7e1){return{'model':db[_0x28b7e1[_0x78d9('0x20')]],'as':_0x28b7e1['as'],'attributes':_0x28b7e1[_0x78d9('0x1c')],'include':_0x28b7e1[_0x78d9('0x1f')]?_[_0x78d9('0x1e')](_0x28b7e1[_0x78d9('0x1f')],function(_0x4e87cf){return{'model':db[_0x4e87cf[_0x78d9('0x20')]],'as':_0x4e87cf['as'],'attributes':_0x4e87cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x78d9('0xb')](function(_0x3d9a53){logger[_0x78d9('0x13')]('GetCampaign',_0x3b4dde);logger[_0x78d9('0xe')](_0x78d9('0x16'),_0x3b4dde,JSON['stringify'](_0x3d9a53));_0x8d0153(_0x3d9a53);})['catch'](function(_0x55617c){logger['error'](_0x78d9('0x16'),_0x55617c[_0x78d9('0x12')],_0x3b4dde);_0x43ea59(_0x36f1e4[_0x78d9('0x10')](0x1f4,_0x55617c[_0x78d9('0x12')]));});});}; \ No newline at end of file +var _0xe9f9=['code','message','findAll','options','where','include','map','model','attributes','GetCampaign','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe9f9,0x174));var _0x9e9f=function(_0x468364,_0x5edb29){_0x468364=_0x468364-0x0;var _0x1dec71=_0xe9f9[_0x468364];return _0x1dec71;};'use strict';var _=require(_0x9e9f('0x0'));var util=require('util');var moment=require(_0x9e9f('0x1'));var BPromise=require(_0x9e9f('0x2'));var rs=require(_0x9e9f('0x3'));var fs=require('fs');var Redis=require(_0x9e9f('0x4'));var db=require(_0x9e9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e9f('0x6'))('rpc');var config=require(_0x9e9f('0x7'));var jayson=require(_0x9e9f('0x8'));var client=jayson['client'][_0x9e9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54f87c,_0x310be8,_0x661886){return new BPromise(function(_0x10d43b,_0x5256b3){return client[_0x9e9f('0xa')](_0x54f87c,_0x661886)[_0x9e9f('0xb')](function(_0x2e1e8e){logger[_0x9e9f('0xc')](_0x9e9f('0xd'),_0x310be8,_0x9e9f('0xe'));logger['debug'](_0x9e9f('0xf'),_0x310be8,_0x9e9f('0xe'),JSON[_0x9e9f('0x10')](_0x2e1e8e));if(_0x2e1e8e['error']){if(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x12')]===0x1f4){logger[_0x9e9f('0x11')](_0x9e9f('0xd'),_0x310be8,_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);return _0x5256b3(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);}logger[_0x9e9f('0x11')]('Campaign,\x20%s,\x20%s',_0x310be8,_0x2e1e8e['error'][_0x9e9f('0x13')]);return _0x10d43b(_0x2e1e8e[_0x9e9f('0x11')][_0x9e9f('0x13')]);}else{logger[_0x9e9f('0xc')](_0x9e9f('0xd'),_0x310be8,_0x9e9f('0xe'));_0x10d43b(_0x2e1e8e['result'][_0x9e9f('0x13')]);}})['catch'](function(_0x38897c){logger['error']('Campaign,\x20%s,\x20%s',_0x310be8,_0x38897c);_0x5256b3(_0x38897c);});});}exports['GetCampaign']=function(_0x3e1c64){var _0x4576ed=this;return new Promise(function(_0xfadc07,_0x21f5b7){return db['Campaign'][_0x9e9f('0x14')]({'raw':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')][_0x9e9f('0x16')]||null:null,'attributes':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64['options']['attributes']||null:null,'limit':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')]['limit']||null:null,'include':_0x3e1c64[_0x9e9f('0x15')]?_0x3e1c64[_0x9e9f('0x15')][_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x3e1c64['options'][_0x9e9f('0x17')],function(_0x1172c2){return{'model':db[_0x1172c2['model']],'as':_0x1172c2['as'],'attributes':_0x1172c2['attributes'],'include':_0x1172c2[_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x1172c2['include'],function(_0x172dd1){return{'model':db[_0x172dd1[_0x9e9f('0x19')]],'as':_0x172dd1['as'],'attributes':_0x172dd1['attributes'],'include':_0x172dd1[_0x9e9f('0x17')]?_[_0x9e9f('0x18')](_0x172dd1['include'],function(_0x5cdfe6){return{'model':db[_0x5cdfe6[_0x9e9f('0x19')]],'as':_0x5cdfe6['as'],'attributes':_0x5cdfe6[_0x9e9f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9e9f('0xb')](function(_0xc12c4c){logger['info'](_0x9e9f('0x1b'),_0x3e1c64);logger[_0x9e9f('0x1c')](_0x9e9f('0x1b'),_0x3e1c64,JSON['stringify'](_0xc12c4c));_0xfadc07(_0xc12c4c);})[_0x9e9f('0x1d')](function(_0xa3a2d7){logger[_0x9e9f('0x11')]('GetCampaign',_0xa3a2d7[_0x9e9f('0x13')],_0x3e1c64);_0x21f5b7(_0x4576ed[_0x9e9f('0x11')](0x1f4,_0xa3a2d7[_0x9e9f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 86ffe70..2e3bb94 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 _0x0a4b=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','post','create','clone','/:id/lists','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','/:id/hopper_histories','isAuthenticated'];(function(_0x1e7766,_0x4136de){var _0x9b7173=function(_0x53fdc7){while(--_0x53fdc7){_0x1e7766['push'](_0x1e7766['shift']());}};_0x9b7173(++_0x4136de);}(_0x0a4b,0x6d));var _0xb0a4=function(_0x48689f,_0x4e913f){_0x48689f=_0x48689f-0x0;var _0x43ae70=_0x0a4b[_0x48689f];return _0x43ae70;};'use strict';var multer=require(_0xb0a4('0x0'));var util=require('util');var path=require(_0xb0a4('0x1'));var timeout=require(_0xb0a4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0a4('0x3'));var config=require(_0xb0a4('0x4'));var controller=require(_0xb0a4('0x5'));router[_0xb0a4('0x6')]('/',auth['isAuthenticated'](),controller[_0xb0a4('0x7')]);router[_0xb0a4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb0a4('0x8')]);router[_0xb0a4('0x6')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0xb0a4('0x6')](_0xb0a4('0x9'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0xb')]);router['get'](_0xb0a4('0xc'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0xd')]);router[_0xb0a4('0x6')](_0xb0a4('0xe'),auth['isAuthenticated'](),controller[_0xb0a4('0xf')]);router[_0xb0a4('0x6')]('/:id/lists',auth[_0xb0a4('0xa')](),controller['getLists']);router[_0xb0a4('0x6')](_0xb0a4('0x10'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xb0a4('0x11')]('/',auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x12')]);router[_0xb0a4('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0xb0a4('0x13')]);router['post'](_0xb0a4('0x14'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x15')]);router[_0xb0a4('0x11')]('/:id/blacklists',auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x16')]);router[_0xb0a4('0x17')](_0xb0a4('0x18'),auth['isAuthenticated'](),controller[_0xb0a4('0x19')]);router[_0xb0a4('0x1a')](_0xb0a4('0x18'),auth['isAuthenticated'](),controller[_0xb0a4('0x1b')]);router[_0xb0a4('0x1a')](_0xb0a4('0x14'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x1c')]);router[_0xb0a4('0x1a')](_0xb0a4('0x10'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xa4ce=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x4560e1,_0x429f0c){var _0x5ee331=function(_0x33a3eb){while(--_0x33a3eb){_0x4560e1['push'](_0x4560e1['shift']());}};_0x5ee331(++_0x429f0c);}(_0xa4ce,0x193));var _0xea4c=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa4ce[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xea4c('0x0'));var util=require(_0xea4c('0x1'));var path=require(_0xea4c('0x2'));var timeout=require(_0xea4c('0x3'));var express=require(_0xea4c('0x4'));var router=express[_0xea4c('0x5')]();var fs_extra=require(_0xea4c('0x6'));var auth=require(_0xea4c('0x7'));var interaction=require(_0xea4c('0x8'));var config=require(_0xea4c('0x9'));var controller=require('./campaign.controller');router[_0xea4c('0xa')]('/',auth['isAuthenticated'](),controller[_0xea4c('0xb')]);router[_0xea4c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xea4c('0xc')]);router[_0xea4c('0xa')](_0xea4c('0xd'),auth[_0xea4c('0xe')](),controller[_0xea4c('0xf')]);router[_0xea4c('0xa')]('/:id/hopper_histories',auth[_0xea4c('0xe')](),controller[_0xea4c('0x10')]);router[_0xea4c('0xa')](_0xea4c('0x11'),auth['isAuthenticated'](),controller[_0xea4c('0x12')]);router['get'](_0xea4c('0x13'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x14')]);router[_0xea4c('0xa')](_0xea4c('0x15'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x16')]);router[_0xea4c('0xa')](_0xea4c('0x17'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x18')]);router[_0xea4c('0x19')]('/',auth[_0xea4c('0xe')](),controller[_0xea4c('0x1a')]);router[_0xea4c('0x19')](_0xea4c('0x1b'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x1c')]);router[_0xea4c('0x19')](_0xea4c('0x15'),auth['isAuthenticated'](),controller[_0xea4c('0x1d')]);router[_0xea4c('0x19')](_0xea4c('0x17'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x1e')]);router['put'](_0xea4c('0x1f'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x20')]);router[_0xea4c('0x21')](_0xea4c('0x1f'),auth['isAuthenticated'](),controller['destroy']);router[_0xea4c('0x21')](_0xea4c('0x15'),auth[_0xea4c('0xe')](),controller[_0xea4c('0x22')]);router[_0xea4c('0x21')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xea4c('0x23')]);module[_0xea4c('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 74525c1..fa8a201 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 _0x0ea2=['sequelize','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x35fd0c,_0x57c9c4){var _0x2049cb=function(_0x4bdda0){while(--_0x4bdda0){_0x35fd0c['push'](_0x35fd0c['shift']());}};_0x2049cb(++_0x57c9c4);}(_0x0ea2,0x7e));var _0x20ea=function(_0x162053,_0xe1b6fc){_0x162053=_0x162053-0x0;var _0x5236ae=_0x0ea2[_0x162053];return _0x5236ae;};'use strict';var Sequelize=require(_0x20ea('0x0'));module['exports']={'key':{'type':Sequelize[_0x20ea('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x20ea('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x20ea('0x3')],'get':function(){return this[_0x20ea('0x4')](_0x20ea('0x5'));}}}; \ No newline at end of file +var _0x1621=['STRING','getDataValue','key','sequelize','exports'];(function(_0x43ba69,_0x3760ec){var _0x33ca5e=function(_0x354c09){while(--_0x354c09){_0x43ba69['push'](_0x43ba69['shift']());}};_0x33ca5e(++_0x3760ec);}(_0x1621,0x8f));var _0x1162=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x1621[_0x2132a3];return _0x21890c;};'use strict';var Sequelize=require(_0x1162('0x0'));module[_0x1162('0x1')]={'key':{'type':Sequelize[_0x1162('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1162('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1162('0x3')](_0x1162('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 89bd537..d4fd039 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 _0x2f5c=['../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','sendStatus','error','stack','name','index','map','CannedAnswer','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x2ba24f,_0x1e67d4){var _0x564da4=function(_0x3f3c06){while(--_0x3f3c06){_0x2ba24f['push'](_0x2ba24f['shift']());}};_0x564da4(++_0x1e67d4);}(_0x2f5c,0x15d));var _0xc2f5=function(_0x2d84b1,_0x392056){_0x2d84b1=_0x2d84b1-0x0;var _0x11f92d=_0x2f5c[_0x2d84b1];return _0x11f92d;};'use strict';var emlformat=require(_0xc2f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2f5('0x1'));var jsonpatch=require(_0xc2f5('0x2'));var rp=require(_0xc2f5('0x3'));var moment=require(_0xc2f5('0x4'));var BPromise=require(_0xc2f5('0x5'));var Mustache=require(_0xc2f5('0x6'));var util=require(_0xc2f5('0x7'));var path=require(_0xc2f5('0x8'));var sox=require(_0xc2f5('0x9'));var csv=require(_0xc2f5('0xa'));var ejs=require(_0xc2f5('0xb'));var fs=require('fs');var fs_extra=require(_0xc2f5('0xc'));var _=require(_0xc2f5('0xd'));var squel=require('squel');var crypto=require(_0xc2f5('0xe'));var jsforce=require(_0xc2f5('0xf'));var deskjs=require(_0xc2f5('0x10'));var toCsv=require(_0xc2f5('0xa'));var querystring=require(_0xc2f5('0x11'));var Papa=require('papaparse');var Redis=require(_0xc2f5('0x12'));var authService=require(_0xc2f5('0x13'));var qs=require(_0xc2f5('0x14'));var as=require(_0xc2f5('0x15'));var hardwareService=require(_0xc2f5('0x16'));var logger=require(_0xc2f5('0x17'))(_0xc2f5('0x18'));var utils=require('../../config/utils');var config=require(_0xc2f5('0x19'));var licenseUtil=require(_0xc2f5('0x1a'));var db=require(_0xc2f5('0x1b'))['db'];function respondWithStatusCode(_0x1cc34c,_0x5828b4){_0x5828b4=_0x5828b4||0xcc;return function(_0x1bc5c0){if(_0x1bc5c0){return _0x1cc34c['sendStatus'](_0x5828b4);}return _0x1cc34c[_0xc2f5('0x1c')](_0x5828b4)[_0xc2f5('0x1d')]();};}function respondWithResult(_0x54be2e,_0x43e1ec){_0x43e1ec=_0x43e1ec||0xc8;return function(_0x3ddf68){if(_0x3ddf68){return _0x54be2e[_0xc2f5('0x1c')](_0x43e1ec)['json'](_0x3ddf68);}};}function respondWithFilteredResult(_0x323dfd,_0x48b14f){return function(_0x23e4fa){if(_0x23e4fa){var _0x1ee734=typeof _0x48b14f[_0xc2f5('0x1e')]===_0xc2f5('0x1f')&&typeof _0x48b14f[_0xc2f5('0x20')]===_0xc2f5('0x1f');var _0x3c473e=_0x23e4fa['count'];var _0x39c0bb=_0x1ee734?0x0:_0x48b14f[_0xc2f5('0x1e')];var _0x318650=_0x1ee734?_0x23e4fa[_0xc2f5('0x21')]:_0x48b14f[_0xc2f5('0x1e')]+_0x48b14f[_0xc2f5('0x20')];var _0x48379c;if(_0x318650>=_0x3c473e){_0x318650=_0x3c473e;_0x48379c=0xc8;}else{_0x48379c=0xce;}_0x323dfd[_0xc2f5('0x1c')](_0x48379c);return _0x323dfd[_0xc2f5('0x22')](_0xc2f5('0x23'),_0x39c0bb+'-'+_0x318650+'/'+_0x3c473e)[_0xc2f5('0x24')](_0x23e4fa);}return null;};}function patchUpdates(_0x3abe37){return function(_0x446e10){try{jsonpatch[_0xc2f5('0x25')](_0x446e10,_0x3abe37,!![]);}catch(_0x149b4c){return BPromise[_0xc2f5('0x26')](_0x149b4c);}return _0x446e10[_0xc2f5('0x27')]();};}function saveUpdates(_0x2db98a,_0x3a8eee){return function(_0x1fe2a2){if(_0x1fe2a2){return _0x1fe2a2[_0xc2f5('0x28')](_0x2db98a)['then'](function(_0x70fd4d){return _0x70fd4d;});}return null;};}function removeEntity(_0x2f09d0,_0x103e13){return function(_0x6f8632){if(_0x6f8632){return _0x6f8632[_0xc2f5('0x29')]()[_0xc2f5('0x2a')](function(){var _0x50081e=_0x6f8632[_0xc2f5('0x2b')]({'plain':!![]});var _0x56c09e=_0xc2f5('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x56c09e,'resourceId':_0x50081e['id']}})[_0xc2f5('0x2a')](function(){return _0x6f8632;});})['then'](function(){_0x2f09d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ecfd,_0x458f45){return function(_0x33015c){if(!_0x33015c){_0x39ecfd[_0xc2f5('0x2d')](0x194);}return _0x33015c;};}function handleError(_0x2b5377,_0x5bdded){_0x5bdded=_0x5bdded||0x1f4;return function(_0x46c974){logger[_0xc2f5('0x2e')](_0x46c974[_0xc2f5('0x2f')]);if(_0x46c974[_0xc2f5('0x30')]){delete _0x46c974[_0xc2f5('0x30')];}_0x2b5377['status'](_0x5bdded)['send'](_0x46c974);};}exports[_0xc2f5('0x31')]=function(_0x2e565d,_0x311ea8){var _0x52e092={},_0x1224c3={},_0x50f74a={'count':0x0,'rows':[]};var _0x38cdb9=_[_0xc2f5('0x32')](db[_0xc2f5('0x33')]['rawAttributes'],function(_0x1c9090){return{'name':_0x1c9090['fieldName'],'type':_0x1c9090[_0xc2f5('0x34')][_0xc2f5('0x35')]};});_0x1224c3[_0xc2f5('0x36')]=_['map'](_0x38cdb9,_0xc2f5('0x30'));_0x1224c3[_0xc2f5('0x37')]=_[_0xc2f5('0x38')](_0x2e565d[_0xc2f5('0x37')]);_0x1224c3['filters']=_[_0xc2f5('0x39')](_0x1224c3[_0xc2f5('0x36')],_0x1224c3[_0xc2f5('0x37')]);_0x52e092[_0xc2f5('0x3a')]=_[_0xc2f5('0x39')](_0x1224c3[_0xc2f5('0x36')],qs[_0xc2f5('0x3b')](_0x2e565d['query']['fields']));_0x52e092['attributes']=_0x52e092[_0xc2f5('0x3a')]['length']?_0x52e092[_0xc2f5('0x3a')]:_0x1224c3['model'];if(!_0x2e565d[_0xc2f5('0x37')]['hasOwnProperty']('nolimit')){_0x52e092[_0xc2f5('0x20')]=qs[_0xc2f5('0x20')](_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x20')]);_0x52e092[_0xc2f5('0x1e')]=qs[_0xc2f5('0x1e')](_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x1e')]);}_0x52e092[_0xc2f5('0x3c')]=qs[_0xc2f5('0x3d')](_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x3d')]);_0x52e092[_0xc2f5('0x3e')]=qs[_0xc2f5('0x3f')](_[_0xc2f5('0x40')](_0x2e565d['query'],_0x1224c3[_0xc2f5('0x3f')]),_0x38cdb9);if(_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x41')]){_0x52e092['where']=_[_0xc2f5('0x42')](_0x52e092[_0xc2f5('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x41')]+'%'}},{'value':{'$like':'%'+_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x41')]+'%'}}]});}_0x52e092=_[_0xc2f5('0x42')]({},_0x52e092,_0x2e565d[_0xc2f5('0x43')]);var _0x11c779={'where':_0x52e092[_0xc2f5('0x3e')]};return db[_0xc2f5('0x33')][_0xc2f5('0x21')](_0x11c779)['then'](function(_0x513598){_0x50f74a[_0xc2f5('0x21')]=_0x513598;if(_0x2e565d[_0xc2f5('0x37')][_0xc2f5('0x44')]){_0x52e092[_0xc2f5('0x45')]=[{'all':!![]}];}return db[_0xc2f5('0x33')][_0xc2f5('0x46')](_0x52e092);})[_0xc2f5('0x2a')](function(_0x54f078){_0x50f74a[_0xc2f5('0x47')]=_0x54f078;return _0x50f74a;})['then'](respondWithFilteredResult(_0x311ea8,_0x52e092))[_0xc2f5('0x48')](handleError(_0x311ea8,null));};exports[_0xc2f5('0x49')]=function(_0xbabda1,_0x428846){var _0x4d91e7={'raw':!![],'where':{'id':_0xbabda1[_0xc2f5('0x4a')]['id']}},_0x343729={};_0x343729[_0xc2f5('0x36')]=_[_0xc2f5('0x38')](db[_0xc2f5('0x33')][_0xc2f5('0x4b')]);_0x343729[_0xc2f5('0x37')]=_['keys'](_0xbabda1[_0xc2f5('0x37')]);_0x343729[_0xc2f5('0x3f')]=_['intersection'](_0x343729[_0xc2f5('0x36')],_0x343729['query']);_0x4d91e7[_0xc2f5('0x3a')]=_['intersection'](_0x343729[_0xc2f5('0x36')],qs[_0xc2f5('0x3b')](_0xbabda1[_0xc2f5('0x37')][_0xc2f5('0x3b')]));_0x4d91e7[_0xc2f5('0x3a')]=_0x4d91e7[_0xc2f5('0x3a')][_0xc2f5('0x4c')]?_0x4d91e7[_0xc2f5('0x3a')]:_0x343729[_0xc2f5('0x36')];if(_0xbabda1[_0xc2f5('0x37')][_0xc2f5('0x44')]){_0x4d91e7['include']=[{'all':!![]}];}_0x4d91e7=_['merge']({},_0x4d91e7,_0xbabda1[_0xc2f5('0x43')]);return db[_0xc2f5('0x33')][_0xc2f5('0x4d')](_0x4d91e7)['then'](handleEntityNotFound(_0x428846,null))[_0xc2f5('0x2a')](respondWithResult(_0x428846,null))[_0xc2f5('0x48')](handleError(_0x428846,null));};exports['update']=function(_0x30ace8,_0x1f792c){if(_0x30ace8['body']['id']){delete _0x30ace8[_0xc2f5('0x4e')]['id'];}return db[_0xc2f5('0x33')][_0xc2f5('0x4d')]({'where':{'id':_0x30ace8['params']['id']}})[_0xc2f5('0x2a')](handleEntityNotFound(_0x1f792c,null))[_0xc2f5('0x2a')](saveUpdates(_0x30ace8[_0xc2f5('0x4e')],null))[_0xc2f5('0x2a')](respondWithResult(_0x1f792c,null))['catch'](handleError(_0x1f792c,null));};exports[_0xc2f5('0x29')]=function(_0x4f9643,_0x4b44a1){return db[_0xc2f5('0x33')][_0xc2f5('0x4d')]({'where':{'id':_0x4f9643[_0xc2f5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b44a1,null))[_0xc2f5('0x2a')](removeEntity(_0x4b44a1,null))[_0xc2f5('0x48')](handleError(_0x4b44a1,null));};exports[_0xc2f5('0x4f')]=function(_0x30ee67,_0x4efc02){var _0x1eb23d={'key':_0x30ee67[_0xc2f5('0x4e')]['key']};if(_0x30ee67['body'][_0xc2f5('0x50')]){_0x1eb23d[_0xc2f5('0x50')]=_0x30ee67['body']['MailAccountId'];}else if(_0x30ee67[_0xc2f5('0x4e')][_0xc2f5('0x51')]){_0x1eb23d[_0xc2f5('0x51')]=_0x30ee67[_0xc2f5('0x4e')][_0xc2f5('0x51')];}else if(_0x30ee67[_0xc2f5('0x4e')]['OpenchannelAccountId']){_0x1eb23d['OpenchannelAccountId']=_0x30ee67[_0xc2f5('0x4e')][_0xc2f5('0x52')];}else if(_0x30ee67[_0xc2f5('0x4e')]['ChatWebsiteId']){_0x1eb23d[_0xc2f5('0x53')]=_0x30ee67[_0xc2f5('0x4e')][_0xc2f5('0x53')];}return db[_0xc2f5('0x33')][_0xc2f5('0x4d')]({'where':_0x1eb23d})[_0xc2f5('0x2a')](function(_0x17d116){if(_0x17d116){throw new db['Sequelize'][(_0xc2f5('0x54'))](_0xc2f5('0x55'));}return db['CannedAnswer'][_0xc2f5('0x4f')](_0x30ee67[_0xc2f5('0x4e')]);})['then'](function(_0x3cbea1){var _0xef8233=_0x30ee67[_0xc2f5('0x56')][_0xc2f5('0x2b')]({'plain':!![]});if(!_0xef8233)throw new Error(_0xc2f5('0x57'));if(_0xef8233[_0xc2f5('0x58')]===_0xc2f5('0x56')){var _0x31ee2f=_0x3cbea1[_0xc2f5('0x2b')]({'plain':!![]});return db[_0xc2f5('0x59')]['find']({'where':{'name':_0xc2f5('0x2c'),'userProfileId':_0xef8233[_0xc2f5('0x5a')]},'raw':!![]})['then'](function(_0x5e71bc){if(_0x5e71bc&&_0x5e71bc[_0xc2f5('0x5b')]===0x0){return db[_0xc2f5('0x5c')][_0xc2f5('0x4f')]({'name':_0x31ee2f[_0xc2f5('0x30')],'resourceId':_0x31ee2f['id'],'type':_0x5e71bc[_0xc2f5('0x30')],'sectionId':_0x5e71bc['id']},{})[_0xc2f5('0x2a')](function(){return _0x3cbea1;});}else{return _0x3cbea1;}})['catch'](function(_0x2378de){logger[_0xc2f5('0x2e')](_0xc2f5('0x5d'),_0x2378de);throw _0x2378de;});}return _0x3cbea1;})[_0xc2f5('0x2a')](respondWithResult(_0x4efc02,0xc9))[_0xc2f5('0x48')](handleError(_0x4efc02,null));}; \ No newline at end of file +var _0x06de=['rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','catch','update','body','find','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','Content-Range','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer'];(function(_0x423265,_0x5d5191){var _0x247f70=function(_0x3c293b){while(--_0x3c293b){_0x423265['push'](_0x423265['shift']());}};_0x247f70(++_0x5d5191);}(_0x06de,0xd8));var _0xe06d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x06de[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06d('0x0'));var zipdir=require(_0xe06d('0x1'));var jsonpatch=require(_0xe06d('0x2'));var rp=require('request-promise');var moment=require(_0xe06d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe06d('0x4'));var util=require('util');var path=require(_0xe06d('0x5'));var sox=require(_0xe06d('0x6'));var csv=require(_0xe06d('0x7'));var ejs=require(_0xe06d('0x8'));var fs=require('fs');var fs_extra=require(_0xe06d('0x9'));var _=require(_0xe06d('0xa'));var squel=require(_0xe06d('0xb'));var crypto=require(_0xe06d('0xc'));var jsforce=require(_0xe06d('0xd'));var deskjs=require(_0xe06d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe06d('0xf'));var Papa=require(_0xe06d('0x10'));var Redis=require('ioredis');var authService=require(_0xe06d('0x11'));var qs=require(_0xe06d('0x12'));var as=require(_0xe06d('0x13'));var hardwareService=require(_0xe06d('0x14'));var logger=require(_0xe06d('0x15'))(_0xe06d('0x16'));var utils=require(_0xe06d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe06d('0x18'))['db'];function respondWithStatusCode(_0x1b8574,_0x1b2981){_0x1b2981=_0x1b2981||0xcc;return function(_0x159ae8){if(_0x159ae8){return _0x1b8574[_0xe06d('0x19')](_0x1b2981);}return _0x1b8574[_0xe06d('0x1a')](_0x1b2981)[_0xe06d('0x1b')]();};}function respondWithResult(_0x506c37,_0x2add77){_0x2add77=_0x2add77||0xc8;return function(_0x17347a){if(_0x17347a){return _0x506c37['status'](_0x2add77)[_0xe06d('0x1c')](_0x17347a);}};}function respondWithFilteredResult(_0x6874fe,_0x18962e){return function(_0x134c3c){if(_0x134c3c){var _0x3add6d=typeof _0x18962e[_0xe06d('0x1d')]===_0xe06d('0x1e')&&typeof _0x18962e['limit']==='undefined';var _0x50aa95=_0x134c3c['count'];var _0x4db06a=_0x3add6d?0x0:_0x18962e[_0xe06d('0x1d')];var _0x63dc47=_0x3add6d?_0x134c3c['count']:_0x18962e[_0xe06d('0x1d')]+_0x18962e['limit'];var _0x16b92b;if(_0x63dc47>=_0x50aa95){_0x63dc47=_0x50aa95;_0x16b92b=0xc8;}else{_0x16b92b=0xce;}_0x6874fe['status'](_0x16b92b);return _0x6874fe['set'](_0xe06d('0x1f'),_0x4db06a+'-'+_0x63dc47+'/'+_0x50aa95)[_0xe06d('0x1c')](_0x134c3c);}return null;};}function patchUpdates(_0x19cde2){return function(_0x2f23e0){try{jsonpatch['apply'](_0x2f23e0,_0x19cde2,!![]);}catch(_0x4f0c35){return BPromise['reject'](_0x4f0c35);}return _0x2f23e0[_0xe06d('0x20')]();};}function saveUpdates(_0x20e79e,_0x4f0626){return function(_0x4e0f88){if(_0x4e0f88){return _0x4e0f88['update'](_0x20e79e)[_0xe06d('0x21')](function(_0x62bb6e){return _0x62bb6e;});}return null;};}function removeEntity(_0x23d228,_0x393867){return function(_0x24874e){if(_0x24874e){return _0x24874e[_0xe06d('0x22')]()['then'](function(){var _0x5c41de=_0x24874e[_0xe06d('0x23')]({'plain':!![]});var _0x5261a2=_0xe06d('0x24');return db[_0xe06d('0x25')][_0xe06d('0x22')]({'where':{'type':_0x5261a2,'resourceId':_0x5c41de['id']}})[_0xe06d('0x21')](function(){return _0x24874e;});})[_0xe06d('0x21')](function(){_0x23d228[_0xe06d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x465d06,_0x586873){return function(_0x21e2ce){if(!_0x21e2ce){_0x465d06['sendStatus'](0x194);}return _0x21e2ce;};}function handleError(_0x2e582f,_0x757258){_0x757258=_0x757258||0x1f4;return function(_0x3568f8){logger[_0xe06d('0x26')](_0x3568f8[_0xe06d('0x27')]);if(_0x3568f8[_0xe06d('0x28')]){delete _0x3568f8[_0xe06d('0x28')];}_0x2e582f['status'](_0x757258)[_0xe06d('0x29')](_0x3568f8);};}exports[_0xe06d('0x2a')]=function(_0x4288bd,_0x1ecc99){var _0x2f545a={},_0xb14c75={},_0x2585b4={'count':0x0,'rows':[]};var _0x7b8e78=_[_0xe06d('0x2b')](db[_0xe06d('0x2c')][_0xe06d('0x2d')],function(_0x35defe){return{'name':_0x35defe[_0xe06d('0x2e')],'type':_0x35defe[_0xe06d('0x2f')][_0xe06d('0x30')]};});_0xb14c75['model']=_[_0xe06d('0x2b')](_0x7b8e78,_0xe06d('0x28'));_0xb14c75['query']=_[_0xe06d('0x31')](_0x4288bd[_0xe06d('0x32')]);_0xb14c75[_0xe06d('0x33')]=_['intersection'](_0xb14c75['model'],_0xb14c75[_0xe06d('0x32')]);_0x2f545a[_0xe06d('0x34')]=_[_0xe06d('0x35')](_0xb14c75[_0xe06d('0x36')],qs['fields'](_0x4288bd['query'][_0xe06d('0x37')]));_0x2f545a[_0xe06d('0x34')]=_0x2f545a[_0xe06d('0x34')][_0xe06d('0x38')]?_0x2f545a[_0xe06d('0x34')]:_0xb14c75[_0xe06d('0x36')];if(!_0x4288bd['query']['hasOwnProperty'](_0xe06d('0x39'))){_0x2f545a['limit']=qs['limit'](_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3a')]);_0x2f545a[_0xe06d('0x1d')]=qs[_0xe06d('0x1d')](_0x4288bd[_0xe06d('0x32')][_0xe06d('0x1d')]);}_0x2f545a[_0xe06d('0x3b')]=qs[_0xe06d('0x3c')](_0x4288bd['query'][_0xe06d('0x3c')]);_0x2f545a[_0xe06d('0x3d')]=qs[_0xe06d('0x33')](_[_0xe06d('0x3e')](_0x4288bd[_0xe06d('0x32')],_0xb14c75[_0xe06d('0x33')]),_0x7b8e78);if(_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3f')]){_0x2f545a['where']=_['merge'](_0x2f545a[_0xe06d('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4288bd[_0xe06d('0x32')][_0xe06d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4288bd['query'][_0xe06d('0x3f')]+'%'}}]});}_0x2f545a=_[_0xe06d('0x40')]({},_0x2f545a,_0x4288bd[_0xe06d('0x41')]);var _0x4060e5={'where':_0x2f545a[_0xe06d('0x3d')]};return db['CannedAnswer'][_0xe06d('0x42')](_0x4060e5)['then'](function(_0x3c705a){_0x2585b4[_0xe06d('0x42')]=_0x3c705a;if(_0x4288bd[_0xe06d('0x32')][_0xe06d('0x43')]){_0x2f545a[_0xe06d('0x44')]=[{'all':!![]}];}return db[_0xe06d('0x2c')][_0xe06d('0x45')](_0x2f545a);})[_0xe06d('0x21')](function(_0x4d0987){_0x2585b4['rows']=_0x4d0987;return _0x2585b4;})[_0xe06d('0x21')](respondWithFilteredResult(_0x1ecc99,_0x2f545a))['catch'](handleError(_0x1ecc99,null));};exports[_0xe06d('0x46')]=function(_0x59e3e8,_0x33462d){var _0x31e155={'raw':!![],'where':{'id':_0x59e3e8[_0xe06d('0x47')]['id']}},_0x32be1a={};_0x32be1a['model']=_['keys'](db[_0xe06d('0x2c')]['rawAttributes']);_0x32be1a[_0xe06d('0x32')]=_['keys'](_0x59e3e8[_0xe06d('0x32')]);_0x32be1a[_0xe06d('0x33')]=_[_0xe06d('0x35')](_0x32be1a[_0xe06d('0x36')],_0x32be1a[_0xe06d('0x32')]);_0x31e155['attributes']=_[_0xe06d('0x35')](_0x32be1a[_0xe06d('0x36')],qs['fields'](_0x59e3e8[_0xe06d('0x32')][_0xe06d('0x37')]));_0x31e155[_0xe06d('0x34')]=_0x31e155[_0xe06d('0x34')][_0xe06d('0x38')]?_0x31e155[_0xe06d('0x34')]:_0x32be1a[_0xe06d('0x36')];if(_0x59e3e8['query']['includeAll']){_0x31e155[_0xe06d('0x44')]=[{'all':!![]}];}_0x31e155=_[_0xe06d('0x40')]({},_0x31e155,_0x59e3e8[_0xe06d('0x41')]);return db[_0xe06d('0x2c')]['find'](_0x31e155)[_0xe06d('0x21')](handleEntityNotFound(_0x33462d,null))[_0xe06d('0x21')](respondWithResult(_0x33462d,null))[_0xe06d('0x48')](handleError(_0x33462d,null));};exports[_0xe06d('0x49')]=function(_0x2ae4c5,_0x498b00){if(_0x2ae4c5[_0xe06d('0x4a')]['id']){delete _0x2ae4c5[_0xe06d('0x4a')]['id'];}return db[_0xe06d('0x2c')][_0xe06d('0x4b')]({'where':{'id':_0x2ae4c5[_0xe06d('0x47')]['id']}})['then'](handleEntityNotFound(_0x498b00,null))[_0xe06d('0x21')](saveUpdates(_0x2ae4c5[_0xe06d('0x4a')],null))[_0xe06d('0x21')](respondWithResult(_0x498b00,null))['catch'](handleError(_0x498b00,null));};exports['destroy']=function(_0x2183c2,_0x341404){return db[_0xe06d('0x2c')]['find']({'where':{'id':_0x2183c2['params']['id']}})[_0xe06d('0x21')](handleEntityNotFound(_0x341404,null))['then'](removeEntity(_0x341404,null))['catch'](handleError(_0x341404,null));};exports[_0xe06d('0x4c')]=function(_0x18f12e,_0x60392d){var _0x428ce7={'key':_0x18f12e['body'][_0xe06d('0x30')]};if(_0x18f12e[_0xe06d('0x4a')]['MailAccountId']){_0x428ce7['MailAccountId']=_0x18f12e['body']['MailAccountId'];}else if(_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4d')]){_0x428ce7[_0xe06d('0x4d')]=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4d')];}else if(_0x18f12e[_0xe06d('0x4a')]['OpenchannelAccountId']){_0x428ce7['OpenchannelAccountId']=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4e')];}else if(_0x18f12e['body'][_0xe06d('0x4f')]){_0x428ce7[_0xe06d('0x4f')]=_0x18f12e[_0xe06d('0x4a')][_0xe06d('0x4f')];}return db[_0xe06d('0x2c')][_0xe06d('0x4b')]({'where':_0x428ce7})[_0xe06d('0x21')](function(_0x4c3c79){if(_0x4c3c79){throw new db[(_0xe06d('0x50'))]['ValidationError'](_0xe06d('0x51'));}return db[_0xe06d('0x2c')]['create'](_0x18f12e[_0xe06d('0x4a')]);})[_0xe06d('0x21')](function(_0x1b8afc){var _0x3d02bd=_0x18f12e[_0xe06d('0x52')][_0xe06d('0x23')]({'plain':!![]});if(!_0x3d02bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d02bd[_0xe06d('0x53')]===_0xe06d('0x52')){var _0x591a1c=_0x1b8afc[_0xe06d('0x23')]({'plain':!![]});return db[_0xe06d('0x54')][_0xe06d('0x4b')]({'where':{'name':_0xe06d('0x24'),'userProfileId':_0x3d02bd['userProfileId']},'raw':!![]})[_0xe06d('0x21')](function(_0x17aa90){if(_0x17aa90&&_0x17aa90[_0xe06d('0x55')]===0x0){return db[_0xe06d('0x25')][_0xe06d('0x4c')]({'name':_0x591a1c[_0xe06d('0x28')],'resourceId':_0x591a1c['id'],'type':_0x17aa90[_0xe06d('0x28')],'sectionId':_0x17aa90['id']},{})[_0xe06d('0x21')](function(){return _0x1b8afc;});}else{return _0x1b8afc;}})[_0xe06d('0x48')](function(_0x47e6d6){logger[_0xe06d('0x26')](_0xe06d('0x56'),_0x47e6d6);throw _0x47e6d6;});}return _0x1b8afc;})[_0xe06d('0x21')](respondWithResult(_0x60392d,0xc9))[_0xe06d('0x48')](handleError(_0x60392d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 26d5470..7643bf8 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 _0xa1aa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2ccc17,_0x2c9375){var _0x37f5d4=function(_0x13cef8){while(--_0x13cef8){_0x2ccc17['push'](_0x2ccc17['shift']());}};_0x37f5d4(++_0x2c9375);}(_0xa1aa,0x81));var _0xaa1a=function(_0x3c7b8a,_0x3b0327){_0x3c7b8a=_0x3c7b8a-0x0;var _0x3d386a=_0xa1aa[_0x3c7b8a];return _0x3d386a;};'use strict';var _=require(_0xaa1a('0x0'));var util=require(_0xaa1a('0x1'));var logger=require(_0xaa1a('0x2'))('api');var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require(_0xaa1a('0x5'));var fs=require('fs');var path=require(_0xaa1a('0x6'));var rimraf=require(_0xaa1a('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa1a('0x8'));module[_0xaa1a('0x9')]=function(_0x4d916c,_0x1cd007){return _0x4d916c[_0xaa1a('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa1a('0xb'),'collate':_0xaa1a('0xc')});}; \ No newline at end of file +var _0x8144=['api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','lodash','util'];(function(_0x46e523,_0xe6fccb){var _0x5da0ee=function(_0x396682){while(--_0x396682){_0x46e523['push'](_0x46e523['shift']());}};_0x5da0ee(++_0xe6fccb);}(_0x8144,0xf5));var _0x4814=function(_0x4e70fd,_0xd0ef5b){_0x4e70fd=_0x4e70fd-0x0;var _0x51cd96=_0x8144[_0x4e70fd];return _0x51cd96;};'use strict';var _=require(_0x4814('0x0'));var util=require(_0x4814('0x1'));var logger=require('../../config/logger')(_0x4814('0x2'));var moment=require(_0x4814('0x3'));var BPromise=require('bluebird');var rp=require(_0x4814('0x4'));var fs=require('fs');var path=require(_0x4814('0x5'));var rimraf=require(_0x4814('0x6'));var config=require(_0x4814('0x7'));var attributes=require(_0x4814('0x8'));module[_0x4814('0x9')]=function(_0x3da152,_0x50164c){return _0x3da152[_0x4814('0xa')](_0x4814('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4814('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d73c8f1..fe6c60f 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(_0x59c4df,_0x3b2b0f){var _0x5a4cb3=function(_0x1a8a74){while(--_0x1a8a74){_0x59c4df['push'](_0x59c4df['shift']());}};_0x5a4cb3(++_0x3b2b0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x21d7a8,_0x551f3a){var _0x1f2320=function(_0x2a8eb6){while(--_0x2a8eb6){_0x21d7a8['push'](_0x21d7a8['shift']());}};_0x1f2320(++_0x551f3a);}(_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 diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index fb0a562..251d248 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 _0xfbbd=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x420e4d,_0x1b7e89){var _0x208c8e=function(_0x3246c0){while(--_0x3246c0){_0x420e4d['push'](_0x420e4d['shift']());}};_0x208c8e(++_0x1b7e89);}(_0xfbbd,0x154));var _0xdfbb=function(_0x41ca24,_0x5415d1){_0x41ca24=_0x41ca24-0x0;var _0xb562cf=_0xfbbd[_0x41ca24];return _0xb562cf;};'use strict';var multer=require(_0xdfbb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdfbb('0x1'));var auth=require(_0xdfbb('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xdfbb('0x3')]('/',auth[_0xdfbb('0x4')](),controller[_0xdfbb('0x5')]);router[_0xdfbb('0x3')](_0xdfbb('0x6'),auth[_0xdfbb('0x4')](),controller[_0xdfbb('0x7')]);router[_0xdfbb('0x8')]('/',auth[_0xdfbb('0x4')](),controller[_0xdfbb('0x9')]);router[_0xdfbb('0xa')]('/:id',auth[_0xdfbb('0x4')](),controller[_0xdfbb('0xb')]);router[_0xdfbb('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xdfbb('0xd')]);module[_0xdfbb('0xe')]=router; \ No newline at end of file +var _0x8d0f=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x5987a3,_0x1dee96){var _0x477db4=function(_0x3dd0b2){while(--_0x3dd0b2){_0x5987a3['push'](_0x5987a3['shift']());}};_0x477db4(++_0x1dee96);}(_0x8d0f,0x129));var _0xf8d0=function(_0x1f2758,_0x153885){_0x1f2758=_0x1f2758-0x0;var _0x3bc8c3=_0x8d0f[_0x1f2758];return _0x3bc8c3;};'use strict';var multer=require(_0xf8d0('0x0'));var util=require(_0xf8d0('0x1'));var path=require(_0xf8d0('0x2'));var timeout=require(_0xf8d0('0x3'));var express=require('express');var router=express[_0xf8d0('0x4')]();var fs_extra=require(_0xf8d0('0x5'));var auth=require(_0xf8d0('0x6'));var interaction=require(_0xf8d0('0x7'));var config=require('../../config/environment');var controller=require(_0xf8d0('0x8'));router[_0xf8d0('0x9')]('/',auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xb')]);router['get'](_0xf8d0('0xc'),auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xd')]);router[_0xf8d0('0xe')]('/',auth[_0xf8d0('0xa')](),controller['create']);router['put']('/:id',auth[_0xf8d0('0xa')](),controller[_0xf8d0('0xf')]);router['delete'](_0xf8d0('0xc'),auth[_0xf8d0('0xa')](),controller[_0xf8d0('0x10')]);module[_0xf8d0('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 57c8b84..82b442a 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 _0x6f0d=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x42a3d4,_0x2d5cda){var _0x102b3d=function(_0x28a3c6){while(--_0x28a3c6){_0x42a3d4['push'](_0x42a3d4['shift']());}};_0x102b3d(++_0x2d5cda);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x144345,_0x317f74){_0x144345=_0x144345-0x0;var _0x6fb2aa=_0x6f0d[_0x144345];return _0x6fb2aa;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'calldate':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![],'defaultValue':_0xd6f0('0x2')},'clid':{'type':Sequelize[_0xd6f0('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xd6f0('0x3')]},'dcontext':{'type':Sequelize[_0xd6f0('0x3')]},'channel':{'type':Sequelize[_0xd6f0('0x3')]},'dstchannel':{'type':Sequelize[_0xd6f0('0x3')]},'lastapp':{'type':Sequelize[_0xd6f0('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd6f0('0x3')]},'amaflags':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd6f0('0x3')]},'userfield':{'type':Sequelize[_0xd6f0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd6f0('0x3')]},'peeraccount':{'type':Sequelize[_0xd6f0('0x3')]},'type':{'type':Sequelize[_0xd6f0('0x3')]},'tag':{'type':Sequelize[_0xd6f0('0x3')]}}; \ No newline at end of file +var _0x7b6b=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x7b6b,0xac));var _0xb7b6=function(_0x32761f,_0x49ef6f){_0x32761f=_0x32761f-0x0;var _0x43ba7d=_0x7b6b[_0x32761f];return _0x43ba7d;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xb7b6('0x1')],'allowNull':![],'defaultValue':_0xb7b6('0x2')},'clid':{'type':Sequelize[_0xb7b6('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb7b6('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb7b6('0x3')]},'dstchannel':{'type':Sequelize[_0xb7b6('0x3')]},'lastapp':{'type':Sequelize[_0xb7b6('0x3')]},'lastdata':{'type':Sequelize[_0xb7b6('0x3')]},'duration':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb7b6('0x3')]},'amaflags':{'type':Sequelize[_0xb7b6('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb7b6('0x3')]},'userfield':{'type':Sequelize[_0xb7b6('0x3')]},'uniqueid':{'type':Sequelize[_0xb7b6('0x3')]},'linkedid':{'type':Sequelize[_0xb7b6('0x3')]},'sequence':{'type':Sequelize[_0xb7b6('0x3')]},'peeraccount':{'type':Sequelize[_0xb7b6('0x3')]},'type':{'type':Sequelize[_0xb7b6('0x3')]},'tag':{'type':Sequelize[_0xb7b6('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0beff53..b0480c4 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 _0xfc17=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x539999,_0x2435a2){var _0xff9180=function(_0x3c51c2){while(--_0x3c51c2){_0x539999['push'](_0x539999['shift']());}};_0xff9180(++_0x2435a2);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x376510,_0x47a195){_0x376510=_0x376510-0x0;var _0x109fd4=_0xfc17[_0x376510];return _0x109fd4;};'use strict';var emlformat=require(_0x7fc1('0x0'));var rimraf=require(_0x7fc1('0x1'));var zipdir=require(_0x7fc1('0x2'));var jsonpatch=require(_0x7fc1('0x3'));var rp=require('request-promise');var moment=require(_0x7fc1('0x4'));var BPromise=require(_0x7fc1('0x5'));var Mustache=require(_0x7fc1('0x6'));var util=require(_0x7fc1('0x7'));var path=require(_0x7fc1('0x8'));var sox=require(_0x7fc1('0x9'));var csv=require('to-csv');var ejs=require(_0x7fc1('0xa'));var fs=require('fs');var fs_extra=require(_0x7fc1('0xb'));var _=require(_0x7fc1('0xc'));var squel=require(_0x7fc1('0xd'));var crypto=require(_0x7fc1('0xe'));var jsforce=require(_0x7fc1('0xf'));var deskjs=require(_0x7fc1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7fc1('0x11'));var Papa=require(_0x7fc1('0x12'));var Redis=require(_0x7fc1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7fc1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fc1('0x15'))(_0x7fc1('0x16'));var utils=require(_0x7fc1('0x17'));var config=require(_0x7fc1('0x18'));var licenseUtil=require(_0x7fc1('0x19'));var db=require(_0x7fc1('0x1a'))['db'];function respondWithStatusCode(_0x53277f,_0x3a7c8e){_0x3a7c8e=_0x3a7c8e||0xcc;return function(_0x902325){if(_0x902325){return _0x53277f[_0x7fc1('0x1b')](_0x3a7c8e);}return _0x53277f[_0x7fc1('0x1c')](_0x3a7c8e)[_0x7fc1('0x1d')]();};}function respondWithResult(_0x5651f2,_0x54a204){_0x54a204=_0x54a204||0xc8;return function(_0x881462){if(_0x881462){return _0x5651f2[_0x7fc1('0x1c')](_0x54a204)[_0x7fc1('0x1e')](_0x881462);}};}function respondWithFilteredResult(_0x391de7,_0x432825){return function(_0x3c4671){if(_0x3c4671){var _0x3d8e82=typeof _0x432825[_0x7fc1('0x1f')]===_0x7fc1('0x20')&&typeof _0x432825[_0x7fc1('0x21')]==='undefined';var _0x419170=_0x3c4671['count'];var _0x30fc04=_0x3d8e82?0x0:_0x432825[_0x7fc1('0x1f')];var _0x535ae1=_0x3d8e82?_0x3c4671[_0x7fc1('0x22')]:_0x432825[_0x7fc1('0x1f')]+_0x432825['limit'];var _0x25d384;if(_0x535ae1>=_0x419170){_0x535ae1=_0x419170;_0x25d384=0xc8;}else{_0x25d384=0xce;}_0x391de7[_0x7fc1('0x1c')](_0x25d384);return _0x391de7[_0x7fc1('0x23')](_0x7fc1('0x24'),_0x30fc04+'-'+_0x535ae1+'/'+_0x419170)[_0x7fc1('0x1e')](_0x3c4671);}return null;};}function patchUpdates(_0x1c249d){return function(_0x3e7c92){try{jsonpatch[_0x7fc1('0x25')](_0x3e7c92,_0x1c249d,!![]);}catch(_0x327569){return BPromise[_0x7fc1('0x26')](_0x327569);}return _0x3e7c92['save']();};}function saveUpdates(_0x49a44f,_0x2390b8){return function(_0x5e10cd){if(_0x5e10cd){return _0x5e10cd[_0x7fc1('0x27')](_0x49a44f)[_0x7fc1('0x28')](function(_0x253ae9){return _0x253ae9;});}return null;};}function removeEntity(_0x3683f4,_0x56c5d6){return function(_0x38b5b5){if(_0x38b5b5){return _0x38b5b5[_0x7fc1('0x29')]()[_0x7fc1('0x28')](function(){_0x3683f4['status'](0xcc)[_0x7fc1('0x1d')]();});}};}function handleEntityNotFound(_0x252b18,_0x5ddc11){return function(_0x4b24d6){if(!_0x4b24d6){_0x252b18[_0x7fc1('0x1b')](0x194);}return _0x4b24d6;};}function handleError(_0x293a2a,_0x1f58ca){_0x1f58ca=_0x1f58ca||0x1f4;return function(_0x2ae7db){logger['error'](_0x2ae7db[_0x7fc1('0x2a')]);if(_0x2ae7db[_0x7fc1('0x2b')]){delete _0x2ae7db[_0x7fc1('0x2b')];}_0x293a2a[_0x7fc1('0x1c')](_0x1f58ca)['send'](_0x2ae7db);};}exports[_0x7fc1('0x2c')]=function(_0x583e60,_0x1f7fce){var _0x22a3c1={},_0x34ec70={},_0x231913={'count':0x0,'rows':[]};var _0x2317f5=_['map'](db[_0x7fc1('0x2d')]['rawAttributes'],function(_0x55b4f1){return{'name':_0x55b4f1[_0x7fc1('0x2e')],'type':_0x55b4f1[_0x7fc1('0x2f')][_0x7fc1('0x30')]};});_0x34ec70[_0x7fc1('0x31')]=_[_0x7fc1('0x32')](_0x2317f5,_0x7fc1('0x2b'));_0x34ec70[_0x7fc1('0x33')]=_[_0x7fc1('0x34')](_0x583e60[_0x7fc1('0x33')]);_0x34ec70[_0x7fc1('0x35')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],_0x34ec70[_0x7fc1('0x33')]);_0x22a3c1[_0x7fc1('0x37')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],qs['fields'](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x22a3c1[_0x7fc1('0x37')]=_0x22a3c1[_0x7fc1('0x37')][_0x7fc1('0x39')]?_0x22a3c1[_0x7fc1('0x37')]:_0x34ec70['model'];if(!_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3a')]('nolimit')){_0x22a3c1[_0x7fc1('0x21')]=qs[_0x7fc1('0x21')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x21')]);_0x22a3c1[_0x7fc1('0x1f')]=qs['offset'](_0x583e60['query'][_0x7fc1('0x1f')]);}_0x22a3c1[_0x7fc1('0x3b')]=qs[_0x7fc1('0x3c')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3c')]);_0x22a3c1[_0x7fc1('0x3d')]=qs[_0x7fc1('0x35')](_[_0x7fc1('0x3e')](_0x583e60['query'],_0x34ec70[_0x7fc1('0x35')]),_0x2317f5);if(_0x583e60[_0x7fc1('0x33')]['filter']){_0x22a3c1[_0x7fc1('0x3d')]=_[_0x7fc1('0x3f')](_0x22a3c1[_0x7fc1('0x3d')],{'$or':_['map'](_0x2317f5,function(_0x57ef4c){if(_0x57ef4c[_0x7fc1('0x2f')]!==_0x7fc1('0x40')){var _0xafc8b0={};_0xafc8b0[_0x57ef4c['name']]={'$like':'%'+_0x583e60['query']['filter']+'%'};return _0xafc8b0;}})});}_0x22a3c1=_[_0x7fc1('0x3f')]({},_0x22a3c1,_0x583e60[_0x7fc1('0x41')]);var _0x32607c={'where':_0x22a3c1[_0x7fc1('0x3d')]};return db['Cdr']['count'](_0x32607c)[_0x7fc1('0x28')](function(_0xf26d98){_0x231913[_0x7fc1('0x22')]=_0xf26d98;if(_0x583e60['query']['includeAll']){_0x22a3c1['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x22a3c1);})[_0x7fc1('0x28')](function(_0x54749f){_0x231913[_0x7fc1('0x42')]=_0x54749f;return _0x231913;})[_0x7fc1('0x28')](respondWithFilteredResult(_0x1f7fce,_0x22a3c1))['catch'](handleError(_0x1f7fce,null));};exports[_0x7fc1('0x43')]=function(_0x16ad03,_0x111d51){var _0x3282dd={'raw':!![],'where':{'id':_0x16ad03[_0x7fc1('0x44')]['id']}},_0x56b853={};_0x56b853['model']=_[_0x7fc1('0x34')](db[_0x7fc1('0x2d')][_0x7fc1('0x45')]);_0x56b853[_0x7fc1('0x33')]=_['keys'](_0x16ad03[_0x7fc1('0x33')]);_0x56b853[_0x7fc1('0x35')]=_['intersection'](_0x56b853[_0x7fc1('0x31')],_0x56b853[_0x7fc1('0x33')]);_0x3282dd['attributes']=_[_0x7fc1('0x36')](_0x56b853[_0x7fc1('0x31')],qs['fields'](_0x16ad03[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x3282dd[_0x7fc1('0x37')]=_0x3282dd['attributes'][_0x7fc1('0x39')]?_0x3282dd[_0x7fc1('0x37')]:_0x56b853[_0x7fc1('0x31')];if(_0x16ad03[_0x7fc1('0x33')]['includeAll']){_0x3282dd['include']=[{'all':!![]}];}_0x3282dd=_[_0x7fc1('0x3f')]({},_0x3282dd,_0x16ad03[_0x7fc1('0x41')]);return db[_0x7fc1('0x2d')][_0x7fc1('0x46')](_0x3282dd)[_0x7fc1('0x28')](handleEntityNotFound(_0x111d51,null))[_0x7fc1('0x28')](respondWithResult(_0x111d51,null))[_0x7fc1('0x47')](handleError(_0x111d51,null));};exports[_0x7fc1('0x48')]=function(_0x419ea1,_0x4c4606){return db['Cdr']['create'](_0x419ea1[_0x7fc1('0x49')],{})[_0x7fc1('0x28')](respondWithResult(_0x4c4606,0xc9))[_0x7fc1('0x47')](handleError(_0x4c4606,null));};exports[_0x7fc1('0x27')]=function(_0x4bcd63,_0xafd821){if(_0x4bcd63[_0x7fc1('0x49')]['id']){delete _0x4bcd63[_0x7fc1('0x49')]['id'];}return db[_0x7fc1('0x2d')]['find']({'where':{'id':_0x4bcd63[_0x7fc1('0x44')]['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0xafd821,null))[_0x7fc1('0x28')](saveUpdates(_0x4bcd63[_0x7fc1('0x49')],null))[_0x7fc1('0x28')](respondWithResult(_0xafd821,null))[_0x7fc1('0x47')](handleError(_0xafd821,null));};exports[_0x7fc1('0x29')]=function(_0x4d27db,_0x3d5f40){return db['Cdr'][_0x7fc1('0x46')]({'where':{'id':_0x4d27db['params']['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0x3d5f40,null))[_0x7fc1('0x28')](removeEntity(_0x3d5f40,null))['catch'](handleError(_0x3d5f40,null));};exports[_0x7fc1('0x4a')]=function(_0x3b492a,_0x509959){return db[_0x7fc1('0x2d')][_0x7fc1('0x4a')]()[_0x7fc1('0x28')](respondWithResult(_0x509959,null))[_0x7fc1('0x47')](handleError(_0x509959,null));}; \ No newline at end of file +var _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x39d266,_0x52d1cc){var _0x276890=function(_0x5fac60){while(--_0x5fac60){_0x39d266['push'](_0x39d266['shift']());}};_0x276890(++_0x52d1cc);}(_0x5577,0x1b4));var _0x7557=function(_0x5bb85c,_0x2a41da){_0x5bb85c=_0x5bb85c-0x0;var _0x180e0b=_0x5577[_0x5bb85c];return _0x180e0b;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4453bc1..a14c030 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(_0x4f5ca2,_0x4a3f73){var _0x3723e1=function(_0x5b0a7b){while(--_0x5b0a7b){_0x4f5ca2['push'](_0x4f5ca2['shift']());}};_0x3723e1(++_0x4a3f73);}(_0x7a54,0x106));var _0x47a5=function(_0x2b311f,_0x1ca7e3){_0x2b311f=_0x2b311f-0x0;var _0x2ff4db=_0x7a54[_0x2b311f];return _0x2ff4db;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2c3632,_0x190e8a){var _0x1dced1=function(_0xd6cc1a){while(--_0xd6cc1a){_0x2c3632['push'](_0x2c3632['shift']());}};_0x1dced1(++_0x190e8a);}(_0x7a54,0x106));var _0x47a5=function(_0x580f0f,_0x5e8392){_0x580f0f=_0x580f0f-0x0;var _0x19746c=_0x7a54[_0x580f0f];return _0x19746c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 33a021f..208bd9c 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 _0x1eae=['code','message','Cdr,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','request\x20sent','error'];(function(_0x2ddb1d,_0x5673bd){var _0xb678f9=function(_0x43a33d){while(--_0x43a33d){_0x2ddb1d['push'](_0x2ddb1d['shift']());}};_0xb678f9(++_0x5673bd);}(_0x1eae,0x103));var _0xe1ea=function(_0x12121d,_0x215e27){_0x12121d=_0x12121d-0x0;var _0x4c42ae=_0x1eae[_0x12121d];return _0x4c42ae;};'use strict';var _=require(_0xe1ea('0x0'));var util=require(_0xe1ea('0x1'));var moment=require(_0xe1ea('0x2'));var BPromise=require(_0xe1ea('0x3'));var rs=require(_0xe1ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1ea('0x5'))['db'];var utils=require(_0xe1ea('0x6'));var logger=require(_0xe1ea('0x7'))(_0xe1ea('0x8'));var config=require(_0xe1ea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe1ea('0xa')][_0xe1ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3adbba,_0x591f98,_0x10124b){return new BPromise(function(_0x421b00,_0x2ce9c6){return client[_0xe1ea('0xc')](_0x3adbba,_0x10124b)[_0xe1ea('0xd')](function(_0x3db243){logger['info']('Cdr,\x20%s,\x20%s',_0x591f98,'request\x20sent');logger[_0xe1ea('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x591f98,_0xe1ea('0xf'),JSON['stringify'](_0x3db243));if(_0x3db243['error']){if(_0x3db243[_0xe1ea('0x10')][_0xe1ea('0x11')]===0x1f4){logger[_0xe1ea('0x10')]('Cdr,\x20%s,\x20%s',_0x591f98,_0x3db243[_0xe1ea('0x10')][_0xe1ea('0x12')]);return _0x2ce9c6(_0x3db243[_0xe1ea('0x10')][_0xe1ea('0x12')]);}logger[_0xe1ea('0x10')](_0xe1ea('0x13'),_0x591f98,_0x3db243[_0xe1ea('0x10')]['message']);return _0x421b00(_0x3db243[_0xe1ea('0x10')]['message']);}else{logger[_0xe1ea('0x14')](_0xe1ea('0x13'),_0x591f98,_0xe1ea('0xf'));_0x421b00(_0x3db243[_0xe1ea('0x15')][_0xe1ea('0x12')]);}})[_0xe1ea('0x16')](function(_0x28a69b){logger[_0xe1ea('0x10')](_0xe1ea('0x13'),_0x591f98,_0x28a69b);_0x2ce9c6(_0x28a69b);});});} \ No newline at end of file +var _0xc92f=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xc92f,0x15d));var _0xfc92=function(_0x208df7,_0x54a7bd){_0x208df7=_0x208df7-0x0;var _0x140f61=_0xc92f[_0x208df7];return _0x140f61;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require(_0xfc92('0x2'));var BPromise=require(_0xfc92('0x3'));var rs=require(_0xfc92('0x4'));var fs=require('fs');var Redis=require(_0xfc92('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc92('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')][_0xfc92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x303889,_0x5effba,_0xec7aff){return new BPromise(function(_0x596d29,_0x16a99d){return client[_0xfc92('0xa')](_0x303889,_0xec7aff)[_0xfc92('0xb')](function(_0x572236){logger[_0xfc92('0xc')](_0xfc92('0xd'),_0x5effba,_0xfc92('0xe'));logger[_0xfc92('0xf')](_0xfc92('0x10'),_0x5effba,_0xfc92('0xe'),JSON[_0xfc92('0x11')](_0x572236));if(_0x572236[_0xfc92('0x12')]){if(_0x572236['error']['code']===0x1f4){logger['error'](_0xfc92('0xd'),_0x5effba,_0x572236[_0xfc92('0x12')]['message']);return _0x16a99d(_0x572236['error'][_0xfc92('0x13')]);}logger[_0xfc92('0x12')](_0xfc92('0xd'),_0x5effba,_0x572236['error'][_0xfc92('0x13')]);return _0x596d29(_0x572236[_0xfc92('0x12')][_0xfc92('0x13')]);}else{logger['info'](_0xfc92('0xd'),_0x5effba,'request\x20sent');_0x596d29(_0x572236[_0xfc92('0x14')][_0xfc92('0x13')]);}})[_0xfc92('0x15')](function(_0x18335b){logger[_0xfc92('0x12')]('Cdr,\x20%s,\x20%s',_0x5effba,_0x18335b);_0x16a99d(_0x18335b);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a1d93dd..1e8ee8f 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(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2c0f27,_0x43abab){var _0x586e67=function(_0xe460df){while(--_0xe460df){_0x2c0f27['push'](_0x2c0f27['shift']());}};_0x586e67(++_0x43abab);}(_0xb10b,0x12a));var _0xbb10=function(_0x24b8ec,_0x3c8c5b){_0x24b8ec=_0x24b8ec-0x0;var _0x1d1b63=_0xb10b[_0x24b8ec];return _0x1d1b63;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 8e16938..9522fc5 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 _0xdf01=['exports','INTEGER','STRING','noop','TEXT'];(function(_0x25168b,_0x4ea135){var _0x40ef93=function(_0x46b4b3){while(--_0x46b4b3){_0x25168b['push'](_0x25168b['shift']());}};_0x40ef93(++_0x4ea135);}(_0xdf01,0xff));var _0x1df0=function(_0x1b7ec4,_0xacdff8){_0x1b7ec4=_0x1b7ec4-0x0;var _0x4ffa1c=_0xdf01[_0x1b7ec4];return _0x4ffa1c;};'use strict';var Sequelize=require('sequelize');module[_0x1df0('0x0')]={'priority':{'type':Sequelize[_0x1df0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1df0('0x2')],'allowNull':![],'defaultValue':_0x1df0('0x3')},'appdata':{'type':Sequelize[_0x1df0('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1df0('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xac9d=['exports','noop','TEXT','STRING'];(function(_0x480136,_0x49744e){var _0x22e760=function(_0x214fb3){while(--_0x214fb3){_0x480136['push'](_0x480136['shift']());}};_0x22e760(++_0x49744e);}(_0xac9d,0xa0));var _0xdac9=function(_0x2aee7b,_0x181285){_0x2aee7b=_0x2aee7b-0x0;var _0x5a4554=_0xac9d[_0x2aee7b];return _0x5a4554;};'use strict';var Sequelize=require('sequelize');module[_0xdac9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdac9('0x1')},'appdata':{'type':Sequelize[_0xdac9('0x2')]()},'description':{'type':Sequelize[_0xdac9('0x3')]},'interval':{'type':Sequelize[_0xdac9('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 e53ad3e..2b8904b 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 _0x4e61=['then','destroy','end','error','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x48734b,_0x34fc9e){var _0x378ae8=function(_0x1ae5cd){while(--_0x1ae5cd){_0x48734b['push'](_0x48734b['shift']());}};_0x378ae8(++_0x34fc9e);}(_0x4e61,0x8c));var _0x14e6=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x4e61[_0x234ce7];return _0x57c561;};'use strict';var emlformat=require(_0x14e6('0x0'));var rimraf=require(_0x14e6('0x1'));var zipdir=require(_0x14e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e6('0x3'));var BPromise=require(_0x14e6('0x4'));var Mustache=require(_0x14e6('0x5'));var util=require(_0x14e6('0x6'));var path=require(_0x14e6('0x7'));var sox=require(_0x14e6('0x8'));var csv=require(_0x14e6('0x9'));var ejs=require(_0x14e6('0xa'));var fs=require('fs');var fs_extra=require(_0x14e6('0xb'));var _=require(_0x14e6('0xc'));var squel=require(_0x14e6('0xd'));var crypto=require(_0x14e6('0xe'));var jsforce=require(_0x14e6('0xf'));var deskjs=require(_0x14e6('0x10'));var toCsv=require(_0x14e6('0x9'));var querystring=require(_0x14e6('0x11'));var Papa=require(_0x14e6('0x12'));var Redis=require(_0x14e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x14e6('0x14'));var as=require(_0x14e6('0x15'));var hardwareService=require(_0x14e6('0x16'));var logger=require(_0x14e6('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x14e6('0x18'))['db'];function respondWithStatusCode(_0x5de0ea,_0x5a1ced){_0x5a1ced=_0x5a1ced||0xcc;return function(_0x128e45){if(_0x128e45){return _0x5de0ea[_0x14e6('0x19')](_0x5a1ced);}return _0x5de0ea[_0x14e6('0x1a')](_0x5a1ced)['end']();};}function respondWithResult(_0x3ea571,_0x23b860){_0x23b860=_0x23b860||0xc8;return function(_0xc8ead5){if(_0xc8ead5){return _0x3ea571[_0x14e6('0x1a')](_0x23b860)[_0x14e6('0x1b')](_0xc8ead5);}};}function respondWithFilteredResult(_0x5dba20,_0x36738d){return function(_0x353910){if(_0x353910){var _0x753064=typeof _0x36738d[_0x14e6('0x1c')]===_0x14e6('0x1d')&&typeof _0x36738d['limit']===_0x14e6('0x1d');var _0x48160f=_0x353910['count'];var _0x4f40b0=_0x753064?0x0:_0x36738d[_0x14e6('0x1c')];var _0x16b937=_0x753064?_0x353910[_0x14e6('0x1e')]:_0x36738d[_0x14e6('0x1c')]+_0x36738d['limit'];var _0x52693c;if(_0x16b937>=_0x48160f){_0x16b937=_0x48160f;_0x52693c=0xc8;}else{_0x52693c=0xce;}_0x5dba20[_0x14e6('0x1a')](_0x52693c);return _0x5dba20[_0x14e6('0x1f')](_0x14e6('0x20'),_0x4f40b0+'-'+_0x16b937+'/'+_0x48160f)[_0x14e6('0x1b')](_0x353910);}return null;};}function patchUpdates(_0x28f75f){return function(_0x2b8d5c){try{jsonpatch[_0x14e6('0x21')](_0x2b8d5c,_0x28f75f,!![]);}catch(_0x1add5e){return BPromise[_0x14e6('0x22')](_0x1add5e);}return _0x2b8d5c[_0x14e6('0x23')]();};}function saveUpdates(_0x20ea17,_0x4400e0){return function(_0x244bc7){if(_0x244bc7){return _0x244bc7[_0x14e6('0x24')](_0x20ea17)[_0x14e6('0x25')](function(_0x3aedac){return _0x3aedac;});}return null;};}function removeEntity(_0xacdf42,_0x129e50){return function(_0x320c2b){if(_0x320c2b){return _0x320c2b[_0x14e6('0x26')]()[_0x14e6('0x25')](function(){_0xacdf42['status'](0xcc)[_0x14e6('0x27')]();});}};}function handleEntityNotFound(_0x2a3807,_0x354b25){return function(_0x21266a){if(!_0x21266a){_0x2a3807[_0x14e6('0x19')](0x194);}return _0x21266a;};}function handleError(_0xb53f12,_0x477833){_0x477833=_0x477833||0x1f4;return function(_0x529bb7){logger[_0x14e6('0x28')](_0x529bb7['stack']);if(_0x529bb7['name']){delete _0x529bb7['name'];}_0xb53f12[_0x14e6('0x1a')](_0x477833)['send'](_0x529bb7);};}exports[_0x14e6('0x29')]=function(_0x1aef5d,_0x2b7336){var _0x5c6a39={'raw':!![],'where':{'id':_0x1aef5d[_0x14e6('0x2a')]['id']}},_0x3395b1={};_0x3395b1[_0x14e6('0x2b')]=_['keys'](db[_0x14e6('0x2c')][_0x14e6('0x2d')]);_0x3395b1[_0x14e6('0x2e')]=_[_0x14e6('0x2f')](_0x1aef5d['query']);_0x3395b1[_0x14e6('0x30')]=_['intersection'](_0x3395b1[_0x14e6('0x2b')],_0x3395b1[_0x14e6('0x2e')]);_0x5c6a39['attributes']=_[_0x14e6('0x31')](_0x3395b1[_0x14e6('0x2b')],qs[_0x14e6('0x32')](_0x1aef5d[_0x14e6('0x2e')]['fields']));_0x5c6a39[_0x14e6('0x33')]=_0x5c6a39[_0x14e6('0x33')][_0x14e6('0x34')]?_0x5c6a39[_0x14e6('0x33')]:_0x3395b1[_0x14e6('0x2b')];if(_0x1aef5d[_0x14e6('0x2e')][_0x14e6('0x35')]){_0x5c6a39['include']=[{'all':!![]}];}_0x5c6a39=_[_0x14e6('0x36')]({},_0x5c6a39,_0x1aef5d[_0x14e6('0x37')]);return db[_0x14e6('0x2c')][_0x14e6('0x38')](_0x5c6a39)['then'](handleEntityNotFound(_0x2b7336,null))[_0x14e6('0x25')](respondWithResult(_0x2b7336,null))[_0x14e6('0x39')](handleError(_0x2b7336,null));};exports[_0x14e6('0x24')]=function(_0xe07746,_0x3560cf){if(_0xe07746[_0x14e6('0x3a')]['id']){delete _0xe07746[_0x14e6('0x3a')]['id'];}return db[_0x14e6('0x2c')][_0x14e6('0x38')]({'where':{'id':_0xe07746[_0x14e6('0x2a')]['id']}})[_0x14e6('0x25')](handleEntityNotFound(_0x3560cf,null))[_0x14e6('0x25')](saveUpdates(_0xe07746['body'],null))[_0x14e6('0x25')](respondWithResult(_0x3560cf,null))[_0x14e6('0x39')](handleError(_0x3560cf,null));};exports[_0x14e6('0x26')]=function(_0x122466,_0x2bc334){return db[_0x14e6('0x2c')][_0x14e6('0x38')]({'where':{'id':_0x122466[_0x14e6('0x2a')]['id']}})[_0x14e6('0x25')](handleEntityNotFound(_0x2bc334,null))[_0x14e6('0x25')](removeEntity(_0x2bc334,null))[_0x14e6('0x39')](handleError(_0x2bc334,null));}; \ No newline at end of file +var _0x56dc=['send','params','model','keys','rawAttributes','filters','query','attributes','fields','includeAll','include','options','ChatApplication','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','save','then','destroy','error','stack','name'];(function(_0x322f36,_0xcd7efe){var _0x3dc6d5=function(_0xb03f08){while(--_0xb03f08){_0x322f36['push'](_0x322f36['shift']());}};_0x3dc6d5(++_0xcd7efe);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc56d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc56d('0x1'));var jsonpatch=require(_0xc56d('0x2'));var rp=require(_0xc56d('0x3'));var moment=require(_0xc56d('0x4'));var BPromise=require(_0xc56d('0x5'));var Mustache=require('mustache');var util=require(_0xc56d('0x6'));var path=require(_0xc56d('0x7'));var sox=require(_0xc56d('0x8'));var csv=require(_0xc56d('0x9'));var ejs=require(_0xc56d('0xa'));var fs=require('fs');var fs_extra=require(_0xc56d('0xb'));var _=require('lodash');var squel=require(_0xc56d('0xc'));var crypto=require(_0xc56d('0xd'));var jsforce=require(_0xc56d('0xe'));var deskjs=require(_0xc56d('0xf'));var toCsv=require(_0xc56d('0x9'));var querystring=require(_0xc56d('0x10'));var Papa=require(_0xc56d('0x11'));var Redis=require(_0xc56d('0x12'));var authService=require(_0xc56d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc56d('0x14'));var hardwareService=require(_0xc56d('0x15'));var logger=require(_0xc56d('0x16'))('api');var utils=require(_0xc56d('0x17'));var config=require(_0xc56d('0x18'));var licenseUtil=require(_0xc56d('0x19'));var db=require(_0xc56d('0x1a'))['db'];function respondWithStatusCode(_0x585ca5,_0xf82e05){_0xf82e05=_0xf82e05||0xcc;return function(_0x2f120a){if(_0x2f120a){return _0x585ca5[_0xc56d('0x1b')](_0xf82e05);}return _0x585ca5['status'](_0xf82e05)[_0xc56d('0x1c')]();};}function respondWithResult(_0x3c0bb5,_0xf3e4eb){_0xf3e4eb=_0xf3e4eb||0xc8;return function(_0x13a712){if(_0x13a712){return _0x3c0bb5['status'](_0xf3e4eb)[_0xc56d('0x1d')](_0x13a712);}};}function respondWithFilteredResult(_0x372724,_0x4aedd3){return function(_0x4c5651){if(_0x4c5651){var _0x259967=typeof _0x4aedd3[_0xc56d('0x1e')]===_0xc56d('0x1f')&&typeof _0x4aedd3[_0xc56d('0x20')]==='undefined';var _0x432f28=_0x4c5651['count'];var _0x25df28=_0x259967?0x0:_0x4aedd3[_0xc56d('0x1e')];var _0x523cfd=_0x259967?_0x4c5651[_0xc56d('0x21')]:_0x4aedd3[_0xc56d('0x1e')]+_0x4aedd3[_0xc56d('0x20')];var _0x2bdb45;if(_0x523cfd>=_0x432f28){_0x523cfd=_0x432f28;_0x2bdb45=0xc8;}else{_0x2bdb45=0xce;}_0x372724[_0xc56d('0x22')](_0x2bdb45);return _0x372724['set'](_0xc56d('0x23'),_0x25df28+'-'+_0x523cfd+'/'+_0x432f28)[_0xc56d('0x1d')](_0x4c5651);}return null;};}function patchUpdates(_0x1dcc97){return function(_0x109254){try{jsonpatch['apply'](_0x109254,_0x1dcc97,!![]);}catch(_0x4ad703){return BPromise['reject'](_0x4ad703);}return _0x109254[_0xc56d('0x24')]();};}function saveUpdates(_0x1c9a1c,_0x44a380){return function(_0x52a5f1){if(_0x52a5f1){return _0x52a5f1['update'](_0x1c9a1c)[_0xc56d('0x25')](function(_0x22d927){return _0x22d927;});}return null;};}function removeEntity(_0x5edf2c,_0x446792){return function(_0x41e336){if(_0x41e336){return _0x41e336[_0xc56d('0x26')]()[_0xc56d('0x25')](function(){_0x5edf2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a769c,_0x30eacf){return function(_0x5405a8){if(!_0x5405a8){_0x2a769c[_0xc56d('0x1b')](0x194);}return _0x5405a8;};}function handleError(_0x27747e,_0x20ab1c){_0x20ab1c=_0x20ab1c||0x1f4;return function(_0x4d4b8e){logger[_0xc56d('0x27')](_0x4d4b8e[_0xc56d('0x28')]);if(_0x4d4b8e[_0xc56d('0x29')]){delete _0x4d4b8e[_0xc56d('0x29')];}_0x27747e[_0xc56d('0x22')](_0x20ab1c)[_0xc56d('0x2a')](_0x4d4b8e);};}exports['show']=function(_0x5a50fb,_0x51e7c7){var _0xb1c8ab={'raw':!![],'where':{'id':_0x5a50fb[_0xc56d('0x2b')]['id']}},_0xf81a5d={};_0xf81a5d[_0xc56d('0x2c')]=_[_0xc56d('0x2d')](db['ChatApplication'][_0xc56d('0x2e')]);_0xf81a5d['query']=_['keys'](_0x5a50fb['query']);_0xf81a5d[_0xc56d('0x2f')]=_['intersection'](_0xf81a5d[_0xc56d('0x2c')],_0xf81a5d[_0xc56d('0x30')]);_0xb1c8ab[_0xc56d('0x31')]=_['intersection'](_0xf81a5d[_0xc56d('0x2c')],qs[_0xc56d('0x32')](_0x5a50fb[_0xc56d('0x30')][_0xc56d('0x32')]));_0xb1c8ab['attributes']=_0xb1c8ab['attributes']['length']?_0xb1c8ab[_0xc56d('0x31')]:_0xf81a5d[_0xc56d('0x2c')];if(_0x5a50fb[_0xc56d('0x30')][_0xc56d('0x33')]){_0xb1c8ab[_0xc56d('0x34')]=[{'all':!![]}];}_0xb1c8ab=_['merge']({},_0xb1c8ab,_0x5a50fb[_0xc56d('0x35')]);return db[_0xc56d('0x36')][_0xc56d('0x37')](_0xb1c8ab)[_0xc56d('0x25')](handleEntityNotFound(_0x51e7c7,null))[_0xc56d('0x25')](respondWithResult(_0x51e7c7,null))[_0xc56d('0x38')](handleError(_0x51e7c7,null));};exports[_0xc56d('0x39')]=function(_0x4a855f,_0x1219aa){if(_0x4a855f['body']['id']){delete _0x4a855f[_0xc56d('0x3a')]['id'];}return db[_0xc56d('0x36')]['find']({'where':{'id':_0x4a855f[_0xc56d('0x2b')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x1219aa,null))[_0xc56d('0x25')](saveUpdates(_0x4a855f[_0xc56d('0x3a')],null))[_0xc56d('0x25')](respondWithResult(_0x1219aa,null))[_0xc56d('0x38')](handleError(_0x1219aa,null));};exports[_0xc56d('0x26')]=function(_0x37b4a8,_0x475408){return db[_0xc56d('0x36')][_0xc56d('0x37')]({'where':{'id':_0x37b4a8[_0xc56d('0x2b')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x475408,null))[_0xc56d('0x25')](removeEntity(_0x475408,null))[_0xc56d('0x38')](handleError(_0x475408,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7ebaad4..9978144 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 _0x1fe2=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x1fe2,0x72));var _0x21fe=function(_0x5c118c,_0x5e981a){_0x5c118c=_0x5c118c-0x0;var _0x111ae=_0x1fe2[_0x5c118c];return _0x111ae;};'use strict';var _=require(_0x21fe('0x0'));var util=require(_0x21fe('0x1'));var logger=require(_0x21fe('0x2'))('api');var moment=require(_0x21fe('0x3'));var BPromise=require(_0x21fe('0x4'));var rp=require(_0x21fe('0x5'));var fs=require('fs');var path=require(_0x21fe('0x6'));var rimraf=require(_0x21fe('0x7'));var config=require('../../config/environment');var attributes=require(_0x21fe('0x8'));module[_0x21fe('0x9')]=function(_0x32cb78,_0x12ac92){return _0x32cb78[_0x21fe('0xa')]('ChatApplication',attributes,{'tableName':_0x21fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21fe('0xc'),'collate':_0x21fe('0xd')});}; \ No newline at end of file +var _0xefe7=['lodash','../../config/logger','api','request-promise','path','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e10d1,_0x175845){var _0x5b178e=function(_0x37f575){while(--_0x37f575){_0x3e10d1['push'](_0x3e10d1['shift']());}};_0x5b178e(++_0x175845);}(_0xefe7,0x168));var _0x7efe=function(_0x14fee0,_0xdc7465){_0x14fee0=_0x14fee0-0x0;var _0x21fa12=_0xefe7[_0x14fee0];return _0x21fa12;};'use strict';var _=require(_0x7efe('0x0'));var util=require('util');var logger=require(_0x7efe('0x1'))(_0x7efe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7efe('0x3'));var fs=require('fs');var path=require(_0x7efe('0x4'));var rimraf=require('rimraf');var config=require(_0x7efe('0x5'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x4183a6,_0x43ac91){return _0x4183a6[_0x7efe('0x6')](_0x7efe('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7efe('0x8'),'collate':_0x7efe('0x9')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b4738d0..747e4c7 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 _0xcd9f=['stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x25ff42,_0x1dd28a){var _0x2b9f64=function(_0x417733){while(--_0x417733){_0x25ff42['push'](_0x25ff42['shift']());}};_0x2b9f64(++_0x1dd28a);}(_0xcd9f,0x1d0));var _0xfcd9=function(_0x513cbb,_0x5bbea5){_0x513cbb=_0x513cbb-0x0;var _0x481b9e=_0xcd9f[_0x513cbb];return _0x481b9e;};'use strict';var _=require(_0xfcd9('0x0'));var util=require('util');var moment=require(_0xfcd9('0x1'));var BPromise=require(_0xfcd9('0x2'));var rs=require(_0xfcd9('0x3'));var fs=require('fs');var Redis=require(_0xfcd9('0x4'));var db=require(_0xfcd9('0x5'))['db'];var utils=require(_0xfcd9('0x6'));var logger=require(_0xfcd9('0x7'))(_0xfcd9('0x8'));var config=require(_0xfcd9('0x9'));var jayson=require(_0xfcd9('0xa'));var client=jayson[_0xfcd9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3be72e,_0x3ddfc2,_0x4fcfb8){return new BPromise(function(_0x4d3cdf,_0x1ceb1a){return client[_0xfcd9('0xc')](_0x3be72e,_0x4fcfb8)[_0xfcd9('0xd')](function(_0x288b33){logger[_0xfcd9('0xe')](_0xfcd9('0xf'),_0x3ddfc2,'request\x20sent');logger[_0xfcd9('0x10')](_0xfcd9('0x11'),_0x3ddfc2,_0xfcd9('0x12'),JSON[_0xfcd9('0x13')](_0x288b33));if(_0x288b33[_0xfcd9('0x14')]){if(_0x288b33[_0xfcd9('0x14')]['code']===0x1f4){logger[_0xfcd9('0x14')](_0xfcd9('0xf'),_0x3ddfc2,_0x288b33[_0xfcd9('0x14')]['message']);return _0x1ceb1a(_0x288b33[_0xfcd9('0x14')][_0xfcd9('0x15')]);}logger[_0xfcd9('0x14')](_0xfcd9('0xf'),_0x3ddfc2,_0x288b33[_0xfcd9('0x14')]['message']);return _0x4d3cdf(_0x288b33['error'][_0xfcd9('0x15')]);}else{logger['info'](_0xfcd9('0xf'),_0x3ddfc2,_0xfcd9('0x12'));_0x4d3cdf(_0x288b33['result'][_0xfcd9('0x15')]);}})[_0xfcd9('0x16')](function(_0x5b6d9b){logger[_0xfcd9('0x14')]('ChatApplication,\x20%s,\x20%s',_0x3ddfc2,_0x5b6d9b);_0x1ceb1a(_0x5b6d9b);});});} \ No newline at end of file +var _0x4d68=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','util','moment','bluebird'];(function(_0x2d44c3,_0x4ce66a){var _0x54cf65=function(_0x110af3){while(--_0x110af3){_0x2d44c3['push'](_0x2d44c3['shift']());}};_0x54cf65(++_0x4ce66a);}(_0x4d68,0x189));var _0x84d6=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4d68[_0x401676];return _0x4f13fe;};'use strict';var _=require('lodash');var util=require(_0x84d6('0x0'));var moment=require(_0x84d6('0x1'));var BPromise=require(_0x84d6('0x2'));var rs=require(_0x84d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84d6('0x4'))['db'];var utils=require(_0x84d6('0x5'));var logger=require(_0x84d6('0x6'))(_0x84d6('0x7'));var config=require(_0x84d6('0x8'));var jayson=require(_0x84d6('0x9'));var client=jayson[_0x84d6('0xa')][_0x84d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40b82d,_0xde7de6,_0x28fec1){return new BPromise(function(_0x11174b,_0x292340){return client['request'](_0x40b82d,_0x28fec1)[_0x84d6('0xc')](function(_0x1cae6c){logger[_0x84d6('0xd')]('ChatApplication,\x20%s,\x20%s',_0xde7de6,_0x84d6('0xe'));logger[_0x84d6('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0xde7de6,'request\x20sent',JSON[_0x84d6('0x10')](_0x1cae6c));if(_0x1cae6c['error']){if(_0x1cae6c[_0x84d6('0x11')][_0x84d6('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0xde7de6,_0x1cae6c[_0x84d6('0x11')]['message']);return _0x292340(_0x1cae6c[_0x84d6('0x11')]['message']);}logger[_0x84d6('0x11')](_0x84d6('0x13'),_0xde7de6,_0x1cae6c[_0x84d6('0x11')]['message']);return _0x11174b(_0x1cae6c[_0x84d6('0x11')][_0x84d6('0x14')]);}else{logger[_0x84d6('0xd')](_0x84d6('0x13'),_0xde7de6,_0x84d6('0xe'));_0x11174b(_0x1cae6c[_0x84d6('0x15')][_0x84d6('0x14')]);}})['catch'](function(_0x260bbf){logger[_0x84d6('0x11')](_0x84d6('0x13'),_0xde7de6,_0x260bbf);_0x292340(_0x260bbf);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 46c6ccd..98b4bb9 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 _0xa275=['isAuthenticated','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x175223,_0x757480){var _0x204e96=function(_0x5067dc){while(--_0x5067dc){_0x175223['push'](_0x175223['shift']());}};_0x204e96(++_0x757480);}(_0xa275,0x122));var _0x5a27=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa275[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x5a27('0x0'));var path=require('path');var timeout=require(_0x5a27('0x1'));var express=require(_0x5a27('0x2'));var router=express['Router']();var fs_extra=require(_0x5a27('0x3'));var auth=require(_0x5a27('0x4'));var interaction=require(_0x5a27('0x5'));var config=require(_0x5a27('0x6'));var controller=require('./chatApplication.controller');router[_0x5a27('0x7')](_0x5a27('0x8'),auth[_0x5a27('0x9')](),controller['show']);router['put'](_0x5a27('0x8'),auth[_0x5a27('0x9')](),controller[_0x5a27('0xa')]);router[_0x5a27('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5a27('0xc')]);module['exports']=router; \ No newline at end of file +var _0x5092=['show','put','update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x54cbf6,_0x1f9806){var _0x361032=function(_0x503bec){while(--_0x503bec){_0x54cbf6['push'](_0x54cbf6['shift']());}};_0x361032(++_0x1f9806);}(_0x5092,0x125));var _0x2509=function(_0x47319f,_0x27849a){_0x47319f=_0x47319f-0x0;var _0x5d8a7a=_0x5092[_0x47319f];return _0x5d8a7a;};'use strict';var multer=require('multer');var util=require(_0x2509('0x0'));var path=require('path');var timeout=require(_0x2509('0x1'));var express=require('express');var router=express[_0x2509('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2509('0x3'));var config=require(_0x2509('0x4'));var controller=require('./chatApplication.controller');router['get'](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0x7')]);router[_0x2509('0x8')](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0x9')]);router[_0x2509('0xa')](_0x2509('0x5'),auth[_0x2509('0x6')](),controller[_0x2509('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bf8d92e..58bcafe 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 _0x2913=['STRING','BOOLEAN','exports'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x2913,0x9b));var _0x3291=function(_0x2e0691,_0x5897de){_0x2e0691=_0x2e0691-0x0;var _0x25cc01=_0x2913[_0x2e0691];return _0x25cc01;};'use strict';var Sequelize=require('sequelize');module[_0x3291('0x0')]={'name':{'type':Sequelize[_0x3291('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3291('0x1')]},'write':{'type':Sequelize[_0x3291('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x261a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x261a,0x1e6));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa261('0x0'));module[_0xa261('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa261('0x2')]},'write':{'type':Sequelize[_0xa261('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index d0dae4e..79fdaec 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 _0x778c=['Content-Range','apply','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','ChatGroup','include','catch','params','find','create','update','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','request-promise','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x51b792,_0x188ecc){var _0x482357=function(_0x17a099){while(--_0x17a099){_0x51b792['push'](_0x51b792['shift']());}};_0x482357(++_0x188ecc);}(_0x778c,0x95));var _0xc778=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x778c[_0x35d775];return _0x59384d;};'use strict';var emlformat=require(_0xc778('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc778('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc778('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc778('0x3'));var sox=require(_0xc778('0x4'));var csv=require(_0xc778('0x5'));var ejs=require(_0xc778('0x6'));var fs=require('fs');var fs_extra=require(_0xc778('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc778('0x8'));var deskjs=require(_0xc778('0x9'));var toCsv=require(_0xc778('0x5'));var querystring=require(_0xc778('0xa'));var Papa=require('papaparse');var Redis=require(_0xc778('0xb'));var authService=require(_0xc778('0xc'));var qs=require(_0xc778('0xd'));var as=require(_0xc778('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc778('0xf'))('api');var utils=require(_0xc778('0x10'));var config=require(_0xc778('0x11'));var licenseUtil=require(_0xc778('0x12'));var db=require(_0xc778('0x13'))['db'];config[_0xc778('0x14')]=_[_0xc778('0x15')](config[_0xc778('0x14')],{'host':_0xc778('0x16'),'port':0x18eb});var socket=require(_0xc778('0x17'))(new Redis(config['redis']));require(_0xc778('0x18'))[_0xc778('0x19')](socket);function respondWithStatusCode(_0x596d01,_0x115228){_0x115228=_0x115228||0xcc;return function(_0x4d05c1){if(_0x4d05c1){return _0x596d01[_0xc778('0x1a')](_0x115228);}return _0x596d01[_0xc778('0x1b')](_0x115228)[_0xc778('0x1c')]();};}function respondWithResult(_0x16718c,_0x27b5b1){_0x27b5b1=_0x27b5b1||0xc8;return function(_0xd82444){if(_0xd82444){return _0x16718c[_0xc778('0x1b')](_0x27b5b1)[_0xc778('0x1d')](_0xd82444);}};}function respondWithFilteredResult(_0x521a2a,_0x1b2151){return function(_0x37c1b1){if(_0x37c1b1){var _0x35c030=typeof _0x1b2151['offset']===_0xc778('0x1e')&&typeof _0x1b2151[_0xc778('0x1f')]===_0xc778('0x1e');var _0x5af252=_0x37c1b1[_0xc778('0x20')];var _0x1db8ce=_0x35c030?0x0:_0x1b2151[_0xc778('0x21')];var _0x4d78bb=_0x35c030?_0x37c1b1[_0xc778('0x20')]:_0x1b2151[_0xc778('0x21')]+_0x1b2151[_0xc778('0x1f')];var _0x570643;if(_0x4d78bb>=_0x5af252){_0x4d78bb=_0x5af252;_0x570643=0xc8;}else{_0x570643=0xce;}_0x521a2a[_0xc778('0x1b')](_0x570643);return _0x521a2a[_0xc778('0x22')](_0xc778('0x23'),_0x1db8ce+'-'+_0x4d78bb+'/'+_0x5af252)[_0xc778('0x1d')](_0x37c1b1);}return null;};}function patchUpdates(_0x14a74a){return function(_0x2ea401){try{jsonpatch[_0xc778('0x24')](_0x2ea401,_0x14a74a,!![]);}catch(_0x392819){return BPromise['reject'](_0x392819);}return _0x2ea401[_0xc778('0x25')]();};}function saveUpdates(_0x130af9,_0x5191bd){return function(_0x24759b){if(_0x24759b){return _0x24759b['update'](_0x130af9)['then'](function(_0x34b80b){return _0x34b80b;});}return null;};}function removeEntity(_0x586852,_0x3abd37){return function(_0x2b7df0){if(_0x2b7df0){return _0x2b7df0[_0xc778('0x26')]()[_0xc778('0x27')](function(){_0x586852['status'](0xcc)[_0xc778('0x1c')]();});}};}function handleEntityNotFound(_0x7a53dd,_0x2ccd76){return function(_0x3f11ef){if(!_0x3f11ef){_0x7a53dd[_0xc778('0x1a')](0x194);}return _0x3f11ef;};}function handleError(_0x5cf6ea,_0x579987){_0x579987=_0x579987||0x1f4;return function(_0x36650f){logger[_0xc778('0x28')](_0x36650f[_0xc778('0x29')]);if(_0x36650f['name']){delete _0x36650f[_0xc778('0x2a')];}_0x5cf6ea[_0xc778('0x1b')](_0x579987)['send'](_0x36650f);};}exports[_0xc778('0x2b')]=function(_0x234daa,_0x48e037){var _0x4c2156={},_0x5cb0c0={},_0x2e7bd8={'count':0x0,'rows':[]};var _0x16ce8f=_[_0xc778('0x2c')](db['ChatGroup'][_0xc778('0x2d')],function(_0x4dff8a){return{'name':_0x4dff8a[_0xc778('0x2e')],'type':_0x4dff8a['type']['key']};});_0x5cb0c0[_0xc778('0x2f')]=_['map'](_0x16ce8f,'name');_0x5cb0c0[_0xc778('0x30')]=_[_0xc778('0x31')](_0x234daa[_0xc778('0x30')]);_0x5cb0c0[_0xc778('0x32')]=_[_0xc778('0x33')](_0x5cb0c0[_0xc778('0x2f')],_0x5cb0c0[_0xc778('0x30')]);_0x4c2156[_0xc778('0x34')]=_[_0xc778('0x33')](_0x5cb0c0[_0xc778('0x2f')],qs['fields'](_0x234daa[_0xc778('0x30')][_0xc778('0x35')]));_0x4c2156[_0xc778('0x34')]=_0x4c2156[_0xc778('0x34')][_0xc778('0x36')]?_0x4c2156[_0xc778('0x34')]:_0x5cb0c0[_0xc778('0x2f')];if(!_0x234daa['query'][_0xc778('0x37')](_0xc778('0x38'))){_0x4c2156[_0xc778('0x1f')]=qs[_0xc778('0x1f')](_0x234daa[_0xc778('0x30')]['limit']);_0x4c2156[_0xc778('0x21')]=qs['offset'](_0x234daa[_0xc778('0x30')][_0xc778('0x21')]);}_0x4c2156[_0xc778('0x39')]=qs[_0xc778('0x3a')](_0x234daa['query'][_0xc778('0x3a')]);_0x4c2156[_0xc778('0x3b')]=qs[_0xc778('0x32')](_[_0xc778('0x3c')](_0x234daa[_0xc778('0x30')],_0x5cb0c0[_0xc778('0x32')]),_0x16ce8f);if(_0x234daa[_0xc778('0x30')]['filter']){_0x4c2156['where']=_['merge'](_0x4c2156[_0xc778('0x3b')],{'$or':_['map'](_0x16ce8f,function(_0x4ff964){if(_0x4ff964[_0xc778('0x3d')]!==_0xc778('0x3e')){var _0x51d90d={};_0x51d90d[_0x4ff964[_0xc778('0x2a')]]={'$like':'%'+_0x234daa[_0xc778('0x30')][_0xc778('0x3f')]+'%'};return _0x51d90d;}})});}_0x4c2156=_[_0xc778('0x40')]({},_0x4c2156,_0x234daa[_0xc778('0x41')]);var _0x15e982={'where':_0x4c2156[_0xc778('0x3b')]};return db[_0xc778('0x42')]['count'](_0x15e982)[_0xc778('0x27')](function(_0x38ec3f){_0x2e7bd8[_0xc778('0x20')]=_0x38ec3f;if(_0x234daa[_0xc778('0x30')]['includeAll']){_0x4c2156[_0xc778('0x43')]=[{'all':!![]}];}return db[_0xc778('0x42')]['findAll'](_0x4c2156);})[_0xc778('0x27')](function(_0x2b811f){_0x2e7bd8['rows']=_0x2b811f;return _0x2e7bd8;})[_0xc778('0x27')](respondWithFilteredResult(_0x48e037,_0x4c2156))[_0xc778('0x44')](handleError(_0x48e037,null));};exports['show']=function(_0x3d8825,_0x4d65f8){var _0x586e57={'raw':!![],'where':{'id':_0x3d8825[_0xc778('0x45')]['id']}},_0x3005c4={};_0x3005c4[_0xc778('0x2f')]=_[_0xc778('0x31')](db[_0xc778('0x42')][_0xc778('0x2d')]);_0x3005c4[_0xc778('0x30')]=_['keys'](_0x3d8825['query']);_0x3005c4[_0xc778('0x32')]=_['intersection'](_0x3005c4[_0xc778('0x2f')],_0x3005c4[_0xc778('0x30')]);_0x586e57[_0xc778('0x34')]=_[_0xc778('0x33')](_0x3005c4[_0xc778('0x2f')],qs[_0xc778('0x35')](_0x3d8825[_0xc778('0x30')][_0xc778('0x35')]));_0x586e57[_0xc778('0x34')]=_0x586e57[_0xc778('0x34')][_0xc778('0x36')]?_0x586e57['attributes']:_0x3005c4[_0xc778('0x2f')];if(_0x3d8825['query']['includeAll']){_0x586e57[_0xc778('0x43')]=[{'all':!![]}];}_0x586e57=_[_0xc778('0x40')]({},_0x586e57,_0x3d8825['options']);return db[_0xc778('0x42')][_0xc778('0x46')](_0x586e57)['then'](handleEntityNotFound(_0x4d65f8,null))[_0xc778('0x27')](respondWithResult(_0x4d65f8,null))[_0xc778('0x44')](handleError(_0x4d65f8,null));};exports[_0xc778('0x47')]=function(_0x24f0b3,_0x5841f8){return db[_0xc778('0x42')][_0xc778('0x47')](_0x24f0b3['body'],{})[_0xc778('0x27')](respondWithResult(_0x5841f8,0xc9))[_0xc778('0x44')](handleError(_0x5841f8,null));};exports[_0xc778('0x48')]=function(_0x521d25,_0x211ca2){if(_0x521d25[_0xc778('0x49')]['id']){delete _0x521d25[_0xc778('0x49')]['id'];}return db[_0xc778('0x42')][_0xc778('0x46')]({'where':{'id':_0x521d25[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x211ca2,null))[_0xc778('0x27')](saveUpdates(_0x521d25['body'],null))[_0xc778('0x27')](respondWithResult(_0x211ca2,null))['catch'](handleError(_0x211ca2,null));};exports['destroy']=function(_0x2a270d,_0x3d4885){return db['ChatGroup'][_0xc778('0x46')]({'where':{'id':_0x2a270d[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x3d4885,null))[_0xc778('0x27')](removeEntity(_0x3d4885,null))[_0xc778('0x44')](handleError(_0x3d4885,null));};exports[_0xc778('0x4a')]=function(_0x5e5f0,_0x28ebcb){return db[_0xc778('0x42')][_0xc778('0x4a')]()[_0xc778('0x27')](respondWithResult(_0x28ebcb,null))[_0xc778('0x44')](handleError(_0x28ebcb,null));};exports[_0xc778('0x4b')]=function(_0x4a651f,_0x1f21e1,_0x3c89f4){return db[_0xc778('0x4c')][_0xc778('0x20')]({'where':{'ChatGroupId':_0x4a651f[_0xc778('0x45')]['id'],'ToId':_0x4a651f[_0xc778('0x4d')]['id'],'read':![]}})[_0xc778('0x27')](function(_0x2ab4cb){return{'id':_[_0xc778('0x4e')](_0x4a651f[_0xc778('0x45')]['id']),'count':_0x2ab4cb};})[_0xc778('0x27')](respondWithResult(_0x1f21e1,null))[_0xc778('0x44')](handleError(_0x1f21e1,null));};exports[_0xc778('0x4f')]=function(_0x2deb0f,_0x1872f4,_0x21aa8b){return db[_0xc778('0x42')][_0xc778('0x46')]({'where':{'id':_0x2deb0f[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x1872f4,null))[_0xc778('0x27')](function(_0x1741b8){if(_0x1741b8){return _0x1741b8['addMembers'](_0x2deb0f['body'][_0xc778('0x50')],_[_0xc778('0x51')](_0x2deb0f[_0xc778('0x49')],['ids','id'])||{});}})[_0xc778('0x27')](respondWithResult(_0x1872f4,null))['catch'](handleError(_0x1872f4,null));};exports[_0xc778('0x52')]=function(_0x3dbd83,_0xc020b8,_0x173885){var _0x21ca0d={};var _0x128122={};var _0xa608b0;var _0x5cc9a4;return db[_0xc778('0x42')][_0xc778('0x53')]({'where':{'id':_0x3dbd83[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0xc020b8,null))[_0xc778('0x27')](function(_0x292c29){if(_0x292c29){_0xa608b0=_0x292c29;_0x128122[_0xc778('0x2f')]=_[_0xc778('0x31')](db[_0xc778('0x54')][_0xc778('0x2d')]);_0x128122[_0xc778('0x30')]=_[_0xc778('0x31')](_0x3dbd83['query']);_0x128122[_0xc778('0x32')]=_[_0xc778('0x33')](_0x128122['model'],_0x128122[_0xc778('0x30')]);_0x21ca0d[_0xc778('0x34')]=_[_0xc778('0x33')](_0x128122[_0xc778('0x2f')],qs[_0xc778('0x35')](_0x3dbd83[_0xc778('0x30')][_0xc778('0x35')]));_0x21ca0d[_0xc778('0x34')]=_0x21ca0d[_0xc778('0x34')]['length']?_0x21ca0d['attributes']:_0x128122[_0xc778('0x2f')];_0x21ca0d[_0xc778('0x39')]=qs[_0xc778('0x3a')](_0x3dbd83[_0xc778('0x30')][_0xc778('0x3a')]);_0x21ca0d[_0xc778('0x3b')]=qs[_0xc778('0x32')](_['pick'](_0x3dbd83[_0xc778('0x30')],_0x128122[_0xc778('0x32')]));if(_0x3dbd83[_0xc778('0x30')][_0xc778('0x3f')]){_0x21ca0d['where']=_[_0xc778('0x40')](_0x21ca0d['where'],{'$or':_[_0xc778('0x2c')](_0x21ca0d[_0xc778('0x34')],function(_0x139bdd){var _0x3ea87f={};_0x3ea87f[_0x139bdd]={'$like':'%'+_0x3dbd83[_0xc778('0x30')]['filter']+'%'};return _0x3ea87f;})});}_0x21ca0d=_[_0xc778('0x40')]({},_0x21ca0d,_0x3dbd83[_0xc778('0x41')]);return _0xa608b0[_0xc778('0x52')](_0x21ca0d);}})[_0xc778('0x27')](function(_0x4ebce0){if(_0x4ebce0){_0x5cc9a4=_0x4ebce0['length'];if(!_0x3dbd83[_0xc778('0x30')][_0xc778('0x37')]('nolimit')){_0x21ca0d[_0xc778('0x1f')]=qs[_0xc778('0x1f')](_0x3dbd83[_0xc778('0x30')][_0xc778('0x1f')]);_0x21ca0d[_0xc778('0x21')]=qs[_0xc778('0x21')](_0x3dbd83[_0xc778('0x30')][_0xc778('0x21')]);}return _0xa608b0[_0xc778('0x52')](_0x21ca0d);}})['then'](function(_0x59f8c0){if(_0x59f8c0){return _0x59f8c0?{'count':_0x5cc9a4,'rows':_0x59f8c0}:null;}})[_0xc778('0x27')](respondWithResult(_0xc020b8,null))[_0xc778('0x44')](handleError(_0xc020b8,null));};exports[_0xc778('0x55')]=function(_0x4638c7,_0x4206c0,_0x5d641d){return db['ChatGroup']['find']({'where':{'id':_0x4638c7[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x4206c0,null))[_0xc778('0x27')](function(_0x1d7134){if(_0x1d7134){return _0x1d7134[_0xc778('0x55')](_0x4638c7['query'][_0xc778('0x50')]);}})[_0xc778('0x27')](respondWithStatusCode(_0x4206c0,null))[_0xc778('0x44')](handleError(_0x4206c0,null));};exports[_0xc778('0x56')]=function(_0x34aa37,_0x44a6d4,_0x409db2){if(_0x34aa37[_0xc778('0x49')]['id']){delete _0x34aa37['body']['id'];}return db['ChatGroup'][_0xc778('0x46')]({'where':{'id':_0x34aa37[_0xc778('0x45')]['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x44a6d4,null))[_0xc778('0x27')](function(_0xd0105e){if(_0xd0105e){_0x34aa37['body'][_0xc778('0x57')]=_0xd0105e['id'];return db[_0xc778('0x4c')][_0xc778('0x47')](_0x34aa37['body']);}})['then'](respondWithResult(_0x44a6d4,null))['catch'](handleError(_0x44a6d4,null));};exports['getMessages']=function(_0x2f7b9b,_0x21d0cb,_0x5d8337){var _0x8e1305={};var _0x1bd081={};var _0x57237c;var _0x498c0b;return db['ChatGroup'][_0xc778('0x53')]({'where':{'id':_0x2f7b9b['params']['id']}})[_0xc778('0x27')](handleEntityNotFound(_0x21d0cb,null))[_0xc778('0x27')](function(_0x4b0112){if(_0x4b0112){_0x57237c=_0x4b0112;_0x1bd081[_0xc778('0x2f')]=_['keys'](db[_0xc778('0x4c')][_0xc778('0x2d')]);_0x1bd081[_0xc778('0x30')]=_[_0xc778('0x31')](_0x2f7b9b[_0xc778('0x30')]);_0x1bd081[_0xc778('0x32')]=_[_0xc778('0x33')](_0x1bd081[_0xc778('0x2f')],_0x1bd081[_0xc778('0x30')]);_0x8e1305[_0xc778('0x34')]=_['intersection'](_0x1bd081[_0xc778('0x2f')],qs[_0xc778('0x35')](_0x2f7b9b[_0xc778('0x30')][_0xc778('0x35')]));_0x8e1305[_0xc778('0x34')]=_0x8e1305[_0xc778('0x34')][_0xc778('0x36')]?_0x8e1305[_0xc778('0x34')]:_0x1bd081[_0xc778('0x2f')];_0x8e1305[_0xc778('0x39')]=qs[_0xc778('0x3a')](_0x2f7b9b[_0xc778('0x30')][_0xc778('0x3a')]);_0x8e1305[_0xc778('0x3b')]=qs[_0xc778('0x32')](_[_0xc778('0x3c')](_0x2f7b9b[_0xc778('0x30')],_0x1bd081[_0xc778('0x32')]));if(_0x2f7b9b[_0xc778('0x30')]['filter']){_0x8e1305['where']=_['merge'](_0x8e1305[_0xc778('0x3b')],{'$or':_[_0xc778('0x2c')](_0x8e1305[_0xc778('0x34')],function(_0x3d7de2){var _0x48ef3e={};_0x48ef3e[_0x3d7de2]={'$like':'%'+_0x2f7b9b[_0xc778('0x30')][_0xc778('0x3f')]+'%'};return _0x48ef3e;})});}if(_0x2f7b9b[_0xc778('0x30')]['$gte']){var _0x244bff=_0x2f7b9b[_0xc778('0x30')][_0xc778('0x58')]['split'](',');var _0x1483dc={};_0x1483dc[_0x244bff[0x0]]={'$gte':moment(_0x244bff[0x1])[_0xc778('0x59')](_0xc778('0x5a'))};_0x8e1305['where']=_[_0xc778('0x40')](_0x8e1305[_0xc778('0x3b')],_0x1483dc);}_0x8e1305=_[_0xc778('0x40')]({},_0x8e1305,_0x2f7b9b[_0xc778('0x41')]);return _0x57237c[_0xc778('0x5b')](_0x8e1305);}})[_0xc778('0x27')](function(_0x40408e){if(_0x40408e){_0x498c0b=_0x40408e['length'];if(!_0x2f7b9b['query'][_0xc778('0x37')](_0xc778('0x38'))){_0x8e1305[_0xc778('0x1f')]=qs[_0xc778('0x1f')](_0x2f7b9b[_0xc778('0x30')]['limit']);_0x8e1305[_0xc778('0x21')]=qs[_0xc778('0x21')](_0x2f7b9b[_0xc778('0x30')][_0xc778('0x21')]);}return _0x57237c['getMessages'](_0x8e1305);}})[_0xc778('0x27')](function(_0x2a5902){if(_0x2a5902){return _0x2a5902?{'count':_0x498c0b,'rows':_0x2a5902}:null;}})[_0xc778('0x27')](respondWithResult(_0x21d0cb,null))[_0xc778('0x44')](handleError(_0x21d0cb,null));}; \ No newline at end of file +var _0x062d=['name','map','ChatGroup','rawAttributes','fieldName','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','format','eml-format','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack'];(function(_0x57d65d,_0x4c1202){var _0x5a6bd3=function(_0x22dd2c){while(--_0x22dd2c){_0x57d65d['push'](_0x57d65d['shift']());}};_0x5a6bd3(++_0x4c1202);}(_0x062d,0x1a1));var _0xd062=function(_0x25996d,_0x5b282e){_0x25996d=_0x25996d-0x0;var _0x12d802=_0x062d[_0x25996d];return _0x12d802;};'use strict';var emlformat=require(_0xd062('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd062('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd062('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd062('0x3'));var path=require(_0xd062('0x4'));var sox=require(_0xd062('0x5'));var csv=require('to-csv');var ejs=require(_0xd062('0x6'));var fs=require('fs');var fs_extra=require(_0xd062('0x7'));var _=require(_0xd062('0x8'));var squel=require(_0xd062('0x9'));var crypto=require(_0xd062('0xa'));var jsforce=require(_0xd062('0xb'));var deskjs=require(_0xd062('0xc'));var toCsv=require(_0xd062('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd062('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd062('0xf'));var hardwareService=require(_0xd062('0x10'));var logger=require('../../config/logger')(_0xd062('0x11'));var utils=require(_0xd062('0x12'));var config=require(_0xd062('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd062('0x14'))['db'];config[_0xd062('0x15')]=_['defaults'](config[_0xd062('0x15')],{'host':_0xd062('0x16'),'port':0x18eb});var socket=require(_0xd062('0x17'))(new Redis(config[_0xd062('0x15')]));require(_0xd062('0x18'))[_0xd062('0x19')](socket);function respondWithStatusCode(_0x18fc52,_0xa185c9){_0xa185c9=_0xa185c9||0xcc;return function(_0x5a7889){if(_0x5a7889){return _0x18fc52[_0xd062('0x1a')](_0xa185c9);}return _0x18fc52[_0xd062('0x1b')](_0xa185c9)[_0xd062('0x1c')]();};}function respondWithResult(_0x1f3471,_0x5cfb93){_0x5cfb93=_0x5cfb93||0xc8;return function(_0xeef60){if(_0xeef60){return _0x1f3471[_0xd062('0x1b')](_0x5cfb93)[_0xd062('0x1d')](_0xeef60);}};}function respondWithFilteredResult(_0x377685,_0x4d8470){return function(_0x38b6b6){if(_0x38b6b6){var _0xbe50a4=typeof _0x4d8470[_0xd062('0x1e')]==='undefined'&&typeof _0x4d8470[_0xd062('0x1f')]===_0xd062('0x20');var _0x2eb38e=_0x38b6b6[_0xd062('0x21')];var _0x410014=_0xbe50a4?0x0:_0x4d8470[_0xd062('0x1e')];var _0x4120b3=_0xbe50a4?_0x38b6b6[_0xd062('0x21')]:_0x4d8470['offset']+_0x4d8470[_0xd062('0x1f')];var _0x119694;if(_0x4120b3>=_0x2eb38e){_0x4120b3=_0x2eb38e;_0x119694=0xc8;}else{_0x119694=0xce;}_0x377685[_0xd062('0x1b')](_0x119694);return _0x377685[_0xd062('0x22')](_0xd062('0x23'),_0x410014+'-'+_0x4120b3+'/'+_0x2eb38e)['json'](_0x38b6b6);}return null;};}function patchUpdates(_0x525245){return function(_0x2f4e28){try{jsonpatch['apply'](_0x2f4e28,_0x525245,!![]);}catch(_0x2993bc){return BPromise[_0xd062('0x24')](_0x2993bc);}return _0x2f4e28[_0xd062('0x25')]();};}function saveUpdates(_0x1011b3,_0x50a180){return function(_0x46401e){if(_0x46401e){return _0x46401e[_0xd062('0x26')](_0x1011b3)['then'](function(_0x365f1b){return _0x365f1b;});}return null;};}function removeEntity(_0xa8a46a,_0x5cb1e8){return function(_0x503053){if(_0x503053){return _0x503053[_0xd062('0x27')]()[_0xd062('0x28')](function(){_0xa8a46a[_0xd062('0x1b')](0xcc)[_0xd062('0x1c')]();});}};}function handleEntityNotFound(_0x4415b4,_0xbd92e6){return function(_0x516b4d){if(!_0x516b4d){_0x4415b4['sendStatus'](0x194);}return _0x516b4d;};}function handleError(_0x36e501,_0x49ee66){_0x49ee66=_0x49ee66||0x1f4;return function(_0x1a0b05){logger[_0xd062('0x29')](_0x1a0b05[_0xd062('0x2a')]);if(_0x1a0b05[_0xd062('0x2b')]){delete _0x1a0b05[_0xd062('0x2b')];}_0x36e501[_0xd062('0x1b')](_0x49ee66)['send'](_0x1a0b05);};}exports['index']=function(_0x5209f8,_0x20b2f7){var _0x1cd6a1={},_0x8952b3={},_0x112f6a={'count':0x0,'rows':[]};var _0x259ffb=_[_0xd062('0x2c')](db[_0xd062('0x2d')][_0xd062('0x2e')],function(_0x69d94a){return{'name':_0x69d94a[_0xd062('0x2f')],'type':_0x69d94a['type']['key']};});_0x8952b3['model']=_[_0xd062('0x2c')](_0x259ffb,_0xd062('0x2b'));_0x8952b3['query']=_['keys'](_0x5209f8[_0xd062('0x30')]);_0x8952b3[_0xd062('0x31')]=_['intersection'](_0x8952b3['model'],_0x8952b3[_0xd062('0x30')]);_0x1cd6a1[_0xd062('0x32')]=_[_0xd062('0x33')](_0x8952b3['model'],qs[_0xd062('0x34')](_0x5209f8[_0xd062('0x30')]['fields']));_0x1cd6a1['attributes']=_0x1cd6a1[_0xd062('0x32')][_0xd062('0x35')]?_0x1cd6a1['attributes']:_0x8952b3[_0xd062('0x36')];if(!_0x5209f8[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x1cd6a1[_0xd062('0x1f')]=qs[_0xd062('0x1f')](_0x5209f8[_0xd062('0x30')][_0xd062('0x1f')]);_0x1cd6a1[_0xd062('0x1e')]=qs[_0xd062('0x1e')](_0x5209f8['query'][_0xd062('0x1e')]);}_0x1cd6a1[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x5209f8['query'][_0xd062('0x3a')]);_0x1cd6a1['where']=qs[_0xd062('0x31')](_[_0xd062('0x3b')](_0x5209f8[_0xd062('0x30')],_0x8952b3[_0xd062('0x31')]),_0x259ffb);if(_0x5209f8[_0xd062('0x30')][_0xd062('0x3c')]){_0x1cd6a1['where']=_['merge'](_0x1cd6a1[_0xd062('0x3d')],{'$or':_['map'](_0x259ffb,function(_0x1edd0d){if(_0x1edd0d[_0xd062('0x3e')]!==_0xd062('0x3f')){var _0x3e2297={};_0x3e2297[_0x1edd0d[_0xd062('0x2b')]]={'$like':'%'+_0x5209f8[_0xd062('0x30')][_0xd062('0x3c')]+'%'};return _0x3e2297;}})});}_0x1cd6a1=_[_0xd062('0x40')]({},_0x1cd6a1,_0x5209f8[_0xd062('0x41')]);var _0x4495d2={'where':_0x1cd6a1[_0xd062('0x3d')]};return db['ChatGroup'][_0xd062('0x21')](_0x4495d2)[_0xd062('0x28')](function(_0x275ed1){_0x112f6a['count']=_0x275ed1;if(_0x5209f8[_0xd062('0x30')][_0xd062('0x42')]){_0x1cd6a1[_0xd062('0x43')]=[{'all':!![]}];}return db[_0xd062('0x2d')][_0xd062('0x44')](_0x1cd6a1);})[_0xd062('0x28')](function(_0x3bb30c){_0x112f6a[_0xd062('0x45')]=_0x3bb30c;return _0x112f6a;})[_0xd062('0x28')](respondWithFilteredResult(_0x20b2f7,_0x1cd6a1))[_0xd062('0x46')](handleError(_0x20b2f7,null));};exports[_0xd062('0x47')]=function(_0x287cfc,_0x1ffcea){var _0x215ff7={'raw':!![],'where':{'id':_0x287cfc[_0xd062('0x48')]['id']}},_0x359ee5={};_0x359ee5[_0xd062('0x36')]=_['keys'](db[_0xd062('0x2d')][_0xd062('0x2e')]);_0x359ee5[_0xd062('0x30')]=_[_0xd062('0x49')](_0x287cfc[_0xd062('0x30')]);_0x359ee5[_0xd062('0x31')]=_['intersection'](_0x359ee5[_0xd062('0x36')],_0x359ee5['query']);_0x215ff7['attributes']=_['intersection'](_0x359ee5[_0xd062('0x36')],qs[_0xd062('0x34')](_0x287cfc[_0xd062('0x30')][_0xd062('0x34')]));_0x215ff7[_0xd062('0x32')]=_0x215ff7[_0xd062('0x32')][_0xd062('0x35')]?_0x215ff7[_0xd062('0x32')]:_0x359ee5[_0xd062('0x36')];if(_0x287cfc[_0xd062('0x30')][_0xd062('0x42')]){_0x215ff7[_0xd062('0x43')]=[{'all':!![]}];}_0x215ff7=_[_0xd062('0x40')]({},_0x215ff7,_0x287cfc['options']);return db[_0xd062('0x2d')][_0xd062('0x4a')](_0x215ff7)[_0xd062('0x28')](handleEntityNotFound(_0x1ffcea,null))[_0xd062('0x28')](respondWithResult(_0x1ffcea,null))['catch'](handleError(_0x1ffcea,null));};exports['create']=function(_0x26f238,_0x3dea31){return db[_0xd062('0x2d')][_0xd062('0x4b')](_0x26f238[_0xd062('0x4c')],{})['then'](respondWithResult(_0x3dea31,0xc9))['catch'](handleError(_0x3dea31,null));};exports['update']=function(_0x2f311b,_0x1c0ee1){if(_0x2f311b['body']['id']){delete _0x2f311b[_0xd062('0x4c')]['id'];}return db['ChatGroup'][_0xd062('0x4a')]({'where':{'id':_0x2f311b[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x1c0ee1,null))[_0xd062('0x28')](saveUpdates(_0x2f311b[_0xd062('0x4c')],null))['then'](respondWithResult(_0x1c0ee1,null))[_0xd062('0x46')](handleError(_0x1c0ee1,null));};exports[_0xd062('0x27')]=function(_0x543cc0,_0x21f9c5){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x543cc0[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x21f9c5,null))[_0xd062('0x28')](removeEntity(_0x21f9c5,null))[_0xd062('0x46')](handleError(_0x21f9c5,null));};exports[_0xd062('0x4d')]=function(_0x285387,_0x4a952a){return db[_0xd062('0x2d')][_0xd062('0x4d')]()[_0xd062('0x28')](respondWithResult(_0x4a952a,null))[_0xd062('0x46')](handleError(_0x4a952a,null));};exports[_0xd062('0x4e')]=function(_0x5a32f1,_0x249599,_0x4f8b46){return db[_0xd062('0x4f')]['count']({'where':{'ChatGroupId':_0x5a32f1[_0xd062('0x48')]['id'],'ToId':_0x5a32f1['user']['id'],'read':![]}})['then'](function(_0xe7ac90){return{'id':_[_0xd062('0x50')](_0x5a32f1[_0xd062('0x48')]['id']),'count':_0xe7ac90};})[_0xd062('0x28')](respondWithResult(_0x249599,null))['catch'](handleError(_0x249599,null));};exports[_0xd062('0x51')]=function(_0x14b192,_0x2578af,_0x3ce12d){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x14b192[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x2578af,null))[_0xd062('0x28')](function(_0x21f63e){if(_0x21f63e){return _0x21f63e[_0xd062('0x51')](_0x14b192[_0xd062('0x4c')][_0xd062('0x52')],_[_0xd062('0x53')](_0x14b192[_0xd062('0x4c')],[_0xd062('0x52'),'id'])||{});}})[_0xd062('0x28')](respondWithResult(_0x2578af,null))[_0xd062('0x46')](handleError(_0x2578af,null));};exports['getMembers']=function(_0x5814ee,_0x35f8ea,_0x1d9189){var _0x3145f3={};var _0x1bf302={};var _0x5c6123;var _0x287fcf;return db[_0xd062('0x2d')][_0xd062('0x54')]({'where':{'id':_0x5814ee[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x35f8ea,null))[_0xd062('0x28')](function(_0x1044f3){if(_0x1044f3){_0x5c6123=_0x1044f3;_0x1bf302[_0xd062('0x36')]=_['keys'](db[_0xd062('0x55')]['rawAttributes']);_0x1bf302[_0xd062('0x30')]=_['keys'](_0x5814ee[_0xd062('0x30')]);_0x1bf302[_0xd062('0x31')]=_['intersection'](_0x1bf302['model'],_0x1bf302['query']);_0x3145f3[_0xd062('0x32')]=_[_0xd062('0x33')](_0x1bf302[_0xd062('0x36')],qs['fields'](_0x5814ee[_0xd062('0x30')][_0xd062('0x34')]));_0x3145f3[_0xd062('0x32')]=_0x3145f3[_0xd062('0x32')][_0xd062('0x35')]?_0x3145f3['attributes']:_0x1bf302['model'];_0x3145f3[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x5814ee[_0xd062('0x30')]['sort']);_0x3145f3[_0xd062('0x3d')]=qs['filters'](_[_0xd062('0x3b')](_0x5814ee[_0xd062('0x30')],_0x1bf302[_0xd062('0x31')]));if(_0x5814ee[_0xd062('0x30')][_0xd062('0x3c')]){_0x3145f3['where']=_['merge'](_0x3145f3[_0xd062('0x3d')],{'$or':_['map'](_0x3145f3[_0xd062('0x32')],function(_0x542118){var _0x2c18f2={};_0x2c18f2[_0x542118]={'$like':'%'+_0x5814ee['query'][_0xd062('0x3c')]+'%'};return _0x2c18f2;})});}_0x3145f3=_[_0xd062('0x40')]({},_0x3145f3,_0x5814ee[_0xd062('0x41')]);return _0x5c6123[_0xd062('0x56')](_0x3145f3);}})[_0xd062('0x28')](function(_0x36da07){if(_0x36da07){_0x287fcf=_0x36da07[_0xd062('0x35')];if(!_0x5814ee[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x3145f3[_0xd062('0x1f')]=qs['limit'](_0x5814ee[_0xd062('0x30')]['limit']);_0x3145f3[_0xd062('0x1e')]=qs[_0xd062('0x1e')](_0x5814ee['query'][_0xd062('0x1e')]);}return _0x5c6123['getMembers'](_0x3145f3);}})[_0xd062('0x28')](function(_0x326998){if(_0x326998){return _0x326998?{'count':_0x287fcf,'rows':_0x326998}:null;}})[_0xd062('0x28')](respondWithResult(_0x35f8ea,null))[_0xd062('0x46')](handleError(_0x35f8ea,null));};exports['removeMembers']=function(_0x132706,_0x2cf1b8,_0x141a57){return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x132706[_0xd062('0x48')]['id']}})['then'](handleEntityNotFound(_0x2cf1b8,null))[_0xd062('0x28')](function(_0x325c79){if(_0x325c79){return _0x325c79[_0xd062('0x57')](_0x132706[_0xd062('0x30')]['ids']);}})[_0xd062('0x28')](respondWithStatusCode(_0x2cf1b8,null))[_0xd062('0x46')](handleError(_0x2cf1b8,null));};exports['addMessage']=function(_0x2d1d2e,_0x3ff50e,_0x22edd9){if(_0x2d1d2e[_0xd062('0x4c')]['id']){delete _0x2d1d2e['body']['id'];}return db[_0xd062('0x2d')][_0xd062('0x4a')]({'where':{'id':_0x2d1d2e[_0xd062('0x48')]['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x3ff50e,null))[_0xd062('0x28')](function(_0x372282){if(_0x372282){_0x2d1d2e[_0xd062('0x4c')][_0xd062('0x58')]=_0x372282['id'];return db[_0xd062('0x4f')][_0xd062('0x4b')](_0x2d1d2e[_0xd062('0x4c')]);}})['then'](respondWithResult(_0x3ff50e,null))[_0xd062('0x46')](handleError(_0x3ff50e,null));};exports[_0xd062('0x59')]=function(_0x22ecda,_0x4baeb4,_0x530be2){var _0x4de536={};var _0x28ced3={};var _0x475c72;var _0x34d509;return db[_0xd062('0x2d')]['findOne']({'where':{'id':_0x22ecda['params']['id']}})[_0xd062('0x28')](handleEntityNotFound(_0x4baeb4,null))['then'](function(_0x2f6aff){if(_0x2f6aff){_0x475c72=_0x2f6aff;_0x28ced3[_0xd062('0x36')]=_[_0xd062('0x49')](db[_0xd062('0x4f')][_0xd062('0x2e')]);_0x28ced3[_0xd062('0x30')]=_[_0xd062('0x49')](_0x22ecda['query']);_0x28ced3[_0xd062('0x31')]=_[_0xd062('0x33')](_0x28ced3[_0xd062('0x36')],_0x28ced3[_0xd062('0x30')]);_0x4de536[_0xd062('0x32')]=_['intersection'](_0x28ced3[_0xd062('0x36')],qs[_0xd062('0x34')](_0x22ecda[_0xd062('0x30')][_0xd062('0x34')]));_0x4de536['attributes']=_0x4de536[_0xd062('0x32')]['length']?_0x4de536['attributes']:_0x28ced3[_0xd062('0x36')];_0x4de536[_0xd062('0x39')]=qs[_0xd062('0x3a')](_0x22ecda[_0xd062('0x30')][_0xd062('0x3a')]);_0x4de536[_0xd062('0x3d')]=qs[_0xd062('0x31')](_[_0xd062('0x3b')](_0x22ecda['query'],_0x28ced3[_0xd062('0x31')]));if(_0x22ecda[_0xd062('0x30')]['filter']){_0x4de536['where']=_[_0xd062('0x40')](_0x4de536[_0xd062('0x3d')],{'$or':_[_0xd062('0x2c')](_0x4de536[_0xd062('0x32')],function(_0x564950){var _0x4a318a={};_0x4a318a[_0x564950]={'$like':'%'+_0x22ecda['query'][_0xd062('0x3c')]+'%'};return _0x4a318a;})});}if(_0x22ecda[_0xd062('0x30')][_0xd062('0x5a')]){var _0x58c5ed=_0x22ecda[_0xd062('0x30')][_0xd062('0x5a')]['split'](',');var _0x439679={};_0x439679[_0x58c5ed[0x0]]={'$gte':moment(_0x58c5ed[0x1])[_0xd062('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4de536['where']=_[_0xd062('0x40')](_0x4de536[_0xd062('0x3d')],_0x439679);}_0x4de536=_[_0xd062('0x40')]({},_0x4de536,_0x22ecda[_0xd062('0x41')]);return _0x475c72[_0xd062('0x59')](_0x4de536);}})[_0xd062('0x28')](function(_0xbe6dc9){if(_0xbe6dc9){_0x34d509=_0xbe6dc9[_0xd062('0x35')];if(!_0x22ecda[_0xd062('0x30')][_0xd062('0x37')](_0xd062('0x38'))){_0x4de536['limit']=qs['limit'](_0x22ecda[_0xd062('0x30')][_0xd062('0x1f')]);_0x4de536[_0xd062('0x1e')]=qs['offset'](_0x22ecda[_0xd062('0x30')]['offset']);}return _0x475c72[_0xd062('0x59')](_0x4de536);}})[_0xd062('0x28')](function(_0x177e22){if(_0x177e22){return _0x177e22?{'count':_0x34d509,'rows':_0x177e22}:null;}})['then'](respondWithResult(_0x4baeb4,null))[_0xd062('0x46')](handleError(_0x4baeb4,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ea63e80..6dd0a0a 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 _0x2929=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2929,0x77));var _0x9292=function(_0x211a44,_0x2ecd20){_0x211a44=_0x211a44-0x0;var _0x1bc738=_0x2929[_0x211a44];return _0x1bc738;};'use strict';var EventEmitter=require(_0x9292('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9292('0x1')](0x0);var events={'afterCreate':_0x9292('0x2'),'afterUpdate':_0x9292('0x3'),'afterDestroy':_0x9292('0x4')};function emitEvent(_0xbfb6b5){return function(_0x3099ef,_0x2cd141,_0x22f161){ChatGroupEvents[_0x9292('0x5')](_0xbfb6b5+':'+_0x3099ef['id'],_0x3099ef);ChatGroupEvents[_0x9292('0x5')](_0xbfb6b5,_0x3099ef);_0x22f161(null);};}for(var e in events){if(events[_0x9292('0x6')](e)){var event=events[e];ChatGroup[_0x9292('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x9782=['events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x568e4a,_0x82a00){var _0xb6e552=function(_0x42bb16){while(--_0x42bb16){_0x568e4a['push'](_0x568e4a['shift']());}};_0xb6e552(++_0x82a00);}(_0x9782,0xf6));var _0x2978=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x9782[_0x13e758];return _0x5b53c3;};'use strict';var EventEmitter=require(_0x2978('0x0'));var ChatGroup=require(_0x2978('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2978('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2978('0x3')};function emitEvent(_0x1fe2bd){return function(_0x104f79,_0x452f52,_0x1f1502){ChatGroupEvents[_0x2978('0x4')](_0x1fe2bd+':'+_0x104f79['id'],_0x104f79);ChatGroupEvents[_0x2978('0x4')](_0x1fe2bd,_0x104f79);_0x1f1502(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x2978('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ab2607a..d804034 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 _0xcf0c=['ChatGroup','lodash','util','../../config/logger','moment','path','../../config/environment','./chatGroup.attributes','define'];(function(_0x4e30ce,_0x2aded5){var _0x1e9a06=function(_0x4e9b83){while(--_0x4e9b83){_0x4e30ce['push'](_0x4e30ce['shift']());}};_0x1e9a06(++_0x2aded5);}(_0xcf0c,0x1e7));var _0xccf0=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0xcf0c[_0x41ee16];return _0x1f60de;};'use strict';var _=require(_0xccf0('0x0'));var util=require(_0xccf0('0x1'));var logger=require(_0xccf0('0x2'))('api');var moment=require(_0xccf0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xccf0('0x4'));var rimraf=require('rimraf');var config=require(_0xccf0('0x5'));var attributes=require(_0xccf0('0x6'));module['exports']=function(_0x511c5a,_0x1366ba){return _0x511c5a[_0xccf0('0x7')](_0xccf0('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62da=['../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x471f82,_0x2defed){var _0x144bb1=function(_0x112b07){while(--_0x112b07){_0x471f82['push'](_0x471f82['shift']());}};_0x144bb1(++_0x2defed);}(_0x62da,0x1f0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa62d('0x0'));var util=require(_0xa62d('0x1'));var logger=require(_0xa62d('0x2'))(_0xa62d('0x3'));var moment=require(_0xa62d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa62d('0x5'));var fs=require('fs');var path=require(_0xa62d('0x6'));var rimraf=require(_0xa62d('0x7'));var config=require(_0xa62d('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2e77d1,_0x59ce4b){return _0x2e77d1[_0xa62d('0x9')](_0xa62d('0xa'),attributes,{'tableName':_0xa62d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index bbf0bc1..b3ffb25 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 _0x0c85=['info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','result','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','./chatGroup.socket','request'];(function(_0x149951,_0x3ad5d2){var _0x16c08f=function(_0x4f58f7){while(--_0x4f58f7){_0x149951['push'](_0x149951['shift']());}};_0x16c08f(++_0x3ad5d2);}(_0x0c85,0x14f));var _0x50c8=function(_0x397105,_0x301b79){_0x397105=_0x397105-0x0;var _0x21d33e=_0x0c85[_0x397105];return _0x21d33e;};'use strict';var _=require(_0x50c8('0x0'));var util=require(_0x50c8('0x1'));var moment=require(_0x50c8('0x2'));var BPromise=require('bluebird');var rs=require(_0x50c8('0x3'));var fs=require('fs');var Redis=require(_0x50c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50c8('0x5'));var logger=require(_0x50c8('0x6'))(_0x50c8('0x7'));var config=require(_0x50c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x50c8('0x9')][_0x50c8('0xa')]({'port':0x232a});config['redis']=_[_0x50c8('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50c8('0xc')]));require(_0x50c8('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ff821,_0x5c52e5,_0x465a90){return new BPromise(function(_0x11dbb3,_0x34ad08){return client[_0x50c8('0xe')](_0x3ff821,_0x465a90)['then'](function(_0x581cd3){logger[_0x50c8('0xf')](_0x50c8('0x10'),_0x5c52e5,'request\x20sent');logger[_0x50c8('0x11')](_0x50c8('0x12'),_0x5c52e5,_0x50c8('0x13'),JSON['stringify'](_0x581cd3));if(_0x581cd3[_0x50c8('0x14')]){if(_0x581cd3[_0x50c8('0x14')][_0x50c8('0x15')]===0x1f4){logger[_0x50c8('0x14')](_0x50c8('0x10'),_0x5c52e5,_0x581cd3[_0x50c8('0x14')]['message']);return _0x34ad08(_0x581cd3[_0x50c8('0x14')]['message']);}logger['error'](_0x50c8('0x10'),_0x5c52e5,_0x581cd3['error']['message']);return _0x11dbb3(_0x581cd3['error']['message']);}else{logger[_0x50c8('0xf')](_0x50c8('0x10'),_0x5c52e5,_0x50c8('0x13'));_0x11dbb3(_0x581cd3[_0x50c8('0x16')][_0x50c8('0x17')]);}})[_0x50c8('0x18')](function(_0x220ae1){logger[_0x50c8('0x14')](_0x50c8('0x10'),_0x5c52e5,_0x220ae1);_0x34ad08(_0x220ae1);});});} \ No newline at end of file +var _0x15ff=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2912d8,_0x201076){var _0x6b361c=function(_0x177d9f){while(--_0x177d9f){_0x2912d8['push'](_0x2912d8['shift']());}};_0x6b361c(++_0x201076);}(_0x15ff,0x74));var _0xf15f=function(_0x7ddadf,_0x235e39){_0x7ddadf=_0x7ddadf-0x0;var _0x3d5f89=_0x15ff[_0x7ddadf];return _0x3d5f89;};'use strict';var _=require(_0xf15f('0x0'));var util=require(_0xf15f('0x1'));var moment=require('moment');var BPromise=require(_0xf15f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf15f('0x3'));var db=require(_0xf15f('0x4'))['db'];var utils=require(_0xf15f('0x5'));var logger=require(_0xf15f('0x6'))(_0xf15f('0x7'));var config=require(_0xf15f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf15f('0x9')]['http']({'port':0x232a});config[_0xf15f('0xa')]=_[_0xf15f('0xb')](config[_0xf15f('0xa')],{'host':_0xf15f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf15f('0xa')]));require(_0xf15f('0xd'))[_0xf15f('0xe')](socket);function respondWithRpcPromise(_0x5f18ef,_0x1dfda0,_0xce0db3){return new BPromise(function(_0x4fa7d8,_0x4767f7){return client[_0xf15f('0xf')](_0x5f18ef,_0xce0db3)[_0xf15f('0x10')](function(_0x4019da){logger[_0xf15f('0x11')](_0xf15f('0x12'),_0x1dfda0,_0xf15f('0x13'));logger[_0xf15f('0x14')](_0xf15f('0x15'),_0x1dfda0,_0xf15f('0x13'),JSON[_0xf15f('0x16')](_0x4019da));if(_0x4019da[_0xf15f('0x17')]){if(_0x4019da[_0xf15f('0x17')][_0xf15f('0x18')]===0x1f4){logger[_0xf15f('0x17')](_0xf15f('0x12'),_0x1dfda0,_0x4019da[_0xf15f('0x17')][_0xf15f('0x19')]);return _0x4767f7(_0x4019da[_0xf15f('0x17')]['message']);}logger['error'](_0xf15f('0x12'),_0x1dfda0,_0x4019da[_0xf15f('0x17')]['message']);return _0x4fa7d8(_0x4019da['error'][_0xf15f('0x19')]);}else{logger['info'](_0xf15f('0x12'),_0x1dfda0,'request\x20sent');_0x4fa7d8(_0x4019da[_0xf15f('0x1a')][_0xf15f('0x19')]);}})[_0xf15f('0x1b')](function(_0x662d62){logger[_0xf15f('0x17')](_0xf15f('0x12'),_0x1dfda0,_0x662d62);_0x4767f7(_0x662d62);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 62bfef3..ecfc67d 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 _0x495a=['remove','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x495a,0xd6));var _0xa495=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x495a[_0x15c421];return _0x5e5ed5;};'use strict';var ChatGroupEvents=require(_0xa495('0x0'));var events=[_0xa495('0x1'),_0xa495('0x2'),'update'];function createListener(_0x563963,_0x1b66ce){return function(_0x16d5cf){_0x1b66ce[_0xa495('0x3')](_0x563963,_0x16d5cf);};}function removeListener(_0x10bc4c,_0x578c4a){return function(){ChatGroupEvents[_0xa495('0x4')](_0x10bc4c,_0x578c4a);};}exports[_0xa495('0x5')]=function(_0x4b0f4b){for(var _0x1d3aa9=0x0,_0x186fba=events[_0xa495('0x6')];_0x1d3aa9<_0x186fba;_0x1d3aa9++){var _0x2c1d61=events[_0x1d3aa9];var _0x36e02a=createListener(_0xa495('0x7')+_0x2c1d61,_0x4b0f4b);ChatGroupEvents['on'](_0x2c1d61,_0x36e02a);}}; \ No newline at end of file +var _0xaf3e=['remove','update','emit','removeListener','register','./chatGroup.events','save'];(function(_0x876f8d,_0x2bad33){var _0x349d20=function(_0x547b2b){while(--_0x547b2b){_0x876f8d['push'](_0x876f8d['shift']());}};_0x349d20(++_0x2bad33);}(_0xaf3e,0x8a));var _0xeaf3=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0xaf3e[_0x440917];return _0x5e906b;};'use strict';var ChatGroupEvents=require(_0xeaf3('0x0'));var events=[_0xeaf3('0x1'),_0xeaf3('0x2'),_0xeaf3('0x3')];function createListener(_0x34b712,_0x5cbd87){return function(_0x31bce8){_0x5cbd87[_0xeaf3('0x4')](_0x34b712,_0x31bce8);};}function removeListener(_0x171f26,_0x1f89df){return function(){ChatGroupEvents[_0xeaf3('0x5')](_0x171f26,_0x1f89df);};}exports[_0xeaf3('0x6')]=function(_0xfe8774){for(var _0x4549ac=0x0,_0x439a43=events['length'];_0x4549ac<_0x439a43;_0x4549ac++){var _0x5085c1=events[_0x4549ac];var _0x1a12be=createListener('chatGroup:'+_0x5085c1,_0xfe8774);ChatGroupEvents['on'](_0x5085c1,_0x1a12be);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 13ee00e..f54c8dd 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 _0xbe29=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','addMessage','put','update','delete','destroy','removeMembers','multer','util','path'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xbe29,0x10b));var _0x9be2=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xbe29[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0x9be2('0x0'));var util=require(_0x9be2('0x1'));var path=require(_0x9be2('0x2'));var timeout=require(_0x9be2('0x3'));var express=require(_0x9be2('0x4'));var router=express[_0x9be2('0x5')]();var fs_extra=require(_0x9be2('0x6'));var auth=require(_0x9be2('0x7'));var interaction=require(_0x9be2('0x8'));var config=require(_0x9be2('0x9'));var controller=require(_0x9be2('0xa'));router[_0x9be2('0xb')]('/',auth[_0x9be2('0xc')](),controller[_0x9be2('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9be2('0xe')]);router['get'](_0x9be2('0xf'),auth['isAuthenticated'](),controller[_0x9be2('0x10')]);router[_0x9be2('0xb')](_0x9be2('0x11'),auth[_0x9be2('0xc')](),controller[_0x9be2('0x12')]);router[_0x9be2('0xb')]('/:id/members',auth[_0x9be2('0xc')](),controller[_0x9be2('0x13')]);router[_0x9be2('0xb')](_0x9be2('0x14'),auth['isAuthenticated'](),controller[_0x9be2('0x15')]);router[_0x9be2('0x16')]('/',auth[_0x9be2('0xc')](),controller['create']);router['post'](_0x9be2('0x17'),auth[_0x9be2('0xc')](),controller['addMembers']);router[_0x9be2('0x16')](_0x9be2('0x14'),auth['isAuthenticated'](),controller[_0x9be2('0x18')]);router[_0x9be2('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x9be2('0x1a')]);router[_0x9be2('0x1b')](_0x9be2('0xf'),auth[_0x9be2('0xc')](),controller[_0x9be2('0x1c')]);router['delete'](_0x9be2('0x17'),auth[_0x9be2('0xc')](),controller[_0x9be2('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xa6de=['delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','index','get','/describe','describe','isAuthenticated','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','put','/:id'];(function(_0x2faf4d,_0xebb4f6){var _0x4c2ec1=function(_0x585197){while(--_0x585197){_0x2faf4d['push'](_0x2faf4d['shift']());}};_0x4c2ec1(++_0xebb4f6);}(_0xa6de,0x12d));var _0xea6d=function(_0x51b72e,_0x408f4f){_0x51b72e=_0x51b72e-0x0;var _0xa108e1=_0xa6de[_0x51b72e];return _0xa108e1;};'use strict';var multer=require(_0xea6d('0x0'));var util=require(_0xea6d('0x1'));var path=require('path');var timeout=require(_0xea6d('0x2'));var express=require(_0xea6d('0x3'));var router=express['Router']();var fs_extra=require(_0xea6d('0x4'));var auth=require(_0xea6d('0x5'));var interaction=require(_0xea6d('0x6'));var config=require('../../config/environment');var controller=require(_0xea6d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xea6d('0x8')]);router[_0xea6d('0x9')](_0xea6d('0xa'),auth['isAuthenticated'](),controller[_0xea6d('0xb')]);router['get']('/:id',auth[_0xea6d('0xc')](),controller[_0xea6d('0xd')]);router['get'](_0xea6d('0xe'),auth[_0xea6d('0xc')](),controller['getUnread']);router['get'](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x10')]);router['get'](_0xea6d('0x11'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x12')]);router[_0xea6d('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea6d('0x13')](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x14')]);router[_0xea6d('0x13')](_0xea6d('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0xea6d('0x15')](_0xea6d('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xea6d('0x17')](_0xea6d('0x16'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x18')]);router['delete'](_0xea6d('0xf'),auth[_0xea6d('0xc')](),controller[_0xea6d('0x19')]);module[_0xea6d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1c22212..4c9b3b3 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 _0xe9e8=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x35134b,_0x519933){var _0xd7e4d=function(_0x45248b){while(--_0x45248b){_0x35134b['push'](_0x35134b['shift']());}};_0xd7e4d(++_0x519933);}(_0xe9e8,0x6b));var _0x8e9e=function(_0xbf837,_0x233540){_0xbf837=_0xbf837-0x0;var _0x436025=_0xe9e8[_0xbf837];return _0x436025;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'closed':{'type':Sequelize[_0x8e9e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8e9e('0x3')]},'ratingType':{'type':Sequelize[_0x8e9e('0x4')](_0x8e9e('0x5'),_0x8e9e('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8e9e('0x7')]},'pathTranscript':{'type':Sequelize[_0x8e9e('0x7')]},'mailTranscript':{'type':Sequelize[_0x8e9e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e9e('0x8')]},'secondDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'note':{'type':Sequelize[_0x8e9e('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8e9e('0x8')]},'osName':{'type':Sequelize[_0x8e9e('0x8')]},'osVersion':{'type':Sequelize[_0x8e9e('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8e9e('0x8')]},'deviceType':{'type':Sequelize[_0x8e9e('0x8')]},'referer':{'type':Sequelize[_0x8e9e('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8e9e('0x7')](_0x8e9e('0x9'))},'read1stAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x8e9e('0x4')]('in',_0x8e9e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8e9e('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x8e9e('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6017=['STRING','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','TEXT'];(function(_0x48a2f8,_0x54889a){var _0x8881e=function(_0x355718){while(--_0x355718){_0x48a2f8['push'](_0x48a2f8['shift']());}};_0x8881e(++_0x54889a);}(_0x6017,0xae));var _0x7601=function(_0x12d633,_0x3e91c5){_0x12d633=_0x12d633-0x0;var _0x2772e1=_0x6017[_0x12d633];return _0x2772e1;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'closed':{'type':Sequelize[_0x7601('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x7601('0x3')](_0x7601('0x4'),'thumb'),'defaultValue':_0x7601('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7601('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7601('0x6')]},'secondDisposition':{'type':Sequelize[_0x7601('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7601('0x6')]},'note':{'type':Sequelize[_0x7601('0x6')]},'browserName':{'type':Sequelize[_0x7601('0x6')]},'browserVersion':{'type':Sequelize[_0x7601('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7601('0x6')]},'deviceModel':{'type':Sequelize[_0x7601('0x6')]},'deviceVendor':{'type':Sequelize[_0x7601('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7601('0x5')]},'customerIp':{'type':Sequelize[_0x7601('0x6')]},'formData':{'type':Sequelize[_0x7601('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x7601('0x7')]},'lastMsgAt':{'type':Sequelize[_0x7601('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7601('0x3')]('in',_0x7601('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7601('0x6')]},'customerPort':{'type':Sequelize[_0x7601('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7601('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7601('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2332934..70bb327 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 _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x555fab,_0x2bd789){var _0x47dd3d=function(_0x27d026){while(--_0x27d026){_0x555fab['push'](_0x555fab['shift']());}};_0x47dd3d(++_0x2bd789);}(_0x34e8,0x12c));var _0x834e=function(_0x2e4f85,_0x53a1ce){_0x2e4f85=_0x2e4f85-0x0;var _0x1ea9e6=_0x34e8[_0x2e4f85];return _0x1ea9e6;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));}; \ No newline at end of file +var _0xec56=['Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','includeAll','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','omit','spread','emit','chatInteractionTags:save','removeTags','files','server','attachments','transcript-%d-%s.zip','lastName','direction','read','Account','Owner','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','firstName','views','downloadInteraction.ejs','Chat','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','talking','answered','unmanaged','total','closed','waiting','UserId','disposition','abandoned','index','ChatInteraction','rawAttributes','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','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','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','end','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','sequelize','toString','keyBy','fields','a.key'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0xec56,0x1bd));var _0x6ec5=function(_0x56d891,_0x463510){_0x56d891=_0x56d891-0x0;var _0x2f1804=_0xec56[_0x56d891];return _0x2f1804;};'use strict';var rimraf=require(_0x6ec5('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0x6ec5('0x1'));var BPromise=require(_0x6ec5('0x2'));var Mustache=require(_0x6ec5('0x3'));var util=require(_0x6ec5('0x4'));var path=require(_0x6ec5('0x5'));var ejs=require(_0x6ec5('0x6'));var fs=require('fs');var _=require(_0x6ec5('0x7'));var squel=require(_0x6ec5('0x8'));var Redis=require(_0x6ec5('0x9'));var qs=require(_0x6ec5('0xa'));var as=require(_0x6ec5('0xb'));var pdf=require(_0x6ec5('0xc'));var logger=require(_0x6ec5('0xd'))(_0x6ec5('0xe'));var config=require(_0x6ec5('0xf'));var db=require(_0x6ec5('0x10'))['db'];config[_0x6ec5('0x11')]=_[_0x6ec5('0x12')](config[_0x6ec5('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ec5('0x13'))(new Redis(config[_0x6ec5('0x11')]));require(_0x6ec5('0x14'))[_0x6ec5('0x15')](socket);var jayson=require(_0x6ec5('0x16'));var client=jayson[_0x6ec5('0x17')][_0x6ec5('0x18')]({'port':0x232b});var client9004=jayson['client'][_0x6ec5('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x1d7180,_0x2b1f61,_0xb04ab6,_0x135aaf){return new BPromise(function(_0x2890fb,_0x2f4c5d){var _0x39125b=_0x135aaf||client;return _0x39125b['request'](_0x1d7180,_0xb04ab6)[_0x6ec5('0x19')](function(_0x4d1510){logger[_0x6ec5('0x1a')](_0x6ec5('0x1b'),_0x2b1f61,_0x6ec5('0x1c'));logger[_0x6ec5('0x1d')](_0x6ec5('0x1e'),_0x2b1f61,'request\x20sent',JSON[_0x6ec5('0x1f')](_0x4d1510));if(_0x4d1510[_0x6ec5('0x20')]){if(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x21')]===0x1f4){logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);return _0x2f4c5d(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);}logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);return _0x2890fb(_0x4d1510[_0x6ec5('0x20')][_0x6ec5('0x22')]);}else{logger[_0x6ec5('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2b1f61,_0x6ec5('0x1c'));_0x2890fb(_0x4d1510[_0x6ec5('0x23')][_0x6ec5('0x22')]);}})[_0x6ec5('0x24')](function(_0x3fc9d7){logger[_0x6ec5('0x20')](_0x6ec5('0x1b'),_0x2b1f61,_0x3fc9d7);_0x2f4c5d(_0x3fc9d7);});});}function respondWithStatusCode(_0x48733b,_0x78c52c){_0x78c52c=_0x78c52c||0xcc;return function(_0x2ecdcf){if(_0x2ecdcf){return _0x48733b[_0x6ec5('0x25')](_0x78c52c);}return _0x48733b[_0x6ec5('0x26')](_0x78c52c)['end']();};}function respondWithResult(_0x27f631,_0x280748){_0x280748=_0x280748||0xc8;return function(_0x5be80f){if(_0x5be80f){return _0x27f631[_0x6ec5('0x26')](_0x280748)[_0x6ec5('0x27')](_0x5be80f);}};}function respondWithFilteredResult(_0xb4d269,_0x5078e8){return function(_0x1b779a){if(_0x1b779a){var _0xd0e8d7=typeof _0x5078e8[_0x6ec5('0x28')]===_0x6ec5('0x29')&&typeof _0x5078e8[_0x6ec5('0x2a')]==='undefined';var _0x171e2a=_0x1b779a[_0x6ec5('0x2b')];var _0x4a9860=_0xd0e8d7?0x0:_0x5078e8[_0x6ec5('0x28')];var _0x3f5ee0=_0xd0e8d7?_0x1b779a['count']:_0x5078e8[_0x6ec5('0x28')]+_0x5078e8[_0x6ec5('0x2a')];var _0x3bbf16;if(_0x3f5ee0>=_0x171e2a){_0x3f5ee0=_0x171e2a;_0x3bbf16=0xc8;}else{_0x3bbf16=0xce;}_0xb4d269[_0x6ec5('0x26')](_0x3bbf16);return _0xb4d269[_0x6ec5('0x2c')]('Content-Range',_0x4a9860+'-'+_0x3f5ee0+'/'+_0x171e2a)[_0x6ec5('0x27')](_0x1b779a);}return null;};}function saveUpdates(_0x179f57){return function(_0x24aff9){if(_0x24aff9){return _0x24aff9[_0x6ec5('0x2d')](_0x179f57)[_0x6ec5('0x19')](function(_0x22c3d3){return _0x22c3d3;});}return null;};}function removeEntity(_0x394132){return function(_0x59a6de){if(_0x59a6de){return _0x59a6de[_0x6ec5('0x2e')]()['then'](function(){_0x394132[_0x6ec5('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424ec7){return function(_0x3115e3){if(!_0x3115e3){_0x424ec7['sendStatus'](0x194);}return _0x3115e3;};}function handleError(_0x5db924,_0x3bfab4){_0x3bfab4=_0x3bfab4||0x1f4;return function(_0x293915){logger['error'](_0x293915[_0x6ec5('0x2f')]);if(_0x293915[_0x6ec5('0x30')]){delete _0x293915['name'];}_0x5db924[_0x6ec5('0x26')](_0x3bfab4)[_0x6ec5('0x31')](_0x293915);};}function getMustacheRender(_0x391c01,_0x12879b){return Mustache[_0x6ec5('0x32')](_0x391c01,_[_0x6ec5('0x33')](_0x12879b[_0x6ec5('0x34')],{'contact':_0x12879b[_0x6ec5('0x35')],'message':_0x12879b['message'],'agent':_0x12879b[_0x6ec5('0x36')],'interaction':_0x12879b['interaction'],'account':_0x12879b[_0x6ec5('0x37')]}))||'';}function getInteractionUsers(_0xe1e58,_0x26ada3){return new BPromise(function(_0x128055,_0x439dd5){try{if(_0x26ada3[_0xe1e58['id']]){_0xe1e58[_0x6ec5('0x38')]=_[_0x6ec5('0x39')](_0x26ada3[_0xe1e58['id']],function(_0xab380e){return{'id':_0xab380e['id'],'fullname':_0xab380e[_0x6ec5('0x3a')]};});}}catch(_0x203756){_0x439dd5(_0x203756);}_0x128055(_0xe1e58);});}function getInteractionTags(_0x1c56e5,_0x496246){return new BPromise(function(_0x5a5cf7,_0x30465b){try{if(_0x1c56e5['TagIds']){_0x1c56e5[_0x6ec5('0x3b')]=[];_0x1c56e5[_0x6ec5('0x3c')][_0x6ec5('0x3d')](',')[_0x6ec5('0x3e')](function(_0x2b47ab){_0x1c56e5[_0x6ec5('0x3b')][_0x6ec5('0x3f')](_0x496246[_0x2b47ab]);});}delete _0x1c56e5['TagIds'];}catch(_0x239920){_0x30465b(_0x239920);}_0x5a5cf7(_0x1c56e5);});}function updateChatInteraction(_0xc79bb3,_0x42b134,_0x3aaf1a){return new BPromise(function(_0x279339,_0x32db57){return getInteractionUsers(_0xc79bb3,_0x3aaf1a)[_0x6ec5('0x19')](function(_0x4354e4){return getInteractionTags(_0x4354e4,_0x42b134);})[_0x6ec5('0x19')](function(_0x53dcd8){return getStateInteraction(_0x53dcd8);})[_0x6ec5('0x19')](function(_0x4a2f6e){_0x279339(_0x4a2f6e);})[_0x6ec5('0x24')](function(_0x58bdd0){_0x32db57(_0x58bdd0);});});}function getStateInteraction(_0x18b409){return new BPromise(function(_0x45de3c){_0x18b409['waiting']=0x0;_0x18b409[_0x6ec5('0x40')]=0x0;_0x18b409[_0x6ec5('0x41')]=0x0;_0x18b409[_0x6ec5('0x42')]=0x0;_0x18b409['abandoned']=0x0;_0x18b409[_0x6ec5('0x43')]=0x0;if(!_0x18b409[_0x6ec5('0x44')]&&!_0x18b409['UserId']){_0x18b409[_0x6ec5('0x45')]+=0x1;}if(!_0x18b409[_0x6ec5('0x44')]&&_0x18b409[_0x6ec5('0x46')]){_0x18b409[_0x6ec5('0x40')]+=0x1;if(_0x18b409[_0x6ec5('0x45')]){_0x18b409[_0x6ec5('0x45')]-=0x1;}}if(_0x18b409[_0x6ec5('0x44')]&&_0x18b409[_0x6ec5('0x47')]===_0x6ec5('0x48')){_0x18b409[_0x6ec5('0x48')]+=0x1;if(_0x18b409[_0x6ec5('0x45')]){_0x18b409['waiting']-=0x1;}}else if(_0x18b409[_0x6ec5('0x44')]&&!_0x18b409[_0x6ec5('0x46')]&&_0x18b409[_0x6ec5('0x47')]){_0x18b409[_0x6ec5('0x42')]+=0x1;if(_0x18b409['waiting']){_0x18b409[_0x6ec5('0x45')]-=0x1;}}else if(_0x18b409[_0x6ec5('0x44')]&&_0x18b409['UserId']){_0x18b409[_0x6ec5('0x41')]+=0x1;if(_0x18b409['talking']){_0x18b409[_0x6ec5('0x40')]-=0x1;}}_0x18b409[_0x6ec5('0x43')]+=0x1;_0x45de3c(_0x18b409);});}exports[_0x6ec5('0x49')]=function(_0xeac39e,_0x51f2ef){var _0x5b0656={},_0x1bbe7f={},_0x56dc23={'count':0x0,'rows':[]};var _0x2e69ff=_[_0x6ec5('0x39')](db[_0x6ec5('0x4a')][_0x6ec5('0x4b')],function(_0x2cf8c7){return{'name':_0x2cf8c7['fieldName'],'type':_0x2cf8c7['type'][_0x6ec5('0x4c')]};});_0x1bbe7f[_0x6ec5('0x4d')]=_[_0x6ec5('0x39')](_0x2e69ff,_0x6ec5('0x30'));_0x1bbe7f[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0xeac39e[_0x6ec5('0x4e')]);_0x1bbe7f[_0x6ec5('0x50')]=_[_0x6ec5('0x51')](_0x1bbe7f[_0x6ec5('0x4d')],_0x1bbe7f[_0x6ec5('0x4e')]);_0x5b0656[_0x6ec5('0x52')]=_[_0x6ec5('0x51')](_0x1bbe7f[_0x6ec5('0x4d')],qs['fields'](_0xeac39e[_0x6ec5('0x4e')]['fields']));_0x5b0656[_0x6ec5('0x52')]=_0x5b0656[_0x6ec5('0x52')]['length']?_0x5b0656[_0x6ec5('0x52')]:_0x1bbe7f[_0x6ec5('0x4d')];if(!_0xeac39e['query'][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x5b0656['limit']=qs['limit'](_0xeac39e[_0x6ec5('0x4e')]['limit']);_0x5b0656['offset']=qs[_0x6ec5('0x28')](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x28')]);}_0x5b0656[_0x6ec5('0x55')]=qs['sort'](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x5b0656[_0x6ec5('0x57')]=qs[_0x6ec5('0x50')](_[_0x6ec5('0x58')](_0xeac39e[_0x6ec5('0x4e')],_0x1bbe7f[_0x6ec5('0x50')]),_0x2e69ff);var _0x29bf52=[];var _0xc52e91=squel[_0x6ec5('0x59')]()[_0x6ec5('0x5a')]('id')[_0x6ec5('0x5a')](_0x6ec5('0x30'))['field'](_0x6ec5('0x5b'))[_0x6ec5('0x5c')]('tools_tags');var _0x388ddd=squel[_0x6ec5('0x59')]()[_0x6ec5('0x5a')](_0x6ec5('0x5d'))[_0x6ec5('0x5a')]('u.fullname')['field'](_0x6ec5('0x5e'))['from'](_0x6ec5('0x5f'),'ui')[_0x6ec5('0x60')](_0x6ec5('0x61'),'u',_0x6ec5('0x62'));var _0x301e31=squel['select']()[_0x6ec5('0x5c')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x6ec5('0x63'))[_0x6ec5('0x60')]('users','o','o.id\x20=\x20i.UserId')[_0x6ec5('0x60')](_0x6ec5('0x64'),'a',_0x6ec5('0x65'))[_0x6ec5('0x60')](_0x6ec5('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x6ec5('0x60')](_0x6ec5('0x67'),'it',_0x6ec5('0x68'))[_0x6ec5('0x60')](_0x6ec5('0x69'),'t','t.id\x20=\x20it.TagId');var _0x34a136=squel[_0x6ec5('0x6a')]();var _0x278c00=[];var _0x5c00c4=squel[_0x6ec5('0x6a')]();var _0xe8a888;if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x6b')]){_0xe8a888=as[_0x6ec5('0x6c')](_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x6b')]);var _0x2393d1=_0xe8a888[_0x6ec5('0x6d')];for(var _0x131ef3=0x0;_0x131ef3<_0xe8a888[_0x6ec5('0x6e')][_0x6ec5('0x6f')];_0x131ef3++){var _0x40c76c=_0xe8a888['conditions'][_0x131ef3];var _0x183353='i';var _0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,['name',_0x40c76c['field']]);if(!_0x594ab3){switch(_0x40c76c[_0x6ec5('0x5a')]){case _0x6ec5('0x71'):if(_0x40c76c[_0x6ec5('0x72')]==0x1){_0x301e31[_0x6ec5('0x73')]('`'+_0x40c76c[_0x6ec5('0x5a')]+'`\x20=\x200');}else{_0x301e31[_0x6ec5('0x73')]('`'+_0x40c76c[_0x6ec5('0x5a')]+_0x6ec5('0x74'));}break;case _0x6ec5('0x75'):if(_0x40c76c[_0x6ec5('0x76')]==='$substring'){if(_0x40c76c[_0x6ec5('0x72')][_0x6ec5('0x3d')]('\x20')[_0x6ec5('0x6f')]>0x1){_0x34a136[_0x2393d1](_0x6ec5('0x77'),qs['getFullTextValue'](_0x40c76c[_0x6ec5('0x72')]),null);}else{var _0x39f48a='%'+_0x40c76c['value']+'%';_0x34a136[_0x2393d1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x39f48a,_0x39f48a,_0x39f48a);}}else{_0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,[_0x6ec5('0x30'),_0x6ec5('0x78')]);_0x40c76c[_0x6ec5('0x5a')]=_0x6ec5('0x78');_0xf44b2b=as[_0x6ec5('0x79')](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')]['end']);}break;case _0x6ec5('0x7d'):var _0x12fdac=_0x40c76c[_0x6ec5('0x72')][_0x6ec5('0x3d')](',')['map'](function(_0x26869d){return Number(_0x26869d);});_0x12fdac[_0x6ec5('0x3e')](function(_0x1d5ee3){_0x5c00c4['or'](_0x6ec5('0x7e'),'%,'+_0x1d5ee3+',%');});_0x278c00=_['union'](_0x278c00,_0x12fdac);break;case _0x6ec5('0x7f'):if(_0x40c76c[_0x6ec5('0x76')]===_0x6ec5('0x80')){_0x34a136[_0x2393d1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x40c76c['value']+'%',null);}else{_0x594ab3=_[_0x6ec5('0x70')](_0x2e69ff,[_0x6ec5('0x30'),'UserId']);_0x40c76c[_0x6ec5('0x5a')]=_0x6ec5('0x46');_0xf44b2b=as[_0x6ec5('0x79')](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b['text'],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')]['end']);}break;case _0x6ec5('0x34'):_0xf44b2b=as[_0x6ec5('0x79')]('me',null,_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x7c')],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x81')]);break;}}else{var _0xf44b2b=as['buildExpression'](_0x183353,_0x594ab3[_0x6ec5('0x7a')],_0x40c76c);_0x34a136[_0x2393d1](_0xf44b2b[_0x6ec5('0x7b')],_0xf44b2b['value']['start'],_0xf44b2b[_0x6ec5('0x72')][_0x6ec5('0x81')]);}}}else{var _0x7e9bd5=_(_0xeac39e['query'])[_0x6ec5('0x4f')]()[_0x6ec5('0x39')](function(_0x3255e4){return _[_0x6ec5('0x82')](_0x2e69ff,['name',_0x3255e4])?_0x3255e4:undefined;})[_0x6ec5('0x83')]()[_0x6ec5('0x72')]();if(!_[_0x6ec5('0x84')](_0x7e9bd5)){_0x7e9bd5[_0x6ec5('0x3e')](function(_0x42fa7b){if(_0x42fa7b===_0x6ec5('0x85')){_0x301e31[_0x6ec5('0x57')](_0x6ec5('0x86'),[][_0x6ec5('0x87')](_0xeac39e['query'][_0x42fa7b]));}else if(_0x42fa7b==='createdAt'){var _0x307c53=JSON[_0x6ec5('0x88')](_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b])['$gte'];var _0x31a571=JSON['parse'](_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b])[_0x6ec5('0x89')];_0x301e31['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x307c53,_0x31a571);}else{if(_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b]===_0x6ec5('0x8a')){_0x301e31[_0x6ec5('0x57')]('i.'+_0x42fa7b+_0x6ec5('0x8b'));}else{_0x301e31['where']('i.'+_0x42fa7b+_0x6ec5('0x8c'),_0xeac39e[_0x6ec5('0x4e')][_0x42fa7b]);}}});}if(_0xeac39e[_0x6ec5('0x4e')]['read']){if(_0xeac39e['query']['read']==0x1){_0x301e31[_0x6ec5('0x73')](_0x6ec5('0x8d'));}else{_0x301e31[_0x6ec5('0x73')](_0x6ec5('0x8e'));}}if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x8f')]){_0x278c00=_[_0x6ec5('0x90')](_0xeac39e['query'][_0x6ec5('0x8f')])?_0xeac39e['query'][_0x6ec5('0x8f')]:new Array(_0xeac39e[_0x6ec5('0x4e')]['tag']);_0x278c00[_0x6ec5('0x3e')](function(_0x354187){_0x5c00c4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x354187+',%');});}if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x91')]){var _0x4bed50=_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x91')][_0x6ec5('0x92')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4bed50)){_0x34a136['or'](_0x6ec5('0x93'),_0x4bed50+'%');}else{_0x34a136['or'](_0x6ec5('0x94'),qs[_0x6ec5('0x95')](_0x4bed50))['or'](_0x6ec5('0x96'),_0x4bed50+'%');}}}_0x301e31[_0x6ec5('0x57')](_0x34a136);_0x301e31[_0x6ec5('0x97')](_0x6ec5('0x98'));var _0x3914ca={'type':db[_0x6ec5('0x99')][_0x6ec5('0x9a')][_0x6ec5('0x9b')],'raw':!![]};var _0x3464ba=_0x301e31[_0x6ec5('0x9c')]();_0x3464ba['field'](_0x6ec5('0x98'));_0x3464ba[_0x6ec5('0x5a')](_0x6ec5('0x9d'),_0x6ec5('0x71'));if(_0x5b0656['order']){_0x5b0656[_0x6ec5('0x55')]['forEach'](function(_0x26e2b1){var _0x2e6e33=_0x26e2b1[0x0]===_0x6ec5('0x9e')?_0x26e2b1[0x0]:'i.'+_0x26e2b1[0x0];_0x301e31[_0x6ec5('0x55')](_0x2e6e33,_0x26e2b1[0x1]===_0x6ec5('0x9f')?![]:!![]);});}if(!_[_0x6ec5('0x84')](_0x278c00)){_0x301e31[_0x6ec5('0x73')](_0x5c00c4);_0x3464ba['where'](_0x6ec5('0xa0'),_0x278c00);}BPromise[_0x6ec5('0xa1')]()['then'](function(){if(!_0xe8a888){if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x85')])return;_0x3464ba[_0x6ec5('0x57')](_0x6ec5('0xa2'));_0x301e31[_0x6ec5('0x57')](_0x6ec5('0xa2'));return;}if(_0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa4')]!==_0x6ec5('0x36'))return;return _0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa5')]({'attributes':['id'],'raw':!![]})[_0x6ec5('0x19')](function(_0xc6dcd){if(_[_0x6ec5('0x84')](_0xc6dcd)){_0x3464ba[_0x6ec5('0x57')]('i.ChatWebsiteId\x20IS\x20NULL');_0x301e31[_0x6ec5('0x57')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3464ba[_0x6ec5('0x57')](_0x6ec5('0x86'),_['map'](_0xc6dcd,'id'));_0x301e31[_0x6ec5('0x57')](_0x6ec5('0x86'),_[_0x6ec5('0x39')](_0xc6dcd,'id'));}});})[_0x6ec5('0x19')](function(){if(_0xeac39e[_0x6ec5('0xa3')][_0x6ec5('0xa4')]===_0x6ec5('0x36')&&!_0xe8a888&&!_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0x85')])return[];return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0x3464ba[_0x6ec5('0xa7')](),_0x3914ca);})['then'](function(_0x45b840){_0x56dc23[_0x6ec5('0x2b')]=_0x45b840['length'];if(_0x56dc23['count']===0x0)return[];return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0xc52e91['toString'](),_0x3914ca)[_0x6ec5('0x19')](function(_0x59025e){_0x29bf52=_[_0x6ec5('0xa8')](_0x59025e,'id');_0x3914ca=_[_0x6ec5('0x33')](_0x3914ca,{'model':db[_0x6ec5('0x4a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xeac39e[_0x6ec5('0x4e')][_0x6ec5('0xa9')]){_0x5b0656[_0x6ec5('0x52')][_0x6ec5('0x3e')](function(_0x3574fe){_0x301e31['field']('i.'+_0x3574fe);});}else{_0x301e31[_0x6ec5('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6ec5('0x71'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xaa'),_0x6ec5('0xab'));_0x301e31['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xac'),_0x6ec5('0x9e'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xad'));_0x301e31['field'](_0x6ec5('0xae'),'Contact.firstName');_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xaf'),_0x6ec5('0xb0'));_0x301e31[_0x6ec5('0x5a')]('c.email',_0x6ec5('0xb1'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb2'),_0x6ec5('0xb3'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb4'),'Contact.mobile');_0x301e31['field'](_0x6ec5('0xb5'),_0x6ec5('0xb6'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb7'),_0x6ec5('0xb8'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xb9'),_0x6ec5('0xba'));_0x301e31[_0x6ec5('0x5a')](_0x6ec5('0xbb'),'TagIds');}if(_0x5b0656[_0x6ec5('0x2a')])_0x301e31[_0x6ec5('0x2a')](_0x5b0656[_0x6ec5('0x2a')]);if(_0x5b0656[_0x6ec5('0x28')])_0x301e31['offset'](_0x5b0656['offset']);return db[_0x6ec5('0xa6')][_0x6ec5('0x4e')](_0x301e31['toString'](),_0x3914ca);})[_0x6ec5('0x19')](function(_0x78b13f){if(_0x78b13f[_0x6ec5('0x6f')]>0x0)_0x388ddd['where'](_0x6ec5('0xbc'),_[_0x6ec5('0x39')](_0x78b13f,'id'));return db['sequelize'][_0x6ec5('0x4e')](_0x388ddd['toString'](),_0x3914ca)['then'](function(_0x5783c5){var _0x1db6bf=_[_0x6ec5('0xbd')](_0x5783c5,_0x6ec5('0xbe'));var _0x5c00c7=[];_0x78b13f[_0x6ec5('0x3e')](function(_0x28f3f2){_0x5c00c7[_0x6ec5('0x3f')](updateChatInteraction(_0x28f3f2,_0x29bf52,_0x1db6bf));});return BPromise[_0x6ec5('0xbf')](_0x5c00c7);});});})['then'](function(_0x333385){_0x56dc23[_0x6ec5('0xc0')]=_0x333385;return _0x56dc23;})[_0x6ec5('0x19')](respondWithFilteredResult(_0x51f2ef,_0x5b0656))['catch'](handleError(_0x51f2ef,null));};exports[_0x6ec5('0xc1')]=function(_0x402c19,_0x2d8a14){var _0x474b87={'raw':![],'where':{'id':_0x402c19['params']['id']}},_0x3ce417={};_0x3ce417[_0x6ec5('0x4d')]=_[_0x6ec5('0x4f')](db[_0x6ec5('0x4a')][_0x6ec5('0x4b')]);_0x3ce417[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x402c19[_0x6ec5('0x4e')]);_0x3ce417[_0x6ec5('0x50')]=_[_0x6ec5('0x51')](_0x3ce417[_0x6ec5('0x4d')],_0x3ce417[_0x6ec5('0x4e')]);_0x474b87['attributes']=_['intersection'](_0x3ce417[_0x6ec5('0x4d')],qs[_0x6ec5('0xa9')](_0x402c19[_0x6ec5('0x4e')]['fields']));_0x474b87[_0x6ec5('0x52')]=_0x474b87[_0x6ec5('0x52')][_0x6ec5('0x6f')]?_0x474b87[_0x6ec5('0x52')]:_0x3ce417['model'];if(_0x402c19[_0x6ec5('0x4e')][_0x6ec5('0xc2')]){_0x474b87['include']=[{'all':!![]}];}_0x474b87=_[_0x6ec5('0x33')]({},_0x474b87,_0x402c19[_0x6ec5('0xc3')]);return db[_0x6ec5('0x4a')][_0x6ec5('0x70')](_0x474b87)[_0x6ec5('0x19')](handleEntityNotFound(_0x2d8a14,null))[_0x6ec5('0x19')](respondWithResult(_0x2d8a14,null))[_0x6ec5('0x24')](handleError(_0x2d8a14,null));};exports[_0x6ec5('0xc4')]=function(_0x496309,_0x161f78){return db[_0x6ec5('0x4a')][_0x6ec5('0xc4')](_0x496309[_0x6ec5('0x34')],{})[_0x6ec5('0x19')](respondWithResult(_0x161f78,0xc9))['catch'](handleError(_0x161f78,null));};exports[_0x6ec5('0x2d')]=function(_0x5409ed,_0x8dd2e){if(_0x5409ed[_0x6ec5('0x34')]['id']){delete _0x5409ed[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')]['find']({'where':{'id':_0x5409ed[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x8dd2e,null))[_0x6ec5('0x19')](saveUpdates(_0x5409ed[_0x6ec5('0x34')],null))[_0x6ec5('0x19')](respondWithResult(_0x8dd2e,null))['catch'](handleError(_0x8dd2e,null));};exports[_0x6ec5('0x2e')]=function(_0x23d65b,_0x5d3f68){return db[_0x6ec5('0x4a')]['find']({'where':{'id':_0x23d65b[_0x6ec5('0xc5')]['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x5d3f68,null))[_0x6ec5('0x19')](removeEntity(_0x5d3f68,null))['catch'](handleError(_0x5d3f68,null));};exports[_0x6ec5('0xc6')]=function(_0x83453e,_0x9cbab1){return db[_0x6ec5('0x4a')]['describe']()[_0x6ec5('0x19')](respondWithResult(_0x9cbab1,null))['catch'](handleError(_0x9cbab1,null));};exports[_0x6ec5('0xc7')]=function(_0x1b9e0d,_0x227438){var _0x31ef77=_0x1b9e0d['params']['id'];var _0x51d321;var _0x1c8568;var _0x34cd17;return db[_0x6ec5('0x4a')][_0x6ec5('0xc8')]({'where':{'id':_0x31ef77}})[_0x6ec5('0x19')](function(_0x55fa60){_0x51d321=_0x55fa60;return db[_0x6ec5('0xc9')][_0x6ec5('0xc8')]({'where':{'id':_0x55fa60[_0x6ec5('0x85')]},'attributes':['id',_0x6ec5('0xca'),_0x6ec5('0xcb'),_0x6ec5('0xcc'),_0x6ec5('0xcd'),_0x6ec5('0xce')],'raw':!![]});})[_0x6ec5('0x19')](function(_0x2902f4){if(_0x2902f4&&_0x2902f4[_0x6ec5('0xca')]&&_0x2902f4[_0x6ec5('0xcb')]){_0x1c8568=_0x2902f4;var _0x280223={'interaction':{'id':_0x31ef77},'agent':{'id':_0x1b9e0d[_0x6ec5('0xa3')]['id'],'name':_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0x30')],'fullname':_0x1b9e0d['user']['fullname'],'email':_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0xcf')]},'contact':_0x1b9e0d[_0x6ec5('0x34')][_0x6ec5('0x35')],'account':_0x1b9e0d[_0x6ec5('0x34')][_0x6ec5('0x37')]};var _0x1e0c0f={'rejectUnauthorized':![],'method':_0x6ec5('0xd0'),'url':_0x6ec5('0xd1'),'headers':{'X-APIKEY':_0x2902f4[_0x6ec5('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1b9e0d[_0x6ec5('0xa3')][_0x6ec5('0xcf')]],'buttons':null,'topic':_0x1c8568[_0x6ec5('0xcc')],'note':_[_0x6ec5('0xd2')](_0x1c8568[_0x6ec5('0xcd')])?null:getMustacheRender(_0x1c8568['vidaooNote'],_0x280223),'metadata':null},'redirect':_0x6ec5('0xd3'),'json':!![]};try{if(!_[_0x6ec5('0xd2')](_0x1c8568[_0x6ec5('0xce')])){var _0x26e30f=getMustacheRender(_0x1c8568[_0x6ec5('0xce')],_0x280223);var _0x2dc668=JSON[_0x6ec5('0x88')](_0x26e30f);_0x1e0c0f[_0x6ec5('0x34')][_0x6ec5('0xd4')]=_0x2dc668;}}catch(_0x506acf){throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))](_0x6ec5('0xd6'));}return rp(_0x1e0c0f);}else{throw new db['Sequelize'][(_0x6ec5('0xd5'))](_0x6ec5('0xd7'));}})['then'](function(_0x5d2d61){_0x34cd17=_0x5d2d61;if(_0x34cd17['id']){var _0x5618ab={'body':_0x34cd17[_0x6ec5('0xd8')],'ChatWebsiteId':_0x1c8568['id'],'ChatInteractionId':_0x51d321['id'],'direction':_0x6ec5('0xd9'),'UserId':_0x1b9e0d['user']['id']};return db[_0x6ec5('0xda')]['create'](_0x5618ab,{});}else{throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x6ec5('0x19')](function(){return _0x51d321[_0x6ec5('0xdb')]({'vidaooSessionId':_0x34cd17['id']});})[_0x6ec5('0x19')](respondWithResult(_0x227438,null))[_0x6ec5('0x24')](handleError(_0x227438,null));};exports[_0x6ec5('0xdc')]=function(_0x40099c,_0x13f7b5){if(_0x40099c[_0x6ec5('0x34')]['id']){delete _0x40099c[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x40099c['params']['id']},'include':[{'model':db[_0x6ec5('0xdd')],'as':'Contact'}]})[_0x6ec5('0x19')](handleEntityNotFound(_0x13f7b5,null))[_0x6ec5('0x19')](saveUpdates(_0x40099c[_0x6ec5('0x34')],null))['then'](respondWithResult(_0x13f7b5,null))[_0x6ec5('0x24')](handleError(_0x13f7b5,null));};exports['abandon']=function(_0x11615,_0x425220){if(_0x11615[_0x6ec5('0x34')]['id']){delete _0x11615[_0x6ec5('0x34')]['id'];}return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x11615['params']['id']}})[_0x6ec5('0x19')](function(_0x58925f){if(!_0x58925f){logger[_0x6ec5('0x20')](_0x6ec5('0xde'),_0x6ec5('0xdf'),0x194,_0x6ec5('0xe0'));_0x425220['sendStatus'](0x194);}else{if(_0x58925f[_0x6ec5('0x46')]){throw new db[(_0x6ec5('0x99'))][(_0x6ec5('0xd5'))](_0x6ec5('0xe1'));}}return _0x58925f;})['then'](function(_0x17fdea){if(_0x17fdea){return _0x17fdea['update']({'closed':_0x11615[_0x6ec5('0x34')]['closed'],'disposition':_0x11615[_0x6ec5('0x34')][_0x6ec5('0x47')]})[_0x6ec5('0x19')](function(_0x15cb73){return _0x15cb73;});}})[_0x6ec5('0x19')](function(){return respondWithRpcPromise(_0x6ec5('0xe2'),_0x6ec5('0xdf'),_0x11615['body'],client9004);})[_0x6ec5('0x19')](respondWithResult(_0x425220,null))[_0x6ec5('0x24')](handleError(_0x425220,null));};exports[_0x6ec5('0xe3')]=function(_0x40e9a8,_0x181a77){_0x40e9a8[_0x6ec5('0x34')][_0x6ec5('0x30')]=_0x40e9a8[_0x6ec5('0xe4')]['originalname'];_0x40e9a8['body'][_0x6ec5('0xe5')]=_0x40e9a8['file'][_0x6ec5('0xe6')];_0x40e9a8[_0x6ec5('0x34')][_0x6ec5('0x7a')]=_0x40e9a8['file'][_0x6ec5('0xe7')];return db['Attachment'][_0x6ec5('0xc4')](_0x40e9a8[_0x6ec5('0x34')])[_0x6ec5('0x19')](respondWithResult(_0x181a77,0xc9))[_0x6ec5('0x24')](handleError(_0x181a77,null));};exports['attachmentDownload']=function(_0x2c5cc0,_0x534539){return db['ChatInteraction']['findOne']({'where':{'id':_0x2c5cc0[_0x6ec5('0xc5')]['id']},'raw':!![]})[_0x6ec5('0x19')](handleEntityNotFound(_0x534539,null))['then'](function(_0x2a6b59){if(_0x2a6b59){if(_0x2a6b59[_0x6ec5('0x44')]){return _0x534539[_0x6ec5('0x26')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x6ec5('0xe8')][_0x6ec5('0xc8')]({'where':{'id':_0x2c5cc0[_0x6ec5('0x4e')][_0x6ec5('0xe9')]},'raw':!![]})[_0x6ec5('0x19')](handleEntityNotFound(_0x534539,null));}})[_0x6ec5('0x19')](function(_0x1142fb){if(_0x1142fb){var _0x1253a0=_0x1142fb[_0x6ec5('0xea')]!==null;var _0x5d22b9=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0xed'));if(_0x1253a0){_0x5d22b9=path['join'](_0x5d22b9,'offline-chat/');}var _0x3ea6ae=path[_0x6ec5('0xeb')](_0x5d22b9,_0x1142fb[_0x6ec5('0xe5')]);return _0x534539[_0x6ec5('0xee')](_0x3ea6ae);}})[_0x6ec5('0x24')](handleError(_0x534539,null));};exports[_0x6ec5('0xef')]=function(_0x2d0aa9,_0x5c8eff){var _0x4fe4b1=null;var _0x499222=null;var _0x50d19a=null;if(_0x2d0aa9['body']['id']){delete _0x2d0aa9[_0x6ec5('0x34')]['id'];}if(_0x2d0aa9['body'][_0x6ec5('0xf0')]){_0x50d19a=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0xf1'),util['format'](_0x6ec5('0xf2'),Date[_0x6ec5('0xf3')]()));_0x2d0aa9[_0x6ec5('0x34')]['pathTranscript']=_0x50d19a;}return db['ChatInteraction'][_0x6ec5('0x70')]({'where':{'id':_0x2d0aa9[_0x6ec5('0xc5')]['id']},'include':[{'model':db[_0x6ec5('0xda')],'as':_0x6ec5('0xf4'),'include':[{'model':db['User'],'as':_0x6ec5('0x7f')}]}]})[_0x6ec5('0x19')](handleEntityNotFound(_0x5c8eff,null))[_0x6ec5('0x19')](saveUpdates(_0x2d0aa9[_0x6ec5('0x34')],null))['then'](function(_0x4e432a){if(_0x4e432a){_0x4fe4b1=_0x4e432a;return db['ChatWebsite'][_0x6ec5('0x70')]({'where':{'id':_0x4fe4b1[_0x6ec5('0x85')]}});}})[_0x6ec5('0x19')](function(_0x3c186d){if(_0x3c186d){_0x499222=_0x3c186d;return db[_0x6ec5('0xdd')][_0x6ec5('0x70')]({'where':{'id':_0x4fe4b1['ContactId']}});}})[_0x6ec5('0x19')](function(_0x47b3dc){if(_0x47b3dc){if(_0x50d19a){var _0x4256fc=null;for(var _0x1ad68c=0x1;_0x1ad68c<_0x4fe4b1['Messages'][_0x6ec5('0x6f')];++_0x1ad68c){_0x4256fc=_0x4fe4b1[_0x6ec5('0xf4')][_0x1ad68c];var _0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?util['format'](_0x6ec5('0xf5'),_0x499222[_0x6ec5('0xf6')],_0x4256fc['UserId']):_0x6ec5('0xf7');var _0x123754=_0x2d0aa9[_0x6ec5('0x34')][_0x6ec5('0xf8')]||util[_0x6ec5('0xf9')]('%s%d',_0x6ec5('0xfa'),_0x4256fc['ContactId']);switch(_0x499222[_0x6ec5('0xfb')]){case _0x6ec5('0xfc'):_0x2d95a3=_0x4256fc['UserId']?util[_0x6ec5('0xf9')](_0x6ec5('0xf5'),_0x499222['agentAlias'],_0x4256fc['UserId']):_0x6ec5('0xf7');break;case _0x6ec5('0xfd'):_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?_0x4256fc['User'][_0x6ec5('0xfe')]||_0x4256fc[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7');break;case _0x6ec5('0xff'):_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?_0x4256fc[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7');break;default:_0x2d95a3=_0x4256fc[_0x6ec5('0x46')]?util[_0x6ec5('0xf9')](_0x6ec5('0xf5'),_0x499222[_0x6ec5('0xf6')],_0x4256fc[_0x6ec5('0x46')]):_0x6ec5('0xf7');}var _0x366b80=util[_0x6ec5('0xf9')](_0x6ec5('0x100'),moment(_0x4256fc[_0x6ec5('0x101')])[_0x6ec5('0xf9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4256fc['direction']==='in'?_0x123754:_0x2d95a3,_0x4256fc[_0x6ec5('0x34')]);if(!_0x4256fc[_0x6ec5('0x102')]){fs[_0x6ec5('0x103')](_0x50d19a,_0x366b80);}}return db['MailAccount'][_0x6ec5('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x6ec5('0x104')],'as':_0x6ec5('0x105'),'raw':!![],'include':[{'model':db[_0x6ec5('0x106')],'as':_0x6ec5('0x106'),'raw':!![]}]}]});}}})[_0x6ec5('0x19')](function(_0x8b2ffd){if(!_0x8b2ffd||!_0x8b2ffd[_0x6ec5('0x105')]||!_0x2d0aa9[_0x6ec5('0x34')])return _0x4fe4b1;var _0xb90e78=_0x8b2ffd[_0x6ec5('0x107')]();return respondWithRpcPromise('SendMail',_0x6ec5('0x108'),{'account':_0xb90e78,'message':{'from':util['format'](_0x6ec5('0x109'),_0x8b2ffd['name'],_0x8b2ffd[_0x6ec5('0xcf')]||_0x8b2ffd[_0x6ec5('0x105')][_0x6ec5('0xa3')]),'to':_0x2d0aa9['body'][_0x6ec5('0xf0')],'subject':'Mail\x20Transcript','text':util[_0x6ec5('0xf9')](_0x6ec5('0x10a'),_0x2d0aa9[_0x6ec5('0x34')]['mailTranscript']),'attachments':[{'path':_0x50d19a}]}})[_0x6ec5('0x19')](function(){return _0x4fe4b1;})[_0x6ec5('0x24')](function(_0xd2b9ef){logger['error'](_0xd2b9ef);});})[_0x6ec5('0x19')](respondWithStatusCode(_0x5c8eff,0xc8))[_0x6ec5('0x24')](handleError(_0x5c8eff,null));};exports[_0x6ec5('0x10b')]=function(_0x1c7b04,_0xed8846){return db[_0x6ec5('0xda')]['find']({'where':{'id':_0x1c7b04[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0xed8846,null))[_0x6ec5('0x19')](function(_0x10e4d7){if(_0x10e4d7){return _0x10e4d7[_0x6ec5('0x10b')](_0x1c7b04[_0x6ec5('0x34')][_0x6ec5('0x10c')],_['omit'](_0x1c7b04['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xed8846,null))[_0x6ec5('0x24')](handleError(_0xed8846,null));};exports['getMessages']=function(_0x5a464d,_0x540592){var _0x3bf9ce={'raw':![],'where':{}};var _0x114ca4={};var _0x249219={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x5a464d['params']['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x540592,null))['then'](function(_0x212558){if(_0x212558){_0x114ca4[_0x6ec5('0x4d')]=_['keys'](db[_0x6ec5('0xda')][_0x6ec5('0x4b')]);_0x114ca4[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x5a464d[_0x6ec5('0x4e')]);_0x114ca4['filters']=_[_0x6ec5('0x51')](_0x114ca4['model'],_0x114ca4[_0x6ec5('0x4e')]);_0x3bf9ce[_0x6ec5('0x52')]=_['intersection'](_0x114ca4[_0x6ec5('0x4d')],qs[_0x6ec5('0xa9')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0xa9')]));_0x3bf9ce['attributes']=_0x3bf9ce[_0x6ec5('0x52')]['length']?_0x3bf9ce[_0x6ec5('0x52')]:_0x114ca4[_0x6ec5('0x4d')];if(!_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x3bf9ce[_0x6ec5('0x2a')]=qs[_0x6ec5('0x2a')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x2a')]);_0x3bf9ce[_0x6ec5('0x28')]=qs[_0x6ec5('0x28')](_0x5a464d['query']['offset']);}_0x3bf9ce[_0x6ec5('0x55')]=qs[_0x6ec5('0x56')](_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x3bf9ce['where']=qs[_0x6ec5('0x50')](_[_0x6ec5('0x58')](_0x5a464d[_0x6ec5('0x4e')],_0x114ca4[_0x6ec5('0x50')]));_0x3bf9ce[_0x6ec5('0x57')]['ChatInteractionId']=_0x212558['id'];if(_0x5a464d['query'][_0x6ec5('0x91')]){_0x3bf9ce[_0x6ec5('0x57')]=_['merge'](_0x3bf9ce[_0x6ec5('0x57')],{'$or':_[_0x6ec5('0x39')](_0x3bf9ce['attributes'],function(_0x22d09e){var _0x14d39d={};_0x14d39d[_0x22d09e]={'$like':'%'+_0x5a464d[_0x6ec5('0x4e')]['filter']+'%'};return _0x14d39d;})});}if(_0x5a464d['query'][_0x6ec5('0x10d')]){var _0x58eeb9=_0x5a464d[_0x6ec5('0x4e')][_0x6ec5('0x10d')][_0x6ec5('0x3d')](',');var _0x48ba54={};_0x48ba54[_0x58eeb9[0x0]]={'$gte':moment(_0x58eeb9[0x1])[_0x6ec5('0xf9')](_0x6ec5('0x10e'))};_0x3bf9ce[_0x6ec5('0x57')]=_[_0x6ec5('0x33')](_0x3bf9ce[_0x6ec5('0x57')],_0x48ba54);}_0x3bf9ce=_[_0x6ec5('0x33')]({},_0x3bf9ce,_0x5a464d[_0x6ec5('0xc3')]);return db[_0x6ec5('0xda')][_0x6ec5('0x2b')]({'where':_0x3bf9ce[_0x6ec5('0x57')]})['then'](function(_0x2984e1){_0x249219[_0x6ec5('0x2b')]=_0x2984e1;if(_0x5a464d[_0x6ec5('0x4e')]['includeAll']){_0x3bf9ce[_0x6ec5('0x10f')]=[{'all':!![]}];}return db[_0x6ec5('0xda')][_0x6ec5('0x110')](_0x3bf9ce);})[_0x6ec5('0x19')](function(_0x40beb9){_0x249219[_0x6ec5('0xc0')]=_0x40beb9;return _0x249219;});}})[_0x6ec5('0x19')](respondWithFilteredResult(_0x540592,_0x3bf9ce))[_0x6ec5('0x24')](handleError(_0x540592,null));};exports[_0x6ec5('0x111')]=function(_0x17d28a,_0x59bdf4){var _0x5ea009={'where':{}},_0xfdf0fb={},_0xb10dcd={'count':0x0,'rows':[]};return db[_0x6ec5('0x4a')][_0x6ec5('0xc8')]({'where':{'id':_0x17d28a[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x59bdf4,null))[_0x6ec5('0x19')](function(_0x4d6ae2){if(_0x4d6ae2){_0xfdf0fb[_0x6ec5('0x4d')]=_['keys'](db[_0x6ec5('0xda')][_0x6ec5('0x4b')]);_0xfdf0fb[_0x6ec5('0x4e')]=_[_0x6ec5('0x4f')](_0x17d28a[_0x6ec5('0x4e')]);_0xfdf0fb['filters']=_[_0x6ec5('0x51')](_0xfdf0fb['model'],_0xfdf0fb['query']);_0x5ea009[_0x6ec5('0x52')]=_[_0x6ec5('0x51')](_0xfdf0fb[_0x6ec5('0x4d')],qs['fields'](_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0xa9')]));_0x5ea009['attributes']=_0x5ea009['attributes']['length']?_0x5ea009['attributes']:_0xfdf0fb[_0x6ec5('0x4d')];if(!_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x53')](_0x6ec5('0x54'))){_0x5ea009[_0x6ec5('0x2a')]=qs['limit'](_0x17d28a[_0x6ec5('0x4e')]['limit']);_0x5ea009[_0x6ec5('0x28')]=qs['offset'](_0x17d28a['query'][_0x6ec5('0x28')]);}_0x5ea009[_0x6ec5('0x55')]=qs['sort'](_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x56')]);_0x5ea009[_0x6ec5('0x57')]=qs[_0x6ec5('0x50')](_['pick'](_0x17d28a[_0x6ec5('0x4e')],_0xfdf0fb[_0x6ec5('0x50')]));_0x5ea009[_0x6ec5('0x57')]['ChatInteractionId']=_0x4d6ae2['id'];if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x91')]){_0x5ea009['where']=_[_0x6ec5('0x33')](_0x5ea009['where'],{'$or':_['map'](_0x5ea009[_0x6ec5('0x52')],function(_0x28c57c){var _0x337c2b={};_0x337c2b[_0x28c57c]={'$like':'%'+_0x17d28a[_0x6ec5('0x4e')]['filter']+'%'};return _0x337c2b;})});}_0x5ea009[_0x6ec5('0x57')][_0x6ec5('0x102')]=![];if(_0x17d28a['query']['id']){_0x5ea009[_0x6ec5('0x57')]['id']={'$gt':_0x17d28a[_0x6ec5('0x4e')]['id']};}_0x5ea009=_[_0x6ec5('0x33')]({},_0x5ea009,_0x17d28a[_0x6ec5('0xc3')]);return db['ChatMessage'][_0x6ec5('0x2b')]({'where':_0x5ea009['where']})[_0x6ec5('0x19')](function(_0x51c78f){_0xb10dcd[_0x6ec5('0x2b')]=_0x51c78f;_0x5ea009[_0x6ec5('0x10f')]=[];if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0x112')]){_0x5ea009[_0x6ec5('0x10f')]['push']({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x7f'),'attributes':['id',_0x6ec5('0x3a'),_0x6ec5('0xfe')]});}if(_0x17d28a[_0x6ec5('0x4e')][_0x6ec5('0xc2')]){_0x5ea009[_0x6ec5('0x10f')]=[{'all':!![]}];}return db[_0x6ec5('0xda')]['findAll'](_0x5ea009);})['then'](function(_0x1f5371){_0xb10dcd[_0x6ec5('0xc0')]=_0x1f5371;return _0xb10dcd;});}})['then'](respondWithFilteredResult(_0x59bdf4,_0x5ea009))[_0x6ec5('0x24')](handleError(_0x59bdf4,null));};exports[_0x6ec5('0x113')]=function(_0x133a0c,_0x23d39e){return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x133a0c[_0x6ec5('0xc5')]['id']}})['then'](handleEntityNotFound(_0x23d39e,null))[_0x6ec5('0x19')](function(_0x39c1f3){if(_0x39c1f3){return _0x39c1f3[_0x6ec5('0x114')](_0x133a0c[_0x6ec5('0x34')]['ids'],_[_0x6ec5('0x115')](_0x133a0c[_0x6ec5('0x34')],[_0x6ec5('0x10c'),'id'])||{})[_0x6ec5('0x116')](function(){return db[_0x6ec5('0x7d')]['findAll']({'attributes':['id','name',_0x6ec5('0x5b')],'where':{'id':_0x133a0c[_0x6ec5('0x34')]['ids']}});})['then'](function(_0x5127c9){socket[_0x6ec5('0x117')](_0x6ec5('0x118'),{'id':Number(_0x133a0c[_0x6ec5('0xc5')]['id']),'tags':_0x5127c9||[]});return{'id':Number(_0x133a0c['params']['id']),'tags':_0x5127c9||[]};});}})[_0x6ec5('0x19')](respondWithResult(_0x23d39e,null))['catch'](handleError(_0x23d39e,null));};exports[_0x6ec5('0x119')]=function(_0x3a3ecc,_0x569b84){return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x3a3ecc[_0x6ec5('0xc5')]['id']}})[_0x6ec5('0x19')](handleEntityNotFound(_0x569b84,null))[_0x6ec5('0x19')](function(_0x49f6dd){if(_0x49f6dd){return _0x49f6dd['removeTags'](_0x3a3ecc[_0x6ec5('0x4e')][_0x6ec5('0x10c')]);}})[_0x6ec5('0x19')](respondWithStatusCode(_0x569b84,null))[_0x6ec5('0x24')](handleError(_0x569b84,null));};exports[_0x6ec5('0xee')]=function(_0x1b2cb6,_0x1af590){var _0x303b9b=moment()['unix']()[_0x6ec5('0xa7')]();var _0x14f55d=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],'server',_0x6ec5('0x11a'),'tmp');var _0x4a4e2=path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0x11b'),'files',_0x6ec5('0x11c'));var _0x49d151=path['join'](_0x14f55d,_0x303b9b);var _0x29fe92=util[_0x6ec5('0xf9')](_0x6ec5('0x11d'),_0x1b2cb6[_0x6ec5('0xc5')]['id'],_0x303b9b);var _0x5eeb97=path['join'](_0x14f55d,_0x29fe92);var _0x45d55c=[];_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x7f'),'attributes':['id',_0x6ec5('0x3a')],'raw':!![]});_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0xdd')],'as':'Contact','attributes':['id','firstName',_0x6ec5('0x11e')],'raw':!![]});if(_0x1b2cb6[_0x6ec5('0x4e')][_0x6ec5('0x11c')]){_0x45d55c[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0xe8')],'as':'Attachment','raw':!![]});}var _0x37f4e0=[{'model':db[_0x6ec5('0xda')],'as':_0x6ec5('0xf4'),'attributes':['id',_0x6ec5('0x34'),_0x6ec5('0x101'),_0x6ec5('0x11f'),_0x6ec5('0x102'),_0x6ec5('0x120')],'include':_0x45d55c}];_0x37f4e0['push']({'model':db[_0x6ec5('0xc9')],'as':_0x6ec5('0x121'),'attributes':['id',_0x6ec5('0x30')]});_0x37f4e0[_0x6ec5('0x3f')]({'model':db[_0x6ec5('0x7f')],'as':_0x6ec5('0x122'),'attributes':['id',_0x6ec5('0x3a')]});return db[_0x6ec5('0x4a')][_0x6ec5('0x70')]({'where':{'id':_0x1b2cb6[_0x6ec5('0xc5')]['id']},'include':_0x37f4e0})[_0x6ec5('0x19')](handleEntityNotFound(_0x1af590,null))['then'](function(_0x576168){if(_0x576168){var _0x1a70bf=_0x576168['get']({'plain':!![]});fs[_0x6ec5('0x123')](_0x49d151);var _0x3aae21={'channel':'Chat','account':_0x1a70bf['Account']['name'],'agent':_0x1a70bf[_0x6ec5('0x122')]?_0x1a70bf[_0x6ec5('0x122')][_0x6ec5('0x3a')]:_0x6ec5('0x124'),'createdAt':moment(_0x1a70bf[_0x6ec5('0x101')])[_0x6ec5('0xf9')](_0x6ec5('0x10e'))[_0x6ec5('0xa7')](),'closedAt':_0x1a70bf[_0x6ec5('0x44')]?moment(_0x1a70bf[_0x6ec5('0x125')])['format'](_0x6ec5('0x10e'))['toString']():'','disposition':_0x1a70bf[_0x6ec5('0x47')],'chatInfo':{'browser':_0x1a70bf[_0x6ec5('0x126')],'os':_0x1a70bf[_0x6ec5('0x127')],'referer':_0x1a70bf[_0x6ec5('0x128')],'customerIp':_0x1a70bf[_0x6ec5('0x129')],'customerPort':_0x1a70bf[_0x6ec5('0x12a')]?_0x1a70bf['customerPort']:_0x6ec5('0x124')},'messages':_(_0x1a70bf[_0x6ec5('0xf4')])['tail']()[_0x6ec5('0x91')]({'secret':![]})[_0x6ec5('0x39')](function(_0x3d417e){if(_0x3d417e[_0x6ec5('0xe8')]){var _0x31e1cc=path[_0x6ec5('0xeb')](_0x4a4e2,_0x3d417e[_0x6ec5('0xe8')][_0x6ec5('0xe5')]);if(fs[_0x6ec5('0x12b')](_0x31e1cc)){fs[_0x6ec5('0x12c')](_0x31e1cc)['pipe'](fs['createWriteStream'](path['join'](_0x49d151,_0x3d417e[_0x6ec5('0xe8')]['basename'])));}}return{'date':moment(_0x3d417e[_0x6ec5('0x101')])[_0x6ec5('0xf9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6ec5('0xa7')](),'sender':_0x3d417e['direction']===_0x6ec5('0xd9')?_0x3d417e[_0x6ec5('0x7f')]?_0x3d417e[_0x6ec5('0x7f')][_0x6ec5('0x3a')]:_0x6ec5('0xf7'):_0x3d417e['Contact'][_0x6ec5('0x12d')]+(_0x3d417e['Contact'][_0x6ec5('0x11e')]?'\x20'+_0x3d417e[_0x6ec5('0x75')][_0x6ec5('0x11e')]:''),'body':_0x3d417e['Attachment']?_0x3d417e[_0x6ec5('0xe8')][_0x6ec5('0xe5')]:_0x3d417e[_0x6ec5('0x34')],'direction':_0x3d417e[_0x6ec5('0x11f')]==='out'?'A':'C','secret':_0x3d417e[_0x6ec5('0x102')],'read':_0x3d417e['read'],'attachment':_0x3d417e['Attachment']};})[_0x6ec5('0x72')]()};return ejs['renderFile'](path[_0x6ec5('0xeb')](config[_0x6ec5('0xec')],_0x6ec5('0x11b'),_0x6ec5('0x12e'),_0x6ec5('0x12f')),{'interaction':_0x3aae21})[_0x6ec5('0x19')](function(_0x2d91d4){var _0x558c48=path[_0x6ec5('0xeb')](_0x49d151,'transcript-'+_0x1a70bf['id']+'-'+_0x303b9b+'.pdf');var _0x506a5e={'path':_0x558c48,'channel':_0x6ec5('0x130'),'interactionId':_0x1a70bf['id']};return pdf[_0x6ec5('0x131')](_0x2d91d4,_0x506a5e);})['then'](function(){return new Promise(function(_0x5cc6ab,_0x2f47bf){zipdir(_0x49d151,{'saveTo':_0x5eeb97},function(_0x10113c,_0x31ef83){if(_0x10113c)return _0x2f47bf(_0x10113c);return _0x5cc6ab(_0x31ef83);});})[_0x6ec5('0x19')](function(){return new BPromise(function(_0x479825,_0x31be2b){rimraf(_0x49d151,function(_0x11ac51){if(_0x11ac51)_0x31be2b(_0x11ac51);return _0x479825();});});})[_0x6ec5('0x19')](function(){return _0x1af590['download'](_0x5eeb97,_0x29fe92,function(_0x5bd5da){if(_0x5bd5da){logger['error'](_0x6ec5('0x132'),_0x5bd5da);}else{fs[_0x6ec5('0x133')](_0x5eeb97);}});});});}else{return _0x1af590['sendStatus'](0xc8);}})[_0x6ec5('0x24')](handleError(_0x1af590,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9429105..90d47b8 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 _0xdc99=['ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x3c6c6d,_0x272de5){var _0x548b8e=function(_0x3b90e2){while(--_0x3b90e2){_0x3c6c6d['push'](_0x3c6c6d['shift']());}};_0x548b8e(++_0x272de5);}(_0xdc99,0x184));var _0x9dc9=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xdc99[_0x95942];return _0x6d7f81;};'use strict';var EventEmitter=require(_0x9dc9('0x0'));var ChatInteraction=require(_0x9dc9('0x1'))['db'][_0x9dc9('0x2')];var ChatMessage=require(_0x9dc9('0x1'))['db'][_0x9dc9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9dc9('0x4'),'afterUpdate':'update','afterDestroy':_0x9dc9('0x5')};function emitEvent(_0x5be18b){return function(_0x13f215,_0x2e7df9,_0x4c4a4c){_0x13f215[_0x9dc9('0x6')]({'attributes':['id'],'raw':!![]})[_0x9dc9('0x7')](function(_0x51c06a){_0x13f215[_0x9dc9('0x8')](_0x9dc9('0x9'),_0x51c06a[_0x9dc9('0xa')](function(_0xd01579){return{'id':_0xd01579['id']};}));return ChatMessage[_0x9dc9('0xb')]({'where':{'ChatInteractionId':_0x13f215['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2acdf1){_0x13f215['setDataValue']('unreadMessages',_0x2acdf1['length']);ChatInteractionEvents['emit'](_0x5be18b+':'+_0x13f215['id'],_0x13f215);ChatInteractionEvents[_0x9dc9('0xc')](_0x5be18b,_0x13f215);_0x4c4a4c(null);})[_0x9dc9('0xd')](_0x4c4a4c(null));};}for(var e in events){if(events[_0x9dc9('0xe')](e)){var event=events[e];ChatInteraction[_0x9dc9('0xf')](e,emitEvent(event));}}module[_0x9dc9('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x20a4=['then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x20a4,0x1aa));var _0x420a=function(_0x3eb3ad,_0x2b3c21){_0x3eb3ad=_0x3eb3ad-0x0;var _0x1be5b8=_0x20a4[_0x3eb3ad];return _0x1be5b8;};'use strict';var EventEmitter=require(_0x420a('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x420a('0x1')];var ChatMessage=require(_0x420a('0x2'))['db'][_0x420a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x420a('0x4')](0x0);var events={'afterCreate':_0x420a('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x184a8){return function(_0x422156,_0x21f4d8,_0x284b8f){_0x422156['getUsers']({'attributes':['id'],'raw':!![]})[_0x420a('0x6')](function(_0x4ce72b){_0x422156[_0x420a('0x7')](_0x420a('0x8'),_0x4ce72b[_0x420a('0x9')](function(_0x50f8f8){return{'id':_0x50f8f8['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x422156['id'],'direction':'in','read':![]},'raw':!![]});})[_0x420a('0x6')](function(_0x2a0d2a){_0x422156[_0x420a('0x7')](_0x420a('0xa'),_0x2a0d2a['length']);ChatInteractionEvents[_0x420a('0xb')](_0x184a8+':'+_0x422156['id'],_0x422156);ChatInteractionEvents[_0x420a('0xb')](_0x184a8,_0x422156);_0x284b8f(null);})[_0x420a('0xc')](_0x284b8f(null));};}for(var e in events){if(events[_0x420a('0xd')](e)){var event=events[e];ChatInteraction[_0x420a('0xe')](e,emitEvent(event));}}module[_0x420a('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ba938c8..fcf2986 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 _0xd3ef=['path','rimraf','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3ef,0x8b));var _0xfd3e=function(_0x17b4e0,_0x28e167){_0x17b4e0=_0x17b4e0-0x0;var _0xc77cd8=_0xd3ef[_0x17b4e0];return _0xc77cd8;};'use strict';var _=require(_0xfd3e('0x0'));var util=require('util');var logger=require(_0xfd3e('0x1'))(_0xfd3e('0x2'));var moment=require('moment');var BPromise=require(_0xfd3e('0x3'));var rp=require(_0xfd3e('0x4'));var fs=require('fs');var path=require(_0xfd3e('0x5'));var rimraf=require(_0xfd3e('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x2e7ab8,_0x4f7830){return _0x2e7ab8['define']('ChatInteraction',attributes,{'tableName':_0xfd3e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cff83,_0x56526f,_0x3a16f2){if(_0x4cff83[_0xfd3e('0x8')]('closed')){_0x4cff83[_0xfd3e('0x9')]=moment()['format'](_0xfd3e('0xa'));}_0x3a16f2(null,_0x4cff83);}},'charset':_0xfd3e('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5633=['./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x313606,_0x141679){var _0x4e2617=function(_0x341f24){while(--_0x341f24){_0x313606['push'](_0x313606['shift']());}};_0x4e2617(++_0x141679);}(_0x5633,0x1aa));var _0x3563=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x5633[_0x2f3848];return _0x102668;};'use strict';var _=require('lodash');var util=require(_0x3563('0x0'));var logger=require(_0x3563('0x1'))(_0x3563('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3563('0x3'));var fs=require('fs');var path=require(_0x3563('0x4'));var rimraf=require(_0x3563('0x5'));var config=require('../../config/environment');var attributes=require(_0x3563('0x6'));module[_0x3563('0x7')]=function(_0xed0609,_0x1e81a9){return _0xed0609['define'](_0x3563('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x403780,_0xbd976f,_0x182839){if(_0x403780[_0x3563('0x9')](_0x3563('0xa'))){_0x403780[_0x3563('0xb')]=moment()[_0x3563('0xc')](_0x3563('0xd'));}_0x182839(null,_0x403780);}},'charset':_0x3563('0xe'),'collate':_0x3563('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c969158..cb369da 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 _0xe7b5=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug','stringify','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','ChatInteraction','body','options','raw','where','attributes','limit','UpdateChatInteraction','find','then','addTags','ids','spread','AddTags'];(function(_0x141ec6,_0xad8345){var _0x3f2557=function(_0x2096ca){while(--_0x2096ca){_0x141ec6['push'](_0x141ec6['shift']());}};_0x3f2557(++_0xad8345);}(_0xe7b5,0x126));var _0x5e7b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe7b5[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5e7b('0x0'));var util=require(_0x5e7b('0x1'));var moment=require(_0x5e7b('0x2'));var BPromise=require(_0x5e7b('0x3'));var rs=require(_0x5e7b('0x4'));var fs=require('fs');var Redis=require(_0x5e7b('0x5'));var db=require(_0x5e7b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e7b('0x7'))(_0x5e7b('0x8'));var config=require(_0x5e7b('0x9'));var jayson=require(_0x5e7b('0xa'));var client=jayson['client'][_0x5e7b('0xb')]({'port':0x232a});config[_0x5e7b('0xc')]=_[_0x5e7b('0xd')](config[_0x5e7b('0xc')],{'host':_0x5e7b('0xe'),'port':0x18eb});var socket=require(_0x5e7b('0xf'))(new Redis(config[_0x5e7b('0xc')]));require(_0x5e7b('0x10'))[_0x5e7b('0x11')](socket);function respondWithRpcPromise(_0x41ff9e,_0x1db3b2,_0x45a526){return new BPromise(function(_0x4b6756,_0x13e494){return client[_0x5e7b('0x12')](_0x41ff9e,_0x45a526)['then'](function(_0x431e7e){logger[_0x5e7b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x1db3b2,_0x5e7b('0x14'));logger[_0x5e7b('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1db3b2,_0x5e7b('0x14'),JSON[_0x5e7b('0x16')](_0x431e7e));if(_0x431e7e[_0x5e7b('0x17')]){if(_0x431e7e[_0x5e7b('0x17')]['code']===0x1f4){logger[_0x5e7b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1db3b2,_0x431e7e[_0x5e7b('0x17')][_0x5e7b('0x18')]);return _0x13e494(_0x431e7e['error'][_0x5e7b('0x18')]);}logger['error'](_0x5e7b('0x19'),_0x1db3b2,_0x431e7e['error']['message']);return _0x4b6756(_0x431e7e[_0x5e7b('0x17')][_0x5e7b('0x18')]);}else{logger[_0x5e7b('0x13')](_0x5e7b('0x19'),_0x1db3b2,_0x5e7b('0x14'));_0x4b6756(_0x431e7e[_0x5e7b('0x1a')]['message']);}})[_0x5e7b('0x1b')](function(_0x2992d2){logger['error'](_0x5e7b('0x19'),_0x1db3b2,_0x2992d2);_0x13e494(_0x2992d2);});});}exports['UpdateChatInteraction']=function(_0x1c37b6){var _0x2b104f=this;return new Promise(function(_0x5c9f8b,_0x107b9c){return db[_0x5e7b('0x1c')]['update'](_0x1c37b6[_0x5e7b('0x1d')],{'raw':_0x1c37b6[_0x5e7b('0x1e')]?_0x1c37b6[_0x5e7b('0x1e')][_0x5e7b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c37b6[_0x5e7b('0x1e')]?_0x1c37b6[_0x5e7b('0x1e')][_0x5e7b('0x20')]||null:null,'attributes':_0x1c37b6[_0x5e7b('0x1e')]?_0x1c37b6[_0x5e7b('0x1e')][_0x5e7b('0x21')]||null:null,'limit':_0x1c37b6[_0x5e7b('0x1e')]?_0x1c37b6[_0x5e7b('0x1e')][_0x5e7b('0x22')]||null:null})['then'](function(_0x230f41){logger[_0x5e7b('0x13')](_0x5e7b('0x23'),_0x1c37b6);logger['debug'](_0x5e7b('0x23'),_0x1c37b6,JSON[_0x5e7b('0x16')](_0x230f41));_0x5c9f8b(_0x230f41);})[_0x5e7b('0x1b')](function(_0x641b1f){logger[_0x5e7b('0x17')]('UpdateChatInteraction',_0x641b1f[_0x5e7b('0x18')],_0x1c37b6);_0x107b9c(_0x2b104f[_0x5e7b('0x17')](0x1f4,_0x641b1f[_0x5e7b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0xbb0b92){return new Promise(function(_0x525519,_0x50f670){return db[_0x5e7b('0x1c')][_0x5e7b('0x24')]({'where':_0xbb0b92[_0x5e7b('0x1e')]?_0xbb0b92[_0x5e7b('0x1e')]['where']||null:null})[_0x5e7b('0x25')](function(_0x5ebaab){if(_0x5ebaab){return _0x5ebaab[_0x5e7b('0x26')](_0xbb0b92['body']['ids'],_['omit'](_0xbb0b92['body'],[_0x5e7b('0x27'),'id'])||{});}})[_0x5e7b('0x28')](function(_0x235ea6){logger[_0x5e7b('0x13')]('AddTags',_0xbb0b92);logger[_0x5e7b('0x15')](_0x5e7b('0x29'),_0xbb0b92,JSON[_0x5e7b('0x16')](_0x235ea6));_0x525519(_0x235ea6);})[_0x5e7b('0x1b')](function(_0x2043d6){logger[_0x5e7b('0x17')](_0x5e7b('0x29'),_0x2043d6[_0x5e7b('0x18')],_0xbb0b92);_0x50f670(_this[_0x5e7b('0x17')](0x1f4,_0x2043d6[_0x5e7b('0x18')]));});});}; \ No newline at end of file +var _0x4c9b=['message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','then','AddTagsToChatInteraction','addTags','ids','body','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0x4c9b,0x13f));var _0xb4c9=function(_0x381f6c,_0x1a05af){_0x381f6c=_0x381f6c-0x0;var _0x4e5295=_0x4c9b[_0x381f6c];return _0x4e5295;};'use strict';var _=require(_0xb4c9('0x0'));var util=require(_0xb4c9('0x1'));var moment=require(_0xb4c9('0x2'));var BPromise=require(_0xb4c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4c9('0x4'));var logger=require(_0xb4c9('0x5'))(_0xb4c9('0x6'));var config=require(_0xb4c9('0x7'));var jayson=require(_0xb4c9('0x8'));var client=jayson[_0xb4c9('0x9')][_0xb4c9('0xa')]({'port':0x232a});config[_0xb4c9('0xb')]=_[_0xb4c9('0xc')](config['redis'],{'host':_0xb4c9('0xd'),'port':0x18eb});var socket=require(_0xb4c9('0xe'))(new Redis(config[_0xb4c9('0xb')]));require(_0xb4c9('0xf'))[_0xb4c9('0x10')](socket);function respondWithRpcPromise(_0x367061,_0x48607f,_0x6e5f2a){return new BPromise(function(_0x4eee5b,_0x34de9f){return client[_0xb4c9('0x11')](_0x367061,_0x6e5f2a)['then'](function(_0x459838){logger['info'](_0xb4c9('0x12'),_0x48607f,_0xb4c9('0x13'));logger[_0xb4c9('0x14')](_0xb4c9('0x15'),_0x48607f,_0xb4c9('0x13'),JSON[_0xb4c9('0x16')](_0x459838));if(_0x459838[_0xb4c9('0x17')]){if(_0x459838[_0xb4c9('0x17')][_0xb4c9('0x18')]===0x1f4){logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);return _0x34de9f(_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);}logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x459838[_0xb4c9('0x17')][_0xb4c9('0x19')]);return _0x4eee5b(_0x459838[_0xb4c9('0x17')]['message']);}else{logger[_0xb4c9('0x1a')](_0xb4c9('0x12'),_0x48607f,_0xb4c9('0x13'));_0x4eee5b(_0x459838[_0xb4c9('0x1b')][_0xb4c9('0x19')]);}})[_0xb4c9('0x1c')](function(_0x4f7130){logger[_0xb4c9('0x17')](_0xb4c9('0x12'),_0x48607f,_0x4f7130);_0x34de9f(_0x4f7130);});});}exports[_0xb4c9('0x1d')]=function(_0x4cd906){var _0x52eaa7=this;return new Promise(function(_0x480964,_0x2e237a){return db[_0xb4c9('0x1e')][_0xb4c9('0x1f')](_0x4cd906['body'],{'raw':_0x4cd906['options']?_0x4cd906[_0xb4c9('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd906[_0xb4c9('0x20')]?_0x4cd906[_0xb4c9('0x20')][_0xb4c9('0x21')]||null:null,'attributes':_0x4cd906['options']?_0x4cd906['options'][_0xb4c9('0x22')]||null:null,'limit':_0x4cd906[_0xb4c9('0x20')]?_0x4cd906['options'][_0xb4c9('0x23')]||null:null})[_0xb4c9('0x24')](function(_0x3393d5){logger[_0xb4c9('0x1a')](_0xb4c9('0x1d'),_0x4cd906);logger[_0xb4c9('0x14')](_0xb4c9('0x1d'),_0x4cd906,JSON[_0xb4c9('0x16')](_0x3393d5));_0x480964(_0x3393d5);})['catch'](function(_0x320493){logger['error'](_0xb4c9('0x1d'),_0x320493[_0xb4c9('0x19')],_0x4cd906);_0x2e237a(_0x52eaa7['error'](0x1f4,_0x320493[_0xb4c9('0x19')]));});});};exports[_0xb4c9('0x25')]=function(_0x59625f){return new Promise(function(_0x596fc0,_0xc7dff){return db[_0xb4c9('0x1e')]['find']({'where':_0x59625f[_0xb4c9('0x20')]?_0x59625f[_0xb4c9('0x20')][_0xb4c9('0x21')]||null:null})['then'](function(_0x20cd38){if(_0x20cd38){return _0x20cd38[_0xb4c9('0x26')](_0x59625f['body'][_0xb4c9('0x27')],_['omit'](_0x59625f[_0xb4c9('0x28')],[_0xb4c9('0x27'),'id'])||{});}})[_0xb4c9('0x29')](function(_0x4b9c10){logger[_0xb4c9('0x1a')](_0xb4c9('0x2a'),_0x59625f);logger[_0xb4c9('0x14')](_0xb4c9('0x2a'),_0x59625f,JSON['stringify'](_0x4b9c10));_0x596fc0(_0x4b9c10);})['catch'](function(_0x449cca){logger['error'](_0xb4c9('0x2a'),_0x449cca['message'],_0x59625f);_0xc7dff(_this[_0xb4c9('0x17')](0x1f4,_0x449cca[_0xb4c9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 62e111e..b749a3f 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 _0x149c=['register','length','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x3e5af4,_0x26df55){var _0x3ce6fa=function(_0x54e4ef){while(--_0x54e4ef){_0x3e5af4['push'](_0x3e5af4['shift']());}};_0x3ce6fa(++_0x26df55);}(_0x149c,0x143));var _0xc149=function(_0x3fd859,_0x41439d){_0x3fd859=_0x3fd859-0x0;var _0x19c4bb=_0x149c[_0x3fd859];return _0x19c4bb;};'use strict';var ChatInteractionEvents=require(_0xc149('0x0'));var events=['save',_0xc149('0x1'),_0xc149('0x2')];function createListener(_0x35e9b8,_0x4f5a90){return function(_0x3b8ac6){_0x4f5a90[_0xc149('0x3')](_0x35e9b8,_0x3b8ac6);};}function removeListener(_0x19a7cb,_0x298415){return function(){ChatInteractionEvents[_0xc149('0x4')](_0x19a7cb,_0x298415);};}exports[_0xc149('0x5')]=function(_0x3b5e34){for(var _0x5e9b5c=0x0,_0x578cec=events[_0xc149('0x6')];_0x5e9b5c<_0x578cec;_0x5e9b5c++){var _0x34710e=events[_0x5e9b5c];var _0x3a1739=createListener(_0xc149('0x7')+_0x34710e,_0x3b5e34);ChatInteractionEvents['on'](_0x34710e,_0x3a1739);}}; \ No newline at end of file +var _0x17aa=['remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x4d164,_0x3e017){var _0x255655=function(_0x1d1fe1){while(--_0x1d1fe1){_0x4d164['push'](_0x4d164['shift']());}};_0x255655(++_0x3e017);}(_0x17aa,0x1b9));var _0xa17a=function(_0x2b9c40,_0xc887fe){_0x2b9c40=_0x2b9c40-0x0;var _0x520731=_0x17aa[_0x2b9c40];return _0x520731;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xa17a('0x0'),_0xa17a('0x1')];function createListener(_0x47e0c5,_0x5ac595){return function(_0x199d48){_0x5ac595[_0xa17a('0x2')](_0x47e0c5,_0x199d48);};}function removeListener(_0x2b8517,_0x15ba36){return function(){ChatInteractionEvents[_0xa17a('0x3')](_0x2b8517,_0x15ba36);};}exports[_0xa17a('0x4')]=function(_0x56d1a7){for(var _0x118006=0x0,_0x22092b=events[_0xa17a('0x5')];_0x118006<_0x22092b;_0x118006++){var _0x3dc2ba=events[_0x118006];var _0xfb6316=createListener(_0xa17a('0x6')+_0x3dc2ba,_0x56d1a7);ChatInteractionEvents['on'](_0x3dc2ba,_0xfb6316);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index bba2d95..def9f38 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 _0xe13f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','%s-%s','now','originalname','replace','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x22c4d7,_0x519ab3){var _0x2345ec=function(_0x320a08){while(--_0x320a08){_0x22c4d7['push'](_0x22c4d7['shift']());}};_0x2345ec(++_0x519ab3);}(_0xe13f,0x1c7));var _0xfe13=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe13f[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xfe13('0x0'));var util=require(_0xfe13('0x1'));var path=require(_0xfe13('0x2'));var timeout=require(_0xfe13('0x3'));var express=require(_0xfe13('0x4'));var router=express[_0xfe13('0x5')]();var fs_extra=require(_0xfe13('0x6'));var auth=require(_0xfe13('0x7'));var interaction=require(_0xfe13('0x8'));var config=require(_0xfe13('0x9'));var controller=require('./chatInteraction.controller');router[_0xfe13('0xa')]('/',auth['isAuthenticated'](),controller[_0xfe13('0xb')]);router['get']('/describe',auth[_0xfe13('0xc')](),controller[_0xfe13('0xd')]);router[_0xfe13('0xa')](_0xfe13('0xe'),auth[_0xfe13('0xf')](),controller[_0xfe13('0x10')]);router['get'](_0xfe13('0x11'),auth[_0xfe13('0xf')](),controller[_0xfe13('0x12')]);router['get'](_0xfe13('0x13'),auth[_0xfe13('0xc')](),controller['getMessages']);router[_0xfe13('0xa')](_0xfe13('0x14'),auth[_0xfe13('0xf')](),controller[_0xfe13('0x15')]);router['get'](_0xfe13('0x16'),auth[_0xfe13('0xc')](),controller['download']);router[_0xfe13('0x17')]('/',auth[_0xfe13('0xc')](),controller['create']);router['post'](_0xfe13('0x18'),auth[_0xfe13('0xc')](),controller[_0xfe13('0x19')]);var upload=multer({'storage':multer[_0xfe13('0x1a')]({'destination':function(_0xe73ff4,_0x4b9efe,_0x32c840){_0x32c840(null,path[_0xfe13('0x1b')](config['root'],'server/files/attachments/'));},'filename':function(_0x56d48a,_0x448d1a,_0x3d0002){_0x3d0002(null,util['format'](_0xfe13('0x1c'),Date[_0xfe13('0x1d')](),_0x448d1a[_0xfe13('0x1e')][_0xfe13('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfe13('0x17')]('/:id/attachment_upload',upload['single'](_0xfe13('0x20')),controller[_0xfe13('0x21')]);router[_0xfe13('0x17')](_0xfe13('0x13'),auth[_0xfe13('0xf')](),controller[_0xfe13('0x22')]);router[_0xfe13('0x17')]('/:id/tags',auth[_0xfe13('0xc')](),interaction[_0xfe13('0x23')](_0xfe13('0x24'),_0xfe13('0x25')),controller[_0xfe13('0x26')]);router[_0xfe13('0x27')](_0xfe13('0xe'),auth[_0xfe13('0xc')](),interaction['tracked'](_0xfe13('0x24'),_0xfe13('0x28')),controller['update']);router['put'](_0xfe13('0x29'),controller[_0xfe13('0x2a')]);router[_0xfe13('0x27')](_0xfe13('0x2b'),auth[_0xfe13('0xf')](),controller['abandon']);router[_0xfe13('0x27')](_0xfe13('0x2c'),controller['close']);router[_0xfe13('0x2d')](_0xfe13('0xe'),auth[_0xfe13('0xc')](),interaction[_0xfe13('0x23')](_0xfe13('0x24'),_0xfe13('0x2e')),controller[_0xfe13('0x2f')]);router[_0xfe13('0x2d')](_0xfe13('0x30'),auth[_0xfe13('0xc')](),controller[_0xfe13('0x31')]);module[_0xfe13('0x32')]=router; \ No newline at end of file +var _0xe738=['tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload'];(function(_0x592af0,_0x6c7240){var _0x24ead5=function(_0x468ea0){while(--_0x468ea0){_0x592af0['push'](_0x592af0['shift']());}};_0x24ead5(++_0x6c7240);}(_0xe738,0x76));var _0x8e73=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe738[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0x8e73('0x0'));var util=require(_0x8e73('0x1'));var path=require(_0x8e73('0x2'));var timeout=require(_0x8e73('0x3'));var express=require(_0x8e73('0x4'));var router=express['Router']();var fs_extra=require(_0x8e73('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e73('0x6'));var config=require(_0x8e73('0x7'));var controller=require(_0x8e73('0x8'));router[_0x8e73('0x9')]('/',auth[_0x8e73('0xa')](),controller['index']);router['get'](_0x8e73('0xb'),auth['isAuthenticated'](),controller[_0x8e73('0xc')]);router[_0x8e73('0x9')](_0x8e73('0xd'),auth[_0x8e73('0xe')](),controller['show']);router[_0x8e73('0x9')](_0x8e73('0xf'),auth[_0x8e73('0xe')](),controller[_0x8e73('0x10')]);router[_0x8e73('0x9')](_0x8e73('0x11'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x12')]);router[_0x8e73('0x9')]('/:id/my_messages',auth[_0x8e73('0xe')](),controller[_0x8e73('0x13')]);router[_0x8e73('0x9')](_0x8e73('0x14'),auth[_0x8e73('0xa')](),controller['download']);router[_0x8e73('0x15')]('/',auth[_0x8e73('0xa')](),controller[_0x8e73('0x16')]);router['post'](_0x8e73('0x17'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x18')]);var upload=multer({'storage':multer[_0x8e73('0x19')]({'destination':function(_0x80da98,_0x25fac7,_0x304bb2){_0x304bb2(null,path[_0x8e73('0x1a')](config[_0x8e73('0x1b')],'server/files/attachments/'));},'filename':function(_0x391227,_0x1605de,_0x458693){_0x458693(null,util[_0x8e73('0x1c')](_0x8e73('0x1d'),Date[_0x8e73('0x1e')](),_0x1605de['originalname'][_0x8e73('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x8e73('0x20'),upload['single'](_0x8e73('0x21')),controller[_0x8e73('0x22')]);router['post'](_0x8e73('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x8e73('0x15')]('/:id/tags',auth[_0x8e73('0xa')](),interaction[_0x8e73('0x23')](_0x8e73('0x24'),_0x8e73('0x25')),controller[_0x8e73('0x26')]);router[_0x8e73('0x27')](_0x8e73('0xd'),auth['isAuthenticated'](),interaction[_0x8e73('0x23')]('chat',_0x8e73('0x28')),controller['update']);router[_0x8e73('0x27')](_0x8e73('0x29'),controller[_0x8e73('0x2a')]);router[_0x8e73('0x27')](_0x8e73('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x8e73('0x2c')]);router[_0x8e73('0x27')]('/:id/close',controller[_0x8e73('0x2d')]);router[_0x8e73('0x2e')](_0x8e73('0xd'),auth['isAuthenticated'](),interaction[_0x8e73('0x23')](_0x8e73('0x24'),'chatinteraction:destroy'),controller[_0x8e73('0x2f')]);router['delete'](_0x8e73('0x30'),auth[_0x8e73('0xa')](),controller[_0x8e73('0x31')]);module[_0x8e73('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index a80c4b2..f46ec2f 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 _0xd624=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x139afd,_0x149c95){var _0x5edee6=function(_0x46b2a7){while(--_0x46b2a7){_0x139afd['push'](_0x139afd['shift']());}};_0x5edee6(++_0x149c95);}(_0xd624,0x1df));var _0x4d62=function(_0x160bbb,_0x566aa9){_0x160bbb=_0x160bbb-0x0;var _0x3e08ee=_0xd624[_0x160bbb];return _0x3e08ee;};'use strict';var Sequelize=require(_0x4d62('0x0'));module['exports']={'body':{'type':Sequelize[_0x4d62('0x1')](_0x4d62('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4d62('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4d62('0x4')]}}; \ No newline at end of file +var _0xae7e=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae7e,0x148));var _0xeae7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xae7e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xeae7('0x0'));module['exports']={'body':{'type':Sequelize[_0xeae7('0x1')](_0xeae7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xeae7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeae7('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 730b5aa..6ecee8d 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 _0x534c=['nolimit','limit','order','sort','where','pick','filter','merge','map','type','includeAll','include','ChatInternalMessage','findAll','rows','catch','keys','create','update','body','find','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','length','FromId','ToId','read','-createdAt','all','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','destroy','then','error','name','index','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','hasOwnProperty'];(function(_0x6b888e,_0x420fed){var _0x17d0f6=function(_0x42675a){while(--_0x42675a){_0x6b888e['push'](_0x6b888e['shift']());}};_0x17d0f6(++_0x420fed);}(_0x534c,0xa5));var _0xc534=function(_0x3642ab,_0x8a4456){_0x3642ab=_0x3642ab-0x0;var _0x5663e8=_0x534c[_0x3642ab];return _0x5663e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc534('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc534('0x1'));var moment=require(_0xc534('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc534('0x3'));var util=require(_0xc534('0x4'));var path=require(_0xc534('0x5'));var sox=require(_0xc534('0x6'));var csv=require('to-csv');var ejs=require(_0xc534('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc534('0x8'));var squel=require('squel');var crypto=require(_0xc534('0x9'));var jsforce=require(_0xc534('0xa'));var deskjs=require(_0xc534('0xb'));var toCsv=require(_0xc534('0xc'));var querystring=require('querystring');var Papa=require(_0xc534('0xd'));var Redis=require('ioredis');var authService=require(_0xc534('0xe'));var qs=require(_0xc534('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc534('0x10'));var logger=require(_0xc534('0x11'))(_0xc534('0x12'));var utils=require(_0xc534('0x13'));var config=require(_0xc534('0x14'));var licenseUtil=require(_0xc534('0x15'));var db=require('../../mysqldb')['db'];config[_0xc534('0x16')]=_['defaults'](config[_0xc534('0x16')],{'host':_0xc534('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc534('0x16')]));require(_0xc534('0x18'))[_0xc534('0x19')](socket);function respondWithStatusCode(_0x1b40a5,_0x21a559){_0x21a559=_0x21a559||0xcc;return function(_0x1662fc){if(_0x1662fc){return _0x1b40a5[_0xc534('0x1a')](_0x21a559);}return _0x1b40a5['status'](_0x21a559)[_0xc534('0x1b')]();};}function respondWithResult(_0x13bd79,_0x408de0){_0x408de0=_0x408de0||0xc8;return function(_0x2a6615){if(_0x2a6615){return _0x13bd79[_0xc534('0x1c')](_0x408de0)[_0xc534('0x1d')](_0x2a6615);}};}function respondWithFilteredResult(_0x40d417,_0x5c8cd5){return function(_0x4838c9){if(_0x4838c9){var _0x1cbcad=typeof _0x5c8cd5[_0xc534('0x1e')]===_0xc534('0x1f')&&typeof _0x5c8cd5['limit']==='undefined';var _0xd85978=_0x4838c9['count'];var _0x449eaa=_0x1cbcad?0x0:_0x5c8cd5['offset'];var _0x419c54=_0x1cbcad?_0x4838c9[_0xc534('0x20')]:_0x5c8cd5['offset']+_0x5c8cd5['limit'];var _0xa247eb;if(_0x419c54>=_0xd85978){_0x419c54=_0xd85978;_0xa247eb=0xc8;}else{_0xa247eb=0xce;}_0x40d417[_0xc534('0x1c')](_0xa247eb);return _0x40d417['set'](_0xc534('0x21'),_0x449eaa+'-'+_0x419c54+'/'+_0xd85978)[_0xc534('0x1d')](_0x4838c9);}return null;};}function patchUpdates(_0x1b80f5){return function(_0x10f0b2){try{jsonpatch[_0xc534('0x22')](_0x10f0b2,_0x1b80f5,!![]);}catch(_0x382131){return BPromise[_0xc534('0x23')](_0x382131);}return _0x10f0b2['save']();};}function saveUpdates(_0x5e6caf,_0x341262){return function(_0x2de5c1){if(_0x2de5c1){return _0x2de5c1['update'](_0x5e6caf)['then'](function(_0x3f155b){return _0x3f155b;});}return null;};}function removeEntity(_0x4b0909,_0x57d16b){return function(_0x39c859){if(_0x39c859){return _0x39c859[_0xc534('0x24')]()[_0xc534('0x25')](function(){_0x4b0909[_0xc534('0x1c')](0xcc)[_0xc534('0x1b')]();});}};}function handleEntityNotFound(_0x21e7fb,_0x216088){return function(_0x58edf4){if(!_0x58edf4){_0x21e7fb[_0xc534('0x1a')](0x194);}return _0x58edf4;};}function handleError(_0x385475,_0x4c9676){_0x4c9676=_0x4c9676||0x1f4;return function(_0x228f26){logger[_0xc534('0x26')](_0x228f26['stack']);if(_0x228f26[_0xc534('0x27')]){delete _0x228f26[_0xc534('0x27')];}_0x385475[_0xc534('0x1c')](_0x4c9676)['send'](_0x228f26);};}exports[_0xc534('0x28')]=function(_0x401997,_0x3e6bb6){var _0x2be6bb={},_0x17dedc={},_0x373ede={'count':0x0,'rows':[]};var _0x191308=_['map'](db['ChatInternalMessage'][_0xc534('0x29')],function(_0x31b8c2){return{'name':_0x31b8c2[_0xc534('0x2a')],'type':_0x31b8c2['type'][_0xc534('0x2b')]};});_0x17dedc['model']=_['map'](_0x191308,_0xc534('0x27'));_0x17dedc['query']=_['keys'](_0x401997['query']);_0x17dedc[_0xc534('0x2c')]=_[_0xc534('0x2d')](_0x17dedc[_0xc534('0x2e')],_0x17dedc[_0xc534('0x2f')]);_0x2be6bb[_0xc534('0x30')]=_[_0xc534('0x2d')](_0x17dedc['model'],qs['fields'](_0x401997[_0xc534('0x2f')][_0xc534('0x31')]));_0x2be6bb[_0xc534('0x30')]=_0x2be6bb[_0xc534('0x30')]['length']?_0x2be6bb[_0xc534('0x30')]:_0x17dedc[_0xc534('0x2e')];if(!_0x401997[_0xc534('0x2f')][_0xc534('0x32')](_0xc534('0x33'))){_0x2be6bb[_0xc534('0x34')]=qs['limit'](_0x401997[_0xc534('0x2f')][_0xc534('0x34')]);_0x2be6bb[_0xc534('0x1e')]=qs[_0xc534('0x1e')](_0x401997[_0xc534('0x2f')]['offset']);}_0x2be6bb[_0xc534('0x35')]=qs[_0xc534('0x36')](_0x401997['query'][_0xc534('0x36')]);_0x2be6bb[_0xc534('0x37')]=qs[_0xc534('0x2c')](_[_0xc534('0x38')](_0x401997[_0xc534('0x2f')],_0x17dedc[_0xc534('0x2c')]),_0x191308);if(_0x401997[_0xc534('0x2f')][_0xc534('0x39')]){_0x2be6bb[_0xc534('0x37')]=_[_0xc534('0x3a')](_0x2be6bb[_0xc534('0x37')],{'$or':_[_0xc534('0x3b')](_0x191308,function(_0xa56158){if(_0xa56158[_0xc534('0x3c')]!=='VIRTUAL'){var _0x4c443e={};_0x4c443e[_0xa56158[_0xc534('0x27')]]={'$like':'%'+_0x401997['query'][_0xc534('0x39')]+'%'};return _0x4c443e;}})});}_0x2be6bb=_[_0xc534('0x3a')]({},_0x2be6bb,_0x401997['options']);var _0x5f4ed8={'where':_0x2be6bb[_0xc534('0x37')]};return db['ChatInternalMessage'][_0xc534('0x20')](_0x5f4ed8)['then'](function(_0x2e775f){_0x373ede[_0xc534('0x20')]=_0x2e775f;if(_0x401997[_0xc534('0x2f')][_0xc534('0x3d')]){_0x2be6bb[_0xc534('0x3e')]=[{'all':!![]}];}return db[_0xc534('0x3f')][_0xc534('0x40')](_0x2be6bb);})[_0xc534('0x25')](function(_0x2e7e92){_0x373ede[_0xc534('0x41')]=_0x2e7e92;return _0x373ede;})[_0xc534('0x25')](respondWithFilteredResult(_0x3e6bb6,_0x2be6bb))[_0xc534('0x42')](handleError(_0x3e6bb6,null));};exports['show']=function(_0x21533b,_0x12d50d){var _0xf1464e={'raw':!![],'where':{'id':_0x21533b['params']['id']}},_0x27a835={};_0x27a835[_0xc534('0x2e')]=_[_0xc534('0x43')](db[_0xc534('0x3f')]['rawAttributes']);_0x27a835[_0xc534('0x2f')]=_[_0xc534('0x43')](_0x21533b[_0xc534('0x2f')]);_0x27a835[_0xc534('0x2c')]=_['intersection'](_0x27a835[_0xc534('0x2e')],_0x27a835[_0xc534('0x2f')]);_0xf1464e[_0xc534('0x30')]=_[_0xc534('0x2d')](_0x27a835['model'],qs[_0xc534('0x31')](_0x21533b['query'][_0xc534('0x31')]));_0xf1464e[_0xc534('0x30')]=_0xf1464e['attributes']['length']?_0xf1464e[_0xc534('0x30')]:_0x27a835['model'];if(_0x21533b[_0xc534('0x2f')][_0xc534('0x3d')]){_0xf1464e[_0xc534('0x3e')]=[{'all':!![]}];}_0xf1464e=_[_0xc534('0x3a')]({},_0xf1464e,_0x21533b['options']);return db[_0xc534('0x3f')]['find'](_0xf1464e)[_0xc534('0x25')](handleEntityNotFound(_0x12d50d,null))[_0xc534('0x25')](respondWithResult(_0x12d50d,null))['catch'](handleError(_0x12d50d,null));};exports[_0xc534('0x44')]=function(_0x5bebf9,_0x16b463){return db['ChatInternalMessage'][_0xc534('0x44')](_0x5bebf9['body'],{})[_0xc534('0x25')](respondWithResult(_0x16b463,0xc9))[_0xc534('0x42')](handleError(_0x16b463,null));};exports[_0xc534('0x45')]=function(_0x3427bf,_0x1fbc48){if(_0x3427bf[_0xc534('0x46')]['id']){delete _0x3427bf[_0xc534('0x46')]['id'];}return db[_0xc534('0x3f')][_0xc534('0x47')]({'where':{'id':_0x3427bf[_0xc534('0x48')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x1fbc48,null))[_0xc534('0x25')](saveUpdates(_0x3427bf[_0xc534('0x46')],null))['then'](respondWithResult(_0x1fbc48,null))[_0xc534('0x42')](handleError(_0x1fbc48,null));};exports[_0xc534('0x24')]=function(_0x22cccc,_0x50f2b3){return db[_0xc534('0x3f')]['find']({'where':{'id':_0x22cccc[_0xc534('0x48')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x50f2b3,null))[_0xc534('0x25')](removeEntity(_0x50f2b3,null))[_0xc534('0x42')](handleError(_0x50f2b3,null));};exports[_0xc534('0x49')]=function(_0x206294,_0x26fcf4){return db[_0xc534('0x3f')][_0xc534('0x49')]()['then'](respondWithResult(_0x26fcf4,null))['catch'](handleError(_0x26fcf4,null));};function wrapUser(_0x6529b4){return function(_0x70775c){var _0x4e8250=_0x6529b4[_0xc534('0x4a')]({'plain':!![]});_0x4e8250[_0xc534('0x4b')]=[];if(_0x70775c){_0x4e8250[_0xc534('0x4c')]=_0x70775c[_0xc534('0x4d')];_0x4e8250['lastMessage']=_0x70775c;}else{_0x4e8250['lastMessageAt']=moment(0x0)[_0xc534('0x4e')](_0xc534('0x4f'));_0x4e8250[_0xc534('0x50')]={};}return _0x4e8250;};}exports['getUsers']=function(_0x15738b,_0xbbfb8d,_0x160cba){var _0x86fe8c=[];return db[_0xc534('0x51')][_0xc534('0x40')]({'where':{'role':['agent',_0xc534('0x52'),_0xc534('0x53')]},'attributes':['id',_0xc534('0x54'),_0xc534('0x27'),'role',_0xc534('0x55'),_0xc534('0x56'),_0xc534('0x57'),_0xc534('0x58'),_0xc534('0x59'),'showWebBar'],'order':qs['sort'](_0xc534('0x5a')),'include':[{'model':db[_0xc534('0x5b')],'as':_0xc534('0x5c'),'attributes':['id',_0xc534('0x27'),'type'],'through':{'attributes':[]}}]})[_0xc534('0x25')](function(_0x3c06e8){if(_0x3c06e8){var _0x1f3d38=_0x15738b[_0xc534('0x53')][_0xc534('0x4a')]({'plain':!![]});if(!_0x1f3d38)throw new Error(_0xc534('0x5d'));if(_0x1f3d38[_0xc534('0x5e')]===_0xc534('0x53')){return db[_0xc534('0x5f')][_0xc534('0x47')]({'where':{'name':_0xc534('0x60'),'userProfileId':_0x1f3d38[_0xc534('0x61')]},'raw':!![]})[_0xc534('0x25')](function(_0x5be14c){if(_0x5be14c){if(_0x5be14c[_0xc534('0x62')]===0x0){return db[_0xc534('0x63')]['findAll']({'where':{'sectionId':_0x5be14c['id']},'raw':!![]})[_0xc534('0x25')](function(_0x22df9e){var _0x2da731=[];if(_[_0xc534('0x64')](_0x22df9e)){_0x2da731=_['filter'](_0x3c06e8,function(_0x43a909){if(_0x43a909[_0xc534('0x5e')]!==_0xc534('0x65')){return _0x43a909;}});return _0x2da731;}else{for(var _0x596f43=0x0;_0x596f43<_0x3c06e8[_0xc534('0x66')];_0x596f43++){var _0x5d93c6=_0x3c06e8[_0x596f43];if(_0x5d93c6[_0xc534('0x5e')]===_0xc534('0x65')){var _0x1ac2c6=_['find'](_0x22df9e,function(_0x563664){return _0x563664['resourceId']===_0x5d93c6['id'];});if(_0x1ac2c6)_0x2da731['push'](_0x5d93c6);}else{_0x2da731['push'](_0x5d93c6);}}return _0x2da731;}});}else{return _0x3c06e8;}}else{var _0x325202=_[_0xc534('0x39')](_0x3c06e8,function(_0x2c9d8e){if(_0x2c9d8e['role']!=='agent'){return _0x2c9d8e;}});return _0x325202;}});}else{return _0x3c06e8;}}})['then'](function(_0x28a4d0){var _0xced9ee=[];if(_0x28a4d0){_0x86fe8c=_0x28a4d0;for(var _0x49fb1c=0x0;_0x49fb1c<_0x28a4d0[_0xc534('0x66')];_0x49fb1c+=0x1){_0x86fe8c[_0x49fb1c][_0xc534('0x4b')]=[];_0xced9ee['push'](db['ChatInternalMessage'][_0xc534('0x47')]({'where':{'FromId':[_0x15738b[_0xc534('0x53')]['id'],_0x28a4d0[_0x49fb1c]['id']],'ToId':[_0x15738b[_0xc534('0x53')]['id'],_0x28a4d0[_0x49fb1c]['id']],'ChatGroupId':null},'attributes':['id',_0xc534('0x4d'),_0xc534('0x67'),_0xc534('0x68'),_0xc534('0x69'),_0xc534('0x46')],'order':qs[_0xc534('0x36')](_0xc534('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc534('0x25')](wrapUser(_0x28a4d0[_0x49fb1c])));}return BPromise[_0xc534('0x6b')](_0xced9ee);}return[];})['then'](function(_0x491d4e){return{'rows':_0x491d4e,'count':_0x491d4e['length']};})['then'](respondWithResult(_0xbbfb8d,null))['catch'](handleError(_0xbbfb8d,null));}; \ No newline at end of file +var _0x0f6d=['error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','agent','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','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','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus'];(function(_0x97b5b6,_0xc590cd){var _0x17a16c=function(_0x1aae0f){while(--_0x1aae0f){_0x97b5b6['push'](_0x97b5b6['shift']());}};_0x17a16c(++_0xc590cd);}(_0x0f6d,0x1a5));var _0xd0f6=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x0f6d[_0x282a1f];return _0x296ea7;};'use strict';var emlformat=require(_0xd0f6('0x0'));var rimraf=require(_0xd0f6('0x1'));var zipdir=require(_0xd0f6('0x2'));var jsonpatch=require(_0xd0f6('0x3'));var rp=require(_0xd0f6('0x4'));var moment=require(_0xd0f6('0x5'));var BPromise=require(_0xd0f6('0x6'));var Mustache=require(_0xd0f6('0x7'));var util=require(_0xd0f6('0x8'));var path=require(_0xd0f6('0x9'));var sox=require(_0xd0f6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0f6('0xb'));var _=require(_0xd0f6('0xc'));var squel=require('squel');var crypto=require(_0xd0f6('0xd'));var jsforce=require(_0xd0f6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd0f6('0xf'));var querystring=require(_0xd0f6('0x10'));var Papa=require(_0xd0f6('0x11'));var Redis=require(_0xd0f6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd0f6('0x13'));var as=require(_0xd0f6('0x14'));var hardwareService=require(_0xd0f6('0x15'));var logger=require(_0xd0f6('0x16'))(_0xd0f6('0x17'));var utils=require(_0xd0f6('0x18'));var config=require(_0xd0f6('0x19'));var licenseUtil=require(_0xd0f6('0x1a'));var db=require(_0xd0f6('0x1b'))['db'];config['redis']=_[_0xd0f6('0x1c')](config[_0xd0f6('0x1d')],{'host':_0xd0f6('0x1e'),'port':0x18eb});var socket=require(_0xd0f6('0x1f'))(new Redis(config[_0xd0f6('0x1d')]));require(_0xd0f6('0x20'))['register'](socket);function respondWithStatusCode(_0x5a6a4e,_0x6444b8){_0x6444b8=_0x6444b8||0xcc;return function(_0x4a51a5){if(_0x4a51a5){return _0x5a6a4e['sendStatus'](_0x6444b8);}return _0x5a6a4e['status'](_0x6444b8)[_0xd0f6('0x21')]();};}function respondWithResult(_0x3181ae,_0x4672f8){_0x4672f8=_0x4672f8||0xc8;return function(_0x482d20){if(_0x482d20){return _0x3181ae[_0xd0f6('0x22')](_0x4672f8)[_0xd0f6('0x23')](_0x482d20);}};}function respondWithFilteredResult(_0x245013,_0x15a33a){return function(_0x5f32a5){if(_0x5f32a5){var _0x1780fc=typeof _0x15a33a[_0xd0f6('0x24')]===_0xd0f6('0x25')&&typeof _0x15a33a[_0xd0f6('0x26')]===_0xd0f6('0x25');var _0x59350d=_0x5f32a5[_0xd0f6('0x27')];var _0x567c68=_0x1780fc?0x0:_0x15a33a['offset'];var _0xdc094c=_0x1780fc?_0x5f32a5[_0xd0f6('0x27')]:_0x15a33a['offset']+_0x15a33a[_0xd0f6('0x26')];var _0x5c7a6d;if(_0xdc094c>=_0x59350d){_0xdc094c=_0x59350d;_0x5c7a6d=0xc8;}else{_0x5c7a6d=0xce;}_0x245013['status'](_0x5c7a6d);return _0x245013[_0xd0f6('0x28')]('Content-Range',_0x567c68+'-'+_0xdc094c+'/'+_0x59350d)[_0xd0f6('0x23')](_0x5f32a5);}return null;};}function patchUpdates(_0x80b645){return function(_0x1b51f1){try{jsonpatch['apply'](_0x1b51f1,_0x80b645,!![]);}catch(_0x571494){return BPromise[_0xd0f6('0x29')](_0x571494);}return _0x1b51f1[_0xd0f6('0x2a')]();};}function saveUpdates(_0x27a414,_0x1a3666){return function(_0x2a1b5c){if(_0x2a1b5c){return _0x2a1b5c[_0xd0f6('0x2b')](_0x27a414)[_0xd0f6('0x2c')](function(_0x23bfe4){return _0x23bfe4;});}return null;};}function removeEntity(_0x2a0cb5,_0xaadd39){return function(_0x4d810c){if(_0x4d810c){return _0x4d810c[_0xd0f6('0x2d')]()[_0xd0f6('0x2c')](function(){_0x2a0cb5[_0xd0f6('0x22')](0xcc)[_0xd0f6('0x21')]();});}};}function handleEntityNotFound(_0x1c1f53,_0x3746cc){return function(_0x303bbf){if(!_0x303bbf){_0x1c1f53[_0xd0f6('0x2e')](0x194);}return _0x303bbf;};}function handleError(_0x5bc46c,_0x3ab41f){_0x3ab41f=_0x3ab41f||0x1f4;return function(_0x5ed450){logger[_0xd0f6('0x2f')](_0x5ed450[_0xd0f6('0x30')]);if(_0x5ed450[_0xd0f6('0x31')]){delete _0x5ed450[_0xd0f6('0x31')];}_0x5bc46c[_0xd0f6('0x22')](_0x3ab41f)[_0xd0f6('0x32')](_0x5ed450);};}exports[_0xd0f6('0x33')]=function(_0x368b5c,_0x83015a){var _0x425f8b={},_0x46e100={},_0x35fd5b={'count':0x0,'rows':[]};var _0x504c62=_['map'](db[_0xd0f6('0x34')][_0xd0f6('0x35')],function(_0xd90a32){return{'name':_0xd90a32[_0xd0f6('0x36')],'type':_0xd90a32['type'][_0xd0f6('0x37')]};});_0x46e100[_0xd0f6('0x38')]=_[_0xd0f6('0x39')](_0x504c62,'name');_0x46e100[_0xd0f6('0x3a')]=_[_0xd0f6('0x3b')](_0x368b5c[_0xd0f6('0x3a')]);_0x46e100['filters']=_['intersection'](_0x46e100['model'],_0x46e100[_0xd0f6('0x3a')]);_0x425f8b[_0xd0f6('0x3c')]=_[_0xd0f6('0x3d')](_0x46e100[_0xd0f6('0x38')],qs[_0xd0f6('0x3e')](_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x3e')]));_0x425f8b['attributes']=_0x425f8b['attributes'][_0xd0f6('0x3f')]?_0x425f8b[_0xd0f6('0x3c')]:_0x46e100[_0xd0f6('0x38')];if(!_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x40')](_0xd0f6('0x41'))){_0x425f8b[_0xd0f6('0x26')]=qs[_0xd0f6('0x26')](_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x26')]);_0x425f8b[_0xd0f6('0x24')]=qs[_0xd0f6('0x24')](_0x368b5c[_0xd0f6('0x3a')]['offset']);}_0x425f8b[_0xd0f6('0x42')]=qs[_0xd0f6('0x43')](_0x368b5c['query']['sort']);_0x425f8b['where']=qs[_0xd0f6('0x44')](_[_0xd0f6('0x45')](_0x368b5c[_0xd0f6('0x3a')],_0x46e100[_0xd0f6('0x44')]),_0x504c62);if(_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x46')]){_0x425f8b[_0xd0f6('0x47')]=_[_0xd0f6('0x48')](_0x425f8b['where'],{'$or':_['map'](_0x504c62,function(_0x37500d){if(_0x37500d['type']!=='VIRTUAL'){var _0x3015d4={};_0x3015d4[_0x37500d['name']]={'$like':'%'+_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x46')]+'%'};return _0x3015d4;}})});}_0x425f8b=_[_0xd0f6('0x48')]({},_0x425f8b,_0x368b5c['options']);var _0x12c64e={'where':_0x425f8b['where']};return db[_0xd0f6('0x34')][_0xd0f6('0x27')](_0x12c64e)['then'](function(_0x35c1ff){_0x35fd5b[_0xd0f6('0x27')]=_0x35c1ff;if(_0x368b5c[_0xd0f6('0x3a')][_0xd0f6('0x49')]){_0x425f8b[_0xd0f6('0x4a')]=[{'all':!![]}];}return db[_0xd0f6('0x34')]['findAll'](_0x425f8b);})[_0xd0f6('0x2c')](function(_0x321b2d){_0x35fd5b[_0xd0f6('0x4b')]=_0x321b2d;return _0x35fd5b;})[_0xd0f6('0x2c')](respondWithFilteredResult(_0x83015a,_0x425f8b))[_0xd0f6('0x4c')](handleError(_0x83015a,null));};exports[_0xd0f6('0x4d')]=function(_0x40dfe6,_0x34c691){var _0x3ab404={'raw':!![],'where':{'id':_0x40dfe6[_0xd0f6('0x4e')]['id']}},_0x25de11={};_0x25de11[_0xd0f6('0x38')]=_[_0xd0f6('0x3b')](db['ChatInternalMessage'][_0xd0f6('0x35')]);_0x25de11[_0xd0f6('0x3a')]=_[_0xd0f6('0x3b')](_0x40dfe6[_0xd0f6('0x3a')]);_0x25de11[_0xd0f6('0x44')]=_[_0xd0f6('0x3d')](_0x25de11[_0xd0f6('0x38')],_0x25de11[_0xd0f6('0x3a')]);_0x3ab404['attributes']=_[_0xd0f6('0x3d')](_0x25de11[_0xd0f6('0x38')],qs[_0xd0f6('0x3e')](_0x40dfe6['query'][_0xd0f6('0x3e')]));_0x3ab404[_0xd0f6('0x3c')]=_0x3ab404[_0xd0f6('0x3c')][_0xd0f6('0x3f')]?_0x3ab404['attributes']:_0x25de11[_0xd0f6('0x38')];if(_0x40dfe6[_0xd0f6('0x3a')][_0xd0f6('0x49')]){_0x3ab404['include']=[{'all':!![]}];}_0x3ab404=_['merge']({},_0x3ab404,_0x40dfe6[_0xd0f6('0x4f')]);return db[_0xd0f6('0x34')][_0xd0f6('0x50')](_0x3ab404)['then'](handleEntityNotFound(_0x34c691,null))['then'](respondWithResult(_0x34c691,null))[_0xd0f6('0x4c')](handleError(_0x34c691,null));};exports[_0xd0f6('0x51')]=function(_0x5f3029,_0x5f2b21){return db['ChatInternalMessage']['create'](_0x5f3029['body'],{})[_0xd0f6('0x2c')](respondWithResult(_0x5f2b21,0xc9))[_0xd0f6('0x4c')](handleError(_0x5f2b21,null));};exports[_0xd0f6('0x2b')]=function(_0x551430,_0xc6c48){if(_0x551430[_0xd0f6('0x52')]['id']){delete _0x551430[_0xd0f6('0x52')]['id'];}return db[_0xd0f6('0x34')]['find']({'where':{'id':_0x551430[_0xd0f6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc6c48,null))[_0xd0f6('0x2c')](saveUpdates(_0x551430[_0xd0f6('0x52')],null))[_0xd0f6('0x2c')](respondWithResult(_0xc6c48,null))['catch'](handleError(_0xc6c48,null));};exports[_0xd0f6('0x2d')]=function(_0x4c34b3,_0x18c7d6){return db[_0xd0f6('0x34')][_0xd0f6('0x50')]({'where':{'id':_0x4c34b3[_0xd0f6('0x4e')]['id']}})[_0xd0f6('0x2c')](handleEntityNotFound(_0x18c7d6,null))[_0xd0f6('0x2c')](removeEntity(_0x18c7d6,null))[_0xd0f6('0x4c')](handleError(_0x18c7d6,null));};exports[_0xd0f6('0x53')]=function(_0x454242,_0x299dc1){return db[_0xd0f6('0x34')][_0xd0f6('0x53')]()[_0xd0f6('0x2c')](respondWithResult(_0x299dc1,null))[_0xd0f6('0x4c')](handleError(_0x299dc1,null));};function wrapUser(_0x1a270b){return function(_0x1f0544){var _0x22d8be=_0x1a270b['get']({'plain':!![]});_0x22d8be[_0xd0f6('0x54')]=[];if(_0x1f0544){_0x22d8be['lastMessageAt']=_0x1f0544['createdAt'];_0x22d8be['lastMessage']=_0x1f0544;}else{_0x22d8be[_0xd0f6('0x55')]=moment(0x0)[_0xd0f6('0x56')](_0xd0f6('0x57'));_0x22d8be[_0xd0f6('0x58')]={};}return _0x22d8be;};}exports[_0xd0f6('0x59')]=function(_0x2443a1,_0x2e8369,_0x1b6152){var _0x5ecc9a=[];return db[_0xd0f6('0x5a')]['findAll']({'where':{'role':['agent',_0xd0f6('0x5b'),_0xd0f6('0x5c')]},'attributes':['id','fullname',_0xd0f6('0x31'),_0xd0f6('0x5d'),_0xd0f6('0x5e'),'internal',_0xd0f6('0x5f'),'lastLoginAt',_0xd0f6('0x60'),_0xd0f6('0x61')],'order':qs['sort'](_0xd0f6('0x62')),'include':[{'model':db[_0xd0f6('0x63')],'as':_0xd0f6('0x64'),'attributes':['id',_0xd0f6('0x31'),_0xd0f6('0x65')],'through':{'attributes':[]}}]})[_0xd0f6('0x2c')](function(_0x5a1f01){if(_0x5a1f01){var _0x3008d7=_0x2443a1[_0xd0f6('0x5c')][_0xd0f6('0x66')]({'plain':!![]});if(!_0x3008d7)throw new Error(_0xd0f6('0x67'));if(_0x3008d7[_0xd0f6('0x5d')]===_0xd0f6('0x5c')){return db[_0xd0f6('0x68')]['find']({'where':{'name':_0xd0f6('0x69'),'userProfileId':_0x3008d7[_0xd0f6('0x6a')]},'raw':!![]})[_0xd0f6('0x2c')](function(_0x1e76fb){if(_0x1e76fb){if(_0x1e76fb[_0xd0f6('0x6b')]===0x0){return db['UserProfileResource'][_0xd0f6('0x6c')]({'where':{'sectionId':_0x1e76fb['id']},'raw':!![]})[_0xd0f6('0x2c')](function(_0x1a8b29){var _0x546b4a=[];if(_[_0xd0f6('0x6d')](_0x1a8b29)){_0x546b4a=_[_0xd0f6('0x46')](_0x5a1f01,function(_0x153e43){if(_0x153e43[_0xd0f6('0x5d')]!==_0xd0f6('0x6e')){return _0x153e43;}});return _0x546b4a;}else{for(var _0x470b5b=0x0;_0x470b5b<_0x5a1f01[_0xd0f6('0x3f')];_0x470b5b++){var _0xc60702=_0x5a1f01[_0x470b5b];if(_0xc60702[_0xd0f6('0x5d')]===_0xd0f6('0x6e')){var _0x273aa4=_[_0xd0f6('0x50')](_0x1a8b29,function(_0x164b23){return _0x164b23['resourceId']===_0xc60702['id'];});if(_0x273aa4)_0x546b4a[_0xd0f6('0x6f')](_0xc60702);}else{_0x546b4a[_0xd0f6('0x6f')](_0xc60702);}}return _0x546b4a;}});}else{return _0x5a1f01;}}else{var _0x15ae2b=_[_0xd0f6('0x46')](_0x5a1f01,function(_0x56c246){if(_0x56c246['role']!==_0xd0f6('0x6e')){return _0x56c246;}});return _0x15ae2b;}});}else{return _0x5a1f01;}}})['then'](function(_0x346dc5){var _0x4ac107=[];if(_0x346dc5){_0x5ecc9a=_0x346dc5;for(var _0x2dfa5b=0x0;_0x2dfa5b<_0x346dc5[_0xd0f6('0x3f')];_0x2dfa5b+=0x1){_0x5ecc9a[_0x2dfa5b][_0xd0f6('0x54')]=[];_0x4ac107['push'](db[_0xd0f6('0x34')]['find']({'where':{'FromId':[_0x2443a1[_0xd0f6('0x5c')]['id'],_0x346dc5[_0x2dfa5b]['id']],'ToId':[_0x2443a1['user']['id'],_0x346dc5[_0x2dfa5b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xd0f6('0x70'),_0xd0f6('0x71'),_0xd0f6('0x72'),_0xd0f6('0x52')],'order':qs['sort'](_0xd0f6('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0f6('0x2c')](wrapUser(_0x346dc5[_0x2dfa5b])));}return BPromise[_0xd0f6('0x74')](_0x4ac107);}return[];})[_0xd0f6('0x2c')](function(_0x18f3eb){return{'rows':_0x18f3eb,'count':_0x18f3eb[_0xd0f6('0x3f')]};})['then'](respondWithResult(_0x2e8369,null))[_0xd0f6('0x4c')](handleError(_0x2e8369,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ce93e0f..cc87ec5 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 _0xb4e4=['exports','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb4e4,0x119));var _0x4b4e=function(_0x403b76,_0x59be57){_0x403b76=_0x403b76-0x0;var _0x587d3b=_0xb4e4[_0x403b76];return _0x587d3b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x4b4e('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4b4e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b4e('0x2'),'afterDestroy':_0x4b4e('0x3')};function emitEvent(_0x8eeddd){return function(_0x5a5adc,_0xc0fb91,_0xb84768){ChatInternalMessageEvents['emit'](_0x8eeddd+':'+_0x5a5adc['id'],_0x5a5adc);ChatInternalMessageEvents[_0x4b4e('0x4')](_0x8eeddd,_0x5a5adc);_0xb84768(null);};}for(var e in events){if(events[_0x4b4e('0x5')](e)){var event=events[e];ChatInternalMessage[_0x4b4e('0x6')](e,emitEvent(event));}}module[_0x4b4e('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa2d5=['save','update','remove','emit','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x23b4df,_0x33dfa6){var _0x26b927=function(_0x1a07ab){while(--_0x1a07ab){_0x23b4df['push'](_0x23b4df['shift']());}};_0x26b927(++_0x33dfa6);}(_0xa2d5,0x14d));var _0x5a2d=function(_0x5bdee3,_0x2fdd3a){_0x5bdee3=_0x5bdee3-0x0;var _0x52e773=_0xa2d5[_0x5bdee3];return _0x52e773;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x5a2d('0x0'))['db'][_0x5a2d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5a2d('0x2')](0x0);var events={'afterCreate':_0x5a2d('0x3'),'afterUpdate':_0x5a2d('0x4'),'afterDestroy':_0x5a2d('0x5')};function emitEvent(_0x47c0bd){return function(_0x33d9c8,_0x5a0a55,_0x399810){ChatInternalMessageEvents[_0x5a2d('0x6')](_0x47c0bd+':'+_0x33d9c8['id'],_0x33d9c8);ChatInternalMessageEvents['emit'](_0x47c0bd,_0x33d9c8);_0x399810(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5a2d('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 38a1e13..5bfdcd8 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 _0x14db=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14db,0x10d));var _0xb14d=function(_0x5307e5,_0x1de6c7){_0x5307e5=_0x5307e5-0x0;var _0x2c1210=_0x14db[_0x5307e5];return _0x2c1210;};'use strict';var _=require(_0xb14d('0x0'));var util=require(_0xb14d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb14d('0x2'));var BPromise=require(_0xb14d('0x3'));var rp=require(_0xb14d('0x4'));var fs=require('fs');var path=require(_0xb14d('0x5'));var rimraf=require(_0xb14d('0x6'));var config=require(_0xb14d('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xb14d('0x8')]=function(_0x35a677,_0x5b7739){return _0x35a677[_0xb14d('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x94ae=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci','lodash'];(function(_0xaaf34f,_0x5448a1){var _0x25c819=function(_0x17bd92){while(--_0x17bd92){_0xaaf34f['push'](_0xaaf34f['shift']());}};_0x25c819(++_0x5448a1);}(_0x94ae,0x137));var _0xe94a=function(_0x4de3ff,_0x4cb1d0){_0x4de3ff=_0x4de3ff-0x0;var _0x3b08fd=_0x94ae[_0x4de3ff];return _0x3b08fd;};'use strict';var _=require(_0xe94a('0x0'));var util=require(_0xe94a('0x1'));var logger=require(_0xe94a('0x2'))(_0xe94a('0x3'));var moment=require(_0xe94a('0x4'));var BPromise=require(_0xe94a('0x5'));var rp=require(_0xe94a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe94a('0x7'));var config=require(_0xe94a('0x8'));var attributes=require(_0xe94a('0x9'));module[_0xe94a('0xa')]=function(_0x4ad424,_0x6362c4){return _0x4ad424['define'](_0xe94a('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe94a('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index fcddd0b..2be9341 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 _0xb8d9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x358639,_0x1a54b1){var _0x48733c=function(_0x25a801){while(--_0x25a801){_0x358639['push'](_0x358639['shift']());}};_0x48733c(++_0x1a54b1);}(_0xb8d9,0x175));var _0x9b8d=function(_0x59ad4a,_0x1f7617){_0x59ad4a=_0x59ad4a-0x0;var _0x36c834=_0xb8d9[_0x59ad4a];return _0x36c834;};'use strict';var _=require(_0x9b8d('0x0'));var util=require(_0x9b8d('0x1'));var moment=require(_0x9b8d('0x2'));var BPromise=require(_0x9b8d('0x3'));var rs=require(_0x9b8d('0x4'));var fs=require('fs');var Redis=require(_0x9b8d('0x5'));var db=require(_0x9b8d('0x6'))['db'];var utils=require(_0x9b8d('0x7'));var logger=require(_0x9b8d('0x8'))(_0x9b8d('0x9'));var config=require(_0x9b8d('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b8d('0xb')]({'port':0x232a});config[_0x9b8d('0xc')]=_['defaults'](config['redis'],{'host':_0x9b8d('0xd'),'port':0x18eb});var socket=require(_0x9b8d('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x22a296,_0x4de29d,_0x539dc4){return new BPromise(function(_0x575623,_0x16cacf){return client[_0x9b8d('0xf')](_0x22a296,_0x539dc4)[_0x9b8d('0x10')](function(_0x1bd000){logger[_0x9b8d('0x11')](_0x9b8d('0x12'),_0x4de29d,_0x9b8d('0x13'));logger[_0x9b8d('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4de29d,'request\x20sent',JSON[_0x9b8d('0x15')](_0x1bd000));if(_0x1bd000[_0x9b8d('0x16')]){if(_0x1bd000['error'][_0x9b8d('0x17')]===0x1f4){logger[_0x9b8d('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4de29d,_0x1bd000[_0x9b8d('0x16')][_0x9b8d('0x18')]);return _0x16cacf(_0x1bd000[_0x9b8d('0x16')][_0x9b8d('0x18')]);}logger['error'](_0x9b8d('0x12'),_0x4de29d,_0x1bd000[_0x9b8d('0x16')][_0x9b8d('0x18')]);return _0x575623(_0x1bd000[_0x9b8d('0x16')]['message']);}else{logger[_0x9b8d('0x11')](_0x9b8d('0x12'),_0x4de29d,_0x9b8d('0x13'));_0x575623(_0x1bd000[_0x9b8d('0x19')]['message']);}})[_0x9b8d('0x1a')](function(_0x2dc2f4){logger[_0x9b8d('0x16')](_0x9b8d('0x12'),_0x4de29d,_0x2dc2f4);_0x16cacf(_0x2dc2f4);});});} \ No newline at end of file +var _0x5735=['result','catch','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1a070f,_0x309e4e){var _0x2e8b1d=function(_0x13993f){while(--_0x13993f){_0x1a070f['push'](_0x1a070f['shift']());}};_0x2e8b1d(++_0x309e4e);}(_0x5735,0x16a));var _0x5573=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x5735[_0x54e6f5];return _0x5e8794;};'use strict';var _=require(_0x5573('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5573('0x1'));var rs=require(_0x5573('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5573('0x3'))(_0x5573('0x4'));var config=require(_0x5573('0x5'));var jayson=require(_0x5573('0x6'));var client=jayson['client'][_0x5573('0x7')]({'port':0x232a});config[_0x5573('0x8')]=_[_0x5573('0x9')](config[_0x5573('0x8')],{'host':_0x5573('0xa'),'port':0x18eb});var socket=require(_0x5573('0xb'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5573('0xc')](socket);function respondWithRpcPromise(_0x33e85f,_0x23744c,_0x5895d9){return new BPromise(function(_0x55bf6a,_0x5c68bc){return client[_0x5573('0xd')](_0x33e85f,_0x5895d9)['then'](function(_0x1817ac){logger[_0x5573('0xe')](_0x5573('0xf'),_0x23744c,_0x5573('0x10'));logger[_0x5573('0x11')](_0x5573('0x12'),_0x23744c,_0x5573('0x10'),JSON[_0x5573('0x13')](_0x1817ac));if(_0x1817ac[_0x5573('0x14')]){if(_0x1817ac[_0x5573('0x14')]['code']===0x1f4){logger[_0x5573('0x14')](_0x5573('0xf'),_0x23744c,_0x1817ac['error'][_0x5573('0x15')]);return _0x5c68bc(_0x1817ac[_0x5573('0x14')][_0x5573('0x15')]);}logger['error'](_0x5573('0xf'),_0x23744c,_0x1817ac['error'][_0x5573('0x15')]);return _0x55bf6a(_0x1817ac[_0x5573('0x14')][_0x5573('0x15')]);}else{logger[_0x5573('0xe')](_0x5573('0xf'),_0x23744c,_0x5573('0x10'));_0x55bf6a(_0x1817ac[_0x5573('0x16')][_0x5573('0x15')]);}})[_0x5573('0x17')](function(_0x267c6e){logger['error'](_0x5573('0xf'),_0x23744c,_0x267c6e);_0x5c68bc(_0x267c6e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 030ed01..7fe94b5 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 _0x1911=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x2856c6,_0x745fd1){var _0x5f23a1=function(_0x26c135){while(--_0x26c135){_0x2856c6['push'](_0x2856c6['shift']());}};_0x5f23a1(++_0x745fd1);}(_0x1911,0x143));var _0x1191=function(_0x4a0cd1,_0x23c60e){_0x4a0cd1=_0x4a0cd1-0x0;var _0x1826d3=_0x1911[_0x4a0cd1];return _0x1826d3;};'use strict';var ChatInternalMessageEvents=require(_0x1191('0x0'));var events=[_0x1191('0x1'),_0x1191('0x2'),_0x1191('0x3')];function createListener(_0x539b80,_0x26ba7c){return function(_0x2bf531){_0x26ba7c[_0x1191('0x4')](_0x539b80,_0x2bf531);};}function removeListener(_0x19fc18,_0x5d5d0a){return function(){ChatInternalMessageEvents['removeListener'](_0x19fc18,_0x5d5d0a);};}exports[_0x1191('0x5')]=function(_0xf3f14a){for(var _0x58e5d2=0x0,_0x5066dc=events[_0x1191('0x6')];_0x58e5d2<_0x5066dc;_0x58e5d2++){var _0x16ed7b=events[_0x58e5d2];var _0x580815=createListener(_0x1191('0x7')+_0x16ed7b,_0xf3f14a);ChatInternalMessageEvents['on'](_0x16ed7b,_0x580815);}}; \ No newline at end of file +var _0xabba=['emit','removeListener','register','./chatInternalMessage.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xabba,0x97));var _0xaabb=function(_0x499b44,_0x18aad3){_0x499b44=_0x499b44-0x0;var _0x49e743=_0xabba[_0x499b44];return _0x49e743;};'use strict';var ChatInternalMessageEvents=require(_0xaabb('0x0'));var events=['save','remove','update'];function createListener(_0x537479,_0x365209){return function(_0x359464){_0x365209[_0xaabb('0x1')](_0x537479,_0x359464);};}function removeListener(_0x9080e7,_0x53d853){return function(){ChatInternalMessageEvents[_0xaabb('0x2')](_0x9080e7,_0x53d853);};}exports[_0xaabb('0x3')]=function(_0x4dbb25){for(var _0x362017=0x0,_0x29348a=events['length'];_0x362017<_0x29348a;_0x362017++){var _0x359a83=events[_0x362017];var _0x53079f=createListener('chatInternalMessage:'+_0x359a83,_0x4dbb25);ChatInternalMessageEvents['on'](_0x359a83,_0x53079f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 1488ad3..391a63c 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 _0xaa68=['/describe','describe','/users','isAuthenticated','getUsers','/:id','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index'];(function(_0x49ab63,_0x2c0f7f){var _0x3ebd1b=function(_0x4ae47a){while(--_0x4ae47a){_0x49ab63['push'](_0x49ab63['shift']());}};_0x3ebd1b(++_0x2c0f7f);}(_0xaa68,0x109));var _0x8aa6=function(_0x1b8486,_0x459cb8){_0x1b8486=_0x1b8486-0x0;var _0x55ef1e=_0xaa68[_0x1b8486];return _0x55ef1e;};'use strict';var multer=require('multer');var util=require(_0x8aa6('0x0'));var path=require(_0x8aa6('0x1'));var timeout=require(_0x8aa6('0x2'));var express=require('express');var router=express[_0x8aa6('0x3')]();var fs_extra=require(_0x8aa6('0x4'));var auth=require(_0x8aa6('0x5'));var interaction=require(_0x8aa6('0x6'));var config=require(_0x8aa6('0x7'));var controller=require(_0x8aa6('0x8'));router[_0x8aa6('0x9')]('/',auth['isAuthenticated'](),controller[_0x8aa6('0xa')]);router['get'](_0x8aa6('0xb'),auth['isAuthenticated'](),controller[_0x8aa6('0xc')]);router[_0x8aa6('0x9')](_0x8aa6('0xd'),auth[_0x8aa6('0xe')](),controller[_0x8aa6('0xf')]);router[_0x8aa6('0x9')](_0x8aa6('0x10'),auth[_0x8aa6('0xe')](),controller['show']);router[_0x8aa6('0x11')]('/',auth[_0x8aa6('0xe')](),controller['create']);router[_0x8aa6('0x12')]('/:id',controller[_0x8aa6('0x13')]);router[_0x8aa6('0x14')](_0x8aa6('0x10'),auth[_0x8aa6('0xe')](),controller[_0x8aa6('0x15')]);module[_0x8aa6('0x16')]=router; \ No newline at end of file +var _0x06d0=['/describe','describe','/users','getUsers','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x176070,_0x5ec9b2){var _0x42a8e5=function(_0x356526){while(--_0x356526){_0x176070['push'](_0x176070['shift']());}};_0x42a8e5(++_0x5ec9b2);}(_0x06d0,0x136));var _0x006d=function(_0x192188,_0x225567){_0x192188=_0x192188-0x0;var _0x287287=_0x06d0[_0x192188];return _0x287287;};'use strict';var multer=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var path=require(_0x006d('0x2'));var timeout=require(_0x006d('0x3'));var express=require(_0x006d('0x4'));var router=express[_0x006d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x006d('0x6'));var config=require(_0x006d('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x006d('0x8')](),controller['index']);router[_0x006d('0x9')](_0x006d('0xa'),auth[_0x006d('0x8')](),controller[_0x006d('0xb')]);router[_0x006d('0x9')](_0x006d('0xc'),auth[_0x006d('0x8')](),controller[_0x006d('0xd')]);router['get'](_0x006d('0xe'),auth['isAuthenticated'](),controller[_0x006d('0xf')]);router[_0x006d('0x10')]('/',auth[_0x006d('0x8')](),controller['create']);router[_0x006d('0x11')](_0x006d('0xe'),controller[_0x006d('0x12')]);router['delete'](_0x006d('0xe'),auth[_0x006d('0x8')](),controller[_0x006d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b52d90b..19127fb 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 _0x676c=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x33430b,_0x44def5){var _0x4c3f39=function(_0x45e925){while(--_0x45e925){_0x33430b['push'](_0x33430b['shift']());}};_0x4c3f39(++_0x44def5);}(_0x676c,0x198));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc676('0x0'));module[_0xc676('0x1')]={'body':{'type':Sequelize[_0xc676('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc676('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc676('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc676('0x4')]('in',_0xc676('0x5')),'defaultValue':_0xc676('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc676('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc676('0x2')]}}; \ No newline at end of file +var _0x9861=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x2d8b49,_0x267614){var _0xf4cb7=function(_0x2990b2){while(--_0x2990b2){_0x2d8b49['push'](_0x2d8b49['shift']());}};_0xf4cb7(++_0x267614);}(_0x9861,0x176));var _0x1986=function(_0x1c403f,_0x46163a){_0x1c403f=_0x1c403f-0x0;var _0x1adf63=_0x9861[_0x1c403f];return _0x1adf63;};'use strict';var Sequelize=require(_0x1986('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x1986('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1986('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1986('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1986('0x3')]('in',_0x1986('0x4')),'defaultValue':_0x1986('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1986('0x5')]},'providerResponse':{'type':Sequelize[_0x1986('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c86c418..4ee86d7 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 _0x7903=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','fullname','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','SIP/%s','event','parse','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x375c61,_0x409703){var _0x387065=function(_0x221a05){while(--_0x221a05){_0x375c61['push'](_0x375c61['shift']());}};_0x387065(++_0x409703);}(_0x7903,0x84));var _0x3790=function(_0x5dbc9c,_0x2d2fb4){_0x5dbc9c=_0x5dbc9c-0x0;var _0x2af357=_0x7903[_0x5dbc9c];return _0x2af357;};'use strict';var emlformat=require(_0x3790('0x0'));var rimraf=require(_0x3790('0x1'));var zipdir=require(_0x3790('0x2'));var jsonpatch=require(_0x3790('0x3'));var rp=require(_0x3790('0x4'));var moment=require(_0x3790('0x5'));var BPromise=require(_0x3790('0x6'));var Mustache=require(_0x3790('0x7'));var util=require(_0x3790('0x8'));var path=require(_0x3790('0x9'));var sox=require(_0x3790('0xa'));var csv=require('to-csv');var ejs=require(_0x3790('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3790('0xc'));var squel=require(_0x3790('0xd'));var crypto=require(_0x3790('0xe'));var jsforce=require(_0x3790('0xf'));var deskjs=require(_0x3790('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3790('0x11'));var Redis=require(_0x3790('0x12'));var authService=require(_0x3790('0x13'));var qs=require(_0x3790('0x14'));var as=require(_0x3790('0x15'));var hardwareService=require(_0x3790('0x16'));var logger=require(_0x3790('0x17'))(_0x3790('0x18'));var utils=require(_0x3790('0x19'));var config=require(_0x3790('0x1a'));var licenseUtil=require(_0x3790('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3790('0x1c')]=_[_0x3790('0x1d')](config[_0x3790('0x1c')],{'host':_0x3790('0x1e'),'port':0x18eb});var socket=require(_0x3790('0x1f'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x3790('0x20')](socket);var jayson=require(_0x3790('0x21'));var client=jayson[_0x3790('0x22')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x230cb6,_0x2f4063,_0x38907c,_0x5ce938){return new BPromise(function(_0x3fd7fa,_0x555173){var _0x2df783=_0x5ce938||client;return _0x2df783[_0x3790('0x23')](_0x230cb6,_0x38907c)[_0x3790('0x24')](function(_0x242010){logger[_0x3790('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2f4063,_0x3790('0x26'));logger[_0x3790('0x27')](_0x3790('0x28'),_0x2f4063,_0x3790('0x26'),JSON[_0x3790('0x29')](_0x242010));if(_0x242010[_0x3790('0x2a')]){if(_0x242010['error'][_0x3790('0x2b')]===0x1f4){logger[_0x3790('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x2f4063,_0x242010[_0x3790('0x2a')][_0x3790('0x2c')]);return _0x555173(_0x242010[_0x3790('0x2a')][_0x3790('0x2c')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2f4063,_0x242010[_0x3790('0x2a')][_0x3790('0x2c')]);return _0x3fd7fa(_0x242010[_0x3790('0x2a')][_0x3790('0x2c')]);}else{logger[_0x3790('0x25')](_0x3790('0x2d'),_0x2f4063,_0x3790('0x26'));_0x3fd7fa(_0x242010[_0x3790('0x2e')][_0x3790('0x2c')]);}})[_0x3790('0x2f')](function(_0xee79e3){logger[_0x3790('0x2a')](_0x3790('0x2d'),_0x2f4063,_0xee79e3);_0x555173(_0xee79e3);});});}function respondWithStatusCode(_0x131f34,_0x58353){_0x58353=_0x58353||0xcc;return function(_0x187511){if(_0x187511){return _0x131f34[_0x3790('0x30')](_0x58353);}return _0x131f34[_0x3790('0x31')](_0x58353)[_0x3790('0x32')]();};}function respondWithResult(_0x49f86a,_0x36b350){_0x36b350=_0x36b350||0xc8;return function(_0x13a92b){if(_0x13a92b){return _0x49f86a['status'](_0x36b350)['json'](_0x13a92b);}};}function respondWithFilteredResult(_0x95afde,_0x288a3e){return function(_0x281782){if(_0x281782){var _0x3c3b57=typeof _0x288a3e[_0x3790('0x33')]===_0x3790('0x34')&&typeof _0x288a3e['limit']==='undefined';var _0x569a83=_0x281782[_0x3790('0x35')];var _0x26b42d=_0x3c3b57?0x0:_0x288a3e['offset'];var _0x3633be=_0x3c3b57?_0x281782[_0x3790('0x35')]:_0x288a3e['offset']+_0x288a3e[_0x3790('0x36')];var _0x25a906;if(_0x3633be>=_0x569a83){_0x3633be=_0x569a83;_0x25a906=0xc8;}else{_0x25a906=0xce;}_0x95afde['status'](_0x25a906);return _0x95afde[_0x3790('0x37')](_0x3790('0x38'),_0x26b42d+'-'+_0x3633be+'/'+_0x569a83)[_0x3790('0x39')](_0x281782);}return null;};}function patchUpdates(_0x5bc8c2){return function(_0x449978){try{jsonpatch['apply'](_0x449978,_0x5bc8c2,!![]);}catch(_0x1d1f7a){return BPromise[_0x3790('0x3a')](_0x1d1f7a);}return _0x449978[_0x3790('0x3b')]();};}function saveUpdates(_0x4f540c,_0x388799){return function(_0x1e8f23){if(_0x1e8f23){return _0x1e8f23[_0x3790('0x3c')](_0x4f540c)[_0x3790('0x24')](function(_0x57e8cb){return _0x57e8cb;});}return null;};}function removeEntity(_0x1aba55,_0x4929f3){return function(_0x506ca4){if(_0x506ca4){return _0x506ca4['destroy']()[_0x3790('0x24')](function(){_0x1aba55[_0x3790('0x31')](0xcc)[_0x3790('0x32')]();});}};}function handleEntityNotFound(_0x16d1b0,_0x54120e){return function(_0x231e5d){if(!_0x231e5d){_0x16d1b0[_0x3790('0x30')](0x194);}return _0x231e5d;};}function handleError(_0x4647fa,_0x3063bd){_0x3063bd=_0x3063bd||0x1f4;return function(_0x2d2877){logger[_0x3790('0x2a')](_0x2d2877['stack']);if(_0x2d2877['name']){delete _0x2d2877[_0x3790('0x3d')];}_0x4647fa[_0x3790('0x31')](_0x3063bd)[_0x3790('0x3e')](_0x2d2877);};}exports[_0x3790('0x3f')]=function(_0x1568fa,_0x12a8df){var _0x349378={},_0x33e362={},_0x44912f={'count':0x0,'rows':[]};var _0x47eb0b=_[_0x3790('0x40')](db[_0x3790('0x41')][_0x3790('0x42')],function(_0x7ee23f){return{'name':_0x7ee23f[_0x3790('0x43')],'type':_0x7ee23f[_0x3790('0x44')][_0x3790('0x45')]};});_0x33e362[_0x3790('0x46')]=_[_0x3790('0x40')](_0x47eb0b,_0x3790('0x3d'));_0x33e362[_0x3790('0x47')]=_[_0x3790('0x48')](_0x1568fa[_0x3790('0x47')]);_0x33e362[_0x3790('0x49')]=_[_0x3790('0x4a')](_0x33e362[_0x3790('0x46')],_0x33e362[_0x3790('0x47')]);_0x349378[_0x3790('0x4b')]=_[_0x3790('0x4a')](_0x33e362['model'],qs[_0x3790('0x4c')](_0x1568fa['query']['fields']));_0x349378[_0x3790('0x4b')]=_0x349378[_0x3790('0x4b')][_0x3790('0x4d')]?_0x349378['attributes']:_0x33e362[_0x3790('0x46')];if(!_0x1568fa[_0x3790('0x47')][_0x3790('0x4e')]('nolimit')){_0x349378[_0x3790('0x36')]=qs[_0x3790('0x36')](_0x1568fa[_0x3790('0x47')][_0x3790('0x36')]);_0x349378[_0x3790('0x33')]=qs[_0x3790('0x33')](_0x1568fa['query']['offset']);}_0x349378['order']=qs[_0x3790('0x4f')](_0x1568fa[_0x3790('0x47')][_0x3790('0x4f')]);_0x349378[_0x3790('0x50')]=qs[_0x3790('0x49')](_[_0x3790('0x51')](_0x1568fa['query'],_0x33e362[_0x3790('0x49')]),_0x47eb0b);if(_0x1568fa['query'][_0x3790('0x52')]){_0x349378[_0x3790('0x50')]=_[_0x3790('0x53')](_0x349378[_0x3790('0x50')],{'$or':_[_0x3790('0x40')](_0x47eb0b,function(_0x1a26cd){if(_0x1a26cd['type']!=='VIRTUAL'){var _0x5cefe8={};_0x5cefe8[_0x1a26cd[_0x3790('0x3d')]]={'$like':'%'+_0x1568fa['query'][_0x3790('0x52')]+'%'};return _0x5cefe8;}})});}_0x349378=_['merge']({},_0x349378,_0x1568fa[_0x3790('0x54')]);var _0x15a841={'where':_0x349378['where']};return db['ChatMessage'][_0x3790('0x35')](_0x15a841)[_0x3790('0x24')](function(_0x482982){_0x44912f[_0x3790('0x35')]=_0x482982;if(_0x1568fa[_0x3790('0x47')][_0x3790('0x55')]){_0x349378[_0x3790('0x56')]=[{'all':!![]}];}return db[_0x3790('0x41')][_0x3790('0x57')](_0x349378);})['then'](function(_0xdd96bd){_0x44912f[_0x3790('0x58')]=_0xdd96bd;return _0x44912f;})['then'](respondWithFilteredResult(_0x12a8df,_0x349378))[_0x3790('0x2f')](handleError(_0x12a8df,null));};exports[_0x3790('0x59')]=function(_0x5fb02f,_0x5b0345){var _0x4bae9a={'raw':!![],'where':{'id':_0x5fb02f[_0x3790('0x5a')]['id']}},_0x38859e={};_0x38859e[_0x3790('0x46')]=_['keys'](db['ChatMessage'][_0x3790('0x42')]);_0x38859e['query']=_[_0x3790('0x48')](_0x5fb02f[_0x3790('0x47')]);_0x38859e[_0x3790('0x49')]=_[_0x3790('0x4a')](_0x38859e[_0x3790('0x46')],_0x38859e[_0x3790('0x47')]);_0x4bae9a[_0x3790('0x4b')]=_['intersection'](_0x38859e['model'],qs[_0x3790('0x4c')](_0x5fb02f['query']['fields']));_0x4bae9a[_0x3790('0x4b')]=_0x4bae9a[_0x3790('0x4b')]['length']?_0x4bae9a[_0x3790('0x4b')]:_0x38859e[_0x3790('0x46')];if(_0x5fb02f[_0x3790('0x47')]['includeAll']){_0x4bae9a[_0x3790('0x56')]=[{'all':!![]}];}_0x4bae9a=_['merge']({},_0x4bae9a,_0x5fb02f['options']);return db[_0x3790('0x41')][_0x3790('0x5b')](_0x4bae9a)['then'](handleEntityNotFound(_0x5b0345,null))[_0x3790('0x24')](respondWithResult(_0x5b0345,null))[_0x3790('0x2f')](handleError(_0x5b0345,null));};exports[_0x3790('0x5c')]=function(_0xe7bc18,_0xe2b91b){return db[_0x3790('0x41')]['create'](_0xe7bc18[_0x3790('0x5d')],{})[_0x3790('0x24')](respondWithResult(_0xe2b91b,0xc9))['catch'](handleError(_0xe2b91b,null));};exports[_0x3790('0x3c')]=function(_0x16cd6a,_0x2090e4){if(_0x16cd6a[_0x3790('0x5d')]['id']){delete _0x16cd6a[_0x3790('0x5d')]['id'];}return db[_0x3790('0x41')][_0x3790('0x5b')]({'where':{'id':_0x16cd6a[_0x3790('0x5a')]['id']}})[_0x3790('0x24')](handleEntityNotFound(_0x2090e4,null))['then'](saveUpdates(_0x16cd6a[_0x3790('0x5d')],null))['then'](respondWithResult(_0x2090e4,null))[_0x3790('0x2f')](handleError(_0x2090e4,null));};exports[_0x3790('0x5e')]=function(_0x4a0e1d,_0x1212f0){return db[_0x3790('0x41')][_0x3790('0x5b')]({'where':{'id':_0x4a0e1d[_0x3790('0x5a')]['id']}})[_0x3790('0x24')](handleEntityNotFound(_0x1212f0,null))[_0x3790('0x24')](removeEntity(_0x1212f0,null))[_0x3790('0x2f')](handleError(_0x1212f0,null));};exports[_0x3790('0x5f')]=function(_0x485ce5,_0x31536a){return db[_0x3790('0x41')]['describe']()['then'](respondWithResult(_0x31536a,null))['catch'](handleError(_0x31536a,null));};var interaction_log=require(_0x3790('0x17'))(_0x3790('0x60'));exports[_0x3790('0x61')]=function(_0x4b794c,_0x24d740,_0x29552b){var _0x416b9b={'agent':{},'channel':_0x3790('0x62')};if(_0x4b794c[_0x3790('0x5d')]['id']){delete _0x4b794c[_0x3790('0x5d')]['id'];}_0x4b794c[_0x3790('0x5d')][_0x3790('0x63')]=!![];_0x4b794c[_0x3790('0x5d')]['readAt']=moment()[_0x3790('0x64')](_0x3790('0x65'));_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')]=_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')]||_0x4b794c[_0x3790('0x67')]['id'];_0x416b9b[_0x3790('0x68')]['id']=_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')];return db[_0x3790('0x41')]['find']({'where':{'id':_0x4b794c[_0x3790('0x5a')]['id'],'UserId':null}})[_0x3790('0x24')](handleEntityNotFound(_0x24d740,null))['then'](saveUpdates(_0x4b794c[_0x3790('0x5d')],null))[_0x3790('0x24')](function(_0x44ae18){if(_0x44ae18){_0x416b9b[_0x3790('0x2c')]=_0x44ae18[_0x3790('0x69')]({'plain':!![]});return db[_0x3790('0x6a')][_0x3790('0x5b')]({'where':{'id':_0x44ae18[_0x3790('0x6b')]}});}return null;})[_0x3790('0x24')](handleEntityNotFound(_0x24d740,null))[_0x3790('0x24')](function(_0x399436){if(_0x399436){return _0x399436[_0x3790('0x3c')]({'UserId':_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')],'read1stAt':_[_0x3790('0x6c')](_0x399436[_0x3790('0x6d')])?moment()[_0x3790('0x64')](_0x3790('0x65')):undefined});}return null;})[_0x3790('0x24')](function(_0x216fcb){if(_0x216fcb){_0x416b9b[_0x3790('0x6e')]=_0x216fcb['get']({'plain':!![]});interaction_log['info'](_0x3790('0x6f'),_0x4b794c[_0x3790('0x67')]['id'],_0x4b794c[_0x3790('0x67')][_0x3790('0x3d')],_0x4b794c[_0x3790('0x67')]['role'],_0x416b9b[_0x3790('0x6e')]['id'],_0x4b794c[_0x3790('0x5d')]?JSON[_0x3790('0x29')](_0x4b794c[_0x3790('0x5d')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3790('0x70'),_0x416b9b);}return null;})[_0x3790('0x24')](function(_0x3cba51){var _0x552f47=_0x3790('0x71')+_0x3cba51[_0x3790('0x2c')][_0x3790('0x72')];return db['sequelize']['query'](_0x552f47,{'type':db[_0x3790('0x73')]['QueryTypes'][_0x3790('0x74')],'raw':!![]})['then'](function(_0x2ea8e7){return _0x2ea8e7;});})[_0x3790('0x24')](function(_0x2a75a0){if(_0x2a75a0){_0x416b9b[_0x3790('0x2c')]['contact']=_0x2a75a0[0x0];if(!_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')])return;return db[_0x3790('0x75')][_0x3790('0x5b')]({'where':{'id':_0x4b794c[_0x3790('0x5d')][_0x3790('0x66')],'role':_0x3790('0x68')},'attributes':['id',_0x3790('0x3d'),_0x3790('0x76'),'email',_0x3790('0x77')],'raw':!![]});}return null;})[_0x3790('0x24')](function(_0xb96bd7){if(!_0xb96bd7)return null;_0x416b9b['message'][_0x3790('0x68')]=_0xb96bd7;return _0x416b9b;})[_0x3790('0x24')](function(_0x2bc679){if(_0x2bc679){if(_0x4b794c[_0x3790('0x5d')][_0x3790('0x78')]){_0x416b9b[_0x3790('0x2c')][_0x3790('0x79')]=util[_0x3790('0x64')]('SIP/%s',_0x4b794c[_0x3790('0x67')][_0x3790('0x3d')]);_0x416b9b[_0x3790('0x2c')][_0x3790('0x7a')]=_0x416b9b[_0x3790('0x7a')];_0x416b9b[_0x3790('0x2c')][_0x3790('0x7b')]=_0x416b9b[_0x3790('0x7a')];_0x416b9b[_0x3790('0x2c')]['event']=_0x3790('0x61');return respondWithRpcPromise(_0x3790('0x7c'),'EventManager',{'event':_0x3790('0x7d'),'message':_[_0x3790('0x53')](_0x416b9b['message'],JSON['parse'](_0x416b9b[_0x3790('0x6e')][_0x3790('0x7e')]))},client9002)[_0x3790('0x24')](function(){return _0x416b9b;});}return _0x416b9b;}return null;})[_0x3790('0x24')](respondWithResult(_0x24d740,null))[_0x3790('0x2f')](handleError(_0x24d740,null));};var interaction_log=require(_0x3790('0x17'))(_0x3790('0x60'));exports[_0x3790('0x3a')]=function(_0x3dea8d,_0x484375,_0x2ec9f6){var _0x5030be={'agent':{},'channel':_0x3790('0x62')};if(_0x3dea8d[_0x3790('0x5d')]['id']){delete _0x3dea8d['body']['id'];}_0x3dea8d['body'][_0x3790('0x66')]=_0x3dea8d['body']['UserId']||_0x3dea8d[_0x3790('0x67')]['id'];_0x5030be[_0x3790('0x68')]['id']=_0x3dea8d[_0x3790('0x5d')]['UserId'];return db[_0x3790('0x41')][_0x3790('0x5b')]({'where':{'id':_0x3dea8d[_0x3790('0x5a')]['id'],'UserId':null}})[_0x3790('0x24')](handleEntityNotFound(_0x484375,null))[_0x3790('0x24')](function(_0x2fdb47){if(_0x2fdb47){_0x5030be['message']=_0x2fdb47[_0x3790('0x69')]({'plain':!![]});return db[_0x3790('0x6a')][_0x3790('0x5b')]({'where':{'id':_0x2fdb47['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x484375,null))['then'](function(_0x30ec96){if(_0x30ec96){_0x5030be[_0x3790('0x6e')]=_0x30ec96[_0x3790('0x69')]({'plain':!![]});interaction_log[_0x3790('0x25')](_0x3790('0x7f'),_0x3dea8d[_0x3790('0x67')]['id'],_0x3dea8d['user'][_0x3790('0x3d')],_0x3dea8d[_0x3790('0x67')]['role'],_0x5030be[_0x3790('0x6e')]['id'],_0x3dea8d['body']?JSON[_0x3790('0x29')](_0x3dea8d[_0x3790('0x5d')]):_0x3790('0x80'));return respondWithRpcPromise(_0x3790('0x81'),_0x3790('0x82'),_0x5030be);}return null;})[_0x3790('0x24')](function(_0x17c7d5){var _0x64438b=_0x3790('0x71')+_0x17c7d5[_0x3790('0x2c')][_0x3790('0x72')];return db[_0x3790('0x83')][_0x3790('0x47')](_0x64438b,{'type':db[_0x3790('0x73')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x309fc0){return _0x309fc0;});})['then'](function(_0x18fb34){if(_0x18fb34){_0x5030be[_0x3790('0x2c')][_0x3790('0x84')]=_0x18fb34[0x0];if(!_0x3dea8d['body']['UserId'])return;return db['User'][_0x3790('0x5b')]({'where':{'id':_0x3dea8d['body']['UserId'],'role':_0x3790('0x68')},'attributes':['id','name',_0x3790('0x76'),'email',_0x3790('0x77')],'raw':!![]});}return null;})[_0x3790('0x24')](function(_0x1bf6c6){if(!_0x1bf6c6)return null;_0x5030be[_0x3790('0x2c')]['agent']=_0x1bf6c6;return _0x5030be;})[_0x3790('0x24')](function(_0xa0193f){if(_0xa0193f){_0xa0193f['message'][_0x3790('0x79')]=util['format'](_0x3790('0x85'),_0x3dea8d[_0x3790('0x67')]['name']);_0xa0193f[_0x3790('0x2c')]['channel']=_0x5030be[_0x3790('0x7a')];_0xa0193f['message'][_0x3790('0x7b')]=_0x5030be[_0x3790('0x7a')];_0xa0193f[_0x3790('0x2c')][_0x3790('0x86')]='reject';respondWithRpcPromise(_0x3790('0x7c'),_0x3790('0x7c'),{'event':'rejectmessage','message':_[_0x3790('0x53')](_0x5030be[_0x3790('0x2c')],JSON[_0x3790('0x87')](_0x5030be[_0x3790('0x6e')][_0x3790('0x7e')]))},client9002);return _0x5030be;}return null;})[_0x3790('0x24')](respondWithResult(_0x484375,null))[_0x3790('0x2f')](handleError(_0x484375,null));}; \ No newline at end of file +var _0x35db=['ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteractionId','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','fullname','event','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x35db,0x105));var _0xb35d=function(_0x51cf9c,_0x1c7107){_0x51cf9c=_0x51cf9c-0x0;var _0x3aca7a=_0x35db[_0x51cf9c];return _0x3aca7a;};'use strict';var emlformat=require(_0xb35d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb35d('0x1'));var jsonpatch=require(_0xb35d('0x2'));var rp=require('request-promise');var moment=require(_0xb35d('0x3'));var BPromise=require(_0xb35d('0x4'));var Mustache=require(_0xb35d('0x5'));var util=require(_0xb35d('0x6'));var path=require(_0xb35d('0x7'));var sox=require(_0xb35d('0x8'));var csv=require('to-csv');var ejs=require(_0xb35d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb35d('0xa'));var jsforce=require(_0xb35d('0xb'));var deskjs=require(_0xb35d('0xc'));var toCsv=require(_0xb35d('0xd'));var querystring=require(_0xb35d('0xe'));var Papa=require(_0xb35d('0xf'));var Redis=require(_0xb35d('0x10'));var authService=require(_0xb35d('0x11'));var qs=require(_0xb35d('0x12'));var as=require(_0xb35d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb35d('0x14'));var utils=require('../../config/utils');var config=require(_0xb35d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb35d('0x16')]=_[_0xb35d('0x17')](config[_0xb35d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb35d('0x18'))(new Redis(config['redis']));require(_0xb35d('0x19'))[_0xb35d('0x1a')](socket);var jayson=require(_0xb35d('0x1b'));var client=jayson[_0xb35d('0x1c')][_0xb35d('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xb35d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x341c68,_0x1f1650,_0x504b0e,_0x9e9036){return new BPromise(function(_0x164570,_0x43b406){var _0x390508=_0x9e9036||client;return _0x390508[_0xb35d('0x1e')](_0x341c68,_0x504b0e)['then'](function(_0x202e7a){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0xb35d('0x1f'));logger[_0xb35d('0x20')](_0xb35d('0x21'),_0x1f1650,_0xb35d('0x1f'),JSON[_0xb35d('0x22')](_0x202e7a));if(_0x202e7a['error']){if(_0x202e7a[_0xb35d('0x23')][_0xb35d('0x24')]===0x1f4){logger[_0xb35d('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0x202e7a[_0xb35d('0x23')]['message']);return _0x43b406(_0x202e7a['error'][_0xb35d('0x25')]);}logger[_0xb35d('0x23')](_0xb35d('0x26'),_0x1f1650,_0x202e7a[_0xb35d('0x23')][_0xb35d('0x25')]);return _0x164570(_0x202e7a[_0xb35d('0x23')][_0xb35d('0x25')]);}else{logger[_0xb35d('0x27')]('ChatMessage,\x20%s,\x20%s',_0x1f1650,_0xb35d('0x1f'));_0x164570(_0x202e7a[_0xb35d('0x28')]['message']);}})[_0xb35d('0x29')](function(_0x1ca131){logger['error'](_0xb35d('0x26'),_0x1f1650,_0x1ca131);_0x43b406(_0x1ca131);});});}function respondWithStatusCode(_0x5ecd40,_0xd81681){_0xd81681=_0xd81681||0xcc;return function(_0x539427){if(_0x539427){return _0x5ecd40[_0xb35d('0x2a')](_0xd81681);}return _0x5ecd40[_0xb35d('0x2b')](_0xd81681)[_0xb35d('0x2c')]();};}function respondWithResult(_0x2378f6,_0x3cb0f1){_0x3cb0f1=_0x3cb0f1||0xc8;return function(_0x17706b){if(_0x17706b){return _0x2378f6[_0xb35d('0x2b')](_0x3cb0f1)['json'](_0x17706b);}};}function respondWithFilteredResult(_0x50c72c,_0x340843){return function(_0x1bf418){if(_0x1bf418){var _0x3a103d=typeof _0x340843['offset']===_0xb35d('0x2d')&&typeof _0x340843[_0xb35d('0x2e')]===_0xb35d('0x2d');var _0x3d5683=_0x1bf418['count'];var _0x8ce94e=_0x3a103d?0x0:_0x340843['offset'];var _0x3d5873=_0x3a103d?_0x1bf418['count']:_0x340843[_0xb35d('0x2f')]+_0x340843[_0xb35d('0x2e')];var _0x57b793;if(_0x3d5873>=_0x3d5683){_0x3d5873=_0x3d5683;_0x57b793=0xc8;}else{_0x57b793=0xce;}_0x50c72c['status'](_0x57b793);return _0x50c72c['set'](_0xb35d('0x30'),_0x8ce94e+'-'+_0x3d5873+'/'+_0x3d5683)['json'](_0x1bf418);}return null;};}function patchUpdates(_0x49488a){return function(_0x24a2fa){try{jsonpatch[_0xb35d('0x31')](_0x24a2fa,_0x49488a,!![]);}catch(_0x18d268){return BPromise[_0xb35d('0x32')](_0x18d268);}return _0x24a2fa[_0xb35d('0x33')]();};}function saveUpdates(_0x15216b,_0x14e7a3){return function(_0x51f52f){if(_0x51f52f){return _0x51f52f[_0xb35d('0x34')](_0x15216b)[_0xb35d('0x35')](function(_0x54cfa9){return _0x54cfa9;});}return null;};}function removeEntity(_0x3f586b,_0x10a1e6){return function(_0x32fd8b){if(_0x32fd8b){return _0x32fd8b[_0xb35d('0x36')]()['then'](function(){_0x3f586b[_0xb35d('0x2b')](0xcc)[_0xb35d('0x2c')]();});}};}function handleEntityNotFound(_0x3fc3aa,_0x2b2183){return function(_0x50ddda){if(!_0x50ddda){_0x3fc3aa[_0xb35d('0x2a')](0x194);}return _0x50ddda;};}function handleError(_0x505ed9,_0x33101d){_0x33101d=_0x33101d||0x1f4;return function(_0x5b6829){logger['error'](_0x5b6829[_0xb35d('0x37')]);if(_0x5b6829['name']){delete _0x5b6829['name'];}_0x505ed9[_0xb35d('0x2b')](_0x33101d)[_0xb35d('0x38')](_0x5b6829);};}exports[_0xb35d('0x39')]=function(_0x14eeb6,_0x590624){var _0x474cdd={},_0x17909b={},_0x16427f={'count':0x0,'rows':[]};var _0x3298ec=_[_0xb35d('0x3a')](db[_0xb35d('0x3b')][_0xb35d('0x3c')],function(_0x4ab011){return{'name':_0x4ab011[_0xb35d('0x3d')],'type':_0x4ab011[_0xb35d('0x3e')][_0xb35d('0x3f')]};});_0x17909b[_0xb35d('0x40')]=_[_0xb35d('0x3a')](_0x3298ec,_0xb35d('0x41'));_0x17909b[_0xb35d('0x42')]=_[_0xb35d('0x43')](_0x14eeb6[_0xb35d('0x42')]);_0x17909b[_0xb35d('0x44')]=_[_0xb35d('0x45')](_0x17909b[_0xb35d('0x40')],_0x17909b['query']);_0x474cdd['attributes']=_['intersection'](_0x17909b['model'],qs[_0xb35d('0x46')](_0x14eeb6['query'][_0xb35d('0x46')]));_0x474cdd[_0xb35d('0x47')]=_0x474cdd['attributes'][_0xb35d('0x48')]?_0x474cdd[_0xb35d('0x47')]:_0x17909b[_0xb35d('0x40')];if(!_0x14eeb6[_0xb35d('0x42')]['hasOwnProperty']('nolimit')){_0x474cdd[_0xb35d('0x2e')]=qs['limit'](_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x2e')]);_0x474cdd[_0xb35d('0x2f')]=qs['offset'](_0x14eeb6['query'][_0xb35d('0x2f')]);}_0x474cdd[_0xb35d('0x49')]=qs[_0xb35d('0x4a')](_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x4a')]);_0x474cdd[_0xb35d('0x4b')]=qs[_0xb35d('0x44')](_[_0xb35d('0x4c')](_0x14eeb6['query'],_0x17909b[_0xb35d('0x44')]),_0x3298ec);if(_0x14eeb6[_0xb35d('0x42')][_0xb35d('0x4d')]){_0x474cdd[_0xb35d('0x4b')]=_[_0xb35d('0x4e')](_0x474cdd['where'],{'$or':_['map'](_0x3298ec,function(_0x10e353){if(_0x10e353[_0xb35d('0x3e')]!=='VIRTUAL'){var _0x4dbdd9={};_0x4dbdd9[_0x10e353[_0xb35d('0x41')]]={'$like':'%'+_0x14eeb6[_0xb35d('0x42')]['filter']+'%'};return _0x4dbdd9;}})});}_0x474cdd=_[_0xb35d('0x4e')]({},_0x474cdd,_0x14eeb6[_0xb35d('0x4f')]);var _0x6b524={'where':_0x474cdd[_0xb35d('0x4b')]};return db['ChatMessage'][_0xb35d('0x50')](_0x6b524)['then'](function(_0x66817e){_0x16427f['count']=_0x66817e;if(_0x14eeb6['query'][_0xb35d('0x51')]){_0x474cdd[_0xb35d('0x52')]=[{'all':!![]}];}return db[_0xb35d('0x3b')][_0xb35d('0x53')](_0x474cdd);})[_0xb35d('0x35')](function(_0x23b8a8){_0x16427f[_0xb35d('0x54')]=_0x23b8a8;return _0x16427f;})[_0xb35d('0x35')](respondWithFilteredResult(_0x590624,_0x474cdd))[_0xb35d('0x29')](handleError(_0x590624,null));};exports[_0xb35d('0x55')]=function(_0x5dcb63,_0x22408a){var _0x788940={'raw':!![],'where':{'id':_0x5dcb63[_0xb35d('0x56')]['id']}},_0x238621={};_0x238621['model']=_[_0xb35d('0x43')](db[_0xb35d('0x3b')][_0xb35d('0x3c')]);_0x238621[_0xb35d('0x42')]=_[_0xb35d('0x43')](_0x5dcb63[_0xb35d('0x42')]);_0x238621[_0xb35d('0x44')]=_[_0xb35d('0x45')](_0x238621[_0xb35d('0x40')],_0x238621['query']);_0x788940[_0xb35d('0x47')]=_[_0xb35d('0x45')](_0x238621[_0xb35d('0x40')],qs[_0xb35d('0x46')](_0x5dcb63['query'][_0xb35d('0x46')]));_0x788940['attributes']=_0x788940[_0xb35d('0x47')][_0xb35d('0x48')]?_0x788940['attributes']:_0x238621[_0xb35d('0x40')];if(_0x5dcb63[_0xb35d('0x42')]['includeAll']){_0x788940[_0xb35d('0x52')]=[{'all':!![]}];}_0x788940=_[_0xb35d('0x4e')]({},_0x788940,_0x5dcb63[_0xb35d('0x4f')]);return db[_0xb35d('0x3b')][_0xb35d('0x57')](_0x788940)[_0xb35d('0x35')](handleEntityNotFound(_0x22408a,null))[_0xb35d('0x35')](respondWithResult(_0x22408a,null))[_0xb35d('0x29')](handleError(_0x22408a,null));};exports[_0xb35d('0x58')]=function(_0x1be3d0,_0x738e4e){return db[_0xb35d('0x3b')][_0xb35d('0x58')](_0x1be3d0[_0xb35d('0x59')],{})[_0xb35d('0x35')](respondWithResult(_0x738e4e,0xc9))[_0xb35d('0x29')](handleError(_0x738e4e,null));};exports[_0xb35d('0x34')]=function(_0x39c4ea,_0xe336a1){if(_0x39c4ea[_0xb35d('0x59')]['id']){delete _0x39c4ea['body']['id'];}return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0x39c4ea[_0xb35d('0x56')]['id']}})[_0xb35d('0x35')](handleEntityNotFound(_0xe336a1,null))['then'](saveUpdates(_0x39c4ea[_0xb35d('0x59')],null))[_0xb35d('0x35')](respondWithResult(_0xe336a1,null))[_0xb35d('0x29')](handleError(_0xe336a1,null));};exports[_0xb35d('0x36')]=function(_0x5d40f2,_0x44ac56){return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0x5d40f2[_0xb35d('0x56')]['id']}})[_0xb35d('0x35')](handleEntityNotFound(_0x44ac56,null))[_0xb35d('0x35')](removeEntity(_0x44ac56,null))[_0xb35d('0x29')](handleError(_0x44ac56,null));};exports[_0xb35d('0x5a')]=function(_0x5cd620,_0x23f75e){return db[_0xb35d('0x3b')][_0xb35d('0x5a')]()[_0xb35d('0x35')](respondWithResult(_0x23f75e,null))[_0xb35d('0x29')](handleError(_0x23f75e,null));};var interaction_log=require(_0xb35d('0x5b'))(_0xb35d('0x5c'));exports[_0xb35d('0x5d')]=function(_0xbcbd15,_0x53be8b,_0x4f10ee){var _0x5c6104={'agent':{},'channel':_0xb35d('0x5e')};if(_0xbcbd15[_0xb35d('0x59')]['id']){delete _0xbcbd15[_0xb35d('0x59')]['id'];}_0xbcbd15['body'][_0xb35d('0x5f')]=!![];_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x60')]=moment()[_0xb35d('0x61')](_0xb35d('0x62'));_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x63')]=_0xbcbd15['body']['UserId']||_0xbcbd15['user']['id'];_0x5c6104[_0xb35d('0x64')]['id']=_0xbcbd15['body']['UserId'];return db[_0xb35d('0x3b')][_0xb35d('0x57')]({'where':{'id':_0xbcbd15[_0xb35d('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53be8b,null))[_0xb35d('0x35')](saveUpdates(_0xbcbd15[_0xb35d('0x59')],null))[_0xb35d('0x35')](function(_0x106883){if(_0x106883){_0x5c6104[_0xb35d('0x25')]=_0x106883['get']({'plain':!![]});return db['ChatInteraction'][_0xb35d('0x57')]({'where':{'id':_0x106883[_0xb35d('0x65')]}});}return null;})[_0xb35d('0x35')](handleEntityNotFound(_0x53be8b,null))['then'](function(_0xc22b8f){if(_0xc22b8f){return _0xc22b8f[_0xb35d('0x34')]({'UserId':_0xbcbd15['body']['UserId'],'read1stAt':_['isNil'](_0xc22b8f['read1stAt'])?moment()[_0xb35d('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2fafdf){if(_0x2fafdf){_0x5c6104[_0xb35d('0x66')]=_0x2fafdf[_0xb35d('0x67')]({'plain':!![]});interaction_log[_0xb35d('0x27')](_0xb35d('0x68'),_0xbcbd15[_0xb35d('0x69')]['id'],_0xbcbd15['user'][_0xb35d('0x41')],_0xbcbd15[_0xb35d('0x69')][_0xb35d('0x6a')],_0x5c6104['interaction']['id'],_0xbcbd15[_0xb35d('0x59')]?JSON[_0xb35d('0x22')](_0xbcbd15[_0xb35d('0x59')]):_0xb35d('0x6b'));return respondWithRpcPromise(_0xb35d('0x6c'),'acceptMessage',_0x5c6104);}return null;})[_0xb35d('0x35')](function(_0x27f94f){var _0x155367=_0xb35d('0x6d')+_0x27f94f[_0xb35d('0x25')][_0xb35d('0x6e')];return db[_0xb35d('0x6f')][_0xb35d('0x42')](_0x155367,{'type':db['Sequelize'][_0xb35d('0x70')]['SELECT'],'raw':!![]})[_0xb35d('0x35')](function(_0x226554){return _0x226554;});})[_0xb35d('0x35')](function(_0x5062e5){if(_0x5062e5){_0x5c6104[_0xb35d('0x25')][_0xb35d('0x71')]=_0x5062e5[0x0];if(!_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x63')])return;return db[_0xb35d('0x72')]['find']({'where':{'id':_0xbcbd15['body'][_0xb35d('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0xb35d('0x73'),_0xb35d('0x74')],'raw':!![]});}return null;})[_0xb35d('0x35')](function(_0x4d9dc3){if(!_0x4d9dc3)return null;_0x5c6104[_0xb35d('0x25')][_0xb35d('0x64')]=_0x4d9dc3;return _0x5c6104;})[_0xb35d('0x35')](function(_0x409893){if(_0x409893){if(_0xbcbd15[_0xb35d('0x59')][_0xb35d('0x75')]){_0x5c6104['message'][_0xb35d('0x76')]=util[_0xb35d('0x61')](_0xb35d('0x77'),_0xbcbd15[_0xb35d('0x69')]['name']);_0x5c6104[_0xb35d('0x25')][_0xb35d('0x78')]=_0x5c6104['channel'];_0x5c6104[_0xb35d('0x25')][_0xb35d('0x79')]=_0x5c6104[_0xb35d('0x78')];_0x5c6104['message']['event']='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb35d('0x7a'),'message':_['merge'](_0x5c6104[_0xb35d('0x25')],JSON[_0xb35d('0x7b')](_0x5c6104[_0xb35d('0x66')][_0xb35d('0x7c')]))},client9002)[_0xb35d('0x35')](function(){return _0x5c6104;});}return _0x5c6104;}return null;})[_0xb35d('0x35')](respondWithResult(_0x53be8b,null))['catch'](handleError(_0x53be8b,null));};var interaction_log=require(_0xb35d('0x5b'))(_0xb35d('0x5c'));exports[_0xb35d('0x32')]=function(_0x3d900c,_0x3645be,_0x4ae155){var _0x461251={'agent':{},'channel':_0xb35d('0x5e')};if(_0x3d900c['body']['id']){delete _0x3d900c[_0xb35d('0x59')]['id'];}_0x3d900c['body'][_0xb35d('0x63')]=_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')]||_0x3d900c['user']['id'];_0x461251['agent']['id']=_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')];return db['ChatMessage'][_0xb35d('0x57')]({'where':{'id':_0x3d900c['params']['id'],'UserId':null}})[_0xb35d('0x35')](handleEntityNotFound(_0x3645be,null))[_0xb35d('0x35')](function(_0x25cbda){if(_0x25cbda){_0x461251[_0xb35d('0x25')]=_0x25cbda[_0xb35d('0x67')]({'plain':!![]});return db[_0xb35d('0x7d')][_0xb35d('0x57')]({'where':{'id':_0x25cbda[_0xb35d('0x65')]}});}return null;})[_0xb35d('0x35')](handleEntityNotFound(_0x3645be,null))[_0xb35d('0x35')](function(_0x513ca7){if(_0x513ca7){_0x461251[_0xb35d('0x66')]=_0x513ca7[_0xb35d('0x67')]({'plain':!![]});interaction_log['info'](_0xb35d('0x7e'),_0x3d900c['user']['id'],_0x3d900c[_0xb35d('0x69')][_0xb35d('0x41')],_0x3d900c['user'][_0xb35d('0x6a')],_0x461251[_0xb35d('0x66')]['id'],_0x3d900c['body']?JSON[_0xb35d('0x22')](_0x3d900c['body']):_0xb35d('0x6b'));return respondWithRpcPromise(_0xb35d('0x7f'),_0xb35d('0x80'),_0x461251);}return null;})[_0xb35d('0x35')](function(_0x1523cf){var _0x25b429=_0xb35d('0x6d')+_0x1523cf[_0xb35d('0x25')][_0xb35d('0x6e')];return db['sequelize'][_0xb35d('0x42')](_0x25b429,{'type':db[_0xb35d('0x81')][_0xb35d('0x70')][_0xb35d('0x82')],'raw':!![]})[_0xb35d('0x35')](function(_0x472525){return _0x472525;});})[_0xb35d('0x35')](function(_0x2ac00b){if(_0x2ac00b){_0x461251['message'][_0xb35d('0x71')]=_0x2ac00b[0x0];if(!_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')])return;return db['User'][_0xb35d('0x57')]({'where':{'id':_0x3d900c[_0xb35d('0x59')][_0xb35d('0x63')],'role':_0xb35d('0x64')},'attributes':['id',_0xb35d('0x41'),_0xb35d('0x83'),_0xb35d('0x73'),_0xb35d('0x74')],'raw':!![]});}return null;})[_0xb35d('0x35')](function(_0x1a05f7){if(!_0x1a05f7)return null;_0x461251[_0xb35d('0x25')]['agent']=_0x1a05f7;return _0x461251;})[_0xb35d('0x35')](function(_0x108420){if(_0x108420){_0x108420[_0xb35d('0x25')][_0xb35d('0x76')]=util[_0xb35d('0x61')](_0xb35d('0x77'),_0x3d900c['user']['name']);_0x108420['message'][_0xb35d('0x78')]=_0x461251[_0xb35d('0x78')];_0x108420[_0xb35d('0x25')][_0xb35d('0x79')]=_0x461251[_0xb35d('0x78')];_0x108420[_0xb35d('0x25')][_0xb35d('0x84')]=_0xb35d('0x32');respondWithRpcPromise(_0xb35d('0x85'),_0xb35d('0x85'),{'event':_0xb35d('0x86'),'message':_[_0xb35d('0x4e')](_0x461251['message'],JSON[_0xb35d('0x7b')](_0x461251[_0xb35d('0x66')][_0xb35d('0x7c')]))},client9002);return _0x461251;}return null;})['then'](respondWithResult(_0x3645be,null))[_0xb35d('0x29')](handleError(_0x3645be,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 916ebc8..5dedfda 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 _0x5b00=['setMaxListeners','save','hasOwnProperty','hook','exports','events','ChatMessage'];(function(_0xdc356f,_0x3003d0){var _0x339eaa=function(_0xc2283e){while(--_0xc2283e){_0xdc356f['push'](_0xdc356f['shift']());}};_0x339eaa(++_0x3003d0);}(_0x5b00,0x101));var _0x05b0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5b00[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x05b0('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x05b0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x05b0('0x2')](0x0);var events={'afterCreate':_0x05b0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa1188a){return function(_0x345f58,_0x1b371e,_0x262851){ChatMessageEvents['emit'](_0xa1188a+':'+_0x345f58['id'],_0x345f58);ChatMessageEvents['emit'](_0xa1188a,_0x345f58);_0x262851(null);};}for(var e in events){if(events[_0x05b0('0x4')](e)){var event=events[e];ChatMessage[_0x05b0('0x5')](e,emitEvent(event));}}module[_0x05b0('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x508d=['emit','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x98bde7,_0x41a56e){var _0x44c270=function(_0xfa99){while(--_0xfa99){_0x98bde7['push'](_0x98bde7['shift']());}};_0x44c270(++_0x41a56e);}(_0x508d,0x112));var _0xd508=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x508d[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0xd508('0x0'));var ChatMessage=require(_0xd508('0x1'))['db'][_0xd508('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd508('0x3'),'afterUpdate':_0xd508('0x4'),'afterDestroy':_0xd508('0x5')};function emitEvent(_0x110b9a){return function(_0x3c88af,_0x52374d,_0x16601d){ChatMessageEvents[_0xd508('0x6')](_0x110b9a+':'+_0x3c88af['id'],_0x3c88af);ChatMessageEvents['emit'](_0x110b9a,_0x3c88af);_0x16601d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xd508('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 1144cbb..1a9d3aa 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 _0xe14b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x505810,_0x217166){var _0x34e8aa=function(_0x35c3a7){while(--_0x35c3a7){_0x505810['push'](_0x505810['shift']());}};_0x34e8aa(++_0x217166);}(_0xe14b,0xb8));var _0xbe14=function(_0x3435ac,_0x280230){_0x3435ac=_0x3435ac-0x0;var _0x3c7261=_0xe14b[_0x3435ac];return _0x3c7261;};'use strict';var _=require(_0xbe14('0x0'));var util=require('util');var logger=require(_0xbe14('0x1'))(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require(_0xbe14('0x4'));var rp=require(_0xbe14('0x5'));var fs=require('fs');var path=require(_0xbe14('0x6'));var rimraf=require(_0xbe14('0x7'));var config=require(_0xbe14('0x8'));var attributes=require(_0xbe14('0x9'));module[_0xbe14('0xa')]=function(_0x70e349,_0x1fc14d){return _0x70e349[_0xbe14('0xb')](_0xbe14('0xc'),attributes,{'tableName':_0xbe14('0xd'),'paranoid':![],'indexes':[{'name':_0xbe14('0xe'),'fields':[_0xbe14('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x105fda,_0x1cc188,_0x3bda94){var _0x256f1a=_0x70e349['models'];var _0x54a1ea=_0x105fda[_0xbe14('0x10')]({'plain':!![]});if(_0x54a1ea['direction']['toLowerCase']()==='in'||_0x54a1ea[_0xbe14('0x11')][_0xbe14('0x12')]()===_0xbe14('0x13')&&!_0x54a1ea[_0xbe14('0x14')]&&!_[_0xbe14('0x15')](_0x54a1ea[_0xbe14('0x16')])){_0x256f1a[_0xbe14('0x17')][_0xbe14('0x18')]({'where':{'id':_0x54a1ea[_0xbe14('0x19')]}})[_0xbe14('0x1a')](function(_0x545c9e){if(_0x545c9e){_0x545c9e[_0xbe14('0x1b')]({'lastMsgAt':_0x54a1ea[_0xbe14('0x1c')],'lastMsgDirection':_0x54a1ea[_0xbe14('0x11')][_0xbe14('0x12')]()});}})[_0xbe14('0x1d')](function(_0x4da916){console['error'](_0x4da916);});}_0x3bda94();}},'charset':'utf8mb4','collate':_0xbe14('0x1e')});}; \ No newline at end of file +var _0x30bd=['chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage'];(function(_0x3e5b7b,_0x1ca279){var _0x441af8=function(_0x3931e7){while(--_0x3931e7){_0x3e5b7b['push'](_0x3e5b7b['shift']());}};_0x441af8(++_0x1ca279);}(_0x30bd,0x9e));var _0xd30b=function(_0x15f43b,_0x53579a){_0x15f43b=_0x15f43b-0x0;var _0x2d753d=_0x30bd[_0x15f43b];return _0x2d753d;};'use strict';var _=require('lodash');var util=require(_0xd30b('0x0'));var logger=require(_0xd30b('0x1'))(_0xd30b('0x2'));var moment=require('moment');var BPromise=require(_0xd30b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd30b('0x4'));var rimraf=require(_0xd30b('0x5'));var config=require(_0xd30b('0x6'));var attributes=require(_0xd30b('0x7'));module[_0xd30b('0x8')]=function(_0x97228a,_0xac9328){return _0x97228a['define'](_0xd30b('0x9'),attributes,{'tableName':_0xd30b('0xa'),'paranoid':![],'indexes':[{'name':_0xd30b('0xb'),'fields':[_0xd30b('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a7026,_0xa42418,_0x508390){var _0x572124=_0x97228a[_0xd30b('0xd')];var _0x32a6ff=_0x3a7026[_0xd30b('0xe')]({'plain':!![]});if(_0x32a6ff['direction']['toLowerCase']()==='in'||_0x32a6ff[_0xd30b('0xf')][_0xd30b('0x10')]()===_0xd30b('0x11')&&!_0x32a6ff[_0xd30b('0x12')]&&!_[_0xd30b('0x13')](_0x32a6ff['UserId'])){_0x572124[_0xd30b('0x14')][_0xd30b('0x15')]({'where':{'id':_0x32a6ff[_0xd30b('0x16')]}})['then'](function(_0x557e6c){if(_0x557e6c){_0x557e6c[_0xd30b('0x17')]({'lastMsgAt':_0x32a6ff[_0xd30b('0x18')],'lastMsgDirection':_0x32a6ff[_0xd30b('0xf')]['toLowerCase']()});}})['catch'](function(_0x3accdd){console[_0xd30b('0x19')](_0x3accdd);});}_0x508390();}},'charset':_0xd30b('0x1a'),'collate':_0xd30b('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index d79d097..2f7756b 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 _0xa681=['register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','CreateChatMessage','ChatMessage','body','options','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket'];(function(_0x2fa6ec,_0x3a59cb){var _0x59ecf7=function(_0x1d01b1){while(--_0x1d01b1){_0x2fa6ec['push'](_0x2fa6ec['shift']());}};_0x59ecf7(++_0x3a59cb);}(_0xa681,0x6a));var _0x1a68=function(_0x5a4226,_0x2f577c){_0x5a4226=_0x5a4226-0x0;var _0x1cf0e8=_0xa681[_0x5a4226];return _0x1cf0e8;};'use strict';var _=require(_0x1a68('0x0'));var util=require('util');var moment=require(_0x1a68('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a68('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a68('0x3'))['db'];var utils=require(_0x1a68('0x4'));var logger=require(_0x1a68('0x5'))(_0x1a68('0x6'));var config=require(_0x1a68('0x7'));var jayson=require(_0x1a68('0x8'));var client=jayson[_0x1a68('0x9')]['http']({'port':0x232a});config[_0x1a68('0xa')]=_[_0x1a68('0xb')](config[_0x1a68('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a68('0xc'))(new Redis(config[_0x1a68('0xa')]));require(_0x1a68('0xd'))[_0x1a68('0xe')](socket);function respondWithRpcPromise(_0x5ad57d,_0x561fc5,_0x148d5e){return new BPromise(function(_0x320000,_0x435664){return client[_0x1a68('0xf')](_0x5ad57d,_0x148d5e)['then'](function(_0x44b865){logger['info'](_0x1a68('0x10'),_0x561fc5,_0x1a68('0x11'));logger[_0x1a68('0x12')](_0x1a68('0x13'),_0x561fc5,_0x1a68('0x11'),JSON[_0x1a68('0x14')](_0x44b865));if(_0x44b865['error']){if(_0x44b865['error'][_0x1a68('0x15')]===0x1f4){logger[_0x1a68('0x16')](_0x1a68('0x10'),_0x561fc5,_0x44b865[_0x1a68('0x16')][_0x1a68('0x17')]);return _0x435664(_0x44b865[_0x1a68('0x16')][_0x1a68('0x17')]);}logger[_0x1a68('0x16')](_0x1a68('0x10'),_0x561fc5,_0x44b865[_0x1a68('0x16')]['message']);return _0x320000(_0x44b865['error'][_0x1a68('0x17')]);}else{logger[_0x1a68('0x18')](_0x1a68('0x10'),_0x561fc5,_0x1a68('0x11'));_0x320000(_0x44b865['result']['message']);}})[_0x1a68('0x19')](function(_0x60b3e3){logger[_0x1a68('0x16')](_0x1a68('0x10'),_0x561fc5,_0x60b3e3);_0x435664(_0x60b3e3);});});}exports[_0x1a68('0x1a')]=function(_0x2f4339){var _0x31dd1a=this;return new Promise(function(_0x4dd80b,_0x2f5eed){return db[_0x1a68('0x1b')]['create'](_0x2f4339[_0x1a68('0x1c')],{'raw':_0x2f4339[_0x1a68('0x1d')]?_0x2f4339[_0x1a68('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49b911){logger['info'](_0x1a68('0x1a'),_0x2f4339);logger[_0x1a68('0x12')](_0x1a68('0x1a'),_0x2f4339,JSON['stringify'](_0x49b911));_0x4dd80b(_0x49b911);})[_0x1a68('0x19')](function(_0x21676c){logger[_0x1a68('0x16')](_0x1a68('0x1a'),_0x21676c[_0x1a68('0x17')],_0x2f4339);_0x2f5eed(_0x31dd1a['error'](0x1f4,_0x21676c[_0x1a68('0x17')]));});});}; \ No newline at end of file +var _0x64c7=['result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x524346,_0x587607){var _0x519e5e=function(_0x18f17f){while(--_0x18f17f){_0x524346['push'](_0x524346['shift']());}};_0x519e5e(++_0x587607);}(_0x64c7,0x1b5));var _0x764c=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x64c7[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x764c('0x0'));var util=require(_0x764c('0x1'));var moment=require(_0x764c('0x2'));var BPromise=require(_0x764c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x764c('0x4'));var db=require(_0x764c('0x5'))['db'];var utils=require(_0x764c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x764c('0x7'));var client=jayson[_0x764c('0x8')][_0x764c('0x9')]({'port':0x232a});config[_0x764c('0xa')]=_[_0x764c('0xb')](config[_0x764c('0xa')],{'host':_0x764c('0xc'),'port':0x18eb});var socket=require(_0x764c('0xd'))(new Redis(config[_0x764c('0xa')]));require('./chatMessage.socket')[_0x764c('0xe')](socket);function respondWithRpcPromise(_0x3b3f47,_0x292605,_0x33b88a){return new BPromise(function(_0x3d9019,_0x224eb0){return client['request'](_0x3b3f47,_0x33b88a)[_0x764c('0xf')](function(_0x4b5ac6){logger[_0x764c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x292605,_0x764c('0x11'));logger[_0x764c('0x12')](_0x764c('0x13'),_0x292605,_0x764c('0x11'),JSON[_0x764c('0x14')](_0x4b5ac6));if(_0x4b5ac6['error']){if(_0x4b5ac6[_0x764c('0x15')][_0x764c('0x16')]===0x1f4){logger[_0x764c('0x15')](_0x764c('0x17'),_0x292605,_0x4b5ac6[_0x764c('0x15')][_0x764c('0x18')]);return _0x224eb0(_0x4b5ac6[_0x764c('0x15')]['message']);}logger[_0x764c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x292605,_0x4b5ac6['error'][_0x764c('0x18')]);return _0x3d9019(_0x4b5ac6[_0x764c('0x15')]['message']);}else{logger[_0x764c('0x10')](_0x764c('0x17'),_0x292605,_0x764c('0x11'));_0x3d9019(_0x4b5ac6[_0x764c('0x19')][_0x764c('0x18')]);}})['catch'](function(_0x3a86cc){logger[_0x764c('0x15')](_0x764c('0x17'),_0x292605,_0x3a86cc);_0x224eb0(_0x3a86cc);});});}exports[_0x764c('0x1a')]=function(_0x475eac){var _0x36135c=this;return new Promise(function(_0x5c02c3,_0x318f24){return db[_0x764c('0x1b')][_0x764c('0x1c')](_0x475eac[_0x764c('0x1d')],{'raw':_0x475eac['options']?_0x475eac[_0x764c('0x1e')][_0x764c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1ce517){logger['info'](_0x764c('0x1a'),_0x475eac);logger[_0x764c('0x12')](_0x764c('0x1a'),_0x475eac,JSON['stringify'](_0x1ce517));_0x5c02c3(_0x1ce517);})[_0x764c('0x20')](function(_0x1e67cc){logger[_0x764c('0x15')](_0x764c('0x1a'),_0x1e67cc[_0x764c('0x18')],_0x475eac);_0x318f24(_0x36135c[_0x764c('0x15')](0x1f4,_0x1e67cc['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 5d149f2..400f3cf 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 _0x85d0=['emit','register','length','chatMessage:'];(function(_0x28dbeb,_0x2f8c0c){var _0x4b7d7c=function(_0x24f682){while(--_0x24f682){_0x28dbeb['push'](_0x28dbeb['shift']());}};_0x4b7d7c(++_0x2f8c0c);}(_0x85d0,0x164));var _0x085d=function(_0x9002d1,_0x4eabc1){_0x9002d1=_0x9002d1-0x0;var _0xceb3a5=_0x85d0[_0x9002d1];return _0xceb3a5;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){ChatMessageEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);ChatMessageEvents['on'](_0x4a12b7,_0xf65d01);}}; \ No newline at end of file +var _0xf95f=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x35b935,_0x5bfe3f){var _0x11c0db=function(_0x4ae9f8){while(--_0x4ae9f8){_0x35b935['push'](_0x35b935['shift']());}};_0x11c0db(++_0x5bfe3f);}(_0xf95f,0x142));var _0xff95=function(_0x3bb854,_0x2fa23e){_0x3bb854=_0x3bb854-0x0;var _0x2ea95e=_0xf95f[_0x3bb854];return _0x2ea95e;};'use strict';var ChatMessageEvents=require(_0xff95('0x0'));var events=[_0xff95('0x1'),_0xff95('0x2'),_0xff95('0x3')];function createListener(_0x109eae,_0x2c7ada){return function(_0x1a42e0){_0x2c7ada[_0xff95('0x4')](_0x109eae,_0x1a42e0);};}function removeListener(_0x1e81fe,_0x498f22){return function(){ChatMessageEvents[_0xff95('0x5')](_0x1e81fe,_0x498f22);};}exports['register']=function(_0x3f72b4){for(var _0x4fb1ed=0x0,_0x314fb4=events[_0xff95('0x6')];_0x4fb1ed<_0x314fb4;_0x4fb1ed++){var _0x2b9ce9=events[_0x4fb1ed];var _0x1a42b2=createListener(_0xff95('0x7')+_0x2b9ce9,_0x3f72b4);ChatMessageEvents['on'](_0x2b9ce9,_0x1a42b2);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ab1aaf1..c91c7f8 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 _0x586a=['reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','isAuthenticated','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0xd351b8,_0x410fa3){var _0x3f8a1c=function(_0x55c53e){while(--_0x55c53e){_0xd351b8['push'](_0xd351b8['shift']());}};_0x3f8a1c(++_0x410fa3);}(_0x586a,0x17e));var _0xa586=function(_0x1ad1b0,_0x1a3f63){_0x1ad1b0=_0x1ad1b0-0x0;var _0x505f3d=_0x586a[_0x1ad1b0];return _0x505f3d;};'use strict';var multer=require(_0xa586('0x0'));var util=require('util');var path=require(_0xa586('0x1'));var timeout=require(_0xa586('0x2'));var express=require('express');var router=express[_0xa586('0x3')]();var fs_extra=require(_0xa586('0x4'));var auth=require(_0xa586('0x5'));var interaction=require(_0xa586('0x6'));var config=require(_0xa586('0x7'));var controller=require(_0xa586('0x8'));router[_0xa586('0x9')]('/',auth['isAuthenticated'](),controller[_0xa586('0xa')]);router[_0xa586('0x9')]('/describe',auth[_0xa586('0xb')](),controller['describe']);router['get'](_0xa586('0xc'),auth['isAuthenticated'](),controller[_0xa586('0xd')]);router['post']('/',auth[_0xa586('0xb')](),interaction[_0xa586('0xe')](_0xa586('0xf'),_0xa586('0x10')),controller[_0xa586('0x11')]);router[_0xa586('0x12')](_0xa586('0xc'),controller[_0xa586('0x13')]);router[_0xa586('0x12')](_0xa586('0x14'),auth[_0xa586('0xb')](),controller[_0xa586('0x15')]);router[_0xa586('0x12')](_0xa586('0x16'),auth[_0xa586('0xb')](),controller[_0xa586('0x17')]);router[_0xa586('0x18')]('/:id',auth[_0xa586('0xb')](),controller[_0xa586('0x19')]);module[_0xa586('0x1a')]=router; \ No newline at end of file +var _0xcacf=['chat','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xcacf,0x14e));var _0xfcac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcacf[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xfcac('0x0'));var util=require(_0xfcac('0x1'));var path=require('path');var timeout=require(_0xfcac('0x2'));var express=require(_0xfcac('0x3'));var router=express[_0xfcac('0x4')]();var fs_extra=require(_0xfcac('0x5'));var auth=require(_0xfcac('0x6'));var interaction=require(_0xfcac('0x7'));var config=require(_0xfcac('0x8'));var controller=require(_0xfcac('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xfcac('0xa')]);router[_0xfcac('0xb')]('/describe',auth[_0xfcac('0xc')](),controller[_0xfcac('0xd')]);router[_0xfcac('0xb')](_0xfcac('0xe'),auth[_0xfcac('0xc')](),controller[_0xfcac('0xf')]);router['post']('/',auth[_0xfcac('0xc')](),interaction['tracked'](_0xfcac('0x10'),'chatmessage:create'),controller[_0xfcac('0x11')]);router[_0xfcac('0x12')](_0xfcac('0xe'),controller[_0xfcac('0x13')]);router[_0xfcac('0x12')](_0xfcac('0x14'),auth['isAuthenticated'](),controller[_0xfcac('0x15')]);router['put'](_0xfcac('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xfcac('0x17')](_0xfcac('0xe'),auth['isAuthenticated'](),controller[_0xfcac('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d93c9bd..bf99b93 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0x0b0e[_0x5d3903];return _0x4b8bc9;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x40e0a1,_0xf24844){var _0x54ae9e=function(_0x368c6c){while(--_0x368c6c){_0x40e0a1['push'](_0x40e0a1['shift']());}};_0x54ae9e(++_0xf24844);}(_0xdb28,0x106));var _0x8db2=function(_0x180413,_0x1803e1){_0x180413=_0x180413-0x0;var _0x12455e=_0xdb28[_0x180413];return _0x12455e;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index f954f7a..2868101 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5b071c,_0xce5722){var _0x25a469=function(_0x5ce1ed){while(--_0x5ce1ed){_0x5b071c['push'](_0x5b071c['shift']());}};_0x25a469(++_0xce5722);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +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(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7a54,0x106));var _0x47a5=function(_0x48f462,_0x3e0f65){_0x48f462=_0x48f462-0x0;var _0x3f0e20=_0x7a54[_0x48f462];return _0x3f0e20;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index b84171e..e193f6d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x441d=['save','update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x39efad,_0x4d6ba9){var _0x1aa8b9=function(_0x3ebf0c){while(--_0x3ebf0c){_0x39efad['push'](_0x39efad['shift']());}};_0x1aa8b9(++_0x4d6ba9);}(_0x441d,0x17e));var _0xd441=function(_0x1b9a60,_0x4ae894){_0x1b9a60=_0x1b9a60-0x0;var _0x3a7c14=_0x441d[_0x1b9a60];return _0x3a7c14;};'use strict';var EventEmitter=require(_0xd441('0x0'));var ChatOfflineMessage=require(_0xd441('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xd441('0x2')](0x0);var events={'afterCreate':_0xd441('0x3'),'afterUpdate':_0xd441('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a8b0e){return function(_0x4824af,_0x41e1de,_0x4dd85b){ChatOfflineMessageEvents[_0xd441('0x5')](_0x3a8b0e+':'+_0x4824af['id'],_0x4824af);ChatOfflineMessageEvents[_0xd441('0x5')](_0x3a8b0e,_0x4824af);_0x4dd85b(null);};}for(var e in events){if(events[_0xd441('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xf2bd=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xf2bd,0x135));var _0xdf2b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf2bd[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0xdf2b('0x0'));var ChatOfflineMessage=require(_0xdf2b('0x1'))['db'][_0xdf2b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xdf2b('0x3')](0x0);var events={'afterCreate':_0xdf2b('0x4'),'afterUpdate':_0xdf2b('0x5'),'afterDestroy':_0xdf2b('0x6')};function emitEvent(_0x42a985){return function(_0x209915,_0x52822c,_0x5c5ec1){ChatOfflineMessageEvents[_0xdf2b('0x7')](_0x42a985+':'+_0x209915['id'],_0x209915);ChatOfflineMessageEvents[_0xdf2b('0x7')](_0x42a985,_0x209915);_0x5c5ec1(null);};}for(var e in events){if(events[_0xdf2b('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xdf2b('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0ab2383..fa13c87 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 _0xebb2=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','ChatOfflineMessage'];(function(_0x5e13af,_0x5461e0){var _0x3dbfa0=function(_0x44c302){while(--_0x44c302){_0x5e13af['push'](_0x5e13af['shift']());}};_0x3dbfa0(++_0x5461e0);}(_0xebb2,0x1ac));var _0x2ebb=function(_0x512c46,_0x2ab926){_0x512c46=_0x512c46-0x0;var _0x128bee=_0xebb2[_0x512c46];return _0x128bee;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x2ebb('0x0')]=function(_0x4eb01c){return _0x4eb01c['define'](_0x2ebb('0x1'),attributes,{'tableName':_0x2ebb('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2ebb('0x3'),'collate':_0x2ebb('0x4')});}; \ No newline at end of file +var _0x80cf=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x575228,_0x3f9bc1){var _0x4cb11e=function(_0x36820e){while(--_0x36820e){_0x575228['push'](_0x575228['shift']());}};_0x4cb11e(++_0x3f9bc1);}(_0x80cf,0x14b));var _0xf80c=function(_0x2efbc1,_0x28c67b){_0x2efbc1=_0x2efbc1-0x0;var _0x14985e=_0x80cf[_0x2efbc1];return _0x14985e;};'use strict';var attributes=require(_0xf80c('0x0'));module[_0xf80c('0x1')]=function(_0x476e9a){return _0x476e9a[_0xf80c('0x2')](_0xf80c('0x3'),attributes,{'tableName':_0xf80c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf80c('0x5'),'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 b7a7859..eda5fcc 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 _0xe107=['then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x5ca78b,_0x2928fa){var _0x130d4c=function(_0x25659e){while(--_0x25659e){_0x5ca78b['push'](_0x5ca78b['shift']());}};_0x130d4c(++_0x2928fa);}(_0xe107,0xb3));var _0x7e10=function(_0x45c22c,_0x3b2fa8){_0x45c22c=_0x45c22c-0x0;var _0x4bd07f=_0xe107[_0x45c22c];return _0x4bd07f;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd3de,_0x7378b3,_0x156c56){return new BPromise(function(_0x3413f7,_0x493958){return client['request'](_0x1dd3de,_0x156c56)[_0x7e10('0x8')](function(_0x490a7a){logger['info'](_0x7e10('0x9'),_0x7378b3,_0x7e10('0xa'));logger[_0x7e10('0xb')](_0x7e10('0xc'),_0x7378b3,_0x7e10('0xa'),JSON['stringify'](_0x490a7a));if(_0x490a7a[_0x7e10('0xd')]){if(_0x490a7a['error'][_0x7e10('0xe')]===0x1f4){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a['error'][_0x7e10('0xf')]);return _0x493958(_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);}logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);return _0x3413f7(_0x490a7a[_0x7e10('0xd')]['message']);}else{logger[_0x7e10('0x10')](_0x7e10('0x9'),_0x7378b3,'request\x20sent');_0x3413f7(_0x490a7a['result'][_0x7e10('0xf')]);}})['catch'](function(_0xe1abd2){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0xe1abd2);_0x493958(_0xe1abd2);});});} \ No newline at end of file +var _0x27af=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x27af,0xbe));var _0xf27a=function(_0x134383,_0x54b5b4){_0x134383=_0x134383-0x0;var _0x40de98=_0x27af[_0x134383];return _0x40de98;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require(_0xf27a('0x2'));var BPromise=require(_0xf27a('0x3'));var rs=require(_0xf27a('0x4'));var fs=require('fs');var Redis=require(_0xf27a('0x5'));var db=require(_0xf27a('0x6'))['db'];var utils=require(_0xf27a('0x7'));var logger=require(_0xf27a('0x8'))(_0xf27a('0x9'));var config=require(_0xf27a('0xa'));var jayson=require(_0xf27a('0xb'));var client=jayson[_0xf27a('0xc')][_0xf27a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x520852,_0x1d0c36,_0xcdbadc){return new BPromise(function(_0x2c8dd3,_0x1a5622){return client[_0xf27a('0xe')](_0x520852,_0xcdbadc)[_0xf27a('0xf')](function(_0x26f95e){logger[_0xf27a('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1d0c36,_0xf27a('0x11'));logger[_0xf27a('0x12')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1d0c36,_0xf27a('0x11'),JSON[_0xf27a('0x13')](_0x26f95e));if(_0x26f95e[_0xf27a('0x14')]){if(_0x26f95e[_0xf27a('0x14')][_0xf27a('0x15')]===0x1f4){logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x26f95e['error'][_0xf27a('0x17')]);return _0x1a5622(_0x26f95e['error'][_0xf27a('0x17')]);}logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x26f95e['error'][_0xf27a('0x17')]);return _0x2c8dd3(_0x26f95e[_0xf27a('0x14')]['message']);}else{logger[_0xf27a('0x10')](_0xf27a('0x16'),_0x1d0c36,_0xf27a('0x11'));_0x2c8dd3(_0x26f95e[_0xf27a('0x18')][_0xf27a('0x17')]);}})['catch'](function(_0x18413c){logger[_0xf27a('0x14')](_0xf27a('0x16'),_0x1d0c36,_0x18413c);_0x1a5622(_0x18413c);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 54590d8..c29100c 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 _0xfc87=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','post','create','put','update','delete','destroy','multer'];(function(_0x4cfe90,_0x3da8fb){var _0x13591e=function(_0x3f1281){while(--_0x3f1281){_0x4cfe90['push'](_0x4cfe90['shift']());}};_0x13591e(++_0x3da8fb);}(_0xfc87,0xf1));var _0x7fc8=function(_0x373468,_0x2aefd3){_0x373468=_0x373468-0x0;var _0x4b58f7=_0xfc87[_0x373468];return _0x4b58f7;};'use strict';var multer=require(_0x7fc8('0x0'));var util=require(_0x7fc8('0x1'));var path=require(_0x7fc8('0x2'));var timeout=require(_0x7fc8('0x3'));var express=require(_0x7fc8('0x4'));var router=express[_0x7fc8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7fc8('0x6'));var interaction=require(_0x7fc8('0x7'));var config=require(_0x7fc8('0x8'));var controller=require(_0x7fc8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7fc8('0xa')]);router['get'](_0x7fc8('0xb'),auth[_0x7fc8('0xc')](),controller[_0x7fc8('0xd')]);router[_0x7fc8('0xe')](_0x7fc8('0xf'),auth[_0x7fc8('0xc')](),controller['show']);router[_0x7fc8('0x10')]('/',auth[_0x7fc8('0xc')](),controller[_0x7fc8('0x11')]);router[_0x7fc8('0x12')]('/:id',auth[_0x7fc8('0xc')](),controller[_0x7fc8('0x13')]);router[_0x7fc8('0x14')](_0x7fc8('0xf'),auth['isAuthenticated'](),controller[_0x7fc8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x42ad=['put','update','delete','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x501b76,_0x2f9a4b){var _0x365015=function(_0xa10818){while(--_0xa10818){_0x501b76['push'](_0x501b76['shift']());}};_0x365015(++_0x2f9a4b);}(_0x42ad,0x14f));var _0xd42a=function(_0x5afe05,_0xcd8720){_0x5afe05=_0x5afe05-0x0;var _0x545c3e=_0x42ad[_0x5afe05];return _0x545c3e;};'use strict';var multer=require(_0xd42a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd42a('0x1'));var express=require(_0xd42a('0x2'));var router=express[_0xd42a('0x3')]();var fs_extra=require(_0xd42a('0x4'));var auth=require(_0xd42a('0x5'));var interaction=require(_0xd42a('0x6'));var config=require(_0xd42a('0x7'));var controller=require(_0xd42a('0x8'));router[_0xd42a('0x9')]('/',auth[_0xd42a('0xa')](),controller[_0xd42a('0xb')]);router[_0xd42a('0x9')](_0xd42a('0xc'),auth[_0xd42a('0xa')](),controller[_0xd42a('0xd')]);router[_0xd42a('0x9')]('/:id',auth[_0xd42a('0xa')](),controller[_0xd42a('0xe')]);router[_0xd42a('0xf')]('/',auth[_0xd42a('0xa')](),controller[_0xd42a('0x10')]);router[_0xd42a('0x11')]('/:id',auth[_0xd42a('0xa')](),controller[_0xd42a('0x12')]);router[_0xd42a('0x13')](_0xd42a('0x14'),auth['isAuthenticated'](),controller[_0xd42a('0x15')]);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 be86c9c..d552d44 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 _0xffee=['STRING','mouseOver','timeout','sequelize'];(function(_0x167b70,_0x3addd4){var _0x19a768=function(_0x28053f){while(--_0x28053f){_0x167b70['push'](_0x167b70['shift']());}};_0x19a768(++_0x3addd4);}(_0xffee,0x1a3));var _0xeffe=function(_0x6320f2,_0x114d7a){_0x6320f2=_0x6320f2-0x0;var _0x588fa3=_0xffee[_0x6320f2];return _0x588fa3;};'use strict';var Sequelize=require(_0xeffe('0x0'));module['exports']={'name':{'type':Sequelize[_0xeffe('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xeffe('0x2'),_0xeffe('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xeffe('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0b41=['timeout','mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0x0b41,0xb9));var _0x10b4=function(_0x3902c4,_0x38144b){_0x3902c4=_0x3902c4-0x0;var _0x2d7329=_0x0b41[_0x3902c4];return _0x2d7329;};'use strict';var Sequelize=require(_0x10b4('0x0'));module[_0x10b4('0x1')]={'name':{'type':Sequelize[_0x10b4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x10b4('0x3')]('mouseOver',_0x10b4('0x4')),'defaultValue':_0x10b4('0x5')},'selector':{'type':Sequelize[_0x10b4('0x2')]},'timeout':{'type':Sequelize[_0x10b4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 10b5d7d..7c709c4 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 _0xac95=['fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','show','keys','ChatProactiveAction','query','filters','intersection','attributes','model','fields','includeAll','include','merge','options','find','then','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs'];(function(_0x4a9fb7,_0x4cbfd7){var _0x40b90e=function(_0x59664c){while(--_0x59664c){_0x4a9fb7['push'](_0x4a9fb7['shift']());}};_0x40b90e(++_0x4cbfd7);}(_0xac95,0xa8));var _0x5ac9=function(_0x1fe027,_0x3be881){_0x1fe027=_0x1fe027-0x0;var _0x30b349=_0xac95[_0x1fe027];return _0x30b349;};'use strict';var emlformat=require(_0x5ac9('0x0'));var rimraf=require(_0x5ac9('0x1'));var zipdir=require(_0x5ac9('0x2'));var jsonpatch=require(_0x5ac9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ac9('0x4'));var Mustache=require(_0x5ac9('0x5'));var util=require('util');var path=require(_0x5ac9('0x6'));var sox=require(_0x5ac9('0x7'));var csv=require('to-csv');var ejs=require(_0x5ac9('0x8'));var fs=require('fs');var fs_extra=require(_0x5ac9('0x9'));var _=require(_0x5ac9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ac9('0xb'));var deskjs=require(_0x5ac9('0xc'));var toCsv=require(_0x5ac9('0xd'));var querystring=require(_0x5ac9('0xe'));var Papa=require(_0x5ac9('0xf'));var Redis=require(_0x5ac9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5ac9('0x11'));var as=require(_0x5ac9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ac9('0x13'))('api');var utils=require(_0x5ac9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5ac9('0x15'));var db=require(_0x5ac9('0x16'))['db'];function respondWithStatusCode(_0x371231,_0x40eb62){_0x40eb62=_0x40eb62||0xcc;return function(_0x4f9a04){if(_0x4f9a04){return _0x371231['sendStatus'](_0x40eb62);}return _0x371231[_0x5ac9('0x17')](_0x40eb62)['end']();};}function respondWithResult(_0x3a7d64,_0x364007){_0x364007=_0x364007||0xc8;return function(_0x50658c){if(_0x50658c){return _0x3a7d64[_0x5ac9('0x17')](_0x364007)[_0x5ac9('0x18')](_0x50658c);}};}function respondWithFilteredResult(_0x3f8fac,_0x122590){return function(_0x456ed9){if(_0x456ed9){var _0x2fe47e=typeof _0x122590[_0x5ac9('0x19')]===_0x5ac9('0x1a')&&typeof _0x122590[_0x5ac9('0x1b')]==='undefined';var _0x53a8db=_0x456ed9[_0x5ac9('0x1c')];var _0x193c56=_0x2fe47e?0x0:_0x122590[_0x5ac9('0x19')];var _0x4463ff=_0x2fe47e?_0x456ed9[_0x5ac9('0x1c')]:_0x122590[_0x5ac9('0x19')]+_0x122590[_0x5ac9('0x1b')];var _0x429bf3;if(_0x4463ff>=_0x53a8db){_0x4463ff=_0x53a8db;_0x429bf3=0xc8;}else{_0x429bf3=0xce;}_0x3f8fac[_0x5ac9('0x17')](_0x429bf3);return _0x3f8fac[_0x5ac9('0x1d')](_0x5ac9('0x1e'),_0x193c56+'-'+_0x4463ff+'/'+_0x53a8db)[_0x5ac9('0x18')](_0x456ed9);}return null;};}function patchUpdates(_0x2efa5f){return function(_0x479c6b){try{jsonpatch[_0x5ac9('0x1f')](_0x479c6b,_0x2efa5f,!![]);}catch(_0x1f5546){return BPromise[_0x5ac9('0x20')](_0x1f5546);}return _0x479c6b[_0x5ac9('0x21')]();};}function saveUpdates(_0x2d2ba5,_0x492679){return function(_0x45417d){if(_0x45417d){return _0x45417d[_0x5ac9('0x22')](_0x2d2ba5)['then'](function(_0x5e42a1){return _0x5e42a1;});}return null;};}function removeEntity(_0x5a4664,_0xc36d2){return function(_0x2e666b){if(_0x2e666b){return _0x2e666b['destroy']()['then'](function(){_0x5a4664[_0x5ac9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49352f,_0x2d1bb5){return function(_0x505acc){if(!_0x505acc){_0x49352f[_0x5ac9('0x23')](0x194);}return _0x505acc;};}function handleError(_0x3b77be,_0x770c48){_0x770c48=_0x770c48||0x1f4;return function(_0x3a7f68){logger[_0x5ac9('0x24')](_0x3a7f68[_0x5ac9('0x25')]);if(_0x3a7f68[_0x5ac9('0x26')]){delete _0x3a7f68[_0x5ac9('0x26')];}_0x3b77be[_0x5ac9('0x17')](_0x770c48)['send'](_0x3a7f68);};}exports[_0x5ac9('0x27')]=function(_0x14a7fe,_0x2a7db9){var _0x3a536c={'raw':!![],'where':{'id':_0x14a7fe['params']['id']}},_0x3d51ab={};_0x3d51ab['model']=_[_0x5ac9('0x28')](db[_0x5ac9('0x29')]['rawAttributes']);_0x3d51ab[_0x5ac9('0x2a')]=_['keys'](_0x14a7fe[_0x5ac9('0x2a')]);_0x3d51ab[_0x5ac9('0x2b')]=_[_0x5ac9('0x2c')](_0x3d51ab['model'],_0x3d51ab[_0x5ac9('0x2a')]);_0x3a536c[_0x5ac9('0x2d')]=_[_0x5ac9('0x2c')](_0x3d51ab[_0x5ac9('0x2e')],qs[_0x5ac9('0x2f')](_0x14a7fe[_0x5ac9('0x2a')]['fields']));_0x3a536c['attributes']=_0x3a536c[_0x5ac9('0x2d')]['length']?_0x3a536c['attributes']:_0x3d51ab[_0x5ac9('0x2e')];if(_0x14a7fe[_0x5ac9('0x2a')][_0x5ac9('0x30')]){_0x3a536c[_0x5ac9('0x31')]=[{'all':!![]}];}_0x3a536c=_[_0x5ac9('0x32')]({},_0x3a536c,_0x14a7fe[_0x5ac9('0x33')]);return db[_0x5ac9('0x29')][_0x5ac9('0x34')](_0x3a536c)[_0x5ac9('0x35')](handleEntityNotFound(_0x2a7db9,null))['then'](respondWithResult(_0x2a7db9,null))[_0x5ac9('0x36')](handleError(_0x2a7db9,null));};exports[_0x5ac9('0x37')]=function(_0x535f20,_0x598093){return db[_0x5ac9('0x29')][_0x5ac9('0x37')](_0x535f20[_0x5ac9('0x38')],{})[_0x5ac9('0x35')](respondWithResult(_0x598093,0xc9))['catch'](handleError(_0x598093,null));};exports[_0x5ac9('0x22')]=function(_0x5b55c9,_0x3c540f){if(_0x5b55c9[_0x5ac9('0x38')]['id']){delete _0x5b55c9[_0x5ac9('0x38')]['id'];}return db[_0x5ac9('0x29')][_0x5ac9('0x34')]({'where':{'id':_0x5b55c9[_0x5ac9('0x39')]['id']}})[_0x5ac9('0x35')](handleEntityNotFound(_0x3c540f,null))[_0x5ac9('0x35')](saveUpdates(_0x5b55c9[_0x5ac9('0x38')],null))[_0x5ac9('0x35')](respondWithResult(_0x3c540f,null))[_0x5ac9('0x36')](handleError(_0x3c540f,null));};exports[_0x5ac9('0x3a')]=function(_0x5eacda,_0x5d57ff){return db[_0x5ac9('0x29')][_0x5ac9('0x34')]({'where':{'id':_0x5eacda[_0x5ac9('0x39')]['id']}})[_0x5ac9('0x35')](handleEntityNotFound(_0x5d57ff,null))[_0x5ac9('0x35')](removeEntity(_0x5d57ff,null))[_0x5ac9('0x36')](handleError(_0x5d57ff,null));}; \ No newline at end of file +var _0xd5da=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','undefined','limit','offset','set','json','reject','save','update','then','end','sendStatus','error','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd5da,0x9f));var _0xad5d=function(_0x4e23db,_0x3fe14b){_0x4e23db=_0x4e23db-0x0;var _0x329d95=_0xd5da[_0x4e23db];return _0x329d95;};'use strict';var emlformat=require(_0xad5d('0x0'));var rimraf=require(_0xad5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad5d('0x2'));var rp=require(_0xad5d('0x3'));var moment=require(_0xad5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad5d('0x5'));var util=require('util');var path=require(_0xad5d('0x6'));var sox=require(_0xad5d('0x7'));var csv=require(_0xad5d('0x8'));var ejs=require(_0xad5d('0x9'));var fs=require('fs');var fs_extra=require(_0xad5d('0xa'));var _=require(_0xad5d('0xb'));var squel=require(_0xad5d('0xc'));var crypto=require(_0xad5d('0xd'));var jsforce=require(_0xad5d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xad5d('0x8'));var querystring=require(_0xad5d('0xf'));var Papa=require('papaparse');var Redis=require(_0xad5d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xad5d('0x11'));var as=require(_0xad5d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad5d('0x13'))(_0xad5d('0x14'));var utils=require('../../config/utils');var config=require(_0xad5d('0x15'));var licenseUtil=require(_0xad5d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2afe2e,_0x5aa39f){_0x5aa39f=_0x5aa39f||0xcc;return function(_0x2473bc){if(_0x2473bc){return _0x2afe2e['sendStatus'](_0x5aa39f);}return _0x2afe2e[_0xad5d('0x17')](_0x5aa39f)['end']();};}function respondWithResult(_0x2b04b2,_0x5091e0){_0x5091e0=_0x5091e0||0xc8;return function(_0x16ef55){if(_0x16ef55){return _0x2b04b2[_0xad5d('0x17')](_0x5091e0)['json'](_0x16ef55);}};}function respondWithFilteredResult(_0x4bb9e5,_0x164280){return function(_0x589daa){if(_0x589daa){var _0x5061c3=typeof _0x164280['offset']===_0xad5d('0x18')&&typeof _0x164280[_0xad5d('0x19')]===_0xad5d('0x18');var _0x4c706e=_0x589daa['count'];var _0x53b88d=_0x5061c3?0x0:_0x164280[_0xad5d('0x1a')];var _0xce6fbf=_0x5061c3?_0x589daa['count']:_0x164280['offset']+_0x164280[_0xad5d('0x19')];var _0x5eaca6;if(_0xce6fbf>=_0x4c706e){_0xce6fbf=_0x4c706e;_0x5eaca6=0xc8;}else{_0x5eaca6=0xce;}_0x4bb9e5[_0xad5d('0x17')](_0x5eaca6);return _0x4bb9e5[_0xad5d('0x1b')]('Content-Range',_0x53b88d+'-'+_0xce6fbf+'/'+_0x4c706e)[_0xad5d('0x1c')](_0x589daa);}return null;};}function patchUpdates(_0x2d9d47){return function(_0x41061d){try{jsonpatch['apply'](_0x41061d,_0x2d9d47,!![]);}catch(_0x3f7dea){return BPromise[_0xad5d('0x1d')](_0x3f7dea);}return _0x41061d[_0xad5d('0x1e')]();};}function saveUpdates(_0x807de1,_0xffc852){return function(_0x53baa9){if(_0x53baa9){return _0x53baa9[_0xad5d('0x1f')](_0x807de1)[_0xad5d('0x20')](function(_0x3326ce){return _0x3326ce;});}return null;};}function removeEntity(_0x183275,_0x37d139){return function(_0x35e1a0){if(_0x35e1a0){return _0x35e1a0['destroy']()['then'](function(){_0x183275[_0xad5d('0x17')](0xcc)[_0xad5d('0x21')]();});}};}function handleEntityNotFound(_0xa90fe,_0x56607e){return function(_0xa94549){if(!_0xa94549){_0xa90fe[_0xad5d('0x22')](0x194);}return _0xa94549;};}function handleError(_0x2b63ba,_0x210eed){_0x210eed=_0x210eed||0x1f4;return function(_0x2d62f4){logger[_0xad5d('0x23')](_0x2d62f4['stack']);if(_0x2d62f4[_0xad5d('0x24')]){delete _0x2d62f4[_0xad5d('0x24')];}_0x2b63ba[_0xad5d('0x17')](_0x210eed)[_0xad5d('0x25')](_0x2d62f4);};}exports['show']=function(_0x5754c0,_0x3e0caf){var _0x3ca863={'raw':!![],'where':{'id':_0x5754c0[_0xad5d('0x26')]['id']}},_0x704d74={};_0x704d74[_0xad5d('0x27')]=_[_0xad5d('0x28')](db[_0xad5d('0x29')][_0xad5d('0x2a')]);_0x704d74[_0xad5d('0x2b')]=_['keys'](_0x5754c0[_0xad5d('0x2b')]);_0x704d74[_0xad5d('0x2c')]=_[_0xad5d('0x2d')](_0x704d74[_0xad5d('0x27')],_0x704d74[_0xad5d('0x2b')]);_0x3ca863['attributes']=_['intersection'](_0x704d74['model'],qs[_0xad5d('0x2e')](_0x5754c0[_0xad5d('0x2b')][_0xad5d('0x2e')]));_0x3ca863[_0xad5d('0x2f')]=_0x3ca863['attributes']['length']?_0x3ca863['attributes']:_0x704d74[_0xad5d('0x27')];if(_0x5754c0[_0xad5d('0x2b')][_0xad5d('0x30')]){_0x3ca863[_0xad5d('0x31')]=[{'all':!![]}];}_0x3ca863=_[_0xad5d('0x32')]({},_0x3ca863,_0x5754c0[_0xad5d('0x33')]);return db[_0xad5d('0x29')][_0xad5d('0x34')](_0x3ca863)[_0xad5d('0x20')](handleEntityNotFound(_0x3e0caf,null))[_0xad5d('0x20')](respondWithResult(_0x3e0caf,null))[_0xad5d('0x35')](handleError(_0x3e0caf,null));};exports['create']=function(_0x542fdf,_0x28ab83){return db['ChatProactiveAction'][_0xad5d('0x36')](_0x542fdf[_0xad5d('0x37')],{})[_0xad5d('0x20')](respondWithResult(_0x28ab83,0xc9))[_0xad5d('0x35')](handleError(_0x28ab83,null));};exports[_0xad5d('0x1f')]=function(_0x597c09,_0x16dc48){if(_0x597c09[_0xad5d('0x37')]['id']){delete _0x597c09[_0xad5d('0x37')]['id'];}return db['ChatProactiveAction'][_0xad5d('0x34')]({'where':{'id':_0x597c09[_0xad5d('0x26')]['id']}})['then'](handleEntityNotFound(_0x16dc48,null))['then'](saveUpdates(_0x597c09[_0xad5d('0x37')],null))[_0xad5d('0x20')](respondWithResult(_0x16dc48,null))['catch'](handleError(_0x16dc48,null));};exports['destroy']=function(_0x581839,_0x5ea825){return db['ChatProactiveAction']['find']({'where':{'id':_0x581839['params']['id']}})['then'](handleEntityNotFound(_0x5ea825,null))[_0xad5d('0x20')](removeEntity(_0x5ea825,null))[_0xad5d('0x35')](handleError(_0x5ea825,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e4ad1c1..f1135aa 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 _0x8ff6=['ChatProactiveAction','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x550d41,_0xe98b2c){var _0x41f799=function(_0x111a2b){while(--_0x111a2b){_0x550d41['push'](_0x550d41['shift']());}};_0x41f799(++_0xe98b2c);}(_0x8ff6,0xc1));var _0x68ff=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8ff6[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x68ff('0x0'));var util=require('util');var logger=require(_0x68ff('0x1'))(_0x68ff('0x2'));var moment=require(_0x68ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x68ff('0x4'));var fs=require('fs');var path=require(_0x68ff('0x5'));var rimraf=require(_0x68ff('0x6'));var config=require(_0x68ff('0x7'));var attributes=require(_0x68ff('0x8'));module[_0x68ff('0x9')]=function(_0x423b8,_0x1c8532){return _0x423b8[_0x68ff('0xa')](_0x68ff('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eeb=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions'];(function(_0x1e1639,_0x352143){var _0x29893c=function(_0x56cb00){while(--_0x56cb00){_0x1e1639['push'](_0x1e1639['shift']());}};_0x29893c(++_0x352143);}(_0x8eeb,0xc0));var _0xb8ee=function(_0x3cecf8,_0x1fe297){_0x3cecf8=_0x3cecf8-0x0;var _0x1c88fe=_0x8eeb[_0x3cecf8];return _0x1c88fe;};'use strict';var _=require(_0xb8ee('0x0'));var util=require('util');var logger=require(_0xb8ee('0x1'))(_0xb8ee('0x2'));var moment=require(_0xb8ee('0x3'));var BPromise=require(_0xb8ee('0x4'));var rp=require(_0xb8ee('0x5'));var fs=require('fs');var path=require(_0xb8ee('0x6'));var rimraf=require(_0xb8ee('0x7'));var config=require(_0xb8ee('0x8'));var attributes=require(_0xb8ee('0x9'));module['exports']=function(_0x368c14,_0x2d7076){return _0x368c14[_0xb8ee('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xb8ee('0xb'),'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 94af3fc..42b33a8 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 _0xa7a9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xa7a9,0x1b5));var _0x9a7a=function(_0x6f0abb,_0x252e84){_0x6f0abb=_0x6f0abb-0x0;var _0x46e894=_0xa7a9[_0x6f0abb];return _0x46e894;};'use strict';var _=require(_0x9a7a('0x0'));var util=require(_0x9a7a('0x1'));var moment=require(_0x9a7a('0x2'));var BPromise=require(_0x9a7a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a7a('0x4'));var db=require(_0x9a7a('0x5'))['db'];var utils=require(_0x9a7a('0x6'));var logger=require(_0x9a7a('0x7'))(_0x9a7a('0x8'));var config=require(_0x9a7a('0x9'));var jayson=require(_0x9a7a('0xa'));var client=jayson[_0x9a7a('0xb')][_0x9a7a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dc5f2,_0x377d73,_0x19df5e){return new BPromise(function(_0x5450ed,_0x3f0340){return client[_0x9a7a('0xd')](_0x4dc5f2,_0x19df5e)[_0x9a7a('0xe')](function(_0x191388){logger[_0x9a7a('0xf')](_0x9a7a('0x10'),_0x377d73,'request\x20sent');logger[_0x9a7a('0x11')](_0x9a7a('0x12'),_0x377d73,_0x9a7a('0x13'),JSON[_0x9a7a('0x14')](_0x191388));if(_0x191388[_0x9a7a('0x15')]){if(_0x191388[_0x9a7a('0x15')][_0x9a7a('0x16')]===0x1f4){logger[_0x9a7a('0x15')](_0x9a7a('0x10'),_0x377d73,_0x191388[_0x9a7a('0x15')][_0x9a7a('0x17')]);return _0x3f0340(_0x191388[_0x9a7a('0x15')][_0x9a7a('0x17')]);}logger['error'](_0x9a7a('0x10'),_0x377d73,_0x191388[_0x9a7a('0x15')][_0x9a7a('0x17')]);return _0x5450ed(_0x191388[_0x9a7a('0x15')][_0x9a7a('0x17')]);}else{logger[_0x9a7a('0xf')](_0x9a7a('0x10'),_0x377d73,_0x9a7a('0x13'));_0x5450ed(_0x191388[_0x9a7a('0x18')][_0x9a7a('0x17')]);}})[_0x9a7a('0x19')](function(_0x595ed2){logger[_0x9a7a('0x15')](_0x9a7a('0x10'),_0x377d73,_0x595ed2);_0x3f0340(_0x595ed2);});});} \ No newline at end of file +var _0x496d=['request\x20sent','debug','stringify','error','code','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x496d,0x1d7));var _0xd496=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x496d[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require('lodash');var util=require(_0xd496('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd496('0x1'));var fs=require('fs');var Redis=require(_0xd496('0x2'));var db=require(_0xd496('0x3'))['db'];var utils=require(_0xd496('0x4'));var logger=require('../../config/logger')(_0xd496('0x5'));var config=require('../../config/environment');var jayson=require(_0xd496('0x6'));var client=jayson[_0xd496('0x7')][_0xd496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ec6e9,_0xa30f99,_0x4f0785){return new BPromise(function(_0x4480b1,_0x22ad2f){return client[_0xd496('0x9')](_0x5ec6e9,_0x4f0785)[_0xd496('0xa')](function(_0x52e730){logger['info'](_0xd496('0xb'),_0xa30f99,_0xd496('0xc'));logger[_0xd496('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xa30f99,_0xd496('0xc'),JSON[_0xd496('0xe')](_0x52e730));if(_0x52e730[_0xd496('0xf')]){if(_0x52e730[_0xd496('0xf')][_0xd496('0x10')]===0x1f4){logger[_0xd496('0xf')](_0xd496('0xb'),_0xa30f99,_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);return _0x22ad2f(_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);}logger[_0xd496('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xa30f99,_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);return _0x4480b1(_0x52e730[_0xd496('0xf')][_0xd496('0x11')]);}else{logger[_0xd496('0x12')](_0xd496('0xb'),_0xa30f99,_0xd496('0xc'));_0x4480b1(_0x52e730[_0xd496('0x13')][_0xd496('0x11')]);}})[_0xd496('0x14')](function(_0x51df90){logger['error'](_0xd496('0xb'),_0xa30f99,_0x51df90);_0x22ad2f(_0x51df90);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index ef6664d..3aff5d3 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1064eb,_0x481da7){var _0x50a20d=function(_0x5029bf){while(--_0x5029bf){_0x1064eb['push'](_0x1064eb['shift']());}};_0x50a20d(++_0x481da7);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router; \ No newline at end of file +var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7aafb11..7f5f2e6 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 _0xbfa1=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2da02e,_0x38aec0){var _0x43ae45=function(_0x18bd18){while(--_0x18bd18){_0x2da02e['push'](_0x2da02e['shift']());}};_0x43ae45(++_0x38aec0);}(_0xbfa1,0x130));var _0x1bfa=function(_0x490679,_0x5ab70e){_0x490679=_0x490679-0x0;var _0x400516=_0xbfa1[_0x490679];return _0x400516;};'use strict';var Sequelize=require(_0x1bfa('0x0'));module[_0x1bfa('0x1')]={'name':{'type':Sequelize[_0x1bfa('0x2')],'unique':_0x1bfa('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1bfa('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1bfa('0x4')](_0x1bfa('0x5'),_0x1bfa('0x6'),_0x1bfa('0x7'))}}; \ No newline at end of file +var _0xb514=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xb514,0xd5));var _0x4b51=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xb514[_0x49c057];return _0xd8f0e6;};'use strict';var Sequelize=require(_0x4b51('0x0'));module[_0x4b51('0x1')]={'name':{'type':Sequelize[_0x4b51('0x2')],'unique':_0x4b51('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b51('0x2')]},'timeout':{'type':Sequelize[_0x4b51('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b51('0x5')](_0x4b51('0x6'),_0x4b51('0x7'),_0x4b51('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index ecb0785..e0cf9a4 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 _0x5cd7=['./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','name','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','findAll','rows','show','params','keys','intersection','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','forEach','emit','removeTeams','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','all','compact','value','isEmpty','removeAgents','addAgents','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5cd7,0x77));var _0x75cd=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x5cd7[_0x7e918f];return _0x5b35ab;};'use strict';var emlformat=require(_0x75cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75cd('0x1'));var rp=require(_0x75cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75cd('0x3'));var path=require(_0x75cd('0x4'));var sox=require(_0x75cd('0x5'));var csv=require(_0x75cd('0x6'));var ejs=require(_0x75cd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75cd('0x8'));var squel=require(_0x75cd('0x9'));var crypto=require(_0x75cd('0xa'));var jsforce=require(_0x75cd('0xb'));var deskjs=require(_0x75cd('0xc'));var toCsv=require(_0x75cd('0x6'));var querystring=require(_0x75cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x75cd('0xe'));var authService=require(_0x75cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x75cd('0x10'));var hardwareService=require(_0x75cd('0x11'));var logger=require(_0x75cd('0x12'))(_0x75cd('0x13'));var utils=require(_0x75cd('0x14'));var config=require(_0x75cd('0x15'));var licenseUtil=require(_0x75cd('0x16'));var db=require(_0x75cd('0x17'))['db'];config[_0x75cd('0x18')]=_['defaults'](config[_0x75cd('0x18')],{'host':_0x75cd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75cd('0x18')]));require(_0x75cd('0x1a'))[_0x75cd('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x75cd('0x1c')][_0x75cd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x14a52c,_0xa3ca79,_0x228907,_0x50629d){return new BPromise(function(_0x15f253,_0x149363){var _0x6d1ee6=_0x50629d||client;return _0x6d1ee6['request'](_0x14a52c,_0x228907)[_0x75cd('0x1e')](function(_0x413897){logger[_0x75cd('0x1f')](_0x75cd('0x20'),_0xa3ca79,_0x75cd('0x21'));logger['debug'](_0x75cd('0x22'),_0xa3ca79,_0x75cd('0x21'),JSON[_0x75cd('0x23')](_0x413897));if(_0x413897[_0x75cd('0x24')]){if(_0x413897[_0x75cd('0x24')]['code']===0x1f4){logger[_0x75cd('0x24')](_0x75cd('0x20'),_0xa3ca79,_0x413897[_0x75cd('0x24')][_0x75cd('0x25')]);return _0x149363(_0x413897['error']['message']);}logger[_0x75cd('0x24')]('ChatQueue,\x20%s,\x20%s',_0xa3ca79,_0x413897['error'][_0x75cd('0x25')]);return _0x15f253(_0x413897[_0x75cd('0x24')][_0x75cd('0x25')]);}else{logger[_0x75cd('0x1f')](_0x75cd('0x20'),_0xa3ca79,_0x75cd('0x21'));_0x15f253(_0x413897[_0x75cd('0x26')][_0x75cd('0x25')]);}})[_0x75cd('0x27')](function(_0x14a53f){logger[_0x75cd('0x24')](_0x75cd('0x20'),_0xa3ca79,_0x14a53f);_0x149363(_0x14a53f);});});}function respondWithStatusCode(_0x2d34d0,_0x2e0101){_0x2e0101=_0x2e0101||0xcc;return function(_0x564db9){if(_0x564db9){return _0x2d34d0[_0x75cd('0x28')](_0x2e0101);}return _0x2d34d0[_0x75cd('0x29')](_0x2e0101)[_0x75cd('0x2a')]();};}function respondWithResult(_0x4d247d,_0x1c182c){_0x1c182c=_0x1c182c||0xc8;return function(_0x507fee){if(_0x507fee){return _0x4d247d[_0x75cd('0x29')](_0x1c182c)[_0x75cd('0x2b')](_0x507fee);}};}function respondWithFilteredResult(_0x5909da,_0x1409b5){return function(_0x1e4b9d){if(_0x1e4b9d){var _0x5d325e=typeof _0x1409b5[_0x75cd('0x2c')]===_0x75cd('0x2d')&&typeof _0x1409b5[_0x75cd('0x2e')]===_0x75cd('0x2d');var _0x2c8c1a=_0x1e4b9d[_0x75cd('0x2f')];var _0x38a641=_0x5d325e?0x0:_0x1409b5[_0x75cd('0x2c')];var _0x4b99c2=_0x5d325e?_0x1e4b9d['count']:_0x1409b5[_0x75cd('0x2c')]+_0x1409b5[_0x75cd('0x2e')];var _0x3d9327;if(_0x4b99c2>=_0x2c8c1a){_0x4b99c2=_0x2c8c1a;_0x3d9327=0xc8;}else{_0x3d9327=0xce;}_0x5909da['status'](_0x3d9327);return _0x5909da[_0x75cd('0x30')](_0x75cd('0x31'),_0x38a641+'-'+_0x4b99c2+'/'+_0x2c8c1a)[_0x75cd('0x2b')](_0x1e4b9d);}return null;};}function patchUpdates(_0x20fd1c){return function(_0x378948){try{jsonpatch[_0x75cd('0x32')](_0x378948,_0x20fd1c,!![]);}catch(_0x2c5ee5){return BPromise[_0x75cd('0x33')](_0x2c5ee5);}return _0x378948['save']();};}function saveUpdates(_0x338988,_0x3261af){return function(_0x5604f4){if(_0x5604f4){return _0x5604f4[_0x75cd('0x34')](_0x338988)[_0x75cd('0x1e')](function(_0x2aeb88){return _0x2aeb88;});}return null;};}function removeEntity(_0x15ad76,_0x5bd779){return function(_0x50c602){if(_0x50c602){return _0x50c602[_0x75cd('0x35')]()[_0x75cd('0x1e')](function(){var _0x986256=_0x50c602[_0x75cd('0x36')]({'plain':!![]});var _0x376eb3=_0x75cd('0x37');return db['UserProfileResource'][_0x75cd('0x35')]({'where':{'type':_0x376eb3,'resourceId':_0x986256['id']}})['then'](function(){return _0x50c602;});})[_0x75cd('0x1e')](function(){_0x15ad76['status'](0xcc)[_0x75cd('0x2a')]();});}};}function handleEntityNotFound(_0x12ba65,_0x181c85){return function(_0x1e0d45){if(!_0x1e0d45){_0x12ba65[_0x75cd('0x28')](0x194);}return _0x1e0d45;};}function handleError(_0x5616f5,_0x40e7af){_0x40e7af=_0x40e7af||0x1f4;return function(_0x2cd9af){logger[_0x75cd('0x24')](_0x2cd9af['stack']);if(_0x2cd9af[_0x75cd('0x38')]){delete _0x2cd9af[_0x75cd('0x38')];}_0x5616f5[_0x75cd('0x29')](_0x40e7af)['send'](_0x2cd9af);};}exports[_0x75cd('0x39')]=function(_0x5891db,_0x163eed){var _0x337257={},_0x255fd7={},_0x4e9c24={'count':0x0,'rows':[]};var _0x2fa414=_[_0x75cd('0x3a')](db['ChatQueue'][_0x75cd('0x3b')],function(_0x58a74b){return{'name':_0x58a74b['fieldName'],'type':_0x58a74b[_0x75cd('0x3c')][_0x75cd('0x3d')]};});_0x255fd7[_0x75cd('0x3e')]=_[_0x75cd('0x3a')](_0x2fa414,_0x75cd('0x38'));_0x255fd7[_0x75cd('0x3f')]=_['keys'](_0x5891db[_0x75cd('0x3f')]);_0x255fd7[_0x75cd('0x40')]=_['intersection'](_0x255fd7[_0x75cd('0x3e')],_0x255fd7[_0x75cd('0x3f')]);_0x337257[_0x75cd('0x41')]=_['intersection'](_0x255fd7[_0x75cd('0x3e')],qs[_0x75cd('0x42')](_0x5891db[_0x75cd('0x3f')][_0x75cd('0x42')]));_0x337257[_0x75cd('0x41')]=_0x337257['attributes'][_0x75cd('0x43')]?_0x337257[_0x75cd('0x41')]:_0x255fd7[_0x75cd('0x3e')];if(!_0x5891db[_0x75cd('0x3f')][_0x75cd('0x44')]('nolimit')){_0x337257[_0x75cd('0x2e')]=qs[_0x75cd('0x2e')](_0x5891db[_0x75cd('0x3f')][_0x75cd('0x2e')]);_0x337257[_0x75cd('0x2c')]=qs[_0x75cd('0x2c')](_0x5891db[_0x75cd('0x3f')]['offset']);}_0x337257[_0x75cd('0x45')]=qs['sort'](_0x5891db[_0x75cd('0x3f')][_0x75cd('0x46')]);_0x337257[_0x75cd('0x47')]=qs[_0x75cd('0x40')](_[_0x75cd('0x48')](_0x5891db[_0x75cd('0x3f')],_0x255fd7['filters']),_0x2fa414);if(_0x5891db[_0x75cd('0x3f')][_0x75cd('0x49')]){_0x337257[_0x75cd('0x47')]=_[_0x75cd('0x4a')](_0x337257[_0x75cd('0x47')],{'$or':_['map'](_0x2fa414,function(_0x3812bf){if(_0x3812bf['type']!==_0x75cd('0x4b')){var _0x4d91ce={};_0x4d91ce[_0x3812bf['name']]={'$like':'%'+_0x5891db['query']['filter']+'%'};return _0x4d91ce;}})});}_0x337257=_[_0x75cd('0x4a')]({},_0x337257,_0x5891db['options']);var _0x54af1b={'where':_0x337257['where']};return db[_0x75cd('0x4c')]['count'](_0x54af1b)[_0x75cd('0x1e')](function(_0x5a2ac6){_0x4e9c24[_0x75cd('0x2f')]=_0x5a2ac6;if(_0x5891db[_0x75cd('0x3f')][_0x75cd('0x4d')]){_0x337257['include']=[{'all':!![]}];}return db[_0x75cd('0x4c')][_0x75cd('0x4e')](_0x337257);})[_0x75cd('0x1e')](function(_0x562be0){_0x4e9c24[_0x75cd('0x4f')]=_0x562be0;return _0x4e9c24;})[_0x75cd('0x1e')](respondWithFilteredResult(_0x163eed,_0x337257))[_0x75cd('0x27')](handleError(_0x163eed,null));};exports[_0x75cd('0x50')]=function(_0x539a71,_0x59c940){var _0x3483ac={'raw':!![],'where':{'id':_0x539a71[_0x75cd('0x51')]['id']}},_0x23c090={};_0x23c090['model']=_[_0x75cd('0x52')](db[_0x75cd('0x4c')]['rawAttributes']);_0x23c090[_0x75cd('0x3f')]=_['keys'](_0x539a71[_0x75cd('0x3f')]);_0x23c090['filters']=_[_0x75cd('0x53')](_0x23c090[_0x75cd('0x3e')],_0x23c090[_0x75cd('0x3f')]);_0x3483ac[_0x75cd('0x41')]=_['intersection'](_0x23c090[_0x75cd('0x3e')],qs[_0x75cd('0x42')](_0x539a71[_0x75cd('0x3f')][_0x75cd('0x42')]));_0x3483ac[_0x75cd('0x41')]=_0x3483ac[_0x75cd('0x41')][_0x75cd('0x43')]?_0x3483ac[_0x75cd('0x41')]:_0x23c090['model'];if(_0x539a71[_0x75cd('0x3f')][_0x75cd('0x4d')]){_0x3483ac['include']=[{'all':!![]}];}_0x3483ac=_[_0x75cd('0x4a')]({},_0x3483ac,_0x539a71[_0x75cd('0x54')]);return db[_0x75cd('0x4c')][_0x75cd('0x55')](_0x3483ac)[_0x75cd('0x1e')](handleEntityNotFound(_0x59c940,null))[_0x75cd('0x1e')](respondWithResult(_0x59c940,null))[_0x75cd('0x27')](handleError(_0x59c940,null));};exports[_0x75cd('0x56')]=function(_0x34a123,_0x442e27){return db[_0x75cd('0x4c')][_0x75cd('0x56')](_0x34a123[_0x75cd('0x57')],{})[_0x75cd('0x1e')](function(_0x4c2b76){var _0xfa72cd=_0x34a123['user'][_0x75cd('0x36')]({'plain':!![]});if(!_0xfa72cd)throw new Error(_0x75cd('0x58'));if(_0xfa72cd[_0x75cd('0x59')]==='user'){var _0x53a49a=_0x4c2b76['get']({'plain':!![]});var _0x1164c9=_0x75cd('0x37');return db[_0x75cd('0x5a')][_0x75cd('0x55')]({'where':{'name':_0x1164c9,'userProfileId':_0xfa72cd[_0x75cd('0x5b')]},'raw':!![]})[_0x75cd('0x1e')](function(_0x336559){if(_0x336559&&_0x336559[_0x75cd('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x53a49a['name'],'resourceId':_0x53a49a['id'],'type':_0x336559[_0x75cd('0x38')],'sectionId':_0x336559['id']},{})[_0x75cd('0x1e')](function(){return _0x4c2b76;});}else{return _0x4c2b76;}})[_0x75cd('0x27')](function(_0x530012){logger[_0x75cd('0x24')](_0x75cd('0x5d'),_0x530012);throw _0x530012;});}return _0x4c2b76;})[_0x75cd('0x1e')](respondWithResult(_0x442e27,0xc9))['catch'](handleError(_0x442e27,null));};exports[_0x75cd('0x34')]=function(_0x52523a,_0xf89819){if(_0x52523a[_0x75cd('0x57')]['id']){delete _0x52523a['body']['id'];}return db[_0x75cd('0x4c')]['find']({'where':{'id':_0x52523a['params']['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0xf89819,null))[_0x75cd('0x1e')](saveUpdates(_0x52523a[_0x75cd('0x57')],null))['then'](respondWithResult(_0xf89819,null))[_0x75cd('0x27')](handleError(_0xf89819,null));};exports[_0x75cd('0x35')]=function(_0x352f65,_0x164421){return db[_0x75cd('0x4c')][_0x75cd('0x55')]({'where':{'id':_0x352f65['params']['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x164421,null))[_0x75cd('0x1e')](removeEntity(_0x164421,null))[_0x75cd('0x27')](handleError(_0x164421,null));};exports[_0x75cd('0x5e')]=function(_0x5797db,_0x31257c){return db[_0x75cd('0x4c')]['describe']()[_0x75cd('0x1e')](respondWithResult(_0x31257c,null))[_0x75cd('0x27')](handleError(_0x31257c,null));};exports[_0x75cd('0x5f')]=function(_0x55d638,_0x4d0c8e,_0x1c87a6){var _0x26c24a={'raw':!![],'where':{}},_0x16574e={},_0x524cd4;return db['ChatQueue'][_0x75cd('0x60')]({'where':{'id':_0x55d638[_0x75cd('0x51')]['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x4d0c8e,null))['then'](function(_0x3139f2){if(_0x3139f2){_0x524cd4=_0x3139f2[_0x75cd('0x36')]({'plain':!![]});_0x16574e['model']=_[_0x75cd('0x52')](db[_0x75cd('0x61')]['rawAttributes']);_0x16574e[_0x75cd('0x3f')]=_[_0x75cd('0x52')](_0x55d638['query']);_0x16574e['filters']=_['intersection'](_0x16574e[_0x75cd('0x3e')],_0x16574e[_0x75cd('0x3f')]);_0x26c24a['attributes']=_[_0x75cd('0x53')](_0x16574e['model'],qs['fields'](_0x55d638[_0x75cd('0x3f')][_0x75cd('0x42')]));_0x26c24a[_0x75cd('0x41')]=_0x26c24a[_0x75cd('0x41')][_0x75cd('0x43')]?_0x26c24a['attributes']:_0x16574e[_0x75cd('0x3e')];if(!_0x55d638[_0x75cd('0x3f')][_0x75cd('0x44')](_0x75cd('0x62'))){_0x26c24a[_0x75cd('0x2e')]=qs[_0x75cd('0x2e')](_0x55d638[_0x75cd('0x3f')]['limit']);_0x26c24a[_0x75cd('0x2c')]=qs[_0x75cd('0x2c')](_0x55d638[_0x75cd('0x3f')][_0x75cd('0x2c')]);}_0x26c24a['order']=qs['sort'](_0x55d638[_0x75cd('0x3f')][_0x75cd('0x46')]);_0x26c24a[_0x75cd('0x47')]=qs[_0x75cd('0x40')](_[_0x75cd('0x48')](_0x55d638[_0x75cd('0x3f')],_0x16574e[_0x75cd('0x40')]));_0x26c24a['where']['ChatQueueId']=_0x3139f2['id'];if(_0x55d638['query']['filter']){_0x26c24a['where']=_[_0x75cd('0x4a')](_0x26c24a[_0x75cd('0x47')],{'$or':_['map'](_0x26c24a['attributes'],function(_0xaafff0){var _0x18f685={};_0x18f685[_0xaafff0]={'$like':'%'+_0x55d638[_0x75cd('0x3f')]['filter']+'%'};return _0x18f685;})});}_0x26c24a=_[_0x75cd('0x4a')]({},_0x26c24a,_0x55d638['options']);return db['UserChatQueue'][_0x75cd('0x4e')](_0x26c24a);}})[_0x75cd('0x1e')](function(_0x3c512c){if(_0x3c512c){return db[_0x75cd('0x63')]['findAndCountAll']({'where':{'id':_[_0x75cd('0x3a')](_0x3c512c,_0x75cd('0x64')),'role':_0x75cd('0x65')},'attributes':['id',_0x75cd('0x38'),_0x75cd('0x66'),_0x75cd('0x67'),_0x75cd('0x68')]});}})[_0x75cd('0x1e')](function(_0x55b856){if(_0x55b856){return{'count':_0x55b856[_0x75cd('0x2f')],'rows':_['map'](_0x55b856['rows'],function(_0x2e8d75){return{'membername':_0x2e8d75[_0x75cd('0x38')],'UserId':_0x2e8d75['id'],'queue_name':_0x524cd4[_0x75cd('0x38')],'ChatQueueId':_0x524cd4['id'],'interface':util[_0x75cd('0x69')]('%s/%s',_0x75cd('0x6a'),_0x2e8d75[_0x75cd('0x38')]),'penalty':0x0,'paused':_0x2e8d75[_0x75cd('0x66')],'createdAt':_0x2e8d75['createdAt'],'updatedAt':_0x2e8d75[_0x75cd('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x75cd('0x1e')](respondWithFilteredResult(_0x4d0c8e,_0x26c24a))[_0x75cd('0x27')](handleError(_0x4d0c8e,null));};exports[_0x75cd('0x6b')]=function(_0x5c6f67,_0x5d2aa6,_0x186fd2){var _0x1aab0e={};var _0x53f6e5={};var _0x1a1b96;var _0x4fedcd;return db['ChatQueue'][_0x75cd('0x60')]({'where':{'id':_0x5c6f67['params']['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x5d2aa6,null))[_0x75cd('0x1e')](function(_0x2c02ec){if(_0x2c02ec){_0x1a1b96=_0x2c02ec;_0x53f6e5['model']=_['keys'](db[_0x75cd('0x6c')][_0x75cd('0x3b')]);_0x53f6e5[_0x75cd('0x3f')]=_[_0x75cd('0x52')](_0x5c6f67['query']);_0x53f6e5[_0x75cd('0x40')]=_[_0x75cd('0x53')](_0x53f6e5[_0x75cd('0x3e')],_0x53f6e5[_0x75cd('0x3f')]);_0x1aab0e[_0x75cd('0x41')]=_[_0x75cd('0x53')](_0x53f6e5[_0x75cd('0x3e')],qs['fields'](_0x5c6f67[_0x75cd('0x3f')][_0x75cd('0x42')]));_0x1aab0e[_0x75cd('0x41')]=_0x1aab0e['attributes'][_0x75cd('0x43')]?_0x1aab0e[_0x75cd('0x41')]:_0x53f6e5[_0x75cd('0x3e')];_0x1aab0e['order']=qs['sort'](_0x5c6f67['query'][_0x75cd('0x46')]);_0x1aab0e[_0x75cd('0x47')]=qs[_0x75cd('0x40')](_[_0x75cd('0x48')](_0x5c6f67[_0x75cd('0x3f')],_0x53f6e5['filters']));if(_0x5c6f67[_0x75cd('0x3f')][_0x75cd('0x49')]){_0x1aab0e['where']=_['merge'](_0x1aab0e[_0x75cd('0x47')],{'$or':_[_0x75cd('0x3a')](_0x1aab0e[_0x75cd('0x41')],function(_0x38a2b0){var _0x99634e={};_0x99634e[_0x38a2b0]={'$like':'%'+_0x5c6f67[_0x75cd('0x3f')][_0x75cd('0x49')]+'%'};return _0x99634e;})});}_0x1aab0e=_[_0x75cd('0x4a')]({},_0x1aab0e,_0x5c6f67[_0x75cd('0x54')]);return _0x1a1b96[_0x75cd('0x6b')](_0x1aab0e);}})[_0x75cd('0x1e')](function(_0x1bcab2){if(_0x1bcab2){_0x4fedcd=_0x1bcab2['length'];if(!_0x5c6f67[_0x75cd('0x3f')][_0x75cd('0x44')](_0x75cd('0x62'))){_0x1aab0e[_0x75cd('0x2e')]=qs[_0x75cd('0x2e')](_0x5c6f67['query'][_0x75cd('0x2e')]);_0x1aab0e['offset']=qs[_0x75cd('0x2c')](_0x5c6f67[_0x75cd('0x3f')]['offset']);}return _0x1a1b96['getTeams'](_0x1aab0e);}})['then'](function(_0x1daea3){if(_0x1daea3){return _0x1daea3?{'count':_0x4fedcd,'rows':_0x1daea3}:null;}})['then'](respondWithResult(_0x5d2aa6,null))[_0x75cd('0x27')](handleError(_0x5d2aa6,null));};exports[_0x75cd('0x6d')]=function(_0x1d3fb0,_0xf42b06,_0x16a9c8){var _0x53487e=_0x1d3fb0[_0x75cd('0x57')][_0x75cd('0x6e')];return db['Team']['findAll']({'where':{'id':_0x53487e},'attributes':['id'],'include':[{'model':db[_0x75cd('0x63')],'as':'Agents','attributes':['id',_0x75cd('0x38'),_0x75cd('0x6f'),_0x75cd('0x70'),_0x75cd('0x71')],'raw':!![]}]})['then'](function(_0x4fe0eb){if(_0x4fe0eb){var _0x5a198c=_[_0x75cd('0x72')](_0x4fe0eb,function(_0x80dc88){var _0xbdeb5a=_0x80dc88[_0x75cd('0x36')]({'plain':!![]});return _0xbdeb5a[_0x75cd('0x73')];});return db[_0x75cd('0x4c')][_0x75cd('0x55')]({'where':{'id':_0x1d3fb0[_0x75cd('0x51')]['id']}})[_0x75cd('0x1e')](function(_0x4afe1c){return db['sequelize'][_0x75cd('0x74')](function(_0x26f27d){return _0x4afe1c[_0x75cd('0x6d')](_0x53487e,{'transaction':_0x26f27d})[_0x75cd('0x1e')](function(){return BPromise[_0x75cd('0x75')](_0x5a198c,function(_0x4da702){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x4da702['id'],'ChatQueueId':_0x1d3fb0[_0x75cd('0x51')]['id']},'transaction':_0x26f27d});});})[_0x75cd('0x1e')](function(){_0x5a198c[_0x75cd('0x76')](function(_0x2b0552){socket[_0x75cd('0x77')]('userChatQueue:save',{'UserId':_0x2b0552['id'],'ChatQueueId':_0x4afe1c['id']});});});});});}})[_0x75cd('0x1e')](respondWithStatusCode(_0xf42b06,null))[_0x75cd('0x27')](handleError(_0xf42b06,null));};exports[_0x75cd('0x78')]=function(_0x14b25e,_0x4c4319,_0x31ebfd){return db[_0x75cd('0x6c')]['findAll']({'where':{'id':_0x14b25e[_0x75cd('0x3f')][_0x75cd('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x75cd('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x75cd('0x1e')](handleEntityNotFound(_0x4c4319,null))[_0x75cd('0x1e')](function(_0x994c3c){var _0x1a36f4=_[_0x75cd('0x3a')](_0x994c3c,'id');var _0x3b4c5e=[];var _0x59644a=[];var _0x36dafc=squel['select']();_0x36dafc[_0x75cd('0x79')]('tq.TeamId')[_0x75cd('0x7a')](_0x75cd('0x7b'),'tq')['join'](_0x75cd('0x7c'),'ut',_0x75cd('0x7d'))[_0x75cd('0x47')](_0x75cd('0x7e'),_0x14b25e['params']['id']);for(var _0x5217d9=0x0;_0x5217d9<_0x994c3c[_0x75cd('0x43')];_0x5217d9+=0x1){let _0x5a7e25=_0x994c3c[_0x5217d9];for(var _0x547c25=0x0;_0x547c25<_0x5a7e25[_0x75cd('0x73')][_0x75cd('0x43')];_0x547c25+=0x1){let _0x493877=_0x5a7e25[_0x75cd('0x73')][_0x547c25];var _0x4e9644=_0x36dafc[_0x75cd('0x7f')]();_0x4e9644[_0x75cd('0x47')](_0x75cd('0x80'),_0x493877['id']);_0x59644a[_0x75cd('0x81')](db[_0x75cd('0x82')][_0x75cd('0x3f')](_0x4e9644[_0x75cd('0x83')](),{'type':db[_0x75cd('0x82')][_0x75cd('0x84')][_0x75cd('0x85')]})[_0x75cd('0x1e')](function(_0x649a33){if(_0x649a33['length']===0x1){return _0x493877['id'];}else{var _0x2aefe6=_[_0x75cd('0x86')](_[_0x75cd('0x3a')](_0x649a33,'TeamId'),function(_0x899192){return _['includes'](_0x1a36f4,_0x899192);});if(_0x2aefe6){return _0x493877['id'];}}}));}}return BPromise[_0x75cd('0x87')](_0x59644a)[_0x75cd('0x1e')](function(_0x158c2f){_0x3b4c5e=_(_0x3b4c5e)['union'](_0x158c2f)[_0x75cd('0x88')]()[_0x75cd('0x89')]();return db[_0x75cd('0x4c')]['find']({'where':{'id':_0x14b25e[_0x75cd('0x51')]['id']}})['then'](function(_0x56a1b7){return db[_0x75cd('0x82')][_0x75cd('0x74')](function(_0x5aa3b7){return _0x56a1b7[_0x75cd('0x78')](_0x14b25e[_0x75cd('0x3f')][_0x75cd('0x6e')],{'transaction':_0x5aa3b7})[_0x75cd('0x1e')](function(){if(!_[_0x75cd('0x8a')](_0x3b4c5e)){return _0x56a1b7[_0x75cd('0x8b')](_0x3b4c5e,{'transaction':_0x5aa3b7});}})[_0x75cd('0x1e')](function(){_0x3b4c5e[_0x75cd('0x76')](function(_0x561485){socket[_0x75cd('0x77')]('userChatQueue:remove',{'UserId':_0x561485,'ChatQueueId':_0x56a1b7['id']});});});});});});})[_0x75cd('0x1e')](respondWithStatusCode(_0x4c4319,null))['catch'](handleError(_0x4c4319,null));};exports[_0x75cd('0x8c')]=function(_0x8cf28e,_0x5e7ab0,_0xecacd3){return db['ChatQueue'][_0x75cd('0x55')]({'where':{'id':_0x8cf28e['params']['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x5e7ab0,null))[_0x75cd('0x1e')](function(_0x4376d3){if(_0x4376d3){return _0x4376d3['addAgents'](_0x8cf28e[_0x75cd('0x57')]['ids'],_['omit'](_0x8cf28e[_0x75cd('0x57')],[_0x75cd('0x6e'),'id'])||{})['spread'](function(_0x443bd0){for(var _0x6ab44=0x0;_0x6ab44<_0x8cf28e['body'][_0x75cd('0x6e')]['length'];_0x6ab44+=0x1){socket[_0x75cd('0x77')](_0x75cd('0x8d'),{'UserId':Number(_0x8cf28e['body'][_0x75cd('0x6e')][_0x6ab44]),'ChatQueueId':Number(_0x8cf28e[_0x75cd('0x51')]['id'])});}return _0x443bd0;});}})[_0x75cd('0x1e')](respondWithResult(_0x5e7ab0,null))[_0x75cd('0x27')](handleError(_0x5e7ab0,null));};exports[_0x75cd('0x8b')]=function(_0x97075b,_0x54f24e,_0x3f8449){return db['ChatQueue']['find']({'where':{'id':_0x97075b['params']['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x54f24e,null))[_0x75cd('0x1e')](function(_0x41ac2c){if(_0x41ac2c){return _0x41ac2c[_0x75cd('0x8b')](_0x97075b[_0x75cd('0x3f')][_0x75cd('0x6e')])['then'](function(){if(_[_0x75cd('0x8e')](_0x97075b[_0x75cd('0x3f')][_0x75cd('0x6e')])){for(var _0x1a89a9=0x0;_0x1a89a9<_0x97075b['query'][_0x75cd('0x6e')][_0x75cd('0x43')];_0x1a89a9+=0x1){socket[_0x75cd('0x77')](_0x75cd('0x8f'),{'UserId':Number(_0x97075b['query'][_0x75cd('0x6e')][_0x1a89a9]),'ChatQueueId':Number(_0x97075b[_0x75cd('0x51')]['id'])});}}else{socket[_0x75cd('0x77')]('userChatQueue:remove',{'UserId':Number(_0x97075b[_0x75cd('0x3f')][_0x75cd('0x6e')]),'ChatQueueId':Number(_0x97075b[_0x75cd('0x51')]['id'])});}});}})[_0x75cd('0x1e')](respondWithStatusCode(_0x54f24e,null))['catch'](handleError(_0x54f24e,null));};exports['getAgents']=function(_0x57991b,_0x5b2c68,_0x38d361){var _0x400c2f={};var _0x2bf2e9={};var _0x543c83;var _0xa2578d;return db['ChatQueue'][_0x75cd('0x60')]({'where':{'id':_0x57991b[_0x75cd('0x51')]['id']}})[_0x75cd('0x1e')](handleEntityNotFound(_0x5b2c68,null))[_0x75cd('0x1e')](function(_0x530e27){if(_0x530e27){_0x543c83=_0x530e27;_0x2bf2e9[_0x75cd('0x3e')]=_['keys'](db[_0x75cd('0x63')][_0x75cd('0x3b')]);_0x2bf2e9[_0x75cd('0x3f')]=_[_0x75cd('0x52')](_0x57991b['query']);_0x2bf2e9[_0x75cd('0x40')]=_[_0x75cd('0x53')](_0x2bf2e9[_0x75cd('0x3e')],_0x2bf2e9[_0x75cd('0x3f')]);_0x400c2f[_0x75cd('0x41')]=_[_0x75cd('0x53')](_0x2bf2e9[_0x75cd('0x3e')],qs[_0x75cd('0x42')](_0x57991b[_0x75cd('0x3f')]['fields']));_0x400c2f[_0x75cd('0x41')]=_0x400c2f[_0x75cd('0x41')][_0x75cd('0x43')]?_0x400c2f[_0x75cd('0x41')]:_0x2bf2e9['model'];_0x400c2f[_0x75cd('0x45')]=qs[_0x75cd('0x46')](_0x57991b[_0x75cd('0x3f')][_0x75cd('0x46')]);_0x400c2f[_0x75cd('0x47')]=qs[_0x75cd('0x40')](_[_0x75cd('0x48')](_0x57991b[_0x75cd('0x3f')],_0x2bf2e9[_0x75cd('0x40')]));if(_0x57991b['query'][_0x75cd('0x49')]){_0x400c2f[_0x75cd('0x47')]=_[_0x75cd('0x4a')](_0x400c2f[_0x75cd('0x47')],{'$or':_['map'](_0x400c2f[_0x75cd('0x41')],function(_0x51af4d){var _0x327d0b={};_0x327d0b[_0x51af4d]={'$like':'%'+_0x57991b['query'][_0x75cd('0x49')]+'%'};return _0x327d0b;})});}_0x400c2f=_[_0x75cd('0x4a')]({},_0x400c2f,_0x57991b[_0x75cd('0x54')]);return _0x543c83['getAgents'](_0x400c2f);}})[_0x75cd('0x1e')](function(_0x4803dd){if(_0x4803dd){_0xa2578d=_0x4803dd[_0x75cd('0x43')];if(!_0x57991b[_0x75cd('0x3f')][_0x75cd('0x44')](_0x75cd('0x62'))){_0x400c2f[_0x75cd('0x2e')]=qs['limit'](_0x57991b['query'][_0x75cd('0x2e')]);_0x400c2f[_0x75cd('0x2c')]=qs[_0x75cd('0x2c')](_0x57991b[_0x75cd('0x3f')][_0x75cd('0x2c')]);}return _0x543c83[_0x75cd('0x90')](_0x400c2f);}})[_0x75cd('0x1e')](function(_0x130b84){if(_0x130b84){return _0x130b84?{'count':_0xa2578d,'rows':_0x130b84}:null;}})[_0x75cd('0x1e')](respondWithResult(_0x5b2c68,null))[_0x75cd('0x27')](handleError(_0x5b2c68,null));}; \ No newline at end of file +var _0xc4d0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','ChatQueues','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','hasOwnProperty','nolimit','User','UserId','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','includes','all','compact','value','forEach','userChatQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x17f767,_0x2ca2be){var _0x54759c=function(_0x39e2b6){while(--_0x39e2b6){_0x17f767['push'](_0x17f767['shift']());}};_0x54759c(++_0x2ca2be);}(_0xc4d0,0x7f));var _0x0c4d=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xc4d0[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require(_0x0c4d('0x0'));var rimraf=require(_0x0c4d('0x1'));var zipdir=require(_0x0c4d('0x2'));var jsonpatch=require(_0x0c4d('0x3'));var rp=require(_0x0c4d('0x4'));var moment=require(_0x0c4d('0x5'));var BPromise=require(_0x0c4d('0x6'));var Mustache=require(_0x0c4d('0x7'));var util=require(_0x0c4d('0x8'));var path=require(_0x0c4d('0x9'));var sox=require('sox');var csv=require(_0x0c4d('0xa'));var ejs=require(_0x0c4d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c4d('0xc'));var squel=require(_0x0c4d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c4d('0xe'));var toCsv=require(_0x0c4d('0xa'));var querystring=require(_0x0c4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x0c4d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0c4d('0x11'));var as=require(_0x0c4d('0x12'));var hardwareService=require(_0x0c4d('0x13'));var logger=require(_0x0c4d('0x14'))(_0x0c4d('0x15'));var utils=require(_0x0c4d('0x16'));var config=require(_0x0c4d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c4d('0x18'))['db'];config[_0x0c4d('0x19')]=_[_0x0c4d('0x1a')](config['redis'],{'host':_0x0c4d('0x1b'),'port':0x18eb});var socket=require(_0x0c4d('0x1c'))(new Redis(config[_0x0c4d('0x19')]));require(_0x0c4d('0x1d'))[_0x0c4d('0x1e')](socket);var jayson=require(_0x0c4d('0x1f'));var client=jayson[_0x0c4d('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549c8b,_0x4cc1a3,_0x493948,_0x1418de){return new BPromise(function(_0x5032c5,_0x279483){var _0x13e4ed=_0x1418de||client;return _0x13e4ed[_0x0c4d('0x21')](_0x549c8b,_0x493948)[_0x0c4d('0x22')](function(_0x2eba4d){logger[_0x0c4d('0x23')](_0x0c4d('0x24'),_0x4cc1a3,_0x0c4d('0x25'));logger[_0x0c4d('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4cc1a3,_0x0c4d('0x25'),JSON[_0x0c4d('0x27')](_0x2eba4d));if(_0x2eba4d[_0x0c4d('0x28')]){if(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x29')]===0x1f4){logger[_0x0c4d('0x28')](_0x0c4d('0x24'),_0x4cc1a3,_0x2eba4d['error'][_0x0c4d('0x2a')]);return _0x279483(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x2a')]);}logger[_0x0c4d('0x28')](_0x0c4d('0x24'),_0x4cc1a3,_0x2eba4d['error']['message']);return _0x5032c5(_0x2eba4d[_0x0c4d('0x28')][_0x0c4d('0x2a')]);}else{logger[_0x0c4d('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4cc1a3,_0x0c4d('0x25'));_0x5032c5(_0x2eba4d['result'][_0x0c4d('0x2a')]);}})[_0x0c4d('0x2b')](function(_0x5492a0){logger[_0x0c4d('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4cc1a3,_0x5492a0);_0x279483(_0x5492a0);});});}function respondWithStatusCode(_0x81dde4,_0x24dc10){_0x24dc10=_0x24dc10||0xcc;return function(_0x4486b0){if(_0x4486b0){return _0x81dde4['sendStatus'](_0x24dc10);}return _0x81dde4[_0x0c4d('0x2c')](_0x24dc10)[_0x0c4d('0x2d')]();};}function respondWithResult(_0x3e3d9b,_0x36ea2f){_0x36ea2f=_0x36ea2f||0xc8;return function(_0x1b15a0){if(_0x1b15a0){return _0x3e3d9b['status'](_0x36ea2f)['json'](_0x1b15a0);}};}function respondWithFilteredResult(_0x4a3019,_0x539336){return function(_0x358d68){if(_0x358d68){var _0x12ffc0=typeof _0x539336[_0x0c4d('0x2e')]===_0x0c4d('0x2f')&&typeof _0x539336['limit']===_0x0c4d('0x2f');var _0x292be1=_0x358d68[_0x0c4d('0x30')];var _0x4e994b=_0x12ffc0?0x0:_0x539336[_0x0c4d('0x2e')];var _0x480a7b=_0x12ffc0?_0x358d68[_0x0c4d('0x30')]:_0x539336['offset']+_0x539336[_0x0c4d('0x31')];var _0x59f246;if(_0x480a7b>=_0x292be1){_0x480a7b=_0x292be1;_0x59f246=0xc8;}else{_0x59f246=0xce;}_0x4a3019[_0x0c4d('0x2c')](_0x59f246);return _0x4a3019[_0x0c4d('0x32')](_0x0c4d('0x33'),_0x4e994b+'-'+_0x480a7b+'/'+_0x292be1)[_0x0c4d('0x34')](_0x358d68);}return null;};}function patchUpdates(_0x449397){return function(_0x591948){try{jsonpatch[_0x0c4d('0x35')](_0x591948,_0x449397,!![]);}catch(_0x14328b){return BPromise[_0x0c4d('0x36')](_0x14328b);}return _0x591948[_0x0c4d('0x37')]();};}function saveUpdates(_0x245587,_0x2dd962){return function(_0xe11e01){if(_0xe11e01){return _0xe11e01[_0x0c4d('0x38')](_0x245587)[_0x0c4d('0x22')](function(_0x304cf3){return _0x304cf3;});}return null;};}function removeEntity(_0x19baa5,_0x4ae4e6){return function(_0x5267e1){if(_0x5267e1){return _0x5267e1[_0x0c4d('0x39')]()[_0x0c4d('0x22')](function(){var _0x5787aa=_0x5267e1['get']({'plain':!![]});var _0x2a9ef9=_0x0c4d('0x3a');return db['UserProfileResource'][_0x0c4d('0x39')]({'where':{'type':_0x2a9ef9,'resourceId':_0x5787aa['id']}})['then'](function(){return _0x5267e1;});})[_0x0c4d('0x22')](function(){_0x19baa5[_0x0c4d('0x2c')](0xcc)[_0x0c4d('0x2d')]();});}};}function handleEntityNotFound(_0x3c8172,_0x4ce8d7){return function(_0x4e5c94){if(!_0x4e5c94){_0x3c8172[_0x0c4d('0x3b')](0x194);}return _0x4e5c94;};}function handleError(_0x26f573,_0x3f4c49){_0x3f4c49=_0x3f4c49||0x1f4;return function(_0x122f7c){logger[_0x0c4d('0x28')](_0x122f7c[_0x0c4d('0x3c')]);if(_0x122f7c['name']){delete _0x122f7c[_0x0c4d('0x3d')];}_0x26f573[_0x0c4d('0x2c')](_0x3f4c49)['send'](_0x122f7c);};}exports[_0x0c4d('0x3e')]=function(_0xed3e5e,_0x37924f){var _0x14a1ca={},_0x489515={},_0x28ef29={'count':0x0,'rows':[]};var _0x15b830=_[_0x0c4d('0x3f')](db[_0x0c4d('0x40')][_0x0c4d('0x41')],function(_0x3583d8){return{'name':_0x3583d8[_0x0c4d('0x42')],'type':_0x3583d8[_0x0c4d('0x43')]['key']};});_0x489515[_0x0c4d('0x44')]=_['map'](_0x15b830,_0x0c4d('0x3d'));_0x489515[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0xed3e5e['query']);_0x489515[_0x0c4d('0x47')]=_['intersection'](_0x489515['model'],_0x489515[_0x0c4d('0x45')]);_0x14a1ca['attributes']=_[_0x0c4d('0x48')](_0x489515[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0xed3e5e[_0x0c4d('0x45')]['fields']));_0x14a1ca[_0x0c4d('0x4a')]=_0x14a1ca['attributes'][_0x0c4d('0x4b')]?_0x14a1ca[_0x0c4d('0x4a')]:_0x489515[_0x0c4d('0x44')];if(!_0xed3e5e['query']['hasOwnProperty']('nolimit')){_0x14a1ca['limit']=qs[_0x0c4d('0x31')](_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x31')]);_0x14a1ca[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0xed3e5e['query'][_0x0c4d('0x2e')]);}_0x14a1ca[_0x0c4d('0x4c')]=qs[_0x0c4d('0x4d')](_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x14a1ca[_0x0c4d('0x4e')]=qs[_0x0c4d('0x47')](_[_0x0c4d('0x4f')](_0xed3e5e[_0x0c4d('0x45')],_0x489515[_0x0c4d('0x47')]),_0x15b830);if(_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x14a1ca['where']=_[_0x0c4d('0x51')](_0x14a1ca[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x15b830,function(_0xf8a93b){if(_0xf8a93b['type']!==_0x0c4d('0x52')){var _0x2c460e={};_0x2c460e[_0xf8a93b[_0x0c4d('0x3d')]]={'$like':'%'+_0xed3e5e[_0x0c4d('0x45')][_0x0c4d('0x50')]+'%'};return _0x2c460e;}})});}_0x14a1ca=_[_0x0c4d('0x51')]({},_0x14a1ca,_0xed3e5e[_0x0c4d('0x53')]);var _0xba4f8b={'where':_0x14a1ca[_0x0c4d('0x4e')]};return db[_0x0c4d('0x40')]['count'](_0xba4f8b)[_0x0c4d('0x22')](function(_0x501b02){_0x28ef29[_0x0c4d('0x30')]=_0x501b02;if(_0xed3e5e[_0x0c4d('0x45')]['includeAll']){_0x14a1ca[_0x0c4d('0x54')]=[{'all':!![]}];}return db[_0x0c4d('0x40')][_0x0c4d('0x55')](_0x14a1ca);})[_0x0c4d('0x22')](function(_0x506a92){_0x28ef29[_0x0c4d('0x56')]=_0x506a92;return _0x28ef29;})[_0x0c4d('0x22')](respondWithFilteredResult(_0x37924f,_0x14a1ca))[_0x0c4d('0x2b')](handleError(_0x37924f,null));};exports['show']=function(_0xba7c0a,_0x4b44e7){var _0x552f50={'raw':!![],'where':{'id':_0xba7c0a['params']['id']}},_0x1ca621={};_0x1ca621[_0x0c4d('0x44')]=_[_0x0c4d('0x46')](db['ChatQueue'][_0x0c4d('0x41')]);_0x1ca621[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0xba7c0a[_0x0c4d('0x45')]);_0x1ca621[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x1ca621[_0x0c4d('0x44')],_0x1ca621[_0x0c4d('0x45')]);_0x552f50[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x1ca621['model'],qs[_0x0c4d('0x49')](_0xba7c0a[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x552f50['attributes']=_0x552f50[_0x0c4d('0x4a')]['length']?_0x552f50['attributes']:_0x1ca621[_0x0c4d('0x44')];if(_0xba7c0a[_0x0c4d('0x45')]['includeAll']){_0x552f50[_0x0c4d('0x54')]=[{'all':!![]}];}_0x552f50=_[_0x0c4d('0x51')]({},_0x552f50,_0xba7c0a[_0x0c4d('0x53')]);return db[_0x0c4d('0x40')][_0x0c4d('0x57')](_0x552f50)[_0x0c4d('0x22')](handleEntityNotFound(_0x4b44e7,null))[_0x0c4d('0x22')](respondWithResult(_0x4b44e7,null))[_0x0c4d('0x2b')](handleError(_0x4b44e7,null));};exports[_0x0c4d('0x58')]=function(_0x5e86d8,_0x3f63e0){return db[_0x0c4d('0x40')][_0x0c4d('0x58')](_0x5e86d8[_0x0c4d('0x59')],{})[_0x0c4d('0x22')](function(_0x51e8f3){var _0x42194e=_0x5e86d8[_0x0c4d('0x5a')][_0x0c4d('0x5b')]({'plain':!![]});if(!_0x42194e)throw new Error(_0x0c4d('0x5c'));if(_0x42194e['role']===_0x0c4d('0x5a')){var _0x2a2f07=_0x51e8f3[_0x0c4d('0x5b')]({'plain':!![]});var _0x190d83='ChatQueues';return db[_0x0c4d('0x5d')][_0x0c4d('0x57')]({'where':{'name':_0x190d83,'userProfileId':_0x42194e[_0x0c4d('0x5e')]},'raw':!![]})[_0x0c4d('0x22')](function(_0x31a362){if(_0x31a362&&_0x31a362[_0x0c4d('0x5f')]===0x0){return db[_0x0c4d('0x60')][_0x0c4d('0x58')]({'name':_0x2a2f07['name'],'resourceId':_0x2a2f07['id'],'type':_0x31a362[_0x0c4d('0x3d')],'sectionId':_0x31a362['id']},{})[_0x0c4d('0x22')](function(){return _0x51e8f3;});}else{return _0x51e8f3;}})[_0x0c4d('0x2b')](function(_0x42ffd1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42ffd1);throw _0x42ffd1;});}return _0x51e8f3;})['then'](respondWithResult(_0x3f63e0,0xc9))['catch'](handleError(_0x3f63e0,null));};exports[_0x0c4d('0x38')]=function(_0x2e6294,_0x5742a3){if(_0x2e6294[_0x0c4d('0x59')]['id']){delete _0x2e6294[_0x0c4d('0x59')]['id'];}return db[_0x0c4d('0x40')][_0x0c4d('0x57')]({'where':{'id':_0x2e6294[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x5742a3,null))['then'](saveUpdates(_0x2e6294[_0x0c4d('0x59')],null))[_0x0c4d('0x22')](respondWithResult(_0x5742a3,null))[_0x0c4d('0x2b')](handleError(_0x5742a3,null));};exports[_0x0c4d('0x39')]=function(_0x5a9be8,_0x297aa3){return db[_0x0c4d('0x40')]['find']({'where':{'id':_0x5a9be8['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x297aa3,null))['then'](removeEntity(_0x297aa3,null))[_0x0c4d('0x2b')](handleError(_0x297aa3,null));};exports[_0x0c4d('0x62')]=function(_0x35072f,_0x5a3c75){return db['ChatQueue']['describe']()[_0x0c4d('0x22')](respondWithResult(_0x5a3c75,null))[_0x0c4d('0x2b')](handleError(_0x5a3c75,null));};exports['getMembers']=function(_0x3d684a,_0x8724ca,_0x57c47a){var _0x5966f1={'raw':!![],'where':{}},_0x5ecd7b={},_0x44ecac;return db[_0x0c4d('0x40')]['findOne']({'where':{'id':_0x3d684a[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x8724ca,null))[_0x0c4d('0x22')](function(_0x53fbcc){if(_0x53fbcc){_0x44ecac=_0x53fbcc[_0x0c4d('0x5b')]({'plain':!![]});_0x5ecd7b['model']=_[_0x0c4d('0x46')](db['UserChatQueue'][_0x0c4d('0x41')]);_0x5ecd7b[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0x3d684a['query']);_0x5ecd7b[_0x0c4d('0x47')]=_['intersection'](_0x5ecd7b[_0x0c4d('0x44')],_0x5ecd7b['query']);_0x5966f1[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x5ecd7b[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x5966f1[_0x0c4d('0x4a')]=_0x5966f1[_0x0c4d('0x4a')][_0x0c4d('0x4b')]?_0x5966f1[_0x0c4d('0x4a')]:_0x5ecd7b[_0x0c4d('0x44')];if(!_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x63')](_0x0c4d('0x64'))){_0x5966f1[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x31')]);_0x5966f1[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x2e')]);}_0x5966f1['order']=qs[_0x0c4d('0x4d')](_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x5966f1[_0x0c4d('0x4e')]=qs[_0x0c4d('0x47')](_['pick'](_0x3d684a[_0x0c4d('0x45')],_0x5ecd7b[_0x0c4d('0x47')]));_0x5966f1['where']['ChatQueueId']=_0x53fbcc['id'];if(_0x3d684a[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x5966f1[_0x0c4d('0x4e')]=_['merge'](_0x5966f1[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x5966f1['attributes'],function(_0x14547b){var _0x1dfffb={};_0x1dfffb[_0x14547b]={'$like':'%'+_0x3d684a[_0x0c4d('0x45')]['filter']+'%'};return _0x1dfffb;})});}_0x5966f1=_[_0x0c4d('0x51')]({},_0x5966f1,_0x3d684a[_0x0c4d('0x53')]);return db['UserChatQueue'][_0x0c4d('0x55')](_0x5966f1);}})[_0x0c4d('0x22')](function(_0x5e4d3a){if(_0x5e4d3a){return db[_0x0c4d('0x65')]['findAndCountAll']({'where':{'id':_['map'](_0x5e4d3a,_0x0c4d('0x66')),'role':'agent'},'attributes':['id',_0x0c4d('0x3d'),'chatPause',_0x0c4d('0x67'),_0x0c4d('0x68')]});}})[_0x0c4d('0x22')](function(_0x50bf18){if(_0x50bf18){return{'count':_0x50bf18[_0x0c4d('0x30')],'rows':_[_0x0c4d('0x3f')](_0x50bf18['rows'],function(_0xd4f2f){return{'membername':_0xd4f2f[_0x0c4d('0x3d')],'UserId':_0xd4f2f['id'],'queue_name':_0x44ecac['name'],'ChatQueueId':_0x44ecac['id'],'interface':util[_0x0c4d('0x69')](_0x0c4d('0x6a'),_0x0c4d('0x6b'),_0xd4f2f['name']),'penalty':0x0,'paused':_0xd4f2f['chatPause'],'createdAt':_0xd4f2f[_0x0c4d('0x68')],'updatedAt':_0xd4f2f[_0x0c4d('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0c4d('0x22')](respondWithFilteredResult(_0x8724ca,_0x5966f1))[_0x0c4d('0x2b')](handleError(_0x8724ca,null));};exports['getTeams']=function(_0x568872,_0x5bb78b,_0x42e67d){var _0x1f80b4={};var _0x35cef8={};var _0x40ba37;var _0x761ba9;return db[_0x0c4d('0x40')]['findOne']({'where':{'id':_0x568872['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x5bb78b,null))[_0x0c4d('0x22')](function(_0xc077d0){if(_0xc077d0){_0x40ba37=_0xc077d0;_0x35cef8[_0x0c4d('0x44')]=_[_0x0c4d('0x46')](db[_0x0c4d('0x6c')][_0x0c4d('0x41')]);_0x35cef8[_0x0c4d('0x45')]=_[_0x0c4d('0x46')](_0x568872[_0x0c4d('0x45')]);_0x35cef8[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x35cef8[_0x0c4d('0x44')],_0x35cef8[_0x0c4d('0x45')]);_0x1f80b4[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x35cef8[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x568872[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x1f80b4['attributes']=_0x1f80b4[_0x0c4d('0x4a')][_0x0c4d('0x4b')]?_0x1f80b4[_0x0c4d('0x4a')]:_0x35cef8[_0x0c4d('0x44')];_0x1f80b4[_0x0c4d('0x4c')]=qs['sort'](_0x568872[_0x0c4d('0x45')]['sort']);_0x1f80b4[_0x0c4d('0x4e')]=qs['filters'](_['pick'](_0x568872[_0x0c4d('0x45')],_0x35cef8[_0x0c4d('0x47')]));if(_0x568872[_0x0c4d('0x45')]['filter']){_0x1f80b4[_0x0c4d('0x4e')]=_[_0x0c4d('0x51')](_0x1f80b4[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x1f80b4[_0x0c4d('0x4a')],function(_0xcb80da){var _0x297e49={};_0x297e49[_0xcb80da]={'$like':'%'+_0x568872[_0x0c4d('0x45')][_0x0c4d('0x50')]+'%'};return _0x297e49;})});}_0x1f80b4=_[_0x0c4d('0x51')]({},_0x1f80b4,_0x568872['options']);return _0x40ba37[_0x0c4d('0x6d')](_0x1f80b4);}})['then'](function(_0x349bb4){if(_0x349bb4){_0x761ba9=_0x349bb4['length'];if(!_0x568872['query'][_0x0c4d('0x63')](_0x0c4d('0x64'))){_0x1f80b4[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x568872[_0x0c4d('0x45')]['limit']);_0x1f80b4[_0x0c4d('0x2e')]=qs[_0x0c4d('0x2e')](_0x568872['query'][_0x0c4d('0x2e')]);}return _0x40ba37[_0x0c4d('0x6d')](_0x1f80b4);}})[_0x0c4d('0x22')](function(_0x3c65ff){if(_0x3c65ff){return _0x3c65ff?{'count':_0x761ba9,'rows':_0x3c65ff}:null;}})[_0x0c4d('0x22')](respondWithResult(_0x5bb78b,null))[_0x0c4d('0x2b')](handleError(_0x5bb78b,null));};exports[_0x0c4d('0x6e')]=function(_0xb3445b,_0x1a5a26,_0x7b94b){var _0x351468=_0xb3445b['body'][_0x0c4d('0x6f')];return db[_0x0c4d('0x6c')][_0x0c4d('0x55')]({'where':{'id':_0x351468},'attributes':['id'],'include':[{'model':db[_0x0c4d('0x65')],'as':'Agents','attributes':['id',_0x0c4d('0x3d'),'online',_0x0c4d('0x70'),_0x0c4d('0x71')],'raw':!![]}]})[_0x0c4d('0x22')](function(_0xd68c2){if(_0xd68c2){var _0x112808=_[_0x0c4d('0x72')](_0xd68c2,function(_0x4b97d7){var _0x561961=_0x4b97d7[_0x0c4d('0x5b')]({'plain':!![]});return _0x561961['Agents'];});return db[_0x0c4d('0x40')]['find']({'where':{'id':_0xb3445b[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](function(_0x2cb06e){return db['sequelize'][_0x0c4d('0x73')](function(_0x3cf1cf){return _0x2cb06e['addTeams'](_0x351468,{'transaction':_0x3cf1cf})[_0x0c4d('0x22')](function(){return BPromise[_0x0c4d('0x74')](_0x112808,function(_0x72481e){return db['UserChatQueue'][_0x0c4d('0x75')]({'where':{'UserId':_0x72481e['id'],'ChatQueueId':_0xb3445b['params']['id']},'transaction':_0x3cf1cf});});})[_0x0c4d('0x22')](function(){_0x112808['forEach'](function(_0x5c1c6f){socket[_0x0c4d('0x76')](_0x0c4d('0x77'),{'UserId':_0x5c1c6f['id'],'ChatQueueId':_0x2cb06e['id']});});});});});}})[_0x0c4d('0x22')](respondWithStatusCode(_0x1a5a26,null))[_0x0c4d('0x2b')](handleError(_0x1a5a26,null));};exports[_0x0c4d('0x78')]=function(_0x8b084,_0x3315e9,_0x4c6123){return db[_0x0c4d('0x6c')][_0x0c4d('0x55')]({'where':{'id':_0x8b084[_0x0c4d('0x45')][_0x0c4d('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x0c4d('0x65')],'as':_0x0c4d('0x79'),'attributes':['id'],'raw':!![]}]})[_0x0c4d('0x22')](handleEntityNotFound(_0x3315e9,null))[_0x0c4d('0x22')](function(_0x86979f){var _0x1f2c45=_['map'](_0x86979f,'id');var _0x164cfa=[];var _0x1ad6fc=[];var _0x484c04=squel[_0x0c4d('0x7a')]();_0x484c04[_0x0c4d('0x7b')](_0x0c4d('0x7c'))[_0x0c4d('0x7d')]('team_has_chat_queues','tq')[_0x0c4d('0x7e')](_0x0c4d('0x7f'),'ut',_0x0c4d('0x80'))['where'](_0x0c4d('0x81'),_0x8b084[_0x0c4d('0x61')]['id']);for(var _0x1e5ac0=0x0;_0x1e5ac0<_0x86979f['length'];_0x1e5ac0+=0x1){let _0x1bfc1d=_0x86979f[_0x1e5ac0];for(var _0x2c5bb1=0x0;_0x2c5bb1<_0x1bfc1d['Agents'][_0x0c4d('0x4b')];_0x2c5bb1+=0x1){let _0x1a0d69=_0x1bfc1d[_0x0c4d('0x79')][_0x2c5bb1];var _0x2224ac=_0x484c04[_0x0c4d('0x82')]();_0x2224ac[_0x0c4d('0x4e')](_0x0c4d('0x83'),_0x1a0d69['id']);_0x1ad6fc[_0x0c4d('0x84')](db[_0x0c4d('0x85')]['query'](_0x2224ac[_0x0c4d('0x86')](),{'type':db['sequelize'][_0x0c4d('0x87')]['SELECT']})['then'](function(_0x43c305){if(_0x43c305[_0x0c4d('0x4b')]===0x1){return _0x1a0d69['id'];}else{var _0x3975d8=_['every'](_[_0x0c4d('0x3f')](_0x43c305,'TeamId'),function(_0x34c63d){return _[_0x0c4d('0x88')](_0x1f2c45,_0x34c63d);});if(_0x3975d8){return _0x1a0d69['id'];}}}));}}return BPromise[_0x0c4d('0x89')](_0x1ad6fc)[_0x0c4d('0x22')](function(_0x1560f0){_0x164cfa=_(_0x164cfa)['union'](_0x1560f0)[_0x0c4d('0x8a')]()[_0x0c4d('0x8b')]();return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x8b084[_0x0c4d('0x61')]['id']}})['then'](function(_0xaa7817){return db[_0x0c4d('0x85')][_0x0c4d('0x73')](function(_0x59b8fa){return _0xaa7817['removeTeams'](_0x8b084['query'][_0x0c4d('0x6f')],{'transaction':_0x59b8fa})[_0x0c4d('0x22')](function(){if(!_['isEmpty'](_0x164cfa)){return _0xaa7817['removeAgents'](_0x164cfa,{'transaction':_0x59b8fa});}})[_0x0c4d('0x22')](function(){_0x164cfa[_0x0c4d('0x8c')](function(_0xe44dd7){socket[_0x0c4d('0x76')](_0x0c4d('0x8d'),{'UserId':_0xe44dd7,'ChatQueueId':_0xaa7817['id']});});});});});});})[_0x0c4d('0x22')](respondWithStatusCode(_0x3315e9,null))['catch'](handleError(_0x3315e9,null));};exports[_0x0c4d('0x8e')]=function(_0x5bf12c,_0x4b0dba,_0x4c9d57){return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x5bf12c[_0x0c4d('0x61')]['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x4b0dba,null))[_0x0c4d('0x22')](function(_0x36c596){if(_0x36c596){return _0x36c596[_0x0c4d('0x8e')](_0x5bf12c['body'][_0x0c4d('0x6f')],_['omit'](_0x5bf12c['body'],[_0x0c4d('0x6f'),'id'])||{})['spread'](function(_0x2339d6){for(var _0x56cec4=0x0;_0x56cec4<_0x5bf12c['body'][_0x0c4d('0x6f')][_0x0c4d('0x4b')];_0x56cec4+=0x1){socket[_0x0c4d('0x76')](_0x0c4d('0x77'),{'UserId':Number(_0x5bf12c[_0x0c4d('0x59')][_0x0c4d('0x6f')][_0x56cec4]),'ChatQueueId':Number(_0x5bf12c[_0x0c4d('0x61')]['id'])});}return _0x2339d6;});}})['then'](respondWithResult(_0x4b0dba,null))['catch'](handleError(_0x4b0dba,null));};exports[_0x0c4d('0x8f')]=function(_0x5f39f3,_0x258ca9,_0x2583ac){return db['ChatQueue'][_0x0c4d('0x57')]({'where':{'id':_0x5f39f3['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x258ca9,null))[_0x0c4d('0x22')](function(_0x2a2d04){if(_0x2a2d04){return _0x2a2d04[_0x0c4d('0x8f')](_0x5f39f3['query']['ids'])[_0x0c4d('0x22')](function(){if(_[_0x0c4d('0x90')](_0x5f39f3[_0x0c4d('0x45')][_0x0c4d('0x6f')])){for(var _0x2f7c1e=0x0;_0x2f7c1e<_0x5f39f3['query'][_0x0c4d('0x6f')][_0x0c4d('0x4b')];_0x2f7c1e+=0x1){socket[_0x0c4d('0x76')]('userChatQueue:remove',{'UserId':Number(_0x5f39f3['query'][_0x0c4d('0x6f')][_0x2f7c1e]),'ChatQueueId':Number(_0x5f39f3[_0x0c4d('0x61')]['id'])});}}else{socket[_0x0c4d('0x76')](_0x0c4d('0x8d'),{'UserId':Number(_0x5f39f3[_0x0c4d('0x45')][_0x0c4d('0x6f')]),'ChatQueueId':Number(_0x5f39f3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x258ca9,null))[_0x0c4d('0x2b')](handleError(_0x258ca9,null));};exports[_0x0c4d('0x91')]=function(_0x44225c,_0x207f74,_0x164562){var _0x3dcc5b={};var _0x176625={};var _0x24d5e2;var _0x5a6e7a;return db['ChatQueue']['findOne']({'where':{'id':_0x44225c['params']['id']}})[_0x0c4d('0x22')](handleEntityNotFound(_0x207f74,null))[_0x0c4d('0x22')](function(_0x2e5d53){if(_0x2e5d53){_0x24d5e2=_0x2e5d53;_0x176625[_0x0c4d('0x44')]=_['keys'](db[_0x0c4d('0x65')][_0x0c4d('0x41')]);_0x176625['query']=_[_0x0c4d('0x46')](_0x44225c[_0x0c4d('0x45')]);_0x176625[_0x0c4d('0x47')]=_[_0x0c4d('0x48')](_0x176625['model'],_0x176625['query']);_0x3dcc5b[_0x0c4d('0x4a')]=_[_0x0c4d('0x48')](_0x176625[_0x0c4d('0x44')],qs[_0x0c4d('0x49')](_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x49')]));_0x3dcc5b[_0x0c4d('0x4a')]=_0x3dcc5b['attributes'][_0x0c4d('0x4b')]?_0x3dcc5b[_0x0c4d('0x4a')]:_0x176625[_0x0c4d('0x44')];_0x3dcc5b[_0x0c4d('0x4c')]=qs[_0x0c4d('0x4d')](_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x4d')]);_0x3dcc5b[_0x0c4d('0x4e')]=qs['filters'](_[_0x0c4d('0x4f')](_0x44225c['query'],_0x176625[_0x0c4d('0x47')]));if(_0x44225c[_0x0c4d('0x45')][_0x0c4d('0x50')]){_0x3dcc5b[_0x0c4d('0x4e')]=_[_0x0c4d('0x51')](_0x3dcc5b[_0x0c4d('0x4e')],{'$or':_[_0x0c4d('0x3f')](_0x3dcc5b[_0x0c4d('0x4a')],function(_0x3dee08){var _0x8d2745={};_0x8d2745[_0x3dee08]={'$like':'%'+_0x44225c[_0x0c4d('0x45')]['filter']+'%'};return _0x8d2745;})});}_0x3dcc5b=_['merge']({},_0x3dcc5b,_0x44225c['options']);return _0x24d5e2['getAgents'](_0x3dcc5b);}})[_0x0c4d('0x22')](function(_0x582b21){if(_0x582b21){_0x5a6e7a=_0x582b21['length'];if(!_0x44225c['query'][_0x0c4d('0x63')]('nolimit')){_0x3dcc5b[_0x0c4d('0x31')]=qs[_0x0c4d('0x31')](_0x44225c['query'][_0x0c4d('0x31')]);_0x3dcc5b[_0x0c4d('0x2e')]=qs['offset'](_0x44225c[_0x0c4d('0x45')]['offset']);}return _0x24d5e2['getAgents'](_0x3dcc5b);}})[_0x0c4d('0x22')](function(_0x4757bc){if(_0x4757bc){return _0x4757bc?{'count':_0x5a6e7a,'rows':_0x4757bc}:null;}})[_0x0c4d('0x22')](respondWithResult(_0x207f74,null))[_0x0c4d('0x2b')](handleError(_0x207f74,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9b74094..e7a1d30 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 _0xb871=['hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','emit'];(function(_0x5908d5,_0x1b50fc){var _0x58a191=function(_0x5784c3){while(--_0x5784c3){_0x5908d5['push'](_0x5908d5['shift']());}};_0x58a191(++_0x1b50fc);}(_0xb871,0x6b));var _0x1b87=function(_0x84ce83,_0x98461d){_0x84ce83=_0x84ce83-0x0;var _0x4490be=_0xb871[_0x84ce83];return _0x4490be;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x1b87('0x0'))['db'][_0x1b87('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1b87('0x2')](0x0);var events={'afterCreate':_0x1b87('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e52f5){return function(_0x27e7fa,_0x39571e,_0x107ee6){ChatQueueEvents[_0x1b87('0x4')](_0x1e52f5+':'+_0x27e7fa['id'],_0x27e7fa);ChatQueueEvents['emit'](_0x1e52f5,_0x27e7fa);_0x107ee6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1b87('0x5')](e,emitEvent(event));}}module[_0x1b87('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x5cbb=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','hook','events'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5cbb,0x77));var _0xb5cb=function(_0x60ebfe,_0x384f42){_0x60ebfe=_0x60ebfe-0x0;var _0x3fc4c3=_0x5cbb[_0x60ebfe];return _0x3fc4c3;};'use strict';var EventEmitter=require(_0xb5cb('0x0'));var ChatQueue=require(_0xb5cb('0x1'))['db'][_0xb5cb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb5cb('0x3')](0x0);var events={'afterCreate':_0xb5cb('0x4'),'afterUpdate':_0xb5cb('0x5'),'afterDestroy':_0xb5cb('0x6')};function emitEvent(_0x58beab){return function(_0x2f82e0,_0x57cdab,_0x1d442f){ChatQueueEvents['emit'](_0x58beab+':'+_0x2f82e0['id'],_0x2f82e0);ChatQueueEvents['emit'](_0x58beab,_0x2f82e0);_0x1d442f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb5cb('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 04f1e3a..174ec74 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 _0xd42e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','api'];(function(_0x521ed8,_0x1f897f){var _0x1f9d76=function(_0x57299e){while(--_0x57299e){_0x521ed8['push'](_0x521ed8['shift']());}};_0x1f9d76(++_0x1f897f);}(_0xd42e,0x184));var _0xed42=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0xd42e[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0xed42('0x0'));var util=require(_0xed42('0x1'));var logger=require(_0xed42('0x2'))(_0xed42('0x3'));var moment=require(_0xed42('0x4'));var BPromise=require(_0xed42('0x5'));var rp=require(_0xed42('0x6'));var fs=require('fs');var path=require(_0xed42('0x7'));var rimraf=require(_0xed42('0x8'));var config=require(_0xed42('0x9'));var attributes=require(_0xed42('0xa'));module[_0xed42('0xb')]=function(_0x3ca550,_0x46c645){return _0x3ca550[_0xed42('0xc')](_0xed42('0xd'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb6b=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x70a8a5,_0x35a384){var _0x2b563b=function(_0x4bbb5b){while(--_0x4bbb5b){_0x70a8a5['push'](_0x70a8a5['shift']());}};_0x2b563b(++_0x35a384);}(_0xeb6b,0x1f0));var _0xbeb6=function(_0x2929bb,_0x1cecdc){_0x2929bb=_0x2929bb-0x0;var _0x3a023d=_0xeb6b[_0x2929bb];return _0x3a023d;};'use strict';var _=require(_0xbeb6('0x0'));var util=require(_0xbeb6('0x1'));var logger=require(_0xbeb6('0x2'))(_0xbeb6('0x3'));var moment=require(_0xbeb6('0x4'));var BPromise=require(_0xbeb6('0x5'));var rp=require(_0xbeb6('0x6'));var fs=require('fs');var path=require(_0xbeb6('0x7'));var rimraf=require('rimraf');var config=require(_0xbeb6('0x8'));var attributes=require(_0xbeb6('0x9'));module[_0xbeb6('0xa')]=function(_0x23a1c3,_0xe2ad0c){return _0x23a1c3[_0xbeb6('0xb')](_0xbeb6('0xc'),attributes,{'tableName':_0xbeb6('0xd'),'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 d1368da..df1f1ab 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 _0x6215=['include','model','map','then','ShowChatQueue','find','where','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit'];(function(_0x34161e,_0x63514f){var _0x2619e7=function(_0x80d015){while(--_0x80d015){_0x34161e['push'](_0x34161e['shift']());}};_0x2619e7(++_0x63514f);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var moment=require(_0x5621('0x2'));var BPromise=require('bluebird');var rs=require(_0x5621('0x3'));var fs=require('fs');var Redis=require(_0x5621('0x4'));var db=require(_0x5621('0x5'))['db'];var utils=require(_0x5621('0x6'));var logger=require(_0x5621('0x7'))(_0x5621('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5621('0x9')]=_[_0x5621('0xa')](config[_0x5621('0x9')],{'host':_0x5621('0xb'),'port':0x18eb});var socket=require(_0x5621('0xc'))(new Redis(config['redis']));require(_0x5621('0xd'))[_0x5621('0xe')](socket);function respondWithRpcPromise(_0x3aa022,_0x418114,_0x53625c){return new BPromise(function(_0x1f4148,_0x10bb32){return client[_0x5621('0xf')](_0x3aa022,_0x53625c)['then'](function(_0x2b0f51){logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));logger[_0x5621('0x13')](_0x5621('0x14'),_0x418114,_0x5621('0x12'),JSON[_0x5621('0x15')](_0x2b0f51));if(_0x2b0f51[_0x5621('0x16')]){if(_0x2b0f51[_0x5621('0x16')]['code']===0x1f4){logger[_0x5621('0x16')](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')]['message']);return _0x10bb32(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}logger['error'](_0x5621('0x11'),_0x418114,_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);return _0x1f4148(_0x2b0f51[_0x5621('0x16')][_0x5621('0x17')]);}else{logger[_0x5621('0x10')](_0x5621('0x11'),_0x418114,_0x5621('0x12'));_0x1f4148(_0x2b0f51[_0x5621('0x18')][_0x5621('0x17')]);}})['catch'](function(_0x1111b2){logger[_0x5621('0x16')]('ChatQueue,\x20%s,\x20%s',_0x418114,_0x1111b2);_0x10bb32(_0x1111b2);});});}exports[_0x5621('0x19')]=function(_0x5647a2){var _0x3ec5f5=this;return new Promise(function(_0x1e366f,_0x179830){return db[_0x5621('0x1a')][_0x5621('0x1b')]({'raw':_0x5647a2['options']?_0x5647a2[_0x5621('0x1c')][_0x5621('0x1d')]===undefined?!![]:![]:!![],'where':_0x5647a2[_0x5621('0x1c')]?_0x5647a2[_0x5621('0x1c')]['where']||null:null,'attributes':_0x5647a2[_0x5621('0x1c')]?_0x5647a2[_0x5621('0x1c')][_0x5621('0x1e')]||null:null,'limit':_0x5647a2[_0x5621('0x1c')]?_0x5647a2[_0x5621('0x1c')][_0x5621('0x1f')]||null:null,'include':_0x5647a2[_0x5621('0x1c')]?_0x5647a2['options'][_0x5621('0x20')]?_['map'](_0x5647a2[_0x5621('0x1c')][_0x5621('0x20')],function(_0x35ea4e){return{'model':db[_0x35ea4e[_0x5621('0x21')]],'as':_0x35ea4e['as'],'attributes':_0x35ea4e[_0x5621('0x1e')],'include':_0x35ea4e[_0x5621('0x20')]?_[_0x5621('0x22')](_0x35ea4e['include'],function(_0x226d73){return{'model':db[_0x226d73[_0x5621('0x21')]],'as':_0x226d73['as'],'attributes':_0x226d73[_0x5621('0x1e')],'include':_0x226d73[_0x5621('0x20')]?_['map'](_0x226d73[_0x5621('0x20')],function(_0x2f0600){return{'model':db[_0x2f0600['model']],'as':_0x2f0600['as'],'attributes':_0x2f0600['attributes']};}):[]};}):[]};}):[]:[]})[_0x5621('0x23')](function(_0x874d8a){logger[_0x5621('0x10')](_0x5621('0x19'),_0x5647a2);logger[_0x5621('0x13')](_0x5621('0x19'),_0x5647a2,JSON[_0x5621('0x15')](_0x874d8a));_0x1e366f(_0x874d8a);})['catch'](function(_0x1cc873){logger[_0x5621('0x16')](_0x5621('0x19'),_0x1cc873[_0x5621('0x17')],_0x5647a2);_0x179830(_0x3ec5f5[_0x5621('0x16')](0x1f4,_0x1cc873['message']));});});};exports[_0x5621('0x24')]=function(_0x66aeb4){var _0xd74700=this;return new Promise(function(_0x14834c,_0x241c38){return db['ChatQueue'][_0x5621('0x25')]({'raw':_0x66aeb4['options']?_0x66aeb4[_0x5621('0x1c')][_0x5621('0x1d')]===undefined?!![]:![]:!![],'where':_0x66aeb4[_0x5621('0x1c')]?_0x66aeb4[_0x5621('0x1c')][_0x5621('0x26')]||null:null,'attributes':_0x66aeb4['options']?_0x66aeb4[_0x5621('0x1c')][_0x5621('0x1e')]||null:null,'include':_0x66aeb4[_0x5621('0x1c')]?_0x66aeb4[_0x5621('0x1c')][_0x5621('0x20')]?_['map'](_0x66aeb4[_0x5621('0x1c')][_0x5621('0x20')],function(_0x103177){return{'model':db[_0x103177['model']],'as':_0x103177['as'],'attributes':_0x103177[_0x5621('0x1e')],'include':_0x103177[_0x5621('0x20')]?_['map'](_0x103177[_0x5621('0x20')],function(_0x4018e2){return{'model':db[_0x4018e2[_0x5621('0x21')]],'as':_0x4018e2['as'],'attributes':_0x4018e2[_0x5621('0x1e')],'include':_0x4018e2[_0x5621('0x20')]?_[_0x5621('0x22')](_0x4018e2[_0x5621('0x20')],function(_0x53c9ff){return{'model':db[_0x53c9ff[_0x5621('0x21')]],'as':_0x53c9ff['as'],'attributes':_0x53c9ff[_0x5621('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5621('0x23')](function(_0x1a2a2e){logger[_0x5621('0x10')](_0x5621('0x24'),_0x66aeb4);logger['debug'](_0x5621('0x24'),_0x66aeb4,JSON[_0x5621('0x15')](_0x1a2a2e));_0x14834c(_0x1a2a2e);})[_0x5621('0x27')](function(_0x5896de){logger['error'](_0x5621('0x24'),_0x5896de['message'],_0x66aeb4);_0x241c38(_0xd74700['error'](0x1f4,_0x5896de[_0x5621('0x17')]));});});}; \ No newline at end of file +var _0x657e=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x172a86,_0x4f121e){var _0x39ae5b=function(_0x1de3d9){while(--_0x1de3d9){_0x172a86['push'](_0x172a86['shift']());}};_0x39ae5b(++_0x4f121e);}(_0x657e,0x1c2));var _0xe657=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x657e[_0x247fa1];return _0x244f35;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var moment=require(_0xe657('0x2'));var BPromise=require(_0xe657('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe657('0x4'));var db=require(_0xe657('0x5'))['db'];var utils=require(_0xe657('0x6'));var logger=require(_0xe657('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe657('0x8'));var client=jayson[_0xe657('0x9')]['http']({'port':0x232a});config[_0xe657('0xa')]=_[_0xe657('0xb')](config[_0xe657('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe657('0xc'))(new Redis(config[_0xe657('0xa')]));require(_0xe657('0xd'))[_0xe657('0xe')](socket);function respondWithRpcPromise(_0x37f91d,_0x3e33c8,_0x4ab4f0){return new BPromise(function(_0xe04ba9,_0xf06a03){return client['request'](_0x37f91d,_0x4ab4f0)[_0xe657('0xf')](function(_0x2a66d9){logger[_0xe657('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0xe657('0x11'));logger[_0xe657('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3e33c8,'request\x20sent',JSON[_0xe657('0x13')](_0x2a66d9));if(_0x2a66d9[_0xe657('0x14')]){if(_0x2a66d9[_0xe657('0x14')][_0xe657('0x15')]===0x1f4){logger[_0xe657('0x14')](_0xe657('0x16'),_0x3e33c8,_0x2a66d9['error']['message']);return _0xf06a03(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}logger['error'](_0xe657('0x16'),_0x3e33c8,_0x2a66d9[_0xe657('0x14')]['message']);return _0xe04ba9(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}else{logger[_0xe657('0x10')](_0xe657('0x16'),_0x3e33c8,_0xe657('0x11'));_0xe04ba9(_0x2a66d9['result'][_0xe657('0x17')]);}})[_0xe657('0x18')](function(_0x4c41df){logger[_0xe657('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0x4c41df);_0xf06a03(_0x4c41df);});});}exports[_0xe657('0x19')]=function(_0x5c3a7d){var _0x163ae3=this;return new Promise(function(_0x1b8b2c,_0x1c563b){return db[_0xe657('0x1a')][_0xe657('0x1b')]({'raw':_0x5c3a7d['options']?_0x5c3a7d['options'][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c3a7d['options']?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1e')]||null:null,'attributes':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'limit':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d['options'][_0xe657('0x20')]||null:null,'include':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')]?_[_0xe657('0x22')](_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')],function(_0xb39831){return{'model':db[_0xb39831[_0xe657('0x23')]],'as':_0xb39831['as'],'attributes':_0xb39831['attributes'],'include':_0xb39831['include']?_[_0xe657('0x22')](_0xb39831['include'],function(_0x5ed298){return{'model':db[_0x5ed298[_0xe657('0x23')]],'as':_0x5ed298['as'],'attributes':_0x5ed298['attributes'],'include':_0x5ed298[_0xe657('0x21')]?_[_0xe657('0x22')](_0x5ed298[_0xe657('0x21')],function(_0x54ae2b){return{'model':db[_0x54ae2b[_0xe657('0x23')]],'as':_0x54ae2b['as'],'attributes':_0x54ae2b[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x343732){logger[_0xe657('0x10')](_0xe657('0x19'),_0x5c3a7d);logger[_0xe657('0x12')](_0xe657('0x19'),_0x5c3a7d,JSON['stringify'](_0x343732));_0x1b8b2c(_0x343732);})[_0xe657('0x18')](function(_0x11aea3){logger['error'](_0xe657('0x19'),_0x11aea3['message'],_0x5c3a7d);_0x1c563b(_0x163ae3[_0xe657('0x14')](0x1f4,_0x11aea3['message']));});});};exports['ShowChatQueue']=function(_0x46050c){var _0x46edbd=this;return new Promise(function(_0x449d25,_0x507e10){return db['ChatQueue'][_0xe657('0x24')]({'raw':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x46050c[_0xe657('0x1d')]?_0x46050c[_0xe657('0x1d')]['where']||null:null,'attributes':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'include':_0x46050c[_0xe657('0x1d')]?_0x46050c['options'][_0xe657('0x21')]?_['map'](_0x46050c['options'][_0xe657('0x21')],function(_0x3fd030){return{'model':db[_0x3fd030['model']],'as':_0x3fd030['as'],'attributes':_0x3fd030[_0xe657('0x1f')],'include':_0x3fd030[_0xe657('0x21')]?_[_0xe657('0x22')](_0x3fd030[_0xe657('0x21')],function(_0x1b951c){return{'model':db[_0x1b951c[_0xe657('0x23')]],'as':_0x1b951c['as'],'attributes':_0x1b951c[_0xe657('0x1f')],'include':_0x1b951c[_0xe657('0x21')]?_[_0xe657('0x22')](_0x1b951c[_0xe657('0x21')],function(_0x57c028){return{'model':db[_0x57c028[_0xe657('0x23')]],'as':_0x57c028['as'],'attributes':_0x57c028[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x17380b){logger[_0xe657('0x10')](_0xe657('0x25'),_0x46050c);logger[_0xe657('0x12')](_0xe657('0x25'),_0x46050c,JSON[_0xe657('0x13')](_0x17380b));_0x449d25(_0x17380b);})[_0xe657('0x18')](function(_0x1f8f6e){logger[_0xe657('0x14')](_0xe657('0x25'),_0x1f8f6e[_0xe657('0x17')],_0x46050c);_0x507e10(_0x46edbd[_0xe657('0x14')](0x1f4,_0x1f8f6e['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 68d504b..eb9a698 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 _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x5b18e3,_0x5a69ab){var _0x45ba38=function(_0x46bb5b){while(--_0x46bb5b){_0x5b18e3['push'](_0x5b18e3['shift']());}};_0x45ba38(++_0x5a69ab);}(_0x3140,0xaf));var _0x0314=function(_0x361026,_0x2375e2){_0x361026=_0x361026-0x0;var _0x37028e=_0x3140[_0x361026];return _0x37028e;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}}; \ No newline at end of file +var _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x13f7e4,_0xba7e02){var _0x3fe30f=function(_0xc8e03d){while(--_0xc8e03d){_0x13f7e4['push'](_0x13f7e4['shift']());}};_0x3fe30f(++_0xba7e02);}(_0xa37e,0x97));var _0xea37=function(_0x15f659,_0x2d86ee){_0x15f659=_0x15f659-0x0;var _0x28185d=_0xa37e[_0x15f659];return _0x28185d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 97cf379..0893e00 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x40d839,_0x1bca38){var _0x883ea2=function(_0x542268){while(--_0x542268){_0x40d839['push'](_0x40d839['shift']());}};_0x883ea2(++_0x1bca38);}(_0xe14b,0x93));var _0xbe14=function(_0x15d10d,_0x57fec9){_0x15d10d=_0x15d10d-0x0;var _0x5498b2=_0xe14b[_0x15d10d];return _0x5498b2;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 6badb3b..d4d30b2 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 _0x2986=['DATE','sequelize','exports'];(function(_0xf44b9,_0x99b1c3){var _0x36f2a0=function(_0x18c09c){while(--_0x18c09c){_0xf44b9['push'](_0xf44b9['shift']());}};_0x36f2a0(++_0x99b1c3);}(_0x2986,0xa9));var _0x6298=function(_0x3fb65d,_0x35c34b){_0x3fb65d=_0x3fb65d-0x0;var _0x13c78f=_0x2986[_0x3fb65d];return _0x13c78f;};'use strict';var moment=require('moment');var Sequelize=require(_0x6298('0x0'));module[_0x6298('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6298('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6298('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb5a2=['moment','sequelize','exports','STRING','DATE'];(function(_0x90519f,_0x5cc33a){var _0x2baf61=function(_0x1e0b7b){while(--_0x1e0b7b){_0x90519f['push'](_0x90519f['shift']());}};_0x2baf61(++_0x5cc33a);}(_0xb5a2,0x73));var _0x2b5a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb5a2[_0x432682];return _0x463d05;};'use strict';var moment=require(_0x2b5a('0x0'));var Sequelize=require(_0x2b5a('0x1'));module[_0x2b5a('0x2')]={'uniqueid':{'type':Sequelize[_0x2b5a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2b5a('0x3')]},'joinAt':{'type':Sequelize[_0x2b5a('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2b5a('0x4')]},'exitAt':{'type':Sequelize[_0x2b5a('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5e8dfe6..ce26de4 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 _0x2484=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','intersection','fields','query','attributes','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x419ec0,_0x5775ad){var _0x475500=function(_0x2dffd0){while(--_0x2dffd0){_0x419ec0['push'](_0x419ec0['shift']());}};_0x475500(++_0x5775ad);}(_0x2484,0x178));var _0x4248=function(_0x367816,_0x35633c){_0x367816=_0x367816-0x0;var _0x2cdde2=_0x2484[_0x367816];return _0x2cdde2;};'use strict';var emlformat=require(_0x4248('0x0'));var rimraf=require(_0x4248('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4248('0x2'));var rp=require(_0x4248('0x3'));var moment=require(_0x4248('0x4'));var BPromise=require(_0x4248('0x5'));var Mustache=require(_0x4248('0x6'));var util=require(_0x4248('0x7'));var path=require(_0x4248('0x8'));var sox=require('sox');var csv=require(_0x4248('0x9'));var ejs=require(_0x4248('0xa'));var fs=require('fs');var fs_extra=require(_0x4248('0xb'));var _=require(_0x4248('0xc'));var squel=require(_0x4248('0xd'));var crypto=require(_0x4248('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4248('0xf'));var toCsv=require(_0x4248('0x9'));var querystring=require(_0x4248('0x10'));var Papa=require(_0x4248('0x11'));var Redis=require(_0x4248('0x12'));var authService=require(_0x4248('0x13'));var qs=require(_0x4248('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4248('0x15'));var logger=require('../../config/logger')(_0x4248('0x16'));var utils=require(_0x4248('0x17'));var config=require(_0x4248('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeb5fd1,_0x5237e9){_0x5237e9=_0x5237e9||0xcc;return function(_0x182e84){if(_0x182e84){return _0xeb5fd1[_0x4248('0x19')](_0x5237e9);}return _0xeb5fd1[_0x4248('0x1a')](_0x5237e9)[_0x4248('0x1b')]();};}function respondWithResult(_0x3a557b,_0x588077){_0x588077=_0x588077||0xc8;return function(_0x8b30bb){if(_0x8b30bb){return _0x3a557b[_0x4248('0x1a')](_0x588077)[_0x4248('0x1c')](_0x8b30bb);}};}function respondWithFilteredResult(_0x35308b,_0x3e7d0a){return function(_0x51c92e){if(_0x51c92e){var _0x46cfbb=typeof _0x3e7d0a[_0x4248('0x1d')]===_0x4248('0x1e')&&typeof _0x3e7d0a[_0x4248('0x1f')]===_0x4248('0x1e');var _0x321e92=_0x51c92e[_0x4248('0x20')];var _0x45edc6=_0x46cfbb?0x0:_0x3e7d0a[_0x4248('0x1d')];var _0xd03b87=_0x46cfbb?_0x51c92e[_0x4248('0x20')]:_0x3e7d0a[_0x4248('0x1d')]+_0x3e7d0a[_0x4248('0x1f')];var _0x1b2f10;if(_0xd03b87>=_0x321e92){_0xd03b87=_0x321e92;_0x1b2f10=0xc8;}else{_0x1b2f10=0xce;}_0x35308b[_0x4248('0x1a')](_0x1b2f10);return _0x35308b[_0x4248('0x21')](_0x4248('0x22'),_0x45edc6+'-'+_0xd03b87+'/'+_0x321e92)[_0x4248('0x1c')](_0x51c92e);}return null;};}function patchUpdates(_0x5ab53e){return function(_0x3c1c46){try{jsonpatch[_0x4248('0x23')](_0x3c1c46,_0x5ab53e,!![]);}catch(_0x2d674b){return BPromise[_0x4248('0x24')](_0x2d674b);}return _0x3c1c46['save']();};}function saveUpdates(_0x43c75d,_0x37b1b3){return function(_0x30b232){if(_0x30b232){return _0x30b232['update'](_0x43c75d)[_0x4248('0x25')](function(_0x25ffa3){return _0x25ffa3;});}return null;};}function removeEntity(_0x50f032,_0x3bfcf2){return function(_0x598681){if(_0x598681){return _0x598681[_0x4248('0x26')]()[_0x4248('0x25')](function(){_0x50f032[_0x4248('0x1a')](0xcc)[_0x4248('0x1b')]();});}};}function handleEntityNotFound(_0x5a3938,_0x1c6ade){return function(_0x205382){if(!_0x205382){_0x5a3938[_0x4248('0x19')](0x194);}return _0x205382;};}function handleError(_0xb3e0e0,_0xd758e6){_0xd758e6=_0xd758e6||0x1f4;return function(_0x429641){logger[_0x4248('0x27')](_0x429641[_0x4248('0x28')]);if(_0x429641[_0x4248('0x29')]){delete _0x429641[_0x4248('0x29')];}_0xb3e0e0[_0x4248('0x1a')](_0xd758e6)[_0x4248('0x2a')](_0x429641);};}exports[_0x4248('0x2b')]=function(_0xf72ecc,_0xf06a1a){var _0x439859={},_0x482689={},_0x346d91={'count':0x0,'rows':[]};var _0x40ca90=_[_0x4248('0x2c')](db['ChatQueueReport'][_0x4248('0x2d')],function(_0x1b4768){return{'name':_0x1b4768[_0x4248('0x2e')],'type':_0x1b4768[_0x4248('0x2f')][_0x4248('0x30')]};});_0x482689[_0x4248('0x31')]=_[_0x4248('0x2c')](_0x40ca90,'name');_0x482689['query']=_['keys'](_0xf72ecc['query']);_0x482689['filters']=_['intersection'](_0x482689['model'],_0x482689['query']);_0x439859['attributes']=_[_0x4248('0x32')](_0x482689[_0x4248('0x31')],qs[_0x4248('0x33')](_0xf72ecc[_0x4248('0x34')]['fields']));_0x439859[_0x4248('0x35')]=_0x439859['attributes'][_0x4248('0x36')]?_0x439859[_0x4248('0x35')]:_0x482689[_0x4248('0x31')];if(!_0xf72ecc[_0x4248('0x34')]['hasOwnProperty']('nolimit')){_0x439859[_0x4248('0x1f')]=qs[_0x4248('0x1f')](_0xf72ecc[_0x4248('0x34')][_0x4248('0x1f')]);_0x439859[_0x4248('0x1d')]=qs[_0x4248('0x1d')](_0xf72ecc[_0x4248('0x34')][_0x4248('0x1d')]);}_0x439859['order']=qs['sort'](_0xf72ecc['query'][_0x4248('0x37')]);_0x439859['where']=qs[_0x4248('0x38')](_[_0x4248('0x39')](_0xf72ecc[_0x4248('0x34')],_0x482689[_0x4248('0x38')]),_0x40ca90);if(_0xf72ecc[_0x4248('0x34')][_0x4248('0x3a')]){_0x439859[_0x4248('0x3b')]=_[_0x4248('0x3c')](_0x439859['where'],{'$or':_[_0x4248('0x2c')](_0x40ca90,function(_0x24a824){if(_0x24a824['type']!==_0x4248('0x3d')){var _0x38a7ab={};_0x38a7ab[_0x24a824['name']]={'$like':'%'+_0xf72ecc[_0x4248('0x34')][_0x4248('0x3a')]+'%'};return _0x38a7ab;}})});}_0x439859=_[_0x4248('0x3c')]({},_0x439859,_0xf72ecc[_0x4248('0x3e')]);var _0xb7f152={'where':_0x439859['where']};return db[_0x4248('0x3f')]['count'](_0xb7f152)['then'](function(_0x33152c){_0x346d91[_0x4248('0x20')]=_0x33152c;if(_0xf72ecc[_0x4248('0x34')][_0x4248('0x40')]){_0x439859[_0x4248('0x41')]=[{'all':!![]}];}return db[_0x4248('0x3f')][_0x4248('0x42')](_0x439859);})[_0x4248('0x25')](function(_0x267923){_0x346d91[_0x4248('0x43')]=_0x267923;return _0x346d91;})['then'](respondWithFilteredResult(_0xf06a1a,_0x439859))[_0x4248('0x44')](handleError(_0xf06a1a,null));};exports[_0x4248('0x45')]=function(_0x3b40ad,_0x4b9200){var _0x57ff44={'raw':!![],'where':{'id':_0x3b40ad[_0x4248('0x46')]['id']}},_0x4b29c1={};_0x4b29c1[_0x4248('0x31')]=_[_0x4248('0x47')](db[_0x4248('0x3f')][_0x4248('0x2d')]);_0x4b29c1[_0x4248('0x34')]=_['keys'](_0x3b40ad[_0x4248('0x34')]);_0x4b29c1[_0x4248('0x38')]=_[_0x4248('0x32')](_0x4b29c1['model'],_0x4b29c1[_0x4248('0x34')]);_0x57ff44[_0x4248('0x35')]=_[_0x4248('0x32')](_0x4b29c1['model'],qs['fields'](_0x3b40ad[_0x4248('0x34')][_0x4248('0x33')]));_0x57ff44[_0x4248('0x35')]=_0x57ff44[_0x4248('0x35')]['length']?_0x57ff44[_0x4248('0x35')]:_0x4b29c1[_0x4248('0x31')];if(_0x3b40ad['query'][_0x4248('0x40')]){_0x57ff44['include']=[{'all':!![]}];}_0x57ff44=_[_0x4248('0x3c')]({},_0x57ff44,_0x3b40ad[_0x4248('0x3e')]);return db['ChatQueueReport'][_0x4248('0x48')](_0x57ff44)['then'](handleEntityNotFound(_0x4b9200,null))[_0x4248('0x25')](respondWithResult(_0x4b9200,null))[_0x4248('0x44')](handleError(_0x4b9200,null));};exports[_0x4248('0x49')]=function(_0x20184b,_0x47b0ef){return db['ChatQueueReport']['create'](_0x20184b[_0x4248('0x4a')],{})[_0x4248('0x25')](respondWithResult(_0x47b0ef,0xc9))[_0x4248('0x44')](handleError(_0x47b0ef,null));};exports[_0x4248('0x4b')]=function(_0x4c5b11,_0x42f12a){if(_0x4c5b11[_0x4248('0x4a')]['id']){delete _0x4c5b11[_0x4248('0x4a')]['id'];}return db[_0x4248('0x3f')]['find']({'where':{'id':_0x4c5b11[_0x4248('0x46')]['id']}})[_0x4248('0x25')](handleEntityNotFound(_0x42f12a,null))[_0x4248('0x25')](saveUpdates(_0x4c5b11[_0x4248('0x4a')],null))[_0x4248('0x25')](respondWithResult(_0x42f12a,null))[_0x4248('0x44')](handleError(_0x42f12a,null));};exports[_0x4248('0x26')]=function(_0x46b2e4,_0x34a922){return db['ChatQueueReport'][_0x4248('0x48')]({'where':{'id':_0x46b2e4[_0x4248('0x46')]['id']}})[_0x4248('0x25')](handleEntityNotFound(_0x34a922,null))[_0x4248('0x25')](removeEntity(_0x34a922,null))[_0x4248('0x44')](handleError(_0x34a922,null));};exports['describe']=function(_0x548bfa,_0x27e3a5){return db[_0x4248('0x3f')][_0x4248('0x4c')]()['then'](respondWithResult(_0x27e3a5,null))['catch'](handleError(_0x27e3a5,null));}; \ No newline at end of file +var _0x6691=['findAll','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueueReport','include'];(function(_0x31aae7,_0xe56cf6){var _0x5923f9=function(_0x939a01){while(--_0x939a01){_0x31aae7['push'](_0x31aae7['shift']());}};_0x5923f9(++_0xe56cf6);}(_0x6691,0x12d));var _0x1669=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6691[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x1669('0x0'));var rimraf=require(_0x1669('0x1'));var zipdir=require(_0x1669('0x2'));var jsonpatch=require(_0x1669('0x3'));var rp=require(_0x1669('0x4'));var moment=require(_0x1669('0x5'));var BPromise=require(_0x1669('0x6'));var Mustache=require(_0x1669('0x7'));var util=require(_0x1669('0x8'));var path=require(_0x1669('0x9'));var sox=require('sox');var csv=require(_0x1669('0xa'));var ejs=require(_0x1669('0xb'));var fs=require('fs');var fs_extra=require(_0x1669('0xc'));var _=require(_0x1669('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1669('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1669('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1669('0x10'));var as=require(_0x1669('0x11'));var hardwareService=require(_0x1669('0x12'));var logger=require(_0x1669('0x13'))(_0x1669('0x14'));var utils=require(_0x1669('0x15'));var config=require(_0x1669('0x16'));var licenseUtil=require(_0x1669('0x17'));var db=require(_0x1669('0x18'))['db'];function respondWithStatusCode(_0x46352e,_0x3709f0){_0x3709f0=_0x3709f0||0xcc;return function(_0x2031eb){if(_0x2031eb){return _0x46352e[_0x1669('0x19')](_0x3709f0);}return _0x46352e[_0x1669('0x1a')](_0x3709f0)[_0x1669('0x1b')]();};}function respondWithResult(_0x355ac3,_0x102193){_0x102193=_0x102193||0xc8;return function(_0x2904b6){if(_0x2904b6){return _0x355ac3[_0x1669('0x1a')](_0x102193)[_0x1669('0x1c')](_0x2904b6);}};}function respondWithFilteredResult(_0x14eb3e,_0x31b2be){return function(_0x1f9ea6){if(_0x1f9ea6){var _0x4d2f66=typeof _0x31b2be[_0x1669('0x1d')]===_0x1669('0x1e')&&typeof _0x31b2be[_0x1669('0x1f')]===_0x1669('0x1e');var _0x285d86=_0x1f9ea6['count'];var _0x56e3d9=_0x4d2f66?0x0:_0x31b2be[_0x1669('0x1d')];var _0x31600f=_0x4d2f66?_0x1f9ea6[_0x1669('0x20')]:_0x31b2be[_0x1669('0x1d')]+_0x31b2be[_0x1669('0x1f')];var _0x64edff;if(_0x31600f>=_0x285d86){_0x31600f=_0x285d86;_0x64edff=0xc8;}else{_0x64edff=0xce;}_0x14eb3e[_0x1669('0x1a')](_0x64edff);return _0x14eb3e['set'](_0x1669('0x21'),_0x56e3d9+'-'+_0x31600f+'/'+_0x285d86)[_0x1669('0x1c')](_0x1f9ea6);}return null;};}function patchUpdates(_0x51297e){return function(_0x3dc48a){try{jsonpatch[_0x1669('0x22')](_0x3dc48a,_0x51297e,!![]);}catch(_0x4e1b1b){return BPromise[_0x1669('0x23')](_0x4e1b1b);}return _0x3dc48a[_0x1669('0x24')]();};}function saveUpdates(_0x2e95c3,_0x17c227){return function(_0x311f56){if(_0x311f56){return _0x311f56['update'](_0x2e95c3)[_0x1669('0x25')](function(_0x457973){return _0x457973;});}return null;};}function removeEntity(_0x344eaf,_0x5796f2){return function(_0x176b4b){if(_0x176b4b){return _0x176b4b['destroy']()['then'](function(){_0x344eaf[_0x1669('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304b25,_0x3ce429){return function(_0x1ab80f){if(!_0x1ab80f){_0x304b25[_0x1669('0x19')](0x194);}return _0x1ab80f;};}function handleError(_0x50abe4,_0x660cc7){_0x660cc7=_0x660cc7||0x1f4;return function(_0x5283da){logger['error'](_0x5283da[_0x1669('0x26')]);if(_0x5283da['name']){delete _0x5283da[_0x1669('0x27')];}_0x50abe4[_0x1669('0x1a')](_0x660cc7)['send'](_0x5283da);};}exports[_0x1669('0x28')]=function(_0x590053,_0x29aff9){var _0x1512e2={},_0x31f4f0={},_0x3fe045={'count':0x0,'rows':[]};var _0x577a0a=_['map'](db['ChatQueueReport'][_0x1669('0x29')],function(_0x6429dc){return{'name':_0x6429dc[_0x1669('0x2a')],'type':_0x6429dc[_0x1669('0x2b')][_0x1669('0x2c')]};});_0x31f4f0['model']=_[_0x1669('0x2d')](_0x577a0a,_0x1669('0x27'));_0x31f4f0[_0x1669('0x2e')]=_[_0x1669('0x2f')](_0x590053[_0x1669('0x2e')]);_0x31f4f0[_0x1669('0x30')]=_[_0x1669('0x31')](_0x31f4f0[_0x1669('0x32')],_0x31f4f0['query']);_0x1512e2[_0x1669('0x33')]=_['intersection'](_0x31f4f0[_0x1669('0x32')],qs['fields'](_0x590053['query'][_0x1669('0x34')]));_0x1512e2[_0x1669('0x33')]=_0x1512e2[_0x1669('0x33')][_0x1669('0x35')]?_0x1512e2[_0x1669('0x33')]:_0x31f4f0[_0x1669('0x32')];if(!_0x590053[_0x1669('0x2e')][_0x1669('0x36')](_0x1669('0x37'))){_0x1512e2['limit']=qs[_0x1669('0x1f')](_0x590053[_0x1669('0x2e')][_0x1669('0x1f')]);_0x1512e2[_0x1669('0x1d')]=qs[_0x1669('0x1d')](_0x590053[_0x1669('0x2e')][_0x1669('0x1d')]);}_0x1512e2['order']=qs[_0x1669('0x38')](_0x590053[_0x1669('0x2e')][_0x1669('0x38')]);_0x1512e2[_0x1669('0x39')]=qs[_0x1669('0x30')](_[_0x1669('0x3a')](_0x590053['query'],_0x31f4f0['filters']),_0x577a0a);if(_0x590053['query'][_0x1669('0x3b')]){_0x1512e2[_0x1669('0x39')]=_[_0x1669('0x3c')](_0x1512e2[_0x1669('0x39')],{'$or':_[_0x1669('0x2d')](_0x577a0a,function(_0x2c35db){if(_0x2c35db[_0x1669('0x2b')]!=='VIRTUAL'){var _0x9ad261={};_0x9ad261[_0x2c35db[_0x1669('0x27')]]={'$like':'%'+_0x590053['query']['filter']+'%'};return _0x9ad261;}})});}_0x1512e2=_[_0x1669('0x3c')]({},_0x1512e2,_0x590053[_0x1669('0x3d')]);var _0x379d82={'where':_0x1512e2[_0x1669('0x39')]};return db[_0x1669('0x3e')]['count'](_0x379d82)[_0x1669('0x25')](function(_0x5ba428){_0x3fe045['count']=_0x5ba428;if(_0x590053[_0x1669('0x2e')]['includeAll']){_0x1512e2[_0x1669('0x3f')]=[{'all':!![]}];}return db[_0x1669('0x3e')][_0x1669('0x40')](_0x1512e2);})[_0x1669('0x25')](function(_0x5e21eb){_0x3fe045[_0x1669('0x41')]=_0x5e21eb;return _0x3fe045;})[_0x1669('0x25')](respondWithFilteredResult(_0x29aff9,_0x1512e2))[_0x1669('0x42')](handleError(_0x29aff9,null));};exports['show']=function(_0x2c1e3b,_0x297c30){var _0x3c4434={'raw':!![],'where':{'id':_0x2c1e3b[_0x1669('0x43')]['id']}},_0x23a1c5={};_0x23a1c5[_0x1669('0x32')]=_[_0x1669('0x2f')](db['ChatQueueReport'][_0x1669('0x29')]);_0x23a1c5['query']=_[_0x1669('0x2f')](_0x2c1e3b['query']);_0x23a1c5[_0x1669('0x30')]=_[_0x1669('0x31')](_0x23a1c5[_0x1669('0x32')],_0x23a1c5[_0x1669('0x2e')]);_0x3c4434[_0x1669('0x33')]=_[_0x1669('0x31')](_0x23a1c5['model'],qs[_0x1669('0x34')](_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x34')]));_0x3c4434['attributes']=_0x3c4434['attributes']['length']?_0x3c4434['attributes']:_0x23a1c5[_0x1669('0x32')];if(_0x2c1e3b[_0x1669('0x2e')][_0x1669('0x44')]){_0x3c4434['include']=[{'all':!![]}];}_0x3c4434=_['merge']({},_0x3c4434,_0x2c1e3b[_0x1669('0x3d')]);return db['ChatQueueReport'][_0x1669('0x45')](_0x3c4434)[_0x1669('0x25')](handleEntityNotFound(_0x297c30,null))[_0x1669('0x25')](respondWithResult(_0x297c30,null))[_0x1669('0x42')](handleError(_0x297c30,null));};exports[_0x1669('0x46')]=function(_0x2ad0eb,_0x410299){return db['ChatQueueReport'][_0x1669('0x46')](_0x2ad0eb['body'],{})[_0x1669('0x25')](respondWithResult(_0x410299,0xc9))['catch'](handleError(_0x410299,null));};exports['update']=function(_0x2778e3,_0x36ab74){if(_0x2778e3[_0x1669('0x47')]['id']){delete _0x2778e3[_0x1669('0x47')]['id'];}return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x2778e3['params']['id']}})[_0x1669('0x25')](handleEntityNotFound(_0x36ab74,null))[_0x1669('0x25')](saveUpdates(_0x2778e3['body'],null))[_0x1669('0x25')](respondWithResult(_0x36ab74,null))[_0x1669('0x42')](handleError(_0x36ab74,null));};exports['destroy']=function(_0x53d184,_0x3d3a24){return db[_0x1669('0x3e')][_0x1669('0x45')]({'where':{'id':_0x53d184[_0x1669('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d3a24,null))[_0x1669('0x25')](removeEntity(_0x3d3a24,null))[_0x1669('0x42')](handleError(_0x3d3a24,null));};exports[_0x1669('0x48')]=function(_0x4c5546,_0x1287ce){return db['ChatQueueReport']['describe']()[_0x1669('0x25')](respondWithResult(_0x1287ce,null))['catch'](handleError(_0x1287ce,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 18e3dc7..19c7f42 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x280727,_0x4432ea){var _0x5e81b8=function(_0x338d73){while(--_0x338d73){_0x280727['push'](_0x280727['shift']());}};_0x5e81b8(++_0x4432ea);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb7e7[_0x1abb09];return _0xea1c07;};'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 +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x1d1763,_0x4bec3a){var _0x19315c=function(_0x3f3883){while(--_0x3f3883){_0x1d1763['push'](_0x1d1763['shift']());}};_0x19315c(++_0x4bec3a);}(_0x757a,0xde));var _0xa757=function(_0x40618d,_0x421346){_0x40618d=_0x40618d-0x0;var _0x557ae3=_0x757a[_0x40618d];return _0x557ae3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 59c519e..8451d11 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 _0xeb82=['raw','then','UpdateChatQueueReport','update','where','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options'];(function(_0x146141,_0x110573){var _0x9688b0=function(_0x5e09b7){while(--_0x5e09b7){_0x146141['push'](_0x146141['shift']());}};_0x9688b0(++_0x110573);}(_0xeb82,0x127));var _0x2eb8=function(_0xd8ae29,_0x24ca4d){_0xd8ae29=_0xd8ae29-0x0;var _0x375870=_0xeb82[_0xd8ae29];return _0x375870;};'use strict';var _=require(_0x2eb8('0x0'));var util=require(_0x2eb8('0x1'));var moment=require(_0x2eb8('0x2'));var BPromise=require(_0x2eb8('0x3'));var rs=require(_0x2eb8('0x4'));var fs=require('fs');var Redis=require(_0x2eb8('0x5'));var db=require(_0x2eb8('0x6'))['db'];var utils=require(_0x2eb8('0x7'));var logger=require(_0x2eb8('0x8'))(_0x2eb8('0x9'));var config=require('../../config/environment');var jayson=require(_0x2eb8('0xa'));var client=jayson[_0x2eb8('0xb')][_0x2eb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5de141,_0x357b39,_0x1706d3){return new BPromise(function(_0x2cac70,_0x4f1af9){return client[_0x2eb8('0xd')](_0x5de141,_0x1706d3)['then'](function(_0x468e0c){logger[_0x2eb8('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x357b39,_0x2eb8('0xf'));logger[_0x2eb8('0x10')](_0x2eb8('0x11'),_0x357b39,_0x2eb8('0xf'),JSON['stringify'](_0x468e0c));if(_0x468e0c['error']){if(_0x468e0c['error'][_0x2eb8('0x12')]===0x1f4){logger[_0x2eb8('0x13')](_0x2eb8('0x14'),_0x357b39,_0x468e0c[_0x2eb8('0x13')][_0x2eb8('0x15')]);return _0x4f1af9(_0x468e0c[_0x2eb8('0x13')]['message']);}logger[_0x2eb8('0x13')](_0x2eb8('0x14'),_0x357b39,_0x468e0c[_0x2eb8('0x13')][_0x2eb8('0x15')]);return _0x2cac70(_0x468e0c['error'][_0x2eb8('0x15')]);}else{logger[_0x2eb8('0xe')](_0x2eb8('0x14'),_0x357b39,_0x2eb8('0xf'));_0x2cac70(_0x468e0c[_0x2eb8('0x16')][_0x2eb8('0x15')]);}})[_0x2eb8('0x17')](function(_0x519ed5){logger[_0x2eb8('0x13')](_0x2eb8('0x14'),_0x357b39,_0x519ed5);_0x4f1af9(_0x519ed5);});});}exports[_0x2eb8('0x18')]=function(_0x5995ef){var _0x23de92=this;return new Promise(function(_0x5f4fdc,_0x43df3c){return db[_0x2eb8('0x19')][_0x2eb8('0x1a')](_0x5995ef[_0x2eb8('0x1b')],{'raw':_0x5995ef[_0x2eb8('0x1c')]?_0x5995ef[_0x2eb8('0x1c')][_0x2eb8('0x1d')]===undefined?!![]:![]:!![]})[_0x2eb8('0x1e')](function(_0x3226f8){logger[_0x2eb8('0xe')](_0x2eb8('0x18'),_0x5995ef);logger['debug'](_0x2eb8('0x18'),_0x5995ef,JSON['stringify'](_0x3226f8));_0x5f4fdc(_0x3226f8);})['catch'](function(_0x280956){logger['error'](_0x2eb8('0x18'),_0x280956[_0x2eb8('0x15')],_0x5995ef);_0x43df3c(_0x23de92[_0x2eb8('0x13')](0x1f4,_0x280956['message']));});});};exports[_0x2eb8('0x1f')]=function(_0x33c3e4){var _0x50095e=this;return new Promise(function(_0x1342ae,_0x3a2c06){return db['ChatQueueReport'][_0x2eb8('0x20')](_0x33c3e4[_0x2eb8('0x1b')],{'raw':_0x33c3e4['options']?_0x33c3e4[_0x2eb8('0x1c')][_0x2eb8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c3e4[_0x2eb8('0x1c')]?_0x33c3e4[_0x2eb8('0x1c')][_0x2eb8('0x21')]||null:null,'attributes':_0x33c3e4[_0x2eb8('0x1c')]?_0x33c3e4['options']['attributes']||null:null,'limit':_0x33c3e4[_0x2eb8('0x1c')]?_0x33c3e4[_0x2eb8('0x1c')][_0x2eb8('0x22')]||null:null})[_0x2eb8('0x1e')](function(_0x5381f0){logger[_0x2eb8('0xe')]('UpdateChatQueueReport',_0x33c3e4);logger['debug']('UpdateChatQueueReport',_0x33c3e4,JSON[_0x2eb8('0x23')](_0x5381f0));_0x1342ae(_0x5381f0);})[_0x2eb8('0x17')](function(_0x427707){logger[_0x2eb8('0x13')](_0x2eb8('0x1f'),_0x427707['message'],_0x33c3e4);_0x3a2c06(_0x50095e[_0x2eb8('0x13')](0x1f4,_0x427707[_0x2eb8('0x15')]));});});}; \ No newline at end of file +var _0xad22=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','where','attributes','UpdateChatQueueReport','moment'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0xad22,0x90));var _0x2ad2=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xad22[_0xd299c3];return _0x376574;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ad2('0x0'));var BPromise=require('bluebird');var rs=require(_0x2ad2('0x1'));var fs=require('fs');var Redis=require(_0x2ad2('0x2'));var db=require(_0x2ad2('0x3'))['db'];var utils=require(_0x2ad2('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2ad2('0x5'));var client=jayson['client'][_0x2ad2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b6d5d,_0x1b2396,_0x251232){return new BPromise(function(_0x2b33d3,_0x1f939d){return client['request'](_0x1b6d5d,_0x251232)[_0x2ad2('0x7')](function(_0x4633af){logger[_0x2ad2('0x8')]('ChatQueueReport,\x20%s,\x20%s',_0x1b2396,_0x2ad2('0x9'));logger[_0x2ad2('0xa')](_0x2ad2('0xb'),_0x1b2396,'request\x20sent',JSON[_0x2ad2('0xc')](_0x4633af));if(_0x4633af[_0x2ad2('0xd')]){if(_0x4633af['error'][_0x2ad2('0xe')]===0x1f4){logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x4633af[_0x2ad2('0xd')]['message']);return _0x1f939d(_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);}logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);return _0x2b33d3(_0x4633af[_0x2ad2('0xd')][_0x2ad2('0x10')]);}else{logger[_0x2ad2('0x8')](_0x2ad2('0xf'),_0x1b2396,_0x2ad2('0x9'));_0x2b33d3(_0x4633af[_0x2ad2('0x11')][_0x2ad2('0x10')]);}})[_0x2ad2('0x12')](function(_0x22db39){logger[_0x2ad2('0xd')](_0x2ad2('0xf'),_0x1b2396,_0x22db39);_0x1f939d(_0x22db39);});});}exports[_0x2ad2('0x13')]=function(_0x2c97c9){var _0x277cad=this;return new Promise(function(_0x12c67f,_0x33602d){return db[_0x2ad2('0x14')][_0x2ad2('0x15')](_0x2c97c9[_0x2ad2('0x16')],{'raw':_0x2c97c9[_0x2ad2('0x17')]?_0x2c97c9['options'][_0x2ad2('0x18')]===undefined?!![]:![]:!![]})[_0x2ad2('0x7')](function(_0x33d58a){logger[_0x2ad2('0x8')](_0x2ad2('0x13'),_0x2c97c9);logger[_0x2ad2('0xa')](_0x2ad2('0x13'),_0x2c97c9,JSON[_0x2ad2('0xc')](_0x33d58a));_0x12c67f(_0x33d58a);})['catch'](function(_0x9b8b66){logger[_0x2ad2('0xd')](_0x2ad2('0x13'),_0x9b8b66[_0x2ad2('0x10')],_0x2c97c9);_0x33602d(_0x277cad[_0x2ad2('0xd')](0x1f4,_0x9b8b66[_0x2ad2('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x4b449f){var _0x121da7=this;return new Promise(function(_0x1548f6,_0x336cab){return db[_0x2ad2('0x14')][_0x2ad2('0x19')](_0x4b449f[_0x2ad2('0x16')],{'raw':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f[_0x2ad2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f[_0x2ad2('0x17')][_0x2ad2('0x1a')]||null:null,'attributes':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f['options'][_0x2ad2('0x1b')]||null:null,'limit':_0x4b449f[_0x2ad2('0x17')]?_0x4b449f['options']['limit']||null:null})['then'](function(_0x20419e){logger['info']('UpdateChatQueueReport',_0x4b449f);logger[_0x2ad2('0xa')](_0x2ad2('0x1c'),_0x4b449f,JSON[_0x2ad2('0xc')](_0x20419e));_0x1548f6(_0x20419e);})[_0x2ad2('0x12')](function(_0x70a29d){logger[_0x2ad2('0xd')](_0x2ad2('0x1c'),_0x70a29d[_0x2ad2('0x10')],_0x4b449f);_0x336cab(_0x121da7[_0x2ad2('0xd')](0x1f4,_0x70a29d[_0x2ad2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 424ae38..0705f33 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 _0x0975=['../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0975,0xad));var _0x5097=function(_0x3062e1,_0x4b920e){_0x3062e1=_0x3062e1-0x0;var _0x35aaa1=_0x0975[_0x3062e1];return _0x35aaa1;};'use strict';var multer=require(_0x5097('0x0'));var util=require(_0x5097('0x1'));var path=require(_0x5097('0x2'));var timeout=require(_0x5097('0x3'));var express=require('express');var router=express[_0x5097('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5097('0x5'));var interaction=require(_0x5097('0x6'));var config=require(_0x5097('0x7'));var controller=require(_0x5097('0x8'));router['get']('/',auth[_0x5097('0x9')](),controller[_0x5097('0xa')]);router['get'](_0x5097('0xb'),auth[_0x5097('0x9')](),controller[_0x5097('0xc')]);router[_0x5097('0xd')]('/:id',auth[_0x5097('0x9')](),controller[_0x5097('0xe')]);router[_0x5097('0xf')]('/',auth[_0x5097('0x9')](),controller['create']);router[_0x5097('0x10')](_0x5097('0x11'),auth[_0x5097('0x9')](),controller[_0x5097('0x12')]);router[_0x5097('0x13')](_0x5097('0x11'),auth[_0x5097('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x09d4=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x24942b,_0x4310e2){var _0x335545=function(_0x1dd0ea){while(--_0x1dd0ea){_0x24942b['push'](_0x24942b['shift']());}};_0x335545(++_0x4310e2);}(_0x09d4,0x78));var _0x409d=function(_0x5d1017,_0x1fa737){_0x5d1017=_0x5d1017-0x0;var _0x23e363=_0x09d4[_0x5d1017];return _0x23e363;};'use strict';var multer=require(_0x409d('0x0'));var util=require(_0x409d('0x1'));var path=require(_0x409d('0x2'));var timeout=require(_0x409d('0x3'));var express=require(_0x409d('0x4'));var router=express[_0x409d('0x5')]();var fs_extra=require(_0x409d('0x6'));var auth=require(_0x409d('0x7'));var interaction=require(_0x409d('0x8'));var config=require(_0x409d('0x9'));var controller=require('./chatQueueReport.controller');router[_0x409d('0xa')]('/',auth[_0x409d('0xb')](),controller[_0x409d('0xc')]);router[_0x409d('0xa')](_0x409d('0xd'),auth[_0x409d('0xb')](),controller[_0x409d('0xe')]);router['get'](_0x409d('0xf'),auth[_0x409d('0xb')](),controller[_0x409d('0x10')]);router[_0x409d('0x11')]('/',auth['isAuthenticated'](),controller[_0x409d('0x12')]);router[_0x409d('0x13')]('/:id',auth[_0x409d('0xb')](),controller[_0x409d('0x14')]);router[_0x409d('0x15')]('/:id',auth[_0x409d('0xb')](),controller[_0x409d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 81aa6da..16fe54d 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(_0x39de23,_0x18cb62){var _0x28e3b5=function(_0xc0ebfd){while(--_0xc0ebfd){_0x39de23['push'](_0x39de23['shift']());}};_0x28e3b5(++_0x18cb62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xcb91[_0x263f4c];return _0x3a78d3;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x6bf16d,_0x7c0cd1){var _0x32a608=function(_0x2222da){while(--_0x2222da){_0x6bf16d['push'](_0x6bf16d['shift']());}};_0x32a608(++_0x7c0cd1);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c17217c..28d354c 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 _0xe6d0=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','end','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','params','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x564242,_0x4159f7){var _0x2906fb=function(_0xed2acc){while(--_0xed2acc){_0x564242['push'](_0x564242['shift']());}};_0x2906fb(++_0x4159f7);}(_0xe6d0,0x1e4));var _0x0e6d=function(_0x2e955f,_0x5dcba6){_0x2e955f=_0x2e955f-0x0;var _0x576aee=_0xe6d0[_0x2e955f];return _0x576aee;};'use strict';var emlformat=require(_0x0e6d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e6d('0x1'));var rp=require(_0x0e6d('0x2'));var moment=require(_0x0e6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e6d('0x4'));var util=require(_0x0e6d('0x5'));var path=require('path');var sox=require(_0x0e6d('0x6'));var csv=require(_0x0e6d('0x7'));var ejs=require(_0x0e6d('0x8'));var fs=require('fs');var fs_extra=require(_0x0e6d('0x9'));var _=require(_0x0e6d('0xa'));var squel=require('squel');var crypto=require(_0x0e6d('0xb'));var jsforce=require(_0x0e6d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0e6d('0x7'));var querystring=require('querystring');var Papa=require(_0x0e6d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e6d('0xe'));var as=require(_0x0e6d('0xf'));var hardwareService=require(_0x0e6d('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0e6d('0x11'));var config=require(_0x0e6d('0x12'));var licenseUtil=require(_0x0e6d('0x13'));var db=require(_0x0e6d('0x14'))['db'];function respondWithStatusCode(_0x2c04cb,_0x384b88){_0x384b88=_0x384b88||0xcc;return function(_0x327e26){if(_0x327e26){return _0x2c04cb[_0x0e6d('0x15')](_0x384b88);}return _0x2c04cb['status'](_0x384b88)['end']();};}function respondWithResult(_0x5c17e7,_0x11c369){_0x11c369=_0x11c369||0xc8;return function(_0x1c61ff){if(_0x1c61ff){return _0x5c17e7[_0x0e6d('0x16')](_0x11c369)[_0x0e6d('0x17')](_0x1c61ff);}};}function respondWithFilteredResult(_0x43377e,_0x35d417){return function(_0x3ac98f){if(_0x3ac98f){var _0x650981=typeof _0x35d417[_0x0e6d('0x18')]===_0x0e6d('0x19')&&typeof _0x35d417['limit']===_0x0e6d('0x19');var _0x4aedff=_0x3ac98f[_0x0e6d('0x1a')];var _0x40ae71=_0x650981?0x0:_0x35d417[_0x0e6d('0x18')];var _0x2be3a4=_0x650981?_0x3ac98f[_0x0e6d('0x1a')]:_0x35d417[_0x0e6d('0x18')]+_0x35d417[_0x0e6d('0x1b')];var _0x291de6;if(_0x2be3a4>=_0x4aedff){_0x2be3a4=_0x4aedff;_0x291de6=0xc8;}else{_0x291de6=0xce;}_0x43377e[_0x0e6d('0x16')](_0x291de6);return _0x43377e[_0x0e6d('0x1c')]('Content-Range',_0x40ae71+'-'+_0x2be3a4+'/'+_0x4aedff)[_0x0e6d('0x17')](_0x3ac98f);}return null;};}function patchUpdates(_0x475be8){return function(_0x19ea12){try{jsonpatch[_0x0e6d('0x1d')](_0x19ea12,_0x475be8,!![]);}catch(_0x4ce17f){return BPromise['reject'](_0x4ce17f);}return _0x19ea12[_0x0e6d('0x1e')]();};}function saveUpdates(_0x588fcd,_0x489a26){return function(_0xa861ce){if(_0xa861ce){return _0xa861ce[_0x0e6d('0x1f')](_0x588fcd)[_0x0e6d('0x20')](function(_0x14756e){return _0x14756e;});}return null;};}function removeEntity(_0x3bb213,_0x472d15){return function(_0x33211a){if(_0x33211a){return _0x33211a['destroy']()[_0x0e6d('0x20')](function(){_0x3bb213['status'](0xcc)[_0x0e6d('0x21')]();});}};}function handleEntityNotFound(_0x3e0ec7,_0x1c5ead){return function(_0x3b1514){if(!_0x3b1514){_0x3e0ec7[_0x0e6d('0x15')](0x194);}return _0x3b1514;};}function handleError(_0x189f5b,_0x1c7203){_0x1c7203=_0x1c7203||0x1f4;return function(_0x1e43e1){logger[_0x0e6d('0x22')](_0x1e43e1[_0x0e6d('0x23')]);if(_0x1e43e1[_0x0e6d('0x24')]){delete _0x1e43e1['name'];}_0x189f5b[_0x0e6d('0x16')](_0x1c7203)['send'](_0x1e43e1);};}exports[_0x0e6d('0x25')]=function(_0x14f0b5,_0x1f6651){var _0x163db8={},_0x3bba06={},_0x33e4e3={'count':0x0,'rows':[]};var _0xd664ea=_[_0x0e6d('0x26')](db[_0x0e6d('0x27')][_0x0e6d('0x28')],function(_0xb15c73){return{'name':_0xb15c73[_0x0e6d('0x29')],'type':_0xb15c73[_0x0e6d('0x2a')][_0x0e6d('0x2b')]};});_0x3bba06[_0x0e6d('0x2c')]=_[_0x0e6d('0x26')](_0xd664ea,'name');_0x3bba06[_0x0e6d('0x2d')]=_['keys'](_0x14f0b5[_0x0e6d('0x2d')]);_0x3bba06[_0x0e6d('0x2e')]=_[_0x0e6d('0x2f')](_0x3bba06[_0x0e6d('0x2c')],_0x3bba06[_0x0e6d('0x2d')]);_0x163db8[_0x0e6d('0x30')]=_[_0x0e6d('0x2f')](_0x3bba06[_0x0e6d('0x2c')],qs[_0x0e6d('0x31')](_0x14f0b5['query']['fields']));_0x163db8['attributes']=_0x163db8['attributes'][_0x0e6d('0x32')]?_0x163db8[_0x0e6d('0x30')]:_0x3bba06[_0x0e6d('0x2c')];if(!_0x14f0b5[_0x0e6d('0x2d')][_0x0e6d('0x33')](_0x0e6d('0x34'))){_0x163db8[_0x0e6d('0x1b')]=qs['limit'](_0x14f0b5[_0x0e6d('0x2d')][_0x0e6d('0x1b')]);_0x163db8[_0x0e6d('0x18')]=qs[_0x0e6d('0x18')](_0x14f0b5['query'][_0x0e6d('0x18')]);}_0x163db8[_0x0e6d('0x35')]=qs['sort'](_0x14f0b5[_0x0e6d('0x2d')][_0x0e6d('0x36')]);_0x163db8['where']=qs['filters'](_[_0x0e6d('0x37')](_0x14f0b5['query'],_0x3bba06[_0x0e6d('0x2e')]),_0xd664ea);if(_0x14f0b5['query'][_0x0e6d('0x38')]){_0x163db8['where']=_[_0x0e6d('0x39')](_0x163db8[_0x0e6d('0x3a')],{'$or':_[_0x0e6d('0x26')](_0xd664ea,function(_0x48ad0a){if(_0x48ad0a['type']!==_0x0e6d('0x3b')){var _0x371fb6={};_0x371fb6[_0x48ad0a[_0x0e6d('0x24')]]={'$like':'%'+_0x14f0b5[_0x0e6d('0x2d')][_0x0e6d('0x38')]+'%'};return _0x371fb6;}})});}_0x163db8=_[_0x0e6d('0x39')]({},_0x163db8,_0x14f0b5[_0x0e6d('0x3c')]);var _0x3bf08a={'where':_0x163db8['where']};return db[_0x0e6d('0x27')][_0x0e6d('0x1a')](_0x3bf08a)['then'](function(_0x368ea7){_0x33e4e3[_0x0e6d('0x1a')]=_0x368ea7;if(_0x14f0b5['query'][_0x0e6d('0x3d')]){_0x163db8['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x0e6d('0x3e')](_0x163db8);})[_0x0e6d('0x20')](function(_0x19ef62){_0x33e4e3[_0x0e6d('0x3f')]=_0x19ef62;return _0x33e4e3;})[_0x0e6d('0x20')](respondWithFilteredResult(_0x1f6651,_0x163db8))[_0x0e6d('0x40')](handleError(_0x1f6651,null));};exports['show']=function(_0x1090a3,_0x454abd){var _0x2f8b79={'raw':!![],'where':{'id':_0x1090a3['params']['id']}},_0x648c5f={};_0x648c5f['model']=_['keys'](db[_0x0e6d('0x27')][_0x0e6d('0x28')]);_0x648c5f[_0x0e6d('0x2d')]=_['keys'](_0x1090a3[_0x0e6d('0x2d')]);_0x648c5f['filters']=_[_0x0e6d('0x2f')](_0x648c5f['model'],_0x648c5f[_0x0e6d('0x2d')]);_0x2f8b79[_0x0e6d('0x30')]=_[_0x0e6d('0x2f')](_0x648c5f[_0x0e6d('0x2c')],qs[_0x0e6d('0x31')](_0x1090a3[_0x0e6d('0x2d')][_0x0e6d('0x31')]));_0x2f8b79[_0x0e6d('0x30')]=_0x2f8b79[_0x0e6d('0x30')][_0x0e6d('0x32')]?_0x2f8b79[_0x0e6d('0x30')]:_0x648c5f['model'];if(_0x1090a3['query'][_0x0e6d('0x3d')]){_0x2f8b79[_0x0e6d('0x41')]=[{'all':!![]}];}_0x2f8b79=_[_0x0e6d('0x39')]({},_0x2f8b79,_0x1090a3['options']);return db['ChatTransferReport'][_0x0e6d('0x42')](_0x2f8b79)[_0x0e6d('0x20')](handleEntityNotFound(_0x454abd,null))[_0x0e6d('0x20')](respondWithResult(_0x454abd,null))[_0x0e6d('0x40')](handleError(_0x454abd,null));};exports[_0x0e6d('0x43')]=function(_0x3a7345,_0x576154){return db[_0x0e6d('0x27')]['create'](_0x3a7345[_0x0e6d('0x44')],{})['then'](respondWithResult(_0x576154,0xc9))[_0x0e6d('0x40')](handleError(_0x576154,null));};exports['update']=function(_0x11d6c8,_0x2e8085){if(_0x11d6c8[_0x0e6d('0x44')]['id']){delete _0x11d6c8['body']['id'];}return db[_0x0e6d('0x27')][_0x0e6d('0x42')]({'where':{'id':_0x11d6c8[_0x0e6d('0x45')]['id']}})[_0x0e6d('0x20')](handleEntityNotFound(_0x2e8085,null))[_0x0e6d('0x20')](saveUpdates(_0x11d6c8[_0x0e6d('0x44')],null))[_0x0e6d('0x20')](respondWithResult(_0x2e8085,null))[_0x0e6d('0x40')](handleError(_0x2e8085,null));};exports[_0x0e6d('0x46')]=function(_0x22f620,_0x1b7407){return db[_0x0e6d('0x27')][_0x0e6d('0x42')]({'where':{'id':_0x22f620[_0x0e6d('0x45')]['id']}})[_0x0e6d('0x20')](handleEntityNotFound(_0x1b7407,null))[_0x0e6d('0x20')](removeEntity(_0x1b7407,null))[_0x0e6d('0x40')](handleError(_0x1b7407,null));};exports[_0x0e6d('0x47')]=function(_0x5360d5,_0x2f1de2){return db['ChatTransferReport'][_0x0e6d('0x47')]()[_0x0e6d('0x20')](respondWithResult(_0x2f1de2,null))['catch'](handleError(_0x2f1de2,null));}; \ No newline at end of file +var _0x9639=['merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','length','find','create','body','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c1738,_0x37cdb4){var _0x2bb6a2=function(_0x30e936){while(--_0x30e936){_0x1c1738['push'](_0x1c1738['shift']());}};_0x2bb6a2(++_0x37cdb4);}(_0x9639,0x184));var _0x9963=function(_0x1a307c,_0x2db142){_0x1a307c=_0x1a307c-0x0;var _0x59a413=_0x9639[_0x1a307c];return _0x59a413;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9963('0x0'));var jsonpatch=require(_0x9963('0x1'));var rp=require('request-promise');var moment=require(_0x9963('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9963('0x3'));var util=require(_0x9963('0x4'));var path=require(_0x9963('0x5'));var sox=require(_0x9963('0x6'));var csv=require(_0x9963('0x7'));var ejs=require(_0x9963('0x8'));var fs=require('fs');var fs_extra=require(_0x9963('0x9'));var _=require(_0x9963('0xa'));var squel=require(_0x9963('0xb'));var crypto=require(_0x9963('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9963('0x7'));var querystring=require(_0x9963('0xd'));var Papa=require(_0x9963('0xe'));var Redis=require(_0x9963('0xf'));var authService=require(_0x9963('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9963('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9963('0x12'));var utils=require(_0x9963('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9963('0x14'))['db'];function respondWithStatusCode(_0x21e2c8,_0x95476e){_0x95476e=_0x95476e||0xcc;return function(_0x242862){if(_0x242862){return _0x21e2c8[_0x9963('0x15')](_0x95476e);}return _0x21e2c8[_0x9963('0x16')](_0x95476e)['end']();};}function respondWithResult(_0x2bd204,_0x3072df){_0x3072df=_0x3072df||0xc8;return function(_0x41036b){if(_0x41036b){return _0x2bd204[_0x9963('0x16')](_0x3072df)[_0x9963('0x17')](_0x41036b);}};}function respondWithFilteredResult(_0x48f2e0,_0xc75f0e){return function(_0xf9f621){if(_0xf9f621){var _0x437273=typeof _0xc75f0e[_0x9963('0x18')]==='undefined'&&typeof _0xc75f0e[_0x9963('0x19')]===_0x9963('0x1a');var _0x3ebd15=_0xf9f621['count'];var _0x50911d=_0x437273?0x0:_0xc75f0e['offset'];var _0x48ab73=_0x437273?_0xf9f621[_0x9963('0x1b')]:_0xc75f0e[_0x9963('0x18')]+_0xc75f0e[_0x9963('0x19')];var _0x1ab771;if(_0x48ab73>=_0x3ebd15){_0x48ab73=_0x3ebd15;_0x1ab771=0xc8;}else{_0x1ab771=0xce;}_0x48f2e0[_0x9963('0x16')](_0x1ab771);return _0x48f2e0[_0x9963('0x1c')]('Content-Range',_0x50911d+'-'+_0x48ab73+'/'+_0x3ebd15)['json'](_0xf9f621);}return null;};}function patchUpdates(_0x32da9f){return function(_0x313c76){try{jsonpatch['apply'](_0x313c76,_0x32da9f,!![]);}catch(_0x16bc4c){return BPromise[_0x9963('0x1d')](_0x16bc4c);}return _0x313c76[_0x9963('0x1e')]();};}function saveUpdates(_0x5b00b3,_0x49999a){return function(_0x4e188d){if(_0x4e188d){return _0x4e188d[_0x9963('0x1f')](_0x5b00b3)[_0x9963('0x20')](function(_0xcf160e){return _0xcf160e;});}return null;};}function removeEntity(_0x38349c,_0x3ae73a){return function(_0x11c86b){if(_0x11c86b){return _0x11c86b[_0x9963('0x21')]()['then'](function(){_0x38349c['status'](0xcc)[_0x9963('0x22')]();});}};}function handleEntityNotFound(_0x3a4e0f,_0x666dd7){return function(_0x475473){if(!_0x475473){_0x3a4e0f[_0x9963('0x15')](0x194);}return _0x475473;};}function handleError(_0x211e3f,_0x43dc89){_0x43dc89=_0x43dc89||0x1f4;return function(_0x146553){logger[_0x9963('0x23')](_0x146553[_0x9963('0x24')]);if(_0x146553[_0x9963('0x25')]){delete _0x146553[_0x9963('0x25')];}_0x211e3f[_0x9963('0x16')](_0x43dc89)[_0x9963('0x26')](_0x146553);};}exports[_0x9963('0x27')]=function(_0x8d9ad9,_0x271a4a){var _0x3be208={},_0x21d5a1={},_0x453056={'count':0x0,'rows':[]};var _0x23df6d=_['map'](db[_0x9963('0x28')]['rawAttributes'],function(_0x5d090d){return{'name':_0x5d090d[_0x9963('0x29')],'type':_0x5d090d[_0x9963('0x2a')][_0x9963('0x2b')]};});_0x21d5a1[_0x9963('0x2c')]=_['map'](_0x23df6d,_0x9963('0x25'));_0x21d5a1[_0x9963('0x2d')]=_['keys'](_0x8d9ad9[_0x9963('0x2d')]);_0x21d5a1[_0x9963('0x2e')]=_['intersection'](_0x21d5a1['model'],_0x21d5a1[_0x9963('0x2d')]);_0x3be208[_0x9963('0x2f')]=_[_0x9963('0x30')](_0x21d5a1[_0x9963('0x2c')],qs['fields'](_0x8d9ad9['query'][_0x9963('0x31')]));_0x3be208[_0x9963('0x2f')]=_0x3be208[_0x9963('0x2f')]['length']?_0x3be208['attributes']:_0x21d5a1[_0x9963('0x2c')];if(!_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x32')](_0x9963('0x33'))){_0x3be208[_0x9963('0x19')]=qs[_0x9963('0x19')](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x19')]);_0x3be208[_0x9963('0x18')]=qs['offset'](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x18')]);}_0x3be208[_0x9963('0x34')]=qs[_0x9963('0x35')](_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x35')]);_0x3be208[_0x9963('0x36')]=qs[_0x9963('0x2e')](_[_0x9963('0x37')](_0x8d9ad9['query'],_0x21d5a1['filters']),_0x23df6d);if(_0x8d9ad9[_0x9963('0x2d')]['filter']){_0x3be208['where']=_[_0x9963('0x38')](_0x3be208['where'],{'$or':_[_0x9963('0x39')](_0x23df6d,function(_0x30c71a){if(_0x30c71a[_0x9963('0x2a')]!==_0x9963('0x3a')){var _0x3360cb={};_0x3360cb[_0x30c71a[_0x9963('0x25')]]={'$like':'%'+_0x8d9ad9[_0x9963('0x2d')][_0x9963('0x3b')]+'%'};return _0x3360cb;}})});}_0x3be208=_[_0x9963('0x38')]({},_0x3be208,_0x8d9ad9[_0x9963('0x3c')]);var _0x2b23b0={'where':_0x3be208['where']};return db[_0x9963('0x28')]['count'](_0x2b23b0)[_0x9963('0x20')](function(_0x3ffaf7){_0x453056[_0x9963('0x1b')]=_0x3ffaf7;if(_0x8d9ad9['query'][_0x9963('0x3d')]){_0x3be208[_0x9963('0x3e')]=[{'all':!![]}];}return db[_0x9963('0x28')][_0x9963('0x3f')](_0x3be208);})[_0x9963('0x20')](function(_0x2bcce3){_0x453056[_0x9963('0x40')]=_0x2bcce3;return _0x453056;})[_0x9963('0x20')](respondWithFilteredResult(_0x271a4a,_0x3be208))[_0x9963('0x41')](handleError(_0x271a4a,null));};exports['show']=function(_0x59d11a,_0x637401){var _0x353f8d={'raw':!![],'where':{'id':_0x59d11a[_0x9963('0x42')]['id']}},_0x105f85={};_0x105f85[_0x9963('0x2c')]=_['keys'](db[_0x9963('0x28')][_0x9963('0x43')]);_0x105f85[_0x9963('0x2d')]=_[_0x9963('0x44')](_0x59d11a[_0x9963('0x2d')]);_0x105f85['filters']=_[_0x9963('0x30')](_0x105f85[_0x9963('0x2c')],_0x105f85[_0x9963('0x2d')]);_0x353f8d[_0x9963('0x2f')]=_[_0x9963('0x30')](_0x105f85['model'],qs['fields'](_0x59d11a['query']['fields']));_0x353f8d[_0x9963('0x2f')]=_0x353f8d['attributes'][_0x9963('0x45')]?_0x353f8d[_0x9963('0x2f')]:_0x105f85['model'];if(_0x59d11a[_0x9963('0x2d')]['includeAll']){_0x353f8d[_0x9963('0x3e')]=[{'all':!![]}];}_0x353f8d=_[_0x9963('0x38')]({},_0x353f8d,_0x59d11a[_0x9963('0x3c')]);return db[_0x9963('0x28')][_0x9963('0x46')](_0x353f8d)[_0x9963('0x20')](handleEntityNotFound(_0x637401,null))[_0x9963('0x20')](respondWithResult(_0x637401,null))[_0x9963('0x41')](handleError(_0x637401,null));};exports[_0x9963('0x47')]=function(_0xef8b78,_0x27f4ba){return db[_0x9963('0x28')][_0x9963('0x47')](_0xef8b78[_0x9963('0x48')],{})[_0x9963('0x20')](respondWithResult(_0x27f4ba,0xc9))[_0x9963('0x41')](handleError(_0x27f4ba,null));};exports[_0x9963('0x1f')]=function(_0x4c523c,_0x43a121){if(_0x4c523c['body']['id']){delete _0x4c523c[_0x9963('0x48')]['id'];}return db[_0x9963('0x28')][_0x9963('0x46')]({'where':{'id':_0x4c523c[_0x9963('0x42')]['id']}})[_0x9963('0x20')](handleEntityNotFound(_0x43a121,null))['then'](saveUpdates(_0x4c523c['body'],null))['then'](respondWithResult(_0x43a121,null))[_0x9963('0x41')](handleError(_0x43a121,null));};exports[_0x9963('0x21')]=function(_0x31a3ad,_0x2a9a16){return db[_0x9963('0x28')][_0x9963('0x46')]({'where':{'id':_0x31a3ad[_0x9963('0x42')]['id']}})[_0x9963('0x20')](handleEntityNotFound(_0x2a9a16,null))[_0x9963('0x20')](removeEntity(_0x2a9a16,null))[_0x9963('0x41')](handleError(_0x2a9a16,null));};exports['describe']=function(_0x5d3484,_0x5c64f3){return db[_0x9963('0x28')][_0x9963('0x49')]()[_0x9963('0x20')](respondWithResult(_0x5c64f3,null))[_0x9963('0x41')](handleError(_0x5c64f3,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 27fcd68..59ab25a 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 _0x04c7=['moment','bluebird','request-promise','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api'];(function(_0x4f219b,_0x841f7e){var _0x8a7718=function(_0x3e8f25){while(--_0x3e8f25){_0x4f219b['push'](_0x4f219b['shift']());}};_0x8a7718(++_0x841f7e);}(_0x04c7,0x11d));var _0x704c=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x04c7[_0x5b87ce];return _0x597aa7;};'use strict';var _=require('lodash');var util=require(_0x704c('0x0'));var logger=require(_0x704c('0x1'))(_0x704c('0x2'));var moment=require(_0x704c('0x3'));var BPromise=require(_0x704c('0x4'));var rp=require(_0x704c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x704c('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x704c('0x7')]=function(_0x2c411c,_0x492b8c){return _0x2c411c[_0x704c('0x8')](_0x704c('0x9'),attributes,{'tableName':_0x704c('0xa'),'paranoid':![],'indexes':[{'name':_0x704c('0xb'),'fields':[_0x704c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9a3=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd9a3,0xf1));var _0x3d9a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9a3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3d9a('0x0'));var util=require(_0x3d9a('0x1'));var logger=require('../../config/logger')(_0x3d9a('0x2'));var moment=require(_0x3d9a('0x3'));var BPromise=require(_0x3d9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9a('0x5'));var rimraf=require(_0x3d9a('0x6'));var config=require(_0x3d9a('0x7'));var attributes=require(_0x3d9a('0x8'));module[_0x3d9a('0x9')]=function(_0x52a490,_0x437c41){return _0x52a490[_0x3d9a('0xa')](_0x3d9a('0xb'),attributes,{'tableName':_0x3d9a('0xc'),'paranoid':![],'indexes':[{'name':_0x3d9a('0xd'),'fields':[_0x3d9a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index d2d6d14..6bc8f46 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 _0x5442=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c2d5d,_0x36bf0d){var _0x5add0f=function(_0x4cb3aa){while(--_0x4cb3aa){_0x1c2d5d['push'](_0x1c2d5d['shift']());}};_0x5add0f(++_0x36bf0d);}(_0x5442,0xcb));var _0x2544=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x5442[_0x1ebe90];return _0x447c82;};'use strict';var _=require(_0x2544('0x0'));var util=require('util');var moment=require(_0x2544('0x1'));var BPromise=require(_0x2544('0x2'));var rs=require(_0x2544('0x3'));var fs=require('fs');var Redis=require(_0x2544('0x4'));var db=require(_0x2544('0x5'))['db'];var utils=require(_0x2544('0x6'));var logger=require(_0x2544('0x7'))('rpc');var config=require(_0x2544('0x8'));var jayson=require(_0x2544('0x9'));var client=jayson[_0x2544('0xa')][_0x2544('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4939b4,_0x2cada0,_0x3c6682){return new BPromise(function(_0x384047,_0x1658d2){return client[_0x2544('0xc')](_0x4939b4,_0x3c6682)[_0x2544('0xd')](function(_0x1d79f3){logger[_0x2544('0xe')](_0x2544('0xf'),_0x2cada0,_0x2544('0x10'));logger[_0x2544('0x11')](_0x2544('0x12'),_0x2cada0,_0x2544('0x10'),JSON[_0x2544('0x13')](_0x1d79f3));if(_0x1d79f3[_0x2544('0x14')]){if(_0x1d79f3[_0x2544('0x14')][_0x2544('0x15')]===0x1f4){logger[_0x2544('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x2cada0,_0x1d79f3[_0x2544('0x14')][_0x2544('0x16')]);return _0x1658d2(_0x1d79f3['error'][_0x2544('0x16')]);}logger[_0x2544('0x14')](_0x2544('0xf'),_0x2cada0,_0x1d79f3[_0x2544('0x14')][_0x2544('0x16')]);return _0x384047(_0x1d79f3[_0x2544('0x14')][_0x2544('0x16')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x2cada0,'request\x20sent');_0x384047(_0x1d79f3[_0x2544('0x17')]['message']);}})[_0x2544('0x18')](function(_0x540fa5){logger[_0x2544('0x14')](_0x2544('0xf'),_0x2cada0,_0x540fa5);_0x1658d2(_0x540fa5);});});} \ No newline at end of file +var _0xc770=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x360055,_0x46cdbf){var _0x356f11=function(_0xfe83c9){while(--_0xfe83c9){_0x360055['push'](_0x360055['shift']());}};_0x356f11(++_0x46cdbf);}(_0xc770,0x12e));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rs=require(_0x0c77('0x4'));var fs=require('fs');var Redis=require(_0x0c77('0x5'));var db=require(_0x0c77('0x6'))['db'];var utils=require(_0x0c77('0x7'));var logger=require(_0x0c77('0x8'))(_0x0c77('0x9'));var config=require(_0x0c77('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0c77('0xb')][_0x0c77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16915f,_0xfb5a40,_0x1ca0ed){return new BPromise(function(_0x13f3ba,_0x7c2655){return client[_0x0c77('0xd')](_0x16915f,_0x1ca0ed)[_0x0c77('0xe')](function(_0x43ff5c){logger[_0x0c77('0xf')](_0x0c77('0x10'),_0xfb5a40,_0x0c77('0x11'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xfb5a40,_0x0c77('0x11'),JSON[_0x0c77('0x12')](_0x43ff5c));if(_0x43ff5c[_0x0c77('0x13')]){if(_0x43ff5c[_0x0c77('0x13')]['code']===0x1f4){logger[_0x0c77('0x13')](_0x0c77('0x10'),_0xfb5a40,_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);return _0x7c2655(_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);}logger[_0x0c77('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xfb5a40,_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);return _0x13f3ba(_0x43ff5c[_0x0c77('0x13')][_0x0c77('0x14')]);}else{logger['info'](_0x0c77('0x10'),_0xfb5a40,'request\x20sent');_0x13f3ba(_0x43ff5c[_0x0c77('0x15')][_0x0c77('0x14')]);}})[_0x0c77('0x16')](function(_0x1ebe10){logger[_0x0c77('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xfb5a40,_0x1ebe10);_0x7c2655(_0x1ebe10);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3df1435..6c65f68 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 _0x788d=['./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x370b7b,_0x1abf7a){var _0x56c95d=function(_0x454aa1){while(--_0x454aa1){_0x370b7b['push'](_0x370b7b['shift']());}};_0x56c95d(++_0x1abf7a);}(_0x788d,0xc1));var _0xd788=function(_0x2eea19,_0x4f73a7){_0x2eea19=_0x2eea19-0x0;var _0x1fc12b=_0x788d[_0x2eea19];return _0x1fc12b;};'use strict';var multer=require(_0xd788('0x0'));var util=require('util');var path=require(_0xd788('0x1'));var timeout=require(_0xd788('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd788('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd788('0x4'));var controller=require(_0xd788('0x5'));router['get']('/',auth[_0xd788('0x6')](),controller[_0xd788('0x7')]);router[_0xd788('0x8')](_0xd788('0x9'),auth[_0xd788('0x6')](),controller[_0xd788('0xa')]);router[_0xd788('0x8')](_0xd788('0xb'),auth[_0xd788('0x6')](),controller['show']);router['post']('/',auth[_0xd788('0x6')](),controller[_0xd788('0xc')]);router[_0xd788('0xd')](_0xd788('0xb'),auth[_0xd788('0x6')](),controller[_0xd788('0xe')]);router[_0xd788('0xf')](_0xd788('0xb'),auth[_0xd788('0x6')](),controller[_0xd788('0x10')]);module[_0xd788('0x11')]=router; \ No newline at end of file +var _0x9f2c=['isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x45fa59,_0x372e90){var _0x5b6c72=function(_0x41377b){while(--_0x41377b){_0x45fa59['push'](_0x45fa59['shift']());}};_0x5b6c72(++_0x372e90);}(_0x9f2c,0x186));var _0xc9f2=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0x9f2c[_0x29d849];return _0x30b104;};'use strict';var multer=require(_0xc9f2('0x0'));var util=require(_0xc9f2('0x1'));var path=require(_0xc9f2('0x2'));var timeout=require(_0xc9f2('0x3'));var express=require(_0xc9f2('0x4'));var router=express[_0xc9f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc9f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9f2('0x7'));var controller=require('./chatTransferReport.controller');router[_0xc9f2('0x8')]('/',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xa')]);router['get'](_0xc9f2('0xb'),auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xc')]);router[_0xc9f2('0x8')](_0xc9f2('0xd'),auth[_0xc9f2('0x9')](),controller[_0xc9f2('0xe')]);router['post']('/',auth[_0xc9f2('0x9')](),controller['create']);router[_0xc9f2('0xf')]('/:id',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0x10')]);router['delete']('/:id',auth[_0xc9f2('0x9')](),controller[_0xc9f2('0x11')]);module[_0xc9f2('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 41ba631..9ed7533 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 _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x776ce4,_0x28aa2b){var _0x85b0e8=function(_0x53e4e5){while(--_0x53e4e5){_0x776ce4['push'](_0x776ce4['shift']());}};_0x85b0e8(++_0x28aa2b);}(_0xe706,0xa3));var _0x6e70=function(_0x5599aa,_0x1b9ffe){_0x5599aa=_0x5599aa-0x0;var _0x4b0f34=_0xe706[_0x5599aa];return _0x4b0f34;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}}; \ No newline at end of file +var _0xa8a8=['BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1947df,_0x4af7f9){_0x1947df=_0x1947df-0x0;var _0xd39126=_0xa8a8[_0x1947df];return _0xd39126;};'use strict';var Sequelize=require(_0x8a8a('0x0'));var rs=require(_0x8a8a('0x1'));module[_0x8a8a('0x2')]={'name':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8a8a('0x4')},'description':{'type':Sequelize[_0x8a8a('0x3')]},'mapKey':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'key':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x6')},'customerAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8a8a('0x3')]},'animation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8a8a('0xa'),_0x8a8a('0xb')),'defaultValue':_0x8a8a('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0xc')},'start_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xd')},'offline_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8a8a('0x10')]},'closingQuestion':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x11')},'noteTitle':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x12')},'placeholderMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x13')},'closingMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'skipMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x16')},'ratingType':{'type':Sequelize[_0x8a8a('0x17')](_0x8a8a('0x18'),_0x8a8a('0x19')),'defaultValue':_0x8a8a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':_0x8a8a('0x1b'),'variable':null,'config':{'placeholder':_0x8a8a('0x1c'),'type':_0x8a8a('0x1d'),'required':!![]},'props':{'title':_0x8a8a('0x1c'),'helpText':''}},{'type':_0x8a8a('0x1b'),'props':{'title':_0x8a8a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))?JSON[_0x8a8a('0x20')](this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))):{};},'set':function(_0x251315){return this[_0x8a8a('0x21')]('onlineForm',JSON[_0x8a8a('0x1a')](_0x251315));}},'offlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':_0x8a8a('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8a8a('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8a8a('0x23'))?JSON[_0x8a8a('0x20')](this['getDataValue'](_0x8a8a('0x23'))):{};},'set':function(_0x2c8f27){return this[_0x8a8a('0x21')](_0x8a8a('0x23'),JSON[_0x8a8a('0x1a')](_0x2c8f27));}},'token':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return rs[_0x8a8a('0x24')]();}},'autoclose':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8a8a('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x25')},'waitingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'sendUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8a8a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return _0x8a8a('0x27');}},'notificationSound':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x29')},'messagesAlignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2a')},'defaultTitle':{'type':Sequelize[_0x8a8a('0x3')]},'customerAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2b')},'systemAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a8a('0xe')],'comment':_0x8a8a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x40d509){if(!_0x40d509)this[_0x8a8a('0x21')](_0x8a8a('0x2d'),null);this['setDataValue'](_0x8a8a('0x2e'),_0x40d509);}},'vidaooEscalation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8a8a('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x2f')},'vidaooNote':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return _0x8a8a('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8a8a('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e217ffd..5a6ff37 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 _0x4936=['ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','autoclose','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','EventManager','offline','difference','mapKeyOffline','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','getSnippet','Interval','Intervals','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','omit','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','getAnswers','pick','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x4936,0xa1));var _0x6493=function(_0x1126aa,_0x10ce67){_0x1126aa=_0x1126aa-0x0;var _0x1b34b4=_0x4936[_0x1126aa];return _0x1b34b4;};'use strict';var BPromise=require(_0x6493('0x0'));var Mustache=require(_0x6493('0x1'));var util=require('util');var path=require(_0x6493('0x2'));var ejs=require(_0x6493('0x3'));var fs=require('fs');var fs_extra=require(_0x6493('0x4'));var _=require(_0x6493('0x5'));var querystring=require(_0x6493('0x6'));var Redis=require(_0x6493('0x7'));var qs=require(_0x6493('0x8'));var logger=require(_0x6493('0x9'))(_0x6493('0xa'));var config=require(_0x6493('0xb'));var db=require(_0x6493('0xc'))['db'];config[_0x6493('0xd')]=_[_0x6493('0xe')](config[_0x6493('0xd')],{'host':_0x6493('0xf'),'port':0x18eb});var socket=require(_0x6493('0x10'))(new Redis(config[_0x6493('0xd')]));require(_0x6493('0x11'))['register'](socket);var htmlToText=require(_0x6493('0x12'));var jayson=require(_0x6493('0x13'));var client=jayson[_0x6493('0x14')]['http']({'port':0x232c});var client9002=jayson[_0x6493('0x14')][_0x6493('0x15')]({'port':0x232a});var client9003=jayson[_0x6493('0x14')]['http']({'port':0x232b});var client9001=jayson['client'][_0x6493('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x5c178b,_0x4bf481,_0x2df144,_0x25a8bd){return new BPromise(function(_0x2a6510,_0x464f83){var _0x4c97ad=_0x25a8bd||client;return _0x4c97ad[_0x6493('0x16')](_0x5c178b,_0x2df144)['then'](function(_0x35a127){logger[_0x6493('0x17')](_0x6493('0x18'),_0x4bf481,_0x6493('0x19'));logger[_0x6493('0x1a')](_0x6493('0x1b'),_0x4bf481,_0x6493('0x19'),JSON[_0x6493('0x1c')](_0x35a127));if(_0x35a127['error']){if(_0x35a127[_0x6493('0x1d')][_0x6493('0x1e')]===0x1f4){logger[_0x6493('0x1d')](_0x6493('0x18'),_0x4bf481,_0x35a127['error'][_0x6493('0x1f')]);return _0x464f83(_0x35a127['error'][_0x6493('0x1f')]);}logger[_0x6493('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x4bf481,_0x35a127[_0x6493('0x1d')]['message']);return _0x2a6510(_0x35a127[_0x6493('0x1d')]['message']);}else{logger[_0x6493('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4bf481,_0x6493('0x19'));_0x2a6510(_0x35a127[_0x6493('0x20')]['message']);}})[_0x6493('0x21')](function(_0x1b590c){logger[_0x6493('0x1d')](_0x6493('0x18'),_0x4bf481,_0x1b590c);_0x464f83(_0x1b590c);});});}function respondWithStatusCode(_0x4d0359,_0x5a49e2){_0x5a49e2=_0x5a49e2||0xcc;return function(_0x599f2a){if(_0x599f2a){return _0x4d0359[_0x6493('0x22')](_0x5a49e2);}return _0x4d0359['status'](_0x5a49e2)[_0x6493('0x23')]();};}function respondWithResult(_0x21837d,_0x5f06fc){_0x5f06fc=_0x5f06fc||0xc8;return function(_0x59aabc){if(_0x59aabc){return _0x21837d[_0x6493('0x24')](_0x5f06fc)[_0x6493('0x25')](_0x59aabc);}};}function respondWithFilteredResult(_0x1fba96,_0x47a407){return function(_0x39a9ad){if(_0x39a9ad){var _0xb454da=typeof _0x47a407['offset']===_0x6493('0x26')&&typeof _0x47a407[_0x6493('0x27')]===_0x6493('0x26');var _0x5ee8de=_0x39a9ad[_0x6493('0x28')];var _0x429b4f=_0xb454da?0x0:_0x47a407[_0x6493('0x29')];var _0x19eb8e=_0xb454da?_0x39a9ad[_0x6493('0x28')]:_0x47a407[_0x6493('0x29')]+_0x47a407[_0x6493('0x27')];var _0x2c62db;if(_0x19eb8e>=_0x5ee8de){_0x19eb8e=_0x5ee8de;_0x2c62db=0xc8;}else{_0x2c62db=0xce;}_0x1fba96[_0x6493('0x24')](_0x2c62db);return _0x1fba96['set'](_0x6493('0x2a'),_0x429b4f+'-'+_0x19eb8e+'/'+_0x5ee8de)['json'](_0x39a9ad);}return null;};}function saveUpdates(_0x2278dc){return function(_0x29f7e6){if(_0x29f7e6){return _0x29f7e6[_0x6493('0x2b')](_0x2278dc)[_0x6493('0x2c')](function(_0x3b3545){return _0x3b3545;});}return null;};}function removeEntity(_0x346996){return function(_0x1c37fc){if(_0x1c37fc){return _0x1c37fc[_0x6493('0x2d')]()['then'](function(){var _0xa5e56d=_0x1c37fc['get']({'plain':!![]});var _0x2c46f7=_0x6493('0x2e');return db[_0x6493('0x2f')]['destroy']({'where':{'type':_0x2c46f7,'resourceId':_0xa5e56d['id']}})[_0x6493('0x2c')](function(){return _0x1c37fc;});})['then'](function(){_0x346996[_0x6493('0x24')](0xcc)[_0x6493('0x23')]();});}};}function handleEntityNotFound(_0x130309){return function(_0x13b8a8){if(!_0x13b8a8){_0x130309['sendStatus'](0x194);}return _0x13b8a8;};}function handleError(_0x589b60,_0x3f4012){_0x3f4012=_0x3f4012||0x1f4;return function(_0x21a055){logger['error'](_0x21a055[_0x6493('0x30')]);if(_0x21a055[_0x6493('0x31')]){delete _0x21a055[_0x6493('0x31')];}_0x589b60['status'](_0x3f4012)[_0x6493('0x32')](_0x21a055);};}exports[_0x6493('0x33')]=function(_0xc289df,_0x20958b){var _0x4df1d0={'include':[{'model':db[_0x6493('0x34')],'as':_0x6493('0x35')}]},_0x4f08d2={},_0x30cf7c={'count':0x0,'rows':[]};var _0x26afd5=_[_0x6493('0x36')](db[_0x6493('0x37')]['rawAttributes'],function(_0x410073){return{'name':_0x410073['fieldName'],'type':_0x410073['type'][_0x6493('0x38')]};});_0x4f08d2[_0x6493('0x39')]=_[_0x6493('0x36')](_0x26afd5,_0x6493('0x31'));_0x4f08d2[_0x6493('0x3a')]=_[_0x6493('0x3b')](_0xc289df[_0x6493('0x3a')]);_0x4f08d2[_0x6493('0x3c')]=_[_0x6493('0x3d')](_0x4f08d2[_0x6493('0x39')],_0x4f08d2[_0x6493('0x3a')]);_0x4df1d0[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x4f08d2[_0x6493('0x39')],qs[_0x6493('0x3f')](_0xc289df[_0x6493('0x3a')]['fields']));_0x4df1d0['attributes']=_0x4df1d0['attributes'][_0x6493('0x40')]?_0x4df1d0[_0x6493('0x3e')]:_0x4f08d2[_0x6493('0x39')];if(!_0xc289df[_0x6493('0x3a')][_0x6493('0x41')]('nolimit')){_0x4df1d0['limit']=qs[_0x6493('0x27')](_0xc289df[_0x6493('0x3a')]['limit']);_0x4df1d0[_0x6493('0x29')]=qs[_0x6493('0x29')](_0xc289df[_0x6493('0x3a')][_0x6493('0x29')]);}_0x4df1d0[_0x6493('0x42')]=qs[_0x6493('0x43')](_0xc289df[_0x6493('0x3a')][_0x6493('0x43')]);_0x4df1d0[_0x6493('0x44')]=qs['filters'](_['pick'](_0xc289df['query'],_0x4f08d2['filters']),_0x26afd5);if(_0xc289df[_0x6493('0x3a')][_0x6493('0x45')]){_0x4df1d0[_0x6493('0x44')]=_[_0x6493('0x46')](_0x4df1d0['where'],{'$or':_[_0x6493('0x36')](_0x26afd5,function(_0x48b970){if(_0x48b970[_0x6493('0x47')]!==_0x6493('0x48')){var _0x499e58={};_0x499e58[_0x48b970[_0x6493('0x31')]]={'$like':'%'+_0xc289df[_0x6493('0x3a')]['filter']+'%'};return _0x499e58;}})});}_0x4df1d0=_[_0x6493('0x46')]({},_0x4df1d0,_0xc289df[_0x6493('0x49')]);var _0x49c34d={'where':_0x4df1d0[_0x6493('0x44')]};return db[_0x6493('0x37')][_0x6493('0x28')](_0x49c34d)[_0x6493('0x2c')](function(_0x234d88){_0x30cf7c[_0x6493('0x28')]=_0x234d88;if(_0xc289df[_0x6493('0x3a')][_0x6493('0x4a')]){_0x4df1d0[_0x6493('0x4b')]=[{'all':!![]}];}return db[_0x6493('0x37')][_0x6493('0x4c')](_0x4df1d0);})['then'](function(_0x3cbdb4){_0x30cf7c[_0x6493('0x4d')]=_0x3cbdb4;return _0x30cf7c;})[_0x6493('0x2c')](respondWithFilteredResult(_0x20958b,_0x4df1d0))[_0x6493('0x21')](handleError(_0x20958b,null));};exports['show']=function(_0x3764cd,_0x4ed000){var _0x53108a={'raw':![],'where':{'id':_0x3764cd['params']['id']},'include':[{'model':db[_0x6493('0x34')],'as':'mandatoryDispositionPause'}]},_0x2d4a6c={};_0x2d4a6c[_0x6493('0x39')]=_[_0x6493('0x3b')](db[_0x6493('0x37')][_0x6493('0x4e')]);_0x2d4a6c[_0x6493('0x3a')]=_[_0x6493('0x3b')](_0x3764cd[_0x6493('0x3a')]);_0x2d4a6c[_0x6493('0x3c')]=_[_0x6493('0x3d')](_0x2d4a6c[_0x6493('0x39')],_0x2d4a6c[_0x6493('0x3a')]);_0x53108a['attributes']=_[_0x6493('0x3d')](_0x2d4a6c[_0x6493('0x39')],qs[_0x6493('0x3f')](_0x3764cd[_0x6493('0x3a')][_0x6493('0x3f')]));_0x53108a['attributes']=_0x53108a[_0x6493('0x3e')][_0x6493('0x40')]?_0x53108a[_0x6493('0x3e')]:_0x2d4a6c[_0x6493('0x39')];if(_0x3764cd[_0x6493('0x3a')][_0x6493('0x4a')]){_0x53108a[_0x6493('0x4b')]=[{'all':!![]}];}_0x53108a=_[_0x6493('0x46')]({},_0x53108a,_0x3764cd['options']);return db[_0x6493('0x37')][_0x6493('0x4f')](_0x53108a)[_0x6493('0x2c')](handleEntityNotFound(_0x4ed000,null))[_0x6493('0x2c')](respondWithResult(_0x4ed000,null))[_0x6493('0x21')](handleError(_0x4ed000,null));};exports[_0x6493('0x50')]=function(_0x41299e,_0x2e9123){return db['ChatWebsite'][_0x6493('0x50')](_0x41299e[_0x6493('0x51')],{})[_0x6493('0x2c')](function(_0x308992){var _0x173c96=_0x41299e['user'][_0x6493('0x52')]({'plain':!![]});if(!_0x173c96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x173c96[_0x6493('0x53')]===_0x6493('0x54')){var _0xf53ff2=_0x308992[_0x6493('0x52')]({'plain':!![]});var _0x37947c=_0x6493('0x2e');return db[_0x6493('0x55')][_0x6493('0x4f')]({'where':{'name':_0x37947c,'userProfileId':_0x173c96[_0x6493('0x56')]},'raw':!![]})[_0x6493('0x2c')](function(_0x3d8c41){if(_0x3d8c41&&_0x3d8c41[_0x6493('0x57')]===0x0){return db[_0x6493('0x2f')]['create']({'name':_0xf53ff2[_0x6493('0x31')],'resourceId':_0xf53ff2['id'],'type':_0x3d8c41[_0x6493('0x31')],'sectionId':_0x3d8c41['id']},{})[_0x6493('0x2c')](function(){return _0x308992;});}else{return _0x308992;}})[_0x6493('0x21')](function(_0x215c2e){logger[_0x6493('0x1d')](_0x6493('0x58'),_0x215c2e);throw _0x215c2e;});}return _0x308992;})['then'](respondWithResult(_0x2e9123,0xc9))[_0x6493('0x21')](handleError(_0x2e9123,null));};exports[_0x6493('0x2b')]=function(_0xa0dd02,_0x282ebb){if(_0xa0dd02[_0x6493('0x51')]['id']){delete _0xa0dd02['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xa0dd02[_0x6493('0x59')]['id']},'include':[{'model':db[_0x6493('0x34')],'as':_0x6493('0x35')}]})['then'](handleEntityNotFound(_0x282ebb,null))['then'](saveUpdates(_0xa0dd02['body'],null))[_0x6493('0x2c')](respondWithResult(_0x282ebb,null))[_0x6493('0x21')](handleError(_0x282ebb,null));};exports[_0x6493('0x2d')]=function(_0x370c0e,_0x31a483){return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x370c0e[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x31a483,null))[_0x6493('0x2c')](removeEntity(_0x31a483,null))[_0x6493('0x21')](handleError(_0x31a483,null));};exports[_0x6493('0x5a')]=function(_0x17de4c,_0x2f27e5){return db['ChatWebsite'][_0x6493('0x5a')]()[_0x6493('0x2c')](respondWithResult(_0x2f27e5,null))[_0x6493('0x21')](handleError(_0x2f27e5,null));};exports['addDisposition']=function(_0x48ebb6,_0x578706){if(_0x48ebb6[_0x6493('0x51')]['id']){delete _0x48ebb6[_0x6493('0x51')]['id'];}return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x48ebb6[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x578706,null))[_0x6493('0x2c')](function(_0x16f5d3){if(_0x16f5d3){_0x48ebb6[_0x6493('0x51')][_0x6493('0x5b')]=_0x16f5d3['id'];return db[_0x6493('0x5c')][_0x6493('0x50')](_0x48ebb6[_0x6493('0x51')]);}})[_0x6493('0x2c')](respondWithResult(_0x578706,null))[_0x6493('0x21')](handleError(_0x578706,null));};exports[_0x6493('0x5d')]=function(_0x2d2ab5,_0x174512){var _0xb0bcb1={'raw':![],'where':{}};var _0x5877ef={};var _0x20f82a={'count':0x0,'rows':[]};return db[_0x6493('0x37')][_0x6493('0x5e')]({'where':{'id':_0x2d2ab5['params']['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x174512,null))[_0x6493('0x2c')](function(_0x50e548){if(_0x50e548){_0x5877ef['model']=_['keys'](db[_0x6493('0x5c')][_0x6493('0x4e')]);_0x5877ef[_0x6493('0x3a')]=_[_0x6493('0x3b')](_0x2d2ab5[_0x6493('0x3a')]);_0x5877ef['filters']=_['intersection'](_0x5877ef[_0x6493('0x39')],_0x5877ef[_0x6493('0x3a')]);_0xb0bcb1['attributes']=_[_0x6493('0x3d')](_0x5877ef[_0x6493('0x39')],qs['fields'](_0x2d2ab5[_0x6493('0x3a')][_0x6493('0x3f')]));_0xb0bcb1[_0x6493('0x3e')]=_0xb0bcb1[_0x6493('0x3e')][_0x6493('0x40')]?_0xb0bcb1['attributes']:_0x5877ef['model'];if(!_0x2d2ab5['query'][_0x6493('0x41')](_0x6493('0x5f'))){_0xb0bcb1[_0x6493('0x27')]=qs['limit'](_0x2d2ab5[_0x6493('0x3a')][_0x6493('0x27')]);_0xb0bcb1[_0x6493('0x29')]=qs[_0x6493('0x29')](_0x2d2ab5[_0x6493('0x3a')][_0x6493('0x29')]);}_0xb0bcb1[_0x6493('0x42')]=qs['sort'](_0x2d2ab5[_0x6493('0x3a')]['sort']);_0xb0bcb1[_0x6493('0x44')]=qs[_0x6493('0x3c')](_['pick'](_0x2d2ab5[_0x6493('0x3a')],_0x5877ef[_0x6493('0x3c')]));_0xb0bcb1['where']['ChatWebsiteId']=_0x50e548['id'];if(_0x2d2ab5[_0x6493('0x3a')][_0x6493('0x45')]){_0xb0bcb1[_0x6493('0x44')]=_[_0x6493('0x46')](_0xb0bcb1['where'],{'$or':_[_0x6493('0x36')](_0xb0bcb1[_0x6493('0x3e')],function(_0x2eef1a){var _0x5c2d57={};_0x5c2d57[_0x2eef1a]={'$like':'%'+_0x2d2ab5['query'][_0x6493('0x45')]+'%'};return _0x5c2d57;})});}_0xb0bcb1=_['merge']({},_0xb0bcb1,_0x2d2ab5['options']);return db['Disposition'][_0x6493('0x28')]({'where':_0xb0bcb1[_0x6493('0x44')]})['then'](function(_0xa51fe9){_0x20f82a['count']=_0xa51fe9;if(_0x2d2ab5[_0x6493('0x3a')][_0x6493('0x4a')]){_0xb0bcb1[_0x6493('0x4b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xb0bcb1);})[_0x6493('0x2c')](function(_0x1e1089){_0x20f82a[_0x6493('0x4d')]=_0x1e1089;return _0x20f82a;});}})[_0x6493('0x2c')](respondWithFilteredResult(_0x174512,_0xb0bcb1))['catch'](handleError(_0x174512,null));};exports[_0x6493('0x60')]=function(_0x4748e6,_0x19463f){return db['ChatWebsite']['find']({'where':{'id':_0x4748e6['params']['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x19463f,null))[_0x6493('0x2c')](function(_0x4f0147){if(_0x4f0147){return _0x4f0147[_0x6493('0x60')](_0x4748e6[_0x6493('0x3a')][_0x6493('0x61')]);}})[_0x6493('0x2c')](respondWithStatusCode(_0x19463f,null))[_0x6493('0x21')](handleError(_0x19463f,null));};exports['addAnswer']=function(_0x4648,_0x226ba0){if(_0x4648['body']['id']){delete _0x4648['body']['id'];}return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x4648[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x226ba0,null))[_0x6493('0x2c')](function(_0x5700dc){if(_0x5700dc){_0x4648[_0x6493('0x51')][_0x6493('0x5b')]=_0x5700dc['id'];return db['CannedAnswer'][_0x6493('0x50')](_0x4648[_0x6493('0x51')]);}})[_0x6493('0x2c')](respondWithResult(_0x226ba0,null))[_0x6493('0x21')](handleError(_0x226ba0,null));};exports[_0x6493('0x62')]=function(_0x430c22,_0x314c67){var _0x458473={'raw':![],'where':{}};var _0x4c4f85={};var _0x28f4ce={'count':0x0,'rows':[]};return db[_0x6493('0x37')]['findOne']({'where':{'id':_0x430c22[_0x6493('0x59')]['id']}})['then'](handleEntityNotFound(_0x314c67,null))[_0x6493('0x2c')](function(_0x232646){if(_0x232646){_0x4c4f85[_0x6493('0x39')]=_[_0x6493('0x3b')](db['CannedAnswer'][_0x6493('0x4e')]);_0x4c4f85['query']=_[_0x6493('0x3b')](_0x430c22[_0x6493('0x3a')]);_0x4c4f85[_0x6493('0x3c')]=_[_0x6493('0x3d')](_0x4c4f85[_0x6493('0x39')],_0x4c4f85['query']);_0x458473[_0x6493('0x3e')]=_['intersection'](_0x4c4f85[_0x6493('0x39')],qs[_0x6493('0x3f')](_0x430c22[_0x6493('0x3a')][_0x6493('0x3f')]));_0x458473[_0x6493('0x3e')]=_0x458473[_0x6493('0x3e')][_0x6493('0x40')]?_0x458473['attributes']:_0x4c4f85[_0x6493('0x39')];if(!_0x430c22[_0x6493('0x3a')][_0x6493('0x41')](_0x6493('0x5f'))){_0x458473[_0x6493('0x27')]=qs[_0x6493('0x27')](_0x430c22[_0x6493('0x3a')][_0x6493('0x27')]);_0x458473['offset']=qs[_0x6493('0x29')](_0x430c22['query'][_0x6493('0x29')]);}_0x458473[_0x6493('0x42')]=qs[_0x6493('0x43')](_0x430c22['query'][_0x6493('0x43')]);_0x458473[_0x6493('0x44')]=qs[_0x6493('0x3c')](_[_0x6493('0x63')](_0x430c22['query'],_0x4c4f85[_0x6493('0x3c')]));_0x458473[_0x6493('0x44')][_0x6493('0x5b')]=_0x232646['id'];if(_0x430c22['query'][_0x6493('0x45')]){_0x458473[_0x6493('0x44')]=_['merge'](_0x458473[_0x6493('0x44')],{'$or':_[_0x6493('0x36')](_0x458473[_0x6493('0x3e')],function(_0x47adcb){var _0x1b3ba4={};_0x1b3ba4[_0x47adcb]={'$like':'%'+_0x430c22[_0x6493('0x3a')]['filter']+'%'};return _0x1b3ba4;})});}_0x458473=_[_0x6493('0x46')]({},_0x458473,_0x430c22[_0x6493('0x49')]);return db['CannedAnswer']['count']({'where':_0x458473[_0x6493('0x44')]})[_0x6493('0x2c')](function(_0x560eb4){_0x28f4ce[_0x6493('0x28')]=_0x560eb4;if(_0x430c22[_0x6493('0x3a')][_0x6493('0x4a')]){_0x458473['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x458473);})[_0x6493('0x2c')](function(_0x50ebad){_0x28f4ce[_0x6493('0x4d')]=_0x50ebad;return _0x28f4ce;});}})[_0x6493('0x2c')](respondWithFilteredResult(_0x314c67,_0x458473))[_0x6493('0x21')](handleError(_0x314c67,null));};exports[_0x6493('0x64')]=function(_0x1344d0,_0x2843fc){return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x1344d0[_0x6493('0x59')]['id']}})['then'](handleEntityNotFound(_0x2843fc,null))[_0x6493('0x2c')](function(_0x1c2f6c){if(_0x1c2f6c){return _0x1c2f6c['removeAnswers'](_0x1344d0['query'][_0x6493('0x61')]);}})['then'](respondWithStatusCode(_0x2843fc,null))['catch'](handleError(_0x2843fc,null));};exports[_0x6493('0x65')]=function(_0x1ae217,_0x3c2eef){_0x1ae217['body']['sitepic']=_0x1ae217['file'][_0x6493('0x66')];return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x1ae217['params']['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x3c2eef,null))[_0x6493('0x2c')](saveUpdates(_0x1ae217['body'],null))[_0x6493('0x2c')](respondWithResult(_0x3c2eef,null))['catch'](handleError(_0x3c2eef,null));};exports[_0x6493('0x67')]=function(_0xd7a1cf,_0xe30062){_0xd7a1cf['body'][_0x6493('0x68')]=_0xd7a1cf[_0x6493('0x69')][_0x6493('0x66')];return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0xd7a1cf[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0xe30062,null))[_0x6493('0x2c')](saveUpdates(_0xd7a1cf[_0x6493('0x51')],null))[_0x6493('0x2c')](respondWithResult(_0xe30062,null))[_0x6493('0x21')](handleError(_0xe30062,null));};exports[_0x6493('0x6a')]=function(_0x563742,_0x494100){_0x563742[_0x6493('0x51')][_0x6493('0x6b')]=_0x563742[_0x6493('0x69')][_0x6493('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x563742[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x494100,null))[_0x6493('0x2c')](saveUpdates(_0x563742[_0x6493('0x51')],null))[_0x6493('0x2c')](respondWithResult(_0x494100,null))[_0x6493('0x21')](handleError(_0x494100,null));};exports[_0x6493('0x6c')]=function(_0x5c4329,_0x1b0deb){_0x5c4329[_0x6493('0x51')]['systemAvatar']=_0x5c4329[_0x6493('0x69')][_0x6493('0x66')];return db[_0x6493('0x37')]['find']({'where':{'id':_0x5c4329[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x1b0deb,null))[_0x6493('0x2c')](saveUpdates(_0x5c4329[_0x6493('0x51')],null))['then'](respondWithResult(_0x1b0deb,null))[_0x6493('0x21')](handleError(_0x1b0deb,null));};exports[_0x6493('0x6d')]=function(_0x3478ab,_0x42f90b){var _0x521816=path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x70'));var _0x1f1b9f={'where':{'id':_0x3478ab[_0x6493('0x59')]['id']},'attributes':['id',_0x6493('0x71')],'raw':!![]};var _0x42a62b=![];return require(_0x6493('0x72'))[_0x6493('0x73')]()['then'](function(_0x49a6bb){if(_0x49a6bb){_0x42a62b=_0x49a6bb[_0x6493('0x74')];}})[_0x6493('0x2c')](function(){return db[_0x6493('0x37')]['find'](_0x1f1b9f);})[_0x6493('0x2c')](handleEntityNotFound(_0x42f90b,null))[_0x6493('0x2c')](function(_0x3f93b7){if(_0x3f93b7){if(!_['isNil'](_0x3f93b7[_0x6493('0x71')])){if(fs[_0x6493('0x75')](path['join'](config[_0x6493('0x6f')],'server/files/images/logos/',_0x3f93b7[_0x6493('0x71')]))&&_0x42a62b){_0x521816=path[_0x6493('0x6e')](config[_0x6493('0x6f')],'server/files/images/logos/',_0x3f93b7[_0x6493('0x71')]);}}return _0x42f90b[_0x6493('0x76')](_0x521816);}})[_0x6493('0x21')](handleError(_0x42f90b,null));};exports[_0x6493('0x77')]=function(_0x13e7b8,_0x5ab3fa){var _0x9f87df=path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x78'));var _0x1771df={'where':{'id':_0x13e7b8[_0x6493('0x59')]['id']},'attributes':['id',_0x6493('0x68')],'raw':!![]};return db['ChatWebsite'][_0x6493('0x4f')](_0x1771df)[_0x6493('0x2c')](handleEntityNotFound(_0x5ab3fa,null))[_0x6493('0x2c')](function(_0x5787a8){if(_0x5787a8){if(!_[_0x6493('0x79')](_0x5787a8[_0x6493('0x68')])){if(fs[_0x6493('0x75')](path['join'](config[_0x6493('0x6f')],'server/files/images/avatars/',_0x5787a8[_0x6493('0x68')]))){_0x9f87df=path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x7a'),_0x5787a8[_0x6493('0x68')]);}}return _0x5ab3fa[_0x6493('0x76')](_0x9f87df);}})[_0x6493('0x21')](handleError(_0x5ab3fa,null));};exports[_0x6493('0x7b')]=function(_0x17352e,_0x15c1c){var _0x21e096=path['join'](config['root'],_0x6493('0x7c'));var _0x49f3cd={'where':{'id':_0x17352e['params']['id']},'attributes':['id',_0x6493('0x6b'),_0x6493('0x7d')],'raw':!![]};return db[_0x6493('0x37')][_0x6493('0x4f')](_0x49f3cd)[_0x6493('0x2c')](handleEntityNotFound(_0x15c1c,null))[_0x6493('0x2c')](function(_0x429888){if(_0x429888){if(!_[_0x6493('0x79')](_0x429888[_0x6493('0x6b')])){if(fs[_0x6493('0x75')](path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x7a'),_0x429888[_0x6493('0x6b')]))&&_0x429888[_0x6493('0x7d')]){_0x21e096=path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x7a'),_0x429888[_0x6493('0x6b')]);}}return _0x15c1c[_0x6493('0x76')](_0x21e096);}})['catch'](handleError(_0x15c1c,null));};exports[_0x6493('0x7e')]=function(_0x168274,_0x4600c6){var _0x429a20=path[_0x6493('0x6e')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x16829d={'where':{'id':_0x168274[_0x6493('0x59')]['id']},'attributes':['id',_0x6493('0x7f')],'raw':!![]};return db[_0x6493('0x37')][_0x6493('0x4f')](_0x16829d)[_0x6493('0x2c')](handleEntityNotFound(_0x4600c6,null))[_0x6493('0x2c')](function(_0x5a9fc3){if(_0x5a9fc3){if(!_[_0x6493('0x79')](_0x5a9fc3[_0x6493('0x7f')])){if(fs[_0x6493('0x75')](path['join'](config[_0x6493('0x6f')],_0x6493('0x7a'),_0x5a9fc3[_0x6493('0x7f')]))){_0x429a20=path[_0x6493('0x6e')](config[_0x6493('0x6f')],'server/files/images/avatars/',_0x5a9fc3['systemAvatar']);}}return _0x4600c6[_0x6493('0x76')](_0x429a20);}})['catch'](handleError(_0x4600c6,null));};exports[_0x6493('0x80')]=function(_0x24f30a,_0x13dd5b){var _0x8b05ca=require(_0x6493('0x81'));var _0x519353=new _0x8b05ca();var _0x4f559c=_0x519353[_0x6493('0x82')](_0x24f30a[_0x6493('0x83')]['user-agent'])[_0x6493('0x84')]();var _0x1e2f0e={'body':_0x24f30a['body'],'channel':_0x6493('0x85')};var _0x3e45e2=[];var _0x2f2b66=[];var _0x14171d={};var _0x4e6599=![];return db['CmContact'][_0x6493('0x5a')]()['then'](function(_0x29de77){if(!_0x29de77){throw new db['Sequelize'][(_0x6493('0x86'))](_0x6493('0x87'));}_0x3e45e2=_['difference'](_['keys'](_0x29de77),[_0x6493('0x88'),_0x6493('0x89')]);_0x2f2b66=_['difference'](_[_0x6493('0x3b')](_0x29de77),[_0x6493('0x88'),_0x6493('0x89'),_0x6493('0x8a'),_0x6493('0x8b')]);if(_0x24f30a[_0x6493('0x51')]['id']){delete _0x24f30a[_0x6493('0x51')]['id'];}if(_[_0x6493('0x79')](_0x24f30a[_0x6493('0x51')][_0x6493('0x8c')])){throw new db[(_0x6493('0x8d'))][(_0x6493('0x86'))](_0x6493('0x8e'));}if(_[_0x6493('0x79')](_0x24f30a[_0x6493('0x51')]['body'])||_0x24f30a['body'][_0x6493('0x51')]===''){throw new db[(_0x6493('0x8d'))][(_0x6493('0x86'))](_0x6493('0x8f'));}if(_[_0x6493('0x79')](_0x24f30a[_0x6493('0x51')]['mapKey'])){throw new db[(_0x6493('0x8d'))]['ValidationError'](_0x6493('0x90')+_0x2f2b66);}if(!_[_0x6493('0x91')](_0x2f2b66,_0x24f30a[_0x6493('0x51')][_0x6493('0x92')])){throw new db[(_0x6493('0x8d'))][(_0x6493('0x86'))](_0x6493('0x93')+_0x2f2b66);}_0x14171d[_0x24f30a[_0x6493('0x51')][_0x6493('0x92')]]=_0x24f30a[_0x6493('0x51')]['from'];})[_0x6493('0x2c')](function(){return db[_0x6493('0x37')]['find']({'where':{'id':_0x24f30a[_0x6493('0x59')]['id']},'include':[{'model':db[_0x6493('0x94')],'as':_0x6493('0x95'),'include':[{'model':db[_0x6493('0x96')],'as':_0x6493('0x97'),'where':_0x14171d,'limit':0x1,'order':[[_0x6493('0x89'),_0x6493('0x98')]]}]},{'model':db[_0x6493('0x99')],'as':_0x6493('0x9a')}]});})['then'](handleEntityNotFound(_0x13dd5b,null))['then'](function(_0x1e1da5){if(_0x1e1da5&&_0x1e1da5[_0x6493('0x95')]){_0x1e2f0e[_0x6493('0x9b')]=_0x1e1da5;_0x1e2f0e[_0x6493('0x9c')]=_0x1e1da5['Applications'];_0x1e2f0e[_0x6493('0x9d')]=_0x1e1da5[_0x6493('0x95')];_0x1e2f0e[_0x6493('0x9c')]=_['orderBy'](_0x1e2f0e[_0x6493('0x9c')],[_0x6493('0x9e')],[_0x6493('0x9f')]);if(_0x1e2f0e[_0x6493('0x9b')][_0x6493('0x9a')]){delete _0x1e2f0e[_0x6493('0x9b')][_0x6493('0x9a')];}if(_0x1e2f0e[_0x6493('0x9b')]['List']&&_0x1e2f0e[_0x6493('0x9b')][_0x6493('0x95')]['Contacts'][_0x6493('0x40')]){return _0x1e2f0e[_0x6493('0x9b')][_0x6493('0x95')][_0x6493('0x97')][0x0];}var _0x15ae70=_['defaults'](_0x24f30a[_0x6493('0x51')],{'firstName':_0x24f30a[_0x6493('0x51')][_0x6493('0x8c')],'ListId':_0x1e1da5[_0x6493('0x8b')]});_0x15ae70[_0x24f30a['body'][_0x6493('0x92')]]=_0x24f30a[_0x6493('0x51')][_0x6493('0x8c')];return db['CmContact'][_0x6493('0x50')](_0x15ae70,{'fields':_0x3e45e2,'raw':!![]});}})['then'](handleEntityNotFound(_0x13dd5b,null))[_0x6493('0x2c')](function(_0x2af234){_0x1e2f0e[_0x6493('0xa0')]=_0x2af234;var _0x339424=_0x24f30a[_0x6493('0x51')][_0x6493('0xa1')];if(_0x24f30a[_0x6493('0x83')][_0x6493('0xa2')]){_0x339424=_0x24f30a[_0x6493('0x83')][_0x6493('0xa2')];}else if(_0x24f30a[_0x6493('0x83')][_0x6493('0xa3')]){_0x339424=_['first'](_0x24f30a[_0x6493('0x83')]['x-forwarded-for'][_0x6493('0xa4')](','));}if(_0x2af234){var _0x583e77={'ContactId':_0x2af234['id'],'ChatWebsiteId':_0x24f30a[_0x6493('0x59')]['id'],'from':(_0x2af234[_0x6493('0xa5')]||'')+'\x20'+(_0x2af234[_0x6493('0xa6')]||''),'customerIp':_0x339424,'customerPort':_0x24f30a['headers'][_0x6493('0xa7')]?_0x24f30a[_0x6493('0x83')][_0x6493('0xa7')]:null,'referer':_0x24f30a[_0x6493('0x51')][_0x6493('0xa8')],'browserName':_0x4f559c[_0x6493('0xa9')][_0x6493('0x31')]&&_0x4f559c['browser'][_0x6493('0xaa')]?util[_0x6493('0xab')]('%s\x20%s',_0x4f559c[_0x6493('0xa9')][_0x6493('0x31')],_0x4f559c['browser']['version']):_0x6493('0xac'),'browserVersion':_0x4f559c['browser'][_0x6493('0xaa')]||_0x6493('0xac'),'osName':util['format'](_0x6493('0xad'),_0x4f559c['os'][_0x6493('0x31')],_0x4f559c['os'][_0x6493('0xaa')]),'osVersion':_0x4f559c['os'][_0x6493('0xaa')],'deviceModel':_0x4f559c['device'][_0x6493('0x39')]&&_0x4f559c[_0x6493('0xae')][_0x6493('0xaf')]?util['format'](_0x6493('0xb0'),_0x4f559c['device'][_0x6493('0x39')],_0x4f559c[_0x6493('0xae')][_0x6493('0xaf')],_0x4f559c[_0x6493('0xae')][_0x6493('0x47')]):null,'deviceVendor':_0x4f559c[_0x6493('0xae')][_0x6493('0xaf')],'deviceType':_0x4f559c[_0x6493('0xae')]['type'],'formData':JSON[_0x6493('0x1c')](_0x24f30a[_0x6493('0x51')])};var _0x3e9ec3={'ChatWebsiteId':_0x24f30a[_0x6493('0x59')]['id'],'closed':![]};if(_0x24f30a['body'][_0x6493('0xb1')]){_0x3e9ec3['threadId']=_0x24f30a['body'][_0x6493('0xb1')];return db[_0x6493('0xb2')][_0x6493('0x4f')]({'where':_0x3e9ec3})[_0x6493('0x2c')](function(_0x3b06b6){if(_0x3b06b6){return[_0x3b06b6,![]];}_0x583e77[_0x6493('0xb1')]=_0x24f30a[_0x6493('0x51')][_0x6493('0xb1')];_0x583e77[_0x6493('0xb3')]=_0x24f30a[_0x6493('0x51')][_0x6493('0xb3')];return db[_0x6493('0xb2')][_0x6493('0x50')](_0x583e77)['then'](function(_0x4a8e34){return[_0x4a8e34,!![]];});});}_0x3e9ec3[_0x6493('0xb4')]=_0x2af234['id'];if(_0x24f30a[_0x6493('0x51')][_0x6493('0xb5')]&&_0x24f30a[_0x6493('0x51')][_0x6493('0xb5')]['id']){_0x3e9ec3['id']=_0x24f30a[_0x6493('0x51')][_0x6493('0xb5')]['id'];return db[_0x6493('0xb2')][_0x6493('0x4f')]({'where':_0x3e9ec3})[_0x6493('0x2c')](function(_0x54e3a7){if(_0x54e3a7){return[_0x54e3a7,![]];}return db[_0x6493('0xb2')][_0x6493('0x50')](_0x583e77)[_0x6493('0x2c')](function(_0x440f20){return[_0x440f20,!![]];});});}return db[_0x6493('0xb2')][_0x6493('0x50')](_0x583e77)[_0x6493('0x2c')](function(_0x3bc7a9){return[_0x3bc7a9,!![]];});}})['spread'](function(_0x16549d,_0x5249cd){if(_0x16549d){_0x4e6599=_0x5249cd;if(!_0x5249cd){var _0x3f3a37={'from':(_0x1e2f0e[_0x6493('0xa0')][_0x6493('0xa5')]||'')+'\x20'+(_0x1e2f0e['contact'][_0x6493('0xa6')]||'')};if(_0x24f30a[_0x6493('0x51')]['threadId']&&_0x24f30a[_0x6493('0x51')]['messageId']&&_0x24f30a['body'][_0x6493('0xb1')]!=_0x24f30a[_0x6493('0x51')][_0x6493('0xb6')]){_0x3f3a37[_0x6493('0xb1')]=_0x24f30a['body']['messageId'];}return _0x16549d[_0x6493('0x2b')](_0x3f3a37);}else{return _0x16549d;}}})[_0x6493('0x2c')](function(_0x1ef8ca){_0x1e2f0e[_0x6493('0xb5')]=_0x1ef8ca[_0x6493('0x52')]({'plain':!![]});_0x1e2f0e[_0x6493('0xb5')]['created']=_0x4e6599;if(_0x1e2f0e[_0x6493('0xb5')]['created']){if(_0x1e2f0e[_0x6493('0x9b')][_0x6493('0xb7')]){_0x1e2f0e[_0x6493('0x9c')]['push']({'id':0x0,'priority':_0x1e2f0e['applications'][_0x6493('0x40')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x6493('0xb8')]['create']({'body':_0x24f30a[_0x6493('0x51')][_0x6493('0x51')],'ChatWebsiteId':_0x24f30a[_0x6493('0x59')]['id'],'ChatInteractionId':_0x1ef8ca['id'],'direction':'in','ContactId':_0x1e2f0e[_0x6493('0xa0')]['id'],'AttachmentId':_0x24f30a['body'][_0x6493('0xb9')]});})['then'](function(_0x469f5b){_0x1e2f0e[_0x6493('0x1f')]=_0x469f5b;if(_0x1e2f0e[_0x6493('0xb5')][_0x6493('0xba')]){return db[_0x6493('0xbb')][_0x6493('0x4f')]({'attributes':['id',_0x6493('0x31')],'where':{'id':_0x1e2f0e[_0x6493('0xb5')]['UserId']}})[_0x6493('0x2c')](function(_0x58bc00){if(_0x58bc00){_0x1e2f0e[_0x6493('0x9c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6493('0xbc'),'appdata':_0x58bc00[_0x6493('0x31')]+','+(_0x1e2f0e['account'][_0x6493('0xbd')]||0xa),'interval':_0x6493('0xbe')});_0x1e2f0e[_0x6493('0xbf')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x1e2f0e);});}return respondWithRpcPromise('Start',_0x6493('0xc0'),_0x1e2f0e);})[_0x6493('0x2c')](function(_0x2354ae){respondWithRpcPromise(_0x6493('0xc1'),_0x6493('0xc1'),{'event':_0x6493('0x80'),'message':_0x2354ae},client9002);return _0x2354ae;})[_0x6493('0x2c')](respondWithResult(_0x13dd5b,null))[_0x6493('0x21')](handleError(_0x13dd5b,null));};exports[_0x6493('0xc2')]=function(_0x57d831,_0x49e6b9){var _0x1071b5,_0x2229ca,_0x4140de;var _0x2325b6=[];var _0xbc5379={};var _0xc87aa3=_0x57d831['files']||[];var _0x284c68=[];var _0x44bea7;return db[_0x6493('0x96')][_0x6493('0x5a')]()[_0x6493('0x2c')](function(_0xe8ddf3){if(!_0xe8ddf3){throw new db['Sequelize']['ValidationError'](_0x6493('0x87'));}_0x2325b6=_[_0x6493('0xc3')](_[_0x6493('0x3b')](_0xe8ddf3),['createdAt',_0x6493('0x89'),_0x6493('0x8a'),'ListId']);if(_0x57d831['body']['id']){delete _0x57d831['body']['id'];}if(_[_0x6493('0x79')](_0x57d831['body']['from'])){throw _0x49e6b9[_0x6493('0x24')](0x1f4)[_0x6493('0x32')](new db[(_0x6493('0x8d'))]['ValidationError'](_0x6493('0x8e')));}if(_[_0x6493('0x79')](_0x57d831['body']['body'])||_0x57d831[_0x6493('0x51')]['body']===''){throw _0x49e6b9['status'](0x1f4)['send'](new db[(_0x6493('0x8d'))][(_0x6493('0x86'))](_0x6493('0x8f')));}if(_[_0x6493('0x79')](_0x57d831['body']['mapKeyOffline'])){throw _0x49e6b9['status'](0x1f4)['send'](new db[(_0x6493('0x8d'))][(_0x6493('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2325b6));}if(!_[_0x6493('0x91')](_0x2325b6,_0x57d831[_0x6493('0x51')]['mapKeyOffline'])){throw _0x49e6b9[_0x6493('0x24')](0x1f4)[_0x6493('0x32')](new db[(_0x6493('0x8d'))][(_0x6493('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2325b6));}_0xbc5379[_0x57d831['body'][_0x6493('0xc4')]]=_0x57d831[_0x6493('0x51')][_0x6493('0x8c')];})[_0x6493('0x2c')](function(){return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x57d831[_0x6493('0x59')]['id']},'include':[{'model':db[_0x6493('0x94')],'as':_0x6493('0x95')},{'model':db[_0x6493('0xc5')],'as':_0x6493('0xc5')}]});})[_0x6493('0x2c')](handleEntityNotFound(_0x49e6b9,null))['then'](function(_0x46819e){if(_0x46819e&&_0x46819e['List']){_0x2229ca=_0x46819e;var _0x5dbffc=_['defaults'](_0x57d831['body'],{'firstName':_0x57d831[_0x6493('0x51')][_0x6493('0x8c')],'phone':_0x57d831[_0x6493('0x51')][_0x6493('0x8c')],'ListId':_0x46819e['ListId']});_0x5dbffc[_0x57d831['body'][_0x6493('0xc4')]]=_0x57d831[_0x6493('0x51')]['from'];return db[_0x6493('0x96')]['findOrCreate']({'where':_0xbc5379,'defaults':_0x5dbffc});}})['spread'](function(_0x5437a1){if(_0x5437a1){_0x4140de=_0x5437a1;var _0x183fd9=fs[_0x6493('0xc6')](path[_0x6493('0x6e')](config['root'],_0x6493('0xc7')),_0x6493('0xc8'));var _0x29df69=ejs['render'](_0x183fd9,{'body':_[_0x6493('0xc9')](_0x57d831['body'][_0x6493('0x51')]),'bodyTitle':_0x2229ca[_0x6493('0xca')]});return db[_0x6493('0xcb')]['create']({'body':_0x29df69,'plainBody':htmlToText[_0x6493('0xcc')](_0x29df69),'ContactId':_0x5437a1['id'],'ChatWebsiteId':_0x2229ca['id']});}})[_0x6493('0x2c')](function(_0x39fdc9){_0x44bea7=_0x39fdc9;if(_0xc87aa3[_0x6493('0x40')]){var _0x263679=_0xc87aa3[_0x6493('0x36')](function(_0x2f8fb8){return{'name':_0x2f8fb8[_0x6493('0xcd')],'basename':_0x2f8fb8[_0x6493('0x66')],'type':_0x2f8fb8[_0x6493('0xce')],'ChatOfflineMessageId':_0x39fdc9['id']};});_0x284c68=_0x263679[_0x6493('0x36')](_0x2e69f1=>{var _0x255907={'filename':_0x2e69f1[_0x6493('0x31')],'path':path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0xcf'),_0x6493('0xd0'),_0x6493('0xd1'),_0x6493('0xd2'),_0x2e69f1['basename'])};return _0x255907;});if(!_0x2229ca[_0x6493('0xd3')]){return db[_0x6493('0xd4')][_0x6493('0xd5')](function(_0x17d122){return db[_0x6493('0xd6')][_0x6493('0xd7')](_0x263679,{'transaction':_0x17d122});});}}})[_0x6493('0x2c')](function(){if(_0x44bea7){_0x1071b5=_0x44bea7;return db[_0x6493('0xc5')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6493('0xd8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6493('0xd9')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x53a46c){if(_0x53a46c&&_0x53a46c[_0x6493('0xda')]&&_0x2229ca['forwardOffline']&&_0x2229ca[_0x6493('0xdb')]){var _0x43aed3=_0x53a46c['getSmtpOptions']();return respondWithRpcPromise(_0x6493('0xdc'),_0x6493('0xdd'),{'account':_0x43aed3,'message':{'from':util['format'](_0x6493('0xde'),_0x53a46c[_0x6493('0x31')],_0x53a46c['email']||_0x53a46c[_0x6493('0xda')][_0x6493('0x54')]),'to':_0x2229ca[_0x6493('0xdb')],'subject':_0x2229ca[_0x6493('0xdf')],'html':_0x1071b5[_0x6493('0x51')],'attachments':_0x284c68}},client9003)[_0x6493('0x2c')](function(){return _0x1071b5;})[_0x6493('0x21')](function(_0x3e6827){logger[_0x6493('0x1d')](_0x3e6827);});}})['then'](function(){if(_0x2229ca&&_0x2229ca[_0x6493('0xd3')]&&_0x2229ca[_0x6493('0xe0')]){var _0x3de8ee=[];if(_0xc87aa3[_0x6493('0x40')]){_0x3de8ee=_0xc87aa3[_0x6493('0x36')](function(_0x50c62f){return{'name':_0x50c62f['originalname'],'basename':_0x50c62f['filename'],'type':_0x50c62f[_0x6493('0xce')],'ChatOfflineMessageId':_0x44bea7['id']};});}var _0x457564;if(!_[_0x6493('0x79')](_0x2229ca['subjectOffline'])){var _0x20c0e2=_[_0x6493('0x36')](_0x57d831[_0x6493('0x51')],function(_0x53c7fb){return _0x53c7fb;});var _0x5498f2=_[_0x6493('0xe1')](_0x20c0e2)[0x0];var _0x1217d2=_[_0x6493('0xe2')](_0x5498f2,function(_0x31d1e2){return _0x31d1e2;});_0x457564=_0x1217d2[0x1][_0x2229ca[_0x6493('0xe3')]];}var _0xc93379={'from':_0x4140de['email'],'firstName':_0x4140de['firstName'],'lastName':_0x4140de[_0x6493('0xa6')],'mapKey':_0x6493('0xe4'),'message':{'from':_0x4140de[_0x6493('0xe4')],'to':_0x2229ca[_0x6493('0xc5')][_0x6493('0xe4')],'cc':'','subject':_[_0x6493('0x79')](_0x457564)?_0x2229ca[_0x6493('0xdf')]:_0x457564,'messageId':'','sentAt':new Date(),'attach':_0x3de8ee[_0x6493('0x40')],'attachments':_0x3de8ee,'originChannel':'Chat','ChatWebsiteId':_0x2229ca['id'],'ChatOfflineMessageId':_0x1071b5['id'],'originTo':_0x2229ca[_0x6493('0xc5')][_0x6493('0xe4')]},'body':_0x1071b5[_0x6493('0x51')]};var _0x48f262={'account':{'id':_0x2229ca[_0x6493('0xe0')]},'body':_0xc93379,'log':_0x6493('0xe5')};return respondWithRpcPromise('NotifyMailAccount',_0x6493('0xe6'),_0x48f262,client9001)[_0x6493('0x2c')](function(){return _0x1071b5;})[_0x6493('0x21')](function(_0x5cd407){logger['error'](_0x5cd407);});}return;})[_0x6493('0x2c')](function(){if(_0x1071b5){return _0x1071b5;}})[_0x6493('0x2c')](respondWithResult(_0x49e6b9,null))[_0x6493('0x21')](function(_0xbac33a){logger['error'](_0x6493('0x21'),_0xbac33a);for(var _0x27079b of _0xc87aa3){var _0x3c2d3c=path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0xcf'),_0x6493('0xd0'),_0x6493('0xd1'),_0x6493('0xd2'),_0x27079b[_0x6493('0x66')]);fs_extra[_0x6493('0xe7')](_0x3c2d3c)['catch'](function(_0x3930aa){logger[_0x6493('0x1d')](_0x6493('0xe8'),_0x3c2d3c,_0x3930aa);});}});};exports[_0x6493('0xe9')]=function(_0x2bd683,_0x3632c){return db[_0x6493('0xb2')][_0x6493('0x4f')]({'where':{'id':_0x2bd683[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x3632c,null))[_0x6493('0x2c')](function(_0x1e7c42){if(_0x1e7c42){return _0x1e7c42[_0x6493('0xe9')](_0x2bd683[_0x6493('0x51')]['ids'],_['omit'](_0x2bd683[_0x6493('0x51')],[_0x6493('0x61'),'id'])||{});}})['then'](respondWithResult(_0x3632c,null))[_0x6493('0x21')](handleError(_0x3632c,null));};exports[_0x6493('0xea')]=function(_0x3cc0e7,_0x4d65d4){var _0x29600f={'raw':![],'where':{}};var _0x12be4a={};var _0x5bad5e={'count':0x0,'rows':[]};return db[_0x6493('0x37')][_0x6493('0x5e')]({'where':{'id':_0x3cc0e7[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x4d65d4,null))[_0x6493('0x2c')](function(_0x3732a7){if(_0x3732a7){_0x12be4a[_0x6493('0x39')]=_[_0x6493('0x3b')](db[_0x6493('0xb2')][_0x6493('0x4e')]);_0x12be4a[_0x6493('0x3a')]=_['keys'](_0x3cc0e7[_0x6493('0x3a')]);_0x12be4a['filters']=_[_0x6493('0x3d')](_0x12be4a[_0x6493('0x39')],_0x12be4a[_0x6493('0x3a')]);_0x29600f[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x12be4a['model'],qs[_0x6493('0x3f')](_0x3cc0e7['query']['fields']));_0x29600f[_0x6493('0x3e')]=_0x29600f[_0x6493('0x3e')][_0x6493('0x40')]?_0x29600f[_0x6493('0x3e')]:_0x12be4a[_0x6493('0x39')];if(!_0x3cc0e7['query'][_0x6493('0x41')](_0x6493('0x5f'))){_0x29600f['limit']=qs[_0x6493('0x27')](_0x3cc0e7[_0x6493('0x3a')][_0x6493('0x27')]);_0x29600f[_0x6493('0x29')]=qs[_0x6493('0x29')](_0x3cc0e7[_0x6493('0x3a')]['offset']);}_0x29600f[_0x6493('0x42')]=qs[_0x6493('0x43')](_0x3cc0e7[_0x6493('0x3a')][_0x6493('0x43')]);_0x29600f[_0x6493('0x44')]=qs['filters'](_['pick'](_0x3cc0e7[_0x6493('0x3a')],_0x12be4a[_0x6493('0x3c')]));_0x29600f[_0x6493('0x44')][_0x6493('0x5b')]=_0x3732a7['id'];if(_0x3cc0e7[_0x6493('0x3a')]['filter']){_0x29600f[_0x6493('0x44')]=_[_0x6493('0x46')](_0x29600f[_0x6493('0x44')],{'$or':_['map'](_0x29600f[_0x6493('0x3e')],function(_0x5858a3){var _0x50a799={};_0x50a799[_0x5858a3]={'$like':'%'+_0x3cc0e7[_0x6493('0x3a')][_0x6493('0x45')]+'%'};return _0x50a799;})});}_0x29600f=_[_0x6493('0x46')]({},_0x29600f,_0x3cc0e7[_0x6493('0x49')]);return db[_0x6493('0xb2')]['count']({'where':_0x29600f['where']})[_0x6493('0x2c')](function(_0x2ca5da){_0x5bad5e['count']=_0x2ca5da;if(_0x3cc0e7[_0x6493('0x3a')]['includeAll']){_0x29600f[_0x6493('0x4b')]=[{'model':db[_0x6493('0x96')],'as':_0x6493('0xeb'),'required':![]},{'model':db[_0x6493('0xbb')],'as':_0x6493('0xec'),'attributes':[_0x6493('0x31'),_0x6493('0xed'),_0x6493('0xee')],'required':![]},{'model':db[_0x6493('0xef')],'as':_0x6493('0xf0'),'attributes':['id',_0x6493('0x31'),'color'],'where':_0x3cc0e7['query'][_0x6493('0xf1')]?{'id':_0x3cc0e7['query']['tag']}:undefined,'required':_0x3cc0e7[_0x6493('0x3a')][_0x6493('0xf1')]?!![]:![]}];}return db[_0x6493('0xb2')][_0x6493('0x4c')](_0x29600f);})[_0x6493('0x2c')](function(_0x53cf5e){_0x5bad5e[_0x6493('0x4d')]=_0x53cf5e;return _0x5bad5e;});}})[_0x6493('0x2c')](respondWithFilteredResult(_0x4d65d4,_0x29600f))[_0x6493('0x21')](handleError(_0x4d65d4,null));};function iftimePromise(_0x27f8fa,_0x2eff83){return respondWithRpcPromise(_0x6493('0xf2'),'getSnippet',{'command':_0x2eff83[_0x6493('0xf3')]?util[_0x6493('0xab')]('iftime\x20%s,%s',_0x27f8fa[_0x6493('0xf4')],_0x2eff83[_0x6493('0xf3')]):util['format'](_0x6493('0xf5'),_0x27f8fa[_0x6493('0xf4')])},client9002)[_0x6493('0x2c')](function(_0x577a40){var _0x35ee81=_0x577a40&&_0x577a40['indexOf'](_0x6493('0xf6'))>=0x0?!![]:![];logger[_0x6493('0x17')](_0x6493('0xf7'),_0x2eff83['id'],_0x27f8fa['id'],_0x27f8fa[_0x6493('0xf4')],_0x35ee81?'ONLINE':'OFFLINE',_0x2eff83[_0x6493('0xf3')]?_0x2eff83[_0x6493('0xf3')]:_0x6493('0xf8'));return _0x35ee81;})[_0x6493('0x21')](function(_0x4debe1){logger[_0x6493('0x1d')](_0x6493('0xf7'),_0x2eff83['id'],_0x27f8fa['id'],_0x27f8fa[_0x6493('0xf4')],util['inspect'](_0x4debe1,{'showHidden':![],'depth':null}),_0x2eff83[_0x6493('0xf3')]?_0x2eff83['timezone']:_0x6493('0xf8'));return![];});}exports[_0x6493('0xf9')]=function(_0x1c8b44,_0xbfce57){var _0x32373a=0x0;var _0x3a5fcd=0x0;var _0x52f2a2=![];var _0x576861;var _0x1f46dc;return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x1c8b44[_0x6493('0x59')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6493('0xfa')],'as':_0x6493('0xfb'),'attributes':['id',_0x6493('0xf4')],'raw':!![]}]}]})[_0x6493('0x2c')](handleEntityNotFound(_0xbfce57,null))['then'](function(_0x212b2c){if(_0x212b2c){_0x576861=_0x212b2c;return _0x212b2c['getProactiveActions']({'raw':!![]});}})[_0x6493('0x2c')](function(_0x465110){if(_0x576861){if(_0x465110){_0x1f46dc=_0x465110;}}return require(_0x6493('0x72'))[_0x6493('0x73')]();})[_0x6493('0x2c')](function(_0x5238cd){if(_0x5238cd){_0x3a5fcd=_0x5238cd['virtual'];_0x52f2a2=_0x5238cd[_0x6493('0x74')];}})['then'](function(){return db[_0x6493('0xb2')]['count']({'where':{'closed':![]}});})[_0x6493('0x2c')](function(_0xfdf6eb){_0x32373a=_0xfdf6eb;if(_0x3a5fcd&&_0xfdf6eb>_0x3a5fcd){return db[_0x6493('0xfc')]['findOne']({'where':{'id':0x1}})['then'](function(_0x48384a){if(_0x48384a){_0x48384a[_0x6493('0xfd')](_0x6493('0xfe'));}});}})[_0x6493('0x2c')](function(){if(_0x576861[_0x6493('0xfa')]&&_0x576861[_0x6493('0xfa')][_0x6493('0xfb')]){var _0x251830=[];for(var _0x17fcae=0x0;_0x17fcae<_0x576861[_0x6493('0xfa')][_0x6493('0xfb')][_0x6493('0x40')];_0x17fcae++){var _0x377d60=_0x576861[_0x6493('0xfa')][_0x6493('0xfb')][_0x17fcae]['get']({'plain':!![]});_0x251830[_0x6493('0xff')](iftimePromise(_0x377d60,_0x576861));}return BPromise[_0x6493('0x100')](_0x251830)['then'](function(_0x186be4){return _[_0x6493('0x101')](_0x186be4);});}else{return!![];}})[_0x6493('0x2c')](function(_0x6db96d){var _0x1db89a=fs[_0x6493('0xc6')](path[_0x6493('0x6e')](config[_0x6493('0x6f')],_0x6493('0x102')),_0x6493('0xc8'));var _0x3cb884={'remote':_0x576861[_0x6493('0x103')],'query':querystring['stringify'](_['merge'](_0x576861[_0x6493('0x52')]({'plain':!![]}),{'customerIp':_0x1c8b44['headers'][_0x6493('0xa3')]||_0x1c8b44[_0x6493('0x83')][_0x6493('0x104')]||_0x1c8b44[_0x6493('0x105')][_0x6493('0x106')]||_0x1c8b44['ip'],'referer':_0x1c8b44['headers'][_0x6493('0xa8')],'openedInteractions':_0x32373a,'maxInteractions':_0x3a5fcd,'virtual':_0x52f2a2['virtual'],'online':_0x6db96d,'custom':_0x52f2a2}))[_0x6493('0x107')](/'/g,'\x5c\x27')};_0xbfce57[_0x6493('0x32')](ejs[_0x6493('0x108')](Mustache['render'](_0x1db89a,_0x3cb884),{'proactiveActions':_0x1f46dc,'alignment':_0x576861[_0x6493('0x109')],'verticalAlignment':_0x576861[_0x6493('0x10a')],'div_color':_0x576861[_0x6493('0x10b')],'labelText':_0x576861['labelText'],'text_color':_0x576861[_0x6493('0x10c')],'text_button_color':_0x576861[_0x6493('0x10d')],'button_color':_0x576861['color_button'],'background_color':_0x576861[_0x6493('0x10e')],'hideWhenOffline':_0x576861[_0x6493('0x10f')],'interval':_0x576861[_0x6493('0x110')]}));})[_0x6493('0x21')](handleError(_0xbfce57,null));};exports[_0x6493('0x111')]=function(_0x38c6e6,_0xd291f0){var _0x4a75a6=_0x38c6e6[_0x6493('0x59')]['id'];var _0x2c6d32=_0x38c6e6['body'];var _0x4b488f=0xc8;var _0x338a6b=null;return db['sequelize'][_0x6493('0xd5')]({'isolationLevel':db[_0x6493('0xd4')][_0x6493('0x112')][_0x6493('0x113')][_0x6493('0x114')]},function(_0x62ad3b){return db[_0x6493('0x37')]['findOne']({'where':{'id':_0x4a75a6},'transaction':_0x62ad3b})['then'](function(_0x418bd7){if(_0x418bd7){return db[_0x6493('0x99')]['destroy']({'where':{'ChatWebsiteId':_0x4a75a6},'transaction':_0x62ad3b})[_0x6493('0x2c')](function(){var _0x51161c=_[_0x6493('0x36')](_0x2c6d32,function(_0x57db69){_0x57db69[_0x6493('0x5b')]=_0x4a75a6;return _0x57db69;});return db['ChatApplication']['bulkCreate'](_0x51161c,{'transaction':_0x62ad3b});});}else{_0x4b488f=0x194;_0x338a6b=[];}});})[_0x6493('0x2c')](function(){if(_0x4b488f!==0x194){return db['ChatApplication'][_0x6493('0x115')]({'where':{'ChatWebsiteId':_0x4a75a6},'order':'priority'})['then'](function(_0xd39e63){_0x338a6b=_0xd39e63;});}})[_0x6493('0x21')](function(_0x4c4f54){_0x4b488f=0x1f4;logger[_0x6493('0x1d')](_0x4c4f54[_0x6493('0x30')]);if(_0x4c4f54[_0x6493('0x31')]){delete _0x4c4f54[_0x6493('0x31')];}_0x338a6b=_0x4c4f54;})['finally'](function(){if(_0x338a6b===null){_0xd291f0[_0x6493('0x22')](_0x4b488f);}else{if(_0x4b488f===0x1f4){_0xd291f0[_0x6493('0x24')](_0x4b488f)[_0x6493('0x32')](_0x338a6b);}else{_0xd291f0[_0x6493('0x24')](_0x4b488f)[_0x6493('0x25')](_0x338a6b);}}});};exports[_0x6493('0x116')]=function(_0x1b2194,_0x117dee){var _0x1268e6={};var _0x10520f={};var _0x6d2ddd;var _0x38af51;return db[_0x6493('0x37')][_0x6493('0x5e')]({'where':{'id':_0x1b2194[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x117dee,null))[_0x6493('0x2c')](function(_0x48cb53){if(_0x48cb53){_0x6d2ddd=_0x48cb53;_0x10520f['model']=_[_0x6493('0x3b')](db[_0x6493('0x99')]['rawAttributes']);_0x10520f['query']=_[_0x6493('0x3b')](_0x1b2194[_0x6493('0x3a')]);_0x10520f[_0x6493('0x3c')]=_['intersection'](_0x10520f[_0x6493('0x39')],_0x10520f[_0x6493('0x3a')]);_0x1268e6[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x10520f[_0x6493('0x39')],qs['fields'](_0x1b2194[_0x6493('0x3a')][_0x6493('0x3f')]));_0x1268e6[_0x6493('0x3e')]=_0x1268e6['attributes'][_0x6493('0x40')]?_0x1268e6[_0x6493('0x3e')]:_0x10520f[_0x6493('0x39')];_0x1268e6[_0x6493('0x42')]=qs['sort'](_0x1b2194[_0x6493('0x3a')][_0x6493('0x43')]);_0x1268e6[_0x6493('0x44')]=qs['filters'](_[_0x6493('0x63')](_0x1b2194['query'],_0x10520f[_0x6493('0x3c')]));if(_0x1b2194['query'][_0x6493('0x45')]){_0x1268e6['where']=_[_0x6493('0x46')](_0x1268e6[_0x6493('0x44')],{'$or':_[_0x6493('0x36')](_0x1268e6[_0x6493('0x3e')],function(_0x199995){var _0x308b65={};_0x308b65[_0x199995]={'$like':'%'+_0x1b2194[_0x6493('0x3a')]['filter']+'%'};return _0x308b65;})});}_0x1268e6=_['merge']({},_0x1268e6,_0x1b2194[_0x6493('0x49')]);return _0x6d2ddd['getApplications'](_0x1268e6);}})[_0x6493('0x2c')](function(_0x267a11){if(_0x267a11){_0x38af51=_0x267a11[_0x6493('0x40')];if(!_0x1b2194[_0x6493('0x3a')][_0x6493('0x41')]('nolimit')){_0x1268e6[_0x6493('0x27')]=qs[_0x6493('0x27')](_0x1b2194['query']['limit']);_0x1268e6['offset']=qs[_0x6493('0x29')](_0x1b2194[_0x6493('0x3a')][_0x6493('0x29')]);}return _0x6d2ddd['getApplications'](_0x1268e6);}})[_0x6493('0x2c')](function(_0x41c7f2){if(_0x41c7f2){return _0x41c7f2?{'count':_0x38af51,'rows':_0x41c7f2}:null;}})[_0x6493('0x2c')](respondWithResult(_0x117dee,null))[_0x6493('0x21')](handleError(_0x117dee,null));};exports[_0x6493('0x117')]=function(_0x541abd,_0x4a3363){return db[_0x6493('0x118')][_0x6493('0x4f')]({'where':{'id':_0x541abd[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x4a3363,null))[_0x6493('0x2c')](function(_0xc85fbe){if(_0xc85fbe){return _0xc85fbe[_0x6493('0x117')](_0x541abd[_0x6493('0x51')][_0x6493('0x61')],_['omit'](_0x541abd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4a3363,null))[_0x6493('0x21')](handleError(_0x4a3363,null));};exports[_0x6493('0x119')]=function(_0x52ae80,_0x317d67){var _0x5e4b8e={};var _0x2378f9={};var _0x1a9cac;var _0x57a743;return db[_0x6493('0x37')][_0x6493('0x5e')]({'where':{'id':_0x52ae80[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x317d67,null))[_0x6493('0x2c')](function(_0x8ddcaa){if(_0x8ddcaa){_0x1a9cac=_0x8ddcaa;_0x2378f9['model']=_[_0x6493('0x3b')](db['ChatProactiveAction'][_0x6493('0x4e')]);_0x2378f9['query']=_['keys'](_0x52ae80[_0x6493('0x3a')]);_0x2378f9[_0x6493('0x3c')]=_[_0x6493('0x3d')](_0x2378f9[_0x6493('0x39')],_0x2378f9[_0x6493('0x3a')]);_0x5e4b8e[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x2378f9[_0x6493('0x39')],qs[_0x6493('0x3f')](_0x52ae80[_0x6493('0x3a')]['fields']));_0x5e4b8e['attributes']=_0x5e4b8e['attributes'][_0x6493('0x40')]?_0x5e4b8e['attributes']:_0x2378f9[_0x6493('0x39')];_0x5e4b8e[_0x6493('0x42')]=qs['sort'](_0x52ae80[_0x6493('0x3a')][_0x6493('0x43')]);_0x5e4b8e['where']=qs[_0x6493('0x3c')](_[_0x6493('0x63')](_0x52ae80[_0x6493('0x3a')],_0x2378f9[_0x6493('0x3c')]));if(_0x52ae80['query'][_0x6493('0x45')]){_0x5e4b8e[_0x6493('0x44')]=_[_0x6493('0x46')](_0x5e4b8e['where'],{'$or':_[_0x6493('0x36')](_0x5e4b8e[_0x6493('0x3e')],function(_0x28c628){var _0x21dc46={};_0x21dc46[_0x28c628]={'$like':'%'+_0x52ae80[_0x6493('0x3a')][_0x6493('0x45')]+'%'};return _0x21dc46;})});}_0x5e4b8e=_['merge']({},_0x5e4b8e,_0x52ae80[_0x6493('0x49')]);return _0x1a9cac[_0x6493('0x119')](_0x5e4b8e);}})[_0x6493('0x2c')](function(_0x3bd691){if(_0x3bd691){_0x57a743=_0x3bd691['length'];if(!_0x52ae80['query'][_0x6493('0x41')](_0x6493('0x5f'))){_0x5e4b8e['limit']=qs[_0x6493('0x27')](_0x52ae80[_0x6493('0x3a')][_0x6493('0x27')]);_0x5e4b8e[_0x6493('0x29')]=qs['offset'](_0x52ae80[_0x6493('0x3a')]['offset']);}return _0x1a9cac[_0x6493('0x119')](_0x5e4b8e);}})[_0x6493('0x2c')](function(_0x258c82){if(_0x258c82){return _0x258c82?{'count':_0x57a743,'rows':_0x258c82}:null;}})[_0x6493('0x2c')](respondWithResult(_0x317d67,null))[_0x6493('0x21')](handleError(_0x317d67,null));};exports[_0x6493('0x11a')]=function(_0x47ce,_0x206e49){var _0x495698=_0x47ce[_0x6493('0x3a')][_0x6493('0x11b')]===_0x6493('0x11c')?_0x6493('0x11d'):_0x6493('0x11e');return db[_0x6493('0x37')][_0x6493('0x4f')]({'attributes':['id',_0x495698],'where':{'id':_0x47ce[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x206e49,null))[_0x6493('0x2c')](function(_0x306927){if(_0x306927){var _0xd27b8=_0x306927[_0x495698];var _0x341397=_0xd27b8&&_0xd27b8[_0x6493('0x11f')]?_0xd27b8[_0x6493('0x11f')]:[];_0x206e49['send']({'fromKey':_[_0x6493('0x79')](_0xd27b8[_0x6493('0x120')])?undefined:_0xd27b8[_0x6493('0x120')],'count':_0x341397['length'],'rows':_0x341397});}})[_0x6493('0x21')](handleError(_0x206e49,null));};exports[_0x6493('0x121')]=function(_0x2bb659,_0x23bbee){var _0x2cf7cb={'raw':![],'where':{}};var _0x6b53f9={};var _0x2c2c5c={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2bb659[_0x6493('0x59')]['id']}})['then'](handleEntityNotFound(_0x23bbee,null))[_0x6493('0x2c')](function(_0x1d95a9){if(_0x1d95a9){_0x6b53f9[_0x6493('0x39')]=_['keys'](db[_0x6493('0xcb')]['rawAttributes']);_0x6b53f9['query']=_[_0x6493('0x3b')](_0x2bb659[_0x6493('0x3a')]);_0x6b53f9['filters']=_[_0x6493('0x3d')](_0x6b53f9['model'],_0x6b53f9[_0x6493('0x3a')]);_0x2cf7cb[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x6b53f9[_0x6493('0x39')],qs['fields'](_0x2bb659['query'][_0x6493('0x3f')]));_0x2cf7cb[_0x6493('0x3e')]=_0x2cf7cb[_0x6493('0x3e')][_0x6493('0x40')]?_0x2cf7cb[_0x6493('0x3e')]:_0x6b53f9[_0x6493('0x39')];if(!_0x2bb659[_0x6493('0x3a')][_0x6493('0x41')](_0x6493('0x5f'))){_0x2cf7cb[_0x6493('0x27')]=qs[_0x6493('0x27')](_0x2bb659[_0x6493('0x3a')][_0x6493('0x27')]);_0x2cf7cb['offset']=qs[_0x6493('0x29')](_0x2bb659[_0x6493('0x3a')][_0x6493('0x29')]);}_0x2cf7cb[_0x6493('0x42')]=qs[_0x6493('0x43')](_0x2bb659[_0x6493('0x3a')][_0x6493('0x43')]);_0x2cf7cb[_0x6493('0x44')]=qs[_0x6493('0x3c')](_[_0x6493('0x63')](_0x2bb659['query'],_0x6b53f9['filters']));_0x2cf7cb['where'][_0x6493('0x5b')]=_0x1d95a9['id'];if(_0x2bb659[_0x6493('0x3a')][_0x6493('0x45')]){_0x2cf7cb[_0x6493('0x44')]=_[_0x6493('0x46')](_0x2cf7cb[_0x6493('0x44')],{'$or':_[_0x6493('0x36')](_0x2cf7cb[_0x6493('0x3e')],function(_0x3ed65d){var _0x3caa19={};_0x3caa19[_0x3ed65d]={'$like':'%'+_0x2bb659['query']['filter']+'%'};return _0x3caa19;})});}_0x2cf7cb=_[_0x6493('0x46')]({},_0x2cf7cb,_0x2bb659['options']);return db[_0x6493('0xcb')]['count']({'where':_0x2cf7cb[_0x6493('0x44')]})['then'](function(_0x20bc99){_0x2c2c5c[_0x6493('0x28')]=_0x20bc99;if(_0x2bb659[_0x6493('0x3a')]['includeAll']){_0x2cf7cb[_0x6493('0x4b')]=[{'all':!![]}];}else{_0x2cf7cb[_0x6493('0x4b')]=[{'model':db[_0x6493('0x96')],'as':_0x6493('0xeb'),'required':![]},{'model':db[_0x6493('0xd6')],'as':_0x6493('0x122'),'required':![]}];}return db[_0x6493('0xcb')]['findAll'](_0x2cf7cb);})['then'](function(_0x48cefc){_0x2c2c5c[_0x6493('0x4d')]=_0x48cefc;return _0x2c2c5c;});}})['then'](respondWithFilteredResult(_0x23bbee,_0x2cf7cb))['catch'](handleError(_0x23bbee,null));};exports[_0x6493('0x123')]=function(_0x3a5984,_0x1d38e3){return db[_0x6493('0x37')]['find']({'where':{'id':_0x3a5984[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x1d38e3,null))[_0x6493('0x2c')](function(_0x2e3965){if(_0x2e3965){return _0x2e3965[_0x6493('0x123')](_0x3a5984[_0x6493('0x51')][_0x6493('0x61')],_[_0x6493('0x124')](_0x3a5984[_0x6493('0x51')],[_0x6493('0x61'),'id'])||{})[_0x6493('0x125')](function(_0x418e1e){for(var _0x35e332=0x0;_0x35e332<_0x3a5984[_0x6493('0x51')]['ids'][_0x6493('0x40')];_0x35e332+=0x1){socket[_0x6493('0x126')](_0x6493('0x127'),{'UserId':Number(_0x3a5984[_0x6493('0x51')][_0x6493('0x61')][_0x35e332]),'ChatWebsiteId':Number(_0x3a5984[_0x6493('0x59')]['id'])});}return _0x418e1e;});}})[_0x6493('0x2c')](respondWithResult(_0x1d38e3,null))[_0x6493('0x21')](handleError(_0x1d38e3,null));};exports[_0x6493('0x128')]=function(_0x250ebe,_0x389a78){return db[_0x6493('0x37')][_0x6493('0x4f')]({'where':{'id':_0x250ebe[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x389a78,null))[_0x6493('0x2c')](function(_0x28f573){if(_0x28f573){return _0x28f573[_0x6493('0x128')](_0x250ebe[_0x6493('0x3a')]['ids'])[_0x6493('0x2c')](function(){if(_[_0x6493('0x129')](_0x250ebe['query'][_0x6493('0x61')])){for(var _0x4d6b6e=0x0;_0x4d6b6e<_0x250ebe[_0x6493('0x3a')][_0x6493('0x61')][_0x6493('0x40')];_0x4d6b6e+=0x1){socket[_0x6493('0x126')](_0x6493('0x12a'),{'UserId':Number(_0x250ebe['query']['ids'][_0x4d6b6e]),'ChatWebsiteId':Number(_0x250ebe['params']['id'])});}}else{socket[_0x6493('0x126')](_0x6493('0x12a'),{'UserId':Number(_0x250ebe[_0x6493('0x3a')][_0x6493('0x61')]),'ChatWebsiteId':Number(_0x250ebe[_0x6493('0x59')]['id'])});}});}})[_0x6493('0x2c')](respondWithStatusCode(_0x389a78,null))[_0x6493('0x21')](handleError(_0x389a78,null));};exports[_0x6493('0x12b')]=function(_0x5caac0,_0x4c8f85){var _0x298904={};var _0x3b0ef9={};var _0x5c1ed6;var _0x201cd6;return db[_0x6493('0x37')][_0x6493('0x5e')]({'where':{'id':_0x5caac0[_0x6493('0x59')]['id']}})[_0x6493('0x2c')](handleEntityNotFound(_0x4c8f85,null))['then'](function(_0xdf2d76){if(_0xdf2d76){_0x5c1ed6=_0xdf2d76;_0x3b0ef9[_0x6493('0x39')]=_[_0x6493('0x3b')](db[_0x6493('0xbb')][_0x6493('0x4e')]);_0x3b0ef9[_0x6493('0x3a')]=_[_0x6493('0x3b')](_0x5caac0[_0x6493('0x3a')]);_0x3b0ef9['filters']=_[_0x6493('0x3d')](_0x3b0ef9['model'],_0x3b0ef9[_0x6493('0x3a')]);_0x298904[_0x6493('0x3e')]=_[_0x6493('0x3d')](_0x3b0ef9[_0x6493('0x39')],qs[_0x6493('0x3f')](_0x5caac0[_0x6493('0x3a')][_0x6493('0x3f')]));_0x298904[_0x6493('0x3e')]=_0x298904[_0x6493('0x3e')][_0x6493('0x40')]?_0x298904[_0x6493('0x3e')]:_0x3b0ef9[_0x6493('0x39')];_0x298904[_0x6493('0x42')]=qs[_0x6493('0x43')](_0x5caac0['query']['sort']);_0x298904[_0x6493('0x44')]=qs['filters'](_[_0x6493('0x63')](_0x5caac0[_0x6493('0x3a')],_0x3b0ef9['filters']));if(_0x5caac0['query'][_0x6493('0x45')]){_0x298904[_0x6493('0x44')]=_[_0x6493('0x46')](_0x298904[_0x6493('0x44')],{'$or':_['map'](_0x298904['attributes'],function(_0x3648b2){var _0x59526e={};_0x59526e[_0x3648b2]={'$like':'%'+_0x5caac0[_0x6493('0x3a')][_0x6493('0x45')]+'%'};return _0x59526e;})});}_0x298904=_[_0x6493('0x46')]({},_0x298904,_0x5caac0[_0x6493('0x49')]);return _0x5c1ed6[_0x6493('0x12b')](_0x298904);}})[_0x6493('0x2c')](function(_0x32a7b3){if(_0x32a7b3){_0x201cd6=_0x32a7b3[_0x6493('0x40')];if(!_0x5caac0['query']['hasOwnProperty'](_0x6493('0x5f'))){_0x298904[_0x6493('0x27')]=qs['limit'](_0x5caac0[_0x6493('0x3a')][_0x6493('0x27')]);_0x298904[_0x6493('0x29')]=qs[_0x6493('0x29')](_0x5caac0['query'][_0x6493('0x29')]);}return _0x5c1ed6['getAgents'](_0x298904);}})[_0x6493('0x2c')](function(_0x273c0f){if(_0x273c0f){return _0x273c0f?{'count':_0x201cd6,'rows':_0x273c0f}:null;}})[_0x6493('0x2c')](respondWithResult(_0x4c8f85,null))['catch'](handleError(_0x4c8f85,null));}; \ No newline at end of file +var _0xc260=['inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','get','ChatWebsites','UserProfileResource','destroy','end','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','isNil','existsSync','root','server/files/images/logos/','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','Contacts','ChatApplication','Applications','List','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','ChatInteraction','threadId','externalUrl','interaction','lastName','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','UserId','forcedOwnership','startRouting','Start','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','utf8','offlineMessageBody','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','getInteractions','Contact','Owner','internal','Tag','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone'];(function(_0x46f7ff,_0x3dfade){var _0x5e1235=function(_0x4cbbdd){while(--_0x4cbbdd){_0x46f7ff['push'](_0x46f7ff['shift']());}};_0x5e1235(++_0x3dfade);}(_0xc260,0x155));var _0x0c26=function(_0x2f96f7,_0x477c5f){_0x2f96f7=_0x2f96f7-0x0;var _0x53210e=_0xc260[_0x2f96f7];return _0x53210e;};'use strict';var BPromise=require(_0x0c26('0x0'));var Mustache=require(_0x0c26('0x1'));var util=require(_0x0c26('0x2'));var path=require(_0x0c26('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c26('0x4'));var _=require(_0x0c26('0x5'));var querystring=require('querystring');var Redis=require(_0x0c26('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x0c26('0x7'))(_0x0c26('0x8'));var config=require(_0x0c26('0x9'));var db=require(_0x0c26('0xa'))['db'];config[_0x0c26('0xb')]=_[_0x0c26('0xc')](config[_0x0c26('0xb')],{'host':_0x0c26('0xd'),'port':0x18eb});var socket=require(_0x0c26('0xe'))(new Redis(config[_0x0c26('0xb')]));require(_0x0c26('0xf'))['register'](socket);var htmlToText=require(_0x0c26('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x0c26('0x11')][_0x0c26('0x12')]({'port':0x232c});var client9002=jayson[_0x0c26('0x11')][_0x0c26('0x12')]({'port':0x232a});var client9003=jayson['client'][_0x0c26('0x12')]({'port':0x232b});var client9001=jayson[_0x0c26('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x607fb9,_0x37633d,_0x2e626d,_0x53f538){return new BPromise(function(_0x500d9e,_0x2226eb){var _0x2eb2d7=_0x53f538||client;return _0x2eb2d7['request'](_0x607fb9,_0x2e626d)['then'](function(_0x3b4973){logger[_0x0c26('0x13')](_0x0c26('0x14'),_0x37633d,'request\x20sent');logger[_0x0c26('0x15')](_0x0c26('0x16'),_0x37633d,_0x0c26('0x17'),JSON[_0x0c26('0x18')](_0x3b4973));if(_0x3b4973[_0x0c26('0x19')]){if(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1a')]===0x1f4){logger[_0x0c26('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x37633d,_0x3b4973['error'][_0x0c26('0x1b')]);return _0x2226eb(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);}logger[_0x0c26('0x19')](_0x0c26('0x14'),_0x37633d,_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);return _0x500d9e(_0x3b4973[_0x0c26('0x19')][_0x0c26('0x1b')]);}else{logger[_0x0c26('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x37633d,_0x0c26('0x17'));_0x500d9e(_0x3b4973['result'][_0x0c26('0x1b')]);}})['catch'](function(_0x5318a7){logger[_0x0c26('0x19')](_0x0c26('0x14'),_0x37633d,_0x5318a7);_0x2226eb(_0x5318a7);});});}function respondWithStatusCode(_0x1e4bbe,_0xfe650a){_0xfe650a=_0xfe650a||0xcc;return function(_0x133400){if(_0x133400){return _0x1e4bbe[_0x0c26('0x1c')](_0xfe650a);}return _0x1e4bbe[_0x0c26('0x1d')](_0xfe650a)['end']();};}function respondWithResult(_0x2d83ad,_0x6fe965){_0x6fe965=_0x6fe965||0xc8;return function(_0x52fe6b){if(_0x52fe6b){return _0x2d83ad['status'](_0x6fe965)[_0x0c26('0x1e')](_0x52fe6b);}};}function respondWithFilteredResult(_0x3898af,_0x34965f){return function(_0x4928d8){if(_0x4928d8){var _0x3bead5=typeof _0x34965f['offset']===_0x0c26('0x1f')&&typeof _0x34965f[_0x0c26('0x20')]===_0x0c26('0x1f');var _0x22200c=_0x4928d8[_0x0c26('0x21')];var _0xafe07a=_0x3bead5?0x0:_0x34965f['offset'];var _0x2c4d3f=_0x3bead5?_0x4928d8['count']:_0x34965f[_0x0c26('0x22')]+_0x34965f[_0x0c26('0x20')];var _0x5820bb;if(_0x2c4d3f>=_0x22200c){_0x2c4d3f=_0x22200c;_0x5820bb=0xc8;}else{_0x5820bb=0xce;}_0x3898af['status'](_0x5820bb);return _0x3898af[_0x0c26('0x23')](_0x0c26('0x24'),_0xafe07a+'-'+_0x2c4d3f+'/'+_0x22200c)[_0x0c26('0x1e')](_0x4928d8);}return null;};}function saveUpdates(_0x45869e){return function(_0x2256d3){if(_0x2256d3){return _0x2256d3[_0x0c26('0x25')](_0x45869e)['then'](function(_0x2a7e6e){return _0x2a7e6e;});}return null;};}function removeEntity(_0x2d3373){return function(_0x446d8c){if(_0x446d8c){return _0x446d8c['destroy']()[_0x0c26('0x26')](function(){var _0x4471d8=_0x446d8c[_0x0c26('0x27')]({'plain':!![]});var _0x4c9b9a=_0x0c26('0x28');return db[_0x0c26('0x29')][_0x0c26('0x2a')]({'where':{'type':_0x4c9b9a,'resourceId':_0x4471d8['id']}})[_0x0c26('0x26')](function(){return _0x446d8c;});})[_0x0c26('0x26')](function(){_0x2d3373[_0x0c26('0x1d')](0xcc)[_0x0c26('0x2b')]();});}};}function handleEntityNotFound(_0x31b2fb){return function(_0x842fb){if(!_0x842fb){_0x31b2fb[_0x0c26('0x1c')](0x194);}return _0x842fb;};}function handleError(_0x290821,_0x3fbeda){_0x3fbeda=_0x3fbeda||0x1f4;return function(_0xec6847){logger[_0x0c26('0x19')](_0xec6847[_0x0c26('0x2c')]);if(_0xec6847['name']){delete _0xec6847['name'];}_0x290821[_0x0c26('0x1d')](_0x3fbeda)[_0x0c26('0x2d')](_0xec6847);};}exports[_0x0c26('0x2e')]=function(_0x6db0e6,_0x1b40b5){var _0x1f1504={'include':[{'model':db[_0x0c26('0x2f')],'as':_0x0c26('0x30')}]},_0x42fad5={},_0xc0554f={'count':0x0,'rows':[]};var _0x4f9e64=_[_0x0c26('0x31')](db[_0x0c26('0x32')]['rawAttributes'],function(_0x33e798){return{'name':_0x33e798[_0x0c26('0x33')],'type':_0x33e798[_0x0c26('0x34')][_0x0c26('0x35')]};});_0x42fad5['model']=_[_0x0c26('0x31')](_0x4f9e64,_0x0c26('0x36'));_0x42fad5[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x6db0e6[_0x0c26('0x37')]);_0x42fad5[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x42fad5[_0x0c26('0x3b')],_0x42fad5[_0x0c26('0x37')]);_0x1f1504[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x42fad5[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x1f1504[_0x0c26('0x3c')]=_0x1f1504[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x1f1504[_0x0c26('0x3c')]:_0x42fad5[_0x0c26('0x3b')];if(!_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x1f1504[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x20')]);_0x1f1504[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x1f1504['order']=qs[_0x0c26('0x41')](_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x41')]);_0x1f1504[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x6db0e6['query'],_0x42fad5[_0x0c26('0x39')]),_0x4f9e64);if(_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x44')]){_0x1f1504[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x1f1504[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x4f9e64,function(_0x4e83eb){if(_0x4e83eb['type']!==_0x0c26('0x46')){var _0x57e2ca={};_0x57e2ca[_0x4e83eb[_0x0c26('0x36')]]={'$like':'%'+_0x6db0e6[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x57e2ca;}})});}_0x1f1504=_['merge']({},_0x1f1504,_0x6db0e6['options']);var _0x17ecf0={'where':_0x1f1504[_0x0c26('0x42')]};return db['ChatWebsite'][_0x0c26('0x21')](_0x17ecf0)['then'](function(_0x56256d){_0xc0554f[_0x0c26('0x21')]=_0x56256d;if(_0x6db0e6[_0x0c26('0x37')]['includeAll']){_0x1f1504[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x32')][_0x0c26('0x48')](_0x1f1504);})[_0x0c26('0x26')](function(_0x1e40c4){_0xc0554f[_0x0c26('0x49')]=_0x1e40c4;return _0xc0554f;})['then'](respondWithFilteredResult(_0x1b40b5,_0x1f1504))[_0x0c26('0x4a')](handleError(_0x1b40b5,null));};exports[_0x0c26('0x4b')]=function(_0x4267a9,_0x9fd0d7){var _0x3acecf={'raw':![],'where':{'id':_0x4267a9['params']['id']},'include':[{'model':db[_0x0c26('0x2f')],'as':_0x0c26('0x30')}]},_0x31263e={};_0x31263e[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x32')]['rawAttributes']);_0x31263e['query']=_[_0x0c26('0x38')](_0x4267a9[_0x0c26('0x37')]);_0x31263e[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x31263e[_0x0c26('0x3b')],_0x31263e[_0x0c26('0x37')]);_0x3acecf[_0x0c26('0x3c')]=_['intersection'](_0x31263e[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x4267a9[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x3acecf[_0x0c26('0x3c')]=_0x3acecf[_0x0c26('0x3c')]['length']?_0x3acecf[_0x0c26('0x3c')]:_0x31263e['model'];if(_0x4267a9[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x3acecf['include']=[{'all':!![]}];}_0x3acecf=_['merge']({},_0x3acecf,_0x4267a9[_0x0c26('0x4d')]);return db['ChatWebsite']['find'](_0x3acecf)['then'](handleEntityNotFound(_0x9fd0d7,null))[_0x0c26('0x26')](respondWithResult(_0x9fd0d7,null))['catch'](handleError(_0x9fd0d7,null));};exports[_0x0c26('0x4e')]=function(_0xe8f5f,_0x41ca7c){return db['ChatWebsite'][_0x0c26('0x4e')](_0xe8f5f[_0x0c26('0x4f')],{})[_0x0c26('0x26')](function(_0xa11e06){var _0x295676=_0xe8f5f['user'][_0x0c26('0x27')]({'plain':!![]});if(!_0x295676)throw new Error(_0x0c26('0x50'));if(_0x295676[_0x0c26('0x51')]===_0x0c26('0x52')){var _0x58f09b=_0xa11e06['get']({'plain':!![]});var _0x215a11=_0x0c26('0x28');return db[_0x0c26('0x53')][_0x0c26('0x54')]({'where':{'name':_0x215a11,'userProfileId':_0x295676[_0x0c26('0x55')]},'raw':!![]})[_0x0c26('0x26')](function(_0x18072b){if(_0x18072b&&_0x18072b[_0x0c26('0x56')]===0x0){return db['UserProfileResource'][_0x0c26('0x4e')]({'name':_0x58f09b[_0x0c26('0x36')],'resourceId':_0x58f09b['id'],'type':_0x18072b['name'],'sectionId':_0x18072b['id']},{})[_0x0c26('0x26')](function(){return _0xa11e06;});}else{return _0xa11e06;}})[_0x0c26('0x4a')](function(_0x3700c9){logger[_0x0c26('0x19')](_0x0c26('0x57'),_0x3700c9);throw _0x3700c9;});}return _0xa11e06;})[_0x0c26('0x26')](respondWithResult(_0x41ca7c,0xc9))[_0x0c26('0x4a')](handleError(_0x41ca7c,null));};exports[_0x0c26('0x25')]=function(_0x3a484e,_0x4fab7c){if(_0x3a484e['body']['id']){delete _0x3a484e[_0x0c26('0x4f')]['id'];}return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x3a484e[_0x0c26('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x0c26('0x30')}]})[_0x0c26('0x26')](handleEntityNotFound(_0x4fab7c,null))[_0x0c26('0x26')](saveUpdates(_0x3a484e[_0x0c26('0x4f')],null))['then'](respondWithResult(_0x4fab7c,null))[_0x0c26('0x4a')](handleError(_0x4fab7c,null));};exports[_0x0c26('0x2a')]=function(_0x5ef160,_0x32abe1){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x5ef160['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x32abe1,null))['then'](removeEntity(_0x32abe1,null))[_0x0c26('0x4a')](handleError(_0x32abe1,null));};exports[_0x0c26('0x59')]=function(_0x34aae8,_0x52d4dd){return db[_0x0c26('0x32')][_0x0c26('0x59')]()[_0x0c26('0x26')](respondWithResult(_0x52d4dd,null))[_0x0c26('0x4a')](handleError(_0x52d4dd,null));};exports[_0x0c26('0x5a')]=function(_0x47ba7d,_0x4b8a2b){if(_0x47ba7d[_0x0c26('0x4f')]['id']){delete _0x47ba7d['body']['id'];}return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x47ba7d[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4b8a2b,null))['then'](function(_0x17941c){if(_0x17941c){_0x47ba7d[_0x0c26('0x4f')][_0x0c26('0x5b')]=_0x17941c['id'];return db[_0x0c26('0x5c')][_0x0c26('0x4e')](_0x47ba7d['body']);}})[_0x0c26('0x26')](respondWithResult(_0x4b8a2b,null))[_0x0c26('0x4a')](handleError(_0x4b8a2b,null));};exports[_0x0c26('0x5d')]=function(_0xb4a879,_0x8fe4e9){var _0x2099e1={'raw':![],'where':{}};var _0x100d7f={};var _0x31d8c1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0c26('0x5e')]({'where':{'id':_0xb4a879[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x8fe4e9,null))['then'](function(_0x223e2c){if(_0x223e2c){_0x100d7f[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x5c')][_0x0c26('0x5f')]);_0x100d7f[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0xb4a879['query']);_0x100d7f['filters']=_[_0x0c26('0x3a')](_0x100d7f[_0x0c26('0x3b')],_0x100d7f['query']);_0x2099e1['attributes']=_[_0x0c26('0x3a')](_0x100d7f[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0xb4a879[_0x0c26('0x37')]['fields']));_0x2099e1[_0x0c26('0x3c')]=_0x2099e1[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x2099e1['attributes']:_0x100d7f['model'];if(!_0xb4a879[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x2099e1[_0x0c26('0x20')]=qs['limit'](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x20')]);_0x2099e1[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x2099e1[_0x0c26('0x60')]=qs['sort'](_0xb4a879[_0x0c26('0x37')][_0x0c26('0x41')]);_0x2099e1[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0xb4a879[_0x0c26('0x37')],_0x100d7f[_0x0c26('0x39')]));_0x2099e1[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x223e2c['id'];if(_0xb4a879[_0x0c26('0x37')][_0x0c26('0x44')]){_0x2099e1[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x2099e1[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x2099e1[_0x0c26('0x3c')],function(_0xcf7411){var _0x42d069={};_0x42d069[_0xcf7411]={'$like':'%'+_0xb4a879[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x42d069;})});}_0x2099e1=_['merge']({},_0x2099e1,_0xb4a879[_0x0c26('0x4d')]);return db[_0x0c26('0x5c')][_0x0c26('0x21')]({'where':_0x2099e1[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x43a566){_0x31d8c1[_0x0c26('0x21')]=_0x43a566;if(_0xb4a879[_0x0c26('0x37')]['includeAll']){_0x2099e1[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x5c')][_0x0c26('0x48')](_0x2099e1);})[_0x0c26('0x26')](function(_0x5dbac9){_0x31d8c1[_0x0c26('0x49')]=_0x5dbac9;return _0x31d8c1;});}})['then'](respondWithFilteredResult(_0x8fe4e9,_0x2099e1))[_0x0c26('0x4a')](handleError(_0x8fe4e9,null));};exports[_0x0c26('0x61')]=function(_0x36a3f1,_0x35fe10){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x36a3f1['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x35fe10,null))[_0x0c26('0x26')](function(_0x5381f1){if(_0x5381f1){return _0x5381f1['removeDispositions'](_0x36a3f1[_0x0c26('0x37')]['ids']);}})[_0x0c26('0x26')](respondWithStatusCode(_0x35fe10,null))[_0x0c26('0x4a')](handleError(_0x35fe10,null));};exports[_0x0c26('0x62')]=function(_0x3a351a,_0x4bb6bf){if(_0x3a351a['body']['id']){delete _0x3a351a[_0x0c26('0x4f')]['id'];}return db[_0x0c26('0x32')]['find']({'where':{'id':_0x3a351a[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4bb6bf,null))[_0x0c26('0x26')](function(_0x598078){if(_0x598078){_0x3a351a['body'][_0x0c26('0x5b')]=_0x598078['id'];return db[_0x0c26('0x63')][_0x0c26('0x4e')](_0x3a351a[_0x0c26('0x4f')]);}})[_0x0c26('0x26')](respondWithResult(_0x4bb6bf,null))[_0x0c26('0x4a')](handleError(_0x4bb6bf,null));};exports[_0x0c26('0x64')]=function(_0x5eeed4,_0x2803f7){var _0x30c720={'raw':![],'where':{}};var _0x5bb02f={};var _0x35d731={'count':0x0,'rows':[]};return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x5eeed4[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x2803f7,null))[_0x0c26('0x26')](function(_0x326ebf){if(_0x326ebf){_0x5bb02f[_0x0c26('0x3b')]=_['keys'](db[_0x0c26('0x63')]['rawAttributes']);_0x5bb02f[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x5eeed4[_0x0c26('0x37')]);_0x5bb02f['filters']=_[_0x0c26('0x3a')](_0x5bb02f['model'],_0x5bb02f[_0x0c26('0x37')]);_0x30c720[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x5bb02f[_0x0c26('0x3b')],qs['fields'](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x30c720[_0x0c26('0x3c')]=_0x30c720[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x30c720['attributes']:_0x5bb02f[_0x0c26('0x3b')];if(!_0x5eeed4[_0x0c26('0x37')]['hasOwnProperty'](_0x0c26('0x40'))){_0x30c720[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x5eeed4['query']['limit']);_0x30c720[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x30c720['order']=qs[_0x0c26('0x41')](_0x5eeed4[_0x0c26('0x37')][_0x0c26('0x41')]);_0x30c720[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x5eeed4[_0x0c26('0x37')],_0x5bb02f['filters']));_0x30c720['where'][_0x0c26('0x5b')]=_0x326ebf['id'];if(_0x5eeed4[_0x0c26('0x37')]['filter']){_0x30c720[_0x0c26('0x42')]=_['merge'](_0x30c720['where'],{'$or':_['map'](_0x30c720[_0x0c26('0x3c')],function(_0xf1a82b){var _0x511bfb={};_0x511bfb[_0xf1a82b]={'$like':'%'+_0x5eeed4['query'][_0x0c26('0x44')]+'%'};return _0x511bfb;})});}_0x30c720=_[_0x0c26('0x45')]({},_0x30c720,_0x5eeed4[_0x0c26('0x4d')]);return db[_0x0c26('0x63')][_0x0c26('0x21')]({'where':_0x30c720[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x2d05eb){_0x35d731['count']=_0x2d05eb;if(_0x5eeed4['query'][_0x0c26('0x4c')]){_0x30c720[_0x0c26('0x47')]=[{'all':!![]}];}return db[_0x0c26('0x63')][_0x0c26('0x48')](_0x30c720);})[_0x0c26('0x26')](function(_0x28451f){_0x35d731[_0x0c26('0x49')]=_0x28451f;return _0x35d731;});}})[_0x0c26('0x26')](respondWithFilteredResult(_0x2803f7,_0x30c720))[_0x0c26('0x4a')](handleError(_0x2803f7,null));};exports[_0x0c26('0x65')]=function(_0x427908,_0x21c2a1){return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x427908[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x21c2a1,null))[_0x0c26('0x26')](function(_0x355203){if(_0x355203){return _0x355203[_0x0c26('0x65')](_0x427908[_0x0c26('0x37')][_0x0c26('0x66')]);}})['then'](respondWithStatusCode(_0x21c2a1,null))[_0x0c26('0x4a')](handleError(_0x21c2a1,null));};exports[_0x0c26('0x67')]=function(_0x27e1f2,_0x55ac4f){_0x27e1f2[_0x0c26('0x4f')][_0x0c26('0x68')]=_0x27e1f2['file'][_0x0c26('0x69')];return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x27e1f2[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x55ac4f,null))['then'](saveUpdates(_0x27e1f2[_0x0c26('0x4f')],null))[_0x0c26('0x26')](respondWithResult(_0x55ac4f,null))[_0x0c26('0x4a')](handleError(_0x55ac4f,null));};exports[_0x0c26('0x6a')]=function(_0x470194,_0x5ea59e){_0x470194[_0x0c26('0x4f')][_0x0c26('0x6b')]=_0x470194[_0x0c26('0x6c')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x470194['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x5ea59e,null))['then'](saveUpdates(_0x470194[_0x0c26('0x4f')],null))[_0x0c26('0x26')](respondWithResult(_0x5ea59e,null))[_0x0c26('0x4a')](handleError(_0x5ea59e,null));};exports[_0x0c26('0x6d')]=function(_0x4ef3ea,_0x54baba){_0x4ef3ea['body'][_0x0c26('0x6e')]=_0x4ef3ea['file'][_0x0c26('0x69')];return db[_0x0c26('0x32')]['find']({'where':{'id':_0x4ef3ea[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x54baba,null))[_0x0c26('0x26')](saveUpdates(_0x4ef3ea[_0x0c26('0x4f')],null))['then'](respondWithResult(_0x54baba,null))[_0x0c26('0x4a')](handleError(_0x54baba,null));};exports[_0x0c26('0x6f')]=function(_0x3d4f22,_0x24f89b){_0x3d4f22[_0x0c26('0x4f')][_0x0c26('0x70')]=_0x3d4f22['file'][_0x0c26('0x69')];return db['ChatWebsite'][_0x0c26('0x54')]({'where':{'id':_0x3d4f22[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x24f89b,null))[_0x0c26('0x26')](saveUpdates(_0x3d4f22['body'],null))[_0x0c26('0x26')](respondWithResult(_0x24f89b,null))['catch'](handleError(_0x24f89b,null));};exports[_0x0c26('0x71')]=function(_0x3fce0d,_0x1963d7){var _0x1125ba=path[_0x0c26('0x72')](config['root'],_0x0c26('0x73'));var _0x5280d3={'where':{'id':_0x3fce0d[_0x0c26('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x282a84=![];return require(_0x0c26('0x74'))['getLicense']()[_0x0c26('0x26')](function(_0x451fd4){if(_0x451fd4){_0x282a84=_0x451fd4['custom'];}})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')](_0x5280d3);})['then'](handleEntityNotFound(_0x1963d7,null))[_0x0c26('0x26')](function(_0x1658cd){if(_0x1658cd){if(!_[_0x0c26('0x75')](_0x1658cd[_0x0c26('0x68')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x78'),_0x1658cd[_0x0c26('0x68')]))&&_0x282a84){_0x1125ba=path['join'](config[_0x0c26('0x77')],_0x0c26('0x78'),_0x1658cd[_0x0c26('0x68')]);}}return _0x1963d7['download'](_0x1125ba);}})[_0x0c26('0x4a')](handleError(_0x1963d7,null));};exports['getAvatar']=function(_0x267f14,_0x176335){var _0x5c0fd6=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4c4a58={'where':{'id':_0x267f14[_0x0c26('0x58')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0c26('0x54')](_0x4c4a58)[_0x0c26('0x26')](handleEntityNotFound(_0x176335,null))[_0x0c26('0x26')](function(_0x78c1c0){if(_0x78c1c0){if(!_[_0x0c26('0x75')](_0x78c1c0[_0x0c26('0x6b')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config['root'],_0x0c26('0x79'),_0x78c1c0[_0x0c26('0x6b')]))){_0x5c0fd6=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x78c1c0[_0x0c26('0x6b')]);}}return _0x176335[_0x0c26('0x7a')](_0x5c0fd6);}})[_0x0c26('0x4a')](handleError(_0x176335,null));};exports[_0x0c26('0x7b')]=function(_0x229a61,_0x306688){var _0x30a509=path[_0x0c26('0x72')](config[_0x0c26('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x4ecc63={'where':{'id':_0x229a61[_0x0c26('0x58')]['id']},'attributes':['id',_0x0c26('0x6e'),_0x0c26('0x7c')],'raw':!![]};return db[_0x0c26('0x32')][_0x0c26('0x54')](_0x4ecc63)['then'](handleEntityNotFound(_0x306688,null))[_0x0c26('0x26')](function(_0x5d3a30){if(_0x5d3a30){if(!_['isNil'](_0x5d3a30['customerAvatar'])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3a30[_0x0c26('0x6e')]))&&_0x5d3a30[_0x0c26('0x7c')]){_0x30a509=path[_0x0c26('0x72')](config[_0x0c26('0x77')],'server/files/images/avatars/',_0x5d3a30[_0x0c26('0x6e')]);}}return _0x306688[_0x0c26('0x7a')](_0x30a509);}})[_0x0c26('0x4a')](handleError(_0x306688,null));};exports[_0x0c26('0x7d')]=function(_0x177e21,_0x23226a){var _0x5318fa=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x7e'));var _0x117300={'where':{'id':_0x177e21[_0x0c26('0x58')]['id']},'attributes':['id',_0x0c26('0x70')],'raw':!![]};return db[_0x0c26('0x32')]['find'](_0x117300)[_0x0c26('0x26')](handleEntityNotFound(_0x23226a,null))[_0x0c26('0x26')](function(_0x5d3722){if(_0x5d3722){if(!_[_0x0c26('0x75')](_0x5d3722[_0x0c26('0x70')])){if(fs[_0x0c26('0x76')](path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3722['systemAvatar']))){_0x5318fa=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0x79'),_0x5d3722[_0x0c26('0x70')]);}}return _0x23226a[_0x0c26('0x7a')](_0x5318fa);}})[_0x0c26('0x4a')](handleError(_0x23226a,null));};exports[_0x0c26('0x7f')]=function(_0x39dee2,_0x1f71ea){var _0x457339=require('user-agent-parser');var _0x36bb36=new _0x457339();var _0x16e26c=_0x36bb36[_0x0c26('0x80')](_0x39dee2[_0x0c26('0x81')]['user-agent'])[_0x0c26('0x82')]();var _0x4b2237={'body':_0x39dee2[_0x0c26('0x4f')],'channel':_0x0c26('0x83')};var _0x16fbbf=[];var _0x3ee11b=[];var _0xc0fc0d={};var _0xb6295f=![];return db[_0x0c26('0x84')][_0x0c26('0x59')]()[_0x0c26('0x26')](function(_0x299e50){if(!_0x299e50){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x87'));}_0x16fbbf=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x299e50),[_0x0c26('0x89'),_0x0c26('0x8a')]);_0x3ee11b=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x299e50),[_0x0c26('0x89'),_0x0c26('0x8a'),_0x0c26('0x8b'),_0x0c26('0x8c')]);if(_0x39dee2['body']['id']){delete _0x39dee2[_0x0c26('0x4f')]['id'];}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')]['from'])){throw new db[(_0x0c26('0x85'))]['ValidationError'](_0x0c26('0x8d'));}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')]['body'])||_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x4f')]===''){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x8e'));}if(_[_0x0c26('0x75')](_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')])){throw new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x90')+_0x3ee11b);}if(!_[_0x0c26('0x91')](_0x3ee11b,_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ee11b);}_0xc0fc0d[_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x8f')]]=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0x92')];})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x39dee2['params']['id']},'include':[{'model':db[_0x0c26('0x93')],'as':'List','include':[{'model':db[_0x0c26('0x84')],'as':_0x0c26('0x94'),'where':_0xc0fc0d,'limit':0x1,'order':[[_0x0c26('0x8a'),'DESC']]}]},{'model':db[_0x0c26('0x95')],'as':_0x0c26('0x96')}]});})['then'](handleEntityNotFound(_0x1f71ea,null))[_0x0c26('0x26')](function(_0x117c69){if(_0x117c69&&_0x117c69[_0x0c26('0x97')]){_0x4b2237['account']=_0x117c69;_0x4b2237[_0x0c26('0x98')]=_0x117c69['Applications'];_0x4b2237['list']=_0x117c69[_0x0c26('0x97')];_0x4b2237[_0x0c26('0x98')]=_[_0x0c26('0x99')](_0x4b2237[_0x0c26('0x98')],[_0x0c26('0x9a')],[_0x0c26('0x9b')]);if(_0x4b2237['account'][_0x0c26('0x96')]){delete _0x4b2237[_0x0c26('0x9c')][_0x0c26('0x96')];}if(_0x4b2237['account'][_0x0c26('0x97')]&&_0x4b2237['account']['List'][_0x0c26('0x94')]['length']){return _0x4b2237['account'][_0x0c26('0x97')][_0x0c26('0x94')][0x0];}var _0x1e4f25=_['defaults'](_0x39dee2[_0x0c26('0x4f')],{'firstName':_0x39dee2[_0x0c26('0x4f')]['from'],'ListId':_0x117c69[_0x0c26('0x8c')]});_0x1e4f25[_0x39dee2[_0x0c26('0x4f')]['mapKey']]=_0x39dee2[_0x0c26('0x4f')]['from'];return db['CmContact'][_0x0c26('0x4e')](_0x1e4f25,{'fields':_0x16fbbf,'raw':!![]});}})[_0x0c26('0x26')](handleEntityNotFound(_0x1f71ea,null))[_0x0c26('0x26')](function(_0x221400){_0x4b2237[_0x0c26('0x9d')]=_0x221400;var _0x1c2684=_0x39dee2['body'][_0x0c26('0x9e')];if(_0x39dee2[_0x0c26('0x81')]['cf-connecting-ip']){_0x1c2684=_0x39dee2[_0x0c26('0x81')][_0x0c26('0x9f')];}else if(_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa0')]){_0x1c2684=_[_0x0c26('0xa1')](_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa0')][_0x0c26('0xa2')](','));}if(_0x221400){var _0x3205b0={'ContactId':_0x221400['id'],'ChatWebsiteId':_0x39dee2[_0x0c26('0x58')]['id'],'from':(_0x221400[_0x0c26('0xa3')]||'')+'\x20'+(_0x221400['lastName']||''),'customerIp':_0x1c2684,'customerPort':_0x39dee2[_0x0c26('0x81')][_0x0c26('0xa4')]?_0x39dee2[_0x0c26('0x81')]['x-real-port']:null,'referer':_0x39dee2['body'][_0x0c26('0xa5')],'browserName':_0x16e26c[_0x0c26('0xa6')][_0x0c26('0x36')]&&_0x16e26c['browser'][_0x0c26('0xa7')]?util[_0x0c26('0xa8')](_0x0c26('0xa9'),_0x16e26c[_0x0c26('0xa6')][_0x0c26('0x36')],_0x16e26c['browser'][_0x0c26('0xa7')]):'unknown','browserVersion':_0x16e26c[_0x0c26('0xa6')][_0x0c26('0xa7')]||_0x0c26('0xaa'),'osName':util[_0x0c26('0xa8')]('%s\x20%s',_0x16e26c['os'][_0x0c26('0x36')],_0x16e26c['os'][_0x0c26('0xa7')]),'osVersion':_0x16e26c['os']['version'],'deviceModel':_0x16e26c[_0x0c26('0xab')][_0x0c26('0x3b')]&&_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')]?util[_0x0c26('0xa8')](_0x0c26('0xad'),_0x16e26c[_0x0c26('0xab')][_0x0c26('0x3b')],_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')],_0x16e26c[_0x0c26('0xab')][_0x0c26('0x34')]):null,'deviceVendor':_0x16e26c[_0x0c26('0xab')][_0x0c26('0xac')],'deviceType':_0x16e26c[_0x0c26('0xab')][_0x0c26('0x34')],'formData':JSON['stringify'](_0x39dee2['body'])};var _0x1b6416={'ChatWebsiteId':_0x39dee2['params']['id'],'closed':![]};if(_0x39dee2[_0x0c26('0x4f')]['threadId']){_0x1b6416['threadId']=_0x39dee2[_0x0c26('0x4f')]['threadId'];return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':_0x1b6416})[_0x0c26('0x26')](function(_0x8711af){if(_0x8711af){return[_0x8711af,![]];}_0x3205b0[_0x0c26('0xaf')]=_0x39dee2[_0x0c26('0x4f')]['threadId'];_0x3205b0[_0x0c26('0xb0')]=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb0')];return db[_0x0c26('0xae')]['create'](_0x3205b0)[_0x0c26('0x26')](function(_0x1e85d0){return[_0x1e85d0,!![]];});});}_0x1b6416['ContactId']=_0x221400['id'];if(_0x39dee2['body'][_0x0c26('0xb1')]&&_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb1')]['id']){_0x1b6416['id']=_0x39dee2['body'][_0x0c26('0xb1')]['id'];return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':_0x1b6416})[_0x0c26('0x26')](function(_0x190a09){if(_0x190a09){return[_0x190a09,![]];}return db[_0x0c26('0xae')][_0x0c26('0x4e')](_0x3205b0)[_0x0c26('0x26')](function(_0x14ce8b){return[_0x14ce8b,!![]];});});}return db['ChatInteraction'][_0x0c26('0x4e')](_0x3205b0)[_0x0c26('0x26')](function(_0x523aa9){return[_0x523aa9,!![]];});}})['spread'](function(_0x55f829,_0x517eca){if(_0x55f829){_0xb6295f=_0x517eca;if(!_0x517eca){var _0x52f7d9={'from':(_0x4b2237[_0x0c26('0x9d')][_0x0c26('0xa3')]||'')+'\x20'+(_0x4b2237['contact'][_0x0c26('0xb2')]||'')};if(_0x39dee2[_0x0c26('0x4f')]['threadId']&&_0x39dee2['body'][_0x0c26('0xb3')]&&_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xaf')]!=_0x39dee2[_0x0c26('0x4f')]['messageId']){_0x52f7d9['threadId']=_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb3')];}return _0x55f829[_0x0c26('0x25')](_0x52f7d9);}else{return _0x55f829;}}})[_0x0c26('0x26')](function(_0x40adc5){_0x4b2237[_0x0c26('0xb1')]=_0x40adc5['get']({'plain':!![]});_0x4b2237[_0x0c26('0xb1')]['created']=_0xb6295f;if(_0x4b2237[_0x0c26('0xb1')][_0x0c26('0xb4')]){if(_0x4b2237[_0x0c26('0x9c')][_0x0c26('0xb5')]){_0x4b2237['applications']['push']({'id':0x0,'priority':_0x4b2237[_0x0c26('0x98')][_0x0c26('0x3e')]+0x1,'app':'close','appdata':_0x0c26('0xb6'),'interval':_0x0c26('0xb7')});}}return db['ChatMessage'][_0x0c26('0x4e')]({'body':_0x39dee2[_0x0c26('0x4f')]['body'],'ChatWebsiteId':_0x39dee2[_0x0c26('0x58')]['id'],'ChatInteractionId':_0x40adc5['id'],'direction':'in','ContactId':_0x4b2237[_0x0c26('0x9d')]['id'],'AttachmentId':_0x39dee2[_0x0c26('0x4f')][_0x0c26('0xb8')]});})[_0x0c26('0x26')](function(_0x28d1cb){_0x4b2237['message']=_0x28d1cb;if(_0x4b2237[_0x0c26('0xb1')]['UserId']){return db[_0x0c26('0xb9')][_0x0c26('0x54')]({'attributes':['id',_0x0c26('0x36')],'where':{'id':_0x4b2237[_0x0c26('0xb1')][_0x0c26('0xba')]}})[_0x0c26('0x26')](function(_0x33626a){if(_0x33626a){_0x4b2237[_0x0c26('0x98')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x33626a[_0x0c26('0x36')]+','+(_0x4b2237['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0c26('0xb7')});_0x4b2237[_0x0c26('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x0c26('0xbc'),_0x4b2237);});}return respondWithRpcPromise(_0x0c26('0xbd'),'startRouting',_0x4b2237);})[_0x0c26('0x26')](function(_0x55aecb){respondWithRpcPromise(_0x0c26('0xbe'),_0x0c26('0xbe'),{'event':_0x0c26('0x7f'),'message':_0x55aecb},client9002);return _0x55aecb;})[_0x0c26('0x26')](respondWithResult(_0x1f71ea,null))[_0x0c26('0x4a')](handleError(_0x1f71ea,null));};exports[_0x0c26('0xbf')]=function(_0x1558f1,_0x255410){var _0x589805,_0x26acb3,_0x673b45;var _0x587138=[];var _0x1940f4={};var _0xe978e9=_0x1558f1['files']||[];var _0x661702=[];var _0x1a7324;return db[_0x0c26('0x84')][_0x0c26('0x59')]()[_0x0c26('0x26')](function(_0x245987){if(!_0x245987){throw new db[(_0x0c26('0x85'))]['ValidationError'](_0x0c26('0x87'));}_0x587138=_[_0x0c26('0x88')](_[_0x0c26('0x38')](_0x245987),[_0x0c26('0x89'),_0x0c26('0x8a'),_0x0c26('0x8b'),_0x0c26('0x8c')]);if(_0x1558f1[_0x0c26('0x4f')]['id']){delete _0x1558f1[_0x0c26('0x4f')]['id'];}if(_[_0x0c26('0x75')](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x4f')])||_0x1558f1[_0x0c26('0x4f')]['body']===''){throw _0x255410['status'](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))](_0x0c26('0x8e')));}if(_[_0x0c26('0x75')](_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db['Sequelize'][(_0x0c26('0x86'))](_0x0c26('0xc1')+_0x587138));}if(!_[_0x0c26('0x91')](_0x587138,_0x1558f1['body'][_0x0c26('0xc0')])){throw _0x255410[_0x0c26('0x1d')](0x1f4)[_0x0c26('0x2d')](new db[(_0x0c26('0x85'))][(_0x0c26('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x587138));}_0x1940f4[_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')]]=_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')];})[_0x0c26('0x26')](function(){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x1558f1['params']['id']},'include':[{'model':db[_0x0c26('0x93')],'as':_0x0c26('0x97')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x255410,null))[_0x0c26('0x26')](function(_0x512f86){if(_0x512f86&&_0x512f86['List']){_0x26acb3=_0x512f86;var _0x52222e=_['defaults'](_0x1558f1[_0x0c26('0x4f')],{'firstName':_0x1558f1['body']['from'],'phone':_0x1558f1['body'][_0x0c26('0x92')],'ListId':_0x512f86[_0x0c26('0x8c')]});_0x52222e[_0x1558f1[_0x0c26('0x4f')][_0x0c26('0xc0')]]=_0x1558f1[_0x0c26('0x4f')][_0x0c26('0x92')];return db[_0x0c26('0x84')][_0x0c26('0xc2')]({'where':_0x1940f4,'defaults':_0x52222e});}})[_0x0c26('0xc3')](function(_0x3abbd6){if(_0x3abbd6){_0x673b45=_0x3abbd6;var _0x1ff7fc=fs[_0x0c26('0xc4')](path[_0x0c26('0x72')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x0c26('0xc5'));var _0x3e72d5=ejs['render'](_0x1ff7fc,{'body':_['toPairs'](_0x1558f1['body'][_0x0c26('0x4f')]),'bodyTitle':_0x26acb3[_0x0c26('0xc6')]});return db['ChatOfflineMessage'][_0x0c26('0x4e')]({'body':_0x3e72d5,'plainBody':htmlToText[_0x0c26('0xc7')](_0x3e72d5),'ContactId':_0x3abbd6['id'],'ChatWebsiteId':_0x26acb3['id']});}})[_0x0c26('0x26')](function(_0x10c145){_0x1a7324=_0x10c145;if(_0xe978e9[_0x0c26('0x3e')]){var _0x14b280=_0xe978e9[_0x0c26('0x31')](function(_0x1371ae){return{'name':_0x1371ae[_0x0c26('0xc8')],'basename':_0x1371ae[_0x0c26('0x69')],'type':_0x1371ae[_0x0c26('0xc9')],'ChatOfflineMessageId':_0x10c145['id']};});_0x661702=_0x14b280['map'](_0x331606=>{var _0x4a2c11={'filename':_0x331606[_0x0c26('0x36')],'path':path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0xca'),_0x0c26('0xcb'),_0x0c26('0xcc'),_0x0c26('0xcd'),_0x331606[_0x0c26('0xce')])};return _0x4a2c11;});if(!_0x26acb3[_0x0c26('0xcf')]){return db[_0x0c26('0xd0')][_0x0c26('0xd1')](function(_0x281ba9){return db[_0x0c26('0xd2')][_0x0c26('0xd3')](_0x14b280,{'transaction':_0x281ba9});});}}})[_0x0c26('0x26')](function(){if(_0x1a7324){_0x589805=_0x1a7324;return db[_0x0c26('0xd4')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0c26('0xd5')],'as':_0x0c26('0xd6'),'raw':!![],'include':[{'model':db[_0x0c26('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x0c26('0x26')](function(_0x906384){if(_0x906384&&_0x906384[_0x0c26('0xd6')]&&_0x26acb3[_0x0c26('0xd8')]&&_0x26acb3[_0x0c26('0xd9')]){var _0x506ffd=_0x906384['getSmtpOptions']();return respondWithRpcPromise(_0x0c26('0xda'),'sendMail',{'account':_0x506ffd,'message':{'from':util[_0x0c26('0xa8')](_0x0c26('0xdb'),_0x906384['name'],_0x906384[_0x0c26('0xdc')]||_0x906384['Smtp'][_0x0c26('0x52')]),'to':_0x26acb3[_0x0c26('0xd9')],'subject':_0x26acb3['offlineMessageSubject'],'html':_0x589805[_0x0c26('0x4f')],'attachments':_0x661702}},client9003)[_0x0c26('0x26')](function(){return _0x589805;})[_0x0c26('0x4a')](function(_0x56de59){logger[_0x0c26('0x19')](_0x56de59);});}})[_0x0c26('0x26')](function(){if(_0x26acb3&&_0x26acb3['openNewInteraction']&&_0x26acb3[_0x0c26('0xdd')]){var _0x3812ce=[];if(_0xe978e9[_0x0c26('0x3e')]){_0x3812ce=_0xe978e9[_0x0c26('0x31')](function(_0x57d4a5){return{'name':_0x57d4a5[_0x0c26('0xc8')],'basename':_0x57d4a5['filename'],'type':_0x57d4a5[_0x0c26('0xc9')],'ChatOfflineMessageId':_0x1a7324['id']};});}var _0xd99ea6;if(!_[_0x0c26('0x75')](_0x26acb3[_0x0c26('0xde')])){var _0x56b257=_[_0x0c26('0x31')](_0x1558f1[_0x0c26('0x4f')],function(_0x35fa29){return _0x35fa29;});var _0x4aaa35=_[_0x0c26('0xdf')](_0x56b257)[0x0];var _0xee14b6=_[_0x0c26('0xe0')](_0x4aaa35,function(_0xb8f952){return _0xb8f952;});_0xd99ea6=_0xee14b6[0x1][_0x26acb3[_0x0c26('0xde')]];}var _0x2fda26={'from':_0x673b45[_0x0c26('0xdc')],'firstName':_0x673b45[_0x0c26('0xa3')],'lastName':_0x673b45[_0x0c26('0xb2')],'mapKey':_0x0c26('0xdc'),'message':{'from':_0x673b45['email'],'to':_0x26acb3['MailAccount'][_0x0c26('0xdc')],'cc':'','subject':_[_0x0c26('0x75')](_0xd99ea6)?_0x26acb3[_0x0c26('0xe1')]:_0xd99ea6,'messageId':'','sentAt':new Date(),'attach':_0x3812ce[_0x0c26('0x3e')],'attachments':_0x3812ce,'originChannel':_0x0c26('0xe2'),'ChatWebsiteId':_0x26acb3['id'],'ChatOfflineMessageId':_0x589805['id'],'originTo':_0x26acb3[_0x0c26('0xd4')][_0x0c26('0xdc')]},'body':_0x589805[_0x0c26('0x4f')]};var _0x2c3fc7={'account':{'id':_0x26acb3[_0x0c26('0xdd')]},'body':_0x2fda26,'log':_0x0c26('0xe3')};return respondWithRpcPromise(_0x0c26('0xe3'),_0x0c26('0xe4'),_0x2c3fc7,client9001)[_0x0c26('0x26')](function(){return _0x589805;})[_0x0c26('0x4a')](function(_0x4bd1be){logger[_0x0c26('0x19')](_0x4bd1be);});}return;})[_0x0c26('0x26')](function(){if(_0x589805){return _0x589805;}})['then'](respondWithResult(_0x255410,null))[_0x0c26('0x4a')](function(_0x4ac77e){logger[_0x0c26('0x19')](_0x0c26('0x4a'),_0x4ac77e);for(var _0x46f56b of _0xe978e9){var _0x30f7bf=path[_0x0c26('0x72')](config[_0x0c26('0x77')],_0x0c26('0xca'),_0x0c26('0xcb'),'attachments',_0x0c26('0xcd'),_0x46f56b['filename']);fs_extra['remove'](_0x30f7bf)['catch'](function(_0x5a27cd){logger[_0x0c26('0x19')](_0x0c26('0xe5'),_0x30f7bf,_0x5a27cd);});}});};exports['addInteraction']=function(_0x1db75b,_0x458b58){return db[_0x0c26('0xae')][_0x0c26('0x54')]({'where':{'id':_0x1db75b['params']['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x458b58,null))['then'](function(_0x4ec740){if(_0x4ec740){return _0x4ec740['addInteraction'](_0x1db75b[_0x0c26('0x4f')][_0x0c26('0x66')],_['omit'](_0x1db75b[_0x0c26('0x4f')],[_0x0c26('0x66'),'id'])||{});}})[_0x0c26('0x26')](respondWithResult(_0x458b58,null))['catch'](handleError(_0x458b58,null));};exports[_0x0c26('0xe6')]=function(_0x5b4fc1,_0x294948){var _0x4e089d={'raw':![],'where':{}};var _0x27b68d={};var _0x3493e6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0c26('0x5e')]({'where':{'id':_0x5b4fc1[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x294948,null))['then'](function(_0x11a39a){if(_0x11a39a){_0x27b68d[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0xae')]['rawAttributes']);_0x27b68d[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x5b4fc1[_0x0c26('0x37')]);_0x27b68d[_0x0c26('0x39')]=_['intersection'](_0x27b68d[_0x0c26('0x3b')],_0x27b68d[_0x0c26('0x37')]);_0x4e089d[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x27b68d['model'],qs['fields'](_0x5b4fc1['query']['fields']));_0x4e089d[_0x0c26('0x3c')]=_0x4e089d['attributes'][_0x0c26('0x3e')]?_0x4e089d[_0x0c26('0x3c')]:_0x27b68d[_0x0c26('0x3b')];if(!_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x4e089d[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x5b4fc1[_0x0c26('0x37')]['limit']);_0x4e089d[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x4e089d[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x41')]);_0x4e089d[_0x0c26('0x42')]=qs['filters'](_[_0x0c26('0x43')](_0x5b4fc1[_0x0c26('0x37')],_0x27b68d[_0x0c26('0x39')]));_0x4e089d[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x11a39a['id'];if(_0x5b4fc1['query']['filter']){_0x4e089d[_0x0c26('0x42')]=_['merge'](_0x4e089d[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x4e089d['attributes'],function(_0x324971){var _0x379537={};_0x379537[_0x324971]={'$like':'%'+_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x379537;})});}_0x4e089d=_[_0x0c26('0x45')]({},_0x4e089d,_0x5b4fc1[_0x0c26('0x4d')]);return db[_0x0c26('0xae')][_0x0c26('0x21')]({'where':_0x4e089d['where']})[_0x0c26('0x26')](function(_0x4a33f5){_0x3493e6['count']=_0x4a33f5;if(_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x4e089d[_0x0c26('0x47')]=[{'model':db[_0x0c26('0x84')],'as':_0x0c26('0xe7'),'required':![]},{'model':db[_0x0c26('0xb9')],'as':_0x0c26('0xe8'),'attributes':['name','fullname',_0x0c26('0xe9')],'required':![]},{'model':db[_0x0c26('0xea')],'as':'Tags','attributes':['id',_0x0c26('0x36'),'color'],'where':_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0xeb')]?{'id':_0x5b4fc1['query']['tag']}:undefined,'required':_0x5b4fc1[_0x0c26('0x37')][_0x0c26('0xeb')]?!![]:![]}];}return db['ChatInteraction'][_0x0c26('0x48')](_0x4e089d);})[_0x0c26('0x26')](function(_0x240bc7){_0x3493e6['rows']=_0x240bc7;return _0x3493e6;});}})['then'](respondWithFilteredResult(_0x294948,_0x4e089d))[_0x0c26('0x4a')](handleError(_0x294948,null));};function iftimePromise(_0x438aca,_0x28ede3){return respondWithRpcPromise('Command','getSnippet',{'command':_0x28ede3[_0x0c26('0xec')]?util[_0x0c26('0xa8')](_0x0c26('0xed'),_0x438aca[_0x0c26('0xee')],_0x28ede3['timezone']):util[_0x0c26('0xa8')](_0x0c26('0xef'),_0x438aca[_0x0c26('0xee')])},client9002)[_0x0c26('0x26')](function(_0x2871c1){var _0x103e49=_0x2871c1&&_0x2871c1[_0x0c26('0xf0')]('true')>=0x0?!![]:![];logger[_0x0c26('0x13')](_0x0c26('0xf1'),_0x28ede3['id'],_0x438aca['id'],_0x438aca[_0x0c26('0xee')],_0x103e49?_0x0c26('0xf2'):_0x0c26('0xf3'),_0x28ede3[_0x0c26('0xec')]?_0x28ede3[_0x0c26('0xec')]:_0x0c26('0xf4'));return _0x103e49;})[_0x0c26('0x4a')](function(_0x315c01){logger[_0x0c26('0x19')](_0x0c26('0xf1'),_0x28ede3['id'],_0x438aca['id'],_0x438aca[_0x0c26('0xee')],util[_0x0c26('0xf5')](_0x315c01,{'showHidden':![],'depth':null}),_0x28ede3['timezone']?_0x28ede3[_0x0c26('0xec')]:_0x0c26('0xf4'));return![];});}exports[_0x0c26('0xf6')]=function(_0x4302a7,_0x24534d){var _0x6f3c9d=0x0;var _0x112d15=0x0;var _0x51d8d2=![];var _0x2b4ca2;var _0x4959bd;return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x4302a7[_0x0c26('0x58')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x0c26('0xf7')],'as':_0x0c26('0xf8'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x0c26('0x26')](handleEntityNotFound(_0x24534d,null))[_0x0c26('0x26')](function(_0xad6339){if(_0xad6339){_0x2b4ca2=_0xad6339;return _0xad6339[_0x0c26('0xf9')]({'raw':!![]});}})[_0x0c26('0x26')](function(_0x5ad1a5){if(_0x2b4ca2){if(_0x5ad1a5){_0x4959bd=_0x5ad1a5;}}return require(_0x0c26('0x74'))['getLicense']();})[_0x0c26('0x26')](function(_0x37f0fb){if(_0x37f0fb){_0x112d15=_0x37f0fb[_0x0c26('0xfa')];_0x51d8d2=_0x37f0fb[_0x0c26('0xfb')];}})[_0x0c26('0x26')](function(){return db[_0x0c26('0xae')]['count']({'where':{'closed':![]}});})['then'](function(_0xff5854){_0x6f3c9d=_0xff5854;if(_0x112d15&&_0xff5854>_0x112d15){return db[_0x0c26('0xfc')][_0x0c26('0x5e')]({'where':{'id':0x1}})[_0x0c26('0x26')](function(_0x511f3c){if(_0x511f3c){_0x511f3c['increment'](_0x0c26('0xfd'));}});}})[_0x0c26('0x26')](function(){if(_0x2b4ca2[_0x0c26('0xf7')]&&_0x2b4ca2[_0x0c26('0xf7')][_0x0c26('0xf8')]){var _0x5c4a9e=[];for(var _0x3bb917=0x0;_0x3bb917<_0x2b4ca2['Interval'][_0x0c26('0xf8')]['length'];_0x3bb917++){var _0x57f5f4=_0x2b4ca2[_0x0c26('0xf7')][_0x0c26('0xf8')][_0x3bb917][_0x0c26('0x27')]({'plain':!![]});_0x5c4a9e['push'](iftimePromise(_0x57f5f4,_0x2b4ca2));}return BPromise[_0x0c26('0xfe')](_0x5c4a9e)['then'](function(_0x528fd0){return _['some'](_0x528fd0);});}else{return!![];}})[_0x0c26('0x26')](function(_0x55ef1b){var _0x5a4ddf=fs[_0x0c26('0xc4')](path[_0x0c26('0x72')](config['root'],_0x0c26('0xff')),'utf8');var _0x403408={'remote':_0x2b4ca2[_0x0c26('0x100')],'query':querystring['stringify'](_[_0x0c26('0x45')](_0x2b4ca2[_0x0c26('0x27')]({'plain':!![]}),{'customerIp':_0x4302a7[_0x0c26('0x81')]['x-forwarded-for']||_0x4302a7['headers']['x-real-ip']||_0x4302a7[_0x0c26('0x101')][_0x0c26('0x102')]||_0x4302a7['ip'],'referer':_0x4302a7[_0x0c26('0x81')]['referer'],'openedInteractions':_0x6f3c9d,'maxInteractions':_0x112d15,'virtual':_0x51d8d2[_0x0c26('0xfa')],'online':_0x55ef1b,'custom':_0x51d8d2}))[_0x0c26('0x103')](/'/g,'\x5c\x27')};_0x24534d[_0x0c26('0x2d')](ejs['render'](Mustache[_0x0c26('0x104')](_0x5a4ddf,_0x403408),{'proactiveActions':_0x4959bd,'alignment':_0x2b4ca2[_0x0c26('0x105')],'verticalAlignment':_0x2b4ca2[_0x0c26('0x106')],'div_color':_0x2b4ca2[_0x0c26('0x107')],'labelText':_0x2b4ca2['labelText'],'text_color':_0x2b4ca2[_0x0c26('0x108')],'text_button_color':_0x2b4ca2[_0x0c26('0x109')],'button_color':_0x2b4ca2[_0x0c26('0x10a')],'background_color':_0x2b4ca2['backgroundColor'],'hideWhenOffline':_0x2b4ca2[_0x0c26('0x10b')],'interval':_0x2b4ca2[_0x0c26('0x10c')]}));})[_0x0c26('0x4a')](handleError(_0x24534d,null));};exports[_0x0c26('0x10d')]=function(_0x517eae,_0x1e68ad){var _0x58dd99=_0x517eae[_0x0c26('0x58')]['id'];var _0x29883d=_0x517eae[_0x0c26('0x4f')];var _0x4d7e1a=0xc8;var _0x543fe1=null;return db[_0x0c26('0xd0')][_0x0c26('0xd1')]({'isolationLevel':db[_0x0c26('0xd0')]['Transaction'][_0x0c26('0x10e')][_0x0c26('0x10f')]},function(_0x2191b1){return db['ChatWebsite']['findOne']({'where':{'id':_0x58dd99},'transaction':_0x2191b1})[_0x0c26('0x26')](function(_0x431bdd){if(_0x431bdd){return db[_0x0c26('0x95')][_0x0c26('0x2a')]({'where':{'ChatWebsiteId':_0x58dd99},'transaction':_0x2191b1})['then'](function(){var _0x2bf222=_['map'](_0x29883d,function(_0x31c3d4){_0x31c3d4[_0x0c26('0x5b')]=_0x58dd99;return _0x31c3d4;});return db[_0x0c26('0x95')][_0x0c26('0xd3')](_0x2bf222,{'transaction':_0x2191b1});});}else{_0x4d7e1a=0x194;_0x543fe1=[];}});})[_0x0c26('0x26')](function(){if(_0x4d7e1a!==0x194){return db['ChatApplication'][_0x0c26('0x110')]({'where':{'ChatWebsiteId':_0x58dd99},'order':_0x0c26('0x9a')})[_0x0c26('0x26')](function(_0x1e6e98){_0x543fe1=_0x1e6e98;});}})[_0x0c26('0x4a')](function(_0x36e78e){_0x4d7e1a=0x1f4;logger[_0x0c26('0x19')](_0x36e78e[_0x0c26('0x2c')]);if(_0x36e78e['name']){delete _0x36e78e[_0x0c26('0x36')];}_0x543fe1=_0x36e78e;})['finally'](function(){if(_0x543fe1===null){_0x1e68ad[_0x0c26('0x1c')](_0x4d7e1a);}else{if(_0x4d7e1a===0x1f4){_0x1e68ad[_0x0c26('0x1d')](_0x4d7e1a)['send'](_0x543fe1);}else{_0x1e68ad[_0x0c26('0x1d')](_0x4d7e1a)[_0x0c26('0x1e')](_0x543fe1);}}});};exports[_0x0c26('0x111')]=function(_0x368153,_0x578d57){var _0x2db291={};var _0x5a2fad={};var _0x3494f1;var _0x125d7d;return db[_0x0c26('0x32')]['findOne']({'where':{'id':_0x368153[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x578d57,null))[_0x0c26('0x26')](function(_0x4ada80){if(_0x4ada80){_0x3494f1=_0x4ada80;_0x5a2fad[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x95')][_0x0c26('0x5f')]);_0x5a2fad[_0x0c26('0x37')]=_['keys'](_0x368153[_0x0c26('0x37')]);_0x5a2fad[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x5a2fad['model'],_0x5a2fad[_0x0c26('0x37')]);_0x2db291[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x5a2fad[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x368153[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x2db291[_0x0c26('0x3c')]=_0x2db291[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x2db291[_0x0c26('0x3c')]:_0x5a2fad[_0x0c26('0x3b')];_0x2db291[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x368153['query'][_0x0c26('0x41')]);_0x2db291['where']=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x368153[_0x0c26('0x37')],_0x5a2fad[_0x0c26('0x39')]));if(_0x368153['query']['filter']){_0x2db291['where']=_[_0x0c26('0x45')](_0x2db291[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x2db291[_0x0c26('0x3c')],function(_0x11d539){var _0x598b9f={};_0x598b9f[_0x11d539]={'$like':'%'+_0x368153[_0x0c26('0x37')][_0x0c26('0x44')]+'%'};return _0x598b9f;})});}_0x2db291=_[_0x0c26('0x45')]({},_0x2db291,_0x368153['options']);return _0x3494f1[_0x0c26('0x111')](_0x2db291);}})[_0x0c26('0x26')](function(_0x5edb4d){if(_0x5edb4d){_0x125d7d=_0x5edb4d[_0x0c26('0x3e')];if(!_0x368153[_0x0c26('0x37')][_0x0c26('0x3f')]('nolimit')){_0x2db291[_0x0c26('0x20')]=qs[_0x0c26('0x20')](_0x368153[_0x0c26('0x37')][_0x0c26('0x20')]);_0x2db291[_0x0c26('0x22')]=qs['offset'](_0x368153[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x3494f1[_0x0c26('0x111')](_0x2db291);}})['then'](function(_0x16d496){if(_0x16d496){return _0x16d496?{'count':_0x125d7d,'rows':_0x16d496}:null;}})['then'](respondWithResult(_0x578d57,null))[_0x0c26('0x4a')](handleError(_0x578d57,null));};exports[_0x0c26('0x112')]=function(_0x1d22d3,_0x1ac3c5){return db[_0x0c26('0x113')]['find']({'where':{'id':_0x1d22d3[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x1ac3c5,null))[_0x0c26('0x26')](function(_0x5882c1){if(_0x5882c1){return _0x5882c1[_0x0c26('0x112')](_0x1d22d3[_0x0c26('0x4f')][_0x0c26('0x66')],_[_0x0c26('0x114')](_0x1d22d3['body'],['ids','id'])||{});}})[_0x0c26('0x26')](respondWithResult(_0x1ac3c5,null))['catch'](handleError(_0x1ac3c5,null));};exports['getProactiveActions']=function(_0x1142dd,_0x4f8747){var _0x43b36c={};var _0x754183={};var _0x5f5974;var _0x3022c;return db[_0x0c26('0x32')]['findOne']({'where':{'id':_0x1142dd[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4f8747,null))[_0x0c26('0x26')](function(_0x20d568){if(_0x20d568){_0x5f5974=_0x20d568;_0x754183[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db['ChatProactiveAction'][_0x0c26('0x5f')]);_0x754183[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x1142dd['query']);_0x754183[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x754183[_0x0c26('0x3b')],_0x754183[_0x0c26('0x37')]);_0x43b36c['attributes']=_['intersection'](_0x754183[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x43b36c[_0x0c26('0x3c')]=_0x43b36c['attributes'][_0x0c26('0x3e')]?_0x43b36c[_0x0c26('0x3c')]:_0x754183[_0x0c26('0x3b')];_0x43b36c[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x41')]);_0x43b36c[_0x0c26('0x42')]=qs[_0x0c26('0x39')](_[_0x0c26('0x43')](_0x1142dd['query'],_0x754183['filters']));if(_0x1142dd[_0x0c26('0x37')][_0x0c26('0x44')]){_0x43b36c['where']=_[_0x0c26('0x45')](_0x43b36c['where'],{'$or':_[_0x0c26('0x31')](_0x43b36c['attributes'],function(_0x4ff5b9){var _0x88454e={};_0x88454e[_0x4ff5b9]={'$like':'%'+_0x1142dd['query']['filter']+'%'};return _0x88454e;})});}_0x43b36c=_[_0x0c26('0x45')]({},_0x43b36c,_0x1142dd[_0x0c26('0x4d')]);return _0x5f5974[_0x0c26('0xf9')](_0x43b36c);}})[_0x0c26('0x26')](function(_0x872dd0){if(_0x872dd0){_0x3022c=_0x872dd0['length'];if(!_0x1142dd[_0x0c26('0x37')][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x43b36c['limit']=qs[_0x0c26('0x20')](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x20')]);_0x43b36c[_0x0c26('0x22')]=qs['offset'](_0x1142dd[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x5f5974['getProactiveActions'](_0x43b36c);}})[_0x0c26('0x26')](function(_0x45da80){if(_0x45da80){return _0x45da80?{'count':_0x3022c,'rows':_0x45da80}:null;}})[_0x0c26('0x26')](respondWithResult(_0x4f8747,null))[_0x0c26('0x4a')](handleError(_0x4f8747,null));};exports[_0x0c26('0x115')]=function(_0x536f1c,_0x51fd51){var _0x65aad5=_0x536f1c[_0x0c26('0x37')][_0x0c26('0x116')]===_0x0c26('0x117')?_0x0c26('0x118'):_0x0c26('0x119');return db[_0x0c26('0x32')][_0x0c26('0x54')]({'attributes':['id',_0x65aad5],'where':{'id':_0x536f1c[_0x0c26('0x58')]['id']}})['then'](handleEntityNotFound(_0x51fd51,null))[_0x0c26('0x26')](function(_0x30c377){if(_0x30c377){var _0x1638ed=_0x30c377[_0x65aad5];var _0x3cc2ff=_0x1638ed&&_0x1638ed[_0x0c26('0x11a')]?_0x1638ed[_0x0c26('0x11a')]:[];_0x51fd51[_0x0c26('0x2d')]({'fromKey':_['isNil'](_0x1638ed['fromKey'])?undefined:_0x1638ed[_0x0c26('0x11b')],'count':_0x3cc2ff[_0x0c26('0x3e')],'rows':_0x3cc2ff});}})[_0x0c26('0x4a')](handleError(_0x51fd51,null));};exports[_0x0c26('0x11c')]=function(_0x2addb1,_0x4d382d){var _0x59d7fe={'raw':![],'where':{}};var _0x3843f6={};var _0x3db9c6={'count':0x0,'rows':[]};return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x2addb1[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x4d382d,null))[_0x0c26('0x26')](function(_0x12b24b){if(_0x12b24b){_0x3843f6[_0x0c26('0x3b')]=_[_0x0c26('0x38')](db[_0x0c26('0x11d')][_0x0c26('0x5f')]);_0x3843f6[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x2addb1[_0x0c26('0x37')]);_0x3843f6[_0x0c26('0x39')]=_[_0x0c26('0x3a')](_0x3843f6['model'],_0x3843f6[_0x0c26('0x37')]);_0x59d7fe[_0x0c26('0x3c')]=_[_0x0c26('0x3a')](_0x3843f6[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x2addb1[_0x0c26('0x37')]['fields']));_0x59d7fe[_0x0c26('0x3c')]=_0x59d7fe[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x59d7fe[_0x0c26('0x3c')]:_0x3843f6[_0x0c26('0x3b')];if(!_0x2addb1['query'][_0x0c26('0x3f')](_0x0c26('0x40'))){_0x59d7fe[_0x0c26('0x20')]=qs['limit'](_0x2addb1[_0x0c26('0x37')]['limit']);_0x59d7fe[_0x0c26('0x22')]=qs['offset'](_0x2addb1[_0x0c26('0x37')][_0x0c26('0x22')]);}_0x59d7fe['order']=qs[_0x0c26('0x41')](_0x2addb1[_0x0c26('0x37')]['sort']);_0x59d7fe['where']=qs[_0x0c26('0x39')](_['pick'](_0x2addb1[_0x0c26('0x37')],_0x3843f6[_0x0c26('0x39')]));_0x59d7fe[_0x0c26('0x42')][_0x0c26('0x5b')]=_0x12b24b['id'];if(_0x2addb1[_0x0c26('0x37')]['filter']){_0x59d7fe[_0x0c26('0x42')]=_[_0x0c26('0x45')](_0x59d7fe[_0x0c26('0x42')],{'$or':_[_0x0c26('0x31')](_0x59d7fe['attributes'],function(_0x18d991){var _0x581c2f={};_0x581c2f[_0x18d991]={'$like':'%'+_0x2addb1['query']['filter']+'%'};return _0x581c2f;})});}_0x59d7fe=_[_0x0c26('0x45')]({},_0x59d7fe,_0x2addb1['options']);return db[_0x0c26('0x11d')][_0x0c26('0x21')]({'where':_0x59d7fe[_0x0c26('0x42')]})[_0x0c26('0x26')](function(_0x16239c){_0x3db9c6[_0x0c26('0x21')]=_0x16239c;if(_0x2addb1[_0x0c26('0x37')][_0x0c26('0x4c')]){_0x59d7fe[_0x0c26('0x47')]=[{'all':!![]}];}else{_0x59d7fe[_0x0c26('0x47')]=[{'model':db[_0x0c26('0x84')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x0c26('0x11e'),'required':![]}];}return db[_0x0c26('0x11d')][_0x0c26('0x48')](_0x59d7fe);})[_0x0c26('0x26')](function(_0x2f6a06){_0x3db9c6[_0x0c26('0x49')]=_0x2f6a06;return _0x3db9c6;});}})[_0x0c26('0x26')](respondWithFilteredResult(_0x4d382d,_0x59d7fe))[_0x0c26('0x4a')](handleError(_0x4d382d,null));};exports[_0x0c26('0x11f')]=function(_0x4de05e,_0x5c8c19){return db[_0x0c26('0x32')]['find']({'where':{'id':_0x4de05e[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x5c8c19,null))['then'](function(_0x5086a6){if(_0x5086a6){return _0x5086a6['addAgents'](_0x4de05e['body'][_0x0c26('0x66')],_['omit'](_0x4de05e[_0x0c26('0x4f')],[_0x0c26('0x66'),'id'])||{})['spread'](function(_0x483a02){for(var _0x4a7f42=0x0;_0x4a7f42<_0x4de05e[_0x0c26('0x4f')][_0x0c26('0x66')][_0x0c26('0x3e')];_0x4a7f42+=0x1){socket[_0x0c26('0x120')](_0x0c26('0x121'),{'UserId':Number(_0x4de05e[_0x0c26('0x4f')][_0x0c26('0x66')][_0x4a7f42]),'ChatWebsiteId':Number(_0x4de05e[_0x0c26('0x58')]['id'])});}return _0x483a02;});}})['then'](respondWithResult(_0x5c8c19,null))[_0x0c26('0x4a')](handleError(_0x5c8c19,null));};exports[_0x0c26('0x122')]=function(_0x590e3f,_0x2f44d9){return db[_0x0c26('0x32')][_0x0c26('0x54')]({'where':{'id':_0x590e3f[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x2f44d9,null))['then'](function(_0x518cb9){if(_0x518cb9){return _0x518cb9[_0x0c26('0x122')](_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')])['then'](function(){if(_['isArray'](_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')])){for(var _0x3c41=0x0;_0x3c41<_0x590e3f['query']['ids'][_0x0c26('0x3e')];_0x3c41+=0x1){socket['emit'](_0x0c26('0x123'),{'UserId':Number(_0x590e3f['query'][_0x0c26('0x66')][_0x3c41]),'ChatWebsiteId':Number(_0x590e3f[_0x0c26('0x58')]['id'])});}}else{socket[_0x0c26('0x120')]('userChatWebsite:remove',{'UserId':Number(_0x590e3f[_0x0c26('0x37')][_0x0c26('0x66')]),'ChatWebsiteId':Number(_0x590e3f[_0x0c26('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f44d9,null))[_0x0c26('0x4a')](handleError(_0x2f44d9,null));};exports[_0x0c26('0x124')]=function(_0x312fee,_0x3bb9b7){var _0x344709={};var _0x35348c={};var _0x57cdc6;var _0x13f768;return db[_0x0c26('0x32')][_0x0c26('0x5e')]({'where':{'id':_0x312fee[_0x0c26('0x58')]['id']}})[_0x0c26('0x26')](handleEntityNotFound(_0x3bb9b7,null))['then'](function(_0xa3a47b){if(_0xa3a47b){_0x57cdc6=_0xa3a47b;_0x35348c[_0x0c26('0x3b')]=_['keys'](db['User'][_0x0c26('0x5f')]);_0x35348c[_0x0c26('0x37')]=_[_0x0c26('0x38')](_0x312fee['query']);_0x35348c['filters']=_['intersection'](_0x35348c[_0x0c26('0x3b')],_0x35348c[_0x0c26('0x37')]);_0x344709[_0x0c26('0x3c')]=_['intersection'](_0x35348c[_0x0c26('0x3b')],qs[_0x0c26('0x3d')](_0x312fee[_0x0c26('0x37')][_0x0c26('0x3d')]));_0x344709[_0x0c26('0x3c')]=_0x344709[_0x0c26('0x3c')][_0x0c26('0x3e')]?_0x344709[_0x0c26('0x3c')]:_0x35348c[_0x0c26('0x3b')];_0x344709[_0x0c26('0x60')]=qs[_0x0c26('0x41')](_0x312fee['query'][_0x0c26('0x41')]);_0x344709[_0x0c26('0x42')]=qs['filters'](_['pick'](_0x312fee[_0x0c26('0x37')],_0x35348c[_0x0c26('0x39')]));if(_0x312fee[_0x0c26('0x37')][_0x0c26('0x44')]){_0x344709[_0x0c26('0x42')]=_['merge'](_0x344709[_0x0c26('0x42')],{'$or':_['map'](_0x344709['attributes'],function(_0x3c10d5){var _0x47bc2a={};_0x47bc2a[_0x3c10d5]={'$like':'%'+_0x312fee['query'][_0x0c26('0x44')]+'%'};return _0x47bc2a;})});}_0x344709=_[_0x0c26('0x45')]({},_0x344709,_0x312fee[_0x0c26('0x4d')]);return _0x57cdc6[_0x0c26('0x124')](_0x344709);}})[_0x0c26('0x26')](function(_0x285151){if(_0x285151){_0x13f768=_0x285151[_0x0c26('0x3e')];if(!_0x312fee[_0x0c26('0x37')][_0x0c26('0x3f')]('nolimit')){_0x344709[_0x0c26('0x20')]=qs['limit'](_0x312fee[_0x0c26('0x37')][_0x0c26('0x20')]);_0x344709[_0x0c26('0x22')]=qs[_0x0c26('0x22')](_0x312fee[_0x0c26('0x37')][_0x0c26('0x22')]);}return _0x57cdc6[_0x0c26('0x124')](_0x344709);}})['then'](function(_0x222683){if(_0x222683){return _0x222683?{'count':_0x13f768,'rows':_0x222683}:null;}})[_0x0c26('0x26')](respondWithResult(_0x3bb9b7,null))[_0x0c26('0x4a')](handleError(_0x3bb9b7,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e1c8e1d..84a080d 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 _0x34aa=['events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x34aa,0x171));var _0xa34a=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x34aa[_0x52ea08];return _0x28d546;};'use strict';var EventEmitter=require(_0xa34a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa34a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa34a('0x2')](0x0);var events={'afterCreate':_0xa34a('0x3'),'afterUpdate':_0xa34a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d7a4f){return function(_0x30f3a2,_0x284561,_0x1db413){ChatWebsiteEvents[_0xa34a('0x5')](_0x1d7a4f+':'+_0x30f3a2['id'],_0x30f3a2);ChatWebsiteEvents[_0xa34a('0x5')](_0x1d7a4f,_0x30f3a2);_0x1db413(null);};}for(var e in events){if(events[_0xa34a('0x6')](e)){var event=events[e];ChatWebsite[_0xa34a('0x7')](e,emitEvent(event));}}module[_0xa34a('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1e19=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3726a8,_0x47bbc1){var _0x4c6344=function(_0x5841ef){while(--_0x5841ef){_0x3726a8['push'](_0x3726a8['shift']());}};_0x4c6344(++_0x47bbc1);}(_0x1e19,0x1c9));var _0x91e1=function(_0x15dc91,_0x2109e5){_0x15dc91=_0x15dc91-0x0;var _0x3ea859=_0x1e19[_0x15dc91];return _0x3ea859;};'use strict';var EventEmitter=require(_0x91e1('0x0'));var ChatWebsite=require(_0x91e1('0x1'))['db'][_0x91e1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91e1('0x3')](0x0);var events={'afterCreate':_0x91e1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x561f69){return function(_0x5e4bdc,_0x169cdf,_0x2db427){ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69+':'+_0x5e4bdc['id'],_0x5e4bdc);ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69,_0x5e4bdc);_0x2db427(null);};}for(var e in events){if(events[_0x91e1('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x91e1('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 224ebc6..7193c61 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 _0xcee4=['bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','chat_websites','lodash','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcee4,0xcc));var _0x4cee=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcee4[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x4cee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4cee('0x1'));var moment=require(_0x4cee('0x2'));var BPromise=require(_0x4cee('0x3'));var rp=require(_0x4cee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cee('0x5'));var config=require('../../config/environment');var attributes=require(_0x4cee('0x6'));module[_0x4cee('0x7')]=function(_0x18e15a,_0x2ec812){return _0x18e15a['define']('ChatWebsite',attributes,{'tableName':_0x4cee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b2=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x38e919,_0xb59a62){var _0x35b6cb=function(_0x45999a){while(--_0x45999a){_0x38e919['push'](_0x38e919['shift']());}};_0x35b6cb(++_0xb59a62);}(_0xc9b2,0x1e6));var _0x2c9b=function(_0x25a6b9,_0x12f190){_0x25a6b9=_0x25a6b9-0x0;var _0x40333f=_0xc9b2[_0x25a6b9];return _0x40333f;};'use strict';var _=require(_0x2c9b('0x0'));var util=require(_0x2c9b('0x1'));var logger=require(_0x2c9b('0x2'))(_0x2c9b('0x3'));var moment=require(_0x2c9b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c9b('0x5'));var fs=require('fs');var path=require(_0x2c9b('0x6'));var rimraf=require('rimraf');var config=require(_0x2c9b('0x7'));var attributes=require(_0x2c9b('0x8'));module[_0x2c9b('0x9')]=function(_0x115bc5,_0x2579ed){return _0x115bc5[_0x2c9b('0xa')](_0x2c9b('0xb'),attributes,{'tableName':_0x2c9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 88b1320..8c87e5c 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 _0x87b7=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','error','code','ChatWebsite,\x20%s,\x20%s','message','info','request\x20sent','result','catch'];(function(_0x516c72,_0x5dda21){var _0xe1e4ff=function(_0x363c0f){while(--_0x363c0f){_0x516c72['push'](_0x516c72['shift']());}};_0xe1e4ff(++_0x5dda21);}(_0x87b7,0x90));var _0x787b=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x87b7[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x787b('0x0'));var util=require(_0x787b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x787b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x787b('0x3'))['db'];var utils=require(_0x787b('0x4'));var logger=require(_0x787b('0x5'))(_0x787b('0x6'));var config=require('../../config/environment');var jayson=require(_0x787b('0x7'));var client=jayson[_0x787b('0x8')][_0x787b('0x9')]({'port':0x232a});config[_0x787b('0xa')]=_[_0x787b('0xb')](config[_0x787b('0xa')],{'host':_0x787b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x787b('0xa')]));require('./chatWebsite.socket')[_0x787b('0xd')](socket);function respondWithRpcPromise(_0x4f3459,_0x4e215f,_0x589b49){return new BPromise(function(_0x2a0d37,_0x2f9e5f){return client[_0x787b('0xe')](_0x4f3459,_0x589b49)[_0x787b('0xf')](function(_0x573bb8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4e215f,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4e215f,'request\x20sent',JSON['stringify'](_0x573bb8));if(_0x573bb8[_0x787b('0x10')]){if(_0x573bb8[_0x787b('0x10')][_0x787b('0x11')]===0x1f4){logger[_0x787b('0x10')](_0x787b('0x12'),_0x4e215f,_0x573bb8[_0x787b('0x10')][_0x787b('0x13')]);return _0x2f9e5f(_0x573bb8[_0x787b('0x10')][_0x787b('0x13')]);}logger[_0x787b('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x4e215f,_0x573bb8[_0x787b('0x10')][_0x787b('0x13')]);return _0x2a0d37(_0x573bb8[_0x787b('0x10')]['message']);}else{logger[_0x787b('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4e215f,_0x787b('0x15'));_0x2a0d37(_0x573bb8[_0x787b('0x16')][_0x787b('0x13')]);}})[_0x787b('0x17')](function(_0x43d5dc){logger['error'](_0x787b('0x12'),_0x4e215f,_0x43d5dc);_0x2f9e5f(_0x43d5dc);});});} \ No newline at end of file +var _0xc11c=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x2bd215,_0x178ce1){var _0x84453=function(_0x247ecd){while(--_0x247ecd){_0x2bd215['push'](_0x2bd215['shift']());}};_0x84453(++_0x178ce1);}(_0xc11c,0x111));var _0xcc11=function(_0xec4677,_0x570c02){_0xec4677=_0xec4677-0x0;var _0x1e99ab=_0xc11c[_0xec4677];return _0x1e99ab;};'use strict';var _=require(_0xcc11('0x0'));var util=require(_0xcc11('0x1'));var moment=require(_0xcc11('0x2'));var BPromise=require(_0xcc11('0x3'));var rs=require(_0xcc11('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc11('0x5'));var logger=require(_0xcc11('0x6'))(_0xcc11('0x7'));var config=require(_0xcc11('0x8'));var jayson=require(_0xcc11('0x9'));var client=jayson['client'][_0xcc11('0xa')]({'port':0x232a});config[_0xcc11('0xb')]=_[_0xcc11('0xc')](config[_0xcc11('0xb')],{'host':_0xcc11('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc11('0xe'))[_0xcc11('0xf')](socket);function respondWithRpcPromise(_0x48318f,_0xcebebc,_0x2693c7){return new BPromise(function(_0x2d1598,_0x221c99){return client[_0xcc11('0x10')](_0x48318f,_0x2693c7)[_0xcc11('0x11')](function(_0x585656){logger[_0xcc11('0x12')](_0xcc11('0x13'),_0xcebebc,_0xcc11('0x14'));logger['debug'](_0xcc11('0x15'),_0xcebebc,_0xcc11('0x14'),JSON[_0xcc11('0x16')](_0x585656));if(_0x585656[_0xcc11('0x17')]){if(_0x585656[_0xcc11('0x17')][_0xcc11('0x18')]===0x1f4){logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x585656[_0xcc11('0x17')][_0xcc11('0x19')]);return _0x221c99(_0x585656[_0xcc11('0x17')][_0xcc11('0x19')]);}logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x585656[_0xcc11('0x17')]['message']);return _0x2d1598(_0x585656['error'][_0xcc11('0x19')]);}else{logger[_0xcc11('0x12')]('ChatWebsite,\x20%s,\x20%s',_0xcebebc,_0xcc11('0x14'));_0x2d1598(_0x585656[_0xcc11('0x1a')][_0xcc11('0x19')]);}})[_0xcc11('0x1b')](function(_0x5aa379){logger[_0xcc11('0x17')](_0xcc11('0x13'),_0xcebebc,_0x5aa379);_0x221c99(_0x5aa379);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a8d988e..8799548 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 _0x3559=['update','emit','removeListener','register','./chatWebsite.events','remove'];(function(_0x365b1d,_0x25492e){var _0x15a049=function(_0xd0e0a7){while(--_0xd0e0a7){_0x365b1d['push'](_0x365b1d['shift']());}};_0x15a049(++_0x25492e);}(_0x3559,0xf4));var _0x9355=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3559[_0x4565bf];return _0x5610ba;};'use strict';var ChatWebsiteEvents=require(_0x9355('0x0'));var events=['save',_0x9355('0x1'),_0x9355('0x2')];function createListener(_0x50679f,_0x5b0b57){return function(_0x20d9f9){_0x5b0b57[_0x9355('0x3')](_0x50679f,_0x20d9f9);};}function removeListener(_0x386784,_0x5d7a2b){return function(){ChatWebsiteEvents[_0x9355('0x4')](_0x386784,_0x5d7a2b);};}exports[_0x9355('0x5')]=function(_0x40f54d){for(var _0x172b96=0x0,_0x588fd4=events['length'];_0x172b96<_0x588fd4;_0x172b96++){var _0x5ea3d9=events[_0x172b96];var _0x4bffb7=createListener('chatWebsite:'+_0x5ea3d9,_0x40f54d);ChatWebsiteEvents['on'](_0x5ea3d9,_0x4bffb7);}}; \ No newline at end of file +var _0x36a9=['chatWebsite:','save','remove','update','emit','removeListener','register','length'];(function(_0x3bc329,_0x51de4e){var _0x372a3a=function(_0x5ac402){while(--_0x5ac402){_0x3bc329['push'](_0x3bc329['shift']());}};_0x372a3a(++_0x51de4e);}(_0x36a9,0x139));var _0x936a=function(_0x15f722,_0x181197){_0x15f722=_0x15f722-0x0;var _0x18554e=_0x36a9[_0x15f722];return _0x18554e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x936a('0x0'),_0x936a('0x1'),_0x936a('0x2')];function createListener(_0x5a511a,_0x2eaf7a){return function(_0x4676e2){_0x2eaf7a[_0x936a('0x3')](_0x5a511a,_0x4676e2);};}function removeListener(_0x5cd2e7,_0x1884a2){return function(){ChatWebsiteEvents[_0x936a('0x4')](_0x5cd2e7,_0x1884a2);};}exports[_0x936a('0x5')]=function(_0x3d02a6){for(var _0x174906=0x0,_0x22f5ff=events[_0x936a('0x6')];_0x174906<_0x22f5ff;_0x174906++){var _0x2c318e=events[_0x174906];var _0x200010=createListener(_0x936a('0x7')+_0x2c318e,_0x3d02a6);ChatWebsiteEvents['on'](_0x2c318e,_0x200010);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d24ec6e..67f7694 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 _0xb09d=['getAnswers','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','file','server/files/images/avatars/','single','addAvatar','format','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','extname','replace','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','delete','destroy','removeDispositions','path','express','Router','../../components/auth/service','./chatWebsite.controller','isAuthenticated','/describe','show','get','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x2d1efb,_0x59e856){var _0x143e89=function(_0x446e8b){while(--_0x446e8b){_0x2d1efb['push'](_0x2d1efb['shift']());}};_0x143e89(++_0x59e856);}(_0xb09d,0xb7));var _0xdb09=function(_0x5626ec,_0x274dd6){_0x5626ec=_0x5626ec-0x0;var _0x36cca2=_0xb09d[_0x5626ec];return _0x36cca2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb09('0x0'));var timeout=require('connect-timeout');var express=require(_0xdb09('0x1'));var router=express[_0xdb09('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdb09('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdb09('0x4'));router['get']('/',auth[_0xdb09('0x5')](),controller['index']);router['get'](_0xdb09('0x6'),auth[_0xdb09('0x5')](),controller['describe']);router['get']('/:id',auth[_0xdb09('0x5')](),controller[_0xdb09('0x7')]);router[_0xdb09('0x8')](_0xdb09('0x9'),auth[_0xdb09('0x5')](),controller[_0xdb09('0xa')]);router[_0xdb09('0x8')](_0xdb09('0xb'),auth['isAuthenticated'](),controller[_0xdb09('0xc')]);router['get']('/:id/logo',controller['getLogo']);router[_0xdb09('0x8')](_0xdb09('0xd'),controller['getAvatar']);router['get'](_0xdb09('0xe'),controller[_0xdb09('0xf')]);router[_0xdb09('0x8')](_0xdb09('0x10'),controller['getSystemAvatar']);router[_0xdb09('0x8')](_0xdb09('0x11'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x12')]);router[_0xdb09('0x8')](_0xdb09('0x13'),controller[_0xdb09('0x14')]);router['get'](_0xdb09('0x15'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x16')]);router['get']('/:id/proactive_actions',auth[_0xdb09('0x5')](),controller[_0xdb09('0x17')]);router['get'](_0xdb09('0x18'),controller[_0xdb09('0x19')]);router[_0xdb09('0x8')]('/:id/offline_messages',auth[_0xdb09('0x5')](),controller[_0xdb09('0x1a')]);router['get'](_0xdb09('0x1b'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x1c')]);router[_0xdb09('0x1d')]('/',auth[_0xdb09('0x5')](),controller[_0xdb09('0x1e')]);router[_0xdb09('0x1d')]('/:id/dispositions',auth[_0xdb09('0x5')](),controller[_0xdb09('0x1f')]);router[_0xdb09('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdb09('0x20')]);var upload=multer({'storage':multer[_0xdb09('0x21')]({'destination':function(_0x3abc9d,_0x2264e2,_0xd81b78){_0xd81b78(null,path[_0xdb09('0x22')](config[_0xdb09('0x23')],_0xdb09('0x24')));},'filename':function(_0x546fc5,_0x13f34d,_0x24bede){_0x24bede(null,util['format'](_0xdb09('0x25'),Date[_0xdb09('0x26')](),_0x13f34d[_0xdb09('0x27')]));}})});router['post'](_0xdb09('0x28'),upload['single'](_0xdb09('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xdb09('0x21')]({'destination':function(_0x216182,_0x3ce9cc,_0x2ef048){_0x2ef048(null,path[_0xdb09('0x22')](config[_0xdb09('0x23')],_0xdb09('0x2a')));},'filename':function(_0x1fff93,_0x218a3f,_0x4d09ca){_0x4d09ca(null,util['format'](_0xdb09('0x25'),Date[_0xdb09('0x26')](),_0x218a3f[_0xdb09('0x27')]));}})});router[_0xdb09('0x1d')]('/:id/avatar',upload[_0xdb09('0x2b')]('file'),controller[_0xdb09('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4014e2,_0xb62a4f,_0x1ebc1d){_0x1ebc1d(null,path['join'](config[_0xdb09('0x23')],'server/files/images/avatars/'));},'filename':function(_0x22c404,_0x5ec44e,_0x14aa26){_0x14aa26(null,util[_0xdb09('0x2d')](_0xdb09('0x25'),Date[_0xdb09('0x26')](),_0x5ec44e[_0xdb09('0x27')]));}})});router['post'](_0xdb09('0xe'),upload[_0xdb09('0x2b')](_0xdb09('0x29')),controller[_0xdb09('0x2e')]);var upload=multer({'storage':multer[_0xdb09('0x21')]({'destination':function(_0x5bd8af,_0x51a400,_0x1fb604){_0x1fb604(null,path['join'](config['root'],_0xdb09('0x2a')));},'filename':function(_0x291fec,_0x141574,_0xfe6915){_0xfe6915(null,util[_0xdb09('0x2d')](_0xdb09('0x25'),Date[_0xdb09('0x26')](),_0x141574[_0xdb09('0x27')]));}})});router['post'](_0xdb09('0x10'),upload['single'](_0xdb09('0x29')),controller[_0xdb09('0x2f')]);router[_0xdb09('0x1d')]('/:id/notify',controller[_0xdb09('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xdb09('0x21')]({'destination':function(_0x271a23,_0x2ec24c,_0x97b17a){const _0x288456=path['join'](config['root'],'server/files',_0xdb09('0x31'),_0xdb09('0x32'));fs_extra[_0xdb09('0x33')](_0x288456,function(){_0x97b17a(null,_0x288456);});},'filename':function(_0x3e1167,_0xf4c816,_0x4dc1c9){const _0x375762=_0xf4c816[_0xdb09('0x27')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x229281=path[_0xdb09('0x34')](_0x375762);const _0x556650=Date['now']()+'-'+_0x375762[_0xdb09('0x35')](_0x229281,'')+_0x229281;_0x4dc1c9(null,_0x556650);}})});router['post']('/:id/offline',offlineUploadMulter[_0xdb09('0x36')](),controller[_0xdb09('0x37')]);router[_0xdb09('0x1d')](_0xdb09('0x11'),auth['isAuthenticated'](),controller['addInteraction']);router['post']('/:id/applications',auth[_0xdb09('0x5')](),controller[_0xdb09('0x38')]);router[_0xdb09('0x1d')](_0xdb09('0x39'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x3a')]);router['post'](_0xdb09('0x1b'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x3b')]);router[_0xdb09('0x3c')](_0xdb09('0x3d'),auth[_0xdb09('0x5')](),controller['update']);router[_0xdb09('0x3e')](_0xdb09('0x3d'),auth['isAuthenticated'](),controller[_0xdb09('0x3f')]);router[_0xdb09('0x3e')](_0xdb09('0x9'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x40')]);router['delete'](_0xdb09('0xb'),auth[_0xdb09('0x5')](),controller['removeAnswers']);router[_0xdb09('0x3e')](_0xdb09('0x1b'),auth[_0xdb09('0x5')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9bc1=['removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','server/files/images/avatars/','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','destroy','delete'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x9bc1,0x1d1));var _0x19bc=function(_0x16cf22,_0x504218){_0x16cf22=_0x16cf22-0x0;var _0x113c09=_0x9bc1[_0x16cf22];return _0x113c09;};'use strict';var multer=require(_0x19bc('0x0'));var util=require('util');var path=require(_0x19bc('0x1'));var timeout=require(_0x19bc('0x2'));var express=require(_0x19bc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x19bc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x19bc('0x5'));var controller=require(_0x19bc('0x6'));router['get']('/',auth[_0x19bc('0x7')](),controller[_0x19bc('0x8')]);router[_0x19bc('0x9')](_0x19bc('0xa'),auth[_0x19bc('0x7')](),controller['describe']);router['get'](_0x19bc('0xb'),auth['isAuthenticated'](),controller[_0x19bc('0xc')]);router['get'](_0x19bc('0xd'),auth[_0x19bc('0x7')](),controller[_0x19bc('0xe')]);router[_0x19bc('0x9')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x10')]);router[_0x19bc('0x9')]('/:id/logo',controller[_0x19bc('0x11')]);router[_0x19bc('0x9')](_0x19bc('0x12'),controller['getAvatar']);router['get'](_0x19bc('0x13'),controller[_0x19bc('0x14')]);router[_0x19bc('0x9')](_0x19bc('0x15'),controller[_0x19bc('0x16')]);router[_0x19bc('0x9')]('/:id/interactions',auth[_0x19bc('0x7')](),controller[_0x19bc('0x17')]);router['get'](_0x19bc('0x18'),controller[_0x19bc('0x19')]);router[_0x19bc('0x9')]('/:id/applications',auth[_0x19bc('0x7')](),controller['getApplications']);router[_0x19bc('0x9')](_0x19bc('0x1a'),auth[_0x19bc('0x7')](),controller['getProactiveActions']);router['get'](_0x19bc('0x1b'),controller['getFields']);router[_0x19bc('0x9')](_0x19bc('0x1c'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x1d')]);router['get'](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x1f')]);router[_0x19bc('0x20')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x19bc('0xd'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x21')]);router[_0x19bc('0x20')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x22')]);var upload=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0x3d3d6b,_0x23acc1,_0x47be0c){_0x47be0c(null,path[_0x19bc('0x24')](config[_0x19bc('0x25')],'server/files/images/logos/'));},'filename':function(_0x2f5ee4,_0xd53f95,_0x4ff631){_0x4ff631(null,util[_0x19bc('0x26')](_0x19bc('0x27'),Date[_0x19bc('0x28')](),_0xd53f95[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')]('/:id/logo',upload[_0x19bc('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x223a2a,_0x3d3527,_0x223f78){_0x223f78(null,path['join'](config[_0x19bc('0x25')],_0x19bc('0x2b')));},'filename':function(_0x491d92,_0x33dd9c,_0x233348){_0x233348(null,util[_0x19bc('0x26')]('%s-%s',Date['now'](),_0x33dd9c[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')](_0x19bc('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0x23c52f,_0xca3cd6,_0x24f768){_0x24f768(null,path[_0x19bc('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x249ef9,_0x478c3a,_0x137b1a){_0x137b1a(null,util['format']('%s-%s',Date[_0x19bc('0x28')](),_0x478c3a[_0x19bc('0x29')]));}})});router[_0x19bc('0x20')]('/:id/customer_avatar',upload[_0x19bc('0x2a')](_0x19bc('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38cf95,_0x3b48d1,_0x138280){_0x138280(null,path[_0x19bc('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3407b5,_0x52db61,_0xa3c449){_0xa3c449(null,util[_0x19bc('0x26')](_0x19bc('0x27'),Date[_0x19bc('0x28')](),_0x52db61[_0x19bc('0x29')]));}})});router['post'](_0x19bc('0x15'),upload[_0x19bc('0x2a')](_0x19bc('0x2c')),controller[_0x19bc('0x2d')]);router[_0x19bc('0x20')](_0x19bc('0x2e'),controller[_0x19bc('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0x19bc('0x23')]({'destination':function(_0xba71a4,_0x32a3fd,_0x4112cc){const _0x3efd95=path[_0x19bc('0x24')](config[_0x19bc('0x25')],'server/files',_0x19bc('0x30'),_0x19bc('0x31'));fs_extra[_0x19bc('0x32')](_0x3efd95,function(){_0x4112cc(null,_0x3efd95);});},'filename':function(_0x13fb5a,_0x1c225e,_0x15461e){const _0x15f6db=_0x1c225e[_0x19bc('0x29')][_0x19bc('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x17b945=path[_0x19bc('0x34')](_0x15f6db);const _0x368499=Date[_0x19bc('0x28')]()+'-'+_0x15f6db[_0x19bc('0x33')](_0x17b945,'')+_0x17b945;_0x15461e(null,_0x368499);}})});router[_0x19bc('0x20')](_0x19bc('0x35'),offlineUploadMulter['any'](),controller[_0x19bc('0x36')]);router[_0x19bc('0x20')]('/:id/interactions',auth[_0x19bc('0x7')](),controller[_0x19bc('0x37')]);router['post'](_0x19bc('0x38'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x39')]);router['post'](_0x19bc('0x1a'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x19bc('0x20')](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3a')]);router[_0x19bc('0x3b')](_0x19bc('0xb'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3c')]);router['delete'](_0x19bc('0xb'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x3d')]);router[_0x19bc('0x3e')](_0x19bc('0xd'),auth['isAuthenticated'](),controller[_0x19bc('0x3f')]);router[_0x19bc('0x3e')](_0x19bc('0xf'),auth[_0x19bc('0x7')](),controller[_0x19bc('0x40')]);router[_0x19bc('0x3e')](_0x19bc('0x1e'),auth[_0x19bc('0x7')](),controller['removeAgents']);module[_0x19bc('0x41')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 31eacee..1ad7a6f 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac80=['app','get','expressEndpoint','/client-logs','use','isAuthenticated','../config/environment','Router','env','production'];(function(_0x367f6b,_0x5018ff){var _0x3b4dd3=function(_0x24e0d0){while(--_0x24e0d0){_0x367f6b['push'](_0x367f6b['shift']());}};_0x3b4dd3(++_0x5018ff);}(_0xac80,0x74));var _0x0ac8=function(_0x3f3c3c,_0x49fe3b){_0x3f3c3c=_0x3f3c3c-0x0;var _0xa71e80=_0xac80[_0x3f3c3c];return _0xa71e80;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x0ac8('0x0'));var router=express[_0x0ac8('0x1')]();var isProduction=config[_0x0ac8('0x2')]===_0x0ac8('0x3')||![];function clientSideLogs(_0x40cf4,_0x5f3e51,_0x65c758){var _0x312289=_0x40cf4[_0x0ac8('0x4')][_0x0ac8('0x5')]('client-side-logger');if(!_0x312289){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x0ac8('0x6')]({'uri':_0x0ac8('0x7'),'logger':_0x312289,'enableCors':!isProduction})(_0x40cf4,_0x5f3e51,_0x65c758);}router[_0x0ac8('0x8')](auth[_0x0ac8('0x9')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xfc14=['expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x37b903,_0x2b6c30){var _0x291da1=function(_0x283624){while(--_0x283624){_0x37b903['push'](_0x37b903['shift']());}};_0x291da1(++_0x2b6c30);}(_0xfc14,0x6c));var _0x4fc1=function(_0x32d709,_0x6baf73){_0x32d709=_0x32d709-0x0;var _0x42a8fc=_0xfc14[_0x32d709];return _0x42a8fc;};var beaverLogger=require(_0x4fc1('0x0'));var express=require(_0x4fc1('0x1'));var auth=require('../components/auth/service');var config=require(_0x4fc1('0x2'));var router=express['Router']();var isProduction=config[_0x4fc1('0x3')]===_0x4fc1('0x4')||![];function clientSideLogs(_0x73b4f9,_0x1af3f0,_0x299485){var _0x42954e=_0x73b4f9[_0x4fc1('0x5')][_0x4fc1('0x6')](_0x4fc1('0x7'));if(!_0x42954e){throw new Error(_0x4fc1('0x8'));}return beaverLogger[_0x4fc1('0x9')]({'uri':'/client-logs','logger':_0x42954e,'enableCors':!isProduction})(_0x73b4f9,_0x1af3f0,_0x299485);}router[_0x4fc1('0xa')](auth[_0x4fc1('0xb')](),clientSideLogs);module[_0x4fc1('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 81a4fcf..ce78aa1 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 _0xcd14=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365'];(function(_0x2edc94,_0x2ef48b){var _0x197824=function(_0x322040){while(--_0x322040){_0x2edc94['push'](_0x2edc94['shift']());}};_0x197824(++_0x2ef48b);}(_0xcd14,0x104));var _0x4cd1=function(_0x212f53,_0x58e075){_0x212f53=_0x212f53-0x0;var _0x3d4e6d=_0xcd14[_0x212f53];return _0x3d4e6d;};'use strict';var Sequelize=require(_0x4cd1('0x0'));module[_0x4cd1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4cd1('0x2')](_0x4cd1('0x3'),'Google',_0x4cd1('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4cd1('0x2')](_0x4cd1('0x5'),_0x4cd1('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x4cd1('0x7')},'data2':{'type':Sequelize[_0x4cd1('0x8')],'comment':_0x4cd1('0x9')},'data3':{'type':Sequelize[_0x4cd1('0x8')],'comment':_0x4cd1('0xa')},'data4':{'type':Sequelize[_0x4cd1('0x8')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x4cd1('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x4cd1('0xb')],'comment':_0x4cd1('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x4cd1('0xd')}}; \ No newline at end of file +var _0xdf5e=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','Google'];(function(_0x82895,_0x459f3c){var _0x547316=function(_0x510429){while(--_0x510429){_0x82895['push'](_0x82895['shift']());}};_0x547316(++_0x459f3c);}(_0xdf5e,0x130));var _0xedf5=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xdf5e[_0x43fdf8];return _0x1160c6;};'use strict';var Sequelize=require(_0xedf5('0x0'));module[_0xedf5('0x1')]={'name':{'type':Sequelize[_0xedf5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xedf5('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xedf5('0x4')](_0xedf5('0x5'),_0xedf5('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xedf5('0x7')},'data2':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0x8')},'data3':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0x9')},'data4':{'type':Sequelize[_0xedf5('0x2')],'comment':_0xedf5('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xedf5('0xb')},'data6':{'type':Sequelize[_0xedf5('0xc')],'comment':_0xedf5('0xd')},'data7':{'type':Sequelize[_0xedf5('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index dc8c00d..f33c401 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 _0x35e9=['Content-Range','update','destroy','then','error','stack','name','send','padEnd','index','CloudProvider','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','map','service','data3','catch','show','params','rawAttributes','find','decryptString','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','join','MicrosoftAzure','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','from','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x29e327,_0x2b6ea9){var _0x3dac9e=function(_0x5c0e02){while(--_0x5c0e02){_0x29e327['push'](_0x29e327['shift']());}};_0x3dac9e(++_0x2b6ea9);}(_0x35e9,0x1da));var _0x935e=function(_0x34d07e,_0xfa71e9){_0x34d07e=_0x34d07e-0x0;var _0x1d9e2=_0x35e9[_0x34d07e];return _0x1d9e2;};'use strict';var _=require(_0x935e('0x0'));var Redis=require(_0x935e('0x1'));var qs=require(_0x935e('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x935e('0x3'));var logger=require(_0x935e('0x4'))(_0x935e('0x5'));var db=require(_0x935e('0x6'))['db'];var oauth=require(_0x935e('0x7'));config[_0x935e('0x8')]=_[_0x935e('0x9')](config[_0x935e('0x8')],{'host':_0x935e('0xa'),'port':0x18eb});var socket=require(_0x935e('0xb'))(new Redis(config['redis']));var redis=new Redis(config[_0x935e('0x8')]);function respondWithStatusCode(_0x2c71d0,_0x5a29d9){_0x5a29d9=_0x5a29d9||0xcc;return function(_0x454848){if(_0x454848){return _0x2c71d0[_0x935e('0xc')](_0x5a29d9);}return _0x2c71d0[_0x935e('0xd')](_0x5a29d9)[_0x935e('0xe')]();};}function respondWithResult(_0x531451,_0xefbf84){_0xefbf84=_0xefbf84||0xc8;return function(_0x355a8f){if(_0x355a8f){return _0x531451[_0x935e('0xd')](_0xefbf84)[_0x935e('0xf')](_0x355a8f);}};}function respondWithFilteredResult(_0x4706fc,_0x3da5fa){return function(_0x11a78c){if(_0x11a78c){var _0x1c443f=typeof _0x3da5fa['offset']===_0x935e('0x10')&&typeof _0x3da5fa[_0x935e('0x11')]===_0x935e('0x10');var _0x2bc309=_0x11a78c[_0x935e('0x12')];var _0x155b85=_0x1c443f?0x0:_0x3da5fa[_0x935e('0x13')];var _0x29fd53=_0x1c443f?_0x11a78c[_0x935e('0x12')]:_0x3da5fa[_0x935e('0x13')]+_0x3da5fa[_0x935e('0x11')];var _0x474bad;if(_0x29fd53>=_0x2bc309){_0x29fd53=_0x2bc309;_0x474bad=0xc8;}else{_0x474bad=0xce;}_0x4706fc['status'](_0x474bad);return _0x4706fc[_0x935e('0x14')](_0x935e('0x15'),_0x155b85+'-'+_0x29fd53+'/'+_0x2bc309)[_0x935e('0xf')](_0x11a78c);}return null;};}function saveUpdates(_0x41def9){return function(_0x54295b){if(_0x54295b){return _0x54295b[_0x935e('0x16')](_0x41def9)['then'](function(_0x35cc1a){return _0x35cc1a;});}return null;};}function removeEntity(_0x375814){return function(_0x37ebe7){if(_0x37ebe7){return _0x37ebe7[_0x935e('0x17')]()[_0x935e('0x18')](function(){_0x375814[_0x935e('0xd')](0xcc)[_0x935e('0xe')]();});}};}function handleEntityNotFound(_0x198322){return function(_0x38d77d){if(!_0x38d77d){_0x198322[_0x935e('0xc')](0x194);}return _0x38d77d;};}function handleError(_0xc62049,_0x53ccea){_0x53ccea=_0x53ccea||0x1f4;return function(_0x2b5649){logger[_0x935e('0x19')](_0x2b5649[_0x935e('0x1a')]);if(_0x2b5649[_0x935e('0x1b')]){delete _0x2b5649[_0x935e('0x1b')];}_0xc62049['status'](_0x53ccea)[_0x935e('0x1c')](_0x2b5649);};}function maskClientSecret(_0x4b9e44){return _[_0x935e('0x1d')](_0x4b9e44['slice'](0x0,0x3),0x14,'*');}exports[_0x935e('0x1e')]=function(_0x2e041d,_0x4b16d8){var _0x1b7331={},_0x26143d={},_0x397862={'count':0x0,'rows':[]};var _0x1df27c=_['map'](db[_0x935e('0x1f')]['rawAttributes'],function(_0x3549cb){return{'name':_0x3549cb[_0x935e('0x20')],'type':_0x3549cb[_0x935e('0x21')][_0x935e('0x22')]};});_0x26143d['model']=_['map'](_0x1df27c,_0x935e('0x1b'));_0x26143d[_0x935e('0x23')]=_[_0x935e('0x24')](_0x2e041d[_0x935e('0x23')]);_0x26143d[_0x935e('0x25')]=_[_0x935e('0x26')](_0x26143d['model'],_0x26143d[_0x935e('0x23')]);_0x1b7331[_0x935e('0x27')]=_['intersection'](_0x26143d[_0x935e('0x28')],qs[_0x935e('0x29')](_0x2e041d[_0x935e('0x23')][_0x935e('0x29')]));_0x1b7331[_0x935e('0x27')]=_0x1b7331[_0x935e('0x27')][_0x935e('0x2a')]?_0x1b7331['attributes']:_0x26143d[_0x935e('0x28')];if(!_0x2e041d[_0x935e('0x23')]['hasOwnProperty'](_0x935e('0x2b'))){_0x1b7331[_0x935e('0x11')]=qs[_0x935e('0x11')](_0x2e041d[_0x935e('0x23')][_0x935e('0x11')]);_0x1b7331['offset']=qs[_0x935e('0x13')](_0x2e041d[_0x935e('0x23')]['offset']);}_0x1b7331[_0x935e('0x2c')]=qs['sort'](_0x2e041d[_0x935e('0x23')][_0x935e('0x2d')]);_0x1b7331['where']=qs['filters'](_[_0x935e('0x2e')](_0x2e041d['query'],_0x26143d[_0x935e('0x25')]),_0x1df27c);if(_0x2e041d[_0x935e('0x23')]['filter']){_0x1b7331[_0x935e('0x2f')]=_[_0x935e('0x30')](_0x1b7331[_0x935e('0x2f')],{'$or':_['map'](_0x1df27c,function(_0xa6b537){if(_0xa6b537[_0x935e('0x21')]!==_0x935e('0x31')){var _0x1be776={};_0x1be776[_0xa6b537[_0x935e('0x1b')]]={'$like':'%'+_0x2e041d[_0x935e('0x23')]['filter']+'%'};return _0x1be776;}})});}_0x1b7331=_['merge']({},_0x1b7331,_0x2e041d[_0x935e('0x32')]);var _0x1bea25={'where':_0x1b7331[_0x935e('0x2f')]};return db[_0x935e('0x1f')][_0x935e('0x12')](_0x1bea25)[_0x935e('0x18')](function(_0x4ce4ec){_0x397862[_0x935e('0x12')]=_0x4ce4ec;if(_0x2e041d[_0x935e('0x23')][_0x935e('0x33')]){_0x1b7331[_0x935e('0x34')]=[{'all':!![]}];}return db['CloudProvider'][_0x935e('0x35')](_0x1b7331);})[_0x935e('0x18')](function(_0x3b38c5){_0x397862['rows']=_[_0x935e('0x36')](_0x3b38c5,function(_0x1ddc38){if(_0x1ddc38[_0x935e('0x37')]==='MicrosoftAzure'){var _0x1f3d73=encryptor['decryptString'](_0x1ddc38[_0x935e('0x38')]);_0x1ddc38['data3']=maskClientSecret(_0x1f3d73);}return _0x1ddc38;});return _0x397862;})[_0x935e('0x18')](respondWithFilteredResult(_0x4b16d8,_0x1b7331))[_0x935e('0x39')](handleError(_0x4b16d8,null));};exports[_0x935e('0x3a')]=function(_0x496a63,_0x4968d4){var _0x3648cb={'raw':!![],'where':{'id':_0x496a63[_0x935e('0x3b')]['id']}},_0x11add0={};_0x11add0[_0x935e('0x28')]=_['keys'](db[_0x935e('0x1f')][_0x935e('0x3c')]);_0x11add0['query']=_['keys'](_0x496a63['query']);_0x11add0[_0x935e('0x25')]=_[_0x935e('0x26')](_0x11add0['model'],_0x11add0[_0x935e('0x23')]);_0x3648cb[_0x935e('0x27')]=_[_0x935e('0x26')](_0x11add0[_0x935e('0x28')],qs[_0x935e('0x29')](_0x496a63[_0x935e('0x23')]['fields']));_0x3648cb[_0x935e('0x27')]=_0x3648cb[_0x935e('0x27')]['length']?_0x3648cb[_0x935e('0x27')]:_0x11add0[_0x935e('0x28')];if(_0x496a63[_0x935e('0x23')][_0x935e('0x33')]){_0x3648cb[_0x935e('0x34')]=[{'all':!![]}];}_0x3648cb=_[_0x935e('0x30')]({},_0x3648cb,_0x496a63[_0x935e('0x32')]);return db[_0x935e('0x1f')][_0x935e('0x3d')](_0x3648cb)[_0x935e('0x18')](handleEntityNotFound(_0x4968d4,null))['then'](function(_0x33fe0c){if(_0x33fe0c[_0x935e('0x37')]==='MicrosoftAzure'){var _0x3c91e2=encryptor[_0x935e('0x3e')](_0x33fe0c['data3']);_0x33fe0c['data3']=maskClientSecret(_0x3c91e2);}return _0x33fe0c;})[_0x935e('0x18')](respondWithResult(_0x4968d4,null))['catch'](handleError(_0x4968d4,null));};exports[_0x935e('0x3f')]=function(_0xeb2b9d,_0x47ca8b){if(!_0xeb2b9d['body'][_0x935e('0x1b')])throw new Error(_0x935e('0x40'));if(!_0xeb2b9d[_0x935e('0x41')][_0x935e('0x37')])throw new Error(_0x935e('0x42'));var _0x27e23f=db[_0x935e('0x1f')][_0x935e('0x3c')][_0x935e('0x37')][_0x935e('0x43')];if(!_0x27e23f[_0x935e('0x44')](_0xeb2b9d[_0x935e('0x41')][_0x935e('0x37')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x27e23f[_0x935e('0x45')](',\x20'));if(_0xeb2b9d[_0x935e('0x41')][_0x935e('0x37')]===_0x935e('0x46')&&_0xeb2b9d[_0x935e('0x41')]['data3']){_0xeb2b9d['body'][_0x935e('0x38')]=encryptor[_0x935e('0x47')](_0xeb2b9d[_0x935e('0x41')][_0x935e('0x38')]);}return db[_0x935e('0x1f')][_0x935e('0x3f')](_0xeb2b9d['body'],{})['then'](respondWithResult(_0x47ca8b,0xc9))['catch'](handleError(_0x47ca8b,null));};exports[_0x935e('0x16')]=function(_0x52842a,_0x2dc697){if(_0x52842a['body']['id']){delete _0x52842a[_0x935e('0x41')]['id'];}return db[_0x935e('0x1f')][_0x935e('0x3d')]({'where':{'id':_0x52842a[_0x935e('0x3b')]['id']}})[_0x935e('0x18')](handleEntityNotFound(_0x2dc697,null))[_0x935e('0x18')](function(_0xc08cd6){if(_0xc08cd6['service']===_0x935e('0x46')&&_0x52842a[_0x935e('0x41')][_0x935e('0x38')]){_0x52842a[_0x935e('0x41')][_0x935e('0x38')]=encryptor[_0x935e('0x47')](_0x52842a[_0x935e('0x41')][_0x935e('0x38')]);}return _0xc08cd6;})[_0x935e('0x18')](saveUpdates(_0x52842a['body'],null))[_0x935e('0x18')](respondWithResult(_0x2dc697,null))[_0x935e('0x39')](handleError(_0x2dc697,null));};exports[_0x935e('0x17')]=function(_0x24eab8,_0x57fbb9){return db[_0x935e('0x1f')]['find']({'where':{'id':_0x24eab8[_0x935e('0x3b')]['id']}})[_0x935e('0x18')](handleEntityNotFound(_0x57fbb9,null))[_0x935e('0x18')](removeEntity(_0x57fbb9,null))[_0x935e('0x39')](handleError(_0x57fbb9,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4f3c9b,_0xcf671e){return db['CloudProvider'][_0x935e('0x48')]({'where':{'id':_0x4f3c9b['params']['id']},'raw':!![]})[_0x935e('0x18')](function(_0x8f568b){if(!_0x8f568b)return _0xcf671e[_0x935e('0xc')](0x194);return{'url':oauth[_0x935e('0x49')](_0x8f568b,_0x4f3c9b[_0x935e('0x4a')]['id'])};})[_0x935e('0x18')](respondWithResult(_0xcf671e,null))[_0x935e('0x39')](handleError(_0xcf671e,null));};exports['oauth2MicrosoftCallback']=function(_0x109193,_0x5d8de7){var _0x2496e7=_0x109193[_0x935e('0x41')];var _0x1385aa;var _0x9eb52;if(_0x2496e7['error'])throw _0x2496e7;redis[_0x935e('0x4b')](_0x2496e7['state'])[_0x935e('0x18')](function(_0x58f91b){if(!_0x58f91b)throw new Error(_0x935e('0x4c'));_0x1385aa=JSON['parse'](_0x58f91b);var _0xbafd4a=Buffer[_0x935e('0x4d')](_0x2496e7['state'],'base64')[_0x935e('0x4e')](_0x935e('0x4f'));_0x9eb52=JSON[_0x935e('0x50')](_0xbafd4a);if(!oauth[_0x935e('0x51')](_0x2496e7[_0x935e('0x52')],_0x1385aa[_0x935e('0x53')]))throw new Error(_0x935e('0x54'));redis[_0x935e('0x55')](_0x2496e7[_0x935e('0x56')]);return oauth['getOauth2MicrosoftAccessToken'](_0x2496e7[_0x935e('0x57')],_0x1385aa);})['then'](function(_0x252e4b){_0x1385aa[_0x935e('0x58')]=_0x252e4b[_0x935e('0x59')];_0x1385aa[_0x935e('0x5a')]=_0x252e4b[_0x935e('0x5b')];return db[_0x935e('0x1f')]['update']({'data5':_0x1385aa[_0x935e('0x58')],'data6':_0x1385aa[_0x935e('0x5a')]},{'where':{'id':_0x1385aa['id']}});})[_0x935e('0x18')](function(){oauth[_0x935e('0x5c')](_0x1385aa);socket[_0x935e('0x5d')](_0x935e('0x5e'),{'id':_0x9eb52['id']});return;})[_0x935e('0x18')](respondWithStatusCode(_0x5d8de7,null))[_0x935e('0x39')](function(_0x132b3f){if(_0x9eb52){socket[_0x935e('0x5d')](_0x935e('0x5f'),{'id':_0x9eb52['id']});}if(!_0x1385aa){logger[_0x935e('0x19')]('Invalid\x20authentication\x20state\x20parameter',_0x132b3f);return _0x5d8de7[_0x935e('0xd')](0x1f4)[_0x935e('0x1c')](_0x132b3f[_0x935e('0x60')]);}logger['error'](_0x935e('0x61'),_0x1385aa['id'],JSON[_0x935e('0x62')](_0x132b3f));});}; \ No newline at end of file +var _0xbfb1=['Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','error','stack','name','send','slice','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','find','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error'];(function(_0xdbc609,_0x2a9cf2){var _0x43c00f=function(_0x2375af){while(--_0x2375af){_0xdbc609['push'](_0xdbc609['shift']());}};_0x43c00f(++_0x2a9cf2);}(_0xbfb1,0x187));var _0x1bfb=function(_0x2f6e2d,_0x3ba8a5){_0x2f6e2d=_0x2f6e2d-0x0;var _0x3d122c=_0xbfb1[_0x2f6e2d];return _0x3d122c;};'use strict';var _=require(_0x1bfb('0x0'));var Redis=require('ioredis');var qs=require(_0x1bfb('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x1bfb('0x2'));var logger=require(_0x1bfb('0x3'))(_0x1bfb('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x1bfb('0x5'));config[_0x1bfb('0x6')]=_[_0x1bfb('0x7')](config[_0x1bfb('0x6')],{'host':_0x1bfb('0x8'),'port':0x18eb});var socket=require(_0x1bfb('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x1bfb('0x6')]);function respondWithStatusCode(_0x4860a5,_0x47aadb){_0x47aadb=_0x47aadb||0xcc;return function(_0x2c23ef){if(_0x2c23ef){return _0x4860a5[_0x1bfb('0xa')](_0x47aadb);}return _0x4860a5[_0x1bfb('0xb')](_0x47aadb)['end']();};}function respondWithResult(_0x5130c1,_0x5b0ebc){_0x5b0ebc=_0x5b0ebc||0xc8;return function(_0x368440){if(_0x368440){return _0x5130c1['status'](_0x5b0ebc)[_0x1bfb('0xc')](_0x368440);}};}function respondWithFilteredResult(_0x52b3ff,_0x5478fc){return function(_0x1d883b){if(_0x1d883b){var _0x53aad7=typeof _0x5478fc['offset']===_0x1bfb('0xd')&&typeof _0x5478fc[_0x1bfb('0xe')]===_0x1bfb('0xd');var _0x5e2dc7=_0x1d883b[_0x1bfb('0xf')];var _0x571a3b=_0x53aad7?0x0:_0x5478fc[_0x1bfb('0x10')];var _0x44fff4=_0x53aad7?_0x1d883b[_0x1bfb('0xf')]:_0x5478fc['offset']+_0x5478fc[_0x1bfb('0xe')];var _0x68bd38;if(_0x44fff4>=_0x5e2dc7){_0x44fff4=_0x5e2dc7;_0x68bd38=0xc8;}else{_0x68bd38=0xce;}_0x52b3ff[_0x1bfb('0xb')](_0x68bd38);return _0x52b3ff[_0x1bfb('0x11')](_0x1bfb('0x12'),_0x571a3b+'-'+_0x44fff4+'/'+_0x5e2dc7)[_0x1bfb('0xc')](_0x1d883b);}return null;};}function saveUpdates(_0x34e13c){return function(_0x4c2275){if(_0x4c2275){return _0x4c2275[_0x1bfb('0x13')](_0x34e13c)[_0x1bfb('0x14')](function(_0x2cb67b){return _0x2cb67b;});}return null;};}function removeEntity(_0x4afa8d){return function(_0x29c8ac){if(_0x29c8ac){return _0x29c8ac[_0x1bfb('0x15')]()['then'](function(){_0x4afa8d[_0x1bfb('0xb')](0xcc)[_0x1bfb('0x16')]();});}};}function handleEntityNotFound(_0x56ea22){return function(_0x3e4dc2){if(!_0x3e4dc2){_0x56ea22[_0x1bfb('0xa')](0x194);}return _0x3e4dc2;};}function handleError(_0x4ba36c,_0xb0710d){_0xb0710d=_0xb0710d||0x1f4;return function(_0x31d115){logger[_0x1bfb('0x17')](_0x31d115[_0x1bfb('0x18')]);if(_0x31d115[_0x1bfb('0x19')]){delete _0x31d115[_0x1bfb('0x19')];}_0x4ba36c['status'](_0xb0710d)[_0x1bfb('0x1a')](_0x31d115);};}function maskClientSecret(_0x340fab){return _['padEnd'](_0x340fab[_0x1bfb('0x1b')](0x0,0x3),0x14,'*');}exports[_0x1bfb('0x1c')]=function(_0x5d844c,_0xc10af5){var _0x4a8ec8={},_0x5ad9f0={},_0x145f21={'count':0x0,'rows':[]};var _0xb4b617=_[_0x1bfb('0x1d')](db['CloudProvider'][_0x1bfb('0x1e')],function(_0xdb290c){return{'name':_0xdb290c[_0x1bfb('0x1f')],'type':_0xdb290c[_0x1bfb('0x20')][_0x1bfb('0x21')]};});_0x5ad9f0[_0x1bfb('0x22')]=_[_0x1bfb('0x1d')](_0xb4b617,'name');_0x5ad9f0[_0x1bfb('0x23')]=_[_0x1bfb('0x24')](_0x5d844c[_0x1bfb('0x23')]);_0x5ad9f0[_0x1bfb('0x25')]=_[_0x1bfb('0x26')](_0x5ad9f0['model'],_0x5ad9f0[_0x1bfb('0x23')]);_0x4a8ec8[_0x1bfb('0x27')]=_[_0x1bfb('0x26')](_0x5ad9f0[_0x1bfb('0x22')],qs[_0x1bfb('0x28')](_0x5d844c['query'][_0x1bfb('0x28')]));_0x4a8ec8[_0x1bfb('0x27')]=_0x4a8ec8[_0x1bfb('0x27')][_0x1bfb('0x29')]?_0x4a8ec8['attributes']:_0x5ad9f0[_0x1bfb('0x22')];if(!_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2a')](_0x1bfb('0x2b'))){_0x4a8ec8[_0x1bfb('0xe')]=qs[_0x1bfb('0xe')](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0xe')]);_0x4a8ec8[_0x1bfb('0x10')]=qs['offset'](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x10')]);}_0x4a8ec8['order']=qs[_0x1bfb('0x2c')](_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2c')]);_0x4a8ec8['where']=qs[_0x1bfb('0x25')](_[_0x1bfb('0x2d')](_0x5d844c[_0x1bfb('0x23')],_0x5ad9f0[_0x1bfb('0x25')]),_0xb4b617);if(_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x2e')]){_0x4a8ec8[_0x1bfb('0x2f')]=_[_0x1bfb('0x30')](_0x4a8ec8[_0x1bfb('0x2f')],{'$or':_[_0x1bfb('0x1d')](_0xb4b617,function(_0x44a4c){if(_0x44a4c[_0x1bfb('0x20')]!==_0x1bfb('0x31')){var _0x51ee4={};_0x51ee4[_0x44a4c[_0x1bfb('0x19')]]={'$like':'%'+_0x5d844c[_0x1bfb('0x23')]['filter']+'%'};return _0x51ee4;}})});}_0x4a8ec8=_['merge']({},_0x4a8ec8,_0x5d844c[_0x1bfb('0x32')]);var _0x2d328a={'where':_0x4a8ec8[_0x1bfb('0x2f')]};return db[_0x1bfb('0x33')][_0x1bfb('0xf')](_0x2d328a)[_0x1bfb('0x14')](function(_0x267f80){_0x145f21[_0x1bfb('0xf')]=_0x267f80;if(_0x5d844c[_0x1bfb('0x23')][_0x1bfb('0x34')]){_0x4a8ec8[_0x1bfb('0x35')]=[{'all':!![]}];}return db[_0x1bfb('0x33')][_0x1bfb('0x36')](_0x4a8ec8);})[_0x1bfb('0x14')](function(_0x20ac5a){_0x145f21[_0x1bfb('0x37')]=_[_0x1bfb('0x1d')](_0x20ac5a,function(_0xa08f2a){if(_0xa08f2a[_0x1bfb('0x38')]==='MicrosoftAzure'){var _0x1889a0=encryptor[_0x1bfb('0x39')](_0xa08f2a[_0x1bfb('0x3a')]);_0xa08f2a[_0x1bfb('0x3a')]=maskClientSecret(_0x1889a0);}return _0xa08f2a;});return _0x145f21;})['then'](respondWithFilteredResult(_0xc10af5,_0x4a8ec8))[_0x1bfb('0x3b')](handleError(_0xc10af5,null));};exports[_0x1bfb('0x3c')]=function(_0x5c6e35,_0x1ccb56){var _0x4ca134={'raw':!![],'where':{'id':_0x5c6e35[_0x1bfb('0x3d')]['id']}},_0x11fb9e={};_0x11fb9e[_0x1bfb('0x22')]=_[_0x1bfb('0x24')](db['CloudProvider'][_0x1bfb('0x1e')]);_0x11fb9e[_0x1bfb('0x23')]=_[_0x1bfb('0x24')](_0x5c6e35[_0x1bfb('0x23')]);_0x11fb9e[_0x1bfb('0x25')]=_['intersection'](_0x11fb9e[_0x1bfb('0x22')],_0x11fb9e[_0x1bfb('0x23')]);_0x4ca134[_0x1bfb('0x27')]=_[_0x1bfb('0x26')](_0x11fb9e['model'],qs['fields'](_0x5c6e35[_0x1bfb('0x23')][_0x1bfb('0x28')]));_0x4ca134[_0x1bfb('0x27')]=_0x4ca134[_0x1bfb('0x27')][_0x1bfb('0x29')]?_0x4ca134[_0x1bfb('0x27')]:_0x11fb9e[_0x1bfb('0x22')];if(_0x5c6e35['query'][_0x1bfb('0x34')]){_0x4ca134[_0x1bfb('0x35')]=[{'all':!![]}];}_0x4ca134=_['merge']({},_0x4ca134,_0x5c6e35[_0x1bfb('0x32')]);return db['CloudProvider'][_0x1bfb('0x3e')](_0x4ca134)[_0x1bfb('0x14')](handleEntityNotFound(_0x1ccb56,null))[_0x1bfb('0x14')](function(_0x3686a9){if(_0x3686a9[_0x1bfb('0x38')]===_0x1bfb('0x3f')){var _0x47174e=encryptor[_0x1bfb('0x39')](_0x3686a9[_0x1bfb('0x3a')]);_0x3686a9[_0x1bfb('0x3a')]=maskClientSecret(_0x47174e);}return _0x3686a9;})[_0x1bfb('0x14')](respondWithResult(_0x1ccb56,null))[_0x1bfb('0x3b')](handleError(_0x1ccb56,null));};exports[_0x1bfb('0x40')]=function(_0xd12cff,_0x2827bf){if(!_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xd12cff['body'][_0x1bfb('0x38')])throw new Error(_0x1bfb('0x42'));var _0x4eeb5b=db['CloudProvider'][_0x1bfb('0x1e')][_0x1bfb('0x38')][_0x1bfb('0x43')];if(!_0x4eeb5b[_0x1bfb('0x44')](_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x38')]))throw new Error(_0x1bfb('0x45')+_0x4eeb5b[_0x1bfb('0x46')](',\x20'));if(_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x38')]===_0x1bfb('0x3f')&&_0xd12cff['body'][_0x1bfb('0x3a')]){_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x3a')]=encryptor['encryptString'](_0xd12cff[_0x1bfb('0x41')][_0x1bfb('0x3a')]);}return db[_0x1bfb('0x33')][_0x1bfb('0x40')](_0xd12cff['body'],{})[_0x1bfb('0x14')](respondWithResult(_0x2827bf,0xc9))[_0x1bfb('0x3b')](handleError(_0x2827bf,null));};exports['update']=function(_0x2f2347,_0x916fb3){if(_0x2f2347['body']['id']){delete _0x2f2347[_0x1bfb('0x41')]['id'];}return db['CloudProvider'][_0x1bfb('0x3e')]({'where':{'id':_0x2f2347[_0x1bfb('0x3d')]['id']}})[_0x1bfb('0x14')](handleEntityNotFound(_0x916fb3,null))[_0x1bfb('0x14')](function(_0x283f97){if(_0x283f97[_0x1bfb('0x38')]===_0x1bfb('0x3f')&&_0x2f2347[_0x1bfb('0x41')][_0x1bfb('0x3a')]){_0x2f2347['body'][_0x1bfb('0x3a')]=encryptor[_0x1bfb('0x47')](_0x2f2347[_0x1bfb('0x41')][_0x1bfb('0x3a')]);}return _0x283f97;})[_0x1bfb('0x14')](saveUpdates(_0x2f2347['body'],null))[_0x1bfb('0x14')](respondWithResult(_0x916fb3,null))[_0x1bfb('0x3b')](handleError(_0x916fb3,null));};exports[_0x1bfb('0x15')]=function(_0x2a13e7,_0x1a3bf8){return db[_0x1bfb('0x33')][_0x1bfb('0x3e')]({'where':{'id':_0x2a13e7[_0x1bfb('0x3d')]['id']}})[_0x1bfb('0x14')](handleEntityNotFound(_0x1a3bf8,null))[_0x1bfb('0x14')](removeEntity(_0x1a3bf8,null))[_0x1bfb('0x3b')](handleError(_0x1a3bf8,null));};exports[_0x1bfb('0x48')]=function(_0x1f9401,_0x39bebc){return db[_0x1bfb('0x33')][_0x1bfb('0x49')]({'where':{'id':_0x1f9401['params']['id']},'raw':!![]})[_0x1bfb('0x14')](function(_0x39e2d8){if(!_0x39e2d8)return _0x39bebc[_0x1bfb('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x39e2d8,_0x1f9401[_0x1bfb('0x4a')]['id'])};})[_0x1bfb('0x14')](respondWithResult(_0x39bebc,null))[_0x1bfb('0x3b')](handleError(_0x39bebc,null));};exports[_0x1bfb('0x4b')]=function(_0x5802d5,_0x53b9f1){var _0x3a1a84=_0x5802d5[_0x1bfb('0x41')];var _0x590975;var _0x201a69;if(_0x3a1a84['error'])throw _0x3a1a84;redis[_0x1bfb('0x4c')](_0x3a1a84[_0x1bfb('0x4d')])[_0x1bfb('0x14')](function(_0x3591a3){if(!_0x3591a3)throw new Error(_0x1bfb('0x4e'));_0x590975=JSON['parse'](_0x3591a3);var _0x32c6e6=Buffer['from'](_0x3a1a84['state'],_0x1bfb('0x4f'))[_0x1bfb('0x50')](_0x1bfb('0x51'));_0x201a69=JSON[_0x1bfb('0x52')](_0x32c6e6);if(!oauth['isValidIdToken'](_0x3a1a84[_0x1bfb('0x53')],_0x590975[_0x1bfb('0x54')]))throw new Error(_0x1bfb('0x55'));redis['del'](_0x3a1a84[_0x1bfb('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3a1a84[_0x1bfb('0x56')],_0x590975);})[_0x1bfb('0x14')](function(_0x26151c){_0x590975[_0x1bfb('0x57')]=_0x26151c['access_token'];_0x590975[_0x1bfb('0x58')]=_0x26151c[_0x1bfb('0x59')];return db[_0x1bfb('0x33')][_0x1bfb('0x13')]({'data5':_0x590975[_0x1bfb('0x57')],'data6':_0x590975[_0x1bfb('0x58')]},{'where':{'id':_0x590975['id']}});})['then'](function(){oauth[_0x1bfb('0x5a')](_0x590975);socket['emit'](_0x1bfb('0x5b'),{'id':_0x201a69['id']});return;})[_0x1bfb('0x14')](respondWithStatusCode(_0x53b9f1,null))[_0x1bfb('0x3b')](function(_0x3f1bfc){if(_0x201a69){socket[_0x1bfb('0x5c')](_0x1bfb('0x5d'),{'id':_0x201a69['id']});}if(!_0x590975){logger[_0x1bfb('0x17')](_0x1bfb('0x5e'),_0x3f1bfc);return _0x53b9f1[_0x1bfb('0xb')](0x1f4)['send'](_0x3f1bfc[_0x1bfb('0x5f')]);}logger['error'](_0x1bfb('0x60'),_0x590975['id'],JSON['stringify'](_0x3f1bfc));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b840971..b4e8c93 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 _0x7a3b=['cloud_providers','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider'];(function(_0x2458ad,_0x4d6d89){var _0x2c8f40=function(_0xa67857){while(--_0xa67857){_0x2458ad['push'](_0x2458ad['shift']());}};_0x2c8f40(++_0x4d6d89);}(_0x7a3b,0xdd));var _0xb7a3=function(_0x15d6dc,_0x10b5bb){_0x15d6dc=_0x15d6dc-0x0;var _0x24a69b=_0x7a3b[_0x15d6dc];return _0x24a69b;};'use strict';var _=require(_0xb7a3('0x0'));var util=require('util');var logger=require(_0xb7a3('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb7a3('0x2'));var rp=require(_0xb7a3('0x3'));var fs=require('fs');var path=require(_0xb7a3('0x4'));var rimraf=require('rimraf');var config=require(_0xb7a3('0x5'));var attributes=require(_0xb7a3('0x6'));module['exports']=function(_0x2df8b9,_0x82511f){return _0x2df8b9[_0xb7a3('0x7')](_0xb7a3('0x8'),attributes,{'tableName':_0xb7a3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27c0=['../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x27c0,0x1cf));var _0x027c=function(_0x136108,_0x33ae59){_0x136108=_0x136108-0x0;var _0x49ab70=_0x27c0[_0x136108];return _0x49ab70;};'use strict';var _=require('lodash');var util=require(_0x027c('0x0'));var logger=require(_0x027c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x027c('0x2'));var rp=require(_0x027c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x027c('0x4'));var config=require(_0x027c('0x5'));var attributes=require(_0x027c('0x6'));module['exports']=function(_0x555bc3,_0x3f4a7b){return _0x555bc3['define'](_0x027c('0x7'),attributes,{'tableName':_0x027c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index e64ec0d..65f2a4c 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e3b=['data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','client_id','data1','response_type','data4','response_mode','form_post','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','data3','findOne','then','refresh_token','data6','decryptString','POST','access_token','CloudProvider','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','map','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','type','Dynamics365','push'];(function(_0x383aec,_0xf84268){var _0x556b35=function(_0xc87138){while(--_0xc87138){_0x383aec['push'](_0x383aec['shift']());}};_0x556b35(++_0xf84268);}(_0x6e3b,0x17b));var _0xb6e3=function(_0x37fc4a,_0x10a2a7){_0x37fc4a=_0x37fc4a-0x0;var _0x3d07d7=_0x6e3b[_0x37fc4a];return _0x3d07d7;};'use strict';var _=require(_0xb6e3('0x0'));var crypto=require(_0xb6e3('0x1'));var jwt=require(_0xb6e3('0x2'));var moment=require(_0xb6e3('0x3'));var Redis=require(_0xb6e3('0x4'));var rp=require(_0xb6e3('0x5'));var util=require(_0xb6e3('0x6'));var encryptor=require(_0xb6e3('0x7'));var config=require(_0xb6e3('0x8'));var logger=require(_0xb6e3('0x9'))(_0xb6e3('0xa'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xb6e3('0xb'))['db'];config[_0xb6e3('0xc')]=_[_0xb6e3('0xd')](config[_0xb6e3('0xc')],{'host':_0xb6e3('0xe'),'port':0x18eb});var redis=new Redis(config[_0xb6e3('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb6e3('0xf'),_0xb6e3('0x10'),'offline_access',_0xb6e3('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xb6e3('0x12')],'Dynamics365':[_0xb6e3('0x13'),_0xb6e3('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0xb6e3('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xb6e3('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3289c9){var _0x5d1c68=_['map'](AZURE_AUTH_SCOPES[_0x3289c9[_0xb6e3('0x17')]]);if(_0x3289c9[_0xb6e3('0x17')]===_0xb6e3('0x18'))_0x5d1c68[_0xb6e3('0x19')](_0x3289c9[_0xb6e3('0x1a')]+_0xb6e3('0x1b'));return _0x5d1c68[_0xb6e3('0x1c')]('\x20');}function getAccessTokenScope(_0xf9cff){if(_0xf9cff[_0xb6e3('0x17')]===_0xb6e3('0x1d'))return _0xb6e3('0x11');if(_0xf9cff[_0xb6e3('0x17')]===_0xb6e3('0x18'))return _0xf9cff['data7']+_0xb6e3('0x1b');}function generateMicrosoftAuthorizationUrl(_0x2cda80,_0x2b7910){var _0x3929ef=MICROSOFT_AUTH_URL[_0xb6e3('0x1e')](_0xb6e3('0x1f'),_0x2cda80[_0xb6e3('0x20')]);var _0x11602a=['code',_0xb6e3('0x21')];var _0x28fa02=Buffer[_0xb6e3('0x22')](JSON[_0xb6e3('0x23')]({'id':_0x2b7910}))[_0xb6e3('0x24')](_0xb6e3('0x25'));var _0x28b32b=crypto['randomBytes'](0x10)[_0xb6e3('0x24')]('hex');var _0x2ac9f1=getAuthorizationScopes(_0x2cda80);var _0x13c061=[{'key':_0xb6e3('0x26'),'value':_0x2cda80[_0xb6e3('0x27')]},{'key':_0xb6e3('0x28'),'value':encodeURIComponent(_0x11602a[_0xb6e3('0x1c')]('\x20'))},{'key':'redirect_uri','value':_0x2cda80[_0xb6e3('0x29')]},{'key':_0xb6e3('0x2a'),'value':_0xb6e3('0x2b')},{'key':'scope','value':encodeURIComponent(_0x2ac9f1)},{'key':_0xb6e3('0x2c'),'value':_0x28fa02},{'key':_0xb6e3('0x2d'),'value':_0x28b32b},{'key':_0xb6e3('0x2e'),'value':'login'}];var _0xa94c5d=_0x3929ef+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x13c061,function(_0x1d6061){return _0x1d6061[_0xb6e3('0x2f')]+'='+_0x1d6061[_0xb6e3('0x30')];})[_0xb6e3('0x1c')]('&');_0x2cda80[_0xb6e3('0x31')]={'issuer':_0x3929ef['replace'](_0xb6e3('0x32'),''),'audience':_0x2cda80[_0xb6e3('0x27')],'state':_0x28fa02,'nonce':_0x28b32b};redis[_0xb6e3('0x33')](_0x28fa02,JSON[_0xb6e3('0x23')](_0x2cda80));return _0xa94c5d;}function isValidIdToken(_0x5eb2e0,_0x4239d4){try{var _0x572b10=jwt[_0xb6e3('0x34')](_0x5eb2e0,{'complete':!![]});var _0x447eb6=_0x572b10[_0xb6e3('0x35')];if(_0x447eb6['iss']!==_0x4239d4[_0xb6e3('0x36')])return![];if(_0x447eb6[_0xb6e3('0x37')]!==_0x4239d4[_0xb6e3('0x38')])return![];if(_0x447eb6[_0xb6e3('0x2d')]!==_0x4239d4[_0xb6e3('0x2d')])return![];if(moment()[_0xb6e3('0x39')](moment[_0xb6e3('0x3a')](_0x447eb6[_0xb6e3('0x3b')])))return![];return!![];}catch(_0x139fd4){throw _0x139fd4;}}function refreshOauth2MicrosoftAccessToken(_0xc99f8d){return Promise[_0xb6e3('0x3c')]()['then'](function(){if(_0xc99f8d[_0xb6e3('0x3d')])return _0xc99f8d;return db['CloudProvider'][_0xb6e3('0x3e')]({'where':{'id':_0xc99f8d['id']},'raw':!![]});})[_0xb6e3('0x3f')](function(_0x4373e9){var _0x182651={'grant_type':_0xb6e3('0x40'),'refresh_token':_0x4373e9[_0xb6e3('0x41')],'scope':getAccessTokenScope(_0x4373e9),'redirect_uri':_0x4373e9[_0xb6e3('0x29')],'client_id':_0x4373e9['data1'],'client_secret':encryptor[_0xb6e3('0x42')](_0x4373e9[_0xb6e3('0x3d')])};var _0x577929={'method':_0xb6e3('0x43'),'uri':MICROSOFT_AUTH_URL[_0xb6e3('0x1e')](_0xb6e3('0x1f'),_0x4373e9[_0xb6e3('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x182651,'json':!![]};return rp(_0x577929);})['then'](function(_0x295779){_0xc99f8d['data5']=_0x295779[_0xb6e3('0x44')];_0xc99f8d[_0xb6e3('0x41')]=_0x295779[_0xb6e3('0x40')];return db[_0xb6e3('0x45')][_0xb6e3('0x46')]({'data5':_0xc99f8d[_0xb6e3('0x47')],'data6':_0xc99f8d[_0xb6e3('0x41')]},{'where':{'id':_0xc99f8d['id']}});})[_0xb6e3('0x3f')](function(){return _0xc99f8d;})['catch'](function(_0x13d197){logger[_0xb6e3('0x48')](_0xb6e3('0x49'),_0xc99f8d['id'],_0x13d197);});}function getOauth2MicrosoftAccessToken(_0x3d1900,_0x113d30){var _0x12ed4c={'grant_type':'authorization_code','code':_0x3d1900,'scope':getAccessTokenScope(_0x113d30),'redirect_uri':_0x113d30[_0xb6e3('0x29')],'client_id':_0x113d30['data1'],'client_secret':encryptor[_0xb6e3('0x42')](_0x113d30[_0xb6e3('0x3d')])};var _0x14c1c9={'method':_0xb6e3('0x43'),'uri':MICROSOFT_AUTH_URL[_0xb6e3('0x1e')]('{TENANT_ID}',_0x113d30[_0xb6e3('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12ed4c,'json':!![]};return rp(_0x14c1c9);}function startRefreshInterval(_0x6c18c){var _0x5f5b25=schedule[_0xb6e3('0x4a')];if(_0x5f5b25[_0x6c18c['id']])clearInterval(_0x5f5b25[_0x6c18c['id']]);_0x5f5b25[_0x6c18c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb6e3('0x4b')](this,{'id':_0x6c18c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb6e3('0x4a')]=_0x5f5b25;}function startAllRefreshIntervals(){return db[_0xb6e3('0x45')][_0xb6e3('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb6e3('0x3f')](function(_0x39aa74){var _0x289a60=_0x39aa74[_0xb6e3('0x4d')](function(_0x4bd95c){return refreshOauth2MicrosoftAccessToken(_0x4bd95c)[_0xb6e3('0x3f')](function(_0x509767){startRefreshInterval(_0x509767);});});return Promise[_0xb6e3('0x4e')](_0x289a60);})['catch'](function(_0x4114a7){var _0x345990=_0x4114a7?util[_0xb6e3('0x4f')](_0x4114a7,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x345990);});}module[_0xb6e3('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xcccf=['/authorize','/token','map','push','data7','/.default','type','Outlook365','Dynamics365','{TENANT_ID}','data2','code','id_token','toString','randomBytes','client_id','data1','response_type','join','redirect_uri','data4','scope','nonce','prompt','key','value','oauth2Claims','oauth2/','set','stringify','decode','payload','audience','isAfter','unix','exp','then','data3','refresh_token','decryptString','POST','replace','data5','access_token','data6','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access'];(function(_0x5cb5ab,_0x3d6d21){var _0x5be2ab=function(_0x417a55){while(--_0x417a55){_0x5cb5ab['push'](_0x5cb5ab['shift']());}};_0x5be2ab(++_0x3d6d21);}(_0xcccf,0x85));var _0xfccc=function(_0x3e946d,_0x11e07f){_0x3e946d=_0x3e946d-0x0;var _0x4cb65b=_0xcccf[_0x3e946d];return _0x4cb65b;};'use strict';var _=require('lodash');var crypto=require(_0xfccc('0x0'));var jwt=require(_0xfccc('0x1'));var moment=require(_0xfccc('0x2'));var Redis=require(_0xfccc('0x3'));var rp=require(_0xfccc('0x4'));var util=require(_0xfccc('0x5'));var encryptor=require(_0xfccc('0x6'));var config=require(_0xfccc('0x7'));var logger=require('../../config/logger')(_0xfccc('0x8'));var schedule=require(_0xfccc('0x9'));var db=require('../../mysqldb')['db'];config[_0xfccc('0xa')]=_['defaults'](config[_0xfccc('0xa')],{'host':_0xfccc('0xb'),'port':0x18eb});var redis=new Redis(config[_0xfccc('0xa')]);var MICROSOFT_AUTH_URL=_0xfccc('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfccc('0xd'),'profile',_0xfccc('0xe'),'offline_access',_0xfccc('0xf'),_0xfccc('0x10'),_0xfccc('0x11')],'Dynamics365':[_0xfccc('0xd'),_0xfccc('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xfccc('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xfccc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x26714d){var _0x1b8332=_[_0xfccc('0x15')](AZURE_AUTH_SCOPES[_0x26714d['type']]);if(_0x26714d['type']==='Dynamics365')_0x1b8332[_0xfccc('0x16')](_0x26714d[_0xfccc('0x17')]+_0xfccc('0x18'));return _0x1b8332['join']('\x20');}function getAccessTokenScope(_0x365c54){if(_0x365c54[_0xfccc('0x19')]===_0xfccc('0x1a'))return _0xfccc('0xf');if(_0x365c54[_0xfccc('0x19')]===_0xfccc('0x1b'))return _0x365c54['data7']+_0xfccc('0x18');}function generateMicrosoftAuthorizationUrl(_0x4b1985,_0x57a2ab){var _0x4b46b5=MICROSOFT_AUTH_URL['replace'](_0xfccc('0x1c'),_0x4b1985[_0xfccc('0x1d')]);var _0x4b08e5=[_0xfccc('0x1e'),_0xfccc('0x1f')];var _0x17158b=Buffer['from'](JSON['stringify']({'id':_0x57a2ab}))[_0xfccc('0x20')]('base64');var _0x3cf545=crypto[_0xfccc('0x21')](0x10)[_0xfccc('0x20')]('hex');var _0x477367=getAuthorizationScopes(_0x4b1985);var _0x342aac=[{'key':_0xfccc('0x22'),'value':_0x4b1985[_0xfccc('0x23')]},{'key':_0xfccc('0x24'),'value':encodeURIComponent(_0x4b08e5[_0xfccc('0x25')]('\x20'))},{'key':_0xfccc('0x26'),'value':_0x4b1985[_0xfccc('0x27')]},{'key':'response_mode','value':'form_post'},{'key':_0xfccc('0x28'),'value':encodeURIComponent(_0x477367)},{'key':'state','value':_0x17158b},{'key':_0xfccc('0x29'),'value':_0x3cf545},{'key':_0xfccc('0x2a'),'value':'login'}];var _0x3a5329=_0x4b46b5+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x342aac,function(_0x1fabcc){return _0x1fabcc[_0xfccc('0x2b')]+'='+_0x1fabcc[_0xfccc('0x2c')];})['join']('&');_0x4b1985[_0xfccc('0x2d')]={'issuer':_0x4b46b5['replace'](_0xfccc('0x2e'),''),'audience':_0x4b1985[_0xfccc('0x23')],'state':_0x17158b,'nonce':_0x3cf545};redis[_0xfccc('0x2f')](_0x17158b,JSON[_0xfccc('0x30')](_0x4b1985));return _0x3a5329;}function isValidIdToken(_0xf11ee,_0x4a73cb){try{var _0x433b17=jwt[_0xfccc('0x31')](_0xf11ee,{'complete':!![]});var _0x4fe097=_0x433b17[_0xfccc('0x32')];if(_0x4fe097['iss']!==_0x4a73cb['issuer'])return![];if(_0x4fe097['aud']!==_0x4a73cb[_0xfccc('0x33')])return![];if(_0x4fe097[_0xfccc('0x29')]!==_0x4a73cb[_0xfccc('0x29')])return![];if(moment()[_0xfccc('0x34')](moment[_0xfccc('0x35')](_0x4fe097[_0xfccc('0x36')])))return![];return!![];}catch(_0x403550){throw _0x403550;}}function refreshOauth2MicrosoftAccessToken(_0x5cd3c7){return Promise['resolve']()[_0xfccc('0x37')](function(){if(_0x5cd3c7[_0xfccc('0x38')])return _0x5cd3c7;return db['CloudProvider']['findOne']({'where':{'id':_0x5cd3c7['id']},'raw':!![]});})['then'](function(_0x48438e){var _0x14c71d={'grant_type':_0xfccc('0x39'),'refresh_token':_0x48438e['data6'],'scope':getAccessTokenScope(_0x48438e),'redirect_uri':_0x48438e['data4'],'client_id':_0x48438e[_0xfccc('0x23')],'client_secret':encryptor[_0xfccc('0x3a')](_0x48438e['data3'])};var _0x1aba79={'method':_0xfccc('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xfccc('0x3c')](_0xfccc('0x1c'),_0x48438e[_0xfccc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14c71d,'json':!![]};return rp(_0x1aba79);})[_0xfccc('0x37')](function(_0x191eb3){_0x5cd3c7[_0xfccc('0x3d')]=_0x191eb3[_0xfccc('0x3e')];_0x5cd3c7[_0xfccc('0x3f')]=_0x191eb3[_0xfccc('0x39')];return db[_0xfccc('0x40')][_0xfccc('0x41')]({'data5':_0x5cd3c7[_0xfccc('0x3d')],'data6':_0x5cd3c7[_0xfccc('0x3f')]},{'where':{'id':_0x5cd3c7['id']}});})[_0xfccc('0x37')](function(){return _0x5cd3c7;})[_0xfccc('0x42')](function(_0x6807cb){logger['error'](_0xfccc('0x43'),_0x5cd3c7['id'],_0x6807cb);});}function getOauth2MicrosoftAccessToken(_0x72e483,_0x2a6079){var _0xb61fd9={'grant_type':'authorization_code','code':_0x72e483,'scope':getAccessTokenScope(_0x2a6079),'redirect_uri':_0x2a6079[_0xfccc('0x27')],'client_id':_0x2a6079[_0xfccc('0x23')],'client_secret':encryptor[_0xfccc('0x3a')](_0x2a6079[_0xfccc('0x38')])};var _0x2ffb55={'method':_0xfccc('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0xfccc('0x1c'),_0x2a6079[_0xfccc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xb61fd9,'json':!![]};return rp(_0x2ffb55);}function startRefreshInterval(_0x5269a8){var _0x5d6b99=schedule[_0xfccc('0x44')];if(_0x5d6b99[_0x5269a8['id']])clearInterval(_0x5d6b99[_0x5269a8['id']]);_0x5d6b99[_0x5269a8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfccc('0x45')](this,{'id':_0x5269a8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfccc('0x44')]=_0x5d6b99;}function startAllRefreshIntervals(){return db[_0xfccc('0x40')][_0xfccc('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x43b76b){var _0x54597c=_0x43b76b[_0xfccc('0x15')](function(_0x406b2a){return refreshOauth2MicrosoftAccessToken(_0x406b2a)[_0xfccc('0x37')](function(_0x59b75b){startRefreshInterval(_0x59b75b);});});return Promise[_0xfccc('0x47')](_0x54597c);})[_0xfccc('0x42')](function(_0x4342f5){var _0x11078d=_0x4342f5?util[_0xfccc('0x48')](_0x4342f5,{'showHidden':![],'depth':null}):'';logger[_0xfccc('0x49')](_0xfccc('0x4a'),_0x11078d);});}module[_0xfccc('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index c8d14e1..25ecd75 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 _0x5204=['rpc','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\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(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0x5204[_0x3c6b7d];return _0x1d3ed2;};'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 +var _0x4f7a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x425288,_0x4d5ec9){var _0x3b148a=function(_0x5d6c0d){while(--_0x5d6c0d){_0x425288['push'](_0x425288['shift']());}};_0x3b148a(++_0x4d5ec9);}(_0x4f7a,0x105));var _0xa4f7=function(_0x2187cd,_0x51613f){_0x2187cd=_0x2187cd-0x0;var _0x1341b2=_0x4f7a[_0x2187cd];return _0x1341b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4f7('0x0'));var BPromise=require(_0xa4f7('0x1'));var rs=require(_0xa4f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f7('0x4'))(_0xa4f7('0x5'));var config=require(_0xa4f7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4f7('0x7')][_0xa4f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c78bd,_0x58e1c7,_0x1cea4c){return new BPromise(function(_0x1e3ff3,_0x1410a1){return client[_0xa4f7('0x9')](_0x4c78bd,_0x1cea4c)[_0xa4f7('0xa')](function(_0x498186){logger[_0xa4f7('0xb')](_0xa4f7('0xc'),_0x58e1c7,_0xa4f7('0xd'));logger[_0xa4f7('0xe')](_0xa4f7('0xf'),_0x58e1c7,_0xa4f7('0xd'),JSON[_0xa4f7('0x10')](_0x498186));if(_0x498186['error']){if(_0x498186['error'][_0xa4f7('0x11')]===0x1f4){logger[_0xa4f7('0x12')]('CloudProvider,\x20%s,\x20%s',_0x58e1c7,_0x498186[_0xa4f7('0x12')][_0xa4f7('0x13')]);return _0x1410a1(_0x498186[_0xa4f7('0x12')]['message']);}logger[_0xa4f7('0x12')](_0xa4f7('0xc'),_0x58e1c7,_0x498186[_0xa4f7('0x12')]['message']);return _0x1e3ff3(_0x498186[_0xa4f7('0x12')][_0xa4f7('0x13')]);}else{logger[_0xa4f7('0xb')](_0xa4f7('0xc'),_0x58e1c7,'request\x20sent');_0x1e3ff3(_0x498186[_0xa4f7('0x14')][_0xa4f7('0x13')]);}})['catch'](function(_0x501fe1){logger[_0xa4f7('0x12')]('CloudProvider,\x20%s,\x20%s',_0x58e1c7,_0x501fe1);_0x1410a1(_0x501fe1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 07eb207..40c5b10 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x3e243c,_0x5eb47d){var _0x2c6aad=function(_0x2d540a){while(--_0x2d540a){_0x3e243c['push'](_0x3e243c['shift']());}};_0x2c6aad(++_0x5eb47d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x23f7c0,_0x258721){var _0x3e7049=function(_0x930a35){while(--_0x930a35){_0x23f7c0['push'](_0x23f7c0['shift']());}};_0x3e7049(++_0x258721);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 520cde3..2bc6276 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 _0x8962=['STRING','name','exports'];(function(_0x48ca33,_0x5f27bc){var _0x267d1a=function(_0x489d0c){while(--_0x489d0c){_0x48ca33['push'](_0x48ca33['shift']());}};_0x267d1a(++_0x5f27bc);}(_0x8962,0x1e2));var _0x2896=function(_0x34d8b0,_0x1a26ef){_0x34d8b0=_0x34d8b0-0x0;var _0x4c93ab=_0x8962[_0x34d8b0];return _0x4c93ab;};'use strict';var Sequelize=require('sequelize');module[_0x2896('0x0')]={'name':{'type':Sequelize[_0x2896('0x1')],'unique':_0x2896('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2896('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x2896('0x1')]},'phone':{'type':Sequelize[_0x2896('0x1')]},'fax':{'type':Sequelize[_0x2896('0x1')]},'type':{'type':Sequelize[_0x2896('0x1')]},'street':{'type':Sequelize[_0x2896('0x1')]},'postalCode':{'type':Sequelize[_0x2896('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2896('0x1')]},'email':{'type':Sequelize[_0x2896('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2896('0x1')]},'sCity':{'type':Sequelize[_0x2896('0x1')]},'sCountry':{'type':Sequelize[_0x2896('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb03a=['sequelize','STRING'];(function(_0x1ef540,_0x19bf9f){var _0x3d050c=function(_0x11a9b2){while(--_0x11a9b2){_0x1ef540['push'](_0x1ef540['shift']());}};_0x3d050c(++_0x19bf9f);}(_0xb03a,0xa6));var _0xab03=function(_0x305293,_0x2ee5d3){_0x305293=_0x305293-0x0;var _0x33cd45=_0xb03a[_0x305293];return _0x33cd45;};'use strict';var Sequelize=require(_0xab03('0x0'));module['exports']={'name':{'type':Sequelize[_0xab03('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xab03('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xab03('0x1')]},'fax':{'type':Sequelize[_0xab03('0x1')]},'type':{'type':Sequelize[_0xab03('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xab03('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xab03('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xab03('0x1')]},'sStreet':{'type':Sequelize[_0xab03('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xab03('0x1')]},'sCountry':{'type':Sequelize[_0xab03('0x1')]},'description':{'type':Sequelize[_0xab03('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 685f9c9..6dc70a3 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 _0x8b7e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','UserProfileResource','error','name','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','map','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','role','Companies','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x535db7,_0x50a83e){var _0x4b56c3=function(_0x2ec584){while(--_0x2ec584){_0x535db7['push'](_0x535db7['shift']());}};_0x4b56c3(++_0x50a83e);}(_0x8b7e,0x9a));var _0xe8b7=function(_0x51f10b,_0x35494e){_0x51f10b=_0x51f10b-0x0;var _0x301a73=_0x8b7e[_0x51f10b];return _0x301a73;};'use strict';var emlformat=require(_0xe8b7('0x0'));var rimraf=require(_0xe8b7('0x1'));var zipdir=require(_0xe8b7('0x2'));var jsonpatch=require(_0xe8b7('0x3'));var rp=require(_0xe8b7('0x4'));var moment=require(_0xe8b7('0x5'));var BPromise=require(_0xe8b7('0x6'));var Mustache=require(_0xe8b7('0x7'));var util=require(_0xe8b7('0x8'));var path=require(_0xe8b7('0x9'));var sox=require(_0xe8b7('0xa'));var csv=require(_0xe8b7('0xb'));var ejs=require(_0xe8b7('0xc'));var fs=require('fs');var fs_extra=require(_0xe8b7('0xd'));var _=require(_0xe8b7('0xe'));var squel=require('squel');var crypto=require(_0xe8b7('0xf'));var jsforce=require(_0xe8b7('0x10'));var deskjs=require(_0xe8b7('0x11'));var toCsv=require(_0xe8b7('0xb'));var querystring=require(_0xe8b7('0x12'));var Papa=require(_0xe8b7('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe8b7('0x14'));var as=require(_0xe8b7('0x15'));var hardwareService=require(_0xe8b7('0x16'));var logger=require(_0xe8b7('0x17'))(_0xe8b7('0x18'));var utils=require(_0xe8b7('0x19'));var config=require(_0xe8b7('0x1a'));var licenseUtil=require(_0xe8b7('0x1b'));var db=require(_0xe8b7('0x1c'))['db'];function respondWithStatusCode(_0x33a8b1,_0x39150f){_0x39150f=_0x39150f||0xcc;return function(_0x42b20f){if(_0x42b20f){return _0x33a8b1[_0xe8b7('0x1d')](_0x39150f);}return _0x33a8b1['status'](_0x39150f)[_0xe8b7('0x1e')]();};}function respondWithResult(_0x4a1acf,_0x13d609){_0x13d609=_0x13d609||0xc8;return function(_0x5853a0){if(_0x5853a0){return _0x4a1acf[_0xe8b7('0x1f')](_0x13d609)[_0xe8b7('0x20')](_0x5853a0);}};}function respondWithFilteredResult(_0x42b58e,_0x33d87e){return function(_0x20480f){if(_0x20480f){var _0x59cb22=typeof _0x33d87e[_0xe8b7('0x21')]===_0xe8b7('0x22')&&typeof _0x33d87e[_0xe8b7('0x23')]==='undefined';var _0xad8b40=_0x20480f[_0xe8b7('0x24')];var _0x253f85=_0x59cb22?0x0:_0x33d87e['offset'];var _0x18c773=_0x59cb22?_0x20480f[_0xe8b7('0x24')]:_0x33d87e[_0xe8b7('0x21')]+_0x33d87e[_0xe8b7('0x23')];var _0x1df42b;if(_0x18c773>=_0xad8b40){_0x18c773=_0xad8b40;_0x1df42b=0xc8;}else{_0x1df42b=0xce;}_0x42b58e[_0xe8b7('0x1f')](_0x1df42b);return _0x42b58e[_0xe8b7('0x25')]('Content-Range',_0x253f85+'-'+_0x18c773+'/'+_0xad8b40)[_0xe8b7('0x20')](_0x20480f);}return null;};}function patchUpdates(_0x4ad208){return function(_0x24c03a){try{jsonpatch[_0xe8b7('0x26')](_0x24c03a,_0x4ad208,!![]);}catch(_0xf38d3d){return BPromise[_0xe8b7('0x27')](_0xf38d3d);}return _0x24c03a[_0xe8b7('0x28')]();};}function saveUpdates(_0x2fc8f8,_0x26a5b9){return function(_0x54b420){if(_0x54b420){return _0x54b420['update'](_0x2fc8f8)[_0xe8b7('0x29')](function(_0x381b41){return _0x381b41;});}return null;};}function removeEntity(_0x1a69fa,_0x3ae170){return function(_0x10ef65){if(_0x10ef65){return _0x10ef65[_0xe8b7('0x2a')]()[_0xe8b7('0x29')](function(){var _0x25f5e0=_0x10ef65[_0xe8b7('0x2b')]({'plain':!![]});var _0x633dbd='Companies';return db[_0xe8b7('0x2c')][_0xe8b7('0x2a')]({'where':{'type':_0x633dbd,'resourceId':_0x25f5e0['id']}})[_0xe8b7('0x29')](function(){return _0x10ef65;});})[_0xe8b7('0x29')](function(){_0x1a69fa[_0xe8b7('0x1f')](0xcc)[_0xe8b7('0x1e')]();});}};}function handleEntityNotFound(_0x4de16b,_0x109098){return function(_0x2ec265){if(!_0x2ec265){_0x4de16b[_0xe8b7('0x1d')](0x194);}return _0x2ec265;};}function handleError(_0x2e5325,_0x1bd43d){_0x1bd43d=_0x1bd43d||0x1f4;return function(_0x2e7313){logger[_0xe8b7('0x2d')](_0x2e7313['stack']);if(_0x2e7313[_0xe8b7('0x2e')]){delete _0x2e7313[_0xe8b7('0x2e')];}_0x2e5325['status'](_0x1bd43d)['send'](_0x2e7313);};}exports[_0xe8b7('0x2f')]=function(_0x5353c1,_0x56aa17){var _0xcae4ba={},_0x4d1c15={},_0x142a97={'count':0x0,'rows':[]};return db[_0xe8b7('0x30')][_0xe8b7('0x31')]()[_0xe8b7('0x29')](function(_0x56bd53){_0x4d1c15[_0xe8b7('0x32')]=_[_0xe8b7('0x33')](_0x56bd53);_0x4d1c15[_0xe8b7('0x34')]=_['keys'](_0x5353c1['query']);_0x4d1c15[_0xe8b7('0x35')]=_[_0xe8b7('0x36')](_0x4d1c15[_0xe8b7('0x32')],_0x4d1c15[_0xe8b7('0x34')]);_0xcae4ba['attributes']=_[_0xe8b7('0x36')](_0x4d1c15['model'],qs[_0xe8b7('0x37')](_0x5353c1['query'][_0xe8b7('0x37')]));_0xcae4ba[_0xe8b7('0x38')]=_0xcae4ba['attributes'][_0xe8b7('0x39')]?_0xcae4ba['attributes']:_0x4d1c15[_0xe8b7('0x32')];if(!_0x5353c1[_0xe8b7('0x34')][_0xe8b7('0x3a')]('nolimit')){_0xcae4ba[_0xe8b7('0x23')]=qs[_0xe8b7('0x23')](_0x5353c1[_0xe8b7('0x34')][_0xe8b7('0x23')]);_0xcae4ba['offset']=qs['offset'](_0x5353c1['query'][_0xe8b7('0x21')]);}_0xcae4ba[_0xe8b7('0x3b')]=qs[_0xe8b7('0x3c')](_0x5353c1[_0xe8b7('0x34')][_0xe8b7('0x3c')]);_0xcae4ba[_0xe8b7('0x3d')]=qs['filters'](_['pick'](_0x5353c1[_0xe8b7('0x34')],_0x4d1c15[_0xe8b7('0x35')]),_0x56bd53);if(_0x5353c1[_0xe8b7('0x34')]['filter']){_0xcae4ba[_0xe8b7('0x3d')]=_['merge'](_0xcae4ba['where'],{'$or':_[_0xe8b7('0x3e')](_0xcae4ba['attributes'],function(_0x4af68a){var _0x85500d={};_0x85500d[_0x4af68a]={'$like':'%'+_0x5353c1['query'][_0xe8b7('0x3f')]+'%'};return _0x85500d;})});}_0xcae4ba=_[_0xe8b7('0x40')]({},_0xcae4ba,_0x5353c1[_0xe8b7('0x41')]);var _0x4570f9={'where':_0xcae4ba[_0xe8b7('0x3d')]};return db[_0xe8b7('0x30')][_0xe8b7('0x24')](_0x4570f9)[_0xe8b7('0x29')](function(_0x3e3d4d){_0x142a97[_0xe8b7('0x24')]=_0x3e3d4d;if(_0x5353c1[_0xe8b7('0x34')][_0xe8b7('0x42')]){_0xcae4ba['include']=[{'all':!![]}];}return db[_0xe8b7('0x30')][_0xe8b7('0x43')](_0xcae4ba);})[_0xe8b7('0x29')](function(_0x4a939d){_0x142a97[_0xe8b7('0x44')]=_0x4a939d;return _0x142a97;})[_0xe8b7('0x29')](respondWithFilteredResult(_0x56aa17,_0xcae4ba))[_0xe8b7('0x45')](handleError(_0x56aa17,null));})[_0xe8b7('0x45')](handleError(_0x56aa17,null));};exports[_0xe8b7('0x46')]=function(_0x554f20,_0x5767da){var _0x4870aa={'raw':![],'where':{'id':_0x554f20[_0xe8b7('0x47')]['id']}},_0x308d0c={};_0x308d0c[_0xe8b7('0x32')]=_[_0xe8b7('0x33')](db[_0xe8b7('0x30')][_0xe8b7('0x48')]);_0x308d0c[_0xe8b7('0x34')]=_[_0xe8b7('0x33')](_0x554f20[_0xe8b7('0x34')]);_0x308d0c[_0xe8b7('0x35')]=_[_0xe8b7('0x36')](_0x308d0c[_0xe8b7('0x32')],_0x308d0c[_0xe8b7('0x34')]);_0x4870aa['attributes']=_[_0xe8b7('0x36')](_0x308d0c['model'],qs[_0xe8b7('0x37')](_0x554f20[_0xe8b7('0x34')][_0xe8b7('0x37')]));_0x4870aa[_0xe8b7('0x38')]=_0x4870aa[_0xe8b7('0x38')]['length']?_0x4870aa[_0xe8b7('0x38')]:_0x308d0c[_0xe8b7('0x32')];if(_0x554f20[_0xe8b7('0x34')][_0xe8b7('0x42')]){_0x4870aa[_0xe8b7('0x49')]=[{'all':!![]}];}_0x4870aa=_[_0xe8b7('0x40')]({},_0x4870aa,_0x554f20['options']);return db['CmCompany'][_0xe8b7('0x4a')](_0x4870aa)[_0xe8b7('0x29')](handleEntityNotFound(_0x5767da,null))[_0xe8b7('0x29')](respondWithResult(_0x5767da,null))['catch'](handleError(_0x5767da,null));};exports[_0xe8b7('0x4b')]=function(_0x5371ef,_0x27a076){return db[_0xe8b7('0x30')]['create'](_0x5371ef[_0xe8b7('0x4c')],{})[_0xe8b7('0x29')](function(_0x34f851){var _0x4c685f=_0x5371ef['user'][_0xe8b7('0x2b')]({'plain':!![]});if(!_0x4c685f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c685f[_0xe8b7('0x4d')]==='user'){var _0x5f5d2d=_0x34f851['get']({'plain':!![]});var _0x2b84a5=_0xe8b7('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x2b84a5,'userProfileId':_0x4c685f[_0xe8b7('0x4f')]},'raw':!![]})[_0xe8b7('0x29')](function(_0x1a00b7){if(_0x1a00b7&&_0x1a00b7[_0xe8b7('0x50')]===0x0){return db['UserProfileResource'][_0xe8b7('0x4b')]({'name':_0x5f5d2d[_0xe8b7('0x2e')],'resourceId':_0x5f5d2d['id'],'type':_0x1a00b7[_0xe8b7('0x2e')],'sectionId':_0x1a00b7['id']},{})['then'](function(){return _0x34f851;});}else{return _0x34f851;}})[_0xe8b7('0x45')](function(_0x4dcf84){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dcf84);throw _0x4dcf84;});}return _0x34f851;})[_0xe8b7('0x29')](respondWithResult(_0x27a076,0xc9))[_0xe8b7('0x45')](handleError(_0x27a076,null));};exports['update']=function(_0x254c7a,_0x38e255){if(_0x254c7a[_0xe8b7('0x4c')]['id']){delete _0x254c7a['body']['id'];}return db[_0xe8b7('0x30')][_0xe8b7('0x4a')]({'where':{'id':_0x254c7a[_0xe8b7('0x47')]['id']}})[_0xe8b7('0x29')](handleEntityNotFound(_0x38e255,null))[_0xe8b7('0x29')](saveUpdates(_0x254c7a[_0xe8b7('0x4c')],null))['then'](respondWithResult(_0x38e255,null))['catch'](handleError(_0x38e255,null));};exports[_0xe8b7('0x2a')]=function(_0x4f60af,_0x34509d){return db[_0xe8b7('0x30')][_0xe8b7('0x4a')]({'where':{'id':_0x4f60af[_0xe8b7('0x47')]['id']}})[_0xe8b7('0x29')](handleEntityNotFound(_0x34509d,null))['then'](removeEntity(_0x34509d,null))[_0xe8b7('0x45')](handleError(_0x34509d,null));};exports['describe']=function(_0xa1444f,_0x42f6e9){return db[_0xe8b7('0x30')][_0xe8b7('0x31')]()[_0xe8b7('0x29')](respondWithResult(_0x42f6e9,null))[_0xe8b7('0x45')](handleError(_0x42f6e9,null));};exports[_0xe8b7('0x51')]=function(_0x11c76b,_0x5d532f,_0xb69d84){return db[_0xe8b7('0x52')][_0xe8b7('0x4a')]({'where':{'id':_0x11c76b[_0xe8b7('0x47')]['id']}})[_0xe8b7('0x29')](handleEntityNotFound(_0x5d532f,null))[_0xe8b7('0x29')](function(_0x36b0db){if(_0x36b0db){return _0x36b0db[_0xe8b7('0x51')](_0x11c76b['body'][_0xe8b7('0x53')],_[_0xe8b7('0x54')](_0x11c76b[_0xe8b7('0x4c')],[_0xe8b7('0x53'),'id'])||{});}})[_0xe8b7('0x29')](respondWithResult(_0x5d532f,null))[_0xe8b7('0x45')](handleError(_0x5d532f,null));};exports[_0xe8b7('0x55')]=function(_0x49f297,_0x3ef483,_0x393404){var _0x176494={};var _0x49a9e6={};var _0x39eb8a;var _0x210300;return db[_0xe8b7('0x30')][_0xe8b7('0x56')]({'where':{'id':_0x49f297[_0xe8b7('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ef483,null))[_0xe8b7('0x29')](function(_0x1d0f00){if(_0x1d0f00){_0x39eb8a=_0x1d0f00;_0x49a9e6['model']=_['keys'](db[_0xe8b7('0x52')][_0xe8b7('0x48')]);_0x49a9e6[_0xe8b7('0x34')]=_[_0xe8b7('0x33')](_0x49f297['query']);_0x49a9e6[_0xe8b7('0x35')]=_[_0xe8b7('0x36')](_0x49a9e6[_0xe8b7('0x32')],_0x49a9e6[_0xe8b7('0x34')]);_0x176494[_0xe8b7('0x38')]=_[_0xe8b7('0x36')](_0x49a9e6[_0xe8b7('0x32')],qs[_0xe8b7('0x37')](_0x49f297[_0xe8b7('0x34')][_0xe8b7('0x37')]));_0x176494['attributes']=_0x176494[_0xe8b7('0x38')]['length']?_0x176494[_0xe8b7('0x38')]:_0x49a9e6['model'];_0x176494['order']=qs[_0xe8b7('0x3c')](_0x49f297[_0xe8b7('0x34')]['sort']);_0x176494['where']=qs['filters'](_['pick'](_0x49f297['query'],_0x49a9e6['filters']));if(_0x49f297[_0xe8b7('0x34')][_0xe8b7('0x3f')]){_0x176494[_0xe8b7('0x3d')]=_[_0xe8b7('0x40')](_0x176494[_0xe8b7('0x3d')],{'$or':_['map'](_0x176494[_0xe8b7('0x38')],function(_0x40ccdb){var _0x35a442={};_0x35a442[_0x40ccdb]={'$like':'%'+_0x49f297[_0xe8b7('0x34')]['filter']+'%'};return _0x35a442;})});}_0x176494=_[_0xe8b7('0x40')]({},_0x176494,_0x49f297[_0xe8b7('0x41')]);return _0x39eb8a[_0xe8b7('0x55')](_0x176494);}})['then'](function(_0x42f3dc){if(_0x42f3dc){_0x210300=_0x42f3dc['length'];if(!_0x49f297[_0xe8b7('0x34')][_0xe8b7('0x3a')]('nolimit')){_0x176494['limit']=qs['limit'](_0x49f297[_0xe8b7('0x34')]['limit']);_0x176494['offset']=qs['offset'](_0x49f297[_0xe8b7('0x34')][_0xe8b7('0x21')]);}return _0x39eb8a[_0xe8b7('0x55')](_0x176494);}})[_0xe8b7('0x29')](function(_0x25a3e2){if(_0x25a3e2){return _0x25a3e2?{'count':_0x210300,'rows':_0x25a3e2}:null;}})[_0xe8b7('0x29')](respondWithResult(_0x3ef483,null))['catch'](handleError(_0x3ef483,null));}; \ No newline at end of file +var _0x31fd=['attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','describe','model','query','keys','filters','intersection'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0x31fd,0x79));var _0xd31f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x31fd[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd31f('0x0'));var rimraf=require(_0xd31f('0x1'));var zipdir=require(_0xd31f('0x2'));var jsonpatch=require(_0xd31f('0x3'));var rp=require(_0xd31f('0x4'));var moment=require(_0xd31f('0x5'));var BPromise=require(_0xd31f('0x6'));var Mustache=require(_0xd31f('0x7'));var util=require(_0xd31f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd31f('0x9'));var ejs=require(_0xd31f('0xa'));var fs=require('fs');var fs_extra=require(_0xd31f('0xb'));var _=require(_0xd31f('0xc'));var squel=require(_0xd31f('0xd'));var crypto=require(_0xd31f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd31f('0x9'));var querystring=require(_0xd31f('0xf'));var Papa=require(_0xd31f('0x10'));var Redis=require(_0xd31f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd31f('0x12'));var as=require(_0xd31f('0x13'));var hardwareService=require(_0xd31f('0x14'));var logger=require(_0xd31f('0x15'))(_0xd31f('0x16'));var utils=require(_0xd31f('0x17'));var config=require(_0xd31f('0x18'));var licenseUtil=require(_0xd31f('0x19'));var db=require(_0xd31f('0x1a'))['db'];function respondWithStatusCode(_0x201f88,_0x1fba88){_0x1fba88=_0x1fba88||0xcc;return function(_0x36ff94){if(_0x36ff94){return _0x201f88[_0xd31f('0x1b')](_0x1fba88);}return _0x201f88['status'](_0x1fba88)[_0xd31f('0x1c')]();};}function respondWithResult(_0x3dbc5a,_0x23a324){_0x23a324=_0x23a324||0xc8;return function(_0x1572fa){if(_0x1572fa){return _0x3dbc5a[_0xd31f('0x1d')](_0x23a324)[_0xd31f('0x1e')](_0x1572fa);}};}function respondWithFilteredResult(_0x1d4238,_0xbfcd2d){return function(_0x5a2959){if(_0x5a2959){var _0x117465=typeof _0xbfcd2d[_0xd31f('0x1f')]===_0xd31f('0x20')&&typeof _0xbfcd2d[_0xd31f('0x21')]===_0xd31f('0x20');var _0x53b084=_0x5a2959[_0xd31f('0x22')];var _0x17a290=_0x117465?0x0:_0xbfcd2d['offset'];var _0x543963=_0x117465?_0x5a2959[_0xd31f('0x22')]:_0xbfcd2d[_0xd31f('0x1f')]+_0xbfcd2d[_0xd31f('0x21')];var _0xda27c7;if(_0x543963>=_0x53b084){_0x543963=_0x53b084;_0xda27c7=0xc8;}else{_0xda27c7=0xce;}_0x1d4238[_0xd31f('0x1d')](_0xda27c7);return _0x1d4238[_0xd31f('0x23')](_0xd31f('0x24'),_0x17a290+'-'+_0x543963+'/'+_0x53b084)[_0xd31f('0x1e')](_0x5a2959);}return null;};}function patchUpdates(_0x4aaac8){return function(_0x4feef3){try{jsonpatch[_0xd31f('0x25')](_0x4feef3,_0x4aaac8,!![]);}catch(_0x491d7d){return BPromise[_0xd31f('0x26')](_0x491d7d);}return _0x4feef3[_0xd31f('0x27')]();};}function saveUpdates(_0x1db448,_0x51815d){return function(_0x55914a){if(_0x55914a){return _0x55914a[_0xd31f('0x28')](_0x1db448)[_0xd31f('0x29')](function(_0x433e0a){return _0x433e0a;});}return null;};}function removeEntity(_0xcb3126,_0x583d84){return function(_0x25fdd2){if(_0x25fdd2){return _0x25fdd2[_0xd31f('0x2a')]()[_0xd31f('0x29')](function(){var _0x2fe961=_0x25fdd2[_0xd31f('0x2b')]({'plain':!![]});var _0x490986=_0xd31f('0x2c');return db[_0xd31f('0x2d')]['destroy']({'where':{'type':_0x490986,'resourceId':_0x2fe961['id']}})['then'](function(){return _0x25fdd2;});})[_0xd31f('0x29')](function(){_0xcb3126[_0xd31f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265ebc,_0x4038de){return function(_0xfc5a3){if(!_0xfc5a3){_0x265ebc['sendStatus'](0x194);}return _0xfc5a3;};}function handleError(_0x6c259c,_0xbd7a41){_0xbd7a41=_0xbd7a41||0x1f4;return function(_0x16fcb5){logger['error'](_0x16fcb5[_0xd31f('0x2e')]);if(_0x16fcb5[_0xd31f('0x2f')]){delete _0x16fcb5[_0xd31f('0x2f')];}_0x6c259c[_0xd31f('0x1d')](_0xbd7a41)[_0xd31f('0x30')](_0x16fcb5);};}exports['index']=function(_0x1976ff,_0x59237d){var _0x1274ef={},_0x2459e0={},_0x41c4e0={'count':0x0,'rows':[]};return db['CmCompany'][_0xd31f('0x31')]()['then'](function(_0xf9fed3){_0x2459e0[_0xd31f('0x32')]=_['keys'](_0xf9fed3);_0x2459e0[_0xd31f('0x33')]=_[_0xd31f('0x34')](_0x1976ff[_0xd31f('0x33')]);_0x2459e0[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x2459e0[_0xd31f('0x32')],_0x2459e0['query']);_0x1274ef[_0xd31f('0x37')]=_[_0xd31f('0x36')](_0x2459e0[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0x1976ff[_0xd31f('0x33')]['fields']));_0x1274ef[_0xd31f('0x37')]=_0x1274ef[_0xd31f('0x37')]['length']?_0x1274ef['attributes']:_0x2459e0[_0xd31f('0x32')];if(!_0x1976ff[_0xd31f('0x33')][_0xd31f('0x39')]('nolimit')){_0x1274ef[_0xd31f('0x21')]=qs[_0xd31f('0x21')](_0x1976ff[_0xd31f('0x33')][_0xd31f('0x21')]);_0x1274ef[_0xd31f('0x1f')]=qs['offset'](_0x1976ff[_0xd31f('0x33')][_0xd31f('0x1f')]);}_0x1274ef[_0xd31f('0x3a')]=qs[_0xd31f('0x3b')](_0x1976ff[_0xd31f('0x33')]['sort']);_0x1274ef[_0xd31f('0x3c')]=qs[_0xd31f('0x35')](_[_0xd31f('0x3d')](_0x1976ff[_0xd31f('0x33')],_0x2459e0[_0xd31f('0x35')]),_0xf9fed3);if(_0x1976ff[_0xd31f('0x33')][_0xd31f('0x3e')]){_0x1274ef[_0xd31f('0x3c')]=_[_0xd31f('0x3f')](_0x1274ef[_0xd31f('0x3c')],{'$or':_['map'](_0x1274ef[_0xd31f('0x37')],function(_0x322f30){var _0x4ebf73={};_0x4ebf73[_0x322f30]={'$like':'%'+_0x1976ff[_0xd31f('0x33')][_0xd31f('0x3e')]+'%'};return _0x4ebf73;})});}_0x1274ef=_[_0xd31f('0x3f')]({},_0x1274ef,_0x1976ff[_0xd31f('0x40')]);var _0x4353d1={'where':_0x1274ef[_0xd31f('0x3c')]};return db[_0xd31f('0x41')][_0xd31f('0x22')](_0x4353d1)['then'](function(_0x5bcdf5){_0x41c4e0[_0xd31f('0x22')]=_0x5bcdf5;if(_0x1976ff[_0xd31f('0x33')][_0xd31f('0x42')]){_0x1274ef[_0xd31f('0x43')]=[{'all':!![]}];}return db[_0xd31f('0x41')]['findAll'](_0x1274ef);})['then'](function(_0x468515){_0x41c4e0[_0xd31f('0x44')]=_0x468515;return _0x41c4e0;})[_0xd31f('0x29')](respondWithFilteredResult(_0x59237d,_0x1274ef))[_0xd31f('0x45')](handleError(_0x59237d,null));})['catch'](handleError(_0x59237d,null));};exports['show']=function(_0xefc703,_0x14d3f1){var _0x2acea6={'raw':![],'where':{'id':_0xefc703[_0xd31f('0x46')]['id']}},_0x1a8427={};_0x1a8427[_0xd31f('0x32')]=_['keys'](db[_0xd31f('0x41')]['rawAttributes']);_0x1a8427['query']=_[_0xd31f('0x34')](_0xefc703['query']);_0x1a8427[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x1a8427[_0xd31f('0x32')],_0x1a8427[_0xd31f('0x33')]);_0x2acea6[_0xd31f('0x37')]=_['intersection'](_0x1a8427[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0xefc703[_0xd31f('0x33')]['fields']));_0x2acea6[_0xd31f('0x37')]=_0x2acea6[_0xd31f('0x37')]['length']?_0x2acea6[_0xd31f('0x37')]:_0x1a8427[_0xd31f('0x32')];if(_0xefc703[_0xd31f('0x33')][_0xd31f('0x42')]){_0x2acea6[_0xd31f('0x43')]=[{'all':!![]}];}_0x2acea6=_[_0xd31f('0x3f')]({},_0x2acea6,_0xefc703['options']);return db['CmCompany'][_0xd31f('0x47')](_0x2acea6)['then'](handleEntityNotFound(_0x14d3f1,null))[_0xd31f('0x29')](respondWithResult(_0x14d3f1,null))[_0xd31f('0x45')](handleError(_0x14d3f1,null));};exports[_0xd31f('0x48')]=function(_0x14fcca,_0x374f71){return db[_0xd31f('0x41')][_0xd31f('0x48')](_0x14fcca[_0xd31f('0x49')],{})['then'](function(_0xd595c5){var _0x251299=_0x14fcca[_0xd31f('0x4a')][_0xd31f('0x2b')]({'plain':!![]});if(!_0x251299)throw new Error(_0xd31f('0x4b'));if(_0x251299[_0xd31f('0x4c')]===_0xd31f('0x4a')){var _0x19479a=_0xd595c5['get']({'plain':!![]});var _0x4c7ccf=_0xd31f('0x2c');return db[_0xd31f('0x4d')][_0xd31f('0x47')]({'where':{'name':_0x4c7ccf,'userProfileId':_0x251299[_0xd31f('0x4e')]},'raw':!![]})['then'](function(_0x3e9b73){if(_0x3e9b73&&_0x3e9b73[_0xd31f('0x4f')]===0x0){return db[_0xd31f('0x2d')][_0xd31f('0x48')]({'name':_0x19479a[_0xd31f('0x2f')],'resourceId':_0x19479a['id'],'type':_0x3e9b73['name'],'sectionId':_0x3e9b73['id']},{})[_0xd31f('0x29')](function(){return _0xd595c5;});}else{return _0xd595c5;}})[_0xd31f('0x45')](function(_0x6625d7){logger[_0xd31f('0x50')](_0xd31f('0x51'),_0x6625d7);throw _0x6625d7;});}return _0xd595c5;})['then'](respondWithResult(_0x374f71,0xc9))[_0xd31f('0x45')](handleError(_0x374f71,null));};exports[_0xd31f('0x28')]=function(_0x2632b8,_0x526ba0){if(_0x2632b8[_0xd31f('0x49')]['id']){delete _0x2632b8[_0xd31f('0x49')]['id'];}return db[_0xd31f('0x41')][_0xd31f('0x47')]({'where':{'id':_0x2632b8[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x526ba0,null))[_0xd31f('0x29')](saveUpdates(_0x2632b8[_0xd31f('0x49')],null))[_0xd31f('0x29')](respondWithResult(_0x526ba0,null))[_0xd31f('0x45')](handleError(_0x526ba0,null));};exports['destroy']=function(_0x23860d,_0x8aff5b){return db['CmCompany'][_0xd31f('0x47')]({'where':{'id':_0x23860d[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x8aff5b,null))[_0xd31f('0x29')](removeEntity(_0x8aff5b,null))['catch'](handleError(_0x8aff5b,null));};exports[_0xd31f('0x31')]=function(_0x5683d0,_0x518aa6){return db[_0xd31f('0x41')]['describe']()[_0xd31f('0x29')](respondWithResult(_0x518aa6,null))[_0xd31f('0x45')](handleError(_0x518aa6,null));};exports[_0xd31f('0x52')]=function(_0x1d59c9,_0x37242a,_0x699290){return db['CmContact'][_0xd31f('0x47')]({'where':{'id':_0x1d59c9[_0xd31f('0x46')]['id']}})[_0xd31f('0x29')](handleEntityNotFound(_0x37242a,null))['then'](function(_0x58c0d0){if(_0x58c0d0){return _0x58c0d0['addContacts'](_0x1d59c9[_0xd31f('0x49')][_0xd31f('0x53')],_[_0xd31f('0x54')](_0x1d59c9['body'],[_0xd31f('0x53'),'id'])||{});}})[_0xd31f('0x29')](respondWithResult(_0x37242a,null))[_0xd31f('0x45')](handleError(_0x37242a,null));};exports[_0xd31f('0x55')]=function(_0x484217,_0x568c2d,_0x55d175){var _0x56ddfd={};var _0x45f480={};var _0x1e86fb;var _0x23b7f1;return db[_0xd31f('0x41')]['findOne']({'where':{'id':_0x484217[_0xd31f('0x46')]['id']}})['then'](handleEntityNotFound(_0x568c2d,null))[_0xd31f('0x29')](function(_0x230e90){if(_0x230e90){_0x1e86fb=_0x230e90;_0x45f480[_0xd31f('0x32')]=_[_0xd31f('0x34')](db['CmContact']['rawAttributes']);_0x45f480[_0xd31f('0x33')]=_['keys'](_0x484217['query']);_0x45f480[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0x45f480[_0xd31f('0x32')],_0x45f480[_0xd31f('0x33')]);_0x56ddfd[_0xd31f('0x37')]=_[_0xd31f('0x36')](_0x45f480[_0xd31f('0x32')],qs[_0xd31f('0x38')](_0x484217[_0xd31f('0x33')][_0xd31f('0x38')]));_0x56ddfd['attributes']=_0x56ddfd[_0xd31f('0x37')][_0xd31f('0x56')]?_0x56ddfd[_0xd31f('0x37')]:_0x45f480[_0xd31f('0x32')];_0x56ddfd[_0xd31f('0x3a')]=qs[_0xd31f('0x3b')](_0x484217[_0xd31f('0x33')][_0xd31f('0x3b')]);_0x56ddfd[_0xd31f('0x3c')]=qs[_0xd31f('0x35')](_[_0xd31f('0x3d')](_0x484217['query'],_0x45f480[_0xd31f('0x35')]));if(_0x484217[_0xd31f('0x33')]['filter']){_0x56ddfd[_0xd31f('0x3c')]=_['merge'](_0x56ddfd[_0xd31f('0x3c')],{'$or':_['map'](_0x56ddfd[_0xd31f('0x37')],function(_0xeb5dfb){var _0x4317a5={};_0x4317a5[_0xeb5dfb]={'$like':'%'+_0x484217[_0xd31f('0x33')][_0xd31f('0x3e')]+'%'};return _0x4317a5;})});}_0x56ddfd=_[_0xd31f('0x3f')]({},_0x56ddfd,_0x484217[_0xd31f('0x40')]);return _0x1e86fb[_0xd31f('0x55')](_0x56ddfd);}})[_0xd31f('0x29')](function(_0x22054b){if(_0x22054b){_0x23b7f1=_0x22054b[_0xd31f('0x56')];if(!_0x484217[_0xd31f('0x33')][_0xd31f('0x39')](_0xd31f('0x57'))){_0x56ddfd['limit']=qs[_0xd31f('0x21')](_0x484217[_0xd31f('0x33')][_0xd31f('0x21')]);_0x56ddfd['offset']=qs[_0xd31f('0x1f')](_0x484217['query'][_0xd31f('0x1f')]);}return _0x1e86fb[_0xd31f('0x55')](_0x56ddfd);}})[_0xd31f('0x29')](function(_0x1fd930){if(_0x1fd930){return _0x1fd930?{'count':_0x23b7f1,'rows':_0x1fd930}:null;}})[_0xd31f('0x29')](respondWithResult(_0x568c2d,null))[_0xd31f('0x45')](handleError(_0x568c2d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 7918750..fa1558f 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 _0xaab4=['../../config/environment','exports','define','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12e73c,_0x2cbe1d){var _0x4c41cb=function(_0x10283b){while(--_0x10283b){_0x12e73c['push'](_0x12e73c['shift']());}};_0x4c41cb(++_0x2cbe1d);}(_0xaab4,0x67));var _0x4aab=function(_0x3a00ad,_0x2ae285){_0x3a00ad=_0x3a00ad-0x0;var _0x4a9a38=_0xaab4[_0x3a00ad];return _0x4a9a38;};'use strict';var _=require(_0x4aab('0x0'));var util=require('util');var logger=require(_0x4aab('0x1'))(_0x4aab('0x2'));var moment=require(_0x4aab('0x3'));var BPromise=require(_0x4aab('0x4'));var rp=require(_0x4aab('0x5'));var fs=require('fs');var path=require(_0x4aab('0x6'));var rimraf=require('rimraf');var config=require(_0x4aab('0x7'));var attributes=require('./cmCompany.attributes');module[_0x4aab('0x8')]=function(_0x2331eb,_0x141eeb){return _0x2331eb[_0x4aab('0x9')]('CmCompany',attributes,{'tableName':_0x4aab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a9b=['path','rimraf','./cmCompany.attributes','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a9b,0xc0));var _0xb1a9=function(_0x7ea9e0,_0x3e2a22){_0x7ea9e0=_0x7ea9e0-0x0;var _0x191073=_0x1a9b[_0x7ea9e0];return _0x191073;};'use strict';var _=require(_0xb1a9('0x0'));var util=require(_0xb1a9('0x1'));var logger=require(_0xb1a9('0x2'))(_0xb1a9('0x3'));var moment=require(_0xb1a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xb1a9('0x5'));var fs=require('fs');var path=require(_0xb1a9('0x6'));var rimraf=require(_0xb1a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xb1a9('0x8'));module['exports']=function(_0xc45b0a,_0x1d089c){return _0xc45b0a[_0xb1a9('0x9')]('CmCompany',attributes,{'tableName':_0xb1a9('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 192942b..d72611b 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 _0xec19=['../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x4b6db3,_0x4bfef8){var _0x5797ff=function(_0x574adf){while(--_0x574adf){_0x4b6db3['push'](_0x4b6db3['shift']());}};_0x5797ff(++_0x4bfef8);}(_0xec19,0xbf));var _0x9ec1=function(_0x1bedbd,_0x33a9b8){_0x1bedbd=_0x1bedbd-0x0;var _0x1166fd=_0xec19[_0x1bedbd];return _0x1166fd;};'use strict';var _=require(_0x9ec1('0x0'));var util=require(_0x9ec1('0x1'));var moment=require(_0x9ec1('0x2'));var BPromise=require(_0x9ec1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ec1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ec1('0x5'));var logger=require('../../config/logger')(_0x9ec1('0x6'));var config=require(_0x9ec1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9ec1('0x8')][_0x9ec1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b77ac,_0x58cc07,_0x38e102){return new BPromise(function(_0x21616a,_0x2d954e){return client[_0x9ec1('0xa')](_0x2b77ac,_0x38e102)[_0x9ec1('0xb')](function(_0x587dd1){logger[_0x9ec1('0xc')](_0x9ec1('0xd'),_0x58cc07,'request\x20sent');logger[_0x9ec1('0xe')](_0x9ec1('0xf'),_0x58cc07,_0x9ec1('0x10'),JSON[_0x9ec1('0x11')](_0x587dd1));if(_0x587dd1[_0x9ec1('0x12')]){if(_0x587dd1['error'][_0x9ec1('0x13')]===0x1f4){logger[_0x9ec1('0x12')](_0x9ec1('0xd'),_0x58cc07,_0x587dd1[_0x9ec1('0x12')][_0x9ec1('0x14')]);return _0x2d954e(_0x587dd1[_0x9ec1('0x12')][_0x9ec1('0x14')]);}logger[_0x9ec1('0x12')](_0x9ec1('0xd'),_0x58cc07,_0x587dd1[_0x9ec1('0x12')][_0x9ec1('0x14')]);return _0x21616a(_0x587dd1[_0x9ec1('0x12')][_0x9ec1('0x14')]);}else{logger[_0x9ec1('0xc')](_0x9ec1('0xd'),_0x58cc07,'request\x20sent');_0x21616a(_0x587dd1[_0x9ec1('0x15')]['message']);}})['catch'](function(_0x482214){logger[_0x9ec1('0x12')](_0x9ec1('0xd'),_0x58cc07,_0x482214);_0x2d954e(_0x482214);});});} \ No newline at end of file +var _0x659f=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x168cab,_0x1b0292){var _0x437052=function(_0x416c01){while(--_0x416c01){_0x168cab['push'](_0x168cab['shift']());}};_0x437052(++_0x1b0292);}(_0x659f,0x10a));var _0xf659=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x659f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf659('0x0'));var moment=require('moment');var BPromise=require(_0xf659('0x1'));var rs=require(_0xf659('0x2'));var fs=require('fs');var Redis=require(_0xf659('0x3'));var db=require(_0xf659('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf659('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf659('0x6'));var client=jayson[_0xf659('0x7')][_0xf659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5276a2,_0x1d9b90,_0x24709f){return new BPromise(function(_0xe4aeb3,_0x53f7d8){return client[_0xf659('0x9')](_0x5276a2,_0x24709f)[_0xf659('0xa')](function(_0x29580b){logger[_0xf659('0xb')](_0xf659('0xc'),_0x1d9b90,_0xf659('0xd'));logger['debug'](_0xf659('0xe'),_0x1d9b90,_0xf659('0xd'),JSON[_0xf659('0xf')](_0x29580b));if(_0x29580b['error']){if(_0x29580b[_0xf659('0x10')][_0xf659('0x11')]===0x1f4){logger['error'](_0xf659('0xc'),_0x1d9b90,_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);return _0x53f7d8(_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);}logger['error'](_0xf659('0xc'),_0x1d9b90,_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);return _0xe4aeb3(_0x29580b[_0xf659('0x10')][_0xf659('0x12')]);}else{logger['info'](_0xf659('0xc'),_0x1d9b90,'request\x20sent');_0xe4aeb3(_0x29580b[_0xf659('0x13')][_0xf659('0x12')]);}})['catch'](function(_0x577516){logger[_0xf659('0x10')]('CmCompany,\x20%s,\x20%s',_0x1d9b90,_0x577516);_0x53f7d8(_0x577516);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c364628..5a9b8c6 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 _0x2374=['show','getContacts','post','/:id/contacts','addContacts','put','/:id','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x28263e,_0x33fd6d){var _0x5865bf=function(_0x1b5171){while(--_0x1b5171){_0x28263e['push'](_0x28263e['shift']());}};_0x5865bf(++_0x33fd6d);}(_0x2374,0x88));var _0x4237=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2374[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x4237('0x0'));var util=require('util');var path=require(_0x4237('0x1'));var timeout=require(_0x4237('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4237('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4237('0x4'));var config=require(_0x4237('0x5'));var controller=require(_0x4237('0x6'));router[_0x4237('0x7')]('/',auth[_0x4237('0x8')](),controller[_0x4237('0x9')]);router[_0x4237('0x7')](_0x4237('0xa'),auth[_0x4237('0x8')](),controller['describe']);router[_0x4237('0x7')]('/:id',auth[_0x4237('0x8')](),controller[_0x4237('0xb')]);router['get']('/:id/contacts',auth[_0x4237('0x8')](),controller[_0x4237('0xc')]);router[_0x4237('0xd')]('/',auth[_0x4237('0x8')](),controller['create']);router[_0x4237('0xd')](_0x4237('0xe'),auth[_0x4237('0x8')](),controller[_0x4237('0xf')]);router[_0x4237('0x10')](_0x4237('0x11'),auth['isAuthenticated'](),controller[_0x4237('0x12')]);router['delete'](_0x4237('0x11'),auth['isAuthenticated'](),controller[_0x4237('0x13')]);module[_0x4237('0x14')]=router; \ No newline at end of file +var _0xa058=['../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','/:id','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x37689d,_0x5474ac){var _0x159c74=function(_0x4dd6c7){while(--_0x4dd6c7){_0x37689d['push'](_0x37689d['shift']());}};_0x159c74(++_0x5474ac);}(_0xa058,0x67));var _0x8a05=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0xa058[_0x4bc428];return _0x3ca37f;};'use strict';var multer=require(_0x8a05('0x0'));var util=require('util');var path=require(_0x8a05('0x1'));var timeout=require(_0x8a05('0x2'));var express=require(_0x8a05('0x3'));var router=express[_0x8a05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a05('0x5'));var interaction=require(_0x8a05('0x6'));var config=require(_0x8a05('0x7'));var controller=require(_0x8a05('0x8'));router['get']('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0xa')]);router[_0x8a05('0xb')](_0x8a05('0xc'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xd')]);router[_0x8a05('0xb')]('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0xe')]);router[_0x8a05('0xb')](_0x8a05('0xf'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x10')]);router[_0x8a05('0x11')]('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0x12')]);router[_0x8a05('0x11')](_0x8a05('0xf'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x13')]);router['put'](_0x8a05('0x14'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 001f207..cc749bf 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 _0x3c81=['TEXT','INTEGER','UNSIGNED','DATE','NOW','STRING'];(function(_0x250b8b,_0x1d3b34){var _0x458585=function(_0x53147d){while(--_0x53147d){_0x250b8b['push'](_0x250b8b['shift']());}};_0x458585(++_0x1d3b34);}(_0x3c81,0x155));var _0x13c8=function(_0x90b375,_0x9b6827){_0x90b375=_0x90b375-0x0;var _0x519c07=_0x3c81[_0x90b375];return _0x519c07;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x13c8('0x0')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x13c8('0x0')]},'postalCode':{'type':Sequelize[_0x13c8('0x0')]},'city':{'type':Sequelize[_0x13c8('0x0')]},'country':{'type':Sequelize[_0x13c8('0x0')]},'dateOfBirth':{'type':Sequelize[_0x13c8('0x0')]},'description':{'type':Sequelize[_0x13c8('0x1')]},'phone':{'type':Sequelize[_0x13c8('0x0')]},'mobile':{'type':Sequelize[_0x13c8('0x0')]},'fax':{'type':Sequelize[_0x13c8('0x0')]},'email':{'type':Sequelize[_0x13c8('0x0')]},'url':{'type':Sequelize[_0x13c8('0x0')]},'facebook':{'type':Sequelize[_0x13c8('0x0')]},'fb_data':{'type':Sequelize[_0x13c8('0x0')]},'twitter':{'type':Sequelize[_0x13c8('0x0')]},'skype':{'type':Sequelize[_0x13c8('0x0')]},'teams':{'type':Sequelize[_0x13c8('0x0')]},'viber':{'type':Sequelize[_0x13c8('0x0')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x13c8('0x0')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x13c8('0x0')]},'priority':{'type':Sequelize[_0x13c8('0x2')](0x2)[_0x13c8('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x13c8('0x4')],'defaultValue':Sequelize[_0x13c8('0x5')]},'dialTimezone':{'type':Sequelize[_0x13c8('0x0')]},'utcOffset':{'type':Sequelize[_0x13c8('0x2')]}}; \ No newline at end of file +var _0x6249=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x2fe3fc,_0x396fce){var _0x59a3b6=function(_0x2e0421){while(--_0x2e0421){_0x2fe3fc['push'](_0x2fe3fc['shift']());}};_0x59a3b6(++_0x396fce);}(_0x6249,0x111));var _0x9624=function(_0x51b760,_0x5b440c){_0x51b760=_0x51b760-0x0;var _0x33c26d=_0x6249[_0x51b760];return _0x33c26d;};'use strict';var _=require(_0x9624('0x0'));var Sequelize=require(_0x9624('0x1'));module[_0x9624('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9624('0x3')]},'street':{'type':Sequelize[_0x9624('0x3')]},'postalCode':{'type':Sequelize[_0x9624('0x3')]},'city':{'type':Sequelize[_0x9624('0x3')]},'country':{'type':Sequelize[_0x9624('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9624('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9624('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9624('0x3')]},'facebook':{'type':Sequelize[_0x9624('0x3')]},'fb_data':{'type':Sequelize[_0x9624('0x3')]},'twitter':{'type':Sequelize[_0x9624('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9624('0x3')]},'wechat':{'type':Sequelize[_0x9624('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9624('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9624('0x3')]},'priority':{'type':Sequelize[_0x9624('0x4')](0x2)[_0x9624('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9624('0x6')]},'dialTimezone':{'type':Sequelize[_0x9624('0x3')]},'utcOffset':{'type':Sequelize[_0x9624('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1850c75..6ea87d5 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 _0x4b37=['[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','name','Phones','ContactItemType','literal','Phones.OrderBy','get','$and','cf_%d','omit','pickBy','table','setFields','values','CmHopper','phone','getTags','rawAttributes','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','includeAll','include','getHopperHistories','getHopperFinals','ContactId','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','alias','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','Interaction','flatten','sortBy','reverse','slice','moment','util','path','squel','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','offset','limit','undefined','count','status','set','json','update','destroy','then','end','sendStatus','error','stack','send','index','CmContact','keys','length','startsWith','CmCustomField','findOne','trimStart','all','cf_','fieldType','query','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','castTo','DATE','text','map','filter','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','forEach','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','group','Sequelize','QueryTypes','SELECT','clone','c.id','order','DESC','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.CompanyId','TagIds','Tags','push','rows','catch','describe','tags','columnName','displayName','analytics','findAll','custom','body','mergeWith','join','info'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x4b37,0xb0));var _0x74b3=function(_0x313903,_0x338dc6){_0x313903=_0x313903-0x0;var _0x4c6d4b=_0x4b37[_0x313903];return _0x4c6d4b;};'use strict';var moment=require(_0x74b3('0x0'));var BPromise=require('bluebird');var util=require(_0x74b3('0x1'));var path=require(_0x74b3('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x74b3('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x74b3('0x4'));var logger=require(_0x74b3('0x5'))(_0x74b3('0x6'));var config=require(_0x74b3('0x7'));var shared=require(_0x74b3('0x8'));var db=require(_0x74b3('0x9'))['db'];config[_0x74b3('0xa')]=_[_0x74b3('0xb')](config[_0x74b3('0xa')],{'host':_0x74b3('0xc'),'port':0x18eb});var socket=require(_0x74b3('0xd'))(new Redis(config[_0x74b3('0xa')]));require(_0x74b3('0xe'))[_0x74b3('0xf')](socket);function respondWithResult(_0x1da85f,_0x47f067){_0x47f067=_0x47f067||0xc8;return function(_0x2031ba){if(_0x2031ba){return _0x1da85f['status'](_0x47f067)['json'](_0x2031ba);}};}function respondWithFilteredResult(_0x16f6af,_0x2f00b2){return function(_0x17f4a2){if(_0x17f4a2){var _0x52ae50=typeof _0x2f00b2[_0x74b3('0x10')]==='undefined'&&typeof _0x2f00b2[_0x74b3('0x11')]===_0x74b3('0x12');var _0x20fa01=_0x17f4a2[_0x74b3('0x13')];var _0x6eb903=_0x52ae50?0x0:_0x2f00b2[_0x74b3('0x10')];var _0x373af5=_0x52ae50?_0x17f4a2[_0x74b3('0x13')]:_0x2f00b2['offset']+_0x2f00b2[_0x74b3('0x11')];var _0x30bbe9;if(_0x373af5>=_0x20fa01){_0x373af5=_0x20fa01;_0x30bbe9=0xc8;}else{_0x30bbe9=0xce;}_0x16f6af[_0x74b3('0x14')](_0x30bbe9);return _0x16f6af[_0x74b3('0x15')]('Content-Range',_0x6eb903+'-'+_0x373af5+'/'+_0x20fa01)[_0x74b3('0x16')](_0x17f4a2);}return null;};}function saveUpdates(_0x1ce291){return function(_0x1c6ae7){if(_0x1c6ae7){return _0x1c6ae7[_0x74b3('0x17')](_0x1ce291)['then'](function(_0x4ad1ea){return _0x4ad1ea;});}return null;};}function removeEntity(_0x42944e){return function(_0x317071){if(_0x317071){return _0x317071[_0x74b3('0x18')]()[_0x74b3('0x19')](function(){_0x42944e[_0x74b3('0x14')](0xcc)[_0x74b3('0x1a')]();});}};}function handleEntityNotFound(_0x1e7407){return function(_0x649b10){if(!_0x649b10){_0x1e7407[_0x74b3('0x1b')](0x194);}return _0x649b10;};}function handleError(_0x185394,_0xd9f7e0){_0xd9f7e0=_0xd9f7e0||0x1f4;return function(_0x4ea217){logger[_0x74b3('0x1c')](_0x4ea217[_0x74b3('0x1d')]);if(_0x4ea217['name']){delete _0x4ea217['name'];}_0x185394['status'](_0xd9f7e0)[_0x74b3('0x1e')](_0x4ea217);};}exports[_0x74b3('0x1f')]=function(_0x4c85fe,_0x47e68c){var _0x76a8aa={},_0x150496={},_0x57968a={'count':0x0,'rows':[]};return db[_0x74b3('0x20')]['describe']()[_0x74b3('0x19')](function(_0x55d3dd){var _0x495f4e=[];for(var _0x1886e0=0x0;_0x1886e00x1){_0x476ca2['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x74b3('0x5c')](_0x12be04),null);}else{if(qs[_0x74b3('0x5d')](_0x12be04)){_0x476ca2['or']('c.id\x20LIKE\x20?',_0x12be04+'%');_0x476ca2['or'](_0x74b3('0x5e'),_0x12be04+'%');_0x476ca2['or'](_0x74b3('0x5f'),_0x12be04+'%');_0x476ca2['or']('c.fax\x20LIKE\x20?',_0x12be04+'%');}else if(qs[_0x74b3('0x60')](_0x12be04)){_0x476ca2['or']('c.email\x20LIKE\x20?',_0x12be04+'%');}else{_0x476ca2['or']('c.firstName\x20LIKE\x20?','%'+_0x12be04+'%');_0x476ca2['or']('c.lastName\x20LIKE\x20?','%'+_0x12be04+'%');_0x476ca2['or']('c.email\x20LIKE\x20?','%'+_0x12be04+'%');}}}}_0x3adc67['where'](_0x476ca2);_0x3adc67[_0x74b3('0x61')]('c.id');var _0x13dfbf={'type':db[_0x74b3('0x62')][_0x74b3('0x63')][_0x74b3('0x64')],'raw':!![]};var _0x465ac8=_0x3adc67[_0x74b3('0x65')]()[_0x74b3('0x35')](_0x74b3('0x66'));if(_0x76a8aa[_0x74b3('0x67')]){_0x76a8aa[_0x74b3('0x67')][_0x74b3('0x5a')](function(_0x805229){_0x3adc67[_0x74b3('0x67')]('c.'+_0x805229[0x0],_0x805229[0x1]===_0x74b3('0x68')?![]:!![]);});}if(!_[_0x74b3('0x53')](_0x501ccd)){_0x3adc67['having'](_0x2ef8e7);_0x465ac8[_0x74b3('0x31')](_0x74b3('0x69'),_0x501ccd);}BPromise[_0x74b3('0x6a')]()[_0x74b3('0x19')](function(){if(!_0xbfdbd1)return;if(_0x4c85fe[_0x74b3('0x6b')][_0x74b3('0x6c')]!==_0x74b3('0x6d'))return;if(!_[_0x74b3('0x6e')](_0xbfdbd1[_0x74b3('0x43')],['field',_0x74b3('0x49')])){return _0x4c85fe[_0x74b3('0x6b')][_0x74b3('0x6f')]({'attributes':['id'],'raw':!![]})[_0x74b3('0x19')](function(_0x594a47){if(_[_0x74b3('0x53')](_0x594a47)){_0x465ac8['where'](_0x74b3('0x70'));_0x3adc67[_0x74b3('0x31')](_0x74b3('0x70'));}else{_0x465ac8[_0x74b3('0x31')](_0x74b3('0x71'),_[_0x74b3('0x50')](_0x594a47,'id'));_0x3adc67['where'](_0x74b3('0x71'),_[_0x74b3('0x50')](_0x594a47,'id'));}});}})['then'](function(){if(_0x4c85fe[_0x74b3('0x6b')][_0x74b3('0x6c')]==='agent'&&!_0xbfdbd1&&!_0x4c85fe[_0x74b3('0x2a')][_0x74b3('0x54')])return[];return db[_0x74b3('0x72')][_0x74b3('0x2a')](_0x465ac8[_0x74b3('0x73')](),_0x13dfbf);})[_0x74b3('0x19')](function(_0x123fd6){_0x57968a[_0x74b3('0x13')]=_0x123fd6['length'];if(_0x57968a[_0x74b3('0x13')]===0x0)return[];return db['sequelize'][_0x74b3('0x2a')](_0x4b7129['toString'](),_0x13dfbf)[_0x74b3('0x19')](function(_0xeb99aa){_0x19df51=_[_0x74b3('0x74')](_0xeb99aa,'id');_0x13dfbf=_[_0x74b3('0x75')](_0x13dfbf,{'model':db[_0x74b3('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c85fe[_0x74b3('0x2a')]['fields']){_0x76a8aa[_0x74b3('0x2e')][_0x74b3('0x5a')](function(_0xf4b1e2){_0x3adc67[_0x74b3('0x35')]('c.'+_0xf4b1e2);});}else{_0x3adc67[_0x74b3('0x35')](_0x74b3('0x66'));_0x3adc67[_0x74b3('0x35')](_0x74b3('0x76'));_0x3adc67['field'](_0x74b3('0x77'));_0x3adc67[_0x74b3('0x35')](_0x74b3('0x78'));_0x3adc67[_0x74b3('0x35')](_0x74b3('0x79'));_0x3adc67[_0x74b3('0x35')](_0x74b3('0x7a'));_0x3adc67[_0x74b3('0x35')]('c.email');_0x3adc67[_0x74b3('0x35')](_0x74b3('0x7b'));_0x3adc67['field'](_0x74b3('0x7c'));_0x3adc67[_0x74b3('0x35')]('c.deletedAt');_0x3adc67['field'](_0x74b3('0x7d'));_0x3adc67[_0x74b3('0x35')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x74b3('0x7e'));}if(_0x76a8aa[_0x74b3('0x11')])_0x3adc67[_0x74b3('0x11')](_0x76a8aa[_0x74b3('0x11')]);if(_0x76a8aa['offset'])_0x3adc67['offset'](_0x76a8aa['offset']);return db[_0x74b3('0x72')][_0x74b3('0x2a')](_0x3adc67['toString'](),_0x13dfbf);});})[_0x74b3('0x19')](function(_0x56ae5d){_0x56ae5d[_0x74b3('0x5a')](function(_0x521b1c){if(_0x521b1c[_0x74b3('0x7e')]){_0x521b1c[_0x74b3('0x7f')]=[];_0x521b1c['TagIds'][_0x74b3('0x46')](',')[_0x74b3('0x5a')](function(_0x35d0a2){_0x521b1c[_0x74b3('0x7f')][_0x74b3('0x80')](_0x19df51[_0x35d0a2]);});}delete _0x521b1c[_0x74b3('0x7e')];});_0x57968a[_0x74b3('0x81')]=_0x56ae5d;return _0x57968a;})['then'](respondWithFilteredResult(_0x47e68c,_0x76a8aa));})[_0x74b3('0x82')](handleError(_0x47e68c,null));};exports[_0x74b3('0x18')]=function(_0x1f781f,_0x4f9efc){return db[_0x74b3('0x20')]['find']({'where':{'id':_0x1f781f['params']['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x4f9efc,null))[_0x74b3('0x19')](removeEntity(_0x4f9efc,null))['catch'](handleError(_0x4f9efc,null));};exports['describe']=function(_0x4577f7,_0x323f53){return db[_0x74b3('0x20')][_0x74b3('0x83')]()['then'](function(_0x43230f){delete _0x43230f[_0x74b3('0x84')];for(var _0x356f63=0x0;_0x356f630x0){return new Promise(function(_0x58b2a8,_0x4ab0c3){var _0x2cbf14=[];for(var _0x4d2a4c=0x0;_0x4d2a4c<_0x15785b[_0x74b3('0x22')];_0x4d2a4c++){_0x2cbf14[_0x74b3('0x80')](insertAdditionalPhones(_0x15785b[_0x4d2a4c]['contact'],_0x15785b[_0x4d2a4c][_0x74b3('0xa9')]));}Promise[_0x74b3('0x27')](_0x2cbf14)[_0x74b3('0x19')](function(){_0x58b2a8(0x1);});})['then'](function(){return{'success':_0x6ca8ae,'failure':_0x4ef8de,'duplicates':_0x3149fd};});}else{return{'success':_0x6ca8ae,'failure':_0x4ef8de,'duplicates':_0x3149fd};}}})[_0x74b3('0x19')](respondWithResult(_0x3d0f69,0xc9))[_0x74b3('0x82')](handleError(_0x3d0f69,null));};exports[_0x74b3('0xb0')]=function(_0x27ef5e,_0x4e7aa8){var _0x551d95;return db['CmContact'][_0x74b3('0x83')]()[_0x74b3('0x19')](function(_0x10c8c8){return db[_0x74b3('0x20')][_0x74b3('0x44')]({'where':{'id':_0x27ef5e[_0x74b3('0xb1')]['id']},'include':[{'model':db['Tag'],'as':_0x74b3('0x7f'),'attributes':['id',_0x74b3('0xb2'),'color'],'required':_0x27ef5e[_0x74b3('0x2a')][_0x74b3('0x58')]?!![]:![]},{'model':db[_0x74b3('0x9b')],'as':_0x74b3('0xb3'),'where':{'CmContactId':_0x27ef5e[_0x74b3('0xb1')]['id']},'required':![],'include':[{'model':db[_0x74b3('0xb4')],'as':'ItemType'}]}],'order':[db[_0x74b3('0x72')][_0x74b3('0xb5')](_0x74b3('0xb6'))],'attributes':_[_0x74b3('0x21')](_0x10c8c8)});})[_0x74b3('0x19')](function(_0x36d2c3){if(!_[_0x74b3('0xa6')](_0x36d2c3)){_0x551d95=_0x36d2c3[_0x74b3('0xb7')]({'plain':!![]});var _0x3cb859={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x36d2c3&&_0x36d2c3[_0x74b3('0x54')]){if(_0x36d2c3[_0x74b3('0x54')]){_0x3cb859[_0x74b3('0x31')][_0x74b3('0xb8')]['push']({'ListId':{'$ne':_0x36d2c3['ListId']}});}}return db[_0x74b3('0x24')][_0x74b3('0x88')](_0x3cb859);}})[_0x74b3('0x19')](function(_0x2eaf9f){if(!_[_0x74b3('0xa6')](_0x2eaf9f)){return _['omit'](_0x551d95,_[_0x74b3('0x50')](_0x2eaf9f,function(_0xba5679){return util['format'](_0x74b3('0xb9'),_0xba5679['id']);}));}})[_0x74b3('0x19')](handleEntityNotFound(_0x4e7aa8,null))[_0x74b3('0x19')](respondWithResult(_0x4e7aa8,null))['catch'](handleError(_0x4e7aa8,null));};exports[_0x74b3('0x17')]=function(_0x2daabe,_0x52bb93){var _0x445e37;if(_0x2daabe[_0x74b3('0x8a')]['id']){delete _0x2daabe[_0x74b3('0x8a')]['id'];}if(!_['isNil'](_0x2daabe[_0x74b3('0x8a')]['dialTimezone'])){var _0x2b6184=_0x2daabe[_0x74b3('0x8a')][_0x74b3('0xa5')];if(!_[_0x74b3('0xa6')](shared[_0x74b3('0xa7')][_0x2b6184]))_0x2daabe[_0x74b3('0x8a')][_0x74b3('0xa8')]=shared['timezones'][_0x2b6184][_0x74b3('0xa8')];}return db['CmContact']['find']({'where':{'id':_0x2daabe['params']['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x52bb93,null))['then'](saveUpdates(_0x2daabe[_0x74b3('0x8a')],null))[_0x74b3('0x19')](function(_0x259037){_0x445e37=_0x259037;var _0x1a0030={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x259037&&_0x259037[_0x74b3('0x54')]){if(_0x259037[_0x74b3('0x54')]){_0x1a0030['where'][_0x74b3('0xb8')][_0x74b3('0x80')]({'ListId':{'$ne':_0x259037[_0x74b3('0x54')]}});}}return db[_0x74b3('0x24')][_0x74b3('0x88')](_0x1a0030);})['then'](function(_0x22f01b){if(_0x22f01b){return _[_0x74b3('0xba')](_[_0x74b3('0xbb')](_0x2daabe['body'],function(_0x1f7993,_0x575d18){return _['startsWith'](_0x575d18,_0x74b3('0x28'));}),_[_0x74b3('0x50')](_0x22f01b,function(_0x212b96){return util['format'](_0x74b3('0xb9'),_0x212b96['id']);}));}})[_0x74b3('0x19')](function(_0x146a4a){if(_0x146a4a&&!_['isEmpty'](_0x146a4a)){var _0x393b2f=squel[_0x74b3('0x17')]()[_0x74b3('0xbc')](_0x74b3('0x39'))[_0x74b3('0xbd')](_0x146a4a)[_0x74b3('0x31')]('id\x20=\x20?',_0x2daabe[_0x74b3('0xb1')]['id'])['toParam']();return db[_0x74b3('0x72')][_0x74b3('0x2a')](_0x393b2f[_0x74b3('0x4f')],{'replacements':_0x393b2f[_0x74b3('0xbe')]});}})[_0x74b3('0x19')](function(){if(_0x2daabe['body']['phone']&&_0x445e37){return db[_0x74b3('0xbf')][_0x74b3('0x17')]({'phone':_0x2daabe[_0x74b3('0x8a')][_0x74b3('0xc0')],'OrderBy':0x0},{'where':{'ContactId':_0x445e37['id']}});}})[_0x74b3('0x19')](function(){return _0x445e37;})[_0x74b3('0x19')](respondWithResult(_0x52bb93,null))[_0x74b3('0x82')](handleError(_0x52bb93,null));};exports[_0x74b3('0xc1')]=function(_0x56f32d,_0x1ec836){var _0x57b039={};var _0xd7db51={};var _0xcb9a53;var _0x4142b2;return db[_0x74b3('0x20')][_0x74b3('0x25')]({'where':{'id':_0x56f32d[_0x74b3('0xb1')]['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x1ec836,null))[_0x74b3('0x19')](function(_0x105fa3){if(_0x105fa3){_0xcb9a53=_0x105fa3;_0xd7db51['model']=_[_0x74b3('0x21')](db[_0x74b3('0x45')][_0x74b3('0xc2')]);_0xd7db51[_0x74b3('0x2a')]=_['keys'](_0x56f32d['query']);_0xd7db51[_0x74b3('0x32')]=_[_0x74b3('0x2b')](_0xd7db51[_0x74b3('0x2c')],_0xd7db51[_0x74b3('0x2a')]);_0x57b039[_0x74b3('0x2e')]=_[_0x74b3('0x2b')](_0xd7db51[_0x74b3('0x2c')],qs[_0x74b3('0x2d')](_0x56f32d[_0x74b3('0x2a')][_0x74b3('0x2d')]));_0x57b039['attributes']=_0x57b039['attributes'][_0x74b3('0x22')]?_0x57b039[_0x74b3('0x2e')]:_0xd7db51[_0x74b3('0x2c')];_0x57b039['order']=qs[_0x74b3('0x30')](_0x56f32d['query'][_0x74b3('0x30')]);_0x57b039[_0x74b3('0x31')]=qs['filters'](_['pick'](_0x56f32d['query'],_0xd7db51[_0x74b3('0x32')]));if(_0x56f32d[_0x74b3('0x2a')][_0x74b3('0x51')]){_0x57b039[_0x74b3('0x31')]=_[_0x74b3('0x75')](_0x57b039[_0x74b3('0x31')],{'$or':_['map'](_0x57b039[_0x74b3('0x2e')],function(_0x2ee0b8){var _0x4088bf={};_0x4088bf[_0x2ee0b8]={'$like':'%'+_0x56f32d[_0x74b3('0x2a')]['filter']+'%'};return _0x4088bf;})});}_0x57b039=_[_0x74b3('0x75')]({},_0x57b039,_0x56f32d[_0x74b3('0xc3')]);return _0xcb9a53[_0x74b3('0xc1')](_0x57b039);}})[_0x74b3('0x19')](function(_0x5dd67e){if(_0x5dd67e){_0x4142b2=_0x5dd67e['length'];if(!_0x56f32d[_0x74b3('0x2a')][_0x74b3('0x2f')](_0x74b3('0xc4'))){_0x57b039[_0x74b3('0x11')]=qs[_0x74b3('0x11')](_0x56f32d[_0x74b3('0x2a')]['limit']);_0x57b039[_0x74b3('0x10')]=qs[_0x74b3('0x10')](_0x56f32d['query'][_0x74b3('0x10')]);}return _0xcb9a53[_0x74b3('0xc1')](_0x57b039);}})[_0x74b3('0x19')](function(_0x461a38){if(_0x461a38){return _0x461a38?{'count':_0x4142b2,'rows':_0x461a38}:null;}})[_0x74b3('0x19')](respondWithResult(_0x1ec836,null))[_0x74b3('0x82')](handleError(_0x1ec836,null));};exports[_0x74b3('0xc5')]=function(_0x308a2e,_0x1ade31){if(_0x308a2e['body']['id']){delete _0x308a2e[_0x74b3('0x8a')]['id'];}return db[_0x74b3('0x20')][_0x74b3('0x25')]({'where':{'id':_0x308a2e[_0x74b3('0xb1')]['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x1ade31,null))[_0x74b3('0x19')](function(_0x2fb34c){if(_0x2fb34c){return _0x2fb34c[_0x74b3('0xc5')](_0x308a2e[_0x74b3('0x8a')][_0x74b3('0xc6')]||[]);}return null;})[_0x74b3('0x19')](respondWithResult(_0x1ade31,null))[_0x74b3('0x82')](handleError(_0x1ade31,null));};exports[_0x74b3('0xc7')]=function(_0x121ed4,_0x46d3ec){var _0x892170=[];_0x892170[_0x74b3('0x80')](addAdditionalPhones(_0x121ed4[_0x74b3('0x8a')]));Promise[_0x74b3('0x27')](_0x892170)['then'](function(){_0x892170=[];_0x892170['push'](deleteCmHopperPhones(_0x121ed4[_0x74b3('0x8a')]['id']));_0x892170[_0x74b3('0x80')](addCmHopperPhones(_0x121ed4['body']['id']));Promise['all'](_0x892170)[_0x74b3('0x19')](function(){return[0x1];})[_0x74b3('0x19')](respondWithResult(_0x46d3ec,null));});};function addAdditionalPhones(_0x44abd4){var _0x1d4eb8;return new Promise(function(_0x4a8b52,_0x3d448e){return db[_0x74b3('0x9b')][_0x74b3('0x18')]({'where':{'CmContactId':_0x44abd4['id']}})[_0x74b3('0x19')](function(){db['ContactItemType'][_0x74b3('0x88')]({'raw':!![],'attributes':['id',_0x74b3('0xc8')]})[_0x74b3('0x19')](function(_0x3c3689){var _0x1a50e5=[];for(var _0x32ce40=0x0;_0x32ce40<_0x44abd4[_0x74b3('0xc9')][_0x74b3('0x22')];_0x32ce40++){var _0x1566c4=_0x44abd4['item_types']?_['isNil'](_0x44abd4[_0x74b3('0xca')][_0x32ce40])?'':_0x44abd4[_0x74b3('0xca')][_0x32ce40]:_0x44abd4[_0x74b3('0xc9')][_0x32ce40][_0x74b3('0xcb')]?_0x44abd4['items'][_0x32ce40]['ItemTypeId']:'';var _0x462517=_[_0x74b3('0xa6')](_0x44abd4[_0x74b3('0xc9')][_0x32ce40][_0x74b3('0xcc')])?'':_0x44abd4[_0x74b3('0xc9')][_0x32ce40][_0x74b3('0xcc')];var _0x4d2c65=_0x1566c4+':'+_0x44abd4['items'][_0x32ce40][_0x74b3('0xc0')]+'§'+_0x462517;if(_[_0x74b3('0xa6')](_0x1d4eb8))_0x1d4eb8=_0x4d2c65;else _0x1d4eb8+=';'+_0x4d2c65;var _0x1983e5=null;if(_0x44abd4['item_types']){if(!_[_0x74b3('0xa6')](_0x44abd4[_0x74b3('0xca')][_0x32ce40])){var _0x45d29c=_[_0x74b3('0x44')](_0x3c3689,function(_0x9dca51){return _0x9dca51['id']===_0x44abd4[_0x74b3('0xca')][_0x32ce40];});if(!_[_0x74b3('0xa6')](_0x45d29c)){_0x1983e5=_0x45d29c[_0x74b3('0xc8')];}}}else{if(!_['isNil'](_0x44abd4[_0x74b3('0xc9')][_0x32ce40])){var _0x45d29c=_[_0x74b3('0x44')](_0x3c3689,function(_0x65720a){return _0x65720a['id']===_0x44abd4['items'][_0x32ce40][_0x74b3('0xcb')];});if(!_[_0x74b3('0xa6')](_0x45d29c)){_0x1983e5=_0x32ce40;}}}if(_[_0x74b3('0xa6')](_0x1983e5)){_0x1983e5=0x64;}_0x1a50e5['push'](addAdditionalPhone(_0x44abd4['id'],_0x44abd4['items'][_0x32ce40][_0x74b3('0xc0')],_0x44abd4[_0x74b3('0xca')]?_[_0x74b3('0xa6')](_0x44abd4[_0x74b3('0xca')][_0x32ce40])?null:_0x44abd4[_0x74b3('0xca')][_0x32ce40]:_0x44abd4[_0x74b3('0xc9')][_0x32ce40]['ItemTypeId']?_0x44abd4['items'][_0x32ce40][_0x74b3('0xcb')]:null,_0x1983e5,_0x462517));}Promise[_0x74b3('0x27')](_0x1a50e5)[_0x74b3('0x19')](function(){db[_0x74b3('0x20')][_0x74b3('0x17')]({'AdditionalPhones':_0x1d4eb8},{'where':{'id':_0x44abd4['id']}})[_0x74b3('0x19')](function(){_0x4a8b52(0x1);});});});});});}function addAdditionalPhone(_0x440120,_0x58cc0f,_0x3ef1fb,_0x855a71,_0x2655b8){return db[_0x74b3('0x9b')][_0x74b3('0x44')]({'where':{'CmContactId':_0x440120,'item':_0x58cc0f}})['then'](function(_0xb1ccd0){if(_0xb1ccd0)logger[_0x74b3('0x8d')](_0x74b3('0xcd'),_0xb1ccd0);else{db[_0x74b3('0x9b')][_0x74b3('0x92')]({'CmContactId':_0x440120,'item':_0x58cc0f,'ItemTypeId':_0x3ef1fb,'OrderBy':_0x855a71,'ItemClass':'PHONE','description':_0x2655b8});}});}function deletePhones(_0x401eb5){return db[_0x74b3('0x9b')][_0x74b3('0x18')]({'where':{'CmContactId':_0x401eb5}});}function deleteCmHopperPhones(_0x59c0fc){return new Promise(function(_0x184a82,_0x4232a0){return db[_0x74b3('0xbf')][_0x74b3('0x88')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x59c0fc}})[_0x74b3('0x19')](function(_0x55caee){db[_0x74b3('0xce')][_0x74b3('0x18')]({'where':{'CmHopperId':{'$in':_[_0x74b3('0x50')](_0x55caee,'id')}}});})['then'](function(){_0x184a82(0x1);});});}function addCmHopperPhones(_0x392847){return new Promise(function(_0xc29600,_0x3d2a5b){return db[_0x74b3('0xbf')][_0x74b3('0x88')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x392847}})['then'](function(_0xe72ed3){var _0x427410=[];_[_0x74b3('0x50')](_0xe72ed3,function(_0x270ad1){_0x427410[_0x74b3('0x80')](createCmHopperPhone(_0x392847,_0x270ad1['id']));});Promise[_0x74b3('0x27')](_0x427410)['then'](function(){_0xc29600(0x1);});});});}function createCmHopperPhone(_0x2ba93c,_0x4a2b13){return new Promise(function(_0x1676c5,_0x5586cf){db[_0x74b3('0x9b')][_0x74b3('0x88')]({'raw':!![],'attributes':[_0x74b3('0xcf'),_0x74b3('0xc8')],'where':{'CmContactId':_0x2ba93c,'ItemClass':_0x74b3('0xd0')},'include':[{'model':db[_0x74b3('0xb4')],'attributes':['OrderBy'],'as':_0x74b3('0xd1')}],'order':[_0x74b3('0xc8'),db[_0x74b3('0x72')][_0x74b3('0xb5')](_0x74b3('0xd2'))]})[_0x74b3('0x19')](function(_0x218e46){var _0x5b669f=0x1;var _0x28c48b=_[_0x74b3('0x50')](_0x218e46,function(_0xef90a){_0xef90a[_0x74b3('0xd3')]=_0x4a2b13;_0xef90a[_0x74b3('0xc0')]=_0xef90a[_0x74b3('0xcf')];_0xef90a[_0x74b3('0xc8')]=_0x5b669f;delete _0xef90a[_0x74b3('0xd4')];_0x5b669f=_0x5b669f+0x1;return _0xef90a;});return db['CmHopperAdditionalPhone'][_0x74b3('0xaa')](_0x28c48b,{});})['then'](function(){_0x1676c5(0x1);});});}function insertAdditionalPhones(_0x31ad78,_0x5eb2d7){return new Promise(function(_0x29a673,_0x58356e){var _0x2d35ba=[];for(var _0xeb1ab0=0x0;_0xeb1ab0<_0x5eb2d7[_0x74b3('0x22')];_0xeb1ab0++){var _0x1d0f15=_0x5eb2d7[_0xeb1ab0];_0x2d35ba['push'](parseContactItemType(_0x1d0f15));}Promise[_0x74b3('0x27')](_0x2d35ba)[_0x74b3('0x19')](function(){var _0x46a2ce={'id':_0x31ad78['id'],'items':_0x5eb2d7};return addAdditionalPhones(_0x46a2ce)[_0x74b3('0x19')](function(_0x3cf0b0){return addCmHopperPhones(_0x31ad78['id']);});})[_0x74b3('0x19')](function(){_0x29a673(_0x31ad78);});});}function parseContactItemType(_0x5d4f78){return new Promise(function(_0x3cb86d,_0xed7257){if(_0x5d4f78['hasOwnProperty'](_0x74b3('0xcb'))){_0x3cb86d(_0x5d4f78);}else{return db[_0x74b3('0xb4')][_0x74b3('0x44')]({'where':{'name':_0x5d4f78[_0x74b3('0xd1')]}})['then'](function(_0x33b338){if(_['isNil'](_0x33b338))_0x5d4f78[_0x74b3('0xcb')]=null;else _0x5d4f78[_0x74b3('0xcb')]=_0x33b338['id'];_0x3cb86d(_0x5d4f78);});}});}exports['getAdditionalPhones']=function(_0x4a6a61,_0x20c8b3){return db[_0x74b3('0x9b')][_0x74b3('0x88')]({'raw':!![],'where':{'CmContactId':_0x4a6a61[_0x74b3('0xb1')]['id'],'ItemClass':_0x74b3('0xd0')},'include':[{'model':db[_0x74b3('0xb4')],'as':_0x74b3('0xd1')}],'order':[[_0x74b3('0xc8')],[db[_0x74b3('0x72')][_0x74b3('0xb5')](_0x74b3('0xd2'))]]})[_0x74b3('0x19')](function(_0x549928){return _0x549928;})[_0x74b3('0x19')](respondWithResult(_0x20c8b3,null))[_0x74b3('0x82')](handleError(_0x20c8b3,null));};exports[_0x74b3('0xd5')]=function(_0x4f49d1,_0x3749de){return db[_0x74b3('0x9b')][_0x74b3('0x88')]({'raw':!![],'where':{'CmContactId':_0x4f49d1['body'][_0x74b3('0xd6')]}})[_0x74b3('0x19')](function(_0x37d4ad){var _0x57e67b=_['map'](_0x37d4ad,function(_0x3d28b8){_0x3d28b8[_0x74b3('0xd7')]=_0x4f49d1[_0x74b3('0x8a')][_0x74b3('0xd8')];return _0x3d28b8;});return db[_0x74b3('0x9b')]['bulkCreate'](_0x57e67b,{});})[_0x74b3('0x19')](function(_0x1fe6ca){return addCmHopperPhones(_0x4f49d1[_0x74b3('0x8a')][_0x74b3('0xd8')]);})[_0x74b3('0x19')](function(_0xf5bb78){return['ok'];})['then'](respondWithResult(_0x3749de,null))[_0x74b3('0x82')](handleError(_0x3749de,null));};exports[_0x74b3('0xd9')]=function(_0x35efad,_0x252a97){var _0x586b2f=[];_0x586b2f['push'](createCmHopperPhone(_0x35efad['body']['id'],_0x35efad[_0x74b3('0x8a')][_0x74b3('0xda')]));Promise['all'](_0x586b2f)[_0x74b3('0x19')](function(){return[0x1];})['then'](respondWithResult(_0x252a97,null));};exports[_0x74b3('0xdb')]=function(_0x57dc86,_0x5ab5c9){var _0x159087={'raw':![],'where':{}};var _0x5dc3d2={};var _0x19e223={'count':0x0,'rows':[]};return db[_0x74b3('0x20')]['findOne']({'where':{'id':_0x57dc86['params']['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x5ab5c9,null))[_0x74b3('0x19')](function(_0x435f5c){if(_0x435f5c){_0x5dc3d2['model']=_[_0x74b3('0x21')](db[_0x74b3('0xbf')]['rawAttributes']);_0x5dc3d2['query']=_[_0x74b3('0x21')](_0x57dc86[_0x74b3('0x2a')]);_0x5dc3d2[_0x74b3('0x32')]=_[_0x74b3('0x2b')](_0x5dc3d2[_0x74b3('0x2c')],_0x5dc3d2['query']);_0x159087[_0x74b3('0x2e')]=_[_0x74b3('0x2b')](_0x5dc3d2['model'],qs[_0x74b3('0x2d')](_0x57dc86['query']['fields']));_0x159087['attributes']=_0x159087[_0x74b3('0x2e')][_0x74b3('0x22')]?_0x159087[_0x74b3('0x2e')]:_0x5dc3d2[_0x74b3('0x2c')];if(!_0x57dc86[_0x74b3('0x2a')][_0x74b3('0x2f')](_0x74b3('0xc4'))){_0x159087[_0x74b3('0x11')]=qs[_0x74b3('0x11')](_0x57dc86[_0x74b3('0x2a')][_0x74b3('0x11')]);_0x159087[_0x74b3('0x10')]=qs[_0x74b3('0x10')](_0x57dc86['query']['offset']);}_0x159087[_0x74b3('0x67')]=qs['sort'](_0x57dc86[_0x74b3('0x2a')][_0x74b3('0x30')]);_0x159087[_0x74b3('0x31')]=qs['filters'](_[_0x74b3('0x33')](_0x57dc86[_0x74b3('0x2a')],_0x5dc3d2[_0x74b3('0x32')]));_0x159087[_0x74b3('0x31')]['ContactId']=_0x435f5c['id'];if(_0x57dc86[_0x74b3('0x2a')][_0x74b3('0x51')]){_0x159087[_0x74b3('0x31')]=_['merge'](_0x159087[_0x74b3('0x31')],{'$or':_[_0x74b3('0x50')](_0x159087[_0x74b3('0x2e')],function(_0x2d1126){var _0x30e733={};_0x30e733[_0x2d1126]={'$like':'%'+_0x57dc86[_0x74b3('0x2a')][_0x74b3('0x51')]+'%'};return _0x30e733;})});}_0x159087=_[_0x74b3('0x75')]({},_0x159087,_0x57dc86[_0x74b3('0xc3')]);return db['CmHopper']['count']({'where':_0x159087[_0x74b3('0x31')]})[_0x74b3('0x19')](function(_0x3714db){_0x19e223[_0x74b3('0x13')]=_0x3714db;if(_0x57dc86[_0x74b3('0x2a')][_0x74b3('0xdc')]){_0x159087[_0x74b3('0xdd')]=[{'all':!![]}];}return db[_0x74b3('0xbf')]['findAll'](_0x159087);})['then'](function(_0x3101d9){_0x19e223[_0x74b3('0x81')]=_0x3101d9;return _0x19e223;});}})[_0x74b3('0x19')](respondWithFilteredResult(_0x5ab5c9,_0x159087))[_0x74b3('0x82')](handleError(_0x5ab5c9,null));};exports[_0x74b3('0xde')]=function(_0xc8193c,_0x3e8e75){var _0x33fc76={'raw':!![],'where':{}};var _0x2604fd={};var _0x43616d={'count':0x0,'rows':[]};return db[_0x74b3('0x20')][_0x74b3('0x25')]({'where':{'id':_0xc8193c[_0x74b3('0xb1')]['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x3e8e75,null))[_0x74b3('0x19')](function(_0x4c1d70){if(_0x4c1d70){_0x2604fd[_0x74b3('0x2c')]=_[_0x74b3('0x21')](db[_0x74b3('0x9d')][_0x74b3('0xc2')]);_0x2604fd[_0x74b3('0x2a')]=_[_0x74b3('0x21')](_0xc8193c['query']);_0x2604fd[_0x74b3('0x32')]=_[_0x74b3('0x2b')](_0x2604fd['model'],_0x2604fd[_0x74b3('0x2a')]);_0x33fc76['attributes']=_[_0x74b3('0x2b')](_0x2604fd['model'],qs[_0x74b3('0x2d')](_0xc8193c[_0x74b3('0x2a')][_0x74b3('0x2d')]));_0x33fc76[_0x74b3('0x2e')]=_0x33fc76[_0x74b3('0x2e')][_0x74b3('0x22')]?_0x33fc76[_0x74b3('0x2e')]:_0x2604fd[_0x74b3('0x2c')];if(!_0xc8193c['query'][_0x74b3('0x2f')]('nolimit')){_0x33fc76[_0x74b3('0x11')]=qs['limit'](_0xc8193c['query']['limit']);_0x33fc76[_0x74b3('0x10')]=qs['offset'](_0xc8193c[_0x74b3('0x2a')][_0x74b3('0x10')]);}_0x33fc76['order']=qs[_0x74b3('0x30')](_0xc8193c[_0x74b3('0x2a')]['sort']);_0x33fc76[_0x74b3('0x31')]=qs[_0x74b3('0x32')](_[_0x74b3('0x33')](_0xc8193c[_0x74b3('0x2a')],_0x2604fd['filters']));_0x33fc76[_0x74b3('0x31')]['ContactId']=_0x4c1d70['id'];if(_0xc8193c['query']['filter']){_0x33fc76[_0x74b3('0x31')]=_[_0x74b3('0x75')](_0x33fc76[_0x74b3('0x31')],{'$or':_[_0x74b3('0x50')](_0x33fc76[_0x74b3('0x2e')],function(_0x48a66a){var _0x13e65d={};_0x13e65d[_0x48a66a]={'$like':'%'+_0xc8193c[_0x74b3('0x2a')][_0x74b3('0x51')]+'%'};return _0x13e65d;})});}_0x33fc76=_[_0x74b3('0x75')]({},_0x33fc76,_0xc8193c[_0x74b3('0xc3')]);return db[_0x74b3('0x9d')][_0x74b3('0x13')]({'where':_0x33fc76[_0x74b3('0x31')]})[_0x74b3('0x19')](function(_0xc09cca){_0x43616d[_0x74b3('0x13')]=_0xc09cca;if(_0xc8193c[_0x74b3('0x2a')][_0x74b3('0xdc')]){_0x33fc76[_0x74b3('0xdd')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x74b3('0x88')](_0x33fc76);})[_0x74b3('0x19')](function(_0x1e1365){_0x43616d[_0x74b3('0x81')]=_0x1e1365;return _0x43616d;});}})[_0x74b3('0x19')](respondWithFilteredResult(_0x3e8e75,_0x33fc76))['catch'](handleError(_0x3e8e75,null));};exports[_0x74b3('0xdf')]=function(_0x27d306,_0x2d1456){var _0x394f1e={'raw':!![],'where':{}};var _0x5554f5={};var _0x10ffb2={'count':0x0,'rows':[]};return db[_0x74b3('0x20')][_0x74b3('0x25')]({'where':{'id':_0x27d306[_0x74b3('0xb1')]['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x2d1456,null))[_0x74b3('0x19')](function(_0x11a73e){if(_0x11a73e){_0x5554f5[_0x74b3('0x2c')]=_[_0x74b3('0x21')](db[_0x74b3('0x9c')][_0x74b3('0xc2')]);_0x5554f5[_0x74b3('0x2a')]=_['keys'](_0x27d306[_0x74b3('0x2a')]);_0x5554f5['filters']=_[_0x74b3('0x2b')](_0x5554f5['model'],_0x5554f5[_0x74b3('0x2a')]);_0x394f1e[_0x74b3('0x2e')]=_['intersection'](_0x5554f5['model'],qs['fields'](_0x27d306[_0x74b3('0x2a')][_0x74b3('0x2d')]));_0x394f1e['attributes']=_0x394f1e[_0x74b3('0x2e')][_0x74b3('0x22')]?_0x394f1e[_0x74b3('0x2e')]:_0x5554f5['model'];if(!_0x27d306[_0x74b3('0x2a')][_0x74b3('0x2f')](_0x74b3('0xc4'))){_0x394f1e[_0x74b3('0x11')]=qs[_0x74b3('0x11')](_0x27d306[_0x74b3('0x2a')][_0x74b3('0x11')]);_0x394f1e[_0x74b3('0x10')]=qs[_0x74b3('0x10')](_0x27d306[_0x74b3('0x2a')][_0x74b3('0x10')]);}_0x394f1e[_0x74b3('0x67')]=qs['sort'](_0x27d306[_0x74b3('0x2a')][_0x74b3('0x30')]);_0x394f1e['where']=qs[_0x74b3('0x32')](_[_0x74b3('0x33')](_0x27d306[_0x74b3('0x2a')],_0x5554f5[_0x74b3('0x32')]));_0x394f1e[_0x74b3('0x31')][_0x74b3('0xe0')]=_0x11a73e['id'];if(_0x27d306[_0x74b3('0x2a')]['filter']){_0x394f1e['where']=_['merge'](_0x394f1e[_0x74b3('0x31')],{'$or':_[_0x74b3('0x50')](_0x394f1e[_0x74b3('0x2e')],function(_0x40b763){var _0x2f7227={};_0x2f7227[_0x40b763]={'$like':'%'+_0x27d306[_0x74b3('0x2a')][_0x74b3('0x51')]+'%'};return _0x2f7227;})});}_0x394f1e=_[_0x74b3('0x75')]({},_0x394f1e,_0x27d306[_0x74b3('0xc3')]);return db[_0x74b3('0x9c')][_0x74b3('0x13')]({'where':_0x394f1e[_0x74b3('0x31')]})[_0x74b3('0x19')](function(_0x4c1799){_0x10ffb2[_0x74b3('0x13')]=_0x4c1799;if(_0x27d306['query'][_0x74b3('0xdc')]){_0x394f1e[_0x74b3('0xdd')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x74b3('0x88')](_0x394f1e);})['then'](function(_0x5f298e){_0x10ffb2[_0x74b3('0x81')]=_0x5f298e;return _0x10ffb2;});}})[_0x74b3('0x19')](respondWithFilteredResult(_0x2d1456,_0x394f1e))['catch'](handleError(_0x2d1456,null));};exports['getJscriptySessions']=function(_0x341c10,_0x90a818){var _0x4fde4d={'raw':!![],'where':{}};var _0x39e806={};var _0x12f93a={'count':0x0,'rows':[]};return db[_0x74b3('0x20')][_0x74b3('0x25')]({'where':{'id':_0x341c10[_0x74b3('0xb1')]['id']}})[_0x74b3('0x19')](handleEntityNotFound(_0x90a818,null))['then'](function(_0x483cd8){if(_0x483cd8){_0x39e806['model']=_[_0x74b3('0x21')](db[_0x74b3('0xe1')][_0x74b3('0xc2')]);_0x39e806[_0x74b3('0x2a')]=_['keys'](_0x341c10[_0x74b3('0x2a')]);_0x39e806[_0x74b3('0x32')]=_[_0x74b3('0x2b')](_0x39e806['model'],_0x39e806[_0x74b3('0x2a')]);_0x4fde4d[_0x74b3('0x2e')]=_[_0x74b3('0x2b')](_0x39e806[_0x74b3('0x2c')],qs[_0x74b3('0x2d')](_0x341c10[_0x74b3('0x2a')]['fields']));_0x4fde4d[_0x74b3('0x2e')]=_0x4fde4d[_0x74b3('0x2e')][_0x74b3('0x22')]?_0x4fde4d[_0x74b3('0x2e')]:_0x39e806['model'];if(!_0x341c10[_0x74b3('0x2a')][_0x74b3('0x2f')](_0x74b3('0xc4'))){_0x4fde4d['limit']=qs['limit'](_0x341c10[_0x74b3('0x2a')][_0x74b3('0x11')]);_0x4fde4d[_0x74b3('0x10')]=qs['offset'](_0x341c10[_0x74b3('0x2a')][_0x74b3('0x10')]);}_0x4fde4d['order']=qs['sort'](_0x341c10['query'][_0x74b3('0x30')]);_0x4fde4d['where']=qs[_0x74b3('0x32')](_[_0x74b3('0x33')](_0x341c10['query'],_0x39e806[_0x74b3('0x32')]));_0x4fde4d[_0x74b3('0x31')][_0x74b3('0xe0')]=_0x483cd8['id'];if(_0x341c10[_0x74b3('0x2a')][_0x74b3('0x51')]){_0x4fde4d[_0x74b3('0x31')]=_[_0x74b3('0x75')](_0x4fde4d[_0x74b3('0x31')],{'$or':_['map'](_0x4fde4d[_0x74b3('0x2e')],function(_0x28065e){var _0x119db9={};_0x119db9[_0x28065e]={'$like':'%'+_0x341c10[_0x74b3('0x2a')][_0x74b3('0x51')]+'%'};return _0x119db9;})});}_0x4fde4d=_[_0x74b3('0x75')]({},_0x4fde4d,_0x341c10['options']);return db[_0x74b3('0xe1')]['count']({'where':_0x4fde4d[_0x74b3('0x31')]})[_0x74b3('0x19')](function(_0x3ed19b){_0x12f93a[_0x74b3('0x13')]=_0x3ed19b;if(_0x341c10['query'][_0x74b3('0xdc')]){_0x4fde4d[_0x74b3('0xdd')]=[{'all':!![]}];}return db[_0x74b3('0xe1')]['findAll'](_0x4fde4d);})[_0x74b3('0x19')](function(_0x1a5702){_0x12f93a[_0x74b3('0x81')]=_0x1a5702;return _0x12f93a;});}})['then'](respondWithFilteredResult(_0x90a818,_0x4fde4d))[_0x74b3('0x82')](handleError(_0x90a818,null));};exports['uploadCsv']=function(_0x4aa08d,_0x6b204f){try{if(!_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0x54')]){throw new Error(_0x74b3('0xe2'));}if(!_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0xe3')]){throw new Error(_0x74b3('0xe4'));}if(!_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0xe5')]){throw new Error(_0x74b3('0xe6'));}if(!_0x4aa08d[_0x74b3('0x8a')]['socket_timestamp']){throw new Error(_0x74b3('0xe7'));}var _0x5b530c=_0x4aa08d['body'][_0x74b3('0xe3')]['split'](',');var _0x23ae22=_0x4aa08d['body']['binding_values'][_0x74b3('0x46')](',');if(!_0x5b530c[_0x74b3('0x22')]||!_0x23ae22[_0x74b3('0x22')]||_0x5b530c['length']!==_0x23ae22['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x4aa08d[_0x74b3('0x8a')]['fields']=_[_0x74b3('0xe8')](_0x5b530c,_0x23ae22);if(!_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0x2d')][_0x74b3('0xc0')]){throw new Error(_0x74b3('0xe9'));}if(!_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0x2d')][_0x74b3('0xea')]){throw new Error(_0x74b3('0xeb'));}var _0x44e78e=path['join'](config[_0x74b3('0xec')],_0x74b3('0xed'),_0x4aa08d[_0x74b3('0xee')]['filename']);fs[_0x74b3('0xef')](_0x44e78e,parseInt('0777',0x8));var _0x2aa854=require(_0x74b3('0xf0'))[_0x74b3('0xf1')](path['join'](__dirname,_0x74b3('0xf2')),[_0x44e78e,_0x4aa08d[_0x74b3('0x8a')]['binding_keys'],_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0xe5')],_0x4aa08d['body'][_0x74b3('0x54')],_0x4aa08d['body'][_0x74b3('0xf3')],_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0xac')],_0x4aa08d[_0x74b3('0x8a')][_0x74b3('0xf4')]]);return _0x6b204f[_0x74b3('0x14')](0xc8)[_0x74b3('0x16')]({'message':_0x74b3('0xf5'),'pid':_0x2aa854[_0x74b3('0xf6')]});}catch(_0x39b1ff){return _0x6b204f[_0x74b3('0x14')](0x1f4)[_0x74b3('0x1e')](_0x39b1ff);}};exports[_0x74b3('0xf7')]=function(_0x3139c2,_0x453a76){var _0x14abfc=fs['createReadStream'](_0x3139c2[_0x74b3('0xee')][_0x74b3('0x2')]);Papa[_0x74b3('0xf8')](_0x14abfc,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x14c703){return _0x453a76['status'](0xc8)[_0x74b3('0x16')]({'file':_0x3139c2[_0x74b3('0xee')],'fields':_0x14c703[_0x74b3('0xf9')]['fields']});}});};exports[_0x74b3('0xfa')]=function(_0x4d7d46,_0x1ecbe1){return db[_0x74b3('0x49')][_0x74b3('0x88')]({'raw':!![],'attributes':['id'],'where':{'role':_0x74b3('0x6d')}})['then'](function(_0x1cc783){var _0x4eefb7=![];if(!_0x4d7d46[_0x74b3('0x8a')][_0x74b3('0x54')]){throw new Error('No\x20ListId\x20specified');}if(!_0x4d7d46[_0x74b3('0x8a')][_0x74b3('0xfb')][_0x74b3('0xc0')]){throw new Error(_0x74b3('0xe9'));}if(!_0x4d7d46['body'][_0x74b3('0xfb')][_0x74b3('0xea')]){throw new Error(_0x74b3('0xeb'));}if(!_0x4d7d46[_0x74b3('0x8a')][_0x74b3('0xf4')]){throw new Error(_0x74b3('0xe7'));}var _0x5c499f=require(_0x74b3('0xf0'))[_0x74b3('0xf1')](path[_0x74b3('0x8c')](__dirname,_0x74b3('0xfc')),[_0x4d7d46[_0x74b3('0xb1')]['id'],JSON[_0x74b3('0xfd')](_0x4d7d46[_0x74b3('0x8a')]),JSON['stringify'](_0x1cc783)]);_0x5c499f['on'](_0x74b3('0xfe'),function(){_0x4eefb7=!![];return _0x1ecbe1['status'](0xc8)[_0x74b3('0x16')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x5c499f[_0x74b3('0xf6')]});});_0x5c499f['on'](_0x74b3('0xff'),function(_0x1d219d){if(_0x1d219d&&!_0x4eefb7){return _0x1ecbe1[_0x74b3('0x14')](0x1f4)['json']({'message':_0x74b3('0x100'),'pid':_0x5c499f[_0x74b3('0xf6')]});}});})[_0x74b3('0x82')](handleError(_0x1ecbe1,null));};exports[_0x74b3('0x101')]=function(_0x27bda9,_0xba6593,_0x58cbb4){return db[_0x74b3('0x49')][_0x74b3('0x88')]({'raw':!![],'attributes':['id'],'where':{'role':_0x74b3('0x6d')}})['then'](function(_0x652161){var _0x8e5721=![];if(!_0x27bda9['body']['ListId']){throw new Error(_0x74b3('0xe2'));}if(!_0x27bda9['body']['binding'][_0x74b3('0xc0')]){throw new Error(_0x74b3('0xe9'));}if(!_0x27bda9[_0x74b3('0x8a')]['binding'][_0x74b3('0xea')]){throw new Error(_0x74b3('0xeb'));}if(!_0x27bda9[_0x74b3('0x8a')][_0x74b3('0xf4')]){throw new Error(_0x74b3('0xe7'));}var _0x43db3d=require(_0x74b3('0xf0'))[_0x74b3('0xf1')](path['join'](__dirname,_0x74b3('0x102')),[_0x27bda9[_0x74b3('0xb1')]['id'],JSON['stringify'](_0x27bda9[_0x74b3('0x8a')]),JSON[_0x74b3('0xfd')](_0x652161)]);_0x43db3d['on'](_0x74b3('0xfe'),function(_0x365a03){_0x8e5721=!![];return _0xba6593[_0x74b3('0x14')](0xc8)[_0x74b3('0x16')]({'message':_0x74b3('0x103'),'pid':_0x43db3d[_0x74b3('0xf6')]});});_0x43db3d['on']('exit',function(_0x155acb){if(_0x155acb&&!_0x8e5721){return _0xba6593['status'](0x1f4)['json']({'message':_0x74b3('0x100'),'pid':_0x43db3d[_0x74b3('0xf6')]});}});})[_0x74b3('0x82')](handleError(_0xba6593,null));};exports[_0x74b3('0x104')]=function(_0x50e1ea,_0x5068e4){var _0x4e6008=[_0x74b3('0x105'),_0x74b3('0x106'),_0x74b3('0x107'),_0x74b3('0x108'),'fax',_0x74b3('0x109'),_0x74b3('0x10a')];var _0x41721d={'offset':0x0,'order':qs[_0x74b3('0x30')](_0x74b3('0x10b'))},_0x1ecb1f={'count':0x0,'rows':[]};Promise[_0x74b3('0x6a')]()[_0x74b3('0x19')](function(){if(_0x50e1ea['query'][_0x74b3('0x10c')]){if(!_[_0x74b3('0x10d')](_0x4e6008,_0x50e1ea[_0x74b3('0x2a')][_0x74b3('0x10c')][_0x74b3('0x10e')]())){throw new Error(_0x74b3('0x10f'));}_0x4e6008=[_0x50e1ea[_0x74b3('0x2a')]['channel']['toLowerCase']()];}if(_0x50e1ea[_0x74b3('0x2a')][_0x74b3('0x110')]){try{var _0x1237d2=JSON['parse'](_0x50e1ea[_0x74b3('0x2a')][_0x74b3('0x110')]);if(!moment(_0x1237d2['from'])[_0x74b3('0x111')]()){throw new Error(_0x74b3('0x112'));}if(!moment(_0x1237d2['to'])['isValid']()){throw new Error(_0x74b3('0x113'));}}catch(_0x444c50){throw new Error(_0x74b3('0x114'));}}if(!_0x50e1ea[_0x74b3('0x2a')]['hasOwnProperty']('nolimit')){_0x41721d['limit']=qs[_0x74b3('0x11')](_0x50e1ea['query'][_0x74b3('0x11')]||0xa);_0x41721d[_0x74b3('0x10')]=qs[_0x74b3('0x10')](_0x50e1ea[_0x74b3('0x2a')][_0x74b3('0x10')]);}var _0x59ac05=_0x4e6008[_0x74b3('0x50')](function(_0x17e05b){if(_0x17e05b==='voice'){var _0x562e7b={'attributes':['id',_0x74b3('0x115'),_0x74b3('0x116'),_0x74b3('0x117'),_0x74b3('0x118'),_0x74b3('0x119'),_0x74b3('0x11a'),'endtime',_0x74b3('0x11b'),_0x74b3('0x11c'),_0x74b3('0x11d'),_0x74b3('0x11e'),_0x74b3('0x11f'),'userThirdDisposition',_0x74b3('0x120')],'where':{'ContactId':_0x50e1ea[_0x74b3('0xb1')]['id']},'include':[{'model':db[_0x74b3('0x49')],'as':_0x74b3('0x49'),'attributes':['id',_0x74b3('0xb2'),_0x74b3('0x121'),_0x74b3('0x122')]}],'order':[[_0x74b3('0x11d'),'DESC']]};if(_0x50e1ea[_0x74b3('0x2a')][_0x74b3('0x110')]){_0x562e7b['where'][_0x74b3('0x11d')]={'$gte':_0x1237d2['from'],'$lte':_0x1237d2['to']};}return db['VoiceCallReport'][_0x74b3('0x123')](_0x562e7b)['then'](function(_0x4c508f){_0x1ecb1f[_0x74b3('0x13')]+=_0x4c508f[_0x74b3('0x13')];return _[_0x74b3('0x50')](_0x4c508f[_0x74b3('0x81')],function(_0x86f713){var _0xf91540=_0x86f713['get']({'plain':!![]});_0xf91540[_0x74b3('0x10c')]=_0x17e05b;if(_0xf91540[_0x74b3('0x49')]){_0xf91540[_0x74b3('0x49')]={'id':_0xf91540[_0x74b3('0x49')]['id'],'name':_0xf91540[_0x74b3('0x49')][_0x74b3('0xb2')],'fullname':_0xf91540[_0x74b3('0x49')][_0x74b3('0x121')],'alias':_0xf91540[_0x74b3('0x49')][_0x74b3('0x122')]};}return _0xf91540;});});}else{var _0x2a9e10=_[_0x74b3('0x124')](_0x17e05b)+(_0x17e05b===_0x74b3('0x106')?_0x74b3('0x125'):_0x74b3('0x126'));var _0x3db1b8={'attributes':['id',_0x74b3('0x127'),_0x74b3('0x128'),_0x74b3('0x11d'),_0x74b3('0x11c'),_0x74b3('0x129'),_0x74b3('0x12a'),_0x74b3('0x12b'),_0x74b3('0x120'),_0x2a9e10+'Id'],'where':{'ContactId':_0x50e1ea['params']['id']},'include':[{'model':db[_0x2a9e10],'as':_0x74b3('0x126'),'attributes':['id',_0x74b3('0xb2'),_0x74b3('0x12c')]},{'model':db['User'],'as':_0x74b3('0x12d'),'attributes':['id',_0x74b3('0xb2'),_0x74b3('0x121')]},{'model':db[_0x74b3('0x45')],'as':_0x74b3('0x7f'),'attributes':['id','name',_0x74b3('0x36')],'through':{'attributes':[]}}],'order':[[_0x74b3('0x11d'),_0x74b3('0x68')]]};if(_0x50e1ea['query'][_0x74b3('0x110')]){_0x3db1b8['where']['createdAt']={'$gte':_0x1237d2['from'],'$lte':_0x1237d2['to']};}switch(_0x17e05b){case _0x74b3('0x106'):_0x3db1b8[_0x74b3('0x2e')][_0x74b3('0x80')](_0x74b3('0x12e'),_0x74b3('0x12f'),_0x74b3('0x130'),_0x74b3('0x131'),_0x74b3('0x132'),_0x74b3('0x133'),_0x74b3('0x134'),_0x74b3('0x135'),_0x74b3('0x136'));break;case _0x74b3('0x105'):_0x3db1b8['attributes'][_0x74b3('0x80')](_0x74b3('0x137'),'substatus');break;case _0x74b3('0x108'):_0x3db1b8[_0x74b3('0x2e')]['push'](_0x74b3('0x138'),'threadId');break;}return db[_[_0x74b3('0x124')](_0x17e05b)+_0x74b3('0x139')][_0x74b3('0x123')](_0x3db1b8)[_0x74b3('0x19')](function(_0x512f27){_0x1ecb1f['count']+=_0x512f27[_0x74b3('0x13')];return _['map'](_0x512f27[_0x74b3('0x81')],function(_0x2c77ba){var _0x14918c=_0x2c77ba[_0x74b3('0xb7')]({'plain':!![]});_0x14918c['channel']=_0x17e05b;if(_0x14918c['Owner']){_0x14918c[_0x74b3('0x12d')]={'id':_0x14918c['Owner']['id'],'name':_0x14918c[_0x74b3('0x12d')]['name'],'fullname':_0x14918c[_0x74b3('0x12d')][_0x74b3('0x121')]};}return _0x14918c;});});}});return Promise[_0x74b3('0x27')](_0x59ac05);})[_0x74b3('0x19')](function(_0x3f78a7){return _(_0x3f78a7)[_0x74b3('0x13a')]()[_0x74b3('0x13b')](_0x74b3('0x11d'))[_0x74b3('0x13c')]()[_0x74b3('0x4c')]();})[_0x74b3('0x19')](function(_0x1696b1){_0x1ecb1f[_0x74b3('0x81')]=_0x41721d[_0x74b3('0x11')]?_0x1696b1[_0x74b3('0x13d')](_0x41721d[_0x74b3('0x10')],_0x41721d[_0x74b3('0x10')]+_0x41721d[_0x74b3('0x11')]):_0x1696b1;return _0x1ecb1f;})[_0x74b3('0x19')](respondWithFilteredResult(_0x5068e4,_0x41721d))['catch'](handleError(_0x5068e4,null));}; \ No newline at end of file +var _0x9ebe=['closedAt','disposition','secondDisposition','key','Owner','customerPort','osName','ratingType','ratingValue','referer','subject','externalUrl','threadId','Interaction','reverse','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','error','name','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','field','from','select','uc.CmContactId\x20=\x20c.id','left_join','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','expr','search','parseSearch','conditions','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','value','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','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?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','resolve','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.phone','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','rows','catch','find','params','tags','columnName','analytics','findAll','displayName','custom','values','hasOwnProperty','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','findOrCreate','contact','show','color','ContactItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','pickBy','table','cm_contacts','id\x20=\x20?','toParam','phone','getTags','findOne','Tag','rawAttributes','options','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','item','ItemType','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','getHopperHistories','getHopperFinals','includeAll','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','socket_timestamp','pid','path','parse','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','fullname','findAndCountAll','alias','startCase','Website','Account'];(function(_0x3af7c4,_0x15dd29){var _0x2d357c=function(_0x266124){while(--_0x266124){_0x3af7c4['push'](_0x3af7c4['shift']());}};_0x2d357c(++_0x15dd29);}(_0x9ebe,0x13b));var _0xe9eb=function(_0x3e8cd5,_0x4bcf2d){_0x3e8cd5=_0x3e8cd5-0x0;var _0x4986a9=_0x9ebe[_0x3e8cd5];return _0x4986a9;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe9eb('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xe9eb('0x1'));var squel=require(_0xe9eb('0x2'));var Papa=require('papaparse');var Redis=require(_0xe9eb('0x3'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xe9eb('0x4'))(_0xe9eb('0x5'));var config=require(_0xe9eb('0x6'));var shared=require('../../config/environment/shared');var db=require(_0xe9eb('0x7'))['db'];config['redis']=_[_0xe9eb('0x8')](config[_0xe9eb('0x9')],{'host':_0xe9eb('0xa'),'port':0x18eb});var socket=require(_0xe9eb('0xb'))(new Redis(config['redis']));require(_0xe9eb('0xc'))[_0xe9eb('0xd')](socket);function respondWithResult(_0x3e547a,_0x37b301){_0x37b301=_0x37b301||0xc8;return function(_0x7a43ff){if(_0x7a43ff){return _0x3e547a[_0xe9eb('0xe')](_0x37b301)[_0xe9eb('0xf')](_0x7a43ff);}};}function respondWithFilteredResult(_0x4c318a,_0x313840){return function(_0x1fee1e){if(_0x1fee1e){var _0x5a7ab8=typeof _0x313840[_0xe9eb('0x10')]===_0xe9eb('0x11')&&typeof _0x313840[_0xe9eb('0x12')]===_0xe9eb('0x11');var _0x4f2c2e=_0x1fee1e[_0xe9eb('0x13')];var _0x4219a9=_0x5a7ab8?0x0:_0x313840['offset'];var _0x38eddc=_0x5a7ab8?_0x1fee1e[_0xe9eb('0x13')]:_0x313840[_0xe9eb('0x10')]+_0x313840[_0xe9eb('0x12')];var _0x562bd5;if(_0x38eddc>=_0x4f2c2e){_0x38eddc=_0x4f2c2e;_0x562bd5=0xc8;}else{_0x562bd5=0xce;}_0x4c318a[_0xe9eb('0xe')](_0x562bd5);return _0x4c318a['set'](_0xe9eb('0x14'),_0x4219a9+'-'+_0x38eddc+'/'+_0x4f2c2e)[_0xe9eb('0xf')](_0x1fee1e);}return null;};}function saveUpdates(_0x34404b){return function(_0x5cceb4){if(_0x5cceb4){return _0x5cceb4[_0xe9eb('0x15')](_0x34404b)['then'](function(_0x371356){return _0x371356;});}return null;};}function removeEntity(_0x1fec7f){return function(_0xd32766){if(_0xd32766){return _0xd32766[_0xe9eb('0x16')]()[_0xe9eb('0x17')](function(){_0x1fec7f['status'](0xcc)[_0xe9eb('0x18')]();});}};}function handleEntityNotFound(_0x18ab40){return function(_0x251f30){if(!_0x251f30){_0x18ab40['sendStatus'](0x194);}return _0x251f30;};}function handleError(_0xc0cc6d,_0x2f21a2){_0x2f21a2=_0x2f21a2||0x1f4;return function(_0x173cb0){logger[_0xe9eb('0x19')](_0x173cb0['stack']);if(_0x173cb0['name']){delete _0x173cb0[_0xe9eb('0x1a')];}_0xc0cc6d[_0xe9eb('0xe')](_0x2f21a2)[_0xe9eb('0x1b')](_0x173cb0);};}exports[_0xe9eb('0x1c')]=function(_0x315690,_0xbe2474){var _0x5243cc={},_0x57a559={},_0x519c68={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')][_0xe9eb('0x1e')]()['then'](function(_0x23a503){var _0x8bf6f5=[];for(var _0x85c766=0x0;_0x85c7660x1){_0x20174f['or'](_0xe9eb('0x58'),qs[_0xe9eb('0x59')](_0x5cc784),null);}else{if(qs[_0xe9eb('0x5a')](_0x5cc784)){_0x20174f['or'](_0xe9eb('0x5b'),_0x5cc784+'%');_0x20174f['or']('c.phone\x20LIKE\x20?',_0x5cc784+'%');_0x20174f['or'](_0xe9eb('0x5c'),_0x5cc784+'%');_0x20174f['or']('c.fax\x20LIKE\x20?',_0x5cc784+'%');}else if(qs[_0xe9eb('0x5d')](_0x5cc784)){_0x20174f['or'](_0xe9eb('0x5e'),_0x5cc784+'%');}else{_0x20174f['or'](_0xe9eb('0x5f'),'%'+_0x5cc784+'%');_0x20174f['or'](_0xe9eb('0x60'),'%'+_0x5cc784+'%');_0x20174f['or']('c.email\x20LIKE\x20?','%'+_0x5cc784+'%');}}}}_0x142290[_0xe9eb('0x31')](_0x20174f);_0x142290[_0xe9eb('0x61')](_0xe9eb('0x62'));var _0x440423={'type':db[_0xe9eb('0x63')][_0xe9eb('0x64')][_0xe9eb('0x65')],'raw':!![]};var _0x1dfb2b=_0x142290[_0xe9eb('0x66')]()[_0xe9eb('0x33')](_0xe9eb('0x62'));if(_0x5243cc[_0xe9eb('0x2f')]){_0x5243cc[_0xe9eb('0x2f')][_0xe9eb('0x40')](function(_0x138e36){_0x142290['order']('c.'+_0x138e36[0x0],_0x138e36[0x1]===_0xe9eb('0x67')?![]:!![]);});}if(!_[_0xe9eb('0x50')](_0x267383)){_0x142290[_0xe9eb('0x68')](_0x101a8d);_0x1dfb2b[_0xe9eb('0x31')]('t.id\x20IN\x20?',_0x267383);}BPromise[_0xe9eb('0x69')]()['then'](function(){if(!_0x4bcb3b)return;if(_0x315690['user']['role']!=='agent')return;if(!_[_0xe9eb('0x6a')](_0x4bcb3b[_0xe9eb('0x3e')],[_0xe9eb('0x33'),_0xe9eb('0x6b')])){return _0x315690[_0xe9eb('0x6c')][_0xe9eb('0x6d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2a65e4){if(_['isEmpty'](_0x2a65e4)){_0x1dfb2b[_0xe9eb('0x31')]('c.ListId\x20IS\x20NULL');_0x142290[_0xe9eb('0x31')](_0xe9eb('0x6e'));}else{_0x1dfb2b[_0xe9eb('0x31')]('c.ListId\x20IN\x20?',_[_0xe9eb('0x3f')](_0x2a65e4,'id'));_0x142290[_0xe9eb('0x31')](_0xe9eb('0x52'),_[_0xe9eb('0x3f')](_0x2a65e4,'id'));}});}})['then'](function(){if(_0x315690['user'][_0xe9eb('0x6f')]==='agent'&&!_0x4bcb3b&&!_0x315690['query']['ListId'])return[];return db[_0xe9eb('0x70')][_0xe9eb('0x29')](_0x1dfb2b[_0xe9eb('0x71')](),_0x440423);})[_0xe9eb('0x17')](function(_0x4eec54){_0x519c68[_0xe9eb('0x13')]=_0x4eec54[_0xe9eb('0x25')];if(_0x519c68[_0xe9eb('0x13')]===0x0)return[];return db[_0xe9eb('0x70')][_0xe9eb('0x29')](_0x4fe485[_0xe9eb('0x71')](),_0x440423)[_0xe9eb('0x17')](function(_0x6758da){_0xab61f6=_[_0xe9eb('0x72')](_0x6758da,'id');_0x440423=_[_0xe9eb('0x73')](_0x440423,{'model':db[_0xe9eb('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x315690[_0xe9eb('0x29')][_0xe9eb('0x2d')]){_0x5243cc[_0xe9eb('0x2c')][_0xe9eb('0x40')](function(_0x8c63e4){_0x142290[_0xe9eb('0x33')]('c.'+_0x8c63e4);});}else{_0x142290[_0xe9eb('0x33')](_0xe9eb('0x62'));_0x142290[_0xe9eb('0x33')]('c.firstName');_0x142290['field']('c.lastName');_0x142290['field'](_0xe9eb('0x74'));_0x142290[_0xe9eb('0x33')]('c.mobile');_0x142290[_0xe9eb('0x33')](_0xe9eb('0x75'));_0x142290[_0xe9eb('0x33')](_0xe9eb('0x76'));_0x142290[_0xe9eb('0x33')]('c.ListId');_0x142290['field']('c.createdAt');_0x142290[_0xe9eb('0x33')](_0xe9eb('0x77'));_0x142290[_0xe9eb('0x33')](_0xe9eb('0x78'));_0x142290[_0xe9eb('0x33')](_0xe9eb('0x79'),_0xe9eb('0x7a'));}if(_0x5243cc[_0xe9eb('0x12')])_0x142290[_0xe9eb('0x12')](_0x5243cc[_0xe9eb('0x12')]);if(_0x5243cc[_0xe9eb('0x10')])_0x142290[_0xe9eb('0x10')](_0x5243cc[_0xe9eb('0x10')]);return db['sequelize']['query'](_0x142290['toString'](),_0x440423);});})['then'](function(_0xfb616){_0xfb616['forEach'](function(_0x5655ca){if(_0x5655ca[_0xe9eb('0x7a')]){_0x5655ca[_0xe9eb('0x7b')]=[];_0x5655ca[_0xe9eb('0x7a')][_0xe9eb('0x7c')](',')[_0xe9eb('0x40')](function(_0x55e7b0){_0x5655ca[_0xe9eb('0x7b')]['push'](_0xab61f6[_0x55e7b0]);});}delete _0x5655ca[_0xe9eb('0x7a')];});_0x519c68[_0xe9eb('0x7d')]=_0xfb616;return _0x519c68;})[_0xe9eb('0x17')](respondWithFilteredResult(_0xbe2474,_0x5243cc));})[_0xe9eb('0x7e')](handleError(_0xbe2474,null));};exports[_0xe9eb('0x16')]=function(_0x25dbdf,_0x2d5369){return db[_0xe9eb('0x1d')][_0xe9eb('0x7f')]({'where':{'id':_0x25dbdf[_0xe9eb('0x80')]['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0x2d5369,null))[_0xe9eb('0x17')](removeEntity(_0x2d5369,null))[_0xe9eb('0x7e')](handleError(_0x2d5369,null));};exports[_0xe9eb('0x1e')]=function(_0x10af76,_0x4ff260){return db[_0xe9eb('0x1d')][_0xe9eb('0x1e')]()[_0xe9eb('0x17')](function(_0x1859f5){delete _0x1859f5[_0xe9eb('0x81')];for(var _0x122462=0x0;_0x1224620x0){return new Promise(function(_0x3c0571,_0x409270){var _0x3891c5=[];for(var _0x4b18a0=0x0;_0x4b18a0<_0x5ac328[_0xe9eb('0x25')];_0x4b18a0++){_0x3891c5[_0xe9eb('0x22')](insertAdditionalPhones(_0x5ac328[_0x4b18a0][_0xe9eb('0xa9')],_0x5ac328[_0x4b18a0][_0xe9eb('0xa5')]));}Promise['all'](_0x3891c5)[_0xe9eb('0x17')](function(){_0x3c0571(0x1);});})[_0xe9eb('0x17')](function(){return{'success':_0xa2ff42,'failure':_0x6ecb67,'duplicates':_0x2c2aa5};});}else{return{'success':_0xa2ff42,'failure':_0x6ecb67,'duplicates':_0x2c2aa5};}}})[_0xe9eb('0x17')](respondWithResult(_0xffd01a,0xc9))['catch'](handleError(_0xffd01a,null));};exports[_0xe9eb('0xaa')]=function(_0x29d7d7,_0x5d6efb){var _0x211779;return db['CmContact'][_0xe9eb('0x1e')]()[_0xe9eb('0x17')](function(_0x35bc7d){return db['CmContact']['find']({'where':{'id':_0x29d7d7['params']['id']},'include':[{'model':db['Tag'],'as':_0xe9eb('0x7b'),'attributes':['id','name',_0xe9eb('0xab')],'required':_0x29d7d7[_0xe9eb('0x29')]['tag']?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x29d7d7[_0xe9eb('0x80')]['id']},'required':![],'include':[{'model':db[_0xe9eb('0xac')],'as':'ItemType'}]}],'order':[db['sequelize'][_0xe9eb('0xad')](_0xe9eb('0xae'))],'attributes':_[_0xe9eb('0x1f')](_0x35bc7d)});})[_0xe9eb('0x17')](function(_0xe991b4){if(!_[_0xe9eb('0x4e')](_0xe991b4)){_0x211779=_0xe991b4[_0xe9eb('0x8a')]({'plain':!![]});var _0x2b06c4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe991b4&&_0xe991b4[_0xe9eb('0x51')]){if(_0xe991b4[_0xe9eb('0x51')]){_0x2b06c4[_0xe9eb('0x31')][_0xe9eb('0xaf')][_0xe9eb('0x22')]({'ListId':{'$ne':_0xe991b4['ListId']}});}}return db[_0xe9eb('0x23')]['findAll'](_0x2b06c4);}})[_0xe9eb('0x17')](function(_0x5c4861){if(!_[_0xe9eb('0x4e')](_0x5c4861)){return _[_0xe9eb('0xb0')](_0x211779,_[_0xe9eb('0x3f')](_0x5c4861,function(_0x39335b){return util[_0xe9eb('0xb1')](_0xe9eb('0xb2'),_0x39335b['id']);}));}})[_0xe9eb('0x17')](handleEntityNotFound(_0x5d6efb,null))[_0xe9eb('0x17')](respondWithResult(_0x5d6efb,null))[_0xe9eb('0x7e')](handleError(_0x5d6efb,null));};exports[_0xe9eb('0x15')]=function(_0x22d641,_0x1f04ed){var _0x57adc7;if(_0x22d641[_0xe9eb('0x89')]['id']){delete _0x22d641[_0xe9eb('0x89')]['id'];}if(!_[_0xe9eb('0x4e')](_0x22d641['body'][_0xe9eb('0xa2')])){var _0x528929=_0x22d641[_0xe9eb('0x89')][_0xe9eb('0xa2')];if(!_[_0xe9eb('0x4e')](shared[_0xe9eb('0xa3')][_0x528929]))_0x22d641['body'][_0xe9eb('0xa4')]=shared[_0xe9eb('0xa3')][_0x528929][_0xe9eb('0xa4')];}return db[_0xe9eb('0x1d')]['find']({'where':{'id':_0x22d641[_0xe9eb('0x80')]['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0x1f04ed,null))[_0xe9eb('0x17')](saveUpdates(_0x22d641['body'],null))[_0xe9eb('0x17')](function(_0x30cf91){_0x57adc7=_0x30cf91;var _0x26ae08={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x30cf91&&_0x30cf91[_0xe9eb('0x51')]){if(_0x30cf91[_0xe9eb('0x51')]){_0x26ae08[_0xe9eb('0x31')][_0xe9eb('0xaf')][_0xe9eb('0x22')]({'ListId':{'$ne':_0x30cf91[_0xe9eb('0x51')]}});}}return db['CmCustomField'][_0xe9eb('0x84')](_0x26ae08);})[_0xe9eb('0x17')](function(_0x3df0c5){if(_0x3df0c5){return _[_0xe9eb('0xb0')](_[_0xe9eb('0xb3')](_0x22d641[_0xe9eb('0x89')],function(_0x3644a0,_0xaf158c){return _[_0xe9eb('0x20')](_0xaf158c,'cf_');}),_['map'](_0x3df0c5,function(_0x6be26a){return util[_0xe9eb('0xb1')](_0xe9eb('0xb2'),_0x6be26a['id']);}));}})[_0xe9eb('0x17')](function(_0x1e1f9c){if(_0x1e1f9c&&!_[_0xe9eb('0x50')](_0x1e1f9c)){var _0x10985b=squel['update']()[_0xe9eb('0xb4')](_0xe9eb('0xb5'))['setFields'](_0x1e1f9c)[_0xe9eb('0x31')](_0xe9eb('0xb6'),_0x22d641[_0xe9eb('0x80')]['id'])[_0xe9eb('0xb7')]();return db[_0xe9eb('0x70')][_0xe9eb('0x29')](_0x10985b['text'],{'replacements':_0x10985b[_0xe9eb('0x87')]});}})[_0xe9eb('0x17')](function(){if(_0x22d641[_0xe9eb('0x89')]['phone']&&_0x57adc7){return db['CmHopper'][_0xe9eb('0x15')]({'phone':_0x22d641[_0xe9eb('0x89')][_0xe9eb('0xb8')],'OrderBy':0x0},{'where':{'ContactId':_0x57adc7['id']}});}})[_0xe9eb('0x17')](function(){return _0x57adc7;})['then'](respondWithResult(_0x1f04ed,null))[_0xe9eb('0x7e')](handleError(_0x1f04ed,null));};exports[_0xe9eb('0xb9')]=function(_0x153846,_0x43e17f){var _0x2dedae={};var _0xbd1be3={};var _0x3d3e4e;var _0x4e8726;return db[_0xe9eb('0x1d')][_0xe9eb('0xba')]({'where':{'id':_0x153846['params']['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0x43e17f,null))[_0xe9eb('0x17')](function(_0x14f01d){if(_0x14f01d){_0x3d3e4e=_0x14f01d;_0xbd1be3[_0xe9eb('0x28')]=_[_0xe9eb('0x1f')](db[_0xe9eb('0xbb')][_0xe9eb('0xbc')]);_0xbd1be3[_0xe9eb('0x29')]=_[_0xe9eb('0x1f')](_0x153846[_0xe9eb('0x29')]);_0xbd1be3[_0xe9eb('0x2a')]=_[_0xe9eb('0x2b')](_0xbd1be3[_0xe9eb('0x28')],_0xbd1be3[_0xe9eb('0x29')]);_0x2dedae['attributes']=_[_0xe9eb('0x2b')](_0xbd1be3[_0xe9eb('0x28')],qs[_0xe9eb('0x2d')](_0x153846[_0xe9eb('0x29')][_0xe9eb('0x2d')]));_0x2dedae[_0xe9eb('0x2c')]=_0x2dedae['attributes'][_0xe9eb('0x25')]?_0x2dedae[_0xe9eb('0x2c')]:_0xbd1be3[_0xe9eb('0x28')];_0x2dedae['order']=qs[_0xe9eb('0x30')](_0x153846[_0xe9eb('0x29')][_0xe9eb('0x30')]);_0x2dedae[_0xe9eb('0x31')]=qs[_0xe9eb('0x2a')](_['pick'](_0x153846[_0xe9eb('0x29')],_0xbd1be3['filters']));if(_0x153846[_0xe9eb('0x29')]['filter']){_0x2dedae['where']=_[_0xe9eb('0x73')](_0x2dedae[_0xe9eb('0x31')],{'$or':_[_0xe9eb('0x3f')](_0x2dedae[_0xe9eb('0x2c')],function(_0x584ccc){var _0x16df33={};_0x16df33[_0x584ccc]={'$like':'%'+_0x153846[_0xe9eb('0x29')]['filter']+'%'};return _0x16df33;})});}_0x2dedae=_[_0xe9eb('0x73')]({},_0x2dedae,_0x153846[_0xe9eb('0xbd')]);return _0x3d3e4e[_0xe9eb('0xb9')](_0x2dedae);}})['then'](function(_0x4cac7e){if(_0x4cac7e){_0x4e8726=_0x4cac7e[_0xe9eb('0x25')];if(!_0x153846['query'][_0xe9eb('0x88')](_0xe9eb('0x2e'))){_0x2dedae[_0xe9eb('0x12')]=qs[_0xe9eb('0x12')](_0x153846[_0xe9eb('0x29')][_0xe9eb('0x12')]);_0x2dedae[_0xe9eb('0x10')]=qs['offset'](_0x153846[_0xe9eb('0x29')]['offset']);}return _0x3d3e4e[_0xe9eb('0xb9')](_0x2dedae);}})[_0xe9eb('0x17')](function(_0x168c73){if(_0x168c73){return _0x168c73?{'count':_0x4e8726,'rows':_0x168c73}:null;}})['then'](respondWithResult(_0x43e17f,null))[_0xe9eb('0x7e')](handleError(_0x43e17f,null));};exports[_0xe9eb('0xbe')]=function(_0x45c9eb,_0x3a8589){if(_0x45c9eb[_0xe9eb('0x89')]['id']){delete _0x45c9eb[_0xe9eb('0x89')]['id'];}return db['CmContact'][_0xe9eb('0xba')]({'where':{'id':_0x45c9eb[_0xe9eb('0x80')]['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0x3a8589,null))[_0xe9eb('0x17')](function(_0x34c73d){if(_0x34c73d){return _0x34c73d['setTags'](_0x45c9eb[_0xe9eb('0x89')][_0xe9eb('0xbf')]||[]);}return null;})[_0xe9eb('0x17')](respondWithResult(_0x3a8589,null))['catch'](handleError(_0x3a8589,null));};exports[_0xe9eb('0xc0')]=function(_0x37d41a,_0x57cd99){var _0x25077e=[];_0x25077e['push'](addAdditionalPhones(_0x37d41a['body']));Promise['all'](_0x25077e)['then'](function(){_0x25077e=[];_0x25077e['push'](deleteCmHopperPhones(_0x37d41a[_0xe9eb('0x89')]['id']));_0x25077e[_0xe9eb('0x22')](addCmHopperPhones(_0x37d41a[_0xe9eb('0x89')]['id']));Promise[_0xe9eb('0x24')](_0x25077e)[_0xe9eb('0x17')](function(){return[0x1];})[_0xe9eb('0x17')](respondWithResult(_0x57cd99,null));});};function addAdditionalPhones(_0x3e806d){var _0x196f47;return new Promise(function(_0x2cffe5,_0x3d908e){return db[_0xe9eb('0x99')][_0xe9eb('0x16')]({'where':{'CmContactId':_0x3e806d['id']}})[_0xe9eb('0x17')](function(){db[_0xe9eb('0xac')][_0xe9eb('0x84')]({'raw':!![],'attributes':['id','OrderBy']})[_0xe9eb('0x17')](function(_0x10058e){var _0x127a50=[];for(var _0x318f4d=0x0;_0x318f4d<_0x3e806d[_0xe9eb('0xc1')][_0xe9eb('0x25')];_0x318f4d++){var _0x831ed9=_0x3e806d[_0xe9eb('0xc2')]?_[_0xe9eb('0x4e')](_0x3e806d[_0xe9eb('0xc2')][_0x318f4d])?'':_0x3e806d[_0xe9eb('0xc2')][_0x318f4d]:_0x3e806d[_0xe9eb('0xc1')][_0x318f4d]['ItemTypeId']?_0x3e806d[_0xe9eb('0xc1')][_0x318f4d][_0xe9eb('0xc3')]:'';var _0x309208=_[_0xe9eb('0x4e')](_0x3e806d[_0xe9eb('0xc1')][_0x318f4d]['description'])?'':_0x3e806d[_0xe9eb('0xc1')][_0x318f4d][_0xe9eb('0xc4')];var _0x1f983c=_0x831ed9+':'+_0x3e806d['items'][_0x318f4d][_0xe9eb('0xb8')]+'§'+_0x309208;if(_[_0xe9eb('0x4e')](_0x196f47))_0x196f47=_0x1f983c;else _0x196f47+=';'+_0x1f983c;var _0x49e361=null;if(_0x3e806d[_0xe9eb('0xc2')]){if(!_[_0xe9eb('0x4e')](_0x3e806d[_0xe9eb('0xc2')][_0x318f4d])){var _0x47748d=_[_0xe9eb('0x7f')](_0x10058e,function(_0x29da2b){return _0x29da2b['id']===_0x3e806d[_0xe9eb('0xc2')][_0x318f4d];});if(!_[_0xe9eb('0x4e')](_0x47748d)){_0x49e361=_0x47748d[_0xe9eb('0xc5')];}}}else{if(!_[_0xe9eb('0x4e')](_0x3e806d[_0xe9eb('0xc1')][_0x318f4d])){var _0x47748d=_[_0xe9eb('0x7f')](_0x10058e,function(_0x111a44){return _0x111a44['id']===_0x3e806d[_0xe9eb('0xc1')][_0x318f4d][_0xe9eb('0xc3')];});if(!_[_0xe9eb('0x4e')](_0x47748d)){_0x49e361=_0x318f4d;}}}if(_[_0xe9eb('0x4e')](_0x49e361)){_0x49e361=0x64;}_0x127a50[_0xe9eb('0x22')](addAdditionalPhone(_0x3e806d['id'],_0x3e806d[_0xe9eb('0xc1')][_0x318f4d][_0xe9eb('0xb8')],_0x3e806d[_0xe9eb('0xc2')]?_[_0xe9eb('0x4e')](_0x3e806d[_0xe9eb('0xc2')][_0x318f4d])?null:_0x3e806d[_0xe9eb('0xc2')][_0x318f4d]:_0x3e806d[_0xe9eb('0xc1')][_0x318f4d]['ItemTypeId']?_0x3e806d[_0xe9eb('0xc1')][_0x318f4d][_0xe9eb('0xc3')]:null,_0x49e361,_0x309208));}Promise[_0xe9eb('0x24')](_0x127a50)['then'](function(){db['CmContact']['update']({'AdditionalPhones':_0x196f47},{'where':{'id':_0x3e806d['id']}})[_0xe9eb('0x17')](function(){_0x2cffe5(0x1);});});});});});}function addAdditionalPhone(_0x4dbb79,_0x53b3d1,_0x143ca7,_0x50a6b1,_0x2183a9){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x4dbb79,'item':_0x53b3d1}})[_0xe9eb('0x17')](function(_0x54390f){if(_0x54390f)logger[_0xe9eb('0x8f')](_0xe9eb('0xc6'),_0x54390f);else{db[_0xe9eb('0x99')][_0xe9eb('0x91')]({'CmContactId':_0x4dbb79,'item':_0x53b3d1,'ItemTypeId':_0x143ca7,'OrderBy':_0x50a6b1,'ItemClass':_0xe9eb('0xc7'),'description':_0x2183a9});}});}function deletePhones(_0x3772f1){return db['CmContactHasItem'][_0xe9eb('0x16')]({'where':{'CmContactId':_0x3772f1}});}function deleteCmHopperPhones(_0x2d6ce9){return new Promise(function(_0x23a0aa,_0x28b39a){return db[_0xe9eb('0x8e')][_0xe9eb('0x84')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2d6ce9}})[_0xe9eb('0x17')](function(_0x24d6f1){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x24d6f1,'id')}}});})[_0xe9eb('0x17')](function(){_0x23a0aa(0x1);});});}function addCmHopperPhones(_0x4e4eb5){return new Promise(function(_0x452a4d,_0x149e01){return db[_0xe9eb('0x8e')][_0xe9eb('0x84')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4e4eb5}})[_0xe9eb('0x17')](function(_0x522a1b){var _0x4d9d1a=[];_[_0xe9eb('0x3f')](_0x522a1b,function(_0x237cc4){_0x4d9d1a[_0xe9eb('0x22')](createCmHopperPhone(_0x4e4eb5,_0x237cc4['id']));});Promise['all'](_0x4d9d1a)[_0xe9eb('0x17')](function(){_0x452a4d(0x1);});});});}function createCmHopperPhone(_0x4d5f57,_0x350e5f){return new Promise(function(_0x59969a,_0x26fffc){db[_0xe9eb('0x99')][_0xe9eb('0x84')]({'raw':!![],'attributes':[_0xe9eb('0xc8'),_0xe9eb('0xc5')],'where':{'CmContactId':_0x4d5f57,'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'attributes':['OrderBy'],'as':_0xe9eb('0xc9')}],'order':[_0xe9eb('0xc5'),db[_0xe9eb('0x70')][_0xe9eb('0xad')]('`ItemType`.OrderBy')]})[_0xe9eb('0x17')](function(_0x196e46){var _0x4610f1=0x1;var _0x3f6068=_[_0xe9eb('0x3f')](_0x196e46,function(_0x25d86d){_0x25d86d[_0xe9eb('0xca')]=_0x350e5f;_0x25d86d[_0xe9eb('0xb8')]=_0x25d86d[_0xe9eb('0xc8')];_0x25d86d[_0xe9eb('0xc5')]=_0x4610f1;delete _0x25d86d[_0xe9eb('0xcb')];_0x4610f1=_0x4610f1+0x1;return _0x25d86d;});return db[_0xe9eb('0xcc')][_0xe9eb('0xa6')](_0x3f6068,{});})[_0xe9eb('0x17')](function(){_0x59969a(0x1);});});}function insertAdditionalPhones(_0x1be458,_0x4d093d){return new Promise(function(_0x46ba82,_0x503e25){var _0x2a5856=[];for(var _0x1f868b=0x0;_0x1f868b<_0x4d093d[_0xe9eb('0x25')];_0x1f868b++){var _0xfacb2b=_0x4d093d[_0x1f868b];_0x2a5856[_0xe9eb('0x22')](parseContactItemType(_0xfacb2b));}Promise[_0xe9eb('0x24')](_0x2a5856)['then'](function(){var _0x4a4829={'id':_0x1be458['id'],'items':_0x4d093d};return addAdditionalPhones(_0x4a4829)['then'](function(_0x279c8f){return addCmHopperPhones(_0x1be458['id']);});})[_0xe9eb('0x17')](function(){_0x46ba82(_0x1be458);});});}function parseContactItemType(_0x463036){return new Promise(function(_0x84ee55,_0x39635f){if(_0x463036[_0xe9eb('0x88')](_0xe9eb('0xc3'))){_0x84ee55(_0x463036);}else{return db[_0xe9eb('0xac')][_0xe9eb('0x7f')]({'where':{'name':_0x463036[_0xe9eb('0xc9')]}})[_0xe9eb('0x17')](function(_0x2ad5db){if(_['isNil'](_0x2ad5db))_0x463036[_0xe9eb('0xc3')]=null;else _0x463036['ItemTypeId']=_0x2ad5db['id'];_0x84ee55(_0x463036);});}});}exports[_0xe9eb('0xcd')]=function(_0x2aa9a7,_0x2d36dc){return db[_0xe9eb('0x99')][_0xe9eb('0x84')]({'raw':!![],'where':{'CmContactId':_0x2aa9a7[_0xe9eb('0x80')]['id'],'ItemClass':_0xe9eb('0xc7')},'include':[{'model':db[_0xe9eb('0xac')],'as':_0xe9eb('0xc9')}],'order':[['OrderBy'],[db[_0xe9eb('0x70')][_0xe9eb('0xad')]('`ItemType`.OrderBy')]]})[_0xe9eb('0x17')](function(_0x5d53ca){return _0x5d53ca;})[_0xe9eb('0x17')](respondWithResult(_0x2d36dc,null))[_0xe9eb('0x7e')](handleError(_0x2d36dc,null));};exports[_0xe9eb('0xce')]=function(_0x59c620,_0x1725f5){return db[_0xe9eb('0x99')][_0xe9eb('0x84')]({'raw':!![],'where':{'CmContactId':_0x59c620[_0xe9eb('0x89')][_0xe9eb('0xcf')]}})[_0xe9eb('0x17')](function(_0x5248d7){var _0x59caf8=_[_0xe9eb('0x3f')](_0x5248d7,function(_0x40448f){_0x40448f[_0xe9eb('0xd0')]=_0x59c620[_0xe9eb('0x89')][_0xe9eb('0xd1')];return _0x40448f;});return db[_0xe9eb('0x99')][_0xe9eb('0xa6')](_0x59caf8,{});})['then'](function(_0x443ad4){return addCmHopperPhones(_0x59c620[_0xe9eb('0x89')][_0xe9eb('0xd1')]);})[_0xe9eb('0x17')](function(_0x520733){return['ok'];})[_0xe9eb('0x17')](respondWithResult(_0x1725f5,null))[_0xe9eb('0x7e')](handleError(_0x1725f5,null));};exports[_0xe9eb('0xd2')]=function(_0x29ead3,_0x2bbc9f){var _0x69db2=[];_0x69db2['push'](createCmHopperPhone(_0x29ead3[_0xe9eb('0x89')]['id'],_0x29ead3[_0xe9eb('0x89')]['hopperId']));Promise[_0xe9eb('0x24')](_0x69db2)[_0xe9eb('0x17')](function(){return[0x1];})[_0xe9eb('0x17')](respondWithResult(_0x2bbc9f,null));};exports['getHoppers']=function(_0x2ec32e,_0xa22594){var _0x1be497={'raw':![],'where':{}};var _0x304e1d={};var _0x364c00={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')][_0xe9eb('0xba')]({'where':{'id':_0x2ec32e[_0xe9eb('0x80')]['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0xa22594,null))[_0xe9eb('0x17')](function(_0x30da82){if(_0x30da82){_0x304e1d[_0xe9eb('0x28')]=_[_0xe9eb('0x1f')](db[_0xe9eb('0x8e')][_0xe9eb('0xbc')]);_0x304e1d[_0xe9eb('0x29')]=_[_0xe9eb('0x1f')](_0x2ec32e['query']);_0x304e1d[_0xe9eb('0x2a')]=_[_0xe9eb('0x2b')](_0x304e1d['model'],_0x304e1d['query']);_0x1be497[_0xe9eb('0x2c')]=_[_0xe9eb('0x2b')](_0x304e1d[_0xe9eb('0x28')],qs[_0xe9eb('0x2d')](_0x2ec32e['query'][_0xe9eb('0x2d')]));_0x1be497['attributes']=_0x1be497[_0xe9eb('0x2c')]['length']?_0x1be497[_0xe9eb('0x2c')]:_0x304e1d[_0xe9eb('0x28')];if(!_0x2ec32e[_0xe9eb('0x29')][_0xe9eb('0x88')](_0xe9eb('0x2e'))){_0x1be497['limit']=qs[_0xe9eb('0x12')](_0x2ec32e[_0xe9eb('0x29')]['limit']);_0x1be497[_0xe9eb('0x10')]=qs[_0xe9eb('0x10')](_0x2ec32e[_0xe9eb('0x29')][_0xe9eb('0x10')]);}_0x1be497[_0xe9eb('0x2f')]=qs[_0xe9eb('0x30')](_0x2ec32e[_0xe9eb('0x29')][_0xe9eb('0x30')]);_0x1be497[_0xe9eb('0x31')]=qs['filters'](_['pick'](_0x2ec32e['query'],_0x304e1d['filters']));_0x1be497[_0xe9eb('0x31')][_0xe9eb('0xd3')]=_0x30da82['id'];if(_0x2ec32e['query'][_0xe9eb('0x4d')]){_0x1be497['where']=_[_0xe9eb('0x73')](_0x1be497[_0xe9eb('0x31')],{'$or':_['map'](_0x1be497[_0xe9eb('0x2c')],function(_0x4142df){var _0xf00121={};_0xf00121[_0x4142df]={'$like':'%'+_0x2ec32e[_0xe9eb('0x29')][_0xe9eb('0x4d')]+'%'};return _0xf00121;})});}_0x1be497=_[_0xe9eb('0x73')]({},_0x1be497,_0x2ec32e['options']);return db['CmHopper'][_0xe9eb('0x13')]({'where':_0x1be497[_0xe9eb('0x31')]})[_0xe9eb('0x17')](function(_0xd70216){_0x364c00[_0xe9eb('0x13')]=_0xd70216;if(_0x2ec32e['query']['includeAll']){_0x1be497['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1be497);})[_0xe9eb('0x17')](function(_0x1335c2){_0x364c00[_0xe9eb('0x7d')]=_0x1335c2;return _0x364c00;});}})[_0xe9eb('0x17')](respondWithFilteredResult(_0xa22594,_0x1be497))['catch'](handleError(_0xa22594,null));};exports[_0xe9eb('0xd4')]=function(_0x14fbc0,_0x46f72c){var _0x3e680b={'raw':!![],'where':{}};var _0x3cb566={};var _0x131f01={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')][_0xe9eb('0xba')]({'where':{'id':_0x14fbc0[_0xe9eb('0x80')]['id']}})['then'](handleEntityNotFound(_0x46f72c,null))[_0xe9eb('0x17')](function(_0x2d7dc4){if(_0x2d7dc4){_0x3cb566['model']=_[_0xe9eb('0x1f')](db['CmHopperHistory']['rawAttributes']);_0x3cb566['query']=_[_0xe9eb('0x1f')](_0x14fbc0[_0xe9eb('0x29')]);_0x3cb566['filters']=_[_0xe9eb('0x2b')](_0x3cb566['model'],_0x3cb566['query']);_0x3e680b[_0xe9eb('0x2c')]=_[_0xe9eb('0x2b')](_0x3cb566[_0xe9eb('0x28')],qs[_0xe9eb('0x2d')](_0x14fbc0[_0xe9eb('0x29')][_0xe9eb('0x2d')]));_0x3e680b[_0xe9eb('0x2c')]=_0x3e680b['attributes'][_0xe9eb('0x25')]?_0x3e680b[_0xe9eb('0x2c')]:_0x3cb566[_0xe9eb('0x28')];if(!_0x14fbc0[_0xe9eb('0x29')][_0xe9eb('0x88')](_0xe9eb('0x2e'))){_0x3e680b['limit']=qs[_0xe9eb('0x12')](_0x14fbc0[_0xe9eb('0x29')]['limit']);_0x3e680b[_0xe9eb('0x10')]=qs[_0xe9eb('0x10')](_0x14fbc0[_0xe9eb('0x29')]['offset']);}_0x3e680b[_0xe9eb('0x2f')]=qs[_0xe9eb('0x30')](_0x14fbc0[_0xe9eb('0x29')][_0xe9eb('0x30')]);_0x3e680b[_0xe9eb('0x31')]=qs[_0xe9eb('0x2a')](_[_0xe9eb('0x32')](_0x14fbc0['query'],_0x3cb566[_0xe9eb('0x2a')]));_0x3e680b['where'][_0xe9eb('0xd3')]=_0x2d7dc4['id'];if(_0x14fbc0[_0xe9eb('0x29')][_0xe9eb('0x4d')]){_0x3e680b[_0xe9eb('0x31')]=_[_0xe9eb('0x73')](_0x3e680b['where'],{'$or':_[_0xe9eb('0x3f')](_0x3e680b[_0xe9eb('0x2c')],function(_0x120492){var _0x572971={};_0x572971[_0x120492]={'$like':'%'+_0x14fbc0['query'][_0xe9eb('0x4d')]+'%'};return _0x572971;})});}_0x3e680b=_[_0xe9eb('0x73')]({},_0x3e680b,_0x14fbc0[_0xe9eb('0xbd')]);return db[_0xe9eb('0x9b')][_0xe9eb('0x13')]({'where':_0x3e680b['where']})['then'](function(_0x53c8d0){_0x131f01[_0xe9eb('0x13')]=_0x53c8d0;if(_0x14fbc0[_0xe9eb('0x29')]['includeAll']){_0x3e680b['include']=[{'all':!![]}];}return db[_0xe9eb('0x9b')]['findAll'](_0x3e680b);})[_0xe9eb('0x17')](function(_0x2f4b1d){_0x131f01[_0xe9eb('0x7d')]=_0x2f4b1d;return _0x131f01;});}})['then'](respondWithFilteredResult(_0x46f72c,_0x3e680b))['catch'](handleError(_0x46f72c,null));};exports[_0xe9eb('0xd5')]=function(_0x5cdbe2,_0x35a4bc){var _0xc3880e={'raw':!![],'where':{}};var _0x2d760a={};var _0x50aa9f={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')]['findOne']({'where':{'id':_0x5cdbe2[_0xe9eb('0x80')]['id']}})['then'](handleEntityNotFound(_0x35a4bc,null))[_0xe9eb('0x17')](function(_0x3d3b85){if(_0x3d3b85){_0x2d760a['model']=_[_0xe9eb('0x1f')](db[_0xe9eb('0x9a')][_0xe9eb('0xbc')]);_0x2d760a[_0xe9eb('0x29')]=_[_0xe9eb('0x1f')](_0x5cdbe2['query']);_0x2d760a['filters']=_[_0xe9eb('0x2b')](_0x2d760a[_0xe9eb('0x28')],_0x2d760a['query']);_0xc3880e[_0xe9eb('0x2c')]=_['intersection'](_0x2d760a[_0xe9eb('0x28')],qs[_0xe9eb('0x2d')](_0x5cdbe2['query']['fields']));_0xc3880e['attributes']=_0xc3880e[_0xe9eb('0x2c')][_0xe9eb('0x25')]?_0xc3880e[_0xe9eb('0x2c')]:_0x2d760a['model'];if(!_0x5cdbe2[_0xe9eb('0x29')]['hasOwnProperty'](_0xe9eb('0x2e'))){_0xc3880e['limit']=qs['limit'](_0x5cdbe2[_0xe9eb('0x29')][_0xe9eb('0x12')]);_0xc3880e[_0xe9eb('0x10')]=qs[_0xe9eb('0x10')](_0x5cdbe2[_0xe9eb('0x29')]['offset']);}_0xc3880e[_0xe9eb('0x2f')]=qs[_0xe9eb('0x30')](_0x5cdbe2['query'][_0xe9eb('0x30')]);_0xc3880e[_0xe9eb('0x31')]=qs['filters'](_[_0xe9eb('0x32')](_0x5cdbe2[_0xe9eb('0x29')],_0x2d760a['filters']));_0xc3880e[_0xe9eb('0x31')]['ContactId']=_0x3d3b85['id'];if(_0x5cdbe2[_0xe9eb('0x29')]['filter']){_0xc3880e[_0xe9eb('0x31')]=_[_0xe9eb('0x73')](_0xc3880e[_0xe9eb('0x31')],{'$or':_[_0xe9eb('0x3f')](_0xc3880e[_0xe9eb('0x2c')],function(_0x340030){var _0x332e66={};_0x332e66[_0x340030]={'$like':'%'+_0x5cdbe2['query']['filter']+'%'};return _0x332e66;})});}_0xc3880e=_[_0xe9eb('0x73')]({},_0xc3880e,_0x5cdbe2[_0xe9eb('0xbd')]);return db[_0xe9eb('0x9a')][_0xe9eb('0x13')]({'where':_0xc3880e[_0xe9eb('0x31')]})['then'](function(_0x39fd86){_0x50aa9f[_0xe9eb('0x13')]=_0x39fd86;if(_0x5cdbe2['query'][_0xe9eb('0xd6')]){_0xc3880e[_0xe9eb('0xd7')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0xc3880e);})[_0xe9eb('0x17')](function(_0x1b86b1){_0x50aa9f[_0xe9eb('0x7d')]=_0x1b86b1;return _0x50aa9f;});}})['then'](respondWithFilteredResult(_0x35a4bc,_0xc3880e))[_0xe9eb('0x7e')](handleError(_0x35a4bc,null));};exports[_0xe9eb('0xd8')]=function(_0x40814f,_0x3af3d4){var _0x5d0c3f={'raw':!![],'where':{}};var _0x5681f5={};var _0x23dfa5={'count':0x0,'rows':[]};return db[_0xe9eb('0x1d')][_0xe9eb('0xba')]({'where':{'id':_0x40814f[_0xe9eb('0x80')]['id']}})[_0xe9eb('0x17')](handleEntityNotFound(_0x3af3d4,null))[_0xe9eb('0x17')](function(_0x5b4e59){if(_0x5b4e59){_0x5681f5['model']=_[_0xe9eb('0x1f')](db[_0xe9eb('0xd9')][_0xe9eb('0xbc')]);_0x5681f5[_0xe9eb('0x29')]=_[_0xe9eb('0x1f')](_0x40814f[_0xe9eb('0x29')]);_0x5681f5['filters']=_['intersection'](_0x5681f5[_0xe9eb('0x28')],_0x5681f5[_0xe9eb('0x29')]);_0x5d0c3f[_0xe9eb('0x2c')]=_[_0xe9eb('0x2b')](_0x5681f5[_0xe9eb('0x28')],qs[_0xe9eb('0x2d')](_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x2d')]));_0x5d0c3f['attributes']=_0x5d0c3f[_0xe9eb('0x2c')]['length']?_0x5d0c3f[_0xe9eb('0x2c')]:_0x5681f5[_0xe9eb('0x28')];if(!_0x40814f['query']['hasOwnProperty'](_0xe9eb('0x2e'))){_0x5d0c3f[_0xe9eb('0x12')]=qs['limit'](_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x12')]);_0x5d0c3f[_0xe9eb('0x10')]=qs['offset'](_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x10')]);}_0x5d0c3f['order']=qs[_0xe9eb('0x30')](_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x30')]);_0x5d0c3f[_0xe9eb('0x31')]=qs[_0xe9eb('0x2a')](_[_0xe9eb('0x32')](_0x40814f['query'],_0x5681f5[_0xe9eb('0x2a')]));_0x5d0c3f['where'][_0xe9eb('0xd3')]=_0x5b4e59['id'];if(_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x4d')]){_0x5d0c3f[_0xe9eb('0x31')]=_[_0xe9eb('0x73')](_0x5d0c3f[_0xe9eb('0x31')],{'$or':_[_0xe9eb('0x3f')](_0x5d0c3f[_0xe9eb('0x2c')],function(_0x281f68){var _0x5cf6da={};_0x5cf6da[_0x281f68]={'$like':'%'+_0x40814f[_0xe9eb('0x29')][_0xe9eb('0x4d')]+'%'};return _0x5cf6da;})});}_0x5d0c3f=_[_0xe9eb('0x73')]({},_0x5d0c3f,_0x40814f[_0xe9eb('0xbd')]);return db[_0xe9eb('0xd9')][_0xe9eb('0x13')]({'where':_0x5d0c3f['where']})[_0xe9eb('0x17')](function(_0x38c71c){_0x23dfa5[_0xe9eb('0x13')]=_0x38c71c;if(_0x40814f['query'][_0xe9eb('0xd6')]){_0x5d0c3f[_0xe9eb('0xd7')]=[{'all':!![]}];}return db[_0xe9eb('0xd9')][_0xe9eb('0x84')](_0x5d0c3f);})[_0xe9eb('0x17')](function(_0x16fade){_0x23dfa5['rows']=_0x16fade;return _0x23dfa5;});}})[_0xe9eb('0x17')](respondWithFilteredResult(_0x3af3d4,_0x5d0c3f))[_0xe9eb('0x7e')](handleError(_0x3af3d4,null));};exports[_0xe9eb('0xda')]=function(_0x298d80,_0x214154){try{if(!_0x298d80[_0xe9eb('0x89')][_0xe9eb('0x51')]){throw new Error(_0xe9eb('0xdb'));}if(!_0x298d80['body']['binding_keys']){throw new Error(_0xe9eb('0xdc'));}if(!_0x298d80['body']['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x298d80[_0xe9eb('0x89')]['socket_timestamp']){throw new Error(_0xe9eb('0xdd'));}var _0x319887=_0x298d80['body']['binding_keys'][_0xe9eb('0x7c')](',');var _0x3040f4=_0x298d80['body'][_0xe9eb('0xde')][_0xe9eb('0x7c')](',');if(!_0x319887['length']||!_0x3040f4[_0xe9eb('0x25')]||_0x319887[_0xe9eb('0x25')]!==_0x3040f4[_0xe9eb('0x25')]){throw new Error(_0xe9eb('0xdf'));}_0x298d80[_0xe9eb('0x89')]['fields']=_[_0xe9eb('0xe0')](_0x319887,_0x3040f4);if(!_0x298d80[_0xe9eb('0x89')][_0xe9eb('0x2d')][_0xe9eb('0xb8')]){throw new Error(_0xe9eb('0xe1'));}if(!_0x298d80[_0xe9eb('0x89')][_0xe9eb('0x2d')][_0xe9eb('0xe2')]){throw new Error(_0xe9eb('0xe3'));}var _0x25304c=path[_0xe9eb('0x8c')](config[_0xe9eb('0xe4')],_0xe9eb('0xe5'),_0x298d80[_0xe9eb('0xe6')][_0xe9eb('0xe7')]);fs['chmodSync'](_0x25304c,parseInt(_0xe9eb('0xe8'),0x8));var _0x4afe50=require(_0xe9eb('0xe9'))[_0xe9eb('0xea')](path[_0xe9eb('0x8c')](__dirname,_0xe9eb('0xeb')),[_0x25304c,_0x298d80[_0xe9eb('0x89')][_0xe9eb('0xec')],_0x298d80[_0xe9eb('0x89')]['binding_values'],_0x298d80[_0xe9eb('0x89')][_0xe9eb('0x51')],_0x298d80['body'][_0xe9eb('0xed')],_0x298d80[_0xe9eb('0x89')][_0xe9eb('0xa7')],_0x298d80['body'][_0xe9eb('0xee')]]);return _0x214154['status'](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x4afe50[_0xe9eb('0xef')]});}catch(_0x370745){return _0x214154[_0xe9eb('0xe')](0x1f4)['send'](_0x370745);}};exports['upload']=function(_0x2fc8b6,_0x1408ff){var _0x5c3ed8=fs['createReadStream'](_0x2fc8b6[_0xe9eb('0xe6')][_0xe9eb('0xf0')]);Papa[_0xe9eb('0xf1')](_0x5c3ed8,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x31a0c0){return _0x1408ff[_0xe9eb('0xe')](0xc8)[_0xe9eb('0xf')]({'file':_0x2fc8b6['file'],'fields':_0x31a0c0['meta']['fields']});}});};exports['import']=function(_0x5095f0,_0x21ccce){return db[_0xe9eb('0x6b')][_0xe9eb('0x84')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe9eb('0xf2')}})[_0xe9eb('0x17')](function(_0x2fedb4){var _0x567595=![];if(!_0x5095f0['body'][_0xe9eb('0x51')]){throw new Error(_0xe9eb('0xdb'));}if(!_0x5095f0[_0xe9eb('0x89')][_0xe9eb('0xf3')][_0xe9eb('0xb8')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5095f0[_0xe9eb('0x89')][_0xe9eb('0xf3')][_0xe9eb('0xe2')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x5095f0['body'][_0xe9eb('0xee')]){throw new Error(_0xe9eb('0xdd'));}var _0x25413b=require(_0xe9eb('0xe9'))['fork'](path['join'](__dirname,_0xe9eb('0xf4')),[_0x5095f0[_0xe9eb('0x80')]['id'],JSON[_0xe9eb('0xf5')](_0x5095f0[_0xe9eb('0x89')]),JSON[_0xe9eb('0xf5')](_0x2fedb4)]);_0x25413b['on'](_0xe9eb('0xf6'),function(){_0x567595=!![];return _0x21ccce['status'](0xc8)[_0xe9eb('0xf')]({'message':_0xe9eb('0xf7'),'pid':_0x25413b[_0xe9eb('0xef')]});});_0x25413b['on'](_0xe9eb('0xf8'),function(_0x5d17ec){if(_0x5d17ec&&!_0x567595){return _0x21ccce['status'](0x1f4)['json']({'message':_0xe9eb('0xf9'),'pid':_0x25413b[_0xe9eb('0xef')]});}});})[_0xe9eb('0x7e')](handleError(_0x21ccce,null));};exports[_0xe9eb('0xfa')]=function(_0x559693,_0x1f6057,_0x8eb0e6){return db[_0xe9eb('0x6b')][_0xe9eb('0x84')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe9eb('0xf2')}})[_0xe9eb('0x17')](function(_0x1f8b7b){var _0x5bcd97=![];if(!_0x559693[_0xe9eb('0x89')][_0xe9eb('0x51')]){throw new Error('No\x20ListId\x20specified');}if(!_0x559693[_0xe9eb('0x89')][_0xe9eb('0xf3')][_0xe9eb('0xb8')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x559693[_0xe9eb('0x89')][_0xe9eb('0xf3')]['firstName']){throw new Error(_0xe9eb('0xe3'));}if(!_0x559693[_0xe9eb('0x89')][_0xe9eb('0xee')]){throw new Error(_0xe9eb('0xdd'));}var _0x2f99e4=require(_0xe9eb('0xe9'))[_0xe9eb('0xea')](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0x559693[_0xe9eb('0x80')]['id'],JSON['stringify'](_0x559693[_0xe9eb('0x89')]),JSON[_0xe9eb('0xf5')](_0x1f8b7b)]);_0x2f99e4['on']('message',function(_0xf084a2){_0x5bcd97=!![];return _0x1f6057[_0xe9eb('0xe')](0xc8)[_0xe9eb('0xf')]({'message':_0xe9eb('0xf7'),'pid':_0x2f99e4[_0xe9eb('0xef')]});});_0x2f99e4['on'](_0xe9eb('0xf8'),function(_0x297100){if(_0x297100&&!_0x5bcd97){return _0x1f6057[_0xe9eb('0xe')](0x1f4)[_0xe9eb('0xf')]({'message':'error\x20child\x20process','pid':_0x2f99e4[_0xe9eb('0xef')]});}});})[_0xe9eb('0x7e')](handleError(_0x1f6057,null));};exports['getJourney']=function(_0x47efa7,_0x69048a){var _0x101bc4=[_0xe9eb('0xfb'),_0xe9eb('0xfc'),_0xe9eb('0xfd'),_0xe9eb('0xfe'),_0xe9eb('0xff'),_0xe9eb('0x100'),_0xe9eb('0x101')];var _0x30480b={'offset':0x0,'order':qs[_0xe9eb('0x30')](_0xe9eb('0x102'))},_0x25f3ee={'count':0x0,'rows':[]};Promise['resolve']()[_0xe9eb('0x17')](function(){if(_0x47efa7[_0xe9eb('0x29')]['channel']){if(!_[_0xe9eb('0x103')](_0x101bc4,_0x47efa7[_0xe9eb('0x29')][_0xe9eb('0x104')][_0xe9eb('0x105')]())){throw new Error(_0xe9eb('0x106'));}_0x101bc4=[_0x47efa7[_0xe9eb('0x29')][_0xe9eb('0x104')][_0xe9eb('0x105')]()];}if(_0x47efa7[_0xe9eb('0x29')]['range']){try{var _0x4bc32e=JSON[_0xe9eb('0xf1')](_0x47efa7[_0xe9eb('0x29')][_0xe9eb('0x107')]);if(!moment(_0x4bc32e[_0xe9eb('0x34')])[_0xe9eb('0x108')]()){throw new Error(_0xe9eb('0x109'));}if(!moment(_0x4bc32e['to'])[_0xe9eb('0x108')]()){throw new Error(_0xe9eb('0x10a'));}}catch(_0x28e1cd){throw new Error(_0xe9eb('0x10b'));}}if(!_0x47efa7[_0xe9eb('0x29')][_0xe9eb('0x88')](_0xe9eb('0x2e'))){_0x30480b[_0xe9eb('0x12')]=qs['limit'](_0x47efa7['query'][_0xe9eb('0x12')]||0xa);_0x30480b[_0xe9eb('0x10')]=qs[_0xe9eb('0x10')](_0x47efa7[_0xe9eb('0x29')][_0xe9eb('0x10')]);}var _0x5aba83=_0x101bc4['map'](function(_0x397141){if(_0x397141===_0xe9eb('0x101')){var _0x1881b4={'attributes':['id',_0xe9eb('0x10c'),_0xe9eb('0x27'),_0xe9eb('0x10d'),_0xe9eb('0x10e'),_0xe9eb('0x10f'),_0xe9eb('0x110'),_0xe9eb('0x111'),_0xe9eb('0x112'),_0xe9eb('0x113'),_0xe9eb('0x114'),_0xe9eb('0x115'),'userSecondDisposition',_0xe9eb('0x116'),'UserId'],'where':{'ContactId':_0x47efa7[_0xe9eb('0x80')]['id']},'include':[{'model':db[_0xe9eb('0x6b')],'as':'User','attributes':['id','name',_0xe9eb('0x117'),'alias']}],'order':[['createdAt',_0xe9eb('0x67')]]};if(_0x47efa7[_0xe9eb('0x29')]['range']){_0x1881b4[_0xe9eb('0x31')][_0xe9eb('0x114')]={'$gte':_0x4bc32e['from'],'$lte':_0x4bc32e['to']};}return db[_0xe9eb('0x9c')][_0xe9eb('0x118')](_0x1881b4)[_0xe9eb('0x17')](function(_0x3af777){_0x25f3ee[_0xe9eb('0x13')]+=_0x3af777[_0xe9eb('0x13')];return _[_0xe9eb('0x3f')](_0x3af777[_0xe9eb('0x7d')],function(_0x5def73){var _0x11e045=_0x5def73[_0xe9eb('0x8a')]({'plain':!![]});_0x11e045['channel']=_0x397141;if(_0x11e045[_0xe9eb('0x6b')]){_0x11e045[_0xe9eb('0x6b')]={'id':_0x11e045[_0xe9eb('0x6b')]['id'],'name':_0x11e045[_0xe9eb('0x6b')][_0xe9eb('0x1a')],'fullname':_0x11e045['User']['fullname'],'alias':_0x11e045['User'][_0xe9eb('0x119')]};}return _0x11e045;});});}else{var _0x47ab5e=_[_0xe9eb('0x11a')](_0x397141)+(_0x397141==='chat'?_0xe9eb('0x11b'):_0xe9eb('0x11c'));var _0xc04001={'attributes':['id','closed',_0xe9eb('0x11d'),'createdAt',_0xe9eb('0x113'),_0xe9eb('0x11e'),_0xe9eb('0x11f'),'thirdDisposition','UserId',_0x47ab5e+'Id'],'where':{'ContactId':_0x47efa7[_0xe9eb('0x80')]['id']},'include':[{'model':db[_0x47ab5e],'as':'Account','attributes':['id',_0xe9eb('0x1a'),_0xe9eb('0x120')]},{'model':db['User'],'as':_0xe9eb('0x121'),'attributes':['id',_0xe9eb('0x1a'),_0xe9eb('0x117')]},{'model':db[_0xe9eb('0xbb')],'as':_0xe9eb('0x7b'),'attributes':['id',_0xe9eb('0x1a'),_0xe9eb('0xab')],'through':{'attributes':[]}}],'order':[[_0xe9eb('0x114'),_0xe9eb('0x67')]]};if(_0x47efa7['query']['range']){_0xc04001['where'][_0xe9eb('0x114')]={'$gte':_0x4bc32e[_0xe9eb('0x34')],'$lte':_0x4bc32e['to']};}switch(_0x397141){case _0xe9eb('0xfc'):_0xc04001['attributes'][_0xe9eb('0x22')]('browserName','customerIp',_0xe9eb('0x122'),'deviceModel',_0xe9eb('0x123'),'ratingMessage',_0xe9eb('0x124'),_0xe9eb('0x125'),_0xe9eb('0x126'));break;case _0xe9eb('0xfb'):_0xc04001[_0xe9eb('0x2c')][_0xe9eb('0x22')](_0xe9eb('0x127'),'substatus');break;case _0xe9eb('0xfe'):_0xc04001['attributes'][_0xe9eb('0x22')](_0xe9eb('0x128'),_0xe9eb('0x129'));break;}return db[_[_0xe9eb('0x11a')](_0x397141)+_0xe9eb('0x12a')]['findAndCountAll'](_0xc04001)[_0xe9eb('0x17')](function(_0x2fbd95){_0x25f3ee[_0xe9eb('0x13')]+=_0x2fbd95['count'];return _[_0xe9eb('0x3f')](_0x2fbd95[_0xe9eb('0x7d')],function(_0x3852f0){var _0x2281cc=_0x3852f0[_0xe9eb('0x8a')]({'plain':!![]});_0x2281cc[_0xe9eb('0x104')]=_0x397141;if(_0x2281cc['Owner']){_0x2281cc[_0xe9eb('0x121')]={'id':_0x2281cc[_0xe9eb('0x121')]['id'],'name':_0x2281cc[_0xe9eb('0x121')]['name'],'fullname':_0x2281cc[_0xe9eb('0x121')][_0xe9eb('0x117')]};}return _0x2281cc;});});}});return Promise[_0xe9eb('0x24')](_0x5aba83);})['then'](function(_0x5be3d8){return _(_0x5be3d8)['flatten']()['sortBy'](_0xe9eb('0x114'))[_0xe9eb('0x12b')]()[_0xe9eb('0x4c')]();})['then'](function(_0x1cf94a){_0x25f3ee[_0xe9eb('0x7d')]=_0x30480b[_0xe9eb('0x12')]?_0x1cf94a['slice'](_0x30480b[_0xe9eb('0x10')],_0x30480b[_0xe9eb('0x10')]+_0x30480b['limit']):_0x1cf94a;return _0x25f3ee;})[_0xe9eb('0x17')](respondWithFilteredResult(_0x69048a,_0x30480b))[_0xe9eb('0x7e')](handleError(_0x69048a,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 424df88..b1ccf01 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6450=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6450,0x184));var _0x0645=function(_0x8dd934,_0x1b02eb){_0x8dd934=_0x8dd934-0x0;var _0x116f3f=_0x6450[_0x8dd934];return _0x116f3f;};'use strict';var EventEmitter=require(_0x0645('0x0'));var CmContact=require(_0x0645('0x1'))['db'][_0x0645('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0645('0x3'),'afterDestroy':'remove'};function emitEvent(_0x121cc3){return function(_0x4c268c,_0x3a0d11,_0x1972f3){CmContactEvents[_0x0645('0x4')](_0x121cc3+':'+_0x4c268c['id'],_0x4c268c);CmContactEvents[_0x0645('0x4')](_0x121cc3,_0x4c268c);_0x1972f3(null);};}for(var e in events){if(events[_0x0645('0x5')](e)){var event=events[e];CmContact[_0x0645('0x6')](e,emitEvent(event));}}module[_0x0645('0x7')]=CmContactEvents; \ No newline at end of file +var _0x8a3d=['update','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x560222,_0x582536){var _0x80dab0=function(_0x35dc2e){while(--_0x35dc2e){_0x560222['push'](_0x560222['shift']());}};_0x80dab0(++_0x582536);}(_0x8a3d,0xfd));var _0xd8a3=function(_0x2b3731,_0x4b1c94){_0x2b3731=_0x2b3731-0x0;var _0x1639ce=_0x8a3d[_0x2b3731];return _0x1639ce;};'use strict';var EventEmitter=require(_0xd8a3('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xd8a3('0x1')](0x0);var events={'afterCreate':_0xd8a3('0x2'),'afterUpdate':_0xd8a3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5702e7){return function(_0x43b466,_0xf68bc3,_0x11e8ff){CmContactEvents[_0xd8a3('0x4')](_0x5702e7+':'+_0x43b466['id'],_0x43b466);CmContactEvents['emit'](_0x5702e7,_0x43b466);_0x11e8ff(null);};}for(var e in events){if(events[_0xd8a3('0x5')](e)){var event=events[e];CmContact[_0xd8a3('0x6')](e,emitEvent(event));}}module[_0xd8a3('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 722896e..1eb6ac9 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa63=['lastName','mobile','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','then','dialTimezone','timezones','utcOffset','minutes','format','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','findOne','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','CmList','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','onlyIfOpen','message','models','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts'];(function(_0x42022a,_0x2c009b){var _0x2de0a8=function(_0x26be68){while(--_0x26be68){_0x42022a['push'](_0x42022a['shift']());}};_0x2de0a8(++_0x2c009b);}(_0xfa63,0x1a2));var _0x3fa6=function(_0x2fe52c,_0x1048b9){_0x2fe52c=_0x2fe52c-0x0;var _0x262bd2=_0xfa63[_0x2fe52c];return _0x262bd2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fa6('0x0'))(_0x3fa6('0x1'));var moment=require(_0x3fa6('0x2'));var BPromise=require(_0x3fa6('0x3'));var rp=require(_0x3fa6('0x4'));var fs=require('fs');var path=require(_0x3fa6('0x5'));var rimraf=require(_0x3fa6('0x6'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x3fa6('0x7'));module[_0x3fa6('0x8')]=function(_0x441265,_0xdb6676){return _0x441265[_0x3fa6('0x9')](_0x3fa6('0xa'),attributes,{'tableName':_0x3fa6('0xb'),'paranoid':!![],'indexes':[{'name':_0x3fa6('0xc'),'fields':[_0x3fa6('0xc')]},{'name':_0x3fa6('0xd'),'fields':['firstName',_0x3fa6('0xe'),_0x3fa6('0xc'),_0x3fa6('0xf'),'fax','email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x3fa6('0x10'),'hooks':{'afterCreate':function(_0x4059ee,_0x175ac9,_0x274794){var _0x3323a0=_0x441265['models'];var _0x44ad3b=_0x4059ee[_0x3fa6('0x11')]({'plain':!![]});function _0x23f91(){return function(_0x119b48){logger[_0x3fa6('0x12')](_0x3fa6('0x13'),_0x3fa6('0x14'),util[_0x3fa6('0x15')](_0x119b48,{'showHidden':![],'depth':null}));};}function _0x1e22a7(_0x1b0ea4,_0x443049){var _0x51d538=_0x443049[_0x3fa6('0x16')]?_0x443049['scheduledat']:moment()['format'](_0x3fa6('0x17'));return new BPromise(function(_0x4b54c0,_0x1d34f7){if(_[_0x3fa6('0x18')](_0x443049['dialTimezone'])){_0x4b54c0({'ret':_0x51d538});}else{_0x3323a0['VoiceQueue']['findOne']({'where':{'id':_0x1b0ea4['id']}})[_0x3fa6('0x19')](function(_0x4a1cf7){if(!_['isNil'](_0x4a1cf7)){var _0x1917bc=_0x4a1cf7[_0x3fa6('0x1a')];if(!_[_0x3fa6('0x18')](_0x1917bc)){var _0x512c2b=shared[_0x3fa6('0x1b')];var _0x1dac59=_0x512c2b[_0x1917bc];var _0x40158c=_0x512c2b[_0x443049[_0x3fa6('0x1a')]];if(!_[_0x3fa6('0x18')](_0x1dac59)&&!_[_0x3fa6('0x18')](_0x40158c)){var _0x513702=_0x1dac59[_0x3fa6('0x1c')]-_0x40158c[_0x3fa6('0x1c')];_0x51d538=_0x443049[_0x3fa6('0x16')]?_0x443049['scheduledat']:moment();var _0x15f5c6=moment(_0x51d538)['add'](_0x513702,_0x3fa6('0x1d'));_0x4b54c0({'ret':_0x15f5c6[_0x3fa6('0x1e')](_0x3fa6('0x17'))});}else _0x4b54c0({'ret':_0x51d538});}else _0x4b54c0({'ret':_0x51d538});}else{_0x4b54c0({'ret':_0x51d538});}});}});return 0xa;}var _0x57b491=function(_0x5f2709){return new BPromise(function(_0x4230c8,_0x4e93f7){_0x1e22a7(_0x5f2709,_0x44ad3b)['then'](function(_0x2a9304){_0x44ad3b[_0x3fa6('0x16')]=_0x2a9304['ret'];_0x3323a0[_0x3fa6('0x1f')]['findOne']({'where':{'phone':_0x44ad3b['phone'],'VoiceQueueId':_0x5f2709['id']}})[_0x3fa6('0x19')](function(_0x58e853){if(!_[_0x3fa6('0x18')](_0x58e853)){throw new Error(_0x3fa6('0x20')+_0x44ad3b[_0x3fa6('0xc')]+_0x3fa6('0x21')+_0x5f2709['id']);}return _0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b[_0x3fa6('0x23')],'priority':_0x44ad3b[_0x3fa6('0x24')]?_0x44ad3b[_0x3fa6('0x24')]:0x2,'scheduledat':_0x44ad3b['scheduledat']?_0x44ad3b[_0x3fa6('0x16')]:moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')),'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b[_0x3fa6('0x25')]?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')):undefined,'VoiceQueueId':_0x5f2709['id']});})[_0x3fa6('0x26')](function(_0x3019c3){_0x4e93f7(_0x3019c3);});});});};var _0x15c088=function(_0x44f1ad){return new BPromise(function(_0x2fa699,_0x2d4cba){_0x1e22a7(_0x44f1ad,_0x44ad3b)[_0x3fa6('0x19')](function(_0x5cbb7d){_0x44ad3b[_0x3fa6('0x16')]=_0x5cbb7d['ret'];_0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x27')]({'where':{'phone':_0x44ad3b[_0x3fa6('0xc')],'VoiceQueueId':_0x44f1ad['id']}})['then'](function(_0x3800a7){if(!_[_0x3fa6('0x18')](_0x3800a7)){throw new Error(_0x3fa6('0x20')+_0x44ad3b[_0x3fa6('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x44f1ad['id']);}return _0x3323a0[_0x3fa6('0x28')][_0x3fa6('0x27')]({'where':{'calleridnum':_0x44ad3b[_0x3fa6('0xc')],'VoiceQueueId':_0x44f1ad['id']}});})[_0x3fa6('0x19')](function(_0x3f19a3){if(!_[_0x3fa6('0x18')](_0x3f19a3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x44ad3b[_0x3fa6('0xc')]+_0x3fa6('0x29')+_0x44f1ad['id']);}return _0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b[_0x3fa6('0x23')],'priority':_0x44ad3b[_0x3fa6('0x24')]?_0x44ad3b[_0x3fa6('0x24')]:0x2,'scheduledat':_0x44ad3b[_0x3fa6('0x16')]?_0x44ad3b[_0x3fa6('0x16')]:moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')),'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b[_0x3fa6('0x25')]?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()['format'](_0x3fa6('0x17')):undefined,'VoiceQueueId':_0x44f1ad['id']});})['catch'](function(_0x1a8146){_0x2d4cba(_0x1a8146);});});});};function _0x4a5fbc(){return function(_0x40539c){logger[_0x3fa6('0x12')](_0x3fa6('0x13'),_0x3fa6('0x14'),util[_0x3fa6('0x15')](_0x40539c,{'showHidden':![],'depth':null}));};}function _0x2f9b75(_0x2398a0,_0x2fa2ba){var _0x28793e=_0x2fa2ba[_0x3fa6('0x16')]?_0x2fa2ba[_0x3fa6('0x16')]:moment()[_0x3fa6('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x3dd478,_0x44119e){if(_[_0x3fa6('0x18')](_0x2fa2ba['dialTimezone'])){_0x3dd478({'ret':_0x28793e});}else{_0x3323a0[_0x3fa6('0x2a')]['findOne']({'where':{'id':_0x2398a0['id']}})[_0x3fa6('0x19')](function(_0x262be0){if(!_[_0x3fa6('0x18')](_0x262be0)){var _0x2a6974=_0x262be0[_0x3fa6('0x1a')];if(!_[_0x3fa6('0x18')](_0x2a6974)){var _0x201e07=shared[_0x3fa6('0x1b')];var _0x6fce55=_0x201e07[_0x2a6974];var _0x494428=_0x201e07[_0x2fa2ba[_0x3fa6('0x1a')]];if(!_[_0x3fa6('0x18')](_0x6fce55)&&!_[_0x3fa6('0x18')](_0x494428)){var _0x2afc38=_0x6fce55[_0x3fa6('0x1c')]-_0x494428[_0x3fa6('0x1c')];_0x28793e=_0x2fa2ba[_0x3fa6('0x16')]?_0x2fa2ba['scheduledat']:moment();var _0x13b7ef=moment(_0x28793e)[_0x3fa6('0x2b')](_0x2afc38,'minutes');_0x3dd478({'ret':_0x13b7ef[_0x3fa6('0x1e')](_0x3fa6('0x17'))});}else _0x3dd478({'ret':_0x28793e});}else _0x3dd478({'ret':_0x28793e});}else{_0x3dd478({'ret':_0x28793e});}});}});return 0xa;}var _0x524189=function(_0x5053ab){return new BPromise(function(_0x2e1b9a,_0x4f8834){_0x2f9b75(_0x5053ab,_0x44ad3b)[_0x3fa6('0x19')](function(_0x57e93b){_0x44ad3b[_0x3fa6('0x16')]=_0x57e93b['ret'];_0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x27')]({'where':{'phone':_0x44ad3b[_0x3fa6('0xc')],'CampaignId':_0x5053ab['id']}})['then'](function(_0x583937){if(!_[_0x3fa6('0x18')](_0x583937)){throw new Error(_0x3fa6('0x20')+_0x44ad3b['phone']+_0x3fa6('0x2c')+_0x5053ab['id']);}return _0x3323a0['CmHopper'][_0x3fa6('0x22')]({'phone':_0x44ad3b['phone'],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b[_0x3fa6('0x23')],'priority':_0x44ad3b['priority']?_0x44ad3b[_0x3fa6('0x24')]:0x2,'scheduledat':_0x44ad3b[_0x3fa6('0x16')]?_0x44ad3b['scheduledat']:moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')),'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b[_0x3fa6('0x25')]?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')):undefined,'CampaignId':_0x5053ab['id']});})[_0x3fa6('0x26')](function(_0x191f3c){_0x4f8834(_0x191f3c);});});});};var _0x168d51=function(_0x25d19e){return new BPromise(function(_0x26f564,_0x157ff4){_0x2f9b75(_0x25d19e,_0x44ad3b)[_0x3fa6('0x19')](function(_0x4bdcd5){_0x44ad3b[_0x3fa6('0x16')]=_0x4bdcd5[_0x3fa6('0x2d')];_0x3323a0[_0x3fa6('0x1f')]['findOne']({'where':{'phone':_0x44ad3b[_0x3fa6('0xc')],'CampaignId':_0x25d19e['id']}})[_0x3fa6('0x19')](function(_0xe3e31c){if(!_['isNil'](_0xe3e31c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x44ad3b[_0x3fa6('0xc')]+_0x3fa6('0x2e')+_0x25d19e['id']);}return _0x3323a0['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x44ad3b[_0x3fa6('0xc')],'CampaignId':_0x25d19e['id']}});})['then'](function(_0x2fa2a2){if(!_[_0x3fa6('0x18')](_0x2fa2a2)){throw new Error(_0x3fa6('0x2f')+_0x44ad3b[_0x3fa6('0xc')]+_0x3fa6('0x30')+_0x25d19e['id']);}return _0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x22')]({'phone':_0x44ad3b['phone'],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b['ListId'],'priority':_0x44ad3b[_0x3fa6('0x24')]?_0x44ad3b['priority']:0x2,'scheduledat':_0x44ad3b[_0x3fa6('0x16')]?_0x44ad3b[_0x3fa6('0x16')]:moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')),'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b[_0x3fa6('0x25')]?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x25d19e['id']});})['catch'](function(_0x2e0cd9){_0x157ff4(_0x2e0cd9);});});});};if(_0x44ad3b[_0x3fa6('0x23')]){_0x3323a0[_0x3fa6('0x31')][_0x3fa6('0x32')]({'where':{'type':_0x3fa6('0x33')},'attributes':['id',_0x3fa6('0x34'),_0x3fa6('0x1a')],'include':[{'model':_0x3323a0['CmList'],'as':_0x3fa6('0x35'),'where':{'id':_0x44ad3b[_0x3fa6('0x23')]}}]})[_0x3fa6('0x19')](function(_0x27ca9e){if(_0x27ca9e){var _0x3258aa=[];for(var _0x2c6ab7=0x0,_0x30924d;_0x2c6ab7<_0x27ca9e['length'];_0x2c6ab7+=0x1){_0x30924d=_0x27ca9e[_0x2c6ab7][_0x3fa6('0x11')]({'plain':!![]});switch(_0x30924d[_0x3fa6('0x34')]){case _0x3fa6('0x36'):_0x15c088(_0x30924d)[_0x3fa6('0x26')](_0x23f91());break;case'onlyIfOpen':_0x57b491(_0x30924d)['catch'](_0x23f91());break;default:_0x2f9b75(_0x30924d,_0x44ad3b)[_0x3fa6('0x19')](function(_0x58034d){_0x44ad3b['scheduledat']=_0x58034d[_0x3fa6('0x2d')];_0x3323a0['CmHopper'][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b['ListId'],'scheduledat':_0x44ad3b[_0x3fa6('0x16')]?_0x44ad3b[_0x3fa6('0x16')]:moment()['format'](_0x3fa6('0x17')),'priority':_0x44ad3b['priority']?_0x44ad3b['priority']:0x2,'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b['callbackUniqueid']?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')):undefined,'VoiceQueueId':_0x30924d['id']})[_0x3fa6('0x26')](_0x23f91());});}}}})['then'](function(){return _0x3323a0[_0x3fa6('0x31')][_0x3fa6('0x32')]({'where':{'type':_0x3fa6('0x33')},'attributes':['id'],'include':[{'model':_0x3323a0[_0x3fa6('0x37')],'as':_0x3fa6('0x38'),'where':{'id':_0x44ad3b[_0x3fa6('0x23')]}}]})[_0x3fa6('0x19')](function(_0x2f08d0){if(_0x2f08d0){var _0x150857=[];for(var _0x203115=0x0,_0x29a6b3;_0x203115<_0x2f08d0[_0x3fa6('0x39')];_0x203115+=0x1){_0x29a6b3=_0x2f08d0[_0x203115][_0x3fa6('0x11')]({'plain':!![]});_0x3323a0[_0x3fa6('0x3a')][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b['ListId'],'VoiceQueueId':_0x29a6b3['id']})[_0x3fa6('0x26')](function(_0x154ba1){logger[_0x3fa6('0x12')](_0x3fa6('0x3b'),'afterCreate',_0x154ba1['message']);});}}});})[_0x3fa6('0x19')](function(){return _0x3323a0['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType',_0x3fa6('0x1a')],'include':[{'model':_0x3323a0[_0x3fa6('0x37')],'as':_0x3fa6('0x35'),'where':{'id':_0x44ad3b[_0x3fa6('0x23')]}}]})[_0x3fa6('0x19')](function(_0x466589){if(_0x466589){var _0x83de00=[];for(var _0x55e933=0x0,_0x2af963;_0x55e933<_0x466589[_0x3fa6('0x39')];_0x55e933+=0x1){_0x2af963=_0x466589[_0x55e933][_0x3fa6('0x11')]({'plain':!![]});switch(_0x2af963[_0x3fa6('0x34')]){case _0x3fa6('0x36'):_0x168d51(_0x2af963)[_0x3fa6('0x26')](_0x4a5fbc());break;case _0x3fa6('0x3c'):_0x524189(_0x2af963)['catch'](_0x4a5fbc());break;default:_0x3323a0[_0x3fa6('0x1f')][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b[_0x3fa6('0x23')],'scheduledat':_0x44ad3b[_0x3fa6('0x16')]?_0x44ad3b[_0x3fa6('0x16')]:moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')),'priority':_0x44ad3b[_0x3fa6('0x24')]?_0x44ad3b[_0x3fa6('0x24')]:0x2,'callback':_0x44ad3b[_0x3fa6('0x25')]?!![]:![],'callbackuniqueid':_0x44ad3b[_0x3fa6('0x25')]?_0x44ad3b[_0x3fa6('0x25')]:undefined,'callbackat':_0x44ad3b[_0x3fa6('0x25')]?moment()[_0x3fa6('0x1e')](_0x3fa6('0x17')):undefined,'CampaignId':_0x2af963['id']})[_0x3fa6('0x26')](_0x4a5fbc());}}}});})[_0x3fa6('0x19')](function(){return _0x3323a0[_0x3fa6('0x2a')][_0x3fa6('0x32')]({'attributes':['id'],'include':[{'model':_0x3323a0[_0x3fa6('0x37')],'as':_0x3fa6('0x38'),'where':{'id':_0x44ad3b[_0x3fa6('0x23')]}}]})[_0x3fa6('0x19')](function(_0x20b1f9){if(_0x20b1f9){var _0x22a485=[];for(var _0x27cab2=0x0,_0x13703f;_0x27cab2<_0x20b1f9[_0x3fa6('0x39')];_0x27cab2+=0x1){_0x13703f=_0x20b1f9[_0x27cab2]['get']({'plain':!![]});_0x3323a0[_0x3fa6('0x3a')][_0x3fa6('0x22')]({'phone':_0x44ad3b[_0x3fa6('0xc')],'ContactId':_0x44ad3b['id'],'ListId':_0x44ad3b['ListId'],'CampaignId':_0x13703f['id']})[_0x3fa6('0x26')](function(_0x1b5caf){logger[_0x3fa6('0x12')](_0x3fa6('0x3b'),_0x3fa6('0x14'),_0x1b5caf[_0x3fa6('0x3d')]);});}}});})['then'](function(){_0x274794();})[_0x3fa6('0x26')](function(_0x115950){logger[_0x3fa6('0x12')](_0x3fa6('0x3b'),'afterCreate',_0x115950['message']);_0x274794(_0x115950);});}else{_0x274794(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x48d709,_0x27df2c,_0x3e4c0c){var _0x3c0d2f=_0x441265[_0x3fa6('0x3e')];var _0x4cfdfe=_0x48d709['get']({'plain':!![]});return _0x3c0d2f['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x4cfdfe[_0x3fa6('0x23')],'ContactId':_0x4cfdfe['id']}})['then'](function(_0x210a80){if(!_[_0x3fa6('0x3f')](_0x210a80)){var _0xce63a2=[];for(var _0x5704c0=0x0;_0x5704c0<_0x210a80[_0x3fa6('0x39')];_0x5704c0+=0x1){var _0x89a862=_0x3c0d2f[_0x3fa6('0x1f')][_0x3fa6('0x40')]({'where':{'ListId':_0x210a80[_0x5704c0][_0x3fa6('0x23')],'ContactId':_0x210a80[_0x5704c0]['ContactId'],'VoiceQueueId':_0x210a80[_0x5704c0][_0x3fa6('0x41')],'CampaignId':_0x210a80[_0x5704c0][_0x3fa6('0x42')]}});_0xce63a2[_0x3fa6('0x43')](_0x89a862);}return BPromise[_0x3fa6('0x44')](_0xce63a2);}})[_0x3fa6('0x19')](function(_0x553881){logger[_0x3fa6('0x45')](_0x3fa6('0x46'),util[_0x3fa6('0x15')](_0x553881,{'showHidden':![],'depth':null}));_0x3e4c0c();})['catch'](function(_0x354410){logger[_0x3fa6('0x12')](_0x3fa6('0x47'),util['inspect'](_0x354410,{'showHidden':![],'depth':null}));_0x3e4c0c(_0x354410);});}}});}; \ No newline at end of file +var _0x4581=['format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones','add','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','CmHopper','inspect','Campaign','utcOffset','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','length','onlyIfOpen','List\x20not\x20found','models','isEmpty','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','get','error','cmContact','afterCreate','scheduledat'];(function(_0x152f5b,_0x2648b7){var _0x481323=function(_0x166634){while(--_0x166634){_0x152f5b['push'](_0x152f5b['shift']());}};_0x481323(++_0x2648b7);}(_0x4581,0x110));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1458('0x0'));var util=require(_0x1458('0x1'));var logger=require(_0x1458('0x2'))(_0x1458('0x3'));var moment=require(_0x1458('0x4'));var BPromise=require(_0x1458('0x5'));var rp=require(_0x1458('0x6'));var fs=require('fs');var path=require(_0x1458('0x7'));var rimraf=require(_0x1458('0x8'));var config=require(_0x1458('0x9'));var shared=require(_0x1458('0xa'));var attributes=require(_0x1458('0xb'));module[_0x1458('0xc')]=function(_0x26aa70,_0x475892){return _0x26aa70[_0x1458('0xd')](_0x1458('0xe'),attributes,{'tableName':_0x1458('0xf'),'paranoid':!![],'indexes':[{'name':_0x1458('0x10'),'fields':[_0x1458('0x10')]},{'name':'fti_cm_contacts','fields':[_0x1458('0x11'),_0x1458('0x12'),_0x1458('0x10'),'mobile',_0x1458('0x13'),_0x1458('0x14')],'type':_0x1458('0x15')}],'timestamps':!![],'charset':_0x1458('0x16'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x5492ad,_0x1a2e21,_0x6ddbf0){var _0x15481e=_0x26aa70['models'];var _0x767451=_0x5492ad[_0x1458('0x17')]({'plain':!![]});function _0x427502(){return function(_0x6fb471){logger[_0x1458('0x18')](_0x1458('0x19'),_0x1458('0x1a'),util['inspect'](_0x6fb471,{'showHidden':![],'depth':null}));};}function _0x35524f(_0x5cd8d4,_0xd8874){var _0x3aa81b=_0xd8874[_0x1458('0x1b')]?_0xd8874[_0x1458('0x1b')]:moment()[_0x1458('0x1c')](_0x1458('0x1d'));return new BPromise(function(_0xd4fe67,_0x278655){if(_[_0x1458('0x1e')](_0xd8874[_0x1458('0x1f')])){_0xd4fe67({'ret':_0x3aa81b});}else{_0x15481e[_0x1458('0x20')]['findOne']({'where':{'id':_0x5cd8d4['id']}})[_0x1458('0x21')](function(_0x4fef7f){if(!_['isNil'](_0x4fef7f)){var _0x5c57cb=_0x4fef7f['dialTimezone'];if(!_['isNil'](_0x5c57cb)){var _0x4dfae3=shared[_0x1458('0x22')];var _0x22bc83=_0x4dfae3[_0x5c57cb];var _0x2dd7b9=_0x4dfae3[_0xd8874[_0x1458('0x1f')]];if(!_[_0x1458('0x1e')](_0x22bc83)&&!_[_0x1458('0x1e')](_0x2dd7b9)){var _0x1b06ee=_0x22bc83['utcOffset']-_0x2dd7b9['utcOffset'];_0x3aa81b=_0xd8874[_0x1458('0x1b')]?_0xd8874[_0x1458('0x1b')]:moment();var _0x1a16fb=moment(_0x3aa81b)[_0x1458('0x23')](_0x1b06ee,_0x1458('0x24'));_0xd4fe67({'ret':_0x1a16fb[_0x1458('0x1c')](_0x1458('0x1d'))});}else _0xd4fe67({'ret':_0x3aa81b});}else _0xd4fe67({'ret':_0x3aa81b});}else{_0xd4fe67({'ret':_0x3aa81b});}});}});return 0xa;}var _0x3fe4b5=function(_0x245352){return new BPromise(function(_0xbaac4c,_0x590a8c){_0x35524f(_0x245352,_0x767451)[_0x1458('0x21')](function(_0x5d97a2){_0x767451['scheduledat']=_0x5d97a2['ret'];_0x15481e['CmHopper']['findOne']({'where':{'phone':_0x767451[_0x1458('0x10')],'VoiceQueueId':_0x245352['id']}})['then'](function(_0x515944){if(!_[_0x1458('0x1e')](_0x515944)){throw new Error('cmContact,\x20afterCreate\x20'+_0x767451['phone']+_0x1458('0x25')+_0x245352['id']);}return _0x15481e['CmHopper'][_0x1458('0x26')]({'phone':_0x767451[_0x1458('0x10')],'ContactId':_0x767451['id'],'ListId':_0x767451[_0x1458('0x27')],'priority':_0x767451[_0x1458('0x28')]?_0x767451[_0x1458('0x28')]:0x2,'scheduledat':_0x767451['scheduledat']?_0x767451[_0x1458('0x1b')]:moment()[_0x1458('0x1c')](_0x1458('0x1d')),'callback':_0x767451['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451[_0x1458('0x29')]:undefined,'callbackat':_0x767451['callbackUniqueid']?moment()[_0x1458('0x1c')](_0x1458('0x1d')):undefined,'VoiceQueueId':_0x245352['id']});})[_0x1458('0x2a')](function(_0x2e812d){_0x590a8c(_0x2e812d);});});});};var _0x4a52f6=function(_0x3b79d6){return new BPromise(function(_0x180452,_0x5b8445){_0x35524f(_0x3b79d6,_0x767451)[_0x1458('0x21')](function(_0x5e1c9f){_0x767451[_0x1458('0x1b')]=_0x5e1c9f['ret'];_0x15481e['CmHopper'][_0x1458('0x2b')]({'where':{'phone':_0x767451[_0x1458('0x10')],'VoiceQueueId':_0x3b79d6['id']}})[_0x1458('0x21')](function(_0x28ddf2){if(!_['isNil'](_0x28ddf2)){throw new Error(_0x1458('0x2c')+_0x767451[_0x1458('0x10')]+_0x1458('0x2d')+_0x3b79d6['id']);}return _0x15481e['CmHopperFinal'][_0x1458('0x2b')]({'where':{'calleridnum':_0x767451['phone'],'VoiceQueueId':_0x3b79d6['id']}});})[_0x1458('0x21')](function(_0x38717e){if(!_[_0x1458('0x1e')](_0x38717e)){throw new Error(_0x1458('0x2e')+_0x767451['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x3b79d6['id']);}return _0x15481e[_0x1458('0x2f')][_0x1458('0x26')]({'phone':_0x767451[_0x1458('0x10')],'ContactId':_0x767451['id'],'ListId':_0x767451[_0x1458('0x27')],'priority':_0x767451[_0x1458('0x28')]?_0x767451[_0x1458('0x28')]:0x2,'scheduledat':_0x767451[_0x1458('0x1b')]?_0x767451[_0x1458('0x1b')]:moment()[_0x1458('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x767451[_0x1458('0x29')]?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451['callbackUniqueid']:undefined,'callbackat':_0x767451[_0x1458('0x29')]?moment()[_0x1458('0x1c')](_0x1458('0x1d')):undefined,'VoiceQueueId':_0x3b79d6['id']});})['catch'](function(_0x3e27cb){_0x5b8445(_0x3e27cb);});});});};function _0x5ae729(){return function(_0xd50c5e){logger[_0x1458('0x18')](_0x1458('0x19'),'afterCreate',util[_0x1458('0x30')](_0xd50c5e,{'showHidden':![],'depth':null}));};}function _0x3d6bde(_0x792311,_0x20830a){var _0x289cd9=_0x20830a[_0x1458('0x1b')]?_0x20830a[_0x1458('0x1b')]:moment()[_0x1458('0x1c')](_0x1458('0x1d'));return new BPromise(function(_0xd7632,_0x22f09d){if(_['isNil'](_0x20830a['dialTimezone'])){_0xd7632({'ret':_0x289cd9});}else{_0x15481e[_0x1458('0x31')][_0x1458('0x2b')]({'where':{'id':_0x792311['id']}})['then'](function(_0x3671d8){if(!_[_0x1458('0x1e')](_0x3671d8)){var _0x42b0cb=_0x3671d8[_0x1458('0x1f')];if(!_[_0x1458('0x1e')](_0x42b0cb)){var _0x35412c=shared['timezones'];var _0x5d1364=_0x35412c[_0x42b0cb];var _0x2cb7b9=_0x35412c[_0x20830a[_0x1458('0x1f')]];if(!_['isNil'](_0x5d1364)&&!_[_0x1458('0x1e')](_0x2cb7b9)){var _0x1b74db=_0x5d1364[_0x1458('0x32')]-_0x2cb7b9[_0x1458('0x32')];_0x289cd9=_0x20830a[_0x1458('0x1b')]?_0x20830a[_0x1458('0x1b')]:moment();var _0x4f8021=moment(_0x289cd9)[_0x1458('0x23')](_0x1b74db,_0x1458('0x24'));_0xd7632({'ret':_0x4f8021[_0x1458('0x1c')](_0x1458('0x1d'))});}else _0xd7632({'ret':_0x289cd9});}else _0xd7632({'ret':_0x289cd9});}else{_0xd7632({'ret':_0x289cd9});}});}});return 0xa;}var _0x5d0468=function(_0x5269bf){return new BPromise(function(_0x95cc3b,_0x4e783d){_0x3d6bde(_0x5269bf,_0x767451)[_0x1458('0x21')](function(_0x3f6ad0){_0x767451[_0x1458('0x1b')]=_0x3f6ad0[_0x1458('0x33')];_0x15481e[_0x1458('0x2f')]['findOne']({'where':{'phone':_0x767451[_0x1458('0x10')],'CampaignId':_0x5269bf['id']}})[_0x1458('0x21')](function(_0x1d3304){if(!_['isNil'](_0x1d3304)){throw new Error('cmContact,\x20afterCreate\x20'+_0x767451[_0x1458('0x10')]+_0x1458('0x34')+_0x5269bf['id']);}return _0x15481e[_0x1458('0x2f')][_0x1458('0x26')]({'phone':_0x767451[_0x1458('0x10')],'ContactId':_0x767451['id'],'ListId':_0x767451['ListId'],'priority':_0x767451[_0x1458('0x28')]?_0x767451['priority']:0x2,'scheduledat':_0x767451[_0x1458('0x1b')]?_0x767451[_0x1458('0x1b')]:moment()['format'](_0x1458('0x1d')),'callback':_0x767451['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451['callbackUniqueid']:undefined,'callbackat':_0x767451[_0x1458('0x29')]?moment()[_0x1458('0x1c')](_0x1458('0x1d')):undefined,'CampaignId':_0x5269bf['id']});})[_0x1458('0x2a')](function(_0x26c0bc){_0x4e783d(_0x26c0bc);});});});};var _0xd3068b=function(_0x36f1e8){return new BPromise(function(_0x1c24c4,_0x229776){_0x3d6bde(_0x36f1e8,_0x767451)[_0x1458('0x21')](function(_0x582892){_0x767451['scheduledat']=_0x582892[_0x1458('0x33')];_0x15481e[_0x1458('0x2f')]['findOne']({'where':{'phone':_0x767451[_0x1458('0x10')],'CampaignId':_0x36f1e8['id']}})[_0x1458('0x21')](function(_0x51b1dd){if(!_[_0x1458('0x1e')](_0x51b1dd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x767451[_0x1458('0x10')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x36f1e8['id']);}return _0x15481e['CmHopperFinal'][_0x1458('0x2b')]({'where':{'calleridnum':_0x767451['phone'],'CampaignId':_0x36f1e8['id']}});})[_0x1458('0x21')](function(_0x1ade6a){if(!_[_0x1458('0x1e')](_0x1ade6a)){throw new Error(_0x1458('0x2e')+_0x767451['phone']+_0x1458('0x35')+_0x36f1e8['id']);}return _0x15481e[_0x1458('0x2f')][_0x1458('0x26')]({'phone':_0x767451['phone'],'ContactId':_0x767451['id'],'ListId':_0x767451['ListId'],'priority':_0x767451['priority']?_0x767451[_0x1458('0x28')]:0x2,'scheduledat':_0x767451[_0x1458('0x1b')]?_0x767451['scheduledat']:moment()['format'](_0x1458('0x1d')),'callback':_0x767451['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451['callbackUniqueid']:undefined,'callbackat':_0x767451[_0x1458('0x29')]?moment()['format'](_0x1458('0x1d')):undefined,'CampaignId':_0x36f1e8['id']});})['catch'](function(_0x15ef8d){_0x229776(_0x15ef8d);});});});};if(_0x767451[_0x1458('0x27')]){_0x15481e[_0x1458('0x20')][_0x1458('0x36')]({'where':{'type':_0x1458('0x37')},'attributes':['id',_0x1458('0x38'),_0x1458('0x1f')],'include':[{'model':_0x15481e[_0x1458('0x39')],'as':_0x1458('0x3a'),'where':{'id':_0x767451[_0x1458('0x27')]}}]})[_0x1458('0x21')](function(_0x5d897f){if(_0x5d897f){var _0x4de424=[];for(var _0x2c84cd=0x0,_0xb79c77;_0x2c84cd<_0x5d897f['length'];_0x2c84cd+=0x1){_0xb79c77=_0x5d897f[_0x2c84cd][_0x1458('0x17')]({'plain':!![]});switch(_0xb79c77[_0x1458('0x38')]){case _0x1458('0x3b'):_0x4a52f6(_0xb79c77)[_0x1458('0x2a')](_0x427502());break;case'onlyIfOpen':_0x3fe4b5(_0xb79c77)[_0x1458('0x2a')](_0x427502());break;default:_0x3d6bde(_0xb79c77,_0x767451)[_0x1458('0x21')](function(_0x56a517){_0x767451[_0x1458('0x1b')]=_0x56a517[_0x1458('0x33')];_0x15481e[_0x1458('0x2f')][_0x1458('0x26')]({'phone':_0x767451['phone'],'ContactId':_0x767451['id'],'ListId':_0x767451['ListId'],'scheduledat':_0x767451['scheduledat']?_0x767451[_0x1458('0x1b')]:moment()[_0x1458('0x1c')](_0x1458('0x1d')),'priority':_0x767451['priority']?_0x767451[_0x1458('0x28')]:0x2,'callback':_0x767451[_0x1458('0x29')]?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451['callbackUniqueid']:undefined,'callbackat':_0x767451['callbackUniqueid']?moment()[_0x1458('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xb79c77['id']})[_0x1458('0x2a')](_0x427502());});}}}})['then'](function(){return _0x15481e['VoiceQueue']['findAll']({'where':{'type':_0x1458('0x37')},'attributes':['id'],'include':[{'model':_0x15481e[_0x1458('0x39')],'as':_0x1458('0x3c'),'where':{'id':_0x767451[_0x1458('0x27')]}}]})['then'](function(_0x447731){if(_0x447731){var _0x1ee7c9=[];for(var _0x7a7f=0x0,_0x1e2ed0;_0x7a7f<_0x447731['length'];_0x7a7f+=0x1){_0x1e2ed0=_0x447731[_0x7a7f][_0x1458('0x17')]({'plain':!![]});_0x15481e[_0x1458('0x3d')][_0x1458('0x26')]({'phone':_0x767451['phone'],'ContactId':_0x767451['id'],'ListId':_0x767451[_0x1458('0x27')],'VoiceQueueId':_0x1e2ed0['id']})['catch'](function(_0x2d5789){logger['error'](_0x1458('0x3e'),'afterCreate',_0x2d5789[_0x1458('0x3f')]);});}}});})[_0x1458('0x21')](function(){return _0x15481e['Campaign'][_0x1458('0x36')]({'attributes':['id',_0x1458('0x38'),_0x1458('0x1f')],'include':[{'model':_0x15481e['CmList'],'as':'Lists','where':{'id':_0x767451[_0x1458('0x27')]}}]})['then'](function(_0x16ca6b){if(_0x16ca6b){var _0x48a363=[];for(var _0xe42a4a=0x0,_0x155768;_0xe42a4a<_0x16ca6b[_0x1458('0x40')];_0xe42a4a+=0x1){_0x155768=_0x16ca6b[_0xe42a4a][_0x1458('0x17')]({'plain':!![]});switch(_0x155768[_0x1458('0x38')]){case _0x1458('0x3b'):_0xd3068b(_0x155768)[_0x1458('0x2a')](_0x5ae729());break;case _0x1458('0x41'):_0x5d0468(_0x155768)['catch'](_0x5ae729());break;default:_0x15481e[_0x1458('0x2f')][_0x1458('0x26')]({'phone':_0x767451['phone'],'ContactId':_0x767451['id'],'ListId':_0x767451[_0x1458('0x27')],'scheduledat':_0x767451[_0x1458('0x1b')]?_0x767451[_0x1458('0x1b')]:moment()[_0x1458('0x1c')](_0x1458('0x1d')),'priority':_0x767451[_0x1458('0x28')]?_0x767451[_0x1458('0x28')]:0x2,'callback':_0x767451[_0x1458('0x29')]?!![]:![],'callbackuniqueid':_0x767451[_0x1458('0x29')]?_0x767451[_0x1458('0x29')]:undefined,'callbackat':_0x767451['callbackUniqueid']?moment()['format'](_0x1458('0x1d')):undefined,'CampaignId':_0x155768['id']})[_0x1458('0x2a')](_0x5ae729());}}}});})[_0x1458('0x21')](function(){return _0x15481e['Campaign'][_0x1458('0x36')]({'attributes':['id'],'include':[{'model':_0x15481e['CmList'],'as':_0x1458('0x3c'),'where':{'id':_0x767451[_0x1458('0x27')]}}]})[_0x1458('0x21')](function(_0xe16dba){if(_0xe16dba){var _0x1fd699=[];for(var _0x94d9bd=0x0,_0x2826a4;_0x94d9bd<_0xe16dba[_0x1458('0x40')];_0x94d9bd+=0x1){_0x2826a4=_0xe16dba[_0x94d9bd][_0x1458('0x17')]({'plain':!![]});_0x15481e['CmHopperBlack'][_0x1458('0x26')]({'phone':_0x767451[_0x1458('0x10')],'ContactId':_0x767451['id'],'ListId':_0x767451[_0x1458('0x27')],'CampaignId':_0x2826a4['id']})[_0x1458('0x2a')](function(_0x575d26){logger['error'](_0x1458('0x3e'),_0x1458('0x1a'),_0x575d26['message']);});}}});})[_0x1458('0x21')](function(){_0x6ddbf0();})[_0x1458('0x2a')](function(_0x3f1660){logger['error'](_0x1458('0x3e'),_0x1458('0x1a'),_0x3f1660['message']);_0x6ddbf0(_0x3f1660);});}else{_0x6ddbf0(new Error(_0x1458('0x42')));}},'afterDestroy':function(_0x55e5f3,_0x911273,_0x3f6a1d){var _0x562af0=_0x26aa70[_0x1458('0x43')];var _0x5de195=_0x55e5f3[_0x1458('0x17')]({'plain':!![]});return _0x562af0[_0x1458('0x2f')][_0x1458('0x36')]({'raw':!![],'where':{'ListId':_0x5de195[_0x1458('0x27')],'ContactId':_0x5de195['id']}})[_0x1458('0x21')](function(_0x1348cc){if(!_[_0x1458('0x44')](_0x1348cc)){var _0x5ddf74=[];for(var _0x3367ee=0x0;_0x3367ee<_0x1348cc['length'];_0x3367ee+=0x1){var _0x42ddf7=_0x562af0[_0x1458('0x2f')]['destroy']({'where':{'ListId':_0x1348cc[_0x3367ee][_0x1458('0x27')],'ContactId':_0x1348cc[_0x3367ee]['ContactId'],'VoiceQueueId':_0x1348cc[_0x3367ee][_0x1458('0x45')],'CampaignId':_0x1348cc[_0x3367ee][_0x1458('0x46')]}});_0x5ddf74[_0x1458('0x47')](_0x42ddf7);}return BPromise[_0x1458('0x48')](_0x5ddf74);}})[_0x1458('0x21')](function(_0x5e0dd6){logger['info'](_0x1458('0x49'),util['inspect'](_0x5e0dd6,{'showHidden':![],'depth':null}));_0x3f6a1d();})[_0x1458('0x2a')](function(_0x4cabca){logger[_0x1458('0x18')](_0x1458('0x4a'),util[_0x1458('0x30')](_0x4cabca,{'showHidden':![],'depth':null}));_0x3f6a1d(_0x4cabca);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index d49af31..cc070ce 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x16bc87,_0x43c8e0){var _0x561f35=function(_0x5cb6e3){while(--_0x5cb6e3){_0x16bc87['push'](_0x16bc87['shift']());}};_0x561f35(++_0x43c8e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 9e6088e..e6af263 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab3a=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab3a,0x1d3));var _0xaab3=function(_0x3137f0,_0x509d52){_0x3137f0=_0x3137f0-0x0;var _0x4c12c4=_0xab3a[_0x3137f0];return _0x4c12c4;};'use strict';var Sequelize=require(_0xaab3('0x0'));module[_0xaab3('0x1')]={'CmContactId':{'type':Sequelize[_0xaab3('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xaab3('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xaab3('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xaab3('0x3')],'defaultValue':_0xaab3('0x4')},'OrderBy':{'type':Sequelize[_0xaab3('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xaab3('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x9649=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x435268,_0x3df5ce){var _0x22d489=function(_0x4d114b){while(--_0x4d114b){_0x435268['push'](_0x435268['shift']());}};_0x22d489(++_0x3df5ce);}(_0x9649,0x19f));var _0x9964=function(_0x418ba9,_0x13d612){_0x418ba9=_0x418ba9-0x0;var _0x30d145=_0x9649[_0x418ba9];return _0x30d145;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'CmContactId':{'type':Sequelize[_0x9964('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x9964('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9964('0x3')],'defaultValue':_0x9964('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x9964('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 02fdba7..08895cd 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dd4=['CmContactHasItems','UserProfileResource','destroy','error','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','CmContactHasItem','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get'];(function(_0x5d1114,_0x3c4b87){var _0x3783a0=function(_0x45fdf1){while(--_0x45fdf1){_0x5d1114['push'](_0x5d1114['shift']());}};_0x3783a0(++_0x3c4b87);}(_0x6dd4,0xcd));var _0x46dd=function(_0x53b48e,_0x3d1415){_0x53b48e=_0x53b48e-0x0;var _0x4902ff=_0x6dd4[_0x53b48e];return _0x4902ff;};'use strict';var emlformat=require(_0x46dd('0x0'));var rimraf=require(_0x46dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x46dd('0x2'));var moment=require('moment');var BPromise=require(_0x46dd('0x3'));var Mustache=require('mustache');var util=require(_0x46dd('0x4'));var path=require(_0x46dd('0x5'));var sox=require('sox');var csv=require(_0x46dd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46dd('0x7'));var _=require(_0x46dd('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x46dd('0x9'));var deskjs=require(_0x46dd('0xa'));var toCsv=require(_0x46dd('0x6'));var querystring=require(_0x46dd('0xb'));var Papa=require(_0x46dd('0xc'));var Redis=require('ioredis');var authService=require(_0x46dd('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x46dd('0xe'));var hardwareService=require(_0x46dd('0xf'));var logger=require(_0x46dd('0x10'))('api');var utils=require(_0x46dd('0x11'));var config=require(_0x46dd('0x12'));var licenseUtil=require(_0x46dd('0x13'));var db=require(_0x46dd('0x14'))['db'];function respondWithStatusCode(_0x4faf35,_0x110600){_0x110600=_0x110600||0xcc;return function(_0x1d4e20){if(_0x1d4e20){return _0x4faf35[_0x46dd('0x15')](_0x110600);}return _0x4faf35[_0x46dd('0x16')](_0x110600)[_0x46dd('0x17')]();};}function respondWithResult(_0x23e9c1,_0x2b443a){_0x2b443a=_0x2b443a||0xc8;return function(_0x128d4b){if(_0x128d4b){return _0x23e9c1[_0x46dd('0x16')](_0x2b443a)[_0x46dd('0x18')](_0x128d4b);}};}function respondWithFilteredResult(_0x53e5aa,_0x3582f2){return function(_0x4229bd){if(_0x4229bd){var _0x32890d=typeof _0x3582f2[_0x46dd('0x19')]===_0x46dd('0x1a')&&typeof _0x3582f2['limit']===_0x46dd('0x1a');var _0x4456f9=_0x4229bd['count'];var _0x386fb8=_0x32890d?0x0:_0x3582f2[_0x46dd('0x19')];var _0x25e104=_0x32890d?_0x4229bd[_0x46dd('0x1b')]:_0x3582f2[_0x46dd('0x19')]+_0x3582f2[_0x46dd('0x1c')];var _0x4f8ede;if(_0x25e104>=_0x4456f9){_0x25e104=_0x4456f9;_0x4f8ede=0xc8;}else{_0x4f8ede=0xce;}_0x53e5aa[_0x46dd('0x16')](_0x4f8ede);return _0x53e5aa[_0x46dd('0x1d')](_0x46dd('0x1e'),_0x386fb8+'-'+_0x25e104+'/'+_0x4456f9)[_0x46dd('0x18')](_0x4229bd);}return null;};}function patchUpdates(_0x5be445){return function(_0xba3061){try{jsonpatch['apply'](_0xba3061,_0x5be445,!![]);}catch(_0x415db1){return BPromise['reject'](_0x415db1);}return _0xba3061[_0x46dd('0x1f')]();};}function saveUpdates(_0x1152e6,_0xe2389a){return function(_0x1b6f9d){if(_0x1b6f9d){return _0x1b6f9d[_0x46dd('0x20')](_0x1152e6)[_0x46dd('0x21')](function(_0x1e6176){return _0x1e6176;});}return null;};}function removeEntity(_0x4b115b,_0x5c652b){return function(_0x3d2044){if(_0x3d2044){return _0x3d2044['destroy']()['then'](function(){var _0xa5f46=_0x3d2044[_0x46dd('0x22')]({'plain':!![]});var _0x317ec3=_0x46dd('0x23');return db[_0x46dd('0x24')][_0x46dd('0x25')]({'where':{'type':_0x317ec3,'resourceId':_0xa5f46['id']}})[_0x46dd('0x21')](function(){return _0x3d2044;});})[_0x46dd('0x21')](function(){_0x4b115b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3799e4,_0x1b6c6d){return function(_0x496112){if(!_0x496112){_0x3799e4['sendStatus'](0x194);}return _0x496112;};}function handleError(_0xfcb69b,_0x4b34bd){_0x4b34bd=_0x4b34bd||0x1f4;return function(_0x216f08){logger[_0x46dd('0x26')](_0x216f08['stack']);if(_0x216f08[_0x46dd('0x27')]){delete _0x216f08[_0x46dd('0x27')];}_0xfcb69b['status'](_0x4b34bd)[_0x46dd('0x28')](_0x216f08);};}exports['index']=function(_0x3de07b,_0x5cddbc){var _0x1aa370={},_0x46d6f5={},_0x1cd0af={'count':0x0,'rows':[]};var _0x49c69f=_['map'](db['CmContactHasItem']['rawAttributes'],function(_0x22eebf){return{'name':_0x22eebf[_0x46dd('0x29')],'type':_0x22eebf[_0x46dd('0x2a')][_0x46dd('0x2b')]};});_0x46d6f5[_0x46dd('0x2c')]=_[_0x46dd('0x2d')](_0x49c69f,_0x46dd('0x27'));_0x46d6f5['query']=_[_0x46dd('0x2e')](_0x3de07b[_0x46dd('0x2f')]);_0x46d6f5[_0x46dd('0x30')]=_[_0x46dd('0x31')](_0x46d6f5[_0x46dd('0x2c')],_0x46d6f5['query']);_0x1aa370[_0x46dd('0x32')]=_[_0x46dd('0x31')](_0x46d6f5[_0x46dd('0x2c')],qs['fields'](_0x3de07b[_0x46dd('0x2f')][_0x46dd('0x33')]));_0x1aa370[_0x46dd('0x32')]=_0x1aa370[_0x46dd('0x32')][_0x46dd('0x34')]?_0x1aa370[_0x46dd('0x32')]:_0x46d6f5[_0x46dd('0x2c')];if(!_0x3de07b[_0x46dd('0x2f')][_0x46dd('0x35')]('nolimit')){_0x1aa370['limit']=qs[_0x46dd('0x1c')](_0x3de07b['query'][_0x46dd('0x1c')]);_0x1aa370[_0x46dd('0x19')]=qs['offset'](_0x3de07b[_0x46dd('0x2f')]['offset']);}_0x1aa370[_0x46dd('0x36')]=qs[_0x46dd('0x37')](_0x3de07b[_0x46dd('0x2f')][_0x46dd('0x37')]);_0x1aa370[_0x46dd('0x38')]=qs['filters'](_[_0x46dd('0x39')](_0x3de07b[_0x46dd('0x2f')],_0x46d6f5[_0x46dd('0x30')]),_0x49c69f);if(_0x3de07b[_0x46dd('0x2f')][_0x46dd('0x3a')]){_0x1aa370['where']=_[_0x46dd('0x3b')](_0x1aa370[_0x46dd('0x38')],{'$or':_[_0x46dd('0x2d')](_0x49c69f,function(_0x6f01c9){if(_0x6f01c9[_0x46dd('0x2a')]!==_0x46dd('0x3c')){var _0x36c5b5={};_0x36c5b5[_0x6f01c9['name']]={'$like':'%'+_0x3de07b[_0x46dd('0x2f')]['filter']+'%'};return _0x36c5b5;}})});}_0x1aa370=_[_0x46dd('0x3b')]({},_0x1aa370,_0x3de07b[_0x46dd('0x3d')]);var _0x72868c={'where':_0x1aa370[_0x46dd('0x38')]};return db['CmContactHasItem'][_0x46dd('0x1b')](_0x72868c)[_0x46dd('0x21')](function(_0x473a17){_0x1cd0af['count']=_0x473a17;if(_0x3de07b[_0x46dd('0x2f')][_0x46dd('0x3e')]){_0x1aa370[_0x46dd('0x3f')]=[{'all':!![]}];}return db[_0x46dd('0x40')][_0x46dd('0x41')](_0x1aa370);})['then'](function(_0x26968c){_0x1cd0af[_0x46dd('0x42')]=_0x26968c;return _0x1cd0af;})['then'](respondWithFilteredResult(_0x5cddbc,_0x1aa370))[_0x46dd('0x43')](handleError(_0x5cddbc,null));};exports[_0x46dd('0x44')]=function(_0xeacc01,_0x3bc1c1){var _0x5296ef={'raw':!![],'where':{'id':_0xeacc01[_0x46dd('0x45')]['id']}},_0x4862f9={};_0x4862f9[_0x46dd('0x2c')]=_[_0x46dd('0x2e')](db[_0x46dd('0x40')][_0x46dd('0x46')]);_0x4862f9[_0x46dd('0x2f')]=_[_0x46dd('0x2e')](_0xeacc01[_0x46dd('0x2f')]);_0x4862f9[_0x46dd('0x30')]=_['intersection'](_0x4862f9[_0x46dd('0x2c')],_0x4862f9[_0x46dd('0x2f')]);_0x5296ef[_0x46dd('0x32')]=_['intersection'](_0x4862f9[_0x46dd('0x2c')],qs[_0x46dd('0x33')](_0xeacc01[_0x46dd('0x2f')][_0x46dd('0x33')]));_0x5296ef['attributes']=_0x5296ef['attributes'][_0x46dd('0x34')]?_0x5296ef['attributes']:_0x4862f9[_0x46dd('0x2c')];if(_0xeacc01[_0x46dd('0x2f')]['includeAll']){_0x5296ef['include']=[{'all':!![]}];}_0x5296ef=_[_0x46dd('0x3b')]({},_0x5296ef,_0xeacc01[_0x46dd('0x3d')]);return db[_0x46dd('0x40')][_0x46dd('0x47')](_0x5296ef)[_0x46dd('0x21')](handleEntityNotFound(_0x3bc1c1,null))['then'](respondWithResult(_0x3bc1c1,null))['catch'](handleError(_0x3bc1c1,null));};exports[_0x46dd('0x48')]=function(_0x15341a,_0x2f2b51){return db['CmContactHasItem'][_0x46dd('0x48')](_0x15341a[_0x46dd('0x49')],{})['then'](function(_0x2cca5d){var _0x5f12ce=_0x15341a[_0x46dd('0x4a')][_0x46dd('0x22')]({'plain':!![]});if(!_0x5f12ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f12ce[_0x46dd('0x4b')]===_0x46dd('0x4a')){var _0x1f2a8a=_0x2cca5d[_0x46dd('0x22')]({'plain':!![]});var _0xaa578d='CmContactHasItems';return db[_0x46dd('0x4c')][_0x46dd('0x47')]({'where':{'name':_0xaa578d,'userProfileId':_0x5f12ce[_0x46dd('0x4d')]},'raw':!![]})[_0x46dd('0x21')](function(_0x306c35){if(_0x306c35&&_0x306c35[_0x46dd('0x4e')]===0x0){return db[_0x46dd('0x24')][_0x46dd('0x48')]({'name':_0x1f2a8a[_0x46dd('0x27')],'resourceId':_0x1f2a8a['id'],'type':_0x306c35[_0x46dd('0x27')],'sectionId':_0x306c35['id']},{})[_0x46dd('0x21')](function(){return _0x2cca5d;});}else{return _0x2cca5d;}})[_0x46dd('0x43')](function(_0x15d90d){logger[_0x46dd('0x26')](_0x46dd('0x4f'),_0x15d90d);throw _0x15d90d;});}return _0x2cca5d;})['then'](respondWithResult(_0x2f2b51,0xc9))[_0x46dd('0x43')](handleError(_0x2f2b51,null));};exports['update']=function(_0x1b9e1f,_0x3313eb){if(_0x1b9e1f[_0x46dd('0x49')]['id']){delete _0x1b9e1f[_0x46dd('0x49')]['id'];}return db['CmContactHasItem'][_0x46dd('0x47')]({'where':{'id':_0x1b9e1f[_0x46dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x3313eb,null))['then'](saveUpdates(_0x1b9e1f[_0x46dd('0x49')],null))[_0x46dd('0x21')](respondWithResult(_0x3313eb,null))[_0x46dd('0x43')](handleError(_0x3313eb,null));};exports[_0x46dd('0x25')]=function(_0x5ce9cd,_0x40f781){return db[_0x46dd('0x40')][_0x46dd('0x47')]({'where':{'id':_0x5ce9cd[_0x46dd('0x45')]['id']}})[_0x46dd('0x21')](handleEntityNotFound(_0x40f781,null))[_0x46dd('0x21')](removeEntity(_0x40f781,null))[_0x46dd('0x43')](handleError(_0x40f781,null));}; \ No newline at end of file +var _0x70f0=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CmContactHasItems','UserProfileResource','error','stack','name','send','CmContactHasItem','rawAttributes','fieldName','type','key','model','query'];(function(_0x45330e,_0x5bc9b5){var _0x2c714c=function(_0x548b45){while(--_0x548b45){_0x45330e['push'](_0x45330e['shift']());}};_0x2c714c(++_0x5bc9b5);}(_0x70f0,0x72));var _0x070f=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0x70f0[_0x508685];return _0x976a76;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x070f('0x0'));var jsonpatch=require(_0x070f('0x1'));var rp=require(_0x070f('0x2'));var moment=require(_0x070f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x070f('0x4'));var util=require(_0x070f('0x5'));var path=require(_0x070f('0x6'));var sox=require(_0x070f('0x7'));var csv=require('to-csv');var ejs=require(_0x070f('0x8'));var fs=require('fs');var fs_extra=require(_0x070f('0x9'));var _=require(_0x070f('0xa'));var squel=require(_0x070f('0xb'));var crypto=require('crypto');var jsforce=require(_0x070f('0xc'));var deskjs=require(_0x070f('0xd'));var toCsv=require(_0x070f('0xe'));var querystring=require(_0x070f('0xf'));var Papa=require(_0x070f('0x10'));var Redis=require('ioredis');var authService=require(_0x070f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x070f('0x12'));var logger=require(_0x070f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x070f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x070f('0x15'))['db'];function respondWithStatusCode(_0x531faf,_0xe8b2c7){_0xe8b2c7=_0xe8b2c7||0xcc;return function(_0xa28ce1){if(_0xa28ce1){return _0x531faf[_0x070f('0x16')](_0xe8b2c7);}return _0x531faf[_0x070f('0x17')](_0xe8b2c7)[_0x070f('0x18')]();};}function respondWithResult(_0x3f0e79,_0x1c08b2){_0x1c08b2=_0x1c08b2||0xc8;return function(_0x4b1365){if(_0x4b1365){return _0x3f0e79['status'](_0x1c08b2)[_0x070f('0x19')](_0x4b1365);}};}function respondWithFilteredResult(_0x369893,_0x725d61){return function(_0x29e089){if(_0x29e089){var _0x53fbd0=typeof _0x725d61[_0x070f('0x1a')]===_0x070f('0x1b')&&typeof _0x725d61[_0x070f('0x1c')]===_0x070f('0x1b');var _0x217d67=_0x29e089[_0x070f('0x1d')];var _0x466b4b=_0x53fbd0?0x0:_0x725d61[_0x070f('0x1a')];var _0x4839f6=_0x53fbd0?_0x29e089[_0x070f('0x1d')]:_0x725d61['offset']+_0x725d61[_0x070f('0x1c')];var _0x2f5830;if(_0x4839f6>=_0x217d67){_0x4839f6=_0x217d67;_0x2f5830=0xc8;}else{_0x2f5830=0xce;}_0x369893[_0x070f('0x17')](_0x2f5830);return _0x369893[_0x070f('0x1e')](_0x070f('0x1f'),_0x466b4b+'-'+_0x4839f6+'/'+_0x217d67)['json'](_0x29e089);}return null;};}function patchUpdates(_0x23f78c){return function(_0x4258d1){try{jsonpatch[_0x070f('0x20')](_0x4258d1,_0x23f78c,!![]);}catch(_0x230b84){return BPromise['reject'](_0x230b84);}return _0x4258d1[_0x070f('0x21')]();};}function saveUpdates(_0x5e7e53,_0x590794){return function(_0x3ca04c){if(_0x3ca04c){return _0x3ca04c[_0x070f('0x22')](_0x5e7e53)[_0x070f('0x23')](function(_0x4f6bd9){return _0x4f6bd9;});}return null;};}function removeEntity(_0x285c34,_0x205385){return function(_0x4754f1){if(_0x4754f1){return _0x4754f1[_0x070f('0x24')]()[_0x070f('0x23')](function(){var _0x1ded10=_0x4754f1['get']({'plain':!![]});var _0x35665b=_0x070f('0x25');return db[_0x070f('0x26')][_0x070f('0x24')]({'where':{'type':_0x35665b,'resourceId':_0x1ded10['id']}})['then'](function(){return _0x4754f1;});})[_0x070f('0x23')](function(){_0x285c34['status'](0xcc)[_0x070f('0x18')]();});}};}function handleEntityNotFound(_0x585f22,_0x3d373d){return function(_0xa901bb){if(!_0xa901bb){_0x585f22[_0x070f('0x16')](0x194);}return _0xa901bb;};}function handleError(_0x46d4ca,_0x515087){_0x515087=_0x515087||0x1f4;return function(_0x7dc43c){logger[_0x070f('0x27')](_0x7dc43c[_0x070f('0x28')]);if(_0x7dc43c[_0x070f('0x29')]){delete _0x7dc43c[_0x070f('0x29')];}_0x46d4ca['status'](_0x515087)[_0x070f('0x2a')](_0x7dc43c);};}exports['index']=function(_0x1d3679,_0x335273){var _0x140caf={},_0xfb8c54={},_0x4db989={'count':0x0,'rows':[]};var _0x2c8771=_['map'](db[_0x070f('0x2b')][_0x070f('0x2c')],function(_0x1d7fc9){return{'name':_0x1d7fc9[_0x070f('0x2d')],'type':_0x1d7fc9[_0x070f('0x2e')][_0x070f('0x2f')]};});_0xfb8c54[_0x070f('0x30')]=_['map'](_0x2c8771,_0x070f('0x29'));_0xfb8c54[_0x070f('0x31')]=_[_0x070f('0x32')](_0x1d3679[_0x070f('0x31')]);_0xfb8c54['filters']=_[_0x070f('0x33')](_0xfb8c54['model'],_0xfb8c54[_0x070f('0x31')]);_0x140caf[_0x070f('0x34')]=_['intersection'](_0xfb8c54[_0x070f('0x30')],qs[_0x070f('0x35')](_0x1d3679['query'][_0x070f('0x35')]));_0x140caf[_0x070f('0x34')]=_0x140caf[_0x070f('0x34')][_0x070f('0x36')]?_0x140caf[_0x070f('0x34')]:_0xfb8c54[_0x070f('0x30')];if(!_0x1d3679[_0x070f('0x31')][_0x070f('0x37')](_0x070f('0x38'))){_0x140caf['limit']=qs['limit'](_0x1d3679['query'][_0x070f('0x1c')]);_0x140caf[_0x070f('0x1a')]=qs[_0x070f('0x1a')](_0x1d3679['query'][_0x070f('0x1a')]);}_0x140caf[_0x070f('0x39')]=qs[_0x070f('0x3a')](_0x1d3679[_0x070f('0x31')]['sort']);_0x140caf['where']=qs[_0x070f('0x3b')](_[_0x070f('0x3c')](_0x1d3679['query'],_0xfb8c54['filters']),_0x2c8771);if(_0x1d3679[_0x070f('0x31')][_0x070f('0x3d')]){_0x140caf[_0x070f('0x3e')]=_[_0x070f('0x3f')](_0x140caf[_0x070f('0x3e')],{'$or':_[_0x070f('0x40')](_0x2c8771,function(_0x2b475c){if(_0x2b475c[_0x070f('0x2e')]!==_0x070f('0x41')){var _0x31a2c1={};_0x31a2c1[_0x2b475c[_0x070f('0x29')]]={'$like':'%'+_0x1d3679['query'][_0x070f('0x3d')]+'%'};return _0x31a2c1;}})});}_0x140caf=_[_0x070f('0x3f')]({},_0x140caf,_0x1d3679[_0x070f('0x42')]);var _0x2932f6={'where':_0x140caf[_0x070f('0x3e')]};return db[_0x070f('0x2b')][_0x070f('0x1d')](_0x2932f6)[_0x070f('0x23')](function(_0x46d2e4){_0x4db989[_0x070f('0x1d')]=_0x46d2e4;if(_0x1d3679['query']['includeAll']){_0x140caf[_0x070f('0x43')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x070f('0x44')](_0x140caf);})['then'](function(_0x1b139f){_0x4db989['rows']=_0x1b139f;return _0x4db989;})[_0x070f('0x23')](respondWithFilteredResult(_0x335273,_0x140caf))[_0x070f('0x45')](handleError(_0x335273,null));};exports['show']=function(_0x144410,_0x17ad1e){var _0xd93efb={'raw':!![],'where':{'id':_0x144410[_0x070f('0x46')]['id']}},_0x39d1c8={};_0x39d1c8[_0x070f('0x30')]=_[_0x070f('0x32')](db[_0x070f('0x2b')]['rawAttributes']);_0x39d1c8[_0x070f('0x31')]=_['keys'](_0x144410[_0x070f('0x31')]);_0x39d1c8['filters']=_[_0x070f('0x33')](_0x39d1c8[_0x070f('0x30')],_0x39d1c8[_0x070f('0x31')]);_0xd93efb[_0x070f('0x34')]=_['intersection'](_0x39d1c8[_0x070f('0x30')],qs[_0x070f('0x35')](_0x144410[_0x070f('0x31')][_0x070f('0x35')]));_0xd93efb[_0x070f('0x34')]=_0xd93efb[_0x070f('0x34')]['length']?_0xd93efb[_0x070f('0x34')]:_0x39d1c8['model'];if(_0x144410['query']['includeAll']){_0xd93efb[_0x070f('0x43')]=[{'all':!![]}];}_0xd93efb=_['merge']({},_0xd93efb,_0x144410[_0x070f('0x42')]);return db['CmContactHasItem']['find'](_0xd93efb)['then'](handleEntityNotFound(_0x17ad1e,null))['then'](respondWithResult(_0x17ad1e,null))[_0x070f('0x45')](handleError(_0x17ad1e,null));};exports[_0x070f('0x47')]=function(_0x13b7f8,_0x2c1a4e){return db[_0x070f('0x2b')][_0x070f('0x47')](_0x13b7f8['body'],{})[_0x070f('0x23')](function(_0x74c8df){var _0x18be6a=_0x13b7f8[_0x070f('0x48')][_0x070f('0x49')]({'plain':!![]});if(!_0x18be6a)throw new Error(_0x070f('0x4a'));if(_0x18be6a[_0x070f('0x4b')]===_0x070f('0x48')){var _0x544a94=_0x74c8df[_0x070f('0x49')]({'plain':!![]});var _0x490c09=_0x070f('0x25');return db[_0x070f('0x4c')][_0x070f('0x4d')]({'where':{'name':_0x490c09,'userProfileId':_0x18be6a[_0x070f('0x4e')]},'raw':!![]})['then'](function(_0x4726ae){if(_0x4726ae&&_0x4726ae[_0x070f('0x4f')]===0x0){return db['UserProfileResource'][_0x070f('0x47')]({'name':_0x544a94['name'],'resourceId':_0x544a94['id'],'type':_0x4726ae['name'],'sectionId':_0x4726ae['id']},{})[_0x070f('0x23')](function(){return _0x74c8df;});}else{return _0x74c8df;}})[_0x070f('0x45')](function(_0x5b85db){logger[_0x070f('0x27')](_0x070f('0x50'),_0x5b85db);throw _0x5b85db;});}return _0x74c8df;})[_0x070f('0x23')](respondWithResult(_0x2c1a4e,0xc9))[_0x070f('0x45')](handleError(_0x2c1a4e,null));};exports[_0x070f('0x22')]=function(_0x35257c,_0x202828){if(_0x35257c[_0x070f('0x51')]['id']){delete _0x35257c[_0x070f('0x51')]['id'];}return db[_0x070f('0x2b')][_0x070f('0x4d')]({'where':{'id':_0x35257c[_0x070f('0x46')]['id']}})[_0x070f('0x23')](handleEntityNotFound(_0x202828,null))[_0x070f('0x23')](saveUpdates(_0x35257c[_0x070f('0x51')],null))[_0x070f('0x23')](respondWithResult(_0x202828,null))[_0x070f('0x45')](handleError(_0x202828,null));};exports[_0x070f('0x24')]=function(_0x17cd99,_0x2a9992){return db['CmContactHasItem'][_0x070f('0x4d')]({'where':{'id':_0x17cd99[_0x070f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a9992,null))['then'](removeEntity(_0x2a9992,null))['catch'](handleError(_0x2a9992,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index c0f87b4..5d1216a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45e6=['bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','cm_contact_has_items','util','api','moment'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x45e6,0x1d1));var _0x645e=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x45e6[_0x280f4a];return _0x1bb157;};'use strict';var _=require('lodash');var util=require(_0x645e('0x0'));var logger=require('../../config/logger')(_0x645e('0x1'));var moment=require(_0x645e('0x2'));var BPromise=require(_0x645e('0x3'));var rp=require(_0x645e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x645e('0x5'));var config=require(_0x645e('0x6'));var attributes=require(_0x645e('0x7'));module['exports']=function(_0x1f75c8,_0x278cd0){return _0x1f75c8['define']('CmContactHasItem',attributes,{'tableName':_0x645e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc323=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9352f7,_0x1d1c7f){var _0x266854=function(_0x130082){while(--_0x130082){_0x9352f7['push'](_0x9352f7['shift']());}};_0x266854(++_0x1d1c7f);}(_0xc323,0x10b));var _0x3c32=function(_0x49989f,_0x20b513){_0x49989f=_0x49989f-0x0;var _0x14a165=_0xc323[_0x49989f];return _0x14a165;};'use strict';var _=require(_0x3c32('0x0'));var util=require(_0x3c32('0x1'));var logger=require(_0x3c32('0x2'))(_0x3c32('0x3'));var moment=require(_0x3c32('0x4'));var BPromise=require(_0x3c32('0x5'));var rp=require(_0x3c32('0x6'));var fs=require('fs');var path=require(_0x3c32('0x7'));var rimraf=require(_0x3c32('0x8'));var config=require(_0x3c32('0x9'));var attributes=require(_0x3c32('0xa'));module[_0x3c32('0xb')]=function(_0x370ded,_0x3c6f76){return _0x370ded['define']('CmContactHasItem',attributes,{'tableName':_0x3c32('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 1abd4ac..b37f807 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7a9=['rpc','../../config/environment','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51539c,_0x25f587){var _0x4f7914=function(_0x4c666e){while(--_0x4c666e){_0x51539c['push'](_0x51539c['shift']());}};_0x4f7914(++_0x25f587);}(_0xe7a9,0x19a));var _0x9e7a=function(_0xf5a834,_0x52c74c){_0xf5a834=_0xf5a834-0x0;var _0x1a9cc6=_0xe7a9[_0xf5a834];return _0x1a9cc6;};'use strict';var _=require(_0x9e7a('0x0'));var util=require(_0x9e7a('0x1'));var moment=require('moment');var BPromise=require(_0x9e7a('0x2'));var rs=require(_0x9e7a('0x3'));var fs=require('fs');var Redis=require(_0x9e7a('0x4'));var db=require(_0x9e7a('0x5'))['db'];var utils=require(_0x9e7a('0x6'));var logger=require(_0x9e7a('0x7'))(_0x9e7a('0x8'));var config=require(_0x9e7a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9e7a('0xa')][_0x9e7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30b972,_0x315916,_0x5826d0){return new BPromise(function(_0x3f668c,_0x225c6d){return client[_0x9e7a('0xc')](_0x30b972,_0x5826d0)['then'](function(_0x5a4936){logger[_0x9e7a('0xd')](_0x9e7a('0xe'),_0x315916,_0x9e7a('0xf'));logger[_0x9e7a('0x10')](_0x9e7a('0x11'),_0x315916,_0x9e7a('0xf'),JSON['stringify'](_0x5a4936));if(_0x5a4936[_0x9e7a('0x12')]){if(_0x5a4936['error'][_0x9e7a('0x13')]===0x1f4){logger[_0x9e7a('0x12')](_0x9e7a('0xe'),_0x315916,_0x5a4936['error'][_0x9e7a('0x14')]);return _0x225c6d(_0x5a4936[_0x9e7a('0x12')][_0x9e7a('0x14')]);}logger[_0x9e7a('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x315916,_0x5a4936[_0x9e7a('0x12')][_0x9e7a('0x14')]);return _0x3f668c(_0x5a4936[_0x9e7a('0x12')][_0x9e7a('0x14')]);}else{logger[_0x9e7a('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x315916,_0x9e7a('0xf'));_0x3f668c(_0x5a4936['result'][_0x9e7a('0x14')]);}})[_0x9e7a('0x15')](function(_0x2af2c9){logger[_0x9e7a('0x12')](_0x9e7a('0xe'),_0x315916,_0x2af2c9);_0x225c6d(_0x2af2c9);});});} \ No newline at end of file +var _0xf8d8=['rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x336e9b,_0xe5c27a){var _0x336afb=function(_0x45991a){while(--_0x45991a){_0x336e9b['push'](_0x336e9b['shift']());}};_0x336afb(++_0xe5c27a);}(_0xf8d8,0x1ad));var _0x8f8d=function(_0x232d09,_0x30a518){_0x232d09=_0x232d09-0x0;var _0x454385=_0xf8d8[_0x232d09];return _0x454385;};'use strict';var _=require(_0x8f8d('0x0'));var util=require('util');var moment=require(_0x8f8d('0x1'));var BPromise=require(_0x8f8d('0x2'));var rs=require(_0x8f8d('0x3'));var fs=require('fs');var Redis=require(_0x8f8d('0x4'));var db=require(_0x8f8d('0x5'))['db'];var utils=require(_0x8f8d('0x6'));var logger=require(_0x8f8d('0x7'))(_0x8f8d('0x8'));var config=require(_0x8f8d('0x9'));var jayson=require(_0x8f8d('0xa'));var client=jayson[_0x8f8d('0xb')][_0x8f8d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259fff,_0x40e114,_0x224665){return new BPromise(function(_0x1cec7b,_0x3918fa){return client['request'](_0x259fff,_0x224665)[_0x8f8d('0xd')](function(_0x102785){logger[_0x8f8d('0xe')](_0x8f8d('0xf'),_0x40e114,'request\x20sent');logger[_0x8f8d('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x40e114,_0x8f8d('0x11'),JSON[_0x8f8d('0x12')](_0x102785));if(_0x102785[_0x8f8d('0x13')]){if(_0x102785[_0x8f8d('0x13')][_0x8f8d('0x14')]===0x1f4){logger[_0x8f8d('0x13')](_0x8f8d('0xf'),_0x40e114,_0x102785[_0x8f8d('0x13')][_0x8f8d('0x15')]);return _0x3918fa(_0x102785[_0x8f8d('0x13')][_0x8f8d('0x15')]);}logger[_0x8f8d('0x13')](_0x8f8d('0xf'),_0x40e114,_0x102785['error'][_0x8f8d('0x15')]);return _0x1cec7b(_0x102785['error']['message']);}else{logger[_0x8f8d('0xe')](_0x8f8d('0xf'),_0x40e114,_0x8f8d('0x11'));_0x1cec7b(_0x102785['result'][_0x8f8d('0x15')]);}})[_0x8f8d('0x16')](function(_0x3a3a4d){logger[_0x8f8d('0x13')](_0x8f8d('0xf'),_0x40e114,_0x3a3a4d);_0x3918fa(_0x3a3a4d);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 8dd779e..1379407 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4a0=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0xf4a0,0x1f2));var _0x0f4a=function(_0x2e75c7,_0x5d2ebe){_0x2e75c7=_0x2e75c7-0x0;var _0x4ec88b=_0xf4a0[_0x2e75c7];return _0x4ec88b;};'use strict';var multer=require(_0x0f4a('0x0'));var util=require(_0x0f4a('0x1'));var path=require(_0x0f4a('0x2'));var timeout=require(_0x0f4a('0x3'));var express=require(_0x0f4a('0x4'));var router=express[_0x0f4a('0x5')]();var fs_extra=require(_0x0f4a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0f4a('0x7'));var config=require(_0x0f4a('0x8'));var controller=require(_0x0f4a('0x9'));router['get']('/',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xb')]);router['get'](_0x0f4a('0xc'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xd')]);router[_0x0f4a('0xe')]('/',auth['isAuthenticated'](),controller[_0x0f4a('0xf')]);router[_0x0f4a('0x10')]('/:id',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x11')]);router['delete'](_0x0f4a('0xc'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x12')]);module[_0x0f4a('0x13')]=router; \ No newline at end of file +var _0x52e3=['index','/:id','show','post','create','put','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get'];(function(_0x3b4f8f,_0x14640d){var _0x3acc2f=function(_0x39ccdf){while(--_0x39ccdf){_0x3b4f8f['push'](_0x3b4f8f['shift']());}};_0x3acc2f(++_0x14640d);}(_0x52e3,0x1ae));var _0x352e=function(_0x2a00f7,_0x998ac3){_0x2a00f7=_0x2a00f7-0x0;var _0x6c16de=_0x52e3[_0x2a00f7];return _0x6c16de;};'use strict';var multer=require(_0x352e('0x0'));var util=require(_0x352e('0x1'));var path=require('path');var timeout=require(_0x352e('0x2'));var express=require(_0x352e('0x3'));var router=express[_0x352e('0x4')]();var fs_extra=require(_0x352e('0x5'));var auth=require(_0x352e('0x6'));var interaction=require(_0x352e('0x7'));var config=require('../../config/environment');var controller=require(_0x352e('0x8'));router[_0x352e('0x9')]('/',auth['isAuthenticated'](),controller[_0x352e('0xa')]);router['get'](_0x352e('0xb'),auth['isAuthenticated'](),controller[_0x352e('0xc')]);router[_0x352e('0xd')]('/',auth['isAuthenticated'](),controller[_0x352e('0xe')]);router[_0x352e('0xf')](_0x352e('0xb'),auth[_0x352e('0x10')](),controller[_0x352e('0x11')]);router[_0x352e('0x12')](_0x352e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x352e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 81f9831..76e4bc2 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 _0x3c35=['stringify','BOOLEAN','voice','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','values','isArray'];(function(_0x4ff0dd,_0x5425a1){var _0x17c597=function(_0x5dcb02){while(--_0x5dcb02){_0x4ff0dd['push'](_0x4ff0dd['shift']());}};_0x17c597(++_0x5425a1);}(_0x3c35,0x17a));var _0x53c3=function(_0x4da245,_0x49edaf){_0x4da245=_0x4da245-0x0;var _0x1cb125=_0x3c35[_0x4da245];return _0x1cb125;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x53c3('0x0')]={'name':{'type':Sequelize[_0x53c3('0x1')],'get':function(_0x54cb65){return this[_0x53c3('0x2')](_0x53c3('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xe0a17b){this[_0x53c3('0x4')]('alias',_0xe0a17b?_0xe0a17b:this[_0x53c3('0x2')](_0x53c3('0x5')));}},'type':{'type':Sequelize[_0x53c3('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x53c3('0x7')](_0x53c3('0x8')),'get':function(){if(this['getDataValue'](_0x53c3('0x9'))==='select'){return JSON['parse'](this['getDataValue'](_0x53c3('0xa')));}else{return this[_0x53c3('0x2')]('values');}},'set':function(_0x276e2b){if(Array[_0x53c3('0xb')](_0x276e2b)){this[_0x53c3('0x4')]('values',JSON[_0x53c3('0xc')](_0x276e2b));}else{this[_0x53c3('0x4')](_0x53c3('0xa'),_0x276e2b);}}},'required':{'type':Sequelize[_0x53c3('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x53c3('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x53c3('0xe'))}}; \ No newline at end of file +var _0x291c=['setDataValue','alias','name','STRING','long','select','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x291c,0xa1));var _0xc291=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x291c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc291('0x0'));var _=require(_0xc291('0x1'));module['exports']={'name':{'type':Sequelize[_0xc291('0x2')],'get':function(_0x346379){return this[_0xc291('0x3')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2e0e28){this[_0xc291('0x4')](_0xc291('0x5'),_0x2e0e28?_0x2e0e28:this[_0xc291('0x3')](_0xc291('0x6')));}},'type':{'type':Sequelize[_0xc291('0x7')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xc291('0x8')),'get':function(){if(this[_0xc291('0x3')]('type')===_0xc291('0x9')){return JSON['parse'](this[_0xc291('0x3')]('values'));}else{return this['getDataValue'](_0xc291('0xa'));}},'set':function(_0x3cd52e){if(Array['isArray'](_0x3cd52e)){this[_0xc291('0x4')](_0xc291('0xa'),JSON[_0xc291('0xb')](_0x3cd52e));}else{this[_0xc291('0x4')](_0xc291('0xa'),_0x3cd52e);}}},'required':{'type':Sequelize[_0xc291('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc291('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc291('0xd')](_0xc291('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1634c6a..9542dcc 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 _0x8b95=['create','sequelize','TEXT','Sequelize','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','include','body'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8b95,0x114));var _0x58b9=function(_0x4bdc26,_0x47bd16){_0x4bdc26=_0x4bdc26-0x0;var _0x3a0b72=_0x8b95[_0x4bdc26];return _0x3a0b72;};'use strict';var emlformat=require(_0x58b9('0x0'));var rimraf=require(_0x58b9('0x1'));var zipdir=require(_0x58b9('0x2'));var jsonpatch=require(_0x58b9('0x3'));var rp=require(_0x58b9('0x4'));var moment=require(_0x58b9('0x5'));var BPromise=require(_0x58b9('0x6'));var Mustache=require(_0x58b9('0x7'));var util=require(_0x58b9('0x8'));var path=require(_0x58b9('0x9'));var sox=require(_0x58b9('0xa'));var csv=require(_0x58b9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58b9('0xc'));var _=require(_0x58b9('0xd'));var squel=require('squel');var crypto=require(_0x58b9('0xe'));var jsforce=require(_0x58b9('0xf'));var deskjs=require(_0x58b9('0x10'));var toCsv=require(_0x58b9('0xb'));var querystring=require(_0x58b9('0x11'));var Papa=require('papaparse');var Redis=require(_0x58b9('0x12'));var authService=require(_0x58b9('0x13'));var qs=require(_0x58b9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58b9('0x15'));var logger=require(_0x58b9('0x16'))(_0x58b9('0x17'));var utils=require(_0x58b9('0x18'));var config=require(_0x58b9('0x19'));var licenseUtil=require(_0x58b9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c8169,_0x45130c){_0x45130c=_0x45130c||0xcc;return function(_0x74c238){if(_0x74c238){return _0x5c8169['sendStatus'](_0x45130c);}return _0x5c8169[_0x58b9('0x1b')](_0x45130c)[_0x58b9('0x1c')]();};}function respondWithResult(_0x4b3c5f,_0xc871fb){_0xc871fb=_0xc871fb||0xc8;return function(_0x16b1e8){if(_0x16b1e8){return _0x4b3c5f[_0x58b9('0x1b')](_0xc871fb)[_0x58b9('0x1d')](_0x16b1e8);}};}function respondWithFilteredResult(_0x200ef1,_0x4f9264){return function(_0x3cb5fe){if(_0x3cb5fe){var _0x9dac24=typeof _0x4f9264['offset']===_0x58b9('0x1e')&&typeof _0x4f9264[_0x58b9('0x1f')]==='undefined';var _0x5f20d0=_0x3cb5fe['count'];var _0xaeef0d=_0x9dac24?0x0:_0x4f9264['offset'];var _0x58cbf1=_0x9dac24?_0x3cb5fe[_0x58b9('0x20')]:_0x4f9264['offset']+_0x4f9264[_0x58b9('0x1f')];var _0xbf512f;if(_0x58cbf1>=_0x5f20d0){_0x58cbf1=_0x5f20d0;_0xbf512f=0xc8;}else{_0xbf512f=0xce;}_0x200ef1[_0x58b9('0x1b')](_0xbf512f);return _0x200ef1['set'](_0x58b9('0x21'),_0xaeef0d+'-'+_0x58cbf1+'/'+_0x5f20d0)['json'](_0x3cb5fe);}return null;};}function patchUpdates(_0x4206c9){return function(_0x3a8b73){try{jsonpatch[_0x58b9('0x22')](_0x3a8b73,_0x4206c9,!![]);}catch(_0x2f3aa1){return BPromise['reject'](_0x2f3aa1);}return _0x3a8b73[_0x58b9('0x23')]();};}function saveUpdates(_0x4965d6,_0x520802){return function(_0x107544){if(_0x107544){return _0x107544[_0x58b9('0x24')](_0x4965d6)['then'](function(_0x2f812d){return _0x2f812d;});}return null;};}function removeEntity(_0x1e0807,_0x1631bd){return function(_0x2d8011){if(_0x2d8011){return _0x2d8011[_0x58b9('0x25')]()['then'](function(){_0x1e0807['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x161f9b,_0x352357){return function(_0x2a0662){if(!_0x2a0662){_0x161f9b[_0x58b9('0x26')](0x194);}return _0x2a0662;};}function handleError(_0x2d3969,_0x2aaae4){_0x2aaae4=_0x2aaae4||0x1f4;return function(_0x2e78ab){logger[_0x58b9('0x27')](_0x2e78ab[_0x58b9('0x28')]);if(_0x2e78ab[_0x58b9('0x29')]){delete _0x2e78ab[_0x58b9('0x29')];}_0x2d3969[_0x58b9('0x1b')](_0x2aaae4)[_0x58b9('0x2a')](_0x2e78ab);};}exports[_0x58b9('0x2b')]=function(_0x348061,_0x2b5da0){var _0x43311c={},_0x388e9e={},_0x2c9d07={'count':0x0,'rows':[]};var _0x304b49=_[_0x58b9('0x2c')](db[_0x58b9('0x2d')]['rawAttributes'],function(_0x547b4d){return{'name':_0x547b4d[_0x58b9('0x2e')],'type':_0x547b4d[_0x58b9('0x2f')][_0x58b9('0x30')]};});_0x388e9e['model']=_[_0x58b9('0x31')](_[_0x58b9('0x2c')](_0x304b49,_0x58b9('0x29')),['name']);_0x388e9e[_0x58b9('0x32')]=_[_0x58b9('0x33')](_0x348061['query']);_0x388e9e[_0x58b9('0x34')]=_[_0x58b9('0x35')](_0x388e9e[_0x58b9('0x36')],_0x388e9e['query']);_0x43311c[_0x58b9('0x37')]=_['intersection'](_0x388e9e[_0x58b9('0x36')],qs[_0x58b9('0x38')](_0x348061[_0x58b9('0x32')][_0x58b9('0x38')]));_0x43311c[_0x58b9('0x37')]=_0x43311c['attributes'][_0x58b9('0x39')]?_0x43311c[_0x58b9('0x37')]:_0x388e9e[_0x58b9('0x36')];if(!_0x348061[_0x58b9('0x32')][_0x58b9('0x3a')](_0x58b9('0x3b'))){_0x43311c[_0x58b9('0x1f')]=qs['limit'](_0x348061[_0x58b9('0x32')][_0x58b9('0x1f')]);_0x43311c[_0x58b9('0x3c')]=qs[_0x58b9('0x3c')](_0x348061[_0x58b9('0x32')][_0x58b9('0x3c')]);}_0x43311c[_0x58b9('0x3d')]=qs['sort'](_0x348061[_0x58b9('0x32')][_0x58b9('0x3e')]);_0x43311c[_0x58b9('0x3f')]=qs[_0x58b9('0x34')](_[_0x58b9('0x40')](_0x348061[_0x58b9('0x32')],_0x388e9e[_0x58b9('0x34')]),_0x304b49);if(_0x348061[_0x58b9('0x32')][_0x58b9('0x41')]){_0x43311c['where']=_['merge'](_0x43311c[_0x58b9('0x3f')],{'$or':_[_0x58b9('0x2c')](_0x304b49,function(_0x522348){if(_0x522348[_0x58b9('0x2f')]!==_0x58b9('0x42')){var _0x4da4d1={};_0x4da4d1[_0x522348[_0x58b9('0x29')]]={'$like':'%'+_0x348061['query'][_0x58b9('0x41')]+'%'};return _0x4da4d1;}})});}_0x43311c=_[_0x58b9('0x43')]({},_0x43311c,_0x348061[_0x58b9('0x44')]);var _0xcad948={'where':_0x43311c[_0x58b9('0x3f')]};return db[_0x58b9('0x2d')][_0x58b9('0x20')](_0xcad948)[_0x58b9('0x45')](function(_0x23097c){_0x2c9d07[_0x58b9('0x20')]=_0x23097c;if(_0x348061[_0x58b9('0x32')][_0x58b9('0x46')]){_0x43311c['include']=[{'all':!![]}];}return db['CmCustomField'][_0x58b9('0x47')](_0x43311c);})[_0x58b9('0x45')](function(_0x37f86a){_0x2c9d07[_0x58b9('0x48')]=_0x37f86a;return _0x2c9d07;})[_0x58b9('0x45')](respondWithFilteredResult(_0x2b5da0,_0x43311c))[_0x58b9('0x49')](handleError(_0x2b5da0,null));};exports['show']=function(_0xa618c9,_0x13c4ec){var _0x2df591={'raw':!![],'where':{'id':_0xa618c9['params']['id']}},_0x36bf9d={};_0x36bf9d['model']=_[_0x58b9('0x33')](db['CmCustomField']['rawAttributes']);_0x36bf9d[_0x58b9('0x32')]=_[_0x58b9('0x33')](_0xa618c9['query']);_0x36bf9d[_0x58b9('0x34')]=_[_0x58b9('0x35')](_0x36bf9d[_0x58b9('0x36')],_0x36bf9d[_0x58b9('0x32')]);_0x2df591[_0x58b9('0x37')]=_[_0x58b9('0x35')](_0x36bf9d[_0x58b9('0x36')],qs[_0x58b9('0x38')](_0xa618c9[_0x58b9('0x32')][_0x58b9('0x38')]));_0x2df591[_0x58b9('0x37')]=_0x2df591['attributes'][_0x58b9('0x39')]?_0x2df591[_0x58b9('0x37')]:_0x36bf9d[_0x58b9('0x36')];if(_0xa618c9[_0x58b9('0x32')][_0x58b9('0x46')]){_0x2df591[_0x58b9('0x4a')]=[{'all':!![]}];}_0x2df591=_[_0x58b9('0x43')]({},_0x2df591,_0xa618c9[_0x58b9('0x44')]);return db['CmCustomField']['find'](_0x2df591)[_0x58b9('0x45')](handleEntityNotFound(_0x13c4ec,null))[_0x58b9('0x45')](respondWithResult(_0x13c4ec,null))[_0x58b9('0x49')](handleError(_0x13c4ec,null));};exports[_0x58b9('0x24')]=function(_0x1bfa4b,_0x49bb3c){if(_0x1bfa4b[_0x58b9('0x4b')]['id']){delete _0x1bfa4b[_0x58b9('0x4b')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x1bfa4b['params']['id']}})[_0x58b9('0x45')](handleEntityNotFound(_0x49bb3c,null))[_0x58b9('0x45')](saveUpdates(_0x1bfa4b[_0x58b9('0x4b')],null))[_0x58b9('0x45')](respondWithResult(_0x49bb3c,null))['catch'](handleError(_0x49bb3c,null));};exports[_0x58b9('0x25')]=function(_0x998b04,_0x2a4301){return db[_0x58b9('0x2d')]['find']({'where':{'id':_0x998b04['params']['id']}})[_0x58b9('0x45')](handleEntityNotFound(_0x2a4301,null))['then'](removeEntity(_0x2a4301,null))[_0x58b9('0x49')](handleError(_0x2a4301,null));};exports[_0x58b9('0x4c')]=function(_0x4e9fca,_0x4fa181){var _0x166290;return db[_0x58b9('0x4d')]['transaction'](function(_0x5a143b){return db['CmCustomField'][_0x58b9('0x4c')](_0x4e9fca[_0x58b9('0x4b')],{'transaction':_0x5a143b})['then'](function(_0x42934c){_0x166290=_0x42934c;var _0x42059b={'type':db['Sequelize'][_0x58b9('0x4e')],'transaction':_0x5a143b};switch(_0x4e9fca[_0x58b9('0x4b')][_0x58b9('0x2f')]){case'text':_0x42059b['type']=db[_0x58b9('0x4f')]['TEXT'];break;case'number':_0x42059b[_0x58b9('0x2f')]=db[_0x58b9('0x4f')]['INTEGER'];break;case _0x58b9('0x50'):_0x42059b['type']=db['Sequelize'][_0x58b9('0x51')];_0x42059b[_0x58b9('0x52')]=![];break;default:}return db[_0x58b9('0x4d')][_0x58b9('0x53')][_0x58b9('0x54')](_0x58b9('0x55'),util[_0x58b9('0x56')](_0x58b9('0x57'),_0x166290['id']),_0x42059b);})[_0x58b9('0x45')](function(){return _0x166290;});})[_0x58b9('0x45')](respondWithResult(_0x4fa181,0xc9))[_0x58b9('0x49')](handleError(_0x4fa181,null));}; \ No newline at end of file +var _0x4af7=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','find','body','destroy','create','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','sequelize','cm_contacts','format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','CmCustomField','rawAttributes','type','model','differenceBy','keys','query','filters'];(function(_0x3b8dae,_0x34f020){var _0x36e826=function(_0x7f62c6){while(--_0x7f62c6){_0x3b8dae['push'](_0x3b8dae['shift']());}};_0x36e826(++_0x34f020);}(_0x4af7,0xc8));var _0x74af=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x4af7[_0x22e9fe];return _0x47cd19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74af('0x0'));var zipdir=require(_0x74af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74af('0x2'));var moment=require(_0x74af('0x3'));var BPromise=require(_0x74af('0x4'));var Mustache=require(_0x74af('0x5'));var util=require(_0x74af('0x6'));var path=require(_0x74af('0x7'));var sox=require(_0x74af('0x8'));var csv=require('to-csv');var ejs=require(_0x74af('0x9'));var fs=require('fs');var fs_extra=require(_0x74af('0xa'));var _=require(_0x74af('0xb'));var squel=require(_0x74af('0xc'));var crypto=require(_0x74af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x74af('0xe'));var toCsv=require(_0x74af('0xf'));var querystring=require(_0x74af('0x10'));var Papa=require(_0x74af('0x11'));var Redis=require(_0x74af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x74af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74af('0x14'))('api');var utils=require(_0x74af('0x15'));var config=require(_0x74af('0x16'));var licenseUtil=require(_0x74af('0x17'));var db=require(_0x74af('0x18'))['db'];function respondWithStatusCode(_0x474403,_0xeb0af7){_0xeb0af7=_0xeb0af7||0xcc;return function(_0x2e9225){if(_0x2e9225){return _0x474403[_0x74af('0x19')](_0xeb0af7);}return _0x474403[_0x74af('0x1a')](_0xeb0af7)[_0x74af('0x1b')]();};}function respondWithResult(_0x9b6410,_0x1b4099){_0x1b4099=_0x1b4099||0xc8;return function(_0x40ab92){if(_0x40ab92){return _0x9b6410['status'](_0x1b4099)[_0x74af('0x1c')](_0x40ab92);}};}function respondWithFilteredResult(_0x20badd,_0x80d659){return function(_0x5a64a6){if(_0x5a64a6){var _0x5933e2=typeof _0x80d659[_0x74af('0x1d')]===_0x74af('0x1e')&&typeof _0x80d659[_0x74af('0x1f')]===_0x74af('0x1e');var _0x1ca714=_0x5a64a6[_0x74af('0x20')];var _0x1dece0=_0x5933e2?0x0:_0x80d659['offset'];var _0x52af85=_0x5933e2?_0x5a64a6[_0x74af('0x20')]:_0x80d659[_0x74af('0x1d')]+_0x80d659['limit'];var _0x10cafb;if(_0x52af85>=_0x1ca714){_0x52af85=_0x1ca714;_0x10cafb=0xc8;}else{_0x10cafb=0xce;}_0x20badd[_0x74af('0x1a')](_0x10cafb);return _0x20badd[_0x74af('0x21')](_0x74af('0x22'),_0x1dece0+'-'+_0x52af85+'/'+_0x1ca714)[_0x74af('0x1c')](_0x5a64a6);}return null;};}function patchUpdates(_0x41f5e5){return function(_0x1a52bc){try{jsonpatch['apply'](_0x1a52bc,_0x41f5e5,!![]);}catch(_0x2e3c60){return BPromise[_0x74af('0x23')](_0x2e3c60);}return _0x1a52bc[_0x74af('0x24')]();};}function saveUpdates(_0x4ce280,_0x924ec5){return function(_0x1ae7f4){if(_0x1ae7f4){return _0x1ae7f4[_0x74af('0x25')](_0x4ce280)[_0x74af('0x26')](function(_0x22873e){return _0x22873e;});}return null;};}function removeEntity(_0x54a39a,_0x4b04c4){return function(_0x5be2e9){if(_0x5be2e9){return _0x5be2e9['destroy']()[_0x74af('0x26')](function(){_0x54a39a['status'](0xcc)[_0x74af('0x1b')]();});}};}function handleEntityNotFound(_0x380e1e,_0x4d2745){return function(_0x49d66d){if(!_0x49d66d){_0x380e1e[_0x74af('0x19')](0x194);}return _0x49d66d;};}function handleError(_0x144daa,_0x3fe236){_0x3fe236=_0x3fe236||0x1f4;return function(_0x15b79a){logger[_0x74af('0x27')](_0x15b79a['stack']);if(_0x15b79a[_0x74af('0x28')]){delete _0x15b79a[_0x74af('0x28')];}_0x144daa[_0x74af('0x1a')](_0x3fe236)[_0x74af('0x29')](_0x15b79a);};}exports[_0x74af('0x2a')]=function(_0x304450,_0x2124bd){var _0x5d96c0={},_0x14381c={},_0x10befa={'count':0x0,'rows':[]};var _0x3b27fd=_[_0x74af('0x2b')](db[_0x74af('0x2c')][_0x74af('0x2d')],function(_0x204ae8){return{'name':_0x204ae8['fieldName'],'type':_0x204ae8[_0x74af('0x2e')]['key']};});_0x14381c[_0x74af('0x2f')]=_[_0x74af('0x30')](_[_0x74af('0x2b')](_0x3b27fd,_0x74af('0x28')),[_0x74af('0x28')]);_0x14381c['query']=_[_0x74af('0x31')](_0x304450[_0x74af('0x32')]);_0x14381c[_0x74af('0x33')]=_[_0x74af('0x34')](_0x14381c[_0x74af('0x2f')],_0x14381c[_0x74af('0x32')]);_0x5d96c0[_0x74af('0x35')]=_['intersection'](_0x14381c[_0x74af('0x2f')],qs[_0x74af('0x36')](_0x304450[_0x74af('0x32')][_0x74af('0x36')]));_0x5d96c0[_0x74af('0x35')]=_0x5d96c0[_0x74af('0x35')]['length']?_0x5d96c0[_0x74af('0x35')]:_0x14381c['model'];if(!_0x304450[_0x74af('0x32')][_0x74af('0x37')](_0x74af('0x38'))){_0x5d96c0[_0x74af('0x1f')]=qs[_0x74af('0x1f')](_0x304450[_0x74af('0x32')][_0x74af('0x1f')]);_0x5d96c0['offset']=qs[_0x74af('0x1d')](_0x304450[_0x74af('0x32')][_0x74af('0x1d')]);}_0x5d96c0['order']=qs[_0x74af('0x39')](_0x304450[_0x74af('0x32')][_0x74af('0x39')]);_0x5d96c0['where']=qs[_0x74af('0x33')](_['pick'](_0x304450[_0x74af('0x32')],_0x14381c[_0x74af('0x33')]),_0x3b27fd);if(_0x304450[_0x74af('0x32')][_0x74af('0x3a')]){_0x5d96c0[_0x74af('0x3b')]=_['merge'](_0x5d96c0[_0x74af('0x3b')],{'$or':_[_0x74af('0x2b')](_0x3b27fd,function(_0x2e03f2){if(_0x2e03f2[_0x74af('0x2e')]!==_0x74af('0x3c')){var _0x121ae2={};_0x121ae2[_0x2e03f2[_0x74af('0x28')]]={'$like':'%'+_0x304450[_0x74af('0x32')][_0x74af('0x3a')]+'%'};return _0x121ae2;}})});}_0x5d96c0=_[_0x74af('0x3d')]({},_0x5d96c0,_0x304450[_0x74af('0x3e')]);var _0x65b83b={'where':_0x5d96c0[_0x74af('0x3b')]};return db['CmCustomField']['count'](_0x65b83b)[_0x74af('0x26')](function(_0x173fff){_0x10befa[_0x74af('0x20')]=_0x173fff;if(_0x304450[_0x74af('0x32')][_0x74af('0x3f')]){_0x5d96c0['include']=[{'all':!![]}];}return db[_0x74af('0x2c')][_0x74af('0x40')](_0x5d96c0);})[_0x74af('0x26')](function(_0xa8b9b7){_0x10befa[_0x74af('0x41')]=_0xa8b9b7;return _0x10befa;})[_0x74af('0x26')](respondWithFilteredResult(_0x2124bd,_0x5d96c0))[_0x74af('0x42')](handleError(_0x2124bd,null));};exports[_0x74af('0x43')]=function(_0x549e81,_0x55a0fa){var _0x371167={'raw':!![],'where':{'id':_0x549e81[_0x74af('0x44')]['id']}},_0x2647b6={};_0x2647b6[_0x74af('0x2f')]=_[_0x74af('0x31')](db['CmCustomField'][_0x74af('0x2d')]);_0x2647b6[_0x74af('0x32')]=_[_0x74af('0x31')](_0x549e81['query']);_0x2647b6[_0x74af('0x33')]=_['intersection'](_0x2647b6['model'],_0x2647b6[_0x74af('0x32')]);_0x371167[_0x74af('0x35')]=_['intersection'](_0x2647b6[_0x74af('0x2f')],qs[_0x74af('0x36')](_0x549e81['query']['fields']));_0x371167[_0x74af('0x35')]=_0x371167['attributes'][_0x74af('0x45')]?_0x371167[_0x74af('0x35')]:_0x2647b6[_0x74af('0x2f')];if(_0x549e81['query'][_0x74af('0x3f')]){_0x371167['include']=[{'all':!![]}];}_0x371167=_['merge']({},_0x371167,_0x549e81[_0x74af('0x3e')]);return db[_0x74af('0x2c')][_0x74af('0x46')](_0x371167)[_0x74af('0x26')](handleEntityNotFound(_0x55a0fa,null))['then'](respondWithResult(_0x55a0fa,null))[_0x74af('0x42')](handleError(_0x55a0fa,null));};exports[_0x74af('0x25')]=function(_0x1809e4,_0x5689ec){if(_0x1809e4[_0x74af('0x47')]['id']){delete _0x1809e4[_0x74af('0x47')]['id'];}return db[_0x74af('0x2c')][_0x74af('0x46')]({'where':{'id':_0x1809e4[_0x74af('0x44')]['id']}})[_0x74af('0x26')](handleEntityNotFound(_0x5689ec,null))[_0x74af('0x26')](saveUpdates(_0x1809e4[_0x74af('0x47')],null))[_0x74af('0x26')](respondWithResult(_0x5689ec,null))[_0x74af('0x42')](handleError(_0x5689ec,null));};exports[_0x74af('0x48')]=function(_0x3ddd70,_0x30d68c){return db[_0x74af('0x2c')][_0x74af('0x46')]({'where':{'id':_0x3ddd70[_0x74af('0x44')]['id']}})[_0x74af('0x26')](handleEntityNotFound(_0x30d68c,null))[_0x74af('0x26')](removeEntity(_0x30d68c,null))[_0x74af('0x42')](handleError(_0x30d68c,null));};exports[_0x74af('0x49')]=function(_0x167f62,_0x81ad0a){var _0x189d72;return db['sequelize'][_0x74af('0x4a')](function(_0x26e287){return db[_0x74af('0x2c')][_0x74af('0x49')](_0x167f62['body'],{'transaction':_0x26e287})[_0x74af('0x26')](function(_0x597eb2){_0x189d72=_0x597eb2;var _0x244f9d={'type':db[_0x74af('0x4b')][_0x74af('0x4c')],'transaction':_0x26e287};switch(_0x167f62['body'][_0x74af('0x2e')]){case _0x74af('0x4d'):_0x244f9d[_0x74af('0x2e')]=db[_0x74af('0x4b')][_0x74af('0x4c')];break;case'number':_0x244f9d['type']=db[_0x74af('0x4b')]['INTEGER'];break;case _0x74af('0x4e'):_0x244f9d[_0x74af('0x2e')]=db[_0x74af('0x4b')][_0x74af('0x4f')];_0x244f9d[_0x74af('0x50')]=![];break;default:}return db[_0x74af('0x51')]['queryInterface']['addColumn'](_0x74af('0x52'),util[_0x74af('0x53')]('cf_%d',_0x189d72['id']),_0x244f9d);})['then'](function(){return _0x189d72;});})[_0x74af('0x26')](respondWithResult(_0x81ad0a,0xc9))[_0x74af('0x42')](handleError(_0x81ad0a,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2aaef22..367568f 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 _0xdcbb=['path','../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xdcbb,0x92));var _0xbdcb=function(_0x265229,_0x18282d){_0x265229=_0x265229-0x0;var _0x40fa48=_0xdcbb[_0x265229];return _0x40fa48;};'use strict';var _=require(_0xbdcb('0x0'));var util=require(_0xbdcb('0x1'));var logger=require(_0xbdcb('0x2'))(_0xbdcb('0x3'));var moment=require(_0xbdcb('0x4'));var BPromise=require(_0xbdcb('0x5'));var rp=require(_0xbdcb('0x6'));var fs=require('fs');var path=require(_0xbdcb('0x7'));var rimraf=require('rimraf');var config=require(_0xbdcb('0x8'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x14a2d0,_0x187a7e){return _0x14a2d0['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe574=['bluebird','request-promise','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x24ccd2,_0x3a05fe){var _0x54b0ad=function(_0x26333f){while(--_0x26333f){_0x24ccd2['push'](_0x24ccd2['shift']());}};_0x54b0ad(++_0x3a05fe);}(_0xe574,0xb8));var _0x4e57=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe574[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x4e57('0x0'));var util=require(_0x4e57('0x1'));var logger=require(_0x4e57('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e57('0x3'));var rp=require(_0x4e57('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e57('0x5'));var config=require(_0x4e57('0x6'));var attributes=require('./cmCustomField.attributes');module[_0x4e57('0x7')]=function(_0x475bdf,_0x3b44e0){return _0x475bdf[_0x4e57('0x8')](_0x4e57('0x9'),attributes,{'tableName':_0x4e57('0xa'),'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 feb18be..4e3b0ec 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 _0x8451=['CmCustomField,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24491e,_0x14aff2){var _0x405570=function(_0xa02171){while(--_0xa02171){_0x24491e['push'](_0x24491e['shift']());}};_0x405570(++_0x14aff2);}(_0x8451,0x100));var _0x1845=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8451[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x1845('0x0'));var util=require(_0x1845('0x1'));var moment=require(_0x1845('0x2'));var BPromise=require('bluebird');var rs=require(_0x1845('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1845('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1845('0x5'))('rpc');var config=require(_0x1845('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1845('0x7')][_0x1845('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dfd85,_0x4d4d63,_0xcd566f){return new BPromise(function(_0x120bec,_0x554c9f){return client[_0x1845('0x9')](_0x3dfd85,_0xcd566f)['then'](function(_0x451163){logger[_0x1845('0xa')](_0x1845('0xb'),_0x4d4d63,_0x1845('0xc'));logger[_0x1845('0xd')](_0x1845('0xe'),_0x4d4d63,_0x1845('0xc'),JSON['stringify'](_0x451163));if(_0x451163['error']){if(_0x451163[_0x1845('0xf')]['code']===0x1f4){logger[_0x1845('0xf')](_0x1845('0xb'),_0x4d4d63,_0x451163[_0x1845('0xf')][_0x1845('0x10')]);return _0x554c9f(_0x451163[_0x1845('0xf')][_0x1845('0x10')]);}logger[_0x1845('0xf')](_0x1845('0xb'),_0x4d4d63,_0x451163[_0x1845('0xf')][_0x1845('0x10')]);return _0x120bec(_0x451163[_0x1845('0xf')][_0x1845('0x10')]);}else{logger['info'](_0x1845('0xb'),_0x4d4d63,'request\x20sent');_0x120bec(_0x451163[_0x1845('0x11')][_0x1845('0x10')]);}})['catch'](function(_0x521ca3){logger[_0x1845('0xf')]('CmCustomField,\x20%s,\x20%s',_0x4d4d63,_0x521ca3);_0x554c9f(_0x521ca3);});});} \ No newline at end of file +var _0x28fc=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x25dea3,_0x2dfb02){var _0x2a700b=function(_0x30f7fc){while(--_0x30f7fc){_0x25dea3['push'](_0x25dea3['shift']());}};_0x2a700b(++_0x2dfb02);}(_0x28fc,0x19e));var _0xc28f=function(_0x4d9efa,_0x2c75d3){_0x4d9efa=_0x4d9efa-0x0;var _0x4601ef=_0x28fc[_0x4d9efa];return _0x4601ef;};'use strict';var _=require(_0xc28f('0x0'));var util=require(_0xc28f('0x1'));var moment=require(_0xc28f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc28f('0x3'));var fs=require('fs');var Redis=require(_0xc28f('0x4'));var db=require(_0xc28f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc28f('0x6'))(_0xc28f('0x7'));var config=require(_0xc28f('0x8'));var jayson=require(_0xc28f('0x9'));var client=jayson[_0xc28f('0xa')][_0xc28f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x461519,_0x1441fd,_0x15a33e){return new BPromise(function(_0x479f84,_0x55de25){return client[_0xc28f('0xc')](_0x461519,_0x15a33e)[_0xc28f('0xd')](function(_0x46f22e){logger[_0xc28f('0xe')](_0xc28f('0xf'),_0x1441fd,_0xc28f('0x10'));logger[_0xc28f('0x11')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1441fd,'request\x20sent',JSON[_0xc28f('0x12')](_0x46f22e));if(_0x46f22e['error']){if(_0x46f22e[_0xc28f('0x13')]['code']===0x1f4){logger[_0xc28f('0x13')](_0xc28f('0xf'),_0x1441fd,_0x46f22e['error'][_0xc28f('0x14')]);return _0x55de25(_0x46f22e[_0xc28f('0x13')][_0xc28f('0x14')]);}logger[_0xc28f('0x13')](_0xc28f('0xf'),_0x1441fd,_0x46f22e[_0xc28f('0x13')]['message']);return _0x479f84(_0x46f22e[_0xc28f('0x13')][_0xc28f('0x14')]);}else{logger[_0xc28f('0xe')](_0xc28f('0xf'),_0x1441fd,_0xc28f('0x10'));_0x479f84(_0x46f22e[_0xc28f('0x15')][_0xc28f('0x14')]);}})[_0xc28f('0x16')](function(_0x46801d){logger[_0xc28f('0x13')](_0xc28f('0xf'),_0x1441fd,_0x46801d);_0x55de25(_0x46801d);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 67af102..53109a9 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 _0xbfe8=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get'];(function(_0x4e1bd3,_0xda464d){var _0x234e83=function(_0x144f4d){while(--_0x144f4d){_0x4e1bd3['push'](_0x4e1bd3['shift']());}};_0x234e83(++_0xda464d);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x212c79,_0x53f2b1){_0x212c79=_0x212c79-0x0;var _0x5954a6=_0xbfe8[_0x212c79];return _0x5954a6;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0xa')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3821=['./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xaa2f13,_0x2ba478){var _0x28186f=function(_0x2e9470){while(--_0x2e9470){_0xaa2f13['push'](_0xaa2f13['shift']());}};_0x28186f(++_0x2ba478);}(_0x3821,0xf7));var _0x1382=function(_0x21a9ce,_0x96790b){_0x21a9ce=_0x21a9ce-0x0;var _0x3329f5=_0x3821[_0x21a9ce];return _0x3329f5;};'use strict';var multer=require(_0x1382('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1382('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1382('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1382('0x3'));var config=require(_0x1382('0x4'));var controller=require(_0x1382('0x5'));router[_0x1382('0x6')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0x8')]);router[_0x1382('0x6')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0xa')]);router[_0x1382('0xb')]('/',auth['isAuthenticated'](),controller[_0x1382('0xc')]);router[_0x1382('0xd')](_0x1382('0x9'),auth['isAuthenticated'](),controller[_0x1382('0xe')]);router[_0x1382('0xf')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0x10')]);module[_0x1382('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index ffc61ea..7fda5e9 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 _0xa5a6=['INTEGER','contactListQueue','moment','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x28f173,_0x4bbb3f){var _0x4e267d=function(_0x4ee832){while(--_0x4ee832){_0x28f173['push'](_0x28f173['shift']());}};_0x4e267d(++_0x4bbb3f);}(_0xa5a6,0x6b));var _0x6a5a=function(_0x53b199,_0x38ff21){_0x53b199=_0x53b199-0x0;var _0x1ba42d=_0xa5a6[_0x53b199];return _0x1ba42d;};'use strict';var moment=require(_0x6a5a('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x6a5a('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x6a5a('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6a5a('0x3')],'defaultValue':moment()['format'](_0x6a5a('0x4'))},'countbusyretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6a5a('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6a5a('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6a5a('0x3')]},'priority':{'type':Sequelize[_0x6a5a('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6a5a('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6a5a('0x5')],'unique':_0x6a5a('0x6')},'ListId':{'type':Sequelize[_0x6a5a('0x5')],'unique':_0x6a5a('0x6')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x6a5a('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6a5a('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6a5a('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6a5a('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6a5a('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x502c=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN'];(function(_0x3ce893,_0xb75779){var _0xcb7d19=function(_0x18acd4){while(--_0x18acd4){_0x3ce893['push'](_0x3ce893['shift']());}};_0xcb7d19(++_0xb75779);}(_0x502c,0xb0));var _0xc502=function(_0x99247e,_0x4c4eac){_0x99247e=_0x99247e-0x0;var _0x573e13=_0x502c[_0x99247e];return _0x573e13;};'use strict';var moment=require('moment');var Sequelize=require(_0xc502('0x0'));module[_0xc502('0x1')]={'phone':{'type':Sequelize[_0xc502('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xc502('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc502('0x4')](_0xc502('0x5'))},'countbusyretry':{'type':Sequelize[_0xc502('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc502('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc502('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc502('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc502('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc502('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc502('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc502('0x6')],'unique':_0xc502('0x9')},'ListId':{'type':Sequelize[_0xc502('0x6')],'unique':_0xc502('0x9')},'UserId':{'type':Sequelize[_0xc502('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc502('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc502('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc502('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc502('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc502('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xc502('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f6eed7f..4754239 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 _0x98a8=['preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','hopperIds','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','LOCK','CmCompany','outbound','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','push','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','sendStatus','stack','name','send','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$eq','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','user','deleted','deletedat','calleridnum','phone','queue','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues'];(function(_0x7dc397,_0x42d668){var _0x14e534=function(_0x4543a1){while(--_0x4543a1){_0x7dc397['push'](_0x7dc397['shift']());}};_0x14e534(++_0x42d668);}(_0x98a8,0x12c));var _0x898a=function(_0x2339a8,_0x480b13){_0x2339a8=_0x2339a8-0x0;var _0x1b8bd9=_0x98a8[_0x2339a8];return _0x1b8bd9;};'use strict';var moment=require(_0x898a('0x0'));var _=require(_0x898a('0x1'));var qs=require(_0x898a('0x2'));var logger=require(_0x898a('0x3'))(_0x898a('0x4'));var shared=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];function respondWithResult(_0x4a0836,_0x2bb3e2){_0x2bb3e2=_0x2bb3e2||0xc8;return function(_0xf84a19){if(_0xf84a19){return _0x4a0836[_0x898a('0x7')](_0x2bb3e2)[_0x898a('0x8')](_0xf84a19);}};}function respondWithFilteredResult(_0x3e7ddd,_0x5d7e59){return function(_0x3aadc2){if(_0x3aadc2){var _0x564583=typeof _0x5d7e59[_0x898a('0x9')]==='undefined'&&typeof _0x5d7e59[_0x898a('0xa')]===_0x898a('0xb');var _0x2101b3=_0x3aadc2[_0x898a('0xc')];var _0x3150df=_0x564583?0x0:_0x5d7e59[_0x898a('0x9')];var _0x42faa4=_0x564583?_0x3aadc2[_0x898a('0xc')]:_0x5d7e59[_0x898a('0x9')]+_0x5d7e59['limit'];var _0x3e1867;if(_0x42faa4>=_0x2101b3){_0x42faa4=_0x2101b3;_0x3e1867=0xc8;}else{_0x3e1867=0xce;}_0x3e7ddd['status'](_0x3e1867);return _0x3e7ddd[_0x898a('0xd')]('Content-Range',_0x3150df+'-'+_0x42faa4+'/'+_0x2101b3)[_0x898a('0x8')](_0x3aadc2);}return null;};}function saveUpdates(_0x2c76b7,_0x364a23){return function(_0x5f5e06){if(_0x5f5e06){return _0x5f5e06['update'](_0x2c76b7)['then'](function(_0x373d53){return _0x373d53;});}return null;};}function handleEntityNotFound(_0x1f5be4,_0xb24335){return function(_0x116fbe){if(!_0x116fbe){_0x1f5be4[_0x898a('0xe')](0x194);}return _0x116fbe;};}function handleError(_0x15177d,_0x506023){_0x506023=_0x506023||0x1f4;return function(_0x47033c){logger['error'](_0x47033c[_0x898a('0xf')]);if(_0x47033c['name']){delete _0x47033c[_0x898a('0x10')];}_0x15177d['status'](_0x506023)[_0x898a('0x11')](_0x47033c);};}exports['index']=function(_0xee4408,_0x3197f7){var _0x28cc63={},_0x4ddd4d={},_0x1faf4c={'count':0x0,'rows':[]};var _0x5960e0=_['map'](db[_0x898a('0x12')][_0x898a('0x13')],function(_0x58c3ab){return{'name':_0x58c3ab['fieldName'],'type':_0x58c3ab[_0x898a('0x14')][_0x898a('0x15')]};});_0x4ddd4d[_0x898a('0x16')]=_[_0x898a('0x17')](_0x5960e0,_0x898a('0x10'));_0x4ddd4d[_0x898a('0x18')]=_[_0x898a('0x19')](_0xee4408['query']);_0x4ddd4d[_0x898a('0x1a')]=_[_0x898a('0x1b')](_0x4ddd4d[_0x898a('0x16')],_0x4ddd4d[_0x898a('0x18')]);_0x4ddd4d[_0x898a('0x1a')]=_[_0x898a('0x1c')](_0x4ddd4d['filters'],[_0x898a('0x1d'),_0x898a('0x1e'),_0x898a('0x1f'),_0x898a('0x20'),_0x898a('0x21'),_0x898a('0x22'),'$ne',_0x898a('0x23'),'$not','$between','$notBetween',_0x898a('0x24'),_0x898a('0x25'),_0x898a('0x26'),_0x898a('0x27'),_0x898a('0x28'),_0x898a('0x29'),_0x898a('0x26'),_0x898a('0x2a'),_0x898a('0x2b'),'$contained','$any']);_0x28cc63['attributes']=_[_0x898a('0x1b')](_0x4ddd4d[_0x898a('0x16')],qs[_0x898a('0x2c')](_0xee4408[_0x898a('0x18')][_0x898a('0x2c')]));_0x28cc63[_0x898a('0x2d')]=_0x28cc63[_0x898a('0x2d')][_0x898a('0x2e')]?_0x28cc63[_0x898a('0x2d')]:_0x4ddd4d[_0x898a('0x16')];if(!_0xee4408[_0x898a('0x18')][_0x898a('0x2f')]('nolimit')){_0x28cc63[_0x898a('0xa')]=qs[_0x898a('0xa')](_0xee4408[_0x898a('0x18')][_0x898a('0xa')]);_0x28cc63[_0x898a('0x9')]=qs['offset'](_0xee4408['query'][_0x898a('0x9')]);}_0x28cc63[_0x898a('0x30')]=qs[_0x898a('0x31')](_0xee4408['query'][_0x898a('0x31')]);_0x28cc63[_0x898a('0x32')]=qs[_0x898a('0x1a')](_[_0x898a('0x33')](_0xee4408[_0x898a('0x18')],_0x4ddd4d[_0x898a('0x1a')]),_0x5960e0);if(_0xee4408[_0x898a('0x18')][_0x898a('0x34')]){_0x28cc63['where']=_[_0x898a('0x35')](_0x28cc63['where'],{'$or':_['map'](_0x5960e0,function(_0x14e2dc){if(_0x14e2dc['type']!==_0x898a('0x36')){var _0x4b3aac={};_0x4b3aac[_0x14e2dc[_0x898a('0x10')]]={'$like':'%'+_0xee4408['query'][_0x898a('0x34')]+'%'};return _0x4b3aac;}})});}_0x28cc63=_[_0x898a('0x35')]({},_0x28cc63,_0xee4408[_0x898a('0x37')]);var _0x50c0e4={'where':_0x28cc63['where']};return db['CmHopper'][_0x898a('0xc')](_0x50c0e4)[_0x898a('0x38')](function(_0x5a228f){_0x1faf4c[_0x898a('0xc')]=_0x5a228f;if(_0xee4408[_0x898a('0x18')][_0x898a('0x39')]){_0x28cc63[_0x898a('0x3a')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x28cc63);})[_0x898a('0x38')](function(_0x454c8c){_0x1faf4c['rows']=_0x454c8c;return _0x1faf4c;})['then'](respondWithFilteredResult(_0x3197f7,_0x28cc63))[_0x898a('0x3b')](handleError(_0x3197f7,null));};exports[_0x898a('0x3c')]=function(_0x181cc8,_0xa45405){var _0x51681f={'raw':!![],'where':{'id':_0x181cc8[_0x898a('0x3d')]['id']}},_0x67114b={};_0x67114b['model']=_['keys'](db['CmHopper'][_0x898a('0x13')]);_0x67114b[_0x898a('0x18')]=_[_0x898a('0x19')](_0x181cc8[_0x898a('0x18')]);_0x67114b[_0x898a('0x1a')]=_[_0x898a('0x1b')](_0x67114b[_0x898a('0x16')],_0x67114b[_0x898a('0x18')]);_0x51681f[_0x898a('0x2d')]=_[_0x898a('0x1b')](_0x67114b[_0x898a('0x16')],qs[_0x898a('0x2c')](_0x181cc8[_0x898a('0x18')][_0x898a('0x2c')]));_0x51681f[_0x898a('0x2d')]=_0x51681f['attributes'][_0x898a('0x2e')]?_0x51681f[_0x898a('0x2d')]:_0x67114b[_0x898a('0x16')];if(_0x181cc8['query'][_0x898a('0x39')]){_0x51681f[_0x898a('0x3a')]=[{'all':!![]}];}_0x51681f=_[_0x898a('0x35')]({},_0x51681f,_0x181cc8[_0x898a('0x37')]);return db[_0x898a('0x12')][_0x898a('0x3e')](_0x51681f)[_0x898a('0x38')](handleEntityNotFound(_0xa45405,null))[_0x898a('0x38')](respondWithResult(_0xa45405,null))['catch'](handleError(_0xa45405,null));};exports[_0x898a('0x3f')]=function(_0x1a874a,_0x3d4aa3){return db[_0x898a('0x12')]['create'](_0x1a874a[_0x898a('0x40')],{})[_0x898a('0x38')](respondWithResult(_0x3d4aa3,0xc9))['catch'](handleError(_0x3d4aa3,null));};exports[_0x898a('0x41')]=function(_0x4ce00e,_0x56a40c){if(_0x4ce00e['body']['id']){delete _0x4ce00e['body']['id'];}return db[_0x898a('0x12')]['find']({'where':{'id':_0x4ce00e[_0x898a('0x3d')]['id']}})[_0x898a('0x38')](handleEntityNotFound(_0x56a40c,null))['then'](saveUpdates(_0x4ce00e[_0x898a('0x40')],null))[_0x898a('0x38')](respondWithResult(_0x56a40c,null))['catch'](handleError(_0x56a40c,null));};exports[_0x898a('0x42')]=function(_0x199437,_0x11a0a3){return db[_0x898a('0x12')]['describe']()[_0x898a('0x38')](respondWithResult(_0x11a0a3,null))[_0x898a('0x3b')](handleError(_0x11a0a3,null));};exports['destroy']=function(_0x25adcc,_0x1d8c16){var _0x4ab441;var _0x28525b=_0x25adcc['params']['id'];return db[_0x898a('0x12')][_0x898a('0x3e')]({'where':{'id':_0x25adcc[_0x898a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1d8c16,null))[_0x898a('0x38')](function(_0x1b09da){if(_0x1b09da){return _0x1b09da[_0x898a('0x43')]()[_0x898a('0x38')](function(_0x5a8a2c){return _0x5a8a2c;});}})[_0x898a('0x38')](function(_0x529d7c){_0x4ab441=_0x529d7c;if(_0x529d7c){if(_0x529d7c[_0x898a('0x44')]||_0x529d7c[_0x898a('0x45')]){return db[_0x529d7c[_0x898a('0x44')]?'VoiceQueue':_0x898a('0x46')][_0x898a('0x3e')]({'where':{'id':_0x529d7c[_0x898a('0x44')]?_0x529d7c['VoiceQueueId']:_0x529d7c['CampaignId']},'attributes':['id',_0x898a('0x10')],'raw':!![]});}}})[_0x898a('0x38')](function(_0x13b3ed){var _0x295f1e={};if(_0x13b3ed){_[_0x898a('0x35')](_0x295f1e,_[_0x898a('0x47')](_0x4ab441[_0x898a('0x48')],[_0x898a('0x49'),_0x898a('0x4a'),'id']));_0x295f1e[_0x898a('0x4b')]=0x15;_0x295f1e[_0x898a('0x4c')]='deleted';_0x295f1e[_0x898a('0x4d')]=_0x13b3ed[_0x898a('0x10')];_0x295f1e['membername']=_0x25adcc[_0x898a('0x4e')]['name'];_0x295f1e['UserId']=_0x25adcc[_0x898a('0x4e')]['id'];_0x295f1e[_0x898a('0x4f')]=!![];_0x295f1e[_0x898a('0x50')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x295f1e[_0x898a('0x51')]=_0x4ab441[_0x898a('0x52')];_0x295f1e['campaigntype']=_0x4ab441[_0x898a('0x44')]?_0x898a('0x53'):'ivr';return db[_0x898a('0x54')][_0x898a('0x3e')]({'where':{'id':_0x295f1e[_0x898a('0x55')]},'attributes':['firstName',_0x898a('0x56')]})[_0x898a('0x38')](function(_0x9c25ee){if(!_[_0x898a('0x57')](_0x1d8c16)&&!_[_0x898a('0x57')](_0x9c25ee[_0x898a('0x58')])){_0x295f1e['calleridname']=_0x9c25ee[_0x898a('0x58')];if(!_['isNil'](_0x9c25ee[_0x898a('0x56')])){_0x295f1e[_0x898a('0x59')]+='\x20'+_0x9c25ee[_0x898a('0x56')];}}})[_0x898a('0x5a')](function(){return db[_0x898a('0x5b')][_0x898a('0x3f')](_0x295f1e);});}})[_0x898a('0x38')](function(_0x75ff57){return db[_0x898a('0x5c')]['destroy']({'where':{'CmHopperId':_0x28525b}});})[_0x898a('0x38')](function(){return _0x1d8c16[_0x898a('0x7')](0xcc)[_0x898a('0x5d')]();})[_0x898a('0x3b')](handleError(_0x1d8c16,null));};exports[_0x898a('0x5e')]=function(_0x2a1345,_0x9d8b4e){var _0x68fd81=[];return db[_0x898a('0x54')][_0x898a('0x42')]()[_0x898a('0x38')](function(_0x217dda){_0x68fd81=_[_0x898a('0x19')](_0x217dda);return _0x2a1345[_0x898a('0x4e')][_0x898a('0x5f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x898a('0x60')},'attributes':['id',_0x898a('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x898a('0x38')](function(_0x4583a1){if(_0x4583a1&&_0x4583a1['length']){return db[_0x898a('0x62')][_0x898a('0x63')](function(_0x21f0f8){var _0x1f3f5b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x898a('0x64'))},'VoiceQueueId':{'$in':_[_0x898a('0x17')](_0x4583a1,'id')},'$or':[{'UserId':null},{'UserId':_0x2a1345[_0x898a('0x4e')]['id']}]};var _0xf86633={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4583a1)['filter']([_0x898a('0x65'),0x0])[_0x898a('0x17')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2a1345[_0x898a('0x4e')]['id']}]};var _0x3c0bf6={'$or':[_0x1f3f5b,_0xf86633]};var _0x5b7019=[];if(_0x2a1345[_0x898a('0x40')]['direction']&&_0x2a1345[_0x898a('0x40')]['direction']==='prev'){if(!_['isEmpty'](_0x2a1345[_0x898a('0x40')][_0x898a('0x66')])){_0x3c0bf6['id']={'$in':_0x2a1345[_0x898a('0x40')][_0x898a('0x66')]};}_0x5b7019=[['priority','ASC'],[_0x898a('0x67'),_0x4583a1[0x0][_0x898a('0x61')]===_0x898a('0x68')?_0x898a('0x69'):_0x898a('0x68')],db[_0x898a('0x62')][_0x898a('0x6a')](_0x898a('0x6b')),['id','DESC']];}else{if(!_[_0x898a('0x6c')](_0x2a1345[_0x898a('0x40')]['hopperIds'])){_0x3c0bf6['id']={'$notIn':_0x2a1345[_0x898a('0x40')][_0x898a('0x66')]};}_0x5b7019=[[_0x898a('0x6d'),_0x898a('0x69')],[_0x898a('0x67'),_0x4583a1[0x0][_0x898a('0x61')]],db[_0x898a('0x62')][_0x898a('0x6a')](_0x898a('0x6e')),['id',_0x898a('0x68')]];}return db[_0x898a('0x12')][_0x898a('0x6f')]({'attributes':['id',_0x898a('0x70'),'phone',_0x898a('0x71')],'where':_0x3c0bf6,'order':_0x5b7019,'transaction':_0x21f0f8,'lock':_0x21f0f8['LOCK'][_0x898a('0x72')],'include':[{'model':db[_0x898a('0x54')],'as':_0x898a('0x73'),'attributes':_0x68fd81,'include':[{'model':db['CmCompany'],'as':_0x898a('0x74'),'attributes':['id',_0x898a('0x10')]}]},{'model':db[_0x898a('0x75')],'as':_0x898a('0x76'),'attributes':['id',_0x898a('0x10')]},{'model':db['VoiceQueue'],'as':_0x898a('0x77'),'attributes':['id',_0x898a('0x10'),_0x898a('0x78')]}]})[_0x898a('0x38')](function(_0xc1c3fe){if(_0xc1c3fe){return _0xc1c3fe['update']({'UserId':_0x2a1345[_0x898a('0x4e')]['id']},{'transaction':_0x21f0f8});}});});}})[_0x898a('0x38')](handleEntityNotFound(_0x9d8b4e,null))[_0x898a('0x38')](respondWithResult(_0x9d8b4e,null))[_0x898a('0x3b')](handleError(_0x9d8b4e,null));};exports[_0x898a('0x79')]=function(_0x420347,_0x1fd617,_0x1b0c09){var _0x51836c=[];var _0x32a207=_0x420347[_0x898a('0x3d')]['id'];var _0x558f13=_0x420347[_0x898a('0x4e')]['id'];return db['CmContact'][_0x898a('0x42')]()['then'](function(_0x2471d8){_0x51836c=_[_0x898a('0x19')](_0x2471d8);return db[_0x898a('0x62')][_0x898a('0x63')](function(_0x109064){const _0x2c7e30={'id':_0x32a207};return db[_0x898a('0x12')][_0x898a('0x6f')]({'attributes':['id',_0x898a('0x70'),'recallme'],'where':_0x2c7e30,'transaction':_0x109064,'lock':_0x109064[_0x898a('0x7a')][_0x898a('0x72')],'include':[{'model':db[_0x898a('0x54')],'as':_0x898a('0x73'),'attributes':_0x51836c,'include':[{'model':db[_0x898a('0x7b')],'as':_0x898a('0x74'),'attributes':['id',_0x898a('0x10')]}]},{'model':db[_0x898a('0x75')],'as':_0x898a('0x76'),'attributes':['id',_0x898a('0x10')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x898a('0x10'),_0x898a('0x78')]}]})['then'](function(_0x5710a0){if(_0x5710a0){return _0x5710a0[_0x898a('0x41')]({'UserId':_0x558f13},{'transaction':_0x109064});}});});})['then'](handleEntityNotFound(_0x1fd617,null))[_0x898a('0x38')](respondWithResult(_0x1fd617,null))[_0x898a('0x3b')](handleError(_0x1fd617,null));};exports['getOpenContacts']=function(_0x3f6815,_0x1c782e){return _0x3f6815[_0x898a('0x4e')][_0x898a('0x5f')]({'where':{'type':_0x898a('0x7c'),'dialActive':!![],'dialMethod':_0x898a('0x60')},'attributes':['id'],'raw':!![]})[_0x898a('0x38')](function(_0x49f8ac){if(_0x49f8ac&&_0x49f8ac[_0x898a('0x2e')]){return db[_0x898a('0x12')][_0x898a('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x898a('0x64'))},'VoiceQueueId':{'$in':_[_0x898a('0x17')](_0x49f8ac,'id')},'$or':[{'UserId':null},{'UserId':_0x3f6815['user']['id']}]}});}return 0x0;})[_0x898a('0x38')](function(_0x532c26){if(!_['isNil'](_0x532c26)&&_['isNumber'](_0x532c26)){return _0x1c782e[_0x898a('0x7')](0xc8)[_0x898a('0x8')]({'contacts':_0x532c26});}else{logger[_0x898a('0x7d')](_0x898a('0x7e'),_0x898a('0x7f'),0x194,_0x898a('0x80'));_0x1c782e[_0x898a('0xe')](0x194);}})['catch'](handleError(_0x1c782e,null));};exports[_0x898a('0x81')]=function(_0x4f29b6,_0x456288){var _0x3da2c1=shared['timezones'];var _0x24670c=[];_[_0x898a('0x17')](_0x3da2c1,function(_0x126ca1){_0x24670c[_0x898a('0x82')]({'id':_0x126ca1[_0x898a('0x10')],'name':_0x126ca1['name'],'utcOffset':_0x126ca1['utcOffset']});});return _0x456288['status'](0xc8)[_0x898a('0x8')]({'tz':_0x24670c});};exports[_0x898a('0x83')]=function(_0x18caad,_0x5c2243){var _0x224746=shared['timezones'];var _0x5c0aed={};if(!_[_0x898a('0x57')](_0x224746[_0x18caad[_0x898a('0x40')]['id']]))_0x5c0aed=_0x224746[_0x18caad[_0x898a('0x40')]['id']];return _0x5c2243[_0x898a('0x7')](0xc8)[_0x898a('0x8')](_0x5c0aed);}; \ No newline at end of file +var _0x9f5a=['omit','dataValues','state','statedesc','campaign','membername','user','UserId','deleted','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','finally','CmHopperFinal','end','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','phone','LOCK','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','findOne','scheduledat','UPDATE','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','rows','catch','params','length','includeAll','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue'];(function(_0x13ace4,_0x4ee8dc){var _0xf4de95=function(_0x2d7ad8){while(--_0x2d7ad8){_0x13ace4['push'](_0x13ace4['shift']());}};_0xf4de95(++_0x4ee8dc);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x3a24a1,_0x498ba0){_0x3a24a1=_0x3a24a1-0x0;var _0x1d18f8=_0x9f5a[_0x3a24a1];return _0x1d18f8;};'use strict';var moment=require(_0xa9f5('0x0'));var _=require(_0xa9f5('0x1'));var qs=require(_0xa9f5('0x2'));var logger=require(_0xa9f5('0x3'))('api');var shared=require(_0xa9f5('0x4'));var db=require(_0xa9f5('0x5'))['db'];function respondWithResult(_0x3cdf79,_0x4eeedd){_0x4eeedd=_0x4eeedd||0xc8;return function(_0x20f51f){if(_0x20f51f){return _0x3cdf79['status'](_0x4eeedd)[_0xa9f5('0x6')](_0x20f51f);}};}function respondWithFilteredResult(_0x219e89,_0x49e337){return function(_0x6c040d){if(_0x6c040d){var _0x285dad=typeof _0x49e337[_0xa9f5('0x7')]===_0xa9f5('0x8')&&typeof _0x49e337[_0xa9f5('0x9')]===_0xa9f5('0x8');var _0x189ef8=_0x6c040d['count'];var _0x2e0ff8=_0x285dad?0x0:_0x49e337[_0xa9f5('0x7')];var _0x4bb362=_0x285dad?_0x6c040d[_0xa9f5('0xa')]:_0x49e337[_0xa9f5('0x7')]+_0x49e337['limit'];var _0x5866a1;if(_0x4bb362>=_0x189ef8){_0x4bb362=_0x189ef8;_0x5866a1=0xc8;}else{_0x5866a1=0xce;}_0x219e89[_0xa9f5('0xb')](_0x5866a1);return _0x219e89[_0xa9f5('0xc')](_0xa9f5('0xd'),_0x2e0ff8+'-'+_0x4bb362+'/'+_0x189ef8)[_0xa9f5('0x6')](_0x6c040d);}return null;};}function saveUpdates(_0x4c26a8,_0x788dec){return function(_0x24ce85){if(_0x24ce85){return _0x24ce85[_0xa9f5('0xe')](_0x4c26a8)['then'](function(_0xc78de5){return _0xc78de5;});}return null;};}function handleEntityNotFound(_0x899513,_0x5a5653){return function(_0x58609c){if(!_0x58609c){_0x899513['sendStatus'](0x194);}return _0x58609c;};}function handleError(_0x100e72,_0x48bfdc){_0x48bfdc=_0x48bfdc||0x1f4;return function(_0x5f2b6a){logger[_0xa9f5('0xf')](_0x5f2b6a[_0xa9f5('0x10')]);if(_0x5f2b6a[_0xa9f5('0x11')]){delete _0x5f2b6a[_0xa9f5('0x11')];}_0x100e72['status'](_0x48bfdc)[_0xa9f5('0x12')](_0x5f2b6a);};}exports[_0xa9f5('0x13')]=function(_0x230fc2,_0x45af85){var _0x2fe6a7={},_0x1ee027={},_0x3b706b={'count':0x0,'rows':[]};var _0x430acb=_[_0xa9f5('0x14')](db[_0xa9f5('0x15')][_0xa9f5('0x16')],function(_0x27a7b0){return{'name':_0x27a7b0['fieldName'],'type':_0x27a7b0[_0xa9f5('0x17')][_0xa9f5('0x18')]};});_0x1ee027[_0xa9f5('0x19')]=_[_0xa9f5('0x14')](_0x430acb,_0xa9f5('0x11'));_0x1ee027[_0xa9f5('0x1a')]=_[_0xa9f5('0x1b')](_0x230fc2['query']);_0x1ee027[_0xa9f5('0x1c')]=_[_0xa9f5('0x1d')](_0x1ee027[_0xa9f5('0x19')],_0x1ee027[_0xa9f5('0x1a')]);_0x1ee027[_0xa9f5('0x1c')]=_[_0xa9f5('0x1e')](_0x1ee027[_0xa9f5('0x1c')],[_0xa9f5('0x1f'),'$or',_0xa9f5('0x20'),_0xa9f5('0x21'),_0xa9f5('0x22'),_0xa9f5('0x23'),_0xa9f5('0x24'),_0xa9f5('0x25'),'$not',_0xa9f5('0x26'),'$notBetween','$in','$notIn',_0xa9f5('0x27'),_0xa9f5('0x28'),_0xa9f5('0x29'),_0xa9f5('0x2a'),_0xa9f5('0x27'),_0xa9f5('0x2b'),'$contains',_0xa9f5('0x2c'),_0xa9f5('0x2d')]);_0x2fe6a7[_0xa9f5('0x2e')]=_[_0xa9f5('0x1d')](_0x1ee027[_0xa9f5('0x19')],qs[_0xa9f5('0x2f')](_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x2f')]));_0x2fe6a7['attributes']=_0x2fe6a7['attributes']['length']?_0x2fe6a7[_0xa9f5('0x2e')]:_0x1ee027[_0xa9f5('0x19')];if(!_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x30')](_0xa9f5('0x31'))){_0x2fe6a7[_0xa9f5('0x9')]=qs[_0xa9f5('0x9')](_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x9')]);_0x2fe6a7[_0xa9f5('0x7')]=qs[_0xa9f5('0x7')](_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x7')]);}_0x2fe6a7['order']=qs[_0xa9f5('0x32')](_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x32')]);_0x2fe6a7[_0xa9f5('0x33')]=qs[_0xa9f5('0x1c')](_[_0xa9f5('0x34')](_0x230fc2[_0xa9f5('0x1a')],_0x1ee027[_0xa9f5('0x1c')]),_0x430acb);if(_0x230fc2['query'][_0xa9f5('0x35')]){_0x2fe6a7['where']=_[_0xa9f5('0x36')](_0x2fe6a7[_0xa9f5('0x33')],{'$or':_['map'](_0x430acb,function(_0x11cc39){if(_0x11cc39[_0xa9f5('0x17')]!==_0xa9f5('0x37')){var _0x2cbd28={};_0x2cbd28[_0x11cc39['name']]={'$like':'%'+_0x230fc2[_0xa9f5('0x1a')][_0xa9f5('0x35')]+'%'};return _0x2cbd28;}})});}_0x2fe6a7=_['merge']({},_0x2fe6a7,_0x230fc2[_0xa9f5('0x38')]);var _0x23232b={'where':_0x2fe6a7[_0xa9f5('0x33')]};return db[_0xa9f5('0x15')][_0xa9f5('0xa')](_0x23232b)[_0xa9f5('0x39')](function(_0x1d71f8){_0x3b706b[_0xa9f5('0xa')]=_0x1d71f8;if(_0x230fc2[_0xa9f5('0x1a')]['includeAll']){_0x2fe6a7['include']=[{'all':!![]}];}return db[_0xa9f5('0x15')][_0xa9f5('0x3a')](_0x2fe6a7);})['then'](function(_0x90b200){_0x3b706b[_0xa9f5('0x3b')]=_0x90b200;return _0x3b706b;})[_0xa9f5('0x39')](respondWithFilteredResult(_0x45af85,_0x2fe6a7))[_0xa9f5('0x3c')](handleError(_0x45af85,null));};exports['show']=function(_0x2bc650,_0x39f83f){var _0x5a4715={'raw':!![],'where':{'id':_0x2bc650[_0xa9f5('0x3d')]['id']}},_0x1d856f={};_0x1d856f['model']=_[_0xa9f5('0x1b')](db[_0xa9f5('0x15')]['rawAttributes']);_0x1d856f[_0xa9f5('0x1a')]=_[_0xa9f5('0x1b')](_0x2bc650['query']);_0x1d856f[_0xa9f5('0x1c')]=_[_0xa9f5('0x1d')](_0x1d856f['model'],_0x1d856f[_0xa9f5('0x1a')]);_0x5a4715['attributes']=_[_0xa9f5('0x1d')](_0x1d856f[_0xa9f5('0x19')],qs['fields'](_0x2bc650[_0xa9f5('0x1a')]['fields']));_0x5a4715['attributes']=_0x5a4715[_0xa9f5('0x2e')][_0xa9f5('0x3e')]?_0x5a4715[_0xa9f5('0x2e')]:_0x1d856f[_0xa9f5('0x19')];if(_0x2bc650[_0xa9f5('0x1a')][_0xa9f5('0x3f')]){_0x5a4715[_0xa9f5('0x40')]=[{'all':!![]}];}_0x5a4715=_[_0xa9f5('0x36')]({},_0x5a4715,_0x2bc650[_0xa9f5('0x38')]);return db['CmHopper'][_0xa9f5('0x41')](_0x5a4715)[_0xa9f5('0x39')](handleEntityNotFound(_0x39f83f,null))[_0xa9f5('0x39')](respondWithResult(_0x39f83f,null))[_0xa9f5('0x3c')](handleError(_0x39f83f,null));};exports[_0xa9f5('0x42')]=function(_0x2b00db,_0x11c1d4){return db[_0xa9f5('0x15')][_0xa9f5('0x42')](_0x2b00db[_0xa9f5('0x43')],{})[_0xa9f5('0x39')](respondWithResult(_0x11c1d4,0xc9))[_0xa9f5('0x3c')](handleError(_0x11c1d4,null));};exports[_0xa9f5('0xe')]=function(_0xd95e3,_0x2dc190){if(_0xd95e3[_0xa9f5('0x43')]['id']){delete _0xd95e3[_0xa9f5('0x43')]['id'];}return db[_0xa9f5('0x15')][_0xa9f5('0x41')]({'where':{'id':_0xd95e3['params']['id']}})['then'](handleEntityNotFound(_0x2dc190,null))[_0xa9f5('0x39')](saveUpdates(_0xd95e3[_0xa9f5('0x43')],null))['then'](respondWithResult(_0x2dc190,null))[_0xa9f5('0x3c')](handleError(_0x2dc190,null));};exports[_0xa9f5('0x44')]=function(_0x44ee96,_0x59e5b7){return db[_0xa9f5('0x15')]['describe']()[_0xa9f5('0x39')](respondWithResult(_0x59e5b7,null))[_0xa9f5('0x3c')](handleError(_0x59e5b7,null));};exports[_0xa9f5('0x45')]=function(_0x836a8d,_0x102ed8){var _0x57c877;var _0x4e17a9=_0x836a8d[_0xa9f5('0x3d')]['id'];return db['CmHopper']['find']({'where':{'id':_0x836a8d[_0xa9f5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x102ed8,null))[_0xa9f5('0x39')](function(_0x56fe65){if(_0x56fe65){return _0x56fe65[_0xa9f5('0x45')]()[_0xa9f5('0x39')](function(_0xafeecc){return _0xafeecc;});}})['then'](function(_0x2cc06e){_0x57c877=_0x2cc06e;if(_0x2cc06e){if(_0x2cc06e[_0xa9f5('0x46')]||_0x2cc06e[_0xa9f5('0x47')]){return db[_0x2cc06e['VoiceQueueId']?_0xa9f5('0x48'):'Campaign']['find']({'where':{'id':_0x2cc06e[_0xa9f5('0x46')]?_0x2cc06e[_0xa9f5('0x46')]:_0x2cc06e[_0xa9f5('0x47')]},'attributes':['id',_0xa9f5('0x11')],'raw':!![]});}}})['then'](function(_0x31cf70){var _0x58b278={};if(_0x31cf70){_[_0xa9f5('0x36')](_0x58b278,_[_0xa9f5('0x49')](_0x57c877[_0xa9f5('0x4a')],['createdAt','updatedAt','id']));_0x58b278[_0xa9f5('0x4b')]=0x15;_0x58b278[_0xa9f5('0x4c')]='deleted';_0x58b278[_0xa9f5('0x4d')]=_0x31cf70[_0xa9f5('0x11')];_0x58b278[_0xa9f5('0x4e')]=_0x836a8d[_0xa9f5('0x4f')][_0xa9f5('0x11')];_0x58b278[_0xa9f5('0x50')]=_0x836a8d[_0xa9f5('0x4f')]['id'];_0x58b278[_0xa9f5('0x51')]=!![];_0x58b278['deletedat']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x58b278[_0xa9f5('0x52')]=_0x57c877['phone'];_0x58b278[_0xa9f5('0x53')]=_0x57c877[_0xa9f5('0x46')]?_0xa9f5('0x54'):_0xa9f5('0x55');return db[_0xa9f5('0x56')][_0xa9f5('0x41')]({'where':{'id':_0x58b278['ContactId']},'attributes':[_0xa9f5('0x57'),_0xa9f5('0x58')]})[_0xa9f5('0x39')](function(_0x19dad6){if(!_[_0xa9f5('0x59')](_0x102ed8)&&!_['isNil'](_0x19dad6[_0xa9f5('0x57')])){_0x58b278['calleridname']=_0x19dad6['firstName'];if(!_['isNil'](_0x19dad6[_0xa9f5('0x58')])){_0x58b278['calleridname']+='\x20'+_0x19dad6[_0xa9f5('0x58')];}}})[_0xa9f5('0x5a')](function(){return db[_0xa9f5('0x5b')]['create'](_0x58b278);});}})['then'](function(_0x2ee9cf){return db['CmHopperAdditionalPhone'][_0xa9f5('0x45')]({'where':{'CmHopperId':_0x4e17a9}});})[_0xa9f5('0x39')](function(){return _0x102ed8[_0xa9f5('0xb')](0xcc)[_0xa9f5('0x5c')]();})[_0xa9f5('0x3c')](handleError(_0x102ed8,null));};exports[_0xa9f5('0x5d')]=function(_0x34c6cb,_0x28ee02){var _0x326a87=[];return db['CmContact']['describe']()[_0xa9f5('0x39')](function(_0x51bd6f){_0x326a87=_[_0xa9f5('0x1b')](_0x51bd6f);return _0x34c6cb[_0xa9f5('0x4f')]['getVoiceQueues']({'where':{'type':_0xa9f5('0x5e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xa9f5('0x5f'),_0xa9f5('0x60')],'raw':!![]});})[_0xa9f5('0x39')](function(_0x5c661e){if(_0x5c661e&&_0x5c661e[_0xa9f5('0x3e')]){return db[_0xa9f5('0x61')][_0xa9f5('0x62')](function(_0x5ab4c0){var _0x2eaa8c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9f5('0x63')](_0xa9f5('0x64'))},'VoiceQueueId':{'$in':_[_0xa9f5('0x14')](_0x5c661e,'id')},'$or':[{'UserId':null},{'UserId':_0x34c6cb[_0xa9f5('0x4f')]['id']}]};var _0x5f0986={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5c661e)[_0xa9f5('0x35')](['dialPreviewAutoRecallMe',0x0])[_0xa9f5('0x14')]('id')[_0xa9f5('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x34c6cb[_0xa9f5('0x4f')]['id']}]};var _0x272c19={'$or':[_0x2eaa8c,_0x5f0986]};var _0x3a79f1=[];if(_0x34c6cb[_0xa9f5('0x43')][_0xa9f5('0x66')]&&_0x34c6cb[_0xa9f5('0x43')][_0xa9f5('0x66')]===_0xa9f5('0x67')){if(!_[_0xa9f5('0x68')](_0x34c6cb[_0xa9f5('0x43')][_0xa9f5('0x69')])){_0x272c19['id']={'$in':_0x34c6cb[_0xa9f5('0x43')][_0xa9f5('0x69')]};}_0x3a79f1=[['priority',_0xa9f5('0x6a')],[_0xa9f5('0x6b'),_0x5c661e[0x0][_0xa9f5('0x5f')]===_0xa9f5('0x6a')?'DESC':_0xa9f5('0x6a')],db[_0xa9f5('0x61')][_0xa9f5('0x6c')](_0xa9f5('0x6d')),['id','DESC']];}else{if(!_[_0xa9f5('0x68')](_0x34c6cb[_0xa9f5('0x43')]['hopperIds'])){_0x272c19['id']={'$notIn':_0x34c6cb[_0xa9f5('0x43')][_0xa9f5('0x69')]};}_0x3a79f1=[['priority','DESC'],[_0xa9f5('0x6b'),_0x5c661e[0x0][_0xa9f5('0x5f')]],db[_0xa9f5('0x61')][_0xa9f5('0x6c')](_0xa9f5('0x6e')),['id',_0xa9f5('0x6a')]];}return db[_0xa9f5('0x15')]['findOne']({'attributes':['id','scheduledat',_0xa9f5('0x6f'),'recallme'],'where':_0x272c19,'order':_0x3a79f1,'transaction':_0x5ab4c0,'lock':_0x5ab4c0[_0xa9f5('0x70')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xa9f5('0x71'),'attributes':_0x326a87,'include':[{'model':db[_0xa9f5('0x72')],'as':_0xa9f5('0x73'),'attributes':['id',_0xa9f5('0x11')]}]},{'model':db['CmList'],'as':_0xa9f5('0x74'),'attributes':['id',_0xa9f5('0x11')]},{'model':db[_0xa9f5('0x48')],'as':_0xa9f5('0x75'),'attributes':['id',_0xa9f5('0x11'),_0xa9f5('0x76')]}]})[_0xa9f5('0x39')](function(_0x25da3e){if(_0x25da3e){return _0x25da3e[_0xa9f5('0xe')]({'UserId':_0x34c6cb[_0xa9f5('0x4f')]['id']},{'transaction':_0x5ab4c0});}});});}})['then'](handleEntityNotFound(_0x28ee02,null))['then'](respondWithResult(_0x28ee02,null))[_0xa9f5('0x3c')](handleError(_0x28ee02,null));};exports[_0xa9f5('0x77')]=function(_0x53875e,_0x52cae4,_0x3c754a){var _0x18647f=[];var _0x36b1a0=_0x53875e[_0xa9f5('0x3d')]['id'];var _0x26a27a=_0x53875e[_0xa9f5('0x4f')]['id'];return db[_0xa9f5('0x56')][_0xa9f5('0x44')]()[_0xa9f5('0x39')](function(_0x56d603){_0x18647f=_['keys'](_0x56d603);return db[_0xa9f5('0x61')][_0xa9f5('0x62')](function(_0x5a8788){const _0x5e7a9b={'id':_0x36b1a0};return db[_0xa9f5('0x15')][_0xa9f5('0x78')]({'attributes':['id',_0xa9f5('0x79'),'recallme'],'where':_0x5e7a9b,'transaction':_0x5a8788,'lock':_0x5a8788[_0xa9f5('0x70')][_0xa9f5('0x7a')],'include':[{'model':db[_0xa9f5('0x56')],'as':'Contact','attributes':_0x18647f,'include':[{'model':db[_0xa9f5('0x72')],'as':_0xa9f5('0x73'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xa9f5('0x74'),'attributes':['id','name']},{'model':db[_0xa9f5('0x48')],'as':_0xa9f5('0x75'),'attributes':['id',_0xa9f5('0x11'),'dialActive']}]})[_0xa9f5('0x39')](function(_0x4b61e5){if(_0x4b61e5){return _0x4b61e5['update']({'UserId':_0x26a27a},{'transaction':_0x5a8788});}});});})[_0xa9f5('0x39')](handleEntityNotFound(_0x52cae4,null))[_0xa9f5('0x39')](respondWithResult(_0x52cae4,null))[_0xa9f5('0x3c')](handleError(_0x52cae4,null));};exports[_0xa9f5('0x7b')]=function(_0x4e874b,_0x2ba0c2){return _0x4e874b[_0xa9f5('0x4f')]['getVoiceQueues']({'where':{'type':_0xa9f5('0x5e'),'dialActive':!![],'dialMethod':_0xa9f5('0x7c')},'attributes':['id'],'raw':!![]})['then'](function(_0x5effe9){if(_0x5effe9&&_0x5effe9[_0xa9f5('0x3e')]){return db[_0xa9f5('0x15')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9f5('0x63')](_0xa9f5('0x64'))},'VoiceQueueId':{'$in':_[_0xa9f5('0x14')](_0x5effe9,'id')},'$or':[{'UserId':null},{'UserId':_0x4e874b[_0xa9f5('0x4f')]['id']}]}});}return 0x0;})[_0xa9f5('0x39')](function(_0x413ad5){if(!_[_0xa9f5('0x59')](_0x413ad5)&&_[_0xa9f5('0x7d')](_0x413ad5)){return _0x2ba0c2[_0xa9f5('0xb')](0xc8)[_0xa9f5('0x6')]({'contacts':_0x413ad5});}else{logger[_0xa9f5('0xf')](_0xa9f5('0x7e'),_0xa9f5('0x7b'),0x194,_0xa9f5('0x7f'));_0x2ba0c2[_0xa9f5('0x80')](0x194);}})['catch'](handleError(_0x2ba0c2,null));};exports[_0xa9f5('0x81')]=function(_0x32e2d5,_0x5662ce){var _0x2b44c0=shared[_0xa9f5('0x82')];var _0x314942=[];_[_0xa9f5('0x14')](_0x2b44c0,function(_0x2e5e6c){_0x314942['push']({'id':_0x2e5e6c['name'],'name':_0x2e5e6c[_0xa9f5('0x11')],'utcOffset':_0x2e5e6c['utcOffset']});});return _0x5662ce[_0xa9f5('0xb')](0xc8)[_0xa9f5('0x6')]({'tz':_0x314942});};exports['getTimezone']=function(_0xabacab,_0x4ebc6e){var _0x3afef3=shared[_0xa9f5('0x82')];var _0x37be26={};if(!_[_0xa9f5('0x59')](_0x3afef3[_0xabacab['body']['id']]))_0x37be26=_0x3afef3[_0xabacab[_0xa9f5('0x43')]['id']];return _0x4ebc6e[_0xa9f5('0xb')](0xc8)[_0xa9f5('0x6')](_0x37be26);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d58ce8f..28120a4 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x90b1,0x1bb));var _0x190b=function(_0x2fe299,_0x2e1408){_0x2fe299=_0x2fe299-0x0;var _0x3e7659=_0x90b1[_0x2fe299];return _0x3e7659;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x2d8272,_0x392785){var _0x19a25c=function(_0x10b9c1){while(--_0x10b9c1){_0x2d8272['push'](_0x2d8272['shift']());}};_0x19a25c(++_0x392785);}(_0xeff8,0x186));var _0x8eff=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xeff8[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index db92143..f815dbc 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 _0x553e=['`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','UserId','LOCK','UPDATE','GetCmHopperPreview','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopper','CmHopper','options','attributes','limit','include','map','model','debug','ShowCmHopper','find','where','create','raw','CreateCmHopper','UpdateCmHopper','update','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','Contact','keys','User','Agent','voicePause','length','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0x553e,0x10f));var _0xe553=function(_0x24550b,_0x414138){_0x24550b=_0x24550b-0x0;var _0x57296a=_0x553e[_0x24550b];return _0x57296a;};'use strict';var _=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var moment=require(_0xe553('0x2'));var BPromise=require(_0xe553('0x3'));var db=require(_0xe553('0x4'))['db'];var logger=require(_0xe553('0x5'))('rpc');var jayson=require(_0xe553('0x6'));var client=jayson[_0xe553('0x7')][_0xe553('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc16183,_0x13dce3,_0x1c2149){return new BPromise(function(_0x325813,_0x4c7741){return client[_0xe553('0x9')](_0xc16183,_0x1c2149)[_0xe553('0xa')](function(_0x2edbc5){logger[_0xe553('0xb')](_0xe553('0xc'),_0x13dce3,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x13dce3,'request\x20sent',JSON[_0xe553('0xd')](_0x2edbc5));if(_0x2edbc5[_0xe553('0xe')]){if(_0x2edbc5[_0xe553('0xe')][_0xe553('0xf')]===0x1f4){logger[_0xe553('0xe')]('CmHopper,\x20%s,\x20%s',_0x13dce3,_0x2edbc5[_0xe553('0xe')]['message']);return _0x4c7741(_0x2edbc5['error'][_0xe553('0x10')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x13dce3,_0x2edbc5['error']['message']);return _0x325813(_0x2edbc5[_0xe553('0xe')][_0xe553('0x10')]);}else{logger[_0xe553('0xb')](_0xe553('0xc'),_0x13dce3,_0xe553('0x11'));_0x325813(_0x2edbc5[_0xe553('0x12')][_0xe553('0x10')]);}})[_0xe553('0x13')](function(_0x23fbee){logger['error']('CmHopper,\x20%s,\x20%s',_0x13dce3,_0x23fbee);_0x4c7741(_0x23fbee);});});}exports[_0xe553('0x14')]=function(_0x48bff4){var _0x323f08=this;return new Promise(function(_0x464e1a,_0x2776c0){return db[_0xe553('0x15')]['findAll']({'raw':_0x48bff4[_0xe553('0x16')]?_0x48bff4[_0xe553('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x48bff4[_0xe553('0x16')]?_0x48bff4[_0xe553('0x16')]['where']||null:null,'attributes':_0x48bff4[_0xe553('0x16')]?_0x48bff4[_0xe553('0x16')][_0xe553('0x17')]||null:null,'limit':_0x48bff4['options']?_0x48bff4['options'][_0xe553('0x18')]||null:null,'include':_0x48bff4[_0xe553('0x16')]?_0x48bff4[_0xe553('0x16')][_0xe553('0x19')]?_[_0xe553('0x1a')](_0x48bff4[_0xe553('0x16')][_0xe553('0x19')],function(_0x507727){return{'model':db[_0x507727[_0xe553('0x1b')]],'as':_0x507727['as'],'attributes':_0x507727[_0xe553('0x17')],'include':_0x507727['include']?_[_0xe553('0x1a')](_0x507727[_0xe553('0x19')],function(_0xbf68a){return{'model':db[_0xbf68a[_0xe553('0x1b')]],'as':_0xbf68a['as'],'attributes':_0xbf68a[_0xe553('0x17')],'include':_0xbf68a['include']?_[_0xe553('0x1a')](_0xbf68a[_0xe553('0x19')],function(_0x5dc12f){return{'model':db[_0x5dc12f[_0xe553('0x1b')]],'as':_0x5dc12f['as'],'attributes':_0x5dc12f[_0xe553('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe553('0xa')](function(_0x33e8f0){logger[_0xe553('0xb')](_0xe553('0x14'),_0x48bff4);logger[_0xe553('0x1c')](_0xe553('0x14'),_0x48bff4,JSON[_0xe553('0xd')](_0x33e8f0));_0x464e1a(_0x33e8f0);})['catch'](function(_0x585f59){logger['error'](_0xe553('0x14'),_0x585f59['message'],_0x48bff4);_0x2776c0(_0x323f08['error'](0x1f4,_0x585f59[_0xe553('0x10')]));});});};exports[_0xe553('0x1d')]=function(_0x35c7c1){var _0x2f453a=this;return new Promise(function(_0x40f7af,_0x1aeccd){return db[_0xe553('0x15')][_0xe553('0x1e')]({'raw':_0x35c7c1['options']?_0x35c7c1['options']['raw']===undefined?!![]:![]:!![],'where':_0x35c7c1['options']?_0x35c7c1[_0xe553('0x16')][_0xe553('0x1f')]||null:null,'attributes':_0x35c7c1[_0xe553('0x16')]?_0x35c7c1[_0xe553('0x16')][_0xe553('0x17')]||null:null,'include':_0x35c7c1[_0xe553('0x16')]?_0x35c7c1['options'][_0xe553('0x19')]?_[_0xe553('0x1a')](_0x35c7c1[_0xe553('0x16')][_0xe553('0x19')],function(_0x4b435e){return{'model':db[_0x4b435e['model']],'as':_0x4b435e['as'],'attributes':_0x4b435e[_0xe553('0x17')],'include':_0x4b435e['include']?_[_0xe553('0x1a')](_0x4b435e[_0xe553('0x19')],function(_0x13bfe0){return{'model':db[_0x13bfe0[_0xe553('0x1b')]],'as':_0x13bfe0['as'],'attributes':_0x13bfe0['attributes'],'include':_0x13bfe0[_0xe553('0x19')]?_[_0xe553('0x1a')](_0x13bfe0['include'],function(_0x98b039){return{'model':db[_0x98b039['model']],'as':_0x98b039['as'],'attributes':_0x98b039['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22f668){logger[_0xe553('0xb')]('ShowCmHopper',_0x35c7c1);logger[_0xe553('0x1c')](_0xe553('0x1d'),_0x35c7c1,JSON[_0xe553('0xd')](_0x22f668));_0x40f7af(_0x22f668);})['catch'](function(_0xbab493){logger[_0xe553('0xe')](_0xe553('0x1d'),_0xbab493[_0xe553('0x10')],_0x35c7c1);_0x1aeccd(_0x2f453a[_0xe553('0xe')](0x1f4,_0xbab493[_0xe553('0x10')]));});});};exports['CreateCmHopper']=function(_0x213d27){var _0x45aad2=this;return new Promise(function(_0xc25654,_0x510bf1){return db['CmHopper'][_0xe553('0x20')](_0x213d27['body'],{'raw':_0x213d27[_0xe553('0x16')]?_0x213d27[_0xe553('0x16')][_0xe553('0x21')]===undefined?!![]:![]:!![]})[_0xe553('0xa')](function(_0x4e6e6a){logger[_0xe553('0xb')]('CreateCmHopper',_0x213d27);logger['debug'](_0xe553('0x22'),_0x213d27,JSON[_0xe553('0xd')](_0x4e6e6a));_0xc25654(_0x4e6e6a);})[_0xe553('0x13')](function(_0x4a50cb){logger[_0xe553('0xe')](_0xe553('0x22'),_0x4a50cb[_0xe553('0x10')],_0x213d27);_0x510bf1(_0x45aad2[_0xe553('0xe')](0x1f4,_0x4a50cb[_0xe553('0x10')]));});});};exports[_0xe553('0x23')]=function(_0x132338){var _0x111b68=this;return new Promise(function(_0x949189,_0x310b0c){return db[_0xe553('0x15')][_0xe553('0x24')](_0x132338[_0xe553('0x25')],{'raw':_0x132338[_0xe553('0x16')]?_0x132338[_0xe553('0x16')][_0xe553('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132338[_0xe553('0x16')]?_0x132338[_0xe553('0x16')][_0xe553('0x1f')]||null:null,'attributes':_0x132338['options']?_0x132338[_0xe553('0x16')][_0xe553('0x17')]||null:null,'limit':_0x132338['options']?_0x132338[_0xe553('0x16')][_0xe553('0x18')]||null:null})[_0xe553('0xa')](function(_0xda9897){logger['info'](_0xe553('0x23'),_0x132338);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xe553('0xd')](_0x132338[_0xe553('0x16')][_0xe553('0x1f')]),_0x132338['body'][_0xe553('0x26')]);logger[_0xe553('0x1c')](_0xe553('0x23'),_0x132338,JSON['stringify'](_0xda9897));_0x949189(_0xda9897);})[_0xe553('0x13')](function(_0x2e200f){logger[_0xe553('0xe')](_0xe553('0x23'),_0x2e200f[_0xe553('0x10')],_0x132338);_0x310b0c(_0x111b68[_0xe553('0xe')](0x1f4,_0x2e200f[_0xe553('0x10')]));});});};exports[_0xe553('0x27')]=function(_0x36cb31){var _0x2d4f0b=this;return new Promise(function(_0x370fa2,_0x4e3102){return db[_0xe553('0x15')][_0xe553('0x28')]({'where':_0x36cb31[_0xe553('0x16')]?_0x36cb31[_0xe553('0x16')][_0xe553('0x1f')]||null:null})['then'](function(_0x3df08d){logger['info'](_0xe553('0x27'),_0x36cb31);logger[_0xe553('0x1c')]('DestroyCmHopper',_0x36cb31,JSON[_0xe553('0xd')](_0x3df08d));_0x370fa2(_0x3df08d);})[_0xe553('0x13')](function(_0x40989a){logger[_0xe553('0xe')](_0xe553('0x27'),_0x40989a[_0xe553('0x10')],_0x36cb31);_0x4e3102(_0x2d4f0b[_0xe553('0xe')](0x1f4,_0x40989a[_0xe553('0x10')]));});});};exports[_0xe553('0x29')]=function(_0x1953e){var _0x45d24a=this;return new Promise(function(_0x3a8fc7,_0x2d1510){return db[_0xe553('0x2a')][_0xe553('0x2b')]()[_0xe553('0xa')](function(_0x26c27d){return db[_0xe553('0x2c')][_0xe553('0x2d')](function(_0x2e278b){return db['CmHopper'][_0xe553('0x2e')]({'where':_0x1953e[_0xe553('0x16')]?_0x1953e[_0xe553('0x16')][_0xe553('0x1f')]||null:null,'attributes':_0x1953e['options']?_0x1953e[_0xe553('0x16')][_0xe553('0x17')]||null:null,'limit':_0x1953e['options']?_0x1953e[_0xe553('0x16')][_0xe553('0x18')]||null:null,'order':_0x1953e['options']?_0x1953e[_0xe553('0x16')][_0xe553('0x2f')]||null:null,'transaction':_0x2e278b,'lock':_0x2e278b['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe553('0x30'),'attributes':_[_0xe553('0x31')](_0x26c27d)},{'model':db[_0xe553('0x32')],'as':_0xe553('0x33'),'attributes':['id','name',_0xe553('0x34')]}]})[_0xe553('0xa')](function(_0x1e86cf){var _0x5e69cf=[];var _0x4969ef=[];for(var _0x5f5a7b=0x0;_0x5f5a7b<_0x1e86cf[_0xe553('0x35')];_0x5f5a7b+=0x1){var _0x28e0b4=_0x1e86cf[_0x5f5a7b]['UserId'];if(_0x28e0b4===null){_0x5e69cf['push'](_0x1e86cf[_0x5f5a7b]['update'](_0x1953e[_0xe553('0x25')],{'transaction':_0x2e278b}));}else if(!_0x4969ef[_0xe553('0x36')](_0x28e0b4)){_0x4969ef[_0xe553('0x37')](_0x28e0b4);_0x5e69cf[_0xe553('0x37')](_0x1e86cf[_0x5f5a7b]['update'](_0x1953e[_0xe553('0x25')],{'transaction':_0x2e278b}));}}return BPromise[_0xe553('0x38')](_0x5e69cf);});})['then'](function(_0x2eb073){logger[_0xe553('0xb')](_0xe553('0x29'),_0x1953e);if(_0x2eb073[_0xe553('0x35')]>0x0){logger[_0xe553('0xb')](_0xe553('0x39'),_0x2eb073[0x0][_0xe553('0x3a')]['id'],_0x2eb073[0x0][_0xe553('0x3a')]['ContactId'],_0x2eb073[0x0][_0xe553('0x3a')][_0xe553('0x26')]);}logger[_0xe553('0x1c')]('GetContactDialer',_0x1953e,JSON[_0xe553('0xd')](_0x2eb073));_0x3a8fc7(_0x2eb073);})[_0xe553('0x13')](function(_0x48dc00){logger['error'](_0xe553('0x29'),_0x48dc00['message'],_0x1953e);_0x2d1510(_0x45d24a[_0xe553('0xe')](0x1f4,_0x48dc00['message']));});});});};exports[_0xe553('0x3b')]=function(_0x32883d){var _0x1fd83d=this;return new Promise(function(_0x53bd7e,_0x4a3451){return db[_0xe553('0x2c')]['transaction'](function(_0x35054c){return db[_0xe553('0x3c')][_0xe553('0x20')](_0x32883d['body'],{'raw':_0x32883d[_0xe553('0x16')]?_0x32883d['options'][_0xe553('0x21')]===undefined?!![]:![]:!![],'transaction':_0x35054c})[_0xe553('0xa')](function(){logger['info'](_0xe553('0x3d'),JSON['stringify'](_0x32883d[_0xe553('0x16')][_0xe553('0x1f')]),_0x32883d[_0xe553('0x16')][_0xe553('0x1f')][_0xe553('0x26')]);return db[_0xe553('0x15')]['destroy']({'where':_0x32883d['options']?_0x32883d[_0xe553('0x16')][_0xe553('0x1f')]||null:null,'transaction':_0x35054c});});})[_0xe553('0xa')](function(_0x273685){logger[_0xe553('0xb')]('MoveContactManagedDialer',_0x32883d);logger[_0xe553('0x1c')](_0xe553('0x3b'),_0x32883d,JSON[_0xe553('0xd')](_0x273685));_0x53bd7e(_0x273685);})[_0xe553('0x13')](function(_0x1143c4){logger[_0xe553('0xe')](_0xe553('0x3b'),_0x1143c4[_0xe553('0x10')],_0x32883d);_0x4a3451(_0x1fd83d[_0xe553('0xe')](0x1f4,_0x1143c4['message']));});});};exports[_0xe553('0x3e')]=function(_0x25f4b0){var _0x1f3372=this;return new Promise(function(_0x365d14,_0xf8e557){return db[_0xe553('0x15')]['findAll']({'raw':_0x25f4b0['options']?_0x25f4b0[_0xe553('0x16')][_0xe553('0x21')]===undefined?!![]:![]:!![],'where':_0x25f4b0[_0xe553('0x16')]?_0x25f4b0['options']['where']||null:null,'attributes':[[db[_0xe553('0x2c')]['fn'](_0xe553('0x3f'),db[_0xe553('0x2c')]['fn']('IF',db[_0xe553('0x2c')][_0xe553('0x40')](_0xe553('0x41')+util['format']('\x22%s\x22',moment()[_0xe553('0x42')](_0xe553('0x43')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x4e0f98){logger[_0xe553('0xb')]('CountReScheduled',_0x25f4b0);logger[_0xe553('0x1c')]('CountReScheduled',_0x25f4b0,JSON[_0xe553('0xd')](_0x4e0f98));_0x365d14(_0x4e0f98);})[_0xe553('0x13')](function(_0x3d8d40){logger[_0xe553('0xe')](_0xe553('0x3e'),_0x3d8d40['message'],_0x25f4b0);_0xf8e557(_0x1f3372[_0xe553('0xe')](0x1f4,_0x3d8d40[_0xe553('0x10')]));});});};exports[_0xe553('0x44')]=function(_0x346df9){var _0x30aaa4=this;return new Promise(function(_0x255cf3,_0x952c14){return db[_0xe553('0x2a')][_0xe553('0x2b')]()['then'](function(_0x54a14b){return db[_0xe553('0x2c')][_0xe553('0x2d')](function(_0x5f1062){return db[_0xe553('0x15')][_0xe553('0x2e')]({'where':_0x346df9[_0xe553('0x16')]?_0x346df9['options'][_0xe553('0x1f')]||null:null,'attributes':_0x346df9[_0xe553('0x16')]?_0x346df9[_0xe553('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x346df9[_0xe553('0x16')]?_0x346df9[_0xe553('0x16')][_0xe553('0x2f')]||null:null,'group':db[_0xe553('0x15')][_0xe553('0x45')],'transaction':_0x5f1062,'lock':_0x5f1062[_0xe553('0x46')][_0xe553('0x47')],'include':_0x346df9[_0xe553('0x16')]?_0x346df9[_0xe553('0x16')][_0xe553('0x19')]?_[_0xe553('0x1a')](_0x346df9[_0xe553('0x16')][_0xe553('0x19')],function(_0x581090){return{'model':db[_0x581090[_0xe553('0x1b')]],'as':_0x581090['as'],'attributes':_0x581090[_0xe553('0x17')],'include':_0x581090[_0xe553('0x19')]?_[_0xe553('0x1a')](_0x581090['include'],function(_0x11d9eb){return{'model':db[_0x11d9eb['model']],'as':_0x11d9eb['as'],'attributes':_0x11d9eb[_0xe553('0x17')],'include':_0x11d9eb[_0xe553('0x19')]?_[_0xe553('0x1a')](_0x11d9eb[_0xe553('0x19')],function(_0x5cd55e){return{'model':db[_0x5cd55e[_0xe553('0x1b')]],'as':_0x5cd55e['as'],'attributes':_0x5cd55e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe553('0xa')](function(_0x2934c8){var _0x57c8b4=[];for(var _0x499708=0x0;_0x499708<_0x2934c8[_0xe553('0x35')];_0x499708+=0x1){_0x57c8b4['push'](_0x2934c8[_0x499708]['update'](_0x346df9[_0xe553('0x25')],{'transaction':_0x5f1062}));}return BPromise[_0xe553('0x38')](_0x57c8b4);});})[_0xe553('0xa')](function(_0x2fd802){logger[_0xe553('0xb')](_0xe553('0x44'),_0x346df9);logger[_0xe553('0x1c')](_0xe553('0x44'),_0x346df9,JSON[_0xe553('0xd')](_0x2fd802));_0x255cf3(_0x2fd802);})['catch'](function(_0x2a48de){logger[_0xe553('0xe')](_0xe553('0x44'),_0x2a48de[_0xe553('0x10')],_0x346df9);_0x952c14(_0x30aaa4[_0xe553('0xe')](0x1f4,_0x2a48de[_0xe553('0x10')]));});});});};exports[_0xe553('0x48')]=function(_0x136ab8){var _0x36ec50=this;return new Promise(function(_0x31fcab,_0x476eca){db['CmContact'][_0xe553('0x2b')]()[_0xe553('0xa')](function(_0x42ee92){return db[_0xe553('0x15')][_0xe553('0x2e')]({'raw':_0x136ab8[_0xe553('0x16')]?_0x136ab8['options'][_0xe553('0x21')]===undefined?!![]:![]:!![],'where':_0x136ab8[_0xe553('0x16')]?_0x136ab8['options'][_0xe553('0x1f')]||null:null,'attributes':_0x136ab8[_0xe553('0x16')]?_0x136ab8[_0xe553('0x16')]['attributes']||null:null,'limit':_0x136ab8[_0xe553('0x16')]?_0x136ab8['options']['limit']||null:null,'include':_0x136ab8['options']?_0x136ab8['options']['include']?_['map'](_0x136ab8[_0xe553('0x16')][_0xe553('0x19')],function(_0x16d039){return{'model':db[_0x16d039['model']],'as':_0x16d039['as'],'attributes':_0x16d039['as']==='Contact'?_[_0xe553('0x31')](_0x42ee92):_0x16d039['attributes'],'include':_0x16d039[_0xe553('0x19')]?_['map'](_0x16d039['include'],function(_0x315004){return{'model':db[_0x315004[_0xe553('0x1b')]],'as':_0x315004['as'],'attributes':_0x315004[_0xe553('0x17')],'include':_0x315004[_0xe553('0x19')]?_[_0xe553('0x1a')](_0x315004[_0xe553('0x19')],function(_0xb679f1){return{'model':db[_0xb679f1['model']],'as':_0xb679f1['as'],'attributes':_0xb679f1[_0xe553('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe553('0xa')](function(_0x4ca2ac){logger[_0xe553('0xb')]('GetCmHopper',_0x136ab8);logger['debug'](_0xe553('0x14'),_0x136ab8,JSON[_0xe553('0xd')](_0x4ca2ac));_0x31fcab(_0x4ca2ac);})[_0xe553('0x13')](function(_0x4245b4){logger[_0xe553('0xe')](_0xe553('0x14'),_0x4245b4['message'],_0x136ab8);_0x476eca(_0x36ec50[_0xe553('0xe')](0x1f4,_0x4245b4['message']));});});});};exports['GetContactByPhone']=function(_0x3504f6){var _0x422cce=this;return new Promise(function(_0x1c6289,_0x4862c3){return db['CmContact'][_0xe553('0x49')]({'raw':!![],'where':{'phone':_0x3504f6[_0xe553('0x16')][_0xe553('0x1f')][_0xe553('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id',_0xe553('0x4b')]]})['then'](function(_0x119fa1){logger['info'](_0xe553('0x4c'),_0x3504f6);logger[_0xe553('0x1c')]('getContactByPhone',_0x3504f6,JSON[_0xe553('0xd')](_0x119fa1));_0x1c6289(_0x119fa1);})['catch'](function(_0x410451){logger[_0xe553('0xe')](_0xe553('0x4c'),_0x410451[_0xe553('0x10')],_0x3504f6);_0x4862c3(_0x422cce[_0xe553('0xe')](0x1f4,_0x410451['message']));});});};exports[_0xe553('0x4d')]=function(_0x9abc23){var _0x402967=this;return new Promise(function(_0x35da7f,_0x34fe37){return db[_0xe553('0x2c')][_0xe553('0x2d')](function(_0x49f6c3){return db[_0xe553('0x15')][_0xe553('0x24')]({'active':![]},{'where':{},'transaction':_0x49f6c3})[_0xe553('0xa')](function(_0x553f83){logger[_0xe553('0xb')](_0xe553('0x4d'),_0x9abc23);logger[_0xe553('0x1c')](_0xe553('0x4d'),_0x9abc23,JSON[_0xe553('0xd')](_0x553f83));_0x35da7f(_0x553f83);})[_0xe553('0x13')](function(_0x56f8d8){logger[_0xe553('0xe')]('ResetActiveCalls',_0x56f8d8[_0xe553('0x10')],_0x9abc23);_0x34fe37(_0x402967[_0xe553('0xe')](0x1f4,_0x56f8d8['message']));});});});};exports[_0xe553('0x4e')]=function(_0x305ef6){var _0x25dcaf=this;var _0x31eda5=_0x305ef6[_0xe553('0x25')][_0xe553('0x1f')]['voiceQueueIds'];var _0x54ab72=_0x305ef6['body']['where']['interval'];var _0x2e7365=_0x305ef6[_0xe553('0x25')][_0xe553('0x1f')][_0xe553('0x4f')];return new Promise(function(_0x4f0e2e,_0x192d42){return db['CmHopper'][_0xe553('0x2e')]({'where':{'voiceQueueId':{'$in':_0x31eda5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xe553('0x2c')]['literal'](_0xe553('0x50')+_0x54ab72+_0xe553('0x51')),'$gt':db[_0xe553('0x2c')][_0xe553('0x40')](_0xe553('0x52'))}},'UserId':{'$in':_0x2e7365}},'include':[{'model':db[_0xe553('0x2a')],'as':_0xe553('0x30')},{'model':db[_0xe553('0x32')],'as':'Agent','attributes':['id',_0xe553('0x53'),'voicePause']},{'model':db['CmList'],'as':'List'}]})['then'](function(_0x47117b){if(_0x47117b[_0xe553('0x35')]>0x0){return db[_0xe553('0x2c')][_0xe553('0x2d')](function(_0x221019){return db[_0xe553('0x15')]['update']({'recallmeNotifiedDate':db[_0xe553('0x2c')]['literal'](_0xe553('0x52'))},{'where':{'id':{'$in':_['map'](_0x47117b,'id')}},'transaction':_0x221019})[_0xe553('0xa')](function(){_0x4f0e2e(_0x47117b);})[_0xe553('0x13')](function(_0x39217f){logger[_0xe553('0xe')](_0xe553('0x4e'),_0x39217f[_0xe553('0x10')],_0x305ef6);_0x192d42(_0x25dcaf[_0xe553('0xe')](0x1f4,_0x39217f['message']));});})[_0xe553('0x13')](function(_0x286baa){logger[_0xe553('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x286baa['message'],_0x305ef6);_0x192d42(_0x25dcaf['error'](0x1f4,_0x286baa['message']));});}else{_0x4f0e2e(_0x47117b);}});});}; \ No newline at end of file +var _0xdacc=['find','CreateCmHopper','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper'];(function(_0x31300c,_0x2823e1){var _0x462408=function(_0x1a7388){while(--_0x1a7388){_0x31300c['push'](_0x31300c['shift']());}};_0x462408(++_0x2823e1);}(_0xdacc,0x14f));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcdac('0x0'));var moment=require(_0xcdac('0x1'));var BPromise=require(_0xcdac('0x2'));var db=require(_0xcdac('0x3'))['db'];var logger=require(_0xcdac('0x4'))(_0xcdac('0x5'));var jayson=require(_0xcdac('0x6'));var client=jayson['client'][_0xcdac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33a37a,_0xa5bc08,_0x1dcf63){return new BPromise(function(_0x323492,_0x2a10a1){return client[_0xcdac('0x8')](_0x33a37a,_0x1dcf63)[_0xcdac('0x9')](function(_0xe906b8){logger[_0xcdac('0xa')](_0xcdac('0xb'),_0xa5bc08,_0xcdac('0xc'));logger[_0xcdac('0xd')](_0xcdac('0xe'),_0xa5bc08,_0xcdac('0xc'),JSON[_0xcdac('0xf')](_0xe906b8));if(_0xe906b8['error']){if(_0xe906b8[_0xcdac('0x10')][_0xcdac('0x11')]===0x1f4){logger['error'](_0xcdac('0xb'),_0xa5bc08,_0xe906b8[_0xcdac('0x10')][_0xcdac('0x12')]);return _0x2a10a1(_0xe906b8[_0xcdac('0x10')][_0xcdac('0x12')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0xa5bc08,_0xe906b8[_0xcdac('0x10')]['message']);return _0x323492(_0xe906b8[_0xcdac('0x10')]['message']);}else{logger['info'](_0xcdac('0xb'),_0xa5bc08,_0xcdac('0xc'));_0x323492(_0xe906b8[_0xcdac('0x13')][_0xcdac('0x12')]);}})[_0xcdac('0x14')](function(_0x2882cc){logger['error'](_0xcdac('0xb'),_0xa5bc08,_0x2882cc);_0x2a10a1(_0x2882cc);});});}exports[_0xcdac('0x15')]=function(_0x542a27){var _0x1f87fc=this;return new Promise(function(_0x46a5fb,_0x3351fe){return db[_0xcdac('0x16')][_0xcdac('0x17')]({'raw':_0x542a27[_0xcdac('0x18')]?_0x542a27[_0xcdac('0x18')][_0xcdac('0x19')]===undefined?!![]:![]:!![],'where':_0x542a27['options']?_0x542a27['options'][_0xcdac('0x1a')]||null:null,'attributes':_0x542a27[_0xcdac('0x18')]?_0x542a27[_0xcdac('0x18')][_0xcdac('0x1b')]||null:null,'limit':_0x542a27[_0xcdac('0x18')]?_0x542a27[_0xcdac('0x18')][_0xcdac('0x1c')]||null:null,'include':_0x542a27[_0xcdac('0x18')]?_0x542a27[_0xcdac('0x18')][_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x542a27[_0xcdac('0x18')][_0xcdac('0x1d')],function(_0x22bbdb){return{'model':db[_0x22bbdb[_0xcdac('0x1f')]],'as':_0x22bbdb['as'],'attributes':_0x22bbdb[_0xcdac('0x1b')],'include':_0x22bbdb[_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x22bbdb[_0xcdac('0x1d')],function(_0x5bff67){return{'model':db[_0x5bff67[_0xcdac('0x1f')]],'as':_0x5bff67['as'],'attributes':_0x5bff67[_0xcdac('0x1b')],'include':_0x5bff67[_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x5bff67[_0xcdac('0x1d')],function(_0x2b43e9){return{'model':db[_0x2b43e9['model']],'as':_0x2b43e9['as'],'attributes':_0x2b43e9[_0xcdac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdac('0x9')](function(_0x51c87a){logger['info'](_0xcdac('0x15'),_0x542a27);logger[_0xcdac('0xd')](_0xcdac('0x15'),_0x542a27,JSON[_0xcdac('0xf')](_0x51c87a));_0x46a5fb(_0x51c87a);})[_0xcdac('0x14')](function(_0x262705){logger[_0xcdac('0x10')](_0xcdac('0x15'),_0x262705['message'],_0x542a27);_0x3351fe(_0x1f87fc[_0xcdac('0x10')](0x1f4,_0x262705['message']));});});};exports[_0xcdac('0x20')]=function(_0x1622ec){var _0x570b29=this;return new Promise(function(_0xd56848,_0x50c585){return db[_0xcdac('0x16')][_0xcdac('0x21')]({'raw':_0x1622ec[_0xcdac('0x18')]?_0x1622ec[_0xcdac('0x18')][_0xcdac('0x19')]===undefined?!![]:![]:!![],'where':_0x1622ec[_0xcdac('0x18')]?_0x1622ec['options'][_0xcdac('0x1a')]||null:null,'attributes':_0x1622ec[_0xcdac('0x18')]?_0x1622ec[_0xcdac('0x18')]['attributes']||null:null,'include':_0x1622ec[_0xcdac('0x18')]?_0x1622ec[_0xcdac('0x18')][_0xcdac('0x1d')]?_['map'](_0x1622ec[_0xcdac('0x18')][_0xcdac('0x1d')],function(_0x1c95f8){return{'model':db[_0x1c95f8[_0xcdac('0x1f')]],'as':_0x1c95f8['as'],'attributes':_0x1c95f8['attributes'],'include':_0x1c95f8['include']?_[_0xcdac('0x1e')](_0x1c95f8[_0xcdac('0x1d')],function(_0x2d1dd6){return{'model':db[_0x2d1dd6['model']],'as':_0x2d1dd6['as'],'attributes':_0x2d1dd6[_0xcdac('0x1b')],'include':_0x2d1dd6[_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x2d1dd6[_0xcdac('0x1d')],function(_0x323051){return{'model':db[_0x323051[_0xcdac('0x1f')]],'as':_0x323051['as'],'attributes':_0x323051[_0xcdac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdac('0x9')](function(_0xd6ebdf){logger[_0xcdac('0xa')](_0xcdac('0x20'),_0x1622ec);logger[_0xcdac('0xd')](_0xcdac('0x20'),_0x1622ec,JSON['stringify'](_0xd6ebdf));_0xd56848(_0xd6ebdf);})[_0xcdac('0x14')](function(_0x1662f2){logger[_0xcdac('0x10')](_0xcdac('0x20'),_0x1662f2['message'],_0x1622ec);_0x50c585(_0x570b29[_0xcdac('0x10')](0x1f4,_0x1662f2[_0xcdac('0x12')]));});});};exports[_0xcdac('0x22')]=function(_0x7f9092){var _0x26f62a=this;return new Promise(function(_0x48cc15,_0x66145b){return db[_0xcdac('0x16')]['create'](_0x7f9092[_0xcdac('0x23')],{'raw':_0x7f9092['options']?_0x7f9092[_0xcdac('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xcdac('0x9')](function(_0x28e9bc){logger[_0xcdac('0xa')](_0xcdac('0x22'),_0x7f9092);logger[_0xcdac('0xd')]('CreateCmHopper',_0x7f9092,JSON[_0xcdac('0xf')](_0x28e9bc));_0x48cc15(_0x28e9bc);})[_0xcdac('0x14')](function(_0x77b51e){logger[_0xcdac('0x10')](_0xcdac('0x22'),_0x77b51e[_0xcdac('0x12')],_0x7f9092);_0x66145b(_0x26f62a[_0xcdac('0x10')](0x1f4,_0x77b51e['message']));});});};exports[_0xcdac('0x24')]=function(_0x33d40d){var _0x3868ee=this;return new Promise(function(_0x26448d,_0x37a8d2){return db['CmHopper'][_0xcdac('0x25')](_0x33d40d[_0xcdac('0x23')],{'raw':_0x33d40d[_0xcdac('0x18')]?_0x33d40d['options'][_0xcdac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d40d[_0xcdac('0x18')]?_0x33d40d['options'][_0xcdac('0x1a')]||null:null,'attributes':_0x33d40d[_0xcdac('0x18')]?_0x33d40d['options'][_0xcdac('0x1b')]||null:null,'limit':_0x33d40d[_0xcdac('0x18')]?_0x33d40d[_0xcdac('0x18')][_0xcdac('0x1c')]||null:null})[_0xcdac('0x9')](function(_0x48769b){logger[_0xcdac('0xa')](_0xcdac('0x24'),_0x33d40d);logger[_0xcdac('0xa')](_0xcdac('0x26'),JSON[_0xcdac('0xf')](_0x33d40d[_0xcdac('0x18')][_0xcdac('0x1a')]),_0x33d40d[_0xcdac('0x23')][_0xcdac('0x27')]);logger['debug'](_0xcdac('0x24'),_0x33d40d,JSON[_0xcdac('0xf')](_0x48769b));_0x26448d(_0x48769b);})['catch'](function(_0x390743){logger[_0xcdac('0x10')](_0xcdac('0x24'),_0x390743[_0xcdac('0x12')],_0x33d40d);_0x37a8d2(_0x3868ee[_0xcdac('0x10')](0x1f4,_0x390743[_0xcdac('0x12')]));});});};exports[_0xcdac('0x28')]=function(_0x23afd8){var _0x51427c=this;return new Promise(function(_0x5e44ce,_0x267168){return db['CmHopper'][_0xcdac('0x29')]({'where':_0x23afd8[_0xcdac('0x18')]?_0x23afd8[_0xcdac('0x18')][_0xcdac('0x1a')]||null:null})[_0xcdac('0x9')](function(_0x24a96a){logger[_0xcdac('0xa')](_0xcdac('0x28'),_0x23afd8);logger['debug']('DestroyCmHopper',_0x23afd8,JSON[_0xcdac('0xf')](_0x24a96a));_0x5e44ce(_0x24a96a);})[_0xcdac('0x14')](function(_0x4dca75){logger[_0xcdac('0x10')]('DestroyCmHopper',_0x4dca75[_0xcdac('0x12')],_0x23afd8);_0x267168(_0x51427c[_0xcdac('0x10')](0x1f4,_0x4dca75[_0xcdac('0x12')]));});});};exports[_0xcdac('0x2a')]=function(_0x2fb820){var _0x159936=this;return new Promise(function(_0x3d8660,_0x152296){return db[_0xcdac('0x2b')][_0xcdac('0x2c')]()[_0xcdac('0x9')](function(_0x2cfdd3){return db[_0xcdac('0x2d')][_0xcdac('0x2e')](function(_0x520d32){return db['CmHopper']['findAll']({'where':_0x2fb820[_0xcdac('0x18')]?_0x2fb820[_0xcdac('0x18')][_0xcdac('0x1a')]||null:null,'attributes':_0x2fb820[_0xcdac('0x18')]?_0x2fb820['options'][_0xcdac('0x1b')]||null:null,'limit':_0x2fb820[_0xcdac('0x18')]?_0x2fb820[_0xcdac('0x18')]['limit']||null:null,'order':_0x2fb820[_0xcdac('0x18')]?_0x2fb820[_0xcdac('0x18')][_0xcdac('0x2f')]||null:null,'transaction':_0x520d32,'lock':_0x520d32[_0xcdac('0x30')][_0xcdac('0x31')],'include':[{'model':db[_0xcdac('0x2b')],'as':_0xcdac('0x32'),'attributes':_[_0xcdac('0x33')](_0x2cfdd3)},{'model':db[_0xcdac('0x34')],'as':_0xcdac('0x35'),'attributes':['id',_0xcdac('0x36'),'voicePause']}]})[_0xcdac('0x9')](function(_0x3688cf){var _0x4cede0=[];var _0x19843f=[];for(var _0x5b57b9=0x0;_0x5b57b9<_0x3688cf[_0xcdac('0x37')];_0x5b57b9+=0x1){var _0x33c3aa=_0x3688cf[_0x5b57b9][_0xcdac('0x38')];if(_0x33c3aa===null){_0x4cede0[_0xcdac('0x39')](_0x3688cf[_0x5b57b9]['update'](_0x2fb820[_0xcdac('0x23')],{'transaction':_0x520d32}));}else if(!_0x19843f[_0xcdac('0x3a')](_0x33c3aa)){_0x19843f['push'](_0x33c3aa);_0x4cede0[_0xcdac('0x39')](_0x3688cf[_0x5b57b9][_0xcdac('0x25')](_0x2fb820[_0xcdac('0x23')],{'transaction':_0x520d32}));}}return BPromise['all'](_0x4cede0);});})['then'](function(_0x104ea8){logger[_0xcdac('0xa')]('GetContactDialer',_0x2fb820);if(_0x104ea8[_0xcdac('0x37')]>0x0){logger[_0xcdac('0xa')](_0xcdac('0x3b'),_0x104ea8[0x0][_0xcdac('0x3c')]['id'],_0x104ea8[0x0][_0xcdac('0x3c')]['ContactId'],_0x104ea8[0x0][_0xcdac('0x3c')][_0xcdac('0x27')]);}logger[_0xcdac('0xd')]('GetContactDialer',_0x2fb820,JSON[_0xcdac('0xf')](_0x104ea8));_0x3d8660(_0x104ea8);})[_0xcdac('0x14')](function(_0x70f5ad){logger[_0xcdac('0x10')](_0xcdac('0x2a'),_0x70f5ad[_0xcdac('0x12')],_0x2fb820);_0x152296(_0x159936[_0xcdac('0x10')](0x1f4,_0x70f5ad[_0xcdac('0x12')]));});});});};exports[_0xcdac('0x3d')]=function(_0x59deb6){var _0x53d747=this;return new Promise(function(_0x432500,_0x302acb){return db['sequelize'][_0xcdac('0x2e')](function(_0x47b0bf){return db[_0xcdac('0x3e')][_0xcdac('0x3f')](_0x59deb6[_0xcdac('0x23')],{'raw':_0x59deb6[_0xcdac('0x18')]?_0x59deb6[_0xcdac('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x47b0bf})[_0xcdac('0x9')](function(){logger[_0xcdac('0xa')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xcdac('0xf')](_0x59deb6[_0xcdac('0x18')][_0xcdac('0x1a')]),_0x59deb6['options']['where'][_0xcdac('0x27')]);return db[_0xcdac('0x16')][_0xcdac('0x29')]({'where':_0x59deb6[_0xcdac('0x18')]?_0x59deb6[_0xcdac('0x18')]['where']||null:null,'transaction':_0x47b0bf});});})[_0xcdac('0x9')](function(_0x4903b2){logger[_0xcdac('0xa')](_0xcdac('0x3d'),_0x59deb6);logger['debug']('MoveContactManagedDialer',_0x59deb6,JSON[_0xcdac('0xf')](_0x4903b2));_0x432500(_0x4903b2);})['catch'](function(_0x508e50){logger[_0xcdac('0x10')](_0xcdac('0x3d'),_0x508e50[_0xcdac('0x12')],_0x59deb6);_0x302acb(_0x53d747[_0xcdac('0x10')](0x1f4,_0x508e50['message']));});});};exports[_0xcdac('0x40')]=function(_0x5d59a7){var _0x3f6029=this;return new Promise(function(_0x390649,_0xa4d8f0){return db[_0xcdac('0x16')][_0xcdac('0x17')]({'raw':_0x5d59a7[_0xcdac('0x18')]?_0x5d59a7[_0xcdac('0x18')][_0xcdac('0x19')]===undefined?!![]:![]:!![],'where':_0x5d59a7[_0xcdac('0x18')]?_0x5d59a7[_0xcdac('0x18')]['where']||null:null,'attributes':[[db[_0xcdac('0x2d')]['fn'](_0xcdac('0x41'),db[_0xcdac('0x2d')]['fn']('IF',db[_0xcdac('0x2d')][_0xcdac('0x42')](_0xcdac('0x43')+util[_0xcdac('0x44')]('\x22%s\x22',moment()[_0xcdac('0x44')](_0xcdac('0x45')))+_0xcdac('0x46')))),_0xcdac('0x47')]]})[_0xcdac('0x9')](function(_0x1a27a2){logger['info'](_0xcdac('0x40'),_0x5d59a7);logger[_0xcdac('0xd')](_0xcdac('0x40'),_0x5d59a7,JSON[_0xcdac('0xf')](_0x1a27a2));_0x390649(_0x1a27a2);})[_0xcdac('0x14')](function(_0x3a5335){logger['error'](_0xcdac('0x40'),_0x3a5335[_0xcdac('0x12')],_0x5d59a7);_0xa4d8f0(_0x3f6029[_0xcdac('0x10')](0x1f4,_0x3a5335[_0xcdac('0x12')]));});});};exports[_0xcdac('0x48')]=function(_0x2fce0f){var _0xfd9893=this;return new Promise(function(_0x35ef83,_0x2249e2){return db[_0xcdac('0x2b')]['describe']()[_0xcdac('0x9')](function(_0x44e008){return db[_0xcdac('0x2d')]['transaction'](function(_0x5c7de3){return db[_0xcdac('0x16')][_0xcdac('0x17')]({'where':_0x2fce0f[_0xcdac('0x18')]?_0x2fce0f[_0xcdac('0x18')]['where']||null:null,'attributes':_0x2fce0f[_0xcdac('0x18')]?_0x2fce0f['options']['attributes']||null:null,'limit':0x1,'order':_0x2fce0f[_0xcdac('0x18')]?_0x2fce0f['options']['order']||null:null,'group':db[_0xcdac('0x16')][_0xcdac('0x38')],'transaction':_0x5c7de3,'lock':_0x5c7de3[_0xcdac('0x30')]['UPDATE'],'include':_0x2fce0f[_0xcdac('0x18')]?_0x2fce0f['options'][_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x2fce0f[_0xcdac('0x18')][_0xcdac('0x1d')],function(_0x1738e7){return{'model':db[_0x1738e7[_0xcdac('0x1f')]],'as':_0x1738e7['as'],'attributes':_0x1738e7[_0xcdac('0x1b')],'include':_0x1738e7[_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x1738e7[_0xcdac('0x1d')],function(_0x4b8a3b){return{'model':db[_0x4b8a3b[_0xcdac('0x1f')]],'as':_0x4b8a3b['as'],'attributes':_0x4b8a3b[_0xcdac('0x1b')],'include':_0x4b8a3b[_0xcdac('0x1d')]?_['map'](_0x4b8a3b[_0xcdac('0x1d')],function(_0x4710f3){return{'model':db[_0x4710f3['model']],'as':_0x4710f3['as'],'attributes':_0x4710f3[_0xcdac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdac('0x9')](function(_0xd3f3a9){var _0x10eae9=[];for(var _0x581378=0x0;_0x581378<_0xd3f3a9[_0xcdac('0x37')];_0x581378+=0x1){_0x10eae9['push'](_0xd3f3a9[_0x581378][_0xcdac('0x25')](_0x2fce0f[_0xcdac('0x23')],{'transaction':_0x5c7de3}));}return BPromise[_0xcdac('0x49')](_0x10eae9);});})[_0xcdac('0x9')](function(_0x4d5fda){logger[_0xcdac('0xa')](_0xcdac('0x48'),_0x2fce0f);logger[_0xcdac('0xd')](_0xcdac('0x48'),_0x2fce0f,JSON[_0xcdac('0xf')](_0x4d5fda));_0x35ef83(_0x4d5fda);})[_0xcdac('0x14')](function(_0x16c803){logger[_0xcdac('0x10')](_0xcdac('0x48'),_0x16c803[_0xcdac('0x12')],_0x2fce0f);_0x2249e2(_0xfd9893['error'](0x1f4,_0x16c803['message']));});});});};exports[_0xcdac('0x4a')]=function(_0x581841){var _0xfc8be3=this;return new Promise(function(_0x20281e,_0x1c1f8d){db[_0xcdac('0x2b')][_0xcdac('0x2c')]()['then'](function(_0x8e5b7f){return db['CmHopper'][_0xcdac('0x17')]({'raw':_0x581841['options']?_0x581841[_0xcdac('0x18')][_0xcdac('0x19')]===undefined?!![]:![]:!![],'where':_0x581841[_0xcdac('0x18')]?_0x581841['options'][_0xcdac('0x1a')]||null:null,'attributes':_0x581841[_0xcdac('0x18')]?_0x581841[_0xcdac('0x18')]['attributes']||null:null,'limit':_0x581841[_0xcdac('0x18')]?_0x581841[_0xcdac('0x18')]['limit']||null:null,'include':_0x581841[_0xcdac('0x18')]?_0x581841[_0xcdac('0x18')]['include']?_[_0xcdac('0x1e')](_0x581841[_0xcdac('0x18')]['include'],function(_0x17fb21){return{'model':db[_0x17fb21[_0xcdac('0x1f')]],'as':_0x17fb21['as'],'attributes':_0x17fb21['as']===_0xcdac('0x32')?_[_0xcdac('0x33')](_0x8e5b7f):_0x17fb21[_0xcdac('0x1b')],'include':_0x17fb21[_0xcdac('0x1d')]?_[_0xcdac('0x1e')](_0x17fb21['include'],function(_0x37559b){return{'model':db[_0x37559b[_0xcdac('0x1f')]],'as':_0x37559b['as'],'attributes':_0x37559b['attributes'],'include':_0x37559b[_0xcdac('0x1d')]?_['map'](_0x37559b['include'],function(_0xb35ad){return{'model':db[_0xb35ad[_0xcdac('0x1f')]],'as':_0xb35ad['as'],'attributes':_0xb35ad[_0xcdac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdac('0x9')](function(_0x51276f){logger[_0xcdac('0xa')]('GetCmHopper',_0x581841);logger['debug'](_0xcdac('0x15'),_0x581841,JSON[_0xcdac('0xf')](_0x51276f));_0x20281e(_0x51276f);})[_0xcdac('0x14')](function(_0x29492a){logger[_0xcdac('0x10')]('GetCmHopper',_0x29492a[_0xcdac('0x12')],_0x581841);_0x1c1f8d(_0xfc8be3['error'](0x1f4,_0x29492a[_0xcdac('0x12')]));});});});};exports[_0xcdac('0x4b')]=function(_0x921f84){var _0x4bfa9e=this;return new Promise(function(_0x59e99f,_0x4596a0){return db[_0xcdac('0x2b')][_0xcdac('0x4c')]({'raw':!![],'where':{'phone':_0x921f84[_0xcdac('0x18')]['where'][_0xcdac('0x4d')]},'attributes':['id',_0xcdac('0x4e')],'order':[['id',_0xcdac('0x4f')]]})['then'](function(_0x172648){logger[_0xcdac('0xa')](_0xcdac('0x50'),_0x921f84);logger[_0xcdac('0xd')](_0xcdac('0x50'),_0x921f84,JSON['stringify'](_0x172648));_0x59e99f(_0x172648);})[_0xcdac('0x14')](function(_0x421659){logger[_0xcdac('0x10')](_0xcdac('0x50'),_0x421659[_0xcdac('0x12')],_0x921f84);_0x4596a0(_0x4bfa9e[_0xcdac('0x10')](0x1f4,_0x421659[_0xcdac('0x12')]));});});};exports['ResetActiveCalls']=function(_0x22ea6a){var _0x38c66d=this;return new Promise(function(_0x4262c7,_0x206ff9){return db['sequelize'][_0xcdac('0x2e')](function(_0x285e56){return db[_0xcdac('0x16')]['update']({'active':![]},{'where':{},'transaction':_0x285e56})[_0xcdac('0x9')](function(_0x5bcd48){logger[_0xcdac('0xa')](_0xcdac('0x51'),_0x22ea6a);logger[_0xcdac('0xd')](_0xcdac('0x51'),_0x22ea6a,JSON['stringify'](_0x5bcd48));_0x4262c7(_0x5bcd48);})[_0xcdac('0x14')](function(_0x3c65df){logger[_0xcdac('0x10')]('ResetActiveCalls',_0x3c65df[_0xcdac('0x12')],_0x22ea6a);_0x206ff9(_0x38c66d[_0xcdac('0x10')](0x1f4,_0x3c65df[_0xcdac('0x12')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x37f6ee){var _0x4abe51=this;var _0x1e8253=_0x37f6ee['body'][_0xcdac('0x1a')][_0xcdac('0x52')];var _0x60b8b8=_0x37f6ee[_0xcdac('0x23')][_0xcdac('0x1a')][_0xcdac('0x53')];var _0x558176=_0x37f6ee[_0xcdac('0x23')][_0xcdac('0x1a')][_0xcdac('0x54')];return new Promise(function(_0x58081e,_0xceb2c4){return db[_0xcdac('0x16')][_0xcdac('0x17')]({'where':{'voiceQueueId':{'$in':_0x1e8253},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xcdac('0x2d')][_0xcdac('0x42')](_0xcdac('0x55')+_0x60b8b8+_0xcdac('0x56')),'$gt':db[_0xcdac('0x2d')]['literal'](_0xcdac('0x57'))}},'UserId':{'$in':_0x558176}},'include':[{'model':db[_0xcdac('0x2b')],'as':'Contact'},{'model':db['User'],'as':'Agent','attributes':['id',_0xcdac('0x36'),_0xcdac('0x58')]},{'model':db[_0xcdac('0x59')],'as':_0xcdac('0x5a')}]})[_0xcdac('0x9')](function(_0x1c9ab3){if(_0x1c9ab3[_0xcdac('0x37')]>0x0){return db['sequelize'][_0xcdac('0x2e')](function(_0x2e7158){return db[_0xcdac('0x16')][_0xcdac('0x25')]({'recallmeNotifiedDate':db[_0xcdac('0x2d')][_0xcdac('0x42')](_0xcdac('0x57'))},{'where':{'id':{'$in':_[_0xcdac('0x1e')](_0x1c9ab3,'id')}},'transaction':_0x2e7158})[_0xcdac('0x9')](function(){_0x58081e(_0x1c9ab3);})[_0xcdac('0x14')](function(_0xe2a8e4){logger['error'](_0xcdac('0x5b'),_0xe2a8e4['message'],_0x37f6ee);_0xceb2c4(_0x4abe51[_0xcdac('0x10')](0x1f4,_0xe2a8e4[_0xcdac('0x12')]));});})['catch'](function(_0x14792e){logger[_0xcdac('0x10')](_0xcdac('0x5b'),_0x14792e[_0xcdac('0x12')],_0x37f6ee);_0xceb2c4(_0x4abe51['error'](0x1f4,_0x14792e[_0xcdac('0x12')]));});}else{_0x58081e(_0x1c9ab3);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2cfe584..55e9c22 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 _0x8df8=['/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','post','/preview','getPreview','getTimezone','update','delete','destroy','exports','Router','isAuthenticated','index','get','/describe'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8df8,0x67));var _0x88df=function(_0x2ea356,_0x4c373b){_0x2ea356=_0x2ea356-0x0;var _0x1439d5=_0x8df8[_0x2ea356];return _0x1439d5;};'use strict';var express=require('express');var router=express[_0x88df('0x0')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router['get']('/',auth[_0x88df('0x1')](),controller[_0x88df('0x2')]);router[_0x88df('0x3')](_0x88df('0x4'),auth[_0x88df('0x1')](),controller['describe']);router[_0x88df('0x3')](_0x88df('0x5'),auth[_0x88df('0x1')](),controller[_0x88df('0x6')]);router['get'](_0x88df('0x7'),auth[_0x88df('0x1')](),controller[_0x88df('0x8')]);router[_0x88df('0x3')](_0x88df('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/previewrecall',auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0x88df('0xa')]('/',auth[_0x88df('0x1')](),controller['create']);router['post'](_0x88df('0xb'),auth[_0x88df('0x1')](),controller[_0x88df('0xc')]);router[_0x88df('0xa')]('/timezone',auth[_0x88df('0x1')](),controller[_0x88df('0xd')]);router['put'](_0x88df('0x9'),auth[_0x88df('0x1')](),controller[_0x88df('0xe')]);router[_0x88df('0xf')](_0x88df('0x9'),auth[_0x88df('0x1')](),controller[_0x88df('0x10')]);module[_0x88df('0x11')]=router; \ No newline at end of file +var _0x9a55=['/timezones','isAuthenticated','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','getTimezone','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','get','index','describe','/opencontacts'];(function(_0x4e4fba,_0x2938e7){var _0x58fbf9=function(_0x4ac285){while(--_0x4ac285){_0x4e4fba['push'](_0x4e4fba['shift']());}};_0x58fbf9(++_0x2938e7);}(_0x9a55,0x8b));var _0x59a5=function(_0x8a57e0,_0x155642){_0x8a57e0=_0x8a57e0-0x0;var _0x45476a=_0x9a55[_0x8a57e0];return _0x45476a;};'use strict';var express=require(_0x59a5('0x0'));var router=express[_0x59a5('0x1')]();var auth=require(_0x59a5('0x2'));var controller=require(_0x59a5('0x3'));router[_0x59a5('0x4')]('/',auth['isAuthenticated'](),controller[_0x59a5('0x5')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x59a5('0x6')]);router[_0x59a5('0x4')](_0x59a5('0x7'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x59a5('0x4')](_0x59a5('0x8'),auth[_0x59a5('0x9')](),controller[_0x59a5('0xa')]);router[_0x59a5('0x4')](_0x59a5('0xb'),auth[_0x59a5('0x9')](),controller[_0x59a5('0xc')]);router[_0x59a5('0x4')](_0x59a5('0xd'),auth[_0x59a5('0x9')](),controller[_0x59a5('0xe')]);router[_0x59a5('0xf')]('/',auth[_0x59a5('0x9')](),controller[_0x59a5('0x10')]);router[_0x59a5('0xf')]('/preview',auth['isAuthenticated'](),controller[_0x59a5('0x11')]);router[_0x59a5('0xf')]('/timezone',auth['isAuthenticated'](),controller[_0x59a5('0x12')]);router['put'](_0x59a5('0xb'),auth[_0x59a5('0x9')](),controller['update']);router[_0x59a5('0x13')](_0x59a5('0xb'),auth[_0x59a5('0x9')](),controller[_0x59a5('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 854fb93..3623a47 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1d8=['sequelize','exports','INTEGER','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47b3a2,_0x2bbb40){var _0xb35a80=function(_0x24f914){while(--_0x24f914){_0x47b3a2['push'](_0x47b3a2['shift']());}};_0xb35a80(++_0x2bbb40);}(_0xf1d8,0x17a));var _0x8f1d=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xf1d8[_0xc77819];return _0x1c9434;};'use strict';var moment=require('moment');var Sequelize=require(_0x8f1d('0x0'));module[_0x8f1d('0x1')]={'CmHopperId':{'type':Sequelize[_0x8f1d('0x2')]},'phone':{'type':Sequelize[_0x8f1d('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8f1d('0x4')],'defaultValue':moment()['format'](_0x8f1d('0x5'))},'countbusyretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8f1d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6c0e=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','DATE','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c0e,0x119));var _0xe6c0=function(_0x52820a,_0x2c9e87){_0x52820a=_0x52820a-0x0;var _0x65401e=_0x6c0e[_0x52820a];return _0x65401e;};'use strict';var moment=require(_0xe6c0('0x0'));var Sequelize=require(_0xe6c0('0x1'));module[_0xe6c0('0x2')]={'CmHopperId':{'type':Sequelize[_0xe6c0('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xe6c0('0x4')],'defaultValue':moment()[_0xe6c0('0x5')](_0xe6c0('0x6'))},'countbusyretry':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe6c0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index da95752..183ee66 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ded=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x1ded,0xf7));var _0xd1de=function(_0x3f44c4,_0x16d23a){_0x3f44c4=_0x3f44c4-0x0;var _0xd4c102=_0x1ded[_0x3f44c4];return _0xd4c102;};'use strict';var emlformat=require(_0xd1de('0x0'));var rimraf=require(_0xd1de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1de('0x2'));var rp=require(_0xd1de('0x3'));var moment=require(_0xd1de('0x4'));var BPromise=require(_0xd1de('0x5'));var Mustache=require(_0xd1de('0x6'));var util=require('util');var path=require(_0xd1de('0x7'));var sox=require(_0xd1de('0x8'));var csv=require(_0xd1de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1de('0xa'));var _=require(_0xd1de('0xb'));var squel=require(_0xd1de('0xc'));var crypto=require('crypto');var jsforce=require(_0xd1de('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd1de('0x9'));var querystring=require(_0xd1de('0xe'));var Papa=require(_0xd1de('0xf'));var Redis=require(_0xd1de('0x10'));var authService=require(_0xd1de('0x11'));var qs=require(_0xd1de('0x12'));var as=require(_0xd1de('0x13'));var hardwareService=require(_0xd1de('0x14'));var logger=require(_0xd1de('0x15'))(_0xd1de('0x16'));var utils=require('../../config/utils');var config=require(_0xd1de('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1de('0x18'))['db'];function respondWithStatusCode(_0x345b21,_0x557387){_0x557387=_0x557387||0xcc;return function(_0x2a4078){if(_0x2a4078){return _0x345b21[_0xd1de('0x19')](_0x557387);}return _0x345b21['status'](_0x557387)[_0xd1de('0x1a')]();};}function respondWithResult(_0x1e008e,_0x5ea0c5){_0x5ea0c5=_0x5ea0c5||0xc8;return function(_0x52e78d){if(_0x52e78d){return _0x1e008e['status'](_0x5ea0c5)[_0xd1de('0x1b')](_0x52e78d);}};}function respondWithFilteredResult(_0x3bcf7e,_0x493e72){return function(_0x40636c){if(_0x40636c){var _0x2dd4ab=typeof _0x493e72[_0xd1de('0x1c')]==='undefined'&&typeof _0x493e72['limit']===_0xd1de('0x1d');var _0x2e684d=_0x40636c['count'];var _0x5714c1=_0x2dd4ab?0x0:_0x493e72[_0xd1de('0x1c')];var _0x4ccb6d=_0x2dd4ab?_0x40636c[_0xd1de('0x1e')]:_0x493e72[_0xd1de('0x1c')]+_0x493e72[_0xd1de('0x1f')];var _0x196a81;if(_0x4ccb6d>=_0x2e684d){_0x4ccb6d=_0x2e684d;_0x196a81=0xc8;}else{_0x196a81=0xce;}_0x3bcf7e[_0xd1de('0x20')](_0x196a81);return _0x3bcf7e[_0xd1de('0x21')](_0xd1de('0x22'),_0x5714c1+'-'+_0x4ccb6d+'/'+_0x2e684d)[_0xd1de('0x1b')](_0x40636c);}return null;};}function patchUpdates(_0x49dfdc){return function(_0x1eb86e){try{jsonpatch[_0xd1de('0x23')](_0x1eb86e,_0x49dfdc,!![]);}catch(_0x2e5a4e){return BPromise[_0xd1de('0x24')](_0x2e5a4e);}return _0x1eb86e[_0xd1de('0x25')]();};}function saveUpdates(_0x40309c,_0x56560b){return function(_0x48bf8d){if(_0x48bf8d){return _0x48bf8d[_0xd1de('0x26')](_0x40309c)[_0xd1de('0x27')](function(_0x16f3a5){return _0x16f3a5;});}return null;};}function removeEntity(_0x2ec50f,_0x1ffc78){return function(_0x2e94a7){if(_0x2e94a7){return _0x2e94a7[_0xd1de('0x28')]()[_0xd1de('0x27')](function(){var _0x1f844c=_0x2e94a7[_0xd1de('0x29')]({'plain':!![]});var _0x57adba=_0xd1de('0x2a');return db[_0xd1de('0x2b')][_0xd1de('0x28')]({'where':{'type':_0x57adba,'resourceId':_0x1f844c['id']}})[_0xd1de('0x27')](function(){return _0x2e94a7;});})[_0xd1de('0x27')](function(){_0x2ec50f[_0xd1de('0x20')](0xcc)[_0xd1de('0x1a')]();});}};}function handleEntityNotFound(_0x5c0c42,_0x1e56ba){return function(_0x8c0ce1){if(!_0x8c0ce1){_0x5c0c42['sendStatus'](0x194);}return _0x8c0ce1;};}function handleError(_0x487487,_0x48f5df){_0x48f5df=_0x48f5df||0x1f4;return function(_0x54cfdd){logger[_0xd1de('0x2c')](_0x54cfdd[_0xd1de('0x2d')]);if(_0x54cfdd[_0xd1de('0x2e')]){delete _0x54cfdd[_0xd1de('0x2e')];}_0x487487[_0xd1de('0x20')](_0x48f5df)[_0xd1de('0x2f')](_0x54cfdd);};}exports[_0xd1de('0x30')]=function(_0x444eda,_0x5045a9){var _0x4e1047={},_0x84d426={},_0x353f85={'count':0x0,'rows':[]};var _0x50a1be=_[_0xd1de('0x31')](db[_0xd1de('0x32')][_0xd1de('0x33')],function(_0x3cb3b2){return{'name':_0x3cb3b2[_0xd1de('0x34')],'type':_0x3cb3b2[_0xd1de('0x35')][_0xd1de('0x36')]};});_0x84d426[_0xd1de('0x37')]=_[_0xd1de('0x31')](_0x50a1be,_0xd1de('0x2e'));_0x84d426[_0xd1de('0x38')]=_[_0xd1de('0x39')](_0x444eda[_0xd1de('0x38')]);_0x84d426[_0xd1de('0x3a')]=_[_0xd1de('0x3b')](_0x84d426['model'],_0x84d426[_0xd1de('0x38')]);_0x4e1047[_0xd1de('0x3c')]=_['intersection'](_0x84d426[_0xd1de('0x37')],qs['fields'](_0x444eda['query'][_0xd1de('0x3d')]));_0x4e1047['attributes']=_0x4e1047[_0xd1de('0x3c')][_0xd1de('0x3e')]?_0x4e1047[_0xd1de('0x3c')]:_0x84d426['model'];if(!_0x444eda[_0xd1de('0x38')][_0xd1de('0x3f')](_0xd1de('0x40'))){_0x4e1047['limit']=qs[_0xd1de('0x1f')](_0x444eda[_0xd1de('0x38')][_0xd1de('0x1f')]);_0x4e1047[_0xd1de('0x1c')]=qs[_0xd1de('0x1c')](_0x444eda['query'][_0xd1de('0x1c')]);}_0x4e1047[_0xd1de('0x41')]=qs['sort'](_0x444eda[_0xd1de('0x38')][_0xd1de('0x42')]);_0x4e1047[_0xd1de('0x43')]=qs['filters'](_[_0xd1de('0x44')](_0x444eda[_0xd1de('0x38')],_0x84d426[_0xd1de('0x3a')]),_0x50a1be);if(_0x444eda[_0xd1de('0x38')][_0xd1de('0x45')]){_0x4e1047[_0xd1de('0x43')]=_[_0xd1de('0x46')](_0x4e1047[_0xd1de('0x43')],{'$or':_[_0xd1de('0x31')](_0x50a1be,function(_0x380223){if(_0x380223[_0xd1de('0x35')]!==_0xd1de('0x47')){var _0x34b560={};_0x34b560[_0x380223[_0xd1de('0x2e')]]={'$like':'%'+_0x444eda['query'][_0xd1de('0x45')]+'%'};return _0x34b560;}})});}_0x4e1047=_[_0xd1de('0x46')]({},_0x4e1047,_0x444eda['options']);var _0x167ad7={'where':_0x4e1047[_0xd1de('0x43')]};return db['CmHopperAdditionalPhone'][_0xd1de('0x1e')](_0x167ad7)[_0xd1de('0x27')](function(_0x335ab0){_0x353f85['count']=_0x335ab0;if(_0x444eda[_0xd1de('0x38')][_0xd1de('0x48')]){_0x4e1047[_0xd1de('0x49')]=[{'all':!![]}];}return db[_0xd1de('0x32')][_0xd1de('0x4a')](_0x4e1047);})[_0xd1de('0x27')](function(_0x2cdea9){_0x353f85['rows']=_0x2cdea9;return _0x353f85;})['then'](respondWithFilteredResult(_0x5045a9,_0x4e1047))[_0xd1de('0x4b')](handleError(_0x5045a9,null));};exports['show']=function(_0x143d6c,_0x25f069){var _0x41d309={'raw':!![],'where':{'id':_0x143d6c[_0xd1de('0x4c')]['id']}},_0x1dd45f={};_0x1dd45f[_0xd1de('0x37')]=_[_0xd1de('0x39')](db[_0xd1de('0x32')][_0xd1de('0x33')]);_0x1dd45f[_0xd1de('0x38')]=_[_0xd1de('0x39')](_0x143d6c[_0xd1de('0x38')]);_0x1dd45f['filters']=_[_0xd1de('0x3b')](_0x1dd45f['model'],_0x1dd45f[_0xd1de('0x38')]);_0x41d309[_0xd1de('0x3c')]=_[_0xd1de('0x3b')](_0x1dd45f[_0xd1de('0x37')],qs[_0xd1de('0x3d')](_0x143d6c[_0xd1de('0x38')]['fields']));_0x41d309[_0xd1de('0x3c')]=_0x41d309[_0xd1de('0x3c')]['length']?_0x41d309[_0xd1de('0x3c')]:_0x1dd45f[_0xd1de('0x37')];if(_0x143d6c[_0xd1de('0x38')]['includeAll']){_0x41d309[_0xd1de('0x49')]=[{'all':!![]}];}_0x41d309=_[_0xd1de('0x46')]({},_0x41d309,_0x143d6c[_0xd1de('0x4d')]);return db['CmHopperAdditionalPhone'][_0xd1de('0x4e')](_0x41d309)['then'](handleEntityNotFound(_0x25f069,null))['then'](respondWithResult(_0x25f069,null))[_0xd1de('0x4b')](handleError(_0x25f069,null));};exports[_0xd1de('0x4f')]=function(_0x1a28df,_0x328235){return db[_0xd1de('0x32')][_0xd1de('0x4f')](_0x1a28df[_0xd1de('0x50')],{})[_0xd1de('0x27')](function(_0x4ce222){var _0x13ff53=_0x1a28df['user'][_0xd1de('0x29')]({'plain':!![]});if(!_0x13ff53)throw new Error(_0xd1de('0x51'));if(_0x13ff53[_0xd1de('0x52')]==='user'){var _0x5698f7=_0x4ce222[_0xd1de('0x29')]({'plain':!![]});var _0x490e9b=_0xd1de('0x2a');return db[_0xd1de('0x53')][_0xd1de('0x4e')]({'where':{'name':_0x490e9b,'userProfileId':_0x13ff53[_0xd1de('0x54')]},'raw':!![]})['then'](function(_0x5c83a9){if(_0x5c83a9&&_0x5c83a9[_0xd1de('0x55')]===0x0){return db['UserProfileResource'][_0xd1de('0x4f')]({'name':_0x5698f7[_0xd1de('0x2e')],'resourceId':_0x5698f7['id'],'type':_0x5c83a9[_0xd1de('0x2e')],'sectionId':_0x5c83a9['id']},{})[_0xd1de('0x27')](function(){return _0x4ce222;});}else{return _0x4ce222;}})[_0xd1de('0x4b')](function(_0x4687f1){logger['error'](_0xd1de('0x56'),_0x4687f1);throw _0x4687f1;});}return _0x4ce222;})['then'](respondWithResult(_0x328235,0xc9))[_0xd1de('0x4b')](handleError(_0x328235,null));};exports[_0xd1de('0x26')]=function(_0x248e3b,_0xebef43){if(_0x248e3b[_0xd1de('0x50')]['id']){delete _0x248e3b[_0xd1de('0x50')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x248e3b[_0xd1de('0x4c')]['id']}})[_0xd1de('0x27')](handleEntityNotFound(_0xebef43,null))[_0xd1de('0x27')](saveUpdates(_0x248e3b[_0xd1de('0x50')],null))[_0xd1de('0x27')](respondWithResult(_0xebef43,null))[_0xd1de('0x4b')](handleError(_0xebef43,null));};exports[_0xd1de('0x28')]=function(_0x3e7371,_0x315d2b){return db[_0xd1de('0x32')][_0xd1de('0x4e')]({'where':{'id':_0x3e7371['params']['id']}})[_0xd1de('0x27')](handleEntityNotFound(_0x315d2b,null))[_0xd1de('0x27')](removeEntity(_0x315d2b,null))[_0xd1de('0x4b')](handleError(_0x315d2b,null));}; \ No newline at end of file +var _0xbd0e=['create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','set','Content-Range','apply','save','then','destroy','get','CmHopperAdditionalPhones','sendStatus','error','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','findAll','rows','show','rawAttributes','include','find'];(function(_0x324f81,_0x4e52f0){var _0x51a4a4=function(_0x482ecd){while(--_0x482ecd){_0x324f81['push'](_0x324f81['shift']());}};_0x51a4a4(++_0x4e52f0);}(_0xbd0e,0x108));var _0xebd0=function(_0x20f08b,_0x646ea0){_0x20f08b=_0x20f08b-0x0;var _0x675062=_0xbd0e[_0x20f08b];return _0x675062;};'use strict';var emlformat=require(_0xebd0('0x0'));var rimraf=require(_0xebd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd0('0x2'));var rp=require(_0xebd0('0x3'));var moment=require(_0xebd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xebd0('0x5'));var util=require(_0xebd0('0x6'));var path=require('path');var sox=require(_0xebd0('0x7'));var csv=require(_0xebd0('0x8'));var ejs=require(_0xebd0('0x9'));var fs=require('fs');var fs_extra=require(_0xebd0('0xa'));var _=require(_0xebd0('0xb'));var squel=require('squel');var crypto=require(_0xebd0('0xc'));var jsforce=require(_0xebd0('0xd'));var deskjs=require(_0xebd0('0xe'));var toCsv=require(_0xebd0('0x8'));var querystring=require(_0xebd0('0xf'));var Papa=require(_0xebd0('0x10'));var Redis=require(_0xebd0('0x11'));var authService=require(_0xebd0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xebd0('0x13'));var hardwareService=require(_0xebd0('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xebd0('0x15'));var config=require(_0xebd0('0x16'));var licenseUtil=require(_0xebd0('0x17'));var db=require(_0xebd0('0x18'))['db'];function respondWithStatusCode(_0x3bbc4e,_0x1cc445){_0x1cc445=_0x1cc445||0xcc;return function(_0x2f0458){if(_0x2f0458){return _0x3bbc4e['sendStatus'](_0x1cc445);}return _0x3bbc4e['status'](_0x1cc445)[_0xebd0('0x19')]();};}function respondWithResult(_0xb9f286,_0x4113f1){_0x4113f1=_0x4113f1||0xc8;return function(_0x3f7d39){if(_0x3f7d39){return _0xb9f286[_0xebd0('0x1a')](_0x4113f1)[_0xebd0('0x1b')](_0x3f7d39);}};}function respondWithFilteredResult(_0x1d5911,_0x3b50c8){return function(_0x384219){if(_0x384219){var _0x268d36=typeof _0x3b50c8['offset']===_0xebd0('0x1c')&&typeof _0x3b50c8['limit']===_0xebd0('0x1c');var _0x386c8b=_0x384219[_0xebd0('0x1d')];var _0x5cae04=_0x268d36?0x0:_0x3b50c8[_0xebd0('0x1e')];var _0x43d4c1=_0x268d36?_0x384219['count']:_0x3b50c8[_0xebd0('0x1e')]+_0x3b50c8['limit'];var _0x4d6c8c;if(_0x43d4c1>=_0x386c8b){_0x43d4c1=_0x386c8b;_0x4d6c8c=0xc8;}else{_0x4d6c8c=0xce;}_0x1d5911[_0xebd0('0x1a')](_0x4d6c8c);return _0x1d5911[_0xebd0('0x1f')](_0xebd0('0x20'),_0x5cae04+'-'+_0x43d4c1+'/'+_0x386c8b)[_0xebd0('0x1b')](_0x384219);}return null;};}function patchUpdates(_0x3a160e){return function(_0x4da980){try{jsonpatch[_0xebd0('0x21')](_0x4da980,_0x3a160e,!![]);}catch(_0x218c21){return BPromise['reject'](_0x218c21);}return _0x4da980[_0xebd0('0x22')]();};}function saveUpdates(_0x3c12aa,_0x1507a8){return function(_0x421003){if(_0x421003){return _0x421003['update'](_0x3c12aa)[_0xebd0('0x23')](function(_0xe51ac3){return _0xe51ac3;});}return null;};}function removeEntity(_0x612a02,_0x41f509){return function(_0x5ba0e1){if(_0x5ba0e1){return _0x5ba0e1[_0xebd0('0x24')]()['then'](function(){var _0x28e7ae=_0x5ba0e1[_0xebd0('0x25')]({'plain':!![]});var _0x165787=_0xebd0('0x26');return db['UserProfileResource'][_0xebd0('0x24')]({'where':{'type':_0x165787,'resourceId':_0x28e7ae['id']}})[_0xebd0('0x23')](function(){return _0x5ba0e1;});})[_0xebd0('0x23')](function(){_0x612a02['status'](0xcc)[_0xebd0('0x19')]();});}};}function handleEntityNotFound(_0xa44251,_0x52243b){return function(_0xc5b1f1){if(!_0xc5b1f1){_0xa44251[_0xebd0('0x27')](0x194);}return _0xc5b1f1;};}function handleError(_0x5c8726,_0x47dff5){_0x47dff5=_0x47dff5||0x1f4;return function(_0x373d56){logger[_0xebd0('0x28')](_0x373d56['stack']);if(_0x373d56[_0xebd0('0x29')]){delete _0x373d56[_0xebd0('0x29')];}_0x5c8726[_0xebd0('0x1a')](_0x47dff5)[_0xebd0('0x2a')](_0x373d56);};}exports[_0xebd0('0x2b')]=function(_0x862bf2,_0x4c0791){var _0x167ad9={},_0x1044ad={},_0x4bea13={'count':0x0,'rows':[]};var _0x164442=_[_0xebd0('0x2c')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x322928){return{'name':_0x322928[_0xebd0('0x2d')],'type':_0x322928[_0xebd0('0x2e')]['key']};});_0x1044ad[_0xebd0('0x2f')]=_[_0xebd0('0x2c')](_0x164442,_0xebd0('0x29'));_0x1044ad[_0xebd0('0x30')]=_[_0xebd0('0x31')](_0x862bf2[_0xebd0('0x30')]);_0x1044ad[_0xebd0('0x32')]=_[_0xebd0('0x33')](_0x1044ad[_0xebd0('0x2f')],_0x1044ad[_0xebd0('0x30')]);_0x167ad9['attributes']=_['intersection'](_0x1044ad['model'],qs['fields'](_0x862bf2[_0xebd0('0x30')]['fields']));_0x167ad9[_0xebd0('0x34')]=_0x167ad9[_0xebd0('0x34')][_0xebd0('0x35')]?_0x167ad9[_0xebd0('0x34')]:_0x1044ad[_0xebd0('0x2f')];if(!_0x862bf2[_0xebd0('0x30')][_0xebd0('0x36')](_0xebd0('0x37'))){_0x167ad9[_0xebd0('0x38')]=qs[_0xebd0('0x38')](_0x862bf2[_0xebd0('0x30')]['limit']);_0x167ad9[_0xebd0('0x1e')]=qs['offset'](_0x862bf2[_0xebd0('0x30')]['offset']);}_0x167ad9['order']=qs[_0xebd0('0x39')](_0x862bf2['query'][_0xebd0('0x39')]);_0x167ad9[_0xebd0('0x3a')]=qs[_0xebd0('0x32')](_[_0xebd0('0x3b')](_0x862bf2[_0xebd0('0x30')],_0x1044ad['filters']),_0x164442);if(_0x862bf2['query']['filter']){_0x167ad9[_0xebd0('0x3a')]=_[_0xebd0('0x3c')](_0x167ad9[_0xebd0('0x3a')],{'$or':_[_0xebd0('0x2c')](_0x164442,function(_0x2d6d49){if(_0x2d6d49['type']!==_0xebd0('0x3d')){var _0x141b14={};_0x141b14[_0x2d6d49['name']]={'$like':'%'+_0x862bf2[_0xebd0('0x30')][_0xebd0('0x3e')]+'%'};return _0x141b14;}})});}_0x167ad9=_[_0xebd0('0x3c')]({},_0x167ad9,_0x862bf2[_0xebd0('0x3f')]);var _0x1bc6df={'where':_0x167ad9[_0xebd0('0x3a')]};return db[_0xebd0('0x40')][_0xebd0('0x1d')](_0x1bc6df)[_0xebd0('0x23')](function(_0x2e223d){_0x4bea13[_0xebd0('0x1d')]=_0x2e223d;if(_0x862bf2[_0xebd0('0x30')][_0xebd0('0x41')]){_0x167ad9['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xebd0('0x42')](_0x167ad9);})[_0xebd0('0x23')](function(_0xf66e4f){_0x4bea13[_0xebd0('0x43')]=_0xf66e4f;return _0x4bea13;})[_0xebd0('0x23')](respondWithFilteredResult(_0x4c0791,_0x167ad9))['catch'](handleError(_0x4c0791,null));};exports[_0xebd0('0x44')]=function(_0x1c5e9e,_0x195b8d){var _0x57ae31={'raw':!![],'where':{'id':_0x1c5e9e['params']['id']}},_0x4d1236={};_0x4d1236['model']=_['keys'](db[_0xebd0('0x40')][_0xebd0('0x45')]);_0x4d1236[_0xebd0('0x30')]=_[_0xebd0('0x31')](_0x1c5e9e['query']);_0x4d1236[_0xebd0('0x32')]=_['intersection'](_0x4d1236[_0xebd0('0x2f')],_0x4d1236[_0xebd0('0x30')]);_0x57ae31[_0xebd0('0x34')]=_['intersection'](_0x4d1236[_0xebd0('0x2f')],qs['fields'](_0x1c5e9e[_0xebd0('0x30')]['fields']));_0x57ae31[_0xebd0('0x34')]=_0x57ae31[_0xebd0('0x34')][_0xebd0('0x35')]?_0x57ae31[_0xebd0('0x34')]:_0x4d1236[_0xebd0('0x2f')];if(_0x1c5e9e['query'][_0xebd0('0x41')]){_0x57ae31[_0xebd0('0x46')]=[{'all':!![]}];}_0x57ae31=_[_0xebd0('0x3c')]({},_0x57ae31,_0x1c5e9e[_0xebd0('0x3f')]);return db[_0xebd0('0x40')][_0xebd0('0x47')](_0x57ae31)[_0xebd0('0x23')](handleEntityNotFound(_0x195b8d,null))[_0xebd0('0x23')](respondWithResult(_0x195b8d,null))['catch'](handleError(_0x195b8d,null));};exports[_0xebd0('0x48')]=function(_0x28ef8b,_0x5bc604){return db['CmHopperAdditionalPhone'][_0xebd0('0x48')](_0x28ef8b[_0xebd0('0x49')],{})[_0xebd0('0x23')](function(_0x3bac7b){var _0x1b509f=_0x28ef8b[_0xebd0('0x4a')][_0xebd0('0x25')]({'plain':!![]});if(!_0x1b509f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b509f[_0xebd0('0x4b')]===_0xebd0('0x4a')){var _0xa56d2a=_0x3bac7b[_0xebd0('0x25')]({'plain':!![]});var _0x12028f='CmHopperAdditionalPhones';return db[_0xebd0('0x4c')][_0xebd0('0x47')]({'where':{'name':_0x12028f,'userProfileId':_0x1b509f[_0xebd0('0x4d')]},'raw':!![]})[_0xebd0('0x23')](function(_0x5c6050){if(_0x5c6050&&_0x5c6050[_0xebd0('0x4e')]===0x0){return db[_0xebd0('0x4f')]['create']({'name':_0xa56d2a[_0xebd0('0x29')],'resourceId':_0xa56d2a['id'],'type':_0x5c6050[_0xebd0('0x29')],'sectionId':_0x5c6050['id']},{})[_0xebd0('0x23')](function(){return _0x3bac7b;});}else{return _0x3bac7b;}})[_0xebd0('0x50')](function(_0x11514f){logger[_0xebd0('0x28')](_0xebd0('0x51'),_0x11514f);throw _0x11514f;});}return _0x3bac7b;})[_0xebd0('0x23')](respondWithResult(_0x5bc604,0xc9))['catch'](handleError(_0x5bc604,null));};exports[_0xebd0('0x52')]=function(_0x2b8a91,_0x5991c6){if(_0x2b8a91[_0xebd0('0x49')]['id']){delete _0x2b8a91[_0xebd0('0x49')]['id'];}return db[_0xebd0('0x40')]['find']({'where':{'id':_0x2b8a91[_0xebd0('0x53')]['id']}})['then'](handleEntityNotFound(_0x5991c6,null))['then'](saveUpdates(_0x2b8a91[_0xebd0('0x49')],null))['then'](respondWithResult(_0x5991c6,null))[_0xebd0('0x50')](handleError(_0x5991c6,null));};exports[_0xebd0('0x24')]=function(_0x18bd6e,_0x522e72){return db['CmHopperAdditionalPhone'][_0xebd0('0x47')]({'where':{'id':_0x18bd6e[_0xebd0('0x53')]['id']}})[_0xebd0('0x23')](handleEntityNotFound(_0x522e72,null))['then'](removeEntity(_0x522e72,null))[_0xebd0('0x50')](handleError(_0x522e72,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 4e59cd3..702688f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe29e=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x2cefa7,_0x3b2163){var _0x1b3c67=function(_0x1c4662){while(--_0x1c4662){_0x2cefa7['push'](_0x2cefa7['shift']());}};_0x1b3c67(++_0x3b2163);}(_0xe29e,0xed));var _0xee29=function(_0x598aa9,_0x32aefe){_0x598aa9=_0x598aa9-0x0;var _0x54436b=_0xe29e[_0x598aa9];return _0x54436b;};'use strict';var _=require(_0xee29('0x0'));var util=require(_0xee29('0x1'));var logger=require(_0xee29('0x2'))(_0xee29('0x3'));var moment=require(_0xee29('0x4'));var BPromise=require('bluebird');var rp=require(_0xee29('0x5'));var fs=require('fs');var path=require(_0xee29('0x6'));var rimraf=require(_0xee29('0x7'));var config=require('../../config/environment');var attributes=require(_0xee29('0x8'));module[_0xee29('0x9')]=function(_0x38a7bb,_0x13b0f3){return _0x38a7bb[_0xee29('0xa')](_0xee29('0xb'),attributes,{'tableName':_0xee29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x703e=['./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x703e,0x197));var _0xe703=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x703e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xe703('0x0'));var util=require(_0xe703('0x1'));var logger=require(_0xe703('0x2'))('api');var moment=require(_0xe703('0x3'));var BPromise=require(_0xe703('0x4'));var rp=require(_0xe703('0x5'));var fs=require('fs');var path=require(_0xe703('0x6'));var rimraf=require(_0xe703('0x7'));var config=require(_0xe703('0x8'));var attributes=require(_0xe703('0x9'));module['exports']=function(_0x248cb4,_0x3840ff){return _0x248cb4[_0xe703('0xa')](_0xe703('0xb'),attributes,{'tableName':_0xe703('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index ab99d76..80087a4 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cfa=['add','minutes','phone','createdAt','updatedAt','sequelize','transaction','CmHopper','activateAdditionalPhone','IncrementPreviewCounters','update','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','info','result','catch','VerifyAdditionalPhones','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','countnosuchnumberretry','countmachineretry','SwapAdditionalPhones','ContactId','duration','waitTime','isNil','scheduledat'];(function(_0x2e5a8c,_0x35f4bf){var _0x5816ec=function(_0x27cf55){while(--_0x27cf55){_0x2e5a8c['push'](_0x2e5a8c['shift']());}};_0x5816ec(++_0x35f4bf);}(_0x9cfa,0xfc));var _0xa9cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9cfa[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa9cf('0x0'));var moment=require(_0xa9cf('0x1'));var BPromise=require(_0xa9cf('0x2'));var rs=require(_0xa9cf('0x3'));var fs=require('fs');var Redis=require(_0xa9cf('0x4'));var db=require(_0xa9cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9cf('0x6'));var config=require(_0xa9cf('0x7'));var jayson=require(_0xa9cf('0x8'));var client=jayson[_0xa9cf('0x9')][_0xa9cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316c3b,_0x48cd71,_0x42e1b8){return new BPromise(function(_0x14ef20,_0x3d499b){return client[_0xa9cf('0xb')](_0x316c3b,_0x42e1b8)[_0xa9cf('0xc')](function(_0x32d536){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x48cd71,_0xa9cf('0xd'));logger[_0xa9cf('0xe')](_0xa9cf('0xf'),_0x48cd71,'request\x20sent',JSON[_0xa9cf('0x10')](_0x32d536));if(_0x32d536[_0xa9cf('0x11')]){if(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x12')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x48cd71,_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);return _0x3d499b(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);}logger[_0xa9cf('0x11')](_0xa9cf('0x14'),_0x48cd71,_0x32d536['error'][_0xa9cf('0x13')]);return _0x14ef20(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);}else{logger[_0xa9cf('0x15')](_0xa9cf('0x14'),_0x48cd71,_0xa9cf('0xd'));_0x14ef20(_0x32d536[_0xa9cf('0x16')]['message']);}})[_0xa9cf('0x17')](function(_0x127795){logger['error'](_0xa9cf('0x14'),_0x48cd71,_0x127795);_0x3d499b(_0x127795);});});}exports[_0xa9cf('0x18')]=function(_0x1429cd){var _0x202bfe=this;return new Promise(function(_0x25ad64,_0x130d47){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1429cd[_0xa9cf('0x19')]['ContactId'],'ListId':_0x1429cd['body'][_0xa9cf('0x1a')],'VoiceQueueId':_0x1429cd['body']['VoiceQueueId']===undefined?null:_0x1429cd['body'][_0xa9cf('0x1b')],'CampaignId':_0x1429cd[_0xa9cf('0x19')][_0xa9cf('0x1c')]===undefined?null:_0x1429cd[_0xa9cf('0x19')]['CampaignId']}})[_0xa9cf('0xc')](function(_0x3ed492){if(_0x3ed492!=null){return db[_0xa9cf('0x1d')][_0xa9cf('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x3ed492['id'],'OrderBy':{'$gt':_0x3ed492[_0xa9cf('0x1f')]}},'order':[[_0xa9cf('0x1f'),_0xa9cf('0x20')]]})['then'](function(_0x47777c){var _0x3d9968=0x0;if(_0x47777c){if(_0x47777c['countbusyretry']+_0x47777c[_0xa9cf('0x21')]+_0x47777c[_0xa9cf('0x22')]+_0x47777c['countnosuchnumberretry']+_0x47777c['countdropretry']+_0x47777c[_0xa9cf('0x23')]+_0x47777c['countmachineretry']+_0x47777c[_0xa9cf('0x24')]<_0x1429cd[_0xa9cf('0x25')][_0xa9cf('0x26')])_0x3d9968=0x1;_0x25ad64({'additional':_0x3d9968});}else{return db[_0xa9cf('0x1d')][_0xa9cf('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x3ed492['id']},'order':[[_0xa9cf('0x1f'),_0xa9cf('0x20')]]})['then'](function(_0xb76900){var _0x358c77=0x0;if(_0xb76900){if(_0xb76900[_0xa9cf('0x27')]+_0xb76900[_0xa9cf('0x21')]+_0xb76900[_0xa9cf('0x22')]+_0xb76900[_0xa9cf('0x28')]+_0xb76900['countdropretry']+_0xb76900[_0xa9cf('0x23')]+_0xb76900[_0xa9cf('0x29')]+_0xb76900['countagentrejectretry']<_0x1429cd[_0xa9cf('0x25')][_0xa9cf('0x26')])_0x358c77=0x1;_0x25ad64({'additional':_0x358c77});}else{_0x25ad64({'additional':0x0});}})[_0xa9cf('0x17')](function(_0x1b9061){logger[_0xa9cf('0x11')]('VerifyAdditionalPhones',_0x1b9061[_0xa9cf('0x13')]);_0x130d47(_0x202bfe[_0xa9cf('0x11')](0x1f4,_0x1b9061[_0xa9cf('0x13')]));});}})[_0xa9cf('0x17')](function(_0x26c6d8){logger[_0xa9cf('0x11')]('VerifyAdditionalPhones',_0x26c6d8['message']);_0x130d47(_0x202bfe[_0xa9cf('0x11')](0x1f4,_0x26c6d8[_0xa9cf('0x13')]));});}else _0x25ad64({'additional':0x0});});});};exports[_0xa9cf('0x2a')]=function(_0x579190){var _0x1615f4=this;return new Promise(function(_0x59583c,_0x53801d){return db['CmHopper'][_0xa9cf('0x1e')]({'raw':!![],'where':{'ContactId':_0x579190[_0xa9cf('0x19')][_0xa9cf('0x2b')],'ListId':_0x579190[_0xa9cf('0x19')]['ListId'],'VoiceQueueId':_0x579190[_0xa9cf('0x19')][_0xa9cf('0x1b')]===undefined?null:_0x579190['body'][_0xa9cf('0x1b')],'CampaignId':_0x579190[_0xa9cf('0x19')][_0xa9cf('0x1c')]===undefined?null:_0x579190[_0xa9cf('0x19')][_0xa9cf('0x1c')]}})['then'](function(_0xe0b5a8){if(_0xe0b5a8!=null){return db[_0xa9cf('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xe0b5a8['id'],'OrderBy':{'$gte':_0xe0b5a8[_0xa9cf('0x1f')]}},'order':[[_0xa9cf('0x1f'),_0xa9cf('0x20')]]})[_0xa9cf('0xc')](function(_0x35d121){if(_0x35d121)return activateAdditionalPhone(_0xe0b5a8,_0x579190[_0xa9cf('0x19')],_0x35d121,_0x579190[_0xa9cf('0x2c')],_0x579190[_0xa9cf('0x2d')])['then'](function(_0x2aff43){_0x59583c(_0x2aff43);});else{return db['CmHopperAdditionalPhone'][_0xa9cf('0x1e')]({'raw':!![],'where':{'CmHopperId':_0xe0b5a8['id']},'order':[[_0xa9cf('0x1f'),_0xa9cf('0x20')]]})[_0xa9cf('0xc')](function(_0x29ae3d){if(_0x29ae3d)return activateAdditionalPhone(_0xe0b5a8,_0x579190['body'],_0x29ae3d,_0x579190[_0xa9cf('0x2c')],_0x579190[_0xa9cf('0x2d')])[_0xa9cf('0xc')](function(_0x5f3034){_0x59583c(_0x5f3034);});else{_0x59583c({'id':_0xe0b5a8['id'],'phone':''});}})[_0xa9cf('0x17')](function(_0x129056){logger[_0xa9cf('0x11')](_0xa9cf('0x18'),_0x129056['message']);_0x53801d(_0x1615f4['error'](0x1f4,_0x129056[_0xa9cf('0x13')]));});}})['catch'](function(_0x2fa189){logger[_0xa9cf('0x11')](_0xa9cf('0x18'),_0x2fa189[_0xa9cf('0x13')]);_0x53801d(_0x1615f4[_0xa9cf('0x11')](0x1f4,_0x2fa189[_0xa9cf('0x13')]));});}else _0x59583c(0x1);});});};function activateAdditionalPhone(_0x1a61a2,_0x28c689,_0x56e012,_0x3a16b0,_0x28aecd){return new Promise(function(_0x4bfc33,_0x47511b){var _0x4f51b3;if(_[_0xa9cf('0x2e')](_0x56e012[_0xa9cf('0x2f')])){_0x56e012[_0xa9cf('0x2f')]=moment();}if(moment()>moment(_0x56e012[_0xa9cf('0x2f')])){_0x4f51b3=moment()[_0xa9cf('0x30')](_0x28aecd||0x3,'minutes');}else{if(_0x56e012[_0xa9cf('0x1f')]==0x0){_0x4f51b3=moment(_0x56e012[_0xa9cf('0x2f')]);}else{_0x4f51b3=moment()[_0xa9cf('0x30')](_0x28aecd||0x3,_0xa9cf('0x31'));}}if(_[_0xa9cf('0x2e')](_0x4f51b3)){_0x4f51b3=moment()[_0xa9cf('0x30')](_0x28aecd||0x3,'minutes');}var _0x2952ed={'phone':_0x1a61a2[_0xa9cf('0x32')],'active':0x0,'OrderBy':_[_0xa9cf('0x2e')](_0x1a61a2[_0xa9cf('0x1f')])?0x0:_0x1a61a2[_0xa9cf('0x1f')],'scheduledat':moment()[_0xa9cf('0x30')](_0x3a16b0||0x1,_0xa9cf('0x31')),'countbusyretry':_0x28c689[_0xa9cf('0x27')],'countcongestionretry':_0x28c689[_0xa9cf('0x21')],'countnoanswerretry':_0x28c689[_0xa9cf('0x22')],'countnosuchnumberretry':_0x28c689[_0xa9cf('0x28')],'countdropretry':_0x28c689['countdropretry'],'countabandonedretry':_0x28c689[_0xa9cf('0x23')],'countmachineretry':_0x28c689[_0xa9cf('0x29')],'countagentrejectretry':_0x28c689[_0xa9cf('0x24')],'createdAt':_0x28c689[_0xa9cf('0x33')],'updatedAt':_0x28c689[_0xa9cf('0x34')]};var _0xdea6e4={'CmHopperId':_0x1a61a2['id'],'phone':_0x56e012['phone'],'active':0x0,'OrderBy':_[_0xa9cf('0x2e')](_0x56e012[_0xa9cf('0x1f')])?0x0:_0x56e012['OrderBy'],'scheduledat':_0x4f51b3,'countbusyretry':_0x56e012[_0xa9cf('0x27')],'countcongestionretry':_0x56e012[_0xa9cf('0x21')],'countnoanswerretry':_0x56e012['countnoanswerretry'],'countnosuchnumberretry':_0x56e012[_0xa9cf('0x28')],'countdropretry':_0x56e012['countdropretry'],'countabandonedretry':_0x56e012[_0xa9cf('0x23')],'countmachineretry':_0x56e012[_0xa9cf('0x29')],'countagentrejectretry':_0x56e012[_0xa9cf('0x24')],'createdAt':_0x56e012[_0xa9cf('0x33')],'updatedAt':_0x56e012['updatedAt']};return db[_0xa9cf('0x35')][_0xa9cf('0x36')](function(_0xaeb3f7){return db['CmHopperAdditionalPhone']['update'](_0x2952ed,{'where':{'id':_0x56e012['id']}},{'transaction':_0xaeb3f7})['then'](function(){return db[_0xa9cf('0x37')]['update'](_0xdea6e4,{'where':{'id':_0x1a61a2['id']}},{'transaction':_0xaeb3f7});});})[_0xa9cf('0xc')](function(_0x496da5){_0x4bfc33({'id':_0x1a61a2['id'],'phone':_0x56e012['phone']});})['catch'](function(_0x2c04b4){logger['error'](_0xa9cf('0x38'),_0x2c04b4['message']);_0x47511b({'error':_0x2c04b4[_0xa9cf('0x13')]});});});}exports[_0xa9cf('0x39')]=function(_0x258738){var _0x3bac70=this;return new Promise(function(_0x44e402,_0x4007e9){return db['CmHopper'][_0xa9cf('0x3a')](_0x258738[_0xa9cf('0x19')][_0xa9cf('0x3b')],{'where':{'id':_0x258738[_0xa9cf('0x19')]['id']}})[_0xa9cf('0xc')](function(_0x2d21fd){_0x44e402(_0x2d21fd);})[_0xa9cf('0x17')](function(_0x33fea6){logger[_0xa9cf('0x11')](_0xa9cf('0x39'),_0x33fea6[_0xa9cf('0x13')]);_0x4007e9(_0x3bac70[_0xa9cf('0x11')](0x1f4,_0x33fea6[_0xa9cf('0x13')]));});});}; \ No newline at end of file +var _0x0afa=['VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','countnosuchnumberretry','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','phone','countcongestionretry','createdAt','updatedAt','isNil','sequelize','transaction','update','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x0afa,0x137));var _0xa0af=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0afa[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xa0af('0x0'));var moment=require(_0xa0af('0x1'));var BPromise=require(_0xa0af('0x2'));var rs=require(_0xa0af('0x3'));var fs=require('fs');var Redis=require(_0xa0af('0x4'));var db=require(_0xa0af('0x5'))['db'];var utils=require(_0xa0af('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa0af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa0af('0x8')][_0xa0af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fbdf3,_0x44d2c9,_0x5e542c){return new BPromise(function(_0x27cf5e,_0x245d32){return client['request'](_0x2fbdf3,_0x5e542c)[_0xa0af('0xa')](function(_0x33c2d0){logger[_0xa0af('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x44d2c9,_0xa0af('0xc'));logger[_0xa0af('0xd')](_0xa0af('0xe'),_0x44d2c9,_0xa0af('0xc'),JSON['stringify'](_0x33c2d0));if(_0x33c2d0[_0xa0af('0xf')]){if(_0x33c2d0[_0xa0af('0xf')]['code']===0x1f4){logger[_0xa0af('0xf')](_0xa0af('0x10'),_0x44d2c9,_0x33c2d0['error']['message']);return _0x245d32(_0x33c2d0[_0xa0af('0xf')]['message']);}logger[_0xa0af('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x44d2c9,_0x33c2d0[_0xa0af('0xf')]['message']);return _0x27cf5e(_0x33c2d0['error']['message']);}else{logger[_0xa0af('0xb')](_0xa0af('0x10'),_0x44d2c9,'request\x20sent');_0x27cf5e(_0x33c2d0['result'][_0xa0af('0x11')]);}})[_0xa0af('0x12')](function(_0x1489c5){logger['error'](_0xa0af('0x10'),_0x44d2c9,_0x1489c5);_0x245d32(_0x1489c5);});});}exports[_0xa0af('0x13')]=function(_0xb00649){var _0x5abf2d=this;return new Promise(function(_0x2dcc16,_0xa28cd0){return db[_0xa0af('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0xb00649[_0xa0af('0x15')][_0xa0af('0x16')],'ListId':_0xb00649['body'][_0xa0af('0x17')],'VoiceQueueId':_0xb00649[_0xa0af('0x15')][_0xa0af('0x18')]===undefined?null:_0xb00649['body'][_0xa0af('0x18')],'CampaignId':_0xb00649[_0xa0af('0x15')][_0xa0af('0x19')]===undefined?null:_0xb00649[_0xa0af('0x15')][_0xa0af('0x19')]}})[_0xa0af('0xa')](function(_0x25afb2){if(_0x25afb2!=null){return db[_0xa0af('0x1a')][_0xa0af('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x25afb2['id'],'OrderBy':{'$gt':_0x25afb2['OrderBy']}},'order':[[_0xa0af('0x1c'),_0xa0af('0x1d')]]})[_0xa0af('0xa')](function(_0x41031c){var _0x14f124=0x0;if(_0x41031c){if(_0x41031c[_0xa0af('0x1e')]+_0x41031c['countcongestionretry']+_0x41031c['countnoanswerretry']+_0x41031c['countnosuchnumberretry']+_0x41031c[_0xa0af('0x1f')]+_0x41031c[_0xa0af('0x20')]+_0x41031c[_0xa0af('0x21')]+_0x41031c[_0xa0af('0x22')]<_0xb00649[_0xa0af('0x23')][_0xa0af('0x24')])_0x14f124=0x1;_0x2dcc16({'additional':_0x14f124});}else{return db[_0xa0af('0x1a')][_0xa0af('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x25afb2['id']},'order':[[_0xa0af('0x1c'),'ASC']]})[_0xa0af('0xa')](function(_0x5ede6a){var _0x557411=0x0;if(_0x5ede6a){if(_0x5ede6a[_0xa0af('0x1e')]+_0x5ede6a['countcongestionretry']+_0x5ede6a[_0xa0af('0x25')]+_0x5ede6a[_0xa0af('0x26')]+_0x5ede6a['countdropretry']+_0x5ede6a[_0xa0af('0x20')]+_0x5ede6a[_0xa0af('0x21')]+_0x5ede6a['countagentrejectretry']<_0xb00649[_0xa0af('0x23')][_0xa0af('0x24')])_0x557411=0x1;_0x2dcc16({'additional':_0x557411});}else{_0x2dcc16({'additional':0x0});}})[_0xa0af('0x12')](function(_0x501412){logger['error'](_0xa0af('0x13'),_0x501412[_0xa0af('0x11')]);_0xa28cd0(_0x5abf2d['error'](0x1f4,_0x501412[_0xa0af('0x11')]));});}})[_0xa0af('0x12')](function(_0x5a2c88){logger['error']('VerifyAdditionalPhones',_0x5a2c88['message']);_0xa28cd0(_0x5abf2d[_0xa0af('0xf')](0x1f4,_0x5a2c88[_0xa0af('0x11')]));});}else _0x2dcc16({'additional':0x0});});});};exports[_0xa0af('0x27')]=function(_0x46178b){var _0x5a1c7e=this;return new Promise(function(_0x561cf1,_0x4718e2){return db[_0xa0af('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x46178b['body'][_0xa0af('0x16')],'ListId':_0x46178b[_0xa0af('0x15')][_0xa0af('0x17')],'VoiceQueueId':_0x46178b[_0xa0af('0x15')]['VoiceQueueId']===undefined?null:_0x46178b['body']['VoiceQueueId'],'CampaignId':_0x46178b[_0xa0af('0x15')][_0xa0af('0x19')]===undefined?null:_0x46178b[_0xa0af('0x15')]['CampaignId']}})['then'](function(_0x3dd4ab){if(_0x3dd4ab!=null){return db[_0xa0af('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3dd4ab['id'],'OrderBy':{'$gte':_0x3dd4ab[_0xa0af('0x1c')]}},'order':[[_0xa0af('0x1c'),'ASC']]})[_0xa0af('0xa')](function(_0x2f0282){if(_0x2f0282)return activateAdditionalPhone(_0x3dd4ab,_0x46178b['body'],_0x2f0282,_0x46178b[_0xa0af('0x28')],_0x46178b[_0xa0af('0x29')])[_0xa0af('0xa')](function(_0x53c371){_0x561cf1(_0x53c371);});else{return db[_0xa0af('0x1a')][_0xa0af('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x3dd4ab['id']},'order':[[_0xa0af('0x1c'),_0xa0af('0x1d')]]})['then'](function(_0xd1fa){if(_0xd1fa)return activateAdditionalPhone(_0x3dd4ab,_0x46178b[_0xa0af('0x15')],_0xd1fa,_0x46178b[_0xa0af('0x28')],_0x46178b[_0xa0af('0x29')])[_0xa0af('0xa')](function(_0x3d0a41){_0x561cf1(_0x3d0a41);});else{_0x561cf1({'id':_0x3dd4ab['id'],'phone':''});}})[_0xa0af('0x12')](function(_0x4c16bb){logger[_0xa0af('0xf')](_0xa0af('0x13'),_0x4c16bb['message']);_0x4718e2(_0x5a1c7e[_0xa0af('0xf')](0x1f4,_0x4c16bb['message']));});}})[_0xa0af('0x12')](function(_0x53b1b4){logger[_0xa0af('0xf')](_0xa0af('0x13'),_0x53b1b4[_0xa0af('0x11')]);_0x4718e2(_0x5a1c7e[_0xa0af('0xf')](0x1f4,_0x53b1b4[_0xa0af('0x11')]));});}else _0x561cf1(0x1);});});};function activateAdditionalPhone(_0x229e05,_0xb42b9c,_0x5c76a7,_0x3248bd,_0x29261a){return new Promise(function(_0x23dc36,_0x5451be){var _0x5c94b7;if(_['isNil'](_0x5c76a7[_0xa0af('0x2a')])){_0x5c76a7[_0xa0af('0x2a')]=moment();}if(moment()>moment(_0x5c76a7[_0xa0af('0x2a')])){_0x5c94b7=moment()[_0xa0af('0x2b')](_0x29261a||0x3,_0xa0af('0x2c'));}else{if(_0x5c76a7[_0xa0af('0x1c')]==0x0){_0x5c94b7=moment(_0x5c76a7[_0xa0af('0x2a')]);}else{_0x5c94b7=moment()[_0xa0af('0x2b')](_0x29261a||0x3,_0xa0af('0x2c'));}}if(_['isNil'](_0x5c94b7)){_0x5c94b7=moment()['add'](_0x29261a||0x3,_0xa0af('0x2c'));}var _0x44a25f={'phone':_0x229e05[_0xa0af('0x2d')],'active':0x0,'OrderBy':_['isNil'](_0x229e05['OrderBy'])?0x0:_0x229e05['OrderBy'],'scheduledat':moment()[_0xa0af('0x2b')](_0x3248bd||0x1,_0xa0af('0x2c')),'countbusyretry':_0xb42b9c[_0xa0af('0x1e')],'countcongestionretry':_0xb42b9c[_0xa0af('0x2e')],'countnoanswerretry':_0xb42b9c[_0xa0af('0x25')],'countnosuchnumberretry':_0xb42b9c[_0xa0af('0x26')],'countdropretry':_0xb42b9c[_0xa0af('0x1f')],'countabandonedretry':_0xb42b9c[_0xa0af('0x20')],'countmachineretry':_0xb42b9c[_0xa0af('0x21')],'countagentrejectretry':_0xb42b9c[_0xa0af('0x22')],'createdAt':_0xb42b9c[_0xa0af('0x2f')],'updatedAt':_0xb42b9c[_0xa0af('0x30')]};var _0x4eeaf0={'CmHopperId':_0x229e05['id'],'phone':_0x5c76a7[_0xa0af('0x2d')],'active':0x0,'OrderBy':_[_0xa0af('0x31')](_0x5c76a7[_0xa0af('0x1c')])?0x0:_0x5c76a7[_0xa0af('0x1c')],'scheduledat':_0x5c94b7,'countbusyretry':_0x5c76a7[_0xa0af('0x1e')],'countcongestionretry':_0x5c76a7[_0xa0af('0x2e')],'countnoanswerretry':_0x5c76a7[_0xa0af('0x25')],'countnosuchnumberretry':_0x5c76a7[_0xa0af('0x26')],'countdropretry':_0x5c76a7[_0xa0af('0x1f')],'countabandonedretry':_0x5c76a7[_0xa0af('0x20')],'countmachineretry':_0x5c76a7['countmachineretry'],'countagentrejectretry':_0x5c76a7[_0xa0af('0x22')],'createdAt':_0x5c76a7[_0xa0af('0x2f')],'updatedAt':_0x5c76a7['updatedAt']};return db[_0xa0af('0x32')][_0xa0af('0x33')](function(_0x8641be){return db[_0xa0af('0x1a')][_0xa0af('0x34')](_0x44a25f,{'where':{'id':_0x5c76a7['id']}},{'transaction':_0x8641be})[_0xa0af('0xa')](function(){return db['CmHopper'][_0xa0af('0x34')](_0x4eeaf0,{'where':{'id':_0x229e05['id']}},{'transaction':_0x8641be});});})[_0xa0af('0xa')](function(_0x12332c){_0x23dc36({'id':_0x229e05['id'],'phone':_0x5c76a7[_0xa0af('0x2d')]});})[_0xa0af('0x12')](function(_0x2dea3b){logger['error']('activateAdditionalPhone',_0x2dea3b[_0xa0af('0x11')]);_0x5451be({'error':_0x2dea3b[_0xa0af('0x11')]});});});}exports[_0xa0af('0x35')]=function(_0xb2c291){var _0x37d3ba=this;return new Promise(function(_0x4cff19,_0x37be0c){return db[_0xa0af('0x14')][_0xa0af('0x34')](_0xb2c291[_0xa0af('0x15')][_0xa0af('0x36')],{'where':{'id':_0xb2c291[_0xa0af('0x15')]['id']}})['then'](function(_0x4cffbb){_0x4cff19(_0x4cffbb);})['catch'](function(_0x2e9356){logger[_0xa0af('0xf')](_0xa0af('0x35'),_0x2e9356['message']);_0x37be0c(_0x37d3ba[_0xa0af('0xf')](0x1f4,_0x2e9356[_0xa0af('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 9853c93..9e1f669 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5630=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x440093,_0x1a874f){var _0x1d1cda=function(_0x578caf){while(--_0x578caf){_0x440093['push'](_0x440093['shift']());}};_0x1d1cda(++_0x1a874f);}(_0x5630,0xc3));var _0x0563=function(_0x585634,_0x22747b){_0x585634=_0x585634-0x0;var _0x30d54a=_0x5630[_0x585634];return _0x30d54a;};'use strict';var multer=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var path=require(_0x0563('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0563('0x3'));var auth=require(_0x0563('0x4'));var interaction=require(_0x0563('0x5'));var config=require(_0x0563('0x6'));var controller=require(_0x0563('0x7'));router[_0x0563('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0563('0x8')](_0x0563('0x9'),auth[_0x0563('0xa')](),controller[_0x0563('0xb')]);router['post']('/',auth[_0x0563('0xa')](),controller[_0x0563('0xc')]);router[_0x0563('0xd')](_0x0563('0x9'),auth[_0x0563('0xa')](),controller[_0x0563('0xe')]);router[_0x0563('0xf')](_0x0563('0x9'),auth['isAuthenticated'](),controller[_0x0563('0x10')]);module[_0x0563('0x11')]=router; \ No newline at end of file +var _0xebea=['destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x29aead,_0x4a09ea){var _0x3b70f9=function(_0x4aff69){while(--_0x4aff69){_0x29aead['push'](_0x29aead['shift']());}};_0x3b70f9(++_0x4a09ea);}(_0xebea,0xec));var _0xaebe=function(_0x2cdd53,_0x4871f7){_0x2cdd53=_0x2cdd53-0x0;var _0x14433=_0xebea[_0x2cdd53];return _0x14433;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xaebe('0x0'));var express=require(_0xaebe('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaebe('0x2'));var interaction=require(_0xaebe('0x3'));var config=require('../../config/environment');var controller=require(_0xaebe('0x4'));router[_0xaebe('0x5')]('/',auth[_0xaebe('0x6')](),controller['index']);router[_0xaebe('0x5')](_0xaebe('0x7'),auth[_0xaebe('0x6')](),controller[_0xaebe('0x8')]);router[_0xaebe('0x9')]('/',auth[_0xaebe('0x6')](),controller[_0xaebe('0xa')]);router['put'](_0xaebe('0x7'),auth[_0xaebe('0x6')](),controller['update']);router['delete'](_0xaebe('0x7'),auth[_0xaebe('0x6')](),controller[_0xaebe('0xb')]);module[_0xaebe('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 08a6fac..1d684bd 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 _0x9a14=['contactListQueue','INTEGER','sequelize','exports','STRING'];(function(_0x381668,_0x1a48e7){var _0xba7a8e=function(_0x5dc1ce){while(--_0x5dc1ce){_0x381668['push'](_0x381668['shift']());}};_0xba7a8e(++_0x1a48e7);}(_0x9a14,0x1d3));var _0x49a1=function(_0x2a4ee6,_0x540a27){_0x2a4ee6=_0x2a4ee6-0x0;var _0x1bcd7d=_0x9a14[_0x2a4ee6];return _0x1bcd7d;};'use strict';var moment=require('moment');var Sequelize=require(_0x49a1('0x0'));module[_0x49a1('0x1')]={'phone':{'type':Sequelize[_0x49a1('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x49a1('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x49a1('0x3')},'VoiceQueueId':{'type':Sequelize[_0x49a1('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xaa37=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x4a0671,_0x124bdb){var _0x31961d=function(_0xf2f1bc){while(--_0xf2f1bc){_0x4a0671['push'](_0x4a0671['shift']());}};_0x31961d(++_0x124bdb);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xaa37[_0x618414];return _0x21c19a;};'use strict';var moment=require(_0x7aa3('0x0'));var Sequelize=require(_0x7aa3('0x1'));module[_0x7aa3('0x2')]={'phone':{'type':Sequelize[_0x7aa3('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7aa3('0x4')},'ListId':{'type':Sequelize[_0x7aa3('0x5')],'unique':_0x7aa3('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7aa3('0x5')],'unique':_0x7aa3('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 85262e2..9aa392c 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 _0xf375=['VIRTUAL','merge','options','includeAll','include','CmHopperBlack','catch','show','find','body','params','destroy','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','index','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0xf375,0x19f));var _0x5f37=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf375[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f37('0x0'));var rp=require(_0x5f37('0x1'));var moment=require(_0x5f37('0x2'));var BPromise=require(_0x5f37('0x3'));var Mustache=require(_0x5f37('0x4'));var util=require(_0x5f37('0x5'));var path=require(_0x5f37('0x6'));var sox=require(_0x5f37('0x7'));var csv=require(_0x5f37('0x8'));var ejs=require(_0x5f37('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f37('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5f37('0x8'));var querystring=require('querystring');var Papa=require(_0x5f37('0xb'));var Redis=require(_0x5f37('0xc'));var authService=require(_0x5f37('0xd'));var qs=require(_0x5f37('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f37('0xf'));var logger=require('../../config/logger')(_0x5f37('0x10'));var utils=require(_0x5f37('0x11'));var config=require(_0x5f37('0x12'));var licenseUtil=require(_0x5f37('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5469df,_0x22a5e6){_0x22a5e6=_0x22a5e6||0xcc;return function(_0x109b90){if(_0x109b90){return _0x5469df[_0x5f37('0x14')](_0x22a5e6);}return _0x5469df[_0x5f37('0x15')](_0x22a5e6)['end']();};}function respondWithResult(_0x5d8e6a,_0x22cfe7){_0x22cfe7=_0x22cfe7||0xc8;return function(_0x275067){if(_0x275067){return _0x5d8e6a[_0x5f37('0x15')](_0x22cfe7)[_0x5f37('0x16')](_0x275067);}};}function respondWithFilteredResult(_0x64d82b,_0x360f88){return function(_0x38e605){if(_0x38e605){var _0x3743be=typeof _0x360f88['offset']===_0x5f37('0x17')&&typeof _0x360f88[_0x5f37('0x18')]===_0x5f37('0x17');var _0x55c64c=_0x38e605[_0x5f37('0x19')];var _0x2ce3c3=_0x3743be?0x0:_0x360f88[_0x5f37('0x1a')];var _0x39ab2c=_0x3743be?_0x38e605[_0x5f37('0x19')]:_0x360f88['offset']+_0x360f88[_0x5f37('0x18')];var _0x56abde;if(_0x39ab2c>=_0x55c64c){_0x39ab2c=_0x55c64c;_0x56abde=0xc8;}else{_0x56abde=0xce;}_0x64d82b[_0x5f37('0x15')](_0x56abde);return _0x64d82b['set'](_0x5f37('0x1b'),_0x2ce3c3+'-'+_0x39ab2c+'/'+_0x55c64c)[_0x5f37('0x16')](_0x38e605);}return null;};}function patchUpdates(_0x52d05c){return function(_0x31f451){try{jsonpatch[_0x5f37('0x1c')](_0x31f451,_0x52d05c,!![]);}catch(_0x2a2809){return BPromise[_0x5f37('0x1d')](_0x2a2809);}return _0x31f451[_0x5f37('0x1e')]();};}function saveUpdates(_0x60f329,_0x6ad1ef){return function(_0x2f94c5){if(_0x2f94c5){return _0x2f94c5[_0x5f37('0x1f')](_0x60f329)[_0x5f37('0x20')](function(_0x15cbe0){return _0x15cbe0;});}return null;};}function removeEntity(_0x1f4918,_0x257720){return function(_0x308461){if(_0x308461){return _0x308461['destroy']()[_0x5f37('0x20')](function(){_0x1f4918[_0x5f37('0x15')](0xcc)[_0x5f37('0x21')]();});}};}function handleEntityNotFound(_0x15f90e,_0x5a70e8){return function(_0x4968b3){if(!_0x4968b3){_0x15f90e['sendStatus'](0x194);}return _0x4968b3;};}function handleError(_0x4f5bdc,_0x190c48){_0x190c48=_0x190c48||0x1f4;return function(_0x3848d6){logger['error'](_0x3848d6['stack']);if(_0x3848d6['name']){delete _0x3848d6['name'];}_0x4f5bdc[_0x5f37('0x15')](_0x190c48)['send'](_0x3848d6);};}exports[_0x5f37('0x22')]=function(_0x5468ba,_0x193bfc){var _0x3133a5={},_0x343b76={},_0x4382af={'count':0x0,'rows':[]};var _0x168b31=_['map'](db['CmHopperBlack']['rawAttributes'],function(_0x584492){return{'name':_0x584492['fieldName'],'type':_0x584492['type'][_0x5f37('0x23')]};});_0x343b76[_0x5f37('0x24')]=_[_0x5f37('0x25')](_0x168b31,_0x5f37('0x26'));_0x343b76['query']=_[_0x5f37('0x27')](_0x5468ba[_0x5f37('0x28')]);_0x343b76[_0x5f37('0x29')]=_[_0x5f37('0x2a')](_0x343b76['model'],_0x343b76[_0x5f37('0x28')]);_0x3133a5[_0x5f37('0x2b')]=_[_0x5f37('0x2a')](_0x343b76[_0x5f37('0x24')],qs[_0x5f37('0x2c')](_0x5468ba[_0x5f37('0x28')][_0x5f37('0x2c')]));_0x3133a5[_0x5f37('0x2b')]=_0x3133a5[_0x5f37('0x2b')][_0x5f37('0x2d')]?_0x3133a5[_0x5f37('0x2b')]:_0x343b76[_0x5f37('0x24')];if(!_0x5468ba[_0x5f37('0x28')][_0x5f37('0x2e')](_0x5f37('0x2f'))){_0x3133a5[_0x5f37('0x18')]=qs[_0x5f37('0x18')](_0x5468ba[_0x5f37('0x28')][_0x5f37('0x18')]);_0x3133a5[_0x5f37('0x1a')]=qs['offset'](_0x5468ba[_0x5f37('0x28')][_0x5f37('0x1a')]);}_0x3133a5[_0x5f37('0x30')]=qs['sort'](_0x5468ba[_0x5f37('0x28')][_0x5f37('0x31')]);_0x3133a5[_0x5f37('0x32')]=qs[_0x5f37('0x29')](_[_0x5f37('0x33')](_0x5468ba[_0x5f37('0x28')],_0x343b76[_0x5f37('0x29')]),_0x168b31);if(_0x5468ba[_0x5f37('0x28')][_0x5f37('0x34')]){_0x3133a5['where']=_['merge'](_0x3133a5[_0x5f37('0x32')],{'$or':_[_0x5f37('0x25')](_0x168b31,function(_0x14fda8){if(_0x14fda8[_0x5f37('0x35')]!==_0x5f37('0x36')){var _0x5de503={};_0x5de503[_0x14fda8[_0x5f37('0x26')]]={'$like':'%'+_0x5468ba[_0x5f37('0x28')][_0x5f37('0x34')]+'%'};return _0x5de503;}})});}_0x3133a5=_[_0x5f37('0x37')]({},_0x3133a5,_0x5468ba[_0x5f37('0x38')]);var _0x3365b3={'where':_0x3133a5[_0x5f37('0x32')]};return db['CmHopperBlack']['count'](_0x3365b3)[_0x5f37('0x20')](function(_0x5159e9){_0x4382af['count']=_0x5159e9;if(_0x5468ba[_0x5f37('0x28')][_0x5f37('0x39')]){_0x3133a5[_0x5f37('0x3a')]=[{'all':!![]}];}return db[_0x5f37('0x3b')]['findAll'](_0x3133a5);})[_0x5f37('0x20')](function(_0x382646){_0x4382af['rows']=_0x382646;return _0x4382af;})[_0x5f37('0x20')](respondWithFilteredResult(_0x193bfc,_0x3133a5))[_0x5f37('0x3c')](handleError(_0x193bfc,null));};exports[_0x5f37('0x3d')]=function(_0x272f8f,_0x9e1a37){var _0x3e9b1a={'raw':!![],'where':{'id':_0x272f8f['params']['id']}},_0x43e9e2={};_0x43e9e2['model']=_[_0x5f37('0x27')](db['CmHopperBlack']['rawAttributes']);_0x43e9e2[_0x5f37('0x28')]=_[_0x5f37('0x27')](_0x272f8f[_0x5f37('0x28')]);_0x43e9e2['filters']=_[_0x5f37('0x2a')](_0x43e9e2[_0x5f37('0x24')],_0x43e9e2['query']);_0x3e9b1a[_0x5f37('0x2b')]=_[_0x5f37('0x2a')](_0x43e9e2['model'],qs['fields'](_0x272f8f[_0x5f37('0x28')]['fields']));_0x3e9b1a[_0x5f37('0x2b')]=_0x3e9b1a[_0x5f37('0x2b')][_0x5f37('0x2d')]?_0x3e9b1a[_0x5f37('0x2b')]:_0x43e9e2['model'];if(_0x272f8f[_0x5f37('0x28')]['includeAll']){_0x3e9b1a['include']=[{'all':!![]}];}_0x3e9b1a=_['merge']({},_0x3e9b1a,_0x272f8f['options']);return db[_0x5f37('0x3b')][_0x5f37('0x3e')](_0x3e9b1a)[_0x5f37('0x20')](handleEntityNotFound(_0x9e1a37,null))['then'](respondWithResult(_0x9e1a37,null))[_0x5f37('0x3c')](handleError(_0x9e1a37,null));};exports[_0x5f37('0x1f')]=function(_0x3e2c16,_0x389843){if(_0x3e2c16[_0x5f37('0x3f')]['id']){delete _0x3e2c16[_0x5f37('0x3f')]['id'];}return db[_0x5f37('0x3b')][_0x5f37('0x3e')]({'where':{'id':_0x3e2c16[_0x5f37('0x40')]['id']}})[_0x5f37('0x20')](handleEntityNotFound(_0x389843,null))[_0x5f37('0x20')](saveUpdates(_0x3e2c16[_0x5f37('0x3f')],null))[_0x5f37('0x20')](respondWithResult(_0x389843,null))['catch'](handleError(_0x389843,null));};exports[_0x5f37('0x41')]=function(_0x47adf5,_0x613dfb){return db[_0x5f37('0x3b')]['find']({'where':{'id':_0x47adf5[_0x5f37('0x40')]['id']}})[_0x5f37('0x20')](handleEntityNotFound(_0x613dfb,null))[_0x5f37('0x20')](removeEntity(_0x613dfb,null))[_0x5f37('0x3c')](handleError(_0x613dfb,null));};exports[_0x5f37('0x42')]=function(_0xa9b1fe,_0x2cdee0){return db[_0x5f37('0x3b')][_0x5f37('0x42')]()[_0x5f37('0x20')](respondWithResult(_0x2cdee0,null))[_0x5f37('0x3c')](handleError(_0x2cdee0,null));}; \ No newline at end of file +var _0x9108=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','CmHopperBlack','include','rows','catch','show','params','find','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x369cec,_0x21216f){var _0x1c79c4=function(_0xe07b46){while(--_0xe07b46){_0x369cec['push'](_0x369cec['shift']());}};_0x1c79c4(++_0x21216f);}(_0x9108,0x12d));var _0x8910=function(_0x152c9e,_0x50f7de){_0x152c9e=_0x152c9e-0x0;var _0x14b99c=_0x9108[_0x152c9e];return _0x14b99c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8910('0x0'));var zipdir=require(_0x8910('0x1'));var jsonpatch=require(_0x8910('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8910('0x3'));var Mustache=require(_0x8910('0x4'));var util=require(_0x8910('0x5'));var path=require(_0x8910('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8910('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8910('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8910('0x9'));var toCsv=require(_0x8910('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8910('0xb'));var authService=require(_0x8910('0xc'));var qs=require(_0x8910('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8910('0xe'));var logger=require(_0x8910('0xf'))(_0x8910('0x10'));var utils=require(_0x8910('0x11'));var config=require(_0x8910('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8910('0x13'))['db'];function respondWithStatusCode(_0x41d489,_0xbbc91f){_0xbbc91f=_0xbbc91f||0xcc;return function(_0x16b922){if(_0x16b922){return _0x41d489[_0x8910('0x14')](_0xbbc91f);}return _0x41d489['status'](_0xbbc91f)[_0x8910('0x15')]();};}function respondWithResult(_0x1d74b1,_0x512d19){_0x512d19=_0x512d19||0xc8;return function(_0x3bc935){if(_0x3bc935){return _0x1d74b1[_0x8910('0x16')](_0x512d19)['json'](_0x3bc935);}};}function respondWithFilteredResult(_0x143665,_0x2cf261){return function(_0x5250b8){if(_0x5250b8){var _0x434dd4=typeof _0x2cf261['offset']===_0x8910('0x17')&&typeof _0x2cf261[_0x8910('0x18')]===_0x8910('0x17');var _0x514031=_0x5250b8['count'];var _0x174926=_0x434dd4?0x0:_0x2cf261[_0x8910('0x19')];var _0x62eb72=_0x434dd4?_0x5250b8[_0x8910('0x1a')]:_0x2cf261[_0x8910('0x19')]+_0x2cf261[_0x8910('0x18')];var _0x4808ee;if(_0x62eb72>=_0x514031){_0x62eb72=_0x514031;_0x4808ee=0xc8;}else{_0x4808ee=0xce;}_0x143665['status'](_0x4808ee);return _0x143665['set'](_0x8910('0x1b'),_0x174926+'-'+_0x62eb72+'/'+_0x514031)[_0x8910('0x1c')](_0x5250b8);}return null;};}function patchUpdates(_0x489450){return function(_0x52ab79){try{jsonpatch['apply'](_0x52ab79,_0x489450,!![]);}catch(_0x93d5ec){return BPromise['reject'](_0x93d5ec);}return _0x52ab79[_0x8910('0x1d')]();};}function saveUpdates(_0x217a2c,_0xcbb570){return function(_0x53f20b){if(_0x53f20b){return _0x53f20b[_0x8910('0x1e')](_0x217a2c)[_0x8910('0x1f')](function(_0x2fb1fa){return _0x2fb1fa;});}return null;};}function removeEntity(_0x3f3ca4,_0x42b912){return function(_0x4ac74e){if(_0x4ac74e){return _0x4ac74e[_0x8910('0x20')]()[_0x8910('0x1f')](function(){_0x3f3ca4[_0x8910('0x16')](0xcc)[_0x8910('0x15')]();});}};}function handleEntityNotFound(_0x198de8,_0x34cc1d){return function(_0x22eaa6){if(!_0x22eaa6){_0x198de8[_0x8910('0x14')](0x194);}return _0x22eaa6;};}function handleError(_0x2393d0,_0x5a5503){_0x5a5503=_0x5a5503||0x1f4;return function(_0x3f9690){logger[_0x8910('0x21')](_0x3f9690[_0x8910('0x22')]);if(_0x3f9690['name']){delete _0x3f9690[_0x8910('0x23')];}_0x2393d0[_0x8910('0x16')](_0x5a5503)[_0x8910('0x24')](_0x3f9690);};}exports[_0x8910('0x25')]=function(_0x4d95da,_0x15dd8a){var _0x589e72={},_0x3bfb4e={},_0x2ccb4c={'count':0x0,'rows':[]};var _0x182ed7=_[_0x8910('0x26')](db['CmHopperBlack'][_0x8910('0x27')],function(_0x194648){return{'name':_0x194648[_0x8910('0x28')],'type':_0x194648[_0x8910('0x29')][_0x8910('0x2a')]};});_0x3bfb4e[_0x8910('0x2b')]=_[_0x8910('0x26')](_0x182ed7,_0x8910('0x23'));_0x3bfb4e[_0x8910('0x2c')]=_[_0x8910('0x2d')](_0x4d95da[_0x8910('0x2c')]);_0x3bfb4e[_0x8910('0x2e')]=_[_0x8910('0x2f')](_0x3bfb4e[_0x8910('0x2b')],_0x3bfb4e[_0x8910('0x2c')]);_0x589e72[_0x8910('0x30')]=_['intersection'](_0x3bfb4e[_0x8910('0x2b')],qs['fields'](_0x4d95da[_0x8910('0x2c')][_0x8910('0x31')]));_0x589e72[_0x8910('0x30')]=_0x589e72[_0x8910('0x30')][_0x8910('0x32')]?_0x589e72['attributes']:_0x3bfb4e[_0x8910('0x2b')];if(!_0x4d95da['query'][_0x8910('0x33')]('nolimit')){_0x589e72[_0x8910('0x18')]=qs[_0x8910('0x18')](_0x4d95da[_0x8910('0x2c')][_0x8910('0x18')]);_0x589e72[_0x8910('0x19')]=qs['offset'](_0x4d95da[_0x8910('0x2c')]['offset']);}_0x589e72[_0x8910('0x34')]=qs[_0x8910('0x35')](_0x4d95da[_0x8910('0x2c')][_0x8910('0x35')]);_0x589e72['where']=qs[_0x8910('0x2e')](_[_0x8910('0x36')](_0x4d95da[_0x8910('0x2c')],_0x3bfb4e['filters']),_0x182ed7);if(_0x4d95da[_0x8910('0x2c')]['filter']){_0x589e72[_0x8910('0x37')]=_[_0x8910('0x38')](_0x589e72[_0x8910('0x37')],{'$or':_[_0x8910('0x26')](_0x182ed7,function(_0x12a8ec){if(_0x12a8ec[_0x8910('0x29')]!==_0x8910('0x39')){var _0x3a3334={};_0x3a3334[_0x12a8ec[_0x8910('0x23')]]={'$like':'%'+_0x4d95da['query'][_0x8910('0x3a')]+'%'};return _0x3a3334;}})});}_0x589e72=_['merge']({},_0x589e72,_0x4d95da[_0x8910('0x3b')]);var _0x371836={'where':_0x589e72[_0x8910('0x37')]};return db[_0x8910('0x3c')]['count'](_0x371836)['then'](function(_0x5345e1){_0x2ccb4c[_0x8910('0x1a')]=_0x5345e1;if(_0x4d95da[_0x8910('0x2c')]['includeAll']){_0x589e72[_0x8910('0x3d')]=[{'all':!![]}];}return db[_0x8910('0x3c')]['findAll'](_0x589e72);})[_0x8910('0x1f')](function(_0x2a1a47){_0x2ccb4c[_0x8910('0x3e')]=_0x2a1a47;return _0x2ccb4c;})[_0x8910('0x1f')](respondWithFilteredResult(_0x15dd8a,_0x589e72))[_0x8910('0x3f')](handleError(_0x15dd8a,null));};exports[_0x8910('0x40')]=function(_0x8eb96a,_0x316d6d){var _0xb08548={'raw':!![],'where':{'id':_0x8eb96a[_0x8910('0x41')]['id']}},_0x3ace1d={};_0x3ace1d['model']=_[_0x8910('0x2d')](db[_0x8910('0x3c')][_0x8910('0x27')]);_0x3ace1d[_0x8910('0x2c')]=_[_0x8910('0x2d')](_0x8eb96a[_0x8910('0x2c')]);_0x3ace1d[_0x8910('0x2e')]=_[_0x8910('0x2f')](_0x3ace1d['model'],_0x3ace1d[_0x8910('0x2c')]);_0xb08548[_0x8910('0x30')]=_[_0x8910('0x2f')](_0x3ace1d[_0x8910('0x2b')],qs[_0x8910('0x31')](_0x8eb96a[_0x8910('0x2c')]['fields']));_0xb08548[_0x8910('0x30')]=_0xb08548['attributes'][_0x8910('0x32')]?_0xb08548[_0x8910('0x30')]:_0x3ace1d['model'];if(_0x8eb96a[_0x8910('0x2c')]['includeAll']){_0xb08548[_0x8910('0x3d')]=[{'all':!![]}];}_0xb08548=_[_0x8910('0x38')]({},_0xb08548,_0x8eb96a[_0x8910('0x3b')]);return db[_0x8910('0x3c')][_0x8910('0x42')](_0xb08548)[_0x8910('0x1f')](handleEntityNotFound(_0x316d6d,null))[_0x8910('0x1f')](respondWithResult(_0x316d6d,null))[_0x8910('0x3f')](handleError(_0x316d6d,null));};exports[_0x8910('0x1e')]=function(_0xd0cade,_0x210510){if(_0xd0cade[_0x8910('0x43')]['id']){delete _0xd0cade[_0x8910('0x43')]['id'];}return db[_0x8910('0x3c')][_0x8910('0x42')]({'where':{'id':_0xd0cade[_0x8910('0x41')]['id']}})[_0x8910('0x1f')](handleEntityNotFound(_0x210510,null))[_0x8910('0x1f')](saveUpdates(_0xd0cade['body'],null))[_0x8910('0x1f')](respondWithResult(_0x210510,null))[_0x8910('0x3f')](handleError(_0x210510,null));};exports[_0x8910('0x20')]=function(_0x424793,_0x379caf){return db[_0x8910('0x3c')][_0x8910('0x42')]({'where':{'id':_0x424793[_0x8910('0x41')]['id']}})['then'](handleEntityNotFound(_0x379caf,null))[_0x8910('0x1f')](removeEntity(_0x379caf,null))[_0x8910('0x3f')](handleError(_0x379caf,null));};exports[_0x8910('0x44')]=function(_0x72b8a4,_0x26285f){return db[_0x8910('0x3c')][_0x8910('0x44')]()[_0x8910('0x1f')](respondWithResult(_0x26285f,null))[_0x8910('0x3f')](handleError(_0x26285f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 43a4d94..3cf8652 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 _0xe9f2=['request-promise','path','../../config/environment','exports','define','CmHopperBlack','lodash','util','api','moment'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe9f2,0x1e6));var _0x2e9f=function(_0x3be1bf,_0x1cc0ff){_0x3be1bf=_0x3be1bf-0x0;var _0x32cdeb=_0xe9f2[_0x3be1bf];return _0x32cdeb;};'use strict';var _=require(_0x2e9f('0x0'));var util=require(_0x2e9f('0x1'));var logger=require('../../config/logger')(_0x2e9f('0x2'));var moment=require(_0x2e9f('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e9f('0x4'));var fs=require('fs');var path=require(_0x2e9f('0x5'));var rimraf=require('rimraf');var config=require(_0x2e9f('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x2e9f('0x7')]=function(_0x46542c,_0x44968c){return _0x46542c[_0x2e9f('0x8')](_0x2e9f('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdeb=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x166a1f,_0x3cb8d9){var _0x8bca3c=function(_0x17bfc8){while(--_0x17bfc8){_0x166a1f['push'](_0x166a1f['shift']());}};_0x8bca3c(++_0x3cb8d9);}(_0xbdeb,0x1b4));var _0xbbde=function(_0x2f381b,_0x4bc41c){_0x2f381b=_0x2f381b-0x0;var _0x367ffc=_0xbdeb[_0x2f381b];return _0x367ffc;};'use strict';var _=require(_0xbbde('0x0'));var util=require(_0xbbde('0x1'));var logger=require(_0xbbde('0x2'))(_0xbbde('0x3'));var moment=require('moment');var BPromise=require(_0xbbde('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbde('0x5'));var rimraf=require(_0xbbde('0x6'));var config=require(_0xbbde('0x7'));var attributes=require(_0xbbde('0x8'));module[_0xbbde('0x9')]=function(_0x409297,_0x5de128){return _0x409297[_0xbbde('0xa')](_0xbbde('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 6d72ba1..991c7dd 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 _0xfe3d=['error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model','map','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34cd31,_0x110f96){var _0x2728ed=function(_0x5c0c97){while(--_0x5c0c97){_0x34cd31['push'](_0x34cd31['shift']());}};_0x2728ed(++_0x110f96);}(_0xfe3d,0x1e7));var _0xdfe3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xfe3d[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xdfe3('0x0'));var util=require(_0xdfe3('0x1'));var moment=require(_0xdfe3('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfe3('0x3'));var fs=require('fs');var Redis=require(_0xdfe3('0x4'));var db=require(_0xdfe3('0x5'))['db'];var utils=require(_0xdfe3('0x6'));var logger=require(_0xdfe3('0x7'))(_0xdfe3('0x8'));var config=require('../../config/environment');var jayson=require(_0xdfe3('0x9'));var client=jayson['client'][_0xdfe3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x258c4c,_0x561511,_0x1c5e1f){return new BPromise(function(_0x5ca2b9,_0x38c8a3){return client[_0xdfe3('0xb')](_0x258c4c,_0x1c5e1f)[_0xdfe3('0xc')](function(_0xefa59c){logger[_0xdfe3('0xd')](_0xdfe3('0xe'),_0x561511,_0xdfe3('0xf'));logger[_0xdfe3('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x561511,_0xdfe3('0xf'),JSON['stringify'](_0xefa59c));if(_0xefa59c[_0xdfe3('0x11')]){if(_0xefa59c['error']['code']===0x1f4){logger[_0xdfe3('0x11')](_0xdfe3('0xe'),_0x561511,_0xefa59c['error'][_0xdfe3('0x12')]);return _0x38c8a3(_0xefa59c[_0xdfe3('0x11')][_0xdfe3('0x12')]);}logger[_0xdfe3('0x11')](_0xdfe3('0xe'),_0x561511,_0xefa59c[_0xdfe3('0x11')][_0xdfe3('0x12')]);return _0x5ca2b9(_0xefa59c[_0xdfe3('0x11')]['message']);}else{logger[_0xdfe3('0xd')](_0xdfe3('0xe'),_0x561511,_0xdfe3('0xf'));_0x5ca2b9(_0xefa59c[_0xdfe3('0x13')]['message']);}})[_0xdfe3('0x14')](function(_0x2f0e64){logger[_0xdfe3('0x11')](_0xdfe3('0xe'),_0x561511,_0x2f0e64);_0x38c8a3(_0x2f0e64);});});}exports[_0xdfe3('0x15')]=function(_0x3d416a){var _0x1cb9e4=this;return new Promise(function(_0x4d4690,_0x2cb846){return db[_0xdfe3('0x16')]['findAll']({'raw':_0x3d416a[_0xdfe3('0x17')]?_0x3d416a[_0xdfe3('0x17')][_0xdfe3('0x18')]===undefined?!![]:![]:!![],'where':_0x3d416a[_0xdfe3('0x17')]?_0x3d416a[_0xdfe3('0x17')][_0xdfe3('0x19')]||null:null,'attributes':_0x3d416a['options']?_0x3d416a['options'][_0xdfe3('0x1a')]||null:null,'limit':_0x3d416a['options']?_0x3d416a[_0xdfe3('0x17')][_0xdfe3('0x1b')]||null:null,'include':_0x3d416a[_0xdfe3('0x17')]?_0x3d416a['options'][_0xdfe3('0x1c')]?_['map'](_0x3d416a[_0xdfe3('0x17')][_0xdfe3('0x1c')],function(_0x547be9){return{'model':db[_0x547be9[_0xdfe3('0x1d')]],'as':_0x547be9['as'],'attributes':_0x547be9['attributes'],'include':_0x547be9[_0xdfe3('0x1c')]?_[_0xdfe3('0x1e')](_0x547be9[_0xdfe3('0x1c')],function(_0x2d4f0a){return{'model':db[_0x2d4f0a[_0xdfe3('0x1d')]],'as':_0x2d4f0a['as'],'attributes':_0x2d4f0a[_0xdfe3('0x1a')],'include':_0x2d4f0a[_0xdfe3('0x1c')]?_[_0xdfe3('0x1e')](_0x2d4f0a[_0xdfe3('0x1c')],function(_0x2c812c){return{'model':db[_0x2c812c[_0xdfe3('0x1d')]],'as':_0x2c812c['as'],'attributes':_0x2c812c[_0xdfe3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xca85e4){logger[_0xdfe3('0xd')](_0xdfe3('0x15'),_0x3d416a);logger[_0xdfe3('0x10')](_0xdfe3('0x15'),_0x3d416a,JSON[_0xdfe3('0x1f')](_0xca85e4));_0x4d4690(_0xca85e4);})[_0xdfe3('0x14')](function(_0x129ef6){logger[_0xdfe3('0x11')](_0xdfe3('0x15'),_0x129ef6['message'],_0x3d416a);_0x2cb846(_0x1cb9e4[_0xdfe3('0x11')](0x1f4,_0x129ef6[_0xdfe3('0x12')]));});});};exports[_0xdfe3('0x20')]=function(_0x270a9e){var _0x1a42b9=this;return new Promise(function(_0xa8803d,_0x22ff08){return db[_0xdfe3('0x16')][_0xdfe3('0x21')](_0x270a9e[_0xdfe3('0x22')],{'raw':_0x270a9e['options']?_0x270a9e[_0xdfe3('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270a9e[_0xdfe3('0x17')]?_0x270a9e[_0xdfe3('0x17')]['where']||null:null,'attributes':_0x270a9e['options']?_0x270a9e[_0xdfe3('0x17')]['attributes']||null:null,'limit':_0x270a9e[_0xdfe3('0x17')]?_0x270a9e[_0xdfe3('0x17')][_0xdfe3('0x1b')]||null:null})[_0xdfe3('0xc')](function(_0x41ec30){logger['info']('UpdateCmHopperBlack',_0x270a9e);logger['debug'](_0xdfe3('0x20'),_0x270a9e,JSON[_0xdfe3('0x1f')](_0x41ec30));_0xa8803d(_0x41ec30);})[_0xdfe3('0x14')](function(_0x16939d){logger['error']('UpdateCmHopperBlack',_0x16939d[_0xdfe3('0x12')],_0x270a9e);_0x22ff08(_0x1a42b9[_0xdfe3('0x11')](0x1f4,_0x16939d['message']));});});};exports['DestroyCmHopperBlack']=function(_0x51904c){var _0x7ec531=this;return new Promise(function(_0x1b7368,_0x165885){return db[_0xdfe3('0x16')]['destroy']({'where':_0x51904c['options']?_0x51904c[_0xdfe3('0x17')][_0xdfe3('0x19')]||null:null})[_0xdfe3('0xc')](function(_0x42bddb){logger[_0xdfe3('0xd')]('DestroyCmHopperBlack',_0x51904c);logger['debug'](_0xdfe3('0x23'),_0x51904c,JSON[_0xdfe3('0x1f')](_0x42bddb));_0x1b7368(_0x42bddb);})['catch'](function(_0x56095c){logger[_0xdfe3('0x11')](_0xdfe3('0x23'),_0x56095c[_0xdfe3('0x12')],_0x51904c);_0x165885(_0x7ec531[_0xdfe3('0x11')](0x1f4,_0x56095c['message']));});});}; \ No newline at end of file +var _0xee40=['DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update'];(function(_0x161fad,_0x1e4319){var _0x5d2c83=function(_0x147263){while(--_0x147263){_0x161fad['push'](_0x161fad['shift']());}};_0x5d2c83(++_0x1e4319);}(_0xee40,0x77));var _0x0ee4=function(_0x1706d0,_0x57ab3b){_0x1706d0=_0x1706d0-0x0;var _0x50c75a=_0xee40[_0x1706d0];return _0x50c75a;};'use strict';var _=require(_0x0ee4('0x0'));var util=require(_0x0ee4('0x1'));var moment=require(_0x0ee4('0x2'));var BPromise=require(_0x0ee4('0x3'));var rs=require(_0x0ee4('0x4'));var fs=require('fs');var Redis=require(_0x0ee4('0x5'));var db=require(_0x0ee4('0x6'))['db'];var utils=require(_0x0ee4('0x7'));var logger=require(_0x0ee4('0x8'))(_0x0ee4('0x9'));var config=require(_0x0ee4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0ee4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x436d59,_0xb048a6,_0x47755f){return new BPromise(function(_0x376db4,_0x2df14c){return client[_0x0ee4('0xc')](_0x436d59,_0x47755f)[_0x0ee4('0xd')](function(_0x1a70f3){logger[_0x0ee4('0xe')](_0x0ee4('0xf'),_0xb048a6,_0x0ee4('0x10'));logger[_0x0ee4('0x11')](_0x0ee4('0x12'),_0xb048a6,_0x0ee4('0x10'),JSON[_0x0ee4('0x13')](_0x1a70f3));if(_0x1a70f3[_0x0ee4('0x14')]){if(_0x1a70f3[_0x0ee4('0x14')][_0x0ee4('0x15')]===0x1f4){logger[_0x0ee4('0x14')](_0x0ee4('0xf'),_0xb048a6,_0x1a70f3['error'][_0x0ee4('0x16')]);return _0x2df14c(_0x1a70f3['error'][_0x0ee4('0x16')]);}logger['error'](_0x0ee4('0xf'),_0xb048a6,_0x1a70f3[_0x0ee4('0x14')][_0x0ee4('0x16')]);return _0x376db4(_0x1a70f3[_0x0ee4('0x14')][_0x0ee4('0x16')]);}else{logger['info'](_0x0ee4('0xf'),_0xb048a6,'request\x20sent');_0x376db4(_0x1a70f3[_0x0ee4('0x17')][_0x0ee4('0x16')]);}})[_0x0ee4('0x18')](function(_0x36da68){logger[_0x0ee4('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0xb048a6,_0x36da68);_0x2df14c(_0x36da68);});});}exports[_0x0ee4('0x19')]=function(_0x3cff7c){var _0x40a1d0=this;return new Promise(function(_0x47686d,_0x8ae241){return db[_0x0ee4('0x1a')]['findAll']({'raw':_0x3cff7c[_0x0ee4('0x1b')]?_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x1c')]===undefined?!![]:![]:!![],'where':_0x3cff7c[_0x0ee4('0x1b')]?_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x1d')]||null:null,'attributes':_0x3cff7c['options']?_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x1e')]||null:null,'limit':_0x3cff7c['options']?_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x1f')]||null:null,'include':_0x3cff7c[_0x0ee4('0x1b')]?_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x20')]?_[_0x0ee4('0x21')](_0x3cff7c[_0x0ee4('0x1b')][_0x0ee4('0x20')],function(_0x24e55f){return{'model':db[_0x24e55f[_0x0ee4('0x22')]],'as':_0x24e55f['as'],'attributes':_0x24e55f[_0x0ee4('0x1e')],'include':_0x24e55f[_0x0ee4('0x20')]?_[_0x0ee4('0x21')](_0x24e55f[_0x0ee4('0x20')],function(_0x35fe5e){return{'model':db[_0x35fe5e[_0x0ee4('0x22')]],'as':_0x35fe5e['as'],'attributes':_0x35fe5e[_0x0ee4('0x1e')],'include':_0x35fe5e[_0x0ee4('0x20')]?_['map'](_0x35fe5e['include'],function(_0x3accfc){return{'model':db[_0x3accfc['model']],'as':_0x3accfc['as'],'attributes':_0x3accfc[_0x0ee4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0ee4('0xd')](function(_0xbbc314){logger['info'](_0x0ee4('0x19'),_0x3cff7c);logger['debug'](_0x0ee4('0x19'),_0x3cff7c,JSON['stringify'](_0xbbc314));_0x47686d(_0xbbc314);})['catch'](function(_0x1a4380){logger[_0x0ee4('0x14')](_0x0ee4('0x19'),_0x1a4380[_0x0ee4('0x16')],_0x3cff7c);_0x8ae241(_0x40a1d0['error'](0x1f4,_0x1a4380['message']));});});};exports[_0x0ee4('0x23')]=function(_0x4e7d10){var _0x39e668=this;return new Promise(function(_0x31d6bf,_0x15fc7a){return db[_0x0ee4('0x1a')][_0x0ee4('0x24')](_0x4e7d10['body'],{'raw':_0x4e7d10[_0x0ee4('0x1b')]?_0x4e7d10[_0x0ee4('0x1b')][_0x0ee4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7d10[_0x0ee4('0x1b')]?_0x4e7d10[_0x0ee4('0x1b')][_0x0ee4('0x1d')]||null:null,'attributes':_0x4e7d10[_0x0ee4('0x1b')]?_0x4e7d10[_0x0ee4('0x1b')][_0x0ee4('0x1e')]||null:null,'limit':_0x4e7d10[_0x0ee4('0x1b')]?_0x4e7d10[_0x0ee4('0x1b')][_0x0ee4('0x1f')]||null:null})['then'](function(_0x5450a8){logger[_0x0ee4('0xe')]('UpdateCmHopperBlack',_0x4e7d10);logger['debug'](_0x0ee4('0x23'),_0x4e7d10,JSON[_0x0ee4('0x13')](_0x5450a8));_0x31d6bf(_0x5450a8);})['catch'](function(_0x37584e){logger['error'](_0x0ee4('0x23'),_0x37584e[_0x0ee4('0x16')],_0x4e7d10);_0x15fc7a(_0x39e668[_0x0ee4('0x14')](0x1f4,_0x37584e[_0x0ee4('0x16')]));});});};exports[_0x0ee4('0x25')]=function(_0x3627e9){var _0x42e0b4=this;return new Promise(function(_0x4e51ad,_0x5a267f){return db['CmHopperBlack'][_0x0ee4('0x26')]({'where':_0x3627e9['options']?_0x3627e9[_0x0ee4('0x1b')]['where']||null:null})[_0x0ee4('0xd')](function(_0x1b0379){logger['info'](_0x0ee4('0x25'),_0x3627e9);logger['debug'](_0x0ee4('0x25'),_0x3627e9,JSON['stringify'](_0x1b0379));_0x4e51ad(_0x1b0379);})[_0x0ee4('0x18')](function(_0x4a0f46){logger['error'](_0x0ee4('0x25'),_0x4a0f46[_0x0ee4('0x16')],_0x3627e9);_0x5a267f(_0x42e0b4[_0x0ee4('0x14')](0x1f4,_0x4a0f46[_0x0ee4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b1e75be..c216c48 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 _0xc2c7=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','update','delete'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xc2c7,0x134));var _0x7c2c=function(_0xd17ed9,_0x908409){_0xd17ed9=_0xd17ed9-0x0;var _0x4d8950=_0xc2c7[_0xd17ed9];return _0x4d8950;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['put'](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);module[_0x7c2c('0x11')]=router; \ No newline at end of file +var _0x4137=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'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')]('/:id',auth[_0x7413('0xe')](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index c487f66..9850546 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 _0x058d=['diff','BOOLEAN','STRING','DATE','INTEGER','getDataValue','endtime','followuptime'];(function(_0x53976e,_0x313deb){var _0x330aae=function(_0x4bc250){while(--_0x4bc250){_0x53976e['push'](_0x53976e['shift']());}};_0x330aae(++_0x313deb);}(_0x058d,0x16a));var _0xd058=function(_0x36e855,_0x5aa495){_0x36e855=_0x36e855-0x0;var _0x2d9dd3=_0x058d[_0x36e855];return _0x2d9dd3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd058('0x0')]},'scheduledat':{'type':Sequelize[_0xd058('0x1')]},'countbusyretry':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd058('0x0')]},'originatecalleridname':{'type':Sequelize[_0xd058('0x0')]},'calleridnum':{'type':Sequelize[_0xd058('0x0')]},'calleridname':{'type':Sequelize[_0xd058('0x0')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xd058('0x1')]},'answertime':{'type':Sequelize[_0xd058('0x1')]},'droptime':{'type':Sequelize[_0xd058('0x1')]},'endtime':{'type':Sequelize[_0xd058('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd058('0x0')]},'campaign':{'type':Sequelize[_0xd058('0x0')]},'campaigntype':{'type':Sequelize[_0xd058('0x0')]},'membername':{'type':Sequelize[_0xd058('0x0')]},'reason':{'type':Sequelize[_0xd058('0x0')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd058('0x0')]},'thirdDisposition':{'type':Sequelize[_0xd058('0x0')]},'dispositionat':{'type':Sequelize[_0xd058('0x1')],'set':function(_0x253df3){var _0x26c7de=this[_0xd058('0x3')](_0xd058('0x4'));if(_0x26c7de&&_0x253df3){this['setDataValue'](_0xd058('0x5'),moment(_0x253df3)[_0xd058('0x6')](moment(_0x26c7de),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd058('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd058('0x1')]},'callback':{'type':Sequelize[_0xd058('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd058('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd058('0x1')]},'recallme':{'type':Sequelize[_0xd058('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd058('0x1')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd058('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb970=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER','getDataValue','endtime','followuptime'];(function(_0xbd6515,_0x3c9c9c){var _0x395fce=function(_0x16a156){while(--_0x16a156){_0xbd6515['push'](_0xbd6515['shift']());}};_0x395fce(++_0x3c9c9c);}(_0xb970,0x17b));var _0x0b97=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xb970[_0x5a7e78];return _0xa8d4a1;};'use strict';var Sequelize=require(_0x0b97('0x0'));var moment=require('moment');module[_0x0b97('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0b97('0x2')]},'scheduledat':{'type':Sequelize[_0x0b97('0x3')]},'countbusyretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0b97('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0b97('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0b97('0x2')]},'calleridnum':{'type':Sequelize[_0x0b97('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x0b97('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x0b97('0x3')]},'endtime':{'type':Sequelize[_0x0b97('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0b97('0x2')]},'campaign':{'type':Sequelize[_0x0b97('0x2')]},'campaigntype':{'type':Sequelize[_0x0b97('0x2')]},'membername':{'type':Sequelize[_0x0b97('0x2')]},'reason':{'type':Sequelize[_0x0b97('0x2')]},'disposition':{'type':Sequelize[_0x0b97('0x2')]},'secondDisposition':{'type':Sequelize[_0x0b97('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x0b97('0x3')],'set':function(_0x374b7b){var _0x1f8f85=this[_0x0b97('0x5')](_0x0b97('0x6'));if(_0x1f8f85&&_0x374b7b){this['setDataValue'](_0x0b97('0x7'),moment(_0x374b7b)['diff'](moment(_0x1f8f85),'seconds'));}}},'amd':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0b97('0x3')]},'callback':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x0b97('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0b97('0x3')]},'recallme':{'type':Sequelize[_0x0b97('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0b97('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index f56dc89..3a52ee4 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 _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xeda8,0x104));var _0x8eda=function(_0x53476e,_0x17122e){_0x53476e=_0x53476e-0x0;var _0x78cd63=_0xeda8[_0x53476e];return _0x78cd63;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file +var _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x687b,0x14a));var _0xb687=function(_0x19b56f,_0x4cbbd9){_0x19b56f=_0x19b56f-0x0;var _0x1e69f9=_0x687b[_0x19b56f];return _0x1e69f9;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4930573..1f1af88 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 _0x4bdc=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4bdc,0x67));var _0xc4bd=function(_0x3664e1,_0x5bce75){_0x3664e1=_0x3664e1-0x0;var _0x3a6efa=_0x4bdc[_0x3664e1];return _0x3a6efa;};'use strict';var _=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var logger=require(_0xc4bd('0x2'))(_0xc4bd('0x3'));var moment=require('moment');var BPromise=require(_0xc4bd('0x4'));var rp=require(_0xc4bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4bd('0x6'));var config=require(_0xc4bd('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0xc4bd('0x8')]=function(_0x380fe4,_0x2104d3){return _0x380fe4['define'](_0xc4bd('0x9'),attributes,{'tableName':_0xc4bd('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xc4bd('0xb')]},{'name':_0xc4bd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d2d=['./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55f75f,_0x2e9876){var _0x2487f3=function(_0x51f530){while(--_0x51f530){_0x55f75f['push'](_0x55f75f['shift']());}};_0x2487f3(++_0x2e9876);}(_0x2d2d,0x12b));var _0xd2d2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2d2d[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xd2d2('0x0'));var util=require('util');var logger=require(_0xd2d2('0x1'))(_0xd2d2('0x2'));var moment=require(_0xd2d2('0x3'));var BPromise=require(_0xd2d2('0x4'));var rp=require(_0xd2d2('0x5'));var fs=require('fs');var path=require(_0xd2d2('0x6'));var rimraf=require(_0xd2d2('0x7'));var config=require(_0xd2d2('0x8'));var attributes=require(_0xd2d2('0x9'));module[_0xd2d2('0xa')]=function(_0x2e336d,_0x380a3d){return _0x2e336d['define'](_0xd2d2('0xb'),attributes,{'tableName':_0xd2d2('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0xd2d2('0xd'),'fields':[_0xd2d2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index bf9bec1..0c03b16 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4811a5,_0x17624b){var _0x5e6219=function(_0x298fdb){while(--_0x298fdb){_0x4811a5['push'](_0x4811a5['shift']());}};_0x5e6219(++_0x17624b);}(_0x7a54,0x106));var _0x47a5=function(_0x51cff8,_0x464e27){_0x51cff8=_0x51cff8-0x0;var _0x17702b=_0x7a54[_0x51cff8];return _0x17702b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x437d67,_0x2e1a10){var _0x932353=function(_0x45c186){while(--_0x45c186){_0x437d67['push'](_0x437d67['shift']());}};_0x932353(++_0x2e1a10);}(_0x7a54,0x106));var _0x47a5=function(_0x5d6a82,_0x45c4b9){_0x5d6a82=_0x5d6a82-0x0;var _0x44eeb4=_0x7a54[_0x5d6a82];return _0x44eeb4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 9ad8622..9769993 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 _0xc2f2=['/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x8e14cd,_0x5c26c7){var _0x23d8af=function(_0x462947){while(--_0x462947){_0x8e14cd['push'](_0x8e14cd['shift']());}};_0x23d8af(++_0x5c26c7);}(_0xc2f2,0xb9));var _0x2c2f=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0xc2f2[_0x187d80];return _0x498a77;};'use strict';var multer=require(_0x2c2f('0x0'));var util=require('util');var path=require(_0x2c2f('0x1'));var timeout=require(_0x2c2f('0x2'));var express=require(_0x2c2f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2c2f('0x4'));var interaction=require(_0x2c2f('0x5'));var config=require(_0x2c2f('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x2c2f('0x7')]('/',auth[_0x2c2f('0x8')](),controller[_0x2c2f('0x9')]);router['get']('/describe',auth[_0x2c2f('0x8')](),controller[_0x2c2f('0xa')]);router['get'](_0x2c2f('0xb'),auth[_0x2c2f('0x8')](),controller[_0x2c2f('0xc')]);router[_0x2c2f('0x7')](_0x2c2f('0xd'),auth[_0x2c2f('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x2c2f('0xe')]);router[_0x2c2f('0xf')](_0x2c2f('0x10'),auth[_0x2c2f('0x8')](),controller[_0x2c2f('0x11')]);router[_0x2c2f('0xf')]('/voice/campaign/moveContacts/:id',auth[_0x2c2f('0x8')](),controller[_0x2c2f('0x12')]);router[_0x2c2f('0xf')](_0x2c2f('0x13'),auth[_0x2c2f('0x8')](),controller[_0x2c2f('0x14')]);router[_0x2c2f('0x15')](_0x2c2f('0xb'),auth[_0x2c2f('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xd07e=['update','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x15d9c9,_0x33ea68){var _0xd8ef55=function(_0xcbc418){while(--_0xcbc418){_0x15d9c9['push'](_0x15d9c9['shift']());}};_0xd8ef55(++_0x33ea68);}(_0xd07e,0x80));var _0xed07=function(_0x55145b,_0x20855a){_0x55145b=_0x55145b-0x0;var _0x410d46=_0xd07e[_0x55145b];return _0x410d46;};'use strict';var multer=require('multer');var util=require(_0xed07('0x0'));var path=require('path');var timeout=require(_0xed07('0x1'));var express=require('express');var router=express[_0xed07('0x2')]();var fs_extra=require(_0xed07('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xed07('0x4'));var config=require(_0xed07('0x5'));var controller=require(_0xed07('0x6'));router[_0xed07('0x7')]('/',auth[_0xed07('0x8')](),controller['index']);router[_0xed07('0x7')](_0xed07('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xed07('0x7')](_0xed07('0xa'),auth[_0xed07('0x8')](),controller[_0xed07('0xb')]);router[_0xed07('0x7')](_0xed07('0xc'),auth[_0xed07('0x8')](),controller[_0xed07('0xd')]);router[_0xed07('0x7')](_0xed07('0xe'),auth[_0xed07('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xed07('0xf')](_0xed07('0x10'),auth[_0xed07('0x8')](),controller[_0xed07('0x11')]);router[_0xed07('0xf')](_0xed07('0x12'),auth[_0xed07('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xed07('0xf')]('/checkContactHopper',auth[_0xed07('0x8')](),controller['checkContactHopper']);router['put']('/:id',auth[_0xed07('0x8')](),controller[_0xed07('0x13')]);module[_0xed07('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 76fe5ef..898ad43 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 _0xc033=['BOOLEAN','sequelize','exports','DATE','INTEGER','STRING'];(function(_0x5434e5,_0x166613){var _0x656ff8=function(_0x120744){while(--_0x120744){_0x5434e5['push'](_0x5434e5['shift']());}};_0x656ff8(++_0x166613);}(_0xc033,0xd3));var _0x3c03=function(_0x37586b,_0x138bec){_0x37586b=_0x37586b-0x0;var _0x57a956=_0xc033[_0x37586b];return _0x57a956;};'use strict';var Sequelize=require(_0x3c03('0x0'));module[_0x3c03('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3c03('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3c03('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x3c03('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3c03('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3c03('0x2')]},'responsetime':{'type':Sequelize[_0x3c03('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3c03('0x2')]},'endtime':{'type':Sequelize[_0x3c03('0x2')]},'ringtime':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3c03('0x4')]},'campaign':{'type':Sequelize[_0x3c03('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3c03('0x4')]},'reason':{'type':Sequelize[_0x3c03('0x4')]},'amd':{'type':Sequelize[_0x3c03('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3c03('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3c03('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c03('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3c03('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x3c03('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3c03('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3c03('0x4')]}}; \ No newline at end of file +var _0xb22e=['INTEGER','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x437ec5,_0x357a51){var _0x3a5f07=function(_0x5d5f07){while(--_0x5d5f07){_0x437ec5['push'](_0x437ec5['shift']());}};_0x3a5f07(++_0x357a51);}(_0xb22e,0x87));var _0xeb22=function(_0x2d2c46,_0x2c25a0){_0x2d2c46=_0x2d2c46-0x0;var _0x100b0c=_0xb22e[_0x2d2c46];return _0x100b0c;};'use strict';var Sequelize=require(_0xeb22('0x0'));module[_0xeb22('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xeb22('0x2')]},'countbusyretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xeb22('0x4')]},'calleridnum':{'type':Sequelize[_0xeb22('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xeb22('0x2')]},'droptime':{'type':Sequelize[_0xeb22('0x2')]},'endtime':{'type':Sequelize[_0xeb22('0x2')]},'ringtime':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb22('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xeb22('0x4')]},'membername':{'type':Sequelize[_0xeb22('0x4')]},'reason':{'type':Sequelize[_0xeb22('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xeb22('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb22('0x2')]},'recallme':{'type':Sequelize[_0xeb22('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xeb22('0x2')]},'edited':{'type':Sequelize[_0xeb22('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb22('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xeb22('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index ffffbd0..42662a7 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 _0xd3b9=['rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','uniqueid','eml-format'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xd3b9,0x1c7));var _0x9d3b=function(_0x1901f3,_0x2c020b){_0x1901f3=_0x1901f3-0x0;var _0x27bf9d=_0xd3b9[_0x1901f3];return _0x27bf9d;};'use strict';var emlformat=require(_0x9d3b('0x0'));var rimraf=require(_0x9d3b('0x1'));var zipdir=require(_0x9d3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d3b('0x3'));var moment=require('moment');var BPromise=require(_0x9d3b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9d3b('0x5'));var sox=require('sox');var csv=require(_0x9d3b('0x6'));var ejs=require(_0x9d3b('0x7'));var fs=require('fs');var fs_extra=require(_0x9d3b('0x8'));var _=require('lodash');var squel=require(_0x9d3b('0x9'));var crypto=require(_0x9d3b('0xa'));var jsforce=require(_0x9d3b('0xb'));var deskjs=require(_0x9d3b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d3b('0xd'));var Redis=require('ioredis');var authService=require(_0x9d3b('0xe'));var qs=require(_0x9d3b('0xf'));var as=require(_0x9d3b('0x10'));var hardwareService=require(_0x9d3b('0x11'));var logger=require(_0x9d3b('0x12'))(_0x9d3b('0x13'));var utils=require(_0x9d3b('0x14'));var config=require(_0x9d3b('0x15'));var licenseUtil=require(_0x9d3b('0x16'));var db=require(_0x9d3b('0x17'))['db'];function respondWithStatusCode(_0x24b3a1,_0x3dafa1){_0x3dafa1=_0x3dafa1||0xcc;return function(_0x4d372e){if(_0x4d372e){return _0x24b3a1['sendStatus'](_0x3dafa1);}return _0x24b3a1[_0x9d3b('0x18')](_0x3dafa1)[_0x9d3b('0x19')]();};}function respondWithResult(_0x5e201e,_0x4848e7){_0x4848e7=_0x4848e7||0xc8;return function(_0x39b353){if(_0x39b353){return _0x5e201e[_0x9d3b('0x18')](_0x4848e7)['json'](_0x39b353);}};}function respondWithFilteredResult(_0x5cc18b,_0xc69306){return function(_0x3e04cd){if(_0x3e04cd){var _0x1207f8=typeof _0xc69306[_0x9d3b('0x1a')]===_0x9d3b('0x1b')&&typeof _0xc69306[_0x9d3b('0x1c')]===_0x9d3b('0x1b');var _0x1e3580=_0x3e04cd[_0x9d3b('0x1d')];var _0x157eed=_0x1207f8?0x0:_0xc69306[_0x9d3b('0x1a')];var _0x156aa1=_0x1207f8?_0x3e04cd[_0x9d3b('0x1d')]:_0xc69306['offset']+_0xc69306['limit'];var _0x371bb3;if(_0x156aa1>=_0x1e3580){_0x156aa1=_0x1e3580;_0x371bb3=0xc8;}else{_0x371bb3=0xce;}_0x5cc18b['status'](_0x371bb3);return _0x5cc18b[_0x9d3b('0x1e')](_0x9d3b('0x1f'),_0x157eed+'-'+_0x156aa1+'/'+_0x1e3580)[_0x9d3b('0x20')](_0x3e04cd);}return null;};}function patchUpdates(_0x2d1e36){return function(_0x52bda3){try{jsonpatch[_0x9d3b('0x21')](_0x52bda3,_0x2d1e36,!![]);}catch(_0x7eb902){return BPromise['reject'](_0x7eb902);}return _0x52bda3[_0x9d3b('0x22')]();};}function saveUpdates(_0x863e82,_0x586a1b){return function(_0x1f8273){if(_0x1f8273){return _0x1f8273[_0x9d3b('0x23')](_0x863e82)[_0x9d3b('0x24')](function(_0x5c1627){return _0x5c1627;});}return null;};}function removeEntity(_0x47f247,_0xe4d640){return function(_0x51a31c){if(_0x51a31c){return _0x51a31c[_0x9d3b('0x25')]()[_0x9d3b('0x24')](function(){_0x47f247[_0x9d3b('0x18')](0xcc)[_0x9d3b('0x19')]();});}};}function handleEntityNotFound(_0x496773,_0x5a72e7){return function(_0x1c5c01){if(!_0x1c5c01){_0x496773[_0x9d3b('0x26')](0x194);}return _0x1c5c01;};}function handleError(_0x235910,_0xd15367){_0xd15367=_0xd15367||0x1f4;return function(_0x595eca){logger[_0x9d3b('0x27')](_0x595eca[_0x9d3b('0x28')]);if(_0x595eca[_0x9d3b('0x29')]){delete _0x595eca[_0x9d3b('0x29')];}_0x235910[_0x9d3b('0x18')](_0xd15367)[_0x9d3b('0x2a')](_0x595eca);};}exports[_0x9d3b('0x2b')]=function(_0x292d7f,_0x1aea3b){var _0x5cb05e={},_0x34bcec={},_0xd9d6f8={'count':0x0,'rows':[]};var _0x33f1e1=_[_0x9d3b('0x2c')](db[_0x9d3b('0x2d')]['rawAttributes'],function(_0x31fccc){return{'name':_0x31fccc['fieldName'],'type':_0x31fccc['type'][_0x9d3b('0x2e')]};});_0x34bcec[_0x9d3b('0x2f')]=_[_0x9d3b('0x2c')](_0x33f1e1,_0x9d3b('0x29'));_0x34bcec[_0x9d3b('0x30')]=_[_0x9d3b('0x31')](_0x292d7f[_0x9d3b('0x30')]);_0x34bcec[_0x9d3b('0x32')]=_[_0x9d3b('0x33')](_0x34bcec[_0x9d3b('0x2f')],_0x34bcec[_0x9d3b('0x30')]);_0x5cb05e['attributes']=_[_0x9d3b('0x33')](_0x34bcec[_0x9d3b('0x2f')],qs[_0x9d3b('0x34')](_0x292d7f[_0x9d3b('0x30')]['fields']));_0x5cb05e[_0x9d3b('0x35')]=_0x5cb05e[_0x9d3b('0x35')][_0x9d3b('0x36')]?_0x5cb05e[_0x9d3b('0x35')]:_0x34bcec[_0x9d3b('0x2f')];if(!_0x292d7f[_0x9d3b('0x30')][_0x9d3b('0x37')](_0x9d3b('0x38'))){_0x5cb05e[_0x9d3b('0x1c')]=qs['limit'](_0x292d7f[_0x9d3b('0x30')]['limit']);_0x5cb05e[_0x9d3b('0x1a')]=qs[_0x9d3b('0x1a')](_0x292d7f['query'][_0x9d3b('0x1a')]);}_0x5cb05e[_0x9d3b('0x39')]=qs[_0x9d3b('0x3a')](_0x292d7f[_0x9d3b('0x30')][_0x9d3b('0x3a')]);_0x5cb05e['where']=qs[_0x9d3b('0x32')](_['pick'](_0x292d7f[_0x9d3b('0x30')],_0x34bcec[_0x9d3b('0x32')]),_0x33f1e1);if(_0x292d7f[_0x9d3b('0x30')][_0x9d3b('0x3b')]){_0x5cb05e[_0x9d3b('0x3c')]=_[_0x9d3b('0x3d')](_0x5cb05e[_0x9d3b('0x3c')],{'$or':_['map'](_0x33f1e1,function(_0x46468d){if(_0x46468d[_0x9d3b('0x3e')]!==_0x9d3b('0x3f')){var _0xd97453={};_0xd97453[_0x46468d[_0x9d3b('0x29')]]={'$like':'%'+_0x292d7f[_0x9d3b('0x30')][_0x9d3b('0x3b')]+'%'};return _0xd97453;}})});}_0x5cb05e=_['merge']({},_0x5cb05e,_0x292d7f[_0x9d3b('0x40')]);var _0x40dd91={'where':_0x5cb05e['where']};return db['CmHopperHistory'][_0x9d3b('0x1d')](_0x40dd91)[_0x9d3b('0x24')](function(_0x43e031){_0xd9d6f8[_0x9d3b('0x1d')]=_0x43e031;if(_0x292d7f[_0x9d3b('0x30')][_0x9d3b('0x41')]){_0x5cb05e[_0x9d3b('0x42')]=[{'all':!![]}];}return db[_0x9d3b('0x2d')][_0x9d3b('0x43')](_0x5cb05e);})[_0x9d3b('0x24')](function(_0x4d0961){_0xd9d6f8[_0x9d3b('0x44')]=_0x4d0961;return _0xd9d6f8;})[_0x9d3b('0x24')](respondWithFilteredResult(_0x1aea3b,_0x5cb05e))['catch'](handleError(_0x1aea3b,null));};exports['show']=function(_0x34aecd,_0x8227cb){var _0x156ac8={'raw':!![],'where':{'id':_0x34aecd[_0x9d3b('0x45')]['id']}},_0x17eaed={};_0x17eaed[_0x9d3b('0x2f')]=_[_0x9d3b('0x31')](db[_0x9d3b('0x2d')]['rawAttributes']);_0x17eaed['query']=_[_0x9d3b('0x31')](_0x34aecd['query']);_0x17eaed['filters']=_[_0x9d3b('0x33')](_0x17eaed[_0x9d3b('0x2f')],_0x17eaed[_0x9d3b('0x30')]);_0x156ac8[_0x9d3b('0x35')]=_[_0x9d3b('0x33')](_0x17eaed['model'],qs[_0x9d3b('0x34')](_0x34aecd[_0x9d3b('0x30')]['fields']));_0x156ac8[_0x9d3b('0x35')]=_0x156ac8[_0x9d3b('0x35')]['length']?_0x156ac8['attributes']:_0x17eaed[_0x9d3b('0x2f')];if(_0x34aecd['query']['includeAll']){_0x156ac8[_0x9d3b('0x42')]=[{'all':!![]}];}_0x156ac8=_['merge']({},_0x156ac8,_0x34aecd['options']);return db[_0x9d3b('0x2d')][_0x9d3b('0x46')](_0x156ac8)[_0x9d3b('0x24')](handleEntityNotFound(_0x8227cb,null))['then'](respondWithResult(_0x8227cb,null))[_0x9d3b('0x47')](handleError(_0x8227cb,null));};exports[_0x9d3b('0x48')]=function(_0xb2565b,_0x3a9d70){return db[_0x9d3b('0x2d')]['create'](_0xb2565b[_0x9d3b('0x49')],{})[_0x9d3b('0x24')](respondWithResult(_0x3a9d70,0xc9))[_0x9d3b('0x47')](handleError(_0x3a9d70,null));};exports[_0x9d3b('0x4a')]=function(_0x1e6753,_0x23d861){return db['CmHopperHistory']['describe']()[_0x9d3b('0x24')](respondWithResult(_0x23d861,null))['catch'](handleError(_0x23d861,null));};exports[_0x9d3b('0x23')]=function(_0x1fcfa2,_0x270612){if(_0x1fcfa2['body']['uniqueid']){delete _0x1fcfa2['body'][_0x9d3b('0x4b')];}return db[_0x9d3b('0x2d')][_0x9d3b('0x46')]({'where':{'uniqueid':_0x1fcfa2[_0x9d3b('0x45')]['id']}})[_0x9d3b('0x24')](handleEntityNotFound(_0x270612,null))['then'](saveUpdates(_0x1fcfa2[_0x9d3b('0x49')],null))[_0x9d3b('0x24')](respondWithResult(_0x270612,null))['catch'](handleError(_0x270612,null));}; \ No newline at end of file +var _0x4ac1=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','CmHopperHistory','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x4ac1,0x141));var _0x14ac=function(_0x36bc39,_0x4ff6ae){_0x36bc39=_0x36bc39-0x0;var _0x3ad777=_0x4ac1[_0x36bc39];return _0x3ad777;};'use strict';var emlformat=require(_0x14ac('0x0'));var rimraf=require(_0x14ac('0x1'));var zipdir=require(_0x14ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14ac('0x3'));var moment=require(_0x14ac('0x4'));var BPromise=require(_0x14ac('0x5'));var Mustache=require(_0x14ac('0x6'));var util=require(_0x14ac('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x14ac('0x8'));var ejs=require(_0x14ac('0x9'));var fs=require('fs');var fs_extra=require(_0x14ac('0xa'));var _=require(_0x14ac('0xb'));var squel=require('squel');var crypto=require(_0x14ac('0xc'));var jsforce=require(_0x14ac('0xd'));var deskjs=require(_0x14ac('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x14ac('0xf'));var authService=require(_0x14ac('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x14ac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14ac('0x12'))(_0x14ac('0x13'));var utils=require(_0x14ac('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x14ac('0x15'));var db=require(_0x14ac('0x16'))['db'];function respondWithStatusCode(_0x1f0cc8,_0x400a5f){_0x400a5f=_0x400a5f||0xcc;return function(_0x6bd3d9){if(_0x6bd3d9){return _0x1f0cc8[_0x14ac('0x17')](_0x400a5f);}return _0x1f0cc8[_0x14ac('0x18')](_0x400a5f)[_0x14ac('0x19')]();};}function respondWithResult(_0x49b897,_0x5a304e){_0x5a304e=_0x5a304e||0xc8;return function(_0x3a660e){if(_0x3a660e){return _0x49b897[_0x14ac('0x18')](_0x5a304e)[_0x14ac('0x1a')](_0x3a660e);}};}function respondWithFilteredResult(_0x717a88,_0x267229){return function(_0x26f9ca){if(_0x26f9ca){var _0x286538=typeof _0x267229['offset']===_0x14ac('0x1b')&&typeof _0x267229['limit']===_0x14ac('0x1b');var _0x59cb24=_0x26f9ca[_0x14ac('0x1c')];var _0x2a8199=_0x286538?0x0:_0x267229['offset'];var _0xf67616=_0x286538?_0x26f9ca['count']:_0x267229[_0x14ac('0x1d')]+_0x267229[_0x14ac('0x1e')];var _0x19d103;if(_0xf67616>=_0x59cb24){_0xf67616=_0x59cb24;_0x19d103=0xc8;}else{_0x19d103=0xce;}_0x717a88[_0x14ac('0x18')](_0x19d103);return _0x717a88[_0x14ac('0x1f')](_0x14ac('0x20'),_0x2a8199+'-'+_0xf67616+'/'+_0x59cb24)[_0x14ac('0x1a')](_0x26f9ca);}return null;};}function patchUpdates(_0x870845){return function(_0x3802e9){try{jsonpatch['apply'](_0x3802e9,_0x870845,!![]);}catch(_0x52db2c){return BPromise[_0x14ac('0x21')](_0x52db2c);}return _0x3802e9[_0x14ac('0x22')]();};}function saveUpdates(_0x25f6a4,_0x2e3a32){return function(_0x5fc091){if(_0x5fc091){return _0x5fc091[_0x14ac('0x23')](_0x25f6a4)[_0x14ac('0x24')](function(_0xd92744){return _0xd92744;});}return null;};}function removeEntity(_0xb99a6a,_0x2491e1){return function(_0x28626f){if(_0x28626f){return _0x28626f[_0x14ac('0x25')]()[_0x14ac('0x24')](function(){_0xb99a6a[_0x14ac('0x18')](0xcc)[_0x14ac('0x19')]();});}};}function handleEntityNotFound(_0x536fc2,_0x5f4377){return function(_0x1156be){if(!_0x1156be){_0x536fc2[_0x14ac('0x17')](0x194);}return _0x1156be;};}function handleError(_0x3d4fcf,_0x426f48){_0x426f48=_0x426f48||0x1f4;return function(_0x45e1f0){logger[_0x14ac('0x26')](_0x45e1f0[_0x14ac('0x27')]);if(_0x45e1f0[_0x14ac('0x28')]){delete _0x45e1f0[_0x14ac('0x28')];}_0x3d4fcf[_0x14ac('0x18')](_0x426f48)['send'](_0x45e1f0);};}exports[_0x14ac('0x29')]=function(_0x6abaad,_0x3bb11b){var _0xd9977c={},_0x2f1281={},_0x58fbac={'count':0x0,'rows':[]};var _0x312ab4=_['map'](db[_0x14ac('0x2a')]['rawAttributes'],function(_0xf85fcc){return{'name':_0xf85fcc['fieldName'],'type':_0xf85fcc[_0x14ac('0x2b')][_0x14ac('0x2c')]};});_0x2f1281[_0x14ac('0x2d')]=_[_0x14ac('0x2e')](_0x312ab4,_0x14ac('0x28'));_0x2f1281[_0x14ac('0x2f')]=_[_0x14ac('0x30')](_0x6abaad[_0x14ac('0x2f')]);_0x2f1281[_0x14ac('0x31')]=_[_0x14ac('0x32')](_0x2f1281[_0x14ac('0x2d')],_0x2f1281[_0x14ac('0x2f')]);_0xd9977c['attributes']=_['intersection'](_0x2f1281[_0x14ac('0x2d')],qs[_0x14ac('0x33')](_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x33')]));_0xd9977c[_0x14ac('0x34')]=_0xd9977c[_0x14ac('0x34')][_0x14ac('0x35')]?_0xd9977c[_0x14ac('0x34')]:_0x2f1281['model'];if(!_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x36')](_0x14ac('0x37'))){_0xd9977c['limit']=qs[_0x14ac('0x1e')](_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x1e')]);_0xd9977c[_0x14ac('0x1d')]=qs[_0x14ac('0x1d')](_0x6abaad[_0x14ac('0x2f')]['offset']);}_0xd9977c[_0x14ac('0x38')]=qs[_0x14ac('0x39')](_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x39')]);_0xd9977c['where']=qs[_0x14ac('0x31')](_[_0x14ac('0x3a')](_0x6abaad[_0x14ac('0x2f')],_0x2f1281[_0x14ac('0x31')]),_0x312ab4);if(_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x3b')]){_0xd9977c[_0x14ac('0x3c')]=_['merge'](_0xd9977c[_0x14ac('0x3c')],{'$or':_[_0x14ac('0x2e')](_0x312ab4,function(_0x5838f1){if(_0x5838f1[_0x14ac('0x2b')]!==_0x14ac('0x3d')){var _0x2f7f3c={};_0x2f7f3c[_0x5838f1[_0x14ac('0x28')]]={'$like':'%'+_0x6abaad['query'][_0x14ac('0x3b')]+'%'};return _0x2f7f3c;}})});}_0xd9977c=_[_0x14ac('0x3e')]({},_0xd9977c,_0x6abaad[_0x14ac('0x3f')]);var _0x3af6c9={'where':_0xd9977c['where']};return db[_0x14ac('0x2a')]['count'](_0x3af6c9)[_0x14ac('0x24')](function(_0x33d4b9){_0x58fbac[_0x14ac('0x1c')]=_0x33d4b9;if(_0x6abaad[_0x14ac('0x2f')][_0x14ac('0x40')]){_0xd9977c[_0x14ac('0x41')]=[{'all':!![]}];}return db[_0x14ac('0x2a')][_0x14ac('0x42')](_0xd9977c);})[_0x14ac('0x24')](function(_0x1faf19){_0x58fbac[_0x14ac('0x43')]=_0x1faf19;return _0x58fbac;})['then'](respondWithFilteredResult(_0x3bb11b,_0xd9977c))[_0x14ac('0x44')](handleError(_0x3bb11b,null));};exports[_0x14ac('0x45')]=function(_0xfb501a,_0x256ce2){var _0xdfb8f1={'raw':!![],'where':{'id':_0xfb501a[_0x14ac('0x46')]['id']}},_0x48b228={};_0x48b228[_0x14ac('0x2d')]=_[_0x14ac('0x30')](db['CmHopperHistory'][_0x14ac('0x47')]);_0x48b228[_0x14ac('0x2f')]=_[_0x14ac('0x30')](_0xfb501a[_0x14ac('0x2f')]);_0x48b228[_0x14ac('0x31')]=_['intersection'](_0x48b228[_0x14ac('0x2d')],_0x48b228[_0x14ac('0x2f')]);_0xdfb8f1['attributes']=_[_0x14ac('0x32')](_0x48b228[_0x14ac('0x2d')],qs[_0x14ac('0x33')](_0xfb501a['query'][_0x14ac('0x33')]));_0xdfb8f1[_0x14ac('0x34')]=_0xdfb8f1[_0x14ac('0x34')][_0x14ac('0x35')]?_0xdfb8f1[_0x14ac('0x34')]:_0x48b228['model'];if(_0xfb501a[_0x14ac('0x2f')][_0x14ac('0x40')]){_0xdfb8f1[_0x14ac('0x41')]=[{'all':!![]}];}_0xdfb8f1=_['merge']({},_0xdfb8f1,_0xfb501a[_0x14ac('0x3f')]);return db[_0x14ac('0x2a')][_0x14ac('0x48')](_0xdfb8f1)['then'](handleEntityNotFound(_0x256ce2,null))[_0x14ac('0x24')](respondWithResult(_0x256ce2,null))[_0x14ac('0x44')](handleError(_0x256ce2,null));};exports[_0x14ac('0x49')]=function(_0x384137,_0x1adf54){return db[_0x14ac('0x2a')][_0x14ac('0x49')](_0x384137[_0x14ac('0x4a')],{})[_0x14ac('0x24')](respondWithResult(_0x1adf54,0xc9))[_0x14ac('0x44')](handleError(_0x1adf54,null));};exports['describe']=function(_0x4e43db,_0x3d3ed8){return db[_0x14ac('0x2a')][_0x14ac('0x4b')]()['then'](respondWithResult(_0x3d3ed8,null))[_0x14ac('0x44')](handleError(_0x3d3ed8,null));};exports[_0x14ac('0x23')]=function(_0x7efacc,_0x222dd3){if(_0x7efacc[_0x14ac('0x4a')]['uniqueid']){delete _0x7efacc[_0x14ac('0x4a')][_0x14ac('0x4c')];}return db[_0x14ac('0x2a')][_0x14ac('0x48')]({'where':{'uniqueid':_0x7efacc[_0x14ac('0x46')]['id']}})[_0x14ac('0x24')](handleEntityNotFound(_0x222dd3,null))[_0x14ac('0x24')](saveUpdates(_0x7efacc['body'],null))[_0x14ac('0x24')](respondWithResult(_0x222dd3,null))[_0x14ac('0x44')](handleError(_0x222dd3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0786152..178d6f3 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 _0xf4c9=['moment','request-promise','path','rimraf','./cmHopperHistory.attributes','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf4c9[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var logger=require(_0x9f4c('0x2'))('api');var moment=require(_0x9f4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f4c('0x4'));var fs=require('fs');var path=require(_0x9f4c('0x5'));var rimraf=require(_0x9f4c('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f4c('0x7'));module['exports']=function(_0x42cd40,_0x48dc53){return _0x42cd40['define']('CmHopperHistory',attributes,{'tableName':_0x9f4c('0x8'),'paranoid':![],'indexes':[{'name':_0x9f4c('0x9'),'fields':[_0x9f4c('0x9')]},{'name':_0x9f4c('0xa'),'fields':[_0x9f4c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5c8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','../../config/logger','api'];(function(_0x429544,_0x45613e){var _0x222ea5=function(_0x26dd13){while(--_0x26dd13){_0x429544['push'](_0x429544['shift']());}};_0x222ea5(++_0x45613e);}(_0xd5c8,0x166));var _0x8d5c=function(_0x412818,_0xe8171a){_0x412818=_0x412818-0x0;var _0x2d40d1=_0xd5c8[_0x412818];return _0x2d40d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d5c('0x0'))(_0x8d5c('0x1'));var moment=require(_0x8d5c('0x2'));var BPromise=require(_0x8d5c('0x3'));var rp=require(_0x8d5c('0x4'));var fs=require('fs');var path=require(_0x8d5c('0x5'));var rimraf=require(_0x8d5c('0x6'));var config=require(_0x8d5c('0x7'));var attributes=require(_0x8d5c('0x8'));module['exports']=function(_0xd72ba3,_0x5d3fff){return _0xd72ba3['define'](_0x8d5c('0x9'),attributes,{'tableName':_0x8d5c('0xa'),'paranoid':![],'indexes':[{'name':_0x8d5c('0xb'),'fields':[_0x8d5c('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 973b4b6..79ab741 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 _0xf958=['`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','AvgHandleTime','findAll','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null'];(function(_0x4aa902,_0xc6d1b4){var _0x2ec26f=function(_0x17f614){while(--_0x17f614){_0x4aa902['push'](_0x4aa902['shift']());}};_0x2ec26f(++_0xc6d1b4);}(_0xf958,0xe6));var _0x8f95=function(_0x2c4caa,_0x1a6deb){_0x2c4caa=_0x2c4caa-0x0;var _0x4625a5=_0xf958[_0x2c4caa];return _0x4625a5;};'use strict';var _=require(_0x8f95('0x0'));var util=require('util');var moment=require(_0x8f95('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x3'))['db'];var utils=require(_0x8f95('0x4'));var logger=require(_0x8f95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f95('0x6'));var client=jayson[_0x8f95('0x7')][_0x8f95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2af8,_0x5cfc04,_0x1ae9c4){return new BPromise(function(_0x109bed,_0x435b5b){return client[_0x8f95('0x9')](_0x5c2af8,_0x1ae9c4)[_0x8f95('0xa')](function(_0x585025){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5cfc04,'request\x20sent');logger[_0x8f95('0xd')](_0x8f95('0xe'),_0x5cfc04,_0x8f95('0xf'),JSON['stringify'](_0x585025));if(_0x585025[_0x8f95('0x10')]){if(_0x585025[_0x8f95('0x10')][_0x8f95('0x11')]===0x1f4){logger['error'](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x435b5b(_0x585025['error'][_0x8f95('0x12')]);}logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x109bed(_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x5cfc04,'request\x20sent');_0x109bed(_0x585025['result']['message']);}})[_0x8f95('0x13')](function(_0x2f01cd){logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x2f01cd);_0x435b5b(_0x2f01cd);});});}exports['CreateCmHopperHistory']=function(_0x5da758){var _0x14d21f=this;return new Promise(function(_0x17b85b,_0x55ba7f){return db[_0x8f95('0x14')][_0x8f95('0x15')](_0x5da758[_0x8f95('0x16')],{'raw':_0x5da758[_0x8f95('0x17')]?_0x5da758['options'][_0x8f95('0x18')]===undefined?!![]:![]:!![]})[_0x8f95('0xa')](function(_0x2b90bf){logger[_0x8f95('0xb')]('CreateCmHopperHistory',_0x5da758);logger['debug'](_0x8f95('0x19'),_0x5da758,JSON[_0x8f95('0x1a')](_0x2b90bf));_0x17b85b(_0x2b90bf);})[_0x8f95('0x13')](function(_0x1c7a29){logger[_0x8f95('0x10')]('CreateCmHopperHistory',_0x1c7a29[_0x8f95('0x12')],_0x5da758);_0x55ba7f(_0x14d21f[_0x8f95('0x10')](0x1f4,_0x1c7a29['message']));});});};exports[_0x8f95('0x1b')]=function(_0x284eb7){var _0x4da2ea=this;return new Promise(function(_0x28d48b,_0x4c96eb){return db[_0x8f95('0x14')][_0x8f95('0x1c')]({'raw':_0x284eb7['options']?_0x284eb7[_0x8f95('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x284eb7['options']?_0x284eb7[_0x8f95('0x17')]['where']||null:null,'attributes':[[db[_0x8f95('0x1d')]['fn']('COUNT',db['sequelize'][_0x8f95('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db[_0x8f95('0x1d')]['fn']('COUNT',db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x20')))),_0x8f95('0x21')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8f95('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x8f95('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x25')))),_0x8f95('0x26')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x27'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x8f95('0xa')](function(_0x53e273){logger[_0x8f95('0xb')](_0x8f95('0x1b'),_0x284eb7);logger[_0x8f95('0xd')](_0x8f95('0x1b'),_0x284eb7,JSON['stringify'](_0x53e273));_0x28d48b(_0x53e273);})[_0x8f95('0x13')](function(_0xe5ad99){logger[_0x8f95('0x10')]('AvgHandleTime',_0xe5ad99['message'],_0x284eb7);_0x4c96eb(_0x4da2ea[_0x8f95('0x10')](0x1f4,_0xe5ad99[_0x8f95('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2c21c2){var _0x17071c=this;return new Promise(function(_0x26843d,_0x21391f){return db[_0x8f95('0x14')][_0x8f95('0x1c')]({'raw':_0x2c21c2[_0x8f95('0x17')]?_0x2c21c2[_0x8f95('0x17')][_0x8f95('0x18')]===undefined?!![]:![]:!![],'where':_0x2c21c2[_0x8f95('0x17')]?_0x2c21c2[_0x8f95('0x17')][_0x8f95('0x29')]||null:null,'attributes':[[_0x8f95('0x2a'),_0x8f95('0x2b')],[db['sequelize']['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x2c')))),_0x8f95('0x2d')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x2e')))),_0x8f95('0x2f')],[db[_0x8f95('0x1d')]['fn']('COUNT',db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x20')))),_0x8f95('0x30')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db['sequelize'][_0x8f95('0x1f')](_0x8f95('0x31')))),_0x8f95('0x32')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db['sequelize'][_0x8f95('0x1f')](_0x8f95('0x33')))),_0x8f95('0x34')],[db[_0x8f95('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8f95('0x1f')](_0x8f95('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x8f95('0x1d')]['fn']('COUNT',db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')]['literal'](_0x8f95('0x36')))),_0x8f95('0x37')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x38')))),_0x8f95('0x39')],[db[_0x8f95('0x1d')]['fn']('COUNT',db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x3a')))),_0x8f95('0x3b')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x3c')))),_0x8f95('0x3d')],[db['sequelize']['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x3e')))),_0x8f95('0x3f')],[db[_0x8f95('0x1d')]['fn']('COUNT',db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')](_0x8f95('0x40')))),_0x8f95('0x41')],[db['sequelize']['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')][_0x8f95('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),_0x8f95('0x3f')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db['sequelize'][_0x8f95('0x1f')](_0x8f95('0x42')))),_0x8f95('0x43')]],'group':[_0x8f95('0x2a')]})[_0x8f95('0xa')](function(_0x43b175){logger[_0x8f95('0xb')](_0x8f95('0x44'),_0x2c21c2);logger[_0x8f95('0xd')](_0x8f95('0x44'),_0x2c21c2,JSON[_0x8f95('0x1a')](_0x43b175));_0x26843d(_0x43b175);})['catch'](function(_0x4aaa74){logger[_0x8f95('0x10')](_0x8f95('0x44'),_0x4aaa74['message'],_0x2c21c2);_0x21391f(_0x17071c[_0x8f95('0x10')](0x1f4,_0x4aaa74['message']));});});};exports[_0x8f95('0x45')]=function(_0x1997a7){var _0x4b3c05=this;return new Promise(function(_0x5cff7a,_0x1c2860){return db[_0x8f95('0x14')]['findAll']({'raw':_0x1997a7[_0x8f95('0x17')]?_0x1997a7['options'][_0x8f95('0x18')]===undefined?!![]:![]:!![],'where':_0x1997a7[_0x8f95('0x17')]?_0x1997a7['options'][_0x8f95('0x29')]||null:null,'attributes':[[_0x8f95('0x2a'),_0x8f95('0x2b')],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')][_0x8f95('0x1e')]('id')),'ivrTotalCallsDays'],[db[_0x8f95('0x1d')]['fn'](_0x8f95('0x22'),db[_0x8f95('0x1d')]['fn']('IF',db[_0x8f95('0x1d')]['literal'](_0x8f95('0x20')))),_0x8f95('0x46')]],'group':[_0x8f95('0x2a')]})[_0x8f95('0xa')](function(_0xf7fdff){logger['info'](_0x8f95('0x45'),_0x1997a7);logger[_0x8f95('0xd')](_0x8f95('0x45'),_0x1997a7,JSON[_0x8f95('0x1a')](_0xf7fdff));_0x5cff7a(_0xf7fdff);})[_0x8f95('0x13')](function(_0x18b368){logger[_0x8f95('0x10')](_0x8f95('0x45'),_0x18b368[_0x8f95('0x12')],_0x1997a7);_0x1c2860(_0x4b3c05['error'](0x1f4,_0x18b368[_0x8f95('0x12')]));});});}; \ No newline at end of file +var _0x12fd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','CmHopperHistory','options','raw','debug','stringify','AvgHandleTime','findAll','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring'];(function(_0x2c6234,_0x54e032){var _0x532ae6=function(_0xfaab51){while(--_0xfaab51){_0x2c6234['push'](_0x2c6234['shift']());}};_0x532ae6(++_0x54e032);}(_0x12fd,0x199));var _0xd12f=function(_0x299cb8,_0x1e5843){_0x299cb8=_0x299cb8-0x0;var _0x46347c=_0x12fd[_0x299cb8];return _0x46347c;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var moment=require(_0xd12f('0x2'));var BPromise=require(_0xd12f('0x3'));var rs=require(_0xd12f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12f('0x5'))['db'];var utils=require(_0xd12f('0x6'));var logger=require(_0xd12f('0x7'))(_0xd12f('0x8'));var config=require(_0xd12f('0x9'));var jayson=require(_0xd12f('0xa'));var client=jayson['client'][_0xd12f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca6e6,_0x285abf,_0x193e89){return new BPromise(function(_0x62de68,_0x40aaf8){return client['request'](_0x5ca6e6,_0x193e89)[_0xd12f('0xc')](function(_0x539473){logger[_0xd12f('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x285abf,'request\x20sent');logger['debug'](_0xd12f('0xe'),_0x285abf,_0xd12f('0xf'),JSON['stringify'](_0x539473));if(_0x539473['error']){if(_0x539473['error']['code']===0x1f4){logger[_0xd12f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x285abf,_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);return _0x40aaf8(_0x539473['error'][_0xd12f('0x11')]);}logger[_0xd12f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x285abf,_0x539473['error']['message']);return _0x62de68(_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);}else{logger[_0xd12f('0xd')](_0xd12f('0x12'),_0x285abf,_0xd12f('0xf'));_0x62de68(_0x539473[_0xd12f('0x13')][_0xd12f('0x11')]);}})[_0xd12f('0x14')](function(_0x4769a2){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x285abf,_0x4769a2);_0x40aaf8(_0x4769a2);});});}exports[_0xd12f('0x15')]=function(_0x45ff4d){var _0x58a653=this;return new Promise(function(_0x14c619,_0x12c884){return db[_0xd12f('0x16')]['create'](_0x45ff4d['body'],{'raw':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![]})[_0xd12f('0xc')](function(_0x410073){logger[_0xd12f('0xd')]('CreateCmHopperHistory',_0x45ff4d);logger[_0xd12f('0x19')](_0xd12f('0x15'),_0x45ff4d,JSON[_0xd12f('0x1a')](_0x410073));_0x14c619(_0x410073);})[_0xd12f('0x14')](function(_0x3a0c41){logger[_0xd12f('0x10')](_0xd12f('0x15'),_0x3a0c41[_0xd12f('0x11')],_0x45ff4d);_0x12c884(_0x58a653[_0xd12f('0x10')](0x1f4,_0x3a0c41[_0xd12f('0x11')]));});});};exports[_0xd12f('0x1b')]=function(_0x322f78){var _0x382395=this;return new Promise(function(_0x24bbc5,_0x36649d){return db[_0xd12f('0x16')][_0xd12f('0x1c')]({'raw':_0x322f78[_0xd12f('0x17')]?_0x322f78[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![],'where':_0x322f78[_0xd12f('0x17')]?_0x322f78[_0xd12f('0x17')][_0xd12f('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd12f('0x1e'),db['sequelize'][_0xd12f('0x1f')]('id')),_0xd12f('0x20')],[db['sequelize']['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x23')))),_0xd12f('0x24')],[db['sequelize']['fn']('COUNT',db[_0xd12f('0x21')]['fn']('IF',db['sequelize'][_0xd12f('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db[_0xd12f('0x21')]['fn']('IF',db['sequelize'][_0xd12f('0x22')](_0xd12f('0x25')))),_0xd12f('0x26')],[db['sequelize']['fn'](_0xd12f('0x27'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xd12f('0x28')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x27'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x29')))),_0xd12f('0x2a')]]})['then'](function(_0x586a50){logger[_0xd12f('0xd')]('AvgHandleTime',_0x322f78);logger[_0xd12f('0x19')](_0xd12f('0x1b'),_0x322f78,JSON['stringify'](_0x586a50));_0x24bbc5(_0x586a50);})[_0xd12f('0x14')](function(_0x108193){logger[_0xd12f('0x10')]('AvgHandleTime',_0x108193['message'],_0x322f78);_0x36649d(_0x382395['error'](0x1f4,_0x108193['message']));});});};exports[_0xd12f('0x2b')]=function(_0x215376){var _0x57eb41=this;return new Promise(function(_0x229a79,_0x2e30e0){return db[_0xd12f('0x16')]['findAll']({'raw':_0x215376[_0xd12f('0x17')]?_0x215376['options']['raw']===undefined?!![]:![]:!![],'where':_0x215376['options']?_0x215376[_0xd12f('0x17')][_0xd12f('0x1d')]||null:null,'attributes':[[_0xd12f('0x2c'),_0xd12f('0x2d')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x2e')))),_0xd12f('0x2f')],[db['sequelize']['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x30')))),_0xd12f('0x31')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x23')))),_0xd12f('0x32')],[db['sequelize']['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')]['literal'](_0xd12f('0x33')))),_0xd12f('0x34')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x35')))),'outboundCongestionCallsDay'],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x36')))),_0xd12f('0x37')],[db[_0xd12f('0x21')]['fn']('COUNT',db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x38')))),_0xd12f('0x39')],[db['sequelize']['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x3a')))),_0xd12f('0x3b')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')]['literal'](_0xd12f('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')]['literal'](_0xd12f('0x3d')))),'outboundRejectCallsDay'],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0xd12f('0x3e')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db[_0xd12f('0x21')]['fn']('IF',db['sequelize'][_0xd12f('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xd12f('0x3f')],[db['sequelize']['fn']('COUNT',db[_0xd12f('0x21')]['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x40')))),_0xd12f('0x41')]],'group':[_0xd12f('0x2c')]})[_0xd12f('0xc')](function(_0x1cda24){logger[_0xd12f('0xd')](_0xd12f('0x2b'),_0x215376);logger[_0xd12f('0x19')](_0xd12f('0x2b'),_0x215376,JSON[_0xd12f('0x1a')](_0x1cda24));_0x229a79(_0x1cda24);})[_0xd12f('0x14')](function(_0x590dcf){logger[_0xd12f('0x10')](_0xd12f('0x2b'),_0x590dcf['message'],_0x215376);_0x2e30e0(_0x57eb41['error'](0x1f4,_0x590dcf[_0xd12f('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x24a52a){var _0x2f573d=this;return new Promise(function(_0x3ef4c6,_0x285497){return db[_0xd12f('0x16')][_0xd12f('0x1c')]({'raw':_0x24a52a[_0xd12f('0x17')]?_0x24a52a[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![],'where':_0x24a52a['options']?_0x24a52a[_0xd12f('0x17')][_0xd12f('0x1d')]||null:null,'attributes':[[_0xd12f('0x2c'),'name'],[db[_0xd12f('0x21')]['fn']('COUNT',db['sequelize'][_0xd12f('0x1f')]('id')),_0xd12f('0x42')],[db[_0xd12f('0x21')]['fn'](_0xd12f('0x1e'),db['sequelize']['fn']('IF',db[_0xd12f('0x21')][_0xd12f('0x22')](_0xd12f('0x23')))),_0xd12f('0x43')]],'group':[_0xd12f('0x2c')]})[_0xd12f('0xc')](function(_0x543ade){logger['info'](_0xd12f('0x44'),_0x24a52a);logger[_0xd12f('0x19')]('GetCampaignHopperHistory',_0x24a52a,JSON[_0xd12f('0x1a')](_0x543ade));_0x3ef4c6(_0x543ade);})[_0xd12f('0x14')](function(_0x169a30){logger[_0xd12f('0x10')](_0xd12f('0x44'),_0x169a30[_0xd12f('0x11')],_0x24a52a);_0x285497(_0x2f573d[_0xd12f('0x10')](0x1f4,_0x169a30['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c5e6e3d..7855d55 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 _0xdca3=['show','create','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/describe','get','/:id'];(function(_0x385ed5,_0x449f76){var _0x27f199=function(_0x47d08f){while(--_0x47d08f){_0x385ed5['push'](_0x385ed5['shift']());}};_0x27f199(++_0x449f76);}(_0xdca3,0x71));var _0x3dca=function(_0x37760a,_0x26ac10){_0x37760a=_0x37760a-0x0;var _0x6840c7=_0xdca3[_0x37760a];return _0x6840c7;};'use strict';var multer=require(_0x3dca('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3dca('0x1'));var express=require(_0x3dca('0x2'));var router=express[_0x3dca('0x3')]();var fs_extra=require(_0x3dca('0x4'));var auth=require(_0x3dca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3dca('0x6'));var controller=require(_0x3dca('0x7'));router['get']('/',auth[_0x3dca('0x8')](),controller[_0x3dca('0x9')]);router['get'](_0x3dca('0xa'),auth[_0x3dca('0x8')](),controller['describe']);router[_0x3dca('0xb')](_0x3dca('0xc'),auth[_0x3dca('0x8')](),controller[_0x3dca('0xd')]);router['post']('/',auth[_0x3dca('0x8')](),controller[_0x3dca('0xe')]);router[_0x3dca('0xf')](_0x3dca('0xc'),auth[_0x3dca('0x8')](),controller[_0x3dca('0x10')]);module[_0x3dca('0x11')]=router; \ No newline at end of file +var _0x14a6=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','multer'];(function(_0x4e37f3,_0xcb3c62){var _0x3b10dd=function(_0x16820b){while(--_0x16820b){_0x4e37f3['push'](_0x4e37f3['shift']());}};_0x3b10dd(++_0xcb3c62);}(_0x14a6,0x167));var _0x614a=function(_0xe3bbea,_0x3ae4d3){_0xe3bbea=_0xe3bbea-0x0;var _0x18713d=_0x14a6[_0xe3bbea];return _0x18713d;};'use strict';var multer=require(_0x614a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x614a('0x1'));var express=require('express');var router=express[_0x614a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x614a('0x3'));var interaction=require(_0x614a('0x4'));var config=require('../../config/environment');var controller=require(_0x614a('0x5'));router[_0x614a('0x6')]('/',auth[_0x614a('0x7')](),controller[_0x614a('0x8')]);router['get']('/describe',auth[_0x614a('0x7')](),controller['describe']);router[_0x614a('0x6')](_0x614a('0x9'),auth[_0x614a('0x7')](),controller[_0x614a('0xa')]);router[_0x614a('0xb')]('/',auth[_0x614a('0x7')](),controller[_0x614a('0xc')]);router[_0x614a('0xd')](_0x614a('0x9'),auth[_0x614a('0x7')](),controller[_0x614a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b829e48..39d7b40 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 _0xe107=['STRING','name','sequelize'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0xe107,0xb3));var _0x7e10=function(_0x7e406d,_0x28d0f8){_0x7e406d=_0x7e406d-0x0;var _0x5064da=_0xe107[_0x7e406d];return _0x5064da;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e10('0x1')],'unique':_0x7e10('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7e10('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x106f=['name','STRING','sequelize','exports'];(function(_0x3ee6bc,_0x4025bb){var _0x5bda78=function(_0x331db2){while(--_0x331db2){_0x3ee6bc['push'](_0x3ee6bc['shift']());}};_0x5bda78(++_0x4025bb);}(_0x106f,0x162));var _0xf106=function(_0x6f8043,_0x435978){_0x6f8043=_0x6f8043-0x0;var _0x18b75f=_0x106f[_0x6f8043];return _0x18b75f;};'use strict';var Sequelize=require(_0xf106('0x0'));module[_0xf106('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf106('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf106('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 2b66795..f7bad32 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 _0xf2f6=['merge','findAll','rows','catch','show','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','find','autoAssociation','UserProfileResource','update','params','describe','addDisposition','ListId','Disposition','getDispositions','pick','options','includeAll','removeDispositions','ids','addContacts','tags','isArray','join','each','CmContact','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','type','text','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findOne','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','error','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','stack','name','send','map','CmList','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x342f03,_0x9dd2e1){var _0x185f83=function(_0x36fb1f){while(--_0x36fb1f){_0x342f03['push'](_0x342f03['shift']());}};_0x185f83(++_0x9dd2e1);}(_0xf2f6,0x110));var _0x6f2f=function(_0x1010a2,_0x51e21d){_0x1010a2=_0x1010a2-0x0;var _0x1d313f=_0xf2f6[_0x1010a2];return _0x1d313f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f2f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f2f('0x1'));var rp=require('request-promise');var moment=require(_0x6f2f('0x2'));var BPromise=require(_0x6f2f('0x3'));var Mustache=require(_0x6f2f('0x4'));var util=require(_0x6f2f('0x5'));var path=require('path');var sox=require(_0x6f2f('0x6'));var csv=require(_0x6f2f('0x7'));var ejs=require(_0x6f2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f2f('0x9'));var crypto=require(_0x6f2f('0xa'));var jsforce=require(_0x6f2f('0xb'));var deskjs=require(_0x6f2f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6f2f('0xd'));var Papa=require(_0x6f2f('0xe'));var Redis=require(_0x6f2f('0xf'));var authService=require(_0x6f2f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6f2f('0x11'));var hardwareService=require(_0x6f2f('0x12'));var logger=require('../../config/logger')(_0x6f2f('0x13'));var utils=require(_0x6f2f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f2f('0x15'));var db=require(_0x6f2f('0x16'))['db'];var csv_results;config[_0x6f2f('0x17')]=_['defaults'](config[_0x6f2f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f2f('0x18'))(new Redis(config['redis']));require(_0x6f2f('0x19'))[_0x6f2f('0x1a')](socket);function respondWithStatusCode(_0x16de7b,_0x493860){_0x493860=_0x493860||0xcc;return function(_0x3d7b4b){if(_0x3d7b4b){return _0x16de7b[_0x6f2f('0x1b')](_0x493860);}return _0x16de7b[_0x6f2f('0x1c')](_0x493860)[_0x6f2f('0x1d')]();};}function respondWithResult(_0x3ebbe1,_0x178836){_0x178836=_0x178836||0xc8;return function(_0x24e865){if(_0x24e865){return _0x3ebbe1['status'](_0x178836)['json'](_0x24e865);}};}function respondWithFilteredResult(_0x5cbc64,_0x967169){return function(_0xc7a49a){if(_0xc7a49a){var _0x234d5f=typeof _0x967169[_0x6f2f('0x1e')]===_0x6f2f('0x1f')&&typeof _0x967169[_0x6f2f('0x20')]===_0x6f2f('0x1f');var _0x1d3eba=_0xc7a49a[_0x6f2f('0x21')];var _0x3aa97d=_0x234d5f?0x0:_0x967169[_0x6f2f('0x1e')];var _0x2ba246=_0x234d5f?_0xc7a49a[_0x6f2f('0x21')]:_0x967169[_0x6f2f('0x1e')]+_0x967169[_0x6f2f('0x20')];var _0xbfdabf;if(_0x2ba246>=_0x1d3eba){_0x2ba246=_0x1d3eba;_0xbfdabf=0xc8;}else{_0xbfdabf=0xce;}_0x5cbc64['status'](_0xbfdabf);return _0x5cbc64[_0x6f2f('0x22')](_0x6f2f('0x23'),_0x3aa97d+'-'+_0x2ba246+'/'+_0x1d3eba)[_0x6f2f('0x24')](_0xc7a49a);}return null;};}function patchUpdates(_0xa11b7){return function(_0x14d584){try{jsonpatch[_0x6f2f('0x25')](_0x14d584,_0xa11b7,!![]);}catch(_0x122581){return BPromise[_0x6f2f('0x26')](_0x122581);}return _0x14d584[_0x6f2f('0x27')]();};}function saveUpdates(_0x163ce5,_0x5d381d){return function(_0x32258d){if(_0x32258d){return _0x32258d['update'](_0x163ce5)[_0x6f2f('0x28')](function(_0x11fff4){return _0x11fff4;});}return null;};}function removeEntity(_0x1fafa9,_0x3c1b22){return function(_0x340180){if(_0x340180){return _0x340180[_0x6f2f('0x29')]()[_0x6f2f('0x28')](function(){var _0x45b1b2=_0x340180[_0x6f2f('0x2a')]({'plain':!![]});var _0x1cade4='Lists';return db['UserProfileResource'][_0x6f2f('0x29')]({'where':{'type':_0x1cade4,'resourceId':_0x45b1b2['id']}})[_0x6f2f('0x28')](function(){return _0x340180;});})['then'](function(){_0x1fafa9['status'](0xcc)[_0x6f2f('0x1d')]();});}};}function handleEntityNotFound(_0x2f1fa3,_0x36c01e){return function(_0x3e6f1b){if(!_0x3e6f1b){_0x2f1fa3[_0x6f2f('0x1b')](0x194);}return _0x3e6f1b;};}function handleError(_0x498ad6,_0x36c3bb){_0x36c3bb=_0x36c3bb||0x1f4;return function(_0x3fa866){logger['error'](_0x3fa866[_0x6f2f('0x2b')]);if(_0x3fa866[_0x6f2f('0x2c')]){delete _0x3fa866[_0x6f2f('0x2c')];}_0x498ad6[_0x6f2f('0x1c')](_0x36c3bb)[_0x6f2f('0x2d')](_0x3fa866);};}exports['index']=function(_0x40b0ec,_0x2d14ca){var _0x569f4a={},_0x511260={},_0x368d8b={'count':0x0,'rows':[]};var _0xfa129d=_[_0x6f2f('0x2e')](db[_0x6f2f('0x2f')][_0x6f2f('0x30')],function(_0x3b0937){return{'name':_0x3b0937[_0x6f2f('0x31')],'type':_0x3b0937['type'][_0x6f2f('0x32')]};});_0x511260['model']=_[_0x6f2f('0x2e')](_0xfa129d,_0x6f2f('0x2c'));_0x511260[_0x6f2f('0x33')]=_[_0x6f2f('0x34')](_0x40b0ec[_0x6f2f('0x33')]);_0x511260[_0x6f2f('0x35')]=_['intersection'](_0x511260[_0x6f2f('0x36')],_0x511260['query']);_0x569f4a['attributes']=_['intersection'](_0x511260[_0x6f2f('0x36')],qs['fields'](_0x40b0ec['query'][_0x6f2f('0x37')]));_0x569f4a[_0x6f2f('0x38')]=_0x569f4a[_0x6f2f('0x38')][_0x6f2f('0x39')]?_0x569f4a[_0x6f2f('0x38')]:_0x511260['model'];if(!_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x3a')](_0x6f2f('0x3b'))){_0x569f4a[_0x6f2f('0x20')]=qs[_0x6f2f('0x20')](_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x20')]);_0x569f4a[_0x6f2f('0x1e')]=qs[_0x6f2f('0x1e')](_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x1e')]);}_0x569f4a[_0x6f2f('0x3c')]=qs[_0x6f2f('0x3d')](_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x3d')]);_0x569f4a[_0x6f2f('0x3e')]=qs[_0x6f2f('0x35')](_['pick'](_0x40b0ec['query'],_0x511260[_0x6f2f('0x35')]),_0xfa129d);if(_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x3f')]){_0x569f4a[_0x6f2f('0x3e')]=_[_0x6f2f('0x40')](_0x569f4a[_0x6f2f('0x3e')],{'$or':_['map'](_0xfa129d,function(_0x110f3a){if(_0x110f3a['type']!=='VIRTUAL'){var _0x2273b6={};_0x2273b6[_0x110f3a['name']]={'$like':'%'+_0x40b0ec[_0x6f2f('0x33')][_0x6f2f('0x3f')]+'%'};return _0x2273b6;}})});}_0x569f4a=_[_0x6f2f('0x40')]({},_0x569f4a,_0x40b0ec['options']);var _0x5b219d={'where':_0x569f4a[_0x6f2f('0x3e')]};return db[_0x6f2f('0x2f')][_0x6f2f('0x21')](_0x5b219d)[_0x6f2f('0x28')](function(_0x471752){_0x368d8b[_0x6f2f('0x21')]=_0x471752;if(_0x40b0ec[_0x6f2f('0x33')]['includeAll']){_0x569f4a['include']=[{'all':!![]}];}return db[_0x6f2f('0x2f')][_0x6f2f('0x41')](_0x569f4a);})[_0x6f2f('0x28')](function(_0x219cdd){_0x368d8b[_0x6f2f('0x42')]=_0x219cdd;return _0x368d8b;})[_0x6f2f('0x28')](respondWithFilteredResult(_0x2d14ca,_0x569f4a))[_0x6f2f('0x43')](handleError(_0x2d14ca,null));};exports[_0x6f2f('0x44')]=function(_0x5c7e3f,_0x419c4f){var _0x19d3db={'raw':![],'where':{'id':_0x5c7e3f['params']['id']}},_0xf1215f={};_0xf1215f[_0x6f2f('0x36')]=_[_0x6f2f('0x34')](db[_0x6f2f('0x2f')][_0x6f2f('0x30')]);_0xf1215f['query']=_[_0x6f2f('0x34')](_0x5c7e3f[_0x6f2f('0x33')]);_0xf1215f[_0x6f2f('0x35')]=_['intersection'](_0xf1215f[_0x6f2f('0x36')],_0xf1215f[_0x6f2f('0x33')]);_0x19d3db[_0x6f2f('0x38')]=_[_0x6f2f('0x45')](_0xf1215f[_0x6f2f('0x36')],qs[_0x6f2f('0x37')](_0x5c7e3f['query'][_0x6f2f('0x37')]));_0x19d3db[_0x6f2f('0x38')]=_0x19d3db[_0x6f2f('0x38')][_0x6f2f('0x39')]?_0x19d3db[_0x6f2f('0x38')]:_0xf1215f[_0x6f2f('0x36')];if(_0x5c7e3f[_0x6f2f('0x33')]['includeAll']){_0x19d3db[_0x6f2f('0x46')]=[{'all':!![]}];}_0x19d3db=_['merge']({},_0x19d3db,_0x5c7e3f['options']);return db[_0x6f2f('0x2f')]['find'](_0x19d3db)[_0x6f2f('0x28')](handleEntityNotFound(_0x419c4f,null))[_0x6f2f('0x28')](respondWithResult(_0x419c4f,null))['catch'](handleError(_0x419c4f,null));};exports[_0x6f2f('0x47')]=function(_0x3e8354,_0x48f7cc){return db['CmList'][_0x6f2f('0x47')](_0x3e8354[_0x6f2f('0x48')],{})[_0x6f2f('0x28')](function(_0x537a3e){var _0x35597e=_0x3e8354[_0x6f2f('0x49')][_0x6f2f('0x2a')]({'plain':!![]});if(!_0x35597e)throw new Error(_0x6f2f('0x4a'));if(_0x35597e[_0x6f2f('0x4b')]===_0x6f2f('0x49')){var _0x50beb0=_0x537a3e['get']({'plain':!![]});var _0x144fa8=_0x6f2f('0x4c');return db[_0x6f2f('0x4d')][_0x6f2f('0x4e')]({'where':{'name':_0x144fa8,'userProfileId':_0x35597e['userProfileId']},'raw':!![]})[_0x6f2f('0x28')](function(_0x208ab7){if(_0x208ab7&&_0x208ab7[_0x6f2f('0x4f')]===0x0){return db[_0x6f2f('0x50')][_0x6f2f('0x47')]({'name':_0x50beb0[_0x6f2f('0x2c')],'resourceId':_0x50beb0['id'],'type':_0x208ab7[_0x6f2f('0x2c')],'sectionId':_0x208ab7['id']},{})[_0x6f2f('0x28')](function(){return _0x537a3e;});}else{return _0x537a3e;}})[_0x6f2f('0x43')](function(_0x331386){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x331386);throw _0x331386;});}return _0x537a3e;})['then'](respondWithResult(_0x48f7cc,0xc9))['catch'](handleError(_0x48f7cc,null));};exports[_0x6f2f('0x51')]=function(_0x3d942c,_0x4d479a){if(_0x3d942c['body']['id']){delete _0x3d942c['body']['id'];}return db[_0x6f2f('0x2f')][_0x6f2f('0x4e')]({'where':{'id':_0x3d942c[_0x6f2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d479a,null))[_0x6f2f('0x28')](saveUpdates(_0x3d942c['body'],null))[_0x6f2f('0x28')](respondWithResult(_0x4d479a,null))[_0x6f2f('0x43')](handleError(_0x4d479a,null));};exports['destroy']=function(_0x2c8d37,_0x389f99){return db[_0x6f2f('0x2f')]['find']({'where':{'id':_0x2c8d37[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x389f99,null))[_0x6f2f('0x28')](removeEntity(_0x389f99,null))[_0x6f2f('0x43')](handleError(_0x389f99,null));};exports['describe']=function(_0x407a44,_0x38e110){return db[_0x6f2f('0x2f')][_0x6f2f('0x53')]()[_0x6f2f('0x28')](respondWithResult(_0x38e110,null))[_0x6f2f('0x43')](handleError(_0x38e110,null));};exports[_0x6f2f('0x54')]=function(_0x3d2a29,_0x17bcfb,_0x3bfa4b){if(_0x3d2a29[_0x6f2f('0x48')]['id']){delete _0x3d2a29[_0x6f2f('0x48')]['id'];}return db[_0x6f2f('0x2f')][_0x6f2f('0x4e')]({'where':{'id':_0x3d2a29[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x17bcfb,null))[_0x6f2f('0x28')](function(_0x2a63e4){if(_0x2a63e4){_0x3d2a29[_0x6f2f('0x48')][_0x6f2f('0x55')]=_0x2a63e4['id'];return db[_0x6f2f('0x56')][_0x6f2f('0x47')](_0x3d2a29[_0x6f2f('0x48')]);}})['then'](respondWithResult(_0x17bcfb,null))['catch'](handleError(_0x17bcfb,null));};exports[_0x6f2f('0x57')]=function(_0x102261,_0x2a1232,_0x654d96){var _0x37ca06={'raw':![],'where':{}};var _0x9ae211={};var _0x5975b0={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x102261['params']['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x2a1232,null))[_0x6f2f('0x28')](function(_0x4b1467){if(_0x4b1467){_0x9ae211[_0x6f2f('0x36')]=_[_0x6f2f('0x34')](db[_0x6f2f('0x56')][_0x6f2f('0x30')]);_0x9ae211[_0x6f2f('0x33')]=_[_0x6f2f('0x34')](_0x102261[_0x6f2f('0x33')]);_0x9ae211[_0x6f2f('0x35')]=_['intersection'](_0x9ae211[_0x6f2f('0x36')],_0x9ae211[_0x6f2f('0x33')]);_0x37ca06[_0x6f2f('0x38')]=_[_0x6f2f('0x45')](_0x9ae211[_0x6f2f('0x36')],qs[_0x6f2f('0x37')](_0x102261[_0x6f2f('0x33')][_0x6f2f('0x37')]));_0x37ca06[_0x6f2f('0x38')]=_0x37ca06[_0x6f2f('0x38')][_0x6f2f('0x39')]?_0x37ca06['attributes']:_0x9ae211[_0x6f2f('0x36')];if(!_0x102261['query'][_0x6f2f('0x3a')]('nolimit')){_0x37ca06[_0x6f2f('0x20')]=qs['limit'](_0x102261[_0x6f2f('0x33')][_0x6f2f('0x20')]);_0x37ca06[_0x6f2f('0x1e')]=qs[_0x6f2f('0x1e')](_0x102261[_0x6f2f('0x33')][_0x6f2f('0x1e')]);}_0x37ca06[_0x6f2f('0x3c')]=qs[_0x6f2f('0x3d')](_0x102261['query'][_0x6f2f('0x3d')]);_0x37ca06[_0x6f2f('0x3e')]=qs[_0x6f2f('0x35')](_[_0x6f2f('0x58')](_0x102261['query'],_0x9ae211[_0x6f2f('0x35')]));_0x37ca06[_0x6f2f('0x3e')][_0x6f2f('0x55')]=_0x4b1467['id'];if(_0x102261['query']['filter']){_0x37ca06[_0x6f2f('0x3e')]=_[_0x6f2f('0x40')](_0x37ca06['where'],{'$or':_[_0x6f2f('0x2e')](_0x37ca06[_0x6f2f('0x38')],function(_0x4c5cc2){var _0x19af59={};_0x19af59[_0x4c5cc2]={'$like':'%'+_0x102261[_0x6f2f('0x33')]['filter']+'%'};return _0x19af59;})});}_0x37ca06=_[_0x6f2f('0x40')]({},_0x37ca06,_0x102261[_0x6f2f('0x59')]);return db[_0x6f2f('0x56')][_0x6f2f('0x21')]({'where':_0x37ca06[_0x6f2f('0x3e')]})['then'](function(_0x1f36b6){_0x5975b0[_0x6f2f('0x21')]=_0x1f36b6;if(_0x102261['query'][_0x6f2f('0x5a')]){_0x37ca06['include']=[{'all':!![]}];}return db[_0x6f2f('0x56')]['findAll'](_0x37ca06);})[_0x6f2f('0x28')](function(_0x8e42ed){_0x5975b0[_0x6f2f('0x42')]=_0x8e42ed;return _0x5975b0;});}})[_0x6f2f('0x28')](respondWithFilteredResult(_0x2a1232,_0x37ca06))[_0x6f2f('0x43')](handleError(_0x2a1232,null));};exports[_0x6f2f('0x5b')]=function(_0x2f1fa6,_0x5acd29,_0x2fb82c){return db[_0x6f2f('0x2f')][_0x6f2f('0x4e')]({'where':{'id':_0x2f1fa6['params']['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x5acd29,null))[_0x6f2f('0x28')](function(_0x3bc69f){if(_0x3bc69f){return _0x3bc69f[_0x6f2f('0x5b')](_0x2f1fa6[_0x6f2f('0x33')][_0x6f2f('0x5c')]);}})['then'](respondWithStatusCode(_0x5acd29,null))[_0x6f2f('0x43')](handleError(_0x5acd29,null));};exports[_0x6f2f('0x5d')]=function(_0x49898b,_0x44bf65,_0x29dc82){return db[_0x6f2f('0x2f')][_0x6f2f('0x4e')]({'where':{'id':_0x49898b[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x44bf65,null))[_0x6f2f('0x28')](function(_0x4d8697){if(_0x4d8697){var _0x1ed5c6=[];var _0x515764={'success':[],'errors':[]};return db['CmContact'][_0x6f2f('0x53')]()[_0x6f2f('0x28')](function(_0xd17055){if(_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x5e')]&&_[_0x6f2f('0x5f')](_0x49898b['body'][_0x6f2f('0x5e')])){if(_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x5e')][_0x6f2f('0x39')]){_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x5e')]=_0x49898b['body'][_0x6f2f('0x5e')][_0x6f2f('0x60')](';')+';';}else{_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x5e')]=null;}}else{_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x5e')]=null;}if(_0x49898b[_0x6f2f('0x48')]&&_[_0x6f2f('0x5f')](_0x49898b['body'])){for(var _0x3f5427=0x0;_0x3f5427<_0x49898b[_0x6f2f('0x48')][_0x6f2f('0x39')];_0x3f5427+=0x1){_0x49898b[_0x6f2f('0x48')][_0x3f5427]['ListId']=_0x49898b['params']['id'];_0x1ed5c6['push'](_0x49898b[_0x6f2f('0x48')][_0x3f5427]);}return BPromise[_0x6f2f('0x61')](_0x1ed5c6,function(_0x45716d){return db[_0x6f2f('0x62')][_0x6f2f('0x47')](_[_0x6f2f('0x63')](_0x45716d,['ids','id'])||{},{'fields':_[_0x6f2f('0x34')](_0xd17055),'raw':!![]})[_0x6f2f('0x28')](function(_0x2a82bf){_0x515764[_0x6f2f('0x64')][_0x6f2f('0x65')](_0x2a82bf[_0x6f2f('0x66')]);})[_0x6f2f('0x43')](function(_0x505ed8){_0x515764[_0x6f2f('0x67')]['push']({'data':_0x45716d,'error':_0x505ed8[_0x6f2f('0x68')]});});})[_0x6f2f('0x28')](function(_0x2b3057){return _0x515764;})[_0x6f2f('0x43')](function(_0x586785){return _0x586785;});}else{_0x44bf65[_0x6f2f('0x1c')](0x190)[_0x6f2f('0x24')]({'message':_0x6f2f('0x69')});}});}})['then'](respondWithResult(_0x44bf65,null))[_0x6f2f('0x43')](handleError(_0x44bf65,null));};exports[_0x6f2f('0x6a')]=function(_0x4a430e,_0x5a8a2c,_0x442ec8){var _0x161ef5;return db[_0x6f2f('0x2f')]['find']({'where':{'id':_0x4a430e[_0x6f2f('0x52')]['id']},'include':[{'model':db[_0x6f2f('0x6b')],'as':_0x6f2f('0x6c')}]})[_0x6f2f('0x28')](handleEntityNotFound(_0x5a8a2c,null))[_0x6f2f('0x28')](function(_0x414d19){if(_0x414d19){_0x161ef5=_0x414d19;return db[_0x6f2f('0x62')][_0x6f2f('0x30')];}})[_0x6f2f('0x28')](function(_0x2e2396){if(_0x2e2396){var _0x43a671={};var _0x2d0955={};_0x2d0955[_0x6f2f('0x36')]=_[_0x6f2f('0x6d')](_[_0x6f2f('0x34')](_0x2e2396),_[_0x6f2f('0x2e')](_0x161ef5[_0x6f2f('0x6c')],function(_0x347836){return util[_0x6f2f('0x6e')](_0x6f2f('0x6f'),_0x347836['id']);}));_0x2d0955['query']=_[_0x6f2f('0x34')](_0x4a430e[_0x6f2f('0x33')]);_0x2d0955[_0x6f2f('0x35')]=_[_0x6f2f('0x45')](_0x2d0955[_0x6f2f('0x36')],_0x2d0955[_0x6f2f('0x33')]);_0x43a671[_0x6f2f('0x38')]=_[_0x6f2f('0x45')](_0x2d0955[_0x6f2f('0x36')],qs['fields'](_0x4a430e[_0x6f2f('0x33')]['fields']));_0x43a671[_0x6f2f('0x38')]=_0x43a671['attributes']['length']?_0x43a671[_0x6f2f('0x38')]:_0x2d0955[_0x6f2f('0x36')];if(!_0x4a430e[_0x6f2f('0x33')][_0x6f2f('0x3a')](_0x6f2f('0x3b'))){_0x43a671[_0x6f2f('0x20')]=qs[_0x6f2f('0x20')](_0x4a430e[_0x6f2f('0x33')][_0x6f2f('0x20')]);_0x43a671[_0x6f2f('0x1e')]=qs[_0x6f2f('0x1e')](_0x4a430e[_0x6f2f('0x33')][_0x6f2f('0x1e')]);}_0x43a671[_0x6f2f('0x3c')]=qs[_0x6f2f('0x3d')](_0x4a430e[_0x6f2f('0x33')][_0x6f2f('0x3d')]);_0x43a671[_0x6f2f('0x3e')]=qs[_0x6f2f('0x35')](_[_0x6f2f('0x58')](_0x4a430e['query'],_0x2d0955[_0x6f2f('0x35')]));_0x43a671[_0x6f2f('0x70')]=!![];if(_0x4a430e[_0x6f2f('0x33')]['filter']){_0x43a671[_0x6f2f('0x3e')]=_[_0x6f2f('0x40')](_0x43a671[_0x6f2f('0x3e')],{'$or':_[_0x6f2f('0x2e')](_0x43a671[_0x6f2f('0x38')],function(_0x44a7c5){var _0x2c1c98={};_0x2c1c98[_0x44a7c5]={'$like':'%'+_0x4a430e[_0x6f2f('0x33')][_0x6f2f('0x3f')]+'%'};return _0x2c1c98;})});}_0x43a671=_[_0x6f2f('0x40')]({},_0x43a671,_0x4a430e[_0x6f2f('0x59')]);return _0x161ef5[_0x6f2f('0x6a')](_0x43a671);}})[_0x6f2f('0x28')](respondWithResult(_0x5a8a2c,null))[_0x6f2f('0x43')](handleError(_0x5a8a2c,null));};exports['getContactsCsv']=function(_0x22a222,_0x52ccc0,_0x157ef6){var _0x4670cd;var _0x46592d;var _0x5e0125;var _0x21b6d8=_0x22a222[_0x6f2f('0x52')]['id'];csv_results=[];return db[_0x6f2f('0x71')]['findAll']({'attributes':['id',_0x6f2f('0x2c')],'raw':!![],'order':[_0x6f2f('0x72')]})[_0x6f2f('0x28')](function(_0x451544){_0x4670cd=_0x451544;var _0x4836ee=_[_0x6f2f('0x34')](db[_0x6f2f('0x62')][_0x6f2f('0x30')]);return db[_0x6f2f('0x6b')][_0x6f2f('0x41')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x5422e1){_0x46592d=_0x5422e1;var _0x1e049c=squel[_0x6f2f('0x73')]()[_0x6f2f('0x37')](_0x4836ee)[_0x6f2f('0x74')](_0x6f2f('0x75'),'c')[_0x6f2f('0x3e')](_0x6f2f('0x76'),_0x21b6d8)[_0x6f2f('0x3e')](_0x6f2f('0x77'))[_0x6f2f('0x78')]();for(var _0x2d0236=0x0;_0x2d0236<_0x46592d['length'];_0x2d0236++){_0x1e049c[_0x6f2f('0x79')](_0x6f2f('0x7a')+_0x46592d[_0x2d0236]['id'],_0x6f2f('0x7b')+_0x46592d[_0x2d0236][_0x6f2f('0x7c')]);}for(var _0x2d0236=0x0;_0x2d0236<_0x4670cd[_0x6f2f('0x39')];_0x2d0236++){_0x1e049c[_0x6f2f('0x79')](squel['select']()[_0x6f2f('0x79')](_0x6f2f('0x7d'))[_0x6f2f('0x74')](_0x6f2f('0x7e'))[_0x6f2f('0x3e')](_0x6f2f('0x7f'),_0x4670cd[_0x2d0236]['id'])[_0x6f2f('0x3e')]('CmContactId\x20=\x20c.id'),_0x6f2f('0x80')+_0x4670cd[_0x2d0236][_0x6f2f('0x2c')]);_0x1e049c[_0x6f2f('0x79')](squel[_0x6f2f('0x73')]()['field'](_0x6f2f('0x81'))['from'](_0x6f2f('0x7e'))['where']('ItemTypeId\x20=\x20?',_0x4670cd[_0x2d0236]['id'])[_0x6f2f('0x3e')](_0x6f2f('0x82')),_0x6f2f('0x83')+_0x4670cd[_0x2d0236][_0x6f2f('0x2c')]);}var _0x5336ab=[];_0x5336ab[_0x6f2f('0x65')](_0x1e049c['toString']());BPromise[_0x6f2f('0x61')](_0x5336ab,handleQuery)[_0x6f2f('0x28')](function(_0x160bf9){handleQuery(_0x1e049c[_0x6f2f('0x84')]());var _0x3a0c3=csv_results[0x0];if(!_['isEmpty'](_0x3a0c3)){var _0x3a9402=toCsv(_0x3a0c3);var _0x3a09c4=Date[_0x6f2f('0x85')]();fs[_0x6f2f('0x86')](util[_0x6f2f('0x6e')](_0x6f2f('0x87'),_0x21b6d8,_0x3a09c4),_0x3a9402);_0x52ccc0[_0x6f2f('0x88')](_0x6f2f('0x89'),_0x6f2f('0x8a')+util[_0x6f2f('0x6e')](_0x6f2f('0x8b'),_0x21b6d8,_0x3a09c4));_0x52ccc0[_0x6f2f('0x88')](_0x6f2f('0x8c'),_0x6f2f('0x8d'));return _0x52ccc0[_0x6f2f('0x8e')](util[_0x6f2f('0x6e')](_0x6f2f('0x87'),_0x21b6d8,_0x3a09c4));}else{return _0x52ccc0[_0x6f2f('0x1b')](0xcc);}});});});};exports[_0x6f2f('0x8f')]=function(_0x2724d7,_0x44e051,_0x90ef37){var _0x53af0c;delete _0x2724d7[_0x6f2f('0x48')]['id'];return db[_0x6f2f('0x2f')]['findOne']({'where':{'id':_0x2724d7[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x44e051,null))[_0x6f2f('0x28')](function(_0x2b9ac8){if(_0x2b9ac8){return db[_0x6f2f('0x90')][_0x6f2f('0x91')](function(_0x2b9335){return db['CmCustomField'][_0x6f2f('0x47')](_0x2724d7[_0x6f2f('0x48')],{'transaction':_0x2b9335})[_0x6f2f('0x28')](function(_0x159d5b){_0x53af0c=_0x159d5b;return _0x2b9ac8[_0x6f2f('0x92')](_0x159d5b,{'transaction':_0x2b9335});})['then'](function(){var _0x1c40c3={'type':db['Sequelize'][_0x6f2f('0x93')],'transaction':_0x2b9335};switch(_0x2724d7['body'][_0x6f2f('0x94')]){case _0x6f2f('0x95'):_0x1c40c3[_0x6f2f('0x94')]=db[_0x6f2f('0x96')]['TEXT'];break;case'number':_0x1c40c3[_0x6f2f('0x94')]=db[_0x6f2f('0x96')]['INTEGER'];break;case'switch':_0x1c40c3['type']=db[_0x6f2f('0x96')][_0x6f2f('0x97')];_0x1c40c3[_0x6f2f('0x98')]=![];break;default:}return db[_0x6f2f('0x90')][_0x6f2f('0x99')][_0x6f2f('0x9a')](_0x6f2f('0x75'),util[_0x6f2f('0x6e')]('cf_%s',_0x53af0c['id']),_0x1c40c3);})['then'](function(){return _0x53af0c;});});}})[_0x6f2f('0x28')](respondWithResult(_0x44e051,null))[_0x6f2f('0x43')](handleError(_0x44e051,null));};exports[_0x6f2f('0x9b')]=function(_0x2fcfc8,_0x2de733,_0x226cf3){var _0x46f009={};var _0x200b8d={};var _0x98713c;var _0x3142a2;return db['CmList'][_0x6f2f('0x9c')]({'where':{'id':_0x2fcfc8['params']['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x2de733,null))['then'](function(_0x359293){if(_0x359293){_0x98713c=_0x359293;_0x200b8d[_0x6f2f('0x36')]=_['keys'](db[_0x6f2f('0x6b')][_0x6f2f('0x30')]);_0x200b8d[_0x6f2f('0x33')]=_[_0x6f2f('0x34')](_0x2fcfc8['query']);_0x200b8d[_0x6f2f('0x35')]=_[_0x6f2f('0x45')](_0x200b8d[_0x6f2f('0x36')],_0x200b8d[_0x6f2f('0x33')]);_0x46f009[_0x6f2f('0x38')]=_[_0x6f2f('0x45')](_0x200b8d['model'],qs['fields'](_0x2fcfc8[_0x6f2f('0x33')]['fields']));_0x46f009[_0x6f2f('0x38')]=_0x46f009[_0x6f2f('0x38')][_0x6f2f('0x39')]?_0x46f009[_0x6f2f('0x38')]:_0x200b8d[_0x6f2f('0x36')];_0x46f009['order']=qs[_0x6f2f('0x3d')](_0x2fcfc8[_0x6f2f('0x33')]['sort']);_0x46f009[_0x6f2f('0x3e')]=qs[_0x6f2f('0x35')](_[_0x6f2f('0x58')](_0x2fcfc8[_0x6f2f('0x33')],_0x200b8d[_0x6f2f('0x35')]));_0x46f009[_0x6f2f('0x3e')]=_['merge'](_0x46f009[_0x6f2f('0x3e')],{'$or':[{'ListId':_0x359293['id']},{'ListId':null}]});if(_0x2fcfc8[_0x6f2f('0x33')][_0x6f2f('0x3f')]){_0x46f009['where']=_[_0x6f2f('0x40')](_0x46f009[_0x6f2f('0x3e')],{'$or':_['map'](_0x46f009[_0x6f2f('0x38')],function(_0x5358f1){var _0x167269={};_0x167269[_0x5358f1]={'$like':'%'+_0x2fcfc8['query'][_0x6f2f('0x3f')]+'%'};return _0x167269;})});}_0x46f009=_[_0x6f2f('0x40')]({},_0x46f009,_0x2fcfc8[_0x6f2f('0x59')]);return db[_0x6f2f('0x6b')][_0x6f2f('0x9d')](_0x46f009);}})[_0x6f2f('0x28')](respondWithResult(_0x2de733,null))[_0x6f2f('0x43')](handleError(_0x2de733,null));};exports[_0x6f2f('0x9e')]=function(_0x410bb0,_0x280c0f){return db[_0x6f2f('0x6b')][_0x6f2f('0x9d')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x280c0f,null))[_0x6f2f('0x28')](function(_0x51ac95){return _0x51ac95;})[_0x6f2f('0x28')](respondWithResult(_0x280c0f,null))[_0x6f2f('0x43')](handleError(_0x280c0f,null));};exports[_0x6f2f('0x9f')]=function(_0x873ad1,_0xa9d775,_0x106a4c){return db['CmList'][_0x6f2f('0x4e')]({'where':{'id':_0x873ad1[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0xa9d775,null))[_0x6f2f('0x28')](function(_0x30a7b9){if(_0x30a7b9){return _0x30a7b9['addAgents'](_0x873ad1[_0x6f2f('0x48')][_0x6f2f('0x5c')],_[_0x6f2f('0x63')](_0x873ad1[_0x6f2f('0x48')],[_0x6f2f('0x5c'),'id'])||{})[_0x6f2f('0xa0')](function(_0x1c71fe){for(var _0x3f7cde=0x0;_0x3f7cde<_0x873ad1['body'][_0x6f2f('0x5c')][_0x6f2f('0x39')];_0x3f7cde+=0x1){socket[_0x6f2f('0xa1')](_0x6f2f('0xa2'),{'UserId':Number(_0x873ad1[_0x6f2f('0x48')][_0x6f2f('0x5c')][_0x3f7cde]),'CmListId':Number(_0x873ad1[_0x6f2f('0x52')]['id'])});}return _0x1c71fe;});}})[_0x6f2f('0x28')](respondWithResult(_0xa9d775,null))[_0x6f2f('0x43')](handleError(_0xa9d775,null));};exports[_0x6f2f('0xa3')]=function(_0x3f5a99,_0x5cd9fc,_0x4c686b){return db['CmList'][_0x6f2f('0x4e')]({'where':{'id':_0x3f5a99[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x5cd9fc,null))['then'](function(_0x4b6dc3){if(_0x4b6dc3){return _0x4b6dc3[_0x6f2f('0xa3')](_0x3f5a99['query'][_0x6f2f('0x5c')])['then'](function(){if(_[_0x6f2f('0x5f')](_0x3f5a99['query']['ids'])){for(var _0x5e1748=0x0;_0x5e1748<_0x3f5a99[_0x6f2f('0x33')][_0x6f2f('0x5c')][_0x6f2f('0x39')];_0x5e1748+=0x1){socket['emit'](_0x6f2f('0xa4'),{'UserId':Number(_0x3f5a99['query']['ids'][_0x5e1748]),'CmListId':Number(_0x3f5a99[_0x6f2f('0x52')]['id'])});}}else{socket[_0x6f2f('0xa1')](_0x6f2f('0xa4'),{'UserId':Number(_0x3f5a99[_0x6f2f('0x33')][_0x6f2f('0x5c')]),'CmListId':Number(_0x3f5a99[_0x6f2f('0x52')]['id'])});}});}})[_0x6f2f('0x28')](respondWithStatusCode(_0x5cd9fc,null))[_0x6f2f('0x43')](handleError(_0x5cd9fc,null));};exports[_0x6f2f('0xa5')]=function(_0x53bb4f,_0x264375,_0x1ef67b){var _0x86b437={};var _0x4fc8e6={};var _0x1d8ead;var _0x57cd27;return db[_0x6f2f('0x2f')][_0x6f2f('0x9c')]({'where':{'id':_0x53bb4f[_0x6f2f('0x52')]['id']}})[_0x6f2f('0x28')](handleEntityNotFound(_0x264375,null))[_0x6f2f('0x28')](function(_0x3a8bc7){if(_0x3a8bc7){_0x1d8ead=_0x3a8bc7;_0x4fc8e6['model']=_['keys'](db['User'][_0x6f2f('0x30')]);_0x4fc8e6[_0x6f2f('0x33')]=_[_0x6f2f('0x34')](_0x53bb4f[_0x6f2f('0x33')]);_0x4fc8e6[_0x6f2f('0x35')]=_['intersection'](_0x4fc8e6[_0x6f2f('0x36')],_0x4fc8e6['query']);_0x86b437[_0x6f2f('0x38')]=_[_0x6f2f('0x45')](_0x4fc8e6[_0x6f2f('0x36')],qs[_0x6f2f('0x37')](_0x53bb4f[_0x6f2f('0x33')]['fields']));_0x86b437[_0x6f2f('0x38')]=_0x86b437[_0x6f2f('0x38')][_0x6f2f('0x39')]?_0x86b437[_0x6f2f('0x38')]:_0x4fc8e6[_0x6f2f('0x36')];_0x86b437[_0x6f2f('0x3c')]=qs['sort'](_0x53bb4f['query'][_0x6f2f('0x3d')]);_0x86b437[_0x6f2f('0x3e')]=qs['filters'](_[_0x6f2f('0x58')](_0x53bb4f[_0x6f2f('0x33')],_0x4fc8e6[_0x6f2f('0x35')]));if(_0x53bb4f[_0x6f2f('0x33')][_0x6f2f('0x3f')]){_0x86b437[_0x6f2f('0x3e')]=_['merge'](_0x86b437['where'],{'$or':_[_0x6f2f('0x2e')](_0x86b437[_0x6f2f('0x38')],function(_0x3b9ff4){var _0x8c1936={};_0x8c1936[_0x3b9ff4]={'$like':'%'+_0x53bb4f['query']['filter']+'%'};return _0x8c1936;})});}_0x86b437=_[_0x6f2f('0x40')]({},_0x86b437,_0x53bb4f[_0x6f2f('0x59')]);return _0x1d8ead[_0x6f2f('0xa5')](_0x86b437);}})[_0x6f2f('0x28')](function(_0x3d5a3a){if(_0x3d5a3a){_0x57cd27=_0x3d5a3a[_0x6f2f('0x39')];if(!_0x53bb4f[_0x6f2f('0x33')][_0x6f2f('0x3a')](_0x6f2f('0x3b'))){_0x86b437[_0x6f2f('0x20')]=qs[_0x6f2f('0x20')](_0x53bb4f[_0x6f2f('0x33')]['limit']);_0x86b437['offset']=qs[_0x6f2f('0x1e')](_0x53bb4f[_0x6f2f('0x33')]['offset']);}return _0x1d8ead[_0x6f2f('0xa5')](_0x86b437);}})[_0x6f2f('0x28')](function(_0xd340c2){if(_0xd340c2){return _0xd340c2?{'count':_0x57cd27,'rows':_0xd340c2}:null;}})[_0x6f2f('0x28')](respondWithResult(_0x264375,null))[_0x6f2f('0x43')](handleError(_0x264375,null));};function handleQuery(_0x498d2d){logger[_0x6f2f('0xa6')](_0x498d2d);return db[_0x6f2f('0x90')][_0x6f2f('0x33')](_0x498d2d)[_0x6f2f('0xa0')](function(_0x51b3b5){csv_results[_0x6f2f('0x65')](_0x51b3b5);})['catch'](function(_0x5d2ecd){logger[_0x6f2f('0xa7')](_0x5d2ecd[_0x6f2f('0x68')]);});} \ No newline at end of file +var _0x01cf=['attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','rows','catch','show','keys','find','create','body','user','get','role','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','CmContact','tags','join','isArray','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','getContactsCsv','findAll','OrderBy','alias','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','sequelize','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','./cmList.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','UserProfileResource','name','index','map','CmList','rawAttributes','fieldName','key','model','query','filters','intersection','fields'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x01cf,0x19f));var _0xf01c=function(_0xa8e026,_0x2dd3c5){_0xa8e026=_0xa8e026-0x0;var _0x1e044d=_0x01cf[_0xa8e026];return _0x1e044d;};'use strict';var emlformat=require(_0xf01c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf01c('0x1'));var moment=require(_0xf01c('0x2'));var BPromise=require(_0xf01c('0x3'));var Mustache=require(_0xf01c('0x4'));var util=require(_0xf01c('0x5'));var path=require('path');var sox=require(_0xf01c('0x6'));var csv=require(_0xf01c('0x7'));var ejs=require(_0xf01c('0x8'));var fs=require('fs');var fs_extra=require(_0xf01c('0x9'));var _=require(_0xf01c('0xa'));var squel=require('squel');var crypto=require(_0xf01c('0xb'));var jsforce=require(_0xf01c('0xc'));var deskjs=require(_0xf01c('0xd'));var toCsv=require(_0xf01c('0x7'));var querystring=require(_0xf01c('0xe'));var Papa=require(_0xf01c('0xf'));var Redis=require(_0xf01c('0x10'));var authService=require(_0xf01c('0x11'));var qs=require(_0xf01c('0x12'));var as=require(_0xf01c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf01c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf01c('0x15'));var licenseUtil=require(_0xf01c('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf01c('0x17')]));require(_0xf01c('0x18'))['register'](socket);function respondWithStatusCode(_0x9a0bf0,_0x21f124){_0x21f124=_0x21f124||0xcc;return function(_0x5ebb14){if(_0x5ebb14){return _0x9a0bf0[_0xf01c('0x19')](_0x21f124);}return _0x9a0bf0['status'](_0x21f124)[_0xf01c('0x1a')]();};}function respondWithResult(_0x47f369,_0x396ec2){_0x396ec2=_0x396ec2||0xc8;return function(_0x122515){if(_0x122515){return _0x47f369[_0xf01c('0x1b')](_0x396ec2)[_0xf01c('0x1c')](_0x122515);}};}function respondWithFilteredResult(_0x29795f,_0x1eef20){return function(_0x359f5c){if(_0x359f5c){var _0x47628c=typeof _0x1eef20[_0xf01c('0x1d')]===_0xf01c('0x1e')&&typeof _0x1eef20[_0xf01c('0x1f')]===_0xf01c('0x1e');var _0x12c5b0=_0x359f5c[_0xf01c('0x20')];var _0x2530a5=_0x47628c?0x0:_0x1eef20['offset'];var _0x283c6d=_0x47628c?_0x359f5c[_0xf01c('0x20')]:_0x1eef20[_0xf01c('0x1d')]+_0x1eef20['limit'];var _0x16c860;if(_0x283c6d>=_0x12c5b0){_0x283c6d=_0x12c5b0;_0x16c860=0xc8;}else{_0x16c860=0xce;}_0x29795f[_0xf01c('0x1b')](_0x16c860);return _0x29795f[_0xf01c('0x21')]('Content-Range',_0x2530a5+'-'+_0x283c6d+'/'+_0x12c5b0)[_0xf01c('0x1c')](_0x359f5c);}return null;};}function patchUpdates(_0x4dea2e){return function(_0x2669c7){try{jsonpatch[_0xf01c('0x22')](_0x2669c7,_0x4dea2e,!![]);}catch(_0x3e69eb){return BPromise[_0xf01c('0x23')](_0x3e69eb);}return _0x2669c7[_0xf01c('0x24')]();};}function saveUpdates(_0x38a597,_0x20b3a5){return function(_0x5410f6){if(_0x5410f6){return _0x5410f6[_0xf01c('0x25')](_0x38a597)[_0xf01c('0x26')](function(_0x7df0c2){return _0x7df0c2;});}return null;};}function removeEntity(_0x5ce22f,_0x4a9db1){return function(_0x2a0647){if(_0x2a0647){return _0x2a0647[_0xf01c('0x27')]()[_0xf01c('0x26')](function(){var _0xfa55a5=_0x2a0647['get']({'plain':!![]});var _0x306994='Lists';return db[_0xf01c('0x28')][_0xf01c('0x27')]({'where':{'type':_0x306994,'resourceId':_0xfa55a5['id']}})[_0xf01c('0x26')](function(){return _0x2a0647;});})[_0xf01c('0x26')](function(){_0x5ce22f[_0xf01c('0x1b')](0xcc)[_0xf01c('0x1a')]();});}};}function handleEntityNotFound(_0x9e81f2,_0x557415){return function(_0x5c471c){if(!_0x5c471c){_0x9e81f2[_0xf01c('0x19')](0x194);}return _0x5c471c;};}function handleError(_0x2b69ea,_0x459c17){_0x459c17=_0x459c17||0x1f4;return function(_0x513e55){logger['error'](_0x513e55['stack']);if(_0x513e55[_0xf01c('0x29')]){delete _0x513e55[_0xf01c('0x29')];}_0x2b69ea[_0xf01c('0x1b')](_0x459c17)['send'](_0x513e55);};}exports[_0xf01c('0x2a')]=function(_0x5c9807,_0x4badc5){var _0xacb284={},_0x246525={},_0x4c55b1={'count':0x0,'rows':[]};var _0xb567cd=_[_0xf01c('0x2b')](db[_0xf01c('0x2c')][_0xf01c('0x2d')],function(_0x327dcf){return{'name':_0x327dcf[_0xf01c('0x2e')],'type':_0x327dcf['type'][_0xf01c('0x2f')]};});_0x246525[_0xf01c('0x30')]=_[_0xf01c('0x2b')](_0xb567cd,_0xf01c('0x29'));_0x246525[_0xf01c('0x31')]=_['keys'](_0x5c9807[_0xf01c('0x31')]);_0x246525[_0xf01c('0x32')]=_[_0xf01c('0x33')](_0x246525['model'],_0x246525[_0xf01c('0x31')]);_0xacb284['attributes']=_[_0xf01c('0x33')](_0x246525[_0xf01c('0x30')],qs[_0xf01c('0x34')](_0x5c9807[_0xf01c('0x31')][_0xf01c('0x34')]));_0xacb284[_0xf01c('0x35')]=_0xacb284[_0xf01c('0x35')][_0xf01c('0x36')]?_0xacb284[_0xf01c('0x35')]:_0x246525[_0xf01c('0x30')];if(!_0x5c9807[_0xf01c('0x31')][_0xf01c('0x37')](_0xf01c('0x38'))){_0xacb284[_0xf01c('0x1f')]=qs[_0xf01c('0x1f')](_0x5c9807[_0xf01c('0x31')][_0xf01c('0x1f')]);_0xacb284[_0xf01c('0x1d')]=qs[_0xf01c('0x1d')](_0x5c9807['query'][_0xf01c('0x1d')]);}_0xacb284[_0xf01c('0x39')]=qs['sort'](_0x5c9807['query'][_0xf01c('0x3a')]);_0xacb284['where']=qs[_0xf01c('0x32')](_[_0xf01c('0x3b')](_0x5c9807['query'],_0x246525['filters']),_0xb567cd);if(_0x5c9807[_0xf01c('0x31')][_0xf01c('0x3c')]){_0xacb284['where']=_[_0xf01c('0x3d')](_0xacb284[_0xf01c('0x3e')],{'$or':_[_0xf01c('0x2b')](_0xb567cd,function(_0x173d29){if(_0x173d29[_0xf01c('0x3f')]!=='VIRTUAL'){var _0x292d09={};_0x292d09[_0x173d29['name']]={'$like':'%'+_0x5c9807['query'][_0xf01c('0x3c')]+'%'};return _0x292d09;}})});}_0xacb284=_['merge']({},_0xacb284,_0x5c9807[_0xf01c('0x40')]);var _0x573865={'where':_0xacb284[_0xf01c('0x3e')]};return db['CmList']['count'](_0x573865)[_0xf01c('0x26')](function(_0x2723e4){_0x4c55b1[_0xf01c('0x20')]=_0x2723e4;if(_0x5c9807[_0xf01c('0x31')][_0xf01c('0x41')]){_0xacb284['include']=[{'all':!![]}];}return db[_0xf01c('0x2c')]['findAll'](_0xacb284);})[_0xf01c('0x26')](function(_0x35a58a){_0x4c55b1[_0xf01c('0x42')]=_0x35a58a;return _0x4c55b1;})[_0xf01c('0x26')](respondWithFilteredResult(_0x4badc5,_0xacb284))[_0xf01c('0x43')](handleError(_0x4badc5,null));};exports[_0xf01c('0x44')]=function(_0x42c5cd,_0x2ad282){var _0x7eeefa={'raw':![],'where':{'id':_0x42c5cd['params']['id']}},_0x4adea8={};_0x4adea8[_0xf01c('0x30')]=_[_0xf01c('0x45')](db[_0xf01c('0x2c')][_0xf01c('0x2d')]);_0x4adea8['query']=_[_0xf01c('0x45')](_0x42c5cd['query']);_0x4adea8[_0xf01c('0x32')]=_[_0xf01c('0x33')](_0x4adea8[_0xf01c('0x30')],_0x4adea8[_0xf01c('0x31')]);_0x7eeefa[_0xf01c('0x35')]=_['intersection'](_0x4adea8[_0xf01c('0x30')],qs[_0xf01c('0x34')](_0x42c5cd[_0xf01c('0x31')][_0xf01c('0x34')]));_0x7eeefa[_0xf01c('0x35')]=_0x7eeefa['attributes'][_0xf01c('0x36')]?_0x7eeefa[_0xf01c('0x35')]:_0x4adea8[_0xf01c('0x30')];if(_0x42c5cd[_0xf01c('0x31')][_0xf01c('0x41')]){_0x7eeefa['include']=[{'all':!![]}];}_0x7eeefa=_[_0xf01c('0x3d')]({},_0x7eeefa,_0x42c5cd[_0xf01c('0x40')]);return db['CmList'][_0xf01c('0x46')](_0x7eeefa)['then'](handleEntityNotFound(_0x2ad282,null))[_0xf01c('0x26')](respondWithResult(_0x2ad282,null))[_0xf01c('0x43')](handleError(_0x2ad282,null));};exports[_0xf01c('0x47')]=function(_0x7a3112,_0x1ae560){return db[_0xf01c('0x2c')][_0xf01c('0x47')](_0x7a3112[_0xf01c('0x48')],{})[_0xf01c('0x26')](function(_0x605f7e){var _0x1ed466=_0x7a3112[_0xf01c('0x49')][_0xf01c('0x4a')]({'plain':!![]});if(!_0x1ed466)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ed466[_0xf01c('0x4b')]===_0xf01c('0x49')){var _0x5b42d3=_0x605f7e[_0xf01c('0x4a')]({'plain':!![]});var _0xa557=_0xf01c('0x4c');return db[_0xf01c('0x4d')]['find']({'where':{'name':_0xa557,'userProfileId':_0x1ed466[_0xf01c('0x4e')]},'raw':!![]})[_0xf01c('0x26')](function(_0x84fd51){if(_0x84fd51&&_0x84fd51[_0xf01c('0x4f')]===0x0){return db[_0xf01c('0x28')][_0xf01c('0x47')]({'name':_0x5b42d3[_0xf01c('0x29')],'resourceId':_0x5b42d3['id'],'type':_0x84fd51['name'],'sectionId':_0x84fd51['id']},{})[_0xf01c('0x26')](function(){return _0x605f7e;});}else{return _0x605f7e;}})[_0xf01c('0x43')](function(_0x113b07){logger[_0xf01c('0x50')](_0xf01c('0x51'),_0x113b07);throw _0x113b07;});}return _0x605f7e;})[_0xf01c('0x26')](respondWithResult(_0x1ae560,0xc9))[_0xf01c('0x43')](handleError(_0x1ae560,null));};exports[_0xf01c('0x25')]=function(_0x366546,_0x24a898){if(_0x366546[_0xf01c('0x48')]['id']){delete _0x366546[_0xf01c('0x48')]['id'];}return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0x366546[_0xf01c('0x52')]['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x24a898,null))[_0xf01c('0x26')](saveUpdates(_0x366546[_0xf01c('0x48')],null))[_0xf01c('0x26')](respondWithResult(_0x24a898,null))['catch'](handleError(_0x24a898,null));};exports[_0xf01c('0x27')]=function(_0xa91871,_0x38092f){return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0xa91871['params']['id']}})['then'](handleEntityNotFound(_0x38092f,null))[_0xf01c('0x26')](removeEntity(_0x38092f,null))[_0xf01c('0x43')](handleError(_0x38092f,null));};exports['describe']=function(_0x5cea72,_0x21ff95){return db[_0xf01c('0x2c')][_0xf01c('0x53')]()[_0xf01c('0x26')](respondWithResult(_0x21ff95,null))[_0xf01c('0x43')](handleError(_0x21ff95,null));};exports[_0xf01c('0x54')]=function(_0x3dd15d,_0x18b8c9,_0x48d8c9){if(_0x3dd15d[_0xf01c('0x48')]['id']){delete _0x3dd15d[_0xf01c('0x48')]['id'];}return db['CmList'][_0xf01c('0x46')]({'where':{'id':_0x3dd15d[_0xf01c('0x52')]['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x18b8c9,null))[_0xf01c('0x26')](function(_0x41373a){if(_0x41373a){_0x3dd15d[_0xf01c('0x48')][_0xf01c('0x55')]=_0x41373a['id'];return db[_0xf01c('0x56')][_0xf01c('0x47')](_0x3dd15d[_0xf01c('0x48')]);}})[_0xf01c('0x26')](respondWithResult(_0x18b8c9,null))[_0xf01c('0x43')](handleError(_0x18b8c9,null));};exports[_0xf01c('0x57')]=function(_0x137faf,_0x39d396,_0x16e1e0){var _0x10fe1d={'raw':![],'where':{}};var _0x3eb71a={};var _0x2c34d5={'count':0x0,'rows':[]};return db[_0xf01c('0x2c')][_0xf01c('0x58')]({'where':{'id':_0x137faf[_0xf01c('0x52')]['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x39d396,null))[_0xf01c('0x26')](function(_0x281e60){if(_0x281e60){_0x3eb71a[_0xf01c('0x30')]=_[_0xf01c('0x45')](db[_0xf01c('0x56')][_0xf01c('0x2d')]);_0x3eb71a['query']=_['keys'](_0x137faf[_0xf01c('0x31')]);_0x3eb71a[_0xf01c('0x32')]=_[_0xf01c('0x33')](_0x3eb71a[_0xf01c('0x30')],_0x3eb71a[_0xf01c('0x31')]);_0x10fe1d[_0xf01c('0x35')]=_[_0xf01c('0x33')](_0x3eb71a['model'],qs[_0xf01c('0x34')](_0x137faf[_0xf01c('0x31')][_0xf01c('0x34')]));_0x10fe1d[_0xf01c('0x35')]=_0x10fe1d[_0xf01c('0x35')][_0xf01c('0x36')]?_0x10fe1d[_0xf01c('0x35')]:_0x3eb71a[_0xf01c('0x30')];if(!_0x137faf[_0xf01c('0x31')]['hasOwnProperty'](_0xf01c('0x38'))){_0x10fe1d[_0xf01c('0x1f')]=qs['limit'](_0x137faf[_0xf01c('0x31')]['limit']);_0x10fe1d[_0xf01c('0x1d')]=qs[_0xf01c('0x1d')](_0x137faf['query'][_0xf01c('0x1d')]);}_0x10fe1d[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x137faf[_0xf01c('0x31')]['sort']);_0x10fe1d['where']=qs[_0xf01c('0x32')](_[_0xf01c('0x3b')](_0x137faf['query'],_0x3eb71a[_0xf01c('0x32')]));_0x10fe1d[_0xf01c('0x3e')][_0xf01c('0x55')]=_0x281e60['id'];if(_0x137faf[_0xf01c('0x31')]['filter']){_0x10fe1d['where']=_['merge'](_0x10fe1d[_0xf01c('0x3e')],{'$or':_[_0xf01c('0x2b')](_0x10fe1d[_0xf01c('0x35')],function(_0x5edf2c){var _0x4de737={};_0x4de737[_0x5edf2c]={'$like':'%'+_0x137faf[_0xf01c('0x31')][_0xf01c('0x3c')]+'%'};return _0x4de737;})});}_0x10fe1d=_['merge']({},_0x10fe1d,_0x137faf[_0xf01c('0x40')]);return db[_0xf01c('0x56')][_0xf01c('0x20')]({'where':_0x10fe1d[_0xf01c('0x3e')]})[_0xf01c('0x26')](function(_0x19fbda){_0x2c34d5[_0xf01c('0x20')]=_0x19fbda;if(_0x137faf[_0xf01c('0x31')]['includeAll']){_0x10fe1d['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x10fe1d);})[_0xf01c('0x26')](function(_0x32ebdc){_0x2c34d5[_0xf01c('0x42')]=_0x32ebdc;return _0x2c34d5;});}})[_0xf01c('0x26')](respondWithFilteredResult(_0x39d396,_0x10fe1d))[_0xf01c('0x43')](handleError(_0x39d396,null));};exports['removeDispositions']=function(_0x2d58a1,_0x1a4116,_0x4a9133){return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0x2d58a1[_0xf01c('0x52')]['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x1a4116,null))[_0xf01c('0x26')](function(_0x1ad9a0){if(_0x1ad9a0){return _0x1ad9a0[_0xf01c('0x59')](_0x2d58a1[_0xf01c('0x31')][_0xf01c('0x5a')]);}})[_0xf01c('0x26')](respondWithStatusCode(_0x1a4116,null))['catch'](handleError(_0x1a4116,null));};exports['addContacts']=function(_0x496cd1,_0x2b7b9c,_0xa8f4de){return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0x496cd1['params']['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x2b7b9c,null))[_0xf01c('0x26')](function(_0xc6840b){if(_0xc6840b){var _0x440c51=[];var _0x564c36={'success':[],'errors':[]};return db[_0xf01c('0x5b')][_0xf01c('0x53')]()[_0xf01c('0x26')](function(_0x585cd2){if(_0x496cd1[_0xf01c('0x48')]['tags']&&_['isArray'](_0x496cd1['body'][_0xf01c('0x5c')])){if(_0x496cd1[_0xf01c('0x48')][_0xf01c('0x5c')]['length']){_0x496cd1[_0xf01c('0x48')][_0xf01c('0x5c')]=_0x496cd1[_0xf01c('0x48')]['tags'][_0xf01c('0x5d')](';')+';';}else{_0x496cd1[_0xf01c('0x48')]['tags']=null;}}else{_0x496cd1[_0xf01c('0x48')][_0xf01c('0x5c')]=null;}if(_0x496cd1[_0xf01c('0x48')]&&_[_0xf01c('0x5e')](_0x496cd1['body'])){for(var _0x4a62e9=0x0;_0x4a62e9<_0x496cd1[_0xf01c('0x48')]['length'];_0x4a62e9+=0x1){_0x496cd1[_0xf01c('0x48')][_0x4a62e9]['ListId']=_0x496cd1[_0xf01c('0x52')]['id'];_0x440c51[_0xf01c('0x5f')](_0x496cd1[_0xf01c('0x48')][_0x4a62e9]);}return BPromise[_0xf01c('0x60')](_0x440c51,function(_0x4b54cb){return db[_0xf01c('0x5b')][_0xf01c('0x47')](_[_0xf01c('0x61')](_0x4b54cb,['ids','id'])||{},{'fields':_[_0xf01c('0x45')](_0x585cd2),'raw':!![]})[_0xf01c('0x26')](function(_0x5668e9){_0x564c36['success'][_0xf01c('0x5f')](_0x5668e9[_0xf01c('0x62')]);})[_0xf01c('0x43')](function(_0x47aca9){_0x564c36[_0xf01c('0x63')]['push']({'data':_0x4b54cb,'error':_0x47aca9[_0xf01c('0x64')]});});})[_0xf01c('0x26')](function(_0x3bca30){return _0x564c36;})[_0xf01c('0x43')](function(_0x226203){return _0x226203;});}else{_0x2b7b9c[_0xf01c('0x1b')](0x190)[_0xf01c('0x1c')]({'message':_0xf01c('0x65')});}});}})[_0xf01c('0x26')](respondWithResult(_0x2b7b9c,null))['catch'](handleError(_0x2b7b9c,null));};exports[_0xf01c('0x66')]=function(_0x3f5345,_0x17e110,_0x2dac4d){var _0x5e909d;return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0x3f5345['params']['id']},'include':[{'model':db[_0xf01c('0x67')],'as':_0xf01c('0x68')}]})[_0xf01c('0x26')](handleEntityNotFound(_0x17e110,null))[_0xf01c('0x26')](function(_0x4dce0e){if(_0x4dce0e){_0x5e909d=_0x4dce0e;return db[_0xf01c('0x5b')][_0xf01c('0x2d')];}})['then'](function(_0x446af3){if(_0x446af3){var _0xca4dae={};var _0x1821e7={};_0x1821e7[_0xf01c('0x30')]=_[_0xf01c('0x69')](_[_0xf01c('0x45')](_0x446af3),_[_0xf01c('0x2b')](_0x5e909d[_0xf01c('0x68')],function(_0x46a4e7){return util['format']('cf_%d',_0x46a4e7['id']);}));_0x1821e7[_0xf01c('0x31')]=_['keys'](_0x3f5345[_0xf01c('0x31')]);_0x1821e7[_0xf01c('0x32')]=_[_0xf01c('0x33')](_0x1821e7[_0xf01c('0x30')],_0x1821e7[_0xf01c('0x31')]);_0xca4dae[_0xf01c('0x35')]=_[_0xf01c('0x33')](_0x1821e7['model'],qs['fields'](_0x3f5345['query'][_0xf01c('0x34')]));_0xca4dae[_0xf01c('0x35')]=_0xca4dae[_0xf01c('0x35')][_0xf01c('0x36')]?_0xca4dae[_0xf01c('0x35')]:_0x1821e7[_0xf01c('0x30')];if(!_0x3f5345['query'][_0xf01c('0x37')](_0xf01c('0x38'))){_0xca4dae['limit']=qs[_0xf01c('0x1f')](_0x3f5345['query'][_0xf01c('0x1f')]);_0xca4dae[_0xf01c('0x1d')]=qs['offset'](_0x3f5345[_0xf01c('0x31')][_0xf01c('0x1d')]);}_0xca4dae[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x3f5345[_0xf01c('0x31')]['sort']);_0xca4dae[_0xf01c('0x3e')]=qs['filters'](_[_0xf01c('0x3b')](_0x3f5345['query'],_0x1821e7[_0xf01c('0x32')]));_0xca4dae['raw']=!![];if(_0x3f5345[_0xf01c('0x31')][_0xf01c('0x3c')]){_0xca4dae[_0xf01c('0x3e')]=_[_0xf01c('0x3d')](_0xca4dae[_0xf01c('0x3e')],{'$or':_[_0xf01c('0x2b')](_0xca4dae[_0xf01c('0x35')],function(_0x31e85e){var _0x221f94={};_0x221f94[_0x31e85e]={'$like':'%'+_0x3f5345[_0xf01c('0x31')][_0xf01c('0x3c')]+'%'};return _0x221f94;})});}_0xca4dae=_['merge']({},_0xca4dae,_0x3f5345['options']);return _0x5e909d[_0xf01c('0x66')](_0xca4dae);}})[_0xf01c('0x26')](respondWithResult(_0x17e110,null))['catch'](handleError(_0x17e110,null));};exports[_0xf01c('0x6a')]=function(_0x3e2f55,_0x430da2,_0x5430d0){var _0x5f08a2;var _0x2ebded;var _0x3b5803;var _0x59c2d8=_0x3e2f55[_0xf01c('0x52')]['id'];csv_results=[];return db['ContactItemType'][_0xf01c('0x6b')]({'attributes':['id',_0xf01c('0x29')],'raw':!![],'order':[_0xf01c('0x6c')]})[_0xf01c('0x26')](function(_0x5cd162){_0x5f08a2=_0x5cd162;var _0x52d2b5=_[_0xf01c('0x45')](db[_0xf01c('0x5b')][_0xf01c('0x2d')]);return db['CmCustomField'][_0xf01c('0x6b')]({'raw':!![],'attributes':['id',_0xf01c('0x6d')]})[_0xf01c('0x26')](function(_0x387373){_0x2ebded=_0x387373;var _0x3941e6=squel[_0xf01c('0x6e')]()['fields'](_0x52d2b5)['from'](_0xf01c('0x6f'),'c')[_0xf01c('0x3e')](_0xf01c('0x70'),_0x59c2d8)[_0xf01c('0x3e')](_0xf01c('0x71'))[_0xf01c('0x72')]();for(var _0x23f825=0x0;_0x23f825<_0x2ebded[_0xf01c('0x36')];_0x23f825++){_0x3941e6[_0xf01c('0x73')](_0xf01c('0x74')+_0x2ebded[_0x23f825]['id'],_0xf01c('0x75')+_0x2ebded[_0x23f825][_0xf01c('0x6d')]);}for(var _0x23f825=0x0;_0x23f825<_0x5f08a2[_0xf01c('0x36')];_0x23f825++){_0x3941e6['field'](squel[_0xf01c('0x6e')]()['field'](_0xf01c('0x76'))[_0xf01c('0x77')](_0xf01c('0x78'))['where'](_0xf01c('0x79'),_0x5f08a2[_0x23f825]['id'])[_0xf01c('0x3e')](_0xf01c('0x7a')),_0xf01c('0x7b')+_0x5f08a2[_0x23f825][_0xf01c('0x29')]);_0x3941e6['field'](squel[_0xf01c('0x6e')]()[_0xf01c('0x73')](_0xf01c('0x7c'))[_0xf01c('0x77')]('cm_contact_has_items')[_0xf01c('0x3e')]('ItemTypeId\x20=\x20?',_0x5f08a2[_0x23f825]['id'])[_0xf01c('0x3e')]('CmContactId\x20=\x20c.id'),_0xf01c('0x7d')+_0x5f08a2[_0x23f825][_0xf01c('0x29')]);}var _0x18dbc2=[];_0x18dbc2[_0xf01c('0x5f')](_0x3941e6[_0xf01c('0x7e')]());BPromise[_0xf01c('0x60')](_0x18dbc2,handleQuery)[_0xf01c('0x26')](function(_0x1ce8de){handleQuery(_0x3941e6[_0xf01c('0x7e')]());var _0x3fe9b9=csv_results[0x0];if(!_['isEmpty'](_0x3fe9b9)){var _0x2233c4=toCsv(_0x3fe9b9);var _0x5dba4e=Date['now']();fs['writeFileSync'](util[_0xf01c('0x7f')](_0xf01c('0x80'),_0x59c2d8,_0x5dba4e),_0x2233c4);_0x430da2[_0xf01c('0x81')](_0xf01c('0x82'),_0xf01c('0x83')+util[_0xf01c('0x7f')]('list_%d_%s.csv',_0x59c2d8,_0x5dba4e));_0x430da2[_0xf01c('0x81')](_0xf01c('0x84'),'text/csv');return _0x430da2[_0xf01c('0x85')](util['format'](_0xf01c('0x80'),_0x59c2d8,_0x5dba4e));}else{return _0x430da2[_0xf01c('0x19')](0xcc);}});});});};exports[_0xf01c('0x86')]=function(_0x3fd253,_0x2e8a11,_0x26f627){var _0x4ddfd1;delete _0x3fd253['body']['id'];return db[_0xf01c('0x2c')]['findOne']({'where':{'id':_0x3fd253[_0xf01c('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e8a11,null))[_0xf01c('0x26')](function(_0x339f7d){if(_0x339f7d){return db['sequelize']['transaction'](function(_0x2b187e){return db[_0xf01c('0x67')]['create'](_0x3fd253[_0xf01c('0x48')],{'transaction':_0x2b187e})[_0xf01c('0x26')](function(_0x26924e){_0x4ddfd1=_0x26924e;return _0x339f7d['addCustomFields'](_0x26924e,{'transaction':_0x2b187e});})[_0xf01c('0x26')](function(){var _0x4700ac={'type':db[_0xf01c('0x87')][_0xf01c('0x88')],'transaction':_0x2b187e};switch(_0x3fd253[_0xf01c('0x48')]['type']){case'text':_0x4700ac['type']=db[_0xf01c('0x87')][_0xf01c('0x88')];break;case _0xf01c('0x89'):_0x4700ac['type']=db[_0xf01c('0x87')][_0xf01c('0x8a')];break;case _0xf01c('0x8b'):_0x4700ac[_0xf01c('0x3f')]=db[_0xf01c('0x87')][_0xf01c('0x8c')];_0x4700ac[_0xf01c('0x8d')]=![];break;default:}return db['sequelize'][_0xf01c('0x8e')]['addColumn'](_0xf01c('0x6f'),util['format'](_0xf01c('0x8f'),_0x4ddfd1['id']),_0x4700ac);})['then'](function(){return _0x4ddfd1;});});}})['then'](respondWithResult(_0x2e8a11,null))['catch'](handleError(_0x2e8a11,null));};exports['getCustomFields']=function(_0x483520,_0x50ed48,_0x2981e3){var _0x2ed5f7={};var _0xabdb3e={};var _0x20ba34;var _0x453a23;return db[_0xf01c('0x2c')][_0xf01c('0x58')]({'where':{'id':_0x483520['params']['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x50ed48,null))[_0xf01c('0x26')](function(_0x254bc3){if(_0x254bc3){_0x20ba34=_0x254bc3;_0xabdb3e[_0xf01c('0x30')]=_['keys'](db[_0xf01c('0x67')][_0xf01c('0x2d')]);_0xabdb3e[_0xf01c('0x31')]=_[_0xf01c('0x45')](_0x483520['query']);_0xabdb3e['filters']=_[_0xf01c('0x33')](_0xabdb3e[_0xf01c('0x30')],_0xabdb3e['query']);_0x2ed5f7[_0xf01c('0x35')]=_[_0xf01c('0x33')](_0xabdb3e[_0xf01c('0x30')],qs[_0xf01c('0x34')](_0x483520[_0xf01c('0x31')][_0xf01c('0x34')]));_0x2ed5f7[_0xf01c('0x35')]=_0x2ed5f7[_0xf01c('0x35')][_0xf01c('0x36')]?_0x2ed5f7[_0xf01c('0x35')]:_0xabdb3e['model'];_0x2ed5f7[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x483520['query'][_0xf01c('0x3a')]);_0x2ed5f7['where']=qs[_0xf01c('0x32')](_[_0xf01c('0x3b')](_0x483520[_0xf01c('0x31')],_0xabdb3e[_0xf01c('0x32')]));_0x2ed5f7['where']=_[_0xf01c('0x3d')](_0x2ed5f7[_0xf01c('0x3e')],{'$or':[{'ListId':_0x254bc3['id']},{'ListId':null}]});if(_0x483520[_0xf01c('0x31')][_0xf01c('0x3c')]){_0x2ed5f7[_0xf01c('0x3e')]=_['merge'](_0x2ed5f7['where'],{'$or':_[_0xf01c('0x2b')](_0x2ed5f7[_0xf01c('0x35')],function(_0x263aec){var _0x195feb={};_0x195feb[_0x263aec]={'$like':'%'+_0x483520['query']['filter']+'%'};return _0x195feb;})});}_0x2ed5f7=_['merge']({},_0x2ed5f7,_0x483520['options']);return db['CmCustomField'][_0xf01c('0x90')](_0x2ed5f7);}})[_0xf01c('0x26')](respondWithResult(_0x50ed48,null))[_0xf01c('0x43')](handleError(_0x50ed48,null));};exports[_0xf01c('0x91')]=function(_0x213047,_0x30b4c3){return db['CmCustomField'][_0xf01c('0x90')]({'where':{'ListId':null}})[_0xf01c('0x26')](handleEntityNotFound(_0x30b4c3,null))[_0xf01c('0x26')](function(_0x4a30a1){return _0x4a30a1;})[_0xf01c('0x26')](respondWithResult(_0x30b4c3,null))['catch'](handleError(_0x30b4c3,null));};exports[_0xf01c('0x92')]=function(_0x76ce23,_0x462a0e,_0x134d5b){return db[_0xf01c('0x2c')]['find']({'where':{'id':_0x76ce23[_0xf01c('0x52')]['id']}})['then'](handleEntityNotFound(_0x462a0e,null))[_0xf01c('0x26')](function(_0x22e777){if(_0x22e777){return _0x22e777[_0xf01c('0x92')](_0x76ce23[_0xf01c('0x48')][_0xf01c('0x5a')],_[_0xf01c('0x61')](_0x76ce23[_0xf01c('0x48')],[_0xf01c('0x5a'),'id'])||{})[_0xf01c('0x93')](function(_0x515518){for(var _0x393680=0x0;_0x393680<_0x76ce23[_0xf01c('0x48')][_0xf01c('0x5a')][_0xf01c('0x36')];_0x393680+=0x1){socket['emit'](_0xf01c('0x94'),{'UserId':Number(_0x76ce23[_0xf01c('0x48')][_0xf01c('0x5a')][_0x393680]),'CmListId':Number(_0x76ce23[_0xf01c('0x52')]['id'])});}return _0x515518;});}})[_0xf01c('0x26')](respondWithResult(_0x462a0e,null))[_0xf01c('0x43')](handleError(_0x462a0e,null));};exports['removeAgents']=function(_0x377e6e,_0x2cd5bc,_0x3b0d6a){return db[_0xf01c('0x2c')][_0xf01c('0x46')]({'where':{'id':_0x377e6e['params']['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x2cd5bc,null))['then'](function(_0x2f9121){if(_0x2f9121){return _0x2f9121[_0xf01c('0x95')](_0x377e6e[_0xf01c('0x31')][_0xf01c('0x5a')])[_0xf01c('0x26')](function(){if(_[_0xf01c('0x5e')](_0x377e6e[_0xf01c('0x31')][_0xf01c('0x5a')])){for(var _0x2914d2=0x0;_0x2914d2<_0x377e6e[_0xf01c('0x31')][_0xf01c('0x5a')][_0xf01c('0x36')];_0x2914d2+=0x1){socket[_0xf01c('0x96')](_0xf01c('0x97'),{'UserId':Number(_0x377e6e[_0xf01c('0x31')][_0xf01c('0x5a')][_0x2914d2]),'CmListId':Number(_0x377e6e[_0xf01c('0x52')]['id'])});}}else{socket[_0xf01c('0x96')]('userCmList:remove',{'UserId':Number(_0x377e6e[_0xf01c('0x31')][_0xf01c('0x5a')]),'CmListId':Number(_0x377e6e[_0xf01c('0x52')]['id'])});}});}})[_0xf01c('0x26')](respondWithStatusCode(_0x2cd5bc,null))['catch'](handleError(_0x2cd5bc,null));};exports[_0xf01c('0x98')]=function(_0x2ff99a,_0x16d1cd,_0x5caeb1){var _0x1bff48={};var _0x3c7425={};var _0x5519f4;var _0x3c0697;return db[_0xf01c('0x2c')][_0xf01c('0x58')]({'where':{'id':_0x2ff99a[_0xf01c('0x52')]['id']}})[_0xf01c('0x26')](handleEntityNotFound(_0x16d1cd,null))[_0xf01c('0x26')](function(_0x1614e5){if(_0x1614e5){_0x5519f4=_0x1614e5;_0x3c7425[_0xf01c('0x30')]=_['keys'](db[_0xf01c('0x99')][_0xf01c('0x2d')]);_0x3c7425['query']=_[_0xf01c('0x45')](_0x2ff99a[_0xf01c('0x31')]);_0x3c7425[_0xf01c('0x32')]=_[_0xf01c('0x33')](_0x3c7425['model'],_0x3c7425[_0xf01c('0x31')]);_0x1bff48[_0xf01c('0x35')]=_[_0xf01c('0x33')](_0x3c7425[_0xf01c('0x30')],qs[_0xf01c('0x34')](_0x2ff99a[_0xf01c('0x31')][_0xf01c('0x34')]));_0x1bff48['attributes']=_0x1bff48[_0xf01c('0x35')][_0xf01c('0x36')]?_0x1bff48[_0xf01c('0x35')]:_0x3c7425[_0xf01c('0x30')];_0x1bff48[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x2ff99a[_0xf01c('0x31')][_0xf01c('0x3a')]);_0x1bff48[_0xf01c('0x3e')]=qs[_0xf01c('0x32')](_['pick'](_0x2ff99a[_0xf01c('0x31')],_0x3c7425[_0xf01c('0x32')]));if(_0x2ff99a[_0xf01c('0x31')]['filter']){_0x1bff48['where']=_[_0xf01c('0x3d')](_0x1bff48['where'],{'$or':_[_0xf01c('0x2b')](_0x1bff48[_0xf01c('0x35')],function(_0x3555c3){var _0x9b4dea={};_0x9b4dea[_0x3555c3]={'$like':'%'+_0x2ff99a[_0xf01c('0x31')][_0xf01c('0x3c')]+'%'};return _0x9b4dea;})});}_0x1bff48=_[_0xf01c('0x3d')]({},_0x1bff48,_0x2ff99a['options']);return _0x5519f4[_0xf01c('0x98')](_0x1bff48);}})[_0xf01c('0x26')](function(_0x5653c6){if(_0x5653c6){_0x3c0697=_0x5653c6[_0xf01c('0x36')];if(!_0x2ff99a[_0xf01c('0x31')]['hasOwnProperty'](_0xf01c('0x38'))){_0x1bff48[_0xf01c('0x1f')]=qs['limit'](_0x2ff99a[_0xf01c('0x31')][_0xf01c('0x1f')]);_0x1bff48[_0xf01c('0x1d')]=qs[_0xf01c('0x1d')](_0x2ff99a[_0xf01c('0x31')][_0xf01c('0x1d')]);}return _0x5519f4['getAgents'](_0x1bff48);}})['then'](function(_0x189940){if(_0x189940){return _0x189940?{'count':_0x3c0697,'rows':_0x189940}:null;}})[_0xf01c('0x26')](respondWithResult(_0x16d1cd,null))[_0xf01c('0x43')](handleError(_0x16d1cd,null));};function handleQuery(_0x35ec62){logger[_0xf01c('0x9a')](_0x35ec62);return db[_0xf01c('0x9b')][_0xf01c('0x31')](_0x35ec62)['spread'](function(_0xaf43d9){csv_results[_0xf01c('0x5f')](_0xaf43d9);})['catch'](function(_0x14aec9){logger[_0xf01c('0x50')](_0x14aec9[_0xf01c('0x64')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 0067938..36b2a89 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe14b,0x93));var _0xbe14=function(_0x2cf195,_0x611c9b){_0x2cf195=_0x2cf195-0x0;var _0x1fa5b3=_0xe14b[_0x2cf195];return _0x1fa5b3;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0xb1c88a,_0x1b0b80){var _0x1ea710=function(_0x4c19cb){while(--_0x4c19cb){_0xb1c88a['push'](_0xb1c88a['shift']());}};_0x1ea710(++_0x1b0b80);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index f9146bb..508ce92 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 _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x743ad3,_0x5ab237){var _0x286352=function(_0x18e4dc){while(--_0x18e4dc){_0x743ad3['push'](_0x743ad3['shift']());}};_0x286352(++_0x5ab237);}(_0x702d,0x147));var _0xd702=function(_0x1996b8,_0x17ea1e){_0x1996b8=_0x1996b8-0x0;var _0x5d9a4a=_0x702d[_0x1996b8];return _0x5d9a4a;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','CmList','util'];(function(_0x3787d4,_0x604e51){var _0xff6d71=function(_0x26ff4a){while(--_0x26ff4a){_0x3787d4['push'](_0x3787d4['shift']());}};_0xff6d71(++_0x604e51);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d00d4,_0x3e7d3d){_0x2d00d4=_0x2d00d4-0x0;var _0x45f2b6=_0xedd9[_0x2d00d4];return _0x45f2b6;};'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':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 37469bd..730bd27 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 _0xf567=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./cmList.socket','register','request','then','info','debug','stringify','error','code','message','CmList,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x333b4b,_0x595ac5){var _0x3d3f5b=function(_0x1ccb2d){while(--_0x1ccb2d){_0x333b4b['push'](_0x333b4b['shift']());}};_0x3d3f5b(++_0x595ac5);}(_0xf567,0xa8));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var moment=require(_0x7f56('0x2'));var BPromise=require(_0x7f56('0x3'));var rs=require(_0x7f56('0x4'));var fs=require('fs');var Redis=require(_0x7f56('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f56('0x6'));var logger=require(_0x7f56('0x7'))(_0x7f56('0x8'));var config=require(_0x7f56('0x9'));var jayson=require(_0x7f56('0xa'));var client=jayson[_0x7f56('0xb')][_0x7f56('0xc')]({'port':0x232a});config['redis']=_[_0x7f56('0xd')](config[_0x7f56('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f56('0xe')]));require(_0x7f56('0xf'))[_0x7f56('0x10')](socket);function respondWithRpcPromise(_0x5167e6,_0x425456,_0x2f5406){return new BPromise(function(_0x31eda8,_0xb483a9){return client[_0x7f56('0x11')](_0x5167e6,_0x2f5406)[_0x7f56('0x12')](function(_0x2ca773){logger[_0x7f56('0x13')]('CmList,\x20%s,\x20%s',_0x425456,'request\x20sent');logger[_0x7f56('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x425456,'request\x20sent',JSON[_0x7f56('0x15')](_0x2ca773));if(_0x2ca773[_0x7f56('0x16')]){if(_0x2ca773['error'][_0x7f56('0x17')]===0x1f4){logger[_0x7f56('0x16')]('CmList,\x20%s,\x20%s',_0x425456,_0x2ca773['error'][_0x7f56('0x18')]);return _0xb483a9(_0x2ca773[_0x7f56('0x16')]['message']);}logger[_0x7f56('0x16')](_0x7f56('0x19'),_0x425456,_0x2ca773[_0x7f56('0x16')][_0x7f56('0x18')]);return _0x31eda8(_0x2ca773[_0x7f56('0x16')]['message']);}else{logger[_0x7f56('0x13')](_0x7f56('0x19'),_0x425456,_0x7f56('0x1a'));_0x31eda8(_0x2ca773[_0x7f56('0x1b')][_0x7f56('0x18')]);}})[_0x7f56('0x1c')](function(_0x92cc7f){logger[_0x7f56('0x16')](_0x7f56('0x19'),_0x425456,_0x92cc7f);_0xb483a9(_0x92cc7f);});});} \ No newline at end of file +var _0x8624=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','info','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','result','lodash'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x8624,0x10d));var _0x4862=function(_0x588dd2,_0x5c8152){_0x588dd2=_0x588dd2-0x0;var _0x4f208e=_0x8624[_0x588dd2];return _0x4f208e;};'use strict';var _=require(_0x4862('0x0'));var util=require(_0x4862('0x1'));var moment=require(_0x4862('0x2'));var BPromise=require(_0x4862('0x3'));var rs=require(_0x4862('0x4'));var fs=require('fs');var Redis=require(_0x4862('0x5'));var db=require(_0x4862('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4862('0x7'));var jayson=require(_0x4862('0x8'));var client=jayson[_0x4862('0x9')][_0x4862('0xa')]({'port':0x232a});config[_0x4862('0xb')]=_[_0x4862('0xc')](config[_0x4862('0xb')],{'host':_0x4862('0xd'),'port':0x18eb});var socket=require(_0x4862('0xe'))(new Redis(config[_0x4862('0xb')]));require(_0x4862('0xf'))[_0x4862('0x10')](socket);function respondWithRpcPromise(_0x1b0b8e,_0x4441e6,_0x543fd3){return new BPromise(function(_0x421e3f,_0x53e12f){return client[_0x4862('0x11')](_0x1b0b8e,_0x543fd3)['then'](function(_0x485a7d){logger[_0x4862('0x12')]('CmList,\x20%s,\x20%s',_0x4441e6,_0x4862('0x13'));logger[_0x4862('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x4441e6,'request\x20sent',JSON[_0x4862('0x15')](_0x485a7d));if(_0x485a7d[_0x4862('0x16')]){if(_0x485a7d[_0x4862('0x16')][_0x4862('0x17')]===0x1f4){logger[_0x4862('0x16')](_0x4862('0x18'),_0x4441e6,_0x485a7d[_0x4862('0x16')][_0x4862('0x19')]);return _0x53e12f(_0x485a7d[_0x4862('0x16')][_0x4862('0x19')]);}logger[_0x4862('0x16')]('CmList,\x20%s,\x20%s',_0x4441e6,_0x485a7d[_0x4862('0x16')][_0x4862('0x19')]);return _0x421e3f(_0x485a7d['error'][_0x4862('0x19')]);}else{logger['info'](_0x4862('0x18'),_0x4441e6,_0x4862('0x13'));_0x421e3f(_0x485a7d[_0x4862('0x1a')][_0x4862('0x19')]);}})['catch'](function(_0xa87c4a){logger[_0x4862('0x16')]('CmList,\x20%s,\x20%s',_0x4441e6,_0xa87c4a);_0x53e12f(_0xa87c4a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 488684a..1ce91dc 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 _0x7a20=['length','cmList:','save','remove','emit','removeListener','register'];(function(_0x3902fd,_0x5ab635){var _0x1e0990=function(_0x27a081){while(--_0x27a081){_0x3902fd['push'](_0x3902fd['shift']());}};_0x1e0990(++_0x5ab635);}(_0x7a20,0xf7));var _0x07a2=function(_0x4edeed,_0x24ecfc){_0x4edeed=_0x4edeed-0x0;var _0x25c10d=_0x7a20[_0x4edeed];return _0x25c10d;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x07a2('0x0'),_0x07a2('0x1'),'update'];function createListener(_0xb131db,_0x20054d){return function(_0xcb0eb5){_0x20054d[_0x07a2('0x2')](_0xb131db,_0xcb0eb5);};}function removeListener(_0x2b9fbf,_0x38125d){return function(){CmListEvents[_0x07a2('0x3')](_0x2b9fbf,_0x38125d);};}exports[_0x07a2('0x4')]=function(_0x739d90){for(var _0x2dc238=0x0,_0x24383e=events[_0x07a2('0x5')];_0x2dc238<_0x24383e;_0x2dc238++){var _0x19af72=events[_0x2dc238];var _0x2ba067=createListener(_0x07a2('0x6')+_0x19af72,_0x739d90);CmListEvents['on'](_0x19af72,_0x2ba067);}}; \ No newline at end of file +var _0x10c5=['remove','update','removeListener','length','cmList:','save'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x10c5,0x89));var _0x510c=function(_0xd5b8d4,_0x84559e){_0xd5b8d4=_0xd5b8d4-0x0;var _0x5b7314=_0x10c5[_0xd5b8d4];return _0x5b7314;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x510c('0x0'),_0x510c('0x1'),_0x510c('0x2')];function createListener(_0x2fac54,_0x1cbdee){return function(_0x1288ab){_0x1cbdee['emit'](_0x2fac54,_0x1288ab);};}function removeListener(_0x49bb41,_0x488070){return function(){CmListEvents[_0x510c('0x3')](_0x49bb41,_0x488070);};}exports['register']=function(_0x15181f){for(var _0x3ba20d=0x0,_0x5e705d=events[_0x510c('0x4')];_0x3ba20d<_0x5e705d;_0x3ba20d++){var _0xd1b9fb=events[_0x3ba20d];var _0x1eee59=createListener(_0x510c('0x5')+_0xd1b9fb,_0x15181f);CmListEvents['on'](_0xd1b9fb,_0x1eee59);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1e0405a..bbbeb69 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 _0x306d=['/:id/fields','/:id/users','post','create','addDisposition','addCustomField','addAgents','put','delete','removeAgents','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x5898be,_0x440612){var _0x574a42=function(_0x54db1c){while(--_0x54db1c){_0x5898be['push'](_0x5898be['shift']());}};_0x574a42(++_0x440612);}(_0x306d,0x176));var _0xd306=function(_0xee74b3,_0x1b5bc2){_0xee74b3=_0xee74b3-0x0;var _0x490bb0=_0x306d[_0xee74b3];return _0x490bb0;};'use strict';var multer=require(_0xd306('0x0'));var util=require(_0xd306('0x1'));var path=require(_0xd306('0x2'));var timeout=require('connect-timeout');var express=require(_0xd306('0x3'));var router=express['Router']();var fs_extra=require(_0xd306('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd306('0x5'));var config=require(_0xd306('0x6'));var controller=require(_0xd306('0x7'));router['get']('/',auth[_0xd306('0x8')](),controller[_0xd306('0x9')]);router['get'](_0xd306('0xa'),auth[_0xd306('0x8')](),controller[_0xd306('0xb')]);router[_0xd306('0xc')]('/global_fields',auth[_0xd306('0x8')](),controller[_0xd306('0xd')]);router[_0xd306('0xc')](_0xd306('0xe'),auth['isAuthenticated'](),controller[_0xd306('0xf')]);router[_0xd306('0xc')](_0xd306('0x10'),auth[_0xd306('0x8')](),controller[_0xd306('0x11')]);router[_0xd306('0xc')](_0xd306('0x12'),auth[_0xd306('0x8')](),controller[_0xd306('0x13')]);router['get'](_0xd306('0x14'),auth[_0xd306('0x8')](),controller[_0xd306('0x15')]);router['get'](_0xd306('0x16'),auth['isAuthenticated'](),controller['getCustomFields']);router['get'](_0xd306('0x17'),auth[_0xd306('0x8')](),controller['getAgents']);router[_0xd306('0x18')]('/',auth[_0xd306('0x8')](),controller[_0xd306('0x19')]);router[_0xd306('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd306('0x1a')]);router[_0xd306('0x18')](_0xd306('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0xd306('0x18')](_0xd306('0x16'),auth[_0xd306('0x8')](),controller[_0xd306('0x1b')]);router[_0xd306('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xd306('0x1c')]);router[_0xd306('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd306('0x1e')]('/:id',auth[_0xd306('0x8')](),controller['destroy']);router['delete'](_0xd306('0x10'),auth[_0xd306('0x8')](),controller['removeDispositions']);router[_0xd306('0x1e')](_0xd306('0x17'),auth['isAuthenticated'](),controller[_0xd306('0x1f')]);module[_0xd306('0x20')]=router; \ No newline at end of file +var _0xcfee=['addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','/global_fields','/:id','/:id/dispositions','/:id/contacts','getContacts','/:id/fields','getCustomFields','getAgents','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcfee,0x175));var _0xecfe=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xcfee[_0x2112d4];return _0x434972;};'use strict';var multer=require('multer');var util=require(_0xecfe('0x0'));var path=require(_0xecfe('0x1'));var timeout=require(_0xecfe('0x2'));var express=require(_0xecfe('0x3'));var router=express['Router']();var fs_extra=require(_0xecfe('0x4'));var auth=require(_0xecfe('0x5'));var interaction=require(_0xecfe('0x6'));var config=require(_0xecfe('0x7'));var controller=require(_0xecfe('0x8'));router['get']('/',auth[_0xecfe('0x9')](),controller[_0xecfe('0xa')]);router['get'](_0xecfe('0xb'),auth[_0xecfe('0x9')](),controller[_0xecfe('0xc')]);router[_0xecfe('0xd')](_0xecfe('0xe'),auth[_0xecfe('0x9')](),controller['getGlobalCustomFields']);router['get'](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller['show']);router[_0xecfe('0xd')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller['getDispositions']);router[_0xecfe('0xd')](_0xecfe('0x11'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x12')]);router[_0xecfe('0xd')]('/:id/contacts/csv',auth[_0xecfe('0x9')](),controller['getContactsCsv']);router['get'](_0xecfe('0x13'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x14')]);router[_0xecfe('0xd')]('/:id/users',auth[_0xecfe('0x9')](),controller[_0xecfe('0x15')]);router[_0xecfe('0x16')]('/',auth[_0xecfe('0x9')](),controller['create']);router[_0xecfe('0x16')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x17')]);router[_0xecfe('0x16')](_0xecfe('0x11'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x18')]);router[_0xecfe('0x16')](_0xecfe('0x13'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x19')]);router[_0xecfe('0x16')](_0xecfe('0x1a'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1b')]);router[_0xecfe('0x1c')](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller['update']);router[_0xecfe('0x1d')](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1e')]);router[_0xecfe('0x1d')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller['removeDispositions']);router[_0xecfe('0x1d')](_0xecfe('0x1a'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1f')]);module[_0xecfe('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index dec9a11..77ceb11 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 _0x2e7b=['getDataValue','field','STRING','sequelize','exports'];(function(_0x518cfb,_0x5ef8d9){var _0x2adae6=function(_0x31da82){while(--_0x31da82){_0x518cfb['push'](_0x518cfb['shift']());}};_0x2adae6(++_0x5ef8d9);}(_0x2e7b,0x1ca));var _0xb2e7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2e7b[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xb2e7('0x0'));module[_0xb2e7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5c94c1){return this[_0xb2e7('0x2')](_0xb2e7('0x3'));}},'field':{'type':Sequelize[_0xb2e7('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xb2e7('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xb2e7('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa65a=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x54e453,_0x2c0802){var _0x471a9a=function(_0x284497){while(--_0x284497){_0x54e453['push'](_0x54e453['shift']());}};_0x471a9a(++_0x2c0802);}(_0xa65a,0x74));var _0xaa65=function(_0x476e07,_0x1ac0bb){_0x476e07=_0x476e07-0x0;var _0x152fac=_0xa65a[_0x476e07];return _0x152fac;};'use strict';var Sequelize=require(_0xaa65('0x0'));module[_0xaa65('0x1')]={'name':{'type':Sequelize[_0xaa65('0x2')],'get':function(_0x36971d){return this[_0xaa65('0x3')](_0xaa65('0x4'));}},'field':{'type':Sequelize[_0xaa65('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xaa65('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xaa65('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index dca5ba8..3571607 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(_0x14b5d0,_0x444ae1){var _0x5ee6f7=function(_0x9b5e22){while(--_0x9b5e22){_0x14b5d0['push'](_0x14b5d0['shift']());}};_0x5ee6f7(++_0x444ae1);}(_0x7a54,0x106));var _0x47a5=function(_0x237b0b,_0xbd1982){_0x237b0b=_0x237b0b-0x0;var _0x1c2cb2=_0x7a54[_0x237b0b];return _0x1c2cb2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x74b437,_0x2ce5a0){var _0x22c2d9=function(_0x109bc4){while(--_0x109bc4){_0x74b437['push'](_0x74b437['shift']());}};_0x22c2d9(++_0x2ce5a0);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8a7f66e..e8800a8 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 _0xd27c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','define','tools_conditions','util','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd27c,0xe1));var _0xcd27=function(_0x59ec7a,_0x1eb345){_0x59ec7a=_0x59ec7a-0x0;var _0x8535ed=_0xd27c[_0x59ec7a];return _0x8535ed;};'use strict';var _=require('lodash');var util=require(_0xcd27('0x0'));var logger=require(_0xcd27('0x1'))(_0xcd27('0x2'));var moment=require(_0xcd27('0x3'));var BPromise=require(_0xcd27('0x4'));var rp=require(_0xcd27('0x5'));var fs=require('fs');var path=require(_0xcd27('0x6'));var rimraf=require(_0xcd27('0x7'));var config=require(_0xcd27('0x8'));var attributes=require(_0xcd27('0x9'));module['exports']=function(_0x37c73e,_0x1a5d28){return _0x37c73e[_0xcd27('0xa')]('Condition',attributes,{'tableName':_0xcd27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0d2=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util'];(function(_0x153412,_0x40352a){var _0x3fd473=function(_0x2f13dd){while(--_0x2f13dd){_0x153412['push'](_0x153412['shift']());}};_0x3fd473(++_0x40352a);}(_0xf0d2,0x8e));var _0x2f0d=function(_0x1f7843,_0x276e9a){_0x1f7843=_0x1f7843-0x0;var _0x4f873d=_0xf0d2[_0x1f7843];return _0x4f873d;};'use strict';var _=require('lodash');var util=require(_0x2f0d('0x0'));var logger=require(_0x2f0d('0x1'))(_0x2f0d('0x2'));var moment=require(_0x2f0d('0x3'));var BPromise=require(_0x2f0d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f0d('0x5'));var rimraf=require(_0x2f0d('0x6'));var config=require(_0x2f0d('0x7'));var attributes=require(_0x2f0d('0x8'));module[_0x2f0d('0x9')]=function(_0x2046d2,_0x9db9a8){return _0x2046d2[_0x2f0d('0xa')](_0x2f0d('0xb'),attributes,{'tableName':_0x2f0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index f08d2db..4998676 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 _0xe9af=['Condition,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0xe9af,0x169));var _0xfe9a=function(_0x187730,_0x19cc8d){_0x187730=_0x187730-0x0;var _0x1181a4=_0xe9af[_0x187730];return _0x1181a4;};'use strict';var _=require(_0xfe9a('0x0'));var util=require(_0xfe9a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfe9a('0x2'));var fs=require('fs');var Redis=require(_0xfe9a('0x3'));var db=require(_0xfe9a('0x4'))['db'];var utils=require(_0xfe9a('0x5'));var logger=require('../../config/logger')(_0xfe9a('0x6'));var config=require(_0xfe9a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50e9ec,_0x133233,_0x3a9707){return new BPromise(function(_0x1752a0,_0x221fbb){return client[_0xfe9a('0x9')](_0x50e9ec,_0x3a9707)[_0xfe9a('0xa')](function(_0x466b1c){logger['info']('Condition,\x20%s,\x20%s',_0x133233,_0xfe9a('0xb'));logger[_0xfe9a('0xc')](_0xfe9a('0xd'),_0x133233,_0xfe9a('0xb'),JSON[_0xfe9a('0xe')](_0x466b1c));if(_0x466b1c[_0xfe9a('0xf')]){if(_0x466b1c[_0xfe9a('0xf')][_0xfe9a('0x10')]===0x1f4){logger[_0xfe9a('0xf')](_0xfe9a('0x11'),_0x133233,_0x466b1c['error'][_0xfe9a('0x12')]);return _0x221fbb(_0x466b1c[_0xfe9a('0xf')][_0xfe9a('0x12')]);}logger[_0xfe9a('0xf')](_0xfe9a('0x11'),_0x133233,_0x466b1c[_0xfe9a('0xf')][_0xfe9a('0x12')]);return _0x1752a0(_0x466b1c[_0xfe9a('0xf')][_0xfe9a('0x12')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x133233,_0xfe9a('0xb'));_0x1752a0(_0x466b1c[_0xfe9a('0x13')][_0xfe9a('0x12')]);}})[_0xfe9a('0x14')](function(_0xa4069c){logger[_0xfe9a('0xf')](_0xfe9a('0x11'),_0x133233,_0xa4069c);_0x221fbb(_0xa4069c);});});} \ No newline at end of file +var _0x61eb=['http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5b8b6b,_0x12a3ec){var _0x44c6a2=function(_0x1675b8){while(--_0x1675b8){_0x5b8b6b['push'](_0x5b8b6b['shift']());}};_0x44c6a2(++_0x12a3ec);}(_0x61eb,0x109));var _0xb61e=function(_0x32580a,_0x298f59){_0x32580a=_0x32580a-0x0;var _0x570850=_0x61eb[_0x32580a];return _0x570850;};'use strict';var _=require(_0xb61e('0x0'));var util=require(_0xb61e('0x1'));var moment=require(_0xb61e('0x2'));var BPromise=require(_0xb61e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb61e('0x4'));var db=require(_0xb61e('0x5'))['db'];var utils=require(_0xb61e('0x6'));var logger=require(_0xb61e('0x7'))('rpc');var config=require(_0xb61e('0x8'));var jayson=require(_0xb61e('0x9'));var client=jayson[_0xb61e('0xa')][_0xb61e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dacbc,_0x33fa6d,_0x1e8e6b){return new BPromise(function(_0x320782,_0x3fc91f){return client[_0xb61e('0xc')](_0x5dacbc,_0x1e8e6b)[_0xb61e('0xd')](function(_0x5f91e9){logger[_0xb61e('0xe')](_0xb61e('0xf'),_0x33fa6d,_0xb61e('0x10'));logger[_0xb61e('0x11')](_0xb61e('0x12'),_0x33fa6d,_0xb61e('0x10'),JSON['stringify'](_0x5f91e9));if(_0x5f91e9[_0xb61e('0x13')]){if(_0x5f91e9['error'][_0xb61e('0x14')]===0x1f4){logger[_0xb61e('0x13')](_0xb61e('0xf'),_0x33fa6d,_0x5f91e9[_0xb61e('0x13')][_0xb61e('0x15')]);return _0x3fc91f(_0x5f91e9[_0xb61e('0x13')]['message']);}logger[_0xb61e('0x13')](_0xb61e('0xf'),_0x33fa6d,_0x5f91e9[_0xb61e('0x13')][_0xb61e('0x15')]);return _0x320782(_0x5f91e9['error'][_0xb61e('0x15')]);}else{logger[_0xb61e('0xe')](_0xb61e('0xf'),_0x33fa6d,_0xb61e('0x10'));_0x320782(_0x5f91e9['result'][_0xb61e('0x15')]);}})[_0xb61e('0x16')](function(_0x31f2fa){logger[_0xb61e('0x13')](_0xb61e('0xf'),_0x33fa6d,_0x31f2fa);_0x3fc91f(_0x31f2fa);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 0ccab59..44102ac 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 _0x5d32=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','exports','path','express','fs-extra'];(function(_0x113ff0,_0x40137d){var _0x4e1fcf=function(_0xf2776b){while(--_0xf2776b){_0x113ff0['push'](_0x113ff0['shift']());}};_0x4e1fcf(++_0x40137d);}(_0x5d32,0x1b9));var _0x25d3=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x5d32[_0x3f6e26];return _0x474345;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x25d3('0x0'));var timeout=require('connect-timeout');var express=require(_0x25d3('0x1'));var router=express['Router']();var fs_extra=require(_0x25d3('0x2'));var auth=require(_0x25d3('0x3'));var interaction=require(_0x25d3('0x4'));var config=require(_0x25d3('0x5'));var controller=require(_0x25d3('0x6'));router[_0x25d3('0x7')](_0x25d3('0x8'),auth['isAuthenticated'](),controller[_0x25d3('0x9')]);router[_0x25d3('0xa')](_0x25d3('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x25d3('0xb')]=router; \ No newline at end of file +var _0x4a4d=['/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x4a4d,0x179));var _0xd4a4=function(_0x6fc3e1,_0x27a726){_0x6fc3e1=_0x6fc3e1-0x0;var _0x5ea4d9=_0x4a4d[_0x6fc3e1];return _0x5ea4d9;};'use strict';var multer=require(_0xd4a4('0x0'));var util=require(_0xd4a4('0x1'));var path=require(_0xd4a4('0x2'));var timeout=require(_0xd4a4('0x3'));var express=require(_0xd4a4('0x4'));var router=express[_0xd4a4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd4a4('0x6'));var interaction=require(_0xd4a4('0x7'));var config=require(_0xd4a4('0x8'));var controller=require('./condition.controller');router[_0xd4a4('0x9')]('/:id',auth[_0xd4a4('0xa')](),controller[_0xd4a4('0xb')]);router[_0xd4a4('0xc')](_0xd4a4('0xd'),auth['isAuthenticated'](),controller[_0xd4a4('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index b7ff51b..6408c54 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e83=['STRING','name','INTEGER','sequelize','exports'];(function(_0x106ee3,_0x3c221b){var _0x26d614=function(_0x443767){while(--_0x443767){_0x106ee3['push'](_0x106ee3['shift']());}};_0x26d614(++_0x3c221b);}(_0x0e83,0xad));var _0x30e8=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x0e83[_0x8a969d];return _0x1d8dc7;};'use strict';var Sequelize=require(_0x30e8('0x0'));module[_0x30e8('0x1')]={'name':{'type':Sequelize[_0x30e8('0x2')],'allowNull':![],'unique':_0x30e8('0x3')},'OrderBy':{'type':Sequelize[_0x30e8('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x30e8('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe1f0=['STRING','name','INTEGER'];(function(_0x3d4e74,_0x21b4e5){var _0x57613d=function(_0x2fa3b3){while(--_0x2fa3b3){_0x3d4e74['push'](_0x3d4e74['shift']());}};_0x57613d(++_0x21b4e5);}(_0xe1f0,0x1c8));var _0x0e1f=function(_0x3a8ac1,_0x189cdc){_0x3a8ac1=_0x3a8ac1-0x0;var _0x2cb0a7=_0xe1f0[_0x3a8ac1];return _0x2cb0a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0e1f('0x0')],'allowNull':![],'unique':_0x0e1f('0x1')},'OrderBy':{'type':Sequelize[_0x0e1f('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0e1f('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 737b4db..1b026bc 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['map','ContactItemType','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name'];(function(_0x166feb,_0x1dd207){var _0x468e02=function(_0x1a2ec3){while(--_0x1a2ec3){_0x166feb['push'](_0x166feb['shift']());}};_0x468e02(++_0x1dd207);}(_0x66fa,0x117));var _0xa66f=function(_0x87733d,_0xca91a5){_0x87733d=_0x87733d-0x0;var _0x3809f3=_0x66fa[_0x87733d];return _0x3809f3;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){var _0x502e21=_0x473822['get']({'plain':!![]});var _0xed98b9='ContactItemTypes';return db[_0xa66f('0x24')][_0xa66f('0x23')]({'where':{'type':_0xed98b9,'resourceId':_0x502e21['id']}})[_0xa66f('0x22')](function(){return _0x473822;});})['then'](function(){_0x5cbd82[_0xa66f('0x16')](0xcc)[_0xa66f('0x15')]();});}};}function handleEntityNotFound(_0x13495f,_0x238eb2){return function(_0x17c103){if(!_0x17c103){_0x13495f[_0xa66f('0x25')](0x194);}return _0x17c103;};}function handleError(_0x1eb86a,_0xea2c89){_0xea2c89=_0xea2c89||0x1f4;return function(_0x20ee67){logger[_0xa66f('0x26')](_0x20ee67[_0xa66f('0x27')]);if(_0x20ee67[_0xa66f('0x28')]){delete _0x20ee67[_0xa66f('0x28')];}_0x1eb86a[_0xa66f('0x16')](_0xea2c89)['send'](_0x20ee67);};}exports['index']=function(_0x38daac,_0x27ceae){var _0x55f309={},_0x44c79a={},_0x2de5f3={'count':0x0,'rows':[]};var _0x4cd7f2=_[_0xa66f('0x29')](db[_0xa66f('0x2a')][_0xa66f('0x2b')],function(_0x2c2ace){return{'name':_0x2c2ace[_0xa66f('0x2c')],'type':_0x2c2ace['type'][_0xa66f('0x2d')]};});_0x44c79a['model']=_[_0xa66f('0x29')](_0x4cd7f2,_0xa66f('0x28'));_0x44c79a[_0xa66f('0x2e')]=_['keys'](_0x38daac[_0xa66f('0x2e')]);_0x44c79a[_0xa66f('0x2f')]=_['intersection'](_0x44c79a[_0xa66f('0x30')],_0x44c79a[_0xa66f('0x2e')]);_0x55f309[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x44c79a[_0xa66f('0x30')],qs[_0xa66f('0x33')](_0x38daac[_0xa66f('0x2e')][_0xa66f('0x33')]));_0x55f309[_0xa66f('0x31')]=_0x55f309[_0xa66f('0x31')]['length']?_0x55f309[_0xa66f('0x31')]:_0x44c79a['model'];if(!_0x38daac[_0xa66f('0x2e')][_0xa66f('0x34')](_0xa66f('0x35'))){_0x55f309[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x38daac[_0xa66f('0x2e')][_0xa66f('0x19')]);_0x55f309[_0xa66f('0x1b')]=qs['offset'](_0x38daac[_0xa66f('0x2e')]['offset']);}_0x55f309[_0xa66f('0x36')]=qs[_0xa66f('0x37')](_0x38daac[_0xa66f('0x2e')]['sort']);_0x55f309['where']=qs[_0xa66f('0x2f')](_[_0xa66f('0x38')](_0x38daac[_0xa66f('0x2e')],_0x44c79a[_0xa66f('0x2f')]),_0x4cd7f2);if(_0x38daac[_0xa66f('0x2e')]['filter']){_0x55f309['where']=_['merge'](_0x55f309[_0xa66f('0x39')],{'$or':_['map'](_0x4cd7f2,function(_0x4d2d27){if(_0x4d2d27['type']!==_0xa66f('0x3a')){var _0x5051b2={};_0x5051b2[_0x4d2d27[_0xa66f('0x28')]]={'$like':'%'+_0x38daac[_0xa66f('0x2e')][_0xa66f('0x3b')]+'%'};return _0x5051b2;}})});}_0x55f309=_[_0xa66f('0x3c')]({},_0x55f309,_0x38daac[_0xa66f('0x3d')]);var _0x360e61={'where':_0x55f309[_0xa66f('0x39')]};return db[_0xa66f('0x2a')][_0xa66f('0x1a')](_0x360e61)[_0xa66f('0x22')](function(_0x3a7929){_0x2de5f3[_0xa66f('0x1a')]=_0x3a7929;if(_0x38daac[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x55f309['include']=[{'all':!![]}];}return db[_0xa66f('0x2a')][_0xa66f('0x3f')](_0x55f309);})['then'](function(_0x248587){_0x2de5f3['rows']=_0x248587;return _0x2de5f3;})[_0xa66f('0x22')](respondWithFilteredResult(_0x27ceae,_0x55f309))[_0xa66f('0x40')](handleError(_0x27ceae,null));};exports['show']=function(_0x1ddd2f,_0xa42041){var _0x2126e8={'raw':!![],'where':{'id':_0x1ddd2f[_0xa66f('0x41')]['id']}},_0x5276ea={};_0x5276ea['model']=_[_0xa66f('0x42')](db[_0xa66f('0x2a')][_0xa66f('0x2b')]);_0x5276ea[_0xa66f('0x2e')]=_[_0xa66f('0x42')](_0x1ddd2f[_0xa66f('0x2e')]);_0x5276ea[_0xa66f('0x2f')]=_['intersection'](_0x5276ea[_0xa66f('0x30')],_0x5276ea[_0xa66f('0x2e')]);_0x2126e8[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x5276ea[_0xa66f('0x30')],qs['fields'](_0x1ddd2f['query'][_0xa66f('0x33')]));_0x2126e8[_0xa66f('0x31')]=_0x2126e8[_0xa66f('0x31')][_0xa66f('0x43')]?_0x2126e8[_0xa66f('0x31')]:_0x5276ea[_0xa66f('0x30')];if(_0x1ddd2f['query'][_0xa66f('0x3e')]){_0x2126e8[_0xa66f('0x44')]=[{'all':!![]}];}_0x2126e8=_[_0xa66f('0x3c')]({},_0x2126e8,_0x1ddd2f['options']);return db['ContactItemType'][_0xa66f('0x45')](_0x2126e8)[_0xa66f('0x22')](handleEntityNotFound(_0xa42041,null))[_0xa66f('0x22')](respondWithResult(_0xa42041,null))['catch'](handleError(_0xa42041,null));};exports['create']=function(_0x52054e,_0x19e7ce){return db[_0xa66f('0x2a')][_0xa66f('0x46')](_0x52054e[_0xa66f('0x47')],{})[_0xa66f('0x22')](function(_0x3edf84){var _0x164242=_0x52054e[_0xa66f('0x48')]['get']({'plain':!![]});if(!_0x164242)throw new Error(_0xa66f('0x49'));if(_0x164242[_0xa66f('0x4a')]===_0xa66f('0x48')){var _0x393755=_0x3edf84[_0xa66f('0x4b')]({'plain':!![]});var _0x33cdc7='ContactItemTypes';return db[_0xa66f('0x4c')][_0xa66f('0x45')]({'where':{'name':_0x33cdc7,'userProfileId':_0x164242[_0xa66f('0x4d')]},'raw':!![]})[_0xa66f('0x22')](function(_0x20d6be){if(_0x20d6be&&_0x20d6be['autoAssociation']===0x0){return db[_0xa66f('0x24')]['create']({'name':_0x393755[_0xa66f('0x28')],'resourceId':_0x393755['id'],'type':_0x20d6be['name'],'sectionId':_0x20d6be['id']},{})['then'](function(){return _0x3edf84;});}else{return _0x3edf84;}})[_0xa66f('0x40')](function(_0x31233b){logger[_0xa66f('0x26')](_0xa66f('0x4e'),_0x31233b);throw _0x31233b;});}return _0x3edf84;})[_0xa66f('0x22')](respondWithResult(_0x19e7ce,0xc9))[_0xa66f('0x40')](handleError(_0x19e7ce,null));};exports['update']=function(_0x30ea28,_0x13822b){if(_0x30ea28[_0xa66f('0x47')]['id']){delete _0x30ea28[_0xa66f('0x47')]['id'];}return db['ContactItemType'][_0xa66f('0x45')]({'where':{'id':_0x30ea28['params']['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x13822b,null))[_0xa66f('0x22')](saveUpdates(_0x30ea28[_0xa66f('0x47')],null))[_0xa66f('0x22')](respondWithResult(_0x13822b,null))[_0xa66f('0x40')](handleError(_0x13822b,null));};exports[_0xa66f('0x23')]=function(_0x44ea10,_0x56b860){return db[_0xa66f('0x2a')][_0xa66f('0x45')]({'where':{'id':_0x44ea10[_0xa66f('0x41')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x56b860,null))[_0xa66f('0x22')](db[_0xa66f('0x4f')][_0xa66f('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x44ea10[_0xa66f('0x41')]['id']}}))[_0xa66f('0x22')](removeEntity(_0x56b860,null))['catch'](handleError(_0x56b860,null));}; \ No newline at end of file +var _0x351d=['path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','get','ContactItemTypes','error','stack','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x13143f,_0x4b3db4){var _0x3ffcb3=function(_0x38c975){while(--_0x38c975){_0x13143f['push'](_0x13143f['shift']());}};_0x3ffcb3(++_0x4b3db4);}(_0x351d,0x90));var _0xd351=function(_0x297375,_0x135ed1){_0x297375=_0x297375-0x0;var _0x16aeeb=_0x351d[_0x297375];return _0x16aeeb;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){var _0x4626c4=_0x59fb6d[_0xd351('0x20')]({'plain':!![]});var _0x489c9a=_0xd351('0x21');return db['UserProfileResource'][_0xd351('0x1e')]({'where':{'type':_0x489c9a,'resourceId':_0x4626c4['id']}})[_0xd351('0x1f')](function(){return _0x59fb6d;});})['then'](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d67e,_0x1d0cb1){return function(_0x560be9){if(!_0x560be9){_0x50d67e['sendStatus'](0x194);}return _0x560be9;};}function handleError(_0x134580,_0x555a50){_0x555a50=_0x555a50||0x1f4;return function(_0x38471c){logger[_0xd351('0x22')](_0x38471c[_0xd351('0x23')]);if(_0x38471c['name']){delete _0x38471c[_0xd351('0x24')];}_0x134580['status'](_0x555a50)[_0xd351('0x25')](_0x38471c);};}exports['index']=function(_0x5f07b1,_0xeb4da9){var _0x38c82f={},_0x3f9ef3={},_0x33b43d={'count':0x0,'rows':[]};var _0x48aa96=_[_0xd351('0x26')](db[_0xd351('0x27')][_0xd351('0x28')],function(_0x41da60){return{'name':_0x41da60[_0xd351('0x29')],'type':_0x41da60[_0xd351('0x2a')][_0xd351('0x2b')]};});_0x3f9ef3[_0xd351('0x2c')]=_[_0xd351('0x26')](_0x48aa96,'name');_0x3f9ef3[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5f07b1[_0xd351('0x2d')]);_0x3f9ef3[_0xd351('0x2f')]=_['intersection'](_0x3f9ef3[_0xd351('0x2c')],_0x3f9ef3[_0xd351('0x2d')]);_0x38c82f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x3f9ef3[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x32')]));_0x38c82f[_0xd351('0x30')]=_0x38c82f['attributes']['length']?_0x38c82f[_0xd351('0x30')]:_0x3f9ef3[_0xd351('0x2c')];if(!_0x5f07b1[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x38c82f[_0xd351('0x17')]=qs['limit'](_0x5f07b1['query'][_0xd351('0x17')]);_0x38c82f['offset']=qs[_0xd351('0x19')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x38c82f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x36')]);_0x38c82f[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x5f07b1[_0xd351('0x2d')],_0x3f9ef3['filters']),_0x48aa96);if(_0x5f07b1[_0xd351('0x2d')]['filter']){_0x38c82f[_0xd351('0x37')]=_[_0xd351('0x39')](_0x38c82f[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x48aa96,function(_0x3b42e7){if(_0x3b42e7[_0xd351('0x2a')]!=='VIRTUAL'){var _0x3ad98e={};_0x3ad98e[_0x3b42e7[_0xd351('0x24')]]={'$like':'%'+_0x5f07b1['query'][_0xd351('0x3a')]+'%'};return _0x3ad98e;}})});}_0x38c82f=_[_0xd351('0x39')]({},_0x38c82f,_0x5f07b1[_0xd351('0x3b')]);var _0x1fc216={'where':_0x38c82f[_0xd351('0x37')]};return db['ContactItemType']['count'](_0x1fc216)[_0xd351('0x1f')](function(_0x3935aa){_0x33b43d['count']=_0x3935aa;if(_0x5f07b1['query'][_0xd351('0x3c')]){_0x38c82f[_0xd351('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x38c82f);})[_0xd351('0x1f')](function(_0x18f9d1){_0x33b43d[_0xd351('0x3e')]=_0x18f9d1;return _0x33b43d;})[_0xd351('0x1f')](respondWithFilteredResult(_0xeb4da9,_0x38c82f))[_0xd351('0x3f')](handleError(_0xeb4da9,null));};exports[_0xd351('0x40')]=function(_0x6192c3,_0x110458){var _0x129605={'raw':!![],'where':{'id':_0x6192c3['params']['id']}},_0x553360={};_0x553360[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x553360[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x6192c3[_0xd351('0x2d')]);_0x553360[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],_0x553360[_0xd351('0x2d')]);_0x129605[_0xd351('0x30')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x6192c3[_0xd351('0x2d')]['fields']));_0x129605[_0xd351('0x30')]=_0x129605[_0xd351('0x30')][_0xd351('0x41')]?_0x129605['attributes']:_0x553360[_0xd351('0x2c')];if(_0x6192c3[_0xd351('0x2d')][_0xd351('0x3c')]){_0x129605[_0xd351('0x3d')]=[{'all':!![]}];}_0x129605=_[_0xd351('0x39')]({},_0x129605,_0x6192c3['options']);return db[_0xd351('0x27')]['find'](_0x129605)[_0xd351('0x1f')](handleEntityNotFound(_0x110458,null))[_0xd351('0x1f')](respondWithResult(_0x110458,null))['catch'](handleError(_0x110458,null));};exports['create']=function(_0x1bd727,_0x444206){return db[_0xd351('0x27')]['create'](_0x1bd727[_0xd351('0x42')],{})[_0xd351('0x1f')](function(_0x548d90){var _0xf3ce5=_0x1bd727['user'][_0xd351('0x20')]({'plain':!![]});if(!_0xf3ce5)throw new Error(_0xd351('0x43'));if(_0xf3ce5['role']==='user'){var _0x25ea1e=_0x548d90['get']({'plain':!![]});var _0xf9f375=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0xf9f375,'userProfileId':_0xf3ce5[_0xd351('0x45')]},'raw':!![]})['then'](function(_0x5527da){if(_0x5527da&&_0x5527da['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x25ea1e[_0xd351('0x24')],'resourceId':_0x25ea1e['id'],'type':_0x5527da['name'],'sectionId':_0x5527da['id']},{})['then'](function(){return _0x548d90;});}else{return _0x548d90;}})[_0xd351('0x3f')](function(_0x42f248){logger['error'](_0xd351('0x48'),_0x42f248);throw _0x42f248;});}return _0x548d90;})[_0xd351('0x1f')](respondWithResult(_0x444206,0xc9))['catch'](handleError(_0x444206,null));};exports[_0xd351('0x1d')]=function(_0x59ab0f,_0x22394e){if(_0x59ab0f['body']['id']){delete _0x59ab0f[_0xd351('0x42')]['id'];}return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x59ab0f[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x22394e,null))[_0xd351('0x1f')](saveUpdates(_0x59ab0f[_0xd351('0x42')],null))['then'](respondWithResult(_0x22394e,null))['catch'](handleError(_0x22394e,null));};exports[_0xd351('0x1e')]=function(_0x624224,_0x53a9da){return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x624224[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53a9da,null))[_0xd351('0x1f')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x624224[_0xd351('0x4a')]['id']}}))[_0xd351('0x1f')](removeEntity(_0x53a9da,null))['catch'](handleError(_0x53a9da,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index b9fbd06..137e4ad 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf192=['ContactItemType','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf192,0xdd));var _0x2f19=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf192[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x2f19('0x0'));var util=require(_0x2f19('0x1'));var logger=require(_0x2f19('0x2'))(_0x2f19('0x3'));var moment=require(_0x2f19('0x4'));var BPromise=require(_0x2f19('0x5'));var rp=require(_0x2f19('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f19('0x7'));var attributes=require(_0x2f19('0x8'));module[_0x2f19('0x9')]=function(_0x110657,_0x7b2f5e){return _0x110657['define'](_0x2f19('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9b=['request-promise','path','rimraf','define','ContactItemType','util','api','moment','bluebird'];(function(_0x324915,_0x5ec142){var _0x569bad=function(_0x589650){while(--_0x589650){_0x324915['push'](_0x324915['shift']());}};_0x569bad(++_0x5ec142);}(_0x2a9b,0x1be));var _0xb2a9=function(_0x16a275,_0x29f59){_0x16a275=_0x16a275-0x0;var _0x2fc69a=_0x2a9b[_0x16a275];return _0x2fc69a;};'use strict';var _=require('lodash');var util=require(_0xb2a9('0x0'));var logger=require('../../config/logger')(_0xb2a9('0x1'));var moment=require(_0xb2a9('0x2'));var BPromise=require(_0xb2a9('0x3'));var rp=require(_0xb2a9('0x4'));var fs=require('fs');var path=require(_0xb2a9('0x5'));var rimraf=require(_0xb2a9('0x6'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x3f0f97,_0x93ea07){return _0x3f0f97[_0xb2a9('0x7')](_0xb2a9('0x8'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 0030b57..dcb1c52 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcef=['code','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcef,0x74));var _0xffce=function(_0x5bf929,_0x257a8e){_0x5bf929=_0x5bf929-0x0;var _0x22d69a=_0xfcef[_0x5bf929];return _0x22d69a;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var moment=require(_0xffce('0x2'));var BPromise=require('bluebird');var rs=require(_0xffce('0x3'));var fs=require('fs');var Redis=require(_0xffce('0x4'));var db=require(_0xffce('0x5'))['db'];var utils=require(_0xffce('0x6'));var logger=require(_0xffce('0x7'))(_0xffce('0x8'));var config=require(_0xffce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xffce('0xa')][_0xffce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x339c0d,_0x4e9b06,_0x10364c){return new BPromise(function(_0x1eb45f,_0xe69949){return client['request'](_0x339c0d,_0x10364c)['then'](function(_0x26a4fa){logger[_0xffce('0xc')](_0xffce('0xd'),_0x4e9b06,_0xffce('0xe'));logger['debug'](_0xffce('0xf'),_0x4e9b06,'request\x20sent',JSON['stringify'](_0x26a4fa));if(_0x26a4fa['error']){if(_0x26a4fa[_0xffce('0x10')][_0xffce('0x11')]===0x1f4){logger[_0xffce('0x10')]('ContactItemType,\x20%s,\x20%s',_0x4e9b06,_0x26a4fa[_0xffce('0x10')]['message']);return _0xe69949(_0x26a4fa['error']['message']);}logger[_0xffce('0x10')](_0xffce('0xd'),_0x4e9b06,_0x26a4fa[_0xffce('0x10')]['message']);return _0x1eb45f(_0x26a4fa[_0xffce('0x10')]['message']);}else{logger[_0xffce('0xc')](_0xffce('0xd'),_0x4e9b06,_0xffce('0xe'));_0x1eb45f(_0x26a4fa[_0xffce('0x12')]['message']);}})['catch'](function(_0x51c28b){logger[_0xffce('0x10')]('ContactItemType,\x20%s,\x20%s',_0x4e9b06,_0x51c28b);_0xe69949(_0x51c28b);});});} \ No newline at end of file +var _0x30d6=['client','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x554e9e,_0xcb21e5){var _0x1ba47c=function(_0x535af9){while(--_0x535af9){_0x554e9e['push'](_0x554e9e['shift']());}};_0x1ba47c(++_0xcb21e5);}(_0x30d6,0x1b0));var _0x630d=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x30d6[_0x4e170e];return _0x338291;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('ContactItemType,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('ContactItemType,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('ContactItemType,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 2a8de00..baec9b8 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2740=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2740,0xe9));var _0x0274=function(_0x2c9f69,_0x594071){_0x2c9f69=_0x2c9f69-0x0;var _0x245eb6=_0x2740[_0x2c9f69];return _0x245eb6;};'use strict';var multer=require(_0x0274('0x0'));var util=require(_0x0274('0x1'));var path=require(_0x0274('0x2'));var timeout=require(_0x0274('0x3'));var express=require(_0x0274('0x4'));var router=express[_0x0274('0x5')]();var fs_extra=require(_0x0274('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0274('0x7'));var config=require(_0x0274('0x8'));var controller=require(_0x0274('0x9'));router[_0x0274('0xa')]('/',auth[_0x0274('0xb')](),controller[_0x0274('0xc')]);router[_0x0274('0xa')](_0x0274('0xd'),auth[_0x0274('0xb')](),controller[_0x0274('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0274('0xf')]);router[_0x0274('0x10')](_0x0274('0xd'),auth[_0x0274('0xb')](),controller['update']);router[_0x0274('0x11')]('/:id',auth[_0x0274('0xb')](),controller[_0x0274('0x12')]);module[_0x0274('0x13')]=router; \ No newline at end of file +var _0x8f0f=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x10dffa,_0x39d92e){var _0x24f7ef=function(_0x59879d){while(--_0x59879d){_0x10dffa['push'](_0x10dffa['shift']());}};_0x24f7ef(++_0x39d92e);}(_0x8f0f,0xfc));var _0xf8f0=function(_0x59a181,_0x4c4eae){_0x59a181=_0x59a181-0x0;var _0x595942=_0x8f0f[_0x59a181];return _0x595942;};'use strict';var multer=require(_0xf8f0('0x0'));var util=require(_0xf8f0('0x1'));var path=require('path');var timeout=require(_0xf8f0('0x2'));var express=require(_0xf8f0('0x3'));var router=express[_0xf8f0('0x4')]();var fs_extra=require(_0xf8f0('0x5'));var auth=require(_0xf8f0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf8f0('0x7'));var controller=require(_0xf8f0('0x8'));router[_0xf8f0('0x9')]('/',auth[_0xf8f0('0xa')](),controller['index']);router['get'](_0xf8f0('0xb'),auth[_0xf8f0('0xa')](),controller[_0xf8f0('0xc')]);router[_0xf8f0('0xd')]('/',auth[_0xf8f0('0xa')](),controller['create']);router[_0xf8f0('0xe')]('/:id',auth[_0xf8f0('0xa')](),controller[_0xf8f0('0xf')]);router[_0xf8f0('0x10')](_0xf8f0('0xb'),auth[_0xf8f0('0xa')](),controller[_0xf8f0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 47de425..089b7b9 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x5334bc,_0x3c146b){var _0x4d0abf=function(_0x468ee7){while(--_0x468ee7){_0x5334bc['push'](_0x5334bc['shift']());}};_0x4d0abf(++_0x3c146b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ad172d0..beb2b36 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 _0xd0be=['attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','DashboardItem','getItems','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','type','options','includeAll','include','rows','show','params','Dashboard','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','attrUrl','attrs','https://','attrPath','clock','attrHourFormat','attrTimezone','value','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts'];(function(_0x399a25,_0x1ae4c2){var _0x58bb4c=function(_0x47639b){while(--_0x47639b){_0x399a25['push'](_0x399a25['shift']());}};_0x58bb4c(++_0x1ae4c2);}(_0xd0be,0x110));var _0xed0b=function(_0x553a8e,_0x22f669){_0x553a8e=_0x553a8e-0x0;var _0x378498=_0xd0be[_0x553a8e];return _0x378498;};'use strict';var emlformat=require(_0xed0b('0x0'));var rimraf=require(_0xed0b('0x1'));var zipdir=require(_0xed0b('0x2'));var jsonpatch=require(_0xed0b('0x3'));var rp=require(_0xed0b('0x4'));var moment=require(_0xed0b('0x5'));var BPromise=require(_0xed0b('0x6'));var Mustache=require(_0xed0b('0x7'));var util=require(_0xed0b('0x8'));var path=require(_0xed0b('0x9'));var sox=require(_0xed0b('0xa'));var csv=require(_0xed0b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed0b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xed0b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xed0b('0xb'));var querystring=require(_0xed0b('0xe'));var Papa=require(_0xed0b('0xf'));var Redis=require(_0xed0b('0x10'));var authService=require(_0xed0b('0x11'));var qs=require(_0xed0b('0x12'));var as=require(_0xed0b('0x13'));var hardwareService=require(_0xed0b('0x14'));var logger=require(_0xed0b('0x15'))(_0xed0b('0x16'));var utils=require(_0xed0b('0x17'));var config=require(_0xed0b('0x18'));var licenseUtil=require(_0xed0b('0x19'));var db=require(_0xed0b('0x1a'))['db'];config[_0xed0b('0x1b')]=_[_0xed0b('0x1c')](config['redis'],{'host':_0xed0b('0x1d'),'port':0x18eb});var socket=require(_0xed0b('0x1e'))(new Redis(config[_0xed0b('0x1b')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1aa6e5,_0x1b0954){_0x1b0954=_0x1b0954||0xcc;return function(_0x44f9d0){if(_0x44f9d0){return _0x1aa6e5[_0xed0b('0x1f')](_0x1b0954);}return _0x1aa6e5['status'](_0x1b0954)[_0xed0b('0x20')]();};}function respondWithResult(_0xae0357,_0x576310){_0x576310=_0x576310||0xc8;return function(_0x39c213){if(_0x39c213){return _0xae0357[_0xed0b('0x21')](_0x576310)[_0xed0b('0x22')](_0x39c213);}};}function respondWithFilteredResult(_0x35c5ec,_0x3d54ab){return function(_0x4b8d97){if(_0x4b8d97){var _0x5dd66a=typeof _0x3d54ab[_0xed0b('0x23')]===_0xed0b('0x24')&&typeof _0x3d54ab['limit']===_0xed0b('0x24');var _0x59c142=_0x4b8d97[_0xed0b('0x25')];var _0x2a8efb=_0x5dd66a?0x0:_0x3d54ab['offset'];var _0x4e32d5=_0x5dd66a?_0x4b8d97['count']:_0x3d54ab[_0xed0b('0x23')]+_0x3d54ab['limit'];var _0x499647;if(_0x4e32d5>=_0x59c142){_0x4e32d5=_0x59c142;_0x499647=0xc8;}else{_0x499647=0xce;}_0x35c5ec[_0xed0b('0x21')](_0x499647);return _0x35c5ec[_0xed0b('0x26')]('Content-Range',_0x2a8efb+'-'+_0x4e32d5+'/'+_0x59c142)[_0xed0b('0x22')](_0x4b8d97);}return null;};}function patchUpdates(_0x4bd4bc){return function(_0xe0107c){try{jsonpatch[_0xed0b('0x27')](_0xe0107c,_0x4bd4bc,!![]);}catch(_0x1cf14c){return BPromise[_0xed0b('0x28')](_0x1cf14c);}return _0xe0107c[_0xed0b('0x29')]();};}function saveUpdates(_0x26b810,_0x36badc){return function(_0x3c592c){if(_0x3c592c){return _0x3c592c[_0xed0b('0x2a')](_0x26b810)[_0xed0b('0x2b')](function(_0x53219b){return _0x53219b;});}return null;};}function removeEntity(_0x57d3dc,_0x39efc6){return function(_0x396318){if(_0x396318){return _0x396318[_0xed0b('0x2c')]()['then'](function(){var _0x4ca412=_0x396318[_0xed0b('0x2d')]({'plain':!![]});var _0x44ca7d=_0xed0b('0x2e');return db[_0xed0b('0x2f')][_0xed0b('0x2c')]({'where':{'type':_0x44ca7d,'resourceId':_0x4ca412['id']}})['then'](function(){return _0x396318;});})[_0xed0b('0x2b')](function(){_0x57d3dc[_0xed0b('0x21')](0xcc)[_0xed0b('0x20')]();});}};}function handleEntityNotFound(_0x3d47d6,_0x11d2fb){return function(_0x5b5d42){if(!_0x5b5d42){_0x3d47d6[_0xed0b('0x1f')](0x194);}return _0x5b5d42;};}function handleError(_0x1834a4,_0x43c06a){_0x43c06a=_0x43c06a||0x1f4;return function(_0x11d324){logger[_0xed0b('0x30')](_0x11d324[_0xed0b('0x31')]);if(_0x11d324[_0xed0b('0x32')]){delete _0x11d324[_0xed0b('0x32')];}_0x1834a4[_0xed0b('0x21')](_0x43c06a)['send'](_0x11d324);};}exports['index']=function(_0x10d602,_0x305c65){var _0x1d1a7a={},_0x364f8f={},_0x15611f={'count':0x0,'rows':[]};var _0x309975=_['map'](db['Dashboard'][_0xed0b('0x33')],function(_0x2eba60){return{'name':_0x2eba60[_0xed0b('0x34')],'type':_0x2eba60['type'][_0xed0b('0x35')]};});_0x364f8f[_0xed0b('0x36')]=_[_0xed0b('0x37')](_0x309975,_0xed0b('0x32'));_0x364f8f[_0xed0b('0x38')]=_[_0xed0b('0x39')](_0x10d602[_0xed0b('0x38')]);_0x364f8f['filters']=_['intersection'](_0x364f8f[_0xed0b('0x36')],_0x364f8f[_0xed0b('0x38')]);_0x1d1a7a[_0xed0b('0x3a')]=_[_0xed0b('0x3b')](_0x364f8f[_0xed0b('0x36')],qs['fields'](_0x10d602[_0xed0b('0x38')][_0xed0b('0x3c')]));_0x1d1a7a[_0xed0b('0x3a')]=_0x1d1a7a['attributes'][_0xed0b('0x3d')]?_0x1d1a7a[_0xed0b('0x3a')]:_0x364f8f[_0xed0b('0x36')];if(!_0x10d602[_0xed0b('0x38')][_0xed0b('0x3e')](_0xed0b('0x3f'))){_0x1d1a7a[_0xed0b('0x40')]=qs['limit'](_0x10d602['query'][_0xed0b('0x40')]);_0x1d1a7a['offset']=qs[_0xed0b('0x23')](_0x10d602[_0xed0b('0x38')][_0xed0b('0x23')]);}_0x1d1a7a[_0xed0b('0x41')]=qs[_0xed0b('0x42')](_0x10d602['query'][_0xed0b('0x42')]);_0x1d1a7a[_0xed0b('0x43')]=qs[_0xed0b('0x44')](_['pick'](_0x10d602[_0xed0b('0x38')],_0x364f8f['filters']),_0x309975);if(_0x10d602[_0xed0b('0x38')]['filter']){_0x1d1a7a[_0xed0b('0x43')]=_[_0xed0b('0x45')](_0x1d1a7a[_0xed0b('0x43')],{'$or':_[_0xed0b('0x37')](_0x309975,function(_0x3a83c0){if(_0x3a83c0[_0xed0b('0x46')]!=='VIRTUAL'){var _0x4b3bfd={};_0x4b3bfd[_0x3a83c0[_0xed0b('0x32')]]={'$like':'%'+_0x10d602[_0xed0b('0x38')]['filter']+'%'};return _0x4b3bfd;}})});}_0x1d1a7a=_['merge']({},_0x1d1a7a,_0x10d602[_0xed0b('0x47')]);var _0x493da4={'where':_0x1d1a7a[_0xed0b('0x43')]};return db['Dashboard']['count'](_0x493da4)[_0xed0b('0x2b')](function(_0x13a0b6){_0x15611f[_0xed0b('0x25')]=_0x13a0b6;if(_0x10d602[_0xed0b('0x38')][_0xed0b('0x48')]){_0x1d1a7a[_0xed0b('0x49')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x1d1a7a);})[_0xed0b('0x2b')](function(_0xdba670){_0x15611f[_0xed0b('0x4a')]=_0xdba670;return _0x15611f;})[_0xed0b('0x2b')](respondWithFilteredResult(_0x305c65,_0x1d1a7a))['catch'](handleError(_0x305c65,null));};exports[_0xed0b('0x4b')]=function(_0x115709,_0x271273){var _0xc943f1={'raw':![],'where':{'id':_0x115709[_0xed0b('0x4c')]['id']}},_0x423efd={};_0x423efd[_0xed0b('0x36')]=_['keys'](db[_0xed0b('0x4d')]['rawAttributes']);_0x423efd[_0xed0b('0x38')]=_[_0xed0b('0x39')](_0x115709[_0xed0b('0x38')]);_0x423efd[_0xed0b('0x44')]=_['intersection'](_0x423efd['model'],_0x423efd['query']);_0xc943f1[_0xed0b('0x3a')]=_[_0xed0b('0x3b')](_0x423efd[_0xed0b('0x36')],qs[_0xed0b('0x3c')](_0x115709['query'][_0xed0b('0x3c')]));_0xc943f1[_0xed0b('0x3a')]=_0xc943f1[_0xed0b('0x3a')][_0xed0b('0x3d')]?_0xc943f1[_0xed0b('0x3a')]:_0x423efd[_0xed0b('0x36')];if(_0x115709['query'][_0xed0b('0x48')]){_0xc943f1[_0xed0b('0x49')]=[{'all':!![]}];}_0xc943f1=_[_0xed0b('0x45')]({},_0xc943f1,_0x115709[_0xed0b('0x47')]);return db['Dashboard'][_0xed0b('0x4e')](_0xc943f1)[_0xed0b('0x2b')](handleEntityNotFound(_0x271273,null))[_0xed0b('0x2b')](respondWithResult(_0x271273,null))[_0xed0b('0x4f')](handleError(_0x271273,null));};exports[_0xed0b('0x50')]=function(_0x4975e5,_0x3dd170){return db['Dashboard']['create'](_0x4975e5[_0xed0b('0x51')],{})[_0xed0b('0x2b')](function(_0x3185de){var _0x4d1e96=_0x4975e5[_0xed0b('0x52')][_0xed0b('0x2d')]({'plain':!![]});if(!_0x4d1e96)throw new Error(_0xed0b('0x53'));if(_0x4d1e96[_0xed0b('0x54')]===_0xed0b('0x52')){var _0x3af10f=_0x3185de[_0xed0b('0x2d')]({'plain':!![]});var _0x3c2f38='CustomDashboards';return db['UserProfileSection'][_0xed0b('0x4e')]({'where':{'name':_0x3c2f38,'userProfileId':_0x4d1e96[_0xed0b('0x55')]},'raw':!![]})[_0xed0b('0x2b')](function(_0x26a670){if(_0x26a670&&_0x26a670[_0xed0b('0x56')]===0x0){return db[_0xed0b('0x2f')]['create']({'name':_0x3af10f['name'],'resourceId':_0x3af10f['id'],'type':_0x26a670[_0xed0b('0x32')],'sectionId':_0x26a670['id']},{})[_0xed0b('0x2b')](function(){return _0x3185de;});}else{return _0x3185de;}})[_0xed0b('0x4f')](function(_0x351980){logger[_0xed0b('0x30')](_0xed0b('0x57'),_0x351980);throw _0x351980;});}return _0x3185de;})[_0xed0b('0x2b')](respondWithResult(_0x3dd170,0xc9))[_0xed0b('0x4f')](handleError(_0x3dd170,null));};exports[_0xed0b('0x58')]=function(_0xbe52f8,_0x1f5f94){var _0x96f98d={'where':{'id':_0xbe52f8[_0xed0b('0x4c')]['id']}},_0x26e752={};_0x26e752[_0xed0b('0x36')]=_['keys'](db['Dashboard'][_0xed0b('0x33')]);_0x96f98d['attributes']=_['intersection'](_0x26e752[_0xed0b('0x36')],qs[_0xed0b('0x3c')](_0xbe52f8[_0xed0b('0x38')][_0xed0b('0x3c')]));_0x96f98d[_0xed0b('0x3a')]=_0x96f98d[_0xed0b('0x3a')][_0xed0b('0x3d')]?_0x96f98d['attributes']:_0x26e752[_0xed0b('0x36')];if(_0xbe52f8[_0xed0b('0x38')][_0xed0b('0x48')]){_0x96f98d[_0xed0b('0x49')]=[{'all':!![]}];}_0x96f98d=_[_0xed0b('0x45')]({},_0x96f98d,_0xbe52f8[_0xed0b('0x47')]);return db[_0xed0b('0x4d')][_0xed0b('0x4e')](_0x96f98d)['then'](handleEntityNotFound(_0x1f5f94,null))['then'](function(_0x45787f){if(_0x45787f){var _0x58b2f5=_0x45787f[_0xed0b('0x2d')]({'plain':!![]});_0x58b2f5=qs['omit'](_0x58b2f5,['id',_0xed0b('0x59'),_0xed0b('0x5a')]);_0xbe52f8[_0xed0b('0x51')]=_[_0xed0b('0x5b')](_0xbe52f8[_0xed0b('0x51')],['id','createdAt','updatedAt']);return db[_0xed0b('0x4d')]['create'](_[_0xed0b('0x45')](_0x58b2f5,_0xbe52f8[_0xed0b('0x51')]),{'include':_0xbe52f8[_0xed0b('0x38')][_0xed0b('0x48')]?[{'all':!![]}]:undefined})[_0xed0b('0x2b')](function(_0xa9e19f){var _0x251736=_0xbe52f8[_0xed0b('0x52')][_0xed0b('0x2d')]({'plain':!![]});if(!_0x251736)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x251736['role']===_0xed0b('0x52')){var _0x21de4e=_0xa9e19f[_0xed0b('0x2d')]({'plain':!![]});var _0x314f89=_0xed0b('0x2e');return db[_0xed0b('0x5c')][_0xed0b('0x4e')]({'where':{'name':_0x314f89,'userProfileId':_0x251736[_0xed0b('0x55')]},'raw':!![]})[_0xed0b('0x2b')](function(_0x29a43c){if(_0x29a43c&&_0x29a43c[_0xed0b('0x56')]===0x0){return db['UserProfileResource'][_0xed0b('0x50')]({'name':_0x21de4e[_0xed0b('0x32')],'resourceId':_0x21de4e['id'],'type':_0x29a43c[_0xed0b('0x32')],'sectionId':_0x29a43c['id']},{})[_0xed0b('0x2b')](function(){return _0xa9e19f;});}else{return _0xa9e19f;}})['catch'](function(_0x31176e){logger['error'](_0xed0b('0x57'),_0x31176e);throw _0x31176e;});}return _0xa9e19f;});}})['then'](respondWithResult(_0x1f5f94,0xc9))[_0xed0b('0x4f')](handleError(_0x1f5f94,null));};exports[_0xed0b('0x2a')]=function(_0x5033f8,_0x126447){if(_0x5033f8[_0xed0b('0x51')]['id']){delete _0x5033f8[_0xed0b('0x51')]['id'];}return db[_0xed0b('0x4d')][_0xed0b('0x4e')]({'where':{'id':_0x5033f8['params']['id']}})['then'](handleEntityNotFound(_0x126447,null))[_0xed0b('0x2b')](saveUpdates(_0x5033f8[_0xed0b('0x51')],null))[_0xed0b('0x2b')](respondWithResult(_0x126447,null))[_0xed0b('0x4f')](handleError(_0x126447,null));};exports[_0xed0b('0x2c')]=function(_0x2ff25e,_0x298b90){return db[_0xed0b('0x4d')][_0xed0b('0x4e')]({'where':{'id':_0x2ff25e['params']['id']}})[_0xed0b('0x2b')](handleEntityNotFound(_0x298b90,null))[_0xed0b('0x2b')](removeEntity(_0x298b90,null))[_0xed0b('0x4f')](handleError(_0x298b90,null));};function widgetAttributes(_0x41240e){try{switch(_0x41240e['type']){case'iframe':return[{'name':_0xed0b('0x5d'),'value':_0x41240e['attrUrl']||(_0x41240e['attrs']&&_0x41240e['attrs'][0x0]?_0x41240e[_0xed0b('0x5e')][0x0]['value']:undefined)||_0xed0b('0x5f')}];case'custom':return[{'name':_0xed0b('0x60'),'value':_0x41240e[_0xed0b('0x60')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x0]?_0x41240e[_0xed0b('0x5e')][0x0]['value']:undefined)||''}];case _0xed0b('0x61'):return[{'name':_0xed0b('0x62'),'value':_0x41240e[_0xed0b('0x62')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e['attrs'][0x0]?_0x41240e[_0xed0b('0x5e')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xed0b('0x63'),'value':_0x41240e[_0xed0b('0x63')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x1]?_0x41240e['attrs'][0x1][_0xed0b('0x64')]:undefined)||_0xed0b('0x65')},{'name':_0xed0b('0x66'),'value':_0x41240e[_0xed0b('0x66')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x2]?_0x41240e[_0xed0b('0x5e')][0x2][_0xed0b('0x64')]:undefined)||0xc}];case'counter':return[{'name':_0xed0b('0x67'),'value':_0x41240e[_0xed0b('0x67')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x0]?_0x41240e[_0xed0b('0x5e')][0x0]['value']:undefined)||'total'},{'name':_0xed0b('0x68'),'value':_0x41240e[_0xed0b('0x68')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x1]?_0x41240e[_0xed0b('0x5e')][0x1][_0xed0b('0x64')]:undefined)||[]},{'name':_0xed0b('0x66'),'value':_0x41240e[_0xed0b('0x66')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x2]?_0x41240e[_0xed0b('0x5e')][0x2][_0xed0b('0x64')]:undefined)||0x14},{'name':_0xed0b('0x69'),'value':_0x41240e[_0xed0b('0x69')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e['attrs'][0x3]?_0x41240e[_0xed0b('0x5e')][0x3][_0xed0b('0x64')]:undefined)||_0xed0b('0x6a')},{'name':_0xed0b('0x6b'),'value':_0x41240e[_0xed0b('0x6b')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x4]?_0x41240e[_0xed0b('0x5e')][0x4][_0xed0b('0x64')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x41240e[_0xed0b('0x6c')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x5]?_0x41240e[_0xed0b('0x5e')][0x5][_0xed0b('0x64')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41240e[_0xed0b('0x6d')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x6]?_0x41240e['attrs'][0x6]['value']:undefined)||''},{'name':_0xed0b('0x6e'),'value':_0x41240e[_0xed0b('0x6e')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x7]?_0x41240e[_0xed0b('0x5e')][0x7][_0xed0b('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x41240e[_0xed0b('0x6f')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x8]?_0x41240e[_0xed0b('0x5e')][0x8]['value']:undefined)||''},{'name':_0xed0b('0x70'),'value':_0x41240e[_0xed0b('0x70')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x9]?_0x41240e[_0xed0b('0x5e')][0x9][_0xed0b('0x64')]:undefined)||''}];case _0xed0b('0x71'):case _0xed0b('0x72'):return[{'name':_0xed0b('0x73'),'value':_0x41240e['attrSerie1']||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x0]?_0x41240e['attrs'][0x0]['value']:undefined)||_0xed0b('0x74')},{'name':_0xed0b('0x75'),'value':_0x41240e['attrSerie2']||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x1]?_0x41240e[_0xed0b('0x5e')][0x1][_0xed0b('0x64')]:undefined)||null},{'name':_0xed0b('0x76'),'value':_0x41240e[_0xed0b('0x76')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x2]?_0x41240e[_0xed0b('0x5e')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x41240e[_0xed0b('0x68')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x3]?_0x41240e['attrs'][0x3][_0xed0b('0x64')]:undefined)||[]},{'name':_0xed0b('0x69'),'value':_0x41240e[_0xed0b('0x69')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x4]?_0x41240e[_0xed0b('0x5e')][0x4]['value']:undefined)||'voice'},{'name':_0xed0b('0x6b'),'value':_0x41240e[_0xed0b('0x6b')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x5]?_0x41240e[_0xed0b('0x5e')][0x5][_0xed0b('0x64')]:undefined)||''},{'name':_0xed0b('0x6c'),'value':_0x41240e['attrFaxAccounts']||(_0x41240e['attrs']&&_0x41240e['attrs'][0x6]?_0x41240e[_0xed0b('0x5e')][0x6][_0xed0b('0x64')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41240e[_0xed0b('0x6d')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e['attrs'][0x7]?_0x41240e[_0xed0b('0x5e')][0x7]['value']:undefined)||''},{'name':_0xed0b('0x6e'),'value':_0x41240e[_0xed0b('0x6e')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x8]?_0x41240e[_0xed0b('0x5e')][0x8][_0xed0b('0x64')]:undefined)||''},{'name':_0xed0b('0x6f'),'value':_0x41240e[_0xed0b('0x6f')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x9]?_0x41240e[_0xed0b('0x5e')][0x9]['value']:undefined)||''},{'name':_0xed0b('0x70'),'value':_0x41240e[_0xed0b('0x70')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0xa]?_0x41240e[_0xed0b('0x5e')][0xa][_0xed0b('0x64')]:undefined)||''}];case _0xed0b('0x77'):return[{'name':'attrReport','type':_0x41240e[_0xed0b('0x78')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x0]?_0x41240e[_0xed0b('0x5e')][0x0]['type']:undefined)||null,'value':_0x41240e[_0xed0b('0x79')]||(_0x41240e['attrs']&&_0x41240e[_0xed0b('0x5e')][0x0]?_0x41240e[_0xed0b('0x5e')][0x0][_0xed0b('0x64')]:undefined)||null},{'name':_0xed0b('0x7a'),'value':_0x41240e[_0xed0b('0x7a')]||(_0x41240e[_0xed0b('0x5e')]&&_0x41240e[_0xed0b('0x5e')][0x1]?_0x41240e[_0xed0b('0x5e')][0x1][_0xed0b('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x12f97d){logger['error']('widgetAttributes:\x20%s',JSON[_0xed0b('0x7b')](_0x12f97d));return[];}}exports['addItem']=function(_0x399b99,_0xdea6a7,_0xbaf22d){if(_0x399b99[_0xed0b('0x51')]['id']){delete _0x399b99[_0xed0b('0x51')]['id'];}return db['Dashboard'][_0xed0b('0x4e')]({'where':{'id':_0x399b99[_0xed0b('0x4c')]['id']}})[_0xed0b('0x2b')](handleEntityNotFound(_0xdea6a7,null))[_0xed0b('0x2b')](function(_0x4313c0){if(_0x4313c0){_0x399b99[_0xed0b('0x51')]['DashboardId']=_0x4313c0['id'];_0x399b99[_0xed0b('0x51')][_0xed0b('0x5e')]=widgetAttributes(_0x399b99[_0xed0b('0x51')]);return db[_0xed0b('0x7c')]['create'](_0x399b99[_0xed0b('0x51')]);}})['then'](respondWithResult(_0xdea6a7,null))[_0xed0b('0x4f')](handleError(_0xdea6a7,null));};exports[_0xed0b('0x7d')]=function(_0x1225ba,_0x3cf828,_0x50a19f){var _0x13a8e6={};var _0x4c2c62={};var _0x3af203;var _0x32df9d;return db[_0xed0b('0x4d')]['findOne']({'where':{'id':_0x1225ba['params']['id']}})[_0xed0b('0x2b')](handleEntityNotFound(_0x3cf828,null))[_0xed0b('0x2b')](function(_0x1574e2){if(_0x1574e2){_0x3af203=_0x1574e2;_0x4c2c62[_0xed0b('0x36')]=_['keys'](db[_0xed0b('0x7c')]['rawAttributes']);_0x4c2c62['query']=_['keys'](_0x1225ba[_0xed0b('0x38')]);_0x4c2c62['filters']=_[_0xed0b('0x3b')](_0x4c2c62['model'],_0x4c2c62[_0xed0b('0x38')]);_0x13a8e6['attributes']=_['intersection'](_0x4c2c62['model'],qs[_0xed0b('0x3c')](_0x1225ba[_0xed0b('0x38')][_0xed0b('0x3c')]));_0x13a8e6['attributes']=_0x13a8e6['attributes'][_0xed0b('0x3d')]?_0x13a8e6['attributes']:_0x4c2c62['model'];_0x13a8e6['order']=qs[_0xed0b('0x42')](_0x1225ba[_0xed0b('0x38')][_0xed0b('0x42')]);_0x13a8e6[_0xed0b('0x43')]=qs['filters'](_[_0xed0b('0x7e')](_0x1225ba['query'],_0x4c2c62[_0xed0b('0x44')]));if(_0x1225ba[_0xed0b('0x38')][_0xed0b('0x7f')]){_0x13a8e6[_0xed0b('0x43')]=_['merge'](_0x13a8e6[_0xed0b('0x43')],{'$or':_['map'](_0x13a8e6['attributes'],function(_0x285f44){var _0x2addca={};_0x2addca[_0x285f44]={'$like':'%'+_0x1225ba[_0xed0b('0x38')]['filter']+'%'};return _0x2addca;})});}_0x13a8e6=_[_0xed0b('0x45')]({},_0x13a8e6,_0x1225ba[_0xed0b('0x47')]);return _0x3af203[_0xed0b('0x7d')](_0x13a8e6);}})['then'](function(_0x19cd19){if(_0x19cd19){_0x32df9d=_0x19cd19[_0xed0b('0x3d')];if(!_0x1225ba[_0xed0b('0x38')][_0xed0b('0x3e')]('nolimit')){_0x13a8e6[_0xed0b('0x40')]=qs[_0xed0b('0x40')](_0x1225ba[_0xed0b('0x38')]['limit']);_0x13a8e6[_0xed0b('0x23')]=qs['offset'](_0x1225ba[_0xed0b('0x38')][_0xed0b('0x23')]);}return _0x3af203['getItems'](_0x13a8e6);}})[_0xed0b('0x2b')](function(_0x42e43f){if(_0x42e43f){return _0x42e43f?{'count':_0x32df9d,'rows':_0x42e43f}:null;}})['then'](respondWithResult(_0x3cf828,null))['catch'](handleError(_0x3cf828,null));}; \ No newline at end of file +var _0x0757=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','stack','name','index','map','Dashboard','rawAttributes','fieldName','key','model','query','filters'];(function(_0x56cde2,_0x2fe99e){var _0x5003fc=function(_0x46fb82){while(--_0x46fb82){_0x56cde2['push'](_0x56cde2['shift']());}};_0x5003fc(++_0x2fe99e);}(_0x0757,0x1cd));var _0x7075=function(_0xc80bfc,_0x175b63){_0xc80bfc=_0xc80bfc-0x0;var _0x136fe0=_0x0757[_0xc80bfc];return _0x136fe0;};'use strict';var emlformat=require(_0x7075('0x0'));var rimraf=require(_0x7075('0x1'));var zipdir=require(_0x7075('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7075('0x3'));var BPromise=require(_0x7075('0x4'));var Mustache=require(_0x7075('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7075('0x6'));var csv=require(_0x7075('0x7'));var ejs=require(_0x7075('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7075('0x9'));var squel=require(_0x7075('0xa'));var crypto=require('crypto');var jsforce=require(_0x7075('0xb'));var deskjs=require(_0x7075('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7075('0xd'));var Papa=require('papaparse');var Redis=require(_0x7075('0xe'));var authService=require(_0x7075('0xf'));var qs=require(_0x7075('0x10'));var as=require(_0x7075('0x11'));var hardwareService=require(_0x7075('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7075('0x13'));var config=require(_0x7075('0x14'));var licenseUtil=require(_0x7075('0x15'));var db=require(_0x7075('0x16'))['db'];config[_0x7075('0x17')]=_[_0x7075('0x18')](config[_0x7075('0x17')],{'host':_0x7075('0x19'),'port':0x18eb});var socket=require(_0x7075('0x1a'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x2d9b58,_0x1f18ee){_0x1f18ee=_0x1f18ee||0xcc;return function(_0x2933b3){if(_0x2933b3){return _0x2d9b58[_0x7075('0x1b')](_0x1f18ee);}return _0x2d9b58[_0x7075('0x1c')](_0x1f18ee)[_0x7075('0x1d')]();};}function respondWithResult(_0x142007,_0x5e7209){_0x5e7209=_0x5e7209||0xc8;return function(_0x150faf){if(_0x150faf){return _0x142007[_0x7075('0x1c')](_0x5e7209)[_0x7075('0x1e')](_0x150faf);}};}function respondWithFilteredResult(_0x588d6c,_0x5d9dd8){return function(_0x2eed5b){if(_0x2eed5b){var _0x3fbbf1=typeof _0x5d9dd8['offset']===_0x7075('0x1f')&&typeof _0x5d9dd8['limit']===_0x7075('0x1f');var _0x3e095c=_0x2eed5b[_0x7075('0x20')];var _0x239b87=_0x3fbbf1?0x0:_0x5d9dd8[_0x7075('0x21')];var _0x2b647f=_0x3fbbf1?_0x2eed5b[_0x7075('0x20')]:_0x5d9dd8[_0x7075('0x21')]+_0x5d9dd8[_0x7075('0x22')];var _0x2ebf50;if(_0x2b647f>=_0x3e095c){_0x2b647f=_0x3e095c;_0x2ebf50=0xc8;}else{_0x2ebf50=0xce;}_0x588d6c[_0x7075('0x1c')](_0x2ebf50);return _0x588d6c[_0x7075('0x23')](_0x7075('0x24'),_0x239b87+'-'+_0x2b647f+'/'+_0x3e095c)[_0x7075('0x1e')](_0x2eed5b);}return null;};}function patchUpdates(_0x2a0417){return function(_0x5cc484){try{jsonpatch['apply'](_0x5cc484,_0x2a0417,!![]);}catch(_0x108ea){return BPromise[_0x7075('0x25')](_0x108ea);}return _0x5cc484['save']();};}function saveUpdates(_0x413779,_0x522352){return function(_0x389673){if(_0x389673){return _0x389673[_0x7075('0x26')](_0x413779)[_0x7075('0x27')](function(_0x144e75){return _0x144e75;});}return null;};}function removeEntity(_0x44644a,_0x28df1c){return function(_0x5abdee){if(_0x5abdee){return _0x5abdee[_0x7075('0x28')]()[_0x7075('0x27')](function(){var _0x4a8078=_0x5abdee[_0x7075('0x29')]({'plain':!![]});var _0x19937a=_0x7075('0x2a');return db[_0x7075('0x2b')][_0x7075('0x28')]({'where':{'type':_0x19937a,'resourceId':_0x4a8078['id']}})[_0x7075('0x27')](function(){return _0x5abdee;});})[_0x7075('0x27')](function(){_0x44644a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19563a,_0x302107){return function(_0xd822b5){if(!_0xd822b5){_0x19563a[_0x7075('0x1b')](0x194);}return _0xd822b5;};}function handleError(_0x5595cc,_0x1fcc7a){_0x1fcc7a=_0x1fcc7a||0x1f4;return function(_0x28a068){logger['error'](_0x28a068[_0x7075('0x2c')]);if(_0x28a068[_0x7075('0x2d')]){delete _0x28a068['name'];}_0x5595cc[_0x7075('0x1c')](_0x1fcc7a)['send'](_0x28a068);};}exports[_0x7075('0x2e')]=function(_0x56f34f,_0x3a5947){var _0x5e2988={},_0x2a4e7f={},_0x17ce85={'count':0x0,'rows':[]};var _0x1a0cb8=_[_0x7075('0x2f')](db[_0x7075('0x30')][_0x7075('0x31')],function(_0x345954){return{'name':_0x345954[_0x7075('0x32')],'type':_0x345954['type'][_0x7075('0x33')]};});_0x2a4e7f[_0x7075('0x34')]=_[_0x7075('0x2f')](_0x1a0cb8,_0x7075('0x2d'));_0x2a4e7f[_0x7075('0x35')]=_['keys'](_0x56f34f[_0x7075('0x35')]);_0x2a4e7f[_0x7075('0x36')]=_[_0x7075('0x37')](_0x2a4e7f[_0x7075('0x34')],_0x2a4e7f[_0x7075('0x35')]);_0x5e2988[_0x7075('0x38')]=_[_0x7075('0x37')](_0x2a4e7f[_0x7075('0x34')],qs[_0x7075('0x39')](_0x56f34f[_0x7075('0x35')][_0x7075('0x39')]));_0x5e2988[_0x7075('0x38')]=_0x5e2988[_0x7075('0x38')][_0x7075('0x3a')]?_0x5e2988[_0x7075('0x38')]:_0x2a4e7f['model'];if(!_0x56f34f[_0x7075('0x35')]['hasOwnProperty'](_0x7075('0x3b'))){_0x5e2988[_0x7075('0x22')]=qs[_0x7075('0x22')](_0x56f34f[_0x7075('0x35')][_0x7075('0x22')]);_0x5e2988['offset']=qs[_0x7075('0x21')](_0x56f34f[_0x7075('0x35')][_0x7075('0x21')]);}_0x5e2988[_0x7075('0x3c')]=qs[_0x7075('0x3d')](_0x56f34f[_0x7075('0x35')][_0x7075('0x3d')]);_0x5e2988[_0x7075('0x3e')]=qs[_0x7075('0x36')](_[_0x7075('0x3f')](_0x56f34f[_0x7075('0x35')],_0x2a4e7f[_0x7075('0x36')]),_0x1a0cb8);if(_0x56f34f['query'][_0x7075('0x40')]){_0x5e2988[_0x7075('0x3e')]=_[_0x7075('0x41')](_0x5e2988[_0x7075('0x3e')],{'$or':_[_0x7075('0x2f')](_0x1a0cb8,function(_0x578efb){if(_0x578efb[_0x7075('0x42')]!==_0x7075('0x43')){var _0x2cd3b7={};_0x2cd3b7[_0x578efb['name']]={'$like':'%'+_0x56f34f['query'][_0x7075('0x40')]+'%'};return _0x2cd3b7;}})});}_0x5e2988=_['merge']({},_0x5e2988,_0x56f34f[_0x7075('0x44')]);var _0x242c6e={'where':_0x5e2988[_0x7075('0x3e')]};return db[_0x7075('0x30')][_0x7075('0x20')](_0x242c6e)[_0x7075('0x27')](function(_0x101765){_0x17ce85[_0x7075('0x20')]=_0x101765;if(_0x56f34f[_0x7075('0x35')][_0x7075('0x45')]){_0x5e2988[_0x7075('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x7075('0x47')](_0x5e2988);})[_0x7075('0x27')](function(_0x5d8dce){_0x17ce85[_0x7075('0x48')]=_0x5d8dce;return _0x17ce85;})[_0x7075('0x27')](respondWithFilteredResult(_0x3a5947,_0x5e2988))['catch'](handleError(_0x3a5947,null));};exports[_0x7075('0x49')]=function(_0x9bcc51,_0x5f0a2f){var _0xa631d7={'raw':![],'where':{'id':_0x9bcc51[_0x7075('0x4a')]['id']}},_0x272b10={};_0x272b10[_0x7075('0x34')]=_[_0x7075('0x4b')](db[_0x7075('0x30')][_0x7075('0x31')]);_0x272b10[_0x7075('0x35')]=_[_0x7075('0x4b')](_0x9bcc51[_0x7075('0x35')]);_0x272b10[_0x7075('0x36')]=_[_0x7075('0x37')](_0x272b10[_0x7075('0x34')],_0x272b10[_0x7075('0x35')]);_0xa631d7[_0x7075('0x38')]=_[_0x7075('0x37')](_0x272b10[_0x7075('0x34')],qs['fields'](_0x9bcc51[_0x7075('0x35')][_0x7075('0x39')]));_0xa631d7['attributes']=_0xa631d7[_0x7075('0x38')][_0x7075('0x3a')]?_0xa631d7[_0x7075('0x38')]:_0x272b10[_0x7075('0x34')];if(_0x9bcc51[_0x7075('0x35')]['includeAll']){_0xa631d7[_0x7075('0x46')]=[{'all':!![]}];}_0xa631d7=_[_0x7075('0x41')]({},_0xa631d7,_0x9bcc51[_0x7075('0x44')]);return db[_0x7075('0x30')]['find'](_0xa631d7)[_0x7075('0x27')](handleEntityNotFound(_0x5f0a2f,null))['then'](respondWithResult(_0x5f0a2f,null))[_0x7075('0x4c')](handleError(_0x5f0a2f,null));};exports[_0x7075('0x4d')]=function(_0x4a93ac,_0x1e0343){return db[_0x7075('0x30')][_0x7075('0x4d')](_0x4a93ac[_0x7075('0x4e')],{})['then'](function(_0x243e24){var _0x59f2cd=_0x4a93ac[_0x7075('0x4f')][_0x7075('0x29')]({'plain':!![]});if(!_0x59f2cd)throw new Error(_0x7075('0x50'));if(_0x59f2cd[_0x7075('0x51')]===_0x7075('0x4f')){var _0x2aedf5=_0x243e24[_0x7075('0x29')]({'plain':!![]});var _0x34cd15=_0x7075('0x2a');return db[_0x7075('0x52')][_0x7075('0x53')]({'where':{'name':_0x34cd15,'userProfileId':_0x59f2cd[_0x7075('0x54')]},'raw':!![]})[_0x7075('0x27')](function(_0x5cd641){if(_0x5cd641&&_0x5cd641[_0x7075('0x55')]===0x0){return db[_0x7075('0x2b')][_0x7075('0x4d')]({'name':_0x2aedf5[_0x7075('0x2d')],'resourceId':_0x2aedf5['id'],'type':_0x5cd641[_0x7075('0x2d')],'sectionId':_0x5cd641['id']},{})[_0x7075('0x27')](function(){return _0x243e24;});}else{return _0x243e24;}})[_0x7075('0x4c')](function(_0x3faf07){logger[_0x7075('0x56')](_0x7075('0x57'),_0x3faf07);throw _0x3faf07;});}return _0x243e24;})[_0x7075('0x27')](respondWithResult(_0x1e0343,0xc9))[_0x7075('0x4c')](handleError(_0x1e0343,null));};exports[_0x7075('0x58')]=function(_0x39c38a,_0x847c5){var _0x593a44={'where':{'id':_0x39c38a['params']['id']}},_0x20897d={};_0x20897d['model']=_[_0x7075('0x4b')](db['Dashboard']['rawAttributes']);_0x593a44['attributes']=_[_0x7075('0x37')](_0x20897d['model'],qs['fields'](_0x39c38a[_0x7075('0x35')][_0x7075('0x39')]));_0x593a44[_0x7075('0x38')]=_0x593a44['attributes'][_0x7075('0x3a')]?_0x593a44['attributes']:_0x20897d['model'];if(_0x39c38a[_0x7075('0x35')][_0x7075('0x45')]){_0x593a44[_0x7075('0x46')]=[{'all':!![]}];}_0x593a44=_[_0x7075('0x41')]({},_0x593a44,_0x39c38a['options']);return db[_0x7075('0x30')][_0x7075('0x53')](_0x593a44)[_0x7075('0x27')](handleEntityNotFound(_0x847c5,null))[_0x7075('0x27')](function(_0x35e864){if(_0x35e864){var _0x21d314=_0x35e864[_0x7075('0x29')]({'plain':!![]});_0x21d314=qs['omit'](_0x21d314,['id',_0x7075('0x59'),_0x7075('0x5a')]);_0x39c38a['body']=_[_0x7075('0x5b')](_0x39c38a['body'],['id',_0x7075('0x59'),_0x7075('0x5a')]);return db[_0x7075('0x30')][_0x7075('0x4d')](_[_0x7075('0x41')](_0x21d314,_0x39c38a[_0x7075('0x4e')]),{'include':_0x39c38a[_0x7075('0x35')][_0x7075('0x45')]?[{'all':!![]}]:undefined})[_0x7075('0x27')](function(_0x4e3d81){var _0xb8264a=_0x39c38a[_0x7075('0x4f')][_0x7075('0x29')]({'plain':!![]});if(!_0xb8264a)throw new Error(_0x7075('0x50'));if(_0xb8264a[_0x7075('0x51')]==='user'){var _0xefd9df=_0x4e3d81[_0x7075('0x29')]({'plain':!![]});var _0x32b266=_0x7075('0x2a');return db[_0x7075('0x52')][_0x7075('0x53')]({'where':{'name':_0x32b266,'userProfileId':_0xb8264a[_0x7075('0x54')]},'raw':!![]})[_0x7075('0x27')](function(_0x4a98be){if(_0x4a98be&&_0x4a98be[_0x7075('0x55')]===0x0){return db['UserProfileResource'][_0x7075('0x4d')]({'name':_0xefd9df[_0x7075('0x2d')],'resourceId':_0xefd9df['id'],'type':_0x4a98be[_0x7075('0x2d')],'sectionId':_0x4a98be['id']},{})[_0x7075('0x27')](function(){return _0x4e3d81;});}else{return _0x4e3d81;}})['catch'](function(_0x135857){logger['error'](_0x7075('0x57'),_0x135857);throw _0x135857;});}return _0x4e3d81;});}})[_0x7075('0x27')](respondWithResult(_0x847c5,0xc9))['catch'](handleError(_0x847c5,null));};exports['update']=function(_0x5dedf8,_0x20d1d2){if(_0x5dedf8['body']['id']){delete _0x5dedf8[_0x7075('0x4e')]['id'];}return db[_0x7075('0x30')][_0x7075('0x53')]({'where':{'id':_0x5dedf8['params']['id']}})[_0x7075('0x27')](handleEntityNotFound(_0x20d1d2,null))[_0x7075('0x27')](saveUpdates(_0x5dedf8[_0x7075('0x4e')],null))['then'](respondWithResult(_0x20d1d2,null))[_0x7075('0x4c')](handleError(_0x20d1d2,null));};exports[_0x7075('0x28')]=function(_0x59f78d,_0x37501c){return db[_0x7075('0x30')][_0x7075('0x53')]({'where':{'id':_0x59f78d[_0x7075('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37501c,null))[_0x7075('0x27')](removeEntity(_0x37501c,null))[_0x7075('0x4c')](handleError(_0x37501c,null));};function widgetAttributes(_0x57a573){try{switch(_0x57a573[_0x7075('0x42')]){case'iframe':return[{'name':_0x7075('0x5c'),'value':_0x57a573[_0x7075('0x5c')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573[_0x7075('0x5d')][0x0][_0x7075('0x5e')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x57a573[_0x7075('0x5f')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573['attrs'][0x0][_0x7075('0x5e')]:undefined)||''}];case _0x7075('0x60'):return[{'name':_0x7075('0x61'),'value':_0x57a573['attrHourFormat']||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573[_0x7075('0x5d')][0x0][_0x7075('0x5e')]:undefined)||_0x7075('0x62')},{'name':_0x7075('0x63'),'value':_0x57a573[_0x7075('0x63')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x1]?_0x57a573[_0x7075('0x5d')][0x1][_0x7075('0x5e')]:undefined)||_0x7075('0x64')},{'name':'attrFontSize','value':_0x57a573[_0x7075('0x65')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x2]?_0x57a573[_0x7075('0x5d')][0x2][_0x7075('0x5e')]:undefined)||0xc}];case _0x7075('0x66'):return[{'name':_0x7075('0x67'),'value':_0x57a573[_0x7075('0x67')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573['attrs'][0x0][_0x7075('0x5e')]:undefined)||'total'},{'name':_0x7075('0x68'),'value':_0x57a573[_0x7075('0x68')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x1]?_0x57a573[_0x7075('0x5d')][0x1][_0x7075('0x5e')]:undefined)||[]},{'name':_0x7075('0x65'),'value':_0x57a573[_0x7075('0x65')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x2]?_0x57a573[_0x7075('0x5d')][0x2][_0x7075('0x5e')]:undefined)||0x14},{'name':_0x7075('0x69'),'value':_0x57a573[_0x7075('0x69')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x3]?_0x57a573[_0x7075('0x5d')][0x3][_0x7075('0x5e')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x57a573[_0x7075('0x6a')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x4]?_0x57a573['attrs'][0x4][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6b'),'value':_0x57a573[_0x7075('0x6b')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x5]?_0x57a573['attrs'][0x5][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6c'),'value':_0x57a573[_0x7075('0x6c')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x6]?_0x57a573[_0x7075('0x5d')][0x6][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6d'),'value':_0x57a573[_0x7075('0x6d')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x7]?_0x57a573['attrs'][0x7][_0x7075('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x57a573[_0x7075('0x6e')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x8]?_0x57a573[_0x7075('0x5d')][0x8]['value']:undefined)||''},{'name':_0x7075('0x6f'),'value':_0x57a573[_0x7075('0x6f')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x9]?_0x57a573['attrs'][0x9][_0x7075('0x5e')]:undefined)||''}];case _0x7075('0x70'):case _0x7075('0x71'):return[{'name':_0x7075('0x72'),'value':_0x57a573[_0x7075('0x72')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573[_0x7075('0x5d')][0x0][_0x7075('0x5e')]:undefined)||_0x7075('0x73')},{'name':'attrSerie2','value':_0x57a573[_0x7075('0x74')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573['attrs'][0x1]?_0x57a573['attrs'][0x1]['value']:undefined)||null},{'name':_0x7075('0x75'),'value':_0x57a573[_0x7075('0x75')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x2]?_0x57a573[_0x7075('0x5d')][0x2][_0x7075('0x5e')]:undefined)||null},{'name':_0x7075('0x68'),'value':_0x57a573[_0x7075('0x68')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573['attrs'][0x3]?_0x57a573[_0x7075('0x5d')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x57a573[_0x7075('0x69')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x4]?_0x57a573[_0x7075('0x5d')][0x4][_0x7075('0x5e')]:undefined)||_0x7075('0x76')},{'name':'attrEmailAccounts','value':_0x57a573[_0x7075('0x6a')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x5]?_0x57a573[_0x7075('0x5d')][0x5][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6b'),'value':_0x57a573[_0x7075('0x6b')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573['attrs'][0x6]?_0x57a573[_0x7075('0x5d')][0x6]['value']:undefined)||''},{'name':_0x7075('0x6c'),'value':_0x57a573[_0x7075('0x6c')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x7]?_0x57a573[_0x7075('0x5d')][0x7][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6d'),'value':_0x57a573[_0x7075('0x6d')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x8]?_0x57a573[_0x7075('0x5d')][0x8][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6e'),'value':_0x57a573[_0x7075('0x6e')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0x9]?_0x57a573['attrs'][0x9][_0x7075('0x5e')]:undefined)||''},{'name':_0x7075('0x6f'),'value':_0x57a573[_0x7075('0x6f')]||(_0x57a573['attrs']&&_0x57a573[_0x7075('0x5d')][0xa]?_0x57a573[_0x7075('0x5d')][0xa][_0x7075('0x5e')]:undefined)||''}];case _0x7075('0x77'):return[{'name':_0x7075('0x78'),'type':_0x57a573['reportType']||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573['attrs'][0x0][_0x7075('0x42')]:undefined)||null,'value':_0x57a573[_0x7075('0x78')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x0]?_0x57a573[_0x7075('0x5d')][0x0][_0x7075('0x5e')]:undefined)||null},{'name':_0x7075('0x79'),'value':_0x57a573[_0x7075('0x79')]||(_0x57a573[_0x7075('0x5d')]&&_0x57a573[_0x7075('0x5d')][0x1]?_0x57a573[_0x7075('0x5d')][0x1][_0x7075('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x39536f){logger[_0x7075('0x56')](_0x7075('0x7a'),JSON[_0x7075('0x7b')](_0x39536f));return[];}}exports[_0x7075('0x7c')]=function(_0x58562d,_0x318060,_0x22093b){if(_0x58562d[_0x7075('0x4e')]['id']){delete _0x58562d['body']['id'];}return db[_0x7075('0x30')][_0x7075('0x53')]({'where':{'id':_0x58562d[_0x7075('0x4a')]['id']}})[_0x7075('0x27')](handleEntityNotFound(_0x318060,null))[_0x7075('0x27')](function(_0x12df6b){if(_0x12df6b){_0x58562d[_0x7075('0x4e')][_0x7075('0x7d')]=_0x12df6b['id'];_0x58562d[_0x7075('0x4e')][_0x7075('0x5d')]=widgetAttributes(_0x58562d[_0x7075('0x4e')]);return db[_0x7075('0x7e')][_0x7075('0x4d')](_0x58562d['body']);}})['then'](respondWithResult(_0x318060,null))[_0x7075('0x4c')](handleError(_0x318060,null));};exports[_0x7075('0x7f')]=function(_0x5e7855,_0xd39030,_0x5c7c95){var _0xd6fdbe={};var _0x4d1786={};var _0x163c93;var _0x153c70;return db['Dashboard']['findOne']({'where':{'id':_0x5e7855[_0x7075('0x4a')]['id']}})[_0x7075('0x27')](handleEntityNotFound(_0xd39030,null))[_0x7075('0x27')](function(_0x542df3){if(_0x542df3){_0x163c93=_0x542df3;_0x4d1786['model']=_[_0x7075('0x4b')](db[_0x7075('0x7e')]['rawAttributes']);_0x4d1786[_0x7075('0x35')]=_[_0x7075('0x4b')](_0x5e7855[_0x7075('0x35')]);_0x4d1786[_0x7075('0x36')]=_[_0x7075('0x37')](_0x4d1786[_0x7075('0x34')],_0x4d1786[_0x7075('0x35')]);_0xd6fdbe[_0x7075('0x38')]=_[_0x7075('0x37')](_0x4d1786['model'],qs['fields'](_0x5e7855['query'][_0x7075('0x39')]));_0xd6fdbe[_0x7075('0x38')]=_0xd6fdbe['attributes'][_0x7075('0x3a')]?_0xd6fdbe[_0x7075('0x38')]:_0x4d1786[_0x7075('0x34')];_0xd6fdbe[_0x7075('0x3c')]=qs['sort'](_0x5e7855['query']['sort']);_0xd6fdbe[_0x7075('0x3e')]=qs[_0x7075('0x36')](_[_0x7075('0x3f')](_0x5e7855[_0x7075('0x35')],_0x4d1786['filters']));if(_0x5e7855[_0x7075('0x35')][_0x7075('0x40')]){_0xd6fdbe[_0x7075('0x3e')]=_[_0x7075('0x41')](_0xd6fdbe[_0x7075('0x3e')],{'$or':_[_0x7075('0x2f')](_0xd6fdbe[_0x7075('0x38')],function(_0x44efe5){var _0x5186e0={};_0x5186e0[_0x44efe5]={'$like':'%'+_0x5e7855[_0x7075('0x35')][_0x7075('0x40')]+'%'};return _0x5186e0;})});}_0xd6fdbe=_[_0x7075('0x41')]({},_0xd6fdbe,_0x5e7855[_0x7075('0x44')]);return _0x163c93[_0x7075('0x7f')](_0xd6fdbe);}})[_0x7075('0x27')](function(_0x1e1ab7){if(_0x1e1ab7){_0x153c70=_0x1e1ab7[_0x7075('0x3a')];if(!_0x5e7855[_0x7075('0x35')][_0x7075('0x80')](_0x7075('0x3b'))){_0xd6fdbe[_0x7075('0x22')]=qs[_0x7075('0x22')](_0x5e7855[_0x7075('0x35')][_0x7075('0x22')]);_0xd6fdbe[_0x7075('0x21')]=qs[_0x7075('0x21')](_0x5e7855[_0x7075('0x35')][_0x7075('0x21')]);}return _0x163c93['getItems'](_0xd6fdbe);}})['then'](function(_0x4d6021){if(_0x4d6021){return _0x4d6021?{'count':_0x153c70,'rows':_0x4d6021}:null;}})[_0x7075('0x27')](respondWithResult(_0xd39030,null))[_0x7075('0x4c')](handleError(_0xd39030,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 66b4e5d..58bfe3f 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 _0x8107=['hook','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4a7bba,_0x1daa93){var _0x206ea6=function(_0xef2a47){while(--_0xef2a47){_0x4a7bba['push'](_0x4a7bba['shift']());}};_0x206ea6(++_0x1daa93);}(_0x8107,0x1f1));var _0x7810=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x8107[_0x4cc280];return _0x16ed24;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x7810('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7810('0x1')](0x0);var events={'afterCreate':_0x7810('0x2'),'afterUpdate':_0x7810('0x3'),'afterDestroy':_0x7810('0x4')};function emitEvent(_0x1eacd0){return function(_0xf21a5d,_0x171c12,_0x7fe30e){DashboardEvents[_0x7810('0x5')](_0x1eacd0+':'+_0xf21a5d['id'],_0xf21a5d);DashboardEvents[_0x7810('0x5')](_0x1eacd0,_0xf21a5d);_0x7fe30e(null);};}for(var e in events){if(events[_0x7810('0x6')](e)){var event=events[e];Dashboard[_0x7810('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x2b2d=['hook','events','../../mysqldb','Dashboard','save','remove'];(function(_0x24a3b3,_0x53b2ee){var _0x123c8d=function(_0x36cecd){while(--_0x36cecd){_0x24a3b3['push'](_0x24a3b3['shift']());}};_0x123c8d(++_0x53b2ee);}(_0x2b2d,0xcd));var _0xd2b2=function(_0x5cceb8,_0xa8e57a){_0x5cceb8=_0x5cceb8-0x0;var _0xeaf4be=_0x2b2d[_0x5cceb8];return _0xeaf4be;};'use strict';var EventEmitter=require(_0xd2b2('0x0'));var Dashboard=require(_0xd2b2('0x1'))['db'][_0xd2b2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd2b2('0x3'),'afterUpdate':'update','afterDestroy':_0xd2b2('0x4')};function emitEvent(_0x35c44d){return function(_0x14b3ed,_0x517df8,_0x3683e0){DashboardEvents['emit'](_0x35c44d+':'+_0x14b3ed['id'],_0x14b3ed);DashboardEvents['emit'](_0x35c44d,_0x14b3ed);_0x3683e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xd2b2('0x5')](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 61b2ad0..fd8e11d 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 _0x4dfc=['define','dashboards','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b8655,_0x485d9a){var _0x3b483b=function(_0x595a6c){while(--_0x595a6c){_0x4b8655['push'](_0x4b8655['shift']());}};_0x3b483b(++_0x485d9a);}(_0x4dfc,0xda));var _0xc4df=function(_0xb4947e,_0x39de27){_0xb4947e=_0xb4947e-0x0;var _0x2af6df=_0x4dfc[_0xb4947e];return _0x2af6df;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc4df('0x0'));var moment=require(_0xc4df('0x1'));var BPromise=require(_0xc4df('0x2'));var rp=require(_0xc4df('0x3'));var fs=require('fs');var path=require(_0xc4df('0x4'));var rimraf=require(_0xc4df('0x5'));var config=require(_0xc4df('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x5814de,_0x27d2b2){return _0x5814de[_0xc4df('0x7')]('Dashboard',attributes,{'tableName':_0xc4df('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9010=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash'];(function(_0x4c9ad2,_0x3bb687){var _0x507886=function(_0x3dd28d){while(--_0x3dd28d){_0x4c9ad2['push'](_0x4c9ad2['shift']());}};_0x507886(++_0x3bb687);}(_0x9010,0xdf));var _0x0901=function(_0x40b701,_0xfa113b){_0x40b701=_0x40b701-0x0;var _0x257052=_0x9010[_0x40b701];return _0x257052;};'use strict';var _=require(_0x0901('0x0'));var util=require(_0x0901('0x1'));var logger=require(_0x0901('0x2'))(_0x0901('0x3'));var moment=require(_0x0901('0x4'));var BPromise=require(_0x0901('0x5'));var rp=require(_0x0901('0x6'));var fs=require('fs');var path=require(_0x0901('0x7'));var rimraf=require(_0x0901('0x8'));var config=require(_0x0901('0x9'));var attributes=require(_0x0901('0xa'));module['exports']=function(_0x433712,_0x1cc281){return _0x433712[_0x0901('0xb')](_0x0901('0xc'),attributes,{'tableName':_0x0901('0xd'),'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 4988106..27985ac 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 _0x7abd=['request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./dashboard.socket','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7abd,0xbb));var _0xd7ab=function(_0x31a116,_0x5b75b0){_0x31a116=_0x31a116-0x0;var _0x5f31ce=_0x7abd[_0x31a116];return _0x5f31ce;};'use strict';var _=require('lodash');var util=require(_0xd7ab('0x0'));var moment=require(_0xd7ab('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ab('0x2'));var fs=require('fs');var Redis=require(_0xd7ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7ab('0x4'));var logger=require(_0xd7ab('0x5'))(_0xd7ab('0x6'));var config=require('../../config/environment');var jayson=require(_0xd7ab('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xd7ab('0x8')]=_[_0xd7ab('0x9')](config[_0xd7ab('0x8')],{'host':_0xd7ab('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7ab('0x8')]));require(_0xd7ab('0xb'))[_0xd7ab('0xc')](socket);function respondWithRpcPromise(_0x455ab0,_0x316532,_0x3336fc){return new BPromise(function(_0x44089e,_0x12d230){return client[_0xd7ab('0xd')](_0x455ab0,_0x3336fc)['then'](function(_0x16643c){logger[_0xd7ab('0xe')](_0xd7ab('0xf'),_0x316532,_0xd7ab('0x10'));logger[_0xd7ab('0x11')](_0xd7ab('0x12'),_0x316532,_0xd7ab('0x10'),JSON[_0xd7ab('0x13')](_0x16643c));if(_0x16643c[_0xd7ab('0x14')]){if(_0x16643c[_0xd7ab('0x14')][_0xd7ab('0x15')]===0x1f4){logger[_0xd7ab('0x14')](_0xd7ab('0xf'),_0x316532,_0x16643c[_0xd7ab('0x14')][_0xd7ab('0x16')]);return _0x12d230(_0x16643c[_0xd7ab('0x14')][_0xd7ab('0x16')]);}logger[_0xd7ab('0x14')](_0xd7ab('0xf'),_0x316532,_0x16643c[_0xd7ab('0x14')]['message']);return _0x44089e(_0x16643c[_0xd7ab('0x14')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x316532,'request\x20sent');_0x44089e(_0x16643c[_0xd7ab('0x17')][_0xd7ab('0x16')]);}})[_0xd7ab('0x18')](function(_0x1fcf81){logger['error'](_0xd7ab('0xf'),_0x316532,_0x1fcf81);_0x12d230(_0x1fcf81);});});} \ No newline at end of file +var _0x720e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x293ed5,_0x395926){var _0x1e2c32=function(_0x5098b4){while(--_0x5098b4){_0x293ed5['push'](_0x293ed5['shift']());}};_0x1e2c32(++_0x395926);}(_0x720e,0x1b3));var _0xe720=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0x720e[_0x44ae0b];return _0x69232a;};'use strict';var _=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var moment=require(_0xe720('0x2'));var BPromise=require(_0xe720('0x3'));var rs=require(_0xe720('0x4'));var fs=require('fs');var Redis=require(_0xe720('0x5'));var db=require(_0xe720('0x6'))['db'];var utils=require(_0xe720('0x7'));var logger=require(_0xe720('0x8'))(_0xe720('0x9'));var config=require(_0xe720('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xe720('0xb')]=_[_0xe720('0xc')](config['redis'],{'host':_0xe720('0xd'),'port':0x18eb});var socket=require(_0xe720('0xe'))(new Redis(config[_0xe720('0xb')]));require(_0xe720('0xf'))[_0xe720('0x10')](socket);function respondWithRpcPromise(_0x1532aa,_0x3d6a2d,_0x1b2192){return new BPromise(function(_0x310b56,_0x7a8122){return client[_0xe720('0x11')](_0x1532aa,_0x1b2192)['then'](function(_0x1ab86b){logger['info'](_0xe720('0x12'),_0x3d6a2d,'request\x20sent');logger[_0xe720('0x13')](_0xe720('0x14'),_0x3d6a2d,_0xe720('0x15'),JSON['stringify'](_0x1ab86b));if(_0x1ab86b['error']){if(_0x1ab86b[_0xe720('0x16')][_0xe720('0x17')]===0x1f4){logger[_0xe720('0x16')](_0xe720('0x12'),_0x3d6a2d,_0x1ab86b[_0xe720('0x16')][_0xe720('0x18')]);return _0x7a8122(_0x1ab86b[_0xe720('0x16')][_0xe720('0x18')]);}logger['error'](_0xe720('0x12'),_0x3d6a2d,_0x1ab86b[_0xe720('0x16')][_0xe720('0x18')]);return _0x310b56(_0x1ab86b[_0xe720('0x16')][_0xe720('0x18')]);}else{logger['info'](_0xe720('0x12'),_0x3d6a2d,_0xe720('0x15'));_0x310b56(_0x1ab86b[_0xe720('0x19')][_0xe720('0x18')]);}})[_0xe720('0x1a')](function(_0x31a9cb){logger[_0xe720('0x16')]('Dashboard,\x20%s,\x20%s',_0x3d6a2d,_0x31a9cb);_0x7a8122(_0x31a9cb);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index aa28f28..872a9bc 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 _0xaeff=['remove','update','emit','register','length','./dashboard.events','save'];(function(_0x2b55cd,_0x333cf7){var _0x6dfb14=function(_0x5dec0d){while(--_0x5dec0d){_0x2b55cd['push'](_0x2b55cd['shift']());}};_0x6dfb14(++_0x333cf7);}(_0xaeff,0x1e1));var _0xfaef=function(_0x34f31c,_0x40ab5b){_0x34f31c=_0x34f31c-0x0;var _0x1b4650=_0xaeff[_0x34f31c];return _0x1b4650;};'use strict';var DashboardEvents=require(_0xfaef('0x0'));var events=[_0xfaef('0x1'),_0xfaef('0x2'),_0xfaef('0x3')];function createListener(_0x1d0344,_0x21cd9b){return function(_0x581e47){_0x21cd9b[_0xfaef('0x4')](_0x1d0344,_0x581e47);};}function removeListener(_0x3fa23c,_0x4e55e4){return function(){DashboardEvents['removeListener'](_0x3fa23c,_0x4e55e4);};}exports[_0xfaef('0x5')]=function(_0x26cc6b){for(var _0x31c3b8=0x0,_0x4edee6=events[_0xfaef('0x6')];_0x31c3b8<_0x4edee6;_0x31c3b8++){var _0x289815=events[_0x31c3b8];var _0x261863=createListener('dashboard:'+_0x289815,_0x26cc6b);DashboardEvents['on'](_0x289815,_0x261863);}}; \ No newline at end of file +var _0xc2a4=['dashboard:','save','remove','update','register'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xc2a4,0x8d));var _0x4c2a=function(_0x498720,_0x2e55d9){_0x498720=_0x498720-0x0;var _0xbca841=_0xc2a4[_0x498720];return _0xbca841;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4c2a('0x0'),_0x4c2a('0x1'),_0x4c2a('0x2')];function createListener(_0x583ef6,_0x11422b){return function(_0x415259){_0x11422b['emit'](_0x583ef6,_0x415259);};}function removeListener(_0x3743ab,_0x33ca2f){return function(){DashboardEvents['removeListener'](_0x3743ab,_0x33ca2f);};}exports[_0x4c2a('0x3')]=function(_0x96d114){for(var _0x25ae94=0x0,_0x223043=events['length'];_0x25ae94<_0x223043;_0x25ae94++){var _0x267777=events[_0x25ae94];var _0x5603f8=createListener(_0x4c2a('0x4')+_0x267777,_0x96d114);DashboardEvents['on'](_0x267777,_0x5603f8);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9c9b866..436cfff 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 _0x2473=['/:id','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put'];(function(_0x4cb9c2,_0x27102f){var _0x1b2b50=function(_0xa482b1){while(--_0xa482b1){_0x4cb9c2['push'](_0x4cb9c2['shift']());}};_0x1b2b50(++_0x27102f);}(_0x2473,0xca));var _0x3247=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2473[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x3247('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3247('0x1'));var express=require(_0x3247('0x2'));var router=express['Router']();var fs_extra=require(_0x3247('0x3'));var auth=require(_0x3247('0x4'));var interaction=require(_0x3247('0x5'));var config=require(_0x3247('0x6'));var controller=require('./dashboard.controller');router[_0x3247('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x3247('0x8')](),controller[_0x3247('0x9')]);router[_0x3247('0x7')](_0x3247('0xa'),auth[_0x3247('0x8')](),controller[_0x3247('0xb')]);router['post']('/',auth[_0x3247('0x8')](),controller[_0x3247('0xc')]);router[_0x3247('0xd')](_0x3247('0xe'),auth[_0x3247('0x8')](),controller[_0x3247('0xf')]);router['post'](_0x3247('0xa'),auth[_0x3247('0x8')](),controller[_0x3247('0x10')]);router[_0x3247('0x11')](_0x3247('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x3247('0x13')](_0x3247('0x12'),auth[_0x3247('0x8')](),controller[_0x3247('0x14')]);module[_0x3247('0x15')]=router; \ No newline at end of file +var _0xff93=['./dashboard.controller','isAuthenticated','get','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service'];(function(_0x476392,_0x43d678){var _0x25d9f4=function(_0x4a0426){while(--_0x4a0426){_0x476392['push'](_0x476392['shift']());}};_0x25d9f4(++_0x43d678);}(_0xff93,0xf7));var _0x3ff9=function(_0x354ab1,_0xec5b21){_0x354ab1=_0x354ab1-0x0;var _0x9918a1=_0xff93[_0x354ab1];return _0x9918a1;};'use strict';var multer=require(_0x3ff9('0x0'));var util=require(_0x3ff9('0x1'));var path=require(_0x3ff9('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ff9('0x3'));var router=express['Router']();var fs_extra=require(_0x3ff9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ff9('0x5'));var config=require('../../config/environment');var controller=require(_0x3ff9('0x6'));router['get']('/',auth[_0x3ff9('0x7')](),controller['index']);router[_0x3ff9('0x8')]('/:id',auth[_0x3ff9('0x7')](),controller[_0x3ff9('0x9')]);router['get'](_0x3ff9('0xa'),auth[_0x3ff9('0x7')](),controller[_0x3ff9('0xb')]);router[_0x3ff9('0xc')]('/',auth[_0x3ff9('0x7')](),controller[_0x3ff9('0xd')]);router[_0x3ff9('0xc')](_0x3ff9('0xe'),auth[_0x3ff9('0x7')](),controller[_0x3ff9('0xf')]);router[_0x3ff9('0xc')](_0x3ff9('0xa'),auth[_0x3ff9('0x7')](),controller[_0x3ff9('0x10')]);router[_0x3ff9('0x11')]('/:id',auth[_0x3ff9('0x7')](),controller[_0x3ff9('0x12')]);router[_0x3ff9('0x13')](_0x3ff9('0x14'),auth['isAuthenticated'](),controller[_0x3ff9('0x15')]);module[_0x3ff9('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 4af8524..94d315c 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 _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x507fa1,_0x57f744){var _0x2e028c=function(_0x4a7602){while(--_0x4a7602){_0x507fa1['push'](_0x507fa1['shift']());}};_0x2e028c(++_0x57f744);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xabce[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 4ff34de..1f6066e 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 _0x5334=['type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','attrRefresh','error','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','undefined','count','offset','limit','set','json','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','DashboardItem','find','catch'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x5334,0x84));var _0x4533=function(_0xfab950,_0x2be2b8){_0xfab950=_0xfab950-0x0;var _0x25d29c=_0x5334[_0xfab950];return _0x25d29c;};'use strict';var emlformat=require(_0x4533('0x0'));var rimraf=require(_0x4533('0x1'));var zipdir=require(_0x4533('0x2'));var jsonpatch=require(_0x4533('0x3'));var rp=require(_0x4533('0x4'));var moment=require('moment');var BPromise=require(_0x4533('0x5'));var Mustache=require('mustache');var util=require(_0x4533('0x6'));var path=require(_0x4533('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4533('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4533('0x9'));var deskjs=require(_0x4533('0xa'));var toCsv=require(_0x4533('0xb'));var querystring=require(_0x4533('0xc'));var Papa=require(_0x4533('0xd'));var Redis=require(_0x4533('0xe'));var authService=require(_0x4533('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4533('0x10'));var hardwareService=require(_0x4533('0x11'));var logger=require(_0x4533('0x12'))(_0x4533('0x13'));var utils=require('../../config/utils');var config=require(_0x4533('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4533('0x15'))['db'];config[_0x4533('0x16')]=_[_0x4533('0x17')](config[_0x4533('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4533('0x18'))(new Redis(config[_0x4533('0x16')]));require(_0x4533('0x19'))[_0x4533('0x1a')](socket);function respondWithStatusCode(_0x533a26,_0xe47213){_0xe47213=_0xe47213||0xcc;return function(_0x573d84){if(_0x573d84){return _0x533a26['sendStatus'](_0xe47213);}return _0x533a26[_0x4533('0x1b')](_0xe47213)[_0x4533('0x1c')]();};}function respondWithResult(_0x5da8b8,_0x30c68c){_0x30c68c=_0x30c68c||0xc8;return function(_0x1e6a1a){if(_0x1e6a1a){return _0x5da8b8[_0x4533('0x1b')](_0x30c68c)['json'](_0x1e6a1a);}};}function respondWithFilteredResult(_0x3ed873,_0x4f732e){return function(_0x3ddb36){if(_0x3ddb36){var _0x3d16a2=typeof _0x4f732e['offset']===_0x4533('0x1d')&&typeof _0x4f732e['limit']==='undefined';var _0x1c5cdd=_0x3ddb36[_0x4533('0x1e')];var _0x49fb91=_0x3d16a2?0x0:_0x4f732e['offset'];var _0x1abe1d=_0x3d16a2?_0x3ddb36[_0x4533('0x1e')]:_0x4f732e[_0x4533('0x1f')]+_0x4f732e[_0x4533('0x20')];var _0x6766eb;if(_0x1abe1d>=_0x1c5cdd){_0x1abe1d=_0x1c5cdd;_0x6766eb=0xc8;}else{_0x6766eb=0xce;}_0x3ed873[_0x4533('0x1b')](_0x6766eb);return _0x3ed873[_0x4533('0x21')]('Content-Range',_0x49fb91+'-'+_0x1abe1d+'/'+_0x1c5cdd)[_0x4533('0x22')](_0x3ddb36);}return null;};}function patchUpdates(_0xd55c04){return function(_0x2901f1){try{jsonpatch['apply'](_0x2901f1,_0xd55c04,!![]);}catch(_0x513011){return BPromise[_0x4533('0x23')](_0x513011);}return _0x2901f1[_0x4533('0x24')]();};}function saveUpdates(_0x4c640c,_0x5dcfd2){return function(_0x307bdd){if(_0x307bdd){return _0x307bdd[_0x4533('0x25')](_0x4c640c)[_0x4533('0x26')](function(_0x4d8189){return _0x4d8189;});}return null;};}function removeEntity(_0x44786f,_0x39b261){return function(_0x43eaa8){if(_0x43eaa8){return _0x43eaa8[_0x4533('0x27')]()[_0x4533('0x26')](function(){_0x44786f[_0x4533('0x1b')](0xcc)[_0x4533('0x1c')]();});}};}function handleEntityNotFound(_0x27b653,_0x45ad98){return function(_0x5f16bb){if(!_0x5f16bb){_0x27b653['sendStatus'](0x194);}return _0x5f16bb;};}function handleError(_0xa2e602,_0x5aaf2d){_0x5aaf2d=_0x5aaf2d||0x1f4;return function(_0x3fd76a){logger['error'](_0x3fd76a[_0x4533('0x28')]);if(_0x3fd76a[_0x4533('0x29')]){delete _0x3fd76a[_0x4533('0x29')];}_0xa2e602[_0x4533('0x1b')](_0x5aaf2d)[_0x4533('0x2a')](_0x3fd76a);};}exports[_0x4533('0x2b')]=function(_0xe584a2,_0xa58dd1){var _0x130566={'raw':![],'where':{'id':_0xe584a2[_0x4533('0x2c')]['id']}},_0x43682f={};_0x43682f[_0x4533('0x2d')]=_[_0x4533('0x2e')](db['DashboardItem'][_0x4533('0x2f')]);_0x43682f['query']=_[_0x4533('0x2e')](_0xe584a2[_0x4533('0x30')]);_0x43682f[_0x4533('0x31')]=_[_0x4533('0x32')](_0x43682f[_0x4533('0x2d')],_0x43682f[_0x4533('0x30')]);_0x130566[_0x4533('0x33')]=_[_0x4533('0x32')](_0x43682f[_0x4533('0x2d')],qs[_0x4533('0x34')](_0xe584a2[_0x4533('0x30')][_0x4533('0x34')]));_0x130566['attributes']=_0x130566[_0x4533('0x33')][_0x4533('0x35')]?_0x130566[_0x4533('0x33')]:_0x43682f[_0x4533('0x2d')];if(_0xe584a2[_0x4533('0x30')]['includeAll']){_0x130566[_0x4533('0x36')]=[{'all':!![]}];}_0x130566=_[_0x4533('0x37')]({},_0x130566,_0xe584a2[_0x4533('0x38')]);return db[_0x4533('0x39')][_0x4533('0x3a')](_0x130566)[_0x4533('0x26')](handleEntityNotFound(_0xa58dd1,null))['then'](respondWithResult(_0xa58dd1,null))[_0x4533('0x3b')](handleError(_0xa58dd1,null));};exports[_0x4533('0x27')]=function(_0x5d21f2,_0x3b6f10){return db[_0x4533('0x39')][_0x4533('0x3a')]({'where':{'id':_0x5d21f2[_0x4533('0x2c')]['id']}})[_0x4533('0x26')](handleEntityNotFound(_0x3b6f10,null))[_0x4533('0x26')](removeEntity(_0x3b6f10,null))[_0x4533('0x3b')](handleError(_0x3b6f10,null));};function widgetAttributes(_0x603753){try{switch(_0x603753[_0x4533('0x3c')]){case _0x4533('0x3d'):return[{'name':'attrUrl','value':_0x603753[_0x4533('0x3e')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753[_0x4533('0x3f')][0x0][_0x4533('0x40')]:undefined)||_0x4533('0x41')}];case _0x4533('0x42'):return[{'name':_0x4533('0x43'),'value':_0x603753[_0x4533('0x43')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753[_0x4533('0x3f')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x4533('0x44'),'value':_0x603753['attrHourFormat']||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753[_0x4533('0x3f')][0x0][_0x4533('0x40')]:undefined)||_0x4533('0x45')},{'name':_0x4533('0x46'),'value':_0x603753[_0x4533('0x46')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x1]?_0x603753[_0x4533('0x3f')][0x1][_0x4533('0x40')]:undefined)||_0x4533('0x47')},{'name':_0x4533('0x48'),'value':_0x603753['attrFontSize']||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x2]?_0x603753['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x4533('0x49'),'value':_0x603753[_0x4533('0x49')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753['attrs'][0x0][_0x4533('0x40')]:undefined)||_0x4533('0x4a')},{'name':_0x4533('0x4b'),'value':_0x603753[_0x4533('0x4b')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x1]?_0x603753[_0x4533('0x3f')][0x1]['value']:undefined)||[]},{'name':_0x4533('0x48'),'value':_0x603753['attrFontSize']||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x2]?_0x603753[_0x4533('0x3f')][0x2][_0x4533('0x40')]:undefined)||0x14},{'name':_0x4533('0x4c'),'value':_0x603753['attrChannel']||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x3]?_0x603753['attrs'][0x3][_0x4533('0x40')]:undefined)||_0x4533('0x4d')},{'name':'attrEmailAccounts','value':_0x603753['attrEmailAccounts']||(_0x603753['attrs']&&_0x603753['attrs'][0x4]?_0x603753['attrs'][0x4][_0x4533('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x603753[_0x4533('0x4e')]||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x5]?_0x603753['attrs'][0x5]['value']:undefined)||''},{'name':_0x4533('0x4f'),'value':_0x603753['attrSmsAccounts']||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x6]?_0x603753[_0x4533('0x3f')][0x6][_0x4533('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x603753[_0x4533('0x50')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x7]?_0x603753[_0x4533('0x3f')][0x7][_0x4533('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x603753[_0x4533('0x51')]||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x8]?_0x603753[_0x4533('0x3f')][0x8][_0x4533('0x40')]:undefined)||''},{'name':_0x4533('0x52'),'value':_0x603753[_0x4533('0x52')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x9]?_0x603753[_0x4533('0x3f')][0x9][_0x4533('0x40')]:undefined)||''}];case _0x4533('0x53'):case _0x4533('0x54'):return[{'name':_0x4533('0x55'),'value':_0x603753[_0x4533('0x55')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753[_0x4533('0x3f')][0x0][_0x4533('0x40')]:undefined)||'total'},{'name':_0x4533('0x56'),'value':_0x603753['attrSerie2']||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x1]?_0x603753[_0x4533('0x3f')][0x1][_0x4533('0x40')]:undefined)||null},{'name':_0x4533('0x57'),'value':_0x603753['attrSerie3']||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x2]?_0x603753['attrs'][0x2][_0x4533('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x603753[_0x4533('0x4b')]||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x3]?_0x603753[_0x4533('0x3f')][0x3][_0x4533('0x40')]:undefined)||[]},{'name':_0x4533('0x4c'),'value':_0x603753[_0x4533('0x4c')]||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x4]?_0x603753[_0x4533('0x3f')][0x4][_0x4533('0x40')]:undefined)||'voice'},{'name':_0x4533('0x58'),'value':_0x603753[_0x4533('0x58')]||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x5]?_0x603753[_0x4533('0x3f')][0x5][_0x4533('0x40')]:undefined)||''},{'name':_0x4533('0x4e'),'value':_0x603753[_0x4533('0x4e')]||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x6]?_0x603753['attrs'][0x6]['value']:undefined)||''},{'name':_0x4533('0x4f'),'value':_0x603753[_0x4533('0x4f')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x7]?_0x603753[_0x4533('0x3f')][0x7][_0x4533('0x40')]:undefined)||''},{'name':_0x4533('0x50'),'value':_0x603753[_0x4533('0x50')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x8]?_0x603753[_0x4533('0x3f')][0x8]['value']:undefined)||''},{'name':_0x4533('0x51'),'value':_0x603753['attrWhatsappAccounts']||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x9]?_0x603753[_0x4533('0x3f')][0x9]['value']:undefined)||''},{'name':_0x4533('0x52'),'value':_0x603753[_0x4533('0x52')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0xa]?_0x603753[_0x4533('0x3f')][0xa][_0x4533('0x40')]:undefined)||''}];case _0x4533('0x59'):return[{'name':_0x4533('0x5a'),'type':_0x603753['reportType']||(_0x603753['attrs']&&_0x603753[_0x4533('0x3f')][0x0]?_0x603753[_0x4533('0x3f')][0x0]['type']:undefined)||null,'value':_0x603753[_0x4533('0x5a')]||(_0x603753[_0x4533('0x3f')]&&_0x603753['attrs'][0x0]?_0x603753['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x603753[_0x4533('0x5b')]||(_0x603753[_0x4533('0x3f')]&&_0x603753[_0x4533('0x3f')][0x1]?_0x603753[_0x4533('0x3f')][0x1][_0x4533('0x40')]:undefined)||0x0}];default:return[];}}catch(_0xbf35f7){logger[_0x4533('0x5c')](_0x4533('0x5d'),JSON['stringify'](_0xbf35f7));return[];}}exports[_0x4533('0x5e')]=function(_0x1bd2da,_0x1b0414){if(_0x1bd2da[_0x4533('0x5f')]){_0x1bd2da['body']['attrs']=widgetAttributes(_0x1bd2da['body']);}return db[_0x4533('0x39')]['create'](_0x1bd2da[_0x4533('0x5f')],{})[_0x4533('0x26')](respondWithResult(_0x1b0414,0xc9))[_0x4533('0x3b')](handleError(_0x1b0414,null));};exports['update']=function(_0x31b10f,_0x50497f){if(_0x31b10f[_0x4533('0x5f')]['id']){delete _0x31b10f['body']['id'];}_0x31b10f[_0x4533('0x5f')][_0x4533('0x3f')]=widgetAttributes(_0x31b10f[_0x4533('0x5f')]);return db[_0x4533('0x39')][_0x4533('0x3a')]({'where':{'id':_0x31b10f['params']['id']}})[_0x4533('0x26')](handleEntityNotFound(_0x50497f,null))['then'](saveUpdates(_0x31b10f[_0x4533('0x5f')],null))[_0x4533('0x26')](respondWithResult(_0x50497f,null))['catch'](handleError(_0x50497f,null));}; \ No newline at end of file +var _0xb4c7=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','DashboardItem','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','merge','options','find','catch','params','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2c35b6,_0x563ea8){_0x2c35b6=_0x2c35b6-0x0;var _0x3bd3e9=_0xb4c7[_0x2c35b6];return _0x3bd3e9;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];config[_0x7b4c('0x1b')]=_[_0x7b4c('0x1c')](config[_0x7b4c('0x1b')],{'host':_0x7b4c('0x1d'),'port':0x18eb});var socket=require(_0x7b4c('0x1e'))(new Redis(config[_0x7b4c('0x1b')]));require(_0x7b4c('0x1f'))[_0x7b4c('0x20')](socket);function respondWithStatusCode(_0x593a19,_0x2edb77){_0x2edb77=_0x2edb77||0xcc;return function(_0x3d8362){if(_0x3d8362){return _0x593a19[_0x7b4c('0x21')](_0x2edb77);}return _0x593a19[_0x7b4c('0x22')](_0x2edb77)[_0x7b4c('0x23')]();};}function respondWithResult(_0x2471b3,_0x1642e1){_0x1642e1=_0x1642e1||0xc8;return function(_0x22c409){if(_0x22c409){return _0x2471b3['status'](_0x1642e1)[_0x7b4c('0x24')](_0x22c409);}};}function respondWithFilteredResult(_0xe71d88,_0x15a5a9){return function(_0x36c02a){if(_0x36c02a){var _0x59ae96=typeof _0x15a5a9[_0x7b4c('0x25')]===_0x7b4c('0x26')&&typeof _0x15a5a9[_0x7b4c('0x27')]===_0x7b4c('0x26');var _0x2d4c72=_0x36c02a[_0x7b4c('0x28')];var _0x237110=_0x59ae96?0x0:_0x15a5a9[_0x7b4c('0x25')];var _0x3556d8=_0x59ae96?_0x36c02a['count']:_0x15a5a9[_0x7b4c('0x25')]+_0x15a5a9[_0x7b4c('0x27')];var _0x11996d;if(_0x3556d8>=_0x2d4c72){_0x3556d8=_0x2d4c72;_0x11996d=0xc8;}else{_0x11996d=0xce;}_0xe71d88[_0x7b4c('0x22')](_0x11996d);return _0xe71d88[_0x7b4c('0x29')](_0x7b4c('0x2a'),_0x237110+'-'+_0x3556d8+'/'+_0x2d4c72)[_0x7b4c('0x24')](_0x36c02a);}return null;};}function patchUpdates(_0x3d4826){return function(_0x2ab9e1){try{jsonpatch[_0x7b4c('0x2b')](_0x2ab9e1,_0x3d4826,!![]);}catch(_0x5eec1e){return BPromise[_0x7b4c('0x2c')](_0x5eec1e);}return _0x2ab9e1[_0x7b4c('0x2d')]();};}function saveUpdates(_0x276271,_0x3157b8){return function(_0x3124e7){if(_0x3124e7){return _0x3124e7[_0x7b4c('0x2e')](_0x276271)[_0x7b4c('0x2f')](function(_0x459eb4){return _0x459eb4;});}return null;};}function removeEntity(_0x1f311e,_0x1a69db){return function(_0x264568){if(_0x264568){return _0x264568[_0x7b4c('0x30')]()[_0x7b4c('0x2f')](function(){_0x1f311e['status'](0xcc)[_0x7b4c('0x23')]();});}};}function handleEntityNotFound(_0x3ab614,_0x1fe0f5){return function(_0x3671c4){if(!_0x3671c4){_0x3ab614[_0x7b4c('0x21')](0x194);}return _0x3671c4;};}function handleError(_0x4ce02c,_0x1de2b1){_0x1de2b1=_0x1de2b1||0x1f4;return function(_0x2552f9){logger[_0x7b4c('0x31')](_0x2552f9[_0x7b4c('0x32')]);if(_0x2552f9[_0x7b4c('0x33')]){delete _0x2552f9[_0x7b4c('0x33')];}_0x4ce02c[_0x7b4c('0x22')](_0x1de2b1)[_0x7b4c('0x34')](_0x2552f9);};}exports[_0x7b4c('0x35')]=function(_0x3e5bdd,_0x1d0724){var _0xce5781={'raw':![],'where':{'id':_0x3e5bdd['params']['id']}},_0x9d3d31={};_0x9d3d31['model']=_['keys'](db[_0x7b4c('0x36')][_0x7b4c('0x37')]);_0x9d3d31[_0x7b4c('0x38')]=_[_0x7b4c('0x39')](_0x3e5bdd['query']);_0x9d3d31[_0x7b4c('0x3a')]=_[_0x7b4c('0x3b')](_0x9d3d31['model'],_0x9d3d31[_0x7b4c('0x38')]);_0xce5781['attributes']=_[_0x7b4c('0x3b')](_0x9d3d31[_0x7b4c('0x3c')],qs[_0x7b4c('0x3d')](_0x3e5bdd['query'][_0x7b4c('0x3d')]));_0xce5781[_0x7b4c('0x3e')]=_0xce5781['attributes'][_0x7b4c('0x3f')]?_0xce5781[_0x7b4c('0x3e')]:_0x9d3d31[_0x7b4c('0x3c')];if(_0x3e5bdd[_0x7b4c('0x38')]['includeAll']){_0xce5781['include']=[{'all':!![]}];}_0xce5781=_[_0x7b4c('0x40')]({},_0xce5781,_0x3e5bdd[_0x7b4c('0x41')]);return db['DashboardItem'][_0x7b4c('0x42')](_0xce5781)['then'](handleEntityNotFound(_0x1d0724,null))['then'](respondWithResult(_0x1d0724,null))[_0x7b4c('0x43')](handleError(_0x1d0724,null));};exports[_0x7b4c('0x30')]=function(_0x39d69a,_0x250901){return db['DashboardItem'][_0x7b4c('0x42')]({'where':{'id':_0x39d69a[_0x7b4c('0x44')]['id']}})[_0x7b4c('0x2f')](handleEntityNotFound(_0x250901,null))[_0x7b4c('0x2f')](removeEntity(_0x250901,null))[_0x7b4c('0x43')](handleError(_0x250901,null));};function widgetAttributes(_0xddd16){try{switch(_0xddd16[_0x7b4c('0x45')]){case'iframe':return[{'name':'attrUrl','value':_0xddd16[_0x7b4c('0x46')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16[_0x7b4c('0x47')][0x0][_0x7b4c('0x48')]:undefined)||'https://'}];case _0x7b4c('0x49'):return[{'name':_0x7b4c('0x4a'),'value':_0xddd16[_0x7b4c('0x4a')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16[_0x7b4c('0x47')][0x0][_0x7b4c('0x48')]:undefined)||''}];case _0x7b4c('0x4b'):return[{'name':_0x7b4c('0x4c'),'value':_0xddd16['attrHourFormat']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16['attrs'][0x0]?_0xddd16[_0x7b4c('0x47')][0x0]['value']:undefined)||_0x7b4c('0x4d')},{'name':_0x7b4c('0x4e'),'value':_0xddd16['attrTimezone']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x1]?_0xddd16[_0x7b4c('0x47')][0x1][_0x7b4c('0x48')]:undefined)||_0x7b4c('0x4f')},{'name':'attrFontSize','value':_0xddd16[_0x7b4c('0x50')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x2]?_0xddd16['attrs'][0x2][_0x7b4c('0x48')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0xddd16[_0x7b4c('0x51')]||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16[_0x7b4c('0x47')][0x0][_0x7b4c('0x48')]:undefined)||_0x7b4c('0x52')},{'name':_0x7b4c('0x53'),'value':_0xddd16[_0x7b4c('0x53')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x1]?_0xddd16[_0x7b4c('0x47')][0x1]['value']:undefined)||[]},{'name':_0x7b4c('0x50'),'value':_0xddd16['attrFontSize']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x2]?_0xddd16[_0x7b4c('0x47')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0xddd16[_0x7b4c('0x54')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x3]?_0xddd16[_0x7b4c('0x47')][0x3][_0x7b4c('0x48')]:undefined)||_0x7b4c('0x55')},{'name':_0x7b4c('0x56'),'value':_0xddd16[_0x7b4c('0x56')]||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x4]?_0xddd16[_0x7b4c('0x47')][0x4][_0x7b4c('0x48')]:undefined)||''},{'name':_0x7b4c('0x57'),'value':_0xddd16[_0x7b4c('0x57')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x5]?_0xddd16[_0x7b4c('0x47')][0x5][_0x7b4c('0x48')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xddd16['attrSmsAccounts']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x6]?_0xddd16[_0x7b4c('0x47')][0x6]['value']:undefined)||''},{'name':_0x7b4c('0x58'),'value':_0xddd16[_0x7b4c('0x58')]||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x7]?_0xddd16['attrs'][0x7][_0x7b4c('0x48')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xddd16[_0x7b4c('0x59')]||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x8]?_0xddd16[_0x7b4c('0x47')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0xddd16[_0x7b4c('0x5a')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x9]?_0xddd16['attrs'][0x9]['value']:undefined)||''}];case _0x7b4c('0x5b'):case _0x7b4c('0x5c'):return[{'name':'attrSerie1','value':_0xddd16['attrSerie1']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16[_0x7b4c('0x47')][0x0]['value']:undefined)||_0x7b4c('0x52')},{'name':_0x7b4c('0x5d'),'value':_0xddd16['attrSerie2']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x1]?_0xddd16['attrs'][0x1]['value']:undefined)||null},{'name':_0x7b4c('0x5e'),'value':_0xddd16['attrSerie3']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x2]?_0xddd16[_0x7b4c('0x47')][0x2][_0x7b4c('0x48')]:undefined)||null},{'name':_0x7b4c('0x53'),'value':_0xddd16['attrVoiceQueues']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x3]?_0xddd16[_0x7b4c('0x47')][0x3][_0x7b4c('0x48')]:undefined)||[]},{'name':'attrChannel','value':_0xddd16[_0x7b4c('0x54')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x4]?_0xddd16['attrs'][0x4][_0x7b4c('0x48')]:undefined)||_0x7b4c('0x55')},{'name':'attrEmailAccounts','value':_0xddd16[_0x7b4c('0x56')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x5]?_0xddd16[_0x7b4c('0x47')][0x5][_0x7b4c('0x48')]:undefined)||''},{'name':_0x7b4c('0x57'),'value':_0xddd16[_0x7b4c('0x57')]||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x6]?_0xddd16[_0x7b4c('0x47')][0x6]['value']:undefined)||''},{'name':_0x7b4c('0x5f'),'value':_0xddd16[_0x7b4c('0x5f')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x7]?_0xddd16['attrs'][0x7][_0x7b4c('0x48')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xddd16['attrOpenchannelAccounts']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x8]?_0xddd16[_0x7b4c('0x47')][0x8][_0x7b4c('0x48')]:undefined)||''},{'name':_0x7b4c('0x59'),'value':_0xddd16['attrWhatsappAccounts']||(_0xddd16['attrs']&&_0xddd16[_0x7b4c('0x47')][0x9]?_0xddd16[_0x7b4c('0x47')][0x9][_0x7b4c('0x48')]:undefined)||''},{'name':'attrChatWebsites','value':_0xddd16[_0x7b4c('0x5a')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0xa]?_0xddd16['attrs'][0xa][_0x7b4c('0x48')]:undefined)||''}];case _0x7b4c('0x60'):return[{'name':_0x7b4c('0x61'),'type':_0xddd16['reportType']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16['attrs'][0x0][_0x7b4c('0x45')]:undefined)||null,'value':_0xddd16['attrReport']||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x0]?_0xddd16[_0x7b4c('0x47')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0xddd16[_0x7b4c('0x62')]||(_0xddd16[_0x7b4c('0x47')]&&_0xddd16[_0x7b4c('0x47')][0x1]?_0xddd16['attrs'][0x1][_0x7b4c('0x48')]:undefined)||0x0}];default:return[];}}catch(_0x49b068){logger[_0x7b4c('0x31')](_0x7b4c('0x63'),JSON[_0x7b4c('0x64')](_0x49b068));return[];}}exports[_0x7b4c('0x65')]=function(_0x39fa6c,_0x57c52b){if(_0x39fa6c[_0x7b4c('0x66')]){_0x39fa6c[_0x7b4c('0x66')]['attrs']=widgetAttributes(_0x39fa6c[_0x7b4c('0x66')]);}return db[_0x7b4c('0x36')][_0x7b4c('0x65')](_0x39fa6c[_0x7b4c('0x66')],{})[_0x7b4c('0x2f')](respondWithResult(_0x57c52b,0xc9))[_0x7b4c('0x43')](handleError(_0x57c52b,null));};exports[_0x7b4c('0x2e')]=function(_0x21082b,_0x51d004){if(_0x21082b[_0x7b4c('0x66')]['id']){delete _0x21082b[_0x7b4c('0x66')]['id'];}_0x21082b[_0x7b4c('0x66')][_0x7b4c('0x47')]=widgetAttributes(_0x21082b[_0x7b4c('0x66')]);return db[_0x7b4c('0x36')][_0x7b4c('0x42')]({'where':{'id':_0x21082b[_0x7b4c('0x44')]['id']}})[_0x7b4c('0x2f')](handleEntityNotFound(_0x51d004,null))[_0x7b4c('0x2f')](saveUpdates(_0x21082b[_0x7b4c('0x66')],null))[_0x7b4c('0x2f')](respondWithResult(_0x51d004,null))[_0x7b4c('0x43')](handleError(_0x51d004,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 03ea5b3..e1c0e3c 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 _0x69d9=['events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x69d9,0x120));var _0x969d=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x69d9[_0x919445];return _0x511b3e;};'use strict';var EventEmitter=require(_0x969d('0x0'));var DashboardItem=require(_0x969d('0x1'))['db'][_0x969d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x969d('0x3')](0x0);var events={'afterCreate':_0x969d('0x4'),'afterUpdate':'update','afterDestroy':_0x969d('0x5')};function emitEvent(_0xf08f6c){return function(_0x36a15c,_0x5ba932,_0x4af266){DashboardItemEvents[_0x969d('0x6')](_0xf08f6c+':'+_0x36a15c['id'],_0x36a15c);DashboardItemEvents[_0x969d('0x6')](_0xf08f6c,_0x36a15c);_0x4af266(null);};}for(var e in events){if(events[_0x969d('0x7')](e)){var event=events[e];DashboardItem[_0x969d('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xd54d=['remove','emit','hasOwnProperty','hook','exports','DashboardItem','update'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xd54d,0x6e));var _0xdd54=function(_0x59c9b7,_0x598387){_0x59c9b7=_0x59c9b7-0x0;var _0x517a20=_0xd54d[_0x59c9b7];return _0x517a20;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xdd54('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd54('0x1'),'afterDestroy':_0xdd54('0x2')};function emitEvent(_0x573beb){return function(_0x3a9be7,_0x52352e,_0xfb59c){DashboardItemEvents[_0xdd54('0x3')](_0x573beb+':'+_0x3a9be7['id'],_0x3a9be7);DashboardItemEvents[_0xdd54('0x3')](_0x573beb,_0x3a9be7);_0xfb59c(null);};}for(var e in events){if(events[_0xdd54('0x4')](e)){var event=events[e];DashboardItem[_0xdd54('0x5')](e,emitEvent(event));}}module[_0xdd54('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ccb4e48..5eea88f 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 _0x27f6=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x5473fb,_0xed1069){var _0x4f4e6a=function(_0x47ee32){while(--_0x47ee32){_0x5473fb['push'](_0x5473fb['shift']());}};_0x4f4e6a(++_0xed1069);}(_0x27f6,0x170));var _0x627f=function(_0x364d4e,_0x47cb7d){_0x364d4e=_0x364d4e-0x0;var _0x51ade2=_0x27f6[_0x364d4e];return _0x51ade2;};'use strict';var _=require('lodash');var util=require(_0x627f('0x0'));var logger=require(_0x627f('0x1'))('api');var moment=require(_0x627f('0x2'));var BPromise=require(_0x627f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x627f('0x4'));var rimraf=require(_0x627f('0x5'));var config=require(_0x627f('0x6'));var attributes=require(_0x627f('0x7'));module[_0x627f('0x8')]=function(_0x180513,_0x250ddf){return _0x180513[_0x627f('0x9')](_0x627f('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44d5=['define','DashboardItem','dashboard_items','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x5652dc,_0x43b35d){var _0x702a56=function(_0x2927f5){while(--_0x2927f5){_0x5652dc['push'](_0x5652dc['shift']());}};_0x702a56(++_0x43b35d);}(_0x44d5,0x1a5));var _0x544d=function(_0x4c8540,_0x1243ae){_0x4c8540=_0x4c8540-0x0;var _0x32f264=_0x44d5[_0x4c8540];return _0x32f264;};'use strict';var _=require(_0x544d('0x0'));var util=require(_0x544d('0x1'));var logger=require('../../config/logger')(_0x544d('0x2'));var moment=require('moment');var BPromise=require(_0x544d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x544d('0x4'));var rimraf=require(_0x544d('0x5'));var config=require(_0x544d('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x544d('0x7')]=function(_0x5cc55a,_0x30b6cb){return _0x5cc55a[_0x544d('0x8')](_0x544d('0x9'),attributes,{'tableName':_0x544d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 1e7a3e6..f8e7135 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 _0xdddf=['request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x5aa373,_0x54c7f4){var _0x590e8e=function(_0x505e62){while(--_0x505e62){_0x5aa373['push'](_0x5aa373['shift']());}};_0x590e8e(++_0x54c7f4);}(_0xdddf,0x10d));var _0xfddd=function(_0x59f58c,_0x6a6330){_0x59f58c=_0x59f58c-0x0;var _0x56b89c=_0xdddf[_0x59f58c];return _0x56b89c;};'use strict';var _=require('lodash');var util=require(_0xfddd('0x0'));var moment=require(_0xfddd('0x1'));var BPromise=require(_0xfddd('0x2'));var rs=require(_0xfddd('0x3'));var fs=require('fs');var Redis=require(_0xfddd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfddd('0x5'));var logger=require(_0xfddd('0x6'))(_0xfddd('0x7'));var config=require('../../config/environment');var jayson=require(_0xfddd('0x8'));var client=jayson[_0xfddd('0x9')][_0xfddd('0xa')]({'port':0x232a});config[_0xfddd('0xb')]=_[_0xfddd('0xc')](config[_0xfddd('0xb')],{'host':_0xfddd('0xd'),'port':0x18eb});var socket=require(_0xfddd('0xe'))(new Redis(config['redis']));require(_0xfddd('0xf'))[_0xfddd('0x10')](socket);function respondWithRpcPromise(_0x5a8eb2,_0x104533,_0x4cdb81){return new BPromise(function(_0x2a1fd9,_0x5c3033){return client[_0xfddd('0x11')](_0x5a8eb2,_0x4cdb81)[_0xfddd('0x12')](function(_0x421bfd){logger[_0xfddd('0x13')](_0xfddd('0x14'),_0x104533,_0xfddd('0x15'));logger[_0xfddd('0x16')](_0xfddd('0x17'),_0x104533,_0xfddd('0x15'),JSON[_0xfddd('0x18')](_0x421bfd));if(_0x421bfd[_0xfddd('0x19')]){if(_0x421bfd[_0xfddd('0x19')][_0xfddd('0x1a')]===0x1f4){logger[_0xfddd('0x19')](_0xfddd('0x14'),_0x104533,_0x421bfd[_0xfddd('0x19')][_0xfddd('0x1b')]);return _0x5c3033(_0x421bfd[_0xfddd('0x19')]['message']);}logger[_0xfddd('0x19')]('DashboardItem,\x20%s,\x20%s',_0x104533,_0x421bfd['error'][_0xfddd('0x1b')]);return _0x2a1fd9(_0x421bfd[_0xfddd('0x19')][_0xfddd('0x1b')]);}else{logger[_0xfddd('0x13')](_0xfddd('0x14'),_0x104533,_0xfddd('0x15'));_0x2a1fd9(_0x421bfd['result'][_0xfddd('0x1b')]);}})[_0xfddd('0x1c')](function(_0x3bff43){logger['error'](_0xfddd('0x14'),_0x104533,_0x3bff43);_0x5c3033(_0x3bff43);});});} \ No newline at end of file +var _0xf8e2=['moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf8e2,0x17f));var _0x2f8e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf8e2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x2f8e('0x0'));var moment=require(_0x2f8e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2f8e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f8e('0x3'))(_0x2f8e('0x4'));var config=require(_0x2f8e('0x5'));var jayson=require(_0x2f8e('0x6'));var client=jayson[_0x2f8e('0x7')][_0x2f8e('0x8')]({'port':0x232a});config[_0x2f8e('0x9')]=_[_0x2f8e('0xa')](config[_0x2f8e('0x9')],{'host':_0x2f8e('0xb'),'port':0x18eb});var socket=require(_0x2f8e('0xc'))(new Redis(config[_0x2f8e('0x9')]));require(_0x2f8e('0xd'))[_0x2f8e('0xe')](socket);function respondWithRpcPromise(_0x557c1e,_0x270e27,_0xbde3f5){return new BPromise(function(_0x577a27,_0x4e9b17){return client[_0x2f8e('0xf')](_0x557c1e,_0xbde3f5)['then'](function(_0x51276e){logger['info'](_0x2f8e('0x10'),_0x270e27,_0x2f8e('0x11'));logger[_0x2f8e('0x12')](_0x2f8e('0x13'),_0x270e27,'request\x20sent',JSON['stringify'](_0x51276e));if(_0x51276e[_0x2f8e('0x14')]){if(_0x51276e[_0x2f8e('0x14')]['code']===0x1f4){logger[_0x2f8e('0x14')](_0x2f8e('0x10'),_0x270e27,_0x51276e[_0x2f8e('0x14')][_0x2f8e('0x15')]);return _0x4e9b17(_0x51276e[_0x2f8e('0x14')][_0x2f8e('0x15')]);}logger[_0x2f8e('0x14')](_0x2f8e('0x10'),_0x270e27,_0x51276e[_0x2f8e('0x14')][_0x2f8e('0x15')]);return _0x577a27(_0x51276e[_0x2f8e('0x14')][_0x2f8e('0x15')]);}else{logger['info'](_0x2f8e('0x10'),_0x270e27,_0x2f8e('0x11'));_0x577a27(_0x51276e[_0x2f8e('0x16')][_0x2f8e('0x15')]);}})[_0x2f8e('0x17')](function(_0x476204){logger[_0x2f8e('0x14')]('DashboardItem,\x20%s,\x20%s',_0x270e27,_0x476204);_0x4e9b17(_0x476204);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3f03d79..7219519 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 _0x1a1f=['remove','update','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a1f,0xf4));var _0xf1a1=function(_0x1ee45a,_0x5c1772){_0x1ee45a=_0x1ee45a-0x0;var _0x20a630=_0x1a1f[_0x1ee45a];return _0x20a630;};'use strict';var DashboardItemEvents=require(_0xf1a1('0x0'));var events=['save',_0xf1a1('0x1'),_0xf1a1('0x2')];function createListener(_0x12e8d5,_0x19dea6){return function(_0x3e1a21){_0x19dea6['emit'](_0x12e8d5,_0x3e1a21);};}function removeListener(_0x17294f,_0x2c20e6){return function(){DashboardItemEvents[_0xf1a1('0x3')](_0x17294f,_0x2c20e6);};}exports[_0xf1a1('0x4')]=function(_0x40993e){for(var _0x3afe35=0x0,_0x3e67ba=events[_0xf1a1('0x5')];_0x3afe35<_0x3e67ba;_0x3afe35++){var _0x190016=events[_0x3afe35];var _0x42b99c=createListener(_0xf1a1('0x6')+_0x190016,_0x40993e);DashboardItemEvents['on'](_0x190016,_0x42b99c);}}; \ No newline at end of file +var _0x7d11=['remove','update','removeListener','register','dashboardItem:','./dashboardItem.events','save'];(function(_0x1a8c55,_0x28a2ac){var _0x47a0cb=function(_0x46b178){while(--_0x46b178){_0x1a8c55['push'](_0x1a8c55['shift']());}};_0x47a0cb(++_0x28a2ac);}(_0x7d11,0x91));var _0x17d1=function(_0x11c3e0,_0x182cb9){_0x11c3e0=_0x11c3e0-0x0;var _0x251db1=_0x7d11[_0x11c3e0];return _0x251db1;};'use strict';var DashboardItemEvents=require(_0x17d1('0x0'));var events=[_0x17d1('0x1'),_0x17d1('0x2'),_0x17d1('0x3')];function createListener(_0x352623,_0x24464d){return function(_0xd8fcc9){_0x24464d['emit'](_0x352623,_0xd8fcc9);};}function removeListener(_0x2ab61e,_0x480640){return function(){DashboardItemEvents[_0x17d1('0x4')](_0x2ab61e,_0x480640);};}exports[_0x17d1('0x5')]=function(_0x76d763){for(var _0x16ab44=0x0,_0x2b1ce1=events['length'];_0x16ab44<_0x2b1ce1;_0x16ab44++){var _0x46c41f=events[_0x16ab44];var _0x1e66e1=createListener(_0x17d1('0x6')+_0x46c41f,_0x76d763);DashboardItemEvents['on'](_0x46c41f,_0x1e66e1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1709af0..c5b8373 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 _0xe9d2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','create','destroy','exports','connect-timeout','express'];(function(_0x3dc7b6,_0x46ef61){var _0x12b8d7=function(_0x30489e){while(--_0x30489e){_0x3dc7b6['push'](_0x3dc7b6['shift']());}};_0x12b8d7(++_0x46ef61);}(_0xe9d2,0x191));var _0x2e9d=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xe9d2[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2e9d('0x0'));var express=require(_0x2e9d('0x1'));var router=express[_0x2e9d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2e9d('0x3'));var interaction=require(_0x2e9d('0x4'));var config=require(_0x2e9d('0x5'));var controller=require('./dashboardItem.controller');router['get'](_0x2e9d('0x6'),auth[_0x2e9d('0x7')](),controller[_0x2e9d('0x8')]);router[_0x2e9d('0x9')]('/',auth['isAuthenticated'](),controller[_0x2e9d('0xa')]);router['put'](_0x2e9d('0x6'),auth[_0x2e9d('0x7')](),controller['update']);router['delete']('/:id',auth[_0x2e9d('0x7')](),controller[_0x2e9d('0xb')]);module[_0x2e9d('0xc')]=router; \ No newline at end of file +var _0xd404=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xd404,0x1df));var _0x4d40=function(_0x329470,_0x40e736){_0x329470=_0x329470-0x0;var _0x3ebbb4=_0xd404[_0x329470];return _0x3ebbb4;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require(_0x4d40('0x2'));var timeout=require(_0x4d40('0x3'));var express=require('express');var router=express[_0x4d40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require('../../config/environment');var controller=require(_0x4d40('0x7'));router['get'](_0x4d40('0x8'),auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0xb')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xc')]);router['put'](_0x4d40('0x8'),auth[_0x4d40('0x9')](),controller['update']);router[_0x4d40('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4d40('0xe')]);module[_0x4d40('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 7ba9bb4..2da6337 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 _0x5bf1=['STRING','sequelize','exports','ENUM','second','third'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x5bf1,0xa9));var _0x15bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5bf1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x15bf('0x0'));module[_0x15bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x15bf('0x2')]('first',_0x15bf('0x3'),_0x15bf('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x15bf('0x5')]}}; \ No newline at end of file +var _0xf55f=['exports','ENUM','first','second','STRING','sequelize'];(function(_0x249f5c,_0x29f012){var _0x4af0d2=function(_0x3e956a){while(--_0x3e956a){_0x249f5c['push'](_0x249f5c['shift']());}};_0x4af0d2(++_0x29f012);}(_0xf55f,0x1cd));var _0xff55=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0xf55f[_0x2d3a4d];return _0x3a94a3;};'use strict';var Sequelize=require(_0xff55('0x0'));module[_0xff55('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xff55('0x2')](_0xff55('0x3'),_0xff55('0x4'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xff55('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e15f9e5..b755ebc 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 _0x4f80=['destroy','then','get','Dispositions','UserProfileResource','end','name','send','index','map','Disposition','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x4f80,0xcb));var _0x04f8=function(_0x3c5fec,_0x4fecdf){_0x3c5fec=_0x3c5fec-0x0;var _0x47eafa=_0x4f80[_0x3c5fec];return _0x47eafa;};'use strict';var emlformat=require(_0x04f8('0x0'));var rimraf=require(_0x04f8('0x1'));var zipdir=require(_0x04f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04f8('0x3'));var moment=require(_0x04f8('0x4'));var BPromise=require(_0x04f8('0x5'));var Mustache=require(_0x04f8('0x6'));var util=require(_0x04f8('0x7'));var path=require(_0x04f8('0x8'));var sox=require('sox');var csv=require(_0x04f8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04f8('0xa'));var squel=require('squel');var crypto=require(_0x04f8('0xb'));var jsforce=require(_0x04f8('0xc'));var deskjs=require(_0x04f8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04f8('0xe'));var Redis=require(_0x04f8('0xf'));var authService=require(_0x04f8('0x10'));var qs=require(_0x04f8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04f8('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x04f8('0x13'));var config=require(_0x04f8('0x14'));var licenseUtil=require(_0x04f8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ecaa9,_0x3bb767){_0x3bb767=_0x3bb767||0xcc;return function(_0x227442){if(_0x227442){return _0x5ecaa9[_0x04f8('0x16')](_0x3bb767);}return _0x5ecaa9[_0x04f8('0x17')](_0x3bb767)['end']();};}function respondWithResult(_0x19f1d2,_0x2e994c){_0x2e994c=_0x2e994c||0xc8;return function(_0x631325){if(_0x631325){return _0x19f1d2[_0x04f8('0x17')](_0x2e994c)[_0x04f8('0x18')](_0x631325);}};}function respondWithFilteredResult(_0xb9dbdd,_0x27c2c1){return function(_0x304e76){if(_0x304e76){var _0x3809d0=typeof _0x27c2c1[_0x04f8('0x19')]===_0x04f8('0x1a')&&typeof _0x27c2c1[_0x04f8('0x1b')]===_0x04f8('0x1a');var _0x3d75bd=_0x304e76[_0x04f8('0x1c')];var _0x1cd7c6=_0x3809d0?0x0:_0x27c2c1['offset'];var _0x3a10d1=_0x3809d0?_0x304e76[_0x04f8('0x1c')]:_0x27c2c1[_0x04f8('0x19')]+_0x27c2c1[_0x04f8('0x1b')];var _0x421a8c;if(_0x3a10d1>=_0x3d75bd){_0x3a10d1=_0x3d75bd;_0x421a8c=0xc8;}else{_0x421a8c=0xce;}_0xb9dbdd['status'](_0x421a8c);return _0xb9dbdd[_0x04f8('0x1d')](_0x04f8('0x1e'),_0x1cd7c6+'-'+_0x3a10d1+'/'+_0x3d75bd)['json'](_0x304e76);}return null;};}function patchUpdates(_0x50bc5e){return function(_0x22bd46){try{jsonpatch[_0x04f8('0x1f')](_0x22bd46,_0x50bc5e,!![]);}catch(_0xe02074){return BPromise['reject'](_0xe02074);}return _0x22bd46[_0x04f8('0x20')]();};}function saveUpdates(_0xb7477b,_0x3cebfe){return function(_0x1ef3cc){if(_0x1ef3cc){return _0x1ef3cc[_0x04f8('0x21')](_0xb7477b)['then'](function(_0x29d6c4){return _0x29d6c4;});}return null;};}function removeEntity(_0x38e678,_0x59cbec){return function(_0x3edd6f){if(_0x3edd6f){return _0x3edd6f[_0x04f8('0x22')]()[_0x04f8('0x23')](function(){var _0x401a57=_0x3edd6f[_0x04f8('0x24')]({'plain':!![]});var _0x7d8616=_0x04f8('0x25');return db[_0x04f8('0x26')]['destroy']({'where':{'type':_0x7d8616,'resourceId':_0x401a57['id']}})[_0x04f8('0x23')](function(){return _0x3edd6f;});})[_0x04f8('0x23')](function(){_0x38e678[_0x04f8('0x17')](0xcc)[_0x04f8('0x27')]();});}};}function handleEntityNotFound(_0x16eea1,_0x5a8c66){return function(_0x53ebe2){if(!_0x53ebe2){_0x16eea1['sendStatus'](0x194);}return _0x53ebe2;};}function handleError(_0x526c05,_0x24533e){_0x24533e=_0x24533e||0x1f4;return function(_0x21c7c2){logger['error'](_0x21c7c2['stack']);if(_0x21c7c2[_0x04f8('0x28')]){delete _0x21c7c2[_0x04f8('0x28')];}_0x526c05[_0x04f8('0x17')](_0x24533e)[_0x04f8('0x29')](_0x21c7c2);};}exports[_0x04f8('0x2a')]=function(_0x272166,_0x3876a2){var _0x12f706={},_0x5cb637={},_0x59e7d7={'count':0x0,'rows':[]};var _0x2e507d=_[_0x04f8('0x2b')](db[_0x04f8('0x2c')]['rawAttributes'],function(_0x16c88e){return{'name':_0x16c88e['fieldName'],'type':_0x16c88e[_0x04f8('0x2d')][_0x04f8('0x2e')]};});_0x5cb637['model']=_[_0x04f8('0x2b')](_0x2e507d,_0x04f8('0x28'));_0x5cb637['query']=_[_0x04f8('0x2f')](_0x272166[_0x04f8('0x30')]);_0x5cb637[_0x04f8('0x31')]=_['intersection'](_0x5cb637[_0x04f8('0x32')],_0x5cb637[_0x04f8('0x30')]);_0x12f706[_0x04f8('0x33')]=_[_0x04f8('0x34')](_0x5cb637[_0x04f8('0x32')],qs[_0x04f8('0x35')](_0x272166[_0x04f8('0x30')][_0x04f8('0x35')]));_0x12f706[_0x04f8('0x33')]=_0x12f706[_0x04f8('0x33')][_0x04f8('0x36')]?_0x12f706[_0x04f8('0x33')]:_0x5cb637['model'];if(!_0x272166['query'][_0x04f8('0x37')](_0x04f8('0x38'))){_0x12f706[_0x04f8('0x1b')]=qs[_0x04f8('0x1b')](_0x272166[_0x04f8('0x30')][_0x04f8('0x1b')]);_0x12f706['offset']=qs['offset'](_0x272166['query']['offset']);}_0x12f706[_0x04f8('0x39')]=qs[_0x04f8('0x3a')](_0x272166[_0x04f8('0x30')][_0x04f8('0x3a')]);_0x12f706[_0x04f8('0x3b')]=qs[_0x04f8('0x31')](_[_0x04f8('0x3c')](_0x272166['query'],_0x5cb637[_0x04f8('0x31')]),_0x2e507d);if(_0x272166[_0x04f8('0x30')]['filter']){_0x12f706[_0x04f8('0x3b')]=_['merge'](_0x12f706['where'],{'$or':_[_0x04f8('0x2b')](_0x2e507d,function(_0x361746){if(_0x361746[_0x04f8('0x2d')]!==_0x04f8('0x3d')){var _0x292c1e={};_0x292c1e[_0x361746[_0x04f8('0x28')]]={'$like':'%'+_0x272166[_0x04f8('0x30')][_0x04f8('0x3e')]+'%'};return _0x292c1e;}})});}_0x12f706=_['merge']({},_0x12f706,_0x272166['options']);var _0x54d332={'where':_0x12f706[_0x04f8('0x3b')]};return db[_0x04f8('0x2c')][_0x04f8('0x1c')](_0x54d332)[_0x04f8('0x23')](function(_0x3d2783){_0x59e7d7['count']=_0x3d2783;if(_0x272166[_0x04f8('0x30')][_0x04f8('0x3f')]){_0x12f706['include']=[{'all':!![]}];}return db[_0x04f8('0x2c')][_0x04f8('0x40')](_0x12f706);})['then'](function(_0x1a29bf){_0x59e7d7[_0x04f8('0x41')]=_0x1a29bf;return _0x59e7d7;})[_0x04f8('0x23')](respondWithFilteredResult(_0x3876a2,_0x12f706))[_0x04f8('0x42')](handleError(_0x3876a2,null));};exports[_0x04f8('0x43')]=function(_0x336e4f,_0x245071){var _0x5e8d7d={'raw':!![],'where':{'id':_0x336e4f[_0x04f8('0x44')]['id']}},_0x2464bd={};_0x2464bd[_0x04f8('0x32')]=_[_0x04f8('0x2f')](db[_0x04f8('0x2c')][_0x04f8('0x45')]);_0x2464bd[_0x04f8('0x30')]=_[_0x04f8('0x2f')](_0x336e4f[_0x04f8('0x30')]);_0x2464bd[_0x04f8('0x31')]=_[_0x04f8('0x34')](_0x2464bd[_0x04f8('0x32')],_0x2464bd['query']);_0x5e8d7d[_0x04f8('0x33')]=_[_0x04f8('0x34')](_0x2464bd[_0x04f8('0x32')],qs['fields'](_0x336e4f[_0x04f8('0x30')][_0x04f8('0x35')]));_0x5e8d7d[_0x04f8('0x33')]=_0x5e8d7d[_0x04f8('0x33')][_0x04f8('0x36')]?_0x5e8d7d[_0x04f8('0x33')]:_0x2464bd['model'];if(_0x336e4f[_0x04f8('0x30')][_0x04f8('0x3f')]){_0x5e8d7d['include']=[{'all':!![]}];}_0x5e8d7d=_[_0x04f8('0x46')]({},_0x5e8d7d,_0x336e4f[_0x04f8('0x47')]);return db['Disposition'][_0x04f8('0x48')](_0x5e8d7d)[_0x04f8('0x23')](handleEntityNotFound(_0x245071,null))[_0x04f8('0x23')](respondWithResult(_0x245071,null))[_0x04f8('0x42')](handleError(_0x245071,null));};exports[_0x04f8('0x49')]=function(_0xab1f59,_0x5cc35f){return db[_0x04f8('0x2c')][_0x04f8('0x49')](_0xab1f59[_0x04f8('0x4a')],{})[_0x04f8('0x23')](function(_0x1f045c){var _0x505e54=_0xab1f59['user'][_0x04f8('0x24')]({'plain':!![]});if(!_0x505e54)throw new Error(_0x04f8('0x4b'));if(_0x505e54['role']===_0x04f8('0x4c')){var _0x20784e=_0x1f045c['get']({'plain':!![]});var _0x33eee9=_0x04f8('0x25');return db[_0x04f8('0x4d')]['find']({'where':{'name':_0x33eee9,'userProfileId':_0x505e54[_0x04f8('0x4e')]},'raw':!![]})[_0x04f8('0x23')](function(_0x317627){if(_0x317627&&_0x317627['autoAssociation']===0x0){return db[_0x04f8('0x26')][_0x04f8('0x49')]({'name':_0x20784e[_0x04f8('0x28')],'resourceId':_0x20784e['id'],'type':_0x317627['name'],'sectionId':_0x317627['id']},{})[_0x04f8('0x23')](function(){return _0x1f045c;});}else{return _0x1f045c;}})['catch'](function(_0x2cb5eb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cb5eb);throw _0x2cb5eb;});}return _0x1f045c;})[_0x04f8('0x23')](respondWithResult(_0x5cc35f,0xc9))['catch'](handleError(_0x5cc35f,null));};exports[_0x04f8('0x21')]=function(_0x292406,_0x1eea9b){if(_0x292406[_0x04f8('0x4a')]['id']){delete _0x292406[_0x04f8('0x4a')]['id'];}return db['Disposition'][_0x04f8('0x48')]({'where':{'id':_0x292406[_0x04f8('0x44')]['id']}})[_0x04f8('0x23')](handleEntityNotFound(_0x1eea9b,null))[_0x04f8('0x23')](saveUpdates(_0x292406[_0x04f8('0x4a')],null))[_0x04f8('0x23')](respondWithResult(_0x1eea9b,null))[_0x04f8('0x42')](handleError(_0x1eea9b,null));};exports[_0x04f8('0x22')]=function(_0x31c87d,_0x2b4378){return db[_0x04f8('0x2c')][_0x04f8('0x48')]({'where':{'id':_0x31c87d['params']['id']}})['then'](handleEntityNotFound(_0x2b4378,null))[_0x04f8('0x23')](removeEntity(_0x2b4378,null))['catch'](handleError(_0x2b4378,null));}; \ No newline at end of file +var _0xf8cc=['role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','Disposition','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user'];(function(_0x5bca01,_0x23ad87){var _0x53a70b=function(_0x39b704){while(--_0x39b704){_0x5bca01['push'](_0x5bca01['shift']());}};_0x53a70b(++_0x23ad87);}(_0xf8cc,0x1e4));var _0xcf8c=function(_0x3600da,_0x250a33){_0x3600da=_0x3600da-0x0;var _0x3d33ea=_0xf8cc[_0x3600da];return _0x3d33ea;};'use strict';var emlformat=require(_0xcf8c('0x0'));var rimraf=require(_0xcf8c('0x1'));var zipdir=require(_0xcf8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf8c('0x3'));var moment=require(_0xcf8c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf8c('0x5'));var util=require(_0xcf8c('0x6'));var path=require(_0xcf8c('0x7'));var sox=require(_0xcf8c('0x8'));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('squel');var crypto=require(_0xcf8c('0x9'));var jsforce=require(_0xcf8c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xcf8c('0xb'));var querystring=require(_0xcf8c('0xc'));var Papa=require('papaparse');var Redis=require(_0xcf8c('0xd'));var authService=require(_0xcf8c('0xe'));var qs=require(_0xcf8c('0xf'));var as=require(_0xcf8c('0x10'));var hardwareService=require(_0xcf8c('0x11'));var logger=require(_0xcf8c('0x12'))(_0xcf8c('0x13'));var utils=require(_0xcf8c('0x14'));var config=require(_0xcf8c('0x15'));var licenseUtil=require(_0xcf8c('0x16'));var db=require(_0xcf8c('0x17'))['db'];function respondWithStatusCode(_0x3b702f,_0x21dd72){_0x21dd72=_0x21dd72||0xcc;return function(_0x303938){if(_0x303938){return _0x3b702f[_0xcf8c('0x18')](_0x21dd72);}return _0x3b702f['status'](_0x21dd72)[_0xcf8c('0x19')]();};}function respondWithResult(_0x1582de,_0x3b25fb){_0x3b25fb=_0x3b25fb||0xc8;return function(_0x69df54){if(_0x69df54){return _0x1582de[_0xcf8c('0x1a')](_0x3b25fb)[_0xcf8c('0x1b')](_0x69df54);}};}function respondWithFilteredResult(_0x59319f,_0x35c41e){return function(_0x3c151e){if(_0x3c151e){var _0x2bb2b9=typeof _0x35c41e[_0xcf8c('0x1c')]===_0xcf8c('0x1d')&&typeof _0x35c41e['limit']===_0xcf8c('0x1d');var _0xa4cc7f=_0x3c151e[_0xcf8c('0x1e')];var _0xc0e422=_0x2bb2b9?0x0:_0x35c41e['offset'];var _0x4399ef=_0x2bb2b9?_0x3c151e[_0xcf8c('0x1e')]:_0x35c41e['offset']+_0x35c41e[_0xcf8c('0x1f')];var _0x3e81de;if(_0x4399ef>=_0xa4cc7f){_0x4399ef=_0xa4cc7f;_0x3e81de=0xc8;}else{_0x3e81de=0xce;}_0x59319f[_0xcf8c('0x1a')](_0x3e81de);return _0x59319f[_0xcf8c('0x20')]('Content-Range',_0xc0e422+'-'+_0x4399ef+'/'+_0xa4cc7f)[_0xcf8c('0x1b')](_0x3c151e);}return null;};}function patchUpdates(_0x24ebcc){return function(_0x11d4c2){try{jsonpatch['apply'](_0x11d4c2,_0x24ebcc,!![]);}catch(_0x2e6e16){return BPromise[_0xcf8c('0x21')](_0x2e6e16);}return _0x11d4c2['save']();};}function saveUpdates(_0x23f2bc,_0x36f085){return function(_0x582f49){if(_0x582f49){return _0x582f49[_0xcf8c('0x22')](_0x23f2bc)[_0xcf8c('0x23')](function(_0x1e1631){return _0x1e1631;});}return null;};}function removeEntity(_0x1c47ef,_0x29d370){return function(_0x5d7eb3){if(_0x5d7eb3){return _0x5d7eb3[_0xcf8c('0x24')]()['then'](function(){var _0x426fed=_0x5d7eb3[_0xcf8c('0x25')]({'plain':!![]});var _0x4e5ad6='Dispositions';return db[_0xcf8c('0x26')][_0xcf8c('0x24')]({'where':{'type':_0x4e5ad6,'resourceId':_0x426fed['id']}})[_0xcf8c('0x23')](function(){return _0x5d7eb3;});})[_0xcf8c('0x23')](function(){_0x1c47ef[_0xcf8c('0x1a')](0xcc)[_0xcf8c('0x19')]();});}};}function handleEntityNotFound(_0x37ad17,_0x1bbd32){return function(_0x422804){if(!_0x422804){_0x37ad17[_0xcf8c('0x18')](0x194);}return _0x422804;};}function handleError(_0x367669,_0x2884c8){_0x2884c8=_0x2884c8||0x1f4;return function(_0x44a947){logger[_0xcf8c('0x27')](_0x44a947[_0xcf8c('0x28')]);if(_0x44a947['name']){delete _0x44a947['name'];}_0x367669[_0xcf8c('0x1a')](_0x2884c8)[_0xcf8c('0x29')](_0x44a947);};}exports[_0xcf8c('0x2a')]=function(_0x3d0e7f,_0x3b51b5){var _0x31efcc={},_0x6938aa={},_0x553ac8={'count':0x0,'rows':[]};var _0x13d489=_[_0xcf8c('0x2b')](db[_0xcf8c('0x2c')][_0xcf8c('0x2d')],function(_0x1d5e36){return{'name':_0x1d5e36['fieldName'],'type':_0x1d5e36[_0xcf8c('0x2e')][_0xcf8c('0x2f')]};});_0x6938aa[_0xcf8c('0x30')]=_[_0xcf8c('0x2b')](_0x13d489,_0xcf8c('0x31'));_0x6938aa[_0xcf8c('0x32')]=_[_0xcf8c('0x33')](_0x3d0e7f['query']);_0x6938aa[_0xcf8c('0x34')]=_['intersection'](_0x6938aa[_0xcf8c('0x30')],_0x6938aa[_0xcf8c('0x32')]);_0x31efcc['attributes']=_[_0xcf8c('0x35')](_0x6938aa[_0xcf8c('0x30')],qs[_0xcf8c('0x36')](_0x3d0e7f['query']['fields']));_0x31efcc['attributes']=_0x31efcc[_0xcf8c('0x37')][_0xcf8c('0x38')]?_0x31efcc[_0xcf8c('0x37')]:_0x6938aa[_0xcf8c('0x30')];if(!_0x3d0e7f[_0xcf8c('0x32')][_0xcf8c('0x39')](_0xcf8c('0x3a'))){_0x31efcc[_0xcf8c('0x1f')]=qs['limit'](_0x3d0e7f[_0xcf8c('0x32')][_0xcf8c('0x1f')]);_0x31efcc[_0xcf8c('0x1c')]=qs[_0xcf8c('0x1c')](_0x3d0e7f[_0xcf8c('0x32')][_0xcf8c('0x1c')]);}_0x31efcc[_0xcf8c('0x3b')]=qs[_0xcf8c('0x3c')](_0x3d0e7f['query']['sort']);_0x31efcc[_0xcf8c('0x3d')]=qs[_0xcf8c('0x34')](_['pick'](_0x3d0e7f[_0xcf8c('0x32')],_0x6938aa[_0xcf8c('0x34')]),_0x13d489);if(_0x3d0e7f[_0xcf8c('0x32')][_0xcf8c('0x3e')]){_0x31efcc['where']=_[_0xcf8c('0x3f')](_0x31efcc[_0xcf8c('0x3d')],{'$or':_['map'](_0x13d489,function(_0x5ba315){if(_0x5ba315[_0xcf8c('0x2e')]!==_0xcf8c('0x40')){var _0x3235b9={};_0x3235b9[_0x5ba315[_0xcf8c('0x31')]]={'$like':'%'+_0x3d0e7f[_0xcf8c('0x32')]['filter']+'%'};return _0x3235b9;}})});}_0x31efcc=_['merge']({},_0x31efcc,_0x3d0e7f[_0xcf8c('0x41')]);var _0x58ad72={'where':_0x31efcc['where']};return db[_0xcf8c('0x2c')][_0xcf8c('0x1e')](_0x58ad72)[_0xcf8c('0x23')](function(_0xbfc65e){_0x553ac8[_0xcf8c('0x1e')]=_0xbfc65e;if(_0x3d0e7f[_0xcf8c('0x32')]['includeAll']){_0x31efcc[_0xcf8c('0x42')]=[{'all':!![]}];}return db['Disposition'][_0xcf8c('0x43')](_0x31efcc);})[_0xcf8c('0x23')](function(_0x3ead56){_0x553ac8[_0xcf8c('0x44')]=_0x3ead56;return _0x553ac8;})[_0xcf8c('0x23')](respondWithFilteredResult(_0x3b51b5,_0x31efcc))[_0xcf8c('0x45')](handleError(_0x3b51b5,null));};exports['show']=function(_0x4ba3ca,_0x48a3f4){var _0x1500a3={'raw':!![],'where':{'id':_0x4ba3ca[_0xcf8c('0x46')]['id']}},_0x54526d={};_0x54526d['model']=_[_0xcf8c('0x33')](db[_0xcf8c('0x2c')][_0xcf8c('0x2d')]);_0x54526d[_0xcf8c('0x32')]=_[_0xcf8c('0x33')](_0x4ba3ca['query']);_0x54526d[_0xcf8c('0x34')]=_['intersection'](_0x54526d[_0xcf8c('0x30')],_0x54526d[_0xcf8c('0x32')]);_0x1500a3[_0xcf8c('0x37')]=_[_0xcf8c('0x35')](_0x54526d['model'],qs[_0xcf8c('0x36')](_0x4ba3ca[_0xcf8c('0x32')][_0xcf8c('0x36')]));_0x1500a3['attributes']=_0x1500a3[_0xcf8c('0x37')][_0xcf8c('0x38')]?_0x1500a3[_0xcf8c('0x37')]:_0x54526d['model'];if(_0x4ba3ca[_0xcf8c('0x32')][_0xcf8c('0x47')]){_0x1500a3[_0xcf8c('0x42')]=[{'all':!![]}];}_0x1500a3=_[_0xcf8c('0x3f')]({},_0x1500a3,_0x4ba3ca[_0xcf8c('0x41')]);return db[_0xcf8c('0x2c')][_0xcf8c('0x48')](_0x1500a3)['then'](handleEntityNotFound(_0x48a3f4,null))[_0xcf8c('0x23')](respondWithResult(_0x48a3f4,null))['catch'](handleError(_0x48a3f4,null));};exports[_0xcf8c('0x49')]=function(_0x19c420,_0x5a91f4){return db[_0xcf8c('0x2c')][_0xcf8c('0x49')](_0x19c420[_0xcf8c('0x4a')],{})[_0xcf8c('0x23')](function(_0x4d02c0){var _0x5c88c7=_0x19c420[_0xcf8c('0x4b')][_0xcf8c('0x25')]({'plain':!![]});if(!_0x5c88c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c88c7[_0xcf8c('0x4c')]===_0xcf8c('0x4b')){var _0x1c76e1=_0x4d02c0[_0xcf8c('0x25')]({'plain':!![]});var _0x565b66='Dispositions';return db[_0xcf8c('0x4d')][_0xcf8c('0x48')]({'where':{'name':_0x565b66,'userProfileId':_0x5c88c7[_0xcf8c('0x4e')]},'raw':!![]})[_0xcf8c('0x23')](function(_0x4aaac7){if(_0x4aaac7&&_0x4aaac7['autoAssociation']===0x0){return db[_0xcf8c('0x26')][_0xcf8c('0x49')]({'name':_0x1c76e1[_0xcf8c('0x31')],'resourceId':_0x1c76e1['id'],'type':_0x4aaac7['name'],'sectionId':_0x4aaac7['id']},{})[_0xcf8c('0x23')](function(){return _0x4d02c0;});}else{return _0x4d02c0;}})[_0xcf8c('0x45')](function(_0x8cedc7){logger[_0xcf8c('0x27')](_0xcf8c('0x4f'),_0x8cedc7);throw _0x8cedc7;});}return _0x4d02c0;})[_0xcf8c('0x23')](respondWithResult(_0x5a91f4,0xc9))[_0xcf8c('0x45')](handleError(_0x5a91f4,null));};exports[_0xcf8c('0x22')]=function(_0x9c4ffd,_0x1529c5){if(_0x9c4ffd[_0xcf8c('0x4a')]['id']){delete _0x9c4ffd[_0xcf8c('0x4a')]['id'];}return db[_0xcf8c('0x2c')][_0xcf8c('0x48')]({'where':{'id':_0x9c4ffd['params']['id']}})[_0xcf8c('0x23')](handleEntityNotFound(_0x1529c5,null))['then'](saveUpdates(_0x9c4ffd[_0xcf8c('0x4a')],null))[_0xcf8c('0x23')](respondWithResult(_0x1529c5,null))[_0xcf8c('0x45')](handleError(_0x1529c5,null));};exports[_0xcf8c('0x24')]=function(_0x36059d,_0x52aa64){return db[_0xcf8c('0x2c')][_0xcf8c('0x48')]({'where':{'id':_0x36059d['params']['id']}})[_0xcf8c('0x23')](handleEntityNotFound(_0x52aa64,null))[_0xcf8c('0x23')](removeEntity(_0x52aa64,null))['catch'](handleError(_0x52aa64,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7aa46f1..62081a8 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 _0x5dd2=['../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e4151,_0x470174){var _0x1dc64c=function(_0x481112){while(--_0x481112){_0x1e4151['push'](_0x1e4151['shift']());}};_0x1dc64c(++_0x470174);}(_0x5dd2,0x19e));var _0x25dd=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x5dd2[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0x25dd('0x0'));var logger=require(_0x25dd('0x1'))(_0x25dd('0x2'));var moment=require(_0x25dd('0x3'));var BPromise=require(_0x25dd('0x4'));var rp=require(_0x25dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x25dd('0x6'));var attributes=require(_0x25dd('0x7'));module[_0x25dd('0x8')]=function(_0x3e5db5,_0x5d9386){return _0x3e5db5[_0x25dd('0x9')]('Disposition',attributes,{'tableName':_0x25dd('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x25dd('0xb'),'fields':[_0x25dd('0xc'),'ListId']},{'unique':!![],'name':_0x25dd('0xd'),'fields':[_0x25dd('0xc'),_0x25dd('0xe')]},{'unique':!![],'name':_0x25dd('0xf'),'fields':['name',_0x25dd('0x10')]},{'unique':!![],'name':_0x25dd('0x11'),'fields':[_0x25dd('0xc'),_0x25dd('0x12')]},{'unique':!![],'name':_0x25dd('0x13'),'fields':[_0x25dd('0xc'),_0x25dd('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x25dd('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x25dd('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e83=['Disposition','tools_dispositions','name_voice','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','path','./disposition.attributes','exports','define'];(function(_0x4daaa1,_0x4a1bbd){var _0x37a1fd=function(_0xa5d8c1){while(--_0xa5d8c1){_0x4daaa1['push'](_0x4daaa1['shift']());}};_0x37a1fd(++_0x4a1bbd);}(_0x4e83,0x132));var _0x34e8=function(_0x533852,_0x5e1347){_0x533852=_0x533852-0x0;var _0x3b39f2=_0x4e83[_0x533852];return _0x3b39f2;};'use strict';var _=require(_0x34e8('0x0'));var util=require(_0x34e8('0x1'));var logger=require(_0x34e8('0x2'))('api');var moment=require(_0x34e8('0x3'));var BPromise=require(_0x34e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34e8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34e8('0x6'));module[_0x34e8('0x7')]=function(_0xb3a589,_0x274740){return _0xb3a589[_0x34e8('0x8')](_0x34e8('0x9'),attributes,{'tableName':_0x34e8('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x34e8('0xb'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':[_0x34e8('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x34e8('0xd'),'fields':[_0x34e8('0xc'),_0x34e8('0xe')]},{'unique':!![],'name':_0x34e8('0xf'),'fields':[_0x34e8('0xc'),_0x34e8('0x10')]},{'unique':!![],'name':_0x34e8('0x11'),'fields':['name',_0x34e8('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x34e8('0xc'),_0x34e8('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x34e8('0xc'),_0x34e8('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d903593..0e018f2 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(_0x93e105,_0x3dd3e4){var _0x145b96=function(_0x58610b){while(--_0x58610b){_0x93e105['push'](_0x93e105['shift']());}};_0x145b96(++_0x3dd3e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x9ecb42,_0x2f6173){var _0x245424=function(_0x5e03e9){while(--_0x5e03e9){_0x9ecb42['push'](_0x9ecb42['shift']());}};_0x245424(++_0x2f6173);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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 24193e6..c00c48a 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 _0x939d=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x5d6a37,_0x3aa9c1){var _0xb28173=function(_0x519105){while(--_0x519105){_0x5d6a37['push'](_0x5d6a37['shift']());}};_0xb28173(++_0x3aa9c1);}(_0x939d,0x1d9));var _0xd939=function(_0x1b0fd3,_0x3173df){_0x1b0fd3=_0x1b0fd3-0x0;var _0xa47af4=_0x939d[_0x1b0fd3];return _0xa47af4;};'use strict';var multer=require(_0xd939('0x0'));var util=require(_0xd939('0x1'));var path=require(_0xd939('0x2'));var timeout=require('connect-timeout');var express=require(_0xd939('0x3'));var router=express[_0xd939('0x4')]();var fs_extra=require(_0xd939('0x5'));var auth=require(_0xd939('0x6'));var interaction=require(_0xd939('0x7'));var config=require(_0xd939('0x8'));var controller=require(_0xd939('0x9'));router[_0xd939('0xa')]('/',auth[_0xd939('0xb')](),controller['index']);router[_0xd939('0xa')](_0xd939('0xc'),auth[_0xd939('0xb')](),controller['show']);router[_0xd939('0xd')]('/',auth[_0xd939('0xb')](),controller[_0xd939('0xe')]);router[_0xd939('0xf')](_0xd939('0xc'),auth[_0xd939('0xb')](),controller[_0xd939('0x10')]);router[_0xd939('0x11')](_0xd939('0xc'),auth[_0xd939('0xb')](),controller['destroy']);module[_0xd939('0x12')]=router; \ No newline at end of file +var _0xc1d0=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports'];(function(_0x2d414f,_0x296e81){var _0x534014=function(_0x586088){while(--_0x586088){_0x2d414f['push'](_0x2d414f['shift']());}};_0x534014(++_0x296e81);}(_0xc1d0,0x18f));var _0x0c1d=function(_0x32f657,_0x3bcd12){_0x32f657=_0x32f657-0x0;var _0x2dd60e=_0xc1d0[_0x32f657];return _0x2dd60e;};'use strict';var multer=require(_0x0c1d('0x0'));var util=require(_0x0c1d('0x1'));var path=require('path');var timeout=require(_0x0c1d('0x2'));var express=require(_0x0c1d('0x3'));var router=express[_0x0c1d('0x4')]();var fs_extra=require(_0x0c1d('0x5'));var auth=require(_0x0c1d('0x6'));var interaction=require(_0x0c1d('0x7'));var config=require(_0x0c1d('0x8'));var controller=require('./disposition.controller');router[_0x0c1d('0x9')]('/',auth[_0x0c1d('0xa')](),controller[_0x0c1d('0xb')]);router['get'](_0x0c1d('0xc'),auth[_0x0c1d('0xa')](),controller[_0x0c1d('0xd')]);router[_0x0c1d('0xe')]('/',auth[_0x0c1d('0xa')](),controller['create']);router['put']('/:id',auth[_0x0c1d('0xa')](),controller[_0x0c1d('0xf')]);router[_0x0c1d('0x10')](_0x0c1d('0xc'),auth[_0x0c1d('0xa')](),controller[_0x0c1d('0x11')]);module[_0x0c1d('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 30f2467..27b90a9 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 _0xa861=['yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600','12000','4800','7200','14400','v17,v27,v29','INTEGER','SIP','DADHI','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x41d01d,_0x577e6d){var _0x356164=function(_0x1d429f){while(--_0x1d429f){_0x41d01d['push'](_0x41d01d['shift']());}};_0x356164(++_0x577e6d);}(_0xa861,0x1c4));var _0x1a86=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xa861[_0x576d8a];return _0x3dc3ef;};'use strict';var Sequelize=require(_0x1a86('0x0'));module[_0x1a86('0x1')]={'name':{'type':Sequelize[_0x1a86('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x1a86('0x3')](_0x1a86('0x4'),'no'),'defaultValue':_0x1a86('0x4')},'headerinfo':{'type':Sequelize[_0x1a86('0x2')],'defaultValue':_0x1a86('0x5')},'localstationid':{'type':Sequelize[_0x1a86('0x2')],'unique':_0x1a86('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x1a86('0x7'),'4800','7200',_0x1a86('0x8'),_0x1a86('0x9'),'14400'),'defaultValue':_0x1a86('0xa')},'maxrate':{'type':Sequelize[_0x1a86('0x3')](_0x1a86('0x7'),_0x1a86('0xa'),_0x1a86('0xb'),_0x1a86('0x8'),_0x1a86('0x9'),_0x1a86('0xc')),'defaultValue':_0x1a86('0xc')},'modem':{'type':Sequelize[_0x1a86('0x2')],'defaultValue':_0x1a86('0xd')},'gateway':{'type':Sequelize[_0x1a86('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1a86('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1a86('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1a86('0x3')](_0x1a86('0xf'),'IAX',_0x1a86('0x10'),'KHOMP'),'defaultValue':_0x1a86('0xf')},'key':{'type':Sequelize[_0x1a86('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1a86('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1a86('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1a86('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a86('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1a86('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a86('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1a86('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a86('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x1a86('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x1a86('0x12')],'defaultValue':![],'comment':_0x1a86('0x14'),'set':function(_0x3820bf){if(!_0x3820bf)this[_0x1a86('0x15')](_0x1a86('0x16'),null);this['setDataValue'](_0x1a86('0x17'),_0x3820bf);}}}; \ No newline at end of file +var _0xed43=['7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','12000','14400'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xed43,0x1c8));var _0x3ed4=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xed43[_0x2891d1];return _0x486948;};'use strict';var Sequelize=require(_0x3ed4('0x0'));module[_0x3ed4('0x1')]={'name':{'type':Sequelize[_0x3ed4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3ed4('0x2')]},'ecm':{'type':Sequelize[_0x3ed4('0x3')]('yes','no'),'defaultValue':_0x3ed4('0x4')},'headerinfo':{'type':Sequelize[_0x3ed4('0x2')],'defaultValue':_0x3ed4('0x5')},'localstationid':{'type':Sequelize[_0x3ed4('0x2')],'unique':_0x3ed4('0x6')},'minrate':{'type':Sequelize[_0x3ed4('0x3')](_0x3ed4('0x7'),_0x3ed4('0x8'),'7200',_0x3ed4('0x9'),_0x3ed4('0xa'),_0x3ed4('0xb')),'defaultValue':_0x3ed4('0x8')},'maxrate':{'type':Sequelize[_0x3ed4('0x3')](_0x3ed4('0x7'),_0x3ed4('0x8'),_0x3ed4('0xc'),_0x3ed4('0x9'),_0x3ed4('0xa'),'14400'),'defaultValue':_0x3ed4('0xb')},'modem':{'type':Sequelize[_0x3ed4('0x2')],'defaultValue':_0x3ed4('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3ed4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x3ed4('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x3ed4('0xf'),_0x3ed4('0x10'),_0x3ed4('0x11'),_0x3ed4('0x12')),'defaultValue':_0x3ed4('0xf')},'key':{'type':Sequelize[_0x3ed4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3ed4('0x13')],'defaultValue':function(){return _0x3ed4('0x14');}},'notificationSound':{'type':Sequelize[_0x3ed4('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ed4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ed4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3ed4('0x16')},'mandatoryDisposition':{'type':Sequelize[_0x3ed4('0x15')],'defaultValue':![],'comment':_0x3ed4('0x17'),'set':function(_0x5c02da){if(!_0x5c02da)this[_0x3ed4('0x18')](_0x3ed4('0x19'),null);this[_0x3ed4('0x18')]('mandatoryDisposition',_0x5c02da);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 70b675c..102c600 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 _0x335d=['name','send','index','Pause','map','FaxAccount','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','FaxAccountId','getAnswers','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','omit','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','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','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','Send\x20Fax\x20failed','out','filename','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxAccount.socket','jayson/promise','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','FaxAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x335d,0x90));var _0xd335=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x335d[_0x4b6830];return _0x239e4a;};'use strict';var emlformat=require(_0xd335('0x0'));var rimraf=require(_0xd335('0x1'));var zipdir=require(_0xd335('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd335('0x3'));var Mustache=require('mustache');var util=require(_0xd335('0x4'));var path=require(_0xd335('0x5'));var sox=require(_0xd335('0x6'));var csv=require('to-csv');var ejs=require(_0xd335('0x7'));var fs=require('fs');var fs_extra=require(_0xd335('0x8'));var _=require(_0xd335('0x9'));var squel=require(_0xd335('0xa'));var crypto=require('crypto');var jsforce=require(_0xd335('0xb'));var deskjs=require(_0xd335('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd335('0xd'));var Papa=require('papaparse');var Redis=require(_0xd335('0xe'));var authService=require(_0xd335('0xf'));var qs=require(_0xd335('0x10'));var as=require(_0xd335('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd335('0x12'))(_0xd335('0x13'));var utils=require(_0xd335('0x14'));var config=require(_0xd335('0x15'));var licenseUtil=require(_0xd335('0x16'));var db=require(_0xd335('0x17'))['db'];config['redis']=_[_0xd335('0x18')](config[_0xd335('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd335('0x1a'))(new Redis(config[_0xd335('0x19')]));require(_0xd335('0x1b'))['register'](socket);var jayson=require(_0xd335('0x1c'));var client=jayson['client'][_0xd335('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475123,_0x2f5811,_0x51df34,_0x329678){return new BPromise(function(_0x482bf1,_0x241c3b){var _0x48de34=_0x329678||client;return _0x48de34['request'](_0x475123,_0x51df34)[_0xd335('0x1e')](function(_0x2129ec){logger[_0xd335('0x1f')](_0xd335('0x20'),_0x2f5811,_0xd335('0x21'));logger[_0xd335('0x22')](_0xd335('0x23'),_0x2f5811,_0xd335('0x21'),JSON['stringify'](_0x2129ec));if(_0x2129ec[_0xd335('0x24')]){if(_0x2129ec[_0xd335('0x24')][_0xd335('0x25')]===0x1f4){logger[_0xd335('0x24')](_0xd335('0x20'),_0x2f5811,_0x2129ec['error'][_0xd335('0x26')]);return _0x241c3b(_0x2129ec[_0xd335('0x24')][_0xd335('0x26')]);}logger[_0xd335('0x24')]('FaxAccount,\x20%s,\x20%s',_0x2f5811,_0x2129ec[_0xd335('0x24')][_0xd335('0x26')]);return _0x482bf1(_0x2129ec[_0xd335('0x24')][_0xd335('0x26')]);}else{logger[_0xd335('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x2f5811,_0xd335('0x21'));_0x482bf1(_0x2129ec[_0xd335('0x27')][_0xd335('0x26')]);}})['catch'](function(_0x20fc21){logger['error'](_0xd335('0x20'),_0x2f5811,_0x20fc21);_0x241c3b(_0x20fc21);});});}function respondWithStatusCode(_0x31fd80,_0x582ae4){_0x582ae4=_0x582ae4||0xcc;return function(_0x1df5ea){if(_0x1df5ea){return _0x31fd80['sendStatus'](_0x582ae4);}return _0x31fd80[_0xd335('0x28')](_0x582ae4)[_0xd335('0x29')]();};}function respondWithResult(_0x37b88b,_0x524896){_0x524896=_0x524896||0xc8;return function(_0xfa6362){if(_0xfa6362){return _0x37b88b[_0xd335('0x28')](_0x524896)[_0xd335('0x2a')](_0xfa6362);}};}function respondWithFilteredResult(_0x2cb696,_0x13f26a){return function(_0x3226ad){if(_0x3226ad){var _0x5cd81e=typeof _0x13f26a[_0xd335('0x2b')]==='undefined'&&typeof _0x13f26a[_0xd335('0x2c')]===_0xd335('0x2d');var _0x1a15ae=_0x3226ad[_0xd335('0x2e')];var _0x8ea45c=_0x5cd81e?0x0:_0x13f26a[_0xd335('0x2b')];var _0x5adb41=_0x5cd81e?_0x3226ad[_0xd335('0x2e')]:_0x13f26a[_0xd335('0x2b')]+_0x13f26a[_0xd335('0x2c')];var _0x29a6ff;if(_0x5adb41>=_0x1a15ae){_0x5adb41=_0x1a15ae;_0x29a6ff=0xc8;}else{_0x29a6ff=0xce;}_0x2cb696[_0xd335('0x28')](_0x29a6ff);return _0x2cb696[_0xd335('0x2f')](_0xd335('0x30'),_0x8ea45c+'-'+_0x5adb41+'/'+_0x1a15ae)[_0xd335('0x2a')](_0x3226ad);}return null;};}function patchUpdates(_0x420a19){return function(_0x18ddd6){try{jsonpatch[_0xd335('0x31')](_0x18ddd6,_0x420a19,!![]);}catch(_0x56d704){return BPromise[_0xd335('0x32')](_0x56d704);}return _0x18ddd6[_0xd335('0x33')]();};}function saveUpdates(_0x53a3dc,_0x5aa291){return function(_0x4fcd7a){if(_0x4fcd7a){return _0x4fcd7a['update'](_0x53a3dc)[_0xd335('0x1e')](function(_0x5ba27a){return _0x5ba27a;});}return null;};}function removeEntity(_0x23e00a,_0x49a6ad){return function(_0xbdcec8){if(_0xbdcec8){return _0xbdcec8[_0xd335('0x34')]()[_0xd335('0x1e')](function(){var _0x3b6418=_0xbdcec8['get']({'plain':!![]});var _0x2c776b=_0xd335('0x35');return db['UserProfileResource'][_0xd335('0x34')]({'where':{'type':_0x2c776b,'resourceId':_0x3b6418['id']}})[_0xd335('0x1e')](function(){return _0xbdcec8;});})[_0xd335('0x1e')](function(){_0x23e00a[_0xd335('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54adca,_0x3e8880){return function(_0x351ae2){if(!_0x351ae2){_0x54adca['sendStatus'](0x194);}return _0x351ae2;};}function handleError(_0x3024fa,_0x351975){_0x351975=_0x351975||0x1f4;return function(_0x3b4c4c){logger[_0xd335('0x24')](_0x3b4c4c['stack']);if(_0x3b4c4c[_0xd335('0x36')]){delete _0x3b4c4c[_0xd335('0x36')];}_0x3024fa[_0xd335('0x28')](_0x351975)[_0xd335('0x37')](_0x3b4c4c);};}exports[_0xd335('0x38')]=function(_0x4a53b6,_0x2fc916){var _0x43a717={'include':[{'model':db[_0xd335('0x39')],'as':'mandatoryDispositionPause'}]},_0x50989c={},_0x29d740={'count':0x0,'rows':[]};var _0x43ba4e=_[_0xd335('0x3a')](db[_0xd335('0x3b')]['rawAttributes'],function(_0x354eff){return{'name':_0x354eff[_0xd335('0x3c')],'type':_0x354eff[_0xd335('0x3d')][_0xd335('0x3e')]};});_0x50989c[_0xd335('0x3f')]=_[_0xd335('0x3a')](_0x43ba4e,_0xd335('0x36'));_0x50989c[_0xd335('0x40')]=_['keys'](_0x4a53b6[_0xd335('0x40')]);_0x50989c['filters']=_[_0xd335('0x41')](_0x50989c[_0xd335('0x3f')],_0x50989c[_0xd335('0x40')]);_0x43a717[_0xd335('0x42')]=_[_0xd335('0x41')](_0x50989c[_0xd335('0x3f')],qs[_0xd335('0x43')](_0x4a53b6[_0xd335('0x40')]['fields']));_0x43a717[_0xd335('0x42')]=_0x43a717[_0xd335('0x42')][_0xd335('0x44')]?_0x43a717['attributes']:_0x50989c[_0xd335('0x3f')];if(!_0x4a53b6[_0xd335('0x40')]['hasOwnProperty'](_0xd335('0x45'))){_0x43a717['limit']=qs[_0xd335('0x2c')](_0x4a53b6[_0xd335('0x40')][_0xd335('0x2c')]);_0x43a717['offset']=qs[_0xd335('0x2b')](_0x4a53b6[_0xd335('0x40')][_0xd335('0x2b')]);}_0x43a717['order']=qs[_0xd335('0x46')](_0x4a53b6['query'][_0xd335('0x46')]);_0x43a717[_0xd335('0x47')]=qs[_0xd335('0x48')](_[_0xd335('0x49')](_0x4a53b6[_0xd335('0x40')],_0x50989c['filters']),_0x43ba4e);if(_0x4a53b6['query']['filter']){_0x43a717[_0xd335('0x47')]=_['merge'](_0x43a717[_0xd335('0x47')],{'$or':_[_0xd335('0x3a')](_0x43ba4e,function(_0x2b241a){if(_0x2b241a[_0xd335('0x3d')]!==_0xd335('0x4a')){var _0x30607a={};_0x30607a[_0x2b241a[_0xd335('0x36')]]={'$like':'%'+_0x4a53b6[_0xd335('0x40')][_0xd335('0x4b')]+'%'};return _0x30607a;}})});}_0x43a717=_[_0xd335('0x4c')]({},_0x43a717,_0x4a53b6[_0xd335('0x4d')]);var _0x41a799={'where':_0x43a717[_0xd335('0x47')]};return db[_0xd335('0x3b')][_0xd335('0x2e')](_0x41a799)[_0xd335('0x1e')](function(_0x3d663d){_0x29d740[_0xd335('0x2e')]=_0x3d663d;if(_0x4a53b6[_0xd335('0x40')][_0xd335('0x4e')]){_0x43a717['include']=[{'all':!![]}];}return db['FaxAccount'][_0xd335('0x4f')](_0x43a717);})['then'](function(_0x43a3b4){_0x29d740[_0xd335('0x50')]=_0x43a3b4;return _0x29d740;})[_0xd335('0x1e')](respondWithFilteredResult(_0x2fc916,_0x43a717))[_0xd335('0x51')](handleError(_0x2fc916,null));};exports[_0xd335('0x52')]=function(_0x5bfe7c,_0x1811ea){var _0x4305a2={'raw':![],'where':{'id':_0x5bfe7c[_0xd335('0x53')]['id']},'include':[{'model':db[_0xd335('0x39')],'as':_0xd335('0x54')}]},_0x20d1ad={};_0x20d1ad[_0xd335('0x3f')]=_[_0xd335('0x55')](db['FaxAccount'][_0xd335('0x56')]);_0x20d1ad[_0xd335('0x40')]=_['keys'](_0x5bfe7c[_0xd335('0x40')]);_0x20d1ad[_0xd335('0x48')]=_[_0xd335('0x41')](_0x20d1ad['model'],_0x20d1ad[_0xd335('0x40')]);_0x4305a2[_0xd335('0x42')]=_[_0xd335('0x41')](_0x20d1ad['model'],qs['fields'](_0x5bfe7c['query'][_0xd335('0x43')]));_0x4305a2['attributes']=_0x4305a2[_0xd335('0x42')][_0xd335('0x44')]?_0x4305a2[_0xd335('0x42')]:_0x20d1ad[_0xd335('0x3f')];if(_0x5bfe7c[_0xd335('0x40')][_0xd335('0x4e')]){_0x4305a2[_0xd335('0x57')]=[{'all':!![]}];}_0x4305a2=_[_0xd335('0x4c')]({},_0x4305a2,_0x5bfe7c[_0xd335('0x4d')]);return db[_0xd335('0x3b')][_0xd335('0x58')](_0x4305a2)[_0xd335('0x1e')](handleEntityNotFound(_0x1811ea,null))['then'](respondWithResult(_0x1811ea,null))[_0xd335('0x51')](handleError(_0x1811ea,null));};exports[_0xd335('0x59')]=function(_0x4c183b,_0x2548c8){return db[_0xd335('0x3b')][_0xd335('0x59')](_0x4c183b[_0xd335('0x5a')],{})[_0xd335('0x1e')](function(_0x13e8a1){var _0x29aafa=_0x4c183b[_0xd335('0x5b')][_0xd335('0x5c')]({'plain':!![]});if(!_0x29aafa)throw new Error(_0xd335('0x5d'));if(_0x29aafa['role']==='user'){var _0x2ffe97=_0x13e8a1[_0xd335('0x5c')]({'plain':!![]});var _0x67649f=_0xd335('0x35');return db[_0xd335('0x5e')]['find']({'where':{'name':_0x67649f,'userProfileId':_0x29aafa[_0xd335('0x5f')]},'raw':!![]})[_0xd335('0x1e')](function(_0x2cfa45){if(_0x2cfa45&&_0x2cfa45[_0xd335('0x60')]===0x0){return db[_0xd335('0x61')]['create']({'name':_0x2ffe97[_0xd335('0x36')],'resourceId':_0x2ffe97['id'],'type':_0x2cfa45[_0xd335('0x36')],'sectionId':_0x2cfa45['id']},{})[_0xd335('0x1e')](function(){return _0x13e8a1;});}else{return _0x13e8a1;}})[_0xd335('0x51')](function(_0x397721){logger[_0xd335('0x24')](_0xd335('0x62'),_0x397721);throw _0x397721;});}return _0x13e8a1;})[_0xd335('0x1e')](respondWithResult(_0x2548c8,0xc9))['catch'](handleError(_0x2548c8,null));};exports[_0xd335('0x63')]=function(_0xb5812a,_0x4a4727){if(_0xb5812a['body']['id']){delete _0xb5812a[_0xd335('0x5a')]['id'];}return db['FaxAccount'][_0xd335('0x58')]({'where':{'id':_0xb5812a[_0xd335('0x53')]['id']},'include':[{'model':db[_0xd335('0x39')],'as':_0xd335('0x54')}]})[_0xd335('0x1e')](handleEntityNotFound(_0x4a4727,null))['then'](saveUpdates(_0xb5812a[_0xd335('0x5a')],null))[_0xd335('0x1e')](respondWithResult(_0x4a4727,null))['catch'](handleError(_0x4a4727,null));};exports[_0xd335('0x34')]=function(_0x2ccf77,_0x593a24){return db[_0xd335('0x3b')]['find']({'where':{'id':_0x2ccf77['params']['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x593a24,null))['then'](removeEntity(_0x593a24,null))[_0xd335('0x51')](handleError(_0x593a24,null));};exports[_0xd335('0x64')]=function(_0x2cc4da,_0x2fc3a7){return db['FaxAccount']['describe']()[_0xd335('0x1e')](respondWithResult(_0x2fc3a7,null))['catch'](handleError(_0x2fc3a7,null));};exports[_0xd335('0x65')]=function(_0x4bdbae,_0x2532e6,_0x347fcf){if(_0x4bdbae[_0xd335('0x5a')]['id']){delete _0x4bdbae[_0xd335('0x5a')]['id'];}return db[_0xd335('0x3b')]['find']({'where':{'id':_0x4bdbae[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x2532e6,null))[_0xd335('0x1e')](function(_0x397da4){if(_0x397da4){_0x4bdbae[_0xd335('0x5a')]['FaxAccountId']=_0x397da4['id'];return db[_0xd335('0x66')]['create'](_0x4bdbae['body']);}})['then'](respondWithResult(_0x2532e6,null))[_0xd335('0x51')](handleError(_0x2532e6,null));};exports[_0xd335('0x67')]=function(_0x96e581,_0x5c22e3,_0x288719){var _0x4de1fb={'raw':![],'where':{}};var _0x4634bd={};var _0x40da64={'count':0x0,'rows':[]};return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x96e581['params']['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x5c22e3,null))[_0xd335('0x1e')](function(_0x5d3602){if(_0x5d3602){_0x4634bd[_0xd335('0x3f')]=_[_0xd335('0x55')](db[_0xd335('0x66')]['rawAttributes']);_0x4634bd[_0xd335('0x40')]=_['keys'](_0x96e581[_0xd335('0x40')]);_0x4634bd[_0xd335('0x48')]=_[_0xd335('0x41')](_0x4634bd[_0xd335('0x3f')],_0x4634bd[_0xd335('0x40')]);_0x4de1fb['attributes']=_['intersection'](_0x4634bd['model'],qs[_0xd335('0x43')](_0x96e581['query']['fields']));_0x4de1fb[_0xd335('0x42')]=_0x4de1fb['attributes'][_0xd335('0x44')]?_0x4de1fb['attributes']:_0x4634bd[_0xd335('0x3f')];if(!_0x96e581[_0xd335('0x40')][_0xd335('0x69')](_0xd335('0x45'))){_0x4de1fb[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x96e581[_0xd335('0x40')]['limit']);_0x4de1fb[_0xd335('0x2b')]=qs[_0xd335('0x2b')](_0x96e581[_0xd335('0x40')]['offset']);}_0x4de1fb[_0xd335('0x6a')]=qs['sort'](_0x96e581[_0xd335('0x40')][_0xd335('0x46')]);_0x4de1fb[_0xd335('0x47')]=qs['filters'](_[_0xd335('0x49')](_0x96e581['query'],_0x4634bd[_0xd335('0x48')]));_0x4de1fb['where']['FaxAccountId']=_0x5d3602['id'];if(_0x96e581[_0xd335('0x40')][_0xd335('0x4b')]){_0x4de1fb[_0xd335('0x47')]=_[_0xd335('0x4c')](_0x4de1fb[_0xd335('0x47')],{'$or':_[_0xd335('0x3a')](_0x4de1fb[_0xd335('0x42')],function(_0x45fb60){var _0x26ac73={};_0x26ac73[_0x45fb60]={'$like':'%'+_0x96e581['query'][_0xd335('0x4b')]+'%'};return _0x26ac73;})});}_0x4de1fb=_['merge']({},_0x4de1fb,_0x96e581[_0xd335('0x4d')]);return db[_0xd335('0x66')][_0xd335('0x2e')]({'where':_0x4de1fb['where']})[_0xd335('0x1e')](function(_0x1faacb){_0x40da64[_0xd335('0x2e')]=_0x1faacb;if(_0x96e581[_0xd335('0x40')][_0xd335('0x4e')]){_0x4de1fb[_0xd335('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xd335('0x4f')](_0x4de1fb);})[_0xd335('0x1e')](function(_0x30dcd5){_0x40da64['rows']=_0x30dcd5;return _0x40da64;});}})['then'](respondWithFilteredResult(_0x5c22e3,_0x4de1fb))[_0xd335('0x51')](handleError(_0x5c22e3,null));};exports[_0xd335('0x6b')]=function(_0x5d6373,_0x1b1d22,_0xbc53fa){return db[_0xd335('0x3b')][_0xd335('0x58')]({'where':{'id':_0x5d6373[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x1b1d22,null))[_0xd335('0x1e')](function(_0x3df49f){if(_0x3df49f){return _0x3df49f[_0xd335('0x6b')](_0x5d6373['query']['ids']);}})[_0xd335('0x1e')](respondWithStatusCode(_0x1b1d22,null))[_0xd335('0x51')](handleError(_0x1b1d22,null));};exports['addAnswer']=function(_0x4a6f20,_0x2528e5,_0x35609c){if(_0x4a6f20[_0xd335('0x5a')]['id']){delete _0x4a6f20['body']['id'];}return db['FaxAccount'][_0xd335('0x58')]({'where':{'id':_0x4a6f20['params']['id']}})['then'](handleEntityNotFound(_0x2528e5,null))[_0xd335('0x1e')](function(_0x2f5b7b){if(_0x2f5b7b){_0x4a6f20[_0xd335('0x5a')][_0xd335('0x6c')]=_0x2f5b7b['id'];return db['CannedAnswer'][_0xd335('0x59')](_0x4a6f20[_0xd335('0x5a')]);}})[_0xd335('0x1e')](respondWithResult(_0x2528e5,null))['catch'](handleError(_0x2528e5,null));};exports[_0xd335('0x6d')]=function(_0x453a86,_0x2739d5,_0x22fbfc){var _0x63a9e9={'raw':![],'where':{}};var _0x5d306c={};var _0x3ed0ef={'count':0x0,'rows':[]};return db[_0xd335('0x3b')]['findOne']({'where':{'id':_0x453a86[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x2739d5,null))[_0xd335('0x1e')](function(_0x18e64c){if(_0x18e64c){_0x5d306c[_0xd335('0x3f')]=_[_0xd335('0x55')](db['CannedAnswer']['rawAttributes']);_0x5d306c[_0xd335('0x40')]=_[_0xd335('0x55')](_0x453a86[_0xd335('0x40')]);_0x5d306c['filters']=_[_0xd335('0x41')](_0x5d306c[_0xd335('0x3f')],_0x5d306c[_0xd335('0x40')]);_0x63a9e9[_0xd335('0x42')]=_['intersection'](_0x5d306c[_0xd335('0x3f')],qs[_0xd335('0x43')](_0x453a86['query'][_0xd335('0x43')]));_0x63a9e9['attributes']=_0x63a9e9[_0xd335('0x42')]['length']?_0x63a9e9[_0xd335('0x42')]:_0x5d306c[_0xd335('0x3f')];if(!_0x453a86[_0xd335('0x40')][_0xd335('0x69')]('nolimit')){_0x63a9e9[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x453a86[_0xd335('0x40')][_0xd335('0x2c')]);_0x63a9e9[_0xd335('0x2b')]=qs[_0xd335('0x2b')](_0x453a86['query']['offset']);}_0x63a9e9[_0xd335('0x6a')]=qs[_0xd335('0x46')](_0x453a86['query'][_0xd335('0x46')]);_0x63a9e9[_0xd335('0x47')]=qs[_0xd335('0x48')](_[_0xd335('0x49')](_0x453a86['query'],_0x5d306c[_0xd335('0x48')]));_0x63a9e9[_0xd335('0x47')]['FaxAccountId']=_0x18e64c['id'];if(_0x453a86[_0xd335('0x40')]['filter']){_0x63a9e9[_0xd335('0x47')]=_['merge'](_0x63a9e9[_0xd335('0x47')],{'$or':_[_0xd335('0x3a')](_0x63a9e9['attributes'],function(_0x29ae3c){var _0xad03bc={};_0xad03bc[_0x29ae3c]={'$like':'%'+_0x453a86[_0xd335('0x40')][_0xd335('0x4b')]+'%'};return _0xad03bc;})});}_0x63a9e9=_[_0xd335('0x4c')]({},_0x63a9e9,_0x453a86[_0xd335('0x4d')]);return db['CannedAnswer'][_0xd335('0x2e')]({'where':_0x63a9e9[_0xd335('0x47')]})[_0xd335('0x1e')](function(_0x1c5a15){_0x3ed0ef[_0xd335('0x2e')]=_0x1c5a15;if(_0x453a86['query'][_0xd335('0x4e')]){_0x63a9e9['include']=[{'all':!![]}];}return db[_0xd335('0x6e')][_0xd335('0x4f')](_0x63a9e9);})[_0xd335('0x1e')](function(_0x5df51d){_0x3ed0ef[_0xd335('0x50')]=_0x5df51d;return _0x3ed0ef;});}})[_0xd335('0x1e')](respondWithFilteredResult(_0x2739d5,_0x63a9e9))[_0xd335('0x51')](handleError(_0x2739d5,null));};exports[_0xd335('0x6f')]=function(_0x599cee,_0x4511b4,_0x1fb90b){return db[_0xd335('0x3b')][_0xd335('0x58')]({'where':{'id':_0x599cee[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x4511b4,null))['then'](function(_0xa3e2bb){if(_0xa3e2bb){return _0xa3e2bb['removeAnswers'](_0x599cee[_0xd335('0x40')][_0xd335('0x70')]);}})[_0xd335('0x1e')](respondWithStatusCode(_0x4511b4,null))[_0xd335('0x51')](handleError(_0x4511b4,null));};exports[_0xd335('0x71')]=function(_0x349fb0,_0x4af22f,_0x4a555e){return db[_0xd335('0x72')][_0xd335('0x58')]({'where':{'id':_0x349fb0[_0xd335('0x53')]['id']}})['then'](handleEntityNotFound(_0x4af22f,null))['then'](function(_0x51b903){if(_0x51b903){return _0x51b903[_0xd335('0x71')](_0x349fb0[_0xd335('0x5a')][_0xd335('0x70')],_[_0xd335('0x73')](_0x349fb0[_0xd335('0x5a')],[_0xd335('0x70'),'id'])||{});}})['then'](respondWithResult(_0x4af22f,null))['catch'](handleError(_0x4af22f,null));};exports['getInteractions']=function(_0x341cb8,_0x1fb1d4,_0x4ce3bb){var _0x13eb45={'raw':![],'where':{}};var _0x51a808={};var _0x301129={'count':0x0,'rows':[]};return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x341cb8[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x1fb1d4,null))[_0xd335('0x1e')](function(_0x5785a1){if(_0x5785a1){_0x51a808[_0xd335('0x3f')]=_[_0xd335('0x55')](db['FaxInteraction']['rawAttributes']);_0x51a808[_0xd335('0x40')]=_[_0xd335('0x55')](_0x341cb8[_0xd335('0x40')]);_0x51a808[_0xd335('0x48')]=_[_0xd335('0x41')](_0x51a808[_0xd335('0x3f')],_0x51a808[_0xd335('0x40')]);_0x13eb45[_0xd335('0x42')]=_[_0xd335('0x41')](_0x51a808[_0xd335('0x3f')],qs[_0xd335('0x43')](_0x341cb8['query'][_0xd335('0x43')]));_0x13eb45[_0xd335('0x42')]=_0x13eb45[_0xd335('0x42')]['length']?_0x13eb45['attributes']:_0x51a808['model'];if(!_0x341cb8['query'][_0xd335('0x69')](_0xd335('0x45'))){_0x13eb45[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x341cb8[_0xd335('0x40')][_0xd335('0x2c')]);_0x13eb45[_0xd335('0x2b')]=qs[_0xd335('0x2b')](_0x341cb8[_0xd335('0x40')][_0xd335('0x2b')]);}_0x13eb45[_0xd335('0x6a')]=qs[_0xd335('0x46')](_0x341cb8['query'][_0xd335('0x46')]);_0x13eb45['where']=qs[_0xd335('0x48')](_[_0xd335('0x49')](_0x341cb8[_0xd335('0x40')],_0x51a808[_0xd335('0x48')]));_0x13eb45[_0xd335('0x47')]['FaxAccountId']=_0x5785a1['id'];if(_0x341cb8['query']['filter']){_0x13eb45[_0xd335('0x47')]=_['merge'](_0x13eb45[_0xd335('0x47')],{'$or':_[_0xd335('0x3a')](_0x13eb45[_0xd335('0x42')],function(_0x1a753b){var _0x4a605f={};_0x4a605f[_0x1a753b]={'$like':'%'+_0x341cb8['query']['filter']+'%'};return _0x4a605f;})});}_0x13eb45=_[_0xd335('0x4c')]({},_0x13eb45,_0x341cb8[_0xd335('0x4d')]);return db['FaxInteraction'][_0xd335('0x2e')]({'where':_0x13eb45[_0xd335('0x47')]})['then'](function(_0x730cf4){_0x301129[_0xd335('0x2e')]=_0x730cf4;if(_0x341cb8[_0xd335('0x40')][_0xd335('0x4e')]){_0x13eb45[_0xd335('0x57')]=[{'model':db['CmContact'],'as':_0xd335('0x74'),'required':![]},{'model':db[_0xd335('0x75')],'as':_0xd335('0x76'),'attributes':['name',_0xd335('0x77'),_0xd335('0x78')],'required':![]},{'model':db['Tag'],'as':_0xd335('0x79'),'attributes':['id','name',_0xd335('0x7a')],'where':_0x341cb8['query']['tag']?{'id':_0x341cb8[_0xd335('0x40')][_0xd335('0x7b')]}:undefined,'required':_0x341cb8[_0xd335('0x40')][_0xd335('0x7b')]?!![]:![]}];}return db[_0xd335('0x72')][_0xd335('0x4f')](_0x13eb45);})['then'](function(_0x45750c){_0x301129['rows']=_0x45750c;return _0x301129;});}})['then'](respondWithFilteredResult(_0x1fb1d4,_0x13eb45))['catch'](handleError(_0x1fb1d4,null));};exports[_0xd335('0x7c')]=function(_0x4a5fc5,_0x1a3455){var _0x28a4ac=_0x4a5fc5[_0xd335('0x53')]['id'];var _0x2f1b05=_0x4a5fc5['body'];var _0x4b662c=0xc8;var _0x8107b9=null;return db[_0xd335('0x7d')][_0xd335('0x7e')]({'isolationLevel':db['sequelize'][_0xd335('0x7f')][_0xd335('0x80')][_0xd335('0x81')]},function(_0x110866){return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x28a4ac},'transaction':_0x110866})['then'](function(_0x3ccc61){if(_0x3ccc61){return db['FaxApplication'][_0xd335('0x34')]({'where':{'FaxAccountId':_0x28a4ac},'transaction':_0x110866})[_0xd335('0x1e')](function(){var _0x49da22=_['map'](_0x2f1b05,function(_0x43fabd){_0x43fabd[_0xd335('0x6c')]=_0x28a4ac;return _0x43fabd;});return db[_0xd335('0x82')][_0xd335('0x83')](_0x49da22,{'transaction':_0x110866});});}else{_0x4b662c=0x194;_0x8107b9=[];}});})[_0xd335('0x1e')](function(){if(_0x4b662c!==0x194){return db['FaxApplication'][_0xd335('0x84')]({'where':{'FaxAccountId':_0x28a4ac},'order':_0xd335('0x85')})[_0xd335('0x1e')](function(_0xdfe969){_0x8107b9=_0xdfe969;});}})['catch'](function(_0x5dcac9){_0x4b662c=0x1f4;logger[_0xd335('0x24')](_0x5dcac9[_0xd335('0x86')]);if(_0x5dcac9[_0xd335('0x36')]){delete _0x5dcac9[_0xd335('0x36')];}_0x8107b9=_0x5dcac9;})[_0xd335('0x87')](function(){if(_0x8107b9===null){_0x1a3455[_0xd335('0x88')](_0x4b662c);}else{if(_0x4b662c===0x1f4){_0x1a3455[_0xd335('0x28')](_0x4b662c)[_0xd335('0x37')](_0x8107b9);}else{_0x1a3455['status'](_0x4b662c)[_0xd335('0x2a')](_0x8107b9);}}});};exports['getApplications']=function(_0x21bdb5,_0x553d5e,_0x450025){var _0x5b48db={};var _0x58eb0e={};var _0x5f57f4;var _0x3ba4d5;return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x21bdb5[_0xd335('0x53')]['id']}})['then'](handleEntityNotFound(_0x553d5e,null))['then'](function(_0x4c1c4e){if(_0x4c1c4e){_0x5f57f4=_0x4c1c4e;_0x58eb0e[_0xd335('0x3f')]=_[_0xd335('0x55')](db[_0xd335('0x82')][_0xd335('0x56')]);_0x58eb0e[_0xd335('0x40')]=_[_0xd335('0x55')](_0x21bdb5[_0xd335('0x40')]);_0x58eb0e['filters']=_[_0xd335('0x41')](_0x58eb0e['model'],_0x58eb0e[_0xd335('0x40')]);_0x5b48db['attributes']=_[_0xd335('0x41')](_0x58eb0e[_0xd335('0x3f')],qs[_0xd335('0x43')](_0x21bdb5['query'][_0xd335('0x43')]));_0x5b48db['attributes']=_0x5b48db[_0xd335('0x42')][_0xd335('0x44')]?_0x5b48db['attributes']:_0x58eb0e['model'];_0x5b48db[_0xd335('0x6a')]=qs[_0xd335('0x46')](_0x21bdb5['query'][_0xd335('0x46')]);_0x5b48db[_0xd335('0x47')]=qs['filters'](_[_0xd335('0x49')](_0x21bdb5[_0xd335('0x40')],_0x58eb0e['filters']));if(_0x21bdb5[_0xd335('0x40')][_0xd335('0x4b')]){_0x5b48db[_0xd335('0x47')]=_[_0xd335('0x4c')](_0x5b48db['where'],{'$or':_[_0xd335('0x3a')](_0x5b48db[_0xd335('0x42')],function(_0x47f4ff){var _0x550497={};_0x550497[_0x47f4ff]={'$like':'%'+_0x21bdb5[_0xd335('0x40')][_0xd335('0x4b')]+'%'};return _0x550497;})});}_0x5b48db=_['merge']({},_0x5b48db,_0x21bdb5[_0xd335('0x4d')]);return _0x5f57f4['getApplications'](_0x5b48db);}})[_0xd335('0x1e')](function(_0x437533){if(_0x437533){_0x3ba4d5=_0x437533['length'];if(!_0x21bdb5[_0xd335('0x40')]['hasOwnProperty'](_0xd335('0x45'))){_0x5b48db[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x21bdb5[_0xd335('0x40')][_0xd335('0x2c')]);_0x5b48db[_0xd335('0x2b')]=qs[_0xd335('0x2b')](_0x21bdb5[_0xd335('0x40')][_0xd335('0x2b')]);}return _0x5f57f4['getApplications'](_0x5b48db);}})['then'](function(_0x33206c){if(_0x33206c){return _0x33206c?{'count':_0x3ba4d5,'rows':_0x33206c}:null;}})[_0xd335('0x1e')](respondWithResult(_0x553d5e,null))[_0xd335('0x51')](handleError(_0x553d5e,null));};function Extension(_0x430260,_0x47deb3,_0x127e23,_0x60065f){this['context']='from-voip-provider';this[_0xd335('0x89')]=_0x430260[_0xd335('0x8a')];this[_0xd335('0x8b')]=_0x60065f;this[_0xd335('0x3d')]=_0xd335('0x8c');this['description']=_0xd335('0x8d');this[_0xd335('0x6c')]=_0x430260['id'];this[_0xd335('0x85')]=_0x47deb3;this[_0xd335('0x8e')]=_0x127e23;}function createExtensionsReciveFax(_0x5c79d5){var _0x17bfda=0x1;var _0x4aff18=[];_0x4aff18[_0xd335('0x8f')](new Extension(_0x5c79d5,_0x17bfda,'',_0xd335('0x90')));_0x17bfda+=0x1;_0x4aff18[_0xd335('0x8f')](new Extension(_0x5c79d5,_0x17bfda,'CDR(type)=inbound-fax',_0xd335('0x91')));_0x17bfda+=0x1;for(var _0x4ac669 in _0x5c79d5){if(_0x5c79d5['hasOwnProperty'](_0x4ac669)&&(_0x4ac669===_0xd335('0x92')||_0x4ac669===_0xd335('0x8a')||_0x4ac669===_0xd335('0x93')||_0x4ac669===_0xd335('0x94')||_0x4ac669==='headerinfo'||_0x4ac669===_0xd335('0x95')||_0x4ac669==='minrate'||_0x4ac669==='modem'||_0x4ac669===_0xd335('0x96'))){_0x4aff18['push'](new Extension(_0x5c79d5,_0x17bfda,_0xd335('0x97')+_0x4ac669+')='+_0x5c79d5[_0x4ac669],_0xd335('0x91')));_0x17bfda+=0x1;}}_0x4aff18[_0xd335('0x8f')](new Extension(_0x5c79d5,_0x17bfda,'6',_0xd335('0x98')));_0x17bfda+=0x1;_0x4aff18[_0xd335('0x8f')](new Extension(_0x5c79d5,_0x17bfda,_0xd335('0x99'),_0xd335('0x9a')));_0x17bfda=0x0;return _0x4aff18;}exports['addAccountApplications']=function(_0xc25508,_0x5b3b4b,_0x480bad){var _0x20a752;return db[_0xd335('0x7d')][_0xd335('0x7e')](function(_0x1aff61){return db[_0xd335('0x3b')]['create'](_0xc25508[_0xd335('0x5a')],{'transaction':_0x1aff61})[_0xd335('0x1e')](function(_0xe66db9){_0x20a752=_0xe66db9[_0xd335('0x5c')]({'plain':!![]});return db[_0xd335('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x20a752),{'transaction':_0x1aff61});});})['then'](function(){return _0x20a752;})['then'](respondWithResult(_0x5b3b4b,null))[_0xd335('0x51')](handleError(_0x5b3b4b,null));};exports['updateAccountApplications']=function(_0x5dd25b,_0x2321f8,_0x5b0351){var _0x2d113a;return db[_0xd335('0x7d')][_0xd335('0x7e')](function(_0x4a3dea){return db[_0xd335('0x3b')][_0xd335('0x63')](_0x5dd25b[_0xd335('0x5a')],{'where':{'id':_0x5dd25b[_0xd335('0x5a')]['id']},'transaction':_0x4a3dea})[_0xd335('0x1e')](function(_0x492f45){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x5dd25b[_0xd335('0x5a')]['id']},'transaction':_0x4a3dea})[_0xd335('0x1e')](function(_0x251df4){return db[_0xd335('0x9b')][_0xd335('0x83')](createExtensionsReciveFax(_['omit'](_0x5dd25b[_0xd335('0x5a')],[_0xd335('0x9c'),_0xd335('0x3e'),_0xd335('0x9d'),_0xd335('0x9e'),_0xd335('0x9f'),_0xd335('0xa0')])),{'transaction':_0x4a3dea});});});})[_0xd335('0x1e')](function(){return db['FaxAccount'][_0xd335('0xa1')](_0x5dd25b['body']['id']);})[_0xd335('0x1e')](respondWithResult(_0x2321f8,null))[_0xd335('0x51')](handleError(_0x2321f8,null));};exports[_0xd335('0xa2')]=function(_0x5aed60,_0x3c5736,_0x279dd2){var _0x5f0dcd={'raw':!![],'where':{}};var _0x2828fd={};var _0x119966={'count':0x0,'rows':[]};return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x5aed60[_0xd335('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c5736,null))[_0xd335('0x1e')](function(_0x108804){if(_0x108804){_0x2828fd[_0xd335('0x3f')]=_[_0xd335('0x55')](db[_0xd335('0xa3')][_0xd335('0x56')]);_0x2828fd[_0xd335('0x40')]=_['keys'](_0x5aed60[_0xd335('0x40')]);_0x2828fd['filters']=_['intersection'](_0x2828fd[_0xd335('0x3f')],_0x2828fd[_0xd335('0x40')]);_0x5f0dcd[_0xd335('0x42')]=_[_0xd335('0x41')](_0x2828fd['model'],qs[_0xd335('0x43')](_0x5aed60[_0xd335('0x40')][_0xd335('0x43')]));_0x5f0dcd[_0xd335('0x42')]=_0x5f0dcd[_0xd335('0x42')][_0xd335('0x44')]?_0x5f0dcd[_0xd335('0x42')]:_0x2828fd[_0xd335('0x3f')];if(!_0x5aed60['query']['hasOwnProperty']('nolimit')){_0x5f0dcd[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x5aed60[_0xd335('0x40')][_0xd335('0x2c')]);_0x5f0dcd['offset']=qs[_0xd335('0x2b')](_0x5aed60[_0xd335('0x40')][_0xd335('0x2b')]);}_0x5f0dcd[_0xd335('0x6a')]=qs['sort'](_0x5aed60[_0xd335('0x40')]['sort']);_0x5f0dcd[_0xd335('0x47')]=qs[_0xd335('0x48')](_[_0xd335('0x49')](_0x5aed60['query'],_0x2828fd[_0xd335('0x48')]));_0x5f0dcd[_0xd335('0x47')][_0xd335('0x6c')]=_0x108804['id'];if(_0x5aed60[_0xd335('0x40')][_0xd335('0x4b')]){_0x5f0dcd[_0xd335('0x47')]=_[_0xd335('0x4c')](_0x5f0dcd[_0xd335('0x47')],{'$or':_['map'](_0x5f0dcd['attributes'],function(_0x9668fb){var _0xeee128={};_0xeee128[_0x9668fb]={'$like':'%'+_0x5aed60['query'][_0xd335('0x4b')]+'%'};return _0xeee128;})});}if(_0x5aed60[_0xd335('0x40')][_0xd335('0xa4')]){var _0x3251=_0x5aed60[_0xd335('0x40')]['$gte'][_0xd335('0xa5')](',');var _0x1c423f={};_0x1c423f[_0x3251[0x0]]={'$gte':moment(_0x3251[0x1])['format'](_0xd335('0xa6'))};_0x5f0dcd[_0xd335('0x47')]=_[_0xd335('0x4c')](_0x5f0dcd[_0xd335('0x47')],_0x1c423f);}_0x5f0dcd=_['merge']({},_0x5f0dcd,_0x5aed60[_0xd335('0x4d')]);return db[_0xd335('0xa3')][_0xd335('0x2e')]({'where':_0x5f0dcd[_0xd335('0x47')]})['then'](function(_0x3bff0b){_0x119966['count']=_0x3bff0b;if(_0x5aed60[_0xd335('0x40')][_0xd335('0x4e')]){_0x5f0dcd[_0xd335('0x57')]=[{'all':!![]}];}return db[_0xd335('0xa3')][_0xd335('0x4f')](_0x5f0dcd);})['then'](function(_0x333e4c){_0x119966[_0xd335('0x50')]=_0x333e4c;return _0x119966;});}})[_0xd335('0x1e')](respondWithFilteredResult(_0x3c5736,_0x5f0dcd))[_0xd335('0x51')](handleError(_0x3c5736,null));};exports['send']=function(_0x33ff81,_0x4c5aff,_0xabff6){var _0x539a79,_0x5d194a={},_0xf99ce6;if(_0x33ff81[_0xd335('0x5a')]['to']){_0xf99ce6=_0x33ff81['body']['to'][0x0];}return db[_0xd335('0x3b')]['find']({'where':{'id':_0x33ff81[_0xd335('0x53')]['id']},'include':[{'model':db[_0xd335('0xa7')],'as':'List','include':[{'model':db[_0xd335('0xa8')],'as':_0xd335('0xa9'),'where':{'fax':_0xf99ce6},'limit':0x1,'order':[[_0xd335('0x9e'),_0xd335('0xaa')]]}]}]})[_0xd335('0x1e')](handleEntityNotFound(_0x4c5aff,null))[_0xd335('0x1e')](function(_0x1e6405){_0x539a79=_0x1e6405;if(_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')]&&_0x33ff81[_0xd335('0x5a')]['attachments'][_0xd335('0x44')]){for(var _0x54cb47=0x0;_0x54cb47<_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][_0xd335('0x44')];_0x54cb47+=0x1){_0x33ff81['body'][_0xd335('0xab')][_0x54cb47]={'filename':_0x33ff81[_0xd335('0x5a')]['attachments'][_0x54cb47]['name'],'id':_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][_0x54cb47]['id'],'path':path[_0xd335('0xac')](config[_0xd335('0xad')],_0xd335('0xae'),_0x33ff81['body'][_0xd335('0xab')][_0x54cb47][_0xd335('0xaf')])};}}return respondWithRpcPromise(_0xd335('0xb0'),_0xd335('0xb0'),{'FaxAccountId':_[_0xd335('0xb1')](_0x33ff81['params']['id'])?undefined:_0x33ff81[_0xd335('0x53')]['id'],'path':_[_0xd335('0xb1')](_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][0x0]['path'])?undefined:_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][0x0]['path'],'fax':_['isNil'](_0x33ff81['body']['to'][0x0])?undefined:_0x33ff81[_0xd335('0x5a')]['to'][0x0]},client9002);})[_0xd335('0x1e')](function(){if(_0x539a79){if(_['isNil'](_0x33ff81[_0xd335('0x5a')][_0xd335('0xb2')])){_0x33ff81[_0xd335('0x5a')][_0xd335('0xb2')]=util[_0xd335('0xb3')](_0xd335('0xb4'),_0x539a79[_0xd335('0x36')],_0x539a79[_0xd335('0xb5')]);}if(_0x539a79[_0xd335('0xb6')]){if(_0x539a79['List'][_0xd335('0xa9')][_0xd335('0x44')]){return _0x539a79[_0xd335('0xb6')]['Contacts'][0x0];}else{return db[_0xd335('0xa8')][_0xd335('0x59')](_['defaults'](_0x33ff81[_0xd335('0x5a')],{'firstName':_0x33ff81[_0xd335('0x5a')]['to'][0x0],'phone':_0x33ff81['body']['to'][0x0],'fax':_0x33ff81[_0xd335('0x5a')]['to'][0x0],'ListId':_0x539a79['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xd335('0xb7'));}})[_0xd335('0x1e')](function(_0x1823f5){if(_0x1823f5){return db[_0xd335('0x72')][_0xd335('0x58')]({'where':{'ContactId':_0x1823f5['id'],'closed':![],'FaxAccountId':_0x539a79['id']}})[_0xd335('0x1e')](function(_0x264510){if(_0x264510){return[_0x264510,![]];}return db['FaxInteraction'][_0xd335('0x59')]({'UserId':_0x33ff81[_0xd335('0x5b')]['id'],'ContactId':_0x1823f5['id'],'FaxAccountId':_0x539a79['id'],'fax':_0x33ff81[_0xd335('0x5a')]['to'][0x0],'firstMsgDirection':_0xd335('0xb8'),'Messages':[_['merge'](_0x33ff81[_0xd335('0x5a')],{'read':![],'body':_0x33ff81['body'][_0xd335('0xab')][0x0][_0xd335('0xb9')],'FaxAccountId':_0x539a79['id'],'UserId':_0x33ff81[_0xd335('0x5b')]['id'],'ContactId':_0x1823f5['id'],'AttachmentId':_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xd335('0x1e')](function(_0x353ccb){return[_0x353ccb,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd335('0xba')](function(_0x78adbe,_0x2ca3b9){if(_0x2ca3b9){return _0x78adbe;}return db[_0xd335('0xa3')][_0xd335('0x59')]({'direction':_0xd335('0xb8'),'read':![],'body':_0x33ff81['body'][_0xd335('0xab')][0x0][_0xd335('0xb9')],'FaxAccountId':_0x539a79['id'],'FaxInteractionId':_0x78adbe['id'],'UserId':_0x33ff81[_0xd335('0x5b')]['id'],'ContactId':_0x78adbe[_0xd335('0xbb')],'AttachmentId':_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][0x0]['id']})[_0xd335('0x1e')](function(_0x21c8ea){_0x78adbe[_0xd335('0xbc')][_0xd335('0xbd')]=[];_0x78adbe[_0xd335('0xbc')][_0xd335('0xbd')][_0xd335('0x8f')](_0x21c8ea[_0xd335('0xbc')]);return _0x78adbe;});})[_0xd335('0x1e')](function(_0x104781){respondWithRpcPromise(_0xd335('0xbe'),_0xd335('0xbe'),{'FaxAccountId':_[_0xd335('0xb1')](_0x33ff81[_0xd335('0x53')]['id'])?undefined:_0x33ff81[_0xd335('0x53')]['id'],'path':_[_0xd335('0xb1')](_0x33ff81['body']['attachments'][0x0][_0xd335('0x5')])?undefined:_0x33ff81['body']['attachments'][0x0][_0xd335('0x5')],'fax':_[_0xd335('0xb1')](_0x33ff81['body']['to'][0x0])?undefined:_0x33ff81[_0xd335('0x5a')]['to'][0x0],'AttachmentId':_0x33ff81[_0xd335('0x5a')][_0xd335('0xab')][0x0]['id']},client9002)[_0xd335('0x1e')](function(_0x42f9b0){logger[_0xd335('0x1f')]('SendFaxRpc,\x20%s',_0x42f9b0);})[_0xd335('0x51')](function(_0x44914b){logger['info'](_0xd335('0xbf'),_0x44914b);});return _0x104781;})[_0xd335('0x1e')](respondWithResult(_0x4c5aff,null))[_0xd335('0x51')](handleError(_0x4c5aff,null));};exports[_0xd335('0xc0')]=function(_0x5737b0,_0x1e08da,_0x8bb901){return db[_0xd335('0x3b')][_0xd335('0x58')]({'where':{'id':_0x5737b0['params']['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x1e08da,null))[_0xd335('0x1e')](function(_0x17d4ea){if(_0x17d4ea){return _0x17d4ea['addAgents'](_0x5737b0[_0xd335('0x5a')][_0xd335('0x70')],_[_0xd335('0x73')](_0x5737b0[_0xd335('0x5a')],[_0xd335('0x70'),'id'])||{})[_0xd335('0xba')](function(_0x434972){for(var _0x2fe82e=0x0;_0x2fe82e<_0x5737b0['body']['ids'][_0xd335('0x44')];_0x2fe82e+=0x1){socket[_0xd335('0xc1')](_0xd335('0xc2'),{'UserId':Number(_0x5737b0['body'][_0xd335('0x70')][_0x2fe82e]),'FaxAccountId':Number(_0x5737b0['params']['id'])});}return _0x434972;});}})[_0xd335('0x1e')](respondWithResult(_0x1e08da,null))[_0xd335('0x51')](handleError(_0x1e08da,null));};exports[_0xd335('0xc3')]=function(_0x4d73b3,_0x4171df,_0x500821){return db['FaxAccount']['find']({'where':{'id':_0x4d73b3[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x4171df,null))['then'](function(_0x365d74){if(_0x365d74){return _0x365d74[_0xd335('0xc3')](_0x4d73b3[_0xd335('0x40')][_0xd335('0x70')])[_0xd335('0x1e')](function(){if(_['isArray'](_0x4d73b3['query'][_0xd335('0x70')])){for(var _0x2b0a5c=0x0;_0x2b0a5c<_0x4d73b3['query'][_0xd335('0x70')]['length'];_0x2b0a5c+=0x1){socket[_0xd335('0xc1')](_0xd335('0xc4'),{'UserId':Number(_0x4d73b3[_0xd335('0x40')][_0xd335('0x70')][_0x2b0a5c]),'FaxAccountId':Number(_0x4d73b3['params']['id'])});}}else{socket[_0xd335('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x4d73b3[_0xd335('0x40')][_0xd335('0x70')]),'FaxAccountId':Number(_0x4d73b3[_0xd335('0x53')]['id'])});}});}})[_0xd335('0x1e')](respondWithStatusCode(_0x4171df,null))['catch'](handleError(_0x4171df,null));};exports[_0xd335('0xc5')]=function(_0x1edb04,_0x31436d,_0x37b33f){var _0x573505={};var _0x30d7fa={};var _0x446090;var _0x1ede9b;return db[_0xd335('0x3b')][_0xd335('0x68')]({'where':{'id':_0x1edb04[_0xd335('0x53')]['id']}})[_0xd335('0x1e')](handleEntityNotFound(_0x31436d,null))['then'](function(_0xcde6a9){if(_0xcde6a9){_0x446090=_0xcde6a9;_0x30d7fa[_0xd335('0x3f')]=_['keys'](db[_0xd335('0x75')][_0xd335('0x56')]);_0x30d7fa[_0xd335('0x40')]=_['keys'](_0x1edb04[_0xd335('0x40')]);_0x30d7fa[_0xd335('0x48')]=_[_0xd335('0x41')](_0x30d7fa[_0xd335('0x3f')],_0x30d7fa[_0xd335('0x40')]);_0x573505['attributes']=_['intersection'](_0x30d7fa[_0xd335('0x3f')],qs[_0xd335('0x43')](_0x1edb04[_0xd335('0x40')][_0xd335('0x43')]));_0x573505['attributes']=_0x573505[_0xd335('0x42')]['length']?_0x573505[_0xd335('0x42')]:_0x30d7fa['model'];_0x573505[_0xd335('0x6a')]=qs[_0xd335('0x46')](_0x1edb04[_0xd335('0x40')][_0xd335('0x46')]);_0x573505[_0xd335('0x47')]=qs[_0xd335('0x48')](_[_0xd335('0x49')](_0x1edb04[_0xd335('0x40')],_0x30d7fa['filters']));if(_0x1edb04[_0xd335('0x40')][_0xd335('0x4b')]){_0x573505[_0xd335('0x47')]=_[_0xd335('0x4c')](_0x573505[_0xd335('0x47')],{'$or':_[_0xd335('0x3a')](_0x573505[_0xd335('0x42')],function(_0x3a036b){var _0x1c47a2={};_0x1c47a2[_0x3a036b]={'$like':'%'+_0x1edb04[_0xd335('0x40')]['filter']+'%'};return _0x1c47a2;})});}_0x573505=_[_0xd335('0x4c')]({},_0x573505,_0x1edb04[_0xd335('0x4d')]);return _0x446090[_0xd335('0xc5')](_0x573505);}})['then'](function(_0x46febc){if(_0x46febc){_0x1ede9b=_0x46febc[_0xd335('0x44')];if(!_0x1edb04[_0xd335('0x40')]['hasOwnProperty'](_0xd335('0x45'))){_0x573505[_0xd335('0x2c')]=qs[_0xd335('0x2c')](_0x1edb04['query']['limit']);_0x573505[_0xd335('0x2b')]=qs[_0xd335('0x2b')](_0x1edb04['query'][_0xd335('0x2b')]);}return _0x446090[_0xd335('0xc5')](_0x573505);}})['then'](function(_0x51c422){if(_0x51c422){return _0x51c422?{'count':_0x1ede9b,'rows':_0x51c422}:null;}})[_0xd335('0x1e')](respondWithResult(_0x31436d,null))[_0xd335('0x51')](handleError(_0x31436d,null));}; \ No newline at end of file +var _0x076f=['system','description','Answer','push','CDR(type)=inbound-fax','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','omit','createdAt','TrunkId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','isNil','path','fax','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','ids','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','app'];(function(_0x46875d,_0xaf6fc3){var _0x304a74=function(_0x30284a){while(--_0x30284a){_0x46875d['push'](_0x46875d['shift']());}};_0x304a74(++_0xaf6fc3);}(_0x076f,0x1c7));var _0xf076=function(_0x4c5e8b,_0x11b9fa){_0x4c5e8b=_0x4c5e8b-0x0;var _0x3ca42e=_0x076f[_0x4c5e8b];return _0x3ca42e;};'use strict';var emlformat=require(_0xf076('0x0'));var rimraf=require(_0xf076('0x1'));var zipdir=require(_0xf076('0x2'));var jsonpatch=require(_0xf076('0x3'));var rp=require(_0xf076('0x4'));var moment=require(_0xf076('0x5'));var BPromise=require(_0xf076('0x6'));var Mustache=require(_0xf076('0x7'));var util=require(_0xf076('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf076('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf076('0xa'));var crypto=require('crypto');var jsforce=require(_0xf076('0xb'));var deskjs=require(_0xf076('0xc'));var toCsv=require(_0xf076('0xd'));var querystring=require(_0xf076('0xe'));var Papa=require(_0xf076('0xf'));var Redis=require(_0xf076('0x10'));var authService=require(_0xf076('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf076('0x12'));var hardwareService=require(_0xf076('0x13'));var logger=require(_0xf076('0x14'))('api');var utils=require(_0xf076('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf076('0x16'))['db'];config[_0xf076('0x17')]=_[_0xf076('0x18')](config['redis'],{'host':_0xf076('0x19'),'port':0x18eb});var socket=require(_0xf076('0x1a'))(new Redis(config[_0xf076('0x17')]));require(_0xf076('0x1b'))['register'](socket);var jayson=require(_0xf076('0x1c'));var client=jayson[_0xf076('0x1d')][_0xf076('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x404892,_0xd3cf19,_0x458cf6,_0x11def3){return new BPromise(function(_0x45feb2,_0x16ab4e){var _0x199b07=_0x11def3||client;return _0x199b07[_0xf076('0x1f')](_0x404892,_0x458cf6)[_0xf076('0x20')](function(_0x37e9fe){logger['info'](_0xf076('0x21'),_0xd3cf19,'request\x20sent');logger[_0xf076('0x22')](_0xf076('0x23'),_0xd3cf19,_0xf076('0x24'),JSON['stringify'](_0x37e9fe));if(_0x37e9fe[_0xf076('0x25')]){if(_0x37e9fe[_0xf076('0x25')][_0xf076('0x26')]===0x1f4){logger[_0xf076('0x25')](_0xf076('0x21'),_0xd3cf19,_0x37e9fe[_0xf076('0x25')][_0xf076('0x27')]);return _0x16ab4e(_0x37e9fe['error'][_0xf076('0x27')]);}logger[_0xf076('0x25')](_0xf076('0x21'),_0xd3cf19,_0x37e9fe['error'][_0xf076('0x27')]);return _0x45feb2(_0x37e9fe[_0xf076('0x25')]['message']);}else{logger[_0xf076('0x28')](_0xf076('0x21'),_0xd3cf19,_0xf076('0x24'));_0x45feb2(_0x37e9fe[_0xf076('0x29')][_0xf076('0x27')]);}})[_0xf076('0x2a')](function(_0x545480){logger[_0xf076('0x25')](_0xf076('0x21'),_0xd3cf19,_0x545480);_0x16ab4e(_0x545480);});});}function respondWithStatusCode(_0x11f52c,_0x1f6002){_0x1f6002=_0x1f6002||0xcc;return function(_0x4be102){if(_0x4be102){return _0x11f52c[_0xf076('0x2b')](_0x1f6002);}return _0x11f52c[_0xf076('0x2c')](_0x1f6002)[_0xf076('0x2d')]();};}function respondWithResult(_0x768501,_0x967b34){_0x967b34=_0x967b34||0xc8;return function(_0x100e03){if(_0x100e03){return _0x768501[_0xf076('0x2c')](_0x967b34)[_0xf076('0x2e')](_0x100e03);}};}function respondWithFilteredResult(_0x5f411e,_0x40c4dd){return function(_0x29157d){if(_0x29157d){var _0x215e27=typeof _0x40c4dd[_0xf076('0x2f')]==='undefined'&&typeof _0x40c4dd[_0xf076('0x30')]==='undefined';var _0x5b4978=_0x29157d[_0xf076('0x31')];var _0x48838f=_0x215e27?0x0:_0x40c4dd[_0xf076('0x2f')];var _0x23a842=_0x215e27?_0x29157d[_0xf076('0x31')]:_0x40c4dd[_0xf076('0x2f')]+_0x40c4dd[_0xf076('0x30')];var _0x358af4;if(_0x23a842>=_0x5b4978){_0x23a842=_0x5b4978;_0x358af4=0xc8;}else{_0x358af4=0xce;}_0x5f411e[_0xf076('0x2c')](_0x358af4);return _0x5f411e[_0xf076('0x32')](_0xf076('0x33'),_0x48838f+'-'+_0x23a842+'/'+_0x5b4978)[_0xf076('0x2e')](_0x29157d);}return null;};}function patchUpdates(_0x17c97e){return function(_0x41d829){try{jsonpatch[_0xf076('0x34')](_0x41d829,_0x17c97e,!![]);}catch(_0x112d1d){return BPromise['reject'](_0x112d1d);}return _0x41d829['save']();};}function saveUpdates(_0xcd4361,_0xb0ae5e){return function(_0x59fecd){if(_0x59fecd){return _0x59fecd[_0xf076('0x35')](_0xcd4361)['then'](function(_0x3e354d){return _0x3e354d;});}return null;};}function removeEntity(_0x1d4422,_0x1429cf){return function(_0x32d363){if(_0x32d363){return _0x32d363[_0xf076('0x36')]()[_0xf076('0x20')](function(){var _0x1b9a91=_0x32d363['get']({'plain':!![]});var _0x27bbf4=_0xf076('0x37');return db[_0xf076('0x38')][_0xf076('0x36')]({'where':{'type':_0x27bbf4,'resourceId':_0x1b9a91['id']}})[_0xf076('0x20')](function(){return _0x32d363;});})[_0xf076('0x20')](function(){_0x1d4422[_0xf076('0x2c')](0xcc)[_0xf076('0x2d')]();});}};}function handleEntityNotFound(_0x480445,_0x45a503){return function(_0xb65214){if(!_0xb65214){_0x480445[_0xf076('0x2b')](0x194);}return _0xb65214;};}function handleError(_0x3f2a5b,_0x4ecb08){_0x4ecb08=_0x4ecb08||0x1f4;return function(_0x146752){logger[_0xf076('0x25')](_0x146752[_0xf076('0x39')]);if(_0x146752[_0xf076('0x3a')]){delete _0x146752[_0xf076('0x3a')];}_0x3f2a5b['status'](_0x4ecb08)[_0xf076('0x3b')](_0x146752);};}exports['index']=function(_0x40b4ac,_0x579637){var _0x26718e={'include':[{'model':db[_0xf076('0x3c')],'as':_0xf076('0x3d')}]},_0x3fac65={},_0x2ef33e={'count':0x0,'rows':[]};var _0x1eef69=_[_0xf076('0x3e')](db[_0xf076('0x3f')][_0xf076('0x40')],function(_0x5d5ad4){return{'name':_0x5d5ad4['fieldName'],'type':_0x5d5ad4[_0xf076('0x41')][_0xf076('0x42')]};});_0x3fac65['model']=_[_0xf076('0x3e')](_0x1eef69,_0xf076('0x3a'));_0x3fac65[_0xf076('0x43')]=_['keys'](_0x40b4ac[_0xf076('0x43')]);_0x3fac65['filters']=_[_0xf076('0x44')](_0x3fac65[_0xf076('0x45')],_0x3fac65['query']);_0x26718e[_0xf076('0x46')]=_[_0xf076('0x44')](_0x3fac65['model'],qs[_0xf076('0x47')](_0x40b4ac[_0xf076('0x43')][_0xf076('0x47')]));_0x26718e['attributes']=_0x26718e[_0xf076('0x46')][_0xf076('0x48')]?_0x26718e[_0xf076('0x46')]:_0x3fac65[_0xf076('0x45')];if(!_0x40b4ac[_0xf076('0x43')][_0xf076('0x49')](_0xf076('0x4a'))){_0x26718e[_0xf076('0x30')]=qs['limit'](_0x40b4ac[_0xf076('0x43')][_0xf076('0x30')]);_0x26718e[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x40b4ac[_0xf076('0x43')][_0xf076('0x2f')]);}_0x26718e['order']=qs[_0xf076('0x4b')](_0x40b4ac['query'][_0xf076('0x4b')]);_0x26718e[_0xf076('0x4c')]=qs['filters'](_[_0xf076('0x4d')](_0x40b4ac[_0xf076('0x43')],_0x3fac65[_0xf076('0x4e')]),_0x1eef69);if(_0x40b4ac['query'][_0xf076('0x4f')]){_0x26718e['where']=_['merge'](_0x26718e[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x1eef69,function(_0xeb0fea){if(_0xeb0fea[_0xf076('0x41')]!=='VIRTUAL'){var _0xae7153={};_0xae7153[_0xeb0fea[_0xf076('0x3a')]]={'$like':'%'+_0x40b4ac[_0xf076('0x43')]['filter']+'%'};return _0xae7153;}})});}_0x26718e=_[_0xf076('0x50')]({},_0x26718e,_0x40b4ac[_0xf076('0x51')]);var _0x2dd242={'where':_0x26718e[_0xf076('0x4c')]};return db[_0xf076('0x3f')][_0xf076('0x31')](_0x2dd242)[_0xf076('0x20')](function(_0x11a52c){_0x2ef33e[_0xf076('0x31')]=_0x11a52c;if(_0x40b4ac['query'][_0xf076('0x52')]){_0x26718e[_0xf076('0x53')]=[{'all':!![]}];}return db[_0xf076('0x3f')][_0xf076('0x54')](_0x26718e);})[_0xf076('0x20')](function(_0x47cff2){_0x2ef33e['rows']=_0x47cff2;return _0x2ef33e;})[_0xf076('0x20')](respondWithFilteredResult(_0x579637,_0x26718e))[_0xf076('0x2a')](handleError(_0x579637,null));};exports[_0xf076('0x55')]=function(_0x5f5dc6,_0x42e2db){var _0x3f3106={'raw':![],'where':{'id':_0x5f5dc6[_0xf076('0x56')]['id']},'include':[{'model':db[_0xf076('0x3c')],'as':_0xf076('0x3d')}]},_0x63e07d={};_0x63e07d[_0xf076('0x45')]=_['keys'](db[_0xf076('0x3f')][_0xf076('0x40')]);_0x63e07d['query']=_[_0xf076('0x57')](_0x5f5dc6[_0xf076('0x43')]);_0x63e07d[_0xf076('0x4e')]=_[_0xf076('0x44')](_0x63e07d['model'],_0x63e07d[_0xf076('0x43')]);_0x3f3106['attributes']=_[_0xf076('0x44')](_0x63e07d[_0xf076('0x45')],qs[_0xf076('0x47')](_0x5f5dc6[_0xf076('0x43')][_0xf076('0x47')]));_0x3f3106['attributes']=_0x3f3106[_0xf076('0x46')][_0xf076('0x48')]?_0x3f3106['attributes']:_0x63e07d[_0xf076('0x45')];if(_0x5f5dc6[_0xf076('0x43')][_0xf076('0x52')]){_0x3f3106[_0xf076('0x53')]=[{'all':!![]}];}_0x3f3106=_[_0xf076('0x50')]({},_0x3f3106,_0x5f5dc6[_0xf076('0x51')]);return db['FaxAccount'][_0xf076('0x58')](_0x3f3106)[_0xf076('0x20')](handleEntityNotFound(_0x42e2db,null))[_0xf076('0x20')](respondWithResult(_0x42e2db,null))[_0xf076('0x2a')](handleError(_0x42e2db,null));};exports[_0xf076('0x59')]=function(_0x30244f,_0x4a3da3){return db[_0xf076('0x3f')][_0xf076('0x59')](_0x30244f[_0xf076('0x5a')],{})[_0xf076('0x20')](function(_0x5ed2cb){var _0x4bd475=_0x30244f[_0xf076('0x5b')]['get']({'plain':!![]});if(!_0x4bd475)throw new Error(_0xf076('0x5c'));if(_0x4bd475[_0xf076('0x5d')]===_0xf076('0x5b')){var _0x3db3c2=_0x5ed2cb[_0xf076('0x5e')]({'plain':!![]});var _0x56b2aa=_0xf076('0x37');return db[_0xf076('0x5f')][_0xf076('0x58')]({'where':{'name':_0x56b2aa,'userProfileId':_0x4bd475[_0xf076('0x60')]},'raw':!![]})[_0xf076('0x20')](function(_0x3e93ef){if(_0x3e93ef&&_0x3e93ef['autoAssociation']===0x0){return db['UserProfileResource'][_0xf076('0x59')]({'name':_0x3db3c2[_0xf076('0x3a')],'resourceId':_0x3db3c2['id'],'type':_0x3e93ef[_0xf076('0x3a')],'sectionId':_0x3e93ef['id']},{})[_0xf076('0x20')](function(){return _0x5ed2cb;});}else{return _0x5ed2cb;}})['catch'](function(_0x4fec3f){logger['error'](_0xf076('0x61'),_0x4fec3f);throw _0x4fec3f;});}return _0x5ed2cb;})['then'](respondWithResult(_0x4a3da3,0xc9))[_0xf076('0x2a')](handleError(_0x4a3da3,null));};exports[_0xf076('0x35')]=function(_0x39b329,_0x5b60b6){if(_0x39b329[_0xf076('0x5a')]['id']){delete _0x39b329[_0xf076('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x39b329['params']['id']},'include':[{'model':db[_0xf076('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xf076('0x20')](handleEntityNotFound(_0x5b60b6,null))[_0xf076('0x20')](saveUpdates(_0x39b329[_0xf076('0x5a')],null))['then'](respondWithResult(_0x5b60b6,null))[_0xf076('0x2a')](handleError(_0x5b60b6,null));};exports[_0xf076('0x36')]=function(_0x46ee97,_0x3f47e0){return db[_0xf076('0x3f')][_0xf076('0x58')]({'where':{'id':_0x46ee97['params']['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x3f47e0,null))[_0xf076('0x20')](removeEntity(_0x3f47e0,null))[_0xf076('0x2a')](handleError(_0x3f47e0,null));};exports[_0xf076('0x62')]=function(_0x30502e,_0x501952){return db['FaxAccount'][_0xf076('0x62')]()['then'](respondWithResult(_0x501952,null))[_0xf076('0x2a')](handleError(_0x501952,null));};exports[_0xf076('0x63')]=function(_0x22eb4b,_0xeb7f0a,_0x1fa944){if(_0x22eb4b[_0xf076('0x5a')]['id']){delete _0x22eb4b[_0xf076('0x5a')]['id'];}return db[_0xf076('0x3f')][_0xf076('0x58')]({'where':{'id':_0x22eb4b[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0xeb7f0a,null))['then'](function(_0x16a3d5){if(_0x16a3d5){_0x22eb4b[_0xf076('0x5a')][_0xf076('0x64')]=_0x16a3d5['id'];return db[_0xf076('0x65')][_0xf076('0x59')](_0x22eb4b[_0xf076('0x5a')]);}})['then'](respondWithResult(_0xeb7f0a,null))[_0xf076('0x2a')](handleError(_0xeb7f0a,null));};exports[_0xf076('0x66')]=function(_0x35b0cf,_0xee9281,_0x4ddd15){var _0x5818b2={'raw':![],'where':{}};var _0x1ad61b={};var _0x4d71c2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf076('0x67')]({'where':{'id':_0x35b0cf['params']['id']}})[_0xf076('0x20')](handleEntityNotFound(_0xee9281,null))[_0xf076('0x20')](function(_0x51bd4e){if(_0x51bd4e){_0x1ad61b[_0xf076('0x45')]=_[_0xf076('0x57')](db[_0xf076('0x65')][_0xf076('0x40')]);_0x1ad61b[_0xf076('0x43')]=_[_0xf076('0x57')](_0x35b0cf[_0xf076('0x43')]);_0x1ad61b[_0xf076('0x4e')]=_[_0xf076('0x44')](_0x1ad61b[_0xf076('0x45')],_0x1ad61b['query']);_0x5818b2['attributes']=_[_0xf076('0x44')](_0x1ad61b[_0xf076('0x45')],qs[_0xf076('0x47')](_0x35b0cf[_0xf076('0x43')][_0xf076('0x47')]));_0x5818b2[_0xf076('0x46')]=_0x5818b2[_0xf076('0x46')][_0xf076('0x48')]?_0x5818b2['attributes']:_0x1ad61b['model'];if(!_0x35b0cf['query'][_0xf076('0x49')](_0xf076('0x4a'))){_0x5818b2[_0xf076('0x30')]=qs[_0xf076('0x30')](_0x35b0cf[_0xf076('0x43')][_0xf076('0x30')]);_0x5818b2[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x35b0cf[_0xf076('0x43')][_0xf076('0x2f')]);}_0x5818b2[_0xf076('0x68')]=qs[_0xf076('0x4b')](_0x35b0cf['query'][_0xf076('0x4b')]);_0x5818b2[_0xf076('0x4c')]=qs[_0xf076('0x4e')](_['pick'](_0x35b0cf['query'],_0x1ad61b[_0xf076('0x4e')]));_0x5818b2['where']['FaxAccountId']=_0x51bd4e['id'];if(_0x35b0cf[_0xf076('0x43')][_0xf076('0x4f')]){_0x5818b2['where']=_[_0xf076('0x50')](_0x5818b2[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x5818b2[_0xf076('0x46')],function(_0x43f85c){var _0x587670={};_0x587670[_0x43f85c]={'$like':'%'+_0x35b0cf[_0xf076('0x43')][_0xf076('0x4f')]+'%'};return _0x587670;})});}_0x5818b2=_[_0xf076('0x50')]({},_0x5818b2,_0x35b0cf[_0xf076('0x51')]);return db[_0xf076('0x65')]['count']({'where':_0x5818b2['where']})[_0xf076('0x20')](function(_0x33883c){_0x4d71c2[_0xf076('0x31')]=_0x33883c;if(_0x35b0cf[_0xf076('0x43')][_0xf076('0x52')]){_0x5818b2[_0xf076('0x53')]=[{'all':!![]}];}return db[_0xf076('0x65')][_0xf076('0x54')](_0x5818b2);})['then'](function(_0x18d18e){_0x4d71c2[_0xf076('0x69')]=_0x18d18e;return _0x4d71c2;});}})[_0xf076('0x20')](respondWithFilteredResult(_0xee9281,_0x5818b2))[_0xf076('0x2a')](handleError(_0xee9281,null));};exports[_0xf076('0x6a')]=function(_0x5548cf,_0x404872,_0x38640e){return db[_0xf076('0x3f')][_0xf076('0x58')]({'where':{'id':_0x5548cf[_0xf076('0x56')]['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x404872,null))['then'](function(_0x1147b8){if(_0x1147b8){return _0x1147b8['removeDispositions'](_0x5548cf[_0xf076('0x43')]['ids']);}})[_0xf076('0x20')](respondWithStatusCode(_0x404872,null))[_0xf076('0x2a')](handleError(_0x404872,null));};exports['addAnswer']=function(_0x333e82,_0x5e0ce2,_0x40805b){if(_0x333e82[_0xf076('0x5a')]['id']){delete _0x333e82['body']['id'];}return db[_0xf076('0x3f')][_0xf076('0x58')]({'where':{'id':_0x333e82[_0xf076('0x56')]['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x5e0ce2,null))[_0xf076('0x20')](function(_0x322537){if(_0x322537){_0x333e82[_0xf076('0x5a')]['FaxAccountId']=_0x322537['id'];return db[_0xf076('0x6b')][_0xf076('0x59')](_0x333e82[_0xf076('0x5a')]);}})[_0xf076('0x20')](respondWithResult(_0x5e0ce2,null))['catch'](handleError(_0x5e0ce2,null));};exports[_0xf076('0x6c')]=function(_0x5b7605,_0x2d9def,_0x31d803){var _0x33d461={'raw':![],'where':{}};var _0x4a1def={};var _0x1f5fc4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf076('0x67')]({'where':{'id':_0x5b7605['params']['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x2d9def,null))[_0xf076('0x20')](function(_0x560d6b){if(_0x560d6b){_0x4a1def['model']=_['keys'](db[_0xf076('0x6b')][_0xf076('0x40')]);_0x4a1def[_0xf076('0x43')]=_[_0xf076('0x57')](_0x5b7605[_0xf076('0x43')]);_0x4a1def[_0xf076('0x4e')]=_['intersection'](_0x4a1def[_0xf076('0x45')],_0x4a1def[_0xf076('0x43')]);_0x33d461[_0xf076('0x46')]=_[_0xf076('0x44')](_0x4a1def[_0xf076('0x45')],qs['fields'](_0x5b7605[_0xf076('0x43')]['fields']));_0x33d461[_0xf076('0x46')]=_0x33d461[_0xf076('0x46')][_0xf076('0x48')]?_0x33d461['attributes']:_0x4a1def[_0xf076('0x45')];if(!_0x5b7605['query'][_0xf076('0x49')](_0xf076('0x4a'))){_0x33d461[_0xf076('0x30')]=qs[_0xf076('0x30')](_0x5b7605[_0xf076('0x43')][_0xf076('0x30')]);_0x33d461[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x5b7605[_0xf076('0x43')][_0xf076('0x2f')]);}_0x33d461[_0xf076('0x68')]=qs[_0xf076('0x4b')](_0x5b7605[_0xf076('0x43')]['sort']);_0x33d461[_0xf076('0x4c')]=qs[_0xf076('0x4e')](_['pick'](_0x5b7605['query'],_0x4a1def['filters']));_0x33d461[_0xf076('0x4c')]['FaxAccountId']=_0x560d6b['id'];if(_0x5b7605[_0xf076('0x43')]['filter']){_0x33d461[_0xf076('0x4c')]=_[_0xf076('0x50')](_0x33d461[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x33d461[_0xf076('0x46')],function(_0x44f3d7){var _0x39e060={};_0x39e060[_0x44f3d7]={'$like':'%'+_0x5b7605[_0xf076('0x43')][_0xf076('0x4f')]+'%'};return _0x39e060;})});}_0x33d461=_[_0xf076('0x50')]({},_0x33d461,_0x5b7605[_0xf076('0x51')]);return db[_0xf076('0x6b')][_0xf076('0x31')]({'where':_0x33d461['where']})[_0xf076('0x20')](function(_0x2285d7){_0x1f5fc4['count']=_0x2285d7;if(_0x5b7605[_0xf076('0x43')][_0xf076('0x52')]){_0x33d461['include']=[{'all':!![]}];}return db[_0xf076('0x6b')]['findAll'](_0x33d461);})[_0xf076('0x20')](function(_0x9d227a){_0x1f5fc4['rows']=_0x9d227a;return _0x1f5fc4;});}})['then'](respondWithFilteredResult(_0x2d9def,_0x33d461))[_0xf076('0x2a')](handleError(_0x2d9def,null));};exports['removeAnswers']=function(_0x7a0fe2,_0x23bc4d,_0x33796e){return db[_0xf076('0x3f')]['find']({'where':{'id':_0x7a0fe2[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0x23bc4d,null))['then'](function(_0x41d055){if(_0x41d055){return _0x41d055[_0xf076('0x6d')](_0x7a0fe2['query']['ids']);}})['then'](respondWithStatusCode(_0x23bc4d,null))[_0xf076('0x2a')](handleError(_0x23bc4d,null));};exports['addInteraction']=function(_0x1cfb2b,_0x4038a7,_0x499c9d){return db[_0xf076('0x6e')][_0xf076('0x58')]({'where':{'id':_0x1cfb2b[_0xf076('0x56')]['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x4038a7,null))['then'](function(_0x45d845){if(_0x45d845){return _0x45d845[_0xf076('0x6f')](_0x1cfb2b[_0xf076('0x5a')][_0xf076('0x70')],_['omit'](_0x1cfb2b['body'],[_0xf076('0x70'),'id'])||{});}})['then'](respondWithResult(_0x4038a7,null))[_0xf076('0x2a')](handleError(_0x4038a7,null));};exports[_0xf076('0x71')]=function(_0x42c0d8,_0x172d68,_0x60db1b){var _0x3d8808={'raw':![],'where':{}};var _0x260956={};var _0x410564={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x42c0d8[_0xf076('0x56')]['id']}})[_0xf076('0x20')](handleEntityNotFound(_0x172d68,null))['then'](function(_0x507a98){if(_0x507a98){_0x260956['model']=_[_0xf076('0x57')](db['FaxInteraction']['rawAttributes']);_0x260956[_0xf076('0x43')]=_[_0xf076('0x57')](_0x42c0d8[_0xf076('0x43')]);_0x260956[_0xf076('0x4e')]=_['intersection'](_0x260956[_0xf076('0x45')],_0x260956[_0xf076('0x43')]);_0x3d8808[_0xf076('0x46')]=_[_0xf076('0x44')](_0x260956[_0xf076('0x45')],qs[_0xf076('0x47')](_0x42c0d8[_0xf076('0x43')][_0xf076('0x47')]));_0x3d8808['attributes']=_0x3d8808[_0xf076('0x46')][_0xf076('0x48')]?_0x3d8808['attributes']:_0x260956['model'];if(!_0x42c0d8[_0xf076('0x43')]['hasOwnProperty'](_0xf076('0x4a'))){_0x3d8808['limit']=qs[_0xf076('0x30')](_0x42c0d8[_0xf076('0x43')][_0xf076('0x30')]);_0x3d8808[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x42c0d8[_0xf076('0x43')][_0xf076('0x2f')]);}_0x3d8808['order']=qs['sort'](_0x42c0d8['query'][_0xf076('0x4b')]);_0x3d8808['where']=qs[_0xf076('0x4e')](_['pick'](_0x42c0d8[_0xf076('0x43')],_0x260956[_0xf076('0x4e')]));_0x3d8808[_0xf076('0x4c')]['FaxAccountId']=_0x507a98['id'];if(_0x42c0d8[_0xf076('0x43')][_0xf076('0x4f')]){_0x3d8808[_0xf076('0x4c')]=_[_0xf076('0x50')](_0x3d8808['where'],{'$or':_[_0xf076('0x3e')](_0x3d8808[_0xf076('0x46')],function(_0x4cbffb){var _0x10c7a9={};_0x10c7a9[_0x4cbffb]={'$like':'%'+_0x42c0d8[_0xf076('0x43')][_0xf076('0x4f')]+'%'};return _0x10c7a9;})});}_0x3d8808=_[_0xf076('0x50')]({},_0x3d8808,_0x42c0d8[_0xf076('0x51')]);return db[_0xf076('0x6e')][_0xf076('0x31')]({'where':_0x3d8808[_0xf076('0x4c')]})[_0xf076('0x20')](function(_0x1d1de5){_0x410564['count']=_0x1d1de5;if(_0x42c0d8[_0xf076('0x43')][_0xf076('0x52')]){_0x3d8808[_0xf076('0x53')]=[{'model':db[_0xf076('0x72')],'as':_0xf076('0x73'),'required':![]},{'model':db[_0xf076('0x74')],'as':_0xf076('0x75'),'attributes':[_0xf076('0x3a'),_0xf076('0x76'),_0xf076('0x77')],'required':![]},{'model':db[_0xf076('0x78')],'as':_0xf076('0x79'),'attributes':['id',_0xf076('0x3a'),'color'],'where':_0x42c0d8[_0xf076('0x43')][_0xf076('0x7a')]?{'id':_0x42c0d8[_0xf076('0x43')][_0xf076('0x7a')]}:undefined,'required':_0x42c0d8[_0xf076('0x43')][_0xf076('0x7a')]?!![]:![]}];}return db[_0xf076('0x6e')][_0xf076('0x54')](_0x3d8808);})[_0xf076('0x20')](function(_0x95c09e){_0x410564[_0xf076('0x69')]=_0x95c09e;return _0x410564;});}})['then'](respondWithFilteredResult(_0x172d68,_0x3d8808))[_0xf076('0x2a')](handleError(_0x172d68,null));};exports[_0xf076('0x7b')]=function(_0x4f8a42,_0x3eef24){var _0x34582d=_0x4f8a42[_0xf076('0x56')]['id'];var _0x2580ee=_0x4f8a42[_0xf076('0x5a')];var _0x33f12c=0xc8;var _0x254b12=null;return db[_0xf076('0x7c')][_0xf076('0x7d')]({'isolationLevel':db[_0xf076('0x7c')][_0xf076('0x7e')][_0xf076('0x7f')][_0xf076('0x80')]},function(_0x3fd6eb){return db[_0xf076('0x3f')][_0xf076('0x67')]({'where':{'id':_0x34582d},'transaction':_0x3fd6eb})[_0xf076('0x20')](function(_0x195515){if(_0x195515){return db[_0xf076('0x81')][_0xf076('0x36')]({'where':{'FaxAccountId':_0x34582d},'transaction':_0x3fd6eb})[_0xf076('0x20')](function(){var _0x3ed47f=_[_0xf076('0x3e')](_0x2580ee,function(_0x269d8e){_0x269d8e[_0xf076('0x64')]=_0x34582d;return _0x269d8e;});return db[_0xf076('0x81')][_0xf076('0x82')](_0x3ed47f,{'transaction':_0x3fd6eb});});}else{_0x33f12c=0x194;_0x254b12=[];}});})[_0xf076('0x20')](function(){if(_0x33f12c!==0x194){return db[_0xf076('0x81')][_0xf076('0x83')]({'where':{'FaxAccountId':_0x34582d},'order':_0xf076('0x84')})[_0xf076('0x20')](function(_0x2109ce){_0x254b12=_0x2109ce;});}})['catch'](function(_0x4d7c44){_0x33f12c=0x1f4;logger['error'](_0x4d7c44[_0xf076('0x39')]);if(_0x4d7c44[_0xf076('0x3a')]){delete _0x4d7c44['name'];}_0x254b12=_0x4d7c44;})[_0xf076('0x85')](function(){if(_0x254b12===null){_0x3eef24[_0xf076('0x2b')](_0x33f12c);}else{if(_0x33f12c===0x1f4){_0x3eef24[_0xf076('0x2c')](_0x33f12c)[_0xf076('0x3b')](_0x254b12);}else{_0x3eef24[_0xf076('0x2c')](_0x33f12c)[_0xf076('0x2e')](_0x254b12);}}});};exports[_0xf076('0x86')]=function(_0x4b23dd,_0x55254c,_0x3ce275){var _0x525f5d={};var _0x28eb15={};var _0x3b32f0;var _0x21b7e0;return db['FaxAccount'][_0xf076('0x67')]({'where':{'id':_0x4b23dd[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0x55254c,null))[_0xf076('0x20')](function(_0x49686c){if(_0x49686c){_0x3b32f0=_0x49686c;_0x28eb15['model']=_['keys'](db[_0xf076('0x81')][_0xf076('0x40')]);_0x28eb15[_0xf076('0x43')]=_[_0xf076('0x57')](_0x4b23dd[_0xf076('0x43')]);_0x28eb15[_0xf076('0x4e')]=_['intersection'](_0x28eb15[_0xf076('0x45')],_0x28eb15[_0xf076('0x43')]);_0x525f5d['attributes']=_[_0xf076('0x44')](_0x28eb15[_0xf076('0x45')],qs['fields'](_0x4b23dd[_0xf076('0x43')][_0xf076('0x47')]));_0x525f5d[_0xf076('0x46')]=_0x525f5d[_0xf076('0x46')]['length']?_0x525f5d[_0xf076('0x46')]:_0x28eb15['model'];_0x525f5d[_0xf076('0x68')]=qs[_0xf076('0x4b')](_0x4b23dd[_0xf076('0x43')]['sort']);_0x525f5d['where']=qs[_0xf076('0x4e')](_[_0xf076('0x4d')](_0x4b23dd['query'],_0x28eb15[_0xf076('0x4e')]));if(_0x4b23dd[_0xf076('0x43')][_0xf076('0x4f')]){_0x525f5d[_0xf076('0x4c')]=_['merge'](_0x525f5d[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x525f5d['attributes'],function(_0x18adae){var _0x40523a={};_0x40523a[_0x18adae]={'$like':'%'+_0x4b23dd[_0xf076('0x43')][_0xf076('0x4f')]+'%'};return _0x40523a;})});}_0x525f5d=_['merge']({},_0x525f5d,_0x4b23dd['options']);return _0x3b32f0['getApplications'](_0x525f5d);}})['then'](function(_0x47619b){if(_0x47619b){_0x21b7e0=_0x47619b[_0xf076('0x48')];if(!_0x4b23dd[_0xf076('0x43')][_0xf076('0x49')]('nolimit')){_0x525f5d[_0xf076('0x30')]=qs[_0xf076('0x30')](_0x4b23dd[_0xf076('0x43')]['limit']);_0x525f5d[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x4b23dd[_0xf076('0x43')][_0xf076('0x2f')]);}return _0x3b32f0[_0xf076('0x86')](_0x525f5d);}})[_0xf076('0x20')](function(_0xa95e12){if(_0xa95e12){return _0xa95e12?{'count':_0x21b7e0,'rows':_0xa95e12}:null;}})[_0xf076('0x20')](respondWithResult(_0x55254c,null))[_0xf076('0x2a')](handleError(_0x55254c,null));};function Extension(_0x686db2,_0x4da2a2,_0x4e5005,_0x5729a2){this[_0xf076('0x87')]=_0xf076('0x88');this[_0xf076('0x89')]=_0x686db2['localstationid'];this[_0xf076('0x8a')]=_0x5729a2;this[_0xf076('0x41')]=_0xf076('0x8b');this[_0xf076('0x8c')]='Fax\x20Extension';this[_0xf076('0x64')]=_0x686db2['id'];this['priority']=_0x4da2a2;this['appdata']=_0x4e5005;}function createExtensionsReciveFax(_0x855d90){var _0x15935b=0x1;var _0x2e97b1=[];_0x2e97b1['push'](new Extension(_0x855d90,_0x15935b,'',_0xf076('0x8d')));_0x15935b+=0x1;_0x2e97b1[_0xf076('0x8e')](new Extension(_0x855d90,_0x15935b,_0xf076('0x8f'),'Set'));_0x15935b+=0x1;for(var _0x33b467 in _0x855d90){if(_0x855d90[_0xf076('0x49')](_0x33b467)&&(_0x33b467===_0xf076('0x90')||_0x33b467===_0xf076('0x91')||_0x33b467===_0xf076('0x92')||_0x33b467===_0xf076('0x93')||_0x33b467===_0xf076('0x94')||_0x33b467===_0xf076('0x95')||_0x33b467===_0xf076('0x96')||_0x33b467===_0xf076('0x97')||_0x33b467===_0xf076('0x98'))){_0x2e97b1[_0xf076('0x8e')](new Extension(_0x855d90,_0x15935b,_0xf076('0x99')+_0x33b467+')='+_0x855d90[_0x33b467],'Set'));_0x15935b+=0x1;}}_0x2e97b1[_0xf076('0x8e')](new Extension(_0x855d90,_0x15935b,'6',_0xf076('0x9a')));_0x15935b+=0x1;_0x2e97b1[_0xf076('0x8e')](new Extension(_0x855d90,_0x15935b,_0xf076('0x9b'),'ReceiveFax'));_0x15935b=0x0;return _0x2e97b1;}exports[_0xf076('0x9c')]=function(_0x5de6bf,_0x342694,_0x11a9f7){var _0x2aaba9;return db[_0xf076('0x7c')][_0xf076('0x7d')](function(_0x4c6346){return db[_0xf076('0x3f')]['create'](_0x5de6bf[_0xf076('0x5a')],{'transaction':_0x4c6346})[_0xf076('0x20')](function(_0x1e959a){_0x2aaba9=_0x1e959a[_0xf076('0x5e')]({'plain':!![]});return db[_0xf076('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0x2aaba9),{'transaction':_0x4c6346});});})['then'](function(){return _0x2aaba9;})[_0xf076('0x20')](respondWithResult(_0x342694,null))[_0xf076('0x2a')](handleError(_0x342694,null));};exports[_0xf076('0x9e')]=function(_0x181e44,_0x9d014b,_0x15333d){var _0x57f991;return db['sequelize'][_0xf076('0x7d')](function(_0x31ad6d){return db[_0xf076('0x3f')][_0xf076('0x35')](_0x181e44[_0xf076('0x5a')],{'where':{'id':_0x181e44[_0xf076('0x5a')]['id']},'transaction':_0x31ad6d})[_0xf076('0x20')](function(_0x405ac5){return db[_0xf076('0x9d')][_0xf076('0x36')]({'where':{'FaxAccountId':_0x181e44[_0xf076('0x5a')]['id']},'transaction':_0x31ad6d})[_0xf076('0x20')](function(_0x3d1b68){return db[_0xf076('0x9d')][_0xf076('0x82')](createExtensionsReciveFax(_[_0xf076('0x9f')](_0x181e44[_0xf076('0x5a')],['tech',_0xf076('0x42'),_0xf076('0xa0'),'updatedAt',_0xf076('0xa1'),'ListId'])),{'transaction':_0x31ad6d});});});})[_0xf076('0x20')](function(){return db[_0xf076('0x3f')][_0xf076('0xa2')](_0x181e44[_0xf076('0x5a')]['id']);})[_0xf076('0x20')](respondWithResult(_0x9d014b,null))[_0xf076('0x2a')](handleError(_0x9d014b,null));};exports[_0xf076('0xa3')]=function(_0x114a00,_0x1714ef,_0x4315c2){var _0x3becc0={'raw':!![],'where':{}};var _0x2bf2c5={};var _0x239245={'count':0x0,'rows':[]};return db[_0xf076('0x3f')][_0xf076('0x67')]({'where':{'id':_0x114a00[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0x1714ef,null))[_0xf076('0x20')](function(_0x44ed6e){if(_0x44ed6e){_0x2bf2c5[_0xf076('0x45')]=_['keys'](db['FaxMessage'][_0xf076('0x40')]);_0x2bf2c5[_0xf076('0x43')]=_[_0xf076('0x57')](_0x114a00[_0xf076('0x43')]);_0x2bf2c5[_0xf076('0x4e')]=_['intersection'](_0x2bf2c5[_0xf076('0x45')],_0x2bf2c5[_0xf076('0x43')]);_0x3becc0[_0xf076('0x46')]=_[_0xf076('0x44')](_0x2bf2c5[_0xf076('0x45')],qs[_0xf076('0x47')](_0x114a00[_0xf076('0x43')][_0xf076('0x47')]));_0x3becc0[_0xf076('0x46')]=_0x3becc0[_0xf076('0x46')][_0xf076('0x48')]?_0x3becc0[_0xf076('0x46')]:_0x2bf2c5[_0xf076('0x45')];if(!_0x114a00[_0xf076('0x43')][_0xf076('0x49')](_0xf076('0x4a'))){_0x3becc0[_0xf076('0x30')]=qs[_0xf076('0x30')](_0x114a00[_0xf076('0x43')]['limit']);_0x3becc0[_0xf076('0x2f')]=qs[_0xf076('0x2f')](_0x114a00[_0xf076('0x43')]['offset']);}_0x3becc0[_0xf076('0x68')]=qs[_0xf076('0x4b')](_0x114a00[_0xf076('0x43')][_0xf076('0x4b')]);_0x3becc0[_0xf076('0x4c')]=qs[_0xf076('0x4e')](_[_0xf076('0x4d')](_0x114a00[_0xf076('0x43')],_0x2bf2c5[_0xf076('0x4e')]));_0x3becc0['where']['FaxAccountId']=_0x44ed6e['id'];if(_0x114a00[_0xf076('0x43')]['filter']){_0x3becc0[_0xf076('0x4c')]=_[_0xf076('0x50')](_0x3becc0[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x3becc0[_0xf076('0x46')],function(_0x4d689b){var _0x2664cb={};_0x2664cb[_0x4d689b]={'$like':'%'+_0x114a00['query'][_0xf076('0x4f')]+'%'};return _0x2664cb;})});}if(_0x114a00['query'][_0xf076('0xa4')]){var _0x4ba7bb=_0x114a00[_0xf076('0x43')]['$gte'][_0xf076('0xa5')](',');var _0x3d2c2a={};_0x3d2c2a[_0x4ba7bb[0x0]]={'$gte':moment(_0x4ba7bb[0x1])[_0xf076('0xa6')](_0xf076('0xa7'))};_0x3becc0[_0xf076('0x4c')]=_[_0xf076('0x50')](_0x3becc0[_0xf076('0x4c')],_0x3d2c2a);}_0x3becc0=_[_0xf076('0x50')]({},_0x3becc0,_0x114a00[_0xf076('0x51')]);return db[_0xf076('0xa8')]['count']({'where':_0x3becc0[_0xf076('0x4c')]})['then'](function(_0x36146e){_0x239245[_0xf076('0x31')]=_0x36146e;if(_0x114a00[_0xf076('0x43')][_0xf076('0x52')]){_0x3becc0['include']=[{'all':!![]}];}return db['FaxMessage'][_0xf076('0x54')](_0x3becc0);})[_0xf076('0x20')](function(_0xdea98d){_0x239245['rows']=_0xdea98d;return _0x239245;});}})[_0xf076('0x20')](respondWithFilteredResult(_0x1714ef,_0x3becc0))[_0xf076('0x2a')](handleError(_0x1714ef,null));};exports[_0xf076('0x3b')]=function(_0x52d34f,_0x21c9ac,_0x285ea5){var _0x2f2189,_0x2db927={},_0x5e8b50;if(_0x52d34f[_0xf076('0x5a')]['to']){_0x5e8b50=_0x52d34f[_0xf076('0x5a')]['to'][0x0];}return db['FaxAccount'][_0xf076('0x58')]({'where':{'id':_0x52d34f[_0xf076('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xf076('0xa9'),'where':{'fax':_0x5e8b50},'limit':0x1,'order':[[_0xf076('0xaa'),_0xf076('0xab')]]}]}]})['then'](handleEntityNotFound(_0x21c9ac,null))['then'](function(_0x4e912b){_0x2f2189=_0x4e912b;if(_0x52d34f[_0xf076('0x5a')]['attachments']&&_0x52d34f['body'][_0xf076('0xac')][_0xf076('0x48')]){for(var _0x3f57f9=0x0;_0x3f57f9<_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')]['length'];_0x3f57f9+=0x1){_0x52d34f['body'][_0xf076('0xac')][_0x3f57f9]={'filename':_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][_0x3f57f9]['name'],'id':_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][_0x3f57f9]['id'],'path':path[_0xf076('0xad')](config['root'],_0xf076('0xae'),_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][_0x3f57f9]['basename'])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xf076('0xaf')](_0x52d34f['params']['id'])?undefined:_0x52d34f[_0xf076('0x56')]['id'],'path':_[_0xf076('0xaf')](_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][0x0][_0xf076('0xb0')])?undefined:_0x52d34f['body'][_0xf076('0xac')][0x0][_0xf076('0xb0')],'fax':_[_0xf076('0xaf')](_0x52d34f['body']['to'][0x0])?undefined:_0x52d34f['body']['to'][0x0]},client9002);})[_0xf076('0x20')](function(){if(_0x2f2189){if(_[_0xf076('0xaf')](_0x52d34f[_0xf076('0x5a')]['from'])){_0x52d34f[_0xf076('0x5a')]['from']=util['format']('\x22%s\x22\x20<%s>',_0x2f2189[_0xf076('0x3a')],_0x2f2189[_0xf076('0xb1')]);}if(_0x2f2189[_0xf076('0xb2')]){if(_0x2f2189[_0xf076('0xb2')][_0xf076('0xa9')]['length']){return _0x2f2189[_0xf076('0xb2')][_0xf076('0xa9')][0x0];}else{return db['CmContact']['create'](_[_0xf076('0x18')](_0x52d34f[_0xf076('0x5a')],{'firstName':_0x52d34f['body']['to'][0x0],'phone':_0x52d34f['body']['to'][0x0],'fax':_0x52d34f['body']['to'][0x0],'ListId':_0x2f2189[_0xf076('0xb3')]}));}}else{throw new Error(_0xf076('0xb4'));}}else{throw new Error(_0xf076('0xb5'));}})['then'](function(_0x299d9d){if(_0x299d9d){return db[_0xf076('0x6e')]['find']({'where':{'ContactId':_0x299d9d['id'],'closed':![],'FaxAccountId':_0x2f2189['id']}})[_0xf076('0x20')](function(_0x4a0479){if(_0x4a0479){return[_0x4a0479,![]];}return db['FaxInteraction'][_0xf076('0x59')]({'UserId':_0x52d34f['user']['id'],'ContactId':_0x299d9d['id'],'FaxAccountId':_0x2f2189['id'],'fax':_0x52d34f['body']['to'][0x0],'firstMsgDirection':_0xf076('0xb6'),'Messages':[_['merge'](_0x52d34f[_0xf076('0x5a')],{'read':![],'body':_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][0x0][_0xf076('0xb7')],'FaxAccountId':_0x2f2189['id'],'UserId':_0x52d34f[_0xf076('0x5b')]['id'],'ContactId':_0x299d9d['id'],'AttachmentId':_0x52d34f[_0xf076('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xf076('0xa8')],'as':'Messages'}]})[_0xf076('0x20')](function(_0x11e3c0){return[_0x11e3c0,!![]];});});}else{throw new Error(_0xf076('0xb8'));}})[_0xf076('0xb9')](function(_0x387959,_0x2c4eb3){if(_0x2c4eb3){return _0x387959;}return db[_0xf076('0xa8')][_0xf076('0x59')]({'direction':_0xf076('0xb6'),'read':![],'body':_0x52d34f['body'][_0xf076('0xac')][0x0][_0xf076('0xb7')],'FaxAccountId':_0x2f2189['id'],'FaxInteractionId':_0x387959['id'],'UserId':_0x52d34f[_0xf076('0x5b')]['id'],'ContactId':_0x387959[_0xf076('0xba')],'AttachmentId':_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][0x0]['id']})[_0xf076('0x20')](function(_0x3707ac){_0x387959[_0xf076('0xbb')][_0xf076('0xbc')]=[];_0x387959[_0xf076('0xbb')][_0xf076('0xbc')][_0xf076('0x8e')](_0x3707ac[_0xf076('0xbb')]);return _0x387959;});})[_0xf076('0x20')](function(_0x3ca12d){respondWithRpcPromise(_0xf076('0xbd'),_0xf076('0xbd'),{'FaxAccountId':_[_0xf076('0xaf')](_0x52d34f['params']['id'])?undefined:_0x52d34f[_0xf076('0x56')]['id'],'path':_[_0xf076('0xaf')](_0x52d34f[_0xf076('0x5a')][_0xf076('0xac')][0x0][_0xf076('0xb0')])?undefined:_0x52d34f[_0xf076('0x5a')]['attachments'][0x0]['path'],'fax':_[_0xf076('0xaf')](_0x52d34f[_0xf076('0x5a')]['to'][0x0])?undefined:_0x52d34f['body']['to'][0x0],'AttachmentId':_0x52d34f['body'][_0xf076('0xac')][0x0]['id']},client9002)[_0xf076('0x20')](function(_0x30f192){logger[_0xf076('0x28')](_0xf076('0xbe'),_0x30f192);})[_0xf076('0x2a')](function(_0x1caf7e){logger[_0xf076('0x28')]('SendFaxRpc,\x20%s',_0x1caf7e);});return _0x3ca12d;})[_0xf076('0x20')](respondWithResult(_0x21c9ac,null))['catch'](handleError(_0x21c9ac,null));};exports['addAgents']=function(_0x570902,_0x2914b6,_0x2475f0){return db[_0xf076('0x3f')][_0xf076('0x58')]({'where':{'id':_0x570902[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0x2914b6,null))['then'](function(_0x488fdb){if(_0x488fdb){return _0x488fdb[_0xf076('0xbf')](_0x570902[_0xf076('0x5a')][_0xf076('0x70')],_[_0xf076('0x9f')](_0x570902[_0xf076('0x5a')],[_0xf076('0x70'),'id'])||{})[_0xf076('0xb9')](function(_0x3b6d47){for(var _0x9c1d91=0x0;_0x9c1d91<_0x570902[_0xf076('0x5a')]['ids']['length'];_0x9c1d91+=0x1){socket[_0xf076('0xc0')](_0xf076('0xc1'),{'UserId':Number(_0x570902[_0xf076('0x5a')][_0xf076('0x70')][_0x9c1d91]),'FaxAccountId':Number(_0x570902[_0xf076('0x56')]['id'])});}return _0x3b6d47;});}})[_0xf076('0x20')](respondWithResult(_0x2914b6,null))[_0xf076('0x2a')](handleError(_0x2914b6,null));};exports[_0xf076('0xc2')]=function(_0x505d31,_0xc37de6,_0x4f7b1e){return db['FaxAccount'][_0xf076('0x58')]({'where':{'id':_0x505d31['params']['id']}})['then'](handleEntityNotFound(_0xc37de6,null))[_0xf076('0x20')](function(_0x37528d){if(_0x37528d){return _0x37528d['removeAgents'](_0x505d31[_0xf076('0x43')][_0xf076('0x70')])[_0xf076('0x20')](function(){if(_[_0xf076('0xc3')](_0x505d31[_0xf076('0x43')]['ids'])){for(var _0x54d9a9=0x0;_0x54d9a9<_0x505d31[_0xf076('0x43')][_0xf076('0x70')][_0xf076('0x48')];_0x54d9a9+=0x1){socket[_0xf076('0xc0')](_0xf076('0xc4'),{'UserId':Number(_0x505d31[_0xf076('0x43')]['ids'][_0x54d9a9]),'FaxAccountId':Number(_0x505d31['params']['id'])});}}else{socket[_0xf076('0xc0')](_0xf076('0xc4'),{'UserId':Number(_0x505d31[_0xf076('0x43')]['ids']),'FaxAccountId':Number(_0x505d31['params']['id'])});}});}})['then'](respondWithStatusCode(_0xc37de6,null))['catch'](handleError(_0xc37de6,null));};exports['getAgents']=function(_0x3e1ec2,_0x4e9efc,_0x13f38c){var _0x385066={};var _0xa4930d={};var _0x10d148;var _0x3eb989;return db['FaxAccount'][_0xf076('0x67')]({'where':{'id':_0x3e1ec2[_0xf076('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e9efc,null))[_0xf076('0x20')](function(_0x1f1ee6){if(_0x1f1ee6){_0x10d148=_0x1f1ee6;_0xa4930d['model']=_[_0xf076('0x57')](db[_0xf076('0x74')][_0xf076('0x40')]);_0xa4930d[_0xf076('0x43')]=_[_0xf076('0x57')](_0x3e1ec2[_0xf076('0x43')]);_0xa4930d['filters']=_['intersection'](_0xa4930d[_0xf076('0x45')],_0xa4930d[_0xf076('0x43')]);_0x385066[_0xf076('0x46')]=_[_0xf076('0x44')](_0xa4930d[_0xf076('0x45')],qs[_0xf076('0x47')](_0x3e1ec2[_0xf076('0x43')]['fields']));_0x385066[_0xf076('0x46')]=_0x385066['attributes'][_0xf076('0x48')]?_0x385066['attributes']:_0xa4930d[_0xf076('0x45')];_0x385066[_0xf076('0x68')]=qs[_0xf076('0x4b')](_0x3e1ec2[_0xf076('0x43')][_0xf076('0x4b')]);_0x385066[_0xf076('0x4c')]=qs[_0xf076('0x4e')](_[_0xf076('0x4d')](_0x3e1ec2['query'],_0xa4930d[_0xf076('0x4e')]));if(_0x3e1ec2[_0xf076('0x43')][_0xf076('0x4f')]){_0x385066['where']=_[_0xf076('0x50')](_0x385066[_0xf076('0x4c')],{'$or':_[_0xf076('0x3e')](_0x385066['attributes'],function(_0x269620){var _0x4d5cba={};_0x4d5cba[_0x269620]={'$like':'%'+_0x3e1ec2[_0xf076('0x43')][_0xf076('0x4f')]+'%'};return _0x4d5cba;})});}_0x385066=_['merge']({},_0x385066,_0x3e1ec2['options']);return _0x10d148[_0xf076('0xc5')](_0x385066);}})[_0xf076('0x20')](function(_0x2a33eb){if(_0x2a33eb){_0x3eb989=_0x2a33eb['length'];if(!_0x3e1ec2[_0xf076('0x43')][_0xf076('0x49')](_0xf076('0x4a'))){_0x385066['limit']=qs[_0xf076('0x30')](_0x3e1ec2[_0xf076('0x43')][_0xf076('0x30')]);_0x385066['offset']=qs[_0xf076('0x2f')](_0x3e1ec2[_0xf076('0x43')][_0xf076('0x2f')]);}return _0x10d148[_0xf076('0xc5')](_0x385066);}})['then'](function(_0x23147a){if(_0x23147a){return _0x23147a?{'count':_0x3eb989,'rows':_0x23147a}:null;}})[_0xf076('0x20')](respondWithResult(_0x4e9efc,null))[_0xf076('0x2a')](handleError(_0x4e9efc,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 964848c..49ff994 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 _0xc82e=['emit','hook','exports','events','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x3bfc68,_0x2bcbb6){var _0x28318a=function(_0x334008){while(--_0x334008){_0x3bfc68['push'](_0x3bfc68['shift']());}};_0x28318a(++_0x2bcbb6);}(_0xc82e,0xd2));var _0xec82=function(_0x238caa,_0xc685a1){_0x238caa=_0x238caa-0x0;var _0x5b0829=_0xc82e[_0x238caa];return _0x5b0829;};'use strict';var EventEmitter=require(_0xec82('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xec82('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xec82('0x2')](0x0);var events={'afterCreate':_0xec82('0x3'),'afterUpdate':_0xec82('0x4'),'afterDestroy':_0xec82('0x5')};function emitEvent(_0x583a62){return function(_0x3249bc,_0x4626a,_0x149161){FaxAccountEvents[_0xec82('0x6')](_0x583a62+':'+_0x3249bc['id'],_0x3249bc);FaxAccountEvents['emit'](_0x583a62,_0x3249bc);_0x149161(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xec82('0x7')](e,emitEvent(event));}}module[_0xec82('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x61f2=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x37b0ff,_0x2c6472){var _0x1cf6eb=function(_0x348f64){while(--_0x348f64){_0x37b0ff['push'](_0x37b0ff['shift']());}};_0x1cf6eb(++_0x2c6472);}(_0x61f2,0x66));var _0x261f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x61f2[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0x261f('0x0'));var FaxAccount=require(_0x261f('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x261f('0x2')](0x0);var events={'afterCreate':_0x261f('0x3'),'afterUpdate':_0x261f('0x4'),'afterDestroy':_0x261f('0x5')};function emitEvent(_0x427b52){return function(_0x363dfe,_0x4260b,_0x5493fb){FaxAccountEvents['emit'](_0x427b52+':'+_0x363dfe['id'],_0x363dfe);FaxAccountEvents[_0x261f('0x6')](_0x427b52,_0x363dfe);_0x5493fb(null);};}for(var e in events){if(events[_0x261f('0x7')](e)){var event=events[e];FaxAccount[_0x261f('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 25c626f..b72268f 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 _0x8fc4=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x37b229,_0x1ff75f){var _0x3162c4=function(_0x2db4f4){while(--_0x2db4f4){_0x37b229['push'](_0x37b229['shift']());}};_0x3162c4(++_0x1ff75f);}(_0x8fc4,0x88));var _0x48fc=function(_0x211dab,_0x9f8286){_0x211dab=_0x211dab-0x0;var _0x43162d=_0x8fc4[_0x211dab];return _0x43162d;};'use strict';var _=require(_0x48fc('0x0'));var util=require(_0x48fc('0x1'));var logger=require(_0x48fc('0x2'))('api');var moment=require(_0x48fc('0x3'));var BPromise=require(_0x48fc('0x4'));var rp=require(_0x48fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48fc('0x6'));var config=require(_0x48fc('0x7'));var attributes=require(_0x48fc('0x8'));module[_0x48fc('0x9')]=function(_0x2bcf58,_0x44f6fe){return _0x2bcf58[_0x48fc('0xa')](_0x48fc('0xb'),attributes,{'tableName':_0x48fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0670=['lodash','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','FaxAccount'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x0670,0x1d0));var _0x0067=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0x0670[_0x4df85c];return _0x4e2a61;};'use strict';var _=require(_0x0067('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0067('0x1'));var BPromise=require(_0x0067('0x2'));var rp=require(_0x0067('0x3'));var fs=require('fs');var path=require(_0x0067('0x4'));var rimraf=require('rimraf');var config=require(_0x0067('0x5'));var attributes=require(_0x0067('0x6'));module['exports']=function(_0x34e5b8,_0x21de7b){return _0x34e5b8['define'](_0x0067('0x7'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index c7c3a5e..64d8bf6 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 _0x218b=['ContactId','name','UserId','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','options','raw','where','limit','include','model','map','attributes','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage'];(function(_0x240757,_0x447def){var _0x2fc8fb=function(_0x440bda){while(--_0x440bda){_0x240757['push'](_0x240757['shift']());}};_0x2fc8fb(++_0x447def);}(_0x218b,0xbb));var _0xb218=function(_0x5b2a79,_0x2f3afe){_0x5b2a79=_0x5b2a79-0x0;var _0x3f201f=_0x218b[_0x5b2a79];return _0x3f201f;};'use strict';var _=require(_0xb218('0x0'));var util=require('util');var moment=require(_0xb218('0x1'));var BPromise=require(_0xb218('0x2'));var rs=require(_0xb218('0x3'));var fs=require('fs');var Redis=require(_0xb218('0x4'));var db=require(_0xb218('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb218('0x6'))(_0xb218('0x7'));var config=require(_0xb218('0x8'));var jayson=require(_0xb218('0x9'));var client=jayson[_0xb218('0xa')][_0xb218('0xb')]({'port':0x232c});config['redis']=_[_0xb218('0xc')](config[_0xb218('0xd')],{'host':_0xb218('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0xb218('0xf')](socket);function respondWithRpcPromise(_0x2a241b,_0x3e4323,_0x250015){return new BPromise(function(_0x109909,_0x261c21){return client['request'](_0x2a241b,_0x250015)[_0xb218('0x10')](function(_0x347615){logger[_0xb218('0x11')](_0xb218('0x12'),_0x3e4323,_0xb218('0x13'));logger[_0xb218('0x14')](_0xb218('0x15'),_0x3e4323,_0xb218('0x13'),JSON[_0xb218('0x16')](_0x347615));if(_0x347615[_0xb218('0x17')]){if(_0x347615[_0xb218('0x17')][_0xb218('0x18')]===0x1f4){logger[_0xb218('0x17')](_0xb218('0x12'),_0x3e4323,_0x347615[_0xb218('0x17')]['message']);return _0x261c21(_0x347615[_0xb218('0x17')][_0xb218('0x19')]);}logger[_0xb218('0x17')](_0xb218('0x12'),_0x3e4323,_0x347615[_0xb218('0x17')][_0xb218('0x19')]);return _0x109909(_0x347615['error'][_0xb218('0x19')]);}else{logger[_0xb218('0x11')](_0xb218('0x12'),_0x3e4323,'request\x20sent');_0x109909(_0x347615[_0xb218('0x1a')]['message']);}})[_0xb218('0x1b')](function(_0x58e2ae){logger[_0xb218('0x17')]('FaxAccount,\x20%s,\x20%s',_0x3e4323,_0x58e2ae);_0x261c21(_0x58e2ae);});});}exports[_0xb218('0x1c')]=function(_0xd6ad){var _0x34b338=this;return new Promise(function(_0x471349,_0x1b47b1){return db['FaxAccount']['findAll']({'raw':_0xd6ad[_0xb218('0x1d')]?_0xd6ad[_0xb218('0x1d')][_0xb218('0x1e')]===undefined?!![]:![]:!![],'where':_0xd6ad[_0xb218('0x1d')]?_0xd6ad[_0xb218('0x1d')][_0xb218('0x1f')]||null:null,'attributes':_0xd6ad['options']?_0xd6ad[_0xb218('0x1d')]['attributes']||null:null,'limit':_0xd6ad['options']?_0xd6ad['options'][_0xb218('0x20')]||null:null,'include':_0xd6ad[_0xb218('0x1d')]?_0xd6ad['options']['include']?_['map'](_0xd6ad['options'][_0xb218('0x21')],function(_0x52048d){return{'model':db[_0x52048d[_0xb218('0x22')]],'as':_0x52048d['as'],'attributes':_0x52048d['attributes'],'include':_0x52048d['include']?_[_0xb218('0x23')](_0x52048d[_0xb218('0x21')],function(_0x1e8b17){return{'model':db[_0x1e8b17[_0xb218('0x22')]],'as':_0x1e8b17['as'],'attributes':_0x1e8b17['attributes'],'include':_0x1e8b17[_0xb218('0x21')]?_[_0xb218('0x23')](_0x1e8b17[_0xb218('0x21')],function(_0x1ad284){return{'model':db[_0x1ad284['model']],'as':_0x1ad284['as'],'attributes':_0x1ad284[_0xb218('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb218('0x10')](function(_0x26717c){logger[_0xb218('0x11')]('GetFaxAccount',_0xd6ad);logger['debug'](_0xb218('0x1c'),_0xd6ad,JSON[_0xb218('0x16')](_0x26717c));_0x471349(_0x26717c);})[_0xb218('0x1b')](function(_0x337d7e){logger['error'](_0xb218('0x1c'),_0x337d7e['message'],_0xd6ad);_0x1b47b1(_0x34b338['error'](0x1f4,_0x337d7e[_0xb218('0x19')]));});});};exports[_0xb218('0x25')]=function(_0x16a0ad,_0x3bdb54,_0x5be1e3){var _0xbf0985=this;return new Promise(function(_0x31c962,_0x3beab0){var _0x38bc66={'body':_0x16a0ad[_0xb218('0x26')],'channel':_0xb218('0x27')};var _0x600b67=[];var _0x319be9=[];var _0x17cbe9={};return db['CmContact'][_0xb218('0x28')]()[_0xb218('0x10')](function(_0x4afaa7){if(!_0x4afaa7){throw new db[(_0xb218('0x29'))][(_0xb218('0x2a'))](_0xb218('0x2b'));}_0x600b67=_['difference'](_[_0xb218('0x2c')](_0x4afaa7),[_0xb218('0x2d'),'updatedAt']);_0x319be9=_['difference'](_[_0xb218('0x2c')](_0x4afaa7),['createdAt',_0xb218('0x2e'),'CompanyId','ListId']);if(_0x16a0ad[_0xb218('0x26')]['id']){delete _0x16a0ad[_0xb218('0x26')]['id'];}if(_[_0xb218('0x2f')](_0x16a0ad[_0xb218('0x26')][_0xb218('0x30')])){throw new db[(_0xb218('0x29'))][(_0xb218('0x2a'))](_0xb218('0x31'));}if(_[_0xb218('0x2f')](_0x16a0ad[_0xb218('0x26')]['body'])||_0x16a0ad[_0xb218('0x26')][_0xb218('0x26')]===''){throw new db[(_0xb218('0x29'))][(_0xb218('0x2a'))](_0xb218('0x32'));}if(_['isNil'](_0x16a0ad[_0xb218('0x26')][_0xb218('0x33')])){throw new db[(_0xb218('0x29'))]['ValidationError'](_0xb218('0x34')+_0x319be9);}if(!_[_0xb218('0x35')](_0x319be9,_0x16a0ad[_0xb218('0x26')]['mapKey'])){throw new db[(_0xb218('0x29'))][(_0xb218('0x2a'))](_0xb218('0x36')+_0x319be9);}_0x17cbe9[_0x16a0ad[_0xb218('0x26')][_0xb218('0x33')]]=_0x16a0ad[_0xb218('0x26')][_0xb218('0x30')];})[_0xb218('0x10')](function(){return db[_0xb218('0x37')][_0xb218('0x38')]({'where':{'id':_0x16a0ad[_0xb218('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xb218('0x3a'),'include':[{'model':db[_0xb218('0x3b')],'as':_0xb218('0x3c'),'where':_0x17cbe9,'limit':0x1,'order':[['updatedAt',_0xb218('0x3d')]]}]},{'model':db[_0xb218('0x3e')],'as':_0xb218('0x3f')}]});})[_0xb218('0x10')](function(_0x123e67){if(_0x123e67&&_0x123e67[_0xb218('0x3a')]){var _0x459b88=_0x123e67[_0xb218('0x40')]({'plain':!![]});_0x38bc66[_0xb218('0x39')]=_0x459b88;_0x38bc66[_0xb218('0x41')]=_0x459b88['Applications'];_0x38bc66[_0xb218('0x42')]=_0x459b88[_0xb218('0x3a')];_0x38bc66[_0xb218('0x41')]=_[_0xb218('0x43')](_0x38bc66[_0xb218('0x41')],[_0xb218('0x44')],[_0xb218('0x45')]);if(_0x38bc66[_0xb218('0x39')][_0xb218('0x3f')]){delete _0x38bc66[_0xb218('0x39')][_0xb218('0x3f')];}if(_0x38bc66[_0xb218('0x39')][_0xb218('0x3a')]&&_0x38bc66[_0xb218('0x39')]['List'][_0xb218('0x3c')][_0xb218('0x46')]){return _0x38bc66[_0xb218('0x39')][_0xb218('0x3a')]['Contacts'][0x0];}var _0x41aa6a=_[_0xb218('0xc')](_0x16a0ad[_0xb218('0x26')],{'firstName':_0x16a0ad[_0xb218('0x26')][_0xb218('0x30')],'ListId':_0x459b88[_0xb218('0x47')]});_0x41aa6a[_0x16a0ad['body'][_0xb218('0x33')]]=_0x16a0ad[_0xb218('0x26')][_0xb218('0x30')];return db[_0xb218('0x3b')][_0xb218('0x48')](_0x41aa6a,{'fields':_0x600b67,'raw':!![]});}})['then'](function(_0xb9c46a){_0x38bc66[_0xb218('0x49')]=_0xb9c46a;if(_0xb9c46a){var _0x2f6aa7={'ContactId':_0xb9c46a['id'],'FaxAccountId':_0x16a0ad[_0xb218('0x39')]['id'],'fax':_0xb9c46a[_0xb218('0x27')]};return db[_0xb218('0x4a')]['find']({'where':{'ContactId':_0xb9c46a['id'],'closed':![],'FaxAccountId':_0x16a0ad[_0xb218('0x39')]['id']}})[_0xb218('0x10')](function(_0x51848d){if(_0x51848d){return[_0x51848d,![]];}return db['FaxInteraction'][_0xb218('0x48')](_0x2f6aa7)['then'](function(_0xba4a56){return[_0xba4a56,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb218('0x4b')](function(_0x2b9e38,_0x156717){var _0x562e55=_0x2b9e38[_0xb218('0x40')]({'plain':!![]});if(_0x156717){if(_0x38bc66[_0xb218('0x39')][_0xb218('0x4c')]){_0x38bc66[_0xb218('0x41')][_0xb218('0x4d')]({'id':0x0,'priority':_0x38bc66[_0xb218('0x41')][_0xb218('0x46')]+0x1,'app':'close','appdata':_0xb218('0x4e'),'interval':_0xb218('0x4f')});}_0x562e55[_0xb218('0x50')]=!![];}else{_0x562e55[_0xb218('0x50')]=![];}_0x38bc66[_0xb218('0x51')]=_0x562e55;return db[_0xb218('0x52')][_0xb218('0x48')]({'body':_0x16a0ad['body'][_0xb218('0x26')],'FaxAccountId':_0x16a0ad[_0xb218('0x39')]['id'],'FaxInteractionId':_0x2b9e38['id'],'direction':'in','ContactId':_0x2b9e38[_0xb218('0x53')],'AttachmentId':_0x16a0ad['body']['AttachmentId']});})[_0xb218('0x10')](function(_0x2e1d92){_0x38bc66[_0xb218('0x19')]=_0x2e1d92;if(_0x38bc66[_0xb218('0x51')]['UserId']){return db['User'][_0xb218('0x38')]({'attributes':['id',_0xb218('0x54')],'where':{'id':_0x38bc66[_0xb218('0x51')][_0xb218('0x55')]}})['then'](function(_0x59079a){if(_0x59079a){_0x38bc66[_0xb218('0x41')][_0xb218('0x56')]({'id':0x0,'priority':0x0,'app':_0xb218('0x57'),'appdata':_0x59079a[_0xb218('0x54')]+','+(_0x38bc66[_0xb218('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xb218('0x4f')});}return respondWithRpcPromise(_0xb218('0x58'),'startRouting',_0x38bc66);});}return respondWithRpcPromise('Start',_0xb218('0x59'),_0x38bc66);})[_0xb218('0x10')](function(_0x4f6fb4){_0x31c962(_0x4f6fb4);})['catch'](function(_0xcb3781){_0x3beab0(_0xbf0985[_0xb218('0x17')](0x1f4,_0xcb3781['message']));});});}; \ No newline at end of file +var _0x5b48=['AttachmentId','User','name','UserId','unshift','agent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','options','where','attributes','limit','map','include','model','then','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','Applications','get','applications','list','List','orderBy','priority','asc','length','create','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','ContactId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b48,0x116));var _0x85b4=function(_0x5785f5,_0x289cad){_0x5785f5=_0x5785f5-0x0;var _0xb76dee=_0x5b48[_0x5785f5];return _0xb76dee;};'use strict';var _=require(_0x85b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x85b4('0x1'));var rs=require(_0x85b4('0x2'));var fs=require('fs');var Redis=require(_0x85b4('0x3'));var db=require(_0x85b4('0x4'))['db'];var utils=require(_0x85b4('0x5'));var logger=require(_0x85b4('0x6'))(_0x85b4('0x7'));var config=require('../../config/environment');var jayson=require(_0x85b4('0x8'));var client=jayson[_0x85b4('0x9')]['http']({'port':0x232c});config[_0x85b4('0xa')]=_[_0x85b4('0xb')](config['redis'],{'host':_0x85b4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85b4('0xa')]));require(_0x85b4('0xd'))[_0x85b4('0xe')](socket);function respondWithRpcPromise(_0x14339d,_0xee59f,_0x32fd27){return new BPromise(function(_0x6d7344,_0x10e578){return client[_0x85b4('0xf')](_0x14339d,_0x32fd27)['then'](function(_0x1cf693){logger[_0x85b4('0x10')](_0x85b4('0x11'),_0xee59f,_0x85b4('0x12'));logger[_0x85b4('0x13')](_0x85b4('0x14'),_0xee59f,'request\x20sent',JSON[_0x85b4('0x15')](_0x1cf693));if(_0x1cf693[_0x85b4('0x16')]){if(_0x1cf693['error'][_0x85b4('0x17')]===0x1f4){logger[_0x85b4('0x16')](_0x85b4('0x11'),_0xee59f,_0x1cf693['error'][_0x85b4('0x18')]);return _0x10e578(_0x1cf693[_0x85b4('0x16')]['message']);}logger['error'](_0x85b4('0x11'),_0xee59f,_0x1cf693[_0x85b4('0x16')][_0x85b4('0x18')]);return _0x6d7344(_0x1cf693[_0x85b4('0x16')][_0x85b4('0x18')]);}else{logger[_0x85b4('0x10')](_0x85b4('0x11'),_0xee59f,_0x85b4('0x12'));_0x6d7344(_0x1cf693['result'][_0x85b4('0x18')]);}})[_0x85b4('0x19')](function(_0x303984){logger[_0x85b4('0x16')](_0x85b4('0x11'),_0xee59f,_0x303984);_0x10e578(_0x303984);});});}exports[_0x85b4('0x1a')]=function(_0x473ea8){var _0x1e2f8c=this;return new Promise(function(_0x2ecb6b,_0x5d1778){return db[_0x85b4('0x1b')]['findAll']({'raw':_0x473ea8[_0x85b4('0x1c')]?_0x473ea8[_0x85b4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x473ea8['options']?_0x473ea8[_0x85b4('0x1c')][_0x85b4('0x1d')]||null:null,'attributes':_0x473ea8['options']?_0x473ea8[_0x85b4('0x1c')][_0x85b4('0x1e')]||null:null,'limit':_0x473ea8[_0x85b4('0x1c')]?_0x473ea8[_0x85b4('0x1c')][_0x85b4('0x1f')]||null:null,'include':_0x473ea8[_0x85b4('0x1c')]?_0x473ea8['options']['include']?_[_0x85b4('0x20')](_0x473ea8[_0x85b4('0x1c')]['include'],function(_0x2af100){return{'model':db[_0x2af100['model']],'as':_0x2af100['as'],'attributes':_0x2af100[_0x85b4('0x1e')],'include':_0x2af100[_0x85b4('0x21')]?_['map'](_0x2af100[_0x85b4('0x21')],function(_0xe1eff5){return{'model':db[_0xe1eff5[_0x85b4('0x22')]],'as':_0xe1eff5['as'],'attributes':_0xe1eff5[_0x85b4('0x1e')],'include':_0xe1eff5[_0x85b4('0x21')]?_[_0x85b4('0x20')](_0xe1eff5[_0x85b4('0x21')],function(_0x59d96a){return{'model':db[_0x59d96a['model']],'as':_0x59d96a['as'],'attributes':_0x59d96a[_0x85b4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x85b4('0x23')](function(_0x1327ca){logger[_0x85b4('0x10')](_0x85b4('0x1a'),_0x473ea8);logger[_0x85b4('0x13')](_0x85b4('0x1a'),_0x473ea8,JSON[_0x85b4('0x15')](_0x1327ca));_0x2ecb6b(_0x1327ca);})[_0x85b4('0x19')](function(_0x742ca2){logger[_0x85b4('0x16')](_0x85b4('0x1a'),_0x742ca2[_0x85b4('0x18')],_0x473ea8);_0x5d1778(_0x1e2f8c['error'](0x1f4,_0x742ca2['message']));});});};exports[_0x85b4('0x24')]=function(_0xf40514,_0x6ab1b8,_0x2df0f9){var _0x2ee917=this;return new Promise(function(_0x20e369,_0xe678ce){var _0x45b9fa={'body':_0xf40514['body'],'channel':'fax'};var _0x54d9cf=[];var _0x49f864=[];var _0x45b4d2={};return db[_0x85b4('0x25')][_0x85b4('0x26')]()[_0x85b4('0x23')](function(_0x345932){if(!_0x345932){throw new db[(_0x85b4('0x27'))][(_0x85b4('0x28'))](_0x85b4('0x29'));}_0x54d9cf=_[_0x85b4('0x2a')](_[_0x85b4('0x2b')](_0x345932),['createdAt',_0x85b4('0x2c')]);_0x49f864=_[_0x85b4('0x2a')](_[_0x85b4('0x2b')](_0x345932),[_0x85b4('0x2d'),_0x85b4('0x2c'),_0x85b4('0x2e'),_0x85b4('0x2f')]);if(_0xf40514[_0x85b4('0x30')]['id']){delete _0xf40514['body']['id'];}if(_[_0x85b4('0x31')](_0xf40514[_0x85b4('0x30')][_0x85b4('0x32')])){throw new db[(_0x85b4('0x27'))][(_0x85b4('0x28'))](_0x85b4('0x33'));}if(_['isNil'](_0xf40514['body'][_0x85b4('0x30')])||_0xf40514[_0x85b4('0x30')][_0x85b4('0x30')]===''){throw new db[(_0x85b4('0x27'))][(_0x85b4('0x28'))](_0x85b4('0x34'));}if(_[_0x85b4('0x31')](_0xf40514[_0x85b4('0x30')][_0x85b4('0x35')])){throw new db[(_0x85b4('0x27'))][(_0x85b4('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49f864);}if(!_[_0x85b4('0x36')](_0x49f864,_0xf40514[_0x85b4('0x30')][_0x85b4('0x35')])){throw new db[(_0x85b4('0x27'))][(_0x85b4('0x28'))](_0x85b4('0x37')+_0x49f864);}_0x45b4d2[_0xf40514[_0x85b4('0x30')][_0x85b4('0x35')]]=_0xf40514[_0x85b4('0x30')][_0x85b4('0x32')];})[_0x85b4('0x23')](function(){return db[_0x85b4('0x1b')][_0x85b4('0x38')]({'where':{'id':_0xf40514[_0x85b4('0x39')]['id']},'include':[{'model':db[_0x85b4('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':_0x85b4('0x3b'),'where':_0x45b4d2,'limit':0x1,'order':[[_0x85b4('0x2c'),_0x85b4('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0x85b4('0x3d')}]});})[_0x85b4('0x23')](function(_0x58c878){if(_0x58c878&&_0x58c878['List']){var _0x47594d=_0x58c878[_0x85b4('0x3e')]({'plain':!![]});_0x45b9fa[_0x85b4('0x39')]=_0x47594d;_0x45b9fa[_0x85b4('0x3f')]=_0x47594d['Applications'];_0x45b9fa[_0x85b4('0x40')]=_0x47594d[_0x85b4('0x41')];_0x45b9fa[_0x85b4('0x3f')]=_[_0x85b4('0x42')](_0x45b9fa[_0x85b4('0x3f')],[_0x85b4('0x43')],[_0x85b4('0x44')]);if(_0x45b9fa[_0x85b4('0x39')][_0x85b4('0x3d')]){delete _0x45b9fa[_0x85b4('0x39')][_0x85b4('0x3d')];}if(_0x45b9fa['account'][_0x85b4('0x41')]&&_0x45b9fa[_0x85b4('0x39')]['List'][_0x85b4('0x3b')][_0x85b4('0x45')]){return _0x45b9fa[_0x85b4('0x39')][_0x85b4('0x41')][_0x85b4('0x3b')][0x0];}var _0x4da3c8=_[_0x85b4('0xb')](_0xf40514[_0x85b4('0x30')],{'firstName':_0xf40514[_0x85b4('0x30')][_0x85b4('0x32')],'ListId':_0x47594d[_0x85b4('0x2f')]});_0x4da3c8[_0xf40514[_0x85b4('0x30')][_0x85b4('0x35')]]=_0xf40514[_0x85b4('0x30')][_0x85b4('0x32')];return db[_0x85b4('0x25')][_0x85b4('0x46')](_0x4da3c8,{'fields':_0x54d9cf,'raw':!![]});}})['then'](function(_0x15b498){_0x45b9fa['contact']=_0x15b498;if(_0x15b498){var _0x82905c={'ContactId':_0x15b498['id'],'FaxAccountId':_0xf40514['account']['id'],'fax':_0x15b498[_0x85b4('0x47')]};return db['FaxInteraction'][_0x85b4('0x38')]({'where':{'ContactId':_0x15b498['id'],'closed':![],'FaxAccountId':_0xf40514[_0x85b4('0x39')]['id']}})[_0x85b4('0x23')](function(_0x3347c4){if(_0x3347c4){return[_0x3347c4,![]];}return db[_0x85b4('0x48')][_0x85b4('0x46')](_0x82905c)[_0x85b4('0x23')](function(_0x2a695e){return[_0x2a695e,!![]];});});}else{throw new Error(_0x85b4('0x49'));}})[_0x85b4('0x4a')](function(_0x231546,_0x468030){var _0x233aa1=_0x231546[_0x85b4('0x3e')]({'plain':!![]});if(_0x468030){if(_0x45b9fa['account'][_0x85b4('0x4b')]){_0x45b9fa['applications']['push']({'id':0x0,'priority':_0x45b9fa['applications']['length']+0x1,'app':_0x85b4('0x4c'),'appdata':_0x85b4('0x4d'),'interval':_0x85b4('0x4e')});}_0x233aa1[_0x85b4('0x4f')]=!![];}else{_0x233aa1['created']=![];}_0x45b9fa[_0x85b4('0x50')]=_0x233aa1;return db['FaxMessage'][_0x85b4('0x46')]({'body':_0xf40514['body'][_0x85b4('0x30')],'FaxAccountId':_0xf40514[_0x85b4('0x39')]['id'],'FaxInteractionId':_0x231546['id'],'direction':'in','ContactId':_0x231546[_0x85b4('0x51')],'AttachmentId':_0xf40514[_0x85b4('0x30')][_0x85b4('0x52')]});})[_0x85b4('0x23')](function(_0x4a3d92){_0x45b9fa['message']=_0x4a3d92;if(_0x45b9fa[_0x85b4('0x50')]['UserId']){return db[_0x85b4('0x53')][_0x85b4('0x38')]({'attributes':['id',_0x85b4('0x54')],'where':{'id':_0x45b9fa['interaction'][_0x85b4('0x55')]}})[_0x85b4('0x23')](function(_0x64b5a7){if(_0x64b5a7){_0x45b9fa[_0x85b4('0x3f')][_0x85b4('0x56')]({'id':0x0,'priority':0x0,'app':_0x85b4('0x57'),'appdata':_0x64b5a7[_0x85b4('0x54')]+','+(_0x45b9fa[_0x85b4('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x85b4('0x4e')});}return respondWithRpcPromise(_0x85b4('0x58'),_0x85b4('0x59'),_0x45b9fa);});}return respondWithRpcPromise(_0x85b4('0x58'),_0x85b4('0x59'),_0x45b9fa);})[_0x85b4('0x23')](function(_0x15320f){_0x20e369(_0x15320f);})[_0x85b4('0x19')](function(_0x29448d){_0xe678ce(_0x2ee917['error'](0x1f4,_0x29448d[_0x85b4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 7a68143..76d8f95 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 _0x4de6=['save','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0x5bfd00,_0x3e3371){var _0x440238=function(_0x32cf59){while(--_0x32cf59){_0x5bfd00['push'](_0x5bfd00['shift']());}};_0x440238(++_0x3e3371);}(_0x4de6,0xd1));var _0x64de=function(_0xe4df76,_0xa0223b){_0xe4df76=_0xe4df76-0x0;var _0x52a130=_0x4de6[_0xe4df76];return _0x52a130;};'use strict';var FaxAccountEvents=require(_0x64de('0x0'));var events=[_0x64de('0x1'),'remove','update'];function createListener(_0xb040c4,_0x5f1dbf){return function(_0x30e811){_0x5f1dbf['emit'](_0xb040c4,_0x30e811);};}function removeListener(_0x4518f6,_0x154f2f){return function(){FaxAccountEvents[_0x64de('0x2')](_0x4518f6,_0x154f2f);};}exports['register']=function(_0x121bf1){for(var _0x4684ac=0x0,_0xc24b77=events[_0x64de('0x3')];_0x4684ac<_0xc24b77;_0x4684ac++){var _0x4d7ee4=events[_0x4684ac];var _0x299fd8=createListener(_0x64de('0x4')+_0x4d7ee4,_0x121bf1);FaxAccountEvents['on'](_0x4d7ee4,_0x299fd8);}}; \ No newline at end of file +var _0xe8c2=['save','remove','update','emit','removeListener','register','length','./faxAccount.events'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe8c2,0x11f));var _0x2e8c=function(_0x2602a7,_0x4ec41e){_0x2602a7=_0x2602a7-0x0;var _0x17c99a=_0xe8c2[_0x2602a7];return _0x17c99a;};'use strict';var FaxAccountEvents=require(_0x2e8c('0x0'));var events=[_0x2e8c('0x1'),_0x2e8c('0x2'),_0x2e8c('0x3')];function createListener(_0x3a668e,_0x27e839){return function(_0x29cd45){_0x27e839[_0x2e8c('0x4')](_0x3a668e,_0x29cd45);};}function removeListener(_0x1d349d,_0x1fa18e){return function(){FaxAccountEvents[_0x2e8c('0x5')](_0x1d349d,_0x1fa18e);};}exports[_0x2e8c('0x6')]=function(_0x3c407c){for(var _0x2f2a2d=0x0,_0x5890b5=events[_0x2e8c('0x7')];_0x2f2a2d<_0x5890b5;_0x2f2a2d++){var _0x86cc28=events[_0x2f2a2d];var _0x52f0c5=createListener('faxAccount:'+_0x86cc28,_0x3c407c);FaxAccountEvents['on'](_0x86cc28,_0x52f0c5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 8da2580..c1790a8 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(_0x3ebdee,_0x1cf5ca){var _0x3eb0f9=function(_0x37312f){while(--_0x37312f){_0x3ebdee['push'](_0x3ebdee['shift']());}};_0x3eb0f9(++_0x1cf5ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x43c3e2,_0x32d556){var _0x1b87bb=function(_0x92b3e3){while(--_0x92b3e3){_0x43c3e2['push'](_0x43c3e2['shift']());}};_0x1b87bb(++_0x32d556);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 a650764..0210918 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 _0xc600=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x14d866,_0x2da407){var _0x34ca21=function(_0x1386ed){while(--_0x1386ed){_0x14d866['push'](_0x14d866['shift']());}};_0x34ca21(++_0x2da407);}(_0xc600,0xef));var _0x0c60=function(_0x36d824,_0x28c308){_0x36d824=_0x36d824-0x0;var _0x2031fd=_0xc600[_0x36d824];return _0x2031fd;};'use strict';var Sequelize=require(_0x0c60('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0c60('0x1')],'allowNull':![],'defaultValue':_0x0c60('0x2')},'appdata':{'type':Sequelize[_0x0c60('0x3')]()},'description':{'type':Sequelize[_0x0c60('0x1')]},'interval':{'type':Sequelize[_0x0c60('0x1')],'defaultValue':_0x0c60('0x4')}}; \ No newline at end of file +var _0xe929=['STRING','*,*,*,*','sequelize','exports'];(function(_0x13f15f,_0x14aa56){var _0x363445=function(_0x2bc11a){while(--_0x2bc11a){_0x13f15f['push'](_0x13f15f['shift']());}};_0x363445(++_0x14aa56);}(_0xe929,0x1d6));var _0x9e92=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0xe929[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require(_0x9e92('0x0'));module[_0x9e92('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9e92('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9e92('0x2')]},'interval':{'type':Sequelize[_0x9e92('0x2')],'defaultValue':_0x9e92('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 5f06412..7f78961 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 _0xe1c4=['offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','FaxApplication','rawAttributes','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x37b624,_0x45ef04){var _0x4724a3=function(_0x4f80c0){while(--_0x4f80c0){_0x37b624['push'](_0x37b624['shift']());}};_0x4724a3(++_0x45ef04);}(_0xe1c4,0x14e));var _0x4e1c=function(_0x329a5d,_0x4a886d){_0x329a5d=_0x329a5d-0x0;var _0x56d83d=_0xe1c4[_0x329a5d];return _0x56d83d;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require(_0x4e1c('0x3'));var rp=require(_0x4e1c('0x4'));var moment=require('moment');var BPromise=require(_0x4e1c('0x5'));var Mustache=require(_0x4e1c('0x6'));var util=require('util');var path=require(_0x4e1c('0x7'));var sox=require(_0x4e1c('0x8'));var csv=require(_0x4e1c('0x9'));var ejs=require(_0x4e1c('0xa'));var fs=require('fs');var fs_extra=require(_0x4e1c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e1c('0xc'));var jsforce=require(_0x4e1c('0xd'));var deskjs=require(_0x4e1c('0xe'));var toCsv=require(_0x4e1c('0x9'));var querystring=require(_0x4e1c('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e1c('0x10'));var authService=require(_0x4e1c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e1c('0x12'))(_0x4e1c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4e1c('0x14'));var db=require(_0x4e1c('0x15'))['db'];function respondWithStatusCode(_0x14ebb4,_0x4b3f54){_0x4b3f54=_0x4b3f54||0xcc;return function(_0x5c1579){if(_0x5c1579){return _0x14ebb4[_0x4e1c('0x16')](_0x4b3f54);}return _0x14ebb4[_0x4e1c('0x17')](_0x4b3f54)[_0x4e1c('0x18')]();};}function respondWithResult(_0x2172fe,_0x1ea103){_0x1ea103=_0x1ea103||0xc8;return function(_0x342cb5){if(_0x342cb5){return _0x2172fe['status'](_0x1ea103)[_0x4e1c('0x19')](_0x342cb5);}};}function respondWithFilteredResult(_0x5bd21c,_0x4c2a41){return function(_0x24732c){if(_0x24732c){var _0x59b6e9=typeof _0x4c2a41[_0x4e1c('0x1a')]==='undefined'&&typeof _0x4c2a41['limit']===_0x4e1c('0x1b');var _0x5a83c1=_0x24732c[_0x4e1c('0x1c')];var _0x58525f=_0x59b6e9?0x0:_0x4c2a41[_0x4e1c('0x1a')];var _0xf07ed5=_0x59b6e9?_0x24732c[_0x4e1c('0x1c')]:_0x4c2a41[_0x4e1c('0x1a')]+_0x4c2a41[_0x4e1c('0x1d')];var _0xc53691;if(_0xf07ed5>=_0x5a83c1){_0xf07ed5=_0x5a83c1;_0xc53691=0xc8;}else{_0xc53691=0xce;}_0x5bd21c['status'](_0xc53691);return _0x5bd21c[_0x4e1c('0x1e')](_0x4e1c('0x1f'),_0x58525f+'-'+_0xf07ed5+'/'+_0x5a83c1)[_0x4e1c('0x19')](_0x24732c);}return null;};}function patchUpdates(_0x4cde74){return function(_0x4413a0){try{jsonpatch[_0x4e1c('0x20')](_0x4413a0,_0x4cde74,!![]);}catch(_0x59126f){return BPromise['reject'](_0x59126f);}return _0x4413a0[_0x4e1c('0x21')]();};}function saveUpdates(_0x1531fd,_0xbe3ba9){return function(_0x22044d){if(_0x22044d){return _0x22044d[_0x4e1c('0x22')](_0x1531fd)['then'](function(_0xe1e975){return _0xe1e975;});}return null;};}function removeEntity(_0x1be206,_0x4ca89e){return function(_0x1f83cc){if(_0x1f83cc){return _0x1f83cc['destroy']()[_0x4e1c('0x23')](function(){_0x1be206['status'](0xcc)[_0x4e1c('0x18')]();});}};}function handleEntityNotFound(_0x304162,_0xc3068b){return function(_0x26b6fb){if(!_0x26b6fb){_0x304162[_0x4e1c('0x16')](0x194);}return _0x26b6fb;};}function handleError(_0x5299af,_0x231e36){_0x231e36=_0x231e36||0x1f4;return function(_0x5dbfd5){logger[_0x4e1c('0x24')](_0x5dbfd5['stack']);if(_0x5dbfd5[_0x4e1c('0x25')]){delete _0x5dbfd5[_0x4e1c('0x25')];}_0x5299af[_0x4e1c('0x17')](_0x231e36)[_0x4e1c('0x26')](_0x5dbfd5);};}exports[_0x4e1c('0x27')]=function(_0x5bd7f8,_0x26e59f){var _0x23f203={},_0x3389e0={},_0x291379={'count':0x0,'rows':[]};var _0x34b717=_[_0x4e1c('0x28')](db[_0x4e1c('0x29')][_0x4e1c('0x2a')],function(_0x5639fc){return{'name':_0x5639fc['fieldName'],'type':_0x5639fc['type'][_0x4e1c('0x2b')]};});_0x3389e0[_0x4e1c('0x2c')]=_['map'](_0x34b717,_0x4e1c('0x25'));_0x3389e0[_0x4e1c('0x2d')]=_[_0x4e1c('0x2e')](_0x5bd7f8[_0x4e1c('0x2d')]);_0x3389e0[_0x4e1c('0x2f')]=_['intersection'](_0x3389e0[_0x4e1c('0x2c')],_0x3389e0[_0x4e1c('0x2d')]);_0x23f203['attributes']=_['intersection'](_0x3389e0['model'],qs[_0x4e1c('0x30')](_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x30')]));_0x23f203[_0x4e1c('0x31')]=_0x23f203[_0x4e1c('0x31')][_0x4e1c('0x32')]?_0x23f203[_0x4e1c('0x31')]:_0x3389e0[_0x4e1c('0x2c')];if(!_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x33')](_0x4e1c('0x34'))){_0x23f203['limit']=qs[_0x4e1c('0x1d')](_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x1d')]);_0x23f203['offset']=qs['offset'](_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x1a')]);}_0x23f203[_0x4e1c('0x35')]=qs[_0x4e1c('0x36')](_0x5bd7f8['query'][_0x4e1c('0x36')]);_0x23f203[_0x4e1c('0x37')]=qs['filters'](_[_0x4e1c('0x38')](_0x5bd7f8[_0x4e1c('0x2d')],_0x3389e0[_0x4e1c('0x2f')]),_0x34b717);if(_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x39')]){_0x23f203[_0x4e1c('0x37')]=_[_0x4e1c('0x3a')](_0x23f203[_0x4e1c('0x37')],{'$or':_[_0x4e1c('0x28')](_0x34b717,function(_0x1770f9){if(_0x1770f9[_0x4e1c('0x3b')]!==_0x4e1c('0x3c')){var _0x49147d={};_0x49147d[_0x1770f9['name']]={'$like':'%'+_0x5bd7f8['query'][_0x4e1c('0x39')]+'%'};return _0x49147d;}})});}_0x23f203=_['merge']({},_0x23f203,_0x5bd7f8[_0x4e1c('0x3d')]);var _0x373147={'where':_0x23f203[_0x4e1c('0x37')]};return db['FaxApplication'][_0x4e1c('0x1c')](_0x373147)[_0x4e1c('0x23')](function(_0x173d93){_0x291379[_0x4e1c('0x1c')]=_0x173d93;if(_0x5bd7f8[_0x4e1c('0x2d')][_0x4e1c('0x3e')]){_0x23f203['include']=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x23f203);})[_0x4e1c('0x23')](function(_0x4aa826){_0x291379[_0x4e1c('0x3f')]=_0x4aa826;return _0x291379;})['then'](respondWithFilteredResult(_0x26e59f,_0x23f203))[_0x4e1c('0x40')](handleError(_0x26e59f,null));};exports[_0x4e1c('0x41')]=function(_0x4cc9ea,_0x113e08){var _0x49ccec={'raw':!![],'where':{'id':_0x4cc9ea[_0x4e1c('0x42')]['id']}},_0x5e1262={};_0x5e1262[_0x4e1c('0x2c')]=_[_0x4e1c('0x2e')](db[_0x4e1c('0x29')][_0x4e1c('0x2a')]);_0x5e1262[_0x4e1c('0x2d')]=_[_0x4e1c('0x2e')](_0x4cc9ea[_0x4e1c('0x2d')]);_0x5e1262[_0x4e1c('0x2f')]=_[_0x4e1c('0x43')](_0x5e1262[_0x4e1c('0x2c')],_0x5e1262[_0x4e1c('0x2d')]);_0x49ccec['attributes']=_[_0x4e1c('0x43')](_0x5e1262[_0x4e1c('0x2c')],qs[_0x4e1c('0x30')](_0x4cc9ea[_0x4e1c('0x2d')]['fields']));_0x49ccec[_0x4e1c('0x31')]=_0x49ccec[_0x4e1c('0x31')][_0x4e1c('0x32')]?_0x49ccec[_0x4e1c('0x31')]:_0x5e1262[_0x4e1c('0x2c')];if(_0x4cc9ea[_0x4e1c('0x2d')]['includeAll']){_0x49ccec[_0x4e1c('0x44')]=[{'all':!![]}];}_0x49ccec=_['merge']({},_0x49ccec,_0x4cc9ea[_0x4e1c('0x3d')]);return db[_0x4e1c('0x29')][_0x4e1c('0x45')](_0x49ccec)[_0x4e1c('0x23')](handleEntityNotFound(_0x113e08,null))[_0x4e1c('0x23')](respondWithResult(_0x113e08,null))[_0x4e1c('0x40')](handleError(_0x113e08,null));};exports[_0x4e1c('0x46')]=function(_0x5e47f2,_0x2781bd){return db[_0x4e1c('0x29')][_0x4e1c('0x46')](_0x5e47f2[_0x4e1c('0x47')],{})[_0x4e1c('0x23')](respondWithResult(_0x2781bd,0xc9))[_0x4e1c('0x40')](handleError(_0x2781bd,null));};exports[_0x4e1c('0x22')]=function(_0x53e133,_0x992229){if(_0x53e133[_0x4e1c('0x47')]['id']){delete _0x53e133['body']['id'];}return db[_0x4e1c('0x29')][_0x4e1c('0x45')]({'where':{'id':_0x53e133[_0x4e1c('0x42')]['id']}})[_0x4e1c('0x23')](handleEntityNotFound(_0x992229,null))[_0x4e1c('0x23')](saveUpdates(_0x53e133[_0x4e1c('0x47')],null))[_0x4e1c('0x23')](respondWithResult(_0x992229,null))['catch'](handleError(_0x992229,null));};exports['destroy']=function(_0x206187,_0x5e8b9e){return db[_0x4e1c('0x29')]['find']({'where':{'id':_0x206187[_0x4e1c('0x42')]['id']}})[_0x4e1c('0x23')](handleEntityNotFound(_0x5e8b9e,null))[_0x4e1c('0x23')](removeEntity(_0x5e8b9e,null))['catch'](handleError(_0x5e8b9e,null));}; \ No newline at end of file +var _0x47ab=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type'];(function(_0x5b029f,_0xb37497){var _0x5b5c48=function(_0x129cf6){while(--_0x129cf6){_0x5b029f['push'](_0x5b029f['shift']());}};_0x5b5c48(++_0xb37497);}(_0x47ab,0x1a9));var _0xb47a=function(_0x3f3bdd,_0x22e8c6){_0x3f3bdd=_0x3f3bdd-0x0;var _0x2d40bd=_0x47ab[_0x3f3bdd];return _0x2d40bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb47a('0x0'));var zipdir=require(_0xb47a('0x1'));var jsonpatch=require(_0xb47a('0x2'));var rp=require('request-promise');var moment=require(_0xb47a('0x3'));var BPromise=require(_0xb47a('0x4'));var Mustache=require(_0xb47a('0x5'));var util=require(_0xb47a('0x6'));var path=require(_0xb47a('0x7'));var sox=require('sox');var csv=require(_0xb47a('0x8'));var ejs=require(_0xb47a('0x9'));var fs=require('fs');var fs_extra=require(_0xb47a('0xa'));var _=require(_0xb47a('0xb'));var squel=require(_0xb47a('0xc'));var crypto=require(_0xb47a('0xd'));var jsforce=require(_0xb47a('0xe'));var deskjs=require(_0xb47a('0xf'));var toCsv=require(_0xb47a('0x8'));var querystring=require(_0xb47a('0x10'));var Papa=require(_0xb47a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb47a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb47a('0x13'));var logger=require(_0xb47a('0x14'))(_0xb47a('0x15'));var utils=require('../../config/utils');var config=require(_0xb47a('0x16'));var licenseUtil=require(_0xb47a('0x17'));var db=require(_0xb47a('0x18'))['db'];function respondWithStatusCode(_0x1ba8ec,_0x5f22cf){_0x5f22cf=_0x5f22cf||0xcc;return function(_0x28ba38){if(_0x28ba38){return _0x1ba8ec[_0xb47a('0x19')](_0x5f22cf);}return _0x1ba8ec[_0xb47a('0x1a')](_0x5f22cf)['end']();};}function respondWithResult(_0x5c4a48,_0x3ddcb7){_0x3ddcb7=_0x3ddcb7||0xc8;return function(_0x3c4bda){if(_0x3c4bda){return _0x5c4a48['status'](_0x3ddcb7)[_0xb47a('0x1b')](_0x3c4bda);}};}function respondWithFilteredResult(_0x1a3f23,_0x4dfb97){return function(_0x36b9c4){if(_0x36b9c4){var _0xe2c5f0=typeof _0x4dfb97[_0xb47a('0x1c')]===_0xb47a('0x1d')&&typeof _0x4dfb97[_0xb47a('0x1e')]==='undefined';var _0x24e7ce=_0x36b9c4[_0xb47a('0x1f')];var _0x5c40f9=_0xe2c5f0?0x0:_0x4dfb97['offset'];var _0x92c3c2=_0xe2c5f0?_0x36b9c4['count']:_0x4dfb97['offset']+_0x4dfb97[_0xb47a('0x1e')];var _0x1c3a3f;if(_0x92c3c2>=_0x24e7ce){_0x92c3c2=_0x24e7ce;_0x1c3a3f=0xc8;}else{_0x1c3a3f=0xce;}_0x1a3f23['status'](_0x1c3a3f);return _0x1a3f23['set'](_0xb47a('0x20'),_0x5c40f9+'-'+_0x92c3c2+'/'+_0x24e7ce)[_0xb47a('0x1b')](_0x36b9c4);}return null;};}function patchUpdates(_0x223347){return function(_0x5f4096){try{jsonpatch[_0xb47a('0x21')](_0x5f4096,_0x223347,!![]);}catch(_0x40fd19){return BPromise[_0xb47a('0x22')](_0x40fd19);}return _0x5f4096[_0xb47a('0x23')]();};}function saveUpdates(_0x1e01c4,_0x4489ec){return function(_0x1f2f66){if(_0x1f2f66){return _0x1f2f66['update'](_0x1e01c4)[_0xb47a('0x24')](function(_0x249140){return _0x249140;});}return null;};}function removeEntity(_0x175dd0,_0x51c1c9){return function(_0x9aece6){if(_0x9aece6){return _0x9aece6[_0xb47a('0x25')]()['then'](function(){_0x175dd0[_0xb47a('0x1a')](0xcc)[_0xb47a('0x26')]();});}};}function handleEntityNotFound(_0x2a79f9,_0x1f185e){return function(_0x5b9c8a){if(!_0x5b9c8a){_0x2a79f9[_0xb47a('0x19')](0x194);}return _0x5b9c8a;};}function handleError(_0x41db48,_0x23c188){_0x23c188=_0x23c188||0x1f4;return function(_0x24bef1){logger[_0xb47a('0x27')](_0x24bef1[_0xb47a('0x28')]);if(_0x24bef1[_0xb47a('0x29')]){delete _0x24bef1[_0xb47a('0x29')];}_0x41db48[_0xb47a('0x1a')](_0x23c188)[_0xb47a('0x2a')](_0x24bef1);};}exports[_0xb47a('0x2b')]=function(_0x26372e,_0x5447ed){var _0x181195={},_0x5d26a5={},_0x531897={'count':0x0,'rows':[]};var _0x5677bc=_[_0xb47a('0x2c')](db[_0xb47a('0x2d')][_0xb47a('0x2e')],function(_0x1b82d1){return{'name':_0x1b82d1[_0xb47a('0x2f')],'type':_0x1b82d1[_0xb47a('0x30')][_0xb47a('0x31')]};});_0x5d26a5[_0xb47a('0x32')]=_[_0xb47a('0x2c')](_0x5677bc,_0xb47a('0x29'));_0x5d26a5[_0xb47a('0x33')]=_[_0xb47a('0x34')](_0x26372e[_0xb47a('0x33')]);_0x5d26a5['filters']=_[_0xb47a('0x35')](_0x5d26a5[_0xb47a('0x32')],_0x5d26a5[_0xb47a('0x33')]);_0x181195[_0xb47a('0x36')]=_[_0xb47a('0x35')](_0x5d26a5[_0xb47a('0x32')],qs[_0xb47a('0x37')](_0x26372e[_0xb47a('0x33')]['fields']));_0x181195[_0xb47a('0x36')]=_0x181195[_0xb47a('0x36')]['length']?_0x181195['attributes']:_0x5d26a5[_0xb47a('0x32')];if(!_0x26372e['query'][_0xb47a('0x38')](_0xb47a('0x39'))){_0x181195[_0xb47a('0x1e')]=qs[_0xb47a('0x1e')](_0x26372e[_0xb47a('0x33')][_0xb47a('0x1e')]);_0x181195['offset']=qs[_0xb47a('0x1c')](_0x26372e[_0xb47a('0x33')][_0xb47a('0x1c')]);}_0x181195[_0xb47a('0x3a')]=qs[_0xb47a('0x3b')](_0x26372e['query']['sort']);_0x181195['where']=qs['filters'](_[_0xb47a('0x3c')](_0x26372e[_0xb47a('0x33')],_0x5d26a5[_0xb47a('0x3d')]),_0x5677bc);if(_0x26372e[_0xb47a('0x33')][_0xb47a('0x3e')]){_0x181195[_0xb47a('0x3f')]=_[_0xb47a('0x40')](_0x181195[_0xb47a('0x3f')],{'$or':_[_0xb47a('0x2c')](_0x5677bc,function(_0x2203ca){if(_0x2203ca[_0xb47a('0x30')]!==_0xb47a('0x41')){var _0x6a180={};_0x6a180[_0x2203ca[_0xb47a('0x29')]]={'$like':'%'+_0x26372e[_0xb47a('0x33')][_0xb47a('0x3e')]+'%'};return _0x6a180;}})});}_0x181195=_[_0xb47a('0x40')]({},_0x181195,_0x26372e[_0xb47a('0x42')]);var _0x165ab0={'where':_0x181195[_0xb47a('0x3f')]};return db[_0xb47a('0x2d')][_0xb47a('0x1f')](_0x165ab0)[_0xb47a('0x24')](function(_0x4d4036){_0x531897[_0xb47a('0x1f')]=_0x4d4036;if(_0x26372e[_0xb47a('0x33')][_0xb47a('0x43')]){_0x181195['include']=[{'all':!![]}];}return db[_0xb47a('0x2d')][_0xb47a('0x44')](_0x181195);})[_0xb47a('0x24')](function(_0x2ee858){_0x531897[_0xb47a('0x45')]=_0x2ee858;return _0x531897;})[_0xb47a('0x24')](respondWithFilteredResult(_0x5447ed,_0x181195))[_0xb47a('0x46')](handleError(_0x5447ed,null));};exports[_0xb47a('0x47')]=function(_0xcd861a,_0x13dd32){var _0x3b1602={'raw':!![],'where':{'id':_0xcd861a[_0xb47a('0x48')]['id']}},_0x431e90={};_0x431e90['model']=_[_0xb47a('0x34')](db[_0xb47a('0x2d')][_0xb47a('0x2e')]);_0x431e90['query']=_[_0xb47a('0x34')](_0xcd861a[_0xb47a('0x33')]);_0x431e90[_0xb47a('0x3d')]=_[_0xb47a('0x35')](_0x431e90['model'],_0x431e90[_0xb47a('0x33')]);_0x3b1602[_0xb47a('0x36')]=_[_0xb47a('0x35')](_0x431e90[_0xb47a('0x32')],qs[_0xb47a('0x37')](_0xcd861a['query'][_0xb47a('0x37')]));_0x3b1602[_0xb47a('0x36')]=_0x3b1602[_0xb47a('0x36')][_0xb47a('0x49')]?_0x3b1602[_0xb47a('0x36')]:_0x431e90['model'];if(_0xcd861a[_0xb47a('0x33')][_0xb47a('0x43')]){_0x3b1602[_0xb47a('0x4a')]=[{'all':!![]}];}_0x3b1602=_['merge']({},_0x3b1602,_0xcd861a[_0xb47a('0x42')]);return db['FaxApplication']['find'](_0x3b1602)[_0xb47a('0x24')](handleEntityNotFound(_0x13dd32,null))[_0xb47a('0x24')](respondWithResult(_0x13dd32,null))['catch'](handleError(_0x13dd32,null));};exports['create']=function(_0x11c1e6,_0x2696a4){return db[_0xb47a('0x2d')][_0xb47a('0x4b')](_0x11c1e6[_0xb47a('0x4c')],{})[_0xb47a('0x24')](respondWithResult(_0x2696a4,0xc9))[_0xb47a('0x46')](handleError(_0x2696a4,null));};exports[_0xb47a('0x4d')]=function(_0x54f5cd,_0x4d6911){if(_0x54f5cd['body']['id']){delete _0x54f5cd[_0xb47a('0x4c')]['id'];}return db['FaxApplication'][_0xb47a('0x4e')]({'where':{'id':_0x54f5cd[_0xb47a('0x48')]['id']}})[_0xb47a('0x24')](handleEntityNotFound(_0x4d6911,null))[_0xb47a('0x24')](saveUpdates(_0x54f5cd[_0xb47a('0x4c')],null))[_0xb47a('0x24')](respondWithResult(_0x4d6911,null))[_0xb47a('0x46')](handleError(_0x4d6911,null));};exports[_0xb47a('0x25')]=function(_0x565ad7,_0x422a82){return db[_0xb47a('0x2d')][_0xb47a('0x4e')]({'where':{'id':_0x565ad7['params']['id']}})['then'](handleEntityNotFound(_0x422a82,null))[_0xb47a('0x24')](removeEntity(_0x422a82,null))['catch'](handleError(_0x422a82,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index aa46bb1..5a34297 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 _0xe836=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications'];(function(_0x3e9137,_0x50f4c6){var _0x34220d=function(_0x4ec3c3){while(--_0x4ec3c3){_0x3e9137['push'](_0x3e9137['shift']());}};_0x34220d(++_0x50f4c6);}(_0xe836,0x9c));var _0x6e83=function(_0xa66c3a,_0x1706af){_0xa66c3a=_0xa66c3a-0x0;var _0x1aeb43=_0xe836[_0xa66c3a];return _0x1aeb43;};'use strict';var _=require(_0x6e83('0x0'));var util=require(_0x6e83('0x1'));var logger=require(_0x6e83('0x2'))(_0x6e83('0x3'));var moment=require(_0x6e83('0x4'));var BPromise=require('bluebird');var rp=require(_0x6e83('0x5'));var fs=require('fs');var path=require(_0x6e83('0x6'));var rimraf=require('rimraf');var config=require(_0x6e83('0x7'));var attributes=require(_0x6e83('0x8'));module['exports']=function(_0x5fa340,_0x5a2392){return _0x5fa340[_0x6e83('0x9')](_0x6e83('0xa'),attributes,{'tableName':_0x6e83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e83('0xc'),'collate':_0x6e83('0xd')});}; \ No newline at end of file +var _0xc3f5=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x5d1c89,_0x48bcc1){var _0x37fc74=function(_0x594e55){while(--_0x594e55){_0x5d1c89['push'](_0x5d1c89['shift']());}};_0x37fc74(++_0x48bcc1);}(_0xc3f5,0xbe));var _0x5c3f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc3f5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5c3f('0x0'));var util=require(_0x5c3f('0x1'));var logger=require('../../config/logger')(_0x5c3f('0x2'));var moment=require(_0x5c3f('0x3'));var BPromise=require(_0x5c3f('0x4'));var rp=require(_0x5c3f('0x5'));var fs=require('fs');var path=require(_0x5c3f('0x6'));var rimraf=require(_0x5c3f('0x7'));var config=require(_0x5c3f('0x8'));var attributes=require(_0x5c3f('0x9'));module[_0x5c3f('0xa')]=function(_0x2a796f,_0x27a211){return _0x2a796f[_0x5c3f('0xb')]('FaxApplication',attributes,{'tableName':_0x5c3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c3f('0xd'),'collate':_0x5c3f('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index eff95cc..2741607 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 _0xfe5d=['update','body','options','raw','where','attributes','limit','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication'];(function(_0x3bc034,_0x236d66){var _0x6aa458=function(_0xee694e){while(--_0xee694e){_0x3bc034['push'](_0x3bc034['shift']());}};_0x6aa458(++_0x236d66);}(_0xfe5d,0x1ba));var _0xdfe5=function(_0x3f3dd6,_0x3176d5){_0x3f3dd6=_0x3f3dd6-0x0;var _0x56cb4e=_0xfe5d[_0x3f3dd6];return _0x56cb4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdfe5('0x0'));var BPromise=require('bluebird');var rs=require(_0xdfe5('0x1'));var fs=require('fs');var Redis=require(_0xdfe5('0x2'));var db=require(_0xdfe5('0x3'))['db'];var utils=require(_0xdfe5('0x4'));var logger=require(_0xdfe5('0x5'))(_0xdfe5('0x6'));var config=require(_0xdfe5('0x7'));var jayson=require(_0xdfe5('0x8'));var client=jayson[_0xdfe5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e595c,_0x82d109,_0x175cd5){return new BPromise(function(_0x425484,_0x1a33a7){return client['request'](_0x1e595c,_0x175cd5)[_0xdfe5('0xa')](function(_0x27c63a){logger[_0xdfe5('0xb')](_0xdfe5('0xc'),_0x82d109,_0xdfe5('0xd'));logger['debug'](_0xdfe5('0xe'),_0x82d109,_0xdfe5('0xd'),JSON[_0xdfe5('0xf')](_0x27c63a));if(_0x27c63a[_0xdfe5('0x10')]){if(_0x27c63a[_0xdfe5('0x10')][_0xdfe5('0x11')]===0x1f4){logger[_0xdfe5('0x10')](_0xdfe5('0xc'),_0x82d109,_0x27c63a[_0xdfe5('0x10')]['message']);return _0x1a33a7(_0x27c63a[_0xdfe5('0x10')]['message']);}logger['error'](_0xdfe5('0xc'),_0x82d109,_0x27c63a[_0xdfe5('0x10')]['message']);return _0x425484(_0x27c63a[_0xdfe5('0x10')][_0xdfe5('0x12')]);}else{logger[_0xdfe5('0xb')](_0xdfe5('0xc'),_0x82d109,_0xdfe5('0xd'));_0x425484(_0x27c63a[_0xdfe5('0x13')][_0xdfe5('0x12')]);}})[_0xdfe5('0x14')](function(_0x16a5d8){logger[_0xdfe5('0x10')](_0xdfe5('0xc'),_0x82d109,_0x16a5d8);_0x1a33a7(_0x16a5d8);});});}exports[_0xdfe5('0x15')]=function(_0x346655){var _0x294296=this;return new Promise(function(_0x295608,_0x10a380){return db[_0xdfe5('0x16')][_0xdfe5('0x17')](_0x346655[_0xdfe5('0x18')],{'raw':_0x346655[_0xdfe5('0x19')]?_0x346655[_0xdfe5('0x19')][_0xdfe5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x346655['options']?_0x346655[_0xdfe5('0x19')][_0xdfe5('0x1b')]||null:null,'attributes':_0x346655[_0xdfe5('0x19')]?_0x346655[_0xdfe5('0x19')][_0xdfe5('0x1c')]||null:null,'limit':_0x346655[_0xdfe5('0x19')]?_0x346655['options'][_0xdfe5('0x1d')]||null:null})['then'](function(_0x398e55){logger[_0xdfe5('0xb')](_0xdfe5('0x15'),_0x346655);logger[_0xdfe5('0x1e')](_0xdfe5('0x15'),_0x346655,JSON[_0xdfe5('0xf')](_0x398e55));_0x295608(_0x398e55);})[_0xdfe5('0x14')](function(_0x4e707){logger[_0xdfe5('0x10')](_0xdfe5('0x15'),_0x4e707[_0xdfe5('0x12')],_0x346655);_0x10a380(_0x294296[_0xdfe5('0x10')](0x1f4,_0x4e707['message']));});});}; \ No newline at end of file +var _0x2e5a=['jayson/promise','client','http','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x385d88,_0x582f58){var _0x32fb4d=function(_0x32426a){while(--_0x32426a){_0x385d88['push'](_0x385d88['shift']());}};_0x32fb4d(++_0x582f58);}(_0x2e5a,0x182));var _0xa2e5=function(_0x25335c,_0x3a2ec7){_0x25335c=_0x25335c-0x0;var _0xc849fe=_0x2e5a[_0x25335c];return _0xc849fe;};'use strict';var _=require(_0xa2e5('0x0'));var util=require(_0xa2e5('0x1'));var moment=require(_0xa2e5('0x2'));var BPromise=require(_0xa2e5('0x3'));var rs=require(_0xa2e5('0x4'));var fs=require('fs');var Redis=require(_0xa2e5('0x5'));var db=require(_0xa2e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2e5('0x7'))(_0xa2e5('0x8'));var config=require(_0xa2e5('0x9'));var jayson=require(_0xa2e5('0xa'));var client=jayson[_0xa2e5('0xb')][_0xa2e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb09998,_0x2216f9,_0x383bf8){return new BPromise(function(_0xb6b8ba,_0xdae23b){return client['request'](_0xb09998,_0x383bf8)[_0xa2e5('0xd')](function(_0x80fb64){logger[_0xa2e5('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2216f9,_0xa2e5('0xf'));logger[_0xa2e5('0x10')](_0xa2e5('0x11'),_0x2216f9,_0xa2e5('0xf'),JSON[_0xa2e5('0x12')](_0x80fb64));if(_0x80fb64[_0xa2e5('0x13')]){if(_0x80fb64[_0xa2e5('0x13')][_0xa2e5('0x14')]===0x1f4){logger[_0xa2e5('0x13')](_0xa2e5('0x15'),_0x2216f9,_0x80fb64[_0xa2e5('0x13')]['message']);return _0xdae23b(_0x80fb64[_0xa2e5('0x13')][_0xa2e5('0x16')]);}logger[_0xa2e5('0x13')](_0xa2e5('0x15'),_0x2216f9,_0x80fb64[_0xa2e5('0x13')][_0xa2e5('0x16')]);return _0xb6b8ba(_0x80fb64[_0xa2e5('0x13')][_0xa2e5('0x16')]);}else{logger['info'](_0xa2e5('0x15'),_0x2216f9,'request\x20sent');_0xb6b8ba(_0x80fb64[_0xa2e5('0x17')][_0xa2e5('0x16')]);}})['catch'](function(_0x23e405){logger['error'](_0xa2e5('0x15'),_0x2216f9,_0x23e405);_0xdae23b(_0x23e405);});});}exports[_0xa2e5('0x18')]=function(_0x482722){var _0x4dfa3c=this;return new Promise(function(_0x3e394c,_0x3f5b47){return db[_0xa2e5('0x19')][_0xa2e5('0x1a')](_0x482722[_0xa2e5('0x1b')],{'raw':_0x482722[_0xa2e5('0x1c')]?_0x482722[_0xa2e5('0x1c')][_0xa2e5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x482722['options']?_0x482722[_0xa2e5('0x1c')][_0xa2e5('0x1e')]||null:null,'attributes':_0x482722[_0xa2e5('0x1c')]?_0x482722[_0xa2e5('0x1c')][_0xa2e5('0x1f')]||null:null,'limit':_0x482722[_0xa2e5('0x1c')]?_0x482722[_0xa2e5('0x1c')]['limit']||null:null})[_0xa2e5('0xd')](function(_0x4b137c){logger[_0xa2e5('0xe')](_0xa2e5('0x18'),_0x482722);logger[_0xa2e5('0x10')](_0xa2e5('0x18'),_0x482722,JSON[_0xa2e5('0x12')](_0x4b137c));_0x3e394c(_0x4b137c);})[_0xa2e5('0x20')](function(_0x402f59){logger[_0xa2e5('0x13')](_0xa2e5('0x18'),_0x402f59[_0xa2e5('0x16')],_0x482722);_0x3f5b47(_0x4dfa3c['error'](0x1f4,_0x402f59[_0xa2e5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 32f3536..fcb54c0 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 _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3fe210,_0x3cdd84){_0x3fe210=_0x3fe210-0x0;var _0x293b52=_0xf7b4[_0x3fe210];return _0x293b52;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0x0b0e,0x187));var _0xe0b0=function(_0x206338,_0x2d800b){_0x206338=_0x206338-0x0;var _0x2b87f2=_0x0b0e[_0x206338];return _0x2b87f2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f81feeb..af58a3f 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 _0xdb6e=['STRING','ENUM','out','DATE','exports','BOOLEAN'];(function(_0x28a010,_0x3ab272){var _0x4cf972=function(_0x30135b){while(--_0x30135b){_0x28a010['push'](_0x28a010['shift']());}};_0x4cf972(++_0x3ab272);}(_0xdb6e,0x10c));var _0xedb6=function(_0x184cfe,_0x1b1785){_0x184cfe=_0x184cfe-0x0;var _0x24b8e4=_0xdb6e[_0x184cfe];return _0x24b8e4;};'use strict';var Sequelize=require('sequelize');module[_0xedb6('0x0')]={'closed':{'type':Sequelize[_0xedb6('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xedb6('0x2')]},'secondDisposition':{'type':Sequelize[_0xedb6('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xedb6('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xedb6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xedb6('0x3')]('in',_0xedb6('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xedb6('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xedb6('0x3')]('in',_0xedb6('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8a27=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x1cb5c2,_0x4219e4){var _0x12a09b=function(_0x217b76){while(--_0x217b76){_0x1cb5c2['push'](_0x1cb5c2['shift']());}};_0x12a09b(++_0x4219e4);}(_0x8a27,0x10b));var _0x78a2=function(_0x38e49b,_0x14a49c){_0x38e49b=_0x38e49b-0x0;var _0x416bd8=_0x8a27[_0x38e49b];return _0x416bd8;};'use strict';var Sequelize=require(_0x78a2('0x0'));module[_0x78a2('0x1')]={'closed':{'type':Sequelize[_0x78a2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x78a2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x78a2('0x4')]},'read1stAt':{'type':Sequelize[_0x78a2('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x78a2('0x5')]('in',_0x78a2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x78a2('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x78a2('0x6')),'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 99c963f..645f075 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 _0x2ab3=['find','ContactId','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','body','some','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.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.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','includeAll','options','create','update','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','format','addTags','setTags','findAll','emit','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','reject','save','then','destroy','error','stack','name','Users','Tags','TagIds','forEach','push','catch','waiting','talking','total','closed','UserId','answered','unmanaged','index','map','FaxInteraction','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0x123942,_0x198650){var _0x42304f=function(_0x353af2){while(--_0x353af2){_0x123942['push'](_0x123942['shift']());}};_0x42304f(++_0x198650);}(_0x2ab3,0x14d));var _0x32ab=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x2ab3[_0x1d5400];return _0x21d9fe;};'use strict';var emlformat=require(_0x32ab('0x0'));var rimraf=require(_0x32ab('0x1'));var zipdir=require(_0x32ab('0x2'));var jsonpatch=require(_0x32ab('0x3'));var rp=require(_0x32ab('0x4'));var moment=require('moment');var BPromise=require(_0x32ab('0x5'));var Mustache=require(_0x32ab('0x6'));var util=require(_0x32ab('0x7'));var path=require(_0x32ab('0x8'));var sox=require('sox');var csv=require(_0x32ab('0x9'));var ejs=require(_0x32ab('0xa'));var fs=require('fs');var fs_extra=require(_0x32ab('0xb'));var _=require(_0x32ab('0xc'));var squel=require(_0x32ab('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32ab('0xe'));var toCsv=require(_0x32ab('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x32ab('0xf'));var authService=require(_0x32ab('0x10'));var qs=require(_0x32ab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ab('0x12'));var logger=require(_0x32ab('0x13'))(_0x32ab('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x32ab('0x15'));var db=require(_0x32ab('0x16'))['db'];config[_0x32ab('0x17')]=_[_0x32ab('0x18')](config[_0x32ab('0x17')],{'host':_0x32ab('0x19'),'port':0x18eb});var socket=require(_0x32ab('0x1a'))(new Redis(config[_0x32ab('0x17')]));require(_0x32ab('0x1b'))[_0x32ab('0x1c')](socket);function respondWithStatusCode(_0x59c84b,_0x208b4a){_0x208b4a=_0x208b4a||0xcc;return function(_0x4125b7){if(_0x4125b7){return _0x59c84b[_0x32ab('0x1d')](_0x208b4a);}return _0x59c84b[_0x32ab('0x1e')](_0x208b4a)[_0x32ab('0x1f')]();};}function respondWithResult(_0x2bc5b9,_0x2728cd){_0x2728cd=_0x2728cd||0xc8;return function(_0x5e785e){if(_0x5e785e){return _0x2bc5b9[_0x32ab('0x1e')](_0x2728cd)['json'](_0x5e785e);}};}function respondWithFilteredResult(_0x10a4b0,_0x2a83d1){return function(_0x34ef3d){if(_0x34ef3d){var _0x400d8a=typeof _0x2a83d1[_0x32ab('0x20')]===_0x32ab('0x21')&&typeof _0x2a83d1[_0x32ab('0x22')]===_0x32ab('0x21');var _0x2d7c90=_0x34ef3d['count'];var _0x376534=_0x400d8a?0x0:_0x2a83d1[_0x32ab('0x20')];var _0x6d081f=_0x400d8a?_0x34ef3d['count']:_0x2a83d1[_0x32ab('0x20')]+_0x2a83d1[_0x32ab('0x22')];var _0x2accf0;if(_0x6d081f>=_0x2d7c90){_0x6d081f=_0x2d7c90;_0x2accf0=0xc8;}else{_0x2accf0=0xce;}_0x10a4b0[_0x32ab('0x1e')](_0x2accf0);return _0x10a4b0['set'](_0x32ab('0x23'),_0x376534+'-'+_0x6d081f+'/'+_0x2d7c90)['json'](_0x34ef3d);}return null;};}function patchUpdates(_0x277603){return function(_0x183385){try{jsonpatch['apply'](_0x183385,_0x277603,!![]);}catch(_0x3832ac){return BPromise[_0x32ab('0x24')](_0x3832ac);}return _0x183385[_0x32ab('0x25')]();};}function saveUpdates(_0x577e6c,_0x3d5386){return function(_0x57f32c){if(_0x57f32c){return _0x57f32c['update'](_0x577e6c)[_0x32ab('0x26')](function(_0x4591b5){return _0x4591b5;});}return null;};}function removeEntity(_0x2b259c,_0x27c007){return function(_0x2b58db){if(_0x2b58db){return _0x2b58db[_0x32ab('0x27')]()['then'](function(){_0x2b259c[_0x32ab('0x1e')](0xcc)[_0x32ab('0x1f')]();});}};}function handleEntityNotFound(_0x312aa0,_0x2f909a){return function(_0x191859){if(!_0x191859){_0x312aa0['sendStatus'](0x194);}return _0x191859;};}function handleError(_0x431fbb,_0x26211d){_0x26211d=_0x26211d||0x1f4;return function(_0x396480){logger[_0x32ab('0x28')](_0x396480[_0x32ab('0x29')]);if(_0x396480[_0x32ab('0x2a')]){delete _0x396480[_0x32ab('0x2a')];}_0x431fbb[_0x32ab('0x1e')](_0x26211d)['send'](_0x396480);};}function getInteractionUsers(_0x3987c3,_0x1fc036){return new BPromise(function(_0x12afcd,_0x3b7477){try{if(_0x1fc036[_0x3987c3['id']]){_0x3987c3[_0x32ab('0x2b')]=_['map'](_0x1fc036[_0x3987c3['id']],function(_0x1b36aa){return{'id':_0x1b36aa['id'],'fullname':_0x1b36aa['fullname']};});}}catch(_0x3f2aa7){_0x3b7477(_0x3f2aa7);}_0x12afcd(_0x3987c3);});}function getInteractionTags(_0x46602c,_0x1243d0){return new BPromise(function(_0xa319c8,_0x1373fe){try{if(_0x46602c['TagIds']){_0x46602c[_0x32ab('0x2c')]=[];_0x46602c[_0x32ab('0x2d')]['split'](',')[_0x32ab('0x2e')](function(_0x38c2b9){_0x46602c[_0x32ab('0x2c')][_0x32ab('0x2f')](_0x1243d0[_0x38c2b9]);});}delete _0x46602c[_0x32ab('0x2d')];}catch(_0x2677a4){_0x1373fe(_0x2677a4);}_0xa319c8(_0x46602c);});}function updateFaxInteraction(_0x44a267,_0x7268d2,_0x4fe605){return new BPromise(function(_0x193e1e,_0x3a8fb2){return getInteractionUsers(_0x44a267,_0x4fe605)[_0x32ab('0x26')](function(_0x5da732){return getInteractionTags(_0x5da732,_0x7268d2);})['then'](function(_0x11a487){return getStateInteraction(_0x11a487);})[_0x32ab('0x26')](function(_0x56d044){_0x193e1e(_0x56d044);})[_0x32ab('0x30')](function(_0x188c90){_0x3a8fb2(_0x188c90);});});}function getStateInteraction(_0x1989d2){return new BPromise(function(_0x20e019){_0x1989d2[_0x32ab('0x31')]=0x0;_0x1989d2[_0x32ab('0x32')]=0x0;_0x1989d2['answered']=0x0;_0x1989d2['unmanaged']=0x0;_0x1989d2[_0x32ab('0x33')]=0x0;if(!_0x1989d2[_0x32ab('0x34')]&&!_0x1989d2['UserId']){_0x1989d2[_0x32ab('0x31')]+=0x1;}if(!_0x1989d2[_0x32ab('0x34')]&&_0x1989d2[_0x32ab('0x35')]){_0x1989d2[_0x32ab('0x32')]+=0x1;if(_0x1989d2['waiting']){_0x1989d2[_0x32ab('0x31')]-=0x1;}}if(_0x1989d2[_0x32ab('0x34')]&&_0x1989d2['UserId']){_0x1989d2[_0x32ab('0x36')]+=0x1;if(_0x1989d2[_0x32ab('0x32')]){_0x1989d2[_0x32ab('0x32')]-=0x1;}}if(_0x1989d2['closed']&&!_0x1989d2[_0x32ab('0x35')]){_0x1989d2[_0x32ab('0x37')]+=0x1;if(_0x1989d2[_0x32ab('0x31')]){_0x1989d2[_0x32ab('0x31')]-=0x1;}}_0x1989d2['total']+=0x1;_0x20e019(_0x1989d2);});}exports[_0x32ab('0x38')]=function(_0x3780cc,_0x427b01){var _0x27e389={},_0x54bc54={},_0x5c465d={'count':0x0,'rows':[]};var _0x3dabe2=_[_0x32ab('0x39')](db[_0x32ab('0x3a')][_0x32ab('0x3b')],function(_0x4b5de2){return{'name':_0x4b5de2[_0x32ab('0x3c')],'type':_0x4b5de2[_0x32ab('0x3d')]['key']};});_0x54bc54[_0x32ab('0x3e')]=_[_0x32ab('0x39')](_0x3dabe2,_0x32ab('0x2a'));_0x54bc54['query']=_[_0x32ab('0x3f')](_0x3780cc[_0x32ab('0x40')]);_0x54bc54[_0x32ab('0x41')]=_['intersection'](_0x54bc54[_0x32ab('0x3e')],_0x54bc54['query']);_0x27e389[_0x32ab('0x42')]=_[_0x32ab('0x43')](_0x54bc54['model'],qs[_0x32ab('0x44')](_0x3780cc['query'][_0x32ab('0x44')]));_0x27e389[_0x32ab('0x42')]=_0x27e389['attributes']['length']?_0x27e389[_0x32ab('0x42')]:_0x54bc54['model'];if(!_0x3780cc[_0x32ab('0x40')][_0x32ab('0x45')](_0x32ab('0x46'))){_0x27e389[_0x32ab('0x22')]=qs[_0x32ab('0x22')](_0x3780cc['query'][_0x32ab('0x22')]);_0x27e389[_0x32ab('0x20')]=qs[_0x32ab('0x20')](_0x3780cc[_0x32ab('0x40')][_0x32ab('0x20')]);}_0x27e389[_0x32ab('0x47')]=qs['sort'](_0x3780cc['query'][_0x32ab('0x48')]);_0x27e389[_0x32ab('0x49')]=qs[_0x32ab('0x41')](_[_0x32ab('0x4a')](_0x3780cc['query'],_0x54bc54[_0x32ab('0x41')]),_0x3dabe2);var _0x1ad9a8=[];var _0x3d1de6=squel[_0x32ab('0x4b')]()[_0x32ab('0x4c')]('id')[_0x32ab('0x4c')](_0x32ab('0x2a'))['field'](_0x32ab('0x4d'))['from'](_0x32ab('0x4e'));var _0x2c05de=squel['select']()[_0x32ab('0x4c')](_0x32ab('0x4f'))['field']('u.fullname')[_0x32ab('0x4c')](_0x32ab('0x50'))[_0x32ab('0x51')](_0x32ab('0x52'),'ui')[_0x32ab('0x53')]('users','u','u.id\x20=\x20ui.UserId');var _0x123c2c=squel[_0x32ab('0x4b')]()[_0x32ab('0x51')](_0x32ab('0x54'),'i')[_0x32ab('0x53')](_0x32ab('0x55'),'c',_0x32ab('0x56'))[_0x32ab('0x53')](_0x32ab('0x57'),'o','o.id\x20=\x20i.UserId')[_0x32ab('0x53')](_0x32ab('0x58'),'a',_0x32ab('0x59'))[_0x32ab('0x53')](_0x32ab('0x5a'),'me',_0x32ab('0x5b'))[_0x32ab('0x53')]('fax_interaction_has_tags','it',_0x32ab('0x5c'))[_0x32ab('0x53')](_0x32ab('0x4e'),'t',_0x32ab('0x5d'));var _0x406c5a=squel[_0x32ab('0x5e')]();var _0x54a132=[];var _0x214c23=squel[_0x32ab('0x5e')]();var _0x496a22;if(_0x3780cc['query']['search']){_0x496a22=as[_0x32ab('0x5f')](_0x3780cc['query'][_0x32ab('0x60')]);var _0x2ba55d=_0x496a22['sqlOperator'];for(var _0x3f54c2=0x0;_0x3f54c2<_0x496a22[_0x32ab('0x61')]['length'];_0x3f54c2++){var _0x2e65ee=_0x496a22[_0x32ab('0x61')][_0x3f54c2];var _0x1f3869='i';var _0x833a31=_['find'](_0x3dabe2,[_0x32ab('0x2a'),_0x2e65ee[_0x32ab('0x4c')]]);if(!_0x833a31){switch(_0x2e65ee[_0x32ab('0x4c')]){case'unreadMessages':if(_0x2e65ee[_0x32ab('0x62')]==0x1){_0x123c2c[_0x32ab('0x63')]('`'+_0x2e65ee[_0x32ab('0x4c')]+_0x32ab('0x64'));}else{_0x123c2c['having']('`'+_0x2e65ee[_0x32ab('0x4c')]+_0x32ab('0x65'));}break;case _0x32ab('0x66'):if(_0x2e65ee[_0x32ab('0x67')]===_0x32ab('0x68')){if(_0x2e65ee['value']['split']('\x20')[_0x32ab('0x69')]>0x1){_0x406c5a[_0x2ba55d](_0x32ab('0x6a'),qs[_0x32ab('0x6b')](_0x2e65ee[_0x32ab('0x62')]),null);}else{var _0x54aaed='%'+_0x2e65ee[_0x32ab('0x62')]+'%';_0x406c5a[_0x2ba55d](_0x32ab('0x6c'),_0x54aaed,_0x54aaed,_0x54aaed);}}else{_0x833a31=_[_0x32ab('0x6d')](_0x3dabe2,[_0x32ab('0x2a'),_0x32ab('0x6e')]);_0x2e65ee[_0x32ab('0x4c')]=_0x32ab('0x6e');_0x506ede=as['buildExpression'](_0x1f3869,_0x833a31[_0x32ab('0x3d')],_0x2e65ee);_0x406c5a[_0x2ba55d](_0x506ede['text'],_0x506ede['value'][_0x32ab('0x6f')],_0x506ede['value'][_0x32ab('0x1f')]);}break;case _0x32ab('0x70'):var _0xd3e37d=_0x2e65ee['value'][_0x32ab('0x71')](',')[_0x32ab('0x39')](function(_0x4a99fd){return Number(_0x4a99fd);});_0xd3e37d[_0x32ab('0x2e')](function(_0x3500cc){_0x214c23['or'](_0x32ab('0x72'),'%,'+_0x3500cc+',%');});_0x54a132=_['union'](_0x54a132,_0xd3e37d);break;case _0x32ab('0x73'):if(_0x2e65ee[_0x32ab('0x67')]===_0x32ab('0x68')){_0x406c5a[_0x2ba55d](_0x32ab('0x74'),'%'+_0x2e65ee[_0x32ab('0x62')]+'%',null);}else{_0x833a31=_[_0x32ab('0x6d')](_0x3dabe2,[_0x32ab('0x2a'),_0x32ab('0x35')]);_0x2e65ee[_0x32ab('0x4c')]=_0x32ab('0x35');_0x506ede=as[_0x32ab('0x75')](_0x1f3869,_0x833a31['type'],_0x2e65ee);_0x406c5a[_0x2ba55d](_0x506ede[_0x32ab('0x76')],_0x506ede[_0x32ab('0x62')][_0x32ab('0x6f')],_0x506ede['value'][_0x32ab('0x1f')]);}break;case _0x32ab('0x77'):_0x506ede=as[_0x32ab('0x75')]('me',null,_0x2e65ee);_0x406c5a[_0x2ba55d](_0x506ede[_0x32ab('0x76')],_0x506ede['value'][_0x32ab('0x6f')],_0x506ede[_0x32ab('0x62')]['end']);break;}}else{var _0x506ede=as[_0x32ab('0x75')](_0x1f3869,_0x833a31[_0x32ab('0x3d')],_0x2e65ee);_0x406c5a[_0x2ba55d](_0x506ede['text'],_0x506ede[_0x32ab('0x62')][_0x32ab('0x6f')],_0x506ede[_0x32ab('0x62')]['end']);}}}else{var _0x1152b3=_(_0x3780cc[_0x32ab('0x40')])[_0x32ab('0x3f')]()[_0x32ab('0x39')](function(_0xa86011){return _[_0x32ab('0x78')](_0x3dabe2,[_0x32ab('0x2a'),_0xa86011])?_0xa86011:undefined;})['compact']()[_0x32ab('0x62')]();if(!_['isEmpty'](_0x1152b3)){_0x1152b3['forEach'](function(_0x4d83b2){if(_0x4d83b2===_0x32ab('0x79')){_0x123c2c[_0x32ab('0x49')](_0x32ab('0x7a'),[][_0x32ab('0x7b')](_0x3780cc[_0x32ab('0x40')][_0x4d83b2]));}else if(_0x4d83b2==='createdAt'){var _0x531383=JSON[_0x32ab('0x7c')](_0x3780cc[_0x32ab('0x40')][_0x4d83b2])[_0x32ab('0x7d')];var _0x3564de=JSON[_0x32ab('0x7c')](_0x3780cc[_0x32ab('0x40')][_0x4d83b2])[_0x32ab('0x7e')];_0x123c2c['where'](_0x32ab('0x7f'),_0x531383,_0x3564de);}else{if(_0x3780cc['query'][_0x4d83b2]==='null'){_0x123c2c[_0x32ab('0x49')]('i.'+_0x4d83b2+_0x32ab('0x80'));}else{_0x123c2c[_0x32ab('0x49')]('i.'+_0x4d83b2+_0x32ab('0x81'),_0x3780cc[_0x32ab('0x40')][_0x4d83b2]);}}});}if(_0x3780cc[_0x32ab('0x40')][_0x32ab('0x82')]){if(_0x3780cc[_0x32ab('0x40')][_0x32ab('0x82')]==0x1){_0x123c2c[_0x32ab('0x63')](_0x32ab('0x83'));}else{_0x123c2c[_0x32ab('0x63')](_0x32ab('0x84'));}}if(_0x3780cc[_0x32ab('0x40')][_0x32ab('0x85')]){_0x54a132=_['isArray'](_0x3780cc[_0x32ab('0x40')][_0x32ab('0x85')])?_0x3780cc['query'][_0x32ab('0x85')]:new Array(_0x3780cc[_0x32ab('0x40')][_0x32ab('0x85')]);_0x54a132[_0x32ab('0x2e')](function(_0x55c386){_0x214c23['or'](_0x32ab('0x72'),'%,'+_0x55c386+',%');});}if(_0x3780cc[_0x32ab('0x40')][_0x32ab('0x86')]){var _0x1717c4=_0x3780cc['query'][_0x32ab('0x86')][_0x32ab('0x87')]('\x5c','\x5c\x5c')[_0x32ab('0x87')](/'/g,'\x27\x27');if(qs[_0x32ab('0x88')](_0x1717c4)){_0x406c5a['or'](_0x32ab('0x89'),_0x1717c4+'%')['or']('i.fax\x20LIKE\x20?',_0x1717c4+'%');}_0x406c5a['or'](_0x32ab('0x8a'),_0x1717c4+'%');}}_0x123c2c[_0x32ab('0x49')](_0x406c5a);_0x123c2c[_0x32ab('0x8b')](_0x32ab('0x8c'));var _0xf9c50f={'type':db[_0x32ab('0x8d')][_0x32ab('0x8e')]['SELECT'],'raw':!![]};var _0x3bd40d=_0x123c2c[_0x32ab('0x8f')]();_0x3bd40d['field']('i.id');_0x3bd40d[_0x32ab('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x32ab('0x90'));if(_0x27e389[_0x32ab('0x47')]){_0x27e389['order']['forEach'](function(_0x545616){var _0x1116dc=_0x545616[0x0]==='contactName'?_0x545616[0x0]:'i.'+_0x545616[0x0];_0x123c2c['order'](_0x1116dc,_0x545616[0x1]==='DESC'?![]:!![]);});}if(!_[_0x32ab('0x91')](_0x54a132)){_0x123c2c['having'](_0x214c23);_0x3bd40d['where'](_0x32ab('0x92'),_0x54a132);}BPromise[_0x32ab('0x93')]()[_0x32ab('0x26')](function(){if(!_0x496a22){if(_0x3780cc[_0x32ab('0x40')]['FaxAccountId'])return;_0x3bd40d['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x123c2c[_0x32ab('0x49')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3780cc[_0x32ab('0x94')][_0x32ab('0x95')]!==_0x32ab('0x96'))return;return _0x3780cc[_0x32ab('0x94')][_0x32ab('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4f4c37){if(_[_0x32ab('0x91')](_0x4f4c37)){_0x3bd40d[_0x32ab('0x49')](_0x32ab('0x98'));_0x123c2c[_0x32ab('0x49')](_0x32ab('0x98'));}else{_0x3bd40d[_0x32ab('0x49')]('i.FaxAccountId\x20IN\x20?',_[_0x32ab('0x39')](_0x4f4c37,'id'));_0x123c2c[_0x32ab('0x49')](_0x32ab('0x7a'),_[_0x32ab('0x39')](_0x4f4c37,'id'));}});})['then'](function(){if(_0x3780cc[_0x32ab('0x94')][_0x32ab('0x95')]===_0x32ab('0x96')&&!_0x496a22&&!_0x3780cc[_0x32ab('0x40')][_0x32ab('0x79')])return[];return db[_0x32ab('0x99')][_0x32ab('0x40')](_0x3bd40d[_0x32ab('0x9a')](),_0xf9c50f);})[_0x32ab('0x26')](function(_0x29b9d8){_0x5c465d[_0x32ab('0x9b')]=_0x29b9d8['length'];if(_0x5c465d[_0x32ab('0x9b')]===0x0)return[];return db[_0x32ab('0x99')][_0x32ab('0x40')](_0x3d1de6[_0x32ab('0x9a')](),_0xf9c50f)[_0x32ab('0x26')](function(_0x3df678){_0x1ad9a8=_[_0x32ab('0x9c')](_0x3df678,'id');_0xf9c50f=_[_0x32ab('0x9d')](_0xf9c50f,{'model':db[_0x32ab('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3780cc['query'][_0x32ab('0x44')]){_0x27e389['attributes'][_0x32ab('0x2e')](function(_0x3dd516){_0x123c2c[_0x32ab('0x4c')]('i.'+_0x3dd516);});}else{_0x123c2c[_0x32ab('0x4c')](_0x32ab('0x9e'),_0x32ab('0x90'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0x9f'),_0x32ab('0xa0'));_0x123c2c[_0x32ab('0x4c')]('a.mandatoryDisposition',_0x32ab('0xa1'));_0x123c2c[_0x32ab('0x4c')]('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',_0x32ab('0xa2'));_0x123c2c['field'](_0x32ab('0xa3'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xa4'),_0x32ab('0xa5'));_0x123c2c['field'](_0x32ab('0xa6'),_0x32ab('0xa7'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xa8'),_0x32ab('0xa9'));_0x123c2c['field'](_0x32ab('0xaa'),_0x32ab('0xab'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xac'),_0x32ab('0xad'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xae'),_0x32ab('0xaf'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xb0'),_0x32ab('0xb1'));_0x123c2c[_0x32ab('0x4c')]('o.internal',_0x32ab('0xb2'));_0x123c2c[_0x32ab('0x4c')](_0x32ab('0xb3'),_0x32ab('0x2d'));}if(_0x27e389['limit'])_0x123c2c[_0x32ab('0x22')](_0x27e389[_0x32ab('0x22')]);if(_0x27e389[_0x32ab('0x20')])_0x123c2c[_0x32ab('0x20')](_0x27e389[_0x32ab('0x20')]);return db[_0x32ab('0x99')][_0x32ab('0x40')](_0x123c2c[_0x32ab('0x9a')](),_0xf9c50f);})['then'](function(_0x4a0f29){if(_0x4a0f29[_0x32ab('0x69')]>0x0)_0x2c05de[_0x32ab('0x49')](_0x32ab('0xb4'),_[_0x32ab('0x39')](_0x4a0f29,'id'));return db['sequelize'][_0x32ab('0x40')](_0x2c05de['toString'](),_0xf9c50f)[_0x32ab('0x26')](function(_0x456715){var _0x130716=_['groupBy'](_0x456715,_0x32ab('0xb5'));var _0x591721=[];_0x4a0f29[_0x32ab('0x2e')](function(_0x332fa3){_0x591721['push'](updateFaxInteraction(_0x332fa3,_0x1ad9a8,_0x130716));});return BPromise[_0x32ab('0xb6')](_0x591721);});});})[_0x32ab('0x26')](function(_0x27b4af){_0x5c465d[_0x32ab('0xb7')]=_0x27b4af;return _0x5c465d;})[_0x32ab('0x26')](respondWithFilteredResult(_0x427b01,_0x27e389))[_0x32ab('0x30')](handleError(_0x427b01,null));};exports[_0x32ab('0xb8')]=function(_0x1223ad,_0x37bce1){var _0x23456d={'raw':![],'where':{'id':_0x1223ad[_0x32ab('0xb9')]['id']}},_0x521261={};_0x521261['model']=_['keys'](db[_0x32ab('0x3a')][_0x32ab('0x3b')]);_0x521261[_0x32ab('0x40')]=_[_0x32ab('0x3f')](_0x1223ad['query']);_0x521261['filters']=_['intersection'](_0x521261[_0x32ab('0x3e')],_0x521261[_0x32ab('0x40')]);_0x23456d[_0x32ab('0x42')]=_[_0x32ab('0x43')](_0x521261[_0x32ab('0x3e')],qs[_0x32ab('0x44')](_0x1223ad[_0x32ab('0x40')][_0x32ab('0x44')]));_0x23456d[_0x32ab('0x42')]=_0x23456d[_0x32ab('0x42')][_0x32ab('0x69')]?_0x23456d['attributes']:_0x521261[_0x32ab('0x3e')];if(_0x1223ad[_0x32ab('0x40')][_0x32ab('0xba')]){_0x23456d['include']=[{'all':!![]}];}_0x23456d=_[_0x32ab('0x9d')]({},_0x23456d,_0x1223ad[_0x32ab('0xbb')]);return db[_0x32ab('0x3a')]['find'](_0x23456d)[_0x32ab('0x26')](handleEntityNotFound(_0x37bce1,null))[_0x32ab('0x26')](respondWithResult(_0x37bce1,null))['catch'](handleError(_0x37bce1,null));};exports['create']=function(_0x17530b,_0x252a64){return db[_0x32ab('0x3a')][_0x32ab('0xbc')](_0x17530b[_0x32ab('0x77')],{})['then'](respondWithResult(_0x252a64,0xc9))[_0x32ab('0x30')](handleError(_0x252a64,null));};exports[_0x32ab('0xbd')]=function(_0x42685b,_0x1bb84d){if(_0x42685b[_0x32ab('0x77')]['id']){delete _0x42685b[_0x32ab('0x77')]['id'];}return db[_0x32ab('0x3a')][_0x32ab('0x6d')]({'where':{'id':_0x42685b[_0x32ab('0xb9')]['id']}})[_0x32ab('0x26')](handleEntityNotFound(_0x1bb84d,null))[_0x32ab('0x26')](saveUpdates(_0x42685b[_0x32ab('0x77')],null))[_0x32ab('0x26')](respondWithResult(_0x1bb84d,null))['catch'](handleError(_0x1bb84d,null));};exports[_0x32ab('0x27')]=function(_0x3d76ff,_0x3bf65a){return db[_0x32ab('0x3a')]['find']({'where':{'id':_0x3d76ff[_0x32ab('0xb9')]['id']}})[_0x32ab('0x26')](handleEntityNotFound(_0x3bf65a,null))[_0x32ab('0x26')](removeEntity(_0x3bf65a,null))[_0x32ab('0x30')](handleError(_0x3bf65a,null));};exports['describe']=function(_0x3f23e0,_0x4f2e3a){return db[_0x32ab('0x3a')][_0x32ab('0xbe')]()['then'](respondWithResult(_0x4f2e3a,null))[_0x32ab('0x30')](handleError(_0x4f2e3a,null));};exports[_0x32ab('0xbf')]=function(_0x42d71e,_0x2b9889,_0x8d7f49){return db[_0x32ab('0xc0')][_0x32ab('0x6d')]({'where':{'id':_0x42d71e[_0x32ab('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2b9889,null))[_0x32ab('0x26')](function(_0x1438c1){if(_0x1438c1){return _0x1438c1[_0x32ab('0xbf')](_0x42d71e[_0x32ab('0x77')]['ids'],_[_0x32ab('0xc1')](_0x42d71e[_0x32ab('0x77')],[_0x32ab('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x2b9889,null))[_0x32ab('0x30')](handleError(_0x2b9889,null));};exports[_0x32ab('0xc3')]=function(_0x4c932c,_0x5b2ae9,_0x2c379a){var _0x4cefea={'raw':![],'where':{}};var _0x2d7a15={};var _0x2632e2={'count':0x0,'rows':[]};return db[_0x32ab('0x3a')][_0x32ab('0xc4')]({'where':{'id':_0x4c932c[_0x32ab('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5b2ae9,null))[_0x32ab('0x26')](function(_0x3a9a37){if(_0x3a9a37){_0x2d7a15[_0x32ab('0x3e')]=_[_0x32ab('0x3f')](db[_0x32ab('0xc0')][_0x32ab('0x3b')]);_0x2d7a15[_0x32ab('0x40')]=_['keys'](_0x4c932c['query']);_0x2d7a15[_0x32ab('0x41')]=_[_0x32ab('0x43')](_0x2d7a15[_0x32ab('0x3e')],_0x2d7a15[_0x32ab('0x40')]);_0x4cefea[_0x32ab('0x42')]=_[_0x32ab('0x43')](_0x2d7a15[_0x32ab('0x3e')],qs[_0x32ab('0x44')](_0x4c932c[_0x32ab('0x40')][_0x32ab('0x44')]));_0x4cefea[_0x32ab('0x42')]=_0x4cefea['attributes'][_0x32ab('0x69')]?_0x4cefea[_0x32ab('0x42')]:_0x2d7a15['model'];if(!_0x4c932c[_0x32ab('0x40')][_0x32ab('0x45')](_0x32ab('0x46'))){_0x4cefea[_0x32ab('0x22')]=qs[_0x32ab('0x22')](_0x4c932c[_0x32ab('0x40')]['limit']);_0x4cefea[_0x32ab('0x20')]=qs[_0x32ab('0x20')](_0x4c932c['query']['offset']);}_0x4cefea[_0x32ab('0x47')]=qs['sort'](_0x4c932c[_0x32ab('0x40')][_0x32ab('0x48')]);_0x4cefea['where']=qs[_0x32ab('0x41')](_[_0x32ab('0x4a')](_0x4c932c[_0x32ab('0x40')],_0x2d7a15[_0x32ab('0x41')]));_0x4cefea['where'][_0x32ab('0xb5')]=_0x3a9a37['id'];if(_0x4c932c[_0x32ab('0x40')][_0x32ab('0x86')]){_0x4cefea[_0x32ab('0x49')]=_['merge'](_0x4cefea[_0x32ab('0x49')],{'$or':_['map'](_0x4cefea[_0x32ab('0x42')],function(_0x565a68){var _0x55e9c1={};_0x55e9c1[_0x565a68]={'$like':'%'+_0x4c932c[_0x32ab('0x40')][_0x32ab('0x86')]+'%'};return _0x55e9c1;})});}if(_0x4c932c['query'][_0x32ab('0x7d')]){var _0xf49d22=_0x4c932c[_0x32ab('0x40')][_0x32ab('0x7d')][_0x32ab('0x71')](',');var _0x167218={};_0x167218[_0xf49d22[0x0]]={'$gte':moment(_0xf49d22[0x1])[_0x32ab('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4cefea[_0x32ab('0x49')]=_[_0x32ab('0x9d')](_0x4cefea['where'],_0x167218);}_0x4cefea=_[_0x32ab('0x9d')]({},_0x4cefea,_0x4c932c[_0x32ab('0xbb')]);return db[_0x32ab('0xc0')]['count']({'where':_0x4cefea[_0x32ab('0x49')]})[_0x32ab('0x26')](function(_0x59176b){_0x2632e2['count']=_0x59176b;if(_0x4c932c[_0x32ab('0x40')][_0x32ab('0xba')]){_0x4cefea['include']=[{'all':!![]}];}return db[_0x32ab('0xc0')]['findAll'](_0x4cefea);})[_0x32ab('0x26')](function(_0x5bd88c){_0x2632e2['rows']=_0x5bd88c;return _0x2632e2;});}})[_0x32ab('0x26')](respondWithFilteredResult(_0x5b2ae9,_0x4cefea))[_0x32ab('0x30')](handleError(_0x5b2ae9,null));};exports[_0x32ab('0xc6')]=function(_0x41e6d1,_0x254e73,_0x38f086){return db[_0x32ab('0x3a')][_0x32ab('0x6d')]({'where':{'id':_0x41e6d1['params']['id']}})['then'](handleEntityNotFound(_0x254e73,null))[_0x32ab('0x26')](function(_0x2a8cbf){if(_0x2a8cbf){return _0x2a8cbf[_0x32ab('0xc7')](_0x41e6d1['body'][_0x32ab('0xc2')],_[_0x32ab('0xc1')](_0x41e6d1['body'],[_0x32ab('0xc2'),'id'])||{})['spread'](function(){return db['Tag'][_0x32ab('0xc8')]({'attributes':['id',_0x32ab('0x2a'),_0x32ab('0x4d')],'where':{'id':_0x41e6d1[_0x32ab('0x77')][_0x32ab('0xc2')]}});})[_0x32ab('0x26')](function(_0xad9850){socket[_0x32ab('0xc9')]('faxInteractionTags:save',{'id':Number(_0x41e6d1[_0x32ab('0xb9')]['id']),'tags':_0xad9850||[]});return{'id':Number(_0x41e6d1['params']['id']),'tags':_0xad9850||[]};});}})[_0x32ab('0x26')](respondWithResult(_0x254e73,null))[_0x32ab('0x30')](handleError(_0x254e73,null));};exports[_0x32ab('0xca')]=function(_0x2cf38d,_0x1c2aa6,_0x14a47a){return db[_0x32ab('0x3a')]['find']({'where':{'id':_0x2cf38d[_0x32ab('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1c2aa6,null))[_0x32ab('0x26')](function(_0x2006b8){if(_0x2006b8){return _0x2006b8[_0x32ab('0xca')](_0x2cf38d[_0x32ab('0x40')][_0x32ab('0xc2')]);}})['then'](respondWithStatusCode(_0x1c2aa6,null))[_0x32ab('0x30')](handleError(_0x1c2aa6,null));};exports[_0x32ab('0xcb')]=function(_0x4f107e,_0x1cdd54){var _0x48f882=moment()['unix']()[_0x32ab('0x9a')]();var _0x4d1e23=path[_0x32ab('0xcc')](config[_0x32ab('0xcd')],_0x32ab('0xce'),_0x32ab('0xcf'),'tmp');var _0x3482ca=path[_0x32ab('0xcc')](config['root'],_0x32ab('0xce'),_0x32ab('0xcf'),_0x32ab('0xd0'));var _0x1b9011=path[_0x32ab('0xcc')](_0x4d1e23,_0x48f882);var _0x4d2c9f=util['format'](_0x32ab('0xd1'),_0x4f107e[_0x32ab('0xb9')]['id'],_0x48f882);var _0x167a3f=path[_0x32ab('0xcc')](_0x4d1e23,_0x4d2c9f);var _0x138596=[];_0x138596[_0x32ab('0x2f')]({'model':db[_0x32ab('0xd2')],'as':_0x32ab('0xd2'),'raw':!![]});var _0x45cdf7=[{'model':db[_0x32ab('0xc0')],'as':_0x32ab('0xd3'),'attributes':['id',_0x32ab('0x77'),_0x32ab('0xd4')],'include':_0x138596}];return db[_0x32ab('0x3a')][_0x32ab('0x6d')]({'where':{'id':_0x4f107e['params']['id']},'include':_0x45cdf7})['then'](handleEntityNotFound(_0x1cdd54,null))['then'](function(_0xb4f98d){if(_0xb4f98d&&_0xb4f98d[_0x32ab('0xd3')]){var _0x154355=_0xb4f98d[_0x32ab('0xd5')]({'plain':!![]});fs[_0x32ab('0xd6')](_0x1b9011);for(var _0x105878=0x0;_0x105878<_0x154355[_0x32ab('0xd3')]['length'];_0x105878++){var _0x423309=_0x154355[_0x32ab('0xd3')][_0x105878]['Attachment'];if(_0x423309){var _0x3b4d6e=path[_0x32ab('0xcc')](_0x3482ca,_0x423309[_0x32ab('0xd7')]);if(fs[_0x32ab('0xd8')](_0x3b4d6e)){fs[_0x32ab('0xd9')](_0x3b4d6e)['pipe'](fs[_0x32ab('0xda')](path[_0x32ab('0xcc')](_0x1b9011,_0x423309[_0x32ab('0xd7')])));}}}return BPromise['resolve']()[_0x32ab('0x26')](function(){return new BPromise(function(_0x3bfe7f,_0x6b9d79){zipdir(_0x1b9011,{'saveTo':_0x167a3f},function(_0x24319a,_0x57c2b8){if(_0x24319a)return _0x6b9d79(_0x24319a);return _0x3bfe7f(_0x57c2b8);});})[_0x32ab('0x26')](function(){return new BPromise(function(_0x11a4b2,_0x2720ee){rimraf(_0x1b9011,function(_0x2228be){if(_0x2228be)_0x2720ee(_0x2228be);return _0x11a4b2();});});})[_0x32ab('0x26')](function(){return _0x1cdd54[_0x32ab('0xcb')](_0x167a3f,_0x4d2c9f,function(_0x1559c5){if(_0x1559c5){console[_0x32ab('0xdb')](_0x32ab('0xdc'),_0x1559c5);}else{fs['unlinkSync'](_0x167a3f);}});});});}else{return _0x1cdd54[_0x32ab('0x1d')](0xc8);}})['catch'](handleError(_0x1cdd54,null));}; \ No newline at end of file +var _0x0977=['join','server','files','tmp','attachments','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','map','FaxInteraction','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','left_join','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','body','keys','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.fax\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','unreadMessages','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','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','include','merge','options','create','params','addMessage','FaxMessage','ids','omit','getMessages','findOne','rawAttributes','$gte','format','includeAll','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0x0977,0xec));var _0x7097=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0977[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7097('0x0'));var zipdir=require(_0x7097('0x1'));var jsonpatch=require(_0x7097('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7097('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7097('0x4'));var csv=require('to-csv');var ejs=require(_0x7097('0x5'));var fs=require('fs');var fs_extra=require(_0x7097('0x6'));var _=require(_0x7097('0x7'));var squel=require(_0x7097('0x8'));var crypto=require('crypto');var jsforce=require(_0x7097('0x9'));var deskjs=require(_0x7097('0xa'));var toCsv=require(_0x7097('0xb'));var querystring=require(_0x7097('0xc'));var Papa=require(_0x7097('0xd'));var Redis=require('ioredis');var authService=require(_0x7097('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7097('0xf'));var logger=require(_0x7097('0x10'))(_0x7097('0x11'));var utils=require(_0x7097('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7097('0x13'));var db=require(_0x7097('0x14'))['db'];config[_0x7097('0x15')]=_[_0x7097('0x16')](config[_0x7097('0x15')],{'host':_0x7097('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7097('0x15')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x344abe,_0x4a11ae){_0x4a11ae=_0x4a11ae||0xcc;return function(_0x342012){if(_0x342012){return _0x344abe[_0x7097('0x18')](_0x4a11ae);}return _0x344abe[_0x7097('0x19')](_0x4a11ae)[_0x7097('0x1a')]();};}function respondWithResult(_0x132a20,_0x52d3d2){_0x52d3d2=_0x52d3d2||0xc8;return function(_0x289cc8){if(_0x289cc8){return _0x132a20[_0x7097('0x19')](_0x52d3d2)[_0x7097('0x1b')](_0x289cc8);}};}function respondWithFilteredResult(_0x21c33f,_0x2864f1){return function(_0x1fe752){if(_0x1fe752){var _0x1e43de=typeof _0x2864f1[_0x7097('0x1c')]===_0x7097('0x1d')&&typeof _0x2864f1[_0x7097('0x1e')]===_0x7097('0x1d');var _0x48d503=_0x1fe752[_0x7097('0x1f')];var _0x2ce48f=_0x1e43de?0x0:_0x2864f1[_0x7097('0x1c')];var _0x389ac9=_0x1e43de?_0x1fe752[_0x7097('0x1f')]:_0x2864f1[_0x7097('0x1c')]+_0x2864f1[_0x7097('0x1e')];var _0x5b627b;if(_0x389ac9>=_0x48d503){_0x389ac9=_0x48d503;_0x5b627b=0xc8;}else{_0x5b627b=0xce;}_0x21c33f['status'](_0x5b627b);return _0x21c33f[_0x7097('0x20')](_0x7097('0x21'),_0x2ce48f+'-'+_0x389ac9+'/'+_0x48d503)[_0x7097('0x1b')](_0x1fe752);}return null;};}function patchUpdates(_0x16b491){return function(_0x4727fb){try{jsonpatch[_0x7097('0x22')](_0x4727fb,_0x16b491,!![]);}catch(_0x25b36d){return BPromise[_0x7097('0x23')](_0x25b36d);}return _0x4727fb[_0x7097('0x24')]();};}function saveUpdates(_0xdbbb62,_0x5b92e6){return function(_0x316a57){if(_0x316a57){return _0x316a57[_0x7097('0x25')](_0xdbbb62)[_0x7097('0x26')](function(_0x376cce){return _0x376cce;});}return null;};}function removeEntity(_0x381dbd,_0x34392b){return function(_0x415e3e){if(_0x415e3e){return _0x415e3e[_0x7097('0x27')]()['then'](function(){_0x381dbd[_0x7097('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3b77,_0x1a640a){return function(_0x7951d7){if(!_0x7951d7){_0x5a3b77['sendStatus'](0x194);}return _0x7951d7;};}function handleError(_0x28f8bf,_0xa90d29){_0xa90d29=_0xa90d29||0x1f4;return function(_0x397ff4){logger[_0x7097('0x28')](_0x397ff4[_0x7097('0x29')]);if(_0x397ff4[_0x7097('0x2a')]){delete _0x397ff4['name'];}_0x28f8bf[_0x7097('0x19')](_0xa90d29)[_0x7097('0x2b')](_0x397ff4);};}function getInteractionUsers(_0x239efb,_0x10670d){return new BPromise(function(_0x2acc7a,_0x924ead){try{if(_0x10670d[_0x239efb['id']]){_0x239efb[_0x7097('0x2c')]=_['map'](_0x10670d[_0x239efb['id']],function(_0x5a985a){return{'id':_0x5a985a['id'],'fullname':_0x5a985a[_0x7097('0x2d')]};});}}catch(_0x154d5b){_0x924ead(_0x154d5b);}_0x2acc7a(_0x239efb);});}function getInteractionTags(_0x53ab9d,_0x473878){return new BPromise(function(_0x10505a,_0x28f44e){try{if(_0x53ab9d[_0x7097('0x2e')]){_0x53ab9d[_0x7097('0x2f')]=[];_0x53ab9d[_0x7097('0x2e')][_0x7097('0x30')](',')['forEach'](function(_0x319e87){_0x53ab9d[_0x7097('0x2f')][_0x7097('0x31')](_0x473878[_0x319e87]);});}delete _0x53ab9d['TagIds'];}catch(_0xb9702b){_0x28f44e(_0xb9702b);}_0x10505a(_0x53ab9d);});}function updateFaxInteraction(_0x4c0b1e,_0x965f6d,_0x296458){return new BPromise(function(_0x58dd4d,_0x242079){return getInteractionUsers(_0x4c0b1e,_0x296458)[_0x7097('0x26')](function(_0xde6d26){return getInteractionTags(_0xde6d26,_0x965f6d);})['then'](function(_0x1f0efe){return getStateInteraction(_0x1f0efe);})[_0x7097('0x26')](function(_0x2b45cb){_0x58dd4d(_0x2b45cb);})[_0x7097('0x32')](function(_0x2af356){_0x242079(_0x2af356);});});}function getStateInteraction(_0x46b4c4){return new BPromise(function(_0xa02946){_0x46b4c4[_0x7097('0x33')]=0x0;_0x46b4c4[_0x7097('0x34')]=0x0;_0x46b4c4['answered']=0x0;_0x46b4c4[_0x7097('0x35')]=0x0;_0x46b4c4[_0x7097('0x36')]=0x0;if(!_0x46b4c4[_0x7097('0x37')]&&!_0x46b4c4[_0x7097('0x38')]){_0x46b4c4[_0x7097('0x33')]+=0x1;}if(!_0x46b4c4[_0x7097('0x37')]&&_0x46b4c4[_0x7097('0x38')]){_0x46b4c4[_0x7097('0x34')]+=0x1;if(_0x46b4c4['waiting']){_0x46b4c4['waiting']-=0x1;}}if(_0x46b4c4['closed']&&_0x46b4c4['UserId']){_0x46b4c4[_0x7097('0x39')]+=0x1;if(_0x46b4c4[_0x7097('0x34')]){_0x46b4c4[_0x7097('0x34')]-=0x1;}}if(_0x46b4c4[_0x7097('0x37')]&&!_0x46b4c4[_0x7097('0x38')]){_0x46b4c4[_0x7097('0x35')]+=0x1;if(_0x46b4c4[_0x7097('0x33')]){_0x46b4c4['waiting']-=0x1;}}_0x46b4c4[_0x7097('0x36')]+=0x1;_0xa02946(_0x46b4c4);});}exports['index']=function(_0x31dc29,_0x5c0e35){var _0x7d6211={},_0x563ead={},_0x25e4af={'count':0x0,'rows':[]};var _0x2612f1=_[_0x7097('0x3a')](db[_0x7097('0x3b')]['rawAttributes'],function(_0x2edf93){return{'name':_0x2edf93['fieldName'],'type':_0x2edf93[_0x7097('0x3c')][_0x7097('0x3d')]};});_0x563ead['model']=_['map'](_0x2612f1,_0x7097('0x2a'));_0x563ead[_0x7097('0x3e')]=_['keys'](_0x31dc29[_0x7097('0x3e')]);_0x563ead['filters']=_[_0x7097('0x3f')](_0x563ead[_0x7097('0x40')],_0x563ead[_0x7097('0x3e')]);_0x7d6211['attributes']=_[_0x7097('0x3f')](_0x563ead['model'],qs[_0x7097('0x41')](_0x31dc29[_0x7097('0x3e')][_0x7097('0x41')]));_0x7d6211[_0x7097('0x42')]=_0x7d6211[_0x7097('0x42')][_0x7097('0x43')]?_0x7d6211[_0x7097('0x42')]:_0x563ead['model'];if(!_0x31dc29[_0x7097('0x3e')][_0x7097('0x44')](_0x7097('0x45'))){_0x7d6211[_0x7097('0x1e')]=qs[_0x7097('0x1e')](_0x31dc29[_0x7097('0x3e')]['limit']);_0x7d6211[_0x7097('0x1c')]=qs[_0x7097('0x1c')](_0x31dc29[_0x7097('0x3e')][_0x7097('0x1c')]);}_0x7d6211[_0x7097('0x46')]=qs[_0x7097('0x47')](_0x31dc29[_0x7097('0x3e')][_0x7097('0x47')]);_0x7d6211[_0x7097('0x48')]=qs[_0x7097('0x49')](_[_0x7097('0x4a')](_0x31dc29[_0x7097('0x3e')],_0x563ead[_0x7097('0x49')]),_0x2612f1);var _0x3fc979=[];var _0x411b77=squel[_0x7097('0x4b')]()['field']('id')[_0x7097('0x4c')]('name')['field'](_0x7097('0x4d'))[_0x7097('0x4e')](_0x7097('0x4f'));var _0x1f2aa1=squel['select']()[_0x7097('0x4c')](_0x7097('0x50'))[_0x7097('0x4c')](_0x7097('0x51'))['field']('ui.FaxInteractionId')[_0x7097('0x4e')](_0x7097('0x52'),'ui')['left_join'](_0x7097('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x1b0547=squel[_0x7097('0x4b')]()['from'](_0x7097('0x54'),'i')['left_join'](_0x7097('0x55'),'c',_0x7097('0x56'))['left_join'](_0x7097('0x53'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x7097('0x57'),'a',_0x7097('0x58'))[_0x7097('0x59')](_0x7097('0x5a'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x7097('0x59')](_0x7097('0x5b'),'it',_0x7097('0x5c'))[_0x7097('0x59')](_0x7097('0x4f'),'t',_0x7097('0x5d'));var _0x37a434=squel[_0x7097('0x5e')]();var _0x4004bd=[];var _0x39d65e=squel[_0x7097('0x5e')]();var _0x29b7f4;if(_0x31dc29['query'][_0x7097('0x5f')]){_0x29b7f4=as[_0x7097('0x60')](_0x31dc29[_0x7097('0x3e')][_0x7097('0x5f')]);var _0x43272c=_0x29b7f4[_0x7097('0x61')];for(var _0x23cc5c=0x0;_0x23cc5c<_0x29b7f4[_0x7097('0x62')][_0x7097('0x43')];_0x23cc5c++){var _0x5cc877=_0x29b7f4[_0x7097('0x62')][_0x23cc5c];var _0xa914c3='i';var _0x2ab081=_['find'](_0x2612f1,['name',_0x5cc877[_0x7097('0x4c')]]);if(!_0x2ab081){switch(_0x5cc877[_0x7097('0x4c')]){case'unreadMessages':if(_0x5cc877[_0x7097('0x63')]==0x1){_0x1b0547[_0x7097('0x64')]('`'+_0x5cc877[_0x7097('0x4c')]+_0x7097('0x65'));}else{_0x1b0547[_0x7097('0x64')]('`'+_0x5cc877['field']+'`\x20>\x200');}break;case _0x7097('0x66'):if(_0x5cc877['operator']===_0x7097('0x67')){if(_0x5cc877[_0x7097('0x63')][_0x7097('0x30')]('\x20')['length']>0x1){_0x37a434[_0x43272c](_0x7097('0x68'),qs[_0x7097('0x69')](_0x5cc877['value']),null);}else{var _0x3d00a4='%'+_0x5cc877['value']+'%';_0x37a434[_0x43272c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3d00a4,_0x3d00a4,_0x3d00a4);}}else{_0x2ab081=_[_0x7097('0x6a')](_0x2612f1,[_0x7097('0x2a'),'ContactId']);_0x5cc877[_0x7097('0x4c')]=_0x7097('0x6b');_0x3abb1a=as[_0x7097('0x6c')](_0xa914c3,_0x2ab081[_0x7097('0x3c')],_0x5cc877);_0x37a434[_0x43272c](_0x3abb1a[_0x7097('0x6d')],_0x3abb1a[_0x7097('0x63')][_0x7097('0x6e')],_0x3abb1a[_0x7097('0x63')][_0x7097('0x1a')]);}break;case _0x7097('0x6f'):var _0x23115c=_0x5cc877[_0x7097('0x63')][_0x7097('0x30')](',')[_0x7097('0x3a')](function(_0x397a48){return Number(_0x397a48);});_0x23115c[_0x7097('0x70')](function(_0x3374ca){_0x39d65e['or'](_0x7097('0x71'),'%,'+_0x3374ca+',%');});_0x4004bd=_[_0x7097('0x72')](_0x4004bd,_0x23115c);break;case _0x7097('0x73'):if(_0x5cc877[_0x7097('0x74')]==='$substring'){_0x37a434[_0x43272c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5cc877['value']+'%',null);}else{_0x2ab081=_[_0x7097('0x6a')](_0x2612f1,['name',_0x7097('0x38')]);_0x5cc877[_0x7097('0x4c')]='UserId';_0x3abb1a=as[_0x7097('0x6c')](_0xa914c3,_0x2ab081[_0x7097('0x3c')],_0x5cc877);_0x37a434[_0x43272c](_0x3abb1a['text'],_0x3abb1a[_0x7097('0x63')][_0x7097('0x6e')],_0x3abb1a[_0x7097('0x63')][_0x7097('0x1a')]);}break;case _0x7097('0x75'):_0x3abb1a=as[_0x7097('0x6c')]('me',null,_0x5cc877);_0x37a434[_0x43272c](_0x3abb1a[_0x7097('0x6d')],_0x3abb1a['value'][_0x7097('0x6e')],_0x3abb1a[_0x7097('0x63')][_0x7097('0x1a')]);break;}}else{var _0x3abb1a=as[_0x7097('0x6c')](_0xa914c3,_0x2ab081[_0x7097('0x3c')],_0x5cc877);_0x37a434[_0x43272c](_0x3abb1a[_0x7097('0x6d')],_0x3abb1a[_0x7097('0x63')]['start'],_0x3abb1a[_0x7097('0x63')][_0x7097('0x1a')]);}}}else{var _0x38726d=_(_0x31dc29[_0x7097('0x3e')])[_0x7097('0x76')]()[_0x7097('0x3a')](function(_0x54cd4d){return _['some'](_0x2612f1,[_0x7097('0x2a'),_0x54cd4d])?_0x54cd4d:undefined;})[_0x7097('0x77')]()['value']();if(!_[_0x7097('0x78')](_0x38726d)){_0x38726d['forEach'](function(_0x47d6fb){if(_0x47d6fb===_0x7097('0x79')){_0x1b0547[_0x7097('0x48')](_0x7097('0x7a'),[][_0x7097('0x7b')](_0x31dc29[_0x7097('0x3e')][_0x47d6fb]));}else if(_0x47d6fb==='createdAt'){var _0x1e703a=JSON['parse'](_0x31dc29['query'][_0x47d6fb])['$gte'];var _0x46bcbf=JSON[_0x7097('0x7c')](_0x31dc29[_0x7097('0x3e')][_0x47d6fb])[_0x7097('0x7d')];_0x1b0547[_0x7097('0x48')](_0x7097('0x7e'),_0x1e703a,_0x46bcbf);}else{if(_0x31dc29[_0x7097('0x3e')][_0x47d6fb]===_0x7097('0x7f')){_0x1b0547[_0x7097('0x48')]('i.'+_0x47d6fb+'\x20IS\x20NULL');}else{_0x1b0547[_0x7097('0x48')]('i.'+_0x47d6fb+'\x20=\x20?',_0x31dc29['query'][_0x47d6fb]);}}});}if(_0x31dc29[_0x7097('0x3e')][_0x7097('0x80')]){if(_0x31dc29['query'][_0x7097('0x80')]==0x1){_0x1b0547[_0x7097('0x64')](_0x7097('0x81'));}else{_0x1b0547[_0x7097('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x31dc29['query']['tag']){_0x4004bd=_[_0x7097('0x82')](_0x31dc29[_0x7097('0x3e')]['tag'])?_0x31dc29[_0x7097('0x3e')][_0x7097('0x83')]:new Array(_0x31dc29[_0x7097('0x3e')][_0x7097('0x83')]);_0x4004bd[_0x7097('0x70')](function(_0x49a0b4){_0x39d65e['or'](_0x7097('0x71'),'%,'+_0x49a0b4+',%');});}if(_0x31dc29[_0x7097('0x3e')][_0x7097('0x84')]){var _0x4f321b=_0x31dc29['query'][_0x7097('0x84')][_0x7097('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7097('0x86')](_0x4f321b)){_0x37a434['or']('i.id\x20LIKE\x20?',_0x4f321b+'%')['or'](_0x7097('0x87'),_0x4f321b+'%');}_0x37a434['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4f321b+'%');}}_0x1b0547['where'](_0x37a434);_0x1b0547['group']('i.id');var _0x46a43b={'type':db[_0x7097('0x88')][_0x7097('0x89')][_0x7097('0x8a')],'raw':!![]};var _0x4e5cc6=_0x1b0547[_0x7097('0x8b')]();_0x4e5cc6[_0x7097('0x4c')](_0x7097('0x8c'));_0x4e5cc6[_0x7097('0x4c')](_0x7097('0x8d'),'unreadMessages');if(_0x7d6211['order']){_0x7d6211[_0x7097('0x46')][_0x7097('0x70')](function(_0x40cc36){var _0x57b207=_0x40cc36[0x0]==='contactName'?_0x40cc36[0x0]:'i.'+_0x40cc36[0x0];_0x1b0547[_0x7097('0x46')](_0x57b207,_0x40cc36[0x1]===_0x7097('0x8e')?![]:!![]);});}if(!_[_0x7097('0x78')](_0x4004bd)){_0x1b0547[_0x7097('0x64')](_0x39d65e);_0x4e5cc6[_0x7097('0x48')](_0x7097('0x8f'),_0x4004bd);}BPromise['resolve']()[_0x7097('0x26')](function(){if(!_0x29b7f4){if(_0x31dc29[_0x7097('0x3e')][_0x7097('0x79')])return;_0x4e5cc6['where'](_0x7097('0x90'));_0x1b0547[_0x7097('0x48')](_0x7097('0x90'));return;}if(_0x31dc29[_0x7097('0x91')][_0x7097('0x92')]!==_0x7097('0x93'))return;return _0x31dc29['user'][_0x7097('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x538cf8){if(_[_0x7097('0x78')](_0x538cf8)){_0x4e5cc6[_0x7097('0x48')](_0x7097('0x95'));_0x1b0547[_0x7097('0x48')](_0x7097('0x95'));}else{_0x4e5cc6['where'](_0x7097('0x7a'),_[_0x7097('0x3a')](_0x538cf8,'id'));_0x1b0547['where'](_0x7097('0x7a'),_[_0x7097('0x3a')](_0x538cf8,'id'));}});})[_0x7097('0x26')](function(){if(_0x31dc29[_0x7097('0x91')][_0x7097('0x92')]===_0x7097('0x93')&&!_0x29b7f4&&!_0x31dc29['query'][_0x7097('0x79')])return[];return db['sequelize']['query'](_0x4e5cc6[_0x7097('0x96')](),_0x46a43b);})[_0x7097('0x26')](function(_0x5bae76){_0x25e4af[_0x7097('0x1f')]=_0x5bae76[_0x7097('0x43')];if(_0x25e4af[_0x7097('0x1f')]===0x0)return[];return db[_0x7097('0x97')][_0x7097('0x3e')](_0x411b77[_0x7097('0x96')](),_0x46a43b)['then'](function(_0x3a340d){_0x3fc979=_['keyBy'](_0x3a340d,'id');_0x46a43b=_['merge'](_0x46a43b,{'model':db[_0x7097('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31dc29[_0x7097('0x3e')][_0x7097('0x41')]){_0x7d6211[_0x7097('0x42')]['forEach'](function(_0x229f85){_0x1b0547['field']('i.'+_0x229f85);});}else{_0x1b0547['field'](_0x7097('0x8d'),_0x7097('0x98'));_0x1b0547[_0x7097('0x4c')](_0x7097('0x99'),_0x7097('0x9a'));_0x1b0547[_0x7097('0x4c')](_0x7097('0x9b'),_0x7097('0x9c'));_0x1b0547[_0x7097('0x4c')](_0x7097('0x9d'),'contactName');_0x1b0547[_0x7097('0x4c')](_0x7097('0x9e'));_0x1b0547[_0x7097('0x4c')](_0x7097('0x9f'),_0x7097('0xa0'));_0x1b0547[_0x7097('0x4c')]('c.lastName',_0x7097('0xa1'));_0x1b0547[_0x7097('0x4c')](_0x7097('0xa2'),_0x7097('0xa3'));_0x1b0547[_0x7097('0x4c')](_0x7097('0xa4'),'Contact.phone');_0x1b0547[_0x7097('0x4c')](_0x7097('0xa5'),'Contact.mobile');_0x1b0547[_0x7097('0x4c')]('c.fax',_0x7097('0xa6'));_0x1b0547[_0x7097('0x4c')](_0x7097('0xa7'),_0x7097('0xa8'));_0x1b0547[_0x7097('0x4c')](_0x7097('0xa9'),_0x7097('0xaa'));_0x1b0547[_0x7097('0x4c')](_0x7097('0xab'),_0x7097('0x2e'));}if(_0x7d6211['limit'])_0x1b0547['limit'](_0x7d6211[_0x7097('0x1e')]);if(_0x7d6211['offset'])_0x1b0547['offset'](_0x7d6211[_0x7097('0x1c')]);return db[_0x7097('0x97')]['query'](_0x1b0547[_0x7097('0x96')](),_0x46a43b);})['then'](function(_0x432639){if(_0x432639[_0x7097('0x43')]>0x0)_0x1f2aa1[_0x7097('0x48')](_0x7097('0xac'),_['map'](_0x432639,'id'));return db[_0x7097('0x97')][_0x7097('0x3e')](_0x1f2aa1[_0x7097('0x96')](),_0x46a43b)[_0x7097('0x26')](function(_0x12a881){var _0x64ba00=_[_0x7097('0xad')](_0x12a881,_0x7097('0xae'));var _0x508c80=[];_0x432639[_0x7097('0x70')](function(_0x3f2838){_0x508c80[_0x7097('0x31')](updateFaxInteraction(_0x3f2838,_0x3fc979,_0x64ba00));});return BPromise['all'](_0x508c80);});});})[_0x7097('0x26')](function(_0x486887){_0x25e4af[_0x7097('0xaf')]=_0x486887;return _0x25e4af;})[_0x7097('0x26')](respondWithFilteredResult(_0x5c0e35,_0x7d6211))[_0x7097('0x32')](handleError(_0x5c0e35,null));};exports[_0x7097('0xb0')]=function(_0x11f75f,_0x52ba37){var _0x2dc522={'raw':![],'where':{'id':_0x11f75f['params']['id']}},_0x59fd60={};_0x59fd60[_0x7097('0x40')]=_[_0x7097('0x76')](db[_0x7097('0x3b')]['rawAttributes']);_0x59fd60[_0x7097('0x3e')]=_['keys'](_0x11f75f[_0x7097('0x3e')]);_0x59fd60[_0x7097('0x49')]=_[_0x7097('0x3f')](_0x59fd60[_0x7097('0x40')],_0x59fd60[_0x7097('0x3e')]);_0x2dc522[_0x7097('0x42')]=_[_0x7097('0x3f')](_0x59fd60[_0x7097('0x40')],qs[_0x7097('0x41')](_0x11f75f[_0x7097('0x3e')][_0x7097('0x41')]));_0x2dc522[_0x7097('0x42')]=_0x2dc522[_0x7097('0x42')][_0x7097('0x43')]?_0x2dc522[_0x7097('0x42')]:_0x59fd60[_0x7097('0x40')];if(_0x11f75f[_0x7097('0x3e')]['includeAll']){_0x2dc522[_0x7097('0xb1')]=[{'all':!![]}];}_0x2dc522=_[_0x7097('0xb2')]({},_0x2dc522,_0x11f75f[_0x7097('0xb3')]);return db[_0x7097('0x3b')][_0x7097('0x6a')](_0x2dc522)[_0x7097('0x26')](handleEntityNotFound(_0x52ba37,null))['then'](respondWithResult(_0x52ba37,null))[_0x7097('0x32')](handleError(_0x52ba37,null));};exports['create']=function(_0xf27f38,_0x2a9449){return db[_0x7097('0x3b')][_0x7097('0xb4')](_0xf27f38[_0x7097('0x75')],{})[_0x7097('0x26')](respondWithResult(_0x2a9449,0xc9))[_0x7097('0x32')](handleError(_0x2a9449,null));};exports[_0x7097('0x25')]=function(_0x295c70,_0x928db9){if(_0x295c70[_0x7097('0x75')]['id']){delete _0x295c70[_0x7097('0x75')]['id'];}return db[_0x7097('0x3b')][_0x7097('0x6a')]({'where':{'id':_0x295c70['params']['id']}})['then'](handleEntityNotFound(_0x928db9,null))[_0x7097('0x26')](saveUpdates(_0x295c70['body'],null))[_0x7097('0x26')](respondWithResult(_0x928db9,null))[_0x7097('0x32')](handleError(_0x928db9,null));};exports['destroy']=function(_0x463eb5,_0x975a66){return db[_0x7097('0x3b')]['find']({'where':{'id':_0x463eb5[_0x7097('0xb5')]['id']}})[_0x7097('0x26')](handleEntityNotFound(_0x975a66,null))['then'](removeEntity(_0x975a66,null))[_0x7097('0x32')](handleError(_0x975a66,null));};exports['describe']=function(_0x54055e,_0x5e3ad4){return db['FaxInteraction']['describe']()[_0x7097('0x26')](respondWithResult(_0x5e3ad4,null))[_0x7097('0x32')](handleError(_0x5e3ad4,null));};exports[_0x7097('0xb6')]=function(_0x32bd52,_0x5e1bbf,_0x99bf38){return db[_0x7097('0xb7')][_0x7097('0x6a')]({'where':{'id':_0x32bd52[_0x7097('0xb5')]['id']}})[_0x7097('0x26')](handleEntityNotFound(_0x5e1bbf,null))[_0x7097('0x26')](function(_0x3cdb1){if(_0x3cdb1){return _0x3cdb1['addMessage'](_0x32bd52[_0x7097('0x75')][_0x7097('0xb8')],_[_0x7097('0xb9')](_0x32bd52[_0x7097('0x75')],[_0x7097('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x5e1bbf,null))['catch'](handleError(_0x5e1bbf,null));};exports[_0x7097('0xba')]=function(_0x2ff92e,_0x3a96d4,_0x3a2c69){var _0xf0cf0d={'raw':![],'where':{}};var _0x4ae042={};var _0x54afac={'count':0x0,'rows':[]};return db[_0x7097('0x3b')][_0x7097('0xbb')]({'where':{'id':_0x2ff92e['params']['id']}})['then'](handleEntityNotFound(_0x3a96d4,null))['then'](function(_0x359b88){if(_0x359b88){_0x4ae042[_0x7097('0x40')]=_[_0x7097('0x76')](db[_0x7097('0xb7')][_0x7097('0xbc')]);_0x4ae042['query']=_['keys'](_0x2ff92e[_0x7097('0x3e')]);_0x4ae042[_0x7097('0x49')]=_[_0x7097('0x3f')](_0x4ae042['model'],_0x4ae042[_0x7097('0x3e')]);_0xf0cf0d[_0x7097('0x42')]=_['intersection'](_0x4ae042['model'],qs['fields'](_0x2ff92e[_0x7097('0x3e')][_0x7097('0x41')]));_0xf0cf0d[_0x7097('0x42')]=_0xf0cf0d[_0x7097('0x42')]['length']?_0xf0cf0d[_0x7097('0x42')]:_0x4ae042['model'];if(!_0x2ff92e[_0x7097('0x3e')][_0x7097('0x44')](_0x7097('0x45'))){_0xf0cf0d['limit']=qs[_0x7097('0x1e')](_0x2ff92e[_0x7097('0x3e')]['limit']);_0xf0cf0d[_0x7097('0x1c')]=qs[_0x7097('0x1c')](_0x2ff92e[_0x7097('0x3e')][_0x7097('0x1c')]);}_0xf0cf0d[_0x7097('0x46')]=qs[_0x7097('0x47')](_0x2ff92e[_0x7097('0x3e')][_0x7097('0x47')]);_0xf0cf0d[_0x7097('0x48')]=qs['filters'](_['pick'](_0x2ff92e[_0x7097('0x3e')],_0x4ae042['filters']));_0xf0cf0d[_0x7097('0x48')][_0x7097('0xae')]=_0x359b88['id'];if(_0x2ff92e[_0x7097('0x3e')][_0x7097('0x84')]){_0xf0cf0d[_0x7097('0x48')]=_[_0x7097('0xb2')](_0xf0cf0d['where'],{'$or':_[_0x7097('0x3a')](_0xf0cf0d['attributes'],function(_0x7be452){var _0xe18cd5={};_0xe18cd5[_0x7be452]={'$like':'%'+_0x2ff92e[_0x7097('0x3e')][_0x7097('0x84')]+'%'};return _0xe18cd5;})});}if(_0x2ff92e['query'][_0x7097('0xbd')]){var _0x766de7=_0x2ff92e[_0x7097('0x3e')][_0x7097('0xbd')][_0x7097('0x30')](',');var _0x1127f1={};_0x1127f1[_0x766de7[0x0]]={'$gte':moment(_0x766de7[0x1])[_0x7097('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf0cf0d[_0x7097('0x48')]=_['merge'](_0xf0cf0d[_0x7097('0x48')],_0x1127f1);}_0xf0cf0d=_[_0x7097('0xb2')]({},_0xf0cf0d,_0x2ff92e[_0x7097('0xb3')]);return db[_0x7097('0xb7')]['count']({'where':_0xf0cf0d[_0x7097('0x48')]})[_0x7097('0x26')](function(_0x2e5ecb){_0x54afac[_0x7097('0x1f')]=_0x2e5ecb;if(_0x2ff92e[_0x7097('0x3e')][_0x7097('0xbf')]){_0xf0cf0d['include']=[{'all':!![]}];}return db['FaxMessage'][_0x7097('0xc0')](_0xf0cf0d);})[_0x7097('0x26')](function(_0x1b75e3){_0x54afac[_0x7097('0xaf')]=_0x1b75e3;return _0x54afac;});}})[_0x7097('0x26')](respondWithFilteredResult(_0x3a96d4,_0xf0cf0d))[_0x7097('0x32')](handleError(_0x3a96d4,null));};exports[_0x7097('0xc1')]=function(_0x22c4ac,_0x5ad1b7,_0x540dc2){return db[_0x7097('0x3b')][_0x7097('0x6a')]({'where':{'id':_0x22c4ac[_0x7097('0xb5')]['id']}})[_0x7097('0x26')](handleEntityNotFound(_0x5ad1b7,null))['then'](function(_0x2c418d){if(_0x2c418d){return _0x2c418d['setTags'](_0x22c4ac['body'][_0x7097('0xb8')],_[_0x7097('0xb9')](_0x22c4ac[_0x7097('0x75')],['ids','id'])||{})[_0x7097('0xc2')](function(){return db[_0x7097('0x6f')]['findAll']({'attributes':['id',_0x7097('0x2a'),'color'],'where':{'id':_0x22c4ac[_0x7097('0x75')]['ids']}});})[_0x7097('0x26')](function(_0x541580){socket[_0x7097('0xc3')](_0x7097('0xc4'),{'id':Number(_0x22c4ac['params']['id']),'tags':_0x541580||[]});return{'id':Number(_0x22c4ac['params']['id']),'tags':_0x541580||[]};});}})[_0x7097('0x26')](respondWithResult(_0x5ad1b7,null))[_0x7097('0x32')](handleError(_0x5ad1b7,null));};exports['removeTags']=function(_0x9e03b1,_0x90c0b4,_0x4fbac6){return db[_0x7097('0x3b')][_0x7097('0x6a')]({'where':{'id':_0x9e03b1['params']['id']}})[_0x7097('0x26')](handleEntityNotFound(_0x90c0b4,null))['then'](function(_0x38e762){if(_0x38e762){return _0x38e762[_0x7097('0xc5')](_0x9e03b1['query'][_0x7097('0xb8')]);}})[_0x7097('0x26')](respondWithStatusCode(_0x90c0b4,null))[_0x7097('0x32')](handleError(_0x90c0b4,null));};exports[_0x7097('0xc6')]=function(_0x3fa3f4,_0x4c863b){var _0x5791a3=moment()[_0x7097('0xc7')]()[_0x7097('0x96')]();var _0x5dca63=path[_0x7097('0xc8')](config['root'],_0x7097('0xc9'),_0x7097('0xca'),_0x7097('0xcb'));var _0x44d2a6=path[_0x7097('0xc8')](config['root'],_0x7097('0xc9'),_0x7097('0xca'),_0x7097('0xcc'));var _0x1acad9=path[_0x7097('0xc8')](_0x5dca63,_0x5791a3);var _0xb1eb4f=util[_0x7097('0xbe')]('transcript-%d-%s.zip',_0x3fa3f4[_0x7097('0xb5')]['id'],_0x5791a3);var _0x42433f=path['join'](_0x5dca63,_0xb1eb4f);var _0x271bff=[];_0x271bff[_0x7097('0x31')]({'model':db[_0x7097('0xcd')],'as':_0x7097('0xcd'),'raw':!![]});var _0x37ade7=[{'model':db[_0x7097('0xb7')],'as':_0x7097('0xce'),'attributes':['id',_0x7097('0x75'),_0x7097('0xcf')],'include':_0x271bff}];return db['FaxInteraction'][_0x7097('0x6a')]({'where':{'id':_0x3fa3f4[_0x7097('0xb5')]['id']},'include':_0x37ade7})['then'](handleEntityNotFound(_0x4c863b,null))['then'](function(_0x1d69f8){if(_0x1d69f8&&_0x1d69f8[_0x7097('0xce')]){var _0x18781c=_0x1d69f8[_0x7097('0xd0')]({'plain':!![]});fs[_0x7097('0xd1')](_0x1acad9);for(var _0x28691a=0x0;_0x28691a<_0x18781c[_0x7097('0xce')][_0x7097('0x43')];_0x28691a++){var _0x954073=_0x18781c[_0x7097('0xce')][_0x28691a][_0x7097('0xcd')];if(_0x954073){var _0x39749d=path[_0x7097('0xc8')](_0x44d2a6,_0x954073['basename']);if(fs[_0x7097('0xd2')](_0x39749d)){fs[_0x7097('0xd3')](_0x39749d)[_0x7097('0xd4')](fs[_0x7097('0xd5')](path['join'](_0x1acad9,_0x954073[_0x7097('0xd6')])));}}}return BPromise[_0x7097('0xd7')]()[_0x7097('0x26')](function(){return new BPromise(function(_0x3d0e31,_0xe0c72e){zipdir(_0x1acad9,{'saveTo':_0x42433f},function(_0x8395fb,_0x47fef4){if(_0x8395fb)return _0xe0c72e(_0x8395fb);return _0x3d0e31(_0x47fef4);});})[_0x7097('0x26')](function(){return new BPromise(function(_0x38059c,_0xd3c854){rimraf(_0x1acad9,function(_0x3ee995){if(_0x3ee995)_0xd3c854(_0x3ee995);return _0x38059c();});});})[_0x7097('0x26')](function(){return _0x4c863b[_0x7097('0xc6')](_0x42433f,_0xb1eb4f,function(_0x30a989){if(_0x30a989){console[_0x7097('0xd8')]('err',_0x30a989);}else{fs[_0x7097('0xd9')](_0x42433f);}});});});}else{return _0x4c863b[_0x7097('0x18')](0xc8);}})[_0x7097('0x32')](handleError(_0x4c863b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f219ea1..150414a 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 _0x7b41=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','update','getUsers','then','setDataValue','Users','map'];(function(_0x47b7f6,_0x1bcee6){var _0x2a19fd=function(_0x23cf74){while(--_0x23cf74){_0x47b7f6['push'](_0x47b7f6['shift']());}};_0x2a19fd(++_0x1bcee6);}(_0x7b41,0x107));var _0x17b4=function(_0x17ed7b,_0x3b98e){_0x17ed7b=_0x17ed7b-0x0;var _0x37e2c5=_0x7b41[_0x17ed7b];return _0x37e2c5;};'use strict';var EventEmitter=require(_0x17b4('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x17b4('0x1')];var FaxMessage=require(_0x17b4('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x17b4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x218a0a){return function(_0x2c840b,_0x5e2e71,_0x5c6eca){_0x2c840b[_0x17b4('0x4')]({'attributes':['id'],'raw':!![]})[_0x17b4('0x5')](function(_0x4fb796){_0x2c840b[_0x17b4('0x6')](_0x17b4('0x7'),_0x4fb796[_0x17b4('0x8')](function(_0x3e67d0){return{'id':_0x3e67d0['id']};}));return FaxMessage[_0x17b4('0x9')]({'where':{'FaxInteractionId':_0x2c840b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x39898b){_0x2c840b['setDataValue'](_0x17b4('0xa'),_0x39898b[_0x17b4('0xb')]);FaxInteractionEvents[_0x17b4('0xc')](_0x218a0a+':'+_0x2c840b['id'],_0x2c840b);FaxInteractionEvents['emit'](_0x218a0a,_0x2c840b);_0x5c6eca(null);})[_0x17b4('0xd')](_0x5c6eca(null));};}for(var e in events){if(events[_0x17b4('0xe')](e)){var event=events[e];FaxInteraction[_0x17b4('0xf')](e,emitEvent(event));}}module[_0x17b4('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x53d9=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','FaxMessage','setMaxListeners','save','update'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x53d9,0x19c));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0x953d('0x0')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x953d('0x1')](0x0);var events={'afterCreate':_0x953d('0x2'),'afterUpdate':_0x953d('0x3'),'afterDestroy':_0x953d('0x4')};function emitEvent(_0x3df370){return function(_0xa7b886,_0x5c2a6f,_0x419be2){_0xa7b886[_0x953d('0x5')]({'attributes':['id'],'raw':!![]})[_0x953d('0x6')](function(_0x52884f){_0xa7b886[_0x953d('0x7')](_0x953d('0x8'),_0x52884f[_0x953d('0x9')](function(_0xc79f71){return{'id':_0xc79f71['id']};}));return FaxMessage[_0x953d('0xa')]({'where':{'FaxInteractionId':_0xa7b886['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4cca88){_0xa7b886[_0x953d('0x7')](_0x953d('0xb'),_0x4cca88[_0x953d('0xc')]);FaxInteractionEvents['emit'](_0x3df370+':'+_0xa7b886['id'],_0xa7b886);FaxInteractionEvents[_0x953d('0xd')](_0x3df370,_0xa7b886);_0x419be2(null);})[_0x953d('0xe')](_0x419be2(null));};}for(var e in events){if(events[_0x953d('0xf')](e)){var event=events[e];FaxInteraction['hook'](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 c07fb78..27ca7ff 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 _0x6072=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','fax_interactions','changed','closed','closedAt','format'];(function(_0x3665de,_0x27a4e8){var _0x585e50=function(_0x16d56f){while(--_0x16d56f){_0x3665de['push'](_0x3665de['shift']());}};_0x585e50(++_0x27a4e8);}(_0x6072,0x17b));var _0x2607=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6072[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2607('0x0'));var util=require(_0x2607('0x1'));var logger=require(_0x2607('0x2'))(_0x2607('0x3'));var moment=require(_0x2607('0x4'));var BPromise=require(_0x2607('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2607('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x2607('0x7')]=function(_0x447083,_0x25055c){return _0x447083['define']('FaxInteraction',attributes,{'tableName':_0x2607('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1db297,_0x183d04,_0x2eaded){if(_0x1db297[_0x2607('0x9')](_0x2607('0xa'))){_0x1db297[_0x2607('0xb')]=moment()[_0x2607('0xc')](_0x2607('0xd'));}_0x2eaded(null,_0x1db297);}}});}; \ No newline at end of file +var _0x583c=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x583c,0x12b));var _0xc583=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x583c[_0x3b3cc6];return _0x1161e4;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));module['exports']=function(_0xd3a750,_0x365ed6){return _0xd3a750[_0xc583('0x8')](_0xc583('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21ed88,_0x26cec0,_0x5b456e){if(_0x21ed88[_0xc583('0xa')](_0xc583('0xb'))){_0x21ed88[_0xc583('0xc')]=moment()[_0xc583('0xd')](_0xc583('0xe'));}_0x5b456e(null,_0x21ed88);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7116e39..2376800 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 _0x19c3=['update','options','where','catch','AddTagsToFaxInteraction','body','ids','omit','spread','debug','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','request\x20sent','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','UpdateFaxInteraction','FaxInteraction'];(function(_0x404b35,_0x1f1db5){var _0x58ac40=function(_0x5e1d90){while(--_0x5e1d90){_0x404b35['push'](_0x404b35['shift']());}};_0x58ac40(++_0x1f1db5);}(_0x19c3,0x173));var _0x319c=function(_0x45c63c,_0x3061ae){_0x45c63c=_0x45c63c-0x0;var _0x475aed=_0x19c3[_0x45c63c];return _0x475aed;};'use strict';var _=require(_0x319c('0x0'));var util=require(_0x319c('0x1'));var moment=require(_0x319c('0x2'));var BPromise=require('bluebird');var rs=require(_0x319c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x319c('0x4'))['db'];var utils=require(_0x319c('0x5'));var logger=require(_0x319c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x319c('0x7'));var client=jayson['client'][_0x319c('0x8')]({'port':0x232a});config[_0x319c('0x9')]=_[_0x319c('0xa')](config[_0x319c('0x9')],{'host':_0x319c('0xb'),'port':0x18eb});var socket=require(_0x319c('0xc'))(new Redis(config[_0x319c('0x9')]));require(_0x319c('0xd'))[_0x319c('0xe')](socket);function respondWithRpcPromise(_0xa182b5,_0x931e7e,_0x1959a2){return new BPromise(function(_0x377d1a,_0x12ce67){return client['request'](_0xa182b5,_0x1959a2)[_0x319c('0xf')](function(_0x39673){logger[_0x319c('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x931e7e,_0x319c('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x931e7e,_0x319c('0x11'),JSON[_0x319c('0x12')](_0x39673));if(_0x39673[_0x319c('0x13')]){if(_0x39673[_0x319c('0x13')][_0x319c('0x14')]===0x1f4){logger[_0x319c('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x931e7e,_0x39673[_0x319c('0x13')][_0x319c('0x15')]);return _0x12ce67(_0x39673[_0x319c('0x13')][_0x319c('0x15')]);}logger[_0x319c('0x13')](_0x319c('0x16'),_0x931e7e,_0x39673[_0x319c('0x13')]['message']);return _0x377d1a(_0x39673[_0x319c('0x13')][_0x319c('0x15')]);}else{logger[_0x319c('0x10')](_0x319c('0x16'),_0x931e7e,'request\x20sent');_0x377d1a(_0x39673['result'][_0x319c('0x15')]);}})['catch'](function(_0x3d27ea){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x931e7e,_0x3d27ea);_0x12ce67(_0x3d27ea);});});}exports[_0x319c('0x17')]=function(_0x1b70fe){var _0xb46c6f=this;return new Promise(function(_0xa5c0b2,_0x56af36){return db[_0x319c('0x18')][_0x319c('0x19')](_0x1b70fe['body'],{'raw':_0x1b70fe['options']?_0x1b70fe[_0x319c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b70fe[_0x319c('0x1a')]?_0x1b70fe[_0x319c('0x1a')][_0x319c('0x1b')]||null:null,'attributes':_0x1b70fe[_0x319c('0x1a')]?_0x1b70fe[_0x319c('0x1a')]['attributes']||null:null,'limit':_0x1b70fe[_0x319c('0x1a')]?_0x1b70fe['options']['limit']||null:null})[_0x319c('0xf')](function(_0x437a63){logger['info'](_0x319c('0x17'),_0x1b70fe);logger['debug']('UpdateFaxInteraction',_0x1b70fe,JSON[_0x319c('0x12')](_0x437a63));_0xa5c0b2(_0x437a63);})[_0x319c('0x1c')](function(_0x574dd3){logger[_0x319c('0x13')](_0x319c('0x17'),_0x574dd3[_0x319c('0x15')],_0x1b70fe);_0x56af36(_0xb46c6f[_0x319c('0x13')](0x1f4,_0x574dd3[_0x319c('0x15')]));});});};exports[_0x319c('0x1d')]=function(_0x3bb15f){return new Promise(function(_0x352b46,_0x4ced22){return db[_0x319c('0x18')]['find']({'where':_0x3bb15f[_0x319c('0x1a')]?_0x3bb15f[_0x319c('0x1a')][_0x319c('0x1b')]||null:null})['then'](function(_0x1035db){if(_0x1035db){return _0x1035db['addTags'](_0x3bb15f[_0x319c('0x1e')][_0x319c('0x1f')],_[_0x319c('0x20')](_0x3bb15f[_0x319c('0x1e')],[_0x319c('0x1f'),'id'])||{});}})[_0x319c('0x21')](function(_0x6d45cb){logger[_0x319c('0x10')]('AddTags',_0x3bb15f);logger[_0x319c('0x22')](_0x319c('0x23'),_0x3bb15f,JSON['stringify'](_0x6d45cb));_0x352b46(_0x6d45cb);})[_0x319c('0x1c')](function(_0x1bdc6c){logger[_0x319c('0x13')](_0x319c('0x23'),_0x1bdc6c['message'],_0x3bb15f);_0x4ced22(_this[_0x319c('0x13')](0x1f4,_0x1bdc6c[_0x319c('0x15')]));});});}; \ No newline at end of file +var _0xc22f=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','then','debug','AddTagsToFaxInteraction','find','addTags','ids','spread','stringify','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x471835,_0x2d66d1){var _0x279532=function(_0x363e0a){while(--_0x363e0a){_0x471835['push'](_0x471835['shift']());}};_0x279532(++_0x2d66d1);}(_0xc22f,0xee));var _0xfc22=function(_0x263b7b,_0x203c66){_0x263b7b=_0x263b7b-0x0;var _0x3b2108=_0xc22f[_0x263b7b];return _0x3b2108;};'use strict';var _=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfc22('0x2'));var fs=require('fs');var Redis=require(_0xfc22('0x3'));var db=require(_0xfc22('0x4'))['db'];var utils=require(_0xfc22('0x5'));var logger=require(_0xfc22('0x6'))('rpc');var config=require(_0xfc22('0x7'));var jayson=require(_0xfc22('0x8'));var client=jayson[_0xfc22('0x9')][_0xfc22('0xa')]({'port':0x232a});config[_0xfc22('0xb')]=_[_0xfc22('0xc')](config[_0xfc22('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc22('0xd'))(new Redis(config[_0xfc22('0xb')]));require(_0xfc22('0xe'))[_0xfc22('0xf')](socket);function respondWithRpcPromise(_0x14a3ac,_0x57aa7c,_0x34fada){return new BPromise(function(_0x3b6c94,_0x3bdf58){return client[_0xfc22('0x10')](_0x14a3ac,_0x34fada)['then'](function(_0x1ccc2b){logger[_0xfc22('0x11')](_0xfc22('0x12'),_0x57aa7c,_0xfc22('0x13'));logger['debug'](_0xfc22('0x14'),_0x57aa7c,_0xfc22('0x13'),JSON['stringify'](_0x1ccc2b));if(_0x1ccc2b['error']){if(_0x1ccc2b[_0xfc22('0x15')][_0xfc22('0x16')]===0x1f4){logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x57aa7c,_0x1ccc2b[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x3bdf58(_0x1ccc2b[_0xfc22('0x15')][_0xfc22('0x17')]);}logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x57aa7c,_0x1ccc2b[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x3b6c94(_0x1ccc2b['error']['message']);}else{logger['info'](_0xfc22('0x12'),_0x57aa7c,_0xfc22('0x13'));_0x3b6c94(_0x1ccc2b[_0xfc22('0x18')][_0xfc22('0x17')]);}})[_0xfc22('0x19')](function(_0x402907){logger[_0xfc22('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x57aa7c,_0x402907);_0x3bdf58(_0x402907);});});}exports[_0xfc22('0x1a')]=function(_0x430988){var _0x2c81dc=this;return new Promise(function(_0x4e5b5b,_0x4be1f4){return db[_0xfc22('0x1b')][_0xfc22('0x1c')](_0x430988[_0xfc22('0x1d')],{'raw':_0x430988[_0xfc22('0x1e')]?_0x430988['options'][_0xfc22('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x430988[_0xfc22('0x1e')]?_0x430988[_0xfc22('0x1e')][_0xfc22('0x20')]||null:null,'attributes':_0x430988[_0xfc22('0x1e')]?_0x430988['options'][_0xfc22('0x21')]||null:null,'limit':_0x430988['options']?_0x430988[_0xfc22('0x1e')][_0xfc22('0x22')]||null:null})[_0xfc22('0x23')](function(_0x47412c){logger[_0xfc22('0x11')](_0xfc22('0x1a'),_0x430988);logger[_0xfc22('0x24')](_0xfc22('0x1a'),_0x430988,JSON['stringify'](_0x47412c));_0x4e5b5b(_0x47412c);})[_0xfc22('0x19')](function(_0xc4cc21){logger[_0xfc22('0x15')](_0xfc22('0x1a'),_0xc4cc21[_0xfc22('0x17')],_0x430988);_0x4be1f4(_0x2c81dc[_0xfc22('0x15')](0x1f4,_0xc4cc21[_0xfc22('0x17')]));});});};exports[_0xfc22('0x25')]=function(_0x23c7ce){return new Promise(function(_0x2b4ac8,_0x4cbe2f){return db[_0xfc22('0x1b')][_0xfc22('0x26')]({'where':_0x23c7ce['options']?_0x23c7ce[_0xfc22('0x1e')][_0xfc22('0x20')]||null:null})['then'](function(_0x3b2d69){if(_0x3b2d69){return _0x3b2d69[_0xfc22('0x27')](_0x23c7ce[_0xfc22('0x1d')]['ids'],_['omit'](_0x23c7ce[_0xfc22('0x1d')],[_0xfc22('0x28'),'id'])||{});}})[_0xfc22('0x29')](function(_0x1d9edb){logger[_0xfc22('0x11')]('AddTags',_0x23c7ce);logger[_0xfc22('0x24')]('AddTags',_0x23c7ce,JSON[_0xfc22('0x2a')](_0x1d9edb));_0x2b4ac8(_0x1d9edb);})['catch'](function(_0x274f79){logger['error'](_0xfc22('0x2b'),_0x274f79[_0xfc22('0x17')],_0x23c7ce);_0x4cbe2f(_this['error'](0x1f4,_0x274f79[_0xfc22('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index bd34040..43f9ad7 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 _0x8683=['remove','update','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x2e6bbd,_0x2590f2){var _0x42d17c=function(_0x49bc5a){while(--_0x49bc5a){_0x2e6bbd['push'](_0x2e6bbd['shift']());}};_0x42d17c(++_0x2590f2);}(_0x8683,0x1e5));var _0x3868=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8683[_0x5b561d];return _0x431060;};'use strict';var FaxInteractionEvents=require(_0x3868('0x0'));var events=['save',_0x3868('0x1'),_0x3868('0x2')];function createListener(_0x1c1682,_0x1d048f){return function(_0x33f438){_0x1d048f['emit'](_0x1c1682,_0x33f438);};}function removeListener(_0x10b682,_0x40effd){return function(){FaxInteractionEvents['removeListener'](_0x10b682,_0x40effd);};}exports[_0x3868('0x3')]=function(_0xb4c9c){for(var _0x5313ae=0x0,_0x53d04e=events[_0x3868('0x4')];_0x5313ae<_0x53d04e;_0x5313ae++){var _0x389fc9=events[_0x5313ae];var _0x2241e4=createListener(_0x3868('0x5')+_0x389fc9,_0xb4c9c);FaxInteractionEvents['on'](_0x389fc9,_0x2241e4);}}; \ No newline at end of file +var _0x0f62=['removeListener','register','./faxInteraction.events','remove','emit'];(function(_0x5cc7e7,_0x3b9912){var _0x155769=function(_0x34de3e){while(--_0x34de3e){_0x5cc7e7['push'](_0x5cc7e7['shift']());}};_0x155769(++_0x3b9912);}(_0x0f62,0x13d));var _0x20f6=function(_0x562110,_0x1ec0c1){_0x562110=_0x562110-0x0;var _0x5a20af=_0x0f62[_0x562110];return _0x5a20af;};'use strict';var FaxInteractionEvents=require(_0x20f6('0x0'));var events=['save',_0x20f6('0x1'),'update'];function createListener(_0xc13944,_0x6e4b1){return function(_0x3a5623){_0x6e4b1[_0x20f6('0x2')](_0xc13944,_0x3a5623);};}function removeListener(_0x515696,_0x126b7a){return function(){FaxInteractionEvents[_0x20f6('0x3')](_0x515696,_0x126b7a);};}exports[_0x20f6('0x4')]=function(_0x17fad0){for(var _0x357784=0x0,_0x2317a6=events['length'];_0x357784<_0x2317a6;_0x357784++){var _0x1e3b1d=events[_0x357784];var _0x33de7d=createListener('faxInteraction:'+_0x1e3b1d,_0x17fad0);FaxInteractionEvents['on'](_0x1e3b1d,_0x33de7d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 323d74a..19f6e32 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 _0x17fd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','getMessages','post','addMessage','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','faxinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x34584e,_0x6616f4){var _0x570a60=function(_0x284957){while(--_0x284957){_0x34584e['push'](_0x34584e['shift']());}};_0x570a60(++_0x6616f4);}(_0x17fd,0x1aa));var _0xd17f=function(_0x1d6948,_0xdbc746){_0x1d6948=_0x1d6948-0x0;var _0x114db0=_0x17fd[_0x1d6948];return _0x114db0;};'use strict';var multer=require(_0xd17f('0x0'));var util=require(_0xd17f('0x1'));var path=require(_0xd17f('0x2'));var timeout=require(_0xd17f('0x3'));var express=require(_0xd17f('0x4'));var router=express[_0xd17f('0x5')]();var fs_extra=require(_0xd17f('0x6'));var auth=require(_0xd17f('0x7'));var interaction=require(_0xd17f('0x8'));var config=require(_0xd17f('0x9'));var controller=require(_0xd17f('0xa'));router['get']('/',auth[_0xd17f('0xb')](),controller[_0xd17f('0xc')]);router['get'](_0xd17f('0xd'),auth[_0xd17f('0xb')](),controller[_0xd17f('0xe')]);router[_0xd17f('0xf')](_0xd17f('0x10'),auth[_0xd17f('0xb')](),controller[_0xd17f('0x11')]);router[_0xd17f('0xf')](_0xd17f('0x12'),auth[_0xd17f('0xb')](),controller[_0xd17f('0x13')]);router[_0xd17f('0xf')]('/:id/download',auth[_0xd17f('0xb')](),controller['download']);router[_0xd17f('0x14')]('/',auth[_0xd17f('0xb')](),controller['create']);router['post'](_0xd17f('0x12'),auth[_0xd17f('0xb')](),controller[_0xd17f('0x15')]);router[_0xd17f('0x14')]('/:id/tags',auth[_0xd17f('0xb')](),interaction['tracked'](_0xd17f('0x16'),_0xd17f('0x17')),controller[_0xd17f('0x18')]);router[_0xd17f('0x19')](_0xd17f('0x10'),auth[_0xd17f('0xb')](),interaction[_0xd17f('0x1a')](_0xd17f('0x16'),_0xd17f('0x1b')),controller[_0xd17f('0x1c')]);router['delete'](_0xd17f('0x10'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xd17f('0x1d')),controller[_0xd17f('0x1e')]);router['delete'](_0xd17f('0x1f'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd17f('0x20')]=router; \ No newline at end of file +var _0x1d90=['faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete'];(function(_0x223b0c,_0x371c5a){var _0x4ce5ed=function(_0x528c8b){while(--_0x528c8b){_0x223b0c['push'](_0x223b0c['shift']());}};_0x4ce5ed(++_0x371c5a);}(_0x1d90,0x1cb));var _0x01d9=function(_0x40de6f,_0x3d5f9c){_0x40de6f=_0x40de6f-0x0;var _0x44a887=_0x1d90[_0x40de6f];return _0x44a887;};'use strict';var multer=require(_0x01d9('0x0'));var util=require(_0x01d9('0x1'));var path=require(_0x01d9('0x2'));var timeout=require(_0x01d9('0x3'));var express=require('express');var router=express[_0x01d9('0x4')]();var fs_extra=require(_0x01d9('0x5'));var auth=require(_0x01d9('0x6'));var interaction=require(_0x01d9('0x7'));var config=require(_0x01d9('0x8'));var controller=require('./faxInteraction.controller');router[_0x01d9('0x9')]('/',auth['isAuthenticated'](),controller[_0x01d9('0xa')]);router[_0x01d9('0x9')](_0x01d9('0xb'),auth['isAuthenticated'](),controller[_0x01d9('0xc')]);router[_0x01d9('0x9')](_0x01d9('0xd'),auth[_0x01d9('0xe')](),controller[_0x01d9('0xf')]);router[_0x01d9('0x9')](_0x01d9('0x10'),auth[_0x01d9('0xe')](),controller[_0x01d9('0x11')]);router[_0x01d9('0x9')](_0x01d9('0x12'),auth[_0x01d9('0xe')](),controller[_0x01d9('0x13')]);router[_0x01d9('0x14')]('/',auth[_0x01d9('0xe')](),controller[_0x01d9('0x15')]);router[_0x01d9('0x14')](_0x01d9('0x10'),auth[_0x01d9('0xe')](),controller[_0x01d9('0x16')]);router[_0x01d9('0x14')](_0x01d9('0x17'),auth['isAuthenticated'](),interaction[_0x01d9('0x18')](_0x01d9('0x19'),_0x01d9('0x1a')),controller['addTags']);router[_0x01d9('0x1b')](_0x01d9('0xd'),auth[_0x01d9('0xe')](),interaction[_0x01d9('0x18')](_0x01d9('0x19'),_0x01d9('0x1c')),controller[_0x01d9('0x1d')]);router[_0x01d9('0x1e')]('/:id',auth[_0x01d9('0xe')](),interaction[_0x01d9('0x18')](_0x01d9('0x19'),_0x01d9('0x1f')),controller[_0x01d9('0x20')]);router[_0x01d9('0x1e')](_0x01d9('0x17'),auth['isAuthenticated'](),controller[_0x01d9('0x21')]);module[_0x01d9('0x22')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 20f2ce6..fc7bf96 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 _0x79a8=['out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x2d3d18,_0x475f4c){var _0x202f49=function(_0x41abb5){while(--_0x41abb5){_0x2d3d18['push'](_0x2d3d18['shift']());}};_0x202f49(++_0x475f4c);}(_0x79a8,0x1d0));var _0x879a=function(_0xc34e78,_0x19638f){_0xc34e78=_0xc34e78-0x0;var _0x205de5=_0x79a8[_0xc34e78];return _0x205de5;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'body':{'type':Sequelize[_0x879a('0x1')](_0x879a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x879a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x879a('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x879a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x879a('0x5')]}}; \ No newline at end of file +var _0x79d3=['ENUM','out','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x2cde3e,_0x1f2213){var _0x4dfdd7=function(_0x2d7fa5){while(--_0x2d7fa5){_0x2cde3e['push'](_0x2cde3e['shift']());}};_0x4dfdd7(++_0x1f2213);}(_0x79d3,0x15f));var _0x379d=function(_0x588e08,_0x494086){_0x588e08=_0x588e08-0x0;var _0x2d1902=_0x79d3[_0x588e08];return _0x2d1902;};'use strict';var Sequelize=require(_0x379d('0x0'));module['exports']={'body':{'type':Sequelize[_0x379d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x379d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x379d('0x3')]('in','out'),'defaultValue':_0x379d('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x379d('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x379d('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 7b4bdb6..c824da5 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 _0xc1b6=['stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','FaxMessage','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','params','rawAttributes','options','find','body','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','join','root','server','files','attachments','download','Attachment','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','request\x20sent','debug'];(function(_0x3a335a,_0x401d39){var _0x512716=function(_0x31f358){while(--_0x31f358){_0x3a335a['push'](_0x3a335a['shift']());}};_0x512716(++_0x401d39);}(_0xc1b6,0x183));var _0x6c1b=function(_0x4eeece,_0x5d0f4c){_0x4eeece=_0x4eeece-0x0;var _0xc5062e=_0xc1b6[_0x4eeece];return _0xc5062e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c1b('0x0'));var zipdir=require(_0x6c1b('0x1'));var jsonpatch=require(_0x6c1b('0x2'));var rp=require(_0x6c1b('0x3'));var moment=require(_0x6c1b('0x4'));var BPromise=require(_0x6c1b('0x5'));var Mustache=require(_0x6c1b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6c1b('0x7'));var csv=require(_0x6c1b('0x8'));var ejs=require(_0x6c1b('0x9'));var fs=require('fs');var fs_extra=require(_0x6c1b('0xa'));var _=require(_0x6c1b('0xb'));var squel=require(_0x6c1b('0xc'));var crypto=require(_0x6c1b('0xd'));var jsforce=require(_0x6c1b('0xe'));var deskjs=require(_0x6c1b('0xf'));var toCsv=require(_0x6c1b('0x8'));var querystring=require(_0x6c1b('0x10'));var Papa=require(_0x6c1b('0x11'));var Redis=require(_0x6c1b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6c1b('0x13'));var as=require(_0x6c1b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c1b('0x15'))(_0x6c1b('0x16'));var utils=require(_0x6c1b('0x17'));var config=require(_0x6c1b('0x18'));var licenseUtil=require(_0x6c1b('0x19'));var db=require(_0x6c1b('0x1a'))['db'];config[_0x6c1b('0x1b')]=_[_0x6c1b('0x1c')](config[_0x6c1b('0x1b')],{'host':_0x6c1b('0x1d'),'port':0x18eb});var socket=require(_0x6c1b('0x1e'))(new Redis(config[_0x6c1b('0x1b')]));require('./faxMessage.socket')[_0x6c1b('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6c1b('0x20')][_0x6c1b('0x21')]({'port':0x232c});var client9002=jayson[_0x6c1b('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250b8c,_0x102d3b,_0x2a6b37,_0x2ab498){return new BPromise(function(_0x3dbcb7,_0x25d9cb){var _0x522cb0=_0x2ab498||client;return _0x522cb0[_0x6c1b('0x22')](_0x250b8c,_0x2a6b37)[_0x6c1b('0x23')](function(_0x598050){logger[_0x6c1b('0x24')]('FaxMessage,\x20%s,\x20%s',_0x102d3b,_0x6c1b('0x25'));logger[_0x6c1b('0x26')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x102d3b,_0x6c1b('0x25'),JSON[_0x6c1b('0x27')](_0x598050));if(_0x598050[_0x6c1b('0x28')]){if(_0x598050['error']['code']===0x1f4){logger[_0x6c1b('0x28')](_0x6c1b('0x29'),_0x102d3b,_0x598050[_0x6c1b('0x28')][_0x6c1b('0x2a')]);return _0x25d9cb(_0x598050[_0x6c1b('0x28')][_0x6c1b('0x2a')]);}logger[_0x6c1b('0x28')](_0x6c1b('0x29'),_0x102d3b,_0x598050[_0x6c1b('0x28')][_0x6c1b('0x2a')]);return _0x3dbcb7(_0x598050['error'][_0x6c1b('0x2a')]);}else{logger[_0x6c1b('0x24')](_0x6c1b('0x29'),_0x102d3b,'request\x20sent');_0x3dbcb7(_0x598050[_0x6c1b('0x2b')][_0x6c1b('0x2a')]);}})[_0x6c1b('0x2c')](function(_0x276f08){logger[_0x6c1b('0x28')](_0x6c1b('0x29'),_0x102d3b,_0x276f08);_0x25d9cb(_0x276f08);});});}function respondWithStatusCode(_0x1ed7f5,_0x3146f5){_0x3146f5=_0x3146f5||0xcc;return function(_0x302b74){if(_0x302b74){return _0x1ed7f5[_0x6c1b('0x2d')](_0x3146f5);}return _0x1ed7f5[_0x6c1b('0x2e')](_0x3146f5)[_0x6c1b('0x2f')]();};}function respondWithResult(_0x5e89c4,_0x222ae7){_0x222ae7=_0x222ae7||0xc8;return function(_0x3139db){if(_0x3139db){return _0x5e89c4[_0x6c1b('0x2e')](_0x222ae7)[_0x6c1b('0x30')](_0x3139db);}};}function respondWithFilteredResult(_0x3564ca,_0x5b4caf){return function(_0x26627d){if(_0x26627d){var _0x7070b4=typeof _0x5b4caf[_0x6c1b('0x31')]===_0x6c1b('0x32')&&typeof _0x5b4caf['limit']===_0x6c1b('0x32');var _0x483aba=_0x26627d[_0x6c1b('0x33')];var _0x1dd282=_0x7070b4?0x0:_0x5b4caf[_0x6c1b('0x31')];var _0x2f3785=_0x7070b4?_0x26627d[_0x6c1b('0x33')]:_0x5b4caf['offset']+_0x5b4caf['limit'];var _0x311249;if(_0x2f3785>=_0x483aba){_0x2f3785=_0x483aba;_0x311249=0xc8;}else{_0x311249=0xce;}_0x3564ca[_0x6c1b('0x2e')](_0x311249);return _0x3564ca['set'](_0x6c1b('0x34'),_0x1dd282+'-'+_0x2f3785+'/'+_0x483aba)[_0x6c1b('0x30')](_0x26627d);}return null;};}function patchUpdates(_0x5cd5fa){return function(_0x1f08d8){try{jsonpatch[_0x6c1b('0x35')](_0x1f08d8,_0x5cd5fa,!![]);}catch(_0xac2701){return BPromise[_0x6c1b('0x36')](_0xac2701);}return _0x1f08d8[_0x6c1b('0x37')]();};}function saveUpdates(_0x3adb23,_0xa6e1c9){return function(_0x3f745c){if(_0x3f745c){return _0x3f745c[_0x6c1b('0x38')](_0x3adb23)[_0x6c1b('0x23')](function(_0x4466dc){return _0x4466dc;});}return null;};}function removeEntity(_0x3c06aa,_0x174dda){return function(_0x41b6f1){if(_0x41b6f1){return _0x41b6f1[_0x6c1b('0x39')]()['then'](function(){_0x3c06aa[_0x6c1b('0x2e')](0xcc)[_0x6c1b('0x2f')]();});}};}function handleEntityNotFound(_0x48dc7b,_0x4294f6){return function(_0x1f07c0){if(!_0x1f07c0){_0x48dc7b[_0x6c1b('0x2d')](0x194);}return _0x1f07c0;};}function handleError(_0x4ed32e,_0x11275d){_0x11275d=_0x11275d||0x1f4;return function(_0xcc2f78){logger[_0x6c1b('0x28')](_0xcc2f78[_0x6c1b('0x3a')]);if(_0xcc2f78[_0x6c1b('0x3b')]){delete _0xcc2f78[_0x6c1b('0x3b')];}_0x4ed32e[_0x6c1b('0x2e')](_0x11275d)[_0x6c1b('0x3c')](_0xcc2f78);};}exports['index']=function(_0x427094,_0x10905e){var _0xcfd9a2={},_0x33279e={},_0x2e966c={'count':0x0,'rows':[]};var _0x29667a=_[_0x6c1b('0x3d')](db[_0x6c1b('0x3e')]['rawAttributes'],function(_0x3205af){return{'name':_0x3205af['fieldName'],'type':_0x3205af[_0x6c1b('0x3f')][_0x6c1b('0x40')]};});_0x33279e['model']=_['map'](_0x29667a,_0x6c1b('0x3b'));_0x33279e[_0x6c1b('0x41')]=_[_0x6c1b('0x42')](_0x427094[_0x6c1b('0x41')]);_0x33279e[_0x6c1b('0x43')]=_[_0x6c1b('0x44')](_0x33279e['model'],_0x33279e[_0x6c1b('0x41')]);_0xcfd9a2[_0x6c1b('0x45')]=_['intersection'](_0x33279e[_0x6c1b('0x46')],qs[_0x6c1b('0x47')](_0x427094[_0x6c1b('0x41')]['fields']));_0xcfd9a2['attributes']=_0xcfd9a2['attributes'][_0x6c1b('0x48')]?_0xcfd9a2[_0x6c1b('0x45')]:_0x33279e[_0x6c1b('0x46')];if(!_0x427094['query']['hasOwnProperty'](_0x6c1b('0x49'))){_0xcfd9a2['limit']=qs['limit'](_0x427094[_0x6c1b('0x41')][_0x6c1b('0x4a')]);_0xcfd9a2[_0x6c1b('0x31')]=qs[_0x6c1b('0x31')](_0x427094[_0x6c1b('0x41')]['offset']);}_0xcfd9a2['order']=qs[_0x6c1b('0x4b')](_0x427094[_0x6c1b('0x41')][_0x6c1b('0x4b')]);_0xcfd9a2[_0x6c1b('0x4c')]=qs[_0x6c1b('0x43')](_['pick'](_0x427094[_0x6c1b('0x41')],_0x33279e[_0x6c1b('0x43')]),_0x29667a);if(_0x427094[_0x6c1b('0x41')][_0x6c1b('0x4d')]){_0xcfd9a2['where']=_['merge'](_0xcfd9a2[_0x6c1b('0x4c')],{'$or':_[_0x6c1b('0x3d')](_0x29667a,function(_0x585257){if(_0x585257[_0x6c1b('0x3f')]!==_0x6c1b('0x4e')){var _0x44f31d={};_0x44f31d[_0x585257['name']]={'$like':'%'+_0x427094['query'][_0x6c1b('0x4d')]+'%'};return _0x44f31d;}})});}_0xcfd9a2=_[_0x6c1b('0x4f')]({},_0xcfd9a2,_0x427094['options']);var _0x43775c={'where':_0xcfd9a2['where']};return db[_0x6c1b('0x3e')]['count'](_0x43775c)['then'](function(_0x5c9216){_0x2e966c[_0x6c1b('0x33')]=_0x5c9216;if(_0x427094['query'][_0x6c1b('0x50')]){_0xcfd9a2[_0x6c1b('0x51')]=[{'all':!![]}];}return db[_0x6c1b('0x3e')][_0x6c1b('0x52')](_0xcfd9a2);})['then'](function(_0x1aaeb8){_0x2e966c[_0x6c1b('0x53')]=_0x1aaeb8;return _0x2e966c;})['then'](respondWithFilteredResult(_0x10905e,_0xcfd9a2))[_0x6c1b('0x2c')](handleError(_0x10905e,null));};exports['show']=function(_0x2460f3,_0x149a86){var _0x56032a={'raw':!![],'where':{'id':_0x2460f3[_0x6c1b('0x54')]['id']}},_0x46a26a={};_0x46a26a[_0x6c1b('0x46')]=_[_0x6c1b('0x42')](db[_0x6c1b('0x3e')][_0x6c1b('0x55')]);_0x46a26a[_0x6c1b('0x41')]=_[_0x6c1b('0x42')](_0x2460f3[_0x6c1b('0x41')]);_0x46a26a[_0x6c1b('0x43')]=_['intersection'](_0x46a26a[_0x6c1b('0x46')],_0x46a26a[_0x6c1b('0x41')]);_0x56032a[_0x6c1b('0x45')]=_[_0x6c1b('0x44')](_0x46a26a[_0x6c1b('0x46')],qs['fields'](_0x2460f3['query'][_0x6c1b('0x47')]));_0x56032a[_0x6c1b('0x45')]=_0x56032a['attributes'][_0x6c1b('0x48')]?_0x56032a[_0x6c1b('0x45')]:_0x46a26a[_0x6c1b('0x46')];if(_0x2460f3[_0x6c1b('0x41')][_0x6c1b('0x50')]){_0x56032a['include']=[{'all':!![]}];}_0x56032a=_[_0x6c1b('0x4f')]({},_0x56032a,_0x2460f3[_0x6c1b('0x56')]);return db[_0x6c1b('0x3e')][_0x6c1b('0x57')](_0x56032a)[_0x6c1b('0x23')](handleEntityNotFound(_0x149a86,null))['then'](respondWithResult(_0x149a86,null))[_0x6c1b('0x2c')](handleError(_0x149a86,null));};exports[_0x6c1b('0x38')]=function(_0xca3c55,_0x2d3c33){if(_0xca3c55[_0x6c1b('0x58')]['id']){delete _0xca3c55['body']['id'];}return db[_0x6c1b('0x3e')][_0x6c1b('0x57')]({'where':{'id':_0xca3c55[_0x6c1b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2d3c33,null))[_0x6c1b('0x23')](saveUpdates(_0xca3c55[_0x6c1b('0x58')],null))['then'](respondWithResult(_0x2d3c33,null))[_0x6c1b('0x2c')](handleError(_0x2d3c33,null));};exports[_0x6c1b('0x39')]=function(_0x420aa2,_0x5ede03){return db[_0x6c1b('0x3e')][_0x6c1b('0x57')]({'where':{'id':_0x420aa2[_0x6c1b('0x54')]['id']}})[_0x6c1b('0x23')](handleEntityNotFound(_0x5ede03,null))[_0x6c1b('0x23')](removeEntity(_0x5ede03,null))['catch'](handleError(_0x5ede03,null));};exports['describe']=function(_0x659bc1,_0x369f59){return db[_0x6c1b('0x3e')]['describe']()[_0x6c1b('0x23')](respondWithResult(_0x369f59,null))[_0x6c1b('0x2c')](handleError(_0x369f59,null));};var interaction_log=require('../../config/logger')(_0x6c1b('0x59'));exports[_0x6c1b('0x5a')]=function(_0x90cfe7,_0x8684ba,_0x13014e){var _0x184f18={'agent':{},'channel':_0x6c1b('0x5b')};if(_0x90cfe7[_0x6c1b('0x58')]['id']){delete _0x90cfe7[_0x6c1b('0x58')]['id'];}_0x90cfe7[_0x6c1b('0x58')][_0x6c1b('0x5c')]=!![];_0x90cfe7[_0x6c1b('0x58')][_0x6c1b('0x5d')]=moment()[_0x6c1b('0x5e')](_0x6c1b('0x5f'));_0x90cfe7[_0x6c1b('0x58')][_0x6c1b('0x60')]=_0x90cfe7[_0x6c1b('0x58')]['UserId']||_0x90cfe7[_0x6c1b('0x61')]['id'];_0x184f18['agent']['id']=_0x90cfe7[_0x6c1b('0x58')][_0x6c1b('0x60')];return db['FaxMessage'][_0x6c1b('0x57')]({'where':{'id':_0x90cfe7[_0x6c1b('0x54')]['id'],'UserId':null}})[_0x6c1b('0x23')](handleEntityNotFound(_0x8684ba,null))[_0x6c1b('0x23')](saveUpdates(_0x90cfe7[_0x6c1b('0x58')],null))[_0x6c1b('0x23')](function(_0xc84a63){if(_0xc84a63){_0x184f18[_0x6c1b('0x2a')]=_0xc84a63[_0x6c1b('0x62')]({'plain':!![]});return db[_0x6c1b('0x63')][_0x6c1b('0x57')]({'where':{'id':_0xc84a63['FaxInteractionId']}});}return null;})[_0x6c1b('0x23')](handleEntityNotFound(_0x8684ba,null))['then'](function(_0x15e191){if(_0x15e191){return _0x15e191[_0x6c1b('0x38')]({'UserId':_0x90cfe7['body'][_0x6c1b('0x60')],'read1stAt':_[_0x6c1b('0x64')](_0x15e191['read1stAt'])?moment()[_0x6c1b('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1e388a){if(_0x1e388a){_0x184f18[_0x6c1b('0x65')]=_0x1e388a[_0x6c1b('0x62')]({'plain':!![]});interaction_log[_0x6c1b('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x90cfe7[_0x6c1b('0x61')]['id'],_0x90cfe7[_0x6c1b('0x61')][_0x6c1b('0x3b')],_0x90cfe7[_0x6c1b('0x61')][_0x6c1b('0x66')],_0x184f18['interaction']['id'],_0x90cfe7['body']?JSON[_0x6c1b('0x27')](_0x90cfe7[_0x6c1b('0x58')]):_0x6c1b('0x67'));return respondWithRpcPromise(_0x6c1b('0x68'),_0x6c1b('0x69'),_0x184f18);}return null;})[_0x6c1b('0x23')](function(_0x142322){var _0x7e4fe6=_0x6c1b('0x6a')+_0x142322[_0x6c1b('0x2a')][_0x6c1b('0x6b')];return db[_0x6c1b('0x6c')][_0x6c1b('0x41')](_0x7e4fe6,{'type':db[_0x6c1b('0x6d')][_0x6c1b('0x6e')][_0x6c1b('0x6f')],'raw':!![]})[_0x6c1b('0x23')](function(_0x4834fa){return _0x4834fa;});})[_0x6c1b('0x23')](function(_0x59404f){if(_0x59404f){_0x184f18[_0x6c1b('0x2a')][_0x6c1b('0x70')]=_0x59404f[0x0];if(!_0x90cfe7[_0x6c1b('0x58')][_0x6c1b('0x60')])return;return db[_0x6c1b('0x71')][_0x6c1b('0x57')]({'where':{'id':_0x90cfe7[_0x6c1b('0x58')]['UserId'],'role':_0x6c1b('0x72')},'attributes':['id','name',_0x6c1b('0x73'),_0x6c1b('0x74'),_0x6c1b('0x75')],'raw':!![]});}return null;})[_0x6c1b('0x23')](function(_0x2c8fcb){if(!_0x2c8fcb)return null;_0x184f18[_0x6c1b('0x2a')][_0x6c1b('0x72')]=_0x2c8fcb;return _0x184f18;})[_0x6c1b('0x23')](function(_0xa4c18f){if(_0xa4c18f){if(_0x90cfe7[_0x6c1b('0x58')]['manual']){_0x184f18['message'][_0x6c1b('0x76')]=util['format'](_0x6c1b('0x77'),_0x90cfe7['user'][_0x6c1b('0x3b')]);_0x184f18[_0x6c1b('0x2a')][_0x6c1b('0x78')]=_0x184f18[_0x6c1b('0x78')];_0x184f18[_0x6c1b('0x2a')][_0x6c1b('0x79')]=_0x184f18[_0x6c1b('0x78')];_0x184f18[_0x6c1b('0x2a')][_0x6c1b('0x7a')]=_0x6c1b('0x5a');return respondWithRpcPromise(_0x6c1b('0x7b'),_0x6c1b('0x7b'),{'event':'acceptmessage','message':_0x184f18[_0x6c1b('0x2a')]},client9002)['then'](function(){return _0x184f18;});}return _0x184f18;}return null;})['then'](respondWithResult(_0x8684ba,null))['catch'](handleError(_0x8684ba,null));};var interaction_log=require(_0x6c1b('0x15'))(_0x6c1b('0x59'));exports['reject']=function(_0x526a4a,_0x1eeaa2,_0x3090ab){var _0x46d196={'agent':{},'channel':_0x6c1b('0x5b')};if(_0x526a4a['body']['id']){delete _0x526a4a['body']['id'];}_0x526a4a[_0x6c1b('0x58')][_0x6c1b('0x60')]=_0x526a4a['body'][_0x6c1b('0x60')]||_0x526a4a[_0x6c1b('0x61')]['id'];_0x46d196[_0x6c1b('0x72')]['id']=_0x526a4a['body'][_0x6c1b('0x60')];return db[_0x6c1b('0x3e')][_0x6c1b('0x57')]({'where':{'id':_0x526a4a['params']['id'],'UserId':null}})[_0x6c1b('0x23')](handleEntityNotFound(_0x1eeaa2,null))['then'](function(_0x5ba119){if(_0x5ba119){_0x46d196[_0x6c1b('0x2a')]=_0x5ba119[_0x6c1b('0x62')]({'plain':!![]});return db[_0x6c1b('0x63')][_0x6c1b('0x57')]({'where':{'id':_0x5ba119[_0x6c1b('0x7c')]}});}return null;})[_0x6c1b('0x23')](handleEntityNotFound(_0x1eeaa2,null))[_0x6c1b('0x23')](function(_0x314adb){if(_0x314adb){_0x46d196[_0x6c1b('0x65')]=_0x314adb[_0x6c1b('0x62')]({'plain':!![]});interaction_log[_0x6c1b('0x24')](_0x6c1b('0x7d'),_0x526a4a[_0x6c1b('0x61')]['id'],_0x526a4a['user'][_0x6c1b('0x3b')],_0x526a4a['user'][_0x6c1b('0x66')],_0x46d196[_0x6c1b('0x65')]['id'],_0x526a4a[_0x6c1b('0x58')]?JSON[_0x6c1b('0x27')](_0x526a4a[_0x6c1b('0x58')]):'null');return respondWithRpcPromise(_0x6c1b('0x7e'),_0x6c1b('0x7f'),_0x46d196);}return null;})[_0x6c1b('0x23')](function(_0xeb7bfd){var _0x161bd6=_0x6c1b('0x6a')+_0xeb7bfd['message'][_0x6c1b('0x6b')];return db[_0x6c1b('0x6c')]['query'](_0x161bd6,{'type':db[_0x6c1b('0x6d')][_0x6c1b('0x6e')][_0x6c1b('0x6f')],'raw':!![]})[_0x6c1b('0x23')](function(_0x1a6c35){return _0x1a6c35;});})[_0x6c1b('0x23')](function(_0xa9ed5b){if(_0xa9ed5b){_0x46d196[_0x6c1b('0x2a')][_0x6c1b('0x70')]=_0xa9ed5b[0x0];if(!_0x526a4a[_0x6c1b('0x58')]['UserId'])return;return db[_0x6c1b('0x71')][_0x6c1b('0x57')]({'where':{'id':_0x526a4a['body'][_0x6c1b('0x60')],'role':_0x6c1b('0x72')},'attributes':['id',_0x6c1b('0x3b'),_0x6c1b('0x73'),_0x6c1b('0x74'),_0x6c1b('0x75')],'raw':!![]});}return null;})[_0x6c1b('0x23')](function(_0x21b1f2){if(!_0x21b1f2)return null;_0x46d196[_0x6c1b('0x2a')][_0x6c1b('0x72')]=_0x21b1f2;return _0x46d196;})[_0x6c1b('0x23')](function(_0x18ecab){if(_0x18ecab){_0x18ecab[_0x6c1b('0x2a')][_0x6c1b('0x76')]=util[_0x6c1b('0x5e')]('SIP/%s',_0x526a4a[_0x6c1b('0x61')][_0x6c1b('0x3b')]);_0x18ecab[_0x6c1b('0x2a')][_0x6c1b('0x78')]=_0x46d196[_0x6c1b('0x78')];_0x18ecab['message'][_0x6c1b('0x79')]=_0x46d196[_0x6c1b('0x78')];_0x18ecab[_0x6c1b('0x2a')]['event']=_0x6c1b('0x36');respondWithRpcPromise(_0x6c1b('0x7b'),_0x6c1b('0x7b'),{'event':_0x6c1b('0x80'),'message':_0x18ecab[_0x6c1b('0x2a')]},client9002);return _0x46d196;}return null;})[_0x6c1b('0x23')](respondWithResult(_0x1eeaa2,null))[_0x6c1b('0x2c')](handleError(_0x1eeaa2,null));};exports['create']=function(_0x152602,_0x59bde1){var _0x37169c;return db[_0x6c1b('0x3e')][_0x6c1b('0x81')](_0x152602['body'],{})[_0x6c1b('0x23')](function(_0x48fa25){_0x37169c=_0x48fa25;return db[_0x6c1b('0x82')]['findOne']({'where':{'id':_0x37169c['ContactId']}});})['then'](function(_0x4e531f){if(_['isNil'](_0x4e531f)){return;}else{_0x37169c[_0x6c1b('0x5b')]=_0x4e531f[_0x6c1b('0x5b')];return db['Attachment'][_0x6c1b('0x83')]({'where':{'id':_0x37169c[_0x6c1b('0x84')]}});}})[_0x6c1b('0x23')](function(_0x357d42){return respondWithRpcPromise('SendFax',_0x6c1b('0x85'),{'FaxAccountId':_[_0x6c1b('0x64')](_0x152602[_0x6c1b('0x58')])?undefined:_0x152602[_0x6c1b('0x58')][_0x6c1b('0x86')],'path':_['isNil'](_0x357d42)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x357d42['basename']),'fax':_[_0x6c1b('0x64')](_0x37169c[_0x6c1b('0x5b')])?undefined:_0x37169c[_0x6c1b('0x5b')],'AttachmentId':_0x37169c[_0x6c1b('0x84')]},client9002);})[_0x6c1b('0x23')](respondWithResult(_0x59bde1,0xc9))[_0x6c1b('0x2c')](handleError(_0x59bde1,null));};exports['download']=function(_0x55797d,_0x4b8063){var _0x287bc6=path[_0x6c1b('0x87')](config[_0x6c1b('0x88')],_0x6c1b('0x89'),_0x6c1b('0x8a'),_0x6c1b('0x8b'));return db[_0x6c1b('0x3e')][_0x6c1b('0x57')]({'where':{'id':_0x55797d[_0x6c1b('0x54')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x6c1b('0x23')](handleEntityNotFound(_0x4b8063,null))[_0x6c1b('0x23')](function(_0x4bb724){if(_0x4bb724){return _0x4b8063[_0x6c1b('0x8c')](path[_0x6c1b('0x87')](_0x287bc6,_0x4bb724[_0x6c1b('0x8d')]['basename']));}})[_0x6c1b('0x2c')](handleError(_0x4b8063,null));}; \ No newline at end of file +var _0xf6ea=['Content-Range','reject','save','update','then','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','SELECT','contact','User','fullname','email','internal','manual','channel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SIP/%s','motionChannel','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','files','Attachment','basename','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf6ea,0x17b));var _0xaf6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf6ea[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaf6e('0x0'));var rimraf=require(_0xaf6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaf6e('0x2'));var moment=require('moment');var BPromise=require(_0xaf6e('0x3'));var Mustache=require(_0xaf6e('0x4'));var util=require(_0xaf6e('0x5'));var path=require('path');var sox=require(_0xaf6e('0x6'));var csv=require(_0xaf6e('0x7'));var ejs=require(_0xaf6e('0x8'));var fs=require('fs');var fs_extra=require(_0xaf6e('0x9'));var _=require('lodash');var squel=require(_0xaf6e('0xa'));var crypto=require(_0xaf6e('0xb'));var jsforce=require(_0xaf6e('0xc'));var deskjs=require(_0xaf6e('0xd'));var toCsv=require(_0xaf6e('0x7'));var querystring=require(_0xaf6e('0xe'));var Papa=require(_0xaf6e('0xf'));var Redis=require(_0xaf6e('0x10'));var authService=require(_0xaf6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf6e('0x12'));var hardwareService=require(_0xaf6e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf6e('0x14'));var config=require(_0xaf6e('0x15'));var licenseUtil=require(_0xaf6e('0x16'));var db=require(_0xaf6e('0x17'))['db'];config[_0xaf6e('0x18')]=_[_0xaf6e('0x19')](config[_0xaf6e('0x18')],{'host':_0xaf6e('0x1a'),'port':0x18eb});var socket=require(_0xaf6e('0x1b'))(new Redis(config[_0xaf6e('0x18')]));require(_0xaf6e('0x1c'))['register'](socket);var jayson=require(_0xaf6e('0x1d'));var client=jayson[_0xaf6e('0x1e')][_0xaf6e('0x1f')]({'port':0x232c});var client9002=jayson[_0xaf6e('0x1e')][_0xaf6e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2f9ecc,_0x1d9b4e,_0x4af280,_0x3f3897){return new BPromise(function(_0x122848,_0x33f1ee){var _0xf96efc=_0x3f3897||client;return _0xf96efc[_0xaf6e('0x20')](_0x2f9ecc,_0x4af280)['then'](function(_0x568334){logger['info'](_0xaf6e('0x21'),_0x1d9b4e,_0xaf6e('0x22'));logger[_0xaf6e('0x23')](_0xaf6e('0x24'),_0x1d9b4e,_0xaf6e('0x22'),JSON[_0xaf6e('0x25')](_0x568334));if(_0x568334[_0xaf6e('0x26')]){if(_0x568334['error'][_0xaf6e('0x27')]===0x1f4){logger['error'](_0xaf6e('0x21'),_0x1d9b4e,_0x568334[_0xaf6e('0x26')][_0xaf6e('0x28')]);return _0x33f1ee(_0x568334['error']['message']);}logger[_0xaf6e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x1d9b4e,_0x568334[_0xaf6e('0x26')][_0xaf6e('0x28')]);return _0x122848(_0x568334[_0xaf6e('0x26')][_0xaf6e('0x28')]);}else{logger[_0xaf6e('0x29')](_0xaf6e('0x21'),_0x1d9b4e,'request\x20sent');_0x122848(_0x568334[_0xaf6e('0x2a')][_0xaf6e('0x28')]);}})[_0xaf6e('0x2b')](function(_0x184a4a){logger[_0xaf6e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x1d9b4e,_0x184a4a);_0x33f1ee(_0x184a4a);});});}function respondWithStatusCode(_0x102f7f,_0x2efeb5){_0x2efeb5=_0x2efeb5||0xcc;return function(_0x42e111){if(_0x42e111){return _0x102f7f[_0xaf6e('0x2c')](_0x2efeb5);}return _0x102f7f['status'](_0x2efeb5)[_0xaf6e('0x2d')]();};}function respondWithResult(_0x1e72b0,_0x3240a7){_0x3240a7=_0x3240a7||0xc8;return function(_0x1dc7bb){if(_0x1dc7bb){return _0x1e72b0[_0xaf6e('0x2e')](_0x3240a7)[_0xaf6e('0x2f')](_0x1dc7bb);}};}function respondWithFilteredResult(_0x53a949,_0x551215){return function(_0x271d5a){if(_0x271d5a){var _0x32ade1=typeof _0x551215[_0xaf6e('0x30')]===_0xaf6e('0x31')&&typeof _0x551215[_0xaf6e('0x32')]==='undefined';var _0x3c0279=_0x271d5a[_0xaf6e('0x33')];var _0x14b5aa=_0x32ade1?0x0:_0x551215[_0xaf6e('0x30')];var _0xb30d17=_0x32ade1?_0x271d5a['count']:_0x551215['offset']+_0x551215['limit'];var _0x5bc89e;if(_0xb30d17>=_0x3c0279){_0xb30d17=_0x3c0279;_0x5bc89e=0xc8;}else{_0x5bc89e=0xce;}_0x53a949[_0xaf6e('0x2e')](_0x5bc89e);return _0x53a949[_0xaf6e('0x34')](_0xaf6e('0x35'),_0x14b5aa+'-'+_0xb30d17+'/'+_0x3c0279)[_0xaf6e('0x2f')](_0x271d5a);}return null;};}function patchUpdates(_0x109fe1){return function(_0x4a949b){try{jsonpatch['apply'](_0x4a949b,_0x109fe1,!![]);}catch(_0x46b620){return BPromise[_0xaf6e('0x36')](_0x46b620);}return _0x4a949b[_0xaf6e('0x37')]();};}function saveUpdates(_0x3ab636,_0xc65fa9){return function(_0x56ce20){if(_0x56ce20){return _0x56ce20[_0xaf6e('0x38')](_0x3ab636)[_0xaf6e('0x39')](function(_0x2064a3){return _0x2064a3;});}return null;};}function removeEntity(_0x38d648,_0x3790c1){return function(_0x10b920){if(_0x10b920){return _0x10b920['destroy']()[_0xaf6e('0x39')](function(){_0x38d648[_0xaf6e('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0007,_0x283fb9){return function(_0x312c64){if(!_0x312c64){_0x4b0007[_0xaf6e('0x2c')](0x194);}return _0x312c64;};}function handleError(_0x30f5ef,_0x2e94eb){_0x2e94eb=_0x2e94eb||0x1f4;return function(_0x3f887a){logger[_0xaf6e('0x26')](_0x3f887a[_0xaf6e('0x3a')]);if(_0x3f887a[_0xaf6e('0x3b')]){delete _0x3f887a[_0xaf6e('0x3b')];}_0x30f5ef[_0xaf6e('0x2e')](_0x2e94eb)[_0xaf6e('0x3c')](_0x3f887a);};}exports[_0xaf6e('0x3d')]=function(_0xb957e4,_0x32c310){var _0x401120={},_0x3da4ba={},_0x2c2947={'count':0x0,'rows':[]};var _0x540a13=_[_0xaf6e('0x3e')](db[_0xaf6e('0x3f')][_0xaf6e('0x40')],function(_0x1e4a80){return{'name':_0x1e4a80[_0xaf6e('0x41')],'type':_0x1e4a80[_0xaf6e('0x42')][_0xaf6e('0x43')]};});_0x3da4ba[_0xaf6e('0x44')]=_[_0xaf6e('0x3e')](_0x540a13,'name');_0x3da4ba[_0xaf6e('0x45')]=_[_0xaf6e('0x46')](_0xb957e4['query']);_0x3da4ba[_0xaf6e('0x47')]=_['intersection'](_0x3da4ba[_0xaf6e('0x44')],_0x3da4ba['query']);_0x401120[_0xaf6e('0x48')]=_[_0xaf6e('0x49')](_0x3da4ba[_0xaf6e('0x44')],qs[_0xaf6e('0x4a')](_0xb957e4['query'][_0xaf6e('0x4a')]));_0x401120[_0xaf6e('0x48')]=_0x401120[_0xaf6e('0x48')][_0xaf6e('0x4b')]?_0x401120[_0xaf6e('0x48')]:_0x3da4ba[_0xaf6e('0x44')];if(!_0xb957e4[_0xaf6e('0x45')]['hasOwnProperty'](_0xaf6e('0x4c'))){_0x401120[_0xaf6e('0x32')]=qs['limit'](_0xb957e4['query']['limit']);_0x401120['offset']=qs[_0xaf6e('0x30')](_0xb957e4[_0xaf6e('0x45')][_0xaf6e('0x30')]);}_0x401120[_0xaf6e('0x4d')]=qs[_0xaf6e('0x4e')](_0xb957e4[_0xaf6e('0x45')][_0xaf6e('0x4e')]);_0x401120[_0xaf6e('0x4f')]=qs[_0xaf6e('0x47')](_['pick'](_0xb957e4['query'],_0x3da4ba[_0xaf6e('0x47')]),_0x540a13);if(_0xb957e4[_0xaf6e('0x45')][_0xaf6e('0x50')]){_0x401120['where']=_[_0xaf6e('0x51')](_0x401120[_0xaf6e('0x4f')],{'$or':_[_0xaf6e('0x3e')](_0x540a13,function(_0x4cbbf0){if(_0x4cbbf0[_0xaf6e('0x42')]!==_0xaf6e('0x52')){var _0x3c0d93={};_0x3c0d93[_0x4cbbf0[_0xaf6e('0x3b')]]={'$like':'%'+_0xb957e4['query'][_0xaf6e('0x50')]+'%'};return _0x3c0d93;}})});}_0x401120=_[_0xaf6e('0x51')]({},_0x401120,_0xb957e4[_0xaf6e('0x53')]);var _0x5e7c2e={'where':_0x401120[_0xaf6e('0x4f')]};return db[_0xaf6e('0x3f')][_0xaf6e('0x33')](_0x5e7c2e)[_0xaf6e('0x39')](function(_0x50b001){_0x2c2947[_0xaf6e('0x33')]=_0x50b001;if(_0xb957e4[_0xaf6e('0x45')]['includeAll']){_0x401120[_0xaf6e('0x54')]=[{'all':!![]}];}return db[_0xaf6e('0x3f')][_0xaf6e('0x55')](_0x401120);})['then'](function(_0x21c8d3){_0x2c2947[_0xaf6e('0x56')]=_0x21c8d3;return _0x2c2947;})[_0xaf6e('0x39')](respondWithFilteredResult(_0x32c310,_0x401120))[_0xaf6e('0x2b')](handleError(_0x32c310,null));};exports['show']=function(_0x3588db,_0x48e51e){var _0x34a509={'raw':!![],'where':{'id':_0x3588db[_0xaf6e('0x57')]['id']}},_0x50a283={};_0x50a283[_0xaf6e('0x44')]=_[_0xaf6e('0x46')](db['FaxMessage'][_0xaf6e('0x40')]);_0x50a283['query']=_[_0xaf6e('0x46')](_0x3588db['query']);_0x50a283[_0xaf6e('0x47')]=_[_0xaf6e('0x49')](_0x50a283[_0xaf6e('0x44')],_0x50a283[_0xaf6e('0x45')]);_0x34a509[_0xaf6e('0x48')]=_['intersection'](_0x50a283[_0xaf6e('0x44')],qs[_0xaf6e('0x4a')](_0x3588db[_0xaf6e('0x45')][_0xaf6e('0x4a')]));_0x34a509[_0xaf6e('0x48')]=_0x34a509[_0xaf6e('0x48')]['length']?_0x34a509[_0xaf6e('0x48')]:_0x50a283[_0xaf6e('0x44')];if(_0x3588db[_0xaf6e('0x45')][_0xaf6e('0x58')]){_0x34a509['include']=[{'all':!![]}];}_0x34a509=_['merge']({},_0x34a509,_0x3588db['options']);return db['FaxMessage'][_0xaf6e('0x59')](_0x34a509)[_0xaf6e('0x39')](handleEntityNotFound(_0x48e51e,null))[_0xaf6e('0x39')](respondWithResult(_0x48e51e,null))['catch'](handleError(_0x48e51e,null));};exports[_0xaf6e('0x38')]=function(_0x52289a,_0x1165fc){if(_0x52289a[_0xaf6e('0x5a')]['id']){delete _0x52289a[_0xaf6e('0x5a')]['id'];}return db[_0xaf6e('0x3f')]['find']({'where':{'id':_0x52289a[_0xaf6e('0x57')]['id']}})[_0xaf6e('0x39')](handleEntityNotFound(_0x1165fc,null))['then'](saveUpdates(_0x52289a['body'],null))[_0xaf6e('0x39')](respondWithResult(_0x1165fc,null))['catch'](handleError(_0x1165fc,null));};exports['destroy']=function(_0x3ef377,_0x4f824e){return db[_0xaf6e('0x3f')][_0xaf6e('0x59')]({'where':{'id':_0x3ef377[_0xaf6e('0x57')]['id']}})[_0xaf6e('0x39')](handleEntityNotFound(_0x4f824e,null))[_0xaf6e('0x39')](removeEntity(_0x4f824e,null))[_0xaf6e('0x2b')](handleError(_0x4f824e,null));};exports[_0xaf6e('0x5b')]=function(_0x9ce124,_0x280824){return db['FaxMessage'][_0xaf6e('0x5b')]()[_0xaf6e('0x39')](respondWithResult(_0x280824,null))[_0xaf6e('0x2b')](handleError(_0x280824,null));};var interaction_log=require(_0xaf6e('0x5c'))(_0xaf6e('0x5d'));exports[_0xaf6e('0x5e')]=function(_0x5af0ba,_0x4f992f,_0x3a6fea){var _0x4b6e0c={'agent':{},'channel':_0xaf6e('0x5f')};if(_0x5af0ba[_0xaf6e('0x5a')]['id']){delete _0x5af0ba[_0xaf6e('0x5a')]['id'];}_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x60')]=!![];_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x61')]=moment()[_0xaf6e('0x62')](_0xaf6e('0x63'));_0x5af0ba[_0xaf6e('0x5a')]['UserId']=_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x64')]||_0x5af0ba['user']['id'];_0x4b6e0c[_0xaf6e('0x65')]['id']=_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x64')];return db[_0xaf6e('0x3f')]['find']({'where':{'id':_0x5af0ba[_0xaf6e('0x57')]['id'],'UserId':null}})[_0xaf6e('0x39')](handleEntityNotFound(_0x4f992f,null))[_0xaf6e('0x39')](saveUpdates(_0x5af0ba[_0xaf6e('0x5a')],null))['then'](function(_0x1ab1fb){if(_0x1ab1fb){_0x4b6e0c['message']=_0x1ab1fb[_0xaf6e('0x66')]({'plain':!![]});return db['FaxInteraction'][_0xaf6e('0x59')]({'where':{'id':_0x1ab1fb['FaxInteractionId']}});}return null;})[_0xaf6e('0x39')](handleEntityNotFound(_0x4f992f,null))[_0xaf6e('0x39')](function(_0x30d043){if(_0x30d043){return _0x30d043['update']({'UserId':_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x64')],'read1stAt':_[_0xaf6e('0x67')](_0x30d043['read1stAt'])?moment()[_0xaf6e('0x62')](_0xaf6e('0x63')):undefined});}return null;})['then'](function(_0x3d4950){if(_0x3d4950){_0x4b6e0c[_0xaf6e('0x68')]=_0x3d4950[_0xaf6e('0x66')]({'plain':!![]});interaction_log[_0xaf6e('0x29')](_0xaf6e('0x69'),_0x5af0ba['user']['id'],_0x5af0ba[_0xaf6e('0x6a')][_0xaf6e('0x3b')],_0x5af0ba[_0xaf6e('0x6a')][_0xaf6e('0x6b')],_0x4b6e0c[_0xaf6e('0x68')]['id'],_0x5af0ba[_0xaf6e('0x5a')]?JSON[_0xaf6e('0x25')](_0x5af0ba[_0xaf6e('0x5a')]):_0xaf6e('0x6c'));return respondWithRpcPromise(_0xaf6e('0x6d'),_0xaf6e('0x6e'),_0x4b6e0c);}return null;})['then'](function(_0x10b623){var _0x253f65='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x10b623['message'][_0xaf6e('0x6f')];return db['sequelize'][_0xaf6e('0x45')](_0x253f65,{'type':db['Sequelize']['QueryTypes'][_0xaf6e('0x70')],'raw':!![]})[_0xaf6e('0x39')](function(_0x5d2fde){return _0x5d2fde;});})['then'](function(_0x57d27f){if(_0x57d27f){_0x4b6e0c[_0xaf6e('0x28')][_0xaf6e('0x71')]=_0x57d27f[0x0];if(!_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x64')])return;return db[_0xaf6e('0x72')][_0xaf6e('0x59')]({'where':{'id':_0x5af0ba[_0xaf6e('0x5a')]['UserId'],'role':_0xaf6e('0x65')},'attributes':['id',_0xaf6e('0x3b'),_0xaf6e('0x73'),_0xaf6e('0x74'),_0xaf6e('0x75')],'raw':!![]});}return null;})['then'](function(_0x269c39){if(!_0x269c39)return null;_0x4b6e0c[_0xaf6e('0x28')][_0xaf6e('0x65')]=_0x269c39;return _0x4b6e0c;})[_0xaf6e('0x39')](function(_0xf8face){if(_0xf8face){if(_0x5af0ba[_0xaf6e('0x5a')][_0xaf6e('0x76')]){_0x4b6e0c[_0xaf6e('0x28')]['interface']=util[_0xaf6e('0x62')]('SIP/%s',_0x5af0ba[_0xaf6e('0x6a')][_0xaf6e('0x3b')]);_0x4b6e0c['message'][_0xaf6e('0x77')]=_0x4b6e0c['channel'];_0x4b6e0c[_0xaf6e('0x28')]['motionChannel']=_0x4b6e0c[_0xaf6e('0x77')];_0x4b6e0c[_0xaf6e('0x28')][_0xaf6e('0x78')]=_0xaf6e('0x5e');return respondWithRpcPromise(_0xaf6e('0x79'),_0xaf6e('0x79'),{'event':_0xaf6e('0x7a'),'message':_0x4b6e0c[_0xaf6e('0x28')]},client9002)[_0xaf6e('0x39')](function(){return _0x4b6e0c;});}return _0x4b6e0c;}return null;})[_0xaf6e('0x39')](respondWithResult(_0x4f992f,null))['catch'](handleError(_0x4f992f,null));};var interaction_log=require(_0xaf6e('0x5c'))(_0xaf6e('0x5d'));exports[_0xaf6e('0x36')]=function(_0x2d90c3,_0x213b26,_0x579539){var _0x1f1dee={'agent':{},'channel':'fax'};if(_0x2d90c3[_0xaf6e('0x5a')]['id']){delete _0x2d90c3[_0xaf6e('0x5a')]['id'];}_0x2d90c3[_0xaf6e('0x5a')][_0xaf6e('0x64')]=_0x2d90c3[_0xaf6e('0x5a')][_0xaf6e('0x64')]||_0x2d90c3[_0xaf6e('0x6a')]['id'];_0x1f1dee[_0xaf6e('0x65')]['id']=_0x2d90c3['body'][_0xaf6e('0x64')];return db['FaxMessage'][_0xaf6e('0x59')]({'where':{'id':_0x2d90c3[_0xaf6e('0x57')]['id'],'UserId':null}})[_0xaf6e('0x39')](handleEntityNotFound(_0x213b26,null))['then'](function(_0x5152ca){if(_0x5152ca){_0x1f1dee[_0xaf6e('0x28')]=_0x5152ca[_0xaf6e('0x66')]({'plain':!![]});return db['FaxInteraction'][_0xaf6e('0x59')]({'where':{'id':_0x5152ca[_0xaf6e('0x7b')]}});}return null;})[_0xaf6e('0x39')](handleEntityNotFound(_0x213b26,null))[_0xaf6e('0x39')](function(_0x27727f){if(_0x27727f){_0x1f1dee['interaction']=_0x27727f['get']({'plain':!![]});interaction_log[_0xaf6e('0x29')](_0xaf6e('0x7c'),_0x2d90c3[_0xaf6e('0x6a')]['id'],_0x2d90c3['user'][_0xaf6e('0x3b')],_0x2d90c3[_0xaf6e('0x6a')][_0xaf6e('0x6b')],_0x1f1dee[_0xaf6e('0x68')]['id'],_0x2d90c3['body']?JSON[_0xaf6e('0x25')](_0x2d90c3['body']):_0xaf6e('0x6c'));return respondWithRpcPromise(_0xaf6e('0x7d'),'rejectMessage',_0x1f1dee);}return null;})[_0xaf6e('0x39')](function(_0xf77eef){var _0x121acc=_0xaf6e('0x7e')+_0xf77eef[_0xaf6e('0x28')]['ContactId'];return db['sequelize'][_0xaf6e('0x45')](_0x121acc,{'type':db[_0xaf6e('0x7f')][_0xaf6e('0x80')][_0xaf6e('0x70')],'raw':!![]})[_0xaf6e('0x39')](function(_0x53d0c8){return _0x53d0c8;});})['then'](function(_0x36b060){if(_0x36b060){_0x1f1dee[_0xaf6e('0x28')][_0xaf6e('0x71')]=_0x36b060[0x0];if(!_0x2d90c3[_0xaf6e('0x5a')][_0xaf6e('0x64')])return;return db[_0xaf6e('0x72')]['find']({'where':{'id':_0x2d90c3[_0xaf6e('0x5a')][_0xaf6e('0x64')],'role':_0xaf6e('0x65')},'attributes':['id','name',_0xaf6e('0x73'),_0xaf6e('0x74'),_0xaf6e('0x75')],'raw':!![]});}return null;})[_0xaf6e('0x39')](function(_0x3f91b3){if(!_0x3f91b3)return null;_0x1f1dee['message'][_0xaf6e('0x65')]=_0x3f91b3;return _0x1f1dee;})[_0xaf6e('0x39')](function(_0x2bba6c){if(_0x2bba6c){_0x2bba6c[_0xaf6e('0x28')]['interface']=util[_0xaf6e('0x62')](_0xaf6e('0x81'),_0x2d90c3[_0xaf6e('0x6a')][_0xaf6e('0x3b')]);_0x2bba6c[_0xaf6e('0x28')][_0xaf6e('0x77')]=_0x1f1dee[_0xaf6e('0x77')];_0x2bba6c[_0xaf6e('0x28')][_0xaf6e('0x82')]=_0x1f1dee[_0xaf6e('0x77')];_0x2bba6c[_0xaf6e('0x28')][_0xaf6e('0x78')]=_0xaf6e('0x36');respondWithRpcPromise(_0xaf6e('0x79'),_0xaf6e('0x79'),{'event':_0xaf6e('0x83'),'message':_0x2bba6c[_0xaf6e('0x28')]},client9002);return _0x1f1dee;}return null;})[_0xaf6e('0x39')](respondWithResult(_0x213b26,null))[_0xaf6e('0x2b')](handleError(_0x213b26,null));};exports[_0xaf6e('0x84')]=function(_0x2656b2,_0x4cf995){var _0x149fd9;return db[_0xaf6e('0x3f')][_0xaf6e('0x84')](_0x2656b2['body'],{})['then'](function(_0x2a64de){_0x149fd9=_0x2a64de;return db[_0xaf6e('0x85')][_0xaf6e('0x86')]({'where':{'id':_0x149fd9[_0xaf6e('0x6f')]}});})[_0xaf6e('0x39')](function(_0xd5ec0c){if(_['isNil'](_0xd5ec0c)){return;}else{_0x149fd9['fax']=_0xd5ec0c['fax'];return db['Attachment'][_0xaf6e('0x86')]({'where':{'id':_0x149fd9[_0xaf6e('0x87')]}});}})[_0xaf6e('0x39')](function(_0x50baf4){return respondWithRpcPromise(_0xaf6e('0x88'),_0xaf6e('0x88'),{'FaxAccountId':_['isNil'](_0x2656b2[_0xaf6e('0x5a')])?undefined:_0x2656b2[_0xaf6e('0x5a')]['FaxAccountId'],'path':_[_0xaf6e('0x67')](_0x50baf4)?undefined:util[_0xaf6e('0x62')](_0xaf6e('0x89'),_0x50baf4['basename']),'fax':_[_0xaf6e('0x67')](_0x149fd9['fax'])?undefined:_0x149fd9[_0xaf6e('0x5f')],'AttachmentId':_0x149fd9['AttachmentId']},client9002);})[_0xaf6e('0x39')](respondWithResult(_0x4cf995,0xc9))['catch'](handleError(_0x4cf995,null));};exports[_0xaf6e('0x8a')]=function(_0xf92921,_0x38712c){var _0x58057b=path[_0xaf6e('0x8b')](config[_0xaf6e('0x8c')],'server',_0xaf6e('0x8d'),'attachments');return db[_0xaf6e('0x3f')][_0xaf6e('0x59')]({'where':{'id':_0xf92921[_0xaf6e('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0xaf6e('0x8e')}]})[_0xaf6e('0x39')](handleEntityNotFound(_0x38712c,null))[_0xaf6e('0x39')](function(_0x548853){if(_0x548853){return _0x38712c[_0xaf6e('0x8a')](path['join'](_0x58057b,_0x548853[_0xaf6e('0x8e')][_0xaf6e('0x8f')]));}})[_0xaf6e('0x2b')](handleError(_0x38712c,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 2b461d8..6282028 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 _0x2525=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2575cd,_0x570e95){var _0x52c789=function(_0x5e50c6){while(--_0x5e50c6){_0x2575cd['push'](_0x2575cd['shift']());}};_0x52c789(++_0x570e95);}(_0x2525,0x1f0));var _0x5252=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2525[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x5252('0x0'));var FaxMessage=require(_0x5252('0x1'))['db'][_0x5252('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5252('0x3')](0x0);var events={'afterCreate':_0x5252('0x4'),'afterUpdate':_0x5252('0x5'),'afterDestroy':_0x5252('0x6')};function emitEvent(_0x1138af){return function(_0x28efdd,_0x4907eb,_0x4a73a2){FaxMessageEvents[_0x5252('0x7')](_0x1138af+':'+_0x28efdd['id'],_0x28efdd);FaxMessageEvents[_0x5252('0x7')](_0x1138af,_0x28efdd);_0x4a73a2(null);};}for(var e in events){if(events[_0x5252('0x8')](e)){var event=events[e];FaxMessage[_0x5252('0x9')](e,emitEvent(event));}}module[_0x5252('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x1267=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1267,0xb5));var _0x7126=function(_0x1981db,_0x1b6878){_0x1981db=_0x1981db-0x0;var _0x59c208=_0x1267[_0x1981db];return _0x59c208;};'use strict';var EventEmitter=require(_0x7126('0x0'));var FaxMessage=require(_0x7126('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7126('0x2'),'afterUpdate':_0x7126('0x3'),'afterDestroy':_0x7126('0x4')};function emitEvent(_0x3587d0){return function(_0x35f8e5,_0x403ed4,_0x4346f7){FaxMessageEvents['emit'](_0x3587d0+':'+_0x35f8e5['id'],_0x35f8e5);FaxMessageEvents[_0x7126('0x5')](_0x3587d0,_0x35f8e5);_0x4346f7(null);};}for(var e in events){if(events[_0x7126('0x6')](e)){var event=events[e];FaxMessage[_0x7126('0x7')](e,emitEvent(event));}}module[_0x7126('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 62ec230..fe76e3c 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 _0x33c2=['direction','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','FULLTEXT','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt'];(function(_0x4bfedd,_0xddfbf8){var _0x2e925c=function(_0x3937da){while(--_0x3937da){_0x4bfedd['push'](_0x4bfedd['shift']());}};_0x2e925c(++_0xddfbf8);}(_0x33c2,0x7f));var _0x233c=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0x33c2[_0x2f8a7c];return _0x257e01;};'use strict';var _=require(_0x233c('0x0'));var util=require(_0x233c('0x1'));var logger=require(_0x233c('0x2'))(_0x233c('0x3'));var moment=require(_0x233c('0x4'));var BPromise=require(_0x233c('0x5'));var rp=require(_0x233c('0x6'));var fs=require('fs');var path=require(_0x233c('0x7'));var rimraf=require(_0x233c('0x8'));var config=require(_0x233c('0x9'));var attributes=require(_0x233c('0xa'));module[_0x233c('0xb')]=function(_0x5167b4,_0xefdf3){return _0x5167b4[_0x233c('0xc')](_0x233c('0xd'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x233c('0xe'),'fields':['body'],'type':_0x233c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x255989,_0x24fe16,_0x52f9af){var _0x5885de=_0x5167b4['models'];var _0x35e35e=_0x255989['get']({'plain':!![]});if(_0x35e35e['direction']['toLowerCase']()==='in'||_0x35e35e['direction']['toLowerCase']()==='out'&&!_0x35e35e[_0x233c('0x10')]&&!_[_0x233c('0x11')](_0x35e35e[_0x233c('0x12')])){_0x5885de[_0x233c('0x13')][_0x233c('0x14')]({'where':{'id':_0x35e35e[_0x233c('0x15')]}})['then'](function(_0x27cce6){if(_0x27cce6){_0x27cce6['update']({'lastMsgAt':_0x35e35e[_0x233c('0x16')],'lastMsgDirection':_0x35e35e[_0x233c('0x17')]['toLowerCase']()});}})['catch'](function(_0x1979ed){console['error'](_0x1979ed);});}_0x52f9af();}},'charset':_0x233c('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf3cd=['secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','error','utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxMessage','fti_fax_messages','body','models'];(function(_0x19b407,_0x55ec50){var _0x29a4a5=function(_0x42752b){while(--_0x42752b){_0x19b407['push'](_0x19b407['shift']());}};_0x29a4a5(++_0x55ec50);}(_0xf3cd,0x17a));var _0xdf3c=function(_0x336df4,_0x52c1dc){_0x336df4=_0x336df4-0x0;var _0x580d8c=_0xf3cd[_0x336df4];return _0x580d8c;};'use strict';var _=require('lodash');var util=require(_0xdf3c('0x0'));var logger=require(_0xdf3c('0x1'))(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var BPromise=require(_0xdf3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x5'));var rimraf=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var attributes=require('./faxMessage.attributes');module[_0xdf3c('0x8')]=function(_0x27922f,_0x4ee1b2){return _0x27922f['define'](_0xdf3c('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xdf3c('0xa'),'fields':[_0xdf3c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e1f8e,_0x14681b,_0x2678f0){var _0x28b6f2=_0x27922f[_0xdf3c('0xc')];var _0x7a550=_0x3e1f8e['get']({'plain':!![]});if(_0x7a550['direction']['toLowerCase']()==='in'||_0x7a550['direction']['toLowerCase']()==='out'&&!_0x7a550[_0xdf3c('0xd')]&&!_[_0xdf3c('0xe')](_0x7a550[_0xdf3c('0xf')])){_0x28b6f2[_0xdf3c('0x10')][_0xdf3c('0x11')]({'where':{'id':_0x7a550[_0xdf3c('0x12')]}})[_0xdf3c('0x13')](function(_0x1da4aa){if(_0x1da4aa){_0x1da4aa[_0xdf3c('0x14')]({'lastMsgAt':_0x7a550['createdAt'],'lastMsgDirection':_0x7a550['direction']['toLowerCase']()});}})['catch'](function(_0x289b52){console[_0xdf3c('0x15')](_0x289b52);});}_0x2678f0();}},'charset':_0xdf3c('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 69e697f..83f0ded 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 _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7bae,0x13b));var _0xe7ba=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x7bae[_0x257642];return _0x3d813b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});}; \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3bc255,_0x5712b0){var _0x14e4fc=function(_0x1de689){while(--_0x1de689){_0x3bc255['push'](_0x3bc255['shift']());}};_0x14e4fc(++_0x5712b0);}(_0xd2ea,0x15f));var _0xad2e=function(_0x3bea88,_0x18b0be){_0x3bea88=_0x3bea88-0x0;var _0x1f2e8a=_0xd2ea[_0x3bea88];return _0x1f2e8a;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index a7fa6c9..1a779ec 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 _0x8f04=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x497d39,_0x168b9f){var _0x42d35=function(_0x396104){while(--_0x396104){_0x497d39['push'](_0x497d39['shift']());}};_0x42d35(++_0x168b9f);}(_0x8f04,0x75));var _0x48f0=function(_0x8db845,_0xb998ff){_0x8db845=_0x8db845-0x0;var _0x45546f=_0x8f04[_0x8db845];return _0x45546f;};'use strict';var FaxMessageEvents=require(_0x48f0('0x0'));var events=[_0x48f0('0x1'),_0x48f0('0x2'),'update'];function createListener(_0x29ed67,_0x22ea9b){return function(_0x3d5cfa){_0x22ea9b[_0x48f0('0x3')](_0x29ed67,_0x3d5cfa);};}function removeListener(_0x1c0151,_0x3afbef){return function(){FaxMessageEvents[_0x48f0('0x4')](_0x1c0151,_0x3afbef);};}exports[_0x48f0('0x5')]=function(_0x1318e3){for(var _0x27500c=0x0,_0x7c9054=events[_0x48f0('0x6')];_0x27500c<_0x7c9054;_0x27500c++){var _0xf18c3d=events[_0x27500c];var _0x14ed22=createListener(_0x48f0('0x7')+_0xf18c3d,_0x1318e3);FaxMessageEvents['on'](_0xf18c3d,_0x14ed22);}}; \ No newline at end of file +var _0xfeae=['register','length','faxMessage:','./faxMessage.events','remove','update','emit','removeListener'];(function(_0x7e247f,_0x469d63){var _0x344f84=function(_0x42604f){while(--_0x42604f){_0x7e247f['push'](_0x7e247f['shift']());}};_0x344f84(++_0x469d63);}(_0xfeae,0x13b));var _0xefea=function(_0x1bcef9,_0x2a6d24){_0x1bcef9=_0x1bcef9-0x0;var _0x24b8a1=_0xfeae[_0x1bcef9];return _0x24b8a1;};'use strict';var FaxMessageEvents=require(_0xefea('0x0'));var events=['save',_0xefea('0x1'),_0xefea('0x2')];function createListener(_0x58d311,_0x5226d3){return function(_0x102c70){_0x5226d3[_0xefea('0x3')](_0x58d311,_0x102c70);};}function removeListener(_0x360633,_0x3c37bc){return function(){FaxMessageEvents[_0xefea('0x4')](_0x360633,_0x3c37bc);};}exports[_0xefea('0x5')]=function(_0x514a7e){for(var _0x278889=0x0,_0xfeb6f3=events[_0xefea('0x6')];_0x278889<_0xfeb6f3;_0x278889++){var _0x1ab141=events[_0x278889];var _0x364d4f=createListener(_0xefea('0x7')+_0x1ab141,_0x514a7e);FaxMessageEvents['on'](_0x1ab141,_0x364d4f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 40c2a94..c5614c8 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 _0xeffd=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','put','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x129d61,_0xe631ae){var _0x48aa96=function(_0x5ec48b){while(--_0x5ec48b){_0x129d61['push'](_0x129d61['shift']());}};_0x48aa96(++_0xe631ae);}(_0xeffd,0x6b));var _0xdeff=function(_0x97c243,_0x24bb0e){_0x97c243=_0x97c243-0x0;var _0x4a2025=_0xeffd[_0x97c243];return _0x4a2025;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/download',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),interaction[_0xdeff('0x12')](_0xdeff('0x13'),_0xdeff('0x14')),controller[_0xdeff('0x15')]);router['put'](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller['update']);router[_0xdeff('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0xdeff('0x18')]);router[_0xdeff('0x17')](_0xdeff('0x19'),auth[_0xdeff('0xb')](),controller['reject']);router[_0xdeff('0x1a')](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller[_0xdeff('0x1b')]);module[_0xdeff('0x1c')]=router; \ No newline at end of file +var _0xf4eb=['/:id/accept','accept','/:id/reject','delete','exports','multer','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','tracked','faxmessage:create','create','put'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xf4eb,0xec));var _0xbf4e=function(_0x318d72,_0x6de0d2){_0x318d72=_0x318d72-0x0;var _0x5f846b=_0xf4eb[_0x318d72];return _0x5f846b;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xbf4e('0xc')]('fax',_0xbf4e('0xd')),controller[_0xbf4e('0xe')]);router['put'](_0xbf4e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);router[_0xbf4e('0xf')](_0xbf4e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xbf4e('0x13')](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index ac115ac..8ba5cb2 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 _0x1622=['exports','STRING','name','INTEGER','rrmemory'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0x1622,0x18b));var _0x2162=function(_0x30a78e,_0x2f4fa9){_0x30a78e=_0x30a78e-0x0;var _0x1079bb=_0x1622[_0x30a78e];return _0x1079bb;};'use strict';var Sequelize=require('sequelize');module[_0x2162('0x0')]={'name':{'type':Sequelize[_0x2162('0x1')],'unique':_0x2162('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2162('0x1')]},'timeout':{'type':Sequelize[_0x2162('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2162('0x4'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2162('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xafe6=['exports','STRING','name','ENUM','rrmemory','beepall','INTEGER','sequelize'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0xafe6,0xa7));var _0x6afe=function(_0x8bf8a6,_0x4e869d){_0x8bf8a6=_0x8bf8a6-0x0;var _0x59e910=_0xafe6[_0x8bf8a6];return _0x59e910;};'use strict';var Sequelize=require(_0x6afe('0x0'));module[_0x6afe('0x1')]={'name':{'type':Sequelize[_0x6afe('0x2')],'unique':_0x6afe('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6afe('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6afe('0x4')](_0x6afe('0x5'),_0x6afe('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6afe('0x7')],'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 1229110..e96707d 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 _0x2f41=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','catch','create','role','user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','findOne','UserFaxQueue','FaxQueueId','User','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x254bbe,_0x44612d){var _0x42aae4=function(_0x32e80e){while(--_0x32e80e){_0x254bbe['push'](_0x254bbe['shift']());}};_0x42aae4(++_0x44612d);}(_0x2f41,0x101));var _0x12f4=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0x2f41[_0x58efa6];return _0x5d643c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12f4('0x0'));var zipdir=require(_0x12f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12f4('0x2'));var moment=require(_0x12f4('0x3'));var BPromise=require(_0x12f4('0x4'));var Mustache=require(_0x12f4('0x5'));var util=require(_0x12f4('0x6'));var path=require('path');var sox=require(_0x12f4('0x7'));var csv=require(_0x12f4('0x8'));var ejs=require(_0x12f4('0x9'));var fs=require('fs');var fs_extra=require(_0x12f4('0xa'));var _=require(_0x12f4('0xb'));var squel=require('squel');var crypto=require(_0x12f4('0xc'));var jsforce=require(_0x12f4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x12f4('0x8'));var querystring=require(_0x12f4('0xe'));var Papa=require('papaparse');var Redis=require(_0x12f4('0xf'));var authService=require(_0x12f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x12f4('0x11'));var hardwareService=require(_0x12f4('0x12'));var logger=require('../../config/logger')(_0x12f4('0x13'));var utils=require('../../config/utils');var config=require(_0x12f4('0x14'));var licenseUtil=require(_0x12f4('0x15'));var db=require(_0x12f4('0x16'))['db'];config[_0x12f4('0x17')]=_[_0x12f4('0x18')](config['redis'],{'host':_0x12f4('0x19'),'port':0x18eb});var socket=require(_0x12f4('0x1a'))(new Redis(config[_0x12f4('0x17')]));require('./faxQueue.socket')[_0x12f4('0x1b')](socket);function respondWithStatusCode(_0x3435c2,_0x1e78d3){_0x1e78d3=_0x1e78d3||0xcc;return function(_0x37e517){if(_0x37e517){return _0x3435c2[_0x12f4('0x1c')](_0x1e78d3);}return _0x3435c2[_0x12f4('0x1d')](_0x1e78d3)[_0x12f4('0x1e')]();};}function respondWithResult(_0x1c4b1c,_0x2ac7b2){_0x2ac7b2=_0x2ac7b2||0xc8;return function(_0x35aab9){if(_0x35aab9){return _0x1c4b1c[_0x12f4('0x1d')](_0x2ac7b2)[_0x12f4('0x1f')](_0x35aab9);}};}function respondWithFilteredResult(_0x4e3792,_0x297c77){return function(_0x5285f1){if(_0x5285f1){var _0x3b0ad5=typeof _0x297c77[_0x12f4('0x20')]===_0x12f4('0x21')&&typeof _0x297c77[_0x12f4('0x22')]===_0x12f4('0x21');var _0x3700dc=_0x5285f1[_0x12f4('0x23')];var _0x57a0dd=_0x3b0ad5?0x0:_0x297c77[_0x12f4('0x20')];var _0x562ee2=_0x3b0ad5?_0x5285f1['count']:_0x297c77[_0x12f4('0x20')]+_0x297c77['limit'];var _0x244644;if(_0x562ee2>=_0x3700dc){_0x562ee2=_0x3700dc;_0x244644=0xc8;}else{_0x244644=0xce;}_0x4e3792[_0x12f4('0x1d')](_0x244644);return _0x4e3792['set'](_0x12f4('0x24'),_0x57a0dd+'-'+_0x562ee2+'/'+_0x3700dc)[_0x12f4('0x1f')](_0x5285f1);}return null;};}function patchUpdates(_0x29086d){return function(_0x102d30){try{jsonpatch[_0x12f4('0x25')](_0x102d30,_0x29086d,!![]);}catch(_0x472ef3){return BPromise[_0x12f4('0x26')](_0x472ef3);}return _0x102d30['save']();};}function saveUpdates(_0x1b4dcb,_0x3b7939){return function(_0x2ef2b5){if(_0x2ef2b5){return _0x2ef2b5[_0x12f4('0x27')](_0x1b4dcb)['then'](function(_0x22589e){return _0x22589e;});}return null;};}function removeEntity(_0x1b982b,_0x1eed5f){return function(_0x171073){if(_0x171073){return _0x171073[_0x12f4('0x28')]()[_0x12f4('0x29')](function(){var _0x2ad97c=_0x171073[_0x12f4('0x2a')]({'plain':!![]});var _0x1fe329='FaxQueues';return db[_0x12f4('0x2b')][_0x12f4('0x28')]({'where':{'type':_0x1fe329,'resourceId':_0x2ad97c['id']}})[_0x12f4('0x29')](function(){return _0x171073;});})[_0x12f4('0x29')](function(){_0x1b982b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e660a,_0x310f04){return function(_0x54f55b){if(!_0x54f55b){_0x1e660a[_0x12f4('0x1c')](0x194);}return _0x54f55b;};}function handleError(_0x18e8c5,_0x5898f3){_0x5898f3=_0x5898f3||0x1f4;return function(_0x5ee636){logger[_0x12f4('0x2c')](_0x5ee636[_0x12f4('0x2d')]);if(_0x5ee636[_0x12f4('0x2e')]){delete _0x5ee636[_0x12f4('0x2e')];}_0x18e8c5[_0x12f4('0x1d')](_0x5898f3)[_0x12f4('0x2f')](_0x5ee636);};}exports['index']=function(_0x2f5a6d,_0xd92d91){var _0x3ef58f={},_0x4979e3={},_0x1e91c3={'count':0x0,'rows':[]};var _0xd4ee50=_[_0x12f4('0x30')](db[_0x12f4('0x31')][_0x12f4('0x32')],function(_0x9b9f27){return{'name':_0x9b9f27[_0x12f4('0x33')],'type':_0x9b9f27[_0x12f4('0x34')][_0x12f4('0x35')]};});_0x4979e3[_0x12f4('0x36')]=_[_0x12f4('0x30')](_0xd4ee50,'name');_0x4979e3['query']=_[_0x12f4('0x37')](_0x2f5a6d[_0x12f4('0x38')]);_0x4979e3[_0x12f4('0x39')]=_['intersection'](_0x4979e3[_0x12f4('0x36')],_0x4979e3[_0x12f4('0x38')]);_0x3ef58f[_0x12f4('0x3a')]=_[_0x12f4('0x3b')](_0x4979e3[_0x12f4('0x36')],qs[_0x12f4('0x3c')](_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x3c')]));_0x3ef58f[_0x12f4('0x3a')]=_0x3ef58f[_0x12f4('0x3a')][_0x12f4('0x3d')]?_0x3ef58f[_0x12f4('0x3a')]:_0x4979e3['model'];if(!_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x3e')](_0x12f4('0x3f'))){_0x3ef58f[_0x12f4('0x22')]=qs['limit'](_0x2f5a6d['query'][_0x12f4('0x22')]);_0x3ef58f[_0x12f4('0x20')]=qs[_0x12f4('0x20')](_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x20')]);}_0x3ef58f[_0x12f4('0x40')]=qs['sort'](_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x41')]);_0x3ef58f[_0x12f4('0x42')]=qs['filters'](_[_0x12f4('0x43')](_0x2f5a6d[_0x12f4('0x38')],_0x4979e3['filters']),_0xd4ee50);if(_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x44')]){_0x3ef58f[_0x12f4('0x42')]=_['merge'](_0x3ef58f['where'],{'$or':_[_0x12f4('0x30')](_0xd4ee50,function(_0x5f301e){if(_0x5f301e[_0x12f4('0x34')]!=='VIRTUAL'){var _0x837f86={};_0x837f86[_0x5f301e[_0x12f4('0x2e')]]={'$like':'%'+_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x44')]+'%'};return _0x837f86;}})});}_0x3ef58f=_[_0x12f4('0x45')]({},_0x3ef58f,_0x2f5a6d[_0x12f4('0x46')]);var _0xc6668b={'where':_0x3ef58f[_0x12f4('0x42')]};return db[_0x12f4('0x31')][_0x12f4('0x23')](_0xc6668b)[_0x12f4('0x29')](function(_0x61629c){_0x1e91c3['count']=_0x61629c;if(_0x2f5a6d[_0x12f4('0x38')][_0x12f4('0x47')]){_0x3ef58f['include']=[{'all':!![]}];}return db[_0x12f4('0x31')][_0x12f4('0x48')](_0x3ef58f);})[_0x12f4('0x29')](function(_0xa0727){_0x1e91c3[_0x12f4('0x49')]=_0xa0727;return _0x1e91c3;})[_0x12f4('0x29')](respondWithFilteredResult(_0xd92d91,_0x3ef58f))['catch'](handleError(_0xd92d91,null));};exports[_0x12f4('0x4a')]=function(_0x4977e3,_0x41ebdf){var _0x1d8d66={'raw':!![],'where':{'id':_0x4977e3[_0x12f4('0x4b')]['id']}},_0x4e8d5d={};_0x4e8d5d[_0x12f4('0x36')]=_['keys'](db[_0x12f4('0x31')][_0x12f4('0x32')]);_0x4e8d5d[_0x12f4('0x38')]=_[_0x12f4('0x37')](_0x4977e3[_0x12f4('0x38')]);_0x4e8d5d[_0x12f4('0x39')]=_[_0x12f4('0x3b')](_0x4e8d5d['model'],_0x4e8d5d[_0x12f4('0x38')]);_0x1d8d66[_0x12f4('0x3a')]=_[_0x12f4('0x3b')](_0x4e8d5d[_0x12f4('0x36')],qs[_0x12f4('0x3c')](_0x4977e3[_0x12f4('0x38')]['fields']));_0x1d8d66[_0x12f4('0x3a')]=_0x1d8d66[_0x12f4('0x3a')][_0x12f4('0x3d')]?_0x1d8d66[_0x12f4('0x3a')]:_0x4e8d5d['model'];if(_0x4977e3[_0x12f4('0x38')]['includeAll']){_0x1d8d66[_0x12f4('0x4c')]=[{'all':!![]}];}_0x1d8d66=_['merge']({},_0x1d8d66,_0x4977e3[_0x12f4('0x46')]);return db[_0x12f4('0x31')]['find'](_0x1d8d66)[_0x12f4('0x29')](handleEntityNotFound(_0x41ebdf,null))[_0x12f4('0x29')](respondWithResult(_0x41ebdf,null))[_0x12f4('0x4d')](handleError(_0x41ebdf,null));};exports[_0x12f4('0x4e')]=function(_0xd07446,_0x461eab){return db[_0x12f4('0x31')][_0x12f4('0x4e')](_0xd07446['body'],{})[_0x12f4('0x29')](function(_0x55e010){var _0x2385a3=_0xd07446['user']['get']({'plain':!![]});if(!_0x2385a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2385a3[_0x12f4('0x4f')]===_0x12f4('0x50')){var _0xa80674=_0x55e010[_0x12f4('0x2a')]({'plain':!![]});var _0x2d33ab=_0x12f4('0x51');return db[_0x12f4('0x52')]['find']({'where':{'name':_0x2d33ab,'userProfileId':_0x2385a3[_0x12f4('0x53')]},'raw':!![]})[_0x12f4('0x29')](function(_0x58dc66){if(_0x58dc66&&_0x58dc66[_0x12f4('0x54')]===0x0){return db[_0x12f4('0x2b')][_0x12f4('0x4e')]({'name':_0xa80674['name'],'resourceId':_0xa80674['id'],'type':_0x58dc66[_0x12f4('0x2e')],'sectionId':_0x58dc66['id']},{})[_0x12f4('0x29')](function(){return _0x55e010;});}else{return _0x55e010;}})[_0x12f4('0x4d')](function(_0x25ccd2){logger[_0x12f4('0x2c')](_0x12f4('0x55'),_0x25ccd2);throw _0x25ccd2;});}return _0x55e010;})[_0x12f4('0x29')](respondWithResult(_0x461eab,0xc9))[_0x12f4('0x4d')](handleError(_0x461eab,null));};exports['update']=function(_0x18994b,_0x277b4a){if(_0x18994b[_0x12f4('0x56')]['id']){delete _0x18994b[_0x12f4('0x56')]['id'];}return db['FaxQueue'][_0x12f4('0x57')]({'where':{'id':_0x18994b[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x277b4a,null))['then'](saveUpdates(_0x18994b[_0x12f4('0x56')],null))[_0x12f4('0x29')](respondWithResult(_0x277b4a,null))[_0x12f4('0x4d')](handleError(_0x277b4a,null));};exports[_0x12f4('0x28')]=function(_0x312504,_0x29a1ba){return db['FaxQueue']['find']({'where':{'id':_0x312504['params']['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x29a1ba,null))[_0x12f4('0x29')](removeEntity(_0x29a1ba,null))[_0x12f4('0x4d')](handleError(_0x29a1ba,null));};exports[_0x12f4('0x58')]=function(_0x24ab31,_0x3533ee){return db[_0x12f4('0x31')][_0x12f4('0x58')]()[_0x12f4('0x29')](respondWithResult(_0x3533ee,null))[_0x12f4('0x4d')](handleError(_0x3533ee,null));};exports['getMembers']=function(_0x2777fc,_0x2abd08,_0x42564c){var _0x3e0d20={'raw':!![],'where':{}},_0x516b42={},_0x1ea188;return db[_0x12f4('0x31')][_0x12f4('0x59')]({'where':{'id':_0x2777fc[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x2abd08,null))['then'](function(_0x2a1872){if(_0x2a1872){_0x1ea188=_0x2a1872[_0x12f4('0x2a')]({'plain':!![]});_0x516b42[_0x12f4('0x36')]=_[_0x12f4('0x37')](db[_0x12f4('0x5a')][_0x12f4('0x32')]);_0x516b42['query']=_[_0x12f4('0x37')](_0x2777fc[_0x12f4('0x38')]);_0x516b42[_0x12f4('0x39')]=_[_0x12f4('0x3b')](_0x516b42[_0x12f4('0x36')],_0x516b42[_0x12f4('0x38')]);_0x3e0d20[_0x12f4('0x3a')]=_[_0x12f4('0x3b')](_0x516b42[_0x12f4('0x36')],qs[_0x12f4('0x3c')](_0x2777fc[_0x12f4('0x38')]['fields']));_0x3e0d20[_0x12f4('0x3a')]=_0x3e0d20[_0x12f4('0x3a')][_0x12f4('0x3d')]?_0x3e0d20[_0x12f4('0x3a')]:_0x516b42['model'];if(!_0x2777fc['query'][_0x12f4('0x3e')](_0x12f4('0x3f'))){_0x3e0d20['limit']=qs[_0x12f4('0x22')](_0x2777fc[_0x12f4('0x38')][_0x12f4('0x22')]);_0x3e0d20['offset']=qs[_0x12f4('0x20')](_0x2777fc['query'][_0x12f4('0x20')]);}_0x3e0d20[_0x12f4('0x40')]=qs['sort'](_0x2777fc[_0x12f4('0x38')][_0x12f4('0x41')]);_0x3e0d20[_0x12f4('0x42')]=qs[_0x12f4('0x39')](_[_0x12f4('0x43')](_0x2777fc[_0x12f4('0x38')],_0x516b42['filters']));_0x3e0d20[_0x12f4('0x42')][_0x12f4('0x5b')]=_0x2a1872['id'];if(_0x2777fc[_0x12f4('0x38')][_0x12f4('0x44')]){_0x3e0d20[_0x12f4('0x42')]=_[_0x12f4('0x45')](_0x3e0d20[_0x12f4('0x42')],{'$or':_[_0x12f4('0x30')](_0x3e0d20[_0x12f4('0x3a')],function(_0x3a984c){var _0x4c82b7={};_0x4c82b7[_0x3a984c]={'$like':'%'+_0x2777fc[_0x12f4('0x38')]['filter']+'%'};return _0x4c82b7;})});}_0x3e0d20=_['merge']({},_0x3e0d20,_0x2777fc[_0x12f4('0x46')]);return db[_0x12f4('0x5a')]['findAll'](_0x3e0d20);}})[_0x12f4('0x29')](function(_0x506f0e){if(_0x506f0e){return db[_0x12f4('0x5c')]['findAndCountAll']({'where':{'id':_[_0x12f4('0x30')](_0x506f0e,_0x12f4('0x5d')),'role':_0x12f4('0x5e')},'attributes':['id',_0x12f4('0x2e'),'faxPause',_0x12f4('0x5f'),_0x12f4('0x60')]});}})[_0x12f4('0x29')](function(_0x441933){if(_0x441933){return{'count':_0x441933[_0x12f4('0x23')],'rows':_[_0x12f4('0x30')](_0x441933[_0x12f4('0x49')],function(_0x1f5192){return{'membername':_0x1f5192[_0x12f4('0x2e')],'UserId':_0x1f5192['id'],'queue_name':_0x1ea188[_0x12f4('0x2e')],'FaxQueueId':_0x1ea188['id'],'interface':util[_0x12f4('0x61')]('%s/%s',_0x12f4('0x62'),_0x1f5192['name']),'penalty':0x0,'paused':_0x1f5192[_0x12f4('0x63')],'createdAt':_0x1f5192[_0x12f4('0x60')],'updatedAt':_0x1f5192['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x12f4('0x29')](respondWithFilteredResult(_0x2abd08,_0x3e0d20))[_0x12f4('0x4d')](handleError(_0x2abd08,null));};exports[_0x12f4('0x64')]=function(_0x380d90,_0x2c7be1,_0x43d8e8){var _0x496dc2={};var _0x3b8f59={};var _0x45e2e2;var _0x44b7dc;return db[_0x12f4('0x31')][_0x12f4('0x59')]({'where':{'id':_0x380d90[_0x12f4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c7be1,null))[_0x12f4('0x29')](function(_0x577313){if(_0x577313){_0x45e2e2=_0x577313;_0x3b8f59[_0x12f4('0x36')]=_[_0x12f4('0x37')](db['Team'][_0x12f4('0x32')]);_0x3b8f59[_0x12f4('0x38')]=_[_0x12f4('0x37')](_0x380d90['query']);_0x3b8f59[_0x12f4('0x39')]=_[_0x12f4('0x3b')](_0x3b8f59[_0x12f4('0x36')],_0x3b8f59[_0x12f4('0x38')]);_0x496dc2[_0x12f4('0x3a')]=_[_0x12f4('0x3b')](_0x3b8f59[_0x12f4('0x36')],qs[_0x12f4('0x3c')](_0x380d90[_0x12f4('0x38')]['fields']));_0x496dc2[_0x12f4('0x3a')]=_0x496dc2[_0x12f4('0x3a')][_0x12f4('0x3d')]?_0x496dc2['attributes']:_0x3b8f59[_0x12f4('0x36')];_0x496dc2[_0x12f4('0x40')]=qs[_0x12f4('0x41')](_0x380d90[_0x12f4('0x38')][_0x12f4('0x41')]);_0x496dc2[_0x12f4('0x42')]=qs['filters'](_[_0x12f4('0x43')](_0x380d90[_0x12f4('0x38')],_0x3b8f59[_0x12f4('0x39')]));if(_0x380d90[_0x12f4('0x38')][_0x12f4('0x44')]){_0x496dc2['where']=_[_0x12f4('0x45')](_0x496dc2[_0x12f4('0x42')],{'$or':_[_0x12f4('0x30')](_0x496dc2[_0x12f4('0x3a')],function(_0x321a1d){var _0x42407c={};_0x42407c[_0x321a1d]={'$like':'%'+_0x380d90[_0x12f4('0x38')][_0x12f4('0x44')]+'%'};return _0x42407c;})});}_0x496dc2=_[_0x12f4('0x45')]({},_0x496dc2,_0x380d90[_0x12f4('0x46')]);return _0x45e2e2['getTeams'](_0x496dc2);}})[_0x12f4('0x29')](function(_0x1f94b7){if(_0x1f94b7){_0x44b7dc=_0x1f94b7[_0x12f4('0x3d')];if(!_0x380d90[_0x12f4('0x38')][_0x12f4('0x3e')](_0x12f4('0x3f'))){_0x496dc2['limit']=qs[_0x12f4('0x22')](_0x380d90['query'][_0x12f4('0x22')]);_0x496dc2['offset']=qs[_0x12f4('0x20')](_0x380d90[_0x12f4('0x38')][_0x12f4('0x20')]);}return _0x45e2e2[_0x12f4('0x64')](_0x496dc2);}})[_0x12f4('0x29')](function(_0x248b4a){if(_0x248b4a){return _0x248b4a?{'count':_0x44b7dc,'rows':_0x248b4a}:null;}})['then'](respondWithResult(_0x2c7be1,null))[_0x12f4('0x4d')](handleError(_0x2c7be1,null));};exports[_0x12f4('0x65')]=function(_0x7a139,_0x20d4dc,_0x30fabd){var _0x1055f7=_0x7a139[_0x12f4('0x56')]['ids'];return db[_0x12f4('0x66')]['findAll']({'where':{'id':_0x1055f7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x12f4('0x67'),'attributes':['id',_0x12f4('0x2e'),_0x12f4('0x68'),_0x12f4('0x69'),_0x12f4('0x6a')],'raw':!![]}]})[_0x12f4('0x29')](function(_0xb52552){if(_0xb52552){var _0x4c8c61=_['flatMap'](_0xb52552,function(_0x3c2fda){var _0x1c5b0f=_0x3c2fda[_0x12f4('0x2a')]({'plain':!![]});return _0x1c5b0f['Agents'];});return db[_0x12f4('0x31')]['find']({'where':{'id':_0x7a139[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](function(_0x542d50){return db[_0x12f4('0x6b')][_0x12f4('0x6c')](function(_0x25dea4){return _0x542d50[_0x12f4('0x65')](_0x1055f7,{'transaction':_0x25dea4})[_0x12f4('0x29')](function(){return BPromise[_0x12f4('0x6d')](_0x4c8c61,function(_0x3b6151){return db['UserFaxQueue'][_0x12f4('0x6e')]({'where':{'UserId':_0x3b6151['id'],'FaxQueueId':_0x7a139[_0x12f4('0x4b')]['id']},'transaction':_0x25dea4});});})['then'](function(){_0x4c8c61[_0x12f4('0x6f')](function(_0x5b81a1){socket['emit'](_0x12f4('0x70'),{'UserId':_0x5b81a1['id'],'FaxQueueId':_0x542d50['id']});});});});});}})[_0x12f4('0x29')](respondWithStatusCode(_0x20d4dc,null))[_0x12f4('0x4d')](handleError(_0x20d4dc,null));};exports[_0x12f4('0x71')]=function(_0x395517,_0x3578c0,_0x5aac2d){return db[_0x12f4('0x66')][_0x12f4('0x48')]({'where':{'id':_0x395517[_0x12f4('0x38')][_0x12f4('0x72')]},'attributes':['id'],'include':[{'model':db[_0x12f4('0x5c')],'as':_0x12f4('0x67'),'attributes':['id'],'raw':!![]}]})[_0x12f4('0x29')](handleEntityNotFound(_0x3578c0,null))[_0x12f4('0x29')](function(_0x17d0cb){var _0x37ee0d=_[_0x12f4('0x30')](_0x17d0cb,'id');var _0x54e3d2=[];var _0x505633=[];var _0x3f78d4=squel[_0x12f4('0x73')]();_0x3f78d4[_0x12f4('0x74')](_0x12f4('0x75'))[_0x12f4('0x76')](_0x12f4('0x77'),'tq')['join'](_0x12f4('0x78'),'ut',_0x12f4('0x79'))['where']('FaxQueueId\x20=\x20?',_0x395517['params']['id']);for(var _0x1d3367=0x0;_0x1d3367<_0x17d0cb[_0x12f4('0x3d')];_0x1d3367+=0x1){let _0x39ba97=_0x17d0cb[_0x1d3367];for(var _0x3b7a7a=0x0;_0x3b7a7a<_0x39ba97[_0x12f4('0x67')][_0x12f4('0x3d')];_0x3b7a7a+=0x1){let _0x3395de=_0x39ba97[_0x12f4('0x67')][_0x3b7a7a];var _0x52b3f2=_0x3f78d4[_0x12f4('0x7a')]();_0x52b3f2[_0x12f4('0x42')]('ut.UserId\x20=\x20?',_0x3395de['id']);_0x505633[_0x12f4('0x7b')](db[_0x12f4('0x6b')][_0x12f4('0x38')](_0x52b3f2[_0x12f4('0x7c')](),{'type':db[_0x12f4('0x6b')][_0x12f4('0x7d')][_0x12f4('0x7e')]})[_0x12f4('0x29')](function(_0xe43fdf){if(_0xe43fdf[_0x12f4('0x3d')]===0x1){return _0x3395de['id'];}else{var _0x2dade8=_[_0x12f4('0x7f')](_[_0x12f4('0x30')](_0xe43fdf,_0x12f4('0x80')),function(_0x5f3081){return _[_0x12f4('0x81')](_0x37ee0d,_0x5f3081);});if(_0x2dade8){return _0x3395de['id'];}}}));}}return BPromise[_0x12f4('0x82')](_0x505633)[_0x12f4('0x29')](function(_0x328119){_0x54e3d2=_(_0x54e3d2)['union'](_0x328119)['compact']()[_0x12f4('0x83')]();return db[_0x12f4('0x31')]['find']({'where':{'id':_0x395517[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](function(_0x52a696){return db[_0x12f4('0x6b')][_0x12f4('0x6c')](function(_0x409ce2){return _0x52a696[_0x12f4('0x71')](_0x395517['query']['ids'],{'transaction':_0x409ce2})[_0x12f4('0x29')](function(){if(!_[_0x12f4('0x84')](_0x54e3d2)){return _0x52a696['removeAgents'](_0x54e3d2,{'transaction':_0x409ce2});}})[_0x12f4('0x29')](function(){_0x54e3d2['forEach'](function(_0x4d19ab){socket[_0x12f4('0x85')](_0x12f4('0x86'),{'UserId':_0x4d19ab,'FaxQueueId':_0x52a696['id']});});});});});});})[_0x12f4('0x29')](respondWithStatusCode(_0x3578c0,null))[_0x12f4('0x4d')](handleError(_0x3578c0,null));};exports[_0x12f4('0x87')]=function(_0x1e1d26,_0x56c6a5,_0x15284b){return db['FaxQueue'][_0x12f4('0x57')]({'where':{'id':_0x1e1d26[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x56c6a5,null))[_0x12f4('0x29')](function(_0xa3fa75){if(_0xa3fa75){return _0xa3fa75[_0x12f4('0x87')](_0x1e1d26[_0x12f4('0x56')][_0x12f4('0x72')],_[_0x12f4('0x88')](_0x1e1d26['body'],[_0x12f4('0x72'),'id'])||{})[_0x12f4('0x89')](function(_0x5bb897){for(var _0xbeb5cf=0x0;_0xbeb5cf<_0x1e1d26[_0x12f4('0x56')][_0x12f4('0x72')][_0x12f4('0x3d')];_0xbeb5cf+=0x1){socket[_0x12f4('0x85')](_0x12f4('0x70'),{'UserId':Number(_0x1e1d26['body'][_0x12f4('0x72')][_0xbeb5cf]),'FaxQueueId':Number(_0x1e1d26[_0x12f4('0x4b')]['id'])});}return _0x5bb897;});}})[_0x12f4('0x29')](respondWithResult(_0x56c6a5,null))[_0x12f4('0x4d')](handleError(_0x56c6a5,null));};exports['removeAgents']=function(_0x528fa8,_0x37bfe3,_0x322f7b){return db[_0x12f4('0x31')]['find']({'where':{'id':_0x528fa8[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x37bfe3,null))['then'](function(_0x401462){if(_0x401462){return _0x401462['removeAgents'](_0x528fa8[_0x12f4('0x38')][_0x12f4('0x72')])[_0x12f4('0x29')](function(){if(_[_0x12f4('0x8a')](_0x528fa8[_0x12f4('0x38')][_0x12f4('0x72')])){for(var _0x50c37e=0x0;_0x50c37e<_0x528fa8[_0x12f4('0x38')][_0x12f4('0x72')][_0x12f4('0x3d')];_0x50c37e+=0x1){socket[_0x12f4('0x85')](_0x12f4('0x86'),{'UserId':Number(_0x528fa8['query']['ids'][_0x50c37e]),'FaxQueueId':Number(_0x528fa8[_0x12f4('0x4b')]['id'])});}}else{socket[_0x12f4('0x85')]('userFaxQueue:remove',{'UserId':Number(_0x528fa8[_0x12f4('0x38')][_0x12f4('0x72')]),'FaxQueueId':Number(_0x528fa8[_0x12f4('0x4b')]['id'])});}});}})[_0x12f4('0x29')](respondWithStatusCode(_0x37bfe3,null))[_0x12f4('0x4d')](handleError(_0x37bfe3,null));};exports[_0x12f4('0x8b')]=function(_0x4a6f03,_0x2d7c05,_0x4c072e){var _0x57791d={};var _0x32dd6e={};var _0x346f40;var _0x40e9de;return db[_0x12f4('0x31')][_0x12f4('0x59')]({'where':{'id':_0x4a6f03[_0x12f4('0x4b')]['id']}})[_0x12f4('0x29')](handleEntityNotFound(_0x2d7c05,null))[_0x12f4('0x29')](function(_0x27d1d0){if(_0x27d1d0){_0x346f40=_0x27d1d0;_0x32dd6e[_0x12f4('0x36')]=_[_0x12f4('0x37')](db[_0x12f4('0x5c')][_0x12f4('0x32')]);_0x32dd6e[_0x12f4('0x38')]=_['keys'](_0x4a6f03[_0x12f4('0x38')]);_0x32dd6e[_0x12f4('0x39')]=_[_0x12f4('0x3b')](_0x32dd6e[_0x12f4('0x36')],_0x32dd6e[_0x12f4('0x38')]);_0x57791d[_0x12f4('0x3a')]=_[_0x12f4('0x3b')](_0x32dd6e[_0x12f4('0x36')],qs['fields'](_0x4a6f03[_0x12f4('0x38')]['fields']));_0x57791d[_0x12f4('0x3a')]=_0x57791d[_0x12f4('0x3a')]['length']?_0x57791d[_0x12f4('0x3a')]:_0x32dd6e[_0x12f4('0x36')];_0x57791d['order']=qs[_0x12f4('0x41')](_0x4a6f03[_0x12f4('0x38')][_0x12f4('0x41')]);_0x57791d[_0x12f4('0x42')]=qs['filters'](_[_0x12f4('0x43')](_0x4a6f03[_0x12f4('0x38')],_0x32dd6e[_0x12f4('0x39')]));if(_0x4a6f03['query'][_0x12f4('0x44')]){_0x57791d['where']=_[_0x12f4('0x45')](_0x57791d[_0x12f4('0x42')],{'$or':_[_0x12f4('0x30')](_0x57791d['attributes'],function(_0x5a6cab){var _0x4ade0d={};_0x4ade0d[_0x5a6cab]={'$like':'%'+_0x4a6f03['query'][_0x12f4('0x44')]+'%'};return _0x4ade0d;})});}_0x57791d=_[_0x12f4('0x45')]({},_0x57791d,_0x4a6f03[_0x12f4('0x46')]);return _0x346f40[_0x12f4('0x8b')](_0x57791d);}})[_0x12f4('0x29')](function(_0x1cb224){if(_0x1cb224){_0x40e9de=_0x1cb224[_0x12f4('0x3d')];if(!_0x4a6f03[_0x12f4('0x38')][_0x12f4('0x3e')]('nolimit')){_0x57791d[_0x12f4('0x22')]=qs[_0x12f4('0x22')](_0x4a6f03[_0x12f4('0x38')][_0x12f4('0x22')]);_0x57791d[_0x12f4('0x20')]=qs[_0x12f4('0x20')](_0x4a6f03['query']['offset']);}return _0x346f40[_0x12f4('0x8b')](_0x57791d);}})[_0x12f4('0x29')](function(_0x275abb){if(_0x275abb){return _0x275abb?{'count':_0x40e9de,'rows':_0x275abb}:null;}})[_0x12f4('0x29')](respondWithResult(_0x2d7c05,null))[_0x12f4('0x4d')](handleError(_0x2d7c05,null));}; \ No newline at end of file +var _0x8096=['fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FaxQueue','includeAll','include','show','params','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','findAll','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','each','userFaxQueue:save','select','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','forEach','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','keys','query','intersection','model','attributes'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x8096,0x166));var _0x6809=function(_0x36d960,_0x24c771){_0x36d960=_0x36d960-0x0;var _0x179e37=_0x8096[_0x36d960];return _0x179e37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6809('0x0'));var zipdir=require(_0x6809('0x1'));var jsonpatch=require(_0x6809('0x2'));var rp=require(_0x6809('0x3'));var moment=require(_0x6809('0x4'));var BPromise=require(_0x6809('0x5'));var Mustache=require(_0x6809('0x6'));var util=require(_0x6809('0x7'));var path=require(_0x6809('0x8'));var sox=require('sox');var csv=require(_0x6809('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6809('0xa'));var _=require(_0x6809('0xb'));var squel=require(_0x6809('0xc'));var crypto=require(_0x6809('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6809('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6809('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6809('0x10'));var as=require(_0x6809('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6809('0x12'))('api');var utils=require(_0x6809('0x13'));var config=require(_0x6809('0x14'));var licenseUtil=require(_0x6809('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6809('0x16'),'port':0x18eb});var socket=require(_0x6809('0x17'))(new Redis(config[_0x6809('0x18')]));require(_0x6809('0x19'))[_0x6809('0x1a')](socket);function respondWithStatusCode(_0x4ddc32,_0x414c59){_0x414c59=_0x414c59||0xcc;return function(_0x4044bd){if(_0x4044bd){return _0x4ddc32[_0x6809('0x1b')](_0x414c59);}return _0x4ddc32[_0x6809('0x1c')](_0x414c59)['end']();};}function respondWithResult(_0x2baa78,_0x1dd422){_0x1dd422=_0x1dd422||0xc8;return function(_0x190bc9){if(_0x190bc9){return _0x2baa78[_0x6809('0x1c')](_0x1dd422)[_0x6809('0x1d')](_0x190bc9);}};}function respondWithFilteredResult(_0x52ff4b,_0x73799e){return function(_0x3f933a){if(_0x3f933a){var _0x48de31=typeof _0x73799e[_0x6809('0x1e')]===_0x6809('0x1f')&&typeof _0x73799e[_0x6809('0x20')]===_0x6809('0x1f');var _0x477606=_0x3f933a[_0x6809('0x21')];var _0x3eb66f=_0x48de31?0x0:_0x73799e['offset'];var _0x51c570=_0x48de31?_0x3f933a['count']:_0x73799e['offset']+_0x73799e['limit'];var _0x5575ea;if(_0x51c570>=_0x477606){_0x51c570=_0x477606;_0x5575ea=0xc8;}else{_0x5575ea=0xce;}_0x52ff4b[_0x6809('0x1c')](_0x5575ea);return _0x52ff4b[_0x6809('0x22')](_0x6809('0x23'),_0x3eb66f+'-'+_0x51c570+'/'+_0x477606)[_0x6809('0x1d')](_0x3f933a);}return null;};}function patchUpdates(_0x2a93bd){return function(_0x27977d){try{jsonpatch['apply'](_0x27977d,_0x2a93bd,!![]);}catch(_0x3aa8d5){return BPromise[_0x6809('0x24')](_0x3aa8d5);}return _0x27977d[_0x6809('0x25')]();};}function saveUpdates(_0x5e7478,_0x127a05){return function(_0x163ebf){if(_0x163ebf){return _0x163ebf[_0x6809('0x26')](_0x5e7478)[_0x6809('0x27')](function(_0xa1fcfb){return _0xa1fcfb;});}return null;};}function removeEntity(_0x2ceb1d,_0xca1714){return function(_0x108c8b){if(_0x108c8b){return _0x108c8b['destroy']()['then'](function(){var _0x5f0fc6=_0x108c8b['get']({'plain':!![]});var _0x389723='FaxQueues';return db[_0x6809('0x28')][_0x6809('0x29')]({'where':{'type':_0x389723,'resourceId':_0x5f0fc6['id']}})[_0x6809('0x27')](function(){return _0x108c8b;});})[_0x6809('0x27')](function(){_0x2ceb1d[_0x6809('0x1c')](0xcc)[_0x6809('0x2a')]();});}};}function handleEntityNotFound(_0x241ef0,_0x2bd345){return function(_0x3cd56d){if(!_0x3cd56d){_0x241ef0[_0x6809('0x1b')](0x194);}return _0x3cd56d;};}function handleError(_0x3897e8,_0x3bf5b5){_0x3bf5b5=_0x3bf5b5||0x1f4;return function(_0x516b4f){logger[_0x6809('0x2b')](_0x516b4f[_0x6809('0x2c')]);if(_0x516b4f[_0x6809('0x2d')]){delete _0x516b4f[_0x6809('0x2d')];}_0x3897e8[_0x6809('0x1c')](_0x3bf5b5)[_0x6809('0x2e')](_0x516b4f);};}exports[_0x6809('0x2f')]=function(_0x1714b6,_0x26b1d8){var _0x4da75d={},_0x34ebd6={},_0x2a78b4={'count':0x0,'rows':[]};var _0x2cfabb=_[_0x6809('0x30')](db['FaxQueue'][_0x6809('0x31')],function(_0x344324){return{'name':_0x344324[_0x6809('0x32')],'type':_0x344324['type']['key']};});_0x34ebd6['model']=_['map'](_0x2cfabb,'name');_0x34ebd6['query']=_[_0x6809('0x33')](_0x1714b6[_0x6809('0x34')]);_0x34ebd6['filters']=_[_0x6809('0x35')](_0x34ebd6[_0x6809('0x36')],_0x34ebd6[_0x6809('0x34')]);_0x4da75d[_0x6809('0x37')]=_[_0x6809('0x35')](_0x34ebd6[_0x6809('0x36')],qs[_0x6809('0x38')](_0x1714b6[_0x6809('0x34')][_0x6809('0x38')]));_0x4da75d['attributes']=_0x4da75d[_0x6809('0x37')][_0x6809('0x39')]?_0x4da75d['attributes']:_0x34ebd6['model'];if(!_0x1714b6[_0x6809('0x34')]['hasOwnProperty'](_0x6809('0x3a'))){_0x4da75d[_0x6809('0x20')]=qs[_0x6809('0x20')](_0x1714b6[_0x6809('0x34')][_0x6809('0x20')]);_0x4da75d['offset']=qs[_0x6809('0x1e')](_0x1714b6['query']['offset']);}_0x4da75d[_0x6809('0x3b')]=qs[_0x6809('0x3c')](_0x1714b6[_0x6809('0x34')][_0x6809('0x3c')]);_0x4da75d[_0x6809('0x3d')]=qs[_0x6809('0x3e')](_[_0x6809('0x3f')](_0x1714b6[_0x6809('0x34')],_0x34ebd6[_0x6809('0x3e')]),_0x2cfabb);if(_0x1714b6[_0x6809('0x34')][_0x6809('0x40')]){_0x4da75d['where']=_[_0x6809('0x41')](_0x4da75d[_0x6809('0x3d')],{'$or':_[_0x6809('0x30')](_0x2cfabb,function(_0x336243){if(_0x336243['type']!==_0x6809('0x42')){var _0x2c2c2e={};_0x2c2c2e[_0x336243[_0x6809('0x2d')]]={'$like':'%'+_0x1714b6['query'][_0x6809('0x40')]+'%'};return _0x2c2c2e;}})});}_0x4da75d=_[_0x6809('0x41')]({},_0x4da75d,_0x1714b6['options']);var _0x4d3d0f={'where':_0x4da75d['where']};return db[_0x6809('0x43')][_0x6809('0x21')](_0x4d3d0f)['then'](function(_0x267f01){_0x2a78b4[_0x6809('0x21')]=_0x267f01;if(_0x1714b6[_0x6809('0x34')][_0x6809('0x44')]){_0x4da75d[_0x6809('0x45')]=[{'all':!![]}];}return db[_0x6809('0x43')]['findAll'](_0x4da75d);})[_0x6809('0x27')](function(_0x2ee2c2){_0x2a78b4['rows']=_0x2ee2c2;return _0x2a78b4;})[_0x6809('0x27')](respondWithFilteredResult(_0x26b1d8,_0x4da75d))['catch'](handleError(_0x26b1d8,null));};exports[_0x6809('0x46')]=function(_0x2396ee,_0xe30339){var _0x103f4f={'raw':!![],'where':{'id':_0x2396ee[_0x6809('0x47')]['id']}},_0x40fea8={};_0x40fea8[_0x6809('0x36')]=_[_0x6809('0x33')](db[_0x6809('0x43')][_0x6809('0x31')]);_0x40fea8['query']=_[_0x6809('0x33')](_0x2396ee['query']);_0x40fea8[_0x6809('0x3e')]=_[_0x6809('0x35')](_0x40fea8[_0x6809('0x36')],_0x40fea8[_0x6809('0x34')]);_0x103f4f['attributes']=_['intersection'](_0x40fea8[_0x6809('0x36')],qs['fields'](_0x2396ee[_0x6809('0x34')]['fields']));_0x103f4f[_0x6809('0x37')]=_0x103f4f[_0x6809('0x37')]['length']?_0x103f4f[_0x6809('0x37')]:_0x40fea8[_0x6809('0x36')];if(_0x2396ee[_0x6809('0x34')][_0x6809('0x44')]){_0x103f4f['include']=[{'all':!![]}];}_0x103f4f=_['merge']({},_0x103f4f,_0x2396ee[_0x6809('0x48')]);return db[_0x6809('0x43')][_0x6809('0x49')](_0x103f4f)[_0x6809('0x27')](handleEntityNotFound(_0xe30339,null))[_0x6809('0x27')](respondWithResult(_0xe30339,null))[_0x6809('0x4a')](handleError(_0xe30339,null));};exports['create']=function(_0x14780c,_0x352b27){return db[_0x6809('0x43')]['create'](_0x14780c[_0x6809('0x4b')],{})[_0x6809('0x27')](function(_0x53f1b7){var _0x4e1fc0=_0x14780c[_0x6809('0x4c')]['get']({'plain':!![]});if(!_0x4e1fc0)throw new Error(_0x6809('0x4d'));if(_0x4e1fc0[_0x6809('0x4e')]==='user'){var _0x14cf6e=_0x53f1b7[_0x6809('0x4f')]({'plain':!![]});var _0x4e95e2='FaxQueues';return db['UserProfileSection'][_0x6809('0x49')]({'where':{'name':_0x4e95e2,'userProfileId':_0x4e1fc0['userProfileId']},'raw':!![]})[_0x6809('0x27')](function(_0x3d45d7){if(_0x3d45d7&&_0x3d45d7[_0x6809('0x50')]===0x0){return db[_0x6809('0x28')][_0x6809('0x51')]({'name':_0x14cf6e[_0x6809('0x2d')],'resourceId':_0x14cf6e['id'],'type':_0x3d45d7[_0x6809('0x2d')],'sectionId':_0x3d45d7['id']},{})[_0x6809('0x27')](function(){return _0x53f1b7;});}else{return _0x53f1b7;}})[_0x6809('0x4a')](function(_0x3406c3){logger[_0x6809('0x2b')](_0x6809('0x52'),_0x3406c3);throw _0x3406c3;});}return _0x53f1b7;})[_0x6809('0x27')](respondWithResult(_0x352b27,0xc9))['catch'](handleError(_0x352b27,null));};exports['update']=function(_0x2ad313,_0x3a75dd){if(_0x2ad313[_0x6809('0x4b')]['id']){delete _0x2ad313[_0x6809('0x4b')]['id'];}return db[_0x6809('0x43')]['find']({'where':{'id':_0x2ad313[_0x6809('0x47')]['id']}})[_0x6809('0x27')](handleEntityNotFound(_0x3a75dd,null))[_0x6809('0x27')](saveUpdates(_0x2ad313[_0x6809('0x4b')],null))['then'](respondWithResult(_0x3a75dd,null))[_0x6809('0x4a')](handleError(_0x3a75dd,null));};exports[_0x6809('0x29')]=function(_0x48ca73,_0xff2d7e){return db[_0x6809('0x43')][_0x6809('0x49')]({'where':{'id':_0x48ca73[_0x6809('0x47')]['id']}})['then'](handleEntityNotFound(_0xff2d7e,null))['then'](removeEntity(_0xff2d7e,null))['catch'](handleError(_0xff2d7e,null));};exports['describe']=function(_0x1206ec,_0x400b6a){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x400b6a,null))['catch'](handleError(_0x400b6a,null));};exports[_0x6809('0x53')]=function(_0x4ccd9e,_0x293e77,_0x52c1e0){var _0x4afd10={'raw':!![],'where':{}},_0x4e152c={},_0x407df8;return db[_0x6809('0x43')]['findOne']({'where':{'id':_0x4ccd9e[_0x6809('0x47')]['id']}})[_0x6809('0x27')](handleEntityNotFound(_0x293e77,null))['then'](function(_0x27607e){if(_0x27607e){_0x407df8=_0x27607e['get']({'plain':!![]});_0x4e152c[_0x6809('0x36')]=_['keys'](db[_0x6809('0x54')][_0x6809('0x31')]);_0x4e152c[_0x6809('0x34')]=_['keys'](_0x4ccd9e[_0x6809('0x34')]);_0x4e152c[_0x6809('0x3e')]=_[_0x6809('0x35')](_0x4e152c[_0x6809('0x36')],_0x4e152c[_0x6809('0x34')]);_0x4afd10[_0x6809('0x37')]=_[_0x6809('0x35')](_0x4e152c[_0x6809('0x36')],qs[_0x6809('0x38')](_0x4ccd9e[_0x6809('0x34')][_0x6809('0x38')]));_0x4afd10[_0x6809('0x37')]=_0x4afd10[_0x6809('0x37')]['length']?_0x4afd10[_0x6809('0x37')]:_0x4e152c['model'];if(!_0x4ccd9e[_0x6809('0x34')][_0x6809('0x55')](_0x6809('0x3a'))){_0x4afd10[_0x6809('0x20')]=qs[_0x6809('0x20')](_0x4ccd9e[_0x6809('0x34')][_0x6809('0x20')]);_0x4afd10[_0x6809('0x1e')]=qs[_0x6809('0x1e')](_0x4ccd9e[_0x6809('0x34')]['offset']);}_0x4afd10[_0x6809('0x3b')]=qs[_0x6809('0x3c')](_0x4ccd9e[_0x6809('0x34')][_0x6809('0x3c')]);_0x4afd10[_0x6809('0x3d')]=qs[_0x6809('0x3e')](_['pick'](_0x4ccd9e[_0x6809('0x34')],_0x4e152c[_0x6809('0x3e')]));_0x4afd10['where'][_0x6809('0x56')]=_0x27607e['id'];if(_0x4ccd9e[_0x6809('0x34')][_0x6809('0x40')]){_0x4afd10[_0x6809('0x3d')]=_[_0x6809('0x41')](_0x4afd10['where'],{'$or':_[_0x6809('0x30')](_0x4afd10[_0x6809('0x37')],function(_0x4a8481){var _0x33665a={};_0x33665a[_0x4a8481]={'$like':'%'+_0x4ccd9e[_0x6809('0x34')]['filter']+'%'};return _0x33665a;})});}_0x4afd10=_[_0x6809('0x41')]({},_0x4afd10,_0x4ccd9e[_0x6809('0x48')]);return db[_0x6809('0x54')][_0x6809('0x57')](_0x4afd10);}})[_0x6809('0x27')](function(_0x5180e4){if(_0x5180e4){return db[_0x6809('0x58')]['findAndCountAll']({'where':{'id':_[_0x6809('0x30')](_0x5180e4,_0x6809('0x59')),'role':_0x6809('0x5a')},'attributes':['id',_0x6809('0x2d'),'faxPause',_0x6809('0x5b'),_0x6809('0x5c')]});}})[_0x6809('0x27')](function(_0x31a325){if(_0x31a325){return{'count':_0x31a325[_0x6809('0x21')],'rows':_['map'](_0x31a325[_0x6809('0x5d')],function(_0x23d43c){return{'membername':_0x23d43c[_0x6809('0x2d')],'UserId':_0x23d43c['id'],'queue_name':_0x407df8[_0x6809('0x2d')],'FaxQueueId':_0x407df8['id'],'interface':util[_0x6809('0x5e')](_0x6809('0x5f'),_0x6809('0x60'),_0x23d43c[_0x6809('0x2d')]),'penalty':0x0,'paused':_0x23d43c[_0x6809('0x61')],'createdAt':_0x23d43c['createdAt'],'updatedAt':_0x23d43c[_0x6809('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6809('0x27')](respondWithFilteredResult(_0x293e77,_0x4afd10))[_0x6809('0x4a')](handleError(_0x293e77,null));};exports[_0x6809('0x62')]=function(_0x27eba5,_0x3e09c6,_0x38183f){var _0x1f9b00={};var _0x394e7c={};var _0x538987;var _0xaf22f;return db[_0x6809('0x43')][_0x6809('0x63')]({'where':{'id':_0x27eba5[_0x6809('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e09c6,null))[_0x6809('0x27')](function(_0x3c02bf){if(_0x3c02bf){_0x538987=_0x3c02bf;_0x394e7c[_0x6809('0x36')]=_['keys'](db[_0x6809('0x64')][_0x6809('0x31')]);_0x394e7c[_0x6809('0x34')]=_['keys'](_0x27eba5[_0x6809('0x34')]);_0x394e7c[_0x6809('0x3e')]=_[_0x6809('0x35')](_0x394e7c['model'],_0x394e7c[_0x6809('0x34')]);_0x1f9b00[_0x6809('0x37')]=_[_0x6809('0x35')](_0x394e7c[_0x6809('0x36')],qs[_0x6809('0x38')](_0x27eba5['query']['fields']));_0x1f9b00['attributes']=_0x1f9b00['attributes']['length']?_0x1f9b00[_0x6809('0x37')]:_0x394e7c['model'];_0x1f9b00[_0x6809('0x3b')]=qs[_0x6809('0x3c')](_0x27eba5['query'][_0x6809('0x3c')]);_0x1f9b00[_0x6809('0x3d')]=qs[_0x6809('0x3e')](_['pick'](_0x27eba5[_0x6809('0x34')],_0x394e7c[_0x6809('0x3e')]));if(_0x27eba5[_0x6809('0x34')][_0x6809('0x40')]){_0x1f9b00[_0x6809('0x3d')]=_[_0x6809('0x41')](_0x1f9b00[_0x6809('0x3d')],{'$or':_[_0x6809('0x30')](_0x1f9b00['attributes'],function(_0x3ca398){var _0x36da07={};_0x36da07[_0x3ca398]={'$like':'%'+_0x27eba5[_0x6809('0x34')][_0x6809('0x40')]+'%'};return _0x36da07;})});}_0x1f9b00=_[_0x6809('0x41')]({},_0x1f9b00,_0x27eba5[_0x6809('0x48')]);return _0x538987[_0x6809('0x62')](_0x1f9b00);}})[_0x6809('0x27')](function(_0x1961fd){if(_0x1961fd){_0xaf22f=_0x1961fd['length'];if(!_0x27eba5[_0x6809('0x34')]['hasOwnProperty'](_0x6809('0x3a'))){_0x1f9b00[_0x6809('0x20')]=qs[_0x6809('0x20')](_0x27eba5[_0x6809('0x34')][_0x6809('0x20')]);_0x1f9b00[_0x6809('0x1e')]=qs[_0x6809('0x1e')](_0x27eba5[_0x6809('0x34')][_0x6809('0x1e')]);}return _0x538987[_0x6809('0x62')](_0x1f9b00);}})[_0x6809('0x27')](function(_0x2eab41){if(_0x2eab41){return _0x2eab41?{'count':_0xaf22f,'rows':_0x2eab41}:null;}})[_0x6809('0x27')](respondWithResult(_0x3e09c6,null))['catch'](handleError(_0x3e09c6,null));};exports[_0x6809('0x65')]=function(_0x3999ae,_0x2d55fb,_0x641903){var _0x5c1bb6=_0x3999ae[_0x6809('0x4b')][_0x6809('0x66')];return db[_0x6809('0x64')][_0x6809('0x57')]({'where':{'id':_0x5c1bb6},'attributes':['id'],'include':[{'model':db[_0x6809('0x58')],'as':_0x6809('0x67'),'attributes':['id','name','online',_0x6809('0x68'),_0x6809('0x69')],'raw':!![]}]})[_0x6809('0x27')](function(_0x266bef){if(_0x266bef){var _0x3ff0fd=_[_0x6809('0x6a')](_0x266bef,function(_0x341ee8){var _0x5df50a=_0x341ee8['get']({'plain':!![]});return _0x5df50a[_0x6809('0x67')];});return db[_0x6809('0x43')][_0x6809('0x49')]({'where':{'id':_0x3999ae[_0x6809('0x47')]['id']}})[_0x6809('0x27')](function(_0x3cb66a){return db['sequelize'][_0x6809('0x6b')](function(_0x8a777b){return _0x3cb66a[_0x6809('0x65')](_0x5c1bb6,{'transaction':_0x8a777b})[_0x6809('0x27')](function(){return BPromise[_0x6809('0x6c')](_0x3ff0fd,function(_0x3a510e){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3a510e['id'],'FaxQueueId':_0x3999ae[_0x6809('0x47')]['id']},'transaction':_0x8a777b});});})['then'](function(){_0x3ff0fd['forEach'](function(_0x507b40){socket['emit'](_0x6809('0x6d'),{'UserId':_0x507b40['id'],'FaxQueueId':_0x3cb66a['id']});});});});});}})[_0x6809('0x27')](respondWithStatusCode(_0x2d55fb,null))[_0x6809('0x4a')](handleError(_0x2d55fb,null));};exports['removeTeams']=function(_0x140f6b,_0x1fa5fe,_0x50411d){return db[_0x6809('0x64')][_0x6809('0x57')]({'where':{'id':_0x140f6b[_0x6809('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6809('0x58')],'as':_0x6809('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fa5fe,null))[_0x6809('0x27')](function(_0x1d77ee){var _0x24d6c5=_[_0x6809('0x30')](_0x1d77ee,'id');var _0x3ce66a=[];var _0x3767e3=[];var _0x67414b=squel[_0x6809('0x6e')]();_0x67414b['field'](_0x6809('0x6f'))[_0x6809('0x70')](_0x6809('0x71'),'tq')['join'](_0x6809('0x72'),'ut',_0x6809('0x73'))['where'](_0x6809('0x74'),_0x140f6b[_0x6809('0x47')]['id']);for(var _0x1f9f99=0x0;_0x1f9f99<_0x1d77ee[_0x6809('0x39')];_0x1f9f99+=0x1){let _0x45500e=_0x1d77ee[_0x1f9f99];for(var _0x54c3b4=0x0;_0x54c3b4<_0x45500e[_0x6809('0x67')]['length'];_0x54c3b4+=0x1){let _0x170bea=_0x45500e[_0x6809('0x67')][_0x54c3b4];var _0x50c073=_0x67414b[_0x6809('0x75')]();_0x50c073[_0x6809('0x3d')]('ut.UserId\x20=\x20?',_0x170bea['id']);_0x3767e3[_0x6809('0x76')](db['sequelize'][_0x6809('0x34')](_0x50c073[_0x6809('0x77')](),{'type':db[_0x6809('0x78')][_0x6809('0x79')]['SELECT']})[_0x6809('0x27')](function(_0x3ec941){if(_0x3ec941[_0x6809('0x39')]===0x1){return _0x170bea['id'];}else{var _0x475cd9=_[_0x6809('0x7a')](_[_0x6809('0x30')](_0x3ec941,_0x6809('0x7b')),function(_0x5debfb){return _['includes'](_0x24d6c5,_0x5debfb);});if(_0x475cd9){return _0x170bea['id'];}}}));}}return BPromise[_0x6809('0x7c')](_0x3767e3)[_0x6809('0x27')](function(_0x2c95b9){_0x3ce66a=_(_0x3ce66a)[_0x6809('0x7d')](_0x2c95b9)[_0x6809('0x7e')]()['value']();return db[_0x6809('0x43')][_0x6809('0x49')]({'where':{'id':_0x140f6b[_0x6809('0x47')]['id']}})[_0x6809('0x27')](function(_0x492993){return db[_0x6809('0x78')][_0x6809('0x6b')](function(_0x2d7c23){return _0x492993[_0x6809('0x7f')](_0x140f6b[_0x6809('0x34')][_0x6809('0x66')],{'transaction':_0x2d7c23})[_0x6809('0x27')](function(){if(!_[_0x6809('0x80')](_0x3ce66a)){return _0x492993[_0x6809('0x81')](_0x3ce66a,{'transaction':_0x2d7c23});}})[_0x6809('0x27')](function(){_0x3ce66a[_0x6809('0x82')](function(_0x329d7e){socket[_0x6809('0x83')](_0x6809('0x84'),{'UserId':_0x329d7e,'FaxQueueId':_0x492993['id']});});});});});});})[_0x6809('0x27')](respondWithStatusCode(_0x1fa5fe,null))['catch'](handleError(_0x1fa5fe,null));};exports['addAgents']=function(_0x20cab9,_0x5ce7a6,_0x3199b3){return db['FaxQueue']['find']({'where':{'id':_0x20cab9[_0x6809('0x47')]['id']}})[_0x6809('0x27')](handleEntityNotFound(_0x5ce7a6,null))['then'](function(_0x396ea0){if(_0x396ea0){return _0x396ea0[_0x6809('0x85')](_0x20cab9['body'][_0x6809('0x66')],_[_0x6809('0x86')](_0x20cab9['body'],[_0x6809('0x66'),'id'])||{})[_0x6809('0x87')](function(_0x36dffb){for(var _0x277a78=0x0;_0x277a78<_0x20cab9[_0x6809('0x4b')][_0x6809('0x66')][_0x6809('0x39')];_0x277a78+=0x1){socket[_0x6809('0x83')](_0x6809('0x6d'),{'UserId':Number(_0x20cab9['body'][_0x6809('0x66')][_0x277a78]),'FaxQueueId':Number(_0x20cab9[_0x6809('0x47')]['id'])});}return _0x36dffb;});}})[_0x6809('0x27')](respondWithResult(_0x5ce7a6,null))['catch'](handleError(_0x5ce7a6,null));};exports[_0x6809('0x81')]=function(_0x1e0646,_0x2a4d18,_0x1bf067){return db[_0x6809('0x43')][_0x6809('0x49')]({'where':{'id':_0x1e0646[_0x6809('0x47')]['id']}})[_0x6809('0x27')](handleEntityNotFound(_0x2a4d18,null))['then'](function(_0x1782c8){if(_0x1782c8){return _0x1782c8[_0x6809('0x81')](_0x1e0646['query'][_0x6809('0x66')])[_0x6809('0x27')](function(){if(_[_0x6809('0x88')](_0x1e0646[_0x6809('0x34')]['ids'])){for(var _0x3a3057=0x0;_0x3a3057<_0x1e0646[_0x6809('0x34')][_0x6809('0x66')]['length'];_0x3a3057+=0x1){socket['emit'](_0x6809('0x84'),{'UserId':Number(_0x1e0646[_0x6809('0x34')][_0x6809('0x66')][_0x3a3057]),'FaxQueueId':Number(_0x1e0646[_0x6809('0x47')]['id'])});}}else{socket['emit'](_0x6809('0x84'),{'UserId':Number(_0x1e0646[_0x6809('0x34')]['ids']),'FaxQueueId':Number(_0x1e0646[_0x6809('0x47')]['id'])});}});}})[_0x6809('0x27')](respondWithStatusCode(_0x2a4d18,null))[_0x6809('0x4a')](handleError(_0x2a4d18,null));};exports[_0x6809('0x89')]=function(_0x5a93d9,_0xb0f6d,_0x3040e8){var _0x1c6889={};var _0x5392ac={};var _0x553a8d;var _0x2f7f4c;return db[_0x6809('0x43')]['findOne']({'where':{'id':_0x5a93d9[_0x6809('0x47')]['id']}})['then'](handleEntityNotFound(_0xb0f6d,null))[_0x6809('0x27')](function(_0x115097){if(_0x115097){_0x553a8d=_0x115097;_0x5392ac[_0x6809('0x36')]=_[_0x6809('0x33')](db['User'][_0x6809('0x31')]);_0x5392ac[_0x6809('0x34')]=_[_0x6809('0x33')](_0x5a93d9[_0x6809('0x34')]);_0x5392ac['filters']=_[_0x6809('0x35')](_0x5392ac[_0x6809('0x36')],_0x5392ac['query']);_0x1c6889[_0x6809('0x37')]=_[_0x6809('0x35')](_0x5392ac[_0x6809('0x36')],qs[_0x6809('0x38')](_0x5a93d9[_0x6809('0x34')][_0x6809('0x38')]));_0x1c6889['attributes']=_0x1c6889[_0x6809('0x37')][_0x6809('0x39')]?_0x1c6889[_0x6809('0x37')]:_0x5392ac[_0x6809('0x36')];_0x1c6889[_0x6809('0x3b')]=qs[_0x6809('0x3c')](_0x5a93d9[_0x6809('0x34')][_0x6809('0x3c')]);_0x1c6889[_0x6809('0x3d')]=qs[_0x6809('0x3e')](_['pick'](_0x5a93d9[_0x6809('0x34')],_0x5392ac['filters']));if(_0x5a93d9[_0x6809('0x34')][_0x6809('0x40')]){_0x1c6889['where']=_[_0x6809('0x41')](_0x1c6889['where'],{'$or':_['map'](_0x1c6889[_0x6809('0x37')],function(_0x1585c9){var _0x3b5c4c={};_0x3b5c4c[_0x1585c9]={'$like':'%'+_0x5a93d9[_0x6809('0x34')][_0x6809('0x40')]+'%'};return _0x3b5c4c;})});}_0x1c6889=_[_0x6809('0x41')]({},_0x1c6889,_0x5a93d9[_0x6809('0x48')]);return _0x553a8d[_0x6809('0x89')](_0x1c6889);}})[_0x6809('0x27')](function(_0xe65616){if(_0xe65616){_0x2f7f4c=_0xe65616['length'];if(!_0x5a93d9[_0x6809('0x34')][_0x6809('0x55')]('nolimit')){_0x1c6889[_0x6809('0x20')]=qs['limit'](_0x5a93d9[_0x6809('0x34')][_0x6809('0x20')]);_0x1c6889[_0x6809('0x1e')]=qs[_0x6809('0x1e')](_0x5a93d9[_0x6809('0x34')]['offset']);}return _0x553a8d[_0x6809('0x89')](_0x1c6889);}})['then'](function(_0x4cb33b){if(_0x4cb33b){return _0x4cb33b?{'count':_0x2f7f4c,'rows':_0x4cb33b}:null;}})[_0x6809('0x27')](respondWithResult(_0xb0f6d,null))[_0x6809('0x4a')](handleError(_0xb0f6d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 366c7de..4e87bd6 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 _0x32d5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','FaxQueue'];(function(_0x18bf25,_0x1d8405){var _0x568540=function(_0x3fd485){while(--_0x3fd485){_0x18bf25['push'](_0x18bf25['shift']());}};_0x568540(++_0x1d8405);}(_0x32d5,0x6e));var _0x532d=function(_0x41e219,_0x1e8307){_0x41e219=_0x41e219-0x0;var _0x54b011=_0x32d5[_0x41e219];return _0x54b011;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x532d('0x0'))['db'][_0x532d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x532d('0x2')](0x0);var events={'afterCreate':_0x532d('0x3'),'afterUpdate':_0x532d('0x4'),'afterDestroy':_0x532d('0x5')};function emitEvent(_0x2999f5){return function(_0x3881ed,_0xf727d1,_0xc3f900){FaxQueueEvents['emit'](_0x2999f5+':'+_0x3881ed['id'],_0x3881ed);FaxQueueEvents[_0x532d('0x6')](_0x2999f5,_0x3881ed);_0xc3f900(null);};}for(var e in events){if(events[_0x532d('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xed5e=['remove','emit','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','update'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xed5e,0x94));var _0xeed5=function(_0x1e1fd5,_0x1173d8){_0x1e1fd5=_0x1e1fd5-0x0;var _0x397946=_0xed5e[_0x1e1fd5];return _0x397946;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xeed5('0x0'))['db'][_0xeed5('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xeed5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeed5('0x3'),'afterDestroy':_0xeed5('0x4')};function emitEvent(_0x319b46){return function(_0x457523,_0x37fb21,_0x5e05b8){FaxQueueEvents[_0xeed5('0x5')](_0x319b46+':'+_0x457523['id'],_0x457523);FaxQueueEvents[_0xeed5('0x5')](_0x319b46,_0x457523);_0x5e05b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xeed5('0x6')](e,emitEvent(event));}}module[_0xeed5('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index da868cc..a3e24e5 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 _0xa978=['api','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues','lodash'];(function(_0x55c3c7,_0x548541){var _0x762ab3=function(_0x272e8a){while(--_0x272e8a){_0x55c3c7['push'](_0x55c3c7['shift']());}};_0x762ab3(++_0x548541);}(_0xa978,0xdb));var _0x8a97=function(_0x395a89,_0xf2bb91){_0x395a89=_0x395a89-0x0;var _0x2b6a94=_0xa978[_0x395a89];return _0x2b6a94;};'use strict';var _=require(_0x8a97('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a97('0x1'));var moment=require(_0x8a97('0x2'));var BPromise=require(_0x8a97('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a97('0x4'));var rimraf=require(_0x8a97('0x5'));var config=require(_0x8a97('0x6'));var attributes=require(_0x8a97('0x7'));module[_0x8a97('0x8')]=function(_0x105ddc,_0x48f617){return _0x105ddc['define'](_0x8a97('0x9'),attributes,{'tableName':_0x8a97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a2=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','util'];(function(_0x7a08f5,_0x2886bc){var _0xb19402=function(_0x2adbe3){while(--_0x2adbe3){_0x7a08f5['push'](_0x7a08f5['shift']());}};_0xb19402(++_0x2886bc);}(_0xc4a2,0x11e));var _0x2c4a=function(_0xa965be,_0x5a6389){_0xa965be=_0xa965be-0x0;var _0x151718=_0xc4a2[_0xa965be];return _0x151718;};'use strict';var _=require(_0x2c4a('0x0'));var util=require(_0x2c4a('0x1'));var logger=require(_0x2c4a('0x2'))('api');var moment=require(_0x2c4a('0x3'));var BPromise=require(_0x2c4a('0x4'));var rp=require(_0x2c4a('0x5'));var fs=require('fs');var path=require(_0x2c4a('0x6'));var rimraf=require(_0x2c4a('0x7'));var config=require(_0x2c4a('0x8'));var attributes=require(_0x2c4a('0x9'));module[_0x2c4a('0xa')]=function(_0x503f42,_0x131008){return _0x503f42[_0x2c4a('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 9f36512..817f261 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 _0xa0c0=['stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','find','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x315de3,_0x47fb12){var _0x1d1889=function(_0x54b385){while(--_0x54b385){_0x315de3['push'](_0x315de3['shift']());}};_0x1d1889(++_0x47fb12);}(_0xa0c0,0x139));var _0x0a0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa0c0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0a0c('0x0'));var util=require(_0x0a0c('0x1'));var moment=require(_0x0a0c('0x2'));var BPromise=require(_0x0a0c('0x3'));var rs=require(_0x0a0c('0x4'));var fs=require('fs');var Redis=require(_0x0a0c('0x5'));var db=require(_0x0a0c('0x6'))['db'];var utils=require(_0x0a0c('0x7'));var logger=require(_0x0a0c('0x8'))(_0x0a0c('0x9'));var config=require('../../config/environment');var jayson=require(_0x0a0c('0xa'));var client=jayson[_0x0a0c('0xb')][_0x0a0c('0xc')]({'port':0x232a});config[_0x0a0c('0xd')]=_[_0x0a0c('0xe')](config[_0x0a0c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a0c('0xf'))(new Redis(config[_0x0a0c('0xd')]));require(_0x0a0c('0x10'))[_0x0a0c('0x11')](socket);function respondWithRpcPromise(_0x546839,_0x51e18f,_0x13ed70){return new BPromise(function(_0x1180af,_0xdf3f10){return client[_0x0a0c('0x12')](_0x546839,_0x13ed70)['then'](function(_0x6f4df7){logger[_0x0a0c('0x13')](_0x0a0c('0x14'),_0x51e18f,'request\x20sent');logger[_0x0a0c('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x51e18f,_0x0a0c('0x16'),JSON[_0x0a0c('0x17')](_0x6f4df7));if(_0x6f4df7['error']){if(_0x6f4df7[_0x0a0c('0x18')][_0x0a0c('0x19')]===0x1f4){logger[_0x0a0c('0x18')](_0x0a0c('0x14'),_0x51e18f,_0x6f4df7[_0x0a0c('0x18')][_0x0a0c('0x1a')]);return _0xdf3f10(_0x6f4df7[_0x0a0c('0x18')][_0x0a0c('0x1a')]);}logger['error'](_0x0a0c('0x14'),_0x51e18f,_0x6f4df7[_0x0a0c('0x18')][_0x0a0c('0x1a')]);return _0x1180af(_0x6f4df7[_0x0a0c('0x18')]['message']);}else{logger[_0x0a0c('0x13')]('FaxQueue,\x20%s,\x20%s',_0x51e18f,'request\x20sent');_0x1180af(_0x6f4df7[_0x0a0c('0x1b')][_0x0a0c('0x1a')]);}})[_0x0a0c('0x1c')](function(_0x1cbf91){logger[_0x0a0c('0x18')](_0x0a0c('0x14'),_0x51e18f,_0x1cbf91);_0xdf3f10(_0x1cbf91);});});}exports[_0x0a0c('0x1d')]=function(_0x4e79a1){var _0x5297bd=this;return new Promise(function(_0x1eb2c6,_0x2d46b4){return db['FaxQueue'][_0x0a0c('0x1e')]({'raw':_0x4e79a1[_0x0a0c('0x1f')]?_0x4e79a1[_0x0a0c('0x1f')][_0x0a0c('0x20')]===undefined?!![]:![]:!![],'where':_0x4e79a1[_0x0a0c('0x1f')]?_0x4e79a1[_0x0a0c('0x1f')]['where']||null:null,'attributes':_0x4e79a1['options']?_0x4e79a1[_0x0a0c('0x1f')][_0x0a0c('0x21')]||null:null,'limit':_0x4e79a1[_0x0a0c('0x1f')]?_0x4e79a1['options'][_0x0a0c('0x22')]||null:null,'include':_0x4e79a1['options']?_0x4e79a1['options'][_0x0a0c('0x23')]?_[_0x0a0c('0x24')](_0x4e79a1['options']['include'],function(_0x27004e){return{'model':db[_0x27004e['model']],'as':_0x27004e['as'],'attributes':_0x27004e[_0x0a0c('0x21')],'include':_0x27004e[_0x0a0c('0x23')]?_['map'](_0x27004e['include'],function(_0x3b7713){return{'model':db[_0x3b7713[_0x0a0c('0x25')]],'as':_0x3b7713['as'],'attributes':_0x3b7713[_0x0a0c('0x21')],'include':_0x3b7713[_0x0a0c('0x23')]?_[_0x0a0c('0x24')](_0x3b7713[_0x0a0c('0x23')],function(_0x1a3f22){return{'model':db[_0x1a3f22['model']],'as':_0x1a3f22['as'],'attributes':_0x1a3f22[_0x0a0c('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32fd1b){logger[_0x0a0c('0x13')](_0x0a0c('0x1d'),_0x4e79a1);logger[_0x0a0c('0x15')](_0x0a0c('0x1d'),_0x4e79a1,JSON['stringify'](_0x32fd1b));_0x1eb2c6(_0x32fd1b);})['catch'](function(_0x4a2ab0){logger['error']('GetFaxQueue',_0x4a2ab0[_0x0a0c('0x1a')],_0x4e79a1);_0x2d46b4(_0x5297bd[_0x0a0c('0x18')](0x1f4,_0x4a2ab0[_0x0a0c('0x1a')]));});});};exports[_0x0a0c('0x26')]=function(_0x37c5b6){var _0x2bd738=this;return new Promise(function(_0x18bf4d,_0x2bf1e5){return db['FaxQueue'][_0x0a0c('0x27')]({'raw':_0x37c5b6[_0x0a0c('0x1f')]?_0x37c5b6['options'][_0x0a0c('0x20')]===undefined?!![]:![]:!![],'where':_0x37c5b6[_0x0a0c('0x1f')]?_0x37c5b6[_0x0a0c('0x1f')][_0x0a0c('0x28')]||null:null,'attributes':_0x37c5b6['options']?_0x37c5b6[_0x0a0c('0x1f')]['attributes']||null:null,'include':_0x37c5b6['options']?_0x37c5b6['options'][_0x0a0c('0x23')]?_[_0x0a0c('0x24')](_0x37c5b6[_0x0a0c('0x1f')][_0x0a0c('0x23')],function(_0x245313){return{'model':db[_0x245313['model']],'as':_0x245313['as'],'attributes':_0x245313[_0x0a0c('0x21')],'include':_0x245313[_0x0a0c('0x23')]?_[_0x0a0c('0x24')](_0x245313['include'],function(_0x498097){return{'model':db[_0x498097[_0x0a0c('0x25')]],'as':_0x498097['as'],'attributes':_0x498097['attributes'],'include':_0x498097[_0x0a0c('0x23')]?_[_0x0a0c('0x24')](_0x498097['include'],function(_0x1afa39){return{'model':db[_0x1afa39[_0x0a0c('0x25')]],'as':_0x1afa39['as'],'attributes':_0x1afa39['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a0c('0x29')](function(_0x25b96d){logger[_0x0a0c('0x13')]('ShowFaxQueue',_0x37c5b6);logger[_0x0a0c('0x15')](_0x0a0c('0x26'),_0x37c5b6,JSON['stringify'](_0x25b96d));_0x18bf4d(_0x25b96d);})[_0x0a0c('0x1c')](function(_0x2bc70d){logger[_0x0a0c('0x18')]('ShowFaxQueue',_0x2bc70d[_0x0a0c('0x1a')],_0x37c5b6);_0x2bf1e5(_0x2bd738['error'](0x1f4,_0x2bc70d[_0x0a0c('0x1a')]));});});}; \ No newline at end of file +var _0x76ed=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','limit','include','map','model','stringify','find','raw','where','info','ShowFaxQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x25cd72,_0x5617d7){var _0x1ed44e=function(_0x2afe95){while(--_0x2afe95){_0x25cd72['push'](_0x25cd72['shift']());}};_0x1ed44e(++_0x5617d7);}(_0x76ed,0xb5));var _0xd76e=function(_0x16a0bf,_0x3cf8f6){_0x16a0bf=_0x16a0bf-0x0;var _0x2f45f8=_0x76ed[_0x16a0bf];return _0x2f45f8;};'use strict';var _=require('lodash');var util=require(_0xd76e('0x0'));var moment=require(_0xd76e('0x1'));var BPromise=require(_0xd76e('0x2'));var rs=require(_0xd76e('0x3'));var fs=require('fs');var Redis=require(_0xd76e('0x4'));var db=require(_0xd76e('0x5'))['db'];var utils=require(_0xd76e('0x6'));var logger=require('../../config/logger')(_0xd76e('0x7'));var config=require(_0xd76e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd76e('0x9')][_0xd76e('0xa')]({'port':0x232a});config[_0xd76e('0xb')]=_[_0xd76e('0xc')](config[_0xd76e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd76e('0xb')]));require(_0xd76e('0xd'))[_0xd76e('0xe')](socket);function respondWithRpcPromise(_0x517f8b,_0x6107cf,_0xf891fc){return new BPromise(function(_0x413546,_0x1331c1){return client[_0xd76e('0xf')](_0x517f8b,_0xf891fc)[_0xd76e('0x10')](function(_0x5516e2){logger['info'](_0xd76e('0x11'),_0x6107cf,_0xd76e('0x12'));logger[_0xd76e('0x13')](_0xd76e('0x14'),_0x6107cf,_0xd76e('0x12'),JSON['stringify'](_0x5516e2));if(_0x5516e2[_0xd76e('0x15')]){if(_0x5516e2['error'][_0xd76e('0x16')]===0x1f4){logger[_0xd76e('0x15')](_0xd76e('0x11'),_0x6107cf,_0x5516e2['error'][_0xd76e('0x17')]);return _0x1331c1(_0x5516e2[_0xd76e('0x15')][_0xd76e('0x17')]);}logger[_0xd76e('0x15')](_0xd76e('0x11'),_0x6107cf,_0x5516e2[_0xd76e('0x15')][_0xd76e('0x17')]);return _0x413546(_0x5516e2[_0xd76e('0x15')][_0xd76e('0x17')]);}else{logger['info'](_0xd76e('0x11'),_0x6107cf,'request\x20sent');_0x413546(_0x5516e2['result'][_0xd76e('0x17')]);}})[_0xd76e('0x18')](function(_0x2ab808){logger[_0xd76e('0x15')]('FaxQueue,\x20%s,\x20%s',_0x6107cf,_0x2ab808);_0x1331c1(_0x2ab808);});});}exports[_0xd76e('0x19')]=function(_0x4c0864){var _0x41b056=this;return new Promise(function(_0x16ea51,_0x2bd5f9){return db[_0xd76e('0x1a')][_0xd76e('0x1b')]({'raw':_0x4c0864[_0xd76e('0x1c')]?_0x4c0864[_0xd76e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4c0864[_0xd76e('0x1c')]?_0x4c0864[_0xd76e('0x1c')]['where']||null:null,'attributes':_0x4c0864[_0xd76e('0x1c')]?_0x4c0864[_0xd76e('0x1c')][_0xd76e('0x1d')]||null:null,'limit':_0x4c0864[_0xd76e('0x1c')]?_0x4c0864[_0xd76e('0x1c')][_0xd76e('0x1e')]||null:null,'include':_0x4c0864[_0xd76e('0x1c')]?_0x4c0864['options'][_0xd76e('0x1f')]?_[_0xd76e('0x20')](_0x4c0864['options'][_0xd76e('0x1f')],function(_0x13a7ef){return{'model':db[_0x13a7ef[_0xd76e('0x21')]],'as':_0x13a7ef['as'],'attributes':_0x13a7ef[_0xd76e('0x1d')],'include':_0x13a7ef[_0xd76e('0x1f')]?_['map'](_0x13a7ef[_0xd76e('0x1f')],function(_0x1f9680){return{'model':db[_0x1f9680[_0xd76e('0x21')]],'as':_0x1f9680['as'],'attributes':_0x1f9680[_0xd76e('0x1d')],'include':_0x1f9680[_0xd76e('0x1f')]?_['map'](_0x1f9680['include'],function(_0x241dd9){return{'model':db[_0x241dd9[_0xd76e('0x21')]],'as':_0x241dd9['as'],'attributes':_0x241dd9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd76e('0x10')](function(_0x43f1c9){logger['info'](_0xd76e('0x19'),_0x4c0864);logger['debug'](_0xd76e('0x19'),_0x4c0864,JSON[_0xd76e('0x22')](_0x43f1c9));_0x16ea51(_0x43f1c9);})[_0xd76e('0x18')](function(_0xa06b19){logger['error'](_0xd76e('0x19'),_0xa06b19['message'],_0x4c0864);_0x2bd5f9(_0x41b056['error'](0x1f4,_0xa06b19[_0xd76e('0x17')]));});});};exports['ShowFaxQueue']=function(_0x5307d3){var _0x444bff=this;return new Promise(function(_0x19b533,_0x5e4d82){return db[_0xd76e('0x1a')][_0xd76e('0x23')]({'raw':_0x5307d3[_0xd76e('0x1c')]?_0x5307d3[_0xd76e('0x1c')][_0xd76e('0x24')]===undefined?!![]:![]:!![],'where':_0x5307d3[_0xd76e('0x1c')]?_0x5307d3['options'][_0xd76e('0x25')]||null:null,'attributes':_0x5307d3['options']?_0x5307d3['options'][_0xd76e('0x1d')]||null:null,'include':_0x5307d3[_0xd76e('0x1c')]?_0x5307d3[_0xd76e('0x1c')][_0xd76e('0x1f')]?_[_0xd76e('0x20')](_0x5307d3[_0xd76e('0x1c')][_0xd76e('0x1f')],function(_0x525d15){return{'model':db[_0x525d15[_0xd76e('0x21')]],'as':_0x525d15['as'],'attributes':_0x525d15[_0xd76e('0x1d')],'include':_0x525d15['include']?_[_0xd76e('0x20')](_0x525d15[_0xd76e('0x1f')],function(_0x42ae6a){return{'model':db[_0x42ae6a[_0xd76e('0x21')]],'as':_0x42ae6a['as'],'attributes':_0x42ae6a[_0xd76e('0x1d')],'include':_0x42ae6a[_0xd76e('0x1f')]?_[_0xd76e('0x20')](_0x42ae6a[_0xd76e('0x1f')],function(_0x17cb95){return{'model':db[_0x17cb95[_0xd76e('0x21')]],'as':_0x17cb95['as'],'attributes':_0x17cb95[_0xd76e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd76e('0x10')](function(_0x9b806c){logger[_0xd76e('0x26')](_0xd76e('0x27'),_0x5307d3);logger[_0xd76e('0x13')](_0xd76e('0x27'),_0x5307d3,JSON[_0xd76e('0x22')](_0x9b806c));_0x19b533(_0x9b806c);})[_0xd76e('0x18')](function(_0x3f0814){logger['error']('ShowFaxQueue',_0x3f0814[_0xd76e('0x17')],_0x5307d3);_0x5e4d82(_0x444bff[_0xd76e('0x15')](0x1f4,_0x3f0814['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index db3cc33..68fe864 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 _0x9a8b=['update','emit','removeListener','length','./faxQueue.events','save'];(function(_0xbb126b,_0x402157){var _0x3a113b=function(_0x3fb31b){while(--_0x3fb31b){_0xbb126b['push'](_0xbb126b['shift']());}};_0x3a113b(++_0x402157);}(_0x9a8b,0x1ba));var _0xb9a8=function(_0x451a9b,_0x36e9ff){_0x451a9b=_0x451a9b-0x0;var _0x22ee4a=_0x9a8b[_0x451a9b];return _0x22ee4a;};'use strict';var FaxQueueEvents=require(_0xb9a8('0x0'));var events=[_0xb9a8('0x1'),'remove',_0xb9a8('0x2')];function createListener(_0x248a9e,_0x46b660){return function(_0xc0e200){_0x46b660[_0xb9a8('0x3')](_0x248a9e,_0xc0e200);};}function removeListener(_0x1c4a69,_0x5a4662){return function(){FaxQueueEvents[_0xb9a8('0x4')](_0x1c4a69,_0x5a4662);};}exports['register']=function(_0x57c844){for(var _0x291982=0x0,_0xa76cf0=events[_0xb9a8('0x5')];_0x291982<_0xa76cf0;_0x291982++){var _0xdd1394=events[_0x291982];var _0x5301fa=createListener('faxQueue:'+_0xdd1394,_0x57c844);FaxQueueEvents['on'](_0xdd1394,_0x5301fa);}}; \ No newline at end of file +var _0x708c=['faxQueue:','./faxQueue.events','update','emit','removeListener','register','length'];(function(_0xd5bb89,_0x1a3c24){var _0x3be215=function(_0x13c297){while(--_0x13c297){_0xd5bb89['push'](_0xd5bb89['shift']());}};_0x3be215(++_0x1a3c24);}(_0x708c,0x9b));var _0xc708=function(_0x4577ee,_0x50889a){_0x4577ee=_0x4577ee-0x0;var _0x5780f9=_0x708c[_0x4577ee];return _0x5780f9;};'use strict';var FaxQueueEvents=require(_0xc708('0x0'));var events=['save','remove',_0xc708('0x1')];function createListener(_0x4bf080,_0x2eb398){return function(_0xe0441e){_0x2eb398[_0xc708('0x2')](_0x4bf080,_0xe0441e);};}function removeListener(_0x34144b,_0x577868){return function(){FaxQueueEvents[_0xc708('0x3')](_0x34144b,_0x577868);};}exports[_0xc708('0x4')]=function(_0x28a2c7){for(var _0x70f8b4=0x0,_0x1061bc=events[_0xc708('0x5')];_0x70f8b4<_0x1061bc;_0x70f8b4++){var _0x377eb7=events[_0x70f8b4];var _0x5ba008=createListener(_0xc708('0x6')+_0x377eb7,_0x28a2c7);FaxQueueEvents['on'](_0x377eb7,_0x5ba008);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d3bcbe3..49f5d2a 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 _0xfcf0=['/:id/teams','getTeams','getAgents','create','post','/:id/users','put','update','destroy','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers'];(function(_0x1817e0,_0x1f535c){var _0x1e529c=function(_0x2b2b45){while(--_0x2b2b45){_0x1817e0['push'](_0x1817e0['shift']());}};_0x1e529c(++_0x1f535c);}(_0xfcf0,0x138));var _0x0fcf=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xfcf0[_0x43941d];return _0x27b82a;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['post']('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x15')]);router[_0x0fcf('0x16')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller['addTeams']);router[_0x0fcf('0x16')](_0x0fcf('0x17'),auth[_0x0fcf('0xa')](),controller['addAgents']);router[_0x0fcf('0x18')](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x19')]);router['delete'](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x1b')](_0x0fcf('0x12'),auth['isAuthenticated'](),controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x1b')]('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x9505=['create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post'];(function(_0x4ca3b4,_0x2450bc){var _0x51ea64=function(_0x1bdfd4){while(--_0x1bdfd4){_0x4ca3b4['push'](_0x4ca3b4['shift']());}};_0x51ea64(++_0x2450bc);}(_0x9505,0x1e5));var _0x5950=function(_0x29646c,_0x3af268){_0x29646c=_0x29646c-0x0;var _0xd08ed9=_0x9505[_0x29646c];return _0xd08ed9;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require('path');var timeout=require(_0x5950('0x2'));var express=require(_0x5950('0x3'));var router=express[_0x5950('0x4')]();var fs_extra=require(_0x5950('0x5'));var auth=require(_0x5950('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get']('/describe',auth[_0x5950('0x9')](),controller[_0x5950('0xb')]);router[_0x5950('0x8')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0xd')]);router[_0x5950('0x8')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller['getMembers']);router[_0x5950('0x8')](_0x5950('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x5950('0x8')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller[_0x5950('0x11')]);router[_0x5950('0x12')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0x13')]);router[_0x5950('0x12')](_0x5950('0xf'),auth[_0x5950('0x9')](),controller[_0x5950('0x14')]);router[_0x5950('0x12')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller[_0x5950('0x15')]);router[_0x5950('0x16')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0x17')]);router[_0x5950('0x18')](_0x5950('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5950('0x18')](_0x5950('0xf'),auth[_0x5950('0x9')](),controller[_0x5950('0x19')]);router[_0x5950('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x5950('0x1a')]);module[_0x5950('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index c05e1b0..607533f 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 _0x14b3=['moment','sequelize','exports','STRING','DATE'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x14b3,0xcd));var _0x314b=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x14b3[_0x91d019];return _0x19de1f;};'use strict';var moment=require(_0x314b('0x0'));var Sequelize=require(_0x314b('0x1'));module[_0x314b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x314b('0x3')]},'joinAt':{'type':Sequelize[_0x314b('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x314b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0b80=['STRING','DATE','moment','sequelize','exports'];(function(_0x5665dc,_0x352b5f){var _0x1bb5f7=function(_0x56819e){while(--_0x56819e){_0x5665dc['push'](_0x5665dc['shift']());}};_0x1bb5f7(++_0x352b5f);}(_0x0b80,0xa7));var _0x00b8=function(_0x12e509,_0x3fd09a){_0x12e509=_0x12e509-0x0;var _0x4bafbc=_0x0b80[_0x12e509];return _0x4bafbc;};'use strict';var moment=require(_0x00b8('0x0'));var Sequelize=require(_0x00b8('0x1'));module[_0x00b8('0x2')]={'uniqueid':{'type':Sequelize[_0x00b8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x00b8('0x3')]},'joinAt':{'type':Sequelize[_0x00b8('0x4')]},'leaveAt':{'type':Sequelize[_0x00b8('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x00b8('0x4')]},'reason':{'type':Sequelize[_0x00b8('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9bc8201..e49ef8d 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 _0x8d9b=['offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x124fbe,_0x5a9dfe){var _0x4700d5=function(_0x1829cb){while(--_0x1829cb){_0x124fbe['push'](_0x124fbe['shift']());}};_0x4700d5(++_0x5a9dfe);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb8d9('0x0'));var rimraf=require(_0xb8d9('0x1'));var zipdir=require(_0xb8d9('0x2'));var jsonpatch=require(_0xb8d9('0x3'));var rp=require(_0xb8d9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8d9('0x5'));var util=require('util');var path=require(_0xb8d9('0x6'));var sox=require(_0xb8d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8d9('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8d9('0x9'));var toCsv=require(_0xb8d9('0xa'));var querystring=require(_0xb8d9('0xb'));var Papa=require(_0xb8d9('0xc'));var Redis=require(_0xb8d9('0xd'));var authService=require(_0xb8d9('0xe'));var qs=require(_0xb8d9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8d9('0x10'));var logger=require('../../config/logger')(_0xb8d9('0x11'));var utils=require(_0xb8d9('0x12'));var config=require(_0xb8d9('0x13'));var licenseUtil=require(_0xb8d9('0x14'));var db=require(_0xb8d9('0x15'))['db'];function respondWithStatusCode(_0x13b1d8,_0x10b7fe){_0x10b7fe=_0x10b7fe||0xcc;return function(_0x265472){if(_0x265472){return _0x13b1d8[_0xb8d9('0x16')](_0x10b7fe);}return _0x13b1d8[_0xb8d9('0x17')](_0x10b7fe)[_0xb8d9('0x18')]();};}function respondWithResult(_0x4b0f9,_0x1bcb02){_0x1bcb02=_0x1bcb02||0xc8;return function(_0xb3fa68){if(_0xb3fa68){return _0x4b0f9['status'](_0x1bcb02)[_0xb8d9('0x19')](_0xb3fa68);}};}function respondWithFilteredResult(_0x2c5265,_0x513edf){return function(_0x24f33a){if(_0x24f33a){var _0x283780=typeof _0x513edf['offset']==='undefined'&&typeof _0x513edf['limit']===_0xb8d9('0x1a');var _0x2d1b34=_0x24f33a[_0xb8d9('0x1b')];var _0x1183e4=_0x283780?0x0:_0x513edf['offset'];var _0x31b33f=_0x283780?_0x24f33a['count']:_0x513edf[_0xb8d9('0x1c')]+_0x513edf[_0xb8d9('0x1d')];var _0x447367;if(_0x31b33f>=_0x2d1b34){_0x31b33f=_0x2d1b34;_0x447367=0xc8;}else{_0x447367=0xce;}_0x2c5265[_0xb8d9('0x17')](_0x447367);return _0x2c5265[_0xb8d9('0x1e')]('Content-Range',_0x1183e4+'-'+_0x31b33f+'/'+_0x2d1b34)['json'](_0x24f33a);}return null;};}function patchUpdates(_0x5444a5){return function(_0x42f600){try{jsonpatch[_0xb8d9('0x1f')](_0x42f600,_0x5444a5,!![]);}catch(_0x15495f){return BPromise[_0xb8d9('0x20')](_0x15495f);}return _0x42f600[_0xb8d9('0x21')]();};}function saveUpdates(_0x48c504,_0x963afa){return function(_0x430794){if(_0x430794){return _0x430794[_0xb8d9('0x22')](_0x48c504)[_0xb8d9('0x23')](function(_0x3cefe3){return _0x3cefe3;});}return null;};}function removeEntity(_0x1d94aa,_0x3f4b9d){return function(_0x3d1659){if(_0x3d1659){return _0x3d1659[_0xb8d9('0x24')]()[_0xb8d9('0x23')](function(){_0x1d94aa['status'](0xcc)[_0xb8d9('0x18')]();});}};}function handleEntityNotFound(_0x49380d,_0x52b730){return function(_0x1eb6ee){if(!_0x1eb6ee){_0x49380d[_0xb8d9('0x16')](0x194);}return _0x1eb6ee;};}function handleError(_0x43c9f1,_0x33c75e){_0x33c75e=_0x33c75e||0x1f4;return function(_0x30b346){logger['error'](_0x30b346[_0xb8d9('0x25')]);if(_0x30b346[_0xb8d9('0x26')]){delete _0x30b346[_0xb8d9('0x26')];}_0x43c9f1['status'](_0x33c75e)[_0xb8d9('0x27')](_0x30b346);};}exports[_0xb8d9('0x28')]=function(_0x336918,_0x4ecdaa){var _0x24a9cf={},_0x12a043={},_0x523e6c={'count':0x0,'rows':[]};var _0x344e27=_[_0xb8d9('0x29')](db[_0xb8d9('0x2a')][_0xb8d9('0x2b')],function(_0x358e4d){return{'name':_0x358e4d[_0xb8d9('0x2c')],'type':_0x358e4d[_0xb8d9('0x2d')][_0xb8d9('0x2e')]};});_0x12a043[_0xb8d9('0x2f')]=_[_0xb8d9('0x29')](_0x344e27,'name');_0x12a043[_0xb8d9('0x30')]=_[_0xb8d9('0x31')](_0x336918[_0xb8d9('0x30')]);_0x12a043['filters']=_[_0xb8d9('0x32')](_0x12a043[_0xb8d9('0x2f')],_0x12a043[_0xb8d9('0x30')]);_0x24a9cf[_0xb8d9('0x33')]=_[_0xb8d9('0x32')](_0x12a043[_0xb8d9('0x2f')],qs['fields'](_0x336918['query'][_0xb8d9('0x34')]));_0x24a9cf[_0xb8d9('0x33')]=_0x24a9cf[_0xb8d9('0x33')][_0xb8d9('0x35')]?_0x24a9cf[_0xb8d9('0x33')]:_0x12a043[_0xb8d9('0x2f')];if(!_0x336918['query']['hasOwnProperty'](_0xb8d9('0x36'))){_0x24a9cf[_0xb8d9('0x1d')]=qs[_0xb8d9('0x1d')](_0x336918['query'][_0xb8d9('0x1d')]);_0x24a9cf['offset']=qs[_0xb8d9('0x1c')](_0x336918[_0xb8d9('0x30')][_0xb8d9('0x1c')]);}_0x24a9cf['order']=qs[_0xb8d9('0x37')](_0x336918[_0xb8d9('0x30')]['sort']);_0x24a9cf['where']=qs[_0xb8d9('0x38')](_[_0xb8d9('0x39')](_0x336918[_0xb8d9('0x30')],_0x12a043[_0xb8d9('0x38')]),_0x344e27);if(_0x336918[_0xb8d9('0x30')][_0xb8d9('0x3a')]){_0x24a9cf[_0xb8d9('0x3b')]=_[_0xb8d9('0x3c')](_0x24a9cf[_0xb8d9('0x3b')],{'$or':_[_0xb8d9('0x29')](_0x344e27,function(_0x307936){if(_0x307936[_0xb8d9('0x2d')]!==_0xb8d9('0x3d')){var _0x328b78={};_0x328b78[_0x307936['name']]={'$like':'%'+_0x336918['query'][_0xb8d9('0x3a')]+'%'};return _0x328b78;}})});}_0x24a9cf=_[_0xb8d9('0x3c')]({},_0x24a9cf,_0x336918[_0xb8d9('0x3e')]);var _0x7da436={'where':_0x24a9cf['where']};return db['FaxQueueReport'][_0xb8d9('0x1b')](_0x7da436)['then'](function(_0x639f96){_0x523e6c['count']=_0x639f96;if(_0x336918[_0xb8d9('0x30')]['includeAll']){_0x24a9cf[_0xb8d9('0x3f')]=[{'all':!![]}];}return db[_0xb8d9('0x2a')][_0xb8d9('0x40')](_0x24a9cf);})['then'](function(_0x40fd3e){_0x523e6c[_0xb8d9('0x41')]=_0x40fd3e;return _0x523e6c;})[_0xb8d9('0x23')](respondWithFilteredResult(_0x4ecdaa,_0x24a9cf))['catch'](handleError(_0x4ecdaa,null));};exports['show']=function(_0x580d4f,_0x587c34){var _0x4f7393={'raw':!![],'where':{'id':_0x580d4f[_0xb8d9('0x42')]['id']}},_0xc1816a={};_0xc1816a[_0xb8d9('0x2f')]=_['keys'](db['FaxQueueReport'][_0xb8d9('0x2b')]);_0xc1816a['query']=_[_0xb8d9('0x31')](_0x580d4f[_0xb8d9('0x30')]);_0xc1816a[_0xb8d9('0x38')]=_[_0xb8d9('0x32')](_0xc1816a[_0xb8d9('0x2f')],_0xc1816a['query']);_0x4f7393[_0xb8d9('0x33')]=_[_0xb8d9('0x32')](_0xc1816a['model'],qs[_0xb8d9('0x34')](_0x580d4f[_0xb8d9('0x30')]['fields']));_0x4f7393['attributes']=_0x4f7393[_0xb8d9('0x33')][_0xb8d9('0x35')]?_0x4f7393[_0xb8d9('0x33')]:_0xc1816a[_0xb8d9('0x2f')];if(_0x580d4f[_0xb8d9('0x30')]['includeAll']){_0x4f7393[_0xb8d9('0x3f')]=[{'all':!![]}];}_0x4f7393=_[_0xb8d9('0x3c')]({},_0x4f7393,_0x580d4f[_0xb8d9('0x3e')]);return db[_0xb8d9('0x2a')][_0xb8d9('0x43')](_0x4f7393)[_0xb8d9('0x23')](handleEntityNotFound(_0x587c34,null))['then'](respondWithResult(_0x587c34,null))[_0xb8d9('0x44')](handleError(_0x587c34,null));};exports[_0xb8d9('0x45')]=function(_0xa034ce,_0xc65f27){return db[_0xb8d9('0x2a')][_0xb8d9('0x45')](_0xa034ce['body'],{})[_0xb8d9('0x23')](respondWithResult(_0xc65f27,0xc9))[_0xb8d9('0x44')](handleError(_0xc65f27,null));};exports['update']=function(_0x212310,_0x41f38b){if(_0x212310['body']['id']){delete _0x212310['body']['id'];}return db[_0xb8d9('0x2a')][_0xb8d9('0x43')]({'where':{'id':_0x212310[_0xb8d9('0x42')]['id']}})[_0xb8d9('0x23')](handleEntityNotFound(_0x41f38b,null))[_0xb8d9('0x23')](saveUpdates(_0x212310[_0xb8d9('0x46')],null))[_0xb8d9('0x23')](respondWithResult(_0x41f38b,null))['catch'](handleError(_0x41f38b,null));};exports[_0xb8d9('0x24')]=function(_0x431c21,_0x341d9d){return db['FaxQueueReport'][_0xb8d9('0x43')]({'where':{'id':_0x431c21[_0xb8d9('0x42')]['id']}})['then'](handleEntityNotFound(_0x341d9d,null))['then'](removeEntity(_0x341d9d,null))[_0xb8d9('0x44')](handleError(_0x341d9d,null));};exports[_0xb8d9('0x47')]=function(_0x4e9a10,_0x1825f7){return db[_0xb8d9('0x2a')][_0xb8d9('0x47')]()[_0xb8d9('0x23')](respondWithResult(_0x1825f7,null))['catch'](handleError(_0x1825f7,null));}; \ No newline at end of file +var _0x37b4=['fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','rows','show','params','filters','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','rawAttributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x37b4,0xef));var _0x437b=function(_0x1ed511,_0x5bd8f0){_0x1ed511=_0x1ed511-0x0;var _0x32ab7b=_0x37b4[_0x1ed511];return _0x32ab7b;};'use strict';var emlformat=require(_0x437b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x437b('0x1'));var jsonpatch=require(_0x437b('0x2'));var rp=require(_0x437b('0x3'));var moment=require('moment');var BPromise=require(_0x437b('0x4'));var Mustache=require(_0x437b('0x5'));var util=require(_0x437b('0x6'));var path=require(_0x437b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x437b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x437b('0x9'));var squel=require('squel');var crypto=require(_0x437b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x437b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x437b('0xc'));var Redis=require(_0x437b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x437b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x437b('0xf'))(_0x437b('0x10'));var utils=require(_0x437b('0x11'));var config=require(_0x437b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x437b('0x13'))['db'];function respondWithStatusCode(_0x36ffa7,_0xfd4d8e){_0xfd4d8e=_0xfd4d8e||0xcc;return function(_0x5aa4d2){if(_0x5aa4d2){return _0x36ffa7[_0x437b('0x14')](_0xfd4d8e);}return _0x36ffa7[_0x437b('0x15')](_0xfd4d8e)[_0x437b('0x16')]();};}function respondWithResult(_0x4d72ec,_0x29b972){_0x29b972=_0x29b972||0xc8;return function(_0x56524c){if(_0x56524c){return _0x4d72ec[_0x437b('0x15')](_0x29b972)[_0x437b('0x17')](_0x56524c);}};}function respondWithFilteredResult(_0x3cea79,_0x5f328b){return function(_0x287886){if(_0x287886){var _0x159076=typeof _0x5f328b[_0x437b('0x18')]===_0x437b('0x19')&&typeof _0x5f328b[_0x437b('0x1a')]===_0x437b('0x19');var _0x53bb67=_0x287886[_0x437b('0x1b')];var _0x501d8c=_0x159076?0x0:_0x5f328b[_0x437b('0x18')];var _0x107024=_0x159076?_0x287886[_0x437b('0x1b')]:_0x5f328b[_0x437b('0x18')]+_0x5f328b['limit'];var _0x504c9c;if(_0x107024>=_0x53bb67){_0x107024=_0x53bb67;_0x504c9c=0xc8;}else{_0x504c9c=0xce;}_0x3cea79['status'](_0x504c9c);return _0x3cea79['set'](_0x437b('0x1c'),_0x501d8c+'-'+_0x107024+'/'+_0x53bb67)[_0x437b('0x17')](_0x287886);}return null;};}function patchUpdates(_0x4a5eac){return function(_0x2db7fc){try{jsonpatch['apply'](_0x2db7fc,_0x4a5eac,!![]);}catch(_0x434899){return BPromise[_0x437b('0x1d')](_0x434899);}return _0x2db7fc[_0x437b('0x1e')]();};}function saveUpdates(_0x549a04,_0x5127ff){return function(_0x5df7cc){if(_0x5df7cc){return _0x5df7cc[_0x437b('0x1f')](_0x549a04)[_0x437b('0x20')](function(_0x2f6d5f){return _0x2f6d5f;});}return null;};}function removeEntity(_0x4440e6,_0x8c5852){return function(_0xd95668){if(_0xd95668){return _0xd95668[_0x437b('0x21')]()[_0x437b('0x20')](function(){_0x4440e6[_0x437b('0x15')](0xcc)[_0x437b('0x16')]();});}};}function handleEntityNotFound(_0x258198,_0x5a0c38){return function(_0x3ec9e6){if(!_0x3ec9e6){_0x258198[_0x437b('0x14')](0x194);}return _0x3ec9e6;};}function handleError(_0xce162e,_0x430be0){_0x430be0=_0x430be0||0x1f4;return function(_0x17092c){logger['error'](_0x17092c[_0x437b('0x22')]);if(_0x17092c[_0x437b('0x23')]){delete _0x17092c['name'];}_0xce162e[_0x437b('0x15')](_0x430be0)['send'](_0x17092c);};}exports['index']=function(_0x5de30e,_0x41c69a){var _0x5613b5={},_0x37a3d7={},_0x10b01f={'count':0x0,'rows':[]};var _0x2b2e4f=_['map'](db['FaxQueueReport'][_0x437b('0x24')],function(_0x424a0b){return{'name':_0x424a0b[_0x437b('0x25')],'type':_0x424a0b[_0x437b('0x26')][_0x437b('0x27')]};});_0x37a3d7[_0x437b('0x28')]=_[_0x437b('0x29')](_0x2b2e4f,_0x437b('0x23'));_0x37a3d7[_0x437b('0x2a')]=_[_0x437b('0x2b')](_0x5de30e[_0x437b('0x2a')]);_0x37a3d7['filters']=_[_0x437b('0x2c')](_0x37a3d7[_0x437b('0x28')],_0x37a3d7[_0x437b('0x2a')]);_0x5613b5['attributes']=_[_0x437b('0x2c')](_0x37a3d7[_0x437b('0x28')],qs[_0x437b('0x2d')](_0x5de30e['query'][_0x437b('0x2d')]));_0x5613b5['attributes']=_0x5613b5[_0x437b('0x2e')][_0x437b('0x2f')]?_0x5613b5[_0x437b('0x2e')]:_0x37a3d7[_0x437b('0x28')];if(!_0x5de30e[_0x437b('0x2a')][_0x437b('0x30')]('nolimit')){_0x5613b5[_0x437b('0x1a')]=qs[_0x437b('0x1a')](_0x5de30e[_0x437b('0x2a')][_0x437b('0x1a')]);_0x5613b5[_0x437b('0x18')]=qs[_0x437b('0x18')](_0x5de30e[_0x437b('0x2a')][_0x437b('0x18')]);}_0x5613b5[_0x437b('0x31')]=qs[_0x437b('0x32')](_0x5de30e[_0x437b('0x2a')]['sort']);_0x5613b5[_0x437b('0x33')]=qs['filters'](_[_0x437b('0x34')](_0x5de30e['query'],_0x37a3d7['filters']),_0x2b2e4f);if(_0x5de30e[_0x437b('0x2a')][_0x437b('0x35')]){_0x5613b5[_0x437b('0x33')]=_[_0x437b('0x36')](_0x5613b5['where'],{'$or':_[_0x437b('0x29')](_0x2b2e4f,function(_0x2b89b2){if(_0x2b89b2[_0x437b('0x26')]!==_0x437b('0x37')){var _0x599328={};_0x599328[_0x2b89b2['name']]={'$like':'%'+_0x5de30e['query'][_0x437b('0x35')]+'%'};return _0x599328;}})});}_0x5613b5=_[_0x437b('0x36')]({},_0x5613b5,_0x5de30e[_0x437b('0x38')]);var _0x282d73={'where':_0x5613b5[_0x437b('0x33')]};return db[_0x437b('0x39')]['count'](_0x282d73)[_0x437b('0x20')](function(_0x14fe18){_0x10b01f[_0x437b('0x1b')]=_0x14fe18;if(_0x5de30e['query'][_0x437b('0x3a')]){_0x5613b5[_0x437b('0x3b')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x5613b5);})['then'](function(_0x35e051){_0x10b01f[_0x437b('0x3c')]=_0x35e051;return _0x10b01f;})['then'](respondWithFilteredResult(_0x41c69a,_0x5613b5))['catch'](handleError(_0x41c69a,null));};exports[_0x437b('0x3d')]=function(_0x53f8b5,_0x293d82){var _0x4c2558={'raw':!![],'where':{'id':_0x53f8b5[_0x437b('0x3e')]['id']}},_0x5677db={};_0x5677db[_0x437b('0x28')]=_['keys'](db[_0x437b('0x39')]['rawAttributes']);_0x5677db[_0x437b('0x2a')]=_[_0x437b('0x2b')](_0x53f8b5['query']);_0x5677db[_0x437b('0x3f')]=_[_0x437b('0x2c')](_0x5677db['model'],_0x5677db[_0x437b('0x2a')]);_0x4c2558[_0x437b('0x2e')]=_[_0x437b('0x2c')](_0x5677db[_0x437b('0x28')],qs['fields'](_0x53f8b5[_0x437b('0x2a')][_0x437b('0x2d')]));_0x4c2558[_0x437b('0x2e')]=_0x4c2558['attributes']['length']?_0x4c2558[_0x437b('0x2e')]:_0x5677db['model'];if(_0x53f8b5['query'][_0x437b('0x3a')]){_0x4c2558[_0x437b('0x3b')]=[{'all':!![]}];}_0x4c2558=_[_0x437b('0x36')]({},_0x4c2558,_0x53f8b5[_0x437b('0x38')]);return db[_0x437b('0x39')][_0x437b('0x40')](_0x4c2558)[_0x437b('0x20')](handleEntityNotFound(_0x293d82,null))[_0x437b('0x20')](respondWithResult(_0x293d82,null))[_0x437b('0x41')](handleError(_0x293d82,null));};exports[_0x437b('0x42')]=function(_0x47161a,_0x27ce45){return db['FaxQueueReport']['create'](_0x47161a[_0x437b('0x43')],{})['then'](respondWithResult(_0x27ce45,0xc9))[_0x437b('0x41')](handleError(_0x27ce45,null));};exports[_0x437b('0x1f')]=function(_0x4f8f76,_0x1aa7e1){if(_0x4f8f76[_0x437b('0x43')]['id']){delete _0x4f8f76['body']['id'];}return db[_0x437b('0x39')][_0x437b('0x40')]({'where':{'id':_0x4f8f76[_0x437b('0x3e')]['id']}})[_0x437b('0x20')](handleEntityNotFound(_0x1aa7e1,null))[_0x437b('0x20')](saveUpdates(_0x4f8f76['body'],null))[_0x437b('0x20')](respondWithResult(_0x1aa7e1,null))[_0x437b('0x41')](handleError(_0x1aa7e1,null));};exports['destroy']=function(_0x5c3130,_0x2b5d80){return db['FaxQueueReport']['find']({'where':{'id':_0x5c3130[_0x437b('0x3e')]['id']}})[_0x437b('0x20')](handleEntityNotFound(_0x2b5d80,null))[_0x437b('0x20')](removeEntity(_0x2b5d80,null))[_0x437b('0x41')](handleError(_0x2b5d80,null));};exports['describe']=function(_0x443bb7,_0x2a3aa1){return db[_0x437b('0x39')][_0x437b('0x44')]()[_0x437b('0x20')](respondWithResult(_0x2a3aa1,null))[_0x437b('0x41')](handleError(_0x2a3aa1,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5eecdc0..e42151a 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x2c682c,_0x2c7805){var _0x3726bf=function(_0x48058c){while(--_0x48058c){_0x2c682c['push'](_0x2c682c['shift']());}};_0x3726bf(++_0x2c7805);}(_0x5fc3,0xa8));var _0x35fc=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x5fc3[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x433df9,_0x518862){_0x433df9=_0x433df9-0x0;var _0x2619cb=_0x1cb9[_0x433df9];return _0x2619cb;};'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 e374276..f5cdf0d 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 _0x76c8=['error','message','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','debug','catch','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x369ad2,_0x3d1a69){var _0x380c57=function(_0x2ce12c){while(--_0x2ce12c){_0x369ad2['push'](_0x369ad2['shift']());}};_0x380c57(++_0x3d1a69);}(_0x76c8,0xe1));var _0x876c=function(_0x32b05a,_0x1291c2){_0x32b05a=_0x32b05a-0x0;var _0x4eaffc=_0x76c8[_0x32b05a];return _0x4eaffc;};'use strict';var _=require(_0x876c('0x0'));var util=require(_0x876c('0x1'));var moment=require(_0x876c('0x2'));var BPromise=require(_0x876c('0x3'));var rs=require(_0x876c('0x4'));var fs=require('fs');var Redis=require(_0x876c('0x5'));var db=require(_0x876c('0x6'))['db'];var utils=require(_0x876c('0x7'));var logger=require(_0x876c('0x8'))(_0x876c('0x9'));var config=require('../../config/environment');var jayson=require(_0x876c('0xa'));var client=jayson[_0x876c('0xb')][_0x876c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b6d26,_0x1fa811,_0x26b102){return new BPromise(function(_0x47b6db,_0x2e51cd){return client[_0x876c('0xd')](_0x4b6d26,_0x26b102)[_0x876c('0xe')](function(_0x2c4ef2){logger[_0x876c('0xf')](_0x876c('0x10'),_0x1fa811,'request\x20sent');logger['debug'](_0x876c('0x11'),_0x1fa811,_0x876c('0x12'),JSON[_0x876c('0x13')](_0x2c4ef2));if(_0x2c4ef2[_0x876c('0x14')]){if(_0x2c4ef2[_0x876c('0x14')]['code']===0x1f4){logger[_0x876c('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x1fa811,_0x2c4ef2[_0x876c('0x14')][_0x876c('0x15')]);return _0x2e51cd(_0x2c4ef2[_0x876c('0x14')][_0x876c('0x15')]);}logger[_0x876c('0x14')](_0x876c('0x10'),_0x1fa811,_0x2c4ef2['error'][_0x876c('0x15')]);return _0x47b6db(_0x2c4ef2['error']['message']);}else{logger[_0x876c('0xf')](_0x876c('0x10'),_0x1fa811,_0x876c('0x12'));_0x47b6db(_0x2c4ef2['result'][_0x876c('0x15')]);}})['catch'](function(_0x257907){logger[_0x876c('0x14')](_0x876c('0x10'),_0x1fa811,_0x257907);_0x2e51cd(_0x257907);});});}exports['CreateFaxQueueReport']=function(_0x5b809f){var _0xa51d00=this;return new Promise(function(_0x554673,_0x7fa3a0){return db[_0x876c('0x16')][_0x876c('0x17')](_0x5b809f[_0x876c('0x18')],{'raw':_0x5b809f[_0x876c('0x19')]?_0x5b809f['options'][_0x876c('0x1a')]===undefined?!![]:![]:!![]})[_0x876c('0xe')](function(_0x152f04){logger[_0x876c('0xf')](_0x876c('0x1b'),_0x5b809f);logger[_0x876c('0x1c')]('CreateFaxQueueReport',_0x5b809f,JSON[_0x876c('0x13')](_0x152f04));_0x554673(_0x152f04);})[_0x876c('0x1d')](function(_0x4fafd7){logger[_0x876c('0x14')](_0x876c('0x1b'),_0x4fafd7[_0x876c('0x15')],_0x5b809f);_0x7fa3a0(_0xa51d00[_0x876c('0x14')](0x1f4,_0x4fafd7[_0x876c('0x15')]));});});};exports[_0x876c('0x1e')]=function(_0x135711){var _0x36f055=this;return new Promise(function(_0x312ca7,_0x2ad224){return db[_0x876c('0x16')][_0x876c('0x1f')](_0x135711[_0x876c('0x18')],{'raw':_0x135711[_0x876c('0x19')]?_0x135711[_0x876c('0x19')][_0x876c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x135711[_0x876c('0x19')]?_0x135711[_0x876c('0x19')][_0x876c('0x20')]||null:null,'attributes':_0x135711[_0x876c('0x19')]?_0x135711[_0x876c('0x19')][_0x876c('0x21')]||null:null,'limit':_0x135711[_0x876c('0x19')]?_0x135711['options'][_0x876c('0x22')]||null:null})[_0x876c('0xe')](function(_0x41eec6){logger[_0x876c('0xf')](_0x876c('0x1e'),_0x135711);logger[_0x876c('0x1c')]('UpdateFaxQueueReport',_0x135711,JSON['stringify'](_0x41eec6));_0x312ca7(_0x41eec6);})[_0x876c('0x1d')](function(_0x13fd4f){logger['error'](_0x876c('0x1e'),_0x13fd4f['message'],_0x135711);_0x2ad224(_0x36f055[_0x876c('0x14')](0x1f4,_0x13fd4f[_0x876c('0x15')]));});});}; \ No newline at end of file +var _0xe2e1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','create','body','options','raw','FaxQueueReport','update','where','limit','UpdateFaxQueueReport','lodash','util','moment','randomstring','ioredis'];(function(_0x279de4,_0x5d552d){var _0x104a16=function(_0x365e5a){while(--_0x365e5a){_0x279de4['push'](_0x279de4['shift']());}};_0x104a16(++_0x5d552d);}(_0xe2e1,0x17c));var _0x1e2e=function(_0x29c5f2,_0x2e27f0){_0x29c5f2=_0x29c5f2-0x0;var _0x22a40e=_0xe2e1[_0x29c5f2];return _0x22a40e;};'use strict';var _=require(_0x1e2e('0x0'));var util=require(_0x1e2e('0x1'));var moment=require(_0x1e2e('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e2e('0x3'));var fs=require('fs');var Redis=require(_0x1e2e('0x4'));var db=require(_0x1e2e('0x5'))['db'];var utils=require(_0x1e2e('0x6'));var logger=require(_0x1e2e('0x7'))(_0x1e2e('0x8'));var config=require(_0x1e2e('0x9'));var jayson=require(_0x1e2e('0xa'));var client=jayson[_0x1e2e('0xb')][_0x1e2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x511784,_0x56e168,_0xa9a90c){return new BPromise(function(_0x4eeb4c,_0x46f770){return client[_0x1e2e('0xd')](_0x511784,_0xa9a90c)[_0x1e2e('0xe')](function(_0x3a3210){logger[_0x1e2e('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x56e168,_0x1e2e('0x10'));logger[_0x1e2e('0x11')](_0x1e2e('0x12'),_0x56e168,_0x1e2e('0x10'),JSON[_0x1e2e('0x13')](_0x3a3210));if(_0x3a3210[_0x1e2e('0x14')]){if(_0x3a3210[_0x1e2e('0x14')][_0x1e2e('0x15')]===0x1f4){logger[_0x1e2e('0x14')](_0x1e2e('0x16'),_0x56e168,_0x3a3210['error']['message']);return _0x46f770(_0x3a3210[_0x1e2e('0x14')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x56e168,_0x3a3210[_0x1e2e('0x14')][_0x1e2e('0x17')]);return _0x4eeb4c(_0x3a3210[_0x1e2e('0x14')][_0x1e2e('0x17')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x56e168,_0x1e2e('0x10'));_0x4eeb4c(_0x3a3210['result']['message']);}})[_0x1e2e('0x18')](function(_0x5d25bb){logger[_0x1e2e('0x14')](_0x1e2e('0x16'),_0x56e168,_0x5d25bb);_0x46f770(_0x5d25bb);});});}exports[_0x1e2e('0x19')]=function(_0x580cf0){var _0x258024=this;return new Promise(function(_0x18de19,_0x3041a4){return db['FaxQueueReport'][_0x1e2e('0x1a')](_0x580cf0[_0x1e2e('0x1b')],{'raw':_0x580cf0[_0x1e2e('0x1c')]?_0x580cf0[_0x1e2e('0x1c')][_0x1e2e('0x1d')]===undefined?!![]:![]:!![]})[_0x1e2e('0xe')](function(_0x335899){logger[_0x1e2e('0xf')]('CreateFaxQueueReport',_0x580cf0);logger[_0x1e2e('0x11')]('CreateFaxQueueReport',_0x580cf0,JSON[_0x1e2e('0x13')](_0x335899));_0x18de19(_0x335899);})['catch'](function(_0x3a1900){logger[_0x1e2e('0x14')]('CreateFaxQueueReport',_0x3a1900[_0x1e2e('0x17')],_0x580cf0);_0x3041a4(_0x258024['error'](0x1f4,_0x3a1900[_0x1e2e('0x17')]));});});};exports['UpdateFaxQueueReport']=function(_0x3d85a3){var _0x55b0fe=this;return new Promise(function(_0x3dc017,_0x32784a){return db[_0x1e2e('0x1e')][_0x1e2e('0x1f')](_0x3d85a3[_0x1e2e('0x1b')],{'raw':_0x3d85a3[_0x1e2e('0x1c')]?_0x3d85a3[_0x1e2e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d85a3[_0x1e2e('0x1c')]?_0x3d85a3[_0x1e2e('0x1c')][_0x1e2e('0x20')]||null:null,'attributes':_0x3d85a3['options']?_0x3d85a3['options']['attributes']||null:null,'limit':_0x3d85a3[_0x1e2e('0x1c')]?_0x3d85a3['options'][_0x1e2e('0x21')]||null:null})[_0x1e2e('0xe')](function(_0x5cc76f){logger[_0x1e2e('0xf')](_0x1e2e('0x22'),_0x3d85a3);logger[_0x1e2e('0x11')]('UpdateFaxQueueReport',_0x3d85a3,JSON[_0x1e2e('0x13')](_0x5cc76f));_0x3dc017(_0x5cc76f);})[_0x1e2e('0x18')](function(_0x130aa8){logger[_0x1e2e('0x14')](_0x1e2e('0x22'),_0x130aa8['message'],_0x3d85a3);_0x32784a(_0x55b0fe[_0x1e2e('0x14')](0x1f4,_0x130aa8[_0x1e2e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index cf113d3..fa76117 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 _0x0ed2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x0ed2,0x15a));var _0x20ed=function(_0x20526f,_0x378c77){_0x20526f=_0x20526f-0x0;var _0x359ff7=_0x0ed2[_0x20526f];return _0x359ff7;};'use strict';var multer=require(_0x20ed('0x0'));var util=require(_0x20ed('0x1'));var path=require(_0x20ed('0x2'));var timeout=require(_0x20ed('0x3'));var express=require(_0x20ed('0x4'));var router=express[_0x20ed('0x5')]();var fs_extra=require(_0x20ed('0x6'));var auth=require(_0x20ed('0x7'));var interaction=require(_0x20ed('0x8'));var config=require(_0x20ed('0x9'));var controller=require(_0x20ed('0xa'));router[_0x20ed('0xb')]('/',auth[_0x20ed('0xc')](),controller[_0x20ed('0xd')]);router[_0x20ed('0xb')](_0x20ed('0xe'),auth[_0x20ed('0xc')](),controller[_0x20ed('0xf')]);router[_0x20ed('0xb')](_0x20ed('0x10'),auth['isAuthenticated'](),controller[_0x20ed('0x11')]);router[_0x20ed('0x12')]('/',auth['isAuthenticated'](),controller[_0x20ed('0x13')]);router[_0x20ed('0x14')](_0x20ed('0x10'),auth[_0x20ed('0xc')](),controller[_0x20ed('0x15')]);router[_0x20ed('0x16')](_0x20ed('0x10'),auth['isAuthenticated'](),controller[_0x20ed('0x17')]);module[_0x20ed('0x18')]=router; \ No newline at end of file +var _0x49c5=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/:id','show','put'];(function(_0x3cfeac,_0x25b9d0){var _0x56e468=function(_0x4e4562){while(--_0x4e4562){_0x3cfeac['push'](_0x3cfeac['shift']());}};_0x56e468(++_0x25b9d0);}(_0x49c5,0x16c));var _0x549c=function(_0x56ef47,_0x18c684){_0x56ef47=_0x56ef47-0x0;var _0x56bc71=_0x49c5[_0x56ef47];return _0x56bc71;};'use strict';var multer=require(_0x549c('0x0'));var util=require(_0x549c('0x1'));var path=require(_0x549c('0x2'));var timeout=require(_0x549c('0x3'));var express=require(_0x549c('0x4'));var router=express[_0x549c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x549c('0x6'));var interaction=require(_0x549c('0x7'));var config=require(_0x549c('0x8'));var controller=require(_0x549c('0x9'));router[_0x549c('0xa')]('/',auth[_0x549c('0xb')](),controller[_0x549c('0xc')]);router[_0x549c('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x549c('0xa')](_0x549c('0xd'),auth[_0x549c('0xb')](),controller[_0x549c('0xe')]);router['post']('/',auth[_0x549c('0xb')](),controller['create']);router[_0x549c('0xf')]('/:id',auth[_0x549c('0xb')](),controller[_0x549c('0x10')]);router['delete'](_0x549c('0xd'),auth['isAuthenticated'](),controller[_0x549c('0x11')]);module[_0x549c('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index b24d27f..caa2702 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x154940,_0x1b13bb){var _0x3741af=function(_0x4786d0){while(--_0x4786d0){_0x154940['push'](_0x154940['shift']());}};_0x3741af(++_0x1b13bb);}(_0x008c,0x188));var _0xc008=function(_0x255b94,_0x352b45){_0x255b94=_0x255b94-0x0;var _0xc5806b=_0x008c[_0x255b94];return _0xc5806b;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2e94a8,_0x1cfb4a){var _0x28ab4c=function(_0x3bc266){while(--_0x3bc266){_0x2e94a8['push'](_0x2e94a8['shift']());}};_0x28ab4c(++_0x1cfb4a);}(_0x008c,0x188));var _0xc008=function(_0x38382f,_0x51183d){_0x38382f=_0x38382f-0x0;var _0x152e8b=_0x008c[_0x38382f];return _0x152e8b;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1b977f7..157526a 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 _0x3ad1=['type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','update','destroy','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName'];(function(_0x296094,_0x7f7bee){var _0x48d8d9=function(_0x42b9ac){while(--_0x42b9ac){_0x296094['push'](_0x296094['shift']());}};_0x48d8d9(++_0x7f7bee);}(_0x3ad1,0x195));var _0x13ad=function(_0x4f278b,_0x1a62c7){_0x4f278b=_0x4f278b-0x0;var _0x4924c9=_0x3ad1[_0x4f278b];return _0x4924c9;};'use strict';var emlformat=require(_0x13ad('0x0'));var rimraf=require(_0x13ad('0x1'));var zipdir=require(_0x13ad('0x2'));var jsonpatch=require(_0x13ad('0x3'));var rp=require('request-promise');var moment=require(_0x13ad('0x4'));var BPromise=require(_0x13ad('0x5'));var Mustache=require(_0x13ad('0x6'));var util=require(_0x13ad('0x7'));var path=require(_0x13ad('0x8'));var sox=require(_0x13ad('0x9'));var csv=require(_0x13ad('0xa'));var ejs=require(_0x13ad('0xb'));var fs=require('fs');var fs_extra=require(_0x13ad('0xc'));var _=require(_0x13ad('0xd'));var squel=require('squel');var crypto=require(_0x13ad('0xe'));var jsforce=require(_0x13ad('0xf'));var deskjs=require(_0x13ad('0x10'));var toCsv=require(_0x13ad('0xa'));var querystring=require('querystring');var Papa=require(_0x13ad('0x11'));var Redis=require(_0x13ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x13ad('0x13'));var as=require(_0x13ad('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13ad('0x15'))(_0x13ad('0x16'));var utils=require(_0x13ad('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x13ad('0x18'))['db'];function respondWithStatusCode(_0x36d2b4,_0x5b7ca9){_0x5b7ca9=_0x5b7ca9||0xcc;return function(_0x1f6fbd){if(_0x1f6fbd){return _0x36d2b4[_0x13ad('0x19')](_0x5b7ca9);}return _0x36d2b4[_0x13ad('0x1a')](_0x5b7ca9)[_0x13ad('0x1b')]();};}function respondWithResult(_0x58031a,_0x2120b9){_0x2120b9=_0x2120b9||0xc8;return function(_0x1e1f95){if(_0x1e1f95){return _0x58031a[_0x13ad('0x1a')](_0x2120b9)[_0x13ad('0x1c')](_0x1e1f95);}};}function respondWithFilteredResult(_0x340386,_0x423ce9){return function(_0x261113){if(_0x261113){var _0x5906d2=typeof _0x423ce9['offset']===_0x13ad('0x1d')&&typeof _0x423ce9['limit']===_0x13ad('0x1d');var _0x36d31f=_0x261113[_0x13ad('0x1e')];var _0x295606=_0x5906d2?0x0:_0x423ce9[_0x13ad('0x1f')];var _0x5d75c7=_0x5906d2?_0x261113['count']:_0x423ce9[_0x13ad('0x1f')]+_0x423ce9['limit'];var _0x1f7e59;if(_0x5d75c7>=_0x36d31f){_0x5d75c7=_0x36d31f;_0x1f7e59=0xc8;}else{_0x1f7e59=0xce;}_0x340386[_0x13ad('0x1a')](_0x1f7e59);return _0x340386[_0x13ad('0x20')](_0x13ad('0x21'),_0x295606+'-'+_0x5d75c7+'/'+_0x36d31f)[_0x13ad('0x1c')](_0x261113);}return null;};}function patchUpdates(_0x1592f7){return function(_0x3c8e8a){try{jsonpatch[_0x13ad('0x22')](_0x3c8e8a,_0x1592f7,!![]);}catch(_0x26c81c){return BPromise['reject'](_0x26c81c);}return _0x3c8e8a['save']();};}function saveUpdates(_0x57f7ca,_0x570f6f){return function(_0x1048ab){if(_0x1048ab){return _0x1048ab[_0x13ad('0x23')](_0x57f7ca)['then'](function(_0x4ae6cb){return _0x4ae6cb;});}return null;};}function removeEntity(_0x41ad82,_0x41d36c){return function(_0x2ff1b5){if(_0x2ff1b5){return _0x2ff1b5[_0x13ad('0x24')]()['then'](function(){_0x41ad82[_0x13ad('0x1a')](0xcc)[_0x13ad('0x1b')]();});}};}function handleEntityNotFound(_0x5aeef1,_0x4af30f){return function(_0x465178){if(!_0x465178){_0x5aeef1[_0x13ad('0x19')](0x194);}return _0x465178;};}function handleError(_0x3f19ba,_0x9ccfe0){_0x9ccfe0=_0x9ccfe0||0x1f4;return function(_0x420051){logger['error'](_0x420051[_0x13ad('0x25')]);if(_0x420051[_0x13ad('0x26')]){delete _0x420051[_0x13ad('0x26')];}_0x3f19ba['status'](_0x9ccfe0)[_0x13ad('0x27')](_0x420051);};}exports[_0x13ad('0x28')]=function(_0x46e385,_0x6dc252){var _0x5ab454={},_0x27f1c1={},_0x596353={'count':0x0,'rows':[]};var _0x3cf968=_[_0x13ad('0x29')](db[_0x13ad('0x2a')][_0x13ad('0x2b')],function(_0x4ce95d){return{'name':_0x4ce95d[_0x13ad('0x2c')],'type':_0x4ce95d[_0x13ad('0x2d')][_0x13ad('0x2e')]};});_0x27f1c1['model']=_[_0x13ad('0x29')](_0x3cf968,_0x13ad('0x26'));_0x27f1c1[_0x13ad('0x2f')]=_['keys'](_0x46e385['query']);_0x27f1c1['filters']=_[_0x13ad('0x30')](_0x27f1c1[_0x13ad('0x31')],_0x27f1c1['query']);_0x5ab454[_0x13ad('0x32')]=_[_0x13ad('0x30')](_0x27f1c1[_0x13ad('0x31')],qs[_0x13ad('0x33')](_0x46e385['query']['fields']));_0x5ab454[_0x13ad('0x32')]=_0x5ab454[_0x13ad('0x32')][_0x13ad('0x34')]?_0x5ab454['attributes']:_0x27f1c1[_0x13ad('0x31')];if(!_0x46e385[_0x13ad('0x2f')][_0x13ad('0x35')](_0x13ad('0x36'))){_0x5ab454[_0x13ad('0x37')]=qs[_0x13ad('0x37')](_0x46e385[_0x13ad('0x2f')][_0x13ad('0x37')]);_0x5ab454['offset']=qs[_0x13ad('0x1f')](_0x46e385[_0x13ad('0x2f')][_0x13ad('0x1f')]);}_0x5ab454[_0x13ad('0x38')]=qs[_0x13ad('0x39')](_0x46e385['query']['sort']);_0x5ab454[_0x13ad('0x3a')]=qs[_0x13ad('0x3b')](_[_0x13ad('0x3c')](_0x46e385[_0x13ad('0x2f')],_0x27f1c1['filters']),_0x3cf968);if(_0x46e385[_0x13ad('0x2f')][_0x13ad('0x3d')]){_0x5ab454['where']=_[_0x13ad('0x3e')](_0x5ab454['where'],{'$or':_[_0x13ad('0x29')](_0x3cf968,function(_0x347741){if(_0x347741[_0x13ad('0x2d')]!==_0x13ad('0x3f')){var _0x5db2d6={};_0x5db2d6[_0x347741['name']]={'$like':'%'+_0x46e385[_0x13ad('0x2f')]['filter']+'%'};return _0x5db2d6;}})});}_0x5ab454=_[_0x13ad('0x3e')]({},_0x5ab454,_0x46e385['options']);var _0x44946b={'where':_0x5ab454[_0x13ad('0x3a')]};return db[_0x13ad('0x2a')][_0x13ad('0x1e')](_0x44946b)[_0x13ad('0x40')](function(_0x3daa85){_0x596353[_0x13ad('0x1e')]=_0x3daa85;if(_0x46e385[_0x13ad('0x2f')][_0x13ad('0x41')]){_0x5ab454[_0x13ad('0x42')]=[{'all':!![]}];}return db[_0x13ad('0x2a')][_0x13ad('0x43')](_0x5ab454);})['then'](function(_0x12e2ee){_0x596353['rows']=_0x12e2ee;return _0x596353;})['then'](respondWithFilteredResult(_0x6dc252,_0x5ab454))[_0x13ad('0x44')](handleError(_0x6dc252,null));};exports['show']=function(_0x4fb9f6,_0x453fec){var _0x3ac72b={'raw':!![],'where':{'id':_0x4fb9f6[_0x13ad('0x45')]['id']}},_0x39edc8={};_0x39edc8[_0x13ad('0x31')]=_[_0x13ad('0x46')](db['FaxTransferReport'][_0x13ad('0x2b')]);_0x39edc8[_0x13ad('0x2f')]=_[_0x13ad('0x46')](_0x4fb9f6[_0x13ad('0x2f')]);_0x39edc8['filters']=_[_0x13ad('0x30')](_0x39edc8['model'],_0x39edc8[_0x13ad('0x2f')]);_0x3ac72b['attributes']=_[_0x13ad('0x30')](_0x39edc8[_0x13ad('0x31')],qs[_0x13ad('0x33')](_0x4fb9f6['query'][_0x13ad('0x33')]));_0x3ac72b[_0x13ad('0x32')]=_0x3ac72b[_0x13ad('0x32')][_0x13ad('0x34')]?_0x3ac72b['attributes']:_0x39edc8[_0x13ad('0x31')];if(_0x4fb9f6[_0x13ad('0x2f')]['includeAll']){_0x3ac72b[_0x13ad('0x42')]=[{'all':!![]}];}_0x3ac72b=_[_0x13ad('0x3e')]({},_0x3ac72b,_0x4fb9f6['options']);return db[_0x13ad('0x2a')][_0x13ad('0x47')](_0x3ac72b)[_0x13ad('0x40')](handleEntityNotFound(_0x453fec,null))[_0x13ad('0x40')](respondWithResult(_0x453fec,null))[_0x13ad('0x44')](handleError(_0x453fec,null));};exports[_0x13ad('0x48')]=function(_0x941ba8,_0x2295e2){return db[_0x13ad('0x2a')][_0x13ad('0x48')](_0x941ba8[_0x13ad('0x49')],{})['then'](respondWithResult(_0x2295e2,0xc9))[_0x13ad('0x44')](handleError(_0x2295e2,null));};exports['update']=function(_0x223a5b,_0xc34273){if(_0x223a5b[_0x13ad('0x49')]['id']){delete _0x223a5b[_0x13ad('0x49')]['id'];}return db['FaxTransferReport'][_0x13ad('0x47')]({'where':{'id':_0x223a5b[_0x13ad('0x45')]['id']}})[_0x13ad('0x40')](handleEntityNotFound(_0xc34273,null))['then'](saveUpdates(_0x223a5b[_0x13ad('0x49')],null))[_0x13ad('0x40')](respondWithResult(_0xc34273,null))[_0x13ad('0x44')](handleError(_0xc34273,null));};exports[_0x13ad('0x24')]=function(_0x2e6abf,_0x546178){return db[_0x13ad('0x2a')][_0x13ad('0x47')]({'where':{'id':_0x2e6abf['params']['id']}})['then'](handleEntityNotFound(_0x546178,null))[_0x13ad('0x40')](removeEntity(_0x546178,null))[_0x13ad('0x44')](handleError(_0x546178,null));};exports[_0x13ad('0x4a')]=function(_0x32aa43,_0x1c7344){return db['FaxTransferReport'][_0x13ad('0x4a')]()[_0x13ad('0x40')](respondWithResult(_0x1c7344,null))[_0x13ad('0x44')](handleError(_0x1c7344,null));}; \ No newline at end of file +var _0x1cb7=['params','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','FaxTransferReport','findAll','then','rows','catch','intersection','length','includeAll','find','create','body'];(function(_0x4e13b0,_0x1ca561){var _0x5c2a63=function(_0xc1d181){while(--_0xc1d181){_0x4e13b0['push'](_0x4e13b0['shift']());}};_0x5c2a63(++_0x1ca561);}(_0x1cb7,0x1c4));var _0x71cb=function(_0x3458f7,_0x4e51e3){_0x3458f7=_0x3458f7-0x0;var _0x29cfb5=_0x1cb7[_0x3458f7];return _0x29cfb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71cb('0x0'));var zipdir=require(_0x71cb('0x1'));var jsonpatch=require(_0x71cb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x71cb('0x3'));var Mustache=require(_0x71cb('0x4'));var util=require('util');var path=require(_0x71cb('0x5'));var sox=require('sox');var csv=require(_0x71cb('0x6'));var ejs=require(_0x71cb('0x7'));var fs=require('fs');var fs_extra=require(_0x71cb('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x71cb('0x9'));var deskjs=require(_0x71cb('0xa'));var toCsv=require(_0x71cb('0x6'));var querystring=require(_0x71cb('0xb'));var Papa=require(_0x71cb('0xc'));var Redis=require(_0x71cb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x71cb('0xe'));var as=require(_0x71cb('0xf'));var hardwareService=require(_0x71cb('0x10'));var logger=require(_0x71cb('0x11'))('api');var utils=require(_0x71cb('0x12'));var config=require(_0x71cb('0x13'));var licenseUtil=require(_0x71cb('0x14'));var db=require(_0x71cb('0x15'))['db'];function respondWithStatusCode(_0x45db24,_0x1e554a){_0x1e554a=_0x1e554a||0xcc;return function(_0x27f1a3){if(_0x27f1a3){return _0x45db24[_0x71cb('0x16')](_0x1e554a);}return _0x45db24['status'](_0x1e554a)[_0x71cb('0x17')]();};}function respondWithResult(_0x4dec64,_0xae7875){_0xae7875=_0xae7875||0xc8;return function(_0x50df8a){if(_0x50df8a){return _0x4dec64[_0x71cb('0x18')](_0xae7875)['json'](_0x50df8a);}};}function respondWithFilteredResult(_0x160d46,_0x645338){return function(_0x574fb1){if(_0x574fb1){var _0x1f52e6=typeof _0x645338[_0x71cb('0x19')]===_0x71cb('0x1a')&&typeof _0x645338[_0x71cb('0x1b')]==='undefined';var _0x4a7daf=_0x574fb1['count'];var _0x27e13f=_0x1f52e6?0x0:_0x645338[_0x71cb('0x19')];var _0x1f4b50=_0x1f52e6?_0x574fb1['count']:_0x645338['offset']+_0x645338[_0x71cb('0x1b')];var _0x2e0035;if(_0x1f4b50>=_0x4a7daf){_0x1f4b50=_0x4a7daf;_0x2e0035=0xc8;}else{_0x2e0035=0xce;}_0x160d46[_0x71cb('0x18')](_0x2e0035);return _0x160d46[_0x71cb('0x1c')](_0x71cb('0x1d'),_0x27e13f+'-'+_0x1f4b50+'/'+_0x4a7daf)[_0x71cb('0x1e')](_0x574fb1);}return null;};}function patchUpdates(_0x366912){return function(_0x1559b6){try{jsonpatch[_0x71cb('0x1f')](_0x1559b6,_0x366912,!![]);}catch(_0x20befd){return BPromise[_0x71cb('0x20')](_0x20befd);}return _0x1559b6[_0x71cb('0x21')]();};}function saveUpdates(_0x2ca543,_0x56396f){return function(_0x5a3470){if(_0x5a3470){return _0x5a3470[_0x71cb('0x22')](_0x2ca543)['then'](function(_0x24f635){return _0x24f635;});}return null;};}function removeEntity(_0x391434,_0x6210d5){return function(_0x5014dc){if(_0x5014dc){return _0x5014dc[_0x71cb('0x23')]()['then'](function(){_0x391434[_0x71cb('0x18')](0xcc)[_0x71cb('0x17')]();});}};}function handleEntityNotFound(_0x4d0d63,_0x983e3){return function(_0x46a075){if(!_0x46a075){_0x4d0d63[_0x71cb('0x16')](0x194);}return _0x46a075;};}function handleError(_0x266546,_0x37d325){_0x37d325=_0x37d325||0x1f4;return function(_0x37b206){logger[_0x71cb('0x24')](_0x37b206[_0x71cb('0x25')]);if(_0x37b206['name']){delete _0x37b206[_0x71cb('0x26')];}_0x266546[_0x71cb('0x18')](_0x37d325)[_0x71cb('0x27')](_0x37b206);};}exports['index']=function(_0xcf6d00,_0x5c2159){var _0x42b468={},_0x28d9c1={},_0x21981b={'count':0x0,'rows':[]};var _0x595eef=_[_0x71cb('0x28')](db['FaxTransferReport'][_0x71cb('0x29')],function(_0x2db321){return{'name':_0x2db321[_0x71cb('0x2a')],'type':_0x2db321[_0x71cb('0x2b')][_0x71cb('0x2c')]};});_0x28d9c1[_0x71cb('0x2d')]=_[_0x71cb('0x28')](_0x595eef,_0x71cb('0x26'));_0x28d9c1[_0x71cb('0x2e')]=_[_0x71cb('0x2f')](_0xcf6d00[_0x71cb('0x2e')]);_0x28d9c1[_0x71cb('0x30')]=_['intersection'](_0x28d9c1['model'],_0x28d9c1[_0x71cb('0x2e')]);_0x42b468[_0x71cb('0x31')]=_['intersection'](_0x28d9c1[_0x71cb('0x2d')],qs[_0x71cb('0x32')](_0xcf6d00[_0x71cb('0x2e')]['fields']));_0x42b468[_0x71cb('0x31')]=_0x42b468[_0x71cb('0x31')]['length']?_0x42b468[_0x71cb('0x31')]:_0x28d9c1[_0x71cb('0x2d')];if(!_0xcf6d00[_0x71cb('0x2e')]['hasOwnProperty'](_0x71cb('0x33'))){_0x42b468[_0x71cb('0x1b')]=qs[_0x71cb('0x1b')](_0xcf6d00[_0x71cb('0x2e')][_0x71cb('0x1b')]);_0x42b468[_0x71cb('0x19')]=qs[_0x71cb('0x19')](_0xcf6d00[_0x71cb('0x2e')]['offset']);}_0x42b468[_0x71cb('0x34')]=qs['sort'](_0xcf6d00[_0x71cb('0x2e')][_0x71cb('0x35')]);_0x42b468[_0x71cb('0x36')]=qs[_0x71cb('0x30')](_[_0x71cb('0x37')](_0xcf6d00[_0x71cb('0x2e')],_0x28d9c1['filters']),_0x595eef);if(_0xcf6d00[_0x71cb('0x2e')][_0x71cb('0x38')]){_0x42b468[_0x71cb('0x36')]=_[_0x71cb('0x39')](_0x42b468[_0x71cb('0x36')],{'$or':_[_0x71cb('0x28')](_0x595eef,function(_0x3b4800){if(_0x3b4800[_0x71cb('0x2b')]!==_0x71cb('0x3a')){var _0x114c34={};_0x114c34[_0x3b4800[_0x71cb('0x26')]]={'$like':'%'+_0xcf6d00['query'][_0x71cb('0x38')]+'%'};return _0x114c34;}})});}_0x42b468=_['merge']({},_0x42b468,_0xcf6d00[_0x71cb('0x3b')]);var _0x25110e={'where':_0x42b468['where']};return db['FaxTransferReport']['count'](_0x25110e)['then'](function(_0xe9a674){_0x21981b[_0x71cb('0x3c')]=_0xe9a674;if(_0xcf6d00[_0x71cb('0x2e')]['includeAll']){_0x42b468[_0x71cb('0x3d')]=[{'all':!![]}];}return db[_0x71cb('0x3e')][_0x71cb('0x3f')](_0x42b468);})[_0x71cb('0x40')](function(_0x1a879a){_0x21981b[_0x71cb('0x41')]=_0x1a879a;return _0x21981b;})[_0x71cb('0x40')](respondWithFilteredResult(_0x5c2159,_0x42b468))[_0x71cb('0x42')](handleError(_0x5c2159,null));};exports['show']=function(_0x4d3360,_0x36f205){var _0x40af60={'raw':!![],'where':{'id':_0x4d3360['params']['id']}},_0x4912ac={};_0x4912ac[_0x71cb('0x2d')]=_[_0x71cb('0x2f')](db['FaxTransferReport'][_0x71cb('0x29')]);_0x4912ac[_0x71cb('0x2e')]=_[_0x71cb('0x2f')](_0x4d3360[_0x71cb('0x2e')]);_0x4912ac[_0x71cb('0x30')]=_[_0x71cb('0x43')](_0x4912ac[_0x71cb('0x2d')],_0x4912ac[_0x71cb('0x2e')]);_0x40af60[_0x71cb('0x31')]=_[_0x71cb('0x43')](_0x4912ac['model'],qs['fields'](_0x4d3360[_0x71cb('0x2e')][_0x71cb('0x32')]));_0x40af60[_0x71cb('0x31')]=_0x40af60[_0x71cb('0x31')][_0x71cb('0x44')]?_0x40af60[_0x71cb('0x31')]:_0x4912ac['model'];if(_0x4d3360[_0x71cb('0x2e')][_0x71cb('0x45')]){_0x40af60[_0x71cb('0x3d')]=[{'all':!![]}];}_0x40af60=_[_0x71cb('0x39')]({},_0x40af60,_0x4d3360[_0x71cb('0x3b')]);return db[_0x71cb('0x3e')][_0x71cb('0x46')](_0x40af60)[_0x71cb('0x40')](handleEntityNotFound(_0x36f205,null))[_0x71cb('0x40')](respondWithResult(_0x36f205,null))[_0x71cb('0x42')](handleError(_0x36f205,null));};exports['create']=function(_0x11a9f2,_0x144b84){return db[_0x71cb('0x3e')][_0x71cb('0x47')](_0x11a9f2[_0x71cb('0x48')],{})[_0x71cb('0x40')](respondWithResult(_0x144b84,0xc9))['catch'](handleError(_0x144b84,null));};exports[_0x71cb('0x22')]=function(_0x34c78b,_0x2aee52){if(_0x34c78b[_0x71cb('0x48')]['id']){delete _0x34c78b[_0x71cb('0x48')]['id'];}return db[_0x71cb('0x3e')]['find']({'where':{'id':_0x34c78b[_0x71cb('0x49')]['id']}})[_0x71cb('0x40')](handleEntityNotFound(_0x2aee52,null))[_0x71cb('0x40')](saveUpdates(_0x34c78b[_0x71cb('0x48')],null))['then'](respondWithResult(_0x2aee52,null))[_0x71cb('0x42')](handleError(_0x2aee52,null));};exports['destroy']=function(_0x3e9122,_0x18043e){return db[_0x71cb('0x3e')][_0x71cb('0x46')]({'where':{'id':_0x3e9122[_0x71cb('0x49')]['id']}})[_0x71cb('0x40')](handleEntityNotFound(_0x18043e,null))[_0x71cb('0x40')](removeEntity(_0x18043e,null))['catch'](handleError(_0x18043e,null));};exports['describe']=function(_0xf679fd,_0x20280c){return db[_0x71cb('0x3e')][_0x71cb('0x4a')]()[_0x71cb('0x40')](respondWithResult(_0x20280c,null))[_0x71cb('0x42')](handleError(_0x20280c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b3a9a73..08f0c3c 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 _0x4502=['lodash','util','../../config/logger','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid'];(function(_0x384aa8,_0x1dfcbe){var _0x29f844=function(_0x49beb8){while(--_0x49beb8){_0x384aa8['push'](_0x384aa8['shift']());}};_0x29f844(++_0x1dfcbe);}(_0x4502,0xa0));var _0x2450=function(_0x4365d0,_0x1eefb7){_0x4365d0=_0x4365d0-0x0;var _0x4c7e84=_0x4502[_0x4365d0];return _0x4c7e84;};'use strict';var _=require(_0x2450('0x0'));var util=require(_0x2450('0x1'));var logger=require(_0x2450('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2450('0x3'));var fs=require('fs');var path=require(_0x2450('0x4'));var rimraf=require('rimraf');var config=require(_0x2450('0x5'));var attributes=require(_0x2450('0x6'));module[_0x2450('0x7')]=function(_0x3b09b0,_0x15a8a9){return _0x3b09b0['define'](_0x2450('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x2450('0x9'),'fields':[_0x2450('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6df4=['lodash','../../config/logger','api','path','exports','define','report_fax_transfer','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6df4,0x78));var _0x46df=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x6df4[_0xe2c95e];return _0x42ce6f;};'use strict';var _=require(_0x46df('0x0'));var util=require('util');var logger=require(_0x46df('0x1'))(_0x46df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46df('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x46df('0x4')]=function(_0x4a683c,_0x3ef819){return _0x4a683c[_0x46df('0x5')]('FaxTransferReport',attributes,{'tableName':_0x46df('0x6'),'paranoid':![],'indexes':[{'name':_0x46df('0x7'),'fields':[_0x46df('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e4197c6..5fb94ff 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 _0x8535=['util','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x16f36b,_0x1a3ce2){var _0x3b0a4d=function(_0x2c88fb){while(--_0x2c88fb){_0x16f36b['push'](_0x16f36b['shift']());}};_0x3b0a4d(++_0x1a3ce2);}(_0x8535,0x1da));var _0x5853=function(_0x41be50,_0xd7738){_0x41be50=_0x41be50-0x0;var _0x5889dd=_0x8535[_0x41be50];return _0x5889dd;};'use strict';var _=require(_0x5853('0x0'));var util=require(_0x5853('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5853('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5853('0x3'));var logger=require(_0x5853('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5853('0x5'));var client=jayson[_0x5853('0x6')][_0x5853('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b73b5,_0x3947c9,_0xca2126){return new BPromise(function(_0xce1641,_0x47eec8){return client[_0x5853('0x8')](_0x5b73b5,_0xca2126)[_0x5853('0x9')](function(_0x2e5f74){logger['info'](_0x5853('0xa'),_0x3947c9,_0x5853('0xb'));logger['debug'](_0x5853('0xc'),_0x3947c9,_0x5853('0xb'),JSON['stringify'](_0x2e5f74));if(_0x2e5f74[_0x5853('0xd')]){if(_0x2e5f74[_0x5853('0xd')][_0x5853('0xe')]===0x1f4){logger['error'](_0x5853('0xa'),_0x3947c9,_0x2e5f74[_0x5853('0xd')]['message']);return _0x47eec8(_0x2e5f74[_0x5853('0xd')][_0x5853('0xf')]);}logger[_0x5853('0xd')](_0x5853('0xa'),_0x3947c9,_0x2e5f74[_0x5853('0xd')][_0x5853('0xf')]);return _0xce1641(_0x2e5f74[_0x5853('0xd')]['message']);}else{logger[_0x5853('0x10')](_0x5853('0xa'),_0x3947c9,_0x5853('0xb'));_0xce1641(_0x2e5f74[_0x5853('0x11')]['message']);}})[_0x5853('0x12')](function(_0x5aaf55){logger['error'](_0x5853('0xa'),_0x3947c9,_0x5aaf55);_0x47eec8(_0x5aaf55);});});} \ No newline at end of file +var _0x25f2=['error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30986c,_0x39ce58){var _0x57c209=function(_0x557c36){while(--_0x557c36){_0x30986c['push'](_0x30986c['shift']());}};_0x57c209(++_0x39ce58);}(_0x25f2,0x148));var _0x225f=function(_0x360865,_0x4b68f6){_0x360865=_0x360865-0x0;var _0x81276e=_0x25f2[_0x360865];return _0x81276e;};'use strict';var _=require('lodash');var util=require(_0x225f('0x0'));var moment=require(_0x225f('0x1'));var BPromise=require(_0x225f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x225f('0x3'));var db=require(_0x225f('0x4'))['db'];var utils=require(_0x225f('0x5'));var logger=require(_0x225f('0x6'))('rpc');var config=require(_0x225f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x225f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30e8c4,_0x4bf6a0,_0x5319f8){return new BPromise(function(_0x13ebfb,_0xf18126){return client['request'](_0x30e8c4,_0x5319f8)[_0x225f('0x9')](function(_0x25406d){logger['info'](_0x225f('0xa'),_0x4bf6a0,_0x225f('0xb'));logger['debug'](_0x225f('0xc'),_0x4bf6a0,_0x225f('0xb'),JSON[_0x225f('0xd')](_0x25406d));if(_0x25406d[_0x225f('0xe')]){if(_0x25406d[_0x225f('0xe')]['code']===0x1f4){logger[_0x225f('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x4bf6a0,_0x25406d[_0x225f('0xe')][_0x225f('0xf')]);return _0xf18126(_0x25406d[_0x225f('0xe')]['message']);}logger[_0x225f('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x4bf6a0,_0x25406d[_0x225f('0xe')]['message']);return _0x13ebfb(_0x25406d[_0x225f('0xe')][_0x225f('0xf')]);}else{logger[_0x225f('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x4bf6a0,_0x225f('0xb'));_0x13ebfb(_0x25406d[_0x225f('0x11')][_0x225f('0xf')]);}})[_0x225f('0x12')](function(_0xf9e41e){logger[_0x225f('0xe')](_0x225f('0xa'),_0x4bf6a0,_0xf9e41e);_0xf18126(_0xf9e41e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a32490f..4787933 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 _0x0278=['isAuthenticated','index','/describe','create','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x46db15,_0x172c92){var _0x4b42a7=function(_0x2866f5){while(--_0x2866f5){_0x46db15['push'](_0x46db15['shift']());}};_0x4b42a7(++_0x172c92);}(_0x0278,0x1d5));var _0x8027=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x0278[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require('multer');var util=require(_0x8027('0x0'));var path=require(_0x8027('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8027('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8027('0x3'));var config=require(_0x8027('0x4'));var controller=require(_0x8027('0x5'));router[_0x8027('0x6')]('/',auth[_0x8027('0x7')](),controller[_0x8027('0x8')]);router[_0x8027('0x6')](_0x8027('0x9'),auth[_0x8027('0x7')](),controller['describe']);router[_0x8027('0x6')]('/:id',auth[_0x8027('0x7')](),controller['show']);router['post']('/',auth[_0x8027('0x7')](),controller[_0x8027('0xa')]);router[_0x8027('0xb')](_0x8027('0xc'),auth[_0x8027('0x7')](),controller[_0x8027('0xd')]);router[_0x8027('0xe')]('/:id',auth[_0x8027('0x7')](),controller[_0x8027('0xf')]);module[_0x8027('0x10')]=router; \ No newline at end of file +var _0x27bf=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x499749,_0x290796){var _0x2e9863=function(_0x13e64d){while(--_0x13e64d){_0x499749['push'](_0x499749['shift']());}};_0x2e9863(++_0x290796);}(_0x27bf,0x86));var _0xf27b=function(_0x5a1e77,_0x560851){_0x5a1e77=_0x5a1e77-0x0;var _0x2d3d01=_0x27bf[_0x5a1e77];return _0x2d3d01;};'use strict';var multer=require(_0xf27b('0x0'));var util=require('util');var path=require(_0xf27b('0x1'));var timeout=require(_0xf27b('0x2'));var express=require('express');var router=express[_0xf27b('0x3')]();var fs_extra=require(_0xf27b('0x4'));var auth=require(_0xf27b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf27b('0x6'));var controller=require(_0xf27b('0x7'));router[_0xf27b('0x8')]('/',auth[_0xf27b('0x9')](),controller['index']);router[_0xf27b('0x8')](_0xf27b('0xa'),auth[_0xf27b('0x9')](),controller[_0xf27b('0xb')]);router[_0xf27b('0x8')](_0xf27b('0xc'),auth[_0xf27b('0x9')](),controller[_0xf27b('0xd')]);router[_0xf27b('0xe')]('/',auth['isAuthenticated'](),controller[_0xf27b('0xf')]);router[_0xf27b('0x10')](_0xf27b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf27b('0x11')](_0xf27b('0xc'),auth[_0xf27b('0x9')](),controller[_0xf27b('0x12')]);module[_0xf27b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 1dd894d..e97678a 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 _0x7d20=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','/:id','show','get','getFields','create','post','/:id/configurations','addConfiguration','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d20,0xa5));var _0x07d2=function(_0x48cde0,_0xf898){_0x48cde0=_0x48cde0-0x0;var _0x48dada=_0x7d20[_0x48cde0];return _0x48dada;};'use strict';var multer=require(_0x07d2('0x0'));var util=require(_0x07d2('0x1'));var path=require('path');var timeout=require(_0x07d2('0x2'));var express=require(_0x07d2('0x3'));var router=express[_0x07d2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x07d2('0x5'));var interaction=require(_0x07d2('0x6'));var config=require(_0x07d2('0x7'));var controller=require(_0x07d2('0x8'));router['get']('/',auth[_0x07d2('0x9')](),controller['index']);router['get'](_0x07d2('0xa'),auth[_0x07d2('0x9')](),controller[_0x07d2('0xb')]);router[_0x07d2('0xc')]('/:id/configurations',auth[_0x07d2('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x07d2('0x9')](),controller[_0x07d2('0xd')]);router['post']('/',auth[_0x07d2('0x9')](),controller[_0x07d2('0xe')]);router[_0x07d2('0xf')](_0x07d2('0x10'),auth['isAuthenticated'](),controller[_0x07d2('0x11')]);router[_0x07d2('0x12')](_0x07d2('0xa'),auth['isAuthenticated'](),controller[_0x07d2('0x13')]);router[_0x07d2('0x14')]('/:id',auth[_0x07d2('0x9')](),controller[_0x07d2('0x15')]);module[_0x07d2('0x16')]=router; \ No newline at end of file +var _0xf946=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x35b8cb,_0x4a6fc8){var _0x551ac8=function(_0x447d99){while(--_0x447d99){_0x35b8cb['push'](_0x35b8cb['shift']());}};_0x551ac8(++_0x4a6fc8);}(_0xf946,0x14f));var _0x6f94=function(_0x4f8cba,_0x51d42b){_0x4f8cba=_0x4f8cba-0x0;var _0xe240a6=_0xf946[_0x4f8cba];return _0xe240a6;};'use strict';var multer=require(_0x6f94('0x0'));var util=require(_0x6f94('0x1'));var path=require(_0x6f94('0x2'));var timeout=require(_0x6f94('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f94('0x4'));var config=require(_0x6f94('0x5'));var controller=require(_0x6f94('0x6'));router['get']('/',auth[_0x6f94('0x7')](),controller[_0x6f94('0x8')]);router[_0x6f94('0x9')](_0x6f94('0xa'),auth[_0x6f94('0x7')](),controller[_0x6f94('0xb')]);router[_0x6f94('0x9')](_0x6f94('0xc'),auth[_0x6f94('0x7')](),controller[_0x6f94('0xd')]);router[_0x6f94('0x9')](_0x6f94('0xe'),auth['isAuthenticated'](),controller[_0x6f94('0xf')]);router['post']('/',auth[_0x6f94('0x7')](),controller[_0x6f94('0x10')]);router[_0x6f94('0x11')](_0x6f94('0xc'),auth[_0x6f94('0x7')](),controller[_0x6f94('0x12')]);router[_0x6f94('0x13')]('/:id',auth[_0x6f94('0x7')](),controller[_0x6f94('0x14')]);router[_0x6f94('0x15')](_0x6f94('0xa'),auth['isAuthenticated'](),controller[_0x6f94('0x16')]);module[_0x6f94('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d6263b8..605ee1d 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 _0x5cbf=['integrationTab','exports','STRING','ENUM','basic'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x5cbf,0x17d));var _0xf5cb=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x5cbf[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require('sequelize');module[_0xf5cb('0x0')]={'name':{'type':Sequelize[_0xf5cb('0x1')]},'description':{'type':Sequelize[_0xf5cb('0x1')]},'username':{'type':Sequelize[_0xf5cb('0x1')]},'remoteUri':{'type':Sequelize[_0xf5cb('0x1')]},'authType':{'type':Sequelize[_0xf5cb('0x2')](_0xf5cb('0x3')),'defaultValue':_0xf5cb('0x3')},'password':{'type':Sequelize[_0xf5cb('0x1')]},'consumerKey':{'type':Sequelize[_0xf5cb('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf5cb('0x1')]},'tokenSecret':{'type':Sequelize[_0xf5cb('0x1')]},'serverUrl':{'type':Sequelize[_0xf5cb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf5cb('0x2')](_0xf5cb('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xb7d4=['STRING','basic','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xb7d4,0xe5));var _0x4b7d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb7d4[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x4b7d('0x0'));module[_0x4b7d('0x1')]={'name':{'type':Sequelize[_0x4b7d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4b7d('0x2')]},'remoteUri':{'type':Sequelize[_0x4b7d('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x4b7d('0x3')),'defaultValue':_0x4b7d('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4b7d('0x2')]},'consumerSecret':{'type':Sequelize[_0x4b7d('0x2')]},'token':{'type':Sequelize[_0x4b7d('0x2')]},'tokenSecret':{'type':Sequelize[_0x4b7d('0x2')]},'serverUrl':{'type':Sequelize[_0x4b7d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4b7d('0x4')](_0x4b7d('0x5'),_0x4b7d('0x6')),'defaultValue':_0x4b7d('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7213472..0b508c4 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 _0x6840=['destroy','getConfigurations','DeskConfiguration','rawAttributes','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','application/json','basic','headers','Authorization','%s:%s','password','base64','concat','entries','active','label','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','end','stack','name','index','map','DeskAccount','fieldName','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','type','options','include','catch','params','includeAll','find','create','body'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6840,0x1da));var _0x0684=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6840[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x0684('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0684('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0684('0x2'));var moment=require(_0x0684('0x3'));var BPromise=require(_0x0684('0x4'));var Mustache=require(_0x0684('0x5'));var util=require(_0x0684('0x6'));var path=require(_0x0684('0x7'));var sox=require(_0x0684('0x8'));var csv=require(_0x0684('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0684('0xa'));var crypto=require(_0x0684('0xb'));var jsforce=require(_0x0684('0xc'));var deskjs=require(_0x0684('0xd'));var toCsv=require(_0x0684('0x9'));var querystring=require(_0x0684('0xe'));var Papa=require(_0x0684('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0684('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0684('0x11'));var logger=require(_0x0684('0x12'))(_0x0684('0x13'));var utils=require(_0x0684('0x14'));var config=require(_0x0684('0x15'));var licenseUtil=require(_0x0684('0x16'));var db=require(_0x0684('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x39ce4e,_0xd058ab){_0xd058ab=_0xd058ab||0xcc;return function(_0x53db46){if(_0x53db46){return _0x39ce4e['sendStatus'](_0xd058ab);}return _0x39ce4e['status'](_0xd058ab)['end']();};}function respondWithResult(_0x54c4a1,_0x5db282){_0x5db282=_0x5db282||0xc8;return function(_0x1b0ecb){if(_0x1b0ecb){return _0x54c4a1['status'](_0x5db282)[_0x0684('0x18')](_0x1b0ecb);}};}function respondWithFilteredResult(_0x578c71,_0x182021){return function(_0x374764){if(_0x374764){var _0x59e24f=typeof _0x182021[_0x0684('0x19')]===_0x0684('0x1a')&&typeof _0x182021[_0x0684('0x1b')]===_0x0684('0x1a');var _0x39d6e7=_0x374764['count'];var _0x3f163a=_0x59e24f?0x0:_0x182021[_0x0684('0x19')];var _0x211353=_0x59e24f?_0x374764[_0x0684('0x1c')]:_0x182021[_0x0684('0x19')]+_0x182021[_0x0684('0x1b')];var _0x155041;if(_0x211353>=_0x39d6e7){_0x211353=_0x39d6e7;_0x155041=0xc8;}else{_0x155041=0xce;}_0x578c71[_0x0684('0x1d')](_0x155041);return _0x578c71[_0x0684('0x1e')](_0x0684('0x1f'),_0x3f163a+'-'+_0x211353+'/'+_0x39d6e7)[_0x0684('0x18')](_0x374764);}return null;};}function patchUpdates(_0x274045){return function(_0x42c3eb){try{jsonpatch[_0x0684('0x20')](_0x42c3eb,_0x274045,!![]);}catch(_0xdeba01){return BPromise[_0x0684('0x21')](_0xdeba01);}return _0x42c3eb['save']();};}function saveUpdates(_0x458631,_0x16c0bf){return function(_0x32f668){if(_0x32f668){return _0x32f668[_0x0684('0x22')](_0x458631)[_0x0684('0x23')](function(_0x55832c){return _0x55832c;});}return null;};}function removeEntity(_0xfed363,_0x25cd43){return function(_0x555284){if(_0x555284){return _0x555284['destroy']()[_0x0684('0x23')](function(){_0xfed363[_0x0684('0x1d')](0xcc)[_0x0684('0x24')]();});}};}function handleEntityNotFound(_0x295a2a,_0x4f51c6){return function(_0x5ce966){if(!_0x5ce966){_0x295a2a['sendStatus'](0x194);}return _0x5ce966;};}function handleError(_0xa67c2d,_0x29b8b1){_0x29b8b1=_0x29b8b1||0x1f4;return function(_0x75d971){logger['error'](_0x75d971[_0x0684('0x25')]);if(_0x75d971[_0x0684('0x26')]){delete _0x75d971[_0x0684('0x26')];}_0xa67c2d[_0x0684('0x1d')](_0x29b8b1)['send'](_0x75d971);};}exports[_0x0684('0x27')]=function(_0x16efe9,_0x53c7e7){var _0x30dc47={},_0x524055={},_0x58b22e={'count':0x0,'rows':[]};var _0xa38555=_[_0x0684('0x28')](db[_0x0684('0x29')]['rawAttributes'],function(_0x8d5143){return{'name':_0x8d5143[_0x0684('0x2a')],'type':_0x8d5143['type']['key']};});_0x524055['model']=_[_0x0684('0x28')](_0xa38555,_0x0684('0x26'));_0x524055[_0x0684('0x2b')]=_[_0x0684('0x2c')](_0x16efe9['query']);_0x524055[_0x0684('0x2d')]=_[_0x0684('0x2e')](_0x524055[_0x0684('0x2f')],_0x524055[_0x0684('0x2b')]);_0x30dc47[_0x0684('0x30')]=_[_0x0684('0x2e')](_0x524055[_0x0684('0x2f')],qs[_0x0684('0x31')](_0x16efe9[_0x0684('0x2b')]['fields']));_0x30dc47[_0x0684('0x30')]=_0x30dc47['attributes'][_0x0684('0x32')]?_0x30dc47[_0x0684('0x30')]:_0x524055[_0x0684('0x2f')];if(!_0x16efe9['query']['hasOwnProperty']('nolimit')){_0x30dc47[_0x0684('0x1b')]=qs[_0x0684('0x1b')](_0x16efe9['query']['limit']);_0x30dc47[_0x0684('0x19')]=qs[_0x0684('0x19')](_0x16efe9[_0x0684('0x2b')][_0x0684('0x19')]);}_0x30dc47[_0x0684('0x33')]=qs[_0x0684('0x34')](_0x16efe9[_0x0684('0x2b')][_0x0684('0x34')]);_0x30dc47['where']=qs[_0x0684('0x2d')](_[_0x0684('0x35')](_0x16efe9[_0x0684('0x2b')],_0x524055[_0x0684('0x2d')]),_0xa38555);if(_0x16efe9[_0x0684('0x2b')][_0x0684('0x36')]){_0x30dc47[_0x0684('0x37')]=_[_0x0684('0x38')](_0x30dc47[_0x0684('0x37')],{'$or':_[_0x0684('0x28')](_0xa38555,function(_0x2bbc80){if(_0x2bbc80[_0x0684('0x39')]!=='VIRTUAL'){var _0x268d9d={};_0x268d9d[_0x2bbc80[_0x0684('0x26')]]={'$like':'%'+_0x16efe9[_0x0684('0x2b')][_0x0684('0x36')]+'%'};return _0x268d9d;}})});}_0x30dc47=_[_0x0684('0x38')]({},_0x30dc47,_0x16efe9[_0x0684('0x3a')]);var _0x47f187={'where':_0x30dc47['where']};return db[_0x0684('0x29')][_0x0684('0x1c')](_0x47f187)['then'](function(_0x3034dc){_0x58b22e['count']=_0x3034dc;if(_0x16efe9[_0x0684('0x2b')]['includeAll']){_0x30dc47[_0x0684('0x3b')]=[{'all':!![]}];}return db[_0x0684('0x29')]['findAll'](_0x30dc47);})[_0x0684('0x23')](function(_0x154131){_0x58b22e['rows']=_0x154131;return _0x58b22e;})[_0x0684('0x23')](respondWithFilteredResult(_0x53c7e7,_0x30dc47))[_0x0684('0x3c')](handleError(_0x53c7e7,null));};exports['show']=function(_0x104204,_0x30f6b0){var _0xd6496d={'raw':![],'where':{'id':_0x104204[_0x0684('0x3d')]['id']}},_0x3c30a4={};_0x3c30a4[_0x0684('0x2f')]=_[_0x0684('0x2c')](db['DeskAccount']['rawAttributes']);_0x3c30a4[_0x0684('0x2b')]=_['keys'](_0x104204[_0x0684('0x2b')]);_0x3c30a4[_0x0684('0x2d')]=_['intersection'](_0x3c30a4[_0x0684('0x2f')],_0x3c30a4[_0x0684('0x2b')]);_0xd6496d[_0x0684('0x30')]=_['intersection'](_0x3c30a4['model'],qs[_0x0684('0x31')](_0x104204['query'][_0x0684('0x31')]));_0xd6496d[_0x0684('0x30')]=_0xd6496d[_0x0684('0x30')][_0x0684('0x32')]?_0xd6496d['attributes']:_0x3c30a4[_0x0684('0x2f')];if(_0x104204[_0x0684('0x2b')][_0x0684('0x3e')]){_0xd6496d[_0x0684('0x3b')]=[{'all':!![]}];}_0xd6496d=_[_0x0684('0x38')]({},_0xd6496d,_0x104204[_0x0684('0x3a')]);return db[_0x0684('0x29')][_0x0684('0x3f')](_0xd6496d)[_0x0684('0x23')](handleEntityNotFound(_0x30f6b0,null))[_0x0684('0x23')](respondWithResult(_0x30f6b0,null))[_0x0684('0x3c')](handleError(_0x30f6b0,null));};exports[_0x0684('0x40')]=function(_0x735a1f,_0xfedb86){return db[_0x0684('0x29')][_0x0684('0x40')](_0x735a1f[_0x0684('0x41')],{})[_0x0684('0x23')](respondWithResult(_0xfedb86,0xc9))[_0x0684('0x3c')](handleError(_0xfedb86,null));};exports['update']=function(_0x319c04,_0x3e73a1){if(_0x319c04['body']['id']){delete _0x319c04[_0x0684('0x41')]['id'];}return db['DeskAccount'][_0x0684('0x3f')]({'where':{'id':_0x319c04[_0x0684('0x3d')]['id']}})[_0x0684('0x23')](handleEntityNotFound(_0x3e73a1,null))['then'](saveUpdates(_0x319c04['body'],null))[_0x0684('0x23')](respondWithResult(_0x3e73a1,null))[_0x0684('0x3c')](handleError(_0x3e73a1,null));};exports[_0x0684('0x42')]=function(_0x56877b,_0x130142){return db['DeskAccount'][_0x0684('0x3f')]({'where':{'id':_0x56877b[_0x0684('0x3d')]['id']}})[_0x0684('0x23')](handleEntityNotFound(_0x130142,null))['then'](removeEntity(_0x130142,null))['catch'](handleError(_0x130142,null));};exports[_0x0684('0x43')]=function(_0x1d711b,_0x4d4f6e,_0x958d9){var _0x13a8f1={};var _0x53f335={};var _0x440fef;var _0x57d58b;return db[_0x0684('0x29')]['findOne']({'where':{'id':_0x1d711b[_0x0684('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4d4f6e,null))[_0x0684('0x23')](function(_0x3a1335){if(_0x3a1335){_0x440fef=_0x3a1335;_0x53f335[_0x0684('0x2f')]=_[_0x0684('0x2c')](db[_0x0684('0x44')][_0x0684('0x45')]);_0x53f335[_0x0684('0x2b')]=_[_0x0684('0x2c')](_0x1d711b[_0x0684('0x2b')]);_0x53f335[_0x0684('0x2d')]=_[_0x0684('0x2e')](_0x53f335[_0x0684('0x2f')],_0x53f335['query']);_0x13a8f1[_0x0684('0x30')]=_[_0x0684('0x2e')](_0x53f335[_0x0684('0x2f')],qs[_0x0684('0x31')](_0x1d711b[_0x0684('0x2b')][_0x0684('0x31')]));_0x13a8f1[_0x0684('0x30')]=_0x13a8f1[_0x0684('0x30')]['length']?_0x13a8f1[_0x0684('0x30')]:_0x53f335[_0x0684('0x2f')];_0x13a8f1['order']=qs['sort'](_0x1d711b['query'][_0x0684('0x34')]);_0x13a8f1['where']=qs[_0x0684('0x2d')](_[_0x0684('0x35')](_0x1d711b[_0x0684('0x2b')],_0x53f335[_0x0684('0x2d')]));if(_0x1d711b[_0x0684('0x2b')][_0x0684('0x36')]){_0x13a8f1[_0x0684('0x37')]=_[_0x0684('0x38')](_0x13a8f1['where'],{'$or':_['map'](_0x13a8f1[_0x0684('0x30')],function(_0x139956){var _0x3d904c={};_0x3d904c[_0x139956]={'$like':'%'+_0x1d711b[_0x0684('0x2b')][_0x0684('0x36')]+'%'};return _0x3d904c;})});}_0x13a8f1=_[_0x0684('0x38')]({},_0x13a8f1,_0x1d711b[_0x0684('0x3a')]);return _0x440fef[_0x0684('0x43')](_0x13a8f1);}})[_0x0684('0x23')](function(_0x5c4efa){if(_0x5c4efa){_0x57d58b=_0x5c4efa[_0x0684('0x32')];if(!_0x1d711b[_0x0684('0x2b')]['hasOwnProperty'](_0x0684('0x46'))){_0x13a8f1['limit']=qs[_0x0684('0x1b')](_0x1d711b[_0x0684('0x2b')]['limit']);_0x13a8f1[_0x0684('0x19')]=qs[_0x0684('0x19')](_0x1d711b[_0x0684('0x2b')][_0x0684('0x19')]);}return _0x440fef[_0x0684('0x43')](_0x13a8f1);}})[_0x0684('0x23')](function(_0x1f099d){if(_0x1f099d){return _0x1f099d?{'count':_0x57d58b,'rows':_0x1f099d}:null;}})[_0x0684('0x23')](respondWithResult(_0x4d4f6e,null))[_0x0684('0x3c')](handleError(_0x4d4f6e,null));};exports['addConfiguration']=function(_0x312f38,_0x47c851,_0x4c8faf){if(_0x312f38[_0x0684('0x41')]['id']){delete _0x312f38[_0x0684('0x41')]['id'];}return db[_0x0684('0x29')]['findOne']({'where':{'id':_0x312f38[_0x0684('0x3d')]['id']}})[_0x0684('0x23')](handleEntityNotFound(_0x47c851,null))[_0x0684('0x23')](function(_0x3d784b){if(_0x3d784b){_0x312f38[_0x0684('0x41')][_0x0684('0x47')]=_0x3d784b['id'];_0x312f38[_0x0684('0x41')][_0x0684('0x48')]=integrations[_0x0684('0x49')](_0x312f38[_0x0684('0x41')][_0x0684('0x4a')],_0x312f38[_0x0684('0x41')][_0x0684('0x39')]);_0x312f38[_0x0684('0x41')][_0x0684('0x4b')]=integrations[_0x0684('0x4c')](_0x312f38['body'][_0x0684('0x4a')],_0x312f38[_0x0684('0x41')][_0x0684('0x39')]);return db[_0x0684('0x44')][_0x0684('0x40')](_0x312f38['body'],{'include':[{'model':db[_0x0684('0x4d')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x0684('0x4b')}]});}return null;})[_0x0684('0x23')](respondWithResult(_0x47c851,null))['catch'](handleError(_0x47c851,null));};exports[_0x0684('0x4e')]=function(_0x52e6fb,_0x4727a5,_0x1ad4f9){var _0x2193d3=[{'name':'priority','label':_0x0684('0x4f'),'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 _0x3da8e2='';return db['DeskAccount'][_0x0684('0x50')]({'where':{'id':_0x52e6fb[_0x0684('0x3d')]['id']},'attributes':['id',_0x0684('0x51'),_0x0684('0x52'),_0x0684('0x53'),'password',_0x0684('0x54'),_0x0684('0x55'),_0x0684('0x56'),_0x0684('0x57')]})[_0x0684('0x23')](handleEntityNotFound(_0x4727a5,null))[_0x0684('0x23')](function(_0x33b043){if(_0x33b043){_0x3da8e2=_0x33b043[_0x0684('0x51')];var _0x5a71e9=_0x3da8e2['slice'](-0x1);if(_0x5a71e9==='/'){_0x3da8e2=_0x3da8e2[_0x0684('0x58')](0x0,_0x3da8e2[_0x0684('0x59')](_0x5a71e9));}var _0x5d2899={'method':_0x0684('0x5a'),'uri':util[_0x0684('0x5b')]('%s/custom_fields',_0x3da8e2),'headers':{'Content-Type':_0x0684('0x5c'),'Accept':_0x0684('0x5c')},'json':!![]};if(_0x33b043['authType']===_0x0684('0x5d')){_0x5d2899[_0x0684('0x5e')][_0x0684('0x5f')]=util[_0x0684('0x5b')]('Basic\x20%s',new Buffer(util['format'](_0x0684('0x60'),_0x33b043[_0x0684('0x53')],_0x33b043[_0x0684('0x61')]))['toString'](_0x0684('0x62')));}return rp(_0x5d2899)['then'](function(_0x25f412){return _0x2193d3[_0x0684('0x63')](_[_0x0684('0x28')](_0x25f412['_embedded'][_0x0684('0x64')],function(_0x5aeddd){return{'id':_0x5aeddd[_0x0684('0x26')],'name':_0x5aeddd[_0x0684('0x26')],'type':_0x5aeddd[_0x0684('0x39')],'active':_0x5aeddd[_0x0684('0x65')],'label':_0x5aeddd[_0x0684('0x66')],'custom':!![]};}));});}})[_0x0684('0x23')](function(_0x28bdcc){return{'count':_0x28bdcc['length'],'rows':_0x28bdcc};})[_0x0684('0x23')](respondWithResult(_0x4727a5,null))[_0x0684('0x3c')](function(_0x2644fc){var _0x546444=_0x52e6fb[_0x0684('0x2b')]['test']?0x1f4:_0x2644fc['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0684('0x4e'),_0x546444,JSON[_0x0684('0x67')](_0x2644fc));delete _0x2644fc[_0x0684('0x26')];if(_0x546444===0x191){_0x546444=0x190;}_0x4727a5['status'](_0x546444)[_0x0684('0x68')](_0x52e6fb['query'][_0x0684('0x69')]?{'message':_0x0684('0x6a'),'statusCode':_0x2644fc[_0x0684('0x6b')]}:_0x2644fc);});}; \ No newline at end of file +var _0x6e60=['set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','key','model','map','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','DeskAccount','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','limit','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','DeskField','priority','remoteUri','consumerSecret','token','tokenSecret','lastIndexOf','GET','format','application/json','authType','basic','headers','Authorization','username','password','toString','base64','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e60,0x1ae));var _0x06e6=function(_0x2930fd,_0x207b99){_0x2930fd=_0x2930fd-0x0;var _0x355fa0=_0x6e60[_0x2930fd];return _0x355fa0;};'use strict';var emlformat=require(_0x06e6('0x0'));var rimraf=require(_0x06e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06e6('0x2'));var rp=require(_0x06e6('0x3'));var moment=require(_0x06e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06e6('0x5'));var util=require(_0x06e6('0x6'));var path=require(_0x06e6('0x7'));var sox=require(_0x06e6('0x8'));var csv=require(_0x06e6('0x9'));var ejs=require(_0x06e6('0xa'));var fs=require('fs');var fs_extra=require(_0x06e6('0xb'));var _=require('lodash');var squel=require(_0x06e6('0xc'));var crypto=require('crypto');var jsforce=require(_0x06e6('0xd'));var deskjs=require(_0x06e6('0xe'));var toCsv=require(_0x06e6('0x9'));var querystring=require(_0x06e6('0xf'));var Papa=require('papaparse');var Redis=require(_0x06e6('0x10'));var authService=require(_0x06e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x06e6('0x12'));var hardwareService=require(_0x06e6('0x13'));var logger=require(_0x06e6('0x14'))(_0x06e6('0x15'));var utils=require(_0x06e6('0x16'));var config=require(_0x06e6('0x17'));var licenseUtil=require(_0x06e6('0x18'));var db=require(_0x06e6('0x19'))['db'];var integrations=require(_0x06e6('0x1a'));function respondWithStatusCode(_0x1c489b,_0x4afab2){_0x4afab2=_0x4afab2||0xcc;return function(_0x364fe1){if(_0x364fe1){return _0x1c489b[_0x06e6('0x1b')](_0x4afab2);}return _0x1c489b[_0x06e6('0x1c')](_0x4afab2)[_0x06e6('0x1d')]();};}function respondWithResult(_0xbf81e0,_0x102ae5){_0x102ae5=_0x102ae5||0xc8;return function(_0x3d46e4){if(_0x3d46e4){return _0xbf81e0[_0x06e6('0x1c')](_0x102ae5)[_0x06e6('0x1e')](_0x3d46e4);}};}function respondWithFilteredResult(_0x344d00,_0x30f756){return function(_0x5f37b7){if(_0x5f37b7){var _0x18bd1c=typeof _0x30f756['offset']===_0x06e6('0x1f')&&typeof _0x30f756['limit']==='undefined';var _0x185c1e=_0x5f37b7['count'];var _0x5ef070=_0x18bd1c?0x0:_0x30f756[_0x06e6('0x20')];var _0x309e3a=_0x18bd1c?_0x5f37b7[_0x06e6('0x21')]:_0x30f756['offset']+_0x30f756['limit'];var _0x5c765f;if(_0x309e3a>=_0x185c1e){_0x309e3a=_0x185c1e;_0x5c765f=0xc8;}else{_0x5c765f=0xce;}_0x344d00[_0x06e6('0x1c')](_0x5c765f);return _0x344d00[_0x06e6('0x22')](_0x06e6('0x23'),_0x5ef070+'-'+_0x309e3a+'/'+_0x185c1e)[_0x06e6('0x1e')](_0x5f37b7);}return null;};}function patchUpdates(_0x5bf29f){return function(_0x1125f4){try{jsonpatch[_0x06e6('0x24')](_0x1125f4,_0x5bf29f,!![]);}catch(_0x51f09b){return BPromise[_0x06e6('0x25')](_0x51f09b);}return _0x1125f4[_0x06e6('0x26')]();};}function saveUpdates(_0x22b10d,_0x3d856a){return function(_0x54f840){if(_0x54f840){return _0x54f840[_0x06e6('0x27')](_0x22b10d)[_0x06e6('0x28')](function(_0x2d5f8a){return _0x2d5f8a;});}return null;};}function removeEntity(_0x4d0eca,_0x6f9c7f){return function(_0x2c2c56){if(_0x2c2c56){return _0x2c2c56[_0x06e6('0x29')]()['then'](function(){_0x4d0eca[_0x06e6('0x1c')](0xcc)[_0x06e6('0x1d')]();});}};}function handleEntityNotFound(_0x2a8202,_0x3e9ce5){return function(_0x4dd34e){if(!_0x4dd34e){_0x2a8202[_0x06e6('0x1b')](0x194);}return _0x4dd34e;};}function handleError(_0xc0fc17,_0x359004){_0x359004=_0x359004||0x1f4;return function(_0x5a96bc){logger[_0x06e6('0x2a')](_0x5a96bc['stack']);if(_0x5a96bc[_0x06e6('0x2b')]){delete _0x5a96bc[_0x06e6('0x2b')];}_0xc0fc17['status'](_0x359004)['send'](_0x5a96bc);};}exports[_0x06e6('0x2c')]=function(_0x11b87d,_0x3fae8c){var _0x134b4f={},_0x1347e3={},_0x2dd779={'count':0x0,'rows':[]};var _0x507ddc=_['map'](db['DeskAccount'][_0x06e6('0x2d')],function(_0x34b319){return{'name':_0x34b319['fieldName'],'type':_0x34b319['type'][_0x06e6('0x2e')]};});_0x1347e3[_0x06e6('0x2f')]=_[_0x06e6('0x30')](_0x507ddc,'name');_0x1347e3[_0x06e6('0x31')]=_['keys'](_0x11b87d[_0x06e6('0x31')]);_0x1347e3[_0x06e6('0x32')]=_['intersection'](_0x1347e3[_0x06e6('0x2f')],_0x1347e3[_0x06e6('0x31')]);_0x134b4f[_0x06e6('0x33')]=_['intersection'](_0x1347e3['model'],qs[_0x06e6('0x34')](_0x11b87d[_0x06e6('0x31')][_0x06e6('0x34')]));_0x134b4f['attributes']=_0x134b4f[_0x06e6('0x33')][_0x06e6('0x35')]?_0x134b4f[_0x06e6('0x33')]:_0x1347e3[_0x06e6('0x2f')];if(!_0x11b87d[_0x06e6('0x31')]['hasOwnProperty'](_0x06e6('0x36'))){_0x134b4f['limit']=qs['limit'](_0x11b87d[_0x06e6('0x31')]['limit']);_0x134b4f[_0x06e6('0x20')]=qs[_0x06e6('0x20')](_0x11b87d[_0x06e6('0x31')][_0x06e6('0x20')]);}_0x134b4f[_0x06e6('0x37')]=qs[_0x06e6('0x38')](_0x11b87d['query']['sort']);_0x134b4f[_0x06e6('0x39')]=qs[_0x06e6('0x32')](_['pick'](_0x11b87d[_0x06e6('0x31')],_0x1347e3[_0x06e6('0x32')]),_0x507ddc);if(_0x11b87d[_0x06e6('0x31')][_0x06e6('0x3a')]){_0x134b4f['where']=_[_0x06e6('0x3b')](_0x134b4f[_0x06e6('0x39')],{'$or':_[_0x06e6('0x30')](_0x507ddc,function(_0x2192ff){if(_0x2192ff['type']!==_0x06e6('0x3c')){var _0x1ad45d={};_0x1ad45d[_0x2192ff[_0x06e6('0x2b')]]={'$like':'%'+_0x11b87d[_0x06e6('0x31')][_0x06e6('0x3a')]+'%'};return _0x1ad45d;}})});}_0x134b4f=_[_0x06e6('0x3b')]({},_0x134b4f,_0x11b87d['options']);var _0x284459={'where':_0x134b4f['where']};return db['DeskAccount'][_0x06e6('0x21')](_0x284459)[_0x06e6('0x28')](function(_0x54687d){_0x2dd779[_0x06e6('0x21')]=_0x54687d;if(_0x11b87d[_0x06e6('0x31')][_0x06e6('0x3d')]){_0x134b4f[_0x06e6('0x3e')]=[{'all':!![]}];}return db[_0x06e6('0x3f')][_0x06e6('0x40')](_0x134b4f);})[_0x06e6('0x28')](function(_0x1e4395){_0x2dd779[_0x06e6('0x41')]=_0x1e4395;return _0x2dd779;})[_0x06e6('0x28')](respondWithFilteredResult(_0x3fae8c,_0x134b4f))[_0x06e6('0x42')](handleError(_0x3fae8c,null));};exports[_0x06e6('0x43')]=function(_0x1a9a0e,_0x10bcce){var _0x1042a0={'raw':![],'where':{'id':_0x1a9a0e[_0x06e6('0x44')]['id']}},_0x85396b={};_0x85396b[_0x06e6('0x2f')]=_['keys'](db[_0x06e6('0x3f')][_0x06e6('0x2d')]);_0x85396b[_0x06e6('0x31')]=_[_0x06e6('0x45')](_0x1a9a0e[_0x06e6('0x31')]);_0x85396b[_0x06e6('0x32')]=_['intersection'](_0x85396b['model'],_0x85396b[_0x06e6('0x31')]);_0x1042a0[_0x06e6('0x33')]=_[_0x06e6('0x46')](_0x85396b[_0x06e6('0x2f')],qs[_0x06e6('0x34')](_0x1a9a0e[_0x06e6('0x31')][_0x06e6('0x34')]));_0x1042a0[_0x06e6('0x33')]=_0x1042a0[_0x06e6('0x33')]['length']?_0x1042a0[_0x06e6('0x33')]:_0x85396b[_0x06e6('0x2f')];if(_0x1a9a0e['query'][_0x06e6('0x3d')]){_0x1042a0[_0x06e6('0x3e')]=[{'all':!![]}];}_0x1042a0=_[_0x06e6('0x3b')]({},_0x1042a0,_0x1a9a0e[_0x06e6('0x47')]);return db['DeskAccount'][_0x06e6('0x48')](_0x1042a0)[_0x06e6('0x28')](handleEntityNotFound(_0x10bcce,null))['then'](respondWithResult(_0x10bcce,null))[_0x06e6('0x42')](handleError(_0x10bcce,null));};exports[_0x06e6('0x49')]=function(_0x587639,_0x251fbe){return db[_0x06e6('0x3f')][_0x06e6('0x49')](_0x587639[_0x06e6('0x4a')],{})[_0x06e6('0x28')](respondWithResult(_0x251fbe,0xc9))[_0x06e6('0x42')](handleError(_0x251fbe,null));};exports[_0x06e6('0x27')]=function(_0x2c3967,_0x198284){if(_0x2c3967[_0x06e6('0x4a')]['id']){delete _0x2c3967[_0x06e6('0x4a')]['id'];}return db[_0x06e6('0x3f')]['find']({'where':{'id':_0x2c3967[_0x06e6('0x44')]['id']}})[_0x06e6('0x28')](handleEntityNotFound(_0x198284,null))[_0x06e6('0x28')](saveUpdates(_0x2c3967[_0x06e6('0x4a')],null))[_0x06e6('0x28')](respondWithResult(_0x198284,null))[_0x06e6('0x42')](handleError(_0x198284,null));};exports[_0x06e6('0x29')]=function(_0x17fd41,_0x4f5498){return db[_0x06e6('0x3f')][_0x06e6('0x48')]({'where':{'id':_0x17fd41[_0x06e6('0x44')]['id']}})[_0x06e6('0x28')](handleEntityNotFound(_0x4f5498,null))[_0x06e6('0x28')](removeEntity(_0x4f5498,null))[_0x06e6('0x42')](handleError(_0x4f5498,null));};exports[_0x06e6('0x4b')]=function(_0x30f151,_0x52f86f,_0x145429){var _0x2d9e5a={};var _0x5b2ef2={};var _0x1a8561;var _0x3a89f3;return db['DeskAccount'][_0x06e6('0x4c')]({'where':{'id':_0x30f151['params']['id']}})[_0x06e6('0x28')](handleEntityNotFound(_0x52f86f,null))['then'](function(_0x48c499){if(_0x48c499){_0x1a8561=_0x48c499;_0x5b2ef2[_0x06e6('0x2f')]=_[_0x06e6('0x45')](db[_0x06e6('0x4d')][_0x06e6('0x2d')]);_0x5b2ef2[_0x06e6('0x31')]=_[_0x06e6('0x45')](_0x30f151[_0x06e6('0x31')]);_0x5b2ef2['filters']=_['intersection'](_0x5b2ef2[_0x06e6('0x2f')],_0x5b2ef2[_0x06e6('0x31')]);_0x2d9e5a[_0x06e6('0x33')]=_[_0x06e6('0x46')](_0x5b2ef2[_0x06e6('0x2f')],qs[_0x06e6('0x34')](_0x30f151['query'][_0x06e6('0x34')]));_0x2d9e5a['attributes']=_0x2d9e5a[_0x06e6('0x33')][_0x06e6('0x35')]?_0x2d9e5a[_0x06e6('0x33')]:_0x5b2ef2[_0x06e6('0x2f')];_0x2d9e5a[_0x06e6('0x37')]=qs[_0x06e6('0x38')](_0x30f151['query']['sort']);_0x2d9e5a[_0x06e6('0x39')]=qs[_0x06e6('0x32')](_['pick'](_0x30f151[_0x06e6('0x31')],_0x5b2ef2['filters']));if(_0x30f151[_0x06e6('0x31')][_0x06e6('0x3a')]){_0x2d9e5a[_0x06e6('0x39')]=_[_0x06e6('0x3b')](_0x2d9e5a[_0x06e6('0x39')],{'$or':_[_0x06e6('0x30')](_0x2d9e5a[_0x06e6('0x33')],function(_0x8f4233){var _0x353ade={};_0x353ade[_0x8f4233]={'$like':'%'+_0x30f151[_0x06e6('0x31')]['filter']+'%'};return _0x353ade;})});}_0x2d9e5a=_[_0x06e6('0x3b')]({},_0x2d9e5a,_0x30f151[_0x06e6('0x47')]);return _0x1a8561[_0x06e6('0x4b')](_0x2d9e5a);}})[_0x06e6('0x28')](function(_0x3ca678){if(_0x3ca678){_0x3a89f3=_0x3ca678['length'];if(!_0x30f151['query'][_0x06e6('0x4e')](_0x06e6('0x36'))){_0x2d9e5a[_0x06e6('0x4f')]=qs['limit'](_0x30f151['query'][_0x06e6('0x4f')]);_0x2d9e5a[_0x06e6('0x20')]=qs[_0x06e6('0x20')](_0x30f151[_0x06e6('0x31')][_0x06e6('0x20')]);}return _0x1a8561[_0x06e6('0x4b')](_0x2d9e5a);}})[_0x06e6('0x28')](function(_0x294222){if(_0x294222){return _0x294222?{'count':_0x3a89f3,'rows':_0x294222}:null;}})['then'](respondWithResult(_0x52f86f,null))['catch'](handleError(_0x52f86f,null));};exports[_0x06e6('0x50')]=function(_0x31ff07,_0x378c4,_0x5c9aed){if(_0x31ff07[_0x06e6('0x4a')]['id']){delete _0x31ff07[_0x06e6('0x4a')]['id'];}return db['DeskAccount'][_0x06e6('0x4c')]({'where':{'id':_0x31ff07['params']['id']}})[_0x06e6('0x28')](handleEntityNotFound(_0x378c4,null))[_0x06e6('0x28')](function(_0x12a84c){if(_0x12a84c){_0x31ff07['body']['AccountId']=_0x12a84c['id'];_0x31ff07[_0x06e6('0x4a')][_0x06e6('0x51')]=integrations[_0x06e6('0x52')](_0x31ff07[_0x06e6('0x4a')][_0x06e6('0x53')],_0x31ff07['body'][_0x06e6('0x54')]);_0x31ff07[_0x06e6('0x4a')][_0x06e6('0x55')]=integrations[_0x06e6('0x56')](_0x31ff07['body'][_0x06e6('0x53')],_0x31ff07[_0x06e6('0x4a')][_0x06e6('0x54')]);return db[_0x06e6('0x4d')][_0x06e6('0x49')](_0x31ff07[_0x06e6('0x4a')],{'include':[{'model':db[_0x06e6('0x57')],'as':_0x06e6('0x51')},{'model':db[_0x06e6('0x57')],'as':_0x06e6('0x55')}]});}return null;})[_0x06e6('0x28')](respondWithResult(_0x378c4,null))[_0x06e6('0x42')](handleError(_0x378c4,null));};exports['getFields']=function(_0x4e1636,_0x514b51,_0x1a5872){var _0x16f0dc=[{'name':_0x06e6('0x58'),'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 _0x66f95c='';return db[_0x06e6('0x3f')][_0x06e6('0x4c')]({'where':{'id':_0x4e1636['params']['id']},'attributes':['id',_0x06e6('0x59'),'authType','username','password','consumerKey',_0x06e6('0x5a'),_0x06e6('0x5b'),_0x06e6('0x5c')]})[_0x06e6('0x28')](handleEntityNotFound(_0x514b51,null))[_0x06e6('0x28')](function(_0x5c61f9){if(_0x5c61f9){_0x66f95c=_0x5c61f9['remoteUri'];var _0x3ddcaa=_0x66f95c['slice'](-0x1);if(_0x3ddcaa==='/'){_0x66f95c=_0x66f95c['substring'](0x0,_0x66f95c[_0x06e6('0x5d')](_0x3ddcaa));}var _0x5aff7e={'method':_0x06e6('0x5e'),'uri':util[_0x06e6('0x5f')]('%s/custom_fields',_0x66f95c),'headers':{'Content-Type':'application/json','Accept':_0x06e6('0x60')},'json':!![]};if(_0x5c61f9[_0x06e6('0x61')]===_0x06e6('0x62')){_0x5aff7e[_0x06e6('0x63')][_0x06e6('0x64')]=util['format']('Basic\x20%s',new Buffer(util[_0x06e6('0x5f')]('%s:%s',_0x5c61f9[_0x06e6('0x65')],_0x5c61f9[_0x06e6('0x66')]))[_0x06e6('0x67')](_0x06e6('0x68')));}return rp(_0x5aff7e)[_0x06e6('0x28')](function(_0x314360){return _0x16f0dc[_0x06e6('0x69')](_['map'](_0x314360[_0x06e6('0x6a')][_0x06e6('0x6b')],function(_0x295bd4){return{'id':_0x295bd4['name'],'name':_0x295bd4[_0x06e6('0x2b')],'type':_0x295bd4['type'],'active':_0x295bd4[_0x06e6('0x6c')],'label':_0x295bd4['label'],'custom':!![]};}));});}})[_0x06e6('0x28')](function(_0x46d38c){return{'count':_0x46d38c[_0x06e6('0x35')],'rows':_0x46d38c};})[_0x06e6('0x28')](respondWithResult(_0x514b51,null))[_0x06e6('0x42')](function(_0x86e885){var _0x33ba44=_0x4e1636[_0x06e6('0x31')][_0x06e6('0x6d')]?0x1f4:_0x86e885[_0x06e6('0x6e')]||0x1f4;logger['error'](_0x06e6('0x6f'),_0x06e6('0x70'),_0x33ba44,JSON[_0x06e6('0x71')](_0x86e885));delete _0x86e885[_0x06e6('0x2b')];if(_0x33ba44===0x191){_0x33ba44=0x190;}_0x514b51[_0x06e6('0x1c')](_0x33ba44)[_0x06e6('0x72')](_0x4e1636['query'][_0x06e6('0x6d')]?{'message':_0x06e6('0x73'),'statusCode':_0x86e885[_0x06e6('0x6e')]}:_0x86e885);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 0175345..2774f8f 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 _0x4a48=['exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a48,0x1d5));var _0x84a4=function(_0x5611f5,_0x174d69){_0x5611f5=_0x5611f5-0x0;var _0x48c8bb=_0x4a48[_0x5611f5];return _0x48c8bb;};'use strict';var _=require(_0x84a4('0x0'));var util=require(_0x84a4('0x1'));var logger=require(_0x84a4('0x2'))(_0x84a4('0x3'));var moment=require(_0x84a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x84a4('0x5'));var fs=require('fs');var path=require(_0x84a4('0x6'));var rimraf=require(_0x84a4('0x7'));var config=require(_0x84a4('0x8'));var attributes=require(_0x84a4('0x9'));var integrations=require(_0x84a4('0xa'));module[_0x84a4('0xb')]=function(_0x2737f9,_0x2d465b){return _0x2737f9[_0x84a4('0xc')](_0x84a4('0xd'),attributes,{'tableName':_0x84a4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9d2=['rimraf','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5db2e5,_0x5ade38){var _0x40953f=function(_0x9b8c5a){while(--_0x9b8c5a){_0x5db2e5['push'](_0x5db2e5['shift']());}};_0x40953f(++_0x5ade38);}(_0xe9d2,0x1e7));var _0x2e9d=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xe9d2[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x2e9d('0x0'));var util=require(_0x2e9d('0x1'));var logger=require(_0x2e9d('0x2'))(_0x2e9d('0x3'));var moment=require(_0x2e9d('0x4'));var BPromise=require(_0x2e9d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e9d('0x6'));var rimraf=require(_0x2e9d('0x7'));var config=require('../../config/environment');var attributes=require(_0x2e9d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x2e9d('0x9')]=function(_0x359e5f,_0x2cc012){return _0x359e5f[_0x2e9d('0xa')](_0x2e9d('0xb'),attributes,{'tableName':_0x2e9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 6f5681c..0b267e5 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 _0x1586=['catch','GetDeskAccount','options','raw','where','attributes','include','map','model','then','DeskAccount','find','ShowDeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x27794b,_0x4d219b){var _0x3eb569=function(_0x27126d){while(--_0x27126d){_0x27794b['push'](_0x27794b['shift']());}};_0x3eb569(++_0x4d219b);}(_0x1586,0x1ed));var _0x6158=function(_0x552041,_0xc34ee7){_0x552041=_0x552041-0x0;var _0x198a1a=_0x1586[_0x552041];return _0x198a1a;};'use strict';var _=require(_0x6158('0x0'));var util=require(_0x6158('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6158('0x2'));var fs=require('fs');var Redis=require(_0x6158('0x3'));var db=require(_0x6158('0x4'))['db'];var utils=require(_0x6158('0x5'));var logger=require('../../config/logger')(_0x6158('0x6'));var config=require(_0x6158('0x7'));var jayson=require(_0x6158('0x8'));var client=jayson[_0x6158('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208ed6,_0x2242c5,_0x272587){return new BPromise(function(_0x16aade,_0x2fddfe){return client['request'](_0x208ed6,_0x272587)['then'](function(_0x180f7d){logger['info'](_0x6158('0xa'),_0x2242c5,_0x6158('0xb'));logger[_0x6158('0xc')](_0x6158('0xd'),_0x2242c5,'request\x20sent',JSON[_0x6158('0xe')](_0x180f7d));if(_0x180f7d[_0x6158('0xf')]){if(_0x180f7d['error'][_0x6158('0x10')]===0x1f4){logger[_0x6158('0xf')](_0x6158('0xa'),_0x2242c5,_0x180f7d[_0x6158('0xf')]['message']);return _0x2fddfe(_0x180f7d[_0x6158('0xf')][_0x6158('0x11')]);}logger[_0x6158('0xf')](_0x6158('0xa'),_0x2242c5,_0x180f7d[_0x6158('0xf')][_0x6158('0x11')]);return _0x16aade(_0x180f7d[_0x6158('0xf')][_0x6158('0x11')]);}else{logger[_0x6158('0x12')](_0x6158('0xa'),_0x2242c5,_0x6158('0xb'));_0x16aade(_0x180f7d['result'][_0x6158('0x11')]);}})[_0x6158('0x13')](function(_0x2724d1){logger[_0x6158('0xf')]('DeskAccount,\x20%s,\x20%s',_0x2242c5,_0x2724d1);_0x2fddfe(_0x2724d1);});});}exports[_0x6158('0x14')]=function(_0x9f265c){var _0x3a5f9b=this;return new Promise(function(_0x24c462,_0x4d1ce8){return db['DeskAccount']['findAll']({'raw':_0x9f265c[_0x6158('0x15')]?_0x9f265c[_0x6158('0x15')][_0x6158('0x16')]===undefined?!![]:![]:!![],'where':_0x9f265c[_0x6158('0x15')]?_0x9f265c[_0x6158('0x15')][_0x6158('0x17')]||null:null,'attributes':_0x9f265c[_0x6158('0x15')]?_0x9f265c[_0x6158('0x15')][_0x6158('0x18')]||null:null,'limit':_0x9f265c['options']?_0x9f265c[_0x6158('0x15')]['limit']||null:null,'include':_0x9f265c[_0x6158('0x15')]?_0x9f265c[_0x6158('0x15')][_0x6158('0x19')]?_[_0x6158('0x1a')](_0x9f265c[_0x6158('0x15')][_0x6158('0x19')],function(_0x8fd4f3){return{'model':db[_0x8fd4f3[_0x6158('0x1b')]],'as':_0x8fd4f3['as'],'attributes':_0x8fd4f3['attributes'],'include':_0x8fd4f3[_0x6158('0x19')]?_[_0x6158('0x1a')](_0x8fd4f3['include'],function(_0x10d8c3){return{'model':db[_0x10d8c3['model']],'as':_0x10d8c3['as'],'attributes':_0x10d8c3[_0x6158('0x18')],'include':_0x10d8c3[_0x6158('0x19')]?_[_0x6158('0x1a')](_0x10d8c3['include'],function(_0x4d0fd4){return{'model':db[_0x4d0fd4[_0x6158('0x1b')]],'as':_0x4d0fd4['as'],'attributes':_0x4d0fd4[_0x6158('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6158('0x1c')](function(_0x3eeb99){logger[_0x6158('0x12')]('GetDeskAccount',_0x9f265c);logger[_0x6158('0xc')]('GetDeskAccount',_0x9f265c,JSON[_0x6158('0xe')](_0x3eeb99));_0x24c462(_0x3eeb99);})[_0x6158('0x13')](function(_0x1605de){logger['error'](_0x6158('0x14'),_0x1605de[_0x6158('0x11')],_0x9f265c);_0x4d1ce8(_0x3a5f9b[_0x6158('0xf')](0x1f4,_0x1605de['message']));});});};exports['ShowDeskAccount']=function(_0x31714b){var _0x34d6c3=this;return new Promise(function(_0x2ca552,_0x386bd8){return db[_0x6158('0x1d')][_0x6158('0x1e')]({'raw':_0x31714b[_0x6158('0x15')]?_0x31714b[_0x6158('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x31714b[_0x6158('0x15')]?_0x31714b[_0x6158('0x15')][_0x6158('0x17')]||null:null,'attributes':_0x31714b['options']?_0x31714b[_0x6158('0x15')][_0x6158('0x18')]||null:null,'include':_0x31714b['options']?_0x31714b[_0x6158('0x15')]['include']?_[_0x6158('0x1a')](_0x31714b[_0x6158('0x15')]['include'],function(_0x26ba63){return{'model':db[_0x26ba63['model']],'as':_0x26ba63['as'],'attributes':_0x26ba63[_0x6158('0x18')],'include':_0x26ba63['include']?_[_0x6158('0x1a')](_0x26ba63[_0x6158('0x19')],function(_0x2d3be5){return{'model':db[_0x2d3be5[_0x6158('0x1b')]],'as':_0x2d3be5['as'],'attributes':_0x2d3be5[_0x6158('0x18')],'include':_0x2d3be5[_0x6158('0x19')]?_[_0x6158('0x1a')](_0x2d3be5[_0x6158('0x19')],function(_0x155a0d){return{'model':db[_0x155a0d[_0x6158('0x1b')]],'as':_0x155a0d['as'],'attributes':_0x155a0d[_0x6158('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6158('0x1c')](function(_0x5a0dec){logger['info'](_0x6158('0x1f'),_0x31714b);logger[_0x6158('0xc')](_0x6158('0x1f'),_0x31714b,JSON['stringify'](_0x5a0dec));_0x2ca552(_0x5a0dec);})[_0x6158('0x13')](function(_0x312018){logger[_0x6158('0xf')](_0x6158('0x1f'),_0x312018[_0x6158('0x11')],_0x31714b);_0x386bd8(_0x34d6c3[_0x6158('0xf')](0x1f4,_0x312018[_0x6158('0x11')]));});});}; \ No newline at end of file +var _0xe350=['DeskAccount','findAll','options','where','attributes','include','map','model','ShowDeskAccount','find','raw','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe350,0x1b0));var _0x0e35=function(_0x57e92b,_0x11803d){_0x57e92b=_0x57e92b-0x0;var _0x189bdf=_0xe350[_0x57e92b];return _0x189bdf;};'use strict';var _=require(_0x0e35('0x0'));var util=require('util');var moment=require(_0x0e35('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e35('0x2'));var fs=require('fs');var Redis=require(_0x0e35('0x3'));var db=require(_0x0e35('0x4'))['db'];var utils=require(_0x0e35('0x5'));var logger=require(_0x0e35('0x6'))('rpc');var config=require(_0x0e35('0x7'));var jayson=require(_0x0e35('0x8'));var client=jayson[_0x0e35('0x9')][_0x0e35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53eea6,_0x1c3c52,_0x27dcd5){return new BPromise(function(_0x223a35,_0x5ed9e7){return client[_0x0e35('0xb')](_0x53eea6,_0x27dcd5)[_0x0e35('0xc')](function(_0x39e695){logger['info'](_0x0e35('0xd'),_0x1c3c52,'request\x20sent');logger[_0x0e35('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1c3c52,_0x0e35('0xf'),JSON[_0x0e35('0x10')](_0x39e695));if(_0x39e695[_0x0e35('0x11')]){if(_0x39e695[_0x0e35('0x11')][_0x0e35('0x12')]===0x1f4){logger[_0x0e35('0x11')](_0x0e35('0xd'),_0x1c3c52,_0x39e695['error'][_0x0e35('0x13')]);return _0x5ed9e7(_0x39e695[_0x0e35('0x11')]['message']);}logger[_0x0e35('0x11')]('DeskAccount,\x20%s,\x20%s',_0x1c3c52,_0x39e695[_0x0e35('0x11')][_0x0e35('0x13')]);return _0x223a35(_0x39e695[_0x0e35('0x11')][_0x0e35('0x13')]);}else{logger['info'](_0x0e35('0xd'),_0x1c3c52,_0x0e35('0xf'));_0x223a35(_0x39e695[_0x0e35('0x14')][_0x0e35('0x13')]);}})[_0x0e35('0x15')](function(_0x2d344a){logger['error'](_0x0e35('0xd'),_0x1c3c52,_0x2d344a);_0x5ed9e7(_0x2d344a);});});}exports[_0x0e35('0x16')]=function(_0x4273f8){var _0x102191=this;return new Promise(function(_0x48ffed,_0x819ae){return db[_0x0e35('0x17')][_0x0e35('0x18')]({'raw':_0x4273f8[_0x0e35('0x19')]?_0x4273f8[_0x0e35('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4273f8[_0x0e35('0x19')]?_0x4273f8[_0x0e35('0x19')][_0x0e35('0x1a')]||null:null,'attributes':_0x4273f8[_0x0e35('0x19')]?_0x4273f8[_0x0e35('0x19')][_0x0e35('0x1b')]||null:null,'limit':_0x4273f8[_0x0e35('0x19')]?_0x4273f8['options']['limit']||null:null,'include':_0x4273f8[_0x0e35('0x19')]?_0x4273f8[_0x0e35('0x19')][_0x0e35('0x1c')]?_[_0x0e35('0x1d')](_0x4273f8['options'][_0x0e35('0x1c')],function(_0x1bde9c){return{'model':db[_0x1bde9c[_0x0e35('0x1e')]],'as':_0x1bde9c['as'],'attributes':_0x1bde9c[_0x0e35('0x1b')],'include':_0x1bde9c[_0x0e35('0x1c')]?_['map'](_0x1bde9c[_0x0e35('0x1c')],function(_0x444025){return{'model':db[_0x444025[_0x0e35('0x1e')]],'as':_0x444025['as'],'attributes':_0x444025['attributes'],'include':_0x444025[_0x0e35('0x1c')]?_[_0x0e35('0x1d')](_0x444025[_0x0e35('0x1c')],function(_0x326a68){return{'model':db[_0x326a68[_0x0e35('0x1e')]],'as':_0x326a68['as'],'attributes':_0x326a68[_0x0e35('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f20c8){logger['info'](_0x0e35('0x16'),_0x4273f8);logger[_0x0e35('0xe')](_0x0e35('0x16'),_0x4273f8,JSON[_0x0e35('0x10')](_0x1f20c8));_0x48ffed(_0x1f20c8);})[_0x0e35('0x15')](function(_0x318083){logger['error'](_0x0e35('0x16'),_0x318083['message'],_0x4273f8);_0x819ae(_0x102191[_0x0e35('0x11')](0x1f4,_0x318083[_0x0e35('0x13')]));});});};exports[_0x0e35('0x1f')]=function(_0x952560){var _0x4058b3=this;return new Promise(function(_0x13b45a,_0x139ab6){return db[_0x0e35('0x17')][_0x0e35('0x20')]({'raw':_0x952560['options']?_0x952560['options'][_0x0e35('0x21')]===undefined?!![]:![]:!![],'where':_0x952560[_0x0e35('0x19')]?_0x952560[_0x0e35('0x19')][_0x0e35('0x1a')]||null:null,'attributes':_0x952560[_0x0e35('0x19')]?_0x952560[_0x0e35('0x19')][_0x0e35('0x1b')]||null:null,'include':_0x952560[_0x0e35('0x19')]?_0x952560[_0x0e35('0x19')]['include']?_[_0x0e35('0x1d')](_0x952560['options'][_0x0e35('0x1c')],function(_0x5e7277){return{'model':db[_0x5e7277[_0x0e35('0x1e')]],'as':_0x5e7277['as'],'attributes':_0x5e7277[_0x0e35('0x1b')],'include':_0x5e7277[_0x0e35('0x1c')]?_['map'](_0x5e7277[_0x0e35('0x1c')],function(_0x36bc87){return{'model':db[_0x36bc87['model']],'as':_0x36bc87['as'],'attributes':_0x36bc87[_0x0e35('0x1b')],'include':_0x36bc87[_0x0e35('0x1c')]?_[_0x0e35('0x1d')](_0x36bc87[_0x0e35('0x1c')],function(_0x266ddb){return{'model':db[_0x266ddb['model']],'as':_0x266ddb['as'],'attributes':_0x266ddb[_0x0e35('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0e35('0xc')](function(_0x4ad302){logger[_0x0e35('0x22')](_0x0e35('0x1f'),_0x952560);logger['debug'](_0x0e35('0x1f'),_0x952560,JSON['stringify'](_0x4ad302));_0x13b45a(_0x4ad302);})['catch'](function(_0x40000f){logger[_0x0e35('0x11')](_0x0e35('0x1f'),_0x40000f[_0x0e35('0x13')],_0x952560);_0x139ab6(_0x4058b3['error'](0x1f4,_0x40000f['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index e639588..7062770 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(_0x2535eb,_0x59ab9d){var _0x39aaa0=function(_0x481c02){while(--_0x481c02){_0x2535eb['push'](_0x2535eb['shift']());}};_0x39aaa0(++_0x59ab9d);}(_0xedd9,0xfc));var _0x9edd=function(_0x21bb2f,_0x4199b9){_0x21bb2f=_0x21bb2f-0x0;var _0x279b0e=_0xedd9[_0x21bb2f];return _0x279b0e;};'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(_0x5a2863,_0x5a21b6){var _0x54e22e=function(_0x20fbec){while(--_0x20fbec){_0x5a2863['push'](_0x5a2863['shift']());}};_0x54e22e(++_0x5a21b6);}(_0x008c,0x188));var _0xc008=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x008c[_0x5ad771];return _0x5b5dce;};'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 6f97a6b..7c649b1 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 _0xf92d=['exports','STRING'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xf92d,0xae));var _0xdf92=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf92d[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require('sequelize');module[_0xdf92('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdf92('0x1')]}}; \ No newline at end of file +var _0x7368=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7368,0xba));var _0x8736=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7368[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x8736('0x0'));module[_0x8736('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 62f9a7a..0e3675a 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 _0xd069=['apply','update','then','destroy','error','stack','name','status','send','index','map','DeskConfiguration','rawAttributes','type','key','model','keys','filters','query','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','catch','includeAll','options','create','body','find','params','getFields','DeskField','intersection','hasOwnProperty','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','Content-Range','json'];(function(_0x16dd98,_0x11d346){var _0xfc7fb3=function(_0x40d7d8){while(--_0x40d7d8){_0x16dd98['push'](_0x16dd98['shift']());}};_0xfc7fb3(++_0x11d346);}(_0xd069,0x186));var _0x9d06=function(_0x4bf8fd,_0x543507){_0x4bf8fd=_0x4bf8fd-0x0;var _0x44ebc8=_0xd069[_0x4bf8fd];return _0x44ebc8;};'use strict';var emlformat=require(_0x9d06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d06('0x1'));var jsonpatch=require(_0x9d06('0x2'));var rp=require(_0x9d06('0x3'));var moment=require(_0x9d06('0x4'));var BPromise=require(_0x9d06('0x5'));var Mustache=require('mustache');var util=require(_0x9d06('0x6'));var path=require(_0x9d06('0x7'));var sox=require('sox');var csv=require(_0x9d06('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d06('0x9'));var _=require(_0x9d06('0xa'));var squel=require('squel');var crypto=require(_0x9d06('0xb'));var jsforce=require(_0x9d06('0xc'));var deskjs=require(_0x9d06('0xd'));var toCsv=require(_0x9d06('0x8'));var querystring=require(_0x9d06('0xe'));var Papa=require(_0x9d06('0xf'));var Redis=require(_0x9d06('0x10'));var authService=require(_0x9d06('0x11'));var qs=require(_0x9d06('0x12'));var as=require(_0x9d06('0x13'));var hardwareService=require(_0x9d06('0x14'));var logger=require(_0x9d06('0x15'))(_0x9d06('0x16'));var utils=require(_0x9d06('0x17'));var config=require(_0x9d06('0x18'));var licenseUtil=require(_0x9d06('0x19'));var db=require(_0x9d06('0x1a'))['db'];function respondWithStatusCode(_0x21d545,_0x1fe78e){_0x1fe78e=_0x1fe78e||0xcc;return function(_0x4cc4a7){if(_0x4cc4a7){return _0x21d545[_0x9d06('0x1b')](_0x1fe78e);}return _0x21d545['status'](_0x1fe78e)[_0x9d06('0x1c')]();};}function respondWithResult(_0x4df153,_0x4d3ff0){_0x4d3ff0=_0x4d3ff0||0xc8;return function(_0x5cac56){if(_0x5cac56){return _0x4df153['status'](_0x4d3ff0)['json'](_0x5cac56);}};}function respondWithFilteredResult(_0x457866,_0x31a7a1){return function(_0x5a462d){if(_0x5a462d){var _0x218fbe=typeof _0x31a7a1[_0x9d06('0x1d')]===_0x9d06('0x1e')&&typeof _0x31a7a1['limit']==='undefined';var _0x9e3611=_0x5a462d['count'];var _0x5ee68d=_0x218fbe?0x0:_0x31a7a1[_0x9d06('0x1d')];var _0x190bc4=_0x218fbe?_0x5a462d[_0x9d06('0x1f')]:_0x31a7a1[_0x9d06('0x1d')]+_0x31a7a1[_0x9d06('0x20')];var _0x80c724;if(_0x190bc4>=_0x9e3611){_0x190bc4=_0x9e3611;_0x80c724=0xc8;}else{_0x80c724=0xce;}_0x457866['status'](_0x80c724);return _0x457866['set'](_0x9d06('0x21'),_0x5ee68d+'-'+_0x190bc4+'/'+_0x9e3611)[_0x9d06('0x22')](_0x5a462d);}return null;};}function patchUpdates(_0x3c3aeb){return function(_0xf55e51){try{jsonpatch[_0x9d06('0x23')](_0xf55e51,_0x3c3aeb,!![]);}catch(_0x38112f){return BPromise['reject'](_0x38112f);}return _0xf55e51['save']();};}function saveUpdates(_0x48079b,_0x2b5226){return function(_0x33a02c){if(_0x33a02c){return _0x33a02c[_0x9d06('0x24')](_0x48079b)[_0x9d06('0x25')](function(_0x13b53c){return _0x13b53c;});}return null;};}function removeEntity(_0x484ce3,_0x599df4){return function(_0x1fc9ec){if(_0x1fc9ec){return _0x1fc9ec[_0x9d06('0x26')]()[_0x9d06('0x25')](function(){_0x484ce3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57bc5d,_0x574f6e){return function(_0x447b5f){if(!_0x447b5f){_0x57bc5d[_0x9d06('0x1b')](0x194);}return _0x447b5f;};}function handleError(_0x10ecd5,_0x5aa3aa){_0x5aa3aa=_0x5aa3aa||0x1f4;return function(_0x2fee9a){logger[_0x9d06('0x27')](_0x2fee9a[_0x9d06('0x28')]);if(_0x2fee9a[_0x9d06('0x29')]){delete _0x2fee9a[_0x9d06('0x29')];}_0x10ecd5[_0x9d06('0x2a')](_0x5aa3aa)[_0x9d06('0x2b')](_0x2fee9a);};}exports[_0x9d06('0x2c')]=function(_0x165033,_0x10ac44){var _0x49451d={},_0x4c655b={},_0x44840d={'count':0x0,'rows':[]};var _0xf7db44=_[_0x9d06('0x2d')](db[_0x9d06('0x2e')][_0x9d06('0x2f')],function(_0x377e7a){return{'name':_0x377e7a['fieldName'],'type':_0x377e7a[_0x9d06('0x30')][_0x9d06('0x31')]};});_0x4c655b[_0x9d06('0x32')]=_[_0x9d06('0x2d')](_0xf7db44,_0x9d06('0x29'));_0x4c655b['query']=_[_0x9d06('0x33')](_0x165033['query']);_0x4c655b[_0x9d06('0x34')]=_['intersection'](_0x4c655b[_0x9d06('0x32')],_0x4c655b[_0x9d06('0x35')]);_0x49451d['attributes']=_['intersection'](_0x4c655b[_0x9d06('0x32')],qs['fields'](_0x165033[_0x9d06('0x35')][_0x9d06('0x36')]));_0x49451d[_0x9d06('0x37')]=_0x49451d[_0x9d06('0x37')][_0x9d06('0x38')]?_0x49451d['attributes']:_0x4c655b[_0x9d06('0x32')];if(!_0x165033[_0x9d06('0x35')]['hasOwnProperty'](_0x9d06('0x39'))){_0x49451d[_0x9d06('0x20')]=qs[_0x9d06('0x20')](_0x165033[_0x9d06('0x35')][_0x9d06('0x20')]);_0x49451d['offset']=qs[_0x9d06('0x1d')](_0x165033['query'][_0x9d06('0x1d')]);}_0x49451d[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x165033[_0x9d06('0x35')][_0x9d06('0x3b')]);_0x49451d['where']=qs['filters'](_[_0x9d06('0x3c')](_0x165033['query'],_0x4c655b['filters']),_0xf7db44);if(_0x165033['query'][_0x9d06('0x3d')]){_0x49451d[_0x9d06('0x3e')]=_[_0x9d06('0x3f')](_0x49451d[_0x9d06('0x3e')],{'$or':_[_0x9d06('0x2d')](_0xf7db44,function(_0x194dec){if(_0x194dec['type']!=='VIRTUAL'){var _0x180776={};_0x180776[_0x194dec[_0x9d06('0x29')]]={'$like':'%'+_0x165033[_0x9d06('0x35')][_0x9d06('0x3d')]+'%'};return _0x180776;}})});}_0x49451d=_[_0x9d06('0x3f')]({},_0x49451d,_0x165033['options']);var _0x1fc2ff={'where':_0x49451d[_0x9d06('0x3e')]};return db[_0x9d06('0x2e')][_0x9d06('0x1f')](_0x1fc2ff)[_0x9d06('0x25')](function(_0x114e24){_0x44840d[_0x9d06('0x1f')]=_0x114e24;if(_0x165033['query']['includeAll']){_0x49451d[_0x9d06('0x40')]=[{'all':!![]}];}return db[_0x9d06('0x2e')][_0x9d06('0x41')](_0x49451d);})[_0x9d06('0x25')](function(_0x49f3f9){_0x44840d[_0x9d06('0x42')]=_0x49f3f9;return _0x44840d;})[_0x9d06('0x25')](respondWithFilteredResult(_0x10ac44,_0x49451d))[_0x9d06('0x43')](handleError(_0x10ac44,null));};exports['show']=function(_0x3fa4ca,_0x252d78){var _0x43fd61={'raw':![],'where':{'id':_0x3fa4ca['params']['id']}},_0x52d66b={};_0x52d66b['model']=_[_0x9d06('0x33')](db[_0x9d06('0x2e')][_0x9d06('0x2f')]);_0x52d66b[_0x9d06('0x35')]=_[_0x9d06('0x33')](_0x3fa4ca[_0x9d06('0x35')]);_0x52d66b['filters']=_['intersection'](_0x52d66b['model'],_0x52d66b[_0x9d06('0x35')]);_0x43fd61[_0x9d06('0x37')]=_['intersection'](_0x52d66b[_0x9d06('0x32')],qs[_0x9d06('0x36')](_0x3fa4ca[_0x9d06('0x35')]['fields']));_0x43fd61['attributes']=_0x43fd61[_0x9d06('0x37')][_0x9d06('0x38')]?_0x43fd61[_0x9d06('0x37')]:_0x52d66b[_0x9d06('0x32')];if(_0x3fa4ca['query'][_0x9d06('0x44')]){_0x43fd61[_0x9d06('0x40')]=[{'all':!![]}];}_0x43fd61=_[_0x9d06('0x3f')]({},_0x43fd61,_0x3fa4ca[_0x9d06('0x45')]);return db[_0x9d06('0x2e')]['find'](_0x43fd61)['then'](handleEntityNotFound(_0x252d78,null))[_0x9d06('0x25')](respondWithResult(_0x252d78,null))[_0x9d06('0x43')](handleError(_0x252d78,null));};exports[_0x9d06('0x46')]=function(_0x2b3ca0,_0x28e265){return db[_0x9d06('0x2e')][_0x9d06('0x46')](_0x2b3ca0['body'],{})[_0x9d06('0x25')](respondWithResult(_0x28e265,0xc9))[_0x9d06('0x43')](handleError(_0x28e265,null));};exports[_0x9d06('0x24')]=function(_0x2ac510,_0x364005){if(_0x2ac510[_0x9d06('0x47')]['id']){delete _0x2ac510['body']['id'];}return db[_0x9d06('0x2e')][_0x9d06('0x48')]({'where':{'id':_0x2ac510[_0x9d06('0x49')]['id']}})['then'](handleEntityNotFound(_0x364005,null))[_0x9d06('0x25')](saveUpdates(_0x2ac510[_0x9d06('0x47')],null))[_0x9d06('0x25')](respondWithResult(_0x364005,null))[_0x9d06('0x43')](handleError(_0x364005,null));};exports[_0x9d06('0x26')]=function(_0x340314,_0x39232b){return db[_0x9d06('0x2e')][_0x9d06('0x48')]({'where':{'id':_0x340314[_0x9d06('0x49')]['id']}})[_0x9d06('0x25')](handleEntityNotFound(_0x39232b,null))[_0x9d06('0x25')](removeEntity(_0x39232b,null))['catch'](handleError(_0x39232b,null));};exports[_0x9d06('0x4a')]=function(_0x541de7,_0x4f389b,_0x145ab9){var _0x4f6522={};var _0x2bf498={};var _0x30028c;var _0x48375e;return db['DeskConfiguration']['findOne']({'where':{'id':_0x541de7[_0x9d06('0x49')]['id']}})[_0x9d06('0x25')](handleEntityNotFound(_0x4f389b,null))['then'](function(_0x4fdb23){if(_0x4fdb23){_0x30028c=_0x4fdb23;_0x2bf498[_0x9d06('0x32')]=_[_0x9d06('0x33')](db[_0x9d06('0x4b')][_0x9d06('0x2f')]);_0x2bf498['query']=_[_0x9d06('0x33')](_0x541de7[_0x9d06('0x35')]);_0x2bf498[_0x9d06('0x34')]=_[_0x9d06('0x4c')](_0x2bf498[_0x9d06('0x32')],_0x2bf498[_0x9d06('0x35')]);_0x4f6522[_0x9d06('0x37')]=_['intersection'](_0x2bf498[_0x9d06('0x32')],qs[_0x9d06('0x36')](_0x541de7[_0x9d06('0x35')][_0x9d06('0x36')]));_0x4f6522[_0x9d06('0x37')]=_0x4f6522[_0x9d06('0x37')][_0x9d06('0x38')]?_0x4f6522['attributes']:_0x2bf498[_0x9d06('0x32')];_0x4f6522[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x541de7[_0x9d06('0x35')][_0x9d06('0x3b')]);_0x4f6522[_0x9d06('0x3e')]=qs[_0x9d06('0x34')](_[_0x9d06('0x3c')](_0x541de7['query'],_0x2bf498['filters']));if(_0x541de7[_0x9d06('0x35')][_0x9d06('0x3d')]){_0x4f6522[_0x9d06('0x3e')]=_[_0x9d06('0x3f')](_0x4f6522[_0x9d06('0x3e')],{'$or':_['map'](_0x4f6522[_0x9d06('0x37')],function(_0x32a2ee){var _0x4669ec={};_0x4669ec[_0x32a2ee]={'$like':'%'+_0x541de7[_0x9d06('0x35')][_0x9d06('0x3d')]+'%'};return _0x4669ec;})});}_0x4f6522=_[_0x9d06('0x3f')]({},_0x4f6522,_0x541de7[_0x9d06('0x45')]);return _0x30028c['getFields'](_0x4f6522);}})[_0x9d06('0x25')](function(_0x3839a0){if(_0x3839a0){_0x48375e=_0x3839a0['length'];if(!_0x541de7['query'][_0x9d06('0x4d')](_0x9d06('0x39'))){_0x4f6522[_0x9d06('0x20')]=qs['limit'](_0x541de7[_0x9d06('0x35')][_0x9d06('0x20')]);_0x4f6522['offset']=qs['offset'](_0x541de7[_0x9d06('0x35')][_0x9d06('0x1d')]);}return _0x30028c[_0x9d06('0x4a')](_0x4f6522);}})[_0x9d06('0x25')](function(_0x3c2b20){if(_0x3c2b20){return _0x3c2b20?{'count':_0x48375e,'rows':_0x3c2b20}:null;}})[_0x9d06('0x25')](respondWithResult(_0x4f389b,null))[_0x9d06('0x43')](handleError(_0x4f389b,null));};exports['getSubjects']=function(_0x29d322,_0x576921,_0x2aec20){var _0x1dbda0={};var _0x346890={};var _0x3663d2;var _0x207203;return db[_0x9d06('0x2e')][_0x9d06('0x4e')]({'where':{'id':_0x29d322['params']['id']}})['then'](handleEntityNotFound(_0x576921,null))['then'](function(_0x380ce3){if(_0x380ce3){_0x3663d2=_0x380ce3;_0x346890[_0x9d06('0x32')]=_[_0x9d06('0x33')](db[_0x9d06('0x4b')][_0x9d06('0x2f')]);_0x346890[_0x9d06('0x35')]=_[_0x9d06('0x33')](_0x29d322[_0x9d06('0x35')]);_0x346890[_0x9d06('0x34')]=_[_0x9d06('0x4c')](_0x346890[_0x9d06('0x32')],_0x346890['query']);_0x1dbda0[_0x9d06('0x37')]=_['intersection'](_0x346890['model'],qs[_0x9d06('0x36')](_0x29d322[_0x9d06('0x35')][_0x9d06('0x36')]));_0x1dbda0[_0x9d06('0x37')]=_0x1dbda0[_0x9d06('0x37')][_0x9d06('0x38')]?_0x1dbda0[_0x9d06('0x37')]:_0x346890[_0x9d06('0x32')];_0x1dbda0[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x29d322[_0x9d06('0x35')][_0x9d06('0x3b')]);_0x1dbda0['where']=qs[_0x9d06('0x34')](_[_0x9d06('0x3c')](_0x29d322[_0x9d06('0x35')],_0x346890[_0x9d06('0x34')]));if(_0x29d322[_0x9d06('0x35')]['filter']){_0x1dbda0['where']=_[_0x9d06('0x3f')](_0x1dbda0[_0x9d06('0x3e')],{'$or':_['map'](_0x1dbda0[_0x9d06('0x37')],function(_0x183c78){var _0x2af22c={};_0x2af22c[_0x183c78]={'$like':'%'+_0x29d322[_0x9d06('0x35')][_0x9d06('0x3d')]+'%'};return _0x2af22c;})});}_0x1dbda0=_['merge']({},_0x1dbda0,_0x29d322[_0x9d06('0x45')]);return _0x3663d2[_0x9d06('0x4f')](_0x1dbda0);}})[_0x9d06('0x25')](function(_0x5f5c9a){if(_0x5f5c9a){_0x207203=_0x5f5c9a[_0x9d06('0x38')];if(!_0x29d322[_0x9d06('0x35')]['hasOwnProperty']('nolimit')){_0x1dbda0[_0x9d06('0x20')]=qs['limit'](_0x29d322['query'][_0x9d06('0x20')]);_0x1dbda0[_0x9d06('0x1d')]=qs[_0x9d06('0x1d')](_0x29d322['query'][_0x9d06('0x1d')]);}return _0x3663d2[_0x9d06('0x4f')](_0x1dbda0);}})['then'](function(_0x536bde){if(_0x536bde){return _0x536bde?{'count':_0x207203,'rows':_0x536bde}:null;}})[_0x9d06('0x25')](respondWithResult(_0x576921,null))[_0x9d06('0x43')](handleError(_0x576921,null));};exports[_0x9d06('0x50')]=function(_0x40b371,_0x4c3e52,_0x4c0613){var _0x31e1ff={};var _0x540c6f={};var _0x433825;var _0x3235bd;return db[_0x9d06('0x2e')][_0x9d06('0x4e')]({'where':{'id':_0x40b371[_0x9d06('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c3e52,null))[_0x9d06('0x25')](function(_0x3e7519){if(_0x3e7519){_0x433825=_0x3e7519;_0x540c6f[_0x9d06('0x32')]=_[_0x9d06('0x33')](db[_0x9d06('0x4b')][_0x9d06('0x2f')]);_0x540c6f[_0x9d06('0x35')]=_['keys'](_0x40b371['query']);_0x540c6f[_0x9d06('0x34')]=_['intersection'](_0x540c6f['model'],_0x540c6f[_0x9d06('0x35')]);_0x31e1ff['attributes']=_[_0x9d06('0x4c')](_0x540c6f['model'],qs[_0x9d06('0x36')](_0x40b371['query'][_0x9d06('0x36')]));_0x31e1ff['attributes']=_0x31e1ff['attributes'][_0x9d06('0x38')]?_0x31e1ff[_0x9d06('0x37')]:_0x540c6f[_0x9d06('0x32')];_0x31e1ff['order']=qs[_0x9d06('0x3b')](_0x40b371['query']['sort']);_0x31e1ff[_0x9d06('0x3e')]=qs[_0x9d06('0x34')](_['pick'](_0x40b371[_0x9d06('0x35')],_0x540c6f[_0x9d06('0x34')]));if(_0x40b371[_0x9d06('0x35')][_0x9d06('0x3d')]){_0x31e1ff[_0x9d06('0x3e')]=_[_0x9d06('0x3f')](_0x31e1ff[_0x9d06('0x3e')],{'$or':_[_0x9d06('0x2d')](_0x31e1ff['attributes'],function(_0xee7885){var _0x58630a={};_0x58630a[_0xee7885]={'$like':'%'+_0x40b371[_0x9d06('0x35')][_0x9d06('0x3d')]+'%'};return _0x58630a;})});}_0x31e1ff=_[_0x9d06('0x3f')]({},_0x31e1ff,_0x40b371['options']);return _0x433825[_0x9d06('0x50')](_0x31e1ff);}})['then'](function(_0xe30ba9){if(_0xe30ba9){_0x3235bd=_0xe30ba9[_0x9d06('0x38')];if(!_0x40b371['query'][_0x9d06('0x4d')]('nolimit')){_0x31e1ff[_0x9d06('0x20')]=qs[_0x9d06('0x20')](_0x40b371[_0x9d06('0x35')][_0x9d06('0x20')]);_0x31e1ff[_0x9d06('0x1d')]=qs['offset'](_0x40b371[_0x9d06('0x35')][_0x9d06('0x1d')]);}return _0x433825[_0x9d06('0x50')](_0x31e1ff);}})[_0x9d06('0x25')](function(_0x26275d){if(_0x26275d){return _0x26275d?{'count':_0x3235bd,'rows':_0x26275d}:null;}})['then'](respondWithResult(_0x4c3e52,null))[_0x9d06('0x43')](handleError(_0x4c3e52,null));};exports[_0x9d06('0x51')]=function(_0x2d5cc1,_0xed365d,_0x3a98e4){var _0x19f278={};var _0x19746b={};var _0x4adc98;var _0x3093c8;return db[_0x9d06('0x2e')]['findOne']({'where':{'id':_0x2d5cc1[_0x9d06('0x49')]['id']}})[_0x9d06('0x25')](handleEntityNotFound(_0xed365d,null))[_0x9d06('0x25')](function(_0x1565a1){if(_0x1565a1){_0x4adc98=_0x1565a1;_0x19746b[_0x9d06('0x32')]=_[_0x9d06('0x33')](db[_0x9d06('0x52')][_0x9d06('0x2f')]);_0x19746b[_0x9d06('0x35')]=_[_0x9d06('0x33')](_0x2d5cc1[_0x9d06('0x35')]);_0x19746b[_0x9d06('0x34')]=_[_0x9d06('0x4c')](_0x19746b[_0x9d06('0x32')],_0x19746b[_0x9d06('0x35')]);_0x19f278[_0x9d06('0x37')]=_[_0x9d06('0x4c')](_0x19746b[_0x9d06('0x32')],qs['fields'](_0x2d5cc1[_0x9d06('0x35')][_0x9d06('0x36')]));_0x19f278[_0x9d06('0x37')]=_0x19f278[_0x9d06('0x37')][_0x9d06('0x38')]?_0x19f278[_0x9d06('0x37')]:_0x19746b[_0x9d06('0x32')];_0x19f278[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x2d5cc1['query']['sort']);_0x19f278[_0x9d06('0x3e')]=qs[_0x9d06('0x34')](_[_0x9d06('0x3c')](_0x2d5cc1['query'],_0x19746b['filters']));if(_0x2d5cc1['query']['filter']){_0x19f278['where']=_[_0x9d06('0x3f')](_0x19f278['where'],{'$or':_['map'](_0x19f278[_0x9d06('0x37')],function(_0x43e6a0){var _0x11a19f={};_0x11a19f[_0x43e6a0]={'$like':'%'+_0x2d5cc1[_0x9d06('0x35')][_0x9d06('0x3d')]+'%'};return _0x11a19f;})});}_0x19f278=_[_0x9d06('0x3f')]({},_0x19f278,_0x2d5cc1[_0x9d06('0x45')]);return _0x4adc98[_0x9d06('0x51')](_0x19f278);}})[_0x9d06('0x25')](function(_0x36c70b){if(_0x36c70b){_0x3093c8=_0x36c70b['length'];if(!_0x2d5cc1[_0x9d06('0x35')][_0x9d06('0x4d')](_0x9d06('0x39'))){_0x19f278[_0x9d06('0x20')]=qs[_0x9d06('0x20')](_0x2d5cc1[_0x9d06('0x35')][_0x9d06('0x20')]);_0x19f278[_0x9d06('0x1d')]=qs[_0x9d06('0x1d')](_0x2d5cc1['query'][_0x9d06('0x1d')]);}return _0x4adc98['getTags'](_0x19f278);}})[_0x9d06('0x25')](function(_0x4ea660){if(_0x4ea660){return _0x4ea660?{'count':_0x3093c8,'rows':_0x4ea660}:null;}})[_0x9d06('0x25')](respondWithResult(_0xed365d,null))[_0x9d06('0x43')](handleError(_0xed365d,null));};exports[_0x9d06('0x53')]=function(_0x39aa99,_0x363706,_0x29d30d){if(_0x39aa99[_0x9d06('0x47')]['id']){delete _0x39aa99[_0x9d06('0x47')]['id'];}return db[_0x9d06('0x2e')][_0x9d06('0x4e')]({'where':{'id':_0x39aa99[_0x9d06('0x49')]['id']}})['then'](handleEntityNotFound(_0x363706,null))['then'](function(_0x2b7a4a){if(_0x2b7a4a){return _0x2b7a4a['setTags'](_0x39aa99[_0x9d06('0x47')][_0x9d06('0x54')]||[]);}return null;})[_0x9d06('0x25')](respondWithResult(_0x363706,null))['catch'](handleError(_0x363706,null));}; \ No newline at end of file +var _0x360e=['offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','DeskConfiguration','findAll','rows','show','includeAll','find','catch','create','body','params','getFields','findOne','length','pick','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4ee33a,_0x2657da){var _0xbe0ec9=function(_0x3294e2){while(--_0x3294e2){_0x4ee33a['push'](_0x4ee33a['shift']());}};_0xbe0ec9(++_0x2657da);}(_0x360e,0x13b));var _0xe360=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0x360e[_0x507965];return _0x3608fc;};'use strict';var emlformat=require(_0xe360('0x0'));var rimraf=require(_0xe360('0x1'));var zipdir=require(_0xe360('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe360('0x3'));var moment=require('moment');var BPromise=require(_0xe360('0x4'));var Mustache=require(_0xe360('0x5'));var util=require(_0xe360('0x6'));var path=require('path');var sox=require(_0xe360('0x7'));var csv=require('to-csv');var ejs=require(_0xe360('0x8'));var fs=require('fs');var fs_extra=require(_0xe360('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe360('0xa'));var jsforce=require(_0xe360('0xb'));var deskjs=require(_0xe360('0xc'));var toCsv=require(_0xe360('0xd'));var querystring=require(_0xe360('0xe'));var Papa=require(_0xe360('0xf'));var Redis=require(_0xe360('0x10'));var authService=require(_0xe360('0x11'));var qs=require(_0xe360('0x12'));var as=require(_0xe360('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe360('0x14'))(_0xe360('0x15'));var utils=require('../../config/utils');var config=require(_0xe360('0x16'));var licenseUtil=require(_0xe360('0x17'));var db=require(_0xe360('0x18'))['db'];function respondWithStatusCode(_0x5e8b89,_0x58e178){_0x58e178=_0x58e178||0xcc;return function(_0xa3104c){if(_0xa3104c){return _0x5e8b89[_0xe360('0x19')](_0x58e178);}return _0x5e8b89[_0xe360('0x1a')](_0x58e178)[_0xe360('0x1b')]();};}function respondWithResult(_0x5c2137,_0x16dc1b){_0x16dc1b=_0x16dc1b||0xc8;return function(_0x170bb6){if(_0x170bb6){return _0x5c2137[_0xe360('0x1a')](_0x16dc1b)[_0xe360('0x1c')](_0x170bb6);}};}function respondWithFilteredResult(_0x50c161,_0x429765){return function(_0x207332){if(_0x207332){var _0x420082=typeof _0x429765[_0xe360('0x1d')]===_0xe360('0x1e')&&typeof _0x429765[_0xe360('0x1f')]===_0xe360('0x1e');var _0x9bf28b=_0x207332[_0xe360('0x20')];var _0x446819=_0x420082?0x0:_0x429765[_0xe360('0x1d')];var _0x3d2ce3=_0x420082?_0x207332[_0xe360('0x20')]:_0x429765['offset']+_0x429765[_0xe360('0x1f')];var _0x3f9c39;if(_0x3d2ce3>=_0x9bf28b){_0x3d2ce3=_0x9bf28b;_0x3f9c39=0xc8;}else{_0x3f9c39=0xce;}_0x50c161[_0xe360('0x1a')](_0x3f9c39);return _0x50c161[_0xe360('0x21')](_0xe360('0x22'),_0x446819+'-'+_0x3d2ce3+'/'+_0x9bf28b)[_0xe360('0x1c')](_0x207332);}return null;};}function patchUpdates(_0x2f438d){return function(_0x3e4a68){try{jsonpatch['apply'](_0x3e4a68,_0x2f438d,!![]);}catch(_0x5055c0){return BPromise[_0xe360('0x23')](_0x5055c0);}return _0x3e4a68['save']();};}function saveUpdates(_0x2f7d64,_0x5eb749){return function(_0x290424){if(_0x290424){return _0x290424[_0xe360('0x24')](_0x2f7d64)[_0xe360('0x25')](function(_0x26d4c0){return _0x26d4c0;});}return null;};}function removeEntity(_0x2e2738,_0x24a823){return function(_0x2f7b35){if(_0x2f7b35){return _0x2f7b35[_0xe360('0x26')]()['then'](function(){_0x2e2738[_0xe360('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54e0b2,_0x499eb6){return function(_0x5332de){if(!_0x5332de){_0x54e0b2[_0xe360('0x19')](0x194);}return _0x5332de;};}function handleError(_0x23f483,_0x576631){_0x576631=_0x576631||0x1f4;return function(_0x234bfd){logger[_0xe360('0x27')](_0x234bfd[_0xe360('0x28')]);if(_0x234bfd[_0xe360('0x29')]){delete _0x234bfd[_0xe360('0x29')];}_0x23f483['status'](_0x576631)[_0xe360('0x2a')](_0x234bfd);};}exports[_0xe360('0x2b')]=function(_0x2325a8,_0x2e9a61){var _0x1b83af={},_0x97bf8e={},_0xae7094={'count':0x0,'rows':[]};var _0x2c012d=_[_0xe360('0x2c')](db['DeskConfiguration'][_0xe360('0x2d')],function(_0x3716cc){return{'name':_0x3716cc[_0xe360('0x2e')],'type':_0x3716cc[_0xe360('0x2f')][_0xe360('0x30')]};});_0x97bf8e[_0xe360('0x31')]=_[_0xe360('0x2c')](_0x2c012d,_0xe360('0x29'));_0x97bf8e[_0xe360('0x32')]=_[_0xe360('0x33')](_0x2325a8[_0xe360('0x32')]);_0x97bf8e[_0xe360('0x34')]=_[_0xe360('0x35')](_0x97bf8e[_0xe360('0x31')],_0x97bf8e[_0xe360('0x32')]);_0x1b83af['attributes']=_[_0xe360('0x35')](_0x97bf8e[_0xe360('0x31')],qs[_0xe360('0x36')](_0x2325a8[_0xe360('0x32')][_0xe360('0x36')]));_0x1b83af[_0xe360('0x37')]=_0x1b83af[_0xe360('0x37')]['length']?_0x1b83af[_0xe360('0x37')]:_0x97bf8e[_0xe360('0x31')];if(!_0x2325a8[_0xe360('0x32')][_0xe360('0x38')](_0xe360('0x39'))){_0x1b83af[_0xe360('0x1f')]=qs[_0xe360('0x1f')](_0x2325a8['query'][_0xe360('0x1f')]);_0x1b83af['offset']=qs[_0xe360('0x1d')](_0x2325a8[_0xe360('0x32')][_0xe360('0x1d')]);}_0x1b83af[_0xe360('0x3a')]=qs[_0xe360('0x3b')](_0x2325a8[_0xe360('0x32')][_0xe360('0x3b')]);_0x1b83af[_0xe360('0x3c')]=qs[_0xe360('0x34')](_['pick'](_0x2325a8[_0xe360('0x32')],_0x97bf8e[_0xe360('0x34')]),_0x2c012d);if(_0x2325a8[_0xe360('0x32')][_0xe360('0x3d')]){_0x1b83af['where']=_[_0xe360('0x3e')](_0x1b83af['where'],{'$or':_[_0xe360('0x2c')](_0x2c012d,function(_0x232ba4){if(_0x232ba4[_0xe360('0x2f')]!=='VIRTUAL'){var _0x1866d6={};_0x1866d6[_0x232ba4['name']]={'$like':'%'+_0x2325a8['query'][_0xe360('0x3d')]+'%'};return _0x1866d6;}})});}_0x1b83af=_[_0xe360('0x3e')]({},_0x1b83af,_0x2325a8[_0xe360('0x3f')]);var _0xc39808={'where':_0x1b83af['where']};return db['DeskConfiguration'][_0xe360('0x20')](_0xc39808)['then'](function(_0x1d2fca){_0xae7094[_0xe360('0x20')]=_0x1d2fca;if(_0x2325a8[_0xe360('0x32')]['includeAll']){_0x1b83af[_0xe360('0x40')]=[{'all':!![]}];}return db[_0xe360('0x41')][_0xe360('0x42')](_0x1b83af);})[_0xe360('0x25')](function(_0x77b20a){_0xae7094[_0xe360('0x43')]=_0x77b20a;return _0xae7094;})['then'](respondWithFilteredResult(_0x2e9a61,_0x1b83af))['catch'](handleError(_0x2e9a61,null));};exports[_0xe360('0x44')]=function(_0x4dc473,_0x5d1836){var _0x45e5f7={'raw':![],'where':{'id':_0x4dc473['params']['id']}},_0xc43130={};_0xc43130[_0xe360('0x31')]=_[_0xe360('0x33')](db[_0xe360('0x41')][_0xe360('0x2d')]);_0xc43130[_0xe360('0x32')]=_[_0xe360('0x33')](_0x4dc473[_0xe360('0x32')]);_0xc43130[_0xe360('0x34')]=_['intersection'](_0xc43130[_0xe360('0x31')],_0xc43130[_0xe360('0x32')]);_0x45e5f7[_0xe360('0x37')]=_[_0xe360('0x35')](_0xc43130[_0xe360('0x31')],qs['fields'](_0x4dc473[_0xe360('0x32')]['fields']));_0x45e5f7['attributes']=_0x45e5f7[_0xe360('0x37')]['length']?_0x45e5f7[_0xe360('0x37')]:_0xc43130['model'];if(_0x4dc473['query'][_0xe360('0x45')]){_0x45e5f7['include']=[{'all':!![]}];}_0x45e5f7=_[_0xe360('0x3e')]({},_0x45e5f7,_0x4dc473['options']);return db[_0xe360('0x41')][_0xe360('0x46')](_0x45e5f7)[_0xe360('0x25')](handleEntityNotFound(_0x5d1836,null))[_0xe360('0x25')](respondWithResult(_0x5d1836,null))[_0xe360('0x47')](handleError(_0x5d1836,null));};exports['create']=function(_0x50406f,_0xfbe5c0){return db[_0xe360('0x41')][_0xe360('0x48')](_0x50406f['body'],{})[_0xe360('0x25')](respondWithResult(_0xfbe5c0,0xc9))[_0xe360('0x47')](handleError(_0xfbe5c0,null));};exports[_0xe360('0x24')]=function(_0x5770ef,_0x220277){if(_0x5770ef[_0xe360('0x49')]['id']){delete _0x5770ef['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x5770ef[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x220277,null))[_0xe360('0x25')](saveUpdates(_0x5770ef[_0xe360('0x49')],null))['then'](respondWithResult(_0x220277,null))['catch'](handleError(_0x220277,null));};exports[_0xe360('0x26')]=function(_0x4f9c0f,_0x5b7865){return db[_0xe360('0x41')][_0xe360('0x46')]({'where':{'id':_0x4f9c0f[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x5b7865,null))[_0xe360('0x25')](removeEntity(_0x5b7865,null))[_0xe360('0x47')](handleError(_0x5b7865,null));};exports[_0xe360('0x4b')]=function(_0x36ee21,_0x47fc5f,_0x366bd2){var _0x2f0bc3={};var _0x545303={};var _0x5c9f70;var _0x253c4a;return db[_0xe360('0x41')][_0xe360('0x4c')]({'where':{'id':_0x36ee21['params']['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x47fc5f,null))['then'](function(_0x3f1a55){if(_0x3f1a55){_0x5c9f70=_0x3f1a55;_0x545303[_0xe360('0x31')]=_[_0xe360('0x33')](db['DeskField'][_0xe360('0x2d')]);_0x545303[_0xe360('0x32')]=_['keys'](_0x36ee21[_0xe360('0x32')]);_0x545303['filters']=_['intersection'](_0x545303[_0xe360('0x31')],_0x545303[_0xe360('0x32')]);_0x2f0bc3[_0xe360('0x37')]=_['intersection'](_0x545303[_0xe360('0x31')],qs[_0xe360('0x36')](_0x36ee21[_0xe360('0x32')]['fields']));_0x2f0bc3[_0xe360('0x37')]=_0x2f0bc3[_0xe360('0x37')][_0xe360('0x4d')]?_0x2f0bc3[_0xe360('0x37')]:_0x545303[_0xe360('0x31')];_0x2f0bc3[_0xe360('0x3a')]=qs[_0xe360('0x3b')](_0x36ee21['query'][_0xe360('0x3b')]);_0x2f0bc3[_0xe360('0x3c')]=qs['filters'](_[_0xe360('0x4e')](_0x36ee21[_0xe360('0x32')],_0x545303[_0xe360('0x34')]));if(_0x36ee21[_0xe360('0x32')][_0xe360('0x3d')]){_0x2f0bc3[_0xe360('0x3c')]=_[_0xe360('0x3e')](_0x2f0bc3[_0xe360('0x3c')],{'$or':_['map'](_0x2f0bc3['attributes'],function(_0x2c3a4f){var _0x2302ec={};_0x2302ec[_0x2c3a4f]={'$like':'%'+_0x36ee21[_0xe360('0x32')]['filter']+'%'};return _0x2302ec;})});}_0x2f0bc3=_[_0xe360('0x3e')]({},_0x2f0bc3,_0x36ee21[_0xe360('0x3f')]);return _0x5c9f70[_0xe360('0x4b')](_0x2f0bc3);}})[_0xe360('0x25')](function(_0x2c9c9e){if(_0x2c9c9e){_0x253c4a=_0x2c9c9e['length'];if(!_0x36ee21[_0xe360('0x32')][_0xe360('0x38')](_0xe360('0x39'))){_0x2f0bc3['limit']=qs[_0xe360('0x1f')](_0x36ee21[_0xe360('0x32')][_0xe360('0x1f')]);_0x2f0bc3['offset']=qs['offset'](_0x36ee21[_0xe360('0x32')][_0xe360('0x1d')]);}return _0x5c9f70[_0xe360('0x4b')](_0x2f0bc3);}})['then'](function(_0x54732c){if(_0x54732c){return _0x54732c?{'count':_0x253c4a,'rows':_0x54732c}:null;}})[_0xe360('0x25')](respondWithResult(_0x47fc5f,null))[_0xe360('0x47')](handleError(_0x47fc5f,null));};exports[_0xe360('0x4f')]=function(_0x51895a,_0x58f8c1,_0x4080c6){var _0x3d7af4={};var _0x2bee09={};var _0x45fc2f;var _0x2ca54d;return db[_0xe360('0x41')][_0xe360('0x4c')]({'where':{'id':_0x51895a[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x58f8c1,null))[_0xe360('0x25')](function(_0x1a5512){if(_0x1a5512){_0x45fc2f=_0x1a5512;_0x2bee09['model']=_['keys'](db[_0xe360('0x50')][_0xe360('0x2d')]);_0x2bee09['query']=_[_0xe360('0x33')](_0x51895a[_0xe360('0x32')]);_0x2bee09[_0xe360('0x34')]=_[_0xe360('0x35')](_0x2bee09['model'],_0x2bee09[_0xe360('0x32')]);_0x3d7af4[_0xe360('0x37')]=_['intersection'](_0x2bee09[_0xe360('0x31')],qs['fields'](_0x51895a[_0xe360('0x32')][_0xe360('0x36')]));_0x3d7af4['attributes']=_0x3d7af4[_0xe360('0x37')][_0xe360('0x4d')]?_0x3d7af4[_0xe360('0x37')]:_0x2bee09['model'];_0x3d7af4['order']=qs['sort'](_0x51895a[_0xe360('0x32')][_0xe360('0x3b')]);_0x3d7af4[_0xe360('0x3c')]=qs[_0xe360('0x34')](_[_0xe360('0x4e')](_0x51895a['query'],_0x2bee09[_0xe360('0x34')]));if(_0x51895a[_0xe360('0x32')]['filter']){_0x3d7af4[_0xe360('0x3c')]=_['merge'](_0x3d7af4[_0xe360('0x3c')],{'$or':_['map'](_0x3d7af4[_0xe360('0x37')],function(_0x2d96a7){var _0x389b47={};_0x389b47[_0x2d96a7]={'$like':'%'+_0x51895a[_0xe360('0x32')]['filter']+'%'};return _0x389b47;})});}_0x3d7af4=_[_0xe360('0x3e')]({},_0x3d7af4,_0x51895a['options']);return _0x45fc2f[_0xe360('0x4f')](_0x3d7af4);}})[_0xe360('0x25')](function(_0x375df8){if(_0x375df8){_0x2ca54d=_0x375df8[_0xe360('0x4d')];if(!_0x51895a['query']['hasOwnProperty'](_0xe360('0x39'))){_0x3d7af4[_0xe360('0x1f')]=qs[_0xe360('0x1f')](_0x51895a[_0xe360('0x32')]['limit']);_0x3d7af4['offset']=qs[_0xe360('0x1d')](_0x51895a[_0xe360('0x32')]['offset']);}return _0x45fc2f[_0xe360('0x4f')](_0x3d7af4);}})['then'](function(_0x1d6443){if(_0x1d6443){return _0x1d6443?{'count':_0x2ca54d,'rows':_0x1d6443}:null;}})[_0xe360('0x25')](respondWithResult(_0x58f8c1,null))[_0xe360('0x47')](handleError(_0x58f8c1,null));};exports[_0xe360('0x51')]=function(_0x43548a,_0x22e6e6,_0xbda47){var _0x4a3ced={};var _0x147e0f={};var _0x4ad2aa;var _0x31de0c;return db[_0xe360('0x41')][_0xe360('0x4c')]({'where':{'id':_0x43548a[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x22e6e6,null))['then'](function(_0x6eb300){if(_0x6eb300){_0x4ad2aa=_0x6eb300;_0x147e0f[_0xe360('0x31')]=_[_0xe360('0x33')](db['DeskField'][_0xe360('0x2d')]);_0x147e0f[_0xe360('0x32')]=_[_0xe360('0x33')](_0x43548a[_0xe360('0x32')]);_0x147e0f[_0xe360('0x34')]=_[_0xe360('0x35')](_0x147e0f['model'],_0x147e0f['query']);_0x4a3ced[_0xe360('0x37')]=_['intersection'](_0x147e0f['model'],qs[_0xe360('0x36')](_0x43548a['query'][_0xe360('0x36')]));_0x4a3ced[_0xe360('0x37')]=_0x4a3ced[_0xe360('0x37')][_0xe360('0x4d')]?_0x4a3ced[_0xe360('0x37')]:_0x147e0f['model'];_0x4a3ced[_0xe360('0x3a')]=qs[_0xe360('0x3b')](_0x43548a[_0xe360('0x32')][_0xe360('0x3b')]);_0x4a3ced[_0xe360('0x3c')]=qs['filters'](_[_0xe360('0x4e')](_0x43548a['query'],_0x147e0f[_0xe360('0x34')]));if(_0x43548a[_0xe360('0x32')]['filter']){_0x4a3ced[_0xe360('0x3c')]=_[_0xe360('0x3e')](_0x4a3ced[_0xe360('0x3c')],{'$or':_[_0xe360('0x2c')](_0x4a3ced[_0xe360('0x37')],function(_0x2c13e5){var _0x4ebf32={};_0x4ebf32[_0x2c13e5]={'$like':'%'+_0x43548a[_0xe360('0x32')][_0xe360('0x3d')]+'%'};return _0x4ebf32;})});}_0x4a3ced=_['merge']({},_0x4a3ced,_0x43548a[_0xe360('0x3f')]);return _0x4ad2aa[_0xe360('0x51')](_0x4a3ced);}})[_0xe360('0x25')](function(_0x532c4b){if(_0x532c4b){_0x31de0c=_0x532c4b[_0xe360('0x4d')];if(!_0x43548a[_0xe360('0x32')][_0xe360('0x38')](_0xe360('0x39'))){_0x4a3ced[_0xe360('0x1f')]=qs['limit'](_0x43548a['query']['limit']);_0x4a3ced[_0xe360('0x1d')]=qs[_0xe360('0x1d')](_0x43548a[_0xe360('0x32')][_0xe360('0x1d')]);}return _0x4ad2aa['getDescriptions'](_0x4a3ced);}})['then'](function(_0x5cfca8){if(_0x5cfca8){return _0x5cfca8?{'count':_0x31de0c,'rows':_0x5cfca8}:null;}})['then'](respondWithResult(_0x22e6e6,null))[_0xe360('0x47')](handleError(_0x22e6e6,null));};exports[_0xe360('0x52')]=function(_0x44ea9b,_0x4485fb,_0x286032){var _0x639c0f={};var _0xc71de={};var _0x5be98a;var _0x12a3f0;return db[_0xe360('0x41')]['findOne']({'where':{'id':_0x44ea9b[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x4485fb,null))[_0xe360('0x25')](function(_0x200656){if(_0x200656){_0x5be98a=_0x200656;_0xc71de[_0xe360('0x31')]=_[_0xe360('0x33')](db[_0xe360('0x53')][_0xe360('0x2d')]);_0xc71de['query']=_[_0xe360('0x33')](_0x44ea9b[_0xe360('0x32')]);_0xc71de[_0xe360('0x34')]=_[_0xe360('0x35')](_0xc71de[_0xe360('0x31')],_0xc71de[_0xe360('0x32')]);_0x639c0f[_0xe360('0x37')]=_[_0xe360('0x35')](_0xc71de[_0xe360('0x31')],qs[_0xe360('0x36')](_0x44ea9b[_0xe360('0x32')]['fields']));_0x639c0f[_0xe360('0x37')]=_0x639c0f['attributes'][_0xe360('0x4d')]?_0x639c0f[_0xe360('0x37')]:_0xc71de[_0xe360('0x31')];_0x639c0f[_0xe360('0x3a')]=qs[_0xe360('0x3b')](_0x44ea9b[_0xe360('0x32')][_0xe360('0x3b')]);_0x639c0f[_0xe360('0x3c')]=qs[_0xe360('0x34')](_['pick'](_0x44ea9b[_0xe360('0x32')],_0xc71de[_0xe360('0x34')]));if(_0x44ea9b[_0xe360('0x32')]['filter']){_0x639c0f[_0xe360('0x3c')]=_[_0xe360('0x3e')](_0x639c0f[_0xe360('0x3c')],{'$or':_[_0xe360('0x2c')](_0x639c0f[_0xe360('0x37')],function(_0x16d9ec){var _0x59b4a2={};_0x59b4a2[_0x16d9ec]={'$like':'%'+_0x44ea9b[_0xe360('0x32')][_0xe360('0x3d')]+'%'};return _0x59b4a2;})});}_0x639c0f=_['merge']({},_0x639c0f,_0x44ea9b[_0xe360('0x3f')]);return _0x5be98a[_0xe360('0x52')](_0x639c0f);}})[_0xe360('0x25')](function(_0x1c0506){if(_0x1c0506){_0x12a3f0=_0x1c0506['length'];if(!_0x44ea9b[_0xe360('0x32')][_0xe360('0x38')](_0xe360('0x39'))){_0x639c0f[_0xe360('0x1f')]=qs['limit'](_0x44ea9b['query']['limit']);_0x639c0f[_0xe360('0x1d')]=qs['offset'](_0x44ea9b[_0xe360('0x32')][_0xe360('0x1d')]);}return _0x5be98a[_0xe360('0x52')](_0x639c0f);}})[_0xe360('0x25')](function(_0x23f83c){if(_0x23f83c){return _0x23f83c?{'count':_0x12a3f0,'rows':_0x23f83c}:null;}})[_0xe360('0x25')](respondWithResult(_0x4485fb,null))[_0xe360('0x47')](handleError(_0x4485fb,null));};exports[_0xe360('0x54')]=function(_0x1ee977,_0x1f4470,_0x33cc86){if(_0x1ee977[_0xe360('0x49')]['id']){delete _0x1ee977['body']['id'];}return db[_0xe360('0x41')][_0xe360('0x4c')]({'where':{'id':_0x1ee977[_0xe360('0x4a')]['id']}})[_0xe360('0x25')](handleEntityNotFound(_0x1f4470,null))[_0xe360('0x25')](function(_0x47a1fd){if(_0x47a1fd){return _0x47a1fd[_0xe360('0x54')](_0x1ee977[_0xe360('0x49')][_0xe360('0x55')]||[]);}return null;})[_0xe360('0x25')](respondWithResult(_0x1f4470,null))[_0xe360('0x47')](handleError(_0x1f4470,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 76bacbd..8c3bcff 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 _0xa8ea=['./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53a0c8,_0x2661aa){var _0x2247c9=function(_0x5a0fd9){while(--_0x5a0fd9){_0x53a0c8['push'](_0x53a0c8['shift']());}};_0x2247c9(++_0x2661aa);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x676c61,_0x5f5b08){_0x676c61=_0x676c61-0x0;var _0x1c000d=_0xa8ea[_0x676c61];return _0x1c000d;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));var logger=require(_0xaa8e('0x2'))(_0xaa8e('0x3'));var moment=require('moment');var BPromise=require(_0xaa8e('0x4'));var rp=require(_0xaa8e('0x5'));var fs=require('fs');var path=require(_0xaa8e('0x6'));var rimraf=require(_0xaa8e('0x7'));var config=require(_0xaa8e('0x8'));var attributes=require(_0xaa8e('0x9'));module[_0xaa8e('0xa')]=function(_0x2348d5,_0x478702){return _0x2348d5[_0xaa8e('0xb')]('DeskConfiguration',attributes,{'tableName':_0xaa8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe02a=['DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe02a,0x1ae));var _0xae02=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe02a[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var logger=require(_0xae02('0x2'))(_0xae02('0x3'));var moment=require(_0xae02('0x4'));var BPromise=require(_0xae02('0x5'));var rp=require(_0xae02('0x6'));var fs=require('fs');var path=require(_0xae02('0x7'));var rimraf=require('rimraf');var config=require(_0xae02('0x8'));var attributes=require(_0xae02('0x9'));module[_0xae02('0xa')]=function(_0x2b9e64,_0x1b1be9){return _0x2b9e64[_0xae02('0xb')](_0xae02('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 25c31cd..a113c15 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 _0x25d4=['info','debug','request\x20sent','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x90017e,_0x30616e){var _0x565445=function(_0xcd8ce1){while(--_0xcd8ce1){_0x90017e['push'](_0x90017e['shift']());}};_0x565445(++_0x30616e);}(_0x25d4,0xb1));var _0x425d=function(_0x3d5d8a,_0x8aafec){_0x3d5d8a=_0x3d5d8a-0x0;var _0x19162=_0x25d4[_0x3d5d8a];return _0x19162;};'use strict';var _=require(_0x425d('0x0'));var util=require(_0x425d('0x1'));var moment=require(_0x425d('0x2'));var BPromise=require(_0x425d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x425d('0x4'));var db=require(_0x425d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x425d('0x6'))('rpc');var config=require(_0x425d('0x7'));var jayson=require(_0x425d('0x8'));var client=jayson[_0x425d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3755b6,_0x5eab62,_0x3b1aec){return new BPromise(function(_0x5936ef,_0x5a1885){return client[_0x425d('0xa')](_0x3755b6,_0x3b1aec)[_0x425d('0xb')](function(_0x3df270){logger[_0x425d('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5eab62,'request\x20sent');logger[_0x425d('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5eab62,_0x425d('0xe'),JSON['stringify'](_0x3df270));if(_0x3df270[_0x425d('0xf')]){if(_0x3df270[_0x425d('0xf')][_0x425d('0x10')]===0x1f4){logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);return _0x5a1885(_0x3df270[_0x425d('0xf')]['message']);}logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);return _0x5936ef(_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);}else{logger[_0x425d('0xc')](_0x425d('0x11'),_0x5eab62,_0x425d('0xe'));_0x5936ef(_0x3df270[_0x425d('0x13')]['message']);}})[_0x425d('0x14')](function(_0x33c37a){logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x33c37a);_0x5a1885(_0x33c37a);});});} \ No newline at end of file +var _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x81d85f,_0x2439fb){var _0x1a56d1=function(_0x66ff4d){while(--_0x66ff4d){_0x81d85f['push'](_0x81d85f['shift']());}};_0x1a56d1(++_0x2439fb);}(_0x8aad,0x146));var _0xd8aa=function(_0x4a7aaf,_0x22bdf7){_0x4a7aaf=_0x4a7aaf-0x0;var _0x53e35d=_0x8aad[_0x4a7aaf];return _0x53e35d;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index aa8ddbf..87cc381 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 _0x4171=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','post','put','update','destroy','exports','path','express','Router'];(function(_0x3f84bb,_0x2d3c82){var _0x1ea027=function(_0x507476){while(--_0x507476){_0x3f84bb['push'](_0x3f84bb['shift']());}};_0x1ea027(++_0x2d3c82);}(_0x4171,0xcf));var _0x1417=function(_0x802d3e,_0x16304d){_0x802d3e=_0x802d3e-0x0;var _0x47f27d=_0x4171[_0x802d3e];return _0x47f27d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1417('0x0'));var timeout=require('connect-timeout');var express=require(_0x1417('0x1'));var router=express[_0x1417('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1417('0x3'));var interaction=require(_0x1417('0x4'));var config=require(_0x1417('0x5'));var controller=require(_0x1417('0x6'));router[_0x1417('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1417('0x7')](_0x1417('0x8'),auth[_0x1417('0x9')](),controller['show']);router[_0x1417('0xa')]('/',auth[_0x1417('0x9')](),controller['create']);router[_0x1417('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1417('0xc')]);router['delete'](_0x1417('0x8'),auth[_0x1417('0x9')](),controller[_0x1417('0xd')]);module[_0x1417('0xe')]=router; \ No newline at end of file +var _0x9aea=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','index','get','/:id','isAuthenticated','create','put','update','delete','destroy','multer','path'];(function(_0x46d25e,_0x19f8ef){var _0x37e344=function(_0x546317){while(--_0x546317){_0x46d25e['push'](_0x46d25e['shift']());}};_0x37e344(++_0x19f8ef);}(_0x9aea,0xee));var _0xa9ae=function(_0xe836d2,_0x19fc94){_0xe836d2=_0xe836d2-0x0;var _0x4bca91=_0x9aea[_0xe836d2];return _0x4bca91;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express['Router']();var fs_extra=require(_0xa9ae('0x3'));var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require('../../config/environment');var controller=require(_0xa9ae('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9ae('0x7')]);router[_0xa9ae('0x8')](_0xa9ae('0x9'),auth[_0xa9ae('0xa')](),controller['show']);router['post']('/',auth[_0xa9ae('0xa')](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0xc')]('/:id',auth[_0xa9ae('0xa')](),controller[_0xa9ae('0xd')]);router[_0xa9ae('0xe')](_0xa9ae('0x9'),auth['isAuthenticated'](),controller[_0xa9ae('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 75f0a71..ac9f815 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 _0x6b0a=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6b0a,0x15f));var _0xa6b0=function(_0x52e4d5,_0x57d60a){_0x52e4d5=_0x52e4d5-0x0;var _0x56eb87=_0x6b0a[_0x52e4d5];return _0x56eb87;};'use strict';var Sequelize=require(_0xa6b0('0x0'));module[_0xa6b0('0x1')]={'type':{'type':Sequelize[_0xa6b0('0x2')](_0xa6b0('0x3'),_0xa6b0('0x4'),_0xa6b0('0x5'),_0xa6b0('0x6'),'picklist'),'defaultValue':_0xa6b0('0x3')},'content':{'type':Sequelize[_0xa6b0('0x7')]},'key':{'type':Sequelize[_0xa6b0('0x7')]},'keyType':{'type':Sequelize[_0xa6b0('0x2')](_0xa6b0('0x3'),'variable',_0xa6b0('0x5'))},'keyContent':{'type':Sequelize[_0xa6b0('0x7')]},'idField':{'type':Sequelize[_0xa6b0('0x7')]},'nameField':{'type':Sequelize[_0xa6b0('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa739=['ENUM','string','variable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x1fc420,_0x3ec74c){var _0x3914bb=function(_0x376443){while(--_0x376443){_0x1fc420['push'](_0x1fc420['shift']());}};_0x3914bb(++_0x3ec74c);}(_0xa739,0x19e));var _0x9a73=function(_0x3f11d7,_0x90b75e){_0x3f11d7=_0x3f11d7-0x0;var _0x508f4c=_0xa739[_0x3f11d7];return _0x508f4c;};'use strict';var Sequelize=require(_0x9a73('0x0'));module[_0x9a73('0x1')]={'type':{'type':Sequelize[_0x9a73('0x2')](_0x9a73('0x3'),_0x9a73('0x4'),'customVariable',_0x9a73('0x5'),'picklist'),'defaultValue':_0x9a73('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9a73('0x6')]},'keyType':{'type':Sequelize[_0x9a73('0x2')](_0x9a73('0x3'),_0x9a73('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9a73('0x6')]},'idField':{'type':Sequelize[_0x9a73('0x6')]},'nameField':{'type':Sequelize[_0x9a73('0x6')]},'customField':{'type':Sequelize[_0x9a73('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a73('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 80a1394..5a61329 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 _0x2a9a=['fieldName','type','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','destroy','params','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','name','DeskField','rawAttributes'];(function(_0x32320a,_0x4f2132){var _0x52ed42=function(_0x199718){while(--_0x199718){_0x32320a['push'](_0x32320a['shift']());}};_0x52ed42(++_0x4f2132);}(_0x2a9a,0x64));var _0xa2a9=function(_0x17b0e1,_0x57245c){_0x17b0e1=_0x17b0e1-0x0;var _0x410c10=_0x2a9a[_0x17b0e1];return _0x410c10;};'use strict';var emlformat=require(_0xa2a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa2a9('0x2'));var BPromise=require(_0xa2a9('0x3'));var Mustache=require(_0xa2a9('0x4'));var util=require(_0xa2a9('0x5'));var path=require(_0xa2a9('0x6'));var sox=require('sox');var csv=require(_0xa2a9('0x7'));var ejs=require(_0xa2a9('0x8'));var fs=require('fs');var fs_extra=require(_0xa2a9('0x9'));var _=require(_0xa2a9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa2a9('0x7'));var querystring=require(_0xa2a9('0xb'));var Papa=require(_0xa2a9('0xc'));var Redis=require(_0xa2a9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa2a9('0xe'));var as=require(_0xa2a9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2a9('0x10'))(_0xa2a9('0x11'));var utils=require(_0xa2a9('0x12'));var config=require(_0xa2a9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2a9('0x14'))['db'];function respondWithStatusCode(_0x252808,_0x31b217){_0x31b217=_0x31b217||0xcc;return function(_0x26936b){if(_0x26936b){return _0x252808[_0xa2a9('0x15')](_0x31b217);}return _0x252808[_0xa2a9('0x16')](_0x31b217)['end']();};}function respondWithResult(_0x1e99ed,_0x2c69f2){_0x2c69f2=_0x2c69f2||0xc8;return function(_0x4e4078){if(_0x4e4078){return _0x1e99ed['status'](_0x2c69f2)['json'](_0x4e4078);}};}function respondWithFilteredResult(_0x2826e6,_0x53a6a1){return function(_0x3f667a){if(_0x3f667a){var _0x487e53=typeof _0x53a6a1[_0xa2a9('0x17')]===_0xa2a9('0x18')&&typeof _0x53a6a1[_0xa2a9('0x19')]===_0xa2a9('0x18');var _0x4d8707=_0x3f667a[_0xa2a9('0x1a')];var _0x574964=_0x487e53?0x0:_0x53a6a1[_0xa2a9('0x17')];var _0x49ae63=_0x487e53?_0x3f667a[_0xa2a9('0x1a')]:_0x53a6a1['offset']+_0x53a6a1[_0xa2a9('0x19')];var _0xe86c00;if(_0x49ae63>=_0x4d8707){_0x49ae63=_0x4d8707;_0xe86c00=0xc8;}else{_0xe86c00=0xce;}_0x2826e6[_0xa2a9('0x16')](_0xe86c00);return _0x2826e6[_0xa2a9('0x1b')](_0xa2a9('0x1c'),_0x574964+'-'+_0x49ae63+'/'+_0x4d8707)[_0xa2a9('0x1d')](_0x3f667a);}return null;};}function patchUpdates(_0x17ccc3){return function(_0x447338){try{jsonpatch[_0xa2a9('0x1e')](_0x447338,_0x17ccc3,!![]);}catch(_0x3cdac1){return BPromise['reject'](_0x3cdac1);}return _0x447338[_0xa2a9('0x1f')]();};}function saveUpdates(_0x34abbf,_0x1204e9){return function(_0xe00463){if(_0xe00463){return _0xe00463[_0xa2a9('0x20')](_0x34abbf)[_0xa2a9('0x21')](function(_0x48aa77){return _0x48aa77;});}return null;};}function removeEntity(_0x1ec94d,_0x565c8c){return function(_0x4de5fd){if(_0x4de5fd){return _0x4de5fd['destroy']()[_0xa2a9('0x21')](function(){_0x1ec94d[_0xa2a9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4cc3d,_0x202323){return function(_0x1c81e8){if(!_0x1c81e8){_0xc4cc3d[_0xa2a9('0x15')](0x194);}return _0x1c81e8;};}function handleError(_0x4ae2f7,_0x3be9c0){_0x3be9c0=_0x3be9c0||0x1f4;return function(_0x44e435){logger[_0xa2a9('0x22')](_0x44e435['stack']);if(_0x44e435[_0xa2a9('0x23')]){delete _0x44e435[_0xa2a9('0x23')];}_0x4ae2f7[_0xa2a9('0x16')](_0x3be9c0)['send'](_0x44e435);};}exports['index']=function(_0x4cfd47,_0x10b84f){var _0x12d222={},_0x40ff63={},_0xca45e8={'count':0x0,'rows':[]};var _0x447564=_['map'](db[_0xa2a9('0x24')][_0xa2a9('0x25')],function(_0x124f47){return{'name':_0x124f47[_0xa2a9('0x26')],'type':_0x124f47[_0xa2a9('0x27')]['key']};});_0x40ff63['model']=_[_0xa2a9('0x28')](_0x447564,'name');_0x40ff63['query']=_[_0xa2a9('0x29')](_0x4cfd47[_0xa2a9('0x2a')]);_0x40ff63[_0xa2a9('0x2b')]=_['intersection'](_0x40ff63[_0xa2a9('0x2c')],_0x40ff63[_0xa2a9('0x2a')]);_0x12d222[_0xa2a9('0x2d')]=_[_0xa2a9('0x2e')](_0x40ff63['model'],qs[_0xa2a9('0x2f')](_0x4cfd47[_0xa2a9('0x2a')][_0xa2a9('0x2f')]));_0x12d222[_0xa2a9('0x2d')]=_0x12d222['attributes'][_0xa2a9('0x30')]?_0x12d222['attributes']:_0x40ff63[_0xa2a9('0x2c')];if(!_0x4cfd47['query'][_0xa2a9('0x31')](_0xa2a9('0x32'))){_0x12d222[_0xa2a9('0x19')]=qs['limit'](_0x4cfd47['query'][_0xa2a9('0x19')]);_0x12d222['offset']=qs[_0xa2a9('0x17')](_0x4cfd47['query'][_0xa2a9('0x17')]);}_0x12d222['order']=qs[_0xa2a9('0x33')](_0x4cfd47['query']['sort']);_0x12d222['where']=qs['filters'](_[_0xa2a9('0x34')](_0x4cfd47[_0xa2a9('0x2a')],_0x40ff63[_0xa2a9('0x2b')]),_0x447564);if(_0x4cfd47['query'][_0xa2a9('0x35')]){_0x12d222[_0xa2a9('0x36')]=_['merge'](_0x12d222['where'],{'$or':_[_0xa2a9('0x28')](_0x447564,function(_0x254f42){if(_0x254f42['type']!==_0xa2a9('0x37')){var _0x3a8911={};_0x3a8911[_0x254f42['name']]={'$like':'%'+_0x4cfd47[_0xa2a9('0x2a')][_0xa2a9('0x35')]+'%'};return _0x3a8911;}})});}_0x12d222=_[_0xa2a9('0x38')]({},_0x12d222,_0x4cfd47[_0xa2a9('0x39')]);var _0x6aaad9={'where':_0x12d222[_0xa2a9('0x36')]};return db[_0xa2a9('0x24')][_0xa2a9('0x1a')](_0x6aaad9)[_0xa2a9('0x21')](function(_0x43118d){_0xca45e8[_0xa2a9('0x1a')]=_0x43118d;if(_0x4cfd47[_0xa2a9('0x2a')][_0xa2a9('0x3a')]){_0x12d222[_0xa2a9('0x3b')]=[{'all':!![]}];}return db['DeskField'][_0xa2a9('0x3c')](_0x12d222);})['then'](function(_0x34de68){_0xca45e8[_0xa2a9('0x3d')]=_0x34de68;return _0xca45e8;})[_0xa2a9('0x21')](respondWithFilteredResult(_0x10b84f,_0x12d222))[_0xa2a9('0x3e')](handleError(_0x10b84f,null));};exports[_0xa2a9('0x3f')]=function(_0x20fd9b,_0x4ea462){var _0x1828cb={'raw':!![],'where':{'id':_0x20fd9b['params']['id']}},_0x818b7e={};_0x818b7e['model']=_[_0xa2a9('0x29')](db['DeskField']['rawAttributes']);_0x818b7e['query']=_[_0xa2a9('0x29')](_0x20fd9b['query']);_0x818b7e[_0xa2a9('0x2b')]=_[_0xa2a9('0x2e')](_0x818b7e[_0xa2a9('0x2c')],_0x818b7e['query']);_0x1828cb[_0xa2a9('0x2d')]=_[_0xa2a9('0x2e')](_0x818b7e[_0xa2a9('0x2c')],qs['fields'](_0x20fd9b[_0xa2a9('0x2a')][_0xa2a9('0x2f')]));_0x1828cb[_0xa2a9('0x2d')]=_0x1828cb[_0xa2a9('0x2d')][_0xa2a9('0x30')]?_0x1828cb[_0xa2a9('0x2d')]:_0x818b7e[_0xa2a9('0x2c')];if(_0x20fd9b[_0xa2a9('0x2a')][_0xa2a9('0x3a')]){_0x1828cb[_0xa2a9('0x3b')]=[{'all':!![]}];}_0x1828cb=_[_0xa2a9('0x38')]({},_0x1828cb,_0x20fd9b[_0xa2a9('0x39')]);return db[_0xa2a9('0x24')]['find'](_0x1828cb)[_0xa2a9('0x21')](handleEntityNotFound(_0x4ea462,null))[_0xa2a9('0x21')](respondWithResult(_0x4ea462,null))[_0xa2a9('0x3e')](handleError(_0x4ea462,null));};exports[_0xa2a9('0x40')]=function(_0x10490f,_0x23a5e8){return db[_0xa2a9('0x24')][_0xa2a9('0x40')](_0x10490f['body'],{})[_0xa2a9('0x21')](respondWithResult(_0x23a5e8,0xc9))[_0xa2a9('0x3e')](handleError(_0x23a5e8,null));};exports['update']=function(_0x323406,_0x569e6a){if(_0x323406[_0xa2a9('0x41')]['id']){delete _0x323406[_0xa2a9('0x41')]['id'];}return db[_0xa2a9('0x24')][_0xa2a9('0x42')]({'where':{'id':_0x323406['params']['id']}})[_0xa2a9('0x21')](handleEntityNotFound(_0x569e6a,null))['then'](saveUpdates(_0x323406['body'],null))[_0xa2a9('0x21')](respondWithResult(_0x569e6a,null))[_0xa2a9('0x3e')](handleError(_0x569e6a,null));};exports[_0xa2a9('0x43')]=function(_0x42ba23,_0x53f60f){return db['DeskField']['find']({'where':{'id':_0x42ba23[_0xa2a9('0x44')]['id']}})[_0xa2a9('0x21')](handleEntityNotFound(_0x53f60f,null))[_0xa2a9('0x21')](removeEntity(_0x53f60f,null))['catch'](handleError(_0x53f60f,null));}; \ No newline at end of file +var _0xf722=['includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','DeskField','then'];(function(_0x20f9bc,_0x1057f0){var _0x2060a4=function(_0x3e3e89){while(--_0x3e3e89){_0x20f9bc['push'](_0x20f9bc['shift']());}};_0x2060a4(++_0x1057f0);}(_0xf722,0x18f));var _0x2f72=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf722[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x2f72('0x0'));var rimraf=require(_0x2f72('0x1'));var zipdir=require(_0x2f72('0x2'));var jsonpatch=require(_0x2f72('0x3'));var rp=require('request-promise');var moment=require(_0x2f72('0x4'));var BPromise=require(_0x2f72('0x5'));var Mustache=require(_0x2f72('0x6'));var util=require(_0x2f72('0x7'));var path=require('path');var sox=require(_0x2f72('0x8'));var csv=require(_0x2f72('0x9'));var ejs=require(_0x2f72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2f72('0xb'));var crypto=require(_0x2f72('0xc'));var jsforce=require(_0x2f72('0xd'));var deskjs=require(_0x2f72('0xe'));var toCsv=require(_0x2f72('0x9'));var querystring=require(_0x2f72('0xf'));var Papa=require(_0x2f72('0x10'));var Redis=require(_0x2f72('0x11'));var authService=require(_0x2f72('0x12'));var qs=require(_0x2f72('0x13'));var as=require(_0x2f72('0x14'));var hardwareService=require(_0x2f72('0x15'));var logger=require(_0x2f72('0x16'))(_0x2f72('0x17'));var utils=require('../../config/utils');var config=require(_0x2f72('0x18'));var licenseUtil=require(_0x2f72('0x19'));var db=require(_0x2f72('0x1a'))['db'];function respondWithStatusCode(_0x3e5d60,_0x1220cd){_0x1220cd=_0x1220cd||0xcc;return function(_0x1ef4cd){if(_0x1ef4cd){return _0x3e5d60[_0x2f72('0x1b')](_0x1220cd);}return _0x3e5d60['status'](_0x1220cd)['end']();};}function respondWithResult(_0x455123,_0x9214f0){_0x9214f0=_0x9214f0||0xc8;return function(_0x47bee7){if(_0x47bee7){return _0x455123[_0x2f72('0x1c')](_0x9214f0)[_0x2f72('0x1d')](_0x47bee7);}};}function respondWithFilteredResult(_0x36732a,_0x4dac36){return function(_0x24114a){if(_0x24114a){var _0x24412d=typeof _0x4dac36[_0x2f72('0x1e')]===_0x2f72('0x1f')&&typeof _0x4dac36[_0x2f72('0x20')]===_0x2f72('0x1f');var _0x2e9ea0=_0x24114a[_0x2f72('0x21')];var _0x5ab0d2=_0x24412d?0x0:_0x4dac36['offset'];var _0x38b050=_0x24412d?_0x24114a[_0x2f72('0x21')]:_0x4dac36[_0x2f72('0x1e')]+_0x4dac36[_0x2f72('0x20')];var _0x496edb;if(_0x38b050>=_0x2e9ea0){_0x38b050=_0x2e9ea0;_0x496edb=0xc8;}else{_0x496edb=0xce;}_0x36732a['status'](_0x496edb);return _0x36732a[_0x2f72('0x22')](_0x2f72('0x23'),_0x5ab0d2+'-'+_0x38b050+'/'+_0x2e9ea0)['json'](_0x24114a);}return null;};}function patchUpdates(_0x1ff1fe){return function(_0xdda902){try{jsonpatch['apply'](_0xdda902,_0x1ff1fe,!![]);}catch(_0x35edd2){return BPromise[_0x2f72('0x24')](_0x35edd2);}return _0xdda902[_0x2f72('0x25')]();};}function saveUpdates(_0x1af16b,_0x39c756){return function(_0x2f0ad8){if(_0x2f0ad8){return _0x2f0ad8[_0x2f72('0x26')](_0x1af16b)['then'](function(_0x3b2924){return _0x3b2924;});}return null;};}function removeEntity(_0x33282c,_0x174311){return function(_0x866be6){if(_0x866be6){return _0x866be6[_0x2f72('0x27')]()['then'](function(){_0x33282c[_0x2f72('0x1c')](0xcc)[_0x2f72('0x28')]();});}};}function handleEntityNotFound(_0x46cee2,_0x16cbab){return function(_0x5670c2){if(!_0x5670c2){_0x46cee2[_0x2f72('0x1b')](0x194);}return _0x5670c2;};}function handleError(_0x4f82a3,_0x87760e){_0x87760e=_0x87760e||0x1f4;return function(_0x5763a6){logger[_0x2f72('0x29')](_0x5763a6[_0x2f72('0x2a')]);if(_0x5763a6['name']){delete _0x5763a6[_0x2f72('0x2b')];}_0x4f82a3[_0x2f72('0x1c')](_0x87760e)[_0x2f72('0x2c')](_0x5763a6);};}exports[_0x2f72('0x2d')]=function(_0x5b8f6b,_0x30f3a3){var _0x50e170={},_0x31038b={},_0x4f099e={'count':0x0,'rows':[]};var _0x26994e=_[_0x2f72('0x2e')](db['DeskField'][_0x2f72('0x2f')],function(_0x2b2158){return{'name':_0x2b2158[_0x2f72('0x30')],'type':_0x2b2158[_0x2f72('0x31')][_0x2f72('0x32')]};});_0x31038b[_0x2f72('0x33')]=_[_0x2f72('0x2e')](_0x26994e,_0x2f72('0x2b'));_0x31038b['query']=_[_0x2f72('0x34')](_0x5b8f6b[_0x2f72('0x35')]);_0x31038b[_0x2f72('0x36')]=_[_0x2f72('0x37')](_0x31038b[_0x2f72('0x33')],_0x31038b[_0x2f72('0x35')]);_0x50e170[_0x2f72('0x38')]=_[_0x2f72('0x37')](_0x31038b[_0x2f72('0x33')],qs[_0x2f72('0x39')](_0x5b8f6b[_0x2f72('0x35')][_0x2f72('0x39')]));_0x50e170[_0x2f72('0x38')]=_0x50e170[_0x2f72('0x38')][_0x2f72('0x3a')]?_0x50e170[_0x2f72('0x38')]:_0x31038b[_0x2f72('0x33')];if(!_0x5b8f6b[_0x2f72('0x35')]['hasOwnProperty'](_0x2f72('0x3b'))){_0x50e170['limit']=qs[_0x2f72('0x20')](_0x5b8f6b[_0x2f72('0x35')][_0x2f72('0x20')]);_0x50e170[_0x2f72('0x1e')]=qs[_0x2f72('0x1e')](_0x5b8f6b[_0x2f72('0x35')]['offset']);}_0x50e170[_0x2f72('0x3c')]=qs[_0x2f72('0x3d')](_0x5b8f6b[_0x2f72('0x35')]['sort']);_0x50e170[_0x2f72('0x3e')]=qs[_0x2f72('0x36')](_[_0x2f72('0x3f')](_0x5b8f6b[_0x2f72('0x35')],_0x31038b[_0x2f72('0x36')]),_0x26994e);if(_0x5b8f6b[_0x2f72('0x35')][_0x2f72('0x40')]){_0x50e170['where']=_[_0x2f72('0x41')](_0x50e170[_0x2f72('0x3e')],{'$or':_[_0x2f72('0x2e')](_0x26994e,function(_0x24a00c){if(_0x24a00c['type']!=='VIRTUAL'){var _0x490809={};_0x490809[_0x24a00c[_0x2f72('0x2b')]]={'$like':'%'+_0x5b8f6b['query'][_0x2f72('0x40')]+'%'};return _0x490809;}})});}_0x50e170=_[_0x2f72('0x41')]({},_0x50e170,_0x5b8f6b[_0x2f72('0x42')]);var _0x195adc={'where':_0x50e170[_0x2f72('0x3e')]};return db[_0x2f72('0x43')]['count'](_0x195adc)[_0x2f72('0x44')](function(_0x5376bb){_0x4f099e[_0x2f72('0x21')]=_0x5376bb;if(_0x5b8f6b['query'][_0x2f72('0x45')]){_0x50e170[_0x2f72('0x46')]=[{'all':!![]}];}return db[_0x2f72('0x43')][_0x2f72('0x47')](_0x50e170);})[_0x2f72('0x44')](function(_0x39e831){_0x4f099e['rows']=_0x39e831;return _0x4f099e;})[_0x2f72('0x44')](respondWithFilteredResult(_0x30f3a3,_0x50e170))[_0x2f72('0x48')](handleError(_0x30f3a3,null));};exports[_0x2f72('0x49')]=function(_0x1ec480,_0xd18837){var _0x2f3338={'raw':!![],'where':{'id':_0x1ec480[_0x2f72('0x4a')]['id']}},_0x5bbfd7={};_0x5bbfd7[_0x2f72('0x33')]=_[_0x2f72('0x34')](db['DeskField']['rawAttributes']);_0x5bbfd7[_0x2f72('0x35')]=_[_0x2f72('0x34')](_0x1ec480[_0x2f72('0x35')]);_0x5bbfd7[_0x2f72('0x36')]=_['intersection'](_0x5bbfd7['model'],_0x5bbfd7[_0x2f72('0x35')]);_0x2f3338[_0x2f72('0x38')]=_[_0x2f72('0x37')](_0x5bbfd7['model'],qs[_0x2f72('0x39')](_0x1ec480['query']['fields']));_0x2f3338['attributes']=_0x2f3338[_0x2f72('0x38')][_0x2f72('0x3a')]?_0x2f3338['attributes']:_0x5bbfd7[_0x2f72('0x33')];if(_0x1ec480[_0x2f72('0x35')]['includeAll']){_0x2f3338['include']=[{'all':!![]}];}_0x2f3338=_[_0x2f72('0x41')]({},_0x2f3338,_0x1ec480[_0x2f72('0x42')]);return db[_0x2f72('0x43')]['find'](_0x2f3338)['then'](handleEntityNotFound(_0xd18837,null))[_0x2f72('0x44')](respondWithResult(_0xd18837,null))[_0x2f72('0x48')](handleError(_0xd18837,null));};exports[_0x2f72('0x4b')]=function(_0xa23924,_0x2e5f30){return db[_0x2f72('0x43')]['create'](_0xa23924[_0x2f72('0x4c')],{})[_0x2f72('0x44')](respondWithResult(_0x2e5f30,0xc9))[_0x2f72('0x48')](handleError(_0x2e5f30,null));};exports[_0x2f72('0x26')]=function(_0x53d447,_0x118534){if(_0x53d447['body']['id']){delete _0x53d447['body']['id'];}return db[_0x2f72('0x43')][_0x2f72('0x4d')]({'where':{'id':_0x53d447[_0x2f72('0x4a')]['id']}})[_0x2f72('0x44')](handleEntityNotFound(_0x118534,null))[_0x2f72('0x44')](saveUpdates(_0x53d447[_0x2f72('0x4c')],null))[_0x2f72('0x44')](respondWithResult(_0x118534,null))[_0x2f72('0x48')](handleError(_0x118534,null));};exports[_0x2f72('0x27')]=function(_0x37d60b,_0x59b31f){return db[_0x2f72('0x43')][_0x2f72('0x4d')]({'where':{'id':_0x37d60b[_0x2f72('0x4a')]['id']}})[_0x2f72('0x44')](handleEntityNotFound(_0x59b31f,null))[_0x2f72('0x44')](removeEntity(_0x59b31f,null))[_0x2f72('0x48')](handleError(_0x59b31f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 2400aa9..6a5d810 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 _0x87ff=['DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define'];(function(_0x5dcff6,_0x4a8796){var _0x2699cd=function(_0x36a328){while(--_0x36a328){_0x5dcff6['push'](_0x5dcff6['shift']());}};_0x2699cd(++_0x4a8796);}(_0x87ff,0x16c));var _0xf87f=function(_0x46570c,_0x2776e5){_0x46570c=_0x46570c-0x0;var _0x386de4=_0x87ff[_0x46570c];return _0x386de4;};'use strict';var _=require(_0xf87f('0x0'));var util=require(_0xf87f('0x1'));var logger=require(_0xf87f('0x2'))(_0xf87f('0x3'));var moment=require('moment');var BPromise=require(_0xf87f('0x4'));var rp=require(_0xf87f('0x5'));var fs=require('fs');var path=require(_0xf87f('0x6'));var rimraf=require(_0xf87f('0x7'));var config=require('../../config/environment');var attributes=require(_0xf87f('0x8'));module[_0xf87f('0x9')]=function(_0x641284,_0x2d00e1){return _0x641284[_0xf87f('0xa')](_0xf87f('0xb'),attributes,{'tableName':_0xf87f('0xc'),'paranoid':![],'indexes':[{'name':_0xf87f('0xd'),'fields':[_0xf87f('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66b1=['desk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x48b00c,_0x16690b){var _0x55d181=function(_0x58b5bd){while(--_0x58b5bd){_0x48b00c['push'](_0x48b00c['shift']());}};_0x55d181(++_0x16690b);}(_0x66b1,0x120));var _0x166b=function(_0x59fffc,_0x1e96a2){_0x59fffc=_0x59fffc-0x0;var _0x21e467=_0x66b1[_0x59fffc];return _0x21e467;};'use strict';var _=require('lodash');var util=require(_0x166b('0x0'));var logger=require(_0x166b('0x1'))(_0x166b('0x2'));var moment=require(_0x166b('0x3'));var BPromise=require(_0x166b('0x4'));var rp=require(_0x166b('0x5'));var fs=require('fs');var path=require(_0x166b('0x6'));var rimraf=require('rimraf');var config=require(_0x166b('0x7'));var attributes=require(_0x166b('0x8'));module[_0x166b('0x9')]=function(_0x2c47ba,_0xe61d18){return _0x2c47ba[_0x166b('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x166b('0xb'),'fields':[_0x166b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 9adad1a..d2045fe 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 _0x4115=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x304693,_0x497520){var _0x4924=function(_0x19e59e){while(--_0x19e59e){_0x304693['push'](_0x304693['shift']());}};_0x4924(++_0x497520);}(_0x4115,0x66));var _0x5411=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x4115[_0x176329];return _0x31997c;};'use strict';var _=require(_0x5411('0x0'));var util=require('util');var moment=require(_0x5411('0x1'));var BPromise=require('bluebird');var rs=require(_0x5411('0x2'));var fs=require('fs');var Redis=require(_0x5411('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5411('0x4'))(_0x5411('0x5'));var config=require('../../config/environment');var jayson=require(_0x5411('0x6'));var client=jayson['client'][_0x5411('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38420b,_0x5eca2c,_0xb0ef16){return new BPromise(function(_0x1ab7f4,_0x344efc){return client[_0x5411('0x8')](_0x38420b,_0xb0ef16)[_0x5411('0x9')](function(_0x311d2d){logger[_0x5411('0xa')](_0x5411('0xb'),_0x5eca2c,_0x5411('0xc'));logger[_0x5411('0xd')](_0x5411('0xe'),_0x5eca2c,_0x5411('0xc'),JSON[_0x5411('0xf')](_0x311d2d));if(_0x311d2d['error']){if(_0x311d2d['error']['code']===0x1f4){logger['error'](_0x5411('0xb'),_0x5eca2c,_0x311d2d[_0x5411('0x10')][_0x5411('0x11')]);return _0x344efc(_0x311d2d[_0x5411('0x10')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x5eca2c,_0x311d2d[_0x5411('0x10')][_0x5411('0x11')]);return _0x1ab7f4(_0x311d2d[_0x5411('0x10')][_0x5411('0x11')]);}else{logger[_0x5411('0xa')](_0x5411('0xb'),_0x5eca2c,_0x5411('0xc'));_0x1ab7f4(_0x311d2d['result'][_0x5411('0x11')]);}})[_0x5411('0x12')](function(_0x4a2bb6){logger[_0x5411('0x10')](_0x5411('0xb'),_0x5eca2c,_0x4a2bb6);_0x344efc(_0x4a2bb6);});});} \ No newline at end of file +var _0xf707=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','moment','bluebird','ioredis'];(function(_0x215ca3,_0x4b664f){var _0x23fe99=function(_0x7d8c74){while(--_0x7d8c74){_0x215ca3['push'](_0x215ca3['shift']());}};_0x23fe99(++_0x4b664f);}(_0xf707,0x95));var _0x7f70=function(_0x26aaa5,_0x502890){_0x26aaa5=_0x26aaa5-0x0;var _0xabd052=_0xf707[_0x26aaa5];return _0xabd052;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f70('0x0'));var BPromise=require(_0x7f70('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f70('0x2'));var db=require(_0x7f70('0x3'))['db'];var utils=require(_0x7f70('0x4'));var logger=require(_0x7f70('0x5'))(_0x7f70('0x6'));var config=require(_0x7f70('0x7'));var jayson=require(_0x7f70('0x8'));var client=jayson['client'][_0x7f70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26c9ba,_0x5d8f34,_0x3cf675){return new BPromise(function(_0x1ff318,_0x1c9206){return client['request'](_0x26c9ba,_0x3cf675)[_0x7f70('0xa')](function(_0x2f2be5){logger[_0x7f70('0xb')]('DeskField,\x20%s,\x20%s',_0x5d8f34,_0x7f70('0xc'));logger[_0x7f70('0xd')](_0x7f70('0xe'),_0x5d8f34,_0x7f70('0xc'),JSON[_0x7f70('0xf')](_0x2f2be5));if(_0x2f2be5['error']){if(_0x2f2be5[_0x7f70('0x10')]['code']===0x1f4){logger[_0x7f70('0x10')](_0x7f70('0x11'),_0x5d8f34,_0x2f2be5[_0x7f70('0x10')]['message']);return _0x1c9206(_0x2f2be5['error'][_0x7f70('0x12')]);}logger[_0x7f70('0x10')]('DeskField,\x20%s,\x20%s',_0x5d8f34,_0x2f2be5[_0x7f70('0x10')][_0x7f70('0x12')]);return _0x1ff318(_0x2f2be5[_0x7f70('0x10')][_0x7f70('0x12')]);}else{logger[_0x7f70('0xb')](_0x7f70('0x11'),_0x5d8f34,_0x7f70('0xc'));_0x1ff318(_0x2f2be5['result'][_0x7f70('0x12')]);}})['catch'](function(_0x9aa63f){logger[_0x7f70('0x10')]('DeskField,\x20%s,\x20%s',_0x5d8f34,_0x9aa63f);_0x1c9206(_0x9aa63f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 00378dd..a5a767e 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 _0x0cd0=['/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3bbe4b,_0x35f067){var _0x402d37=function(_0x2f7f78){while(--_0x2f7f78){_0x3bbe4b['push'](_0x3bbe4b['shift']());}};_0x402d37(++_0x35f067);}(_0x0cd0,0xbe));var _0x00cd=function(_0x3c7598,_0x3437b4){_0x3c7598=_0x3c7598-0x0;var _0x5a3789=_0x0cd0[_0x3c7598];return _0x5a3789;};'use strict';var multer=require('multer');var util=require(_0x00cd('0x0'));var path=require(_0x00cd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x00cd('0x2'));var auth=require(_0x00cd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x00cd('0x4'));var controller=require('./intDynamics365Account.controller');router[_0x00cd('0x5')]('/',auth[_0x00cd('0x6')](),controller[_0x00cd('0x7')]);router[_0x00cd('0x5')](_0x00cd('0x8'),auth[_0x00cd('0x6')](),controller[_0x00cd('0x9')]);router['get'](_0x00cd('0xa'),auth[_0x00cd('0x6')](),controller[_0x00cd('0xb')]);router[_0x00cd('0x5')]('/:id/fields',auth[_0x00cd('0x6')](),controller[_0x00cd('0xc')]);router['post']('/',auth[_0x00cd('0x6')](),controller[_0x00cd('0xd')]);router[_0x00cd('0xe')](_0x00cd('0xa'),auth[_0x00cd('0x6')](),controller[_0x00cd('0xf')]);router[_0x00cd('0x10')](_0x00cd('0x8'),auth[_0x00cd('0x6')](),controller[_0x00cd('0x11')]);router[_0x00cd('0x12')](_0x00cd('0x8'),auth[_0x00cd('0x6')](),controller[_0x00cd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x45e7=['post','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getFields','create'];(function(_0x2cb92a,_0x24b44c){var _0x4cff98=function(_0xe43dad){while(--_0xe43dad){_0x2cb92a['push'](_0x2cb92a['shift']());}};_0x4cff98(++_0x24b44c);}(_0x45e7,0x195));var _0x745e=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0x45e7[_0xa03344];return _0x38acfd;};'use strict';var multer=require(_0x745e('0x0'));var util=require('util');var path=require(_0x745e('0x1'));var timeout=require(_0x745e('0x2'));var express=require(_0x745e('0x3'));var router=express[_0x745e('0x4')]();var fs_extra=require(_0x745e('0x5'));var auth=require(_0x745e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x745e('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x745e('0x8')]('/',auth[_0x745e('0x9')](),controller[_0x745e('0xa')]);router[_0x745e('0x8')](_0x745e('0xb'),auth[_0x745e('0x9')](),controller['show']);router[_0x745e('0x8')](_0x745e('0xc'),auth[_0x745e('0x9')](),controller['getConfigurations']);router[_0x745e('0x8')]('/:id/fields',auth[_0x745e('0x9')](),controller[_0x745e('0xd')]);router['post']('/',auth[_0x745e('0x9')](),controller[_0x745e('0xe')]);router[_0x745e('0xf')](_0x745e('0xc'),auth[_0x745e('0x9')](),controller[_0x745e('0x10')]);router[_0x745e('0x11')]('/:id',auth[_0x745e('0x9')](),controller['update']);router[_0x745e('0x12')](_0x745e('0xb'),auth[_0x745e('0x9')](),controller[_0x745e('0x13')]);module[_0x745e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 250ddda..bfed3aa 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 _0x522b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0x522b,0x1c3));var _0xb522=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0x522b[_0x2e7a43];return _0x52e9e1;};'use strict';var Sequelize=require(_0xb522('0x0'));module[_0xb522('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb522('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xb522('0x2')]},'clientId':{'type':Sequelize[_0xb522('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb522('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb522('0x2')]},'modernAuthentication':{'type':Sequelize[_0xb522('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa992=['sequelize','exports','STRING','BOOLEAN'];(function(_0x19c22a,_0x251e5a){var _0x345426=function(_0x57d487){while(--_0x57d487){_0x19c22a['push'](_0x19c22a['shift']());}};_0x345426(++_0x251e5a);}(_0xa992,0x18c));var _0x2a99=function(_0x79a072,_0x429720){_0x79a072=_0x79a072-0x0;var _0x4cac81=_0xa992[_0x79a072];return _0x4cac81;};'use strict';var Sequelize=require(_0x2a99('0x0'));module[_0x2a99('0x1')]={'name':{'type':Sequelize[_0x2a99('0x2')]},'username':{'type':Sequelize[_0x2a99('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2a99('0x2')]},'tenantId':{'type':Sequelize[_0x2a99('0x2')]},'clientId':{'type':Sequelize[_0x2a99('0x2')]},'clientSecret':{'type':Sequelize[_0x2a99('0x2')]},'serverUrl':{'type':Sequelize[_0x2a99('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2a99('0x2')]},'modernAuthentication':{'type':Sequelize[_0x2a99('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a2deb90..a3002ed 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 _0x0a1a=['index','map','Dynamics365Account','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/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','LogicalName','forEach','@odata.type','substring','lastIndexOf','push','isNil','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','error','name','send'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0x0a1a,0x161));var _0xa0a1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a1a[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0xa0a1('0x0'));var util=require(_0xa0a1('0x1'));var _=require(_0xa0a1('0x2'));var qs=require(_0xa0a1('0x3'));var logger=require(_0xa0a1('0x4'))(_0xa0a1('0x5'));var db=require(_0xa0a1('0x6'))['db'];var integrations=require(_0xa0a1('0x7'));function respondWithResult(_0x56fb50,_0x3450a6){_0x3450a6=_0x3450a6||0xc8;return function(_0x23f6c6){if(_0x23f6c6){return _0x56fb50[_0xa0a1('0x8')](_0x3450a6)[_0xa0a1('0x9')](_0x23f6c6);}};}function respondWithFilteredResult(_0xa5b83,_0x3e0353){return function(_0x482fd3){if(_0x482fd3){var _0x2989ff=typeof _0x3e0353[_0xa0a1('0xa')]===_0xa0a1('0xb')&&typeof _0x3e0353[_0xa0a1('0xc')]===_0xa0a1('0xb');var _0x303535=_0x482fd3[_0xa0a1('0xd')];var _0x21e1af=_0x2989ff?0x0:_0x3e0353[_0xa0a1('0xa')];var _0x42a779=_0x2989ff?_0x482fd3[_0xa0a1('0xd')]:_0x3e0353[_0xa0a1('0xa')]+_0x3e0353['limit'];var _0x1dce43;if(_0x42a779>=_0x303535){_0x42a779=_0x303535;_0x1dce43=0xc8;}else{_0x1dce43=0xce;}_0xa5b83[_0xa0a1('0x8')](_0x1dce43);return _0xa5b83['set'](_0xa0a1('0xe'),_0x21e1af+'-'+_0x42a779+'/'+_0x303535)[_0xa0a1('0x9')](_0x482fd3);}return null;};}function saveUpdates(_0x1796af){return function(_0x104599){if(_0x104599){return _0x104599[_0xa0a1('0xf')](_0x1796af)[_0xa0a1('0x10')](function(_0x17d639){return _0x17d639;});}return null;};}function removeEntity(_0x56c83d){return function(_0x3ec4ec){if(_0x3ec4ec){return _0x3ec4ec[_0xa0a1('0x11')]()[_0xa0a1('0x10')](function(){_0x56c83d[_0xa0a1('0x8')](0xcc)[_0xa0a1('0x12')]();});}};}function handleEntityNotFound(_0x367871){return function(_0x2aa317){if(!_0x2aa317){_0x367871[_0xa0a1('0x13')](0x194);}return _0x2aa317;};}function handleError(_0x26dd29,_0x5aca98){_0x5aca98=_0x5aca98||0x1f4;return function(_0x58074c){logger[_0xa0a1('0x14')](_0x58074c['stack']);if(_0x58074c[_0xa0a1('0x15')]){delete _0x58074c[_0xa0a1('0x15')];}_0x26dd29[_0xa0a1('0x8')](_0x5aca98)[_0xa0a1('0x16')](_0x58074c);};}exports[_0xa0a1('0x17')]=function(_0x413f01,_0x226d1b){var _0x1008cf={},_0x5b0e25={},_0x15b8af={'count':0x0,'rows':[]};var _0x228638=_[_0xa0a1('0x18')](db[_0xa0a1('0x19')]['rawAttributes'],function(_0x3c31dd){return{'name':_0x3c31dd[_0xa0a1('0x1a')],'type':_0x3c31dd[_0xa0a1('0x1b')]['key']};});_0x5b0e25['model']=_[_0xa0a1('0x18')](_0x228638,'name');_0x5b0e25[_0xa0a1('0x1c')]=_[_0xa0a1('0x1d')](_0x413f01[_0xa0a1('0x1c')]);_0x5b0e25['filters']=_[_0xa0a1('0x1e')](_0x5b0e25[_0xa0a1('0x1f')],_0x5b0e25[_0xa0a1('0x1c')]);_0x1008cf['attributes']=_['intersection'](_0x5b0e25['model'],qs[_0xa0a1('0x20')](_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0x20')]));_0x1008cf[_0xa0a1('0x21')]=_0x1008cf[_0xa0a1('0x21')][_0xa0a1('0x22')]?_0x1008cf['attributes']:_0x5b0e25['model'];if(!_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0x23')](_0xa0a1('0x24'))){_0x1008cf[_0xa0a1('0xc')]=qs[_0xa0a1('0xc')](_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0xc')]);_0x1008cf[_0xa0a1('0xa')]=qs[_0xa0a1('0xa')](_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0xa')]);}_0x1008cf[_0xa0a1('0x25')]=qs[_0xa0a1('0x26')](_0x413f01['query'][_0xa0a1('0x26')]);_0x1008cf[_0xa0a1('0x27')]=qs['filters'](_[_0xa0a1('0x28')](_0x413f01[_0xa0a1('0x1c')],_0x5b0e25[_0xa0a1('0x29')]),_0x228638);if(_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0x2a')]){_0x1008cf[_0xa0a1('0x27')]=_[_0xa0a1('0x2b')](_0x1008cf[_0xa0a1('0x27')],{'$or':_['map'](_0x228638,function(_0x551af8){if(_0x551af8[_0xa0a1('0x1b')]!==_0xa0a1('0x2c')){var _0x586c90={};_0x586c90[_0x551af8[_0xa0a1('0x15')]]={'$like':'%'+_0x413f01[_0xa0a1('0x1c')]['filter']+'%'};return _0x586c90;}})});}_0x1008cf=_[_0xa0a1('0x2b')]({},_0x1008cf,_0x413f01[_0xa0a1('0x2d')]);var _0x1900e5={'where':_0x1008cf[_0xa0a1('0x27')]};return db[_0xa0a1('0x19')]['count'](_0x1900e5)[_0xa0a1('0x10')](function(_0x41a78e){_0x15b8af[_0xa0a1('0xd')]=_0x41a78e;if(_0x413f01[_0xa0a1('0x1c')][_0xa0a1('0x2e')]){_0x1008cf['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0xa0a1('0x2f')](_0x1008cf);})[_0xa0a1('0x10')](function(_0x1ac54d){_0x15b8af[_0xa0a1('0x30')]=_0x1ac54d;return _0x15b8af;})['then'](respondWithFilteredResult(_0x226d1b,_0x1008cf))[_0xa0a1('0x31')](handleError(_0x226d1b,null));};exports['show']=function(_0x5b1b1b,_0x781504){var _0x461f54={'raw':![],'where':{'id':_0x5b1b1b[_0xa0a1('0x32')]['id']}},_0x4ae288={};_0x4ae288[_0xa0a1('0x1f')]=_[_0xa0a1('0x1d')](db['Dynamics365Account'][_0xa0a1('0x33')]);_0x4ae288[_0xa0a1('0x1c')]=_[_0xa0a1('0x1d')](_0x5b1b1b[_0xa0a1('0x1c')]);_0x4ae288['filters']=_[_0xa0a1('0x1e')](_0x4ae288['model'],_0x4ae288['query']);_0x461f54[_0xa0a1('0x21')]=_[_0xa0a1('0x1e')](_0x4ae288['model'],qs[_0xa0a1('0x20')](_0x5b1b1b[_0xa0a1('0x1c')][_0xa0a1('0x20')]));_0x461f54[_0xa0a1('0x21')]=_0x461f54[_0xa0a1('0x21')][_0xa0a1('0x22')]?_0x461f54[_0xa0a1('0x21')]:_0x4ae288['model'];if(_0x5b1b1b[_0xa0a1('0x1c')]['includeAll']){_0x461f54[_0xa0a1('0x34')]=[{'all':!![]}];}_0x461f54=_['merge']({},_0x461f54,_0x5b1b1b[_0xa0a1('0x2d')]);return db[_0xa0a1('0x19')][_0xa0a1('0x35')](_0x461f54)[_0xa0a1('0x10')](handleEntityNotFound(_0x781504,null))['then'](respondWithResult(_0x781504,null))['catch'](handleError(_0x781504,null));};exports[_0xa0a1('0x36')]=function(_0x19817f,_0x21d1f5){return db['Dynamics365Account']['create'](_0x19817f[_0xa0a1('0x37')],{})[_0xa0a1('0x10')](respondWithResult(_0x21d1f5,0xc9))[_0xa0a1('0x31')](handleError(_0x21d1f5,null));};exports[_0xa0a1('0xf')]=function(_0x2cf6bd,_0x418dce){if(_0x2cf6bd[_0xa0a1('0x37')]['id']){delete _0x2cf6bd[_0xa0a1('0x37')]['id'];}return db['Dynamics365Account'][_0xa0a1('0x35')]({'where':{'id':_0x2cf6bd[_0xa0a1('0x32')]['id']}})[_0xa0a1('0x10')](handleEntityNotFound(_0x418dce,null))[_0xa0a1('0x10')](saveUpdates(_0x2cf6bd[_0xa0a1('0x37')],null))[_0xa0a1('0x10')](respondWithResult(_0x418dce,null))['catch'](handleError(_0x418dce,null));};exports[_0xa0a1('0x11')]=function(_0x37742e,_0x5b750c){return db[_0xa0a1('0x19')][_0xa0a1('0x35')]({'where':{'id':_0x37742e['params']['id']}})[_0xa0a1('0x10')](handleEntityNotFound(_0x5b750c,null))['then'](removeEntity(_0x5b750c,null))[_0xa0a1('0x31')](handleError(_0x5b750c,null));};exports[_0xa0a1('0x38')]=function(_0x1ba6eb,_0xdaa881){var _0x4b6ef2={};var _0x31ec00={};var _0x39fe2b;var _0x541c34;return db['Dynamics365Account'][_0xa0a1('0x39')]({'where':{'id':_0x1ba6eb['params']['id']}})[_0xa0a1('0x10')](handleEntityNotFound(_0xdaa881,null))['then'](function(_0x2f5702){if(_0x2f5702){_0x39fe2b=_0x2f5702;_0x31ec00[_0xa0a1('0x1f')]=_[_0xa0a1('0x1d')](db[_0xa0a1('0x3a')]['rawAttributes']);_0x31ec00['query']=_[_0xa0a1('0x1d')](_0x1ba6eb[_0xa0a1('0x1c')]);_0x31ec00[_0xa0a1('0x29')]=_[_0xa0a1('0x1e')](_0x31ec00[_0xa0a1('0x1f')],_0x31ec00[_0xa0a1('0x1c')]);_0x4b6ef2[_0xa0a1('0x21')]=_[_0xa0a1('0x1e')](_0x31ec00[_0xa0a1('0x1f')],qs[_0xa0a1('0x20')](_0x1ba6eb['query'][_0xa0a1('0x20')]));_0x4b6ef2['attributes']=_0x4b6ef2[_0xa0a1('0x21')]['length']?_0x4b6ef2[_0xa0a1('0x21')]:_0x31ec00[_0xa0a1('0x1f')];_0x4b6ef2[_0xa0a1('0x25')]=qs[_0xa0a1('0x26')](_0x1ba6eb[_0xa0a1('0x1c')][_0xa0a1('0x26')]);_0x4b6ef2[_0xa0a1('0x27')]=qs[_0xa0a1('0x29')](_[_0xa0a1('0x28')](_0x1ba6eb[_0xa0a1('0x1c')],_0x31ec00[_0xa0a1('0x29')]));if(_0x1ba6eb[_0xa0a1('0x1c')][_0xa0a1('0x2a')]){_0x4b6ef2[_0xa0a1('0x27')]=_[_0xa0a1('0x2b')](_0x4b6ef2[_0xa0a1('0x27')],{'$or':_[_0xa0a1('0x18')](_0x4b6ef2[_0xa0a1('0x21')],function(_0x112ce1){var _0x3a45e8={};_0x3a45e8[_0x112ce1]={'$like':'%'+_0x1ba6eb['query'][_0xa0a1('0x2a')]+'%'};return _0x3a45e8;})});}_0x4b6ef2=_[_0xa0a1('0x2b')]({},_0x4b6ef2,_0x1ba6eb[_0xa0a1('0x2d')]);return _0x39fe2b[_0xa0a1('0x38')](_0x4b6ef2);}})[_0xa0a1('0x10')](function(_0x39eb83){if(_0x39eb83){_0x541c34=_0x39eb83[_0xa0a1('0x22')];if(!_0x1ba6eb[_0xa0a1('0x1c')]['hasOwnProperty'](_0xa0a1('0x24'))){_0x4b6ef2['limit']=qs[_0xa0a1('0xc')](_0x1ba6eb['query'][_0xa0a1('0xc')]);_0x4b6ef2[_0xa0a1('0xa')]=qs['offset'](_0x1ba6eb['query'][_0xa0a1('0xa')]);}return _0x39fe2b[_0xa0a1('0x38')](_0x4b6ef2);}})[_0xa0a1('0x10')](function(_0xb44d4b){if(_0xb44d4b){return _0xb44d4b?{'count':_0x541c34,'rows':_0xb44d4b}:null;}})['then'](respondWithResult(_0xdaa881,null))[_0xa0a1('0x31')](handleError(_0xdaa881,null));};exports['addConfiguration']=function(_0x17dcee,_0xb0044a){if(_0x17dcee['body']['id']){delete _0x17dcee[_0xa0a1('0x37')]['id'];}return db[_0xa0a1('0x19')][_0xa0a1('0x39')]({'where':{'id':_0x17dcee[_0xa0a1('0x32')]['id']}})[_0xa0a1('0x10')](handleEntityNotFound(_0xb0044a,null))[_0xa0a1('0x10')](function(_0x24c4de){if(_0x24c4de){_0x17dcee[_0xa0a1('0x37')][_0xa0a1('0x3b')]=_0x24c4de['id'];_0x17dcee[_0xa0a1('0x37')][_0xa0a1('0x3c')]=integrations[_0xa0a1('0x3d')](_0x17dcee[_0xa0a1('0x37')][_0xa0a1('0x3e')],_0x17dcee[_0xa0a1('0x37')][_0xa0a1('0x1b')]);_0x17dcee[_0xa0a1('0x37')]['Descriptions']=integrations[_0xa0a1('0x3f')](_0x17dcee[_0xa0a1('0x37')][_0xa0a1('0x3e')],_0x17dcee[_0xa0a1('0x37')]['type']);return db[_0xa0a1('0x3a')][_0xa0a1('0x36')](_0x17dcee[_0xa0a1('0x37')],{'include':[{'model':db[_0xa0a1('0x40')],'as':'Subjects'},{'model':db[_0xa0a1('0x40')],'as':_0xa0a1('0x41')}]});}return null;})[_0xa0a1('0x10')](respondWithResult(_0xb0044a,null))[_0xa0a1('0x31')](handleError(_0xb0044a,null));};function sanitizeRemoteUri(_0x3942c8){var _0xec689e=_0x3942c8['slice'](-0x1);if(_0xec689e==='/')return _0x3942c8['substring'](0x0,_0x3942c8['lastIndexOf'](_0xec689e));return _0x3942c8;}function getWebApiUrl(_0x318762){return util[_0xa0a1('0x42')](_0xa0a1('0x43'),_0x318762);}exports[_0xa0a1('0x44')]=function(_0x1ff7f5,_0x429f4e){var _0x456b7f=_0x1ff7f5[_0xa0a1('0x1c')][_0xa0a1('0x45')];var _0x489e67=_0x456b7f===_0xa0a1('0x46')?_0xa0a1('0x47'):_0xa0a1('0x48');var _0x40e6d7='';var _0x24536a='';var _0x459ade='';var _0x511ad1='';var _0x3fb820='';var _0x4a0bde='';var _0x17a595='';var _0x157e6f='';var _0x306b70=[_0xa0a1('0x49'),'description',_0xa0a1('0x4a'),_0xa0a1('0x4b'),'caseorigincode',_0xa0a1('0x4c'),_0xa0a1('0x4d'),_0xa0a1('0x4e'),_0xa0a1('0x4f'),_0xa0a1('0x50')];var _0x13ab04=[_0xa0a1('0x51'),_0xa0a1('0x52'),_0xa0a1('0x53'),_0xa0a1('0x54'),'contactidname',_0xa0a1('0x55'),_0xa0a1('0x56'),_0xa0a1('0x57'),_0xa0a1('0x58'),'createdbyexternalpartyyominame',_0xa0a1('0x59'),_0xa0a1('0x5a'),'createdon',_0xa0a1('0x5b'),'createdonbehalfbyyominame',_0xa0a1('0x5c'),_0xa0a1('0x5d'),_0xa0a1('0x5e'),'emailaddress',_0xa0a1('0x5f'),_0xa0a1('0x60'),_0xa0a1('0x61'),_0xa0a1('0x62'),_0xa0a1('0x63'),'firstresponsebykpiidname','followupby','importsequencenumber','influencescore',_0xa0a1('0x64'),'lastonholdtime','masteridname',_0xa0a1('0x65'),_0xa0a1('0x66'),_0xa0a1('0x67'),_0xa0a1('0x68'),_0xa0a1('0x69'),_0xa0a1('0x6a'),_0xa0a1('0x6b'),'msdyn_incidenttypename',_0xa0a1('0x6c'),_0xa0a1('0x6d'),_0xa0a1('0x6e'),'overriddencreatedon',_0xa0a1('0x6f'),_0xa0a1('0x70'),_0xa0a1('0x71'),_0xa0a1('0x72'),_0xa0a1('0x73'),_0xa0a1('0x74'),_0xa0a1('0x75'),_0xa0a1('0x76'),_0xa0a1('0x77'),'resolveby',_0xa0a1('0x78'),_0xa0a1('0x79'),_0xa0a1('0x7a'),_0xa0a1('0x7b'),_0xa0a1('0x7c'),_0xa0a1('0x7d'),'slaname','socialprofileidname','statecode',_0xa0a1('0x7e'),_0xa0a1('0x7f'),_0xa0a1('0x80'),_0xa0a1('0x81'),_0xa0a1('0x82'),_0xa0a1('0x83'),_0xa0a1('0x84'),_0xa0a1('0x85')];var _0x23b3d8=_0x306b70[_0xa0a1('0x86')](_0x13ab04);return db['Dynamics365Account'][_0xa0a1('0x39')]({'where':{'id':_0x1ff7f5[_0xa0a1('0x32')]['id']},'attributes':['id',_0xa0a1('0x87'),_0xa0a1('0x88'),_0xa0a1('0x89'),'tenantId',_0xa0a1('0x8a'),_0xa0a1('0x8b'),_0xa0a1('0x8c')],'include':[{'model':db[_0xa0a1('0x8d')],'as':_0xa0a1('0x8d'),'attributes':['id','data5',_0xa0a1('0x8e')]}]})[_0xa0a1('0x10')](handleEntityNotFound(_0x429f4e,null))['then'](function(_0x157da4){if(_0x157da4){if(_0x157da4[_0xa0a1('0x8c')]){_0x157da4[_0xa0a1('0x8f')]=_0x157da4['CloudProvider'][_0xa0a1('0x90')];_0x157e6f=sanitizeRemoteUri(_0x157da4[_0xa0a1('0x8d')][_0xa0a1('0x8e')]);_0x17a595=getWebApiUrl(_0x157e6f);return _0x157da4;}_0x157e6f=sanitizeRemoteUri(_0x157da4['remoteUri']);_0x17a595=getWebApiUrl(_0x157e6f);var _0x29cc12={'method':_0xa0a1('0x91'),'uri':_0xa0a1('0x92')+_0x157da4['tenantId']+_0xa0a1('0x93'),'form':{'client_id':_0x157da4[_0xa0a1('0x8a')],'resource':_0x157e6f,'username':_0x157da4[_0xa0a1('0x87')],'password':_0x157da4[_0xa0a1('0x88')],'grant_type':_0xa0a1('0x88'),'client_secret':_0x157da4['clientSecret']},'json':!![]};return rp(_0x29cc12);}})[_0xa0a1('0x10')](function(_0x52dbae){_0x4a0bde=_0x52dbae[_0xa0a1('0x8f')];var _0x4f4624={'method':_0xa0a1('0x94'),'uri':encodeURI(_0x17a595+_0xa0a1('0x95')+_0x489e67+'\x27'),'headers':{'Authorization':_0xa0a1('0x96')+_0x4a0bde,'If-None-Match':null,'OData-Version':_0xa0a1('0x97')},'json':!![]};return rp(_0x4f4624);})['then'](function(_0x2b2ebb){var _0x58078d=_0x2b2ebb[_0xa0a1('0x98')][0x0];var _0x560bfd=_0x58078d[_0xa0a1('0x99')];var _0xf8ff83={'method':_0xa0a1('0x94'),'uri':_0x17a595+_0xa0a1('0x9a')+_0x560bfd+_0xa0a1('0x9b'),'headers':{'Authorization':_0xa0a1('0x96')+_0x4a0bde,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xf8ff83);})[_0xa0a1('0x10')](function(_0x32040a){_0x40e6d7=_0x32040a;_0x24536a=_0x40e6d7[_0xa0a1('0x9c')];_0x24536a=_[_0xa0a1('0x9d')](_0x24536a,function(_0x1783b4){return!_0x23b3d8['includes'](_0x1783b4[_0xa0a1('0x9e')]);});var _0x5c1a45=[];var _0x4a88e0=[];_0x24536a[_0xa0a1('0x9f')](function(_0x1f8200){if(_0x1f8200['@odata.type']){var _0x98d97e=_0x1f8200[_0xa0a1('0xa0')][_0xa0a1('0xa1')](_0x1f8200[_0xa0a1('0xa0')][_0xa0a1('0xa2')]('.')+0x1);if(_0x98d97e==='PicklistAttributeMetadata'){_0x5c1a45[_0xa0a1('0xa3')](getSelectList(_0x17a595,_0x456b7f,_0x4a88e0,_0x40e6d7[_0xa0a1('0x99')],_0x1f8200[_0xa0a1('0x99')],_0x4a0bde));}}});return Promise['all'](_0x5c1a45);})['then'](function(_0x3e4d8e){_0x459ade=_0x3e4d8e[0x0];var _0x3cdb3a=[];var _0x59b76d=[];_0x24536a[_0xa0a1('0x9f')](function(_0x8ce1c){if(!_[_0xa0a1('0xa4')](_0x8ce1c[_0xa0a1('0xa0')])){var _0x8682be=_0x8ce1c[_0xa0a1('0xa0')][_0xa0a1('0xa1')](_0x8ce1c[_0xa0a1('0xa0')][_0xa0a1('0xa2')]('.')+0x1);if(_0x8682be==='BooleanAttributeMetadata'){_0x3cdb3a[_0xa0a1('0xa3')](getBooleanList(_0x17a595,_0x456b7f,_0x59b76d,_0x40e6d7['MetadataId'],_0x8ce1c[_0xa0a1('0x99')],_0x4a0bde));}}});return Promise[_0xa0a1('0xa5')](_0x3cdb3a);})[_0xa0a1('0x10')](function(_0x1beb49){_0x511ad1=_0x1beb49[0x0];var _0x11f31c=[];var _0x13a9dc=[];_0x24536a[_0xa0a1('0x9f')](function(_0x303e96){if(_0x303e96[_0xa0a1('0xa0')]){var _0x14579a=_0x303e96[_0xa0a1('0xa0')]['substring'](_0x303e96[_0xa0a1('0xa0')]['lastIndexOf']('.')+0x1);if(_0x14579a===_0xa0a1('0xa6')||_0x14579a===_0xa0a1('0xa7')||_0x14579a===_0xa0a1('0xa8')||_0x14579a==='IntegerAttributeMetadata'||_0x14579a===_0xa0a1('0xa9')||_0x14579a===_0xa0a1('0xaa')||_0x14579a===_0xa0a1('0xab')||_0x14579a==='EntityNameAttributeMetadata'||_0x14579a==='StateAttributeMetadata'||_0x14579a==='DecimalAttributeMetadata'){_0x11f31c[_0xa0a1('0xa3')](getInputList(_0x17a595,_0x456b7f,_0x14579a,_0x13a9dc,_0x40e6d7[_0xa0a1('0x99')],_0x303e96['MetadataId'],_0x4a0bde));}}});return Promise[_0xa0a1('0xa5')](_0x11f31c);})[_0xa0a1('0x10')](function(_0xe33559){_0x3fb820=_0xe33559[0x0];var _0x38319f=_0x459ade[_0xa0a1('0x86')](_0x511ad1)[_0xa0a1('0x86')](_0x3fb820);var _0x5e50b0={'count':_0x38319f['length'],'rows':_0x38319f};return _0x5e50b0;})[_0xa0a1('0x10')](respondWithResult(_0x429f4e,null))[_0xa0a1('0x31')](function(_0x5eac0f){var _0x214577=_0x1ff7f5[_0xa0a1('0x1c')][_0xa0a1('0xac')]?0x1f4:_0x5eac0f[_0xa0a1('0xad')]||0x1f4;logger[_0xa0a1('0x14')](_0x5eac0f['stack']);delete _0x5eac0f['name'];if(_0x214577===0x191){_0x214577=0x190;}_0x429f4e[_0xa0a1('0x8')](_0x214577)[_0xa0a1('0x16')](_0x1ff7f5[_0xa0a1('0x1c')][_0xa0a1('0xac')]?{'message':_0xa0a1('0xae'),'statusCode':_0x5eac0f['statusCode']}:_0x5eac0f);});};function getSelectList(_0xaa7ca,_0x51e855,_0xc47f55,_0x5c0c54,_0x435b76,_0x454d03){var _0x1109d7={'method':_0xa0a1('0x94'),'uri':_0xaa7ca+_0xa0a1('0x9a')+_0x5c0c54+')/Attributes('+_0x435b76+_0xa0a1('0xaf')+_0xa0a1('0xb0'),'headers':{'Authorization':_0xa0a1('0x96')+_0x454d03,'If-None-Match':null,'OData-Version':_0xa0a1('0x97')},'json':!![]};return rp(_0x1109d7)[_0xa0a1('0x10')](function(_0x58dfed){var _0x4bf09=[];var _0x225ac0=_0x58dfed[_0xa0a1('0xb1')][_0xa0a1('0xb2')];_0x225ac0[_0xa0a1('0x9f')](function(_0xc16153){_0x4bf09[_0xa0a1('0xa3')]({'name':_0xc16153[_0xa0a1('0xb3')][_0xa0a1('0xb4')][_0xa0a1('0xb3')],'value':String(_0xc16153['Value'])});});var _0x4274ef={'id':_0x51e855+'_'+_0x58dfed['LogicalName'],'name':_0x58dfed[_0xa0a1('0xb5')][_0xa0a1('0xb4')][_0xa0a1('0xb3')],'custom':![],'options':_0x4bf09};_0xc47f55[_0xa0a1('0xa3')](_0x4274ef);return _0xc47f55;});}function getBooleanList(_0x323833,_0x40a573,_0x37bb43,_0x3e0467,_0x13102d,_0x53c096){var _0x2e11e4={'method':_0xa0a1('0x94'),'uri':_0x323833+'EntityDefinitions('+_0x3e0467+_0xa0a1('0xb6')+_0x13102d+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xa0a1('0x96')+_0x53c096,'If-None-Match':null,'OData-Version':_0xa0a1('0x97')},'json':!![]};return rp(_0x2e11e4)[_0xa0a1('0x10')](function(_0x3a8535){var _0x11594d=[];_0x11594d['push']({'name':_0x3a8535['OptionSet']['TrueOption'][_0xa0a1('0xb3')][_0xa0a1('0xb4')][_0xa0a1('0xb3')],'value':_0xa0a1('0xb7')},{'name':_0x3a8535[_0xa0a1('0xb1')][_0xa0a1('0xb8')][_0xa0a1('0xb3')][_0xa0a1('0xb4')][_0xa0a1('0xb3')],'value':_0xa0a1('0xb9')});var _0x41a633={'id':_0x40a573+'_'+_0x3a8535[_0xa0a1('0x9e')],'name':_0x3a8535['DisplayName'][_0xa0a1('0xb4')][_0xa0a1('0xb3')],'custom':![],'options':_0x11594d};_0x37bb43['push'](_0x41a633);return _0x37bb43;});}function getInputList(_0x2d2418,_0x468a83,_0x573257,_0x250968,_0x7bc9df,_0x5e1caa,_0x3fae36){var _0x1960ac={'method':_0xa0a1('0x94'),'uri':_0x2d2418+_0xa0a1('0x9a')+_0x7bc9df+_0xa0a1('0xb6')+_0x5e1caa+_0xa0a1('0xba')+_0x573257+_0xa0a1('0xbb'),'headers':{'Authorization':_0xa0a1('0x96')+_0x3fae36,'If-None-Match':null,'OData-Version':_0xa0a1('0x97')},'json':!![]};return rp(_0x1960ac)['then'](function(_0x2fcb5b){var _0x5b7706={'id':_0x468a83+'_'+_0x2fcb5b[_0xa0a1('0x9e')],'name':_0x2fcb5b[_0xa0a1('0xb5')][_0xa0a1('0xb4')]?_0x2fcb5b['DisplayName'][_0xa0a1('0xb4')]['Label']:_0x2fcb5b[_0xa0a1('0x9e')],'custom':![],'options':[]};_0x250968[_0xa0a1('0xa3')](_0x5b7706);return _0x250968;});} \ No newline at end of file +var _0xc306=['masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','username','remoteUri','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','all','forEach','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','push','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','Bearer\x20','OptionSet','true','FalseOption','false','EntityDefinitions(','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','limit','undefined','count','offset','status','set','Content-Range','then','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','params','keys','include','find','catch','create','body','update','destroy','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','description','ownerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc306,0x1b6));var _0x6c30=function(_0x3de9fd,_0xae93c2){_0x3de9fd=_0x3de9fd-0x0;var _0x268307=_0xc306[_0x3de9fd];return _0x268307;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x6c30('0x0'));var qs=require(_0x6c30('0x1'));var logger=require(_0x6c30('0x2'))('api');var db=require(_0x6c30('0x3'))['db'];var integrations=require(_0x6c30('0x4'));function respondWithResult(_0x200e9c,_0x1f62c4){_0x1f62c4=_0x1f62c4||0xc8;return function(_0x21b9be){if(_0x21b9be){return _0x200e9c['status'](_0x1f62c4)[_0x6c30('0x5')](_0x21b9be);}};}function respondWithFilteredResult(_0xead9f0,_0x5ecb9f){return function(_0x55ab91){if(_0x55ab91){var _0x3a1e90=typeof _0x5ecb9f['offset']==='undefined'&&typeof _0x5ecb9f[_0x6c30('0x6')]===_0x6c30('0x7');var _0x1a369a=_0x55ab91[_0x6c30('0x8')];var _0x56db10=_0x3a1e90?0x0:_0x5ecb9f[_0x6c30('0x9')];var _0x1df06f=_0x3a1e90?_0x55ab91[_0x6c30('0x8')]:_0x5ecb9f[_0x6c30('0x9')]+_0x5ecb9f['limit'];var _0x1fad78;if(_0x1df06f>=_0x1a369a){_0x1df06f=_0x1a369a;_0x1fad78=0xc8;}else{_0x1fad78=0xce;}_0xead9f0[_0x6c30('0xa')](_0x1fad78);return _0xead9f0[_0x6c30('0xb')](_0x6c30('0xc'),_0x56db10+'-'+_0x1df06f+'/'+_0x1a369a)[_0x6c30('0x5')](_0x55ab91);}return null;};}function saveUpdates(_0x2b4394){return function(_0x166104){if(_0x166104){return _0x166104['update'](_0x2b4394)[_0x6c30('0xd')](function(_0x5ef1f3){return _0x5ef1f3;});}return null;};}function removeEntity(_0xd99ae5){return function(_0x49461a){if(_0x49461a){return _0x49461a['destroy']()['then'](function(){_0xd99ae5['status'](0xcc)[_0x6c30('0xe')]();});}};}function handleEntityNotFound(_0x41691e){return function(_0x14d28f){if(!_0x14d28f){_0x41691e[_0x6c30('0xf')](0x194);}return _0x14d28f;};}function handleError(_0x3e44ab,_0x34996a){_0x34996a=_0x34996a||0x1f4;return function(_0x1b1091){logger[_0x6c30('0x10')](_0x1b1091['stack']);if(_0x1b1091[_0x6c30('0x11')]){delete _0x1b1091[_0x6c30('0x11')];}_0x3e44ab['status'](_0x34996a)[_0x6c30('0x12')](_0x1b1091);};}exports[_0x6c30('0x13')]=function(_0x1f19e4,_0x4e3bb3){var _0x265c08={},_0x9bdf26={},_0x51823d={'count':0x0,'rows':[]};var _0x3ff1ff=_[_0x6c30('0x14')](db[_0x6c30('0x15')][_0x6c30('0x16')],function(_0x476a60){return{'name':_0x476a60[_0x6c30('0x17')],'type':_0x476a60[_0x6c30('0x18')]['key']};});_0x9bdf26[_0x6c30('0x19')]=_[_0x6c30('0x14')](_0x3ff1ff,'name');_0x9bdf26[_0x6c30('0x1a')]=_['keys'](_0x1f19e4[_0x6c30('0x1a')]);_0x9bdf26[_0x6c30('0x1b')]=_[_0x6c30('0x1c')](_0x9bdf26[_0x6c30('0x19')],_0x9bdf26[_0x6c30('0x1a')]);_0x265c08[_0x6c30('0x1d')]=_[_0x6c30('0x1c')](_0x9bdf26[_0x6c30('0x19')],qs['fields'](_0x1f19e4['query'][_0x6c30('0x1e')]));_0x265c08[_0x6c30('0x1d')]=_0x265c08[_0x6c30('0x1d')][_0x6c30('0x1f')]?_0x265c08[_0x6c30('0x1d')]:_0x9bdf26[_0x6c30('0x19')];if(!_0x1f19e4[_0x6c30('0x1a')][_0x6c30('0x20')](_0x6c30('0x21'))){_0x265c08[_0x6c30('0x6')]=qs[_0x6c30('0x6')](_0x1f19e4[_0x6c30('0x1a')][_0x6c30('0x6')]);_0x265c08[_0x6c30('0x9')]=qs[_0x6c30('0x9')](_0x1f19e4[_0x6c30('0x1a')][_0x6c30('0x9')]);}_0x265c08[_0x6c30('0x22')]=qs[_0x6c30('0x23')](_0x1f19e4[_0x6c30('0x1a')][_0x6c30('0x23')]);_0x265c08[_0x6c30('0x24')]=qs['filters'](_[_0x6c30('0x25')](_0x1f19e4['query'],_0x9bdf26[_0x6c30('0x1b')]),_0x3ff1ff);if(_0x1f19e4['query'][_0x6c30('0x26')]){_0x265c08['where']=_['merge'](_0x265c08['where'],{'$or':_[_0x6c30('0x14')](_0x3ff1ff,function(_0x5dc654){if(_0x5dc654[_0x6c30('0x18')]!==_0x6c30('0x27')){var _0x4da9e0={};_0x4da9e0[_0x5dc654['name']]={'$like':'%'+_0x1f19e4[_0x6c30('0x1a')][_0x6c30('0x26')]+'%'};return _0x4da9e0;}})});}_0x265c08=_[_0x6c30('0x28')]({},_0x265c08,_0x1f19e4[_0x6c30('0x29')]);var _0x39468d={'where':_0x265c08[_0x6c30('0x24')]};return db[_0x6c30('0x15')]['count'](_0x39468d)[_0x6c30('0xd')](function(_0x354b9e){_0x51823d[_0x6c30('0x8')]=_0x354b9e;if(_0x1f19e4[_0x6c30('0x1a')]['includeAll']){_0x265c08['include']=[{'all':!![]}];}return db[_0x6c30('0x15')][_0x6c30('0x2a')](_0x265c08);})[_0x6c30('0xd')](function(_0xb79dbb){_0x51823d[_0x6c30('0x2b')]=_0xb79dbb;return _0x51823d;})[_0x6c30('0xd')](respondWithFilteredResult(_0x4e3bb3,_0x265c08))['catch'](handleError(_0x4e3bb3,null));};exports['show']=function(_0x4c862f,_0x371c8f){var _0x31ac3a={'raw':![],'where':{'id':_0x4c862f[_0x6c30('0x2c')]['id']}},_0x1f4c1c={};_0x1f4c1c[_0x6c30('0x19')]=_[_0x6c30('0x2d')](db[_0x6c30('0x15')][_0x6c30('0x16')]);_0x1f4c1c[_0x6c30('0x1a')]=_['keys'](_0x4c862f[_0x6c30('0x1a')]);_0x1f4c1c['filters']=_['intersection'](_0x1f4c1c['model'],_0x1f4c1c['query']);_0x31ac3a[_0x6c30('0x1d')]=_[_0x6c30('0x1c')](_0x1f4c1c[_0x6c30('0x19')],qs['fields'](_0x4c862f[_0x6c30('0x1a')][_0x6c30('0x1e')]));_0x31ac3a[_0x6c30('0x1d')]=_0x31ac3a['attributes'][_0x6c30('0x1f')]?_0x31ac3a[_0x6c30('0x1d')]:_0x1f4c1c[_0x6c30('0x19')];if(_0x4c862f[_0x6c30('0x1a')]['includeAll']){_0x31ac3a[_0x6c30('0x2e')]=[{'all':!![]}];}_0x31ac3a=_['merge']({},_0x31ac3a,_0x4c862f[_0x6c30('0x29')]);return db[_0x6c30('0x15')][_0x6c30('0x2f')](_0x31ac3a)['then'](handleEntityNotFound(_0x371c8f,null))[_0x6c30('0xd')](respondWithResult(_0x371c8f,null))[_0x6c30('0x30')](handleError(_0x371c8f,null));};exports['create']=function(_0xbfd2a2,_0x8e5991){return db[_0x6c30('0x15')][_0x6c30('0x31')](_0xbfd2a2[_0x6c30('0x32')],{})[_0x6c30('0xd')](respondWithResult(_0x8e5991,0xc9))[_0x6c30('0x30')](handleError(_0x8e5991,null));};exports[_0x6c30('0x33')]=function(_0x3e0784,_0x1b5f2b){if(_0x3e0784['body']['id']){delete _0x3e0784[_0x6c30('0x32')]['id'];}return db[_0x6c30('0x15')][_0x6c30('0x2f')]({'where':{'id':_0x3e0784[_0x6c30('0x2c')]['id']}})[_0x6c30('0xd')](handleEntityNotFound(_0x1b5f2b,null))[_0x6c30('0xd')](saveUpdates(_0x3e0784[_0x6c30('0x32')],null))[_0x6c30('0xd')](respondWithResult(_0x1b5f2b,null))[_0x6c30('0x30')](handleError(_0x1b5f2b,null));};exports[_0x6c30('0x34')]=function(_0x6b3669,_0x330c5d){return db[_0x6c30('0x15')][_0x6c30('0x2f')]({'where':{'id':_0x6b3669[_0x6c30('0x2c')]['id']}})[_0x6c30('0xd')](handleEntityNotFound(_0x330c5d,null))['then'](removeEntity(_0x330c5d,null))[_0x6c30('0x30')](handleError(_0x330c5d,null));};exports[_0x6c30('0x35')]=function(_0x47b3f4,_0x21d7da){var _0x10d953={};var _0x254fa2={};var _0x3dedf0;var _0x4010a9;return db[_0x6c30('0x15')][_0x6c30('0x36')]({'where':{'id':_0x47b3f4['params']['id']}})['then'](handleEntityNotFound(_0x21d7da,null))['then'](function(_0x5f4107){if(_0x5f4107){_0x3dedf0=_0x5f4107;_0x254fa2[_0x6c30('0x19')]=_[_0x6c30('0x2d')](db[_0x6c30('0x37')]['rawAttributes']);_0x254fa2[_0x6c30('0x1a')]=_[_0x6c30('0x2d')](_0x47b3f4[_0x6c30('0x1a')]);_0x254fa2[_0x6c30('0x1b')]=_[_0x6c30('0x1c')](_0x254fa2[_0x6c30('0x19')],_0x254fa2[_0x6c30('0x1a')]);_0x10d953['attributes']=_[_0x6c30('0x1c')](_0x254fa2[_0x6c30('0x19')],qs[_0x6c30('0x1e')](_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x1e')]));_0x10d953[_0x6c30('0x1d')]=_0x10d953[_0x6c30('0x1d')][_0x6c30('0x1f')]?_0x10d953[_0x6c30('0x1d')]:_0x254fa2[_0x6c30('0x19')];_0x10d953[_0x6c30('0x22')]=qs[_0x6c30('0x23')](_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x23')]);_0x10d953[_0x6c30('0x24')]=qs['filters'](_[_0x6c30('0x25')](_0x47b3f4[_0x6c30('0x1a')],_0x254fa2[_0x6c30('0x1b')]));if(_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x26')]){_0x10d953[_0x6c30('0x24')]=_['merge'](_0x10d953[_0x6c30('0x24')],{'$or':_[_0x6c30('0x14')](_0x10d953['attributes'],function(_0x32c436){var _0x40c932={};_0x40c932[_0x32c436]={'$like':'%'+_0x47b3f4['query'][_0x6c30('0x26')]+'%'};return _0x40c932;})});}_0x10d953=_[_0x6c30('0x28')]({},_0x10d953,_0x47b3f4[_0x6c30('0x29')]);return _0x3dedf0['getConfigurations'](_0x10d953);}})[_0x6c30('0xd')](function(_0x4e6d91){if(_0x4e6d91){_0x4010a9=_0x4e6d91[_0x6c30('0x1f')];if(!_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x20')](_0x6c30('0x21'))){_0x10d953['limit']=qs[_0x6c30('0x6')](_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x6')]);_0x10d953[_0x6c30('0x9')]=qs['offset'](_0x47b3f4[_0x6c30('0x1a')][_0x6c30('0x9')]);}return _0x3dedf0['getConfigurations'](_0x10d953);}})[_0x6c30('0xd')](function(_0x40bac6){if(_0x40bac6){return _0x40bac6?{'count':_0x4010a9,'rows':_0x40bac6}:null;}})['then'](respondWithResult(_0x21d7da,null))[_0x6c30('0x30')](handleError(_0x21d7da,null));};exports[_0x6c30('0x38')]=function(_0x49acc9,_0x1fb8d9){if(_0x49acc9[_0x6c30('0x32')]['id']){delete _0x49acc9[_0x6c30('0x32')]['id'];}return db[_0x6c30('0x15')][_0x6c30('0x36')]({'where':{'id':_0x49acc9[_0x6c30('0x2c')]['id']}})[_0x6c30('0xd')](handleEntityNotFound(_0x1fb8d9,null))[_0x6c30('0xd')](function(_0x163221){if(_0x163221){_0x49acc9[_0x6c30('0x32')]['AccountId']=_0x163221['id'];_0x49acc9[_0x6c30('0x32')][_0x6c30('0x39')]=integrations['getSubjects'](_0x49acc9['body']['channel'],_0x49acc9[_0x6c30('0x32')][_0x6c30('0x18')]);_0x49acc9['body'][_0x6c30('0x3a')]=integrations[_0x6c30('0x3b')](_0x49acc9['body'][_0x6c30('0x3c')],_0x49acc9[_0x6c30('0x32')]['type']);return db[_0x6c30('0x37')]['create'](_0x49acc9['body'],{'include':[{'model':db[_0x6c30('0x3d')],'as':_0x6c30('0x39')},{'model':db[_0x6c30('0x3d')],'as':_0x6c30('0x3a')}]});}return null;})['then'](respondWithResult(_0x1fb8d9,null))[_0x6c30('0x30')](handleError(_0x1fb8d9,null));};function sanitizeRemoteUri(_0x1a50bc){var _0x4f0c4a=_0x1a50bc[_0x6c30('0x3e')](-0x1);if(_0x4f0c4a==='/')return _0x1a50bc[_0x6c30('0x3f')](0x0,_0x1a50bc['lastIndexOf'](_0x4f0c4a));return _0x1a50bc;}function getWebApiUrl(_0x5b4c49){return util[_0x6c30('0x40')](_0x6c30('0x41'),_0x5b4c49);}exports[_0x6c30('0x42')]=function(_0x1b124d,_0x231b0e){var _0x2b981d=_0x1b124d[_0x6c30('0x1a')]['ticketType'];var _0x4e2988=_0x2b981d===_0x6c30('0x43')?_0x6c30('0x44'):_0x6c30('0x45');var _0x2f98ec='';var _0x315ebf='';var _0x35a25d='';var _0xacc48='';var _0x24319e='';var _0x279229='';var _0x276dfa='';var _0x428b56='';var _0x56e172=['title',_0x6c30('0x46'),'customerid',_0x6c30('0x47'),_0x6c30('0x48'),'subject','phonenumber',_0x6c30('0x49'),_0x6c30('0x4a'),_0x6c30('0x4b')];var _0x430d1d=[_0x6c30('0x4c'),_0x6c30('0x4d'),_0x6c30('0x4e'),_0x6c30('0x4f'),'contactidname',_0x6c30('0x50'),'contractdetailidname',_0x6c30('0x51'),'createdbyexternalpartyname',_0x6c30('0x52'),_0x6c30('0x53'),_0x6c30('0x54'),_0x6c30('0x55'),_0x6c30('0x56'),_0x6c30('0x57'),_0x6c30('0x58'),_0x6c30('0x59'),_0x6c30('0x5a'),_0x6c30('0x5b'),'entitlementidname',_0x6c30('0x5c'),'entityimage_url',_0x6c30('0x5d'),'exchangerate',_0x6c30('0x5e'),_0x6c30('0x5f'),_0x6c30('0x60'),_0x6c30('0x61'),_0x6c30('0x62'),'lastonholdtime',_0x6c30('0x63'),_0x6c30('0x64'),_0x6c30('0x65'),_0x6c30('0x66'),_0x6c30('0x67'),'modifiedon','modifiedonbehalfbyname',_0x6c30('0x68'),'msdyn_incidenttypename',_0x6c30('0x69'),_0x6c30('0x6a'),_0x6c30('0x6b'),'overriddencreatedon',_0x6c30('0x6c'),_0x6c30('0x6d'),_0x6c30('0x6e'),'parentcaseidname','primarycontactidname',_0x6c30('0x6f'),'prioritycodename',_0x6c30('0x70'),_0x6c30('0x71'),'resolveby',_0x6c30('0x72'),_0x6c30('0x73'),'responsiblecontactidname',_0x6c30('0x74'),_0x6c30('0x75'),'slainvokedidname',_0x6c30('0x76'),_0x6c30('0x77'),'statecode',_0x6c30('0x78'),_0x6c30('0x79'),_0x6c30('0x7a'),'timezoneruleversionnumber',_0x6c30('0x7b'),_0x6c30('0x7c'),'utcconversiontimezonecode',_0x6c30('0x7d')];var _0x22e376=_0x56e172['concat'](_0x430d1d);return db[_0x6c30('0x15')]['findOne']({'where':{'id':_0x1b124d[_0x6c30('0x2c')]['id']},'attributes':['id',_0x6c30('0x7e'),'password',_0x6c30('0x7f'),'tenantId','clientId',_0x6c30('0x80'),_0x6c30('0x81')],'include':[{'model':db['CloudProvider'],'as':_0x6c30('0x82'),'attributes':['id','data5',_0x6c30('0x83')]}]})[_0x6c30('0xd')](handleEntityNotFound(_0x231b0e,null))[_0x6c30('0xd')](function(_0x1d52be){if(_0x1d52be){if(_0x1d52be['modernAuthentication']){_0x1d52be[_0x6c30('0x84')]=_0x1d52be[_0x6c30('0x82')][_0x6c30('0x85')];_0x428b56=sanitizeRemoteUri(_0x1d52be['CloudProvider'][_0x6c30('0x83')]);_0x276dfa=getWebApiUrl(_0x428b56);return _0x1d52be;}_0x428b56=sanitizeRemoteUri(_0x1d52be[_0x6c30('0x7f')]);_0x276dfa=getWebApiUrl(_0x428b56);var _0x5783bd={'method':_0x6c30('0x86'),'uri':_0x6c30('0x87')+_0x1d52be['tenantId']+'/oauth2/token','form':{'client_id':_0x1d52be['clientId'],'resource':_0x428b56,'username':_0x1d52be[_0x6c30('0x7e')],'password':_0x1d52be['password'],'grant_type':'password','client_secret':_0x1d52be['clientSecret']},'json':!![]};return rp(_0x5783bd);}})['then'](function(_0x2862d3){_0x279229=_0x2862d3[_0x6c30('0x84')];var _0x2bcffb={'method':_0x6c30('0x88'),'uri':encodeURI(_0x276dfa+_0x6c30('0x89')+_0x4e2988+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x279229,'If-None-Match':null,'OData-Version':_0x6c30('0x8a')},'json':!![]};return rp(_0x2bcffb);})[_0x6c30('0xd')](function(_0x6b2a3c){var _0x2e3ed=_0x6b2a3c[_0x6c30('0x8b')][0x0];var _0x465025=_0x2e3ed[_0x6c30('0x8c')];var _0xe25b23={'method':_0x6c30('0x88'),'uri':_0x276dfa+'EntityDefinitions('+_0x465025+_0x6c30('0x8d'),'headers':{'Authorization':'Bearer\x20'+_0x279229,'If-None-Match':null,'OData-Version':_0x6c30('0x8a')},'json':!![]};return rp(_0xe25b23);})[_0x6c30('0xd')](function(_0x46a1bf){_0x2f98ec=_0x46a1bf;_0x315ebf=_0x2f98ec[_0x6c30('0x8e')];_0x315ebf=_[_0x6c30('0x8f')](_0x315ebf,function(_0x4e479b){return!_0x22e376['includes'](_0x4e479b[_0x6c30('0x90')]);});var _0x121d6b=[];var _0x389c29=[];_0x315ebf['forEach'](function(_0x376c0e){if(_0x376c0e[_0x6c30('0x91')]){var _0x323bc8=_0x376c0e[_0x6c30('0x91')][_0x6c30('0x3f')](_0x376c0e['@odata.type'][_0x6c30('0x92')]('.')+0x1);if(_0x323bc8===_0x6c30('0x93')){_0x121d6b['push'](getSelectList(_0x276dfa,_0x2b981d,_0x389c29,_0x2f98ec[_0x6c30('0x8c')],_0x376c0e[_0x6c30('0x8c')],_0x279229));}}});return Promise[_0x6c30('0x94')](_0x121d6b);})['then'](function(_0x5aee97){_0x35a25d=_0x5aee97[0x0];var _0x49f135=[];var _0x10997c=[];_0x315ebf[_0x6c30('0x95')](function(_0x87df0d){if(!_[_0x6c30('0x96')](_0x87df0d[_0x6c30('0x91')])){var _0x6c3589=_0x87df0d[_0x6c30('0x91')][_0x6c30('0x3f')](_0x87df0d['@odata.type'][_0x6c30('0x92')]('.')+0x1);if(_0x6c3589===_0x6c30('0x97')){_0x49f135['push'](getBooleanList(_0x276dfa,_0x2b981d,_0x10997c,_0x2f98ec[_0x6c30('0x8c')],_0x87df0d[_0x6c30('0x8c')],_0x279229));}}});return Promise[_0x6c30('0x94')](_0x49f135);})[_0x6c30('0xd')](function(_0x11244c){_0xacc48=_0x11244c[0x0];var _0x55dfb9=[];var _0x27b9ec=[];_0x315ebf[_0x6c30('0x95')](function(_0x3b4303){if(_0x3b4303[_0x6c30('0x91')]){var _0x4571b0=_0x3b4303[_0x6c30('0x91')][_0x6c30('0x3f')](_0x3b4303[_0x6c30('0x91')]['lastIndexOf']('.')+0x1);if(_0x4571b0==='StringAttributeMetadata'||_0x4571b0===_0x6c30('0x98')||_0x4571b0===_0x6c30('0x99')||_0x4571b0==='IntegerAttributeMetadata'||_0x4571b0===_0x6c30('0x9a')||_0x4571b0===_0x6c30('0x9b')||_0x4571b0===_0x6c30('0x9c')||_0x4571b0===_0x6c30('0x9d')||_0x4571b0===_0x6c30('0x9e')||_0x4571b0===_0x6c30('0x9f')){_0x55dfb9['push'](getInputList(_0x276dfa,_0x2b981d,_0x4571b0,_0x27b9ec,_0x2f98ec[_0x6c30('0x8c')],_0x3b4303['MetadataId'],_0x279229));}}});return Promise[_0x6c30('0x94')](_0x55dfb9);})[_0x6c30('0xd')](function(_0x4d41ab){_0x24319e=_0x4d41ab[0x0];var _0x298685=_0x35a25d['concat'](_0xacc48)[_0x6c30('0xa0')](_0x24319e);var _0x3d7485={'count':_0x298685[_0x6c30('0x1f')],'rows':_0x298685};return _0x3d7485;})[_0x6c30('0xd')](respondWithResult(_0x231b0e,null))[_0x6c30('0x30')](function(_0x3cb064){var _0x233f46=_0x1b124d[_0x6c30('0x1a')][_0x6c30('0xa1')]?0x1f4:_0x3cb064[_0x6c30('0xa2')]||0x1f4;logger[_0x6c30('0x10')](_0x3cb064[_0x6c30('0xa3')]);delete _0x3cb064[_0x6c30('0x11')];if(_0x233f46===0x191){_0x233f46=0x190;}_0x231b0e[_0x6c30('0xa')](_0x233f46)[_0x6c30('0x12')](_0x1b124d[_0x6c30('0x1a')][_0x6c30('0xa1')]?{'message':'Wrong\x20credentials','statusCode':_0x3cb064[_0x6c30('0xa2')]}:_0x3cb064);});};function getSelectList(_0x20ea36,_0x449a20,_0x340568,_0x51f281,_0x1a2b8e,_0x209d79){var _0x1a4f65={'method':'GET','uri':_0x20ea36+'EntityDefinitions('+_0x51f281+_0x6c30('0xa4')+_0x1a2b8e+_0x6c30('0xa5')+_0x6c30('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x209d79,'If-None-Match':null,'OData-Version':_0x6c30('0x8a')},'json':!![]};return rp(_0x1a4f65)['then'](function(_0x47a4a5){var _0x33a7b9=[];var _0x5d80dc=_0x47a4a5['OptionSet']['Options'];_0x5d80dc[_0x6c30('0x95')](function(_0x381930){_0x33a7b9[_0x6c30('0xa7')]({'name':_0x381930[_0x6c30('0xa8')][_0x6c30('0xa9')][_0x6c30('0xa8')],'value':String(_0x381930[_0x6c30('0xaa')])});});var _0x5bdfd5={'id':_0x449a20+'_'+_0x47a4a5[_0x6c30('0x90')],'name':_0x47a4a5[_0x6c30('0xab')][_0x6c30('0xa9')][_0x6c30('0xa8')],'custom':![],'options':_0x33a7b9};_0x340568[_0x6c30('0xa7')](_0x5bdfd5);return _0x340568;});}function getBooleanList(_0x3edebb,_0x263614,_0x2abd05,_0x169be9,_0xd58dd1,_0x4d6536){var _0x388b2c={'method':'GET','uri':_0x3edebb+'EntityDefinitions('+_0x169be9+')/Attributes('+_0xd58dd1+_0x6c30('0xac'),'headers':{'Authorization':_0x6c30('0xad')+_0x4d6536,'If-None-Match':null,'OData-Version':_0x6c30('0x8a')},'json':!![]};return rp(_0x388b2c)[_0x6c30('0xd')](function(_0x2a40b8){var _0x538fa5=[];_0x538fa5[_0x6c30('0xa7')]({'name':_0x2a40b8[_0x6c30('0xae')]['TrueOption'][_0x6c30('0xa8')][_0x6c30('0xa9')][_0x6c30('0xa8')],'value':_0x6c30('0xaf')},{'name':_0x2a40b8[_0x6c30('0xae')][_0x6c30('0xb0')][_0x6c30('0xa8')][_0x6c30('0xa9')][_0x6c30('0xa8')],'value':_0x6c30('0xb1')});var _0x766f2a={'id':_0x263614+'_'+_0x2a40b8[_0x6c30('0x90')],'name':_0x2a40b8[_0x6c30('0xab')][_0x6c30('0xa9')][_0x6c30('0xa8')],'custom':![],'options':_0x538fa5};_0x2abd05[_0x6c30('0xa7')](_0x766f2a);return _0x2abd05;});}function getInputList(_0x404b97,_0x40cd03,_0x2c2824,_0x11281b,_0x3f6018,_0x4dbf63,_0x1622c9){var _0x484d85={'method':_0x6c30('0x88'),'uri':_0x404b97+_0x6c30('0xb2')+_0x3f6018+_0x6c30('0xa4')+_0x4dbf63+')/Microsoft.Dynamics.CRM.'+_0x2c2824+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x6c30('0xad')+_0x1622c9,'If-None-Match':null,'OData-Version':_0x6c30('0x8a')},'json':!![]};return rp(_0x484d85)[_0x6c30('0xd')](function(_0x525f0c){var _0x5c9594={'id':_0x40cd03+'_'+_0x525f0c['LogicalName'],'name':_0x525f0c[_0x6c30('0xab')][_0x6c30('0xa9')]?_0x525f0c[_0x6c30('0xab')][_0x6c30('0xa9')][_0x6c30('0xa8')]:_0x525f0c[_0x6c30('0x90')],'custom':![],'options':[]};_0x11281b['push'](_0x5c9594);return _0x11281b;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 71e69fc..91a26eb 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x1b3ada,_0x57e70e){var _0x419fa9=function(_0x12e938){while(--_0x12e938){_0x1b3ada['push'](_0x1b3ada['shift']());}};_0x419fa9(++_0x57e70e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x597124,_0x2f7364){var _0x2bc041=function(_0x466d67){while(--_0x466d67){_0x597124['push'](_0x597124['shift']());}};_0x2bc041(++_0x2f7364);}(_0x757a,0xde));var _0xa757=function(_0x2e24aa,_0x910e0f){_0x2e24aa=_0x2e24aa-0x0;var _0x1c512e=_0x757a[_0x2e24aa];return _0x1c512e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 9387e3e..e03b72e 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 _0x3cfb=['attributes','include','ShowDynamics365Account','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','limit','map','model'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x3cfb,0x88));var _0xb3cf=function(_0x375ed5,_0x49666c){_0x375ed5=_0x375ed5-0x0;var _0x4670e2=_0x3cfb[_0x375ed5];return _0x4670e2;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3cf('0x3'));var fs=require('fs');var Redis=require(_0xb3cf('0x4'));var db=require(_0xb3cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3cf('0x6'))(_0xb3cf('0x7'));var config=require(_0xb3cf('0x8'));var jayson=require(_0xb3cf('0x9'));var client=jayson[_0xb3cf('0xa')][_0xb3cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11cb8,_0x198c79,_0x250571){return new BPromise(function(_0x5eb976,_0x2fb997){return client[_0xb3cf('0xc')](_0x11cb8,_0x250571)['then'](function(_0x2f3377){logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x198c79,_0xb3cf('0xf'));logger[_0xb3cf('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x198c79,_0xb3cf('0xf'),JSON[_0xb3cf('0x11')](_0x2f3377));if(_0x2f3377[_0xb3cf('0x12')]){if(_0x2f3377['error'][_0xb3cf('0x13')]===0x1f4){logger[_0xb3cf('0x12')](_0xb3cf('0xe'),_0x198c79,_0x2f3377[_0xb3cf('0x12')]['message']);return _0x2fb997(_0x2f3377[_0xb3cf('0x12')][_0xb3cf('0x14')]);}logger[_0xb3cf('0x12')](_0xb3cf('0xe'),_0x198c79,_0x2f3377[_0xb3cf('0x12')][_0xb3cf('0x14')]);return _0x5eb976(_0x2f3377[_0xb3cf('0x12')][_0xb3cf('0x14')]);}else{logger['info'](_0xb3cf('0xe'),_0x198c79,_0xb3cf('0xf'));_0x5eb976(_0x2f3377['result']['message']);}})[_0xb3cf('0x15')](function(_0x105257){logger[_0xb3cf('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x198c79,_0x105257);_0x2fb997(_0x105257);});});}exports[_0xb3cf('0x16')]=function(_0x5cad70){var _0x5902c4=this;return new Promise(function(_0x22d755,_0x48f0c5){return db[_0xb3cf('0x17')]['findAll']({'raw':_0x5cad70[_0xb3cf('0x18')]?_0x5cad70[_0xb3cf('0x18')][_0xb3cf('0x19')]===undefined?!![]:![]:!![],'where':_0x5cad70['options']?_0x5cad70[_0xb3cf('0x18')]['where']||null:null,'attributes':_0x5cad70[_0xb3cf('0x18')]?_0x5cad70[_0xb3cf('0x18')]['attributes']||null:null,'limit':_0x5cad70[_0xb3cf('0x18')]?_0x5cad70[_0xb3cf('0x18')][_0xb3cf('0x1a')]||null:null,'include':_0x5cad70[_0xb3cf('0x18')]?_0x5cad70[_0xb3cf('0x18')]['include']?_[_0xb3cf('0x1b')](_0x5cad70[_0xb3cf('0x18')]['include'],function(_0x4e486e){return{'model':db[_0x4e486e[_0xb3cf('0x1c')]],'as':_0x4e486e['as'],'attributes':_0x4e486e[_0xb3cf('0x1d')],'include':_0x4e486e[_0xb3cf('0x1e')]?_[_0xb3cf('0x1b')](_0x4e486e[_0xb3cf('0x1e')],function(_0x4de845){return{'model':db[_0x4de845[_0xb3cf('0x1c')]],'as':_0x4de845['as'],'attributes':_0x4de845[_0xb3cf('0x1d')],'include':_0x4de845[_0xb3cf('0x1e')]?_['map'](_0x4de845[_0xb3cf('0x1e')],function(_0x2bf0fa){return{'model':db[_0x2bf0fa[_0xb3cf('0x1c')]],'as':_0x2bf0fa['as'],'attributes':_0x2bf0fa[_0xb3cf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9380){logger['info'](_0xb3cf('0x16'),_0x5cad70);logger[_0xb3cf('0x10')]('GetDynamics365Account',_0x5cad70,JSON[_0xb3cf('0x11')](_0x5e9380));_0x22d755(_0x5e9380);})[_0xb3cf('0x15')](function(_0x3e2f72){logger[_0xb3cf('0x12')]('GetDynamics365Account',_0x3e2f72[_0xb3cf('0x14')],_0x5cad70);_0x48f0c5(_0x5902c4[_0xb3cf('0x12')](0x1f4,_0x3e2f72['message']));});});};exports[_0xb3cf('0x1f')]=function(_0x27f9b2){var _0x1d0391=this;return new Promise(function(_0xa93548,_0xfda961){return db[_0xb3cf('0x17')][_0xb3cf('0x20')]({'raw':_0x27f9b2['options']?_0x27f9b2[_0xb3cf('0x18')][_0xb3cf('0x19')]===undefined?!![]:![]:!![],'where':_0x27f9b2[_0xb3cf('0x18')]?_0x27f9b2[_0xb3cf('0x18')]['where']||null:null,'attributes':_0x27f9b2[_0xb3cf('0x18')]?_0x27f9b2[_0xb3cf('0x18')]['attributes']||null:null,'include':_0x27f9b2[_0xb3cf('0x18')]?_0x27f9b2[_0xb3cf('0x18')][_0xb3cf('0x1e')]?_[_0xb3cf('0x1b')](_0x27f9b2['options'][_0xb3cf('0x1e')],function(_0x2c76cc){return{'model':db[_0x2c76cc['model']],'as':_0x2c76cc['as'],'attributes':_0x2c76cc['attributes'],'include':_0x2c76cc[_0xb3cf('0x1e')]?_[_0xb3cf('0x1b')](_0x2c76cc['include'],function(_0x552d4f){return{'model':db[_0x552d4f[_0xb3cf('0x1c')]],'as':_0x552d4f['as'],'attributes':_0x552d4f[_0xb3cf('0x1d')],'include':_0x552d4f[_0xb3cf('0x1e')]?_[_0xb3cf('0x1b')](_0x552d4f['include'],function(_0x46219d){return{'model':db[_0x46219d['model']],'as':_0x46219d['as'],'attributes':_0x46219d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d8b94){logger['info'](_0xb3cf('0x1f'),_0x27f9b2);logger[_0xb3cf('0x10')]('ShowDynamics365Account',_0x27f9b2,JSON['stringify'](_0x5d8b94));_0xa93548(_0x5d8b94);})[_0xb3cf('0x15')](function(_0x3e2693){logger['error'](_0xb3cf('0x1f'),_0x3e2693[_0xb3cf('0x14')],_0x27f9b2);_0xfda961(_0x1d0391[_0xb3cf('0x12')](0x1f4,_0x3e2693[_0xb3cf('0x14')]));});});}; \ No newline at end of file +var _0x619f=['limit','include','map','model','debug','GetDynamics365Account','stringify','ShowDynamics365Account','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','Dynamics365Account','options','attributes'];(function(_0x2f190e,_0x5e8b07){var _0x5b24a1=function(_0x4b8c1b){while(--_0x4b8c1b){_0x2f190e['push'](_0x2f190e['shift']());}};_0x5b24a1(++_0x5e8b07);}(_0x619f,0x14a));var _0xf619=function(_0x5a4924,_0x17ff19){_0x5a4924=_0x5a4924-0x0;var _0x3eeb55=_0x619f[_0x5a4924];return _0x3eeb55;};'use strict';var _=require(_0xf619('0x0'));var util=require(_0xf619('0x1'));var moment=require(_0xf619('0x2'));var BPromise=require('bluebird');var rs=require(_0xf619('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf619('0x4'))['db'];var utils=require(_0xf619('0x5'));var logger=require(_0xf619('0x6'))('rpc');var config=require(_0xf619('0x7'));var jayson=require(_0xf619('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x253f6e,_0x301b40,_0x13d178){return new BPromise(function(_0x642c4,_0xee1610){return client[_0xf619('0x9')](_0x253f6e,_0x13d178)[_0xf619('0xa')](function(_0x44edb8){logger['info'](_0xf619('0xb'),_0x301b40,_0xf619('0xc'));logger['debug'](_0xf619('0xd'),_0x301b40,_0xf619('0xc'),JSON['stringify'](_0x44edb8));if(_0x44edb8['error']){if(_0x44edb8[_0xf619('0xe')][_0xf619('0xf')]===0x1f4){logger[_0xf619('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x301b40,_0x44edb8[_0xf619('0xe')][_0xf619('0x10')]);return _0xee1610(_0x44edb8[_0xf619('0xe')][_0xf619('0x10')]);}logger[_0xf619('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x301b40,_0x44edb8[_0xf619('0xe')]['message']);return _0x642c4(_0x44edb8['error']['message']);}else{logger[_0xf619('0x11')](_0xf619('0xb'),_0x301b40,_0xf619('0xc'));_0x642c4(_0x44edb8['result']['message']);}})[_0xf619('0x12')](function(_0x225ac7){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x301b40,_0x225ac7);_0xee1610(_0x225ac7);});});}exports['GetDynamics365Account']=function(_0x3a9a55){var _0x381de5=this;return new Promise(function(_0x5bc32e,_0x55b85e){return db[_0xf619('0x13')]['findAll']({'raw':_0x3a9a55[_0xf619('0x14')]?_0x3a9a55['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a9a55[_0xf619('0x14')]?_0x3a9a55[_0xf619('0x14')]['where']||null:null,'attributes':_0x3a9a55[_0xf619('0x14')]?_0x3a9a55[_0xf619('0x14')][_0xf619('0x15')]||null:null,'limit':_0x3a9a55[_0xf619('0x14')]?_0x3a9a55[_0xf619('0x14')][_0xf619('0x16')]||null:null,'include':_0x3a9a55[_0xf619('0x14')]?_0x3a9a55[_0xf619('0x14')][_0xf619('0x17')]?_[_0xf619('0x18')](_0x3a9a55[_0xf619('0x14')][_0xf619('0x17')],function(_0x58f8f){return{'model':db[_0x58f8f[_0xf619('0x19')]],'as':_0x58f8f['as'],'attributes':_0x58f8f[_0xf619('0x15')],'include':_0x58f8f['include']?_[_0xf619('0x18')](_0x58f8f[_0xf619('0x17')],function(_0x4f333c){return{'model':db[_0x4f333c[_0xf619('0x19')]],'as':_0x4f333c['as'],'attributes':_0x4f333c[_0xf619('0x15')],'include':_0x4f333c[_0xf619('0x17')]?_[_0xf619('0x18')](_0x4f333c[_0xf619('0x17')],function(_0x58d39e){return{'model':db[_0x58d39e[_0xf619('0x19')]],'as':_0x58d39e['as'],'attributes':_0x58d39e[_0xf619('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29e529){logger[_0xf619('0x11')]('GetDynamics365Account',_0x3a9a55);logger[_0xf619('0x1a')](_0xf619('0x1b'),_0x3a9a55,JSON[_0xf619('0x1c')](_0x29e529));_0x5bc32e(_0x29e529);})[_0xf619('0x12')](function(_0x406a04){logger['error'](_0xf619('0x1b'),_0x406a04['message'],_0x3a9a55);_0x55b85e(_0x381de5[_0xf619('0xe')](0x1f4,_0x406a04[_0xf619('0x10')]));});});};exports[_0xf619('0x1d')]=function(_0x1e3d99){var _0x590f73=this;return new Promise(function(_0x456dba,_0x4655eb){return db[_0xf619('0x13')]['find']({'raw':_0x1e3d99[_0xf619('0x14')]?_0x1e3d99['options'][_0xf619('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e3d99[_0xf619('0x14')]?_0x1e3d99['options'][_0xf619('0x1f')]||null:null,'attributes':_0x1e3d99[_0xf619('0x14')]?_0x1e3d99[_0xf619('0x14')][_0xf619('0x15')]||null:null,'include':_0x1e3d99[_0xf619('0x14')]?_0x1e3d99[_0xf619('0x14')][_0xf619('0x17')]?_['map'](_0x1e3d99[_0xf619('0x14')][_0xf619('0x17')],function(_0x399c28){return{'model':db[_0x399c28[_0xf619('0x19')]],'as':_0x399c28['as'],'attributes':_0x399c28[_0xf619('0x15')],'include':_0x399c28[_0xf619('0x17')]?_[_0xf619('0x18')](_0x399c28[_0xf619('0x17')],function(_0x51fe64){return{'model':db[_0x51fe64['model']],'as':_0x51fe64['as'],'attributes':_0x51fe64[_0xf619('0x15')],'include':_0x51fe64[_0xf619('0x17')]?_[_0xf619('0x18')](_0x51fe64[_0xf619('0x17')],function(_0x53a275){return{'model':db[_0x53a275['model']],'as':_0x53a275['as'],'attributes':_0x53a275['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1acce4){logger['info'](_0xf619('0x1d'),_0x1e3d99);logger[_0xf619('0x1a')](_0xf619('0x1d'),_0x1e3d99,JSON[_0xf619('0x1c')](_0x1acce4));_0x456dba(_0x1acce4);})[_0xf619('0x12')](function(_0x255bab){logger['error']('ShowDynamics365Account',_0x255bab[_0xf619('0x10')],_0x1e3d99);_0x4655eb(_0x590f73[_0xf619('0xe')](0x1f4,_0x255bab[_0xf619('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3a2ceec..eb74448 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 _0x7bee=['/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2c7924,_0x147bbe){var _0x559c88=function(_0x121c4d){while(--_0x121c4d){_0x2c7924['push'](_0x2c7924['shift']());}};_0x559c88(++_0x147bbe);}(_0x7bee,0x168));var _0xe7be=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7bee[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0xe7be('0x0'));var util=require(_0xe7be('0x1'));var path=require(_0xe7be('0x2'));var timeout=require(_0xe7be('0x3'));var express=require(_0xe7be('0x4'));var router=express[_0xe7be('0x5')]();var fs_extra=require(_0xe7be('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe7be('0x7'));var controller=require(_0xe7be('0x8'));router[_0xe7be('0x9')]('/',auth[_0xe7be('0xa')](),controller[_0xe7be('0xb')]);router[_0xe7be('0x9')](_0xe7be('0xc'),auth[_0xe7be('0xa')](),controller[_0xe7be('0xd')]);router[_0xe7be('0x9')](_0xe7be('0xe'),auth[_0xe7be('0xa')](),controller['getFields']);router[_0xe7be('0x9')](_0xe7be('0xf'),auth[_0xe7be('0xa')](),controller['getSubjects']);router[_0xe7be('0x9')](_0xe7be('0x10'),auth[_0xe7be('0xa')](),controller[_0xe7be('0x11')]);router['post']('/',auth[_0xe7be('0xa')](),controller['create']);router[_0xe7be('0x12')](_0xe7be('0xc'),auth[_0xe7be('0xa')](),controller[_0xe7be('0x13')]);router['delete'](_0xe7be('0xc'),auth[_0xe7be('0xa')](),controller[_0xe7be('0x14')]);module[_0xe7be('0x15')]=router; \ No newline at end of file +var _0xa2d0=['../../components/interaction/service','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xa2d0,0x77));var _0x0a2d=function(_0x3057ff,_0x29cc49){_0x3057ff=_0x3057ff-0x0;var _0x35173c=_0xa2d0[_0x3057ff];return _0x35173c;};'use strict';var multer=require(_0x0a2d('0x0'));var util=require('util');var path=require(_0x0a2d('0x1'));var timeout=require(_0x0a2d('0x2'));var express=require(_0x0a2d('0x3'));var router=express[_0x0a2d('0x4')]();var fs_extra=require(_0x0a2d('0x5'));var auth=require(_0x0a2d('0x6'));var interaction=require(_0x0a2d('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x0a2d('0x8')](),controller['index']);router['get']('/:id',auth[_0x0a2d('0x8')](),controller['show']);router[_0x0a2d('0x9')](_0x0a2d('0xa'),auth['isAuthenticated'](),controller[_0x0a2d('0xb')]);router['get'](_0x0a2d('0xc'),auth[_0x0a2d('0x8')](),controller[_0x0a2d('0xd')]);router['get'](_0x0a2d('0xe'),auth[_0x0a2d('0x8')](),controller[_0x0a2d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0a2d('0x10')]);router[_0x0a2d('0x11')](_0x0a2d('0x12'),auth[_0x0a2d('0x8')](),controller['update']);router[_0x0a2d('0x13')]('/:id',auth[_0x0a2d('0x8')](),controller['destroy']);module[_0x0a2d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 74f79d8..219e880 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 _0x7eb7=['ENUM','incident','contact','nothing','BOOLEAN','STRING'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x7eb7,0xef));var _0x77eb=function(_0x37d960,_0x136c09){_0x37d960=_0x37d960-0x0;var _0x75c969=_0x7eb7[_0x37d960];return _0x75c969;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x77eb('0x0')]},'description':{'type':Sequelize[_0x77eb('0x0')]},'ticketType':{'type':Sequelize[_0x77eb('0x1')](_0x77eb('0x2'),'phonecall'),'defaultValue':_0x77eb('0x2')},'moduleCreate':{'type':Sequelize[_0x77eb('0x1')](_0x77eb('0x3'),_0x77eb('0x4')),'defaultValue':_0x77eb('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x77eb('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe033=['ENUM','incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports'];(function(_0x416bab,_0x41c724){var _0x1cfb74=function(_0x14cd1f){while(--_0x14cd1f){_0x416bab['push'](_0x416bab['shift']());}};_0x1cfb74(++_0x41c724);}(_0xe033,0x16e));var _0x3e03=function(_0x43f815,_0xc55ec5){_0x43f815=_0x43f815-0x0;var _0xec48cc=_0xe033[_0x43f815];return _0xec48cc;};'use strict';var Sequelize=require(_0x3e03('0x0'));module[_0x3e03('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3e03('0x2')](_0x3e03('0x3'),_0x3e03('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x3e03('0x5'),_0x3e03('0x6')),'defaultValue':_0x3e03('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3e03('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e9ffae6..70f3726 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 _0xe8ca=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','getFields','Dynamics365Field','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3cf270,_0x18d0c8){var _0x3bed97=function(_0x373002){while(--_0x373002){_0x3cf270['push'](_0x3cf270['shift']());}};_0x3bed97(++_0x18d0c8);}(_0xe8ca,0x150));var _0xae8c=function(_0xb04032,_0x5e0cad){_0xb04032=_0xb04032-0x0;var _0x2b0248=_0xe8ca[_0xb04032];return _0x2b0248;};'use strict';var emlformat=require(_0xae8c('0x0'));var rimraf=require(_0xae8c('0x1'));var zipdir=require(_0xae8c('0x2'));var jsonpatch=require(_0xae8c('0x3'));var rp=require(_0xae8c('0x4'));var moment=require(_0xae8c('0x5'));var BPromise=require(_0xae8c('0x6'));var Mustache=require(_0xae8c('0x7'));var util=require(_0xae8c('0x8'));var path=require(_0xae8c('0x9'));var sox=require(_0xae8c('0xa'));var csv=require(_0xae8c('0xb'));var ejs=require(_0xae8c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae8c('0xd'));var squel=require(_0xae8c('0xe'));var crypto=require(_0xae8c('0xf'));var jsforce=require(_0xae8c('0x10'));var deskjs=require(_0xae8c('0x11'));var toCsv=require('to-csv');var querystring=require(_0xae8c('0x12'));var Papa=require(_0xae8c('0x13'));var Redis=require(_0xae8c('0x14'));var authService=require(_0xae8c('0x15'));var qs=require(_0xae8c('0x16'));var as=require(_0xae8c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae8c('0x18'))(_0xae8c('0x19'));var utils=require(_0xae8c('0x1a'));var config=require(_0xae8c('0x1b'));var licenseUtil=require(_0xae8c('0x1c'));var db=require(_0xae8c('0x1d'))['db'];function respondWithStatusCode(_0x251dd9,_0x54027d){_0x54027d=_0x54027d||0xcc;return function(_0x420ab4){if(_0x420ab4){return _0x251dd9['sendStatus'](_0x54027d);}return _0x251dd9[_0xae8c('0x1e')](_0x54027d)[_0xae8c('0x1f')]();};}function respondWithResult(_0x1ecfa8,_0x13fce0){_0x13fce0=_0x13fce0||0xc8;return function(_0x3665e3){if(_0x3665e3){return _0x1ecfa8[_0xae8c('0x1e')](_0x13fce0)[_0xae8c('0x20')](_0x3665e3);}};}function respondWithFilteredResult(_0x507ac7,_0x338a45){return function(_0xcc7a4b){if(_0xcc7a4b){var _0x523ccd=typeof _0x338a45[_0xae8c('0x21')]===_0xae8c('0x22')&&typeof _0x338a45['limit']===_0xae8c('0x22');var _0x3e8e92=_0xcc7a4b['count'];var _0x1b1dca=_0x523ccd?0x0:_0x338a45[_0xae8c('0x21')];var _0x52e765=_0x523ccd?_0xcc7a4b[_0xae8c('0x23')]:_0x338a45[_0xae8c('0x21')]+_0x338a45[_0xae8c('0x24')];var _0x4f397c;if(_0x52e765>=_0x3e8e92){_0x52e765=_0x3e8e92;_0x4f397c=0xc8;}else{_0x4f397c=0xce;}_0x507ac7['status'](_0x4f397c);return _0x507ac7['set'](_0xae8c('0x25'),_0x1b1dca+'-'+_0x52e765+'/'+_0x3e8e92)[_0xae8c('0x20')](_0xcc7a4b);}return null;};}function patchUpdates(_0x2ac280){return function(_0x5b3e9a){try{jsonpatch[_0xae8c('0x26')](_0x5b3e9a,_0x2ac280,!![]);}catch(_0x3e8cfc){return BPromise['reject'](_0x3e8cfc);}return _0x5b3e9a[_0xae8c('0x27')]();};}function saveUpdates(_0x988481,_0x3e9fa6){return function(_0x5f12d9){if(_0x5f12d9){return _0x5f12d9['update'](_0x988481)[_0xae8c('0x28')](function(_0x4f240a){return _0x4f240a;});}return null;};}function removeEntity(_0x5c70e8,_0x4961d6){return function(_0x49eb8c){if(_0x49eb8c){return _0x49eb8c[_0xae8c('0x29')]()[_0xae8c('0x28')](function(){_0x5c70e8[_0xae8c('0x1e')](0xcc)[_0xae8c('0x1f')]();});}};}function handleEntityNotFound(_0x3a58b4,_0x425b05){return function(_0x1f0b59){if(!_0x1f0b59){_0x3a58b4[_0xae8c('0x2a')](0x194);}return _0x1f0b59;};}function handleError(_0x3b4c7a,_0x4ac598){_0x4ac598=_0x4ac598||0x1f4;return function(_0x10edb6){logger['error'](_0x10edb6[_0xae8c('0x2b')]);if(_0x10edb6[_0xae8c('0x2c')]){delete _0x10edb6['name'];}_0x3b4c7a[_0xae8c('0x1e')](_0x4ac598)[_0xae8c('0x2d')](_0x10edb6);};}exports[_0xae8c('0x2e')]=function(_0x14380c,_0x4e4dff){var _0x3f6c57={},_0x170db3={},_0x1d8830={'count':0x0,'rows':[]};var _0x51bb18=_[_0xae8c('0x2f')](db[_0xae8c('0x30')][_0xae8c('0x31')],function(_0x669715){return{'name':_0x669715[_0xae8c('0x32')],'type':_0x669715[_0xae8c('0x33')][_0xae8c('0x34')]};});_0x170db3[_0xae8c('0x35')]=_['map'](_0x51bb18,'name');_0x170db3['query']=_[_0xae8c('0x36')](_0x14380c[_0xae8c('0x37')]);_0x170db3['filters']=_[_0xae8c('0x38')](_0x170db3[_0xae8c('0x35')],_0x170db3['query']);_0x3f6c57['attributes']=_['intersection'](_0x170db3[_0xae8c('0x35')],qs[_0xae8c('0x39')](_0x14380c['query']['fields']));_0x3f6c57[_0xae8c('0x3a')]=_0x3f6c57[_0xae8c('0x3a')][_0xae8c('0x3b')]?_0x3f6c57['attributes']:_0x170db3[_0xae8c('0x35')];if(!_0x14380c[_0xae8c('0x37')][_0xae8c('0x3c')](_0xae8c('0x3d'))){_0x3f6c57[_0xae8c('0x24')]=qs[_0xae8c('0x24')](_0x14380c[_0xae8c('0x37')]['limit']);_0x3f6c57[_0xae8c('0x21')]=qs['offset'](_0x14380c[_0xae8c('0x37')][_0xae8c('0x21')]);}_0x3f6c57[_0xae8c('0x3e')]=qs[_0xae8c('0x3f')](_0x14380c[_0xae8c('0x37')][_0xae8c('0x3f')]);_0x3f6c57[_0xae8c('0x40')]=qs[_0xae8c('0x41')](_[_0xae8c('0x42')](_0x14380c[_0xae8c('0x37')],_0x170db3[_0xae8c('0x41')]),_0x51bb18);if(_0x14380c[_0xae8c('0x37')][_0xae8c('0x43')]){_0x3f6c57[_0xae8c('0x40')]=_[_0xae8c('0x44')](_0x3f6c57[_0xae8c('0x40')],{'$or':_[_0xae8c('0x2f')](_0x51bb18,function(_0xa8bd70){if(_0xa8bd70[_0xae8c('0x33')]!==_0xae8c('0x45')){var _0x472020={};_0x472020[_0xa8bd70['name']]={'$like':'%'+_0x14380c['query'][_0xae8c('0x43')]+'%'};return _0x472020;}})});}_0x3f6c57=_[_0xae8c('0x44')]({},_0x3f6c57,_0x14380c[_0xae8c('0x46')]);var _0x18fbde={'where':_0x3f6c57[_0xae8c('0x40')]};return db[_0xae8c('0x30')][_0xae8c('0x23')](_0x18fbde)[_0xae8c('0x28')](function(_0x456e77){_0x1d8830[_0xae8c('0x23')]=_0x456e77;if(_0x14380c[_0xae8c('0x37')][_0xae8c('0x47')]){_0x3f6c57[_0xae8c('0x48')]=[{'all':!![]}];}return db[_0xae8c('0x30')][_0xae8c('0x49')](_0x3f6c57);})[_0xae8c('0x28')](function(_0x4c5a94){_0x1d8830[_0xae8c('0x4a')]=_0x4c5a94;return _0x1d8830;})[_0xae8c('0x28')](respondWithFilteredResult(_0x4e4dff,_0x3f6c57))[_0xae8c('0x4b')](handleError(_0x4e4dff,null));};exports[_0xae8c('0x4c')]=function(_0x1b6637,_0x50eec6){var _0x5751c7={'raw':![],'where':{'id':_0x1b6637['params']['id']}},_0x31af12={};_0x31af12[_0xae8c('0x35')]=_[_0xae8c('0x36')](db[_0xae8c('0x30')][_0xae8c('0x31')]);_0x31af12[_0xae8c('0x37')]=_[_0xae8c('0x36')](_0x1b6637[_0xae8c('0x37')]);_0x31af12[_0xae8c('0x41')]=_[_0xae8c('0x38')](_0x31af12[_0xae8c('0x35')],_0x31af12[_0xae8c('0x37')]);_0x5751c7['attributes']=_[_0xae8c('0x38')](_0x31af12['model'],qs['fields'](_0x1b6637[_0xae8c('0x37')]['fields']));_0x5751c7[_0xae8c('0x3a')]=_0x5751c7['attributes'][_0xae8c('0x3b')]?_0x5751c7[_0xae8c('0x3a')]:_0x31af12[_0xae8c('0x35')];if(_0x1b6637[_0xae8c('0x37')][_0xae8c('0x47')]){_0x5751c7[_0xae8c('0x48')]=[{'all':!![]}];}_0x5751c7=_[_0xae8c('0x44')]({},_0x5751c7,_0x1b6637['options']);return db[_0xae8c('0x30')][_0xae8c('0x4d')](_0x5751c7)[_0xae8c('0x28')](handleEntityNotFound(_0x50eec6,null))[_0xae8c('0x28')](respondWithResult(_0x50eec6,null))[_0xae8c('0x4b')](handleError(_0x50eec6,null));};exports[_0xae8c('0x4e')]=function(_0xa787b9,_0x313096){return db[_0xae8c('0x30')][_0xae8c('0x4e')](_0xa787b9[_0xae8c('0x4f')],{})['then'](respondWithResult(_0x313096,0xc9))[_0xae8c('0x4b')](handleError(_0x313096,null));};exports[_0xae8c('0x50')]=function(_0x57a37e,_0xe2157e){if(_0x57a37e['body']['id']){delete _0x57a37e[_0xae8c('0x4f')]['id'];}return db[_0xae8c('0x30')][_0xae8c('0x4d')]({'where':{'id':_0x57a37e['params']['id']}})[_0xae8c('0x28')](handleEntityNotFound(_0xe2157e,null))[_0xae8c('0x28')](saveUpdates(_0x57a37e[_0xae8c('0x4f')],null))['then'](respondWithResult(_0xe2157e,null))['catch'](handleError(_0xe2157e,null));};exports[_0xae8c('0x29')]=function(_0x517772,_0x489166){return db['Dynamics365Configuration'][_0xae8c('0x4d')]({'where':{'id':_0x517772[_0xae8c('0x51')]['id']}})[_0xae8c('0x28')](handleEntityNotFound(_0x489166,null))[_0xae8c('0x28')](removeEntity(_0x489166,null))[_0xae8c('0x4b')](handleError(_0x489166,null));};exports[_0xae8c('0x52')]=function(_0x27cdc1,_0x10ae85,_0x26b1db){var _0x277497={};var _0x5d5e3a={};var _0x5ac86a;var _0x44fc91;return db[_0xae8c('0x30')]['findOne']({'where':{'id':_0x27cdc1[_0xae8c('0x51')]['id']}})[_0xae8c('0x28')](handleEntityNotFound(_0x10ae85,null))['then'](function(_0x5d66ca){if(_0x5d66ca){_0x5ac86a=_0x5d66ca;_0x5d5e3a[_0xae8c('0x35')]=_[_0xae8c('0x36')](db[_0xae8c('0x53')][_0xae8c('0x31')]);_0x5d5e3a['query']=_[_0xae8c('0x36')](_0x27cdc1['query']);_0x5d5e3a[_0xae8c('0x41')]=_[_0xae8c('0x38')](_0x5d5e3a[_0xae8c('0x35')],_0x5d5e3a[_0xae8c('0x37')]);_0x277497['attributes']=_[_0xae8c('0x38')](_0x5d5e3a[_0xae8c('0x35')],qs[_0xae8c('0x39')](_0x27cdc1['query'][_0xae8c('0x39')]));_0x277497[_0xae8c('0x3a')]=_0x277497[_0xae8c('0x3a')]['length']?_0x277497['attributes']:_0x5d5e3a[_0xae8c('0x35')];_0x277497[_0xae8c('0x3e')]=qs[_0xae8c('0x3f')](_0x27cdc1['query'][_0xae8c('0x3f')]);_0x277497[_0xae8c('0x40')]=qs[_0xae8c('0x41')](_[_0xae8c('0x42')](_0x27cdc1['query'],_0x5d5e3a[_0xae8c('0x41')]));if(_0x27cdc1[_0xae8c('0x37')][_0xae8c('0x43')]){_0x277497[_0xae8c('0x40')]=_[_0xae8c('0x44')](_0x277497[_0xae8c('0x40')],{'$or':_[_0xae8c('0x2f')](_0x277497[_0xae8c('0x3a')],function(_0x1bdb87){var _0x3a92d1={};_0x3a92d1[_0x1bdb87]={'$like':'%'+_0x27cdc1[_0xae8c('0x37')]['filter']+'%'};return _0x3a92d1;})});}_0x277497=_[_0xae8c('0x44')]({},_0x277497,_0x27cdc1[_0xae8c('0x46')]);return _0x5ac86a[_0xae8c('0x52')](_0x277497);}})[_0xae8c('0x28')](function(_0x4cbd2f){if(_0x4cbd2f){_0x44fc91=_0x4cbd2f[_0xae8c('0x3b')];if(!_0x27cdc1[_0xae8c('0x37')][_0xae8c('0x3c')]('nolimit')){_0x277497['limit']=qs[_0xae8c('0x24')](_0x27cdc1[_0xae8c('0x37')][_0xae8c('0x24')]);_0x277497[_0xae8c('0x21')]=qs[_0xae8c('0x21')](_0x27cdc1[_0xae8c('0x37')][_0xae8c('0x21')]);}return _0x5ac86a[_0xae8c('0x52')](_0x277497);}})[_0xae8c('0x28')](function(_0x2ba0dd){if(_0x2ba0dd){return _0x2ba0dd?{'count':_0x44fc91,'rows':_0x2ba0dd}:null;}})[_0xae8c('0x28')](respondWithResult(_0x10ae85,null))[_0xae8c('0x4b')](handleError(_0x10ae85,null));};exports[_0xae8c('0x54')]=function(_0xfd8374,_0x38b0bf,_0x98096d){var _0xf5e0a2={};var _0x24a78d={};var _0x1d4d88;var _0x18c09e;return db[_0xae8c('0x30')]['findOne']({'where':{'id':_0xfd8374[_0xae8c('0x51')]['id']}})[_0xae8c('0x28')](handleEntityNotFound(_0x38b0bf,null))[_0xae8c('0x28')](function(_0x36de2d){if(_0x36de2d){_0x1d4d88=_0x36de2d;_0x24a78d[_0xae8c('0x35')]=_['keys'](db['Dynamics365Field'][_0xae8c('0x31')]);_0x24a78d['query']=_[_0xae8c('0x36')](_0xfd8374[_0xae8c('0x37')]);_0x24a78d[_0xae8c('0x41')]=_['intersection'](_0x24a78d[_0xae8c('0x35')],_0x24a78d[_0xae8c('0x37')]);_0xf5e0a2[_0xae8c('0x3a')]=_[_0xae8c('0x38')](_0x24a78d[_0xae8c('0x35')],qs['fields'](_0xfd8374[_0xae8c('0x37')][_0xae8c('0x39')]));_0xf5e0a2[_0xae8c('0x3a')]=_0xf5e0a2[_0xae8c('0x3a')][_0xae8c('0x3b')]?_0xf5e0a2[_0xae8c('0x3a')]:_0x24a78d[_0xae8c('0x35')];_0xf5e0a2[_0xae8c('0x3e')]=qs['sort'](_0xfd8374[_0xae8c('0x37')][_0xae8c('0x3f')]);_0xf5e0a2[_0xae8c('0x40')]=qs['filters'](_[_0xae8c('0x42')](_0xfd8374['query'],_0x24a78d[_0xae8c('0x41')]));if(_0xfd8374[_0xae8c('0x37')][_0xae8c('0x43')]){_0xf5e0a2['where']=_[_0xae8c('0x44')](_0xf5e0a2['where'],{'$or':_[_0xae8c('0x2f')](_0xf5e0a2['attributes'],function(_0x58bd91){var _0x7468eb={};_0x7468eb[_0x58bd91]={'$like':'%'+_0xfd8374['query'][_0xae8c('0x43')]+'%'};return _0x7468eb;})});}_0xf5e0a2=_['merge']({},_0xf5e0a2,_0xfd8374[_0xae8c('0x46')]);return _0x1d4d88['getSubjects'](_0xf5e0a2);}})[_0xae8c('0x28')](function(_0x50553f){if(_0x50553f){_0x18c09e=_0x50553f['length'];if(!_0xfd8374[_0xae8c('0x37')][_0xae8c('0x3c')](_0xae8c('0x3d'))){_0xf5e0a2['limit']=qs[_0xae8c('0x24')](_0xfd8374[_0xae8c('0x37')][_0xae8c('0x24')]);_0xf5e0a2[_0xae8c('0x21')]=qs['offset'](_0xfd8374[_0xae8c('0x37')][_0xae8c('0x21')]);}return _0x1d4d88[_0xae8c('0x54')](_0xf5e0a2);}})['then'](function(_0x3be28c){if(_0x3be28c){return _0x3be28c?{'count':_0x18c09e,'rows':_0x3be28c}:null;}})[_0xae8c('0x28')](respondWithResult(_0x38b0bf,null))[_0xae8c('0x4b')](handleError(_0x38b0bf,null));};exports['getDescriptions']=function(_0xe0f4fb,_0x32b113,_0x5e0446){var _0x3f2f2a={};var _0x1e323d={};var _0x45ab59;var _0x19697a;return db[_0xae8c('0x30')][_0xae8c('0x55')]({'where':{'id':_0xe0f4fb['params']['id']}})[_0xae8c('0x28')](handleEntityNotFound(_0x32b113,null))[_0xae8c('0x28')](function(_0x1d3e3e){if(_0x1d3e3e){_0x45ab59=_0x1d3e3e;_0x1e323d[_0xae8c('0x35')]=_[_0xae8c('0x36')](db[_0xae8c('0x53')][_0xae8c('0x31')]);_0x1e323d[_0xae8c('0x37')]=_[_0xae8c('0x36')](_0xe0f4fb[_0xae8c('0x37')]);_0x1e323d[_0xae8c('0x41')]=_[_0xae8c('0x38')](_0x1e323d['model'],_0x1e323d[_0xae8c('0x37')]);_0x3f2f2a[_0xae8c('0x3a')]=_[_0xae8c('0x38')](_0x1e323d['model'],qs['fields'](_0xe0f4fb['query'][_0xae8c('0x39')]));_0x3f2f2a[_0xae8c('0x3a')]=_0x3f2f2a[_0xae8c('0x3a')][_0xae8c('0x3b')]?_0x3f2f2a['attributes']:_0x1e323d[_0xae8c('0x35')];_0x3f2f2a[_0xae8c('0x3e')]=qs['sort'](_0xe0f4fb[_0xae8c('0x37')]['sort']);_0x3f2f2a[_0xae8c('0x40')]=qs[_0xae8c('0x41')](_[_0xae8c('0x42')](_0xe0f4fb['query'],_0x1e323d[_0xae8c('0x41')]));if(_0xe0f4fb['query'][_0xae8c('0x43')]){_0x3f2f2a[_0xae8c('0x40')]=_[_0xae8c('0x44')](_0x3f2f2a[_0xae8c('0x40')],{'$or':_['map'](_0x3f2f2a[_0xae8c('0x3a')],function(_0x16c72c){var _0x1f8d46={};_0x1f8d46[_0x16c72c]={'$like':'%'+_0xe0f4fb[_0xae8c('0x37')][_0xae8c('0x43')]+'%'};return _0x1f8d46;})});}_0x3f2f2a=_['merge']({},_0x3f2f2a,_0xe0f4fb[_0xae8c('0x46')]);return _0x45ab59[_0xae8c('0x56')](_0x3f2f2a);}})[_0xae8c('0x28')](function(_0x1b1d29){if(_0x1b1d29){_0x19697a=_0x1b1d29[_0xae8c('0x3b')];if(!_0xe0f4fb[_0xae8c('0x37')][_0xae8c('0x3c')](_0xae8c('0x3d'))){_0x3f2f2a[_0xae8c('0x24')]=qs[_0xae8c('0x24')](_0xe0f4fb[_0xae8c('0x37')]['limit']);_0x3f2f2a[_0xae8c('0x21')]=qs[_0xae8c('0x21')](_0xe0f4fb[_0xae8c('0x37')]['offset']);}return _0x45ab59[_0xae8c('0x56')](_0x3f2f2a);}})[_0xae8c('0x28')](function(_0x100301){if(_0x100301){return _0x100301?{'count':_0x19697a,'rows':_0x100301}:null;}})[_0xae8c('0x28')](respondWithResult(_0x32b113,null))[_0xae8c('0x4b')](handleError(_0x32b113,null));}; \ No newline at end of file +var _0xaecb=['params','find','create','body','getFields','findOne','order','getSubjects','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show'];(function(_0x528ebe,_0x504d4d){var _0x27594c=function(_0x3e1849){while(--_0x3e1849){_0x528ebe['push'](_0x528ebe['shift']());}};_0x27594c(++_0x504d4d);}(_0xaecb,0x18b));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbaec('0x0'));var zipdir=require(_0xbaec('0x1'));var jsonpatch=require(_0xbaec('0x2'));var rp=require(_0xbaec('0x3'));var moment=require('moment');var BPromise=require(_0xbaec('0x4'));var Mustache=require(_0xbaec('0x5'));var util=require(_0xbaec('0x6'));var path=require(_0xbaec('0x7'));var sox=require(_0xbaec('0x8'));var csv=require(_0xbaec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbaec('0xa'));var _=require('lodash');var squel=require(_0xbaec('0xb'));var crypto=require(_0xbaec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbaec('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbaec('0xe'));var Papa=require('papaparse');var Redis=require(_0xbaec('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbaec('0x10'));var as=require(_0xbaec('0x11'));var hardwareService=require(_0xbaec('0x12'));var logger=require(_0xbaec('0x13'))(_0xbaec('0x14'));var utils=require(_0xbaec('0x15'));var config=require(_0xbaec('0x16'));var licenseUtil=require(_0xbaec('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551f70,_0x4d4715){_0x4d4715=_0x4d4715||0xcc;return function(_0x48da5c){if(_0x48da5c){return _0x551f70[_0xbaec('0x18')](_0x4d4715);}return _0x551f70[_0xbaec('0x19')](_0x4d4715)[_0xbaec('0x1a')]();};}function respondWithResult(_0x41fe4c,_0x516dc1){_0x516dc1=_0x516dc1||0xc8;return function(_0x3bc775){if(_0x3bc775){return _0x41fe4c[_0xbaec('0x19')](_0x516dc1)[_0xbaec('0x1b')](_0x3bc775);}};}function respondWithFilteredResult(_0x3680eb,_0xc85984){return function(_0x4cc342){if(_0x4cc342){var _0x53ba6a=typeof _0xc85984[_0xbaec('0x1c')]===_0xbaec('0x1d')&&typeof _0xc85984[_0xbaec('0x1e')]===_0xbaec('0x1d');var _0x511108=_0x4cc342[_0xbaec('0x1f')];var _0x59a21b=_0x53ba6a?0x0:_0xc85984[_0xbaec('0x1c')];var _0xf49246=_0x53ba6a?_0x4cc342[_0xbaec('0x1f')]:_0xc85984[_0xbaec('0x1c')]+_0xc85984[_0xbaec('0x1e')];var _0x45e50a;if(_0xf49246>=_0x511108){_0xf49246=_0x511108;_0x45e50a=0xc8;}else{_0x45e50a=0xce;}_0x3680eb[_0xbaec('0x19')](_0x45e50a);return _0x3680eb[_0xbaec('0x20')]('Content-Range',_0x59a21b+'-'+_0xf49246+'/'+_0x511108)['json'](_0x4cc342);}return null;};}function patchUpdates(_0x280d7d){return function(_0x1f4fcc){try{jsonpatch[_0xbaec('0x21')](_0x1f4fcc,_0x280d7d,!![]);}catch(_0x4f7f1d){return BPromise[_0xbaec('0x22')](_0x4f7f1d);}return _0x1f4fcc[_0xbaec('0x23')]();};}function saveUpdates(_0x7d9e23,_0x303cdb){return function(_0x2c8152){if(_0x2c8152){return _0x2c8152['update'](_0x7d9e23)['then'](function(_0x207f62){return _0x207f62;});}return null;};}function removeEntity(_0x367fe1,_0x38accc){return function(_0x2f2f6a){if(_0x2f2f6a){return _0x2f2f6a['destroy']()[_0xbaec('0x24')](function(){_0x367fe1['status'](0xcc)[_0xbaec('0x1a')]();});}};}function handleEntityNotFound(_0x10ee9c,_0xb28d38){return function(_0x285d14){if(!_0x285d14){_0x10ee9c['sendStatus'](0x194);}return _0x285d14;};}function handleError(_0xc3ea34,_0x50ab95){_0x50ab95=_0x50ab95||0x1f4;return function(_0x346b18){logger[_0xbaec('0x25')](_0x346b18[_0xbaec('0x26')]);if(_0x346b18['name']){delete _0x346b18[_0xbaec('0x27')];}_0xc3ea34['status'](_0x50ab95)['send'](_0x346b18);};}exports['index']=function(_0x41223a,_0x347f42){var _0x59cb02={},_0x4e57e0={},_0x3755af={'count':0x0,'rows':[]};var _0x12f728=_['map'](db[_0xbaec('0x28')][_0xbaec('0x29')],function(_0x2e7b70){return{'name':_0x2e7b70[_0xbaec('0x2a')],'type':_0x2e7b70[_0xbaec('0x2b')]['key']};});_0x4e57e0[_0xbaec('0x2c')]=_[_0xbaec('0x2d')](_0x12f728,'name');_0x4e57e0[_0xbaec('0x2e')]=_[_0xbaec('0x2f')](_0x41223a[_0xbaec('0x2e')]);_0x4e57e0[_0xbaec('0x30')]=_[_0xbaec('0x31')](_0x4e57e0['model'],_0x4e57e0[_0xbaec('0x2e')]);_0x59cb02[_0xbaec('0x32')]=_[_0xbaec('0x31')](_0x4e57e0[_0xbaec('0x2c')],qs[_0xbaec('0x33')](_0x41223a[_0xbaec('0x2e')][_0xbaec('0x33')]));_0x59cb02[_0xbaec('0x32')]=_0x59cb02['attributes'][_0xbaec('0x34')]?_0x59cb02['attributes']:_0x4e57e0['model'];if(!_0x41223a[_0xbaec('0x2e')][_0xbaec('0x35')](_0xbaec('0x36'))){_0x59cb02[_0xbaec('0x1e')]=qs[_0xbaec('0x1e')](_0x41223a['query']['limit']);_0x59cb02[_0xbaec('0x1c')]=qs[_0xbaec('0x1c')](_0x41223a[_0xbaec('0x2e')][_0xbaec('0x1c')]);}_0x59cb02['order']=qs['sort'](_0x41223a[_0xbaec('0x2e')][_0xbaec('0x37')]);_0x59cb02[_0xbaec('0x38')]=qs[_0xbaec('0x30')](_[_0xbaec('0x39')](_0x41223a['query'],_0x4e57e0[_0xbaec('0x30')]),_0x12f728);if(_0x41223a[_0xbaec('0x2e')][_0xbaec('0x3a')]){_0x59cb02[_0xbaec('0x38')]=_['merge'](_0x59cb02[_0xbaec('0x38')],{'$or':_[_0xbaec('0x2d')](_0x12f728,function(_0x1d6529){if(_0x1d6529[_0xbaec('0x2b')]!==_0xbaec('0x3b')){var _0x4cc24e={};_0x4cc24e[_0x1d6529[_0xbaec('0x27')]]={'$like':'%'+_0x41223a[_0xbaec('0x2e')][_0xbaec('0x3a')]+'%'};return _0x4cc24e;}})});}_0x59cb02=_[_0xbaec('0x3c')]({},_0x59cb02,_0x41223a[_0xbaec('0x3d')]);var _0xbc31ef={'where':_0x59cb02[_0xbaec('0x38')]};return db[_0xbaec('0x28')][_0xbaec('0x1f')](_0xbc31ef)[_0xbaec('0x24')](function(_0x432035){_0x3755af['count']=_0x432035;if(_0x41223a['query'][_0xbaec('0x3e')]){_0x59cb02[_0xbaec('0x3f')]=[{'all':!![]}];}return db[_0xbaec('0x28')][_0xbaec('0x40')](_0x59cb02);})[_0xbaec('0x24')](function(_0x23db45){_0x3755af['rows']=_0x23db45;return _0x3755af;})[_0xbaec('0x24')](respondWithFilteredResult(_0x347f42,_0x59cb02))[_0xbaec('0x41')](handleError(_0x347f42,null));};exports[_0xbaec('0x42')]=function(_0x1e1222,_0x528a27){var _0x2f6444={'raw':![],'where':{'id':_0x1e1222[_0xbaec('0x43')]['id']}},_0x11098d={};_0x11098d[_0xbaec('0x2c')]=_[_0xbaec('0x2f')](db[_0xbaec('0x28')][_0xbaec('0x29')]);_0x11098d[_0xbaec('0x2e')]=_[_0xbaec('0x2f')](_0x1e1222[_0xbaec('0x2e')]);_0x11098d[_0xbaec('0x30')]=_[_0xbaec('0x31')](_0x11098d[_0xbaec('0x2c')],_0x11098d[_0xbaec('0x2e')]);_0x2f6444[_0xbaec('0x32')]=_[_0xbaec('0x31')](_0x11098d['model'],qs[_0xbaec('0x33')](_0x1e1222[_0xbaec('0x2e')][_0xbaec('0x33')]));_0x2f6444[_0xbaec('0x32')]=_0x2f6444[_0xbaec('0x32')][_0xbaec('0x34')]?_0x2f6444[_0xbaec('0x32')]:_0x11098d[_0xbaec('0x2c')];if(_0x1e1222['query'][_0xbaec('0x3e')]){_0x2f6444[_0xbaec('0x3f')]=[{'all':!![]}];}_0x2f6444=_[_0xbaec('0x3c')]({},_0x2f6444,_0x1e1222[_0xbaec('0x3d')]);return db[_0xbaec('0x28')][_0xbaec('0x44')](_0x2f6444)[_0xbaec('0x24')](handleEntityNotFound(_0x528a27,null))['then'](respondWithResult(_0x528a27,null))[_0xbaec('0x41')](handleError(_0x528a27,null));};exports[_0xbaec('0x45')]=function(_0xb9bc5,_0x21605c){return db[_0xbaec('0x28')]['create'](_0xb9bc5[_0xbaec('0x46')],{})[_0xbaec('0x24')](respondWithResult(_0x21605c,0xc9))[_0xbaec('0x41')](handleError(_0x21605c,null));};exports['update']=function(_0x9f810e,_0x39224d){if(_0x9f810e['body']['id']){delete _0x9f810e[_0xbaec('0x46')]['id'];}return db['Dynamics365Configuration'][_0xbaec('0x44')]({'where':{'id':_0x9f810e[_0xbaec('0x43')]['id']}})[_0xbaec('0x24')](handleEntityNotFound(_0x39224d,null))[_0xbaec('0x24')](saveUpdates(_0x9f810e[_0xbaec('0x46')],null))[_0xbaec('0x24')](respondWithResult(_0x39224d,null))[_0xbaec('0x41')](handleError(_0x39224d,null));};exports['destroy']=function(_0x3af210,_0x2ce5cf){return db[_0xbaec('0x28')][_0xbaec('0x44')]({'where':{'id':_0x3af210['params']['id']}})[_0xbaec('0x24')](handleEntityNotFound(_0x2ce5cf,null))[_0xbaec('0x24')](removeEntity(_0x2ce5cf,null))['catch'](handleError(_0x2ce5cf,null));};exports[_0xbaec('0x47')]=function(_0x18bc97,_0x14b81d,_0x395e4d){var _0x3269bd={};var _0x152092={};var _0x437f3c;var _0xcc2c84;return db[_0xbaec('0x28')][_0xbaec('0x48')]({'where':{'id':_0x18bc97[_0xbaec('0x43')]['id']}})[_0xbaec('0x24')](handleEntityNotFound(_0x14b81d,null))['then'](function(_0xd3330e){if(_0xd3330e){_0x437f3c=_0xd3330e;_0x152092['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x152092['query']=_[_0xbaec('0x2f')](_0x18bc97[_0xbaec('0x2e')]);_0x152092[_0xbaec('0x30')]=_['intersection'](_0x152092[_0xbaec('0x2c')],_0x152092['query']);_0x3269bd[_0xbaec('0x32')]=_[_0xbaec('0x31')](_0x152092[_0xbaec('0x2c')],qs[_0xbaec('0x33')](_0x18bc97[_0xbaec('0x2e')]['fields']));_0x3269bd['attributes']=_0x3269bd['attributes'][_0xbaec('0x34')]?_0x3269bd['attributes']:_0x152092[_0xbaec('0x2c')];_0x3269bd[_0xbaec('0x49')]=qs['sort'](_0x18bc97[_0xbaec('0x2e')]['sort']);_0x3269bd['where']=qs[_0xbaec('0x30')](_[_0xbaec('0x39')](_0x18bc97[_0xbaec('0x2e')],_0x152092[_0xbaec('0x30')]));if(_0x18bc97[_0xbaec('0x2e')][_0xbaec('0x3a')]){_0x3269bd['where']=_['merge'](_0x3269bd[_0xbaec('0x38')],{'$or':_[_0xbaec('0x2d')](_0x3269bd[_0xbaec('0x32')],function(_0x2e70ba){var _0x2ea97a={};_0x2ea97a[_0x2e70ba]={'$like':'%'+_0x18bc97[_0xbaec('0x2e')][_0xbaec('0x3a')]+'%'};return _0x2ea97a;})});}_0x3269bd=_[_0xbaec('0x3c')]({},_0x3269bd,_0x18bc97[_0xbaec('0x3d')]);return _0x437f3c[_0xbaec('0x47')](_0x3269bd);}})[_0xbaec('0x24')](function(_0x479803){if(_0x479803){_0xcc2c84=_0x479803[_0xbaec('0x34')];if(!_0x18bc97[_0xbaec('0x2e')]['hasOwnProperty'](_0xbaec('0x36'))){_0x3269bd[_0xbaec('0x1e')]=qs[_0xbaec('0x1e')](_0x18bc97[_0xbaec('0x2e')][_0xbaec('0x1e')]);_0x3269bd[_0xbaec('0x1c')]=qs[_0xbaec('0x1c')](_0x18bc97[_0xbaec('0x2e')]['offset']);}return _0x437f3c[_0xbaec('0x47')](_0x3269bd);}})[_0xbaec('0x24')](function(_0x488023){if(_0x488023){return _0x488023?{'count':_0xcc2c84,'rows':_0x488023}:null;}})[_0xbaec('0x24')](respondWithResult(_0x14b81d,null))[_0xbaec('0x41')](handleError(_0x14b81d,null));};exports[_0xbaec('0x4a')]=function(_0x3a1efd,_0x3008ee,_0x3ec1b0){var _0x3643c9={};var _0x70a0c9={};var _0x57a5a8;var _0x1097a1;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x3a1efd['params']['id']}})[_0xbaec('0x24')](handleEntityNotFound(_0x3008ee,null))['then'](function(_0x3efed2){if(_0x3efed2){_0x57a5a8=_0x3efed2;_0x70a0c9[_0xbaec('0x2c')]=_[_0xbaec('0x2f')](db[_0xbaec('0x4b')][_0xbaec('0x29')]);_0x70a0c9['query']=_[_0xbaec('0x2f')](_0x3a1efd[_0xbaec('0x2e')]);_0x70a0c9['filters']=_[_0xbaec('0x31')](_0x70a0c9[_0xbaec('0x2c')],_0x70a0c9['query']);_0x3643c9[_0xbaec('0x32')]=_[_0xbaec('0x31')](_0x70a0c9[_0xbaec('0x2c')],qs[_0xbaec('0x33')](_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x33')]));_0x3643c9[_0xbaec('0x32')]=_0x3643c9[_0xbaec('0x32')]['length']?_0x3643c9['attributes']:_0x70a0c9[_0xbaec('0x2c')];_0x3643c9['order']=qs[_0xbaec('0x37')](_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x37')]);_0x3643c9['where']=qs['filters'](_[_0xbaec('0x39')](_0x3a1efd[_0xbaec('0x2e')],_0x70a0c9[_0xbaec('0x30')]));if(_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x3a')]){_0x3643c9[_0xbaec('0x38')]=_[_0xbaec('0x3c')](_0x3643c9['where'],{'$or':_[_0xbaec('0x2d')](_0x3643c9[_0xbaec('0x32')],function(_0x31726e){var _0x2a6d7d={};_0x2a6d7d[_0x31726e]={'$like':'%'+_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x3a')]+'%'};return _0x2a6d7d;})});}_0x3643c9=_['merge']({},_0x3643c9,_0x3a1efd['options']);return _0x57a5a8[_0xbaec('0x4a')](_0x3643c9);}})[_0xbaec('0x24')](function(_0x4f4d6b){if(_0x4f4d6b){_0x1097a1=_0x4f4d6b[_0xbaec('0x34')];if(!_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x35')](_0xbaec('0x36'))){_0x3643c9['limit']=qs[_0xbaec('0x1e')](_0x3a1efd[_0xbaec('0x2e')][_0xbaec('0x1e')]);_0x3643c9[_0xbaec('0x1c')]=qs[_0xbaec('0x1c')](_0x3a1efd['query'][_0xbaec('0x1c')]);}return _0x57a5a8[_0xbaec('0x4a')](_0x3643c9);}})[_0xbaec('0x24')](function(_0x107669){if(_0x107669){return _0x107669?{'count':_0x1097a1,'rows':_0x107669}:null;}})[_0xbaec('0x24')](respondWithResult(_0x3008ee,null))[_0xbaec('0x41')](handleError(_0x3008ee,null));};exports[_0xbaec('0x4c')]=function(_0xbcab15,_0x195dc9,_0x4e268d){var _0x30d993={};var _0x1b7799={};var _0x436ab1;var _0x290af8;return db[_0xbaec('0x28')][_0xbaec('0x48')]({'where':{'id':_0xbcab15[_0xbaec('0x43')]['id']}})[_0xbaec('0x24')](handleEntityNotFound(_0x195dc9,null))[_0xbaec('0x24')](function(_0x52254b){if(_0x52254b){_0x436ab1=_0x52254b;_0x1b7799[_0xbaec('0x2c')]=_[_0xbaec('0x2f')](db['Dynamics365Field'][_0xbaec('0x29')]);_0x1b7799[_0xbaec('0x2e')]=_['keys'](_0xbcab15[_0xbaec('0x2e')]);_0x1b7799[_0xbaec('0x30')]=_[_0xbaec('0x31')](_0x1b7799[_0xbaec('0x2c')],_0x1b7799[_0xbaec('0x2e')]);_0x30d993[_0xbaec('0x32')]=_['intersection'](_0x1b7799[_0xbaec('0x2c')],qs[_0xbaec('0x33')](_0xbcab15[_0xbaec('0x2e')]['fields']));_0x30d993[_0xbaec('0x32')]=_0x30d993[_0xbaec('0x32')][_0xbaec('0x34')]?_0x30d993[_0xbaec('0x32')]:_0x1b7799[_0xbaec('0x2c')];_0x30d993[_0xbaec('0x49')]=qs[_0xbaec('0x37')](_0xbcab15[_0xbaec('0x2e')]['sort']);_0x30d993['where']=qs[_0xbaec('0x30')](_[_0xbaec('0x39')](_0xbcab15[_0xbaec('0x2e')],_0x1b7799[_0xbaec('0x30')]));if(_0xbcab15[_0xbaec('0x2e')][_0xbaec('0x3a')]){_0x30d993[_0xbaec('0x38')]=_[_0xbaec('0x3c')](_0x30d993[_0xbaec('0x38')],{'$or':_[_0xbaec('0x2d')](_0x30d993[_0xbaec('0x32')],function(_0x46a832){var _0x586fa={};_0x586fa[_0x46a832]={'$like':'%'+_0xbcab15['query']['filter']+'%'};return _0x586fa;})});}_0x30d993=_['merge']({},_0x30d993,_0xbcab15[_0xbaec('0x3d')]);return _0x436ab1[_0xbaec('0x4c')](_0x30d993);}})['then'](function(_0x3caa9c){if(_0x3caa9c){_0x290af8=_0x3caa9c[_0xbaec('0x34')];if(!_0xbcab15['query']['hasOwnProperty'](_0xbaec('0x36'))){_0x30d993['limit']=qs[_0xbaec('0x1e')](_0xbcab15[_0xbaec('0x2e')]['limit']);_0x30d993[_0xbaec('0x1c')]=qs[_0xbaec('0x1c')](_0xbcab15[_0xbaec('0x2e')]['offset']);}return _0x436ab1[_0xbaec('0x4c')](_0x30d993);}})[_0xbaec('0x24')](function(_0x1fce14){if(_0x1fce14){return _0x1fce14?{'count':_0x290af8,'rows':_0x1fce14}:null;}})[_0xbaec('0x24')](respondWithResult(_0x195dc9,null))['catch'](handleError(_0x195dc9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 430f133..3505296 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0xe5b3,0x133));var _0x3e5b=function(_0x40e640,_0x3c50f0){_0x40e640=_0x40e640-0x0;var _0xacd87e=_0xe5b3[_0x40e640];return _0xacd87e;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x4bd795,_0x4b5438){var _0x5e37f8=function(_0x2862e8){while(--_0x2862e8){_0x4bd795['push'](_0x4bd795['shift']());}};_0x5e37f8(++_0x4b5438);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fbe2d,_0x8a7c76){_0x1fbe2d=_0x1fbe2d-0x0;var _0x24bfa3=_0x8d0e[_0x1fbe2d];return _0x24bfa3;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 0c566c2..cb04206 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 _0x3296=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3296,0x1d8));var _0x6329=function(_0x441a91,_0x1a55e3){_0x441a91=_0x441a91-0x0;var _0x1c3bff=_0x3296[_0x441a91];return _0x1c3bff;};'use strict';var _=require('lodash');var util=require(_0x6329('0x0'));var moment=require(_0x6329('0x1'));var BPromise=require('bluebird');var rs=require(_0x6329('0x2'));var fs=require('fs');var Redis=require(_0x6329('0x3'));var db=require(_0x6329('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6329('0x5'))(_0x6329('0x6'));var config=require(_0x6329('0x7'));var jayson=require(_0x6329('0x8'));var client=jayson[_0x6329('0x9')][_0x6329('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56e1d0,_0x4319f1,_0x43b7d6){return new BPromise(function(_0x452f9c,_0x4020c3){return client[_0x6329('0xb')](_0x56e1d0,_0x43b7d6)[_0x6329('0xc')](function(_0x22843e){logger[_0x6329('0xd')](_0x6329('0xe'),_0x4319f1,_0x6329('0xf'));logger[_0x6329('0x10')](_0x6329('0x11'),_0x4319f1,_0x6329('0xf'),JSON[_0x6329('0x12')](_0x22843e));if(_0x22843e[_0x6329('0x13')]){if(_0x22843e[_0x6329('0x13')]['code']===0x1f4){logger[_0x6329('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4319f1,_0x22843e[_0x6329('0x13')][_0x6329('0x14')]);return _0x4020c3(_0x22843e[_0x6329('0x13')][_0x6329('0x14')]);}logger[_0x6329('0x13')](_0x6329('0xe'),_0x4319f1,_0x22843e[_0x6329('0x13')][_0x6329('0x14')]);return _0x452f9c(_0x22843e['error'][_0x6329('0x14')]);}else{logger['info'](_0x6329('0xe'),_0x4319f1,_0x6329('0xf'));_0x452f9c(_0x22843e[_0x6329('0x15')][_0x6329('0x14')]);}})[_0x6329('0x16')](function(_0x421090){logger[_0x6329('0x13')](_0x6329('0xe'),_0x4319f1,_0x421090);_0x4020c3(_0x421090);});});} \ No newline at end of file +var _0x2d47=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x3a780c,_0x34684b){var _0x525062=function(_0x5d83e0){while(--_0x5d83e0){_0x3a780c['push'](_0x3a780c['shift']());}};_0x525062(++_0x34684b);}(_0x2d47,0x196));var _0x72d4=function(_0x6ad6c0,_0x39de11){_0x6ad6c0=_0x6ad6c0-0x0;var _0x139825=_0x2d47[_0x6ad6c0];return _0x139825;};'use strict';var _=require(_0x72d4('0x0'));var util=require(_0x72d4('0x1'));var moment=require(_0x72d4('0x2'));var BPromise=require(_0x72d4('0x3'));var rs=require(_0x72d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d4('0x5'))['db'];var utils=require(_0x72d4('0x6'));var logger=require(_0x72d4('0x7'))(_0x72d4('0x8'));var config=require(_0x72d4('0x9'));var jayson=require(_0x72d4('0xa'));var client=jayson[_0x72d4('0xb')][_0x72d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x161e69,_0x37044d,_0x533f20){return new BPromise(function(_0xd0e6fc,_0x1bf6dd){return client[_0x72d4('0xd')](_0x161e69,_0x533f20)[_0x72d4('0xe')](function(_0x36e697){logger[_0x72d4('0xf')](_0x72d4('0x10'),_0x37044d,_0x72d4('0x11'));logger[_0x72d4('0x12')](_0x72d4('0x13'),_0x37044d,'request\x20sent',JSON[_0x72d4('0x14')](_0x36e697));if(_0x36e697[_0x72d4('0x15')]){if(_0x36e697[_0x72d4('0x15')]['code']===0x1f4){logger[_0x72d4('0x15')](_0x72d4('0x10'),_0x37044d,_0x36e697[_0x72d4('0x15')][_0x72d4('0x16')]);return _0x1bf6dd(_0x36e697['error'][_0x72d4('0x16')]);}logger[_0x72d4('0x15')](_0x72d4('0x10'),_0x37044d,_0x36e697[_0x72d4('0x15')][_0x72d4('0x16')]);return _0xd0e6fc(_0x36e697['error'][_0x72d4('0x16')]);}else{logger['info'](_0x72d4('0x10'),_0x37044d,_0x72d4('0x11'));_0xd0e6fc(_0x36e697['result']['message']);}})[_0x72d4('0x17')](function(_0x1548ff){logger[_0x72d4('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x37044d,_0x1548ff);_0x1bf6dd(_0x1548ff);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 258ce51..5a66a66 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 _0x5b47=['index','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5b47,0x98));var _0x75b4=function(_0x1d4b88,_0x8a052f){_0x1d4b88=_0x1d4b88-0x0;var _0x36da06=_0x5b47[_0x1d4b88];return _0x36da06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x75b4('0x0'));var timeout=require(_0x75b4('0x1'));var express=require('express');var router=express[_0x75b4('0x2')]();var fs_extra=require(_0x75b4('0x3'));var auth=require(_0x75b4('0x4'));var interaction=require(_0x75b4('0x5'));var config=require(_0x75b4('0x6'));var controller=require(_0x75b4('0x7'));router[_0x75b4('0x8')]('/',auth[_0x75b4('0x9')](),controller[_0x75b4('0xa')]);router[_0x75b4('0x8')](_0x75b4('0xb'),auth[_0x75b4('0x9')](),controller['show']);router[_0x75b4('0xc')]('/',auth[_0x75b4('0x9')](),controller[_0x75b4('0xd')]);router['put'](_0x75b4('0xb'),auth['isAuthenticated'](),controller[_0x75b4('0xe')]);router[_0x75b4('0xf')](_0x75b4('0xb'),auth[_0x75b4('0x9')](),controller[_0x75b4('0x10')]);module[_0x75b4('0x11')]=router; \ No newline at end of file +var _0xb7c3=['isAuthenticated','index','show','put','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x1317f4,_0x52cf32){var _0xc1f884=function(_0x11baeb){while(--_0x11baeb){_0x1317f4['push'](_0x1317f4['shift']());}};_0xc1f884(++_0x52cf32);}(_0xb7c3,0x1a6));var _0x3b7c=function(_0x2728e4,_0x5c7199){_0x2728e4=_0x2728e4-0x0;var _0x4623de=_0xb7c3[_0x2728e4];return _0x4623de;};'use strict';var multer=require('multer');var util=require(_0x3b7c('0x0'));var path=require(_0x3b7c('0x1'));var timeout=require(_0x3b7c('0x2'));var express=require(_0x3b7c('0x3'));var router=express[_0x3b7c('0x4')]();var fs_extra=require(_0x3b7c('0x5'));var auth=require(_0x3b7c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3b7c('0x7'));var controller=require(_0x3b7c('0x8'));router[_0x3b7c('0x9')]('/',auth[_0x3b7c('0xa')](),controller[_0x3b7c('0xb')]);router[_0x3b7c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3b7c('0xc')]);router['post']('/',auth[_0x3b7c('0xa')](),controller['create']);router[_0x3b7c('0xd')]('/:id',auth[_0x3b7c('0xa')](),controller[_0x3b7c('0xe')]);router['delete'](_0x3b7c('0xf'),auth[_0x3b7c('0xa')](),controller[_0x3b7c('0x10')]);module[_0x3b7c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 50dc987..3d222fd 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 _0xfea3=['string','customVariable','STRING','variable','BOOLEAN','exports','ENUM'];(function(_0x2397b7,_0x5f1976){var _0x5b5cf7=function(_0x357dca){while(--_0x357dca){_0x2397b7['push'](_0x2397b7['shift']());}};_0x5b5cf7(++_0x5f1976);}(_0xfea3,0x186));var _0x3fea=function(_0x34d408,_0x32ec83){_0x34d408=_0x34d408-0x0;var _0x20366c=_0xfea3[_0x34d408];return _0x20366c;};'use strict';var Sequelize=require('sequelize');module[_0x3fea('0x0')]={'type':{'type':Sequelize[_0x3fea('0x1')](_0x3fea('0x2'),'variable',_0x3fea('0x3'),'keyValue','picklist'),'defaultValue':_0x3fea('0x2')},'content':{'type':Sequelize[_0x3fea('0x4')]},'key':{'type':Sequelize[_0x3fea('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x3fea('0x2'),_0x3fea('0x5'),_0x3fea('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3fea('0x4')]},'nameField':{'type':Sequelize[_0x3fea('0x4')]},'customField':{'type':Sequelize[_0x3fea('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x471b=['BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x1ca1e9,_0x165b5d){var _0xfdf320=function(_0x47aefb){while(--_0x47aefb){_0x1ca1e9['push'](_0x1ca1e9['shift']());}};_0xfdf320(++_0x165b5d);}(_0x471b,0x13c));var _0xb471=function(_0x5ba275,_0x49eb48){_0x5ba275=_0x5ba275-0x0;var _0x135685=_0x471b[_0x5ba275];return _0x135685;};'use strict';var Sequelize=require(_0xb471('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb471('0x1'),_0xb471('0x2'),_0xb471('0x3'),_0xb471('0x4'),_0xb471('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb471('0x6')]},'key':{'type':Sequelize[_0xb471('0x6')]},'keyType':{'type':Sequelize[_0xb471('0x7')](_0xb471('0x1'),_0xb471('0x2'),_0xb471('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb471('0x6')]},'nameField':{'type':Sequelize[_0xb471('0x6')]},'customField':{'type':Sequelize[_0xb471('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 8d34b1b..d492fd4 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 _0xae69=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','length','model','hasOwnProperty','where','filter','merge','VIRTUAL','options','then','findAll','rows','catch','params','fields','includeAll','include','find','create','update','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xae69,0xc6));var _0x9ae6=function(_0x37a0c1,_0x46c8bd){_0x37a0c1=_0x37a0c1-0x0;var _0x4c4f33=_0xae69[_0x37a0c1];return _0x4c4f33;};'use strict';var emlformat=require(_0x9ae6('0x0'));var rimraf=require(_0x9ae6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ae6('0x2'));var rp=require('request-promise');var moment=require(_0x9ae6('0x3'));var BPromise=require(_0x9ae6('0x4'));var Mustache=require(_0x9ae6('0x5'));var util=require(_0x9ae6('0x6'));var path=require(_0x9ae6('0x7'));var sox=require(_0x9ae6('0x8'));var csv=require(_0x9ae6('0x9'));var ejs=require(_0x9ae6('0xa'));var fs=require('fs');var fs_extra=require(_0x9ae6('0xb'));var _=require('lodash');var squel=require(_0x9ae6('0xc'));var crypto=require(_0x9ae6('0xd'));var jsforce=require(_0x9ae6('0xe'));var deskjs=require(_0x9ae6('0xf'));var toCsv=require(_0x9ae6('0x9'));var querystring=require(_0x9ae6('0x10'));var Papa=require('papaparse');var Redis=require(_0x9ae6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9ae6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9ae6('0x13'));var utils=require(_0x9ae6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9ae6('0x15'))['db'];function respondWithStatusCode(_0x55f1d3,_0x2609f0){_0x2609f0=_0x2609f0||0xcc;return function(_0x197bc1){if(_0x197bc1){return _0x55f1d3[_0x9ae6('0x16')](_0x2609f0);}return _0x55f1d3[_0x9ae6('0x17')](_0x2609f0)['end']();};}function respondWithResult(_0x3a16d9,_0x2565ce){_0x2565ce=_0x2565ce||0xc8;return function(_0x50857e){if(_0x50857e){return _0x3a16d9[_0x9ae6('0x17')](_0x2565ce)[_0x9ae6('0x18')](_0x50857e);}};}function respondWithFilteredResult(_0x4ecb1b,_0x3073dd){return function(_0x144b9a){if(_0x144b9a){var _0x275458=typeof _0x3073dd[_0x9ae6('0x19')]===_0x9ae6('0x1a')&&typeof _0x3073dd[_0x9ae6('0x1b')]==='undefined';var _0x3f1840=_0x144b9a[_0x9ae6('0x1c')];var _0x5b489b=_0x275458?0x0:_0x3073dd[_0x9ae6('0x19')];var _0x2ed71e=_0x275458?_0x144b9a[_0x9ae6('0x1c')]:_0x3073dd[_0x9ae6('0x19')]+_0x3073dd['limit'];var _0x9cfa00;if(_0x2ed71e>=_0x3f1840){_0x2ed71e=_0x3f1840;_0x9cfa00=0xc8;}else{_0x9cfa00=0xce;}_0x4ecb1b[_0x9ae6('0x17')](_0x9cfa00);return _0x4ecb1b[_0x9ae6('0x1d')](_0x9ae6('0x1e'),_0x5b489b+'-'+_0x2ed71e+'/'+_0x3f1840)[_0x9ae6('0x18')](_0x144b9a);}return null;};}function patchUpdates(_0x4785bb){return function(_0x29a3c1){try{jsonpatch[_0x9ae6('0x1f')](_0x29a3c1,_0x4785bb,!![]);}catch(_0x360152){return BPromise[_0x9ae6('0x20')](_0x360152);}return _0x29a3c1[_0x9ae6('0x21')]();};}function saveUpdates(_0x3f9a1c,_0x7bd14e){return function(_0x286d26){if(_0x286d26){return _0x286d26['update'](_0x3f9a1c)['then'](function(_0x5c5404){return _0x5c5404;});}return null;};}function removeEntity(_0x4c90b5,_0x4e64ed){return function(_0x296454){if(_0x296454){return _0x296454[_0x9ae6('0x22')]()['then'](function(){_0x4c90b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf30004,_0x146dc3){return function(_0x417505){if(!_0x417505){_0xf30004[_0x9ae6('0x16')](0x194);}return _0x417505;};}function handleError(_0x115e94,_0x837074){_0x837074=_0x837074||0x1f4;return function(_0x463e6a){logger[_0x9ae6('0x23')](_0x463e6a[_0x9ae6('0x24')]);if(_0x463e6a[_0x9ae6('0x25')]){delete _0x463e6a[_0x9ae6('0x25')];}_0x115e94[_0x9ae6('0x17')](_0x837074)['send'](_0x463e6a);};}exports['index']=function(_0x63d0d5,_0x5f2e11){var _0x460c79={},_0x2f680e={},_0x1e3830={'count':0x0,'rows':[]};var _0x3beb58=_[_0x9ae6('0x26')](db[_0x9ae6('0x27')][_0x9ae6('0x28')],function(_0x2d91e7){return{'name':_0x2d91e7[_0x9ae6('0x29')],'type':_0x2d91e7[_0x9ae6('0x2a')]['key']};});_0x2f680e['model']=_['map'](_0x3beb58,'name');_0x2f680e[_0x9ae6('0x2b')]=_[_0x9ae6('0x2c')](_0x63d0d5[_0x9ae6('0x2b')]);_0x2f680e[_0x9ae6('0x2d')]=_[_0x9ae6('0x2e')](_0x2f680e['model'],_0x2f680e['query']);_0x460c79[_0x9ae6('0x2f')]=_[_0x9ae6('0x2e')](_0x2f680e['model'],qs['fields'](_0x63d0d5[_0x9ae6('0x2b')]['fields']));_0x460c79[_0x9ae6('0x2f')]=_0x460c79[_0x9ae6('0x2f')][_0x9ae6('0x30')]?_0x460c79['attributes']:_0x2f680e[_0x9ae6('0x31')];if(!_0x63d0d5['query'][_0x9ae6('0x32')]('nolimit')){_0x460c79[_0x9ae6('0x1b')]=qs[_0x9ae6('0x1b')](_0x63d0d5[_0x9ae6('0x2b')][_0x9ae6('0x1b')]);_0x460c79['offset']=qs[_0x9ae6('0x19')](_0x63d0d5['query']['offset']);}_0x460c79['order']=qs['sort'](_0x63d0d5['query']['sort']);_0x460c79[_0x9ae6('0x33')]=qs[_0x9ae6('0x2d')](_['pick'](_0x63d0d5['query'],_0x2f680e[_0x9ae6('0x2d')]),_0x3beb58);if(_0x63d0d5['query'][_0x9ae6('0x34')]){_0x460c79[_0x9ae6('0x33')]=_[_0x9ae6('0x35')](_0x460c79[_0x9ae6('0x33')],{'$or':_['map'](_0x3beb58,function(_0xf84a04){if(_0xf84a04[_0x9ae6('0x2a')]!==_0x9ae6('0x36')){var _0xa59603={};_0xa59603[_0xf84a04[_0x9ae6('0x25')]]={'$like':'%'+_0x63d0d5[_0x9ae6('0x2b')][_0x9ae6('0x34')]+'%'};return _0xa59603;}})});}_0x460c79=_[_0x9ae6('0x35')]({},_0x460c79,_0x63d0d5[_0x9ae6('0x37')]);var _0x56fb54={'where':_0x460c79['where']};return db[_0x9ae6('0x27')][_0x9ae6('0x1c')](_0x56fb54)[_0x9ae6('0x38')](function(_0x485e38){_0x1e3830[_0x9ae6('0x1c')]=_0x485e38;if(_0x63d0d5['query']['includeAll']){_0x460c79['include']=[{'all':!![]}];}return db[_0x9ae6('0x27')][_0x9ae6('0x39')](_0x460c79);})[_0x9ae6('0x38')](function(_0xa96763){_0x1e3830[_0x9ae6('0x3a')]=_0xa96763;return _0x1e3830;})['then'](respondWithFilteredResult(_0x5f2e11,_0x460c79))[_0x9ae6('0x3b')](handleError(_0x5f2e11,null));};exports['show']=function(_0xf8e572,_0x44dbd0){var _0x179b33={'raw':!![],'where':{'id':_0xf8e572[_0x9ae6('0x3c')]['id']}},_0x297713={};_0x297713['model']=_[_0x9ae6('0x2c')](db[_0x9ae6('0x27')]['rawAttributes']);_0x297713[_0x9ae6('0x2b')]=_[_0x9ae6('0x2c')](_0xf8e572[_0x9ae6('0x2b')]);_0x297713['filters']=_[_0x9ae6('0x2e')](_0x297713['model'],_0x297713['query']);_0x179b33[_0x9ae6('0x2f')]=_[_0x9ae6('0x2e')](_0x297713[_0x9ae6('0x31')],qs[_0x9ae6('0x3d')](_0xf8e572['query']['fields']));_0x179b33['attributes']=_0x179b33[_0x9ae6('0x2f')][_0x9ae6('0x30')]?_0x179b33[_0x9ae6('0x2f')]:_0x297713[_0x9ae6('0x31')];if(_0xf8e572['query'][_0x9ae6('0x3e')]){_0x179b33[_0x9ae6('0x3f')]=[{'all':!![]}];}_0x179b33=_[_0x9ae6('0x35')]({},_0x179b33,_0xf8e572[_0x9ae6('0x37')]);return db[_0x9ae6('0x27')][_0x9ae6('0x40')](_0x179b33)['then'](handleEntityNotFound(_0x44dbd0,null))[_0x9ae6('0x38')](respondWithResult(_0x44dbd0,null))[_0x9ae6('0x3b')](handleError(_0x44dbd0,null));};exports[_0x9ae6('0x41')]=function(_0x1e990f,_0x260a24){return db[_0x9ae6('0x27')][_0x9ae6('0x41')](_0x1e990f['body'],{})[_0x9ae6('0x38')](respondWithResult(_0x260a24,0xc9))[_0x9ae6('0x3b')](handleError(_0x260a24,null));};exports[_0x9ae6('0x42')]=function(_0x22a04d,_0x16ec64){if(_0x22a04d[_0x9ae6('0x43')]['id']){delete _0x22a04d['body']['id'];}return db[_0x9ae6('0x27')][_0x9ae6('0x40')]({'where':{'id':_0x22a04d['params']['id']}})[_0x9ae6('0x38')](handleEntityNotFound(_0x16ec64,null))[_0x9ae6('0x38')](saveUpdates(_0x22a04d[_0x9ae6('0x43')],null))['then'](respondWithResult(_0x16ec64,null))[_0x9ae6('0x3b')](handleError(_0x16ec64,null));};exports[_0x9ae6('0x22')]=function(_0x173fb3,_0x35558d){return db['Dynamics365Field'][_0x9ae6('0x40')]({'where':{'id':_0x173fb3['params']['id']}})[_0x9ae6('0x38')](handleEntityNotFound(_0x35558d,null))[_0x9ae6('0x38')](removeEntity(_0x35558d,null))[_0x9ae6('0x3b')](handleError(_0x35558d,null));}; \ No newline at end of file +var _0xbe2a=['Dynamics365Field','includeAll','include','show','fields','catch','create','body','params','find','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x29fdde,_0x758fe8){var _0x64201=function(_0x3943bd){while(--_0x3943bd){_0x29fdde['push'](_0x29fdde['shift']());}};_0x64201(++_0x758fe8);}(_0xbe2a,0x96));var _0xabe2=function(_0x50bffd,_0xc34d6a){_0x50bffd=_0x50bffd-0x0;var _0x47fe91=_0xbe2a[_0x50bffd];return _0x47fe91;};'use strict';var emlformat=require(_0xabe2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabe2('0x1'));var jsonpatch=require(_0xabe2('0x2'));var rp=require(_0xabe2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabe2('0x4'));var path=require(_0xabe2('0x5'));var sox=require(_0xabe2('0x6'));var csv=require(_0xabe2('0x7'));var ejs=require(_0xabe2('0x8'));var fs=require('fs');var fs_extra=require(_0xabe2('0x9'));var _=require('lodash');var squel=require(_0xabe2('0xa'));var crypto=require(_0xabe2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabe2('0xc'));var toCsv=require(_0xabe2('0x7'));var querystring=require(_0xabe2('0xd'));var Papa=require(_0xabe2('0xe'));var Redis=require(_0xabe2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabe2('0x10'));var logger=require(_0xabe2('0x11'))(_0xabe2('0x12'));var utils=require(_0xabe2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xabe2('0x14'));var db=require(_0xabe2('0x15'))['db'];function respondWithStatusCode(_0x5f3d42,_0x4bdac0){_0x4bdac0=_0x4bdac0||0xcc;return function(_0x151d03){if(_0x151d03){return _0x5f3d42[_0xabe2('0x16')](_0x4bdac0);}return _0x5f3d42['status'](_0x4bdac0)[_0xabe2('0x17')]();};}function respondWithResult(_0x4f0d74,_0x1b5418){_0x1b5418=_0x1b5418||0xc8;return function(_0x4080b4){if(_0x4080b4){return _0x4f0d74[_0xabe2('0x18')](_0x1b5418)[_0xabe2('0x19')](_0x4080b4);}};}function respondWithFilteredResult(_0x2622f4,_0x187c58){return function(_0x2fb4c6){if(_0x2fb4c6){var _0x7fe45c=typeof _0x187c58[_0xabe2('0x1a')]===_0xabe2('0x1b')&&typeof _0x187c58[_0xabe2('0x1c')]===_0xabe2('0x1b');var _0x1abfd4=_0x2fb4c6[_0xabe2('0x1d')];var _0x529d39=_0x7fe45c?0x0:_0x187c58[_0xabe2('0x1a')];var _0x3c62ca=_0x7fe45c?_0x2fb4c6[_0xabe2('0x1d')]:_0x187c58[_0xabe2('0x1a')]+_0x187c58[_0xabe2('0x1c')];var _0x4de508;if(_0x3c62ca>=_0x1abfd4){_0x3c62ca=_0x1abfd4;_0x4de508=0xc8;}else{_0x4de508=0xce;}_0x2622f4[_0xabe2('0x18')](_0x4de508);return _0x2622f4[_0xabe2('0x1e')](_0xabe2('0x1f'),_0x529d39+'-'+_0x3c62ca+'/'+_0x1abfd4)[_0xabe2('0x19')](_0x2fb4c6);}return null;};}function patchUpdates(_0x26e8eb){return function(_0x12e534){try{jsonpatch[_0xabe2('0x20')](_0x12e534,_0x26e8eb,!![]);}catch(_0x4373f1){return BPromise['reject'](_0x4373f1);}return _0x12e534['save']();};}function saveUpdates(_0x4bb1cd,_0x4fdcf4){return function(_0x2f951b){if(_0x2f951b){return _0x2f951b[_0xabe2('0x21')](_0x4bb1cd)[_0xabe2('0x22')](function(_0x4aa057){return _0x4aa057;});}return null;};}function removeEntity(_0x875bae,_0x52c83d){return function(_0x4e4a81){if(_0x4e4a81){return _0x4e4a81[_0xabe2('0x23')]()[_0xabe2('0x22')](function(){_0x875bae[_0xabe2('0x18')](0xcc)[_0xabe2('0x17')]();});}};}function handleEntityNotFound(_0x424a2a,_0x2e9e68){return function(_0x5a6ca8){if(!_0x5a6ca8){_0x424a2a[_0xabe2('0x16')](0x194);}return _0x5a6ca8;};}function handleError(_0x11b608,_0x58acc3){_0x58acc3=_0x58acc3||0x1f4;return function(_0x1d320d){logger['error'](_0x1d320d[_0xabe2('0x24')]);if(_0x1d320d[_0xabe2('0x25')]){delete _0x1d320d[_0xabe2('0x25')];}_0x11b608[_0xabe2('0x18')](_0x58acc3)['send'](_0x1d320d);};}exports[_0xabe2('0x26')]=function(_0xbe77b5,_0x94cbdb){var _0x56151d={},_0x302531={},_0x1f8c30={'count':0x0,'rows':[]};var _0x1352a5=_[_0xabe2('0x27')](db['Dynamics365Field'][_0xabe2('0x28')],function(_0x18a7bf){return{'name':_0x18a7bf[_0xabe2('0x29')],'type':_0x18a7bf[_0xabe2('0x2a')][_0xabe2('0x2b')]};});_0x302531[_0xabe2('0x2c')]=_[_0xabe2('0x27')](_0x1352a5,_0xabe2('0x25'));_0x302531[_0xabe2('0x2d')]=_[_0xabe2('0x2e')](_0xbe77b5[_0xabe2('0x2d')]);_0x302531[_0xabe2('0x2f')]=_[_0xabe2('0x30')](_0x302531[_0xabe2('0x2c')],_0x302531[_0xabe2('0x2d')]);_0x56151d[_0xabe2('0x31')]=_[_0xabe2('0x30')](_0x302531[_0xabe2('0x2c')],qs['fields'](_0xbe77b5[_0xabe2('0x2d')]['fields']));_0x56151d[_0xabe2('0x31')]=_0x56151d[_0xabe2('0x31')][_0xabe2('0x32')]?_0x56151d[_0xabe2('0x31')]:_0x302531['model'];if(!_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x33')](_0xabe2('0x34'))){_0x56151d[_0xabe2('0x1c')]=qs[_0xabe2('0x1c')](_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x1c')]);_0x56151d[_0xabe2('0x1a')]=qs[_0xabe2('0x1a')](_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x1a')]);}_0x56151d[_0xabe2('0x35')]=qs[_0xabe2('0x36')](_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x36')]);_0x56151d[_0xabe2('0x37')]=qs[_0xabe2('0x2f')](_[_0xabe2('0x38')](_0xbe77b5[_0xabe2('0x2d')],_0x302531['filters']),_0x1352a5);if(_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x39')]){_0x56151d[_0xabe2('0x37')]=_[_0xabe2('0x3a')](_0x56151d[_0xabe2('0x37')],{'$or':_[_0xabe2('0x27')](_0x1352a5,function(_0x47c998){if(_0x47c998['type']!==_0xabe2('0x3b')){var _0x5e163f={};_0x5e163f[_0x47c998[_0xabe2('0x25')]]={'$like':'%'+_0xbe77b5[_0xabe2('0x2d')][_0xabe2('0x39')]+'%'};return _0x5e163f;}})});}_0x56151d=_[_0xabe2('0x3a')]({},_0x56151d,_0xbe77b5['options']);var _0x4357e6={'where':_0x56151d[_0xabe2('0x37')]};return db[_0xabe2('0x3c')][_0xabe2('0x1d')](_0x4357e6)['then'](function(_0x1585fa){_0x1f8c30[_0xabe2('0x1d')]=_0x1585fa;if(_0xbe77b5['query'][_0xabe2('0x3d')]){_0x56151d[_0xabe2('0x3e')]=[{'all':!![]}];}return db[_0xabe2('0x3c')]['findAll'](_0x56151d);})['then'](function(_0x55d2f6){_0x1f8c30['rows']=_0x55d2f6;return _0x1f8c30;})[_0xabe2('0x22')](respondWithFilteredResult(_0x94cbdb,_0x56151d))['catch'](handleError(_0x94cbdb,null));};exports[_0xabe2('0x3f')]=function(_0x2a53e3,_0x1a1e9f){var _0x4e604c={'raw':!![],'where':{'id':_0x2a53e3['params']['id']}},_0x5cdce2={};_0x5cdce2[_0xabe2('0x2c')]=_['keys'](db[_0xabe2('0x3c')][_0xabe2('0x28')]);_0x5cdce2['query']=_['keys'](_0x2a53e3[_0xabe2('0x2d')]);_0x5cdce2[_0xabe2('0x2f')]=_[_0xabe2('0x30')](_0x5cdce2[_0xabe2('0x2c')],_0x5cdce2[_0xabe2('0x2d')]);_0x4e604c[_0xabe2('0x31')]=_[_0xabe2('0x30')](_0x5cdce2[_0xabe2('0x2c')],qs[_0xabe2('0x40')](_0x2a53e3['query'][_0xabe2('0x40')]));_0x4e604c[_0xabe2('0x31')]=_0x4e604c[_0xabe2('0x31')][_0xabe2('0x32')]?_0x4e604c[_0xabe2('0x31')]:_0x5cdce2[_0xabe2('0x2c')];if(_0x2a53e3[_0xabe2('0x2d')][_0xabe2('0x3d')]){_0x4e604c[_0xabe2('0x3e')]=[{'all':!![]}];}_0x4e604c=_[_0xabe2('0x3a')]({},_0x4e604c,_0x2a53e3['options']);return db[_0xabe2('0x3c')]['find'](_0x4e604c)[_0xabe2('0x22')](handleEntityNotFound(_0x1a1e9f,null))['then'](respondWithResult(_0x1a1e9f,null))[_0xabe2('0x41')](handleError(_0x1a1e9f,null));};exports[_0xabe2('0x42')]=function(_0x41e857,_0x427bf2){return db[_0xabe2('0x3c')][_0xabe2('0x42')](_0x41e857[_0xabe2('0x43')],{})[_0xabe2('0x22')](respondWithResult(_0x427bf2,0xc9))[_0xabe2('0x41')](handleError(_0x427bf2,null));};exports[_0xabe2('0x21')]=function(_0x3808f2,_0x190cec){if(_0x3808f2['body']['id']){delete _0x3808f2[_0xabe2('0x43')]['id'];}return db[_0xabe2('0x3c')]['find']({'where':{'id':_0x3808f2[_0xabe2('0x44')]['id']}})[_0xabe2('0x22')](handleEntityNotFound(_0x190cec,null))['then'](saveUpdates(_0x3808f2[_0xabe2('0x43')],null))[_0xabe2('0x22')](respondWithResult(_0x190cec,null))[_0xabe2('0x41')](handleError(_0x190cec,null));};exports[_0xabe2('0x23')]=function(_0x481272,_0x4cd37b){return db[_0xabe2('0x3c')][_0xabe2('0x45')]({'where':{'id':_0x481272[_0xabe2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cd37b,null))[_0xabe2('0x22')](removeEntity(_0x4cd37b,null))['catch'](handleError(_0x4cd37b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9d71ca2..e304c3d 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 _0x1543=['idField','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1543,0x1a5));var _0x3154=function(_0x1564f0,_0x38869c){_0x1564f0=_0x1564f0-0x0;var _0x551cf1=_0x1543[_0x1564f0];return _0x551cf1;};'use strict';var _=require(_0x3154('0x0'));var util=require('util');var logger=require(_0x3154('0x1'))(_0x3154('0x2'));var moment=require(_0x3154('0x3'));var BPromise=require('bluebird');var rp=require(_0x3154('0x4'));var fs=require('fs');var path=require(_0x3154('0x5'));var rimraf=require(_0x3154('0x6'));var config=require('../../config/environment');var attributes=require(_0x3154('0x7'));module['exports']=function(_0x1bbf37,_0x5324b3){return _0x1bbf37['define'](_0x3154('0x8'),attributes,{'tableName':_0x3154('0x9'),'paranoid':![],'indexes':[{'name':_0x3154('0xa'),'fields':[_0x3154('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5505=['define','dynamics365_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x3a782e,_0x51bf11){var _0x4d256c=function(_0x573de8){while(--_0x573de8){_0x3a782e['push'](_0x3a782e['shift']());}};_0x4d256c(++_0x51bf11);}(_0x5505,0x93));var _0x5550=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5505[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5550('0x0'));var moment=require(_0x5550('0x1'));var BPromise=require(_0x5550('0x2'));var rp=require(_0x5550('0x3'));var fs=require('fs');var path=require(_0x5550('0x4'));var rimraf=require(_0x5550('0x5'));var config=require(_0x5550('0x6'));var attributes=require(_0x5550('0x7'));module[_0x5550('0x8')]=function(_0x2aa401,_0x6f0b3f){return _0x2aa401[_0x5550('0x9')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x5550('0xa'),'fields':[_0x5550('0xb'),_0x5550('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 3db4e9d..18bae28 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 _0xfd8b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird'];(function(_0x2f0bf0,_0x2f888e){var _0x502938=function(_0x387ea4){while(--_0x387ea4){_0x2f0bf0['push'](_0x2f0bf0['shift']());}};_0x502938(++_0x2f888e);}(_0xfd8b,0xc5));var _0xbfd8=function(_0x8a97a1,_0xaf1fdf){_0x8a97a1=_0x8a97a1-0x0;var _0x3daafa=_0xfd8b[_0x8a97a1];return _0x3daafa;};'use strict';var _=require(_0xbfd8('0x0'));var util=require(_0xbfd8('0x1'));var moment=require('moment');var BPromise=require(_0xbfd8('0x2'));var rs=require(_0xbfd8('0x3'));var fs=require('fs');var Redis=require(_0xbfd8('0x4'));var db=require(_0xbfd8('0x5'))['db'];var utils=require(_0xbfd8('0x6'));var logger=require(_0xbfd8('0x7'))(_0xbfd8('0x8'));var config=require(_0xbfd8('0x9'));var jayson=require(_0xbfd8('0xa'));var client=jayson[_0xbfd8('0xb')][_0xbfd8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c266b,_0x321324,_0x466b42){return new BPromise(function(_0x41b120,_0x531b90){return client[_0xbfd8('0xd')](_0x4c266b,_0x466b42)[_0xbfd8('0xe')](function(_0xef664b){logger['info'](_0xbfd8('0xf'),_0x321324,_0xbfd8('0x10'));logger[_0xbfd8('0x11')](_0xbfd8('0x12'),_0x321324,_0xbfd8('0x10'),JSON[_0xbfd8('0x13')](_0xef664b));if(_0xef664b[_0xbfd8('0x14')]){if(_0xef664b[_0xbfd8('0x14')][_0xbfd8('0x15')]===0x1f4){logger['error'](_0xbfd8('0xf'),_0x321324,_0xef664b[_0xbfd8('0x14')][_0xbfd8('0x16')]);return _0x531b90(_0xef664b[_0xbfd8('0x14')][_0xbfd8('0x16')]);}logger[_0xbfd8('0x14')](_0xbfd8('0xf'),_0x321324,_0xef664b[_0xbfd8('0x14')][_0xbfd8('0x16')]);return _0x41b120(_0xef664b['error'][_0xbfd8('0x16')]);}else{logger[_0xbfd8('0x17')](_0xbfd8('0xf'),_0x321324,'request\x20sent');_0x41b120(_0xef664b['result'][_0xbfd8('0x16')]);}})[_0xbfd8('0x18')](function(_0x19d494){logger[_0xbfd8('0x14')](_0xbfd8('0xf'),_0x321324,_0x19d494);_0x531b90(_0x19d494);});});} \ No newline at end of file +var _0x47a0=['lodash','moment','bluebird','randomstring','rpc','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x47a0,0xbb));var _0x047a=function(_0x1a5a72,_0x5092ec){_0x1a5a72=_0x1a5a72-0x0;var _0x5e83b8=_0x47a0[_0x1a5a72];return _0x5e83b8;};'use strict';var _=require(_0x047a('0x0'));var util=require('util');var moment=require(_0x047a('0x1'));var BPromise=require(_0x047a('0x2'));var rs=require(_0x047a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x047a('0x4'));var config=require('../../config/environment');var jayson=require(_0x047a('0x5'));var client=jayson[_0x047a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d799,_0x4ddc44,_0x69f8b0){return new BPromise(function(_0x2f32a4,_0x4c780f){return client[_0x047a('0x7')](_0x12d799,_0x69f8b0)[_0x047a('0x8')](function(_0x3869de){logger[_0x047a('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x4ddc44,'request\x20sent');logger[_0x047a('0xa')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4ddc44,_0x047a('0xb'),JSON[_0x047a('0xc')](_0x3869de));if(_0x3869de[_0x047a('0xd')]){if(_0x3869de['error']['code']===0x1f4){logger['error'](_0x047a('0xe'),_0x4ddc44,_0x3869de[_0x047a('0xd')][_0x047a('0xf')]);return _0x4c780f(_0x3869de['error']['message']);}logger[_0x047a('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4ddc44,_0x3869de[_0x047a('0xd')][_0x047a('0xf')]);return _0x2f32a4(_0x3869de[_0x047a('0xd')]['message']);}else{logger[_0x047a('0x9')](_0x047a('0xe'),_0x4ddc44,_0x047a('0xb'));_0x2f32a4(_0x3869de[_0x047a('0x10')][_0x047a('0xf')]);}})['catch'](function(_0x18ec78){logger[_0x047a('0xd')](_0x047a('0xe'),_0x4ddc44,_0x18ec78);_0x4c780f(_0x18ec78);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 88a8acd..645961e 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 _0x6748=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0x6748,0x88));var _0x8674=function(_0x224e23,_0xae780e){_0x224e23=_0x224e23-0x0;var _0x1903a5=_0x6748[_0x224e23];return _0x1903a5;};'use strict';var multer=require('multer');var util=require(_0x8674('0x0'));var path=require(_0x8674('0x1'));var timeout=require(_0x8674('0x2'));var express=require(_0x8674('0x3'));var router=express[_0x8674('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8674('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8674('0x6'));var controller=require(_0x8674('0x7'));router[_0x8674('0x8')]('/',auth['isAuthenticated'](),controller[_0x8674('0x9')]);router['get'](_0x8674('0xa'),auth[_0x8674('0xb')](),controller[_0x8674('0xc')]);router['get'](_0x8674('0xd'),auth[_0x8674('0xb')](),controller[_0x8674('0xe')]);router['get'](_0x8674('0xf'),auth[_0x8674('0xb')](),controller[_0x8674('0x10')]);router['post']('/',auth[_0x8674('0xb')](),controller[_0x8674('0x11')]);router[_0x8674('0x12')](_0x8674('0xd'),auth[_0x8674('0xb')](),controller[_0x8674('0x13')]);router[_0x8674('0x14')](_0x8674('0xa'),auth['isAuthenticated'](),controller[_0x8674('0x15')]);router[_0x8674('0x16')](_0x8674('0xa'),auth[_0x8674('0xb')](),controller[_0x8674('0x17')]);module[_0x8674('0x18')]=router; \ No newline at end of file +var _0x849f=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e7dd7,_0x2cb723){var _0x5a9112=function(_0x54212a){while(--_0x54212a){_0x5e7dd7['push'](_0x5e7dd7['shift']());}};_0x5a9112(++_0x2cb723);}(_0x849f,0x1dd));var _0xf849=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x849f[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0xf849('0x0'));var path=require('path');var timeout=require(_0xf849('0x1'));var express=require(_0xf849('0x2'));var router=express[_0xf849('0x3')]();var fs_extra=require(_0xf849('0x4'));var auth=require(_0xf849('0x5'));var interaction=require(_0xf849('0x6'));var config=require(_0xf849('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0xf849('0x8')]('/',auth['isAuthenticated'](),controller[_0xf849('0x9')]);router[_0xf849('0x8')](_0xf849('0xa'),auth[_0xf849('0xb')](),controller[_0xf849('0xc')]);router[_0xf849('0x8')](_0xf849('0xd'),auth[_0xf849('0xb')](),controller[_0xf849('0xe')]);router[_0xf849('0x8')](_0xf849('0xf'),auth[_0xf849('0xb')](),controller[_0xf849('0x10')]);router[_0xf849('0x11')]('/',auth[_0xf849('0xb')](),controller[_0xf849('0x12')]);router[_0xf849('0x11')](_0xf849('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xf849('0x13')](_0xf849('0xa'),auth[_0xf849('0xb')](),controller['update']);router[_0xf849('0x14')](_0xf849('0xa'),auth['isAuthenticated'](),controller[_0xf849('0x15')]);module[_0xf849('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a950e6f..e6c115e 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 _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xadb5,0xad));var _0x5adb=function(_0x3f1539,_0x11cd92){_0x3f1539=_0x3f1539-0x0;var _0x1390d5=_0xadb5[_0x3f1539];return _0x1390d5;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x29f315,_0x394b22){var _0x2f1e92=function(_0x286f2f){while(--_0x286f2f){_0x29f315['push'](_0x29f315['shift']());}};_0x2f1e92(++_0x394b22);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('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 a41bf08..46e165c 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 _0x93ed=['requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','FreshdeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','show','length','find','catch','create','body','getConfigurations','params','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x93ed,0xfe));var _0xd93e=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0x93ed[_0x262ff6];return _0x4c9b82;};'use strict';var emlformat=require(_0xd93e('0x0'));var rimraf=require(_0xd93e('0x1'));var zipdir=require(_0xd93e('0x2'));var jsonpatch=require(_0xd93e('0x3'));var rp=require(_0xd93e('0x4'));var moment=require('moment');var BPromise=require(_0xd93e('0x5'));var Mustache=require('mustache');var util=require(_0xd93e('0x6'));var path=require(_0xd93e('0x7'));var sox=require('sox');var csv=require(_0xd93e('0x8'));var ejs=require(_0xd93e('0x9'));var fs=require('fs');var fs_extra=require(_0xd93e('0xa'));var _=require(_0xd93e('0xb'));var squel=require(_0xd93e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd93e('0xd'));var toCsv=require(_0xd93e('0x8'));var querystring=require(_0xd93e('0xe'));var Papa=require(_0xd93e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd93e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd93e('0x11'));var logger=require(_0xd93e('0x12'))(_0xd93e('0x13'));var utils=require(_0xd93e('0x14'));var config=require(_0xd93e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd93e('0x16'))['db'];var integrations=require(_0xd93e('0x17'));function respondWithStatusCode(_0x444b08,_0x2e4284){_0x2e4284=_0x2e4284||0xcc;return function(_0x2032c7){if(_0x2032c7){return _0x444b08['sendStatus'](_0x2e4284);}return _0x444b08['status'](_0x2e4284)['end']();};}function respondWithResult(_0x567589,_0x1e1ef4){_0x1e1ef4=_0x1e1ef4||0xc8;return function(_0x42eea7){if(_0x42eea7){return _0x567589[_0xd93e('0x18')](_0x1e1ef4)['json'](_0x42eea7);}};}function respondWithFilteredResult(_0xc53b90,_0x490bc0){return function(_0x1826b8){if(_0x1826b8){var _0x164238=typeof _0x490bc0[_0xd93e('0x19')]===_0xd93e('0x1a')&&typeof _0x490bc0[_0xd93e('0x1b')]===_0xd93e('0x1a');var _0x433ced=_0x1826b8['count'];var _0x50c196=_0x164238?0x0:_0x490bc0['offset'];var _0x2e9fff=_0x164238?_0x1826b8[_0xd93e('0x1c')]:_0x490bc0[_0xd93e('0x19')]+_0x490bc0['limit'];var _0x4c1d3a;if(_0x2e9fff>=_0x433ced){_0x2e9fff=_0x433ced;_0x4c1d3a=0xc8;}else{_0x4c1d3a=0xce;}_0xc53b90[_0xd93e('0x18')](_0x4c1d3a);return _0xc53b90[_0xd93e('0x1d')](_0xd93e('0x1e'),_0x50c196+'-'+_0x2e9fff+'/'+_0x433ced)[_0xd93e('0x1f')](_0x1826b8);}return null;};}function patchUpdates(_0x5bc3f9){return function(_0x23b151){try{jsonpatch[_0xd93e('0x20')](_0x23b151,_0x5bc3f9,!![]);}catch(_0x336e14){return BPromise[_0xd93e('0x21')](_0x336e14);}return _0x23b151[_0xd93e('0x22')]();};}function saveUpdates(_0x4909c1,_0x52376d){return function(_0x287e01){if(_0x287e01){return _0x287e01[_0xd93e('0x23')](_0x4909c1)[_0xd93e('0x24')](function(_0xe5553f){return _0xe5553f;});}return null;};}function removeEntity(_0xd74297,_0x128e72){return function(_0xa0bcbe){if(_0xa0bcbe){return _0xa0bcbe[_0xd93e('0x25')]()[_0xd93e('0x24')](function(){_0xd74297[_0xd93e('0x18')](0xcc)[_0xd93e('0x26')]();});}};}function handleEntityNotFound(_0x538a3e,_0xf6c667){return function(_0x50eec4){if(!_0x50eec4){_0x538a3e['sendStatus'](0x194);}return _0x50eec4;};}function handleError(_0x1b2f60,_0x2175ad){_0x2175ad=_0x2175ad||0x1f4;return function(_0x5aaa9a){logger[_0xd93e('0x27')](_0x5aaa9a[_0xd93e('0x28')]);if(_0x5aaa9a[_0xd93e('0x29')]){delete _0x5aaa9a['name'];}_0x1b2f60[_0xd93e('0x18')](_0x2175ad)[_0xd93e('0x2a')](_0x5aaa9a);};}exports['index']=function(_0x2bff6e,_0x131a9c){var _0x49dae={},_0x41c479={},_0x4e4895={'count':0x0,'rows':[]};var _0x519ee8=_['map'](db[_0xd93e('0x2b')][_0xd93e('0x2c')],function(_0x23c1b4){return{'name':_0x23c1b4[_0xd93e('0x2d')],'type':_0x23c1b4[_0xd93e('0x2e')][_0xd93e('0x2f')]};});_0x41c479['model']=_[_0xd93e('0x30')](_0x519ee8,'name');_0x41c479[_0xd93e('0x31')]=_[_0xd93e('0x32')](_0x2bff6e[_0xd93e('0x31')]);_0x41c479[_0xd93e('0x33')]=_[_0xd93e('0x34')](_0x41c479['model'],_0x41c479['query']);_0x49dae['attributes']=_['intersection'](_0x41c479['model'],qs[_0xd93e('0x35')](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x35')]));_0x49dae['attributes']=_0x49dae[_0xd93e('0x36')]['length']?_0x49dae['attributes']:_0x41c479[_0xd93e('0x37')];if(!_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x38')](_0xd93e('0x39'))){_0x49dae['limit']=qs['limit'](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x1b')]);_0x49dae[_0xd93e('0x19')]=qs['offset'](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x19')]);}_0x49dae['order']=qs['sort'](_0x2bff6e['query'][_0xd93e('0x3a')]);_0x49dae[_0xd93e('0x3b')]=qs[_0xd93e('0x33')](_[_0xd93e('0x3c')](_0x2bff6e[_0xd93e('0x31')],_0x41c479[_0xd93e('0x33')]),_0x519ee8);if(_0x2bff6e[_0xd93e('0x31')]['filter']){_0x49dae[_0xd93e('0x3b')]=_['merge'](_0x49dae[_0xd93e('0x3b')],{'$or':_['map'](_0x519ee8,function(_0x35423f){if(_0x35423f[_0xd93e('0x2e')]!=='VIRTUAL'){var _0x341010={};_0x341010[_0x35423f[_0xd93e('0x29')]]={'$like':'%'+_0x2bff6e['query'][_0xd93e('0x3d')]+'%'};return _0x341010;}})});}_0x49dae=_[_0xd93e('0x3e')]({},_0x49dae,_0x2bff6e[_0xd93e('0x3f')]);var _0x5090bb={'where':_0x49dae['where']};return db['FreshdeskAccount'][_0xd93e('0x1c')](_0x5090bb)[_0xd93e('0x24')](function(_0x17a368){_0x4e4895[_0xd93e('0x1c')]=_0x17a368;if(_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x40')]){_0x49dae[_0xd93e('0x41')]=[{'all':!![]}];}return db[_0xd93e('0x2b')]['findAll'](_0x49dae);})[_0xd93e('0x24')](function(_0x5eeee6){_0x4e4895[_0xd93e('0x42')]=_0x5eeee6;return _0x4e4895;})[_0xd93e('0x24')](respondWithFilteredResult(_0x131a9c,_0x49dae))['catch'](handleError(_0x131a9c,null));};exports[_0xd93e('0x43')]=function(_0x3d490d,_0x11d951){var _0x20c463={'raw':![],'where':{'id':_0x3d490d['params']['id']}},_0x2204c3={};_0x2204c3[_0xd93e('0x37')]=_[_0xd93e('0x32')](db[_0xd93e('0x2b')]['rawAttributes']);_0x2204c3[_0xd93e('0x31')]=_['keys'](_0x3d490d['query']);_0x2204c3[_0xd93e('0x33')]=_[_0xd93e('0x34')](_0x2204c3[_0xd93e('0x37')],_0x2204c3['query']);_0x20c463['attributes']=_[_0xd93e('0x34')](_0x2204c3[_0xd93e('0x37')],qs[_0xd93e('0x35')](_0x3d490d[_0xd93e('0x31')]['fields']));_0x20c463['attributes']=_0x20c463[_0xd93e('0x36')][_0xd93e('0x44')]?_0x20c463[_0xd93e('0x36')]:_0x2204c3[_0xd93e('0x37')];if(_0x3d490d[_0xd93e('0x31')][_0xd93e('0x40')]){_0x20c463[_0xd93e('0x41')]=[{'all':!![]}];}_0x20c463=_[_0xd93e('0x3e')]({},_0x20c463,_0x3d490d[_0xd93e('0x3f')]);return db[_0xd93e('0x2b')][_0xd93e('0x45')](_0x20c463)[_0xd93e('0x24')](handleEntityNotFound(_0x11d951,null))[_0xd93e('0x24')](respondWithResult(_0x11d951,null))[_0xd93e('0x46')](handleError(_0x11d951,null));};exports[_0xd93e('0x47')]=function(_0x1624da,_0x543de8){return db[_0xd93e('0x2b')][_0xd93e('0x47')](_0x1624da[_0xd93e('0x48')],{})[_0xd93e('0x24')](respondWithResult(_0x543de8,0xc9))['catch'](handleError(_0x543de8,null));};exports[_0xd93e('0x23')]=function(_0x57ba4f,_0x467b02){if(_0x57ba4f[_0xd93e('0x48')]['id']){delete _0x57ba4f[_0xd93e('0x48')]['id'];}return db[_0xd93e('0x2b')][_0xd93e('0x45')]({'where':{'id':_0x57ba4f['params']['id']}})[_0xd93e('0x24')](handleEntityNotFound(_0x467b02,null))[_0xd93e('0x24')](saveUpdates(_0x57ba4f[_0xd93e('0x48')],null))[_0xd93e('0x24')](respondWithResult(_0x467b02,null))[_0xd93e('0x46')](handleError(_0x467b02,null));};exports['destroy']=function(_0x1d552d,_0xef2705){return db[_0xd93e('0x2b')][_0xd93e('0x45')]({'where':{'id':_0x1d552d['params']['id']}})['then'](handleEntityNotFound(_0xef2705,null))[_0xd93e('0x24')](removeEntity(_0xef2705,null))[_0xd93e('0x46')](handleError(_0xef2705,null));};exports[_0xd93e('0x49')]=function(_0x2e2eed,_0x3d197d,_0x1cc130){var _0x1fa006={};var _0x15f2c1={};var _0x56be38;var _0x4c6eaa;return db[_0xd93e('0x2b')]['findOne']({'where':{'id':_0x2e2eed[_0xd93e('0x4a')]['id']}})[_0xd93e('0x24')](handleEntityNotFound(_0x3d197d,null))[_0xd93e('0x24')](function(_0x2025c9){if(_0x2025c9){_0x56be38=_0x2025c9;_0x15f2c1[_0xd93e('0x37')]=_['keys'](db[_0xd93e('0x4b')]['rawAttributes']);_0x15f2c1[_0xd93e('0x31')]=_[_0xd93e('0x32')](_0x2e2eed[_0xd93e('0x31')]);_0x15f2c1['filters']=_[_0xd93e('0x34')](_0x15f2c1['model'],_0x15f2c1['query']);_0x1fa006[_0xd93e('0x36')]=_[_0xd93e('0x34')](_0x15f2c1[_0xd93e('0x37')],qs[_0xd93e('0x35')](_0x2e2eed[_0xd93e('0x31')]['fields']));_0x1fa006['attributes']=_0x1fa006['attributes']['length']?_0x1fa006[_0xd93e('0x36')]:_0x15f2c1[_0xd93e('0x37')];_0x1fa006['order']=qs[_0xd93e('0x3a')](_0x2e2eed['query'][_0xd93e('0x3a')]);_0x1fa006[_0xd93e('0x3b')]=qs[_0xd93e('0x33')](_[_0xd93e('0x3c')](_0x2e2eed[_0xd93e('0x31')],_0x15f2c1[_0xd93e('0x33')]));if(_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x3d')]){_0x1fa006['where']=_[_0xd93e('0x3e')](_0x1fa006[_0xd93e('0x3b')],{'$or':_[_0xd93e('0x30')](_0x1fa006[_0xd93e('0x36')],function(_0x3278c9){var _0x4b3c5c={};_0x4b3c5c[_0x3278c9]={'$like':'%'+_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x3d')]+'%'};return _0x4b3c5c;})});}_0x1fa006=_[_0xd93e('0x3e')]({},_0x1fa006,_0x2e2eed[_0xd93e('0x3f')]);return _0x56be38['getConfigurations'](_0x1fa006);}})['then'](function(_0x1efb3f){if(_0x1efb3f){_0x4c6eaa=_0x1efb3f[_0xd93e('0x44')];if(!_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x38')](_0xd93e('0x39'))){_0x1fa006[_0xd93e('0x1b')]=qs[_0xd93e('0x1b')](_0x2e2eed['query'][_0xd93e('0x1b')]);_0x1fa006[_0xd93e('0x19')]=qs['offset'](_0x2e2eed[_0xd93e('0x31')]['offset']);}return _0x56be38[_0xd93e('0x49')](_0x1fa006);}})[_0xd93e('0x24')](function(_0x336bc6){if(_0x336bc6){return _0x336bc6?{'count':_0x4c6eaa,'rows':_0x336bc6}:null;}})[_0xd93e('0x24')](respondWithResult(_0x3d197d,null))['catch'](handleError(_0x3d197d,null));};exports[_0xd93e('0x4c')]=function(_0x2e228a,_0x4d701d,_0xc5d319){if(_0x2e228a['body']['id']){delete _0x2e228a[_0xd93e('0x48')]['id'];}return db[_0xd93e('0x2b')][_0xd93e('0x4d')]({'where':{'id':_0x2e228a['params']['id']}})['then'](handleEntityNotFound(_0x4d701d,null))[_0xd93e('0x24')](function(_0x5214e8){if(_0x5214e8){_0x2e228a[_0xd93e('0x48')][_0xd93e('0x4e')]=_0x5214e8['id'];_0x2e228a['body'][_0xd93e('0x4f')]=integrations[_0xd93e('0x50')](_0x2e228a[_0xd93e('0x48')][_0xd93e('0x51')],_0x2e228a['body'][_0xd93e('0x2e')]);_0x2e228a[_0xd93e('0x48')][_0xd93e('0x52')]=integrations['getDescriptions'](_0x2e228a[_0xd93e('0x48')]['channel'],_0x2e228a[_0xd93e('0x48')][_0xd93e('0x2e')]);return db[_0xd93e('0x4b')]['create'](_0x2e228a[_0xd93e('0x48')],{'include':[{'model':db[_0xd93e('0x53')],'as':_0xd93e('0x4f')},{'model':db[_0xd93e('0x53')],'as':_0xd93e('0x52')}]});}return null;})[_0xd93e('0x24')](respondWithResult(_0x4d701d,null))[_0xd93e('0x46')](handleError(_0x4d701d,null));};exports[_0xd93e('0x54')]=function(_0x24de38,_0x12f2ad,_0x27e5c4){var _0x5ecaad='';return db[_0xd93e('0x2b')][_0xd93e('0x4d')]({'where':{'id':_0x24de38[_0xd93e('0x4a')]['id']},'attributes':['id',_0xd93e('0x55'),_0xd93e('0x56')]})['then'](handleEntityNotFound(_0x12f2ad,null))[_0xd93e('0x24')](function(_0xdc1751){if(_0xdc1751){_0x5ecaad=_0xdc1751[_0xd93e('0x55')];var _0x20d88b=_0x5ecaad['slice'](-0x1);if(_0x20d88b==='/'){_0x5ecaad=_0x5ecaad[_0xd93e('0x57')](0x0,_0x5ecaad[_0xd93e('0x58')](_0x20d88b));}return rp({'method':_0xd93e('0x59'),'uri':util['format'](_0xd93e('0x5a'),_0x5ecaad,_0xd93e('0x5b')),'headers':{'Authorization':util[_0xd93e('0x5c')](_0xd93e('0x5d'),new Buffer(util[_0xd93e('0x5c')](_0xd93e('0x5e'),_0xdc1751[_0xd93e('0x56')]))[_0xd93e('0x5f')](_0xd93e('0x60')))},'json':!![]});}})['then'](function(_0xda7ecc){if(_0xda7ecc){var _0x5a6eea=[_0xd93e('0x61'),_0xd93e('0x62'),_0xd93e('0x63'),_0xd93e('0x64'),_0xd93e('0x18'),_0xd93e('0x65'),_0xd93e('0x66'),_0xd93e('0x67'),_0xd93e('0x68'),_0xd93e('0x66'),'company'];_[_0xd93e('0x69')](_0xda7ecc,function(_0x3b6512){return _0x5a6eea[_0xd93e('0x6a')](_0x3b6512['name'])||!_0x3b6512[_0xd93e('0x6b')]&&_0x3b6512[_0xd93e('0x2e')]!==_0xd93e('0x6c')&&_0x3b6512[_0xd93e('0x2e')]!==_0xd93e('0x6d');});return{'count':_0xda7ecc[_0xd93e('0x44')],'rows':_[_0xd93e('0x30')](_0xda7ecc,function(_0x5c1581){return{'id':_0x5c1581[_0xd93e('0x29')],'name':_0x5c1581[_0xd93e('0x6e')],'custom':!_0x5c1581[_0xd93e('0x6b')],'options':_0x5c1581[_0xd93e('0x6f')]?_['map'](_0x5c1581['choices'],function(_0x18add0){return{'name':_[_0xd93e('0x70')](_0x18add0),'value':_0x18add0};}):[]};})};}})[_0xd93e('0x24')](respondWithResult(_0x12f2ad,null))[_0xd93e('0x46')](function(_0x54ce9a){var _0x45c0ac=_0x24de38['query'][_0xd93e('0x71')]?0x1f4:_0x54ce9a[_0xd93e('0x72')]||0x1f4;logger[_0xd93e('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xd93e('0x54'),_0x45c0ac,JSON[_0xd93e('0x73')](_0x54ce9a));delete _0x54ce9a['name'];if(_0x45c0ac===0x191){_0x45c0ac=0x190;}_0x12f2ad[_0xd93e('0x18')](_0x45c0ac)[_0xd93e('0x2a')](_0x24de38[_0xd93e('0x31')][_0xd93e('0x71')]?{'message':_0xd93e('0x74'),'statusCode':_0x54ce9a[_0xd93e('0x72')]}:_0x54ce9a);});}; \ No newline at end of file +var _0xb63f=['options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','%s:X','toString','base64','agent','description','priority','group','ticket_type','company','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','FreshdeskAccount','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','type'];(function(_0x5af812,_0x43d252){var _0x1489f2=function(_0x1c7fa9){while(--_0x1c7fa9){_0x5af812['push'](_0x5af812['shift']());}};_0x1489f2(++_0x43d252);}(_0xb63f,0xa3));var _0xfb63=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xb63f[_0x31991b];return _0x307304;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb63('0x0'));var jsonpatch=require(_0xfb63('0x1'));var rp=require(_0xfb63('0x2'));var moment=require(_0xfb63('0x3'));var BPromise=require(_0xfb63('0x4'));var Mustache=require(_0xfb63('0x5'));var util=require(_0xfb63('0x6'));var path=require(_0xfb63('0x7'));var sox=require(_0xfb63('0x8'));var csv=require('to-csv');var ejs=require(_0xfb63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb63('0xa'));var squel=require(_0xfb63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb63('0xc'));var querystring=require(_0xfb63('0xd'));var Papa=require(_0xfb63('0xe'));var Redis=require('ioredis');var authService=require(_0xfb63('0xf'));var qs=require(_0xfb63('0x10'));var as=require(_0xfb63('0x11'));var hardwareService=require(_0xfb63('0x12'));var logger=require(_0xfb63('0x13'))(_0xfb63('0x14'));var utils=require(_0xfb63('0x15'));var config=require(_0xfb63('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfb63('0x17'));function respondWithStatusCode(_0x233ec3,_0xa2f034){_0xa2f034=_0xa2f034||0xcc;return function(_0x4844aa){if(_0x4844aa){return _0x233ec3[_0xfb63('0x18')](_0xa2f034);}return _0x233ec3[_0xfb63('0x19')](_0xa2f034)['end']();};}function respondWithResult(_0x4575b6,_0x377d1e){_0x377d1e=_0x377d1e||0xc8;return function(_0x3a4fb8){if(_0x3a4fb8){return _0x4575b6[_0xfb63('0x19')](_0x377d1e)['json'](_0x3a4fb8);}};}function respondWithFilteredResult(_0x44619e,_0x48e2c0){return function(_0x19f196){if(_0x19f196){var _0x24cd53=typeof _0x48e2c0[_0xfb63('0x1a')]===_0xfb63('0x1b')&&typeof _0x48e2c0[_0xfb63('0x1c')]==='undefined';var _0x2ac69a=_0x19f196['count'];var _0x43a9ad=_0x24cd53?0x0:_0x48e2c0['offset'];var _0x31f41c=_0x24cd53?_0x19f196[_0xfb63('0x1d')]:_0x48e2c0[_0xfb63('0x1a')]+_0x48e2c0[_0xfb63('0x1c')];var _0x5b6ccb;if(_0x31f41c>=_0x2ac69a){_0x31f41c=_0x2ac69a;_0x5b6ccb=0xc8;}else{_0x5b6ccb=0xce;}_0x44619e[_0xfb63('0x19')](_0x5b6ccb);return _0x44619e['set'](_0xfb63('0x1e'),_0x43a9ad+'-'+_0x31f41c+'/'+_0x2ac69a)[_0xfb63('0x1f')](_0x19f196);}return null;};}function patchUpdates(_0x564052){return function(_0x21954f){try{jsonpatch[_0xfb63('0x20')](_0x21954f,_0x564052,!![]);}catch(_0x52ef91){return BPromise[_0xfb63('0x21')](_0x52ef91);}return _0x21954f[_0xfb63('0x22')]();};}function saveUpdates(_0x267953,_0x34e22c){return function(_0x32f813){if(_0x32f813){return _0x32f813[_0xfb63('0x23')](_0x267953)[_0xfb63('0x24')](function(_0x1bbedc){return _0x1bbedc;});}return null;};}function removeEntity(_0x43c245,_0xa7612f){return function(_0x3d21b5){if(_0x3d21b5){return _0x3d21b5[_0xfb63('0x25')]()[_0xfb63('0x24')](function(){_0x43c245[_0xfb63('0x19')](0xcc)[_0xfb63('0x26')]();});}};}function handleEntityNotFound(_0x19ea95,_0x1b8f0a){return function(_0x443dbd){if(!_0x443dbd){_0x19ea95['sendStatus'](0x194);}return _0x443dbd;};}function handleError(_0x2bbe9a,_0x4c80c1){_0x4c80c1=_0x4c80c1||0x1f4;return function(_0x4d728c){logger[_0xfb63('0x27')](_0x4d728c[_0xfb63('0x28')]);if(_0x4d728c[_0xfb63('0x29')]){delete _0x4d728c[_0xfb63('0x29')];}_0x2bbe9a[_0xfb63('0x19')](_0x4c80c1)[_0xfb63('0x2a')](_0x4d728c);};}exports['index']=function(_0x45e231,_0x2a008e){var _0x441dd7={},_0x188501={},_0x3c910b={'count':0x0,'rows':[]};var _0x30ea17=_[_0xfb63('0x2b')](db[_0xfb63('0x2c')][_0xfb63('0x2d')],function(_0x2478af){return{'name':_0x2478af[_0xfb63('0x2e')],'type':_0x2478af['type'][_0xfb63('0x2f')]};});_0x188501['model']=_[_0xfb63('0x2b')](_0x30ea17,_0xfb63('0x29'));_0x188501[_0xfb63('0x30')]=_['keys'](_0x45e231['query']);_0x188501[_0xfb63('0x31')]=_['intersection'](_0x188501['model'],_0x188501[_0xfb63('0x30')]);_0x441dd7['attributes']=_[_0xfb63('0x32')](_0x188501[_0xfb63('0x33')],qs[_0xfb63('0x34')](_0x45e231[_0xfb63('0x30')][_0xfb63('0x34')]));_0x441dd7[_0xfb63('0x35')]=_0x441dd7[_0xfb63('0x35')][_0xfb63('0x36')]?_0x441dd7['attributes']:_0x188501['model'];if(!_0x45e231[_0xfb63('0x30')]['hasOwnProperty'](_0xfb63('0x37'))){_0x441dd7[_0xfb63('0x1c')]=qs[_0xfb63('0x1c')](_0x45e231[_0xfb63('0x30')][_0xfb63('0x1c')]);_0x441dd7['offset']=qs['offset'](_0x45e231[_0xfb63('0x30')][_0xfb63('0x1a')]);}_0x441dd7['order']=qs['sort'](_0x45e231['query'][_0xfb63('0x38')]);_0x441dd7[_0xfb63('0x39')]=qs[_0xfb63('0x31')](_['pick'](_0x45e231[_0xfb63('0x30')],_0x188501[_0xfb63('0x31')]),_0x30ea17);if(_0x45e231[_0xfb63('0x30')][_0xfb63('0x3a')]){_0x441dd7[_0xfb63('0x39')]=_[_0xfb63('0x3b')](_0x441dd7[_0xfb63('0x39')],{'$or':_['map'](_0x30ea17,function(_0x4bbf1b){if(_0x4bbf1b[_0xfb63('0x3c')]!=='VIRTUAL'){var _0xed781e={};_0xed781e[_0x4bbf1b[_0xfb63('0x29')]]={'$like':'%'+_0x45e231[_0xfb63('0x30')][_0xfb63('0x3a')]+'%'};return _0xed781e;}})});}_0x441dd7=_[_0xfb63('0x3b')]({},_0x441dd7,_0x45e231[_0xfb63('0x3d')]);var _0x97d793={'where':_0x441dd7[_0xfb63('0x39')]};return db[_0xfb63('0x2c')][_0xfb63('0x1d')](_0x97d793)[_0xfb63('0x24')](function(_0x3aff25){_0x3c910b[_0xfb63('0x1d')]=_0x3aff25;if(_0x45e231[_0xfb63('0x30')][_0xfb63('0x3e')]){_0x441dd7[_0xfb63('0x3f')]=[{'all':!![]}];}return db[_0xfb63('0x2c')][_0xfb63('0x40')](_0x441dd7);})[_0xfb63('0x24')](function(_0x30a2de){_0x3c910b[_0xfb63('0x41')]=_0x30a2de;return _0x3c910b;})['then'](respondWithFilteredResult(_0x2a008e,_0x441dd7))['catch'](handleError(_0x2a008e,null));};exports[_0xfb63('0x42')]=function(_0x54346d,_0x3bdc62){var _0x1fc68b={'raw':![],'where':{'id':_0x54346d[_0xfb63('0x43')]['id']}},_0x3f9885={};_0x3f9885[_0xfb63('0x33')]=_[_0xfb63('0x44')](db[_0xfb63('0x2c')][_0xfb63('0x2d')]);_0x3f9885[_0xfb63('0x30')]=_[_0xfb63('0x44')](_0x54346d[_0xfb63('0x30')]);_0x3f9885[_0xfb63('0x31')]=_['intersection'](_0x3f9885[_0xfb63('0x33')],_0x3f9885[_0xfb63('0x30')]);_0x1fc68b[_0xfb63('0x35')]=_[_0xfb63('0x32')](_0x3f9885[_0xfb63('0x33')],qs[_0xfb63('0x34')](_0x54346d[_0xfb63('0x30')][_0xfb63('0x34')]));_0x1fc68b[_0xfb63('0x35')]=_0x1fc68b['attributes'][_0xfb63('0x36')]?_0x1fc68b[_0xfb63('0x35')]:_0x3f9885[_0xfb63('0x33')];if(_0x54346d[_0xfb63('0x30')][_0xfb63('0x3e')]){_0x1fc68b[_0xfb63('0x3f')]=[{'all':!![]}];}_0x1fc68b=_['merge']({},_0x1fc68b,_0x54346d[_0xfb63('0x3d')]);return db[_0xfb63('0x2c')][_0xfb63('0x45')](_0x1fc68b)[_0xfb63('0x24')](handleEntityNotFound(_0x3bdc62,null))[_0xfb63('0x24')](respondWithResult(_0x3bdc62,null))[_0xfb63('0x46')](handleError(_0x3bdc62,null));};exports[_0xfb63('0x47')]=function(_0x13030c,_0x38737e){return db['FreshdeskAccount'][_0xfb63('0x47')](_0x13030c[_0xfb63('0x48')],{})[_0xfb63('0x24')](respondWithResult(_0x38737e,0xc9))[_0xfb63('0x46')](handleError(_0x38737e,null));};exports[_0xfb63('0x23')]=function(_0x1f0478,_0x1b6717){if(_0x1f0478[_0xfb63('0x48')]['id']){delete _0x1f0478[_0xfb63('0x48')]['id'];}return db['FreshdeskAccount'][_0xfb63('0x45')]({'where':{'id':_0x1f0478[_0xfb63('0x43')]['id']}})[_0xfb63('0x24')](handleEntityNotFound(_0x1b6717,null))[_0xfb63('0x24')](saveUpdates(_0x1f0478[_0xfb63('0x48')],null))[_0xfb63('0x24')](respondWithResult(_0x1b6717,null))['catch'](handleError(_0x1b6717,null));};exports[_0xfb63('0x25')]=function(_0x24aa62,_0x4a20e6){return db[_0xfb63('0x2c')][_0xfb63('0x45')]({'where':{'id':_0x24aa62[_0xfb63('0x43')]['id']}})[_0xfb63('0x24')](handleEntityNotFound(_0x4a20e6,null))[_0xfb63('0x24')](removeEntity(_0x4a20e6,null))[_0xfb63('0x46')](handleError(_0x4a20e6,null));};exports[_0xfb63('0x49')]=function(_0x43c1a8,_0x10aa68,_0x1ccb6a){var _0x69a7eb={};var _0x577412={};var _0x17aad5;var _0x464a67;return db[_0xfb63('0x2c')]['findOne']({'where':{'id':_0x43c1a8['params']['id']}})[_0xfb63('0x24')](handleEntityNotFound(_0x10aa68,null))[_0xfb63('0x24')](function(_0x258ce1){if(_0x258ce1){_0x17aad5=_0x258ce1;_0x577412[_0xfb63('0x33')]=_['keys'](db[_0xfb63('0x4a')][_0xfb63('0x2d')]);_0x577412[_0xfb63('0x30')]=_[_0xfb63('0x44')](_0x43c1a8[_0xfb63('0x30')]);_0x577412[_0xfb63('0x31')]=_[_0xfb63('0x32')](_0x577412[_0xfb63('0x33')],_0x577412['query']);_0x69a7eb[_0xfb63('0x35')]=_[_0xfb63('0x32')](_0x577412[_0xfb63('0x33')],qs[_0xfb63('0x34')](_0x43c1a8['query'][_0xfb63('0x34')]));_0x69a7eb[_0xfb63('0x35')]=_0x69a7eb[_0xfb63('0x35')][_0xfb63('0x36')]?_0x69a7eb[_0xfb63('0x35')]:_0x577412['model'];_0x69a7eb['order']=qs[_0xfb63('0x38')](_0x43c1a8[_0xfb63('0x30')][_0xfb63('0x38')]);_0x69a7eb[_0xfb63('0x39')]=qs[_0xfb63('0x31')](_['pick'](_0x43c1a8[_0xfb63('0x30')],_0x577412['filters']));if(_0x43c1a8[_0xfb63('0x30')][_0xfb63('0x3a')]){_0x69a7eb[_0xfb63('0x39')]=_[_0xfb63('0x3b')](_0x69a7eb[_0xfb63('0x39')],{'$or':_[_0xfb63('0x2b')](_0x69a7eb[_0xfb63('0x35')],function(_0x4c5267){var _0x131da9={};_0x131da9[_0x4c5267]={'$like':'%'+_0x43c1a8[_0xfb63('0x30')][_0xfb63('0x3a')]+'%'};return _0x131da9;})});}_0x69a7eb=_['merge']({},_0x69a7eb,_0x43c1a8[_0xfb63('0x3d')]);return _0x17aad5[_0xfb63('0x49')](_0x69a7eb);}})[_0xfb63('0x24')](function(_0x308f57){if(_0x308f57){_0x464a67=_0x308f57['length'];if(!_0x43c1a8['query']['hasOwnProperty']('nolimit')){_0x69a7eb[_0xfb63('0x1c')]=qs['limit'](_0x43c1a8[_0xfb63('0x30')][_0xfb63('0x1c')]);_0x69a7eb[_0xfb63('0x1a')]=qs['offset'](_0x43c1a8[_0xfb63('0x30')][_0xfb63('0x1a')]);}return _0x17aad5[_0xfb63('0x49')](_0x69a7eb);}})[_0xfb63('0x24')](function(_0x293c89){if(_0x293c89){return _0x293c89?{'count':_0x464a67,'rows':_0x293c89}:null;}})['then'](respondWithResult(_0x10aa68,null))[_0xfb63('0x46')](handleError(_0x10aa68,null));};exports[_0xfb63('0x4b')]=function(_0x4accab,_0x593e1e,_0x2efe73){if(_0x4accab[_0xfb63('0x48')]['id']){delete _0x4accab[_0xfb63('0x48')]['id'];}return db['FreshdeskAccount'][_0xfb63('0x4c')]({'where':{'id':_0x4accab[_0xfb63('0x43')]['id']}})[_0xfb63('0x24')](handleEntityNotFound(_0x593e1e,null))[_0xfb63('0x24')](function(_0x10426a){if(_0x10426a){_0x4accab['body']['AccountId']=_0x10426a['id'];_0x4accab[_0xfb63('0x48')][_0xfb63('0x4d')]=integrations[_0xfb63('0x4e')](_0x4accab[_0xfb63('0x48')][_0xfb63('0x4f')],_0x4accab[_0xfb63('0x48')]['type']);_0x4accab[_0xfb63('0x48')][_0xfb63('0x50')]=integrations[_0xfb63('0x51')](_0x4accab[_0xfb63('0x48')][_0xfb63('0x4f')],_0x4accab[_0xfb63('0x48')][_0xfb63('0x3c')]);return db[_0xfb63('0x4a')]['create'](_0x4accab['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xfb63('0x4d')},{'model':db[_0xfb63('0x52')],'as':_0xfb63('0x50')}]});}return null;})[_0xfb63('0x24')](respondWithResult(_0x593e1e,null))[_0xfb63('0x46')](handleError(_0x593e1e,null));};exports[_0xfb63('0x53')]=function(_0x4a86ca,_0x50e2e9,_0x1b84b6){var _0x43ea48='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x4a86ca[_0xfb63('0x43')]['id']},'attributes':['id','remoteUri',_0xfb63('0x54')]})[_0xfb63('0x24')](handleEntityNotFound(_0x50e2e9,null))[_0xfb63('0x24')](function(_0x4b17fa){if(_0x4b17fa){_0x43ea48=_0x4b17fa[_0xfb63('0x55')];var _0x351788=_0x43ea48[_0xfb63('0x56')](-0x1);if(_0x351788==='/'){_0x43ea48=_0x43ea48[_0xfb63('0x57')](0x0,_0x43ea48[_0xfb63('0x58')](_0x351788));}return rp({'method':_0xfb63('0x59'),'uri':util['format'](_0xfb63('0x5a'),_0x43ea48,_0xfb63('0x5b')),'headers':{'Authorization':util[_0xfb63('0x5c')]('Basic\x20%s',new Buffer(util['format'](_0xfb63('0x5d'),_0x4b17fa[_0xfb63('0x54')]))[_0xfb63('0x5e')](_0xfb63('0x5f')))},'json':!![]});}})[_0xfb63('0x24')](function(_0x9834e7){if(_0x9834e7){var _0x561dcb=['requester','subject',_0xfb63('0x60'),_0xfb63('0x61'),_0xfb63('0x19'),_0xfb63('0x62'),_0xfb63('0x63'),'source',_0xfb63('0x64'),_0xfb63('0x63'),_0xfb63('0x65')];_['remove'](_0x9834e7,function(_0x18aac4){return _0x561dcb[_0xfb63('0x66')](_0x18aac4[_0xfb63('0x29')])||!_0x18aac4[_0xfb63('0x67')]&&_0x18aac4[_0xfb63('0x3c')]!=='custom_text'&&_0x18aac4[_0xfb63('0x3c')]!==_0xfb63('0x68');});return{'count':_0x9834e7[_0xfb63('0x36')],'rows':_[_0xfb63('0x2b')](_0x9834e7,function(_0x428f03){return{'id':_0x428f03['name'],'name':_0x428f03[_0xfb63('0x69')],'custom':!_0x428f03[_0xfb63('0x67')],'options':_0x428f03['choices']?_[_0xfb63('0x2b')](_0x428f03[_0xfb63('0x6a')],function(_0x2d794e){return{'name':_[_0xfb63('0x6b')](_0x2d794e),'value':_0x2d794e};}):[]};})};}})[_0xfb63('0x24')](respondWithResult(_0x50e2e9,null))[_0xfb63('0x46')](function(_0x972b89){var _0x15afd7=_0x4a86ca['query'][_0xfb63('0x6c')]?0x1f4:_0x972b89[_0xfb63('0x6d')]||0x1f4;logger[_0xfb63('0x27')](_0xfb63('0x6e'),_0xfb63('0x53'),_0x15afd7,JSON['stringify'](_0x972b89));delete _0x972b89[_0xfb63('0x29')];if(_0x15afd7===0x191){_0x15afd7=0x190;}_0x50e2e9[_0xfb63('0x19')](_0x15afd7)[_0xfb63('0x2a')](_0x4a86ca[_0xfb63('0x30')]['test']?{'message':_0xfb63('0x6f'),'statusCode':_0x972b89[_0xfb63('0x6d')]}:_0x972b89);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 990b310..57a7e16 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 _0x0eee=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','exports','define'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x0eee,0xa7));var _0xe0ee=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x0eee[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0xe0ee('0x0'));var util=require(_0xe0ee('0x1'));var logger=require(_0xe0ee('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe0ee('0x3'));var rp=require(_0xe0ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe0ee('0x5'));var attributes=require(_0xe0ee('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xe0ee('0x7')]=function(_0x4a0c91,_0x531e8b){return _0x4a0c91[_0xe0ee('0x8')](_0xe0ee('0x9'),attributes,{'tableName':_0xe0ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x302a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x302a,0x7c));var _0xa302=function(_0x217b7b,_0x476c21){_0x217b7b=_0x217b7b-0x0;var _0x12d1c7=_0x302a[_0x217b7b];return _0x12d1c7;};'use strict';var _=require(_0xa302('0x0'));var util=require(_0xa302('0x1'));var logger=require(_0xa302('0x2'))(_0xa302('0x3'));var moment=require(_0xa302('0x4'));var BPromise=require(_0xa302('0x5'));var rp=require(_0xa302('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa302('0x7'));var config=require(_0xa302('0x8'));var attributes=require(_0xa302('0x9'));var integrations=require(_0xa302('0xa'));module[_0xa302('0xb')]=function(_0x31770c,_0x206cc3){return _0x31770c[_0xa302('0xc')]('FreshdeskAccount',attributes,{'tableName':_0xa302('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index b268415..81687d8 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 _0x5a05=['map','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount','findAll','options','raw','limit','include','model','attributes'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x5a05,0x93));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x55a0('0x0'));var util=require(_0x55a0('0x1'));var moment=require(_0x55a0('0x2'));var BPromise=require(_0x55a0('0x3'));var rs=require(_0x55a0('0x4'));var fs=require('fs');var Redis=require(_0x55a0('0x5'));var db=require(_0x55a0('0x6'))['db'];var utils=require(_0x55a0('0x7'));var logger=require(_0x55a0('0x8'))(_0x55a0('0x9'));var config=require(_0x55a0('0xa'));var jayson=require(_0x55a0('0xb'));var client=jayson[_0x55a0('0xc')][_0x55a0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x551c26,_0x51e054,_0x4ec00d){return new BPromise(function(_0x25e52f,_0x20d2c7){return client[_0x55a0('0xe')](_0x551c26,_0x4ec00d)[_0x55a0('0xf')](function(_0x4a9e95){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x51e054,_0x55a0('0x12'));logger[_0x55a0('0x13')](_0x55a0('0x14'),_0x51e054,_0x55a0('0x12'),JSON[_0x55a0('0x15')](_0x4a9e95));if(_0x4a9e95[_0x55a0('0x16')]){if(_0x4a9e95[_0x55a0('0x16')][_0x55a0('0x17')]===0x1f4){logger[_0x55a0('0x16')]('FreshdeskAccount,\x20%s,\x20%s',_0x51e054,_0x4a9e95[_0x55a0('0x16')][_0x55a0('0x18')]);return _0x20d2c7(_0x4a9e95['error']['message']);}logger[_0x55a0('0x16')](_0x55a0('0x11'),_0x51e054,_0x4a9e95[_0x55a0('0x16')]['message']);return _0x25e52f(_0x4a9e95['error'][_0x55a0('0x18')]);}else{logger['info'](_0x55a0('0x11'),_0x51e054,_0x55a0('0x12'));_0x25e52f(_0x4a9e95['result'][_0x55a0('0x18')]);}})['catch'](function(_0x5840af){logger[_0x55a0('0x16')](_0x55a0('0x11'),_0x51e054,_0x5840af);_0x20d2c7(_0x5840af);});});}exports['GetFreshdeskAccount']=function(_0x3f70a6){var _0x522386=this;return new Promise(function(_0x1c47d0,_0x199f80){return db[_0x55a0('0x19')][_0x55a0('0x1a')]({'raw':_0x3f70a6[_0x55a0('0x1b')]?_0x3f70a6[_0x55a0('0x1b')][_0x55a0('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f70a6[_0x55a0('0x1b')]?_0x3f70a6[_0x55a0('0x1b')]['where']||null:null,'attributes':_0x3f70a6[_0x55a0('0x1b')]?_0x3f70a6[_0x55a0('0x1b')]['attributes']||null:null,'limit':_0x3f70a6['options']?_0x3f70a6[_0x55a0('0x1b')][_0x55a0('0x1d')]||null:null,'include':_0x3f70a6['options']?_0x3f70a6[_0x55a0('0x1b')][_0x55a0('0x1e')]?_['map'](_0x3f70a6[_0x55a0('0x1b')][_0x55a0('0x1e')],function(_0x25c9a3){return{'model':db[_0x25c9a3[_0x55a0('0x1f')]],'as':_0x25c9a3['as'],'attributes':_0x25c9a3[_0x55a0('0x20')],'include':_0x25c9a3[_0x55a0('0x1e')]?_[_0x55a0('0x21')](_0x25c9a3['include'],function(_0x17442d){return{'model':db[_0x17442d['model']],'as':_0x17442d['as'],'attributes':_0x17442d[_0x55a0('0x20')],'include':_0x17442d[_0x55a0('0x1e')]?_[_0x55a0('0x21')](_0x17442d[_0x55a0('0x1e')],function(_0x281a0b){return{'model':db[_0x281a0b[_0x55a0('0x1f')]],'as':_0x281a0b['as'],'attributes':_0x281a0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x55a0('0xf')](function(_0x529f88){logger['info']('GetFreshdeskAccount',_0x3f70a6);logger['debug'](_0x55a0('0x22'),_0x3f70a6,JSON[_0x55a0('0x15')](_0x529f88));_0x1c47d0(_0x529f88);})['catch'](function(_0x456cf9){logger['error']('GetFreshdeskAccount',_0x456cf9[_0x55a0('0x18')],_0x3f70a6);_0x199f80(_0x522386[_0x55a0('0x16')](0x1f4,_0x456cf9[_0x55a0('0x18')]));});});};exports[_0x55a0('0x23')]=function(_0x3397d7){var _0x2dc989=this;return new Promise(function(_0x51a34a,_0x24ee1b){return db[_0x55a0('0x19')]['find']({'raw':_0x3397d7[_0x55a0('0x1b')]?_0x3397d7[_0x55a0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3397d7[_0x55a0('0x1b')]?_0x3397d7['options']['where']||null:null,'attributes':_0x3397d7[_0x55a0('0x1b')]?_0x3397d7[_0x55a0('0x1b')][_0x55a0('0x20')]||null:null,'include':_0x3397d7['options']?_0x3397d7[_0x55a0('0x1b')][_0x55a0('0x1e')]?_['map'](_0x3397d7[_0x55a0('0x1b')][_0x55a0('0x1e')],function(_0x30a81d){return{'model':db[_0x30a81d[_0x55a0('0x1f')]],'as':_0x30a81d['as'],'attributes':_0x30a81d['attributes'],'include':_0x30a81d['include']?_[_0x55a0('0x21')](_0x30a81d[_0x55a0('0x1e')],function(_0x19bdba){return{'model':db[_0x19bdba[_0x55a0('0x1f')]],'as':_0x19bdba['as'],'attributes':_0x19bdba[_0x55a0('0x20')],'include':_0x19bdba['include']?_[_0x55a0('0x21')](_0x19bdba[_0x55a0('0x1e')],function(_0x3ab092){return{'model':db[_0x3ab092['model']],'as':_0x3ab092['as'],'attributes':_0x3ab092[_0x55a0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x55a0('0xf')](function(_0x49b9d9){logger[_0x55a0('0x10')](_0x55a0('0x23'),_0x3397d7);logger[_0x55a0('0x13')](_0x55a0('0x23'),_0x3397d7,JSON['stringify'](_0x49b9d9));_0x51a34a(_0x49b9d9);})['catch'](function(_0x5d89e9){logger[_0x55a0('0x16')](_0x55a0('0x23'),_0x5d89e9[_0x55a0('0x18')],_0x3397d7);_0x24ee1b(_0x2dc989[_0x55a0('0x16')](0x1f4,_0x5d89e9[_0x55a0('0x18')]));});});}; \ No newline at end of file +var _0xb4b7=['raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','FreshdeskAccount','find'];(function(_0x49d7d1,_0xacf5a6){var _0x33038d=function(_0x223fc5){while(--_0x223fc5){_0x49d7d1['push'](_0x49d7d1['shift']());}};_0x33038d(++_0xacf5a6);}(_0xb4b7,0x6a));var _0x7b4b=function(_0x2e708a,_0x1b469d){_0x2e708a=_0x2e708a-0x0;var _0x5e4def=_0xb4b7[_0x2e708a];return _0x5e4def;};'use strict';var _=require(_0x7b4b('0x0'));var util=require('util');var moment=require(_0x7b4b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b4b('0x2'));var fs=require('fs');var Redis=require(_0x7b4b('0x3'));var db=require(_0x7b4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b4b('0x5'))('rpc');var config=require(_0x7b4b('0x6'));var jayson=require(_0x7b4b('0x7'));var client=jayson[_0x7b4b('0x8')][_0x7b4b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9d6d9f,_0x1d3508,_0x116a10){return new BPromise(function(_0x468a1e,_0x2b8615){return client[_0x7b4b('0xa')](_0x9d6d9f,_0x116a10)[_0x7b4b('0xb')](function(_0x39997f){logger[_0x7b4b('0xc')](_0x7b4b('0xd'),_0x1d3508,_0x7b4b('0xe'));logger[_0x7b4b('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1d3508,_0x7b4b('0xe'),JSON[_0x7b4b('0x10')](_0x39997f));if(_0x39997f[_0x7b4b('0x11')]){if(_0x39997f[_0x7b4b('0x11')][_0x7b4b('0x12')]===0x1f4){logger[_0x7b4b('0x11')](_0x7b4b('0xd'),_0x1d3508,_0x39997f[_0x7b4b('0x11')][_0x7b4b('0x13')]);return _0x2b8615(_0x39997f[_0x7b4b('0x11')][_0x7b4b('0x13')]);}logger['error'](_0x7b4b('0xd'),_0x1d3508,_0x39997f[_0x7b4b('0x11')][_0x7b4b('0x13')]);return _0x468a1e(_0x39997f['error']['message']);}else{logger[_0x7b4b('0xc')](_0x7b4b('0xd'),_0x1d3508,'request\x20sent');_0x468a1e(_0x39997f[_0x7b4b('0x14')][_0x7b4b('0x13')]);}})['catch'](function(_0x4117cb){logger['error'](_0x7b4b('0xd'),_0x1d3508,_0x4117cb);_0x2b8615(_0x4117cb);});});}exports[_0x7b4b('0x15')]=function(_0x308a40){var _0x57b681=this;return new Promise(function(_0x3cf27a,_0x4dfc34){return db['FreshdeskAccount'][_0x7b4b('0x16')]({'raw':_0x308a40['options']?_0x308a40[_0x7b4b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x308a40[_0x7b4b('0x17')]?_0x308a40[_0x7b4b('0x17')][_0x7b4b('0x18')]||null:null,'attributes':_0x308a40[_0x7b4b('0x17')]?_0x308a40['options'][_0x7b4b('0x19')]||null:null,'limit':_0x308a40['options']?_0x308a40[_0x7b4b('0x17')][_0x7b4b('0x1a')]||null:null,'include':_0x308a40['options']?_0x308a40['options'][_0x7b4b('0x1b')]?_[_0x7b4b('0x1c')](_0x308a40[_0x7b4b('0x17')][_0x7b4b('0x1b')],function(_0x3d0c82){return{'model':db[_0x3d0c82['model']],'as':_0x3d0c82['as'],'attributes':_0x3d0c82[_0x7b4b('0x19')],'include':_0x3d0c82[_0x7b4b('0x1b')]?_[_0x7b4b('0x1c')](_0x3d0c82['include'],function(_0x31174b){return{'model':db[_0x31174b[_0x7b4b('0x1d')]],'as':_0x31174b['as'],'attributes':_0x31174b[_0x7b4b('0x19')],'include':_0x31174b[_0x7b4b('0x1b')]?_[_0x7b4b('0x1c')](_0x31174b[_0x7b4b('0x1b')],function(_0x23396c){return{'model':db[_0x23396c[_0x7b4b('0x1d')]],'as':_0x23396c['as'],'attributes':_0x23396c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b4b('0xb')](function(_0x1ea49d){logger[_0x7b4b('0xc')](_0x7b4b('0x15'),_0x308a40);logger[_0x7b4b('0xf')](_0x7b4b('0x15'),_0x308a40,JSON[_0x7b4b('0x10')](_0x1ea49d));_0x3cf27a(_0x1ea49d);})[_0x7b4b('0x1e')](function(_0xfc2138){logger[_0x7b4b('0x11')](_0x7b4b('0x15'),_0xfc2138[_0x7b4b('0x13')],_0x308a40);_0x4dfc34(_0x57b681[_0x7b4b('0x11')](0x1f4,_0xfc2138['message']));});});};exports[_0x7b4b('0x1f')]=function(_0x4c540b){var _0x1f048c=this;return new Promise(function(_0x49a36d,_0x5ce4b1){return db[_0x7b4b('0x20')][_0x7b4b('0x21')]({'raw':_0x4c540b[_0x7b4b('0x17')]?_0x4c540b['options'][_0x7b4b('0x22')]===undefined?!![]:![]:!![],'where':_0x4c540b['options']?_0x4c540b[_0x7b4b('0x17')][_0x7b4b('0x18')]||null:null,'attributes':_0x4c540b[_0x7b4b('0x17')]?_0x4c540b[_0x7b4b('0x17')][_0x7b4b('0x19')]||null:null,'include':_0x4c540b['options']?_0x4c540b['options']['include']?_[_0x7b4b('0x1c')](_0x4c540b[_0x7b4b('0x17')]['include'],function(_0x31d685){return{'model':db[_0x31d685[_0x7b4b('0x1d')]],'as':_0x31d685['as'],'attributes':_0x31d685['attributes'],'include':_0x31d685['include']?_[_0x7b4b('0x1c')](_0x31d685['include'],function(_0x521f1a){return{'model':db[_0x521f1a[_0x7b4b('0x1d')]],'as':_0x521f1a['as'],'attributes':_0x521f1a[_0x7b4b('0x19')],'include':_0x521f1a[_0x7b4b('0x1b')]?_[_0x7b4b('0x1c')](_0x521f1a['include'],function(_0x52b546){return{'model':db[_0x52b546['model']],'as':_0x52b546['as'],'attributes':_0x52b546['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b4b('0xb')](function(_0x9f23da){logger[_0x7b4b('0xc')](_0x7b4b('0x1f'),_0x4c540b);logger[_0x7b4b('0xf')](_0x7b4b('0x1f'),_0x4c540b,JSON['stringify'](_0x9f23da));_0x49a36d(_0x9f23da);})[_0x7b4b('0x1e')](function(_0x3cf336){logger[_0x7b4b('0x11')](_0x7b4b('0x1f'),_0x3cf336[_0x7b4b('0x13')],_0x4c540b);_0x5ce4b1(_0x1f048c[_0x7b4b('0x11')](0x1f4,_0x3cf336['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 878f389..33c3485 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 _0xa913=['/:id','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get'];(function(_0xc2dccb,_0x5957f2){var _0x3239b3=function(_0x58f337){while(--_0x58f337){_0xc2dccb['push'](_0xc2dccb['shift']());}};_0x3239b3(++_0x5957f2);}(_0xa913,0x84));var _0x3a91=function(_0x3875fc,_0x1dd545){_0x3875fc=_0x3875fc-0x0;var _0x55f8b2=_0xa913[_0x3875fc];return _0x55f8b2;};'use strict';var multer=require(_0x3a91('0x0'));var util=require('util');var path=require(_0x3a91('0x1'));var timeout=require(_0x3a91('0x2'));var express=require(_0x3a91('0x3'));var router=express[_0x3a91('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a91('0x5'));var interaction=require(_0x3a91('0x6'));var config=require(_0x3a91('0x7'));var controller=require(_0x3a91('0x8'));router['get']('/',auth[_0x3a91('0x9')](),controller[_0x3a91('0xa')]);router[_0x3a91('0xb')](_0x3a91('0xc'),auth[_0x3a91('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0x3a91('0x9')](),controller[_0x3a91('0xd')]);router[_0x3a91('0xb')]('/:id/subjects',auth[_0x3a91('0x9')](),controller[_0x3a91('0xe')]);router[_0x3a91('0xb')](_0x3a91('0xf'),auth['isAuthenticated'](),controller[_0x3a91('0x10')]);router['get'](_0x3a91('0x11'),auth[_0x3a91('0x9')](),controller[_0x3a91('0x12')]);router[_0x3a91('0x13')]('/',auth['isAuthenticated'](),controller[_0x3a91('0x14')]);router[_0x3a91('0x13')](_0x3a91('0x11'),auth[_0x3a91('0x9')](),controller['setTags']);router['put'](_0x3a91('0xc'),auth[_0x3a91('0x9')](),controller['update']);router[_0x3a91('0x15')](_0x3a91('0xc'),auth['isAuthenticated'](),controller[_0x3a91('0x16')]);module[_0x3a91('0x17')]=router; \ No newline at end of file +var _0xb596=['/:id/tags','getTags','post','create','setTags','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','/:id/fields','getFields','/:id/subjects','getDescriptions'];(function(_0x15cc64,_0x5c4420){var _0x5596d5=function(_0x21077c){while(--_0x21077c){_0x15cc64['push'](_0x15cc64['shift']());}};_0x5596d5(++_0x5c4420);}(_0xb596,0x18a));var _0x6b59=function(_0x360473,_0x4b55be){_0x360473=_0x360473-0x0;var _0x543009=_0xb596[_0x360473];return _0x543009;};'use strict';var multer=require(_0x6b59('0x0'));var util=require(_0x6b59('0x1'));var path=require('path');var timeout=require(_0x6b59('0x2'));var express=require(_0x6b59('0x3'));var router=express[_0x6b59('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b59('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b59('0x6'));router[_0x6b59('0x7')]('/',auth['isAuthenticated'](),controller[_0x6b59('0x8')]);router[_0x6b59('0x7')]('/:id',auth[_0x6b59('0x9')](),controller['show']);router[_0x6b59('0x7')](_0x6b59('0xa'),auth[_0x6b59('0x9')](),controller[_0x6b59('0xb')]);router[_0x6b59('0x7')](_0x6b59('0xc'),auth[_0x6b59('0x9')](),controller['getSubjects']);router[_0x6b59('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6b59('0xd')]);router[_0x6b59('0x7')](_0x6b59('0xe'),auth[_0x6b59('0x9')](),controller[_0x6b59('0xf')]);router[_0x6b59('0x10')]('/',auth[_0x6b59('0x9')](),controller[_0x6b59('0x11')]);router[_0x6b59('0x10')](_0x6b59('0xe'),auth[_0x6b59('0x9')](),controller[_0x6b59('0x12')]);router['put'](_0x6b59('0x13'),auth[_0x6b59('0x9')](),controller[_0x6b59('0x14')]);router[_0x6b59('0x15')](_0x6b59('0x13'),auth[_0x6b59('0x9')](),controller[_0x6b59('0x16')]);module[_0x6b59('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 97a8ecc..fc899af 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 _0xe04e=['STRING','sequelize','exports'];(function(_0x50b5de,_0x1234ff){var _0x1770ca=function(_0x9d8bad){while(--_0x9d8bad){_0x50b5de['push'](_0x50b5de['shift']());}};_0x1770ca(++_0x1234ff);}(_0xe04e,0x160));var _0xee04=function(_0x134693,_0x529985){_0x134693=_0x134693-0x0;var _0xc1665b=_0xe04e[_0x134693];return _0xc1665b;};'use strict';var Sequelize=require(_0xee04('0x0'));module[_0xee04('0x1')]={'name':{'type':Sequelize[_0xee04('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6f1=['sequelize','STRING'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xf6f1,0x12c));var _0x1f6f=function(_0x209bb9,_0x77dc20){_0x209bb9=_0x209bb9-0x0;var _0x22df2f=_0xf6f1[_0x209bb9];return _0x22df2f;};'use strict';var Sequelize=require(_0x1f6f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1f6f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index cad35ac..800c21c 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 _0xc6c3=['merge','VIRTUAL','filter','options','include','rows','catch','params','includeAll','find','create','body','findOne','FreshdeskField','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x18ec05,_0x4cb61d){var _0x136bfb=function(_0x112ff5){while(--_0x112ff5){_0x18ec05['push'](_0x18ec05['shift']());}};_0x136bfb(++_0x4cb61d);}(_0xc6c3,0x65));var _0x3c6c=function(_0x17e05c,_0x2ae564){_0x17e05c=_0x17e05c-0x0;var _0x5ad01b=_0xc6c3[_0x17e05c];return _0x5ad01b;};'use strict';var emlformat=require(_0x3c6c('0x0'));var rimraf=require(_0x3c6c('0x1'));var zipdir=require(_0x3c6c('0x2'));var jsonpatch=require(_0x3c6c('0x3'));var rp=require('request-promise');var moment=require(_0x3c6c('0x4'));var BPromise=require(_0x3c6c('0x5'));var Mustache=require(_0x3c6c('0x6'));var util=require(_0x3c6c('0x7'));var path=require('path');var sox=require(_0x3c6c('0x8'));var csv=require(_0x3c6c('0x9'));var ejs=require(_0x3c6c('0xa'));var fs=require('fs');var fs_extra=require(_0x3c6c('0xb'));var _=require(_0x3c6c('0xc'));var squel=require('squel');var crypto=require(_0x3c6c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3c6c('0xe'));var toCsv=require(_0x3c6c('0x9'));var querystring=require('querystring');var Papa=require(_0x3c6c('0xf'));var Redis=require(_0x3c6c('0x10'));var authService=require(_0x3c6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c6c('0x12'));var logger=require(_0x3c6c('0x13'))(_0x3c6c('0x14'));var utils=require(_0x3c6c('0x15'));var config=require(_0x3c6c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe4699,_0x450779){_0x450779=_0x450779||0xcc;return function(_0x33af14){if(_0x33af14){return _0xe4699[_0x3c6c('0x17')](_0x450779);}return _0xe4699['status'](_0x450779)[_0x3c6c('0x18')]();};}function respondWithResult(_0x2108cc,_0x32136a){_0x32136a=_0x32136a||0xc8;return function(_0x595608){if(_0x595608){return _0x2108cc['status'](_0x32136a)[_0x3c6c('0x19')](_0x595608);}};}function respondWithFilteredResult(_0x545d2c,_0x955814){return function(_0x446c1a){if(_0x446c1a){var _0x33d318=typeof _0x955814[_0x3c6c('0x1a')]===_0x3c6c('0x1b')&&typeof _0x955814[_0x3c6c('0x1c')]==='undefined';var _0x10729b=_0x446c1a[_0x3c6c('0x1d')];var _0x4b6bab=_0x33d318?0x0:_0x955814[_0x3c6c('0x1a')];var _0x887129=_0x33d318?_0x446c1a['count']:_0x955814[_0x3c6c('0x1a')]+_0x955814[_0x3c6c('0x1c')];var _0x2eac8c;if(_0x887129>=_0x10729b){_0x887129=_0x10729b;_0x2eac8c=0xc8;}else{_0x2eac8c=0xce;}_0x545d2c[_0x3c6c('0x1e')](_0x2eac8c);return _0x545d2c['set'](_0x3c6c('0x1f'),_0x4b6bab+'-'+_0x887129+'/'+_0x10729b)['json'](_0x446c1a);}return null;};}function patchUpdates(_0x50f927){return function(_0x5ccc14){try{jsonpatch[_0x3c6c('0x20')](_0x5ccc14,_0x50f927,!![]);}catch(_0x3bc213){return BPromise[_0x3c6c('0x21')](_0x3bc213);}return _0x5ccc14[_0x3c6c('0x22')]();};}function saveUpdates(_0x54db07,_0x2a77cd){return function(_0x1d93ac){if(_0x1d93ac){return _0x1d93ac[_0x3c6c('0x23')](_0x54db07)[_0x3c6c('0x24')](function(_0xa4a377){return _0xa4a377;});}return null;};}function removeEntity(_0x5eda3c,_0x47bfe6){return function(_0x44724a){if(_0x44724a){return _0x44724a[_0x3c6c('0x25')]()['then'](function(){_0x5eda3c['status'](0xcc)[_0x3c6c('0x18')]();});}};}function handleEntityNotFound(_0x483ccc,_0x4d36c5){return function(_0x3fe2e5){if(!_0x3fe2e5){_0x483ccc[_0x3c6c('0x17')](0x194);}return _0x3fe2e5;};}function handleError(_0x1bf088,_0x5ed360){_0x5ed360=_0x5ed360||0x1f4;return function(_0x1e8196){logger['error'](_0x1e8196['stack']);if(_0x1e8196[_0x3c6c('0x26')]){delete _0x1e8196[_0x3c6c('0x26')];}_0x1bf088[_0x3c6c('0x1e')](_0x5ed360)[_0x3c6c('0x27')](_0x1e8196);};}exports[_0x3c6c('0x28')]=function(_0x1eea2a,_0x143809){var _0x3dea0f={},_0xd6e270={},_0x215370={'count':0x0,'rows':[]};var _0x144354=_[_0x3c6c('0x29')](db[_0x3c6c('0x2a')][_0x3c6c('0x2b')],function(_0x31dc44){return{'name':_0x31dc44[_0x3c6c('0x2c')],'type':_0x31dc44['type'][_0x3c6c('0x2d')]};});_0xd6e270[_0x3c6c('0x2e')]=_[_0x3c6c('0x29')](_0x144354,_0x3c6c('0x26'));_0xd6e270[_0x3c6c('0x2f')]=_[_0x3c6c('0x30')](_0x1eea2a[_0x3c6c('0x2f')]);_0xd6e270['filters']=_[_0x3c6c('0x31')](_0xd6e270[_0x3c6c('0x2e')],_0xd6e270[_0x3c6c('0x2f')]);_0x3dea0f['attributes']=_[_0x3c6c('0x31')](_0xd6e270[_0x3c6c('0x2e')],qs[_0x3c6c('0x32')](_0x1eea2a[_0x3c6c('0x2f')][_0x3c6c('0x32')]));_0x3dea0f[_0x3c6c('0x33')]=_0x3dea0f[_0x3c6c('0x33')][_0x3c6c('0x34')]?_0x3dea0f[_0x3c6c('0x33')]:_0xd6e270[_0x3c6c('0x2e')];if(!_0x1eea2a[_0x3c6c('0x2f')][_0x3c6c('0x35')](_0x3c6c('0x36'))){_0x3dea0f['limit']=qs[_0x3c6c('0x1c')](_0x1eea2a['query'][_0x3c6c('0x1c')]);_0x3dea0f[_0x3c6c('0x1a')]=qs['offset'](_0x1eea2a[_0x3c6c('0x2f')]['offset']);}_0x3dea0f[_0x3c6c('0x37')]=qs[_0x3c6c('0x38')](_0x1eea2a[_0x3c6c('0x2f')][_0x3c6c('0x38')]);_0x3dea0f[_0x3c6c('0x39')]=qs[_0x3c6c('0x3a')](_['pick'](_0x1eea2a[_0x3c6c('0x2f')],_0xd6e270[_0x3c6c('0x3a')]),_0x144354);if(_0x1eea2a[_0x3c6c('0x2f')]['filter']){_0x3dea0f['where']=_[_0x3c6c('0x3b')](_0x3dea0f['where'],{'$or':_[_0x3c6c('0x29')](_0x144354,function(_0x301d6d){if(_0x301d6d['type']!==_0x3c6c('0x3c')){var _0x3511be={};_0x3511be[_0x301d6d[_0x3c6c('0x26')]]={'$like':'%'+_0x1eea2a['query'][_0x3c6c('0x3d')]+'%'};return _0x3511be;}})});}_0x3dea0f=_[_0x3c6c('0x3b')]({},_0x3dea0f,_0x1eea2a[_0x3c6c('0x3e')]);var _0x234a5b={'where':_0x3dea0f[_0x3c6c('0x39')]};return db['FreshdeskConfiguration']['count'](_0x234a5b)[_0x3c6c('0x24')](function(_0x14c683){_0x215370['count']=_0x14c683;if(_0x1eea2a['query']['includeAll']){_0x3dea0f[_0x3c6c('0x3f')]=[{'all':!![]}];}return db[_0x3c6c('0x2a')]['findAll'](_0x3dea0f);})[_0x3c6c('0x24')](function(_0x5a77d6){_0x215370[_0x3c6c('0x40')]=_0x5a77d6;return _0x215370;})[_0x3c6c('0x24')](respondWithFilteredResult(_0x143809,_0x3dea0f))[_0x3c6c('0x41')](handleError(_0x143809,null));};exports['show']=function(_0x1c6969,_0x1f089d){var _0x489c0e={'raw':![],'where':{'id':_0x1c6969[_0x3c6c('0x42')]['id']}},_0xabb763={};_0xabb763[_0x3c6c('0x2e')]=_[_0x3c6c('0x30')](db[_0x3c6c('0x2a')][_0x3c6c('0x2b')]);_0xabb763['query']=_[_0x3c6c('0x30')](_0x1c6969[_0x3c6c('0x2f')]);_0xabb763[_0x3c6c('0x3a')]=_[_0x3c6c('0x31')](_0xabb763[_0x3c6c('0x2e')],_0xabb763[_0x3c6c('0x2f')]);_0x489c0e[_0x3c6c('0x33')]=_[_0x3c6c('0x31')](_0xabb763['model'],qs[_0x3c6c('0x32')](_0x1c6969[_0x3c6c('0x2f')][_0x3c6c('0x32')]));_0x489c0e[_0x3c6c('0x33')]=_0x489c0e[_0x3c6c('0x33')]['length']?_0x489c0e[_0x3c6c('0x33')]:_0xabb763['model'];if(_0x1c6969[_0x3c6c('0x2f')][_0x3c6c('0x43')]){_0x489c0e[_0x3c6c('0x3f')]=[{'all':!![]}];}_0x489c0e=_[_0x3c6c('0x3b')]({},_0x489c0e,_0x1c6969['options']);return db[_0x3c6c('0x2a')][_0x3c6c('0x44')](_0x489c0e)[_0x3c6c('0x24')](handleEntityNotFound(_0x1f089d,null))['then'](respondWithResult(_0x1f089d,null))[_0x3c6c('0x41')](handleError(_0x1f089d,null));};exports[_0x3c6c('0x45')]=function(_0x4b68a8,_0x1fca4a){return db['FreshdeskConfiguration']['create'](_0x4b68a8['body'],{})[_0x3c6c('0x24')](respondWithResult(_0x1fca4a,0xc9))[_0x3c6c('0x41')](handleError(_0x1fca4a,null));};exports['update']=function(_0x1dc009,_0xef4d42){if(_0x1dc009['body']['id']){delete _0x1dc009[_0x3c6c('0x46')]['id'];}return db[_0x3c6c('0x2a')][_0x3c6c('0x44')]({'where':{'id':_0x1dc009['params']['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0xef4d42,null))['then'](saveUpdates(_0x1dc009['body'],null))[_0x3c6c('0x24')](respondWithResult(_0xef4d42,null))[_0x3c6c('0x41')](handleError(_0xef4d42,null));};exports[_0x3c6c('0x25')]=function(_0x244d17,_0x159921){return db[_0x3c6c('0x2a')][_0x3c6c('0x44')]({'where':{'id':_0x244d17[_0x3c6c('0x42')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x159921,null))[_0x3c6c('0x24')](removeEntity(_0x159921,null))['catch'](handleError(_0x159921,null));};exports['getFields']=function(_0x2ce2f3,_0x3bb085,_0x4d3d69){var _0x3ba08d={};var _0x3cbc8c={};var _0x1f884f;var _0x435be4;return db[_0x3c6c('0x2a')][_0x3c6c('0x47')]({'where':{'id':_0x2ce2f3['params']['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x3bb085,null))[_0x3c6c('0x24')](function(_0x495ba8){if(_0x495ba8){_0x1f884f=_0x495ba8;_0x3cbc8c[_0x3c6c('0x2e')]=_[_0x3c6c('0x30')](db[_0x3c6c('0x48')][_0x3c6c('0x2b')]);_0x3cbc8c[_0x3c6c('0x2f')]=_[_0x3c6c('0x30')](_0x2ce2f3['query']);_0x3cbc8c['filters']=_[_0x3c6c('0x31')](_0x3cbc8c[_0x3c6c('0x2e')],_0x3cbc8c[_0x3c6c('0x2f')]);_0x3ba08d[_0x3c6c('0x33')]=_[_0x3c6c('0x31')](_0x3cbc8c[_0x3c6c('0x2e')],qs['fields'](_0x2ce2f3['query'][_0x3c6c('0x32')]));_0x3ba08d[_0x3c6c('0x33')]=_0x3ba08d['attributes']['length']?_0x3ba08d[_0x3c6c('0x33')]:_0x3cbc8c[_0x3c6c('0x2e')];_0x3ba08d[_0x3c6c('0x37')]=qs[_0x3c6c('0x38')](_0x2ce2f3['query'][_0x3c6c('0x38')]);_0x3ba08d['where']=qs[_0x3c6c('0x3a')](_[_0x3c6c('0x49')](_0x2ce2f3[_0x3c6c('0x2f')],_0x3cbc8c['filters']));if(_0x2ce2f3[_0x3c6c('0x2f')][_0x3c6c('0x3d')]){_0x3ba08d['where']=_[_0x3c6c('0x3b')](_0x3ba08d[_0x3c6c('0x39')],{'$or':_[_0x3c6c('0x29')](_0x3ba08d[_0x3c6c('0x33')],function(_0x469a92){var _0x500fe2={};_0x500fe2[_0x469a92]={'$like':'%'+_0x2ce2f3['query'][_0x3c6c('0x3d')]+'%'};return _0x500fe2;})});}_0x3ba08d=_[_0x3c6c('0x3b')]({},_0x3ba08d,_0x2ce2f3[_0x3c6c('0x3e')]);return _0x1f884f[_0x3c6c('0x4a')](_0x3ba08d);}})[_0x3c6c('0x24')](function(_0x3e999e){if(_0x3e999e){_0x435be4=_0x3e999e[_0x3c6c('0x34')];if(!_0x2ce2f3['query'][_0x3c6c('0x35')](_0x3c6c('0x36'))){_0x3ba08d['limit']=qs[_0x3c6c('0x1c')](_0x2ce2f3['query'][_0x3c6c('0x1c')]);_0x3ba08d['offset']=qs[_0x3c6c('0x1a')](_0x2ce2f3[_0x3c6c('0x2f')]['offset']);}return _0x1f884f[_0x3c6c('0x4a')](_0x3ba08d);}})[_0x3c6c('0x24')](function(_0x4e5c08){if(_0x4e5c08){return _0x4e5c08?{'count':_0x435be4,'rows':_0x4e5c08}:null;}})['then'](respondWithResult(_0x3bb085,null))[_0x3c6c('0x41')](handleError(_0x3bb085,null));};exports['getSubjects']=function(_0xb046cc,_0x3db1a3,_0x95a5c8){var _0x5f1c57={};var _0xe0ddf5={};var _0x2b6880;var _0x351cc2;return db[_0x3c6c('0x2a')][_0x3c6c('0x47')]({'where':{'id':_0xb046cc[_0x3c6c('0x42')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x3db1a3,null))[_0x3c6c('0x24')](function(_0x263291){if(_0x263291){_0x2b6880=_0x263291;_0xe0ddf5[_0x3c6c('0x2e')]=_[_0x3c6c('0x30')](db[_0x3c6c('0x48')]['rawAttributes']);_0xe0ddf5[_0x3c6c('0x2f')]=_[_0x3c6c('0x30')](_0xb046cc[_0x3c6c('0x2f')]);_0xe0ddf5[_0x3c6c('0x3a')]=_['intersection'](_0xe0ddf5[_0x3c6c('0x2e')],_0xe0ddf5[_0x3c6c('0x2f')]);_0x5f1c57['attributes']=_[_0x3c6c('0x31')](_0xe0ddf5[_0x3c6c('0x2e')],qs[_0x3c6c('0x32')](_0xb046cc[_0x3c6c('0x2f')]['fields']));_0x5f1c57['attributes']=_0x5f1c57['attributes'][_0x3c6c('0x34')]?_0x5f1c57['attributes']:_0xe0ddf5[_0x3c6c('0x2e')];_0x5f1c57[_0x3c6c('0x37')]=qs['sort'](_0xb046cc[_0x3c6c('0x2f')][_0x3c6c('0x38')]);_0x5f1c57['where']=qs[_0x3c6c('0x3a')](_[_0x3c6c('0x49')](_0xb046cc[_0x3c6c('0x2f')],_0xe0ddf5['filters']));if(_0xb046cc[_0x3c6c('0x2f')][_0x3c6c('0x3d')]){_0x5f1c57[_0x3c6c('0x39')]=_[_0x3c6c('0x3b')](_0x5f1c57[_0x3c6c('0x39')],{'$or':_[_0x3c6c('0x29')](_0x5f1c57[_0x3c6c('0x33')],function(_0x27c606){var _0x2f8dde={};_0x2f8dde[_0x27c606]={'$like':'%'+_0xb046cc[_0x3c6c('0x2f')][_0x3c6c('0x3d')]+'%'};return _0x2f8dde;})});}_0x5f1c57=_[_0x3c6c('0x3b')]({},_0x5f1c57,_0xb046cc[_0x3c6c('0x3e')]);return _0x2b6880[_0x3c6c('0x4b')](_0x5f1c57);}})[_0x3c6c('0x24')](function(_0x4c8168){if(_0x4c8168){_0x351cc2=_0x4c8168[_0x3c6c('0x34')];if(!_0xb046cc[_0x3c6c('0x2f')][_0x3c6c('0x35')]('nolimit')){_0x5f1c57[_0x3c6c('0x1c')]=qs[_0x3c6c('0x1c')](_0xb046cc['query'][_0x3c6c('0x1c')]);_0x5f1c57[_0x3c6c('0x1a')]=qs['offset'](_0xb046cc[_0x3c6c('0x2f')][_0x3c6c('0x1a')]);}return _0x2b6880['getSubjects'](_0x5f1c57);}})[_0x3c6c('0x24')](function(_0x52abec){if(_0x52abec){return _0x52abec?{'count':_0x351cc2,'rows':_0x52abec}:null;}})['then'](respondWithResult(_0x3db1a3,null))[_0x3c6c('0x41')](handleError(_0x3db1a3,null));};exports[_0x3c6c('0x4c')]=function(_0x3fe5bb,_0x595423,_0x3ad26f){var _0x3d4bcd={};var _0x554b07={};var _0xeacc55;var _0x5dfbcf;return db['FreshdeskConfiguration'][_0x3c6c('0x47')]({'where':{'id':_0x3fe5bb[_0x3c6c('0x42')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x595423,null))[_0x3c6c('0x24')](function(_0x495176){if(_0x495176){_0xeacc55=_0x495176;_0x554b07[_0x3c6c('0x2e')]=_[_0x3c6c('0x30')](db[_0x3c6c('0x48')][_0x3c6c('0x2b')]);_0x554b07[_0x3c6c('0x2f')]=_[_0x3c6c('0x30')](_0x3fe5bb[_0x3c6c('0x2f')]);_0x554b07['filters']=_['intersection'](_0x554b07[_0x3c6c('0x2e')],_0x554b07[_0x3c6c('0x2f')]);_0x3d4bcd[_0x3c6c('0x33')]=_[_0x3c6c('0x31')](_0x554b07[_0x3c6c('0x2e')],qs[_0x3c6c('0x32')](_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x32')]));_0x3d4bcd[_0x3c6c('0x33')]=_0x3d4bcd[_0x3c6c('0x33')]['length']?_0x3d4bcd['attributes']:_0x554b07[_0x3c6c('0x2e')];_0x3d4bcd[_0x3c6c('0x37')]=qs['sort'](_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x38')]);_0x3d4bcd[_0x3c6c('0x39')]=qs['filters'](_['pick'](_0x3fe5bb[_0x3c6c('0x2f')],_0x554b07[_0x3c6c('0x3a')]));if(_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x3d')]){_0x3d4bcd[_0x3c6c('0x39')]=_[_0x3c6c('0x3b')](_0x3d4bcd['where'],{'$or':_[_0x3c6c('0x29')](_0x3d4bcd[_0x3c6c('0x33')],function(_0x157bb1){var _0x1dc98d={};_0x1dc98d[_0x157bb1]={'$like':'%'+_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x3d')]+'%'};return _0x1dc98d;})});}_0x3d4bcd=_[_0x3c6c('0x3b')]({},_0x3d4bcd,_0x3fe5bb['options']);return _0xeacc55[_0x3c6c('0x4c')](_0x3d4bcd);}})[_0x3c6c('0x24')](function(_0x10bced){if(_0x10bced){_0x5dfbcf=_0x10bced[_0x3c6c('0x34')];if(!_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x35')](_0x3c6c('0x36'))){_0x3d4bcd[_0x3c6c('0x1c')]=qs[_0x3c6c('0x1c')](_0x3fe5bb[_0x3c6c('0x2f')]['limit']);_0x3d4bcd[_0x3c6c('0x1a')]=qs[_0x3c6c('0x1a')](_0x3fe5bb[_0x3c6c('0x2f')][_0x3c6c('0x1a')]);}return _0xeacc55[_0x3c6c('0x4c')](_0x3d4bcd);}})['then'](function(_0xff6d46){if(_0xff6d46){return _0xff6d46?{'count':_0x5dfbcf,'rows':_0xff6d46}:null;}})[_0x3c6c('0x24')](respondWithResult(_0x595423,null))[_0x3c6c('0x41')](handleError(_0x595423,null));};exports[_0x3c6c('0x4d')]=function(_0x3d4a39,_0x138686,_0x14d074){var _0xe7e9c={};var _0x20b464={};var _0x23f9ba;var _0x5204d3;return db['FreshdeskConfiguration'][_0x3c6c('0x47')]({'where':{'id':_0x3d4a39[_0x3c6c('0x42')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x138686,null))[_0x3c6c('0x24')](function(_0x17d33b){if(_0x17d33b){_0x23f9ba=_0x17d33b;_0x20b464[_0x3c6c('0x2e')]=_[_0x3c6c('0x30')](db[_0x3c6c('0x4e')][_0x3c6c('0x2b')]);_0x20b464[_0x3c6c('0x2f')]=_[_0x3c6c('0x30')](_0x3d4a39[_0x3c6c('0x2f')]);_0x20b464[_0x3c6c('0x3a')]=_[_0x3c6c('0x31')](_0x20b464[_0x3c6c('0x2e')],_0x20b464[_0x3c6c('0x2f')]);_0xe7e9c[_0x3c6c('0x33')]=_[_0x3c6c('0x31')](_0x20b464[_0x3c6c('0x2e')],qs[_0x3c6c('0x32')](_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x32')]));_0xe7e9c[_0x3c6c('0x33')]=_0xe7e9c[_0x3c6c('0x33')][_0x3c6c('0x34')]?_0xe7e9c[_0x3c6c('0x33')]:_0x20b464[_0x3c6c('0x2e')];_0xe7e9c['order']=qs['sort'](_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x38')]);_0xe7e9c[_0x3c6c('0x39')]=qs[_0x3c6c('0x3a')](_['pick'](_0x3d4a39[_0x3c6c('0x2f')],_0x20b464[_0x3c6c('0x3a')]));if(_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x3d')]){_0xe7e9c[_0x3c6c('0x39')]=_[_0x3c6c('0x3b')](_0xe7e9c[_0x3c6c('0x39')],{'$or':_[_0x3c6c('0x29')](_0xe7e9c['attributes'],function(_0x20a339){var _0x16caa6={};_0x16caa6[_0x20a339]={'$like':'%'+_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x3d')]+'%'};return _0x16caa6;})});}_0xe7e9c=_[_0x3c6c('0x3b')]({},_0xe7e9c,_0x3d4a39[_0x3c6c('0x3e')]);return _0x23f9ba[_0x3c6c('0x4d')](_0xe7e9c);}})['then'](function(_0x489d78){if(_0x489d78){_0x5204d3=_0x489d78[_0x3c6c('0x34')];if(!_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x35')](_0x3c6c('0x36'))){_0xe7e9c[_0x3c6c('0x1c')]=qs[_0x3c6c('0x1c')](_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x1c')]);_0xe7e9c['offset']=qs[_0x3c6c('0x1a')](_0x3d4a39[_0x3c6c('0x2f')][_0x3c6c('0x1a')]);}return _0x23f9ba[_0x3c6c('0x4d')](_0xe7e9c);}})['then'](function(_0x49c030){if(_0x49c030){return _0x49c030?{'count':_0x5204d3,'rows':_0x49c030}:null;}})[_0x3c6c('0x24')](respondWithResult(_0x138686,null))[_0x3c6c('0x41')](handleError(_0x138686,null));};exports[_0x3c6c('0x4f')]=function(_0x46807b,_0x286c33,_0x413ff1){if(_0x46807b[_0x3c6c('0x46')]['id']){delete _0x46807b[_0x3c6c('0x46')]['id'];}return db[_0x3c6c('0x2a')][_0x3c6c('0x47')]({'where':{'id':_0x46807b['params']['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x286c33,null))[_0x3c6c('0x24')](function(_0x366810){if(_0x366810){return _0x366810[_0x3c6c('0x4f')](_0x46807b[_0x3c6c('0x46')]['ids']||[]);}return null;})[_0x3c6c('0x24')](respondWithResult(_0x286c33,null))['catch'](handleError(_0x286c33,null));}; \ No newline at end of file +var _0xf036=['keys','find','body','destroy','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','Tag','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf036,0x154));var _0x6f03=function(_0x533147,_0x4ba332){_0x533147=_0x533147-0x0;var _0x2bc6fb=_0xf036[_0x533147];return _0x2bc6fb;};'use strict';var emlformat=require(_0x6f03('0x0'));var rimraf=require(_0x6f03('0x1'));var zipdir=require(_0x6f03('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6f03('0x3'));var BPromise=require(_0x6f03('0x4'));var Mustache=require(_0x6f03('0x5'));var util=require(_0x6f03('0x6'));var path=require('path');var sox=require(_0x6f03('0x7'));var csv=require(_0x6f03('0x8'));var ejs=require(_0x6f03('0x9'));var fs=require('fs');var fs_extra=require(_0x6f03('0xa'));var _=require(_0x6f03('0xb'));var squel=require('squel');var crypto=require(_0x6f03('0xc'));var jsforce=require(_0x6f03('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f03('0x8'));var querystring=require(_0x6f03('0xe'));var Papa=require(_0x6f03('0xf'));var Redis=require(_0x6f03('0x10'));var authService=require(_0x6f03('0x11'));var qs=require(_0x6f03('0x12'));var as=require(_0x6f03('0x13'));var hardwareService=require(_0x6f03('0x14'));var logger=require(_0x6f03('0x15'))('api');var utils=require(_0x6f03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6f03('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe31063,_0x6e99e6){_0x6e99e6=_0x6e99e6||0xcc;return function(_0x10cb88){if(_0x10cb88){return _0xe31063[_0x6f03('0x18')](_0x6e99e6);}return _0xe31063[_0x6f03('0x19')](_0x6e99e6)[_0x6f03('0x1a')]();};}function respondWithResult(_0x50d9d9,_0x3745e1){_0x3745e1=_0x3745e1||0xc8;return function(_0xce4541){if(_0xce4541){return _0x50d9d9[_0x6f03('0x19')](_0x3745e1)['json'](_0xce4541);}};}function respondWithFilteredResult(_0x3d8082,_0x23e298){return function(_0x3cc5de){if(_0x3cc5de){var _0x5ab363=typeof _0x23e298[_0x6f03('0x1b')]===_0x6f03('0x1c')&&typeof _0x23e298[_0x6f03('0x1d')]===_0x6f03('0x1c');var _0x1af05c=_0x3cc5de['count'];var _0x2dcc5e=_0x5ab363?0x0:_0x23e298[_0x6f03('0x1b')];var _0x121758=_0x5ab363?_0x3cc5de[_0x6f03('0x1e')]:_0x23e298[_0x6f03('0x1b')]+_0x23e298[_0x6f03('0x1d')];var _0x19192a;if(_0x121758>=_0x1af05c){_0x121758=_0x1af05c;_0x19192a=0xc8;}else{_0x19192a=0xce;}_0x3d8082[_0x6f03('0x19')](_0x19192a);return _0x3d8082[_0x6f03('0x1f')]('Content-Range',_0x2dcc5e+'-'+_0x121758+'/'+_0x1af05c)[_0x6f03('0x20')](_0x3cc5de);}return null;};}function patchUpdates(_0x4a55d0){return function(_0x17e0fa){try{jsonpatch[_0x6f03('0x21')](_0x17e0fa,_0x4a55d0,!![]);}catch(_0x44dd63){return BPromise[_0x6f03('0x22')](_0x44dd63);}return _0x17e0fa[_0x6f03('0x23')]();};}function saveUpdates(_0x4279d9,_0x54d9b2){return function(_0x2d8242){if(_0x2d8242){return _0x2d8242[_0x6f03('0x24')](_0x4279d9)[_0x6f03('0x25')](function(_0x205f6c){return _0x205f6c;});}return null;};}function removeEntity(_0x140928,_0x2881e4){return function(_0x3d8d6c){if(_0x3d8d6c){return _0x3d8d6c['destroy']()[_0x6f03('0x25')](function(){_0x140928[_0x6f03('0x19')](0xcc)[_0x6f03('0x1a')]();});}};}function handleEntityNotFound(_0x437a4f,_0x1b615e){return function(_0x49fcba){if(!_0x49fcba){_0x437a4f[_0x6f03('0x18')](0x194);}return _0x49fcba;};}function handleError(_0x170592,_0x29e548){_0x29e548=_0x29e548||0x1f4;return function(_0x3cdf0e){logger[_0x6f03('0x26')](_0x3cdf0e[_0x6f03('0x27')]);if(_0x3cdf0e[_0x6f03('0x28')]){delete _0x3cdf0e[_0x6f03('0x28')];}_0x170592[_0x6f03('0x19')](_0x29e548)[_0x6f03('0x29')](_0x3cdf0e);};}exports[_0x6f03('0x2a')]=function(_0x473f86,_0x54be75){var _0x5cb468={},_0x24e12d={},_0x5c02bc={'count':0x0,'rows':[]};var _0x4a2c4c=_[_0x6f03('0x2b')](db[_0x6f03('0x2c')][_0x6f03('0x2d')],function(_0x3c66e3){return{'name':_0x3c66e3[_0x6f03('0x2e')],'type':_0x3c66e3[_0x6f03('0x2f')][_0x6f03('0x30')]};});_0x24e12d[_0x6f03('0x31')]=_[_0x6f03('0x2b')](_0x4a2c4c,_0x6f03('0x28'));_0x24e12d[_0x6f03('0x32')]=_['keys'](_0x473f86['query']);_0x24e12d[_0x6f03('0x33')]=_[_0x6f03('0x34')](_0x24e12d[_0x6f03('0x31')],_0x24e12d[_0x6f03('0x32')]);_0x5cb468['attributes']=_[_0x6f03('0x34')](_0x24e12d['model'],qs[_0x6f03('0x35')](_0x473f86['query']['fields']));_0x5cb468[_0x6f03('0x36')]=_0x5cb468[_0x6f03('0x36')][_0x6f03('0x37')]?_0x5cb468[_0x6f03('0x36')]:_0x24e12d['model'];if(!_0x473f86[_0x6f03('0x32')][_0x6f03('0x38')](_0x6f03('0x39'))){_0x5cb468[_0x6f03('0x1d')]=qs[_0x6f03('0x1d')](_0x473f86[_0x6f03('0x32')][_0x6f03('0x1d')]);_0x5cb468['offset']=qs[_0x6f03('0x1b')](_0x473f86['query'][_0x6f03('0x1b')]);}_0x5cb468[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_0x473f86[_0x6f03('0x32')][_0x6f03('0x3b')]);_0x5cb468[_0x6f03('0x3c')]=qs[_0x6f03('0x33')](_['pick'](_0x473f86['query'],_0x24e12d[_0x6f03('0x33')]),_0x4a2c4c);if(_0x473f86[_0x6f03('0x32')]['filter']){_0x5cb468[_0x6f03('0x3c')]=_[_0x6f03('0x3d')](_0x5cb468[_0x6f03('0x3c')],{'$or':_[_0x6f03('0x2b')](_0x4a2c4c,function(_0x3c35bc){if(_0x3c35bc[_0x6f03('0x2f')]!=='VIRTUAL'){var _0x247b67={};_0x247b67[_0x3c35bc['name']]={'$like':'%'+_0x473f86[_0x6f03('0x32')][_0x6f03('0x3e')]+'%'};return _0x247b67;}})});}_0x5cb468=_[_0x6f03('0x3d')]({},_0x5cb468,_0x473f86[_0x6f03('0x3f')]);var _0x3dedc5={'where':_0x5cb468[_0x6f03('0x3c')]};return db['FreshdeskConfiguration'][_0x6f03('0x1e')](_0x3dedc5)[_0x6f03('0x25')](function(_0x511f12){_0x5c02bc[_0x6f03('0x1e')]=_0x511f12;if(_0x473f86[_0x6f03('0x32')][_0x6f03('0x40')]){_0x5cb468[_0x6f03('0x41')]=[{'all':!![]}];}return db[_0x6f03('0x2c')][_0x6f03('0x42')](_0x5cb468);})['then'](function(_0xd45160){_0x5c02bc[_0x6f03('0x43')]=_0xd45160;return _0x5c02bc;})[_0x6f03('0x25')](respondWithFilteredResult(_0x54be75,_0x5cb468))[_0x6f03('0x44')](handleError(_0x54be75,null));};exports['show']=function(_0x45f82c,_0x1cfe63){var _0x4dccb2={'raw':![],'where':{'id':_0x45f82c[_0x6f03('0x45')]['id']}},_0x461b44={};_0x461b44[_0x6f03('0x31')]=_[_0x6f03('0x46')](db[_0x6f03('0x2c')]['rawAttributes']);_0x461b44['query']=_[_0x6f03('0x46')](_0x45f82c[_0x6f03('0x32')]);_0x461b44[_0x6f03('0x33')]=_[_0x6f03('0x34')](_0x461b44[_0x6f03('0x31')],_0x461b44[_0x6f03('0x32')]);_0x4dccb2[_0x6f03('0x36')]=_[_0x6f03('0x34')](_0x461b44['model'],qs[_0x6f03('0x35')](_0x45f82c[_0x6f03('0x32')]['fields']));_0x4dccb2['attributes']=_0x4dccb2[_0x6f03('0x36')][_0x6f03('0x37')]?_0x4dccb2['attributes']:_0x461b44[_0x6f03('0x31')];if(_0x45f82c[_0x6f03('0x32')][_0x6f03('0x40')]){_0x4dccb2[_0x6f03('0x41')]=[{'all':!![]}];}_0x4dccb2=_[_0x6f03('0x3d')]({},_0x4dccb2,_0x45f82c[_0x6f03('0x3f')]);return db[_0x6f03('0x2c')][_0x6f03('0x47')](_0x4dccb2)[_0x6f03('0x25')](handleEntityNotFound(_0x1cfe63,null))[_0x6f03('0x25')](respondWithResult(_0x1cfe63,null))[_0x6f03('0x44')](handleError(_0x1cfe63,null));};exports['create']=function(_0x10c838,_0x4d79fa){return db[_0x6f03('0x2c')]['create'](_0x10c838[_0x6f03('0x48')],{})[_0x6f03('0x25')](respondWithResult(_0x4d79fa,0xc9))[_0x6f03('0x44')](handleError(_0x4d79fa,null));};exports[_0x6f03('0x24')]=function(_0x1b21a8,_0x2c9e11){if(_0x1b21a8[_0x6f03('0x48')]['id']){delete _0x1b21a8[_0x6f03('0x48')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x1b21a8[_0x6f03('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c9e11,null))[_0x6f03('0x25')](saveUpdates(_0x1b21a8['body'],null))[_0x6f03('0x25')](respondWithResult(_0x2c9e11,null))[_0x6f03('0x44')](handleError(_0x2c9e11,null));};exports[_0x6f03('0x49')]=function(_0x47afc3,_0xaa484){return db[_0x6f03('0x2c')]['find']({'where':{'id':_0x47afc3[_0x6f03('0x45')]['id']}})['then'](handleEntityNotFound(_0xaa484,null))[_0x6f03('0x25')](removeEntity(_0xaa484,null))[_0x6f03('0x44')](handleError(_0xaa484,null));};exports[_0x6f03('0x4a')]=function(_0x11f8b8,_0x3be1a4,_0x3c2588){var _0x5aa401={};var _0x37e84f={};var _0x29b593;var _0x53a7b9;return db[_0x6f03('0x2c')][_0x6f03('0x4b')]({'where':{'id':_0x11f8b8[_0x6f03('0x45')]['id']}})[_0x6f03('0x25')](handleEntityNotFound(_0x3be1a4,null))[_0x6f03('0x25')](function(_0x36bb19){if(_0x36bb19){_0x29b593=_0x36bb19;_0x37e84f[_0x6f03('0x31')]=_[_0x6f03('0x46')](db[_0x6f03('0x4c')]['rawAttributes']);_0x37e84f['query']=_[_0x6f03('0x46')](_0x11f8b8['query']);_0x37e84f[_0x6f03('0x33')]=_[_0x6f03('0x34')](_0x37e84f[_0x6f03('0x31')],_0x37e84f[_0x6f03('0x32')]);_0x5aa401['attributes']=_[_0x6f03('0x34')](_0x37e84f[_0x6f03('0x31')],qs['fields'](_0x11f8b8[_0x6f03('0x32')][_0x6f03('0x35')]));_0x5aa401[_0x6f03('0x36')]=_0x5aa401[_0x6f03('0x36')][_0x6f03('0x37')]?_0x5aa401[_0x6f03('0x36')]:_0x37e84f[_0x6f03('0x31')];_0x5aa401[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_0x11f8b8['query'][_0x6f03('0x3b')]);_0x5aa401['where']=qs[_0x6f03('0x33')](_[_0x6f03('0x4d')](_0x11f8b8[_0x6f03('0x32')],_0x37e84f['filters']));if(_0x11f8b8[_0x6f03('0x32')][_0x6f03('0x3e')]){_0x5aa401[_0x6f03('0x3c')]=_[_0x6f03('0x3d')](_0x5aa401['where'],{'$or':_[_0x6f03('0x2b')](_0x5aa401['attributes'],function(_0x1e3cb5){var _0x10713a={};_0x10713a[_0x1e3cb5]={'$like':'%'+_0x11f8b8[_0x6f03('0x32')][_0x6f03('0x3e')]+'%'};return _0x10713a;})});}_0x5aa401=_[_0x6f03('0x3d')]({},_0x5aa401,_0x11f8b8[_0x6f03('0x3f')]);return _0x29b593[_0x6f03('0x4a')](_0x5aa401);}})['then'](function(_0x272e20){if(_0x272e20){_0x53a7b9=_0x272e20[_0x6f03('0x37')];if(!_0x11f8b8['query'][_0x6f03('0x38')](_0x6f03('0x39'))){_0x5aa401[_0x6f03('0x1d')]=qs[_0x6f03('0x1d')](_0x11f8b8[_0x6f03('0x32')][_0x6f03('0x1d')]);_0x5aa401[_0x6f03('0x1b')]=qs[_0x6f03('0x1b')](_0x11f8b8['query'][_0x6f03('0x1b')]);}return _0x29b593['getFields'](_0x5aa401);}})['then'](function(_0x2d8d60){if(_0x2d8d60){return _0x2d8d60?{'count':_0x53a7b9,'rows':_0x2d8d60}:null;}})[_0x6f03('0x25')](respondWithResult(_0x3be1a4,null))['catch'](handleError(_0x3be1a4,null));};exports['getSubjects']=function(_0x18ff91,_0x250bb9,_0x263896){var _0x13003a={};var _0x3a09af={};var _0x373af1;var _0x1f5587;return db[_0x6f03('0x2c')]['findOne']({'where':{'id':_0x18ff91['params']['id']}})['then'](handleEntityNotFound(_0x250bb9,null))['then'](function(_0xee10b8){if(_0xee10b8){_0x373af1=_0xee10b8;_0x3a09af[_0x6f03('0x31')]=_['keys'](db[_0x6f03('0x4c')][_0x6f03('0x2d')]);_0x3a09af[_0x6f03('0x32')]=_['keys'](_0x18ff91[_0x6f03('0x32')]);_0x3a09af[_0x6f03('0x33')]=_[_0x6f03('0x34')](_0x3a09af[_0x6f03('0x31')],_0x3a09af[_0x6f03('0x32')]);_0x13003a[_0x6f03('0x36')]=_[_0x6f03('0x34')](_0x3a09af[_0x6f03('0x31')],qs[_0x6f03('0x35')](_0x18ff91[_0x6f03('0x32')]['fields']));_0x13003a[_0x6f03('0x36')]=_0x13003a[_0x6f03('0x36')][_0x6f03('0x37')]?_0x13003a[_0x6f03('0x36')]:_0x3a09af[_0x6f03('0x31')];_0x13003a[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_0x18ff91[_0x6f03('0x32')][_0x6f03('0x3b')]);_0x13003a[_0x6f03('0x3c')]=qs[_0x6f03('0x33')](_[_0x6f03('0x4d')](_0x18ff91[_0x6f03('0x32')],_0x3a09af[_0x6f03('0x33')]));if(_0x18ff91[_0x6f03('0x32')]['filter']){_0x13003a[_0x6f03('0x3c')]=_[_0x6f03('0x3d')](_0x13003a[_0x6f03('0x3c')],{'$or':_[_0x6f03('0x2b')](_0x13003a[_0x6f03('0x36')],function(_0x184047){var _0x22e093={};_0x22e093[_0x184047]={'$like':'%'+_0x18ff91['query']['filter']+'%'};return _0x22e093;})});}_0x13003a=_[_0x6f03('0x3d')]({},_0x13003a,_0x18ff91[_0x6f03('0x3f')]);return _0x373af1[_0x6f03('0x4e')](_0x13003a);}})[_0x6f03('0x25')](function(_0x6607e3){if(_0x6607e3){_0x1f5587=_0x6607e3[_0x6f03('0x37')];if(!_0x18ff91[_0x6f03('0x32')][_0x6f03('0x38')](_0x6f03('0x39'))){_0x13003a[_0x6f03('0x1d')]=qs[_0x6f03('0x1d')](_0x18ff91[_0x6f03('0x32')][_0x6f03('0x1d')]);_0x13003a[_0x6f03('0x1b')]=qs[_0x6f03('0x1b')](_0x18ff91[_0x6f03('0x32')][_0x6f03('0x1b')]);}return _0x373af1[_0x6f03('0x4e')](_0x13003a);}})['then'](function(_0x539cfc){if(_0x539cfc){return _0x539cfc?{'count':_0x1f5587,'rows':_0x539cfc}:null;}})['then'](respondWithResult(_0x250bb9,null))[_0x6f03('0x44')](handleError(_0x250bb9,null));};exports[_0x6f03('0x4f')]=function(_0x2ad477,_0x336b2b,_0x307cd5){var _0x34abb6={};var _0xbe12ca={};var _0xdb6b4c;var _0xf2ef8d;return db[_0x6f03('0x2c')]['findOne']({'where':{'id':_0x2ad477[_0x6f03('0x45')]['id']}})[_0x6f03('0x25')](handleEntityNotFound(_0x336b2b,null))[_0x6f03('0x25')](function(_0x7b9ded){if(_0x7b9ded){_0xdb6b4c=_0x7b9ded;_0xbe12ca[_0x6f03('0x31')]=_['keys'](db[_0x6f03('0x4c')][_0x6f03('0x2d')]);_0xbe12ca[_0x6f03('0x32')]=_[_0x6f03('0x46')](_0x2ad477[_0x6f03('0x32')]);_0xbe12ca['filters']=_[_0x6f03('0x34')](_0xbe12ca[_0x6f03('0x31')],_0xbe12ca[_0x6f03('0x32')]);_0x34abb6[_0x6f03('0x36')]=_['intersection'](_0xbe12ca[_0x6f03('0x31')],qs[_0x6f03('0x35')](_0x2ad477[_0x6f03('0x32')][_0x6f03('0x35')]));_0x34abb6['attributes']=_0x34abb6[_0x6f03('0x36')][_0x6f03('0x37')]?_0x34abb6[_0x6f03('0x36')]:_0xbe12ca['model'];_0x34abb6[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_0x2ad477[_0x6f03('0x32')][_0x6f03('0x3b')]);_0x34abb6[_0x6f03('0x3c')]=qs[_0x6f03('0x33')](_[_0x6f03('0x4d')](_0x2ad477[_0x6f03('0x32')],_0xbe12ca[_0x6f03('0x33')]));if(_0x2ad477['query']['filter']){_0x34abb6[_0x6f03('0x3c')]=_['merge'](_0x34abb6['where'],{'$or':_[_0x6f03('0x2b')](_0x34abb6[_0x6f03('0x36')],function(_0x3f41ab){var _0x15a417={};_0x15a417[_0x3f41ab]={'$like':'%'+_0x2ad477[_0x6f03('0x32')][_0x6f03('0x3e')]+'%'};return _0x15a417;})});}_0x34abb6=_[_0x6f03('0x3d')]({},_0x34abb6,_0x2ad477[_0x6f03('0x3f')]);return _0xdb6b4c[_0x6f03('0x4f')](_0x34abb6);}})[_0x6f03('0x25')](function(_0x3b674c){if(_0x3b674c){_0xf2ef8d=_0x3b674c[_0x6f03('0x37')];if(!_0x2ad477['query'][_0x6f03('0x38')](_0x6f03('0x39'))){_0x34abb6['limit']=qs['limit'](_0x2ad477[_0x6f03('0x32')][_0x6f03('0x1d')]);_0x34abb6['offset']=qs[_0x6f03('0x1b')](_0x2ad477[_0x6f03('0x32')][_0x6f03('0x1b')]);}return _0xdb6b4c[_0x6f03('0x4f')](_0x34abb6);}})[_0x6f03('0x25')](function(_0x3883ce){if(_0x3883ce){return _0x3883ce?{'count':_0xf2ef8d,'rows':_0x3883ce}:null;}})['then'](respondWithResult(_0x336b2b,null))['catch'](handleError(_0x336b2b,null));};exports[_0x6f03('0x50')]=function(_0x521083,_0x1ce3af,_0x174d5e){var _0x2900b0={};var _0x5429a0={};var _0x4b1be8;var _0x30a5d0;return db[_0x6f03('0x2c')][_0x6f03('0x4b')]({'where':{'id':_0x521083[_0x6f03('0x45')]['id']}})[_0x6f03('0x25')](handleEntityNotFound(_0x1ce3af,null))[_0x6f03('0x25')](function(_0x14329b){if(_0x14329b){_0x4b1be8=_0x14329b;_0x5429a0[_0x6f03('0x31')]=_[_0x6f03('0x46')](db[_0x6f03('0x51')][_0x6f03('0x2d')]);_0x5429a0[_0x6f03('0x32')]=_[_0x6f03('0x46')](_0x521083[_0x6f03('0x32')]);_0x5429a0['filters']=_['intersection'](_0x5429a0[_0x6f03('0x31')],_0x5429a0[_0x6f03('0x32')]);_0x2900b0[_0x6f03('0x36')]=_[_0x6f03('0x34')](_0x5429a0[_0x6f03('0x31')],qs[_0x6f03('0x35')](_0x521083[_0x6f03('0x32')][_0x6f03('0x35')]));_0x2900b0[_0x6f03('0x36')]=_0x2900b0['attributes'][_0x6f03('0x37')]?_0x2900b0[_0x6f03('0x36')]:_0x5429a0[_0x6f03('0x31')];_0x2900b0[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_0x521083[_0x6f03('0x32')][_0x6f03('0x3b')]);_0x2900b0[_0x6f03('0x3c')]=qs[_0x6f03('0x33')](_[_0x6f03('0x4d')](_0x521083[_0x6f03('0x32')],_0x5429a0[_0x6f03('0x33')]));if(_0x521083[_0x6f03('0x32')][_0x6f03('0x3e')]){_0x2900b0['where']=_[_0x6f03('0x3d')](_0x2900b0[_0x6f03('0x3c')],{'$or':_['map'](_0x2900b0['attributes'],function(_0x4ff03f){var _0x3572a1={};_0x3572a1[_0x4ff03f]={'$like':'%'+_0x521083['query'][_0x6f03('0x3e')]+'%'};return _0x3572a1;})});}_0x2900b0=_[_0x6f03('0x3d')]({},_0x2900b0,_0x521083['options']);return _0x4b1be8[_0x6f03('0x50')](_0x2900b0);}})['then'](function(_0x221660){if(_0x221660){_0x30a5d0=_0x221660[_0x6f03('0x37')];if(!_0x521083[_0x6f03('0x32')][_0x6f03('0x38')](_0x6f03('0x39'))){_0x2900b0['limit']=qs[_0x6f03('0x1d')](_0x521083[_0x6f03('0x32')][_0x6f03('0x1d')]);_0x2900b0['offset']=qs[_0x6f03('0x1b')](_0x521083[_0x6f03('0x32')][_0x6f03('0x1b')]);}return _0x4b1be8[_0x6f03('0x50')](_0x2900b0);}})[_0x6f03('0x25')](function(_0x155c2d){if(_0x155c2d){return _0x155c2d?{'count':_0x30a5d0,'rows':_0x155c2d}:null;}})[_0x6f03('0x25')](respondWithResult(_0x1ce3af,null))['catch'](handleError(_0x1ce3af,null));};exports['setTags']=function(_0x49e487,_0x5530a6,_0xc98705){if(_0x49e487[_0x6f03('0x48')]['id']){delete _0x49e487['body']['id'];}return db['FreshdeskConfiguration'][_0x6f03('0x4b')]({'where':{'id':_0x49e487['params']['id']}})['then'](handleEntityNotFound(_0x5530a6,null))['then'](function(_0x4d1e96){if(_0x4d1e96){return _0x4d1e96['setTags'](_0x49e487['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x5530a6,null))[_0x6f03('0x44')](handleError(_0x5530a6,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index cfc1360..c0374a1 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 _0xf77a=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2e55c9,_0x2c37f3){var _0x4f7361=function(_0x4c6251){while(--_0x4c6251){_0x2e55c9['push'](_0x2e55c9['shift']());}};_0x4f7361(++_0x2c37f3);}(_0xf77a,0xe1));var _0xaf77=function(_0x2a1a09,_0x37454e){_0x2a1a09=_0x2a1a09-0x0;var _0xacb6de=_0xf77a[_0x2a1a09];return _0xacb6de;};'use strict';var _=require('lodash');var util=require(_0xaf77('0x0'));var logger=require(_0xaf77('0x1'))(_0xaf77('0x2'));var moment=require(_0xaf77('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf77('0x4'));var fs=require('fs');var path=require(_0xaf77('0x5'));var rimraf=require('rimraf');var config=require(_0xaf77('0x6'));var attributes=require(_0xaf77('0x7'));module[_0xaf77('0x8')]=function(_0x5907f4,_0x5f1590){return _0x5907f4['define'](_0xaf77('0x9'),attributes,{'tableName':_0xaf77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0e9=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','FreshdeskConfiguration'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xb0e9,0x18d));var _0x9b0e=function(_0x504b50,_0xf0ab3c){_0x504b50=_0x504b50-0x0;var _0x278132=_0xb0e9[_0x504b50];return _0x278132;};'use strict';var _=require(_0x9b0e('0x0'));var util=require(_0x9b0e('0x1'));var logger=require(_0x9b0e('0x2'))(_0x9b0e('0x3'));var moment=require(_0x9b0e('0x4'));var BPromise=require(_0x9b0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b0e('0x6'));var rimraf=require('rimraf');var config=require(_0x9b0e('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x9b0e('0x8')]=function(_0x172a5c,_0x118f0b){return _0x172a5c[_0x9b0e('0x9')](_0x9b0e('0xa'),attributes,{'tableName':_0x9b0e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 050ebf9..5e52fca 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 _0xc7d7=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','moment','bluebird'];(function(_0xd6d456,_0x37accf){var _0x5c3e7d=function(_0x262ac9){while(--_0x262ac9){_0xd6d456['push'](_0xd6d456['shift']());}};_0x5c3e7d(++_0x37accf);}(_0xc7d7,0x9d));var _0x7c7d=function(_0x3b6ad5,_0x1b0ddb){_0x3b6ad5=_0x3b6ad5-0x0;var _0x3a6e1f=_0xc7d7[_0x3b6ad5];return _0x3a6e1f;};'use strict';var _=require(_0x7c7d('0x0'));var util=require('util');var moment=require(_0x7c7d('0x1'));var BPromise=require(_0x7c7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c7d('0x3'));var db=require(_0x7c7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c7d('0x5'))(_0x7c7d('0x6'));var config=require('../../config/environment');var jayson=require(_0x7c7d('0x7'));var client=jayson['client'][_0x7c7d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ce2a2,_0x1c771e,_0x4bab57){return new BPromise(function(_0x41f89c,_0x50e9f5){return client[_0x7c7d('0x9')](_0x5ce2a2,_0x4bab57)[_0x7c7d('0xa')](function(_0x854c4a){logger['info'](_0x7c7d('0xb'),_0x1c771e,'request\x20sent');logger[_0x7c7d('0xc')](_0x7c7d('0xd'),_0x1c771e,_0x7c7d('0xe'),JSON['stringify'](_0x854c4a));if(_0x854c4a['error']){if(_0x854c4a[_0x7c7d('0xf')][_0x7c7d('0x10')]===0x1f4){logger[_0x7c7d('0xf')](_0x7c7d('0xb'),_0x1c771e,_0x854c4a[_0x7c7d('0xf')][_0x7c7d('0x11')]);return _0x50e9f5(_0x854c4a[_0x7c7d('0xf')]['message']);}logger[_0x7c7d('0xf')](_0x7c7d('0xb'),_0x1c771e,_0x854c4a[_0x7c7d('0xf')][_0x7c7d('0x11')]);return _0x41f89c(_0x854c4a[_0x7c7d('0xf')][_0x7c7d('0x11')]);}else{logger[_0x7c7d('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1c771e,_0x7c7d('0xe'));_0x41f89c(_0x854c4a[_0x7c7d('0x13')][_0x7c7d('0x11')]);}})['catch'](function(_0x54d5c5){logger[_0x7c7d('0xf')](_0x7c7d('0xb'),_0x1c771e,_0x54d5c5);_0x50e9f5(_0x54d5c5);});});} \ No newline at end of file +var _0x880a=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42d9d8,_0x2baa3c){var _0x210060=function(_0x2c9b7f){while(--_0x2c9b7f){_0x42d9d8['push'](_0x42d9d8['shift']());}};_0x210060(++_0x2baa3c);}(_0x880a,0x1da));var _0xa880=function(_0xc7e71d,_0x154f48){_0xc7e71d=_0xc7e71d-0x0;var _0x262aea=_0x880a[_0xc7e71d];return _0x262aea;};'use strict';var _=require(_0xa880('0x0'));var util=require(_0xa880('0x1'));var moment=require(_0xa880('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa880('0x3'));var db=require(_0xa880('0x4'))['db'];var utils=require(_0xa880('0x5'));var logger=require(_0xa880('0x6'))(_0xa880('0x7'));var config=require(_0xa880('0x8'));var jayson=require(_0xa880('0x9'));var client=jayson[_0xa880('0xa')][_0xa880('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37ebfe,_0x35e58e,_0x5711be){return new BPromise(function(_0x4e4029,_0x180a52){return client[_0xa880('0xc')](_0x37ebfe,_0x5711be)[_0xa880('0xd')](function(_0xfe9b16){logger[_0xa880('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x35e58e,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x35e58e,_0xa880('0xf'),JSON[_0xa880('0x10')](_0xfe9b16));if(_0xfe9b16[_0xa880('0x11')]){if(_0xfe9b16[_0xa880('0x11')][_0xa880('0x12')]===0x1f4){logger['error'](_0xa880('0x13'),_0x35e58e,_0xfe9b16['error'][_0xa880('0x14')]);return _0x180a52(_0xfe9b16[_0xa880('0x11')]['message']);}logger['error'](_0xa880('0x13'),_0x35e58e,_0xfe9b16['error'][_0xa880('0x14')]);return _0x4e4029(_0xfe9b16['error']['message']);}else{logger['info'](_0xa880('0x13'),_0x35e58e,_0xa880('0xf'));_0x4e4029(_0xfe9b16[_0xa880('0x15')][_0xa880('0x14')]);}})[_0xa880('0x16')](function(_0x5858ae){logger[_0xa880('0x11')](_0xa880('0x13'),_0x35e58e,_0x5858ae);_0x180a52(_0x5858ae);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index a1582c8..cec3884 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 _0x3598=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0xafdd64,_0x1c20b0){var _0x326499=function(_0x140fdb){while(--_0x140fdb){_0xafdd64['push'](_0xafdd64['shift']());}};_0x326499(++_0x1c20b0);}(_0x3598,0x1a3));var _0x8359=function(_0x15019e,_0x52c809){_0x15019e=_0x15019e-0x0;var _0x5ce225=_0x3598[_0x15019e];return _0x5ce225;};'use strict';var multer=require(_0x8359('0x0'));var util=require(_0x8359('0x1'));var path=require(_0x8359('0x2'));var timeout=require(_0x8359('0x3'));var express=require(_0x8359('0x4'));var router=express[_0x8359('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8359('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8359('0x7'));var controller=require(_0x8359('0x8'));router['get']('/',auth[_0x8359('0x9')](),controller[_0x8359('0xa')]);router['get'](_0x8359('0xb'),auth[_0x8359('0x9')](),controller[_0x8359('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8359('0xd')]);router[_0x8359('0xe')](_0x8359('0xb'),auth['isAuthenticated'](),controller[_0x8359('0xf')]);router[_0x8359('0x10')](_0x8359('0xb'),auth[_0x8359('0x9')](),controller[_0x8359('0x11')]);module[_0x8359('0x12')]=router; \ No newline at end of file +var _0xa7bf=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xa7bf,0x121));var _0xfa7b=function(_0x477ec9,_0x3a53d9){_0x477ec9=_0x477ec9-0x0;var _0x104c5e=_0xa7bf[_0x477ec9];return _0x104c5e;};'use strict';var multer=require('multer');var util=require(_0xfa7b('0x0'));var path=require('path');var timeout=require(_0xfa7b('0x1'));var express=require(_0xfa7b('0x2'));var router=express[_0xfa7b('0x3')]();var fs_extra=require(_0xfa7b('0x4'));var auth=require(_0xfa7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa7b('0x6'));var controller=require(_0xfa7b('0x7'));router[_0xfa7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa7b('0x9')]);router[_0xfa7b('0x8')](_0xfa7b('0xa'),auth[_0xfa7b('0xb')](),controller[_0xfa7b('0xc')]);router[_0xfa7b('0xd')]('/',auth[_0xfa7b('0xb')](),controller[_0xfa7b('0xe')]);router[_0xfa7b('0xf')]('/:id',auth[_0xfa7b('0xb')](),controller[_0xfa7b('0x10')]);router[_0xfa7b('0x11')](_0xfa7b('0xa'),auth['isAuthenticated'](),controller[_0xfa7b('0x12')]);module[_0xfa7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 52be957..a60bbdb 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 _0xa4f1=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','exports','ENUM'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa4f1,0x1ae));var _0x1a4f=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xa4f1[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require('sequelize');module[_0x1a4f('0x0')]={'type':{'type':Sequelize[_0x1a4f('0x1')](_0x1a4f('0x2'),'variable',_0x1a4f('0x3'),_0x1a4f('0x4'),_0x1a4f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1a4f('0x6')]},'key':{'type':Sequelize[_0x1a4f('0x6')]},'keyType':{'type':Sequelize[_0x1a4f('0x1')](_0x1a4f('0x2'),_0x1a4f('0x7'),_0x1a4f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1a4f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1a4f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a4f('0x6')]}}; \ No newline at end of file +var _0x47b0=['sequelize','ENUM','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x473d36,_0x21eac1){var _0x649067=function(_0x319dfe){while(--_0x319dfe){_0x473d36['push'](_0x473d36['shift']());}};_0x649067(++_0x21eac1);}(_0x47b0,0x134));var _0x047b=function(_0x31b7da,_0xe08c97){_0x31b7da=_0x31b7da-0x0;var _0x54fded=_0x47b0[_0x31b7da];return _0x54fded;};'use strict';var Sequelize=require(_0x047b('0x0'));module['exports']={'type':{'type':Sequelize[_0x047b('0x1')](_0x047b('0x2'),_0x047b('0x3'),'customVariable',_0x047b('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x047b('0x5')]},'key':{'type':Sequelize[_0x047b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x047b('0x2'),_0x047b('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x047b('0x5')]},'idField':{'type':Sequelize[_0x047b('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x047b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x047b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 76aeb25..2629609 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 _0xf403=['error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','params','intersection','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xf403,0x1d3));var _0x3f40=function(_0x3ab7c7,_0x58347a){_0x3ab7c7=_0x3ab7c7-0x0;var _0x149229=_0xf403[_0x3ab7c7];return _0x149229;};'use strict';var emlformat=require(_0x3f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f40('0x1'));var jsonpatch=require(_0x3f40('0x2'));var rp=require(_0x3f40('0x3'));var moment=require(_0x3f40('0x4'));var BPromise=require(_0x3f40('0x5'));var Mustache=require(_0x3f40('0x6'));var util=require(_0x3f40('0x7'));var path=require(_0x3f40('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f40('0x9'));var fs=require('fs');var fs_extra=require(_0x3f40('0xa'));var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var licenseUtil=require(_0x3f40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332635,_0x509c02){_0x509c02=_0x509c02||0xcc;return function(_0x116460){if(_0x116460){return _0x332635[_0x3f40('0x17')](_0x509c02);}return _0x332635[_0x3f40('0x18')](_0x509c02)[_0x3f40('0x19')]();};}function respondWithResult(_0x569c6e,_0x2b2bfe){_0x2b2bfe=_0x2b2bfe||0xc8;return function(_0x308e97){if(_0x308e97){return _0x569c6e[_0x3f40('0x18')](_0x2b2bfe)[_0x3f40('0x1a')](_0x308e97);}};}function respondWithFilteredResult(_0x232241,_0x4e28b9){return function(_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=typeof _0x4e28b9['offset']==='undefined'&&typeof _0x4e28b9['limit']===_0x3f40('0x1b');var _0x13b950=_0x2e51ed[_0x3f40('0x1c')];var _0x131e55=_0x3d11c9?0x0:_0x4e28b9[_0x3f40('0x1d')];var _0x5b4ebc=_0x3d11c9?_0x2e51ed[_0x3f40('0x1c')]:_0x4e28b9[_0x3f40('0x1d')]+_0x4e28b9[_0x3f40('0x1e')];var _0x29405a;if(_0x5b4ebc>=_0x13b950){_0x5b4ebc=_0x13b950;_0x29405a=0xc8;}else{_0x29405a=0xce;}_0x232241[_0x3f40('0x18')](_0x29405a);return _0x232241['set'](_0x3f40('0x1f'),_0x131e55+'-'+_0x5b4ebc+'/'+_0x13b950)['json'](_0x2e51ed);}return null;};}function patchUpdates(_0x12aabf){return function(_0x32b945){try{jsonpatch[_0x3f40('0x20')](_0x32b945,_0x12aabf,!![]);}catch(_0x113293){return BPromise[_0x3f40('0x21')](_0x113293);}return _0x32b945['save']();};}function saveUpdates(_0x27f5a5,_0x379b4e){return function(_0x117823){if(_0x117823){return _0x117823[_0x3f40('0x22')](_0x27f5a5)[_0x3f40('0x23')](function(_0xa1f39d){return _0xa1f39d;});}return null;};}function removeEntity(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(_0x59eb32){return _0x59eb32[_0x3f40('0x24')]()['then'](function(){_0x4e1f47[_0x3f40('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b47e,_0x5ae235){return function(_0x4b206b){if(!_0x4b206b){_0x37b47e['sendStatus'](0x194);}return _0x4b206b;};}function handleError(_0x30a945,_0x26e46b){_0x26e46b=_0x26e46b||0x1f4;return function(_0x140044){logger[_0x3f40('0x25')](_0x140044['stack']);if(_0x140044[_0x3f40('0x26')]){delete _0x140044['name'];}_0x30a945[_0x3f40('0x18')](_0x26e46b)[_0x3f40('0x27')](_0x140044);};}exports[_0x3f40('0x28')]=function(_0x5e0f25,_0x287632){var _0x4b5ef7={},_0x1cab5c={},_0x5b9079={'count':0x0,'rows':[]};var _0x49057b=_[_0x3f40('0x29')](db[_0x3f40('0x2a')][_0x3f40('0x2b')],function(_0xb23186){return{'name':_0xb23186[_0x3f40('0x2c')],'type':_0xb23186[_0x3f40('0x2d')][_0x3f40('0x2e')]};});_0x1cab5c[_0x3f40('0x2f')]=_['map'](_0x49057b,_0x3f40('0x26'));_0x1cab5c[_0x3f40('0x30')]=_[_0x3f40('0x31')](_0x5e0f25[_0x3f40('0x30')]);_0x1cab5c[_0x3f40('0x32')]=_['intersection'](_0x1cab5c[_0x3f40('0x2f')],_0x1cab5c[_0x3f40('0x30')]);_0x4b5ef7[_0x3f40('0x33')]=_['intersection'](_0x1cab5c[_0x3f40('0x2f')],qs[_0x3f40('0x34')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x34')]));_0x4b5ef7[_0x3f40('0x33')]=_0x4b5ef7[_0x3f40('0x33')][_0x3f40('0x35')]?_0x4b5ef7[_0x3f40('0x33')]:_0x1cab5c[_0x3f40('0x2f')];if(!_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x36')](_0x3f40('0x37'))){_0x4b5ef7[_0x3f40('0x1e')]=qs[_0x3f40('0x1e')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x1e')]);_0x4b5ef7[_0x3f40('0x1d')]=qs[_0x3f40('0x1d')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x1d')]);}_0x4b5ef7[_0x3f40('0x38')]=qs[_0x3f40('0x39')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x39')]);_0x4b5ef7[_0x3f40('0x3a')]=qs[_0x3f40('0x32')](_[_0x3f40('0x3b')](_0x5e0f25[_0x3f40('0x30')],_0x1cab5c[_0x3f40('0x32')]),_0x49057b);if(_0x5e0f25[_0x3f40('0x30')]['filter']){_0x4b5ef7['where']=_[_0x3f40('0x3c')](_0x4b5ef7[_0x3f40('0x3a')],{'$or':_[_0x3f40('0x29')](_0x49057b,function(_0x4778ec){if(_0x4778ec[_0x3f40('0x2d')]!==_0x3f40('0x3d')){var _0x1ffa33={};_0x1ffa33[_0x4778ec['name']]={'$like':'%'+_0x5e0f25[_0x3f40('0x30')]['filter']+'%'};return _0x1ffa33;}})});}_0x4b5ef7=_[_0x3f40('0x3c')]({},_0x4b5ef7,_0x5e0f25[_0x3f40('0x3e')]);var _0xec24e4={'where':_0x4b5ef7['where']};return db[_0x3f40('0x2a')][_0x3f40('0x1c')](_0xec24e4)['then'](function(_0x1eb15c){_0x5b9079[_0x3f40('0x1c')]=_0x1eb15c;if(_0x5e0f25['query'][_0x3f40('0x3f')]){_0x4b5ef7['include']=[{'all':!![]}];}return db[_0x3f40('0x2a')]['findAll'](_0x4b5ef7);})['then'](function(_0x8e89a){_0x5b9079['rows']=_0x8e89a;return _0x5b9079;})[_0x3f40('0x23')](respondWithFilteredResult(_0x287632,_0x4b5ef7))[_0x3f40('0x40')](handleError(_0x287632,null));};exports[_0x3f40('0x41')]=function(_0x460237,_0x48b65e){var _0x237c91={'raw':!![],'where':{'id':_0x460237[_0x3f40('0x42')]['id']}},_0x5b0eaa={};_0x5b0eaa[_0x3f40('0x2f')]=_[_0x3f40('0x31')](db['FreshdeskField']['rawAttributes']);_0x5b0eaa[_0x3f40('0x30')]=_[_0x3f40('0x31')](_0x460237[_0x3f40('0x30')]);_0x5b0eaa[_0x3f40('0x32')]=_[_0x3f40('0x43')](_0x5b0eaa[_0x3f40('0x2f')],_0x5b0eaa[_0x3f40('0x30')]);_0x237c91[_0x3f40('0x33')]=_['intersection'](_0x5b0eaa[_0x3f40('0x2f')],qs['fields'](_0x460237['query'][_0x3f40('0x34')]));_0x237c91[_0x3f40('0x33')]=_0x237c91[_0x3f40('0x33')][_0x3f40('0x35')]?_0x237c91[_0x3f40('0x33')]:_0x5b0eaa[_0x3f40('0x2f')];if(_0x460237[_0x3f40('0x30')][_0x3f40('0x3f')]){_0x237c91[_0x3f40('0x44')]=[{'all':!![]}];}_0x237c91=_[_0x3f40('0x3c')]({},_0x237c91,_0x460237[_0x3f40('0x3e')]);return db[_0x3f40('0x2a')][_0x3f40('0x45')](_0x237c91)[_0x3f40('0x23')](handleEntityNotFound(_0x48b65e,null))['then'](respondWithResult(_0x48b65e,null))[_0x3f40('0x40')](handleError(_0x48b65e,null));};exports['create']=function(_0x2c1fa2,_0x2f16d6){return db['FreshdeskField'][_0x3f40('0x46')](_0x2c1fa2[_0x3f40('0x47')],{})[_0x3f40('0x23')](respondWithResult(_0x2f16d6,0xc9))[_0x3f40('0x40')](handleError(_0x2f16d6,null));};exports[_0x3f40('0x22')]=function(_0x268ae4,_0x851bfc){if(_0x268ae4[_0x3f40('0x47')]['id']){delete _0x268ae4[_0x3f40('0x47')]['id'];}return db[_0x3f40('0x2a')][_0x3f40('0x45')]({'where':{'id':_0x268ae4[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x851bfc,null))[_0x3f40('0x23')](saveUpdates(_0x268ae4[_0x3f40('0x47')],null))[_0x3f40('0x23')](respondWithResult(_0x851bfc,null))[_0x3f40('0x40')](handleError(_0x851bfc,null));};exports[_0x3f40('0x24')]=function(_0x32bd05,_0x2d7e66){return db[_0x3f40('0x2a')]['find']({'where':{'id':_0x32bd05[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x2d7e66,null))[_0x3f40('0x23')](removeEntity(_0x2d7e66,null))[_0x3f40('0x40')](handleError(_0x2d7e66,null));}; \ No newline at end of file +var _0xaf80=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','includeAll','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x1a50e5,_0x14accb){var _0x53b463=function(_0x12df94){while(--_0x12df94){_0x1a50e5['push'](_0x1a50e5['shift']());}};_0x53b463(++_0x14accb);}(_0xaf80,0x1ef));var _0x0af8=function(_0x19b99a,_0x273506){_0x19b99a=_0x19b99a-0x0;var _0x362e3c=_0xaf80[_0x19b99a];return _0x362e3c;};'use strict';var emlformat=require(_0x0af8('0x0'));var rimraf=require(_0x0af8('0x1'));var zipdir=require(_0x0af8('0x2'));var jsonpatch=require(_0x0af8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0af8('0x4'));var util=require(_0x0af8('0x5'));var path=require(_0x0af8('0x6'));var sox=require(_0x0af8('0x7'));var csv=require(_0x0af8('0x8'));var ejs=require(_0x0af8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0af8('0xa'));var crypto=require('crypto');var jsforce=require(_0x0af8('0xb'));var deskjs=require(_0x0af8('0xc'));var toCsv=require(_0x0af8('0x8'));var querystring=require('querystring');var Papa=require(_0x0af8('0xd'));var Redis=require(_0x0af8('0xe'));var authService=require(_0x0af8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0af8('0x10'));var logger=require(_0x0af8('0x11'))(_0x0af8('0x12'));var utils=require(_0x0af8('0x13'));var config=require(_0x0af8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0af8('0x15'))['db'];function respondWithStatusCode(_0x2d5892,_0x465135){_0x465135=_0x465135||0xcc;return function(_0x31d390){if(_0x31d390){return _0x2d5892[_0x0af8('0x16')](_0x465135);}return _0x2d5892[_0x0af8('0x17')](_0x465135)[_0x0af8('0x18')]();};}function respondWithResult(_0x58a9a8,_0x58ef18){_0x58ef18=_0x58ef18||0xc8;return function(_0x420432){if(_0x420432){return _0x58a9a8[_0x0af8('0x17')](_0x58ef18)[_0x0af8('0x19')](_0x420432);}};}function respondWithFilteredResult(_0x216f0b,_0x2a42a4){return function(_0x1997b8){if(_0x1997b8){var _0x4755cb=typeof _0x2a42a4[_0x0af8('0x1a')]==='undefined'&&typeof _0x2a42a4['limit']==='undefined';var _0x3294ce=_0x1997b8[_0x0af8('0x1b')];var _0x54e946=_0x4755cb?0x0:_0x2a42a4[_0x0af8('0x1a')];var _0x230a68=_0x4755cb?_0x1997b8[_0x0af8('0x1b')]:_0x2a42a4['offset']+_0x2a42a4['limit'];var _0x50b8fa;if(_0x230a68>=_0x3294ce){_0x230a68=_0x3294ce;_0x50b8fa=0xc8;}else{_0x50b8fa=0xce;}_0x216f0b[_0x0af8('0x17')](_0x50b8fa);return _0x216f0b[_0x0af8('0x1c')]('Content-Range',_0x54e946+'-'+_0x230a68+'/'+_0x3294ce)[_0x0af8('0x19')](_0x1997b8);}return null;};}function patchUpdates(_0x4891e6){return function(_0x5cbf28){try{jsonpatch[_0x0af8('0x1d')](_0x5cbf28,_0x4891e6,!![]);}catch(_0x2e0b36){return BPromise[_0x0af8('0x1e')](_0x2e0b36);}return _0x5cbf28[_0x0af8('0x1f')]();};}function saveUpdates(_0x162e95,_0x52778f){return function(_0x592523){if(_0x592523){return _0x592523[_0x0af8('0x20')](_0x162e95)[_0x0af8('0x21')](function(_0x4b0492){return _0x4b0492;});}return null;};}function removeEntity(_0x300474,_0x320d0c){return function(_0x404b25){if(_0x404b25){return _0x404b25[_0x0af8('0x22')]()[_0x0af8('0x21')](function(){_0x300474['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6306,_0x3b2a80){return function(_0x359583){if(!_0x359583){_0x1c6306[_0x0af8('0x16')](0x194);}return _0x359583;};}function handleError(_0x510efc,_0x500fd5){_0x500fd5=_0x500fd5||0x1f4;return function(_0x315ad){logger[_0x0af8('0x23')](_0x315ad[_0x0af8('0x24')]);if(_0x315ad[_0x0af8('0x25')]){delete _0x315ad[_0x0af8('0x25')];}_0x510efc[_0x0af8('0x17')](_0x500fd5)[_0x0af8('0x26')](_0x315ad);};}exports['index']=function(_0x34aa8b,_0xf898cc){var _0x1a7fdf={},_0x20eab4={},_0x1b94cf={'count':0x0,'rows':[]};var _0x231230=_[_0x0af8('0x27')](db[_0x0af8('0x28')][_0x0af8('0x29')],function(_0x270b49){return{'name':_0x270b49[_0x0af8('0x2a')],'type':_0x270b49['type'][_0x0af8('0x2b')]};});_0x20eab4['model']=_[_0x0af8('0x27')](_0x231230,'name');_0x20eab4[_0x0af8('0x2c')]=_[_0x0af8('0x2d')](_0x34aa8b['query']);_0x20eab4[_0x0af8('0x2e')]=_[_0x0af8('0x2f')](_0x20eab4[_0x0af8('0x30')],_0x20eab4['query']);_0x1a7fdf[_0x0af8('0x31')]=_[_0x0af8('0x2f')](_0x20eab4[_0x0af8('0x30')],qs['fields'](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x32')]));_0x1a7fdf[_0x0af8('0x31')]=_0x1a7fdf[_0x0af8('0x31')][_0x0af8('0x33')]?_0x1a7fdf[_0x0af8('0x31')]:_0x20eab4['model'];if(!_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x34')](_0x0af8('0x35'))){_0x1a7fdf[_0x0af8('0x36')]=qs[_0x0af8('0x36')](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x36')]);_0x1a7fdf[_0x0af8('0x1a')]=qs[_0x0af8('0x1a')](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x1a')]);}_0x1a7fdf[_0x0af8('0x37')]=qs['sort'](_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x38')]);_0x1a7fdf[_0x0af8('0x39')]=qs[_0x0af8('0x2e')](_[_0x0af8('0x3a')](_0x34aa8b[_0x0af8('0x2c')],_0x20eab4[_0x0af8('0x2e')]),_0x231230);if(_0x34aa8b['query'][_0x0af8('0x3b')]){_0x1a7fdf[_0x0af8('0x39')]=_[_0x0af8('0x3c')](_0x1a7fdf['where'],{'$or':_[_0x0af8('0x27')](_0x231230,function(_0x1082de){if(_0x1082de[_0x0af8('0x3d')]!=='VIRTUAL'){var _0x6781fe={};_0x6781fe[_0x1082de[_0x0af8('0x25')]]={'$like':'%'+_0x34aa8b[_0x0af8('0x2c')][_0x0af8('0x3b')]+'%'};return _0x6781fe;}})});}_0x1a7fdf=_[_0x0af8('0x3c')]({},_0x1a7fdf,_0x34aa8b[_0x0af8('0x3e')]);var _0x258872={'where':_0x1a7fdf['where']};return db['FreshdeskField'][_0x0af8('0x1b')](_0x258872)[_0x0af8('0x21')](function(_0x5bc8f5){_0x1b94cf[_0x0af8('0x1b')]=_0x5bc8f5;if(_0x34aa8b[_0x0af8('0x2c')]['includeAll']){_0x1a7fdf[_0x0af8('0x3f')]=[{'all':!![]}];}return db['FreshdeskField'][_0x0af8('0x40')](_0x1a7fdf);})[_0x0af8('0x21')](function(_0x510bec){_0x1b94cf[_0x0af8('0x41')]=_0x510bec;return _0x1b94cf;})[_0x0af8('0x21')](respondWithFilteredResult(_0xf898cc,_0x1a7fdf))['catch'](handleError(_0xf898cc,null));};exports[_0x0af8('0x42')]=function(_0x496ea4,_0x2e15ec){var _0x423eee={'raw':!![],'where':{'id':_0x496ea4['params']['id']}},_0x141d2f={};_0x141d2f['model']=_[_0x0af8('0x2d')](db[_0x0af8('0x28')][_0x0af8('0x29')]);_0x141d2f[_0x0af8('0x2c')]=_['keys'](_0x496ea4[_0x0af8('0x2c')]);_0x141d2f[_0x0af8('0x2e')]=_[_0x0af8('0x2f')](_0x141d2f['model'],_0x141d2f[_0x0af8('0x2c')]);_0x423eee[_0x0af8('0x31')]=_['intersection'](_0x141d2f[_0x0af8('0x30')],qs['fields'](_0x496ea4[_0x0af8('0x2c')]['fields']));_0x423eee['attributes']=_0x423eee['attributes'][_0x0af8('0x33')]?_0x423eee['attributes']:_0x141d2f[_0x0af8('0x30')];if(_0x496ea4['query'][_0x0af8('0x43')]){_0x423eee[_0x0af8('0x3f')]=[{'all':!![]}];}_0x423eee=_[_0x0af8('0x3c')]({},_0x423eee,_0x496ea4[_0x0af8('0x3e')]);return db[_0x0af8('0x28')]['find'](_0x423eee)['then'](handleEntityNotFound(_0x2e15ec,null))[_0x0af8('0x21')](respondWithResult(_0x2e15ec,null))[_0x0af8('0x44')](handleError(_0x2e15ec,null));};exports[_0x0af8('0x45')]=function(_0x24a104,_0x3d86e2){return db[_0x0af8('0x28')][_0x0af8('0x45')](_0x24a104['body'],{})['then'](respondWithResult(_0x3d86e2,0xc9))[_0x0af8('0x44')](handleError(_0x3d86e2,null));};exports[_0x0af8('0x20')]=function(_0x394525,_0x3c57dd){if(_0x394525['body']['id']){delete _0x394525[_0x0af8('0x46')]['id'];}return db[_0x0af8('0x28')][_0x0af8('0x47')]({'where':{'id':_0x394525[_0x0af8('0x48')]['id']}})[_0x0af8('0x21')](handleEntityNotFound(_0x3c57dd,null))[_0x0af8('0x21')](saveUpdates(_0x394525['body'],null))[_0x0af8('0x21')](respondWithResult(_0x3c57dd,null))['catch'](handleError(_0x3c57dd,null));};exports[_0x0af8('0x22')]=function(_0x4a43e3,_0xeddce9){return db[_0x0af8('0x28')][_0x0af8('0x47')]({'where':{'id':_0x4a43e3['params']['id']}})[_0x0af8('0x21')](handleEntityNotFound(_0xeddce9,null))[_0x0af8('0x21')](removeEntity(_0xeddce9,null))['catch'](handleError(_0xeddce9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6701527..1b8b367 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 _0xd240=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util'];(function(_0x322177,_0x4a29c4){var _0x357c57=function(_0x5114c9){while(--_0x5114c9){_0x322177['push'](_0x322177['shift']());}};_0x357c57(++_0x4a29c4);}(_0xd240,0x1c7));var _0x0d24=function(_0x52f938,_0x1d2c50){_0x52f938=_0x52f938-0x0;var _0x1be631=_0xd240[_0x52f938];return _0x1be631;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0d24('0x1'));var BPromise=require(_0x0d24('0x2'));var rp=require(_0x0d24('0x3'));var fs=require('fs');var path=require(_0x0d24('0x4'));var rimraf=require(_0x0d24('0x5'));var config=require(_0x0d24('0x6'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x30fbee,_0x2accfe){return _0x30fbee[_0x0d24('0x7')](_0x0d24('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x0d24('0x9'),'fields':[_0x0d24('0xa'),_0x0d24('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31c2=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','api','moment','request-promise'];(function(_0x320f5c,_0x2ed07f){var _0x1da3d0=function(_0x4537f9){while(--_0x4537f9){_0x320f5c['push'](_0x320f5c['shift']());}};_0x1da3d0(++_0x2ed07f);}(_0x31c2,0x98));var _0x231c=function(_0x37fbf0,_0x6bcd70){_0x37fbf0=_0x37fbf0-0x0;var _0x17aa9e=_0x31c2[_0x37fbf0];return _0x17aa9e;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x231c('0x1'));var moment=require(_0x231c('0x2'));var BPromise=require('bluebird');var rp=require(_0x231c('0x3'));var fs=require('fs');var path=require(_0x231c('0x4'));var rimraf=require(_0x231c('0x5'));var config=require(_0x231c('0x6'));var attributes=require(_0x231c('0x7'));module[_0x231c('0x8')]=function(_0x21b4df,_0x4442b9){return _0x21b4df['define'](_0x231c('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x231c('0xa'),'fields':[_0x231c('0xb'),_0x231c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index d848689..a353d0f 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 _0xe64c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment'];(function(_0x4635e5,_0x5590a9){var _0x5a187b=function(_0x4e4f0c){while(--_0x4e4f0c){_0x4635e5['push'](_0x4635e5['shift']());}};_0x5a187b(++_0x5590a9);}(_0xe64c,0x112));var _0xce64=function(_0x5b1a7c,_0x17dd34){_0x5b1a7c=_0x5b1a7c-0x0;var _0x17250e=_0xe64c[_0x5b1a7c];return _0x17250e;};'use strict';var _=require('lodash');var util=require(_0xce64('0x0'));var moment=require(_0xce64('0x1'));var BPromise=require(_0xce64('0x2'));var rs=require(_0xce64('0x3'));var fs=require('fs');var Redis=require(_0xce64('0x4'));var db=require(_0xce64('0x5'))['db'];var utils=require(_0xce64('0x6'));var logger=require(_0xce64('0x7'))(_0xce64('0x8'));var config=require(_0xce64('0x9'));var jayson=require(_0xce64('0xa'));var client=jayson[_0xce64('0xb')][_0xce64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a2118,_0x524561,_0x239c89){return new BPromise(function(_0x551b35,_0x563dc4){return client[_0xce64('0xd')](_0x5a2118,_0x239c89)[_0xce64('0xe')](function(_0x3ef71e){logger[_0xce64('0xf')](_0xce64('0x10'),_0x524561,'request\x20sent');logger['debug'](_0xce64('0x11'),_0x524561,_0xce64('0x12'),JSON['stringify'](_0x3ef71e));if(_0x3ef71e[_0xce64('0x13')]){if(_0x3ef71e['error'][_0xce64('0x14')]===0x1f4){logger[_0xce64('0x13')](_0xce64('0x10'),_0x524561,_0x3ef71e[_0xce64('0x13')][_0xce64('0x15')]);return _0x563dc4(_0x3ef71e['error'][_0xce64('0x15')]);}logger[_0xce64('0x13')](_0xce64('0x10'),_0x524561,_0x3ef71e[_0xce64('0x13')][_0xce64('0x15')]);return _0x551b35(_0x3ef71e[_0xce64('0x13')]['message']);}else{logger['info'](_0xce64('0x10'),_0x524561,'request\x20sent');_0x551b35(_0x3ef71e[_0xce64('0x16')]['message']);}})['catch'](function(_0x1158e3){logger[_0xce64('0x13')](_0xce64('0x10'),_0x524561,_0x1158e3);_0x563dc4(_0x1158e3);});});} \ No newline at end of file +var _0xddb7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','lodash','util','bluebird'];(function(_0x28ff00,_0x3308ee){var _0x42ba1b=function(_0x117b53){while(--_0x117b53){_0x28ff00['push'](_0x28ff00['shift']());}};_0x42ba1b(++_0x3308ee);}(_0xddb7,0x174));var _0x7ddb=function(_0x3b1504,_0x464acd){_0x3b1504=_0x3b1504-0x0;var _0x1df980=_0xddb7[_0x3b1504];return _0x1df980;};'use strict';var _=require(_0x7ddb('0x0'));var util=require(_0x7ddb('0x1'));var moment=require('moment');var BPromise=require(_0x7ddb('0x2'));var rs=require(_0x7ddb('0x3'));var fs=require('fs');var Redis=require(_0x7ddb('0x4'));var db=require(_0x7ddb('0x5'))['db'];var utils=require(_0x7ddb('0x6'));var logger=require(_0x7ddb('0x7'))(_0x7ddb('0x8'));var config=require(_0x7ddb('0x9'));var jayson=require(_0x7ddb('0xa'));var client=jayson[_0x7ddb('0xb')][_0x7ddb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c5039,_0x46e3fb,_0xd9b413){return new BPromise(function(_0x5cc4d9,_0x1b3fd1){return client[_0x7ddb('0xd')](_0x4c5039,_0xd9b413)[_0x7ddb('0xe')](function(_0x4990f5){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x46e3fb,'request\x20sent');logger[_0x7ddb('0xf')](_0x7ddb('0x10'),_0x46e3fb,_0x7ddb('0x11'),JSON[_0x7ddb('0x12')](_0x4990f5));if(_0x4990f5[_0x7ddb('0x13')]){if(_0x4990f5[_0x7ddb('0x13')][_0x7ddb('0x14')]===0x1f4){logger[_0x7ddb('0x13')](_0x7ddb('0x15'),_0x46e3fb,_0x4990f5[_0x7ddb('0x13')][_0x7ddb('0x16')]);return _0x1b3fd1(_0x4990f5[_0x7ddb('0x13')][_0x7ddb('0x16')]);}logger[_0x7ddb('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x46e3fb,_0x4990f5[_0x7ddb('0x13')][_0x7ddb('0x16')]);return _0x5cc4d9(_0x4990f5[_0x7ddb('0x13')]['message']);}else{logger[_0x7ddb('0x17')](_0x7ddb('0x15'),_0x46e3fb,_0x7ddb('0x11'));_0x5cc4d9(_0x4990f5[_0x7ddb('0x18')][_0x7ddb('0x16')]);}})['catch'](function(_0x42922c){logger['error'](_0x7ddb('0x15'),_0x46e3fb,_0x42922c);_0x1b3fd1(_0x42922c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e510586..1c30c5e 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 _0x1339=['/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x57914d,_0x59213b){var _0x15989f=function(_0x482fbe){while(--_0x482fbe){_0x57914d['push'](_0x57914d['shift']());}};_0x15989f(++_0x59213b);}(_0x1339,0x1ed));var _0x9133=function(_0x1a655e,_0x4f2b76){_0x1a655e=_0x1a655e-0x0;var _0x124559=_0x1339[_0x1a655e];return _0x124559;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0x8')](_0x9133('0xf'),auth[_0x9133('0x9')](),controller['getFields']);router[_0x9133('0x10')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x10')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['addConfiguration']);router[_0x9133('0x12')](_0x9133('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9133('0x13')]('/:id',auth[_0x9133('0x9')](),controller[_0x9133('0x14')]);module[_0x9133('0x15')]=router; \ No newline at end of file +var _0x9348=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x9348,0x10d));var _0x8934=function(_0x536d83,_0x4b52ee){_0x536d83=_0x536d83-0x0;var _0x7bacbe=_0x9348[_0x536d83];return _0x7bacbe;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0xf')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);router[_0x8934('0xf')](_0x8934('0x11'),auth[_0x8934('0xa')](),controller[_0x8934('0x12')]);router['put'](_0x8934('0x13'),auth[_0x8934('0xa')](),controller[_0x8934('0x14')]);router[_0x8934('0x15')](_0x8934('0x13'),auth[_0x8934('0xa')](),controller['destroy']);module[_0x8934('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f5e056c..39cf331 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 _0x25e7=['sequelize','exports','STRING','username','remoteUri'];(function(_0x282186,_0x433534){var _0x445ef5=function(_0x410099){while(--_0x410099){_0x282186['push'](_0x282186['shift']());}};_0x445ef5(++_0x433534);}(_0x25e7,0x1d6));var _0x725e=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x25e7[_0x44ceee];return _0x1a065c;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'name':{'type':Sequelize[_0x725e('0x2')]},'description':{'type':Sequelize[_0x725e('0x2')]},'username':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x3')},'apiKey':{'type':Sequelize[_0x725e('0x2')]},'remoteUri':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x4')},'serverUrl':{'type':Sequelize[_0x725e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xb016,0x159));var _0x6b01=function(_0x32e0b9,_0x5d8af6){_0x32e0b9=_0x32e0b9-0x0;var _0x5d36e7=_0xb016[_0x32e0b9];return _0x5d36e7;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('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 2f8d06b..72e8159 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 _0xa7c9=['AccountId','Subjects','channel','FreshsalesField','Descriptions','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','keys','options','find','catch','create','body','update','params','getConfigurations','findOne','FreshsalesConfiguration','order','pick','addConfiguration'];(function(_0x42c48c,_0x1e5cc5){var _0x16860a=function(_0xd5d8e8){while(--_0xd5d8e8){_0x42c48c['push'](_0x42c48c['shift']());}};_0x16860a(++_0x1e5cc5);}(_0xa7c9,0x7e));var _0x9a7c=function(_0xb6fb4e,_0x53444b){_0xb6fb4e=_0xb6fb4e-0x0;var _0x1c8b0f=_0xa7c9[_0xb6fb4e];return _0x1c8b0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a7c('0x1'));var moment=require(_0x9a7c('0x2'));var BPromise=require(_0x9a7c('0x3'));var Mustache=require(_0x9a7c('0x4'));var util=require(_0x9a7c('0x5'));var path=require(_0x9a7c('0x6'));var sox=require(_0x9a7c('0x7'));var csv=require(_0x9a7c('0x8'));var ejs=require(_0x9a7c('0x9'));var fs=require('fs');var fs_extra=require(_0x9a7c('0xa'));var _=require(_0x9a7c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a7c('0xc'));var toCsv=require(_0x9a7c('0x8'));var querystring=require(_0x9a7c('0xd'));var Papa=require(_0x9a7c('0xe'));var Redis=require(_0x9a7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9a7c('0x10'));var as=require(_0x9a7c('0x11'));var hardwareService=require(_0x9a7c('0x12'));var logger=require('../../config/logger')(_0x9a7c('0x13'));var utils=require(_0x9a7c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a7c('0x15'));var db=require(_0x9a7c('0x16'))['db'];var integrations=require(_0x9a7c('0x17'));function respondWithStatusCode(_0x358297,_0x30ec30){_0x30ec30=_0x30ec30||0xcc;return function(_0x5fe91c){if(_0x5fe91c){return _0x358297[_0x9a7c('0x18')](_0x30ec30);}return _0x358297[_0x9a7c('0x19')](_0x30ec30)[_0x9a7c('0x1a')]();};}function respondWithResult(_0x4a8b92,_0x32f412){_0x32f412=_0x32f412||0xc8;return function(_0x477893){if(_0x477893){return _0x4a8b92['status'](_0x32f412)['json'](_0x477893);}};}function respondWithFilteredResult(_0x4a128b,_0x4090a2){return function(_0x481048){if(_0x481048){var _0x3c840f=typeof _0x4090a2[_0x9a7c('0x1b')]===_0x9a7c('0x1c')&&typeof _0x4090a2[_0x9a7c('0x1d')]===_0x9a7c('0x1c');var _0x3163ed=_0x481048[_0x9a7c('0x1e')];var _0x2315bc=_0x3c840f?0x0:_0x4090a2[_0x9a7c('0x1b')];var _0x16ecb3=_0x3c840f?_0x481048[_0x9a7c('0x1e')]:_0x4090a2[_0x9a7c('0x1b')]+_0x4090a2['limit'];var _0x24ee60;if(_0x16ecb3>=_0x3163ed){_0x16ecb3=_0x3163ed;_0x24ee60=0xc8;}else{_0x24ee60=0xce;}_0x4a128b[_0x9a7c('0x19')](_0x24ee60);return _0x4a128b[_0x9a7c('0x1f')](_0x9a7c('0x20'),_0x2315bc+'-'+_0x16ecb3+'/'+_0x3163ed)[_0x9a7c('0x21')](_0x481048);}return null;};}function patchUpdates(_0x3cd9e4){return function(_0x56e522){try{jsonpatch[_0x9a7c('0x22')](_0x56e522,_0x3cd9e4,!![]);}catch(_0x5dd3a9){return BPromise[_0x9a7c('0x23')](_0x5dd3a9);}return _0x56e522[_0x9a7c('0x24')]();};}function saveUpdates(_0x3872f2,_0x1190b1){return function(_0x2d343f){if(_0x2d343f){return _0x2d343f['update'](_0x3872f2)[_0x9a7c('0x25')](function(_0x46b55f){return _0x46b55f;});}return null;};}function removeEntity(_0x3132c0,_0x14b838){return function(_0x4c6ece){if(_0x4c6ece){return _0x4c6ece[_0x9a7c('0x26')]()[_0x9a7c('0x25')](function(){_0x3132c0[_0x9a7c('0x19')](0xcc)[_0x9a7c('0x1a')]();});}};}function handleEntityNotFound(_0x15ae91,_0x131b42){return function(_0x38a930){if(!_0x38a930){_0x15ae91[_0x9a7c('0x18')](0x194);}return _0x38a930;};}function handleError(_0x23d3c9,_0x3f31d0){_0x3f31d0=_0x3f31d0||0x1f4;return function(_0xd68559){logger['error'](_0xd68559['stack']);if(_0xd68559['name']){delete _0xd68559[_0x9a7c('0x27')];}_0x23d3c9['status'](_0x3f31d0)[_0x9a7c('0x28')](_0xd68559);};}exports['index']=function(_0x303096,_0x3f36a0){var _0x4b04a7={},_0xeeb377={},_0x35fe08={'count':0x0,'rows':[]};var _0x2ac842=_[_0x9a7c('0x29')](db[_0x9a7c('0x2a')][_0x9a7c('0x2b')],function(_0x2d5ff9){return{'name':_0x2d5ff9[_0x9a7c('0x2c')],'type':_0x2d5ff9[_0x9a7c('0x2d')][_0x9a7c('0x2e')]};});_0xeeb377[_0x9a7c('0x2f')]=_[_0x9a7c('0x29')](_0x2ac842,_0x9a7c('0x27'));_0xeeb377[_0x9a7c('0x30')]=_['keys'](_0x303096['query']);_0xeeb377[_0x9a7c('0x31')]=_[_0x9a7c('0x32')](_0xeeb377[_0x9a7c('0x2f')],_0xeeb377['query']);_0x4b04a7['attributes']=_['intersection'](_0xeeb377['model'],qs[_0x9a7c('0x33')](_0x303096['query'][_0x9a7c('0x33')]));_0x4b04a7[_0x9a7c('0x34')]=_0x4b04a7[_0x9a7c('0x34')][_0x9a7c('0x35')]?_0x4b04a7[_0x9a7c('0x34')]:_0xeeb377[_0x9a7c('0x2f')];if(!_0x303096[_0x9a7c('0x30')][_0x9a7c('0x36')](_0x9a7c('0x37'))){_0x4b04a7['limit']=qs[_0x9a7c('0x1d')](_0x303096[_0x9a7c('0x30')][_0x9a7c('0x1d')]);_0x4b04a7[_0x9a7c('0x1b')]=qs[_0x9a7c('0x1b')](_0x303096[_0x9a7c('0x30')]['offset']);}_0x4b04a7['order']=qs[_0x9a7c('0x38')](_0x303096['query'][_0x9a7c('0x38')]);_0x4b04a7[_0x9a7c('0x39')]=qs[_0x9a7c('0x31')](_['pick'](_0x303096[_0x9a7c('0x30')],_0xeeb377['filters']),_0x2ac842);if(_0x303096[_0x9a7c('0x30')][_0x9a7c('0x3a')]){_0x4b04a7[_0x9a7c('0x39')]=_['merge'](_0x4b04a7[_0x9a7c('0x39')],{'$or':_[_0x9a7c('0x29')](_0x2ac842,function(_0x3f9856){if(_0x3f9856['type']!==_0x9a7c('0x3b')){var _0x500e62={};_0x500e62[_0x3f9856[_0x9a7c('0x27')]]={'$like':'%'+_0x303096['query'][_0x9a7c('0x3a')]+'%'};return _0x500e62;}})});}_0x4b04a7=_[_0x9a7c('0x3c')]({},_0x4b04a7,_0x303096['options']);var _0x3f5029={'where':_0x4b04a7['where']};return db[_0x9a7c('0x2a')][_0x9a7c('0x1e')](_0x3f5029)[_0x9a7c('0x25')](function(_0xe0144c){_0x35fe08[_0x9a7c('0x1e')]=_0xe0144c;if(_0x303096['query'][_0x9a7c('0x3d')]){_0x4b04a7['include']=[{'all':!![]}];}return db[_0x9a7c('0x2a')][_0x9a7c('0x3e')](_0x4b04a7);})['then'](function(_0x1a4beb){_0x35fe08[_0x9a7c('0x3f')]=_0x1a4beb;return _0x35fe08;})[_0x9a7c('0x25')](respondWithFilteredResult(_0x3f36a0,_0x4b04a7))['catch'](handleError(_0x3f36a0,null));};exports['show']=function(_0x28a98f,_0x2b49b9){var _0x4a17ea={'raw':![],'where':{'id':_0x28a98f['params']['id']}},_0x1c6783={};_0x1c6783[_0x9a7c('0x2f')]=_[_0x9a7c('0x40')](db[_0x9a7c('0x2a')][_0x9a7c('0x2b')]);_0x1c6783[_0x9a7c('0x30')]=_[_0x9a7c('0x40')](_0x28a98f[_0x9a7c('0x30')]);_0x1c6783[_0x9a7c('0x31')]=_[_0x9a7c('0x32')](_0x1c6783[_0x9a7c('0x2f')],_0x1c6783[_0x9a7c('0x30')]);_0x4a17ea[_0x9a7c('0x34')]=_['intersection'](_0x1c6783[_0x9a7c('0x2f')],qs[_0x9a7c('0x33')](_0x28a98f[_0x9a7c('0x30')]['fields']));_0x4a17ea['attributes']=_0x4a17ea[_0x9a7c('0x34')][_0x9a7c('0x35')]?_0x4a17ea[_0x9a7c('0x34')]:_0x1c6783[_0x9a7c('0x2f')];if(_0x28a98f['query'][_0x9a7c('0x3d')]){_0x4a17ea['include']=[{'all':!![]}];}_0x4a17ea=_[_0x9a7c('0x3c')]({},_0x4a17ea,_0x28a98f[_0x9a7c('0x41')]);return db[_0x9a7c('0x2a')][_0x9a7c('0x42')](_0x4a17ea)[_0x9a7c('0x25')](handleEntityNotFound(_0x2b49b9,null))['then'](respondWithResult(_0x2b49b9,null))[_0x9a7c('0x43')](handleError(_0x2b49b9,null));};exports['create']=function(_0x32c159,_0x4cea3c){return db[_0x9a7c('0x2a')][_0x9a7c('0x44')](_0x32c159[_0x9a7c('0x45')],{})['then'](respondWithResult(_0x4cea3c,0xc9))[_0x9a7c('0x43')](handleError(_0x4cea3c,null));};exports[_0x9a7c('0x46')]=function(_0x4c095e,_0x926a70){if(_0x4c095e[_0x9a7c('0x45')]['id']){delete _0x4c095e[_0x9a7c('0x45')]['id'];}return db[_0x9a7c('0x2a')][_0x9a7c('0x42')]({'where':{'id':_0x4c095e[_0x9a7c('0x47')]['id']}})['then'](handleEntityNotFound(_0x926a70,null))[_0x9a7c('0x25')](saveUpdates(_0x4c095e[_0x9a7c('0x45')],null))[_0x9a7c('0x25')](respondWithResult(_0x926a70,null))['catch'](handleError(_0x926a70,null));};exports[_0x9a7c('0x26')]=function(_0xd947d2,_0x472315){return db[_0x9a7c('0x2a')][_0x9a7c('0x42')]({'where':{'id':_0xd947d2['params']['id']}})[_0x9a7c('0x25')](handleEntityNotFound(_0x472315,null))[_0x9a7c('0x25')](removeEntity(_0x472315,null))['catch'](handleError(_0x472315,null));};exports[_0x9a7c('0x48')]=function(_0x3ba5b1,_0x633948,_0x204328){var _0x532552={};var _0x5d1190={};var _0x5a84bf;var _0x29af61;return db[_0x9a7c('0x2a')][_0x9a7c('0x49')]({'where':{'id':_0x3ba5b1[_0x9a7c('0x47')]['id']}})['then'](handleEntityNotFound(_0x633948,null))[_0x9a7c('0x25')](function(_0x4af9eb){if(_0x4af9eb){_0x5a84bf=_0x4af9eb;_0x5d1190[_0x9a7c('0x2f')]=_[_0x9a7c('0x40')](db[_0x9a7c('0x4a')]['rawAttributes']);_0x5d1190[_0x9a7c('0x30')]=_[_0x9a7c('0x40')](_0x3ba5b1[_0x9a7c('0x30')]);_0x5d1190[_0x9a7c('0x31')]=_[_0x9a7c('0x32')](_0x5d1190[_0x9a7c('0x2f')],_0x5d1190[_0x9a7c('0x30')]);_0x532552[_0x9a7c('0x34')]=_[_0x9a7c('0x32')](_0x5d1190[_0x9a7c('0x2f')],qs[_0x9a7c('0x33')](_0x3ba5b1[_0x9a7c('0x30')][_0x9a7c('0x33')]));_0x532552[_0x9a7c('0x34')]=_0x532552[_0x9a7c('0x34')][_0x9a7c('0x35')]?_0x532552[_0x9a7c('0x34')]:_0x5d1190['model'];_0x532552[_0x9a7c('0x4b')]=qs['sort'](_0x3ba5b1[_0x9a7c('0x30')][_0x9a7c('0x38')]);_0x532552[_0x9a7c('0x39')]=qs[_0x9a7c('0x31')](_[_0x9a7c('0x4c')](_0x3ba5b1[_0x9a7c('0x30')],_0x5d1190['filters']));if(_0x3ba5b1[_0x9a7c('0x30')][_0x9a7c('0x3a')]){_0x532552[_0x9a7c('0x39')]=_[_0x9a7c('0x3c')](_0x532552[_0x9a7c('0x39')],{'$or':_[_0x9a7c('0x29')](_0x532552[_0x9a7c('0x34')],function(_0x2063f6){var _0x27b968={};_0x27b968[_0x2063f6]={'$like':'%'+_0x3ba5b1[_0x9a7c('0x30')][_0x9a7c('0x3a')]+'%'};return _0x27b968;})});}_0x532552=_[_0x9a7c('0x3c')]({},_0x532552,_0x3ba5b1['options']);return _0x5a84bf[_0x9a7c('0x48')](_0x532552);}})[_0x9a7c('0x25')](function(_0x484135){if(_0x484135){_0x29af61=_0x484135['length'];if(!_0x3ba5b1['query'][_0x9a7c('0x36')](_0x9a7c('0x37'))){_0x532552[_0x9a7c('0x1d')]=qs[_0x9a7c('0x1d')](_0x3ba5b1['query'][_0x9a7c('0x1d')]);_0x532552[_0x9a7c('0x1b')]=qs['offset'](_0x3ba5b1[_0x9a7c('0x30')]['offset']);}return _0x5a84bf['getConfigurations'](_0x532552);}})[_0x9a7c('0x25')](function(_0x26723f){if(_0x26723f){return _0x26723f?{'count':_0x29af61,'rows':_0x26723f}:null;}})[_0x9a7c('0x25')](respondWithResult(_0x633948,null))['catch'](handleError(_0x633948,null));};exports[_0x9a7c('0x4d')]=function(_0x4339cd,_0x1fb135,_0x245581){if(_0x4339cd[_0x9a7c('0x45')]['id']){delete _0x4339cd[_0x9a7c('0x45')]['id'];}return db[_0x9a7c('0x2a')]['findOne']({'where':{'id':_0x4339cd[_0x9a7c('0x47')]['id']}})[_0x9a7c('0x25')](handleEntityNotFound(_0x1fb135,null))[_0x9a7c('0x25')](function(_0x586f95){if(_0x586f95){_0x4339cd['body'][_0x9a7c('0x4e')]=_0x586f95['id'];_0x4339cd['body'][_0x9a7c('0x4f')]=integrations['getSubjects'](_0x4339cd[_0x9a7c('0x45')]['channel'],_0x4339cd[_0x9a7c('0x45')][_0x9a7c('0x2d')]);_0x4339cd[_0x9a7c('0x45')]['Descriptions']=integrations['getDescriptions'](_0x4339cd['body'][_0x9a7c('0x50')],_0x4339cd[_0x9a7c('0x45')][_0x9a7c('0x2d')]);return db[_0x9a7c('0x4a')][_0x9a7c('0x44')](_0x4339cd[_0x9a7c('0x45')],{'include':[{'model':db[_0x9a7c('0x51')],'as':_0x9a7c('0x4f')},{'model':db[_0x9a7c('0x51')],'as':_0x9a7c('0x52')}]});}return null;})[_0x9a7c('0x25')](respondWithResult(_0x1fb135,null))['catch'](handleError(_0x1fb135,null));};exports[_0x9a7c('0x53')]=function(_0xc5938a,_0x5d612b,_0x43ae22){var _0x10fceb='';var _0x220be2='';return db[_0x9a7c('0x2a')][_0x9a7c('0x49')]({'where':{'id':_0xc5938a[_0x9a7c('0x47')]['id']},'attributes':['id',_0x9a7c('0x54'),_0x9a7c('0x55'),'apiKey']})['then'](handleEntityNotFound(_0x5d612b,null))[_0x9a7c('0x25')](function(_0x18d177){if(_0x18d177){_0x220be2=_0x18d177[_0x9a7c('0x54')];_0x10fceb=_0x18d177[_0x9a7c('0x55')];var _0x5236dc=_0x18d177[_0x9a7c('0x55')][_0x9a7c('0x56')](-0x1);if(_0x5236dc==='/'){_0x10fceb=_0x10fceb[_0x9a7c('0x57')](0x0,_0x10fceb[_0x9a7c('0x58')](_0x5236dc));}return rp({'method':_0x9a7c('0x59'),'uri':util[_0x9a7c('0x5a')](_0x9a7c('0x5b'),_0x10fceb,_0x9a7c('0x5c')),'headers':{'Authorization':_0x9a7c('0x5d')+_0x18d177[_0x9a7c('0x5e')]},'json':!![]});}})['then'](function(_0x23eb08){if(_0x23eb08){var _0x5cf736=_0x23eb08['users'];var _0x2a2165=![];var _0x329660=null;for(_0x329660=0x0;_0x329660<_0x5cf736[_0x9a7c('0x35')];_0x329660++){if(_0x5cf736[_0x329660][_0x9a7c('0x5f')]===_0x220be2){_0x2a2165=!![];}}if(_0x2a2165){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9a7c('0x60')});}}})[_0x9a7c('0x25')](respondWithResult(_0x5d612b,null))[_0x9a7c('0x43')](function(_0xbf7e21){var _0x198fbf=_0xc5938a[_0x9a7c('0x30')][_0x9a7c('0x61')]?0x1f4:_0xbf7e21[_0x9a7c('0x62')]||0x1f4;logger[_0x9a7c('0x63')](_0x9a7c('0x64'),_0x9a7c('0x53'),_0x198fbf,JSON[_0x9a7c('0x65')](_0xbf7e21));delete _0xbf7e21[_0x9a7c('0x27')];if(_0x198fbf===0x191){_0x198fbf=0x190;}_0x5d612b[_0x9a7c('0x19')](_0x198fbf)[_0x9a7c('0x28')](_0xc5938a['query'][_0x9a7c('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0xbf7e21[_0x9a7c('0x62')]}:_0xbf7e21);});}; \ No newline at end of file +var _0x0299=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesAccount','includeAll','include','rows','show','length','find','catch','create','body','update','params','FreshsalesConfiguration','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','findOne','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','test','Wrong\x20credentials','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0299,0x15d));var _0x9029=function(_0x521e37,_0x559d0d){_0x521e37=_0x521e37-0x0;var _0x7eaace=_0x0299[_0x521e37];return _0x7eaace;};'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(_0x9029('0x0'));var moment=require('moment');var BPromise=require(_0x9029('0x1'));var Mustache=require(_0x9029('0x2'));var util=require(_0x9029('0x3'));var path=require(_0x9029('0x4'));var sox=require(_0x9029('0x5'));var csv=require(_0x9029('0x6'));var ejs=require(_0x9029('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9029('0x8'));var squel=require(_0x9029('0x9'));var crypto=require(_0x9029('0xa'));var jsforce=require(_0x9029('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9029('0x6'));var querystring=require(_0x9029('0xc'));var Papa=require(_0x9029('0xd'));var Redis=require(_0x9029('0xe'));var authService=require(_0x9029('0xf'));var qs=require(_0x9029('0x10'));var as=require(_0x9029('0x11'));var hardwareService=require(_0x9029('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9029('0x13'));var config=require(_0x9029('0x14'));var licenseUtil=require(_0x9029('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9029('0x16'));function respondWithStatusCode(_0x548ff8,_0x38bb83){_0x38bb83=_0x38bb83||0xcc;return function(_0x126275){if(_0x126275){return _0x548ff8[_0x9029('0x17')](_0x38bb83);}return _0x548ff8[_0x9029('0x18')](_0x38bb83)[_0x9029('0x19')]();};}function respondWithResult(_0x3878ce,_0x53ee60){_0x53ee60=_0x53ee60||0xc8;return function(_0x5b51e0){if(_0x5b51e0){return _0x3878ce[_0x9029('0x18')](_0x53ee60)[_0x9029('0x1a')](_0x5b51e0);}};}function respondWithFilteredResult(_0xc5319f,_0x3625e9){return function(_0xe21b41){if(_0xe21b41){var _0xa3620c=typeof _0x3625e9[_0x9029('0x1b')]==='undefined'&&typeof _0x3625e9[_0x9029('0x1c')]===_0x9029('0x1d');var _0x3c5a41=_0xe21b41[_0x9029('0x1e')];var _0x3f0c56=_0xa3620c?0x0:_0x3625e9[_0x9029('0x1b')];var _0x43de3c=_0xa3620c?_0xe21b41[_0x9029('0x1e')]:_0x3625e9[_0x9029('0x1b')]+_0x3625e9[_0x9029('0x1c')];var _0x3285fb;if(_0x43de3c>=_0x3c5a41){_0x43de3c=_0x3c5a41;_0x3285fb=0xc8;}else{_0x3285fb=0xce;}_0xc5319f[_0x9029('0x18')](_0x3285fb);return _0xc5319f[_0x9029('0x1f')](_0x9029('0x20'),_0x3f0c56+'-'+_0x43de3c+'/'+_0x3c5a41)['json'](_0xe21b41);}return null;};}function patchUpdates(_0x33fcd0){return function(_0x62258c){try{jsonpatch[_0x9029('0x21')](_0x62258c,_0x33fcd0,!![]);}catch(_0x964a98){return BPromise['reject'](_0x964a98);}return _0x62258c[_0x9029('0x22')]();};}function saveUpdates(_0x17c83f,_0x2818d7){return function(_0x33d3cc){if(_0x33d3cc){return _0x33d3cc['update'](_0x17c83f)[_0x9029('0x23')](function(_0x445fe0){return _0x445fe0;});}return null;};}function removeEntity(_0x5901ab,_0x3fba2d){return function(_0xe9c4fd){if(_0xe9c4fd){return _0xe9c4fd['destroy']()[_0x9029('0x23')](function(){_0x5901ab['status'](0xcc)[_0x9029('0x19')]();});}};}function handleEntityNotFound(_0x289e7c,_0x26ee51){return function(_0x58ea6b){if(!_0x58ea6b){_0x289e7c[_0x9029('0x17')](0x194);}return _0x58ea6b;};}function handleError(_0x171b9e,_0x1bac39){_0x1bac39=_0x1bac39||0x1f4;return function(_0x2aa83f){logger[_0x9029('0x24')](_0x2aa83f[_0x9029('0x25')]);if(_0x2aa83f[_0x9029('0x26')]){delete _0x2aa83f[_0x9029('0x26')];}_0x171b9e['status'](_0x1bac39)[_0x9029('0x27')](_0x2aa83f);};}exports['index']=function(_0x568f1b,_0x406e88){var _0x1446a={},_0x383572={},_0x22e30f={'count':0x0,'rows':[]};var _0x320fb6=_[_0x9029('0x28')](db['FreshsalesAccount'][_0x9029('0x29')],function(_0x1ca708){return{'name':_0x1ca708[_0x9029('0x2a')],'type':_0x1ca708[_0x9029('0x2b')][_0x9029('0x2c')]};});_0x383572['model']=_[_0x9029('0x28')](_0x320fb6,_0x9029('0x26'));_0x383572[_0x9029('0x2d')]=_[_0x9029('0x2e')](_0x568f1b[_0x9029('0x2d')]);_0x383572[_0x9029('0x2f')]=_[_0x9029('0x30')](_0x383572[_0x9029('0x31')],_0x383572[_0x9029('0x2d')]);_0x1446a['attributes']=_['intersection'](_0x383572[_0x9029('0x31')],qs['fields'](_0x568f1b['query'][_0x9029('0x32')]));_0x1446a[_0x9029('0x33')]=_0x1446a[_0x9029('0x33')]['length']?_0x1446a[_0x9029('0x33')]:_0x383572[_0x9029('0x31')];if(!_0x568f1b[_0x9029('0x2d')][_0x9029('0x34')](_0x9029('0x35'))){_0x1446a[_0x9029('0x1c')]=qs[_0x9029('0x1c')](_0x568f1b[_0x9029('0x2d')][_0x9029('0x1c')]);_0x1446a['offset']=qs[_0x9029('0x1b')](_0x568f1b[_0x9029('0x2d')][_0x9029('0x1b')]);}_0x1446a[_0x9029('0x36')]=qs[_0x9029('0x37')](_0x568f1b[_0x9029('0x2d')]['sort']);_0x1446a[_0x9029('0x38')]=qs[_0x9029('0x2f')](_[_0x9029('0x39')](_0x568f1b[_0x9029('0x2d')],_0x383572[_0x9029('0x2f')]),_0x320fb6);if(_0x568f1b['query'][_0x9029('0x3a')]){_0x1446a['where']=_['merge'](_0x1446a[_0x9029('0x38')],{'$or':_['map'](_0x320fb6,function(_0x5e3bb2){if(_0x5e3bb2[_0x9029('0x2b')]!==_0x9029('0x3b')){var _0xc6aab5={};_0xc6aab5[_0x5e3bb2[_0x9029('0x26')]]={'$like':'%'+_0x568f1b['query'][_0x9029('0x3a')]+'%'};return _0xc6aab5;}})});}_0x1446a=_[_0x9029('0x3c')]({},_0x1446a,_0x568f1b[_0x9029('0x3d')]);var _0x1200bf={'where':_0x1446a['where']};return db[_0x9029('0x3e')]['count'](_0x1200bf)[_0x9029('0x23')](function(_0x44c069){_0x22e30f['count']=_0x44c069;if(_0x568f1b[_0x9029('0x2d')][_0x9029('0x3f')]){_0x1446a[_0x9029('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x1446a);})[_0x9029('0x23')](function(_0x141959){_0x22e30f[_0x9029('0x41')]=_0x141959;return _0x22e30f;})[_0x9029('0x23')](respondWithFilteredResult(_0x406e88,_0x1446a))['catch'](handleError(_0x406e88,null));};exports[_0x9029('0x42')]=function(_0x3ebd70,_0x187440){var _0x1ae0ae={'raw':![],'where':{'id':_0x3ebd70['params']['id']}},_0xa11ac5={};_0xa11ac5[_0x9029('0x31')]=_[_0x9029('0x2e')](db['FreshsalesAccount']['rawAttributes']);_0xa11ac5[_0x9029('0x2d')]=_[_0x9029('0x2e')](_0x3ebd70['query']);_0xa11ac5['filters']=_[_0x9029('0x30')](_0xa11ac5[_0x9029('0x31')],_0xa11ac5[_0x9029('0x2d')]);_0x1ae0ae[_0x9029('0x33')]=_[_0x9029('0x30')](_0xa11ac5[_0x9029('0x31')],qs['fields'](_0x3ebd70[_0x9029('0x2d')][_0x9029('0x32')]));_0x1ae0ae['attributes']=_0x1ae0ae['attributes'][_0x9029('0x43')]?_0x1ae0ae[_0x9029('0x33')]:_0xa11ac5['model'];if(_0x3ebd70[_0x9029('0x2d')][_0x9029('0x3f')]){_0x1ae0ae[_0x9029('0x40')]=[{'all':!![]}];}_0x1ae0ae=_[_0x9029('0x3c')]({},_0x1ae0ae,_0x3ebd70[_0x9029('0x3d')]);return db[_0x9029('0x3e')][_0x9029('0x44')](_0x1ae0ae)[_0x9029('0x23')](handleEntityNotFound(_0x187440,null))[_0x9029('0x23')](respondWithResult(_0x187440,null))[_0x9029('0x45')](handleError(_0x187440,null));};exports['create']=function(_0x5657fe,_0x10a2ec){return db[_0x9029('0x3e')][_0x9029('0x46')](_0x5657fe[_0x9029('0x47')],{})[_0x9029('0x23')](respondWithResult(_0x10a2ec,0xc9))[_0x9029('0x45')](handleError(_0x10a2ec,null));};exports[_0x9029('0x48')]=function(_0x506c6d,_0x3481ed){if(_0x506c6d[_0x9029('0x47')]['id']){delete _0x506c6d[_0x9029('0x47')]['id'];}return db[_0x9029('0x3e')][_0x9029('0x44')]({'where':{'id':_0x506c6d['params']['id']}})[_0x9029('0x23')](handleEntityNotFound(_0x3481ed,null))[_0x9029('0x23')](saveUpdates(_0x506c6d[_0x9029('0x47')],null))[_0x9029('0x23')](respondWithResult(_0x3481ed,null))[_0x9029('0x45')](handleError(_0x3481ed,null));};exports['destroy']=function(_0x50cd91,_0x37f2a1){return db['FreshsalesAccount'][_0x9029('0x44')]({'where':{'id':_0x50cd91[_0x9029('0x49')]['id']}})[_0x9029('0x23')](handleEntityNotFound(_0x37f2a1,null))[_0x9029('0x23')](removeEntity(_0x37f2a1,null))[_0x9029('0x45')](handleError(_0x37f2a1,null));};exports['getConfigurations']=function(_0x57b16e,_0x4b7c62,_0x49ebdc){var _0x1c0f9e={};var _0x25bad6={};var _0x158948;var _0x22b862;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x57b16e[_0x9029('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b7c62,null))[_0x9029('0x23')](function(_0x2edb01){if(_0x2edb01){_0x158948=_0x2edb01;_0x25bad6[_0x9029('0x31')]=_[_0x9029('0x2e')](db[_0x9029('0x4a')]['rawAttributes']);_0x25bad6[_0x9029('0x2d')]=_[_0x9029('0x2e')](_0x57b16e[_0x9029('0x2d')]);_0x25bad6['filters']=_[_0x9029('0x30')](_0x25bad6[_0x9029('0x31')],_0x25bad6[_0x9029('0x2d')]);_0x1c0f9e[_0x9029('0x33')]=_[_0x9029('0x30')](_0x25bad6[_0x9029('0x31')],qs[_0x9029('0x32')](_0x57b16e[_0x9029('0x2d')][_0x9029('0x32')]));_0x1c0f9e[_0x9029('0x33')]=_0x1c0f9e['attributes']['length']?_0x1c0f9e[_0x9029('0x33')]:_0x25bad6[_0x9029('0x31')];_0x1c0f9e[_0x9029('0x36')]=qs[_0x9029('0x37')](_0x57b16e['query'][_0x9029('0x37')]);_0x1c0f9e['where']=qs[_0x9029('0x2f')](_[_0x9029('0x39')](_0x57b16e[_0x9029('0x2d')],_0x25bad6[_0x9029('0x2f')]));if(_0x57b16e[_0x9029('0x2d')][_0x9029('0x3a')]){_0x1c0f9e[_0x9029('0x38')]=_[_0x9029('0x3c')](_0x1c0f9e[_0x9029('0x38')],{'$or':_['map'](_0x1c0f9e[_0x9029('0x33')],function(_0xe8db7){var _0x380e0e={};_0x380e0e[_0xe8db7]={'$like':'%'+_0x57b16e[_0x9029('0x2d')][_0x9029('0x3a')]+'%'};return _0x380e0e;})});}_0x1c0f9e=_[_0x9029('0x3c')]({},_0x1c0f9e,_0x57b16e[_0x9029('0x3d')]);return _0x158948[_0x9029('0x4b')](_0x1c0f9e);}})[_0x9029('0x23')](function(_0x78f87d){if(_0x78f87d){_0x22b862=_0x78f87d[_0x9029('0x43')];if(!_0x57b16e['query']['hasOwnProperty'](_0x9029('0x35'))){_0x1c0f9e[_0x9029('0x1c')]=qs[_0x9029('0x1c')](_0x57b16e[_0x9029('0x2d')][_0x9029('0x1c')]);_0x1c0f9e['offset']=qs[_0x9029('0x1b')](_0x57b16e[_0x9029('0x2d')][_0x9029('0x1b')]);}return _0x158948['getConfigurations'](_0x1c0f9e);}})[_0x9029('0x23')](function(_0x149d14){if(_0x149d14){return _0x149d14?{'count':_0x22b862,'rows':_0x149d14}:null;}})[_0x9029('0x23')](respondWithResult(_0x4b7c62,null))[_0x9029('0x45')](handleError(_0x4b7c62,null));};exports[_0x9029('0x4c')]=function(_0x1be93a,_0x2545be,_0x14d984){if(_0x1be93a['body']['id']){delete _0x1be93a[_0x9029('0x47')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x1be93a['params']['id']}})[_0x9029('0x23')](handleEntityNotFound(_0x2545be,null))[_0x9029('0x23')](function(_0x353f2a){if(_0x353f2a){_0x1be93a[_0x9029('0x47')]['AccountId']=_0x353f2a['id'];_0x1be93a[_0x9029('0x47')]['Subjects']=integrations[_0x9029('0x4d')](_0x1be93a[_0x9029('0x47')][_0x9029('0x4e')],_0x1be93a[_0x9029('0x47')][_0x9029('0x2b')]);_0x1be93a[_0x9029('0x47')][_0x9029('0x4f')]=integrations['getDescriptions'](_0x1be93a['body']['channel'],_0x1be93a[_0x9029('0x47')][_0x9029('0x2b')]);return db['FreshsalesConfiguration'][_0x9029('0x46')](_0x1be93a[_0x9029('0x47')],{'include':[{'model':db[_0x9029('0x50')],'as':_0x9029('0x51')},{'model':db[_0x9029('0x50')],'as':_0x9029('0x4f')}]});}return null;})[_0x9029('0x23')](respondWithResult(_0x2545be,null))[_0x9029('0x45')](handleError(_0x2545be,null));};exports[_0x9029('0x52')]=function(_0x240ac7,_0x1e8563,_0x176a07){var _0x1f285a='';var _0xd81c95='';return db[_0x9029('0x3e')][_0x9029('0x53')]({'where':{'id':_0x240ac7['params']['id']},'attributes':['id',_0x9029('0x54'),_0x9029('0x55'),_0x9029('0x56')]})[_0x9029('0x23')](handleEntityNotFound(_0x1e8563,null))[_0x9029('0x23')](function(_0x4aae9f){if(_0x4aae9f){_0xd81c95=_0x4aae9f[_0x9029('0x54')];_0x1f285a=_0x4aae9f['remoteUri'];var _0x5e21b7=_0x4aae9f['remoteUri'][_0x9029('0x57')](-0x1);if(_0x5e21b7==='/'){_0x1f285a=_0x1f285a[_0x9029('0x58')](0x0,_0x1f285a[_0x9029('0x59')](_0x5e21b7));}return rp({'method':_0x9029('0x5a'),'uri':util[_0x9029('0x5b')](_0x9029('0x5c'),_0x1f285a,_0x9029('0x5d')),'headers':{'Authorization':_0x9029('0x5e')+_0x4aae9f[_0x9029('0x56')]},'json':!![]});}})['then'](function(_0x54e16e){if(_0x54e16e){var _0x1999ec=_0x54e16e[_0x9029('0x5f')];var _0x5f551b=![];var _0x1d40bb=null;for(_0x1d40bb=0x0;_0x1d40bb<_0x1999ec['length'];_0x1d40bb++){if(_0x1999ec[_0x1d40bb]['email']===_0xd81c95){_0x5f551b=!![];}}if(_0x5f551b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9029('0x60')});}}})[_0x9029('0x23')](respondWithResult(_0x1e8563,null))['catch'](function(_0x4147b5){var _0x20c0d1=_0x240ac7[_0x9029('0x2d')]['test']?0x1f4:_0x4147b5[_0x9029('0x61')]||0x1f4;logger[_0x9029('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x9029('0x52'),_0x20c0d1,JSON['stringify'](_0x4147b5));delete _0x4147b5[_0x9029('0x26')];if(_0x20c0d1===0x191){_0x20c0d1=0x190;}_0x1e8563[_0x9029('0x18')](_0x20c0d1)[_0x9029('0x27')](_0x240ac7[_0x9029('0x2d')][_0x9029('0x62')]?{'message':_0x9029('0x63'),'statusCode':_0x4147b5[_0x9029('0x61')]}:_0x4147b5);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index cfc0e8b..b855e79 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 _0x6d11=['../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','moment','request-promise','path','./intFreshsalesAccount.attributes'];(function(_0x4a3a12,_0x458ca9){var _0x18975b=function(_0x4a5c17){while(--_0x4a5c17){_0x4a3a12['push'](_0x4a3a12['shift']());}};_0x18975b(++_0x458ca9);}(_0x6d11,0xbf));var _0x16d1=function(_0x59ad75,_0x23d697){_0x59ad75=_0x59ad75-0x0;var _0x2c18ea=_0x6d11[_0x59ad75];return _0x2c18ea;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));var integrations=require(_0x16d1('0x7'));module[_0x16d1('0x8')]=function(_0x38626d,_0x1009dc){return _0x38626d[_0x16d1('0x9')](_0x16d1('0xa'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 8a523a7..2cbebb0 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 _0x2da6=['info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshsalesAccount','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0xc43140,_0x46ce6f){var _0x2f6792=function(_0x269e8f){while(--_0x269e8f){_0xc43140['push'](_0xc43140['shift']());}};_0x2f6792(++_0x46ce6f);}(_0x2da6,0x1dd));var _0x62da=function(_0x35fafd,_0x1af7df){_0x35fafd=_0x35fafd-0x0;var _0xc10f32=_0x2da6[_0x35fafd];return _0xc10f32;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['GetFreshsalesAccount']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['findAll']({'raw':_0xa7050b[_0x62da('0x19')]?_0xa7050b['options'][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1b')]||null:null,'attributes':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1c')]||null:null,'limit':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')]['limit']||null:null,'include':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')]?_[_0x62da('0x1e')](_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')],function(_0x24298a){return{'model':db[_0x24298a['model']],'as':_0x24298a['as'],'attributes':_0x24298a['attributes'],'include':_0x24298a['include']?_[_0x62da('0x1e')](_0x24298a[_0x62da('0x1d')],function(_0x14897c){return{'model':db[_0x14897c[_0x62da('0x1f')]],'as':_0x14897c['as'],'attributes':_0x14897c['attributes'],'include':_0x14897c[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x14897c['include'],function(_0x3ccf96){return{'model':db[_0x3ccf96[_0x62da('0x1f')]],'as':_0x3ccf96['as'],'attributes':_0x3ccf96[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41de3a){logger[_0x62da('0xd')](_0x62da('0x20'),_0xa7050b);logger['debug']('GetFreshsalesAccount',_0xa7050b,JSON[_0x62da('0x12')](_0x41de3a));_0x4d6482(_0x41de3a);})[_0x62da('0x17')](function(_0x220ffc){logger['error'](_0x62da('0x20'),_0x220ffc[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x220ffc[_0x62da('0x15')]));});});};exports[_0x62da('0x21')]=function(_0x1cf765){var _0x592c6c=this;return new Promise(function(_0xbe398f,_0x4f71bc){return db[_0x62da('0x18')][_0x62da('0x22')]({'raw':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cf765[_0x62da('0x19')]?_0x1cf765['options'][_0x62da('0x1b')]||null:null,'attributes':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')]['attributes']||null:null,'include':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')]?_['map'](_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')],function(_0x55eda7){return{'model':db[_0x55eda7[_0x62da('0x1f')]],'as':_0x55eda7['as'],'attributes':_0x55eda7[_0x62da('0x1c')],'include':_0x55eda7['include']?_[_0x62da('0x1e')](_0x55eda7[_0x62da('0x1d')],function(_0x11bf73){return{'model':db[_0x11bf73[_0x62da('0x1f')]],'as':_0x11bf73['as'],'attributes':_0x11bf73[_0x62da('0x1c')],'include':_0x11bf73[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x11bf73[_0x62da('0x1d')],function(_0x2f1115){return{'model':db[_0x2f1115[_0x62da('0x1f')]],'as':_0x2f1115['as'],'attributes':_0x2f1115[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x62da('0xc')](function(_0x3057f6){logger[_0x62da('0xd')](_0x62da('0x21'),_0x1cf765);logger[_0x62da('0xf')](_0x62da('0x21'),_0x1cf765,JSON['stringify'](_0x3057f6));_0xbe398f(_0x3057f6);})[_0x62da('0x17')](function(_0x5e9295){logger[_0x62da('0x13')](_0x62da('0x21'),_0x5e9295[_0x62da('0x15')],_0x1cf765);_0x4f71bc(_0x592c6c['error'](0x1f4,_0x5e9295[_0x62da('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['http','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x505907,_0x1ce510){var _0x3116b3=function(_0x1c3da8){while(--_0x1c3da8){_0x505907['push'](_0x505907['shift']());}};_0x3116b3(++_0x1ce510);}(_0x7a54,0x106));var _0x47a5=function(_0x568447,_0xad21ba){_0x568447=_0x568447-0x0;var _0x504fe7=_0x7a54[_0x568447];return _0x504fe7;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=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,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6a82b0f..3ae47fb 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 _0x1bb7=['/:id/descriptions','/:id/fields','getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bb7,0x1a7));var _0x71bb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1bb7[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x71bb('0x0'));var util=require('util');var path=require(_0x71bb('0x1'));var timeout=require(_0x71bb('0x2'));var express=require(_0x71bb('0x3'));var router=express[_0x71bb('0x4')]();var fs_extra=require(_0x71bb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71bb('0x6'));router[_0x71bb('0x7')]('/',auth[_0x71bb('0x8')](),controller[_0x71bb('0x9')]);router[_0x71bb('0x7')](_0x71bb('0xa'),auth['isAuthenticated'](),controller[_0x71bb('0xb')]);router[_0x71bb('0x7')](_0x71bb('0xc'),auth[_0x71bb('0x8')](),controller[_0x71bb('0xd')]);router[_0x71bb('0x7')](_0x71bb('0xe'),auth[_0x71bb('0x8')](),controller['getDescriptions']);router[_0x71bb('0x7')](_0x71bb('0xf'),auth[_0x71bb('0x8')](),controller[_0x71bb('0x10')]);router[_0x71bb('0x11')]('/',auth[_0x71bb('0x8')](),controller[_0x71bb('0x12')]);router[_0x71bb('0x13')]('/:id',auth[_0x71bb('0x8')](),controller[_0x71bb('0x14')]);router[_0x71bb('0x15')](_0x71bb('0xa'),auth[_0x71bb('0x8')](),controller['destroy']);module[_0x71bb('0x16')]=router; \ No newline at end of file +var _0xbb99=['post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getFields'];(function(_0x533995,_0x4ec30d){var _0xb7571b=function(_0xedb5f0){while(--_0xedb5f0){_0x533995['push'](_0x533995['shift']());}};_0xb7571b(++_0x4ec30d);}(_0xbb99,0x165));var _0x9bb9=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xbb99[_0x361d3f];return _0x320229;};'use strict';var multer=require(_0x9bb9('0x0'));var util=require(_0x9bb9('0x1'));var path=require('path');var timeout=require(_0x9bb9('0x2'));var express=require(_0x9bb9('0x3'));var router=express[_0x9bb9('0x4')]();var fs_extra=require(_0x9bb9('0x5'));var auth=require(_0x9bb9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9bb9('0x7'));var controller=require(_0x9bb9('0x8'));router[_0x9bb9('0x9')]('/',auth[_0x9bb9('0xa')](),controller[_0x9bb9('0xb')]);router['get'](_0x9bb9('0xc'),auth[_0x9bb9('0xa')](),controller[_0x9bb9('0xd')]);router[_0x9bb9('0x9')](_0x9bb9('0xe'),auth[_0x9bb9('0xa')](),controller[_0x9bb9('0xf')]);router[_0x9bb9('0x9')]('/:id/descriptions',auth[_0x9bb9('0xa')](),controller['getDescriptions']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x9bb9('0x10')]);router[_0x9bb9('0x11')]('/',auth[_0x9bb9('0xa')](),controller[_0x9bb9('0x12')]);router[_0x9bb9('0x13')](_0x9bb9('0xc'),auth[_0x9bb9('0xa')](),controller['update']);router[_0x9bb9('0x14')](_0x9bb9('0xc'),auth[_0x9bb9('0xa')](),controller['destroy']);module[_0x9bb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 48a3ce4..cdb6e67 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 _0xdf83=['STRING','sequelize'];(function(_0x39501e,_0x241f9a){var _0x4a2a66=function(_0x4fdfba){while(--_0x4fdfba){_0x39501e['push'](_0x39501e['shift']());}};_0x4a2a66(++_0x241f9a);}(_0xdf83,0x137));var _0x3df8=function(_0x3a2734,_0x4cf230){_0x3a2734=_0x3a2734-0x0;var _0x3c960e=_0xdf83[_0x3a2734];return _0x3c960e;};'use strict';var Sequelize=require(_0x3df8('0x0'));module['exports']={'name':{'type':Sequelize[_0x3df8('0x1')]},'description':{'type':Sequelize[_0x3df8('0x1')]}}; \ No newline at end of file +var _0xc405=['STRING','sequelize'];(function(_0x397384,_0x27041f){var _0x2a3849=function(_0x3d21d1){while(--_0x3d21d1){_0x397384['push'](_0x397384['shift']());}};_0x2a3849(++_0x27041f);}(_0xc405,0xaf));var _0x5c40=function(_0x418c3a,_0xafc508){_0x418c3a=_0x418c3a-0x0;var _0x5ebf73=_0xc405[_0x418c3a];return _0x5ebf73;};'use strict';var Sequelize=require(_0x5c40('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c40('0x1')]},'description':{'type':Sequelize[_0x5c40('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 4f71870..f576f41 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 _0x1af3=['FreshsalesField','pick','hasOwnProperty','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','body','getSubjects','findOne'];(function(_0x1486d7,_0x64d129){var _0x437f3f=function(_0x5c3ac2){while(--_0x5c3ac2){_0x1486d7['push'](_0x1486d7['shift']());}};_0x437f3f(++_0x64d129);}(_0x1af3,0x14d));var _0x31af=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x1af3[_0x2a0183];return _0x158c3a;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31af('0x1'));var jsonpatch=require(_0x31af('0x2'));var rp=require(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var Mustache=require(_0x31af('0x6'));var util=require(_0x31af('0x7'));var path=require(_0x31af('0x8'));var sox=require(_0x31af('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31af('0xa'));var _=require(_0x31af('0xb'));var squel=require(_0x31af('0xc'));var crypto=require(_0x31af('0xd'));var jsforce=require(_0x31af('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x31af('0xf'));var querystring=require(_0x31af('0x10'));var Papa=require(_0x31af('0x11'));var Redis=require('ioredis');var authService=require(_0x31af('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31af('0x13'));var logger=require(_0x31af('0x14'))(_0x31af('0x15'));var utils=require(_0x31af('0x16'));var config=require(_0x31af('0x17'));var licenseUtil=require(_0x31af('0x18'));var db=require(_0x31af('0x19'))['db'];function respondWithStatusCode(_0x22c6d2,_0x3ee4df){_0x3ee4df=_0x3ee4df||0xcc;return function(_0x4541e5){if(_0x4541e5){return _0x22c6d2[_0x31af('0x1a')](_0x3ee4df);}return _0x22c6d2['status'](_0x3ee4df)[_0x31af('0x1b')]();};}function respondWithResult(_0x1fbc81,_0x593ddd){_0x593ddd=_0x593ddd||0xc8;return function(_0x452815){if(_0x452815){return _0x1fbc81[_0x31af('0x1c')](_0x593ddd)[_0x31af('0x1d')](_0x452815);}};}function respondWithFilteredResult(_0x16c7fc,_0x41cdd4){return function(_0x3744fc){if(_0x3744fc){var _0x54b06f=typeof _0x41cdd4[_0x31af('0x1e')]===_0x31af('0x1f')&&typeof _0x41cdd4['limit']===_0x31af('0x1f');var _0x5a77af=_0x3744fc['count'];var _0x4a1c0f=_0x54b06f?0x0:_0x41cdd4[_0x31af('0x1e')];var _0x43510c=_0x54b06f?_0x3744fc[_0x31af('0x20')]:_0x41cdd4[_0x31af('0x1e')]+_0x41cdd4[_0x31af('0x21')];var _0x54a8a1;if(_0x43510c>=_0x5a77af){_0x43510c=_0x5a77af;_0x54a8a1=0xc8;}else{_0x54a8a1=0xce;}_0x16c7fc[_0x31af('0x1c')](_0x54a8a1);return _0x16c7fc[_0x31af('0x22')]('Content-Range',_0x4a1c0f+'-'+_0x43510c+'/'+_0x5a77af)[_0x31af('0x1d')](_0x3744fc);}return null;};}function patchUpdates(_0x4abc87){return function(_0x14ada4){try{jsonpatch[_0x31af('0x23')](_0x14ada4,_0x4abc87,!![]);}catch(_0x5c41a5){return BPromise[_0x31af('0x24')](_0x5c41a5);}return _0x14ada4['save']();};}function saveUpdates(_0x7d75dd,_0x4234b4){return function(_0x57527e){if(_0x57527e){return _0x57527e[_0x31af('0x25')](_0x7d75dd)[_0x31af('0x26')](function(_0x2a38a1){return _0x2a38a1;});}return null;};}function removeEntity(_0x13bb64,_0x221453){return function(_0x163385){if(_0x163385){return _0x163385[_0x31af('0x27')]()['then'](function(){_0x13bb64[_0x31af('0x1c')](0xcc)[_0x31af('0x1b')]();});}};}function handleEntityNotFound(_0x3c0fed,_0x10da34){return function(_0x5c94fd){if(!_0x5c94fd){_0x3c0fed['sendStatus'](0x194);}return _0x5c94fd;};}function handleError(_0x3c6d0e,_0x3b8055){_0x3b8055=_0x3b8055||0x1f4;return function(_0x462b4c){logger[_0x31af('0x28')](_0x462b4c['stack']);if(_0x462b4c[_0x31af('0x29')]){delete _0x462b4c['name'];}_0x3c6d0e['status'](_0x3b8055)[_0x31af('0x2a')](_0x462b4c);};}exports[_0x31af('0x2b')]=function(_0x4a24f8,_0x501439){var _0x3af453={},_0x1dc542={},_0x4de077={'count':0x0,'rows':[]};var _0x3021ba=_['map'](db[_0x31af('0x2c')][_0x31af('0x2d')],function(_0x2a7737){return{'name':_0x2a7737[_0x31af('0x2e')],'type':_0x2a7737[_0x31af('0x2f')][_0x31af('0x30')]};});_0x1dc542['model']=_[_0x31af('0x31')](_0x3021ba,_0x31af('0x29'));_0x1dc542[_0x31af('0x32')]=_[_0x31af('0x33')](_0x4a24f8['query']);_0x1dc542[_0x31af('0x34')]=_[_0x31af('0x35')](_0x1dc542[_0x31af('0x36')],_0x1dc542[_0x31af('0x32')]);_0x3af453['attributes']=_[_0x31af('0x35')](_0x1dc542['model'],qs[_0x31af('0x37')](_0x4a24f8['query'][_0x31af('0x37')]));_0x3af453[_0x31af('0x38')]=_0x3af453['attributes'][_0x31af('0x39')]?_0x3af453['attributes']:_0x1dc542[_0x31af('0x36')];if(!_0x4a24f8[_0x31af('0x32')]['hasOwnProperty'](_0x31af('0x3a'))){_0x3af453[_0x31af('0x21')]=qs[_0x31af('0x21')](_0x4a24f8[_0x31af('0x32')][_0x31af('0x21')]);_0x3af453[_0x31af('0x1e')]=qs['offset'](_0x4a24f8[_0x31af('0x32')]['offset']);}_0x3af453[_0x31af('0x3b')]=qs[_0x31af('0x3c')](_0x4a24f8['query'][_0x31af('0x3c')]);_0x3af453[_0x31af('0x3d')]=qs[_0x31af('0x34')](_['pick'](_0x4a24f8['query'],_0x1dc542[_0x31af('0x34')]),_0x3021ba);if(_0x4a24f8[_0x31af('0x32')][_0x31af('0x3e')]){_0x3af453[_0x31af('0x3d')]=_[_0x31af('0x3f')](_0x3af453[_0x31af('0x3d')],{'$or':_[_0x31af('0x31')](_0x3021ba,function(_0x121f4a){if(_0x121f4a[_0x31af('0x2f')]!==_0x31af('0x40')){var _0x1dec01={};_0x1dec01[_0x121f4a[_0x31af('0x29')]]={'$like':'%'+_0x4a24f8['query'][_0x31af('0x3e')]+'%'};return _0x1dec01;}})});}_0x3af453=_[_0x31af('0x3f')]({},_0x3af453,_0x4a24f8[_0x31af('0x41')]);var _0x59a06c={'where':_0x3af453['where']};return db[_0x31af('0x2c')]['count'](_0x59a06c)[_0x31af('0x26')](function(_0xa76a14){_0x4de077[_0x31af('0x20')]=_0xa76a14;if(_0x4a24f8[_0x31af('0x32')][_0x31af('0x42')]){_0x3af453['include']=[{'all':!![]}];}return db[_0x31af('0x2c')][_0x31af('0x43')](_0x3af453);})[_0x31af('0x26')](function(_0xbf43a3){_0x4de077[_0x31af('0x44')]=_0xbf43a3;return _0x4de077;})[_0x31af('0x26')](respondWithFilteredResult(_0x501439,_0x3af453))[_0x31af('0x45')](handleError(_0x501439,null));};exports[_0x31af('0x46')]=function(_0x320a49,_0x40a67b){var _0x42e008={'raw':![],'where':{'id':_0x320a49[_0x31af('0x47')]['id']}},_0x15c6ab={};_0x15c6ab[_0x31af('0x36')]=_[_0x31af('0x33')](db[_0x31af('0x2c')]['rawAttributes']);_0x15c6ab[_0x31af('0x32')]=_[_0x31af('0x33')](_0x320a49[_0x31af('0x32')]);_0x15c6ab[_0x31af('0x34')]=_[_0x31af('0x35')](_0x15c6ab['model'],_0x15c6ab[_0x31af('0x32')]);_0x42e008[_0x31af('0x38')]=_[_0x31af('0x35')](_0x15c6ab[_0x31af('0x36')],qs['fields'](_0x320a49[_0x31af('0x32')][_0x31af('0x37')]));_0x42e008[_0x31af('0x38')]=_0x42e008[_0x31af('0x38')][_0x31af('0x39')]?_0x42e008[_0x31af('0x38')]:_0x15c6ab['model'];if(_0x320a49['query']['includeAll']){_0x42e008[_0x31af('0x48')]=[{'all':!![]}];}_0x42e008=_[_0x31af('0x3f')]({},_0x42e008,_0x320a49[_0x31af('0x41')]);return db[_0x31af('0x2c')][_0x31af('0x49')](_0x42e008)[_0x31af('0x26')](handleEntityNotFound(_0x40a67b,null))[_0x31af('0x26')](respondWithResult(_0x40a67b,null))[_0x31af('0x45')](handleError(_0x40a67b,null));};exports['create']=function(_0x4241f0,_0x104e8e){return db[_0x31af('0x2c')]['create'](_0x4241f0[_0x31af('0x4a')],{})[_0x31af('0x26')](respondWithResult(_0x104e8e,0xc9))[_0x31af('0x45')](handleError(_0x104e8e,null));};exports[_0x31af('0x25')]=function(_0x2f1411,_0x260f69){if(_0x2f1411[_0x31af('0x4a')]['id']){delete _0x2f1411[_0x31af('0x4a')]['id'];}return db['FreshsalesConfiguration'][_0x31af('0x49')]({'where':{'id':_0x2f1411[_0x31af('0x47')]['id']}})['then'](handleEntityNotFound(_0x260f69,null))[_0x31af('0x26')](saveUpdates(_0x2f1411[_0x31af('0x4a')],null))[_0x31af('0x26')](respondWithResult(_0x260f69,null))[_0x31af('0x45')](handleError(_0x260f69,null));};exports[_0x31af('0x27')]=function(_0x193526,_0x572183){return db[_0x31af('0x2c')][_0x31af('0x49')]({'where':{'id':_0x193526[_0x31af('0x47')]['id']}})[_0x31af('0x26')](handleEntityNotFound(_0x572183,null))[_0x31af('0x26')](removeEntity(_0x572183,null))['catch'](handleError(_0x572183,null));};exports[_0x31af('0x4b')]=function(_0x57fa0a,_0x494d26,_0x10cdc2){var _0x31b3d5={};var _0x5ab679={};var _0x411d1c;var _0x29ae59;return db[_0x31af('0x2c')][_0x31af('0x4c')]({'where':{'id':_0x57fa0a[_0x31af('0x47')]['id']}})[_0x31af('0x26')](handleEntityNotFound(_0x494d26,null))[_0x31af('0x26')](function(_0x52380a){if(_0x52380a){_0x411d1c=_0x52380a;_0x5ab679['model']=_['keys'](db[_0x31af('0x4d')][_0x31af('0x2d')]);_0x5ab679[_0x31af('0x32')]=_['keys'](_0x57fa0a[_0x31af('0x32')]);_0x5ab679['filters']=_[_0x31af('0x35')](_0x5ab679[_0x31af('0x36')],_0x5ab679[_0x31af('0x32')]);_0x31b3d5[_0x31af('0x38')]=_[_0x31af('0x35')](_0x5ab679[_0x31af('0x36')],qs[_0x31af('0x37')](_0x57fa0a[_0x31af('0x32')]['fields']));_0x31b3d5[_0x31af('0x38')]=_0x31b3d5['attributes'][_0x31af('0x39')]?_0x31b3d5[_0x31af('0x38')]:_0x5ab679[_0x31af('0x36')];_0x31b3d5[_0x31af('0x3b')]=qs[_0x31af('0x3c')](_0x57fa0a['query']['sort']);_0x31b3d5['where']=qs[_0x31af('0x34')](_[_0x31af('0x4e')](_0x57fa0a['query'],_0x5ab679['filters']));if(_0x57fa0a['query'][_0x31af('0x3e')]){_0x31b3d5[_0x31af('0x3d')]=_['merge'](_0x31b3d5[_0x31af('0x3d')],{'$or':_[_0x31af('0x31')](_0x31b3d5[_0x31af('0x38')],function(_0x52fea1){var _0x36cfb8={};_0x36cfb8[_0x52fea1]={'$like':'%'+_0x57fa0a[_0x31af('0x32')][_0x31af('0x3e')]+'%'};return _0x36cfb8;})});}_0x31b3d5=_[_0x31af('0x3f')]({},_0x31b3d5,_0x57fa0a[_0x31af('0x41')]);return _0x411d1c[_0x31af('0x4b')](_0x31b3d5);}})[_0x31af('0x26')](function(_0x2b1f85){if(_0x2b1f85){_0x29ae59=_0x2b1f85['length'];if(!_0x57fa0a[_0x31af('0x32')][_0x31af('0x4f')](_0x31af('0x3a'))){_0x31b3d5['limit']=qs[_0x31af('0x21')](_0x57fa0a[_0x31af('0x32')][_0x31af('0x21')]);_0x31b3d5['offset']=qs[_0x31af('0x1e')](_0x57fa0a[_0x31af('0x32')]['offset']);}return _0x411d1c[_0x31af('0x4b')](_0x31b3d5);}})[_0x31af('0x26')](function(_0x2b73ed){if(_0x2b73ed){return _0x2b73ed?{'count':_0x29ae59,'rows':_0x2b73ed}:null;}})[_0x31af('0x26')](respondWithResult(_0x494d26,null))[_0x31af('0x45')](handleError(_0x494d26,null));};exports[_0x31af('0x50')]=function(_0x422350,_0x3f9a53,_0x36a5ee){var _0x3e6fcf={};var _0x7ee2be={};var _0x2c8538;var _0x13e0d7;return db[_0x31af('0x2c')]['findOne']({'where':{'id':_0x422350['params']['id']}})[_0x31af('0x26')](handleEntityNotFound(_0x3f9a53,null))[_0x31af('0x26')](function(_0x4b266d){if(_0x4b266d){_0x2c8538=_0x4b266d;_0x7ee2be[_0x31af('0x36')]=_[_0x31af('0x33')](db['FreshsalesField']['rawAttributes']);_0x7ee2be[_0x31af('0x32')]=_[_0x31af('0x33')](_0x422350[_0x31af('0x32')]);_0x7ee2be[_0x31af('0x34')]=_['intersection'](_0x7ee2be['model'],_0x7ee2be[_0x31af('0x32')]);_0x3e6fcf[_0x31af('0x38')]=_[_0x31af('0x35')](_0x7ee2be[_0x31af('0x36')],qs[_0x31af('0x37')](_0x422350[_0x31af('0x32')][_0x31af('0x37')]));_0x3e6fcf[_0x31af('0x38')]=_0x3e6fcf[_0x31af('0x38')]['length']?_0x3e6fcf[_0x31af('0x38')]:_0x7ee2be[_0x31af('0x36')];_0x3e6fcf[_0x31af('0x3b')]=qs[_0x31af('0x3c')](_0x422350[_0x31af('0x32')][_0x31af('0x3c')]);_0x3e6fcf[_0x31af('0x3d')]=qs[_0x31af('0x34')](_[_0x31af('0x4e')](_0x422350['query'],_0x7ee2be[_0x31af('0x34')]));if(_0x422350['query'][_0x31af('0x3e')]){_0x3e6fcf[_0x31af('0x3d')]=_[_0x31af('0x3f')](_0x3e6fcf[_0x31af('0x3d')],{'$or':_[_0x31af('0x31')](_0x3e6fcf[_0x31af('0x38')],function(_0x254314){var _0x1814d0={};_0x1814d0[_0x254314]={'$like':'%'+_0x422350[_0x31af('0x32')][_0x31af('0x3e')]+'%'};return _0x1814d0;})});}_0x3e6fcf=_['merge']({},_0x3e6fcf,_0x422350[_0x31af('0x41')]);return _0x2c8538[_0x31af('0x50')](_0x3e6fcf);}})['then'](function(_0x59dbfe){if(_0x59dbfe){_0x13e0d7=_0x59dbfe[_0x31af('0x39')];if(!_0x422350[_0x31af('0x32')]['hasOwnProperty'](_0x31af('0x3a'))){_0x3e6fcf[_0x31af('0x21')]=qs[_0x31af('0x21')](_0x422350['query'][_0x31af('0x21')]);_0x3e6fcf[_0x31af('0x1e')]=qs[_0x31af('0x1e')](_0x422350[_0x31af('0x32')]['offset']);}return _0x2c8538[_0x31af('0x50')](_0x3e6fcf);}})['then'](function(_0x4ac50d){if(_0x4ac50d){return _0x4ac50d?{'count':_0x13e0d7,'rows':_0x4ac50d}:null;}})[_0x31af('0x26')](respondWithResult(_0x3f9a53,null))['catch'](handleError(_0x3f9a53,null));};exports[_0x31af('0x51')]=function(_0x3667ae,_0x5e90ce,_0x2fd45f){var _0x36220e={};var _0x50a6fa={};var _0x1b849b;var _0x54f550;return db[_0x31af('0x2c')][_0x31af('0x4c')]({'where':{'id':_0x3667ae[_0x31af('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e90ce,null))['then'](function(_0x304db0){if(_0x304db0){_0x1b849b=_0x304db0;_0x50a6fa[_0x31af('0x36')]=_['keys'](db[_0x31af('0x4d')][_0x31af('0x2d')]);_0x50a6fa[_0x31af('0x32')]=_['keys'](_0x3667ae[_0x31af('0x32')]);_0x50a6fa[_0x31af('0x34')]=_[_0x31af('0x35')](_0x50a6fa[_0x31af('0x36')],_0x50a6fa[_0x31af('0x32')]);_0x36220e[_0x31af('0x38')]=_[_0x31af('0x35')](_0x50a6fa[_0x31af('0x36')],qs[_0x31af('0x37')](_0x3667ae[_0x31af('0x32')][_0x31af('0x37')]));_0x36220e['attributes']=_0x36220e[_0x31af('0x38')][_0x31af('0x39')]?_0x36220e[_0x31af('0x38')]:_0x50a6fa[_0x31af('0x36')];_0x36220e[_0x31af('0x3b')]=qs[_0x31af('0x3c')](_0x3667ae[_0x31af('0x32')]['sort']);_0x36220e[_0x31af('0x3d')]=qs['filters'](_[_0x31af('0x4e')](_0x3667ae[_0x31af('0x32')],_0x50a6fa['filters']));if(_0x3667ae[_0x31af('0x32')][_0x31af('0x3e')]){_0x36220e[_0x31af('0x3d')]=_['merge'](_0x36220e[_0x31af('0x3d')],{'$or':_[_0x31af('0x31')](_0x36220e[_0x31af('0x38')],function(_0x3fc006){var _0x27be8f={};_0x27be8f[_0x3fc006]={'$like':'%'+_0x3667ae[_0x31af('0x32')][_0x31af('0x3e')]+'%'};return _0x27be8f;})});}_0x36220e=_[_0x31af('0x3f')]({},_0x36220e,_0x3667ae['options']);return _0x1b849b['getFields'](_0x36220e);}})['then'](function(_0x393f3c){if(_0x393f3c){_0x54f550=_0x393f3c[_0x31af('0x39')];if(!_0x3667ae['query'][_0x31af('0x4f')](_0x31af('0x3a'))){_0x36220e['limit']=qs[_0x31af('0x21')](_0x3667ae[_0x31af('0x32')][_0x31af('0x21')]);_0x36220e[_0x31af('0x1e')]=qs[_0x31af('0x1e')](_0x3667ae[_0x31af('0x32')][_0x31af('0x1e')]);}return _0x1b849b['getFields'](_0x36220e);}})[_0x31af('0x26')](function(_0x58e136){if(_0x58e136){return _0x58e136?{'count':_0x54f550,'rows':_0x58e136}:null;}})[_0x31af('0x26')](respondWithResult(_0x5e90ce,null))[_0x31af('0x45')](handleError(_0x5e90ce,null));}; \ No newline at end of file +var _0x3ece=['FreshsalesField','getFields','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','rawAttributes','includeAll','find','create','body','params','destroy','getSubjects','getDescriptions','findOne'];(function(_0x5dc1f9,_0x460322){var _0x2fe944=function(_0x10fe9e){while(--_0x10fe9e){_0x5dc1f9['push'](_0x5dc1f9['shift']());}};_0x2fe944(++_0x460322);}(_0x3ece,0x192));var _0xe3ec=function(_0x5dff08,_0x213365){_0x5dff08=_0x5dff08-0x0;var _0x5f0820=_0x3ece[_0x5dff08];return _0x5f0820;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3ec('0x0'));var zipdir=require(_0xe3ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3ec('0x2'));var moment=require(_0xe3ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe3ec('0x4'));var util=require('util');var path=require(_0xe3ec('0x5'));var sox=require(_0xe3ec('0x6'));var csv=require('to-csv');var ejs=require(_0xe3ec('0x7'));var fs=require('fs');var fs_extra=require(_0xe3ec('0x8'));var _=require(_0xe3ec('0x9'));var squel=require(_0xe3ec('0xa'));var crypto=require(_0xe3ec('0xb'));var jsforce=require(_0xe3ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe3ec('0xd'));var querystring=require(_0xe3ec('0xe'));var Papa=require(_0xe3ec('0xf'));var Redis=require(_0xe3ec('0x10'));var authService=require(_0xe3ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3ec('0x12'));var logger=require('../../config/logger')(_0xe3ec('0x13'));var utils=require('../../config/utils');var config=require(_0xe3ec('0x14'));var licenseUtil=require(_0xe3ec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x471a02,_0x4db78d){_0x4db78d=_0x4db78d||0xcc;return function(_0x27248c){if(_0x27248c){return _0x471a02[_0xe3ec('0x16')](_0x4db78d);}return _0x471a02[_0xe3ec('0x17')](_0x4db78d)[_0xe3ec('0x18')]();};}function respondWithResult(_0x23cc73,_0x4d30dc){_0x4d30dc=_0x4d30dc||0xc8;return function(_0x2d0954){if(_0x2d0954){return _0x23cc73[_0xe3ec('0x17')](_0x4d30dc)[_0xe3ec('0x19')](_0x2d0954);}};}function respondWithFilteredResult(_0x5ea9ab,_0x5389c5){return function(_0x2003c2){if(_0x2003c2){var _0x521541=typeof _0x5389c5['offset']===_0xe3ec('0x1a')&&typeof _0x5389c5[_0xe3ec('0x1b')]===_0xe3ec('0x1a');var _0x3154e7=_0x2003c2[_0xe3ec('0x1c')];var _0x42d797=_0x521541?0x0:_0x5389c5[_0xe3ec('0x1d')];var _0x24f70d=_0x521541?_0x2003c2[_0xe3ec('0x1c')]:_0x5389c5[_0xe3ec('0x1d')]+_0x5389c5[_0xe3ec('0x1b')];var _0x411046;if(_0x24f70d>=_0x3154e7){_0x24f70d=_0x3154e7;_0x411046=0xc8;}else{_0x411046=0xce;}_0x5ea9ab[_0xe3ec('0x17')](_0x411046);return _0x5ea9ab[_0xe3ec('0x1e')](_0xe3ec('0x1f'),_0x42d797+'-'+_0x24f70d+'/'+_0x3154e7)[_0xe3ec('0x19')](_0x2003c2);}return null;};}function patchUpdates(_0x3354cc){return function(_0x47b53c){try{jsonpatch['apply'](_0x47b53c,_0x3354cc,!![]);}catch(_0x55c046){return BPromise[_0xe3ec('0x20')](_0x55c046);}return _0x47b53c[_0xe3ec('0x21')]();};}function saveUpdates(_0x161cb5,_0x3ecf09){return function(_0x31df21){if(_0x31df21){return _0x31df21[_0xe3ec('0x22')](_0x161cb5)[_0xe3ec('0x23')](function(_0xd71e24){return _0xd71e24;});}return null;};}function removeEntity(_0xd28650,_0x57ac5d){return function(_0x77b858){if(_0x77b858){return _0x77b858['destroy']()[_0xe3ec('0x23')](function(){_0xd28650[_0xe3ec('0x17')](0xcc)[_0xe3ec('0x18')]();});}};}function handleEntityNotFound(_0x85a90d,_0x39d1c7){return function(_0x2cd7c9){if(!_0x2cd7c9){_0x85a90d[_0xe3ec('0x16')](0x194);}return _0x2cd7c9;};}function handleError(_0x2e653d,_0x55d77e){_0x55d77e=_0x55d77e||0x1f4;return function(_0x240c33){logger[_0xe3ec('0x24')](_0x240c33[_0xe3ec('0x25')]);if(_0x240c33[_0xe3ec('0x26')]){delete _0x240c33[_0xe3ec('0x26')];}_0x2e653d['status'](_0x55d77e)[_0xe3ec('0x27')](_0x240c33);};}exports[_0xe3ec('0x28')]=function(_0x3283d2,_0x45d515){var _0x5727a5={},_0x4eed1b={},_0x109457={'count':0x0,'rows':[]};var _0x3973a7=_[_0xe3ec('0x29')](db[_0xe3ec('0x2a')]['rawAttributes'],function(_0xe9590){return{'name':_0xe9590[_0xe3ec('0x2b')],'type':_0xe9590[_0xe3ec('0x2c')][_0xe3ec('0x2d')]};});_0x4eed1b['model']=_[_0xe3ec('0x29')](_0x3973a7,_0xe3ec('0x26'));_0x4eed1b['query']=_[_0xe3ec('0x2e')](_0x3283d2[_0xe3ec('0x2f')]);_0x4eed1b[_0xe3ec('0x30')]=_[_0xe3ec('0x31')](_0x4eed1b[_0xe3ec('0x32')],_0x4eed1b[_0xe3ec('0x2f')]);_0x5727a5[_0xe3ec('0x33')]=_[_0xe3ec('0x31')](_0x4eed1b['model'],qs['fields'](_0x3283d2[_0xe3ec('0x2f')][_0xe3ec('0x34')]));_0x5727a5[_0xe3ec('0x33')]=_0x5727a5[_0xe3ec('0x33')][_0xe3ec('0x35')]?_0x5727a5[_0xe3ec('0x33')]:_0x4eed1b[_0xe3ec('0x32')];if(!_0x3283d2['query'][_0xe3ec('0x36')](_0xe3ec('0x37'))){_0x5727a5[_0xe3ec('0x1b')]=qs[_0xe3ec('0x1b')](_0x3283d2[_0xe3ec('0x2f')][_0xe3ec('0x1b')]);_0x5727a5[_0xe3ec('0x1d')]=qs['offset'](_0x3283d2[_0xe3ec('0x2f')][_0xe3ec('0x1d')]);}_0x5727a5[_0xe3ec('0x38')]=qs[_0xe3ec('0x39')](_0x3283d2['query'][_0xe3ec('0x39')]);_0x5727a5['where']=qs['filters'](_[_0xe3ec('0x3a')](_0x3283d2[_0xe3ec('0x2f')],_0x4eed1b[_0xe3ec('0x30')]),_0x3973a7);if(_0x3283d2[_0xe3ec('0x2f')][_0xe3ec('0x3b')]){_0x5727a5[_0xe3ec('0x3c')]=_['merge'](_0x5727a5['where'],{'$or':_[_0xe3ec('0x29')](_0x3973a7,function(_0xc7f488){if(_0xc7f488[_0xe3ec('0x2c')]!==_0xe3ec('0x3d')){var _0x5781d3={};_0x5781d3[_0xc7f488[_0xe3ec('0x26')]]={'$like':'%'+_0x3283d2[_0xe3ec('0x2f')]['filter']+'%'};return _0x5781d3;}})});}_0x5727a5=_[_0xe3ec('0x3e')]({},_0x5727a5,_0x3283d2[_0xe3ec('0x3f')]);var _0x2a7f08={'where':_0x5727a5[_0xe3ec('0x3c')]};return db[_0xe3ec('0x2a')][_0xe3ec('0x1c')](_0x2a7f08)[_0xe3ec('0x23')](function(_0x4c1ffc){_0x109457[_0xe3ec('0x1c')]=_0x4c1ffc;if(_0x3283d2['query']['includeAll']){_0x5727a5[_0xe3ec('0x40')]=[{'all':!![]}];}return db[_0xe3ec('0x2a')][_0xe3ec('0x41')](_0x5727a5);})[_0xe3ec('0x23')](function(_0x163213){_0x109457['rows']=_0x163213;return _0x109457;})[_0xe3ec('0x23')](respondWithFilteredResult(_0x45d515,_0x5727a5))[_0xe3ec('0x42')](handleError(_0x45d515,null));};exports[_0xe3ec('0x43')]=function(_0x9f7cf4,_0x58d13a){var _0x52358b={'raw':![],'where':{'id':_0x9f7cf4['params']['id']}},_0x352dcb={};_0x352dcb[_0xe3ec('0x32')]=_['keys'](db[_0xe3ec('0x2a')][_0xe3ec('0x44')]);_0x352dcb['query']=_[_0xe3ec('0x2e')](_0x9f7cf4[_0xe3ec('0x2f')]);_0x352dcb[_0xe3ec('0x30')]=_['intersection'](_0x352dcb['model'],_0x352dcb[_0xe3ec('0x2f')]);_0x52358b[_0xe3ec('0x33')]=_[_0xe3ec('0x31')](_0x352dcb[_0xe3ec('0x32')],qs[_0xe3ec('0x34')](_0x9f7cf4[_0xe3ec('0x2f')]['fields']));_0x52358b[_0xe3ec('0x33')]=_0x52358b['attributes']['length']?_0x52358b[_0xe3ec('0x33')]:_0x352dcb[_0xe3ec('0x32')];if(_0x9f7cf4[_0xe3ec('0x2f')][_0xe3ec('0x45')]){_0x52358b[_0xe3ec('0x40')]=[{'all':!![]}];}_0x52358b=_[_0xe3ec('0x3e')]({},_0x52358b,_0x9f7cf4[_0xe3ec('0x3f')]);return db[_0xe3ec('0x2a')][_0xe3ec('0x46')](_0x52358b)[_0xe3ec('0x23')](handleEntityNotFound(_0x58d13a,null))['then'](respondWithResult(_0x58d13a,null))[_0xe3ec('0x42')](handleError(_0x58d13a,null));};exports['create']=function(_0x4a4581,_0x1f2891){return db[_0xe3ec('0x2a')][_0xe3ec('0x47')](_0x4a4581[_0xe3ec('0x48')],{})[_0xe3ec('0x23')](respondWithResult(_0x1f2891,0xc9))[_0xe3ec('0x42')](handleError(_0x1f2891,null));};exports['update']=function(_0x355d4b,_0x8ff2e5){if(_0x355d4b[_0xe3ec('0x48')]['id']){delete _0x355d4b[_0xe3ec('0x48')]['id'];}return db[_0xe3ec('0x2a')]['find']({'where':{'id':_0x355d4b[_0xe3ec('0x49')]['id']}})[_0xe3ec('0x23')](handleEntityNotFound(_0x8ff2e5,null))[_0xe3ec('0x23')](saveUpdates(_0x355d4b[_0xe3ec('0x48')],null))[_0xe3ec('0x23')](respondWithResult(_0x8ff2e5,null))['catch'](handleError(_0x8ff2e5,null));};exports[_0xe3ec('0x4a')]=function(_0x44f7d7,_0x38f68a){return db[_0xe3ec('0x2a')][_0xe3ec('0x46')]({'where':{'id':_0x44f7d7['params']['id']}})[_0xe3ec('0x23')](handleEntityNotFound(_0x38f68a,null))[_0xe3ec('0x23')](removeEntity(_0x38f68a,null))['catch'](handleError(_0x38f68a,null));};exports[_0xe3ec('0x4b')]=function(_0x529fe0,_0x296a56,_0x4684c7){var _0x256554={};var _0xce8946={};var _0x5423c4;var _0x2b7f6d;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x529fe0['params']['id']}})[_0xe3ec('0x23')](handleEntityNotFound(_0x296a56,null))[_0xe3ec('0x23')](function(_0x576da5){if(_0x576da5){_0x5423c4=_0x576da5;_0xce8946['model']=_[_0xe3ec('0x2e')](db['FreshsalesField']['rawAttributes']);_0xce8946[_0xe3ec('0x2f')]=_[_0xe3ec('0x2e')](_0x529fe0[_0xe3ec('0x2f')]);_0xce8946[_0xe3ec('0x30')]=_[_0xe3ec('0x31')](_0xce8946[_0xe3ec('0x32')],_0xce8946[_0xe3ec('0x2f')]);_0x256554[_0xe3ec('0x33')]=_[_0xe3ec('0x31')](_0xce8946['model'],qs[_0xe3ec('0x34')](_0x529fe0[_0xe3ec('0x2f')][_0xe3ec('0x34')]));_0x256554[_0xe3ec('0x33')]=_0x256554[_0xe3ec('0x33')][_0xe3ec('0x35')]?_0x256554['attributes']:_0xce8946[_0xe3ec('0x32')];_0x256554['order']=qs[_0xe3ec('0x39')](_0x529fe0['query'][_0xe3ec('0x39')]);_0x256554[_0xe3ec('0x3c')]=qs[_0xe3ec('0x30')](_[_0xe3ec('0x3a')](_0x529fe0['query'],_0xce8946['filters']));if(_0x529fe0[_0xe3ec('0x2f')][_0xe3ec('0x3b')]){_0x256554[_0xe3ec('0x3c')]=_[_0xe3ec('0x3e')](_0x256554[_0xe3ec('0x3c')],{'$or':_['map'](_0x256554['attributes'],function(_0x1ff06f){var _0x4b3f53={};_0x4b3f53[_0x1ff06f]={'$like':'%'+_0x529fe0[_0xe3ec('0x2f')]['filter']+'%'};return _0x4b3f53;})});}_0x256554=_[_0xe3ec('0x3e')]({},_0x256554,_0x529fe0[_0xe3ec('0x3f')]);return _0x5423c4[_0xe3ec('0x4b')](_0x256554);}})[_0xe3ec('0x23')](function(_0x4dbca3){if(_0x4dbca3){_0x2b7f6d=_0x4dbca3['length'];if(!_0x529fe0['query'][_0xe3ec('0x36')]('nolimit')){_0x256554[_0xe3ec('0x1b')]=qs[_0xe3ec('0x1b')](_0x529fe0[_0xe3ec('0x2f')][_0xe3ec('0x1b')]);_0x256554[_0xe3ec('0x1d')]=qs[_0xe3ec('0x1d')](_0x529fe0['query']['offset']);}return _0x5423c4[_0xe3ec('0x4b')](_0x256554);}})['then'](function(_0x27e4e2){if(_0x27e4e2){return _0x27e4e2?{'count':_0x2b7f6d,'rows':_0x27e4e2}:null;}})['then'](respondWithResult(_0x296a56,null))[_0xe3ec('0x42')](handleError(_0x296a56,null));};exports[_0xe3ec('0x4c')]=function(_0x1ab523,_0x426f43,_0x39e75f){var _0x4091e3={};var _0x42d08f={};var _0xbc0501;var _0x382429;return db[_0xe3ec('0x2a')][_0xe3ec('0x4d')]({'where':{'id':_0x1ab523[_0xe3ec('0x49')]['id']}})[_0xe3ec('0x23')](handleEntityNotFound(_0x426f43,null))['then'](function(_0x2ffbb3){if(_0x2ffbb3){_0xbc0501=_0x2ffbb3;_0x42d08f['model']=_[_0xe3ec('0x2e')](db[_0xe3ec('0x4e')][_0xe3ec('0x44')]);_0x42d08f[_0xe3ec('0x2f')]=_[_0xe3ec('0x2e')](_0x1ab523[_0xe3ec('0x2f')]);_0x42d08f['filters']=_[_0xe3ec('0x31')](_0x42d08f[_0xe3ec('0x32')],_0x42d08f[_0xe3ec('0x2f')]);_0x4091e3[_0xe3ec('0x33')]=_[_0xe3ec('0x31')](_0x42d08f[_0xe3ec('0x32')],qs[_0xe3ec('0x34')](_0x1ab523[_0xe3ec('0x2f')]['fields']));_0x4091e3['attributes']=_0x4091e3['attributes'][_0xe3ec('0x35')]?_0x4091e3[_0xe3ec('0x33')]:_0x42d08f[_0xe3ec('0x32')];_0x4091e3[_0xe3ec('0x38')]=qs[_0xe3ec('0x39')](_0x1ab523[_0xe3ec('0x2f')][_0xe3ec('0x39')]);_0x4091e3[_0xe3ec('0x3c')]=qs[_0xe3ec('0x30')](_['pick'](_0x1ab523[_0xe3ec('0x2f')],_0x42d08f[_0xe3ec('0x30')]));if(_0x1ab523[_0xe3ec('0x2f')][_0xe3ec('0x3b')]){_0x4091e3[_0xe3ec('0x3c')]=_[_0xe3ec('0x3e')](_0x4091e3[_0xe3ec('0x3c')],{'$or':_[_0xe3ec('0x29')](_0x4091e3[_0xe3ec('0x33')],function(_0x4270fb){var _0x20b953={};_0x20b953[_0x4270fb]={'$like':'%'+_0x1ab523['query'][_0xe3ec('0x3b')]+'%'};return _0x20b953;})});}_0x4091e3=_[_0xe3ec('0x3e')]({},_0x4091e3,_0x1ab523[_0xe3ec('0x3f')]);return _0xbc0501[_0xe3ec('0x4c')](_0x4091e3);}})[_0xe3ec('0x23')](function(_0x1a7b29){if(_0x1a7b29){_0x382429=_0x1a7b29[_0xe3ec('0x35')];if(!_0x1ab523[_0xe3ec('0x2f')][_0xe3ec('0x36')](_0xe3ec('0x37'))){_0x4091e3[_0xe3ec('0x1b')]=qs[_0xe3ec('0x1b')](_0x1ab523[_0xe3ec('0x2f')][_0xe3ec('0x1b')]);_0x4091e3[_0xe3ec('0x1d')]=qs[_0xe3ec('0x1d')](_0x1ab523[_0xe3ec('0x2f')]['offset']);}return _0xbc0501[_0xe3ec('0x4c')](_0x4091e3);}})['then'](function(_0x30ad3d){if(_0x30ad3d){return _0x30ad3d?{'count':_0x382429,'rows':_0x30ad3d}:null;}})[_0xe3ec('0x23')](respondWithResult(_0x426f43,null))[_0xe3ec('0x42')](handleError(_0x426f43,null));};exports[_0xe3ec('0x4f')]=function(_0x23b179,_0x2d16fe,_0x25d218){var _0x375949={};var _0x50ce54={};var _0x242123;var _0xc274d3;return db[_0xe3ec('0x2a')][_0xe3ec('0x4d')]({'where':{'id':_0x23b179[_0xe3ec('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d16fe,null))[_0xe3ec('0x23')](function(_0x3539a5){if(_0x3539a5){_0x242123=_0x3539a5;_0x50ce54[_0xe3ec('0x32')]=_[_0xe3ec('0x2e')](db[_0xe3ec('0x4e')][_0xe3ec('0x44')]);_0x50ce54[_0xe3ec('0x2f')]=_[_0xe3ec('0x2e')](_0x23b179[_0xe3ec('0x2f')]);_0x50ce54['filters']=_[_0xe3ec('0x31')](_0x50ce54['model'],_0x50ce54['query']);_0x375949[_0xe3ec('0x33')]=_['intersection'](_0x50ce54[_0xe3ec('0x32')],qs['fields'](_0x23b179[_0xe3ec('0x2f')][_0xe3ec('0x34')]));_0x375949['attributes']=_0x375949[_0xe3ec('0x33')][_0xe3ec('0x35')]?_0x375949[_0xe3ec('0x33')]:_0x50ce54['model'];_0x375949[_0xe3ec('0x38')]=qs[_0xe3ec('0x39')](_0x23b179[_0xe3ec('0x2f')][_0xe3ec('0x39')]);_0x375949[_0xe3ec('0x3c')]=qs['filters'](_[_0xe3ec('0x3a')](_0x23b179[_0xe3ec('0x2f')],_0x50ce54['filters']));if(_0x23b179[_0xe3ec('0x2f')][_0xe3ec('0x3b')]){_0x375949['where']=_[_0xe3ec('0x3e')](_0x375949[_0xe3ec('0x3c')],{'$or':_[_0xe3ec('0x29')](_0x375949['attributes'],function(_0x2bffeb){var _0x4af460={};_0x4af460[_0x2bffeb]={'$like':'%'+_0x23b179[_0xe3ec('0x2f')][_0xe3ec('0x3b')]+'%'};return _0x4af460;})});}_0x375949=_[_0xe3ec('0x3e')]({},_0x375949,_0x23b179[_0xe3ec('0x3f')]);return _0x242123['getFields'](_0x375949);}})[_0xe3ec('0x23')](function(_0x2b21b5){if(_0x2b21b5){_0xc274d3=_0x2b21b5[_0xe3ec('0x35')];if(!_0x23b179[_0xe3ec('0x2f')]['hasOwnProperty']('nolimit')){_0x375949[_0xe3ec('0x1b')]=qs[_0xe3ec('0x1b')](_0x23b179[_0xe3ec('0x2f')]['limit']);_0x375949['offset']=qs[_0xe3ec('0x1d')](_0x23b179[_0xe3ec('0x2f')][_0xe3ec('0x1d')]);}return _0x242123['getFields'](_0x375949);}})['then'](function(_0x3b9d2c){if(_0x3b9d2c){return _0x3b9d2c?{'count':_0xc274d3,'rows':_0x3b9d2c}:null;}})['then'](respondWithResult(_0x2d16fe,null))[_0xe3ec('0x42')](handleError(_0x2d16fe,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e0f7724..420d831 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 _0xa274=['request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x19bf5f,_0x1ca6b9){var _0x237efa=function(_0x18f2a3){while(--_0x18f2a3){_0x19bf5f['push'](_0x19bf5f['shift']());}};_0x237efa(++_0x1ca6b9);}(_0xa274,0x11b));var _0x4a27=function(_0x186222,_0x3bdfb0){_0x186222=_0x186222-0x0;var _0x226a38=_0xa274[_0x186222];return _0x226a38;};'use strict';var _=require(_0x4a27('0x0'));var util=require('util');var logger=require(_0x4a27('0x1'))(_0x4a27('0x2'));var moment=require(_0x4a27('0x3'));var BPromise=require(_0x4a27('0x4'));var rp=require(_0x4a27('0x5'));var fs=require('fs');var path=require(_0x4a27('0x6'));var rimraf=require('rimraf');var config=require(_0x4a27('0x7'));var attributes=require(_0x4a27('0x8'));module['exports']=function(_0x60d5de,_0x553a94){return _0x60d5de[_0x4a27('0x9')](_0x4a27('0xa'),attributes,{'tableName':_0x4a27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5a=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x6f5a,0x108));var _0xa6f5=function(_0x4f3597,_0x3dbc8d){_0x4f3597=_0x4f3597-0x0;var _0x1afcfc=_0x6f5a[_0x4f3597];return _0x1afcfc;};'use strict';var _=require(_0xa6f5('0x0'));var util=require('util');var logger=require(_0xa6f5('0x1'))('api');var moment=require(_0xa6f5('0x2'));var BPromise=require(_0xa6f5('0x3'));var rp=require(_0xa6f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6f5('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6f5('0x6'));module[_0xa6f5('0x7')]=function(_0x42d6f0,_0x478f06){return _0x42d6f0[_0xa6f5('0x8')](_0xa6f5('0x9'),attributes,{'tableName':'int_freshsales_configurations','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 0a5a142..15cf033 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 _0xb6f1=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment'];(function(_0x386352,_0xfac264){var _0x5bcdc3=function(_0x173af4){while(--_0x173af4){_0x386352['push'](_0x386352['shift']());}};_0x5bcdc3(++_0xfac264);}(_0xb6f1,0x7c));var _0x1b6f=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xb6f1[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var moment=require(_0x1b6f('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6f('0x2'));var fs=require('fs');var Redis=require(_0x1b6f('0x3'));var db=require(_0x1b6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b6f('0x5'))(_0x1b6f('0x6'));var config=require(_0x1b6f('0x7'));var jayson=require(_0x1b6f('0x8'));var client=jayson[_0x1b6f('0x9')][_0x1b6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49fb42,_0x2cc396,_0x381702){return new BPromise(function(_0x49f049,_0x35229d){return client['request'](_0x49fb42,_0x381702)[_0x1b6f('0xb')](function(_0x24f10c){logger[_0x1b6f('0xc')](_0x1b6f('0xd'),_0x2cc396,_0x1b6f('0xe'));logger['debug'](_0x1b6f('0xf'),_0x2cc396,_0x1b6f('0xe'),JSON['stringify'](_0x24f10c));if(_0x24f10c['error']){if(_0x24f10c['error'][_0x1b6f('0x10')]===0x1f4){logger[_0x1b6f('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2cc396,_0x24f10c['error'][_0x1b6f('0x12')]);return _0x35229d(_0x24f10c[_0x1b6f('0x11')]['message']);}logger[_0x1b6f('0x11')](_0x1b6f('0xd'),_0x2cc396,_0x24f10c['error'][_0x1b6f('0x12')]);return _0x49f049(_0x24f10c['error']['message']);}else{logger[_0x1b6f('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2cc396,_0x1b6f('0xe'));_0x49f049(_0x24f10c[_0x1b6f('0x13')]['message']);}})[_0x1b6f('0x14')](function(_0x4b00cb){logger[_0x1b6f('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2cc396,_0x4b00cb);_0x35229d(_0x4b00cb);});});} \ No newline at end of file +var _0x2473=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5490ae,_0x5ebc0f){var _0x6098a0=function(_0x5140c2){while(--_0x5140c2){_0x5490ae['push'](_0x5490ae['shift']());}};_0x6098a0(++_0x5ebc0f);}(_0x2473,0x73));var _0x3247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2473[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3247('0x0'));var moment=require(_0x3247('0x1'));var BPromise=require('bluebird');var rs=require(_0x3247('0x2'));var fs=require('fs');var Redis=require(_0x3247('0x3'));var db=require(_0x3247('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3247('0x5'))(_0x3247('0x6'));var config=require(_0x3247('0x7'));var jayson=require(_0x3247('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57540b,_0x4bf61f,_0x5b502d){return new BPromise(function(_0xad4633,_0x126a8b){return client[_0x3247('0x9')](_0x57540b,_0x5b502d)[_0x3247('0xa')](function(_0x2775e1){logger[_0x3247('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4bf61f,'request\x20sent');logger[_0x3247('0xc')](_0x3247('0xd'),_0x4bf61f,'request\x20sent',JSON[_0x3247('0xe')](_0x2775e1));if(_0x2775e1[_0x3247('0xf')]){if(_0x2775e1[_0x3247('0xf')]['code']===0x1f4){logger[_0x3247('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4bf61f,_0x2775e1[_0x3247('0xf')][_0x3247('0x10')]);return _0x126a8b(_0x2775e1[_0x3247('0xf')][_0x3247('0x10')]);}logger['error'](_0x3247('0x11'),_0x4bf61f,_0x2775e1[_0x3247('0xf')]['message']);return _0xad4633(_0x2775e1[_0x3247('0xf')][_0x3247('0x10')]);}else{logger[_0x3247('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4bf61f,_0x3247('0x12'));_0xad4633(_0x2775e1['result'][_0x3247('0x10')]);}})[_0x3247('0x13')](function(_0x12741a){logger[_0x3247('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4bf61f,_0x12741a);_0x126a8b(_0x12741a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index de9bc7b..73e1dd4 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 _0xbec5=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index'];(function(_0x314d82,_0x52f61c){var _0x2f01bc=function(_0x531836){while(--_0x531836){_0x314d82['push'](_0x314d82['shift']());}};_0x2f01bc(++_0x52f61c);}(_0xbec5,0xe5));var _0x5bec=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0xbec5[_0x1ee0a1];return _0x1d2d5b;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0xe')]('/',auth[_0x5bec('0xc')](),controller[_0x5bec('0xf')]);router['put'](_0x5bec('0xb'),auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xb'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);module[_0x5bec('0x13')]=router; \ No newline at end of file +var _0x3189=['put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesField.controller','get','index','isAuthenticated','show','post','create'];(function(_0x429a1c,_0x20a313){var _0xb4ee9f=function(_0xf42bc6){while(--_0xf42bc6){_0x429a1c['push'](_0x429a1c['shift']());}};_0xb4ee9f(++_0x20a313);}(_0x3189,0xae));var _0x9318=function(_0x36017a,_0x5461aa){_0x36017a=_0x36017a-0x0;var _0x2eb869=_0x3189[_0x36017a];return _0x2eb869;};'use strict';var multer=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var path=require('path');var timeout=require(_0x9318('0x2'));var express=require(_0x9318('0x3'));var router=express[_0x9318('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9318('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9318('0x6'));router[_0x9318('0x7')]('/',auth['isAuthenticated'](),controller[_0x9318('0x8')]);router['get']('/:id',auth[_0x9318('0x9')](),controller[_0x9318('0xa')]);router[_0x9318('0xb')]('/',auth['isAuthenticated'](),controller[_0x9318('0xc')]);router[_0x9318('0xd')](_0x9318('0xe'),auth[_0x9318('0x9')](),controller['update']);router['delete'](_0x9318('0xe'),auth['isAuthenticated'](),controller[_0x9318('0xf')]);module[_0x9318('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index d17ee34..b0c33d3 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 _0x31ca=['ENUM','customVariable','keyValue','picklist','STRING','string','variable','BOOLEAN','exports'];(function(_0x4c1ad8,_0x55e28d){var _0x2c617b=function(_0x5f80df){while(--_0x5f80df){_0x4c1ad8['push'](_0x4c1ad8['shift']());}};_0x2c617b(++_0x55e28d);}(_0x31ca,0xb3));var _0xa31c=function(_0x99a506,_0x5b4f9c){_0x99a506=_0x99a506-0x0;var _0x646330=_0x31ca[_0x99a506];return _0x646330;};'use strict';var Sequelize=require('sequelize');module[_0xa31c('0x0')]={'type':{'type':Sequelize[_0xa31c('0x1')]('string','variable',_0xa31c('0x2'),_0xa31c('0x3'),_0xa31c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa31c('0x5')]},'key':{'type':Sequelize[_0xa31c('0x5')]},'keyType':{'type':Sequelize[_0xa31c('0x1')](_0xa31c('0x6'),_0xa31c('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xa31c('0x5')]},'idField':{'type':Sequelize[_0xa31c('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa31c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa31c('0x5')]}}; \ No newline at end of file +var _0x84df=['picklist','STRING','ENUM','variable','sequelize','exports','string','customVariable','keyValue'];(function(_0x10cf06,_0x5a6f7c){var _0x14179c=function(_0x573f19){while(--_0x573f19){_0x10cf06['push'](_0x10cf06['shift']());}};_0x14179c(++_0x5a6f7c);}(_0x84df,0xf7));var _0xf84d=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x84df[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0xf84d('0x0'));module[_0xf84d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf84d('0x2'),'variable',_0xf84d('0x3'),_0xf84d('0x4'),_0xf84d('0x5')),'defaultValue':_0xf84d('0x2')},'content':{'type':Sequelize[_0xf84d('0x6')]},'key':{'type':Sequelize[_0xf84d('0x6')]},'keyType':{'type':Sequelize[_0xf84d('0x7')](_0xf84d('0x2'),_0xf84d('0x8'),_0xf84d('0x3'))},'keyContent':{'type':Sequelize[_0xf84d('0x6')]},'idField':{'type':Sequelize[_0xf84d('0x6')]},'nameField':{'type':Sequelize[_0xf84d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf84d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 24483ae..e96c2ed 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 _0x79c8=['save','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply'];(function(_0x2e761d,_0x123e87){var _0x3a316a=function(_0x1a56a4){while(--_0x1a56a4){_0x2e761d['push'](_0x2e761d['shift']());}};_0x3a316a(++_0x123e87);}(_0x79c8,0x10e));var _0x879c=function(_0x3c6bc1,_0x40b3c7){_0x3c6bc1=_0x3c6bc1-0x0;var _0x215adf=_0x79c8[_0x3c6bc1];return _0x215adf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x879c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x879c('0x1'));var rp=require(_0x879c('0x2'));var moment=require(_0x879c('0x3'));var BPromise=require(_0x879c('0x4'));var Mustache=require('mustache');var util=require(_0x879c('0x5'));var path=require(_0x879c('0x6'));var sox=require(_0x879c('0x7'));var csv=require('to-csv');var ejs=require(_0x879c('0x8'));var fs=require('fs');var fs_extra=require(_0x879c('0x9'));var _=require(_0x879c('0xa'));var squel=require(_0x879c('0xb'));var crypto=require(_0x879c('0xc'));var jsforce=require(_0x879c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879c('0xe'));var querystring=require(_0x879c('0xf'));var Papa=require(_0x879c('0x10'));var Redis=require(_0x879c('0x11'));var authService=require(_0x879c('0x12'));var qs=require(_0x879c('0x13'));var as=require(_0x879c('0x14'));var hardwareService=require(_0x879c('0x15'));var logger=require(_0x879c('0x16'))(_0x879c('0x17'));var utils=require(_0x879c('0x18'));var config=require(_0x879c('0x19'));var licenseUtil=require(_0x879c('0x1a'));var db=require(_0x879c('0x1b'))['db'];function respondWithStatusCode(_0x57c8b1,_0x2ddd42){_0x2ddd42=_0x2ddd42||0xcc;return function(_0x4b55ec){if(_0x4b55ec){return _0x57c8b1[_0x879c('0x1c')](_0x2ddd42);}return _0x57c8b1[_0x879c('0x1d')](_0x2ddd42)[_0x879c('0x1e')]();};}function respondWithResult(_0x1ad175,_0xaf3389){_0xaf3389=_0xaf3389||0xc8;return function(_0x1a5549){if(_0x1a5549){return _0x1ad175[_0x879c('0x1d')](_0xaf3389)['json'](_0x1a5549);}};}function respondWithFilteredResult(_0x556b53,_0x12e00e){return function(_0xbe48ab){if(_0xbe48ab){var _0x56862f=typeof _0x12e00e[_0x879c('0x1f')]==='undefined'&&typeof _0x12e00e[_0x879c('0x20')]===_0x879c('0x21');var _0x54d674=_0xbe48ab['count'];var _0xa18e69=_0x56862f?0x0:_0x12e00e[_0x879c('0x1f')];var _0x3d6855=_0x56862f?_0xbe48ab[_0x879c('0x22')]:_0x12e00e['offset']+_0x12e00e[_0x879c('0x20')];var _0x4e1633;if(_0x3d6855>=_0x54d674){_0x3d6855=_0x54d674;_0x4e1633=0xc8;}else{_0x4e1633=0xce;}_0x556b53[_0x879c('0x1d')](_0x4e1633);return _0x556b53['set'](_0x879c('0x23'),_0xa18e69+'-'+_0x3d6855+'/'+_0x54d674)[_0x879c('0x24')](_0xbe48ab);}return null;};}function patchUpdates(_0x51704c){return function(_0x1cc57a){try{jsonpatch[_0x879c('0x25')](_0x1cc57a,_0x51704c,!![]);}catch(_0x54fb30){return BPromise['reject'](_0x54fb30);}return _0x1cc57a[_0x879c('0x26')]();};}function saveUpdates(_0x3bfc30,_0x34c285){return function(_0x52faac){if(_0x52faac){return _0x52faac[_0x879c('0x27')](_0x3bfc30)[_0x879c('0x28')](function(_0x4ec2db){return _0x4ec2db;});}return null;};}function removeEntity(_0x56243f,_0x16a61b){return function(_0x2ec5f2){if(_0x2ec5f2){return _0x2ec5f2[_0x879c('0x29')]()[_0x879c('0x28')](function(){_0x56243f[_0x879c('0x1d')](0xcc)[_0x879c('0x1e')]();});}};}function handleEntityNotFound(_0x230970,_0x54c6b4){return function(_0x482c4f){if(!_0x482c4f){_0x230970[_0x879c('0x1c')](0x194);}return _0x482c4f;};}function handleError(_0x2529ec,_0x2c47d8){_0x2c47d8=_0x2c47d8||0x1f4;return function(_0x4f0d25){logger[_0x879c('0x2a')](_0x4f0d25['stack']);if(_0x4f0d25[_0x879c('0x2b')]){delete _0x4f0d25['name'];}_0x2529ec[_0x879c('0x1d')](_0x2c47d8)[_0x879c('0x2c')](_0x4f0d25);};}exports[_0x879c('0x2d')]=function(_0xa47814,_0x117e14){var _0x282181={},_0x382070={},_0x10620c={'count':0x0,'rows':[]};var _0x47a189=_[_0x879c('0x2e')](db[_0x879c('0x2f')][_0x879c('0x30')],function(_0x3efa2b){return{'name':_0x3efa2b[_0x879c('0x31')],'type':_0x3efa2b['type'][_0x879c('0x32')]};});_0x382070['model']=_['map'](_0x47a189,'name');_0x382070['query']=_[_0x879c('0x33')](_0xa47814[_0x879c('0x34')]);_0x382070['filters']=_[_0x879c('0x35')](_0x382070[_0x879c('0x36')],_0x382070[_0x879c('0x34')]);_0x282181[_0x879c('0x37')]=_[_0x879c('0x35')](_0x382070['model'],qs[_0x879c('0x38')](_0xa47814[_0x879c('0x34')][_0x879c('0x38')]));_0x282181[_0x879c('0x37')]=_0x282181[_0x879c('0x37')][_0x879c('0x39')]?_0x282181[_0x879c('0x37')]:_0x382070['model'];if(!_0xa47814[_0x879c('0x34')]['hasOwnProperty'](_0x879c('0x3a'))){_0x282181[_0x879c('0x20')]=qs[_0x879c('0x20')](_0xa47814[_0x879c('0x34')]['limit']);_0x282181['offset']=qs[_0x879c('0x1f')](_0xa47814[_0x879c('0x34')][_0x879c('0x1f')]);}_0x282181[_0x879c('0x3b')]=qs[_0x879c('0x3c')](_0xa47814[_0x879c('0x34')][_0x879c('0x3c')]);_0x282181['where']=qs[_0x879c('0x3d')](_[_0x879c('0x3e')](_0xa47814[_0x879c('0x34')],_0x382070[_0x879c('0x3d')]),_0x47a189);if(_0xa47814[_0x879c('0x34')]['filter']){_0x282181[_0x879c('0x3f')]=_[_0x879c('0x40')](_0x282181[_0x879c('0x3f')],{'$or':_['map'](_0x47a189,function(_0x50fb10){if(_0x50fb10['type']!==_0x879c('0x41')){var _0xf35076={};_0xf35076[_0x50fb10[_0x879c('0x2b')]]={'$like':'%'+_0xa47814['query'][_0x879c('0x42')]+'%'};return _0xf35076;}})});}_0x282181=_[_0x879c('0x40')]({},_0x282181,_0xa47814[_0x879c('0x43')]);var _0x441a30={'where':_0x282181[_0x879c('0x3f')]};return db[_0x879c('0x2f')][_0x879c('0x22')](_0x441a30)[_0x879c('0x28')](function(_0x4861af){_0x10620c[_0x879c('0x22')]=_0x4861af;if(_0xa47814['query'][_0x879c('0x44')]){_0x282181[_0x879c('0x45')]=[{'all':!![]}];}return db[_0x879c('0x2f')][_0x879c('0x46')](_0x282181);})[_0x879c('0x28')](function(_0x3017bc){_0x10620c[_0x879c('0x47')]=_0x3017bc;return _0x10620c;})[_0x879c('0x28')](respondWithFilteredResult(_0x117e14,_0x282181))[_0x879c('0x48')](handleError(_0x117e14,null));};exports[_0x879c('0x49')]=function(_0x411fdb,_0x2643db){var _0x5aa06f={'raw':!![],'where':{'id':_0x411fdb[_0x879c('0x4a')]['id']}},_0x39ff5a={};_0x39ff5a[_0x879c('0x36')]=_[_0x879c('0x33')](db[_0x879c('0x2f')][_0x879c('0x30')]);_0x39ff5a[_0x879c('0x34')]=_[_0x879c('0x33')](_0x411fdb[_0x879c('0x34')]);_0x39ff5a[_0x879c('0x3d')]=_[_0x879c('0x35')](_0x39ff5a[_0x879c('0x36')],_0x39ff5a[_0x879c('0x34')]);_0x5aa06f[_0x879c('0x37')]=_[_0x879c('0x35')](_0x39ff5a[_0x879c('0x36')],qs[_0x879c('0x38')](_0x411fdb[_0x879c('0x34')][_0x879c('0x38')]));_0x5aa06f['attributes']=_0x5aa06f[_0x879c('0x37')][_0x879c('0x39')]?_0x5aa06f['attributes']:_0x39ff5a['model'];if(_0x411fdb['query'][_0x879c('0x44')]){_0x5aa06f[_0x879c('0x45')]=[{'all':!![]}];}_0x5aa06f=_['merge']({},_0x5aa06f,_0x411fdb[_0x879c('0x43')]);return db[_0x879c('0x2f')][_0x879c('0x4b')](_0x5aa06f)[_0x879c('0x28')](handleEntityNotFound(_0x2643db,null))[_0x879c('0x28')](respondWithResult(_0x2643db,null))[_0x879c('0x48')](handleError(_0x2643db,null));};exports['create']=function(_0x25258a,_0x369e92){return db['FreshsalesField']['create'](_0x25258a['body'],{})['then'](respondWithResult(_0x369e92,0xc9))['catch'](handleError(_0x369e92,null));};exports[_0x879c('0x27')]=function(_0x3e91d5,_0x5e2476){if(_0x3e91d5[_0x879c('0x4c')]['id']){delete _0x3e91d5[_0x879c('0x4c')]['id'];}return db['FreshsalesField'][_0x879c('0x4b')]({'where':{'id':_0x3e91d5['params']['id']}})[_0x879c('0x28')](handleEntityNotFound(_0x5e2476,null))['then'](saveUpdates(_0x3e91d5[_0x879c('0x4c')],null))[_0x879c('0x28')](respondWithResult(_0x5e2476,null))[_0x879c('0x48')](handleError(_0x5e2476,null));};exports[_0x879c('0x29')]=function(_0x2f605a,_0x4d33cb){return db[_0x879c('0x2f')][_0x879c('0x4b')]({'where':{'id':_0x2f605a['params']['id']}})[_0x879c('0x28')](handleEntityNotFound(_0x4d33cb,null))[_0x879c('0x28')](removeEntity(_0x4d33cb,null))['catch'](handleError(_0x4d33cb,null));}; \ No newline at end of file +var _0x560e=['rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','rows','find','catch','create','body','params'];(function(_0x2ee693,_0x2e92cb){var _0x44e33f=function(_0x145e80){while(--_0x145e80){_0x2ee693['push'](_0x2ee693['shift']());}};_0x44e33f(++_0x2e92cb);}(_0x560e,0x84));var _0xe560=function(_0x319e2f,_0x468071){_0x319e2f=_0x319e2f-0x0;var _0x312c55=_0x560e[_0x319e2f];return _0x312c55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe560('0x0'));var zipdir=require(_0xe560('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe560('0x2'));var moment=require(_0xe560('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe560('0x4'));var path=require(_0xe560('0x5'));var sox=require(_0xe560('0x6'));var csv=require(_0xe560('0x7'));var ejs=require(_0xe560('0x8'));var fs=require('fs');var fs_extra=require(_0xe560('0x9'));var _=require(_0xe560('0xa'));var squel=require(_0xe560('0xb'));var crypto=require('crypto');var jsforce=require(_0xe560('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe560('0x7'));var querystring=require(_0xe560('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe560('0xe'));var logger=require(_0xe560('0xf'))(_0xe560('0x10'));var utils=require(_0xe560('0x11'));var config=require(_0xe560('0x12'));var licenseUtil=require(_0xe560('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ef221,_0xe01e11){_0xe01e11=_0xe01e11||0xcc;return function(_0x322ac6){if(_0x322ac6){return _0x5ef221[_0xe560('0x14')](_0xe01e11);}return _0x5ef221[_0xe560('0x15')](_0xe01e11)[_0xe560('0x16')]();};}function respondWithResult(_0x40ee76,_0x341ed0){_0x341ed0=_0x341ed0||0xc8;return function(_0x4aff94){if(_0x4aff94){return _0x40ee76[_0xe560('0x15')](_0x341ed0)[_0xe560('0x17')](_0x4aff94);}};}function respondWithFilteredResult(_0x343be7,_0x57c9ee){return function(_0x2ecd77){if(_0x2ecd77){var _0x469b1f=typeof _0x57c9ee[_0xe560('0x18')]===_0xe560('0x19')&&typeof _0x57c9ee[_0xe560('0x1a')]===_0xe560('0x19');var _0x32129c=_0x2ecd77[_0xe560('0x1b')];var _0x11f4e4=_0x469b1f?0x0:_0x57c9ee[_0xe560('0x18')];var _0x569e84=_0x469b1f?_0x2ecd77[_0xe560('0x1b')]:_0x57c9ee[_0xe560('0x18')]+_0x57c9ee[_0xe560('0x1a')];var _0x122e97;if(_0x569e84>=_0x32129c){_0x569e84=_0x32129c;_0x122e97=0xc8;}else{_0x122e97=0xce;}_0x343be7['status'](_0x122e97);return _0x343be7['set']('Content-Range',_0x11f4e4+'-'+_0x569e84+'/'+_0x32129c)[_0xe560('0x17')](_0x2ecd77);}return null;};}function patchUpdates(_0x294bd1){return function(_0x361d8f){try{jsonpatch[_0xe560('0x1c')](_0x361d8f,_0x294bd1,!![]);}catch(_0x4e6449){return BPromise['reject'](_0x4e6449);}return _0x361d8f[_0xe560('0x1d')]();};}function saveUpdates(_0x17f57f,_0x3c67fc){return function(_0x465045){if(_0x465045){return _0x465045[_0xe560('0x1e')](_0x17f57f)[_0xe560('0x1f')](function(_0x37b45c){return _0x37b45c;});}return null;};}function removeEntity(_0x110288,_0x164aba){return function(_0x4c8abb){if(_0x4c8abb){return _0x4c8abb[_0xe560('0x20')]()['then'](function(){_0x110288[_0xe560('0x15')](0xcc)[_0xe560('0x16')]();});}};}function handleEntityNotFound(_0x59c13c,_0x5a605d){return function(_0x1c6885){if(!_0x1c6885){_0x59c13c[_0xe560('0x14')](0x194);}return _0x1c6885;};}function handleError(_0x15434b,_0x3a2de0){_0x3a2de0=_0x3a2de0||0x1f4;return function(_0x3b0eb4){logger[_0xe560('0x21')](_0x3b0eb4['stack']);if(_0x3b0eb4[_0xe560('0x22')]){delete _0x3b0eb4[_0xe560('0x22')];}_0x15434b[_0xe560('0x15')](_0x3a2de0)[_0xe560('0x23')](_0x3b0eb4);};}exports['index']=function(_0x532cf5,_0x4fbdd8){var _0x47cd06={},_0x45ec52={},_0x403181={'count':0x0,'rows':[]};var _0x454cd1=_[_0xe560('0x24')](db[_0xe560('0x25')][_0xe560('0x26')],function(_0x1aded9){return{'name':_0x1aded9[_0xe560('0x27')],'type':_0x1aded9[_0xe560('0x28')][_0xe560('0x29')]};});_0x45ec52[_0xe560('0x2a')]=_[_0xe560('0x24')](_0x454cd1,_0xe560('0x22'));_0x45ec52['query']=_[_0xe560('0x2b')](_0x532cf5[_0xe560('0x2c')]);_0x45ec52[_0xe560('0x2d')]=_[_0xe560('0x2e')](_0x45ec52[_0xe560('0x2a')],_0x45ec52[_0xe560('0x2c')]);_0x47cd06['attributes']=_['intersection'](_0x45ec52[_0xe560('0x2a')],qs['fields'](_0x532cf5[_0xe560('0x2c')][_0xe560('0x2f')]));_0x47cd06[_0xe560('0x30')]=_0x47cd06[_0xe560('0x30')][_0xe560('0x31')]?_0x47cd06[_0xe560('0x30')]:_0x45ec52[_0xe560('0x2a')];if(!_0x532cf5[_0xe560('0x2c')][_0xe560('0x32')](_0xe560('0x33'))){_0x47cd06[_0xe560('0x1a')]=qs[_0xe560('0x1a')](_0x532cf5[_0xe560('0x2c')][_0xe560('0x1a')]);_0x47cd06[_0xe560('0x18')]=qs[_0xe560('0x18')](_0x532cf5[_0xe560('0x2c')][_0xe560('0x18')]);}_0x47cd06[_0xe560('0x34')]=qs[_0xe560('0x35')](_0x532cf5[_0xe560('0x2c')][_0xe560('0x35')]);_0x47cd06['where']=qs[_0xe560('0x2d')](_[_0xe560('0x36')](_0x532cf5['query'],_0x45ec52[_0xe560('0x2d')]),_0x454cd1);if(_0x532cf5[_0xe560('0x2c')]['filter']){_0x47cd06[_0xe560('0x37')]=_[_0xe560('0x38')](_0x47cd06['where'],{'$or':_[_0xe560('0x24')](_0x454cd1,function(_0x2b3e0d){if(_0x2b3e0d[_0xe560('0x28')]!=='VIRTUAL'){var _0x1def68={};_0x1def68[_0x2b3e0d[_0xe560('0x22')]]={'$like':'%'+_0x532cf5[_0xe560('0x2c')][_0xe560('0x39')]+'%'};return _0x1def68;}})});}_0x47cd06=_[_0xe560('0x38')]({},_0x47cd06,_0x532cf5[_0xe560('0x3a')]);var _0x1f5b6e={'where':_0x47cd06[_0xe560('0x37')]};return db[_0xe560('0x25')]['count'](_0x1f5b6e)[_0xe560('0x1f')](function(_0x165cd4){_0x403181[_0xe560('0x1b')]=_0x165cd4;if(_0x532cf5['query'][_0xe560('0x3b')]){_0x47cd06['include']=[{'all':!![]}];}return db[_0xe560('0x25')]['findAll'](_0x47cd06);})[_0xe560('0x1f')](function(_0x323241){_0x403181[_0xe560('0x3c')]=_0x323241;return _0x403181;})['then'](respondWithFilteredResult(_0x4fbdd8,_0x47cd06))['catch'](handleError(_0x4fbdd8,null));};exports['show']=function(_0x917feb,_0x25a6a7){var _0x2334f1={'raw':!![],'where':{'id':_0x917feb['params']['id']}},_0x2c5fcf={};_0x2c5fcf[_0xe560('0x2a')]=_[_0xe560('0x2b')](db['FreshsalesField'][_0xe560('0x26')]);_0x2c5fcf['query']=_[_0xe560('0x2b')](_0x917feb[_0xe560('0x2c')]);_0x2c5fcf[_0xe560('0x2d')]=_[_0xe560('0x2e')](_0x2c5fcf[_0xe560('0x2a')],_0x2c5fcf[_0xe560('0x2c')]);_0x2334f1['attributes']=_[_0xe560('0x2e')](_0x2c5fcf['model'],qs[_0xe560('0x2f')](_0x917feb[_0xe560('0x2c')]['fields']));_0x2334f1['attributes']=_0x2334f1[_0xe560('0x30')]['length']?_0x2334f1[_0xe560('0x30')]:_0x2c5fcf['model'];if(_0x917feb[_0xe560('0x2c')][_0xe560('0x3b')]){_0x2334f1['include']=[{'all':!![]}];}_0x2334f1=_[_0xe560('0x38')]({},_0x2334f1,_0x917feb['options']);return db[_0xe560('0x25')][_0xe560('0x3d')](_0x2334f1)[_0xe560('0x1f')](handleEntityNotFound(_0x25a6a7,null))[_0xe560('0x1f')](respondWithResult(_0x25a6a7,null))[_0xe560('0x3e')](handleError(_0x25a6a7,null));};exports['create']=function(_0xea0f7e,_0x440645){return db[_0xe560('0x25')][_0xe560('0x3f')](_0xea0f7e[_0xe560('0x40')],{})[_0xe560('0x1f')](respondWithResult(_0x440645,0xc9))['catch'](handleError(_0x440645,null));};exports[_0xe560('0x1e')]=function(_0x5cb2c6,_0x263c2e){if(_0x5cb2c6[_0xe560('0x40')]['id']){delete _0x5cb2c6[_0xe560('0x40')]['id'];}return db[_0xe560('0x25')][_0xe560('0x3d')]({'where':{'id':_0x5cb2c6[_0xe560('0x41')]['id']}})[_0xe560('0x1f')](handleEntityNotFound(_0x263c2e,null))[_0xe560('0x1f')](saveUpdates(_0x5cb2c6[_0xe560('0x40')],null))[_0xe560('0x1f')](respondWithResult(_0x263c2e,null))[_0xe560('0x3e')](handleError(_0x263c2e,null));};exports[_0xe560('0x20')]=function(_0xd404b6,_0x505c87){return db[_0xe560('0x25')][_0xe560('0x3d')]({'where':{'id':_0xd404b6[_0xe560('0x41')]['id']}})[_0xe560('0x1f')](handleEntityNotFound(_0x505c87,null))[_0xe560('0x1f')](removeEntity(_0x505c87,null))['catch'](handleError(_0x505c87,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index f3cd1bd..236ed44 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 _0x20d6=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x55c379,_0x1565e6){var _0x1164e7=function(_0x2c7baa){while(--_0x2c7baa){_0x55c379['push'](_0x55c379['shift']());}};_0x1164e7(++_0x1565e6);}(_0x20d6,0x1b8));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var logger=require(_0x620d('0x2'))(_0x620d('0x3'));var moment=require('moment');var BPromise=require(_0x620d('0x4'));var rp=require(_0x620d('0x5'));var fs=require('fs');var path=require(_0x620d('0x6'));var rimraf=require(_0x620d('0x7'));var config=require(_0x620d('0x8'));var attributes=require(_0x620d('0x9'));module[_0x620d('0xa')]=function(_0x46fc14,_0x28e29a){return _0x46fc14[_0x620d('0xb')](_0x620d('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x620d('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4329=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','freshsales_unique_index','idField'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x4329,0x13b));var _0x9432=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4329[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var logger=require(_0x9432('0x2'))(_0x9432('0x3'));var moment=require(_0x9432('0x4'));var BPromise=require(_0x9432('0x5'));var rp=require(_0x9432('0x6'));var fs=require('fs');var path=require(_0x9432('0x7'));var rimraf=require(_0x9432('0x8'));var config=require(_0x9432('0x9'));var attributes=require(_0x9432('0xa'));module[_0x9432('0xb')]=function(_0x1ca7e0,_0x27edef){return _0x1ca7e0['define'](_0x9432('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x9432('0xd'),'fields':[_0x9432('0xe'),'FieldId'],'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 d8347ab..bb77755 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 _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xfcf0[_0x3eb713];return _0x1d7128;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e4764,_0x574f8d){var _0x37506a=function(_0x14f787){while(--_0x14f787){_0x2e4764['push'](_0x2e4764['shift']());}};_0x37506a(++_0x574f8d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x46e1a8,_0x6a426e){_0x46e1a8=_0x46e1a8-0x0;var _0x3c0da3=_0xc6ac[_0x46e1a8];return _0x3c0da3;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index f8fc819..ad71e40 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(_0x5682d0,_0x45c554){var _0x5f5b14=function(_0x400a78){while(--_0x400a78){_0x5682d0['push'](_0x5682d0['shift']());}};_0x5f5b14(++_0x45c554);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x1d4c8a,_0x32b8a1){var _0x11d7ec=function(_0xcb816c){while(--_0xcb816c){_0x1d4c8a['push'](_0x1d4c8a['shift']());}};_0x11d7ec(++_0x32b8a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 8698b86..da672e3 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 _0x2080=['STRING','username','ENUM','integrationTab','newTab'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x2080,0x19f));var _0x0208=function(_0x3dd3bc,_0x32950b){_0x3dd3bc=_0x3dd3bc-0x0;var _0x172373=_0x2080[_0x3dd3bc];return _0x172373;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0208('0x0')]},'description':{'type':Sequelize[_0x0208('0x0')]},'username':{'type':Sequelize[_0x0208('0x0')],'unique':_0x0208('0x1')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0208('0x0')]},'clientId':{'type':Sequelize[_0x0208('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x0208('0x0')]},'serverUrl':{'type':Sequelize[_0x0208('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x0208('0x2')](_0x0208('0x3'),_0x0208('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xfdbf=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x2fa31e,_0x1848a0){var _0x5a5218=function(_0x587b36){while(--_0x587b36){_0x2fa31e['push'](_0x2fa31e['shift']());}};_0x5a5218(++_0x1848a0);}(_0xfdbf,0xb5));var _0xffdb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xfdbf[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0xffdb('0x0'));module[_0xffdb('0x1')]={'name':{'type':Sequelize[_0xffdb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xffdb('0x2')],'unique':_0xffdb('0x3')},'remoteUri':{'type':Sequelize[_0xffdb('0x2')]},'password':{'type':Sequelize[_0xffdb('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xffdb('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xffdb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xffdb('0x4')](_0xffdb('0x5'),_0xffdb('0x6')),'defaultValue':_0xffdb('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3da554c..d1db5c6 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 _0xabb6=['SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','email','textarea','phone','remove','includes','custom','picklistValues','label','boolean','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','end','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','sort','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x16806a,_0x1f94e7){var _0x26c482=function(_0x2502f1){while(--_0x2502f1){_0x16806a['push'](_0x16806a['shift']());}};_0x26c482(++_0x1f94e7);}(_0xabb6,0x11f));var _0x6abb=function(_0x44dc5f,_0x4fe455){_0x44dc5f=_0x44dc5f-0x0;var _0x3eaf77=_0xabb6[_0x44dc5f];return _0x3eaf77;};'use strict';var emlformat=require(_0x6abb('0x0'));var rimraf=require(_0x6abb('0x1'));var zipdir=require(_0x6abb('0x2'));var jsonpatch=require(_0x6abb('0x3'));var rp=require(_0x6abb('0x4'));var moment=require(_0x6abb('0x5'));var BPromise=require(_0x6abb('0x6'));var Mustache=require(_0x6abb('0x7'));var util=require('util');var path=require(_0x6abb('0x8'));var sox=require('sox');var csv=require(_0x6abb('0x9'));var ejs=require(_0x6abb('0xa'));var fs=require('fs');var fs_extra=require(_0x6abb('0xb'));var _=require('lodash');var squel=require(_0x6abb('0xc'));var crypto=require('crypto');var jsforce=require(_0x6abb('0xd'));var deskjs=require(_0x6abb('0xe'));var toCsv=require(_0x6abb('0x9'));var querystring=require('querystring');var Papa=require(_0x6abb('0xf'));var Redis=require(_0x6abb('0x10'));var authService=require(_0x6abb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6abb('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6abb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6abb('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6abb('0x15'));function respondWithStatusCode(_0x5a56f9,_0x1dfa05){_0x1dfa05=_0x1dfa05||0xcc;return function(_0x446079){if(_0x446079){return _0x5a56f9[_0x6abb('0x16')](_0x1dfa05);}return _0x5a56f9[_0x6abb('0x17')](_0x1dfa05)['end']();};}function respondWithResult(_0x441f68,_0x14b306){_0x14b306=_0x14b306||0xc8;return function(_0x36a0f3){if(_0x36a0f3){return _0x441f68[_0x6abb('0x17')](_0x14b306)[_0x6abb('0x18')](_0x36a0f3);}};}function respondWithFilteredResult(_0x261e69,_0x58a294){return function(_0x555b9e){if(_0x555b9e){var _0x522909=typeof _0x58a294['offset']===_0x6abb('0x19')&&typeof _0x58a294[_0x6abb('0x1a')]===_0x6abb('0x19');var _0x31152c=_0x555b9e[_0x6abb('0x1b')];var _0x1c2b25=_0x522909?0x0:_0x58a294['offset'];var _0x4030f4=_0x522909?_0x555b9e[_0x6abb('0x1b')]:_0x58a294[_0x6abb('0x1c')]+_0x58a294[_0x6abb('0x1a')];var _0x54bbd4;if(_0x4030f4>=_0x31152c){_0x4030f4=_0x31152c;_0x54bbd4=0xc8;}else{_0x54bbd4=0xce;}_0x261e69[_0x6abb('0x17')](_0x54bbd4);return _0x261e69[_0x6abb('0x1d')]('Content-Range',_0x1c2b25+'-'+_0x4030f4+'/'+_0x31152c)['json'](_0x555b9e);}return null;};}function patchUpdates(_0x54d327){return function(_0x1519ca){try{jsonpatch['apply'](_0x1519ca,_0x54d327,!![]);}catch(_0x57eec6){return BPromise[_0x6abb('0x1e')](_0x57eec6);}return _0x1519ca[_0x6abb('0x1f')]();};}function saveUpdates(_0x14b99c,_0x440c9d){return function(_0x396abf){if(_0x396abf){return _0x396abf[_0x6abb('0x20')](_0x14b99c)[_0x6abb('0x21')](function(_0x4ac7ac){return _0x4ac7ac;});}return null;};}function removeEntity(_0x33049c,_0x710b51){return function(_0x398038){if(_0x398038){return _0x398038[_0x6abb('0x22')]()[_0x6abb('0x21')](function(){_0x33049c[_0x6abb('0x17')](0xcc)[_0x6abb('0x23')]();});}};}function handleEntityNotFound(_0x16eafd,_0x259f8a){return function(_0x4bc4e7){if(!_0x4bc4e7){_0x16eafd['sendStatus'](0x194);}return _0x4bc4e7;};}function handleError(_0xc3e269,_0x2c30cd){_0x2c30cd=_0x2c30cd||0x1f4;return function(_0x3c6041){logger[_0x6abb('0x24')](_0x3c6041['stack']);if(_0x3c6041[_0x6abb('0x25')]){delete _0x3c6041[_0x6abb('0x25')];}_0xc3e269[_0x6abb('0x17')](_0x2c30cd)[_0x6abb('0x26')](_0x3c6041);};}exports[_0x6abb('0x27')]=function(_0x9e41d1,_0x1284c3){var _0x2bb295={},_0x4c8957={},_0x9883a6={'count':0x0,'rows':[]};var _0x169ece=_[_0x6abb('0x28')](db[_0x6abb('0x29')][_0x6abb('0x2a')],function(_0x4b0a31){return{'name':_0x4b0a31[_0x6abb('0x2b')],'type':_0x4b0a31[_0x6abb('0x2c')][_0x6abb('0x2d')]};});_0x4c8957[_0x6abb('0x2e')]=_[_0x6abb('0x28')](_0x169ece,_0x6abb('0x25'));_0x4c8957[_0x6abb('0x2f')]=_[_0x6abb('0x30')](_0x9e41d1['query']);_0x4c8957[_0x6abb('0x31')]=_[_0x6abb('0x32')](_0x4c8957[_0x6abb('0x2e')],_0x4c8957['query']);_0x2bb295['attributes']=_[_0x6abb('0x32')](_0x4c8957[_0x6abb('0x2e')],qs[_0x6abb('0x33')](_0x9e41d1['query'][_0x6abb('0x33')]));_0x2bb295[_0x6abb('0x34')]=_0x2bb295[_0x6abb('0x34')][_0x6abb('0x35')]?_0x2bb295[_0x6abb('0x34')]:_0x4c8957[_0x6abb('0x2e')];if(!_0x9e41d1[_0x6abb('0x2f')][_0x6abb('0x36')](_0x6abb('0x37'))){_0x2bb295[_0x6abb('0x1a')]=qs[_0x6abb('0x1a')](_0x9e41d1[_0x6abb('0x2f')][_0x6abb('0x1a')]);_0x2bb295[_0x6abb('0x1c')]=qs[_0x6abb('0x1c')](_0x9e41d1['query']['offset']);}_0x2bb295[_0x6abb('0x38')]=qs['sort'](_0x9e41d1['query']['sort']);_0x2bb295[_0x6abb('0x39')]=qs['filters'](_[_0x6abb('0x3a')](_0x9e41d1[_0x6abb('0x2f')],_0x4c8957[_0x6abb('0x31')]),_0x169ece);if(_0x9e41d1[_0x6abb('0x2f')][_0x6abb('0x3b')]){_0x2bb295[_0x6abb('0x39')]=_['merge'](_0x2bb295['where'],{'$or':_[_0x6abb('0x28')](_0x169ece,function(_0x4c9143){if(_0x4c9143[_0x6abb('0x2c')]!==_0x6abb('0x3c')){var _0x144d74={};_0x144d74[_0x4c9143['name']]={'$like':'%'+_0x9e41d1[_0x6abb('0x2f')][_0x6abb('0x3b')]+'%'};return _0x144d74;}})});}_0x2bb295=_[_0x6abb('0x3d')]({},_0x2bb295,_0x9e41d1[_0x6abb('0x3e')]);var _0x1e2907={'where':_0x2bb295[_0x6abb('0x39')]};return db[_0x6abb('0x29')][_0x6abb('0x1b')](_0x1e2907)[_0x6abb('0x21')](function(_0x304540){_0x9883a6['count']=_0x304540;if(_0x9e41d1[_0x6abb('0x2f')][_0x6abb('0x3f')]){_0x2bb295[_0x6abb('0x40')]=[{'all':!![]}];}return db[_0x6abb('0x29')]['findAll'](_0x2bb295);})[_0x6abb('0x21')](function(_0x21b8f2){_0x9883a6[_0x6abb('0x41')]=_0x21b8f2;return _0x9883a6;})[_0x6abb('0x21')](respondWithFilteredResult(_0x1284c3,_0x2bb295))[_0x6abb('0x42')](handleError(_0x1284c3,null));};exports[_0x6abb('0x43')]=function(_0x8ec27c,_0x25d273){var _0x296a15={'raw':![],'where':{'id':_0x8ec27c[_0x6abb('0x44')]['id']}},_0x23b415={};_0x23b415[_0x6abb('0x2e')]=_['keys'](db['SalesforceAccount'][_0x6abb('0x2a')]);_0x23b415['query']=_[_0x6abb('0x30')](_0x8ec27c[_0x6abb('0x2f')]);_0x23b415[_0x6abb('0x31')]=_['intersection'](_0x23b415[_0x6abb('0x2e')],_0x23b415[_0x6abb('0x2f')]);_0x296a15[_0x6abb('0x34')]=_[_0x6abb('0x32')](_0x23b415['model'],qs[_0x6abb('0x33')](_0x8ec27c[_0x6abb('0x2f')][_0x6abb('0x33')]));_0x296a15[_0x6abb('0x34')]=_0x296a15['attributes']['length']?_0x296a15[_0x6abb('0x34')]:_0x23b415[_0x6abb('0x2e')];if(_0x8ec27c[_0x6abb('0x2f')][_0x6abb('0x3f')]){_0x296a15['include']=[{'all':!![]}];}_0x296a15=_['merge']({},_0x296a15,_0x8ec27c[_0x6abb('0x3e')]);return db[_0x6abb('0x29')][_0x6abb('0x45')](_0x296a15)[_0x6abb('0x21')](handleEntityNotFound(_0x25d273,null))[_0x6abb('0x21')](respondWithResult(_0x25d273,null))[_0x6abb('0x42')](handleError(_0x25d273,null));};exports['create']=function(_0x20098a,_0x485d75){return db[_0x6abb('0x29')][_0x6abb('0x46')](_0x20098a[_0x6abb('0x47')],{})[_0x6abb('0x21')](respondWithResult(_0x485d75,0xc9))[_0x6abb('0x42')](handleError(_0x485d75,null));};exports[_0x6abb('0x20')]=function(_0x5d04c9,_0x16c3c9){if(_0x5d04c9[_0x6abb('0x47')]['id']){delete _0x5d04c9[_0x6abb('0x47')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x5d04c9[_0x6abb('0x44')]['id']}})['then'](handleEntityNotFound(_0x16c3c9,null))['then'](saveUpdates(_0x5d04c9[_0x6abb('0x47')],null))[_0x6abb('0x21')](respondWithResult(_0x16c3c9,null))['catch'](handleError(_0x16c3c9,null));};exports[_0x6abb('0x22')]=function(_0x3bfb94,_0x13b041){return db[_0x6abb('0x29')][_0x6abb('0x45')]({'where':{'id':_0x3bfb94[_0x6abb('0x44')]['id']}})[_0x6abb('0x21')](handleEntityNotFound(_0x13b041,null))[_0x6abb('0x21')](removeEntity(_0x13b041,null))['catch'](handleError(_0x13b041,null));};exports[_0x6abb('0x48')]=function(_0x7a8c55,_0x58f476,_0xcc38ae){var _0x5364ad={};var _0x59bb44={};var _0x4ff6c4;var _0x37591d;return db['SalesforceAccount'][_0x6abb('0x49')]({'where':{'id':_0x7a8c55[_0x6abb('0x44')]['id']}})[_0x6abb('0x21')](handleEntityNotFound(_0x58f476,null))['then'](function(_0x53c20c){if(_0x53c20c){_0x4ff6c4=_0x53c20c;_0x59bb44[_0x6abb('0x2e')]=_[_0x6abb('0x30')](db[_0x6abb('0x4a')][_0x6abb('0x2a')]);_0x59bb44[_0x6abb('0x2f')]=_[_0x6abb('0x30')](_0x7a8c55['query']);_0x59bb44[_0x6abb('0x31')]=_[_0x6abb('0x32')](_0x59bb44['model'],_0x59bb44['query']);_0x5364ad[_0x6abb('0x34')]=_['intersection'](_0x59bb44[_0x6abb('0x2e')],qs['fields'](_0x7a8c55[_0x6abb('0x2f')]['fields']));_0x5364ad[_0x6abb('0x34')]=_0x5364ad[_0x6abb('0x34')][_0x6abb('0x35')]?_0x5364ad[_0x6abb('0x34')]:_0x59bb44[_0x6abb('0x2e')];_0x5364ad[_0x6abb('0x38')]=qs[_0x6abb('0x4b')](_0x7a8c55[_0x6abb('0x2f')][_0x6abb('0x4b')]);_0x5364ad[_0x6abb('0x39')]=qs[_0x6abb('0x31')](_[_0x6abb('0x3a')](_0x7a8c55[_0x6abb('0x2f')],_0x59bb44[_0x6abb('0x31')]));if(_0x7a8c55[_0x6abb('0x2f')][_0x6abb('0x3b')]){_0x5364ad[_0x6abb('0x39')]=_[_0x6abb('0x3d')](_0x5364ad[_0x6abb('0x39')],{'$or':_['map'](_0x5364ad[_0x6abb('0x34')],function(_0x152bfd){var _0x1c1554={};_0x1c1554[_0x152bfd]={'$like':'%'+_0x7a8c55[_0x6abb('0x2f')][_0x6abb('0x3b')]+'%'};return _0x1c1554;})});}_0x5364ad=_[_0x6abb('0x3d')]({},_0x5364ad,_0x7a8c55[_0x6abb('0x3e')]);return _0x4ff6c4[_0x6abb('0x48')](_0x5364ad);}})[_0x6abb('0x21')](function(_0xbee6c4){if(_0xbee6c4){_0x37591d=_0xbee6c4[_0x6abb('0x35')];if(!_0x7a8c55['query'][_0x6abb('0x36')]('nolimit')){_0x5364ad[_0x6abb('0x1a')]=qs[_0x6abb('0x1a')](_0x7a8c55[_0x6abb('0x2f')]['limit']);_0x5364ad['offset']=qs[_0x6abb('0x1c')](_0x7a8c55[_0x6abb('0x2f')][_0x6abb('0x1c')]);}return _0x4ff6c4[_0x6abb('0x48')](_0x5364ad);}})['then'](function(_0x2df345){if(_0x2df345){return _0x2df345?{'count':_0x37591d,'rows':_0x2df345}:null;}})[_0x6abb('0x21')](respondWithResult(_0x58f476,null))['catch'](handleError(_0x58f476,null));};exports[_0x6abb('0x4c')]=function(_0x21c43c,_0x1a122d,_0x40a619){if(_0x21c43c[_0x6abb('0x47')]['id']){delete _0x21c43c[_0x6abb('0x47')]['id'];}return db[_0x6abb('0x29')][_0x6abb('0x49')]({'where':{'id':_0x21c43c['params']['id']}})[_0x6abb('0x21')](handleEntityNotFound(_0x1a122d,null))[_0x6abb('0x21')](function(_0x389071){if(_0x389071){_0x21c43c['body'][_0x6abb('0x4d')]=_0x389071['id'];_0x21c43c['body']['Subjects']=integrations[_0x6abb('0x4e')](_0x21c43c[_0x6abb('0x47')][_0x6abb('0x4f')],_0x21c43c['body'][_0x6abb('0x2c')]);_0x21c43c[_0x6abb('0x47')][_0x6abb('0x50')]=integrations[_0x6abb('0x51')](_0x21c43c[_0x6abb('0x47')][_0x6abb('0x4f')],_0x21c43c[_0x6abb('0x47')][_0x6abb('0x2c')]);return db['SalesforceConfiguration'][_0x6abb('0x46')](_0x21c43c[_0x6abb('0x47')],{'include':[{'model':db[_0x6abb('0x52')],'as':_0x6abb('0x53')},{'model':db[_0x6abb('0x52')],'as':_0x6abb('0x50')}]});}return null;})[_0x6abb('0x21')](respondWithResult(_0x1a122d,null))['catch'](handleError(_0x1a122d,null));};exports[_0x6abb('0x54')]=function(_0x12ded7,_0x4373d6,_0x53cef2){var _0x5ef695;var _0x10672e='';var _0x49985a=_0x6abb('0x55');return db[_0x6abb('0x29')][_0x6abb('0x49')]({'where':{'id':_0x12ded7['params']['id']},'attributes':['id',_0x6abb('0x56'),_0x6abb('0x57'),_0x6abb('0x58'),_0x6abb('0x59'),_0x6abb('0x5a'),'securityToken']})[_0x6abb('0x21')](handleEntityNotFound(_0x4373d6,null))[_0x6abb('0x21')](function(_0x57ba6f){if(_0x57ba6f){_0x10672e=_0x57ba6f[_0x6abb('0x56')];var _0x324748=_0x10672e[_0x6abb('0x5b')](-0x1);if(_0x324748==='/'){_0x10672e=_0x10672e[_0x6abb('0x5c')](0x0,_0x10672e[_0x6abb('0x5d')](_0x324748));}_0x5ef695=new jsforce[(_0x6abb('0x5e'))]({'oauth2':{'loginUrl':_0x10672e,'clientId':_0x57ba6f['clientId'],'clientSecret':_0x57ba6f['clientSecret']}});return _0x5ef695[_0x6abb('0x5f')](_0x57ba6f['username'],_0x57ba6f[_0x6abb('0x5a')][_0x6abb('0x60')](_0x57ba6f[_0x6abb('0x61')]));}})[_0x6abb('0x21')](function(_0x1bb022){if(_0x1bb022){if(!_[_0x6abb('0x62')](_0x12ded7['query'][_0x6abb('0x63')])){_0x49985a=_0x12ded7['query'][_0x6abb('0x63')];}return _0x5ef695['sobject'](_0x49985a)[_0x6abb('0x64')]();}})[_0x6abb('0x21')](function(_0x30ac8b){var _0x119f85=[_0x6abb('0x65'),_0x6abb('0x66'),_0x6abb('0x67'),_0x6abb('0x68'),'Subject',_0x6abb('0x69')];var _0x51b01b=[_0x6abb('0x6a'),_0x6abb('0x6b'),'picklist','boolean',_0x6abb('0x6c'),_0x6abb('0x6d'),_0x6abb('0x6e')];if(_0x30ac8b){_[_0x6abb('0x6f')](_0x30ac8b['fields'],function(_0xda747a){return _0x119f85[_0x6abb('0x70')](_0xda747a[_0x6abb('0x25')])||!_0x51b01b[_0x6abb('0x70')](_0xda747a['type']);});return{'count':_0x30ac8b[_0x6abb('0x33')]['length'],'rows':_[_0x6abb('0x28')](_0x30ac8b[_0x6abb('0x33')],function(_0x5c3962){return{'id':_0x5c3962['name'],'name':_0x5c3962['label'],'custom':_0x5c3962[_0x6abb('0x71')],'options':_0x5c3962[_0x6abb('0x72')][_0x6abb('0x35')]>0x0?_['map'](_0x5c3962[_0x6abb('0x72')],function(_0x2d2ba0){return{'name':_0x2d2ba0[_0x6abb('0x73')],'value':_0x2d2ba0['value']};}):_0x5c3962[_0x6abb('0x2c')]==_0x6abb('0x74')?[{'name':'True','value':_0x6abb('0x75')},{'name':_0x6abb('0x76'),'value':'false'}]:[]};})};}})[_0x6abb('0x21')](respondWithResult(_0x4373d6,null))[_0x6abb('0x42')](function(_0x39559e){var _0x1b1f86=_0x12ded7[_0x6abb('0x2f')][_0x6abb('0x77')]?0x1f4:_0x39559e['statusCode']||0x1f4;logger['error'](_0x6abb('0x78'),_0x6abb('0x54'),_0x1b1f86,JSON[_0x6abb('0x79')](_0x39559e));delete _0x39559e[_0x6abb('0x25')];if(_0x1b1f86===0x191){_0x1b1f86=0x190;}_0x4373d6[_0x6abb('0x17')](_0x1b1f86)[_0x6abb('0x26')](_0x12ded7['query'][_0x6abb('0x77')]?{'message':_0x6abb('0x7a'),'statusCode':_0x39559e['statusCode']}:_0x39559e);});}; \ No newline at end of file +var _0x16d0=['../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','merge','create','body','update','find','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','Connection','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','includes','custom','picklistValues','label','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x16d0,0xe8));var _0x016d=function(_0xd2ff9f,_0x516361){_0xd2ff9f=_0xd2ff9f-0x0;var _0x188fbc=_0x16d0[_0xd2ff9f];return _0x188fbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x016d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x016d('0x1'));var rp=require(_0x016d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x016d('0x3'));var util=require(_0x016d('0x4'));var path=require(_0x016d('0x5'));var sox=require(_0x016d('0x6'));var csv=require('to-csv');var ejs=require(_0x016d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x016d('0x8'));var squel=require(_0x016d('0x9'));var crypto=require('crypto');var jsforce=require(_0x016d('0xa'));var deskjs=require(_0x016d('0xb'));var toCsv=require(_0x016d('0xc'));var querystring=require(_0x016d('0xd'));var Papa=require('papaparse');var Redis=require(_0x016d('0xe'));var authService=require(_0x016d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x016d('0x10'));var hardwareService=require(_0x016d('0x11'));var logger=require(_0x016d('0x12'))(_0x016d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x016d('0x14'))['db'];var integrations=require(_0x016d('0x15'));function respondWithStatusCode(_0x251b9d,_0x1a7240){_0x1a7240=_0x1a7240||0xcc;return function(_0x15884b){if(_0x15884b){return _0x251b9d[_0x016d('0x16')](_0x1a7240);}return _0x251b9d['status'](_0x1a7240)[_0x016d('0x17')]();};}function respondWithResult(_0x221873,_0x145806){_0x145806=_0x145806||0xc8;return function(_0x524c63){if(_0x524c63){return _0x221873[_0x016d('0x18')](_0x145806)[_0x016d('0x19')](_0x524c63);}};}function respondWithFilteredResult(_0x1ca8c8,_0xd1af7d){return function(_0x41742c){if(_0x41742c){var _0x514c64=typeof _0xd1af7d[_0x016d('0x1a')]===_0x016d('0x1b')&&typeof _0xd1af7d[_0x016d('0x1c')]===_0x016d('0x1b');var _0x483d11=_0x41742c[_0x016d('0x1d')];var _0xbafebd=_0x514c64?0x0:_0xd1af7d[_0x016d('0x1a')];var _0x5ef360=_0x514c64?_0x41742c[_0x016d('0x1d')]:_0xd1af7d[_0x016d('0x1a')]+_0xd1af7d['limit'];var _0xcc85be;if(_0x5ef360>=_0x483d11){_0x5ef360=_0x483d11;_0xcc85be=0xc8;}else{_0xcc85be=0xce;}_0x1ca8c8['status'](_0xcc85be);return _0x1ca8c8[_0x016d('0x1e')](_0x016d('0x1f'),_0xbafebd+'-'+_0x5ef360+'/'+_0x483d11)['json'](_0x41742c);}return null;};}function patchUpdates(_0x20435b){return function(_0x47ee03){try{jsonpatch[_0x016d('0x20')](_0x47ee03,_0x20435b,!![]);}catch(_0x17cd4b){return BPromise[_0x016d('0x21')](_0x17cd4b);}return _0x47ee03[_0x016d('0x22')]();};}function saveUpdates(_0x3033e8,_0x4730ab){return function(_0x35ddb8){if(_0x35ddb8){return _0x35ddb8['update'](_0x3033e8)[_0x016d('0x23')](function(_0x3b8dab){return _0x3b8dab;});}return null;};}function removeEntity(_0x3f604d,_0x243f4c){return function(_0x4b634e){if(_0x4b634e){return _0x4b634e[_0x016d('0x24')]()['then'](function(){_0x3f604d[_0x016d('0x18')](0xcc)[_0x016d('0x17')]();});}};}function handleEntityNotFound(_0x1f47d4,_0x5cc46e){return function(_0x5d1a73){if(!_0x5d1a73){_0x1f47d4[_0x016d('0x16')](0x194);}return _0x5d1a73;};}function handleError(_0x16d781,_0x43c0ae){_0x43c0ae=_0x43c0ae||0x1f4;return function(_0x248b23){logger[_0x016d('0x25')](_0x248b23[_0x016d('0x26')]);if(_0x248b23[_0x016d('0x27')]){delete _0x248b23[_0x016d('0x27')];}_0x16d781[_0x016d('0x18')](_0x43c0ae)['send'](_0x248b23);};}exports[_0x016d('0x28')]=function(_0x36d2de,_0x3f9d7e){var _0x48d0b9={},_0x4896fa={},_0x108b80={'count':0x0,'rows':[]};var _0x11fd76=_[_0x016d('0x29')](db[_0x016d('0x2a')]['rawAttributes'],function(_0x1180e4){return{'name':_0x1180e4[_0x016d('0x2b')],'type':_0x1180e4[_0x016d('0x2c')][_0x016d('0x2d')]};});_0x4896fa[_0x016d('0x2e')]=_['map'](_0x11fd76,_0x016d('0x27'));_0x4896fa[_0x016d('0x2f')]=_[_0x016d('0x30')](_0x36d2de[_0x016d('0x2f')]);_0x4896fa[_0x016d('0x31')]=_['intersection'](_0x4896fa[_0x016d('0x2e')],_0x4896fa['query']);_0x48d0b9[_0x016d('0x32')]=_[_0x016d('0x33')](_0x4896fa[_0x016d('0x2e')],qs[_0x016d('0x34')](_0x36d2de[_0x016d('0x2f')][_0x016d('0x34')]));_0x48d0b9[_0x016d('0x32')]=_0x48d0b9[_0x016d('0x32')][_0x016d('0x35')]?_0x48d0b9[_0x016d('0x32')]:_0x4896fa[_0x016d('0x2e')];if(!_0x36d2de['query'][_0x016d('0x36')](_0x016d('0x37'))){_0x48d0b9[_0x016d('0x1c')]=qs[_0x016d('0x1c')](_0x36d2de[_0x016d('0x2f')][_0x016d('0x1c')]);_0x48d0b9[_0x016d('0x1a')]=qs['offset'](_0x36d2de[_0x016d('0x2f')][_0x016d('0x1a')]);}_0x48d0b9['order']=qs[_0x016d('0x38')](_0x36d2de['query'][_0x016d('0x38')]);_0x48d0b9['where']=qs[_0x016d('0x31')](_[_0x016d('0x39')](_0x36d2de[_0x016d('0x2f')],_0x4896fa[_0x016d('0x31')]),_0x11fd76);if(_0x36d2de[_0x016d('0x2f')][_0x016d('0x3a')]){_0x48d0b9[_0x016d('0x3b')]=_['merge'](_0x48d0b9[_0x016d('0x3b')],{'$or':_[_0x016d('0x29')](_0x11fd76,function(_0x4d1653){if(_0x4d1653[_0x016d('0x2c')]!==_0x016d('0x3c')){var _0x35b08f={};_0x35b08f[_0x4d1653['name']]={'$like':'%'+_0x36d2de[_0x016d('0x2f')][_0x016d('0x3a')]+'%'};return _0x35b08f;}})});}_0x48d0b9=_['merge']({},_0x48d0b9,_0x36d2de[_0x016d('0x3d')]);var _0x3a218b={'where':_0x48d0b9[_0x016d('0x3b')]};return db[_0x016d('0x2a')]['count'](_0x3a218b)[_0x016d('0x23')](function(_0x379e78){_0x108b80[_0x016d('0x1d')]=_0x379e78;if(_0x36d2de[_0x016d('0x2f')]['includeAll']){_0x48d0b9[_0x016d('0x3e')]=[{'all':!![]}];}return db[_0x016d('0x2a')]['findAll'](_0x48d0b9);})[_0x016d('0x23')](function(_0x415e57){_0x108b80[_0x016d('0x3f')]=_0x415e57;return _0x108b80;})[_0x016d('0x23')](respondWithFilteredResult(_0x3f9d7e,_0x48d0b9))[_0x016d('0x40')](handleError(_0x3f9d7e,null));};exports[_0x016d('0x41')]=function(_0x198096,_0x4d79b6){var _0x1ec959={'raw':![],'where':{'id':_0x198096[_0x016d('0x42')]['id']}},_0x35f759={};_0x35f759['model']=_[_0x016d('0x30')](db[_0x016d('0x2a')][_0x016d('0x43')]);_0x35f759[_0x016d('0x2f')]=_[_0x016d('0x30')](_0x198096['query']);_0x35f759[_0x016d('0x31')]=_[_0x016d('0x33')](_0x35f759['model'],_0x35f759[_0x016d('0x2f')]);_0x1ec959[_0x016d('0x32')]=_['intersection'](_0x35f759['model'],qs[_0x016d('0x34')](_0x198096[_0x016d('0x2f')][_0x016d('0x34')]));_0x1ec959[_0x016d('0x32')]=_0x1ec959['attributes'][_0x016d('0x35')]?_0x1ec959[_0x016d('0x32')]:_0x35f759[_0x016d('0x2e')];if(_0x198096[_0x016d('0x2f')][_0x016d('0x44')]){_0x1ec959['include']=[{'all':!![]}];}_0x1ec959=_[_0x016d('0x45')]({},_0x1ec959,_0x198096[_0x016d('0x3d')]);return db[_0x016d('0x2a')]['find'](_0x1ec959)[_0x016d('0x23')](handleEntityNotFound(_0x4d79b6,null))[_0x016d('0x23')](respondWithResult(_0x4d79b6,null))[_0x016d('0x40')](handleError(_0x4d79b6,null));};exports[_0x016d('0x46')]=function(_0x3adea4,_0x18806b){return db[_0x016d('0x2a')][_0x016d('0x46')](_0x3adea4[_0x016d('0x47')],{})[_0x016d('0x23')](respondWithResult(_0x18806b,0xc9))['catch'](handleError(_0x18806b,null));};exports[_0x016d('0x48')]=function(_0x2ca7cb,_0xc077ee){if(_0x2ca7cb[_0x016d('0x47')]['id']){delete _0x2ca7cb[_0x016d('0x47')]['id'];}return db[_0x016d('0x2a')][_0x016d('0x49')]({'where':{'id':_0x2ca7cb[_0x016d('0x42')]['id']}})[_0x016d('0x23')](handleEntityNotFound(_0xc077ee,null))[_0x016d('0x23')](saveUpdates(_0x2ca7cb[_0x016d('0x47')],null))[_0x016d('0x23')](respondWithResult(_0xc077ee,null))[_0x016d('0x40')](handleError(_0xc077ee,null));};exports[_0x016d('0x24')]=function(_0x1eb715,_0x535f09){return db[_0x016d('0x2a')][_0x016d('0x49')]({'where':{'id':_0x1eb715['params']['id']}})[_0x016d('0x23')](handleEntityNotFound(_0x535f09,null))[_0x016d('0x23')](removeEntity(_0x535f09,null))[_0x016d('0x40')](handleError(_0x535f09,null));};exports[_0x016d('0x4a')]=function(_0x1210c0,_0x1f39ef,_0x3c3464){var _0x26ba57={};var _0x40e740={};var _0x383ae8;var _0x5861d3;return db[_0x016d('0x2a')][_0x016d('0x4b')]({'where':{'id':_0x1210c0['params']['id']}})[_0x016d('0x23')](handleEntityNotFound(_0x1f39ef,null))['then'](function(_0x25703c){if(_0x25703c){_0x383ae8=_0x25703c;_0x40e740[_0x016d('0x2e')]=_[_0x016d('0x30')](db[_0x016d('0x4c')]['rawAttributes']);_0x40e740[_0x016d('0x2f')]=_[_0x016d('0x30')](_0x1210c0[_0x016d('0x2f')]);_0x40e740[_0x016d('0x31')]=_[_0x016d('0x33')](_0x40e740['model'],_0x40e740[_0x016d('0x2f')]);_0x26ba57[_0x016d('0x32')]=_[_0x016d('0x33')](_0x40e740[_0x016d('0x2e')],qs[_0x016d('0x34')](_0x1210c0['query'][_0x016d('0x34')]));_0x26ba57[_0x016d('0x32')]=_0x26ba57[_0x016d('0x32')][_0x016d('0x35')]?_0x26ba57[_0x016d('0x32')]:_0x40e740[_0x016d('0x2e')];_0x26ba57[_0x016d('0x4d')]=qs[_0x016d('0x38')](_0x1210c0[_0x016d('0x2f')][_0x016d('0x38')]);_0x26ba57[_0x016d('0x3b')]=qs[_0x016d('0x31')](_['pick'](_0x1210c0[_0x016d('0x2f')],_0x40e740[_0x016d('0x31')]));if(_0x1210c0['query'][_0x016d('0x3a')]){_0x26ba57[_0x016d('0x3b')]=_['merge'](_0x26ba57[_0x016d('0x3b')],{'$or':_[_0x016d('0x29')](_0x26ba57['attributes'],function(_0x26d3fa){var _0x173114={};_0x173114[_0x26d3fa]={'$like':'%'+_0x1210c0['query'][_0x016d('0x3a')]+'%'};return _0x173114;})});}_0x26ba57=_[_0x016d('0x45')]({},_0x26ba57,_0x1210c0['options']);return _0x383ae8['getConfigurations'](_0x26ba57);}})['then'](function(_0x67ee6b){if(_0x67ee6b){_0x5861d3=_0x67ee6b[_0x016d('0x35')];if(!_0x1210c0['query'][_0x016d('0x36')](_0x016d('0x37'))){_0x26ba57[_0x016d('0x1c')]=qs['limit'](_0x1210c0[_0x016d('0x2f')][_0x016d('0x1c')]);_0x26ba57[_0x016d('0x1a')]=qs['offset'](_0x1210c0[_0x016d('0x2f')][_0x016d('0x1a')]);}return _0x383ae8[_0x016d('0x4a')](_0x26ba57);}})['then'](function(_0x2f0f2a){if(_0x2f0f2a){return _0x2f0f2a?{'count':_0x5861d3,'rows':_0x2f0f2a}:null;}})[_0x016d('0x23')](respondWithResult(_0x1f39ef,null))[_0x016d('0x40')](handleError(_0x1f39ef,null));};exports[_0x016d('0x4e')]=function(_0x471016,_0x4798cb,_0xe92165){if(_0x471016['body']['id']){delete _0x471016[_0x016d('0x47')]['id'];}return db[_0x016d('0x2a')][_0x016d('0x4b')]({'where':{'id':_0x471016[_0x016d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4798cb,null))[_0x016d('0x23')](function(_0x137da5){if(_0x137da5){_0x471016['body'][_0x016d('0x4f')]=_0x137da5['id'];_0x471016[_0x016d('0x47')][_0x016d('0x50')]=integrations[_0x016d('0x51')](_0x471016[_0x016d('0x47')][_0x016d('0x52')],_0x471016[_0x016d('0x47')][_0x016d('0x2c')]);_0x471016['body'][_0x016d('0x53')]=integrations['getDescriptions'](_0x471016[_0x016d('0x47')]['channel'],_0x471016[_0x016d('0x47')]['type']);return db[_0x016d('0x4c')]['create'](_0x471016[_0x016d('0x47')],{'include':[{'model':db['SalesforceField'],'as':_0x016d('0x50')},{'model':db[_0x016d('0x54')],'as':_0x016d('0x53')}]});}return null;})['then'](respondWithResult(_0x4798cb,null))[_0x016d('0x40')](handleError(_0x4798cb,null));};exports[_0x016d('0x55')]=function(_0x358411,_0x5d41d1,_0x11d31b){var _0x3b96cc;var _0x47f569='';var _0x32d672=_0x016d('0x56');return db[_0x016d('0x2a')]['findOne']({'where':{'id':_0x358411[_0x016d('0x42')]['id']},'attributes':['id','remoteUri',_0x016d('0x57'),_0x016d('0x58'),_0x016d('0x59'),_0x016d('0x5a'),_0x016d('0x5b')]})[_0x016d('0x23')](handleEntityNotFound(_0x5d41d1,null))[_0x016d('0x23')](function(_0x393f03){if(_0x393f03){_0x47f569=_0x393f03[_0x016d('0x5c')];var _0x3ce52a=_0x47f569[_0x016d('0x5d')](-0x1);if(_0x3ce52a==='/'){_0x47f569=_0x47f569[_0x016d('0x5e')](0x0,_0x47f569['lastIndexOf'](_0x3ce52a));}_0x3b96cc=new jsforce[(_0x016d('0x5f'))]({'oauth2':{'loginUrl':_0x47f569,'clientId':_0x393f03[_0x016d('0x57')],'clientSecret':_0x393f03['clientSecret']}});return _0x3b96cc[_0x016d('0x60')](_0x393f03[_0x016d('0x59')],_0x393f03[_0x016d('0x5a')][_0x016d('0x61')](_0x393f03[_0x016d('0x5b')]));}})[_0x016d('0x23')](function(_0x5e758a){if(_0x5e758a){if(!_[_0x016d('0x62')](_0x358411['query'][_0x016d('0x63')])){_0x32d672=_0x358411[_0x016d('0x2f')][_0x016d('0x63')];}return _0x3b96cc['sobject'](_0x32d672)[_0x016d('0x64')]();}})[_0x016d('0x23')](function(_0x3ecbed){var _0xfa6001=[_0x016d('0x65'),_0x016d('0x66'),_0x016d('0x67'),_0x016d('0x68'),_0x016d('0x69'),'Description'];var _0x36fa49=[_0x016d('0x6a'),_0x016d('0x6b'),_0x016d('0x6c'),_0x016d('0x6d'),_0x016d('0x6e'),_0x016d('0x6f'),'phone'];if(_0x3ecbed){_['remove'](_0x3ecbed[_0x016d('0x34')],function(_0x27a1e1){return _0xfa6001['includes'](_0x27a1e1[_0x016d('0x27')])||!_0x36fa49[_0x016d('0x70')](_0x27a1e1['type']);});return{'count':_0x3ecbed['fields']['length'],'rows':_['map'](_0x3ecbed[_0x016d('0x34')],function(_0x5ad601){return{'id':_0x5ad601[_0x016d('0x27')],'name':_0x5ad601['label'],'custom':_0x5ad601[_0x016d('0x71')],'options':_0x5ad601[_0x016d('0x72')][_0x016d('0x35')]>0x0?_['map'](_0x5ad601['picklistValues'],function(_0x3553dc){return{'name':_0x3553dc[_0x016d('0x73')],'value':_0x3553dc[_0x016d('0x74')]};}):_0x5ad601[_0x016d('0x2c')]==_0x016d('0x6d')?[{'name':_0x016d('0x75'),'value':_0x016d('0x76')},{'name':_0x016d('0x77'),'value':_0x016d('0x78')}]:[]};})};}})['then'](respondWithResult(_0x5d41d1,null))[_0x016d('0x40')](function(_0x357bcd){var _0x13a945=_0x358411[_0x016d('0x2f')][_0x016d('0x79')]?0x1f4:_0x357bcd[_0x016d('0x7a')]||0x1f4;logger[_0x016d('0x25')](_0x016d('0x7b'),'getFields',_0x13a945,JSON['stringify'](_0x357bcd));delete _0x357bcd[_0x016d('0x27')];if(_0x13a945===0x191){_0x13a945=0x190;}_0x5d41d1[_0x016d('0x18')](_0x13a945)[_0x016d('0x7c')](_0x358411[_0x016d('0x2f')][_0x016d('0x79')]?{'message':_0x016d('0x7d'),'statusCode':_0x357bcd[_0x016d('0x7a')]}:_0x357bcd);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0bb87f7..d2198ea 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 _0x684d=['api','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger'];(function(_0x4dd838,_0x2209b0){var _0x446118=function(_0xa847eb){while(--_0xa847eb){_0x4dd838['push'](_0x4dd838['shift']());}};_0x446118(++_0x2209b0);}(_0x684d,0x174));var _0xd684=function(_0x1441ba,_0xf0df81){_0x1441ba=_0x1441ba-0x0;var _0x397320=_0x684d[_0x1441ba];return _0x397320;};'use strict';var _=require('lodash');var util=require(_0xd684('0x0'));var logger=require(_0xd684('0x1'))(_0xd684('0x2'));var moment=require('moment');var BPromise=require(_0xd684('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd684('0x4'));var rimraf=require(_0xd684('0x5'));var config=require(_0xd684('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xd684('0x7'));module['exports']=function(_0x3bf907,_0x51350a){return _0x3bf907[_0xd684('0x8')](_0xd684('0x9'),attributes,{'tableName':_0xd684('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa83=['path','rimraf','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c24f7,_0x3ab16d){var _0x1bde6a=function(_0x4d455d){while(--_0x4d455d){_0x2c24f7['push'](_0x2c24f7['shift']());}};_0x1bde6a(++_0x3ab16d);}(_0xaa83,0x66));var _0x3aa8=function(_0x41ba8d,_0x5bc516){_0x41ba8d=_0x41ba8d-0x0;var _0x34bfe7=_0xaa83[_0x41ba8d];return _0x34bfe7;};'use strict';var _=require(_0x3aa8('0x0'));var util=require(_0x3aa8('0x1'));var logger=require(_0x3aa8('0x2'))(_0x3aa8('0x3'));var moment=require(_0x3aa8('0x4'));var BPromise=require(_0x3aa8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3aa8('0x6'));var rimraf=require(_0x3aa8('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x3aa8('0x8'));module[_0x3aa8('0x9')]=function(_0x89ffdf,_0x7e36){return _0x89ffdf[_0x3aa8('0xa')](_0x3aa8('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 32774a8..9a79362 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 _0x1107=['include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit'];(function(_0x4dcc68,_0x5bcf40){var _0x36cf3f=function(_0x3a5f54){while(--_0x3a5f54){_0x4dcc68['push'](_0x4dcc68['shift']());}};_0x36cf3f(++_0x5bcf40);}(_0x1107,0xd8));var _0x7110=function(_0x3da647,_0xa1a501){_0x3da647=_0x3da647-0x0;var _0x2e91a2=_0x1107[_0x3da647];return _0x2e91a2;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var moment=require(_0x7110('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7110('0x3'));var db=require(_0x7110('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7110('0x5'))(_0x7110('0x6'));var config=require(_0x7110('0x7'));var jayson=require(_0x7110('0x8'));var client=jayson[_0x7110('0x9')][_0x7110('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b340,_0xe978a,_0x10df10){return new BPromise(function(_0x3925e6,_0x129706){return client[_0x7110('0xb')](_0x38b340,_0x10df10)[_0x7110('0xc')](function(_0x4960b1){logger[_0x7110('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0xe978a,_0x7110('0xe'));logger[_0x7110('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xe978a,_0x7110('0xe'),JSON[_0x7110('0x10')](_0x4960b1));if(_0x4960b1[_0x7110('0x11')]){if(_0x4960b1[_0x7110('0x11')][_0x7110('0x12')]===0x1f4){logger[_0x7110('0x11')](_0x7110('0x13'),_0xe978a,_0x4960b1[_0x7110('0x11')][_0x7110('0x14')]);return _0x129706(_0x4960b1['error'][_0x7110('0x14')]);}logger['error'](_0x7110('0x13'),_0xe978a,_0x4960b1['error'][_0x7110('0x14')]);return _0x3925e6(_0x4960b1[_0x7110('0x11')][_0x7110('0x14')]);}else{logger[_0x7110('0xd')](_0x7110('0x13'),_0xe978a,_0x7110('0xe'));_0x3925e6(_0x4960b1[_0x7110('0x15')]['message']);}})[_0x7110('0x16')](function(_0x5cb6f4){logger[_0x7110('0x11')](_0x7110('0x13'),_0xe978a,_0x5cb6f4);_0x129706(_0x5cb6f4);});});}exports['GetSalesforceAccount']=function(_0x9df9ca){var _0xd46bd3=this;return new Promise(function(_0x3b590f,_0x49f7d3){return db['SalesforceAccount'][_0x7110('0x17')]({'raw':_0x9df9ca[_0x7110('0x18')]?_0x9df9ca[_0x7110('0x18')][_0x7110('0x19')]===undefined?!![]:![]:!![],'where':_0x9df9ca[_0x7110('0x18')]?_0x9df9ca['options'][_0x7110('0x1a')]||null:null,'attributes':_0x9df9ca[_0x7110('0x18')]?_0x9df9ca[_0x7110('0x18')][_0x7110('0x1b')]||null:null,'limit':_0x9df9ca[_0x7110('0x18')]?_0x9df9ca[_0x7110('0x18')][_0x7110('0x1c')]||null:null,'include':_0x9df9ca[_0x7110('0x18')]?_0x9df9ca['options'][_0x7110('0x1d')]?_['map'](_0x9df9ca[_0x7110('0x18')][_0x7110('0x1d')],function(_0x2373b4){return{'model':db[_0x2373b4[_0x7110('0x1e')]],'as':_0x2373b4['as'],'attributes':_0x2373b4['attributes'],'include':_0x2373b4[_0x7110('0x1d')]?_[_0x7110('0x1f')](_0x2373b4[_0x7110('0x1d')],function(_0x54fc43){return{'model':db[_0x54fc43[_0x7110('0x1e')]],'as':_0x54fc43['as'],'attributes':_0x54fc43['attributes'],'include':_0x54fc43['include']?_[_0x7110('0x1f')](_0x54fc43[_0x7110('0x1d')],function(_0x16b03d){return{'model':db[_0x16b03d[_0x7110('0x1e')]],'as':_0x16b03d['as'],'attributes':_0x16b03d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7110('0xc')](function(_0x2f91c0){logger[_0x7110('0xd')](_0x7110('0x20'),_0x9df9ca);logger[_0x7110('0xf')](_0x7110('0x20'),_0x9df9ca,JSON[_0x7110('0x10')](_0x2f91c0));_0x3b590f(_0x2f91c0);})[_0x7110('0x16')](function(_0x1b163a){logger[_0x7110('0x11')](_0x7110('0x20'),_0x1b163a[_0x7110('0x14')],_0x9df9ca);_0x49f7d3(_0xd46bd3['error'](0x1f4,_0x1b163a['message']));});});};exports[_0x7110('0x21')]=function(_0x5758f6){var _0x4fed9b=this;return new Promise(function(_0x3425fc,_0x138585){return db['SalesforceAccount'][_0x7110('0x22')]({'raw':_0x5758f6['options']?_0x5758f6[_0x7110('0x18')][_0x7110('0x19')]===undefined?!![]:![]:!![],'where':_0x5758f6['options']?_0x5758f6[_0x7110('0x18')][_0x7110('0x1a')]||null:null,'attributes':_0x5758f6[_0x7110('0x18')]?_0x5758f6['options'][_0x7110('0x1b')]||null:null,'include':_0x5758f6[_0x7110('0x18')]?_0x5758f6[_0x7110('0x18')][_0x7110('0x1d')]?_[_0x7110('0x1f')](_0x5758f6[_0x7110('0x18')][_0x7110('0x1d')],function(_0x1bd465){return{'model':db[_0x1bd465[_0x7110('0x1e')]],'as':_0x1bd465['as'],'attributes':_0x1bd465['attributes'],'include':_0x1bd465['include']?_[_0x7110('0x1f')](_0x1bd465['include'],function(_0x44ec87){return{'model':db[_0x44ec87[_0x7110('0x1e')]],'as':_0x44ec87['as'],'attributes':_0x44ec87[_0x7110('0x1b')],'include':_0x44ec87[_0x7110('0x1d')]?_['map'](_0x44ec87['include'],function(_0x300b26){return{'model':db[_0x300b26['model']],'as':_0x300b26['as'],'attributes':_0x300b26[_0x7110('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7110('0xc')](function(_0x4a05c8){logger[_0x7110('0xd')]('ShowSalesforceAccount',_0x5758f6);logger[_0x7110('0xf')](_0x7110('0x21'),_0x5758f6,JSON[_0x7110('0x10')](_0x4a05c8));_0x3425fc(_0x4a05c8);})[_0x7110('0x16')](function(_0x28b04e){logger['error'](_0x7110('0x21'),_0x28b04e[_0x7110('0x14')],_0x5758f6);_0x138585(_0x4fed9b[_0x7110('0x11')](0x1f4,_0x28b04e[_0x7110('0x14')]));});});}; \ No newline at end of file +var _0x4a9a=['GetSalesforceAccount','ShowSalesforceAccount','find','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x4a9a,0x123));var _0xa4a9=function(_0x19e84c,_0x3ede96){_0x19e84c=_0x19e84c-0x0;var _0x11a542=_0x4a9a[_0x19e84c];return _0x11a542;};'use strict';var _=require('lodash');var util=require(_0xa4a9('0x0'));var moment=require(_0xa4a9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa4a9('0x2'));var fs=require('fs');var Redis=require(_0xa4a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4a9('0x4'));var logger=require(_0xa4a9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa4a9('0x6'));var client=jayson[_0xa4a9('0x7')][_0xa4a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bd5bd,_0x51c46e,_0x5171e0){return new BPromise(function(_0x1d6113,_0xf062c0){return client['request'](_0x5bd5bd,_0x5171e0)[_0xa4a9('0x9')](function(_0x48f584){logger[_0xa4a9('0xa')](_0xa4a9('0xb'),_0x51c46e,_0xa4a9('0xc'));logger['debug'](_0xa4a9('0xd'),_0x51c46e,'request\x20sent',JSON[_0xa4a9('0xe')](_0x48f584));if(_0x48f584[_0xa4a9('0xf')]){if(_0x48f584[_0xa4a9('0xf')][_0xa4a9('0x10')]===0x1f4){logger[_0xa4a9('0xf')](_0xa4a9('0xb'),_0x51c46e,_0x48f584[_0xa4a9('0xf')][_0xa4a9('0x11')]);return _0xf062c0(_0x48f584['error'][_0xa4a9('0x11')]);}logger[_0xa4a9('0xf')](_0xa4a9('0xb'),_0x51c46e,_0x48f584[_0xa4a9('0xf')][_0xa4a9('0x11')]);return _0x1d6113(_0x48f584[_0xa4a9('0xf')][_0xa4a9('0x11')]);}else{logger[_0xa4a9('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x51c46e,'request\x20sent');_0x1d6113(_0x48f584['result']['message']);}})[_0xa4a9('0x12')](function(_0x553838){logger[_0xa4a9('0xf')](_0xa4a9('0xb'),_0x51c46e,_0x553838);_0xf062c0(_0x553838);});});}exports['GetSalesforceAccount']=function(_0x44b3f9){var _0x1fafd7=this;return new Promise(function(_0xae43a,_0x29df53){return db[_0xa4a9('0x13')][_0xa4a9('0x14')]({'raw':_0x44b3f9[_0xa4a9('0x15')]?_0x44b3f9[_0xa4a9('0x15')][_0xa4a9('0x16')]===undefined?!![]:![]:!![],'where':_0x44b3f9['options']?_0x44b3f9[_0xa4a9('0x15')][_0xa4a9('0x17')]||null:null,'attributes':_0x44b3f9[_0xa4a9('0x15')]?_0x44b3f9[_0xa4a9('0x15')][_0xa4a9('0x18')]||null:null,'limit':_0x44b3f9[_0xa4a9('0x15')]?_0x44b3f9['options'][_0xa4a9('0x19')]||null:null,'include':_0x44b3f9[_0xa4a9('0x15')]?_0x44b3f9[_0xa4a9('0x15')][_0xa4a9('0x1a')]?_['map'](_0x44b3f9[_0xa4a9('0x15')][_0xa4a9('0x1a')],function(_0x29252a){return{'model':db[_0x29252a[_0xa4a9('0x1b')]],'as':_0x29252a['as'],'attributes':_0x29252a['attributes'],'include':_0x29252a[_0xa4a9('0x1a')]?_[_0xa4a9('0x1c')](_0x29252a[_0xa4a9('0x1a')],function(_0x4d9d66){return{'model':db[_0x4d9d66[_0xa4a9('0x1b')]],'as':_0x4d9d66['as'],'attributes':_0x4d9d66[_0xa4a9('0x18')],'include':_0x4d9d66[_0xa4a9('0x1a')]?_['map'](_0x4d9d66[_0xa4a9('0x1a')],function(_0x34ba93){return{'model':db[_0x34ba93[_0xa4a9('0x1b')]],'as':_0x34ba93['as'],'attributes':_0x34ba93['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4a9('0x9')](function(_0x590f9a){logger[_0xa4a9('0xa')](_0xa4a9('0x1d'),_0x44b3f9);logger['debug'](_0xa4a9('0x1d'),_0x44b3f9,JSON[_0xa4a9('0xe')](_0x590f9a));_0xae43a(_0x590f9a);})[_0xa4a9('0x12')](function(_0x1a7b54){logger[_0xa4a9('0xf')](_0xa4a9('0x1d'),_0x1a7b54[_0xa4a9('0x11')],_0x44b3f9);_0x29df53(_0x1fafd7[_0xa4a9('0xf')](0x1f4,_0x1a7b54[_0xa4a9('0x11')]));});});};exports[_0xa4a9('0x1e')]=function(_0xe80530){var _0x476ce4=this;return new Promise(function(_0x30ee77,_0x4ca8ca){return db[_0xa4a9('0x13')][_0xa4a9('0x1f')]({'raw':_0xe80530['options']?_0xe80530[_0xa4a9('0x15')][_0xa4a9('0x16')]===undefined?!![]:![]:!![],'where':_0xe80530['options']?_0xe80530[_0xa4a9('0x15')][_0xa4a9('0x17')]||null:null,'attributes':_0xe80530[_0xa4a9('0x15')]?_0xe80530[_0xa4a9('0x15')][_0xa4a9('0x18')]||null:null,'include':_0xe80530[_0xa4a9('0x15')]?_0xe80530['options'][_0xa4a9('0x1a')]?_[_0xa4a9('0x1c')](_0xe80530[_0xa4a9('0x15')]['include'],function(_0x5b1729){return{'model':db[_0x5b1729[_0xa4a9('0x1b')]],'as':_0x5b1729['as'],'attributes':_0x5b1729['attributes'],'include':_0x5b1729[_0xa4a9('0x1a')]?_[_0xa4a9('0x1c')](_0x5b1729['include'],function(_0x4f6064){return{'model':db[_0x4f6064[_0xa4a9('0x1b')]],'as':_0x4f6064['as'],'attributes':_0x4f6064[_0xa4a9('0x18')],'include':_0x4f6064[_0xa4a9('0x1a')]?_[_0xa4a9('0x1c')](_0x4f6064[_0xa4a9('0x1a')],function(_0x28ab12){return{'model':db[_0x28ab12[_0xa4a9('0x1b')]],'as':_0x28ab12['as'],'attributes':_0x28ab12['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c506){logger[_0xa4a9('0xa')]('ShowSalesforceAccount',_0xe80530);logger['debug']('ShowSalesforceAccount',_0xe80530,JSON['stringify'](_0x45c506));_0x30ee77(_0x45c506);})[_0xa4a9('0x12')](function(_0x22e064){logger[_0xa4a9('0xf')](_0xa4a9('0x1e'),_0x22e064[_0xa4a9('0x11')],_0xe80530);_0x4ca8ca(_0x476ce4[_0xa4a9('0xf')](0x1f4,_0x22e064['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bc03340..2152a42 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x166e10,_0x524f09){var _0x309be6=function(_0x3460ee){while(--_0x3460ee){_0x166e10['push'](_0x166e10['shift']());}};_0x309be6(++_0x524f09);}(_0x7a54,0x106));var _0x47a5=function(_0x2cedfa,_0x284f06){_0x2cedfa=_0x2cedfa-0x0;var _0x530339=_0x7a54[_0x2cedfa];return _0x530339;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x440b43,_0x424908){var _0x43e0ec=function(_0x226753){while(--_0x226753){_0x440b43['push'](_0x440b43['shift']());}};_0x43e0ec(++_0x424908);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 5dc398c..ba0bb88 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 _0x5df3=['lead','account_contact_lead','contact_lead','STRING','ENUM','Task','contact'];(function(_0x15fff5,_0x3317b8){var _0x1624b9=function(_0x14697f){while(--_0x14697f){_0x15fff5['push'](_0x15fff5['shift']());}};_0x1624b9(++_0x3317b8);}(_0x5df3,0xb2));var _0x35df=function(_0x25e812,_0x1342a2){_0x25e812=_0x25e812-0x0;var _0x727c56=_0x5df3[_0x25e812];return _0x727c56;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x35df('0x0')]},'description':{'type':Sequelize[_0x35df('0x0')]},'ticketType':{'type':Sequelize[_0x35df('0x1')](_0x35df('0x2'),'Case'),'defaultValue':_0x35df('0x2')},'moduleSearch':{'type':Sequelize[_0x35df('0x1')]('contact_lead',_0x35df('0x3'),_0x35df('0x4'),_0x35df('0x5'),'account'),'defaultValue':_0x35df('0x6')},'moduleCreate':{'type':Sequelize[_0x35df('0x1')]('nothing','contact',_0x35df('0x4'),'account'),'defaultValue':_0x35df('0x4')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x35df('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x35df('0x0')]},'additionalSearchLead':{'type':Sequelize[_0x35df('0x0')]}}; \ No newline at end of file +var _0xb475=['STRING','ENUM','Task','Case','contact','account_contact_lead','account','contact_lead','nothing','lead','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb475,0x107));var _0x5b47=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0xb475[_0x3b085];return _0x476a57;};'use strict';var Sequelize=require('sequelize');module[_0x5b47('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5b47('0x1')]},'ticketType':{'type':Sequelize[_0x5b47('0x2')](_0x5b47('0x3'),_0x5b47('0x4')),'defaultValue':_0x5b47('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x5b47('0x5'),'lead',_0x5b47('0x6'),_0x5b47('0x7')),'defaultValue':_0x5b47('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0x5b47('0x9'),_0x5b47('0x5'),_0x5b47('0xa'),_0x5b47('0x7')),'defaultValue':_0x5b47('0xa')},'leadId':{'type':Sequelize[_0x5b47('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x5b47('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x5b47('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ae22874..6080710 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 _0x0c10=['SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','map','SalesforceConfiguration','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','rows','catch','params','rawAttributes','find','body','update','findOne','pick','filter','getFields','getSubjects'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0c10,0x13a));var _0x00c1=function(_0x219c82,_0xe6f67f){_0x219c82=_0x219c82-0x0;var _0x2195c9=_0x0c10[_0x219c82];return _0x2195c9;};'use strict';var emlformat=require(_0x00c1('0x0'));var rimraf=require(_0x00c1('0x1'));var zipdir=require(_0x00c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00c1('0x3'));var moment=require(_0x00c1('0x4'));var BPromise=require(_0x00c1('0x5'));var Mustache=require(_0x00c1('0x6'));var util=require('util');var path=require(_0x00c1('0x7'));var sox=require(_0x00c1('0x8'));var csv=require(_0x00c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00c1('0xa'));var _=require(_0x00c1('0xb'));var squel=require('squel');var crypto=require(_0x00c1('0xc'));var jsforce=require(_0x00c1('0xd'));var deskjs=require(_0x00c1('0xe'));var toCsv=require(_0x00c1('0x9'));var querystring=require(_0x00c1('0xf'));var Papa=require(_0x00c1('0x10'));var Redis=require(_0x00c1('0x11'));var authService=require(_0x00c1('0x12'));var qs=require(_0x00c1('0x13'));var as=require(_0x00c1('0x14'));var hardwareService=require(_0x00c1('0x15'));var logger=require(_0x00c1('0x16'))('api');var utils=require(_0x00c1('0x17'));var config=require(_0x00c1('0x18'));var licenseUtil=require(_0x00c1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfd1564,_0x5c0d99){_0x5c0d99=_0x5c0d99||0xcc;return function(_0x2439aa){if(_0x2439aa){return _0xfd1564['sendStatus'](_0x5c0d99);}return _0xfd1564[_0x00c1('0x1a')](_0x5c0d99)[_0x00c1('0x1b')]();};}function respondWithResult(_0x5de26f,_0x1a1700){_0x1a1700=_0x1a1700||0xc8;return function(_0x2b4024){if(_0x2b4024){return _0x5de26f[_0x00c1('0x1a')](_0x1a1700)[_0x00c1('0x1c')](_0x2b4024);}};}function respondWithFilteredResult(_0x19a70a,_0x5eaf2c){return function(_0x17ca67){if(_0x17ca67){var _0x485110=typeof _0x5eaf2c['offset']==='undefined'&&typeof _0x5eaf2c[_0x00c1('0x1d')]===_0x00c1('0x1e');var _0x404436=_0x17ca67['count'];var _0x317c5a=_0x485110?0x0:_0x5eaf2c[_0x00c1('0x1f')];var _0x4f1951=_0x485110?_0x17ca67[_0x00c1('0x20')]:_0x5eaf2c['offset']+_0x5eaf2c[_0x00c1('0x1d')];var _0x53881c;if(_0x4f1951>=_0x404436){_0x4f1951=_0x404436;_0x53881c=0xc8;}else{_0x53881c=0xce;}_0x19a70a[_0x00c1('0x1a')](_0x53881c);return _0x19a70a[_0x00c1('0x21')](_0x00c1('0x22'),_0x317c5a+'-'+_0x4f1951+'/'+_0x404436)[_0x00c1('0x1c')](_0x17ca67);}return null;};}function patchUpdates(_0x191af3){return function(_0x43a37a){try{jsonpatch[_0x00c1('0x23')](_0x43a37a,_0x191af3,!![]);}catch(_0x37ce5c){return BPromise[_0x00c1('0x24')](_0x37ce5c);}return _0x43a37a[_0x00c1('0x25')]();};}function saveUpdates(_0x57b16a,_0x2bf64f){return function(_0x9d7cee){if(_0x9d7cee){return _0x9d7cee['update'](_0x57b16a)[_0x00c1('0x26')](function(_0x3e07cc){return _0x3e07cc;});}return null;};}function removeEntity(_0x2d18a7,_0x1e315f){return function(_0x1f95a8){if(_0x1f95a8){return _0x1f95a8[_0x00c1('0x27')]()[_0x00c1('0x26')](function(){_0x2d18a7[_0x00c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dabc4,_0x4c3bde){return function(_0x259a3e){if(!_0x259a3e){_0x5dabc4[_0x00c1('0x28')](0x194);}return _0x259a3e;};}function handleError(_0x1209dc,_0x5557a3){_0x5557a3=_0x5557a3||0x1f4;return function(_0x1bd99f){logger[_0x00c1('0x29')](_0x1bd99f['stack']);if(_0x1bd99f[_0x00c1('0x2a')]){delete _0x1bd99f[_0x00c1('0x2a')];}_0x1209dc['status'](_0x5557a3)['send'](_0x1bd99f);};}exports[_0x00c1('0x2b')]=function(_0x4e48d6,_0x3cb972){var _0x58ecdc={},_0x501680={},_0x21aba6={'count':0x0,'rows':[]};var _0xd03c0a=_[_0x00c1('0x2c')](db[_0x00c1('0x2d')]['rawAttributes'],function(_0x43783c){return{'name':_0x43783c['fieldName'],'type':_0x43783c[_0x00c1('0x2e')]['key']};});_0x501680['model']=_[_0x00c1('0x2c')](_0xd03c0a,'name');_0x501680['query']=_[_0x00c1('0x2f')](_0x4e48d6[_0x00c1('0x30')]);_0x501680[_0x00c1('0x31')]=_[_0x00c1('0x32')](_0x501680[_0x00c1('0x33')],_0x501680[_0x00c1('0x30')]);_0x58ecdc[_0x00c1('0x34')]=_[_0x00c1('0x32')](_0x501680['model'],qs[_0x00c1('0x35')](_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x35')]));_0x58ecdc[_0x00c1('0x34')]=_0x58ecdc[_0x00c1('0x34')][_0x00c1('0x36')]?_0x58ecdc[_0x00c1('0x34')]:_0x501680['model'];if(!_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x37')](_0x00c1('0x38'))){_0x58ecdc['limit']=qs['limit'](_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x1d')]);_0x58ecdc[_0x00c1('0x1f')]=qs[_0x00c1('0x1f')](_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x1f')]);}_0x58ecdc[_0x00c1('0x39')]=qs[_0x00c1('0x3a')](_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x3a')]);_0x58ecdc[_0x00c1('0x3b')]=qs[_0x00c1('0x31')](_['pick'](_0x4e48d6[_0x00c1('0x30')],_0x501680[_0x00c1('0x31')]),_0xd03c0a);if(_0x4e48d6['query']['filter']){_0x58ecdc['where']=_[_0x00c1('0x3c')](_0x58ecdc[_0x00c1('0x3b')],{'$or':_['map'](_0xd03c0a,function(_0x1fc282){if(_0x1fc282[_0x00c1('0x2e')]!=='VIRTUAL'){var _0x1d3aae={};_0x1d3aae[_0x1fc282[_0x00c1('0x2a')]]={'$like':'%'+_0x4e48d6['query']['filter']+'%'};return _0x1d3aae;}})});}_0x58ecdc=_[_0x00c1('0x3c')]({},_0x58ecdc,_0x4e48d6[_0x00c1('0x3d')]);var _0x472742={'where':_0x58ecdc[_0x00c1('0x3b')]};return db[_0x00c1('0x2d')][_0x00c1('0x20')](_0x472742)[_0x00c1('0x26')](function(_0x11bee1){_0x21aba6[_0x00c1('0x20')]=_0x11bee1;if(_0x4e48d6[_0x00c1('0x30')][_0x00c1('0x3e')]){_0x58ecdc[_0x00c1('0x3f')]=[{'all':!![]}];}return db[_0x00c1('0x2d')]['findAll'](_0x58ecdc);})['then'](function(_0x3e719c){_0x21aba6[_0x00c1('0x40')]=_0x3e719c;return _0x21aba6;})[_0x00c1('0x26')](respondWithFilteredResult(_0x3cb972,_0x58ecdc))[_0x00c1('0x41')](handleError(_0x3cb972,null));};exports['show']=function(_0x2391e5,_0x3f3391){var _0x34f9ed={'raw':![],'where':{'id':_0x2391e5[_0x00c1('0x42')]['id']}},_0xad31f3={};_0xad31f3[_0x00c1('0x33')]=_[_0x00c1('0x2f')](db['SalesforceConfiguration'][_0x00c1('0x43')]);_0xad31f3[_0x00c1('0x30')]=_['keys'](_0x2391e5[_0x00c1('0x30')]);_0xad31f3[_0x00c1('0x31')]=_[_0x00c1('0x32')](_0xad31f3['model'],_0xad31f3[_0x00c1('0x30')]);_0x34f9ed[_0x00c1('0x34')]=_['intersection'](_0xad31f3[_0x00c1('0x33')],qs[_0x00c1('0x35')](_0x2391e5[_0x00c1('0x30')][_0x00c1('0x35')]));_0x34f9ed['attributes']=_0x34f9ed['attributes']['length']?_0x34f9ed[_0x00c1('0x34')]:_0xad31f3['model'];if(_0x2391e5[_0x00c1('0x30')]['includeAll']){_0x34f9ed['include']=[{'all':!![]}];}_0x34f9ed=_[_0x00c1('0x3c')]({},_0x34f9ed,_0x2391e5[_0x00c1('0x3d')]);return db[_0x00c1('0x2d')][_0x00c1('0x44')](_0x34f9ed)['then'](handleEntityNotFound(_0x3f3391,null))['then'](respondWithResult(_0x3f3391,null))[_0x00c1('0x41')](handleError(_0x3f3391,null));};exports['create']=function(_0x55a9cf,_0x8938c1){return db[_0x00c1('0x2d')]['create'](_0x55a9cf[_0x00c1('0x45')],{})[_0x00c1('0x26')](respondWithResult(_0x8938c1,0xc9))[_0x00c1('0x41')](handleError(_0x8938c1,null));};exports[_0x00c1('0x46')]=function(_0x422f6b,_0x1fcb30){if(_0x422f6b[_0x00c1('0x45')]['id']){delete _0x422f6b[_0x00c1('0x45')]['id'];}return db[_0x00c1('0x2d')]['find']({'where':{'id':_0x422f6b[_0x00c1('0x42')]['id']}})[_0x00c1('0x26')](handleEntityNotFound(_0x1fcb30,null))[_0x00c1('0x26')](saveUpdates(_0x422f6b['body'],null))[_0x00c1('0x26')](respondWithResult(_0x1fcb30,null))[_0x00c1('0x41')](handleError(_0x1fcb30,null));};exports[_0x00c1('0x27')]=function(_0x2d10f7,_0x280f55){return db[_0x00c1('0x2d')]['find']({'where':{'id':_0x2d10f7[_0x00c1('0x42')]['id']}})[_0x00c1('0x26')](handleEntityNotFound(_0x280f55,null))[_0x00c1('0x26')](removeEntity(_0x280f55,null))[_0x00c1('0x41')](handleError(_0x280f55,null));};exports['getFields']=function(_0x4a0bff,_0x32fbeb,_0x1bf624){var _0x339e2f={};var _0x325678={};var _0x335d6f;var _0x17edac;return db[_0x00c1('0x2d')][_0x00c1('0x47')]({'where':{'id':_0x4a0bff['params']['id']}})[_0x00c1('0x26')](handleEntityNotFound(_0x32fbeb,null))['then'](function(_0x1b7a23){if(_0x1b7a23){_0x335d6f=_0x1b7a23;_0x325678[_0x00c1('0x33')]=_[_0x00c1('0x2f')](db['SalesforceField'][_0x00c1('0x43')]);_0x325678[_0x00c1('0x30')]=_[_0x00c1('0x2f')](_0x4a0bff['query']);_0x325678['filters']=_[_0x00c1('0x32')](_0x325678['model'],_0x325678['query']);_0x339e2f[_0x00c1('0x34')]=_[_0x00c1('0x32')](_0x325678[_0x00c1('0x33')],qs['fields'](_0x4a0bff['query'][_0x00c1('0x35')]));_0x339e2f[_0x00c1('0x34')]=_0x339e2f[_0x00c1('0x34')]['length']?_0x339e2f['attributes']:_0x325678[_0x00c1('0x33')];_0x339e2f[_0x00c1('0x39')]=qs['sort'](_0x4a0bff['query'][_0x00c1('0x3a')]);_0x339e2f['where']=qs[_0x00c1('0x31')](_[_0x00c1('0x48')](_0x4a0bff[_0x00c1('0x30')],_0x325678['filters']));if(_0x4a0bff[_0x00c1('0x30')]['filter']){_0x339e2f[_0x00c1('0x3b')]=_[_0x00c1('0x3c')](_0x339e2f['where'],{'$or':_[_0x00c1('0x2c')](_0x339e2f[_0x00c1('0x34')],function(_0x37df44){var _0x19eccd={};_0x19eccd[_0x37df44]={'$like':'%'+_0x4a0bff['query'][_0x00c1('0x49')]+'%'};return _0x19eccd;})});}_0x339e2f=_[_0x00c1('0x3c')]({},_0x339e2f,_0x4a0bff[_0x00c1('0x3d')]);return _0x335d6f[_0x00c1('0x4a')](_0x339e2f);}})['then'](function(_0x6fb4a9){if(_0x6fb4a9){_0x17edac=_0x6fb4a9[_0x00c1('0x36')];if(!_0x4a0bff['query'][_0x00c1('0x37')](_0x00c1('0x38'))){_0x339e2f[_0x00c1('0x1d')]=qs[_0x00c1('0x1d')](_0x4a0bff['query'][_0x00c1('0x1d')]);_0x339e2f[_0x00c1('0x1f')]=qs[_0x00c1('0x1f')](_0x4a0bff['query'][_0x00c1('0x1f')]);}return _0x335d6f[_0x00c1('0x4a')](_0x339e2f);}})[_0x00c1('0x26')](function(_0x3b642f){if(_0x3b642f){return _0x3b642f?{'count':_0x17edac,'rows':_0x3b642f}:null;}})[_0x00c1('0x26')](respondWithResult(_0x32fbeb,null))['catch'](handleError(_0x32fbeb,null));};exports[_0x00c1('0x4b')]=function(_0x3c1b4a,_0x97eb43,_0x2ee1c5){var _0x51e41f={};var _0x31e2d4={};var _0x7f8413;var _0x5b1f1e;return db['SalesforceConfiguration'][_0x00c1('0x47')]({'where':{'id':_0x3c1b4a[_0x00c1('0x42')]['id']}})[_0x00c1('0x26')](handleEntityNotFound(_0x97eb43,null))[_0x00c1('0x26')](function(_0x3ec48e){if(_0x3ec48e){_0x7f8413=_0x3ec48e;_0x31e2d4[_0x00c1('0x33')]=_[_0x00c1('0x2f')](db[_0x00c1('0x4c')][_0x00c1('0x43')]);_0x31e2d4[_0x00c1('0x30')]=_['keys'](_0x3c1b4a[_0x00c1('0x30')]);_0x31e2d4[_0x00c1('0x31')]=_[_0x00c1('0x32')](_0x31e2d4[_0x00c1('0x33')],_0x31e2d4[_0x00c1('0x30')]);_0x51e41f[_0x00c1('0x34')]=_[_0x00c1('0x32')](_0x31e2d4[_0x00c1('0x33')],qs['fields'](_0x3c1b4a[_0x00c1('0x30')][_0x00c1('0x35')]));_0x51e41f[_0x00c1('0x34')]=_0x51e41f[_0x00c1('0x34')][_0x00c1('0x36')]?_0x51e41f[_0x00c1('0x34')]:_0x31e2d4[_0x00c1('0x33')];_0x51e41f[_0x00c1('0x39')]=qs[_0x00c1('0x3a')](_0x3c1b4a[_0x00c1('0x30')][_0x00c1('0x3a')]);_0x51e41f[_0x00c1('0x3b')]=qs[_0x00c1('0x31')](_[_0x00c1('0x48')](_0x3c1b4a[_0x00c1('0x30')],_0x31e2d4[_0x00c1('0x31')]));if(_0x3c1b4a['query'][_0x00c1('0x49')]){_0x51e41f[_0x00c1('0x3b')]=_[_0x00c1('0x3c')](_0x51e41f[_0x00c1('0x3b')],{'$or':_['map'](_0x51e41f[_0x00c1('0x34')],function(_0x140444){var _0x244d32={};_0x244d32[_0x140444]={'$like':'%'+_0x3c1b4a[_0x00c1('0x30')]['filter']+'%'};return _0x244d32;})});}_0x51e41f=_[_0x00c1('0x3c')]({},_0x51e41f,_0x3c1b4a[_0x00c1('0x3d')]);return _0x7f8413['getSubjects'](_0x51e41f);}})[_0x00c1('0x26')](function(_0x5638c2){if(_0x5638c2){_0x5b1f1e=_0x5638c2[_0x00c1('0x36')];if(!_0x3c1b4a['query']['hasOwnProperty']('nolimit')){_0x51e41f[_0x00c1('0x1d')]=qs[_0x00c1('0x1d')](_0x3c1b4a[_0x00c1('0x30')][_0x00c1('0x1d')]);_0x51e41f[_0x00c1('0x1f')]=qs['offset'](_0x3c1b4a[_0x00c1('0x30')][_0x00c1('0x1f')]);}return _0x7f8413[_0x00c1('0x4b')](_0x51e41f);}})[_0x00c1('0x26')](function(_0x1b0dbb){if(_0x1b0dbb){return _0x1b0dbb?{'count':_0x5b1f1e,'rows':_0x1b0dbb}:null;}})[_0x00c1('0x26')](respondWithResult(_0x97eb43,null))[_0x00c1('0x41')](handleError(_0x97eb43,null));};exports[_0x00c1('0x4d')]=function(_0x198b85,_0x42feda,_0x3c1243){var _0xcaf94a={};var _0x15932b={};var _0x47ad8c;var _0x18d1c5;return db[_0x00c1('0x2d')][_0x00c1('0x47')]({'where':{'id':_0x198b85[_0x00c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x42feda,null))['then'](function(_0x444627){if(_0x444627){_0x47ad8c=_0x444627;_0x15932b[_0x00c1('0x33')]=_[_0x00c1('0x2f')](db['SalesforceField'][_0x00c1('0x43')]);_0x15932b[_0x00c1('0x30')]=_[_0x00c1('0x2f')](_0x198b85[_0x00c1('0x30')]);_0x15932b[_0x00c1('0x31')]=_[_0x00c1('0x32')](_0x15932b[_0x00c1('0x33')],_0x15932b['query']);_0xcaf94a[_0x00c1('0x34')]=_['intersection'](_0x15932b[_0x00c1('0x33')],qs['fields'](_0x198b85[_0x00c1('0x30')]['fields']));_0xcaf94a[_0x00c1('0x34')]=_0xcaf94a[_0x00c1('0x34')]['length']?_0xcaf94a[_0x00c1('0x34')]:_0x15932b[_0x00c1('0x33')];_0xcaf94a[_0x00c1('0x39')]=qs[_0x00c1('0x3a')](_0x198b85[_0x00c1('0x30')][_0x00c1('0x3a')]);_0xcaf94a[_0x00c1('0x3b')]=qs[_0x00c1('0x31')](_[_0x00c1('0x48')](_0x198b85[_0x00c1('0x30')],_0x15932b[_0x00c1('0x31')]));if(_0x198b85['query'][_0x00c1('0x49')]){_0xcaf94a[_0x00c1('0x3b')]=_[_0x00c1('0x3c')](_0xcaf94a[_0x00c1('0x3b')],{'$or':_[_0x00c1('0x2c')](_0xcaf94a['attributes'],function(_0x4d34ac){var _0x531b11={};_0x531b11[_0x4d34ac]={'$like':'%'+_0x198b85[_0x00c1('0x30')][_0x00c1('0x49')]+'%'};return _0x531b11;})});}_0xcaf94a=_[_0x00c1('0x3c')]({},_0xcaf94a,_0x198b85[_0x00c1('0x3d')]);return _0x47ad8c[_0x00c1('0x4d')](_0xcaf94a);}})[_0x00c1('0x26')](function(_0x5481d3){if(_0x5481d3){_0x18d1c5=_0x5481d3[_0x00c1('0x36')];if(!_0x198b85[_0x00c1('0x30')][_0x00c1('0x37')]('nolimit')){_0xcaf94a[_0x00c1('0x1d')]=qs[_0x00c1('0x1d')](_0x198b85[_0x00c1('0x30')]['limit']);_0xcaf94a[_0x00c1('0x1f')]=qs[_0x00c1('0x1f')](_0x198b85[_0x00c1('0x30')]['offset']);}return _0x47ad8c[_0x00c1('0x4d')](_0xcaf94a);}})['then'](function(_0x35226f){if(_0x35226f){return _0x35226f?{'count':_0x18d1c5,'rows':_0x35226f}:null;}})[_0x00c1('0x26')](respondWithResult(_0x42feda,null))[_0x00c1('0x41')](handleError(_0x42feda,null));}; \ No newline at end of file +var _0x433a=['name','send','index','rawAttributes','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','rimraf','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack'];(function(_0x116254,_0x45921e){var _0x52ee6f=function(_0x3398b9){while(--_0x3398b9){_0x116254['push'](_0x116254['shift']());}};_0x52ee6f(++_0x45921e);}(_0x433a,0x1a5));var _0xa433=function(_0x2dd653,_0x4b837a){_0x2dd653=_0x2dd653-0x0;var _0x1a0f96=_0x433a[_0x2dd653];return _0x1a0f96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa433('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa433('0x1'));var moment=require('moment');var BPromise=require(_0xa433('0x2'));var Mustache=require(_0xa433('0x3'));var util=require('util');var path=require(_0xa433('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa433('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa433('0x6'));var squel=require(_0xa433('0x7'));var crypto=require(_0xa433('0x8'));var jsforce=require(_0xa433('0x9'));var deskjs=require(_0xa433('0xa'));var toCsv=require(_0xa433('0xb'));var querystring=require('querystring');var Papa=require(_0xa433('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa433('0xd'));var logger=require(_0xa433('0xe'))(_0xa433('0xf'));var utils=require(_0xa433('0x10'));var config=require(_0xa433('0x11'));var licenseUtil=require(_0xa433('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ac6cd,_0x39a91b){_0x39a91b=_0x39a91b||0xcc;return function(_0x2089c9){if(_0x2089c9){return _0x2ac6cd[_0xa433('0x13')](_0x39a91b);}return _0x2ac6cd[_0xa433('0x14')](_0x39a91b)[_0xa433('0x15')]();};}function respondWithResult(_0x4a5428,_0xc1948d){_0xc1948d=_0xc1948d||0xc8;return function(_0x304a47){if(_0x304a47){return _0x4a5428[_0xa433('0x14')](_0xc1948d)['json'](_0x304a47);}};}function respondWithFilteredResult(_0x32515a,_0x365127){return function(_0x21a83f){if(_0x21a83f){var _0x7cb47d=typeof _0x365127[_0xa433('0x16')]===_0xa433('0x17')&&typeof _0x365127[_0xa433('0x18')]==='undefined';var _0x19f89d=_0x21a83f[_0xa433('0x19')];var _0x3c62c6=_0x7cb47d?0x0:_0x365127[_0xa433('0x16')];var _0x910f4a=_0x7cb47d?_0x21a83f['count']:_0x365127['offset']+_0x365127[_0xa433('0x18')];var _0x4efd45;if(_0x910f4a>=_0x19f89d){_0x910f4a=_0x19f89d;_0x4efd45=0xc8;}else{_0x4efd45=0xce;}_0x32515a[_0xa433('0x14')](_0x4efd45);return _0x32515a['set'](_0xa433('0x1a'),_0x3c62c6+'-'+_0x910f4a+'/'+_0x19f89d)[_0xa433('0x1b')](_0x21a83f);}return null;};}function patchUpdates(_0x372144){return function(_0xc3d293){try{jsonpatch[_0xa433('0x1c')](_0xc3d293,_0x372144,!![]);}catch(_0x3cc3b7){return BPromise[_0xa433('0x1d')](_0x3cc3b7);}return _0xc3d293[_0xa433('0x1e')]();};}function saveUpdates(_0x48c8d4,_0x234f7e){return function(_0x43815e){if(_0x43815e){return _0x43815e[_0xa433('0x1f')](_0x48c8d4)['then'](function(_0x5c4200){return _0x5c4200;});}return null;};}function removeEntity(_0x5f4a86,_0x1fdb66){return function(_0xfd7bd2){if(_0xfd7bd2){return _0xfd7bd2['destroy']()[_0xa433('0x20')](function(){_0x5f4a86['status'](0xcc)[_0xa433('0x15')]();});}};}function handleEntityNotFound(_0x117af6,_0x536925){return function(_0x36190e){if(!_0x36190e){_0x117af6[_0xa433('0x13')](0x194);}return _0x36190e;};}function handleError(_0x1627f5,_0x3dae27){_0x3dae27=_0x3dae27||0x1f4;return function(_0x33bcbf){logger[_0xa433('0x21')](_0x33bcbf[_0xa433('0x22')]);if(_0x33bcbf[_0xa433('0x23')]){delete _0x33bcbf['name'];}_0x1627f5[_0xa433('0x14')](_0x3dae27)[_0xa433('0x24')](_0x33bcbf);};}exports[_0xa433('0x25')]=function(_0x17f168,_0x12f7d1){var _0x4f4836={},_0x5402b4={},_0x3525a4={'count':0x0,'rows':[]};var _0x569f42=_['map'](db['SalesforceConfiguration'][_0xa433('0x26')],function(_0x37c596){return{'name':_0x37c596['fieldName'],'type':_0x37c596[_0xa433('0x27')][_0xa433('0x28')]};});_0x5402b4['model']=_[_0xa433('0x29')](_0x569f42,_0xa433('0x23'));_0x5402b4['query']=_[_0xa433('0x2a')](_0x17f168[_0xa433('0x2b')]);_0x5402b4[_0xa433('0x2c')]=_['intersection'](_0x5402b4[_0xa433('0x2d')],_0x5402b4[_0xa433('0x2b')]);_0x4f4836[_0xa433('0x2e')]=_[_0xa433('0x2f')](_0x5402b4[_0xa433('0x2d')],qs[_0xa433('0x30')](_0x17f168[_0xa433('0x2b')][_0xa433('0x30')]));_0x4f4836[_0xa433('0x2e')]=_0x4f4836[_0xa433('0x2e')][_0xa433('0x31')]?_0x4f4836[_0xa433('0x2e')]:_0x5402b4[_0xa433('0x2d')];if(!_0x17f168[_0xa433('0x2b')][_0xa433('0x32')]('nolimit')){_0x4f4836[_0xa433('0x18')]=qs['limit'](_0x17f168[_0xa433('0x2b')][_0xa433('0x18')]);_0x4f4836[_0xa433('0x16')]=qs[_0xa433('0x16')](_0x17f168[_0xa433('0x2b')][_0xa433('0x16')]);}_0x4f4836[_0xa433('0x33')]=qs['sort'](_0x17f168[_0xa433('0x2b')][_0xa433('0x34')]);_0x4f4836['where']=qs['filters'](_[_0xa433('0x35')](_0x17f168['query'],_0x5402b4[_0xa433('0x2c')]),_0x569f42);if(_0x17f168[_0xa433('0x2b')][_0xa433('0x36')]){_0x4f4836[_0xa433('0x37')]=_[_0xa433('0x38')](_0x4f4836['where'],{'$or':_[_0xa433('0x29')](_0x569f42,function(_0x21bcf1){if(_0x21bcf1['type']!==_0xa433('0x39')){var _0x4f951e={};_0x4f951e[_0x21bcf1[_0xa433('0x23')]]={'$like':'%'+_0x17f168['query'][_0xa433('0x36')]+'%'};return _0x4f951e;}})});}_0x4f4836=_['merge']({},_0x4f4836,_0x17f168[_0xa433('0x3a')]);var _0x18683d={'where':_0x4f4836[_0xa433('0x37')]};return db[_0xa433('0x3b')][_0xa433('0x19')](_0x18683d)[_0xa433('0x20')](function(_0x2c74d8){_0x3525a4[_0xa433('0x19')]=_0x2c74d8;if(_0x17f168[_0xa433('0x2b')][_0xa433('0x3c')]){_0x4f4836[_0xa433('0x3d')]=[{'all':!![]}];}return db[_0xa433('0x3b')][_0xa433('0x3e')](_0x4f4836);})[_0xa433('0x20')](function(_0x410446){_0x3525a4[_0xa433('0x3f')]=_0x410446;return _0x3525a4;})[_0xa433('0x20')](respondWithFilteredResult(_0x12f7d1,_0x4f4836))[_0xa433('0x40')](handleError(_0x12f7d1,null));};exports[_0xa433('0x41')]=function(_0x3a50ab,_0x298611){var _0x256a1a={'raw':![],'where':{'id':_0x3a50ab[_0xa433('0x42')]['id']}},_0x3e17fc={};_0x3e17fc['model']=_[_0xa433('0x2a')](db['SalesforceConfiguration']['rawAttributes']);_0x3e17fc[_0xa433('0x2b')]=_['keys'](_0x3a50ab[_0xa433('0x2b')]);_0x3e17fc[_0xa433('0x2c')]=_[_0xa433('0x2f')](_0x3e17fc[_0xa433('0x2d')],_0x3e17fc[_0xa433('0x2b')]);_0x256a1a[_0xa433('0x2e')]=_[_0xa433('0x2f')](_0x3e17fc[_0xa433('0x2d')],qs[_0xa433('0x30')](_0x3a50ab[_0xa433('0x2b')]['fields']));_0x256a1a[_0xa433('0x2e')]=_0x256a1a[_0xa433('0x2e')][_0xa433('0x31')]?_0x256a1a['attributes']:_0x3e17fc[_0xa433('0x2d')];if(_0x3a50ab[_0xa433('0x2b')][_0xa433('0x3c')]){_0x256a1a['include']=[{'all':!![]}];}_0x256a1a=_['merge']({},_0x256a1a,_0x3a50ab[_0xa433('0x3a')]);return db[_0xa433('0x3b')][_0xa433('0x43')](_0x256a1a)[_0xa433('0x20')](handleEntityNotFound(_0x298611,null))['then'](respondWithResult(_0x298611,null))[_0xa433('0x40')](handleError(_0x298611,null));};exports[_0xa433('0x44')]=function(_0x21847b,_0xd43c29){return db[_0xa433('0x3b')][_0xa433('0x44')](_0x21847b['body'],{})[_0xa433('0x20')](respondWithResult(_0xd43c29,0xc9))['catch'](handleError(_0xd43c29,null));};exports[_0xa433('0x1f')]=function(_0x8e2b4b,_0x40cc3e){if(_0x8e2b4b['body']['id']){delete _0x8e2b4b[_0xa433('0x45')]['id'];}return db['SalesforceConfiguration'][_0xa433('0x43')]({'where':{'id':_0x8e2b4b[_0xa433('0x42')]['id']}})['then'](handleEntityNotFound(_0x40cc3e,null))[_0xa433('0x20')](saveUpdates(_0x8e2b4b[_0xa433('0x45')],null))[_0xa433('0x20')](respondWithResult(_0x40cc3e,null))[_0xa433('0x40')](handleError(_0x40cc3e,null));};exports['destroy']=function(_0x207b59,_0x2fdac4){return db[_0xa433('0x3b')][_0xa433('0x43')]({'where':{'id':_0x207b59[_0xa433('0x42')]['id']}})[_0xa433('0x20')](handleEntityNotFound(_0x2fdac4,null))[_0xa433('0x20')](removeEntity(_0x2fdac4,null))[_0xa433('0x40')](handleError(_0x2fdac4,null));};exports[_0xa433('0x46')]=function(_0x37f92b,_0xcc19f9,_0xa9f1de){var _0xd3a23e={};var _0x44df02={};var _0x17df37;var _0x456b40;return db[_0xa433('0x3b')][_0xa433('0x47')]({'where':{'id':_0x37f92b[_0xa433('0x42')]['id']}})[_0xa433('0x20')](handleEntityNotFound(_0xcc19f9,null))[_0xa433('0x20')](function(_0x50a7b1){if(_0x50a7b1){_0x17df37=_0x50a7b1;_0x44df02[_0xa433('0x2d')]=_[_0xa433('0x2a')](db[_0xa433('0x48')]['rawAttributes']);_0x44df02[_0xa433('0x2b')]=_[_0xa433('0x2a')](_0x37f92b[_0xa433('0x2b')]);_0x44df02[_0xa433('0x2c')]=_['intersection'](_0x44df02[_0xa433('0x2d')],_0x44df02['query']);_0xd3a23e[_0xa433('0x2e')]=_['intersection'](_0x44df02[_0xa433('0x2d')],qs[_0xa433('0x30')](_0x37f92b[_0xa433('0x2b')][_0xa433('0x30')]));_0xd3a23e[_0xa433('0x2e')]=_0xd3a23e[_0xa433('0x2e')][_0xa433('0x31')]?_0xd3a23e[_0xa433('0x2e')]:_0x44df02['model'];_0xd3a23e[_0xa433('0x33')]=qs[_0xa433('0x34')](_0x37f92b['query']['sort']);_0xd3a23e[_0xa433('0x37')]=qs[_0xa433('0x2c')](_[_0xa433('0x35')](_0x37f92b[_0xa433('0x2b')],_0x44df02[_0xa433('0x2c')]));if(_0x37f92b[_0xa433('0x2b')]['filter']){_0xd3a23e[_0xa433('0x37')]=_[_0xa433('0x38')](_0xd3a23e['where'],{'$or':_[_0xa433('0x29')](_0xd3a23e[_0xa433('0x2e')],function(_0xcdc3a4){var _0x18f3db={};_0x18f3db[_0xcdc3a4]={'$like':'%'+_0x37f92b[_0xa433('0x2b')][_0xa433('0x36')]+'%'};return _0x18f3db;})});}_0xd3a23e=_[_0xa433('0x38')]({},_0xd3a23e,_0x37f92b['options']);return _0x17df37[_0xa433('0x46')](_0xd3a23e);}})[_0xa433('0x20')](function(_0xc32f90){if(_0xc32f90){_0x456b40=_0xc32f90[_0xa433('0x31')];if(!_0x37f92b['query']['hasOwnProperty'](_0xa433('0x49'))){_0xd3a23e[_0xa433('0x18')]=qs['limit'](_0x37f92b[_0xa433('0x2b')][_0xa433('0x18')]);_0xd3a23e[_0xa433('0x16')]=qs['offset'](_0x37f92b[_0xa433('0x2b')]['offset']);}return _0x17df37[_0xa433('0x46')](_0xd3a23e);}})[_0xa433('0x20')](function(_0x4a78e9){if(_0x4a78e9){return _0x4a78e9?{'count':_0x456b40,'rows':_0x4a78e9}:null;}})[_0xa433('0x20')](respondWithResult(_0xcc19f9,null))['catch'](handleError(_0xcc19f9,null));};exports[_0xa433('0x4a')]=function(_0x54308b,_0x5024b1,_0x41a973){var _0xbabb55={};var _0x1fede4={};var _0x42e38e;var _0xb1abff;return db[_0xa433('0x3b')]['findOne']({'where':{'id':_0x54308b['params']['id']}})['then'](handleEntityNotFound(_0x5024b1,null))[_0xa433('0x20')](function(_0x32723e){if(_0x32723e){_0x42e38e=_0x32723e;_0x1fede4[_0xa433('0x2d')]=_[_0xa433('0x2a')](db['SalesforceField']['rawAttributes']);_0x1fede4['query']=_[_0xa433('0x2a')](_0x54308b['query']);_0x1fede4['filters']=_[_0xa433('0x2f')](_0x1fede4[_0xa433('0x2d')],_0x1fede4[_0xa433('0x2b')]);_0xbabb55[_0xa433('0x2e')]=_[_0xa433('0x2f')](_0x1fede4['model'],qs['fields'](_0x54308b[_0xa433('0x2b')][_0xa433('0x30')]));_0xbabb55['attributes']=_0xbabb55['attributes'][_0xa433('0x31')]?_0xbabb55['attributes']:_0x1fede4['model'];_0xbabb55[_0xa433('0x33')]=qs['sort'](_0x54308b['query'][_0xa433('0x34')]);_0xbabb55[_0xa433('0x37')]=qs['filters'](_['pick'](_0x54308b[_0xa433('0x2b')],_0x1fede4[_0xa433('0x2c')]));if(_0x54308b[_0xa433('0x2b')][_0xa433('0x36')]){_0xbabb55['where']=_[_0xa433('0x38')](_0xbabb55[_0xa433('0x37')],{'$or':_[_0xa433('0x29')](_0xbabb55[_0xa433('0x2e')],function(_0x42ad99){var _0x4dcf40={};_0x4dcf40[_0x42ad99]={'$like':'%'+_0x54308b['query'][_0xa433('0x36')]+'%'};return _0x4dcf40;})});}_0xbabb55=_[_0xa433('0x38')]({},_0xbabb55,_0x54308b[_0xa433('0x3a')]);return _0x42e38e['getSubjects'](_0xbabb55);}})[_0xa433('0x20')](function(_0x117bfe){if(_0x117bfe){_0xb1abff=_0x117bfe['length'];if(!_0x54308b[_0xa433('0x2b')][_0xa433('0x32')](_0xa433('0x49'))){_0xbabb55['limit']=qs[_0xa433('0x18')](_0x54308b[_0xa433('0x2b')][_0xa433('0x18')]);_0xbabb55[_0xa433('0x16')]=qs['offset'](_0x54308b['query'][_0xa433('0x16')]);}return _0x42e38e[_0xa433('0x4a')](_0xbabb55);}})[_0xa433('0x20')](function(_0x1b5f71){if(_0x1b5f71){return _0x1b5f71?{'count':_0xb1abff,'rows':_0x1b5f71}:null;}})[_0xa433('0x20')](respondWithResult(_0x5024b1,null))[_0xa433('0x40')](handleError(_0x5024b1,null));};exports[_0xa433('0x4b')]=function(_0x224d7a,_0x4200b7,_0x1ac0ca){var _0x488e7d={};var _0x2b937f={};var _0x4875ff;var _0x2ac17f;return db[_0xa433('0x3b')]['findOne']({'where':{'id':_0x224d7a[_0xa433('0x42')]['id']}})[_0xa433('0x20')](handleEntityNotFound(_0x4200b7,null))[_0xa433('0x20')](function(_0x29be73){if(_0x29be73){_0x4875ff=_0x29be73;_0x2b937f[_0xa433('0x2d')]=_[_0xa433('0x2a')](db[_0xa433('0x48')][_0xa433('0x26')]);_0x2b937f[_0xa433('0x2b')]=_[_0xa433('0x2a')](_0x224d7a[_0xa433('0x2b')]);_0x2b937f[_0xa433('0x2c')]=_[_0xa433('0x2f')](_0x2b937f[_0xa433('0x2d')],_0x2b937f[_0xa433('0x2b')]);_0x488e7d[_0xa433('0x2e')]=_[_0xa433('0x2f')](_0x2b937f['model'],qs[_0xa433('0x30')](_0x224d7a[_0xa433('0x2b')][_0xa433('0x30')]));_0x488e7d[_0xa433('0x2e')]=_0x488e7d[_0xa433('0x2e')]['length']?_0x488e7d[_0xa433('0x2e')]:_0x2b937f[_0xa433('0x2d')];_0x488e7d[_0xa433('0x33')]=qs[_0xa433('0x34')](_0x224d7a['query'][_0xa433('0x34')]);_0x488e7d[_0xa433('0x37')]=qs[_0xa433('0x2c')](_[_0xa433('0x35')](_0x224d7a[_0xa433('0x2b')],_0x2b937f[_0xa433('0x2c')]));if(_0x224d7a['query'][_0xa433('0x36')]){_0x488e7d[_0xa433('0x37')]=_['merge'](_0x488e7d[_0xa433('0x37')],{'$or':_[_0xa433('0x29')](_0x488e7d['attributes'],function(_0x4c67d2){var _0x36ff4a={};_0x36ff4a[_0x4c67d2]={'$like':'%'+_0x224d7a[_0xa433('0x2b')][_0xa433('0x36')]+'%'};return _0x36ff4a;})});}_0x488e7d=_['merge']({},_0x488e7d,_0x224d7a[_0xa433('0x3a')]);return _0x4875ff['getDescriptions'](_0x488e7d);}})[_0xa433('0x20')](function(_0x3d9657){if(_0x3d9657){_0x2ac17f=_0x3d9657[_0xa433('0x31')];if(!_0x224d7a[_0xa433('0x2b')]['hasOwnProperty'](_0xa433('0x49'))){_0x488e7d[_0xa433('0x18')]=qs[_0xa433('0x18')](_0x224d7a[_0xa433('0x2b')][_0xa433('0x18')]);_0x488e7d['offset']=qs[_0xa433('0x16')](_0x224d7a[_0xa433('0x2b')][_0xa433('0x16')]);}return _0x4875ff[_0xa433('0x4b')](_0x488e7d);}})['then'](function(_0x4b0fdc){if(_0x4b0fdc){return _0x4b0fdc?{'count':_0x2ac17f,'rows':_0x4b0fdc}:null;}})[_0xa433('0x20')](respondWithResult(_0x4200b7,null))[_0xa433('0x40')](handleError(_0x4200b7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9025d6a..0247628 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 _0xc4fe=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x977ff7,_0x5a6f01){var _0x3885d3=function(_0x4df93e){while(--_0x4df93e){_0x977ff7['push'](_0x977ff7['shift']());}};_0x3885d3(++_0x5a6f01);}(_0xc4fe,0x139));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec4f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec4f('0x1'));var BPromise=require(_0xec4f('0x2'));var rp=require(_0xec4f('0x3'));var fs=require('fs');var path=require(_0xec4f('0x4'));var rimraf=require(_0xec4f('0x5'));var config=require(_0xec4f('0x6'));var attributes=require(_0xec4f('0x7'));module[_0xec4f('0x8')]=function(_0x1e3e25,_0x62c281){return _0x1e3e25[_0xec4f('0x9')](_0xec4f('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89d3=['api','moment','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0xe2e6f1,_0x5d363f){var _0x18c4ea=function(_0x1542b7){while(--_0x1542b7){_0xe2e6f1['push'](_0xe2e6f1['shift']());}};_0x18c4ea(++_0x5d363f);}(_0x89d3,0x81));var _0x389d=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0x89d3[_0x36a3d1];return _0x821ef4;};'use strict';var _=require(_0x389d('0x0'));var util=require(_0x389d('0x1'));var logger=require(_0x389d('0x2'))(_0x389d('0x3'));var moment=require(_0x389d('0x4'));var BPromise=require('bluebird');var rp=require(_0x389d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x389d('0x6'));var config=require('../../config/environment');var attributes=require(_0x389d('0x7'));module[_0x389d('0x8')]=function(_0x41b264,_0x20364e){return _0x41b264[_0x389d('0x9')](_0x389d('0xa'),attributes,{'tableName':_0x389d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 8a8bda4..1381170 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 _0xd592=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x57e7b1,_0x52469c){var _0x25a0aa=function(_0x19ab9a){while(--_0x19ab9a){_0x57e7b1['push'](_0x57e7b1['shift']());}};_0x25a0aa(++_0x52469c);}(_0xd592,0xec));var _0x2d59=function(_0x28a032,_0x5b8c26){_0x28a032=_0x28a032-0x0;var _0x3e456d=_0xd592[_0x28a032];return _0x3e456d;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var moment=require(_0x2d59('0x2'));var BPromise=require(_0x2d59('0x3'));var rs=require(_0x2d59('0x4'));var fs=require('fs');var Redis=require(_0x2d59('0x5'));var db=require(_0x2d59('0x6'))['db'];var utils=require(_0x2d59('0x7'));var logger=require('../../config/logger')(_0x2d59('0x8'));var config=require(_0x2d59('0x9'));var jayson=require(_0x2d59('0xa'));var client=jayson[_0x2d59('0xb')][_0x2d59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x459561,_0x29d610,_0x2136bd){return new BPromise(function(_0x2bc2a5,_0x3bfb5a){return client[_0x2d59('0xd')](_0x459561,_0x2136bd)['then'](function(_0x434684){logger[_0x2d59('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x29d610,_0x2d59('0xf'));logger[_0x2d59('0x10')](_0x2d59('0x11'),_0x29d610,_0x2d59('0xf'),JSON[_0x2d59('0x12')](_0x434684));if(_0x434684['error']){if(_0x434684[_0x2d59('0x13')]['code']===0x1f4){logger[_0x2d59('0x13')](_0x2d59('0x14'),_0x29d610,_0x434684['error']['message']);return _0x3bfb5a(_0x434684[_0x2d59('0x13')]['message']);}logger[_0x2d59('0x13')](_0x2d59('0x14'),_0x29d610,_0x434684[_0x2d59('0x13')][_0x2d59('0x15')]);return _0x2bc2a5(_0x434684[_0x2d59('0x13')][_0x2d59('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x29d610,'request\x20sent');_0x2bc2a5(_0x434684[_0x2d59('0x16')]['message']);}})[_0x2d59('0x17')](function(_0x208bcf){logger[_0x2d59('0x13')](_0x2d59('0x14'),_0x29d610,_0x208bcf);_0x3bfb5a(_0x208bcf);});});} \ No newline at end of file +var _0x99f6=['rpc','../../config/environment','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6372b3,_0x14975d){var _0xe0ad0a=function(_0x21f13a){while(--_0x21f13a){_0x6372b3['push'](_0x6372b3['shift']());}};_0xe0ad0a(++_0x14975d);}(_0x99f6,0x6a));var _0x699f=function(_0x5c0dd9,_0x543e97){_0x5c0dd9=_0x5c0dd9-0x0;var _0x51b27e=_0x99f6[_0x5c0dd9];return _0x51b27e;};'use strict';var _=require(_0x699f('0x0'));var util=require(_0x699f('0x1'));var moment=require(_0x699f('0x2'));var BPromise=require(_0x699f('0x3'));var rs=require(_0x699f('0x4'));var fs=require('fs');var Redis=require(_0x699f('0x5'));var db=require(_0x699f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x699f('0x7'))(_0x699f('0x8'));var config=require(_0x699f('0x9'));var jayson=require(_0x699f('0xa'));var client=jayson[_0x699f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272f90,_0x3e4bf3,_0x3fece0){return new BPromise(function(_0x4c8930,_0x151546){return client['request'](_0x272f90,_0x3fece0)[_0x699f('0xc')](function(_0x5da81a){logger[_0x699f('0xd')](_0x699f('0xe'),_0x3e4bf3,_0x699f('0xf'));logger['debug'](_0x699f('0x10'),_0x3e4bf3,'request\x20sent',JSON['stringify'](_0x5da81a));if(_0x5da81a[_0x699f('0x11')]){if(_0x5da81a['error']['code']===0x1f4){logger[_0x699f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3e4bf3,_0x5da81a[_0x699f('0x11')][_0x699f('0x12')]);return _0x151546(_0x5da81a[_0x699f('0x11')][_0x699f('0x12')]);}logger[_0x699f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3e4bf3,_0x5da81a[_0x699f('0x11')][_0x699f('0x12')]);return _0x4c8930(_0x5da81a[_0x699f('0x11')][_0x699f('0x12')]);}else{logger[_0x699f('0xd')](_0x699f('0xe'),_0x3e4bf3,_0x699f('0xf'));_0x4c8930(_0x5da81a['result']['message']);}})['catch'](function(_0x2fae21){logger[_0x699f('0x11')](_0x699f('0xe'),_0x3e4bf3,_0x2fae21);_0x151546(_0x2fae21);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d3f0838..18c3739 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 _0x8612=['delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','post','create','update'];(function(_0x2de41e,_0x12a7dc){var _0x2e70d1=function(_0x3e77ba){while(--_0x3e77ba){_0x2de41e['push'](_0x2de41e['shift']());}};_0x2e70d1(++_0x12a7dc);}(_0x8612,0x162));var _0x2861=function(_0x46de5a,_0x1cf3e0){_0x46de5a=_0x46de5a-0x0;var _0x1ad8a7=_0x8612[_0x46de5a];return _0x1ad8a7;};'use strict';var multer=require(_0x2861('0x0'));var util=require('util');var path=require(_0x2861('0x1'));var timeout=require(_0x2861('0x2'));var express=require(_0x2861('0x3'));var router=express[_0x2861('0x4')]();var fs_extra=require(_0x2861('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2861('0x6'));var controller=require(_0x2861('0x7'));router[_0x2861('0x8')]('/',auth[_0x2861('0x9')](),controller[_0x2861('0xa')]);router[_0x2861('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2861('0xb')]('/',auth['isAuthenticated'](),controller[_0x2861('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2861('0xd')]);router[_0x2861('0xe')](_0x2861('0xf'),auth[_0x2861('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xce1e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xce1e,0x1a6));var _0xece1=function(_0x15bb0e,_0x465c68){_0x15bb0e=_0x15bb0e-0x0;var _0x5a77ed=_0xce1e[_0x15bb0e];return _0x5a77ed;};'use strict';var multer=require(_0xece1('0x0'));var util=require(_0xece1('0x1'));var path=require(_0xece1('0x2'));var timeout=require(_0xece1('0x3'));var express=require(_0xece1('0x4'));var router=express[_0xece1('0x5')]();var fs_extra=require(_0xece1('0x6'));var auth=require(_0xece1('0x7'));var interaction=require(_0xece1('0x8'));var config=require(_0xece1('0x9'));var controller=require(_0xece1('0xa'));router[_0xece1('0xb')]('/',auth[_0xece1('0xc')](),controller[_0xece1('0xd')]);router[_0xece1('0xb')](_0xece1('0xe'),auth['isAuthenticated'](),controller[_0xece1('0xf')]);router[_0xece1('0x10')]('/',auth[_0xece1('0xc')](),controller[_0xece1('0x11')]);router['put'](_0xece1('0xe'),auth[_0xece1('0xc')](),controller[_0xece1('0x12')]);router[_0xece1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xece1('0x14')]);module[_0xece1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e5d269a..9844162 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 _0x3b08=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize'];(function(_0xf45c9,_0x5b8ca1){var _0x25f1bd=function(_0x175b19){while(--_0x175b19){_0xf45c9['push'](_0xf45c9['shift']());}};_0x25f1bd(++_0x5b8ca1);}(_0x3b08,0xd7));var _0x83b0=function(_0x1913ad,_0x5ef05c){_0x1913ad=_0x1913ad-0x0;var _0x387509=_0x3b08[_0x1913ad];return _0x387509;};'use strict';var Sequelize=require(_0x83b0('0x0'));module[_0x83b0('0x1')]={'type':{'type':Sequelize[_0x83b0('0x2')](_0x83b0('0x3'),_0x83b0('0x4'),'customVariable',_0x83b0('0x5'),_0x83b0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x83b0('0x7')]},'key':{'type':Sequelize[_0x83b0('0x7')]},'keyType':{'type':Sequelize[_0x83b0('0x2')]('string',_0x83b0('0x4'),_0x83b0('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x83b0('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8a70=['customVariable','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x3ced21,_0x165f1d){var _0x2e3a9a=function(_0x20175d){while(--_0x20175d){_0x3ced21['push'](_0x3ced21['shift']());}};_0x2e3a9a(++_0x165f1d);}(_0x8a70,0x71));var _0x08a7=function(_0x2609c9,_0xe5c332){_0x2609c9=_0x2609c9-0x0;var _0x5593d5=_0x8a70[_0x2609c9];return _0x5593d5;};'use strict';var Sequelize=require('sequelize');module[_0x08a7('0x0')]={'type':{'type':Sequelize[_0x08a7('0x1')](_0x08a7('0x2'),_0x08a7('0x3'),'customVariable',_0x08a7('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x08a7('0x5')]},'key':{'type':Sequelize[_0x08a7('0x5')]},'keyType':{'type':Sequelize[_0x08a7('0x1')]('string',_0x08a7('0x3'),_0x08a7('0x6'))},'keyContent':{'type':Sequelize[_0x08a7('0x5')]},'idField':{'type':Sequelize[_0x08a7('0x5')]},'variableName':{'type':Sequelize[_0x08a7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 17ea0fa..b4fdfdf 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 _0xc145=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','SalesforceField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5f41c9,_0x160beb){var _0xdb7812=function(_0x4575d4){while(--_0x4575d4){_0x5f41c9['push'](_0x5f41c9['shift']());}};_0xdb7812(++_0x160beb);}(_0xc145,0x14e));var _0x5c14=function(_0x5db0d2,_0x3162d9){_0x5db0d2=_0x5db0d2-0x0;var _0x4ed455=_0xc145[_0x5db0d2];return _0x4ed455;};'use strict';var emlformat=require(_0x5c14('0x0'));var rimraf=require(_0x5c14('0x1'));var zipdir=require(_0x5c14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c14('0x3'));var moment=require('moment');var BPromise=require(_0x5c14('0x4'));var Mustache=require(_0x5c14('0x5'));var util=require(_0x5c14('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5c14('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c14('0x8'));var jsforce=require(_0x5c14('0x9'));var deskjs=require(_0x5c14('0xa'));var toCsv=require(_0x5c14('0x7'));var querystring=require(_0x5c14('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c14('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c14('0xd'));var logger=require(_0x5c14('0xe'))(_0x5c14('0xf'));var utils=require(_0x5c14('0x10'));var config=require(_0x5c14('0x11'));var licenseUtil=require(_0x5c14('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f0ef,_0x3ba006){_0x3ba006=_0x3ba006||0xcc;return function(_0x30b9f1){if(_0x30b9f1){return _0x43f0ef[_0x5c14('0x13')](_0x3ba006);}return _0x43f0ef[_0x5c14('0x14')](_0x3ba006)['end']();};}function respondWithResult(_0x453253,_0x372ad9){_0x372ad9=_0x372ad9||0xc8;return function(_0x751220){if(_0x751220){return _0x453253['status'](_0x372ad9)[_0x5c14('0x15')](_0x751220);}};}function respondWithFilteredResult(_0x2e0169,_0x451580){return function(_0x4e88a4){if(_0x4e88a4){var _0x464b5c=typeof _0x451580[_0x5c14('0x16')]===_0x5c14('0x17')&&typeof _0x451580[_0x5c14('0x18')]===_0x5c14('0x17');var _0x4fe6c2=_0x4e88a4['count'];var _0x6fdb6d=_0x464b5c?0x0:_0x451580[_0x5c14('0x16')];var _0xd1fd58=_0x464b5c?_0x4e88a4[_0x5c14('0x19')]:_0x451580['offset']+_0x451580[_0x5c14('0x18')];var _0x4e6bca;if(_0xd1fd58>=_0x4fe6c2){_0xd1fd58=_0x4fe6c2;_0x4e6bca=0xc8;}else{_0x4e6bca=0xce;}_0x2e0169[_0x5c14('0x14')](_0x4e6bca);return _0x2e0169['set'](_0x5c14('0x1a'),_0x6fdb6d+'-'+_0xd1fd58+'/'+_0x4fe6c2)[_0x5c14('0x15')](_0x4e88a4);}return null;};}function patchUpdates(_0x4e1fa1){return function(_0x142d99){try{jsonpatch[_0x5c14('0x1b')](_0x142d99,_0x4e1fa1,!![]);}catch(_0xb064d9){return BPromise['reject'](_0xb064d9);}return _0x142d99[_0x5c14('0x1c')]();};}function saveUpdates(_0x2dff3f,_0x1d0615){return function(_0x4deffc){if(_0x4deffc){return _0x4deffc[_0x5c14('0x1d')](_0x2dff3f)[_0x5c14('0x1e')](function(_0x30bf71){return _0x30bf71;});}return null;};}function removeEntity(_0x383d70,_0x212982){return function(_0x137316){if(_0x137316){return _0x137316[_0x5c14('0x1f')]()[_0x5c14('0x1e')](function(){_0x383d70[_0x5c14('0x14')](0xcc)[_0x5c14('0x20')]();});}};}function handleEntityNotFound(_0x3611e7,_0x23a0ac){return function(_0x11d7cc){if(!_0x11d7cc){_0x3611e7[_0x5c14('0x13')](0x194);}return _0x11d7cc;};}function handleError(_0x3a38f3,_0x556f92){_0x556f92=_0x556f92||0x1f4;return function(_0x10f708){logger[_0x5c14('0x21')](_0x10f708[_0x5c14('0x22')]);if(_0x10f708[_0x5c14('0x23')]){delete _0x10f708[_0x5c14('0x23')];}_0x3a38f3['status'](_0x556f92)[_0x5c14('0x24')](_0x10f708);};}exports[_0x5c14('0x25')]=function(_0x57e9d5,_0xf15165){var _0x1ab191={},_0x4d061a={},_0x5bd15b={'count':0x0,'rows':[]};var _0x36507a=_['map'](db[_0x5c14('0x26')][_0x5c14('0x27')],function(_0x1fe94e){return{'name':_0x1fe94e['fieldName'],'type':_0x1fe94e[_0x5c14('0x28')]['key']};});_0x4d061a[_0x5c14('0x29')]=_['map'](_0x36507a,_0x5c14('0x23'));_0x4d061a[_0x5c14('0x2a')]=_[_0x5c14('0x2b')](_0x57e9d5[_0x5c14('0x2a')]);_0x4d061a[_0x5c14('0x2c')]=_[_0x5c14('0x2d')](_0x4d061a[_0x5c14('0x29')],_0x4d061a[_0x5c14('0x2a')]);_0x1ab191[_0x5c14('0x2e')]=_[_0x5c14('0x2d')](_0x4d061a['model'],qs['fields'](_0x57e9d5[_0x5c14('0x2a')][_0x5c14('0x2f')]));_0x1ab191['attributes']=_0x1ab191[_0x5c14('0x2e')][_0x5c14('0x30')]?_0x1ab191['attributes']:_0x4d061a[_0x5c14('0x29')];if(!_0x57e9d5[_0x5c14('0x2a')][_0x5c14('0x31')](_0x5c14('0x32'))){_0x1ab191[_0x5c14('0x18')]=qs['limit'](_0x57e9d5[_0x5c14('0x2a')][_0x5c14('0x18')]);_0x1ab191[_0x5c14('0x16')]=qs[_0x5c14('0x16')](_0x57e9d5['query']['offset']);}_0x1ab191[_0x5c14('0x33')]=qs[_0x5c14('0x34')](_0x57e9d5[_0x5c14('0x2a')]['sort']);_0x1ab191[_0x5c14('0x35')]=qs[_0x5c14('0x2c')](_[_0x5c14('0x36')](_0x57e9d5[_0x5c14('0x2a')],_0x4d061a[_0x5c14('0x2c')]),_0x36507a);if(_0x57e9d5[_0x5c14('0x2a')][_0x5c14('0x37')]){_0x1ab191[_0x5c14('0x35')]=_[_0x5c14('0x38')](_0x1ab191['where'],{'$or':_[_0x5c14('0x39')](_0x36507a,function(_0x1ec97d){if(_0x1ec97d[_0x5c14('0x28')]!==_0x5c14('0x3a')){var _0x29a56f={};_0x29a56f[_0x1ec97d[_0x5c14('0x23')]]={'$like':'%'+_0x57e9d5[_0x5c14('0x2a')]['filter']+'%'};return _0x29a56f;}})});}_0x1ab191=_[_0x5c14('0x38')]({},_0x1ab191,_0x57e9d5[_0x5c14('0x3b')]);var _0x4e2b13={'where':_0x1ab191[_0x5c14('0x35')]};return db[_0x5c14('0x26')]['count'](_0x4e2b13)[_0x5c14('0x1e')](function(_0x549de0){_0x5bd15b[_0x5c14('0x19')]=_0x549de0;if(_0x57e9d5[_0x5c14('0x2a')][_0x5c14('0x3c')]){_0x1ab191[_0x5c14('0x3d')]=[{'all':!![]}];}return db[_0x5c14('0x26')][_0x5c14('0x3e')](_0x1ab191);})[_0x5c14('0x1e')](function(_0x420b5f){_0x5bd15b[_0x5c14('0x3f')]=_0x420b5f;return _0x5bd15b;})['then'](respondWithFilteredResult(_0xf15165,_0x1ab191))['catch'](handleError(_0xf15165,null));};exports[_0x5c14('0x40')]=function(_0x1303c4,_0x388485){var _0x54147a={'raw':!![],'where':{'id':_0x1303c4[_0x5c14('0x41')]['id']}},_0x20070b={};_0x20070b[_0x5c14('0x29')]=_[_0x5c14('0x2b')](db[_0x5c14('0x26')][_0x5c14('0x27')]);_0x20070b[_0x5c14('0x2a')]=_[_0x5c14('0x2b')](_0x1303c4[_0x5c14('0x2a')]);_0x20070b[_0x5c14('0x2c')]=_[_0x5c14('0x2d')](_0x20070b[_0x5c14('0x29')],_0x20070b[_0x5c14('0x2a')]);_0x54147a[_0x5c14('0x2e')]=_[_0x5c14('0x2d')](_0x20070b[_0x5c14('0x29')],qs[_0x5c14('0x2f')](_0x1303c4['query'][_0x5c14('0x2f')]));_0x54147a['attributes']=_0x54147a['attributes'][_0x5c14('0x30')]?_0x54147a[_0x5c14('0x2e')]:_0x20070b[_0x5c14('0x29')];if(_0x1303c4[_0x5c14('0x2a')][_0x5c14('0x3c')]){_0x54147a[_0x5c14('0x3d')]=[{'all':!![]}];}_0x54147a=_[_0x5c14('0x38')]({},_0x54147a,_0x1303c4[_0x5c14('0x3b')]);return db[_0x5c14('0x26')]['find'](_0x54147a)[_0x5c14('0x1e')](handleEntityNotFound(_0x388485,null))['then'](respondWithResult(_0x388485,null))[_0x5c14('0x42')](handleError(_0x388485,null));};exports[_0x5c14('0x43')]=function(_0x2c315f,_0x1e5468){return db[_0x5c14('0x26')][_0x5c14('0x43')](_0x2c315f['body'],{})['then'](respondWithResult(_0x1e5468,0xc9))['catch'](handleError(_0x1e5468,null));};exports[_0x5c14('0x1d')]=function(_0x2eeffc,_0x5ce66b){if(_0x2eeffc[_0x5c14('0x44')]['id']){delete _0x2eeffc['body']['id'];}return db[_0x5c14('0x26')][_0x5c14('0x45')]({'where':{'id':_0x2eeffc[_0x5c14('0x41')]['id']}})[_0x5c14('0x1e')](handleEntityNotFound(_0x5ce66b,null))[_0x5c14('0x1e')](saveUpdates(_0x2eeffc[_0x5c14('0x44')],null))[_0x5c14('0x1e')](respondWithResult(_0x5ce66b,null))[_0x5c14('0x42')](handleError(_0x5ce66b,null));};exports['destroy']=function(_0x2c98da,_0x242ec8){return db['SalesforceField'][_0x5c14('0x45')]({'where':{'id':_0x2c98da[_0x5c14('0x41')]['id']}})['then'](handleEntityNotFound(_0x242ec8,null))[_0x5c14('0x1e')](removeEntity(_0x242ec8,null))[_0x5c14('0x42')](handleError(_0x242ec8,null));}; \ No newline at end of file +var _0x21ad=['zip-dir','fast-json-patch','moment','bluebird','util','to-csv','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','then','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x2ace72,_0x814809){var _0x33d102=function(_0x505fd1){while(--_0x505fd1){_0x2ace72['push'](_0x2ace72['shift']());}};_0x33d102(++_0x814809);}(_0x21ad,0x161));var _0xd21a=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x21ad[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require(_0xd21a('0x0'));var rimraf=require(_0xd21a('0x1'));var zipdir=require(_0xd21a('0x2'));var jsonpatch=require(_0xd21a('0x3'));var rp=require('request-promise');var moment=require(_0xd21a('0x4'));var BPromise=require(_0xd21a('0x5'));var Mustache=require('mustache');var util=require(_0xd21a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd21a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd21a('0x8'));var _=require(_0xd21a('0x9'));var squel=require(_0xd21a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd21a('0xb'));var toCsv=require(_0xd21a('0x7'));var querystring=require(_0xd21a('0xc'));var Papa=require(_0xd21a('0xd'));var Redis=require(_0xd21a('0xe'));var authService=require(_0xd21a('0xf'));var qs=require(_0xd21a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd21a('0x11'));var logger=require(_0xd21a('0x12'))(_0xd21a('0x13'));var utils=require(_0xd21a('0x14'));var config=require(_0xd21a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd21a('0x16'))['db'];function respondWithStatusCode(_0x4c24a9,_0x32e4ab){_0x32e4ab=_0x32e4ab||0xcc;return function(_0x27c78){if(_0x27c78){return _0x4c24a9[_0xd21a('0x17')](_0x32e4ab);}return _0x4c24a9[_0xd21a('0x18')](_0x32e4ab)[_0xd21a('0x19')]();};}function respondWithResult(_0x558251,_0x1d27df){_0x1d27df=_0x1d27df||0xc8;return function(_0x351385){if(_0x351385){return _0x558251[_0xd21a('0x18')](_0x1d27df)['json'](_0x351385);}};}function respondWithFilteredResult(_0x43e5d5,_0x2b36ef){return function(_0x2809d0){if(_0x2809d0){var _0x15a367=typeof _0x2b36ef[_0xd21a('0x1a')]===_0xd21a('0x1b')&&typeof _0x2b36ef[_0xd21a('0x1c')]===_0xd21a('0x1b');var _0xfdf8ef=_0x2809d0[_0xd21a('0x1d')];var _0x166fb7=_0x15a367?0x0:_0x2b36ef['offset'];var _0xf63382=_0x15a367?_0x2809d0[_0xd21a('0x1d')]:_0x2b36ef['offset']+_0x2b36ef['limit'];var _0x2977cd;if(_0xf63382>=_0xfdf8ef){_0xf63382=_0xfdf8ef;_0x2977cd=0xc8;}else{_0x2977cd=0xce;}_0x43e5d5[_0xd21a('0x18')](_0x2977cd);return _0x43e5d5[_0xd21a('0x1e')](_0xd21a('0x1f'),_0x166fb7+'-'+_0xf63382+'/'+_0xfdf8ef)['json'](_0x2809d0);}return null;};}function patchUpdates(_0xd12821){return function(_0x16aea9){try{jsonpatch[_0xd21a('0x20')](_0x16aea9,_0xd12821,!![]);}catch(_0x450c29){return BPromise['reject'](_0x450c29);}return _0x16aea9[_0xd21a('0x21')]();};}function saveUpdates(_0x175a9a,_0xe8b883){return function(_0x111d99){if(_0x111d99){return _0x111d99[_0xd21a('0x22')](_0x175a9a)['then'](function(_0x38fc52){return _0x38fc52;});}return null;};}function removeEntity(_0x18f68a,_0x17462a){return function(_0x206864){if(_0x206864){return _0x206864[_0xd21a('0x23')]()['then'](function(){_0x18f68a[_0xd21a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188fdf,_0x3ac889){return function(_0x4eaa48){if(!_0x4eaa48){_0x188fdf['sendStatus'](0x194);}return _0x4eaa48;};}function handleError(_0x320ccd,_0xe22ed7){_0xe22ed7=_0xe22ed7||0x1f4;return function(_0x1e1eba){logger['error'](_0x1e1eba[_0xd21a('0x24')]);if(_0x1e1eba[_0xd21a('0x25')]){delete _0x1e1eba[_0xd21a('0x25')];}_0x320ccd['status'](_0xe22ed7)[_0xd21a('0x26')](_0x1e1eba);};}exports[_0xd21a('0x27')]=function(_0x5bc042,_0x3d52d7){var _0x9ef0f0={},_0xa62d45={},_0x47fb22={'count':0x0,'rows':[]};var _0x5ca46c=_['map'](db['SalesforceField'][_0xd21a('0x28')],function(_0x1cd74c){return{'name':_0x1cd74c[_0xd21a('0x29')],'type':_0x1cd74c[_0xd21a('0x2a')]['key']};});_0xa62d45['model']=_[_0xd21a('0x2b')](_0x5ca46c,_0xd21a('0x25'));_0xa62d45[_0xd21a('0x2c')]=_[_0xd21a('0x2d')](_0x5bc042[_0xd21a('0x2c')]);_0xa62d45[_0xd21a('0x2e')]=_[_0xd21a('0x2f')](_0xa62d45[_0xd21a('0x30')],_0xa62d45[_0xd21a('0x2c')]);_0x9ef0f0[_0xd21a('0x31')]=_[_0xd21a('0x2f')](_0xa62d45[_0xd21a('0x30')],qs['fields'](_0x5bc042[_0xd21a('0x2c')]['fields']));_0x9ef0f0[_0xd21a('0x31')]=_0x9ef0f0[_0xd21a('0x31')][_0xd21a('0x32')]?_0x9ef0f0[_0xd21a('0x31')]:_0xa62d45[_0xd21a('0x30')];if(!_0x5bc042['query']['hasOwnProperty'](_0xd21a('0x33'))){_0x9ef0f0[_0xd21a('0x1c')]=qs[_0xd21a('0x1c')](_0x5bc042[_0xd21a('0x2c')]['limit']);_0x9ef0f0[_0xd21a('0x1a')]=qs[_0xd21a('0x1a')](_0x5bc042[_0xd21a('0x2c')][_0xd21a('0x1a')]);}_0x9ef0f0[_0xd21a('0x34')]=qs[_0xd21a('0x35')](_0x5bc042['query'][_0xd21a('0x35')]);_0x9ef0f0[_0xd21a('0x36')]=qs[_0xd21a('0x2e')](_[_0xd21a('0x37')](_0x5bc042[_0xd21a('0x2c')],_0xa62d45['filters']),_0x5ca46c);if(_0x5bc042['query'][_0xd21a('0x38')]){_0x9ef0f0[_0xd21a('0x36')]=_[_0xd21a('0x39')](_0x9ef0f0[_0xd21a('0x36')],{'$or':_['map'](_0x5ca46c,function(_0x45b892){if(_0x45b892[_0xd21a('0x2a')]!==_0xd21a('0x3a')){var _0x2bc4c5={};_0x2bc4c5[_0x45b892[_0xd21a('0x25')]]={'$like':'%'+_0x5bc042[_0xd21a('0x2c')][_0xd21a('0x38')]+'%'};return _0x2bc4c5;}})});}_0x9ef0f0=_[_0xd21a('0x39')]({},_0x9ef0f0,_0x5bc042[_0xd21a('0x3b')]);var _0x332e0e={'where':_0x9ef0f0['where']};return db[_0xd21a('0x3c')][_0xd21a('0x1d')](_0x332e0e)[_0xd21a('0x3d')](function(_0x560899){_0x47fb22[_0xd21a('0x1d')]=_0x560899;if(_0x5bc042[_0xd21a('0x2c')][_0xd21a('0x3e')]){_0x9ef0f0[_0xd21a('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0xd21a('0x40')](_0x9ef0f0);})[_0xd21a('0x3d')](function(_0x23416b){_0x47fb22['rows']=_0x23416b;return _0x47fb22;})[_0xd21a('0x3d')](respondWithFilteredResult(_0x3d52d7,_0x9ef0f0))[_0xd21a('0x41')](handleError(_0x3d52d7,null));};exports[_0xd21a('0x42')]=function(_0x32e22f,_0x4f4635){var _0x24fffd={'raw':!![],'where':{'id':_0x32e22f[_0xd21a('0x43')]['id']}},_0x4152c5={};_0x4152c5[_0xd21a('0x30')]=_[_0xd21a('0x2d')](db[_0xd21a('0x3c')][_0xd21a('0x28')]);_0x4152c5[_0xd21a('0x2c')]=_['keys'](_0x32e22f[_0xd21a('0x2c')]);_0x4152c5[_0xd21a('0x2e')]=_['intersection'](_0x4152c5[_0xd21a('0x30')],_0x4152c5['query']);_0x24fffd[_0xd21a('0x31')]=_[_0xd21a('0x2f')](_0x4152c5[_0xd21a('0x30')],qs['fields'](_0x32e22f['query']['fields']));_0x24fffd[_0xd21a('0x31')]=_0x24fffd[_0xd21a('0x31')][_0xd21a('0x32')]?_0x24fffd['attributes']:_0x4152c5['model'];if(_0x32e22f[_0xd21a('0x2c')]['includeAll']){_0x24fffd[_0xd21a('0x3f')]=[{'all':!![]}];}_0x24fffd=_['merge']({},_0x24fffd,_0x32e22f['options']);return db[_0xd21a('0x3c')][_0xd21a('0x44')](_0x24fffd)[_0xd21a('0x3d')](handleEntityNotFound(_0x4f4635,null))['then'](respondWithResult(_0x4f4635,null))[_0xd21a('0x41')](handleError(_0x4f4635,null));};exports[_0xd21a('0x45')]=function(_0x2dfccc,_0x42cade){return db[_0xd21a('0x3c')]['create'](_0x2dfccc[_0xd21a('0x46')],{})[_0xd21a('0x3d')](respondWithResult(_0x42cade,0xc9))[_0xd21a('0x41')](handleError(_0x42cade,null));};exports[_0xd21a('0x22')]=function(_0x1243a3,_0x5840c0){if(_0x1243a3[_0xd21a('0x46')]['id']){delete _0x1243a3[_0xd21a('0x46')]['id'];}return db[_0xd21a('0x3c')][_0xd21a('0x44')]({'where':{'id':_0x1243a3[_0xd21a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5840c0,null))['then'](saveUpdates(_0x1243a3[_0xd21a('0x46')],null))[_0xd21a('0x3d')](respondWithResult(_0x5840c0,null))['catch'](handleError(_0x5840c0,null));};exports['destroy']=function(_0x2a6c3e,_0x55a243){return db[_0xd21a('0x3c')]['find']({'where':{'id':_0x2a6c3e[_0xd21a('0x43')]['id']}})['then'](handleEntityNotFound(_0x55a243,null))[_0xd21a('0x3d')](removeEntity(_0x55a243,null))['catch'](handleError(_0x55a243,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 61dd828..9f84bd0 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 _0x493a=['exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x549c51,_0x29e6fd){var _0x264861=function(_0x24e074){while(--_0x24e074){_0x549c51['push'](_0x549c51['shift']());}};_0x264861(++_0x29e6fd);}(_0x493a,0xa0));var _0xa493=function(_0x3d1ce2,_0x2a9d26){_0x3d1ce2=_0x3d1ce2-0x0;var _0x43c682=_0x493a[_0x3d1ce2];return _0x43c682;};'use strict';var _=require(_0xa493('0x0'));var util=require(_0xa493('0x1'));var logger=require(_0xa493('0x2'))(_0xa493('0x3'));var moment=require('moment');var BPromise=require(_0xa493('0x4'));var rp=require(_0xa493('0x5'));var fs=require('fs');var path=require(_0xa493('0x6'));var rimraf=require(_0xa493('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xa493('0x8')]=function(_0x39edcd,_0x3b289d){return _0x39edcd[_0xa493('0x9')]('SalesforceField',attributes,{'tableName':_0xa493('0xa'),'paranoid':![],'indexes':[{'name':_0xa493('0xb'),'fields':[_0xa493('0xc'),_0xa493('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3944=['path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x70db11,_0x3cdc8c){var _0x2155d9=function(_0x16a116){while(--_0x16a116){_0x70db11['push'](_0x70db11['shift']());}};_0x2155d9(++_0x3cdc8c);}(_0x3944,0x13a));var _0x4394=function(_0x53591f,_0x261d10){_0x53591f=_0x53591f-0x0;var _0x245df6=_0x3944[_0x53591f];return _0x245df6;};'use strict';var _=require(_0x4394('0x0'));var util=require(_0x4394('0x1'));var logger=require(_0x4394('0x2'))(_0x4394('0x3'));var moment=require(_0x4394('0x4'));var BPromise=require('bluebird');var rp=require(_0x4394('0x5'));var fs=require('fs');var path=require(_0x4394('0x6'));var rimraf=require('rimraf');var config=require(_0x4394('0x7'));var attributes=require(_0x4394('0x8'));module[_0x4394('0x9')]=function(_0x2c5ff2,_0x3df325){return _0x2c5ff2[_0x4394('0xa')](_0x4394('0xb'),attributes,{'tableName':_0x4394('0xc'),'paranoid':![],'indexes':[{'name':_0x4394('0xd'),'fields':[_0x4394('0xe'),_0x4394('0xf')],'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 26755d7..96914e9 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 _0x99c9=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x54b637,_0x53af68){var _0x522f8f=function(_0x22c35f){while(--_0x22c35f){_0x54b637['push'](_0x54b637['shift']());}};_0x522f8f(++_0x53af68);}(_0x99c9,0x1e9));var _0x999c=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x99c9[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x999c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x999c('0x4'));var logger=require(_0x999c('0x5'))('rpc');var config=require(_0x999c('0x6'));var jayson=require(_0x999c('0x7'));var client=jayson[_0x999c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1deb1f,_0x30e423,_0x3adeea){return new BPromise(function(_0x684029,_0x26a0db){return client[_0x999c('0x9')](_0x1deb1f,_0x3adeea)['then'](function(_0x36934c){logger[_0x999c('0xa')](_0x999c('0xb'),_0x30e423,_0x999c('0xc'));logger[_0x999c('0xd')](_0x999c('0xe'),_0x30e423,_0x999c('0xc'),JSON['stringify'](_0x36934c));if(_0x36934c[_0x999c('0xf')]){if(_0x36934c[_0x999c('0xf')][_0x999c('0x10')]===0x1f4){logger[_0x999c('0xf')]('SalesforceField,\x20%s,\x20%s',_0x30e423,_0x36934c['error'][_0x999c('0x11')]);return _0x26a0db(_0x36934c[_0x999c('0xf')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x30e423,_0x36934c[_0x999c('0xf')][_0x999c('0x11')]);return _0x684029(_0x36934c[_0x999c('0xf')][_0x999c('0x11')]);}else{logger[_0x999c('0xa')]('SalesforceField,\x20%s,\x20%s',_0x30e423,'request\x20sent');_0x684029(_0x36934c[_0x999c('0x12')][_0x999c('0x11')]);}})[_0x999c('0x13')](function(_0x183f8d){logger[_0x999c('0xf')]('SalesforceField,\x20%s,\x20%s',_0x30e423,_0x183f8d);_0x26a0db(_0x183f8d);});});} \ No newline at end of file +var _0x68c5=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x4259fb,_0x5e707b){var _0x39b86c=function(_0x5297db){while(--_0x5297db){_0x4259fb['push'](_0x4259fb['shift']());}};_0x39b86c(++_0x5e707b);}(_0x68c5,0x70));var _0x568c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x68c5[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x568c('0x0'));var util=require(_0x568c('0x1'));var moment=require(_0x568c('0x2'));var BPromise=require('bluebird');var rs=require(_0x568c('0x3'));var fs=require('fs');var Redis=require(_0x568c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x568c('0x5'))(_0x568c('0x6'));var config=require(_0x568c('0x7'));var jayson=require(_0x568c('0x8'));var client=jayson[_0x568c('0x9')][_0x568c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eb985,_0x136d34,_0x3b9e33){return new BPromise(function(_0x340192,_0x2db783){return client['request'](_0x5eb985,_0x3b9e33)[_0x568c('0xb')](function(_0x3acddb){logger[_0x568c('0xc')](_0x568c('0xd'),_0x136d34,_0x568c('0xe'));logger[_0x568c('0xf')](_0x568c('0x10'),_0x136d34,_0x568c('0xe'),JSON[_0x568c('0x11')](_0x3acddb));if(_0x3acddb[_0x568c('0x12')]){if(_0x3acddb[_0x568c('0x12')][_0x568c('0x13')]===0x1f4){logger[_0x568c('0x12')](_0x568c('0xd'),_0x136d34,_0x3acddb[_0x568c('0x12')]['message']);return _0x2db783(_0x3acddb[_0x568c('0x12')]['message']);}logger[_0x568c('0x12')]('SalesforceField,\x20%s,\x20%s',_0x136d34,_0x3acddb[_0x568c('0x12')][_0x568c('0x14')]);return _0x340192(_0x3acddb[_0x568c('0x12')][_0x568c('0x14')]);}else{logger[_0x568c('0xc')](_0x568c('0xd'),_0x136d34,_0x568c('0xe'));_0x340192(_0x3acddb[_0x568c('0x15')][_0x568c('0x14')]);}})[_0x568c('0x16')](function(_0x2ecae1){logger[_0x568c('0x12')](_0x568c('0xd'),_0x136d34,_0x2ecae1);_0x2db783(_0x2ecae1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 10c397b..aac5616 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 _0xdd32=['./intServicenowAccount.controller','get','index','isAuthenticated','show','getConfigurations','post','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15f114,_0x22935c){var _0x52df23=function(_0x2e1439){while(--_0x2e1439){_0x15f114['push'](_0x15f114['shift']());}};_0x52df23(++_0x22935c);}(_0xdd32,0x98));var _0x2dd3=function(_0x589870,_0x2595a1){_0x589870=_0x589870-0x0;var _0xf3ffc0=_0xdd32[_0x589870];return _0xf3ffc0;};'use strict';var multer=require(_0x2dd3('0x0'));var util=require(_0x2dd3('0x1'));var path=require(_0x2dd3('0x2'));var timeout=require(_0x2dd3('0x3'));var express=require(_0x2dd3('0x4'));var router=express[_0x2dd3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2dd3('0x6'));var interaction=require(_0x2dd3('0x7'));var config=require(_0x2dd3('0x8'));var controller=require(_0x2dd3('0x9'));router[_0x2dd3('0xa')]('/',auth['isAuthenticated'](),controller[_0x2dd3('0xb')]);router[_0x2dd3('0xa')]('/:id',auth[_0x2dd3('0xc')](),controller[_0x2dd3('0xd')]);router[_0x2dd3('0xa')]('/:id/configurations',auth[_0x2dd3('0xc')](),controller[_0x2dd3('0xe')]);router['get']('/:id/fields',auth[_0x2dd3('0xc')](),controller['getFields']);router[_0x2dd3('0xf')]('/',auth[_0x2dd3('0xc')](),controller['create']);router['post'](_0x2dd3('0x10'),auth['isAuthenticated'](),controller[_0x2dd3('0x11')]);router['put'](_0x2dd3('0x12'),auth[_0x2dd3('0xc')](),controller[_0x2dd3('0x13')]);router[_0x2dd3('0x14')](_0x2dd3('0x12'),auth[_0x2dd3('0xc')](),controller[_0x2dd3('0x15')]);module[_0x2dd3('0x16')]=router; \ No newline at end of file +var _0x4e0c=['./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x420f45,_0x82ba43){var _0x115f02=function(_0x1f2638){while(--_0x1f2638){_0x420f45['push'](_0x420f45['shift']());}};_0x115f02(++_0x82ba43);}(_0x4e0c,0x70));var _0xc4e0=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x4e0c[_0x574ce3];return _0x3447a0;};'use strict';var multer=require('multer');var util=require(_0xc4e0('0x0'));var path=require(_0xc4e0('0x1'));var timeout=require('connect-timeout');var express=require(_0xc4e0('0x2'));var router=express[_0xc4e0('0x3')]();var fs_extra=require(_0xc4e0('0x4'));var auth=require(_0xc4e0('0x5'));var interaction=require(_0xc4e0('0x6'));var config=require(_0xc4e0('0x7'));var controller=require(_0xc4e0('0x8'));router[_0xc4e0('0x9')]('/',auth[_0xc4e0('0xa')](),controller['index']);router[_0xc4e0('0x9')]('/:id',auth[_0xc4e0('0xa')](),controller[_0xc4e0('0xb')]);router[_0xc4e0('0x9')](_0xc4e0('0xc'),auth['isAuthenticated'](),controller[_0xc4e0('0xd')]);router[_0xc4e0('0x9')](_0xc4e0('0xe'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0xf')]);router[_0xc4e0('0x10')]('/',auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x11')]);router[_0xc4e0('0x10')](_0xc4e0('0xc'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x12')]);router['put'](_0xc4e0('0x13'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x14')]);router[_0xc4e0('0x15')](_0xc4e0('0x13'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x16')]);module[_0xc4e0('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 490affa..6eee143 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 _0xf7b6=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4248d4,_0x21de09){var _0x110855=function(_0x5bf3c4){while(--_0x5bf3c4){_0x4248d4['push'](_0x4248d4['shift']());}};_0x110855(++_0x21de09);}(_0xf7b6,0x1cb));var _0x6f7b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf7b6[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x6f7b('0x0'));module[_0x6f7b('0x1')]={'name':{'type':Sequelize[_0x6f7b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6f7b('0x3')},'password':{'type':Sequelize[_0x6f7b('0x2')]},'email':{'type':Sequelize[_0x6f7b('0x2')]},'remoteUri':{'type':Sequelize[_0x6f7b('0x2')],'unique':_0x6f7b('0x4')},'serverUrl':{'type':Sequelize[_0x6f7b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x429a=['STRING','username','remoteUri','exports'];(function(_0x4e0edb,_0x202780){var _0x331c57=function(_0xeea52f){while(--_0xeea52f){_0x4e0edb['push'](_0x4e0edb['shift']());}};_0x331c57(++_0x202780);}(_0x429a,0x13f));var _0xa429=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x429a[_0x3eb630];return _0x1b840d;};'use strict';var Sequelize=require('sequelize');module[_0xa429('0x0')]={'name':{'type':Sequelize[_0xa429('0x1')]},'description':{'type':Sequelize[_0xa429('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa429('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa429('0x3')},'serverUrl':{'type':Sequelize[_0xa429('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 0d506c3..b9960db 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 _0x485f=['moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','save','update','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','ServicenowAccount','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','ServicenowConfiguration','options','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','hold_reason','knowledge','subcategory','close_code','notify','severity','category','made_sla','caused_by','watch_list','upon_reject','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','correlation_display','delivery_task','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','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x485f,0x177));var _0xf485=function(_0x289e48,_0x2fe387){_0x289e48=_0x289e48-0x0;var _0x56d497=_0x485f[_0x289e48];return _0x56d497;};'use strict';var emlformat=require(_0xf485('0x0'));var rimraf=require(_0xf485('0x1'));var zipdir=require(_0xf485('0x2'));var jsonpatch=require(_0xf485('0x3'));var rp=require(_0xf485('0x4'));var moment=require(_0xf485('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf485('0x6'));var util=require('util');var path=require(_0xf485('0x7'));var sox=require(_0xf485('0x8'));var csv=require(_0xf485('0x9'));var ejs=require(_0xf485('0xa'));var fs=require('fs');var fs_extra=require(_0xf485('0xb'));var _=require(_0xf485('0xc'));var squel=require(_0xf485('0xd'));var crypto=require(_0xf485('0xe'));var jsforce=require(_0xf485('0xf'));var deskjs=require(_0xf485('0x10'));var toCsv=require(_0xf485('0x9'));var querystring=require('querystring');var Papa=require(_0xf485('0x11'));var Redis=require(_0xf485('0x12'));var authService=require(_0xf485('0x13'));var qs=require(_0xf485('0x14'));var as=require(_0xf485('0x15'));var hardwareService=require(_0xf485('0x16'));var logger=require(_0xf485('0x17'))(_0xf485('0x18'));var utils=require('../../config/utils');var config=require(_0xf485('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf485('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c4825,_0x3957d7){_0x3957d7=_0x3957d7||0xcc;return function(_0x82d4d){if(_0x82d4d){return _0x3c4825[_0xf485('0x1b')](_0x3957d7);}return _0x3c4825[_0xf485('0x1c')](_0x3957d7)['end']();};}function respondWithResult(_0xeb56db,_0x39e631){_0x39e631=_0x39e631||0xc8;return function(_0x15a403){if(_0x15a403){return _0xeb56db[_0xf485('0x1c')](_0x39e631)['json'](_0x15a403);}};}function respondWithFilteredResult(_0xfb797f,_0x18fbe1){return function(_0x14b26a){if(_0x14b26a){var _0x4f6d91=typeof _0x18fbe1[_0xf485('0x1d')]===_0xf485('0x1e')&&typeof _0x18fbe1[_0xf485('0x1f')]===_0xf485('0x1e');var _0x1606ca=_0x14b26a[_0xf485('0x20')];var _0x1cdedc=_0x4f6d91?0x0:_0x18fbe1[_0xf485('0x1d')];var _0x59f179=_0x4f6d91?_0x14b26a[_0xf485('0x20')]:_0x18fbe1[_0xf485('0x1d')]+_0x18fbe1['limit'];var _0x39586b;if(_0x59f179>=_0x1606ca){_0x59f179=_0x1606ca;_0x39586b=0xc8;}else{_0x39586b=0xce;}_0xfb797f[_0xf485('0x1c')](_0x39586b);return _0xfb797f[_0xf485('0x21')]('Content-Range',_0x1cdedc+'-'+_0x59f179+'/'+_0x1606ca)[_0xf485('0x22')](_0x14b26a);}return null;};}function patchUpdates(_0x114694){return function(_0x59ddae){try{jsonpatch['apply'](_0x59ddae,_0x114694,!![]);}catch(_0x29980a){return BPromise['reject'](_0x29980a);}return _0x59ddae[_0xf485('0x23')]();};}function saveUpdates(_0x1f688e,_0x3e5b1d){return function(_0x4afa62){if(_0x4afa62){return _0x4afa62[_0xf485('0x24')](_0x1f688e)['then'](function(_0x460c43){return _0x460c43;});}return null;};}function removeEntity(_0x2cedf9,_0x55a002){return function(_0x4b6c03){if(_0x4b6c03){return _0x4b6c03[_0xf485('0x25')]()['then'](function(){_0x2cedf9[_0xf485('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49b7ee,_0x270b3f){return function(_0x1796eb){if(!_0x1796eb){_0x49b7ee['sendStatus'](0x194);}return _0x1796eb;};}function handleError(_0x59e391,_0x1bcf12){_0x1bcf12=_0x1bcf12||0x1f4;return function(_0x569ea4){logger[_0xf485('0x26')](_0x569ea4[_0xf485('0x27')]);if(_0x569ea4[_0xf485('0x28')]){delete _0x569ea4[_0xf485('0x28')];}_0x59e391[_0xf485('0x1c')](_0x1bcf12)[_0xf485('0x29')](_0x569ea4);};}exports[_0xf485('0x2a')]=function(_0x10acdd,_0x359155){var _0x31baa3={},_0x40685c={},_0x545517={'count':0x0,'rows':[]};var _0x1a051c=_[_0xf485('0x2b')](db['ServicenowAccount']['rawAttributes'],function(_0x6225b2){return{'name':_0x6225b2[_0xf485('0x2c')],'type':_0x6225b2[_0xf485('0x2d')][_0xf485('0x2e')]};});_0x40685c[_0xf485('0x2f')]=_['map'](_0x1a051c,_0xf485('0x28'));_0x40685c[_0xf485('0x30')]=_[_0xf485('0x31')](_0x10acdd[_0xf485('0x30')]);_0x40685c[_0xf485('0x32')]=_[_0xf485('0x33')](_0x40685c[_0xf485('0x2f')],_0x40685c['query']);_0x31baa3[_0xf485('0x34')]=_['intersection'](_0x40685c[_0xf485('0x2f')],qs[_0xf485('0x35')](_0x10acdd[_0xf485('0x30')][_0xf485('0x35')]));_0x31baa3[_0xf485('0x34')]=_0x31baa3[_0xf485('0x34')][_0xf485('0x36')]?_0x31baa3[_0xf485('0x34')]:_0x40685c['model'];if(!_0x10acdd[_0xf485('0x30')][_0xf485('0x37')]('nolimit')){_0x31baa3['limit']=qs[_0xf485('0x1f')](_0x10acdd[_0xf485('0x30')][_0xf485('0x1f')]);_0x31baa3[_0xf485('0x1d')]=qs['offset'](_0x10acdd['query']['offset']);}_0x31baa3[_0xf485('0x38')]=qs[_0xf485('0x39')](_0x10acdd[_0xf485('0x30')][_0xf485('0x39')]);_0x31baa3['where']=qs[_0xf485('0x32')](_[_0xf485('0x3a')](_0x10acdd[_0xf485('0x30')],_0x40685c[_0xf485('0x32')]),_0x1a051c);if(_0x10acdd['query']['filter']){_0x31baa3[_0xf485('0x3b')]=_[_0xf485('0x3c')](_0x31baa3[_0xf485('0x3b')],{'$or':_[_0xf485('0x2b')](_0x1a051c,function(_0x585d3c){if(_0x585d3c[_0xf485('0x2d')]!==_0xf485('0x3d')){var _0x4c3359={};_0x4c3359[_0x585d3c[_0xf485('0x28')]]={'$like':'%'+_0x10acdd[_0xf485('0x30')]['filter']+'%'};return _0x4c3359;}})});}_0x31baa3=_[_0xf485('0x3c')]({},_0x31baa3,_0x10acdd['options']);var _0x5a7c33={'where':_0x31baa3[_0xf485('0x3b')]};return db[_0xf485('0x3e')][_0xf485('0x20')](_0x5a7c33)[_0xf485('0x3f')](function(_0x453418){_0x545517[_0xf485('0x20')]=_0x453418;if(_0x10acdd[_0xf485('0x30')]['includeAll']){_0x31baa3[_0xf485('0x40')]=[{'all':!![]}];}return db[_0xf485('0x3e')][_0xf485('0x41')](_0x31baa3);})[_0xf485('0x3f')](function(_0x1a89d1){_0x545517[_0xf485('0x42')]=_0x1a89d1;return _0x545517;})[_0xf485('0x3f')](respondWithFilteredResult(_0x359155,_0x31baa3))[_0xf485('0x43')](handleError(_0x359155,null));};exports[_0xf485('0x44')]=function(_0x5e04d7,_0x43cb60){var _0x5a10df={'raw':![],'where':{'id':_0x5e04d7[_0xf485('0x45')]['id']}},_0xc4204e={};_0xc4204e['model']=_[_0xf485('0x31')](db[_0xf485('0x3e')][_0xf485('0x46')]);_0xc4204e[_0xf485('0x30')]=_['keys'](_0x5e04d7[_0xf485('0x30')]);_0xc4204e['filters']=_['intersection'](_0xc4204e[_0xf485('0x2f')],_0xc4204e[_0xf485('0x30')]);_0x5a10df[_0xf485('0x34')]=_[_0xf485('0x33')](_0xc4204e[_0xf485('0x2f')],qs[_0xf485('0x35')](_0x5e04d7[_0xf485('0x30')]['fields']));_0x5a10df[_0xf485('0x34')]=_0x5a10df['attributes'][_0xf485('0x36')]?_0x5a10df[_0xf485('0x34')]:_0xc4204e[_0xf485('0x2f')];if(_0x5e04d7[_0xf485('0x30')][_0xf485('0x47')]){_0x5a10df['include']=[{'all':!![]}];}_0x5a10df=_[_0xf485('0x3c')]({},_0x5a10df,_0x5e04d7['options']);return db[_0xf485('0x3e')][_0xf485('0x48')](_0x5a10df)[_0xf485('0x3f')](handleEntityNotFound(_0x43cb60,null))[_0xf485('0x3f')](respondWithResult(_0x43cb60,null))[_0xf485('0x43')](handleError(_0x43cb60,null));};exports[_0xf485('0x49')]=function(_0x572837,_0xc59acd){return db['ServicenowAccount']['create'](_0x572837[_0xf485('0x4a')],{})[_0xf485('0x3f')](respondWithResult(_0xc59acd,0xc9))['catch'](handleError(_0xc59acd,null));};exports[_0xf485('0x24')]=function(_0x583857,_0x23e173){if(_0x583857['body']['id']){delete _0x583857[_0xf485('0x4a')]['id'];}return db['ServicenowAccount'][_0xf485('0x48')]({'where':{'id':_0x583857[_0xf485('0x45')]['id']}})[_0xf485('0x3f')](handleEntityNotFound(_0x23e173,null))[_0xf485('0x3f')](saveUpdates(_0x583857[_0xf485('0x4a')],null))[_0xf485('0x3f')](respondWithResult(_0x23e173,null))[_0xf485('0x43')](handleError(_0x23e173,null));};exports[_0xf485('0x25')]=function(_0x3956cc,_0x134c74){return db['ServicenowAccount'][_0xf485('0x48')]({'where':{'id':_0x3956cc['params']['id']}})['then'](handleEntityNotFound(_0x134c74,null))[_0xf485('0x3f')](removeEntity(_0x134c74,null))[_0xf485('0x43')](handleError(_0x134c74,null));};exports[_0xf485('0x4b')]=function(_0x176d00,_0x52ca8f,_0x23eed4){var _0x22c9d0={};var _0x2e15ad={};var _0x3aecb1;var _0x358f25;return db['ServicenowAccount']['findOne']({'where':{'id':_0x176d00[_0xf485('0x45')]['id']}})['then'](handleEntityNotFound(_0x52ca8f,null))[_0xf485('0x3f')](function(_0x23e0bf){if(_0x23e0bf){_0x3aecb1=_0x23e0bf;_0x2e15ad[_0xf485('0x2f')]=_[_0xf485('0x31')](db[_0xf485('0x4c')]['rawAttributes']);_0x2e15ad['query']=_[_0xf485('0x31')](_0x176d00[_0xf485('0x30')]);_0x2e15ad['filters']=_[_0xf485('0x33')](_0x2e15ad[_0xf485('0x2f')],_0x2e15ad[_0xf485('0x30')]);_0x22c9d0[_0xf485('0x34')]=_[_0xf485('0x33')](_0x2e15ad[_0xf485('0x2f')],qs[_0xf485('0x35')](_0x176d00['query'][_0xf485('0x35')]));_0x22c9d0['attributes']=_0x22c9d0['attributes'][_0xf485('0x36')]?_0x22c9d0[_0xf485('0x34')]:_0x2e15ad['model'];_0x22c9d0['order']=qs[_0xf485('0x39')](_0x176d00[_0xf485('0x30')]['sort']);_0x22c9d0[_0xf485('0x3b')]=qs[_0xf485('0x32')](_[_0xf485('0x3a')](_0x176d00[_0xf485('0x30')],_0x2e15ad[_0xf485('0x32')]));if(_0x176d00[_0xf485('0x30')]['filter']){_0x22c9d0['where']=_[_0xf485('0x3c')](_0x22c9d0[_0xf485('0x3b')],{'$or':_[_0xf485('0x2b')](_0x22c9d0[_0xf485('0x34')],function(_0x4c1cf4){var _0x3381f3={};_0x3381f3[_0x4c1cf4]={'$like':'%'+_0x176d00[_0xf485('0x30')]['filter']+'%'};return _0x3381f3;})});}_0x22c9d0=_[_0xf485('0x3c')]({},_0x22c9d0,_0x176d00[_0xf485('0x4d')]);return _0x3aecb1[_0xf485('0x4b')](_0x22c9d0);}})[_0xf485('0x3f')](function(_0x32d567){if(_0x32d567){_0x358f25=_0x32d567['length'];if(!_0x176d00[_0xf485('0x30')][_0xf485('0x37')](_0xf485('0x4e'))){_0x22c9d0[_0xf485('0x1f')]=qs[_0xf485('0x1f')](_0x176d00[_0xf485('0x30')][_0xf485('0x1f')]);_0x22c9d0[_0xf485('0x1d')]=qs[_0xf485('0x1d')](_0x176d00[_0xf485('0x30')][_0xf485('0x1d')]);}return _0x3aecb1[_0xf485('0x4b')](_0x22c9d0);}})['then'](function(_0x135c28){if(_0x135c28){return _0x135c28?{'count':_0x358f25,'rows':_0x135c28}:null;}})[_0xf485('0x3f')](respondWithResult(_0x52ca8f,null))[_0xf485('0x43')](handleError(_0x52ca8f,null));};exports[_0xf485('0x4f')]=function(_0x9c97ab,_0x48ab08,_0x33fe65){if(_0x9c97ab[_0xf485('0x4a')]['id']){delete _0x9c97ab[_0xf485('0x4a')]['id'];}return db[_0xf485('0x3e')][_0xf485('0x50')]({'where':{'id':_0x9c97ab[_0xf485('0x45')]['id']}})['then'](handleEntityNotFound(_0x48ab08,null))[_0xf485('0x3f')](function(_0x781776){if(_0x781776){_0x9c97ab[_0xf485('0x4a')][_0xf485('0x51')]=_0x781776['id'];_0x9c97ab['body'][_0xf485('0x52')]=integrations[_0xf485('0x53')](_0x9c97ab[_0xf485('0x4a')][_0xf485('0x54')],_0x9c97ab['body']['type']);_0x9c97ab[_0xf485('0x4a')][_0xf485('0x55')]=integrations[_0xf485('0x56')](_0x9c97ab[_0xf485('0x4a')][_0xf485('0x54')],_0x9c97ab[_0xf485('0x4a')][_0xf485('0x2d')]);return db[_0xf485('0x4c')]['create'](_0x9c97ab['body'],{'include':[{'model':db[_0xf485('0x57')],'as':_0xf485('0x52')},{'model':db['ServicenowField'],'as':_0xf485('0x55')}]});}return null;})['then'](respondWithResult(_0x48ab08,null))[_0xf485('0x43')](handleError(_0x48ab08,null));};exports['getFields']=function(_0x44f502,_0x5f3201,_0x4e49ca){var _0x3dc120=['made_sla',_0xf485('0x58'),_0xf485('0x59'),_0xf485('0x5a'),_0xf485('0x5b'),_0xf485('0x5c'),'incident_state',_0xf485('0x5d'),_0xf485('0x5e')];var _0x266e0b=['parent',_0xf485('0x5f'),_0xf485('0x60'),_0xf485('0x61'),_0xf485('0x62'),'sys_updated_on','child_incidents','hold_reason','approval_history',_0xf485('0x63'),_0xf485('0x64'),_0xf485('0x65'),_0xf485('0x66'),_0xf485('0x67'),_0xf485('0x68'),_0xf485('0x69'),_0xf485('0x6a'),_0xf485('0x6b'),'knowledge','order','calendar_stc',_0xf485('0x6c'),_0xf485('0x6d'),'delivery_plan','impact',_0xf485('0x6e'),'work_notes_list',_0xf485('0x6f'),_0xf485('0x70'),_0xf485('0x71'),_0xf485('0x72'),_0xf485('0x73'),_0xf485('0x74'),_0xf485('0x75'),_0xf485('0x76'),_0xf485('0x77'),_0xf485('0x78'),_0xf485('0x79'),_0xf485('0x7a'),_0xf485('0x7b'),'approval_set',_0xf485('0x5a'),'work_notes','short_description','close_code',_0xf485('0x7c'),_0xf485('0x7d'),_0xf485('0x7e'),_0xf485('0x7f'),_0xf485('0x80'),_0xf485('0x81'),_0xf485('0x82'),_0xf485('0x83'),_0xf485('0x5c'),_0xf485('0x84'),_0xf485('0x85'),_0xf485('0x86'),_0xf485('0x87'),_0xf485('0x88'),_0xf485('0x89'),_0xf485('0x8a'),_0xf485('0x8b'),'incident_state',_0xf485('0x8c'),_0xf485('0x8d'),_0xf485('0x8e'),_0xf485('0x8f'),_0xf485('0x90'),_0xf485('0x91'),_0xf485('0x5d'),_0xf485('0x92'),_0xf485('0x93'),_0xf485('0x94'),_0xf485('0x95'),_0xf485('0x96'),_0xf485('0x97'),_0xf485('0x98'),_0xf485('0x99'),_0xf485('0x9a'),_0xf485('0x9b'),_0xf485('0x9c'),_0xf485('0x9d'),_0xf485('0x5e')];var _0x4b12fa='';var _0x46bf7e='';var _0x1c53d9=[];var _0x34c35d='';var _0x522d42='';var _0x22d10b=[];var _0x1c8b01='';var _0x1b3c0a='';var _0x345594={};var _0x433a7f='';return db['ServicenowAccount'][_0xf485('0x50')]({'where':{'id':_0x44f502['params']['id']},'attributes':['id',_0xf485('0x9e'),'password',_0xf485('0x9f'),_0xf485('0xa0'),_0xf485('0xa1')]})[_0xf485('0x3f')](handleEntityNotFound(_0x5f3201,null))[_0xf485('0x3f')](function(_0x1ca526){if(_0x1ca526){_0x433a7f=_0x1ca526[_0xf485('0xa0')];var _0x53bfef=_0x433a7f[_0xf485('0xa2')](-0x1);if(_0x53bfef==='/'){_0x433a7f=_0x433a7f['substring'](0x0,_0x433a7f[_0xf485('0xa3')](_0x53bfef));}_0x1b3c0a=util[_0xf485('0xa4')](_0xf485('0xa5'),_0x433a7f);_0x1c8b01=util[_0xf485('0xa4')](_0xf485('0xa6'),_0x433a7f);_0x345594={'user':_0x1ca526[_0xf485('0x9e')],'pass':_0x1ca526[_0xf485('0xa7')]};var _0x58f2e5={'method':'GET','uri':_0x1b3c0a+_0xf485('0xa8'),'auth':_0x345594,'json':!![]};return rp(_0x58f2e5);}})['then'](function(_0x581c77){if(_0x581c77[_0xf485('0xa9')][_0xf485('0x36')]>0x0){_0x4b12fa=_0x581c77[_0xf485('0xa9')];}console[_0xf485('0xaa')](_0xf485('0xab'),_0x4b12fa);_0x22d10b=[];_0x46bf7e=Object[_0xf485('0xac')]([],_0x4b12fa);_[_0xf485('0xad')](_0x46bf7e,function(_0x4db3a3){return!_0x3dc120[_0xf485('0xae')](_0x4db3a3['name']);});_0x46bf7e['forEach'](function(_0x3eb161){var _0x2545f4=createFieldObject(_0x1c8b01,_0x345594,_0x3eb161[_0xf485('0xaf')],_0x3eb161[_0xf485('0x28')],_0x3eb161['label'],![]);_0x22d10b[_0xf485('0xb0')](_0x2545f4);});return Promise[_0xf485('0xb1')](_0x22d10b);})[_0xf485('0x3f')](function(_0x55b271){_0x1c53d9=_0x55b271;_0x34c35d=Object['assign']([],_0x4b12fa);console[_0xf485('0xaa')](_0xf485('0xb2'),_0x4b12fa);_[_0xf485('0xad')](_0x34c35d,function(_0x169d16){return _0x266e0b[_0xf485('0xae')](_0x169d16[_0xf485('0x28')]);});console[_0xf485('0xaa')](_0xf485('0xb3'),_0x34c35d);_0x22d10b=[];_0x34c35d[_0xf485('0xb4')](function(_0x3de50e){var _0x381fbb=createFieldObject(_0x1c8b01,_0x345594,_0x3de50e[_0xf485('0xaf')],_0x3de50e[_0xf485('0x28')],_0x3de50e['label'],!![]);_0x22d10b['push'](_0x381fbb);});return Promise['all'](_0x22d10b);})['then'](function(_0x47d085){_0x522d42=_0x47d085;var _0x226d69=_0x1c53d9[_0xf485('0xb5')](_0x522d42);return{'count':_0x226d69[_0xf485('0x36')],'rows':_0x226d69};})['then'](respondWithResult(_0x5f3201,null))['catch'](function(_0x233108){console[_0xf485('0xaa')](_0xf485('0xb6')+_0x233108);var _0x14b313=_0x44f502[_0xf485('0x30')][_0xf485('0xb7')]?0x1f4:_0x233108[_0xf485('0xb8')]||0x1f4;logger[_0xf485('0x26')](_0x233108[_0xf485('0x27')]);delete _0x233108[_0xf485('0x28')];if(_0x14b313===0x191){_0x14b313=0x190;}_0x5f3201[_0xf485('0x1c')](_0x14b313)[_0xf485('0x29')](_0x44f502[_0xf485('0x30')][_0xf485('0xb7')]?{'message':'Wrong\x20credentials','statusCode':_0x233108[_0xf485('0xb8')]}:_0x233108);});};function createFieldObject(_0x49afe4,_0x48f2ec,_0x315749,_0x5f1ba8,_0x4ebbbf,_0x38b253){return new Promise(function(_0x184755,_0xa13d1e){var _0x5c8c88={'id':_0x5f1ba8,'name':_0x4ebbbf,'custom':_0x38b253};if(_0x315749===_0xf485('0xb9')){_0x5c8c88['options']=[{'name':_0xf485('0xba'),'value':'true'},{'name':'False','value':_0xf485('0xbb')}];_0x184755(_0x5c8c88);}else{var _0x5517fd={'method':'GET','uri':_0x49afe4+'sys_choice?sysparm_query=name=incident^element='+_0x5f1ba8,'auth':_0x48f2ec,'json':!![]};return rp(_0x5517fd)[_0xf485('0x3f')](function(_0x4d215c){var _0x1046a1=[];if(_0x4d215c['result'][_0xf485('0x36')]>0x0){_0x4d215c[_0xf485('0xa9')][_0xf485('0xb4')](function(_0x5da5a0){if(_0x5da5a0[_0xf485('0xbc')]===_0xf485('0xbb')){var _0xd1ccf5={'name':_0x5da5a0['label'],'value':_0x5da5a0[_0xf485('0xbd')]};_0x1046a1[_0xf485('0xb0')](_0xd1ccf5);}});}_0x5c8c88['options']=_0x1046a1;if(_0x5c8c88[_0xf485('0x4d')][_0xf485('0x36')]>0x0){_0x184755(_0x5c8c88);}else{if(_0x38b253==![]){_0x184755();}else{_0x184755(_0x5c8c88);}}});}});} \ No newline at end of file +var _0x4c36=['length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','include','findAll','rows','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','severity','category','parent','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','incident_state','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','fields','query'];(function(_0x416aed,_0x2afb47){var _0x3b73ec=function(_0x3ea460){while(--_0x3ea460){_0x416aed['push'](_0x416aed['shift']());}};_0x3b73ec(++_0x2afb47);}(_0x4c36,0x1ec));var _0x64c3=function(_0x108016,_0x32a74a){_0x108016=_0x108016-0x0;var _0xa4a24f=_0x4c36[_0x108016];return _0xa4a24f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x64c3('0x0'));var jsonpatch=require(_0x64c3('0x1'));var rp=require(_0x64c3('0x2'));var moment=require(_0x64c3('0x3'));var BPromise=require(_0x64c3('0x4'));var Mustache=require('mustache');var util=require(_0x64c3('0x5'));var path=require(_0x64c3('0x6'));var sox=require(_0x64c3('0x7'));var csv=require(_0x64c3('0x8'));var ejs=require(_0x64c3('0x9'));var fs=require('fs');var fs_extra=require(_0x64c3('0xa'));var _=require(_0x64c3('0xb'));var squel=require(_0x64c3('0xc'));var crypto=require(_0x64c3('0xd'));var jsforce=require(_0x64c3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x64c3('0xf'));var Redis=require(_0x64c3('0x10'));var authService=require(_0x64c3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x64c3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x64c3('0x13'));var utils=require(_0x64c3('0x14'));var config=require(_0x64c3('0x15'));var licenseUtil=require(_0x64c3('0x16'));var db=require(_0x64c3('0x17'))['db'];var integrations=require(_0x64c3('0x18'));function respondWithStatusCode(_0x281104,_0x1b3e9b){_0x1b3e9b=_0x1b3e9b||0xcc;return function(_0x9fa38c){if(_0x9fa38c){return _0x281104[_0x64c3('0x19')](_0x1b3e9b);}return _0x281104[_0x64c3('0x1a')](_0x1b3e9b)[_0x64c3('0x1b')]();};}function respondWithResult(_0x9a4b1d,_0x3affed){_0x3affed=_0x3affed||0xc8;return function(_0x54b745){if(_0x54b745){return _0x9a4b1d[_0x64c3('0x1a')](_0x3affed)[_0x64c3('0x1c')](_0x54b745);}};}function respondWithFilteredResult(_0x46b89d,_0x730c2b){return function(_0x36a43f){if(_0x36a43f){var _0x1fb8a1=typeof _0x730c2b[_0x64c3('0x1d')]===_0x64c3('0x1e')&&typeof _0x730c2b['limit']==='undefined';var _0x480fc0=_0x36a43f[_0x64c3('0x1f')];var _0x385142=_0x1fb8a1?0x0:_0x730c2b[_0x64c3('0x1d')];var _0x2b4ccf=_0x1fb8a1?_0x36a43f[_0x64c3('0x1f')]:_0x730c2b['offset']+_0x730c2b[_0x64c3('0x20')];var _0x1c2b08;if(_0x2b4ccf>=_0x480fc0){_0x2b4ccf=_0x480fc0;_0x1c2b08=0xc8;}else{_0x1c2b08=0xce;}_0x46b89d['status'](_0x1c2b08);return _0x46b89d[_0x64c3('0x21')](_0x64c3('0x22'),_0x385142+'-'+_0x2b4ccf+'/'+_0x480fc0)[_0x64c3('0x1c')](_0x36a43f);}return null;};}function patchUpdates(_0x12b396){return function(_0x4d69a7){try{jsonpatch[_0x64c3('0x23')](_0x4d69a7,_0x12b396,!![]);}catch(_0x27a940){return BPromise['reject'](_0x27a940);}return _0x4d69a7[_0x64c3('0x24')]();};}function saveUpdates(_0x2deee3,_0x5f1f20){return function(_0x2fb8c2){if(_0x2fb8c2){return _0x2fb8c2['update'](_0x2deee3)[_0x64c3('0x25')](function(_0x245dc9){return _0x245dc9;});}return null;};}function removeEntity(_0x2a13b0,_0x43fae7){return function(_0x171cb2){if(_0x171cb2){return _0x171cb2[_0x64c3('0x26')]()[_0x64c3('0x25')](function(){_0x2a13b0['status'](0xcc)[_0x64c3('0x1b')]();});}};}function handleEntityNotFound(_0x5bd3ec,_0x46ee52){return function(_0x45d769){if(!_0x45d769){_0x5bd3ec[_0x64c3('0x19')](0x194);}return _0x45d769;};}function handleError(_0x122eb5,_0x58e795){_0x58e795=_0x58e795||0x1f4;return function(_0x3ef0ab){logger['error'](_0x3ef0ab[_0x64c3('0x27')]);if(_0x3ef0ab[_0x64c3('0x28')]){delete _0x3ef0ab[_0x64c3('0x28')];}_0x122eb5['status'](_0x58e795)[_0x64c3('0x29')](_0x3ef0ab);};}exports[_0x64c3('0x2a')]=function(_0x4d9fb4,_0x540156){var _0x29641b={},_0x53f8c8={},_0x203e66={'count':0x0,'rows':[]};var _0x5d4a0b=_[_0x64c3('0x2b')](db['ServicenowAccount'][_0x64c3('0x2c')],function(_0x28833e){return{'name':_0x28833e[_0x64c3('0x2d')],'type':_0x28833e[_0x64c3('0x2e')][_0x64c3('0x2f')]};});_0x53f8c8[_0x64c3('0x30')]=_[_0x64c3('0x2b')](_0x5d4a0b,_0x64c3('0x28'));_0x53f8c8['query']=_['keys'](_0x4d9fb4['query']);_0x53f8c8[_0x64c3('0x31')]=_[_0x64c3('0x32')](_0x53f8c8[_0x64c3('0x30')],_0x53f8c8['query']);_0x29641b[_0x64c3('0x33')]=_['intersection'](_0x53f8c8['model'],qs[_0x64c3('0x34')](_0x4d9fb4[_0x64c3('0x35')][_0x64c3('0x34')]));_0x29641b[_0x64c3('0x33')]=_0x29641b[_0x64c3('0x33')][_0x64c3('0x36')]?_0x29641b['attributes']:_0x53f8c8[_0x64c3('0x30')];if(!_0x4d9fb4[_0x64c3('0x35')][_0x64c3('0x37')]('nolimit')){_0x29641b[_0x64c3('0x20')]=qs[_0x64c3('0x20')](_0x4d9fb4[_0x64c3('0x35')][_0x64c3('0x20')]);_0x29641b[_0x64c3('0x1d')]=qs[_0x64c3('0x1d')](_0x4d9fb4[_0x64c3('0x35')]['offset']);}_0x29641b[_0x64c3('0x38')]=qs[_0x64c3('0x39')](_0x4d9fb4[_0x64c3('0x35')]['sort']);_0x29641b[_0x64c3('0x3a')]=qs['filters'](_['pick'](_0x4d9fb4['query'],_0x53f8c8[_0x64c3('0x31')]),_0x5d4a0b);if(_0x4d9fb4['query'][_0x64c3('0x3b')]){_0x29641b['where']=_[_0x64c3('0x3c')](_0x29641b[_0x64c3('0x3a')],{'$or':_['map'](_0x5d4a0b,function(_0xa18f46){if(_0xa18f46[_0x64c3('0x2e')]!==_0x64c3('0x3d')){var _0xf6f6ef={};_0xf6f6ef[_0xa18f46[_0x64c3('0x28')]]={'$like':'%'+_0x4d9fb4['query'][_0x64c3('0x3b')]+'%'};return _0xf6f6ef;}})});}_0x29641b=_[_0x64c3('0x3c')]({},_0x29641b,_0x4d9fb4[_0x64c3('0x3e')]);var _0x1ad65c={'where':_0x29641b[_0x64c3('0x3a')]};return db[_0x64c3('0x3f')][_0x64c3('0x1f')](_0x1ad65c)[_0x64c3('0x25')](function(_0x10a70c){_0x203e66[_0x64c3('0x1f')]=_0x10a70c;if(_0x4d9fb4[_0x64c3('0x35')]['includeAll']){_0x29641b[_0x64c3('0x40')]=[{'all':!![]}];}return db[_0x64c3('0x3f')][_0x64c3('0x41')](_0x29641b);})[_0x64c3('0x25')](function(_0x231410){_0x203e66[_0x64c3('0x42')]=_0x231410;return _0x203e66;})['then'](respondWithFilteredResult(_0x540156,_0x29641b))[_0x64c3('0x43')](handleError(_0x540156,null));};exports[_0x64c3('0x44')]=function(_0x937966,_0x5fdd6c){var _0x5e2e1f={'raw':![],'where':{'id':_0x937966[_0x64c3('0x45')]['id']}},_0x4153bb={};_0x4153bb[_0x64c3('0x30')]=_[_0x64c3('0x46')](db[_0x64c3('0x3f')]['rawAttributes']);_0x4153bb[_0x64c3('0x35')]=_[_0x64c3('0x46')](_0x937966[_0x64c3('0x35')]);_0x4153bb[_0x64c3('0x31')]=_[_0x64c3('0x32')](_0x4153bb[_0x64c3('0x30')],_0x4153bb[_0x64c3('0x35')]);_0x5e2e1f[_0x64c3('0x33')]=_['intersection'](_0x4153bb[_0x64c3('0x30')],qs['fields'](_0x937966['query'][_0x64c3('0x34')]));_0x5e2e1f['attributes']=_0x5e2e1f['attributes']['length']?_0x5e2e1f[_0x64c3('0x33')]:_0x4153bb[_0x64c3('0x30')];if(_0x937966['query']['includeAll']){_0x5e2e1f[_0x64c3('0x40')]=[{'all':!![]}];}_0x5e2e1f=_[_0x64c3('0x3c')]({},_0x5e2e1f,_0x937966[_0x64c3('0x3e')]);return db[_0x64c3('0x3f')][_0x64c3('0x47')](_0x5e2e1f)[_0x64c3('0x25')](handleEntityNotFound(_0x5fdd6c,null))['then'](respondWithResult(_0x5fdd6c,null))[_0x64c3('0x43')](handleError(_0x5fdd6c,null));};exports['create']=function(_0x5a204e,_0x391dc3){return db[_0x64c3('0x3f')][_0x64c3('0x48')](_0x5a204e[_0x64c3('0x49')],{})[_0x64c3('0x25')](respondWithResult(_0x391dc3,0xc9))[_0x64c3('0x43')](handleError(_0x391dc3,null));};exports[_0x64c3('0x4a')]=function(_0x3a9ef8,_0x249612){if(_0x3a9ef8[_0x64c3('0x49')]['id']){delete _0x3a9ef8['body']['id'];}return db[_0x64c3('0x3f')][_0x64c3('0x47')]({'where':{'id':_0x3a9ef8[_0x64c3('0x45')]['id']}})[_0x64c3('0x25')](handleEntityNotFound(_0x249612,null))[_0x64c3('0x25')](saveUpdates(_0x3a9ef8[_0x64c3('0x49')],null))[_0x64c3('0x25')](respondWithResult(_0x249612,null))[_0x64c3('0x43')](handleError(_0x249612,null));};exports[_0x64c3('0x26')]=function(_0x42a35b,_0x584b4f){return db[_0x64c3('0x3f')][_0x64c3('0x47')]({'where':{'id':_0x42a35b['params']['id']}})[_0x64c3('0x25')](handleEntityNotFound(_0x584b4f,null))[_0x64c3('0x25')](removeEntity(_0x584b4f,null))[_0x64c3('0x43')](handleError(_0x584b4f,null));};exports[_0x64c3('0x4b')]=function(_0x7ad0fd,_0x2bf0e8,_0x5d39cd){var _0xd1989d={};var _0x32521d={};var _0x194287;var _0x3e97db;return db[_0x64c3('0x3f')][_0x64c3('0x4c')]({'where':{'id':_0x7ad0fd[_0x64c3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bf0e8,null))[_0x64c3('0x25')](function(_0x48b513){if(_0x48b513){_0x194287=_0x48b513;_0x32521d[_0x64c3('0x30')]=_[_0x64c3('0x46')](db[_0x64c3('0x4d')][_0x64c3('0x2c')]);_0x32521d[_0x64c3('0x35')]=_[_0x64c3('0x46')](_0x7ad0fd[_0x64c3('0x35')]);_0x32521d[_0x64c3('0x31')]=_[_0x64c3('0x32')](_0x32521d['model'],_0x32521d[_0x64c3('0x35')]);_0xd1989d[_0x64c3('0x33')]=_['intersection'](_0x32521d[_0x64c3('0x30')],qs[_0x64c3('0x34')](_0x7ad0fd[_0x64c3('0x35')][_0x64c3('0x34')]));_0xd1989d['attributes']=_0xd1989d[_0x64c3('0x33')][_0x64c3('0x36')]?_0xd1989d[_0x64c3('0x33')]:_0x32521d[_0x64c3('0x30')];_0xd1989d[_0x64c3('0x38')]=qs['sort'](_0x7ad0fd[_0x64c3('0x35')][_0x64c3('0x39')]);_0xd1989d[_0x64c3('0x3a')]=qs[_0x64c3('0x31')](_['pick'](_0x7ad0fd[_0x64c3('0x35')],_0x32521d[_0x64c3('0x31')]));if(_0x7ad0fd['query'][_0x64c3('0x3b')]){_0xd1989d['where']=_[_0x64c3('0x3c')](_0xd1989d['where'],{'$or':_[_0x64c3('0x2b')](_0xd1989d['attributes'],function(_0x5314e0){var _0x387cbe={};_0x387cbe[_0x5314e0]={'$like':'%'+_0x7ad0fd['query'][_0x64c3('0x3b')]+'%'};return _0x387cbe;})});}_0xd1989d=_['merge']({},_0xd1989d,_0x7ad0fd[_0x64c3('0x3e')]);return _0x194287[_0x64c3('0x4b')](_0xd1989d);}})['then'](function(_0x482b6e){if(_0x482b6e){_0x3e97db=_0x482b6e[_0x64c3('0x36')];if(!_0x7ad0fd[_0x64c3('0x35')][_0x64c3('0x37')](_0x64c3('0x4e'))){_0xd1989d[_0x64c3('0x20')]=qs[_0x64c3('0x20')](_0x7ad0fd['query']['limit']);_0xd1989d[_0x64c3('0x1d')]=qs[_0x64c3('0x1d')](_0x7ad0fd[_0x64c3('0x35')][_0x64c3('0x1d')]);}return _0x194287[_0x64c3('0x4b')](_0xd1989d);}})[_0x64c3('0x25')](function(_0x48a894){if(_0x48a894){return _0x48a894?{'count':_0x3e97db,'rows':_0x48a894}:null;}})[_0x64c3('0x25')](respondWithResult(_0x2bf0e8,null))[_0x64c3('0x43')](handleError(_0x2bf0e8,null));};exports[_0x64c3('0x4f')]=function(_0x485d0f,_0x1b3ccd,_0xbac823){if(_0x485d0f[_0x64c3('0x49')]['id']){delete _0x485d0f[_0x64c3('0x49')]['id'];}return db[_0x64c3('0x3f')][_0x64c3('0x4c')]({'where':{'id':_0x485d0f[_0x64c3('0x45')]['id']}})[_0x64c3('0x25')](handleEntityNotFound(_0x1b3ccd,null))['then'](function(_0x47b984){if(_0x47b984){_0x485d0f['body'][_0x64c3('0x50')]=_0x47b984['id'];_0x485d0f[_0x64c3('0x49')][_0x64c3('0x51')]=integrations[_0x64c3('0x52')](_0x485d0f[_0x64c3('0x49')][_0x64c3('0x53')],_0x485d0f[_0x64c3('0x49')]['type']);_0x485d0f['body'][_0x64c3('0x54')]=integrations[_0x64c3('0x55')](_0x485d0f[_0x64c3('0x49')][_0x64c3('0x53')],_0x485d0f[_0x64c3('0x49')][_0x64c3('0x2e')]);return db['ServicenowConfiguration'][_0x64c3('0x48')](_0x485d0f[_0x64c3('0x49')],{'include':[{'model':db[_0x64c3('0x56')],'as':'Subjects'},{'model':db[_0x64c3('0x56')],'as':'Descriptions'}]});}return null;})[_0x64c3('0x25')](respondWithResult(_0x1b3ccd,null))[_0x64c3('0x43')](handleError(_0x1b3ccd,null));};exports['getFields']=function(_0x179516,_0x754d99,_0x547394){var _0x32c30e=[_0x64c3('0x57'),_0x64c3('0x58'),'knowledge',_0x64c3('0x59'),_0x64c3('0x5a'),'notify','incident_state',_0x64c3('0x5b'),_0x64c3('0x5c')];var _0x5e1ef0=[_0x64c3('0x5d'),_0x64c3('0x57'),'caused_by','watch_list','upon_reject',_0x64c3('0x5e'),_0x64c3('0x5f'),_0x64c3('0x58'),_0x64c3('0x60'),_0x64c3('0x61'),_0x64c3('0x62'),'sys_updated_by',_0x64c3('0x63'),_0x64c3('0x64'),'sys_created_on','sys_domain',_0x64c3('0x65'),_0x64c3('0x66'),'knowledge',_0x64c3('0x38'),_0x64c3('0x67'),'closed_at',_0x64c3('0x68'),_0x64c3('0x69'),'impact',_0x64c3('0x6a'),_0x64c3('0x6b'),_0x64c3('0x6c'),'priority',_0x64c3('0x6d'),_0x64c3('0x6e'),_0x64c3('0x6f'),_0x64c3('0x70'),'opened_at',_0x64c3('0x71'),_0x64c3('0x72'),_0x64c3('0x73'),_0x64c3('0x74'),_0x64c3('0x75'),_0x64c3('0x76'),_0x64c3('0x77'),_0x64c3('0x59'),_0x64c3('0x78'),'short_description',_0x64c3('0x5a'),_0x64c3('0x79'),_0x64c3('0x7a'),_0x64c3('0x7b'),_0x64c3('0x7c'),_0x64c3('0x7d'),_0x64c3('0x7e'),'description','calendar_duration',_0x64c3('0x7f'),_0x64c3('0x80'),_0x64c3('0x81'),_0x64c3('0x82'),_0x64c3('0x83'),_0x64c3('0x84'),'sys_id',_0x64c3('0x85'),_0x64c3('0x86'),_0x64c3('0x87'),'urgency','problem_id','company',_0x64c3('0x88'),_0x64c3('0x89'),_0x64c3('0x8a'),'severity',_0x64c3('0x8b'),_0x64c3('0x8c'),_0x64c3('0x8d'),'comments_and_work_notes',_0x64c3('0x8e'),'sys_mod_count',_0x64c3('0x8f'),_0x64c3('0x90'),_0x64c3('0x91'),_0x64c3('0x92'),_0x64c3('0x93'),_0x64c3('0x94'),_0x64c3('0x5c')];var _0x38d599='';var _0x430c1f='';var _0x5e5107=[];var _0x4698f0='';var _0x5821c8='';var _0x3eec41=[];var _0x155176='';var _0x452007='';var _0x8068c9={};var _0x18c84e='';return db[_0x64c3('0x3f')]['findOne']({'where':{'id':_0x179516['params']['id']},'attributes':['id',_0x64c3('0x95'),'password','email',_0x64c3('0x96'),_0x64c3('0x97')]})[_0x64c3('0x25')](handleEntityNotFound(_0x754d99,null))[_0x64c3('0x25')](function(_0x4ecb89){if(_0x4ecb89){_0x18c84e=_0x4ecb89[_0x64c3('0x96')];var _0x12b0b1=_0x18c84e['slice'](-0x1);if(_0x12b0b1==='/'){_0x18c84e=_0x18c84e[_0x64c3('0x98')](0x0,_0x18c84e[_0x64c3('0x99')](_0x12b0b1));}_0x452007=util['format'](_0x64c3('0x9a'),_0x18c84e);_0x155176=util[_0x64c3('0x9b')](_0x64c3('0x9c'),_0x18c84e);_0x8068c9={'user':_0x4ecb89['username'],'pass':_0x4ecb89[_0x64c3('0x9d')]};var _0x47aa77={'method':_0x64c3('0x9e'),'uri':_0x452007+_0x64c3('0x9f'),'auth':_0x8068c9,'json':!![]};return rp(_0x47aa77);}})[_0x64c3('0x25')](function(_0x34ace5){if(_0x34ace5['result'][_0x64c3('0x36')]>0x0){_0x38d599=_0x34ace5[_0x64c3('0xa0')];}console[_0x64c3('0xa1')]('incident\x20table\x20objects',_0x38d599);_0x3eec41=[];_0x430c1f=Object[_0x64c3('0xa2')]([],_0x38d599);_[_0x64c3('0xa3')](_0x430c1f,function(_0x2a3824){return!_0x32c30e[_0x64c3('0xa4')](_0x2a3824[_0x64c3('0x28')]);});_0x430c1f[_0x64c3('0xa5')](function(_0xb90aca){var _0x5ecd86=createFieldObject(_0x155176,_0x8068c9,_0xb90aca[_0x64c3('0xa6')],_0xb90aca['name'],_0xb90aca[_0x64c3('0xa7')],![]);_0x3eec41[_0x64c3('0xa8')](_0x5ecd86);});return Promise['all'](_0x3eec41);})[_0x64c3('0x25')](function(_0x40f7dd){_0x5e5107=_0x40f7dd;_0x4698f0=Object['assign']([],_0x38d599);console['log'](_0x64c3('0xa9'),_0x38d599);_[_0x64c3('0xa3')](_0x4698f0,function(_0x344d0c){return _0x5e1ef0[_0x64c3('0xa4')](_0x344d0c[_0x64c3('0x28')]);});console[_0x64c3('0xa1')](_0x64c3('0xaa'),_0x4698f0);_0x3eec41=[];_0x4698f0[_0x64c3('0xa5')](function(_0x5a998b){var _0xa9b098=createFieldObject(_0x155176,_0x8068c9,_0x5a998b['internalType'],_0x5a998b[_0x64c3('0x28')],_0x5a998b[_0x64c3('0xa7')],!![]);_0x3eec41[_0x64c3('0xa8')](_0xa9b098);});return Promise['all'](_0x3eec41);})[_0x64c3('0x25')](function(_0x5299a1){_0x5821c8=_0x5299a1;var _0x454b93=_0x5e5107[_0x64c3('0xab')](_0x5821c8);return{'count':_0x454b93[_0x64c3('0x36')],'rows':_0x454b93};})[_0x64c3('0x25')](respondWithResult(_0x754d99,null))['catch'](function(_0x503c29){console['log'](_0x64c3('0xac')+_0x503c29);var _0x5b4911=_0x179516[_0x64c3('0x35')][_0x64c3('0xad')]?0x1f4:_0x503c29[_0x64c3('0xae')]||0x1f4;logger[_0x64c3('0xaf')](_0x503c29[_0x64c3('0x27')]);delete _0x503c29['name'];if(_0x5b4911===0x191){_0x5b4911=0x190;}_0x754d99[_0x64c3('0x1a')](_0x5b4911)['send'](_0x179516[_0x64c3('0x35')]['test']?{'message':_0x64c3('0xb0'),'statusCode':_0x503c29[_0x64c3('0xae')]}:_0x503c29);});};function createFieldObject(_0x2ab896,_0x5bf4ea,_0x2496e2,_0x1f6a3b,_0x199250,_0x15ae62){return new Promise(function(_0x1cf996,_0x42dd7f){var _0xb1934d={'id':_0x1f6a3b,'name':_0x199250,'custom':_0x15ae62};if(_0x2496e2==='boolean'){_0xb1934d[_0x64c3('0x3e')]=[{'name':'True','value':'true'},{'name':_0x64c3('0xb1'),'value':_0x64c3('0xb2')}];_0x1cf996(_0xb1934d);}else{var _0x16742a={'method':'GET','uri':_0x2ab896+_0x64c3('0xb3')+_0x1f6a3b,'auth':_0x5bf4ea,'json':!![]};return rp(_0x16742a)['then'](function(_0x47ebb8){var _0x3d5614=[];if(_0x47ebb8[_0x64c3('0xa0')]['length']>0x0){_0x47ebb8[_0x64c3('0xa0')][_0x64c3('0xa5')](function(_0x2b1d4c){if(_0x2b1d4c[_0x64c3('0xb4')]===_0x64c3('0xb2')){var _0x85211e={'name':_0x2b1d4c[_0x64c3('0xa7')],'value':_0x2b1d4c[_0x64c3('0xb5')]};_0x3d5614[_0x64c3('0xa8')](_0x85211e);}});}_0xb1934d[_0x64c3('0x3e')]=_0x3d5614;if(_0xb1934d[_0x64c3('0x3e')]['length']>0x0){_0x1cf996(_0xb1934d);}else{if(_0x15ae62==![]){_0x1cf996();}else{_0x1cf996(_0xb1934d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7eb18e8..cd569bf 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xf494,0x1c6));var _0x4f49=function(_0x5b55c7,_0x15d300){_0x5b55c7=_0x5b55c7-0x0;var _0x4a0dc4=_0xf494[_0x5b55c7];return _0x4a0dc4;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));var integrations=require(_0x4f49('0xa'));module[_0x4f49('0xb')]=function(_0x413530,_0x42b0e8){return _0x413530['define']('ServicenowAccount',attributes,{'tableName':_0x4f49('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x2039c3,_0x2e21dc){var _0x971850=function(_0x27705c){while(--_0x27705c){_0x2039c3['push'](_0x2039c3['shift']());}};_0x971850(++_0x2e21dc);}(_0x2675,0x75));var _0x5267=function(_0x17edaf,_0x4c2bbb){_0x17edaf=_0x17edaf-0x0;var _0x1d97d2=_0x2675[_0x17edaf];return _0x1d97d2;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('0x9'),'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 8649e82..6944561 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 _0xba87=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','ServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xba87,0xb8));var _0x7ba8=function(_0x11ee99,_0xa743ed){_0x11ee99=_0x11ee99-0x0;var _0x469072=_0xba87[_0x11ee99];return _0x469072;};'use strict';var _=require(_0x7ba8('0x0'));var util=require(_0x7ba8('0x1'));var moment=require(_0x7ba8('0x2'));var BPromise=require(_0x7ba8('0x3'));var rs=require(_0x7ba8('0x4'));var fs=require('fs');var Redis=require(_0x7ba8('0x5'));var db=require(_0x7ba8('0x6'))['db'];var utils=require(_0x7ba8('0x7'));var logger=require(_0x7ba8('0x8'))(_0x7ba8('0x9'));var config=require(_0x7ba8('0xa'));var jayson=require(_0x7ba8('0xb'));var client=jayson[_0x7ba8('0xc')][_0x7ba8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x593213,_0x2cf99d,_0x45daf9){return new BPromise(function(_0x5b244c,_0x234c44){return client['request'](_0x593213,_0x45daf9)[_0x7ba8('0xe')](function(_0x1eb9ee){logger[_0x7ba8('0xf')](_0x7ba8('0x10'),_0x2cf99d,_0x7ba8('0x11'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2cf99d,_0x7ba8('0x11'),JSON[_0x7ba8('0x12')](_0x1eb9ee));if(_0x1eb9ee['error']){if(_0x1eb9ee[_0x7ba8('0x13')][_0x7ba8('0x14')]===0x1f4){logger['error'](_0x7ba8('0x10'),_0x2cf99d,_0x1eb9ee[_0x7ba8('0x13')][_0x7ba8('0x15')]);return _0x234c44(_0x1eb9ee[_0x7ba8('0x13')][_0x7ba8('0x15')]);}logger[_0x7ba8('0x13')](_0x7ba8('0x10'),_0x2cf99d,_0x1eb9ee[_0x7ba8('0x13')][_0x7ba8('0x15')]);return _0x5b244c(_0x1eb9ee['error'][_0x7ba8('0x15')]);}else{logger[_0x7ba8('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x2cf99d,_0x7ba8('0x11'));_0x5b244c(_0x1eb9ee[_0x7ba8('0x16')][_0x7ba8('0x15')]);}})[_0x7ba8('0x17')](function(_0x401b05){logger[_0x7ba8('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2cf99d,_0x401b05);_0x234c44(_0x401b05);});});}exports[_0x7ba8('0x18')]=function(_0x6058c5){var _0x1f9ac2=this;return new Promise(function(_0x50b56f,_0x43a87b){return db['ServicenowAccount'][_0x7ba8('0x19')]({'raw':_0x6058c5['options']?_0x6058c5[_0x7ba8('0x1a')][_0x7ba8('0x1b')]===undefined?!![]:![]:!![],'where':_0x6058c5['options']?_0x6058c5[_0x7ba8('0x1a')][_0x7ba8('0x1c')]||null:null,'attributes':_0x6058c5[_0x7ba8('0x1a')]?_0x6058c5[_0x7ba8('0x1a')][_0x7ba8('0x1d')]||null:null,'limit':_0x6058c5[_0x7ba8('0x1a')]?_0x6058c5['options'][_0x7ba8('0x1e')]||null:null,'include':_0x6058c5[_0x7ba8('0x1a')]?_0x6058c5[_0x7ba8('0x1a')][_0x7ba8('0x1f')]?_['map'](_0x6058c5[_0x7ba8('0x1a')][_0x7ba8('0x1f')],function(_0x934826){return{'model':db[_0x934826[_0x7ba8('0x20')]],'as':_0x934826['as'],'attributes':_0x934826['attributes'],'include':_0x934826['include']?_['map'](_0x934826['include'],function(_0x326ede){return{'model':db[_0x326ede[_0x7ba8('0x20')]],'as':_0x326ede['as'],'attributes':_0x326ede['attributes'],'include':_0x326ede[_0x7ba8('0x1f')]?_[_0x7ba8('0x21')](_0x326ede[_0x7ba8('0x1f')],function(_0x466202){return{'model':db[_0x466202[_0x7ba8('0x20')]],'as':_0x466202['as'],'attributes':_0x466202[_0x7ba8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7ba8('0xe')](function(_0x1cce96){logger['info'](_0x7ba8('0x18'),_0x6058c5);logger[_0x7ba8('0x22')](_0x7ba8('0x18'),_0x6058c5,JSON[_0x7ba8('0x12')](_0x1cce96));_0x50b56f(_0x1cce96);})[_0x7ba8('0x17')](function(_0x28e283){logger[_0x7ba8('0x13')]('GetServicenowAccount',_0x28e283[_0x7ba8('0x15')],_0x6058c5);_0x43a87b(_0x1f9ac2[_0x7ba8('0x13')](0x1f4,_0x28e283[_0x7ba8('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x273aa5){var _0x194960=this;return new Promise(function(_0x1d8dcf,_0x222bd8){return db[_0x7ba8('0x23')][_0x7ba8('0x24')]({'raw':_0x273aa5[_0x7ba8('0x1a')]?_0x273aa5[_0x7ba8('0x1a')][_0x7ba8('0x1b')]===undefined?!![]:![]:!![],'where':_0x273aa5[_0x7ba8('0x1a')]?_0x273aa5[_0x7ba8('0x1a')][_0x7ba8('0x1c')]||null:null,'attributes':_0x273aa5[_0x7ba8('0x1a')]?_0x273aa5['options'][_0x7ba8('0x1d')]||null:null,'include':_0x273aa5[_0x7ba8('0x1a')]?_0x273aa5['options'][_0x7ba8('0x1f')]?_[_0x7ba8('0x21')](_0x273aa5[_0x7ba8('0x1a')][_0x7ba8('0x1f')],function(_0x5e12b1){return{'model':db[_0x5e12b1[_0x7ba8('0x20')]],'as':_0x5e12b1['as'],'attributes':_0x5e12b1[_0x7ba8('0x1d')],'include':_0x5e12b1[_0x7ba8('0x1f')]?_[_0x7ba8('0x21')](_0x5e12b1['include'],function(_0x4beccd){return{'model':db[_0x4beccd[_0x7ba8('0x20')]],'as':_0x4beccd['as'],'attributes':_0x4beccd[_0x7ba8('0x1d')],'include':_0x4beccd[_0x7ba8('0x1f')]?_[_0x7ba8('0x21')](_0x4beccd['include'],function(_0xe0fc0e){return{'model':db[_0xe0fc0e[_0x7ba8('0x20')]],'as':_0xe0fc0e['as'],'attributes':_0xe0fc0e[_0x7ba8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7ba8('0xe')](function(_0x4a4071){logger[_0x7ba8('0xf')](_0x7ba8('0x25'),_0x273aa5);logger[_0x7ba8('0x22')](_0x7ba8('0x25'),_0x273aa5,JSON[_0x7ba8('0x12')](_0x4a4071));_0x1d8dcf(_0x4a4071);})['catch'](function(_0x109290){logger[_0x7ba8('0x13')](_0x7ba8('0x25'),_0x109290['message'],_0x273aa5);_0x222bd8(_0x194960[_0x7ba8('0x13')](0x1f4,_0x109290[_0x7ba8('0x15')]));});});}; \ No newline at end of file +var _0xc5d3=['then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','options','where','attributes','include','model','map','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3d8291,_0x560e85){var _0x2bad5c=function(_0x16d94d){while(--_0x16d94d){_0x3d8291['push'](_0x3d8291['shift']());}};_0x2bad5c(++_0x560e85);}(_0xc5d3,0x79));var _0x3c5d=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xc5d3[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x3c5d('0x0'));var util=require(_0x3c5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3c5d('0x2'));var fs=require('fs');var Redis=require(_0x3c5d('0x3'));var db=require(_0x3c5d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c5d('0x5'))(_0x3c5d('0x6'));var config=require(_0x3c5d('0x7'));var jayson=require(_0x3c5d('0x8'));var client=jayson[_0x3c5d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c32a1,_0x3e2a15,_0x1f8a29){return new BPromise(function(_0x21f019,_0x17187a){return client[_0x3c5d('0xa')](_0x3c32a1,_0x1f8a29)[_0x3c5d('0xb')](function(_0x5c09cd){logger[_0x3c5d('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x3e2a15,_0x3c5d('0xd'));logger[_0x3c5d('0xe')](_0x3c5d('0xf'),_0x3e2a15,_0x3c5d('0xd'),JSON[_0x3c5d('0x10')](_0x5c09cd));if(_0x5c09cd[_0x3c5d('0x11')]){if(_0x5c09cd[_0x3c5d('0x11')][_0x3c5d('0x12')]===0x1f4){logger[_0x3c5d('0x11')](_0x3c5d('0x13'),_0x3e2a15,_0x5c09cd[_0x3c5d('0x11')][_0x3c5d('0x14')]);return _0x17187a(_0x5c09cd[_0x3c5d('0x11')][_0x3c5d('0x14')]);}logger['error'](_0x3c5d('0x13'),_0x3e2a15,_0x5c09cd[_0x3c5d('0x11')]['message']);return _0x21f019(_0x5c09cd[_0x3c5d('0x11')][_0x3c5d('0x14')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3e2a15,_0x3c5d('0xd'));_0x21f019(_0x5c09cd['result']['message']);}})[_0x3c5d('0x15')](function(_0x1bcae2){logger[_0x3c5d('0x11')](_0x3c5d('0x13'),_0x3e2a15,_0x1bcae2);_0x17187a(_0x1bcae2);});});}exports['GetServicenowAccount']=function(_0x49d6a0){var _0x2b4fe3=this;return new Promise(function(_0x56b0f3,_0x11880a){return db['ServicenowAccount']['findAll']({'raw':_0x49d6a0[_0x3c5d('0x16')]?_0x49d6a0[_0x3c5d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x49d6a0[_0x3c5d('0x16')]?_0x49d6a0[_0x3c5d('0x16')][_0x3c5d('0x17')]||null:null,'attributes':_0x49d6a0[_0x3c5d('0x16')]?_0x49d6a0[_0x3c5d('0x16')][_0x3c5d('0x18')]||null:null,'limit':_0x49d6a0['options']?_0x49d6a0[_0x3c5d('0x16')]['limit']||null:null,'include':_0x49d6a0[_0x3c5d('0x16')]?_0x49d6a0[_0x3c5d('0x16')]['include']?_['map'](_0x49d6a0[_0x3c5d('0x16')]['include'],function(_0x4ed218){return{'model':db[_0x4ed218['model']],'as':_0x4ed218['as'],'attributes':_0x4ed218[_0x3c5d('0x18')],'include':_0x4ed218[_0x3c5d('0x19')]?_['map'](_0x4ed218[_0x3c5d('0x19')],function(_0x2f88f5){return{'model':db[_0x2f88f5[_0x3c5d('0x1a')]],'as':_0x2f88f5['as'],'attributes':_0x2f88f5[_0x3c5d('0x18')],'include':_0x2f88f5['include']?_[_0x3c5d('0x1b')](_0x2f88f5[_0x3c5d('0x19')],function(_0x2d9792){return{'model':db[_0x2d9792['model']],'as':_0x2d9792['as'],'attributes':_0x2d9792[_0x3c5d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x292fc8){logger[_0x3c5d('0xc')]('GetServicenowAccount',_0x49d6a0);logger[_0x3c5d('0xe')](_0x3c5d('0x1c'),_0x49d6a0,JSON[_0x3c5d('0x10')](_0x292fc8));_0x56b0f3(_0x292fc8);})[_0x3c5d('0x15')](function(_0x4c34fc){logger['error']('GetServicenowAccount',_0x4c34fc['message'],_0x49d6a0);_0x11880a(_0x2b4fe3[_0x3c5d('0x11')](0x1f4,_0x4c34fc[_0x3c5d('0x14')]));});});};exports[_0x3c5d('0x1d')]=function(_0x4d3137){var _0x58bd70=this;return new Promise(function(_0x26dc2d,_0x5e1142){return db[_0x3c5d('0x1e')][_0x3c5d('0x1f')]({'raw':_0x4d3137[_0x3c5d('0x16')]?_0x4d3137['options'][_0x3c5d('0x20')]===undefined?!![]:![]:!![],'where':_0x4d3137[_0x3c5d('0x16')]?_0x4d3137[_0x3c5d('0x16')][_0x3c5d('0x17')]||null:null,'attributes':_0x4d3137[_0x3c5d('0x16')]?_0x4d3137[_0x3c5d('0x16')][_0x3c5d('0x18')]||null:null,'include':_0x4d3137[_0x3c5d('0x16')]?_0x4d3137[_0x3c5d('0x16')][_0x3c5d('0x19')]?_[_0x3c5d('0x1b')](_0x4d3137[_0x3c5d('0x16')][_0x3c5d('0x19')],function(_0x2c59a8){return{'model':db[_0x2c59a8['model']],'as':_0x2c59a8['as'],'attributes':_0x2c59a8['attributes'],'include':_0x2c59a8['include']?_[_0x3c5d('0x1b')](_0x2c59a8[_0x3c5d('0x19')],function(_0x4ebcfd){return{'model':db[_0x4ebcfd[_0x3c5d('0x1a')]],'as':_0x4ebcfd['as'],'attributes':_0x4ebcfd[_0x3c5d('0x18')],'include':_0x4ebcfd[_0x3c5d('0x19')]?_[_0x3c5d('0x1b')](_0x4ebcfd[_0x3c5d('0x19')],function(_0x284cef){return{'model':db[_0x284cef['model']],'as':_0x284cef['as'],'attributes':_0x284cef[_0x3c5d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3c5d('0xb')](function(_0x26f91d){logger['info']('ShowServicenowAccount',_0x4d3137);logger['debug'](_0x3c5d('0x1d'),_0x4d3137,JSON[_0x3c5d('0x10')](_0x26f91d));_0x26dc2d(_0x26f91d);})[_0x3c5d('0x15')](function(_0x2b6941){logger['error']('ShowServicenowAccount',_0x2b6941[_0x3c5d('0x14')],_0x4d3137);_0x5e1142(_0x58bd70['error'](0x1f4,_0x2b6941[_0x3c5d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 136a01f..16cfe27 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 _0x221c=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x2913e3,_0x131dd3){var _0x17b57a=function(_0x4af8e2){while(--_0x4af8e2){_0x2913e3['push'](_0x2913e3['shift']());}};_0x17b57a(++_0x131dd3);}(_0x221c,0x1cc));var _0xc221=function(_0x3a2e5a,_0x56e6e8){_0x3a2e5a=_0x3a2e5a-0x0;var _0x16153e=_0x221c[_0x3a2e5a];return _0x16153e;};'use strict';var multer=require(_0xc221('0x0'));var util=require('util');var path=require(_0xc221('0x1'));var timeout=require(_0xc221('0x2'));var express=require('express');var router=express[_0xc221('0x3')]();var fs_extra=require(_0xc221('0x4'));var auth=require(_0xc221('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc221('0x6'));var controller=require(_0xc221('0x7'));router[_0xc221('0x8')]('/',auth['isAuthenticated'](),controller[_0xc221('0x9')]);router[_0xc221('0x8')](_0xc221('0xa'),auth[_0xc221('0xb')](),controller[_0xc221('0xc')]);router[_0xc221('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc221('0xd')]);router[_0xc221('0x8')](_0xc221('0xe'),auth[_0xc221('0xb')](),controller[_0xc221('0xf')]);router[_0xc221('0x8')](_0xc221('0x10'),auth['isAuthenticated'](),controller[_0xc221('0x11')]);router[_0xc221('0x12')]('/',auth[_0xc221('0xb')](),controller[_0xc221('0x13')]);router['put'](_0xc221('0xa'),auth[_0xc221('0xb')](),controller[_0xc221('0x14')]);router[_0xc221('0x15')](_0xc221('0xa'),auth[_0xc221('0xb')](),controller[_0xc221('0x16')]);module[_0xc221('0x17')]=router; \ No newline at end of file +var _0x536d=['get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x20c9a3,_0x481a11){var _0x1da02e=function(_0x3b72a8){while(--_0x3b72a8){_0x20c9a3['push'](_0x20c9a3['shift']());}};_0x1da02e(++_0x481a11);}(_0x536d,0x1f0));var _0xd536=function(_0x594aa4,_0x55174d){_0x594aa4=_0x594aa4-0x0;var _0x49f0e3=_0x536d[_0x594aa4];return _0x49f0e3;};'use strict';var multer=require(_0xd536('0x0'));var util=require(_0xd536('0x1'));var path=require('path');var timeout=require(_0xd536('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd536('0x3'));var auth=require(_0xd536('0x4'));var interaction=require(_0xd536('0x5'));var config=require(_0xd536('0x6'));var controller=require(_0xd536('0x7'));router[_0xd536('0x8')]('/',auth[_0xd536('0x9')](),controller[_0xd536('0xa')]);router[_0xd536('0x8')]('/:id',auth[_0xd536('0x9')](),controller[_0xd536('0xb')]);router['get'](_0xd536('0xc'),auth[_0xd536('0x9')](),controller[_0xd536('0xd')]);router[_0xd536('0x8')](_0xd536('0xe'),auth['isAuthenticated'](),controller[_0xd536('0xf')]);router[_0xd536('0x8')]('/:id/descriptions',auth[_0xd536('0x9')](),controller[_0xd536('0x10')]);router[_0xd536('0x11')]('/',auth[_0xd536('0x9')](),controller['create']);router[_0xd536('0x12')](_0xd536('0x13'),auth['isAuthenticated'](),controller[_0xd536('0x14')]);router[_0xd536('0x15')]('/:id',auth[_0xd536('0x9')](),controller[_0xd536('0x16')]);module[_0xd536('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 741290f..a688135 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 _0x857a=['sequelize','exports','STRING'];(function(_0x587f89,_0x15821d){var _0x5fb74e=function(_0x24abbe){while(--_0x24abbe){_0x587f89['push'](_0x587f89['shift']());}};_0x5fb74e(++_0x15821d);}(_0x857a,0x93));var _0xa857=function(_0x3c48b0,_0x327bfe){_0x3c48b0=_0x3c48b0-0x0;var _0x28a6e4=_0x857a[_0x3c48b0];return _0x28a6e4;};'use strict';var Sequelize=require(_0xa857('0x0'));module[_0xa857('0x1')]={'name':{'type':Sequelize[_0xa857('0x2')]},'description':{'type':Sequelize[_0xa857('0x2')]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 8393c67..5e4139b 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 _0x3e42=['body','findOne','getFields','getSubjects','ServicenowField','getDescriptions','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','ServicenowConfiguration','findAll','rows','catch','show','params','includeAll','include','find'];(function(_0x5e5cbf,_0x1311b0){var _0x419f9e=function(_0x15d0e0){while(--_0x15d0e0){_0x5e5cbf['push'](_0x5e5cbf['shift']());}};_0x419f9e(++_0x1311b0);}(_0x3e42,0x147));var _0x23e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e42[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23e4('0x0'));var zipdir=require(_0x23e4('0x1'));var jsonpatch=require(_0x23e4('0x2'));var rp=require(_0x23e4('0x3'));var moment=require(_0x23e4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x23e4('0x5'));var path=require(_0x23e4('0x6'));var sox=require(_0x23e4('0x7'));var csv=require(_0x23e4('0x8'));var ejs=require(_0x23e4('0x9'));var fs=require('fs');var fs_extra=require(_0x23e4('0xa'));var _=require(_0x23e4('0xb'));var squel=require(_0x23e4('0xc'));var crypto=require(_0x23e4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x23e4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x23e4('0xf'));var Papa=require(_0x23e4('0x10'));var Redis=require('ioredis');var authService=require(_0x23e4('0x11'));var qs=require(_0x23e4('0x12'));var as=require(_0x23e4('0x13'));var hardwareService=require(_0x23e4('0x14'));var logger=require(_0x23e4('0x15'))('api');var utils=require(_0x23e4('0x16'));var config=require(_0x23e4('0x17'));var licenseUtil=require(_0x23e4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b961,_0xe077b4){_0xe077b4=_0xe077b4||0xcc;return function(_0x389581){if(_0x389581){return _0x33b961[_0x23e4('0x19')](_0xe077b4);}return _0x33b961['status'](_0xe077b4)[_0x23e4('0x1a')]();};}function respondWithResult(_0x33cdb4,_0x5844f9){_0x5844f9=_0x5844f9||0xc8;return function(_0x518334){if(_0x518334){return _0x33cdb4[_0x23e4('0x1b')](_0x5844f9)[_0x23e4('0x1c')](_0x518334);}};}function respondWithFilteredResult(_0x34fdce,_0x368652){return function(_0x23e034){if(_0x23e034){var _0x31219d=typeof _0x368652[_0x23e4('0x1d')]===_0x23e4('0x1e')&&typeof _0x368652['limit']===_0x23e4('0x1e');var _0x3a498d=_0x23e034[_0x23e4('0x1f')];var _0x320337=_0x31219d?0x0:_0x368652[_0x23e4('0x1d')];var _0x45e112=_0x31219d?_0x23e034[_0x23e4('0x1f')]:_0x368652[_0x23e4('0x1d')]+_0x368652['limit'];var _0x227b70;if(_0x45e112>=_0x3a498d){_0x45e112=_0x3a498d;_0x227b70=0xc8;}else{_0x227b70=0xce;}_0x34fdce['status'](_0x227b70);return _0x34fdce['set'](_0x23e4('0x20'),_0x320337+'-'+_0x45e112+'/'+_0x3a498d)['json'](_0x23e034);}return null;};}function patchUpdates(_0x1e0c67){return function(_0x30a107){try{jsonpatch[_0x23e4('0x21')](_0x30a107,_0x1e0c67,!![]);}catch(_0x1dd9ea){return BPromise[_0x23e4('0x22')](_0x1dd9ea);}return _0x30a107['save']();};}function saveUpdates(_0x530de0,_0x52eaab){return function(_0x28265e){if(_0x28265e){return _0x28265e[_0x23e4('0x23')](_0x530de0)[_0x23e4('0x24')](function(_0x3ffd48){return _0x3ffd48;});}return null;};}function removeEntity(_0x3bbe4d,_0x37f894){return function(_0x597cc1){if(_0x597cc1){return _0x597cc1[_0x23e4('0x25')]()[_0x23e4('0x24')](function(){_0x3bbe4d[_0x23e4('0x1b')](0xcc)[_0x23e4('0x1a')]();});}};}function handleEntityNotFound(_0x2bab63,_0x3e03f2){return function(_0x3fa78c){if(!_0x3fa78c){_0x2bab63[_0x23e4('0x19')](0x194);}return _0x3fa78c;};}function handleError(_0x374e9d,_0x3016d0){_0x3016d0=_0x3016d0||0x1f4;return function(_0x3ee310){logger[_0x23e4('0x26')](_0x3ee310['stack']);if(_0x3ee310[_0x23e4('0x27')]){delete _0x3ee310[_0x23e4('0x27')];}_0x374e9d[_0x23e4('0x1b')](_0x3016d0)[_0x23e4('0x28')](_0x3ee310);};}exports[_0x23e4('0x29')]=function(_0x13b311,_0x8149db){var _0x403685={},_0x48388e={},_0x1731a7={'count':0x0,'rows':[]};var _0x1cf0f7=_[_0x23e4('0x2a')](db['ServicenowConfiguration'][_0x23e4('0x2b')],function(_0xb708b2){return{'name':_0xb708b2[_0x23e4('0x2c')],'type':_0xb708b2[_0x23e4('0x2d')]['key']};});_0x48388e[_0x23e4('0x2e')]=_[_0x23e4('0x2a')](_0x1cf0f7,_0x23e4('0x27'));_0x48388e[_0x23e4('0x2f')]=_[_0x23e4('0x30')](_0x13b311[_0x23e4('0x2f')]);_0x48388e[_0x23e4('0x31')]=_[_0x23e4('0x32')](_0x48388e['model'],_0x48388e[_0x23e4('0x2f')]);_0x403685[_0x23e4('0x33')]=_[_0x23e4('0x32')](_0x48388e['model'],qs['fields'](_0x13b311[_0x23e4('0x2f')][_0x23e4('0x34')]));_0x403685[_0x23e4('0x33')]=_0x403685[_0x23e4('0x33')][_0x23e4('0x35')]?_0x403685[_0x23e4('0x33')]:_0x48388e[_0x23e4('0x2e')];if(!_0x13b311['query'][_0x23e4('0x36')](_0x23e4('0x37'))){_0x403685[_0x23e4('0x38')]=qs['limit'](_0x13b311[_0x23e4('0x2f')][_0x23e4('0x38')]);_0x403685['offset']=qs[_0x23e4('0x1d')](_0x13b311[_0x23e4('0x2f')][_0x23e4('0x1d')]);}_0x403685[_0x23e4('0x39')]=qs[_0x23e4('0x3a')](_0x13b311[_0x23e4('0x2f')][_0x23e4('0x3a')]);_0x403685[_0x23e4('0x3b')]=qs[_0x23e4('0x31')](_['pick'](_0x13b311['query'],_0x48388e[_0x23e4('0x31')]),_0x1cf0f7);if(_0x13b311[_0x23e4('0x2f')][_0x23e4('0x3c')]){_0x403685['where']=_[_0x23e4('0x3d')](_0x403685[_0x23e4('0x3b')],{'$or':_[_0x23e4('0x2a')](_0x1cf0f7,function(_0x185246){if(_0x185246[_0x23e4('0x2d')]!==_0x23e4('0x3e')){var _0x1464b7={};_0x1464b7[_0x185246[_0x23e4('0x27')]]={'$like':'%'+_0x13b311[_0x23e4('0x2f')][_0x23e4('0x3c')]+'%'};return _0x1464b7;}})});}_0x403685=_[_0x23e4('0x3d')]({},_0x403685,_0x13b311[_0x23e4('0x3f')]);var _0x23bc95={'where':_0x403685['where']};return db['ServicenowConfiguration'][_0x23e4('0x1f')](_0x23bc95)[_0x23e4('0x24')](function(_0x56796a){_0x1731a7['count']=_0x56796a;if(_0x13b311[_0x23e4('0x2f')]['includeAll']){_0x403685['include']=[{'all':!![]}];}return db[_0x23e4('0x40')][_0x23e4('0x41')](_0x403685);})[_0x23e4('0x24')](function(_0x13eea7){_0x1731a7[_0x23e4('0x42')]=_0x13eea7;return _0x1731a7;})[_0x23e4('0x24')](respondWithFilteredResult(_0x8149db,_0x403685))[_0x23e4('0x43')](handleError(_0x8149db,null));};exports[_0x23e4('0x44')]=function(_0x1204f0,_0x6c5825){var _0x1c15b6={'raw':![],'where':{'id':_0x1204f0[_0x23e4('0x45')]['id']}},_0x402b46={};_0x402b46['model']=_['keys'](db[_0x23e4('0x40')][_0x23e4('0x2b')]);_0x402b46[_0x23e4('0x2f')]=_[_0x23e4('0x30')](_0x1204f0[_0x23e4('0x2f')]);_0x402b46['filters']=_['intersection'](_0x402b46['model'],_0x402b46[_0x23e4('0x2f')]);_0x1c15b6['attributes']=_[_0x23e4('0x32')](_0x402b46[_0x23e4('0x2e')],qs[_0x23e4('0x34')](_0x1204f0[_0x23e4('0x2f')][_0x23e4('0x34')]));_0x1c15b6[_0x23e4('0x33')]=_0x1c15b6[_0x23e4('0x33')][_0x23e4('0x35')]?_0x1c15b6[_0x23e4('0x33')]:_0x402b46['model'];if(_0x1204f0['query'][_0x23e4('0x46')]){_0x1c15b6[_0x23e4('0x47')]=[{'all':!![]}];}_0x1c15b6=_[_0x23e4('0x3d')]({},_0x1c15b6,_0x1204f0['options']);return db[_0x23e4('0x40')][_0x23e4('0x48')](_0x1c15b6)['then'](handleEntityNotFound(_0x6c5825,null))['then'](respondWithResult(_0x6c5825,null))[_0x23e4('0x43')](handleError(_0x6c5825,null));};exports['create']=function(_0x28a4ef,_0x47d484){return db[_0x23e4('0x40')]['create'](_0x28a4ef[_0x23e4('0x49')],{})[_0x23e4('0x24')](respondWithResult(_0x47d484,0xc9))[_0x23e4('0x43')](handleError(_0x47d484,null));};exports[_0x23e4('0x23')]=function(_0x6add63,_0x4b29b2){if(_0x6add63[_0x23e4('0x49')]['id']){delete _0x6add63[_0x23e4('0x49')]['id'];}return db[_0x23e4('0x40')][_0x23e4('0x48')]({'where':{'id':_0x6add63[_0x23e4('0x45')]['id']}})[_0x23e4('0x24')](handleEntityNotFound(_0x4b29b2,null))['then'](saveUpdates(_0x6add63['body'],null))['then'](respondWithResult(_0x4b29b2,null))[_0x23e4('0x43')](handleError(_0x4b29b2,null));};exports[_0x23e4('0x25')]=function(_0x9f266a,_0x32c407){return db[_0x23e4('0x40')][_0x23e4('0x48')]({'where':{'id':_0x9f266a[_0x23e4('0x45')]['id']}})[_0x23e4('0x24')](handleEntityNotFound(_0x32c407,null))['then'](removeEntity(_0x32c407,null))[_0x23e4('0x43')](handleError(_0x32c407,null));};exports['getFields']=function(_0x49d31e,_0x2bbca9,_0x4aef0b){var _0x487601={};var _0x4b0fd2={};var _0x297b13;var _0xf6d88;return db[_0x23e4('0x40')][_0x23e4('0x4a')]({'where':{'id':_0x49d31e[_0x23e4('0x45')]['id']}})[_0x23e4('0x24')](handleEntityNotFound(_0x2bbca9,null))[_0x23e4('0x24')](function(_0x5e1bea){if(_0x5e1bea){_0x297b13=_0x5e1bea;_0x4b0fd2[_0x23e4('0x2e')]=_[_0x23e4('0x30')](db['ServicenowField'][_0x23e4('0x2b')]);_0x4b0fd2[_0x23e4('0x2f')]=_[_0x23e4('0x30')](_0x49d31e[_0x23e4('0x2f')]);_0x4b0fd2[_0x23e4('0x31')]=_[_0x23e4('0x32')](_0x4b0fd2['model'],_0x4b0fd2[_0x23e4('0x2f')]);_0x487601[_0x23e4('0x33')]=_[_0x23e4('0x32')](_0x4b0fd2[_0x23e4('0x2e')],qs[_0x23e4('0x34')](_0x49d31e[_0x23e4('0x2f')]['fields']));_0x487601[_0x23e4('0x33')]=_0x487601['attributes']['length']?_0x487601[_0x23e4('0x33')]:_0x4b0fd2['model'];_0x487601['order']=qs[_0x23e4('0x3a')](_0x49d31e[_0x23e4('0x2f')][_0x23e4('0x3a')]);_0x487601[_0x23e4('0x3b')]=qs[_0x23e4('0x31')](_['pick'](_0x49d31e['query'],_0x4b0fd2[_0x23e4('0x31')]));if(_0x49d31e['query']['filter']){_0x487601[_0x23e4('0x3b')]=_[_0x23e4('0x3d')](_0x487601[_0x23e4('0x3b')],{'$or':_[_0x23e4('0x2a')](_0x487601[_0x23e4('0x33')],function(_0x3c468c){var _0x3b4d76={};_0x3b4d76[_0x3c468c]={'$like':'%'+_0x49d31e['query'][_0x23e4('0x3c')]+'%'};return _0x3b4d76;})});}_0x487601=_[_0x23e4('0x3d')]({},_0x487601,_0x49d31e['options']);return _0x297b13[_0x23e4('0x4b')](_0x487601);}})[_0x23e4('0x24')](function(_0x50bc43){if(_0x50bc43){_0xf6d88=_0x50bc43['length'];if(!_0x49d31e[_0x23e4('0x2f')][_0x23e4('0x36')]('nolimit')){_0x487601[_0x23e4('0x38')]=qs[_0x23e4('0x38')](_0x49d31e[_0x23e4('0x2f')][_0x23e4('0x38')]);_0x487601[_0x23e4('0x1d')]=qs[_0x23e4('0x1d')](_0x49d31e[_0x23e4('0x2f')][_0x23e4('0x1d')]);}return _0x297b13[_0x23e4('0x4b')](_0x487601);}})[_0x23e4('0x24')](function(_0x5503fb){if(_0x5503fb){return _0x5503fb?{'count':_0xf6d88,'rows':_0x5503fb}:null;}})[_0x23e4('0x24')](respondWithResult(_0x2bbca9,null))[_0x23e4('0x43')](handleError(_0x2bbca9,null));};exports[_0x23e4('0x4c')]=function(_0x43eb36,_0x25ff3a,_0x25c556){var _0xb0009d={};var _0x255165={};var _0x41d5fb;var _0x57bf89;return db[_0x23e4('0x40')][_0x23e4('0x4a')]({'where':{'id':_0x43eb36[_0x23e4('0x45')]['id']}})[_0x23e4('0x24')](handleEntityNotFound(_0x25ff3a,null))[_0x23e4('0x24')](function(_0x4a9434){if(_0x4a9434){_0x41d5fb=_0x4a9434;_0x255165[_0x23e4('0x2e')]=_[_0x23e4('0x30')](db[_0x23e4('0x4d')][_0x23e4('0x2b')]);_0x255165[_0x23e4('0x2f')]=_[_0x23e4('0x30')](_0x43eb36['query']);_0x255165[_0x23e4('0x31')]=_['intersection'](_0x255165[_0x23e4('0x2e')],_0x255165[_0x23e4('0x2f')]);_0xb0009d[_0x23e4('0x33')]=_[_0x23e4('0x32')](_0x255165[_0x23e4('0x2e')],qs[_0x23e4('0x34')](_0x43eb36[_0x23e4('0x2f')][_0x23e4('0x34')]));_0xb0009d[_0x23e4('0x33')]=_0xb0009d[_0x23e4('0x33')][_0x23e4('0x35')]?_0xb0009d['attributes']:_0x255165[_0x23e4('0x2e')];_0xb0009d['order']=qs['sort'](_0x43eb36['query'][_0x23e4('0x3a')]);_0xb0009d[_0x23e4('0x3b')]=qs[_0x23e4('0x31')](_['pick'](_0x43eb36[_0x23e4('0x2f')],_0x255165[_0x23e4('0x31')]));if(_0x43eb36['query'][_0x23e4('0x3c')]){_0xb0009d['where']=_[_0x23e4('0x3d')](_0xb0009d[_0x23e4('0x3b')],{'$or':_['map'](_0xb0009d['attributes'],function(_0x182244){var _0x2b7f59={};_0x2b7f59[_0x182244]={'$like':'%'+_0x43eb36[_0x23e4('0x2f')]['filter']+'%'};return _0x2b7f59;})});}_0xb0009d=_[_0x23e4('0x3d')]({},_0xb0009d,_0x43eb36[_0x23e4('0x3f')]);return _0x41d5fb['getSubjects'](_0xb0009d);}})[_0x23e4('0x24')](function(_0x2c6b01){if(_0x2c6b01){_0x57bf89=_0x2c6b01['length'];if(!_0x43eb36[_0x23e4('0x2f')]['hasOwnProperty']('nolimit')){_0xb0009d[_0x23e4('0x38')]=qs[_0x23e4('0x38')](_0x43eb36['query'][_0x23e4('0x38')]);_0xb0009d[_0x23e4('0x1d')]=qs[_0x23e4('0x1d')](_0x43eb36[_0x23e4('0x2f')][_0x23e4('0x1d')]);}return _0x41d5fb[_0x23e4('0x4c')](_0xb0009d);}})[_0x23e4('0x24')](function(_0x405daf){if(_0x405daf){return _0x405daf?{'count':_0x57bf89,'rows':_0x405daf}:null;}})[_0x23e4('0x24')](respondWithResult(_0x25ff3a,null))[_0x23e4('0x43')](handleError(_0x25ff3a,null));};exports[_0x23e4('0x4e')]=function(_0x201a9b,_0x1b57f6,_0x4885f5){var _0x104450={};var _0x4362d7={};var _0x2c76d6;var _0x5529d7;return db['ServicenowConfiguration'][_0x23e4('0x4a')]({'where':{'id':_0x201a9b[_0x23e4('0x45')]['id']}})[_0x23e4('0x24')](handleEntityNotFound(_0x1b57f6,null))[_0x23e4('0x24')](function(_0x24051b){if(_0x24051b){_0x2c76d6=_0x24051b;_0x4362d7[_0x23e4('0x2e')]=_[_0x23e4('0x30')](db[_0x23e4('0x4d')][_0x23e4('0x2b')]);_0x4362d7['query']=_[_0x23e4('0x30')](_0x201a9b[_0x23e4('0x2f')]);_0x4362d7[_0x23e4('0x31')]=_['intersection'](_0x4362d7[_0x23e4('0x2e')],_0x4362d7[_0x23e4('0x2f')]);_0x104450[_0x23e4('0x33')]=_[_0x23e4('0x32')](_0x4362d7[_0x23e4('0x2e')],qs[_0x23e4('0x34')](_0x201a9b[_0x23e4('0x2f')][_0x23e4('0x34')]));_0x104450[_0x23e4('0x33')]=_0x104450[_0x23e4('0x33')][_0x23e4('0x35')]?_0x104450[_0x23e4('0x33')]:_0x4362d7[_0x23e4('0x2e')];_0x104450[_0x23e4('0x39')]=qs[_0x23e4('0x3a')](_0x201a9b[_0x23e4('0x2f')][_0x23e4('0x3a')]);_0x104450[_0x23e4('0x3b')]=qs[_0x23e4('0x31')](_[_0x23e4('0x4f')](_0x201a9b['query'],_0x4362d7['filters']));if(_0x201a9b['query'][_0x23e4('0x3c')]){_0x104450[_0x23e4('0x3b')]=_[_0x23e4('0x3d')](_0x104450[_0x23e4('0x3b')],{'$or':_[_0x23e4('0x2a')](_0x104450[_0x23e4('0x33')],function(_0x2cb607){var _0xd482e9={};_0xd482e9[_0x2cb607]={'$like':'%'+_0x201a9b['query'][_0x23e4('0x3c')]+'%'};return _0xd482e9;})});}_0x104450=_[_0x23e4('0x3d')]({},_0x104450,_0x201a9b[_0x23e4('0x3f')]);return _0x2c76d6[_0x23e4('0x4e')](_0x104450);}})[_0x23e4('0x24')](function(_0x5bb177){if(_0x5bb177){_0x5529d7=_0x5bb177[_0x23e4('0x35')];if(!_0x201a9b[_0x23e4('0x2f')][_0x23e4('0x36')](_0x23e4('0x37'))){_0x104450[_0x23e4('0x38')]=qs[_0x23e4('0x38')](_0x201a9b[_0x23e4('0x2f')][_0x23e4('0x38')]);_0x104450[_0x23e4('0x1d')]=qs[_0x23e4('0x1d')](_0x201a9b[_0x23e4('0x2f')][_0x23e4('0x1d')]);}return _0x2c76d6[_0x23e4('0x4e')](_0x104450);}})[_0x23e4('0x24')](function(_0xfc6a21){if(_0xfc6a21){return _0xfc6a21?{'count':_0x5529d7,'rows':_0xfc6a21}:null;}})[_0x23e4('0x24')](respondWithResult(_0x1b57f6,null))[_0x23e4('0x43')](handleError(_0x1b57f6,null));}; \ No newline at end of file +var _0xfb5f=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','ServicenowField','order','getFields','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4b935a,_0x327ee3){var _0xa298f0=function(_0x3e07c2){while(--_0x3e07c2){_0x4b935a['push'](_0x4b935a['shift']());}};_0xa298f0(++_0x327ee3);}(_0xfb5f,0x18c));var _0xffb5=function(_0xa83473,_0xe200c0){_0xa83473=_0xa83473-0x0;var _0x56be07=_0xfb5f[_0xa83473];return _0x56be07;};'use strict';var emlformat=require(_0xffb5('0x0'));var rimraf=require(_0xffb5('0x1'));var zipdir=require(_0xffb5('0x2'));var jsonpatch=require(_0xffb5('0x3'));var rp=require(_0xffb5('0x4'));var moment=require(_0xffb5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xffb5('0x6'));var util=require(_0xffb5('0x7'));var path=require(_0xffb5('0x8'));var sox=require('sox');var csv=require(_0xffb5('0x9'));var ejs=require(_0xffb5('0xa'));var fs=require('fs');var fs_extra=require(_0xffb5('0xb'));var _=require('lodash');var squel=require(_0xffb5('0xc'));var crypto=require(_0xffb5('0xd'));var jsforce=require(_0xffb5('0xe'));var deskjs=require(_0xffb5('0xf'));var toCsv=require(_0xffb5('0x9'));var querystring=require(_0xffb5('0x10'));var Papa=require(_0xffb5('0x11'));var Redis=require(_0xffb5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xffb5('0x13'));var as=require(_0xffb5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffb5('0x15'))('api');var utils=require(_0xffb5('0x16'));var config=require(_0xffb5('0x17'));var licenseUtil=require(_0xffb5('0x18'));var db=require(_0xffb5('0x19'))['db'];function respondWithStatusCode(_0x70bb4c,_0x42f4c9){_0x42f4c9=_0x42f4c9||0xcc;return function(_0x373d9a){if(_0x373d9a){return _0x70bb4c[_0xffb5('0x1a')](_0x42f4c9);}return _0x70bb4c[_0xffb5('0x1b')](_0x42f4c9)[_0xffb5('0x1c')]();};}function respondWithResult(_0x4e8450,_0x536c76){_0x536c76=_0x536c76||0xc8;return function(_0x57eba4){if(_0x57eba4){return _0x4e8450[_0xffb5('0x1b')](_0x536c76)['json'](_0x57eba4);}};}function respondWithFilteredResult(_0x163d3e,_0x521fad){return function(_0xbb239d){if(_0xbb239d){var _0xfba410=typeof _0x521fad[_0xffb5('0x1d')]===_0xffb5('0x1e')&&typeof _0x521fad['limit']===_0xffb5('0x1e');var _0xbd4b51=_0xbb239d['count'];var _0x4f8ef9=_0xfba410?0x0:_0x521fad[_0xffb5('0x1d')];var _0x436954=_0xfba410?_0xbb239d[_0xffb5('0x1f')]:_0x521fad[_0xffb5('0x1d')]+_0x521fad['limit'];var _0x5107c9;if(_0x436954>=_0xbd4b51){_0x436954=_0xbd4b51;_0x5107c9=0xc8;}else{_0x5107c9=0xce;}_0x163d3e[_0xffb5('0x1b')](_0x5107c9);return _0x163d3e[_0xffb5('0x20')](_0xffb5('0x21'),_0x4f8ef9+'-'+_0x436954+'/'+_0xbd4b51)[_0xffb5('0x22')](_0xbb239d);}return null;};}function patchUpdates(_0x3a7df4){return function(_0x12ec13){try{jsonpatch['apply'](_0x12ec13,_0x3a7df4,!![]);}catch(_0x415045){return BPromise['reject'](_0x415045);}return _0x12ec13['save']();};}function saveUpdates(_0x515b60,_0x387fe7){return function(_0x220fd8){if(_0x220fd8){return _0x220fd8[_0xffb5('0x23')](_0x515b60)[_0xffb5('0x24')](function(_0x3e4b0d){return _0x3e4b0d;});}return null;};}function removeEntity(_0xfb7bf6,_0x569d1b){return function(_0x23f753){if(_0x23f753){return _0x23f753[_0xffb5('0x25')]()[_0xffb5('0x24')](function(){_0xfb7bf6[_0xffb5('0x1b')](0xcc)[_0xffb5('0x1c')]();});}};}function handleEntityNotFound(_0x183819,_0x36093a){return function(_0x16329e){if(!_0x16329e){_0x183819[_0xffb5('0x1a')](0x194);}return _0x16329e;};}function handleError(_0xdec20d,_0x3ad02c){_0x3ad02c=_0x3ad02c||0x1f4;return function(_0x521a9a){logger[_0xffb5('0x26')](_0x521a9a[_0xffb5('0x27')]);if(_0x521a9a[_0xffb5('0x28')]){delete _0x521a9a[_0xffb5('0x28')];}_0xdec20d[_0xffb5('0x1b')](_0x3ad02c)[_0xffb5('0x29')](_0x521a9a);};}exports[_0xffb5('0x2a')]=function(_0x3d8037,_0x42b93d){var _0x5dd56f={},_0x52e439={},_0x54fae6={'count':0x0,'rows':[]};var _0x4eab6d=_[_0xffb5('0x2b')](db[_0xffb5('0x2c')][_0xffb5('0x2d')],function(_0x3f54a1){return{'name':_0x3f54a1['fieldName'],'type':_0x3f54a1[_0xffb5('0x2e')][_0xffb5('0x2f')]};});_0x52e439[_0xffb5('0x30')]=_[_0xffb5('0x2b')](_0x4eab6d,_0xffb5('0x28'));_0x52e439[_0xffb5('0x31')]=_[_0xffb5('0x32')](_0x3d8037[_0xffb5('0x31')]);_0x52e439[_0xffb5('0x33')]=_[_0xffb5('0x34')](_0x52e439[_0xffb5('0x30')],_0x52e439[_0xffb5('0x31')]);_0x5dd56f[_0xffb5('0x35')]=_[_0xffb5('0x34')](_0x52e439['model'],qs[_0xffb5('0x36')](_0x3d8037[_0xffb5('0x31')][_0xffb5('0x36')]));_0x5dd56f[_0xffb5('0x35')]=_0x5dd56f[_0xffb5('0x35')][_0xffb5('0x37')]?_0x5dd56f[_0xffb5('0x35')]:_0x52e439[_0xffb5('0x30')];if(!_0x3d8037[_0xffb5('0x31')]['hasOwnProperty'](_0xffb5('0x38'))){_0x5dd56f[_0xffb5('0x39')]=qs[_0xffb5('0x39')](_0x3d8037[_0xffb5('0x31')]['limit']);_0x5dd56f[_0xffb5('0x1d')]=qs[_0xffb5('0x1d')](_0x3d8037['query']['offset']);}_0x5dd56f['order']=qs[_0xffb5('0x3a')](_0x3d8037[_0xffb5('0x31')][_0xffb5('0x3a')]);_0x5dd56f[_0xffb5('0x3b')]=qs[_0xffb5('0x33')](_[_0xffb5('0x3c')](_0x3d8037[_0xffb5('0x31')],_0x52e439[_0xffb5('0x33')]),_0x4eab6d);if(_0x3d8037[_0xffb5('0x31')][_0xffb5('0x3d')]){_0x5dd56f[_0xffb5('0x3b')]=_[_0xffb5('0x3e')](_0x5dd56f['where'],{'$or':_[_0xffb5('0x2b')](_0x4eab6d,function(_0x1b91e4){if(_0x1b91e4['type']!==_0xffb5('0x3f')){var _0x2fac37={};_0x2fac37[_0x1b91e4[_0xffb5('0x28')]]={'$like':'%'+_0x3d8037[_0xffb5('0x31')][_0xffb5('0x3d')]+'%'};return _0x2fac37;}})});}_0x5dd56f=_[_0xffb5('0x3e')]({},_0x5dd56f,_0x3d8037['options']);var _0x3240be={'where':_0x5dd56f[_0xffb5('0x3b')]};return db[_0xffb5('0x2c')]['count'](_0x3240be)['then'](function(_0x14fd98){_0x54fae6['count']=_0x14fd98;if(_0x3d8037['query'][_0xffb5('0x40')]){_0x5dd56f[_0xffb5('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xffb5('0x42')](_0x5dd56f);})['then'](function(_0x5ecede){_0x54fae6['rows']=_0x5ecede;return _0x54fae6;})['then'](respondWithFilteredResult(_0x42b93d,_0x5dd56f))[_0xffb5('0x43')](handleError(_0x42b93d,null));};exports['show']=function(_0x50282b,_0x1acc1c){var _0x24e19b={'raw':![],'where':{'id':_0x50282b[_0xffb5('0x44')]['id']}},_0x7f7cd2={};_0x7f7cd2[_0xffb5('0x30')]=_[_0xffb5('0x32')](db[_0xffb5('0x2c')][_0xffb5('0x2d')]);_0x7f7cd2[_0xffb5('0x31')]=_[_0xffb5('0x32')](_0x50282b[_0xffb5('0x31')]);_0x7f7cd2[_0xffb5('0x33')]=_[_0xffb5('0x34')](_0x7f7cd2[_0xffb5('0x30')],_0x7f7cd2[_0xffb5('0x31')]);_0x24e19b[_0xffb5('0x35')]=_[_0xffb5('0x34')](_0x7f7cd2[_0xffb5('0x30')],qs[_0xffb5('0x36')](_0x50282b[_0xffb5('0x31')][_0xffb5('0x36')]));_0x24e19b[_0xffb5('0x35')]=_0x24e19b[_0xffb5('0x35')]['length']?_0x24e19b[_0xffb5('0x35')]:_0x7f7cd2[_0xffb5('0x30')];if(_0x50282b[_0xffb5('0x31')]['includeAll']){_0x24e19b[_0xffb5('0x41')]=[{'all':!![]}];}_0x24e19b=_['merge']({},_0x24e19b,_0x50282b[_0xffb5('0x45')]);return db[_0xffb5('0x2c')][_0xffb5('0x46')](_0x24e19b)[_0xffb5('0x24')](handleEntityNotFound(_0x1acc1c,null))[_0xffb5('0x24')](respondWithResult(_0x1acc1c,null))[_0xffb5('0x43')](handleError(_0x1acc1c,null));};exports[_0xffb5('0x47')]=function(_0x43a439,_0xfd33f7){return db[_0xffb5('0x2c')][_0xffb5('0x47')](_0x43a439[_0xffb5('0x48')],{})['then'](respondWithResult(_0xfd33f7,0xc9))[_0xffb5('0x43')](handleError(_0xfd33f7,null));};exports[_0xffb5('0x23')]=function(_0x2a3b2d,_0x5f344a){if(_0x2a3b2d[_0xffb5('0x48')]['id']){delete _0x2a3b2d['body']['id'];}return db[_0xffb5('0x2c')]['find']({'where':{'id':_0x2a3b2d[_0xffb5('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f344a,null))[_0xffb5('0x24')](saveUpdates(_0x2a3b2d['body'],null))[_0xffb5('0x24')](respondWithResult(_0x5f344a,null))[_0xffb5('0x43')](handleError(_0x5f344a,null));};exports[_0xffb5('0x25')]=function(_0x410545,_0x2061dd){return db['ServicenowConfiguration']['find']({'where':{'id':_0x410545[_0xffb5('0x44')]['id']}})['then'](handleEntityNotFound(_0x2061dd,null))[_0xffb5('0x24')](removeEntity(_0x2061dd,null))[_0xffb5('0x43')](handleError(_0x2061dd,null));};exports['getFields']=function(_0x53f064,_0x1afe76,_0x127c31){var _0x1a7c87={};var _0x1f7770={};var _0x52ee80;var _0x1fdbc4;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x53f064['params']['id']}})['then'](handleEntityNotFound(_0x1afe76,null))[_0xffb5('0x24')](function(_0x1e6d2b){if(_0x1e6d2b){_0x52ee80=_0x1e6d2b;_0x1f7770[_0xffb5('0x30')]=_[_0xffb5('0x32')](db[_0xffb5('0x49')][_0xffb5('0x2d')]);_0x1f7770[_0xffb5('0x31')]=_[_0xffb5('0x32')](_0x53f064[_0xffb5('0x31')]);_0x1f7770[_0xffb5('0x33')]=_[_0xffb5('0x34')](_0x1f7770[_0xffb5('0x30')],_0x1f7770[_0xffb5('0x31')]);_0x1a7c87[_0xffb5('0x35')]=_[_0xffb5('0x34')](_0x1f7770[_0xffb5('0x30')],qs['fields'](_0x53f064[_0xffb5('0x31')]['fields']));_0x1a7c87[_0xffb5('0x35')]=_0x1a7c87[_0xffb5('0x35')][_0xffb5('0x37')]?_0x1a7c87[_0xffb5('0x35')]:_0x1f7770[_0xffb5('0x30')];_0x1a7c87[_0xffb5('0x4a')]=qs[_0xffb5('0x3a')](_0x53f064['query'][_0xffb5('0x3a')]);_0x1a7c87[_0xffb5('0x3b')]=qs[_0xffb5('0x33')](_['pick'](_0x53f064[_0xffb5('0x31')],_0x1f7770[_0xffb5('0x33')]));if(_0x53f064[_0xffb5('0x31')][_0xffb5('0x3d')]){_0x1a7c87['where']=_[_0xffb5('0x3e')](_0x1a7c87[_0xffb5('0x3b')],{'$or':_[_0xffb5('0x2b')](_0x1a7c87[_0xffb5('0x35')],function(_0x32cde1){var _0x301ca7={};_0x301ca7[_0x32cde1]={'$like':'%'+_0x53f064['query']['filter']+'%'};return _0x301ca7;})});}_0x1a7c87=_[_0xffb5('0x3e')]({},_0x1a7c87,_0x53f064[_0xffb5('0x45')]);return _0x52ee80[_0xffb5('0x4b')](_0x1a7c87);}})['then'](function(_0x402656){if(_0x402656){_0x1fdbc4=_0x402656[_0xffb5('0x37')];if(!_0x53f064['query']['hasOwnProperty'](_0xffb5('0x38'))){_0x1a7c87[_0xffb5('0x39')]=qs[_0xffb5('0x39')](_0x53f064[_0xffb5('0x31')][_0xffb5('0x39')]);_0x1a7c87[_0xffb5('0x1d')]=qs['offset'](_0x53f064[_0xffb5('0x31')][_0xffb5('0x1d')]);}return _0x52ee80['getFields'](_0x1a7c87);}})[_0xffb5('0x24')](function(_0x28982d){if(_0x28982d){return _0x28982d?{'count':_0x1fdbc4,'rows':_0x28982d}:null;}})[_0xffb5('0x24')](respondWithResult(_0x1afe76,null))[_0xffb5('0x43')](handleError(_0x1afe76,null));};exports[_0xffb5('0x4c')]=function(_0x44a80d,_0x18a4d8,_0x180c23){var _0x23caa0={};var _0x3a1326={};var _0x64c3fa;var _0x2564a3;return db[_0xffb5('0x2c')][_0xffb5('0x4d')]({'where':{'id':_0x44a80d[_0xffb5('0x44')]['id']}})[_0xffb5('0x24')](handleEntityNotFound(_0x18a4d8,null))['then'](function(_0x37e6fa){if(_0x37e6fa){_0x64c3fa=_0x37e6fa;_0x3a1326[_0xffb5('0x30')]=_[_0xffb5('0x32')](db[_0xffb5('0x49')]['rawAttributes']);_0x3a1326[_0xffb5('0x31')]=_[_0xffb5('0x32')](_0x44a80d[_0xffb5('0x31')]);_0x3a1326[_0xffb5('0x33')]=_[_0xffb5('0x34')](_0x3a1326['model'],_0x3a1326[_0xffb5('0x31')]);_0x23caa0[_0xffb5('0x35')]=_[_0xffb5('0x34')](_0x3a1326[_0xffb5('0x30')],qs[_0xffb5('0x36')](_0x44a80d[_0xffb5('0x31')]['fields']));_0x23caa0['attributes']=_0x23caa0[_0xffb5('0x35')][_0xffb5('0x37')]?_0x23caa0[_0xffb5('0x35')]:_0x3a1326[_0xffb5('0x30')];_0x23caa0[_0xffb5('0x4a')]=qs[_0xffb5('0x3a')](_0x44a80d['query'][_0xffb5('0x3a')]);_0x23caa0[_0xffb5('0x3b')]=qs['filters'](_[_0xffb5('0x3c')](_0x44a80d[_0xffb5('0x31')],_0x3a1326[_0xffb5('0x33')]));if(_0x44a80d[_0xffb5('0x31')]['filter']){_0x23caa0['where']=_[_0xffb5('0x3e')](_0x23caa0[_0xffb5('0x3b')],{'$or':_['map'](_0x23caa0['attributes'],function(_0x5b3083){var _0x230a5b={};_0x230a5b[_0x5b3083]={'$like':'%'+_0x44a80d[_0xffb5('0x31')][_0xffb5('0x3d')]+'%'};return _0x230a5b;})});}_0x23caa0=_[_0xffb5('0x3e')]({},_0x23caa0,_0x44a80d[_0xffb5('0x45')]);return _0x64c3fa[_0xffb5('0x4c')](_0x23caa0);}})[_0xffb5('0x24')](function(_0x229603){if(_0x229603){_0x2564a3=_0x229603[_0xffb5('0x37')];if(!_0x44a80d[_0xffb5('0x31')][_0xffb5('0x4e')](_0xffb5('0x38'))){_0x23caa0[_0xffb5('0x39')]=qs[_0xffb5('0x39')](_0x44a80d[_0xffb5('0x31')]['limit']);_0x23caa0[_0xffb5('0x1d')]=qs[_0xffb5('0x1d')](_0x44a80d[_0xffb5('0x31')][_0xffb5('0x1d')]);}return _0x64c3fa[_0xffb5('0x4c')](_0x23caa0);}})['then'](function(_0x2b5fd3){if(_0x2b5fd3){return _0x2b5fd3?{'count':_0x2564a3,'rows':_0x2b5fd3}:null;}})[_0xffb5('0x24')](respondWithResult(_0x18a4d8,null))[_0xffb5('0x43')](handleError(_0x18a4d8,null));};exports[_0xffb5('0x4f')]=function(_0x27e2be,_0x3a15e9,_0x2814f4){var _0x459cfe={};var _0x51e579={};var _0xd5d5b2;var _0xabdb7b;return db[_0xffb5('0x2c')]['findOne']({'where':{'id':_0x27e2be[_0xffb5('0x44')]['id']}})[_0xffb5('0x24')](handleEntityNotFound(_0x3a15e9,null))[_0xffb5('0x24')](function(_0x5880a0){if(_0x5880a0){_0xd5d5b2=_0x5880a0;_0x51e579['model']=_[_0xffb5('0x32')](db[_0xffb5('0x49')][_0xffb5('0x2d')]);_0x51e579['query']=_[_0xffb5('0x32')](_0x27e2be['query']);_0x51e579['filters']=_[_0xffb5('0x34')](_0x51e579[_0xffb5('0x30')],_0x51e579[_0xffb5('0x31')]);_0x459cfe['attributes']=_[_0xffb5('0x34')](_0x51e579['model'],qs['fields'](_0x27e2be['query']['fields']));_0x459cfe[_0xffb5('0x35')]=_0x459cfe[_0xffb5('0x35')][_0xffb5('0x37')]?_0x459cfe[_0xffb5('0x35')]:_0x51e579[_0xffb5('0x30')];_0x459cfe[_0xffb5('0x4a')]=qs[_0xffb5('0x3a')](_0x27e2be[_0xffb5('0x31')][_0xffb5('0x3a')]);_0x459cfe[_0xffb5('0x3b')]=qs[_0xffb5('0x33')](_[_0xffb5('0x3c')](_0x27e2be[_0xffb5('0x31')],_0x51e579['filters']));if(_0x27e2be[_0xffb5('0x31')]['filter']){_0x459cfe['where']=_[_0xffb5('0x3e')](_0x459cfe[_0xffb5('0x3b')],{'$or':_[_0xffb5('0x2b')](_0x459cfe[_0xffb5('0x35')],function(_0x15f3bb){var _0x102ae0={};_0x102ae0[_0x15f3bb]={'$like':'%'+_0x27e2be[_0xffb5('0x31')][_0xffb5('0x3d')]+'%'};return _0x102ae0;})});}_0x459cfe=_[_0xffb5('0x3e')]({},_0x459cfe,_0x27e2be[_0xffb5('0x45')]);return _0xd5d5b2[_0xffb5('0x4f')](_0x459cfe);}})['then'](function(_0x1c4f40){if(_0x1c4f40){_0xabdb7b=_0x1c4f40['length'];if(!_0x27e2be[_0xffb5('0x31')][_0xffb5('0x4e')](_0xffb5('0x38'))){_0x459cfe[_0xffb5('0x39')]=qs[_0xffb5('0x39')](_0x27e2be['query'][_0xffb5('0x39')]);_0x459cfe[_0xffb5('0x1d')]=qs[_0xffb5('0x1d')](_0x27e2be[_0xffb5('0x31')][_0xffb5('0x1d')]);}return _0xd5d5b2[_0xffb5('0x4f')](_0x459cfe);}})['then'](function(_0x59f205){if(_0x59f205){return _0x59f205?{'count':_0xabdb7b,'rows':_0x59f205}:null;}})[_0xffb5('0x24')](respondWithResult(_0x3a15e9,null))[_0xffb5('0x43')](handleError(_0x3a15e9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3fdaadc..7c32eed 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 _0x98b7=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','path'];(function(_0x422baa,_0x98d34a){var _0x31c810=function(_0xa554fe){while(--_0xa554fe){_0x422baa['push'](_0x422baa['shift']());}};_0x31c810(++_0x98d34a);}(_0x98b7,0xc1));var _0x798b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x98b7[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var logger=require(_0x798b('0x2'))(_0x798b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x798b('0x4'));var rimraf=require(_0x798b('0x5'));var config=require(_0x798b('0x6'));var attributes=require(_0x798b('0x7'));module[_0x798b('0x8')]=function(_0x4c197e,_0x2bab89){return _0x4c197e['define'](_0x798b('0x9'),attributes,{'tableName':_0x798b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f3c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x427094,_0x412378){var _0x24f773=function(_0x50455c){while(--_0x50455c){_0x427094['push'](_0x427094['shift']());}};_0x24f773(++_0x412378);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x585f40,_0x4a3091){_0x585f40=_0x585f40-0x0;var _0x44fc86=_0x4f3c[_0x585f40];return _0x44fc86;};'use strict';var _=require(_0xc4f3('0x0'));var util=require(_0xc4f3('0x1'));var logger=require(_0xc4f3('0x2'))(_0xc4f3('0x3'));var moment=require(_0xc4f3('0x4'));var BPromise=require(_0xc4f3('0x5'));var rp=require(_0xc4f3('0x6'));var fs=require('fs');var path=require(_0xc4f3('0x7'));var rimraf=require(_0xc4f3('0x8'));var config=require(_0xc4f3('0x9'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x21d027,_0x14f1cc){return _0x21d027[_0xc4f3('0xa')](_0xc4f3('0xb'),attributes,{'tableName':_0xc4f3('0xc'),'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 b21ef50..c3c11ae 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 _0x5c10=['request','request\x20sent','debug','error','message','info','result','catch','ServicenowConfiguration,\x20%s,\x20%s','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x244f28,_0x444117){var _0x5533e2=function(_0x3e9405){while(--_0x3e9405){_0x244f28['push'](_0x244f28['shift']());}};_0x5533e2(++_0x444117);}(_0x5c10,0x183));var _0x05c1=function(_0x4da2d4,_0x152cd3){_0x4da2d4=_0x4da2d4-0x0;var _0x265151=_0x5c10[_0x4da2d4];return _0x265151;};'use strict';var _=require(_0x05c1('0x0'));var util=require('util');var moment=require(_0x05c1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05c1('0x2'));var db=require(_0x05c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x05c1('0x4'))(_0x05c1('0x5'));var config=require('../../config/environment');var jayson=require(_0x05c1('0x6'));var client=jayson[_0x05c1('0x7')][_0x05c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x399a18,_0x51d30e,_0x12047d){return new BPromise(function(_0x5e46e3,_0x41a93f){return client[_0x05c1('0x9')](_0x399a18,_0x12047d)['then'](function(_0xf471c1){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x51d30e,_0x05c1('0xa'));logger[_0x05c1('0xb')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x51d30e,'request\x20sent',JSON['stringify'](_0xf471c1));if(_0xf471c1[_0x05c1('0xc')]){if(_0xf471c1[_0x05c1('0xc')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x51d30e,_0xf471c1['error'][_0x05c1('0xd')]);return _0x41a93f(_0xf471c1['error']['message']);}logger[_0x05c1('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x51d30e,_0xf471c1[_0x05c1('0xc')]['message']);return _0x5e46e3(_0xf471c1[_0x05c1('0xc')]['message']);}else{logger[_0x05c1('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x51d30e,_0x05c1('0xa'));_0x5e46e3(_0xf471c1[_0x05c1('0xf')][_0x05c1('0xd')]);}})[_0x05c1('0x10')](function(_0x405c3d){logger[_0x05c1('0xc')](_0x05c1('0x11'),_0x51d30e,_0x405c3d);_0x41a93f(_0x405c3d);});});} \ No newline at end of file +var _0x3469=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x3469,0x19e));var _0x9346=function(_0x3e7489,_0x316938){_0x3e7489=_0x3e7489-0x0;var _0x5e8db0=_0x3469[_0x3e7489];return _0x5e8db0;};'use strict';var _=require(_0x9346('0x0'));var util=require(_0x9346('0x1'));var moment=require('moment');var BPromise=require(_0x9346('0x2'));var rs=require(_0x9346('0x3'));var fs=require('fs');var Redis=require(_0x9346('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9346('0x5'));var logger=require(_0x9346('0x6'))(_0x9346('0x7'));var config=require(_0x9346('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9346('0x9')][_0x9346('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d94ec,_0x291ee0,_0xed69f7){return new BPromise(function(_0x707a0a,_0x566681){return client[_0x9346('0xb')](_0x3d94ec,_0xed69f7)[_0x9346('0xc')](function(_0x590273){logger[_0x9346('0xd')](_0x9346('0xe'),_0x291ee0,_0x9346('0xf'));logger['debug'](_0x9346('0x10'),_0x291ee0,'request\x20sent',JSON[_0x9346('0x11')](_0x590273));if(_0x590273[_0x9346('0x12')]){if(_0x590273['error'][_0x9346('0x13')]===0x1f4){logger[_0x9346('0x12')](_0x9346('0xe'),_0x291ee0,_0x590273[_0x9346('0x12')][_0x9346('0x14')]);return _0x566681(_0x590273[_0x9346('0x12')][_0x9346('0x14')]);}logger[_0x9346('0x12')](_0x9346('0xe'),_0x291ee0,_0x590273[_0x9346('0x12')]['message']);return _0x707a0a(_0x590273[_0x9346('0x12')][_0x9346('0x14')]);}else{logger[_0x9346('0xd')](_0x9346('0xe'),_0x291ee0,'request\x20sent');_0x707a0a(_0x590273[_0x9346('0x15')][_0x9346('0x14')]);}})[_0x9346('0x16')](function(_0x3db5e7){logger[_0x9346('0x12')](_0x9346('0xe'),_0x291ee0,_0x3db5e7);_0x566681(_0x3db5e7);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9ac8142..0a78b1c 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 _0xc39e=['./intServicenowField.controller','get','isAuthenticated','index','/:id','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41bec0,_0x5f4b7f){var _0x25638c=function(_0x42b319){while(--_0x42b319){_0x41bec0['push'](_0x41bec0['shift']());}};_0x25638c(++_0x5f4b7f);}(_0xc39e,0x74));var _0xec39=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xc39e[_0x576266];return _0x18234f;};'use strict';var multer=require(_0xec39('0x0'));var util=require(_0xec39('0x1'));var path=require(_0xec39('0x2'));var timeout=require(_0xec39('0x3'));var express=require(_0xec39('0x4'));var router=express[_0xec39('0x5')]();var fs_extra=require(_0xec39('0x6'));var auth=require(_0xec39('0x7'));var interaction=require(_0xec39('0x8'));var config=require(_0xec39('0x9'));var controller=require(_0xec39('0xa'));router[_0xec39('0xb')]('/',auth[_0xec39('0xc')](),controller[_0xec39('0xd')]);router['get'](_0xec39('0xe'),auth[_0xec39('0xc')](),controller['show']);router[_0xec39('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec39('0x10')](_0xec39('0xe'),auth[_0xec39('0xc')](),controller['update']);router[_0xec39('0x11')](_0xec39('0xe'),auth[_0xec39('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xde2b=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated','create','put','delete'];(function(_0x419924,_0x2cdbad){var _0x122134=function(_0x185374){while(--_0x185374){_0x419924['push'](_0x419924['shift']());}};_0x122134(++_0x2cdbad);}(_0xde2b,0x9a));var _0xbde2=function(_0x29f2cf,_0x28a185){_0x29f2cf=_0x29f2cf-0x0;var _0x157a69=_0xde2b[_0x29f2cf];return _0x157a69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbde2('0x0'));var timeout=require(_0xbde2('0x1'));var express=require(_0xbde2('0x2'));var router=express[_0xbde2('0x3')]();var fs_extra=require(_0xbde2('0x4'));var auth=require(_0xbde2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbde2('0x6'));router[_0xbde2('0x7')]('/',auth['isAuthenticated'](),controller[_0xbde2('0x8')]);router[_0xbde2('0x7')](_0xbde2('0x9'),auth['isAuthenticated'](),controller[_0xbde2('0xa')]);router[_0xbde2('0xb')]('/',auth[_0xbde2('0xc')](),controller[_0xbde2('0xd')]);router[_0xbde2('0xe')](_0xbde2('0x9'),auth[_0xbde2('0xc')](),controller['update']);router[_0xbde2('0xf')](_0xbde2('0x9'),auth[_0xbde2('0xc')](),controller['destroy']);module[_0xbde2('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 5c21212..ddced7e 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 _0x9a2c=['variable','keyValue','picklist','string','STRING','customVariable','sequelize','ENUM'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x9a2c,0xfe));var _0xc9a2=function(_0x318fb3,_0xb3c2ec){_0x318fb3=_0x318fb3-0x0;var _0x298c25=_0x9a2c[_0x318fb3];return _0x298c25;};'use strict';var Sequelize=require(_0xc9a2('0x0'));module['exports']={'type':{'type':Sequelize[_0xc9a2('0x1')]('string',_0xc9a2('0x2'),'customVariable',_0xc9a2('0x3'),_0xc9a2('0x4')),'defaultValue':_0xc9a2('0x5')},'content':{'type':Sequelize[_0xc9a2('0x6')]},'key':{'type':Sequelize[_0xc9a2('0x6')]},'keyType':{'type':Sequelize[_0xc9a2('0x1')](_0xc9a2('0x5'),_0xc9a2('0x2'),_0xc9a2('0x7'))},'keyContent':{'type':Sequelize[_0xc9a2('0x6')]},'idField':{'type':Sequelize[_0xc9a2('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9a2('0x6')]}}; \ No newline at end of file +var _0x8ea2=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0xd056f7,_0xedbba9){var _0xbcb407=function(_0x137340){while(--_0x137340){_0xd056f7['push'](_0xd056f7['shift']());}};_0xbcb407(++_0xedbba9);}(_0x8ea2,0x15c));var _0x28ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x28ea('0x0'));module[_0x28ea('0x1')]={'type':{'type':Sequelize[_0x28ea('0x2')]('string',_0x28ea('0x3'),_0x28ea('0x4'),_0x28ea('0x5'),_0x28ea('0x6')),'defaultValue':_0x28ea('0x7')},'content':{'type':Sequelize[_0x28ea('0x8')]},'key':{'type':Sequelize[_0x28ea('0x8')]},'keyType':{'type':Sequelize[_0x28ea('0x2')](_0x28ea('0x7'),_0x28ea('0x3'),_0x28ea('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x28ea('0x8')]},'nameField':{'type':Sequelize[_0x28ea('0x8')]},'customField':{'type':Sequelize[_0x28ea('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28ea('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 13c4c66..02ff219 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 _0x3dff=['includeAll','include','ServicenowField','findAll','rows','show','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x3dff,0x13b));var _0xf3df=function(_0x168bb8,_0x2f16f9){_0x168bb8=_0x168bb8-0x0;var _0x48a84d=_0x3dff[_0x168bb8];return _0x48a84d;};'use strict';var emlformat=require(_0xf3df('0x0'));var rimraf=require(_0xf3df('0x1'));var zipdir=require(_0xf3df('0x2'));var jsonpatch=require(_0xf3df('0x3'));var rp=require(_0xf3df('0x4'));var moment=require(_0xf3df('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf3df('0x6'));var util=require(_0xf3df('0x7'));var path=require(_0xf3df('0x8'));var sox=require(_0xf3df('0x9'));var csv=require(_0xf3df('0xa'));var ejs=require(_0xf3df('0xb'));var fs=require('fs');var fs_extra=require(_0xf3df('0xc'));var _=require(_0xf3df('0xd'));var squel=require(_0xf3df('0xe'));var crypto=require(_0xf3df('0xf'));var jsforce=require(_0xf3df('0x10'));var deskjs=require(_0xf3df('0x11'));var toCsv=require(_0xf3df('0xa'));var querystring=require('querystring');var Papa=require(_0xf3df('0x12'));var Redis=require(_0xf3df('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf3df('0x14'));var as=require(_0xf3df('0x15'));var hardwareService=require(_0xf3df('0x16'));var logger=require(_0xf3df('0x17'))(_0xf3df('0x18'));var utils=require('../../config/utils');var config=require(_0xf3df('0x19'));var licenseUtil=require(_0xf3df('0x1a'));var db=require(_0xf3df('0x1b'))['db'];function respondWithStatusCode(_0x20c411,_0x282461){_0x282461=_0x282461||0xcc;return function(_0x52987f){if(_0x52987f){return _0x20c411['sendStatus'](_0x282461);}return _0x20c411[_0xf3df('0x1c')](_0x282461)[_0xf3df('0x1d')]();};}function respondWithResult(_0x44de4a,_0x56ba17){_0x56ba17=_0x56ba17||0xc8;return function(_0x57ac2b){if(_0x57ac2b){return _0x44de4a[_0xf3df('0x1c')](_0x56ba17)[_0xf3df('0x1e')](_0x57ac2b);}};}function respondWithFilteredResult(_0x404c64,_0x5f522b){return function(_0x353295){if(_0x353295){var _0x55da0a=typeof _0x5f522b[_0xf3df('0x1f')]==='undefined'&&typeof _0x5f522b[_0xf3df('0x20')]==='undefined';var _0x5077b1=_0x353295['count'];var _0x2a0d12=_0x55da0a?0x0:_0x5f522b['offset'];var _0x33e7e8=_0x55da0a?_0x353295[_0xf3df('0x21')]:_0x5f522b[_0xf3df('0x1f')]+_0x5f522b[_0xf3df('0x20')];var _0x57e962;if(_0x33e7e8>=_0x5077b1){_0x33e7e8=_0x5077b1;_0x57e962=0xc8;}else{_0x57e962=0xce;}_0x404c64[_0xf3df('0x1c')](_0x57e962);return _0x404c64[_0xf3df('0x22')](_0xf3df('0x23'),_0x2a0d12+'-'+_0x33e7e8+'/'+_0x5077b1)[_0xf3df('0x1e')](_0x353295);}return null;};}function patchUpdates(_0x532292){return function(_0x942a7e){try{jsonpatch[_0xf3df('0x24')](_0x942a7e,_0x532292,!![]);}catch(_0x2a6a22){return BPromise['reject'](_0x2a6a22);}return _0x942a7e['save']();};}function saveUpdates(_0xede337,_0x182846){return function(_0x45f218){if(_0x45f218){return _0x45f218[_0xf3df('0x25')](_0xede337)[_0xf3df('0x26')](function(_0x503ad4){return _0x503ad4;});}return null;};}function removeEntity(_0x102a1e,_0xbe2a9f){return function(_0x3bb6bd){if(_0x3bb6bd){return _0x3bb6bd[_0xf3df('0x27')]()[_0xf3df('0x26')](function(){_0x102a1e[_0xf3df('0x1c')](0xcc)[_0xf3df('0x1d')]();});}};}function handleEntityNotFound(_0x38ebc7,_0x131660){return function(_0x467654){if(!_0x467654){_0x38ebc7[_0xf3df('0x28')](0x194);}return _0x467654;};}function handleError(_0x272bef,_0x25f17a){_0x25f17a=_0x25f17a||0x1f4;return function(_0x1c2fd3){logger[_0xf3df('0x29')](_0x1c2fd3['stack']);if(_0x1c2fd3[_0xf3df('0x2a')]){delete _0x1c2fd3['name'];}_0x272bef['status'](_0x25f17a)['send'](_0x1c2fd3);};}exports[_0xf3df('0x2b')]=function(_0x5c94e3,_0x2296fb){var _0x417b59={},_0x1055b3={},_0x3f36ce={'count':0x0,'rows':[]};var _0x2e8b03=_['map'](db['ServicenowField'][_0xf3df('0x2c')],function(_0x287939){return{'name':_0x287939[_0xf3df('0x2d')],'type':_0x287939[_0xf3df('0x2e')][_0xf3df('0x2f')]};});_0x1055b3[_0xf3df('0x30')]=_[_0xf3df('0x31')](_0x2e8b03,_0xf3df('0x2a'));_0x1055b3[_0xf3df('0x32')]=_[_0xf3df('0x33')](_0x5c94e3[_0xf3df('0x32')]);_0x1055b3[_0xf3df('0x34')]=_[_0xf3df('0x35')](_0x1055b3[_0xf3df('0x30')],_0x1055b3[_0xf3df('0x32')]);_0x417b59['attributes']=_[_0xf3df('0x35')](_0x1055b3[_0xf3df('0x30')],qs['fields'](_0x5c94e3[_0xf3df('0x32')][_0xf3df('0x36')]));_0x417b59[_0xf3df('0x37')]=_0x417b59[_0xf3df('0x37')][_0xf3df('0x38')]?_0x417b59['attributes']:_0x1055b3['model'];if(!_0x5c94e3[_0xf3df('0x32')][_0xf3df('0x39')]('nolimit')){_0x417b59[_0xf3df('0x20')]=qs['limit'](_0x5c94e3[_0xf3df('0x32')]['limit']);_0x417b59['offset']=qs[_0xf3df('0x1f')](_0x5c94e3['query'][_0xf3df('0x1f')]);}_0x417b59[_0xf3df('0x3a')]=qs[_0xf3df('0x3b')](_0x5c94e3['query'][_0xf3df('0x3b')]);_0x417b59[_0xf3df('0x3c')]=qs['filters'](_['pick'](_0x5c94e3[_0xf3df('0x32')],_0x1055b3[_0xf3df('0x34')]),_0x2e8b03);if(_0x5c94e3['query'][_0xf3df('0x3d')]){_0x417b59[_0xf3df('0x3c')]=_[_0xf3df('0x3e')](_0x417b59['where'],{'$or':_['map'](_0x2e8b03,function(_0x4ebe69){if(_0x4ebe69[_0xf3df('0x2e')]!==_0xf3df('0x3f')){var _0x4aba67={};_0x4aba67[_0x4ebe69[_0xf3df('0x2a')]]={'$like':'%'+_0x5c94e3[_0xf3df('0x32')][_0xf3df('0x3d')]+'%'};return _0x4aba67;}})});}_0x417b59=_[_0xf3df('0x3e')]({},_0x417b59,_0x5c94e3[_0xf3df('0x40')]);var _0x31b2c1={'where':_0x417b59[_0xf3df('0x3c')]};return db['ServicenowField'][_0xf3df('0x21')](_0x31b2c1)['then'](function(_0x1091fe){_0x3f36ce[_0xf3df('0x21')]=_0x1091fe;if(_0x5c94e3['query'][_0xf3df('0x41')]){_0x417b59[_0xf3df('0x42')]=[{'all':!![]}];}return db[_0xf3df('0x43')][_0xf3df('0x44')](_0x417b59);})[_0xf3df('0x26')](function(_0x28fc7b){_0x3f36ce[_0xf3df('0x45')]=_0x28fc7b;return _0x3f36ce;})[_0xf3df('0x26')](respondWithFilteredResult(_0x2296fb,_0x417b59))['catch'](handleError(_0x2296fb,null));};exports[_0xf3df('0x46')]=function(_0x14cd14,_0x48c0f1){var _0x5f1171={'raw':!![],'where':{'id':_0x14cd14['params']['id']}},_0x3eff1a={};_0x3eff1a['model']=_[_0xf3df('0x33')](db[_0xf3df('0x43')][_0xf3df('0x2c')]);_0x3eff1a['query']=_[_0xf3df('0x33')](_0x14cd14[_0xf3df('0x32')]);_0x3eff1a[_0xf3df('0x34')]=_['intersection'](_0x3eff1a[_0xf3df('0x30')],_0x3eff1a[_0xf3df('0x32')]);_0x5f1171[_0xf3df('0x37')]=_[_0xf3df('0x35')](_0x3eff1a['model'],qs[_0xf3df('0x36')](_0x14cd14[_0xf3df('0x32')][_0xf3df('0x36')]));_0x5f1171[_0xf3df('0x37')]=_0x5f1171[_0xf3df('0x37')]['length']?_0x5f1171['attributes']:_0x3eff1a[_0xf3df('0x30')];if(_0x14cd14[_0xf3df('0x32')]['includeAll']){_0x5f1171[_0xf3df('0x42')]=[{'all':!![]}];}_0x5f1171=_[_0xf3df('0x3e')]({},_0x5f1171,_0x14cd14[_0xf3df('0x40')]);return db[_0xf3df('0x43')][_0xf3df('0x47')](_0x5f1171)[_0xf3df('0x26')](handleEntityNotFound(_0x48c0f1,null))['then'](respondWithResult(_0x48c0f1,null))['catch'](handleError(_0x48c0f1,null));};exports[_0xf3df('0x48')]=function(_0x363858,_0x57137b){return db['ServicenowField'][_0xf3df('0x48')](_0x363858[_0xf3df('0x49')],{})[_0xf3df('0x26')](respondWithResult(_0x57137b,0xc9))[_0xf3df('0x4a')](handleError(_0x57137b,null));};exports[_0xf3df('0x25')]=function(_0x4f3448,_0x214d5a){if(_0x4f3448[_0xf3df('0x49')]['id']){delete _0x4f3448[_0xf3df('0x49')]['id'];}return db[_0xf3df('0x43')][_0xf3df('0x47')]({'where':{'id':_0x4f3448[_0xf3df('0x4b')]['id']}})[_0xf3df('0x26')](handleEntityNotFound(_0x214d5a,null))[_0xf3df('0x26')](saveUpdates(_0x4f3448[_0xf3df('0x49')],null))[_0xf3df('0x26')](respondWithResult(_0x214d5a,null))[_0xf3df('0x4a')](handleError(_0x214d5a,null));};exports[_0xf3df('0x27')]=function(_0x2aee57,_0xf2b0ea){return db[_0xf3df('0x43')]['find']({'where':{'id':_0x2aee57[_0xf3df('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf2b0ea,null))[_0xf3df('0x26')](removeEntity(_0xf2b0ea,null))[_0xf3df('0x4a')](handleError(_0xf2b0ea,null));}; \ No newline at end of file +var _0x25d5=['count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowField','include','findAll','rows','catch','keys','fields','includeAll','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0xb845ee,_0x3f93c4){var _0x46ac01=function(_0x3cffa5){while(--_0x3cffa5){_0xb845ee['push'](_0xb845ee['shift']());}};_0x46ac01(++_0x3f93c4);}(_0x25d5,0x180));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x525d('0x0'));var rimraf=require(_0x525d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x525d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x525d('0x3'));var util=require('util');var path=require(_0x525d('0x4'));var sox=require('sox');var csv=require(_0x525d('0x5'));var ejs=require(_0x525d('0x6'));var fs=require('fs');var fs_extra=require(_0x525d('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x525d('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x525d('0x5'));var querystring=require(_0x525d('0x9'));var Papa=require(_0x525d('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x525d('0xb'));var as=require(_0x525d('0xc'));var hardwareService=require(_0x525d('0xd'));var logger=require(_0x525d('0xe'))(_0x525d('0xf'));var utils=require('../../config/utils');var config=require(_0x525d('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x525d('0x11'))['db'];function respondWithStatusCode(_0x2889b2,_0x44451a){_0x44451a=_0x44451a||0xcc;return function(_0x1b998c){if(_0x1b998c){return _0x2889b2['sendStatus'](_0x44451a);}return _0x2889b2[_0x525d('0x12')](_0x44451a)[_0x525d('0x13')]();};}function respondWithResult(_0x3e1c62,_0x41ce07){_0x41ce07=_0x41ce07||0xc8;return function(_0x5a6f0a){if(_0x5a6f0a){return _0x3e1c62[_0x525d('0x12')](_0x41ce07)[_0x525d('0x14')](_0x5a6f0a);}};}function respondWithFilteredResult(_0x28f7bc,_0x54962c){return function(_0x1c25d9){if(_0x1c25d9){var _0x40642e=typeof _0x54962c[_0x525d('0x15')]===_0x525d('0x16')&&typeof _0x54962c[_0x525d('0x17')]===_0x525d('0x16');var _0x585e20=_0x1c25d9[_0x525d('0x18')];var _0x42f037=_0x40642e?0x0:_0x54962c['offset'];var _0x3446cb=_0x40642e?_0x1c25d9[_0x525d('0x18')]:_0x54962c[_0x525d('0x15')]+_0x54962c[_0x525d('0x17')];var _0x39428e;if(_0x3446cb>=_0x585e20){_0x3446cb=_0x585e20;_0x39428e=0xc8;}else{_0x39428e=0xce;}_0x28f7bc[_0x525d('0x12')](_0x39428e);return _0x28f7bc[_0x525d('0x19')](_0x525d('0x1a'),_0x42f037+'-'+_0x3446cb+'/'+_0x585e20)[_0x525d('0x14')](_0x1c25d9);}return null;};}function patchUpdates(_0xc74355){return function(_0x4f56ae){try{jsonpatch[_0x525d('0x1b')](_0x4f56ae,_0xc74355,!![]);}catch(_0x5e9410){return BPromise[_0x525d('0x1c')](_0x5e9410);}return _0x4f56ae[_0x525d('0x1d')]();};}function saveUpdates(_0x907c03,_0x3626cf){return function(_0x4e7aea){if(_0x4e7aea){return _0x4e7aea[_0x525d('0x1e')](_0x907c03)[_0x525d('0x1f')](function(_0x37423a){return _0x37423a;});}return null;};}function removeEntity(_0x20dd9b,_0x360281){return function(_0x26cee9){if(_0x26cee9){return _0x26cee9['destroy']()[_0x525d('0x1f')](function(){_0x20dd9b['status'](0xcc)[_0x525d('0x13')]();});}};}function handleEntityNotFound(_0x571fb9,_0x2f3506){return function(_0x47293d){if(!_0x47293d){_0x571fb9[_0x525d('0x20')](0x194);}return _0x47293d;};}function handleError(_0x50e1cf,_0x5d3406){_0x5d3406=_0x5d3406||0x1f4;return function(_0x49d7b9){logger['error'](_0x49d7b9[_0x525d('0x21')]);if(_0x49d7b9[_0x525d('0x22')]){delete _0x49d7b9[_0x525d('0x22')];}_0x50e1cf[_0x525d('0x12')](_0x5d3406)['send'](_0x49d7b9);};}exports[_0x525d('0x23')]=function(_0x29a74c,_0x12fbab){var _0x511184={},_0x3e8755={},_0x52cabf={'count':0x0,'rows':[]};var _0x1b9dad=_['map'](db['ServicenowField'][_0x525d('0x24')],function(_0x39c921){return{'name':_0x39c921['fieldName'],'type':_0x39c921[_0x525d('0x25')][_0x525d('0x26')]};});_0x3e8755[_0x525d('0x27')]=_[_0x525d('0x28')](_0x1b9dad,'name');_0x3e8755[_0x525d('0x29')]=_['keys'](_0x29a74c[_0x525d('0x29')]);_0x3e8755[_0x525d('0x2a')]=_[_0x525d('0x2b')](_0x3e8755[_0x525d('0x27')],_0x3e8755[_0x525d('0x29')]);_0x511184[_0x525d('0x2c')]=_[_0x525d('0x2b')](_0x3e8755[_0x525d('0x27')],qs['fields'](_0x29a74c[_0x525d('0x29')]['fields']));_0x511184[_0x525d('0x2c')]=_0x511184[_0x525d('0x2c')][_0x525d('0x2d')]?_0x511184[_0x525d('0x2c')]:_0x3e8755[_0x525d('0x27')];if(!_0x29a74c[_0x525d('0x29')][_0x525d('0x2e')]('nolimit')){_0x511184[_0x525d('0x17')]=qs[_0x525d('0x17')](_0x29a74c['query'][_0x525d('0x17')]);_0x511184[_0x525d('0x15')]=qs[_0x525d('0x15')](_0x29a74c[_0x525d('0x29')]['offset']);}_0x511184[_0x525d('0x2f')]=qs[_0x525d('0x30')](_0x29a74c['query'][_0x525d('0x30')]);_0x511184[_0x525d('0x31')]=qs[_0x525d('0x2a')](_[_0x525d('0x32')](_0x29a74c[_0x525d('0x29')],_0x3e8755[_0x525d('0x2a')]),_0x1b9dad);if(_0x29a74c['query'][_0x525d('0x33')]){_0x511184[_0x525d('0x31')]=_[_0x525d('0x34')](_0x511184[_0x525d('0x31')],{'$or':_[_0x525d('0x28')](_0x1b9dad,function(_0x4588d5){if(_0x4588d5['type']!==_0x525d('0x35')){var _0x50406c={};_0x50406c[_0x4588d5[_0x525d('0x22')]]={'$like':'%'+_0x29a74c[_0x525d('0x29')][_0x525d('0x33')]+'%'};return _0x50406c;}})});}_0x511184=_[_0x525d('0x34')]({},_0x511184,_0x29a74c[_0x525d('0x36')]);var _0x5c9d5f={'where':_0x511184[_0x525d('0x31')]};return db[_0x525d('0x37')][_0x525d('0x18')](_0x5c9d5f)[_0x525d('0x1f')](function(_0x4e33be){_0x52cabf[_0x525d('0x18')]=_0x4e33be;if(_0x29a74c[_0x525d('0x29')]['includeAll']){_0x511184[_0x525d('0x38')]=[{'all':!![]}];}return db[_0x525d('0x37')][_0x525d('0x39')](_0x511184);})[_0x525d('0x1f')](function(_0x4d855d){_0x52cabf[_0x525d('0x3a')]=_0x4d855d;return _0x52cabf;})[_0x525d('0x1f')](respondWithFilteredResult(_0x12fbab,_0x511184))[_0x525d('0x3b')](handleError(_0x12fbab,null));};exports['show']=function(_0xd8e1ef,_0x294470){var _0x2f8609={'raw':!![],'where':{'id':_0xd8e1ef['params']['id']}},_0x1983bc={};_0x1983bc[_0x525d('0x27')]=_[_0x525d('0x3c')](db[_0x525d('0x37')][_0x525d('0x24')]);_0x1983bc[_0x525d('0x29')]=_['keys'](_0xd8e1ef[_0x525d('0x29')]);_0x1983bc[_0x525d('0x2a')]=_[_0x525d('0x2b')](_0x1983bc['model'],_0x1983bc[_0x525d('0x29')]);_0x2f8609[_0x525d('0x2c')]=_[_0x525d('0x2b')](_0x1983bc[_0x525d('0x27')],qs[_0x525d('0x3d')](_0xd8e1ef[_0x525d('0x29')][_0x525d('0x3d')]));_0x2f8609[_0x525d('0x2c')]=_0x2f8609[_0x525d('0x2c')][_0x525d('0x2d')]?_0x2f8609[_0x525d('0x2c')]:_0x1983bc[_0x525d('0x27')];if(_0xd8e1ef[_0x525d('0x29')][_0x525d('0x3e')]){_0x2f8609[_0x525d('0x38')]=[{'all':!![]}];}_0x2f8609=_['merge']({},_0x2f8609,_0xd8e1ef[_0x525d('0x36')]);return db[_0x525d('0x37')][_0x525d('0x3f')](_0x2f8609)[_0x525d('0x1f')](handleEntityNotFound(_0x294470,null))[_0x525d('0x1f')](respondWithResult(_0x294470,null))['catch'](handleError(_0x294470,null));};exports[_0x525d('0x40')]=function(_0x159fab,_0xd007dc){return db['ServicenowField']['create'](_0x159fab[_0x525d('0x41')],{})[_0x525d('0x1f')](respondWithResult(_0xd007dc,0xc9))['catch'](handleError(_0xd007dc,null));};exports[_0x525d('0x1e')]=function(_0x349d22,_0x43db38){if(_0x349d22[_0x525d('0x41')]['id']){delete _0x349d22[_0x525d('0x41')]['id'];}return db[_0x525d('0x37')][_0x525d('0x3f')]({'where':{'id':_0x349d22[_0x525d('0x42')]['id']}})[_0x525d('0x1f')](handleEntityNotFound(_0x43db38,null))['then'](saveUpdates(_0x349d22[_0x525d('0x41')],null))[_0x525d('0x1f')](respondWithResult(_0x43db38,null))[_0x525d('0x3b')](handleError(_0x43db38,null));};exports[_0x525d('0x43')]=function(_0x54f9cd,_0x351648){return db[_0x525d('0x37')][_0x525d('0x3f')]({'where':{'id':_0x54f9cd[_0x525d('0x42')]['id']}})[_0x525d('0x1f')](handleEntityNotFound(_0x351648,null))[_0x525d('0x1f')](removeEntity(_0x351648,null))[_0x525d('0x3b')](handleError(_0x351648,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 2c9f76b..bb375c8 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 _0x904c=['./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x904c,0xd9));var _0xc904=function(_0x2398b4,_0x117cbd){_0x2398b4=_0x2398b4-0x0;var _0x3457fd=_0x904c[_0x2398b4];return _0x3457fd;};'use strict';var _=require(_0xc904('0x0'));var util=require(_0xc904('0x1'));var logger=require(_0xc904('0x2'))(_0xc904('0x3'));var moment=require(_0xc904('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc904('0x5'));var rimraf=require(_0xc904('0x6'));var config=require(_0xc904('0x7'));var attributes=require(_0xc904('0x8'));module[_0xc904('0x9')]=function(_0x579ceb,_0x31c0a9){return _0x579ceb[_0xc904('0xa')](_0xc904('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc904('0xc'),'fields':[_0xc904('0xd'),_0xc904('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d5f=['servicenow_unique_index','idField','FieldId','util','api','moment','request-promise','path','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x4a4e05,_0x2cdd51){var _0x29c2ac=function(_0x2ca696){while(--_0x2ca696){_0x4a4e05['push'](_0x4a4e05['shift']());}};_0x29c2ac(++_0x2cdd51);}(_0x8d5f,0xe7));var _0xf8d5=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x8d5f[_0x1b92a6];return _0x24be5b;};'use strict';var _=require('lodash');var util=require(_0xf8d5('0x0'));var logger=require('../../config/logger')(_0xf8d5('0x1'));var moment=require(_0xf8d5('0x2'));var BPromise=require('bluebird');var rp=require(_0xf8d5('0x3'));var fs=require('fs');var path=require(_0xf8d5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xf8d5('0x5')]=function(_0x167856,_0x59300b){return _0x167856[_0xf8d5('0x6')](_0xf8d5('0x7'),attributes,{'tableName':_0xf8d5('0x8'),'paranoid':![],'indexes':[{'name':_0xf8d5('0x9'),'fields':[_0xf8d5('0xa'),_0xf8d5('0xb')],'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 319c34c..38541b7 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(_0x2478ad,_0x1cc494){var _0xfcbc6f=function(_0x40f0a1){while(--_0x40f0a1){_0x2478ad['push'](_0x2478ad['shift']());}};_0xfcbc6f(++_0x1cc494);}(_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(_0x32453c,_0x5558d2){var _0x1cda7a=function(_0x4c61e1){while(--_0x4c61e1){_0x32453c['push'](_0x32453c['shift']());}};_0x1cda7a(++_0x5558d2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4ae6f5,_0x30d0c6){_0x4ae6f5=_0x4ae6f5-0x0;var _0x155541=_0xb43b[_0x4ae6f5];return _0x155541;};'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 1bc7d20..85af45b 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x189de8,_0x4c8c4a){var _0x3cafdb=function(_0x1d1fbf){while(--_0x1d1fbf){_0x189de8['push'](_0x189de8['shift']());}};_0x3cafdb(++_0x4c8c4a);}(_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['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xc9764e,_0x50ffae){var _0x188b39=function(_0x508f14){while(--_0x508f14){_0xc9764e['push'](_0xc9764e['shift']());}};_0x188b39(++_0x50ffae);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index eee9b28..d6fdeb7 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(_0x35b0ae,_0x18a193){var _0x10e39b=function(_0xca256e){while(--_0xca256e){_0x35b0ae['push'](_0x35b0ae['shift']());}};_0x10e39b(++_0x18a193);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x440ae1,_0x47c816){var _0xb5da8=function(_0x31e619){while(--_0x31e619){_0x440ae1['push'](_0x440ae1['shift']());}};_0xb5da8(++_0x47c816);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 9676f8e..5403de9 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 _0x643d=['error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','length','create','body','find','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x643d,0xc8));var _0xd643=function(_0x1aea09,_0x4f5b1b){_0x1aea09=_0x1aea09-0x0;var _0x456b43=_0x643d[_0x1aea09];return _0x456b43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd643('0x0'));var jsonpatch=require(_0xd643('0x1'));var rp=require(_0xd643('0x2'));var moment=require(_0xd643('0x3'));var BPromise=require(_0xd643('0x4'));var Mustache=require(_0xd643('0x5'));var util=require(_0xd643('0x6'));var path=require(_0xd643('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd643('0x8'));var fs=require('fs');var fs_extra=require(_0xd643('0x9'));var _=require('lodash');var squel=require(_0xd643('0xa'));var crypto=require('crypto');var jsforce=require(_0xd643('0xb'));var deskjs=require(_0xd643('0xc'));var toCsv=require(_0xd643('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd643('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd643('0xf'));var as=require(_0xd643('0x10'));var hardwareService=require(_0xd643('0x11'));var logger=require(_0xd643('0x12'))(_0xd643('0x13'));var utils=require('../../config/utils');var config=require(_0xd643('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd643('0x15'));function respondWithStatusCode(_0x1d2c82,_0x176002){_0x176002=_0x176002||0xcc;return function(_0x3fe65e){if(_0x3fe65e){return _0x1d2c82[_0xd643('0x16')](_0x176002);}return _0x1d2c82[_0xd643('0x17')](_0x176002)['end']();};}function respondWithResult(_0x204bdd,_0x3955c1){_0x3955c1=_0x3955c1||0xc8;return function(_0x2cdb7f){if(_0x2cdb7f){return _0x204bdd['status'](_0x3955c1)[_0xd643('0x18')](_0x2cdb7f);}};}function respondWithFilteredResult(_0x575234,_0x12e433){return function(_0x2746d2){if(_0x2746d2){var _0x14cccb=typeof _0x12e433[_0xd643('0x19')]===_0xd643('0x1a')&&typeof _0x12e433[_0xd643('0x1b')]===_0xd643('0x1a');var _0x4ca91b=_0x2746d2[_0xd643('0x1c')];var _0x380aad=_0x14cccb?0x0:_0x12e433[_0xd643('0x19')];var _0x2456c0=_0x14cccb?_0x2746d2[_0xd643('0x1c')]:_0x12e433[_0xd643('0x19')]+_0x12e433['limit'];var _0xf6421;if(_0x2456c0>=_0x4ca91b){_0x2456c0=_0x4ca91b;_0xf6421=0xc8;}else{_0xf6421=0xce;}_0x575234[_0xd643('0x17')](_0xf6421);return _0x575234[_0xd643('0x1d')](_0xd643('0x1e'),_0x380aad+'-'+_0x2456c0+'/'+_0x4ca91b)[_0xd643('0x18')](_0x2746d2);}return null;};}function patchUpdates(_0x92eb37){return function(_0x5d674b){try{jsonpatch[_0xd643('0x1f')](_0x5d674b,_0x92eb37,!![]);}catch(_0x25b8c4){return BPromise[_0xd643('0x20')](_0x25b8c4);}return _0x5d674b[_0xd643('0x21')]();};}function saveUpdates(_0x561b2a,_0x283072){return function(_0x5d0dac){if(_0x5d0dac){return _0x5d0dac[_0xd643('0x22')](_0x561b2a)[_0xd643('0x23')](function(_0x238ca6){return _0x238ca6;});}return null;};}function removeEntity(_0x1921fa,_0x2e8351){return function(_0xfd0a36){if(_0xfd0a36){return _0xfd0a36[_0xd643('0x24')]()[_0xd643('0x23')](function(){_0x1921fa['status'](0xcc)[_0xd643('0x25')]();});}};}function handleEntityNotFound(_0x16320b,_0x46b265){return function(_0x3472cd){if(!_0x3472cd){_0x16320b[_0xd643('0x16')](0x194);}return _0x3472cd;};}function handleError(_0x516ae8,_0x44a285){_0x44a285=_0x44a285||0x1f4;return function(_0x3dcee9){logger[_0xd643('0x26')](_0x3dcee9['stack']);if(_0x3dcee9[_0xd643('0x27')]){delete _0x3dcee9[_0xd643('0x27')];}_0x516ae8[_0xd643('0x17')](_0x44a285)[_0xd643('0x28')](_0x3dcee9);};}exports[_0xd643('0x29')]=function(_0x4288a6,_0x3351c6){var _0x5ca4bb={},_0x3a211c={},_0x1d7e64={'count':0x0,'rows':[]};var _0x38f175=_[_0xd643('0x2a')](db[_0xd643('0x2b')][_0xd643('0x2c')],function(_0x4034ad){return{'name':_0x4034ad[_0xd643('0x2d')],'type':_0x4034ad[_0xd643('0x2e')][_0xd643('0x2f')]};});_0x3a211c[_0xd643('0x30')]=_[_0xd643('0x2a')](_0x38f175,_0xd643('0x27'));_0x3a211c[_0xd643('0x31')]=_[_0xd643('0x32')](_0x4288a6[_0xd643('0x31')]);_0x3a211c['filters']=_[_0xd643('0x33')](_0x3a211c[_0xd643('0x30')],_0x3a211c['query']);_0x5ca4bb[_0xd643('0x34')]=_[_0xd643('0x33')](_0x3a211c[_0xd643('0x30')],qs['fields'](_0x4288a6['query'][_0xd643('0x35')]));_0x5ca4bb[_0xd643('0x34')]=_0x5ca4bb[_0xd643('0x34')]['length']?_0x5ca4bb[_0xd643('0x34')]:_0x3a211c[_0xd643('0x30')];if(!_0x4288a6[_0xd643('0x31')]['hasOwnProperty'](_0xd643('0x36'))){_0x5ca4bb[_0xd643('0x1b')]=qs['limit'](_0x4288a6[_0xd643('0x31')][_0xd643('0x1b')]);_0x5ca4bb[_0xd643('0x19')]=qs[_0xd643('0x19')](_0x4288a6['query'][_0xd643('0x19')]);}_0x5ca4bb[_0xd643('0x37')]=qs[_0xd643('0x38')](_0x4288a6[_0xd643('0x31')][_0xd643('0x38')]);_0x5ca4bb[_0xd643('0x39')]=qs[_0xd643('0x3a')](_[_0xd643('0x3b')](_0x4288a6['query'],_0x3a211c[_0xd643('0x3a')]),_0x38f175);if(_0x4288a6[_0xd643('0x31')][_0xd643('0x3c')]){_0x5ca4bb['where']=_[_0xd643('0x3d')](_0x5ca4bb[_0xd643('0x39')],{'$or':_['map'](_0x38f175,function(_0x2515e9){if(_0x2515e9[_0xd643('0x2e')]!==_0xd643('0x3e')){var _0x45a542={};_0x45a542[_0x2515e9[_0xd643('0x27')]]={'$like':'%'+_0x4288a6[_0xd643('0x31')][_0xd643('0x3c')]+'%'};return _0x45a542;}})});}_0x5ca4bb=_[_0xd643('0x3d')]({},_0x5ca4bb,_0x4288a6[_0xd643('0x3f')]);var _0x2b4634={'where':_0x5ca4bb[_0xd643('0x39')]};return db[_0xd643('0x2b')][_0xd643('0x1c')](_0x2b4634)[_0xd643('0x23')](function(_0x20c934){_0x1d7e64[_0xd643('0x1c')]=_0x20c934;if(_0x4288a6[_0xd643('0x31')][_0xd643('0x40')]){_0x5ca4bb['include']=[{'all':!![]}];}return db[_0xd643('0x2b')][_0xd643('0x41')](_0x5ca4bb);})[_0xd643('0x23')](function(_0x5ca038){_0x1d7e64['rows']=_0x5ca038;return _0x1d7e64;})[_0xd643('0x23')](respondWithFilteredResult(_0x3351c6,_0x5ca4bb))[_0xd643('0x42')](handleError(_0x3351c6,null));};exports['show']=function(_0x247aba,_0x1c6c42){var _0x5690b2={'raw':![],'where':{'id':_0x247aba[_0xd643('0x43')]['id']}},_0x38baec={};_0x38baec[_0xd643('0x30')]=_[_0xd643('0x32')](db['SugarcrmAccount'][_0xd643('0x2c')]);_0x38baec[_0xd643('0x31')]=_[_0xd643('0x32')](_0x247aba[_0xd643('0x31')]);_0x38baec[_0xd643('0x3a')]=_[_0xd643('0x33')](_0x38baec[_0xd643('0x30')],_0x38baec[_0xd643('0x31')]);_0x5690b2[_0xd643('0x34')]=_['intersection'](_0x38baec[_0xd643('0x30')],qs[_0xd643('0x35')](_0x247aba[_0xd643('0x31')][_0xd643('0x35')]));_0x5690b2[_0xd643('0x34')]=_0x5690b2[_0xd643('0x34')][_0xd643('0x44')]?_0x5690b2['attributes']:_0x38baec[_0xd643('0x30')];if(_0x247aba[_0xd643('0x31')][_0xd643('0x40')]){_0x5690b2['include']=[{'all':!![]}];}_0x5690b2=_[_0xd643('0x3d')]({},_0x5690b2,_0x247aba[_0xd643('0x3f')]);return db[_0xd643('0x2b')]['find'](_0x5690b2)[_0xd643('0x23')](handleEntityNotFound(_0x1c6c42,null))['then'](respondWithResult(_0x1c6c42,null))[_0xd643('0x42')](handleError(_0x1c6c42,null));};exports[_0xd643('0x45')]=function(_0x2f1b97,_0x87b6a2){return db[_0xd643('0x2b')][_0xd643('0x45')](_0x2f1b97[_0xd643('0x46')],{})[_0xd643('0x23')](respondWithResult(_0x87b6a2,0xc9))[_0xd643('0x42')](handleError(_0x87b6a2,null));};exports[_0xd643('0x22')]=function(_0x3befa7,_0x3c54bf){if(_0x3befa7['body']['id']){delete _0x3befa7[_0xd643('0x46')]['id'];}return db[_0xd643('0x2b')]['find']({'where':{'id':_0x3befa7[_0xd643('0x43')]['id']}})[_0xd643('0x23')](handleEntityNotFound(_0x3c54bf,null))[_0xd643('0x23')](saveUpdates(_0x3befa7['body'],null))['then'](respondWithResult(_0x3c54bf,null))[_0xd643('0x42')](handleError(_0x3c54bf,null));};exports[_0xd643('0x24')]=function(_0x39c87c,_0x4c2a85){return db[_0xd643('0x2b')][_0xd643('0x47')]({'where':{'id':_0x39c87c[_0xd643('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c2a85,null))['then'](removeEntity(_0x4c2a85,null))[_0xd643('0x42')](handleError(_0x4c2a85,null));};exports[_0xd643('0x48')]=function(_0x57b247,_0x1fe029,_0x4a65e4){var _0x2353e3={};var _0x1c9c37={};var _0x52b758;var _0xb64312;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x57b247['params']['id']}})[_0xd643('0x23')](handleEntityNotFound(_0x1fe029,null))['then'](function(_0x5e185a){if(_0x5e185a){_0x52b758=_0x5e185a;_0x1c9c37[_0xd643('0x30')]=_[_0xd643('0x32')](db['SugarcrmConfiguration'][_0xd643('0x2c')]);_0x1c9c37[_0xd643('0x31')]=_['keys'](_0x57b247[_0xd643('0x31')]);_0x1c9c37[_0xd643('0x3a')]=_['intersection'](_0x1c9c37[_0xd643('0x30')],_0x1c9c37[_0xd643('0x31')]);_0x2353e3[_0xd643('0x34')]=_[_0xd643('0x33')](_0x1c9c37[_0xd643('0x30')],qs[_0xd643('0x35')](_0x57b247[_0xd643('0x31')]['fields']));_0x2353e3[_0xd643('0x34')]=_0x2353e3[_0xd643('0x34')]['length']?_0x2353e3['attributes']:_0x1c9c37['model'];_0x2353e3[_0xd643('0x37')]=qs['sort'](_0x57b247[_0xd643('0x31')][_0xd643('0x38')]);_0x2353e3[_0xd643('0x39')]=qs['filters'](_[_0xd643('0x3b')](_0x57b247[_0xd643('0x31')],_0x1c9c37[_0xd643('0x3a')]));if(_0x57b247[_0xd643('0x31')][_0xd643('0x3c')]){_0x2353e3[_0xd643('0x39')]=_[_0xd643('0x3d')](_0x2353e3['where'],{'$or':_['map'](_0x2353e3['attributes'],function(_0x14ebf2){var _0xca614a={};_0xca614a[_0x14ebf2]={'$like':'%'+_0x57b247[_0xd643('0x31')][_0xd643('0x3c')]+'%'};return _0xca614a;})});}_0x2353e3=_[_0xd643('0x3d')]({},_0x2353e3,_0x57b247[_0xd643('0x3f')]);return _0x52b758[_0xd643('0x48')](_0x2353e3);}})['then'](function(_0x250cef){if(_0x250cef){_0xb64312=_0x250cef['length'];if(!_0x57b247['query'][_0xd643('0x49')](_0xd643('0x36'))){_0x2353e3[_0xd643('0x1b')]=qs[_0xd643('0x1b')](_0x57b247[_0xd643('0x31')]['limit']);_0x2353e3['offset']=qs[_0xd643('0x19')](_0x57b247['query'][_0xd643('0x19')]);}return _0x52b758[_0xd643('0x48')](_0x2353e3);}})[_0xd643('0x23')](function(_0xcaee08){if(_0xcaee08){return _0xcaee08?{'count':_0xb64312,'rows':_0xcaee08}:null;}})[_0xd643('0x23')](respondWithResult(_0x1fe029,null))[_0xd643('0x42')](handleError(_0x1fe029,null));};exports[_0xd643('0x4a')]=function(_0x44c39e,_0xe721d0,_0x55d131){if(_0x44c39e[_0xd643('0x46')]['id']){delete _0x44c39e['body']['id'];}return db[_0xd643('0x2b')]['findOne']({'where':{'id':_0x44c39e[_0xd643('0x43')]['id']}})[_0xd643('0x23')](handleEntityNotFound(_0xe721d0,null))[_0xd643('0x23')](function(_0x257cfb){if(_0x257cfb){_0x44c39e[_0xd643('0x46')][_0xd643('0x4b')]=_0x257cfb['id'];_0x44c39e[_0xd643('0x46')][_0xd643('0x4c')]=integrations[_0xd643('0x4d')](_0x44c39e[_0xd643('0x46')][_0xd643('0x4e')],_0x44c39e[_0xd643('0x46')][_0xd643('0x2e')]);_0x44c39e['body'][_0xd643('0x4f')]=integrations[_0xd643('0x50')](_0x44c39e[_0xd643('0x46')][_0xd643('0x4e')],_0x44c39e[_0xd643('0x46')]['type']);return db[_0xd643('0x51')][_0xd643('0x45')](_0x44c39e[_0xd643('0x46')],{'include':[{'model':db[_0xd643('0x52')],'as':_0xd643('0x4c')},{'model':db[_0xd643('0x52')],'as':'Descriptions'}]});}return null;})[_0xd643('0x23')](respondWithResult(_0xe721d0,null))[_0xd643('0x42')](handleError(_0xe721d0,null));};exports[_0xd643('0x53')]=function(_0x499f88,_0x2b3a7f,_0x390ca6){var _0x1db8be='';var _0x3163eb=['id',_0xd643('0x27'),'assigned_user_id',_0xd643('0x54'),'description',_0xd643('0x55'),_0xd643('0x56'),_0xd643('0x57'),_0xd643('0x58'),_0xd643('0x59'),_0xd643('0x5a'),_0xd643('0x5b')];return db[_0xd643('0x2b')]['findOne']({'where':{'id':_0x499f88[_0xd643('0x43')]['id']},'attributes':['id',_0xd643('0x5c'),'password',_0xd643('0x5d')]})[_0xd643('0x23')](handleEntityNotFound(_0x2b3a7f,null))['then'](function(_0x32851c){if(_0x32851c){_0x1db8be=_0x32851c[_0xd643('0x5d')];var _0x42bc20=_0x1db8be[_0xd643('0x5e')](-0x1);if(_0x42bc20==='/'){_0x1db8be=_0x1db8be[_0xd643('0x5f')](0x0,_0x1db8be['lastIndexOf'](_0x42bc20));}return rp({'method':'POST','uri':util[_0xd643('0x60')](_0xd643('0x61'),_0x1db8be,_0xd643('0x62')),'json':!![],'form':{'method':'login','input_type':_0xd643('0x63'),'response_type':_0xd643('0x63'),'rest_data':JSON[_0xd643('0x64')]({'user_auth':{'user_name':_0x32851c[_0xd643('0x5c')],'password':_0x32851c[_0xd643('0x65')],'encryption':_0xd643('0x66')},'application':_0xd643('0x67')})}});}})[_0xd643('0x23')](function(_0x5ecc37){if(_0x5ecc37&&_0x5ecc37[_0xd643('0x27')]!==_0xd643('0x68')&&_0x5ecc37['name']!==_0xd643('0x69')){return rp({'method':_0xd643('0x6a'),'uri':util[_0xd643('0x60')](_0xd643('0x61'),_0x1db8be,_0xd643('0x62')),'json':!![],'form':{'method':_0xd643('0x6b'),'input_type':_0xd643('0x63'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5ecc37['id'],'module_name':_0xd643('0x6c')})}})[_0xd643('0x23')](function(_0x7abe73){if(_0x7abe73){var _0xe8a772=_[_0xd643('0x6d')](_0x7abe73[_0xd643('0x6e')]);_[_0xd643('0x6f')](_0xe8a772,function(_0x1d9cde){return _0x3163eb[_0xd643('0x70')](_0x1d9cde[_0xd643('0x27')]);});return{'count':_0xe8a772[_0xd643('0x44')],'rows':_['map'](_0xe8a772,function(_0x8865dd){return{'id':_0x8865dd['name'],'name':_0x8865dd['label'],'custom':_[_0xd643('0x71')](_0x8865dd['name'],'_c')?!![]:![],'options':_0x8865dd[_0xd643('0x3f')]?_['map'](_[_0xd643('0x6d')](_0x8865dd['options']),function(_0x1ad210){return{'name':_0x1ad210[_0xd643('0x72')],'value':_0x1ad210[_0xd643('0x27')]};}):[]};})};}})['then'](respondWithResult(_0x2b3a7f,null))[_0xd643('0x42')](function(_0x5c16c7){var _0x2ddf81=_0x499f88['query'][_0xd643('0x73')]?0x1f4:_0x5c16c7['statusCode']||0x1f4;logger['error'](_0xd643('0x74'),_0xd643('0x53'),_0x2ddf81,JSON['stringify'](_0x5c16c7));delete _0x5c16c7[_0xd643('0x27')];if(_0x2ddf81===0x191){_0x2ddf81=0x190;}_0x2b3a7f[_0xd643('0x17')](_0x2ddf81)['send'](_0x499f88['query'][_0xd643('0x73')]?{'message':_0xd643('0x75'),'statusCode':_0x5c16c7[_0xd643('0x76')]}:_0x5c16c7);});}else{var _0x13ded2=0x1f4;_0x2b3a7f[_0xd643('0x17')](_0x13ded2)[_0xd643('0x28')]({'message':_0xd643('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xee0f=['%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','rawAttributes','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format'];(function(_0x181b1e,_0x160c56){var _0x1ad7bf=function(_0x59cae9){while(--_0x59cae9){_0x181b1e['push'](_0x181b1e['shift']());}};_0x1ad7bf(++_0x160c56);}(_0xee0f,0x103));var _0xfee0=function(_0x45b2ac,_0x3010da){_0x45b2ac=_0x45b2ac-0x0;var _0x304bf3=_0xee0f[_0x45b2ac];return _0x304bf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfee0('0x0'));var zipdir=require(_0xfee0('0x1'));var jsonpatch=require(_0xfee0('0x2'));var rp=require(_0xfee0('0x3'));var moment=require('moment');var BPromise=require(_0xfee0('0x4'));var Mustache=require(_0xfee0('0x5'));var util=require(_0xfee0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfee0('0x7'));var ejs=require(_0xfee0('0x8'));var fs=require('fs');var fs_extra=require(_0xfee0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfee0('0xa'));var jsforce=require(_0xfee0('0xb'));var deskjs=require(_0xfee0('0xc'));var toCsv=require(_0xfee0('0x7'));var querystring=require(_0xfee0('0xd'));var Papa=require(_0xfee0('0xe'));var Redis=require(_0xfee0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfee0('0x10'));var as=require(_0xfee0('0x11'));var hardwareService=require(_0xfee0('0x12'));var logger=require(_0xfee0('0x13'))(_0xfee0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfee0('0x15'));var db=require(_0xfee0('0x16'))['db'];var integrations=require(_0xfee0('0x17'));function respondWithStatusCode(_0x341f12,_0x1027a0){_0x1027a0=_0x1027a0||0xcc;return function(_0x26697f){if(_0x26697f){return _0x341f12['sendStatus'](_0x1027a0);}return _0x341f12[_0xfee0('0x18')](_0x1027a0)[_0xfee0('0x19')]();};}function respondWithResult(_0x45b26d,_0x1baa77){_0x1baa77=_0x1baa77||0xc8;return function(_0xb9c387){if(_0xb9c387){return _0x45b26d[_0xfee0('0x18')](_0x1baa77)[_0xfee0('0x1a')](_0xb9c387);}};}function respondWithFilteredResult(_0x4958d2,_0x25e7b3){return function(_0x2cd586){if(_0x2cd586){var _0x595b01=typeof _0x25e7b3[_0xfee0('0x1b')]===_0xfee0('0x1c')&&typeof _0x25e7b3[_0xfee0('0x1d')]===_0xfee0('0x1c');var _0x2ae956=_0x2cd586[_0xfee0('0x1e')];var _0x439555=_0x595b01?0x0:_0x25e7b3['offset'];var _0xd4ee5a=_0x595b01?_0x2cd586[_0xfee0('0x1e')]:_0x25e7b3['offset']+_0x25e7b3[_0xfee0('0x1d')];var _0x323298;if(_0xd4ee5a>=_0x2ae956){_0xd4ee5a=_0x2ae956;_0x323298=0xc8;}else{_0x323298=0xce;}_0x4958d2['status'](_0x323298);return _0x4958d2['set'](_0xfee0('0x1f'),_0x439555+'-'+_0xd4ee5a+'/'+_0x2ae956)['json'](_0x2cd586);}return null;};}function patchUpdates(_0x4e0271){return function(_0x1053a3){try{jsonpatch[_0xfee0('0x20')](_0x1053a3,_0x4e0271,!![]);}catch(_0x2644d9){return BPromise['reject'](_0x2644d9);}return _0x1053a3[_0xfee0('0x21')]();};}function saveUpdates(_0x1d1cb3,_0x595c6b){return function(_0x2e6fc6){if(_0x2e6fc6){return _0x2e6fc6[_0xfee0('0x22')](_0x1d1cb3)['then'](function(_0x3195f1){return _0x3195f1;});}return null;};}function removeEntity(_0x229c20,_0x3e827a){return function(_0x1cd382){if(_0x1cd382){return _0x1cd382[_0xfee0('0x23')]()[_0xfee0('0x24')](function(){_0x229c20[_0xfee0('0x18')](0xcc)[_0xfee0('0x19')]();});}};}function handleEntityNotFound(_0x2ff4d8,_0x7bdc76){return function(_0x566962){if(!_0x566962){_0x2ff4d8[_0xfee0('0x25')](0x194);}return _0x566962;};}function handleError(_0x17b5b1,_0xd4a5da){_0xd4a5da=_0xd4a5da||0x1f4;return function(_0x3e9d9c){logger[_0xfee0('0x26')](_0x3e9d9c['stack']);if(_0x3e9d9c['name']){delete _0x3e9d9c[_0xfee0('0x27')];}_0x17b5b1[_0xfee0('0x18')](_0xd4a5da)[_0xfee0('0x28')](_0x3e9d9c);};}exports[_0xfee0('0x29')]=function(_0x34570d,_0x78445f){var _0x1950f3={},_0x2d8cde={},_0x40a9da={'count':0x0,'rows':[]};var _0x1168ac=_[_0xfee0('0x2a')](db[_0xfee0('0x2b')]['rawAttributes'],function(_0x56504c){return{'name':_0x56504c[_0xfee0('0x2c')],'type':_0x56504c[_0xfee0('0x2d')][_0xfee0('0x2e')]};});_0x2d8cde[_0xfee0('0x2f')]=_['map'](_0x1168ac,_0xfee0('0x27'));_0x2d8cde[_0xfee0('0x30')]=_['keys'](_0x34570d[_0xfee0('0x30')]);_0x2d8cde[_0xfee0('0x31')]=_[_0xfee0('0x32')](_0x2d8cde[_0xfee0('0x2f')],_0x2d8cde[_0xfee0('0x30')]);_0x1950f3[_0xfee0('0x33')]=_['intersection'](_0x2d8cde[_0xfee0('0x2f')],qs[_0xfee0('0x34')](_0x34570d[_0xfee0('0x30')][_0xfee0('0x34')]));_0x1950f3[_0xfee0('0x33')]=_0x1950f3[_0xfee0('0x33')]['length']?_0x1950f3['attributes']:_0x2d8cde[_0xfee0('0x2f')];if(!_0x34570d['query'][_0xfee0('0x35')](_0xfee0('0x36'))){_0x1950f3[_0xfee0('0x1d')]=qs[_0xfee0('0x1d')](_0x34570d[_0xfee0('0x30')]['limit']);_0x1950f3[_0xfee0('0x1b')]=qs['offset'](_0x34570d[_0xfee0('0x30')][_0xfee0('0x1b')]);}_0x1950f3['order']=qs['sort'](_0x34570d[_0xfee0('0x30')][_0xfee0('0x37')]);_0x1950f3['where']=qs[_0xfee0('0x31')](_[_0xfee0('0x38')](_0x34570d[_0xfee0('0x30')],_0x2d8cde['filters']),_0x1168ac);if(_0x34570d[_0xfee0('0x30')][_0xfee0('0x39')]){_0x1950f3[_0xfee0('0x3a')]=_['merge'](_0x1950f3[_0xfee0('0x3a')],{'$or':_['map'](_0x1168ac,function(_0x971cc){if(_0x971cc[_0xfee0('0x2d')]!==_0xfee0('0x3b')){var _0x4f8168={};_0x4f8168[_0x971cc[_0xfee0('0x27')]]={'$like':'%'+_0x34570d[_0xfee0('0x30')][_0xfee0('0x39')]+'%'};return _0x4f8168;}})});}_0x1950f3=_[_0xfee0('0x3c')]({},_0x1950f3,_0x34570d[_0xfee0('0x3d')]);var _0x3a67ec={'where':_0x1950f3[_0xfee0('0x3a')]};return db[_0xfee0('0x2b')][_0xfee0('0x1e')](_0x3a67ec)[_0xfee0('0x24')](function(_0x12d1fd){_0x40a9da[_0xfee0('0x1e')]=_0x12d1fd;if(_0x34570d[_0xfee0('0x30')][_0xfee0('0x3e')]){_0x1950f3[_0xfee0('0x3f')]=[{'all':!![]}];}return db[_0xfee0('0x2b')][_0xfee0('0x40')](_0x1950f3);})[_0xfee0('0x24')](function(_0x5ae0a1){_0x40a9da['rows']=_0x5ae0a1;return _0x40a9da;})[_0xfee0('0x24')](respondWithFilteredResult(_0x78445f,_0x1950f3))[_0xfee0('0x41')](handleError(_0x78445f,null));};exports[_0xfee0('0x42')]=function(_0x128228,_0x450172){var _0x4f4559={'raw':![],'where':{'id':_0x128228[_0xfee0('0x43')]['id']}},_0x2ff598={};_0x2ff598[_0xfee0('0x2f')]=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0x2ff598[_0xfee0('0x30')]=_[_0xfee0('0x44')](_0x128228[_0xfee0('0x30')]);_0x2ff598['filters']=_[_0xfee0('0x32')](_0x2ff598[_0xfee0('0x2f')],_0x2ff598[_0xfee0('0x30')]);_0x4f4559['attributes']=_[_0xfee0('0x32')](_0x2ff598[_0xfee0('0x2f')],qs[_0xfee0('0x34')](_0x128228[_0xfee0('0x30')]['fields']));_0x4f4559['attributes']=_0x4f4559['attributes']['length']?_0x4f4559[_0xfee0('0x33')]:_0x2ff598[_0xfee0('0x2f')];if(_0x128228[_0xfee0('0x30')]['includeAll']){_0x4f4559[_0xfee0('0x3f')]=[{'all':!![]}];}_0x4f4559=_[_0xfee0('0x3c')]({},_0x4f4559,_0x128228[_0xfee0('0x3d')]);return db[_0xfee0('0x2b')][_0xfee0('0x45')](_0x4f4559)['then'](handleEntityNotFound(_0x450172,null))[_0xfee0('0x24')](respondWithResult(_0x450172,null))[_0xfee0('0x41')](handleError(_0x450172,null));};exports[_0xfee0('0x46')]=function(_0x26bab2,_0x4d47dc){return db[_0xfee0('0x2b')][_0xfee0('0x46')](_0x26bab2[_0xfee0('0x47')],{})[_0xfee0('0x24')](respondWithResult(_0x4d47dc,0xc9))[_0xfee0('0x41')](handleError(_0x4d47dc,null));};exports[_0xfee0('0x22')]=function(_0x2f3f45,_0x5b3fb6){if(_0x2f3f45[_0xfee0('0x47')]['id']){delete _0x2f3f45[_0xfee0('0x47')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x2f3f45[_0xfee0('0x43')]['id']}})[_0xfee0('0x24')](handleEntityNotFound(_0x5b3fb6,null))[_0xfee0('0x24')](saveUpdates(_0x2f3f45['body'],null))['then'](respondWithResult(_0x5b3fb6,null))[_0xfee0('0x41')](handleError(_0x5b3fb6,null));};exports[_0xfee0('0x23')]=function(_0x5ad8f7,_0x9cbce2){return db['SugarcrmAccount'][_0xfee0('0x45')]({'where':{'id':_0x5ad8f7[_0xfee0('0x43')]['id']}})[_0xfee0('0x24')](handleEntityNotFound(_0x9cbce2,null))[_0xfee0('0x24')](removeEntity(_0x9cbce2,null))[_0xfee0('0x41')](handleError(_0x9cbce2,null));};exports[_0xfee0('0x48')]=function(_0x562594,_0x2f96d8,_0x398c57){var _0x53e596={};var _0x1716c1={};var _0x51752b;var _0x4a4489;return db[_0xfee0('0x2b')][_0xfee0('0x49')]({'where':{'id':_0x562594[_0xfee0('0x43')]['id']}})[_0xfee0('0x24')](handleEntityNotFound(_0x2f96d8,null))['then'](function(_0x5db7f3){if(_0x5db7f3){_0x51752b=_0x5db7f3;_0x1716c1[_0xfee0('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0xfee0('0x4a')]);_0x1716c1[_0xfee0('0x30')]=_[_0xfee0('0x44')](_0x562594[_0xfee0('0x30')]);_0x1716c1['filters']=_['intersection'](_0x1716c1[_0xfee0('0x2f')],_0x1716c1[_0xfee0('0x30')]);_0x53e596[_0xfee0('0x33')]=_[_0xfee0('0x32')](_0x1716c1[_0xfee0('0x2f')],qs[_0xfee0('0x34')](_0x562594['query'][_0xfee0('0x34')]));_0x53e596[_0xfee0('0x33')]=_0x53e596['attributes'][_0xfee0('0x4b')]?_0x53e596[_0xfee0('0x33')]:_0x1716c1[_0xfee0('0x2f')];_0x53e596[_0xfee0('0x4c')]=qs[_0xfee0('0x37')](_0x562594[_0xfee0('0x30')][_0xfee0('0x37')]);_0x53e596['where']=qs[_0xfee0('0x31')](_[_0xfee0('0x38')](_0x562594[_0xfee0('0x30')],_0x1716c1[_0xfee0('0x31')]));if(_0x562594[_0xfee0('0x30')][_0xfee0('0x39')]){_0x53e596['where']=_[_0xfee0('0x3c')](_0x53e596[_0xfee0('0x3a')],{'$or':_[_0xfee0('0x2a')](_0x53e596[_0xfee0('0x33')],function(_0x5593c9){var _0x5c82bb={};_0x5c82bb[_0x5593c9]={'$like':'%'+_0x562594[_0xfee0('0x30')][_0xfee0('0x39')]+'%'};return _0x5c82bb;})});}_0x53e596=_['merge']({},_0x53e596,_0x562594[_0xfee0('0x3d')]);return _0x51752b[_0xfee0('0x48')](_0x53e596);}})[_0xfee0('0x24')](function(_0x585aa){if(_0x585aa){_0x4a4489=_0x585aa['length'];if(!_0x562594[_0xfee0('0x30')][_0xfee0('0x35')](_0xfee0('0x36'))){_0x53e596['limit']=qs[_0xfee0('0x1d')](_0x562594[_0xfee0('0x30')][_0xfee0('0x1d')]);_0x53e596[_0xfee0('0x1b')]=qs['offset'](_0x562594[_0xfee0('0x30')]['offset']);}return _0x51752b[_0xfee0('0x48')](_0x53e596);}})['then'](function(_0x3259c2){if(_0x3259c2){return _0x3259c2?{'count':_0x4a4489,'rows':_0x3259c2}:null;}})[_0xfee0('0x24')](respondWithResult(_0x2f96d8,null))[_0xfee0('0x41')](handleError(_0x2f96d8,null));};exports[_0xfee0('0x4d')]=function(_0x332e08,_0x539327,_0x3bb2a3){if(_0x332e08[_0xfee0('0x47')]['id']){delete _0x332e08[_0xfee0('0x47')]['id'];}return db[_0xfee0('0x2b')][_0xfee0('0x49')]({'where':{'id':_0x332e08[_0xfee0('0x43')]['id']}})[_0xfee0('0x24')](handleEntityNotFound(_0x539327,null))[_0xfee0('0x24')](function(_0x312b60){if(_0x312b60){_0x332e08[_0xfee0('0x47')][_0xfee0('0x4e')]=_0x312b60['id'];_0x332e08['body'][_0xfee0('0x4f')]=integrations[_0xfee0('0x50')](_0x332e08[_0xfee0('0x47')][_0xfee0('0x51')],_0x332e08[_0xfee0('0x47')][_0xfee0('0x2d')]);_0x332e08[_0xfee0('0x47')][_0xfee0('0x52')]=integrations[_0xfee0('0x53')](_0x332e08[_0xfee0('0x47')][_0xfee0('0x51')],_0x332e08['body'][_0xfee0('0x2d')]);return db[_0xfee0('0x54')]['create'](_0x332e08[_0xfee0('0x47')],{'include':[{'model':db[_0xfee0('0x55')],'as':_0xfee0('0x4f')},{'model':db[_0xfee0('0x55')],'as':_0xfee0('0x52')}]});}return null;})['then'](respondWithResult(_0x539327,null))[_0xfee0('0x41')](handleError(_0x539327,null));};exports[_0xfee0('0x56')]=function(_0x19390e,_0xae8625,_0x3464e8){var _0x651c83='';var _0x8f5b64=['id',_0xfee0('0x27'),_0xfee0('0x57'),'created_by','description',_0xfee0('0x58'),_0xfee0('0x59'),_0xfee0('0x5a'),'parent_id',_0xfee0('0x5b'),'parent_name',_0xfee0('0x5c')];return db['SugarcrmAccount'][_0xfee0('0x49')]({'where':{'id':_0x19390e[_0xfee0('0x43')]['id']},'attributes':['id',_0xfee0('0x5d'),_0xfee0('0x5e'),_0xfee0('0x5f')]})[_0xfee0('0x24')](handleEntityNotFound(_0xae8625,null))[_0xfee0('0x24')](function(_0x47a7d9){if(_0x47a7d9){_0x651c83=_0x47a7d9['remoteUri'];var _0x54f5b4=_0x651c83[_0xfee0('0x60')](-0x1);if(_0x54f5b4==='/'){_0x651c83=_0x651c83[_0xfee0('0x61')](0x0,_0x651c83[_0xfee0('0x62')](_0x54f5b4));}return rp({'method':_0xfee0('0x63'),'uri':util[_0xfee0('0x64')](_0xfee0('0x65'),_0x651c83,_0xfee0('0x66')),'json':!![],'form':{'method':'login','input_type':_0xfee0('0x67'),'response_type':_0xfee0('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x47a7d9['username'],'password':_0x47a7d9[_0xfee0('0x5e')],'encryption':_0xfee0('0x68')},'application':_0xfee0('0x69')})}});}})[_0xfee0('0x24')](function(_0x264018){if(_0x264018&&_0x264018[_0xfee0('0x27')]!=='Invalid\x20Login'&&_0x264018[_0xfee0('0x27')]!==_0xfee0('0x6a')){return rp({'method':_0xfee0('0x63'),'uri':util['format']('%s%s',_0x651c83,_0xfee0('0x66')),'json':!![],'form':{'method':_0xfee0('0x6b'),'input_type':_0xfee0('0x67'),'response_type':_0xfee0('0x67'),'rest_data':JSON['stringify']({'session':_0x264018['id'],'module_name':_0xfee0('0x6c')})}})['then'](function(_0x2c6d94){if(_0x2c6d94){var _0x29a273=_['values'](_0x2c6d94[_0xfee0('0x6d')]);_[_0xfee0('0x6e')](_0x29a273,function(_0x5b0bf2){return _0x8f5b64[_0xfee0('0x6f')](_0x5b0bf2[_0xfee0('0x27')]);});return{'count':_0x29a273[_0xfee0('0x4b')],'rows':_['map'](_0x29a273,function(_0x1487f6){return{'id':_0x1487f6[_0xfee0('0x27')],'name':_0x1487f6[_0xfee0('0x70')],'custom':_[_0xfee0('0x71')](_0x1487f6['name'],'_c')?!![]:![],'options':_0x1487f6[_0xfee0('0x3d')]?_[_0xfee0('0x2a')](_[_0xfee0('0x72')](_0x1487f6[_0xfee0('0x3d')]),function(_0x27738f){return{'name':_0x27738f[_0xfee0('0x73')],'value':_0x27738f[_0xfee0('0x27')]};}):[]};})};}})['then'](respondWithResult(_0xae8625,null))['catch'](function(_0x2990ae){var _0x10d844=_0x19390e[_0xfee0('0x30')][_0xfee0('0x74')]?0x1f4:_0x2990ae[_0xfee0('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfee0('0x56'),_0x10d844,JSON[_0xfee0('0x76')](_0x2990ae));delete _0x2990ae['name'];if(_0x10d844===0x191){_0x10d844=0x190;}_0xae8625[_0xfee0('0x18')](_0x10d844)['send'](_0x19390e[_0xfee0('0x30')]['test']?{'message':_0xfee0('0x77'),'statusCode':_0x2990ae[_0xfee0('0x75')]}:_0x2990ae);});}else{var _0x58fd7c=0x1f4;_0xae8625[_0xfee0('0x18')](_0x58fd7c)[_0xfee0('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index e9b20d9..5f0aa98 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 _0x69d4=['util','api','moment','bluebird','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','lodash'];(function(_0x2b0d44,_0x3b6cba){var _0x3d0cf7=function(_0x4344cd){while(--_0x4344cd){_0x2b0d44['push'](_0x2b0d44['shift']());}};_0x3d0cf7(++_0x3b6cba);}(_0x69d4,0x83));var _0x469d=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x69d4[_0x231a47];return _0x48d7c9;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var logger=require('../../config/logger')(_0x469d('0x2'));var moment=require(_0x469d('0x3'));var BPromise=require(_0x469d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x469d('0x5'));var rimraf=require('rimraf');var config=require(_0x469d('0x6'));var attributes=require(_0x469d('0x7'));var integrations=require(_0x469d('0x8'));module[_0x469d('0x9')]=function(_0x3d0ec8,_0xb15ca9){return _0x3d0ec8['define'](_0x469d('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x553e=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x2f8dd8,_0x371e88){var _0x753282=function(_0x2297be){while(--_0x2297be){_0x2f8dd8['push'](_0x2f8dd8['shift']());}};_0x753282(++_0x371e88);}(_0x553e,0x10f));var _0xe553=function(_0xdd130a,_0x56e62c){_0xdd130a=_0xdd130a-0x0;var _0x2155a4=_0x553e[_0xdd130a];return _0x2155a4;};'use strict';var _=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var logger=require(_0xe553('0x2'))(_0xe553('0x3'));var moment=require(_0xe553('0x4'));var BPromise=require(_0xe553('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe553('0x6'));var rimraf=require(_0xe553('0x7'));var config=require(_0xe553('0x8'));var attributes=require(_0xe553('0x9'));var integrations=require(_0xe553('0xa'));module[_0xe553('0xb')]=function(_0x325813,_0x4c7741){return _0x325813[_0xe553('0xc')](_0xe553('0xd'),attributes,{'tableName':_0xe553('0xe'),'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 960a290..f2f8f4f 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 _0xd860=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','ShowSugarcrmAccount','find','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd860,0x14f));var _0x0d86=function(_0x3958df,_0x58d13f){_0x3958df=_0x3958df-0x0;var _0x5c9313=_0xd860[_0x3958df];return _0x5c9313;};'use strict';var _=require('lodash');var util=require(_0x0d86('0x0'));var moment=require(_0x0d86('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d86('0x2'));var db=require(_0x0d86('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d86('0x4'))(_0x0d86('0x5'));var config=require(_0x0d86('0x6'));var jayson=require(_0x0d86('0x7'));var client=jayson[_0x0d86('0x8')][_0x0d86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6a37,_0x2639ab,_0x129b14){return new BPromise(function(_0x3ad5f,_0x10e9dc){return client[_0x0d86('0xa')](_0x4a6a37,_0x129b14)[_0x0d86('0xb')](function(_0x162211){logger[_0x0d86('0xc')](_0x0d86('0xd'),_0x2639ab,_0x0d86('0xe'));logger[_0x0d86('0xf')](_0x0d86('0x10'),_0x2639ab,_0x0d86('0xe'),JSON['stringify'](_0x162211));if(_0x162211[_0x0d86('0x11')]){if(_0x162211[_0x0d86('0x11')][_0x0d86('0x12')]===0x1f4){logger[_0x0d86('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x2639ab,_0x162211['error']['message']);return _0x10e9dc(_0x162211[_0x0d86('0x11')]['message']);}logger[_0x0d86('0x11')](_0x0d86('0xd'),_0x2639ab,_0x162211[_0x0d86('0x11')][_0x0d86('0x13')]);return _0x3ad5f(_0x162211[_0x0d86('0x11')][_0x0d86('0x13')]);}else{logger[_0x0d86('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x2639ab,_0x0d86('0xe'));_0x3ad5f(_0x162211[_0x0d86('0x14')][_0x0d86('0x13')]);}})[_0x0d86('0x15')](function(_0x4c11fc){logger[_0x0d86('0x11')](_0x0d86('0xd'),_0x2639ab,_0x4c11fc);_0x10e9dc(_0x4c11fc);});});}exports[_0x0d86('0x16')]=function(_0x4e8a13){var _0x34bce4=this;return new Promise(function(_0x30e392,_0x4c377e){return db[_0x0d86('0x17')][_0x0d86('0x18')]({'raw':_0x4e8a13[_0x0d86('0x19')]?_0x4e8a13['options'][_0x0d86('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e8a13[_0x0d86('0x19')]?_0x4e8a13[_0x0d86('0x19')]['where']||null:null,'attributes':_0x4e8a13[_0x0d86('0x19')]?_0x4e8a13[_0x0d86('0x19')][_0x0d86('0x1b')]||null:null,'limit':_0x4e8a13['options']?_0x4e8a13[_0x0d86('0x19')][_0x0d86('0x1c')]||null:null,'include':_0x4e8a13[_0x0d86('0x19')]?_0x4e8a13[_0x0d86('0x19')]['include']?_[_0x0d86('0x1d')](_0x4e8a13[_0x0d86('0x19')][_0x0d86('0x1e')],function(_0x4063ea){return{'model':db[_0x4063ea[_0x0d86('0x1f')]],'as':_0x4063ea['as'],'attributes':_0x4063ea[_0x0d86('0x1b')],'include':_0x4063ea['include']?_['map'](_0x4063ea[_0x0d86('0x1e')],function(_0x3b7eb3){return{'model':db[_0x3b7eb3[_0x0d86('0x1f')]],'as':_0x3b7eb3['as'],'attributes':_0x3b7eb3[_0x0d86('0x1b')],'include':_0x3b7eb3['include']?_[_0x0d86('0x1d')](_0x3b7eb3['include'],function(_0x21678b){return{'model':db[_0x21678b[_0x0d86('0x1f')]],'as':_0x21678b['as'],'attributes':_0x21678b[_0x0d86('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d86('0xb')](function(_0x3aeb6d){logger['info'](_0x0d86('0x16'),_0x4e8a13);logger[_0x0d86('0xf')]('GetSugarcrmAccount',_0x4e8a13,JSON[_0x0d86('0x20')](_0x3aeb6d));_0x30e392(_0x3aeb6d);})['catch'](function(_0x45585e){logger['error'](_0x0d86('0x16'),_0x45585e[_0x0d86('0x13')],_0x4e8a13);_0x4c377e(_0x34bce4['error'](0x1f4,_0x45585e[_0x0d86('0x13')]));});});};exports[_0x0d86('0x21')]=function(_0x51d9b2){var _0x2a1e06=this;return new Promise(function(_0x3ef864,_0x3534fb){return db[_0x0d86('0x17')][_0x0d86('0x22')]({'raw':_0x51d9b2[_0x0d86('0x19')]?_0x51d9b2[_0x0d86('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x51d9b2[_0x0d86('0x19')]?_0x51d9b2[_0x0d86('0x19')]['where']||null:null,'attributes':_0x51d9b2[_0x0d86('0x19')]?_0x51d9b2[_0x0d86('0x19')][_0x0d86('0x1b')]||null:null,'include':_0x51d9b2[_0x0d86('0x19')]?_0x51d9b2['options']['include']?_[_0x0d86('0x1d')](_0x51d9b2[_0x0d86('0x19')][_0x0d86('0x1e')],function(_0x5c87b1){return{'model':db[_0x5c87b1['model']],'as':_0x5c87b1['as'],'attributes':_0x5c87b1[_0x0d86('0x1b')],'include':_0x5c87b1['include']?_[_0x0d86('0x1d')](_0x5c87b1[_0x0d86('0x1e')],function(_0x5ca57b){return{'model':db[_0x5ca57b[_0x0d86('0x1f')]],'as':_0x5ca57b['as'],'attributes':_0x5ca57b['attributes'],'include':_0x5ca57b['include']?_[_0x0d86('0x1d')](_0x5ca57b['include'],function(_0x4e90e0){return{'model':db[_0x4e90e0[_0x0d86('0x1f')]],'as':_0x4e90e0['as'],'attributes':_0x4e90e0[_0x0d86('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d86('0xb')](function(_0x574046){logger[_0x0d86('0xc')](_0x0d86('0x21'),_0x51d9b2);logger['debug'](_0x0d86('0x21'),_0x51d9b2,JSON[_0x0d86('0x20')](_0x574046));_0x3ef864(_0x574046);})['catch'](function(_0x35cc7e){logger['error']('ShowSugarcrmAccount',_0x35cc7e[_0x0d86('0x13')],_0x51d9b2);_0x3534fb(_0x2a1e06[_0x0d86('0x11')](0x1f4,_0x35cc7e[_0x0d86('0x13')]));});});}; \ No newline at end of file +var _0xa5ec=['stringify','error','code','message','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','include','model','map','debug','ShowSugarcrmAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2044c0,_0x1cdd58){var _0x5e623e=function(_0x3bd98e){while(--_0x3bd98e){_0x2044c0['push'](_0x2044c0['shift']());}};_0x5e623e(++_0x1cdd58);}(_0xa5ec,0x185));var _0xca5e=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0xa5ec[_0x213518];return _0x1baf75;};'use strict';var _=require(_0xca5e('0x0'));var util=require('util');var moment=require(_0xca5e('0x1'));var BPromise=require(_0xca5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca5e('0x3'));var db=require(_0xca5e('0x4'))['db'];var utils=require(_0xca5e('0x5'));var logger=require('../../config/logger')(_0xca5e('0x6'));var config=require('../../config/environment');var jayson=require(_0xca5e('0x7'));var client=jayson[_0xca5e('0x8')][_0xca5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13383a,_0x11f312,_0x4ec119){return new BPromise(function(_0x54bd59,_0x39ce0a){return client['request'](_0x13383a,_0x4ec119)[_0xca5e('0xa')](function(_0x19131f){logger[_0xca5e('0xb')](_0xca5e('0xc'),_0x11f312,_0xca5e('0xd'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x11f312,_0xca5e('0xd'),JSON[_0xca5e('0xe')](_0x19131f));if(_0x19131f[_0xca5e('0xf')]){if(_0x19131f[_0xca5e('0xf')][_0xca5e('0x10')]===0x1f4){logger['error'](_0xca5e('0xc'),_0x11f312,_0x19131f[_0xca5e('0xf')]['message']);return _0x39ce0a(_0x19131f[_0xca5e('0xf')][_0xca5e('0x11')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x11f312,_0x19131f['error'][_0xca5e('0x11')]);return _0x54bd59(_0x19131f[_0xca5e('0xf')][_0xca5e('0x11')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x11f312,_0xca5e('0xd'));_0x54bd59(_0x19131f['result'][_0xca5e('0x11')]);}})[_0xca5e('0x12')](function(_0x1593cc){logger[_0xca5e('0xf')](_0xca5e('0xc'),_0x11f312,_0x1593cc);_0x39ce0a(_0x1593cc);});});}exports[_0xca5e('0x13')]=function(_0x1defc6){var _0x1e109e=this;return new Promise(function(_0x45b189,_0x3f1850){return db['SugarcrmAccount']['findAll']({'raw':_0x1defc6[_0xca5e('0x14')]?_0x1defc6[_0xca5e('0x14')][_0xca5e('0x15')]===undefined?!![]:![]:!![],'where':_0x1defc6[_0xca5e('0x14')]?_0x1defc6[_0xca5e('0x14')][_0xca5e('0x16')]||null:null,'attributes':_0x1defc6[_0xca5e('0x14')]?_0x1defc6[_0xca5e('0x14')][_0xca5e('0x17')]||null:null,'limit':_0x1defc6['options']?_0x1defc6['options'][_0xca5e('0x18')]||null:null,'include':_0x1defc6['options']?_0x1defc6[_0xca5e('0x14')][_0xca5e('0x19')]?_['map'](_0x1defc6['options'][_0xca5e('0x19')],function(_0x1c8b20){return{'model':db[_0x1c8b20[_0xca5e('0x1a')]],'as':_0x1c8b20['as'],'attributes':_0x1c8b20[_0xca5e('0x17')],'include':_0x1c8b20[_0xca5e('0x19')]?_['map'](_0x1c8b20[_0xca5e('0x19')],function(_0x229b0e){return{'model':db[_0x229b0e['model']],'as':_0x229b0e['as'],'attributes':_0x229b0e['attributes'],'include':_0x229b0e[_0xca5e('0x19')]?_[_0xca5e('0x1b')](_0x229b0e[_0xca5e('0x19')],function(_0x21227a){return{'model':db[_0x21227a[_0xca5e('0x1a')]],'as':_0x21227a['as'],'attributes':_0x21227a[_0xca5e('0x17')]};}):[]};}):[]};}):[]:[]})[_0xca5e('0xa')](function(_0x150091){logger['info'](_0xca5e('0x13'),_0x1defc6);logger[_0xca5e('0x1c')](_0xca5e('0x13'),_0x1defc6,JSON[_0xca5e('0xe')](_0x150091));_0x45b189(_0x150091);})['catch'](function(_0x5eb84b){logger[_0xca5e('0xf')](_0xca5e('0x13'),_0x5eb84b[_0xca5e('0x11')],_0x1defc6);_0x3f1850(_0x1e109e['error'](0x1f4,_0x5eb84b[_0xca5e('0x11')]));});});};exports[_0xca5e('0x1d')]=function(_0x4e3f3f){var _0x51aca2=this;return new Promise(function(_0x36e95b,_0x3ab1d2){return db['SugarcrmAccount'][_0xca5e('0x1e')]({'raw':_0x4e3f3f[_0xca5e('0x14')]?_0x4e3f3f[_0xca5e('0x14')][_0xca5e('0x15')]===undefined?!![]:![]:!![],'where':_0x4e3f3f[_0xca5e('0x14')]?_0x4e3f3f[_0xca5e('0x14')]['where']||null:null,'attributes':_0x4e3f3f[_0xca5e('0x14')]?_0x4e3f3f['options'][_0xca5e('0x17')]||null:null,'include':_0x4e3f3f['options']?_0x4e3f3f[_0xca5e('0x14')]['include']?_[_0xca5e('0x1b')](_0x4e3f3f[_0xca5e('0x14')][_0xca5e('0x19')],function(_0x1e2fd6){return{'model':db[_0x1e2fd6[_0xca5e('0x1a')]],'as':_0x1e2fd6['as'],'attributes':_0x1e2fd6[_0xca5e('0x17')],'include':_0x1e2fd6['include']?_['map'](_0x1e2fd6[_0xca5e('0x19')],function(_0x5894f5){return{'model':db[_0x5894f5[_0xca5e('0x1a')]],'as':_0x5894f5['as'],'attributes':_0x5894f5['attributes'],'include':_0x5894f5[_0xca5e('0x19')]?_[_0xca5e('0x1b')](_0x5894f5['include'],function(_0x494492){return{'model':db[_0x494492[_0xca5e('0x1a')]],'as':_0x494492['as'],'attributes':_0x494492[_0xca5e('0x17')]};}):[]};}):[]};}):[]:[]})[_0xca5e('0xa')](function(_0x21827c){logger[_0xca5e('0xb')](_0xca5e('0x1d'),_0x4e3f3f);logger[_0xca5e('0x1c')](_0xca5e('0x1d'),_0x4e3f3f,JSON['stringify'](_0x21827c));_0x36e95b(_0x21827c);})[_0xca5e('0x12')](function(_0x2e4e39){logger[_0xca5e('0xf')]('ShowSugarcrmAccount',_0x2e4e39[_0xca5e('0x11')],_0x4e3f3f);_0x3ab1d2(_0x51aca2[_0xca5e('0xf')](0x1f4,_0x2e4e39[_0xca5e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a269c37..fb794e0 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 _0x0979=['isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get'];(function(_0x4dfad5,_0x62f93c){var _0xc5c336=function(_0x4ad0ed){while(--_0x4ad0ed){_0x4dfad5['push'](_0x4dfad5['shift']());}};_0xc5c336(++_0x62f93c);}(_0x0979,0x7b));var _0x9097=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0x0979[_0x98db33];return _0x5ae63a;};'use strict';var multer=require(_0x9097('0x0'));var util=require(_0x9097('0x1'));var path=require(_0x9097('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9097('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9097('0x4'));var interaction=require(_0x9097('0x5'));var config=require(_0x9097('0x6'));var controller=require(_0x9097('0x7'));router[_0x9097('0x8')]('/',auth[_0x9097('0x9')](),controller['index']);router[_0x9097('0x8')](_0x9097('0xa'),auth[_0x9097('0x9')](),controller[_0x9097('0xb')]);router['get'](_0x9097('0xc'),auth[_0x9097('0x9')](),controller[_0x9097('0xd')]);router[_0x9097('0x8')](_0x9097('0xe'),auth[_0x9097('0x9')](),controller[_0x9097('0xf')]);router[_0x9097('0x8')](_0x9097('0x10'),auth[_0x9097('0x9')](),controller[_0x9097('0x11')]);router['post']('/',auth[_0x9097('0x9')](),controller[_0x9097('0x12')]);router['put'](_0x9097('0xa'),auth[_0x9097('0x9')](),controller[_0x9097('0x13')]);router[_0x9097('0x14')](_0x9097('0xa'),auth[_0x9097('0x9')](),controller['destroy']);module[_0x9097('0x15')]=router; \ No newline at end of file +var _0x1bdc=['../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5100bc,_0x1e273f){var _0x598cd7=function(_0x2af552){while(--_0x2af552){_0x5100bc['push'](_0x5100bc['shift']());}};_0x598cd7(++_0x1e273f);}(_0x1bdc,0x160));var _0xc1bd=function(_0x94118,_0x3bf157){_0x94118=_0x94118-0x0;var _0x685a42=_0x1bdc[_0x94118];return _0x685a42;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc1bd('0x0'));var express=require('express');var router=express[_0xc1bd('0x1')]();var fs_extra=require(_0xc1bd('0x2'));var auth=require(_0xc1bd('0x3'));var interaction=require(_0xc1bd('0x4'));var config=require(_0xc1bd('0x5'));var controller=require(_0xc1bd('0x6'));router[_0xc1bd('0x7')]('/',auth[_0xc1bd('0x8')](),controller['index']);router[_0xc1bd('0x7')](_0xc1bd('0x9'),auth[_0xc1bd('0x8')](),controller[_0xc1bd('0xa')]);router[_0xc1bd('0x7')](_0xc1bd('0xb'),auth['isAuthenticated'](),controller[_0xc1bd('0xc')]);router[_0xc1bd('0x7')](_0xc1bd('0xd'),auth[_0xc1bd('0x8')](),controller[_0xc1bd('0xe')]);router['get'](_0xc1bd('0xf'),auth['isAuthenticated'](),controller[_0xc1bd('0x10')]);router[_0xc1bd('0x11')]('/',auth[_0xc1bd('0x8')](),controller[_0xc1bd('0x12')]);router[_0xc1bd('0x13')](_0xc1bd('0x9'),auth[_0xc1bd('0x8')](),controller['update']);router['delete'](_0xc1bd('0x9'),auth[_0xc1bd('0x8')](),controller[_0xc1bd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9f4a42b..aaceb50 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 _0x8a3b=['STRING'];(function(_0x357c40,_0x1c24fa){var _0x1e4ee2=function(_0x3af66c){while(--_0x3af66c){_0x357c40['push'](_0x357c40['shift']());}};_0x1e4ee2(++_0x1c24fa);}(_0x8a3b,0xc4));var _0xb8a3=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x8a3b[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb8a3('0x0')]},'description':{'type':Sequelize[_0xb8a3('0x0')]}}; \ No newline at end of file +var _0x916b=['sequelize','STRING'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x916b,0x10c));var _0xb916=function(_0x1774c7,_0x4336f3){_0x1774c7=_0x1774c7-0x0;var _0x1d35a4=_0x916b[_0x1774c7];return _0x1d35a4;};'use strict';var Sequelize=require(_0xb916('0x0'));module['exports']={'name':{'type':Sequelize[_0xb916('0x1')]},'description':{'type':Sequelize[_0xb916('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 25656f1..7ab3649 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 _0xc326=['send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','getFields','pick','hasOwnProperty','nolimit','getSubjects','findOne','SugarcrmField','getDescriptions','eml-format','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc326,0x7b));var _0x6c32=function(_0xe5bcfd,_0x17a060){_0xe5bcfd=_0xe5bcfd-0x0;var _0x1d5424=_0xc326[_0xe5bcfd];return _0x1d5424;};'use strict';var emlformat=require(_0x6c32('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c32('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c32('0x2'));var Mustache=require(_0x6c32('0x3'));var util=require(_0x6c32('0x4'));var path=require(_0x6c32('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c32('0x6'));var fs=require('fs');var fs_extra=require(_0x6c32('0x7'));var _=require(_0x6c32('0x8'));var squel=require(_0x6c32('0x9'));var crypto=require(_0x6c32('0xa'));var jsforce=require(_0x6c32('0xb'));var deskjs=require(_0x6c32('0xc'));var toCsv=require(_0x6c32('0xd'));var querystring=require(_0x6c32('0xe'));var Papa=require(_0x6c32('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c32('0x10'));var as=require(_0x6c32('0x11'));var hardwareService=require(_0x6c32('0x12'));var logger=require(_0x6c32('0x13'))('api');var utils=require(_0x6c32('0x14'));var config=require(_0x6c32('0x15'));var licenseUtil=require(_0x6c32('0x16'));var db=require(_0x6c32('0x17'))['db'];function respondWithStatusCode(_0x23c9a7,_0x3eff31){_0x3eff31=_0x3eff31||0xcc;return function(_0x5384ac){if(_0x5384ac){return _0x23c9a7[_0x6c32('0x18')](_0x3eff31);}return _0x23c9a7[_0x6c32('0x19')](_0x3eff31)[_0x6c32('0x1a')]();};}function respondWithResult(_0x1cecd2,_0x546064){_0x546064=_0x546064||0xc8;return function(_0xbd9fa2){if(_0xbd9fa2){return _0x1cecd2[_0x6c32('0x19')](_0x546064)[_0x6c32('0x1b')](_0xbd9fa2);}};}function respondWithFilteredResult(_0x502481,_0x269d1f){return function(_0x25d75a){if(_0x25d75a){var _0x1c1feb=typeof _0x269d1f[_0x6c32('0x1c')]==='undefined'&&typeof _0x269d1f[_0x6c32('0x1d')]==='undefined';var _0x4793f9=_0x25d75a[_0x6c32('0x1e')];var _0x207c46=_0x1c1feb?0x0:_0x269d1f[_0x6c32('0x1c')];var _0x566055=_0x1c1feb?_0x25d75a[_0x6c32('0x1e')]:_0x269d1f[_0x6c32('0x1c')]+_0x269d1f['limit'];var _0x35d42f;if(_0x566055>=_0x4793f9){_0x566055=_0x4793f9;_0x35d42f=0xc8;}else{_0x35d42f=0xce;}_0x502481[_0x6c32('0x19')](_0x35d42f);return _0x502481[_0x6c32('0x1f')](_0x6c32('0x20'),_0x207c46+'-'+_0x566055+'/'+_0x4793f9)[_0x6c32('0x1b')](_0x25d75a);}return null;};}function patchUpdates(_0xe2d6d0){return function(_0x58dd9f){try{jsonpatch[_0x6c32('0x21')](_0x58dd9f,_0xe2d6d0,!![]);}catch(_0x1abb2b){return BPromise[_0x6c32('0x22')](_0x1abb2b);}return _0x58dd9f[_0x6c32('0x23')]();};}function saveUpdates(_0x1541b3,_0x1506cb){return function(_0x357366){if(_0x357366){return _0x357366[_0x6c32('0x24')](_0x1541b3)[_0x6c32('0x25')](function(_0x258d79){return _0x258d79;});}return null;};}function removeEntity(_0x503110,_0x37c8a2){return function(_0x437411){if(_0x437411){return _0x437411['destroy']()['then'](function(){_0x503110['status'](0xcc)[_0x6c32('0x1a')]();});}};}function handleEntityNotFound(_0x484651,_0x4e08d4){return function(_0x25ed81){if(!_0x25ed81){_0x484651[_0x6c32('0x18')](0x194);}return _0x25ed81;};}function handleError(_0x4312f9,_0x269606){_0x269606=_0x269606||0x1f4;return function(_0x48ee74){logger[_0x6c32('0x26')](_0x48ee74[_0x6c32('0x27')]);if(_0x48ee74[_0x6c32('0x28')]){delete _0x48ee74['name'];}_0x4312f9[_0x6c32('0x19')](_0x269606)[_0x6c32('0x29')](_0x48ee74);};}exports[_0x6c32('0x2a')]=function(_0x19ce0d,_0xbf4ff){var _0x326026={},_0x39aa29={},_0x45e153={'count':0x0,'rows':[]};var _0x5c45fd=_[_0x6c32('0x2b')](db[_0x6c32('0x2c')][_0x6c32('0x2d')],function(_0x510ab0){return{'name':_0x510ab0[_0x6c32('0x2e')],'type':_0x510ab0[_0x6c32('0x2f')][_0x6c32('0x30')]};});_0x39aa29[_0x6c32('0x31')]=_['map'](_0x5c45fd,_0x6c32('0x28'));_0x39aa29[_0x6c32('0x32')]=_['keys'](_0x19ce0d[_0x6c32('0x32')]);_0x39aa29[_0x6c32('0x33')]=_['intersection'](_0x39aa29[_0x6c32('0x31')],_0x39aa29[_0x6c32('0x32')]);_0x326026[_0x6c32('0x34')]=_[_0x6c32('0x35')](_0x39aa29[_0x6c32('0x31')],qs[_0x6c32('0x36')](_0x19ce0d['query'][_0x6c32('0x36')]));_0x326026['attributes']=_0x326026[_0x6c32('0x34')][_0x6c32('0x37')]?_0x326026[_0x6c32('0x34')]:_0x39aa29[_0x6c32('0x31')];if(!_0x19ce0d[_0x6c32('0x32')]['hasOwnProperty']('nolimit')){_0x326026['limit']=qs[_0x6c32('0x1d')](_0x19ce0d[_0x6c32('0x32')][_0x6c32('0x1d')]);_0x326026[_0x6c32('0x1c')]=qs['offset'](_0x19ce0d['query'][_0x6c32('0x1c')]);}_0x326026[_0x6c32('0x38')]=qs['sort'](_0x19ce0d[_0x6c32('0x32')][_0x6c32('0x39')]);_0x326026[_0x6c32('0x3a')]=qs[_0x6c32('0x33')](_['pick'](_0x19ce0d['query'],_0x39aa29['filters']),_0x5c45fd);if(_0x19ce0d['query'][_0x6c32('0x3b')]){_0x326026[_0x6c32('0x3a')]=_[_0x6c32('0x3c')](_0x326026['where'],{'$or':_[_0x6c32('0x2b')](_0x5c45fd,function(_0x489834){if(_0x489834['type']!==_0x6c32('0x3d')){var _0x4c189a={};_0x4c189a[_0x489834['name']]={'$like':'%'+_0x19ce0d['query'][_0x6c32('0x3b')]+'%'};return _0x4c189a;}})});}_0x326026=_[_0x6c32('0x3c')]({},_0x326026,_0x19ce0d[_0x6c32('0x3e')]);var _0xa41436={'where':_0x326026[_0x6c32('0x3a')]};return db[_0x6c32('0x2c')]['count'](_0xa41436)[_0x6c32('0x25')](function(_0x3b414e){_0x45e153['count']=_0x3b414e;if(_0x19ce0d[_0x6c32('0x32')]['includeAll']){_0x326026[_0x6c32('0x3f')]=[{'all':!![]}];}return db[_0x6c32('0x2c')][_0x6c32('0x40')](_0x326026);})[_0x6c32('0x25')](function(_0x2c8fb0){_0x45e153[_0x6c32('0x41')]=_0x2c8fb0;return _0x45e153;})[_0x6c32('0x25')](respondWithFilteredResult(_0xbf4ff,_0x326026))[_0x6c32('0x42')](handleError(_0xbf4ff,null));};exports[_0x6c32('0x43')]=function(_0x1af5d3,_0x22c561){var _0x31d637={'raw':![],'where':{'id':_0x1af5d3[_0x6c32('0x44')]['id']}},_0x5be082={};_0x5be082[_0x6c32('0x31')]=_[_0x6c32('0x45')](db[_0x6c32('0x2c')]['rawAttributes']);_0x5be082[_0x6c32('0x32')]=_[_0x6c32('0x45')](_0x1af5d3[_0x6c32('0x32')]);_0x5be082[_0x6c32('0x33')]=_[_0x6c32('0x35')](_0x5be082[_0x6c32('0x31')],_0x5be082[_0x6c32('0x32')]);_0x31d637[_0x6c32('0x34')]=_['intersection'](_0x5be082[_0x6c32('0x31')],qs[_0x6c32('0x36')](_0x1af5d3[_0x6c32('0x32')]['fields']));_0x31d637[_0x6c32('0x34')]=_0x31d637[_0x6c32('0x34')][_0x6c32('0x37')]?_0x31d637[_0x6c32('0x34')]:_0x5be082['model'];if(_0x1af5d3[_0x6c32('0x32')]['includeAll']){_0x31d637[_0x6c32('0x3f')]=[{'all':!![]}];}_0x31d637=_[_0x6c32('0x3c')]({},_0x31d637,_0x1af5d3['options']);return db[_0x6c32('0x2c')]['find'](_0x31d637)[_0x6c32('0x25')](handleEntityNotFound(_0x22c561,null))[_0x6c32('0x25')](respondWithResult(_0x22c561,null))['catch'](handleError(_0x22c561,null));};exports[_0x6c32('0x46')]=function(_0x4b5680,_0x43c688){return db['SugarcrmConfiguration']['create'](_0x4b5680[_0x6c32('0x47')],{})[_0x6c32('0x25')](respondWithResult(_0x43c688,0xc9))[_0x6c32('0x42')](handleError(_0x43c688,null));};exports[_0x6c32('0x24')]=function(_0x49944f,_0x3b174d){if(_0x49944f[_0x6c32('0x47')]['id']){delete _0x49944f['body']['id'];}return db['SugarcrmConfiguration'][_0x6c32('0x48')]({'where':{'id':_0x49944f[_0x6c32('0x44')]['id']}})[_0x6c32('0x25')](handleEntityNotFound(_0x3b174d,null))[_0x6c32('0x25')](saveUpdates(_0x49944f[_0x6c32('0x47')],null))[_0x6c32('0x25')](respondWithResult(_0x3b174d,null))[_0x6c32('0x42')](handleError(_0x3b174d,null));};exports[_0x6c32('0x49')]=function(_0x135df1,_0x4cc339){return db['SugarcrmConfiguration'][_0x6c32('0x48')]({'where':{'id':_0x135df1[_0x6c32('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cc339,null))[_0x6c32('0x25')](removeEntity(_0x4cc339,null))[_0x6c32('0x42')](handleError(_0x4cc339,null));};exports[_0x6c32('0x4a')]=function(_0x4e7f80,_0x1d760c,_0x5c6406){var _0x53275a={};var _0x32545e={};var _0x31c75a;var _0x146a7f;return db[_0x6c32('0x2c')]['findOne']({'where':{'id':_0x4e7f80[_0x6c32('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d760c,null))['then'](function(_0xcaf588){if(_0xcaf588){_0x31c75a=_0xcaf588;_0x32545e[_0x6c32('0x31')]=_[_0x6c32('0x45')](db['SugarcrmField'][_0x6c32('0x2d')]);_0x32545e[_0x6c32('0x32')]=_[_0x6c32('0x45')](_0x4e7f80['query']);_0x32545e[_0x6c32('0x33')]=_['intersection'](_0x32545e[_0x6c32('0x31')],_0x32545e[_0x6c32('0x32')]);_0x53275a[_0x6c32('0x34')]=_['intersection'](_0x32545e[_0x6c32('0x31')],qs[_0x6c32('0x36')](_0x4e7f80[_0x6c32('0x32')][_0x6c32('0x36')]));_0x53275a[_0x6c32('0x34')]=_0x53275a[_0x6c32('0x34')]['length']?_0x53275a[_0x6c32('0x34')]:_0x32545e[_0x6c32('0x31')];_0x53275a[_0x6c32('0x38')]=qs[_0x6c32('0x39')](_0x4e7f80[_0x6c32('0x32')]['sort']);_0x53275a[_0x6c32('0x3a')]=qs['filters'](_[_0x6c32('0x4b')](_0x4e7f80[_0x6c32('0x32')],_0x32545e[_0x6c32('0x33')]));if(_0x4e7f80['query'][_0x6c32('0x3b')]){_0x53275a[_0x6c32('0x3a')]=_[_0x6c32('0x3c')](_0x53275a[_0x6c32('0x3a')],{'$or':_[_0x6c32('0x2b')](_0x53275a[_0x6c32('0x34')],function(_0x26c012){var _0x615836={};_0x615836[_0x26c012]={'$like':'%'+_0x4e7f80[_0x6c32('0x32')][_0x6c32('0x3b')]+'%'};return _0x615836;})});}_0x53275a=_['merge']({},_0x53275a,_0x4e7f80[_0x6c32('0x3e')]);return _0x31c75a[_0x6c32('0x4a')](_0x53275a);}})[_0x6c32('0x25')](function(_0x38dadb){if(_0x38dadb){_0x146a7f=_0x38dadb[_0x6c32('0x37')];if(!_0x4e7f80['query'][_0x6c32('0x4c')](_0x6c32('0x4d'))){_0x53275a[_0x6c32('0x1d')]=qs[_0x6c32('0x1d')](_0x4e7f80['query'][_0x6c32('0x1d')]);_0x53275a[_0x6c32('0x1c')]=qs[_0x6c32('0x1c')](_0x4e7f80[_0x6c32('0x32')][_0x6c32('0x1c')]);}return _0x31c75a[_0x6c32('0x4a')](_0x53275a);}})['then'](function(_0x3df984){if(_0x3df984){return _0x3df984?{'count':_0x146a7f,'rows':_0x3df984}:null;}})[_0x6c32('0x25')](respondWithResult(_0x1d760c,null))[_0x6c32('0x42')](handleError(_0x1d760c,null));};exports[_0x6c32('0x4e')]=function(_0x24a8d6,_0x14d861,_0x4d5193){var _0x44189a={};var _0x59c8e1={};var _0x565c3b;var _0x3b62e4;return db[_0x6c32('0x2c')][_0x6c32('0x4f')]({'where':{'id':_0x24a8d6['params']['id']}})[_0x6c32('0x25')](handleEntityNotFound(_0x14d861,null))[_0x6c32('0x25')](function(_0x1d455c){if(_0x1d455c){_0x565c3b=_0x1d455c;_0x59c8e1[_0x6c32('0x31')]=_[_0x6c32('0x45')](db[_0x6c32('0x50')][_0x6c32('0x2d')]);_0x59c8e1[_0x6c32('0x32')]=_[_0x6c32('0x45')](_0x24a8d6[_0x6c32('0x32')]);_0x59c8e1[_0x6c32('0x33')]=_['intersection'](_0x59c8e1[_0x6c32('0x31')],_0x59c8e1[_0x6c32('0x32')]);_0x44189a[_0x6c32('0x34')]=_[_0x6c32('0x35')](_0x59c8e1[_0x6c32('0x31')],qs[_0x6c32('0x36')](_0x24a8d6['query'][_0x6c32('0x36')]));_0x44189a[_0x6c32('0x34')]=_0x44189a['attributes'][_0x6c32('0x37')]?_0x44189a[_0x6c32('0x34')]:_0x59c8e1['model'];_0x44189a[_0x6c32('0x38')]=qs['sort'](_0x24a8d6['query'][_0x6c32('0x39')]);_0x44189a[_0x6c32('0x3a')]=qs[_0x6c32('0x33')](_[_0x6c32('0x4b')](_0x24a8d6[_0x6c32('0x32')],_0x59c8e1[_0x6c32('0x33')]));if(_0x24a8d6['query'][_0x6c32('0x3b')]){_0x44189a['where']=_[_0x6c32('0x3c')](_0x44189a[_0x6c32('0x3a')],{'$or':_[_0x6c32('0x2b')](_0x44189a[_0x6c32('0x34')],function(_0x1fe090){var _0x2615c2={};_0x2615c2[_0x1fe090]={'$like':'%'+_0x24a8d6[_0x6c32('0x32')][_0x6c32('0x3b')]+'%'};return _0x2615c2;})});}_0x44189a=_[_0x6c32('0x3c')]({},_0x44189a,_0x24a8d6[_0x6c32('0x3e')]);return _0x565c3b[_0x6c32('0x4e')](_0x44189a);}})['then'](function(_0x1ea196){if(_0x1ea196){_0x3b62e4=_0x1ea196[_0x6c32('0x37')];if(!_0x24a8d6[_0x6c32('0x32')]['hasOwnProperty']('nolimit')){_0x44189a['limit']=qs[_0x6c32('0x1d')](_0x24a8d6[_0x6c32('0x32')][_0x6c32('0x1d')]);_0x44189a['offset']=qs['offset'](_0x24a8d6['query']['offset']);}return _0x565c3b[_0x6c32('0x4e')](_0x44189a);}})['then'](function(_0xa00c8e){if(_0xa00c8e){return _0xa00c8e?{'count':_0x3b62e4,'rows':_0xa00c8e}:null;}})[_0x6c32('0x25')](respondWithResult(_0x14d861,null))[_0x6c32('0x42')](handleError(_0x14d861,null));};exports[_0x6c32('0x51')]=function(_0x1b9ee2,_0x573c63,_0x20b5d7){var _0x14f077={};var _0x11c86f={};var _0x4c811f;var _0x28cae3;return db['SugarcrmConfiguration'][_0x6c32('0x4f')]({'where':{'id':_0x1b9ee2[_0x6c32('0x44')]['id']}})[_0x6c32('0x25')](handleEntityNotFound(_0x573c63,null))[_0x6c32('0x25')](function(_0x59c0df){if(_0x59c0df){_0x4c811f=_0x59c0df;_0x11c86f[_0x6c32('0x31')]=_[_0x6c32('0x45')](db['SugarcrmField']['rawAttributes']);_0x11c86f[_0x6c32('0x32')]=_[_0x6c32('0x45')](_0x1b9ee2[_0x6c32('0x32')]);_0x11c86f[_0x6c32('0x33')]=_[_0x6c32('0x35')](_0x11c86f['model'],_0x11c86f[_0x6c32('0x32')]);_0x14f077['attributes']=_['intersection'](_0x11c86f[_0x6c32('0x31')],qs[_0x6c32('0x36')](_0x1b9ee2[_0x6c32('0x32')][_0x6c32('0x36')]));_0x14f077[_0x6c32('0x34')]=_0x14f077[_0x6c32('0x34')][_0x6c32('0x37')]?_0x14f077[_0x6c32('0x34')]:_0x11c86f['model'];_0x14f077[_0x6c32('0x38')]=qs[_0x6c32('0x39')](_0x1b9ee2[_0x6c32('0x32')][_0x6c32('0x39')]);_0x14f077[_0x6c32('0x3a')]=qs[_0x6c32('0x33')](_[_0x6c32('0x4b')](_0x1b9ee2[_0x6c32('0x32')],_0x11c86f[_0x6c32('0x33')]));if(_0x1b9ee2['query'][_0x6c32('0x3b')]){_0x14f077[_0x6c32('0x3a')]=_[_0x6c32('0x3c')](_0x14f077[_0x6c32('0x3a')],{'$or':_[_0x6c32('0x2b')](_0x14f077[_0x6c32('0x34')],function(_0x302bd5){var _0x3a52a6={};_0x3a52a6[_0x302bd5]={'$like':'%'+_0x1b9ee2[_0x6c32('0x32')][_0x6c32('0x3b')]+'%'};return _0x3a52a6;})});}_0x14f077=_[_0x6c32('0x3c')]({},_0x14f077,_0x1b9ee2[_0x6c32('0x3e')]);return _0x4c811f[_0x6c32('0x51')](_0x14f077);}})['then'](function(_0x3a6090){if(_0x3a6090){_0x28cae3=_0x3a6090[_0x6c32('0x37')];if(!_0x1b9ee2[_0x6c32('0x32')][_0x6c32('0x4c')]('nolimit')){_0x14f077[_0x6c32('0x1d')]=qs[_0x6c32('0x1d')](_0x1b9ee2[_0x6c32('0x32')][_0x6c32('0x1d')]);_0x14f077[_0x6c32('0x1c')]=qs[_0x6c32('0x1c')](_0x1b9ee2['query'][_0x6c32('0x1c')]);}return _0x4c811f['getDescriptions'](_0x14f077);}})[_0x6c32('0x25')](function(_0x4d82b0){if(_0x4d82b0){return _0x4d82b0?{'count':_0x28cae3,'rows':_0x4d82b0}:null;}})[_0x6c32('0x25')](respondWithResult(_0x573c63,null))[_0x6c32('0x42')](handleError(_0x573c63,null));}; \ No newline at end of file +var _0xba26=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','include','SugarcrmConfiguration','findAll','rows','catch','show','params','options','find','create','body','update','getFields','SugarcrmField','sort','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','../../mysqldb','status','json','undefined','limit','count','offset','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0xba26,0x111));var _0x6ba2=function(_0x24502f,_0x134350){_0x24502f=_0x24502f-0x0;var _0x402fd9=_0xba26[_0x24502f];return _0x402fd9;};'use strict';var emlformat=require(_0x6ba2('0x0'));var rimraf=require(_0x6ba2('0x1'));var zipdir=require(_0x6ba2('0x2'));var jsonpatch=require(_0x6ba2('0x3'));var rp=require('request-promise');var moment=require(_0x6ba2('0x4'));var BPromise=require(_0x6ba2('0x5'));var Mustache=require(_0x6ba2('0x6'));var util=require(_0x6ba2('0x7'));var path=require(_0x6ba2('0x8'));var sox=require('sox');var csv=require(_0x6ba2('0x9'));var ejs=require(_0x6ba2('0xa'));var fs=require('fs');var fs_extra=require(_0x6ba2('0xb'));var _=require(_0x6ba2('0xc'));var squel=require(_0x6ba2('0xd'));var crypto=require(_0x6ba2('0xe'));var jsforce=require(_0x6ba2('0xf'));var deskjs=require(_0x6ba2('0x10'));var toCsv=require(_0x6ba2('0x9'));var querystring=require(_0x6ba2('0x11'));var Papa=require(_0x6ba2('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ba2('0x13'));var as=require(_0x6ba2('0x14'));var hardwareService=require(_0x6ba2('0x15'));var logger=require(_0x6ba2('0x16'))(_0x6ba2('0x17'));var utils=require(_0x6ba2('0x18'));var config=require(_0x6ba2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ba2('0x1a'))['db'];function respondWithStatusCode(_0x918a68,_0x1abe7f){_0x1abe7f=_0x1abe7f||0xcc;return function(_0x160fd2){if(_0x160fd2){return _0x918a68['sendStatus'](_0x1abe7f);}return _0x918a68[_0x6ba2('0x1b')](_0x1abe7f)['end']();};}function respondWithResult(_0x511f57,_0x6c54d8){_0x6c54d8=_0x6c54d8||0xc8;return function(_0x46abd8){if(_0x46abd8){return _0x511f57[_0x6ba2('0x1b')](_0x6c54d8)[_0x6ba2('0x1c')](_0x46abd8);}};}function respondWithFilteredResult(_0x139ce1,_0x51dd4f){return function(_0x175159){if(_0x175159){var _0x1ad3bc=typeof _0x51dd4f['offset']===_0x6ba2('0x1d')&&typeof _0x51dd4f[_0x6ba2('0x1e')]===_0x6ba2('0x1d');var _0x90ed96=_0x175159[_0x6ba2('0x1f')];var _0x119a8d=_0x1ad3bc?0x0:_0x51dd4f[_0x6ba2('0x20')];var _0xc3506d=_0x1ad3bc?_0x175159[_0x6ba2('0x1f')]:_0x51dd4f[_0x6ba2('0x20')]+_0x51dd4f[_0x6ba2('0x1e')];var _0x2f9de8;if(_0xc3506d>=_0x90ed96){_0xc3506d=_0x90ed96;_0x2f9de8=0xc8;}else{_0x2f9de8=0xce;}_0x139ce1[_0x6ba2('0x1b')](_0x2f9de8);return _0x139ce1['set']('Content-Range',_0x119a8d+'-'+_0xc3506d+'/'+_0x90ed96)[_0x6ba2('0x1c')](_0x175159);}return null;};}function patchUpdates(_0x207e8f){return function(_0x5e0686){try{jsonpatch[_0x6ba2('0x21')](_0x5e0686,_0x207e8f,!![]);}catch(_0x29c522){return BPromise[_0x6ba2('0x22')](_0x29c522);}return _0x5e0686['save']();};}function saveUpdates(_0x340791,_0x40d546){return function(_0x461282){if(_0x461282){return _0x461282['update'](_0x340791)[_0x6ba2('0x23')](function(_0x2fb04b){return _0x2fb04b;});}return null;};}function removeEntity(_0x347089,_0x2d5395){return function(_0x308351){if(_0x308351){return _0x308351[_0x6ba2('0x24')]()[_0x6ba2('0x23')](function(){_0x347089['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9bf7,_0xf89ff2){return function(_0x580226){if(!_0x580226){_0x4b9bf7[_0x6ba2('0x25')](0x194);}return _0x580226;};}function handleError(_0x273257,_0x5cc77f){_0x5cc77f=_0x5cc77f||0x1f4;return function(_0x420e12){logger[_0x6ba2('0x26')](_0x420e12[_0x6ba2('0x27')]);if(_0x420e12[_0x6ba2('0x28')]){delete _0x420e12[_0x6ba2('0x28')];}_0x273257[_0x6ba2('0x1b')](_0x5cc77f)[_0x6ba2('0x29')](_0x420e12);};}exports[_0x6ba2('0x2a')]=function(_0x566d0e,_0x1f8152){var _0x581ca7={},_0x56a78c={},_0x54f2be={'count':0x0,'rows':[]};var _0x444b66=_[_0x6ba2('0x2b')](db['SugarcrmConfiguration'][_0x6ba2('0x2c')],function(_0x4a0b73){return{'name':_0x4a0b73[_0x6ba2('0x2d')],'type':_0x4a0b73[_0x6ba2('0x2e')][_0x6ba2('0x2f')]};});_0x56a78c[_0x6ba2('0x30')]=_['map'](_0x444b66,_0x6ba2('0x28'));_0x56a78c[_0x6ba2('0x31')]=_[_0x6ba2('0x32')](_0x566d0e[_0x6ba2('0x31')]);_0x56a78c[_0x6ba2('0x33')]=_[_0x6ba2('0x34')](_0x56a78c[_0x6ba2('0x30')],_0x56a78c['query']);_0x581ca7[_0x6ba2('0x35')]=_[_0x6ba2('0x34')](_0x56a78c['model'],qs[_0x6ba2('0x36')](_0x566d0e[_0x6ba2('0x31')][_0x6ba2('0x36')]));_0x581ca7[_0x6ba2('0x35')]=_0x581ca7['attributes'][_0x6ba2('0x37')]?_0x581ca7['attributes']:_0x56a78c[_0x6ba2('0x30')];if(!_0x566d0e['query'][_0x6ba2('0x38')](_0x6ba2('0x39'))){_0x581ca7[_0x6ba2('0x1e')]=qs[_0x6ba2('0x1e')](_0x566d0e['query'][_0x6ba2('0x1e')]);_0x581ca7['offset']=qs[_0x6ba2('0x20')](_0x566d0e[_0x6ba2('0x31')][_0x6ba2('0x20')]);}_0x581ca7[_0x6ba2('0x3a')]=qs['sort'](_0x566d0e[_0x6ba2('0x31')]['sort']);_0x581ca7[_0x6ba2('0x3b')]=qs[_0x6ba2('0x33')](_[_0x6ba2('0x3c')](_0x566d0e[_0x6ba2('0x31')],_0x56a78c[_0x6ba2('0x33')]),_0x444b66);if(_0x566d0e[_0x6ba2('0x31')][_0x6ba2('0x3d')]){_0x581ca7[_0x6ba2('0x3b')]=_['merge'](_0x581ca7[_0x6ba2('0x3b')],{'$or':_[_0x6ba2('0x2b')](_0x444b66,function(_0x5573e6){if(_0x5573e6[_0x6ba2('0x2e')]!=='VIRTUAL'){var _0x5eb970={};_0x5eb970[_0x5573e6[_0x6ba2('0x28')]]={'$like':'%'+_0x566d0e[_0x6ba2('0x31')][_0x6ba2('0x3d')]+'%'};return _0x5eb970;}})});}_0x581ca7=_[_0x6ba2('0x3e')]({},_0x581ca7,_0x566d0e['options']);var _0x10e5fb={'where':_0x581ca7[_0x6ba2('0x3b')]};return db['SugarcrmConfiguration'][_0x6ba2('0x1f')](_0x10e5fb)[_0x6ba2('0x23')](function(_0x21fa2b){_0x54f2be[_0x6ba2('0x1f')]=_0x21fa2b;if(_0x566d0e[_0x6ba2('0x31')]['includeAll']){_0x581ca7[_0x6ba2('0x3f')]=[{'all':!![]}];}return db[_0x6ba2('0x40')][_0x6ba2('0x41')](_0x581ca7);})[_0x6ba2('0x23')](function(_0x5abd01){_0x54f2be[_0x6ba2('0x42')]=_0x5abd01;return _0x54f2be;})[_0x6ba2('0x23')](respondWithFilteredResult(_0x1f8152,_0x581ca7))[_0x6ba2('0x43')](handleError(_0x1f8152,null));};exports[_0x6ba2('0x44')]=function(_0x312912,_0x4a14a0){var _0x46933c={'raw':![],'where':{'id':_0x312912[_0x6ba2('0x45')]['id']}},_0x1dbae1={};_0x1dbae1[_0x6ba2('0x30')]=_[_0x6ba2('0x32')](db[_0x6ba2('0x40')][_0x6ba2('0x2c')]);_0x1dbae1['query']=_['keys'](_0x312912['query']);_0x1dbae1[_0x6ba2('0x33')]=_[_0x6ba2('0x34')](_0x1dbae1[_0x6ba2('0x30')],_0x1dbae1[_0x6ba2('0x31')]);_0x46933c[_0x6ba2('0x35')]=_[_0x6ba2('0x34')](_0x1dbae1[_0x6ba2('0x30')],qs['fields'](_0x312912[_0x6ba2('0x31')][_0x6ba2('0x36')]));_0x46933c['attributes']=_0x46933c[_0x6ba2('0x35')][_0x6ba2('0x37')]?_0x46933c[_0x6ba2('0x35')]:_0x1dbae1['model'];if(_0x312912[_0x6ba2('0x31')]['includeAll']){_0x46933c['include']=[{'all':!![]}];}_0x46933c=_[_0x6ba2('0x3e')]({},_0x46933c,_0x312912[_0x6ba2('0x46')]);return db[_0x6ba2('0x40')][_0x6ba2('0x47')](_0x46933c)[_0x6ba2('0x23')](handleEntityNotFound(_0x4a14a0,null))[_0x6ba2('0x23')](respondWithResult(_0x4a14a0,null))[_0x6ba2('0x43')](handleError(_0x4a14a0,null));};exports[_0x6ba2('0x48')]=function(_0x25639a,_0x38f876){return db['SugarcrmConfiguration']['create'](_0x25639a[_0x6ba2('0x49')],{})['then'](respondWithResult(_0x38f876,0xc9))[_0x6ba2('0x43')](handleError(_0x38f876,null));};exports[_0x6ba2('0x4a')]=function(_0x3a0b7b,_0x5854c5){if(_0x3a0b7b['body']['id']){delete _0x3a0b7b[_0x6ba2('0x49')]['id'];}return db[_0x6ba2('0x40')][_0x6ba2('0x47')]({'where':{'id':_0x3a0b7b[_0x6ba2('0x45')]['id']}})[_0x6ba2('0x23')](handleEntityNotFound(_0x5854c5,null))[_0x6ba2('0x23')](saveUpdates(_0x3a0b7b[_0x6ba2('0x49')],null))[_0x6ba2('0x23')](respondWithResult(_0x5854c5,null))[_0x6ba2('0x43')](handleError(_0x5854c5,null));};exports[_0x6ba2('0x24')]=function(_0x53a28c,_0x252df6){return db[_0x6ba2('0x40')][_0x6ba2('0x47')]({'where':{'id':_0x53a28c[_0x6ba2('0x45')]['id']}})['then'](handleEntityNotFound(_0x252df6,null))[_0x6ba2('0x23')](removeEntity(_0x252df6,null))[_0x6ba2('0x43')](handleError(_0x252df6,null));};exports[_0x6ba2('0x4b')]=function(_0x56da8a,_0x52624f,_0x13ef46){var _0x33a9e2={};var _0x5639b3={};var _0x53383b;var _0x281f7f;return db[_0x6ba2('0x40')]['findOne']({'where':{'id':_0x56da8a[_0x6ba2('0x45')]['id']}})[_0x6ba2('0x23')](handleEntityNotFound(_0x52624f,null))[_0x6ba2('0x23')](function(_0x39c67c){if(_0x39c67c){_0x53383b=_0x39c67c;_0x5639b3['model']=_[_0x6ba2('0x32')](db[_0x6ba2('0x4c')][_0x6ba2('0x2c')]);_0x5639b3[_0x6ba2('0x31')]=_[_0x6ba2('0x32')](_0x56da8a[_0x6ba2('0x31')]);_0x5639b3[_0x6ba2('0x33')]=_[_0x6ba2('0x34')](_0x5639b3['model'],_0x5639b3[_0x6ba2('0x31')]);_0x33a9e2[_0x6ba2('0x35')]=_[_0x6ba2('0x34')](_0x5639b3[_0x6ba2('0x30')],qs['fields'](_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x36')]));_0x33a9e2['attributes']=_0x33a9e2[_0x6ba2('0x35')][_0x6ba2('0x37')]?_0x33a9e2[_0x6ba2('0x35')]:_0x5639b3[_0x6ba2('0x30')];_0x33a9e2[_0x6ba2('0x3a')]=qs[_0x6ba2('0x4d')](_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x4d')]);_0x33a9e2[_0x6ba2('0x3b')]=qs['filters'](_[_0x6ba2('0x3c')](_0x56da8a[_0x6ba2('0x31')],_0x5639b3[_0x6ba2('0x33')]));if(_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x3d')]){_0x33a9e2[_0x6ba2('0x3b')]=_[_0x6ba2('0x3e')](_0x33a9e2[_0x6ba2('0x3b')],{'$or':_[_0x6ba2('0x2b')](_0x33a9e2[_0x6ba2('0x35')],function(_0x4062f2){var _0x56fdb0={};_0x56fdb0[_0x4062f2]={'$like':'%'+_0x56da8a[_0x6ba2('0x31')]['filter']+'%'};return _0x56fdb0;})});}_0x33a9e2=_[_0x6ba2('0x3e')]({},_0x33a9e2,_0x56da8a[_0x6ba2('0x46')]);return _0x53383b[_0x6ba2('0x4b')](_0x33a9e2);}})[_0x6ba2('0x23')](function(_0x286158){if(_0x286158){_0x281f7f=_0x286158[_0x6ba2('0x37')];if(!_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x38')]('nolimit')){_0x33a9e2[_0x6ba2('0x1e')]=qs[_0x6ba2('0x1e')](_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x1e')]);_0x33a9e2[_0x6ba2('0x20')]=qs[_0x6ba2('0x20')](_0x56da8a[_0x6ba2('0x31')][_0x6ba2('0x20')]);}return _0x53383b[_0x6ba2('0x4b')](_0x33a9e2);}})['then'](function(_0xcfcf6d){if(_0xcfcf6d){return _0xcfcf6d?{'count':_0x281f7f,'rows':_0xcfcf6d}:null;}})[_0x6ba2('0x23')](respondWithResult(_0x52624f,null))[_0x6ba2('0x43')](handleError(_0x52624f,null));};exports['getSubjects']=function(_0x4f0df4,_0x25f3a5,_0x45089a){var _0x29ea1c={};var _0x165731={};var _0x5d07c3;var _0x3e0b1e;return db[_0x6ba2('0x40')][_0x6ba2('0x4e')]({'where':{'id':_0x4f0df4['params']['id']}})['then'](handleEntityNotFound(_0x25f3a5,null))[_0x6ba2('0x23')](function(_0x194046){if(_0x194046){_0x5d07c3=_0x194046;_0x165731[_0x6ba2('0x30')]=_[_0x6ba2('0x32')](db[_0x6ba2('0x4c')][_0x6ba2('0x2c')]);_0x165731['query']=_['keys'](_0x4f0df4[_0x6ba2('0x31')]);_0x165731[_0x6ba2('0x33')]=_[_0x6ba2('0x34')](_0x165731[_0x6ba2('0x30')],_0x165731[_0x6ba2('0x31')]);_0x29ea1c[_0x6ba2('0x35')]=_[_0x6ba2('0x34')](_0x165731['model'],qs['fields'](_0x4f0df4[_0x6ba2('0x31')][_0x6ba2('0x36')]));_0x29ea1c['attributes']=_0x29ea1c['attributes']['length']?_0x29ea1c[_0x6ba2('0x35')]:_0x165731['model'];_0x29ea1c[_0x6ba2('0x3a')]=qs[_0x6ba2('0x4d')](_0x4f0df4['query']['sort']);_0x29ea1c[_0x6ba2('0x3b')]=qs[_0x6ba2('0x33')](_[_0x6ba2('0x3c')](_0x4f0df4['query'],_0x165731['filters']));if(_0x4f0df4[_0x6ba2('0x31')][_0x6ba2('0x3d')]){_0x29ea1c[_0x6ba2('0x3b')]=_[_0x6ba2('0x3e')](_0x29ea1c[_0x6ba2('0x3b')],{'$or':_[_0x6ba2('0x2b')](_0x29ea1c['attributes'],function(_0x538fd1){var _0x54f05f={};_0x54f05f[_0x538fd1]={'$like':'%'+_0x4f0df4['query'][_0x6ba2('0x3d')]+'%'};return _0x54f05f;})});}_0x29ea1c=_[_0x6ba2('0x3e')]({},_0x29ea1c,_0x4f0df4[_0x6ba2('0x46')]);return _0x5d07c3['getSubjects'](_0x29ea1c);}})['then'](function(_0x32cfa5){if(_0x32cfa5){_0x3e0b1e=_0x32cfa5['length'];if(!_0x4f0df4[_0x6ba2('0x31')]['hasOwnProperty'](_0x6ba2('0x39'))){_0x29ea1c['limit']=qs[_0x6ba2('0x1e')](_0x4f0df4[_0x6ba2('0x31')][_0x6ba2('0x1e')]);_0x29ea1c[_0x6ba2('0x20')]=qs['offset'](_0x4f0df4['query'][_0x6ba2('0x20')]);}return _0x5d07c3[_0x6ba2('0x4f')](_0x29ea1c);}})[_0x6ba2('0x23')](function(_0x44ee7a){if(_0x44ee7a){return _0x44ee7a?{'count':_0x3e0b1e,'rows':_0x44ee7a}:null;}})[_0x6ba2('0x23')](respondWithResult(_0x25f3a5,null))['catch'](handleError(_0x25f3a5,null));};exports[_0x6ba2('0x50')]=function(_0x41e5e1,_0x3589a1,_0x4a8568){var _0x112b4d={};var _0x59e031={};var _0x2e9a7a;var _0x1f2db0;return db['SugarcrmConfiguration'][_0x6ba2('0x4e')]({'where':{'id':_0x41e5e1[_0x6ba2('0x45')]['id']}})[_0x6ba2('0x23')](handleEntityNotFound(_0x3589a1,null))[_0x6ba2('0x23')](function(_0x4173f0){if(_0x4173f0){_0x2e9a7a=_0x4173f0;_0x59e031[_0x6ba2('0x30')]=_[_0x6ba2('0x32')](db['SugarcrmField'][_0x6ba2('0x2c')]);_0x59e031[_0x6ba2('0x31')]=_[_0x6ba2('0x32')](_0x41e5e1[_0x6ba2('0x31')]);_0x59e031[_0x6ba2('0x33')]=_[_0x6ba2('0x34')](_0x59e031[_0x6ba2('0x30')],_0x59e031[_0x6ba2('0x31')]);_0x112b4d[_0x6ba2('0x35')]=_[_0x6ba2('0x34')](_0x59e031[_0x6ba2('0x30')],qs[_0x6ba2('0x36')](_0x41e5e1[_0x6ba2('0x31')][_0x6ba2('0x36')]));_0x112b4d[_0x6ba2('0x35')]=_0x112b4d[_0x6ba2('0x35')][_0x6ba2('0x37')]?_0x112b4d[_0x6ba2('0x35')]:_0x59e031[_0x6ba2('0x30')];_0x112b4d[_0x6ba2('0x3a')]=qs[_0x6ba2('0x4d')](_0x41e5e1[_0x6ba2('0x31')]['sort']);_0x112b4d[_0x6ba2('0x3b')]=qs['filters'](_['pick'](_0x41e5e1[_0x6ba2('0x31')],_0x59e031[_0x6ba2('0x33')]));if(_0x41e5e1[_0x6ba2('0x31')]['filter']){_0x112b4d[_0x6ba2('0x3b')]=_[_0x6ba2('0x3e')](_0x112b4d[_0x6ba2('0x3b')],{'$or':_[_0x6ba2('0x2b')](_0x112b4d[_0x6ba2('0x35')],function(_0x350ef5){var _0x86377c={};_0x86377c[_0x350ef5]={'$like':'%'+_0x41e5e1['query']['filter']+'%'};return _0x86377c;})});}_0x112b4d=_['merge']({},_0x112b4d,_0x41e5e1['options']);return _0x2e9a7a['getDescriptions'](_0x112b4d);}})[_0x6ba2('0x23')](function(_0x53cb81){if(_0x53cb81){_0x1f2db0=_0x53cb81[_0x6ba2('0x37')];if(!_0x41e5e1[_0x6ba2('0x31')][_0x6ba2('0x38')](_0x6ba2('0x39'))){_0x112b4d['limit']=qs[_0x6ba2('0x1e')](_0x41e5e1['query'][_0x6ba2('0x1e')]);_0x112b4d[_0x6ba2('0x20')]=qs['offset'](_0x41e5e1['query'][_0x6ba2('0x20')]);}return _0x2e9a7a[_0x6ba2('0x50')](_0x112b4d);}})[_0x6ba2('0x23')](function(_0x87544f){if(_0x87544f){return _0x87544f?{'count':_0x1f2db0,'rows':_0x87544f}:null;}})[_0x6ba2('0x23')](respondWithResult(_0x3589a1,null))[_0x6ba2('0x43')](handleError(_0x3589a1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c703b15..12faf33 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 _0xf0f0=['bluebird','request-promise','../../config/environment','exports','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0f0,0x8c));var _0x0f0f=function(_0x3ce87a,_0xe59e94){_0x3ce87a=_0x3ce87a-0x0;var _0x5dfcea=_0xf0f0[_0x3ce87a];return _0x5dfcea;};'use strict';var _=require(_0x0f0f('0x0'));var util=require('util');var logger=require(_0x0f0f('0x1'))(_0x0f0f('0x2'));var moment=require(_0x0f0f('0x3'));var BPromise=require(_0x0f0f('0x4'));var rp=require(_0x0f0f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f0f('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x0f0f('0x7')]=function(_0x4d2733,_0xd378a5){return _0x4d2733['define']('SugarcrmConfiguration',attributes,{'tableName':_0x0f0f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe359=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration'];(function(_0x139004,_0x25ba4b){var _0x539831=function(_0x3e4a1c){while(--_0x3e4a1c){_0x139004['push'](_0x139004['shift']());}};_0x539831(++_0x25ba4b);}(_0xe359,0x12c));var _0x9e35=function(_0x480da6,_0x430a42){_0x480da6=_0x480da6-0x0;var _0x8f9b7f=_0xe359[_0x480da6];return _0x8f9b7f;};'use strict';var _=require(_0x9e35('0x0'));var util=require(_0x9e35('0x1'));var logger=require(_0x9e35('0x2'))(_0x9e35('0x3'));var moment=require(_0x9e35('0x4'));var BPromise=require(_0x9e35('0x5'));var rp=require(_0x9e35('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e35('0x7'));var config=require(_0x9e35('0x8'));var attributes=require(_0x9e35('0x9'));module[_0x9e35('0xa')]=function(_0x241885,_0x252554){return _0x241885['define'](_0x9e35('0xb'),attributes,{'tableName':_0x9e35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 48fa069..c116562 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 _0x8bdc=['SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x4f3f31,_0x12f348){var _0x87dbd0=function(_0x4be664){while(--_0x4be664){_0x4f3f31['push'](_0x4f3f31['shift']());}};_0x87dbd0(++_0x12f348);}(_0x8bdc,0x13c));var _0xc8bd=function(_0x2738f5,_0x57cbea){_0x2738f5=_0x2738f5-0x0;var _0x24f291=_0x8bdc[_0x2738f5];return _0x24f291;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc8bd('0x0'));var BPromise=require(_0xc8bd('0x1'));var rs=require(_0xc8bd('0x2'));var fs=require('fs');var Redis=require(_0xc8bd('0x3'));var db=require(_0xc8bd('0x4'))['db'];var utils=require(_0xc8bd('0x5'));var logger=require(_0xc8bd('0x6'))(_0xc8bd('0x7'));var config=require(_0xc8bd('0x8'));var jayson=require(_0xc8bd('0x9'));var client=jayson[_0xc8bd('0xa')][_0xc8bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf1e60f,_0x43604e,_0x347982){return new BPromise(function(_0x392a31,_0x94352){return client[_0xc8bd('0xc')](_0xf1e60f,_0x347982)[_0xc8bd('0xd')](function(_0x171345){logger[_0xc8bd('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x43604e,'request\x20sent');logger[_0xc8bd('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x43604e,_0xc8bd('0x10'),JSON[_0xc8bd('0x11')](_0x171345));if(_0x171345[_0xc8bd('0x12')]){if(_0x171345[_0xc8bd('0x12')][_0xc8bd('0x13')]===0x1f4){logger[_0xc8bd('0x12')](_0xc8bd('0x14'),_0x43604e,_0x171345[_0xc8bd('0x12')]['message']);return _0x94352(_0x171345[_0xc8bd('0x12')][_0xc8bd('0x15')]);}logger[_0xc8bd('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x43604e,_0x171345['error'][_0xc8bd('0x15')]);return _0x392a31(_0x171345[_0xc8bd('0x12')][_0xc8bd('0x15')]);}else{logger[_0xc8bd('0xe')](_0xc8bd('0x14'),_0x43604e,'request\x20sent');_0x392a31(_0x171345[_0xc8bd('0x16')]['message']);}})[_0xc8bd('0x17')](function(_0x5949be){logger[_0xc8bd('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x43604e,_0x5949be);_0x94352(_0x5949be);});});} \ No newline at end of file +var _0x3279=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x187644,_0x51e58c){var _0x347d58=function(_0x209628){while(--_0x209628){_0x187644['push'](_0x187644['shift']());}};_0x347d58(++_0x51e58c);}(_0x3279,0x140));var _0x9327=function(_0x55a792,_0x56650d){_0x55a792=_0x55a792-0x0;var _0x6aaabb=_0x3279[_0x55a792];return _0x6aaabb;};'use strict';var _=require(_0x9327('0x0'));var util=require(_0x9327('0x1'));var moment=require(_0x9327('0x2'));var BPromise=require(_0x9327('0x3'));var rs=require(_0x9327('0x4'));var fs=require('fs');var Redis=require(_0x9327('0x5'));var db=require(_0x9327('0x6'))['db'];var utils=require(_0x9327('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9327('0x8'));var jayson=require(_0x9327('0x9'));var client=jayson[_0x9327('0xa')][_0x9327('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x450fe8,_0x3021bc,_0x300fa6){return new BPromise(function(_0x113940,_0x2323c6){return client[_0x9327('0xc')](_0x450fe8,_0x300fa6)['then'](function(_0x218c70){logger[_0x9327('0xd')](_0x9327('0xe'),_0x3021bc,_0x9327('0xf'));logger[_0x9327('0x10')](_0x9327('0x11'),_0x3021bc,_0x9327('0xf'),JSON[_0x9327('0x12')](_0x218c70));if(_0x218c70[_0x9327('0x13')]){if(_0x218c70[_0x9327('0x13')][_0x9327('0x14')]===0x1f4){logger[_0x9327('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3021bc,_0x218c70['error'][_0x9327('0x15')]);return _0x2323c6(_0x218c70['error'][_0x9327('0x15')]);}logger[_0x9327('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3021bc,_0x218c70[_0x9327('0x13')][_0x9327('0x15')]);return _0x113940(_0x218c70['error'][_0x9327('0x15')]);}else{logger[_0x9327('0xd')](_0x9327('0xe'),_0x3021bc,'request\x20sent');_0x113940(_0x218c70['result'][_0x9327('0x15')]);}})[_0x9327('0x16')](function(_0xaa25bc){logger[_0x9327('0x13')](_0x9327('0xe'),_0x3021bc,_0xaa25bc);_0x2323c6(_0xaa25bc);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7d7c5a6..2550125 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 _0xff55=['connect-timeout','express','Router','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xff55,0x9f));var _0x5ff5=function(_0x49b716,_0x3ff724){_0x49b716=_0x49b716-0x0;var _0x19ee5c=_0xff55[_0x49b716];return _0x19ee5c;};'use strict';var multer=require(_0x5ff5('0x0'));var util=require(_0x5ff5('0x1'));var path=require(_0x5ff5('0x2'));var timeout=require(_0x5ff5('0x3'));var express=require(_0x5ff5('0x4'));var router=express[_0x5ff5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ff5('0x6'));var controller=require(_0x5ff5('0x7'));router['get']('/',auth[_0x5ff5('0x8')](),controller['index']);router[_0x5ff5('0x9')](_0x5ff5('0xa'),auth[_0x5ff5('0x8')](),controller[_0x5ff5('0xb')]);router['post']('/',auth[_0x5ff5('0x8')](),controller[_0x5ff5('0xc')]);router[_0x5ff5('0xd')](_0x5ff5('0xa'),auth[_0x5ff5('0x8')](),controller[_0x5ff5('0xe')]);router[_0x5ff5('0xf')](_0x5ff5('0xa'),auth[_0x5ff5('0x8')](),controller[_0x5ff5('0x10')]);module[_0x5ff5('0x11')]=router; \ No newline at end of file +var _0x6e2f=['put','update','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','create'];(function(_0x272bd0,_0xd0aa6a){var _0x11e096=function(_0x4b0b0a){while(--_0x4b0b0a){_0x272bd0['push'](_0x272bd0['shift']());}};_0x11e096(++_0xd0aa6a);}(_0x6e2f,0xe3));var _0xf6e2=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x6e2f[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf6e2('0x0'));var timeout=require(_0xf6e2('0x1'));var express=require('express');var router=express[_0xf6e2('0x2')]();var fs_extra=require(_0xf6e2('0x3'));var auth=require(_0xf6e2('0x4'));var interaction=require(_0xf6e2('0x5'));var config=require(_0xf6e2('0x6'));var controller=require(_0xf6e2('0x7'));router['get']('/',auth[_0xf6e2('0x8')](),controller[_0xf6e2('0x9')]);router[_0xf6e2('0xa')](_0xf6e2('0xb'),auth[_0xf6e2('0x8')](),controller['show']);router['post']('/',auth[_0xf6e2('0x8')](),controller[_0xf6e2('0xc')]);router[_0xf6e2('0xd')](_0xf6e2('0xb'),auth[_0xf6e2('0x8')](),controller[_0xf6e2('0xe')]);router[_0xf6e2('0xf')](_0xf6e2('0xb'),auth[_0xf6e2('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 23156b5..c46ed1a 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 _0x9dc0=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x336c57,_0x382cbf){var _0x26d9cf=function(_0x1a0f25){while(--_0x1a0f25){_0x336c57['push'](_0x336c57['shift']());}};_0x26d9cf(++_0x382cbf);}(_0x9dc0,0x17a));var _0x09dc=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x9dc0[_0x5dbb84];return _0x1d6eae;};'use strict';var Sequelize=require(_0x09dc('0x0'));module['exports']={'type':{'type':Sequelize[_0x09dc('0x1')](_0x09dc('0x2'),_0x09dc('0x3'),_0x09dc('0x4'),'keyValue',_0x09dc('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x09dc('0x6')]},'key':{'type':Sequelize[_0x09dc('0x6')]},'keyType':{'type':Sequelize[_0x09dc('0x1')](_0x09dc('0x2'),_0x09dc('0x3'),_0x09dc('0x4'))},'keyContent':{'type':Sequelize[_0x09dc('0x6')]},'idField':{'type':Sequelize[_0x09dc('0x6')]},'nameField':{'type':Sequelize[_0x09dc('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e88=['BOOLEAN','exports','ENUM','variable','customVariable','string','STRING'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0x1e88,0x19e));var _0x81e8=function(_0x3cca19,_0x3d2837){_0x3cca19=_0x3cca19-0x0;var _0x3ae1db=_0x1e88[_0x3cca19];return _0x3ae1db;};'use strict';var Sequelize=require('sequelize');module[_0x81e8('0x0')]={'type':{'type':Sequelize[_0x81e8('0x1')]('string',_0x81e8('0x2'),_0x81e8('0x3'),'keyValue','picklist'),'defaultValue':_0x81e8('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x81e8('0x5')]},'keyType':{'type':Sequelize[_0x81e8('0x1')](_0x81e8('0x4'),_0x81e8('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x81e8('0x5')]},'idField':{'type':Sequelize[_0x81e8('0x5')]},'nameField':{'type':Sequelize[_0x81e8('0x5')]},'customField':{'type':Sequelize[_0x81e8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x81e8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 9ef6d46..40836a2 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 _0xb1fb=['save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','SugarcrmField','includeAll','findAll','rows','catch','show','params','rawAttributes','include','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x5b1acd,_0x4f7f2f){var _0x1ed300=function(_0x1ee3ef){while(--_0x1ee3ef){_0x5b1acd['push'](_0x5b1acd['shift']());}};_0x1ed300(++_0x4f7f2f);}(_0xb1fb,0x1c8));var _0xbb1f=function(_0x4834f3,_0x3fbff9){_0x4834f3=_0x4834f3-0x0;var _0x36988e=_0xb1fb[_0x4834f3];return _0x36988e;};'use strict';var emlformat=require(_0xbb1f('0x0'));var rimraf=require(_0xbb1f('0x1'));var zipdir=require(_0xbb1f('0x2'));var jsonpatch=require(_0xbb1f('0x3'));var rp=require(_0xbb1f('0x4'));var moment=require(_0xbb1f('0x5'));var BPromise=require(_0xbb1f('0x6'));var Mustache=require(_0xbb1f('0x7'));var util=require(_0xbb1f('0x8'));var path=require(_0xbb1f('0x9'));var sox=require(_0xbb1f('0xa'));var csv=require(_0xbb1f('0xb'));var ejs=require(_0xbb1f('0xc'));var fs=require('fs');var fs_extra=require(_0xbb1f('0xd'));var _=require(_0xbb1f('0xe'));var squel=require(_0xbb1f('0xf'));var crypto=require(_0xbb1f('0x10'));var jsforce=require(_0xbb1f('0x11'));var deskjs=require(_0xbb1f('0x12'));var toCsv=require('to-csv');var querystring=require(_0xbb1f('0x13'));var Papa=require(_0xbb1f('0x14'));var Redis=require(_0xbb1f('0x15'));var authService=require(_0xbb1f('0x16'));var qs=require(_0xbb1f('0x17'));var as=require(_0xbb1f('0x18'));var hardwareService=require(_0xbb1f('0x19'));var logger=require(_0xbb1f('0x1a'))(_0xbb1f('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb1f('0x1c'));var db=require(_0xbb1f('0x1d'))['db'];function respondWithStatusCode(_0x441a2f,_0x331e79){_0x331e79=_0x331e79||0xcc;return function(_0x53b67e){if(_0x53b67e){return _0x441a2f[_0xbb1f('0x1e')](_0x331e79);}return _0x441a2f[_0xbb1f('0x1f')](_0x331e79)[_0xbb1f('0x20')]();};}function respondWithResult(_0x53557e,_0x2d34d8){_0x2d34d8=_0x2d34d8||0xc8;return function(_0x5762db){if(_0x5762db){return _0x53557e['status'](_0x2d34d8)[_0xbb1f('0x21')](_0x5762db);}};}function respondWithFilteredResult(_0x287e27,_0x537669){return function(_0x109484){if(_0x109484){var _0x4ad44f=typeof _0x537669[_0xbb1f('0x22')]==='undefined'&&typeof _0x537669['limit']===_0xbb1f('0x23');var _0x4760d0=_0x109484[_0xbb1f('0x24')];var _0xe25b1d=_0x4ad44f?0x0:_0x537669[_0xbb1f('0x22')];var _0x11c80e=_0x4ad44f?_0x109484[_0xbb1f('0x24')]:_0x537669[_0xbb1f('0x22')]+_0x537669[_0xbb1f('0x25')];var _0x4866bd;if(_0x11c80e>=_0x4760d0){_0x11c80e=_0x4760d0;_0x4866bd=0xc8;}else{_0x4866bd=0xce;}_0x287e27[_0xbb1f('0x1f')](_0x4866bd);return _0x287e27[_0xbb1f('0x26')](_0xbb1f('0x27'),_0xe25b1d+'-'+_0x11c80e+'/'+_0x4760d0)[_0xbb1f('0x21')](_0x109484);}return null;};}function patchUpdates(_0x2d2911){return function(_0x5a97a3){try{jsonpatch[_0xbb1f('0x28')](_0x5a97a3,_0x2d2911,!![]);}catch(_0x5c09b4){return BPromise[_0xbb1f('0x29')](_0x5c09b4);}return _0x5a97a3[_0xbb1f('0x2a')]();};}function saveUpdates(_0x306a59,_0x4ad30a){return function(_0x32ea01){if(_0x32ea01){return _0x32ea01[_0xbb1f('0x2b')](_0x306a59)[_0xbb1f('0x2c')](function(_0x5a5f7f){return _0x5a5f7f;});}return null;};}function removeEntity(_0xe324c6,_0x3c6f77){return function(_0x4853d6){if(_0x4853d6){return _0x4853d6[_0xbb1f('0x2d')]()[_0xbb1f('0x2c')](function(){_0xe324c6[_0xbb1f('0x1f')](0xcc)[_0xbb1f('0x20')]();});}};}function handleEntityNotFound(_0x117452,_0x5ccf47){return function(_0x560632){if(!_0x560632){_0x117452[_0xbb1f('0x1e')](0x194);}return _0x560632;};}function handleError(_0x44a7fd,_0x5b94fb){_0x5b94fb=_0x5b94fb||0x1f4;return function(_0x5b3b01){logger[_0xbb1f('0x2e')](_0x5b3b01[_0xbb1f('0x2f')]);if(_0x5b3b01[_0xbb1f('0x30')]){delete _0x5b3b01[_0xbb1f('0x30')];}_0x44a7fd[_0xbb1f('0x1f')](_0x5b94fb)[_0xbb1f('0x31')](_0x5b3b01);};}exports[_0xbb1f('0x32')]=function(_0x1048fc,_0x31431a){var _0x2f4a5d={},_0x3de04c={},_0xf929bb={'count':0x0,'rows':[]};var _0x5cd474=_[_0xbb1f('0x33')](db['SugarcrmField']['rawAttributes'],function(_0x585000){return{'name':_0x585000[_0xbb1f('0x34')],'type':_0x585000[_0xbb1f('0x35')][_0xbb1f('0x36')]};});_0x3de04c[_0xbb1f('0x37')]=_['map'](_0x5cd474,_0xbb1f('0x30'));_0x3de04c[_0xbb1f('0x38')]=_[_0xbb1f('0x39')](_0x1048fc[_0xbb1f('0x38')]);_0x3de04c['filters']=_['intersection'](_0x3de04c[_0xbb1f('0x37')],_0x3de04c['query']);_0x2f4a5d[_0xbb1f('0x3a')]=_[_0xbb1f('0x3b')](_0x3de04c['model'],qs['fields'](_0x1048fc[_0xbb1f('0x38')][_0xbb1f('0x3c')]));_0x2f4a5d[_0xbb1f('0x3a')]=_0x2f4a5d['attributes'][_0xbb1f('0x3d')]?_0x2f4a5d[_0xbb1f('0x3a')]:_0x3de04c[_0xbb1f('0x37')];if(!_0x1048fc[_0xbb1f('0x38')]['hasOwnProperty'](_0xbb1f('0x3e'))){_0x2f4a5d[_0xbb1f('0x25')]=qs[_0xbb1f('0x25')](_0x1048fc[_0xbb1f('0x38')][_0xbb1f('0x25')]);_0x2f4a5d[_0xbb1f('0x22')]=qs[_0xbb1f('0x22')](_0x1048fc['query']['offset']);}_0x2f4a5d['order']=qs[_0xbb1f('0x3f')](_0x1048fc[_0xbb1f('0x38')][_0xbb1f('0x3f')]);_0x2f4a5d[_0xbb1f('0x40')]=qs[_0xbb1f('0x41')](_[_0xbb1f('0x42')](_0x1048fc[_0xbb1f('0x38')],_0x3de04c['filters']),_0x5cd474);if(_0x1048fc['query'][_0xbb1f('0x43')]){_0x2f4a5d[_0xbb1f('0x40')]=_['merge'](_0x2f4a5d[_0xbb1f('0x40')],{'$or':_['map'](_0x5cd474,function(_0x59bd8e){if(_0x59bd8e[_0xbb1f('0x35')]!==_0xbb1f('0x44')){var _0x34bd46={};_0x34bd46[_0x59bd8e[_0xbb1f('0x30')]]={'$like':'%'+_0x1048fc[_0xbb1f('0x38')][_0xbb1f('0x43')]+'%'};return _0x34bd46;}})});}_0x2f4a5d=_['merge']({},_0x2f4a5d,_0x1048fc[_0xbb1f('0x45')]);var _0x4a185f={'where':_0x2f4a5d[_0xbb1f('0x40')]};return db[_0xbb1f('0x46')][_0xbb1f('0x24')](_0x4a185f)[_0xbb1f('0x2c')](function(_0x1222d4){_0xf929bb[_0xbb1f('0x24')]=_0x1222d4;if(_0x1048fc[_0xbb1f('0x38')][_0xbb1f('0x47')]){_0x2f4a5d['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xbb1f('0x48')](_0x2f4a5d);})[_0xbb1f('0x2c')](function(_0x1a8a5c){_0xf929bb[_0xbb1f('0x49')]=_0x1a8a5c;return _0xf929bb;})[_0xbb1f('0x2c')](respondWithFilteredResult(_0x31431a,_0x2f4a5d))[_0xbb1f('0x4a')](handleError(_0x31431a,null));};exports[_0xbb1f('0x4b')]=function(_0x315a52,_0x280f7c){var _0x4e9bfe={'raw':!![],'where':{'id':_0x315a52[_0xbb1f('0x4c')]['id']}},_0x4a50b1={};_0x4a50b1[_0xbb1f('0x37')]=_['keys'](db[_0xbb1f('0x46')][_0xbb1f('0x4d')]);_0x4a50b1[_0xbb1f('0x38')]=_[_0xbb1f('0x39')](_0x315a52[_0xbb1f('0x38')]);_0x4a50b1['filters']=_[_0xbb1f('0x3b')](_0x4a50b1[_0xbb1f('0x37')],_0x4a50b1['query']);_0x4e9bfe['attributes']=_[_0xbb1f('0x3b')](_0x4a50b1['model'],qs[_0xbb1f('0x3c')](_0x315a52[_0xbb1f('0x38')][_0xbb1f('0x3c')]));_0x4e9bfe[_0xbb1f('0x3a')]=_0x4e9bfe[_0xbb1f('0x3a')][_0xbb1f('0x3d')]?_0x4e9bfe['attributes']:_0x4a50b1['model'];if(_0x315a52[_0xbb1f('0x38')][_0xbb1f('0x47')]){_0x4e9bfe[_0xbb1f('0x4e')]=[{'all':!![]}];}_0x4e9bfe=_[_0xbb1f('0x4f')]({},_0x4e9bfe,_0x315a52[_0xbb1f('0x45')]);return db[_0xbb1f('0x46')][_0xbb1f('0x50')](_0x4e9bfe)[_0xbb1f('0x2c')](handleEntityNotFound(_0x280f7c,null))[_0xbb1f('0x2c')](respondWithResult(_0x280f7c,null))['catch'](handleError(_0x280f7c,null));};exports[_0xbb1f('0x51')]=function(_0x5aa218,_0xfaf644){return db[_0xbb1f('0x46')]['create'](_0x5aa218[_0xbb1f('0x52')],{})[_0xbb1f('0x2c')](respondWithResult(_0xfaf644,0xc9))[_0xbb1f('0x4a')](handleError(_0xfaf644,null));};exports[_0xbb1f('0x2b')]=function(_0x2c594e,_0x1cc24b){if(_0x2c594e[_0xbb1f('0x52')]['id']){delete _0x2c594e[_0xbb1f('0x52')]['id'];}return db[_0xbb1f('0x46')][_0xbb1f('0x50')]({'where':{'id':_0x2c594e[_0xbb1f('0x4c')]['id']}})[_0xbb1f('0x2c')](handleEntityNotFound(_0x1cc24b,null))[_0xbb1f('0x2c')](saveUpdates(_0x2c594e[_0xbb1f('0x52')],null))[_0xbb1f('0x2c')](respondWithResult(_0x1cc24b,null))[_0xbb1f('0x4a')](handleError(_0x1cc24b,null));};exports['destroy']=function(_0x19c2f5,_0x5db583){return db[_0xbb1f('0x46')][_0xbb1f('0x50')]({'where':{'id':_0x19c2f5['params']['id']}})['then'](handleEntityNotFound(_0x5db583,null))['then'](removeEntity(_0x5db583,null))[_0xbb1f('0x4a')](handleError(_0x5db583,null));}; \ No newline at end of file +var _0xa366=['eml-format','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmField','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa366,0x114));var _0x6a36=function(_0x55d550,_0x487a5c){_0x55d550=_0x55d550-0x0;var _0x3fc7b0=_0xa366[_0x55d550];return _0x3fc7b0;};'use strict';var emlformat=require(_0x6a36('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6a36('0x1'));var rp=require(_0x6a36('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6a36('0x3'));var path=require('path');var sox=require(_0x6a36('0x4'));var csv=require(_0x6a36('0x5'));var ejs=require(_0x6a36('0x6'));var fs=require('fs');var fs_extra=require(_0x6a36('0x7'));var _=require(_0x6a36('0x8'));var squel=require('squel');var crypto=require(_0x6a36('0x9'));var jsforce=require(_0x6a36('0xa'));var deskjs=require(_0x6a36('0xb'));var toCsv=require(_0x6a36('0x5'));var querystring=require(_0x6a36('0xc'));var Papa=require(_0x6a36('0xd'));var Redis=require(_0x6a36('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6a36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a36('0x10'));var logger=require(_0x6a36('0x11'))(_0x6a36('0x12'));var utils=require(_0x6a36('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6a36('0x14'));var db=require(_0x6a36('0x15'))['db'];function respondWithStatusCode(_0x4d7f04,_0x334ed3){_0x334ed3=_0x334ed3||0xcc;return function(_0x5b65cf){if(_0x5b65cf){return _0x4d7f04[_0x6a36('0x16')](_0x334ed3);}return _0x4d7f04[_0x6a36('0x17')](_0x334ed3)[_0x6a36('0x18')]();};}function respondWithResult(_0x473854,_0x4e8ed1){_0x4e8ed1=_0x4e8ed1||0xc8;return function(_0x510e27){if(_0x510e27){return _0x473854[_0x6a36('0x17')](_0x4e8ed1)[_0x6a36('0x19')](_0x510e27);}};}function respondWithFilteredResult(_0x2d28ec,_0x636203){return function(_0x570aa0){if(_0x570aa0){var _0x5a2f92=typeof _0x636203[_0x6a36('0x1a')]===_0x6a36('0x1b')&&typeof _0x636203[_0x6a36('0x1c')]===_0x6a36('0x1b');var _0x32ce57=_0x570aa0[_0x6a36('0x1d')];var _0x20b187=_0x5a2f92?0x0:_0x636203[_0x6a36('0x1a')];var _0x176bf8=_0x5a2f92?_0x570aa0[_0x6a36('0x1d')]:_0x636203[_0x6a36('0x1a')]+_0x636203['limit'];var _0x568dde;if(_0x176bf8>=_0x32ce57){_0x176bf8=_0x32ce57;_0x568dde=0xc8;}else{_0x568dde=0xce;}_0x2d28ec[_0x6a36('0x17')](_0x568dde);return _0x2d28ec['set']('Content-Range',_0x20b187+'-'+_0x176bf8+'/'+_0x32ce57)[_0x6a36('0x19')](_0x570aa0);}return null;};}function patchUpdates(_0x5e463c){return function(_0x5752ba){try{jsonpatch[_0x6a36('0x1e')](_0x5752ba,_0x5e463c,!![]);}catch(_0x4e9008){return BPromise[_0x6a36('0x1f')](_0x4e9008);}return _0x5752ba[_0x6a36('0x20')]();};}function saveUpdates(_0x464bb6,_0x16cad9){return function(_0x129691){if(_0x129691){return _0x129691[_0x6a36('0x21')](_0x464bb6)[_0x6a36('0x22')](function(_0x218469){return _0x218469;});}return null;};}function removeEntity(_0x20451c,_0x4b2db9){return function(_0x5ede83){if(_0x5ede83){return _0x5ede83['destroy']()[_0x6a36('0x22')](function(){_0x20451c[_0x6a36('0x17')](0xcc)[_0x6a36('0x18')]();});}};}function handleEntityNotFound(_0x55f4b4,_0x13bec1){return function(_0x3b9785){if(!_0x3b9785){_0x55f4b4[_0x6a36('0x16')](0x194);}return _0x3b9785;};}function handleError(_0x3a763b,_0xe44857){_0xe44857=_0xe44857||0x1f4;return function(_0x286087){logger[_0x6a36('0x23')](_0x286087[_0x6a36('0x24')]);if(_0x286087[_0x6a36('0x25')]){delete _0x286087['name'];}_0x3a763b['status'](_0xe44857)[_0x6a36('0x26')](_0x286087);};}exports[_0x6a36('0x27')]=function(_0x53dff7,_0x39b477){var _0x1b9a7a={},_0x239ebe={},_0x17ae8f={'count':0x0,'rows':[]};var _0x4071b7=_[_0x6a36('0x28')](db[_0x6a36('0x29')]['rawAttributes'],function(_0xb2758){return{'name':_0xb2758['fieldName'],'type':_0xb2758[_0x6a36('0x2a')]['key']};});_0x239ebe[_0x6a36('0x2b')]=_[_0x6a36('0x28')](_0x4071b7,'name');_0x239ebe[_0x6a36('0x2c')]=_[_0x6a36('0x2d')](_0x53dff7[_0x6a36('0x2c')]);_0x239ebe[_0x6a36('0x2e')]=_[_0x6a36('0x2f')](_0x239ebe[_0x6a36('0x2b')],_0x239ebe[_0x6a36('0x2c')]);_0x1b9a7a[_0x6a36('0x30')]=_[_0x6a36('0x2f')](_0x239ebe['model'],qs[_0x6a36('0x31')](_0x53dff7['query'][_0x6a36('0x31')]));_0x1b9a7a[_0x6a36('0x30')]=_0x1b9a7a[_0x6a36('0x30')][_0x6a36('0x32')]?_0x1b9a7a[_0x6a36('0x30')]:_0x239ebe[_0x6a36('0x2b')];if(!_0x53dff7['query']['hasOwnProperty'](_0x6a36('0x33'))){_0x1b9a7a[_0x6a36('0x1c')]=qs[_0x6a36('0x1c')](_0x53dff7['query'][_0x6a36('0x1c')]);_0x1b9a7a[_0x6a36('0x1a')]=qs[_0x6a36('0x1a')](_0x53dff7[_0x6a36('0x2c')][_0x6a36('0x1a')]);}_0x1b9a7a[_0x6a36('0x34')]=qs[_0x6a36('0x35')](_0x53dff7[_0x6a36('0x2c')][_0x6a36('0x35')]);_0x1b9a7a[_0x6a36('0x36')]=qs[_0x6a36('0x2e')](_[_0x6a36('0x37')](_0x53dff7[_0x6a36('0x2c')],_0x239ebe[_0x6a36('0x2e')]),_0x4071b7);if(_0x53dff7[_0x6a36('0x2c')]['filter']){_0x1b9a7a['where']=_[_0x6a36('0x38')](_0x1b9a7a[_0x6a36('0x36')],{'$or':_[_0x6a36('0x28')](_0x4071b7,function(_0x48dfe1){if(_0x48dfe1[_0x6a36('0x2a')]!==_0x6a36('0x39')){var _0x6d135d={};_0x6d135d[_0x48dfe1[_0x6a36('0x25')]]={'$like':'%'+_0x53dff7[_0x6a36('0x2c')]['filter']+'%'};return _0x6d135d;}})});}_0x1b9a7a=_['merge']({},_0x1b9a7a,_0x53dff7[_0x6a36('0x3a')]);var _0x205448={'where':_0x1b9a7a[_0x6a36('0x36')]};return db[_0x6a36('0x29')][_0x6a36('0x1d')](_0x205448)[_0x6a36('0x22')](function(_0x1465dd){_0x17ae8f[_0x6a36('0x1d')]=_0x1465dd;if(_0x53dff7[_0x6a36('0x2c')][_0x6a36('0x3b')]){_0x1b9a7a[_0x6a36('0x3c')]=[{'all':!![]}];}return db['SugarcrmField'][_0x6a36('0x3d')](_0x1b9a7a);})[_0x6a36('0x22')](function(_0x4ef33){_0x17ae8f['rows']=_0x4ef33;return _0x17ae8f;})[_0x6a36('0x22')](respondWithFilteredResult(_0x39b477,_0x1b9a7a))[_0x6a36('0x3e')](handleError(_0x39b477,null));};exports[_0x6a36('0x3f')]=function(_0x33a9dd,_0x3e6fac){var _0x5b1496={'raw':!![],'where':{'id':_0x33a9dd[_0x6a36('0x40')]['id']}},_0x4052b4={};_0x4052b4[_0x6a36('0x2b')]=_[_0x6a36('0x2d')](db['SugarcrmField']['rawAttributes']);_0x4052b4[_0x6a36('0x2c')]=_[_0x6a36('0x2d')](_0x33a9dd[_0x6a36('0x2c')]);_0x4052b4[_0x6a36('0x2e')]=_[_0x6a36('0x2f')](_0x4052b4['model'],_0x4052b4['query']);_0x5b1496[_0x6a36('0x30')]=_[_0x6a36('0x2f')](_0x4052b4[_0x6a36('0x2b')],qs['fields'](_0x33a9dd[_0x6a36('0x2c')][_0x6a36('0x31')]));_0x5b1496[_0x6a36('0x30')]=_0x5b1496[_0x6a36('0x30')][_0x6a36('0x32')]?_0x5b1496[_0x6a36('0x30')]:_0x4052b4[_0x6a36('0x2b')];if(_0x33a9dd['query']['includeAll']){_0x5b1496['include']=[{'all':!![]}];}_0x5b1496=_[_0x6a36('0x38')]({},_0x5b1496,_0x33a9dd['options']);return db['SugarcrmField']['find'](_0x5b1496)['then'](handleEntityNotFound(_0x3e6fac,null))[_0x6a36('0x22')](respondWithResult(_0x3e6fac,null))['catch'](handleError(_0x3e6fac,null));};exports[_0x6a36('0x41')]=function(_0x23ee1f,_0x590b5b){return db[_0x6a36('0x29')][_0x6a36('0x41')](_0x23ee1f[_0x6a36('0x42')],{})[_0x6a36('0x22')](respondWithResult(_0x590b5b,0xc9))[_0x6a36('0x3e')](handleError(_0x590b5b,null));};exports[_0x6a36('0x21')]=function(_0x4fd9b3,_0x1e8501){if(_0x4fd9b3[_0x6a36('0x42')]['id']){delete _0x4fd9b3[_0x6a36('0x42')]['id'];}return db[_0x6a36('0x29')][_0x6a36('0x43')]({'where':{'id':_0x4fd9b3['params']['id']}})[_0x6a36('0x22')](handleEntityNotFound(_0x1e8501,null))['then'](saveUpdates(_0x4fd9b3[_0x6a36('0x42')],null))[_0x6a36('0x22')](respondWithResult(_0x1e8501,null))['catch'](handleError(_0x1e8501,null));};exports[_0x6a36('0x44')]=function(_0x4a2621,_0x5caa2f){return db[_0x6a36('0x29')][_0x6a36('0x43')]({'where':{'id':_0x4a2621[_0x6a36('0x40')]['id']}})[_0x6a36('0x22')](handleEntityNotFound(_0x5caa2f,null))[_0x6a36('0x22')](removeEntity(_0x5caa2f,null))[_0x6a36('0x3e')](handleError(_0x5caa2f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8920569..39b2128 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 _0x29a0=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3165eb,_0x2b7a35){var _0x429978=function(_0x45878e){while(--_0x45878e){_0x3165eb['push'](_0x3165eb['shift']());}};_0x429978(++_0x2b7a35);}(_0x29a0,0x1c8));var _0x029a=function(_0xf5307f,_0x9eb22d){_0xf5307f=_0xf5307f-0x0;var _0x5a1db9=_0x29a0[_0xf5307f];return _0x5a1db9;};'use strict';var _=require(_0x029a('0x0'));var util=require(_0x029a('0x1'));var logger=require(_0x029a('0x2'))(_0x029a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x029a('0x4'));var fs=require('fs');var path=require(_0x029a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x029a('0x6'));module[_0x029a('0x7')]=function(_0xe0b001,_0x5e56c4){return _0xe0b001[_0x029a('0x8')](_0x029a('0x9'),attributes,{'tableName':_0x029a('0xa'),'paranoid':![],'indexes':[{'name':_0x029a('0xb'),'fields':[_0x029a('0xc'),_0x029a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd351=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','SugarcrmField','sugarcrm_unique_index','idField','FieldId'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd351,0xa0));var _0x1d35=function(_0x31af15,_0x4cbc56){_0x31af15=_0x31af15-0x0;var _0x33ca9b=_0xd351[_0x31af15];return _0x33ca9b;};'use strict';var _=require(_0x1d35('0x0'));var util=require(_0x1d35('0x1'));var logger=require(_0x1d35('0x2'))('api');var moment=require(_0x1d35('0x3'));var BPromise=require('bluebird');var rp=require(_0x1d35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d35('0x5'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x53bbbd,_0x487e20){return _0x53bbbd['define'](_0x1d35('0x6'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x1d35('0x7'),'fields':[_0x1d35('0x8'),_0x1d35('0x9')],'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 b8d37dd..a934c65 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 _0x1efe=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0x1efe,0x12c));var _0xe1ef=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1efe[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xe1ef('0x0'));var util=require(_0xe1ef('0x1'));var moment=require(_0xe1ef('0x2'));var BPromise=require(_0xe1ef('0x3'));var rs=require(_0xe1ef('0x4'));var fs=require('fs');var Redis=require(_0xe1ef('0x5'));var db=require(_0xe1ef('0x6'))['db'];var utils=require(_0xe1ef('0x7'));var logger=require(_0xe1ef('0x8'))(_0xe1ef('0x9'));var config=require(_0xe1ef('0xa'));var jayson=require(_0xe1ef('0xb'));var client=jayson[_0xe1ef('0xc')][_0xe1ef('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x12bbcd,_0x2c0c19,_0x210462){return new BPromise(function(_0x5ca406,_0x560b0f){return client[_0xe1ef('0xe')](_0x12bbcd,_0x210462)[_0xe1ef('0xf')](function(_0x489378){logger[_0xe1ef('0x10')](_0xe1ef('0x11'),_0x2c0c19,_0xe1ef('0x12'));logger[_0xe1ef('0x13')](_0xe1ef('0x14'),_0x2c0c19,_0xe1ef('0x12'),JSON[_0xe1ef('0x15')](_0x489378));if(_0x489378[_0xe1ef('0x16')]){if(_0x489378[_0xe1ef('0x16')][_0xe1ef('0x17')]===0x1f4){logger[_0xe1ef('0x16')](_0xe1ef('0x11'),_0x2c0c19,_0x489378['error'][_0xe1ef('0x18')]);return _0x560b0f(_0x489378[_0xe1ef('0x16')][_0xe1ef('0x18')]);}logger[_0xe1ef('0x16')](_0xe1ef('0x11'),_0x2c0c19,_0x489378[_0xe1ef('0x16')][_0xe1ef('0x18')]);return _0x5ca406(_0x489378[_0xe1ef('0x16')]['message']);}else{logger[_0xe1ef('0x10')](_0xe1ef('0x11'),_0x2c0c19,_0xe1ef('0x12'));_0x5ca406(_0x489378[_0xe1ef('0x19')]['message']);}})[_0xe1ef('0x1a')](function(_0x190e79){logger[_0xe1ef('0x16')]('SugarcrmField,\x20%s,\x20%s',_0x2c0c19,_0x190e79);_0x560b0f(_0x190e79);});});} \ No newline at end of file +var _0x7ece=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27f0ad,_0x5bc0b7){var _0x465bb9=function(_0xcb41ad){while(--_0xcb41ad){_0x27f0ad['push'](_0x27f0ad['shift']());}};_0x465bb9(++_0x5bc0b7);}(_0x7ece,0x1f1));var _0xe7ec=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7ece[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xe7ec('0x0'));var util=require(_0xe7ec('0x1'));var moment=require(_0xe7ec('0x2'));var BPromise=require(_0xe7ec('0x3'));var rs=require(_0xe7ec('0x4'));var fs=require('fs');var Redis=require(_0xe7ec('0x5'));var db=require(_0xe7ec('0x6'))['db'];var utils=require(_0xe7ec('0x7'));var logger=require(_0xe7ec('0x8'))(_0xe7ec('0x9'));var config=require(_0xe7ec('0xa'));var jayson=require(_0xe7ec('0xb'));var client=jayson[_0xe7ec('0xc')][_0xe7ec('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x56cec4,_0xddae84,_0x1b4332){return new BPromise(function(_0x13715c,_0x4152ad){return client[_0xe7ec('0xe')](_0x56cec4,_0x1b4332)[_0xe7ec('0xf')](function(_0x3d529d){logger[_0xe7ec('0x10')](_0xe7ec('0x11'),_0xddae84,'request\x20sent');logger[_0xe7ec('0x12')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0xddae84,_0xe7ec('0x13'),JSON['stringify'](_0x3d529d));if(_0x3d529d['error']){if(_0x3d529d[_0xe7ec('0x14')]['code']===0x1f4){logger[_0xe7ec('0x14')](_0xe7ec('0x11'),_0xddae84,_0x3d529d['error'][_0xe7ec('0x15')]);return _0x4152ad(_0x3d529d['error'][_0xe7ec('0x15')]);}logger['error'](_0xe7ec('0x11'),_0xddae84,_0x3d529d[_0xe7ec('0x14')]['message']);return _0x13715c(_0x3d529d[_0xe7ec('0x14')]['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0xddae84,_0xe7ec('0x13'));_0x13715c(_0x3d529d[_0xe7ec('0x16')][_0xe7ec('0x15')]);}})['catch'](function(_0x51706f){logger[_0xe7ec('0x14')]('SugarcrmField,\x20%s,\x20%s',_0xddae84,_0x51706f);_0x4152ad(_0x51706f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6637574..d746c0a 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 _0x98e1=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x277607,_0x345a06){var _0x15fe23=function(_0x336de7){while(--_0x336de7){_0x277607['push'](_0x277607['shift']());}};_0x15fe23(++_0x345a06);}(_0x98e1,0x160));var _0x198e=function(_0x3ab8df,_0xe88b7f){_0x3ab8df=_0x3ab8df-0x0;var _0x135f26=_0x98e1[_0x3ab8df];return _0x135f26;};'use strict';var multer=require('multer');var util=require(_0x198e('0x0'));var path=require(_0x198e('0x1'));var timeout=require(_0x198e('0x2'));var express=require(_0x198e('0x3'));var router=express['Router']();var fs_extra=require(_0x198e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x198e('0x5'));var controller=require(_0x198e('0x6'));router[_0x198e('0x7')]('/',auth[_0x198e('0x8')](),controller['index']);router['get'](_0x198e('0x9'),auth['isAuthenticated'](),controller[_0x198e('0xa')]);router['get'](_0x198e('0xb'),auth[_0x198e('0x8')](),controller[_0x198e('0xc')]);router[_0x198e('0x7')](_0x198e('0xd'),auth[_0x198e('0x8')](),controller[_0x198e('0xe')]);router[_0x198e('0xf')]('/',auth[_0x198e('0x8')](),controller['create']);router[_0x198e('0xf')](_0x198e('0xb'),auth['isAuthenticated'](),controller[_0x198e('0x10')]);router['put'](_0x198e('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x198e('0x8')](),controller[_0x198e('0x11')]);module[_0x198e('0x12')]=router; \ No newline at end of file +var _0x8413=['getFields','create','post','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8413,0x7b));var _0x3841=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8413[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x3841('0x0'));var util=require(_0x3841('0x1'));var path=require(_0x3841('0x2'));var timeout=require(_0x3841('0x3'));var express=require(_0x3841('0x4'));var router=express[_0x3841('0x5')]();var fs_extra=require(_0x3841('0x6'));var auth=require(_0x3841('0x7'));var interaction=require(_0x3841('0x8'));var config=require('../../config/environment');var controller=require(_0x3841('0x9'));router[_0x3841('0xa')]('/',auth[_0x3841('0xb')](),controller[_0x3841('0xc')]);router[_0x3841('0xa')]('/:id',auth[_0x3841('0xb')](),controller['show']);router[_0x3841('0xa')](_0x3841('0xd'),auth[_0x3841('0xb')](),controller[_0x3841('0xe')]);router[_0x3841('0xa')]('/:id/fields',auth[_0x3841('0xb')](),controller[_0x3841('0xf')]);router['post']('/',auth[_0x3841('0xb')](),controller[_0x3841('0x10')]);router[_0x3841('0x11')](_0x3841('0xd'),auth[_0x3841('0xb')](),controller[_0x3841('0x12')]);router['put'](_0x3841('0x13'),auth[_0x3841('0xb')](),controller['update']);router[_0x3841('0x14')](_0x3841('0x13'),auth[_0x3841('0xb')](),controller[_0x3841('0x15')]);module[_0x3841('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f8edca1..3d768e1 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 _0x38b9=['sequelize','exports','STRING','HelpDesk'];(function(_0x4d3973,_0x21daf3){var _0x534dd2=function(_0x470b40){while(--_0x470b40){_0x4d3973['push'](_0x4d3973['shift']());}};_0x534dd2(++_0x21daf3);}(_0x38b9,0x1f0));var _0x938b=function(_0x2b594d,_0x56dac0){_0x2b594d=_0x2b594d-0x0;var _0x4dfc68=_0x38b9[_0x2b594d];return _0x4dfc68;};'use strict';var Sequelize=require(_0x938b('0x0'));module[_0x938b('0x1')]={'name':{'type':Sequelize[_0x938b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x938b('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x938b('0x2')],'allowNull':![],'defaultValue':_0x938b('0x3')},'remoteUri':{'type':Sequelize[_0x938b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x938b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4516=['STRING','sequelize','exports'];(function(_0x1f0a9c,_0x3c6be3){var _0x2b12c5=function(_0x4e6353){while(--_0x4e6353){_0x1f0a9c['push'](_0x1f0a9c['shift']());}};_0x2b12c5(++_0x3c6be3);}(_0x4516,0xd3));var _0x6451=function(_0x44cccc,_0x602518){_0x44cccc=_0x44cccc-0x0;var _0x3de637=_0x4516[_0x44cccc];return _0x3de637;};'use strict';var Sequelize=require(_0x6451('0x0'));module[_0x6451('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6451('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6451('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6451('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6451('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 8a8645e..8a0f8e2 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 _0x1e16=['statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','filters','intersection','query','fields','attributes','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','include','create','body','find','params','getConfigurations','findOne','VtigerConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','VtigerField','Descriptions','md5','getFields','username','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','POST','login','result','token','success','GET','autogenerated','owner','remove','includes','editable','false','label','cf_','picklistValues','log','vTiger\x20error:\x20','test'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x1e16,0x15c));var _0x61e1=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1e16[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x61e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x61e1('0x1'));var jsonpatch=require(_0x61e1('0x2'));var rp=require(_0x61e1('0x3'));var moment=require(_0x61e1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61e1('0x5'));var util=require(_0x61e1('0x6'));var path=require(_0x61e1('0x7'));var sox=require('sox');var csv=require(_0x61e1('0x8'));var ejs=require(_0x61e1('0x9'));var fs=require('fs');var fs_extra=require(_0x61e1('0xa'));var _=require('lodash');var squel=require(_0x61e1('0xb'));var crypto=require(_0x61e1('0xc'));var jsforce=require(_0x61e1('0xd'));var deskjs=require(_0x61e1('0xe'));var toCsv=require(_0x61e1('0x8'));var querystring=require('querystring');var Papa=require(_0x61e1('0xf'));var Redis=require(_0x61e1('0x10'));var authService=require(_0x61e1('0x11'));var qs=require(_0x61e1('0x12'));var as=require(_0x61e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x61e1('0x14'));var utils=require(_0x61e1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x61e1('0x16'));function respondWithStatusCode(_0x303f44,_0x45e65c){_0x45e65c=_0x45e65c||0xcc;return function(_0x520c1f){if(_0x520c1f){return _0x303f44['sendStatus'](_0x45e65c);}return _0x303f44[_0x61e1('0x17')](_0x45e65c)[_0x61e1('0x18')]();};}function respondWithResult(_0x2ba1f0,_0x49cf5e){_0x49cf5e=_0x49cf5e||0xc8;return function(_0x4a85fe){if(_0x4a85fe){return _0x2ba1f0[_0x61e1('0x17')](_0x49cf5e)['json'](_0x4a85fe);}};}function respondWithFilteredResult(_0x31fd78,_0x12dea1){return function(_0xe05d2a){if(_0xe05d2a){var _0x2fc9d4=typeof _0x12dea1[_0x61e1('0x19')]===_0x61e1('0x1a')&&typeof _0x12dea1['limit']===_0x61e1('0x1a');var _0x496839=_0xe05d2a['count'];var _0x160e6a=_0x2fc9d4?0x0:_0x12dea1[_0x61e1('0x19')];var _0x394362=_0x2fc9d4?_0xe05d2a[_0x61e1('0x1b')]:_0x12dea1['offset']+_0x12dea1[_0x61e1('0x1c')];var _0xc85120;if(_0x394362>=_0x496839){_0x394362=_0x496839;_0xc85120=0xc8;}else{_0xc85120=0xce;}_0x31fd78[_0x61e1('0x17')](_0xc85120);return _0x31fd78[_0x61e1('0x1d')](_0x61e1('0x1e'),_0x160e6a+'-'+_0x394362+'/'+_0x496839)['json'](_0xe05d2a);}return null;};}function patchUpdates(_0x5afa9e){return function(_0x54f43d){try{jsonpatch['apply'](_0x54f43d,_0x5afa9e,!![]);}catch(_0x5edc2e){return BPromise[_0x61e1('0x1f')](_0x5edc2e);}return _0x54f43d['save']();};}function saveUpdates(_0x1b04b4,_0x19f545){return function(_0x3d66c){if(_0x3d66c){return _0x3d66c[_0x61e1('0x20')](_0x1b04b4)[_0x61e1('0x21')](function(_0x1c7338){return _0x1c7338;});}return null;};}function removeEntity(_0x40074f,_0x415682){return function(_0xcf1c25){if(_0xcf1c25){return _0xcf1c25[_0x61e1('0x22')]()[_0x61e1('0x21')](function(){_0x40074f[_0x61e1('0x17')](0xcc)[_0x61e1('0x18')]();});}};}function handleEntityNotFound(_0x1e2a45,_0x1498a8){return function(_0x3aea6e){if(!_0x3aea6e){_0x1e2a45['sendStatus'](0x194);}return _0x3aea6e;};}function handleError(_0x570ebb,_0x5ae7df){_0x5ae7df=_0x5ae7df||0x1f4;return function(_0x33ecac){logger[_0x61e1('0x23')](_0x33ecac[_0x61e1('0x24')]);if(_0x33ecac['name']){delete _0x33ecac[_0x61e1('0x25')];}_0x570ebb[_0x61e1('0x17')](_0x5ae7df)[_0x61e1('0x26')](_0x33ecac);};}exports[_0x61e1('0x27')]=function(_0x37f974,_0x107236){var _0x2b693a={},_0x4d9d9a={},_0xe5bfd={'count':0x0,'rows':[]};var _0x26a4c3=_[_0x61e1('0x28')](db[_0x61e1('0x29')][_0x61e1('0x2a')],function(_0x46c6e5){return{'name':_0x46c6e5[_0x61e1('0x2b')],'type':_0x46c6e5[_0x61e1('0x2c')]['key']};});_0x4d9d9a['model']=_[_0x61e1('0x28')](_0x26a4c3,_0x61e1('0x25'));_0x4d9d9a['query']=_['keys'](_0x37f974['query']);_0x4d9d9a[_0x61e1('0x2d')]=_[_0x61e1('0x2e')](_0x4d9d9a['model'],_0x4d9d9a[_0x61e1('0x2f')]);_0x2b693a['attributes']=_[_0x61e1('0x2e')](_0x4d9d9a['model'],qs[_0x61e1('0x30')](_0x37f974[_0x61e1('0x2f')][_0x61e1('0x30')]));_0x2b693a[_0x61e1('0x31')]=_0x2b693a[_0x61e1('0x31')]['length']?_0x2b693a[_0x61e1('0x31')]:_0x4d9d9a[_0x61e1('0x32')];if(!_0x37f974['query'][_0x61e1('0x33')](_0x61e1('0x34'))){_0x2b693a['limit']=qs[_0x61e1('0x1c')](_0x37f974['query'][_0x61e1('0x1c')]);_0x2b693a[_0x61e1('0x19')]=qs['offset'](_0x37f974[_0x61e1('0x2f')][_0x61e1('0x19')]);}_0x2b693a['order']=qs[_0x61e1('0x35')](_0x37f974['query'][_0x61e1('0x35')]);_0x2b693a[_0x61e1('0x36')]=qs[_0x61e1('0x2d')](_[_0x61e1('0x37')](_0x37f974['query'],_0x4d9d9a[_0x61e1('0x2d')]),_0x26a4c3);if(_0x37f974['query'][_0x61e1('0x38')]){_0x2b693a[_0x61e1('0x36')]=_[_0x61e1('0x39')](_0x2b693a[_0x61e1('0x36')],{'$or':_[_0x61e1('0x28')](_0x26a4c3,function(_0x53a976){if(_0x53a976[_0x61e1('0x2c')]!==_0x61e1('0x3a')){var _0xec42a5={};_0xec42a5[_0x53a976[_0x61e1('0x25')]]={'$like':'%'+_0x37f974['query']['filter']+'%'};return _0xec42a5;}})});}_0x2b693a=_['merge']({},_0x2b693a,_0x37f974[_0x61e1('0x3b')]);var _0xf50d5d={'where':_0x2b693a[_0x61e1('0x36')]};return db[_0x61e1('0x29')][_0x61e1('0x1b')](_0xf50d5d)[_0x61e1('0x21')](function(_0x3e2614){_0xe5bfd['count']=_0x3e2614;if(_0x37f974[_0x61e1('0x2f')][_0x61e1('0x3c')]){_0x2b693a['include']=[{'all':!![]}];}return db[_0x61e1('0x29')][_0x61e1('0x3d')](_0x2b693a);})[_0x61e1('0x21')](function(_0x52715c){_0xe5bfd['rows']=_0x52715c;return _0xe5bfd;})[_0x61e1('0x21')](respondWithFilteredResult(_0x107236,_0x2b693a))[_0x61e1('0x3e')](handleError(_0x107236,null));};exports[_0x61e1('0x3f')]=function(_0x5bb88e,_0x10ccdf){var _0x29fc9b={'raw':![],'where':{'id':_0x5bb88e['params']['id']}},_0x3bafe2={};_0x3bafe2['model']=_[_0x61e1('0x40')](db[_0x61e1('0x29')]['rawAttributes']);_0x3bafe2['query']=_[_0x61e1('0x40')](_0x5bb88e[_0x61e1('0x2f')]);_0x3bafe2[_0x61e1('0x2d')]=_[_0x61e1('0x2e')](_0x3bafe2[_0x61e1('0x32')],_0x3bafe2[_0x61e1('0x2f')]);_0x29fc9b[_0x61e1('0x31')]=_[_0x61e1('0x2e')](_0x3bafe2[_0x61e1('0x32')],qs[_0x61e1('0x30')](_0x5bb88e[_0x61e1('0x2f')][_0x61e1('0x30')]));_0x29fc9b[_0x61e1('0x31')]=_0x29fc9b[_0x61e1('0x31')]['length']?_0x29fc9b[_0x61e1('0x31')]:_0x3bafe2['model'];if(_0x5bb88e[_0x61e1('0x2f')]['includeAll']){_0x29fc9b[_0x61e1('0x41')]=[{'all':!![]}];}_0x29fc9b=_[_0x61e1('0x39')]({},_0x29fc9b,_0x5bb88e['options']);return db[_0x61e1('0x29')]['find'](_0x29fc9b)[_0x61e1('0x21')](handleEntityNotFound(_0x10ccdf,null))['then'](respondWithResult(_0x10ccdf,null))[_0x61e1('0x3e')](handleError(_0x10ccdf,null));};exports[_0x61e1('0x42')]=function(_0x4c9b38,_0x1ce6cd){return db[_0x61e1('0x29')][_0x61e1('0x42')](_0x4c9b38[_0x61e1('0x43')],{})[_0x61e1('0x21')](respondWithResult(_0x1ce6cd,0xc9))[_0x61e1('0x3e')](handleError(_0x1ce6cd,null));};exports[_0x61e1('0x20')]=function(_0x20e059,_0x55dcee){if(_0x20e059[_0x61e1('0x43')]['id']){delete _0x20e059['body']['id'];}return db['VtigerAccount'][_0x61e1('0x44')]({'where':{'id':_0x20e059['params']['id']}})['then'](handleEntityNotFound(_0x55dcee,null))[_0x61e1('0x21')](saveUpdates(_0x20e059['body'],null))[_0x61e1('0x21')](respondWithResult(_0x55dcee,null))[_0x61e1('0x3e')](handleError(_0x55dcee,null));};exports[_0x61e1('0x22')]=function(_0x2a730f,_0x4a60da){return db[_0x61e1('0x29')][_0x61e1('0x44')]({'where':{'id':_0x2a730f[_0x61e1('0x45')]['id']}})[_0x61e1('0x21')](handleEntityNotFound(_0x4a60da,null))[_0x61e1('0x21')](removeEntity(_0x4a60da,null))[_0x61e1('0x3e')](handleError(_0x4a60da,null));};exports[_0x61e1('0x46')]=function(_0x1bc839,_0x3bc943,_0x575b4c){var _0x4ba66c={};var _0xd14b0d={};var _0x358536;var _0x9a3df9;return db[_0x61e1('0x29')][_0x61e1('0x47')]({'where':{'id':_0x1bc839[_0x61e1('0x45')]['id']}})[_0x61e1('0x21')](handleEntityNotFound(_0x3bc943,null))[_0x61e1('0x21')](function(_0x29f303){if(_0x29f303){_0x358536=_0x29f303;_0xd14b0d[_0x61e1('0x32')]=_[_0x61e1('0x40')](db[_0x61e1('0x48')][_0x61e1('0x2a')]);_0xd14b0d[_0x61e1('0x2f')]=_['keys'](_0x1bc839['query']);_0xd14b0d[_0x61e1('0x2d')]=_['intersection'](_0xd14b0d[_0x61e1('0x32')],_0xd14b0d['query']);_0x4ba66c[_0x61e1('0x31')]=_['intersection'](_0xd14b0d[_0x61e1('0x32')],qs[_0x61e1('0x30')](_0x1bc839[_0x61e1('0x2f')][_0x61e1('0x30')]));_0x4ba66c[_0x61e1('0x31')]=_0x4ba66c[_0x61e1('0x31')]['length']?_0x4ba66c[_0x61e1('0x31')]:_0xd14b0d[_0x61e1('0x32')];_0x4ba66c['order']=qs[_0x61e1('0x35')](_0x1bc839[_0x61e1('0x2f')][_0x61e1('0x35')]);_0x4ba66c[_0x61e1('0x36')]=qs[_0x61e1('0x2d')](_[_0x61e1('0x37')](_0x1bc839[_0x61e1('0x2f')],_0xd14b0d[_0x61e1('0x2d')]));if(_0x1bc839[_0x61e1('0x2f')][_0x61e1('0x38')]){_0x4ba66c[_0x61e1('0x36')]=_[_0x61e1('0x39')](_0x4ba66c['where'],{'$or':_[_0x61e1('0x28')](_0x4ba66c[_0x61e1('0x31')],function(_0x41d308){var _0x16da88={};_0x16da88[_0x41d308]={'$like':'%'+_0x1bc839[_0x61e1('0x2f')][_0x61e1('0x38')]+'%'};return _0x16da88;})});}_0x4ba66c=_[_0x61e1('0x39')]({},_0x4ba66c,_0x1bc839[_0x61e1('0x3b')]);return _0x358536[_0x61e1('0x46')](_0x4ba66c);}})[_0x61e1('0x21')](function(_0x25acfb){if(_0x25acfb){_0x9a3df9=_0x25acfb[_0x61e1('0x49')];if(!_0x1bc839[_0x61e1('0x2f')]['hasOwnProperty'](_0x61e1('0x34'))){_0x4ba66c[_0x61e1('0x1c')]=qs[_0x61e1('0x1c')](_0x1bc839['query']['limit']);_0x4ba66c['offset']=qs[_0x61e1('0x19')](_0x1bc839[_0x61e1('0x2f')][_0x61e1('0x19')]);}return _0x358536[_0x61e1('0x46')](_0x4ba66c);}})[_0x61e1('0x21')](function(_0x257af6){if(_0x257af6){return _0x257af6?{'count':_0x9a3df9,'rows':_0x257af6}:null;}})[_0x61e1('0x21')](respondWithResult(_0x3bc943,null))[_0x61e1('0x3e')](handleError(_0x3bc943,null));};exports[_0x61e1('0x4a')]=function(_0x4c1a32,_0x6f1f3,_0x332efc){if(_0x4c1a32[_0x61e1('0x43')]['id']){delete _0x4c1a32['body']['id'];}return db['VtigerAccount'][_0x61e1('0x47')]({'where':{'id':_0x4c1a32[_0x61e1('0x45')]['id']}})[_0x61e1('0x21')](handleEntityNotFound(_0x6f1f3,null))[_0x61e1('0x21')](function(_0x1f4c28){if(_0x1f4c28){_0x4c1a32[_0x61e1('0x43')][_0x61e1('0x4b')]=_0x1f4c28['id'];_0x4c1a32[_0x61e1('0x43')][_0x61e1('0x4c')]=integrations[_0x61e1('0x4d')](_0x4c1a32[_0x61e1('0x43')]['channel'],_0x4c1a32[_0x61e1('0x43')][_0x61e1('0x2c')]);_0x4c1a32[_0x61e1('0x43')]['Descriptions']=integrations[_0x61e1('0x4e')](_0x4c1a32[_0x61e1('0x43')][_0x61e1('0x4f')],_0x4c1a32[_0x61e1('0x43')][_0x61e1('0x2c')]);return db[_0x61e1('0x48')][_0x61e1('0x42')](_0x4c1a32[_0x61e1('0x43')],{'include':[{'model':db[_0x61e1('0x50')],'as':_0x61e1('0x4c')},{'model':db['VtigerField'],'as':_0x61e1('0x51')}]});}return null;})['then'](respondWithResult(_0x6f1f3,null))['catch'](handleError(_0x6f1f3,null));};var md5=require(_0x61e1('0x52'));exports[_0x61e1('0x53')]=function(_0x41b3cf,_0xee3527,_0x45732d){var _0x21868e=null;var _0x229bd5=null;var _0x37493b=null;var _0x47d08e=null;var _0x357552='';return db['VtigerAccount'][_0x61e1('0x47')]({'where':{'id':_0x41b3cf[_0x61e1('0x45')]['id']},'attributes':['id',_0x61e1('0x25'),_0x61e1('0x54'),'description','moduleName',_0x61e1('0x55'),_0x61e1('0x56'),_0x61e1('0x57')]})[_0x61e1('0x21')](handleEntityNotFound(_0xee3527,null))[_0x61e1('0x21')](function(_0x5bf8f4){if(_0x5bf8f4){_0x21868e=_0x5bf8f4['username'];_0x229bd5=_0x5bf8f4['accessKey'];_0x37493b=_0x5bf8f4['moduleName'];_0x357552=_0x5bf8f4['remoteUri'];var _0x5ee5e6=_0x357552[_0x61e1('0x58')](-0x1);if(_0x5ee5e6==='/'){_0x357552=_0x357552[_0x61e1('0x59')](0x0,_0x357552[_0x61e1('0x5a')](_0x5ee5e6));}_0x47d08e=util[_0x61e1('0x5b')](_0x61e1('0x5c'),_0x357552);var _0x48b1f5={'method':'GET','uri':_0x47d08e,'qs':{'operation':_0x61e1('0x5d'),'username':_0x5bf8f4[_0x61e1('0x54')]},'json':!![]};return rp(_0x48b1f5);}})[_0x61e1('0x21')](function(_0x546370){if(_0x546370['success']){var _0x2e5005={'method':_0x61e1('0x5e'),'uri':_0x47d08e,'form':{'operation':_0x61e1('0x5f'),'username':_0x21868e,'accessKey':md5(_0x546370[_0x61e1('0x60')][_0x61e1('0x61')]+_0x229bd5)},'json':!![]};return rp(_0x2e5005);}})[_0x61e1('0x21')](function(_0x3a554a){if(_0x3a554a[_0x61e1('0x62')]){var _0x4ab789={'method':_0x61e1('0x63'),'uri':_0x47d08e,'qs':{'operation':'describe','username':_0x21868e,'sessionName':_0x3a554a[_0x61e1('0x60')]['sessionName'],'elementType':_0x37493b},'json':!![]};return rp(_0x4ab789);}})[_0x61e1('0x21')](function(_0x2efb46){if(_0x2efb46[_0x61e1('0x62')]){var _0x59ab72=[_0x61e1('0x64'),'reference',_0x61e1('0x65')];_[_0x61e1('0x66')](_0x2efb46[_0x61e1('0x60')]['fields'],function(_0x42e661){return _0x59ab72[_0x61e1('0x67')](_0x42e661[_0x61e1('0x2c')][_0x61e1('0x25')]);});_[_0x61e1('0x66')](_0x2efb46[_0x61e1('0x60')][_0x61e1('0x30')],function(_0x9cc8fb){return _0x9cc8fb[_0x61e1('0x68')]===_0x61e1('0x69');});return{'count':_0x2efb46[_0x61e1('0x60')][_0x61e1('0x30')][_0x61e1('0x49')],'rows':_[_0x61e1('0x28')](_0x2efb46[_0x61e1('0x60')][_0x61e1('0x30')],function(_0x33f37e){return{'id':_0x33f37e[_0x61e1('0x25')],'name':_0x33f37e[_0x61e1('0x6a')],'custom':_['startsWith'](_0x33f37e[_0x61e1('0x25')],_0x61e1('0x6b'))?!![]:![],'options':_0x33f37e[_0x61e1('0x2c')][_0x61e1('0x25')]==='picklist'&&_0x33f37e[_0x61e1('0x2c')][_0x61e1('0x6c')]['length']>0x0?_['map'](_0x33f37e[_0x61e1('0x2c')][_0x61e1('0x6c')],function(_0x3ce100){return{'name':_0x3ce100[_0x61e1('0x6a')],'value':_0x3ce100['value']};}):[]};})};}})[_0x61e1('0x21')](respondWithResult(_0xee3527,null))[_0x61e1('0x3e')](function(_0x5bf5a5){console[_0x61e1('0x6d')](_0x61e1('0x6e')+_0x5bf5a5);var _0x182b57=_0x41b3cf[_0x61e1('0x2f')][_0x61e1('0x6f')]?0x1f4:_0x5bf5a5[_0x61e1('0x70')]||0x1f4;logger[_0x61e1('0x23')](_0x61e1('0x71'),_0x61e1('0x53'),_0x182b57,JSON['stringify'](_0x5bf5a5));delete _0x5bf5a5['name'];if(_0x182b57===0x191){_0x182b57=0x190;}_0xee3527[_0x61e1('0x17')](_0x182b57)[_0x61e1('0x26')](_0x41b3cf[_0x61e1('0x2f')][_0x61e1('0x6f')]?{'message':_0x61e1('0x72'),'statusCode':_0x5bf5a5['statusCode']}:_0x5bf5a5);});}; \ No newline at end of file +var _0x35d4=['filter','where','VIRTUAL','options','findAll','catch','show','params','fields','includeAll','merge','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','rawAttributes','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','moduleName','remoteUri','username','accessKey','slice','format','GET','getchallenge','success','POST','token','result','autogenerated','reference','includes','remove','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','pick'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x35d4,0xa9));var _0x435d=function(_0x309af5,_0x189f42){_0x309af5=_0x309af5-0x0;var _0x33f1ee=_0x35d4[_0x309af5];return _0x33f1ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x435d('0x0'));var zipdir=require(_0x435d('0x1'));var jsonpatch=require(_0x435d('0x2'));var rp=require('request-promise');var moment=require(_0x435d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x435d('0x4'));var util=require(_0x435d('0x5'));var path=require(_0x435d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x435d('0x7'));var _=require(_0x435d('0x8'));var squel=require(_0x435d('0x9'));var crypto=require(_0x435d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x435d('0xb'));var querystring=require('querystring');var Papa=require(_0x435d('0xc'));var Redis=require(_0x435d('0xd'));var authService=require(_0x435d('0xe'));var qs=require(_0x435d('0xf'));var as=require(_0x435d('0x10'));var hardwareService=require(_0x435d('0x11'));var logger=require(_0x435d('0x12'))(_0x435d('0x13'));var utils=require(_0x435d('0x14'));var config=require(_0x435d('0x15'));var licenseUtil=require(_0x435d('0x16'));var db=require(_0x435d('0x17'))['db'];var integrations=require(_0x435d('0x18'));function respondWithStatusCode(_0x163685,_0x461c92){_0x461c92=_0x461c92||0xcc;return function(_0x2dd62c){if(_0x2dd62c){return _0x163685[_0x435d('0x19')](_0x461c92);}return _0x163685[_0x435d('0x1a')](_0x461c92)['end']();};}function respondWithResult(_0x2ae179,_0x4b334a){_0x4b334a=_0x4b334a||0xc8;return function(_0xbad86d){if(_0xbad86d){return _0x2ae179[_0x435d('0x1a')](_0x4b334a)['json'](_0xbad86d);}};}function respondWithFilteredResult(_0x3cb565,_0x198915){return function(_0x2e7885){if(_0x2e7885){var _0x11330c=typeof _0x198915[_0x435d('0x1b')]===_0x435d('0x1c')&&typeof _0x198915[_0x435d('0x1d')]===_0x435d('0x1c');var _0x2f90c1=_0x2e7885[_0x435d('0x1e')];var _0x3b356e=_0x11330c?0x0:_0x198915[_0x435d('0x1b')];var _0x24c5b1=_0x11330c?_0x2e7885[_0x435d('0x1e')]:_0x198915[_0x435d('0x1b')]+_0x198915[_0x435d('0x1d')];var _0x1af678;if(_0x24c5b1>=_0x2f90c1){_0x24c5b1=_0x2f90c1;_0x1af678=0xc8;}else{_0x1af678=0xce;}_0x3cb565[_0x435d('0x1a')](_0x1af678);return _0x3cb565[_0x435d('0x1f')](_0x435d('0x20'),_0x3b356e+'-'+_0x24c5b1+'/'+_0x2f90c1)[_0x435d('0x21')](_0x2e7885);}return null;};}function patchUpdates(_0x569461){return function(_0x1d1bfc){try{jsonpatch[_0x435d('0x22')](_0x1d1bfc,_0x569461,!![]);}catch(_0x5a7b2d){return BPromise[_0x435d('0x23')](_0x5a7b2d);}return _0x1d1bfc[_0x435d('0x24')]();};}function saveUpdates(_0x14f873,_0x1c2ea4){return function(_0x3e8843){if(_0x3e8843){return _0x3e8843[_0x435d('0x25')](_0x14f873)['then'](function(_0x3e4433){return _0x3e4433;});}return null;};}function removeEntity(_0x161097,_0x3c4d1d){return function(_0x4b9558){if(_0x4b9558){return _0x4b9558['destroy']()[_0x435d('0x26')](function(){_0x161097[_0x435d('0x1a')](0xcc)[_0x435d('0x27')]();});}};}function handleEntityNotFound(_0x5a79e1,_0x7a3f9e){return function(_0x2e9806){if(!_0x2e9806){_0x5a79e1['sendStatus'](0x194);}return _0x2e9806;};}function handleError(_0x3b5355,_0x3863f4){_0x3863f4=_0x3863f4||0x1f4;return function(_0x1906f7){logger[_0x435d('0x28')](_0x1906f7[_0x435d('0x29')]);if(_0x1906f7[_0x435d('0x2a')]){delete _0x1906f7[_0x435d('0x2a')];}_0x3b5355[_0x435d('0x1a')](_0x3863f4)[_0x435d('0x2b')](_0x1906f7);};}exports[_0x435d('0x2c')]=function(_0x279f27,_0x3cc002){var _0x49d087={},_0x42a92a={},_0x4ca5f7={'count':0x0,'rows':[]};var _0x32bd8d=_[_0x435d('0x2d')](db[_0x435d('0x2e')]['rawAttributes'],function(_0x2887f1){return{'name':_0x2887f1[_0x435d('0x2f')],'type':_0x2887f1[_0x435d('0x30')][_0x435d('0x31')]};});_0x42a92a[_0x435d('0x32')]=_['map'](_0x32bd8d,'name');_0x42a92a['query']=_[_0x435d('0x33')](_0x279f27[_0x435d('0x34')]);_0x42a92a[_0x435d('0x35')]=_['intersection'](_0x42a92a['model'],_0x42a92a[_0x435d('0x34')]);_0x49d087[_0x435d('0x36')]=_[_0x435d('0x37')](_0x42a92a[_0x435d('0x32')],qs['fields'](_0x279f27[_0x435d('0x34')]['fields']));_0x49d087[_0x435d('0x36')]=_0x49d087['attributes'][_0x435d('0x38')]?_0x49d087[_0x435d('0x36')]:_0x42a92a['model'];if(!_0x279f27[_0x435d('0x34')][_0x435d('0x39')]('nolimit')){_0x49d087[_0x435d('0x1d')]=qs[_0x435d('0x1d')](_0x279f27[_0x435d('0x34')][_0x435d('0x1d')]);_0x49d087['offset']=qs[_0x435d('0x1b')](_0x279f27[_0x435d('0x34')][_0x435d('0x1b')]);}_0x49d087[_0x435d('0x3a')]=qs[_0x435d('0x3b')](_0x279f27[_0x435d('0x34')]['sort']);_0x49d087['where']=qs[_0x435d('0x35')](_[_0x435d('0x3c')](_0x279f27['query'],_0x42a92a[_0x435d('0x35')]),_0x32bd8d);if(_0x279f27[_0x435d('0x34')][_0x435d('0x3d')]){_0x49d087[_0x435d('0x3e')]=_['merge'](_0x49d087['where'],{'$or':_[_0x435d('0x2d')](_0x32bd8d,function(_0x3e4eeb){if(_0x3e4eeb[_0x435d('0x30')]!==_0x435d('0x3f')){var _0xe615a8={};_0xe615a8[_0x3e4eeb[_0x435d('0x2a')]]={'$like':'%'+_0x279f27['query'][_0x435d('0x3d')]+'%'};return _0xe615a8;}})});}_0x49d087=_['merge']({},_0x49d087,_0x279f27[_0x435d('0x40')]);var _0x4ab852={'where':_0x49d087[_0x435d('0x3e')]};return db[_0x435d('0x2e')][_0x435d('0x1e')](_0x4ab852)[_0x435d('0x26')](function(_0xe7020c){_0x4ca5f7[_0x435d('0x1e')]=_0xe7020c;if(_0x279f27[_0x435d('0x34')]['includeAll']){_0x49d087['include']=[{'all':!![]}];}return db[_0x435d('0x2e')][_0x435d('0x41')](_0x49d087);})[_0x435d('0x26')](function(_0x49c03c){_0x4ca5f7['rows']=_0x49c03c;return _0x4ca5f7;})['then'](respondWithFilteredResult(_0x3cc002,_0x49d087))[_0x435d('0x42')](handleError(_0x3cc002,null));};exports[_0x435d('0x43')]=function(_0x365b28,_0x24345c){var _0x3ac3c5={'raw':![],'where':{'id':_0x365b28[_0x435d('0x44')]['id']}},_0xb6cc0b={};_0xb6cc0b['model']=_[_0x435d('0x33')](db['VtigerAccount']['rawAttributes']);_0xb6cc0b[_0x435d('0x34')]=_[_0x435d('0x33')](_0x365b28['query']);_0xb6cc0b[_0x435d('0x35')]=_[_0x435d('0x37')](_0xb6cc0b['model'],_0xb6cc0b[_0x435d('0x34')]);_0x3ac3c5['attributes']=_[_0x435d('0x37')](_0xb6cc0b['model'],qs['fields'](_0x365b28[_0x435d('0x34')][_0x435d('0x45')]));_0x3ac3c5[_0x435d('0x36')]=_0x3ac3c5['attributes']['length']?_0x3ac3c5[_0x435d('0x36')]:_0xb6cc0b['model'];if(_0x365b28['query'][_0x435d('0x46')]){_0x3ac3c5['include']=[{'all':!![]}];}_0x3ac3c5=_[_0x435d('0x47')]({},_0x3ac3c5,_0x365b28[_0x435d('0x40')]);return db['VtigerAccount'][_0x435d('0x48')](_0x3ac3c5)[_0x435d('0x26')](handleEntityNotFound(_0x24345c,null))[_0x435d('0x26')](respondWithResult(_0x24345c,null))[_0x435d('0x42')](handleError(_0x24345c,null));};exports[_0x435d('0x49')]=function(_0x2802f1,_0x1e5bf9){return db[_0x435d('0x2e')]['create'](_0x2802f1[_0x435d('0x4a')],{})[_0x435d('0x26')](respondWithResult(_0x1e5bf9,0xc9))[_0x435d('0x42')](handleError(_0x1e5bf9,null));};exports[_0x435d('0x25')]=function(_0x9e9a17,_0x2db562){if(_0x9e9a17[_0x435d('0x4a')]['id']){delete _0x9e9a17[_0x435d('0x4a')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x9e9a17['params']['id']}})[_0x435d('0x26')](handleEntityNotFound(_0x2db562,null))['then'](saveUpdates(_0x9e9a17['body'],null))[_0x435d('0x26')](respondWithResult(_0x2db562,null))[_0x435d('0x42')](handleError(_0x2db562,null));};exports[_0x435d('0x4b')]=function(_0x11fc0e,_0x29ccef){return db[_0x435d('0x2e')][_0x435d('0x48')]({'where':{'id':_0x11fc0e['params']['id']}})['then'](handleEntityNotFound(_0x29ccef,null))[_0x435d('0x26')](removeEntity(_0x29ccef,null))[_0x435d('0x42')](handleError(_0x29ccef,null));};exports[_0x435d('0x4c')]=function(_0x58067c,_0x4fb3b8,_0x4d297e){var _0x5f4027={};var _0x59d5ef={};var _0x3ff750;var _0x54b3e1;return db[_0x435d('0x2e')][_0x435d('0x4d')]({'where':{'id':_0x58067c[_0x435d('0x44')]['id']}})[_0x435d('0x26')](handleEntityNotFound(_0x4fb3b8,null))['then'](function(_0x6ba137){if(_0x6ba137){_0x3ff750=_0x6ba137;_0x59d5ef[_0x435d('0x32')]=_[_0x435d('0x33')](db[_0x435d('0x4e')][_0x435d('0x4f')]);_0x59d5ef['query']=_[_0x435d('0x33')](_0x58067c['query']);_0x59d5ef[_0x435d('0x35')]=_[_0x435d('0x37')](_0x59d5ef['model'],_0x59d5ef[_0x435d('0x34')]);_0x5f4027[_0x435d('0x36')]=_[_0x435d('0x37')](_0x59d5ef[_0x435d('0x32')],qs['fields'](_0x58067c['query'][_0x435d('0x45')]));_0x5f4027[_0x435d('0x36')]=_0x5f4027[_0x435d('0x36')]['length']?_0x5f4027[_0x435d('0x36')]:_0x59d5ef[_0x435d('0x32')];_0x5f4027[_0x435d('0x3a')]=qs[_0x435d('0x3b')](_0x58067c['query'][_0x435d('0x3b')]);_0x5f4027[_0x435d('0x3e')]=qs['filters'](_[_0x435d('0x3c')](_0x58067c[_0x435d('0x34')],_0x59d5ef['filters']));if(_0x58067c[_0x435d('0x34')]['filter']){_0x5f4027[_0x435d('0x3e')]=_[_0x435d('0x47')](_0x5f4027[_0x435d('0x3e')],{'$or':_[_0x435d('0x2d')](_0x5f4027[_0x435d('0x36')],function(_0x34a1e8){var _0x33a99f={};_0x33a99f[_0x34a1e8]={'$like':'%'+_0x58067c[_0x435d('0x34')][_0x435d('0x3d')]+'%'};return _0x33a99f;})});}_0x5f4027=_[_0x435d('0x47')]({},_0x5f4027,_0x58067c[_0x435d('0x40')]);return _0x3ff750[_0x435d('0x4c')](_0x5f4027);}})['then'](function(_0x31af36){if(_0x31af36){_0x54b3e1=_0x31af36[_0x435d('0x38')];if(!_0x58067c['query'][_0x435d('0x39')]('nolimit')){_0x5f4027[_0x435d('0x1d')]=qs[_0x435d('0x1d')](_0x58067c[_0x435d('0x34')]['limit']);_0x5f4027[_0x435d('0x1b')]=qs[_0x435d('0x1b')](_0x58067c['query']['offset']);}return _0x3ff750[_0x435d('0x4c')](_0x5f4027);}})[_0x435d('0x26')](function(_0x186114){if(_0x186114){return _0x186114?{'count':_0x54b3e1,'rows':_0x186114}:null;}})[_0x435d('0x26')](respondWithResult(_0x4fb3b8,null))[_0x435d('0x42')](handleError(_0x4fb3b8,null));};exports['addConfiguration']=function(_0x303fd0,_0x27e125,_0x55728e){if(_0x303fd0[_0x435d('0x4a')]['id']){delete _0x303fd0[_0x435d('0x4a')]['id'];}return db[_0x435d('0x2e')][_0x435d('0x4d')]({'where':{'id':_0x303fd0[_0x435d('0x44')]['id']}})[_0x435d('0x26')](handleEntityNotFound(_0x27e125,null))['then'](function(_0x43350f){if(_0x43350f){_0x303fd0['body']['AccountId']=_0x43350f['id'];_0x303fd0[_0x435d('0x4a')][_0x435d('0x50')]=integrations[_0x435d('0x51')](_0x303fd0[_0x435d('0x4a')][_0x435d('0x52')],_0x303fd0[_0x435d('0x4a')]['type']);_0x303fd0[_0x435d('0x4a')][_0x435d('0x53')]=integrations[_0x435d('0x54')](_0x303fd0['body'][_0x435d('0x52')],_0x303fd0['body'][_0x435d('0x30')]);return db[_0x435d('0x4e')][_0x435d('0x49')](_0x303fd0[_0x435d('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x435d('0x50')},{'model':db[_0x435d('0x55')],'as':_0x435d('0x53')}]});}return null;})[_0x435d('0x26')](respondWithResult(_0x27e125,null))[_0x435d('0x42')](handleError(_0x27e125,null));};var md5=require(_0x435d('0x56'));exports[_0x435d('0x57')]=function(_0x2d9499,_0x542001,_0x286678){var _0x53f725=null;var _0xbe32a6=null;var _0x441334=null;var _0x174e04=null;var _0x2a906a='';return db[_0x435d('0x2e')][_0x435d('0x4d')]({'where':{'id':_0x2d9499[_0x435d('0x44')]['id']},'attributes':['id',_0x435d('0x2a'),'username','description',_0x435d('0x58'),_0x435d('0x59'),'serverUrl','accessKey']})[_0x435d('0x26')](handleEntityNotFound(_0x542001,null))['then'](function(_0x12e924){if(_0x12e924){_0x53f725=_0x12e924[_0x435d('0x5a')];_0xbe32a6=_0x12e924[_0x435d('0x5b')];_0x441334=_0x12e924[_0x435d('0x58')];_0x2a906a=_0x12e924['remoteUri'];var _0x4dea0d=_0x2a906a[_0x435d('0x5c')](-0x1);if(_0x4dea0d==='/'){_0x2a906a=_0x2a906a['substring'](0x0,_0x2a906a['lastIndexOf'](_0x4dea0d));}_0x174e04=util[_0x435d('0x5d')]('%s/webservice.php',_0x2a906a);var _0x11c021={'method':_0x435d('0x5e'),'uri':_0x174e04,'qs':{'operation':_0x435d('0x5f'),'username':_0x12e924[_0x435d('0x5a')]},'json':!![]};return rp(_0x11c021);}})[_0x435d('0x26')](function(_0x1701bc){if(_0x1701bc[_0x435d('0x60')]){var _0x925be5={'method':_0x435d('0x61'),'uri':_0x174e04,'form':{'operation':'login','username':_0x53f725,'accessKey':md5(_0x1701bc['result'][_0x435d('0x62')]+_0xbe32a6)},'json':!![]};return rp(_0x925be5);}})[_0x435d('0x26')](function(_0x3d96c6){if(_0x3d96c6[_0x435d('0x60')]){var _0x184e6b={'method':_0x435d('0x5e'),'uri':_0x174e04,'qs':{'operation':'describe','username':_0x53f725,'sessionName':_0x3d96c6[_0x435d('0x63')]['sessionName'],'elementType':_0x441334},'json':!![]};return rp(_0x184e6b);}})[_0x435d('0x26')](function(_0x2eb166){if(_0x2eb166[_0x435d('0x60')]){var _0x484bcc=[_0x435d('0x64'),_0x435d('0x65'),'owner'];_['remove'](_0x2eb166[_0x435d('0x63')][_0x435d('0x45')],function(_0x456996){return _0x484bcc[_0x435d('0x66')](_0x456996[_0x435d('0x30')][_0x435d('0x2a')]);});_[_0x435d('0x67')](_0x2eb166[_0x435d('0x63')][_0x435d('0x45')],function(_0x225d0c){return _0x225d0c['editable']===_0x435d('0x68');});return{'count':_0x2eb166[_0x435d('0x63')]['fields']['length'],'rows':_['map'](_0x2eb166[_0x435d('0x63')]['fields'],function(_0x5a986c){return{'id':_0x5a986c['name'],'name':_0x5a986c[_0x435d('0x69')],'custom':_[_0x435d('0x6a')](_0x5a986c[_0x435d('0x2a')],'cf_')?!![]:![],'options':_0x5a986c[_0x435d('0x30')][_0x435d('0x2a')]===_0x435d('0x6b')&&_0x5a986c['type'][_0x435d('0x6c')][_0x435d('0x38')]>0x0?_[_0x435d('0x2d')](_0x5a986c[_0x435d('0x30')][_0x435d('0x6c')],function(_0x4fd050){return{'name':_0x4fd050[_0x435d('0x69')],'value':_0x4fd050[_0x435d('0x6d')]};}):[]};})};}})['then'](respondWithResult(_0x542001,null))[_0x435d('0x42')](function(_0x4774c9){console[_0x435d('0x6e')](_0x435d('0x6f')+_0x4774c9);var _0x3ac389=_0x2d9499[_0x435d('0x34')]['test']?0x1f4:_0x4774c9[_0x435d('0x70')]||0x1f4;logger[_0x435d('0x28')](_0x435d('0x71'),_0x435d('0x57'),_0x3ac389,JSON[_0x435d('0x72')](_0x4774c9));delete _0x4774c9[_0x435d('0x2a')];if(_0x3ac389===0x191){_0x3ac389=0x190;}_0x542001['status'](_0x3ac389)[_0x435d('0x2b')](_0x2d9499['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x4774c9['statusCode']}:_0x4774c9);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b338079..df8b458 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 _0x917f=['path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger','api','moment','request-promise'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x917f,0x110));var _0xf917=function(_0x35ea51,_0x34769f){_0x35ea51=_0x35ea51-0x0;var _0x5b811a=_0x917f[_0x35ea51];return _0x5b811a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf917('0x0'))(_0xf917('0x1'));var moment=require(_0xf917('0x2'));var BPromise=require('bluebird');var rp=require(_0xf917('0x3'));var fs=require('fs');var path=require(_0xf917('0x4'));var rimraf=require('rimraf');var config=require(_0xf917('0x5'));var attributes=require(_0xf917('0x6'));var integrations=require(_0xf917('0x7'));module[_0xf917('0x8')]=function(_0xe88ab,_0x67a9ec){return _0xe88ab[_0xf917('0x9')](_0xf917('0xa'),attributes,{'tableName':_0xf917('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd906=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','../../config/logger'];(function(_0x77fbea,_0x27a5ec){var _0x2d35e5=function(_0x200e93){while(--_0x200e93){_0x77fbea['push'](_0x77fbea['shift']());}};_0x2d35e5(++_0x27a5ec);}(_0xd906,0x6b));var _0x6d90=function(_0x372b5a,_0x5d3393){_0x372b5a=_0x372b5a-0x0;var _0x43ac01=_0xd906[_0x372b5a];return _0x43ac01;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6d90('0x0'))(_0x6d90('0x1'));var moment=require(_0x6d90('0x2'));var BPromise=require(_0x6d90('0x3'));var rp=require(_0x6d90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d90('0x5'));var config=require(_0x6d90('0x6'));var attributes=require(_0x6d90('0x7'));var integrations=require(_0x6d90('0x8'));module['exports']=function(_0x8ee191,_0x19eb61){return _0x8ee191[_0x6d90('0x9')](_0x6d90('0xa'),attributes,{'tableName':_0x6d90('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 f3cd31a..26adc24 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 _0x1775=['stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','limit','map','include','model','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2b2df1,_0x58a51c){var _0x8dfc93=function(_0x557e79){while(--_0x557e79){_0x2b2df1['push'](_0x2b2df1['shift']());}};_0x8dfc93(++_0x58a51c);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['findAll']({'raw':_0x1b4102[_0x5177('0x1c')]?_0x1b4102['options'][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1e')]||null:null,'attributes':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'limit':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x20')]||null:null,'include':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')]['include']?_[_0x5177('0x21')](_0x1b4102['options'][_0x5177('0x22')],function(_0x2c68d8){return{'model':db[_0x2c68d8[_0x5177('0x23')]],'as':_0x2c68d8['as'],'attributes':_0x2c68d8[_0x5177('0x1f')],'include':_0x2c68d8['include']?_[_0x5177('0x21')](_0x2c68d8['include'],function(_0x564139){return{'model':db[_0x564139[_0x5177('0x23')]],'as':_0x564139['as'],'attributes':_0x564139[_0x5177('0x1f')],'include':_0x564139['include']?_[_0x5177('0x21')](_0x564139['include'],function(_0x231d35){return{'model':db[_0x231d35[_0x5177('0x23')]],'as':_0x231d35['as'],'attributes':_0x231d35['attributes']};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x2554ec){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON['stringify'](_0x2554ec));_0x3e6944(_0x2554ec);})['catch'](function(_0x45cf20){logger[_0x5177('0x14')](_0x5177('0x1a'),_0x45cf20[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4[_0x5177('0x14')](0x1f4,_0x45cf20[_0x5177('0x17')]));});});};exports[_0x5177('0x24')]=function(_0x72dced){var _0x49f6f1=this;return new Promise(function(_0x42e1db,_0x2233a2){return db['VtigerAccount'][_0x5177('0x25')]({'raw':_0x72dced['options']?_0x72dced[_0x5177('0x1c')][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x72dced[_0x5177('0x1c')]?_0x72dced['options']['where']||null:null,'attributes':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'include':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x22')]?_[_0x5177('0x21')](_0x72dced[_0x5177('0x1c')]['include'],function(_0x459ac6){return{'model':db[_0x459ac6[_0x5177('0x23')]],'as':_0x459ac6['as'],'attributes':_0x459ac6['attributes'],'include':_0x459ac6[_0x5177('0x22')]?_[_0x5177('0x21')](_0x459ac6[_0x5177('0x22')],function(_0x8727c6){return{'model':db[_0x8727c6[_0x5177('0x23')]],'as':_0x8727c6['as'],'attributes':_0x8727c6[_0x5177('0x1f')],'include':_0x8727c6['include']?_[_0x5177('0x21')](_0x8727c6[_0x5177('0x22')],function(_0x28b1d5){return{'model':db[_0x28b1d5[_0x5177('0x23')]],'as':_0x28b1d5['as'],'attributes':_0x28b1d5[_0x5177('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x1bb1e3){logger['info'](_0x5177('0x24'),_0x72dced);logger[_0x5177('0x10')]('ShowVtigerAccount',_0x72dced,JSON['stringify'](_0x1bb1e3));_0x42e1db(_0x1bb1e3);})[_0x5177('0x19')](function(_0x188cec){logger[_0x5177('0x14')](_0x5177('0x24'),_0x188cec[_0x5177('0x17')],_0x72dced);_0x2233a2(_0x49f6f1[_0x5177('0x14')](0x1f4,_0x188cec[_0x5177('0x17')]));});});}; \ No newline at end of file +var _0xbee3=['VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','limit','include','map','model','attributes','stringify','where','ShowVtigerAccount','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xbee3,0xd5));var _0x3bee=function(_0x395309,_0x3e10c5){_0x395309=_0x395309-0x0;var _0x1391b3=_0xbee3[_0x395309];return _0x1391b3;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3bee('0x1'));var fs=require('fs');var Redis=require(_0x3bee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var config=require('../../config/environment');var jayson=require(_0x3bee('0x6'));var client=jayson[_0x3bee('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fdeec,_0x28d912,_0x1b510d){return new BPromise(function(_0x339223,_0xbdd5d5){return client[_0x3bee('0x8')](_0x2fdeec,_0x1b510d)[_0x3bee('0x9')](function(_0x518e2d){logger[_0x3bee('0xa')](_0x3bee('0xb'),_0x28d912,_0x3bee('0xc'));logger[_0x3bee('0xd')](_0x3bee('0xe'),_0x28d912,_0x3bee('0xc'),JSON['stringify'](_0x518e2d));if(_0x518e2d[_0x3bee('0xf')]){if(_0x518e2d['error'][_0x3bee('0x10')]===0x1f4){logger[_0x3bee('0xf')](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0xbdd5d5(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}logger['error'](_0x3bee('0xb'),_0x28d912,_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);return _0x339223(_0x518e2d[_0x3bee('0xf')][_0x3bee('0x11')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x28d912,_0x3bee('0xc'));_0x339223(_0x518e2d['result'][_0x3bee('0x11')]);}})[_0x3bee('0x12')](function(_0x57d42c){logger['error'](_0x3bee('0xb'),_0x28d912,_0x57d42c);_0xbdd5d5(_0x57d42c);});});}exports[_0x3bee('0x13')]=function(_0xfdba3b){var _0x631ff8=this;return new Promise(function(_0x49095a,_0x30a1de){return db[_0x3bee('0x14')][_0x3bee('0x15')]({'raw':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x17')]===undefined?!![]:![]:!![],'where':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b['options']['where']||null:null,'attributes':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')]['attributes']||null:null,'limit':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x18')]||null:null,'include':_0xfdba3b[_0x3bee('0x16')]?_0xfdba3b[_0x3bee('0x16')][_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0xfdba3b['options'][_0x3bee('0x19')],function(_0x1ed0c1){return{'model':db[_0x1ed0c1[_0x3bee('0x1b')]],'as':_0x1ed0c1['as'],'attributes':_0x1ed0c1[_0x3bee('0x1c')],'include':_0x1ed0c1['include']?_[_0x3bee('0x1a')](_0x1ed0c1[_0x3bee('0x19')],function(_0x1e0111){return{'model':db[_0x1e0111['model']],'as':_0x1e0111['as'],'attributes':_0x1e0111['attributes'],'include':_0x1e0111[_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0x1e0111['include'],function(_0x2c0e50){return{'model':db[_0x2c0e50[_0x3bee('0x1b')]],'as':_0x2c0e50['as'],'attributes':_0x2c0e50[_0x3bee('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1984c4){logger[_0x3bee('0xa')](_0x3bee('0x13'),_0xfdba3b);logger['debug'](_0x3bee('0x13'),_0xfdba3b,JSON[_0x3bee('0x1d')](_0x1984c4));_0x49095a(_0x1984c4);})[_0x3bee('0x12')](function(_0x496abd){logger[_0x3bee('0xf')](_0x3bee('0x13'),_0x496abd[_0x3bee('0x11')],_0xfdba3b);_0x30a1de(_0x631ff8[_0x3bee('0xf')](0x1f4,_0x496abd[_0x3bee('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x564e45){var _0x3fbc8c=this;return new Promise(function(_0x1e1529,_0x10bae0){return db[_0x3bee('0x14')]['find']({'raw':_0x564e45['options']?_0x564e45[_0x3bee('0x16')][_0x3bee('0x17')]===undefined?!![]:![]:!![],'where':_0x564e45['options']?_0x564e45['options'][_0x3bee('0x1e')]||null:null,'attributes':_0x564e45[_0x3bee('0x16')]?_0x564e45[_0x3bee('0x16')][_0x3bee('0x1c')]||null:null,'include':_0x564e45[_0x3bee('0x16')]?_0x564e45[_0x3bee('0x16')][_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0x564e45[_0x3bee('0x16')][_0x3bee('0x19')],function(_0x569675){return{'model':db[_0x569675['model']],'as':_0x569675['as'],'attributes':_0x569675[_0x3bee('0x1c')],'include':_0x569675['include']?_['map'](_0x569675[_0x3bee('0x19')],function(_0x1bc332){return{'model':db[_0x1bc332[_0x3bee('0x1b')]],'as':_0x1bc332['as'],'attributes':_0x1bc332[_0x3bee('0x1c')],'include':_0x1bc332[_0x3bee('0x19')]?_[_0x3bee('0x1a')](_0x1bc332[_0x3bee('0x19')],function(_0x10ace5){return{'model':db[_0x10ace5['model']],'as':_0x10ace5['as'],'attributes':_0x10ace5[_0x3bee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3bee('0x9')](function(_0x5f046a){logger[_0x3bee('0xa')](_0x3bee('0x1f'),_0x564e45);logger[_0x3bee('0xd')](_0x3bee('0x1f'),_0x564e45,JSON[_0x3bee('0x1d')](_0x5f046a));_0x1e1529(_0x5f046a);})['catch'](function(_0x57a895){logger[_0x3bee('0xf')](_0x3bee('0x1f'),_0x57a895[_0x3bee('0x11')],_0x564e45);_0x10bae0(_0x3fbc8c[_0x3bee('0xf')](0x1f4,_0x57a895[_0x3bee('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 32d18db..10291fa 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 _0x118b=['getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x51b5ea,_0x3fc812){var _0x2ba4d9=function(_0x17fb38){while(--_0x17fb38){_0x51b5ea['push'](_0x51b5ea['shift']());}};_0x2ba4d9(++_0x3fc812);}(_0x118b,0x1be));var _0xb118=function(_0xd97555,_0x436fee){_0xd97555=_0xd97555-0x0;var _0x4d7c97=_0x118b[_0xd97555];return _0x4d7c97;};'use strict';var multer=require(_0xb118('0x0'));var util=require('util');var path=require(_0xb118('0x1'));var timeout=require('connect-timeout');var express=require(_0xb118('0x2'));var router=express[_0xb118('0x3')]();var fs_extra=require(_0xb118('0x4'));var auth=require(_0xb118('0x5'));var interaction=require(_0xb118('0x6'));var config=require('../../config/environment');var controller=require(_0xb118('0x7'));router[_0xb118('0x8')]('/',auth[_0xb118('0x9')](),controller[_0xb118('0xa')]);router[_0xb118('0x8')](_0xb118('0xb'),auth[_0xb118('0x9')](),controller[_0xb118('0xc')]);router[_0xb118('0x8')](_0xb118('0xd'),auth[_0xb118('0x9')](),controller[_0xb118('0xe')]);router[_0xb118('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xb118('0x8')](_0xb118('0xf'),auth['isAuthenticated'](),controller[_0xb118('0x10')]);router[_0xb118('0x11')]('/',auth[_0xb118('0x9')](),controller[_0xb118('0x12')]);router[_0xb118('0x13')](_0xb118('0xb'),auth[_0xb118('0x9')](),controller[_0xb118('0x14')]);router[_0xb118('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb118('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe94b=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x4bd1e0,_0x16eb15){var _0x434894=function(_0x2ef70e){while(--_0x2ef70e){_0x4bd1e0['push'](_0x4bd1e0['shift']());}};_0x434894(++_0x16eb15);}(_0xe94b,0x1d9));var _0xbe94=function(_0x1c6787,_0x322aea){_0x1c6787=_0x1c6787-0x0;var _0x10c3df=_0xe94b[_0x1c6787];return _0x10c3df;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbe94('0x0'));var express=require(_0xbe94('0x1'));var router=express['Router']();var fs_extra=require(_0xbe94('0x2'));var auth=require(_0xbe94('0x3'));var interaction=require(_0xbe94('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xbe94('0x5')]('/',auth[_0xbe94('0x6')](),controller[_0xbe94('0x7')]);router[_0xbe94('0x5')](_0xbe94('0x8'),auth['isAuthenticated'](),controller[_0xbe94('0x9')]);router[_0xbe94('0x5')](_0xbe94('0xa'),auth[_0xbe94('0x6')](),controller[_0xbe94('0xb')]);router[_0xbe94('0x5')](_0xbe94('0xc'),auth[_0xbe94('0x6')](),controller[_0xbe94('0xd')]);router[_0xbe94('0x5')](_0xbe94('0xe'),auth[_0xbe94('0x6')](),controller[_0xbe94('0xf')]);router[_0xbe94('0x10')]('/',auth['isAuthenticated'](),controller[_0xbe94('0x11')]);router[_0xbe94('0x12')](_0xbe94('0x8'),auth[_0xbe94('0x6')](),controller[_0xbe94('0x13')]);router[_0xbe94('0x14')]('/:id',auth[_0xbe94('0x6')](),controller[_0xbe94('0x15')]);module[_0xbe94('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 64ee87a..210e5ed 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 _0x90b1=['sequelize','exports','STRING'];(function(_0x55e251,_0x1461ec){var _0x5683f1=function(_0xf77bc4){while(--_0xf77bc4){_0x55e251['push'](_0x55e251['shift']());}};_0x5683f1(++_0x1461ec);}(_0x90b1,0x198));var _0x190b=function(_0x5ee893,_0x260e68){_0x5ee893=_0x5ee893-0x0;var _0x79ab0e=_0x90b1[_0x5ee893];return _0x79ab0e;};'use strict';var Sequelize=require(_0x190b('0x0'));module[_0x190b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x190b('0x2')]}}; \ No newline at end of file +var _0x929f=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x929f,0x126));var _0xf929=function(_0x1e7f9f,_0x30055d){_0x1e7f9f=_0x1e7f9f-0x0;var _0x35d688=_0x929f[_0x1e7f9f];return _0x35d688;};'use strict';var Sequelize=require(_0xf929('0x0'));module['exports']={'name':{'type':Sequelize[_0xf929('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 3b93a58..45c508a 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 _0xb9fd=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','VtigerConfiguration','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','order','getSubjects','VtigerField','findOne','getDescriptions','eml-format','rimraf','fast-json-patch'];(function(_0x57fec7,_0x233d2b){var _0x2290c0=function(_0x265c00){while(--_0x265c00){_0x57fec7['push'](_0x57fec7['shift']());}};_0x2290c0(++_0x233d2b);}(_0xb9fd,0x149));var _0xdb9f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xb9fd[_0x45b034];return _0x509cb0;};'use strict';var emlformat=require(_0xdb9f('0x0'));var rimraf=require(_0xdb9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb9f('0x2'));var rp=require(_0xdb9f('0x3'));var moment=require(_0xdb9f('0x4'));var BPromise=require(_0xdb9f('0x5'));var Mustache=require(_0xdb9f('0x6'));var util=require(_0xdb9f('0x7'));var path=require(_0xdb9f('0x8'));var sox=require(_0xdb9f('0x9'));var csv=require(_0xdb9f('0xa'));var ejs=require(_0xdb9f('0xb'));var fs=require('fs');var fs_extra=require(_0xdb9f('0xc'));var _=require(_0xdb9f('0xd'));var squel=require(_0xdb9f('0xe'));var crypto=require('crypto');var jsforce=require(_0xdb9f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb9f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb9f('0x11'));var as=require(_0xdb9f('0x12'));var hardwareService=require(_0xdb9f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xdb9f('0x14'));var config=require(_0xdb9f('0x15'));var licenseUtil=require(_0xdb9f('0x16'));var db=require(_0xdb9f('0x17'))['db'];function respondWithStatusCode(_0x1ad376,_0x13b999){_0x13b999=_0x13b999||0xcc;return function(_0x52cbd4){if(_0x52cbd4){return _0x1ad376[_0xdb9f('0x18')](_0x13b999);}return _0x1ad376[_0xdb9f('0x19')](_0x13b999)[_0xdb9f('0x1a')]();};}function respondWithResult(_0x5023ca,_0xcb2708){_0xcb2708=_0xcb2708||0xc8;return function(_0x329e80){if(_0x329e80){return _0x5023ca[_0xdb9f('0x19')](_0xcb2708)[_0xdb9f('0x1b')](_0x329e80);}};}function respondWithFilteredResult(_0x4fe3ca,_0x1c90fe){return function(_0x41bd58){if(_0x41bd58){var _0x138822=typeof _0x1c90fe[_0xdb9f('0x1c')]===_0xdb9f('0x1d')&&typeof _0x1c90fe['limit']===_0xdb9f('0x1d');var _0x163b59=_0x41bd58['count'];var _0x1efeb9=_0x138822?0x0:_0x1c90fe[_0xdb9f('0x1c')];var _0x4fb035=_0x138822?_0x41bd58[_0xdb9f('0x1e')]:_0x1c90fe['offset']+_0x1c90fe[_0xdb9f('0x1f')];var _0x54fcd2;if(_0x4fb035>=_0x163b59){_0x4fb035=_0x163b59;_0x54fcd2=0xc8;}else{_0x54fcd2=0xce;}_0x4fe3ca[_0xdb9f('0x19')](_0x54fcd2);return _0x4fe3ca[_0xdb9f('0x20')](_0xdb9f('0x21'),_0x1efeb9+'-'+_0x4fb035+'/'+_0x163b59)['json'](_0x41bd58);}return null;};}function patchUpdates(_0x51f1f5){return function(_0x3a03d8){try{jsonpatch[_0xdb9f('0x22')](_0x3a03d8,_0x51f1f5,!![]);}catch(_0x504a4e){return BPromise[_0xdb9f('0x23')](_0x504a4e);}return _0x3a03d8[_0xdb9f('0x24')]();};}function saveUpdates(_0x17a0b0,_0x50bc5c){return function(_0x2b4ea4){if(_0x2b4ea4){return _0x2b4ea4[_0xdb9f('0x25')](_0x17a0b0)['then'](function(_0x11e0ac){return _0x11e0ac;});}return null;};}function removeEntity(_0x260f71,_0x2e60ff){return function(_0x536385){if(_0x536385){return _0x536385[_0xdb9f('0x26')]()[_0xdb9f('0x27')](function(){_0x260f71[_0xdb9f('0x19')](0xcc)[_0xdb9f('0x1a')]();});}};}function handleEntityNotFound(_0x3b0423,_0x1a41d1){return function(_0x3b5f32){if(!_0x3b5f32){_0x3b0423['sendStatus'](0x194);}return _0x3b5f32;};}function handleError(_0x2007eb,_0x2590d3){_0x2590d3=_0x2590d3||0x1f4;return function(_0x1a9996){logger[_0xdb9f('0x28')](_0x1a9996[_0xdb9f('0x29')]);if(_0x1a9996['name']){delete _0x1a9996['name'];}_0x2007eb[_0xdb9f('0x19')](_0x2590d3)[_0xdb9f('0x2a')](_0x1a9996);};}exports[_0xdb9f('0x2b')]=function(_0x3f177c,_0x29b424){var _0x4f14e6={},_0x3be6b={},_0x2e9b4b={'count':0x0,'rows':[]};var _0x161bea=_[_0xdb9f('0x2c')](db[_0xdb9f('0x2d')]['rawAttributes'],function(_0x429d6e){return{'name':_0x429d6e[_0xdb9f('0x2e')],'type':_0x429d6e[_0xdb9f('0x2f')][_0xdb9f('0x30')]};});_0x3be6b[_0xdb9f('0x31')]=_[_0xdb9f('0x2c')](_0x161bea,_0xdb9f('0x32'));_0x3be6b[_0xdb9f('0x33')]=_[_0xdb9f('0x34')](_0x3f177c[_0xdb9f('0x33')]);_0x3be6b['filters']=_[_0xdb9f('0x35')](_0x3be6b[_0xdb9f('0x31')],_0x3be6b[_0xdb9f('0x33')]);_0x4f14e6['attributes']=_[_0xdb9f('0x35')](_0x3be6b[_0xdb9f('0x31')],qs['fields'](_0x3f177c[_0xdb9f('0x33')][_0xdb9f('0x36')]));_0x4f14e6[_0xdb9f('0x37')]=_0x4f14e6[_0xdb9f('0x37')][_0xdb9f('0x38')]?_0x4f14e6[_0xdb9f('0x37')]:_0x3be6b[_0xdb9f('0x31')];if(!_0x3f177c[_0xdb9f('0x33')][_0xdb9f('0x39')](_0xdb9f('0x3a'))){_0x4f14e6[_0xdb9f('0x1f')]=qs[_0xdb9f('0x1f')](_0x3f177c[_0xdb9f('0x33')][_0xdb9f('0x1f')]);_0x4f14e6[_0xdb9f('0x1c')]=qs[_0xdb9f('0x1c')](_0x3f177c[_0xdb9f('0x33')][_0xdb9f('0x1c')]);}_0x4f14e6['order']=qs[_0xdb9f('0x3b')](_0x3f177c['query'][_0xdb9f('0x3b')]);_0x4f14e6[_0xdb9f('0x3c')]=qs[_0xdb9f('0x3d')](_[_0xdb9f('0x3e')](_0x3f177c['query'],_0x3be6b[_0xdb9f('0x3d')]),_0x161bea);if(_0x3f177c['query'][_0xdb9f('0x3f')]){_0x4f14e6[_0xdb9f('0x3c')]=_[_0xdb9f('0x40')](_0x4f14e6['where'],{'$or':_[_0xdb9f('0x2c')](_0x161bea,function(_0x170e52){if(_0x170e52[_0xdb9f('0x2f')]!=='VIRTUAL'){var _0x15226f={};_0x15226f[_0x170e52[_0xdb9f('0x32')]]={'$like':'%'+_0x3f177c['query'][_0xdb9f('0x3f')]+'%'};return _0x15226f;}})});}_0x4f14e6=_[_0xdb9f('0x40')]({},_0x4f14e6,_0x3f177c[_0xdb9f('0x41')]);var _0x3feb64={'where':_0x4f14e6[_0xdb9f('0x3c')]};return db[_0xdb9f('0x2d')][_0xdb9f('0x1e')](_0x3feb64)['then'](function(_0x27923d){_0x2e9b4b[_0xdb9f('0x1e')]=_0x27923d;if(_0x3f177c[_0xdb9f('0x33')]['includeAll']){_0x4f14e6[_0xdb9f('0x42')]=[{'all':!![]}];}return db[_0xdb9f('0x2d')][_0xdb9f('0x43')](_0x4f14e6);})['then'](function(_0x244c4b){_0x2e9b4b[_0xdb9f('0x44')]=_0x244c4b;return _0x2e9b4b;})[_0xdb9f('0x27')](respondWithFilteredResult(_0x29b424,_0x4f14e6))[_0xdb9f('0x45')](handleError(_0x29b424,null));};exports[_0xdb9f('0x46')]=function(_0x2b5c31,_0x551c8a){var _0x2b5ca={'raw':![],'where':{'id':_0x2b5c31[_0xdb9f('0x47')]['id']}},_0x31c431={};_0x31c431[_0xdb9f('0x31')]=_[_0xdb9f('0x34')](db[_0xdb9f('0x2d')][_0xdb9f('0x48')]);_0x31c431[_0xdb9f('0x33')]=_[_0xdb9f('0x34')](_0x2b5c31[_0xdb9f('0x33')]);_0x31c431[_0xdb9f('0x3d')]=_[_0xdb9f('0x35')](_0x31c431[_0xdb9f('0x31')],_0x31c431[_0xdb9f('0x33')]);_0x2b5ca[_0xdb9f('0x37')]=_['intersection'](_0x31c431['model'],qs[_0xdb9f('0x36')](_0x2b5c31[_0xdb9f('0x33')]['fields']));_0x2b5ca['attributes']=_0x2b5ca[_0xdb9f('0x37')][_0xdb9f('0x38')]?_0x2b5ca[_0xdb9f('0x37')]:_0x31c431[_0xdb9f('0x31')];if(_0x2b5c31[_0xdb9f('0x33')][_0xdb9f('0x49')]){_0x2b5ca['include']=[{'all':!![]}];}_0x2b5ca=_[_0xdb9f('0x40')]({},_0x2b5ca,_0x2b5c31[_0xdb9f('0x41')]);return db[_0xdb9f('0x2d')][_0xdb9f('0x4a')](_0x2b5ca)[_0xdb9f('0x27')](handleEntityNotFound(_0x551c8a,null))['then'](respondWithResult(_0x551c8a,null))[_0xdb9f('0x45')](handleError(_0x551c8a,null));};exports[_0xdb9f('0x4b')]=function(_0x2f6b0b,_0x22b61d){return db[_0xdb9f('0x2d')][_0xdb9f('0x4b')](_0x2f6b0b[_0xdb9f('0x4c')],{})[_0xdb9f('0x27')](respondWithResult(_0x22b61d,0xc9))[_0xdb9f('0x45')](handleError(_0x22b61d,null));};exports[_0xdb9f('0x25')]=function(_0x18cb1b,_0x1d1bc0){if(_0x18cb1b[_0xdb9f('0x4c')]['id']){delete _0x18cb1b[_0xdb9f('0x4c')]['id'];}return db[_0xdb9f('0x2d')][_0xdb9f('0x4a')]({'where':{'id':_0x18cb1b[_0xdb9f('0x47')]['id']}})[_0xdb9f('0x27')](handleEntityNotFound(_0x1d1bc0,null))['then'](saveUpdates(_0x18cb1b[_0xdb9f('0x4c')],null))[_0xdb9f('0x27')](respondWithResult(_0x1d1bc0,null))[_0xdb9f('0x45')](handleError(_0x1d1bc0,null));};exports[_0xdb9f('0x26')]=function(_0x5dcd54,_0x5dace9){return db[_0xdb9f('0x2d')]['find']({'where':{'id':_0x5dcd54['params']['id']}})[_0xdb9f('0x27')](handleEntityNotFound(_0x5dace9,null))[_0xdb9f('0x27')](removeEntity(_0x5dace9,null))[_0xdb9f('0x45')](handleError(_0x5dace9,null));};exports[_0xdb9f('0x4d')]=function(_0x60d2a3,_0x2b6a0d,_0x614a9){var _0x1fc3b3={};var _0xe807f2={};var _0x3394c1;var _0x214bb5;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x60d2a3['params']['id']}})['then'](handleEntityNotFound(_0x2b6a0d,null))[_0xdb9f('0x27')](function(_0x1009b1){if(_0x1009b1){_0x3394c1=_0x1009b1;_0xe807f2[_0xdb9f('0x31')]=_[_0xdb9f('0x34')](db['VtigerField'][_0xdb9f('0x48')]);_0xe807f2[_0xdb9f('0x33')]=_[_0xdb9f('0x34')](_0x60d2a3[_0xdb9f('0x33')]);_0xe807f2['filters']=_['intersection'](_0xe807f2['model'],_0xe807f2[_0xdb9f('0x33')]);_0x1fc3b3[_0xdb9f('0x37')]=_[_0xdb9f('0x35')](_0xe807f2[_0xdb9f('0x31')],qs['fields'](_0x60d2a3[_0xdb9f('0x33')][_0xdb9f('0x36')]));_0x1fc3b3['attributes']=_0x1fc3b3[_0xdb9f('0x37')][_0xdb9f('0x38')]?_0x1fc3b3[_0xdb9f('0x37')]:_0xe807f2[_0xdb9f('0x31')];_0x1fc3b3[_0xdb9f('0x4e')]=qs[_0xdb9f('0x3b')](_0x60d2a3[_0xdb9f('0x33')][_0xdb9f('0x3b')]);_0x1fc3b3[_0xdb9f('0x3c')]=qs['filters'](_['pick'](_0x60d2a3[_0xdb9f('0x33')],_0xe807f2[_0xdb9f('0x3d')]));if(_0x60d2a3[_0xdb9f('0x33')][_0xdb9f('0x3f')]){_0x1fc3b3['where']=_[_0xdb9f('0x40')](_0x1fc3b3[_0xdb9f('0x3c')],{'$or':_[_0xdb9f('0x2c')](_0x1fc3b3['attributes'],function(_0x3446fb){var _0x463663={};_0x463663[_0x3446fb]={'$like':'%'+_0x60d2a3[_0xdb9f('0x33')]['filter']+'%'};return _0x463663;})});}_0x1fc3b3=_[_0xdb9f('0x40')]({},_0x1fc3b3,_0x60d2a3[_0xdb9f('0x41')]);return _0x3394c1[_0xdb9f('0x4d')](_0x1fc3b3);}})[_0xdb9f('0x27')](function(_0x3471d6){if(_0x3471d6){_0x214bb5=_0x3471d6[_0xdb9f('0x38')];if(!_0x60d2a3['query'][_0xdb9f('0x39')](_0xdb9f('0x3a'))){_0x1fc3b3['limit']=qs[_0xdb9f('0x1f')](_0x60d2a3[_0xdb9f('0x33')][_0xdb9f('0x1f')]);_0x1fc3b3['offset']=qs[_0xdb9f('0x1c')](_0x60d2a3[_0xdb9f('0x33')][_0xdb9f('0x1c')]);}return _0x3394c1[_0xdb9f('0x4d')](_0x1fc3b3);}})[_0xdb9f('0x27')](function(_0x5a25a3){if(_0x5a25a3){return _0x5a25a3?{'count':_0x214bb5,'rows':_0x5a25a3}:null;}})['then'](respondWithResult(_0x2b6a0d,null))[_0xdb9f('0x45')](handleError(_0x2b6a0d,null));};exports[_0xdb9f('0x4f')]=function(_0x410ae9,_0xc5cd46,_0x19e08c){var _0x1e7ef3={};var _0x59d603={};var _0x50351a;var _0x5ed15f;return db[_0xdb9f('0x2d')]['findOne']({'where':{'id':_0x410ae9['params']['id']}})[_0xdb9f('0x27')](handleEntityNotFound(_0xc5cd46,null))['then'](function(_0x3eac1b){if(_0x3eac1b){_0x50351a=_0x3eac1b;_0x59d603[_0xdb9f('0x31')]=_[_0xdb9f('0x34')](db[_0xdb9f('0x50')][_0xdb9f('0x48')]);_0x59d603['query']=_[_0xdb9f('0x34')](_0x410ae9['query']);_0x59d603[_0xdb9f('0x3d')]=_[_0xdb9f('0x35')](_0x59d603[_0xdb9f('0x31')],_0x59d603['query']);_0x1e7ef3[_0xdb9f('0x37')]=_['intersection'](_0x59d603['model'],qs[_0xdb9f('0x36')](_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x36')]));_0x1e7ef3[_0xdb9f('0x37')]=_0x1e7ef3[_0xdb9f('0x37')]['length']?_0x1e7ef3['attributes']:_0x59d603[_0xdb9f('0x31')];_0x1e7ef3['order']=qs[_0xdb9f('0x3b')](_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x3b')]);_0x1e7ef3[_0xdb9f('0x3c')]=qs[_0xdb9f('0x3d')](_[_0xdb9f('0x3e')](_0x410ae9['query'],_0x59d603[_0xdb9f('0x3d')]));if(_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x3f')]){_0x1e7ef3[_0xdb9f('0x3c')]=_[_0xdb9f('0x40')](_0x1e7ef3[_0xdb9f('0x3c')],{'$or':_['map'](_0x1e7ef3[_0xdb9f('0x37')],function(_0x44e694){var _0x17f19c={};_0x17f19c[_0x44e694]={'$like':'%'+_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x3f')]+'%'};return _0x17f19c;})});}_0x1e7ef3=_[_0xdb9f('0x40')]({},_0x1e7ef3,_0x410ae9[_0xdb9f('0x41')]);return _0x50351a[_0xdb9f('0x4f')](_0x1e7ef3);}})[_0xdb9f('0x27')](function(_0x4bf430){if(_0x4bf430){_0x5ed15f=_0x4bf430[_0xdb9f('0x38')];if(!_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x39')](_0xdb9f('0x3a'))){_0x1e7ef3[_0xdb9f('0x1f')]=qs[_0xdb9f('0x1f')](_0x410ae9[_0xdb9f('0x33')][_0xdb9f('0x1f')]);_0x1e7ef3['offset']=qs[_0xdb9f('0x1c')](_0x410ae9[_0xdb9f('0x33')]['offset']);}return _0x50351a[_0xdb9f('0x4f')](_0x1e7ef3);}})[_0xdb9f('0x27')](function(_0x4376cf){if(_0x4376cf){return _0x4376cf?{'count':_0x5ed15f,'rows':_0x4376cf}:null;}})[_0xdb9f('0x27')](respondWithResult(_0xc5cd46,null))[_0xdb9f('0x45')](handleError(_0xc5cd46,null));};exports['getDescriptions']=function(_0x52b42c,_0x5e6715,_0x427ed8){var _0x5153cf={};var _0xb3a355={};var _0x2dc58d;var _0x54942d;return db[_0xdb9f('0x2d')][_0xdb9f('0x51')]({'where':{'id':_0x52b42c['params']['id']}})[_0xdb9f('0x27')](handleEntityNotFound(_0x5e6715,null))[_0xdb9f('0x27')](function(_0x4413cf){if(_0x4413cf){_0x2dc58d=_0x4413cf;_0xb3a355[_0xdb9f('0x31')]=_[_0xdb9f('0x34')](db[_0xdb9f('0x50')][_0xdb9f('0x48')]);_0xb3a355['query']=_[_0xdb9f('0x34')](_0x52b42c[_0xdb9f('0x33')]);_0xb3a355['filters']=_[_0xdb9f('0x35')](_0xb3a355[_0xdb9f('0x31')],_0xb3a355['query']);_0x5153cf['attributes']=_['intersection'](_0xb3a355[_0xdb9f('0x31')],qs[_0xdb9f('0x36')](_0x52b42c['query'][_0xdb9f('0x36')]));_0x5153cf['attributes']=_0x5153cf[_0xdb9f('0x37')][_0xdb9f('0x38')]?_0x5153cf[_0xdb9f('0x37')]:_0xb3a355[_0xdb9f('0x31')];_0x5153cf[_0xdb9f('0x4e')]=qs['sort'](_0x52b42c[_0xdb9f('0x33')][_0xdb9f('0x3b')]);_0x5153cf['where']=qs[_0xdb9f('0x3d')](_[_0xdb9f('0x3e')](_0x52b42c[_0xdb9f('0x33')],_0xb3a355['filters']));if(_0x52b42c[_0xdb9f('0x33')][_0xdb9f('0x3f')]){_0x5153cf[_0xdb9f('0x3c')]=_[_0xdb9f('0x40')](_0x5153cf[_0xdb9f('0x3c')],{'$or':_[_0xdb9f('0x2c')](_0x5153cf['attributes'],function(_0x286971){var _0xbc6475={};_0xbc6475[_0x286971]={'$like':'%'+_0x52b42c['query'][_0xdb9f('0x3f')]+'%'};return _0xbc6475;})});}_0x5153cf=_[_0xdb9f('0x40')]({},_0x5153cf,_0x52b42c[_0xdb9f('0x41')]);return _0x2dc58d[_0xdb9f('0x52')](_0x5153cf);}})['then'](function(_0x28dfa4){if(_0x28dfa4){_0x54942d=_0x28dfa4[_0xdb9f('0x38')];if(!_0x52b42c[_0xdb9f('0x33')]['hasOwnProperty'](_0xdb9f('0x3a'))){_0x5153cf[_0xdb9f('0x1f')]=qs[_0xdb9f('0x1f')](_0x52b42c[_0xdb9f('0x33')][_0xdb9f('0x1f')]);_0x5153cf[_0xdb9f('0x1c')]=qs[_0xdb9f('0x1c')](_0x52b42c['query'][_0xdb9f('0x1c')]);}return _0x2dc58d[_0xdb9f('0x52')](_0x5153cf);}})[_0xdb9f('0x27')](function(_0x598a38){if(_0x598a38){return _0x598a38?{'count':_0x54942d,'rows':_0x598a38}:null;}})[_0xdb9f('0x27')](respondWithResult(_0x5e6715,null))[_0xdb9f('0x45')](handleError(_0x5e6715,null));}; \ No newline at end of file +var _0xde94=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','error','name','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0xde94,0x134));var _0x4de9=function(_0x2b21f8,_0x53bbc8){_0x2b21f8=_0x2b21f8-0x0;var _0x4657fd=_0xde94[_0x2b21f8];return _0x4657fd;};'use strict';var emlformat=require(_0x4de9('0x0'));var rimraf=require(_0x4de9('0x1'));var zipdir=require(_0x4de9('0x2'));var jsonpatch=require(_0x4de9('0x3'));var rp=require(_0x4de9('0x4'));var moment=require(_0x4de9('0x5'));var BPromise=require(_0x4de9('0x6'));var Mustache=require(_0x4de9('0x7'));var util=require(_0x4de9('0x8'));var path=require(_0x4de9('0x9'));var sox=require('sox');var csv=require(_0x4de9('0xa'));var ejs=require(_0x4de9('0xb'));var fs=require('fs');var fs_extra=require(_0x4de9('0xc'));var _=require('lodash');var squel=require(_0x4de9('0xd'));var crypto=require(_0x4de9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4de9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4de9('0x10'));var Papa=require(_0x4de9('0x11'));var Redis=require('ioredis');var authService=require(_0x4de9('0x12'));var qs=require(_0x4de9('0x13'));var as=require(_0x4de9('0x14'));var hardwareService=require(_0x4de9('0x15'));var logger=require(_0x4de9('0x16'))(_0x4de9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4de9('0x18'));var db=require(_0x4de9('0x19'))['db'];function respondWithStatusCode(_0x3206e8,_0x22dc2d){_0x22dc2d=_0x22dc2d||0xcc;return function(_0x47a35f){if(_0x47a35f){return _0x3206e8[_0x4de9('0x1a')](_0x22dc2d);}return _0x3206e8[_0x4de9('0x1b')](_0x22dc2d)[_0x4de9('0x1c')]();};}function respondWithResult(_0x39bf70,_0x1da092){_0x1da092=_0x1da092||0xc8;return function(_0xab9a4c){if(_0xab9a4c){return _0x39bf70['status'](_0x1da092)['json'](_0xab9a4c);}};}function respondWithFilteredResult(_0xa3dd05,_0x1e6bcc){return function(_0x281206){if(_0x281206){var _0x1ae2b5=typeof _0x1e6bcc[_0x4de9('0x1d')]===_0x4de9('0x1e')&&typeof _0x1e6bcc['limit']==='undefined';var _0x132adf=_0x281206[_0x4de9('0x1f')];var _0xe1484e=_0x1ae2b5?0x0:_0x1e6bcc[_0x4de9('0x1d')];var _0xf561d5=_0x1ae2b5?_0x281206['count']:_0x1e6bcc[_0x4de9('0x1d')]+_0x1e6bcc['limit'];var _0x136383;if(_0xf561d5>=_0x132adf){_0xf561d5=_0x132adf;_0x136383=0xc8;}else{_0x136383=0xce;}_0xa3dd05[_0x4de9('0x1b')](_0x136383);return _0xa3dd05[_0x4de9('0x20')](_0x4de9('0x21'),_0xe1484e+'-'+_0xf561d5+'/'+_0x132adf)[_0x4de9('0x22')](_0x281206);}return null;};}function patchUpdates(_0x44f99e){return function(_0x39c563){try{jsonpatch[_0x4de9('0x23')](_0x39c563,_0x44f99e,!![]);}catch(_0x47d9f3){return BPromise['reject'](_0x47d9f3);}return _0x39c563[_0x4de9('0x24')]();};}function saveUpdates(_0x4388eb,_0x5d9790){return function(_0x58cd3b){if(_0x58cd3b){return _0x58cd3b[_0x4de9('0x25')](_0x4388eb)[_0x4de9('0x26')](function(_0x46ef56){return _0x46ef56;});}return null;};}function removeEntity(_0x1165d7,_0x3ec178){return function(_0x2724a5){if(_0x2724a5){return _0x2724a5['destroy']()[_0x4de9('0x26')](function(){_0x1165d7[_0x4de9('0x1b')](0xcc)[_0x4de9('0x1c')]();});}};}function handleEntityNotFound(_0x4b7f55,_0x202cfb){return function(_0xc41c90){if(!_0xc41c90){_0x4b7f55[_0x4de9('0x1a')](0x194);}return _0xc41c90;};}function handleError(_0x4c3364,_0x49f728){_0x49f728=_0x49f728||0x1f4;return function(_0x1e4f93){logger[_0x4de9('0x27')](_0x1e4f93['stack']);if(_0x1e4f93[_0x4de9('0x28')]){delete _0x1e4f93[_0x4de9('0x28')];}_0x4c3364[_0x4de9('0x1b')](_0x49f728)['send'](_0x1e4f93);};}exports['index']=function(_0x443cf1,_0x45e262){var _0x5c4259={},_0x42f25a={},_0x222099={'count':0x0,'rows':[]};var _0x478d61=_['map'](db[_0x4de9('0x29')][_0x4de9('0x2a')],function(_0x514d03){return{'name':_0x514d03[_0x4de9('0x2b')],'type':_0x514d03[_0x4de9('0x2c')][_0x4de9('0x2d')]};});_0x42f25a[_0x4de9('0x2e')]=_[_0x4de9('0x2f')](_0x478d61,'name');_0x42f25a['query']=_['keys'](_0x443cf1[_0x4de9('0x30')]);_0x42f25a[_0x4de9('0x31')]=_['intersection'](_0x42f25a[_0x4de9('0x2e')],_0x42f25a[_0x4de9('0x30')]);_0x5c4259[_0x4de9('0x32')]=_[_0x4de9('0x33')](_0x42f25a[_0x4de9('0x2e')],qs['fields'](_0x443cf1[_0x4de9('0x30')][_0x4de9('0x34')]));_0x5c4259[_0x4de9('0x32')]=_0x5c4259['attributes'][_0x4de9('0x35')]?_0x5c4259[_0x4de9('0x32')]:_0x42f25a[_0x4de9('0x2e')];if(!_0x443cf1[_0x4de9('0x30')][_0x4de9('0x36')](_0x4de9('0x37'))){_0x5c4259[_0x4de9('0x38')]=qs['limit'](_0x443cf1[_0x4de9('0x30')]['limit']);_0x5c4259[_0x4de9('0x1d')]=qs[_0x4de9('0x1d')](_0x443cf1[_0x4de9('0x30')]['offset']);}_0x5c4259['order']=qs[_0x4de9('0x39')](_0x443cf1[_0x4de9('0x30')]['sort']);_0x5c4259[_0x4de9('0x3a')]=qs[_0x4de9('0x31')](_[_0x4de9('0x3b')](_0x443cf1[_0x4de9('0x30')],_0x42f25a[_0x4de9('0x31')]),_0x478d61);if(_0x443cf1[_0x4de9('0x30')][_0x4de9('0x3c')]){_0x5c4259['where']=_[_0x4de9('0x3d')](_0x5c4259[_0x4de9('0x3a')],{'$or':_[_0x4de9('0x2f')](_0x478d61,function(_0x1e3d07){if(_0x1e3d07[_0x4de9('0x2c')]!=='VIRTUAL'){var _0x158b26={};_0x158b26[_0x1e3d07[_0x4de9('0x28')]]={'$like':'%'+_0x443cf1[_0x4de9('0x30')]['filter']+'%'};return _0x158b26;}})});}_0x5c4259=_[_0x4de9('0x3d')]({},_0x5c4259,_0x443cf1['options']);var _0x5282e7={'where':_0x5c4259[_0x4de9('0x3a')]};return db[_0x4de9('0x29')][_0x4de9('0x1f')](_0x5282e7)[_0x4de9('0x26')](function(_0x8dfca0){_0x222099[_0x4de9('0x1f')]=_0x8dfca0;if(_0x443cf1[_0x4de9('0x30')][_0x4de9('0x3e')]){_0x5c4259[_0x4de9('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x4de9('0x40')](_0x5c4259);})[_0x4de9('0x26')](function(_0x493c5a){_0x222099[_0x4de9('0x41')]=_0x493c5a;return _0x222099;})[_0x4de9('0x26')](respondWithFilteredResult(_0x45e262,_0x5c4259))[_0x4de9('0x42')](handleError(_0x45e262,null));};exports[_0x4de9('0x43')]=function(_0x265b3d,_0x369cca){var _0xd1970c={'raw':![],'where':{'id':_0x265b3d[_0x4de9('0x44')]['id']}},_0x52c2eb={};_0x52c2eb['model']=_[_0x4de9('0x45')](db[_0x4de9('0x29')][_0x4de9('0x2a')]);_0x52c2eb[_0x4de9('0x30')]=_[_0x4de9('0x45')](_0x265b3d[_0x4de9('0x30')]);_0x52c2eb[_0x4de9('0x31')]=_['intersection'](_0x52c2eb[_0x4de9('0x2e')],_0x52c2eb[_0x4de9('0x30')]);_0xd1970c[_0x4de9('0x32')]=_[_0x4de9('0x33')](_0x52c2eb[_0x4de9('0x2e')],qs[_0x4de9('0x34')](_0x265b3d[_0x4de9('0x30')]['fields']));_0xd1970c[_0x4de9('0x32')]=_0xd1970c[_0x4de9('0x32')][_0x4de9('0x35')]?_0xd1970c['attributes']:_0x52c2eb[_0x4de9('0x2e')];if(_0x265b3d[_0x4de9('0x30')]['includeAll']){_0xd1970c[_0x4de9('0x3f')]=[{'all':!![]}];}_0xd1970c=_['merge']({},_0xd1970c,_0x265b3d[_0x4de9('0x46')]);return db[_0x4de9('0x29')][_0x4de9('0x47')](_0xd1970c)[_0x4de9('0x26')](handleEntityNotFound(_0x369cca,null))[_0x4de9('0x26')](respondWithResult(_0x369cca,null))[_0x4de9('0x42')](handleError(_0x369cca,null));};exports[_0x4de9('0x48')]=function(_0x698f99,_0x3829ec){return db[_0x4de9('0x29')][_0x4de9('0x48')](_0x698f99['body'],{})[_0x4de9('0x26')](respondWithResult(_0x3829ec,0xc9))[_0x4de9('0x42')](handleError(_0x3829ec,null));};exports[_0x4de9('0x25')]=function(_0x410e45,_0x446466){if(_0x410e45['body']['id']){delete _0x410e45[_0x4de9('0x49')]['id'];}return db['VtigerConfiguration'][_0x4de9('0x47')]({'where':{'id':_0x410e45[_0x4de9('0x44')]['id']}})[_0x4de9('0x26')](handleEntityNotFound(_0x446466,null))[_0x4de9('0x26')](saveUpdates(_0x410e45[_0x4de9('0x49')],null))[_0x4de9('0x26')](respondWithResult(_0x446466,null))[_0x4de9('0x42')](handleError(_0x446466,null));};exports[_0x4de9('0x4a')]=function(_0x4edfb2,_0x4cb1af){return db[_0x4de9('0x29')]['find']({'where':{'id':_0x4edfb2[_0x4de9('0x44')]['id']}})[_0x4de9('0x26')](handleEntityNotFound(_0x4cb1af,null))[_0x4de9('0x26')](removeEntity(_0x4cb1af,null))[_0x4de9('0x42')](handleError(_0x4cb1af,null));};exports[_0x4de9('0x4b')]=function(_0x5685d7,_0x1efbdd,_0x6bfcdb){var _0x16f227={};var _0x1f33c6={};var _0xfd7719;var _0x56c4f7;return db[_0x4de9('0x29')][_0x4de9('0x4c')]({'where':{'id':_0x5685d7[_0x4de9('0x44')]['id']}})['then'](handleEntityNotFound(_0x1efbdd,null))['then'](function(_0x16c1f6){if(_0x16c1f6){_0xfd7719=_0x16c1f6;_0x1f33c6[_0x4de9('0x2e')]=_[_0x4de9('0x45')](db[_0x4de9('0x4d')]['rawAttributes']);_0x1f33c6[_0x4de9('0x30')]=_[_0x4de9('0x45')](_0x5685d7[_0x4de9('0x30')]);_0x1f33c6['filters']=_[_0x4de9('0x33')](_0x1f33c6[_0x4de9('0x2e')],_0x1f33c6[_0x4de9('0x30')]);_0x16f227[_0x4de9('0x32')]=_[_0x4de9('0x33')](_0x1f33c6[_0x4de9('0x2e')],qs[_0x4de9('0x34')](_0x5685d7[_0x4de9('0x30')][_0x4de9('0x34')]));_0x16f227['attributes']=_0x16f227[_0x4de9('0x32')][_0x4de9('0x35')]?_0x16f227[_0x4de9('0x32')]:_0x1f33c6[_0x4de9('0x2e')];_0x16f227[_0x4de9('0x4e')]=qs['sort'](_0x5685d7[_0x4de9('0x30')]['sort']);_0x16f227['where']=qs[_0x4de9('0x31')](_[_0x4de9('0x3b')](_0x5685d7['query'],_0x1f33c6[_0x4de9('0x31')]));if(_0x5685d7[_0x4de9('0x30')][_0x4de9('0x3c')]){_0x16f227['where']=_[_0x4de9('0x3d')](_0x16f227[_0x4de9('0x3a')],{'$or':_[_0x4de9('0x2f')](_0x16f227[_0x4de9('0x32')],function(_0x375a57){var _0x1bffef={};_0x1bffef[_0x375a57]={'$like':'%'+_0x5685d7[_0x4de9('0x30')]['filter']+'%'};return _0x1bffef;})});}_0x16f227=_[_0x4de9('0x3d')]({},_0x16f227,_0x5685d7['options']);return _0xfd7719['getFields'](_0x16f227);}})[_0x4de9('0x26')](function(_0x5d271f){if(_0x5d271f){_0x56c4f7=_0x5d271f[_0x4de9('0x35')];if(!_0x5685d7[_0x4de9('0x30')][_0x4de9('0x36')](_0x4de9('0x37'))){_0x16f227[_0x4de9('0x38')]=qs[_0x4de9('0x38')](_0x5685d7['query'][_0x4de9('0x38')]);_0x16f227['offset']=qs[_0x4de9('0x1d')](_0x5685d7[_0x4de9('0x30')][_0x4de9('0x1d')]);}return _0xfd7719[_0x4de9('0x4b')](_0x16f227);}})['then'](function(_0x596954){if(_0x596954){return _0x596954?{'count':_0x56c4f7,'rows':_0x596954}:null;}})['then'](respondWithResult(_0x1efbdd,null))[_0x4de9('0x42')](handleError(_0x1efbdd,null));};exports[_0x4de9('0x4f')]=function(_0x27f617,_0x18d775,_0x249fdb){var _0x162def={};var _0x1f4971={};var _0x298680;var _0x4e8cae;return db['VtigerConfiguration'][_0x4de9('0x4c')]({'where':{'id':_0x27f617['params']['id']}})[_0x4de9('0x26')](handleEntityNotFound(_0x18d775,null))['then'](function(_0x3d5f92){if(_0x3d5f92){_0x298680=_0x3d5f92;_0x1f4971['model']=_[_0x4de9('0x45')](db[_0x4de9('0x4d')]['rawAttributes']);_0x1f4971[_0x4de9('0x30')]=_['keys'](_0x27f617[_0x4de9('0x30')]);_0x1f4971[_0x4de9('0x31')]=_[_0x4de9('0x33')](_0x1f4971[_0x4de9('0x2e')],_0x1f4971[_0x4de9('0x30')]);_0x162def['attributes']=_['intersection'](_0x1f4971['model'],qs[_0x4de9('0x34')](_0x27f617['query']['fields']));_0x162def[_0x4de9('0x32')]=_0x162def[_0x4de9('0x32')][_0x4de9('0x35')]?_0x162def['attributes']:_0x1f4971['model'];_0x162def[_0x4de9('0x4e')]=qs[_0x4de9('0x39')](_0x27f617[_0x4de9('0x30')]['sort']);_0x162def['where']=qs['filters'](_['pick'](_0x27f617[_0x4de9('0x30')],_0x1f4971[_0x4de9('0x31')]));if(_0x27f617['query']['filter']){_0x162def['where']=_[_0x4de9('0x3d')](_0x162def[_0x4de9('0x3a')],{'$or':_[_0x4de9('0x2f')](_0x162def[_0x4de9('0x32')],function(_0x4c1fac){var _0x7128d8={};_0x7128d8[_0x4c1fac]={'$like':'%'+_0x27f617[_0x4de9('0x30')][_0x4de9('0x3c')]+'%'};return _0x7128d8;})});}_0x162def=_[_0x4de9('0x3d')]({},_0x162def,_0x27f617[_0x4de9('0x46')]);return _0x298680[_0x4de9('0x4f')](_0x162def);}})[_0x4de9('0x26')](function(_0x420a5c){if(_0x420a5c){_0x4e8cae=_0x420a5c['length'];if(!_0x27f617[_0x4de9('0x30')]['hasOwnProperty'](_0x4de9('0x37'))){_0x162def[_0x4de9('0x38')]=qs['limit'](_0x27f617[_0x4de9('0x30')][_0x4de9('0x38')]);_0x162def['offset']=qs[_0x4de9('0x1d')](_0x27f617['query']['offset']);}return _0x298680[_0x4de9('0x4f')](_0x162def);}})[_0x4de9('0x26')](function(_0x52868e){if(_0x52868e){return _0x52868e?{'count':_0x4e8cae,'rows':_0x52868e}:null;}})[_0x4de9('0x26')](respondWithResult(_0x18d775,null))['catch'](handleError(_0x18d775,null));};exports[_0x4de9('0x50')]=function(_0xf10bff,_0x2ee51b,_0x3893ea){var _0x325890={};var _0x39305b={};var _0x45d0f8;var _0x6027bf;return db[_0x4de9('0x29')][_0x4de9('0x4c')]({'where':{'id':_0xf10bff[_0x4de9('0x44')]['id']}})[_0x4de9('0x26')](handleEntityNotFound(_0x2ee51b,null))[_0x4de9('0x26')](function(_0x55cf23){if(_0x55cf23){_0x45d0f8=_0x55cf23;_0x39305b[_0x4de9('0x2e')]=_[_0x4de9('0x45')](db[_0x4de9('0x4d')][_0x4de9('0x2a')]);_0x39305b[_0x4de9('0x30')]=_[_0x4de9('0x45')](_0xf10bff['query']);_0x39305b[_0x4de9('0x31')]=_['intersection'](_0x39305b[_0x4de9('0x2e')],_0x39305b[_0x4de9('0x30')]);_0x325890[_0x4de9('0x32')]=_[_0x4de9('0x33')](_0x39305b['model'],qs[_0x4de9('0x34')](_0xf10bff[_0x4de9('0x30')][_0x4de9('0x34')]));_0x325890[_0x4de9('0x32')]=_0x325890[_0x4de9('0x32')]['length']?_0x325890[_0x4de9('0x32')]:_0x39305b[_0x4de9('0x2e')];_0x325890[_0x4de9('0x4e')]=qs[_0x4de9('0x39')](_0xf10bff['query'][_0x4de9('0x39')]);_0x325890[_0x4de9('0x3a')]=qs[_0x4de9('0x31')](_['pick'](_0xf10bff[_0x4de9('0x30')],_0x39305b[_0x4de9('0x31')]));if(_0xf10bff['query'][_0x4de9('0x3c')]){_0x325890[_0x4de9('0x3a')]=_[_0x4de9('0x3d')](_0x325890[_0x4de9('0x3a')],{'$or':_['map'](_0x325890[_0x4de9('0x32')],function(_0x431fa1){var _0x2ec086={};_0x2ec086[_0x431fa1]={'$like':'%'+_0xf10bff[_0x4de9('0x30')][_0x4de9('0x3c')]+'%'};return _0x2ec086;})});}_0x325890=_[_0x4de9('0x3d')]({},_0x325890,_0xf10bff['options']);return _0x45d0f8[_0x4de9('0x50')](_0x325890);}})[_0x4de9('0x26')](function(_0x594115){if(_0x594115){_0x6027bf=_0x594115[_0x4de9('0x35')];if(!_0xf10bff[_0x4de9('0x30')][_0x4de9('0x36')](_0x4de9('0x37'))){_0x325890[_0x4de9('0x38')]=qs['limit'](_0xf10bff[_0x4de9('0x30')][_0x4de9('0x38')]);_0x325890[_0x4de9('0x1d')]=qs[_0x4de9('0x1d')](_0xf10bff[_0x4de9('0x30')]['offset']);}return _0x45d0f8[_0x4de9('0x50')](_0x325890);}})[_0x4de9('0x26')](function(_0x4b7a0a){if(_0x4b7a0a){return _0x4b7a0a?{'count':_0x6027bf,'rows':_0x4b7a0a}:null;}})['then'](respondWithResult(_0x2ee51b,null))['catch'](handleError(_0x2ee51b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 8666f1b..c301f06 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 _0xb4e7=['request-promise','path','rimraf','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14afa4,_0x182cd2){var _0x12fbaf=function(_0x1c3f84){while(--_0x1c3f84){_0x14afa4['push'](_0x14afa4['shift']());}};_0x12fbaf(++_0x182cd2);}(_0xb4e7,0x1e6));var _0x7b4e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb4e7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7b4e('0x0'));var util=require(_0x7b4e('0x1'));var logger=require(_0x7b4e('0x2'))(_0x7b4e('0x3'));var moment=require(_0x7b4e('0x4'));var BPromise=require(_0x7b4e('0x5'));var rp=require(_0x7b4e('0x6'));var fs=require('fs');var path=require(_0x7b4e('0x7'));var rimraf=require(_0x7b4e('0x8'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x7b4e('0x9')]=function(_0x2136de,_0x23bae9){return _0x2136de[_0x7b4e('0xa')](_0x7b4e('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x607e=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0xd0e7e2,_0x471c53){var _0x5b1e08=function(_0x190c0e){while(--_0x190c0e){_0xd0e7e2['push'](_0xd0e7e2['shift']());}};_0x5b1e08(++_0x471c53);}(_0x607e,0x84));var _0xe607=function(_0x346f5a,_0x33de62){_0x346f5a=_0x346f5a-0x0;var _0x2c1254=_0x607e[_0x346f5a];return _0x2c1254;};'use strict';var _=require(_0xe607('0x0'));var util=require('util');var logger=require(_0xe607('0x1'))('api');var moment=require(_0xe607('0x2'));var BPromise=require(_0xe607('0x3'));var rp=require(_0xe607('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe607('0x5'));var config=require(_0xe607('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xe607('0x7')]=function(_0x506b65,_0x41457){return _0x506b65[_0xe607('0x8')](_0xe607('0x9'),attributes,{'tableName':_0xe607('0xa'),'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 0cecc03..956cd2d 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 _0x3fdd=['jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x23009e,_0x16da62){var _0x5eba57=function(_0x230bae){while(--_0x230bae){_0x23009e['push'](_0x23009e['shift']());}};_0x5eba57(++_0x16da62);}(_0x3fdd,0x18f));var _0xd3fd=function(_0x259b25,_0x37fe57){_0x259b25=_0x259b25-0x0;var _0x531cad=_0x3fdd[_0x259b25];return _0x531cad;};'use strict';var _=require(_0xd3fd('0x0'));var util=require(_0xd3fd('0x1'));var moment=require('moment');var BPromise=require(_0xd3fd('0x2'));var rs=require(_0xd3fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3fd('0x4'))['db'];var utils=require(_0xd3fd('0x5'));var logger=require(_0xd3fd('0x6'))(_0xd3fd('0x7'));var config=require(_0xd3fd('0x8'));var jayson=require(_0xd3fd('0x9'));var client=jayson[_0xd3fd('0xa')][_0xd3fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24bd94,_0x393752,_0x4246d9){return new BPromise(function(_0x831b68,_0x554092){return client[_0xd3fd('0xc')](_0x24bd94,_0x4246d9)['then'](function(_0x24206d){logger[_0xd3fd('0xd')](_0xd3fd('0xe'),_0x393752,_0xd3fd('0xf'));logger[_0xd3fd('0x10')](_0xd3fd('0x11'),_0x393752,'request\x20sent',JSON[_0xd3fd('0x12')](_0x24206d));if(_0x24206d[_0xd3fd('0x13')]){if(_0x24206d[_0xd3fd('0x13')][_0xd3fd('0x14')]===0x1f4){logger[_0xd3fd('0x13')](_0xd3fd('0xe'),_0x393752,_0x24206d[_0xd3fd('0x13')][_0xd3fd('0x15')]);return _0x554092(_0x24206d[_0xd3fd('0x13')][_0xd3fd('0x15')]);}logger[_0xd3fd('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x393752,_0x24206d['error'][_0xd3fd('0x15')]);return _0x831b68(_0x24206d[_0xd3fd('0x13')][_0xd3fd('0x15')]);}else{logger[_0xd3fd('0xd')](_0xd3fd('0xe'),_0x393752,_0xd3fd('0xf'));_0x831b68(_0x24206d[_0xd3fd('0x16')]['message']);}})[_0xd3fd('0x17')](function(_0x375732){logger[_0xd3fd('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x393752,_0x375732);_0x554092(_0x375732);});});} \ No newline at end of file +var _0x99cd=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x99cd,0x1e1));var _0xd99c=function(_0x55490d,_0x7b7bdb){_0x55490d=_0x55490d-0x0;var _0x2fb353=_0x99cd[_0x55490d];return _0x2fb353;};'use strict';var _=require('lodash');var util=require(_0xd99c('0x0'));var moment=require('moment');var BPromise=require(_0xd99c('0x1'));var rs=require(_0xd99c('0x2'));var fs=require('fs');var Redis=require(_0xd99c('0x3'));var db=require(_0xd99c('0x4'))['db'];var utils=require(_0xd99c('0x5'));var logger=require('../../config/logger')(_0xd99c('0x6'));var config=require(_0xd99c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd99c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x203c10,_0x4904fd,_0x3198da){return new BPromise(function(_0x55fbda,_0x39bc46){return client[_0xd99c('0x9')](_0x203c10,_0x3198da)[_0xd99c('0xa')](function(_0x53ffe8){logger[_0xd99c('0xb')](_0xd99c('0xc'),_0x4904fd,'request\x20sent');logger[_0xd99c('0xd')](_0xd99c('0xe'),_0x4904fd,_0xd99c('0xf'),JSON[_0xd99c('0x10')](_0x53ffe8));if(_0x53ffe8[_0xd99c('0x11')]){if(_0x53ffe8[_0xd99c('0x11')][_0xd99c('0x12')]===0x1f4){logger[_0xd99c('0x11')](_0xd99c('0xc'),_0x4904fd,_0x53ffe8[_0xd99c('0x11')]['message']);return _0x39bc46(_0x53ffe8['error'][_0xd99c('0x13')]);}logger[_0xd99c('0x11')](_0xd99c('0xc'),_0x4904fd,_0x53ffe8[_0xd99c('0x11')][_0xd99c('0x13')]);return _0x55fbda(_0x53ffe8[_0xd99c('0x11')][_0xd99c('0x13')]);}else{logger['info'](_0xd99c('0xc'),_0x4904fd,_0xd99c('0xf'));_0x55fbda(_0x53ffe8[_0xd99c('0x14')][_0xd99c('0x13')]);}})[_0xd99c('0x15')](function(_0x1070fb){logger[_0xd99c('0x11')](_0xd99c('0xc'),_0x4904fd,_0x1070fb);_0x39bc46(_0x1070fb);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b710099..a23f065 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 _0x6784=['/:id','post','create','put','update','delete','destroy','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x2d7fd3,_0x131621){var _0xc81451=function(_0x1cd824){while(--_0x1cd824){_0x2d7fd3['push'](_0x2d7fd3['shift']());}};_0xc81451(++_0x131621);}(_0x6784,0x7e));var _0x4678=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x6784[_0x1eda20];return _0x31b953;};'use strict';var multer=require(_0x4678('0x0'));var util=require(_0x4678('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4678('0x2'));var router=express['Router']();var fs_extra=require(_0x4678('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4678('0x4'));var config=require(_0x4678('0x5'));var controller=require(_0x4678('0x6'));router[_0x4678('0x7')]('/',auth[_0x4678('0x8')](),controller[_0x4678('0x9')]);router[_0x4678('0x7')](_0x4678('0xa'),auth[_0x4678('0x8')](),controller['show']);router[_0x4678('0xb')]('/',auth[_0x4678('0x8')](),controller[_0x4678('0xc')]);router[_0x4678('0xd')]('/:id',auth[_0x4678('0x8')](),controller[_0x4678('0xe')]);router[_0x4678('0xf')](_0x4678('0xa'),auth[_0x4678('0x8')](),controller[_0x4678('0x10')]);module['exports']=router; \ No newline at end of file +var _0x45aa=['/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x3a25ab,_0x32c7fe){var _0x512888=function(_0x12da3a){while(--_0x12da3a){_0x3a25ab['push'](_0x3a25ab['shift']());}};_0x512888(++_0x32c7fe);}(_0x45aa,0x196));var _0xa45a=function(_0x50c727,_0x367f1c){_0x50c727=_0x50c727-0x0;var _0x54e240=_0x45aa[_0x50c727];return _0x54e240;};'use strict';var multer=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var path=require('path');var timeout=require(_0xa45a('0x2'));var express=require(_0xa45a('0x3'));var router=express[_0xa45a('0x4')]();var fs_extra=require(_0xa45a('0x5'));var auth=require(_0xa45a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa45a('0x7'));var controller=require(_0xa45a('0x8'));router[_0xa45a('0x9')]('/',auth[_0xa45a('0xa')](),controller[_0xa45a('0xb')]);router['get'](_0xa45a('0xc'),auth[_0xa45a('0xa')](),controller['show']);router[_0xa45a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa45a('0xe')](_0xa45a('0xc'),auth[_0xa45a('0xa')](),controller[_0xa45a('0xf')]);router[_0xa45a('0x10')]('/:id',auth[_0xa45a('0xa')](),controller[_0xa45a('0x11')]);module[_0xa45a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index faefc95..c7dd88d 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 _0x453a=['exports','ENUM','variable','customVariable','keyValue','string','STRING','sequelize'];(function(_0x5450fd,_0x2f2ddd){var _0x37e7a4=function(_0xa1cba3){while(--_0xa1cba3){_0x5450fd['push'](_0x5450fd['shift']());}};_0x37e7a4(++_0x2f2ddd);}(_0x453a,0x167));var _0xa453=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x453a[_0x4310e8];return _0x301445;};'use strict';var Sequelize=require(_0xa453('0x0'));module[_0xa453('0x1')]={'type':{'type':Sequelize[_0xa453('0x2')]('string',_0xa453('0x3'),_0xa453('0x4'),_0xa453('0x5'),'picklist'),'defaultValue':_0xa453('0x6')},'content':{'type':Sequelize[_0xa453('0x7')]},'key':{'type':Sequelize[_0xa453('0x7')]},'keyType':{'type':Sequelize[_0xa453('0x2')](_0xa453('0x6'),_0xa453('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa453('0x7')]},'idField':{'type':Sequelize[_0xa453('0x7')]},'nameField':{'type':Sequelize[_0xa453('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa453('0x7')]}}; \ No newline at end of file +var _0xa1bf=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x502eb0,_0x6d0814){var _0x4f78e4=function(_0x237787){while(--_0x237787){_0x502eb0['push'](_0x502eb0['shift']());}};_0x4f78e4(++_0x6d0814);}(_0xa1bf,0x9b));var _0xfa1b=function(_0x5f10d9,_0x16a7d5){_0x5f10d9=_0x5f10d9-0x0;var _0x1c7ec4=_0xa1bf[_0x5f10d9];return _0x1c7ec4;};'use strict';var Sequelize=require(_0xfa1b('0x0'));module[_0xfa1b('0x1')]={'type':{'type':Sequelize[_0xfa1b('0x2')](_0xfa1b('0x3'),_0xfa1b('0x4'),'customVariable',_0xfa1b('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfa1b('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xfa1b('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfa1b('0x6')]},'nameField':{'type':Sequelize[_0xfa1b('0x6')]},'customField':{'type':Sequelize[_0xfa1b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa1b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 5ba01b9..266f679 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 _0x2ab0=['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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','send','map','VtigerField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x2ab0,0x138));var _0x02ab=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x2ab0[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require(_0x02ab('0x0'));var rimraf=require(_0x02ab('0x1'));var zipdir=require(_0x02ab('0x2'));var jsonpatch=require(_0x02ab('0x3'));var rp=require('request-promise');var moment=require(_0x02ab('0x4'));var BPromise=require(_0x02ab('0x5'));var Mustache=require(_0x02ab('0x6'));var util=require(_0x02ab('0x7'));var path=require(_0x02ab('0x8'));var sox=require(_0x02ab('0x9'));var csv=require(_0x02ab('0xa'));var ejs=require(_0x02ab('0xb'));var fs=require('fs');var fs_extra=require(_0x02ab('0xc'));var _=require(_0x02ab('0xd'));var squel=require(_0x02ab('0xe'));var crypto=require(_0x02ab('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x02ab('0x10'));var toCsv=require(_0x02ab('0xa'));var querystring=require(_0x02ab('0x11'));var Papa=require(_0x02ab('0x12'));var Redis=require('ioredis');var authService=require(_0x02ab('0x13'));var qs=require(_0x02ab('0x14'));var as=require(_0x02ab('0x15'));var hardwareService=require(_0x02ab('0x16'));var logger=require(_0x02ab('0x17'))(_0x02ab('0x18'));var utils=require(_0x02ab('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x02ab('0x1a'))['db'];function respondWithStatusCode(_0x4106b4,_0x5b14fe){_0x5b14fe=_0x5b14fe||0xcc;return function(_0x5660bb){if(_0x5660bb){return _0x4106b4['sendStatus'](_0x5b14fe);}return _0x4106b4[_0x02ab('0x1b')](_0x5b14fe)[_0x02ab('0x1c')]();};}function respondWithResult(_0x7b1960,_0x1b82fd){_0x1b82fd=_0x1b82fd||0xc8;return function(_0x48f8a7){if(_0x48f8a7){return _0x7b1960[_0x02ab('0x1b')](_0x1b82fd)[_0x02ab('0x1d')](_0x48f8a7);}};}function respondWithFilteredResult(_0x393078,_0x146f07){return function(_0x46408c){if(_0x46408c){var _0x53813e=typeof _0x146f07[_0x02ab('0x1e')]===_0x02ab('0x1f')&&typeof _0x146f07[_0x02ab('0x20')]===_0x02ab('0x1f');var _0x58a035=_0x46408c[_0x02ab('0x21')];var _0x4ef6c9=_0x53813e?0x0:_0x146f07[_0x02ab('0x1e')];var _0xcd2a86=_0x53813e?_0x46408c[_0x02ab('0x21')]:_0x146f07[_0x02ab('0x1e')]+_0x146f07[_0x02ab('0x20')];var _0x5159a2;if(_0xcd2a86>=_0x58a035){_0xcd2a86=_0x58a035;_0x5159a2=0xc8;}else{_0x5159a2=0xce;}_0x393078[_0x02ab('0x1b')](_0x5159a2);return _0x393078[_0x02ab('0x22')](_0x02ab('0x23'),_0x4ef6c9+'-'+_0xcd2a86+'/'+_0x58a035)[_0x02ab('0x1d')](_0x46408c);}return null;};}function patchUpdates(_0x2f3d07){return function(_0x4fdfb4){try{jsonpatch[_0x02ab('0x24')](_0x4fdfb4,_0x2f3d07,!![]);}catch(_0xa1b74f){return BPromise[_0x02ab('0x25')](_0xa1b74f);}return _0x4fdfb4[_0x02ab('0x26')]();};}function saveUpdates(_0x4fc520,_0x449e25){return function(_0x1693d8){if(_0x1693d8){return _0x1693d8[_0x02ab('0x27')](_0x4fc520)[_0x02ab('0x28')](function(_0x477a57){return _0x477a57;});}return null;};}function removeEntity(_0x3463f5,_0x458430){return function(_0x1ed9d3){if(_0x1ed9d3){return _0x1ed9d3['destroy']()[_0x02ab('0x28')](function(){_0x3463f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f471c,_0x26405a){return function(_0x1f9fcd){if(!_0x1f9fcd){_0x2f471c['sendStatus'](0x194);}return _0x1f9fcd;};}function handleError(_0x2b1c5d,_0x4fd9f2){_0x4fd9f2=_0x4fd9f2||0x1f4;return function(_0xc55ff){logger[_0x02ab('0x29')](_0xc55ff[_0x02ab('0x2a')]);if(_0xc55ff['name']){delete _0xc55ff['name'];}_0x2b1c5d[_0x02ab('0x1b')](_0x4fd9f2)[_0x02ab('0x2b')](_0xc55ff);};}exports['index']=function(_0xb806fe,_0xc2ebe){var _0x9e2eff={},_0x4daf52={},_0x51816c={'count':0x0,'rows':[]};var _0x21c029=_[_0x02ab('0x2c')](db[_0x02ab('0x2d')][_0x02ab('0x2e')],function(_0x5d0d7d){return{'name':_0x5d0d7d[_0x02ab('0x2f')],'type':_0x5d0d7d[_0x02ab('0x30')][_0x02ab('0x31')]};});_0x4daf52[_0x02ab('0x32')]=_[_0x02ab('0x2c')](_0x21c029,_0x02ab('0x33'));_0x4daf52[_0x02ab('0x34')]=_[_0x02ab('0x35')](_0xb806fe[_0x02ab('0x34')]);_0x4daf52[_0x02ab('0x36')]=_[_0x02ab('0x37')](_0x4daf52['model'],_0x4daf52[_0x02ab('0x34')]);_0x9e2eff[_0x02ab('0x38')]=_[_0x02ab('0x37')](_0x4daf52[_0x02ab('0x32')],qs[_0x02ab('0x39')](_0xb806fe[_0x02ab('0x34')][_0x02ab('0x39')]));_0x9e2eff[_0x02ab('0x38')]=_0x9e2eff[_0x02ab('0x38')][_0x02ab('0x3a')]?_0x9e2eff['attributes']:_0x4daf52[_0x02ab('0x32')];if(!_0xb806fe[_0x02ab('0x34')]['hasOwnProperty'](_0x02ab('0x3b'))){_0x9e2eff[_0x02ab('0x20')]=qs['limit'](_0xb806fe[_0x02ab('0x34')][_0x02ab('0x20')]);_0x9e2eff[_0x02ab('0x1e')]=qs['offset'](_0xb806fe[_0x02ab('0x34')]['offset']);}_0x9e2eff['order']=qs[_0x02ab('0x3c')](_0xb806fe[_0x02ab('0x34')][_0x02ab('0x3c')]);_0x9e2eff[_0x02ab('0x3d')]=qs[_0x02ab('0x36')](_[_0x02ab('0x3e')](_0xb806fe['query'],_0x4daf52['filters']),_0x21c029);if(_0xb806fe[_0x02ab('0x34')][_0x02ab('0x3f')]){_0x9e2eff[_0x02ab('0x3d')]=_['merge'](_0x9e2eff[_0x02ab('0x3d')],{'$or':_['map'](_0x21c029,function(_0x4764b2){if(_0x4764b2['type']!==_0x02ab('0x40')){var _0x295ac2={};_0x295ac2[_0x4764b2[_0x02ab('0x33')]]={'$like':'%'+_0xb806fe[_0x02ab('0x34')][_0x02ab('0x3f')]+'%'};return _0x295ac2;}})});}_0x9e2eff=_[_0x02ab('0x41')]({},_0x9e2eff,_0xb806fe[_0x02ab('0x42')]);var _0x58c345={'where':_0x9e2eff[_0x02ab('0x3d')]};return db[_0x02ab('0x2d')][_0x02ab('0x21')](_0x58c345)[_0x02ab('0x28')](function(_0x217d26){_0x51816c['count']=_0x217d26;if(_0xb806fe[_0x02ab('0x34')]['includeAll']){_0x9e2eff[_0x02ab('0x43')]=[{'all':!![]}];}return db[_0x02ab('0x2d')][_0x02ab('0x44')](_0x9e2eff);})[_0x02ab('0x28')](function(_0x34fd3a){_0x51816c[_0x02ab('0x45')]=_0x34fd3a;return _0x51816c;})[_0x02ab('0x28')](respondWithFilteredResult(_0xc2ebe,_0x9e2eff))[_0x02ab('0x46')](handleError(_0xc2ebe,null));};exports[_0x02ab('0x47')]=function(_0x430c6b,_0xe37aaa){var _0x14dcd6={'raw':!![],'where':{'id':_0x430c6b['params']['id']}},_0x3cb61f={};_0x3cb61f[_0x02ab('0x32')]=_[_0x02ab('0x35')](db[_0x02ab('0x2d')][_0x02ab('0x2e')]);_0x3cb61f[_0x02ab('0x34')]=_[_0x02ab('0x35')](_0x430c6b[_0x02ab('0x34')]);_0x3cb61f['filters']=_[_0x02ab('0x37')](_0x3cb61f['model'],_0x3cb61f[_0x02ab('0x34')]);_0x14dcd6['attributes']=_[_0x02ab('0x37')](_0x3cb61f[_0x02ab('0x32')],qs[_0x02ab('0x39')](_0x430c6b['query'][_0x02ab('0x39')]));_0x14dcd6[_0x02ab('0x38')]=_0x14dcd6[_0x02ab('0x38')][_0x02ab('0x3a')]?_0x14dcd6[_0x02ab('0x38')]:_0x3cb61f[_0x02ab('0x32')];if(_0x430c6b[_0x02ab('0x34')][_0x02ab('0x48')]){_0x14dcd6[_0x02ab('0x43')]=[{'all':!![]}];}_0x14dcd6=_[_0x02ab('0x41')]({},_0x14dcd6,_0x430c6b[_0x02ab('0x42')]);return db['VtigerField'][_0x02ab('0x49')](_0x14dcd6)['then'](handleEntityNotFound(_0xe37aaa,null))['then'](respondWithResult(_0xe37aaa,null))['catch'](handleError(_0xe37aaa,null));};exports[_0x02ab('0x4a')]=function(_0x3f200b,_0x4b82b4){return db[_0x02ab('0x2d')]['create'](_0x3f200b[_0x02ab('0x4b')],{})[_0x02ab('0x28')](respondWithResult(_0x4b82b4,0xc9))[_0x02ab('0x46')](handleError(_0x4b82b4,null));};exports[_0x02ab('0x27')]=function(_0x50e443,_0x445cbc){if(_0x50e443[_0x02ab('0x4b')]['id']){delete _0x50e443['body']['id'];}return db[_0x02ab('0x2d')][_0x02ab('0x49')]({'where':{'id':_0x50e443[_0x02ab('0x4c')]['id']}})[_0x02ab('0x28')](handleEntityNotFound(_0x445cbc,null))[_0x02ab('0x28')](saveUpdates(_0x50e443['body'],null))[_0x02ab('0x28')](respondWithResult(_0x445cbc,null))[_0x02ab('0x46')](handleError(_0x445cbc,null));};exports[_0x02ab('0x4d')]=function(_0x4b1d77,_0x442996){return db[_0x02ab('0x2d')][_0x02ab('0x49')]({'where':{'id':_0x4b1d77[_0x02ab('0x4c')]['id']}})[_0x02ab('0x28')](handleEntityNotFound(_0x442996,null))['then'](removeEntity(_0x442996,null))[_0x02ab('0x46')](handleError(_0x442996,null));}; \ No newline at end of file +var _0x71b3=['find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','map','VtigerField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body'];(function(_0x276831,_0xc400ae){var _0x4fc83f=function(_0x4d9391){while(--_0x4d9391){_0x276831['push'](_0x276831['shift']());}};_0x4fc83f(++_0xc400ae);}(_0x71b3,0x165));var _0x371b=function(_0x4d5493,_0x4d4d61){_0x4d5493=_0x4d5493-0x0;var _0x3ef175=_0x71b3[_0x4d5493];return _0x3ef175;};'use strict';var emlformat=require(_0x371b('0x0'));var rimraf=require(_0x371b('0x1'));var zipdir=require(_0x371b('0x2'));var jsonpatch=require(_0x371b('0x3'));var rp=require(_0x371b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x371b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x371b('0x6'));var ejs=require(_0x371b('0x7'));var fs=require('fs');var fs_extra=require(_0x371b('0x8'));var _=require(_0x371b('0x9'));var squel=require('squel');var crypto=require(_0x371b('0xa'));var jsforce=require(_0x371b('0xb'));var deskjs=require(_0x371b('0xc'));var toCsv=require(_0x371b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x371b('0xd'));var authService=require(_0x371b('0xe'));var qs=require(_0x371b('0xf'));var as=require(_0x371b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x371b('0x11'));var utils=require(_0x371b('0x12'));var config=require(_0x371b('0x13'));var licenseUtil=require(_0x371b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f706,_0x4aa502){_0x4aa502=_0x4aa502||0xcc;return function(_0xc19626){if(_0xc19626){return _0x25f706['sendStatus'](_0x4aa502);}return _0x25f706['status'](_0x4aa502)['end']();};}function respondWithResult(_0x13834f,_0x28d55a){_0x28d55a=_0x28d55a||0xc8;return function(_0x48be7f){if(_0x48be7f){return _0x13834f['status'](_0x28d55a)['json'](_0x48be7f);}};}function respondWithFilteredResult(_0x4e0033,_0x184d13){return function(_0x409553){if(_0x409553){var _0x2eb018=typeof _0x184d13[_0x371b('0x15')]===_0x371b('0x16')&&typeof _0x184d13[_0x371b('0x17')]===_0x371b('0x16');var _0x4a3097=_0x409553[_0x371b('0x18')];var _0x58840c=_0x2eb018?0x0:_0x184d13['offset'];var _0xcd3187=_0x2eb018?_0x409553[_0x371b('0x18')]:_0x184d13['offset']+_0x184d13[_0x371b('0x17')];var _0x1a0867;if(_0xcd3187>=_0x4a3097){_0xcd3187=_0x4a3097;_0x1a0867=0xc8;}else{_0x1a0867=0xce;}_0x4e0033[_0x371b('0x19')](_0x1a0867);return _0x4e0033[_0x371b('0x1a')]('Content-Range',_0x58840c+'-'+_0xcd3187+'/'+_0x4a3097)[_0x371b('0x1b')](_0x409553);}return null;};}function patchUpdates(_0x47cdf0){return function(_0x506aa2){try{jsonpatch[_0x371b('0x1c')](_0x506aa2,_0x47cdf0,!![]);}catch(_0x49a697){return BPromise[_0x371b('0x1d')](_0x49a697);}return _0x506aa2[_0x371b('0x1e')]();};}function saveUpdates(_0x599c1a,_0x20b47d){return function(_0x40b58a){if(_0x40b58a){return _0x40b58a[_0x371b('0x1f')](_0x599c1a)[_0x371b('0x20')](function(_0x3ef709){return _0x3ef709;});}return null;};}function removeEntity(_0x6c92d0,_0x4a3dc4){return function(_0x29207a){if(_0x29207a){return _0x29207a[_0x371b('0x21')]()['then'](function(){_0x6c92d0[_0x371b('0x19')](0xcc)[_0x371b('0x22')]();});}};}function handleEntityNotFound(_0x1c503b,_0x4790b1){return function(_0x51ce52){if(!_0x51ce52){_0x1c503b[_0x371b('0x23')](0x194);}return _0x51ce52;};}function handleError(_0x5b9e2f,_0x2af061){_0x2af061=_0x2af061||0x1f4;return function(_0x5ca19b){logger[_0x371b('0x24')](_0x5ca19b['stack']);if(_0x5ca19b[_0x371b('0x25')]){delete _0x5ca19b[_0x371b('0x25')];}_0x5b9e2f['status'](_0x2af061)['send'](_0x5ca19b);};}exports['index']=function(_0x289957,_0x2b729c){var _0x1a2534={},_0x1f1318={},_0x5b50f3={'count':0x0,'rows':[]};var _0xb9adfa=_[_0x371b('0x26')](db[_0x371b('0x27')][_0x371b('0x28')],function(_0x45e5b2){return{'name':_0x45e5b2['fieldName'],'type':_0x45e5b2[_0x371b('0x29')][_0x371b('0x2a')]};});_0x1f1318[_0x371b('0x2b')]=_[_0x371b('0x26')](_0xb9adfa,'name');_0x1f1318[_0x371b('0x2c')]=_[_0x371b('0x2d')](_0x289957[_0x371b('0x2c')]);_0x1f1318[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],_0x1f1318[_0x371b('0x2c')]);_0x1a2534[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],qs['fields'](_0x289957[_0x371b('0x2c')][_0x371b('0x31')]));_0x1a2534[_0x371b('0x30')]=_0x1a2534[_0x371b('0x30')][_0x371b('0x32')]?_0x1a2534['attributes']:_0x1f1318[_0x371b('0x2b')];if(!_0x289957['query'][_0x371b('0x33')](_0x371b('0x34'))){_0x1a2534[_0x371b('0x17')]=qs[_0x371b('0x17')](_0x289957['query'][_0x371b('0x17')]);_0x1a2534[_0x371b('0x15')]=qs[_0x371b('0x15')](_0x289957[_0x371b('0x2c')][_0x371b('0x15')]);}_0x1a2534[_0x371b('0x35')]=qs[_0x371b('0x36')](_0x289957['query']['sort']);_0x1a2534[_0x371b('0x37')]=qs['filters'](_[_0x371b('0x38')](_0x289957['query'],_0x1f1318[_0x371b('0x2e')]),_0xb9adfa);if(_0x289957['query'][_0x371b('0x39')]){_0x1a2534['where']=_[_0x371b('0x3a')](_0x1a2534[_0x371b('0x37')],{'$or':_[_0x371b('0x26')](_0xb9adfa,function(_0x24e8ef){if(_0x24e8ef[_0x371b('0x29')]!==_0x371b('0x3b')){var _0x15c1c9={};_0x15c1c9[_0x24e8ef[_0x371b('0x25')]]={'$like':'%'+_0x289957[_0x371b('0x2c')][_0x371b('0x39')]+'%'};return _0x15c1c9;}})});}_0x1a2534=_[_0x371b('0x3a')]({},_0x1a2534,_0x289957[_0x371b('0x3c')]);var _0x5a16b2={'where':_0x1a2534[_0x371b('0x37')]};return db['VtigerField']['count'](_0x5a16b2)[_0x371b('0x20')](function(_0x1c91b4){_0x5b50f3[_0x371b('0x18')]=_0x1c91b4;if(_0x289957[_0x371b('0x2c')][_0x371b('0x3d')]){_0x1a2534[_0x371b('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x371b('0x3f')](_0x1a2534);})[_0x371b('0x20')](function(_0x47c972){_0x5b50f3[_0x371b('0x40')]=_0x47c972;return _0x5b50f3;})[_0x371b('0x20')](respondWithFilteredResult(_0x2b729c,_0x1a2534))[_0x371b('0x41')](handleError(_0x2b729c,null));};exports[_0x371b('0x42')]=function(_0x4fd1ef,_0x969e9c){var _0x3dbf72={'raw':!![],'where':{'id':_0x4fd1ef['params']['id']}},_0x4dd2e6={};_0x4dd2e6[_0x371b('0x2b')]=_[_0x371b('0x2d')](db[_0x371b('0x27')][_0x371b('0x28')]);_0x4dd2e6[_0x371b('0x2c')]=_['keys'](_0x4fd1ef[_0x371b('0x2c')]);_0x4dd2e6[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],_0x4dd2e6[_0x371b('0x2c')]);_0x3dbf72[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],qs[_0x371b('0x31')](_0x4fd1ef[_0x371b('0x2c')]['fields']));_0x3dbf72['attributes']=_0x3dbf72[_0x371b('0x30')][_0x371b('0x32')]?_0x3dbf72[_0x371b('0x30')]:_0x4dd2e6[_0x371b('0x2b')];if(_0x4fd1ef[_0x371b('0x2c')]['includeAll']){_0x3dbf72['include']=[{'all':!![]}];}_0x3dbf72=_[_0x371b('0x3a')]({},_0x3dbf72,_0x4fd1ef['options']);return db[_0x371b('0x27')]['find'](_0x3dbf72)[_0x371b('0x20')](handleEntityNotFound(_0x969e9c,null))[_0x371b('0x20')](respondWithResult(_0x969e9c,null))[_0x371b('0x41')](handleError(_0x969e9c,null));};exports[_0x371b('0x43')]=function(_0x43f550,_0x2fe50d){return db['VtigerField']['create'](_0x43f550['body'],{})[_0x371b('0x20')](respondWithResult(_0x2fe50d,0xc9))['catch'](handleError(_0x2fe50d,null));};exports[_0x371b('0x1f')]=function(_0x394ddb,_0x4dc257){if(_0x394ddb[_0x371b('0x44')]['id']){delete _0x394ddb[_0x371b('0x44')]['id'];}return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x394ddb[_0x371b('0x46')]['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4dc257,null))[_0x371b('0x20')](saveUpdates(_0x394ddb[_0x371b('0x44')],null))[_0x371b('0x20')](respondWithResult(_0x4dc257,null))['catch'](handleError(_0x4dc257,null));};exports[_0x371b('0x21')]=function(_0x55138b,_0x4b64dd){return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x55138b['params']['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4b64dd,null))['then'](removeEntity(_0x4b64dd,null))[_0x371b('0x41')](handleError(_0x4b64dd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 4d1dfc2..5af70a1 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 _0xc520=['moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','api'];(function(_0x23b36e,_0x5899e6){var _0xe8c2c5=function(_0x31260d){while(--_0x31260d){_0x23b36e['push'](_0x23b36e['shift']());}};_0xe8c2c5(++_0x5899e6);}(_0xc520,0xa2));var _0x0c52=function(_0x1577db,_0x3ba4c7){_0x1577db=_0x1577db-0x0;var _0x117aac=_0xc520[_0x1577db];return _0x117aac;};'use strict';var _=require(_0x0c52('0x0'));var util=require(_0x0c52('0x1'));var logger=require('../../config/logger')(_0x0c52('0x2'));var moment=require(_0x0c52('0x3'));var BPromise=require(_0x0c52('0x4'));var rp=require(_0x0c52('0x5'));var fs=require('fs');var path=require(_0x0c52('0x6'));var rimraf=require('rimraf');var config=require(_0x0c52('0x7'));var attributes=require(_0x0c52('0x8'));module['exports']=function(_0x1fa09a,_0x27d993){return _0x1fa09a[_0x0c52('0x9')](_0x0c52('0xa'),attributes,{'tableName':_0x0c52('0xb'),'paranoid':![],'indexes':[{'name':_0x0c52('0xc'),'fields':[_0x0c52('0xd'),_0x0c52('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb356=['api','request-promise','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger'];(function(_0x5d340b,_0xec22ef){var _0x512ffa=function(_0x1ab122){while(--_0x1ab122){_0x5d340b['push'](_0x5d340b['shift']());}};_0x512ffa(++_0xec22ef);}(_0xb356,0xe7));var _0x6b35=function(_0x432251,_0x33e7a8){_0x432251=_0x432251-0x0;var _0x13874c=_0xb356[_0x432251];return _0x13874c;};'use strict';var _=require(_0x6b35('0x0'));var util=require(_0x6b35('0x1'));var logger=require(_0x6b35('0x2'))(_0x6b35('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b35('0x5'));var config=require(_0x6b35('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x6b35('0x7')]=function(_0x1944cc,_0x356980){return _0x1944cc[_0x6b35('0x8')](_0x6b35('0x9'),attributes,{'tableName':_0x6b35('0xa'),'paranoid':![],'indexes':[{'name':_0x6b35('0xb'),'fields':[_0x6b35('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index d42797d..7afd19b 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 _0xfa25=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45c035,_0x2333f1){var _0x14e3af=function(_0x3ba2b4){while(--_0x3ba2b4){_0x45c035['push'](_0x45c035['shift']());}};_0x14e3af(++_0x2333f1);}(_0xfa25,0xb9));var _0x5fa2=function(_0x4c9e55,_0x4d31f1){_0x4c9e55=_0x4c9e55-0x0;var _0x435f65=_0xfa25[_0x4c9e55];return _0x435f65;};'use strict';var _=require(_0x5fa2('0x0'));var util=require(_0x5fa2('0x1'));var moment=require(_0x5fa2('0x2'));var BPromise=require(_0x5fa2('0x3'));var rs=require(_0x5fa2('0x4'));var fs=require('fs');var Redis=require(_0x5fa2('0x5'));var db=require(_0x5fa2('0x6'))['db'];var utils=require(_0x5fa2('0x7'));var logger=require(_0x5fa2('0x8'))(_0x5fa2('0x9'));var config=require('../../config/environment');var jayson=require(_0x5fa2('0xa'));var client=jayson['client'][_0x5fa2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x327bf7,_0x48ace8,_0x3ea713){return new BPromise(function(_0x48acad,_0x3512ba){return client[_0x5fa2('0xc')](_0x327bf7,_0x3ea713)[_0x5fa2('0xd')](function(_0x202eed){logger['info'](_0x5fa2('0xe'),_0x48ace8,'request\x20sent');logger[_0x5fa2('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x48ace8,_0x5fa2('0x10'),JSON[_0x5fa2('0x11')](_0x202eed));if(_0x202eed[_0x5fa2('0x12')]){if(_0x202eed[_0x5fa2('0x12')][_0x5fa2('0x13')]===0x1f4){logger[_0x5fa2('0x12')](_0x5fa2('0xe'),_0x48ace8,_0x202eed[_0x5fa2('0x12')]['message']);return _0x3512ba(_0x202eed[_0x5fa2('0x12')][_0x5fa2('0x14')]);}logger[_0x5fa2('0x12')](_0x5fa2('0xe'),_0x48ace8,_0x202eed['error'][_0x5fa2('0x14')]);return _0x48acad(_0x202eed['error'][_0x5fa2('0x14')]);}else{logger[_0x5fa2('0x15')]('VtigerField,\x20%s,\x20%s',_0x48ace8,_0x5fa2('0x10'));_0x48acad(_0x202eed[_0x5fa2('0x16')]['message']);}})[_0x5fa2('0x17')](function(_0x173179){logger[_0x5fa2('0x12')](_0x5fa2('0xe'),_0x48ace8,_0x173179);_0x3512ba(_0x173179);});});} \ No newline at end of file +var _0x39e6=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x39e6,0x173));var _0x639e=function(_0x2ebbb8,_0xb88e41){_0x2ebbb8=_0x2ebbb8-0x0;var _0xdbc667=_0x39e6[_0x2ebbb8];return _0xdbc667;};'use strict';var _=require(_0x639e('0x0'));var util=require(_0x639e('0x1'));var moment=require(_0x639e('0x2'));var BPromise=require(_0x639e('0x3'));var rs=require(_0x639e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x639e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x639e('0x6'))(_0x639e('0x7'));var config=require(_0x639e('0x8'));var jayson=require(_0x639e('0x9'));var client=jayson[_0x639e('0xa')][_0x639e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ca6bd,_0x5cb132,_0x3c2fa6){return new BPromise(function(_0x12c7be,_0x3889e6){return client[_0x639e('0xc')](_0x1ca6bd,_0x3c2fa6)['then'](function(_0x504b7c){logger[_0x639e('0xd')](_0x639e('0xe'),_0x5cb132,_0x639e('0xf'));logger[_0x639e('0x10')](_0x639e('0x11'),_0x5cb132,_0x639e('0xf'),JSON[_0x639e('0x12')](_0x504b7c));if(_0x504b7c['error']){if(_0x504b7c['error']['code']===0x1f4){logger[_0x639e('0x13')](_0x639e('0xe'),_0x5cb132,_0x504b7c['error']['message']);return _0x3889e6(_0x504b7c[_0x639e('0x13')][_0x639e('0x14')]);}logger[_0x639e('0x13')](_0x639e('0xe'),_0x5cb132,_0x504b7c[_0x639e('0x13')][_0x639e('0x14')]);return _0x12c7be(_0x504b7c[_0x639e('0x13')][_0x639e('0x14')]);}else{logger['info'](_0x639e('0xe'),_0x5cb132,_0x639e('0xf'));_0x12c7be(_0x504b7c['result'][_0x639e('0x14')]);}})[_0x639e('0x15')](function(_0x23b6f0){logger[_0x639e('0x13')](_0x639e('0xe'),_0x5cb132,_0x23b6f0);_0x3889e6(_0x23b6f0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 4c5d04a..2ae8e47 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 _0x4753=['Router','../../components/auth/service','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x4753,0x1f4));var _0x3475=function(_0xcea93f,_0x2df052){_0xcea93f=_0xcea93f-0x0;var _0xc7795c=_0x4753[_0xcea93f];return _0xc7795c;};'use strict';var multer=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var path=require(_0x3475('0x2'));var timeout=require('connect-timeout');var express=require(_0x3475('0x3'));var router=express[_0x3475('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3475('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x3475('0x6')](),controller[_0x3475('0x7')]);router['get'](_0x3475('0x8'),auth[_0x3475('0x6')](),controller[_0x3475('0x9')]);router[_0x3475('0xa')](_0x3475('0xb'),auth[_0x3475('0x6')](),controller[_0x3475('0xc')]);router[_0x3475('0xa')](_0x3475('0xd'),auth[_0x3475('0x6')](),controller['getFields']);router[_0x3475('0xe')]('/',auth[_0x3475('0x6')](),controller[_0x3475('0xf')]);router['post'](_0x3475('0xb'),auth[_0x3475('0x6')](),controller['addConfiguration']);router[_0x3475('0x10')]('/:id',auth[_0x3475('0x6')](),controller[_0x3475('0x11')]);router[_0x3475('0x12')]('/:id',auth[_0x3475('0x6')](),controller[_0x3475('0x13')]);module[_0x3475('0x14')]=router; \ No newline at end of file +var _0x7374=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x7374,0x1b9));var _0x4737=function(_0x1a2e1a,_0xafba7c){_0x1a2e1a=_0x1a2e1a-0x0;var _0x43f293=_0x7374[_0x1a2e1a];return _0x43f293;};'use strict';var multer=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var path=require(_0x4737('0x2'));var timeout=require(_0x4737('0x3'));var express=require(_0x4737('0x4'));var router=express['Router']();var fs_extra=require(_0x4737('0x5'));var auth=require(_0x4737('0x6'));var interaction=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x4737('0x9')](),controller[_0x4737('0xa')]);router[_0x4737('0xb')](_0x4737('0xc'),auth['isAuthenticated'](),controller[_0x4737('0xd')]);router[_0x4737('0xb')](_0x4737('0xe'),auth[_0x4737('0x9')](),controller[_0x4737('0xf')]);router['get'](_0x4737('0x10'),auth[_0x4737('0x9')](),controller[_0x4737('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4737('0x12')]);router[_0x4737('0x13')](_0x4737('0xe'),auth[_0x4737('0x9')](),controller[_0x4737('0x14')]);router[_0x4737('0x15')](_0x4737('0xc'),auth[_0x4737('0x9')](),controller[_0x4737('0x16')]);router['delete'](_0x4737('0xc'),auth[_0x4737('0x9')](),controller[_0x4737('0x17')]);module[_0x4737('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index f06e618..020d6cd 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 _0xee2c=['STRING','username','remoteUri','password','token','ENUM','integrationTab','sequelize'];(function(_0x4c62ce,_0x18e255){var _0x388297=function(_0x4aadfc){while(--_0x4aadfc){_0x4c62ce['push'](_0x4c62ce['shift']());}};_0x388297(++_0x18e255);}(_0xee2c,0x1c7));var _0xcee2=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xee2c[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0xcee2('0x0'));module['exports']={'name':{'type':Sequelize[_0xcee2('0x1')]},'description':{'type':Sequelize[_0xcee2('0x1')]},'username':{'type':Sequelize[_0xcee2('0x1')],'unique':_0xcee2('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcee2('0x1')],'unique':_0xcee2('0x3')},'authType':{'type':Sequelize['ENUM'](_0xcee2('0x4'),_0xcee2('0x5')),'defaultValue':_0xcee2('0x4')},'serverUrl':{'type':Sequelize[_0xcee2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcee2('0x6')]('integrationTab','newTab'),'defaultValue':_0xcee2('0x7')}}; \ No newline at end of file +var _0x89fb=['password','newTab','integrationTab','exports','STRING','username','remoteUri','ENUM'];(function(_0x3c47b1,_0x261d6b){var _0x56a7e3=function(_0x46c595){while(--_0x46c595){_0x3c47b1['push'](_0x3c47b1['shift']());}};_0x56a7e3(++_0x261d6b);}(_0x89fb,0x14b));var _0xb89f=function(_0x46ae73,_0x4f68fd){_0x46ae73=_0x46ae73-0x0;var _0x2b5029=_0x89fb[_0x46ae73];return _0x2b5029;};'use strict';var Sequelize=require('sequelize');module[_0xb89f('0x0')]={'name':{'type':Sequelize[_0xb89f('0x1')]},'description':{'type':Sequelize[_0xb89f('0x1')]},'username':{'type':Sequelize[_0xb89f('0x1')],'unique':_0xb89f('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb89f('0x1')]},'remoteUri':{'type':Sequelize[_0xb89f('0x1')],'unique':_0xb89f('0x3')},'authType':{'type':Sequelize[_0xb89f('0x4')](_0xb89f('0x5'),'token'),'defaultValue':_0xb89f('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb89f('0x4')]('integrationTab',_0xb89f('0x6')),'defaultValue':_0xb89f('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7c98288..cd47ace 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 _0x0713=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','body','catch','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','toString','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','ZendeskAccount'];(function(_0x3b7bcf,_0x6d8a7d){var _0x2feb9b=function(_0x2970f9){while(--_0x2970f9){_0x3b7bcf['push'](_0x3b7bcf['shift']());}};_0x2feb9b(++_0x6d8a7d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5330a8,_0x1826ca){_0x1826ca=_0x1826ca||0xcc;return function(_0x5dc13b){if(_0x5dc13b){return _0x5330a8[_0x3071('0x1b')](_0x1826ca);}return _0x5330a8[_0x3071('0x1c')](_0x1826ca)['end']();};}function respondWithResult(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xc8;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1c')](_0x4e1219)[_0x3071('0x1d')](_0x2fc15d);}};}function respondWithFilteredResult(_0x1f14e1,_0x1caa5d){return function(_0x2a6a4b){if(_0x2a6a4b){var _0x157a47=typeof _0x1caa5d[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1caa5d[_0x3071('0x20')]==='undefined';var _0x224996=_0x2a6a4b[_0x3071('0x21')];var _0x1068d9=_0x157a47?0x0:_0x1caa5d[_0x3071('0x1e')];var _0x3acf0e=_0x157a47?_0x2a6a4b[_0x3071('0x21')]:_0x1caa5d[_0x3071('0x1e')]+_0x1caa5d[_0x3071('0x20')];var _0x502a16;if(_0x3acf0e>=_0x224996){_0x3acf0e=_0x224996;_0x502a16=0xc8;}else{_0x502a16=0xce;}_0x1f14e1[_0x3071('0x1c')](_0x502a16);return _0x1f14e1[_0x3071('0x22')](_0x3071('0x23'),_0x1068d9+'-'+_0x3acf0e+'/'+_0x224996)['json'](_0x2a6a4b);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x24')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x25')](_0x43128c);}return _0x5cd80d[_0x3071('0x26')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x27')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x28')]()[_0x3071('0x29')](function(){_0x2ce48a[_0x3071('0x1c')](0xcc)[_0x3071('0x2a')]();});}};}function handleEntityNotFound(_0x1fe727,_0x1de5fb){return function(_0x4c7130){if(!_0x4c7130){_0x1fe727[_0x3071('0x1b')](0x194);}return _0x4c7130;};}function handleError(_0x3f1e6e,_0x177138){_0x177138=_0x177138||0x1f4;return function(_0x4d5c4b){logger[_0x3071('0x2b')](_0x4d5c4b[_0x3071('0x2c')]);if(_0x4d5c4b[_0x3071('0x2d')]){delete _0x4d5c4b[_0x3071('0x2d')];}_0x3f1e6e[_0x3071('0x1c')](_0x177138)[_0x3071('0x2e')](_0x4d5c4b);};}exports[_0x3071('0x2f')]=function(_0x3921a1,_0x32f1b4){var _0x292205={},_0x254fc8={},_0x5aba96={'count':0x0,'rows':[]};var _0x4f1484=_[_0x3071('0x30')](db[_0x3071('0x31')][_0x3071('0x32')],function(_0x40be95){return{'name':_0x40be95[_0x3071('0x33')],'type':_0x40be95[_0x3071('0x34')][_0x3071('0x35')]};});_0x254fc8[_0x3071('0x36')]=_['map'](_0x4f1484,'name');_0x254fc8['query']=_[_0x3071('0x37')](_0x3921a1[_0x3071('0x38')]);_0x254fc8['filters']=_[_0x3071('0x39')](_0x254fc8[_0x3071('0x36')],_0x254fc8[_0x3071('0x38')]);_0x292205[_0x3071('0x3a')]=_['intersection'](_0x254fc8[_0x3071('0x36')],qs[_0x3071('0x3b')](_0x3921a1[_0x3071('0x38')][_0x3071('0x3b')]));_0x292205[_0x3071('0x3a')]=_0x292205[_0x3071('0x3a')][_0x3071('0x3c')]?_0x292205[_0x3071('0x3a')]:_0x254fc8['model'];if(!_0x3921a1[_0x3071('0x38')]['hasOwnProperty']('nolimit')){_0x292205[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x3921a1['query'][_0x3071('0x20')]);_0x292205[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x3921a1[_0x3071('0x38')][_0x3071('0x1e')]);}_0x292205[_0x3071('0x3d')]=qs['sort'](_0x3921a1[_0x3071('0x38')][_0x3071('0x3e')]);_0x292205['where']=qs[_0x3071('0x3f')](_['pick'](_0x3921a1[_0x3071('0x38')],_0x254fc8[_0x3071('0x3f')]),_0x4f1484);if(_0x3921a1['query']['filter']){_0x292205[_0x3071('0x40')]=_[_0x3071('0x41')](_0x292205[_0x3071('0x40')],{'$or':_['map'](_0x4f1484,function(_0x4dea69){if(_0x4dea69['type']!==_0x3071('0x42')){var _0x4b7928={};_0x4b7928[_0x4dea69[_0x3071('0x2d')]]={'$like':'%'+_0x3921a1[_0x3071('0x38')][_0x3071('0x43')]+'%'};return _0x4b7928;}})});}_0x292205=_[_0x3071('0x41')]({},_0x292205,_0x3921a1[_0x3071('0x44')]);var _0x593c9c={'where':_0x292205['where']};return db[_0x3071('0x31')][_0x3071('0x21')](_0x593c9c)[_0x3071('0x29')](function(_0x1f69a6){_0x5aba96['count']=_0x1f69a6;if(_0x3921a1[_0x3071('0x38')][_0x3071('0x45')]){_0x292205[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x31')][_0x3071('0x47')](_0x292205);})[_0x3071('0x29')](function(_0x56a9d8){_0x5aba96[_0x3071('0x48')]=_0x56a9d8;return _0x5aba96;})['then'](respondWithFilteredResult(_0x32f1b4,_0x292205))['catch'](handleError(_0x32f1b4,null));};exports['show']=function(_0x47ceaf,_0x2992e6){var _0x1be8b6={'raw':![],'where':{'id':_0x47ceaf[_0x3071('0x49')]['id']}},_0x67b2fb={};_0x67b2fb[_0x3071('0x36')]=_[_0x3071('0x37')](db[_0x3071('0x31')][_0x3071('0x32')]);_0x67b2fb['query']=_[_0x3071('0x37')](_0x47ceaf[_0x3071('0x38')]);_0x67b2fb[_0x3071('0x3f')]=_[_0x3071('0x39')](_0x67b2fb[_0x3071('0x36')],_0x67b2fb['query']);_0x1be8b6['attributes']=_[_0x3071('0x39')](_0x67b2fb[_0x3071('0x36')],qs[_0x3071('0x3b')](_0x47ceaf[_0x3071('0x38')][_0x3071('0x3b')]));_0x1be8b6['attributes']=_0x1be8b6[_0x3071('0x3a')]['length']?_0x1be8b6[_0x3071('0x3a')]:_0x67b2fb['model'];if(_0x47ceaf['query'][_0x3071('0x45')]){_0x1be8b6['include']=[{'all':!![]}];}_0x1be8b6=_[_0x3071('0x41')]({},_0x1be8b6,_0x47ceaf['options']);return db[_0x3071('0x31')][_0x3071('0x4a')](_0x1be8b6)[_0x3071('0x29')](handleEntityNotFound(_0x2992e6,null))[_0x3071('0x29')](respondWithResult(_0x2992e6,null))['catch'](handleError(_0x2992e6,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){return db['ZendeskAccount'][_0x3071('0x4b')](_0x575c12[_0x3071('0x4c')],{})['then'](respondWithResult(_0xd273ec,0xc9))[_0x3071('0x4d')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x224a70,_0x38bcc2){if(_0x224a70[_0x3071('0x4c')]['id']){delete _0x224a70[_0x3071('0x4c')]['id'];}return db[_0x3071('0x31')]['find']({'where':{'id':_0x224a70[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x38bcc2,null))[_0x3071('0x29')](saveUpdates(_0x224a70[_0x3071('0x4c')],null))['then'](respondWithResult(_0x38bcc2,null))[_0x3071('0x4d')](handleError(_0x38bcc2,null));};exports[_0x3071('0x28')]=function(_0x1b832e,_0x2307dd){return db[_0x3071('0x31')][_0x3071('0x4a')]({'where':{'id':_0x1b832e[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x2307dd,null))[_0x3071('0x29')](removeEntity(_0x2307dd,null))[_0x3071('0x4d')](handleError(_0x2307dd,null));};exports[_0x3071('0x4e')]=function(_0x111115,_0x24977b,_0x114f1f){var _0x1656de={};var _0x12be97={};var _0x596cdd;var _0x47a438;return db[_0x3071('0x31')]['findOne']({'where':{'id':_0x111115[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x24977b,null))[_0x3071('0x29')](function(_0x514821){if(_0x514821){_0x596cdd=_0x514821;_0x12be97[_0x3071('0x36')]=_[_0x3071('0x37')](db['ZendeskConfiguration']['rawAttributes']);_0x12be97[_0x3071('0x38')]=_[_0x3071('0x37')](_0x111115[_0x3071('0x38')]);_0x12be97[_0x3071('0x3f')]=_['intersection'](_0x12be97[_0x3071('0x36')],_0x12be97[_0x3071('0x38')]);_0x1656de[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x12be97[_0x3071('0x36')],qs['fields'](_0x111115[_0x3071('0x38')][_0x3071('0x3b')]));_0x1656de[_0x3071('0x3a')]=_0x1656de[_0x3071('0x3a')][_0x3071('0x3c')]?_0x1656de[_0x3071('0x3a')]:_0x12be97[_0x3071('0x36')];_0x1656de['order']=qs['sort'](_0x111115[_0x3071('0x38')]['sort']);_0x1656de[_0x3071('0x40')]=qs[_0x3071('0x3f')](_['pick'](_0x111115[_0x3071('0x38')],_0x12be97[_0x3071('0x3f')]));if(_0x111115['query'][_0x3071('0x43')]){_0x1656de[_0x3071('0x40')]=_[_0x3071('0x41')](_0x1656de[_0x3071('0x40')],{'$or':_[_0x3071('0x30')](_0x1656de['attributes'],function(_0x327ef0){var _0x313a54={};_0x313a54[_0x327ef0]={'$like':'%'+_0x111115[_0x3071('0x38')]['filter']+'%'};return _0x313a54;})});}_0x1656de=_[_0x3071('0x41')]({},_0x1656de,_0x111115[_0x3071('0x44')]);return _0x596cdd[_0x3071('0x4e')](_0x1656de);}})[_0x3071('0x29')](function(_0x379723){if(_0x379723){_0x47a438=_0x379723[_0x3071('0x3c')];if(!_0x111115[_0x3071('0x38')][_0x3071('0x4f')](_0x3071('0x50'))){_0x1656de['limit']=qs[_0x3071('0x20')](_0x111115[_0x3071('0x38')][_0x3071('0x20')]);_0x1656de[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x111115[_0x3071('0x38')][_0x3071('0x1e')]);}return _0x596cdd[_0x3071('0x4e')](_0x1656de);}})[_0x3071('0x29')](function(_0x302680){if(_0x302680){return _0x302680?{'count':_0x47a438,'rows':_0x302680}:null;}})[_0x3071('0x29')](respondWithResult(_0x24977b,null))['catch'](handleError(_0x24977b,null));};exports[_0x3071('0x51')]=function(_0x315044,_0x279594,_0x3ed86c){if(_0x315044[_0x3071('0x4c')]['id']){delete _0x315044[_0x3071('0x4c')]['id'];}return db[_0x3071('0x31')][_0x3071('0x52')]({'where':{'id':_0x315044['params']['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x279594,null))[_0x3071('0x29')](function(_0x59ba87){if(_0x59ba87){_0x315044['body'][_0x3071('0x53')]=_0x59ba87['id'];_0x315044[_0x3071('0x4c')][_0x3071('0x54')]=integrations[_0x3071('0x55')](_0x315044['body']['channel'],_0x315044[_0x3071('0x4c')]['type']);_0x315044['body']['Descriptions']=integrations['getDescriptions'](_0x315044[_0x3071('0x4c')][_0x3071('0x56')],_0x315044[_0x3071('0x4c')]['type']);return db[_0x3071('0x57')][_0x3071('0x4b')](_0x315044[_0x3071('0x4c')],{'include':[{'model':db[_0x3071('0x58')],'as':'Subjects'},{'model':db[_0x3071('0x58')],'as':_0x3071('0x59')}]});}return null;})['then'](respondWithResult(_0x279594,null))[_0x3071('0x4d')](handleError(_0x279594,null));};exports[_0x3071('0x5a')]=function(_0x388cd1,_0x40c258,_0x4edd23){var _0x11ffdd='';return db[_0x3071('0x31')]['findOne']({'where':{'id':_0x388cd1['params']['id']},'attributes':['id',_0x3071('0x5b'),_0x3071('0x5c'),_0x3071('0x5d'),'authType','remoteUri']})[_0x3071('0x29')](handleEntityNotFound(_0x40c258,null))[_0x3071('0x29')](function(_0x3bad84){if(_0x3bad84){_0x11ffdd=_0x3bad84[_0x3071('0x5e')];var _0x2f1935=_0x11ffdd[_0x3071('0x5f')](-0x1);if(_0x2f1935==='/'){_0x11ffdd=_0x11ffdd[_0x3071('0x60')](0x0,_0x11ffdd[_0x3071('0x61')](_0x2f1935));}var _0x5eed64={'method':_0x3071('0x62'),'uri':util['format'](_0x3071('0x63'),_0x11ffdd,_0x3071('0x64')),'json':!![]};switch(_0x3bad84[_0x3071('0x65')]){case _0x3071('0x5c'):_0x5eed64[_0x3071('0x66')]={'Authorization':util[_0x3071('0x67')](_0x3071('0x68'),new Buffer(util[_0x3071('0x67')]('%s:%s',_0x3bad84[_0x3071('0x5b')],_0x3bad84[_0x3071('0x5c')]))[_0x3071('0x69')]('base64'))};break;case _0x3071('0x5d'):_0x5eed64[_0x3071('0x66')]={'Authorization':util[_0x3071('0x67')]('Basic\x20%s',new Buffer(util['format'](_0x3071('0x6a'),_0x3bad84['username'],_0x3bad84[_0x3071('0x5d')]))[_0x3071('0x69')](_0x3071('0x6b')))};break;default:throw new db[(_0x3071('0x6c'))][(_0x3071('0x6d'))](_0x3071('0x6e'));}return rp(_0x5eed64);}})[_0x3071('0x29')](function(_0x4c67ec){if(_0x4c67ec){var _0x1f2be3=[_0x3071('0x6f'),_0x3071('0x70'),_0x3071('0x71'),_0x3071('0x72')];_[_0x3071('0x73')](_0x4c67ec[_0x3071('0x64')],function(_0x277377){return _0x1f2be3['includes'](_0x277377[_0x3071('0x34')]);});return{'count':_0x4c67ec['ticket_fields'][_0x3071('0x3c')],'rows':_[_0x3071('0x30')](_0x4c67ec[_0x3071('0x64')],function(_0x45879b){return{'id':_0x45879b['id'],'name':_0x45879b[_0x3071('0x74')]>0x7?_0x45879b[_0x3071('0x75')]:_0x45879b[_0x3071('0x34')],'custom':_0x45879b[_0x3071('0x74')]>0x7?!![]:![],'options':_0x45879b[_0x3071('0x76')]?_0x45879b[_0x3071('0x76')]:_0x45879b['custom_field_options']?_0x45879b[_0x3071('0x77')]:[]};})};}})[_0x3071('0x29')](respondWithResult(_0x40c258,null))['catch'](function(_0x156826){var _0x3b7c95=_0x388cd1[_0x3071('0x38')][_0x3071('0x78')]?0x1f4:_0x156826[_0x3071('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x3071('0x5a'),_0x3b7c95,JSON['stringify'](_0x156826));delete _0x156826[_0x3071('0x2d')];if(_0x3b7c95===0x191){_0x3b7c95=0x190;}_0x40c258[_0x3071('0x1c')](_0x3b7c95)[_0x3071('0x2e')](_0x388cd1[_0x3071('0x38')][_0x3071('0x78')]?{'message':_0x3071('0x7a'),'statusCode':_0x156826['statusCode']}:_0x156826);});}; \ No newline at end of file +var _0x63a5=['username','password','token','remoteUri','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','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','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','rows','params','length','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields'];(function(_0x1e34b2,_0x566d4b){var _0x24da5a=function(_0x2f117a){while(--_0x2f117a){_0x1e34b2['push'](_0x1e34b2['shift']());}};_0x24da5a(++_0x566d4b);}(_0x63a5,0x18e));var _0x563a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x63a5[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x563a('0x19'));function respondWithStatusCode(_0x214f42,_0x10de2e){_0x10de2e=_0x10de2e||0xcc;return function(_0x27034c){if(_0x27034c){return _0x214f42[_0x563a('0x1a')](_0x10de2e);}return _0x214f42[_0x563a('0x1b')](_0x10de2e)['end']();};}function respondWithResult(_0x2cf052,_0x3045ac){_0x3045ac=_0x3045ac||0xc8;return function(_0x8c3727){if(_0x8c3727){return _0x2cf052[_0x563a('0x1b')](_0x3045ac)['json'](_0x8c3727);}};}function respondWithFilteredResult(_0x504cb7,_0x414535){return function(_0x2ad667){if(_0x2ad667){var _0x5b291f=typeof _0x414535[_0x563a('0x1c')]===_0x563a('0x1d')&&typeof _0x414535[_0x563a('0x1e')]===_0x563a('0x1d');var _0x4f947d=_0x2ad667['count'];var _0xe3d2bd=_0x5b291f?0x0:_0x414535[_0x563a('0x1c')];var _0x54a3b4=_0x5b291f?_0x2ad667['count']:_0x414535['offset']+_0x414535['limit'];var _0x4c15c1;if(_0x54a3b4>=_0x4f947d){_0x54a3b4=_0x4f947d;_0x4c15c1=0xc8;}else{_0x4c15c1=0xce;}_0x504cb7[_0x563a('0x1b')](_0x4c15c1);return _0x504cb7[_0x563a('0x1f')](_0x563a('0x20'),_0xe3d2bd+'-'+_0x54a3b4+'/'+_0x4f947d)[_0x563a('0x21')](_0x2ad667);}return null;};}function patchUpdates(_0x562fce){return function(_0x4e3b67){try{jsonpatch[_0x563a('0x22')](_0x4e3b67,_0x562fce,!![]);}catch(_0x9f8b29){return BPromise[_0x563a('0x23')](_0x9f8b29);}return _0x4e3b67[_0x563a('0x24')]();};}function saveUpdates(_0x1bf502,_0x2dc7e2){return function(_0x44b460){if(_0x44b460){return _0x44b460[_0x563a('0x25')](_0x1bf502)['then'](function(_0xd59ba8){return _0xd59ba8;});}return null;};}function removeEntity(_0x5422f6,_0x44e2c1){return function(_0xd3e0ae){if(_0xd3e0ae){return _0xd3e0ae[_0x563a('0x26')]()[_0x563a('0x27')](function(){_0x5422f6[_0x563a('0x1b')](0xcc)[_0x563a('0x28')]();});}};}function handleEntityNotFound(_0x3642b3,_0x173990){return function(_0x4de4c3){if(!_0x4de4c3){_0x3642b3[_0x563a('0x1a')](0x194);}return _0x4de4c3;};}function handleError(_0x2b688e,_0x2311f2){_0x2311f2=_0x2311f2||0x1f4;return function(_0x3d79ac){logger[_0x563a('0x29')](_0x3d79ac[_0x563a('0x2a')]);if(_0x3d79ac[_0x563a('0x2b')]){delete _0x3d79ac[_0x563a('0x2b')];}_0x2b688e[_0x563a('0x1b')](_0x2311f2)[_0x563a('0x2c')](_0x3d79ac);};}exports[_0x563a('0x2d')]=function(_0x24d1a8,_0x1bdfb0){var _0x7696c2={},_0x579cb5={},_0x43379c={'count':0x0,'rows':[]};var _0x3c16d0=_[_0x563a('0x2e')](db['ZendeskAccount'][_0x563a('0x2f')],function(_0x2e5c4b){return{'name':_0x2e5c4b[_0x563a('0x30')],'type':_0x2e5c4b[_0x563a('0x31')][_0x563a('0x32')]};});_0x579cb5[_0x563a('0x33')]=_[_0x563a('0x2e')](_0x3c16d0,'name');_0x579cb5[_0x563a('0x34')]=_[_0x563a('0x35')](_0x24d1a8[_0x563a('0x34')]);_0x579cb5[_0x563a('0x36')]=_[_0x563a('0x37')](_0x579cb5['model'],_0x579cb5['query']);_0x7696c2['attributes']=_['intersection'](_0x579cb5[_0x563a('0x33')],qs[_0x563a('0x38')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x38')]));_0x7696c2[_0x563a('0x39')]=_0x7696c2[_0x563a('0x39')]['length']?_0x7696c2['attributes']:_0x579cb5[_0x563a('0x33')];if(!_0x24d1a8[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x7696c2[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x1e')]);_0x7696c2[_0x563a('0x1c')]=qs[_0x563a('0x1c')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x1c')]);}_0x7696c2[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x3d')]);_0x7696c2['where']=qs[_0x563a('0x36')](_[_0x563a('0x3e')](_0x24d1a8[_0x563a('0x34')],_0x579cb5['filters']),_0x3c16d0);if(_0x24d1a8[_0x563a('0x34')]['filter']){_0x7696c2[_0x563a('0x3f')]=_[_0x563a('0x40')](_0x7696c2['where'],{'$or':_['map'](_0x3c16d0,function(_0x1b48f1){if(_0x1b48f1['type']!==_0x563a('0x41')){var _0x92bd6={};_0x92bd6[_0x1b48f1[_0x563a('0x2b')]]={'$like':'%'+_0x24d1a8[_0x563a('0x34')]['filter']+'%'};return _0x92bd6;}})});}_0x7696c2=_['merge']({},_0x7696c2,_0x24d1a8[_0x563a('0x42')]);var _0x598ee3={'where':_0x7696c2[_0x563a('0x3f')]};return db[_0x563a('0x43')][_0x563a('0x44')](_0x598ee3)[_0x563a('0x27')](function(_0x3a2eb0){_0x43379c[_0x563a('0x44')]=_0x3a2eb0;if(_0x24d1a8[_0x563a('0x34')][_0x563a('0x45')]){_0x7696c2['include']=[{'all':!![]}];}return db[_0x563a('0x43')]['findAll'](_0x7696c2);})[_0x563a('0x27')](function(_0x3de697){_0x43379c[_0x563a('0x46')]=_0x3de697;return _0x43379c;})[_0x563a('0x27')](respondWithFilteredResult(_0x1bdfb0,_0x7696c2))['catch'](handleError(_0x1bdfb0,null));};exports['show']=function(_0x54ac1e,_0x2221d4){var _0x1255da={'raw':![],'where':{'id':_0x54ac1e[_0x563a('0x47')]['id']}},_0x19b18f={};_0x19b18f[_0x563a('0x33')]=_[_0x563a('0x35')](db[_0x563a('0x43')][_0x563a('0x2f')]);_0x19b18f[_0x563a('0x34')]=_[_0x563a('0x35')](_0x54ac1e[_0x563a('0x34')]);_0x19b18f[_0x563a('0x36')]=_[_0x563a('0x37')](_0x19b18f[_0x563a('0x33')],_0x19b18f[_0x563a('0x34')]);_0x1255da[_0x563a('0x39')]=_[_0x563a('0x37')](_0x19b18f[_0x563a('0x33')],qs[_0x563a('0x38')](_0x54ac1e['query']['fields']));_0x1255da[_0x563a('0x39')]=_0x1255da[_0x563a('0x39')][_0x563a('0x48')]?_0x1255da[_0x563a('0x39')]:_0x19b18f[_0x563a('0x33')];if(_0x54ac1e[_0x563a('0x34')][_0x563a('0x45')]){_0x1255da[_0x563a('0x49')]=[{'all':!![]}];}_0x1255da=_['merge']({},_0x1255da,_0x54ac1e['options']);return db[_0x563a('0x43')][_0x563a('0x4a')](_0x1255da)[_0x563a('0x27')](handleEntityNotFound(_0x2221d4,null))[_0x563a('0x27')](respondWithResult(_0x2221d4,null))[_0x563a('0x4b')](handleError(_0x2221d4,null));};exports[_0x563a('0x4c')]=function(_0x2689b5,_0x276642){return db['ZendeskAccount'][_0x563a('0x4c')](_0x2689b5[_0x563a('0x4d')],{})['then'](respondWithResult(_0x276642,0xc9))[_0x563a('0x4b')](handleError(_0x276642,null));};exports['update']=function(_0x3ea787,_0xab7b16){if(_0x3ea787[_0x563a('0x4d')]['id']){delete _0x3ea787['body']['id'];}return db[_0x563a('0x43')][_0x563a('0x4a')]({'where':{'id':_0x3ea787[_0x563a('0x47')]['id']}})[_0x563a('0x27')](handleEntityNotFound(_0xab7b16,null))[_0x563a('0x27')](saveUpdates(_0x3ea787[_0x563a('0x4d')],null))[_0x563a('0x27')](respondWithResult(_0xab7b16,null))[_0x563a('0x4b')](handleError(_0xab7b16,null));};exports[_0x563a('0x26')]=function(_0x2008d4,_0x3c98d5){return db[_0x563a('0x43')][_0x563a('0x4a')]({'where':{'id':_0x2008d4['params']['id']}})['then'](handleEntityNotFound(_0x3c98d5,null))[_0x563a('0x27')](removeEntity(_0x3c98d5,null))[_0x563a('0x4b')](handleError(_0x3c98d5,null));};exports[_0x563a('0x4e')]=function(_0x4a807f,_0x5ae08f,_0x13530f){var _0x1fc4d2={};var _0x50ebde={};var _0x4b6ba9;var _0x51e142;return db[_0x563a('0x43')][_0x563a('0x4f')]({'where':{'id':_0x4a807f[_0x563a('0x47')]['id']}})[_0x563a('0x27')](handleEntityNotFound(_0x5ae08f,null))[_0x563a('0x27')](function(_0x2805eb){if(_0x2805eb){_0x4b6ba9=_0x2805eb;_0x50ebde['model']=_['keys'](db[_0x563a('0x50')]['rawAttributes']);_0x50ebde[_0x563a('0x34')]=_[_0x563a('0x35')](_0x4a807f[_0x563a('0x34')]);_0x50ebde[_0x563a('0x36')]=_[_0x563a('0x37')](_0x50ebde[_0x563a('0x33')],_0x50ebde[_0x563a('0x34')]);_0x1fc4d2['attributes']=_[_0x563a('0x37')](_0x50ebde[_0x563a('0x33')],qs['fields'](_0x4a807f[_0x563a('0x34')][_0x563a('0x38')]));_0x1fc4d2[_0x563a('0x39')]=_0x1fc4d2[_0x563a('0x39')][_0x563a('0x48')]?_0x1fc4d2[_0x563a('0x39')]:_0x50ebde[_0x563a('0x33')];_0x1fc4d2[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x4a807f[_0x563a('0x34')]['sort']);_0x1fc4d2[_0x563a('0x3f')]=qs[_0x563a('0x36')](_['pick'](_0x4a807f['query'],_0x50ebde[_0x563a('0x36')]));if(_0x4a807f[_0x563a('0x34')]['filter']){_0x1fc4d2[_0x563a('0x3f')]=_['merge'](_0x1fc4d2[_0x563a('0x3f')],{'$or':_[_0x563a('0x2e')](_0x1fc4d2[_0x563a('0x39')],function(_0xbe9fff){var _0x7fa423={};_0x7fa423[_0xbe9fff]={'$like':'%'+_0x4a807f['query']['filter']+'%'};return _0x7fa423;})});}_0x1fc4d2=_['merge']({},_0x1fc4d2,_0x4a807f['options']);return _0x4b6ba9[_0x563a('0x4e')](_0x1fc4d2);}})['then'](function(_0x111444){if(_0x111444){_0x51e142=_0x111444['length'];if(!_0x4a807f[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x1fc4d2[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4a807f['query'][_0x563a('0x1e')]);_0x1fc4d2['offset']=qs['offset'](_0x4a807f[_0x563a('0x34')][_0x563a('0x1c')]);}return _0x4b6ba9[_0x563a('0x4e')](_0x1fc4d2);}})[_0x563a('0x27')](function(_0x1c8ad7){if(_0x1c8ad7){return _0x1c8ad7?{'count':_0x51e142,'rows':_0x1c8ad7}:null;}})['then'](respondWithResult(_0x5ae08f,null))[_0x563a('0x4b')](handleError(_0x5ae08f,null));};exports[_0x563a('0x51')]=function(_0x20bd36,_0x3bbe7c,_0x36d40c){if(_0x20bd36['body']['id']){delete _0x20bd36[_0x563a('0x4d')]['id'];}return db['ZendeskAccount'][_0x563a('0x4f')]({'where':{'id':_0x20bd36[_0x563a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bbe7c,null))[_0x563a('0x27')](function(_0x30bf2b){if(_0x30bf2b){_0x20bd36[_0x563a('0x4d')][_0x563a('0x52')]=_0x30bf2b['id'];_0x20bd36[_0x563a('0x4d')][_0x563a('0x53')]=integrations[_0x563a('0x54')](_0x20bd36[_0x563a('0x4d')]['channel'],_0x20bd36[_0x563a('0x4d')][_0x563a('0x31')]);_0x20bd36[_0x563a('0x4d')][_0x563a('0x55')]=integrations[_0x563a('0x56')](_0x20bd36[_0x563a('0x4d')][_0x563a('0x57')],_0x20bd36['body'][_0x563a('0x31')]);return db['ZendeskConfiguration']['create'](_0x20bd36['body'],{'include':[{'model':db[_0x563a('0x58')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x563a('0x55')}]});}return null;})[_0x563a('0x27')](respondWithResult(_0x3bbe7c,null))[_0x563a('0x4b')](handleError(_0x3bbe7c,null));};exports[_0x563a('0x59')]=function(_0x2e442f,_0x51220c,_0x4814b3){var _0x4c9ad7='';return db[_0x563a('0x43')][_0x563a('0x4f')]({'where':{'id':_0x2e442f[_0x563a('0x47')]['id']},'attributes':['id',_0x563a('0x5a'),_0x563a('0x5b'),_0x563a('0x5c'),'authType',_0x563a('0x5d')]})[_0x563a('0x27')](handleEntityNotFound(_0x51220c,null))['then'](function(_0x1983e5){if(_0x1983e5){_0x4c9ad7=_0x1983e5[_0x563a('0x5d')];var _0x15e9ce=_0x4c9ad7['slice'](-0x1);if(_0x15e9ce==='/'){_0x4c9ad7=_0x4c9ad7[_0x563a('0x5e')](0x0,_0x4c9ad7[_0x563a('0x5f')](_0x15e9ce));}var _0x332428={'method':_0x563a('0x60'),'uri':util['format'](_0x563a('0x61'),_0x4c9ad7,_0x563a('0x62')),'json':!![]};switch(_0x1983e5[_0x563a('0x63')]){case _0x563a('0x5b'):_0x332428[_0x563a('0x64')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x563a('0x65')]('%s:%s',_0x1983e5[_0x563a('0x5a')],_0x1983e5[_0x563a('0x5b')]))[_0x563a('0x66')](_0x563a('0x67')))};break;case _0x563a('0x5c'):_0x332428[_0x563a('0x64')]={'Authorization':util[_0x563a('0x65')](_0x563a('0x68'),new Buffer(util[_0x563a('0x65')](_0x563a('0x69'),_0x1983e5['username'],_0x1983e5[_0x563a('0x5c')]))['toString'](_0x563a('0x67')))};break;default:throw new db[(_0x563a('0x6a'))]['ValidationError'](_0x563a('0x6b'));}return rp(_0x332428);}})['then'](function(_0x41f530){if(_0x41f530){var _0x42c448=['subject',_0x563a('0x6c'),_0x563a('0x6d'),_0x563a('0x6e')];_[_0x563a('0x6f')](_0x41f530['ticket_fields'],function(_0x418646){return _0x42c448[_0x563a('0x70')](_0x418646[_0x563a('0x31')]);});return{'count':_0x41f530[_0x563a('0x62')][_0x563a('0x48')],'rows':_[_0x563a('0x2e')](_0x41f530[_0x563a('0x62')],function(_0x137d52){return{'id':_0x137d52['id'],'name':_0x137d52[_0x563a('0x71')]>0x7?_0x137d52[_0x563a('0x72')]:_0x137d52['type'],'custom':_0x137d52[_0x563a('0x71')]>0x7?!![]:![],'options':_0x137d52[_0x563a('0x73')]?_0x137d52[_0x563a('0x73')]:_0x137d52['custom_field_options']?_0x137d52[_0x563a('0x74')]:[]};})};}})[_0x563a('0x27')](respondWithResult(_0x51220c,null))[_0x563a('0x4b')](function(_0xe27e02){var _0x2cca62=_0x2e442f[_0x563a('0x34')][_0x563a('0x75')]?0x1f4:_0xe27e02[_0x563a('0x76')]||0x1f4;logger[_0x563a('0x29')](_0x563a('0x77'),_0x563a('0x59'),_0x2cca62,JSON[_0x563a('0x78')](_0xe27e02));delete _0xe27e02[_0x563a('0x2b')];if(_0x2cca62===0x191){_0x2cca62=0x190;}_0x51220c['status'](_0x2cca62)[_0x563a('0x2c')](_0x2e442f[_0x563a('0x34')]['test']?{'message':_0x563a('0x79'),'statusCode':_0xe27e02[_0x563a('0x76')]}:_0xe27e02);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2ffc122..ecfb3c3 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 _0x26f6=['util','../../config/logger','bluebird','rimraf','../../config/environment','define','lodash'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0x26f6,0x125));var _0x626f=function(_0x3969aa,_0x368c1c){_0x3969aa=_0x3969aa-0x0;var _0x125067=_0x26f6[_0x3969aa];return _0x125067;};'use strict';var _=require(_0x626f('0x0'));var util=require(_0x626f('0x1'));var logger=require(_0x626f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x626f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x626f('0x4'));var config=require(_0x626f('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x58845e,_0x1a726f){return _0x58845e[_0x626f('0x6')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x989b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount'];(function(_0x7f690b,_0x3756a5){var _0x2de411=function(_0x4699a7){while(--_0x4699a7){_0x7f690b['push'](_0x7f690b['shift']());}};_0x2de411(++_0x3756a5);}(_0x989b,0xa8));var _0xb989=function(_0x144be0,_0x272ee4){_0x144be0=_0x144be0-0x0;var _0x2d47bd=_0x989b[_0x144be0];return _0x2d47bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb989('0x0'))(_0xb989('0x1'));var moment=require(_0xb989('0x2'));var BPromise=require(_0xb989('0x3'));var rp=require(_0xb989('0x4'));var fs=require('fs');var path=require(_0xb989('0x5'));var rimraf=require(_0xb989('0x6'));var config=require(_0xb989('0x7'));var attributes=require(_0xb989('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xb989('0x9')]=function(_0x544b49,_0x5ec8dd){return _0x544b49[_0xb989('0xa')](_0xb989('0xb'),attributes,{'tableName':'int_zendesk_accounts','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 b1c6921..defdce2 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 _0xc17f=['ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','request\x20sent','error','message','ZendeskAccount,\x20%s,\x20%s','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetZendeskAccount','debug','stringify','find'];(function(_0x1223bd,_0xcecb3a){var _0x8c7308=function(_0x296ece){while(--_0x296ece){_0x1223bd['push'](_0x1223bd['shift']());}};_0x8c7308(++_0xcecb3a);}(_0xc17f,0x155));var _0xfc17=function(_0x15f956,_0x4facae){_0x15f956=_0x15f956-0x0;var _0x52c33c=_0xc17f[_0x15f956];return _0x52c33c;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require(_0xfc17('0x6'))['db'];var utils=require(_0xfc17('0x7'));var logger=require(_0xfc17('0x8'))(_0xfc17('0x9'));var config=require(_0xfc17('0xa'));var jayson=require(_0xfc17('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec2ca,_0x1aa0ab,_0x58377b){return new BPromise(function(_0x1c6fb4,_0x2ac442){return client['request'](_0x4ec2ca,_0x58377b)[_0xfc17('0xc')](function(_0x1c60b8){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x1aa0ab,_0xfc17('0xd'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1aa0ab,_0xfc17('0xd'),JSON['stringify'](_0x1c60b8));if(_0x1c60b8[_0xfc17('0xe')]){if(_0x1c60b8[_0xfc17('0xe')]['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1aa0ab,_0x1c60b8['error'][_0xfc17('0xf')]);return _0x2ac442(_0x1c60b8['error'][_0xfc17('0xf')]);}logger[_0xfc17('0xe')](_0xfc17('0x10'),_0x1aa0ab,_0x1c60b8[_0xfc17('0xe')][_0xfc17('0xf')]);return _0x1c6fb4(_0x1c60b8[_0xfc17('0xe')][_0xfc17('0xf')]);}else{logger[_0xfc17('0x11')](_0xfc17('0x10'),_0x1aa0ab,_0xfc17('0xd'));_0x1c6fb4(_0x1c60b8[_0xfc17('0x12')][_0xfc17('0xf')]);}})[_0xfc17('0x13')](function(_0x22cc29){logger[_0xfc17('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x1aa0ab,_0x22cc29);_0x2ac442(_0x22cc29);});});}exports['GetZendeskAccount']=function(_0x43ef71){var _0xa8d78f=this;return new Promise(function(_0x26d258,_0x4ffac9){return db['ZendeskAccount'][_0xfc17('0x14')]({'raw':_0x43ef71[_0xfc17('0x15')]?_0x43ef71['options'][_0xfc17('0x16')]===undefined?!![]:![]:!![],'where':_0x43ef71[_0xfc17('0x15')]?_0x43ef71[_0xfc17('0x15')][_0xfc17('0x17')]||null:null,'attributes':_0x43ef71['options']?_0x43ef71[_0xfc17('0x15')]['attributes']||null:null,'limit':_0x43ef71[_0xfc17('0x15')]?_0x43ef71[_0xfc17('0x15')][_0xfc17('0x18')]||null:null,'include':_0x43ef71[_0xfc17('0x15')]?_0x43ef71['options'][_0xfc17('0x19')]?_[_0xfc17('0x1a')](_0x43ef71[_0xfc17('0x15')][_0xfc17('0x19')],function(_0x54459d){return{'model':db[_0x54459d[_0xfc17('0x1b')]],'as':_0x54459d['as'],'attributes':_0x54459d[_0xfc17('0x1c')],'include':_0x54459d[_0xfc17('0x19')]?_[_0xfc17('0x1a')](_0x54459d[_0xfc17('0x19')],function(_0x152d45){return{'model':db[_0x152d45[_0xfc17('0x1b')]],'as':_0x152d45['as'],'attributes':_0x152d45[_0xfc17('0x1c')],'include':_0x152d45['include']?_['map'](_0x152d45[_0xfc17('0x19')],function(_0x166556){return{'model':db[_0x166556[_0xfc17('0x1b')]],'as':_0x166556['as'],'attributes':_0x166556[_0xfc17('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4825c5){logger['info'](_0xfc17('0x1d'),_0x43ef71);logger[_0xfc17('0x1e')]('GetZendeskAccount',_0x43ef71,JSON[_0xfc17('0x1f')](_0x4825c5));_0x26d258(_0x4825c5);})['catch'](function(_0x16a220){logger[_0xfc17('0xe')](_0xfc17('0x1d'),_0x16a220['message'],_0x43ef71);_0x4ffac9(_0xa8d78f[_0xfc17('0xe')](0x1f4,_0x16a220['message']));});});};exports['ShowZendeskAccount']=function(_0x596fe2){var _0x172d2e=this;return new Promise(function(_0xcb130c,_0x18a2dc){return db['ZendeskAccount'][_0xfc17('0x20')]({'raw':_0x596fe2['options']?_0x596fe2['options'][_0xfc17('0x16')]===undefined?!![]:![]:!![],'where':_0x596fe2[_0xfc17('0x15')]?_0x596fe2[_0xfc17('0x15')][_0xfc17('0x17')]||null:null,'attributes':_0x596fe2[_0xfc17('0x15')]?_0x596fe2[_0xfc17('0x15')][_0xfc17('0x1c')]||null:null,'include':_0x596fe2['options']?_0x596fe2[_0xfc17('0x15')][_0xfc17('0x19')]?_['map'](_0x596fe2[_0xfc17('0x15')][_0xfc17('0x19')],function(_0x498cac){return{'model':db[_0x498cac[_0xfc17('0x1b')]],'as':_0x498cac['as'],'attributes':_0x498cac[_0xfc17('0x1c')],'include':_0x498cac[_0xfc17('0x19')]?_[_0xfc17('0x1a')](_0x498cac[_0xfc17('0x19')],function(_0x2a37a9){return{'model':db[_0x2a37a9[_0xfc17('0x1b')]],'as':_0x2a37a9['as'],'attributes':_0x2a37a9[_0xfc17('0x1c')],'include':_0x2a37a9[_0xfc17('0x19')]?_[_0xfc17('0x1a')](_0x2a37a9[_0xfc17('0x19')],function(_0x5929af){return{'model':db[_0x5929af['model']],'as':_0x5929af['as'],'attributes':_0x5929af[_0xfc17('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2403c0){logger[_0xfc17('0x11')](_0xfc17('0x21'),_0x596fe2);logger['debug'](_0xfc17('0x21'),_0x596fe2,JSON[_0xfc17('0x1f')](_0x2403c0));_0xcb130c(_0x2403c0);})[_0xfc17('0x13')](function(_0x52ae4c){logger[_0xfc17('0xe')]('ShowZendeskAccount',_0x52ae4c[_0xfc17('0xf')],_0x596fe2);_0x18a2dc(_0x172d2e[_0xfc17('0xe')](0x1f4,_0x52ae4c[_0xfc17('0xf')]));});});}; \ No newline at end of file +var _0x213f=['../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xeaddd1,_0x442355){var _0x51aa6f=function(_0x42baca){while(--_0x42baca){_0xeaddd1['push'](_0xeaddd1['shift']());}};_0x51aa6f(++_0x442355);}(_0x213f,0x173));var _0xf213=function(_0x1b7561,_0x205d0a){_0x1b7561=_0x1b7561-0x0;var _0x4b79e2=_0x213f[_0x1b7561];return _0x4b79e2;};'use strict';var _=require(_0xf213('0x0'));var util=require(_0xf213('0x1'));var moment=require(_0xf213('0x2'));var BPromise=require(_0xf213('0x3'));var rs=require(_0xf213('0x4'));var fs=require('fs');var Redis=require(_0xf213('0x5'));var db=require(_0xf213('0x6'))['db'];var utils=require(_0xf213('0x7'));var logger=require('../../config/logger')(_0xf213('0x8'));var config=require(_0xf213('0x9'));var jayson=require(_0xf213('0xa'));var client=jayson['client'][_0xf213('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8faa,_0x4c34f8,_0x5adc09){return new BPromise(function(_0xf3b2e7,_0x50ccb0){return client[_0xf213('0xc')](_0x4a8faa,_0x5adc09)['then'](function(_0xe52e7a){logger[_0xf213('0xd')](_0xf213('0xe'),_0x4c34f8,_0xf213('0xf'));logger['debug'](_0xf213('0x10'),_0x4c34f8,'request\x20sent',JSON[_0xf213('0x11')](_0xe52e7a));if(_0xe52e7a[_0xf213('0x12')]){if(_0xe52e7a[_0xf213('0x12')][_0xf213('0x13')]===0x1f4){logger[_0xf213('0x12')](_0xf213('0xe'),_0x4c34f8,_0xe52e7a['error'][_0xf213('0x14')]);return _0x50ccb0(_0xe52e7a[_0xf213('0x12')][_0xf213('0x14')]);}logger[_0xf213('0x12')](_0xf213('0xe'),_0x4c34f8,_0xe52e7a[_0xf213('0x12')][_0xf213('0x14')]);return _0xf3b2e7(_0xe52e7a[_0xf213('0x12')][_0xf213('0x14')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x4c34f8,'request\x20sent');_0xf3b2e7(_0xe52e7a[_0xf213('0x15')][_0xf213('0x14')]);}})['catch'](function(_0x16cbdb){logger[_0xf213('0x12')](_0xf213('0xe'),_0x4c34f8,_0x16cbdb);_0x50ccb0(_0x16cbdb);});});}exports[_0xf213('0x16')]=function(_0x4c21f2){var _0x39f060=this;return new Promise(function(_0x58512d,_0x4d4f07){return db[_0xf213('0x17')][_0xf213('0x18')]({'raw':_0x4c21f2[_0xf213('0x19')]?_0x4c21f2['options'][_0xf213('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c21f2[_0xf213('0x19')]?_0x4c21f2[_0xf213('0x19')][_0xf213('0x1b')]||null:null,'attributes':_0x4c21f2[_0xf213('0x19')]?_0x4c21f2[_0xf213('0x19')][_0xf213('0x1c')]||null:null,'limit':_0x4c21f2[_0xf213('0x19')]?_0x4c21f2[_0xf213('0x19')][_0xf213('0x1d')]||null:null,'include':_0x4c21f2['options']?_0x4c21f2[_0xf213('0x19')][_0xf213('0x1e')]?_[_0xf213('0x1f')](_0x4c21f2['options'][_0xf213('0x1e')],function(_0x317a25){return{'model':db[_0x317a25['model']],'as':_0x317a25['as'],'attributes':_0x317a25[_0xf213('0x1c')],'include':_0x317a25[_0xf213('0x1e')]?_[_0xf213('0x1f')](_0x317a25[_0xf213('0x1e')],function(_0x2a7a2f){return{'model':db[_0x2a7a2f['model']],'as':_0x2a7a2f['as'],'attributes':_0x2a7a2f['attributes'],'include':_0x2a7a2f[_0xf213('0x1e')]?_[_0xf213('0x1f')](_0x2a7a2f['include'],function(_0x4e89f0){return{'model':db[_0x4e89f0[_0xf213('0x20')]],'as':_0x4e89f0['as'],'attributes':_0x4e89f0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf213('0x21')](function(_0x122b31){logger[_0xf213('0xd')]('GetZendeskAccount',_0x4c21f2);logger[_0xf213('0x22')](_0xf213('0x16'),_0x4c21f2,JSON[_0xf213('0x11')](_0x122b31));_0x58512d(_0x122b31);})[_0xf213('0x23')](function(_0x141c09){logger['error'](_0xf213('0x16'),_0x141c09[_0xf213('0x14')],_0x4c21f2);_0x4d4f07(_0x39f060[_0xf213('0x12')](0x1f4,_0x141c09[_0xf213('0x14')]));});});};exports[_0xf213('0x24')]=function(_0x20d1db){var _0x1ccf6d=this;return new Promise(function(_0xd5b5e1,_0xde9f3){return db[_0xf213('0x17')][_0xf213('0x25')]({'raw':_0x20d1db[_0xf213('0x19')]?_0x20d1db[_0xf213('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20d1db[_0xf213('0x19')]?_0x20d1db[_0xf213('0x19')][_0xf213('0x1b')]||null:null,'attributes':_0x20d1db['options']?_0x20d1db['options'][_0xf213('0x1c')]||null:null,'include':_0x20d1db[_0xf213('0x19')]?_0x20d1db[_0xf213('0x19')][_0xf213('0x1e')]?_[_0xf213('0x1f')](_0x20d1db[_0xf213('0x19')]['include'],function(_0x5e4b84){return{'model':db[_0x5e4b84[_0xf213('0x20')]],'as':_0x5e4b84['as'],'attributes':_0x5e4b84[_0xf213('0x1c')],'include':_0x5e4b84[_0xf213('0x1e')]?_['map'](_0x5e4b84[_0xf213('0x1e')],function(_0x3f5e68){return{'model':db[_0x3f5e68['model']],'as':_0x3f5e68['as'],'attributes':_0x3f5e68[_0xf213('0x1c')],'include':_0x3f5e68['include']?_[_0xf213('0x1f')](_0x3f5e68['include'],function(_0x5a293b){return{'model':db[_0x5a293b[_0xf213('0x20')]],'as':_0x5a293b['as'],'attributes':_0x5a293b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf213('0x21')](function(_0x3bb89a){logger[_0xf213('0xd')](_0xf213('0x24'),_0x20d1db);logger[_0xf213('0x22')](_0xf213('0x24'),_0x20d1db,JSON[_0xf213('0x11')](_0x3bb89a));_0xd5b5e1(_0x3bb89a);})[_0xf213('0x23')](function(_0x4d5b32){logger[_0xf213('0x12')](_0xf213('0x24'),_0x4d5b32[_0xf213('0x14')],_0x20d1db);_0xde9f3(_0x1ccf6d['error'](0x1f4,_0x4d5b32[_0xf213('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index a1cdd87..75b03d7 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x296a68,_0x21254f){var _0x138035=function(_0x696d87){while(--_0x696d87){_0x296a68['push'](_0x296a68['shift']());}};_0x138035(++_0x21254f);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router; \ No newline at end of file +var _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x451959,_0x18c7a5){var _0x490269=function(_0x40cf17){while(--_0x40cf17){_0x451959['push'](_0x451959['shift']());}};_0x490269(++_0x18c7a5);}(_0xea28,0x13a));var _0x8ea2=function(_0x37f299,_0x18aecb){_0x37f299=_0x37f299-0x0;var _0x5488ce=_0xea28[_0x37f299];return _0x5488ce;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index c50cc7e..cd6a092 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 _0x9162=['sequelize','exports','STRING'];(function(_0x5b11e0,_0x48afdf){var _0x40256b=function(_0x565609){while(--_0x565609){_0x5b11e0['push'](_0x5b11e0['shift']());}};_0x40256b(++_0x48afdf);}(_0x9162,0xf0));var _0x2916=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x9162[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x2916('0x0'));module[_0x2916('0x1')]={'name':{'type':Sequelize[_0x2916('0x2')]},'description':{'type':Sequelize[_0x2916('0x2')]}}; \ No newline at end of file +var _0x1398=['sequelize','STRING'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x1398,0x1de));var _0x8139=function(_0x1adcf2,_0x2d216e){_0x1adcf2=_0x1adcf2-0x0;var _0x306827=_0x1398[_0x1adcf2];return _0x306827;};'use strict';var Sequelize=require(_0x8139('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8139('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2e702ea..24bbdc2 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 _0x67af=['limit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','params','create','body','find','getFields','findOne','pick','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','request-promise','moment','bluebird','util','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','sendStatus','status','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x67af,0x115));var _0xf67a=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x67af[_0x5756f8];return _0x3bb749;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf67a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf67a('0x1'));var moment=require(_0xf67a('0x2'));var BPromise=require(_0xf67a('0x3'));var Mustache=require('mustache');var util=require(_0xf67a('0x4'));var path=require('path');var sox=require(_0xf67a('0x5'));var csv=require(_0xf67a('0x6'));var ejs=require(_0xf67a('0x7'));var fs=require('fs');var fs_extra=require(_0xf67a('0x8'));var _=require(_0xf67a('0x9'));var squel=require(_0xf67a('0xa'));var crypto=require(_0xf67a('0xb'));var jsforce=require(_0xf67a('0xc'));var deskjs=require(_0xf67a('0xd'));var toCsv=require(_0xf67a('0x6'));var querystring=require(_0xf67a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf67a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf67a('0x10'));var as=require(_0xf67a('0x11'));var hardwareService=require(_0xf67a('0x12'));var logger=require(_0xf67a('0x13'))(_0xf67a('0x14'));var utils=require(_0xf67a('0x15'));var config=require(_0xf67a('0x16'));var licenseUtil=require(_0xf67a('0x17'));var db=require(_0xf67a('0x18'))['db'];function respondWithStatusCode(_0x4d4fbb,_0x3f1543){_0x3f1543=_0x3f1543||0xcc;return function(_0x22e9b6){if(_0x22e9b6){return _0x4d4fbb[_0xf67a('0x19')](_0x3f1543);}return _0x4d4fbb[_0xf67a('0x1a')](_0x3f1543)['end']();};}function respondWithResult(_0x5e14a9,_0x49ffa0){_0x49ffa0=_0x49ffa0||0xc8;return function(_0x3efc17){if(_0x3efc17){return _0x5e14a9[_0xf67a('0x1a')](_0x49ffa0)['json'](_0x3efc17);}};}function respondWithFilteredResult(_0x2593c7,_0x110503){return function(_0x427228){if(_0x427228){var _0x59f048=typeof _0x110503[_0xf67a('0x1b')]==='undefined'&&typeof _0x110503['limit']==='undefined';var _0x21f4fe=_0x427228[_0xf67a('0x1c')];var _0x3a7c7e=_0x59f048?0x0:_0x110503['offset'];var _0x1a1ffe=_0x59f048?_0x427228[_0xf67a('0x1c')]:_0x110503['offset']+_0x110503['limit'];var _0x347a22;if(_0x1a1ffe>=_0x21f4fe){_0x1a1ffe=_0x21f4fe;_0x347a22=0xc8;}else{_0x347a22=0xce;}_0x2593c7['status'](_0x347a22);return _0x2593c7[_0xf67a('0x1d')](_0xf67a('0x1e'),_0x3a7c7e+'-'+_0x1a1ffe+'/'+_0x21f4fe)[_0xf67a('0x1f')](_0x427228);}return null;};}function patchUpdates(_0x48a6b2){return function(_0x405048){try{jsonpatch[_0xf67a('0x20')](_0x405048,_0x48a6b2,!![]);}catch(_0x40a73f){return BPromise[_0xf67a('0x21')](_0x40a73f);}return _0x405048['save']();};}function saveUpdates(_0x167e64,_0x467a07){return function(_0x404516){if(_0x404516){return _0x404516[_0xf67a('0x22')](_0x167e64)[_0xf67a('0x23')](function(_0x2776d0){return _0x2776d0;});}return null;};}function removeEntity(_0x11c010,_0x372d59){return function(_0x5bf0cf){if(_0x5bf0cf){return _0x5bf0cf[_0xf67a('0x24')]()['then'](function(){_0x11c010[_0xf67a('0x1a')](0xcc)[_0xf67a('0x25')]();});}};}function handleEntityNotFound(_0x5d0d7c,_0x534f47){return function(_0xfd1a44){if(!_0xfd1a44){_0x5d0d7c['sendStatus'](0x194);}return _0xfd1a44;};}function handleError(_0x12e7e2,_0x1a6c48){_0x1a6c48=_0x1a6c48||0x1f4;return function(_0x2c699e){logger[_0xf67a('0x26')](_0x2c699e['stack']);if(_0x2c699e['name']){delete _0x2c699e[_0xf67a('0x27')];}_0x12e7e2['status'](_0x1a6c48)[_0xf67a('0x28')](_0x2c699e);};}exports[_0xf67a('0x29')]=function(_0x53024f,_0xf739b1){var _0x14ec3b={},_0x227a28={},_0x1f0b9b={'count':0x0,'rows':[]};var _0x56b9fa=_[_0xf67a('0x2a')](db[_0xf67a('0x2b')][_0xf67a('0x2c')],function(_0x289c81){return{'name':_0x289c81[_0xf67a('0x2d')],'type':_0x289c81['type']['key']};});_0x227a28[_0xf67a('0x2e')]=_[_0xf67a('0x2a')](_0x56b9fa,_0xf67a('0x27'));_0x227a28['query']=_[_0xf67a('0x2f')](_0x53024f[_0xf67a('0x30')]);_0x227a28[_0xf67a('0x31')]=_[_0xf67a('0x32')](_0x227a28['model'],_0x227a28[_0xf67a('0x30')]);_0x14ec3b[_0xf67a('0x33')]=_['intersection'](_0x227a28[_0xf67a('0x2e')],qs[_0xf67a('0x34')](_0x53024f[_0xf67a('0x30')][_0xf67a('0x34')]));_0x14ec3b[_0xf67a('0x33')]=_0x14ec3b[_0xf67a('0x33')][_0xf67a('0x35')]?_0x14ec3b[_0xf67a('0x33')]:_0x227a28[_0xf67a('0x2e')];if(!_0x53024f[_0xf67a('0x30')]['hasOwnProperty'](_0xf67a('0x36'))){_0x14ec3b['limit']=qs[_0xf67a('0x37')](_0x53024f[_0xf67a('0x30')][_0xf67a('0x37')]);_0x14ec3b['offset']=qs[_0xf67a('0x1b')](_0x53024f[_0xf67a('0x30')]['offset']);}_0x14ec3b[_0xf67a('0x38')]=qs[_0xf67a('0x39')](_0x53024f[_0xf67a('0x30')][_0xf67a('0x39')]);_0x14ec3b['where']=qs['filters'](_['pick'](_0x53024f[_0xf67a('0x30')],_0x227a28['filters']),_0x56b9fa);if(_0x53024f[_0xf67a('0x30')][_0xf67a('0x3a')]){_0x14ec3b[_0xf67a('0x3b')]=_[_0xf67a('0x3c')](_0x14ec3b['where'],{'$or':_[_0xf67a('0x2a')](_0x56b9fa,function(_0x6418d9){if(_0x6418d9[_0xf67a('0x3d')]!=='VIRTUAL'){var _0x8877fc={};_0x8877fc[_0x6418d9['name']]={'$like':'%'+_0x53024f['query'][_0xf67a('0x3a')]+'%'};return _0x8877fc;}})});}_0x14ec3b=_[_0xf67a('0x3c')]({},_0x14ec3b,_0x53024f[_0xf67a('0x3e')]);var _0x132da6={'where':_0x14ec3b['where']};return db[_0xf67a('0x2b')][_0xf67a('0x1c')](_0x132da6)[_0xf67a('0x23')](function(_0x2d8e0d){_0x1f0b9b['count']=_0x2d8e0d;if(_0x53024f[_0xf67a('0x30')][_0xf67a('0x3f')]){_0x14ec3b[_0xf67a('0x40')]=[{'all':!![]}];}return db[_0xf67a('0x2b')][_0xf67a('0x41')](_0x14ec3b);})[_0xf67a('0x23')](function(_0x1d0ee0){_0x1f0b9b[_0xf67a('0x42')]=_0x1d0ee0;return _0x1f0b9b;})['then'](respondWithFilteredResult(_0xf739b1,_0x14ec3b))[_0xf67a('0x43')](handleError(_0xf739b1,null));};exports['show']=function(_0x745369,_0x216ebf){var _0x40b1a4={'raw':![],'where':{'id':_0x745369[_0xf67a('0x44')]['id']}},_0x17b488={};_0x17b488[_0xf67a('0x2e')]=_['keys'](db[_0xf67a('0x2b')][_0xf67a('0x2c')]);_0x17b488['query']=_[_0xf67a('0x2f')](_0x745369[_0xf67a('0x30')]);_0x17b488[_0xf67a('0x31')]=_['intersection'](_0x17b488[_0xf67a('0x2e')],_0x17b488[_0xf67a('0x30')]);_0x40b1a4[_0xf67a('0x33')]=_[_0xf67a('0x32')](_0x17b488['model'],qs[_0xf67a('0x34')](_0x745369[_0xf67a('0x30')]['fields']));_0x40b1a4[_0xf67a('0x33')]=_0x40b1a4[_0xf67a('0x33')][_0xf67a('0x35')]?_0x40b1a4['attributes']:_0x17b488[_0xf67a('0x2e')];if(_0x745369['query'][_0xf67a('0x3f')]){_0x40b1a4[_0xf67a('0x40')]=[{'all':!![]}];}_0x40b1a4=_[_0xf67a('0x3c')]({},_0x40b1a4,_0x745369['options']);return db[_0xf67a('0x2b')]['find'](_0x40b1a4)[_0xf67a('0x23')](handleEntityNotFound(_0x216ebf,null))[_0xf67a('0x23')](respondWithResult(_0x216ebf,null))[_0xf67a('0x43')](handleError(_0x216ebf,null));};exports[_0xf67a('0x45')]=function(_0xdeaef7,_0x5a99e4){return db[_0xf67a('0x2b')][_0xf67a('0x45')](_0xdeaef7[_0xf67a('0x46')],{})[_0xf67a('0x23')](respondWithResult(_0x5a99e4,0xc9))['catch'](handleError(_0x5a99e4,null));};exports['update']=function(_0x47325f,_0x4c8b11){if(_0x47325f[_0xf67a('0x46')]['id']){delete _0x47325f['body']['id'];}return db['ZendeskConfiguration'][_0xf67a('0x47')]({'where':{'id':_0x47325f[_0xf67a('0x44')]['id']}})[_0xf67a('0x23')](handleEntityNotFound(_0x4c8b11,null))[_0xf67a('0x23')](saveUpdates(_0x47325f[_0xf67a('0x46')],null))['then'](respondWithResult(_0x4c8b11,null))[_0xf67a('0x43')](handleError(_0x4c8b11,null));};exports[_0xf67a('0x24')]=function(_0x470805,_0xff65dc){return db['ZendeskConfiguration'][_0xf67a('0x47')]({'where':{'id':_0x470805[_0xf67a('0x44')]['id']}})[_0xf67a('0x23')](handleEntityNotFound(_0xff65dc,null))[_0xf67a('0x23')](removeEntity(_0xff65dc,null))[_0xf67a('0x43')](handleError(_0xff65dc,null));};exports[_0xf67a('0x48')]=function(_0x820520,_0x1b5109,_0x231a7c){var _0x122d9f={};var _0x2f540d={};var _0x554337;var _0x3c1eed;return db[_0xf67a('0x2b')][_0xf67a('0x49')]({'where':{'id':_0x820520[_0xf67a('0x44')]['id']}})[_0xf67a('0x23')](handleEntityNotFound(_0x1b5109,null))['then'](function(_0x312813){if(_0x312813){_0x554337=_0x312813;_0x2f540d[_0xf67a('0x2e')]=_[_0xf67a('0x2f')](db['ZendeskField']['rawAttributes']);_0x2f540d[_0xf67a('0x30')]=_[_0xf67a('0x2f')](_0x820520['query']);_0x2f540d[_0xf67a('0x31')]=_[_0xf67a('0x32')](_0x2f540d[_0xf67a('0x2e')],_0x2f540d['query']);_0x122d9f[_0xf67a('0x33')]=_['intersection'](_0x2f540d[_0xf67a('0x2e')],qs[_0xf67a('0x34')](_0x820520['query'][_0xf67a('0x34')]));_0x122d9f[_0xf67a('0x33')]=_0x122d9f[_0xf67a('0x33')][_0xf67a('0x35')]?_0x122d9f[_0xf67a('0x33')]:_0x2f540d[_0xf67a('0x2e')];_0x122d9f[_0xf67a('0x38')]=qs[_0xf67a('0x39')](_0x820520[_0xf67a('0x30')]['sort']);_0x122d9f[_0xf67a('0x3b')]=qs[_0xf67a('0x31')](_[_0xf67a('0x4a')](_0x820520[_0xf67a('0x30')],_0x2f540d['filters']));if(_0x820520[_0xf67a('0x30')][_0xf67a('0x3a')]){_0x122d9f['where']=_[_0xf67a('0x3c')](_0x122d9f[_0xf67a('0x3b')],{'$or':_[_0xf67a('0x2a')](_0x122d9f[_0xf67a('0x33')],function(_0x56f9ad){var _0x22803f={};_0x22803f[_0x56f9ad]={'$like':'%'+_0x820520['query']['filter']+'%'};return _0x22803f;})});}_0x122d9f=_['merge']({},_0x122d9f,_0x820520[_0xf67a('0x3e')]);return _0x554337[_0xf67a('0x48')](_0x122d9f);}})[_0xf67a('0x23')](function(_0x4fe9b6){if(_0x4fe9b6){_0x3c1eed=_0x4fe9b6['length'];if(!_0x820520[_0xf67a('0x30')][_0xf67a('0x4b')](_0xf67a('0x36'))){_0x122d9f[_0xf67a('0x37')]=qs['limit'](_0x820520[_0xf67a('0x30')][_0xf67a('0x37')]);_0x122d9f[_0xf67a('0x1b')]=qs['offset'](_0x820520[_0xf67a('0x30')]['offset']);}return _0x554337['getFields'](_0x122d9f);}})[_0xf67a('0x23')](function(_0x197aa0){if(_0x197aa0){return _0x197aa0?{'count':_0x3c1eed,'rows':_0x197aa0}:null;}})[_0xf67a('0x23')](respondWithResult(_0x1b5109,null))[_0xf67a('0x43')](handleError(_0x1b5109,null));};exports[_0xf67a('0x4c')]=function(_0x473011,_0x4cc723,_0x4c091a){var _0x285e95={};var _0x1cca87={};var _0x436d6a;var _0x37b3bf;return db[_0xf67a('0x2b')][_0xf67a('0x49')]({'where':{'id':_0x473011['params']['id']}})['then'](handleEntityNotFound(_0x4cc723,null))[_0xf67a('0x23')](function(_0x4236a5){if(_0x4236a5){_0x436d6a=_0x4236a5;_0x1cca87['model']=_['keys'](db[_0xf67a('0x4d')][_0xf67a('0x2c')]);_0x1cca87[_0xf67a('0x30')]=_[_0xf67a('0x2f')](_0x473011[_0xf67a('0x30')]);_0x1cca87[_0xf67a('0x31')]=_[_0xf67a('0x32')](_0x1cca87[_0xf67a('0x2e')],_0x1cca87[_0xf67a('0x30')]);_0x285e95['attributes']=_['intersection'](_0x1cca87[_0xf67a('0x2e')],qs['fields'](_0x473011[_0xf67a('0x30')][_0xf67a('0x34')]));_0x285e95[_0xf67a('0x33')]=_0x285e95[_0xf67a('0x33')]['length']?_0x285e95['attributes']:_0x1cca87[_0xf67a('0x2e')];_0x285e95[_0xf67a('0x38')]=qs[_0xf67a('0x39')](_0x473011[_0xf67a('0x30')][_0xf67a('0x39')]);_0x285e95['where']=qs[_0xf67a('0x31')](_[_0xf67a('0x4a')](_0x473011['query'],_0x1cca87[_0xf67a('0x31')]));if(_0x473011['query'][_0xf67a('0x3a')]){_0x285e95[_0xf67a('0x3b')]=_[_0xf67a('0x3c')](_0x285e95[_0xf67a('0x3b')],{'$or':_[_0xf67a('0x2a')](_0x285e95['attributes'],function(_0x2c794d){var _0x26f769={};_0x26f769[_0x2c794d]={'$like':'%'+_0x473011[_0xf67a('0x30')][_0xf67a('0x3a')]+'%'};return _0x26f769;})});}_0x285e95=_[_0xf67a('0x3c')]({},_0x285e95,_0x473011['options']);return _0x436d6a[_0xf67a('0x4c')](_0x285e95);}})['then'](function(_0x503c12){if(_0x503c12){_0x37b3bf=_0x503c12['length'];if(!_0x473011[_0xf67a('0x30')][_0xf67a('0x4b')]('nolimit')){_0x285e95[_0xf67a('0x37')]=qs['limit'](_0x473011[_0xf67a('0x30')]['limit']);_0x285e95[_0xf67a('0x1b')]=qs['offset'](_0x473011['query'][_0xf67a('0x1b')]);}return _0x436d6a[_0xf67a('0x4c')](_0x285e95);}})[_0xf67a('0x23')](function(_0xc064ef){if(_0xc064ef){return _0xc064ef?{'count':_0x37b3bf,'rows':_0xc064ef}:null;}})[_0xf67a('0x23')](respondWithResult(_0x4cc723,null))[_0xf67a('0x43')](handleError(_0x4cc723,null));};exports[_0xf67a('0x4e')]=function(_0x742a77,_0x1b1ac0,_0x366ec){var _0xa15b7d={};var _0x29633a={};var _0x5bedde;var _0x54ebb3;return db[_0xf67a('0x2b')][_0xf67a('0x49')]({'where':{'id':_0x742a77[_0xf67a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b1ac0,null))[_0xf67a('0x23')](function(_0x4b3a7d){if(_0x4b3a7d){_0x5bedde=_0x4b3a7d;_0x29633a[_0xf67a('0x2e')]=_[_0xf67a('0x2f')](db[_0xf67a('0x4d')][_0xf67a('0x2c')]);_0x29633a[_0xf67a('0x30')]=_[_0xf67a('0x2f')](_0x742a77[_0xf67a('0x30')]);_0x29633a[_0xf67a('0x31')]=_[_0xf67a('0x32')](_0x29633a[_0xf67a('0x2e')],_0x29633a['query']);_0xa15b7d[_0xf67a('0x33')]=_[_0xf67a('0x32')](_0x29633a[_0xf67a('0x2e')],qs[_0xf67a('0x34')](_0x742a77['query'][_0xf67a('0x34')]));_0xa15b7d[_0xf67a('0x33')]=_0xa15b7d[_0xf67a('0x33')][_0xf67a('0x35')]?_0xa15b7d[_0xf67a('0x33')]:_0x29633a['model'];_0xa15b7d[_0xf67a('0x38')]=qs[_0xf67a('0x39')](_0x742a77['query'][_0xf67a('0x39')]);_0xa15b7d['where']=qs[_0xf67a('0x31')](_[_0xf67a('0x4a')](_0x742a77['query'],_0x29633a['filters']));if(_0x742a77[_0xf67a('0x30')][_0xf67a('0x3a')]){_0xa15b7d['where']=_[_0xf67a('0x3c')](_0xa15b7d[_0xf67a('0x3b')],{'$or':_[_0xf67a('0x2a')](_0xa15b7d[_0xf67a('0x33')],function(_0x49b0c6){var _0x3ad78a={};_0x3ad78a[_0x49b0c6]={'$like':'%'+_0x742a77[_0xf67a('0x30')]['filter']+'%'};return _0x3ad78a;})});}_0xa15b7d=_[_0xf67a('0x3c')]({},_0xa15b7d,_0x742a77[_0xf67a('0x3e')]);return _0x5bedde[_0xf67a('0x4e')](_0xa15b7d);}})['then'](function(_0x5e589e){if(_0x5e589e){_0x54ebb3=_0x5e589e[_0xf67a('0x35')];if(!_0x742a77['query'][_0xf67a('0x4b')](_0xf67a('0x36'))){_0xa15b7d[_0xf67a('0x37')]=qs[_0xf67a('0x37')](_0x742a77[_0xf67a('0x30')][_0xf67a('0x37')]);_0xa15b7d[_0xf67a('0x1b')]=qs[_0xf67a('0x1b')](_0x742a77[_0xf67a('0x30')][_0xf67a('0x1b')]);}return _0x5bedde[_0xf67a('0x4e')](_0xa15b7d);}})[_0xf67a('0x23')](function(_0x1cf438){if(_0x1cf438){return _0x1cf438?{'count':_0x54ebb3,'rows':_0x1cf438}:null;}})[_0xf67a('0x23')](respondWithResult(_0x1b1ac0,null))[_0xf67a('0x43')](handleError(_0x1b1ac0,null));};exports[_0xf67a('0x4f')]=function(_0x4bcc34,_0x389b24,_0x11a1f6){var _0x1d8fc8={};var _0x185efa={};var _0x1e098d;var _0x503755;return db['ZendeskConfiguration'][_0xf67a('0x49')]({'where':{'id':_0x4bcc34[_0xf67a('0x44')]['id']}})[_0xf67a('0x23')](handleEntityNotFound(_0x389b24,null))[_0xf67a('0x23')](function(_0x447c29){if(_0x447c29){_0x1e098d=_0x447c29;_0x185efa[_0xf67a('0x2e')]=_[_0xf67a('0x2f')](db[_0xf67a('0x50')][_0xf67a('0x2c')]);_0x185efa['query']=_[_0xf67a('0x2f')](_0x4bcc34[_0xf67a('0x30')]);_0x185efa['filters']=_['intersection'](_0x185efa[_0xf67a('0x2e')],_0x185efa['query']);_0x1d8fc8[_0xf67a('0x33')]=_[_0xf67a('0x32')](_0x185efa[_0xf67a('0x2e')],qs[_0xf67a('0x34')](_0x4bcc34['query'][_0xf67a('0x34')]));_0x1d8fc8[_0xf67a('0x33')]=_0x1d8fc8[_0xf67a('0x33')]['length']?_0x1d8fc8[_0xf67a('0x33')]:_0x185efa['model'];_0x1d8fc8[_0xf67a('0x38')]=qs[_0xf67a('0x39')](_0x4bcc34[_0xf67a('0x30')]['sort']);_0x1d8fc8[_0xf67a('0x3b')]=qs['filters'](_[_0xf67a('0x4a')](_0x4bcc34[_0xf67a('0x30')],_0x185efa[_0xf67a('0x31')]));if(_0x4bcc34[_0xf67a('0x30')][_0xf67a('0x3a')]){_0x1d8fc8[_0xf67a('0x3b')]=_[_0xf67a('0x3c')](_0x1d8fc8[_0xf67a('0x3b')],{'$or':_[_0xf67a('0x2a')](_0x1d8fc8[_0xf67a('0x33')],function(_0x4135e4){var _0x58f2d3={};_0x58f2d3[_0x4135e4]={'$like':'%'+_0x4bcc34[_0xf67a('0x30')][_0xf67a('0x3a')]+'%'};return _0x58f2d3;})});}_0x1d8fc8=_[_0xf67a('0x3c')]({},_0x1d8fc8,_0x4bcc34[_0xf67a('0x3e')]);return _0x1e098d[_0xf67a('0x4f')](_0x1d8fc8);}})['then'](function(_0x1c0c35){if(_0x1c0c35){_0x503755=_0x1c0c35['length'];if(!_0x4bcc34[_0xf67a('0x30')]['hasOwnProperty']('nolimit')){_0x1d8fc8[_0xf67a('0x37')]=qs[_0xf67a('0x37')](_0x4bcc34[_0xf67a('0x30')]['limit']);_0x1d8fc8[_0xf67a('0x1b')]=qs[_0xf67a('0x1b')](_0x4bcc34[_0xf67a('0x30')]['offset']);}return _0x1e098d[_0xf67a('0x4f')](_0x1d8fc8);}})[_0xf67a('0x23')](function(_0x3029b7){if(_0x3029b7){return _0x3029b7?{'count':_0x503755,'rows':_0x3029b7}:null;}})['then'](respondWithResult(_0x389b24,null))['catch'](handleError(_0x389b24,null));};exports[_0xf67a('0x51')]=function(_0x3a7f0e,_0x33d765,_0x488f75){if(_0x3a7f0e[_0xf67a('0x46')]['id']){delete _0x3a7f0e[_0xf67a('0x46')]['id'];}return db['ZendeskConfiguration'][_0xf67a('0x49')]({'where':{'id':_0x3a7f0e[_0xf67a('0x44')]['id']}})[_0xf67a('0x23')](handleEntityNotFound(_0x33d765,null))[_0xf67a('0x23')](function(_0x377486){if(_0x377486){return _0x377486['setTags'](_0x3a7f0e[_0xf67a('0x46')][_0xf67a('0x52')]||[]);}return null;})[_0xf67a('0x23')](respondWithResult(_0x33d765,null))['catch'](handleError(_0x33d765,null));}; \ No newline at end of file +var _0xf2ec=['name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','findOne','ZendeskField','sort','options','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','apply','save','update','then','sendStatus','error','stack'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xf2ec,0x12e));var _0xcf2e=function(_0x3c6d72,_0x36d3f2){_0x3c6d72=_0x3c6d72-0x0;var _0xd3fe0c=_0xf2ec[_0x3c6d72];return _0xd3fe0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf2e('0x0'));var zipdir=require(_0xcf2e('0x1'));var jsonpatch=require(_0xcf2e('0x2'));var rp=require(_0xcf2e('0x3'));var moment=require(_0xcf2e('0x4'));var BPromise=require(_0xcf2e('0x5'));var Mustache=require('mustache');var util=require(_0xcf2e('0x6'));var path=require(_0xcf2e('0x7'));var sox=require('sox');var csv=require(_0xcf2e('0x8'));var ejs=require(_0xcf2e('0x9'));var fs=require('fs');var fs_extra=require(_0xcf2e('0xa'));var _=require(_0xcf2e('0xb'));var squel=require(_0xcf2e('0xc'));var crypto=require(_0xcf2e('0xd'));var jsforce=require(_0xcf2e('0xe'));var deskjs=require(_0xcf2e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf2e('0x10'));var Papa=require(_0xcf2e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf2e('0x12'));var as=require(_0xcf2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcf2e('0x14'));var config=require(_0xcf2e('0x15'));var licenseUtil=require(_0xcf2e('0x16'));var db=require(_0xcf2e('0x17'))['db'];function respondWithStatusCode(_0x37b325,_0x519530){_0x519530=_0x519530||0xcc;return function(_0x24d332){if(_0x24d332){return _0x37b325['sendStatus'](_0x519530);}return _0x37b325[_0xcf2e('0x18')](_0x519530)[_0xcf2e('0x19')]();};}function respondWithResult(_0x493c8e,_0x24d022){_0x24d022=_0x24d022||0xc8;return function(_0x179164){if(_0x179164){return _0x493c8e[_0xcf2e('0x18')](_0x24d022)[_0xcf2e('0x1a')](_0x179164);}};}function respondWithFilteredResult(_0x4e5983,_0x50e537){return function(_0x58b23a){if(_0x58b23a){var _0x1eb77e=typeof _0x50e537['offset']==='undefined'&&typeof _0x50e537[_0xcf2e('0x1b')]==='undefined';var _0x381296=_0x58b23a[_0xcf2e('0x1c')];var _0xbcb61a=_0x1eb77e?0x0:_0x50e537[_0xcf2e('0x1d')];var _0x1dfa21=_0x1eb77e?_0x58b23a[_0xcf2e('0x1c')]:_0x50e537[_0xcf2e('0x1d')]+_0x50e537[_0xcf2e('0x1b')];var _0x15fa45;if(_0x1dfa21>=_0x381296){_0x1dfa21=_0x381296;_0x15fa45=0xc8;}else{_0x15fa45=0xce;}_0x4e5983[_0xcf2e('0x18')](_0x15fa45);return _0x4e5983[_0xcf2e('0x1e')]('Content-Range',_0xbcb61a+'-'+_0x1dfa21+'/'+_0x381296)[_0xcf2e('0x1a')](_0x58b23a);}return null;};}function patchUpdates(_0x537a01){return function(_0x1ece81){try{jsonpatch[_0xcf2e('0x1f')](_0x1ece81,_0x537a01,!![]);}catch(_0x461939){return BPromise['reject'](_0x461939);}return _0x1ece81[_0xcf2e('0x20')]();};}function saveUpdates(_0x587f12,_0x4383c5){return function(_0x3cbf8e){if(_0x3cbf8e){return _0x3cbf8e[_0xcf2e('0x21')](_0x587f12)[_0xcf2e('0x22')](function(_0x952bf7){return _0x952bf7;});}return null;};}function removeEntity(_0x4f62d9,_0x1725c8){return function(_0x5ee430){if(_0x5ee430){return _0x5ee430['destroy']()[_0xcf2e('0x22')](function(){_0x4f62d9[_0xcf2e('0x18')](0xcc)[_0xcf2e('0x19')]();});}};}function handleEntityNotFound(_0x291b51,_0xe6af6c){return function(_0x9bfb17){if(!_0x9bfb17){_0x291b51[_0xcf2e('0x23')](0x194);}return _0x9bfb17;};}function handleError(_0x92605c,_0x35059b){_0x35059b=_0x35059b||0x1f4;return function(_0x29c073){logger[_0xcf2e('0x24')](_0x29c073[_0xcf2e('0x25')]);if(_0x29c073[_0xcf2e('0x26')]){delete _0x29c073[_0xcf2e('0x26')];}_0x92605c[_0xcf2e('0x18')](_0x35059b)[_0xcf2e('0x27')](_0x29c073);};}exports[_0xcf2e('0x28')]=function(_0x25f181,_0x14e19e){var _0x265368={},_0x2a18e8={},_0x19bbee={'count':0x0,'rows':[]};var _0xe18b17=_[_0xcf2e('0x29')](db[_0xcf2e('0x2a')][_0xcf2e('0x2b')],function(_0x32a963){return{'name':_0x32a963[_0xcf2e('0x2c')],'type':_0x32a963[_0xcf2e('0x2d')][_0xcf2e('0x2e')]};});_0x2a18e8['model']=_[_0xcf2e('0x29')](_0xe18b17,'name');_0x2a18e8[_0xcf2e('0x2f')]=_[_0xcf2e('0x30')](_0x25f181[_0xcf2e('0x2f')]);_0x2a18e8[_0xcf2e('0x31')]=_[_0xcf2e('0x32')](_0x2a18e8[_0xcf2e('0x33')],_0x2a18e8['query']);_0x265368['attributes']=_['intersection'](_0x2a18e8['model'],qs[_0xcf2e('0x34')](_0x25f181[_0xcf2e('0x2f')][_0xcf2e('0x34')]));_0x265368['attributes']=_0x265368[_0xcf2e('0x35')]['length']?_0x265368['attributes']:_0x2a18e8[_0xcf2e('0x33')];if(!_0x25f181[_0xcf2e('0x2f')][_0xcf2e('0x36')](_0xcf2e('0x37'))){_0x265368[_0xcf2e('0x1b')]=qs[_0xcf2e('0x1b')](_0x25f181[_0xcf2e('0x2f')]['limit']);_0x265368[_0xcf2e('0x1d')]=qs['offset'](_0x25f181[_0xcf2e('0x2f')]['offset']);}_0x265368[_0xcf2e('0x38')]=qs['sort'](_0x25f181[_0xcf2e('0x2f')]['sort']);_0x265368[_0xcf2e('0x39')]=qs['filters'](_['pick'](_0x25f181[_0xcf2e('0x2f')],_0x2a18e8[_0xcf2e('0x31')]),_0xe18b17);if(_0x25f181[_0xcf2e('0x2f')][_0xcf2e('0x3a')]){_0x265368[_0xcf2e('0x39')]=_['merge'](_0x265368[_0xcf2e('0x39')],{'$or':_[_0xcf2e('0x29')](_0xe18b17,function(_0x3515d3){if(_0x3515d3['type']!==_0xcf2e('0x3b')){var _0xf38f={};_0xf38f[_0x3515d3[_0xcf2e('0x26')]]={'$like':'%'+_0x25f181['query'][_0xcf2e('0x3a')]+'%'};return _0xf38f;}})});}_0x265368=_[_0xcf2e('0x3c')]({},_0x265368,_0x25f181['options']);var _0x8ad2e6={'where':_0x265368[_0xcf2e('0x39')]};return db[_0xcf2e('0x2a')][_0xcf2e('0x1c')](_0x8ad2e6)[_0xcf2e('0x22')](function(_0x1402d4){_0x19bbee[_0xcf2e('0x1c')]=_0x1402d4;if(_0x25f181['query'][_0xcf2e('0x3d')]){_0x265368[_0xcf2e('0x3e')]=[{'all':!![]}];}return db[_0xcf2e('0x2a')][_0xcf2e('0x3f')](_0x265368);})[_0xcf2e('0x22')](function(_0x5c5466){_0x19bbee[_0xcf2e('0x40')]=_0x5c5466;return _0x19bbee;})[_0xcf2e('0x22')](respondWithFilteredResult(_0x14e19e,_0x265368))[_0xcf2e('0x41')](handleError(_0x14e19e,null));};exports[_0xcf2e('0x42')]=function(_0x241d36,_0x5d8811){var _0x1650a4={'raw':![],'where':{'id':_0x241d36[_0xcf2e('0x43')]['id']}},_0x2e8bce={};_0x2e8bce['model']=_['keys'](db[_0xcf2e('0x2a')][_0xcf2e('0x2b')]);_0x2e8bce[_0xcf2e('0x2f')]=_[_0xcf2e('0x30')](_0x241d36['query']);_0x2e8bce[_0xcf2e('0x31')]=_[_0xcf2e('0x32')](_0x2e8bce[_0xcf2e('0x33')],_0x2e8bce[_0xcf2e('0x2f')]);_0x1650a4[_0xcf2e('0x35')]=_[_0xcf2e('0x32')](_0x2e8bce[_0xcf2e('0x33')],qs[_0xcf2e('0x34')](_0x241d36['query'][_0xcf2e('0x34')]));_0x1650a4[_0xcf2e('0x35')]=_0x1650a4['attributes'][_0xcf2e('0x44')]?_0x1650a4[_0xcf2e('0x35')]:_0x2e8bce['model'];if(_0x241d36[_0xcf2e('0x2f')][_0xcf2e('0x3d')]){_0x1650a4[_0xcf2e('0x3e')]=[{'all':!![]}];}_0x1650a4=_['merge']({},_0x1650a4,_0x241d36['options']);return db['ZendeskConfiguration'][_0xcf2e('0x45')](_0x1650a4)[_0xcf2e('0x22')](handleEntityNotFound(_0x5d8811,null))[_0xcf2e('0x22')](respondWithResult(_0x5d8811,null))[_0xcf2e('0x41')](handleError(_0x5d8811,null));};exports[_0xcf2e('0x46')]=function(_0x5ac453,_0x316c58){return db[_0xcf2e('0x2a')][_0xcf2e('0x46')](_0x5ac453[_0xcf2e('0x47')],{})[_0xcf2e('0x22')](respondWithResult(_0x316c58,0xc9))['catch'](handleError(_0x316c58,null));};exports['update']=function(_0x1c6646,_0x51cf09){if(_0x1c6646[_0xcf2e('0x47')]['id']){delete _0x1c6646[_0xcf2e('0x47')]['id'];}return db['ZendeskConfiguration'][_0xcf2e('0x45')]({'where':{'id':_0x1c6646['params']['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x51cf09,null))[_0xcf2e('0x22')](saveUpdates(_0x1c6646['body'],null))[_0xcf2e('0x22')](respondWithResult(_0x51cf09,null))[_0xcf2e('0x41')](handleError(_0x51cf09,null));};exports[_0xcf2e('0x48')]=function(_0x224f0b,_0x32a985){return db[_0xcf2e('0x2a')][_0xcf2e('0x45')]({'where':{'id':_0x224f0b['params']['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x32a985,null))[_0xcf2e('0x22')](removeEntity(_0x32a985,null))[_0xcf2e('0x41')](handleError(_0x32a985,null));};exports[_0xcf2e('0x49')]=function(_0x7baabc,_0x1cb405,_0x478e6b){var _0x3ab208={};var _0x5b9cc8={};var _0x564d0f;var _0x4bd6f7;return db[_0xcf2e('0x2a')][_0xcf2e('0x4a')]({'where':{'id':_0x7baabc[_0xcf2e('0x43')]['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x1cb405,null))[_0xcf2e('0x22')](function(_0x177749){if(_0x177749){_0x564d0f=_0x177749;_0x5b9cc8[_0xcf2e('0x33')]=_[_0xcf2e('0x30')](db[_0xcf2e('0x4b')][_0xcf2e('0x2b')]);_0x5b9cc8['query']=_['keys'](_0x7baabc['query']);_0x5b9cc8[_0xcf2e('0x31')]=_[_0xcf2e('0x32')](_0x5b9cc8[_0xcf2e('0x33')],_0x5b9cc8[_0xcf2e('0x2f')]);_0x3ab208[_0xcf2e('0x35')]=_[_0xcf2e('0x32')](_0x5b9cc8[_0xcf2e('0x33')],qs[_0xcf2e('0x34')](_0x7baabc['query'][_0xcf2e('0x34')]));_0x3ab208['attributes']=_0x3ab208[_0xcf2e('0x35')]['length']?_0x3ab208['attributes']:_0x5b9cc8[_0xcf2e('0x33')];_0x3ab208[_0xcf2e('0x38')]=qs['sort'](_0x7baabc[_0xcf2e('0x2f')][_0xcf2e('0x4c')]);_0x3ab208[_0xcf2e('0x39')]=qs[_0xcf2e('0x31')](_['pick'](_0x7baabc[_0xcf2e('0x2f')],_0x5b9cc8[_0xcf2e('0x31')]));if(_0x7baabc['query'][_0xcf2e('0x3a')]){_0x3ab208[_0xcf2e('0x39')]=_[_0xcf2e('0x3c')](_0x3ab208[_0xcf2e('0x39')],{'$or':_[_0xcf2e('0x29')](_0x3ab208['attributes'],function(_0x4fe2a1){var _0x2bbaad={};_0x2bbaad[_0x4fe2a1]={'$like':'%'+_0x7baabc[_0xcf2e('0x2f')][_0xcf2e('0x3a')]+'%'};return _0x2bbaad;})});}_0x3ab208=_[_0xcf2e('0x3c')]({},_0x3ab208,_0x7baabc[_0xcf2e('0x4d')]);return _0x564d0f['getFields'](_0x3ab208);}})[_0xcf2e('0x22')](function(_0x4e855f){if(_0x4e855f){_0x4bd6f7=_0x4e855f[_0xcf2e('0x44')];if(!_0x7baabc[_0xcf2e('0x2f')][_0xcf2e('0x36')](_0xcf2e('0x37'))){_0x3ab208[_0xcf2e('0x1b')]=qs[_0xcf2e('0x1b')](_0x7baabc['query'][_0xcf2e('0x1b')]);_0x3ab208['offset']=qs[_0xcf2e('0x1d')](_0x7baabc[_0xcf2e('0x2f')][_0xcf2e('0x1d')]);}return _0x564d0f[_0xcf2e('0x49')](_0x3ab208);}})[_0xcf2e('0x22')](function(_0x46efeb){if(_0x46efeb){return _0x46efeb?{'count':_0x4bd6f7,'rows':_0x46efeb}:null;}})[_0xcf2e('0x22')](respondWithResult(_0x1cb405,null))[_0xcf2e('0x41')](handleError(_0x1cb405,null));};exports['getSubjects']=function(_0x346cb4,_0x5e9e04,_0x42703f){var _0x279f27={};var _0x3d9f7a={};var _0x71114;var _0x39b95d;return db['ZendeskConfiguration'][_0xcf2e('0x4a')]({'where':{'id':_0x346cb4[_0xcf2e('0x43')]['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x5e9e04,null))[_0xcf2e('0x22')](function(_0x65a799){if(_0x65a799){_0x71114=_0x65a799;_0x3d9f7a[_0xcf2e('0x33')]=_[_0xcf2e('0x30')](db['ZendeskField'][_0xcf2e('0x2b')]);_0x3d9f7a[_0xcf2e('0x2f')]=_[_0xcf2e('0x30')](_0x346cb4['query']);_0x3d9f7a[_0xcf2e('0x31')]=_['intersection'](_0x3d9f7a[_0xcf2e('0x33')],_0x3d9f7a[_0xcf2e('0x2f')]);_0x279f27['attributes']=_[_0xcf2e('0x32')](_0x3d9f7a[_0xcf2e('0x33')],qs[_0xcf2e('0x34')](_0x346cb4[_0xcf2e('0x2f')][_0xcf2e('0x34')]));_0x279f27[_0xcf2e('0x35')]=_0x279f27[_0xcf2e('0x35')][_0xcf2e('0x44')]?_0x279f27[_0xcf2e('0x35')]:_0x3d9f7a[_0xcf2e('0x33')];_0x279f27[_0xcf2e('0x38')]=qs[_0xcf2e('0x4c')](_0x346cb4[_0xcf2e('0x2f')][_0xcf2e('0x4c')]);_0x279f27['where']=qs[_0xcf2e('0x31')](_[_0xcf2e('0x4e')](_0x346cb4['query'],_0x3d9f7a[_0xcf2e('0x31')]));if(_0x346cb4[_0xcf2e('0x2f')]['filter']){_0x279f27[_0xcf2e('0x39')]=_['merge'](_0x279f27['where'],{'$or':_[_0xcf2e('0x29')](_0x279f27[_0xcf2e('0x35')],function(_0x5a0877){var _0x323e88={};_0x323e88[_0x5a0877]={'$like':'%'+_0x346cb4[_0xcf2e('0x2f')][_0xcf2e('0x3a')]+'%'};return _0x323e88;})});}_0x279f27=_[_0xcf2e('0x3c')]({},_0x279f27,_0x346cb4[_0xcf2e('0x4d')]);return _0x71114[_0xcf2e('0x4f')](_0x279f27);}})[_0xcf2e('0x22')](function(_0x3a66ea){if(_0x3a66ea){_0x39b95d=_0x3a66ea[_0xcf2e('0x44')];if(!_0x346cb4[_0xcf2e('0x2f')]['hasOwnProperty'](_0xcf2e('0x37'))){_0x279f27[_0xcf2e('0x1b')]=qs['limit'](_0x346cb4[_0xcf2e('0x2f')][_0xcf2e('0x1b')]);_0x279f27[_0xcf2e('0x1d')]=qs['offset'](_0x346cb4['query'][_0xcf2e('0x1d')]);}return _0x71114[_0xcf2e('0x4f')](_0x279f27);}})[_0xcf2e('0x22')](function(_0x1e15bb){if(_0x1e15bb){return _0x1e15bb?{'count':_0x39b95d,'rows':_0x1e15bb}:null;}})['then'](respondWithResult(_0x5e9e04,null))[_0xcf2e('0x41')](handleError(_0x5e9e04,null));};exports[_0xcf2e('0x50')]=function(_0xae4d9b,_0x49317a,_0x426ac2){var _0x2005f6={};var _0x3e2840={};var _0x231cc3;var _0x132cdd;return db[_0xcf2e('0x2a')]['findOne']({'where':{'id':_0xae4d9b[_0xcf2e('0x43')]['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x49317a,null))[_0xcf2e('0x22')](function(_0x12e9f4){if(_0x12e9f4){_0x231cc3=_0x12e9f4;_0x3e2840['model']=_['keys'](db[_0xcf2e('0x4b')]['rawAttributes']);_0x3e2840[_0xcf2e('0x2f')]=_[_0xcf2e('0x30')](_0xae4d9b[_0xcf2e('0x2f')]);_0x3e2840[_0xcf2e('0x31')]=_['intersection'](_0x3e2840[_0xcf2e('0x33')],_0x3e2840[_0xcf2e('0x2f')]);_0x2005f6['attributes']=_[_0xcf2e('0x32')](_0x3e2840['model'],qs['fields'](_0xae4d9b['query']['fields']));_0x2005f6[_0xcf2e('0x35')]=_0x2005f6['attributes'][_0xcf2e('0x44')]?_0x2005f6[_0xcf2e('0x35')]:_0x3e2840[_0xcf2e('0x33')];_0x2005f6[_0xcf2e('0x38')]=qs[_0xcf2e('0x4c')](_0xae4d9b[_0xcf2e('0x2f')][_0xcf2e('0x4c')]);_0x2005f6[_0xcf2e('0x39')]=qs[_0xcf2e('0x31')](_[_0xcf2e('0x4e')](_0xae4d9b[_0xcf2e('0x2f')],_0x3e2840[_0xcf2e('0x31')]));if(_0xae4d9b[_0xcf2e('0x2f')][_0xcf2e('0x3a')]){_0x2005f6[_0xcf2e('0x39')]=_['merge'](_0x2005f6[_0xcf2e('0x39')],{'$or':_['map'](_0x2005f6[_0xcf2e('0x35')],function(_0x19a739){var _0x5998e5={};_0x5998e5[_0x19a739]={'$like':'%'+_0xae4d9b['query']['filter']+'%'};return _0x5998e5;})});}_0x2005f6=_[_0xcf2e('0x3c')]({},_0x2005f6,_0xae4d9b[_0xcf2e('0x4d')]);return _0x231cc3[_0xcf2e('0x50')](_0x2005f6);}})[_0xcf2e('0x22')](function(_0x54608a){if(_0x54608a){_0x132cdd=_0x54608a[_0xcf2e('0x44')];if(!_0xae4d9b[_0xcf2e('0x2f')]['hasOwnProperty'](_0xcf2e('0x37'))){_0x2005f6[_0xcf2e('0x1b')]=qs[_0xcf2e('0x1b')](_0xae4d9b[_0xcf2e('0x2f')][_0xcf2e('0x1b')]);_0x2005f6[_0xcf2e('0x1d')]=qs[_0xcf2e('0x1d')](_0xae4d9b[_0xcf2e('0x2f')][_0xcf2e('0x1d')]);}return _0x231cc3[_0xcf2e('0x50')](_0x2005f6);}})[_0xcf2e('0x22')](function(_0x5b8058){if(_0x5b8058){return _0x5b8058?{'count':_0x132cdd,'rows':_0x5b8058}:null;}})[_0xcf2e('0x22')](respondWithResult(_0x49317a,null))[_0xcf2e('0x41')](handleError(_0x49317a,null));};exports[_0xcf2e('0x51')]=function(_0x4000cb,_0x5db3f0,_0x1e2b32){var _0x117e2f={};var _0x47c7cf={};var _0x39212c;var _0x38c596;return db[_0xcf2e('0x2a')]['findOne']({'where':{'id':_0x4000cb[_0xcf2e('0x43')]['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x5db3f0,null))[_0xcf2e('0x22')](function(_0x203e9e){if(_0x203e9e){_0x39212c=_0x203e9e;_0x47c7cf[_0xcf2e('0x33')]=_[_0xcf2e('0x30')](db[_0xcf2e('0x52')][_0xcf2e('0x2b')]);_0x47c7cf[_0xcf2e('0x2f')]=_[_0xcf2e('0x30')](_0x4000cb['query']);_0x47c7cf[_0xcf2e('0x31')]=_[_0xcf2e('0x32')](_0x47c7cf[_0xcf2e('0x33')],_0x47c7cf[_0xcf2e('0x2f')]);_0x117e2f[_0xcf2e('0x35')]=_[_0xcf2e('0x32')](_0x47c7cf[_0xcf2e('0x33')],qs[_0xcf2e('0x34')](_0x4000cb[_0xcf2e('0x2f')][_0xcf2e('0x34')]));_0x117e2f[_0xcf2e('0x35')]=_0x117e2f[_0xcf2e('0x35')][_0xcf2e('0x44')]?_0x117e2f[_0xcf2e('0x35')]:_0x47c7cf[_0xcf2e('0x33')];_0x117e2f[_0xcf2e('0x38')]=qs[_0xcf2e('0x4c')](_0x4000cb['query'][_0xcf2e('0x4c')]);_0x117e2f['where']=qs[_0xcf2e('0x31')](_['pick'](_0x4000cb['query'],_0x47c7cf['filters']));if(_0x4000cb[_0xcf2e('0x2f')]['filter']){_0x117e2f[_0xcf2e('0x39')]=_['merge'](_0x117e2f['where'],{'$or':_['map'](_0x117e2f[_0xcf2e('0x35')],function(_0x125904){var _0x5a078b={};_0x5a078b[_0x125904]={'$like':'%'+_0x4000cb[_0xcf2e('0x2f')]['filter']+'%'};return _0x5a078b;})});}_0x117e2f=_['merge']({},_0x117e2f,_0x4000cb[_0xcf2e('0x4d')]);return _0x39212c['getTags'](_0x117e2f);}})[_0xcf2e('0x22')](function(_0x37da33){if(_0x37da33){_0x38c596=_0x37da33[_0xcf2e('0x44')];if(!_0x4000cb['query'][_0xcf2e('0x36')](_0xcf2e('0x37'))){_0x117e2f['limit']=qs['limit'](_0x4000cb[_0xcf2e('0x2f')][_0xcf2e('0x1b')]);_0x117e2f['offset']=qs[_0xcf2e('0x1d')](_0x4000cb[_0xcf2e('0x2f')][_0xcf2e('0x1d')]);}return _0x39212c['getTags'](_0x117e2f);}})[_0xcf2e('0x22')](function(_0x1cfada){if(_0x1cfada){return _0x1cfada?{'count':_0x38c596,'rows':_0x1cfada}:null;}})[_0xcf2e('0x22')](respondWithResult(_0x5db3f0,null))[_0xcf2e('0x41')](handleError(_0x5db3f0,null));};exports[_0xcf2e('0x53')]=function(_0xf7a49f,_0x554e02,_0x279ce5){if(_0xf7a49f[_0xcf2e('0x47')]['id']){delete _0xf7a49f[_0xcf2e('0x47')]['id'];}return db[_0xcf2e('0x2a')][_0xcf2e('0x4a')]({'where':{'id':_0xf7a49f[_0xcf2e('0x43')]['id']}})[_0xcf2e('0x22')](handleEntityNotFound(_0x554e02,null))['then'](function(_0x56d12c){if(_0x56d12c){return _0x56d12c[_0xcf2e('0x53')](_0xf7a49f[_0xcf2e('0x47')][_0xcf2e('0x54')]||[]);}return null;})['then'](respondWithResult(_0x554e02,null))['catch'](handleError(_0x554e02,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 516f5d5..36eac5c 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 _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','int_zendesk_configurations'];(function(_0x51879d,_0x48a0b1){var _0x347ec5=function(_0x1934af){while(--_0x1934af){_0x51879d['push'](_0x51879d['shift']());}};_0x347ec5(++_0x48a0b1);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ZendeskConfiguration',attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ZendeskConfiguration'];(function(_0x3ba863,_0x2fef4c){var _0x730c9b=function(_0x464740){while(--_0x464740){_0x3ba863['push'](_0x3ba863['shift']());}};_0x730c9b(++_0x2fef4c);}(_0x8f4c,0x113));var _0xc8f4=function(_0x15d59a,_0x4b13c2){_0x15d59a=_0x15d59a-0x0;var _0x575cd5=_0x8f4c[_0x15d59a];return _0x575cd5;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),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 af0d733..f9a1af4 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 _0x8ac6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x232bd7,_0x247b6b){var _0x58310c=function(_0x562c13){while(--_0x562c13){_0x232bd7['push'](_0x232bd7['shift']());}};_0x58310c(++_0x247b6b);}(_0x8ac6,0x92));var _0x68ac=function(_0x219dbf,_0xd31643){_0x219dbf=_0x219dbf-0x0;var _0x584202=_0x8ac6[_0x219dbf];return _0x584202;};'use strict';var _=require(_0x68ac('0x0'));var util=require(_0x68ac('0x1'));var moment=require(_0x68ac('0x2'));var BPromise=require(_0x68ac('0x3'));var rs=require(_0x68ac('0x4'));var fs=require('fs');var Redis=require(_0x68ac('0x5'));var db=require(_0x68ac('0x6'))['db'];var utils=require(_0x68ac('0x7'));var logger=require('../../config/logger')(_0x68ac('0x8'));var config=require(_0x68ac('0x9'));var jayson=require(_0x68ac('0xa'));var client=jayson[_0x68ac('0xb')][_0x68ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb78fc7,_0xba3a40,_0x5514cf){return new BPromise(function(_0x203f46,_0x6fba7f){return client[_0x68ac('0xd')](_0xb78fc7,_0x5514cf)[_0x68ac('0xe')](function(_0x4c3aba){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xba3a40,_0x68ac('0xf'));logger['debug'](_0x68ac('0x10'),_0xba3a40,_0x68ac('0xf'),JSON[_0x68ac('0x11')](_0x4c3aba));if(_0x4c3aba[_0x68ac('0x12')]){if(_0x4c3aba[_0x68ac('0x12')][_0x68ac('0x13')]===0x1f4){logger[_0x68ac('0x12')](_0x68ac('0x14'),_0xba3a40,_0x4c3aba[_0x68ac('0x12')][_0x68ac('0x15')]);return _0x6fba7f(_0x4c3aba[_0x68ac('0x12')][_0x68ac('0x15')]);}logger[_0x68ac('0x12')](_0x68ac('0x14'),_0xba3a40,_0x4c3aba[_0x68ac('0x12')]['message']);return _0x203f46(_0x4c3aba['error'][_0x68ac('0x15')]);}else{logger[_0x68ac('0x16')](_0x68ac('0x14'),_0xba3a40,_0x68ac('0xf'));_0x203f46(_0x4c3aba[_0x68ac('0x17')][_0x68ac('0x15')]);}})[_0x68ac('0x18')](function(_0xee3f6f){logger[_0x68ac('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0xba3a40,_0xee3f6f);_0x6fba7f(_0xee3f6f);});});} \ No newline at end of file +var _0xcbd2=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x279c8c,_0x34ae3d){var _0x2bad1d=function(_0x1ec830){while(--_0x1ec830){_0x279c8c['push'](_0x279c8c['shift']());}};_0x2bad1d(++_0x34ae3d);}(_0xcbd2,0x101));var _0x2cbd=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0xcbd2[_0x35387d];return _0x3aba56;};'use strict';var _=require('lodash');var util=require(_0x2cbd('0x0'));var moment=require(_0x2cbd('0x1'));var BPromise=require(_0x2cbd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbd('0x3'))['db'];var utils=require(_0x2cbd('0x4'));var logger=require(_0x2cbd('0x5'))(_0x2cbd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2cbd('0x7')][_0x2cbd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x140146,_0x46bc83,_0x52995b){return new BPromise(function(_0x53f456,_0x4f3527){return client[_0x2cbd('0x9')](_0x140146,_0x52995b)[_0x2cbd('0xa')](function(_0x3479be){logger[_0x2cbd('0xb')](_0x2cbd('0xc'),_0x46bc83,_0x2cbd('0xd'));logger[_0x2cbd('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46bc83,_0x2cbd('0xd'),JSON[_0x2cbd('0xf')](_0x3479be));if(_0x3479be[_0x2cbd('0x10')]){if(_0x3479be[_0x2cbd('0x10')][_0x2cbd('0x11')]===0x1f4){logger['error'](_0x2cbd('0xc'),_0x46bc83,_0x3479be[_0x2cbd('0x10')][_0x2cbd('0x12')]);return _0x4f3527(_0x3479be[_0x2cbd('0x10')][_0x2cbd('0x12')]);}logger[_0x2cbd('0x10')](_0x2cbd('0xc'),_0x46bc83,_0x3479be['error'][_0x2cbd('0x12')]);return _0x53f456(_0x3479be[_0x2cbd('0x10')][_0x2cbd('0x12')]);}else{logger[_0x2cbd('0xb')](_0x2cbd('0xc'),_0x46bc83,_0x2cbd('0xd'));_0x53f456(_0x3479be['result'][_0x2cbd('0x12')]);}})[_0x2cbd('0x13')](function(_0x22ed40){logger[_0x2cbd('0x10')](_0x2cbd('0xc'),_0x46bc83,_0x22ed40);_0x4f3527(_0x22ed40);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7f1843e..3063630 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 _0x2ffa=['/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../config/environment','./intZendeskField.controller','isAuthenticated'];(function(_0x2b8b91,_0x3cab36){var _0xc6e4ce=function(_0x20b7ce){while(--_0x20b7ce){_0x2b8b91['push'](_0x2b8b91['shift']());}};_0xc6e4ce(++_0x3cab36);}(_0x2ffa,0x189));var _0xa2ff=function(_0x2ea9d4,_0x492718){_0x2ea9d4=_0x2ea9d4-0x0;var _0x469ac4=_0x2ffa[_0x2ea9d4];return _0x469ac4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa2ff('0x0'));var express=require(_0xa2ff('0x1'));var router=express[_0xa2ff('0x2')]();var fs_extra=require(_0xa2ff('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa2ff('0x4'));var controller=require(_0xa2ff('0x5'));router['get']('/',auth[_0xa2ff('0x6')](),controller['index']);router['get'](_0xa2ff('0x7'),auth[_0xa2ff('0x6')](),controller[_0xa2ff('0x8')]);router[_0xa2ff('0x9')]('/',auth['isAuthenticated'](),controller[_0xa2ff('0xa')]);router[_0xa2ff('0xb')](_0xa2ff('0x7'),auth[_0xa2ff('0x6')](),controller[_0xa2ff('0xc')]);router[_0xa2ff('0xd')]('/:id',auth[_0xa2ff('0x6')](),controller[_0xa2ff('0xe')]);module[_0xa2ff('0xf')]=router; \ No newline at end of file +var _0xa6b2=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x481844,_0x259b1f){var _0x2afc17=function(_0x3404d4){while(--_0x3404d4){_0x481844['push'](_0x481844['shift']());}};_0x2afc17(++_0x259b1f);}(_0xa6b2,0xaf));var _0x2a6b=function(_0x69c202,_0x59f36e){_0x69c202=_0x69c202-0x0;var _0x413774=_0xa6b2[_0x69c202];return _0x413774;};'use strict';var multer=require(_0x2a6b('0x0'));var util=require(_0x2a6b('0x1'));var path=require(_0x2a6b('0x2'));var timeout=require(_0x2a6b('0x3'));var express=require(_0x2a6b('0x4'));var router=express[_0x2a6b('0x5')]();var fs_extra=require(_0x2a6b('0x6'));var auth=require(_0x2a6b('0x7'));var interaction=require(_0x2a6b('0x8'));var config=require(_0x2a6b('0x9'));var controller=require(_0x2a6b('0xa'));router[_0x2a6b('0xb')]('/',auth[_0x2a6b('0xc')](),controller[_0x2a6b('0xd')]);router['get']('/:id',auth[_0x2a6b('0xc')](),controller['show']);router[_0x2a6b('0xe')]('/',auth[_0x2a6b('0xc')](),controller[_0x2a6b('0xf')]);router[_0x2a6b('0x10')]('/:id',auth[_0x2a6b('0xc')](),controller[_0x2a6b('0x11')]);router[_0x2a6b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2a6b('0x13')]);module[_0x2a6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7aeca8d..58ba9d0 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 _0xaa15=['variable','customVariable','keyValue','STRING','BOOLEAN','ENUM','string'];(function(_0x4ec550,_0xee9cf){var _0x1f24e3=function(_0x59d212){while(--_0x59d212){_0x4ec550['push'](_0x4ec550['shift']());}};_0x1f24e3(++_0xee9cf);}(_0xaa15,0x1d3));var _0x5aa1=function(_0x125250,_0x23ba4d){_0x125250=_0x125250-0x0;var _0x926c4c=_0xaa15[_0x125250];return _0x926c4c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5aa1('0x0')](_0x5aa1('0x1'),_0x5aa1('0x2'),_0x5aa1('0x3'),_0x5aa1('0x4'),'picklist'),'defaultValue':_0x5aa1('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5aa1('0x5')]},'keyType':{'type':Sequelize[_0x5aa1('0x0')](_0x5aa1('0x1'),_0x5aa1('0x2'),_0x5aa1('0x3'))},'keyContent':{'type':Sequelize[_0x5aa1('0x5')]},'idField':{'type':Sequelize[_0x5aa1('0x5')]},'nameField':{'type':Sequelize[_0x5aa1('0x5')]},'customField':{'type':Sequelize[_0x5aa1('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5aa1('0x5')]}}; \ No newline at end of file +var _0x25c2=['BOOLEAN','sequelize','exports','string','customVariable','picklist','STRING','ENUM','variable'];(function(_0x55e756,_0x16813d){var _0x1bae04=function(_0x4faf10){while(--_0x4faf10){_0x55e756['push'](_0x55e756['shift']());}};_0x1bae04(++_0x16813d);}(_0x25c2,0x10f));var _0x225c=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x25c2[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x225c('0x0'));module[_0x225c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x225c('0x2'),'variable',_0x225c('0x3'),'keyValue',_0x225c('0x4')),'defaultValue':_0x225c('0x2')},'content':{'type':Sequelize[_0x225c('0x5')]},'key':{'type':Sequelize[_0x225c('0x5')]},'keyType':{'type':Sequelize[_0x225c('0x6')](_0x225c('0x2'),_0x225c('0x7'),_0x225c('0x3'))},'keyContent':{'type':Sequelize[_0x225c('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x225c('0x5')]},'customField':{'type':Sequelize[_0x225c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x225c('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index cf7ac23..0bcf782 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 _0x7220=['set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','ZendeskField','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x46f690,_0x571be0){var _0x52319d=function(_0x21648d){while(--_0x21648d){_0x46f690['push'](_0x46f690['shift']());}};_0x52319d(++_0x571be0);}(_0x7220,0x14d));var _0x0722=function(_0x405372,_0x2276ed){_0x405372=_0x405372-0x0;var _0x3a5a9b=_0x7220[_0x405372];return _0x3a5a9b;};'use strict';var emlformat=require(_0x0722('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0722('0x1'));var jsonpatch=require(_0x0722('0x2'));var rp=require(_0x0722('0x3'));var moment=require(_0x0722('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0722('0x5'));var util=require('util');var path=require(_0x0722('0x6'));var sox=require(_0x0722('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0722('0x8'));var _=require(_0x0722('0x9'));var squel=require(_0x0722('0xa'));var crypto=require(_0x0722('0xb'));var jsforce=require(_0x0722('0xc'));var deskjs=require(_0x0722('0xd'));var toCsv=require(_0x0722('0xe'));var querystring=require(_0x0722('0xf'));var Papa=require(_0x0722('0x10'));var Redis=require(_0x0722('0x11'));var authService=require(_0x0722('0x12'));var qs=require(_0x0722('0x13'));var as=require(_0x0722('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0722('0x15'));var utils=require(_0x0722('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0722('0x17'));var db=require(_0x0722('0x18'))['db'];function respondWithStatusCode(_0x3ee2ee,_0x228fe0){_0x228fe0=_0x228fe0||0xcc;return function(_0x119003){if(_0x119003){return _0x3ee2ee['sendStatus'](_0x228fe0);}return _0x3ee2ee[_0x0722('0x19')](_0x228fe0)[_0x0722('0x1a')]();};}function respondWithResult(_0x2cca09,_0x1e750f){_0x1e750f=_0x1e750f||0xc8;return function(_0x1d59d4){if(_0x1d59d4){return _0x2cca09[_0x0722('0x19')](_0x1e750f)[_0x0722('0x1b')](_0x1d59d4);}};}function respondWithFilteredResult(_0xf4b291,_0x41b239){return function(_0x3f27d4){if(_0x3f27d4){var _0x2d993f=typeof _0x41b239[_0x0722('0x1c')]===_0x0722('0x1d')&&typeof _0x41b239[_0x0722('0x1e')]===_0x0722('0x1d');var _0x346f15=_0x3f27d4[_0x0722('0x1f')];var _0x3fee44=_0x2d993f?0x0:_0x41b239[_0x0722('0x1c')];var _0x3cdaa3=_0x2d993f?_0x3f27d4[_0x0722('0x1f')]:_0x41b239[_0x0722('0x1c')]+_0x41b239['limit'];var _0x17c71a;if(_0x3cdaa3>=_0x346f15){_0x3cdaa3=_0x346f15;_0x17c71a=0xc8;}else{_0x17c71a=0xce;}_0xf4b291[_0x0722('0x19')](_0x17c71a);return _0xf4b291[_0x0722('0x20')](_0x0722('0x21'),_0x3fee44+'-'+_0x3cdaa3+'/'+_0x346f15)[_0x0722('0x1b')](_0x3f27d4);}return null;};}function patchUpdates(_0x23bb85){return function(_0x5e9ad5){try{jsonpatch[_0x0722('0x22')](_0x5e9ad5,_0x23bb85,!![]);}catch(_0x276b2b){return BPromise['reject'](_0x276b2b);}return _0x5e9ad5[_0x0722('0x23')]();};}function saveUpdates(_0x4fc58a,_0x56f7f6){return function(_0x49314d){if(_0x49314d){return _0x49314d[_0x0722('0x24')](_0x4fc58a)['then'](function(_0xcf0b0d){return _0xcf0b0d;});}return null;};}function removeEntity(_0x2f8289,_0x3ada37){return function(_0x54c111){if(_0x54c111){return _0x54c111[_0x0722('0x25')]()[_0x0722('0x26')](function(){_0x2f8289[_0x0722('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443c99,_0x48d7d9){return function(_0x22cd3f){if(!_0x22cd3f){_0x443c99[_0x0722('0x27')](0x194);}return _0x22cd3f;};}function handleError(_0x578956,_0x2d6d80){_0x2d6d80=_0x2d6d80||0x1f4;return function(_0x7118e6){logger[_0x0722('0x28')](_0x7118e6[_0x0722('0x29')]);if(_0x7118e6['name']){delete _0x7118e6[_0x0722('0x2a')];}_0x578956[_0x0722('0x19')](_0x2d6d80)[_0x0722('0x2b')](_0x7118e6);};}exports['index']=function(_0x465bd8,_0x32da11){var _0x44bb4b={},_0x55210b={},_0x3a84f1={'count':0x0,'rows':[]};var _0x13095c=_['map'](db[_0x0722('0x2c')]['rawAttributes'],function(_0x42b02d){return{'name':_0x42b02d['fieldName'],'type':_0x42b02d['type'][_0x0722('0x2d')]};});_0x55210b[_0x0722('0x2e')]=_[_0x0722('0x2f')](_0x13095c,_0x0722('0x2a'));_0x55210b[_0x0722('0x30')]=_[_0x0722('0x31')](_0x465bd8[_0x0722('0x30')]);_0x55210b[_0x0722('0x32')]=_[_0x0722('0x33')](_0x55210b[_0x0722('0x2e')],_0x55210b['query']);_0x44bb4b['attributes']=_[_0x0722('0x33')](_0x55210b[_0x0722('0x2e')],qs[_0x0722('0x34')](_0x465bd8[_0x0722('0x30')][_0x0722('0x34')]));_0x44bb4b['attributes']=_0x44bb4b[_0x0722('0x35')][_0x0722('0x36')]?_0x44bb4b['attributes']:_0x55210b[_0x0722('0x2e')];if(!_0x465bd8[_0x0722('0x30')]['hasOwnProperty'](_0x0722('0x37'))){_0x44bb4b['limit']=qs[_0x0722('0x1e')](_0x465bd8[_0x0722('0x30')][_0x0722('0x1e')]);_0x44bb4b['offset']=qs['offset'](_0x465bd8[_0x0722('0x30')][_0x0722('0x1c')]);}_0x44bb4b[_0x0722('0x38')]=qs[_0x0722('0x39')](_0x465bd8[_0x0722('0x30')][_0x0722('0x39')]);_0x44bb4b['where']=qs[_0x0722('0x32')](_[_0x0722('0x3a')](_0x465bd8[_0x0722('0x30')],_0x55210b[_0x0722('0x32')]),_0x13095c);if(_0x465bd8[_0x0722('0x30')][_0x0722('0x3b')]){_0x44bb4b[_0x0722('0x3c')]=_[_0x0722('0x3d')](_0x44bb4b[_0x0722('0x3c')],{'$or':_[_0x0722('0x2f')](_0x13095c,function(_0x512cf0){if(_0x512cf0[_0x0722('0x3e')]!==_0x0722('0x3f')){var _0x3f1d39={};_0x3f1d39[_0x512cf0[_0x0722('0x2a')]]={'$like':'%'+_0x465bd8[_0x0722('0x30')]['filter']+'%'};return _0x3f1d39;}})});}_0x44bb4b=_[_0x0722('0x3d')]({},_0x44bb4b,_0x465bd8['options']);var _0x2b3ebd={'where':_0x44bb4b[_0x0722('0x3c')]};return db[_0x0722('0x2c')]['count'](_0x2b3ebd)['then'](function(_0x6f7fbc){_0x3a84f1[_0x0722('0x1f')]=_0x6f7fbc;if(_0x465bd8['query'][_0x0722('0x40')]){_0x44bb4b[_0x0722('0x41')]=[{'all':!![]}];}return db[_0x0722('0x2c')]['findAll'](_0x44bb4b);})['then'](function(_0x295777){_0x3a84f1[_0x0722('0x42')]=_0x295777;return _0x3a84f1;})['then'](respondWithFilteredResult(_0x32da11,_0x44bb4b))[_0x0722('0x43')](handleError(_0x32da11,null));};exports[_0x0722('0x44')]=function(_0x2e6ed7,_0x5d3a12){var _0x50d7f9={'raw':!![],'where':{'id':_0x2e6ed7[_0x0722('0x45')]['id']}},_0x44a72d={};_0x44a72d[_0x0722('0x2e')]=_[_0x0722('0x31')](db[_0x0722('0x2c')][_0x0722('0x46')]);_0x44a72d['query']=_[_0x0722('0x31')](_0x2e6ed7[_0x0722('0x30')]);_0x44a72d[_0x0722('0x32')]=_[_0x0722('0x33')](_0x44a72d[_0x0722('0x2e')],_0x44a72d[_0x0722('0x30')]);_0x50d7f9[_0x0722('0x35')]=_[_0x0722('0x33')](_0x44a72d[_0x0722('0x2e')],qs[_0x0722('0x34')](_0x2e6ed7['query'][_0x0722('0x34')]));_0x50d7f9['attributes']=_0x50d7f9['attributes'][_0x0722('0x36')]?_0x50d7f9[_0x0722('0x35')]:_0x44a72d[_0x0722('0x2e')];if(_0x2e6ed7[_0x0722('0x30')][_0x0722('0x40')]){_0x50d7f9[_0x0722('0x41')]=[{'all':!![]}];}_0x50d7f9=_[_0x0722('0x3d')]({},_0x50d7f9,_0x2e6ed7['options']);return db[_0x0722('0x2c')][_0x0722('0x47')](_0x50d7f9)[_0x0722('0x26')](handleEntityNotFound(_0x5d3a12,null))['then'](respondWithResult(_0x5d3a12,null))['catch'](handleError(_0x5d3a12,null));};exports['create']=function(_0x33afc8,_0x3ed868){return db[_0x0722('0x2c')]['create'](_0x33afc8['body'],{})[_0x0722('0x26')](respondWithResult(_0x3ed868,0xc9))[_0x0722('0x43')](handleError(_0x3ed868,null));};exports['update']=function(_0x873e8b,_0xe0b89e){if(_0x873e8b['body']['id']){delete _0x873e8b[_0x0722('0x48')]['id'];}return db['ZendeskField'][_0x0722('0x47')]({'where':{'id':_0x873e8b['params']['id']}})['then'](handleEntityNotFound(_0xe0b89e,null))[_0x0722('0x26')](saveUpdates(_0x873e8b['body'],null))[_0x0722('0x26')](respondWithResult(_0xe0b89e,null))[_0x0722('0x43')](handleError(_0xe0b89e,null));};exports[_0x0722('0x25')]=function(_0x5a8907,_0x4057b2){return db[_0x0722('0x2c')][_0x0722('0x47')]({'where':{'id':_0x5a8907['params']['id']}})[_0x0722('0x26')](handleEntityNotFound(_0x4057b2,null))['then'](removeEntity(_0x4057b2,null))[_0x0722('0x43')](handleError(_0x4057b2,null));}; \ No newline at end of file +var _0x6b83=['update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','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','apply','reject','save'];(function(_0x957bf,_0x4044fd){var _0x34dc6b=function(_0x10a65d){while(--_0x10a65d){_0x957bf['push'](_0x957bf['shift']());}};_0x34dc6b(++_0x4044fd);}(_0x6b83,0x103));var _0x36b8=function(_0x532634,_0x1963fa){_0x532634=_0x532634-0x0;var _0x4bc53f=_0x6b83[_0x532634];return _0x4bc53f;};'use strict';var emlformat=require(_0x36b8('0x0'));var rimraf=require(_0x36b8('0x1'));var zipdir=require(_0x36b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36b8('0x3'));var moment=require(_0x36b8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x36b8('0x5'));var path=require(_0x36b8('0x6'));var sox=require(_0x36b8('0x7'));var csv=require(_0x36b8('0x8'));var ejs=require(_0x36b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36b8('0xa'));var squel=require(_0x36b8('0xb'));var crypto=require('crypto');var jsforce=require(_0x36b8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x36b8('0x8'));var querystring=require(_0x36b8('0xd'));var Papa=require('papaparse');var Redis=require(_0x36b8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x36b8('0xf'));var as=require(_0x36b8('0x10'));var hardwareService=require(_0x36b8('0x11'));var logger=require(_0x36b8('0x12'))(_0x36b8('0x13'));var utils=require(_0x36b8('0x14'));var config=require(_0x36b8('0x15'));var licenseUtil=require(_0x36b8('0x16'));var db=require(_0x36b8('0x17'))['db'];function respondWithStatusCode(_0x648644,_0x21e092){_0x21e092=_0x21e092||0xcc;return function(_0x492710){if(_0x492710){return _0x648644[_0x36b8('0x18')](_0x21e092);}return _0x648644[_0x36b8('0x19')](_0x21e092)[_0x36b8('0x1a')]();};}function respondWithResult(_0x407119,_0x5cbeb6){_0x5cbeb6=_0x5cbeb6||0xc8;return function(_0x4488ca){if(_0x4488ca){return _0x407119['status'](_0x5cbeb6)[_0x36b8('0x1b')](_0x4488ca);}};}function respondWithFilteredResult(_0x921225,_0x21c8f0){return function(_0x2b39a9){if(_0x2b39a9){var _0x11e9f8=typeof _0x21c8f0[_0x36b8('0x1c')]===_0x36b8('0x1d')&&typeof _0x21c8f0[_0x36b8('0x1e')]===_0x36b8('0x1d');var _0x5cc07e=_0x2b39a9[_0x36b8('0x1f')];var _0xabe0b5=_0x11e9f8?0x0:_0x21c8f0[_0x36b8('0x1c')];var _0x37e33d=_0x11e9f8?_0x2b39a9['count']:_0x21c8f0[_0x36b8('0x1c')]+_0x21c8f0[_0x36b8('0x1e')];var _0x205938;if(_0x37e33d>=_0x5cc07e){_0x37e33d=_0x5cc07e;_0x205938=0xc8;}else{_0x205938=0xce;}_0x921225[_0x36b8('0x19')](_0x205938);return _0x921225[_0x36b8('0x20')](_0x36b8('0x21'),_0xabe0b5+'-'+_0x37e33d+'/'+_0x5cc07e)[_0x36b8('0x1b')](_0x2b39a9);}return null;};}function patchUpdates(_0x142358){return function(_0x57d45e){try{jsonpatch[_0x36b8('0x22')](_0x57d45e,_0x142358,!![]);}catch(_0x4f2e29){return BPromise[_0x36b8('0x23')](_0x4f2e29);}return _0x57d45e[_0x36b8('0x24')]();};}function saveUpdates(_0x493427,_0x16405e){return function(_0x5b2eba){if(_0x5b2eba){return _0x5b2eba[_0x36b8('0x25')](_0x493427)[_0x36b8('0x26')](function(_0x35a000){return _0x35a000;});}return null;};}function removeEntity(_0x2ed3bd,_0x4e4a47){return function(_0x3186d1){if(_0x3186d1){return _0x3186d1[_0x36b8('0x27')]()['then'](function(){_0x2ed3bd[_0x36b8('0x19')](0xcc)[_0x36b8('0x1a')]();});}};}function handleEntityNotFound(_0x12949a,_0x270e89){return function(_0x2015b2){if(!_0x2015b2){_0x12949a[_0x36b8('0x18')](0x194);}return _0x2015b2;};}function handleError(_0x3d6b79,_0x53b474){_0x53b474=_0x53b474||0x1f4;return function(_0xe5dd96){logger[_0x36b8('0x28')](_0xe5dd96[_0x36b8('0x29')]);if(_0xe5dd96[_0x36b8('0x2a')]){delete _0xe5dd96[_0x36b8('0x2a')];}_0x3d6b79['status'](_0x53b474)['send'](_0xe5dd96);};}exports[_0x36b8('0x2b')]=function(_0x383d49,_0x4aa1e1){var _0x57e006={},_0x154c9b={},_0xdda81e={'count':0x0,'rows':[]};var _0x7480f7=_[_0x36b8('0x2c')](db['ZendeskField'][_0x36b8('0x2d')],function(_0x5e5c5b){return{'name':_0x5e5c5b['fieldName'],'type':_0x5e5c5b[_0x36b8('0x2e')][_0x36b8('0x2f')]};});_0x154c9b['model']=_[_0x36b8('0x2c')](_0x7480f7,_0x36b8('0x2a'));_0x154c9b[_0x36b8('0x30')]=_[_0x36b8('0x31')](_0x383d49[_0x36b8('0x30')]);_0x154c9b[_0x36b8('0x32')]=_[_0x36b8('0x33')](_0x154c9b[_0x36b8('0x34')],_0x154c9b[_0x36b8('0x30')]);_0x57e006[_0x36b8('0x35')]=_[_0x36b8('0x33')](_0x154c9b[_0x36b8('0x34')],qs[_0x36b8('0x36')](_0x383d49[_0x36b8('0x30')][_0x36b8('0x36')]));_0x57e006[_0x36b8('0x35')]=_0x57e006[_0x36b8('0x35')]['length']?_0x57e006[_0x36b8('0x35')]:_0x154c9b[_0x36b8('0x34')];if(!_0x383d49[_0x36b8('0x30')][_0x36b8('0x37')]('nolimit')){_0x57e006[_0x36b8('0x1e')]=qs[_0x36b8('0x1e')](_0x383d49[_0x36b8('0x30')][_0x36b8('0x1e')]);_0x57e006[_0x36b8('0x1c')]=qs[_0x36b8('0x1c')](_0x383d49[_0x36b8('0x30')]['offset']);}_0x57e006[_0x36b8('0x38')]=qs['sort'](_0x383d49[_0x36b8('0x30')][_0x36b8('0x39')]);_0x57e006[_0x36b8('0x3a')]=qs[_0x36b8('0x32')](_[_0x36b8('0x3b')](_0x383d49[_0x36b8('0x30')],_0x154c9b['filters']),_0x7480f7);if(_0x383d49[_0x36b8('0x30')][_0x36b8('0x3c')]){_0x57e006[_0x36b8('0x3a')]=_[_0x36b8('0x3d')](_0x57e006[_0x36b8('0x3a')],{'$or':_['map'](_0x7480f7,function(_0x4fd97e){if(_0x4fd97e[_0x36b8('0x2e')]!==_0x36b8('0x3e')){var _0x364100={};_0x364100[_0x4fd97e[_0x36b8('0x2a')]]={'$like':'%'+_0x383d49[_0x36b8('0x30')]['filter']+'%'};return _0x364100;}})});}_0x57e006=_['merge']({},_0x57e006,_0x383d49[_0x36b8('0x3f')]);var _0x4daf57={'where':_0x57e006[_0x36b8('0x3a')]};return db[_0x36b8('0x40')][_0x36b8('0x1f')](_0x4daf57)[_0x36b8('0x26')](function(_0x2ed783){_0xdda81e[_0x36b8('0x1f')]=_0x2ed783;if(_0x383d49[_0x36b8('0x30')][_0x36b8('0x41')]){_0x57e006[_0x36b8('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x36b8('0x43')](_0x57e006);})['then'](function(_0x228ac6){_0xdda81e['rows']=_0x228ac6;return _0xdda81e;})[_0x36b8('0x26')](respondWithFilteredResult(_0x4aa1e1,_0x57e006))[_0x36b8('0x44')](handleError(_0x4aa1e1,null));};exports[_0x36b8('0x45')]=function(_0x13ad7a,_0x31410a){var _0x1893c5={'raw':!![],'where':{'id':_0x13ad7a['params']['id']}},_0x2ca9c0={};_0x2ca9c0[_0x36b8('0x34')]=_['keys'](db[_0x36b8('0x40')][_0x36b8('0x2d')]);_0x2ca9c0['query']=_[_0x36b8('0x31')](_0x13ad7a['query']);_0x2ca9c0['filters']=_['intersection'](_0x2ca9c0[_0x36b8('0x34')],_0x2ca9c0['query']);_0x1893c5[_0x36b8('0x35')]=_[_0x36b8('0x33')](_0x2ca9c0[_0x36b8('0x34')],qs[_0x36b8('0x36')](_0x13ad7a[_0x36b8('0x30')][_0x36b8('0x36')]));_0x1893c5[_0x36b8('0x35')]=_0x1893c5[_0x36b8('0x35')]['length']?_0x1893c5['attributes']:_0x2ca9c0[_0x36b8('0x34')];if(_0x13ad7a[_0x36b8('0x30')][_0x36b8('0x41')]){_0x1893c5['include']=[{'all':!![]}];}_0x1893c5=_[_0x36b8('0x3d')]({},_0x1893c5,_0x13ad7a['options']);return db['ZendeskField'][_0x36b8('0x46')](_0x1893c5)[_0x36b8('0x26')](handleEntityNotFound(_0x31410a,null))[_0x36b8('0x26')](respondWithResult(_0x31410a,null))[_0x36b8('0x44')](handleError(_0x31410a,null));};exports[_0x36b8('0x47')]=function(_0x1316de,_0x25b623){return db[_0x36b8('0x40')][_0x36b8('0x47')](_0x1316de[_0x36b8('0x48')],{})[_0x36b8('0x26')](respondWithResult(_0x25b623,0xc9))[_0x36b8('0x44')](handleError(_0x25b623,null));};exports[_0x36b8('0x25')]=function(_0x1eb084,_0xb1ab8a){if(_0x1eb084['body']['id']){delete _0x1eb084[_0x36b8('0x48')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x1eb084[_0x36b8('0x49')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0xb1ab8a,null))['then'](saveUpdates(_0x1eb084[_0x36b8('0x48')],null))[_0x36b8('0x26')](respondWithResult(_0xb1ab8a,null))['catch'](handleError(_0xb1ab8a,null));};exports[_0x36b8('0x27')]=function(_0x22864b,_0x107d80){return db['ZendeskField']['find']({'where':{'id':_0x22864b[_0x36b8('0x49')]['id']}})[_0x36b8('0x26')](handleEntityNotFound(_0x107d80,null))['then'](removeEntity(_0x107d80,null))[_0x36b8('0x44')](handleError(_0x107d80,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0c00961..6e9c66a 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 _0x21ad=['FieldId','lodash','moment','request-promise','path','rimraf','../../config/environment','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0xf0c56a,_0x5a0beb){var _0x23b4ac=function(_0x27a33f){while(--_0x27a33f){_0xf0c56a['push'](_0xf0c56a['shift']());}};_0x23b4ac(++_0x5a0beb);}(_0x21ad,0x9b));var _0xd21a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x21ad[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xd21a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd21a('0x1'));var BPromise=require('bluebird');var rp=require(_0xd21a('0x2'));var fs=require('fs');var path=require(_0xd21a('0x3'));var rimraf=require(_0xd21a('0x4'));var config=require(_0xd21a('0x5'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0xe72a6d,_0x12a910){return _0xe72a6d['define'](_0xd21a('0x6'),attributes,{'tableName':_0xd21a('0x7'),'paranoid':![],'indexes':[{'name':_0xd21a('0x8'),'fields':[_0xd21a('0x9'),_0xd21a('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4db=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x51b832,_0x533f84){var _0xefa7f1=function(_0x19af06){while(--_0x19af06){_0x51b832['push'](_0x51b832['shift']());}};_0xefa7f1(++_0x533f84);}(_0xc4db,0xb9));var _0xbc4d=function(_0x50695e,_0x2c90c2){_0x50695e=_0x50695e-0x0;var _0x54caae=_0xc4db[_0x50695e];return _0x54caae;};'use strict';var _=require(_0xbc4d('0x0'));var util=require(_0xbc4d('0x1'));var logger=require(_0xbc4d('0x2'))(_0xbc4d('0x3'));var moment=require(_0xbc4d('0x4'));var BPromise=require(_0xbc4d('0x5'));var rp=require(_0xbc4d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc4d('0x7'));var config=require(_0xbc4d('0x8'));var attributes=require(_0xbc4d('0x9'));module[_0xbc4d('0xa')]=function(_0x19f9a6,_0x4bcb2c){return _0x19f9a6[_0xbc4d('0xb')](_0xbc4d('0xc'),attributes,{'tableName':_0xbc4d('0xd'),'paranoid':![],'indexes':[{'name':_0xbc4d('0xe'),'fields':['idField',_0xbc4d('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 6206319..b64e946 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 _0x1f91=['ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x2798a3,_0x141295){var _0x13a1e7=function(_0x57d290){while(--_0x57d290){_0x2798a3['push'](_0x2798a3['shift']());}};_0x13a1e7(++_0x141295);}(_0x1f91,0xe4));var _0x11f9=function(_0x4d8f8d,_0x1384c1){_0x4d8f8d=_0x4d8f8d-0x0;var _0x7eb23f=_0x1f91[_0x4d8f8d];return _0x7eb23f;};'use strict';var _=require(_0x11f9('0x0'));var util=require('util');var moment=require(_0x11f9('0x1'));var BPromise=require(_0x11f9('0x2'));var rs=require(_0x11f9('0x3'));var fs=require('fs');var Redis=require(_0x11f9('0x4'));var db=require(_0x11f9('0x5'))['db'];var utils=require(_0x11f9('0x6'));var logger=require(_0x11f9('0x7'))(_0x11f9('0x8'));var config=require(_0x11f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x11f9('0xa')][_0x11f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12fe39,_0x1b9afd,_0x5003a7){return new BPromise(function(_0x397eff,_0x43fe69){return client['request'](_0x12fe39,_0x5003a7)[_0x11f9('0xc')](function(_0x4bba9d){logger[_0x11f9('0xd')](_0x11f9('0xe'),_0x1b9afd,_0x11f9('0xf'));logger['debug'](_0x11f9('0x10'),_0x1b9afd,_0x11f9('0xf'),JSON[_0x11f9('0x11')](_0x4bba9d));if(_0x4bba9d[_0x11f9('0x12')]){if(_0x4bba9d['error']['code']===0x1f4){logger[_0x11f9('0x12')]('ZendeskField,\x20%s,\x20%s',_0x1b9afd,_0x4bba9d[_0x11f9('0x12')][_0x11f9('0x13')]);return _0x43fe69(_0x4bba9d[_0x11f9('0x12')]['message']);}logger['error'](_0x11f9('0xe'),_0x1b9afd,_0x4bba9d[_0x11f9('0x12')][_0x11f9('0x13')]);return _0x397eff(_0x4bba9d[_0x11f9('0x12')][_0x11f9('0x13')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x1b9afd,_0x11f9('0xf'));_0x397eff(_0x4bba9d[_0x11f9('0x14')][_0x11f9('0x13')]);}})[_0x11f9('0x15')](function(_0x4b043d){logger[_0x11f9('0x12')](_0x11f9('0xe'),_0x1b9afd,_0x4b043d);_0x43fe69(_0x4b043d);});});} \ No newline at end of file +var _0x97cf=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','result','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97cf,0xfd));var _0xf97c=function(_0x2b080,_0x26a48a){_0x2b080=_0x2b080-0x0;var _0x30401b=_0x97cf[_0x2b080];return _0x30401b;};'use strict';var _=require(_0xf97c('0x0'));var util=require(_0xf97c('0x1'));var moment=require(_0xf97c('0x2'));var BPromise=require(_0xf97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf97c('0x4'));var db=require(_0xf97c('0x5'))['db'];var utils=require(_0xf97c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf97c('0x7'));var jayson=require(_0xf97c('0x8'));var client=jayson[_0xf97c('0x9')][_0xf97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd924ba,_0x11de25,_0x4e21dd){return new BPromise(function(_0x130d00,_0x5ec776){return client[_0xf97c('0xb')](_0xd924ba,_0x4e21dd)[_0xf97c('0xc')](function(_0x5726b4){logger[_0xf97c('0xd')]('ZendeskField,\x20%s,\x20%s',_0x11de25,_0xf97c('0xe'));logger[_0xf97c('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x11de25,'request\x20sent',JSON[_0xf97c('0x10')](_0x5726b4));if(_0x5726b4[_0xf97c('0x11')]){if(_0x5726b4[_0xf97c('0x11')][_0xf97c('0x12')]===0x1f4){logger[_0xf97c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x11de25,_0x5726b4[_0xf97c('0x11')][_0xf97c('0x13')]);return _0x5ec776(_0x5726b4[_0xf97c('0x11')][_0xf97c('0x13')]);}logger[_0xf97c('0x11')](_0xf97c('0x14'),_0x11de25,_0x5726b4[_0xf97c('0x11')]['message']);return _0x130d00(_0x5726b4['error']['message']);}else{logger[_0xf97c('0xd')](_0xf97c('0x14'),_0x11de25,'request\x20sent');_0x130d00(_0x5726b4[_0xf97c('0x15')][_0xf97c('0x13')]);}})[_0xf97c('0x16')](function(_0x50e554){logger[_0xf97c('0x11')](_0xf97c('0x14'),_0x11de25,_0x50e554);_0x5ec776(_0x50e554);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1c8be72..e551377 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 _0xea2f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xea2f,0x14d));var _0xfea2=function(_0xd076cf,_0xf8bc5b){_0xd076cf=_0xd076cf-0x0;var _0x43b7fb=_0xea2f[_0xd076cf];return _0x43b7fb;};'use strict';var multer=require(_0xfea2('0x0'));var util=require(_0xfea2('0x1'));var path=require(_0xfea2('0x2'));var timeout=require(_0xfea2('0x3'));var express=require(_0xfea2('0x4'));var router=express[_0xfea2('0x5')]();var fs_extra=require(_0xfea2('0x6'));var auth=require(_0xfea2('0x7'));var interaction=require(_0xfea2('0x8'));var config=require('../../config/environment');var controller=require(_0xfea2('0x9'));router[_0xfea2('0xa')]('/',auth[_0xfea2('0xb')](),controller['index']);router[_0xfea2('0xa')](_0xfea2('0xc'),auth[_0xfea2('0xb')](),controller[_0xfea2('0xd')]);router['get'](_0xfea2('0xe'),auth[_0xfea2('0xb')](),controller['getConfigurations']);router[_0xfea2('0xa')](_0xfea2('0xf'),auth['isAuthenticated'](),controller[_0xfea2('0x10')]);router[_0xfea2('0x11')]('/',auth[_0xfea2('0xb')](),controller[_0xfea2('0x12')]);router['post']('/:id/configurations',auth[_0xfea2('0xb')](),controller[_0xfea2('0x13')]);router[_0xfea2('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfea2('0x15')](_0xfea2('0xc'),auth[_0xfea2('0xb')](),controller[_0xfea2('0x16')]);module[_0xfea2('0x17')]=router; \ No newline at end of file +var _0xe3a2=['./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3a2,0x1de));var _0x2e3a=function(_0x21c231,_0x13623d){_0x21c231=_0x21c231-0x0;var _0x26a8f3=_0xe3a2[_0x21c231];return _0x26a8f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2e3a('0x0'));var timeout=require(_0x2e3a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2e3a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2e3a('0x3'));var config=require(_0x2e3a('0x4'));var controller=require(_0x2e3a('0x5'));router['get']('/',auth[_0x2e3a('0x6')](),controller[_0x2e3a('0x7')]);router[_0x2e3a('0x8')](_0x2e3a('0x9'),auth[_0x2e3a('0x6')](),controller[_0x2e3a('0xa')]);router[_0x2e3a('0x8')](_0x2e3a('0xb'),auth[_0x2e3a('0x6')](),controller[_0x2e3a('0xc')]);router[_0x2e3a('0x8')](_0x2e3a('0xd'),auth['isAuthenticated'](),controller[_0x2e3a('0xe')]);router[_0x2e3a('0xf')]('/',auth[_0x2e3a('0x6')](),controller[_0x2e3a('0x10')]);router['post'](_0x2e3a('0xb'),auth[_0x2e3a('0x6')](),controller[_0x2e3a('0x11')]);router[_0x2e3a('0x12')](_0x2e3a('0x9'),auth[_0x2e3a('0x6')](),controller['update']);router[_0x2e3a('0x13')](_0x2e3a('0x9'),auth[_0x2e3a('0x6')](),controller['destroy']);module[_0x2e3a('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 19d569f..d6c942b 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 _0xa9e0=['sequelize','exports','STRING'];(function(_0x2d7e09,_0x16be83){var _0x1ba707=function(_0x4d3063){while(--_0x4d3063){_0x2d7e09['push'](_0x2d7e09['shift']());}};_0x1ba707(++_0x16be83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x9a19,0x114));var _0x99a1=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0x9a19[_0x17a32f];return _0x15a293;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 26361d7..1babbf6 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 _0xcf44=['find','create','body','params','findOne','order','getConfigurations','addConfiguration','Subjects','getSubjects','getDescriptions','channel','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','response','error','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','push','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xcf44,0x133));var _0x4cf4=function(_0x4ed3f7,_0x2b2627){_0x4ed3f7=_0x4ed3f7-0x0;var _0xdfe8ee=_0xcf44[_0x4ed3f7];return _0xdfe8ee;};'use strict';var emlformat=require(_0x4cf4('0x0'));var rimraf=require(_0x4cf4('0x1'));var zipdir=require(_0x4cf4('0x2'));var jsonpatch=require(_0x4cf4('0x3'));var rp=require(_0x4cf4('0x4'));var moment=require(_0x4cf4('0x5'));var BPromise=require(_0x4cf4('0x6'));var Mustache=require(_0x4cf4('0x7'));var util=require(_0x4cf4('0x8'));var path=require(_0x4cf4('0x9'));var sox=require(_0x4cf4('0xa'));var csv=require(_0x4cf4('0xb'));var ejs=require(_0x4cf4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4cf4('0xd'));var crypto=require(_0x4cf4('0xe'));var jsforce=require(_0x4cf4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4cf4('0xb'));var querystring=require(_0x4cf4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4cf4('0x11'));var qs=require(_0x4cf4('0x12'));var as=require(_0x4cf4('0x13'));var hardwareService=require(_0x4cf4('0x14'));var logger=require(_0x4cf4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4cf4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cf4('0x17'))['db'];var integrations=require(_0x4cf4('0x18'));function respondWithStatusCode(_0x4cf420,_0x23e01b){_0x23e01b=_0x23e01b||0xcc;return function(_0x3c67c8){if(_0x3c67c8){return _0x4cf420[_0x4cf4('0x19')](_0x23e01b);}return _0x4cf420[_0x4cf4('0x1a')](_0x23e01b)[_0x4cf4('0x1b')]();};}function respondWithResult(_0x30364b,_0x52f044){_0x52f044=_0x52f044||0xc8;return function(_0x1acc64){if(_0x1acc64){return _0x30364b['status'](_0x52f044)[_0x4cf4('0x1c')](_0x1acc64);}};}function respondWithFilteredResult(_0x22f562,_0x5d97d1){return function(_0x36a14e){if(_0x36a14e){var _0x15e191=typeof _0x5d97d1[_0x4cf4('0x1d')]==='undefined'&&typeof _0x5d97d1[_0x4cf4('0x1e')]==='undefined';var _0xe46d60=_0x36a14e[_0x4cf4('0x1f')];var _0x1eabdf=_0x15e191?0x0:_0x5d97d1[_0x4cf4('0x1d')];var _0xdf1bb4=_0x15e191?_0x36a14e['count']:_0x5d97d1[_0x4cf4('0x1d')]+_0x5d97d1[_0x4cf4('0x1e')];var _0x20aca8;if(_0xdf1bb4>=_0xe46d60){_0xdf1bb4=_0xe46d60;_0x20aca8=0xc8;}else{_0x20aca8=0xce;}_0x22f562[_0x4cf4('0x1a')](_0x20aca8);return _0x22f562[_0x4cf4('0x20')](_0x4cf4('0x21'),_0x1eabdf+'-'+_0xdf1bb4+'/'+_0xe46d60)[_0x4cf4('0x1c')](_0x36a14e);}return null;};}function patchUpdates(_0x40329c){return function(_0x264841){try{jsonpatch[_0x4cf4('0x22')](_0x264841,_0x40329c,!![]);}catch(_0x4953a2){return BPromise['reject'](_0x4953a2);}return _0x264841[_0x4cf4('0x23')]();};}function saveUpdates(_0x2ee6a0,_0x4adefc){return function(_0x57e0ee){if(_0x57e0ee){return _0x57e0ee[_0x4cf4('0x24')](_0x2ee6a0)[_0x4cf4('0x25')](function(_0xc16fa9){return _0xc16fa9;});}return null;};}function removeEntity(_0x39a147,_0x5eda2e){return function(_0xc211a6){if(_0xc211a6){return _0xc211a6[_0x4cf4('0x26')]()[_0x4cf4('0x25')](function(){_0x39a147[_0x4cf4('0x1a')](0xcc)[_0x4cf4('0x1b')]();});}};}function handleEntityNotFound(_0x2cd9ce,_0xfc3aba){return function(_0x539444){if(!_0x539444){_0x2cd9ce[_0x4cf4('0x19')](0x194);}return _0x539444;};}function handleError(_0x2f9c61,_0x223095){_0x223095=_0x223095||0x1f4;return function(_0x3bbea7){logger['error'](_0x3bbea7[_0x4cf4('0x27')]);if(_0x3bbea7[_0x4cf4('0x28')]){delete _0x3bbea7[_0x4cf4('0x28')];}_0x2f9c61['status'](_0x223095)[_0x4cf4('0x29')](_0x3bbea7);};}exports['index']=function(_0xbbe01f,_0x47e8d4){var _0x209687={},_0x58a256={},_0x428a34={'count':0x0,'rows':[]};var _0x4d9b8e=_['map'](db[_0x4cf4('0x2a')][_0x4cf4('0x2b')],function(_0x428341){return{'name':_0x428341[_0x4cf4('0x2c')],'type':_0x428341[_0x4cf4('0x2d')][_0x4cf4('0x2e')]};});_0x58a256[_0x4cf4('0x2f')]=_[_0x4cf4('0x30')](_0x4d9b8e,_0x4cf4('0x28'));_0x58a256[_0x4cf4('0x31')]=_[_0x4cf4('0x32')](_0xbbe01f[_0x4cf4('0x31')]);_0x58a256[_0x4cf4('0x33')]=_['intersection'](_0x58a256[_0x4cf4('0x2f')],_0x58a256[_0x4cf4('0x31')]);_0x209687[_0x4cf4('0x34')]=_[_0x4cf4('0x35')](_0x58a256[_0x4cf4('0x2f')],qs[_0x4cf4('0x36')](_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x36')]));_0x209687['attributes']=_0x209687[_0x4cf4('0x34')][_0x4cf4('0x37')]?_0x209687[_0x4cf4('0x34')]:_0x58a256[_0x4cf4('0x2f')];if(!_0xbbe01f['query'][_0x4cf4('0x38')](_0x4cf4('0x39'))){_0x209687[_0x4cf4('0x1e')]=qs['limit'](_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x1e')]);_0x209687[_0x4cf4('0x1d')]=qs[_0x4cf4('0x1d')](_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x1d')]);}_0x209687['order']=qs[_0x4cf4('0x3a')](_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x3a')]);_0x209687[_0x4cf4('0x3b')]=qs[_0x4cf4('0x33')](_[_0x4cf4('0x3c')](_0xbbe01f[_0x4cf4('0x31')],_0x58a256[_0x4cf4('0x33')]),_0x4d9b8e);if(_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x3d')]){_0x209687[_0x4cf4('0x3b')]=_[_0x4cf4('0x3e')](_0x209687[_0x4cf4('0x3b')],{'$or':_[_0x4cf4('0x30')](_0x4d9b8e,function(_0x4d13a6){if(_0x4d13a6['type']!==_0x4cf4('0x3f')){var _0x429fe9={};_0x429fe9[_0x4d13a6[_0x4cf4('0x28')]]={'$like':'%'+_0xbbe01f[_0x4cf4('0x31')][_0x4cf4('0x3d')]+'%'};return _0x429fe9;}})});}_0x209687=_[_0x4cf4('0x3e')]({},_0x209687,_0xbbe01f[_0x4cf4('0x40')]);var _0x33fe5b={'where':_0x209687[_0x4cf4('0x3b')]};return db[_0x4cf4('0x2a')][_0x4cf4('0x1f')](_0x33fe5b)['then'](function(_0x261206){_0x428a34[_0x4cf4('0x1f')]=_0x261206;if(_0xbbe01f[_0x4cf4('0x31')]['includeAll']){_0x209687[_0x4cf4('0x41')]=[{'all':!![]}];}return db[_0x4cf4('0x2a')][_0x4cf4('0x42')](_0x209687);})[_0x4cf4('0x25')](function(_0x123ead){_0x428a34[_0x4cf4('0x43')]=_0x123ead;return _0x428a34;})[_0x4cf4('0x25')](respondWithFilteredResult(_0x47e8d4,_0x209687))[_0x4cf4('0x44')](handleError(_0x47e8d4,null));};exports[_0x4cf4('0x45')]=function(_0x5c3cfa,_0x1a087a){var _0x43abb7={'raw':![],'where':{'id':_0x5c3cfa['params']['id']}},_0x20f6dd={};_0x20f6dd[_0x4cf4('0x2f')]=_[_0x4cf4('0x32')](db[_0x4cf4('0x2a')][_0x4cf4('0x2b')]);_0x20f6dd['query']=_[_0x4cf4('0x32')](_0x5c3cfa[_0x4cf4('0x31')]);_0x20f6dd[_0x4cf4('0x33')]=_[_0x4cf4('0x35')](_0x20f6dd[_0x4cf4('0x2f')],_0x20f6dd[_0x4cf4('0x31')]);_0x43abb7[_0x4cf4('0x34')]=_[_0x4cf4('0x35')](_0x20f6dd['model'],qs[_0x4cf4('0x36')](_0x5c3cfa['query']['fields']));_0x43abb7[_0x4cf4('0x34')]=_0x43abb7[_0x4cf4('0x34')][_0x4cf4('0x37')]?_0x43abb7[_0x4cf4('0x34')]:_0x20f6dd['model'];if(_0x5c3cfa[_0x4cf4('0x31')][_0x4cf4('0x46')]){_0x43abb7[_0x4cf4('0x41')]=[{'all':!![]}];}_0x43abb7=_[_0x4cf4('0x3e')]({},_0x43abb7,_0x5c3cfa[_0x4cf4('0x40')]);return db[_0x4cf4('0x2a')][_0x4cf4('0x47')](_0x43abb7)[_0x4cf4('0x25')](handleEntityNotFound(_0x1a087a,null))[_0x4cf4('0x25')](respondWithResult(_0x1a087a,null))['catch'](handleError(_0x1a087a,null));};exports['create']=function(_0x5cb3da,_0x2fd533){return db[_0x4cf4('0x2a')][_0x4cf4('0x48')](_0x5cb3da[_0x4cf4('0x49')],{})[_0x4cf4('0x25')](respondWithResult(_0x2fd533,0xc9))[_0x4cf4('0x44')](handleError(_0x2fd533,null));};exports['update']=function(_0x1cf0d7,_0x35c323){if(_0x1cf0d7['body']['id']){delete _0x1cf0d7['body']['id'];}return db[_0x4cf4('0x2a')][_0x4cf4('0x47')]({'where':{'id':_0x1cf0d7[_0x4cf4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35c323,null))[_0x4cf4('0x25')](saveUpdates(_0x1cf0d7['body'],null))[_0x4cf4('0x25')](respondWithResult(_0x35c323,null))[_0x4cf4('0x44')](handleError(_0x35c323,null));};exports[_0x4cf4('0x26')]=function(_0x506e8f,_0x5b30e9){return db[_0x4cf4('0x2a')][_0x4cf4('0x47')]({'where':{'id':_0x506e8f['params']['id']}})[_0x4cf4('0x25')](handleEntityNotFound(_0x5b30e9,null))[_0x4cf4('0x25')](removeEntity(_0x5b30e9,null))[_0x4cf4('0x44')](handleError(_0x5b30e9,null));};exports['getConfigurations']=function(_0x38e593,_0x52a79e,_0x6d75fa){var _0x18d54a={};var _0x4475c4={};var _0x4d307b;var _0x4908c8;return db[_0x4cf4('0x2a')][_0x4cf4('0x4b')]({'where':{'id':_0x38e593[_0x4cf4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52a79e,null))[_0x4cf4('0x25')](function(_0x31e12b){if(_0x31e12b){_0x4d307b=_0x31e12b;_0x4475c4[_0x4cf4('0x2f')]=_[_0x4cf4('0x32')](db['ZohoConfiguration']['rawAttributes']);_0x4475c4[_0x4cf4('0x31')]=_[_0x4cf4('0x32')](_0x38e593['query']);_0x4475c4[_0x4cf4('0x33')]=_[_0x4cf4('0x35')](_0x4475c4[_0x4cf4('0x2f')],_0x4475c4[_0x4cf4('0x31')]);_0x18d54a[_0x4cf4('0x34')]=_[_0x4cf4('0x35')](_0x4475c4[_0x4cf4('0x2f')],qs[_0x4cf4('0x36')](_0x38e593['query'][_0x4cf4('0x36')]));_0x18d54a['attributes']=_0x18d54a['attributes'][_0x4cf4('0x37')]?_0x18d54a['attributes']:_0x4475c4[_0x4cf4('0x2f')];_0x18d54a[_0x4cf4('0x4c')]=qs[_0x4cf4('0x3a')](_0x38e593[_0x4cf4('0x31')]['sort']);_0x18d54a[_0x4cf4('0x3b')]=qs['filters'](_[_0x4cf4('0x3c')](_0x38e593[_0x4cf4('0x31')],_0x4475c4['filters']));if(_0x38e593[_0x4cf4('0x31')][_0x4cf4('0x3d')]){_0x18d54a[_0x4cf4('0x3b')]=_[_0x4cf4('0x3e')](_0x18d54a[_0x4cf4('0x3b')],{'$or':_[_0x4cf4('0x30')](_0x18d54a['attributes'],function(_0x58c0dc){var _0x2d677d={};_0x2d677d[_0x58c0dc]={'$like':'%'+_0x38e593[_0x4cf4('0x31')][_0x4cf4('0x3d')]+'%'};return _0x2d677d;})});}_0x18d54a=_[_0x4cf4('0x3e')]({},_0x18d54a,_0x38e593['options']);return _0x4d307b[_0x4cf4('0x4d')](_0x18d54a);}})[_0x4cf4('0x25')](function(_0x408ea2){if(_0x408ea2){_0x4908c8=_0x408ea2[_0x4cf4('0x37')];if(!_0x38e593[_0x4cf4('0x31')][_0x4cf4('0x38')](_0x4cf4('0x39'))){_0x18d54a['limit']=qs['limit'](_0x38e593[_0x4cf4('0x31')][_0x4cf4('0x1e')]);_0x18d54a[_0x4cf4('0x1d')]=qs[_0x4cf4('0x1d')](_0x38e593[_0x4cf4('0x31')]['offset']);}return _0x4d307b[_0x4cf4('0x4d')](_0x18d54a);}})[_0x4cf4('0x25')](function(_0x478721){if(_0x478721){return _0x478721?{'count':_0x4908c8,'rows':_0x478721}:null;}})[_0x4cf4('0x25')](respondWithResult(_0x52a79e,null))[_0x4cf4('0x44')](handleError(_0x52a79e,null));};exports[_0x4cf4('0x4e')]=function(_0xb97a9a,_0x488b3d,_0x19b419){if(_0xb97a9a[_0x4cf4('0x49')]['id']){delete _0xb97a9a[_0x4cf4('0x49')]['id'];}return db[_0x4cf4('0x2a')][_0x4cf4('0x4b')]({'where':{'id':_0xb97a9a[_0x4cf4('0x4a')]['id']}})[_0x4cf4('0x25')](handleEntityNotFound(_0x488b3d,null))[_0x4cf4('0x25')](function(_0x3593df){if(_0x3593df){_0xb97a9a['body']['AccountId']=_0x3593df['id'];_0xb97a9a['body'][_0x4cf4('0x4f')]=integrations[_0x4cf4('0x50')](_0xb97a9a[_0x4cf4('0x49')]['channel'],_0xb97a9a[_0x4cf4('0x49')][_0x4cf4('0x2d')]);_0xb97a9a[_0x4cf4('0x49')]['Descriptions']=integrations[_0x4cf4('0x51')](_0xb97a9a[_0x4cf4('0x49')][_0x4cf4('0x52')],_0xb97a9a[_0x4cf4('0x49')]['type']);return db[_0x4cf4('0x53')][_0x4cf4('0x48')](_0xb97a9a[_0x4cf4('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x4cf4('0x4f')},{'model':db[_0x4cf4('0x54')],'as':_0x4cf4('0x55')}]});}return null;})['then'](respondWithResult(_0x488b3d,null))[_0x4cf4('0x44')](handleError(_0x488b3d,null));};function getAccessToken(_0x303ecb){return new Promise(function(_0xf20a17,_0x228f0e){var _0x594ad1;switch(_0x303ecb[_0x4cf4('0x56')]){case'US':_0x594ad1='https://accounts.zoho.com';break;case'AU':_0x594ad1=_0x4cf4('0x57');break;case'EU':_0x594ad1='https://accounts.zoho.eu';break;case'IN':_0x594ad1='https://accounts.zoho.in';break;case'CN':_0x594ad1=_0x4cf4('0x58');break;default:_0x594ad1=_0x4cf4('0x59');break;}var _0x4bb4af={'method':'POST','uri':_0x594ad1+_0x4cf4('0x5a'),'qs':{'refresh_token':_0x303ecb[_0x4cf4('0x5b')],'client_id':_0x303ecb[_0x4cf4('0x5c')],'client_secret':_0x303ecb[_0x4cf4('0x5d')],'grant_type':_0x4cf4('0x5e')},'json':!![]};return rp(_0x4bb4af)[_0x4cf4('0x25')](function(_0x146ae2){if(_0x146ae2[_0x4cf4('0x5f')]){_0xf20a17(_0x146ae2[_0x4cf4('0x5f')]);}else{_0x228f0e(_0x4cf4('0x60'));}})[_0x4cf4('0x44')](function(_0x57e20d){_0x228f0e(_0x57e20d);});});}exports[_0x4cf4('0x61')]=function(_0xc4339f,_0x498993,_0xcc0ae){var _0x5e7146,_0x1584b2,_0x42819d,_0x115f92,_0x1d9c44;return db[_0x4cf4('0x2a')][_0x4cf4('0x4b')]({'where':{'id':_0xc4339f[_0x4cf4('0x4a')]['id']},'attributes':['id','host',_0x4cf4('0x56'),_0x4cf4('0x5c'),_0x4cf4('0x5d'),_0x4cf4('0x62'),_0x4cf4('0x63'),_0x4cf4('0x5b')]})[_0x4cf4('0x25')](handleEntityNotFound(_0x498993,null))[_0x4cf4('0x25')](function(_0x2b2371){_0x1d9c44=_0x2b2371;_0x5e7146=_0x1d9c44['host'];_0x1584b2=_0x5e7146===_0x4cf4('0x64')?'eu':_0x4cf4('0x65');_0x42819d=_0x1d9c44[_0x4cf4('0x62')];var _0x3a32a8=_0x42819d[_0x4cf4('0x66')](-0x1);if(_0x3a32a8==='/'||_0x3a32a8==='\x5c'||_0x3a32a8===':'){_0x42819d=_0x42819d[_0x4cf4('0x67')](0x0,_0x42819d[_0x4cf4('0x68')](_0x3a32a8));}if(!_0x1d9c44[_0x4cf4('0x5b')]){throw new Error(_0x4cf4('0x69'));}return getAccessToken(_0x1d9c44);})[_0x4cf4('0x25')](function(_0x4e2b1e){if(_0x4e2b1e){return rp({'method':'GET','uri':util[_0x4cf4('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1584b2),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4e2b1e},'json':!![]});}})[_0x4cf4('0x25')](function(_0x509583){if(_0x509583){if(_0x509583[_0x4cf4('0x6b')]&&_0x509583[_0x4cf4('0x6b')][_0x4cf4('0x6c')]){throw new Error(_0x509583[_0x4cf4('0x6b')][_0x4cf4('0x6c')][_0x4cf4('0x6d')]);}var _0x4237c0=[];var _0x28d637=[];var _0xfab75c=[_0x4cf4('0x6e'),'Subject',_0x4cf4('0x6f'),_0x4cf4('0x70'),_0x4cf4('0x71'),_0x4cf4('0x72'),_0x4cf4('0x73'),'Call_Type'];_0x28d637=_['remove'](_0x509583['fields'],function(_0x2d7c3e){return _0xfab75c[_0x4cf4('0x74')](_0x2d7c3e[_0x4cf4('0x75')]);});for(var _0x483a34=0x0;_0x483a34<_0x28d637['length'];_0x483a34++){if(_0x28d637[_0x483a34]['system_mandatory']===![]){_0x4237c0[_0x4cf4('0x76')]({'id':_0x28d637[_0x483a34]['id'],'name':_0x28d637[_0x483a34]['display_label'],'custom':_0x28d637[_0x483a34]['custom_field'],'options':_0x28d637[_0x483a34][_0x4cf4('0x77')]===_0x4cf4('0x78')&&_0x28d637[_0x483a34][_0x4cf4('0x79')][_0x4cf4('0x37')]>-0x1?_[_0x4cf4('0x30')](_0x28d637[_0x483a34]['pick_list_values'],function(_0x2531ef){return{'name':_0x2531ef,'value':_0x2531ef};}):[]});}}return{'count':_0x4237c0[_0x4cf4('0x37')],'rows':_0x4237c0};}else{return{'count':0x0,'rows':[]};}})[_0x4cf4('0x25')](respondWithResult(_0x498993,null))['catch'](function(_0x17f6d3){var _0x24d8f0=_0xc4339f[_0x4cf4('0x31')][_0x4cf4('0x7a')]?0x1f4:_0x17f6d3[_0x4cf4('0x7b')]||0x1f4;logger['error'](_0x4cf4('0x7c'),'getFields',_0x24d8f0,JSON[_0x4cf4('0x7d')](_0x17f6d3));delete _0x17f6d3[_0x4cf4('0x28')];if(_0x24d8f0===0x191){_0x24d8f0=0x190;}_0x498993[_0x4cf4('0x1a')](_0x24d8f0)[_0x4cf4('0x29')](_0xc4339f[_0x4cf4('0x31')][_0x4cf4('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x17f6d3[_0x4cf4('0x7b')]}:_0x17f6d3);});}; \ No newline at end of file +var _0x3eaf=['intersection','length','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientSecret','serverUrl','code','refreshToken','host','com','substring','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','error','Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','sendStatus','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','count','then','includeAll','include','findAll','rows','catch','params'];(function(_0x422f7d,_0x49945c){var _0x4ca436=function(_0x5081c2){while(--_0x5081c2){_0x422f7d['push'](_0x422f7d['shift']());}};_0x4ca436(++_0x49945c);}(_0x3eaf,0x143));var _0xf3ea=function(_0x250780,_0x4994e6){_0x250780=_0x250780-0x0;var _0x11f214=_0x3eaf[_0x250780];return _0x11f214;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3ea('0x0'));var zipdir=require(_0xf3ea('0x1'));var jsonpatch=require(_0xf3ea('0x2'));var rp=require(_0xf3ea('0x3'));var moment=require(_0xf3ea('0x4'));var BPromise=require(_0xf3ea('0x5'));var Mustache=require(_0xf3ea('0x6'));var util=require(_0xf3ea('0x7'));var path=require(_0xf3ea('0x8'));var sox=require(_0xf3ea('0x9'));var csv=require(_0xf3ea('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3ea('0xb'));var _=require(_0xf3ea('0xc'));var squel=require(_0xf3ea('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf3ea('0xe'));var toCsv=require(_0xf3ea('0xa'));var querystring=require('querystring');var Papa=require(_0xf3ea('0xf'));var Redis=require(_0xf3ea('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf3ea('0x11'));var as=require(_0xf3ea('0x12'));var hardwareService=require(_0xf3ea('0x13'));var logger=require('../../config/logger')(_0xf3ea('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3ea('0x15'));var db=require(_0xf3ea('0x16'))['db'];var integrations=require(_0xf3ea('0x17'));function respondWithStatusCode(_0xefc0e0,_0x5b7960){_0x5b7960=_0x5b7960||0xcc;return function(_0x14ebd0){if(_0x14ebd0){return _0xefc0e0['sendStatus'](_0x5b7960);}return _0xefc0e0['status'](_0x5b7960)[_0xf3ea('0x18')]();};}function respondWithResult(_0x9a232b,_0x2b320a){_0x2b320a=_0x2b320a||0xc8;return function(_0x1ad9b0){if(_0x1ad9b0){return _0x9a232b[_0xf3ea('0x19')](_0x2b320a)['json'](_0x1ad9b0);}};}function respondWithFilteredResult(_0x4b215a,_0x20126e){return function(_0x47f686){if(_0x47f686){var _0x142c1f=typeof _0x20126e[_0xf3ea('0x1a')]===_0xf3ea('0x1b')&&typeof _0x20126e[_0xf3ea('0x1c')]===_0xf3ea('0x1b');var _0x4c1160=_0x47f686['count'];var _0x2f54de=_0x142c1f?0x0:_0x20126e[_0xf3ea('0x1a')];var _0x27c121=_0x142c1f?_0x47f686['count']:_0x20126e[_0xf3ea('0x1a')]+_0x20126e['limit'];var _0x588d0d;if(_0x27c121>=_0x4c1160){_0x27c121=_0x4c1160;_0x588d0d=0xc8;}else{_0x588d0d=0xce;}_0x4b215a[_0xf3ea('0x19')](_0x588d0d);return _0x4b215a[_0xf3ea('0x1d')](_0xf3ea('0x1e'),_0x2f54de+'-'+_0x27c121+'/'+_0x4c1160)[_0xf3ea('0x1f')](_0x47f686);}return null;};}function patchUpdates(_0x35aa2a){return function(_0x28b945){try{jsonpatch[_0xf3ea('0x20')](_0x28b945,_0x35aa2a,!![]);}catch(_0x217b94){return BPromise[_0xf3ea('0x21')](_0x217b94);}return _0x28b945[_0xf3ea('0x22')]();};}function saveUpdates(_0x33575b,_0x30cff5){return function(_0x443eeb){if(_0x443eeb){return _0x443eeb['update'](_0x33575b)['then'](function(_0x3cb432){return _0x3cb432;});}return null;};}function removeEntity(_0x19c1a1,_0x456f0f){return function(_0x1f4ad6){if(_0x1f4ad6){return _0x1f4ad6[_0xf3ea('0x23')]()['then'](function(){_0x19c1a1[_0xf3ea('0x19')](0xcc)[_0xf3ea('0x18')]();});}};}function handleEntityNotFound(_0x3c09ad,_0x1938b6){return function(_0x3b75f7){if(!_0x3b75f7){_0x3c09ad[_0xf3ea('0x24')](0x194);}return _0x3b75f7;};}function handleError(_0x122648,_0x46bfb4){_0x46bfb4=_0x46bfb4||0x1f4;return function(_0x2cc589){logger['error'](_0x2cc589[_0xf3ea('0x25')]);if(_0x2cc589[_0xf3ea('0x26')]){delete _0x2cc589[_0xf3ea('0x26')];}_0x122648[_0xf3ea('0x19')](_0x46bfb4)[_0xf3ea('0x27')](_0x2cc589);};}exports[_0xf3ea('0x28')]=function(_0x2cb195,_0xdcf4da){var _0x3826f0={},_0x6ce67f={},_0x29bac4={'count':0x0,'rows':[]};var _0x1e2034=_['map'](db[_0xf3ea('0x29')][_0xf3ea('0x2a')],function(_0x12d4aa){return{'name':_0x12d4aa[_0xf3ea('0x2b')],'type':_0x12d4aa[_0xf3ea('0x2c')][_0xf3ea('0x2d')]};});_0x6ce67f['model']=_[_0xf3ea('0x2e')](_0x1e2034,'name');_0x6ce67f[_0xf3ea('0x2f')]=_[_0xf3ea('0x30')](_0x2cb195[_0xf3ea('0x2f')]);_0x6ce67f[_0xf3ea('0x31')]=_['intersection'](_0x6ce67f[_0xf3ea('0x32')],_0x6ce67f['query']);_0x3826f0['attributes']=_['intersection'](_0x6ce67f[_0xf3ea('0x32')],qs[_0xf3ea('0x33')](_0x2cb195['query']['fields']));_0x3826f0['attributes']=_0x3826f0[_0xf3ea('0x34')]['length']?_0x3826f0[_0xf3ea('0x34')]:_0x6ce67f[_0xf3ea('0x32')];if(!_0x2cb195[_0xf3ea('0x2f')][_0xf3ea('0x35')](_0xf3ea('0x36'))){_0x3826f0[_0xf3ea('0x1c')]=qs[_0xf3ea('0x1c')](_0x2cb195[_0xf3ea('0x2f')][_0xf3ea('0x1c')]);_0x3826f0[_0xf3ea('0x1a')]=qs['offset'](_0x2cb195[_0xf3ea('0x2f')]['offset']);}_0x3826f0[_0xf3ea('0x37')]=qs[_0xf3ea('0x38')](_0x2cb195['query']['sort']);_0x3826f0['where']=qs[_0xf3ea('0x31')](_[_0xf3ea('0x39')](_0x2cb195['query'],_0x6ce67f['filters']),_0x1e2034);if(_0x2cb195['query'][_0xf3ea('0x3a')]){_0x3826f0['where']=_['merge'](_0x3826f0['where'],{'$or':_[_0xf3ea('0x2e')](_0x1e2034,function(_0x467642){if(_0x467642[_0xf3ea('0x2c')]!=='VIRTUAL'){var _0x146aa7={};_0x146aa7[_0x467642['name']]={'$like':'%'+_0x2cb195[_0xf3ea('0x2f')][_0xf3ea('0x3a')]+'%'};return _0x146aa7;}})});}_0x3826f0=_[_0xf3ea('0x3b')]({},_0x3826f0,_0x2cb195[_0xf3ea('0x3c')]);var _0x6ae3c={'where':_0x3826f0[_0xf3ea('0x3d')]};return db[_0xf3ea('0x29')][_0xf3ea('0x3e')](_0x6ae3c)[_0xf3ea('0x3f')](function(_0x46f1ab){_0x29bac4[_0xf3ea('0x3e')]=_0x46f1ab;if(_0x2cb195[_0xf3ea('0x2f')][_0xf3ea('0x40')]){_0x3826f0[_0xf3ea('0x41')]=[{'all':!![]}];}return db[_0xf3ea('0x29')][_0xf3ea('0x42')](_0x3826f0);})[_0xf3ea('0x3f')](function(_0x5d2745){_0x29bac4[_0xf3ea('0x43')]=_0x5d2745;return _0x29bac4;})[_0xf3ea('0x3f')](respondWithFilteredResult(_0xdcf4da,_0x3826f0))[_0xf3ea('0x44')](handleError(_0xdcf4da,null));};exports['show']=function(_0x1cce1a,_0x557469){var _0x1abfd4={'raw':![],'where':{'id':_0x1cce1a[_0xf3ea('0x45')]['id']}},_0x2af7d7={};_0x2af7d7[_0xf3ea('0x32')]=_[_0xf3ea('0x30')](db['ZohoAccount'][_0xf3ea('0x2a')]);_0x2af7d7[_0xf3ea('0x2f')]=_[_0xf3ea('0x30')](_0x1cce1a[_0xf3ea('0x2f')]);_0x2af7d7[_0xf3ea('0x31')]=_[_0xf3ea('0x46')](_0x2af7d7[_0xf3ea('0x32')],_0x2af7d7['query']);_0x1abfd4[_0xf3ea('0x34')]=_['intersection'](_0x2af7d7[_0xf3ea('0x32')],qs[_0xf3ea('0x33')](_0x1cce1a['query'][_0xf3ea('0x33')]));_0x1abfd4[_0xf3ea('0x34')]=_0x1abfd4[_0xf3ea('0x34')][_0xf3ea('0x47')]?_0x1abfd4['attributes']:_0x2af7d7[_0xf3ea('0x32')];if(_0x1cce1a[_0xf3ea('0x2f')][_0xf3ea('0x40')]){_0x1abfd4['include']=[{'all':!![]}];}_0x1abfd4=_[_0xf3ea('0x3b')]({},_0x1abfd4,_0x1cce1a[_0xf3ea('0x3c')]);return db[_0xf3ea('0x29')][_0xf3ea('0x48')](_0x1abfd4)[_0xf3ea('0x3f')](handleEntityNotFound(_0x557469,null))[_0xf3ea('0x3f')](respondWithResult(_0x557469,null))[_0xf3ea('0x44')](handleError(_0x557469,null));};exports['create']=function(_0x47c01e,_0x50dd16){return db[_0xf3ea('0x29')][_0xf3ea('0x49')](_0x47c01e['body'],{})['then'](respondWithResult(_0x50dd16,0xc9))[_0xf3ea('0x44')](handleError(_0x50dd16,null));};exports['update']=function(_0x1171c0,_0x2db003){if(_0x1171c0[_0xf3ea('0x4a')]['id']){delete _0x1171c0[_0xf3ea('0x4a')]['id'];}return db[_0xf3ea('0x29')][_0xf3ea('0x48')]({'where':{'id':_0x1171c0['params']['id']}})[_0xf3ea('0x3f')](handleEntityNotFound(_0x2db003,null))[_0xf3ea('0x3f')](saveUpdates(_0x1171c0[_0xf3ea('0x4a')],null))[_0xf3ea('0x3f')](respondWithResult(_0x2db003,null))[_0xf3ea('0x44')](handleError(_0x2db003,null));};exports[_0xf3ea('0x23')]=function(_0x4959a2,_0x5d174a){return db[_0xf3ea('0x29')][_0xf3ea('0x48')]({'where':{'id':_0x4959a2['params']['id']}})[_0xf3ea('0x3f')](handleEntityNotFound(_0x5d174a,null))['then'](removeEntity(_0x5d174a,null))['catch'](handleError(_0x5d174a,null));};exports[_0xf3ea('0x4b')]=function(_0x46dbf9,_0x3346a7,_0x5d8742){var _0x418f0d={};var _0x396f26={};var _0x319f26;var _0x8afd12;return db['ZohoAccount'][_0xf3ea('0x4c')]({'where':{'id':_0x46dbf9[_0xf3ea('0x45')]['id']}})['then'](handleEntityNotFound(_0x3346a7,null))['then'](function(_0x3db571){if(_0x3db571){_0x319f26=_0x3db571;_0x396f26[_0xf3ea('0x32')]=_['keys'](db['ZohoConfiguration'][_0xf3ea('0x2a')]);_0x396f26[_0xf3ea('0x2f')]=_[_0xf3ea('0x30')](_0x46dbf9[_0xf3ea('0x2f')]);_0x396f26[_0xf3ea('0x31')]=_[_0xf3ea('0x46')](_0x396f26[_0xf3ea('0x32')],_0x396f26[_0xf3ea('0x2f')]);_0x418f0d['attributes']=_[_0xf3ea('0x46')](_0x396f26[_0xf3ea('0x32')],qs[_0xf3ea('0x33')](_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x33')]));_0x418f0d[_0xf3ea('0x34')]=_0x418f0d[_0xf3ea('0x34')][_0xf3ea('0x47')]?_0x418f0d[_0xf3ea('0x34')]:_0x396f26[_0xf3ea('0x32')];_0x418f0d[_0xf3ea('0x37')]=qs['sort'](_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x38')]);_0x418f0d['where']=qs[_0xf3ea('0x31')](_[_0xf3ea('0x39')](_0x46dbf9[_0xf3ea('0x2f')],_0x396f26[_0xf3ea('0x31')]));if(_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x3a')]){_0x418f0d[_0xf3ea('0x3d')]=_[_0xf3ea('0x3b')](_0x418f0d[_0xf3ea('0x3d')],{'$or':_['map'](_0x418f0d[_0xf3ea('0x34')],function(_0x448800){var _0x2ff3d6={};_0x2ff3d6[_0x448800]={'$like':'%'+_0x46dbf9[_0xf3ea('0x2f')]['filter']+'%'};return _0x2ff3d6;})});}_0x418f0d=_[_0xf3ea('0x3b')]({},_0x418f0d,_0x46dbf9[_0xf3ea('0x3c')]);return _0x319f26[_0xf3ea('0x4b')](_0x418f0d);}})[_0xf3ea('0x3f')](function(_0x35e38c){if(_0x35e38c){_0x8afd12=_0x35e38c[_0xf3ea('0x47')];if(!_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x35')]('nolimit')){_0x418f0d[_0xf3ea('0x1c')]=qs['limit'](_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x1c')]);_0x418f0d['offset']=qs[_0xf3ea('0x1a')](_0x46dbf9[_0xf3ea('0x2f')][_0xf3ea('0x1a')]);}return _0x319f26[_0xf3ea('0x4b')](_0x418f0d);}})[_0xf3ea('0x3f')](function(_0x438cd6){if(_0x438cd6){return _0x438cd6?{'count':_0x8afd12,'rows':_0x438cd6}:null;}})[_0xf3ea('0x3f')](respondWithResult(_0x3346a7,null))[_0xf3ea('0x44')](handleError(_0x3346a7,null));};exports[_0xf3ea('0x4d')]=function(_0x2df05a,_0x201c0b,_0x434f97){if(_0x2df05a['body']['id']){delete _0x2df05a[_0xf3ea('0x4a')]['id'];}return db[_0xf3ea('0x29')]['findOne']({'where':{'id':_0x2df05a[_0xf3ea('0x45')]['id']}})[_0xf3ea('0x3f')](handleEntityNotFound(_0x201c0b,null))[_0xf3ea('0x3f')](function(_0x51cc4d){if(_0x51cc4d){_0x2df05a['body'][_0xf3ea('0x4e')]=_0x51cc4d['id'];_0x2df05a[_0xf3ea('0x4a')][_0xf3ea('0x4f')]=integrations[_0xf3ea('0x50')](_0x2df05a[_0xf3ea('0x4a')][_0xf3ea('0x51')],_0x2df05a['body'][_0xf3ea('0x2c')]);_0x2df05a[_0xf3ea('0x4a')]['Descriptions']=integrations[_0xf3ea('0x52')](_0x2df05a[_0xf3ea('0x4a')][_0xf3ea('0x51')],_0x2df05a['body'][_0xf3ea('0x2c')]);return db[_0xf3ea('0x53')][_0xf3ea('0x49')](_0x2df05a['body'],{'include':[{'model':db[_0xf3ea('0x54')],'as':_0xf3ea('0x4f')},{'model':db[_0xf3ea('0x54')],'as':_0xf3ea('0x55')}]});}return null;})[_0xf3ea('0x3f')](respondWithResult(_0x201c0b,null))['catch'](handleError(_0x201c0b,null));};function getAccessToken(_0x5b2ff1){return new Promise(function(_0x521bab,_0x5281f5){var _0x4873f9;switch(_0x5b2ff1[_0xf3ea('0x56')]){case'US':_0x4873f9=_0xf3ea('0x57');break;case'AU':_0x4873f9=_0xf3ea('0x58');break;case'EU':_0x4873f9=_0xf3ea('0x59');break;case'IN':_0x4873f9='https://accounts.zoho.in';break;case'CN':_0x4873f9=_0xf3ea('0x5a');break;default:_0x4873f9='https://accounts.zoho.eu';break;}var _0x263893={'method':_0xf3ea('0x5b'),'uri':_0x4873f9+_0xf3ea('0x5c'),'qs':{'refresh_token':_0x5b2ff1['refreshToken'],'client_id':_0x5b2ff1[_0xf3ea('0x5d')],'client_secret':_0x5b2ff1['clientSecret'],'grant_type':_0xf3ea('0x5e')},'json':!![]};return rp(_0x263893)['then'](function(_0xed43f8){if(_0xed43f8[_0xf3ea('0x5f')]){_0x521bab(_0xed43f8['access_token']);}else{_0x5281f5(_0xf3ea('0x60'));}})[_0xf3ea('0x44')](function(_0x475168){_0x5281f5(_0x475168);});});}exports['getFields']=function(_0xbfc142,_0xabddf8,_0x26e314){var _0x5f0435,_0x428caa,_0x235583,_0x3221da,_0xe5c83d;return db[_0xf3ea('0x29')]['findOne']({'where':{'id':_0xbfc142[_0xf3ea('0x45')]['id']},'attributes':['id','host',_0xf3ea('0x56'),'clientId',_0xf3ea('0x61'),_0xf3ea('0x62'),_0xf3ea('0x63'),_0xf3ea('0x64')]})[_0xf3ea('0x3f')](handleEntityNotFound(_0xabddf8,null))[_0xf3ea('0x3f')](function(_0x3d8307){_0xe5c83d=_0x3d8307;_0x5f0435=_0xe5c83d[_0xf3ea('0x65')];_0x428caa=_0x5f0435==='zoho.eu'?'eu':_0xf3ea('0x66');_0x235583=_0xe5c83d[_0xf3ea('0x62')];var _0x50798c=_0x235583['slice'](-0x1);if(_0x50798c==='/'||_0x50798c==='\x5c'||_0x50798c===':'){_0x235583=_0x235583[_0xf3ea('0x67')](0x0,_0x235583[_0xf3ea('0x68')](_0x50798c));}if(!_0xe5c83d[_0xf3ea('0x64')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xe5c83d);})['then'](function(_0x3b98f9){if(_0x3b98f9){return rp({'method':_0xf3ea('0x69'),'uri':util[_0xf3ea('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x428caa),'qs':{'module':_0xf3ea('0x6b')},'headers':{'Authorization':_0xf3ea('0x6c')+_0x3b98f9},'json':!![]});}})[_0xf3ea('0x3f')](function(_0x3f0b9e){if(_0x3f0b9e){if(_0x3f0b9e[_0xf3ea('0x6d')]&&_0x3f0b9e[_0xf3ea('0x6d')][_0xf3ea('0x6e')]){throw new Error(_0x3f0b9e[_0xf3ea('0x6d')][_0xf3ea('0x6e')]['message']);}var _0x4338b0=[];var _0x51d1ba=[];var _0x5c117d=[_0xf3ea('0x6f'),'Subject',_0xf3ea('0x70'),_0xf3ea('0x71'),_0xf3ea('0x72'),'Call_Result',_0xf3ea('0x73'),_0xf3ea('0x74')];_0x51d1ba=_[_0xf3ea('0x75')](_0x3f0b9e[_0xf3ea('0x33')],function(_0x570511){return _0x5c117d[_0xf3ea('0x76')](_0x570511['api_name']);});for(var _0x2c6af2=0x0;_0x2c6af2<_0x51d1ba[_0xf3ea('0x47')];_0x2c6af2++){if(_0x51d1ba[_0x2c6af2]['system_mandatory']===![]){_0x4338b0[_0xf3ea('0x77')]({'id':_0x51d1ba[_0x2c6af2]['id'],'name':_0x51d1ba[_0x2c6af2][_0xf3ea('0x78')],'custom':_0x51d1ba[_0x2c6af2][_0xf3ea('0x79')],'options':_0x51d1ba[_0x2c6af2][_0xf3ea('0x7a')]===_0xf3ea('0x7b')&&_0x51d1ba[_0x2c6af2]['pick_list_values']['length']>-0x1?_[_0xf3ea('0x2e')](_0x51d1ba[_0x2c6af2][_0xf3ea('0x7c')],function(_0x3e2747){return{'name':_0x3e2747,'value':_0x3e2747};}):[]});}}return{'count':_0x4338b0[_0xf3ea('0x47')],'rows':_0x4338b0};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xabddf8,null))[_0xf3ea('0x44')](function(_0x51f681){var _0x564fd8=_0xbfc142[_0xf3ea('0x2f')][_0xf3ea('0x7d')]?0x1f4:_0x51f681[_0xf3ea('0x7e')]||0x1f4;logger[_0xf3ea('0x6e')](_0xf3ea('0x7f'),_0xf3ea('0x80'),_0x564fd8,JSON[_0xf3ea('0x81')](_0x51f681));delete _0x51f681[_0xf3ea('0x26')];if(_0x564fd8===0x191){_0x564fd8=0x190;}_0xabddf8['status'](_0x564fd8)[_0xf3ea('0x27')](_0xbfc142[_0xf3ea('0x2f')][_0xf3ea('0x7d')]?{'message':_0xf3ea('0x82'),'statusCode':_0x51f681[_0xf3ea('0x7e')]}:_0x51f681);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0040f3e..06df684 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 _0x2b49=['clientId','clientSecret','code','host','substring','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com.cn','refreshToken','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zoho_accounts','changed','serverUrl'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0x2b49,0x95));var _0x92b4=function(_0x1e821b,_0x10bf0f){_0x1e821b=_0x1e821b-0x0;var _0xc80b42=_0x2b49[_0x1e821b];return _0xc80b42;};'use strict';var _=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var logger=require(_0x92b4('0x2'))(_0x92b4('0x3'));var moment=require(_0x92b4('0x4'));var BPromise=require(_0x92b4('0x5'));var rp=require(_0x92b4('0x6'));var fs=require('fs');var path=require(_0x92b4('0x7'));var rimraf=require(_0x92b4('0x8'));var config=require(_0x92b4('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x92b4('0xa'));module[_0x92b4('0xb')]=function(_0x243d8f,_0x2e853f){return _0x243d8f['define']('ZohoAccount',attributes,{'tableName':_0x92b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17ae8e,_0x4369dd,_0x67aec9){if(_0x17ae8e[_0x92b4('0xd')]('zone')||_0x17ae8e[_0x92b4('0xd')](_0x92b4('0xe'))||_0x17ae8e[_0x92b4('0xd')](_0x92b4('0xf'))||_0x17ae8e[_0x92b4('0xd')](_0x92b4('0x10'))||_0x17ae8e[_0x92b4('0xd')](_0x92b4('0x11'))||_0x17ae8e[_0x92b4('0xd')](_0x92b4('0x12'))){var _0x5d9c5f,_0x68eae;_0x5d9c5f=_0x17ae8e[_0x92b4('0xe')];var _0x7c5244=_0x5d9c5f['slice'](-0x1);if(_0x7c5244==='/'||_0x7c5244==='\x5c'||_0x7c5244===':'){_0x5d9c5f=_0x5d9c5f[_0x92b4('0x13')](0x0,_0x5d9c5f['lastIndexOf'](_0x7c5244));}switch(_0x17ae8e[_0x92b4('0x14')]){case'US':_0x68eae='https://accounts.zoho.com';break;case'AU':_0x68eae=_0x92b4('0x15');break;case'IN':_0x68eae=_0x92b4('0x16');break;case'CN':_0x68eae='https://accounts.zoho.com.cn';break;default:_0x68eae=_0x92b4('0x17');break;}var _0x46f5cd={'method':_0x92b4('0x18'),'uri':_0x68eae+_0x92b4('0x19'),'form':{'grant_type':_0x92b4('0x1a'),'client_id':_0x17ae8e[_0x92b4('0xf')],'client_secret':_0x17ae8e['clientSecret'],'redirect_uri':_0x17ae8e['serverUrl'],'code':_0x17ae8e[_0x92b4('0x11')]},'headers':{'Content-Type':_0x92b4('0x1b')}};return rp(_0x46f5cd)[_0x92b4('0x1c')](function(_0x268285){var _0x286683=JSON[_0x92b4('0x1d')](_0x268285);if(_0x286683[_0x92b4('0x1e')]){_0x17ae8e['refreshToken']=_0x286683[_0x92b4('0x1e')];logger[_0x92b4('0x1f')](util[_0x92b4('0x20')](_0x92b4('0x21'),_0x17ae8e[_0x92b4('0x22')],_0x17ae8e['id']));}else{logger[_0x92b4('0x23')](util['format'](_0x92b4('0x24'),_0x17ae8e[_0x92b4('0x22')],_0x17ae8e['id']),util[_0x92b4('0x25')](_0x286683,{'showHidden':![],'depth':null}));}return _0x67aec9(null,_0x4369dd);})['catch'](function(_0x36d053){logger[_0x92b4('0x23')](util[_0x92b4('0x20')](_0x92b4('0x24'),_0x17ae8e['name'],_0x17ae8e['id']),util[_0x92b4('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x67aec9(_0x36d053);});}else{return _0x67aec9(null,_0x4369dd);}},'beforeUpdate':function(_0x245e06,_0x4b9ebc,_0x536a03){if(_0x245e06[_0x92b4('0xd')](_0x92b4('0x14'))||_0x245e06[_0x92b4('0xd')](_0x92b4('0xe'))||_0x245e06['changed'](_0x92b4('0xf'))||_0x245e06['changed'](_0x92b4('0x10'))||_0x245e06[_0x92b4('0xd')]('code')||_0x245e06[_0x92b4('0xd')](_0x92b4('0x12'))){var _0x1698c4,_0x18365c;_0x1698c4=_0x245e06[_0x92b4('0xe')];var _0x328002=_0x1698c4['slice'](-0x1);if(_0x328002==='/'||_0x328002==='\x5c'||_0x328002===':'){_0x1698c4=_0x1698c4['substring'](0x0,_0x1698c4['lastIndexOf'](_0x328002));}switch(_0x245e06[_0x92b4('0x14')]){case'US':_0x18365c='https://accounts.zoho.com';break;case'AU':_0x18365c='https://accounts.zoho.com.au';break;case'IN':_0x18365c=_0x92b4('0x16');break;case'CN':_0x18365c=_0x92b4('0x26');break;default:_0x18365c=_0x92b4('0x17');break;}var _0x48d4e4={'method':_0x92b4('0x18'),'uri':_0x18365c+_0x92b4('0x19'),'form':{'grant_type':_0x92b4('0x1a'),'client_id':_0x245e06[_0x92b4('0xf')],'client_secret':_0x245e06['clientSecret'],'redirect_uri':_0x245e06[_0x92b4('0xe')],'code':_0x245e06[_0x92b4('0x11')]},'headers':{'Content-Type':_0x92b4('0x1b')}};return rp(_0x48d4e4)[_0x92b4('0x1c')](function(_0xab516c){var _0x72ffe5=JSON['parse'](_0xab516c);if(_0x72ffe5[_0x92b4('0x1e')]){_0x245e06[_0x92b4('0x27')]=_0x72ffe5[_0x92b4('0x1e')];logger[_0x92b4('0x1f')](util['format'](_0x92b4('0x21'),_0x245e06[_0x92b4('0x22')],_0x245e06['id']));}else{logger[_0x92b4('0x23')](util[_0x92b4('0x20')](_0x92b4('0x24'),_0x245e06['name'],_0x245e06['id']),util['inspect'](_0x72ffe5,{'showHidden':![],'depth':null}));}return _0x536a03(null,_0x4b9ebc);})[_0x92b4('0x28')](function(_0x5e7289){logger[_0x92b4('0x23')](util[_0x92b4('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x245e06['name'],_0x245e06['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x536a03(_0x5e7289);});}else{return _0x536a03(null,_0x4b9ebc);}}}});}; \ No newline at end of file +var _0x35f3=['clientId','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','https://accounts.zoho.in','then','format','catch','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x35f3,0x98));var _0x335f=function(_0x248c97,_0x3e1c0c){_0x248c97=_0x248c97-0x0;var _0x18397b=_0x35f3[_0x248c97];return _0x18397b;};'use strict';var _=require(_0x335f('0x0'));var util=require('util');var logger=require(_0x335f('0x1'))(_0x335f('0x2'));var moment=require(_0x335f('0x3'));var BPromise=require('bluebird');var rp=require(_0x335f('0x4'));var fs=require('fs');var path=require(_0x335f('0x5'));var rimraf=require(_0x335f('0x6'));var config=require(_0x335f('0x7'));var attributes=require(_0x335f('0x8'));var integrations=require(_0x335f('0x9'));module[_0x335f('0xa')]=function(_0x56615c,_0x46f9e5){return _0x56615c[_0x335f('0xb')]('ZohoAccount',attributes,{'tableName':_0x335f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x266040,_0xbd2851,_0x1a4d16){if(_0x266040[_0x335f('0xd')](_0x335f('0xe'))||_0x266040[_0x335f('0xd')](_0x335f('0xf'))||_0x266040[_0x335f('0xd')](_0x335f('0x10'))||_0x266040[_0x335f('0xd')]('clientSecret')||_0x266040[_0x335f('0xd')](_0x335f('0x11'))||_0x266040[_0x335f('0xd')](_0x335f('0x12'))){var _0x1fd324,_0x18deef;_0x1fd324=_0x266040[_0x335f('0xf')];var _0x23d4b5=_0x1fd324[_0x335f('0x13')](-0x1);if(_0x23d4b5==='/'||_0x23d4b5==='\x5c'||_0x23d4b5===':'){_0x1fd324=_0x1fd324[_0x335f('0x14')](0x0,_0x1fd324[_0x335f('0x15')](_0x23d4b5));}switch(_0x266040[_0x335f('0xe')]){case'US':_0x18deef=_0x335f('0x16');break;case'AU':_0x18deef=_0x335f('0x17');break;case'IN':_0x18deef='https://accounts.zoho.in';break;case'CN':_0x18deef=_0x335f('0x18');break;default:_0x18deef=_0x335f('0x19');break;}var _0x478a97={'method':_0x335f('0x1a'),'uri':_0x18deef+_0x335f('0x1b'),'form':{'grant_type':_0x335f('0x1c'),'client_id':_0x266040[_0x335f('0x10')],'client_secret':_0x266040[_0x335f('0x1d')],'redirect_uri':_0x266040[_0x335f('0xf')],'code':_0x266040[_0x335f('0x11')]},'headers':{'Content-Type':_0x335f('0x1e')}};return rp(_0x478a97)['then'](function(_0x39574c){var _0x5854a9=JSON['parse'](_0x39574c);if(_0x5854a9[_0x335f('0x1f')]){_0x266040[_0x335f('0x20')]=_0x5854a9['refresh_token'];logger['info'](util['format'](_0x335f('0x21'),_0x266040['name'],_0x266040['id']));}else{logger[_0x335f('0x22')](util['format'](_0x335f('0x23'),_0x266040[_0x335f('0x24')],_0x266040['id']),util[_0x335f('0x25')](_0x5854a9,{'showHidden':![],'depth':null}));}return _0x1a4d16(null,_0xbd2851);})['catch'](function(_0x11a34a){logger[_0x335f('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x266040[_0x335f('0x24')],_0x266040['id']),util[_0x335f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1a4d16(_0x11a34a);});}else{return _0x1a4d16(null,_0xbd2851);}},'beforeUpdate':function(_0x3b461f,_0x5cc986,_0x2f521d){if(_0x3b461f[_0x335f('0xd')](_0x335f('0xe'))||_0x3b461f[_0x335f('0xd')](_0x335f('0xf'))||_0x3b461f['changed']('clientId')||_0x3b461f[_0x335f('0xd')](_0x335f('0x1d'))||_0x3b461f[_0x335f('0xd')](_0x335f('0x11'))||_0x3b461f['changed'](_0x335f('0x12'))){var _0x5c205b,_0x2bb065;_0x5c205b=_0x3b461f['serverUrl'];var _0x1d09a5=_0x5c205b['slice'](-0x1);if(_0x1d09a5==='/'||_0x1d09a5==='\x5c'||_0x1d09a5===':'){_0x5c205b=_0x5c205b['substring'](0x0,_0x5c205b['lastIndexOf'](_0x1d09a5));}switch(_0x3b461f[_0x335f('0xe')]){case'US':_0x2bb065=_0x335f('0x16');break;case'AU':_0x2bb065=_0x335f('0x17');break;case'IN':_0x2bb065=_0x335f('0x26');break;case'CN':_0x2bb065=_0x335f('0x18');break;default:_0x2bb065=_0x335f('0x19');break;}var _0x1b528b={'method':_0x335f('0x1a'),'uri':_0x2bb065+'/oauth/v2/token','form':{'grant_type':_0x335f('0x1c'),'client_id':_0x3b461f[_0x335f('0x10')],'client_secret':_0x3b461f[_0x335f('0x1d')],'redirect_uri':_0x3b461f[_0x335f('0xf')],'code':_0x3b461f[_0x335f('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1b528b)[_0x335f('0x27')](function(_0x4189da){var _0x8b6651=JSON['parse'](_0x4189da);if(_0x8b6651[_0x335f('0x1f')]){_0x3b461f[_0x335f('0x20')]=_0x8b6651[_0x335f('0x1f')];logger['info'](util[_0x335f('0x28')](_0x335f('0x21'),_0x3b461f[_0x335f('0x24')],_0x3b461f['id']));}else{logger[_0x335f('0x22')](util[_0x335f('0x28')](_0x335f('0x23'),_0x3b461f['name'],_0x3b461f['id']),util['inspect'](_0x8b6651,{'showHidden':![],'depth':null}));}return _0x2f521d(null,_0x5cc986);})[_0x335f('0x29')](function(_0x513ba9){logger['error'](util[_0x335f('0x28')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b461f['name'],_0x3b461f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2f521d(_0x513ba9);});}else{return _0x2f521d(null,_0x5cc986);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 80a1469..982a424 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 _0x2c91=['find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','limit','include','map','model','attributes','debug','stringify','ShowZohoAccount'];(function(_0x28b6a8,_0xfe5c71){var _0x2dd1c4=function(_0x2b6c21){while(--_0x2b6c21){_0x28b6a8['push'](_0x28b6a8['shift']());}};_0x2dd1c4(++_0xfe5c71);}(_0x2c91,0x158));var _0x12c9=function(_0x3ac599,_0x40c0ab){_0x3ac599=_0x3ac599-0x0;var _0x2b1b07=_0x2c91[_0x3ac599];return _0x2b1b07;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var moment=require(_0x12c9('0x2'));var BPromise=require(_0x12c9('0x3'));var rs=require(_0x12c9('0x4'));var fs=require('fs');var Redis=require(_0x12c9('0x5'));var db=require(_0x12c9('0x6'))['db'];var utils=require(_0x12c9('0x7'));var logger=require('../../config/logger')(_0x12c9('0x8'));var config=require(_0x12c9('0x9'));var jayson=require(_0x12c9('0xa'));var client=jayson[_0x12c9('0xb')][_0x12c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x170c17,_0x3e30ed,_0x55c40a){return new BPromise(function(_0x283633,_0x2cbffe){return client['request'](_0x170c17,_0x55c40a)[_0x12c9('0xd')](function(_0x397004){logger['info'](_0x12c9('0xe'),_0x3e30ed,_0x12c9('0xf'));logger['debug'](_0x12c9('0x10'),_0x3e30ed,_0x12c9('0xf'),JSON['stringify'](_0x397004));if(_0x397004[_0x12c9('0x11')]){if(_0x397004[_0x12c9('0x11')][_0x12c9('0x12')]===0x1f4){logger[_0x12c9('0x11')](_0x12c9('0xe'),_0x3e30ed,_0x397004[_0x12c9('0x11')]['message']);return _0x2cbffe(_0x397004[_0x12c9('0x11')][_0x12c9('0x13')]);}logger[_0x12c9('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3e30ed,_0x397004['error']['message']);return _0x283633(_0x397004['error']['message']);}else{logger[_0x12c9('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x3e30ed,_0x12c9('0xf'));_0x283633(_0x397004[_0x12c9('0x15')][_0x12c9('0x13')]);}})[_0x12c9('0x16')](function(_0x8caeda){logger['error'](_0x12c9('0xe'),_0x3e30ed,_0x8caeda);_0x2cbffe(_0x8caeda);});});}exports[_0x12c9('0x17')]=function(_0x1890d4){var _0x38c12e=this;return new Promise(function(_0x44e9af,_0x1def14){return db[_0x12c9('0x18')][_0x12c9('0x19')]({'raw':_0x1890d4['options']?_0x1890d4[_0x12c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1890d4[_0x12c9('0x1a')]?_0x1890d4[_0x12c9('0x1a')][_0x12c9('0x1b')]||null:null,'attributes':_0x1890d4[_0x12c9('0x1a')]?_0x1890d4[_0x12c9('0x1a')]['attributes']||null:null,'limit':_0x1890d4[_0x12c9('0x1a')]?_0x1890d4[_0x12c9('0x1a')][_0x12c9('0x1c')]||null:null,'include':_0x1890d4[_0x12c9('0x1a')]?_0x1890d4[_0x12c9('0x1a')][_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x1890d4[_0x12c9('0x1a')][_0x12c9('0x1d')],function(_0x2eecec){return{'model':db[_0x2eecec[_0x12c9('0x1f')]],'as':_0x2eecec['as'],'attributes':_0x2eecec['attributes'],'include':_0x2eecec[_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x2eecec[_0x12c9('0x1d')],function(_0x1aa6a8){return{'model':db[_0x1aa6a8[_0x12c9('0x1f')]],'as':_0x1aa6a8['as'],'attributes':_0x1aa6a8[_0x12c9('0x20')],'include':_0x1aa6a8[_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x1aa6a8[_0x12c9('0x1d')],function(_0x3ed911){return{'model':db[_0x3ed911[_0x12c9('0x1f')]],'as':_0x3ed911['as'],'attributes':_0x3ed911[_0x12c9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x12c9('0xd')](function(_0x2224ce){logger[_0x12c9('0x14')](_0x12c9('0x17'),_0x1890d4);logger[_0x12c9('0x21')](_0x12c9('0x17'),_0x1890d4,JSON[_0x12c9('0x22')](_0x2224ce));_0x44e9af(_0x2224ce);})[_0x12c9('0x16')](function(_0x5c02fb){logger[_0x12c9('0x11')](_0x12c9('0x17'),_0x5c02fb[_0x12c9('0x13')],_0x1890d4);_0x1def14(_0x38c12e[_0x12c9('0x11')](0x1f4,_0x5c02fb[_0x12c9('0x13')]));});});};exports[_0x12c9('0x23')]=function(_0x98660f){var _0x59ba1a=this;return new Promise(function(_0x179def,_0x35a37d){return db[_0x12c9('0x18')][_0x12c9('0x24')]({'raw':_0x98660f[_0x12c9('0x1a')]?_0x98660f['options'][_0x12c9('0x25')]===undefined?!![]:![]:!![],'where':_0x98660f['options']?_0x98660f[_0x12c9('0x1a')][_0x12c9('0x1b')]||null:null,'attributes':_0x98660f[_0x12c9('0x1a')]?_0x98660f[_0x12c9('0x1a')][_0x12c9('0x20')]||null:null,'include':_0x98660f[_0x12c9('0x1a')]?_0x98660f[_0x12c9('0x1a')][_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x98660f['options']['include'],function(_0x46bfc0){return{'model':db[_0x46bfc0[_0x12c9('0x1f')]],'as':_0x46bfc0['as'],'attributes':_0x46bfc0[_0x12c9('0x20')],'include':_0x46bfc0[_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x46bfc0[_0x12c9('0x1d')],function(_0x410841){return{'model':db[_0x410841['model']],'as':_0x410841['as'],'attributes':_0x410841[_0x12c9('0x20')],'include':_0x410841[_0x12c9('0x1d')]?_[_0x12c9('0x1e')](_0x410841['include'],function(_0x30221c){return{'model':db[_0x30221c[_0x12c9('0x1f')]],'as':_0x30221c['as'],'attributes':_0x30221c['attributes']};}):[]};}):[]};}):[]:[]})[_0x12c9('0xd')](function(_0x34dacd){logger[_0x12c9('0x14')]('ShowZohoAccount',_0x98660f);logger[_0x12c9('0x21')](_0x12c9('0x23'),_0x98660f,JSON[_0x12c9('0x22')](_0x34dacd));_0x179def(_0x34dacd);})[_0x12c9('0x16')](function(_0x2f4cf7){logger[_0x12c9('0x11')](_0x12c9('0x23'),_0x2f4cf7[_0x12c9('0x13')],_0x98660f);_0x35a37d(_0x59ba1a[_0x12c9('0x11')](0x1f4,_0x2f4cf7[_0x12c9('0x13')]));});});}; \ No newline at end of file +var _0x0755=['ZohoAccount','findAll','options','where','include','map','attributes','model','debug','ShowZohoAccount','find','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount'];(function(_0x251dec,_0x43e695){var _0x1ce120=function(_0x177ea1){while(--_0x177ea1){_0x251dec['push'](_0x251dec['shift']());}};_0x1ce120(++_0x43e695);}(_0x0755,0x7c));var _0x5075=function(_0x501d13,_0x3dee46){_0x501d13=_0x501d13-0x0;var _0x3e6d04=_0x0755[_0x501d13];return _0x3e6d04;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var moment=require(_0x5075('0x2'));var BPromise=require(_0x5075('0x3'));var rs=require(_0x5075('0x4'));var fs=require('fs');var Redis=require(_0x5075('0x5'));var db=require(_0x5075('0x6'))['db'];var utils=require(_0x5075('0x7'));var logger=require(_0x5075('0x8'))(_0x5075('0x9'));var config=require('../../config/environment');var jayson=require(_0x5075('0xa'));var client=jayson[_0x5075('0xb')][_0x5075('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e39f4,_0x57f9e8,_0x52bb37){return new BPromise(function(_0x4f882e,_0x41d88f){return client[_0x5075('0xd')](_0x2e39f4,_0x52bb37)['then'](function(_0x1782e9){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'),JSON[_0x5075('0xf')](_0x1782e9));if(_0x1782e9[_0x5075('0x10')]){if(_0x1782e9['error'][_0x5075('0x11')]===0x1f4){logger['error'](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x41d88f(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}logger[_0x5075('0x10')](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x4f882e(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}else{logger[_0x5075('0x14')](_0x5075('0x12'),_0x57f9e8,'request\x20sent');_0x4f882e(_0x1782e9[_0x5075('0x15')][_0x5075('0x13')]);}})[_0x5075('0x16')](function(_0x381b3b){logger[_0x5075('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x57f9e8,_0x381b3b);_0x41d88f(_0x381b3b);});});}exports[_0x5075('0x17')]=function(_0xc8b69a){var _0x4dbe45=this;return new Promise(function(_0x2159a8,_0x2beeaf){return db[_0x5075('0x18')][_0x5075('0x19')]({'raw':_0xc8b69a['options']?_0xc8b69a[_0x5075('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xc8b69a[_0x5075('0x1a')]?_0xc8b69a['options'][_0x5075('0x1b')]||null:null,'attributes':_0xc8b69a['options']?_0xc8b69a[_0x5075('0x1a')]['attributes']||null:null,'limit':_0xc8b69a[_0x5075('0x1a')]?_0xc8b69a[_0x5075('0x1a')]['limit']||null:null,'include':_0xc8b69a['options']?_0xc8b69a['options'][_0x5075('0x1c')]?_[_0x5075('0x1d')](_0xc8b69a[_0x5075('0x1a')][_0x5075('0x1c')],function(_0x1d7758){return{'model':db[_0x1d7758['model']],'as':_0x1d7758['as'],'attributes':_0x1d7758[_0x5075('0x1e')],'include':_0x1d7758[_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x1d7758['include'],function(_0x1f16cc){return{'model':db[_0x1f16cc[_0x5075('0x1f')]],'as':_0x1f16cc['as'],'attributes':_0x1f16cc['attributes'],'include':_0x1f16cc[_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x1f16cc[_0x5075('0x1c')],function(_0x38a4ea){return{'model':db[_0x38a4ea['model']],'as':_0x38a4ea['as'],'attributes':_0x38a4ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b3d0b){logger[_0x5075('0x14')]('GetZohoAccount',_0xc8b69a);logger[_0x5075('0x20')](_0x5075('0x17'),_0xc8b69a,JSON[_0x5075('0xf')](_0x3b3d0b));_0x2159a8(_0x3b3d0b);})['catch'](function(_0x264777){logger['error']('GetZohoAccount',_0x264777[_0x5075('0x13')],_0xc8b69a);_0x2beeaf(_0x4dbe45[_0x5075('0x10')](0x1f4,_0x264777[_0x5075('0x13')]));});});};exports[_0x5075('0x21')]=function(_0x5e87b0){var _0x362711=this;return new Promise(function(_0x1edab4,_0x8290e7){return db['ZohoAccount'][_0x5075('0x22')]({'raw':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x23')]===undefined?!![]:![]:!![],'where':_0x5e87b0['options']?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x1b')]||null:null,'attributes':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0['options'][_0x5075('0x1e')]||null:null,'include':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x5e87b0['options'][_0x5075('0x1c')],function(_0x305b99){return{'model':db[_0x305b99['model']],'as':_0x305b99['as'],'attributes':_0x305b99[_0x5075('0x1e')],'include':_0x305b99['include']?_['map'](_0x305b99['include'],function(_0x1a5e7c){return{'model':db[_0x1a5e7c[_0x5075('0x1f')]],'as':_0x1a5e7c['as'],'attributes':_0x1a5e7c[_0x5075('0x1e')],'include':_0x1a5e7c['include']?_[_0x5075('0x1d')](_0x1a5e7c['include'],function(_0x50c23d){return{'model':db[_0x50c23d[_0x5075('0x1f')]],'as':_0x50c23d['as'],'attributes':_0x50c23d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5075('0x24')](function(_0x1e0435){logger['info'](_0x5075('0x21'),_0x5e87b0);logger[_0x5075('0x20')](_0x5075('0x21'),_0x5e87b0,JSON['stringify'](_0x1e0435));_0x1edab4(_0x1e0435);})[_0x5075('0x16')](function(_0x32af7f){logger[_0x5075('0x10')](_0x5075('0x21'),_0x32af7f[_0x5075('0x13')],_0x5e87b0);_0x8290e7(_0x362711[_0x5075('0x10')](0x1f4,_0x32af7f[_0x5075('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 59b6a4b..fee3a91 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 _0x60f0=['getDescriptions','post','create','put','destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x26569d,_0x55d60a){var _0x4c7297=function(_0x32f1ff){while(--_0x32f1ff){_0x26569d['push'](_0x26569d['shift']());}};_0x4c7297(++_0x55d60a);}(_0x60f0,0x98));var _0x060f=function(_0x1e671f,_0x1c8a22){_0x1e671f=_0x1e671f-0x0;var _0x1e6ffb=_0x60f0[_0x1e671f];return _0x1e6ffb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x060f('0x0'));var timeout=require(_0x060f('0x1'));var express=require(_0x060f('0x2'));var router=express['Router']();var fs_extra=require(_0x060f('0x3'));var auth=require(_0x060f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x060f('0x5'));var controller=require(_0x060f('0x6'));router[_0x060f('0x7')]('/',auth[_0x060f('0x8')](),controller[_0x060f('0x9')]);router['get'](_0x060f('0xa'),auth['isAuthenticated'](),controller[_0x060f('0xb')]);router[_0x060f('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x060f('0xc')]);router[_0x060f('0x7')](_0x060f('0xd'),auth['isAuthenticated'](),controller[_0x060f('0xe')]);router['get'](_0x060f('0xf'),auth[_0x060f('0x8')](),controller[_0x060f('0x10')]);router[_0x060f('0x11')]('/',auth[_0x060f('0x8')](),controller[_0x060f('0x12')]);router[_0x060f('0x13')]('/:id',auth[_0x060f('0x8')](),controller['update']);router['delete'](_0x060f('0xa'),auth[_0x060f('0x8')](),controller[_0x060f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x30b3=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4a31fe,_0x3e67ae){var _0x40f4a9=function(_0x44b994){while(--_0x44b994){_0x4a31fe['push'](_0x4a31fe['shift']());}};_0x40f4a9(++_0x3e67ae);}(_0x30b3,0xc4));var _0x330b=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x30b3[_0x136619];return _0x38c4a5;};'use strict';var multer=require(_0x330b('0x0'));var util=require(_0x330b('0x1'));var path=require('path');var timeout=require(_0x330b('0x2'));var express=require(_0x330b('0x3'));var router=express[_0x330b('0x4')]();var fs_extra=require(_0x330b('0x5'));var auth=require(_0x330b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x330b('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x330b('0x8')]('/',auth[_0x330b('0x9')](),controller[_0x330b('0xa')]);router['get']('/:id',auth[_0x330b('0x9')](),controller[_0x330b('0xb')]);router[_0x330b('0x8')](_0x330b('0xc'),auth[_0x330b('0x9')](),controller[_0x330b('0xd')]);router[_0x330b('0x8')](_0x330b('0xe'),auth[_0x330b('0x9')](),controller['getSubjects']);router[_0x330b('0x8')](_0x330b('0xf'),auth['isAuthenticated'](),controller[_0x330b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x330b('0x11')]);router[_0x330b('0x12')](_0x330b('0x13'),auth['isAuthenticated'](),controller[_0x330b('0x14')]);router[_0x330b('0x15')](_0x330b('0x13'),auth[_0x330b('0x9')](),controller['destroy']);module[_0x330b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9c982ba..9edf3ff 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 _0x91f6=['nothing','ENUM','contact_lead','contact','STRING','lead'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x91f6,0x7c));var _0x691f=function(_0x2ae77b,_0x368e2c){_0x2ae77b=_0x2ae77b-0x0;var _0x25a4e1=_0x91f6[_0x2ae77b];return _0x25a4e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x691f('0x0')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x691f('0x1'),'contact',_0x691f('0x2')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x691f('0x3')](_0x691f('0x4'),_0x691f('0x5'),_0x691f('0x1')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x691f('0x0')]}}; \ No newline at end of file +var _0xbe62=['nothing','contact_lead','sequelize','ENUM','lead','contact'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xbe62,0xf8));var _0x2be6=function(_0xcf3b6d,_0x29bfb0){_0xcf3b6d=_0xcf3b6d-0x0;var _0x20af2f=_0xbe62[_0xcf3b6d];return _0x20af2f;};'use strict';var Sequelize=require(_0x2be6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x2be6('0x1')](_0x2be6('0x2'),_0x2be6('0x3'),_0x2be6('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x2be6('0x1')](_0x2be6('0x5'),'contact',_0x2be6('0x2')),'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 6930073..09519e5 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 _0x8f32=['params','fields','include','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','map','ZohoConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','findAll','rows','catch','show'];(function(_0x11277f,_0x37bb02){var _0x196686=function(_0x349021){while(--_0x349021){_0x11277f['push'](_0x11277f['shift']());}};_0x196686(++_0x37bb02);}(_0x8f32,0x14c));var _0x28f3=function(_0x2dddf9,_0x38f1fc){_0x2dddf9=_0x2dddf9-0x0;var _0x1312ea=_0x8f32[_0x2dddf9];return _0x1312ea;};'use strict';var emlformat=require(_0x28f3('0x0'));var rimraf=require(_0x28f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28f3('0x2'));var rp=require(_0x28f3('0x3'));var moment=require(_0x28f3('0x4'));var BPromise=require(_0x28f3('0x5'));var Mustache=require('mustache');var util=require(_0x28f3('0x6'));var path=require(_0x28f3('0x7'));var sox=require(_0x28f3('0x8'));var csv=require(_0x28f3('0x9'));var ejs=require(_0x28f3('0xa'));var fs=require('fs');var fs_extra=require(_0x28f3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x28f3('0xc'));var jsforce=require(_0x28f3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x28f3('0x9'));var querystring=require(_0x28f3('0xe'));var Papa=require(_0x28f3('0xf'));var Redis=require(_0x28f3('0x10'));var authService=require(_0x28f3('0x11'));var qs=require(_0x28f3('0x12'));var as=require(_0x28f3('0x13'));var hardwareService=require(_0x28f3('0x14'));var logger=require(_0x28f3('0x15'))(_0x28f3('0x16'));var utils=require(_0x28f3('0x17'));var config=require(_0x28f3('0x18'));var licenseUtil=require(_0x28f3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aecf7,_0x1474a8){_0x1474a8=_0x1474a8||0xcc;return function(_0x1b9d21){if(_0x1b9d21){return _0x1aecf7[_0x28f3('0x1a')](_0x1474a8);}return _0x1aecf7[_0x28f3('0x1b')](_0x1474a8)[_0x28f3('0x1c')]();};}function respondWithResult(_0x3116d3,_0x319628){_0x319628=_0x319628||0xc8;return function(_0x4be9c1){if(_0x4be9c1){return _0x3116d3['status'](_0x319628)[_0x28f3('0x1d')](_0x4be9c1);}};}function respondWithFilteredResult(_0x39cc6b,_0x11c74f){return function(_0x55ce40){if(_0x55ce40){var _0x25c2bd=typeof _0x11c74f[_0x28f3('0x1e')]===_0x28f3('0x1f')&&typeof _0x11c74f[_0x28f3('0x20')]===_0x28f3('0x1f');var _0x20e847=_0x55ce40['count'];var _0x3ff843=_0x25c2bd?0x0:_0x11c74f[_0x28f3('0x1e')];var _0x1e0032=_0x25c2bd?_0x55ce40['count']:_0x11c74f[_0x28f3('0x1e')]+_0x11c74f[_0x28f3('0x20')];var _0x33e546;if(_0x1e0032>=_0x20e847){_0x1e0032=_0x20e847;_0x33e546=0xc8;}else{_0x33e546=0xce;}_0x39cc6b[_0x28f3('0x1b')](_0x33e546);return _0x39cc6b[_0x28f3('0x21')](_0x28f3('0x22'),_0x3ff843+'-'+_0x1e0032+'/'+_0x20e847)['json'](_0x55ce40);}return null;};}function patchUpdates(_0x4139a2){return function(_0x3e7bc0){try{jsonpatch['apply'](_0x3e7bc0,_0x4139a2,!![]);}catch(_0x2b74cc){return BPromise[_0x28f3('0x23')](_0x2b74cc);}return _0x3e7bc0[_0x28f3('0x24')]();};}function saveUpdates(_0x387414,_0x52bc0b){return function(_0x1d85f7){if(_0x1d85f7){return _0x1d85f7[_0x28f3('0x25')](_0x387414)['then'](function(_0x3aa2e4){return _0x3aa2e4;});}return null;};}function removeEntity(_0x3f0763,_0x451170){return function(_0xb65a6b){if(_0xb65a6b){return _0xb65a6b[_0x28f3('0x26')]()['then'](function(){_0x3f0763[_0x28f3('0x1b')](0xcc)[_0x28f3('0x1c')]();});}};}function handleEntityNotFound(_0x289466,_0x4acbd6){return function(_0x460b5e){if(!_0x460b5e){_0x289466['sendStatus'](0x194);}return _0x460b5e;};}function handleError(_0x4681d9,_0x996e35){_0x996e35=_0x996e35||0x1f4;return function(_0x4f3124){logger[_0x28f3('0x27')](_0x4f3124[_0x28f3('0x28')]);if(_0x4f3124[_0x28f3('0x29')]){delete _0x4f3124[_0x28f3('0x29')];}_0x4681d9['status'](_0x996e35)[_0x28f3('0x2a')](_0x4f3124);};}exports['index']=function(_0x4d074c,_0x3e147c){var _0xbe4dee={},_0x497771={},_0x22b3f6={'count':0x0,'rows':[]};var _0x3d68b2=_[_0x28f3('0x2b')](db[_0x28f3('0x2c')][_0x28f3('0x2d')],function(_0x7902c6){return{'name':_0x7902c6['fieldName'],'type':_0x7902c6[_0x28f3('0x2e')]['key']};});_0x497771[_0x28f3('0x2f')]=_['map'](_0x3d68b2,_0x28f3('0x29'));_0x497771[_0x28f3('0x30')]=_[_0x28f3('0x31')](_0x4d074c[_0x28f3('0x30')]);_0x497771[_0x28f3('0x32')]=_['intersection'](_0x497771[_0x28f3('0x2f')],_0x497771[_0x28f3('0x30')]);_0xbe4dee['attributes']=_[_0x28f3('0x33')](_0x497771[_0x28f3('0x2f')],qs['fields'](_0x4d074c[_0x28f3('0x30')]['fields']));_0xbe4dee[_0x28f3('0x34')]=_0xbe4dee[_0x28f3('0x34')][_0x28f3('0x35')]?_0xbe4dee[_0x28f3('0x34')]:_0x497771[_0x28f3('0x2f')];if(!_0x4d074c[_0x28f3('0x30')]['hasOwnProperty'](_0x28f3('0x36'))){_0xbe4dee[_0x28f3('0x20')]=qs[_0x28f3('0x20')](_0x4d074c[_0x28f3('0x30')][_0x28f3('0x20')]);_0xbe4dee['offset']=qs[_0x28f3('0x1e')](_0x4d074c[_0x28f3('0x30')]['offset']);}_0xbe4dee[_0x28f3('0x37')]=qs[_0x28f3('0x38')](_0x4d074c[_0x28f3('0x30')][_0x28f3('0x38')]);_0xbe4dee[_0x28f3('0x39')]=qs['filters'](_[_0x28f3('0x3a')](_0x4d074c[_0x28f3('0x30')],_0x497771[_0x28f3('0x32')]),_0x3d68b2);if(_0x4d074c[_0x28f3('0x30')][_0x28f3('0x3b')]){_0xbe4dee[_0x28f3('0x39')]=_[_0x28f3('0x3c')](_0xbe4dee['where'],{'$or':_[_0x28f3('0x2b')](_0x3d68b2,function(_0x9f4c3c){if(_0x9f4c3c[_0x28f3('0x2e')]!=='VIRTUAL'){var _0x4fbfb6={};_0x4fbfb6[_0x9f4c3c[_0x28f3('0x29')]]={'$like':'%'+_0x4d074c[_0x28f3('0x30')][_0x28f3('0x3b')]+'%'};return _0x4fbfb6;}})});}_0xbe4dee=_[_0x28f3('0x3c')]({},_0xbe4dee,_0x4d074c[_0x28f3('0x3d')]);var _0x104dce={'where':_0xbe4dee[_0x28f3('0x39')]};return db['ZohoConfiguration']['count'](_0x104dce)[_0x28f3('0x3e')](function(_0x50b4da){_0x22b3f6['count']=_0x50b4da;if(_0x4d074c[_0x28f3('0x30')][_0x28f3('0x3f')]){_0xbe4dee['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x28f3('0x40')](_0xbe4dee);})[_0x28f3('0x3e')](function(_0x490457){_0x22b3f6[_0x28f3('0x41')]=_0x490457;return _0x22b3f6;})[_0x28f3('0x3e')](respondWithFilteredResult(_0x3e147c,_0xbe4dee))[_0x28f3('0x42')](handleError(_0x3e147c,null));};exports[_0x28f3('0x43')]=function(_0x2024ae,_0x3ec5ac){var _0x1f4199={'raw':![],'where':{'id':_0x2024ae[_0x28f3('0x44')]['id']}},_0x146ace={};_0x146ace['model']=_[_0x28f3('0x31')](db[_0x28f3('0x2c')][_0x28f3('0x2d')]);_0x146ace[_0x28f3('0x30')]=_['keys'](_0x2024ae[_0x28f3('0x30')]);_0x146ace[_0x28f3('0x32')]=_[_0x28f3('0x33')](_0x146ace[_0x28f3('0x2f')],_0x146ace[_0x28f3('0x30')]);_0x1f4199[_0x28f3('0x34')]=_['intersection'](_0x146ace['model'],qs['fields'](_0x2024ae['query'][_0x28f3('0x45')]));_0x1f4199[_0x28f3('0x34')]=_0x1f4199[_0x28f3('0x34')][_0x28f3('0x35')]?_0x1f4199[_0x28f3('0x34')]:_0x146ace[_0x28f3('0x2f')];if(_0x2024ae[_0x28f3('0x30')]['includeAll']){_0x1f4199[_0x28f3('0x46')]=[{'all':!![]}];}_0x1f4199=_['merge']({},_0x1f4199,_0x2024ae['options']);return db[_0x28f3('0x2c')][_0x28f3('0x47')](_0x1f4199)[_0x28f3('0x3e')](handleEntityNotFound(_0x3ec5ac,null))[_0x28f3('0x3e')](respondWithResult(_0x3ec5ac,null))[_0x28f3('0x42')](handleError(_0x3ec5ac,null));};exports[_0x28f3('0x48')]=function(_0x5c7eea,_0x5355e1){return db[_0x28f3('0x2c')][_0x28f3('0x48')](_0x5c7eea[_0x28f3('0x49')],{})[_0x28f3('0x3e')](respondWithResult(_0x5355e1,0xc9))[_0x28f3('0x42')](handleError(_0x5355e1,null));};exports[_0x28f3('0x25')]=function(_0x2963de,_0x1b3c2c){if(_0x2963de[_0x28f3('0x49')]['id']){delete _0x2963de[_0x28f3('0x49')]['id'];}return db[_0x28f3('0x2c')][_0x28f3('0x47')]({'where':{'id':_0x2963de[_0x28f3('0x44')]['id']}})[_0x28f3('0x3e')](handleEntityNotFound(_0x1b3c2c,null))[_0x28f3('0x3e')](saveUpdates(_0x2963de[_0x28f3('0x49')],null))[_0x28f3('0x3e')](respondWithResult(_0x1b3c2c,null))[_0x28f3('0x42')](handleError(_0x1b3c2c,null));};exports[_0x28f3('0x26')]=function(_0xf5f296,_0x158854){return db[_0x28f3('0x2c')][_0x28f3('0x47')]({'where':{'id':_0xf5f296[_0x28f3('0x44')]['id']}})['then'](handleEntityNotFound(_0x158854,null))[_0x28f3('0x3e')](removeEntity(_0x158854,null))[_0x28f3('0x42')](handleError(_0x158854,null));};exports[_0x28f3('0x4a')]=function(_0x3996c3,_0xaca5cc,_0x3f8c55){var _0x592aab={};var _0x197703={};var _0x3825e2;var _0x3066a5;return db[_0x28f3('0x2c')][_0x28f3('0x4b')]({'where':{'id':_0x3996c3['params']['id']}})[_0x28f3('0x3e')](handleEntityNotFound(_0xaca5cc,null))[_0x28f3('0x3e')](function(_0x4ab98f){if(_0x4ab98f){_0x3825e2=_0x4ab98f;_0x197703[_0x28f3('0x2f')]=_[_0x28f3('0x31')](db[_0x28f3('0x4c')][_0x28f3('0x2d')]);_0x197703['query']=_[_0x28f3('0x31')](_0x3996c3['query']);_0x197703[_0x28f3('0x32')]=_[_0x28f3('0x33')](_0x197703[_0x28f3('0x2f')],_0x197703[_0x28f3('0x30')]);_0x592aab[_0x28f3('0x34')]=_[_0x28f3('0x33')](_0x197703[_0x28f3('0x2f')],qs['fields'](_0x3996c3['query']['fields']));_0x592aab[_0x28f3('0x34')]=_0x592aab[_0x28f3('0x34')][_0x28f3('0x35')]?_0x592aab[_0x28f3('0x34')]:_0x197703[_0x28f3('0x2f')];_0x592aab[_0x28f3('0x37')]=qs[_0x28f3('0x38')](_0x3996c3[_0x28f3('0x30')][_0x28f3('0x38')]);_0x592aab[_0x28f3('0x39')]=qs[_0x28f3('0x32')](_['pick'](_0x3996c3[_0x28f3('0x30')],_0x197703[_0x28f3('0x32')]));if(_0x3996c3[_0x28f3('0x30')][_0x28f3('0x3b')]){_0x592aab[_0x28f3('0x39')]=_[_0x28f3('0x3c')](_0x592aab[_0x28f3('0x39')],{'$or':_[_0x28f3('0x2b')](_0x592aab[_0x28f3('0x34')],function(_0x56f1f2){var _0x4a1f68={};_0x4a1f68[_0x56f1f2]={'$like':'%'+_0x3996c3[_0x28f3('0x30')][_0x28f3('0x3b')]+'%'};return _0x4a1f68;})});}_0x592aab=_[_0x28f3('0x3c')]({},_0x592aab,_0x3996c3[_0x28f3('0x3d')]);return _0x3825e2['getFields'](_0x592aab);}})[_0x28f3('0x3e')](function(_0x42d89b){if(_0x42d89b){_0x3066a5=_0x42d89b[_0x28f3('0x35')];if(!_0x3996c3[_0x28f3('0x30')][_0x28f3('0x4d')](_0x28f3('0x36'))){_0x592aab[_0x28f3('0x20')]=qs[_0x28f3('0x20')](_0x3996c3[_0x28f3('0x30')][_0x28f3('0x20')]);_0x592aab[_0x28f3('0x1e')]=qs[_0x28f3('0x1e')](_0x3996c3[_0x28f3('0x30')][_0x28f3('0x1e')]);}return _0x3825e2[_0x28f3('0x4a')](_0x592aab);}})['then'](function(_0x2634b1){if(_0x2634b1){return _0x2634b1?{'count':_0x3066a5,'rows':_0x2634b1}:null;}})[_0x28f3('0x3e')](respondWithResult(_0xaca5cc,null))[_0x28f3('0x42')](handleError(_0xaca5cc,null));};exports[_0x28f3('0x4e')]=function(_0x22c0fe,_0x3f1ad4,_0x5702b0){var _0x3c9e38={};var _0x564109={};var _0x1c2b44;var _0x192d06;return db[_0x28f3('0x2c')][_0x28f3('0x4b')]({'where':{'id':_0x22c0fe[_0x28f3('0x44')]['id']}})[_0x28f3('0x3e')](handleEntityNotFound(_0x3f1ad4,null))[_0x28f3('0x3e')](function(_0x366484){if(_0x366484){_0x1c2b44=_0x366484;_0x564109[_0x28f3('0x2f')]=_[_0x28f3('0x31')](db[_0x28f3('0x4c')][_0x28f3('0x2d')]);_0x564109['query']=_[_0x28f3('0x31')](_0x22c0fe[_0x28f3('0x30')]);_0x564109[_0x28f3('0x32')]=_[_0x28f3('0x33')](_0x564109['model'],_0x564109[_0x28f3('0x30')]);_0x3c9e38[_0x28f3('0x34')]=_['intersection'](_0x564109[_0x28f3('0x2f')],qs[_0x28f3('0x45')](_0x22c0fe['query'][_0x28f3('0x45')]));_0x3c9e38['attributes']=_0x3c9e38[_0x28f3('0x34')][_0x28f3('0x35')]?_0x3c9e38['attributes']:_0x564109[_0x28f3('0x2f')];_0x3c9e38['order']=qs[_0x28f3('0x38')](_0x22c0fe['query']['sort']);_0x3c9e38[_0x28f3('0x39')]=qs['filters'](_[_0x28f3('0x3a')](_0x22c0fe['query'],_0x564109['filters']));if(_0x22c0fe['query'][_0x28f3('0x3b')]){_0x3c9e38[_0x28f3('0x39')]=_['merge'](_0x3c9e38[_0x28f3('0x39')],{'$or':_[_0x28f3('0x2b')](_0x3c9e38[_0x28f3('0x34')],function(_0x44bb00){var _0x3a8e2e={};_0x3a8e2e[_0x44bb00]={'$like':'%'+_0x22c0fe[_0x28f3('0x30')][_0x28f3('0x3b')]+'%'};return _0x3a8e2e;})});}_0x3c9e38=_[_0x28f3('0x3c')]({},_0x3c9e38,_0x22c0fe[_0x28f3('0x3d')]);return _0x1c2b44['getSubjects'](_0x3c9e38);}})[_0x28f3('0x3e')](function(_0x26dfca){if(_0x26dfca){_0x192d06=_0x26dfca['length'];if(!_0x22c0fe[_0x28f3('0x30')]['hasOwnProperty']('nolimit')){_0x3c9e38[_0x28f3('0x20')]=qs[_0x28f3('0x20')](_0x22c0fe['query'][_0x28f3('0x20')]);_0x3c9e38[_0x28f3('0x1e')]=qs['offset'](_0x22c0fe['query'][_0x28f3('0x1e')]);}return _0x1c2b44['getSubjects'](_0x3c9e38);}})[_0x28f3('0x3e')](function(_0x25a84c){if(_0x25a84c){return _0x25a84c?{'count':_0x192d06,'rows':_0x25a84c}:null;}})[_0x28f3('0x3e')](respondWithResult(_0x3f1ad4,null))[_0x28f3('0x42')](handleError(_0x3f1ad4,null));};exports[_0x28f3('0x4f')]=function(_0x21af77,_0x2a5a75,_0x3412c9){var _0x4c34fe={};var _0x216da5={};var _0x1ec558;var _0x464004;return db[_0x28f3('0x2c')][_0x28f3('0x4b')]({'where':{'id':_0x21af77[_0x28f3('0x44')]['id']}})[_0x28f3('0x3e')](handleEntityNotFound(_0x2a5a75,null))[_0x28f3('0x3e')](function(_0x4c6e13){if(_0x4c6e13){_0x1ec558=_0x4c6e13;_0x216da5[_0x28f3('0x2f')]=_['keys'](db['ZohoField'][_0x28f3('0x2d')]);_0x216da5['query']=_[_0x28f3('0x31')](_0x21af77[_0x28f3('0x30')]);_0x216da5[_0x28f3('0x32')]=_[_0x28f3('0x33')](_0x216da5[_0x28f3('0x2f')],_0x216da5['query']);_0x4c34fe['attributes']=_[_0x28f3('0x33')](_0x216da5[_0x28f3('0x2f')],qs[_0x28f3('0x45')](_0x21af77['query']['fields']));_0x4c34fe[_0x28f3('0x34')]=_0x4c34fe[_0x28f3('0x34')][_0x28f3('0x35')]?_0x4c34fe['attributes']:_0x216da5[_0x28f3('0x2f')];_0x4c34fe[_0x28f3('0x37')]=qs['sort'](_0x21af77[_0x28f3('0x30')]['sort']);_0x4c34fe[_0x28f3('0x39')]=qs[_0x28f3('0x32')](_[_0x28f3('0x3a')](_0x21af77[_0x28f3('0x30')],_0x216da5[_0x28f3('0x32')]));if(_0x21af77[_0x28f3('0x30')]['filter']){_0x4c34fe[_0x28f3('0x39')]=_[_0x28f3('0x3c')](_0x4c34fe['where'],{'$or':_[_0x28f3('0x2b')](_0x4c34fe[_0x28f3('0x34')],function(_0x1a4469){var _0x50c664={};_0x50c664[_0x1a4469]={'$like':'%'+_0x21af77['query'][_0x28f3('0x3b')]+'%'};return _0x50c664;})});}_0x4c34fe=_['merge']({},_0x4c34fe,_0x21af77[_0x28f3('0x3d')]);return _0x1ec558[_0x28f3('0x4f')](_0x4c34fe);}})[_0x28f3('0x3e')](function(_0x23677f){if(_0x23677f){_0x464004=_0x23677f[_0x28f3('0x35')];if(!_0x21af77[_0x28f3('0x30')][_0x28f3('0x4d')]('nolimit')){_0x4c34fe[_0x28f3('0x20')]=qs[_0x28f3('0x20')](_0x21af77['query']['limit']);_0x4c34fe[_0x28f3('0x1e')]=qs[_0x28f3('0x1e')](_0x21af77[_0x28f3('0x30')][_0x28f3('0x1e')]);}return _0x1ec558[_0x28f3('0x4f')](_0x4c34fe);}})[_0x28f3('0x3e')](function(_0x3209e0){if(_0x3209e0){return _0x3209e0?{'count':_0x464004,'rows':_0x3209e0}:null;}})[_0x28f3('0x3e')](respondWithResult(_0x2a5a75,null))[_0x28f3('0x42')](handleError(_0x2a5a75,null));}; \ No newline at end of file +var _0xb198=['map','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','update','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','send','index','ZohoConfiguration','rawAttributes','key'];(function(_0x2ced4f,_0x3e2bec){var _0x4cf01a=function(_0x1c0a08){while(--_0x1c0a08){_0x2ced4f['push'](_0x2ced4f['shift']());}};_0x4cf01a(++_0x3e2bec);}(_0xb198,0x10a));var _0x8b19=function(_0x363240,_0x230d4e){_0x363240=_0x363240-0x0;var _0x937893=_0xb198[_0x363240];return _0x937893;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b19('0x0'));var jsonpatch=require(_0x8b19('0x1'));var rp=require(_0x8b19('0x2'));var moment=require('moment');var BPromise=require(_0x8b19('0x3'));var Mustache=require('mustache');var util=require(_0x8b19('0x4'));var path=require(_0x8b19('0x5'));var sox=require('sox');var csv=require(_0x8b19('0x6'));var ejs=require(_0x8b19('0x7'));var fs=require('fs');var fs_extra=require(_0x8b19('0x8'));var _=require('lodash');var squel=require(_0x8b19('0x9'));var crypto=require(_0x8b19('0xa'));var jsforce=require(_0x8b19('0xb'));var deskjs=require(_0x8b19('0xc'));var toCsv=require(_0x8b19('0x6'));var querystring=require('querystring');var Papa=require(_0x8b19('0xd'));var Redis=require(_0x8b19('0xe'));var authService=require(_0x8b19('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8b19('0x10'));var hardwareService=require(_0x8b19('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8b19('0x12'));var config=require(_0x8b19('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b19('0x14'))['db'];function respondWithStatusCode(_0x3cd5e2,_0x11797f){_0x11797f=_0x11797f||0xcc;return function(_0x1b4ed9){if(_0x1b4ed9){return _0x3cd5e2[_0x8b19('0x15')](_0x11797f);}return _0x3cd5e2['status'](_0x11797f)[_0x8b19('0x16')]();};}function respondWithResult(_0x50bcb9,_0x11c5dc){_0x11c5dc=_0x11c5dc||0xc8;return function(_0x1957fd){if(_0x1957fd){return _0x50bcb9[_0x8b19('0x17')](_0x11c5dc)['json'](_0x1957fd);}};}function respondWithFilteredResult(_0x1b0dd2,_0x39742f){return function(_0x10701d){if(_0x10701d){var _0x505178=typeof _0x39742f[_0x8b19('0x18')]===_0x8b19('0x19')&&typeof _0x39742f[_0x8b19('0x1a')]===_0x8b19('0x19');var _0x6280d6=_0x10701d[_0x8b19('0x1b')];var _0x3a07ef=_0x505178?0x0:_0x39742f['offset'];var _0x4a5238=_0x505178?_0x10701d[_0x8b19('0x1b')]:_0x39742f[_0x8b19('0x18')]+_0x39742f[_0x8b19('0x1a')];var _0x41b767;if(_0x4a5238>=_0x6280d6){_0x4a5238=_0x6280d6;_0x41b767=0xc8;}else{_0x41b767=0xce;}_0x1b0dd2[_0x8b19('0x17')](_0x41b767);return _0x1b0dd2['set'](_0x8b19('0x1c'),_0x3a07ef+'-'+_0x4a5238+'/'+_0x6280d6)[_0x8b19('0x1d')](_0x10701d);}return null;};}function patchUpdates(_0x26b012){return function(_0xedcb14){try{jsonpatch[_0x8b19('0x1e')](_0xedcb14,_0x26b012,!![]);}catch(_0xa0c697){return BPromise[_0x8b19('0x1f')](_0xa0c697);}return _0xedcb14[_0x8b19('0x20')]();};}function saveUpdates(_0x1c9ef8,_0x50567c){return function(_0x106755){if(_0x106755){return _0x106755['update'](_0x1c9ef8)[_0x8b19('0x21')](function(_0x3e5ab7){return _0x3e5ab7;});}return null;};}function removeEntity(_0x5bca43,_0x2fbbf6){return function(_0x282daa){if(_0x282daa){return _0x282daa[_0x8b19('0x22')]()[_0x8b19('0x21')](function(){_0x5bca43[_0x8b19('0x17')](0xcc)[_0x8b19('0x16')]();});}};}function handleEntityNotFound(_0x14010d,_0x4e637f){return function(_0x10ac2f){if(!_0x10ac2f){_0x14010d[_0x8b19('0x15')](0x194);}return _0x10ac2f;};}function handleError(_0x249eb4,_0xb4a658){_0xb4a658=_0xb4a658||0x1f4;return function(_0x3189f8){logger[_0x8b19('0x23')](_0x3189f8[_0x8b19('0x24')]);if(_0x3189f8['name']){delete _0x3189f8['name'];}_0x249eb4[_0x8b19('0x17')](_0xb4a658)[_0x8b19('0x25')](_0x3189f8);};}exports[_0x8b19('0x26')]=function(_0x2472d0,_0x78fabe){var _0xdde8a5={},_0x493369={},_0x500f2c={'count':0x0,'rows':[]};var _0x146aa4=_['map'](db[_0x8b19('0x27')][_0x8b19('0x28')],function(_0x52daad){return{'name':_0x52daad['fieldName'],'type':_0x52daad['type'][_0x8b19('0x29')]};});_0x493369['model']=_[_0x8b19('0x2a')](_0x146aa4,_0x8b19('0x2b'));_0x493369[_0x8b19('0x2c')]=_[_0x8b19('0x2d')](_0x2472d0[_0x8b19('0x2c')]);_0x493369['filters']=_[_0x8b19('0x2e')](_0x493369[_0x8b19('0x2f')],_0x493369[_0x8b19('0x2c')]);_0xdde8a5[_0x8b19('0x30')]=_[_0x8b19('0x2e')](_0x493369[_0x8b19('0x2f')],qs[_0x8b19('0x31')](_0x2472d0[_0x8b19('0x2c')][_0x8b19('0x31')]));_0xdde8a5['attributes']=_0xdde8a5['attributes'][_0x8b19('0x32')]?_0xdde8a5[_0x8b19('0x30')]:_0x493369['model'];if(!_0x2472d0[_0x8b19('0x2c')][_0x8b19('0x33')]('nolimit')){_0xdde8a5[_0x8b19('0x1a')]=qs[_0x8b19('0x1a')](_0x2472d0['query'][_0x8b19('0x1a')]);_0xdde8a5['offset']=qs[_0x8b19('0x18')](_0x2472d0[_0x8b19('0x2c')]['offset']);}_0xdde8a5[_0x8b19('0x34')]=qs[_0x8b19('0x35')](_0x2472d0['query'][_0x8b19('0x35')]);_0xdde8a5[_0x8b19('0x36')]=qs[_0x8b19('0x37')](_[_0x8b19('0x38')](_0x2472d0[_0x8b19('0x2c')],_0x493369[_0x8b19('0x37')]),_0x146aa4);if(_0x2472d0[_0x8b19('0x2c')][_0x8b19('0x39')]){_0xdde8a5['where']=_[_0x8b19('0x3a')](_0xdde8a5[_0x8b19('0x36')],{'$or':_[_0x8b19('0x2a')](_0x146aa4,function(_0x2f4a2){if(_0x2f4a2[_0x8b19('0x3b')]!==_0x8b19('0x3c')){var _0x520c28={};_0x520c28[_0x2f4a2[_0x8b19('0x2b')]]={'$like':'%'+_0x2472d0[_0x8b19('0x2c')][_0x8b19('0x39')]+'%'};return _0x520c28;}})});}_0xdde8a5=_[_0x8b19('0x3a')]({},_0xdde8a5,_0x2472d0[_0x8b19('0x3d')]);var _0x5c3b26={'where':_0xdde8a5[_0x8b19('0x36')]};return db['ZohoConfiguration'][_0x8b19('0x1b')](_0x5c3b26)[_0x8b19('0x21')](function(_0x2cdc66){_0x500f2c[_0x8b19('0x1b')]=_0x2cdc66;if(_0x2472d0[_0x8b19('0x2c')][_0x8b19('0x3e')]){_0xdde8a5['include']=[{'all':!![]}];}return db[_0x8b19('0x27')][_0x8b19('0x3f')](_0xdde8a5);})['then'](function(_0x187d3c){_0x500f2c[_0x8b19('0x40')]=_0x187d3c;return _0x500f2c;})[_0x8b19('0x21')](respondWithFilteredResult(_0x78fabe,_0xdde8a5))[_0x8b19('0x41')](handleError(_0x78fabe,null));};exports['show']=function(_0x26f4f3,_0x3c79af){var _0x3d9b8f={'raw':![],'where':{'id':_0x26f4f3[_0x8b19('0x42')]['id']}},_0x3cc9be={};_0x3cc9be[_0x8b19('0x2f')]=_[_0x8b19('0x2d')](db[_0x8b19('0x27')][_0x8b19('0x28')]);_0x3cc9be[_0x8b19('0x2c')]=_[_0x8b19('0x2d')](_0x26f4f3[_0x8b19('0x2c')]);_0x3cc9be[_0x8b19('0x37')]=_[_0x8b19('0x2e')](_0x3cc9be['model'],_0x3cc9be[_0x8b19('0x2c')]);_0x3d9b8f['attributes']=_[_0x8b19('0x2e')](_0x3cc9be[_0x8b19('0x2f')],qs['fields'](_0x26f4f3['query'][_0x8b19('0x31')]));_0x3d9b8f[_0x8b19('0x30')]=_0x3d9b8f['attributes'][_0x8b19('0x32')]?_0x3d9b8f[_0x8b19('0x30')]:_0x3cc9be[_0x8b19('0x2f')];if(_0x26f4f3[_0x8b19('0x2c')][_0x8b19('0x3e')]){_0x3d9b8f['include']=[{'all':!![]}];}_0x3d9b8f=_[_0x8b19('0x3a')]({},_0x3d9b8f,_0x26f4f3[_0x8b19('0x3d')]);return db['ZohoConfiguration'][_0x8b19('0x43')](_0x3d9b8f)[_0x8b19('0x21')](handleEntityNotFound(_0x3c79af,null))[_0x8b19('0x21')](respondWithResult(_0x3c79af,null))[_0x8b19('0x41')](handleError(_0x3c79af,null));};exports[_0x8b19('0x44')]=function(_0x4a7d0,_0x35ae36){return db[_0x8b19('0x27')]['create'](_0x4a7d0[_0x8b19('0x45')],{})[_0x8b19('0x21')](respondWithResult(_0x35ae36,0xc9))['catch'](handleError(_0x35ae36,null));};exports[_0x8b19('0x46')]=function(_0x196d9e,_0x59ab70){if(_0x196d9e['body']['id']){delete _0x196d9e[_0x8b19('0x45')]['id'];}return db[_0x8b19('0x27')][_0x8b19('0x43')]({'where':{'id':_0x196d9e['params']['id']}})[_0x8b19('0x21')](handleEntityNotFound(_0x59ab70,null))[_0x8b19('0x21')](saveUpdates(_0x196d9e['body'],null))[_0x8b19('0x21')](respondWithResult(_0x59ab70,null))[_0x8b19('0x41')](handleError(_0x59ab70,null));};exports[_0x8b19('0x22')]=function(_0x1c893c,_0x1b3c88){return db[_0x8b19('0x27')][_0x8b19('0x43')]({'where':{'id':_0x1c893c[_0x8b19('0x42')]['id']}})[_0x8b19('0x21')](handleEntityNotFound(_0x1b3c88,null))[_0x8b19('0x21')](removeEntity(_0x1b3c88,null))[_0x8b19('0x41')](handleError(_0x1b3c88,null));};exports[_0x8b19('0x47')]=function(_0x3087f5,_0x2c5d29,_0xb02d1f){var _0x1688df={};var _0x28aaa9={};var _0x538ee3;var _0x547fee;return db['ZohoConfiguration'][_0x8b19('0x48')]({'where':{'id':_0x3087f5[_0x8b19('0x42')]['id']}})[_0x8b19('0x21')](handleEntityNotFound(_0x2c5d29,null))['then'](function(_0x1beb85){if(_0x1beb85){_0x538ee3=_0x1beb85;_0x28aaa9[_0x8b19('0x2f')]=_[_0x8b19('0x2d')](db[_0x8b19('0x49')]['rawAttributes']);_0x28aaa9[_0x8b19('0x2c')]=_['keys'](_0x3087f5[_0x8b19('0x2c')]);_0x28aaa9[_0x8b19('0x37')]=_[_0x8b19('0x2e')](_0x28aaa9[_0x8b19('0x2f')],_0x28aaa9[_0x8b19('0x2c')]);_0x1688df['attributes']=_[_0x8b19('0x2e')](_0x28aaa9[_0x8b19('0x2f')],qs[_0x8b19('0x31')](_0x3087f5['query'][_0x8b19('0x31')]));_0x1688df['attributes']=_0x1688df[_0x8b19('0x30')]['length']?_0x1688df[_0x8b19('0x30')]:_0x28aaa9[_0x8b19('0x2f')];_0x1688df[_0x8b19('0x34')]=qs[_0x8b19('0x35')](_0x3087f5['query'][_0x8b19('0x35')]);_0x1688df[_0x8b19('0x36')]=qs[_0x8b19('0x37')](_[_0x8b19('0x38')](_0x3087f5[_0x8b19('0x2c')],_0x28aaa9[_0x8b19('0x37')]));if(_0x3087f5[_0x8b19('0x2c')][_0x8b19('0x39')]){_0x1688df['where']=_[_0x8b19('0x3a')](_0x1688df[_0x8b19('0x36')],{'$or':_[_0x8b19('0x2a')](_0x1688df[_0x8b19('0x30')],function(_0x38ecd6){var _0x4bfa1c={};_0x4bfa1c[_0x38ecd6]={'$like':'%'+_0x3087f5['query'][_0x8b19('0x39')]+'%'};return _0x4bfa1c;})});}_0x1688df=_[_0x8b19('0x3a')]({},_0x1688df,_0x3087f5[_0x8b19('0x3d')]);return _0x538ee3['getFields'](_0x1688df);}})['then'](function(_0x24d69f){if(_0x24d69f){_0x547fee=_0x24d69f[_0x8b19('0x32')];if(!_0x3087f5[_0x8b19('0x2c')]['hasOwnProperty'](_0x8b19('0x4a'))){_0x1688df[_0x8b19('0x1a')]=qs[_0x8b19('0x1a')](_0x3087f5[_0x8b19('0x2c')][_0x8b19('0x1a')]);_0x1688df[_0x8b19('0x18')]=qs['offset'](_0x3087f5[_0x8b19('0x2c')][_0x8b19('0x18')]);}return _0x538ee3[_0x8b19('0x47')](_0x1688df);}})[_0x8b19('0x21')](function(_0x3f96ed){if(_0x3f96ed){return _0x3f96ed?{'count':_0x547fee,'rows':_0x3f96ed}:null;}})['then'](respondWithResult(_0x2c5d29,null))[_0x8b19('0x41')](handleError(_0x2c5d29,null));};exports[_0x8b19('0x4b')]=function(_0x5a62eb,_0x4ecc28,_0x893317){var _0x1faf48={};var _0x1f8e7f={};var _0x57fc7b;var _0xa191fa;return db['ZohoConfiguration'][_0x8b19('0x48')]({'where':{'id':_0x5a62eb[_0x8b19('0x42')]['id']}})[_0x8b19('0x21')](handleEntityNotFound(_0x4ecc28,null))[_0x8b19('0x21')](function(_0x58c014){if(_0x58c014){_0x57fc7b=_0x58c014;_0x1f8e7f[_0x8b19('0x2f')]=_['keys'](db[_0x8b19('0x49')]['rawAttributes']);_0x1f8e7f[_0x8b19('0x2c')]=_[_0x8b19('0x2d')](_0x5a62eb[_0x8b19('0x2c')]);_0x1f8e7f[_0x8b19('0x37')]=_['intersection'](_0x1f8e7f[_0x8b19('0x2f')],_0x1f8e7f['query']);_0x1faf48[_0x8b19('0x30')]=_[_0x8b19('0x2e')](_0x1f8e7f[_0x8b19('0x2f')],qs[_0x8b19('0x31')](_0x5a62eb[_0x8b19('0x2c')][_0x8b19('0x31')]));_0x1faf48['attributes']=_0x1faf48[_0x8b19('0x30')][_0x8b19('0x32')]?_0x1faf48[_0x8b19('0x30')]:_0x1f8e7f[_0x8b19('0x2f')];_0x1faf48[_0x8b19('0x34')]=qs[_0x8b19('0x35')](_0x5a62eb['query'][_0x8b19('0x35')]);_0x1faf48[_0x8b19('0x36')]=qs[_0x8b19('0x37')](_[_0x8b19('0x38')](_0x5a62eb[_0x8b19('0x2c')],_0x1f8e7f['filters']));if(_0x5a62eb[_0x8b19('0x2c')][_0x8b19('0x39')]){_0x1faf48[_0x8b19('0x36')]=_[_0x8b19('0x3a')](_0x1faf48[_0x8b19('0x36')],{'$or':_[_0x8b19('0x2a')](_0x1faf48['attributes'],function(_0x121bf7){var _0x560ab1={};_0x560ab1[_0x121bf7]={'$like':'%'+_0x5a62eb[_0x8b19('0x2c')][_0x8b19('0x39')]+'%'};return _0x560ab1;})});}_0x1faf48=_[_0x8b19('0x3a')]({},_0x1faf48,_0x5a62eb[_0x8b19('0x3d')]);return _0x57fc7b[_0x8b19('0x4b')](_0x1faf48);}})['then'](function(_0x56701d){if(_0x56701d){_0xa191fa=_0x56701d['length'];if(!_0x5a62eb[_0x8b19('0x2c')][_0x8b19('0x33')](_0x8b19('0x4a'))){_0x1faf48['limit']=qs[_0x8b19('0x1a')](_0x5a62eb[_0x8b19('0x2c')][_0x8b19('0x1a')]);_0x1faf48['offset']=qs[_0x8b19('0x18')](_0x5a62eb['query'][_0x8b19('0x18')]);}return _0x57fc7b[_0x8b19('0x4b')](_0x1faf48);}})[_0x8b19('0x21')](function(_0x598428){if(_0x598428){return _0x598428?{'count':_0xa191fa,'rows':_0x598428}:null;}})[_0x8b19('0x21')](respondWithResult(_0x4ecc28,null))[_0x8b19('0x41')](handleError(_0x4ecc28,null));};exports['getDescriptions']=function(_0x156da7,_0x1a36ef,_0x37e23f){var _0x49391e={};var _0x3cb7bb={};var _0x4710c2;var _0x8e1249;return db[_0x8b19('0x27')][_0x8b19('0x48')]({'where':{'id':_0x156da7['params']['id']}})[_0x8b19('0x21')](handleEntityNotFound(_0x1a36ef,null))[_0x8b19('0x21')](function(_0x47ae28){if(_0x47ae28){_0x4710c2=_0x47ae28;_0x3cb7bb['model']=_[_0x8b19('0x2d')](db[_0x8b19('0x49')][_0x8b19('0x28')]);_0x3cb7bb[_0x8b19('0x2c')]=_[_0x8b19('0x2d')](_0x156da7[_0x8b19('0x2c')]);_0x3cb7bb[_0x8b19('0x37')]=_[_0x8b19('0x2e')](_0x3cb7bb[_0x8b19('0x2f')],_0x3cb7bb[_0x8b19('0x2c')]);_0x49391e[_0x8b19('0x30')]=_[_0x8b19('0x2e')](_0x3cb7bb[_0x8b19('0x2f')],qs[_0x8b19('0x31')](_0x156da7['query'][_0x8b19('0x31')]));_0x49391e['attributes']=_0x49391e[_0x8b19('0x30')]['length']?_0x49391e[_0x8b19('0x30')]:_0x3cb7bb['model'];_0x49391e['order']=qs['sort'](_0x156da7[_0x8b19('0x2c')][_0x8b19('0x35')]);_0x49391e[_0x8b19('0x36')]=qs[_0x8b19('0x37')](_[_0x8b19('0x38')](_0x156da7[_0x8b19('0x2c')],_0x3cb7bb['filters']));if(_0x156da7[_0x8b19('0x2c')][_0x8b19('0x39')]){_0x49391e[_0x8b19('0x36')]=_[_0x8b19('0x3a')](_0x49391e[_0x8b19('0x36')],{'$or':_[_0x8b19('0x2a')](_0x49391e[_0x8b19('0x30')],function(_0x33bf8f){var _0x4aa896={};_0x4aa896[_0x33bf8f]={'$like':'%'+_0x156da7[_0x8b19('0x2c')]['filter']+'%'};return _0x4aa896;})});}_0x49391e=_[_0x8b19('0x3a')]({},_0x49391e,_0x156da7[_0x8b19('0x3d')]);return _0x4710c2[_0x8b19('0x4c')](_0x49391e);}})[_0x8b19('0x21')](function(_0x426ae1){if(_0x426ae1){_0x8e1249=_0x426ae1['length'];if(!_0x156da7[_0x8b19('0x2c')][_0x8b19('0x33')](_0x8b19('0x4a'))){_0x49391e[_0x8b19('0x1a')]=qs['limit'](_0x156da7['query'][_0x8b19('0x1a')]);_0x49391e[_0x8b19('0x18')]=qs[_0x8b19('0x18')](_0x156da7['query'][_0x8b19('0x18')]);}return _0x4710c2[_0x8b19('0x4c')](_0x49391e);}})[_0x8b19('0x21')](function(_0xae3853){if(_0xae3853){return _0xae3853?{'count':_0x8e1249,'rows':_0xae3853}:null;}})[_0x8b19('0x21')](respondWithResult(_0x1a36ef,null))[_0x8b19('0x41')](handleError(_0x1a36ef,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 998ebf8..b8c5b70 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 _0xf2b7=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x229f5e,_0x433f0f){var _0x2d62ff=function(_0xe4d381){while(--_0xe4d381){_0x229f5e['push'](_0x229f5e['shift']());}};_0x2d62ff(++_0x433f0f);}(_0xf2b7,0x150));var _0x7f2b=function(_0x168928,_0x49e53d){_0x168928=_0x168928-0x0;var _0x33d81c=_0xf2b7[_0x168928];return _0x33d81c;};'use strict';var _=require(_0x7f2b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7f2b('0x1'));var moment=require('moment');var BPromise=require(_0x7f2b('0x2'));var rp=require(_0x7f2b('0x3'));var fs=require('fs');var path=require(_0x7f2b('0x4'));var rimraf=require(_0x7f2b('0x5'));var config=require(_0x7f2b('0x6'));var attributes=require(_0x7f2b('0x7'));module[_0x7f2b('0x8')]=function(_0x1b3310,_0x3cbca5){return _0x1b3310[_0x7f2b('0x9')](_0x7f2b('0xa'),attributes,{'tableName':_0x7f2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5453=['moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','util','../../config/logger','api'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x5453,0x1e9));var _0x3545=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5453[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x3545('0x0'));var logger=require(_0x3545('0x1'))(_0x3545('0x2'));var moment=require(_0x3545('0x3'));var BPromise=require(_0x3545('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3545('0x5'));var rimraf=require(_0x3545('0x6'));var config=require(_0x3545('0x7'));var attributes=require(_0x3545('0x8'));module[_0x3545('0x9')]=function(_0x5304ee,_0x4a1528){return _0x5304ee[_0x3545('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x3545('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 6fa7537..d5a933d 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 _0x73a7=['request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x73a7,0x148));var _0x773a=function(_0x15ae2d,_0xe14444){_0x15ae2d=_0x15ae2d-0x0;var _0x14926c=_0x73a7[_0x15ae2d];return _0x14926c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x773a('0x0'));var BPromise=require('bluebird');var rs=require(_0x773a('0x1'));var fs=require('fs');var Redis=require(_0x773a('0x2'));var db=require(_0x773a('0x3'))['db'];var utils=require(_0x773a('0x4'));var logger=require(_0x773a('0x5'))(_0x773a('0x6'));var config=require(_0x773a('0x7'));var jayson=require(_0x773a('0x8'));var client=jayson['client'][_0x773a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d498,_0x55cdb4,_0x388537){return new BPromise(function(_0xc4dffd,_0x1434f5){return client['request'](_0x52d498,_0x388537)[_0x773a('0xa')](function(_0x32e12b){logger[_0x773a('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x55cdb4,_0x773a('0xc'));logger['debug'](_0x773a('0xd'),_0x55cdb4,_0x773a('0xc'),JSON[_0x773a('0xe')](_0x32e12b));if(_0x32e12b[_0x773a('0xf')]){if(_0x32e12b['error'][_0x773a('0x10')]===0x1f4){logger[_0x773a('0xf')](_0x773a('0x11'),_0x55cdb4,_0x32e12b[_0x773a('0xf')][_0x773a('0x12')]);return _0x1434f5(_0x32e12b[_0x773a('0xf')][_0x773a('0x12')]);}logger[_0x773a('0xf')](_0x773a('0x11'),_0x55cdb4,_0x32e12b['error'][_0x773a('0x12')]);return _0xc4dffd(_0x32e12b[_0x773a('0xf')][_0x773a('0x12')]);}else{logger[_0x773a('0xb')](_0x773a('0x11'),_0x55cdb4,_0x773a('0xc'));_0xc4dffd(_0x32e12b[_0x773a('0x13')]['message']);}})['catch'](function(_0x25648d){logger['error'](_0x773a('0x11'),_0x55cdb4,_0x25648d);_0x1434f5(_0x25648d);});});} \ No newline at end of file +var _0x4d92=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x57d593,_0x53b430){var _0x4b2f24=function(_0x4a505a){while(--_0x4a505a){_0x57d593['push'](_0x57d593['shift']());}};_0x4b2f24(++_0x53b430);}(_0x4d92,0xa4));var _0x24d9=function(_0x1476ba,_0x446421){_0x1476ba=_0x1476ba-0x0;var _0x5e7bc1=_0x4d92[_0x1476ba];return _0x5e7bc1;};'use strict';var _=require(_0x24d9('0x0'));var util=require(_0x24d9('0x1'));var moment=require(_0x24d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x24d9('0x3'));var fs=require('fs');var Redis=require(_0x24d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x24d9('0x5'));var logger=require(_0x24d9('0x6'))(_0x24d9('0x7'));var config=require(_0x24d9('0x8'));var jayson=require(_0x24d9('0x9'));var client=jayson['client'][_0x24d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x138eaf,_0x1c78fd,_0x23a439){return new BPromise(function(_0x3f5950,_0x3d8e7d){return client[_0x24d9('0xb')](_0x138eaf,_0x23a439)[_0x24d9('0xc')](function(_0xa850de){logger[_0x24d9('0xd')](_0x24d9('0xe'),_0x1c78fd,_0x24d9('0xf'));logger[_0x24d9('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1c78fd,'request\x20sent',JSON['stringify'](_0xa850de));if(_0xa850de['error']){if(_0xa850de[_0x24d9('0x11')][_0x24d9('0x12')]===0x1f4){logger[_0x24d9('0x11')](_0x24d9('0xe'),_0x1c78fd,_0xa850de[_0x24d9('0x11')][_0x24d9('0x13')]);return _0x3d8e7d(_0xa850de[_0x24d9('0x11')][_0x24d9('0x13')]);}logger[_0x24d9('0x11')](_0x24d9('0xe'),_0x1c78fd,_0xa850de[_0x24d9('0x11')][_0x24d9('0x13')]);return _0x3f5950(_0xa850de[_0x24d9('0x11')]['message']);}else{logger[_0x24d9('0xd')](_0x24d9('0xe'),_0x1c78fd,_0x24d9('0xf'));_0x3f5950(_0xa850de[_0x24d9('0x14')][_0x24d9('0x13')]);}})['catch'](function(_0x44f578){logger[_0x24d9('0x11')](_0x24d9('0xe'),_0x1c78fd,_0x44f578);_0x3d8e7d(_0x44f578);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7640eed..c34bbbc 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 _0xf41d=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x4b0589,_0xed7f9a){var _0x45ce5f=function(_0x2b9ba2){while(--_0x2b9ba2){_0x4b0589['push'](_0x4b0589['shift']());}};_0x45ce5f(++_0xed7f9a);}(_0xf41d,0xa0));var _0xdf41=function(_0x1bcf55,_0x3eefa4){_0x1bcf55=_0x1bcf55-0x0;var _0x30bf4c=_0xf41d[_0x1bcf55];return _0x30bf4c;};'use strict';var multer=require(_0xdf41('0x0'));var util=require(_0xdf41('0x1'));var path=require('path');var timeout=require(_0xdf41('0x2'));var express=require(_0xdf41('0x3'));var router=express['Router']();var fs_extra=require(_0xdf41('0x4'));var auth=require(_0xdf41('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf41('0x6'));var controller=require(_0xdf41('0x7'));router[_0xdf41('0x8')]('/',auth[_0xdf41('0x9')](),controller['index']);router['get'](_0xdf41('0xa'),auth[_0xdf41('0x9')](),controller[_0xdf41('0xb')]);router[_0xdf41('0xc')]('/',auth[_0xdf41('0x9')](),controller[_0xdf41('0xd')]);router[_0xdf41('0xe')]('/:id',auth[_0xdf41('0x9')](),controller['update']);router[_0xdf41('0xf')](_0xdf41('0xa'),auth[_0xdf41('0x9')](),controller[_0xdf41('0x10')]);module[_0xdf41('0x11')]=router; \ No newline at end of file +var _0xed02=['./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b7221,_0x43eb0d){var _0x41f443=function(_0x318db7){while(--_0x318db7){_0x1b7221['push'](_0x1b7221['shift']());}};_0x41f443(++_0x43eb0d);}(_0xed02,0x102));var _0x2ed0=function(_0x41b210,_0x3b46fc){_0x41b210=_0x41b210-0x0;var _0x2b2786=_0xed02[_0x41b210];return _0x2b2786;};'use strict';var multer=require(_0x2ed0('0x0'));var util=require(_0x2ed0('0x1'));var path=require(_0x2ed0('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ed0('0x3'));var router=express[_0x2ed0('0x4')]();var fs_extra=require(_0x2ed0('0x5'));var auth=require(_0x2ed0('0x6'));var interaction=require(_0x2ed0('0x7'));var config=require('../../config/environment');var controller=require(_0x2ed0('0x8'));router[_0x2ed0('0x9')]('/',auth[_0x2ed0('0xa')](),controller[_0x2ed0('0xb')]);router[_0x2ed0('0x9')](_0x2ed0('0xc'),auth[_0x2ed0('0xa')](),controller['show']);router[_0x2ed0('0xd')]('/',auth['isAuthenticated'](),controller[_0x2ed0('0xe')]);router['put'](_0x2ed0('0xc'),auth['isAuthenticated'](),controller[_0x2ed0('0xf')]);router[_0x2ed0('0x10')]('/:id',auth[_0x2ed0('0xa')](),controller[_0x2ed0('0x11')]);module[_0x2ed0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1ed0f0c..8b2256f 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 _0x1844=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2eb42d,_0x330213){var _0x3ceff=function(_0x24b8d2){while(--_0x24b8d2){_0x2eb42d['push'](_0x2eb42d['shift']());}};_0x3ceff(++_0x330213);}(_0x1844,0x1c2));var _0x4184=function(_0x32f376,_0x2c8523){_0x32f376=_0x32f376-0x0;var _0x55ba12=_0x1844[_0x32f376];return _0x55ba12;};'use strict';var Sequelize=require(_0x4184('0x0'));module[_0x4184('0x1')]={'type':{'type':Sequelize[_0x4184('0x2')](_0x4184('0x3'),_0x4184('0x4'),_0x4184('0x5'),_0x4184('0x6'),_0x4184('0x7')),'defaultValue':_0x4184('0x3')},'content':{'type':Sequelize[_0x4184('0x8')]},'key':{'type':Sequelize[_0x4184('0x8')]},'keyType':{'type':Sequelize[_0x4184('0x2')](_0x4184('0x3'),_0x4184('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4184('0x8')]},'idField':{'type':Sequelize[_0x4184('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4184('0x8')]}}; \ No newline at end of file +var _0x5f7b=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x7babd9,_0x1d1f5e){var _0x394174=function(_0x40e52a){while(--_0x40e52a){_0x7babd9['push'](_0x7babd9['shift']());}};_0x394174(++_0x1d1f5e);}(_0x5f7b,0xc9));var _0xb5f7=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x5f7b[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0xb5f7('0x0'));module[_0xb5f7('0x1')]={'type':{'type':Sequelize[_0xb5f7('0x2')](_0xb5f7('0x3'),_0xb5f7('0x4'),'customVariable',_0xb5f7('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb5f7('0x6')]},'keyType':{'type':Sequelize[_0xb5f7('0x2')](_0xb5f7('0x3'),_0xb5f7('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xb5f7('0x6')]},'idField':{'type':Sequelize[_0xb5f7('0x6')]},'nameField':{'type':Sequelize[_0xb5f7('0x6')]},'customField':{'type':Sequelize[_0xb5f7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb5f7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 7822493..193b58f 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 _0xf064=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','sendStatus','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x26f959,_0x1cf0c9){var _0x1191b9=function(_0x54cc62){while(--_0x54cc62){_0x26f959['push'](_0x26f959['shift']());}};_0x1191b9(++_0x1cf0c9);}(_0xf064,0xcc));var _0x4f06=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0xf064[_0x4bfade];return _0x272465;};'use strict';var emlformat=require(_0x4f06('0x0'));var rimraf=require(_0x4f06('0x1'));var zipdir=require(_0x4f06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f06('0x3'));var moment=require(_0x4f06('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f06('0x5'));var path=require(_0x4f06('0x6'));var sox=require('sox');var csv=require(_0x4f06('0x7'));var ejs=require(_0x4f06('0x8'));var fs=require('fs');var fs_extra=require(_0x4f06('0x9'));var _=require(_0x4f06('0xa'));var squel=require(_0x4f06('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f06('0xc'));var deskjs=require(_0x4f06('0xd'));var toCsv=require(_0x4f06('0x7'));var querystring=require(_0x4f06('0xe'));var Papa=require(_0x4f06('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f06('0x10'));var hardwareService=require(_0x4f06('0x11'));var logger=require(_0x4f06('0x12'))(_0x4f06('0x13'));var utils=require(_0x4f06('0x14'));var config=require(_0x4f06('0x15'));var licenseUtil=require(_0x4f06('0x16'));var db=require(_0x4f06('0x17'))['db'];function respondWithStatusCode(_0x57fb8a,_0x1d7397){_0x1d7397=_0x1d7397||0xcc;return function(_0x4ed652){if(_0x4ed652){return _0x57fb8a['sendStatus'](_0x1d7397);}return _0x57fb8a[_0x4f06('0x18')](_0x1d7397)[_0x4f06('0x19')]();};}function respondWithResult(_0xb94fe6,_0x22cccc){_0x22cccc=_0x22cccc||0xc8;return function(_0x429b20){if(_0x429b20){return _0xb94fe6['status'](_0x22cccc)[_0x4f06('0x1a')](_0x429b20);}};}function respondWithFilteredResult(_0x2e5d12,_0x47fad3){return function(_0x32a2c3){if(_0x32a2c3){var _0x307935=typeof _0x47fad3[_0x4f06('0x1b')]===_0x4f06('0x1c')&&typeof _0x47fad3[_0x4f06('0x1d')]===_0x4f06('0x1c');var _0x32d281=_0x32a2c3[_0x4f06('0x1e')];var _0x35fc51=_0x307935?0x0:_0x47fad3['offset'];var _0x2a166f=_0x307935?_0x32a2c3['count']:_0x47fad3[_0x4f06('0x1b')]+_0x47fad3[_0x4f06('0x1d')];var _0x36d53;if(_0x2a166f>=_0x32d281){_0x2a166f=_0x32d281;_0x36d53=0xc8;}else{_0x36d53=0xce;}_0x2e5d12['status'](_0x36d53);return _0x2e5d12[_0x4f06('0x1f')]('Content-Range',_0x35fc51+'-'+_0x2a166f+'/'+_0x32d281)[_0x4f06('0x1a')](_0x32a2c3);}return null;};}function patchUpdates(_0x406581){return function(_0x9bf336){try{jsonpatch[_0x4f06('0x20')](_0x9bf336,_0x406581,!![]);}catch(_0x256ed2){return BPromise[_0x4f06('0x21')](_0x256ed2);}return _0x9bf336[_0x4f06('0x22')]();};}function saveUpdates(_0x427299,_0x510085){return function(_0x323d5a){if(_0x323d5a){return _0x323d5a['update'](_0x427299)[_0x4f06('0x23')](function(_0x505bc5){return _0x505bc5;});}return null;};}function removeEntity(_0x48623e,_0x49747d){return function(_0x4c565c){if(_0x4c565c){return _0x4c565c['destroy']()[_0x4f06('0x23')](function(){_0x48623e[_0x4f06('0x18')](0xcc)[_0x4f06('0x19')]();});}};}function handleEntityNotFound(_0x8b9f14,_0x2e20fb){return function(_0x10571e){if(!_0x10571e){_0x8b9f14[_0x4f06('0x24')](0x194);}return _0x10571e;};}function handleError(_0x36aa48,_0x6e97f){_0x6e97f=_0x6e97f||0x1f4;return function(_0xbdac16){logger[_0x4f06('0x25')](_0xbdac16[_0x4f06('0x26')]);if(_0xbdac16[_0x4f06('0x27')]){delete _0xbdac16[_0x4f06('0x27')];}_0x36aa48['status'](_0x6e97f)['send'](_0xbdac16);};}exports[_0x4f06('0x28')]=function(_0x1554b1,_0x21a661){var _0x26515e={},_0x2f56d0={},_0x49b6f6={'count':0x0,'rows':[]};var _0x1f8fa2=_[_0x4f06('0x29')](db[_0x4f06('0x2a')][_0x4f06('0x2b')],function(_0x46b76d){return{'name':_0x46b76d[_0x4f06('0x2c')],'type':_0x46b76d[_0x4f06('0x2d')][_0x4f06('0x2e')]};});_0x2f56d0[_0x4f06('0x2f')]=_['map'](_0x1f8fa2,_0x4f06('0x27'));_0x2f56d0[_0x4f06('0x30')]=_[_0x4f06('0x31')](_0x1554b1['query']);_0x2f56d0[_0x4f06('0x32')]=_[_0x4f06('0x33')](_0x2f56d0[_0x4f06('0x2f')],_0x2f56d0[_0x4f06('0x30')]);_0x26515e['attributes']=_[_0x4f06('0x33')](_0x2f56d0[_0x4f06('0x2f')],qs[_0x4f06('0x34')](_0x1554b1['query'][_0x4f06('0x34')]));_0x26515e[_0x4f06('0x35')]=_0x26515e[_0x4f06('0x35')]['length']?_0x26515e['attributes']:_0x2f56d0[_0x4f06('0x2f')];if(!_0x1554b1['query']['hasOwnProperty']('nolimit')){_0x26515e[_0x4f06('0x1d')]=qs[_0x4f06('0x1d')](_0x1554b1[_0x4f06('0x30')][_0x4f06('0x1d')]);_0x26515e['offset']=qs['offset'](_0x1554b1['query']['offset']);}_0x26515e[_0x4f06('0x36')]=qs[_0x4f06('0x37')](_0x1554b1['query'][_0x4f06('0x37')]);_0x26515e[_0x4f06('0x38')]=qs['filters'](_[_0x4f06('0x39')](_0x1554b1[_0x4f06('0x30')],_0x2f56d0['filters']),_0x1f8fa2);if(_0x1554b1[_0x4f06('0x30')][_0x4f06('0x3a')]){_0x26515e[_0x4f06('0x38')]=_[_0x4f06('0x3b')](_0x26515e[_0x4f06('0x38')],{'$or':_[_0x4f06('0x29')](_0x1f8fa2,function(_0x39d2fa){if(_0x39d2fa[_0x4f06('0x2d')]!=='VIRTUAL'){var _0x14c7ca={};_0x14c7ca[_0x39d2fa[_0x4f06('0x27')]]={'$like':'%'+_0x1554b1[_0x4f06('0x30')]['filter']+'%'};return _0x14c7ca;}})});}_0x26515e=_[_0x4f06('0x3b')]({},_0x26515e,_0x1554b1['options']);var _0x438aa8={'where':_0x26515e[_0x4f06('0x38')]};return db['ZohoField'][_0x4f06('0x1e')](_0x438aa8)[_0x4f06('0x23')](function(_0x2d75be){_0x49b6f6['count']=_0x2d75be;if(_0x1554b1[_0x4f06('0x30')][_0x4f06('0x3c')]){_0x26515e['include']=[{'all':!![]}];}return db['ZohoField'][_0x4f06('0x3d')](_0x26515e);})['then'](function(_0x270f64){_0x49b6f6[_0x4f06('0x3e')]=_0x270f64;return _0x49b6f6;})[_0x4f06('0x23')](respondWithFilteredResult(_0x21a661,_0x26515e))[_0x4f06('0x3f')](handleError(_0x21a661,null));};exports[_0x4f06('0x40')]=function(_0x131fec,_0x30b41c){var _0x2209b4={'raw':!![],'where':{'id':_0x131fec[_0x4f06('0x41')]['id']}},_0x461c02={};_0x461c02[_0x4f06('0x2f')]=_[_0x4f06('0x31')](db['ZohoField']['rawAttributes']);_0x461c02[_0x4f06('0x30')]=_['keys'](_0x131fec[_0x4f06('0x30')]);_0x461c02[_0x4f06('0x32')]=_[_0x4f06('0x33')](_0x461c02[_0x4f06('0x2f')],_0x461c02[_0x4f06('0x30')]);_0x2209b4[_0x4f06('0x35')]=_[_0x4f06('0x33')](_0x461c02[_0x4f06('0x2f')],qs[_0x4f06('0x34')](_0x131fec['query'][_0x4f06('0x34')]));_0x2209b4[_0x4f06('0x35')]=_0x2209b4[_0x4f06('0x35')][_0x4f06('0x42')]?_0x2209b4['attributes']:_0x461c02['model'];if(_0x131fec[_0x4f06('0x30')][_0x4f06('0x3c')]){_0x2209b4[_0x4f06('0x43')]=[{'all':!![]}];}_0x2209b4=_[_0x4f06('0x3b')]({},_0x2209b4,_0x131fec[_0x4f06('0x44')]);return db[_0x4f06('0x2a')][_0x4f06('0x45')](_0x2209b4)[_0x4f06('0x23')](handleEntityNotFound(_0x30b41c,null))['then'](respondWithResult(_0x30b41c,null))[_0x4f06('0x3f')](handleError(_0x30b41c,null));};exports['create']=function(_0x4442d9,_0x4c67ef){return db[_0x4f06('0x2a')][_0x4f06('0x46')](_0x4442d9[_0x4f06('0x47')],{})['then'](respondWithResult(_0x4c67ef,0xc9))[_0x4f06('0x3f')](handleError(_0x4c67ef,null));};exports[_0x4f06('0x48')]=function(_0x1e0bc5,_0x41c245){if(_0x1e0bc5[_0x4f06('0x47')]['id']){delete _0x1e0bc5['body']['id'];}return db['ZohoField']['find']({'where':{'id':_0x1e0bc5['params']['id']}})[_0x4f06('0x23')](handleEntityNotFound(_0x41c245,null))[_0x4f06('0x23')](saveUpdates(_0x1e0bc5['body'],null))[_0x4f06('0x23')](respondWithResult(_0x41c245,null))[_0x4f06('0x3f')](handleError(_0x41c245,null));};exports[_0x4f06('0x49')]=function(_0x1eee5b,_0xff725a){return db['ZohoField']['find']({'where':{'id':_0x1eee5b['params']['id']}})[_0x4f06('0x23')](handleEntityNotFound(_0xff725a,null))[_0x4f06('0x23')](removeEntity(_0xff725a,null))[_0x4f06('0x3f')](handleError(_0xff725a,null));}; \ No newline at end of file +var _0xd456=['sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','show','params','keys','catch','create','body','find','eml-format','request-promise','moment','mustache','util','path'];(function(_0xc58566,_0x43a34d){var _0x4701c7=function(_0x5c079b){while(--_0x5c079b){_0xc58566['push'](_0xc58566['shift']());}};_0x4701c7(++_0x43a34d);}(_0xd456,0x12a));var _0x6d45=function(_0xf33397,_0x402395){_0xf33397=_0xf33397-0x0;var _0x35086b=_0xd456[_0xf33397];return _0x35086b;};'use strict';var emlformat=require(_0x6d45('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6d45('0x1'));var moment=require(_0x6d45('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6d45('0x3'));var util=require(_0x6d45('0x4'));var path=require(_0x6d45('0x5'));var sox=require(_0x6d45('0x6'));var csv=require(_0x6d45('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d45('0x8'));var _=require('lodash');var squel=require(_0x6d45('0x9'));var crypto=require('crypto');var jsforce=require(_0x6d45('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6d45('0x7'));var querystring=require(_0x6d45('0xb'));var Papa=require(_0x6d45('0xc'));var Redis=require(_0x6d45('0xd'));var authService=require(_0x6d45('0xe'));var qs=require(_0x6d45('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d45('0x10'));var logger=require('../../config/logger')(_0x6d45('0x11'));var utils=require(_0x6d45('0x12'));var config=require(_0x6d45('0x13'));var licenseUtil=require(_0x6d45('0x14'));var db=require(_0x6d45('0x15'))['db'];function respondWithStatusCode(_0xec12af,_0x4edd32){_0x4edd32=_0x4edd32||0xcc;return function(_0x3c872e){if(_0x3c872e){return _0xec12af[_0x6d45('0x16')](_0x4edd32);}return _0xec12af['status'](_0x4edd32)[_0x6d45('0x17')]();};}function respondWithResult(_0x5a4d04,_0x7b7fa){_0x7b7fa=_0x7b7fa||0xc8;return function(_0x362ff4){if(_0x362ff4){return _0x5a4d04['status'](_0x7b7fa)[_0x6d45('0x18')](_0x362ff4);}};}function respondWithFilteredResult(_0x1129cd,_0x1c41ee){return function(_0x1f39a5){if(_0x1f39a5){var _0x52ade7=typeof _0x1c41ee[_0x6d45('0x19')]===_0x6d45('0x1a')&&typeof _0x1c41ee['limit']==='undefined';var _0x2db0b3=_0x1f39a5[_0x6d45('0x1b')];var _0x28404b=_0x52ade7?0x0:_0x1c41ee[_0x6d45('0x19')];var _0xa1e6d5=_0x52ade7?_0x1f39a5['count']:_0x1c41ee[_0x6d45('0x19')]+_0x1c41ee[_0x6d45('0x1c')];var _0x55ef27;if(_0xa1e6d5>=_0x2db0b3){_0xa1e6d5=_0x2db0b3;_0x55ef27=0xc8;}else{_0x55ef27=0xce;}_0x1129cd[_0x6d45('0x1d')](_0x55ef27);return _0x1129cd[_0x6d45('0x1e')](_0x6d45('0x1f'),_0x28404b+'-'+_0xa1e6d5+'/'+_0x2db0b3)['json'](_0x1f39a5);}return null;};}function patchUpdates(_0x2b671c){return function(_0x203058){try{jsonpatch[_0x6d45('0x20')](_0x203058,_0x2b671c,!![]);}catch(_0x3540c0){return BPromise[_0x6d45('0x21')](_0x3540c0);}return _0x203058[_0x6d45('0x22')]();};}function saveUpdates(_0x55ddc6,_0x525427){return function(_0x509a80){if(_0x509a80){return _0x509a80[_0x6d45('0x23')](_0x55ddc6)['then'](function(_0x39bc17){return _0x39bc17;});}return null;};}function removeEntity(_0x375454,_0x1de305){return function(_0x32267c){if(_0x32267c){return _0x32267c[_0x6d45('0x24')]()['then'](function(){_0x375454[_0x6d45('0x1d')](0xcc)[_0x6d45('0x17')]();});}};}function handleEntityNotFound(_0x347392,_0x5b21ea){return function(_0x39b701){if(!_0x39b701){_0x347392[_0x6d45('0x16')](0x194);}return _0x39b701;};}function handleError(_0xd1bf0b,_0x303c3d){_0x303c3d=_0x303c3d||0x1f4;return function(_0x45c442){logger[_0x6d45('0x25')](_0x45c442[_0x6d45('0x26')]);if(_0x45c442[_0x6d45('0x27')]){delete _0x45c442[_0x6d45('0x27')];}_0xd1bf0b[_0x6d45('0x1d')](_0x303c3d)[_0x6d45('0x28')](_0x45c442);};}exports[_0x6d45('0x29')]=function(_0x5515ce,_0x597aa7){var _0xf5298d={},_0x199329={},_0x164998={'count':0x0,'rows':[]};var _0x44add9=_['map'](db[_0x6d45('0x2a')][_0x6d45('0x2b')],function(_0x5a9f28){return{'name':_0x5a9f28[_0x6d45('0x2c')],'type':_0x5a9f28[_0x6d45('0x2d')][_0x6d45('0x2e')]};});_0x199329[_0x6d45('0x2f')]=_[_0x6d45('0x30')](_0x44add9,_0x6d45('0x27'));_0x199329[_0x6d45('0x31')]=_['keys'](_0x5515ce['query']);_0x199329[_0x6d45('0x32')]=_[_0x6d45('0x33')](_0x199329[_0x6d45('0x2f')],_0x199329[_0x6d45('0x31')]);_0xf5298d[_0x6d45('0x34')]=_[_0x6d45('0x33')](_0x199329[_0x6d45('0x2f')],qs[_0x6d45('0x35')](_0x5515ce[_0x6d45('0x31')][_0x6d45('0x35')]));_0xf5298d[_0x6d45('0x34')]=_0xf5298d[_0x6d45('0x34')][_0x6d45('0x36')]?_0xf5298d[_0x6d45('0x34')]:_0x199329[_0x6d45('0x2f')];if(!_0x5515ce[_0x6d45('0x31')][_0x6d45('0x37')](_0x6d45('0x38'))){_0xf5298d[_0x6d45('0x1c')]=qs[_0x6d45('0x1c')](_0x5515ce[_0x6d45('0x31')][_0x6d45('0x1c')]);_0xf5298d[_0x6d45('0x19')]=qs[_0x6d45('0x19')](_0x5515ce[_0x6d45('0x31')]['offset']);}_0xf5298d[_0x6d45('0x39')]=qs['sort'](_0x5515ce[_0x6d45('0x31')][_0x6d45('0x3a')]);_0xf5298d[_0x6d45('0x3b')]=qs[_0x6d45('0x32')](_['pick'](_0x5515ce['query'],_0x199329[_0x6d45('0x32')]),_0x44add9);if(_0x5515ce['query'][_0x6d45('0x3c')]){_0xf5298d['where']=_[_0x6d45('0x3d')](_0xf5298d['where'],{'$or':_[_0x6d45('0x30')](_0x44add9,function(_0x8a3561){if(_0x8a3561[_0x6d45('0x2d')]!==_0x6d45('0x3e')){var _0xc80d86={};_0xc80d86[_0x8a3561[_0x6d45('0x27')]]={'$like':'%'+_0x5515ce['query'][_0x6d45('0x3c')]+'%'};return _0xc80d86;}})});}_0xf5298d=_['merge']({},_0xf5298d,_0x5515ce[_0x6d45('0x3f')]);var _0x51277c={'where':_0xf5298d[_0x6d45('0x3b')]};return db['ZohoField'][_0x6d45('0x1b')](_0x51277c)['then'](function(_0x8bac0){_0x164998[_0x6d45('0x1b')]=_0x8bac0;if(_0x5515ce[_0x6d45('0x31')][_0x6d45('0x40')]){_0xf5298d[_0x6d45('0x41')]=[{'all':!![]}];}return db[_0x6d45('0x2a')][_0x6d45('0x42')](_0xf5298d);})[_0x6d45('0x43')](function(_0x5b18a6){_0x164998[_0x6d45('0x44')]=_0x5b18a6;return _0x164998;})[_0x6d45('0x43')](respondWithFilteredResult(_0x597aa7,_0xf5298d))['catch'](handleError(_0x597aa7,null));};exports[_0x6d45('0x45')]=function(_0x444317,_0x46d2cb){var _0x359c56={'raw':!![],'where':{'id':_0x444317[_0x6d45('0x46')]['id']}},_0xebb07e={};_0xebb07e[_0x6d45('0x2f')]=_[_0x6d45('0x47')](db[_0x6d45('0x2a')][_0x6d45('0x2b')]);_0xebb07e['query']=_[_0x6d45('0x47')](_0x444317['query']);_0xebb07e[_0x6d45('0x32')]=_[_0x6d45('0x33')](_0xebb07e[_0x6d45('0x2f')],_0xebb07e['query']);_0x359c56['attributes']=_[_0x6d45('0x33')](_0xebb07e[_0x6d45('0x2f')],qs[_0x6d45('0x35')](_0x444317[_0x6d45('0x31')][_0x6d45('0x35')]));_0x359c56[_0x6d45('0x34')]=_0x359c56['attributes'][_0x6d45('0x36')]?_0x359c56[_0x6d45('0x34')]:_0xebb07e[_0x6d45('0x2f')];if(_0x444317[_0x6d45('0x31')][_0x6d45('0x40')]){_0x359c56[_0x6d45('0x41')]=[{'all':!![]}];}_0x359c56=_[_0x6d45('0x3d')]({},_0x359c56,_0x444317[_0x6d45('0x3f')]);return db['ZohoField']['find'](_0x359c56)['then'](handleEntityNotFound(_0x46d2cb,null))['then'](respondWithResult(_0x46d2cb,null))[_0x6d45('0x48')](handleError(_0x46d2cb,null));};exports[_0x6d45('0x49')]=function(_0x5835b9,_0x4294ba){return db[_0x6d45('0x2a')][_0x6d45('0x49')](_0x5835b9['body'],{})[_0x6d45('0x43')](respondWithResult(_0x4294ba,0xc9))[_0x6d45('0x48')](handleError(_0x4294ba,null));};exports[_0x6d45('0x23')]=function(_0x31ecb6,_0x187f61){if(_0x31ecb6[_0x6d45('0x4a')]['id']){delete _0x31ecb6['body']['id'];}return db[_0x6d45('0x2a')][_0x6d45('0x4b')]({'where':{'id':_0x31ecb6[_0x6d45('0x46')]['id']}})[_0x6d45('0x43')](handleEntityNotFound(_0x187f61,null))[_0x6d45('0x43')](saveUpdates(_0x31ecb6[_0x6d45('0x4a')],null))[_0x6d45('0x43')](respondWithResult(_0x187f61,null))[_0x6d45('0x48')](handleError(_0x187f61,null));};exports[_0x6d45('0x24')]=function(_0xfa6df8,_0x3eddc8){return db[_0x6d45('0x2a')]['find']({'where':{'id':_0xfa6df8[_0x6d45('0x46')]['id']}})[_0x6d45('0x43')](handleEntityNotFound(_0x3eddc8,null))['then'](removeEntity(_0x3eddc8,null))[_0x6d45('0x48')](handleError(_0x3eddc8,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index fb026a2..7309ac8 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 _0x6a55=['moment','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash'];(function(_0x78eb03,_0x5cd104){var _0xc146c3=function(_0x47fc1d){while(--_0x47fc1d){_0x78eb03['push'](_0x78eb03['shift']());}};_0xc146c3(++_0x5cd104);}(_0x6a55,0xdb));var _0x56a5=function(_0x2abd13,_0x501317){_0x2abd13=_0x2abd13-0x0;var _0x5ad645=_0x6a55[_0x2abd13];return _0x5ad645;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56a5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56a5('0x2'));var rimraf=require('rimraf');var config=require(_0x56a5('0x3'));var attributes=require('./intZohoField.attributes');module[_0x56a5('0x4')]=function(_0x380b1b,_0x42d164){return _0x380b1b[_0x56a5('0x5')](_0x56a5('0x6'),attributes,{'tableName':_0x56a5('0x7'),'paranoid':![],'indexes':[{'name':_0x56a5('0x8'),'fields':[_0x56a5('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x13b8b1,_0x42882a){var _0x467f68=function(_0x1948e0){while(--_0x1948e0){_0x13b8b1['push'](_0x13b8b1['shift']());}};_0x467f68(++_0x42882a);}(_0xdb28,0x106));var _0x8db2=function(_0xbaf0c4,_0x4253eb){_0xbaf0c4=_0xbaf0c4-0x0;var _0x332a28=_0xdb28[_0xbaf0c4];return _0x332a28;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intZohoField.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':_0x8db2('0xc'),'fields':[_0x8db2('0xd'),_0x8db2('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 3faf1e3..7403975 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 _0x776c=['../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x776c,0x182));var _0xc776=function(_0x1e2854,_0x1f5474){_0x1e2854=_0x1e2854-0x0;var _0x44a7b1=_0x776c[_0x1e2854];return _0x44a7b1;};'use strict';var _=require(_0xc776('0x0'));var util=require('util');var moment=require(_0xc776('0x1'));var BPromise=require(_0xc776('0x2'));var rs=require(_0xc776('0x3'));var fs=require('fs');var Redis=require(_0xc776('0x4'));var db=require(_0xc776('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc776('0x6'));var config=require('../../config/environment');var jayson=require(_0xc776('0x7'));var client=jayson[_0xc776('0x8')][_0xc776('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa9c618,_0x2091bc,_0x2255a){return new BPromise(function(_0x412af9,_0x33eaf4){return client[_0xc776('0xa')](_0xa9c618,_0x2255a)[_0xc776('0xb')](function(_0x426c06){logger[_0xc776('0xc')](_0xc776('0xd'),_0x2091bc,_0xc776('0xe'));logger[_0xc776('0xf')](_0xc776('0x10'),_0x2091bc,_0xc776('0xe'),JSON[_0xc776('0x11')](_0x426c06));if(_0x426c06['error']){if(_0x426c06[_0xc776('0x12')][_0xc776('0x13')]===0x1f4){logger[_0xc776('0x12')]('ZohoField,\x20%s,\x20%s',_0x2091bc,_0x426c06[_0xc776('0x12')][_0xc776('0x14')]);return _0x33eaf4(_0x426c06[_0xc776('0x12')][_0xc776('0x14')]);}logger['error'](_0xc776('0xd'),_0x2091bc,_0x426c06[_0xc776('0x12')]['message']);return _0x412af9(_0x426c06[_0xc776('0x12')][_0xc776('0x14')]);}else{logger[_0xc776('0xc')]('ZohoField,\x20%s,\x20%s',_0x2091bc,_0xc776('0xe'));_0x412af9(_0x426c06[_0xc776('0x15')][_0xc776('0x14')]);}})[_0xc776('0x16')](function(_0x500cb7){logger['error']('ZohoField,\x20%s,\x20%s',_0x2091bc,_0x500cb7);_0x33eaf4(_0x500cb7);});});} \ No newline at end of file +var _0xc846=['../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc846,0x70));var _0x6c84=function(_0x4b2d44,_0x3cb79f){_0x4b2d44=_0x4b2d44-0x0;var _0x359d92=_0xc846[_0x4b2d44];return _0x359d92;};'use strict';var _=require(_0x6c84('0x0'));var util=require(_0x6c84('0x1'));var moment=require('moment');var BPromise=require(_0x6c84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c84('0x3'));var db=require(_0x6c84('0x4'))['db'];var utils=require(_0x6c84('0x5'));var logger=require(_0x6c84('0x6'))(_0x6c84('0x7'));var config=require(_0x6c84('0x8'));var jayson=require(_0x6c84('0x9'));var client=jayson[_0x6c84('0xa')][_0x6c84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e5ca8,_0x5628ac,_0x2da8f8){return new BPromise(function(_0x2e6e46,_0x290148){return client[_0x6c84('0xc')](_0x5e5ca8,_0x2da8f8)[_0x6c84('0xd')](function(_0x532453){logger[_0x6c84('0xe')](_0x6c84('0xf'),_0x5628ac,_0x6c84('0x10'));logger[_0x6c84('0x11')](_0x6c84('0x12'),_0x5628ac,_0x6c84('0x10'),JSON[_0x6c84('0x13')](_0x532453));if(_0x532453[_0x6c84('0x14')]){if(_0x532453[_0x6c84('0x14')][_0x6c84('0x15')]===0x1f4){logger[_0x6c84('0x14')]('ZohoField,\x20%s,\x20%s',_0x5628ac,_0x532453['error'][_0x6c84('0x16')]);return _0x290148(_0x532453[_0x6c84('0x14')][_0x6c84('0x16')]);}logger[_0x6c84('0x14')]('ZohoField,\x20%s,\x20%s',_0x5628ac,_0x532453[_0x6c84('0x14')]['message']);return _0x2e6e46(_0x532453[_0x6c84('0x14')][_0x6c84('0x16')]);}else{logger['info'](_0x6c84('0xf'),_0x5628ac,_0x6c84('0x10'));_0x2e6e46(_0x532453[_0x6c84('0x17')][_0x6c84('0x16')]);}})['catch'](function(_0x45a6e6){logger['error'](_0x6c84('0xf'),_0x5628ac,_0x45a6e6);_0x290148(_0x45a6e6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5a3df7d..dcfdd87 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1edc1d,_0x12dd5c){var _0x760cc0=function(_0x2ac31b){while(--_0x2ac31b){_0x1edc1d['push'](_0x1edc1d['shift']());}};_0x760cc0(++_0x12dd5c);}(_0x70e0,0x17b));var _0x070e=function(_0x42cdf7,_0x397328){_0x42cdf7=_0x42cdf7-0x0;var _0x25419d=_0x70e0[_0x42cdf7];return _0x25419d;};'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(_0x570e42,_0x9c658a){var _0x5177c9=function(_0x291abc){while(--_0x291abc){_0x570e42['push'](_0x570e42['shift']());}};_0x5177c9(++_0x9c658a);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8e1290b..b7a3ba4 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 _0x9c00=['app.js','INTEGER','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x33ff2b,_0xcfeca6){var _0x1adb18=function(_0x4f4678){while(--_0x4f4678){_0x33ff2b['push'](_0x33ff2b['shift']());}};_0x1adb18(++_0xcfeca6);}(_0x9c00,0x1a0));var _0x09c0=function(_0xa6e83b,_0x266b29){_0xa6e83b=_0xa6e83b-0x0;var _0x21d379=_0x9c00[_0xa6e83b];return _0x21d379;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'unique':_0x09c0('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x09c0('0x4')},'filename':{'type':Sequelize[_0x09c0('0x2')]},'path':{'type':Sequelize[_0x09c0('0x2')]},'type':{'type':Sequelize[_0x09c0('0x2')]},'size':{'type':Sequelize[_0x09c0('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x09c0('0x2')]},'state':{'type':Sequelize[_0x09c0('0x2')],'unique':_0x09c0('0x6')},'description':{'type':Sequelize[_0x09c0('0x2')]},'title':{'type':Sequelize[_0x09c0('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb5f0=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','STRING'];(function(_0x3ac878,_0x4e4502){var _0x12f74c=function(_0x8cf855){while(--_0x8cf855){_0x3ac878['push'](_0x3ac878['shift']());}};_0x12f74c(++_0x4e4502);}(_0xb5f0,0x1da));var _0x0b5f=function(_0x596238,_0x155c16){_0x596238=_0x596238-0x0;var _0x1982b8=_0xb5f0[_0x596238];return _0x1982b8;};'use strict';var Sequelize=require(_0x0b5f('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b5f('0x1')],'allowNull':![],'unique':_0x0b5f('0x2')},'version':{'type':Sequelize[_0x0b5f('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x0b5f('0x1')],'defaultValue':_0x0b5f('0x3')},'filename':{'type':Sequelize[_0x0b5f('0x1')]},'path':{'type':Sequelize[_0x0b5f('0x1')]},'type':{'type':Sequelize[_0x0b5f('0x1')]},'size':{'type':Sequelize[_0x0b5f('0x4')]},'active':{'type':Sequelize[_0x0b5f('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x0b5f('0x1')]},'state':{'type':Sequelize[_0x0b5f('0x1')],'unique':_0x0b5f('0x6')},'description':{'type':Sequelize[_0x0b5f('0x1')]},'title':{'type':Sequelize[_0x0b5f('0x1')]},'remoteUri':{'type':Sequelize[_0x0b5f('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0cbb431..ab8a76d 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','Integration','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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d20ba,_0x92b596){_0x4d20ba=_0x4d20ba-0x0;var _0x4824d8=_0x5f2f[_0x4d20ba];return _0x4824d8;};'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 +var _0xc4aa=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Integration','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 075c514..8d9ba24 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 _0x954d=['../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','api','request-promise','path'];(function(_0x5c9f8f,_0x33a1f6){var _0x5bb83f=function(_0x882e0){while(--_0x882e0){_0x5c9f8f['push'](_0x5c9f8f['shift']());}};_0x5bb83f(++_0x33a1f6);}(_0x954d,0x1c9));var _0xd954=function(_0x4c7a4d,_0xf6fda9){_0x4c7a4d=_0x4c7a4d-0x0;var _0x16a471=_0x954d[_0x4c7a4d];return _0x16a471;};'use strict';var _=require('lodash');var util=require(_0xd954('0x0'));var logger=require(_0xd954('0x1'))(_0xd954('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd954('0x3'));var fs=require('fs');var path=require(_0xd954('0x4'));var rimraf=require('rimraf');var config=require(_0xd954('0x5'));var attributes=require(_0xd954('0x6'));module[_0xd954('0x7')]=function(_0x15262a,_0x13cce3){return _0x15262a[_0xd954('0x8')](_0xd954('0x9'),attributes,{'tableName':_0xd954('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81e2=['../../config/environment','exports','define','Integration','lodash','util','api','request-promise','path','rimraf'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x81e2,0xcc));var _0x281e=function(_0x5a2053,_0x2f6e2f){_0x5a2053=_0x5a2053-0x0;var _0x711931=_0x81e2[_0x5a2053];return _0x711931;};'use strict';var _=require(_0x281e('0x0'));var util=require(_0x281e('0x1'));var logger=require('../../config/logger')(_0x281e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x281e('0x3'));var fs=require('fs');var path=require(_0x281e('0x4'));var rimraf=require(_0x281e('0x5'));var config=require(_0x281e('0x6'));var attributes=require('./integration.attributes');module[_0x281e('0x7')]=function(_0x50406e,_0x2490ea){return _0x50406e[_0x281e('0x8')](_0x281e('0x9'),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 2dc7307..5bc6094 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 _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x44231b,_0x4b278f){var _0x3cb95d=function(_0x354b32){while(--_0x354b32){_0x44231b['push'](_0x44231b['shift']());}};_0x3cb95d(++_0x4b278f);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x4a1c42,_0x5f598f){_0x4a1c42=_0x4a1c42-0x0;var _0x30b506=_0xdd4f[_0x4a1c42];return _0x30b506;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});} \ No newline at end of file +var _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x507a33,_0x56ad14){var _0x2111c5=function(_0x39037d){while(--_0x39037d){_0x507a33['push'](_0x507a33['shift']());}};_0x2111c5(++_0x56ad14);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ea5a58e..08f4df8 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 _0xe2fe=['describe','/:id','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./integrationReport.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file +var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41565c,_0x537a06){var _0x4aab2e=function(_0x4cb191){while(--_0x4cb191){_0x41565c['push'](_0x41565c['shift']());}};_0x4aab2e(++_0x537a06);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x29a724,_0x5b9cb6){_0x29a724=_0x29a724-0x0;var _0x21b9e2=_0xc6ac[_0x29a724];return _0x21b9e2;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e135545..64cf845 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 _0x5a93=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5a93,0x149));var _0x35a9=function(_0x34238b,_0x424a09){_0x34238b=_0x34238b-0x0;var _0x38e94f=_0x5a93[_0x34238b];return _0x38e94f;};'use strict';var Sequelize=require(_0x35a9('0x0'));module[_0x35a9('0x1')]={'integration':{'type':Sequelize[_0x35a9('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x35a9('0x2')]},'ticketId':{'type':Sequelize[_0x35a9('0x2')]},'integrationId':{'type':Sequelize[_0x35a9('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x35a9('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x35a9('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x35a9('0x2')]},'membername':{'type':Sequelize[_0x35a9('0x2')]},'agentcalledAt':{'type':Sequelize[_0x35a9('0x4')]},'agentconnectAt':{'type':Sequelize[_0x35a9('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x35a9('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x35a9('0x4')]},'talktime':{'type':Sequelize[_0x35a9('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x35a9('0x3')]},'reason':{'type':Sequelize[_0x35a9('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x35a9('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x35a9('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x35a9('0x4')]},'lastevent':{'type':Sequelize[_0x35a9('0x2')]},'channel':{'type':Sequelize[_0x35a9('0x2')]},'channelstate':{'type':Sequelize[_0x35a9('0x3')]},'channelstatedesc':{'type':Sequelize[_0x35a9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x35a9('0x2')]},'connectedlinename':{'type':Sequelize[_0x35a9('0x2')]},'language':{'type':Sequelize[_0x35a9('0x2')]},'accountcode':{'type':Sequelize[_0x35a9('0x2')]},'context':{'type':Sequelize[_0x35a9('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x35a9('0x2')]},'destchannel':{'type':Sequelize[_0x35a9('0x2')]},'destchannelstate':{'type':Sequelize[_0x35a9('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x35a9('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x35a9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x35a9('0x2')]},'destlanguage':{'type':Sequelize[_0x35a9('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x35a9('0x2')]},'destexten':{'type':Sequelize[_0x35a9('0x2')]},'destpriority':{'type':Sequelize[_0x35a9('0x2')]},'destuniqueid':{'type':Sequelize[_0x35a9('0x2')]},'messageId':{'type':Sequelize[_0x35a9('0x2')]},'inReplyTo':{'type':Sequelize[_0x35a9('0x2')]},'subject':{'type':Sequelize[_0x35a9('0x2')]},'from':{'type':Sequelize[_0x35a9('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x35a9('0x6')]},'html':{'type':Sequelize[_0x35a9('0x6')]},'text':{'type':Sequelize[_0x35a9('0x6')]},'status':{'type':Sequelize[_0x35a9('0x7')](_0x35a9('0x8'),_0x35a9('0x9'),_0x35a9('0xa'),_0x35a9('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x35a9('0x2')]},'appdata':{'type':Sequelize[_0x35a9('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1bb4=['SENT','SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0x34bc66,_0x384004){var _0x33ce46=function(_0x34d411){while(--_0x34d411){_0x34bc66['push'](_0x34bc66['shift']());}};_0x33ce46(++_0x384004);}(_0x1bb4,0x92));var _0x41bb=function(_0x123b9c,_0x1fc4c5){_0x123b9c=_0x123b9c-0x0;var _0x285242=_0x1bb4[_0x123b9c];return _0x285242;};'use strict';var Sequelize=require(_0x41bb('0x0'));module[_0x41bb('0x1')]={'integration':{'type':Sequelize[_0x41bb('0x2')]},'eventChannel':{'type':Sequelize[_0x41bb('0x2')]},'exitStatus':{'type':Sequelize[_0x41bb('0x2')]},'ticketId':{'type':Sequelize[_0x41bb('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x41bb('0x2')]},'calleridname':{'type':Sequelize[_0x41bb('0x2')]},'queue':{'type':Sequelize[_0x41bb('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x41bb('0x2')]},'agentcalledAt':{'type':Sequelize[_0x41bb('0x3')]},'agentconnectAt':{'type':Sequelize[_0x41bb('0x3')]},'holdtime':{'type':Sequelize[_0x41bb('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x41bb('0x4')]},'agentacw':{'type':Sequelize[_0x41bb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x41bb('0x4')]},'reason':{'type':Sequelize[_0x41bb('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x41bb('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x41bb('0x3')]},'agentdump':{'type':Sequelize[_0x41bb('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x41bb('0x3')]},'lastevent':{'type':Sequelize[_0x41bb('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x41bb('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x41bb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x41bb('0x2')]},'priority':{'type':Sequelize[_0x41bb('0x2')]},'destchannel':{'type':Sequelize[_0x41bb('0x2')]},'destchannelstate':{'type':Sequelize[_0x41bb('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x41bb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x41bb('0x2')]},'destcalleridname':{'type':Sequelize[_0x41bb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x41bb('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x41bb('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x41bb('0x2')]},'destexten':{'type':Sequelize[_0x41bb('0x2')]},'destpriority':{'type':Sequelize[_0x41bb('0x2')]},'destuniqueid':{'type':Sequelize[_0x41bb('0x2')]},'messageId':{'type':Sequelize[_0x41bb('0x2')]},'inReplyTo':{'type':Sequelize[_0x41bb('0x2')]},'subject':{'type':Sequelize[_0x41bb('0x2')]},'from':{'type':Sequelize[_0x41bb('0x2')]},'to':{'type':Sequelize[_0x41bb('0x2')]},'cc':{'type':Sequelize[_0x41bb('0x2')]},'attachment':{'type':Sequelize[_0x41bb('0x6')]},'html':{'type':Sequelize[_0x41bb('0x6')]},'text':{'type':Sequelize[_0x41bb('0x6')]},'status':{'type':Sequelize['ENUM'](_0x41bb('0x7'),_0x41bb('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x41bb('0x2')]},'app':{'type':Sequelize[_0x41bb('0x2')]},'appdata':{'type':Sequelize[_0x41bb('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 b1049e9..94ebdd8 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 _0x5faf=['count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','IntegrationReport','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','mustache','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2c3fe3,_0x24a181){var _0x1b89a6=function(_0x260628){while(--_0x260628){_0x2c3fe3['push'](_0x2c3fe3['shift']());}};_0x1b89a6(++_0x24a181);}(_0x5faf,0x146));var _0xf5fa=function(_0x5f46e3,_0x2bad46){_0x5f46e3=_0x5f46e3-0x0;var _0x3f0785=_0x5faf[_0x5f46e3];return _0x3f0785;};'use strict';var emlformat=require(_0xf5fa('0x0'));var rimraf=require(_0xf5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5fa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf5fa('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf5fa('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf5fa('0x5'));var crypto=require(_0xf5fa('0x6'));var jsforce=require(_0xf5fa('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xf5fa('0x4'));var querystring=require('querystring');var Papa=require(_0xf5fa('0x8'));var Redis=require(_0xf5fa('0x9'));var authService=require(_0xf5fa('0xa'));var qs=require(_0xf5fa('0xb'));var as=require(_0xf5fa('0xc'));var hardwareService=require(_0xf5fa('0xd'));var logger=require('../../config/logger')(_0xf5fa('0xe'));var utils=require(_0xf5fa('0xf'));var config=require(_0xf5fa('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe4465a,_0xd85a6d){_0xd85a6d=_0xd85a6d||0xcc;return function(_0x198c9e){if(_0x198c9e){return _0xe4465a[_0xf5fa('0x11')](_0xd85a6d);}return _0xe4465a[_0xf5fa('0x12')](_0xd85a6d)[_0xf5fa('0x13')]();};}function respondWithResult(_0x3c890e,_0x2db69f){_0x2db69f=_0x2db69f||0xc8;return function(_0x48adad){if(_0x48adad){return _0x3c890e[_0xf5fa('0x12')](_0x2db69f)[_0xf5fa('0x14')](_0x48adad);}};}function respondWithFilteredResult(_0x18ae34,_0x41be6f){return function(_0x4c3032){if(_0x4c3032){var _0x468753=typeof _0x41be6f[_0xf5fa('0x15')]===_0xf5fa('0x16')&&typeof _0x41be6f[_0xf5fa('0x17')]===_0xf5fa('0x16');var _0x4b3f01=_0x4c3032['count'];var _0x53ed36=_0x468753?0x0:_0x41be6f[_0xf5fa('0x15')];var _0x43ed6c=_0x468753?_0x4c3032[_0xf5fa('0x18')]:_0x41be6f[_0xf5fa('0x15')]+_0x41be6f[_0xf5fa('0x17')];var _0x3a8cad;if(_0x43ed6c>=_0x4b3f01){_0x43ed6c=_0x4b3f01;_0x3a8cad=0xc8;}else{_0x3a8cad=0xce;}_0x18ae34[_0xf5fa('0x12')](_0x3a8cad);return _0x18ae34[_0xf5fa('0x19')](_0xf5fa('0x1a'),_0x53ed36+'-'+_0x43ed6c+'/'+_0x4b3f01)[_0xf5fa('0x14')](_0x4c3032);}return null;};}function patchUpdates(_0x3e588a){return function(_0x2a1c36){try{jsonpatch[_0xf5fa('0x1b')](_0x2a1c36,_0x3e588a,!![]);}catch(_0x224138){return BPromise[_0xf5fa('0x1c')](_0x224138);}return _0x2a1c36[_0xf5fa('0x1d')]();};}function saveUpdates(_0x460229,_0xa2ef5c){return function(_0x2a1a7a){if(_0x2a1a7a){return _0x2a1a7a[_0xf5fa('0x1e')](_0x460229)[_0xf5fa('0x1f')](function(_0x132510){return _0x132510;});}return null;};}function removeEntity(_0xf558e9,_0x26d7e2){return function(_0x1ce91f){if(_0x1ce91f){return _0x1ce91f[_0xf5fa('0x20')]()['then'](function(){_0xf558e9['status'](0xcc)[_0xf5fa('0x13')]();});}};}function handleEntityNotFound(_0x408240,_0x3e79a4){return function(_0x215805){if(!_0x215805){_0x408240['sendStatus'](0x194);}return _0x215805;};}function handleError(_0x411f8f,_0x297e9f){_0x297e9f=_0x297e9f||0x1f4;return function(_0x33dcd3){logger['error'](_0x33dcd3[_0xf5fa('0x21')]);if(_0x33dcd3[_0xf5fa('0x22')]){delete _0x33dcd3[_0xf5fa('0x22')];}_0x411f8f[_0xf5fa('0x12')](_0x297e9f)[_0xf5fa('0x23')](_0x33dcd3);};}exports['index']=function(_0x59381a,_0x192ac5){var _0x8cb227={},_0x1eddad={},_0x28d894={'count':0x0,'rows':[]};var _0x2365f3=_[_0xf5fa('0x24')](db['IntegrationReport']['rawAttributes'],function(_0x510d35){return{'name':_0x510d35[_0xf5fa('0x25')],'type':_0x510d35['type'][_0xf5fa('0x26')]};});_0x1eddad[_0xf5fa('0x27')]=_[_0xf5fa('0x24')](_0x2365f3,_0xf5fa('0x22'));_0x1eddad[_0xf5fa('0x28')]=_[_0xf5fa('0x29')](_0x59381a[_0xf5fa('0x28')]);_0x1eddad[_0xf5fa('0x2a')]=_[_0xf5fa('0x2b')](_0x1eddad[_0xf5fa('0x27')],_0x1eddad[_0xf5fa('0x28')]);_0x8cb227['attributes']=_[_0xf5fa('0x2b')](_0x1eddad[_0xf5fa('0x27')],qs[_0xf5fa('0x2c')](_0x59381a[_0xf5fa('0x28')][_0xf5fa('0x2c')]));_0x8cb227['attributes']=_0x8cb227[_0xf5fa('0x2d')]['length']?_0x8cb227[_0xf5fa('0x2d')]:_0x1eddad[_0xf5fa('0x27')];if(!_0x59381a['query']['hasOwnProperty'](_0xf5fa('0x2e'))){_0x8cb227['limit']=qs[_0xf5fa('0x17')](_0x59381a[_0xf5fa('0x28')][_0xf5fa('0x17')]);_0x8cb227[_0xf5fa('0x15')]=qs[_0xf5fa('0x15')](_0x59381a[_0xf5fa('0x28')][_0xf5fa('0x15')]);}_0x8cb227[_0xf5fa('0x2f')]=qs[_0xf5fa('0x30')](_0x59381a['query'][_0xf5fa('0x30')]);_0x8cb227[_0xf5fa('0x31')]=qs[_0xf5fa('0x2a')](_[_0xf5fa('0x32')](_0x59381a[_0xf5fa('0x28')],_0x1eddad['filters']),_0x2365f3);if(_0x59381a[_0xf5fa('0x28')][_0xf5fa('0x33')]){_0x8cb227[_0xf5fa('0x31')]=_[_0xf5fa('0x34')](_0x8cb227[_0xf5fa('0x31')],{'$or':_[_0xf5fa('0x24')](_0x2365f3,function(_0x434e03){if(_0x434e03[_0xf5fa('0x35')]!==_0xf5fa('0x36')){var _0x35f2f4={};_0x35f2f4[_0x434e03[_0xf5fa('0x22')]]={'$like':'%'+_0x59381a['query'][_0xf5fa('0x33')]+'%'};return _0x35f2f4;}})});}_0x8cb227=_[_0xf5fa('0x34')]({},_0x8cb227,_0x59381a[_0xf5fa('0x37')]);var _0x32bc22={'where':_0x8cb227[_0xf5fa('0x31')]};return db[_0xf5fa('0x38')][_0xf5fa('0x18')](_0x32bc22)[_0xf5fa('0x1f')](function(_0x12ea9a){_0x28d894[_0xf5fa('0x18')]=_0x12ea9a;if(_0x59381a[_0xf5fa('0x28')]['includeAll']){_0x8cb227[_0xf5fa('0x39')]=[{'all':!![]}];}return db[_0xf5fa('0x38')][_0xf5fa('0x3a')](_0x8cb227);})[_0xf5fa('0x1f')](function(_0x461a2d){_0x28d894[_0xf5fa('0x3b')]=_0x461a2d;return _0x28d894;})['then'](respondWithFilteredResult(_0x192ac5,_0x8cb227))[_0xf5fa('0x3c')](handleError(_0x192ac5,null));};exports[_0xf5fa('0x3d')]=function(_0x1e90f4,_0x4dbb9b){var _0x573b0a={'raw':![],'where':{'id':_0x1e90f4[_0xf5fa('0x3e')]['id']}},_0x426951={};_0x426951['model']=_[_0xf5fa('0x29')](db[_0xf5fa('0x38')][_0xf5fa('0x3f')]);_0x426951[_0xf5fa('0x28')]=_[_0xf5fa('0x29')](_0x1e90f4['query']);_0x426951['filters']=_['intersection'](_0x426951[_0xf5fa('0x27')],_0x426951[_0xf5fa('0x28')]);_0x573b0a[_0xf5fa('0x2d')]=_[_0xf5fa('0x2b')](_0x426951[_0xf5fa('0x27')],qs[_0xf5fa('0x2c')](_0x1e90f4[_0xf5fa('0x28')][_0xf5fa('0x2c')]));_0x573b0a[_0xf5fa('0x2d')]=_0x573b0a[_0xf5fa('0x2d')][_0xf5fa('0x40')]?_0x573b0a[_0xf5fa('0x2d')]:_0x426951[_0xf5fa('0x27')];if(_0x1e90f4[_0xf5fa('0x28')][_0xf5fa('0x41')]){_0x573b0a[_0xf5fa('0x39')]=[{'all':!![]}];}_0x573b0a=_[_0xf5fa('0x34')]({},_0x573b0a,_0x1e90f4[_0xf5fa('0x37')]);return db[_0xf5fa('0x38')][_0xf5fa('0x42')](_0x573b0a)[_0xf5fa('0x1f')](handleEntityNotFound(_0x4dbb9b,null))['then'](respondWithResult(_0x4dbb9b,null))[_0xf5fa('0x3c')](handleError(_0x4dbb9b,null));};exports[_0xf5fa('0x43')]=function(_0x284d31,_0xe28dee){return db[_0xf5fa('0x38')][_0xf5fa('0x43')](_0x284d31[_0xf5fa('0x44')],{})[_0xf5fa('0x1f')](respondWithResult(_0xe28dee,0xc9))[_0xf5fa('0x3c')](handleError(_0xe28dee,null));};exports[_0xf5fa('0x1e')]=function(_0x2d4ca9,_0x634e03){if(_0x2d4ca9['body']['id']){delete _0x2d4ca9[_0xf5fa('0x44')]['id'];}return db[_0xf5fa('0x38')][_0xf5fa('0x42')]({'where':{'id':_0x2d4ca9['params']['id']}})['then'](handleEntityNotFound(_0x634e03,null))[_0xf5fa('0x1f')](saveUpdates(_0x2d4ca9['body'],null))[_0xf5fa('0x1f')](respondWithResult(_0x634e03,null))[_0xf5fa('0x3c')](handleError(_0x634e03,null));};exports[_0xf5fa('0x20')]=function(_0x115e42,_0x260224){return db[_0xf5fa('0x38')][_0xf5fa('0x42')]({'where':{'id':_0x115e42['params']['id']}})['then'](handleEntityNotFound(_0x260224,null))[_0xf5fa('0x1f')](removeEntity(_0x260224,null))[_0xf5fa('0x3c')](handleError(_0x260224,null));};exports[_0xf5fa('0x45')]=function(_0x2e2245,_0x369c7a){return db[_0xf5fa('0x38')][_0xf5fa('0x45')]()[_0xf5fa('0x1f')](respondWithResult(_0x369c7a,null))['catch'](handleError(_0x369c7a,null));}; \ No newline at end of file +var _0xaf89=['save','update','then','destroy','error','stack','name','send','IntegrationReport','rawAttributes','fieldName','map','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x111692,_0x5a7ae3){var _0xf6cda0=function(_0xbf1fbf){while(--_0xbf1fbf){_0x111692['push'](_0x111692['shift']());}};_0xf6cda0(++_0x5a7ae3);}(_0xaf89,0xaf));var _0x9af8=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xaf89[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x9af8('0x0'));var rimraf=require(_0x9af8('0x1'));var zipdir=require(_0x9af8('0x2'));var jsonpatch=require(_0x9af8('0x3'));var rp=require('request-promise');var moment=require(_0x9af8('0x4'));var BPromise=require(_0x9af8('0x5'));var Mustache=require(_0x9af8('0x6'));var util=require(_0x9af8('0x7'));var path=require('path');var sox=require(_0x9af8('0x8'));var csv=require(_0x9af8('0x9'));var ejs=require(_0x9af8('0xa'));var fs=require('fs');var fs_extra=require(_0x9af8('0xb'));var _=require('lodash');var squel=require(_0x9af8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9af8('0xd'));var toCsv=require(_0x9af8('0x9'));var querystring=require('querystring');var Papa=require(_0x9af8('0xe'));var Redis=require(_0x9af8('0xf'));var authService=require(_0x9af8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9af8('0x11'));var hardwareService=require(_0x9af8('0x12'));var logger=require('../../config/logger')(_0x9af8('0x13'));var utils=require(_0x9af8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9af8('0x15'));var db=require(_0x9af8('0x16'))['db'];function respondWithStatusCode(_0x5bc6c0,_0x4fca57){_0x4fca57=_0x4fca57||0xcc;return function(_0x19ff3e){if(_0x19ff3e){return _0x5bc6c0[_0x9af8('0x17')](_0x4fca57);}return _0x5bc6c0[_0x9af8('0x18')](_0x4fca57)[_0x9af8('0x19')]();};}function respondWithResult(_0x50b860,_0x3f4329){_0x3f4329=_0x3f4329||0xc8;return function(_0x9cab9c){if(_0x9cab9c){return _0x50b860['status'](_0x3f4329)[_0x9af8('0x1a')](_0x9cab9c);}};}function respondWithFilteredResult(_0x134ed0,_0x3fa6c2){return function(_0x1ee27a){if(_0x1ee27a){var _0x2a9636=typeof _0x3fa6c2[_0x9af8('0x1b')]===_0x9af8('0x1c')&&typeof _0x3fa6c2[_0x9af8('0x1d')]===_0x9af8('0x1c');var _0x517879=_0x1ee27a[_0x9af8('0x1e')];var _0x53ec98=_0x2a9636?0x0:_0x3fa6c2[_0x9af8('0x1b')];var _0x31f9a3=_0x2a9636?_0x1ee27a[_0x9af8('0x1e')]:_0x3fa6c2[_0x9af8('0x1b')]+_0x3fa6c2['limit'];var _0x588c69;if(_0x31f9a3>=_0x517879){_0x31f9a3=_0x517879;_0x588c69=0xc8;}else{_0x588c69=0xce;}_0x134ed0['status'](_0x588c69);return _0x134ed0[_0x9af8('0x1f')]('Content-Range',_0x53ec98+'-'+_0x31f9a3+'/'+_0x517879)[_0x9af8('0x1a')](_0x1ee27a);}return null;};}function patchUpdates(_0x34f5d7){return function(_0x411c25){try{jsonpatch['apply'](_0x411c25,_0x34f5d7,!![]);}catch(_0x31f80d){return BPromise['reject'](_0x31f80d);}return _0x411c25[_0x9af8('0x20')]();};}function saveUpdates(_0x1fa62a,_0x3cd47e){return function(_0xf4bac3){if(_0xf4bac3){return _0xf4bac3[_0x9af8('0x21')](_0x1fa62a)[_0x9af8('0x22')](function(_0x85f2a3){return _0x85f2a3;});}return null;};}function removeEntity(_0x29b47f,_0x54f295){return function(_0x7d2b31){if(_0x7d2b31){return _0x7d2b31[_0x9af8('0x23')]()[_0x9af8('0x22')](function(){_0x29b47f[_0x9af8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x677e6e,_0x141e7a){return function(_0x30d8e6){if(!_0x30d8e6){_0x677e6e[_0x9af8('0x17')](0x194);}return _0x30d8e6;};}function handleError(_0x5ada7e,_0x1608c7){_0x1608c7=_0x1608c7||0x1f4;return function(_0xfda6ea){logger[_0x9af8('0x24')](_0xfda6ea[_0x9af8('0x25')]);if(_0xfda6ea[_0x9af8('0x26')]){delete _0xfda6ea[_0x9af8('0x26')];}_0x5ada7e[_0x9af8('0x18')](_0x1608c7)[_0x9af8('0x27')](_0xfda6ea);};}exports['index']=function(_0x4fdaae,_0x50c250){var _0x480cae={},_0x6c0c16={},_0x5c8335={'count':0x0,'rows':[]};var _0x5d840a=_['map'](db[_0x9af8('0x28')][_0x9af8('0x29')],function(_0x5a6eaa){return{'name':_0x5a6eaa[_0x9af8('0x2a')],'type':_0x5a6eaa['type']['key']};});_0x6c0c16['model']=_[_0x9af8('0x2b')](_0x5d840a,'name');_0x6c0c16[_0x9af8('0x2c')]=_['keys'](_0x4fdaae[_0x9af8('0x2c')]);_0x6c0c16['filters']=_['intersection'](_0x6c0c16[_0x9af8('0x2d')],_0x6c0c16[_0x9af8('0x2c')]);_0x480cae[_0x9af8('0x2e')]=_[_0x9af8('0x2f')](_0x6c0c16[_0x9af8('0x2d')],qs[_0x9af8('0x30')](_0x4fdaae[_0x9af8('0x2c')][_0x9af8('0x30')]));_0x480cae['attributes']=_0x480cae[_0x9af8('0x2e')][_0x9af8('0x31')]?_0x480cae['attributes']:_0x6c0c16[_0x9af8('0x2d')];if(!_0x4fdaae['query'][_0x9af8('0x32')](_0x9af8('0x33'))){_0x480cae[_0x9af8('0x1d')]=qs[_0x9af8('0x1d')](_0x4fdaae['query'][_0x9af8('0x1d')]);_0x480cae[_0x9af8('0x1b')]=qs[_0x9af8('0x1b')](_0x4fdaae['query'][_0x9af8('0x1b')]);}_0x480cae['order']=qs[_0x9af8('0x34')](_0x4fdaae[_0x9af8('0x2c')][_0x9af8('0x34')]);_0x480cae[_0x9af8('0x35')]=qs[_0x9af8('0x36')](_['pick'](_0x4fdaae[_0x9af8('0x2c')],_0x6c0c16[_0x9af8('0x36')]),_0x5d840a);if(_0x4fdaae[_0x9af8('0x2c')][_0x9af8('0x37')]){_0x480cae[_0x9af8('0x35')]=_[_0x9af8('0x38')](_0x480cae['where'],{'$or':_[_0x9af8('0x2b')](_0x5d840a,function(_0x3960f6){if(_0x3960f6['type']!==_0x9af8('0x39')){var _0x3e5ef5={};_0x3e5ef5[_0x3960f6[_0x9af8('0x26')]]={'$like':'%'+_0x4fdaae['query'][_0x9af8('0x37')]+'%'};return _0x3e5ef5;}})});}_0x480cae=_[_0x9af8('0x38')]({},_0x480cae,_0x4fdaae[_0x9af8('0x3a')]);var _0xc6263={'where':_0x480cae[_0x9af8('0x35')]};return db[_0x9af8('0x28')][_0x9af8('0x1e')](_0xc6263)[_0x9af8('0x22')](function(_0x2d1553){_0x5c8335['count']=_0x2d1553;if(_0x4fdaae[_0x9af8('0x2c')][_0x9af8('0x3b')]){_0x480cae[_0x9af8('0x3c')]=[{'all':!![]}];}return db[_0x9af8('0x28')][_0x9af8('0x3d')](_0x480cae);})['then'](function(_0x3842df){_0x5c8335[_0x9af8('0x3e')]=_0x3842df;return _0x5c8335;})[_0x9af8('0x22')](respondWithFilteredResult(_0x50c250,_0x480cae))[_0x9af8('0x3f')](handleError(_0x50c250,null));};exports['show']=function(_0x1d72f2,_0x25e888){var _0x342f3a={'raw':![],'where':{'id':_0x1d72f2[_0x9af8('0x40')]['id']}},_0x5d5eca={};_0x5d5eca[_0x9af8('0x2d')]=_[_0x9af8('0x41')](db[_0x9af8('0x28')][_0x9af8('0x29')]);_0x5d5eca[_0x9af8('0x2c')]=_[_0x9af8('0x41')](_0x1d72f2[_0x9af8('0x2c')]);_0x5d5eca[_0x9af8('0x36')]=_[_0x9af8('0x2f')](_0x5d5eca[_0x9af8('0x2d')],_0x5d5eca['query']);_0x342f3a[_0x9af8('0x2e')]=_[_0x9af8('0x2f')](_0x5d5eca[_0x9af8('0x2d')],qs[_0x9af8('0x30')](_0x1d72f2['query']['fields']));_0x342f3a['attributes']=_0x342f3a[_0x9af8('0x2e')]['length']?_0x342f3a[_0x9af8('0x2e')]:_0x5d5eca['model'];if(_0x1d72f2[_0x9af8('0x2c')][_0x9af8('0x3b')]){_0x342f3a['include']=[{'all':!![]}];}_0x342f3a=_[_0x9af8('0x38')]({},_0x342f3a,_0x1d72f2[_0x9af8('0x3a')]);return db[_0x9af8('0x28')][_0x9af8('0x42')](_0x342f3a)['then'](handleEntityNotFound(_0x25e888,null))[_0x9af8('0x22')](respondWithResult(_0x25e888,null))[_0x9af8('0x3f')](handleError(_0x25e888,null));};exports[_0x9af8('0x43')]=function(_0x17e54d,_0x47c277){return db[_0x9af8('0x28')][_0x9af8('0x43')](_0x17e54d[_0x9af8('0x44')],{})[_0x9af8('0x22')](respondWithResult(_0x47c277,0xc9))[_0x9af8('0x3f')](handleError(_0x47c277,null));};exports[_0x9af8('0x21')]=function(_0x13f817,_0x11c182){if(_0x13f817[_0x9af8('0x44')]['id']){delete _0x13f817['body']['id'];}return db[_0x9af8('0x28')]['find']({'where':{'id':_0x13f817[_0x9af8('0x40')]['id']}})['then'](handleEntityNotFound(_0x11c182,null))[_0x9af8('0x22')](saveUpdates(_0x13f817['body'],null))[_0x9af8('0x22')](respondWithResult(_0x11c182,null))[_0x9af8('0x3f')](handleError(_0x11c182,null));};exports['destroy']=function(_0x444566,_0x459c84){return db[_0x9af8('0x28')][_0x9af8('0x42')]({'where':{'id':_0x444566[_0x9af8('0x40')]['id']}})['then'](handleEntityNotFound(_0x459c84,null))['then'](removeEntity(_0x459c84,null))[_0x9af8('0x3f')](handleError(_0x459c84,null));};exports['describe']=function(_0x20298c,_0x3044fa){return db[_0x9af8('0x28')]['describe']()[_0x9af8('0x22')](respondWithResult(_0x3044fa,null))[_0x9af8('0x3f')](handleError(_0x3044fa,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2161bea..67291f4 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 _0xb591=['../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird'];(function(_0x22fc85,_0x2d521a){var _0x424cb0=function(_0x28e6fd){while(--_0x28e6fd){_0x22fc85['push'](_0x22fc85['shift']());}};_0x424cb0(++_0x2d521a);}(_0xb591,0x92));var _0x1b59=function(_0x3351b6,_0x37d07b){_0x3351b6=_0x3351b6-0x0;var _0x1fe058=_0xb591[_0x3351b6];return _0x1fe058;};'use strict';var _=require('lodash');var util=require(_0x1b59('0x0'));var logger=require(_0x1b59('0x1'))(_0x1b59('0x2'));var moment=require('moment');var BPromise=require(_0x1b59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b59('0x4'));var attributes=require(_0x1b59('0x5'));module[_0x1b59('0x6')]=function(_0x4c2e50,_0x6b7fad){return _0x4c2e50[_0x1b59('0x7')](_0x1b59('0x8'),attributes,{'tableName':_0x1b59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa651=['exports','define','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ed928,_0x3c33b0){var _0x36712a=function(_0x4cbcf6){while(--_0x4cbcf6){_0x1ed928['push'](_0x1ed928['shift']());}};_0x36712a(++_0x3c33b0);}(_0xa651,0xab));var _0x1a65=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0xa651[_0x30780e];return _0x5b9129;};'use strict';var _=require(_0x1a65('0x0'));var util=require(_0x1a65('0x1'));var logger=require(_0x1a65('0x2'))(_0x1a65('0x3'));var moment=require(_0x1a65('0x4'));var BPromise=require(_0x1a65('0x5'));var rp=require(_0x1a65('0x6'));var fs=require('fs');var path=require(_0x1a65('0x7'));var rimraf=require(_0x1a65('0x8'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x1a65('0x9')]=function(_0x195dde,_0x5ccff1){return _0x195dde[_0x1a65('0xa')]('IntegrationReport',attributes,{'tableName':_0x1a65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index ac7c76c..1e9de3d 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x18fabc,_0x73e8aa){var _0x20fa08=function(_0x335bd6){while(--_0x335bd6){_0x18fabc['push'](_0x18fabc['shift']());}};_0x20fa08(++_0x73e8aa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x53ec,0x192));var _0xc53e=function(_0x1d4e21,_0x4e8096){_0x1d4e21=_0x1d4e21-0x0;var _0x178fef=_0x53ec[_0x1d4e21];return _0x178fef;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5432fe6..661714d 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 _0xa0a1=['isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addIntervals','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./interval.controller','get','index','/:id'];(function(_0x278583,_0x15dbca){var _0x462e6f=function(_0x41814e){while(--_0x41814e){_0x278583['push'](_0x278583['shift']());}};_0x462e6f(++_0x15dbca);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x4fe0c,_0x1f9112){_0x4fe0c=_0x4fe0c-0x0;var _0x4dd2cc=_0xa0a1[_0x4fe0c];return _0x4dd2cc;};'use strict';var multer=require(_0x1a0a('0x0'));var util=require('util');var path=require(_0x1a0a('0x1'));var timeout=require(_0x1a0a('0x2'));var express=require(_0x1a0a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1a0a('0x4'));var interaction=require(_0x1a0a('0x5'));var config=require('../../config/environment');var controller=require(_0x1a0a('0x6'));router[_0x1a0a('0x7')]('/',auth['isAuthenticated'](),controller[_0x1a0a('0x8')]);router[_0x1a0a('0x7')](_0x1a0a('0x9'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xb')]);router['get'](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1a0a('0xe')](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),controller['addInterval']);router[_0x1a0a('0xe')]('/:id/sub_intervals/create_many',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xf')]);router[_0x1a0a('0x10')](_0x1a0a('0x9'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x11')]);router[_0x1a0a('0x12')]('/:id',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x13')]);module[_0x1a0a('0x14')]=router; \ No newline at end of file +var _0xd1b5=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer'];(function(_0x389f51,_0x9804e2){var _0x49aafa=function(_0x30fa79){while(--_0x30fa79){_0x389f51['push'](_0x389f51['shift']());}};_0x49aafa(++_0x9804e2);}(_0xd1b5,0x67));var _0x5d1b=function(_0x498a2f,_0x4a5d59){_0x498a2f=_0x498a2f-0x0;var _0x17acdb=_0xd1b5[_0x498a2f];return _0x17acdb;};'use strict';var multer=require(_0x5d1b('0x0'));var util=require(_0x5d1b('0x1'));var path=require('path');var timeout=require(_0x5d1b('0x2'));var express=require('express');var router=express[_0x5d1b('0x3')]();var fs_extra=require(_0x5d1b('0x4'));var auth=require(_0x5d1b('0x5'));var interaction=require(_0x5d1b('0x6'));var config=require(_0x5d1b('0x7'));var controller=require(_0x5d1b('0x8'));router[_0x5d1b('0x9')]('/',auth[_0x5d1b('0xa')](),controller[_0x5d1b('0xb')]);router['get'](_0x5d1b('0xc'),auth[_0x5d1b('0xa')](),controller[_0x5d1b('0xd')]);router['get'](_0x5d1b('0xe'),auth[_0x5d1b('0xa')](),controller[_0x5d1b('0xf')]);router[_0x5d1b('0x10')]('/',auth[_0x5d1b('0xa')](),controller[_0x5d1b('0x11')]);router[_0x5d1b('0x10')](_0x5d1b('0xe'),auth[_0x5d1b('0xa')](),controller[_0x5d1b('0x12')]);router['post'](_0x5d1b('0x13'),auth[_0x5d1b('0xa')](),controller[_0x5d1b('0x14')]);router[_0x5d1b('0x15')]('/:id',auth[_0x5d1b('0xa')](),controller[_0x5d1b('0x16')]);router[_0x5d1b('0x17')](_0x5d1b('0xc'),auth['isAuthenticated'](),controller[_0x5d1b('0x18')]);module[_0x5d1b('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 3121c80..0a7fee4 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 _0x8be9=['exports','STRING','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8be9,0x1b5));var _0x98be=function(_0x543d50,_0x1f3906){_0x543d50=_0x543d50-0x0;var _0x45ea40=_0x8be9[_0x543d50];return _0x45ea40;};'use strict';var Sequelize=require(_0x98be('0x0'));module[_0x98be('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x98be('0x2')]},'interval':{'type':Sequelize[_0x98be('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x91dc=['STRING','sequelize','exports'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x91dc,0x1cf));var _0xc91d=function(_0x58f08a,_0xe92ec1){_0x58f08a=_0x58f08a-0x0;var _0xd55a5=_0x91dc[_0x58f08a];return _0xd55a5;};'use strict';var Sequelize=require(_0xc91d('0x0'));module[_0xc91d('0x1')]={'name':{'type':Sequelize[_0xc91d('0x2')]},'description':{'type':Sequelize[_0xc91d('0x2')]},'interval':{'type':Sequelize[_0xc91d('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8ac9c11..aacef49 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 _0x80b2=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','filter','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','map','keys','query','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create'];(function(_0x583998,_0x49c395){var _0x39780b=function(_0x260d57){while(--_0x260d57){_0x583998['push'](_0x583998['shift']());}};_0x39780b(++_0x49c395);}(_0x80b2,0x64));var _0x280b=function(_0x102d06,_0x40aefa){_0x102d06=_0x102d06-0x0;var _0x40b185=_0x80b2[_0x102d06];return _0x40b185;};'use strict';var emlformat=require(_0x280b('0x0'));var rimraf=require(_0x280b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x280b('0x2'));var rp=require(_0x280b('0x3'));var moment=require(_0x280b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x280b('0x5'));var util=require(_0x280b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x280b('0x7'));var ejs=require(_0x280b('0x8'));var fs=require('fs');var fs_extra=require(_0x280b('0x9'));var _=require(_0x280b('0xa'));var squel=require(_0x280b('0xb'));var crypto=require('crypto');var jsforce=require(_0x280b('0xc'));var deskjs=require(_0x280b('0xd'));var toCsv=require(_0x280b('0x7'));var querystring=require(_0x280b('0xe'));var Papa=require('papaparse');var Redis=require(_0x280b('0xf'));var authService=require(_0x280b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x280b('0x11'))('api');var utils=require(_0x280b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x280b('0x13'));var db=require('../../mysqldb')['db'];var extensions=require(_0x280b('0x14'));function respondWithStatusCode(_0x3a2a8b,_0x103e8f){_0x103e8f=_0x103e8f||0xcc;return function(_0x1750e9){if(_0x1750e9){return _0x3a2a8b[_0x280b('0x15')](_0x103e8f);}return _0x3a2a8b[_0x280b('0x16')](_0x103e8f)[_0x280b('0x17')]();};}function respondWithResult(_0x5cee65,_0x5e1bdb){_0x5e1bdb=_0x5e1bdb||0xc8;return function(_0x3b8adb){if(_0x3b8adb){return _0x5cee65[_0x280b('0x16')](_0x5e1bdb)[_0x280b('0x18')](_0x3b8adb);}};}function respondWithFilteredResult(_0x23fb71,_0x3c9258){return function(_0x3274a4){if(_0x3274a4){var _0x465eae=typeof _0x3c9258[_0x280b('0x19')]===_0x280b('0x1a')&&typeof _0x3c9258[_0x280b('0x1b')]==='undefined';var _0x5c81c7=_0x3274a4['count'];var _0x58112a=_0x465eae?0x0:_0x3c9258[_0x280b('0x19')];var _0x1ae37b=_0x465eae?_0x3274a4[_0x280b('0x1c')]:_0x3c9258[_0x280b('0x19')]+_0x3c9258[_0x280b('0x1b')];var _0x169133;if(_0x1ae37b>=_0x5c81c7){_0x1ae37b=_0x5c81c7;_0x169133=0xc8;}else{_0x169133=0xce;}_0x23fb71[_0x280b('0x16')](_0x169133);return _0x23fb71[_0x280b('0x1d')](_0x280b('0x1e'),_0x58112a+'-'+_0x1ae37b+'/'+_0x5c81c7)[_0x280b('0x18')](_0x3274a4);}return null;};}function patchUpdates(_0x4acecd){return function(_0x5ac683){try{jsonpatch[_0x280b('0x1f')](_0x5ac683,_0x4acecd,!![]);}catch(_0x343a32){return BPromise['reject'](_0x343a32);}return _0x5ac683[_0x280b('0x20')]();};}function saveUpdates(_0x1ed500,_0x4f2407){return function(_0x3b33ba){if(_0x3b33ba){return _0x3b33ba['update'](_0x1ed500)[_0x280b('0x21')](function(_0x35cd58){return _0x35cd58;});}return null;};}function removeEntity(_0x2cdfcf,_0x4913c9){return function(_0x5deeac){if(_0x5deeac){return _0x5deeac[_0x280b('0x22')]()[_0x280b('0x21')](function(){var _0x2a1013=_0x5deeac[_0x280b('0x23')]({'plain':!![]});var _0x7f3895=_0x280b('0x24');return db[_0x280b('0x25')][_0x280b('0x22')]({'where':{'type':_0x7f3895,'resourceId':_0x2a1013['id']}})['then'](function(){return _0x5deeac;});})['then'](function(){_0x2cdfcf['status'](0xcc)[_0x280b('0x17')]();});}};}function handleEntityNotFound(_0x3d6fe2,_0x5af4c7){return function(_0x50cbce){if(!_0x50cbce){_0x3d6fe2[_0x280b('0x15')](0x194);}return _0x50cbce;};}function handleError(_0x2ce0df,_0x262b27){_0x262b27=_0x262b27||0x1f4;return function(_0x4233f1){logger[_0x280b('0x26')](_0x4233f1[_0x280b('0x27')]);if(_0x4233f1[_0x280b('0x28')]){delete _0x4233f1[_0x280b('0x28')];}_0x2ce0df[_0x280b('0x16')](_0x262b27)[_0x280b('0x29')](_0x4233f1);};}exports['index']=function(_0x31f050,_0x3e5c04){var _0x1fa5e6={},_0x13687a={},_0x36f752={'count':0x0,'rows':[]};var _0x7844d6=_['map'](db[_0x280b('0x2a')][_0x280b('0x2b')],function(_0x5be246){return{'name':_0x5be246[_0x280b('0x2c')],'type':_0x5be246[_0x280b('0x2d')][_0x280b('0x2e')]};});_0x13687a['model']=_[_0x280b('0x2f')](_0x7844d6,_0x280b('0x28'));_0x13687a['query']=_[_0x280b('0x30')](_0x31f050[_0x280b('0x31')]);_0x13687a['filters']=_['intersection'](_0x13687a[_0x280b('0x32')],_0x13687a[_0x280b('0x31')]);_0x1fa5e6[_0x280b('0x33')]=_['intersection'](_0x13687a[_0x280b('0x32')],qs[_0x280b('0x34')](_0x31f050[_0x280b('0x31')]['fields']));_0x1fa5e6['attributes']=_0x1fa5e6['attributes']['length']?_0x1fa5e6[_0x280b('0x33')]:_0x13687a[_0x280b('0x32')];if(!_0x31f050['query'][_0x280b('0x35')](_0x280b('0x36'))){_0x1fa5e6[_0x280b('0x1b')]=qs['limit'](_0x31f050[_0x280b('0x31')]['limit']);_0x1fa5e6['offset']=qs[_0x280b('0x19')](_0x31f050[_0x280b('0x31')][_0x280b('0x19')]);}_0x1fa5e6[_0x280b('0x37')]=qs['sort'](_0x31f050[_0x280b('0x31')][_0x280b('0x38')]);_0x1fa5e6[_0x280b('0x39')]=qs[_0x280b('0x3a')](_[_0x280b('0x3b')](_0x31f050[_0x280b('0x31')],_0x13687a[_0x280b('0x3a')]),_0x7844d6);if(_0x31f050['query']['filter']){_0x1fa5e6[_0x280b('0x39')]=_[_0x280b('0x3c')](_0x1fa5e6[_0x280b('0x39')],{'$or':_[_0x280b('0x2f')](_0x7844d6,function(_0x54b863){if(_0x54b863[_0x280b('0x2d')]!=='VIRTUAL'){var _0x424433={};_0x424433[_0x54b863['name']]={'$like':'%'+_0x31f050['query']['filter']+'%'};return _0x424433;}})});}_0x1fa5e6=_[_0x280b('0x3c')]({},_0x1fa5e6,_0x31f050[_0x280b('0x3d')]);var _0x3f49a5={'where':_0x1fa5e6['where']};return db[_0x280b('0x2a')]['count'](_0x3f49a5)['then'](function(_0x2bd431){_0x36f752[_0x280b('0x1c')]=_0x2bd431;if(_0x31f050[_0x280b('0x31')]['includeAll']){_0x1fa5e6[_0x280b('0x3e')]=[{'all':!![]}];}return db[_0x280b('0x2a')][_0x280b('0x3f')](_0x1fa5e6);})[_0x280b('0x21')](function(_0x1efe7d){_0x36f752[_0x280b('0x40')]=_0x1efe7d;return _0x36f752;})[_0x280b('0x21')](respondWithFilteredResult(_0x3e5c04,_0x1fa5e6))[_0x280b('0x41')](handleError(_0x3e5c04,null));};exports[_0x280b('0x42')]=function(_0x1142ef,_0x2d39ec){var _0xede863={'raw':!![],'where':{'id':_0x1142ef[_0x280b('0x43')]['id']}},_0x2e7c74={};_0x2e7c74['model']=_[_0x280b('0x30')](db[_0x280b('0x2a')]['rawAttributes']);_0x2e7c74[_0x280b('0x31')]=_[_0x280b('0x30')](_0x1142ef[_0x280b('0x31')]);_0x2e7c74[_0x280b('0x3a')]=_[_0x280b('0x44')](_0x2e7c74['model'],_0x2e7c74['query']);_0xede863[_0x280b('0x33')]=_['intersection'](_0x2e7c74[_0x280b('0x32')],qs[_0x280b('0x34')](_0x1142ef[_0x280b('0x31')]['fields']));_0xede863[_0x280b('0x33')]=_0xede863[_0x280b('0x33')][_0x280b('0x45')]?_0xede863['attributes']:_0x2e7c74['model'];if(_0x1142ef[_0x280b('0x31')][_0x280b('0x46')]){_0xede863[_0x280b('0x3e')]=[{'all':!![]}];}_0xede863=_['merge']({},_0xede863,_0x1142ef['options']);return db[_0x280b('0x2a')]['find'](_0xede863)[_0x280b('0x21')](handleEntityNotFound(_0x2d39ec,null))[_0x280b('0x21')](respondWithResult(_0x2d39ec,null))[_0x280b('0x41')](handleError(_0x2d39ec,null));};exports['create']=function(_0x3d2115,_0xeeb5f6){return db[_0x280b('0x2a')]['create'](_0x3d2115[_0x280b('0x47')],{})[_0x280b('0x21')](function(_0x498490){var _0x2b4f28=_0x3d2115[_0x280b('0x48')][_0x280b('0x23')]({'plain':!![]});if(!_0x2b4f28)throw new Error(_0x280b('0x49'));if(_0x2b4f28[_0x280b('0x4a')]===_0x280b('0x48')){var _0x46d30d=_0x498490['get']({'plain':!![]});var _0x444beb='Intervals';return db[_0x280b('0x4b')][_0x280b('0x4c')]({'where':{'name':_0x444beb,'userProfileId':_0x2b4f28[_0x280b('0x4d')]},'raw':!![]})[_0x280b('0x21')](function(_0x23c49e){if(_0x23c49e&&_0x23c49e[_0x280b('0x4e')]===0x0){return db[_0x280b('0x25')][_0x280b('0x4f')]({'name':_0x46d30d[_0x280b('0x28')],'resourceId':_0x46d30d['id'],'type':_0x23c49e[_0x280b('0x28')],'sectionId':_0x23c49e['id']},{})[_0x280b('0x21')](function(){return _0x498490;});}else{return _0x498490;}})['catch'](function(_0x9021f8){logger[_0x280b('0x26')](_0x280b('0x50'),_0x9021f8);throw _0x9021f8;});}return _0x498490;})[_0x280b('0x21')](respondWithResult(_0xeeb5f6,0xc9))[_0x280b('0x41')](handleError(_0xeeb5f6,null));};exports[_0x280b('0x51')]=function(_0xa92f75,_0x318fbe){if(_0xa92f75[_0x280b('0x47')]['id']){delete _0xa92f75[_0x280b('0x47')]['id'];}return db['Interval'][_0x280b('0x4c')]({'where':{'id':_0xa92f75['params']['id']}})[_0x280b('0x21')](handleEntityNotFound(_0x318fbe,null))[_0x280b('0x21')](saveUpdates(_0xa92f75['body'],null))[_0x280b('0x21')](respondWithResult(_0x318fbe,null))[_0x280b('0x41')](handleError(_0x318fbe,null));};exports[_0x280b('0x22')]=function(_0x38f75d,_0x39d160){return db['Interval']['find']({'where':{'id':_0x38f75d['params']['id']}})[_0x280b('0x21')](handleEntityNotFound(_0x39d160,null))[_0x280b('0x21')](removeEntity(_0x39d160,null))[_0x280b('0x41')](handleError(_0x39d160,null));};exports[_0x280b('0x52')]=function(_0x26aa10,_0x39cbc5,_0x107c91){if(_0x26aa10[_0x280b('0x47')]['id']){delete _0x26aa10[_0x280b('0x47')]['id'];}return db[_0x280b('0x2a')]['find']({'where':{'id':_0x26aa10['params']['id']}})[_0x280b('0x21')](handleEntityNotFound(_0x39cbc5,null))['then'](function(_0x56e144){if(_0x56e144){_0x26aa10[_0x280b('0x47')][_0x280b('0x53')]=_0x56e144['id'];return db[_0x280b('0x2a')][_0x280b('0x4f')](_0x26aa10['body']);}})[_0x280b('0x21')](respondWithResult(_0x39cbc5,null))[_0x280b('0x41')](handleError(_0x39cbc5,null));};exports[_0x280b('0x54')]=function(_0x2d577b,_0x43025e,_0xbd1fd4){var _0x55a23c={};var _0x7cae9d={};var _0x39c5d3;var _0x89df25;return db[_0x280b('0x2a')][_0x280b('0x55')]({'where':{'id':_0x2d577b[_0x280b('0x43')]['id']}})['then'](handleEntityNotFound(_0x43025e,null))[_0x280b('0x21')](function(_0x168786){if(_0x168786){_0x39c5d3=_0x168786;_0x7cae9d['model']=_[_0x280b('0x30')](db[_0x280b('0x2a')]['rawAttributes']);_0x7cae9d[_0x280b('0x31')]=_[_0x280b('0x30')](_0x2d577b[_0x280b('0x31')]);_0x7cae9d[_0x280b('0x3a')]=_['intersection'](_0x7cae9d[_0x280b('0x32')],_0x7cae9d[_0x280b('0x31')]);_0x55a23c['attributes']=_[_0x280b('0x44')](_0x7cae9d[_0x280b('0x32')],qs['fields'](_0x2d577b[_0x280b('0x31')][_0x280b('0x34')]));_0x55a23c['attributes']=_0x55a23c[_0x280b('0x33')][_0x280b('0x45')]?_0x55a23c[_0x280b('0x33')]:_0x7cae9d[_0x280b('0x32')];_0x55a23c['order']=qs['sort'](_0x2d577b[_0x280b('0x31')][_0x280b('0x38')]);_0x55a23c['where']=qs[_0x280b('0x3a')](_[_0x280b('0x3b')](_0x2d577b[_0x280b('0x31')],_0x7cae9d[_0x280b('0x3a')]));if(_0x2d577b['query'][_0x280b('0x56')]){_0x55a23c['where']=_[_0x280b('0x3c')](_0x55a23c['where'],{'$or':_[_0x280b('0x2f')](_0x55a23c[_0x280b('0x33')],function(_0x412835){var _0x552c9a={};_0x552c9a[_0x412835]={'$like':'%'+_0x2d577b['query'][_0x280b('0x56')]+'%'};return _0x552c9a;})});}_0x55a23c=_[_0x280b('0x3c')]({},_0x55a23c,_0x2d577b['options']);return _0x39c5d3[_0x280b('0x54')](_0x55a23c);}})[_0x280b('0x21')](function(_0x424d3a){if(_0x424d3a){_0x89df25=_0x424d3a[_0x280b('0x45')];if(!_0x2d577b[_0x280b('0x31')][_0x280b('0x35')](_0x280b('0x36'))){_0x55a23c[_0x280b('0x1b')]=qs[_0x280b('0x1b')](_0x2d577b['query'][_0x280b('0x1b')]);_0x55a23c[_0x280b('0x19')]=qs['offset'](_0x2d577b[_0x280b('0x31')][_0x280b('0x19')]);}return _0x39c5d3['getIntervals'](_0x55a23c);}})[_0x280b('0x21')](function(_0x41e4ee){if(_0x41e4ee){return _0x41e4ee?{'count':_0x89df25,'rows':_0x41e4ee}:null;}})['then'](respondWithResult(_0x43025e,null))[_0x280b('0x41')](handleError(_0x43025e,null));};exports['addIntervals']=function(_0x2ef3f4,_0x2e6166,_0x57998b){return db['Interval']['findOne']({'where':{'id':_0x2ef3f4[_0x280b('0x43')]['id']}})[_0x280b('0x21')](handleEntityNotFound(_0x2e6166,null))[_0x280b('0x21')](function(_0x129f97){if(_0x129f97){return db[_0x280b('0x57')][_0x280b('0x58')](function(_0x4a592f){return db[_0x280b('0x2a')][_0x280b('0x22')]({'where':{'IntervalId':_0x2ef3f4[_0x280b('0x43')]['id']},'transaction':_0x4a592f})[_0x280b('0x21')](function(_0x856e28){var _0x98874f=_[_0x280b('0x2f')](_0x2ef3f4['body'],function(_0x42c130){delete _0x42c130['id'];_0x42c130[_0x280b('0x53')]=_0x2ef3f4[_0x280b('0x43')]['id'];return _0x42c130;});return db['Interval'][_0x280b('0x59')](_0x98874f,{'transaction':_0x4a592f});});})['then'](function(){return db[_0x280b('0x2a')]['findAll']({'where':{'IntervalId':_0x2ef3f4['params']['id']}});});}})['then'](respondWithResult(_0x2e6166,null))[_0x280b('0x41')](handleError(_0x2e6166,null));}; \ No newline at end of file +var _0x5a73=['update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','body','IntervalId','getIntervals','findOne','order','sequelize','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x2417af,_0x24011d){var _0x3736bb=function(_0x9b621f){while(--_0x9b621f){_0x2417af['push'](_0x2417af['shift']());}};_0x3736bb(++_0x24011d);}(_0x5a73,0x1a3));var _0x35a7=function(_0x47364c,_0x32c782){_0x47364c=_0x47364c-0x0;var _0x83d860=_0x5a73[_0x47364c];return _0x83d860;};'use strict';var emlformat=require(_0x35a7('0x0'));var rimraf=require(_0x35a7('0x1'));var zipdir=require(_0x35a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x35a7('0x3'));var BPromise=require(_0x35a7('0x4'));var Mustache=require(_0x35a7('0x5'));var util=require(_0x35a7('0x6'));var path=require(_0x35a7('0x7'));var sox=require(_0x35a7('0x8'));var csv=require(_0x35a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35a7('0xa'));var _=require(_0x35a7('0xb'));var squel=require('squel');var crypto=require(_0x35a7('0xc'));var jsforce=require(_0x35a7('0xd'));var deskjs=require(_0x35a7('0xe'));var toCsv=require(_0x35a7('0x9'));var querystring=require(_0x35a7('0xf'));var Papa=require('papaparse');var Redis=require(_0x35a7('0x10'));var authService=require(_0x35a7('0x11'));var qs=require(_0x35a7('0x12'));var as=require(_0x35a7('0x13'));var hardwareService=require(_0x35a7('0x14'));var logger=require(_0x35a7('0x15'))(_0x35a7('0x16'));var utils=require(_0x35a7('0x17'));var config=require(_0x35a7('0x18'));var licenseUtil=require(_0x35a7('0x19'));var db=require(_0x35a7('0x1a'))['db'];var extensions=require(_0x35a7('0x1b'));function respondWithStatusCode(_0x332b6b,_0x123ecc){_0x123ecc=_0x123ecc||0xcc;return function(_0x39d084){if(_0x39d084){return _0x332b6b[_0x35a7('0x1c')](_0x123ecc);}return _0x332b6b[_0x35a7('0x1d')](_0x123ecc)[_0x35a7('0x1e')]();};}function respondWithResult(_0x16206d,_0x146a4c){_0x146a4c=_0x146a4c||0xc8;return function(_0x229038){if(_0x229038){return _0x16206d[_0x35a7('0x1d')](_0x146a4c)[_0x35a7('0x1f')](_0x229038);}};}function respondWithFilteredResult(_0x4dbca9,_0xfff6a4){return function(_0x55d76c){if(_0x55d76c){var _0x5e4ca0=typeof _0xfff6a4['offset']===_0x35a7('0x20')&&typeof _0xfff6a4[_0x35a7('0x21')]==='undefined';var _0x287600=_0x55d76c[_0x35a7('0x22')];var _0x1b2ac3=_0x5e4ca0?0x0:_0xfff6a4['offset'];var _0x799ce7=_0x5e4ca0?_0x55d76c['count']:_0xfff6a4[_0x35a7('0x23')]+_0xfff6a4[_0x35a7('0x21')];var _0x47322d;if(_0x799ce7>=_0x287600){_0x799ce7=_0x287600;_0x47322d=0xc8;}else{_0x47322d=0xce;}_0x4dbca9[_0x35a7('0x1d')](_0x47322d);return _0x4dbca9[_0x35a7('0x24')](_0x35a7('0x25'),_0x1b2ac3+'-'+_0x799ce7+'/'+_0x287600)[_0x35a7('0x1f')](_0x55d76c);}return null;};}function patchUpdates(_0x3df53e){return function(_0x4cf031){try{jsonpatch[_0x35a7('0x26')](_0x4cf031,_0x3df53e,!![]);}catch(_0x751462){return BPromise[_0x35a7('0x27')](_0x751462);}return _0x4cf031[_0x35a7('0x28')]();};}function saveUpdates(_0x189434,_0x342932){return function(_0x279b05){if(_0x279b05){return _0x279b05[_0x35a7('0x29')](_0x189434)[_0x35a7('0x2a')](function(_0x3cbf15){return _0x3cbf15;});}return null;};}function removeEntity(_0x5b62e0,_0x3d449a){return function(_0x182f44){if(_0x182f44){return _0x182f44[_0x35a7('0x2b')]()[_0x35a7('0x2a')](function(){var _0x277973=_0x182f44['get']({'plain':!![]});var _0xfeda=_0x35a7('0x2c');return db[_0x35a7('0x2d')][_0x35a7('0x2b')]({'where':{'type':_0xfeda,'resourceId':_0x277973['id']}})[_0x35a7('0x2a')](function(){return _0x182f44;});})[_0x35a7('0x2a')](function(){_0x5b62e0[_0x35a7('0x1d')](0xcc)[_0x35a7('0x1e')]();});}};}function handleEntityNotFound(_0x561406,_0x4eb7f1){return function(_0x1258a3){if(!_0x1258a3){_0x561406['sendStatus'](0x194);}return _0x1258a3;};}function handleError(_0x33d77e,_0x4a96a6){_0x4a96a6=_0x4a96a6||0x1f4;return function(_0x263a9b){logger[_0x35a7('0x2e')](_0x263a9b[_0x35a7('0x2f')]);if(_0x263a9b[_0x35a7('0x30')]){delete _0x263a9b[_0x35a7('0x30')];}_0x33d77e[_0x35a7('0x1d')](_0x4a96a6)[_0x35a7('0x31')](_0x263a9b);};}exports[_0x35a7('0x32')]=function(_0x5d22b4,_0x1dc8f3){var _0x151b93={},_0x292c3e={},_0xa6ac01={'count':0x0,'rows':[]};var _0x48031a=_['map'](db[_0x35a7('0x33')][_0x35a7('0x34')],function(_0x44a024){return{'name':_0x44a024[_0x35a7('0x35')],'type':_0x44a024[_0x35a7('0x36')]['key']};});_0x292c3e[_0x35a7('0x37')]=_[_0x35a7('0x38')](_0x48031a,_0x35a7('0x30'));_0x292c3e[_0x35a7('0x39')]=_[_0x35a7('0x3a')](_0x5d22b4[_0x35a7('0x39')]);_0x292c3e[_0x35a7('0x3b')]=_['intersection'](_0x292c3e[_0x35a7('0x37')],_0x292c3e[_0x35a7('0x39')]);_0x151b93['attributes']=_[_0x35a7('0x3c')](_0x292c3e[_0x35a7('0x37')],qs['fields'](_0x5d22b4['query'][_0x35a7('0x3d')]));_0x151b93[_0x35a7('0x3e')]=_0x151b93['attributes'][_0x35a7('0x3f')]?_0x151b93[_0x35a7('0x3e')]:_0x292c3e[_0x35a7('0x37')];if(!_0x5d22b4[_0x35a7('0x39')][_0x35a7('0x40')](_0x35a7('0x41'))){_0x151b93[_0x35a7('0x21')]=qs[_0x35a7('0x21')](_0x5d22b4[_0x35a7('0x39')][_0x35a7('0x21')]);_0x151b93[_0x35a7('0x23')]=qs[_0x35a7('0x23')](_0x5d22b4[_0x35a7('0x39')]['offset']);}_0x151b93['order']=qs['sort'](_0x5d22b4[_0x35a7('0x39')][_0x35a7('0x42')]);_0x151b93['where']=qs[_0x35a7('0x3b')](_[_0x35a7('0x43')](_0x5d22b4[_0x35a7('0x39')],_0x292c3e[_0x35a7('0x3b')]),_0x48031a);if(_0x5d22b4['query']['filter']){_0x151b93['where']=_[_0x35a7('0x44')](_0x151b93[_0x35a7('0x45')],{'$or':_['map'](_0x48031a,function(_0x3b2222){if(_0x3b2222['type']!==_0x35a7('0x46')){var _0x5d0e43={};_0x5d0e43[_0x3b2222[_0x35a7('0x30')]]={'$like':'%'+_0x5d22b4['query'][_0x35a7('0x47')]+'%'};return _0x5d0e43;}})});}_0x151b93=_[_0x35a7('0x44')]({},_0x151b93,_0x5d22b4[_0x35a7('0x48')]);var _0x3ca096={'where':_0x151b93['where']};return db['Interval'][_0x35a7('0x22')](_0x3ca096)[_0x35a7('0x2a')](function(_0x930c1d){_0xa6ac01['count']=_0x930c1d;if(_0x5d22b4[_0x35a7('0x39')][_0x35a7('0x49')]){_0x151b93['include']=[{'all':!![]}];}return db[_0x35a7('0x33')][_0x35a7('0x4a')](_0x151b93);})[_0x35a7('0x2a')](function(_0x1f22e1){_0xa6ac01['rows']=_0x1f22e1;return _0xa6ac01;})[_0x35a7('0x2a')](respondWithFilteredResult(_0x1dc8f3,_0x151b93))[_0x35a7('0x4b')](handleError(_0x1dc8f3,null));};exports[_0x35a7('0x4c')]=function(_0x519059,_0xdd3f67){var _0x2e08d0={'raw':!![],'where':{'id':_0x519059[_0x35a7('0x4d')]['id']}},_0x48b997={};_0x48b997[_0x35a7('0x37')]=_[_0x35a7('0x3a')](db[_0x35a7('0x33')][_0x35a7('0x34')]);_0x48b997[_0x35a7('0x39')]=_[_0x35a7('0x3a')](_0x519059['query']);_0x48b997['filters']=_['intersection'](_0x48b997[_0x35a7('0x37')],_0x48b997[_0x35a7('0x39')]);_0x2e08d0[_0x35a7('0x3e')]=_['intersection'](_0x48b997[_0x35a7('0x37')],qs['fields'](_0x519059['query'][_0x35a7('0x3d')]));_0x2e08d0[_0x35a7('0x3e')]=_0x2e08d0[_0x35a7('0x3e')]['length']?_0x2e08d0[_0x35a7('0x3e')]:_0x48b997[_0x35a7('0x37')];if(_0x519059[_0x35a7('0x39')][_0x35a7('0x49')]){_0x2e08d0['include']=[{'all':!![]}];}_0x2e08d0=_[_0x35a7('0x44')]({},_0x2e08d0,_0x519059[_0x35a7('0x48')]);return db['Interval'][_0x35a7('0x4e')](_0x2e08d0)[_0x35a7('0x2a')](handleEntityNotFound(_0xdd3f67,null))['then'](respondWithResult(_0xdd3f67,null))['catch'](handleError(_0xdd3f67,null));};exports[_0x35a7('0x4f')]=function(_0xd44c5a,_0x32fe1d){return db[_0x35a7('0x33')][_0x35a7('0x4f')](_0xd44c5a['body'],{})['then'](function(_0x433da3){var _0x164999=_0xd44c5a['user'][_0x35a7('0x50')]({'plain':!![]});if(!_0x164999)throw new Error(_0x35a7('0x51'));if(_0x164999[_0x35a7('0x52')]===_0x35a7('0x53')){var _0x2a0a07=_0x433da3[_0x35a7('0x50')]({'plain':!![]});var _0x6af98b=_0x35a7('0x2c');return db['UserProfileSection'][_0x35a7('0x4e')]({'where':{'name':_0x6af98b,'userProfileId':_0x164999['userProfileId']},'raw':!![]})[_0x35a7('0x2a')](function(_0x14b4be){if(_0x14b4be&&_0x14b4be[_0x35a7('0x54')]===0x0){return db[_0x35a7('0x2d')]['create']({'name':_0x2a0a07[_0x35a7('0x30')],'resourceId':_0x2a0a07['id'],'type':_0x14b4be[_0x35a7('0x30')],'sectionId':_0x14b4be['id']},{})[_0x35a7('0x2a')](function(){return _0x433da3;});}else{return _0x433da3;}})[_0x35a7('0x4b')](function(_0x285985){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x285985);throw _0x285985;});}return _0x433da3;})[_0x35a7('0x2a')](respondWithResult(_0x32fe1d,0xc9))['catch'](handleError(_0x32fe1d,null));};exports[_0x35a7('0x29')]=function(_0x2e3a64,_0xc5f2df){if(_0x2e3a64[_0x35a7('0x55')]['id']){delete _0x2e3a64[_0x35a7('0x55')]['id'];}return db[_0x35a7('0x33')][_0x35a7('0x4e')]({'where':{'id':_0x2e3a64['params']['id']}})[_0x35a7('0x2a')](handleEntityNotFound(_0xc5f2df,null))[_0x35a7('0x2a')](saveUpdates(_0x2e3a64['body'],null))[_0x35a7('0x2a')](respondWithResult(_0xc5f2df,null))['catch'](handleError(_0xc5f2df,null));};exports['destroy']=function(_0xae2d86,_0x9b6a39){return db['Interval']['find']({'where':{'id':_0xae2d86[_0x35a7('0x4d')]['id']}})[_0x35a7('0x2a')](handleEntityNotFound(_0x9b6a39,null))[_0x35a7('0x2a')](removeEntity(_0x9b6a39,null))[_0x35a7('0x4b')](handleError(_0x9b6a39,null));};exports['addInterval']=function(_0x356650,_0x5ec589,_0x43e612){if(_0x356650['body']['id']){delete _0x356650[_0x35a7('0x55')]['id'];}return db[_0x35a7('0x33')]['find']({'where':{'id':_0x356650[_0x35a7('0x4d')]['id']}})[_0x35a7('0x2a')](handleEntityNotFound(_0x5ec589,null))[_0x35a7('0x2a')](function(_0x23a013){if(_0x23a013){_0x356650[_0x35a7('0x55')][_0x35a7('0x56')]=_0x23a013['id'];return db[_0x35a7('0x33')][_0x35a7('0x4f')](_0x356650[_0x35a7('0x55')]);}})[_0x35a7('0x2a')](respondWithResult(_0x5ec589,null))['catch'](handleError(_0x5ec589,null));};exports[_0x35a7('0x57')]=function(_0x57260c,_0x386409,_0x5c6ee7){var _0x1dc18b={};var _0x50271e={};var _0x35caa1;var _0x3c2296;return db[_0x35a7('0x33')][_0x35a7('0x58')]({'where':{'id':_0x57260c['params']['id']}})[_0x35a7('0x2a')](handleEntityNotFound(_0x386409,null))[_0x35a7('0x2a')](function(_0x275b07){if(_0x275b07){_0x35caa1=_0x275b07;_0x50271e[_0x35a7('0x37')]=_[_0x35a7('0x3a')](db[_0x35a7('0x33')][_0x35a7('0x34')]);_0x50271e[_0x35a7('0x39')]=_['keys'](_0x57260c[_0x35a7('0x39')]);_0x50271e[_0x35a7('0x3b')]=_[_0x35a7('0x3c')](_0x50271e[_0x35a7('0x37')],_0x50271e[_0x35a7('0x39')]);_0x1dc18b['attributes']=_[_0x35a7('0x3c')](_0x50271e[_0x35a7('0x37')],qs[_0x35a7('0x3d')](_0x57260c[_0x35a7('0x39')][_0x35a7('0x3d')]));_0x1dc18b[_0x35a7('0x3e')]=_0x1dc18b[_0x35a7('0x3e')][_0x35a7('0x3f')]?_0x1dc18b[_0x35a7('0x3e')]:_0x50271e[_0x35a7('0x37')];_0x1dc18b[_0x35a7('0x59')]=qs['sort'](_0x57260c[_0x35a7('0x39')][_0x35a7('0x42')]);_0x1dc18b[_0x35a7('0x45')]=qs[_0x35a7('0x3b')](_[_0x35a7('0x43')](_0x57260c[_0x35a7('0x39')],_0x50271e[_0x35a7('0x3b')]));if(_0x57260c[_0x35a7('0x39')][_0x35a7('0x47')]){_0x1dc18b['where']=_[_0x35a7('0x44')](_0x1dc18b[_0x35a7('0x45')],{'$or':_['map'](_0x1dc18b['attributes'],function(_0x369747){var _0x44c226={};_0x44c226[_0x369747]={'$like':'%'+_0x57260c[_0x35a7('0x39')][_0x35a7('0x47')]+'%'};return _0x44c226;})});}_0x1dc18b=_['merge']({},_0x1dc18b,_0x57260c[_0x35a7('0x48')]);return _0x35caa1[_0x35a7('0x57')](_0x1dc18b);}})[_0x35a7('0x2a')](function(_0x2d495a){if(_0x2d495a){_0x3c2296=_0x2d495a[_0x35a7('0x3f')];if(!_0x57260c[_0x35a7('0x39')][_0x35a7('0x40')](_0x35a7('0x41'))){_0x1dc18b['limit']=qs[_0x35a7('0x21')](_0x57260c[_0x35a7('0x39')][_0x35a7('0x21')]);_0x1dc18b[_0x35a7('0x23')]=qs['offset'](_0x57260c[_0x35a7('0x39')][_0x35a7('0x23')]);}return _0x35caa1['getIntervals'](_0x1dc18b);}})[_0x35a7('0x2a')](function(_0x44d082){if(_0x44d082){return _0x44d082?{'count':_0x3c2296,'rows':_0x44d082}:null;}})[_0x35a7('0x2a')](respondWithResult(_0x386409,null))['catch'](handleError(_0x386409,null));};exports['addIntervals']=function(_0x105f5d,_0x2e00ac,_0x56d1d7){return db[_0x35a7('0x33')][_0x35a7('0x58')]({'where':{'id':_0x105f5d[_0x35a7('0x4d')]['id']}})[_0x35a7('0x2a')](handleEntityNotFound(_0x2e00ac,null))[_0x35a7('0x2a')](function(_0x5d899c){if(_0x5d899c){return db[_0x35a7('0x5a')]['transaction'](function(_0x33adf7){return db['Interval'][_0x35a7('0x2b')]({'where':{'IntervalId':_0x105f5d[_0x35a7('0x4d')]['id']},'transaction':_0x33adf7})[_0x35a7('0x2a')](function(_0x5177b3){var _0x45ad36=_[_0x35a7('0x38')](_0x105f5d[_0x35a7('0x55')],function(_0x5140b0){delete _0x5140b0['id'];_0x5140b0[_0x35a7('0x56')]=_0x105f5d[_0x35a7('0x4d')]['id'];return _0x5140b0;});return db[_0x35a7('0x33')][_0x35a7('0x5b')](_0x45ad36,{'transaction':_0x33adf7});});})[_0x35a7('0x2a')](function(){return db['Interval'][_0x35a7('0x4a')]({'where':{'IntervalId':_0x105f5d[_0x35a7('0x4d')]['id']}});});}})['then'](respondWithResult(_0x2e00ac,null))[_0x35a7('0x4b')](handleError(_0x2e00ac,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6e98ccb..7a3a974 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 _0x8e61=['request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','../../config/logger','api','bluebird'];(function(_0x5581e9,_0x28d871){var _0x2d923c=function(_0x5b7d58){while(--_0x5b7d58){_0x5581e9['push'](_0x5581e9['shift']());}};_0x2d923c(++_0x28d871);}(_0x8e61,0x6c));var _0x18e6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8e61[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x18e6('0x0'));var util=require('util');var logger=require(_0x18e6('0x1'))(_0x18e6('0x2'));var moment=require('moment');var BPromise=require(_0x18e6('0x3'));var rp=require(_0x18e6('0x4'));var fs=require('fs');var path=require(_0x18e6('0x5'));var rimraf=require('rimraf');var config=require(_0x18e6('0x6'));var attributes=require(_0x18e6('0x7'));var extensions=require(_0x18e6('0x8'));module[_0x18e6('0x9')]=function(_0x39b639,_0x3ea837){return _0x39b639[_0x18e6('0xa')](_0x18e6('0xb'),attributes,{'tableName':_0x18e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26ea89,_0x228ae9){extensions[_0x18e6('0xd')](_0x39b639,_0x26ea89);},'afterBulkCreate':function(_0x438f6d,_0x2bef00,_0x5efefb){_0x5efefb();extensions['rewrite'](_0x39b639,_0x438f6d[0x0]);},'afterUpdate':function(_0x8b56f5,_0x12e1c8){extensions['rewrite'](_0x39b639,_0x8b56f5);},'afterDestroy':function(_0x29ab20,_0x4688a5){extensions[_0x18e6('0xd')](_0x39b639,_0x29ab20);}}});}; \ No newline at end of file +var _0x0faf=['bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x0faf,0x91));var _0xf0fa=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0x0faf[_0x2d0d9f];return _0x30243d;};'use strict';var _=require(_0xf0fa('0x0'));var util=require(_0xf0fa('0x1'));var logger=require(_0xf0fa('0x2'))(_0xf0fa('0x3'));var moment=require(_0xf0fa('0x4'));var BPromise=require(_0xf0fa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf0fa('0x6'));var config=require(_0xf0fa('0x7'));var attributes=require(_0xf0fa('0x8'));var extensions=require(_0xf0fa('0x9'));module[_0xf0fa('0xa')]=function(_0x115575,_0x417e44){return _0x115575[_0xf0fa('0xb')](_0xf0fa('0xc'),attributes,{'tableName':_0xf0fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x116d6b,_0x4ed2ce){extensions[_0xf0fa('0xe')](_0x115575,_0x116d6b);},'afterBulkCreate':function(_0x228aa7,_0x4aa451,_0x465d14){_0x465d14();extensions[_0xf0fa('0xe')](_0x115575,_0x228aa7[0x0]);},'afterUpdate':function(_0x4497f1,_0x371708){extensions['rewrite'](_0x115575,_0x4497f1);},'afterDestroy':function(_0x563529,_0x3503f0){extensions[_0xf0fa('0xe')](_0x115575,_0x563529);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 5573fea..dd4bfa4 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(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 4b0f6f1..6b95147 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x283708,_0x57a9e7){var _0xd6bd85=function(_0xa21419){while(--_0xa21419){_0x283708['push'](_0x283708['shift']());}};_0xd6bd85(++_0x57a9e7);}(_0x2ef3,0xba));var _0x32ef=function(_0x20cd04,_0x2b67dd){_0x20cd04=_0x20cd04-0x0;var _0x16085e=_0x2ef3[_0x20cd04];return _0x16085e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x4d395f,_0x249e5a){var _0x2d0a63=function(_0x1511ba){while(--_0x1511ba){_0x4d395f['push'](_0x4d395f['shift']());}};_0x2d0a63(++_0x249e5a);}(_0xdb28,0x106));var _0x8db2=function(_0x2745b1,_0x30ffff){_0x2745b1=_0x2745b1-0x0;var _0x23b802=_0xdb28[_0x2745b1];return _0x23b802;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 4b7a00a..8cad544 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 _0xe3f7=['end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','api','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data'];(function(_0x19d7af,_0x54fbdb){var _0x17a39e=function(_0xef411d){while(--_0xef411d){_0x19d7af['push'](_0x19d7af['shift']());}};_0x17a39e(++_0x54fbdb);}(_0xe3f7,0x13d));var _0x7e3f=function(_0x1e00e3,_0x2bf288){_0x1e00e3=_0x1e00e3-0x0;var _0x50b6ca=_0xe3f7[_0x1e00e3];return _0x50b6ca;};'use strict';var BPromise=require(_0x7e3f('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x7e3f('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0xd2610b,_0x506775){var _0x495edd={'fields':{'project':{'key':_0xd2610b[_0x7e3f('0x2')]||_0x7e3f('0x3')},'summary':(_0xd2610b[_0x7e3f('0x4')]||_0x7e3f('0x5'))+_0x7e3f('0x6')+_0xd2610b['ip'],'description':_0xd2610b[_0x7e3f('0x7')]||JSON[_0x7e3f('0x8')](_0xd2610b),'issuetype':{'name':_0xd2610b['issuetype']||_0x7e3f('0x9')}}};_0x495edd[_0x7e3f('0xa')][_0x7e3f('0xb')]=_0xd2610b['email'];_0x495edd[_0x7e3f('0xa')]['customfield_11501']=_0xd2610b['oldToken'];_0x495edd[_0x7e3f('0xa')]['customfield_11502']=_0xd2610b[_0x7e3f('0xc')];_0x495edd[_0x7e3f('0xa')][_0x7e3f('0xd')]=_0xd2610b[_0x7e3f('0xe')];_0x495edd['fields'][_0x7e3f('0xf')]=_0xd2610b[_0x7e3f('0x10')];_0x495edd[_0x7e3f('0xa')]['customfield_10102']=_0xd2610b['ip'];var _0xc45418={'host':_0x7e3f('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x7e3f('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x7e3f('0x13'),'Authorization':_0x7e3f('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x7e3f('0x15')](_0x7e3f('0x16'))}};var _0x2a61c9=JSON[_0x7e3f('0x8')](_0x495edd);var _0x23af62=https[_0x7e3f('0x17')](_0xc45418,function(_0x1d0368){_0x1d0368[_0x7e3f('0x18')](_0x7e3f('0x19'));var _0x42809a='';_0x1d0368['on'](_0x7e3f('0x1a'),function(_0x54fda5){_0x42809a+=_0x54fda5;});_0x1d0368['on'](_0x7e3f('0x1b'),function(){if(_0x506775){return _0x506775['status'](_0x1d0368[_0x7e3f('0x1c')])[_0x7e3f('0x1d')](JSON[_0x7e3f('0x1e')](_0x42809a));}});});_0x23af62['on'](_0x7e3f('0x1f'),function(_0x550660){if(_0x506775){return _0x506775[_0x7e3f('0x20')](0x1f4)['json']({'errors':[{'message':_0x7e3f('0x21'),'type':_0x7e3f('0x22')}]});}});_0x23af62[_0x7e3f('0x23')](_0x2a61c9);_0x23af62['end']();}exports[_0x7e3f('0x24')]=openIssue;exports['send']=function(_0x417548,_0x2a06d9){_0x417548['body']['ip']=_0x417548[_0x7e3f('0x25')][_0x7e3f('0x26')]||_0x417548[_0x7e3f('0x27')][_0x7e3f('0x28')]||_0x417548['socket'][_0x7e3f('0x28')]||_0x417548[_0x7e3f('0x27')][_0x7e3f('0x29')]['remoteAddress'];return openIssue(_0x417548[_0x7e3f('0x2a')],_0x2a06d9);}; \ No newline at end of file +var _0x9f90=['fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','name','customfield_11504','customfield_10102','POST','application/json','Basic\x20','base64','request','setEncoding','utf8','data','status','statusCode','parse','api.jira','write','end','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','api','support','3eAmWpBVP0','summary','Report','description','stringify','issuetype'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9f90,0x130));var _0x09f9=function(_0xdb4b5b,_0x19a138){_0xdb4b5b=_0xdb4b5b-0x0;var _0x504e22=_0x9f90[_0xdb4b5b];return _0x504e22;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0x09f9('0x0'));var USERNAME=_0x09f9('0x1');var PASSWORD=_0x09f9('0x2');function openIssue(_0x264292,_0x2fb100){var _0x1efd2f={'fields':{'project':{'key':_0x264292['key']||'MOTGUI'},'summary':(_0x264292[_0x09f9('0x3')]||_0x09f9('0x4'))+'\x20from\x20'+_0x264292['ip'],'description':_0x264292[_0x09f9('0x5')]||JSON[_0x09f9('0x6')](_0x264292),'issuetype':{'name':_0x264292[_0x09f9('0x7')]||'Bug'}}};_0x1efd2f[_0x09f9('0x8')][_0x09f9('0x9')]=_0x264292[_0x09f9('0xa')];_0x1efd2f['fields'][_0x09f9('0xb')]=_0x264292[_0x09f9('0xc')];_0x1efd2f['fields'][_0x09f9('0xd')]=_0x264292['newToken'];_0x1efd2f['fields']['customfield_11503']=_0x264292[_0x09f9('0xe')];_0x1efd2f[_0x09f9('0x8')][_0x09f9('0xf')]=_0x264292['reason'];_0x1efd2f[_0x09f9('0x8')][_0x09f9('0x10')]=_0x264292['ip'];var _0x1f6a49={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x09f9('0x11'),'timeout':0x4e20,'headers':{'Content-Type':_0x09f9('0x12'),'Authorization':_0x09f9('0x13')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x09f9('0x14'))}};var _0x3668d1=JSON['stringify'](_0x1efd2f);var _0x90394=https[_0x09f9('0x15')](_0x1f6a49,function(_0x54dd9e){_0x54dd9e[_0x09f9('0x16')](_0x09f9('0x17'));var _0x463d65='';_0x54dd9e['on'](_0x09f9('0x18'),function(_0x28cfee){_0x463d65+=_0x28cfee;});_0x54dd9e['on']('end',function(){if(_0x2fb100){return _0x2fb100[_0x09f9('0x19')](_0x54dd9e[_0x09f9('0x1a')])['json'](JSON[_0x09f9('0x1b')](_0x463d65));}});});_0x90394['on']('error',function(_0xcc4d2d){if(_0x2fb100){return _0x2fb100[_0x09f9('0x19')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x09f9('0x1c')}]});}});_0x90394[_0x09f9('0x1d')](_0x3668d1);_0x90394[_0x09f9('0x1e')]();}exports[_0x09f9('0x1f')]=openIssue;exports[_0x09f9('0x20')]=function(_0x51d53b,_0x286c45){_0x51d53b['body']['ip']=_0x51d53b[_0x09f9('0x21')][_0x09f9('0x22')]||_0x51d53b[_0x09f9('0x23')]['remoteAddress']||_0x51d53b[_0x09f9('0x24')][_0x09f9('0x25')]||_0x51d53b[_0x09f9('0x23')]['socket'][_0x09f9('0x25')];return openIssue(_0x51d53b[_0x09f9('0x26')],_0x286c45);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6538aff..05abf6f 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x89a5f2,_0x1c0cfb){var _0x526482=function(_0x607e9d){while(--_0x607e9d){_0x89a5f2['push'](_0x89a5f2['shift']());}};_0x526482(++_0x1c0cfb);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4bf485,_0x284dcc){_0x4bf485=_0x4bf485-0x0;var _0x58824b=_0xee5b[_0x4bf485];return _0x58824b;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file +var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x4414a6,_0x20b529){var _0x49ff60=function(_0x46bd77){while(--_0x46bd77){_0x4414a6['push'](_0x4414a6['shift']());}};_0x49ff60(++_0x20b529);}(_0xee5b,0x1f4));var _0xbee5=function(_0xb0e3c4,_0x23ccd9){_0xb0e3c4=_0xb0e3c4-0x0;var _0x47bd96=_0xee5b[_0xb0e3c4];return _0x47bd96;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index dbde7ca..9f731d0 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x31bb80,_0x5a0b50){_0x31bb80=_0x31bb80-0x0;var _0x45e1a7=_0x7a54[_0x31bb80];return _0x45e1a7;};'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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x2a803b,_0x494d01){_0x2a803b=_0x2a803b-0x0;var _0x16f0c7=_0x7a54[_0x2a803b];return _0x16f0c7;};'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 b040ca8..62f05ae 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 _0x23f4=['index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send'];(function(_0x59f64e,_0x3f87d5){var _0x618691=function(_0x30e22c){while(--_0x30e22c){_0x59f64e['push'](_0x59f64e['shift']());}};_0x618691(++_0x3f87d5);}(_0x23f4,0x1ee));var _0x423f=function(_0x491a62,_0x415eac){_0x491a62=_0x491a62-0x0;var _0x170227=_0x23f4[_0x491a62];return _0x170227;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={},_0xbb4bce={},_0x5a838e={'count':0x0,'rows':[]};var _0x3cf4aa=_[_0x423f('0x27')](db[_0x423f('0x28')][_0x423f('0x29')],function(_0x518c1e){return{'name':_0x518c1e[_0x423f('0x2a')],'type':_0x518c1e[_0x423f('0x2b')][_0x423f('0x2c')]};});_0xbb4bce[_0x423f('0x2d')]=_['map'](_0x3cf4aa,_0x423f('0x2e'));_0xbb4bce[_0x423f('0x2f')]=_[_0x423f('0x30')](_0x4c2f21[_0x423f('0x2f')]);_0xbb4bce[_0x423f('0x31')]=_[_0x423f('0x32')](_0xbb4bce[_0x423f('0x2d')],_0xbb4bce[_0x423f('0x2f')]);_0x3ca28d[_0x423f('0x33')]=_[_0x423f('0x32')](_0xbb4bce['model'],qs[_0x423f('0x34')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x34')]));_0x3ca28d['attributes']=_0x3ca28d[_0x423f('0x33')]['length']?_0x3ca28d[_0x423f('0x33')]:_0xbb4bce[_0x423f('0x2d')];if(!_0x4c2f21[_0x423f('0x2f')][_0x423f('0x35')](_0x423f('0x36'))){_0x3ca28d['limit']=qs['limit'](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1c')]);_0x3ca28d[_0x423f('0x1a')]=qs[_0x423f('0x1a')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1a')]);}_0x3ca28d[_0x423f('0x37')]=qs[_0x423f('0x38')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x38')]);_0x3ca28d[_0x423f('0x39')]=qs[_0x423f('0x31')](_[_0x423f('0x3a')](_0x4c2f21['query'],_0xbb4bce['filters']),_0x3cf4aa);if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]){_0x3ca28d[_0x423f('0x39')]=_[_0x423f('0x3c')](_0x3ca28d[_0x423f('0x39')],{'$or':_['map'](_0x3cf4aa,function(_0x38dcce){if(_0x38dcce[_0x423f('0x2b')]!==_0x423f('0x3d')){var _0x1d47d8={};_0x1d47d8[_0x38dcce[_0x423f('0x2e')]]={'$like':'%'+_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]+'%'};return _0x1d47d8;}})});}_0x3ca28d=_[_0x423f('0x3c')]({},_0x3ca28d,_0x4c2f21[_0x423f('0x3e')]);var _0x40571a={'where':_0x3ca28d['where']};return db['JscriptyAnswerReport'][_0x423f('0x1d')](_0x40571a)[_0x423f('0x21')](function(_0x81bd62){_0x5a838e[_0x423f('0x1d')]=_0x81bd62;if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3ca28d['include']=[{'all':!![]}];}return db[_0x423f('0x28')][_0x423f('0x40')](_0x3ca28d);})[_0x423f('0x21')](function(_0x393618){_0x5a838e[_0x423f('0x41')]=_0x393618;return _0x5a838e;})[_0x423f('0x21')](respondWithFilteredResult(_0x5882ed,_0x3ca28d))[_0x423f('0x42')](handleError(_0x5882ed,null));};exports[_0x423f('0x43')]=function(_0x518443,_0x4165e0){var _0x3bc113={'raw':!![],'where':{'id':_0x518443[_0x423f('0x44')]['id']}},_0x192ae5={};_0x192ae5[_0x423f('0x2d')]=_[_0x423f('0x30')](db[_0x423f('0x28')][_0x423f('0x29')]);_0x192ae5[_0x423f('0x2f')]=_['keys'](_0x518443[_0x423f('0x2f')]);_0x192ae5['filters']=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],_0x192ae5[_0x423f('0x2f')]);_0x3bc113[_0x423f('0x33')]=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],qs[_0x423f('0x34')](_0x518443[_0x423f('0x2f')][_0x423f('0x34')]));_0x3bc113[_0x423f('0x33')]=_0x3bc113[_0x423f('0x33')][_0x423f('0x45')]?_0x3bc113[_0x423f('0x33')]:_0x192ae5[_0x423f('0x2d')];if(_0x518443[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3bc113[_0x423f('0x46')]=[{'all':!![]}];}_0x3bc113=_[_0x423f('0x3c')]({},_0x3bc113,_0x518443[_0x423f('0x3e')]);return db[_0x423f('0x28')]['find'](_0x3bc113)[_0x423f('0x21')](handleEntityNotFound(_0x4165e0,null))['then'](respondWithResult(_0x4165e0,null))[_0x423f('0x42')](handleError(_0x4165e0,null));};exports[_0x423f('0x47')]=function(_0x1cf881,_0x37035a){return db[_0x423f('0x28')][_0x423f('0x47')](_0x1cf881[_0x423f('0x48')],{})[_0x423f('0x21')](respondWithResult(_0x37035a,0xc9))[_0x423f('0x42')](handleError(_0x37035a,null));};exports[_0x423f('0x49')]=function(_0x31b88e,_0x2dcbec){if(_0x31b88e['body']['id']){delete _0x31b88e[_0x423f('0x48')]['id'];}return db[_0x423f('0x28')]['find']({'where':{'id':_0x31b88e[_0x423f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcbec,null))[_0x423f('0x21')](saveUpdates(_0x31b88e['body'],null))['then'](respondWithResult(_0x2dcbec,null))[_0x423f('0x42')](handleError(_0x2dcbec,null));};exports[_0x423f('0x22')]=function(_0x1668d4,_0x4114e1){return db['JscriptyAnswerReport'][_0x423f('0x4a')]({'where':{'id':_0x1668d4['params']['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x4114e1,null))[_0x423f('0x21')](removeEntity(_0x4114e1,null))[_0x423f('0x42')](handleError(_0x4114e1,null));};exports[_0x423f('0x4b')]=function(_0x17c2b6,_0x961f0d){return db[_0x423f('0x28')][_0x423f('0x4b')]()[_0x423f('0x21')](respondWithResult(_0x961f0d,null))['catch'](handleError(_0x961f0d,null));}; \ No newline at end of file +var _0x326f=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment'];(function(_0xed80b2,_0x88f27d){var _0x39524e=function(_0x232183){while(--_0x232183){_0xed80b2['push'](_0xed80b2['shift']());}};_0x39524e(++_0x88f27d);}(_0x326f,0xd1));var _0xf326=function(_0x617025,_0x138124){_0x617025=_0x617025-0x0;var _0x1a6fd2=_0x326f[_0x617025];return _0x1a6fd2;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['JscriptyAnswerReport'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')](_0x12792c[_0xf326('0x45')],{})[_0xf326('0x24')](respondWithResult(_0x3b90dc,0xc9))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0xeac1a1,_0x59f9a7){if(_0xeac1a1[_0xf326('0x45')]['id']){delete _0xeac1a1[_0xf326('0x45')]['id'];}return db[_0xf326('0x3c')][_0xf326('0x43')]({'where':{'id':_0xeac1a1['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x24')](saveUpdates(_0xeac1a1[_0xf326('0x45')],null))[_0xf326('0x24')](respondWithResult(_0x59f9a7,null))['catch'](handleError(_0x59f9a7,null));};exports[_0xf326('0x23')]=function(_0x1967ab,_0x145a77){return db[_0xf326('0x3c')][_0xf326('0x43')]({'where':{'id':_0x1967ab['params']['id']}})['then'](handleEntityNotFound(_0x145a77,null))[_0xf326('0x24')](removeEntity(_0x145a77,null))[_0xf326('0x40')](handleError(_0x145a77,null));};exports[_0xf326('0x46')]=function(_0x4cb25b,_0x102fba){return db[_0xf326('0x3c')][_0xf326('0x46')]()['then'](respondWithResult(_0x102fba,null))['catch'](handleError(_0x102fba,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 90c2e44..e0adcba 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 _0x0bc7=['report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x0bc7,0xfe));var _0x70bc=function(_0x2d02a1,_0x400768){_0x2d02a1=_0x2d02a1-0x0;var _0x2e44e8=_0x0bc7[_0x2d02a1];return _0x2e44e8;};'use strict';var _=require(_0x70bc('0x0'));var util=require(_0x70bc('0x1'));var logger=require(_0x70bc('0x2'))('api');var moment=require(_0x70bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x70bc('0x4'));var fs=require('fs');var path=require(_0x70bc('0x5'));var rimraf=require(_0x70bc('0x6'));var config=require(_0x70bc('0x7'));var attributes=require(_0x70bc('0x8'));module['exports']=function(_0x4e4d4e,_0x560944){return _0x4e4d4e[_0x70bc('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x70bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdc6=['exports','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x26883d,_0x2049f7){var _0x26f528=function(_0x4fc8de){while(--_0x4fc8de){_0x26883d['push'](_0x26883d['shift']());}};_0x26f528(++_0x2049f7);}(_0xfdc6,0xf3));var _0x6fdc=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0xfdc6[_0x51eb91];return _0x1c4fc4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6fdc('0x0'))(_0x6fdc('0x1'));var moment=require('moment');var BPromise=require(_0x6fdc('0x2'));var rp=require(_0x6fdc('0x3'));var fs=require('fs');var path=require(_0x6fdc('0x4'));var rimraf=require(_0x6fdc('0x5'));var config=require(_0x6fdc('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x6fdc('0x7')]=function(_0x5a651b,_0x5e9de5){return _0x5a651b['define'](_0x6fdc('0x8'),attributes,{'tableName':_0x6fdc('0x9'),'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 eda988c..2a16bf9 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 _0xc504=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5f26f4,_0x4f9bcf){var _0x385e31=function(_0x20d9d7){while(--_0x20d9d7){_0x5f26f4['push'](_0x5f26f4['shift']());}};_0x385e31(++_0x4f9bcf);}(_0xc504,0x1c6));var _0x4c50=function(_0x502196,_0x19affd){_0x502196=_0x502196-0x0;var _0x1ace96=_0xc504[_0x502196];return _0x1ace96;};'use strict';var _=require(_0x4c50('0x0'));var util=require(_0x4c50('0x1'));var moment=require(_0x4c50('0x2'));var BPromise=require(_0x4c50('0x3'));var rs=require(_0x4c50('0x4'));var fs=require('fs');var Redis=require(_0x4c50('0x5'));var db=require(_0x4c50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c50('0x7'))(_0x4c50('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c50('0x9'));var client=jayson[_0x4c50('0xa')][_0x4c50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c86f2,_0x15f26e,_0x36b02d){return new BPromise(function(_0x1d1fc1,_0x40bb56){return client[_0x4c50('0xc')](_0x4c86f2,_0x36b02d)['then'](function(_0x152f1f){logger[_0x4c50('0xd')](_0x4c50('0xe'),_0x15f26e,_0x4c50('0xf'));logger['debug'](_0x4c50('0x10'),_0x15f26e,_0x4c50('0xf'),JSON[_0x4c50('0x11')](_0x152f1f));if(_0x152f1f[_0x4c50('0x12')]){if(_0x152f1f['error'][_0x4c50('0x13')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x15f26e,_0x152f1f[_0x4c50('0x12')][_0x4c50('0x14')]);return _0x40bb56(_0x152f1f[_0x4c50('0x12')]['message']);}logger['error'](_0x4c50('0xe'),_0x15f26e,_0x152f1f[_0x4c50('0x12')][_0x4c50('0x14')]);return _0x1d1fc1(_0x152f1f['error'][_0x4c50('0x14')]);}else{logger['info'](_0x4c50('0xe'),_0x15f26e,_0x4c50('0xf'));_0x1d1fc1(_0x152f1f[_0x4c50('0x15')][_0x4c50('0x14')]);}})[_0x4c50('0x16')](function(_0x26714b){logger[_0x4c50('0x12')](_0x4c50('0xe'),_0x15f26e,_0x26714b);_0x40bb56(_0x26714b);});});} \ No newline at end of file +var _0xfd47=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1993b4,_0x55b66f){var _0xe58d80=function(_0x243d90){while(--_0x243d90){_0x1993b4['push'](_0x1993b4['shift']());}};_0xe58d80(++_0x55b66f);}(_0xfd47,0x10d));var _0x7fd4=function(_0xe964f,_0x2f9d47){_0xe964f=_0xe964f-0x0;var _0x39cce7=_0xfd47[_0xe964f];return _0x39cce7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7fd4('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fd4('0x1'));var db=require(_0x7fd4('0x2'))['db'];var utils=require(_0x7fd4('0x3'));var logger=require(_0x7fd4('0x4'))(_0x7fd4('0x5'));var config=require(_0x7fd4('0x6'));var jayson=require(_0x7fd4('0x7'));var client=jayson[_0x7fd4('0x8')][_0x7fd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c52ab,_0x1a28f7,_0x51281e){return new BPromise(function(_0x19f90c,_0x322052){return client['request'](_0x2c52ab,_0x51281e)[_0x7fd4('0xa')](function(_0x201c77){logger[_0x7fd4('0xb')](_0x7fd4('0xc'),_0x1a28f7,'request\x20sent');logger[_0x7fd4('0xd')](_0x7fd4('0xe'),_0x1a28f7,_0x7fd4('0xf'),JSON[_0x7fd4('0x10')](_0x201c77));if(_0x201c77['error']){if(_0x201c77[_0x7fd4('0x11')][_0x7fd4('0x12')]===0x1f4){logger[_0x7fd4('0x11')](_0x7fd4('0xc'),_0x1a28f7,_0x201c77[_0x7fd4('0x11')]['message']);return _0x322052(_0x201c77[_0x7fd4('0x11')][_0x7fd4('0x13')]);}logger[_0x7fd4('0x11')](_0x7fd4('0xc'),_0x1a28f7,_0x201c77['error'][_0x7fd4('0x13')]);return _0x19f90c(_0x201c77['error'][_0x7fd4('0x13')]);}else{logger[_0x7fd4('0xb')](_0x7fd4('0xc'),_0x1a28f7,_0x7fd4('0xf'));_0x19f90c(_0x201c77[_0x7fd4('0x14')][_0x7fd4('0x13')]);}})['catch'](function(_0x17023e){logger[_0x7fd4('0x11')](_0x7fd4('0xc'),_0x1a28f7,_0x17023e);_0x322052(_0x17023e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 28e3ccd..aa7f5b9 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 _0xc635=['getSummary','post','create','/:id/clone','clone','put','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','getAnswers','/:id/summary','30s'];(function(_0x2888ba,_0x5b0146){var _0x3e22b3=function(_0x53ea43){while(--_0x53ea43){_0x2888ba['push'](_0x2888ba['shift']());}};_0x3e22b3(++_0x5b0146);}(_0xc635,0x199));var _0x5c63=function(_0x209c34,_0x2a110c){_0x209c34=_0x209c34-0x0;var _0x45289d=_0xc635[_0x209c34];return _0x45289d;};'use strict';var multer=require(_0x5c63('0x0'));var util=require(_0x5c63('0x1'));var path=require(_0x5c63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c63('0x3')]();var fs_extra=require(_0x5c63('0x4'));var auth=require(_0x5c63('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5c63('0x6'));var controller=require(_0x5c63('0x7'));router[_0x5c63('0x8')]('/',auth[_0x5c63('0x9')](),controller[_0x5c63('0xa')]);router['get']('/:id',auth[_0x5c63('0x9')](),controller[_0x5c63('0xb')]);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0x5c63('0xc')]);router[_0x5c63('0x8')]('/:id/answers',auth['isAuthenticated'](),controller[_0x5c63('0xd')]);router[_0x5c63('0x8')](_0x5c63('0xe'),auth[_0x5c63('0x9')](),timeout(_0x5c63('0xf')),controller[_0x5c63('0x10')]);router[_0x5c63('0x11')]('/',auth[_0x5c63('0x9')](),controller[_0x5c63('0x12')]);router[_0x5c63('0x11')](_0x5c63('0x13'),auth[_0x5c63('0x9')](),controller[_0x5c63('0x14')]);router[_0x5c63('0x15')](_0x5c63('0x16'),auth[_0x5c63('0x9')](),controller['update']);router[_0x5c63('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5c63('0x18')]=router; \ No newline at end of file +var _0xe211=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/answers','/:id/summary','30s','post','clone','put','update','destroy','exports','multer','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe211,0x98));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1e21('0x0'));var util=require(_0x1e21('0x1'));var path=require('path');var timeout=require(_0x1e21('0x2'));var express=require(_0x1e21('0x3'));var router=express[_0x1e21('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1e21('0x5'));var interaction=require(_0x1e21('0x6'));var config=require(_0x1e21('0x7'));var controller=require(_0x1e21('0x8'));router[_0x1e21('0x9')]('/',auth[_0x1e21('0xa')](),controller[_0x1e21('0xb')]);router[_0x1e21('0x9')](_0x1e21('0xc'),auth[_0x1e21('0xa')](),controller['show']);router[_0x1e21('0x9')]('/:id/sessions',auth[_0x1e21('0xa')](),controller['getSessions']);router[_0x1e21('0x9')](_0x1e21('0xd'),auth[_0x1e21('0xa')](),controller['getAnswers']);router[_0x1e21('0x9')](_0x1e21('0xe'),auth[_0x1e21('0xa')](),timeout(_0x1e21('0xf')),controller['getSummary']);router[_0x1e21('0x10')]('/',auth[_0x1e21('0xa')](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x1e21('0x11')]);router[_0x1e21('0x12')](_0x1e21('0xc'),auth[_0x1e21('0xa')](),controller[_0x1e21('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1e21('0x14')]);module[_0x1e21('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cfbab66..1e686e1 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 _0xc506=['exports','STRING','name','TEXT','long','setDataValue','formData','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash','util'];(function(_0x48759e,_0x3edb3a){var _0x13da56=function(_0x569a18){while(--_0x569a18){_0x48759e['push'](_0x48759e['shift']());}};_0x13da56(++_0x3edb3a);}(_0xc506,0x147));var _0x6c50=function(_0x124da8,_0x2f4adf){_0x124da8=_0x124da8-0x0;var _0x470b89=_0xc506[_0x124da8];return _0x470b89;};'use strict';var Sequelize=require(_0x6c50('0x0'));var _=require(_0x6c50('0x1'));var util=require(_0x6c50('0x2'));module[_0x6c50('0x3')]={'name':{'type':Sequelize[_0x6c50('0x4')],'unique':_0x6c50('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x6c50('0x6')](_0x6c50('0x7')),'set':function(_0x5dda81){if(_['isObjectLike'](_0x5dda81)){this[_0x6c50('0x8')](_0x6c50('0x9'),JSON['stringify'](_0x5dda81));}else if(_[_0x6c50('0xa')](_0x5dda81)){this['setDataValue']('formData',_0x5dda81);}else{this[_0x6c50('0x8')](_0x6c50('0x9'),util[_0x6c50('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x6c50('0xc')](_0x6c50('0x5'))||'',this[_0x6c50('0xc')](_0x6c50('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6c50('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x1bba=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name','STRING','TEXT','long','setDataValue','stringify','isString','formData'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x1bba,0x145));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa1bb('0x0'));var util=require(_0xa1bb('0x1'));module[_0xa1bb('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa1bb('0x3')},'description':{'type':Sequelize[_0xa1bb('0x4')]},'formData':{'type':Sequelize[_0xa1bb('0x5')](_0xa1bb('0x6')),'set':function(_0x7ddb2b){if(_['isObjectLike'](_0x7ddb2b)){this[_0xa1bb('0x7')]('formData',JSON[_0xa1bb('0x8')](_0x7ddb2b));}else if(_[_0xa1bb('0x9')](_0x7ddb2b)){this[_0xa1bb('0x7')](_0xa1bb('0xa'),_0x7ddb2b);}else{this[_0xa1bb('0x7')](_0xa1bb('0xa'),util[_0xa1bb('0xb')](_0xa1bb('0xc'),this['getDataValue']('name')||'',this[_0xa1bb('0xd')](_0xa1bb('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa1bb('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa1bb('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 27ef4f7..814669c 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 _0x143a=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','getSessions','JscriptySessionReport','order','pick','ProjectId','count','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x54cef4,_0x3f01b9){var _0x50bc2b=function(_0x180df3){while(--_0x180df3){_0x54cef4['push'](_0x54cef4['shift']());}};_0x50bc2b(++_0x3f01b9);}(_0x143a,0x1b9));var _0xa143=function(_0xcff696,_0x212d6d){_0xcff696=_0xcff696-0x0;var _0xf720b9=_0x143a[_0xcff696];return _0xf720b9;};'use strict';var emlformat=require(_0xa143('0x0'));var rimraf=require(_0xa143('0x1'));var zipdir=require(_0xa143('0x2'));var jsonpatch=require(_0xa143('0x3'));var rp=require(_0xa143('0x4'));var moment=require('moment');var BPromise=require(_0xa143('0x5'));var Mustache=require('mustache');var util=require(_0xa143('0x6'));var path=require('path');var sox=require(_0xa143('0x7'));var csv=require(_0xa143('0x8'));var ejs=require(_0xa143('0x9'));var fs=require('fs');var fs_extra=require(_0xa143('0xa'));var _=require(_0xa143('0xb'));var squel=require(_0xa143('0xc'));var crypto=require(_0xa143('0xd'));var jsforce=require(_0xa143('0xe'));var deskjs=require(_0xa143('0xf'));var toCsv=require(_0xa143('0x8'));var querystring=require(_0xa143('0x10'));var Papa=require(_0xa143('0x11'));var Redis=require('ioredis');var authService=require(_0xa143('0x12'));var qs=require(_0xa143('0x13'));var as=require(_0xa143('0x14'));var hardwareService=require(_0xa143('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa143('0x16'));var config=require(_0xa143('0x17'));var licenseUtil=require(_0xa143('0x18'));var db=require(_0xa143('0x19'))['db'];function respondWithStatusCode(_0xc3cc21,_0x3a5c00){_0x3a5c00=_0x3a5c00||0xcc;return function(_0x226303){if(_0x226303){return _0xc3cc21[_0xa143('0x1a')](_0x3a5c00);}return _0xc3cc21[_0xa143('0x1b')](_0x3a5c00)[_0xa143('0x1c')]();};}function respondWithResult(_0x49807f,_0x1988fe){_0x1988fe=_0x1988fe||0xc8;return function(_0x29146e){if(_0x29146e){return _0x49807f[_0xa143('0x1b')](_0x1988fe)[_0xa143('0x1d')](_0x29146e);}};}function respondWithFilteredResult(_0x4318c1,_0x47d554){return function(_0x72f2c7){if(_0x72f2c7){var _0x3f2771=typeof _0x47d554[_0xa143('0x1e')]==='undefined'&&typeof _0x47d554['limit']===_0xa143('0x1f');var _0x3d7197=_0x72f2c7['count'];var _0x7b534e=_0x3f2771?0x0:_0x47d554[_0xa143('0x1e')];var _0x58343c=_0x3f2771?_0x72f2c7['count']:_0x47d554[_0xa143('0x1e')]+_0x47d554[_0xa143('0x20')];var _0xae3471;if(_0x58343c>=_0x3d7197){_0x58343c=_0x3d7197;_0xae3471=0xc8;}else{_0xae3471=0xce;}_0x4318c1['status'](_0xae3471);return _0x4318c1[_0xa143('0x21')]('Content-Range',_0x7b534e+'-'+_0x58343c+'/'+_0x3d7197)[_0xa143('0x1d')](_0x72f2c7);}return null;};}function patchUpdates(_0x25254a){return function(_0x27d8a8){try{jsonpatch[_0xa143('0x22')](_0x27d8a8,_0x25254a,!![]);}catch(_0x477e4d){return BPromise['reject'](_0x477e4d);}return _0x27d8a8[_0xa143('0x23')]();};}function saveUpdates(_0x3a1998,_0x51eb32){return function(_0x419024){if(_0x419024){return _0x419024[_0xa143('0x24')](_0x3a1998)['then'](function(_0xb90b5c){return _0xb90b5c;});}return null;};}function removeEntity(_0xbf7ac,_0x320f20){return function(_0x317b5f){if(_0x317b5f){return _0x317b5f[_0xa143('0x25')]()[_0xa143('0x26')](function(){var _0x26b7f1=_0x317b5f[_0xa143('0x27')]({'plain':!![]});var _0x2467ac=_0xa143('0x28');return db[_0xa143('0x29')]['destroy']({'where':{'type':_0x2467ac,'resourceId':_0x26b7f1['id']}})[_0xa143('0x26')](function(){return _0x317b5f;});})['then'](function(){_0xbf7ac[_0xa143('0x1b')](0xcc)[_0xa143('0x1c')]();});}};}function handleEntityNotFound(_0x422e04,_0x4fc21e){return function(_0x5b68e0){if(!_0x5b68e0){_0x422e04['sendStatus'](0x194);}return _0x5b68e0;};}function handleError(_0x533e13,_0x1fc193){_0x1fc193=_0x1fc193||0x1f4;return function(_0x571877){logger[_0xa143('0x2a')](_0x571877[_0xa143('0x2b')]);if(_0x571877[_0xa143('0x2c')]){delete _0x571877[_0xa143('0x2c')];}_0x533e13[_0xa143('0x1b')](_0x1fc193)['send'](_0x571877);};}exports[_0xa143('0x2d')]=function(_0x105396,_0x4b1505){var _0x4f1000={},_0x4c8da8={},_0x4363b6={'count':0x0,'rows':[]};var _0xd2b938=_[_0xa143('0x2e')](db[_0xa143('0x2f')][_0xa143('0x30')],function(_0x492677){return{'name':_0x492677[_0xa143('0x31')],'type':_0x492677[_0xa143('0x32')][_0xa143('0x33')]};});_0x4c8da8[_0xa143('0x34')]=_[_0xa143('0x2e')](_0xd2b938,'name');_0x4c8da8['query']=_[_0xa143('0x35')](_0x105396[_0xa143('0x36')]);_0x4c8da8[_0xa143('0x37')]=_[_0xa143('0x38')](_0x4c8da8['model'],_0x4c8da8[_0xa143('0x36')]);_0x4f1000['attributes']=_[_0xa143('0x38')](_0x4c8da8[_0xa143('0x34')],qs[_0xa143('0x39')](_0x105396[_0xa143('0x36')][_0xa143('0x39')]));_0x4f1000[_0xa143('0x3a')]=_0x4f1000['attributes']['length']?_0x4f1000['attributes']:_0x4c8da8['model'];if(!_0x105396[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x4f1000[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x105396[_0xa143('0x36')][_0xa143('0x20')]);_0x4f1000[_0xa143('0x1e')]=qs[_0xa143('0x1e')](_0x105396['query'][_0xa143('0x1e')]);}_0x4f1000['order']=qs[_0xa143('0x3d')](_0x105396[_0xa143('0x36')][_0xa143('0x3d')]);_0x4f1000[_0xa143('0x3e')]=qs[_0xa143('0x37')](_['pick'](_0x105396[_0xa143('0x36')],_0x4c8da8[_0xa143('0x37')]),_0xd2b938);if(_0x105396[_0xa143('0x36')][_0xa143('0x3f')]){_0x4f1000[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x4f1000['where'],{'$or':_[_0xa143('0x2e')](_0xd2b938,function(_0x4a6057){if(_0x4a6057[_0xa143('0x32')]!==_0xa143('0x41')){var _0x30c4a2={};_0x30c4a2[_0x4a6057[_0xa143('0x2c')]]={'$like':'%'+_0x105396['query'][_0xa143('0x3f')]+'%'};return _0x30c4a2;}})});}_0x4f1000=_['merge']({},_0x4f1000,_0x105396[_0xa143('0x42')]);var _0x37178b={'where':_0x4f1000[_0xa143('0x3e')]};return db[_0xa143('0x2f')]['count'](_0x37178b)[_0xa143('0x26')](function(_0x5e2f11){_0x4363b6['count']=_0x5e2f11;if(_0x105396[_0xa143('0x36')][_0xa143('0x43')]){_0x4f1000[_0xa143('0x44')]=[{'all':!![]}];}return db[_0xa143('0x2f')][_0xa143('0x45')](_0x4f1000);})['then'](function(_0x9f650f){_0x4363b6[_0xa143('0x46')]=_0x9f650f;return _0x4363b6;})[_0xa143('0x26')](respondWithFilteredResult(_0x4b1505,_0x4f1000))['catch'](handleError(_0x4b1505,null));};exports[_0xa143('0x47')]=function(_0x4e5901,_0x1f0bd9){var _0x23e732={'raw':![],'where':{'id':_0x4e5901[_0xa143('0x48')]['id']}},_0x2a8828={};_0x2a8828[_0xa143('0x34')]=_[_0xa143('0x35')](db['JscriptyProject'][_0xa143('0x30')]);_0x2a8828[_0xa143('0x36')]=_[_0xa143('0x35')](_0x4e5901['query']);_0x2a8828[_0xa143('0x37')]=_['intersection'](_0x2a8828[_0xa143('0x34')],_0x2a8828[_0xa143('0x36')]);_0x23e732[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x2a8828[_0xa143('0x34')],qs['fields'](_0x4e5901[_0xa143('0x36')]['fields']));_0x23e732[_0xa143('0x3a')]=_0x23e732['attributes'][_0xa143('0x49')]?_0x23e732[_0xa143('0x3a')]:_0x2a8828[_0xa143('0x34')];if(_0x4e5901[_0xa143('0x36')][_0xa143('0x43')]){_0x23e732['include']=[{'all':!![]}];}_0x23e732=_[_0xa143('0x40')]({},_0x23e732,_0x4e5901[_0xa143('0x42')]);return db[_0xa143('0x2f')][_0xa143('0x4a')](_0x23e732)[_0xa143('0x26')](handleEntityNotFound(_0x1f0bd9,null))[_0xa143('0x26')](respondWithResult(_0x1f0bd9,null))['catch'](handleError(_0x1f0bd9,null));};exports[_0xa143('0x4b')]=function(_0x5f5b1b,_0x340392){return db[_0xa143('0x2f')][_0xa143('0x4b')](_0x5f5b1b[_0xa143('0x4c')],{})['then'](function(_0x18a4cf){var _0x27369f=_0x5f5b1b[_0xa143('0x4d')][_0xa143('0x27')]({'plain':!![]});if(!_0x27369f)throw new Error(_0xa143('0x4e'));if(_0x27369f['role']==='user'){var _0xc7db60=_0x18a4cf['get']({'plain':!![]});var _0x1bc17f=_0xa143('0x28');return db['UserProfileSection'][_0xa143('0x4a')]({'where':{'name':_0x1bc17f,'userProfileId':_0x27369f['userProfileId']},'raw':!![]})[_0xa143('0x26')](function(_0x65b782){if(_0x65b782&&_0x65b782[_0xa143('0x4f')]===0x0){return db[_0xa143('0x29')][_0xa143('0x4b')]({'name':_0xc7db60[_0xa143('0x2c')],'resourceId':_0xc7db60['id'],'type':_0x65b782['name'],'sectionId':_0x65b782['id']},{})[_0xa143('0x26')](function(){return _0x18a4cf;});}else{return _0x18a4cf;}})[_0xa143('0x50')](function(_0x48b43b){logger[_0xa143('0x2a')](_0xa143('0x51'),_0x48b43b);throw _0x48b43b;});}return _0x18a4cf;})[_0xa143('0x26')](respondWithResult(_0x340392,0xc9))[_0xa143('0x50')](handleError(_0x340392,null));};exports[_0xa143('0x52')]=function(_0x110e2a,_0x1d71c0){var _0x2728cf={'where':{'id':_0x110e2a[_0xa143('0x48')]['id']}},_0x5ae19e={};_0x5ae19e[_0xa143('0x34')]=_[_0xa143('0x35')](db[_0xa143('0x2f')]['rawAttributes']);_0x2728cf[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x5ae19e[_0xa143('0x34')],qs[_0xa143('0x39')](_0x110e2a[_0xa143('0x36')][_0xa143('0x39')]));_0x2728cf['attributes']=_0x2728cf[_0xa143('0x3a')]['length']?_0x2728cf[_0xa143('0x3a')]:_0x5ae19e[_0xa143('0x34')];if(_0x110e2a[_0xa143('0x36')][_0xa143('0x43')]){_0x2728cf[_0xa143('0x44')]=[{'all':!![]}];}_0x2728cf=_[_0xa143('0x40')]({},_0x2728cf,_0x110e2a[_0xa143('0x42')]);return db[_0xa143('0x2f')][_0xa143('0x4a')](_0x2728cf)['then'](handleEntityNotFound(_0x1d71c0,null))[_0xa143('0x26')](function(_0xa2610d){if(_0xa2610d){var _0x566871=_0xa2610d[_0xa143('0x27')]({'plain':!![]});_0x566871=qs[_0xa143('0x53')](_0x566871,['id',_0xa143('0x54'),_0xa143('0x55')]);_0x110e2a[_0xa143('0x4c')]=_[_0xa143('0x53')](_0x110e2a[_0xa143('0x4c')],['id',_0xa143('0x54'),_0xa143('0x55')]);return db['JscriptyProject'][_0xa143('0x4b')](_[_0xa143('0x40')](_0x566871,_0x110e2a[_0xa143('0x4c')]),{'include':_0x110e2a[_0xa143('0x36')][_0xa143('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x2eb472){var _0x1ccb8c=_0x110e2a[_0xa143('0x4d')][_0xa143('0x27')]({'plain':!![]});if(!_0x1ccb8c)throw new Error(_0xa143('0x4e'));if(_0x1ccb8c[_0xa143('0x56')]===_0xa143('0x4d')){var _0x4229f6=_0x2eb472[_0xa143('0x27')]({'plain':!![]});var _0x11b315='Projects';return db[_0xa143('0x57')][_0xa143('0x4a')]({'where':{'name':_0x11b315,'userProfileId':_0x1ccb8c['userProfileId']},'raw':!![]})[_0xa143('0x26')](function(_0xcf1c08){if(_0xcf1c08&&_0xcf1c08[_0xa143('0x4f')]===0x0){return db[_0xa143('0x29')][_0xa143('0x4b')]({'name':_0x4229f6['name'],'resourceId':_0x4229f6['id'],'type':_0xcf1c08[_0xa143('0x2c')],'sectionId':_0xcf1c08['id']},{})[_0xa143('0x26')](function(){return _0x2eb472;});}else{return _0x2eb472;}})['catch'](function(_0x431b90){logger[_0xa143('0x2a')](_0xa143('0x51'),_0x431b90);throw _0x431b90;});}return _0x2eb472;});}})['then'](respondWithResult(_0x1d71c0,0xc9))[_0xa143('0x50')](handleError(_0x1d71c0,null));};exports['update']=function(_0x1f6e78,_0x12dd6c){if(_0x1f6e78[_0xa143('0x4c')]['id']){delete _0x1f6e78[_0xa143('0x4c')]['id'];}return db[_0xa143('0x2f')][_0xa143('0x4a')]({'where':{'id':_0x1f6e78['params']['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x12dd6c,null))[_0xa143('0x26')](saveUpdates(_0x1f6e78['body'],null))[_0xa143('0x26')](respondWithResult(_0x12dd6c,null))[_0xa143('0x50')](handleError(_0x12dd6c,null));};exports[_0xa143('0x25')]=function(_0x117028,_0x1af5c0){return db[_0xa143('0x2f')]['find']({'where':{'id':_0x117028[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x1af5c0,null))[_0xa143('0x26')](removeEntity(_0x1af5c0,null))[_0xa143('0x50')](handleError(_0x1af5c0,null));};exports[_0xa143('0x58')]=function(_0x37ca1f,_0x51add7,_0xaed815){var _0x415f8f={'raw':!![],'where':{}};var _0x5cda88={};var _0xbdc66b={'count':0x0,'rows':[]};return db[_0xa143('0x2f')]['findOne']({'where':{'id':_0x37ca1f[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x51add7,null))[_0xa143('0x26')](function(_0x1076b2){if(_0x1076b2){_0x5cda88[_0xa143('0x34')]=_[_0xa143('0x35')](db[_0xa143('0x59')][_0xa143('0x30')]);_0x5cda88[_0xa143('0x36')]=_[_0xa143('0x35')](_0x37ca1f[_0xa143('0x36')]);_0x5cda88['filters']=_['intersection'](_0x5cda88[_0xa143('0x34')],_0x5cda88[_0xa143('0x36')]);_0x415f8f[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x5cda88[_0xa143('0x34')],qs[_0xa143('0x39')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x39')]));_0x415f8f[_0xa143('0x3a')]=_0x415f8f['attributes']['length']?_0x415f8f['attributes']:_0x5cda88[_0xa143('0x34')];if(!_0x37ca1f[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x415f8f[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x20')]);_0x415f8f['offset']=qs['offset'](_0x37ca1f[_0xa143('0x36')][_0xa143('0x1e')]);}_0x415f8f[_0xa143('0x5a')]=qs[_0xa143('0x3d')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x3d')]);_0x415f8f[_0xa143('0x3e')]=qs['filters'](_[_0xa143('0x5b')](_0x37ca1f['query'],_0x5cda88[_0xa143('0x37')]));_0x415f8f['where'][_0xa143('0x5c')]=_0x1076b2['id'];if(_0x37ca1f['query'][_0xa143('0x3f')]){_0x415f8f[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x415f8f[_0xa143('0x3e')],{'$or':_[_0xa143('0x2e')](_0x415f8f[_0xa143('0x3a')],function(_0x6443dd){var _0x406f9a={};_0x406f9a[_0x6443dd]={'$like':'%'+_0x37ca1f[_0xa143('0x36')]['filter']+'%'};return _0x406f9a;})});}_0x415f8f=_['merge']({},_0x415f8f,_0x37ca1f[_0xa143('0x42')]);return db[_0xa143('0x59')]['count']({'where':_0x415f8f[_0xa143('0x3e')]})[_0xa143('0x26')](function(_0x1c94b9){_0xbdc66b[_0xa143('0x5d')]=_0x1c94b9;if(_0x37ca1f[_0xa143('0x36')][_0xa143('0x43')]){_0x415f8f['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xa143('0x45')](_0x415f8f);})[_0xa143('0x26')](function(_0x46a627){_0xbdc66b[_0xa143('0x46')]=_0x46a627;return _0xbdc66b;});}})['then'](respondWithFilteredResult(_0x51add7,_0x415f8f))[_0xa143('0x50')](handleError(_0x51add7,null));};exports[_0xa143('0x5e')]=function(_0x536261,_0xe2dbc1,_0x5f15c3){var _0x2fed93={'raw':!![],'where':{}};var _0x4c9a69={};var _0x36f159={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa143('0x5f')]({'where':{'id':_0x536261[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0xe2dbc1,null))[_0xa143('0x26')](function(_0xf80dbd){if(_0xf80dbd){_0x4c9a69[_0xa143('0x34')]=_['keys'](db[_0xa143('0x60')]['rawAttributes']);_0x4c9a69[_0xa143('0x36')]=_[_0xa143('0x35')](_0x536261[_0xa143('0x36')]);_0x4c9a69[_0xa143('0x37')]=_[_0xa143('0x38')](_0x4c9a69[_0xa143('0x34')],_0x4c9a69[_0xa143('0x36')]);_0x2fed93[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x4c9a69['model'],qs['fields'](_0x536261[_0xa143('0x36')]['fields']));_0x2fed93[_0xa143('0x3a')]=_0x2fed93[_0xa143('0x3a')][_0xa143('0x49')]?_0x2fed93[_0xa143('0x3a')]:_0x4c9a69[_0xa143('0x34')];if(!_0x536261[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x2fed93[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x536261[_0xa143('0x36')][_0xa143('0x20')]);_0x2fed93[_0xa143('0x1e')]=qs['offset'](_0x536261[_0xa143('0x36')][_0xa143('0x1e')]);}_0x2fed93[_0xa143('0x5a')]=qs[_0xa143('0x3d')](_0x536261[_0xa143('0x36')]['sort']);_0x2fed93[_0xa143('0x3e')]=qs[_0xa143('0x37')](_[_0xa143('0x5b')](_0x536261[_0xa143('0x36')],_0x4c9a69['filters']));_0x2fed93[_0xa143('0x3e')][_0xa143('0x5c')]=_0xf80dbd['id'];if(_0x536261[_0xa143('0x36')][_0xa143('0x3f')]){_0x2fed93[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x2fed93[_0xa143('0x3e')],{'$or':_[_0xa143('0x2e')](_0x2fed93[_0xa143('0x3a')],function(_0x3c0a1e){var _0x4a99d6={};_0x4a99d6[_0x3c0a1e]={'$like':'%'+_0x536261['query']['filter']+'%'};return _0x4a99d6;})});}_0x2fed93=_['merge']({},_0x2fed93,_0x536261[_0xa143('0x42')]);return db[_0xa143('0x60')]['count']({'where':_0x2fed93[_0xa143('0x3e')]})[_0xa143('0x26')](function(_0xd672fe){_0x36f159[_0xa143('0x5d')]=_0xd672fe;if(_0x536261['query']['includeAll']){_0x2fed93['include']=[{'all':!![]}];}return db[_0xa143('0x60')][_0xa143('0x45')](_0x2fed93);})['then'](function(_0x3b8900){_0x36f159[_0xa143('0x46')]=_0x3b8900;return _0x36f159;});}})[_0xa143('0x26')](respondWithFilteredResult(_0xe2dbc1,_0x2fed93))[_0xa143('0x50')](handleError(_0xe2dbc1,null));};function char(_0x2d6916){return _0xa143('0x61')===typeof _0x2d6916?String[_0xa143('0x62')][_0xa143('0x22')](null,arguments):_0x2d6916;}function needsEncapsulation(_0x3f4ad2){return!!_0x3f4ad2&&(_0x3f4ad2[_0xa143('0x63')]()[_0xa143('0x64')](char(0xd))>=0x0||_0x3f4ad2[_0xa143('0x63')]()['indexOf'](char(0xa))>=0x0||_0x3f4ad2['toString']()[_0xa143('0x64')](char(0x2c))>=0x0||_0x3f4ad2[_0xa143('0x63')]()[_0xa143('0x64')](char(0x22))>=0x0);}function encapsulate(_0x5555ac){var _0x2a3d88=char(0x22),_0x189cc7='\x5c'+char(0x22),_0x4c1c04=_0x5555ac[_0xa143('0x63')]()[_0xa143('0x65')](new RegExp(_0x2a3d88,'g'),_0x189cc7);return _0x2a3d88+_0x4c1c04+_0x2a3d88;}exports[_0xa143('0x66')]=function(_0x4b49c5,_0x2c35ab,_0x8b535){var _0x2f56b2,_0x251887;var _0x333447={'where':{'ProjectId':_0x4b49c5[_0xa143('0x48')]['id']}};if(_0x4b49c5[_0xa143('0x36')]['startTime']){_0x333447[_0xa143('0x3e')][_0xa143('0x67')]=JSON[_0xa143('0x68')](_0x4b49c5[_0xa143('0x36')][_0xa143('0x69')]);}return db[_0xa143('0x59')][_0xa143('0x45')](_0x333447)[_0xa143('0x26')](handleEntityNotFound(_0x2c35ab,null))['then'](function(_0x602403){if(_0x602403){_0x2f56b2=_0x602403;return db[_0xa143('0x6a')][_0xa143('0x45')]({'where':{'SessionId':{'$in':_[_0xa143('0x2e')](_0x2f56b2,'id')},'ProjectId':_0x4b49c5['params']['id']},'order':_0xa143('0x6b')});}})[_0xa143('0x26')](handleEntityNotFound(_0x2c35ab,null))[_0xa143('0x26')](function(_0x3c01ed){if(_0x3c01ed){_0x251887=_0x3c01ed;var _0x235f9b={};for(var _0x483e80=0x0,_0x6e9fd1=_0x251887[_0xa143('0x49')];_0x483e80<_0x6e9fd1;_0x483e80++){if(!_0x235f9b[_0xa143('0x3b')](_0x251887[_0x483e80][_0xa143('0x6c')])){_0x235f9b[_0x251887[_0x483e80][_0xa143('0x6c')]]=needsEncapsulation(_0x251887[_0x483e80][_0xa143('0x6d')])?encapsulate(_0x251887[_0x483e80][_0xa143('0x6d')]):_0x251887[_0x483e80][_0xa143('0x6d')];}}var _0x3a38ef=[],_0x1b0798={};for(var _0xfdd855=0x0,_0x15ea8c=_0x2f56b2[_0xa143('0x49')];_0xfdd855<_0x15ea8c;_0xfdd855++){_0x1b0798={'ProjectId':_0x4b49c5['params']['id'],'SessionId':_0x2f56b2[_0xfdd855]['id'],'StartTime':moment(_0x2f56b2[_0xfdd855][_0xa143('0x67')])[_0xa143('0x6e')](_0xa143('0x6f'))};for(var _0x2825ba=0x0,_0x398b76=_0x251887[_0xa143('0x49')];_0x2825ba<_0x398b76;_0x2825ba++){if(_0x251887[_0x2825ba][_0xa143('0x70')]==_0x2f56b2[_0xfdd855]['id']&&_0x235f9b[_0xa143('0x3b')](_0x251887[_0x2825ba][_0xa143('0x6c')])){_0x1b0798[_0x235f9b[_0x251887[_0x2825ba][_0xa143('0x6c')]]]=_0x251887[_0x2825ba][_0xa143('0x71')];}}for(var _0x4a0d09 in _0x235f9b){if(!_0x1b0798[_0xa143('0x3b')](_0x235f9b[_0x4a0d09])){_0x1b0798[_0x235f9b[_0x4a0d09]]=null;}}_0x3a38ef['push'](_0x1b0798);}return _0x3a38ef;}})[_0xa143('0x26')](function(_0x25b2fe){if(!_[_0xa143('0x72')](_0x25b2fe)){var _0x104678=toCsv(_0x25b2fe);var _0x282114=Date[_0xa143('0x73')]();fs[_0xa143('0x74')](util['format'](_0xa143('0x75'),_0x4b49c5['params']['id'],_0x282114),_0x104678);_0x2c35ab[_0xa143('0x76')](_0xa143('0x77'),'attachment;\x20filename='+util[_0xa143('0x6e')](_0xa143('0x78'),_0x4b49c5[_0xa143('0x48')]['id'],_0x282114));_0x2c35ab[_0xa143('0x76')](_0xa143('0x79'),_0xa143('0x7a'));return _0x2c35ab[_0xa143('0x7b')](util[_0xa143('0x6e')](_0xa143('0x75'),_0x4b49c5[_0xa143('0x48')]['id'],_0x282114));}else{return _0x2c35ab[_0xa143('0x1a')](0xcc);}})[_0xa143('0x50')](handleError(_0x2c35ab,null));}; \ No newline at end of file +var _0xd232=['request-promise','moment','bluebird','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','JscriptyProject','includeAll','include','show','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','body','omit','user','userProfileId','error','getSessions','JscriptySessionReport','hasOwnProperty','ProjectId','findAll','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','zip-dir','fast-json-patch'];(function(_0x10a7d2,_0x16a8bd){var _0x2c9036=function(_0x38b2e2){while(--_0x38b2e2){_0x10a7d2['push'](_0x10a7d2['shift']());}};_0x2c9036(++_0x16a8bd);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2d23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d23('0x1'));var jsonpatch=require(_0x2d23('0x2'));var rp=require(_0x2d23('0x3'));var moment=require(_0x2d23('0x4'));var BPromise=require(_0x2d23('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d23('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d23('0x7'));var fs=require('fs');var fs_extra=require(_0x2d23('0x8'));var _=require(_0x2d23('0x9'));var squel=require('squel');var crypto=require(_0x2d23('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2d23('0xb'));var toCsv=require(_0x2d23('0xc'));var querystring=require(_0x2d23('0xd'));var Papa=require(_0x2d23('0xe'));var Redis=require(_0x2d23('0xf'));var authService=require(_0x2d23('0x10'));var qs=require(_0x2d23('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d23('0x12'));var logger=require(_0x2d23('0x13'))(_0x2d23('0x14'));var utils=require(_0x2d23('0x15'));var config=require(_0x2d23('0x16'));var licenseUtil=require(_0x2d23('0x17'));var db=require(_0x2d23('0x18'))['db'];function respondWithStatusCode(_0xe816ba,_0x33da73){_0x33da73=_0x33da73||0xcc;return function(_0x344755){if(_0x344755){return _0xe816ba[_0x2d23('0x19')](_0x33da73);}return _0xe816ba[_0x2d23('0x1a')](_0x33da73)['end']();};}function respondWithResult(_0x428a01,_0x28554a){_0x28554a=_0x28554a||0xc8;return function(_0x3cd5b2){if(_0x3cd5b2){return _0x428a01[_0x2d23('0x1a')](_0x28554a)[_0x2d23('0x1b')](_0x3cd5b2);}};}function respondWithFilteredResult(_0x5557ed,_0x47233f){return function(_0x54051e){if(_0x54051e){var _0x1b8ac4=typeof _0x47233f['offset']===_0x2d23('0x1c')&&typeof _0x47233f[_0x2d23('0x1d')]==='undefined';var _0x56a120=_0x54051e[_0x2d23('0x1e')];var _0x59c54b=_0x1b8ac4?0x0:_0x47233f[_0x2d23('0x1f')];var _0x1428c8=_0x1b8ac4?_0x54051e[_0x2d23('0x1e')]:_0x47233f[_0x2d23('0x1f')]+_0x47233f['limit'];var _0x5d73be;if(_0x1428c8>=_0x56a120){_0x1428c8=_0x56a120;_0x5d73be=0xc8;}else{_0x5d73be=0xce;}_0x5557ed[_0x2d23('0x1a')](_0x5d73be);return _0x5557ed[_0x2d23('0x20')](_0x2d23('0x21'),_0x59c54b+'-'+_0x1428c8+'/'+_0x56a120)['json'](_0x54051e);}return null;};}function patchUpdates(_0x512e4d){return function(_0x44025e){try{jsonpatch[_0x2d23('0x22')](_0x44025e,_0x512e4d,!![]);}catch(_0x15ec13){return BPromise[_0x2d23('0x23')](_0x15ec13);}return _0x44025e['save']();};}function saveUpdates(_0x33c4fb,_0x42eb0d){return function(_0x4bc017){if(_0x4bc017){return _0x4bc017['update'](_0x33c4fb)[_0x2d23('0x24')](function(_0x4bfa6c){return _0x4bfa6c;});}return null;};}function removeEntity(_0x20256a,_0x3b09e4){return function(_0x5a1f1e){if(_0x5a1f1e){return _0x5a1f1e[_0x2d23('0x25')]()[_0x2d23('0x24')](function(){var _0x3aef1d=_0x5a1f1e['get']({'plain':!![]});var _0x3f1a97='Projects';return db[_0x2d23('0x26')][_0x2d23('0x25')]({'where':{'type':_0x3f1a97,'resourceId':_0x3aef1d['id']}})[_0x2d23('0x24')](function(){return _0x5a1f1e;});})[_0x2d23('0x24')](function(){_0x20256a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40bee3,_0x2e5701){return function(_0x533489){if(!_0x533489){_0x40bee3[_0x2d23('0x19')](0x194);}return _0x533489;};}function handleError(_0x5f2aed,_0x2a20ca){_0x2a20ca=_0x2a20ca||0x1f4;return function(_0x5e01a7){logger['error'](_0x5e01a7[_0x2d23('0x27')]);if(_0x5e01a7[_0x2d23('0x28')]){delete _0x5e01a7[_0x2d23('0x28')];}_0x5f2aed[_0x2d23('0x1a')](_0x2a20ca)[_0x2d23('0x29')](_0x5e01a7);};}exports[_0x2d23('0x2a')]=function(_0x479958,_0x40dfe7){var _0x39b8ef={},_0xfd6e32={},_0x3326d2={'count':0x0,'rows':[]};var _0x12d802=_[_0x2d23('0x2b')](db['JscriptyProject'][_0x2d23('0x2c')],function(_0x3058fb){return{'name':_0x3058fb[_0x2d23('0x2d')],'type':_0x3058fb['type'][_0x2d23('0x2e')]};});_0xfd6e32[_0x2d23('0x2f')]=_['map'](_0x12d802,_0x2d23('0x28'));_0xfd6e32[_0x2d23('0x30')]=_[_0x2d23('0x31')](_0x479958['query']);_0xfd6e32[_0x2d23('0x32')]=_[_0x2d23('0x33')](_0xfd6e32[_0x2d23('0x2f')],_0xfd6e32[_0x2d23('0x30')]);_0x39b8ef['attributes']=_[_0x2d23('0x33')](_0xfd6e32['model'],qs[_0x2d23('0x34')](_0x479958['query'][_0x2d23('0x34')]));_0x39b8ef[_0x2d23('0x35')]=_0x39b8ef['attributes'][_0x2d23('0x36')]?_0x39b8ef[_0x2d23('0x35')]:_0xfd6e32[_0x2d23('0x2f')];if(!_0x479958[_0x2d23('0x30')]['hasOwnProperty'](_0x2d23('0x37'))){_0x39b8ef[_0x2d23('0x1d')]=qs[_0x2d23('0x1d')](_0x479958[_0x2d23('0x30')]['limit']);_0x39b8ef[_0x2d23('0x1f')]=qs[_0x2d23('0x1f')](_0x479958[_0x2d23('0x30')][_0x2d23('0x1f')]);}_0x39b8ef[_0x2d23('0x38')]=qs[_0x2d23('0x39')](_0x479958['query']['sort']);_0x39b8ef[_0x2d23('0x3a')]=qs['filters'](_[_0x2d23('0x3b')](_0x479958[_0x2d23('0x30')],_0xfd6e32[_0x2d23('0x32')]),_0x12d802);if(_0x479958[_0x2d23('0x30')][_0x2d23('0x3c')]){_0x39b8ef[_0x2d23('0x3a')]=_[_0x2d23('0x3d')](_0x39b8ef[_0x2d23('0x3a')],{'$or':_['map'](_0x12d802,function(_0x50670f){if(_0x50670f[_0x2d23('0x3e')]!=='VIRTUAL'){var _0x1f503c={};_0x1f503c[_0x50670f[_0x2d23('0x28')]]={'$like':'%'+_0x479958[_0x2d23('0x30')][_0x2d23('0x3c')]+'%'};return _0x1f503c;}})});}_0x39b8ef=_['merge']({},_0x39b8ef,_0x479958[_0x2d23('0x3f')]);var _0x3878b4={'where':_0x39b8ef[_0x2d23('0x3a')]};return db[_0x2d23('0x40')][_0x2d23('0x1e')](_0x3878b4)[_0x2d23('0x24')](function(_0x36f744){_0x3326d2[_0x2d23('0x1e')]=_0x36f744;if(_0x479958[_0x2d23('0x30')][_0x2d23('0x41')]){_0x39b8ef[_0x2d23('0x42')]=[{'all':!![]}];}return db[_0x2d23('0x40')]['findAll'](_0x39b8ef);})[_0x2d23('0x24')](function(_0x5a40c4){_0x3326d2['rows']=_0x5a40c4;return _0x3326d2;})[_0x2d23('0x24')](respondWithFilteredResult(_0x40dfe7,_0x39b8ef))['catch'](handleError(_0x40dfe7,null));};exports[_0x2d23('0x43')]=function(_0x238f9b,_0x358fbc){var _0x56af4e={'raw':![],'where':{'id':_0x238f9b['params']['id']}},_0x2f7660={};_0x2f7660[_0x2d23('0x2f')]=_['keys'](db[_0x2d23('0x40')][_0x2d23('0x2c')]);_0x2f7660[_0x2d23('0x30')]=_[_0x2d23('0x31')](_0x238f9b[_0x2d23('0x30')]);_0x2f7660['filters']=_[_0x2d23('0x33')](_0x2f7660[_0x2d23('0x2f')],_0x2f7660[_0x2d23('0x30')]);_0x56af4e[_0x2d23('0x35')]=_['intersection'](_0x2f7660[_0x2d23('0x2f')],qs['fields'](_0x238f9b[_0x2d23('0x30')][_0x2d23('0x34')]));_0x56af4e['attributes']=_0x56af4e[_0x2d23('0x35')][_0x2d23('0x36')]?_0x56af4e['attributes']:_0x2f7660[_0x2d23('0x2f')];if(_0x238f9b[_0x2d23('0x30')]['includeAll']){_0x56af4e[_0x2d23('0x42')]=[{'all':!![]}];}_0x56af4e=_['merge']({},_0x56af4e,_0x238f9b[_0x2d23('0x3f')]);return db[_0x2d23('0x40')][_0x2d23('0x44')](_0x56af4e)[_0x2d23('0x24')](handleEntityNotFound(_0x358fbc,null))[_0x2d23('0x24')](respondWithResult(_0x358fbc,null))[_0x2d23('0x45')](handleError(_0x358fbc,null));};exports[_0x2d23('0x46')]=function(_0xedfaef,_0x1878d2){return db[_0x2d23('0x40')][_0x2d23('0x46')](_0xedfaef['body'],{})[_0x2d23('0x24')](function(_0x307473){var _0x4130af=_0xedfaef['user'][_0x2d23('0x47')]({'plain':!![]});if(!_0x4130af)throw new Error(_0x2d23('0x48'));if(_0x4130af[_0x2d23('0x49')]==='user'){var _0xaa8ac9=_0x307473[_0x2d23('0x47')]({'plain':!![]});var _0x4b5f9f=_0x2d23('0x4a');return db[_0x2d23('0x4b')][_0x2d23('0x44')]({'where':{'name':_0x4b5f9f,'userProfileId':_0x4130af['userProfileId']},'raw':!![]})[_0x2d23('0x24')](function(_0x41bccf){if(_0x41bccf&&_0x41bccf[_0x2d23('0x4c')]===0x0){return db[_0x2d23('0x26')][_0x2d23('0x46')]({'name':_0xaa8ac9[_0x2d23('0x28')],'resourceId':_0xaa8ac9['id'],'type':_0x41bccf['name'],'sectionId':_0x41bccf['id']},{})[_0x2d23('0x24')](function(){return _0x307473;});}else{return _0x307473;}})[_0x2d23('0x45')](function(_0x49d3aa){logger['error'](_0x2d23('0x4d'),_0x49d3aa);throw _0x49d3aa;});}return _0x307473;})['then'](respondWithResult(_0x1878d2,0xc9))['catch'](handleError(_0x1878d2,null));};exports['clone']=function(_0x17d9c6,_0x5032ee){var _0x5a6600={'where':{'id':_0x17d9c6[_0x2d23('0x4e')]['id']}},_0x557bdc={};_0x557bdc[_0x2d23('0x2f')]=_[_0x2d23('0x31')](db[_0x2d23('0x40')][_0x2d23('0x2c')]);_0x5a6600[_0x2d23('0x35')]=_['intersection'](_0x557bdc[_0x2d23('0x2f')],qs[_0x2d23('0x34')](_0x17d9c6[_0x2d23('0x30')][_0x2d23('0x34')]));_0x5a6600[_0x2d23('0x35')]=_0x5a6600[_0x2d23('0x35')][_0x2d23('0x36')]?_0x5a6600['attributes']:_0x557bdc[_0x2d23('0x2f')];if(_0x17d9c6[_0x2d23('0x30')][_0x2d23('0x41')]){_0x5a6600[_0x2d23('0x42')]=[{'all':!![]}];}_0x5a6600=_['merge']({},_0x5a6600,_0x17d9c6[_0x2d23('0x3f')]);return db[_0x2d23('0x40')]['find'](_0x5a6600)[_0x2d23('0x24')](handleEntityNotFound(_0x5032ee,null))[_0x2d23('0x24')](function(_0x4b4917){if(_0x4b4917){var _0x559c47=_0x4b4917[_0x2d23('0x47')]({'plain':!![]});_0x559c47=qs['omit'](_0x559c47,['id',_0x2d23('0x4f'),_0x2d23('0x50')]);_0x17d9c6[_0x2d23('0x51')]=_[_0x2d23('0x52')](_0x17d9c6['body'],['id',_0x2d23('0x4f'),_0x2d23('0x50')]);return db[_0x2d23('0x40')][_0x2d23('0x46')](_[_0x2d23('0x3d')](_0x559c47,_0x17d9c6[_0x2d23('0x51')]),{'include':_0x17d9c6['query'][_0x2d23('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x41fcac){var _0x4f83fe=_0x17d9c6[_0x2d23('0x53')][_0x2d23('0x47')]({'plain':!![]});if(!_0x4f83fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f83fe[_0x2d23('0x49')]===_0x2d23('0x53')){var _0x2aa57d=_0x41fcac[_0x2d23('0x47')]({'plain':!![]});var _0xf3e553=_0x2d23('0x4a');return db[_0x2d23('0x4b')]['find']({'where':{'name':_0xf3e553,'userProfileId':_0x4f83fe[_0x2d23('0x54')]},'raw':!![]})[_0x2d23('0x24')](function(_0x4bb2cc){if(_0x4bb2cc&&_0x4bb2cc['autoAssociation']===0x0){return db[_0x2d23('0x26')][_0x2d23('0x46')]({'name':_0x2aa57d[_0x2d23('0x28')],'resourceId':_0x2aa57d['id'],'type':_0x4bb2cc['name'],'sectionId':_0x4bb2cc['id']},{})[_0x2d23('0x24')](function(){return _0x41fcac;});}else{return _0x41fcac;}})[_0x2d23('0x45')](function(_0x1ebc9f){logger[_0x2d23('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ebc9f);throw _0x1ebc9f;});}return _0x41fcac;});}})[_0x2d23('0x24')](respondWithResult(_0x5032ee,0xc9))[_0x2d23('0x45')](handleError(_0x5032ee,null));};exports['update']=function(_0x1adc77,_0x396f1c){if(_0x1adc77[_0x2d23('0x51')]['id']){delete _0x1adc77[_0x2d23('0x51')]['id'];}return db[_0x2d23('0x40')][_0x2d23('0x44')]({'where':{'id':_0x1adc77['params']['id']}})[_0x2d23('0x24')](handleEntityNotFound(_0x396f1c,null))['then'](saveUpdates(_0x1adc77['body'],null))[_0x2d23('0x24')](respondWithResult(_0x396f1c,null))[_0x2d23('0x45')](handleError(_0x396f1c,null));};exports[_0x2d23('0x25')]=function(_0x78813e,_0x243512){return db[_0x2d23('0x40')]['find']({'where':{'id':_0x78813e[_0x2d23('0x4e')]['id']}})[_0x2d23('0x24')](handleEntityNotFound(_0x243512,null))[_0x2d23('0x24')](removeEntity(_0x243512,null))['catch'](handleError(_0x243512,null));};exports[_0x2d23('0x56')]=function(_0x152378,_0x2826ec,_0x54b801){var _0xa566ff={'raw':!![],'where':{}};var _0x273d79={};var _0x1ac1f1={'count':0x0,'rows':[]};return db[_0x2d23('0x40')]['findOne']({'where':{'id':_0x152378[_0x2d23('0x4e')]['id']}})[_0x2d23('0x24')](handleEntityNotFound(_0x2826ec,null))[_0x2d23('0x24')](function(_0x5159f6){if(_0x5159f6){_0x273d79['model']=_[_0x2d23('0x31')](db[_0x2d23('0x57')][_0x2d23('0x2c')]);_0x273d79['query']=_[_0x2d23('0x31')](_0x152378['query']);_0x273d79[_0x2d23('0x32')]=_[_0x2d23('0x33')](_0x273d79[_0x2d23('0x2f')],_0x273d79['query']);_0xa566ff['attributes']=_['intersection'](_0x273d79['model'],qs['fields'](_0x152378['query'][_0x2d23('0x34')]));_0xa566ff['attributes']=_0xa566ff[_0x2d23('0x35')][_0x2d23('0x36')]?_0xa566ff[_0x2d23('0x35')]:_0x273d79[_0x2d23('0x2f')];if(!_0x152378[_0x2d23('0x30')][_0x2d23('0x58')](_0x2d23('0x37'))){_0xa566ff[_0x2d23('0x1d')]=qs[_0x2d23('0x1d')](_0x152378[_0x2d23('0x30')][_0x2d23('0x1d')]);_0xa566ff['offset']=qs['offset'](_0x152378['query']['offset']);}_0xa566ff[_0x2d23('0x38')]=qs[_0x2d23('0x39')](_0x152378[_0x2d23('0x30')][_0x2d23('0x39')]);_0xa566ff['where']=qs[_0x2d23('0x32')](_[_0x2d23('0x3b')](_0x152378[_0x2d23('0x30')],_0x273d79[_0x2d23('0x32')]));_0xa566ff[_0x2d23('0x3a')][_0x2d23('0x59')]=_0x5159f6['id'];if(_0x152378[_0x2d23('0x30')][_0x2d23('0x3c')]){_0xa566ff[_0x2d23('0x3a')]=_['merge'](_0xa566ff[_0x2d23('0x3a')],{'$or':_[_0x2d23('0x2b')](_0xa566ff[_0x2d23('0x35')],function(_0x387040){var _0x3187fc={};_0x3187fc[_0x387040]={'$like':'%'+_0x152378[_0x2d23('0x30')]['filter']+'%'};return _0x3187fc;})});}_0xa566ff=_[_0x2d23('0x3d')]({},_0xa566ff,_0x152378[_0x2d23('0x3f')]);return db[_0x2d23('0x57')]['count']({'where':_0xa566ff[_0x2d23('0x3a')]})[_0x2d23('0x24')](function(_0x9d9302){_0x1ac1f1[_0x2d23('0x1e')]=_0x9d9302;if(_0x152378[_0x2d23('0x30')][_0x2d23('0x41')]){_0xa566ff[_0x2d23('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2d23('0x5a')](_0xa566ff);})['then'](function(_0x2ba691){_0x1ac1f1['rows']=_0x2ba691;return _0x1ac1f1;});}})[_0x2d23('0x24')](respondWithFilteredResult(_0x2826ec,_0xa566ff))[_0x2d23('0x45')](handleError(_0x2826ec,null));};exports['getAnswers']=function(_0x4910d1,_0x43de26,_0x21bace){var _0x5b0132={'raw':!![],'where':{}};var _0x44e377={};var _0xe43ee8={'count':0x0,'rows':[]};return db[_0x2d23('0x40')][_0x2d23('0x5b')]({'where':{'id':_0x4910d1[_0x2d23('0x4e')]['id']}})[_0x2d23('0x24')](handleEntityNotFound(_0x43de26,null))['then'](function(_0x34512b){if(_0x34512b){_0x44e377[_0x2d23('0x2f')]=_[_0x2d23('0x31')](db[_0x2d23('0x5c')][_0x2d23('0x2c')]);_0x44e377[_0x2d23('0x30')]=_[_0x2d23('0x31')](_0x4910d1[_0x2d23('0x30')]);_0x44e377[_0x2d23('0x32')]=_[_0x2d23('0x33')](_0x44e377[_0x2d23('0x2f')],_0x44e377['query']);_0x5b0132[_0x2d23('0x35')]=_[_0x2d23('0x33')](_0x44e377[_0x2d23('0x2f')],qs[_0x2d23('0x34')](_0x4910d1[_0x2d23('0x30')][_0x2d23('0x34')]));_0x5b0132[_0x2d23('0x35')]=_0x5b0132['attributes'][_0x2d23('0x36')]?_0x5b0132[_0x2d23('0x35')]:_0x44e377[_0x2d23('0x2f')];if(!_0x4910d1[_0x2d23('0x30')][_0x2d23('0x58')]('nolimit')){_0x5b0132['limit']=qs[_0x2d23('0x1d')](_0x4910d1[_0x2d23('0x30')][_0x2d23('0x1d')]);_0x5b0132['offset']=qs[_0x2d23('0x1f')](_0x4910d1[_0x2d23('0x30')][_0x2d23('0x1f')]);}_0x5b0132[_0x2d23('0x38')]=qs[_0x2d23('0x39')](_0x4910d1[_0x2d23('0x30')][_0x2d23('0x39')]);_0x5b0132[_0x2d23('0x3a')]=qs[_0x2d23('0x32')](_[_0x2d23('0x3b')](_0x4910d1[_0x2d23('0x30')],_0x44e377[_0x2d23('0x32')]));_0x5b0132[_0x2d23('0x3a')][_0x2d23('0x59')]=_0x34512b['id'];if(_0x4910d1[_0x2d23('0x30')]['filter']){_0x5b0132[_0x2d23('0x3a')]=_['merge'](_0x5b0132['where'],{'$or':_[_0x2d23('0x2b')](_0x5b0132[_0x2d23('0x35')],function(_0x3cfcff){var _0x2e995c={};_0x2e995c[_0x3cfcff]={'$like':'%'+_0x4910d1[_0x2d23('0x30')][_0x2d23('0x3c')]+'%'};return _0x2e995c;})});}_0x5b0132=_[_0x2d23('0x3d')]({},_0x5b0132,_0x4910d1[_0x2d23('0x3f')]);return db['JscriptyAnswerReport']['count']({'where':_0x5b0132['where']})['then'](function(_0x5a84bf){_0xe43ee8[_0x2d23('0x1e')]=_0x5a84bf;if(_0x4910d1[_0x2d23('0x30')]['includeAll']){_0x5b0132[_0x2d23('0x42')]=[{'all':!![]}];}return db[_0x2d23('0x5c')][_0x2d23('0x5a')](_0x5b0132);})[_0x2d23('0x24')](function(_0x2963c9){_0xe43ee8['rows']=_0x2963c9;return _0xe43ee8;});}})['then'](respondWithFilteredResult(_0x43de26,_0x5b0132))['catch'](handleError(_0x43de26,null));};function char(_0x3ce01e){return _0x2d23('0x5d')===typeof _0x3ce01e?String[_0x2d23('0x5e')][_0x2d23('0x22')](null,arguments):_0x3ce01e;}function needsEncapsulation(_0x2fab18){return!!_0x2fab18&&(_0x2fab18[_0x2d23('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x2fab18[_0x2d23('0x5f')]()[_0x2d23('0x60')](char(0xa))>=0x0||_0x2fab18[_0x2d23('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x2fab18[_0x2d23('0x5f')]()[_0x2d23('0x60')](char(0x22))>=0x0);}function encapsulate(_0x5ba825){var _0x452e77=char(0x22),_0x210a88='\x5c'+char(0x22),_0x1cc3ad=_0x5ba825['toString']()[_0x2d23('0x61')](new RegExp(_0x452e77,'g'),_0x210a88);return _0x452e77+_0x1cc3ad+_0x452e77;}exports[_0x2d23('0x62')]=function(_0x5d8b39,_0x1864b3,_0x1e7ffd){var _0x274b31,_0x1cbdb6;var _0x1ddb1f={'where':{'ProjectId':_0x5d8b39[_0x2d23('0x4e')]['id']}};if(_0x5d8b39[_0x2d23('0x30')][_0x2d23('0x63')]){_0x1ddb1f['where'][_0x2d23('0x64')]=JSON[_0x2d23('0x65')](_0x5d8b39['query']['startTime']);}return db['JscriptySessionReport']['findAll'](_0x1ddb1f)[_0x2d23('0x24')](handleEntityNotFound(_0x1864b3,null))[_0x2d23('0x24')](function(_0x21021f){if(_0x21021f){_0x274b31=_0x21021f;return db['JscriptyQuestionReport'][_0x2d23('0x5a')]({'where':{'SessionId':{'$in':_[_0x2d23('0x2b')](_0x274b31,'id')},'ProjectId':_0x5d8b39[_0x2d23('0x4e')]['id']},'order':_0x2d23('0x66')});}})[_0x2d23('0x24')](handleEntityNotFound(_0x1864b3,null))[_0x2d23('0x24')](function(_0x55d9b4){if(_0x55d9b4){_0x1cbdb6=_0x55d9b4;var _0x4126d9={};for(var _0x53f614=0x0,_0x1af601=_0x1cbdb6['length'];_0x53f614<_0x1af601;_0x53f614++){if(!_0x4126d9['hasOwnProperty'](_0x1cbdb6[_0x53f614][_0x2d23('0x67')])){_0x4126d9[_0x1cbdb6[_0x53f614][_0x2d23('0x67')]]=needsEncapsulation(_0x1cbdb6[_0x53f614][_0x2d23('0x68')])?encapsulate(_0x1cbdb6[_0x53f614][_0x2d23('0x68')]):_0x1cbdb6[_0x53f614]['question'];}}var _0x2bd081=[],_0x5c6358={};for(var _0x3ce102=0x0,_0x4c5ef9=_0x274b31[_0x2d23('0x36')];_0x3ce102<_0x4c5ef9;_0x3ce102++){_0x5c6358={'ProjectId':_0x5d8b39[_0x2d23('0x4e')]['id'],'SessionId':_0x274b31[_0x3ce102]['id'],'StartTime':moment(_0x274b31[_0x3ce102]['starttime'])[_0x2d23('0x69')](_0x2d23('0x6a'))};for(var _0x2ade03=0x0,_0x478fd8=_0x1cbdb6[_0x2d23('0x36')];_0x2ade03<_0x478fd8;_0x2ade03++){if(_0x1cbdb6[_0x2ade03][_0x2d23('0x6b')]==_0x274b31[_0x3ce102]['id']&&_0x4126d9[_0x2d23('0x58')](_0x1cbdb6[_0x2ade03][_0x2d23('0x67')])){_0x5c6358[_0x4126d9[_0x1cbdb6[_0x2ade03]['questionId']]]=_0x1cbdb6[_0x2ade03]['answer'];}}for(var _0x105997 in _0x4126d9){if(!_0x5c6358[_0x2d23('0x58')](_0x4126d9[_0x105997])){_0x5c6358[_0x4126d9[_0x105997]]=null;}}_0x2bd081[_0x2d23('0x6c')](_0x5c6358);}return _0x2bd081;}})['then'](function(_0x219c9e){if(!_[_0x2d23('0x6d')](_0x219c9e)){var _0x49e77b=toCsv(_0x219c9e);var _0x205790=Date[_0x2d23('0x6e')]();fs[_0x2d23('0x6f')](util[_0x2d23('0x69')](_0x2d23('0x70'),_0x5d8b39[_0x2d23('0x4e')]['id'],_0x205790),_0x49e77b);_0x1864b3[_0x2d23('0x71')](_0x2d23('0x72'),_0x2d23('0x73')+util[_0x2d23('0x69')](_0x2d23('0x74'),_0x5d8b39[_0x2d23('0x4e')]['id'],_0x205790));_0x1864b3[_0x2d23('0x71')]('Content-type',_0x2d23('0x75'));return _0x1864b3[_0x2d23('0x76')](util[_0x2d23('0x69')](_0x2d23('0x70'),_0x5d8b39['params']['id'],_0x205790));}else{return _0x1864b3[_0x2d23('0x19')](0xcc);}})[_0x2d23('0x45')](handleError(_0x1864b3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 60e259c..b7042c9 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 _0x8e0f=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes'];(function(_0x217523,_0x5d793a){var _0x43e3e1=function(_0x477f77){while(--_0x477f77){_0x217523['push'](_0x217523['shift']());}};_0x43e3e1(++_0x5d793a);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x41b109,_0x3f1365){_0x41b109=_0x41b109-0x0;var _0x440653=_0x8e0f[_0x41b109];return _0x440653;};'use strict';var _=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var logger=require(_0xf8e0('0x2'))(_0xf8e0('0x3'));var moment=require(_0xf8e0('0x4'));var BPromise=require(_0xf8e0('0x5'));var rp=require(_0xf8e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e0('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8e0('0x8'));module[_0xf8e0('0x9')]=function(_0x4f3b30,_0x2921b3){return _0x4f3b30[_0xf8e0('0xa')](_0xf8e0('0xb'),attributes,{'tableName':_0xf8e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4148=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','jscripty_projects'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4148,0xc6));var _0x8414=function(_0x520a18,_0x2e7d0a){_0x520a18=_0x520a18-0x0;var _0x5b0ba6=_0x4148[_0x520a18];return _0x5b0ba6;};'use strict';var _=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var logger=require(_0x8414('0x2'))(_0x8414('0x3'));var moment=require(_0x8414('0x4'));var BPromise=require('bluebird');var rp=require(_0x8414('0x5'));var fs=require('fs');var path=require(_0x8414('0x6'));var rimraf=require(_0x8414('0x7'));var config=require(_0x8414('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x8414('0x9')]=function(_0x5119d0,_0x8b350a){return _0x5119d0['define']('JscriptyProject',attributes,{'tableName':_0x8414('0xa'),'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 fd39e09..d04eeb1 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x27a8af,_0x4f7e9e){var _0x25050f=function(_0x9d4451){while(--_0x9d4451){_0x27a8af['push'](_0x27a8af['shift']());}};_0x25050f(++_0x4f7e9e);}(_0x70e0,0x17b));var _0x070e=function(_0xc4141a,_0x2ca194){_0xc4141a=_0xc4141a-0x0;var _0x656668=_0x70e0[_0xc4141a];return _0x656668;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\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 +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5202de,_0x4e1b12){var _0x47fdfd=function(_0x451e2b){while(--_0x451e2b){_0x5202de['push'](_0x5202de['shift']());}};_0x47fdfd(++_0x4e1b12);}(_0xb43b,0x1b2));var _0xbb43=function(_0x50fc82,_0x3d4211){_0x50fc82=_0x50fc82-0x0;var _0x59e734=_0xb43b[_0x50fc82];return _0x59e734;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9c6dce0..93abb78 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 _0x507d=['get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x1b8e24,_0x1dbcd0){var _0x44b6b3=function(_0x32199e){while(--_0x32199e){_0x1b8e24['push'](_0x1b8e24['shift']());}};_0x44b6b3(++_0x1dbcd0);}(_0x507d,0xde));var _0xd507=function(_0x4a7736,_0x5bc5fa){_0x4a7736=_0x4a7736-0x0;var _0x48f09a=_0x507d[_0x4a7736];return _0x48f09a;};'use strict';var multer=require(_0xd507('0x0'));var util=require(_0xd507('0x1'));var path=require(_0xd507('0x2'));var timeout=require(_0xd507('0x3'));var express=require('express');var router=express[_0xd507('0x4')]();var fs_extra=require(_0xd507('0x5'));var auth=require(_0xd507('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd507('0x7'));var controller=require(_0xd507('0x8'));router[_0xd507('0x9')]('/',auth[_0xd507('0xa')](),controller[_0xd507('0xb')]);router[_0xd507('0x9')](_0xd507('0xc'),auth[_0xd507('0xa')](),controller['describe']);router[_0xd507('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd507('0xd')]);router[_0xd507('0xe')]('/',auth['isAuthenticated'](),controller[_0xd507('0xf')]);router[_0xd507('0x10')](_0xd507('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xd507('0x12')](_0xd507('0x11'),auth[_0xd507('0xa')](),controller[_0xd507('0x13')]);module[_0xd507('0x14')]=router; \ No newline at end of file +var _0xc23b=['exports','path','express','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x3ff61e,_0x28d5ba){var _0x117b1b=function(_0x15148d){while(--_0x15148d){_0x3ff61e['push'](_0x3ff61e['shift']());}};_0x117b1b(++_0x28d5ba);}(_0xc23b,0x10b));var _0xbc23=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0xc23b[_0x430459];return _0x3a2439;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc23('0x0'));var timeout=require('connect-timeout');var express=require(_0xbc23('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc23('0x2'));var config=require(_0xbc23('0x3'));var controller=require(_0xbc23('0x4'));router[_0xbc23('0x5')]('/',auth['isAuthenticated'](),controller[_0xbc23('0x6')]);router[_0xbc23('0x5')](_0xbc23('0x7'),auth['isAuthenticated'](),controller[_0xbc23('0x8')]);router[_0xbc23('0x5')](_0xbc23('0x9'),auth[_0xbc23('0xa')](),controller[_0xbc23('0xb')]);router[_0xbc23('0xc')]('/',auth['isAuthenticated'](),controller[_0xbc23('0xd')]);router[_0xbc23('0xe')]('/:id',auth[_0xbc23('0xa')](),controller[_0xbc23('0xf')]);router[_0xbc23('0x10')](_0xbc23('0x9'),auth[_0xbc23('0xa')](),controller[_0xbc23('0x11')]);module[_0xbc23('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ac15d41..2311388 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef4e5,_0x248fe7){_0x4ef4e5=_0x4ef4e5-0x0;var _0x192cfa=_0x7a54[_0x4ef4e5];return _0x192cfa;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x1dae73,_0x514f56){_0x1dae73=_0x1dae73-0x0;var _0x33378f=_0x7a54[_0x1dae73];return _0x33378f;};'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 2dae7e0..2728d2d 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 _0xdf93=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','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'];(function(_0x376679,_0x5ce09e){var _0xae73e9=function(_0x4bba87){while(--_0x4bba87){_0x376679['push'](_0x376679['shift']());}};_0xae73e9(++_0x5ce09e);}(_0xdf93,0x80));var _0x3df9=function(_0x594f9a,_0x479270){_0x594f9a=_0x594f9a-0x0;var _0x35bf46=_0xdf93[_0x594f9a];return _0x35bf46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3df9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3df9('0x1'));var rp=require(_0x3df9('0x2'));var moment=require(_0x3df9('0x3'));var BPromise=require(_0x3df9('0x4'));var Mustache=require(_0x3df9('0x5'));var util=require(_0x3df9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3df9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3df9('0x8'));var _=require(_0x3df9('0x9'));var squel=require('squel');var crypto=require(_0x3df9('0xa'));var jsforce=require(_0x3df9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3df9('0x7'));var querystring=require('querystring');var Papa=require(_0x3df9('0xc'));var Redis=require(_0x3df9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3df9('0xe'));var as=require(_0x3df9('0xf'));var hardwareService=require(_0x3df9('0x10'));var logger=require(_0x3df9('0x11'))(_0x3df9('0x12'));var utils=require(_0x3df9('0x13'));var config=require(_0x3df9('0x14'));var licenseUtil=require(_0x3df9('0x15'));var db=require(_0x3df9('0x16'))['db'];function respondWithStatusCode(_0x5bc07d,_0x10e1f0){_0x10e1f0=_0x10e1f0||0xcc;return function(_0x5a570c){if(_0x5a570c){return _0x5bc07d[_0x3df9('0x17')](_0x10e1f0);}return _0x5bc07d[_0x3df9('0x18')](_0x10e1f0)['end']();};}function respondWithResult(_0x133950,_0x347092){_0x347092=_0x347092||0xc8;return function(_0x1f2a51){if(_0x1f2a51){return _0x133950['status'](_0x347092)[_0x3df9('0x19')](_0x1f2a51);}};}function respondWithFilteredResult(_0x3b4a97,_0x1110b0){return function(_0x4ff44d){if(_0x4ff44d){var _0x36cca3=typeof _0x1110b0[_0x3df9('0x1a')]===_0x3df9('0x1b')&&typeof _0x1110b0[_0x3df9('0x1c')]===_0x3df9('0x1b');var _0x1f7d46=_0x4ff44d[_0x3df9('0x1d')];var _0x59a734=_0x36cca3?0x0:_0x1110b0[_0x3df9('0x1a')];var _0x2fb5c6=_0x36cca3?_0x4ff44d[_0x3df9('0x1d')]:_0x1110b0[_0x3df9('0x1a')]+_0x1110b0[_0x3df9('0x1c')];var _0x5ae632;if(_0x2fb5c6>=_0x1f7d46){_0x2fb5c6=_0x1f7d46;_0x5ae632=0xc8;}else{_0x5ae632=0xce;}_0x3b4a97[_0x3df9('0x18')](_0x5ae632);return _0x3b4a97[_0x3df9('0x1e')](_0x3df9('0x1f'),_0x59a734+'-'+_0x2fb5c6+'/'+_0x1f7d46)[_0x3df9('0x19')](_0x4ff44d);}return null;};}function patchUpdates(_0x49cff6){return function(_0x52e1aa){try{jsonpatch[_0x3df9('0x20')](_0x52e1aa,_0x49cff6,!![]);}catch(_0x294a5b){return BPromise[_0x3df9('0x21')](_0x294a5b);}return _0x52e1aa[_0x3df9('0x22')]();};}function saveUpdates(_0x55bfd9,_0x195c94){return function(_0x313179){if(_0x313179){return _0x313179[_0x3df9('0x23')](_0x55bfd9)[_0x3df9('0x24')](function(_0x5eb6b3){return _0x5eb6b3;});}return null;};}function removeEntity(_0x174a98,_0x14b378){return function(_0x329c4d){if(_0x329c4d){return _0x329c4d[_0x3df9('0x25')]()[_0x3df9('0x24')](function(){_0x174a98['status'](0xcc)[_0x3df9('0x26')]();});}};}function handleEntityNotFound(_0x4aab42,_0x1585ac){return function(_0x16021a){if(!_0x16021a){_0x4aab42['sendStatus'](0x194);}return _0x16021a;};}function handleError(_0x37cd27,_0x5797a1){_0x5797a1=_0x5797a1||0x1f4;return function(_0x2413cf){logger[_0x3df9('0x27')](_0x2413cf[_0x3df9('0x28')]);if(_0x2413cf['name']){delete _0x2413cf[_0x3df9('0x29')];}_0x37cd27['status'](_0x5797a1)[_0x3df9('0x2a')](_0x2413cf);};}exports[_0x3df9('0x2b')]=function(_0x1d18bf,_0x1d8409){var _0x45183c={},_0x51df45={},_0xcba5d9={'count':0x0,'rows':[]};var _0x360f8a=_[_0x3df9('0x2c')](db[_0x3df9('0x2d')][_0x3df9('0x2e')],function(_0x4739de){return{'name':_0x4739de['fieldName'],'type':_0x4739de[_0x3df9('0x2f')][_0x3df9('0x30')]};});_0x51df45[_0x3df9('0x31')]=_[_0x3df9('0x2c')](_0x360f8a,_0x3df9('0x29'));_0x51df45[_0x3df9('0x32')]=_['keys'](_0x1d18bf['query']);_0x51df45[_0x3df9('0x33')]=_[_0x3df9('0x34')](_0x51df45[_0x3df9('0x31')],_0x51df45[_0x3df9('0x32')]);_0x45183c[_0x3df9('0x35')]=_[_0x3df9('0x34')](_0x51df45[_0x3df9('0x31')],qs[_0x3df9('0x36')](_0x1d18bf[_0x3df9('0x32')][_0x3df9('0x36')]));_0x45183c['attributes']=_0x45183c[_0x3df9('0x35')][_0x3df9('0x37')]?_0x45183c[_0x3df9('0x35')]:_0x51df45['model'];if(!_0x1d18bf[_0x3df9('0x32')]['hasOwnProperty'](_0x3df9('0x38'))){_0x45183c[_0x3df9('0x1c')]=qs[_0x3df9('0x1c')](_0x1d18bf[_0x3df9('0x32')][_0x3df9('0x1c')]);_0x45183c[_0x3df9('0x1a')]=qs[_0x3df9('0x1a')](_0x1d18bf['query']['offset']);}_0x45183c[_0x3df9('0x39')]=qs[_0x3df9('0x3a')](_0x1d18bf[_0x3df9('0x32')][_0x3df9('0x3a')]);_0x45183c[_0x3df9('0x3b')]=qs[_0x3df9('0x33')](_[_0x3df9('0x3c')](_0x1d18bf['query'],_0x51df45['filters']),_0x360f8a);if(_0x1d18bf[_0x3df9('0x32')][_0x3df9('0x3d')]){_0x45183c[_0x3df9('0x3b')]=_[_0x3df9('0x3e')](_0x45183c[_0x3df9('0x3b')],{'$or':_[_0x3df9('0x2c')](_0x360f8a,function(_0x4c5d1f){if(_0x4c5d1f[_0x3df9('0x2f')]!==_0x3df9('0x3f')){var _0x1b134d={};_0x1b134d[_0x4c5d1f['name']]={'$like':'%'+_0x1d18bf['query'][_0x3df9('0x3d')]+'%'};return _0x1b134d;}})});}_0x45183c=_[_0x3df9('0x3e')]({},_0x45183c,_0x1d18bf[_0x3df9('0x40')]);var _0x47dc69={'where':_0x45183c['where']};return db[_0x3df9('0x2d')][_0x3df9('0x1d')](_0x47dc69)[_0x3df9('0x24')](function(_0x3d367b){_0xcba5d9[_0x3df9('0x1d')]=_0x3d367b;if(_0x1d18bf[_0x3df9('0x32')][_0x3df9('0x41')]){_0x45183c[_0x3df9('0x42')]=[{'all':!![]}];}return db[_0x3df9('0x2d')][_0x3df9('0x43')](_0x45183c);})['then'](function(_0x15c67a){_0xcba5d9[_0x3df9('0x44')]=_0x15c67a;return _0xcba5d9;})[_0x3df9('0x24')](respondWithFilteredResult(_0x1d8409,_0x45183c))[_0x3df9('0x45')](handleError(_0x1d8409,null));};exports[_0x3df9('0x46')]=function(_0x22e61c,_0x10647a){var _0x17e34e={'raw':!![],'where':{'id':_0x22e61c[_0x3df9('0x47')]['id']}},_0x1c1ed7={};_0x1c1ed7[_0x3df9('0x31')]=_['keys'](db[_0x3df9('0x2d')][_0x3df9('0x2e')]);_0x1c1ed7[_0x3df9('0x32')]=_[_0x3df9('0x48')](_0x22e61c[_0x3df9('0x32')]);_0x1c1ed7[_0x3df9('0x33')]=_['intersection'](_0x1c1ed7[_0x3df9('0x31')],_0x1c1ed7[_0x3df9('0x32')]);_0x17e34e[_0x3df9('0x35')]=_[_0x3df9('0x34')](_0x1c1ed7[_0x3df9('0x31')],qs['fields'](_0x22e61c['query'][_0x3df9('0x36')]));_0x17e34e[_0x3df9('0x35')]=_0x17e34e[_0x3df9('0x35')][_0x3df9('0x37')]?_0x17e34e[_0x3df9('0x35')]:_0x1c1ed7['model'];if(_0x22e61c[_0x3df9('0x32')]['includeAll']){_0x17e34e[_0x3df9('0x42')]=[{'all':!![]}];}_0x17e34e=_[_0x3df9('0x3e')]({},_0x17e34e,_0x22e61c[_0x3df9('0x40')]);return db[_0x3df9('0x2d')][_0x3df9('0x49')](_0x17e34e)[_0x3df9('0x24')](handleEntityNotFound(_0x10647a,null))[_0x3df9('0x24')](respondWithResult(_0x10647a,null))[_0x3df9('0x45')](handleError(_0x10647a,null));};exports['create']=function(_0x306d3d,_0x515054){return db[_0x3df9('0x2d')][_0x3df9('0x4a')](_0x306d3d['body'],{})[_0x3df9('0x24')](respondWithResult(_0x515054,0xc9))['catch'](handleError(_0x515054,null));};exports[_0x3df9('0x23')]=function(_0x2f5ed5,_0x1e767d){if(_0x2f5ed5[_0x3df9('0x4b')]['id']){delete _0x2f5ed5[_0x3df9('0x4b')]['id'];}return db[_0x3df9('0x2d')]['find']({'where':{'id':_0x2f5ed5[_0x3df9('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e767d,null))['then'](saveUpdates(_0x2f5ed5[_0x3df9('0x4b')],null))['then'](respondWithResult(_0x1e767d,null))['catch'](handleError(_0x1e767d,null));};exports['destroy']=function(_0x573228,_0x1ba346){return db[_0x3df9('0x2d')][_0x3df9('0x49')]({'where':{'id':_0x573228[_0x3df9('0x47')]['id']}})[_0x3df9('0x24')](handleEntityNotFound(_0x1ba346,null))[_0x3df9('0x24')](removeEntity(_0x1ba346,null))['catch'](handleError(_0x1ba346,null));};exports['describe']=function(_0x17b122,_0x2fb4d2){return db[_0x3df9('0x2d')][_0x3df9('0x4c')]()['then'](respondWithResult(_0x2fb4d2,null))[_0x3df9('0x45')](handleError(_0x2fb4d2,null));}; \ No newline at end of file +var _0x4699=['error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x132940,_0x5ecbcf){var _0x4b1ed1=function(_0x1f1d6b){while(--_0x1f1d6b){_0x132940['push'](_0x132940['shift']());}};_0x4b1ed1(++_0x5ecbcf);}(_0x4699,0xb8));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9469('0x0'));var rimraf=require(_0x9469('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9469('0x2'));var rp=require(_0x9469('0x3'));var moment=require(_0x9469('0x4'));var BPromise=require(_0x9469('0x5'));var Mustache=require(_0x9469('0x6'));var util=require(_0x9469('0x7'));var path=require(_0x9469('0x8'));var sox=require(_0x9469('0x9'));var csv=require(_0x9469('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9469('0xb'));var _=require(_0x9469('0xc'));var squel=require(_0x9469('0xd'));var crypto=require(_0x9469('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9469('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9469('0x10'));var Redis=require('ioredis');var authService=require(_0x9469('0x11'));var qs=require(_0x9469('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9469('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9469('0x14'));var config=require(_0x9469('0x15'));var licenseUtil=require(_0x9469('0x16'));var db=require(_0x9469('0x17'))['db'];function respondWithStatusCode(_0x5a8b25,_0x97cb22){_0x97cb22=_0x97cb22||0xcc;return function(_0x2ec270){if(_0x2ec270){return _0x5a8b25['sendStatus'](_0x97cb22);}return _0x5a8b25['status'](_0x97cb22)[_0x9469('0x18')]();};}function respondWithResult(_0xc50f1c,_0x340504){_0x340504=_0x340504||0xc8;return function(_0x18db74){if(_0x18db74){return _0xc50f1c[_0x9469('0x19')](_0x340504)[_0x9469('0x1a')](_0x18db74);}};}function respondWithFilteredResult(_0x544030,_0x88565c){return function(_0x28dd33){if(_0x28dd33){var _0x2f3d4d=typeof _0x88565c[_0x9469('0x1b')]===_0x9469('0x1c')&&typeof _0x88565c[_0x9469('0x1d')]===_0x9469('0x1c');var _0x176ad7=_0x28dd33[_0x9469('0x1e')];var _0x2f35da=_0x2f3d4d?0x0:_0x88565c[_0x9469('0x1b')];var _0x4f2fb5=_0x2f3d4d?_0x28dd33[_0x9469('0x1e')]:_0x88565c[_0x9469('0x1b')]+_0x88565c['limit'];var _0x32a943;if(_0x4f2fb5>=_0x176ad7){_0x4f2fb5=_0x176ad7;_0x32a943=0xc8;}else{_0x32a943=0xce;}_0x544030[_0x9469('0x19')](_0x32a943);return _0x544030[_0x9469('0x1f')](_0x9469('0x20'),_0x2f35da+'-'+_0x4f2fb5+'/'+_0x176ad7)[_0x9469('0x1a')](_0x28dd33);}return null;};}function patchUpdates(_0xa4abe0){return function(_0x5d3687){try{jsonpatch[_0x9469('0x21')](_0x5d3687,_0xa4abe0,!![]);}catch(_0x16bfc4){return BPromise['reject'](_0x16bfc4);}return _0x5d3687[_0x9469('0x22')]();};}function saveUpdates(_0x5ef7c9,_0x32ee81){return function(_0x5e5597){if(_0x5e5597){return _0x5e5597[_0x9469('0x23')](_0x5ef7c9)[_0x9469('0x24')](function(_0x5b692e){return _0x5b692e;});}return null;};}function removeEntity(_0x381502,_0x554aa6){return function(_0x4bb866){if(_0x4bb866){return _0x4bb866[_0x9469('0x25')]()[_0x9469('0x24')](function(){_0x381502[_0x9469('0x19')](0xcc)[_0x9469('0x18')]();});}};}function handleEntityNotFound(_0x39ffac,_0x2d2acb){return function(_0x3e6c16){if(!_0x3e6c16){_0x39ffac['sendStatus'](0x194);}return _0x3e6c16;};}function handleError(_0x17eff2,_0x4aa628){_0x4aa628=_0x4aa628||0x1f4;return function(_0x39a5a8){logger[_0x9469('0x26')](_0x39a5a8[_0x9469('0x27')]);if(_0x39a5a8[_0x9469('0x28')]){delete _0x39a5a8[_0x9469('0x28')];}_0x17eff2[_0x9469('0x19')](_0x4aa628)[_0x9469('0x29')](_0x39a5a8);};}exports[_0x9469('0x2a')]=function(_0x42480c,_0x440b34){var _0x32309f={},_0x12b2b7={},_0xb819a={'count':0x0,'rows':[]};var _0x488dcd=_[_0x9469('0x2b')](db[_0x9469('0x2c')][_0x9469('0x2d')],function(_0xadbc4a){return{'name':_0xadbc4a[_0x9469('0x2e')],'type':_0xadbc4a[_0x9469('0x2f')]['key']};});_0x12b2b7['model']=_[_0x9469('0x2b')](_0x488dcd,'name');_0x12b2b7['query']=_['keys'](_0x42480c[_0x9469('0x30')]);_0x12b2b7[_0x9469('0x31')]=_[_0x9469('0x32')](_0x12b2b7[_0x9469('0x33')],_0x12b2b7['query']);_0x32309f[_0x9469('0x34')]=_[_0x9469('0x32')](_0x12b2b7[_0x9469('0x33')],qs[_0x9469('0x35')](_0x42480c['query'][_0x9469('0x35')]));_0x32309f['attributes']=_0x32309f[_0x9469('0x34')][_0x9469('0x36')]?_0x32309f[_0x9469('0x34')]:_0x12b2b7[_0x9469('0x33')];if(!_0x42480c[_0x9469('0x30')][_0x9469('0x37')]('nolimit')){_0x32309f[_0x9469('0x1d')]=qs['limit'](_0x42480c['query'][_0x9469('0x1d')]);_0x32309f[_0x9469('0x1b')]=qs[_0x9469('0x1b')](_0x42480c['query']['offset']);}_0x32309f[_0x9469('0x38')]=qs[_0x9469('0x39')](_0x42480c[_0x9469('0x30')]['sort']);_0x32309f[_0x9469('0x3a')]=qs[_0x9469('0x31')](_[_0x9469('0x3b')](_0x42480c[_0x9469('0x30')],_0x12b2b7[_0x9469('0x31')]),_0x488dcd);if(_0x42480c['query'][_0x9469('0x3c')]){_0x32309f[_0x9469('0x3a')]=_['merge'](_0x32309f[_0x9469('0x3a')],{'$or':_[_0x9469('0x2b')](_0x488dcd,function(_0x3097ea){if(_0x3097ea[_0x9469('0x2f')]!=='VIRTUAL'){var _0x498787={};_0x498787[_0x3097ea[_0x9469('0x28')]]={'$like':'%'+_0x42480c[_0x9469('0x30')]['filter']+'%'};return _0x498787;}})});}_0x32309f=_[_0x9469('0x3d')]({},_0x32309f,_0x42480c[_0x9469('0x3e')]);var _0x587352={'where':_0x32309f['where']};return db[_0x9469('0x2c')]['count'](_0x587352)[_0x9469('0x24')](function(_0x4fd1a2){_0xb819a['count']=_0x4fd1a2;if(_0x42480c[_0x9469('0x30')][_0x9469('0x3f')]){_0x32309f[_0x9469('0x40')]=[{'all':!![]}];}return db[_0x9469('0x2c')][_0x9469('0x41')](_0x32309f);})[_0x9469('0x24')](function(_0x30bb6b){_0xb819a['rows']=_0x30bb6b;return _0xb819a;})[_0x9469('0x24')](respondWithFilteredResult(_0x440b34,_0x32309f))[_0x9469('0x42')](handleError(_0x440b34,null));};exports[_0x9469('0x43')]=function(_0x207012,_0x388f50){var _0x112a2e={'raw':!![],'where':{'id':_0x207012[_0x9469('0x44')]['id']}},_0x1363e1={};_0x1363e1['model']=_['keys'](db[_0x9469('0x2c')][_0x9469('0x2d')]);_0x1363e1[_0x9469('0x30')]=_[_0x9469('0x45')](_0x207012[_0x9469('0x30')]);_0x1363e1[_0x9469('0x31')]=_[_0x9469('0x32')](_0x1363e1[_0x9469('0x33')],_0x1363e1[_0x9469('0x30')]);_0x112a2e[_0x9469('0x34')]=_[_0x9469('0x32')](_0x1363e1['model'],qs[_0x9469('0x35')](_0x207012['query'][_0x9469('0x35')]));_0x112a2e['attributes']=_0x112a2e[_0x9469('0x34')][_0x9469('0x36')]?_0x112a2e[_0x9469('0x34')]:_0x1363e1[_0x9469('0x33')];if(_0x207012[_0x9469('0x30')]['includeAll']){_0x112a2e[_0x9469('0x40')]=[{'all':!![]}];}_0x112a2e=_[_0x9469('0x3d')]({},_0x112a2e,_0x207012[_0x9469('0x3e')]);return db['JscriptyQuestionReport'][_0x9469('0x46')](_0x112a2e)[_0x9469('0x24')](handleEntityNotFound(_0x388f50,null))[_0x9469('0x24')](respondWithResult(_0x388f50,null))[_0x9469('0x42')](handleError(_0x388f50,null));};exports['create']=function(_0x4fc817,_0x2a44e9){return db[_0x9469('0x2c')][_0x9469('0x47')](_0x4fc817[_0x9469('0x48')],{})[_0x9469('0x24')](respondWithResult(_0x2a44e9,0xc9))[_0x9469('0x42')](handleError(_0x2a44e9,null));};exports[_0x9469('0x23')]=function(_0x4f92af,_0x8c5dc3){if(_0x4f92af[_0x9469('0x48')]['id']){delete _0x4f92af['body']['id'];}return db[_0x9469('0x2c')][_0x9469('0x46')]({'where':{'id':_0x4f92af[_0x9469('0x44')]['id']}})['then'](handleEntityNotFound(_0x8c5dc3,null))[_0x9469('0x24')](saveUpdates(_0x4f92af[_0x9469('0x48')],null))[_0x9469('0x24')](respondWithResult(_0x8c5dc3,null))[_0x9469('0x42')](handleError(_0x8c5dc3,null));};exports[_0x9469('0x25')]=function(_0x5df55c,_0x2ce14d){return db['JscriptyQuestionReport'][_0x9469('0x46')]({'where':{'id':_0x5df55c['params']['id']}})[_0x9469('0x24')](handleEntityNotFound(_0x2ce14d,null))[_0x9469('0x24')](removeEntity(_0x2ce14d,null))[_0x9469('0x42')](handleError(_0x2ce14d,null));};exports['describe']=function(_0x48b8fd,_0x40e68a){return db['JscriptyQuestionReport'][_0x9469('0x49')]()[_0x9469('0x24')](respondWithResult(_0x40e68a,null))[_0x9469('0x42')](handleError(_0x40e68a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cb4d6d0..5641290 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 _0x98d5=['request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','api','moment'];(function(_0x4394bf,_0x352e04){var _0x442fea=function(_0x58a44e){while(--_0x58a44e){_0x4394bf['push'](_0x4394bf['shift']());}};_0x442fea(++_0x352e04);}(_0x98d5,0x1f1));var _0x598d=function(_0x423d6f,_0x21fc69){_0x423d6f=_0x423d6f-0x0;var _0x2c1b9b=_0x98d5[_0x423d6f];return _0x2c1b9b;};'use strict';var _=require(_0x598d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x598d('0x1'));var moment=require(_0x598d('0x2'));var BPromise=require('bluebird');var rp=require(_0x598d('0x3'));var fs=require('fs');var path=require(_0x598d('0x4'));var rimraf=require('rimraf');var config=require(_0x598d('0x5'));var attributes=require(_0x598d('0x6'));module['exports']=function(_0x114fde,_0xdfade9){return _0x114fde[_0x598d('0x7')](_0x598d('0x8'),attributes,{'tableName':_0x598d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x007e=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b71b2,_0x5c18be){var _0x1bdaee=function(_0x54db3){while(--_0x54db3){_0x2b71b2['push'](_0x2b71b2['shift']());}};_0x1bdaee(++_0x5c18be);}(_0x007e,0x17e));var _0xe007=function(_0x4a6a39,_0x53f146){_0x4a6a39=_0x4a6a39-0x0;var _0x480dfd=_0x007e[_0x4a6a39];return _0x480dfd;};'use strict';var _=require(_0xe007('0x0'));var util=require(_0xe007('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe007('0x2'));var BPromise=require(_0xe007('0x3'));var rp=require(_0xe007('0x4'));var fs=require('fs');var path=require(_0xe007('0x5'));var rimraf=require(_0xe007('0x6'));var config=require(_0xe007('0x7'));var attributes=require(_0xe007('0x8'));module[_0xe007('0x9')]=function(_0x55db2b,_0x462634){return _0x55db2b[_0xe007('0xa')](_0xe007('0xb'),attributes,{'tableName':_0xe007('0xc'),'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 4590317..c11302a 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 _0x1ffc=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x6de857,_0x5c7b04){var _0x5cf9e2=function(_0x511c80){while(--_0x511c80){_0x6de857['push'](_0x6de857['shift']());}};_0x5cf9e2(++_0x5c7b04);}(_0x1ffc,0x89));var _0xc1ff=function(_0x68776b,_0x58c25c){_0x68776b=_0x68776b-0x0;var _0xec1af3=_0x1ffc[_0x68776b];return _0xec1af3;};'use strict';var _=require(_0xc1ff('0x0'));var util=require(_0xc1ff('0x1'));var moment=require('moment');var BPromise=require(_0xc1ff('0x2'));var rs=require(_0xc1ff('0x3'));var fs=require('fs');var Redis=require(_0xc1ff('0x4'));var db=require(_0xc1ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1ff('0x6'))(_0xc1ff('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc1ff('0x8')][_0xc1ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4da30c,_0x47699b,_0x1ebd13){return new BPromise(function(_0x3be1d8,_0x4cad5f){return client[_0xc1ff('0xa')](_0x4da30c,_0x1ebd13)[_0xc1ff('0xb')](function(_0x3e4e24){logger[_0xc1ff('0xc')](_0xc1ff('0xd'),_0x47699b,_0xc1ff('0xe'));logger[_0xc1ff('0xf')](_0xc1ff('0x10'),_0x47699b,_0xc1ff('0xe'),JSON[_0xc1ff('0x11')](_0x3e4e24));if(_0x3e4e24[_0xc1ff('0x12')]){if(_0x3e4e24[_0xc1ff('0x12')][_0xc1ff('0x13')]===0x1f4){logger[_0xc1ff('0x12')](_0xc1ff('0xd'),_0x47699b,_0x3e4e24[_0xc1ff('0x12')][_0xc1ff('0x14')]);return _0x4cad5f(_0x3e4e24[_0xc1ff('0x12')][_0xc1ff('0x14')]);}logger[_0xc1ff('0x12')](_0xc1ff('0xd'),_0x47699b,_0x3e4e24['error']['message']);return _0x3be1d8(_0x3e4e24[_0xc1ff('0x12')][_0xc1ff('0x14')]);}else{logger[_0xc1ff('0xc')](_0xc1ff('0xd'),_0x47699b,_0xc1ff('0xe'));_0x3be1d8(_0x3e4e24['result'][_0xc1ff('0x14')]);}})[_0xc1ff('0x15')](function(_0x6d18e8){logger[_0xc1ff('0x12')](_0xc1ff('0xd'),_0x47699b,_0x6d18e8);_0x4cad5f(_0x6d18e8);});});} \ No newline at end of file +var _0xe432=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x426753,_0x452621){var _0x5a2d7a=function(_0x20552e){while(--_0x20552e){_0x426753['push'](_0x426753['shift']());}};_0x5a2d7a(++_0x452621);}(_0xe432,0x19b));var _0x2e43=function(_0xcb7bc6,_0x2bed38){_0xcb7bc6=_0xcb7bc6-0x0;var _0x1c678e=_0xe432[_0xcb7bc6];return _0x1c678e;};'use strict';var _=require(_0x2e43('0x0'));var util=require(_0x2e43('0x1'));var moment=require(_0x2e43('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e43('0x3'));var fs=require('fs');var Redis=require(_0x2e43('0x4'));var db=require(_0x2e43('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e43('0x6'))(_0x2e43('0x7'));var config=require('../../config/environment');var jayson=require(_0x2e43('0x8'));var client=jayson[_0x2e43('0x9')][_0x2e43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65798a,_0x12d64f,_0x41b515){return new BPromise(function(_0x50e7ed,_0x581bbb){return client[_0x2e43('0xb')](_0x65798a,_0x41b515)[_0x2e43('0xc')](function(_0x36dc41){logger['info'](_0x2e43('0xd'),_0x12d64f,'request\x20sent');logger['debug'](_0x2e43('0xe'),_0x12d64f,_0x2e43('0xf'),JSON[_0x2e43('0x10')](_0x36dc41));if(_0x36dc41['error']){if(_0x36dc41[_0x2e43('0x11')][_0x2e43('0x12')]===0x1f4){logger[_0x2e43('0x11')](_0x2e43('0xd'),_0x12d64f,_0x36dc41[_0x2e43('0x11')]['message']);return _0x581bbb(_0x36dc41[_0x2e43('0x11')][_0x2e43('0x13')]);}logger[_0x2e43('0x11')](_0x2e43('0xd'),_0x12d64f,_0x36dc41[_0x2e43('0x11')][_0x2e43('0x13')]);return _0x50e7ed(_0x36dc41[_0x2e43('0x11')][_0x2e43('0x13')]);}else{logger[_0x2e43('0x14')](_0x2e43('0xd'),_0x12d64f,_0x2e43('0xf'));_0x50e7ed(_0x36dc41[_0x2e43('0x15')][_0x2e43('0x13')]);}})[_0x2e43('0x16')](function(_0x10beef){logger[_0x2e43('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x12d64f,_0x10beef);_0x581bbb(_0x10beef);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2117c24..e79ef17 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 _0xa245=['describe','/:id','show','/:id/questions','post','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x43213b,_0x3e739c){var _0x501bea=function(_0xb76a36){while(--_0xb76a36){_0x43213b['push'](_0x43213b['shift']());}};_0x501bea(++_0x3e739c);}(_0xa245,0x67));var _0x5a24=function(_0x376a4d,_0x26ca79){_0x376a4d=_0x376a4d-0x0;var _0x31b8fd=_0xa245[_0x376a4d];return _0x31b8fd;};'use strict';var multer=require('multer');var util=require(_0x5a24('0x0'));var path=require('path');var timeout=require(_0x5a24('0x1'));var express=require('express');var router=express[_0x5a24('0x2')]();var fs_extra=require(_0x5a24('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5a24('0x4'));var config=require(_0x5a24('0x5'));var controller=require(_0x5a24('0x6'));router[_0x5a24('0x7')]('/',auth[_0x5a24('0x8')](),controller[_0x5a24('0x9')]);router[_0x5a24('0x7')](_0x5a24('0xa'),auth[_0x5a24('0x8')](),controller[_0x5a24('0xb')]);router[_0x5a24('0x7')](_0x5a24('0xc'),auth[_0x5a24('0x8')](),controller[_0x5a24('0xd')]);router[_0x5a24('0x7')](_0x5a24('0xe'),auth[_0x5a24('0x8')](),controller['getQuestions']);router[_0x5a24('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x5a24('0x8')](),controller[_0x5a24('0x10')]);router[_0x5a24('0x11')](_0x5a24('0xc'),auth['isAuthenticated'](),controller[_0x5a24('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe187=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/questions','getQuestions','post','create','put','update','multer','util'];(function(_0x283080,_0x33181b){var _0x5d9b9e=function(_0x3031d3){while(--_0x3031d3){_0x283080['push'](_0x283080['shift']());}};_0x5d9b9e(++_0x33181b);}(_0xe187,0xd0));var _0x7e18=function(_0x2c5436,_0x268e46){_0x2c5436=_0x2c5436-0x0;var _0x37a13e=_0xe187[_0x2c5436];return _0x37a13e;};'use strict';var multer=require(_0x7e18('0x0'));var util=require(_0x7e18('0x1'));var path=require('path');var timeout=require(_0x7e18('0x2'));var express=require(_0x7e18('0x3'));var router=express[_0x7e18('0x4')]();var fs_extra=require(_0x7e18('0x5'));var auth=require(_0x7e18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7e18('0x7'));var controller=require(_0x7e18('0x8'));router['get']('/',auth[_0x7e18('0x9')](),controller[_0x7e18('0xa')]);router['get'](_0x7e18('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7e18('0xc'),auth[_0x7e18('0x9')](),controller[_0x7e18('0xd')]);router[_0x7e18('0xe')](_0x7e18('0xf'),auth[_0x7e18('0x9')](),controller[_0x7e18('0x10')]);router[_0x7e18('0x11')]('/',auth[_0x7e18('0x9')](),controller[_0x7e18('0x12')]);router[_0x7e18('0x13')](_0x7e18('0xc'),auth[_0x7e18('0x9')](),controller[_0x7e18('0x14')]);router['delete'](_0x7e18('0xc'),auth[_0x7e18('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 2b5bc01..8ea6397 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 _0xe451=['format','STRING','moment','sequelize','exports','DATE','endtime'];(function(_0x45883b,_0x1ff0c1){var _0x5713f8=function(_0x1a4a27){while(--_0x1a4a27){_0x45883b['push'](_0x45883b['shift']());}};_0x5713f8(++_0x1ff0c1);}(_0xe451,0x1e5));var _0x1e45=function(_0x4cff77,_0x4a6a2c){_0x4cff77=_0x4cff77-0x0;var _0x5be9c2=_0xe451[_0x4cff77];return _0x5be9c2;};'use strict';var moment=require(_0x1e45('0x0'));var Sequelize=require(_0x1e45('0x1'));module[_0x1e45('0x2')]={'starttime':{'type':Sequelize[_0x1e45('0x3')],'set':function(_0x5b807f){this['setDataValue']('starttime',_0x5b807f);this['setDataValue'](_0x1e45('0x4'),moment()[_0x1e45('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x1e45('0x6')]},'projectname':{'type':Sequelize[_0x1e45('0x6')]},'queue':{'type':Sequelize[_0x1e45('0x6')]},'uniqueid':{'type':Sequelize[_0x1e45('0x6')]},'calleridname':{'type':Sequelize[_0x1e45('0x6')]},'calleridnum':{'type':Sequelize[_0x1e45('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4c48=['STRING','moment','sequelize','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x1f8e8a,_0x2b457f){var _0x2d7412=function(_0x15f450){while(--_0x15f450){_0x1f8e8a['push'](_0x1f8e8a['shift']());}};_0x2d7412(++_0x2b457f);}(_0x4c48,0x129));var _0x84c4=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x4c48[_0x2aefb6];return _0x202772;};'use strict';var moment=require(_0x84c4('0x0'));var Sequelize=require(_0x84c4('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3215fe){this[_0x84c4('0x2')](_0x84c4('0x3'),_0x3215fe);this[_0x84c4('0x2')]('endtime',moment()[_0x84c4('0x4')](_0x84c4('0x5')));}},'endtime':{'type':Sequelize[_0x84c4('0x6')]},'membername':{'type':Sequelize[_0x84c4('0x7')]},'projectname':{'type':Sequelize[_0x84c4('0x7')]},'queue':{'type':Sequelize[_0x84c4('0x7')]},'uniqueid':{'type':Sequelize[_0x84c4('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index e60fddf..f0f7beb 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 _0x9a69=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','filters','includeAll','find','create','body','params','describe','findOne','pick','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x9a69,0x1c1));var _0x99a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9a69[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x99a6('0x0'));var rimraf=require(_0x99a6('0x1'));var zipdir=require(_0x99a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a6('0x3'));var moment=require(_0x99a6('0x4'));var BPromise=require(_0x99a6('0x5'));var Mustache=require(_0x99a6('0x6'));var util=require('util');var path=require(_0x99a6('0x7'));var sox=require('sox');var csv=require(_0x99a6('0x8'));var ejs=require(_0x99a6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x99a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x99a6('0xb'));var deskjs=require(_0x99a6('0xc'));var toCsv=require(_0x99a6('0x8'));var querystring=require(_0x99a6('0xd'));var Papa=require('papaparse');var Redis=require(_0x99a6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x99a6('0xf'));var as=require(_0x99a6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99a6('0x11'))(_0x99a6('0x12'));var utils=require('../../config/utils');var config=require(_0x99a6('0x13'));var licenseUtil=require(_0x99a6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd4f0,_0x120abf){_0x120abf=_0x120abf||0xcc;return function(_0x160caf){if(_0x160caf){return _0x5dd4f0[_0x99a6('0x15')](_0x120abf);}return _0x5dd4f0[_0x99a6('0x16')](_0x120abf)[_0x99a6('0x17')]();};}function respondWithResult(_0x34c451,_0x3e3339){_0x3e3339=_0x3e3339||0xc8;return function(_0x3c38d4){if(_0x3c38d4){return _0x34c451[_0x99a6('0x16')](_0x3e3339)[_0x99a6('0x18')](_0x3c38d4);}};}function respondWithFilteredResult(_0x3a0531,_0x5e0f2f){return function(_0x179a05){if(_0x179a05){var _0x249042=typeof _0x5e0f2f[_0x99a6('0x19')]===_0x99a6('0x1a')&&typeof _0x5e0f2f[_0x99a6('0x1b')]===_0x99a6('0x1a');var _0x452b45=_0x179a05['count'];var _0x70b164=_0x249042?0x0:_0x5e0f2f['offset'];var _0x261032=_0x249042?_0x179a05[_0x99a6('0x1c')]:_0x5e0f2f['offset']+_0x5e0f2f[_0x99a6('0x1b')];var _0x3f49c7;if(_0x261032>=_0x452b45){_0x261032=_0x452b45;_0x3f49c7=0xc8;}else{_0x3f49c7=0xce;}_0x3a0531[_0x99a6('0x16')](_0x3f49c7);return _0x3a0531[_0x99a6('0x1d')](_0x99a6('0x1e'),_0x70b164+'-'+_0x261032+'/'+_0x452b45)['json'](_0x179a05);}return null;};}function patchUpdates(_0x49cbe5){return function(_0x235c31){try{jsonpatch[_0x99a6('0x1f')](_0x235c31,_0x49cbe5,!![]);}catch(_0x2f4518){return BPromise[_0x99a6('0x20')](_0x2f4518);}return _0x235c31[_0x99a6('0x21')]();};}function saveUpdates(_0x379a8a,_0x496627){return function(_0x5e0ff1){if(_0x5e0ff1){return _0x5e0ff1[_0x99a6('0x22')](_0x379a8a)[_0x99a6('0x23')](function(_0x7da655){return _0x7da655;});}return null;};}function removeEntity(_0x3f39f5,_0x8c2c8a){return function(_0x15b826){if(_0x15b826){return _0x15b826[_0x99a6('0x24')]()[_0x99a6('0x23')](function(){_0x3f39f5[_0x99a6('0x16')](0xcc)[_0x99a6('0x17')]();});}};}function handleEntityNotFound(_0x303106,_0x2c098c){return function(_0x2fb620){if(!_0x2fb620){_0x303106[_0x99a6('0x15')](0x194);}return _0x2fb620;};}function handleError(_0x2e7eed,_0x243ce8){_0x243ce8=_0x243ce8||0x1f4;return function(_0x281a9e){logger['error'](_0x281a9e['stack']);if(_0x281a9e[_0x99a6('0x25')]){delete _0x281a9e['name'];}_0x2e7eed[_0x99a6('0x16')](_0x243ce8)[_0x99a6('0x26')](_0x281a9e);};}exports[_0x99a6('0x27')]=function(_0x136f67,_0x13d11f){var _0x5b3ea4={},_0xf38d7={},_0xa32ad9={'count':0x0,'rows':[]};var _0x4326cc=_[_0x99a6('0x28')](db[_0x99a6('0x29')][_0x99a6('0x2a')],function(_0x1db631){return{'name':_0x1db631[_0x99a6('0x2b')],'type':_0x1db631[_0x99a6('0x2c')]['key']};});_0xf38d7[_0x99a6('0x2d')]=_[_0x99a6('0x28')](_0x4326cc,_0x99a6('0x25'));_0xf38d7[_0x99a6('0x2e')]=_['keys'](_0x136f67[_0x99a6('0x2e')]);_0xf38d7['filters']=_[_0x99a6('0x2f')](_0xf38d7[_0x99a6('0x2d')],_0xf38d7[_0x99a6('0x2e')]);_0x5b3ea4['attributes']=_[_0x99a6('0x2f')](_0xf38d7[_0x99a6('0x2d')],qs[_0x99a6('0x30')](_0x136f67[_0x99a6('0x2e')]['fields']));_0x5b3ea4['attributes']=_0x5b3ea4[_0x99a6('0x31')][_0x99a6('0x32')]?_0x5b3ea4[_0x99a6('0x31')]:_0xf38d7[_0x99a6('0x2d')];if(!_0x136f67[_0x99a6('0x2e')][_0x99a6('0x33')](_0x99a6('0x34'))){_0x5b3ea4[_0x99a6('0x1b')]=qs[_0x99a6('0x1b')](_0x136f67[_0x99a6('0x2e')]['limit']);_0x5b3ea4['offset']=qs['offset'](_0x136f67['query'][_0x99a6('0x19')]);}_0x5b3ea4[_0x99a6('0x35')]=qs[_0x99a6('0x36')](_0x136f67['query'][_0x99a6('0x36')]);_0x5b3ea4[_0x99a6('0x37')]=qs['filters'](_['pick'](_0x136f67['query'],_0xf38d7['filters']),_0x4326cc);if(_0x136f67['query']['filter']){_0x5b3ea4[_0x99a6('0x37')]=_[_0x99a6('0x38')](_0x5b3ea4[_0x99a6('0x37')],{'$or':_['map'](_0x4326cc,function(_0x2ac676){if(_0x2ac676['type']!==_0x99a6('0x39')){var _0x3f774a={};_0x3f774a[_0x2ac676[_0x99a6('0x25')]]={'$like':'%'+_0x136f67[_0x99a6('0x2e')][_0x99a6('0x3a')]+'%'};return _0x3f774a;}})});}_0x5b3ea4=_[_0x99a6('0x38')]({},_0x5b3ea4,_0x136f67[_0x99a6('0x3b')]);var _0x139c4a={'where':_0x5b3ea4[_0x99a6('0x37')]};return db[_0x99a6('0x29')]['count'](_0x139c4a)[_0x99a6('0x23')](function(_0x4058df){_0xa32ad9[_0x99a6('0x1c')]=_0x4058df;if(_0x136f67[_0x99a6('0x2e')]['includeAll']){_0x5b3ea4[_0x99a6('0x3c')]=[{'all':!![]}];}return db[_0x99a6('0x29')][_0x99a6('0x3d')](_0x5b3ea4);})['then'](function(_0x3b9b98){_0xa32ad9[_0x99a6('0x3e')]=_0x3b9b98;return _0xa32ad9;})[_0x99a6('0x23')](respondWithFilteredResult(_0x13d11f,_0x5b3ea4))[_0x99a6('0x3f')](handleError(_0x13d11f,null));};exports[_0x99a6('0x40')]=function(_0x24c868,_0x50c874){var _0x410187={'raw':!![],'where':{'id':_0x24c868['params']['id']}},_0x1f31a5={};_0x1f31a5[_0x99a6('0x2d')]=_['keys'](db['JscriptySessionReport'][_0x99a6('0x2a')]);_0x1f31a5[_0x99a6('0x2e')]=_[_0x99a6('0x41')](_0x24c868[_0x99a6('0x2e')]);_0x1f31a5[_0x99a6('0x42')]=_[_0x99a6('0x2f')](_0x1f31a5[_0x99a6('0x2d')],_0x1f31a5[_0x99a6('0x2e')]);_0x410187[_0x99a6('0x31')]=_['intersection'](_0x1f31a5[_0x99a6('0x2d')],qs[_0x99a6('0x30')](_0x24c868[_0x99a6('0x2e')][_0x99a6('0x30')]));_0x410187[_0x99a6('0x31')]=_0x410187[_0x99a6('0x31')][_0x99a6('0x32')]?_0x410187[_0x99a6('0x31')]:_0x1f31a5[_0x99a6('0x2d')];if(_0x24c868['query'][_0x99a6('0x43')]){_0x410187[_0x99a6('0x3c')]=[{'all':!![]}];}_0x410187=_[_0x99a6('0x38')]({},_0x410187,_0x24c868[_0x99a6('0x3b')]);return db[_0x99a6('0x29')][_0x99a6('0x44')](_0x410187)[_0x99a6('0x23')](handleEntityNotFound(_0x50c874,null))[_0x99a6('0x23')](respondWithResult(_0x50c874,null))[_0x99a6('0x3f')](handleError(_0x50c874,null));};exports[_0x99a6('0x45')]=function(_0xff0eb5,_0x18a925){return db[_0x99a6('0x29')]['create'](_0xff0eb5[_0x99a6('0x46')],{})[_0x99a6('0x23')](respondWithResult(_0x18a925,0xc9))[_0x99a6('0x3f')](handleError(_0x18a925,null));};exports[_0x99a6('0x22')]=function(_0x5bea7e,_0x52bced){if(_0x5bea7e[_0x99a6('0x46')]['id']){delete _0x5bea7e[_0x99a6('0x46')]['id'];}return db[_0x99a6('0x29')][_0x99a6('0x44')]({'where':{'id':_0x5bea7e[_0x99a6('0x47')]['id']}})[_0x99a6('0x23')](handleEntityNotFound(_0x52bced,null))[_0x99a6('0x23')](saveUpdates(_0x5bea7e[_0x99a6('0x46')],null))[_0x99a6('0x23')](respondWithResult(_0x52bced,null))[_0x99a6('0x3f')](handleError(_0x52bced,null));};exports[_0x99a6('0x24')]=function(_0x5e9106,_0x19464f){return db['JscriptySessionReport'][_0x99a6('0x44')]({'where':{'id':_0x5e9106['params']['id']}})[_0x99a6('0x23')](handleEntityNotFound(_0x19464f,null))[_0x99a6('0x23')](removeEntity(_0x19464f,null))[_0x99a6('0x3f')](handleError(_0x19464f,null));};exports[_0x99a6('0x48')]=function(_0xceb739,_0x55ddbf){return db['JscriptySessionReport'][_0x99a6('0x48')]()['then'](respondWithResult(_0x55ddbf,null))[_0x99a6('0x3f')](handleError(_0x55ddbf,null));};exports['getQuestions']=function(_0x42ae31,_0x352499,_0x2353f7){var _0x263f76={'raw':!![],'where':{}};var _0x3af10a={};var _0x12cb7a={'count':0x0,'rows':[]};return db[_0x99a6('0x29')][_0x99a6('0x49')]({'where':{'id':_0x42ae31[_0x99a6('0x47')]['id']}})[_0x99a6('0x23')](handleEntityNotFound(_0x352499,null))[_0x99a6('0x23')](function(_0x453c78){if(_0x453c78){_0x3af10a['model']=_[_0x99a6('0x41')](db['JscriptyQuestionReport'][_0x99a6('0x2a')]);_0x3af10a[_0x99a6('0x2e')]=_[_0x99a6('0x41')](_0x42ae31[_0x99a6('0x2e')]);_0x3af10a['filters']=_[_0x99a6('0x2f')](_0x3af10a[_0x99a6('0x2d')],_0x3af10a[_0x99a6('0x2e')]);_0x263f76[_0x99a6('0x31')]=_['intersection'](_0x3af10a[_0x99a6('0x2d')],qs[_0x99a6('0x30')](_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x30')]));_0x263f76[_0x99a6('0x31')]=_0x263f76[_0x99a6('0x31')]['length']?_0x263f76[_0x99a6('0x31')]:_0x3af10a[_0x99a6('0x2d')];if(!_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x33')]('nolimit')){_0x263f76['limit']=qs['limit'](_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x1b')]);_0x263f76[_0x99a6('0x19')]=qs['offset'](_0x42ae31['query']['offset']);}_0x263f76[_0x99a6('0x35')]=qs[_0x99a6('0x36')](_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x36')]);_0x263f76['where']=qs[_0x99a6('0x42')](_[_0x99a6('0x4a')](_0x42ae31['query'],_0x3af10a['filters']));_0x263f76[_0x99a6('0x37')][_0x99a6('0x4b')]=_0x453c78['id'];if(_0x42ae31['query']['filter']){_0x263f76[_0x99a6('0x37')]=_[_0x99a6('0x38')](_0x263f76[_0x99a6('0x37')],{'$or':_['map'](_0x263f76[_0x99a6('0x31')],function(_0x4fae34){var _0x5477f3={};_0x5477f3[_0x4fae34]={'$like':'%'+_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x3a')]+'%'};return _0x5477f3;})});}_0x263f76=_['merge']({},_0x263f76,_0x42ae31['options']);return db[_0x99a6('0x4c')][_0x99a6('0x1c')]({'where':_0x263f76[_0x99a6('0x37')]})[_0x99a6('0x23')](function(_0x1b7b48){_0x12cb7a[_0x99a6('0x1c')]=_0x1b7b48;if(_0x42ae31[_0x99a6('0x2e')][_0x99a6('0x43')]){_0x263f76[_0x99a6('0x3c')]=[{'all':!![]}];}return db[_0x99a6('0x4c')][_0x99a6('0x3d')](_0x263f76);})[_0x99a6('0x23')](function(_0x15e65f){_0x12cb7a[_0x99a6('0x3e')]=_0x15e65f;return _0x12cb7a;});}})[_0x99a6('0x23')](respondWithFilteredResult(_0x352499,_0x263f76))['catch'](handleError(_0x352499,null));}; \ No newline at end of file +var _0xe0a4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','filter','include','findAll','show','params','keys','options','JscriptySessionReport','find','catch','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','includeAll','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1d0bbb,_0x2d9ec0){var _0x4cfa25=function(_0x12cba5){while(--_0x12cba5){_0x1d0bbb['push'](_0x1d0bbb['shift']());}};_0x4cfa25(++_0x2d9ec0);}(_0xe0a4,0x18d));var _0x4e0a=function(_0x1fbf95,_0x454438){_0x1fbf95=_0x1fbf95-0x0;var _0x588f01=_0xe0a4[_0x1fbf95];return _0x588f01;};'use strict';var emlformat=require(_0x4e0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e0a('0x2'));var moment=require(_0x4e0a('0x3'));var BPromise=require(_0x4e0a('0x4'));var Mustache=require(_0x4e0a('0x5'));var util=require(_0x4e0a('0x6'));var path=require(_0x4e0a('0x7'));var sox=require(_0x4e0a('0x8'));var csv=require(_0x4e0a('0x9'));var ejs=require(_0x4e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x4e0a('0xb'));var _=require(_0x4e0a('0xc'));var squel=require(_0x4e0a('0xd'));var crypto=require(_0x4e0a('0xe'));var jsforce=require(_0x4e0a('0xf'));var deskjs=require(_0x4e0a('0x10'));var toCsv=require(_0x4e0a('0x9'));var querystring=require(_0x4e0a('0x11'));var Papa=require(_0x4e0a('0x12'));var Redis=require(_0x4e0a('0x13'));var authService=require(_0x4e0a('0x14'));var qs=require(_0x4e0a('0x15'));var as=require(_0x4e0a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e0a('0x17'))(_0x4e0a('0x18'));var utils=require(_0x4e0a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4e0a('0x1a'));var db=require(_0x4e0a('0x1b'))['db'];function respondWithStatusCode(_0x48ebb6,_0xc10db7){_0xc10db7=_0xc10db7||0xcc;return function(_0x2837c4){if(_0x2837c4){return _0x48ebb6['sendStatus'](_0xc10db7);}return _0x48ebb6['status'](_0xc10db7)[_0x4e0a('0x1c')]();};}function respondWithResult(_0x3a7edd,_0x323200){_0x323200=_0x323200||0xc8;return function(_0x5faa38){if(_0x5faa38){return _0x3a7edd['status'](_0x323200)['json'](_0x5faa38);}};}function respondWithFilteredResult(_0x209bd8,_0x573cde){return function(_0xee32c4){if(_0xee32c4){var _0x15fc9d=typeof _0x573cde[_0x4e0a('0x1d')]===_0x4e0a('0x1e')&&typeof _0x573cde['limit']===_0x4e0a('0x1e');var _0x2a7d7e=_0xee32c4[_0x4e0a('0x1f')];var _0x20e7ef=_0x15fc9d?0x0:_0x573cde[_0x4e0a('0x1d')];var _0x44f693=_0x15fc9d?_0xee32c4[_0x4e0a('0x1f')]:_0x573cde['offset']+_0x573cde['limit'];var _0x25ea98;if(_0x44f693>=_0x2a7d7e){_0x44f693=_0x2a7d7e;_0x25ea98=0xc8;}else{_0x25ea98=0xce;}_0x209bd8[_0x4e0a('0x20')](_0x25ea98);return _0x209bd8[_0x4e0a('0x21')](_0x4e0a('0x22'),_0x20e7ef+'-'+_0x44f693+'/'+_0x2a7d7e)['json'](_0xee32c4);}return null;};}function patchUpdates(_0x5dea06){return function(_0x250cf6){try{jsonpatch[_0x4e0a('0x23')](_0x250cf6,_0x5dea06,!![]);}catch(_0x3622dc){return BPromise[_0x4e0a('0x24')](_0x3622dc);}return _0x250cf6[_0x4e0a('0x25')]();};}function saveUpdates(_0x23929e,_0xcd1b5d){return function(_0xeeeb8d){if(_0xeeeb8d){return _0xeeeb8d[_0x4e0a('0x26')](_0x23929e)[_0x4e0a('0x27')](function(_0xfbd5ed){return _0xfbd5ed;});}return null;};}function removeEntity(_0x769d1b,_0x4f5629){return function(_0x3d1c95){if(_0x3d1c95){return _0x3d1c95['destroy']()[_0x4e0a('0x27')](function(){_0x769d1b[_0x4e0a('0x20')](0xcc)[_0x4e0a('0x1c')]();});}};}function handleEntityNotFound(_0xdd026c,_0x10d7bc){return function(_0xd44de5){if(!_0xd44de5){_0xdd026c[_0x4e0a('0x28')](0x194);}return _0xd44de5;};}function handleError(_0x1e95a2,_0x2c4070){_0x2c4070=_0x2c4070||0x1f4;return function(_0xc01744){logger[_0x4e0a('0x29')](_0xc01744[_0x4e0a('0x2a')]);if(_0xc01744[_0x4e0a('0x2b')]){delete _0xc01744[_0x4e0a('0x2b')];}_0x1e95a2['status'](_0x2c4070)[_0x4e0a('0x2c')](_0xc01744);};}exports['index']=function(_0x3f0b25,_0x4601b4){var _0x5646e3={},_0x57634f={},_0x22df2f={'count':0x0,'rows':[]};var _0x5f02d7=_['map'](db['JscriptySessionReport'][_0x4e0a('0x2d')],function(_0x3ea4eb){return{'name':_0x3ea4eb['fieldName'],'type':_0x3ea4eb['type'][_0x4e0a('0x2e')]};});_0x57634f[_0x4e0a('0x2f')]=_[_0x4e0a('0x30')](_0x5f02d7,'name');_0x57634f[_0x4e0a('0x31')]=_['keys'](_0x3f0b25[_0x4e0a('0x31')]);_0x57634f[_0x4e0a('0x32')]=_[_0x4e0a('0x33')](_0x57634f[_0x4e0a('0x2f')],_0x57634f[_0x4e0a('0x31')]);_0x5646e3[_0x4e0a('0x34')]=_[_0x4e0a('0x33')](_0x57634f[_0x4e0a('0x2f')],qs[_0x4e0a('0x35')](_0x3f0b25[_0x4e0a('0x31')]['fields']));_0x5646e3['attributes']=_0x5646e3[_0x4e0a('0x34')][_0x4e0a('0x36')]?_0x5646e3[_0x4e0a('0x34')]:_0x57634f[_0x4e0a('0x2f')];if(!_0x3f0b25[_0x4e0a('0x31')][_0x4e0a('0x37')](_0x4e0a('0x38'))){_0x5646e3[_0x4e0a('0x39')]=qs[_0x4e0a('0x39')](_0x3f0b25[_0x4e0a('0x31')][_0x4e0a('0x39')]);_0x5646e3['offset']=qs[_0x4e0a('0x1d')](_0x3f0b25['query']['offset']);}_0x5646e3[_0x4e0a('0x3a')]=qs[_0x4e0a('0x3b')](_0x3f0b25[_0x4e0a('0x31')]['sort']);_0x5646e3[_0x4e0a('0x3c')]=qs[_0x4e0a('0x32')](_[_0x4e0a('0x3d')](_0x3f0b25[_0x4e0a('0x31')],_0x57634f[_0x4e0a('0x32')]),_0x5f02d7);if(_0x3f0b25['query']['filter']){_0x5646e3['where']=_[_0x4e0a('0x3e')](_0x5646e3[_0x4e0a('0x3c')],{'$or':_[_0x4e0a('0x30')](_0x5f02d7,function(_0x3aec35){if(_0x3aec35[_0x4e0a('0x3f')]!=='VIRTUAL'){var _0x4c22a0={};_0x4c22a0[_0x3aec35[_0x4e0a('0x2b')]]={'$like':'%'+_0x3f0b25[_0x4e0a('0x31')][_0x4e0a('0x40')]+'%'};return _0x4c22a0;}})});}_0x5646e3=_[_0x4e0a('0x3e')]({},_0x5646e3,_0x3f0b25['options']);var _0x2ef1d1={'where':_0x5646e3[_0x4e0a('0x3c')]};return db['JscriptySessionReport'][_0x4e0a('0x1f')](_0x2ef1d1)[_0x4e0a('0x27')](function(_0x27e5f1){_0x22df2f[_0x4e0a('0x1f')]=_0x27e5f1;if(_0x3f0b25['query']['includeAll']){_0x5646e3[_0x4e0a('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4e0a('0x42')](_0x5646e3);})[_0x4e0a('0x27')](function(_0x4c4194){_0x22df2f['rows']=_0x4c4194;return _0x22df2f;})[_0x4e0a('0x27')](respondWithFilteredResult(_0x4601b4,_0x5646e3))['catch'](handleError(_0x4601b4,null));};exports[_0x4e0a('0x43')]=function(_0x25efb2,_0x1ed390){var _0xea620e={'raw':!![],'where':{'id':_0x25efb2[_0x4e0a('0x44')]['id']}},_0x531be5={};_0x531be5[_0x4e0a('0x2f')]=_[_0x4e0a('0x45')](db['JscriptySessionReport']['rawAttributes']);_0x531be5[_0x4e0a('0x31')]=_[_0x4e0a('0x45')](_0x25efb2[_0x4e0a('0x31')]);_0x531be5[_0x4e0a('0x32')]=_[_0x4e0a('0x33')](_0x531be5[_0x4e0a('0x2f')],_0x531be5[_0x4e0a('0x31')]);_0xea620e[_0x4e0a('0x34')]=_[_0x4e0a('0x33')](_0x531be5[_0x4e0a('0x2f')],qs[_0x4e0a('0x35')](_0x25efb2['query'][_0x4e0a('0x35')]));_0xea620e['attributes']=_0xea620e[_0x4e0a('0x34')][_0x4e0a('0x36')]?_0xea620e[_0x4e0a('0x34')]:_0x531be5[_0x4e0a('0x2f')];if(_0x25efb2[_0x4e0a('0x31')]['includeAll']){_0xea620e['include']=[{'all':!![]}];}_0xea620e=_[_0x4e0a('0x3e')]({},_0xea620e,_0x25efb2[_0x4e0a('0x46')]);return db[_0x4e0a('0x47')][_0x4e0a('0x48')](_0xea620e)[_0x4e0a('0x27')](handleEntityNotFound(_0x1ed390,null))[_0x4e0a('0x27')](respondWithResult(_0x1ed390,null))[_0x4e0a('0x49')](handleError(_0x1ed390,null));};exports[_0x4e0a('0x4a')]=function(_0xed906,_0x53341d){return db['JscriptySessionReport'][_0x4e0a('0x4a')](_0xed906[_0x4e0a('0x4b')],{})[_0x4e0a('0x27')](respondWithResult(_0x53341d,0xc9))['catch'](handleError(_0x53341d,null));};exports[_0x4e0a('0x26')]=function(_0x597a38,_0x229842){if(_0x597a38['body']['id']){delete _0x597a38[_0x4e0a('0x4b')]['id'];}return db[_0x4e0a('0x47')]['find']({'where':{'id':_0x597a38[_0x4e0a('0x44')]['id']}})['then'](handleEntityNotFound(_0x229842,null))[_0x4e0a('0x27')](saveUpdates(_0x597a38['body'],null))[_0x4e0a('0x27')](respondWithResult(_0x229842,null))[_0x4e0a('0x49')](handleError(_0x229842,null));};exports[_0x4e0a('0x4c')]=function(_0xf3dfc9,_0x39b9d5){return db[_0x4e0a('0x47')][_0x4e0a('0x48')]({'where':{'id':_0xf3dfc9[_0x4e0a('0x44')]['id']}})[_0x4e0a('0x27')](handleEntityNotFound(_0x39b9d5,null))[_0x4e0a('0x27')](removeEntity(_0x39b9d5,null))[_0x4e0a('0x49')](handleError(_0x39b9d5,null));};exports[_0x4e0a('0x4d')]=function(_0x57ed79,_0x3aef7e){return db['JscriptySessionReport'][_0x4e0a('0x4d')]()[_0x4e0a('0x27')](respondWithResult(_0x3aef7e,null))[_0x4e0a('0x49')](handleError(_0x3aef7e,null));};exports[_0x4e0a('0x4e')]=function(_0x4845c3,_0x2a795d,_0x4cc688){var _0x38f81a={'raw':!![],'where':{}};var _0x5d37d4={};var _0x68c7d3={'count':0x0,'rows':[]};return db[_0x4e0a('0x47')][_0x4e0a('0x4f')]({'where':{'id':_0x4845c3['params']['id']}})['then'](handleEntityNotFound(_0x2a795d,null))[_0x4e0a('0x27')](function(_0x59c6d6){if(_0x59c6d6){_0x5d37d4['model']=_[_0x4e0a('0x45')](db[_0x4e0a('0x50')]['rawAttributes']);_0x5d37d4[_0x4e0a('0x31')]=_[_0x4e0a('0x45')](_0x4845c3['query']);_0x5d37d4[_0x4e0a('0x32')]=_[_0x4e0a('0x33')](_0x5d37d4[_0x4e0a('0x2f')],_0x5d37d4[_0x4e0a('0x31')]);_0x38f81a[_0x4e0a('0x34')]=_['intersection'](_0x5d37d4[_0x4e0a('0x2f')],qs[_0x4e0a('0x35')](_0x4845c3[_0x4e0a('0x31')][_0x4e0a('0x35')]));_0x38f81a['attributes']=_0x38f81a['attributes'][_0x4e0a('0x36')]?_0x38f81a[_0x4e0a('0x34')]:_0x5d37d4['model'];if(!_0x4845c3[_0x4e0a('0x31')][_0x4e0a('0x37')](_0x4e0a('0x38'))){_0x38f81a[_0x4e0a('0x39')]=qs[_0x4e0a('0x39')](_0x4845c3[_0x4e0a('0x31')]['limit']);_0x38f81a[_0x4e0a('0x1d')]=qs[_0x4e0a('0x1d')](_0x4845c3[_0x4e0a('0x31')]['offset']);}_0x38f81a[_0x4e0a('0x3a')]=qs['sort'](_0x4845c3['query'][_0x4e0a('0x3b')]);_0x38f81a[_0x4e0a('0x3c')]=qs[_0x4e0a('0x32')](_[_0x4e0a('0x3d')](_0x4845c3[_0x4e0a('0x31')],_0x5d37d4[_0x4e0a('0x32')]));_0x38f81a[_0x4e0a('0x3c')][_0x4e0a('0x51')]=_0x59c6d6['id'];if(_0x4845c3[_0x4e0a('0x31')][_0x4e0a('0x40')]){_0x38f81a[_0x4e0a('0x3c')]=_['merge'](_0x38f81a['where'],{'$or':_[_0x4e0a('0x30')](_0x38f81a[_0x4e0a('0x34')],function(_0x4b8be5){var _0x5ddc83={};_0x5ddc83[_0x4b8be5]={'$like':'%'+_0x4845c3[_0x4e0a('0x31')][_0x4e0a('0x40')]+'%'};return _0x5ddc83;})});}_0x38f81a=_[_0x4e0a('0x3e')]({},_0x38f81a,_0x4845c3[_0x4e0a('0x46')]);return db['JscriptyQuestionReport'][_0x4e0a('0x1f')]({'where':_0x38f81a[_0x4e0a('0x3c')]})[_0x4e0a('0x27')](function(_0x201089){_0x68c7d3[_0x4e0a('0x1f')]=_0x201089;if(_0x4845c3[_0x4e0a('0x31')][_0x4e0a('0x52')]){_0x38f81a[_0x4e0a('0x41')]=[{'all':!![]}];}return db[_0x4e0a('0x50')][_0x4e0a('0x42')](_0x38f81a);})[_0x4e0a('0x27')](function(_0x7c7718){_0x68c7d3[_0x4e0a('0x53')]=_0x7c7718;return _0x68c7d3;});}})[_0x4e0a('0x27')](respondWithFilteredResult(_0x2a795d,_0x38f81a))[_0x4e0a('0x49')](handleError(_0x2a795d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 5643c92..dedd4df 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x56029c,_0xaa925f){var _0xbae6d0=function(_0x16f5c7){while(--_0x16f5c7){_0x56029c['push'](_0x56029c['shift']());}};_0xbae6d0(++_0xaa925f);}(_0x5fab,0x177));var _0xb5fa=function(_0x52c1f6,_0x4eda0b){_0x52c1f6=_0x52c1f6-0x0;var _0x4df981=_0x5fab[_0x52c1f6];return _0x4df981;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5d9112,_0x274d68){var _0x5bb5fa=function(_0x33078d){while(--_0x33078d){_0x5d9112['push'](_0x5d9112['shift']());}};_0x5bb5fa(++_0x274d68);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x265f6d,_0x2a38a5){_0x265f6d=_0x265f6d-0x0;var _0x317995=_0x3f8a[_0x265f6d];return _0x317995;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'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 b579d5c..ec573cf 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 _0x5fdc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring'];(function(_0x208616,_0x39fd62){var _0x1acc88=function(_0x1f3918){while(--_0x1f3918){_0x208616['push'](_0x208616['shift']());}};_0x1acc88(++_0x39fd62);}(_0x5fdc,0x127));var _0xc5fd=function(_0x136df0,_0x735f27){_0x136df0=_0x136df0-0x0;var _0x43e342=_0x5fdc[_0x136df0];return _0x43e342;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});} \ No newline at end of file +var _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7096,0x10c));var _0x6709=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7096[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f52ad12..108a121 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 _0x8149=['util','connect-timeout','express','../../components/interaction/service','../../config/environment','index','isAuthenticated','update','get','/download_log_file','exports','multer'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x8149,0x1a3));var _0x9814=function(_0x31ff9c,_0x1c913a){_0x31ff9c=_0x31ff9c-0x0;var _0x34639d=_0x8149[_0x31ff9c];return _0x34639d;};'use strict';var multer=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var path=require('path');var timeout=require(_0x9814('0x2'));var express=require(_0x9814('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9814('0x4'));var config=require(_0x9814('0x5'));var controller=require('./license.controller');router['get']('/',controller[_0x9814('0x6')]);router['put']('/:id',auth[_0x9814('0x7')](),controller[_0x9814('0x8')]);router[_0x9814('0x9')](_0x9814('0xa'),auth[_0x9814('0x7')](),controller['downloadLogFile']);module[_0x9814('0xb')]=router; \ No newline at end of file +var _0xf699=['fs-extra','../../components/interaction/service','get','index','put','/:id','update','/download_log_file','downloadLogFile','multer','path','express','Router'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xf699,0xd9));var _0x9f69=function(_0x2eeff4,_0x1ebc20){_0x2eeff4=_0x2eeff4-0x0;var _0xd9e662=_0xf699[_0x2eeff4];return _0xd9e662;};'use strict';var multer=require(_0x9f69('0x0'));var util=require('util');var path=require(_0x9f69('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f69('0x2'));var router=express[_0x9f69('0x3')]();var fs_extra=require(_0x9f69('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f69('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x9f69('0x6')]('/',controller[_0x9f69('0x7')]);router[_0x9f69('0x8')](_0x9f69('0x9'),auth['isAuthenticated'](),controller[_0x9f69('0xa')]);router[_0x9f69('0x6')](_0x9f69('0xb'),auth['isAuthenticated'](),controller[_0x9f69('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 76a8926..231d6ac 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 _0xe3f3=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x29fc00,_0x58869c){var _0x5c1f7a=function(_0x386087){while(--_0x386087){_0x29fc00['push'](_0x29fc00['shift']());}};_0x5c1f7a(++_0x58869c);}(_0xe3f3,0x14f));var _0x3e3f=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xe3f3[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x3e3f('0x0'));module[_0x3e3f('0x1')]={'license':{'type':Sequelize[_0x3e3f('0x2')]},'data1':{'type':Sequelize[_0x3e3f('0x3')]},'data2':{'type':Sequelize[_0x3e3f('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3e3f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbc12=['INTEGER','sequelize','exports','STRING'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0xbc12,0xdd));var _0x2bc1=function(_0x392368,_0x1e14a5){_0x392368=_0x392368-0x0;var _0x33efe7=_0xbc12[_0x392368];return _0x33efe7;};'use strict';var Sequelize=require(_0x2bc1('0x0'));module[_0x2bc1('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2bc1('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x2bc1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index f549a6d..e8c4868 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 _0x3230=['moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','name','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','catch','body','find','params','get','demo','license-info.log','join','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','text/plain','download','fast-json-patch','request-promise'];(function(_0x5d0186,_0x2a6e57){var _0x25706c=function(_0x4f960d){while(--_0x4f960d){_0x5d0186['push'](_0x5d0186['shift']());}};_0x25706c(++_0x2a6e57);}(_0x3230,0x106));var _0x0323=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3230[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0323('0x0'));var rp=require(_0x0323('0x1'));var moment=require(_0x0323('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0323('0x3'));var util=require(_0x0323('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0323('0x5'));var fs=require('fs');var fs_extra=require(_0x0323('0x6'));var _=require(_0x0323('0x7'));var squel=require(_0x0323('0x8'));var crypto=require(_0x0323('0x9'));var jsforce=require(_0x0323('0xa'));var deskjs=require(_0x0323('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0323('0xc'));var Papa=require('papaparse');var Redis=require(_0x0323('0xd'));var authService=require(_0x0323('0xe'));var qs=require(_0x0323('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0323('0x10'));var logger=require(_0x0323('0x11'))(_0x0323('0x12'));var utils=require(_0x0323('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0323('0x14'));var db=require(_0x0323('0x15'))['db'];function respondWithStatusCode(_0x46dbd3,_0x3d7fe5){_0x3d7fe5=_0x3d7fe5||0xcc;return function(_0x604f33){if(_0x604f33){return _0x46dbd3['sendStatus'](_0x3d7fe5);}return _0x46dbd3[_0x0323('0x16')](_0x3d7fe5)[_0x0323('0x17')]();};}function respondWithResult(_0x4bee1c,_0x3640d3){_0x3640d3=_0x3640d3||0xc8;return function(_0x49a013){if(_0x49a013){return _0x4bee1c['status'](_0x3640d3)[_0x0323('0x18')](_0x49a013);}};}function respondWithFilteredResult(_0x4f329a,_0x40c59d){return function(_0x3e9f04){if(_0x3e9f04){var _0x115c90=typeof _0x40c59d[_0x0323('0x19')]===_0x0323('0x1a')&&typeof _0x40c59d[_0x0323('0x1b')]===_0x0323('0x1a');var _0xd8272c=_0x3e9f04[_0x0323('0x1c')];var _0x3b0d66=_0x115c90?0x0:_0x40c59d[_0x0323('0x19')];var _0x68dfb1=_0x115c90?_0x3e9f04[_0x0323('0x1c')]:_0x40c59d[_0x0323('0x19')]+_0x40c59d[_0x0323('0x1b')];var _0x5380de;if(_0x68dfb1>=_0xd8272c){_0x68dfb1=_0xd8272c;_0x5380de=0xc8;}else{_0x5380de=0xce;}_0x4f329a[_0x0323('0x16')](_0x5380de);return _0x4f329a['set']('Content-Range',_0x3b0d66+'-'+_0x68dfb1+'/'+_0xd8272c)[_0x0323('0x18')](_0x3e9f04);}return null;};}function patchUpdates(_0x11f3f8){return function(_0x45953a){try{jsonpatch[_0x0323('0x1d')](_0x45953a,_0x11f3f8,!![]);}catch(_0x171227){return BPromise[_0x0323('0x1e')](_0x171227);}return _0x45953a[_0x0323('0x1f')]();};}function saveUpdates(_0x5dd3b0,_0x323ad8){return function(_0xfff6e9){if(_0xfff6e9){return _0xfff6e9[_0x0323('0x20')](_0x5dd3b0)[_0x0323('0x21')](function(_0x37f1dd){return _0x37f1dd;});}return null;};}function removeEntity(_0x24f1ae,_0x5e3190){return function(_0x1bc93b){if(_0x1bc93b){return _0x1bc93b[_0x0323('0x22')]()[_0x0323('0x21')](function(){_0x24f1ae[_0x0323('0x16')](0xcc)[_0x0323('0x17')]();});}};}function handleEntityNotFound(_0x1334f0,_0x1db8a5){return function(_0x5cf0ad){if(!_0x5cf0ad){_0x1334f0[_0x0323('0x23')](0x194);}return _0x5cf0ad;};}function handleError(_0x32cc7c,_0x4941de){_0x4941de=_0x4941de||0x1f4;return function(_0x1e7df2){logger[_0x0323('0x24')](_0x1e7df2['stack']);if(_0x1e7df2['name']){delete _0x1e7df2[_0x0323('0x25')];}_0x32cc7c['status'](_0x4941de)['send'](_0x1e7df2);};}var utilLicense=require(_0x0323('0x14'));exports[_0x0323('0x26')]=function(_0x5eb25d,_0x4784da){var _0x5e488b={'raw':!![],'where':{'id':0x1}},_0xbe3bca={};_0xbe3bca[_0x0323('0x27')]=_[_0x0323('0x28')](db['License'][_0x0323('0x29')]);_0xbe3bca[_0x0323('0x2a')]=_['keys'](_0x5eb25d[_0x0323('0x2a')]);_0xbe3bca[_0x0323('0x2b')]=_[_0x0323('0x2c')](_0xbe3bca['model'],_0xbe3bca[_0x0323('0x2a')]);_0x5e488b['attributes']=_[_0x0323('0x2c')](_0xbe3bca[_0x0323('0x27')],qs['fields'](_0x5eb25d[_0x0323('0x2a')][_0x0323('0x2d')]));_0x5e488b[_0x0323('0x2e')]=_0x5e488b['attributes'][_0x0323('0x2f')]?_0x5e488b['attributes']:_0xbe3bca[_0x0323('0x27')];_0x5e488b=_['merge']({},_0x5e488b,_0x5eb25d[_0x0323('0x30')]);return utilLicense[_0x0323('0x31')](_0x5e488b)[_0x0323('0x21')](respondWithResult(_0x4784da,null))[_0x0323('0x32')](handleError(_0x4784da,null));};exports[_0x0323('0x20')]=function(_0x5728b8,_0x2fbe3d){if(_0x5728b8[_0x0323('0x33')]['id']){delete _0x5728b8[_0x0323('0x33')]['id'];}return db['License'][_0x0323('0x34')]({'where':{'id':_0x5728b8[_0x0323('0x35')]['id']}})[_0x0323('0x21')](handleEntityNotFound(_0x2fbe3d,null))[_0x0323('0x21')](function(_0x4c4db6){var _0x11978d=_0x4c4db6[_0x0323('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x11978d,_0x5728b8['body']['key']);})[_0x0323('0x21')](function(_0x2845e6){if(!_0x2845e6[_0x0323('0x37')]){return saveUpdates(_0x5728b8[_0x0323('0x33')],null);}return _0x2845e6;})[_0x0323('0x21')](respondWithResult(_0x2fbe3d,null))[_0x0323('0x32')](handleError(_0x2fbe3d,null));};exports['downloadLogFile']=function(_0x39800e,_0x58ee77){var _0x455064=_0x0323('0x38');var _0x8748e2=path[_0x0323('0x39')]('/var',_0x0323('0x3a'),_0x0323('0x3b'),_0x455064);_0x58ee77[_0x0323('0x3c')](_0x0323('0x3d'),_0x0323('0x3e')+_0x455064);_0x58ee77[_0x0323('0x3f')]('Content-Type',_0x0323('0x40'));_0x58ee77[_0x0323('0x41')](_0x8748e2);}; \ No newline at end of file +var _0x45cf=['set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','model','keys','License','query','intersection','attributes','fields','getLicense','catch','body','find','params','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','text/plain','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x334042,_0x25edee){var _0x20fc2b=function(_0x2c5af1){while(--_0x2c5af1){_0x334042['push'](_0x334042['shift']());}};_0x20fc2b(++_0x25edee);}(_0x45cf,0xa1));var _0xf45c=function(_0x4eb889,_0x13b842){_0x4eb889=_0x4eb889-0x0;var _0x3f2955=_0x45cf[_0x4eb889];return _0x3f2955;};'use strict';var emlformat=require(_0xf45c('0x0'));var rimraf=require(_0xf45c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf45c('0x2'));var rp=require('request-promise');var moment=require(_0xf45c('0x3'));var BPromise=require(_0xf45c('0x4'));var Mustache=require(_0xf45c('0x5'));var util=require('util');var path=require(_0xf45c('0x6'));var sox=require(_0xf45c('0x7'));var csv=require(_0xf45c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf45c('0x9'));var squel=require(_0xf45c('0xa'));var crypto=require(_0xf45c('0xb'));var jsforce=require(_0xf45c('0xc'));var deskjs=require(_0xf45c('0xd'));var toCsv=require(_0xf45c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf45c('0xe'));var authService=require(_0xf45c('0xf'));var qs=require(_0xf45c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf45c('0x11'));var licenseUtil=require(_0xf45c('0x12'));var db=require(_0xf45c('0x13'))['db'];function respondWithStatusCode(_0xad9042,_0x232137){_0x232137=_0x232137||0xcc;return function(_0x4a313a){if(_0x4a313a){return _0xad9042[_0xf45c('0x14')](_0x232137);}return _0xad9042[_0xf45c('0x15')](_0x232137)[_0xf45c('0x16')]();};}function respondWithResult(_0x1f157a,_0x3bfe32){_0x3bfe32=_0x3bfe32||0xc8;return function(_0xeedf6f){if(_0xeedf6f){return _0x1f157a[_0xf45c('0x15')](_0x3bfe32)[_0xf45c('0x17')](_0xeedf6f);}};}function respondWithFilteredResult(_0x1e3fb8,_0xd3c835){return function(_0x39518c){if(_0x39518c){var _0x26b733=typeof _0xd3c835[_0xf45c('0x18')]===_0xf45c('0x19')&&typeof _0xd3c835['limit']==='undefined';var _0x2e033a=_0x39518c['count'];var _0x580342=_0x26b733?0x0:_0xd3c835[_0xf45c('0x18')];var _0x4703c4=_0x26b733?_0x39518c[_0xf45c('0x1a')]:_0xd3c835['offset']+_0xd3c835[_0xf45c('0x1b')];var _0xcf519b;if(_0x4703c4>=_0x2e033a){_0x4703c4=_0x2e033a;_0xcf519b=0xc8;}else{_0xcf519b=0xce;}_0x1e3fb8['status'](_0xcf519b);return _0x1e3fb8[_0xf45c('0x1c')](_0xf45c('0x1d'),_0x580342+'-'+_0x4703c4+'/'+_0x2e033a)[_0xf45c('0x17')](_0x39518c);}return null;};}function patchUpdates(_0x8311a6){return function(_0x59f536){try{jsonpatch[_0xf45c('0x1e')](_0x59f536,_0x8311a6,!![]);}catch(_0x5679e6){return BPromise[_0xf45c('0x1f')](_0x5679e6);}return _0x59f536[_0xf45c('0x20')]();};}function saveUpdates(_0x3e3800,_0x37364a){return function(_0x3b14a6){if(_0x3b14a6){return _0x3b14a6['update'](_0x3e3800)['then'](function(_0x12cf2d){return _0x12cf2d;});}return null;};}function removeEntity(_0x551a37,_0x460695){return function(_0x33c105){if(_0x33c105){return _0x33c105[_0xf45c('0x21')]()[_0xf45c('0x22')](function(){_0x551a37[_0xf45c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cf943,_0x4b6552){return function(_0xd71370){if(!_0xd71370){_0x3cf943[_0xf45c('0x14')](0x194);}return _0xd71370;};}function handleError(_0xcea0d3,_0xe5e7e9){_0xe5e7e9=_0xe5e7e9||0x1f4;return function(_0x1b1fd){logger[_0xf45c('0x23')](_0x1b1fd[_0xf45c('0x24')]);if(_0x1b1fd[_0xf45c('0x25')]){delete _0x1b1fd['name'];}_0xcea0d3[_0xf45c('0x15')](_0xe5e7e9)[_0xf45c('0x26')](_0x1b1fd);};}var utilLicense=require(_0xf45c('0x12'));exports[_0xf45c('0x27')]=function(_0x4d63ac,_0x1aebd3){var _0x2e4690={'raw':!![],'where':{'id':0x1}},_0x45d43a={};_0x45d43a[_0xf45c('0x28')]=_[_0xf45c('0x29')](db[_0xf45c('0x2a')]['rawAttributes']);_0x45d43a[_0xf45c('0x2b')]=_[_0xf45c('0x29')](_0x4d63ac[_0xf45c('0x2b')]);_0x45d43a['filters']=_[_0xf45c('0x2c')](_0x45d43a[_0xf45c('0x28')],_0x45d43a[_0xf45c('0x2b')]);_0x2e4690[_0xf45c('0x2d')]=_[_0xf45c('0x2c')](_0x45d43a['model'],qs[_0xf45c('0x2e')](_0x4d63ac[_0xf45c('0x2b')][_0xf45c('0x2e')]));_0x2e4690[_0xf45c('0x2d')]=_0x2e4690[_0xf45c('0x2d')]['length']?_0x2e4690['attributes']:_0x45d43a[_0xf45c('0x28')];_0x2e4690=_['merge']({},_0x2e4690,_0x4d63ac['options']);return utilLicense[_0xf45c('0x2f')](_0x2e4690)[_0xf45c('0x22')](respondWithResult(_0x1aebd3,null))[_0xf45c('0x30')](handleError(_0x1aebd3,null));};exports['update']=function(_0xbf6c44,_0x2555ef){if(_0xbf6c44[_0xf45c('0x31')]['id']){delete _0xbf6c44[_0xf45c('0x31')]['id'];}return db[_0xf45c('0x2a')][_0xf45c('0x32')]({'where':{'id':_0xbf6c44[_0xf45c('0x33')]['id']}})[_0xf45c('0x22')](handleEntityNotFound(_0x2555ef,null))[_0xf45c('0x22')](function(_0x1de840){var _0x3ef28b=_0x1de840['get']({'plain':!![]});return utilLicense[_0xf45c('0x34')](_0x3ef28b,_0xbf6c44[_0xf45c('0x31')][_0xf45c('0x35')]);})[_0xf45c('0x22')](function(_0x1f5983){if(!_0x1f5983['demo']){return saveUpdates(_0xbf6c44['body'],null);}return _0x1f5983;})[_0xf45c('0x22')](respondWithResult(_0x2555ef,null))[_0xf45c('0x30')](handleError(_0x2555ef,null));};exports[_0xf45c('0x36')]=function(_0x5c80a0,_0x2b188e){var _0x307b32=_0xf45c('0x37');var _0x30ad38=path[_0xf45c('0x38')](_0xf45c('0x39'),_0xf45c('0x3a'),_0xf45c('0x3b'),_0x307b32);_0x2b188e['setHeader'](_0xf45c('0x3c'),_0xf45c('0x3d')+_0x307b32);_0x2b188e['set']('Content-Type',_0xf45c('0x3e'));_0x2b188e['download'](_0x30ad38);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fbd9db0..5dcb2f4 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 _0x680c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license','util'];(function(_0x1678d0,_0x8a799c){var _0x1ff3c1=function(_0x53e4e2){while(--_0x53e4e2){_0x1678d0['push'](_0x1678d0['shift']());}};_0x1ff3c1(++_0x8a799c);}(_0x680c,0xc2));var _0xc680=function(_0x45ff95,_0x4c138e){_0x45ff95=_0x45ff95-0x0;var _0x3ff0a7=_0x680c[_0x45ff95];return _0x3ff0a7;};'use strict';var _=require('lodash');var util=require(_0xc680('0x0'));var logger=require(_0xc680('0x1'))(_0xc680('0x2'));var moment=require(_0xc680('0x3'));var BPromise=require(_0xc680('0x4'));var rp=require(_0xc680('0x5'));var fs=require('fs');var path=require(_0xc680('0x6'));var rimraf=require(_0xc680('0x7'));var config=require(_0xc680('0x8'));var attributes=require(_0xc680('0x9'));module[_0xc680('0xa')]=function(_0x34c5ae,_0x2d4ef0){return _0x34c5ae['define'](_0xc680('0xb'),attributes,{'tableName':_0xc680('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfeec=['exports','define','License','license','../../config/logger','moment','bluebird','request-promise','path','rimraf','./license.attributes'];(function(_0x5d0814,_0x30b9f5){var _0x5f28ef=function(_0x43991a){while(--_0x43991a){_0x5d0814['push'](_0x5d0814['shift']());}};_0x5f28ef(++_0x30b9f5);}(_0xfeec,0xca));var _0xcfee=function(_0x137b2e,_0x156391){_0x137b2e=_0x137b2e-0x0;var _0x5e9b52=_0xfeec[_0x137b2e];return _0x5e9b52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfee('0x0'))('api');var moment=require(_0xcfee('0x1'));var BPromise=require(_0xcfee('0x2'));var rp=require(_0xcfee('0x3'));var fs=require('fs');var path=require(_0xcfee('0x4'));var rimraf=require(_0xcfee('0x5'));var config=require('../../config/environment');var attributes=require(_0xcfee('0x6'));module[_0xcfee('0x7')]=function(_0x11ce23,_0x4e073f){return _0x11ce23[_0xcfee('0x8')](_0xcfee('0x9'),attributes,{'tableName':_0xcfee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1b94d90..2b3b2e1 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 _0x35a2=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1040c8,_0x1baa50){var _0x5d0df0=function(_0x182b7f){while(--_0x182b7f){_0x1040c8['push'](_0x1040c8['shift']());}};_0x5d0df0(++_0x1baa50);}(_0x35a2,0x1e2));var _0x235a=function(_0x542312,_0x54895d){_0x542312=_0x542312-0x0;var _0x4d73a0=_0x35a2[_0x542312];return _0x4d73a0;};'use strict';var _=require(_0x235a('0x0'));var util=require(_0x235a('0x1'));var moment=require(_0x235a('0x2'));var BPromise=require(_0x235a('0x3'));var rs=require(_0x235a('0x4'));var fs=require('fs');var Redis=require(_0x235a('0x5'));var db=require(_0x235a('0x6'))['db'];var utils=require(_0x235a('0x7'));var logger=require(_0x235a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x235a('0x9'));var client=jayson[_0x235a('0xa')][_0x235a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21041c,_0x268a3c,_0x4f140c){return new BPromise(function(_0x374208,_0x102002){return client['request'](_0x21041c,_0x4f140c)[_0x235a('0xc')](function(_0xbcc7f2){logger[_0x235a('0xd')](_0x235a('0xe'),_0x268a3c,_0x235a('0xf'));logger['debug'](_0x235a('0x10'),_0x268a3c,_0x235a('0xf'),JSON[_0x235a('0x11')](_0xbcc7f2));if(_0xbcc7f2['error']){if(_0xbcc7f2[_0x235a('0x12')][_0x235a('0x13')]===0x1f4){logger[_0x235a('0x12')](_0x235a('0xe'),_0x268a3c,_0xbcc7f2[_0x235a('0x12')][_0x235a('0x14')]);return _0x102002(_0xbcc7f2[_0x235a('0x12')][_0x235a('0x14')]);}logger['error'](_0x235a('0xe'),_0x268a3c,_0xbcc7f2['error'][_0x235a('0x14')]);return _0x374208(_0xbcc7f2[_0x235a('0x12')][_0x235a('0x14')]);}else{logger[_0x235a('0xd')](_0x235a('0xe'),_0x268a3c,_0x235a('0xf'));_0x374208(_0xbcc7f2[_0x235a('0x15')][_0x235a('0x14')]);}})[_0x235a('0x16')](function(_0x3fb562){logger[_0x235a('0x12')]('License,\x20%s,\x20%s',_0x268a3c,_0x3fb562);_0x102002(_0x3fb562);});});} \ No newline at end of file +var _0xeecc=['client','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xbfb611,_0x2b7be2){var _0x45016f=function(_0x1e66c0){while(--_0x1e66c0){_0xbfb611['push'](_0xbfb611['shift']());}};_0x45016f(++_0x2b7be2);}(_0xeecc,0x194));var _0xceec=function(_0x5dac1d,_0x50f69a){_0x5dac1d=_0x5dac1d-0x0;var _0x69241b=_0xeecc[_0x5dac1d];return _0x69241b;};'use strict';var _=require(_0xceec('0x0'));var util=require('util');var moment=require(_0xceec('0x1'));var BPromise=require(_0xceec('0x2'));var rs=require(_0xceec('0x3'));var fs=require('fs');var Redis=require(_0xceec('0x4'));var db=require(_0xceec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xceec('0x6'))(_0xceec('0x7'));var config=require(_0xceec('0x8'));var jayson=require(_0xceec('0x9'));var client=jayson[_0xceec('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x377214,_0x1462b4,_0x3e525b){return new BPromise(function(_0x591590,_0x35a54e){return client['request'](_0x377214,_0x3e525b)[_0xceec('0xb')](function(_0x1f5bf5){logger[_0xceec('0xc')](_0xceec('0xd'),_0x1462b4,'request\x20sent');logger[_0xceec('0xe')](_0xceec('0xf'),_0x1462b4,_0xceec('0x10'),JSON[_0xceec('0x11')](_0x1f5bf5));if(_0x1f5bf5[_0xceec('0x12')]){if(_0x1f5bf5[_0xceec('0x12')][_0xceec('0x13')]===0x1f4){logger[_0xceec('0x12')](_0xceec('0xd'),_0x1462b4,_0x1f5bf5[_0xceec('0x12')]['message']);return _0x35a54e(_0x1f5bf5['error']['message']);}logger['error'](_0xceec('0xd'),_0x1462b4,_0x1f5bf5[_0xceec('0x12')][_0xceec('0x14')]);return _0x591590(_0x1f5bf5[_0xceec('0x12')]['message']);}else{logger['info'](_0xceec('0xd'),_0x1462b4,_0xceec('0x10'));_0x591590(_0x1f5bf5[_0xceec('0x15')]['message']);}})[_0xceec('0x16')](function(_0x5118d2){logger[_0xceec('0x12')](_0xceec('0xd'),_0x1462b4,_0x5118d2);_0x35a54e(_0x5118d2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 655be52..7db5af4 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 _0xaefa=['getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addSmtp','addInteraction','/:id/send','/:id/users','addAgents','/:id','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x2977fc,_0x2a78df){var _0x1ac573=function(_0x3982a6){while(--_0x3982a6){_0x2977fc['push'](_0x2977fc['shift']());}};_0x1ac573(++_0x2a78df);}(_0xaefa,0x1df));var _0xaaef=function(_0x5a3277,_0x477100){_0x5a3277=_0x5a3277-0x0;var _0x3da47b=_0xaefa[_0x5a3277];return _0x3da47b;};'use strict';var multer=require(_0xaaef('0x0'));var util=require('util');var path=require(_0xaaef('0x1'));var timeout=require(_0xaaef('0x2'));var express=require(_0xaaef('0x3'));var router=express['Router']();var fs_extra=require(_0xaaef('0x4'));var auth=require(_0xaaef('0x5'));var interaction=require(_0xaaef('0x6'));var config=require(_0xaaef('0x7'));var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaaef('0x8')]);router[_0xaaef('0x9')]('/describe',auth[_0xaaef('0xa')](),controller[_0xaaef('0xb')]);router[_0xaaef('0x9')]('/:id',auth[_0xaaef('0xa')](),controller['show']);router['get'](_0xaaef('0xc'),auth[_0xaaef('0xa')](),controller[_0xaaef('0xd')]);router[_0xaaef('0x9')](_0xaaef('0xe'),auth[_0xaaef('0xa')](),controller[_0xaaef('0xf')]);router[_0xaaef('0x9')]('/:id/in_servers',auth[_0xaaef('0xa')](),controller[_0xaaef('0x10')]);router[_0xaaef('0x9')](_0xaaef('0x11'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x12')]);router[_0xaaef('0x9')](_0xaaef('0x13'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x14')]);router['get'](_0xaaef('0x15'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x16')]);router[_0xaaef('0x9')]('/:id/messages',auth[_0xaaef('0xa')](),controller['getMessages']);router[_0xaaef('0x9')]('/:id/verify',auth[_0xaaef('0xa')](),controller[_0xaaef('0x17')]);router[_0xaaef('0x9')]('/:id/users',auth[_0xaaef('0xa')](),controller[_0xaaef('0x18')]);router[_0xaaef('0x19')](_0xaaef('0xc'),auth['isAuthenticated'](),controller[_0xaaef('0x1a')]);router['post'](_0xaaef('0xe'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x1b')]);router['post']('/',auth[_0xaaef('0xa')](),controller[_0xaaef('0x1c')]);router[_0xaaef('0x19')]('/:id/in_servers',auth['isAuthenticated'](),controller['addImap']);router[_0xaaef('0x19')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xaaef('0x1d')]);router[_0xaaef('0x19')](_0xaaef('0x13'),auth['isAuthenticated'](),controller[_0xaaef('0x1e')]);router['post'](_0xaaef('0x15'),auth[_0xaaef('0xa')](),controller['addApplications']);router['post'](_0xaaef('0x1f'),auth[_0xaaef('0xa')](),controller['send']);router['post'](_0xaaef('0x20'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x21')]);router['put'](_0xaaef('0x22'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x23')]);router[_0xaaef('0x24')]('/:id/dispositions',auth[_0xaaef('0xa')](),controller[_0xaaef('0x25')]);router[_0xaaef('0x24')](_0xaaef('0xe'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x26')]);router['delete'](_0xaaef('0x27'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x28')]);router[_0xaaef('0x24')](_0xaaef('0x11'),auth[_0xaaef('0xa')](),controller[_0xaaef('0x29')]);router[_0xaaef('0x24')](_0xaaef('0x22'),auth['isAuthenticated'](),controller[_0xaaef('0x2a')]);router[_0xaaef('0x24')]('/:id/users',auth[_0xaaef('0xa')](),controller[_0xaaef('0x2b')]);module[_0xaaef('0x2c')]=router; \ No newline at end of file +var _0x6ddb=['delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','express','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','show','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update'];(function(_0x416f8e,_0x382960){var _0x56313a=function(_0x56dec3){while(--_0x56dec3){_0x416f8e['push'](_0x416f8e['shift']());}};_0x56313a(++_0x382960);}(_0x6ddb,0xf7));var _0xb6dd=function(_0x4358de,_0x5aefa6){_0x4358de=_0x4358de-0x0;var _0x52bf46=_0x6ddb[_0x4358de];return _0x52bf46;};'use strict';var multer=require(_0xb6dd('0x0'));var util=require(_0xb6dd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6dd('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(_0xb6dd('0x3'));var controller=require(_0xb6dd('0x4'));router[_0xb6dd('0x5')]('/',auth['isAuthenticated'](),controller[_0xb6dd('0x6')]);router[_0xb6dd('0x5')](_0xb6dd('0x7'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb6dd('0xa')]);router['get']('/:id/dispositions',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xb')]);router['get']('/:id/canned_answers',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xc')]);router[_0xb6dd('0x5')](_0xb6dd('0xd'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xe')]);router[_0xb6dd('0x5')](_0xb6dd('0xf'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x10')]);router[_0xb6dd('0x5')](_0xb6dd('0x11'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x12')]);router['get']('/:id/applications',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x13')]);router[_0xb6dd('0x5')](_0xb6dd('0x14'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x15')]);router[_0xb6dd('0x5')](_0xb6dd('0x16'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x17')]);router[_0xb6dd('0x5')](_0xb6dd('0x18'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x19')]);router[_0xb6dd('0x1a')](_0xb6dd('0x1b'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x1c')]);router[_0xb6dd('0x1a')](_0xb6dd('0x1d'),auth['isAuthenticated'](),controller[_0xb6dd('0x1e')]);router[_0xb6dd('0x1a')]('/',auth[_0xb6dd('0x8')](),controller['create']);router[_0xb6dd('0x1a')](_0xb6dd('0xd'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x1f')]);router['post'](_0xb6dd('0xf'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x20')]);router[_0xb6dd('0x1a')](_0xb6dd('0x11'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x21')]);router[_0xb6dd('0x1a')]('/:id/applications',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x22')]);router[_0xb6dd('0x1a')](_0xb6dd('0x23'),auth['isAuthenticated'](),controller[_0xb6dd('0x24')]);router[_0xb6dd('0x1a')](_0xb6dd('0x18'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x25')]);router[_0xb6dd('0x26')](_0xb6dd('0x27'),auth['isAuthenticated'](),controller[_0xb6dd('0x28')]);router[_0xb6dd('0x29')](_0xb6dd('0x1b'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x2a')]);router[_0xb6dd('0x29')](_0xb6dd('0x1d'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x2b')]);router[_0xb6dd('0x29')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xb6dd('0x2c')]);router[_0xb6dd('0x29')](_0xb6dd('0xf'),auth['isAuthenticated'](),controller[_0xb6dd('0x2d')]);router[_0xb6dd('0x29')](_0xb6dd('0x27'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x2e')]);router[_0xb6dd('0x29')](_0xb6dd('0x18'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x2f')]);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 e52425c..b9ea3bc 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 _0x9393=['mandatoryDisposition','ENUM','gmail','yahoo','getDataValue','provider','custom','sequelize','exports','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','setDataValue','mandatoryDispositionPauseId'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x9393,0x147));var _0x3939=function(_0x4f16e9,_0x44ea59){_0x4f16e9=_0x4f16e9-0x0;var _0x36dd05=_0x9393[_0x4f16e9];return _0x36dd05;};'use strict';var Sequelize=require(_0x3939('0x0'));module[_0x3939('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3939('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3939('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3939('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3939('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x3939('0x4')]},'markAsUnread':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3939('0x2')],'allowNull':![],'defaultValue':_0x3939('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x3939('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3939('0x4')],'defaultValue':function(){return _0x3939('0x7');}},'notificationSound':{'type':Sequelize[_0x3939('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3939('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3939('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3939('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x3939('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x3939('0x3')],'defaultValue':![],'comment':_0x3939('0xa'),'set':function(_0x2349fe){if(!_0x2349fe)this[_0x3939('0xb')](_0x3939('0xc'),null);this[_0x3939('0xb')](_0x3939('0xd'),_0x2349fe);}},'provider':{'type':Sequelize[_0x3939('0xe')](_0x3939('0xf'),'hotmail',_0x3939('0x10'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3939('0x11')](_0x3939('0x12')))return _0x3939('0x13');return this[_0x3939('0x11')]('provider');},'set':function(_0x53418f){if(_0x53418f==='custom')_0x53418f=null;return this['setDataValue'](_0x3939('0x12'),_0x53418f);}}}; \ No newline at end of file +var _0x16b4=['getDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','custom'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x16b4,0x7a));var _0x416b=function(_0x43a3ff,_0x3eb067){_0x43a3ff=_0x43a3ff-0x0;var _0x34d89a=_0x16b4[_0x43a3ff];return _0x34d89a;};'use strict';var Sequelize=require(_0x416b('0x0'));module[_0x416b('0x1')]={'description':{'type':Sequelize[_0x416b('0x2')]},'name':{'type':Sequelize[_0x416b('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x416b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x416b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x416b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x416b('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x416b('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x416b('0x5')](0x2)[_0x416b('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x416b('0x4')],'defaultValue':function(){return _0x416b('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x416b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x416b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x416b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x416b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x416b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x416b('0x9'),'set':function(_0xebba3b){if(!_0xebba3b)this[_0x416b('0xa')](_0x416b('0xb'),null);this[_0x416b('0xa')](_0x416b('0xc'),_0xebba3b);}},'provider':{'type':Sequelize[_0x416b('0xd')](_0x416b('0xe'),_0x416b('0xf'),'yahoo',_0x416b('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x416b('0x11');return this[_0x416b('0x12')](_0x416b('0x13'));},'set':function(_0x221f69){if(_0x221f69===_0x416b('0x11'))_0x221f69=null;return this[_0x416b('0xa')](_0x416b('0x13'),_0x221f69);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index fa6742c..449f771 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 _0x80dd=['UserProfileResource','end','stack','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','service','username','authentication','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','params','MailServerOut','keys','includeAll','include','find','update','body','provider','custom','secure','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','findOne','rows','removeDispositions','CannedAnswer','create','getAnswers','removeAnswers','ids','email','ListId','active','description','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','attachments','root','server/files/attachments','getSmtpOptions','SendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','redis','register','jayson/promise','client','request','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','then','destroy','get','MailAccounts'];(function(_0x197879,_0x2f574a){var _0x5af2b9=function(_0x44fda1){while(--_0x44fda1){_0x197879['push'](_0x197879['shift']());}};_0x5af2b9(++_0x2f574a);}(_0x80dd,0x158));var _0xd80d=function(_0x110dc8,_0x2b1f1f){_0x110dc8=_0x110dc8-0x0;var _0x4b001d=_0x80dd[_0x110dc8];return _0x4b001d;};'use strict';var moment=require(_0xd80d('0x0'));var BPromise=require(_0xd80d('0x1'));var util=require('util');var path=require(_0xd80d('0x2'));var _=require(_0xd80d('0x3'));var juice=require(_0xd80d('0x4'));var Redis=require(_0xd80d('0x5'));var qs=require(_0xd80d('0x6'));var logger=require(_0xd80d('0x7'))(_0xd80d('0x8'));var config=require(_0xd80d('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd80d('0xa'),'port':0x18eb});var socket=require(_0xd80d('0xb'))(new Redis(config[_0xd80d('0xc')]));require('./mailAccount.socket')[_0xd80d('0xd')](socket);var jayson=require(_0xd80d('0xe'));var client=jayson[_0xd80d('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x43b1b7,_0x5df572,_0x4a5975,_0x1c59d5){return new BPromise(function(_0x4407c7,_0x4e5639){var _0x3157f3=_0x1c59d5||client;return _0x3157f3[_0xd80d('0x10')](_0x43b1b7,_0x4a5975)['then'](function(_0x547e0c){logger['info'](_0xd80d('0x11'),_0x5df572,_0xd80d('0x12'));logger['debug'](_0xd80d('0x13'),_0x5df572,_0xd80d('0x12'),JSON[_0xd80d('0x14')](_0x547e0c));if(_0x547e0c[_0xd80d('0x15')]){if(_0x547e0c['error']['code']===0x1f4){logger[_0xd80d('0x15')]('MailAccount,\x20%s,\x20%s',_0x5df572,_0x547e0c['error']['message']);return _0x4e5639(_0x547e0c['error'][_0xd80d('0x16')]);}logger[_0xd80d('0x15')]('MailAccount,\x20%s,\x20%s',_0x5df572,_0x547e0c['error'][_0xd80d('0x16')]);return _0x4407c7(_0x547e0c[_0xd80d('0x15')][_0xd80d('0x16')]);}else{logger[_0xd80d('0x17')]('MailAccount,\x20%s,\x20%s',_0x5df572,_0xd80d('0x12'));_0x4407c7(_0x547e0c[_0xd80d('0x18')][_0xd80d('0x16')]);}})[_0xd80d('0x19')](function(_0x304172){logger[_0xd80d('0x15')]('MailAccount,\x20%s,\x20%s',_0x5df572,_0x304172);_0x4e5639(_0x304172);});});}function respondWithStatusCode(_0x2aa597,_0x307a46){_0x307a46=_0x307a46||0xcc;return function(_0xf33bb2){if(_0xf33bb2){return _0x2aa597[_0xd80d('0x1a')](_0x307a46);}return _0x2aa597[_0xd80d('0x1b')](_0x307a46)['end']();};}function respondWithResult(_0x40910e,_0x45c10f){_0x45c10f=_0x45c10f||0xc8;return function(_0x453726){if(_0x453726){return _0x40910e['status'](_0x45c10f)[_0xd80d('0x1c')](_0x453726);}};}function respondWithFilteredResult(_0x28657b,_0x49d03b){return function(_0x3fe55b){if(_0x3fe55b){var _0x31ff6c=typeof _0x49d03b[_0xd80d('0x1d')]==='undefined'&&typeof _0x49d03b[_0xd80d('0x1e')]===_0xd80d('0x1f');var _0x1f110b=_0x3fe55b['count'];var _0x30862c=_0x31ff6c?0x0:_0x49d03b[_0xd80d('0x1d')];var _0x2fe525=_0x31ff6c?_0x3fe55b[_0xd80d('0x20')]:_0x49d03b[_0xd80d('0x1d')]+_0x49d03b[_0xd80d('0x1e')];var _0x3d6e41;if(_0x2fe525>=_0x1f110b){_0x2fe525=_0x1f110b;_0x3d6e41=0xc8;}else{_0x3d6e41=0xce;}_0x28657b[_0xd80d('0x1b')](_0x3d6e41);return _0x28657b['set'](_0xd80d('0x21'),_0x30862c+'-'+_0x2fe525+'/'+_0x1f110b)[_0xd80d('0x1c')](_0x3fe55b);}return null;};}function saveUpdates(_0x32b4e2){return function(_0x4aab7c){if(_0x4aab7c){return _0x4aab7c['update'](_0x32b4e2)[_0xd80d('0x22')](function(_0x43e47f){return _0x43e47f;});}return null;};}function removeEntity(_0x26b9e6){return function(_0x23a181){if(_0x23a181){return _0x23a181[_0xd80d('0x23')]()['then'](function(){var _0x116dc8=_0x23a181[_0xd80d('0x24')]({'plain':!![]});var _0x251044=_0xd80d('0x25');return db[_0xd80d('0x26')][_0xd80d('0x23')]({'where':{'type':_0x251044,'resourceId':_0x116dc8['id']}})[_0xd80d('0x22')](function(){return _0x23a181;});})[_0xd80d('0x22')](function(){_0x26b9e6['status'](0xcc)[_0xd80d('0x27')]();});}};}function handleEntityNotFound(_0x3ef9b1){return function(_0x201010){if(!_0x201010){_0x3ef9b1[_0xd80d('0x1a')](0x194);}return _0x201010;};}function handleError(_0x50ab2a,_0x4718d3){_0x4718d3=_0x4718d3||0x1f4;return function(_0x1a1992){logger['error'](_0x1a1992[_0xd80d('0x28')]);if(_0x1a1992['name']){delete _0x1a1992['name'];}_0x50ab2a[_0xd80d('0x1b')](_0x4718d3)[_0xd80d('0x29')](_0x1a1992);};}function getImapHost(_0x42ad1e){switch(_0x42ad1e){case _0xd80d('0x2a'):return _0xd80d('0x2b');case _0xd80d('0x2c'):return _0xd80d('0x2d');case _0xd80d('0x2e'):return'imap-mail.outlook.com';case _0xd80d('0x2f'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x42ad1e);}function getSmtpHost(_0x5cabab){switch(_0x5cabab){case _0xd80d('0x2a'):return _0xd80d('0x30');case _0xd80d('0x2c'):return _0xd80d('0x31');case'hotmail':return _0xd80d('0x32');case'outlook365':return _0xd80d('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x5cabab);}function getAuthenticationOptions(_0x3badc4,_0x2ab01c){var _0x2e9583={};var _0x5f1b42={};if(_0x3badc4){_0x2e9583['user']=_0x5f1b42[_0xd80d('0x34')]=_0x2ab01c['username'];_0x2e9583[_0xd80d('0x35')]=_0x5f1b42[_0xd80d('0x36')]=_0x2ab01c['password'];if(_0x2ab01c[_0xd80d('0x37')]){_0x2e9583[_0xd80d('0x37')]=_0x5f1b42[_0xd80d('0x37')]=!![];_0x2e9583[_0xd80d('0x38')]=_0x5f1b42[_0xd80d('0x38')]=_0x2ab01c[_0xd80d('0x38')];_0x2e9583['password']=_0x5f1b42[_0xd80d('0x36')]=null;}else{_0x2e9583[_0xd80d('0x38')]=_0x5f1b42[_0xd80d('0x38')]=null;}_0x2e9583[_0xd80d('0x39')]=getImapHost(_0x3badc4);_0x2e9583[_0xd80d('0x3a')]=0x3e1;_0x5f1b42[_0xd80d('0x39')]=getSmtpHost(_0x3badc4);_0x5f1b42[_0xd80d('0x3a')]=0x24b;_0x5f1b42['secure']=![];_0x2e9583[_0xd80d('0x3b')]=_0x5f1b42[_0xd80d('0x3b')]=null;}else{if(_0x2ab01c['authentication']){_0x2e9583['user']=_0x5f1b42[_0xd80d('0x34')]=_0x2ab01c[_0xd80d('0x3c')];_0x2e9583[_0xd80d('0x35')]=_0x5f1b42[_0xd80d('0x36')]=_0x2ab01c[_0xd80d('0x35')];}else{_0x2e9583[_0xd80d('0x3d')]=_0x5f1b42[_0xd80d('0x3d')]=![];_0x2e9583[_0xd80d('0x34')]=_0x5f1b42['user']=null;_0x2e9583[_0xd80d('0x35')]=_0x5f1b42[_0xd80d('0x36')]=null;}_0x2e9583[_0xd80d('0x39')]=_0x2ab01c['Imap'][_0xd80d('0x39')];_0x2e9583[_0xd80d('0x3a')]=_0x2ab01c[_0xd80d('0x3e')]['port'];_0x5f1b42[_0xd80d('0x39')]=_0x2ab01c[_0xd80d('0x3f')][_0xd80d('0x39')];_0x5f1b42[_0xd80d('0x3a')]=_0x2ab01c[_0xd80d('0x3f')]['port'];}return{'Imap':_0x2e9583,'Smtp':_0x5f1b42};}exports['index']=function(_0xf27195,_0x4f1b53){var _0x22eeab={'include':[{'model':db[_0xd80d('0x40')],'as':_0xd80d('0x3e')},{'model':db['MailServerOut'],'as':_0xd80d('0x3f')},{'model':db[_0xd80d('0x41')],'as':_0xd80d('0x42')}]},_0x354926={},_0x1bbdf9={'count':0x0,'rows':[]};var _0x5ae5da=_[_0xd80d('0x43')](db[_0xd80d('0x44')][_0xd80d('0x45')],function(_0x1a53fd){return{'name':_0x1a53fd[_0xd80d('0x46')],'type':_0x1a53fd[_0xd80d('0x47')][_0xd80d('0x48')]};});_0x354926[_0xd80d('0x49')]=_[_0xd80d('0x43')](_0x5ae5da,_0xd80d('0x4a'));_0x354926['query']=_['keys'](_0xf27195[_0xd80d('0x4b')]);_0x354926[_0xd80d('0x4c')]=_[_0xd80d('0x4d')](_0x354926[_0xd80d('0x49')],_0x354926[_0xd80d('0x4b')]);_0x22eeab[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x354926['model'],qs[_0xd80d('0x4f')](_0xf27195[_0xd80d('0x4b')][_0xd80d('0x4f')]));_0x22eeab['attributes']=_0x22eeab[_0xd80d('0x4e')][_0xd80d('0x50')]?_0x22eeab[_0xd80d('0x4e')]:_0x354926[_0xd80d('0x49')];if(!_0xf27195[_0xd80d('0x4b')][_0xd80d('0x51')](_0xd80d('0x52'))){_0x22eeab[_0xd80d('0x1e')]=qs['limit'](_0xf27195[_0xd80d('0x4b')]['limit']);_0x22eeab[_0xd80d('0x1d')]=qs['offset'](_0xf27195[_0xd80d('0x4b')][_0xd80d('0x1d')]);}_0x22eeab[_0xd80d('0x53')]=qs['sort'](_0xf27195[_0xd80d('0x4b')][_0xd80d('0x54')]);_0x22eeab[_0xd80d('0x55')]=qs[_0xd80d('0x4c')](_[_0xd80d('0x56')](_0xf27195[_0xd80d('0x4b')],_0x354926['filters']),_0x5ae5da);if(_0xf27195[_0xd80d('0x4b')][_0xd80d('0x57')]){_0x22eeab[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x22eeab[_0xd80d('0x55')],{'$or':_['map'](_0x5ae5da,function(_0x254f2b){if(_0x254f2b[_0xd80d('0x47')]!=='VIRTUAL'){var _0x29f9a5={};_0x29f9a5[_0x254f2b['name']]={'$like':'%'+_0xf27195[_0xd80d('0x4b')]['filter']+'%'};return _0x29f9a5;}})});}_0x22eeab=_[_0xd80d('0x58')]({},_0x22eeab,_0xf27195[_0xd80d('0x59')]);var _0x21a77b={'where':_0x22eeab[_0xd80d('0x55')]};return db['MailAccount']['count'](_0x21a77b)[_0xd80d('0x22')](function(_0x2f7928){_0x1bbdf9['count']=_0x2f7928;if(_0xf27195['query']['includeAll']){_0x22eeab['include']=[{'all':!![]}];}return db['MailAccount'][_0xd80d('0x5a')](_0x22eeab);})['then'](function(_0x175dcb){_0x1bbdf9['rows']=_0x175dcb;return _0x1bbdf9;})[_0xd80d('0x22')](respondWithFilteredResult(_0x4f1b53,_0x22eeab))[_0xd80d('0x19')](handleError(_0x4f1b53,null));};exports['show']=function(_0x4aaace,_0x17ee5d){var _0x606cf6={'raw':![],'where':{'id':_0x4aaace[_0xd80d('0x5b')]['id']},'include':[{'model':db[_0xd80d('0x40')],'as':_0xd80d('0x3e')},{'model':db[_0xd80d('0x5c')],'as':_0xd80d('0x3f')},{'model':db[_0xd80d('0x41')],'as':'mandatoryDispositionPause'}]},_0x371093={};_0x371093[_0xd80d('0x49')]=_[_0xd80d('0x5d')](db[_0xd80d('0x44')][_0xd80d('0x45')]);_0x371093['query']=_[_0xd80d('0x5d')](_0x4aaace['query']);_0x371093['filters']=_[_0xd80d('0x4d')](_0x371093[_0xd80d('0x49')],_0x371093['query']);_0x606cf6['attributes']=_[_0xd80d('0x4d')](_0x371093[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0x4aaace[_0xd80d('0x4b')][_0xd80d('0x4f')]));_0x606cf6[_0xd80d('0x4e')]=_0x606cf6['attributes'][_0xd80d('0x50')]?_0x606cf6[_0xd80d('0x4e')]:_0x371093['model'];if(_0x4aaace['query'][_0xd80d('0x5e')]){_0x606cf6[_0xd80d('0x5f')]=[{'all':!![]}];}_0x606cf6=_[_0xd80d('0x58')]({},_0x606cf6,_0x4aaace['options']);return db['MailAccount'][_0xd80d('0x60')](_0x606cf6)[_0xd80d('0x22')](handleEntityNotFound(_0x17ee5d,null))[_0xd80d('0x22')](respondWithResult(_0x17ee5d,null))['catch'](handleError(_0x17ee5d,null));};exports[_0xd80d('0x61')]=function(_0x48da96,_0x1f5c03){if(_0x48da96['body']['id']){delete _0x48da96[_0xd80d('0x62')]['id'];}var _0x145989=_0x48da96['body'][_0xd80d('0x63')]===_0xd80d('0x64')?null:_0x48da96['body']['provider'];var _0x380349=_0x48da96[_0xd80d('0x62')]['Imap']||{};var _0x1ab89c=_0x48da96[_0xd80d('0x62')]['Smtp']||{};if(_0x145989){_0x380349[_0xd80d('0x39')]=getImapHost(_0x145989);_0x380349[_0xd80d('0x3a')]=0x3e1;_0x1ab89c[_0xd80d('0x39')]=getSmtpHost(_0x145989);_0x1ab89c['port']=0x24b;_0x1ab89c['secure']=![];}if(_0x1ab89c[_0xd80d('0x37')]){_0x1ab89c[_0xd80d('0x65')]=![];}else{_0x1ab89c['CloudProviderId']=null;}if(!_0x380349[_0xd80d('0x37')])_0x380349[_0xd80d('0x38')]=null;_0x48da96[_0xd80d('0x62')][_0xd80d('0x3e')]=_0x380349;_0x48da96[_0xd80d('0x62')][_0xd80d('0x3f')]=_0x1ab89c;return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x48da96[_0xd80d('0x5b')]['id']},'include':[{'model':db[_0xd80d('0x40')],'as':_0xd80d('0x3e')},{'model':db[_0xd80d('0x5c')],'as':_0xd80d('0x3f')},{'model':db[_0xd80d('0x41')],'as':_0xd80d('0x42')}]})[_0xd80d('0x22')](handleEntityNotFound(_0x1f5c03,null))[_0xd80d('0x22')](function(_0x20c8e6){if(!_0x20c8e6)throw new Error(_0xd80d('0x66'));if(_0x20c8e6[_0xd80d('0x3b')])delete _0x48da96['body']['Imap'];return _0x20c8e6;})['then'](saveUpdates(_0x48da96[_0xd80d('0x62')],null))[_0xd80d('0x22')](function(_0x3bf580){if(!_0x48da96[_0xd80d('0x62')][_0xd80d('0x3e')])return _0x3bf580;return db[_0xd80d('0x40')][_0xd80d('0x61')](_0x48da96[_0xd80d('0x62')][_0xd80d('0x3e')],{'where':{'MailAccountId':_0x3bf580['id']}})[_0xd80d('0x22')](function(){return _0x3bf580;});})['then'](function(_0x3e6c95){if(!_0x48da96[_0xd80d('0x62')][_0xd80d('0x3f')])return _0x3e6c95;return db[_0xd80d('0x5c')][_0xd80d('0x61')](_0x48da96[_0xd80d('0x62')]['Smtp'],{'where':{'MailAccountId':_0x3e6c95['id']}})[_0xd80d('0x22')](function(){return _0x3e6c95;});})[_0xd80d('0x22')](respondWithResult(_0x1f5c03,null))[_0xd80d('0x19')](handleError(_0x1f5c03,null));};exports[_0xd80d('0x67')]=function(_0x37cef6,_0x471603){return db[_0xd80d('0x44')][_0xd80d('0x67')]()[_0xd80d('0x22')](respondWithResult(_0x471603,null))[_0xd80d('0x19')](handleError(_0x471603,null));};exports['addDisposition']=function(_0x4aefbb,_0x19c086){if(_0x4aefbb[_0xd80d('0x62')]['id']){delete _0x4aefbb[_0xd80d('0x62')]['id'];}return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x4aefbb[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x19c086,null))['then'](function(_0xd27dbb){if(_0xd27dbb){_0x4aefbb['body'][_0xd80d('0x68')]=_0xd27dbb['id'];return db[_0xd80d('0x69')]['create'](_0x4aefbb[_0xd80d('0x62')]);}})[_0xd80d('0x22')](respondWithResult(_0x19c086,null))['catch'](handleError(_0x19c086,null));};exports['getDispositions']=function(_0x3376e5,_0x448fdb){var _0x24e726={'raw':![],'where':{}};var _0x53b0ae={};var _0x2e5d8b={'count':0x0,'rows':[]};return db[_0xd80d('0x44')][_0xd80d('0x6a')]({'where':{'id':_0x3376e5['params']['id']}})['then'](handleEntityNotFound(_0x448fdb,null))[_0xd80d('0x22')](function(_0x37bee2){if(_0x37bee2){_0x53b0ae[_0xd80d('0x49')]=_[_0xd80d('0x5d')](db[_0xd80d('0x69')][_0xd80d('0x45')]);_0x53b0ae['query']=_[_0xd80d('0x5d')](_0x3376e5['query']);_0x53b0ae[_0xd80d('0x4c')]=_[_0xd80d('0x4d')](_0x53b0ae[_0xd80d('0x49')],_0x53b0ae[_0xd80d('0x4b')]);_0x24e726[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x53b0ae[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0x3376e5[_0xd80d('0x4b')][_0xd80d('0x4f')]));_0x24e726['attributes']=_0x24e726[_0xd80d('0x4e')][_0xd80d('0x50')]?_0x24e726[_0xd80d('0x4e')]:_0x53b0ae[_0xd80d('0x49')];if(!_0x3376e5['query'][_0xd80d('0x51')](_0xd80d('0x52'))){_0x24e726[_0xd80d('0x1e')]=qs['limit'](_0x3376e5[_0xd80d('0x4b')][_0xd80d('0x1e')]);_0x24e726['offset']=qs[_0xd80d('0x1d')](_0x3376e5['query'][_0xd80d('0x1d')]);}_0x24e726[_0xd80d('0x53')]=qs[_0xd80d('0x54')](_0x3376e5['query'][_0xd80d('0x54')]);_0x24e726['where']=qs[_0xd80d('0x4c')](_[_0xd80d('0x56')](_0x3376e5['query'],_0x53b0ae[_0xd80d('0x4c')]));_0x24e726[_0xd80d('0x55')][_0xd80d('0x68')]=_0x37bee2['id'];if(_0x3376e5[_0xd80d('0x4b')][_0xd80d('0x57')]){_0x24e726['where']=_[_0xd80d('0x58')](_0x24e726[_0xd80d('0x55')],{'$or':_['map'](_0x24e726[_0xd80d('0x4e')],function(_0x287359){var _0x17b724={};_0x17b724[_0x287359]={'$like':'%'+_0x3376e5[_0xd80d('0x4b')]['filter']+'%'};return _0x17b724;})});}_0x24e726=_['merge']({},_0x24e726,_0x3376e5['options']);return db[_0xd80d('0x69')][_0xd80d('0x20')]({'where':_0x24e726[_0xd80d('0x55')]})[_0xd80d('0x22')](function(_0x4b49ee){_0x2e5d8b['count']=_0x4b49ee;if(_0x3376e5[_0xd80d('0x4b')]['includeAll']){_0x24e726[_0xd80d('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0xd80d('0x5a')](_0x24e726);})[_0xd80d('0x22')](function(_0x19fc09){_0x2e5d8b[_0xd80d('0x6b')]=_0x19fc09;return _0x2e5d8b;});}})[_0xd80d('0x22')](respondWithFilteredResult(_0x448fdb,_0x24e726))['catch'](handleError(_0x448fdb,null));};exports[_0xd80d('0x6c')]=function(_0x90ab11,_0x1fc5b4){return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x90ab11[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x1fc5b4,null))['then'](function(_0xea3a2c){if(_0xea3a2c){return _0xea3a2c['removeDispositions'](_0x90ab11[_0xd80d('0x4b')]['ids']);}})[_0xd80d('0x22')](respondWithStatusCode(_0x1fc5b4,null))[_0xd80d('0x19')](handleError(_0x1fc5b4,null));};exports['addAnswer']=function(_0x534c15,_0x524770){if(_0x534c15[_0xd80d('0x62')]['id']){delete _0x534c15[_0xd80d('0x62')]['id'];}return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x534c15[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x524770,null))['then'](function(_0x1de908){if(_0x1de908){_0x534c15[_0xd80d('0x62')][_0xd80d('0x68')]=_0x1de908['id'];return db[_0xd80d('0x6d')][_0xd80d('0x6e')](_0x534c15[_0xd80d('0x62')]);}})[_0xd80d('0x22')](respondWithResult(_0x524770,null))[_0xd80d('0x19')](handleError(_0x524770,null));};exports[_0xd80d('0x6f')]=function(_0x3cf24b,_0x279a72){var _0x4ea7df={'raw':![],'where':{}};var _0x4d69e3={};var _0x1310a1={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3cf24b[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x279a72,null))['then'](function(_0xdd003b){if(_0xdd003b){_0x4d69e3['model']=_['keys'](db['CannedAnswer'][_0xd80d('0x45')]);_0x4d69e3['query']=_[_0xd80d('0x5d')](_0x3cf24b[_0xd80d('0x4b')]);_0x4d69e3[_0xd80d('0x4c')]=_[_0xd80d('0x4d')](_0x4d69e3[_0xd80d('0x49')],_0x4d69e3[_0xd80d('0x4b')]);_0x4ea7df[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x4d69e3[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0x3cf24b[_0xd80d('0x4b')]['fields']));_0x4ea7df[_0xd80d('0x4e')]=_0x4ea7df[_0xd80d('0x4e')]['length']?_0x4ea7df[_0xd80d('0x4e')]:_0x4d69e3[_0xd80d('0x49')];if(!_0x3cf24b[_0xd80d('0x4b')][_0xd80d('0x51')](_0xd80d('0x52'))){_0x4ea7df['limit']=qs['limit'](_0x3cf24b['query'][_0xd80d('0x1e')]);_0x4ea7df[_0xd80d('0x1d')]=qs['offset'](_0x3cf24b[_0xd80d('0x4b')][_0xd80d('0x1d')]);}_0x4ea7df['order']=qs['sort'](_0x3cf24b[_0xd80d('0x4b')][_0xd80d('0x54')]);_0x4ea7df[_0xd80d('0x55')]=qs[_0xd80d('0x4c')](_['pick'](_0x3cf24b[_0xd80d('0x4b')],_0x4d69e3[_0xd80d('0x4c')]));_0x4ea7df[_0xd80d('0x55')]['MailAccountId']=_0xdd003b['id'];if(_0x3cf24b[_0xd80d('0x4b')]['filter']){_0x4ea7df[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x4ea7df[_0xd80d('0x55')],{'$or':_[_0xd80d('0x43')](_0x4ea7df[_0xd80d('0x4e')],function(_0x2166b2){var _0x197244={};_0x197244[_0x2166b2]={'$like':'%'+_0x3cf24b[_0xd80d('0x4b')][_0xd80d('0x57')]+'%'};return _0x197244;})});}_0x4ea7df=_[_0xd80d('0x58')]({},_0x4ea7df,_0x3cf24b[_0xd80d('0x59')]);return db[_0xd80d('0x6d')]['count']({'where':_0x4ea7df[_0xd80d('0x55')]})['then'](function(_0x4b63da){_0x1310a1[_0xd80d('0x20')]=_0x4b63da;if(_0x3cf24b['query'][_0xd80d('0x5e')]){_0x4ea7df[_0xd80d('0x5f')]=[{'all':!![]}];}return db[_0xd80d('0x6d')][_0xd80d('0x5a')](_0x4ea7df);})[_0xd80d('0x22')](function(_0x1c9fb3){_0x1310a1['rows']=_0x1c9fb3;return _0x1310a1;});}})['then'](respondWithFilteredResult(_0x279a72,_0x4ea7df))[_0xd80d('0x19')](handleError(_0x279a72,null));};exports['removeAnswers']=function(_0x2ff480,_0xf000bb){return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x2ff480[_0xd80d('0x5b')]['id']}})['then'](handleEntityNotFound(_0xf000bb,null))[_0xd80d('0x22')](function(_0x37fdda){if(_0x37fdda){return _0x37fdda[_0xd80d('0x70')](_0x2ff480['query'][_0xd80d('0x71')]);}})['then'](respondWithStatusCode(_0xf000bb,null))[_0xd80d('0x19')](handleError(_0xf000bb,null));};exports[_0xd80d('0x6e')]=function(_0x34cc35,_0x1ff634){var _0x570bbe={'name':_0x34cc35[_0xd80d('0x62')][_0xd80d('0x4a')],'key':_0x34cc35[_0xd80d('0x62')][_0xd80d('0x48')],'provider':_0x34cc35[_0xd80d('0x62')][_0xd80d('0x63')]==='custom'?null:_0x34cc35[_0xd80d('0x62')][_0xd80d('0x63')],'email':_0x34cc35[_0xd80d('0x62')][_0xd80d('0x72')],'ListId':_0x34cc35['body'][_0xd80d('0x73')],'active':!_['isNil'](_0x34cc35[_0xd80d('0x62')]['active'])?_0x34cc35[_0xd80d('0x62')][_0xd80d('0x74')]:!![],'description':_0x34cc35[_0xd80d('0x62')][_0xd80d('0x75')]||null};var _0x5e7c9b=getAuthenticationOptions(_0x570bbe[_0xd80d('0x63')],_0x34cc35['body']);_0x570bbe[_0xd80d('0x3e')]=_0x5e7c9b[_0xd80d('0x3e')];_0x570bbe[_0xd80d('0x3f')]=_0x5e7c9b[_0xd80d('0x3f')];return db[_0xd80d('0x44')][_0xd80d('0x6e')](_0x570bbe,{'include':[{'model':db[_0xd80d('0x5c')],'as':_0xd80d('0x3f')},{'model':db[_0xd80d('0x40')],'as':_0xd80d('0x3e')}]})['then'](function(_0x4855fa){var _0x1e7ee0=_0x34cc35[_0xd80d('0x34')][_0xd80d('0x24')]({'plain':!![]});if(!_0x1e7ee0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e7ee0[_0xd80d('0x76')]===_0xd80d('0x34')){var _0x62711c=_0x4855fa[_0xd80d('0x24')]({'plain':!![]});return db[_0xd80d('0x77')][_0xd80d('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x1e7ee0[_0xd80d('0x78')]},'raw':!![]})[_0xd80d('0x22')](function(_0x3c4d05){if(_0x3c4d05&&_0x3c4d05['autoAssociation']===0x0){return db[_0xd80d('0x26')][_0xd80d('0x6e')]({'name':_0x62711c[_0xd80d('0x4a')],'resourceId':_0x62711c['id'],'type':_0x3c4d05['name'],'sectionId':_0x3c4d05['id']},{})[_0xd80d('0x22')](function(){return _0x4855fa;});}else{return _0x4855fa;}})[_0xd80d('0x19')](function(_0x18a3de){logger[_0xd80d('0x15')](_0xd80d('0x79'),_0x18a3de);throw _0x18a3de;});}return _0x4855fa;})[_0xd80d('0x22')](respondWithResult(_0x1ff634,0xc9))[_0xd80d('0x19')](handleError(_0x1ff634,null));};exports[_0xd80d('0x7a')]=function(_0x533126,_0x55f5c3){return db[_0xd80d('0x44')][_0xd80d('0x6a')]({'where':{'id':_0x533126['params']['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x55f5c3,null))[_0xd80d('0x22')](function(_0x168a03){if(_0x168a03){return _0x168a03[_0xd80d('0x7a')]();}return null;})[_0xd80d('0x22')](respondWithResult(_0x55f5c3,null))[_0xd80d('0x19')](handleError(_0x55f5c3,null));};exports['addImap']=function(_0x498b49,_0x7d44f6){if(_0x498b49[_0xd80d('0x62')]['id']){delete _0x498b49[_0xd80d('0x62')]['id'];}return db['MailAccount'][_0xd80d('0x60')]({'where':{'id':_0x498b49[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x7d44f6,null))[_0xd80d('0x22')](function(_0xb26859){if(_0xb26859){_0x498b49[_0xd80d('0x62')]['MailAccountId']=_0xb26859['id'];return db[_0xd80d('0x40')]['create'](_0x498b49[_0xd80d('0x62')]);}})['then'](respondWithResult(_0x7d44f6,null))[_0xd80d('0x19')](handleError(_0x7d44f6,null));};exports[_0xd80d('0x7b')]=function(_0x23d2f8,_0x518cb8){return db['MailAccount'][_0xd80d('0x6a')]({'where':{'id':_0x23d2f8[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x518cb8,null))[_0xd80d('0x22')](function(_0x5b2bd4){if(_0x5b2bd4){return _0x5b2bd4['setImap'](null);}return null;})[_0xd80d('0x22')](respondWithStatusCode(_0x518cb8,null))[_0xd80d('0x19')](handleError(_0x518cb8,null));};exports[_0xd80d('0x7c')]=function(_0xba2041,_0xe7aa3f){return db[_0xd80d('0x44')]['findOne']({'where':{'id':_0xba2041[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0xe7aa3f,null))[_0xd80d('0x22')](function(_0xca19ae){if(_0xca19ae){return _0xca19ae[_0xd80d('0x7c')]();}return null;})[_0xd80d('0x22')](respondWithResult(_0xe7aa3f,null))[_0xd80d('0x19')](handleError(_0xe7aa3f,null));};exports['addSmtp']=function(_0x1d4a1d,_0x4e0a89){if(_0x1d4a1d[_0xd80d('0x62')]['id']){delete _0x1d4a1d['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x1d4a1d[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x4e0a89,null))[_0xd80d('0x22')](function(_0x2c9707){if(_0x2c9707){_0x1d4a1d[_0xd80d('0x62')][_0xd80d('0x68')]=_0x2c9707['id'];return db['MailServerOut'][_0xd80d('0x6e')](_0x1d4a1d['body']);}})[_0xd80d('0x22')](respondWithResult(_0x4e0a89,null))[_0xd80d('0x19')](handleError(_0x4e0a89,null));};exports[_0xd80d('0x7d')]=function(_0x297f9b,_0x31fa4a){return db[_0xd80d('0x44')][_0xd80d('0x6a')]({'where':{'id':_0x297f9b[_0xd80d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31fa4a,null))[_0xd80d('0x22')](function(_0x425293){if(_0x425293){return _0x425293[_0xd80d('0x7e')](null);}return null;})['then'](respondWithStatusCode(_0x31fa4a,null))[_0xd80d('0x19')](handleError(_0x31fa4a,null));};exports[_0xd80d('0x7f')]=function(_0x183118,_0xc3d1af){return db['MailInteraction'][_0xd80d('0x60')]({'where':{'id':_0x183118['params']['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0xc3d1af,null))[_0xd80d('0x22')](function(_0x378a71){if(_0x378a71){return _0x378a71[_0xd80d('0x7f')](_0x183118['body'][_0xd80d('0x71')],_[_0xd80d('0x80')](_0x183118['body'],[_0xd80d('0x71'),'id'])||{});}})[_0xd80d('0x22')](respondWithResult(_0xc3d1af,null))[_0xd80d('0x19')](handleError(_0xc3d1af,null));};exports['getInteractions']=function(_0xa8d5e1,_0x2d5a17){var _0x3bfb5d={'raw':![],'where':{}};var _0x153716={};var _0x573930={'count':0x0,'rows':[]};return db['MailAccount'][_0xd80d('0x6a')]({'where':{'id':_0xa8d5e1['params']['id']}})['then'](handleEntityNotFound(_0x2d5a17,null))['then'](function(_0x2a527c){if(_0x2a527c){_0x153716[_0xd80d('0x49')]=_['keys'](db[_0xd80d('0x81')][_0xd80d('0x45')]);_0x153716['query']=_['keys'](_0xa8d5e1[_0xd80d('0x4b')]);_0x153716['filters']=_[_0xd80d('0x4d')](_0x153716[_0xd80d('0x49')],_0x153716['query']);_0x3bfb5d[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x153716[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x4f')]));_0x3bfb5d[_0xd80d('0x4e')]=_0x3bfb5d['attributes'][_0xd80d('0x50')]?_0x3bfb5d['attributes']:_0x153716[_0xd80d('0x49')];if(!_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x51')]('nolimit')){_0x3bfb5d[_0xd80d('0x1e')]=qs['limit'](_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x1e')]);_0x3bfb5d[_0xd80d('0x1d')]=qs[_0xd80d('0x1d')](_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x1d')]);}_0x3bfb5d['order']=qs['sort'](_0xa8d5e1['query'][_0xd80d('0x54')]);_0x3bfb5d[_0xd80d('0x55')]=qs[_0xd80d('0x4c')](_['pick'](_0xa8d5e1['query'],_0x153716[_0xd80d('0x4c')]));_0x3bfb5d['where']['MailAccountId']=_0x2a527c['id'];if(_0xa8d5e1[_0xd80d('0x4b')]['filter']){_0x3bfb5d[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x3bfb5d['where'],{'$or':_[_0xd80d('0x43')](_0x3bfb5d[_0xd80d('0x4e')],function(_0x4d0edb){var _0x3beea9={};_0x3beea9[_0x4d0edb]={'$like':'%'+_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x57')]+'%'};return _0x3beea9;})});}_0x3bfb5d=_[_0xd80d('0x58')]({},_0x3bfb5d,_0xa8d5e1[_0xd80d('0x59')]);return db[_0xd80d('0x81')][_0xd80d('0x20')]({'where':_0x3bfb5d[_0xd80d('0x55')]})[_0xd80d('0x22')](function(_0x46045b){_0x573930[_0xd80d('0x20')]=_0x46045b;if(_0xa8d5e1[_0xd80d('0x4b')][_0xd80d('0x5e')]){_0x3bfb5d['include']=[{'model':db[_0xd80d('0x82')],'as':_0xd80d('0x83'),'required':![]},{'model':db[_0xd80d('0x84')],'as':_0xd80d('0x85'),'attributes':['name',_0xd80d('0x86'),'internal'],'required':![]},{'model':db[_0xd80d('0x87')],'as':_0xd80d('0x88'),'attributes':['id',_0xd80d('0x4a'),_0xd80d('0x89')],'where':_0xa8d5e1['query'][_0xd80d('0x8a')]?{'id':_0xa8d5e1[_0xd80d('0x4b')]['tag']}:undefined,'required':_0xa8d5e1['query']['tag']?!![]:![]}];}return db[_0xd80d('0x81')][_0xd80d('0x5a')](_0x3bfb5d);})[_0xd80d('0x22')](function(_0x5ab6d8){_0x573930[_0xd80d('0x6b')]=_0x5ab6d8;return _0x573930;});}})[_0xd80d('0x22')](respondWithFilteredResult(_0x2d5a17,_0x3bfb5d))['catch'](handleError(_0x2d5a17,null));};exports[_0xd80d('0x8b')]=function addApplications(_0x454ca7,_0x439b9b){var _0x422154=_0x454ca7[_0xd80d('0x5b')]['id'];var _0x27da4c=_0x454ca7[_0xd80d('0x62')];var _0x11b5db=0xc8;var _0x5dcae1=null;return db[_0xd80d('0x8c')]['transaction']({'isolationLevel':db['sequelize'][_0xd80d('0x8d')][_0xd80d('0x8e')][_0xd80d('0x8f')]},function(_0x3c01d5){return db[_0xd80d('0x44')][_0xd80d('0x6a')]({'where':{'id':_0x422154},'transaction':_0x3c01d5})[_0xd80d('0x22')](function(_0xd5cbdd){if(_0xd5cbdd){return db['MailApplication'][_0xd80d('0x23')]({'where':{'MailAccountId':_0x422154},'transaction':_0x3c01d5})[_0xd80d('0x22')](function(){var _0x99b055=_[_0xd80d('0x43')](_0x27da4c,function(_0x419425){_0x419425['MailAccountId']=_0x422154;return _0x419425;});return db[_0xd80d('0x90')][_0xd80d('0x91')](_0x99b055,{'transaction':_0x3c01d5});});}else{_0x11b5db=0x194;_0x5dcae1=[];}});})[_0xd80d('0x22')](function(){if(_0x11b5db!==0x194){return db[_0xd80d('0x90')][_0xd80d('0x92')]({'where':{'MailAccountId':_0x422154},'order':_0xd80d('0x93')})[_0xd80d('0x22')](function(_0x458d7e){_0x5dcae1=_0x458d7e;});}})[_0xd80d('0x19')](function(_0x3e5b8a){_0x11b5db=0x1f4;logger['error'](_0x3e5b8a[_0xd80d('0x28')]);if(_0x3e5b8a[_0xd80d('0x4a')]){delete _0x3e5b8a[_0xd80d('0x4a')];}_0x5dcae1=_0x3e5b8a;})[_0xd80d('0x94')](function(){if(_0x5dcae1===null){_0x439b9b['sendStatus'](_0x11b5db);}else{if(_0x11b5db===0x1f4){_0x439b9b[_0xd80d('0x1b')](_0x11b5db)['send'](_0x5dcae1);}else{_0x439b9b['status'](_0x11b5db)[_0xd80d('0x1c')](_0x5dcae1);}}});};exports[_0xd80d('0x95')]=function(_0x5a404a,_0x19315a){var _0x1fc927={};var _0x4c299f={};var _0x4dd892;var _0xc00ddc;return db[_0xd80d('0x44')][_0xd80d('0x6a')]({'where':{'id':_0x5a404a[_0xd80d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x19315a,null))[_0xd80d('0x22')](function(_0x374fa7){if(_0x374fa7){_0x4dd892=_0x374fa7;_0x4c299f[_0xd80d('0x49')]=_['keys'](db['MailApplication'][_0xd80d('0x45')]);_0x4c299f[_0xd80d('0x4b')]=_[_0xd80d('0x5d')](_0x5a404a['query']);_0x4c299f[_0xd80d('0x4c')]=_['intersection'](_0x4c299f[_0xd80d('0x49')],_0x4c299f['query']);_0x1fc927[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x4c299f[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0x5a404a['query']['fields']));_0x1fc927['attributes']=_0x1fc927['attributes'][_0xd80d('0x50')]?_0x1fc927[_0xd80d('0x4e')]:_0x4c299f[_0xd80d('0x49')];_0x1fc927[_0xd80d('0x53')]=qs[_0xd80d('0x54')](_0x5a404a[_0xd80d('0x4b')][_0xd80d('0x54')]);_0x1fc927[_0xd80d('0x55')]=qs['filters'](_[_0xd80d('0x56')](_0x5a404a['query'],_0x4c299f['filters']));if(_0x5a404a[_0xd80d('0x4b')][_0xd80d('0x57')]){_0x1fc927[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x1fc927[_0xd80d('0x55')],{'$or':_[_0xd80d('0x43')](_0x1fc927[_0xd80d('0x4e')],function(_0x979ba9){var _0x33769f={};_0x33769f[_0x979ba9]={'$like':'%'+_0x5a404a[_0xd80d('0x4b')]['filter']+'%'};return _0x33769f;})});}_0x1fc927=_['merge']({},_0x1fc927,_0x5a404a[_0xd80d('0x59')]);return _0x4dd892['getApplications'](_0x1fc927);}})[_0xd80d('0x22')](function(_0x31535f){if(_0x31535f){_0xc00ddc=_0x31535f[_0xd80d('0x50')];if(!_0x5a404a[_0xd80d('0x4b')]['hasOwnProperty'](_0xd80d('0x52'))){_0x1fc927[_0xd80d('0x1e')]=qs['limit'](_0x5a404a[_0xd80d('0x4b')][_0xd80d('0x1e')]);_0x1fc927[_0xd80d('0x1d')]=qs[_0xd80d('0x1d')](_0x5a404a[_0xd80d('0x4b')][_0xd80d('0x1d')]);}return _0x4dd892[_0xd80d('0x95')](_0x1fc927);}})[_0xd80d('0x22')](function(_0x47b865){if(_0x47b865){return _0x47b865?{'count':_0xc00ddc,'rows':_0x47b865}:null;}})[_0xd80d('0x22')](respondWithResult(_0x19315a,null))[_0xd80d('0x19')](handleError(_0x19315a,null));};exports[_0xd80d('0x96')]=function(_0x33d61b,_0x23cdef){var _0x30693d={'raw':!![],'where':{}};var _0x3c36a6={};var _0x598ee0={'count':0x0,'rows':[]};return db['MailAccount'][_0xd80d('0x6a')]({'where':{'id':_0x33d61b['params']['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x23cdef,null))['then'](function(_0x2fd553){if(_0x2fd553){_0x3c36a6['model']=_[_0xd80d('0x5d')](db[_0xd80d('0x97')][_0xd80d('0x45')]);_0x3c36a6[_0xd80d('0x4b')]=_[_0xd80d('0x5d')](_0x33d61b[_0xd80d('0x4b')]);_0x3c36a6['filters']=_[_0xd80d('0x4d')](_0x3c36a6[_0xd80d('0x49')],_0x3c36a6['query']);_0x30693d[_0xd80d('0x4e')]=_[_0xd80d('0x4d')](_0x3c36a6[_0xd80d('0x49')],qs[_0xd80d('0x4f')](_0x33d61b['query']['fields']));_0x30693d[_0xd80d('0x4e')]=_0x30693d[_0xd80d('0x4e')][_0xd80d('0x50')]?_0x30693d[_0xd80d('0x4e')]:_0x3c36a6[_0xd80d('0x49')];if(!_0x33d61b['query']['hasOwnProperty']('nolimit')){_0x30693d[_0xd80d('0x1e')]=qs['limit'](_0x33d61b['query'][_0xd80d('0x1e')]);_0x30693d[_0xd80d('0x1d')]=qs[_0xd80d('0x1d')](_0x33d61b[_0xd80d('0x4b')]['offset']);}_0x30693d[_0xd80d('0x53')]=qs[_0xd80d('0x54')](_0x33d61b['query'][_0xd80d('0x54')]);_0x30693d['where']=qs[_0xd80d('0x4c')](_['pick'](_0x33d61b[_0xd80d('0x4b')],_0x3c36a6[_0xd80d('0x4c')]));_0x30693d[_0xd80d('0x55')][_0xd80d('0x68')]=_0x2fd553['id'];if(_0x33d61b[_0xd80d('0x4b')][_0xd80d('0x57')]){_0x30693d[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x30693d[_0xd80d('0x55')],{'$or':_[_0xd80d('0x43')](_0x30693d['attributes'],function(_0x1be147){var _0x30486f={};_0x30486f[_0x1be147]={'$like':'%'+_0x33d61b[_0xd80d('0x4b')]['filter']+'%'};return _0x30486f;})});}if(_0x33d61b[_0xd80d('0x4b')][_0xd80d('0x98')]){var _0x7f0651=_0x33d61b[_0xd80d('0x4b')][_0xd80d('0x98')][_0xd80d('0x99')](',');var _0x48698b={};_0x48698b[_0x7f0651[0x0]]={'$gte':moment(_0x7f0651[0x1])[_0xd80d('0x9a')](_0xd80d('0x9b'))};_0x30693d[_0xd80d('0x55')]=_[_0xd80d('0x58')](_0x30693d[_0xd80d('0x55')],_0x48698b);}_0x30693d=_[_0xd80d('0x58')]({},_0x30693d,_0x33d61b[_0xd80d('0x59')]);return db['MailMessage'][_0xd80d('0x20')]({'where':_0x30693d[_0xd80d('0x55')]})[_0xd80d('0x22')](function(_0x5367c5){_0x598ee0[_0xd80d('0x20')]=_0x5367c5;if(_0x33d61b['query'][_0xd80d('0x5e')]){_0x30693d[_0xd80d('0x5f')]=[{'all':!![]}];}return db[_0xd80d('0x97')][_0xd80d('0x5a')](_0x30693d);})[_0xd80d('0x22')](function(_0x1a1ef9){if(_0x33d61b[_0xd80d('0x4b')][_0xd80d('0x9c')]===_0xd80d('0x9d')){for(var _0x1ff2fa=0x0;_0x1ff2fa<_0x1a1ef9[_0xd80d('0x50')];_0x1ff2fa++){_0x1a1ef9[_0x1ff2fa][_0xd80d('0x62')]=juice(_0x1a1ef9[_0x1ff2fa][_0xd80d('0x62')]);}}_0x598ee0[_0xd80d('0x6b')]=_0x1a1ef9;return _0x598ee0;});}})[_0xd80d('0x22')](respondWithFilteredResult(_0x23cdef,_0x30693d))[_0xd80d('0x19')](handleError(_0x23cdef,null));};exports['send']=function(_0x5ecbbc,_0x478bf7){var _0x32ca35,_0x522005={},_0x18d881;if(_0x5ecbbc['body']['to']){_0x18d881=_0x5ecbbc[_0xd80d('0x62')]['to'][_0xd80d('0x99')](',')[0x0];}return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x5ecbbc['params']['id']},'include':[{'model':db[_0xd80d('0x9e')],'as':_0xd80d('0x9f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x18d881},'limit':0x1,'order':[[_0xd80d('0xa0'),'DESC']]}]},{'model':db[_0xd80d('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd80d('0xa1')],'as':_0xd80d('0xa1'),'raw':!![]}]}]})[_0xd80d('0x22')](handleEntityNotFound(_0x478bf7,null))[_0xd80d('0x22')](function(_0x5cb253){if(!_0x5cb253)return;_0x32ca35=_0x5cb253;if(!_0x5cb253['Smtp'])throw new Error(_0xd80d('0xa2'));if(_[_0xd80d('0xa3')](_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa4')])){_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa4')]=util[_0xd80d('0x9a')]('%s\x20<%s>',_0x5cb253['name'],_0x5cb253['email']||_0x5cb253[_0xd80d('0x3f')][_0xd80d('0x34')]);}if(_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa5')]&&_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa5')][_0xd80d('0x50')]){for(var _0x29e2b9=0x0;_0x29e2b9<_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa5')][_0xd80d('0x50')];_0x29e2b9+=0x1){_0x5ecbbc['body'][_0xd80d('0xa5')][_0x29e2b9]={'filename':_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xa5')][_0x29e2b9]['name'],'path':path['join'](config[_0xd80d('0xa6')],_0xd80d('0xa7'),_0x5ecbbc[_0xd80d('0x62')]['attachments'][_0x29e2b9]['basename'])};}}var _0x352b06=_0x5cb253[_0xd80d('0xa8')]();return respondWithRpcPromise(_0xd80d('0xa9'),'sendMail',{'account':_0x352b06,'message':_0x5ecbbc[_0xd80d('0x62')]});})[_0xd80d('0x22')](function(_0x175095){if(!_0x175095)return;_0x522005=_0x175095;if(!_0x32ca35['List'])throw new Error(_0xd80d('0xaa'));if(_0x32ca35[_0xd80d('0x9f')][_0xd80d('0xab')][_0xd80d('0x50')])return _0x32ca35[_0xd80d('0x9f')][_0xd80d('0xab')][0x0];return db[_0xd80d('0x82')][_0xd80d('0x6e')](_[_0xd80d('0xac')](_0x5ecbbc[_0xd80d('0x62')],{'firstName':_0x5ecbbc['body']['to'],'email':_0x5ecbbc[_0xd80d('0x62')]['to'],'phone':_0x5ecbbc['body']['to'],'ListId':_0x32ca35[_0xd80d('0x73')]}));})[_0xd80d('0x22')](function(_0xd7eae1){if(!_0xd7eae1)return;var _0x1dbbbf={'UserId':_0x5ecbbc['user']['id'],'ContactId':_0xd7eae1['id'],'MailAccountId':_0x32ca35['id'],'inReplyTo':_0x522005[_0xd80d('0xad')],'to':_0x5ecbbc[_0xd80d('0x62')]['from'],'cc':_0x5ecbbc[_0xd80d('0x62')]['cc'],'subject':_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xae')],'attach':_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xaf')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xd80d('0x9a')](_0xd80d('0x9b')),'lastMsgDirection':_0xd80d('0xb0'),'Messages':[_[_0xd80d('0x58')](_0x5ecbbc[_0xd80d('0x62')],{'messageId':_0x522005[_0xd80d('0xad')],'sentAt':moment()['format'](_0xd80d('0x9b')),'read':!![],'MailAccountId':_0x32ca35['id'],'UserId':_0x5ecbbc[_0xd80d('0x34')]['id'],'ContactId':_0xd7eae1['id']})]};if(_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xb1')]){_0x1dbbbf=_[_0xd80d('0x58')](_0x1dbbbf,_0x5ecbbc[_0xd80d('0x62')][_0xd80d('0xb1')]);}return db[_0xd80d('0x81')][_0xd80d('0x6e')](_0x1dbbbf,{'include':[{'model':db['MailMessage'],'as':_0xd80d('0xb2')}]});})['then'](respondWithResult(_0x478bf7,null))[_0xd80d('0x19')](handleError(_0x478bf7,null));};exports['verifySmtp']=function(_0x3661c8,_0x90f1b5){return db['MailAccount'][_0xd80d('0x60')]({'where':{'id':_0x3661c8['params']['id']},'include':[{'model':db[_0xd80d('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd80d('0xa1')],'as':'CloudProvider','raw':!![]}]}]})[_0xd80d('0x22')](handleEntityNotFound(_0x90f1b5,null))[_0xd80d('0x22')](function(_0x4409bc){if(!_0x4409bc['Smtp'])return;var _0x41201e=_0x4409bc[_0xd80d('0xa8')]();return respondWithRpcPromise(_0xd80d('0xb3'),_0xd80d('0xb4'),{'account':_0x41201e});})[_0xd80d('0x22')](respondWithResult(_0x90f1b5,null))[_0xd80d('0x19')](handleError(_0x90f1b5,null));};exports[_0xd80d('0x23')]=function(_0x5be0f9,_0x1764c1){return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x5be0f9[_0xd80d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1764c1,null))[_0xd80d('0x22')](function(_0x294b6e){if(_0x294b6e&&_0x294b6e[_0xd80d('0x3b')]){throw new db[(_0xd80d('0xb5'))][(_0xd80d('0xb6'))](_0xd80d('0xb7'));}return _0x294b6e;})['then'](removeEntity(_0x1764c1,null))['catch'](handleError(_0x1764c1,null));};exports['addAgents']=function(_0x4ecbb6,_0x4346d7){return db[_0xd80d('0x44')]['find']({'where':{'id':_0x4ecbb6['params']['id']}})['then'](handleEntityNotFound(_0x4346d7,null))[_0xd80d('0x22')](function(_0x442a0b){if(_0x442a0b){return _0x442a0b[_0xd80d('0xb8')](_0x4ecbb6[_0xd80d('0x62')][_0xd80d('0x71')],_[_0xd80d('0x80')](_0x4ecbb6[_0xd80d('0x62')],[_0xd80d('0x71'),'id'])||{})['spread'](function(_0x308af7){for(var _0x51dfac=0x0;_0x51dfac<_0x4ecbb6['body'][_0xd80d('0x71')][_0xd80d('0x50')];_0x51dfac+=0x1){socket[_0xd80d('0xb9')](_0xd80d('0xba'),{'UserId':Number(_0x4ecbb6[_0xd80d('0x62')][_0xd80d('0x71')][_0x51dfac]),'MailAccountId':Number(_0x4ecbb6[_0xd80d('0x5b')]['id'])});}return _0x308af7;});}})[_0xd80d('0x22')](respondWithResult(_0x4346d7,null))[_0xd80d('0x19')](handleError(_0x4346d7,null));};exports[_0xd80d('0xbb')]=function(_0x6af938,_0x1b5919){return db[_0xd80d('0x44')][_0xd80d('0x60')]({'where':{'id':_0x6af938[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x1b5919,null))[_0xd80d('0x22')](function(_0x3c0481){if(_0x3c0481){return _0x3c0481[_0xd80d('0xbb')](_0x6af938['query']['ids'])[_0xd80d('0x22')](function(){if(_[_0xd80d('0xbc')](_0x6af938[_0xd80d('0x4b')][_0xd80d('0x71')])){for(var _0x1508c2=0x0;_0x1508c2<_0x6af938[_0xd80d('0x4b')][_0xd80d('0x71')][_0xd80d('0x50')];_0x1508c2+=0x1){socket['emit'](_0xd80d('0xbd'),{'UserId':Number(_0x6af938[_0xd80d('0x4b')][_0xd80d('0x71')][_0x1508c2]),'MailAccountId':Number(_0x6af938[_0xd80d('0x5b')]['id'])});}}else{socket[_0xd80d('0xb9')]('userMailAccount:remove',{'UserId':Number(_0x6af938[_0xd80d('0x4b')]['ids']),'MailAccountId':Number(_0x6af938[_0xd80d('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b5919,null))[_0xd80d('0x19')](handleError(_0x1b5919,null));};exports[_0xd80d('0xbe')]=function(_0x564088,_0x5ae10b){var _0x321575={};var _0x3c2d0c={};var _0xc7a6ef;var _0x4ae964;return db[_0xd80d('0x44')]['findOne']({'where':{'id':_0x564088[_0xd80d('0x5b')]['id']}})[_0xd80d('0x22')](handleEntityNotFound(_0x5ae10b,null))['then'](function(_0xf239a0){if(_0xf239a0){_0xc7a6ef=_0xf239a0;_0x3c2d0c[_0xd80d('0x49')]=_[_0xd80d('0x5d')](db[_0xd80d('0x84')][_0xd80d('0x45')]);_0x3c2d0c[_0xd80d('0x4b')]=_['keys'](_0x564088[_0xd80d('0x4b')]);_0x3c2d0c['filters']=_[_0xd80d('0x4d')](_0x3c2d0c[_0xd80d('0x49')],_0x3c2d0c[_0xd80d('0x4b')]);_0x321575[_0xd80d('0x4e')]=_['intersection'](_0x3c2d0c[_0xd80d('0x49')],qs['fields'](_0x564088[_0xd80d('0x4b')][_0xd80d('0x4f')]));_0x321575['attributes']=_0x321575[_0xd80d('0x4e')][_0xd80d('0x50')]?_0x321575[_0xd80d('0x4e')]:_0x3c2d0c['model'];_0x321575[_0xd80d('0x53')]=qs['sort'](_0x564088[_0xd80d('0x4b')][_0xd80d('0x54')]);_0x321575[_0xd80d('0x55')]=qs[_0xd80d('0x4c')](_['pick'](_0x564088['query'],_0x3c2d0c[_0xd80d('0x4c')]));if(_0x564088['query'][_0xd80d('0x57')]){_0x321575['where']=_[_0xd80d('0x58')](_0x321575[_0xd80d('0x55')],{'$or':_[_0xd80d('0x43')](_0x321575[_0xd80d('0x4e')],function(_0x1cc604){var _0x326a08={};_0x326a08[_0x1cc604]={'$like':'%'+_0x564088[_0xd80d('0x4b')][_0xd80d('0x57')]+'%'};return _0x326a08;})});}_0x321575=_[_0xd80d('0x58')]({},_0x321575,_0x564088[_0xd80d('0x59')]);return _0xc7a6ef[_0xd80d('0xbe')](_0x321575);}})['then'](function(_0xd0c526){if(_0xd0c526){_0x4ae964=_0xd0c526['length'];if(!_0x564088[_0xd80d('0x4b')][_0xd80d('0x51')](_0xd80d('0x52'))){_0x321575['limit']=qs['limit'](_0x564088['query'][_0xd80d('0x1e')]);_0x321575['offset']=qs['offset'](_0x564088[_0xd80d('0x4b')][_0xd80d('0x1d')]);}return _0xc7a6ef[_0xd80d('0xbe')](_0x321575);}})['then'](function(_0x3e1f78){if(_0x3e1f78){return _0x3e1f78?{'count':_0x4ae964,'rows':_0x3e1f78}:null;}})[_0xd80d('0x22')](respondWithResult(_0x5ae10b,null))[_0xd80d('0x19')](handleError(_0x5ae10b,null));}; \ No newline at end of file +var _0xaf36=['color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','Contacts','updatedAt','CloudProvider','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','sendMail','List\x20not\x20found','messageId','out','Interaction','getSmtpOptions','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','then','get','UserProfileResource','destroy','stack','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','params','Pause','include','options','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','service','describe','MailAccountId','Disposition','create','catch','findOne','hasOwnProperty','pick','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','ids','omit','getInteractions','CmContact','Contact','Owner','internal','Tags'];(function(_0x3a0006,_0x2cc0ef){var _0x2b22d5=function(_0x4daaf8){while(--_0x4daaf8){_0x3a0006['push'](_0x3a0006['shift']());}};_0x2b22d5(++_0x2cc0ef);}(_0xaf36,0x1be));var _0x6af3=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xaf36[_0x2a390b];return _0x5df10a;};'use strict';var moment=require(_0x6af3('0x0'));var BPromise=require(_0x6af3('0x1'));var util=require(_0x6af3('0x2'));var path=require(_0x6af3('0x3'));var _=require(_0x6af3('0x4'));var juice=require(_0x6af3('0x5'));var Redis=require(_0x6af3('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x6af3('0x7'))(_0x6af3('0x8'));var config=require(_0x6af3('0x9'));var db=require(_0x6af3('0xa'))['db'];config[_0x6af3('0xb')]=_[_0x6af3('0xc')](config[_0x6af3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6af3('0xd'))(new Redis(config[_0x6af3('0xb')]));require('./mailAccount.socket')[_0x6af3('0xe')](socket);var jayson=require(_0x6af3('0xf'));var client=jayson[_0x6af3('0x10')][_0x6af3('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x414f0d,_0x2c89cc,_0x404c42,_0x30df79){return new BPromise(function(_0x4a7955,_0x48ea1a){var _0x549f80=_0x30df79||client;return _0x549f80[_0x6af3('0x12')](_0x414f0d,_0x404c42)['then'](function(_0x5bccfe){logger[_0x6af3('0x13')](_0x6af3('0x14'),_0x2c89cc,'request\x20sent');logger[_0x6af3('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2c89cc,_0x6af3('0x16'),JSON[_0x6af3('0x17')](_0x5bccfe));if(_0x5bccfe[_0x6af3('0x18')]){if(_0x5bccfe[_0x6af3('0x18')][_0x6af3('0x19')]===0x1f4){logger[_0x6af3('0x18')](_0x6af3('0x14'),_0x2c89cc,_0x5bccfe[_0x6af3('0x18')][_0x6af3('0x1a')]);return _0x48ea1a(_0x5bccfe[_0x6af3('0x18')]['message']);}logger[_0x6af3('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c89cc,_0x5bccfe[_0x6af3('0x18')]['message']);return _0x4a7955(_0x5bccfe[_0x6af3('0x18')][_0x6af3('0x1a')]);}else{logger[_0x6af3('0x13')](_0x6af3('0x14'),_0x2c89cc,_0x6af3('0x16'));_0x4a7955(_0x5bccfe[_0x6af3('0x1b')]['message']);}})['catch'](function(_0x1f3698){logger[_0x6af3('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c89cc,_0x1f3698);_0x48ea1a(_0x1f3698);});});}function respondWithStatusCode(_0x11c4fd,_0xcefe47){_0xcefe47=_0xcefe47||0xcc;return function(_0x159630){if(_0x159630){return _0x11c4fd[_0x6af3('0x1c')](_0xcefe47);}return _0x11c4fd['status'](_0xcefe47)['end']();};}function respondWithResult(_0x4e3e7c,_0x8f2ee1){_0x8f2ee1=_0x8f2ee1||0xc8;return function(_0x1229ba){if(_0x1229ba){return _0x4e3e7c[_0x6af3('0x1d')](_0x8f2ee1)[_0x6af3('0x1e')](_0x1229ba);}};}function respondWithFilteredResult(_0x5a4953,_0x11ed2e){return function(_0x92d52b){if(_0x92d52b){var _0x104470=typeof _0x11ed2e[_0x6af3('0x1f')]===_0x6af3('0x20')&&typeof _0x11ed2e[_0x6af3('0x21')]===_0x6af3('0x20');var _0x28f35d=_0x92d52b['count'];var _0x5eec05=_0x104470?0x0:_0x11ed2e[_0x6af3('0x1f')];var _0x10a0f8=_0x104470?_0x92d52b[_0x6af3('0x22')]:_0x11ed2e[_0x6af3('0x1f')]+_0x11ed2e[_0x6af3('0x21')];var _0x5c5ebf;if(_0x10a0f8>=_0x28f35d){_0x10a0f8=_0x28f35d;_0x5c5ebf=0xc8;}else{_0x5c5ebf=0xce;}_0x5a4953[_0x6af3('0x1d')](_0x5c5ebf);return _0x5a4953[_0x6af3('0x23')]('Content-Range',_0x5eec05+'-'+_0x10a0f8+'/'+_0x28f35d)[_0x6af3('0x1e')](_0x92d52b);}return null;};}function saveUpdates(_0x893e5f){return function(_0x964b8e){if(_0x964b8e){return _0x964b8e['update'](_0x893e5f)[_0x6af3('0x24')](function(_0x30e4ff){return _0x30e4ff;});}return null;};}function removeEntity(_0x824801){return function(_0x522702){if(_0x522702){return _0x522702['destroy']()[_0x6af3('0x24')](function(){var _0x5d8d5b=_0x522702[_0x6af3('0x25')]({'plain':!![]});var _0x3f64c7='MailAccounts';return db[_0x6af3('0x26')][_0x6af3('0x27')]({'where':{'type':_0x3f64c7,'resourceId':_0x5d8d5b['id']}})[_0x6af3('0x24')](function(){return _0x522702;});})[_0x6af3('0x24')](function(){_0x824801['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x251b44){return function(_0x7bc17e){if(!_0x7bc17e){_0x251b44[_0x6af3('0x1c')](0x194);}return _0x7bc17e;};}function handleError(_0x479c81,_0x2cf276){_0x2cf276=_0x2cf276||0x1f4;return function(_0x2e69a1){logger[_0x6af3('0x18')](_0x2e69a1[_0x6af3('0x28')]);if(_0x2e69a1['name']){delete _0x2e69a1['name'];}_0x479c81['status'](_0x2cf276)[_0x6af3('0x29')](_0x2e69a1);};}function getImapHost(_0x232492){switch(_0x232492){case _0x6af3('0x2a'):return _0x6af3('0x2b');case _0x6af3('0x2c'):return _0x6af3('0x2d');case'hotmail':return _0x6af3('0x2e');case _0x6af3('0x2f'):return _0x6af3('0x30');}throw new Error(_0x6af3('0x31'),_0x232492);}function getSmtpHost(_0x2c54c9){switch(_0x2c54c9){case'gmail':return _0x6af3('0x32');case _0x6af3('0x2c'):return _0x6af3('0x33');case _0x6af3('0x34'):return _0x6af3('0x35');case _0x6af3('0x2f'):return _0x6af3('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x2c54c9);}function getAuthenticationOptions(_0x55216,_0x446e52){var _0x5b2000={};var _0x27c490={};if(_0x55216){_0x5b2000[_0x6af3('0x37')]=_0x27c490[_0x6af3('0x37')]=_0x446e52[_0x6af3('0x38')];_0x5b2000[_0x6af3('0x39')]=_0x27c490[_0x6af3('0x3a')]=_0x446e52[_0x6af3('0x39')];if(_0x446e52[_0x6af3('0x3b')]){_0x5b2000[_0x6af3('0x3b')]=_0x27c490[_0x6af3('0x3b')]=!![];_0x5b2000[_0x6af3('0x3c')]=_0x27c490['CloudProviderId']=_0x446e52[_0x6af3('0x3c')];_0x5b2000['password']=_0x27c490[_0x6af3('0x3a')]=null;}else{_0x5b2000[_0x6af3('0x3c')]=_0x27c490[_0x6af3('0x3c')]=null;}_0x5b2000[_0x6af3('0x3d')]=getImapHost(_0x55216);_0x5b2000[_0x6af3('0x3e')]=0x3e1;_0x27c490[_0x6af3('0x3d')]=getSmtpHost(_0x55216);_0x27c490[_0x6af3('0x3e')]=0x24b;_0x27c490[_0x6af3('0x3f')]=![];_0x5b2000['service']=_0x27c490['service']=null;}else{if(_0x446e52[_0x6af3('0x40')]){_0x5b2000['user']=_0x27c490['user']=_0x446e52[_0x6af3('0x38')];_0x5b2000[_0x6af3('0x39')]=_0x27c490['pass']=_0x446e52['password'];}else{_0x5b2000[_0x6af3('0x40')]=_0x27c490[_0x6af3('0x40')]=![];_0x5b2000['user']=_0x27c490[_0x6af3('0x37')]=null;_0x5b2000['password']=_0x27c490[_0x6af3('0x3a')]=null;}_0x5b2000['host']=_0x446e52[_0x6af3('0x41')]['host'];_0x5b2000[_0x6af3('0x3e')]=_0x446e52[_0x6af3('0x41')][_0x6af3('0x3e')];_0x27c490[_0x6af3('0x3d')]=_0x446e52[_0x6af3('0x42')][_0x6af3('0x3d')];_0x27c490[_0x6af3('0x3e')]=_0x446e52[_0x6af3('0x42')][_0x6af3('0x3e')];}return{'Imap':_0x5b2000,'Smtp':_0x27c490};}exports[_0x6af3('0x43')]=function(_0x48dbaf,_0x3768a1){var _0x1f7590={'include':[{'model':db[_0x6af3('0x44')],'as':_0x6af3('0x41')},{'model':db[_0x6af3('0x45')],'as':'Smtp'},{'model':db['Pause'],'as':_0x6af3('0x46')}]},_0x2f462e={},_0x44055b={'count':0x0,'rows':[]};var _0x2cdbfc=_[_0x6af3('0x47')](db[_0x6af3('0x48')][_0x6af3('0x49')],function(_0x5e9914){return{'name':_0x5e9914[_0x6af3('0x4a')],'type':_0x5e9914[_0x6af3('0x4b')][_0x6af3('0x4c')]};});_0x2f462e[_0x6af3('0x4d')]=_[_0x6af3('0x47')](_0x2cdbfc,_0x6af3('0x4e'));_0x2f462e[_0x6af3('0x4f')]=_[_0x6af3('0x50')](_0x48dbaf[_0x6af3('0x4f')]);_0x2f462e['filters']=_[_0x6af3('0x51')](_0x2f462e['model'],_0x2f462e['query']);_0x1f7590[_0x6af3('0x52')]=_[_0x6af3('0x51')](_0x2f462e['model'],qs[_0x6af3('0x53')](_0x48dbaf[_0x6af3('0x4f')]['fields']));_0x1f7590[_0x6af3('0x52')]=_0x1f7590[_0x6af3('0x52')][_0x6af3('0x54')]?_0x1f7590[_0x6af3('0x52')]:_0x2f462e['model'];if(!_0x48dbaf['query']['hasOwnProperty'](_0x6af3('0x55'))){_0x1f7590[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x48dbaf[_0x6af3('0x4f')][_0x6af3('0x21')]);_0x1f7590[_0x6af3('0x1f')]=qs['offset'](_0x48dbaf[_0x6af3('0x4f')][_0x6af3('0x1f')]);}_0x1f7590[_0x6af3('0x56')]=qs[_0x6af3('0x57')](_0x48dbaf['query'][_0x6af3('0x57')]);_0x1f7590[_0x6af3('0x58')]=qs['filters'](_['pick'](_0x48dbaf[_0x6af3('0x4f')],_0x2f462e[_0x6af3('0x59')]),_0x2cdbfc);if(_0x48dbaf['query'][_0x6af3('0x5a')]){_0x1f7590[_0x6af3('0x58')]=_[_0x6af3('0x5b')](_0x1f7590[_0x6af3('0x58')],{'$or':_['map'](_0x2cdbfc,function(_0x4d3a54){if(_0x4d3a54[_0x6af3('0x4b')]!==_0x6af3('0x5c')){var _0x2f6373={};_0x2f6373[_0x4d3a54[_0x6af3('0x4e')]]={'$like':'%'+_0x48dbaf[_0x6af3('0x4f')][_0x6af3('0x5a')]+'%'};return _0x2f6373;}})});}_0x1f7590=_[_0x6af3('0x5b')]({},_0x1f7590,_0x48dbaf['options']);var _0x414b47={'where':_0x1f7590[_0x6af3('0x58')]};return db['MailAccount'][_0x6af3('0x22')](_0x414b47)[_0x6af3('0x24')](function(_0x5e327b){_0x44055b[_0x6af3('0x22')]=_0x5e327b;if(_0x48dbaf[_0x6af3('0x4f')][_0x6af3('0x5d')]){_0x1f7590['include']=[{'all':!![]}];}return db[_0x6af3('0x48')][_0x6af3('0x5e')](_0x1f7590);})['then'](function(_0x3cdad8){_0x44055b[_0x6af3('0x5f')]=_0x3cdad8;return _0x44055b;})[_0x6af3('0x24')](respondWithFilteredResult(_0x3768a1,_0x1f7590))['catch'](handleError(_0x3768a1,null));};exports['show']=function(_0x363098,_0x26f710){var _0x62a409={'raw':![],'where':{'id':_0x363098[_0x6af3('0x60')]['id']},'include':[{'model':db[_0x6af3('0x44')],'as':_0x6af3('0x41')},{'model':db[_0x6af3('0x45')],'as':_0x6af3('0x42')},{'model':db[_0x6af3('0x61')],'as':_0x6af3('0x46')}]},_0xa17ff0={};_0xa17ff0[_0x6af3('0x4d')]=_[_0x6af3('0x50')](db[_0x6af3('0x48')][_0x6af3('0x49')]);_0xa17ff0[_0x6af3('0x4f')]=_[_0x6af3('0x50')](_0x363098['query']);_0xa17ff0['filters']=_[_0x6af3('0x51')](_0xa17ff0['model'],_0xa17ff0['query']);_0x62a409[_0x6af3('0x52')]=_[_0x6af3('0x51')](_0xa17ff0['model'],qs[_0x6af3('0x53')](_0x363098[_0x6af3('0x4f')]['fields']));_0x62a409[_0x6af3('0x52')]=_0x62a409[_0x6af3('0x52')][_0x6af3('0x54')]?_0x62a409[_0x6af3('0x52')]:_0xa17ff0[_0x6af3('0x4d')];if(_0x363098[_0x6af3('0x4f')][_0x6af3('0x5d')]){_0x62a409[_0x6af3('0x62')]=[{'all':!![]}];}_0x62a409=_['merge']({},_0x62a409,_0x363098[_0x6af3('0x63')]);return db[_0x6af3('0x48')][_0x6af3('0x64')](_0x62a409)[_0x6af3('0x24')](handleEntityNotFound(_0x26f710,null))[_0x6af3('0x24')](respondWithResult(_0x26f710,null))['catch'](handleError(_0x26f710,null));};exports[_0x6af3('0x65')]=function(_0x48d522,_0x365b36){if(_0x48d522['body']['id']){delete _0x48d522['body']['id'];}var _0x495f33=_0x48d522[_0x6af3('0x66')][_0x6af3('0x67')]===_0x6af3('0x68')?null:_0x48d522[_0x6af3('0x66')][_0x6af3('0x67')];var _0x4a14fe=_0x48d522['body'][_0x6af3('0x41')]||{};var _0x57e576=_0x48d522[_0x6af3('0x66')][_0x6af3('0x42')]||{};if(_0x495f33){_0x4a14fe['host']=getImapHost(_0x495f33);_0x4a14fe[_0x6af3('0x3e')]=0x3e1;_0x57e576[_0x6af3('0x3d')]=getSmtpHost(_0x495f33);_0x57e576[_0x6af3('0x3e')]=0x24b;_0x57e576['secure']=![];}if(_0x57e576[_0x6af3('0x3b')]){_0x57e576[_0x6af3('0x3f')]=![];}else{_0x57e576[_0x6af3('0x3c')]=null;}if(!_0x4a14fe[_0x6af3('0x3b')])_0x4a14fe[_0x6af3('0x3c')]=null;_0x48d522['body'][_0x6af3('0x41')]=_0x4a14fe;_0x48d522['body'][_0x6af3('0x42')]=_0x57e576;return db['MailAccount'][_0x6af3('0x64')]({'where':{'id':_0x48d522[_0x6af3('0x60')]['id']},'include':[{'model':db[_0x6af3('0x44')],'as':_0x6af3('0x41')},{'model':db[_0x6af3('0x45')],'as':_0x6af3('0x42')},{'model':db[_0x6af3('0x61')],'as':_0x6af3('0x46')}]})[_0x6af3('0x24')](handleEntityNotFound(_0x365b36,null))[_0x6af3('0x24')](function(_0x1d37ea){if(!_0x1d37ea)throw new Error(_0x6af3('0x69'));if(_0x1d37ea[_0x6af3('0x6a')])delete _0x48d522[_0x6af3('0x66')][_0x6af3('0x41')];return _0x1d37ea;})[_0x6af3('0x24')](saveUpdates(_0x48d522[_0x6af3('0x66')],null))[_0x6af3('0x24')](function(_0x433742){if(!_0x48d522[_0x6af3('0x66')][_0x6af3('0x41')])return _0x433742;return db[_0x6af3('0x44')][_0x6af3('0x65')](_0x48d522[_0x6af3('0x66')][_0x6af3('0x41')],{'where':{'MailAccountId':_0x433742['id']}})[_0x6af3('0x24')](function(){return _0x433742;});})['then'](function(_0x2db3a5){if(!_0x48d522[_0x6af3('0x66')][_0x6af3('0x42')])return _0x2db3a5;return db['MailServerOut']['update'](_0x48d522[_0x6af3('0x66')]['Smtp'],{'where':{'MailAccountId':_0x2db3a5['id']}})[_0x6af3('0x24')](function(){return _0x2db3a5;});})[_0x6af3('0x24')](respondWithResult(_0x365b36,null))['catch'](handleError(_0x365b36,null));};exports[_0x6af3('0x6b')]=function(_0x5eadc6,_0x23f6f5){return db[_0x6af3('0x48')]['describe']()[_0x6af3('0x24')](respondWithResult(_0x23f6f5,null))['catch'](handleError(_0x23f6f5,null));};exports['addDisposition']=function(_0x43328f,_0x573c37){if(_0x43328f[_0x6af3('0x66')]['id']){delete _0x43328f[_0x6af3('0x66')]['id'];}return db[_0x6af3('0x48')]['find']({'where':{'id':_0x43328f[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x573c37,null))[_0x6af3('0x24')](function(_0x18a7b9){if(_0x18a7b9){_0x43328f[_0x6af3('0x66')][_0x6af3('0x6c')]=_0x18a7b9['id'];return db[_0x6af3('0x6d')][_0x6af3('0x6e')](_0x43328f['body']);}})[_0x6af3('0x24')](respondWithResult(_0x573c37,null))[_0x6af3('0x6f')](handleError(_0x573c37,null));};exports['getDispositions']=function(_0x1051b1,_0x50f596){var _0x355982={'raw':![],'where':{}};var _0x3c2dc7={};var _0x3f22cf={'count':0x0,'rows':[]};return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x1051b1[_0x6af3('0x60')]['id']}})['then'](handleEntityNotFound(_0x50f596,null))['then'](function(_0x25f07e){if(_0x25f07e){_0x3c2dc7[_0x6af3('0x4d')]=_[_0x6af3('0x50')](db[_0x6af3('0x6d')][_0x6af3('0x49')]);_0x3c2dc7[_0x6af3('0x4f')]=_['keys'](_0x1051b1[_0x6af3('0x4f')]);_0x3c2dc7[_0x6af3('0x59')]=_['intersection'](_0x3c2dc7['model'],_0x3c2dc7['query']);_0x355982[_0x6af3('0x52')]=_[_0x6af3('0x51')](_0x3c2dc7['model'],qs[_0x6af3('0x53')](_0x1051b1[_0x6af3('0x4f')]['fields']));_0x355982[_0x6af3('0x52')]=_0x355982[_0x6af3('0x52')][_0x6af3('0x54')]?_0x355982[_0x6af3('0x52')]:_0x3c2dc7[_0x6af3('0x4d')];if(!_0x1051b1[_0x6af3('0x4f')][_0x6af3('0x71')]('nolimit')){_0x355982[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x1051b1[_0x6af3('0x4f')][_0x6af3('0x21')]);_0x355982[_0x6af3('0x1f')]=qs[_0x6af3('0x1f')](_0x1051b1['query'][_0x6af3('0x1f')]);}_0x355982[_0x6af3('0x56')]=qs['sort'](_0x1051b1[_0x6af3('0x4f')][_0x6af3('0x57')]);_0x355982[_0x6af3('0x58')]=qs['filters'](_[_0x6af3('0x72')](_0x1051b1[_0x6af3('0x4f')],_0x3c2dc7[_0x6af3('0x59')]));_0x355982[_0x6af3('0x58')][_0x6af3('0x6c')]=_0x25f07e['id'];if(_0x1051b1[_0x6af3('0x4f')]['filter']){_0x355982[_0x6af3('0x58')]=_[_0x6af3('0x5b')](_0x355982['where'],{'$or':_[_0x6af3('0x47')](_0x355982[_0x6af3('0x52')],function(_0x4164be){var _0x5ea9bc={};_0x5ea9bc[_0x4164be]={'$like':'%'+_0x1051b1[_0x6af3('0x4f')]['filter']+'%'};return _0x5ea9bc;})});}_0x355982=_[_0x6af3('0x5b')]({},_0x355982,_0x1051b1['options']);return db[_0x6af3('0x6d')]['count']({'where':_0x355982['where']})[_0x6af3('0x24')](function(_0x198999){_0x3f22cf[_0x6af3('0x22')]=_0x198999;if(_0x1051b1[_0x6af3('0x4f')][_0x6af3('0x5d')]){_0x355982[_0x6af3('0x62')]=[{'all':!![]}];}return db[_0x6af3('0x6d')][_0x6af3('0x5e')](_0x355982);})['then'](function(_0x53ffd3){_0x3f22cf['rows']=_0x53ffd3;return _0x3f22cf;});}})[_0x6af3('0x24')](respondWithFilteredResult(_0x50f596,_0x355982))[_0x6af3('0x6f')](handleError(_0x50f596,null));};exports[_0x6af3('0x73')]=function(_0x3d0bcb,_0x1cc96b){return db[_0x6af3('0x48')]['find']({'where':{'id':_0x3d0bcb[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x1cc96b,null))[_0x6af3('0x24')](function(_0x272093){if(_0x272093){return _0x272093[_0x6af3('0x73')](_0x3d0bcb[_0x6af3('0x4f')]['ids']);}})[_0x6af3('0x24')](respondWithStatusCode(_0x1cc96b,null))['catch'](handleError(_0x1cc96b,null));};exports[_0x6af3('0x74')]=function(_0x242cd3,_0x4fbf3e){if(_0x242cd3[_0x6af3('0x66')]['id']){delete _0x242cd3[_0x6af3('0x66')]['id'];}return db[_0x6af3('0x48')][_0x6af3('0x64')]({'where':{'id':_0x242cd3[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x4fbf3e,null))[_0x6af3('0x24')](function(_0x3cd4d2){if(_0x3cd4d2){_0x242cd3[_0x6af3('0x66')][_0x6af3('0x6c')]=_0x3cd4d2['id'];return db['CannedAnswer'][_0x6af3('0x6e')](_0x242cd3[_0x6af3('0x66')]);}})[_0x6af3('0x24')](respondWithResult(_0x4fbf3e,null))[_0x6af3('0x6f')](handleError(_0x4fbf3e,null));};exports[_0x6af3('0x75')]=function(_0x187407,_0x40a257){var _0x5f3289={'raw':![],'where':{}};var _0x2587a8={};var _0x3b5232={'count':0x0,'rows':[]};return db[_0x6af3('0x48')]['findOne']({'where':{'id':_0x187407[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x40a257,null))[_0x6af3('0x24')](function(_0x55d7c1){if(_0x55d7c1){_0x2587a8['model']=_['keys'](db[_0x6af3('0x76')][_0x6af3('0x49')]);_0x2587a8['query']=_[_0x6af3('0x50')](_0x187407['query']);_0x2587a8['filters']=_[_0x6af3('0x51')](_0x2587a8[_0x6af3('0x4d')],_0x2587a8[_0x6af3('0x4f')]);_0x5f3289[_0x6af3('0x52')]=_[_0x6af3('0x51')](_0x2587a8['model'],qs[_0x6af3('0x53')](_0x187407[_0x6af3('0x4f')][_0x6af3('0x53')]));_0x5f3289['attributes']=_0x5f3289[_0x6af3('0x52')]['length']?_0x5f3289[_0x6af3('0x52')]:_0x2587a8[_0x6af3('0x4d')];if(!_0x187407[_0x6af3('0x4f')][_0x6af3('0x71')](_0x6af3('0x55'))){_0x5f3289[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x187407[_0x6af3('0x4f')]['limit']);_0x5f3289[_0x6af3('0x1f')]=qs[_0x6af3('0x1f')](_0x187407['query']['offset']);}_0x5f3289[_0x6af3('0x56')]=qs['sort'](_0x187407[_0x6af3('0x4f')][_0x6af3('0x57')]);_0x5f3289[_0x6af3('0x58')]=qs[_0x6af3('0x59')](_['pick'](_0x187407[_0x6af3('0x4f')],_0x2587a8[_0x6af3('0x59')]));_0x5f3289[_0x6af3('0x58')][_0x6af3('0x6c')]=_0x55d7c1['id'];if(_0x187407['query']['filter']){_0x5f3289[_0x6af3('0x58')]=_[_0x6af3('0x5b')](_0x5f3289[_0x6af3('0x58')],{'$or':_[_0x6af3('0x47')](_0x5f3289['attributes'],function(_0x19aac0){var _0x48b49b={};_0x48b49b[_0x19aac0]={'$like':'%'+_0x187407[_0x6af3('0x4f')]['filter']+'%'};return _0x48b49b;})});}_0x5f3289=_[_0x6af3('0x5b')]({},_0x5f3289,_0x187407['options']);return db[_0x6af3('0x76')][_0x6af3('0x22')]({'where':_0x5f3289['where']})[_0x6af3('0x24')](function(_0xa17bb9){_0x3b5232[_0x6af3('0x22')]=_0xa17bb9;if(_0x187407['query'][_0x6af3('0x5d')]){_0x5f3289[_0x6af3('0x62')]=[{'all':!![]}];}return db[_0x6af3('0x76')]['findAll'](_0x5f3289);})[_0x6af3('0x24')](function(_0x29a745){_0x3b5232[_0x6af3('0x5f')]=_0x29a745;return _0x3b5232;});}})[_0x6af3('0x24')](respondWithFilteredResult(_0x40a257,_0x5f3289))[_0x6af3('0x6f')](handleError(_0x40a257,null));};exports[_0x6af3('0x77')]=function(_0x45ed5f,_0x13f0f5){return db[_0x6af3('0x48')][_0x6af3('0x64')]({'where':{'id':_0x45ed5f[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x13f0f5,null))[_0x6af3('0x24')](function(_0x1b260d){if(_0x1b260d){return _0x1b260d[_0x6af3('0x77')](_0x45ed5f['query']['ids']);}})[_0x6af3('0x24')](respondWithStatusCode(_0x13f0f5,null))['catch'](handleError(_0x13f0f5,null));};exports[_0x6af3('0x6e')]=function(_0xa0f7ba,_0x23a0dd){var _0x2cede5={'name':_0xa0f7ba[_0x6af3('0x66')][_0x6af3('0x4e')],'key':_0xa0f7ba[_0x6af3('0x66')][_0x6af3('0x4c')],'provider':_0xa0f7ba['body'][_0x6af3('0x67')]==='custom'?null:_0xa0f7ba[_0x6af3('0x66')][_0x6af3('0x67')],'email':_0xa0f7ba[_0x6af3('0x66')][_0x6af3('0x78')],'ListId':_0xa0f7ba[_0x6af3('0x66')][_0x6af3('0x79')],'active':!_[_0x6af3('0x7a')](_0xa0f7ba[_0x6af3('0x66')]['active'])?_0xa0f7ba['body'][_0x6af3('0x7b')]:!![],'description':_0xa0f7ba[_0x6af3('0x66')]['description']||null};var _0x591be5=getAuthenticationOptions(_0x2cede5[_0x6af3('0x67')],_0xa0f7ba['body']);_0x2cede5['Imap']=_0x591be5[_0x6af3('0x41')];_0x2cede5[_0x6af3('0x42')]=_0x591be5['Smtp'];return db[_0x6af3('0x48')][_0x6af3('0x6e')](_0x2cede5,{'include':[{'model':db['MailServerOut'],'as':_0x6af3('0x42')},{'model':db['MailServerIn'],'as':_0x6af3('0x41')}]})[_0x6af3('0x24')](function(_0x1d646e){var _0x30ff8d=_0xa0f7ba[_0x6af3('0x37')][_0x6af3('0x25')]({'plain':!![]});if(!_0x30ff8d)throw new Error(_0x6af3('0x7c'));if(_0x30ff8d[_0x6af3('0x7d')]===_0x6af3('0x37')){var _0x3b7909=_0x1d646e[_0x6af3('0x25')]({'plain':!![]});return db[_0x6af3('0x7e')]['find']({'where':{'name':_0x6af3('0x7f'),'userProfileId':_0x30ff8d[_0x6af3('0x80')]},'raw':!![]})[_0x6af3('0x24')](function(_0x45b369){if(_0x45b369&&_0x45b369['autoAssociation']===0x0){return db[_0x6af3('0x26')][_0x6af3('0x6e')]({'name':_0x3b7909[_0x6af3('0x4e')],'resourceId':_0x3b7909['id'],'type':_0x45b369[_0x6af3('0x4e')],'sectionId':_0x45b369['id']},{})[_0x6af3('0x24')](function(){return _0x1d646e;});}else{return _0x1d646e;}})[_0x6af3('0x6f')](function(_0x4ee03f){logger[_0x6af3('0x18')](_0x6af3('0x81'),_0x4ee03f);throw _0x4ee03f;});}return _0x1d646e;})[_0x6af3('0x24')](respondWithResult(_0x23a0dd,0xc9))['catch'](handleError(_0x23a0dd,null));};exports[_0x6af3('0x82')]=function(_0x41a342,_0x34917a){return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x41a342['params']['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x34917a,null))[_0x6af3('0x24')](function(_0x4624ad){if(_0x4624ad){return _0x4624ad[_0x6af3('0x82')]();}return null;})[_0x6af3('0x24')](respondWithResult(_0x34917a,null))[_0x6af3('0x6f')](handleError(_0x34917a,null));};exports[_0x6af3('0x83')]=function(_0xb447a7,_0x529103){if(_0xb447a7[_0x6af3('0x66')]['id']){delete _0xb447a7[_0x6af3('0x66')]['id'];}return db[_0x6af3('0x48')][_0x6af3('0x64')]({'where':{'id':_0xb447a7['params']['id']}})['then'](handleEntityNotFound(_0x529103,null))[_0x6af3('0x24')](function(_0x10f046){if(_0x10f046){_0xb447a7['body'][_0x6af3('0x6c')]=_0x10f046['id'];return db[_0x6af3('0x44')][_0x6af3('0x6e')](_0xb447a7[_0x6af3('0x66')]);}})[_0x6af3('0x24')](respondWithResult(_0x529103,null))['catch'](handleError(_0x529103,null));};exports[_0x6af3('0x84')]=function(_0x2c937e,_0x13b96d){return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x2c937e[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x13b96d,null))[_0x6af3('0x24')](function(_0x465eb1){if(_0x465eb1){return _0x465eb1[_0x6af3('0x85')](null);}return null;})[_0x6af3('0x24')](respondWithStatusCode(_0x13b96d,null))[_0x6af3('0x6f')](handleError(_0x13b96d,null));};exports[_0x6af3('0x86')]=function(_0x32d191,_0x4c4f5b){return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x32d191[_0x6af3('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c4f5b,null))[_0x6af3('0x24')](function(_0x4e355a){if(_0x4e355a){return _0x4e355a[_0x6af3('0x86')]();}return null;})[_0x6af3('0x24')](respondWithResult(_0x4c4f5b,null))['catch'](handleError(_0x4c4f5b,null));};exports[_0x6af3('0x87')]=function(_0x209743,_0x28bb9f){if(_0x209743[_0x6af3('0x66')]['id']){delete _0x209743[_0x6af3('0x66')]['id'];}return db['MailAccount'][_0x6af3('0x64')]({'where':{'id':_0x209743['params']['id']}})['then'](handleEntityNotFound(_0x28bb9f,null))[_0x6af3('0x24')](function(_0x38c58e){if(_0x38c58e){_0x209743['body'][_0x6af3('0x6c')]=_0x38c58e['id'];return db['MailServerOut']['create'](_0x209743[_0x6af3('0x66')]);}})[_0x6af3('0x24')](respondWithResult(_0x28bb9f,null))[_0x6af3('0x6f')](handleError(_0x28bb9f,null));};exports[_0x6af3('0x88')]=function(_0x2c2574,_0x3ea361){return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x2c2574[_0x6af3('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ea361,null))[_0x6af3('0x24')](function(_0x500300){if(_0x500300){return _0x500300[_0x6af3('0x89')](null);}return null;})['then'](respondWithStatusCode(_0x3ea361,null))[_0x6af3('0x6f')](handleError(_0x3ea361,null));};exports[_0x6af3('0x8a')]=function(_0xc412f2,_0x3c4857){return db[_0x6af3('0x8b')][_0x6af3('0x64')]({'where':{'id':_0xc412f2[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x3c4857,null))['then'](function(_0x24d040){if(_0x24d040){return _0x24d040[_0x6af3('0x8a')](_0xc412f2[_0x6af3('0x66')][_0x6af3('0x8c')],_[_0x6af3('0x8d')](_0xc412f2['body'],[_0x6af3('0x8c'),'id'])||{});}})[_0x6af3('0x24')](respondWithResult(_0x3c4857,null))['catch'](handleError(_0x3c4857,null));};exports[_0x6af3('0x8e')]=function(_0xddbee5,_0x5d12aa){var _0x17beb7={'raw':![],'where':{}};var _0x15e634={};var _0x119868={'count':0x0,'rows':[]};return db['MailAccount'][_0x6af3('0x70')]({'where':{'id':_0xddbee5[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x5d12aa,null))[_0x6af3('0x24')](function(_0x1321bb){if(_0x1321bb){_0x15e634['model']=_[_0x6af3('0x50')](db[_0x6af3('0x8b')]['rawAttributes']);_0x15e634[_0x6af3('0x4f')]=_['keys'](_0xddbee5[_0x6af3('0x4f')]);_0x15e634[_0x6af3('0x59')]=_[_0x6af3('0x51')](_0x15e634[_0x6af3('0x4d')],_0x15e634['query']);_0x17beb7[_0x6af3('0x52')]=_['intersection'](_0x15e634[_0x6af3('0x4d')],qs['fields'](_0xddbee5['query'][_0x6af3('0x53')]));_0x17beb7[_0x6af3('0x52')]=_0x17beb7[_0x6af3('0x52')][_0x6af3('0x54')]?_0x17beb7[_0x6af3('0x52')]:_0x15e634[_0x6af3('0x4d')];if(!_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x71')]('nolimit')){_0x17beb7[_0x6af3('0x21')]=qs['limit'](_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x21')]);_0x17beb7['offset']=qs[_0x6af3('0x1f')](_0xddbee5['query'][_0x6af3('0x1f')]);}_0x17beb7[_0x6af3('0x56')]=qs[_0x6af3('0x57')](_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x57')]);_0x17beb7[_0x6af3('0x58')]=qs[_0x6af3('0x59')](_[_0x6af3('0x72')](_0xddbee5['query'],_0x15e634[_0x6af3('0x59')]));_0x17beb7[_0x6af3('0x58')][_0x6af3('0x6c')]=_0x1321bb['id'];if(_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x5a')]){_0x17beb7[_0x6af3('0x58')]=_['merge'](_0x17beb7[_0x6af3('0x58')],{'$or':_[_0x6af3('0x47')](_0x17beb7[_0x6af3('0x52')],function(_0x54a54c){var _0x2842c4={};_0x2842c4[_0x54a54c]={'$like':'%'+_0xddbee5['query']['filter']+'%'};return _0x2842c4;})});}_0x17beb7=_['merge']({},_0x17beb7,_0xddbee5['options']);return db[_0x6af3('0x8b')][_0x6af3('0x22')]({'where':_0x17beb7[_0x6af3('0x58')]})[_0x6af3('0x24')](function(_0x3a4164){_0x119868[_0x6af3('0x22')]=_0x3a4164;if(_0xddbee5['query']['includeAll']){_0x17beb7[_0x6af3('0x62')]=[{'model':db[_0x6af3('0x8f')],'as':_0x6af3('0x90'),'required':![]},{'model':db['User'],'as':_0x6af3('0x91'),'attributes':[_0x6af3('0x4e'),'fullname',_0x6af3('0x92')],'required':![]},{'model':db['Tag'],'as':_0x6af3('0x93'),'attributes':['id','name',_0x6af3('0x94')],'where':_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x95')]?{'id':_0xddbee5['query'][_0x6af3('0x95')]}:undefined,'required':_0xddbee5[_0x6af3('0x4f')][_0x6af3('0x95')]?!![]:![]}];}return db[_0x6af3('0x8b')][_0x6af3('0x5e')](_0x17beb7);})[_0x6af3('0x24')](function(_0x3669cb){_0x119868[_0x6af3('0x5f')]=_0x3669cb;return _0x119868;});}})[_0x6af3('0x24')](respondWithFilteredResult(_0x5d12aa,_0x17beb7))[_0x6af3('0x6f')](handleError(_0x5d12aa,null));};exports[_0x6af3('0x96')]=function addApplications(_0x4f19ff,_0x6f89b2){var _0x231c0a=_0x4f19ff[_0x6af3('0x60')]['id'];var _0x3a3fde=_0x4f19ff[_0x6af3('0x66')];var _0x1d4568=0xc8;var _0x3215b6=null;return db['sequelize'][_0x6af3('0x97')]({'isolationLevel':db[_0x6af3('0x98')][_0x6af3('0x99')]['ISOLATION_LEVELS'][_0x6af3('0x9a')]},function(_0x5d3eb8){return db['MailAccount'][_0x6af3('0x70')]({'where':{'id':_0x231c0a},'transaction':_0x5d3eb8})['then'](function(_0x285c96){if(_0x285c96){return db[_0x6af3('0x9b')][_0x6af3('0x27')]({'where':{'MailAccountId':_0x231c0a},'transaction':_0x5d3eb8})[_0x6af3('0x24')](function(){var _0xe1f3db=_[_0x6af3('0x47')](_0x3a3fde,function(_0x53c2e1){_0x53c2e1[_0x6af3('0x6c')]=_0x231c0a;return _0x53c2e1;});return db[_0x6af3('0x9b')]['bulkCreate'](_0xe1f3db,{'transaction':_0x5d3eb8});});}else{_0x1d4568=0x194;_0x3215b6=[];}});})[_0x6af3('0x24')](function(){if(_0x1d4568!==0x194){return db[_0x6af3('0x9b')][_0x6af3('0x9c')]({'where':{'MailAccountId':_0x231c0a},'order':_0x6af3('0x9d')})[_0x6af3('0x24')](function(_0x41ef17){_0x3215b6=_0x41ef17;});}})[_0x6af3('0x6f')](function(_0x2b127a){_0x1d4568=0x1f4;logger['error'](_0x2b127a['stack']);if(_0x2b127a[_0x6af3('0x4e')]){delete _0x2b127a[_0x6af3('0x4e')];}_0x3215b6=_0x2b127a;})['finally'](function(){if(_0x3215b6===null){_0x6f89b2['sendStatus'](_0x1d4568);}else{if(_0x1d4568===0x1f4){_0x6f89b2[_0x6af3('0x1d')](_0x1d4568)['send'](_0x3215b6);}else{_0x6f89b2[_0x6af3('0x1d')](_0x1d4568)[_0x6af3('0x1e')](_0x3215b6);}}});};exports[_0x6af3('0x9e')]=function(_0x28494f,_0x45234d){var _0x4e85fb={};var _0x593403={};var _0x17f80a;var _0x21b809;return db['MailAccount']['findOne']({'where':{'id':_0x28494f[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x45234d,null))[_0x6af3('0x24')](function(_0x5b3f27){if(_0x5b3f27){_0x17f80a=_0x5b3f27;_0x593403[_0x6af3('0x4d')]=_[_0x6af3('0x50')](db[_0x6af3('0x9b')]['rawAttributes']);_0x593403['query']=_[_0x6af3('0x50')](_0x28494f[_0x6af3('0x4f')]);_0x593403[_0x6af3('0x59')]=_[_0x6af3('0x51')](_0x593403[_0x6af3('0x4d')],_0x593403['query']);_0x4e85fb['attributes']=_[_0x6af3('0x51')](_0x593403[_0x6af3('0x4d')],qs[_0x6af3('0x53')](_0x28494f['query']['fields']));_0x4e85fb[_0x6af3('0x52')]=_0x4e85fb[_0x6af3('0x52')][_0x6af3('0x54')]?_0x4e85fb[_0x6af3('0x52')]:_0x593403[_0x6af3('0x4d')];_0x4e85fb[_0x6af3('0x56')]=qs[_0x6af3('0x57')](_0x28494f[_0x6af3('0x4f')][_0x6af3('0x57')]);_0x4e85fb[_0x6af3('0x58')]=qs[_0x6af3('0x59')](_[_0x6af3('0x72')](_0x28494f[_0x6af3('0x4f')],_0x593403[_0x6af3('0x59')]));if(_0x28494f[_0x6af3('0x4f')]['filter']){_0x4e85fb['where']=_[_0x6af3('0x5b')](_0x4e85fb[_0x6af3('0x58')],{'$or':_[_0x6af3('0x47')](_0x4e85fb['attributes'],function(_0x4567c7){var _0x283fa1={};_0x283fa1[_0x4567c7]={'$like':'%'+_0x28494f[_0x6af3('0x4f')][_0x6af3('0x5a')]+'%'};return _0x283fa1;})});}_0x4e85fb=_[_0x6af3('0x5b')]({},_0x4e85fb,_0x28494f['options']);return _0x17f80a[_0x6af3('0x9e')](_0x4e85fb);}})[_0x6af3('0x24')](function(_0x240030){if(_0x240030){_0x21b809=_0x240030[_0x6af3('0x54')];if(!_0x28494f[_0x6af3('0x4f')][_0x6af3('0x71')](_0x6af3('0x55'))){_0x4e85fb[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x28494f[_0x6af3('0x4f')][_0x6af3('0x21')]);_0x4e85fb[_0x6af3('0x1f')]=qs[_0x6af3('0x1f')](_0x28494f[_0x6af3('0x4f')]['offset']);}return _0x17f80a[_0x6af3('0x9e')](_0x4e85fb);}})[_0x6af3('0x24')](function(_0x3f2f47){if(_0x3f2f47){return _0x3f2f47?{'count':_0x21b809,'rows':_0x3f2f47}:null;}})['then'](respondWithResult(_0x45234d,null))[_0x6af3('0x6f')](handleError(_0x45234d,null));};exports['getMessages']=function(_0x36aaa8,_0x349935){var _0x4186bd={'raw':!![],'where':{}};var _0x3b601e={};var _0x53ce80={'count':0x0,'rows':[]};return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x36aaa8[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x349935,null))['then'](function(_0x16c7b2){if(_0x16c7b2){_0x3b601e[_0x6af3('0x4d')]=_[_0x6af3('0x50')](db[_0x6af3('0x9f')][_0x6af3('0x49')]);_0x3b601e[_0x6af3('0x4f')]=_[_0x6af3('0x50')](_0x36aaa8[_0x6af3('0x4f')]);_0x3b601e['filters']=_['intersection'](_0x3b601e[_0x6af3('0x4d')],_0x3b601e[_0x6af3('0x4f')]);_0x4186bd[_0x6af3('0x52')]=_[_0x6af3('0x51')](_0x3b601e[_0x6af3('0x4d')],qs[_0x6af3('0x53')](_0x36aaa8['query'][_0x6af3('0x53')]));_0x4186bd[_0x6af3('0x52')]=_0x4186bd[_0x6af3('0x52')]['length']?_0x4186bd[_0x6af3('0x52')]:_0x3b601e['model'];if(!_0x36aaa8['query']['hasOwnProperty'](_0x6af3('0x55'))){_0x4186bd[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x36aaa8[_0x6af3('0x4f')]['limit']);_0x4186bd['offset']=qs[_0x6af3('0x1f')](_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0x1f')]);}_0x4186bd[_0x6af3('0x56')]=qs[_0x6af3('0x57')](_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0x57')]);_0x4186bd[_0x6af3('0x58')]=qs[_0x6af3('0x59')](_['pick'](_0x36aaa8[_0x6af3('0x4f')],_0x3b601e[_0x6af3('0x59')]));_0x4186bd['where']['MailAccountId']=_0x16c7b2['id'];if(_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0x5a')]){_0x4186bd[_0x6af3('0x58')]=_[_0x6af3('0x5b')](_0x4186bd[_0x6af3('0x58')],{'$or':_['map'](_0x4186bd[_0x6af3('0x52')],function(_0x30c078){var _0x3964ad={};_0x3964ad[_0x30c078]={'$like':'%'+_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0x5a')]+'%'};return _0x3964ad;})});}if(_0x36aaa8['query']['$gte']){var _0x457d1d=_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0xa0')]['split'](',');var _0x19faa4={};_0x19faa4[_0x457d1d[0x0]]={'$gte':moment(_0x457d1d[0x1])[_0x6af3('0xa1')](_0x6af3('0xa2'))};_0x4186bd['where']=_['merge'](_0x4186bd[_0x6af3('0x58')],_0x19faa4);}_0x4186bd=_[_0x6af3('0x5b')]({},_0x4186bd,_0x36aaa8[_0x6af3('0x63')]);return db[_0x6af3('0x9f')]['count']({'where':_0x4186bd[_0x6af3('0x58')]})['then'](function(_0x4995e1){_0x53ce80['count']=_0x4995e1;if(_0x36aaa8['query'][_0x6af3('0x5d')]){_0x4186bd[_0x6af3('0x62')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4186bd);})[_0x6af3('0x24')](function(_0x3daf9f){if(_0x36aaa8[_0x6af3('0x4f')][_0x6af3('0xa3')]===_0x6af3('0xa4')){for(var _0x1c41c4=0x0;_0x1c41c4<_0x3daf9f['length'];_0x1c41c4++){_0x3daf9f[_0x1c41c4][_0x6af3('0x66')]=juice(_0x3daf9f[_0x1c41c4]['body']);}}_0x53ce80['rows']=_0x3daf9f;return _0x53ce80;});}})['then'](respondWithFilteredResult(_0x349935,_0x4186bd))['catch'](handleError(_0x349935,null));};exports[_0x6af3('0x29')]=function(_0x2212b2,_0x5e376b){var _0x5eda44,_0x3ab053={},_0x540258;if(_0x2212b2[_0x6af3('0x66')]['to']){_0x540258=_0x2212b2[_0x6af3('0x66')]['to'][_0x6af3('0xa5')](',')[0x0];}return db[_0x6af3('0x48')][_0x6af3('0x64')]({'where':{'id':_0x2212b2[_0x6af3('0x60')]['id']},'include':[{'model':db[_0x6af3('0xa6')],'as':_0x6af3('0xa7'),'include':[{'model':db[_0x6af3('0x8f')],'as':_0x6af3('0xa8'),'where':{'email':_0x540258},'limit':0x1,'order':[[_0x6af3('0xa9'),'DESC']]}]},{'model':db[_0x6af3('0x45')],'as':_0x6af3('0x42'),'raw':!![],'include':[{'model':db[_0x6af3('0xaa')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x5e376b,null))[_0x6af3('0x24')](function(_0x2efbed){if(!_0x2efbed)return;_0x5eda44=_0x2efbed;if(!_0x2efbed[_0x6af3('0x42')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x6af3('0x7a')](_0x2212b2[_0x6af3('0x66')][_0x6af3('0xab')])){_0x2212b2[_0x6af3('0x66')][_0x6af3('0xab')]=util['format'](_0x6af3('0xac'),_0x2efbed[_0x6af3('0x4e')],_0x2efbed[_0x6af3('0x78')]||_0x2efbed[_0x6af3('0x42')][_0x6af3('0x37')]);}if(_0x2212b2[_0x6af3('0x66')]['attachments']&&_0x2212b2[_0x6af3('0x66')][_0x6af3('0xad')][_0x6af3('0x54')]){for(var _0x5ce9b5=0x0;_0x5ce9b5<_0x2212b2[_0x6af3('0x66')]['attachments'][_0x6af3('0x54')];_0x5ce9b5+=0x1){_0x2212b2['body'][_0x6af3('0xad')][_0x5ce9b5]={'filename':_0x2212b2[_0x6af3('0x66')][_0x6af3('0xad')][_0x5ce9b5][_0x6af3('0x4e')],'path':path[_0x6af3('0xae')](config[_0x6af3('0xaf')],_0x6af3('0xb0'),_0x2212b2[_0x6af3('0x66')]['attachments'][_0x5ce9b5][_0x6af3('0xb1')])};}}var _0x31938f=_0x2efbed['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x6af3('0xb2'),{'account':_0x31938f,'message':_0x2212b2[_0x6af3('0x66')]});})[_0x6af3('0x24')](function(_0x2cf2c1){if(!_0x2cf2c1)return;_0x3ab053=_0x2cf2c1;if(!_0x5eda44[_0x6af3('0xa7')])throw new Error(_0x6af3('0xb3'));if(_0x5eda44[_0x6af3('0xa7')][_0x6af3('0xa8')][_0x6af3('0x54')])return _0x5eda44['List']['Contacts'][0x0];return db['CmContact'][_0x6af3('0x6e')](_[_0x6af3('0xc')](_0x2212b2[_0x6af3('0x66')],{'firstName':_0x2212b2[_0x6af3('0x66')]['to'],'email':_0x2212b2['body']['to'],'phone':_0x2212b2['body']['to'],'ListId':_0x5eda44[_0x6af3('0x79')]}));})[_0x6af3('0x24')](function(_0x45f6c2){if(!_0x45f6c2)return;var _0x1117a2={'UserId':_0x2212b2['user']['id'],'ContactId':_0x45f6c2['id'],'MailAccountId':_0x5eda44['id'],'inReplyTo':_0x3ab053[_0x6af3('0xb4')],'to':_0x2212b2[_0x6af3('0x66')]['from'],'cc':_0x2212b2[_0x6af3('0x66')]['cc'],'subject':_0x2212b2[_0x6af3('0x66')]['subject'],'attach':_0x2212b2[_0x6af3('0x66')]['attach'],'firstMsgDirection':_0x6af3('0xb5'),'lastMsgAt':moment()[_0x6af3('0xa1')](_0x6af3('0xa2')),'lastMsgDirection':'out','Messages':[_[_0x6af3('0x5b')](_0x2212b2[_0x6af3('0x66')],{'messageId':_0x3ab053[_0x6af3('0xb4')],'sentAt':moment()['format'](_0x6af3('0xa2')),'read':!![],'MailAccountId':_0x5eda44['id'],'UserId':_0x2212b2[_0x6af3('0x37')]['id'],'ContactId':_0x45f6c2['id']})]};if(_0x2212b2[_0x6af3('0x66')][_0x6af3('0xb6')]){_0x1117a2=_['merge'](_0x1117a2,_0x2212b2[_0x6af3('0x66')]['Interaction']);}return db[_0x6af3('0x8b')][_0x6af3('0x6e')](_0x1117a2,{'include':[{'model':db[_0x6af3('0x9f')],'as':'Messages'}]});})[_0x6af3('0x24')](respondWithResult(_0x5e376b,null))[_0x6af3('0x6f')](handleError(_0x5e376b,null));};exports['verifySmtp']=function(_0x40c0db,_0x14a69e){return db['MailAccount'][_0x6af3('0x64')]({'where':{'id':_0x40c0db[_0x6af3('0x60')]['id']},'include':[{'model':db[_0x6af3('0x45')],'as':_0x6af3('0x42'),'raw':!![],'include':[{'model':db[_0x6af3('0xaa')],'as':_0x6af3('0xaa'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x14a69e,null))['then'](function(_0x5c5716){if(!_0x5c5716[_0x6af3('0x42')])return;var _0x4564d2=_0x5c5716[_0x6af3('0xb7')]();return respondWithRpcPromise(_0x6af3('0xb8'),_0x6af3('0xb9'),{'account':_0x4564d2});})[_0x6af3('0x24')](respondWithResult(_0x14a69e,null))[_0x6af3('0x6f')](handleError(_0x14a69e,null));};exports[_0x6af3('0x27')]=function(_0x85a9d3,_0x5ca748){return db[_0x6af3('0x48')][_0x6af3('0x64')]({'where':{'id':_0x85a9d3['params']['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x5ca748,null))[_0x6af3('0x24')](function(_0x48c2c4){if(_0x48c2c4&&_0x48c2c4[_0x6af3('0x6a')]){throw new db[(_0x6af3('0xba'))][(_0x6af3('0xbb'))](_0x6af3('0xbc'));}return _0x48c2c4;})['then'](removeEntity(_0x5ca748,null))[_0x6af3('0x6f')](handleError(_0x5ca748,null));};exports[_0x6af3('0xbd')]=function(_0x34cd87,_0x559110){return db[_0x6af3('0x48')]['find']({'where':{'id':_0x34cd87[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x559110,null))['then'](function(_0x502013){if(_0x502013){return _0x502013[_0x6af3('0xbd')](_0x34cd87['body'][_0x6af3('0x8c')],_[_0x6af3('0x8d')](_0x34cd87['body'],['ids','id'])||{})[_0x6af3('0xbe')](function(_0x7ce377){for(var _0x39f78e=0x0;_0x39f78e<_0x34cd87[_0x6af3('0x66')][_0x6af3('0x8c')][_0x6af3('0x54')];_0x39f78e+=0x1){socket[_0x6af3('0xbf')](_0x6af3('0xc0'),{'UserId':Number(_0x34cd87[_0x6af3('0x66')][_0x6af3('0x8c')][_0x39f78e]),'MailAccountId':Number(_0x34cd87[_0x6af3('0x60')]['id'])});}return _0x7ce377;});}})[_0x6af3('0x24')](respondWithResult(_0x559110,null))[_0x6af3('0x6f')](handleError(_0x559110,null));};exports[_0x6af3('0xc1')]=function(_0x10cf68,_0xfc9af0){return db[_0x6af3('0x48')]['find']({'where':{'id':_0x10cf68['params']['id']}})['then'](handleEntityNotFound(_0xfc9af0,null))[_0x6af3('0x24')](function(_0x5cebe4){if(_0x5cebe4){return _0x5cebe4[_0x6af3('0xc1')](_0x10cf68[_0x6af3('0x4f')][_0x6af3('0x8c')])[_0x6af3('0x24')](function(){if(_[_0x6af3('0xc2')](_0x10cf68[_0x6af3('0x4f')][_0x6af3('0x8c')])){for(var _0x49e581=0x0;_0x49e581<_0x10cf68['query']['ids'][_0x6af3('0x54')];_0x49e581+=0x1){socket['emit'](_0x6af3('0xc3'),{'UserId':Number(_0x10cf68[_0x6af3('0x4f')]['ids'][_0x49e581]),'MailAccountId':Number(_0x10cf68[_0x6af3('0x60')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x10cf68[_0x6af3('0x4f')][_0x6af3('0x8c')]),'MailAccountId':Number(_0x10cf68[_0x6af3('0x60')]['id'])});}});}})[_0x6af3('0x24')](respondWithStatusCode(_0xfc9af0,null))[_0x6af3('0x6f')](handleError(_0xfc9af0,null));};exports[_0x6af3('0xc4')]=function(_0x562879,_0x1a8d58){var _0x2afef5={};var _0x2720d2={};var _0x1de472;var _0x3431ca;return db[_0x6af3('0x48')][_0x6af3('0x70')]({'where':{'id':_0x562879[_0x6af3('0x60')]['id']}})[_0x6af3('0x24')](handleEntityNotFound(_0x1a8d58,null))[_0x6af3('0x24')](function(_0x4beeb5){if(_0x4beeb5){_0x1de472=_0x4beeb5;_0x2720d2[_0x6af3('0x4d')]=_[_0x6af3('0x50')](db[_0x6af3('0xc5')][_0x6af3('0x49')]);_0x2720d2[_0x6af3('0x4f')]=_[_0x6af3('0x50')](_0x562879[_0x6af3('0x4f')]);_0x2720d2[_0x6af3('0x59')]=_['intersection'](_0x2720d2['model'],_0x2720d2[_0x6af3('0x4f')]);_0x2afef5['attributes']=_[_0x6af3('0x51')](_0x2720d2[_0x6af3('0x4d')],qs[_0x6af3('0x53')](_0x562879[_0x6af3('0x4f')][_0x6af3('0x53')]));_0x2afef5[_0x6af3('0x52')]=_0x2afef5[_0x6af3('0x52')]['length']?_0x2afef5[_0x6af3('0x52')]:_0x2720d2[_0x6af3('0x4d')];_0x2afef5[_0x6af3('0x56')]=qs[_0x6af3('0x57')](_0x562879[_0x6af3('0x4f')]['sort']);_0x2afef5[_0x6af3('0x58')]=qs[_0x6af3('0x59')](_[_0x6af3('0x72')](_0x562879['query'],_0x2720d2[_0x6af3('0x59')]));if(_0x562879[_0x6af3('0x4f')]['filter']){_0x2afef5['where']=_[_0x6af3('0x5b')](_0x2afef5[_0x6af3('0x58')],{'$or':_[_0x6af3('0x47')](_0x2afef5[_0x6af3('0x52')],function(_0x12de10){var _0x13aa2a={};_0x13aa2a[_0x12de10]={'$like':'%'+_0x562879['query'][_0x6af3('0x5a')]+'%'};return _0x13aa2a;})});}_0x2afef5=_[_0x6af3('0x5b')]({},_0x2afef5,_0x562879['options']);return _0x1de472[_0x6af3('0xc4')](_0x2afef5);}})['then'](function(_0x55892f){if(_0x55892f){_0x3431ca=_0x55892f[_0x6af3('0x54')];if(!_0x562879[_0x6af3('0x4f')][_0x6af3('0x71')](_0x6af3('0x55'))){_0x2afef5[_0x6af3('0x21')]=qs[_0x6af3('0x21')](_0x562879[_0x6af3('0x4f')][_0x6af3('0x21')]);_0x2afef5['offset']=qs[_0x6af3('0x1f')](_0x562879['query'][_0x6af3('0x1f')]);}return _0x1de472[_0x6af3('0xc4')](_0x2afef5);}})[_0x6af3('0x24')](function(_0x171979){if(_0x171979){return _0x171979?{'count':_0x3431ca,'rows':_0x171979}:null;}})['then'](respondWithResult(_0x1a8d58,null))['catch'](handleError(_0x1a8d58,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index bcbd17a..87c545b 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 _0x414f=['MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x452f62,_0x2b9811){var _0xc72188=function(_0x32efaa){while(--_0x32efaa){_0x452f62['push'](_0x452f62['shift']());}};_0xc72188(++_0x2b9811);}(_0x414f,0x13f));var _0xf414=function(_0x3ee99e,_0x4affec){_0x3ee99e=_0x3ee99e-0x0;var _0x1b56e1=_0x414f[_0x3ee99e];return _0x1b56e1;};'use strict';var EventEmitter=require(_0xf414('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xf414('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf414('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf414('0x3'),'afterDestroy':_0xf414('0x4')};function emitEvent(_0x26a3b2){return function(_0x335d3e,_0x29b998,_0x22e5aa){MailAccountEvents[_0xf414('0x5')](_0x26a3b2+':'+_0x335d3e['id'],_0x335d3e);MailAccountEvents['emit'](_0x26a3b2,_0x335d3e);_0x22e5aa(null);};}for(var e in events){if(events[_0xf414('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xf414('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x292c=['hook','exports','events','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4a42f0,_0x2da65d){var _0x3dc532=function(_0xb60cdf){while(--_0xb60cdf){_0x4a42f0['push'](_0x4a42f0['shift']());}};_0x3dc532(++_0x2da65d);}(_0x292c,0x66));var _0xc292=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x292c[_0x18a79d];return _0x4f8848;};'use strict';var EventEmitter=require(_0xc292('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xc292('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc292('0x2')](0x0);var events={'afterCreate':_0xc292('0x3'),'afterUpdate':_0xc292('0x4'),'afterDestroy':_0xc292('0x5')};function emitEvent(_0x50b478){return function(_0x1f14f9,_0x536154,_0x516f54){MailAccountEvents[_0xc292('0x6')](_0x50b478+':'+_0x1f14f9['id'],_0x1f14f9);MailAccountEvents[_0xc292('0x6')](_0x50b478,_0x1f14f9);_0x516f54(null);};}for(var e in events){if(events[_0xc292('0x7')](e)){var event=events[e];MailAccount[_0xc292('0x8')](e,emitEvent(event));}}module[_0xc292('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index fe629c2..71c828e 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 _0x931a=['host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','service'];(function(_0x31341b,_0x533e30){var _0xfc7b19=function(_0x51a1d4){while(--_0x51a1d4){_0x31341b['push'](_0x31341b['shift']());}};_0xfc7b19(++_0x533e30);}(_0x931a,0x1a9));var _0xa931=function(_0x54d13a,_0xe2af58){_0x54d13a=_0x54d13a-0x0;var _0x26dc79=_0x931a[_0x54d13a];return _0x26dc79;};'use strict';var attributes=require(_0xa931('0x0'));module[_0xa931('0x1')]=function(_0x1a14a1){return _0x1a14a1[_0xa931('0x2')](_0xa931('0x3'),attributes,{'tableName':_0xa931('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2ea596=this;var _0x7365a0={'id':_0x2ea596['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2ea596[_0xa931('0x5')]!=='custom'){_0x7365a0[_0xa931('0x6')]=_0x2ea596[_0xa931('0x5')];}else{_0x7365a0[_0xa931('0x7')]=_0x2ea596['Smtp']['host'];_0x7365a0['port']=_0x2ea596[_0xa931('0x8')][_0xa931('0x9')];_0x7365a0[_0xa931('0xa')]=_0x2ea596[_0xa931('0x8')][_0xa931('0xa')];}if(_0x2ea596['Smtp']['authentication']){if(_0x2ea596[_0xa931('0x8')][_0xa931('0xb')]){if(!_0x2ea596[_0xa931('0x8')][_0xa931('0xc')])throw new Error(_0xa931('0xd'));_0x7365a0[_0xa931('0xe')]={'type':'OAuth2','user':_0x2ea596[_0xa931('0x8')][_0xa931('0xf')],'accessToken':_0x2ea596[_0xa931('0x8')][_0xa931('0xc')][_0xa931('0x10')]};}else{_0x7365a0[_0xa931('0xe')]={'user':_0x2ea596[_0xa931('0x8')][_0xa931('0xf')],'pass':_0x2ea596[_0xa931('0x8')][_0xa931('0x11')]};}}return _0x7365a0;}}});}; \ No newline at end of file +var _0xa3c0=['mail_accounts','provider','service','host','port','Smtp','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa3c0,0x7c));var _0x0a3c=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xa3c0[_0x20c9b2];return _0x2c6030;};'use strict';var attributes=require(_0x0a3c('0x0'));module[_0x0a3c('0x1')]=function(_0x2a7d9a){return _0x2a7d9a[_0x0a3c('0x2')](_0x0a3c('0x3'),attributes,{'tableName':_0x0a3c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x289a20=this;var _0xac82a2={'id':_0x289a20['id'],'tls':{'rejectUnauthorized':![]}};if(_0x289a20[_0x0a3c('0x5')]!=='custom'){_0xac82a2[_0x0a3c('0x6')]=_0x289a20[_0x0a3c('0x5')];}else{_0xac82a2[_0x0a3c('0x7')]=_0x289a20['Smtp'][_0x0a3c('0x7')];_0xac82a2[_0x0a3c('0x8')]=_0x289a20[_0x0a3c('0x9')]['port'];_0xac82a2[_0x0a3c('0xa')]=_0x289a20['Smtp'][_0x0a3c('0xa')];}if(_0x289a20['Smtp']['authentication']){if(_0x289a20['Smtp']['modernAuthentication']){if(!_0x289a20[_0x0a3c('0x9')][_0x0a3c('0xb')])throw new Error(_0x0a3c('0xc'));_0xac82a2[_0x0a3c('0xd')]={'type':'OAuth2','user':_0x289a20[_0x0a3c('0x9')][_0x0a3c('0xe')],'accessToken':_0x289a20[_0x0a3c('0x9')][_0x0a3c('0xb')][_0x0a3c('0xf')]};}else{_0xac82a2['auth']={'user':_0x289a20[_0x0a3c('0x9')]['user'],'pass':_0x289a20[_0x0a3c('0x9')]['pass']};}}return _0xac82a2;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 28e4654..57fd6e4 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 _0x5fab=['DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','getSmtpOptions','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','defaults','ListId','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','spread','interaction','get','created','create','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','attributes','limit','include','model','map','ShowMailAccount','find','where','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','updatedAt'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x5fab,0x177));var _0xb5fa=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x5fab[_0x12c34e];return _0x244e88;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5fa('0x2'));var Redis=require(_0xb5fa('0x3'));var db=require(_0xb5fa('0x4'))['db'];var logger=require(_0xb5fa('0x5'))(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var jayson=require(_0xb5fa('0x8'));var client=jayson[_0xb5fa('0x9')][_0xb5fa('0xa')]({'port':0x232c});config[_0xb5fa('0xb')]=_['defaults'](config['redis'],{'host':_0xb5fa('0xc'),'port':0x18eb});var socket=require(_0xb5fa('0xd'))(new Redis(config[_0xb5fa('0xb')]));require('./mailAccount.socket')[_0xb5fa('0xe')](socket);function respondWithRpcPromise(_0x38d9a3,_0x2cf4a5,_0x54c7eb){return new BPromise(function(_0x5b5ea8,_0x3a8e1b){return client[_0xb5fa('0xf')](_0x38d9a3,_0x54c7eb)[_0xb5fa('0x10')](function(_0x44e6c8){logger[_0xb5fa('0x11')](_0xb5fa('0x12'),_0x2cf4a5,_0xb5fa('0x13'));logger[_0xb5fa('0x14')](_0xb5fa('0x15'),_0x2cf4a5,'request\x20sent',JSON[_0xb5fa('0x16')](_0x44e6c8));if(_0x44e6c8[_0xb5fa('0x17')]){if(_0x44e6c8['error'][_0xb5fa('0x18')]===0x1f4){logger['error'](_0xb5fa('0x12'),_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x3a8e1b(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x5b5ea8(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0xb5fa('0x13'));_0x5b5ea8(_0x44e6c8[_0xb5fa('0x1a')][_0xb5fa('0x19')]);}})[_0xb5fa('0x1b')](function(_0x324ba5){logger[_0xb5fa('0x17')](_0xb5fa('0x12'),_0x2cf4a5,_0x324ba5);_0x3a8e1b(_0x324ba5);});});}exports[_0xb5fa('0x1c')]=function(_0xc14dc4){var _0x368cb1=this;return new Promise(function(_0x3c8d53,_0x1f5064){return db['MailAccount'][_0xb5fa('0x1d')]({'raw':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')]['where']||null:null,'attributes':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x1f')]||null:null,'limit':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x20')]||null:null,'include':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4['options'][_0xb5fa('0x21')]?_['map'](_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x22')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x11053a[_0xb5fa('0x21')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes'],'include':_0x568870['include']?_[_0xb5fa('0x23')](_0x568870[_0xb5fa('0x21')],function(_0x12c0d4){return{'model':db[_0x12c0d4[_0xb5fa('0x22')]],'as':_0x12c0d4['as'],'attributes':_0x12c0d4[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x358549){logger[_0xb5fa('0x11')](_0xb5fa('0x1c'),_0xc14dc4);logger[_0xb5fa('0x14')](_0xb5fa('0x1c'),_0xc14dc4,JSON[_0xb5fa('0x16')](_0x358549));_0x3c8d53(_0x358549);})[_0xb5fa('0x1b')](function(_0x1f4380){logger[_0xb5fa('0x17')](_0xb5fa('0x1c'),_0x1f4380[_0xb5fa('0x19')],_0xc14dc4);_0x1f5064(_0x368cb1[_0xb5fa('0x17')](0x1f4,_0x1f4380[_0xb5fa('0x19')]));});});};exports[_0xb5fa('0x24')]=function(_0x291938){var _0x370d95=this;return new Promise(function(_0x10fb43,_0x25fc7c){return db['MailAccount'][_0xb5fa('0x25')]({'raw':_0x291938['options']?_0x291938['options']['raw']===undefined?!![]:![]:!![],'where':_0x291938[_0xb5fa('0x1e')]?_0x291938['options'][_0xb5fa('0x26')]||null:null,'attributes':_0x291938['options']?_0x291938['options'][_0xb5fa('0x1f')]||null:null,'include':_0x291938[_0xb5fa('0x1e')]?_0x291938['options']['include']?_[_0xb5fa('0x23')](_0x291938[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x22')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x23')](_0x560b53[_0xb5fa('0x21')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')],'include':_0x204d6b[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x204d6b['include'],function(_0x117694){return{'model':db[_0x117694[_0xb5fa('0x22')]],'as':_0x117694['as'],'attributes':_0x117694[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x5e7770){if(_0x291938['options']['smtp']===!![])_0x5e7770['setDataValue']('smtpOptions',_0x5e7770['getSmtpOptions']());logger[_0xb5fa('0x11')]('ShowMailAccount',_0x291938);logger[_0xb5fa('0x14')](_0xb5fa('0x24'),_0x291938,JSON[_0xb5fa('0x16')](_0x5e7770));_0x10fb43(_0x5e7770);})[_0xb5fa('0x1b')](function(_0x40c1c0){logger[_0xb5fa('0x17')]('ShowMailAccount',_0x40c1c0['message'],_0x291938);_0x25fc7c(_0x370d95['error'](0x1f4,_0x40c1c0[_0xb5fa('0x19')]));});});};exports['NotifyMailAccount']=function(_0x73d425){var _0x5addd5=this;return new Promise(function(_0x58aa97,_0x3cdf63){var _0x42d331={'body':_0x73d425[_0xb5fa('0x27')],'channel':_0xb5fa('0x28')};var _0x5bc93f=_[_0xb5fa('0x29')](_[_0xb5fa('0x2a')](db[_0xb5fa('0x2b')][_0xb5fa('0x2c')]),[_0xb5fa('0x2d'),'updatedAt',_0xb5fa('0x2e'),'ListId']);var _0x233f90=![];if(_0x73d425[_0xb5fa('0x27')]['id']){delete _0x73d425[_0xb5fa('0x27')]['id'];}if(_[_0xb5fa('0x2f')](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x31')));}if(_['isNil'](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')])||_0x73d425['body'][_0xb5fa('0x27')]===''){return _0x3cdf63(_0x5addd5['error'](0x1f4,_0xb5fa('0x32')));}if(_[_0xb5fa('0x2f')](_0x73d425['body']['mapKey'])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x33')+_0x5bc93f));}if(!_[_0xb5fa('0x34')](_0x5bc93f,_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x36')+_0x5bc93f));}var _0x125a5c={};_0x125a5c[_0x73d425['body'][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')]['from'];return db[_0xb5fa('0x37')][_0xb5fa('0x25')]({'where':{'id':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x39')],'as':_0xb5fa('0x3a'),'include':[{'model':db[_0xb5fa('0x2b')],'as':_0xb5fa('0x3b'),'where':_0x125a5c,'limit':0x1,'order':[[_0xb5fa('0x3c'),_0xb5fa('0x3d')]]}]},{'model':db[_0xb5fa('0x3e')],'as':_0xb5fa('0x3f')},{'model':db[_0xb5fa('0x40')],'as':_0xb5fa('0x41'),'include':[{'model':db[_0xb5fa('0x42')],'as':_0xb5fa('0x42')}]}]})[_0xb5fa('0x10')](function(_0x52f5d8){if(_0x52f5d8&&_0x52f5d8['List']){var _0x46194d=_0x52f5d8['get']({'plain':!![]});_0x42d331[_0xb5fa('0x38')]=_[_0xb5fa('0x43')](_0x46194d,['Applications',_0xb5fa('0x3a')]);_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x44')]=_0x52f5d8[_0xb5fa('0x45')]();_0x42d331[_0xb5fa('0x46')]=_0x46194d[_0xb5fa('0x3f')];_0x42d331['list']=_0x46194d[_0xb5fa('0x3a')];_0x42d331['applications']=_[_0xb5fa('0x47')](_0x42d331[_0xb5fa('0x46')],[_0xb5fa('0x48')],['asc']);if(_0x42d331[_0xb5fa('0x38')]&&_0x42d331[_0xb5fa('0x38')]['autoclose']){_0x42d331['applications'][_0xb5fa('0x49')]({'id':0x0,'priority':_0x42d331[_0xb5fa('0x46')][_0xb5fa('0x4a')]+0x1,'app':_0xb5fa('0x4b'),'appdata':_0xb5fa('0x4c'),'interval':_0xb5fa('0x4d')});}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')];}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')];}if(_0x46194d[_0xb5fa('0x3a')][_0xb5fa('0x3b')][_0xb5fa('0x4a')]){return _0x46194d[_0xb5fa('0x3a')]['Contacts'][0x0];}var _0x1900a5=_[_0xb5fa('0x4e')](_0x73d425[_0xb5fa('0x27')],{'firstName':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')],'ListId':_0x46194d[_0xb5fa('0x4f')]});_0x1900a5[_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')];return db['CmContact']['create'](_0x1900a5);}else{throw new Error(_0xb5fa('0x50'));}})[_0xb5fa('0x10')](function(_0x1e78cb){_0x42d331['contact']=_0x1e78cb;if(_0x1e78cb){if(!_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]){_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]=rs[_0xb5fa('0x52')]()+'\x20'+_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x30')];}var _0x4afc02={'ContactId':_0x1e78cb['id'],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'inReplyTo':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x54')],'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'};return db[_0xb5fa('0x57')][_0xb5fa('0x25')]({'where':{'closed':![],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x58')],'as':_0xb5fa('0x59'),'attributes':[_0xb5fa('0x51')],'where':{'messageId':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['inReplyTo']}}]})[_0xb5fa('0x10')](function(_0x34ebd0){if(_0x34ebd0){return[_0x34ebd0,![]];}return db[_0xb5fa('0x57')]['create'](_0x4afc02)[_0xb5fa('0x10')](function(_0x2d786e){return[_0x2d786e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb5fa('0x5a')](function(_0xb535c3,_0x5c25f6){if(_0xb535c3){_0x233f90=_0x5c25f6;if(!_0x5c25f6){return _0xb535c3['update']({'inReplyTo':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')]['message']['subject'],'attach':_0xb535c3['attach']?_0xb535c3[_0xb5fa('0x54')]:_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'});}else{return _0xb535c3;}}})[_0xb5fa('0x10')](function(_0x36b709){_0x42d331[_0xb5fa('0x5b')]=_0x36b709[_0xb5fa('0x5c')]({'plain':!![]});_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x5d')]=_0x233f90;return db[_0xb5fa('0x58')][_0xb5fa('0x5e')]({'body':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'MailInteractionId':_0x36b709['id'],'direction':'in','ContactId':_0x42d331['contact']['id'],'messageId':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'from':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'to':_0x73d425[_0xb5fa('0x27')]['message']['to'],'cc':_0x73d425[_0xb5fa('0x27')]['message']['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')]['message']['attach'],'Attachments':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x5f')],'originTo':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x60')],'originCc':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x61')],'bcc':_0x73d425['body']['message'][_0xb5fa('0x62')],'ChatWebsiteId':_0x73d425['body']['message']['ChatWebsiteId']||null,'originChannel':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x63')]||_0xb5fa('0x64'),'ChatOfflineMessageId':_0x73d425[_0xb5fa('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb5fa('0x65')],'as':_0xb5fa('0x66')}]});})['then'](function(_0x2d0c95){_0x42d331[_0xb5fa('0x19')]=_0x2d0c95;if(_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]){return db['User'][_0xb5fa('0x25')]({'attributes':['id',_0xb5fa('0x68')],'where':{'id':_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]}})[_0xb5fa('0x10')](function(_0x3348f7){if(_0x3348f7){_0x42d331[_0xb5fa('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb5fa('0x69'),'appdata':_0x3348f7['name']+','+(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x6a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);})[_0xb5fa('0x10')](function(_0x8ce5b8){_0x58aa97(_0x8ce5b8);})[_0xb5fa('0x1b')](function(_0x1bac54){_0x3cdf63(_0x5addd5['error'](0x1f4,_0x1bac54[_0xb5fa('0x19')]));});});}; \ No newline at end of file +var _0xef0f=['Applications','MailServerOut','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','MailApplication'];(function(_0x554233,_0xa8393){var _0x2391e8=function(_0x4ce3b1){while(--_0x4ce3b1){_0x554233['push'](_0x554233['shift']());}};_0x2391e8(++_0xa8393);}(_0xef0f,0x168));var _0xfef0=function(_0x23edff,_0x574d05){_0x23edff=_0x23edff-0x0;var _0x3aa6c4=_0xef0f[_0x23edff];return _0x3aa6c4;};'use strict';var _=require(_0xfef0('0x0'));var moment=require('moment');var BPromise=require(_0xfef0('0x1'));var rs=require(_0xfef0('0x2'));var Redis=require(_0xfef0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfef0('0x7')][_0xfef0('0x8')]({'port':0x232c});config[_0xfef0('0x9')]=_[_0xfef0('0xa')](config[_0xfef0('0x9')],{'host':_0xfef0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0x9')]));require('./mailAccount.socket')[_0xfef0('0xc')](socket);function respondWithRpcPromise(_0x100e3a,_0x3a81cc,_0x2d42dc){return new BPromise(function(_0x334e74,_0x402dff){return client[_0xfef0('0xd')](_0x100e3a,_0x2d42dc)[_0xfef0('0xe')](function(_0x11bbca){logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x3a81cc,'request\x20sent',JSON[_0xfef0('0x14')](_0x11bbca));if(_0x11bbca[_0xfef0('0x15')]){if(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x16')]===0x1f4){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x11bbca[_0xfef0('0x15')]['message']);return _0x402dff(_0x11bbca[_0xfef0('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3a81cc,_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);return _0x334e74(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);}else{logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));_0x334e74(_0x11bbca[_0xfef0('0x18')]['message']);}})[_0xfef0('0x19')](function(_0x1642cd){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x1642cd);_0x402dff(_0x1642cd);});});}exports[_0xfef0('0x1a')]=function(_0x55912f){var _0x5283e1=this;return new Promise(function(_0x4e24de,_0x20826b){return db[_0xfef0('0x1b')][_0xfef0('0x1c')]({'raw':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')]['where']||null:null,'attributes':_0x55912f['options']?_0x55912f['options'][_0xfef0('0x1e')]||null:null,'limit':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x1f')]||null:null,'include':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x55912f['options']['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x22')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1e')],'include':_0x316e20[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x316e20[_0xfef0('0x20')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x22')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1e')],'include':_0x5df04f['include']?_[_0xfef0('0x21')](_0x5df04f[_0xfef0('0x20')],function(_0xca0cce){return{'model':db[_0xca0cce[_0xfef0('0x22')]],'as':_0xca0cce['as'],'attributes':_0xca0cce[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x3e3c4c){logger[_0xfef0('0xf')](_0xfef0('0x1a'),_0x55912f);logger[_0xfef0('0x12')](_0xfef0('0x1a'),_0x55912f,JSON[_0xfef0('0x14')](_0x3e3c4c));_0x4e24de(_0x3e3c4c);})['catch'](function(_0x445625){logger['error']('GetMailAccount',_0x445625[_0xfef0('0x17')],_0x55912f);_0x20826b(_0x5283e1[_0xfef0('0x15')](0x1f4,_0x445625['message']));});});};exports['ShowMailAccount']=function(_0x5cf518){var _0x4f65cd=this;return new Promise(function(_0x4cce8a,_0x417535){return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'raw':_0x5cf518['options']?_0x5cf518['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x24')]||null:null,'attributes':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518[_0xfef0('0x1d')]['attributes']||null:null,'include':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x5cf518[_0xfef0('0x1d')][_0xfef0('0x20')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x22')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1e')],'include':_0x3e1a64[_0xfef0('0x20')]?_['map'](_0x3e1a64[_0xfef0('0x20')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x22')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1e')],'include':_0xea09ec[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0xea09ec[_0xfef0('0x20')],function(_0xeb75e2){return{'model':db[_0xeb75e2[_0xfef0('0x22')]],'as':_0xeb75e2['as'],'attributes':_0xeb75e2[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x22acf9){if(_0x5cf518[_0xfef0('0x1d')]['smtp']===!![])_0x22acf9[_0xfef0('0x25')]('smtpOptions',_0x22acf9[_0xfef0('0x26')]());logger[_0xfef0('0xf')](_0xfef0('0x27'),_0x5cf518);logger['debug'](_0xfef0('0x27'),_0x5cf518,JSON[_0xfef0('0x14')](_0x22acf9));_0x4cce8a(_0x22acf9);})[_0xfef0('0x19')](function(_0x5537c8){logger[_0xfef0('0x15')](_0xfef0('0x27'),_0x5537c8[_0xfef0('0x17')],_0x5cf518);_0x417535(_0x4f65cd['error'](0x1f4,_0x5537c8[_0xfef0('0x17')]));});});};exports['NotifyMailAccount']=function(_0x49ed48){var _0xf30aff=this;return new Promise(function(_0x547a5d,_0x5c3305){var _0xbf6ddd={'body':_0x49ed48[_0xfef0('0x28')],'channel':_0xfef0('0x29')};var _0x1a6593=_[_0xfef0('0x2a')](_[_0xfef0('0x2b')](db['CmContact'][_0xfef0('0x2c')]),[_0xfef0('0x2d'),'updatedAt','CompanyId',_0xfef0('0x2e')]);var _0x5dc824=![];if(_0x49ed48[_0xfef0('0x28')]['id']){delete _0x49ed48[_0xfef0('0x28')]['id'];}if(_[_0xfef0('0x2f')](_0x49ed48[_0xfef0('0x28')][_0xfef0('0x30')])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x31')));}if(_[_0xfef0('0x2f')](_0x49ed48['body'][_0xfef0('0x28')])||_0x49ed48['body']['body']===''){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x32')));}if(_['isNil'](_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x33')+_0x1a6593));}if(!_[_0xfef0('0x34')](_0x1a6593,_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x35')+_0x1a6593));}var _0x504967={};_0x504967[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body'][_0xfef0('0x30')];return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'where':{'id':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x38')],'as':_0xfef0('0x39'),'include':[{'model':db['CmContact'],'as':_0xfef0('0x3a'),'where':_0x504967,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfef0('0x3b')],'as':_0xfef0('0x3c')},{'model':db[_0xfef0('0x3d')],'as':'Smtp','include':[{'model':db[_0xfef0('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x51f207){if(_0x51f207&&_0x51f207[_0xfef0('0x39')]){var _0x3d471c=_0x51f207[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x37')]=_[_0xfef0('0x40')](_0x3d471c,[_0xfef0('0x3c'),_0xfef0('0x39')]);_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x41')]=_0x51f207['getSmtpOptions']();_0xbf6ddd['applications']=_0x3d471c[_0xfef0('0x3c')];_0xbf6ddd[_0xfef0('0x42')]=_0x3d471c[_0xfef0('0x39')];_0xbf6ddd[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0xbf6ddd[_0xfef0('0x43')],[_0xfef0('0x45')],[_0xfef0('0x46')]);if(_0xbf6ddd['account']&&_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x47')]){_0xbf6ddd[_0xfef0('0x43')][_0xfef0('0x48')]({'id':0x0,'priority':_0xbf6ddd[_0xfef0('0x43')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xfef0('0x49')});}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x3c')]){delete _0xbf6ddd[_0xfef0('0x37')]['Applications'];}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')]){delete _0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')];}if(_0x3d471c[_0xfef0('0x39')][_0xfef0('0x3a')][_0xfef0('0x4a')]){return _0x3d471c['List'][_0xfef0('0x3a')][0x0];}var _0x163255=_['defaults'](_0x49ed48[_0xfef0('0x28')],{'firstName':_0x49ed48['body'][_0xfef0('0x30')],'ListId':_0x3d471c[_0xfef0('0x2e')]});_0x163255[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body']['from'];return db['CmContact'][_0xfef0('0x4b')](_0x163255);}else{throw new Error(_0xfef0('0x4c'));}})[_0xfef0('0xe')](function(_0x34fda3){_0xbf6ddd[_0xfef0('0x4d')]=_0x34fda3;if(_0x34fda3){if(!_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x4e')]){_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')]=rs[_0xfef0('0x4f')]()+'\x20'+_0x49ed48['body'][_0xfef0('0x17')]['from'];}var _0x135653={'ContactId':_0x34fda3['id'],'MailAccountId':_0x49ed48['account']['id'],'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['from'],'cc':_0x49ed48[_0xfef0('0x28')]['message']['cc'],'subject':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['subject'],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'lastMsgAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgDirection':'in'};return db[_0xfef0('0x53')][_0xfef0('0x23')]({'where':{'closed':![],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x54')],'as':_0xfef0('0x55'),'attributes':[_0xfef0('0x4e')],'where':{'messageId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x56')]}}]})[_0xfef0('0xe')](function(_0x28cab7){if(_0x28cab7){return[_0x28cab7,![]];}return db[_0xfef0('0x53')][_0xfef0('0x4b')](_0x135653)['then'](function(_0x12e383){return[_0x12e383,!![]];});});}else{throw new Error(_0xfef0('0x57'));}})[_0xfef0('0x58')](function(_0x3c6bb8,_0x176fc7){if(_0x3c6bb8){_0x5dc824=_0x176fc7;if(!_0x176fc7){return _0x3c6bb8[_0xfef0('0x59')]({'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x30')],'cc':_0x49ed48['body'][_0xfef0('0x17')]['cc'],'subject':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5a')],'attach':_0x3c6bb8[_0xfef0('0x50')]?_0x3c6bb8[_0xfef0('0x50')]:_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgAt':moment()[_0xfef0('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c6bb8;}}})[_0xfef0('0xe')](function(_0x2ab666){_0xbf6ddd[_0xfef0('0x5b')]=_0x2ab666[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x5c')]=_0x5dc824;return db[_0xfef0('0x54')]['create']({'body':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x28')],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id'],'MailInteractionId':_0x2ab666['id'],'direction':'in','ContactId':_0xbf6ddd[_0xfef0('0x4d')]['id'],'messageId':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['messageId'],'from':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x30')],'to':_0x49ed48[_0xfef0('0x28')]['message']['to'],'cc':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['cc'],'subject':_0x49ed48['body'][_0xfef0('0x17')][_0xfef0('0x5a')],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'Attachments':_0x49ed48['body']['message']['attachments'],'originTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x5d')],'originCc':_0x49ed48['body'][_0xfef0('0x17')]['originCc'],'bcc':_0x49ed48['body']['message'][_0xfef0('0x5e')],'ChatWebsiteId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5f')]||null,'originChannel':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['originChannel']||_0xfef0('0x60'),'ChatOfflineMessageId':_0x49ed48['body']['message'][_0xfef0('0x61')]||null},{'include':[{'model':db[_0xfef0('0x62')],'as':_0xfef0('0x63')}]});})[_0xfef0('0xe')](function(_0x4df63b){_0xbf6ddd['message']=_0x4df63b;if(_0xbf6ddd['interaction'][_0xfef0('0x64')]){return db['User'][_0xfef0('0x23')]({'attributes':['id',_0xfef0('0x65')],'where':{'id':_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x64')]}})[_0xfef0('0xe')](function(_0x4be622){if(_0x4be622){_0xbf6ddd[_0xfef0('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4be622[_0xfef0('0x65')]+','+(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x66')]||0xa),'interval':_0xfef0('0x49')});}return respondWithRpcPromise('Start','startRouting',_0xbf6ddd);});}return respondWithRpcPromise(_0xfef0('0x67'),_0xfef0('0x68'),_0xbf6ddd);})['then'](function(_0x872f99){_0x547a5d(_0x872f99);})[_0xfef0('0x19')](function(_0x4690c0){_0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0x4690c0[_0xfef0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 314b685..f7bde31 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 _0xf5ac=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','remove'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xf5ac,0x1a9));var _0xcf5a=function(_0x49c52e,_0x2fd41d){_0x49c52e=_0x49c52e-0x0;var _0x931127=_0xf5ac[_0x49c52e];return _0x931127;};'use strict';var MailAccountEvents=require(_0xcf5a('0x0'));var events=['save',_0xcf5a('0x1'),'update'];function createListener(_0x2a1190,_0x261e09){return function(_0x5ea981){_0x261e09[_0xcf5a('0x2')](_0x2a1190,_0x5ea981);};}function removeListener(_0x7f374c,_0x4e399e){return function(){MailAccountEvents[_0xcf5a('0x3')](_0x7f374c,_0x4e399e);};}exports[_0xcf5a('0x4')]=function(_0x2bfa6f){for(var _0x529b50=0x0,_0x358d1f=events[_0xcf5a('0x5')];_0x529b50<_0x358d1f;_0x529b50++){var _0xa47697=events[_0x529b50];var _0x66dde=createListener(_0xcf5a('0x6')+_0xa47697,_0x2bfa6f);MailAccountEvents['on'](_0xa47697,_0x66dde);}}; \ No newline at end of file +var _0xa96b=['emit','removeListener','register','./mailAccount.events','remove','update'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xa96b,0x10b));var _0xba96=function(_0x56deed,_0x3061c1){_0x56deed=_0x56deed-0x0;var _0x1253d7=_0xa96b[_0x56deed];return _0x1253d7;};'use strict';var MailAccountEvents=require(_0xba96('0x0'));var events=['save',_0xba96('0x1'),_0xba96('0x2')];function createListener(_0x468a9e,_0x61ea85){return function(_0x3f6908){_0x61ea85[_0xba96('0x3')](_0x468a9e,_0x3f6908);};}function removeListener(_0x42c773,_0x5e2d37){return function(){MailAccountEvents[_0xba96('0x4')](_0x42c773,_0x5e2d37);};}exports[_0xba96('0x5')]=function(_0x4b0b61){for(var _0x498053=0x0,_0x3e35d0=events['length'];_0x498053<_0x3e35d0;_0x498053++){var _0x1e80b3=events[_0x498053];var _0x40773c=createListener('mailAccount:'+_0x1e80b3,_0x4b0b61);MailAccountEvents['on'](_0x1e80b3,_0x40773c);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index c1f5770..1dbbfa2 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 _0x90cb=['put','isAuthenticated','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show'];(function(_0x3962ae,_0x58a714){var _0x4d2346=function(_0x2b9e8e){while(--_0x2b9e8e){_0x3962ae['push'](_0x3962ae['shift']());}};_0x4d2346(++_0x58a714);}(_0x90cb,0x17a));var _0xb90c=function(_0x3a1972,_0x194511){_0x3a1972=_0x3a1972-0x0;var _0xc7e0b5=_0x90cb[_0x3a1972];return _0xc7e0b5;};'use strict';var multer=require(_0xb90c('0x0'));var util=require(_0xb90c('0x1'));var path=require(_0xb90c('0x2'));var timeout=require(_0xb90c('0x3'));var express=require(_0xb90c('0x4'));var router=express[_0xb90c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb90c('0x6'));var interaction=require(_0xb90c('0x7'));var config=require(_0xb90c('0x8'));var controller=require(_0xb90c('0x9'));router[_0xb90c('0xa')](_0xb90c('0xb'),auth['isAuthenticated'](),controller[_0xb90c('0xc')]);router[_0xb90c('0xd')](_0xb90c('0xb'),auth[_0xb90c('0xe')](),controller['update']);router[_0xb90c('0xf')](_0xb90c('0xb'),auth['isAuthenticated'](),controller[_0xb90c('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa0f2=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0xa0f2,0x153));var _0x2a0f=function(_0x1a2f93,_0x507838){_0x1a2f93=_0x1a2f93-0x0;var _0x269749=_0xa0f2[_0x1a2f93];return _0x269749;};'use strict';var multer=require(_0x2a0f('0x0'));var util=require(_0x2a0f('0x1'));var path=require('path');var timeout=require(_0x2a0f('0x2'));var express=require(_0x2a0f('0x3'));var router=express[_0x2a0f('0x4')]();var fs_extra=require(_0x2a0f('0x5'));var auth=require(_0x2a0f('0x6'));var interaction=require(_0x2a0f('0x7'));var config=require('../../config/environment');var controller=require(_0x2a0f('0x8'));router[_0x2a0f('0x9')](_0x2a0f('0xa'),auth[_0x2a0f('0xb')](),controller[_0x2a0f('0xc')]);router['put'](_0x2a0f('0xa'),auth['isAuthenticated'](),controller[_0x2a0f('0xd')]);router[_0x2a0f('0xe')](_0x2a0f('0xa'),auth[_0x2a0f('0xb')](),controller[_0x2a0f('0xf')]);module[_0x2a0f('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index d146a46..9274226 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 _0x988c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x988c,0xfb));var _0xc988=function(_0x21f260,_0x4770d2){_0x21f260=_0x21f260-0x0;var _0x2484d2=_0x988c[_0x21f260];return _0x2484d2;};'use strict';var Sequelize=require(_0xc988('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc988('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc988('0x2')],'allowNull':![],'defaultValue':_0xc988('0x3')},'appdata':{'type':Sequelize[_0xc988('0x4')]()},'description':{'type':Sequelize[_0xc988('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc988('0x5')}}; \ No newline at end of file +var _0x847e=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x2344d6,_0x41831b){var _0x40bc47=function(_0x1eab7d){while(--_0x1eab7d){_0x2344d6['push'](_0x2344d6['shift']());}};_0x40bc47(++_0x41831b);}(_0x847e,0x78));var _0xe847=function(_0x42f60e,_0x277ff6){_0x42f60e=_0x42f60e-0x0;var _0xe397a2=_0x847e[_0x42f60e];return _0xe397a2;};'use strict';var Sequelize=require(_0xe847('0x0'));module[_0xe847('0x1')]={'priority':{'type':Sequelize[_0xe847('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe847('0x3')],'allowNull':![],'defaultValue':_0xe847('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe847('0x3')],'defaultValue':_0xe847('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 73776cb..29c147d 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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x36ad73,_0x593eb9){var _0x59b7c8=function(_0x1b1e7d){while(--_0x1b1e7d){_0x36ad73['push'](_0x36ad73['shift']());}};_0x59b7c8(++_0x593eb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x5cc161,_0x5851ee){var _0x2d3067=function(_0x5f0083){while(--_0x5f0083){_0x5cc161['push'](_0x5cc161['shift']());}};_0x2d3067(++_0x5851ee);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xcb91[_0x1ac6ec];return _0x48a489;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 3a8a6dc..bc2edc4 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 _0x3bee=['exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x3bee,0x155));var _0xe3be=function(_0x55a53e,_0x563b3f){_0x55a53e=_0x55a53e-0x0;var _0x58335c=_0x3bee[_0x55a53e];return _0x58335c;};'use strict';var _=require(_0xe3be('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe3be('0x1'));var moment=require(_0xe3be('0x2'));var BPromise=require(_0xe3be('0x3'));var rp=require(_0xe3be('0x4'));var fs=require('fs');var path=require(_0xe3be('0x5'));var rimraf=require(_0xe3be('0x6'));var config=require(_0xe3be('0x7'));var attributes=require(_0xe3be('0x8'));module[_0xe3be('0x9')]=function(_0x472eab,_0x31fdb1){return _0x472eab['define'](_0xe3be('0xa'),attributes,{'tableName':_0xe3be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3be('0xc'),'collate':_0xe3be('0xd')});}; \ No newline at end of file +var _0xe343=['utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4'];(function(_0x6e5e67,_0x5a66a2){var _0x21bd02=function(_0x3e3a20){while(--_0x3e3a20){_0x6e5e67['push'](_0x6e5e67['shift']());}};_0x21bd02(++_0x5a66a2);}(_0xe343,0x18d));var _0x3e34=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xe343[_0x163742];return _0x1152ac;};'use strict';var _=require(_0x3e34('0x0'));var util=require('util');var logger=require(_0x3e34('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e34('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e34('0x3'));var rimraf=require(_0x3e34('0x4'));var config=require(_0x3e34('0x5'));var attributes=require(_0x3e34('0x6'));module[_0x3e34('0x7')]=function(_0x53c7ef,_0x3c551f){return _0x53c7ef[_0x3e34('0x8')](_0x3e34('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e34('0xa'),'collate':_0x3e34('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7d0149f..e34f705 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 _0xccd4=['MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','options','raw','where','limit','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2471ae,_0x196073){var _0x316ef2=function(_0x481ec7){while(--_0x481ec7){_0x2471ae['push'](_0x2471ae['shift']());}};_0x316ef2(++_0x196073);}(_0xccd4,0x112));var _0x4ccd=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xccd4[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x4ccd('0x0'));var util=require('util');var moment=require(_0x4ccd('0x1'));var BPromise=require(_0x4ccd('0x2'));var rs=require(_0x4ccd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4ccd('0x4'));var logger=require('../../config/logger')(_0x4ccd('0x5'));var config=require(_0x4ccd('0x6'));var jayson=require(_0x4ccd('0x7'));var client=jayson[_0x4ccd('0x8')][_0x4ccd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8c4c,_0x5d373e,_0x5989e1){return new BPromise(function(_0x2216fe,_0x343da4){return client[_0x4ccd('0xa')](_0x2c8c4c,_0x5989e1)[_0x4ccd('0xb')](function(_0x462820){logger[_0x4ccd('0xc')](_0x4ccd('0xd'),_0x5d373e,_0x4ccd('0xe'));logger[_0x4ccd('0xf')](_0x4ccd('0x10'),_0x5d373e,'request\x20sent',JSON[_0x4ccd('0x11')](_0x462820));if(_0x462820[_0x4ccd('0x12')]){if(_0x462820['error'][_0x4ccd('0x13')]===0x1f4){logger[_0x4ccd('0x12')](_0x4ccd('0xd'),_0x5d373e,_0x462820['error'][_0x4ccd('0x14')]);return _0x343da4(_0x462820[_0x4ccd('0x12')][_0x4ccd('0x14')]);}logger[_0x4ccd('0x12')]('MailApplication,\x20%s,\x20%s',_0x5d373e,_0x462820[_0x4ccd('0x12')][_0x4ccd('0x14')]);return _0x2216fe(_0x462820[_0x4ccd('0x12')][_0x4ccd('0x14')]);}else{logger[_0x4ccd('0xc')](_0x4ccd('0xd'),_0x5d373e,_0x4ccd('0xe'));_0x2216fe(_0x462820[_0x4ccd('0x15')][_0x4ccd('0x14')]);}})['catch'](function(_0x5c5c4d){logger['error'](_0x4ccd('0xd'),_0x5d373e,_0x5c5c4d);_0x343da4(_0x5c5c4d);});});}exports[_0x4ccd('0x16')]=function(_0x5a8f80){var _0x3990db=this;return new Promise(function(_0x1175c5,_0x13523d){return db[_0x4ccd('0x17')][_0x4ccd('0x18')](_0x5a8f80['body'],{'raw':_0x5a8f80[_0x4ccd('0x19')]?_0x5a8f80['options'][_0x4ccd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a8f80['options']?_0x5a8f80[_0x4ccd('0x19')][_0x4ccd('0x1b')]||null:null,'attributes':_0x5a8f80[_0x4ccd('0x19')]?_0x5a8f80[_0x4ccd('0x19')]['attributes']||null:null,'limit':_0x5a8f80[_0x4ccd('0x19')]?_0x5a8f80[_0x4ccd('0x19')][_0x4ccd('0x1c')]||null:null})[_0x4ccd('0xb')](function(_0x15dc5f){logger[_0x4ccd('0xc')](_0x4ccd('0x16'),_0x5a8f80);logger[_0x4ccd('0xf')](_0x4ccd('0x16'),_0x5a8f80,JSON[_0x4ccd('0x11')](_0x15dc5f));_0x1175c5(_0x15dc5f);})['catch'](function(_0x3a5ca3){logger['error']('UpdateMailApplication',_0x3a5ca3[_0x4ccd('0x14')],_0x5a8f80);_0x13523d(_0x3990db['error'](0x1f4,_0x3a5ca3[_0x4ccd('0x14')]));});});}; \ No newline at end of file +var _0x3c6a=['update','options','where','attributes','limit','then','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','UpdateMailApplication','MailApplication'];(function(_0x496a45,_0x2de9b2){var _0x5a381f=function(_0x4bfb4d){while(--_0x4bfb4d){_0x496a45['push'](_0x496a45['shift']());}};_0x5a381f(++_0x2de9b2);}(_0x3c6a,0xb5));var _0xa3c6=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x3c6a[_0x531d15];return _0x271a18;};'use strict';var _=require(_0xa3c6('0x0'));var util=require(_0xa3c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3c6('0x3'))['db'];var utils=require(_0xa3c6('0x4'));var logger=require(_0xa3c6('0x5'))(_0xa3c6('0x6'));var config=require('../../config/environment');var jayson=require(_0xa3c6('0x7'));var client=jayson[_0xa3c6('0x8')][_0xa3c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x128cc2,_0x93316a,_0x1cfd8f){return new BPromise(function(_0x38c35d,_0x3a8181){return client[_0xa3c6('0xa')](_0x128cc2,_0x1cfd8f)['then'](function(_0x3e56d0){logger['info'](_0xa3c6('0xb'),_0x93316a,'request\x20sent');logger[_0xa3c6('0xc')](_0xa3c6('0xd'),_0x93316a,_0xa3c6('0xe'),JSON['stringify'](_0x3e56d0));if(_0x3e56d0[_0xa3c6('0xf')]){if(_0x3e56d0['error']['code']===0x1f4){logger[_0xa3c6('0xf')](_0xa3c6('0xb'),_0x93316a,_0x3e56d0[_0xa3c6('0xf')][_0xa3c6('0x10')]);return _0x3a8181(_0x3e56d0[_0xa3c6('0xf')][_0xa3c6('0x10')]);}logger[_0xa3c6('0xf')]('MailApplication,\x20%s,\x20%s',_0x93316a,_0x3e56d0['error'][_0xa3c6('0x10')]);return _0x38c35d(_0x3e56d0[_0xa3c6('0xf')]['message']);}else{logger[_0xa3c6('0x11')](_0xa3c6('0xb'),_0x93316a,_0xa3c6('0xe'));_0x38c35d(_0x3e56d0[_0xa3c6('0x12')][_0xa3c6('0x10')]);}})[_0xa3c6('0x13')](function(_0x2f44de){logger[_0xa3c6('0xf')](_0xa3c6('0xb'),_0x93316a,_0x2f44de);_0x3a8181(_0x2f44de);});});}exports[_0xa3c6('0x14')]=function(_0x18d786){var _0x561728=this;return new Promise(function(_0x14db2d,_0x5e36fc){return db[_0xa3c6('0x15')][_0xa3c6('0x16')](_0x18d786['body'],{'raw':_0x18d786['options']?_0x18d786[_0xa3c6('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18d786[_0xa3c6('0x17')]?_0x18d786[_0xa3c6('0x17')][_0xa3c6('0x18')]||null:null,'attributes':_0x18d786['options']?_0x18d786[_0xa3c6('0x17')][_0xa3c6('0x19')]||null:null,'limit':_0x18d786[_0xa3c6('0x17')]?_0x18d786[_0xa3c6('0x17')][_0xa3c6('0x1a')]||null:null})[_0xa3c6('0x1b')](function(_0x599b7c){logger['info'](_0xa3c6('0x14'),_0x18d786);logger[_0xa3c6('0xc')](_0xa3c6('0x14'),_0x18d786,JSON[_0xa3c6('0x1c')](_0x599b7c));_0x14db2d(_0x599b7c);})['catch'](function(_0x3dc263){logger[_0xa3c6('0xf')]('UpdateMailApplication',_0x3dc263[_0xa3c6('0x10')],_0x18d786);_0x5e36fc(_0x561728[_0xa3c6('0xf')](0x1f4,_0x3dc263[_0xa3c6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9f6a26b..dc1dc46 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 _0xd3f4=['mail','update','delete','mailinteraction:destroy','destroy','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','mailinteraction:addtags','addTags','put'];(function(_0xff8d4b,_0x1e6e8c){var _0x1126e6=function(_0x41cb4e){while(--_0x41cb4e){_0xff8d4b['push'](_0xff8d4b['shift']());}};_0x1126e6(++_0x1e6e8c);}(_0xd3f4,0xae));var _0x4d3f=function(_0xb18abc,_0x4f465b){_0xb18abc=_0xb18abc-0x0;var _0x5cdbb2=_0xd3f4[_0xb18abc];return _0x5cdbb2;};'use strict';var express=require(_0x4d3f('0x0'));var router=express['Router']();var auth=require(_0x4d3f('0x1'));var interaction=require(_0x4d3f('0x2'));var controller=require(_0x4d3f('0x3'));router[_0x4d3f('0x4')]('/',auth[_0x4d3f('0x5')](),controller[_0x4d3f('0x6')]);router[_0x4d3f('0x4')](_0x4d3f('0x7'),auth[_0x4d3f('0x5')](),controller[_0x4d3f('0x8')]);router[_0x4d3f('0x4')](_0x4d3f('0x9'),auth[_0x4d3f('0x5')](),controller[_0x4d3f('0xa')]);router['get'](_0x4d3f('0xb'),auth[_0x4d3f('0x5')](),controller[_0x4d3f('0xc')]);router[_0x4d3f('0x4')](_0x4d3f('0xd'),auth['isAuthenticated'](),controller[_0x4d3f('0xe')]);router['post']('/',auth[_0x4d3f('0x5')](),controller[_0x4d3f('0xf')]);router[_0x4d3f('0x10')](_0x4d3f('0xb'),auth[_0x4d3f('0x5')](),controller['addMessage']);router[_0x4d3f('0x10')](_0x4d3f('0x11'),auth[_0x4d3f('0x5')](),interaction[_0x4d3f('0x12')]('mail',_0x4d3f('0x13')),controller[_0x4d3f('0x14')]);router[_0x4d3f('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x4d3f('0x12')](_0x4d3f('0x16'),'mailinteraction:update'),controller[_0x4d3f('0x17')]);router[_0x4d3f('0x18')](_0x4d3f('0x9'),auth['isAuthenticated'](),interaction[_0x4d3f('0x12')](_0x4d3f('0x16'),_0x4d3f('0x19')),controller[_0x4d3f('0x1a')]);router[_0x4d3f('0x18')](_0x4d3f('0x11'),auth[_0x4d3f('0x5')](),controller['removeTags']);module[_0x4d3f('0x1b')]=router; \ No newline at end of file +var _0x7d7c=['put','/:id','mailinteraction:update','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id/messages','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x31b12c,_0x18b4a4){var _0x47fe72=function(_0x5049dd){while(--_0x5049dd){_0x31b12c['push'](_0x31b12c['shift']());}};_0x47fe72(++_0x18b4a4);}(_0x7d7c,0x11b));var _0xc7d7=function(_0x3ade97,_0x348510){_0x3ade97=_0x3ade97-0x0;var _0x2380b6=_0x7d7c[_0x3ade97];return _0x2380b6;};'use strict';var express=require('express');var router=express[_0xc7d7('0x0')]();var auth=require(_0xc7d7('0x1'));var interaction=require(_0xc7d7('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xc7d7('0x3')](),controller[_0xc7d7('0x4')]);router[_0xc7d7('0x5')](_0xc7d7('0x6'),auth[_0xc7d7('0x3')](),controller[_0xc7d7('0x7')]);router[_0xc7d7('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xc7d7('0x8'),auth[_0xc7d7('0x3')](),controller['getMessages']);router[_0xc7d7('0x5')]('/:id/download',auth['isAuthenticated'](),controller[_0xc7d7('0x9')]);router[_0xc7d7('0xa')]('/',auth['isAuthenticated'](),controller[_0xc7d7('0xb')]);router[_0xc7d7('0xa')](_0xc7d7('0x8'),auth[_0xc7d7('0x3')](),controller[_0xc7d7('0xc')]);router[_0xc7d7('0xa')]('/:id/tags',auth[_0xc7d7('0x3')](),interaction[_0xc7d7('0xd')](_0xc7d7('0xe'),_0xc7d7('0xf')),controller[_0xc7d7('0x10')]);router[_0xc7d7('0x11')](_0xc7d7('0x12'),auth[_0xc7d7('0x3')](),interaction['tracked']('mail',_0xc7d7('0x13')),controller['update']);router['delete'](_0xc7d7('0x12'),auth[_0xc7d7('0x3')](),interaction['tracked'](_0xc7d7('0xe'),_0xc7d7('0x14')),controller[_0xc7d7('0x15')]);router['delete'](_0xc7d7('0x16'),auth[_0xc7d7('0x3')](),controller[_0xc7d7('0x17')]);module[_0xc7d7('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 1096202..db82f1b 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 _0x05da=['exports','DATE','STRING','TEXT','long','ENUM','out','BOOLEAN','iconv'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x05da,0x7d));var _0xa05d=function(_0x2d43f3,_0x4941bc){_0x2d43f3=_0x2d43f3-0x0;var _0x22cb6e=_0x05da[_0x2d43f3];return _0x22cb6e;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xa05d('0x0'));module[_0xa05d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa05d('0x2')]},'disposition':{'type':Sequelize[_0xa05d('0x3')]},'secondDisposition':{'type':Sequelize[_0xa05d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa05d('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa05d('0x3')](0x1fe)},'to':{'type':Sequelize[_0xa05d('0x3')]},'cc':{'type':Sequelize[_0xa05d('0x4')](_0xa05d('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa05d('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xa05d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa05d('0x6')]('in',_0xa05d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa05d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa05d('0x6')]('in',_0xa05d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa05d('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x9e69=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x4c6d19,_0x149f70){var _0x40b6c7=function(_0x258143){while(--_0x258143){_0x4c6d19['push'](_0x4c6d19['shift']());}};_0x40b6c7(++_0x149f70);}(_0x9e69,0xcf));var _0x99e6=function(_0x53bdf3,_0xdcd72e){_0x53bdf3=_0x53bdf3-0x0;var _0x4ad414=_0x9e69[_0x53bdf3];return _0x4ad414;};'use strict';var Sequelize=require(_0x99e6('0x0'));var iconv=require('iconv');module[_0x99e6('0x1')]={'closed':{'type':Sequelize[_0x99e6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x99e6('0x3')]},'disposition':{'type':Sequelize[_0x99e6('0x4')]},'secondDisposition':{'type':Sequelize[_0x99e6('0x4')]},'thirdDisposition':{'type':Sequelize[_0x99e6('0x4')]},'note':{'type':Sequelize[_0x99e6('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x99e6('0x4')]},'cc':{'type':Sequelize[_0x99e6('0x5')](_0x99e6('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x99e6('0x3')]},'substatus':{'type':Sequelize[_0x99e6('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x99e6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x99e6('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x99e6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x99e6('0x7')]('in',_0x99e6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x99e6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index f1b45e0..9c9858a 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 _0xd6c2=['getFullTextValue','group','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','MailAccountId','sequelize','toString','keyBy','a.key','Account.mandatoryDisposition','a.email','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','show','params','intersection','includeAll','include','merge','options','create','update','body','describe','addMessage','ids','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','mailInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','subject','Messages','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','build','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','moment','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','html-entities','redis','defaults','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','error','stack','name','send','Users','map','fullname','Tags','split','forEach','push','TagIds','MailMessage','plainBody','-id','then','lastMsgText','trimStart','catch','answered','waiting','talking','closed','UserId','index','MailInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','left_join','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','tools_tags','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','i.MailAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x10286d,_0x595de8){var _0x25f02b=function(_0xfa6dd){while(--_0xfa6dd){_0x10286d['push'](_0x10286d['shift']());}};_0x25f02b(++_0x595de8);}(_0xd6c2,0x14a));var _0x2d6c=function(_0x2fae01,_0x372fb4){_0x2fae01=_0x2fae01-0x0;var _0x2a154b=_0xd6c2[_0x2fae01];return _0x2a154b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d6c('0x0'));var zipdir=require(_0x2d6c('0x1'));var moment=require(_0x2d6c('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x2d6c('0x3'));var fs=require('fs');var _=require(_0x2d6c('0x4'));var squel=require(_0x2d6c('0x5'));var juice=require(_0x2d6c('0x6'));var Redis=require(_0x2d6c('0x7'));var qs=require(_0x2d6c('0x8'));var as=require(_0x2d6c('0x9'));var logger=require('../../config/logger')(_0x2d6c('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x2d6c('0xb'));config[_0x2d6c('0xc')]=_[_0x2d6c('0xd')](config[_0x2d6c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d6c('0xc')]));require(_0x2d6c('0xe'))[_0x2d6c('0xf')](socket);function respondWithStatusCode(_0x2face3,_0x67651f){_0x67651f=_0x67651f||0xcc;return function(_0x121cf1){if(_0x121cf1){return _0x2face3[_0x2d6c('0x10')](_0x67651f);}return _0x2face3[_0x2d6c('0x11')](_0x67651f)[_0x2d6c('0x12')]();};}function respondWithResult(_0x229ada,_0x1a87c3){_0x1a87c3=_0x1a87c3||0xc8;return function(_0x4ecb6d){if(_0x4ecb6d){return _0x229ada[_0x2d6c('0x11')](_0x1a87c3)['json'](_0x4ecb6d);}};}function respondWithFilteredResult(_0xf35b75,_0x44a301){return function(_0x54fb3b){if(_0x54fb3b){var _0x2888be=typeof _0x44a301[_0x2d6c('0x13')]===_0x2d6c('0x14')&&typeof _0x44a301[_0x2d6c('0x15')]===_0x2d6c('0x14');var _0x22aa2e=_0x54fb3b[_0x2d6c('0x16')];var _0x579164=_0x2888be?0x0:_0x44a301[_0x2d6c('0x13')];var _0xf284a7=_0x2888be?_0x54fb3b[_0x2d6c('0x16')]:_0x44a301[_0x2d6c('0x13')]+_0x44a301['limit'];var _0x4aec18;if(_0xf284a7>=_0x22aa2e){_0xf284a7=_0x22aa2e;_0x4aec18=0xc8;}else{_0x4aec18=0xce;}_0xf35b75[_0x2d6c('0x11')](_0x4aec18);return _0xf35b75[_0x2d6c('0x17')](_0x2d6c('0x18'),_0x579164+'-'+_0xf284a7+'/'+_0x22aa2e)[_0x2d6c('0x19')](_0x54fb3b);}return null;};}function saveUpdates(_0xc5567){return function(_0x3e4c4b){if(_0x3e4c4b){return _0x3e4c4b['update'](_0xc5567)['then'](function(_0xd6b8b4){return _0xd6b8b4;});}return null;};}function removeEntity(_0x4e55e4){return function(_0x103ed4){if(_0x103ed4){return _0x103ed4[_0x2d6c('0x1a')]()['then'](function(){_0x4e55e4['status'](0xcc)[_0x2d6c('0x12')]();});}};}function handleEntityNotFound(_0x4b709){return function(_0x33bbd1){if(!_0x33bbd1){_0x4b709[_0x2d6c('0x10')](0x194);}return _0x33bbd1;};}function handleError(_0x3a1ee5,_0x1f18e3){_0x1f18e3=_0x1f18e3||0x1f4;return function(_0x397e6a){logger[_0x2d6c('0x1b')](_0x397e6a[_0x2d6c('0x1c')]);if(_0x397e6a['name']){delete _0x397e6a[_0x2d6c('0x1d')];}_0x3a1ee5[_0x2d6c('0x11')](_0x1f18e3)[_0x2d6c('0x1e')](_0x397e6a);};}function getInteractionUsers(_0x49e810,_0x5073ab){return new BPromise(function(_0xb57937,_0x38e575){try{if(_0x5073ab[_0x49e810['id']]){_0x49e810[_0x2d6c('0x1f')]=_[_0x2d6c('0x20')](_0x5073ab[_0x49e810['id']],function(_0x3db8c3){return{'id':_0x3db8c3['id'],'fullname':_0x3db8c3[_0x2d6c('0x21')]};});}}catch(_0x54750f){_0x38e575(_0x54750f);}_0xb57937(_0x49e810);});}function getInteractionTags(_0x50aa37,_0x522593){return new BPromise(function(_0x4ca442,_0x32b1f1){try{if(_0x50aa37['TagIds']){_0x50aa37[_0x2d6c('0x22')]=[];_0x50aa37['TagIds'][_0x2d6c('0x23')](',')[_0x2d6c('0x24')](function(_0x329c2f){_0x50aa37['Tags'][_0x2d6c('0x25')](_0x522593[_0x329c2f]);});}delete _0x50aa37[_0x2d6c('0x26')];}catch(_0x3e3934){_0x32b1f1(_0x3e3934);}_0x4ca442(_0x50aa37);});}function getLastMessageText(_0x21b1fe){return new BPromise(function(_0x278712,_0x2fccad){return db[_0x2d6c('0x27')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x21b1fe['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2d6c('0x28')],'order':_0x2d6c('0x29'),'raw':!![]})[_0x2d6c('0x2a')](function(_0x1f4259){if(_0x1f4259&&_0x1f4259[_0x2d6c('0x28')]){_0x21b1fe[_0x2d6c('0x2b')]=_[_0x2d6c('0x2c')](_0x1f4259['plainBody']);}_0x278712(_0x21b1fe);})[_0x2d6c('0x2d')](function(_0x3f82ef){_0x2fccad(_0x3f82ef);});});}function updateMailInteraction(_0x50c196,_0x46f09d,_0x3df901,_0xa49d58){return new BPromise(function(_0xdf77d0,_0x485c83){return getInteractionUsers(_0x50c196,_0x3df901)[_0x2d6c('0x2a')](function(_0x3414c3){return getInteractionTags(_0x3414c3,_0x46f09d);})[_0x2d6c('0x2a')](function(_0x3415e9){return getStateInteraction(_0x3415e9);})[_0x2d6c('0x2a')](function(_0x296707){if(_0xa49d58){_0xdf77d0(getLastMessageText(_0x296707));}else{_0xdf77d0(_0x296707);}})[_0x2d6c('0x2d')](function(_0x3a8d36){_0x485c83(_0x3a8d36);});});}function getStateInteraction(_0x2e68b7){return new BPromise(function(_0x250528){_0x2e68b7['waiting']=0x0;_0x2e68b7['talking']=0x0;_0x2e68b7[_0x2d6c('0x2e')]=0x0;_0x2e68b7['unmanaged']=0x0;_0x2e68b7['total']=0x0;if(!_0x2e68b7['closed']&&!_0x2e68b7['UserId']){_0x2e68b7[_0x2d6c('0x2f')]+=0x1;}if(!_0x2e68b7['closed']&&_0x2e68b7['UserId']){_0x2e68b7[_0x2d6c('0x30')]+=0x1;if(_0x2e68b7[_0x2d6c('0x2f')]){_0x2e68b7['waiting']-=0x1;}}if(_0x2e68b7[_0x2d6c('0x31')]&&_0x2e68b7[_0x2d6c('0x32')]){_0x2e68b7[_0x2d6c('0x2e')]+=0x1;if(_0x2e68b7[_0x2d6c('0x30')]){_0x2e68b7['talking']-=0x1;}}if(_0x2e68b7[_0x2d6c('0x31')]&&!_0x2e68b7[_0x2d6c('0x32')]){_0x2e68b7['unmanaged']+=0x1;if(_0x2e68b7['waiting']){_0x2e68b7['waiting']-=0x1;}}_0x2e68b7['total']+=0x1;_0x250528(_0x2e68b7);});}exports[_0x2d6c('0x33')]=function(_0x2be8a2,_0x375557){var _0x5a0771={},_0x22e12a={},_0x4ab3e0={'count':0x0,'rows':[]};var _0x527cf7=_[_0x2d6c('0x20')](db[_0x2d6c('0x34')][_0x2d6c('0x35')],function(_0x214441){return{'name':_0x214441[_0x2d6c('0x36')],'type':_0x214441[_0x2d6c('0x37')][_0x2d6c('0x38')]};});_0x22e12a[_0x2d6c('0x39')]=_[_0x2d6c('0x20')](_0x527cf7,_0x2d6c('0x1d'));_0x22e12a[_0x2d6c('0x3a')]=_[_0x2d6c('0x3b')](_0x2be8a2[_0x2d6c('0x3a')]);_0x22e12a[_0x2d6c('0x3c')]=_['intersection'](_0x22e12a[_0x2d6c('0x39')],_0x22e12a['query']);_0x5a0771[_0x2d6c('0x3d')]=_['intersection'](_0x22e12a[_0x2d6c('0x39')],qs['fields'](_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x3e')]));_0x5a0771[_0x2d6c('0x3d')]=_0x5a0771['attributes'][_0x2d6c('0x3f')]?_0x5a0771[_0x2d6c('0x3d')]:_0x22e12a['model'];if(!_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x40')](_0x2d6c('0x41'))){_0x5a0771[_0x2d6c('0x15')]=qs[_0x2d6c('0x15')](_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x15')]);_0x5a0771[_0x2d6c('0x13')]=qs['offset'](_0x2be8a2[_0x2d6c('0x3a')]['offset']);}_0x5a0771[_0x2d6c('0x42')]=qs[_0x2d6c('0x43')](_0x2be8a2['query'][_0x2d6c('0x43')]);_0x5a0771[_0x2d6c('0x44')]=qs[_0x2d6c('0x3c')](_[_0x2d6c('0x45')](_0x2be8a2[_0x2d6c('0x3a')],_0x22e12a[_0x2d6c('0x3c')]),_0x527cf7);var _0x3d2759=[];var _0x4b930f=squel['select']()[_0x2d6c('0x46')]('id')[_0x2d6c('0x46')]('name')['field'](_0x2d6c('0x47'))[_0x2d6c('0x48')]('tools_tags');var _0x2b6a0b=squel[_0x2d6c('0x49')]()[_0x2d6c('0x46')](_0x2d6c('0x4a'))['field'](_0x2d6c('0x4b'))[_0x2d6c('0x46')]('ui.MailInteractionId')[_0x2d6c('0x48')]('user_has_mail_interactions','ui')[_0x2d6c('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0x1e2eda=squel['select']()[_0x2d6c('0x48')](_0x2d6c('0x4d'),'i')[_0x2d6c('0x4c')](_0x2d6c('0x4e'),'c',_0x2d6c('0x4f'))[_0x2d6c('0x4c')](_0x2d6c('0x50'),'o',_0x2d6c('0x51'))[_0x2d6c('0x4c')](_0x2d6c('0x52'),'a',_0x2d6c('0x53'))[_0x2d6c('0x4c')](_0x2d6c('0x54'),'me','me.MailInteractionId\x20=\x20i.id')[_0x2d6c('0x4c')](_0x2d6c('0x55'),'it','it.MailInteractionId\x20=\x20i.id')[_0x2d6c('0x4c')](_0x2d6c('0x56'),'t','t.id\x20=\x20it.TagId');var _0x1dbd19=squel[_0x2d6c('0x57')]();var _0x3a1f91=[];var _0x187f7d=squel['expr']();var _0x3d4a93;if(_0x2be8a2[_0x2d6c('0x3a')]['search']){_0x3d4a93=as[_0x2d6c('0x58')](_0x2be8a2['query'][_0x2d6c('0x59')]);var _0x5f4034=_0x3d4a93[_0x2d6c('0x5a')];for(var _0xe267b0=0x0;_0xe267b0<_0x3d4a93[_0x2d6c('0x5b')][_0x2d6c('0x3f')];_0xe267b0++){var _0x210ac6=_0x3d4a93[_0x2d6c('0x5b')][_0xe267b0];var _0x51abbe='i';var _0x443336=_[_0x2d6c('0x5c')](_0x527cf7,[_0x2d6c('0x1d'),_0x210ac6['field']]);if(!_0x443336){switch(_0x210ac6[_0x2d6c('0x46')]){case _0x2d6c('0x5d'):if(_0x210ac6[_0x2d6c('0x5e')]==0x1){_0x1e2eda[_0x2d6c('0x5f')]('`'+_0x210ac6['field']+_0x2d6c('0x60'));}else{_0x1e2eda[_0x2d6c('0x5f')]('`'+_0x210ac6[_0x2d6c('0x46')]+_0x2d6c('0x61'));}break;case _0x2d6c('0x62'):if(_0x210ac6[_0x2d6c('0x63')]==='$substring'){if(_0x210ac6[_0x2d6c('0x5e')][_0x2d6c('0x23')]('\x20')[_0x2d6c('0x3f')]>0x1){_0x1dbd19[_0x5f4034](_0x2d6c('0x64'),qs['getFullTextValue'](_0x210ac6[_0x2d6c('0x5e')]),null);}else{var _0x3d0b62='%'+_0x210ac6[_0x2d6c('0x5e')]+'%';_0x1dbd19[_0x5f4034]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3d0b62,_0x3d0b62,_0x3d0b62);}}else{_0x443336=_[_0x2d6c('0x5c')](_0x527cf7,[_0x2d6c('0x1d'),_0x2d6c('0x65')]);_0x210ac6['field']=_0x2d6c('0x65');_0x232f7c=as[_0x2d6c('0x66')](_0x51abbe,_0x443336[_0x2d6c('0x37')],_0x210ac6);_0x1dbd19[_0x5f4034](_0x232f7c[_0x2d6c('0x67')],_0x232f7c['value'][_0x2d6c('0x68')],_0x232f7c[_0x2d6c('0x5e')][_0x2d6c('0x12')]);}break;case _0x2d6c('0x69'):var _0x55a44d=_0x210ac6['value']['split'](',')[_0x2d6c('0x20')](function(_0x99433f){return Number(_0x99433f);});_0x55a44d[_0x2d6c('0x24')](function(_0x55f394){_0x187f7d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x55f394+',%');});_0x3a1f91=_[_0x2d6c('0x6a')](_0x3a1f91,_0x55a44d);break;case'User':if(_0x210ac6[_0x2d6c('0x63')]===_0x2d6c('0x6b')){_0x1dbd19[_0x5f4034](_0x2d6c('0x6c'),'%'+_0x210ac6[_0x2d6c('0x5e')]+'%',null);}else{_0x443336=_[_0x2d6c('0x5c')](_0x527cf7,['name',_0x2d6c('0x32')]);_0x210ac6[_0x2d6c('0x46')]=_0x2d6c('0x32');_0x232f7c=as[_0x2d6c('0x66')](_0x51abbe,_0x443336['type'],_0x210ac6);_0x1dbd19[_0x5f4034](_0x232f7c[_0x2d6c('0x67')],_0x232f7c[_0x2d6c('0x5e')][_0x2d6c('0x68')],_0x232f7c['value']['end']);}break;case _0x2d6c('0x28'):_0x232f7c=as[_0x2d6c('0x66')]('me',null,_0x210ac6);_0x1dbd19[_0x5f4034](_0x232f7c[_0x2d6c('0x67')],_0x232f7c[_0x2d6c('0x5e')][_0x2d6c('0x68')],_0x232f7c[_0x2d6c('0x5e')][_0x2d6c('0x12')]);break;}}else{var _0x232f7c=as['buildExpression'](_0x51abbe,_0x443336['type'],_0x210ac6);_0x1dbd19[_0x5f4034](_0x232f7c[_0x2d6c('0x67')],_0x232f7c[_0x2d6c('0x5e')][_0x2d6c('0x68')],_0x232f7c['value'][_0x2d6c('0x12')]);}}}else{var _0xab004e=_(_0x2be8a2['query'])[_0x2d6c('0x3b')]()[_0x2d6c('0x20')](function(_0x11d350){return _[_0x2d6c('0x6d')](_0x527cf7,['name',_0x11d350])?_0x11d350:undefined;})[_0x2d6c('0x6e')]()[_0x2d6c('0x5e')]();if(!_['isEmpty'](_0xab004e)){_0xab004e[_0x2d6c('0x24')](function(_0x23bfa4){if(_0x23bfa4==='MailAccountId'){_0x1e2eda['where'](_0x2d6c('0x6f'),[][_0x2d6c('0x70')](_0x2be8a2[_0x2d6c('0x3a')][_0x23bfa4]));}else if(_0x23bfa4===_0x2d6c('0x71')){var _0x3557d8=JSON['parse'](_0x2be8a2[_0x2d6c('0x3a')][_0x23bfa4])['$gte'];var _0x5e5caa=JSON['parse'](_0x2be8a2[_0x2d6c('0x3a')][_0x23bfa4])[_0x2d6c('0x72')];_0x1e2eda[_0x2d6c('0x44')](_0x2d6c('0x73'),_0x3557d8,_0x5e5caa);}else{if(_0x2be8a2['query'][_0x23bfa4]===_0x2d6c('0x74')){_0x1e2eda[_0x2d6c('0x44')]('i.'+_0x23bfa4+_0x2d6c('0x75'));}else{_0x1e2eda[_0x2d6c('0x44')]('i.'+_0x23bfa4+'\x20=\x20?',_0x2be8a2['query'][_0x23bfa4]);}}});}if(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x76')]){if(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x76')]==0x1){_0x1e2eda['having'](_0x2d6c('0x77'));}else{_0x1e2eda[_0x2d6c('0x5f')](_0x2d6c('0x78'));}}if(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x79')]){_0x3a1f91=_[_0x2d6c('0x7a')](_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x79')])?_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x79')]:new Array(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x79')]);_0x3a1f91['forEach'](function(_0x510d0d){_0x187f7d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x510d0d+',%');});}if(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x7b')]){var _0x3504f6=_0x2be8a2[_0x2d6c('0x3a')]['filter'][_0x2d6c('0x7c')]('\x5c','\x5c\x5c')[_0x2d6c('0x7c')](/'/g,'\x27\x27');if(qs[_0x2d6c('0x7d')](_0x3504f6)){_0x1dbd19['or'](_0x2d6c('0x7e'),_0x3504f6+'%');}else if(qs['isEmail'](_0x3504f6)){_0x1dbd19['or'](_0x2d6c('0x7f'),_0x3504f6+'%');}else{_0x1dbd19['or'](_0x2d6c('0x80'),qs['getFullTextValue'](_0x3504f6))['or'](_0x2d6c('0x81'),qs[_0x2d6c('0x82')](_0x3504f6));}}}_0x1e2eda[_0x2d6c('0x44')](_0x1dbd19);_0x1e2eda[_0x2d6c('0x83')](_0x2d6c('0x84'));var _0xfb7cb2={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0xca8394=_0x1e2eda[_0x2d6c('0x85')]();_0xca8394[_0x2d6c('0x46')](_0x2d6c('0x84'));_0xca8394['field'](_0x2d6c('0x86'),_0x2d6c('0x5d'));if(_0x5a0771[_0x2d6c('0x42')]){_0x5a0771[_0x2d6c('0x42')]['forEach'](function(_0x575ea5){var _0x2b637e=_0x575ea5[0x0]==='contactName'?_0x575ea5[0x0]:'i.'+_0x575ea5[0x0];_0x1e2eda[_0x2d6c('0x42')](_0x2b637e,_0x575ea5[0x1]===_0x2d6c('0x87')?![]:!![]);});}if(!_[_0x2d6c('0x88')](_0x3a1f91)){_0x1e2eda[_0x2d6c('0x5f')](_0x187f7d);_0xca8394[_0x2d6c('0x44')](_0x2d6c('0x89'),_0x3a1f91);}BPromise[_0x2d6c('0x8a')]()[_0x2d6c('0x2a')](function(){if(!_0x3d4a93){if(_0x2be8a2[_0x2d6c('0x3a')]['MailAccountId'])return;_0xca8394[_0x2d6c('0x44')](_0x2d6c('0x8b'));_0x1e2eda[_0x2d6c('0x44')](_0x2d6c('0x8b'));return;}if(_0x2be8a2[_0x2d6c('0x8c')][_0x2d6c('0x8d')]!=='agent')return;return _0x2be8a2[_0x2d6c('0x8c')][_0x2d6c('0x8e')]({'attributes':['id'],'raw':!![]})[_0x2d6c('0x2a')](function(_0x1281ea){if(_[_0x2d6c('0x88')](_0x1281ea)){_0xca8394[_0x2d6c('0x44')]('i.MailAccountId\x20IS\x20NULL');_0x1e2eda['where'](_0x2d6c('0x8f'));}else{_0xca8394[_0x2d6c('0x44')]('i.MailAccountId\x20IN\x20?',_['map'](_0x1281ea,'id'));_0x1e2eda[_0x2d6c('0x44')](_0x2d6c('0x6f'),_[_0x2d6c('0x20')](_0x1281ea,'id'));}});})[_0x2d6c('0x2a')](function(){if(_0x2be8a2[_0x2d6c('0x8c')][_0x2d6c('0x8d')]===_0x2d6c('0x90')&&!_0x3d4a93&&!_0x2be8a2['query'][_0x2d6c('0x91')])return[];return db[_0x2d6c('0x92')][_0x2d6c('0x3a')](_0xca8394[_0x2d6c('0x93')](),_0xfb7cb2);})[_0x2d6c('0x2a')](function(_0x580f81){_0x4ab3e0[_0x2d6c('0x16')]=_0x580f81['length'];if(_0x4ab3e0[_0x2d6c('0x16')]===0x0)return[];return db[_0x2d6c('0x92')][_0x2d6c('0x3a')](_0x4b930f['toString'](),_0xfb7cb2)['then'](function(_0x122464){_0x3d2759=_[_0x2d6c('0x94')](_0x122464,'id');_0xfb7cb2=_['merge'](_0xfb7cb2,{'model':db[_0x2d6c('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2be8a2[_0x2d6c('0x3a')][_0x2d6c('0x3e')]){_0x5a0771[_0x2d6c('0x3d')]['forEach'](function(_0x3a12be){_0x1e2eda[_0x2d6c('0x46')]('i.'+_0x3a12be);});}else{_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x86'),_0x2d6c('0x5d'));_0x1e2eda['field'](_0x2d6c('0x95'),'Account.key');_0x1e2eda[_0x2d6c('0x46')]('a.mandatoryDisposition',_0x2d6c('0x96'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x97'),'Account.email');_0x1e2eda['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x2d6c('0x98'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x84'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x99'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x9a'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x9b'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x9c'));_0x1e2eda['field'](_0x2d6c('0x9d'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x9e'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0x9f'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa0'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa1'));_0x1e2eda[_0x2d6c('0x46')]('i.secondDisposition');_0x1e2eda['field']('i.thirdDisposition');_0x1e2eda['field']('i.substatus');_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa2'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa3'));_0x1e2eda['field'](_0x2d6c('0xa4'));_0x1e2eda['field'](_0x2d6c('0xa5'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa6'),_0x2d6c('0xa7'));_0x1e2eda['field']('c.lastName',_0x2d6c('0xa8'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xa9'),_0x2d6c('0xaa'));_0x1e2eda['field'](_0x2d6c('0xab'),'Contact.phone');_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xac'),'Contact.mobile');_0x1e2eda[_0x2d6c('0x46')]('c.fax',_0x2d6c('0xad'));_0x1e2eda[_0x2d6c('0x46')](_0x2d6c('0xae'),_0x2d6c('0xaf'));_0x1e2eda[_0x2d6c('0x46')]('o.internal',_0x2d6c('0xb0'));_0x1e2eda['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2d6c('0x26'));}if(_0x5a0771[_0x2d6c('0x15')])_0x1e2eda['limit'](_0x5a0771['limit']);if(_0x5a0771[_0x2d6c('0x13')])_0x1e2eda[_0x2d6c('0x13')](_0x5a0771[_0x2d6c('0x13')]);return db[_0x2d6c('0x92')][_0x2d6c('0x3a')](_0x1e2eda['toString'](),_0xfb7cb2);})['then'](function(_0x435116){if(_0x435116[_0x2d6c('0x3f')]>0x0)_0x2b6a0b[_0x2d6c('0x44')](_0x2d6c('0xb1'),_['map'](_0x435116,'id'));return db[_0x2d6c('0x92')][_0x2d6c('0x3a')](_0x2b6a0b[_0x2d6c('0x93')](),_0xfb7cb2)[_0x2d6c('0x2a')](function(_0x10be59){var _0x3e34b1=_['groupBy'](_0x10be59,_0x2d6c('0xb2'));var _0x1b8d8e=[];return db[_0x2d6c('0xb3')][_0x2d6c('0xb4')]({'attributes':[_0x2d6c('0xb5')],'raw':!![]})['then'](function(_0x55c20e){var _0x298dd7=_0x55c20e[_0x2d6c('0xb5')];_0x435116[_0x2d6c('0x24')](function(_0x3526fc){_0x1b8d8e[_0x2d6c('0x25')](updateMailInteraction(_0x3526fc,_0x3d2759,_0x3e34b1,_0x298dd7));});return BPromise[_0x2d6c('0xb6')](_0x1b8d8e);});});});})[_0x2d6c('0x2a')](function(_0x44e369){_0x4ab3e0[_0x2d6c('0xb7')]=_0x44e369;return _0x4ab3e0;})[_0x2d6c('0x2a')](respondWithFilteredResult(_0x375557,_0x5a0771))['catch'](handleError(_0x375557,null));};exports[_0x2d6c('0xb8')]=function(_0xe7a314,_0x343313){var _0xb48645={'raw':![],'where':{'id':_0xe7a314[_0x2d6c('0xb9')]['id']}},_0x3169fa={};_0x3169fa[_0x2d6c('0x39')]=_[_0x2d6c('0x3b')](db[_0x2d6c('0x34')][_0x2d6c('0x35')]);_0x3169fa[_0x2d6c('0x3a')]=_['keys'](_0xe7a314[_0x2d6c('0x3a')]);_0x3169fa['filters']=_['intersection'](_0x3169fa[_0x2d6c('0x39')],_0x3169fa[_0x2d6c('0x3a')]);_0xb48645[_0x2d6c('0x3d')]=_[_0x2d6c('0xba')](_0x3169fa[_0x2d6c('0x39')],qs[_0x2d6c('0x3e')](_0xe7a314[_0x2d6c('0x3a')][_0x2d6c('0x3e')]));_0xb48645['attributes']=_0xb48645['attributes']['length']?_0xb48645[_0x2d6c('0x3d')]:_0x3169fa['model'];if(_0xe7a314[_0x2d6c('0x3a')][_0x2d6c('0xbb')]){_0xb48645[_0x2d6c('0xbc')]=[{'all':!![]}];}_0xb48645=_[_0x2d6c('0xbd')]({},_0xb48645,_0xe7a314[_0x2d6c('0xbe')]);return db['MailInteraction'][_0x2d6c('0x5c')](_0xb48645)['then'](handleEntityNotFound(_0x343313,null))[_0x2d6c('0x2a')](respondWithResult(_0x343313,null))[_0x2d6c('0x2d')](handleError(_0x343313,null));};exports[_0x2d6c('0xbf')]=function(_0x3f01d1,_0x494d97){return db['MailInteraction']['create'](_0x3f01d1['body'],{})[_0x2d6c('0x2a')](respondWithResult(_0x494d97,0xc9))[_0x2d6c('0x2d')](handleError(_0x494d97,null));};exports[_0x2d6c('0xc0')]=function(_0x32619b,_0x34c4f5){if(_0x32619b[_0x2d6c('0xc1')]['id']){delete _0x32619b[_0x2d6c('0xc1')]['id'];}return db[_0x2d6c('0x34')][_0x2d6c('0x5c')]({'where':{'id':_0x32619b['params']['id']}})['then'](handleEntityNotFound(_0x34c4f5,null))[_0x2d6c('0x2a')](saveUpdates(_0x32619b[_0x2d6c('0xc1')],null))[_0x2d6c('0x2a')](respondWithResult(_0x34c4f5,null))[_0x2d6c('0x2d')](handleError(_0x34c4f5,null));};exports[_0x2d6c('0x1a')]=function(_0x5a2f0c,_0x4848ca){return db[_0x2d6c('0x34')][_0x2d6c('0x5c')]({'where':{'id':_0x5a2f0c[_0x2d6c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4848ca,null))[_0x2d6c('0x2a')](removeEntity(_0x4848ca,null))['catch'](handleError(_0x4848ca,null));};exports[_0x2d6c('0xc2')]=function(_0x4c20db,_0x283df0){return db[_0x2d6c('0x34')][_0x2d6c('0xc2')]()['then'](respondWithResult(_0x283df0,null))[_0x2d6c('0x2d')](handleError(_0x283df0,null));};exports[_0x2d6c('0xc3')]=function(_0x4b70a1,_0x40a62b){return db[_0x2d6c('0x27')][_0x2d6c('0x5c')]({'where':{'id':_0x4b70a1['params']['id']}})[_0x2d6c('0x2a')](handleEntityNotFound(_0x40a62b,null))[_0x2d6c('0x2a')](function(_0x47ccff){if(_0x47ccff){return _0x47ccff[_0x2d6c('0xc3')](_0x4b70a1[_0x2d6c('0xc1')][_0x2d6c('0xc4')],_['omit'](_0x4b70a1[_0x2d6c('0xc1')],[_0x2d6c('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x40a62b,null))['catch'](handleError(_0x40a62b,null));};exports['getMessages']=function(_0x1a0a25,_0x5ebc2e){var _0x12c9e5={'raw':![],'where':{}};var _0x40eed5={};var _0x150340={'count':0x0,'rows':[]};return db[_0x2d6c('0x34')]['findOne']({'where':{'id':_0x1a0a25['params']['id']}})['then'](handleEntityNotFound(_0x5ebc2e,null))[_0x2d6c('0x2a')](function(_0x5db0c8){if(_0x5db0c8){_0x40eed5[_0x2d6c('0x39')]=_['keys'](db[_0x2d6c('0x27')][_0x2d6c('0x35')]);_0x40eed5[_0x2d6c('0x3a')]=_[_0x2d6c('0x3b')](_0x1a0a25[_0x2d6c('0x3a')]);_0x40eed5[_0x2d6c('0x3c')]=_['intersection'](_0x40eed5[_0x2d6c('0x39')],_0x40eed5['query']);_0x12c9e5[_0x2d6c('0x3d')]=_[_0x2d6c('0xba')](_0x40eed5[_0x2d6c('0x39')],qs[_0x2d6c('0x3e')](_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0x3e')]));_0x12c9e5[_0x2d6c('0x3d')]=_0x12c9e5[_0x2d6c('0x3d')][_0x2d6c('0x3f')]?_0x12c9e5[_0x2d6c('0x3d')]:_0x40eed5[_0x2d6c('0x39')];if(!_0x1a0a25['query'][_0x2d6c('0x40')](_0x2d6c('0x41'))){_0x12c9e5[_0x2d6c('0x15')]=qs['limit'](_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0x15')]);_0x12c9e5[_0x2d6c('0x13')]=qs[_0x2d6c('0x13')](_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0x13')]);}_0x12c9e5[_0x2d6c('0x42')]=qs[_0x2d6c('0x43')](_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0x43')]);_0x12c9e5[_0x2d6c('0x44')]=qs[_0x2d6c('0x3c')](_['pick'](_0x1a0a25[_0x2d6c('0x3a')],_0x40eed5[_0x2d6c('0x3c')]));_0x12c9e5['where'][_0x2d6c('0xb2')]=_0x5db0c8['id'];if(_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0x7b')]){_0x12c9e5[_0x2d6c('0x44')]=_['merge'](_0x12c9e5[_0x2d6c('0x44')],{'$or':_[_0x2d6c('0x20')](_0x12c9e5[_0x2d6c('0x3d')],function(_0x5ae511){var _0x403aba={};_0x403aba[_0x5ae511]={'$like':'%'+_0x1a0a25['query']['filter']+'%'};return _0x403aba;})});}if(_0x1a0a25[_0x2d6c('0x3a')]['$gte']){var _0x41deac=_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0xc5')][_0x2d6c('0x23')](',');var _0x394943={};_0x394943[_0x41deac[0x0]]={'$gte':moment(_0x41deac[0x1])[_0x2d6c('0xc6')](_0x2d6c('0xc7'))};_0x12c9e5[_0x2d6c('0x44')]=_[_0x2d6c('0xbd')](_0x12c9e5[_0x2d6c('0x44')],_0x394943);}_0x12c9e5=_[_0x2d6c('0xbd')]({},_0x12c9e5,_0x1a0a25['options']);return db['MailMessage'][_0x2d6c('0x16')]({'where':_0x12c9e5[_0x2d6c('0x44')]})['then'](function(_0x435916){_0x150340[_0x2d6c('0x16')]=_0x435916;if(_0x1a0a25[_0x2d6c('0x3a')][_0x2d6c('0xbb')]){_0x12c9e5['include']=[{'all':!![]}];}return db[_0x2d6c('0x27')][_0x2d6c('0xc8')](_0x12c9e5);})[_0x2d6c('0x2a')](function(_0xab300e){if(_0x1a0a25[_0x2d6c('0x3a')]['inlineCss']==='true'){for(var _0x1f3bc0=0x0;_0x1f3bc0<_0xab300e['length'];_0x1f3bc0++){_0xab300e[_0x1f3bc0][_0x2d6c('0xc1')]=juice(_0xab300e[_0x1f3bc0][_0x2d6c('0xc1')]);}}_0x150340[_0x2d6c('0xb7')]=_0xab300e;return _0x150340;});}})[_0x2d6c('0x2a')](respondWithFilteredResult(_0x5ebc2e,_0x12c9e5))[_0x2d6c('0x2d')](handleError(_0x5ebc2e,null));};exports[_0x2d6c('0xc9')]=function(_0x4b2639,_0x362fbd){return db[_0x2d6c('0x34')][_0x2d6c('0x5c')]({'where':{'id':_0x4b2639[_0x2d6c('0xb9')]['id']}})[_0x2d6c('0x2a')](handleEntityNotFound(_0x362fbd,null))[_0x2d6c('0x2a')](function(_0x43a402){if(_0x43a402){return _0x43a402[_0x2d6c('0xca')](_0x4b2639[_0x2d6c('0xc1')][_0x2d6c('0xc4')],_[_0x2d6c('0xcb')](_0x4b2639[_0x2d6c('0xc1')],[_0x2d6c('0xc4'),'id'])||{})['spread'](function(){return db[_0x2d6c('0x69')][_0x2d6c('0xc8')]({'attributes':['id',_0x2d6c('0x1d'),'color'],'where':{'id':_0x4b2639[_0x2d6c('0xc1')][_0x2d6c('0xc4')]}});})[_0x2d6c('0x2a')](function(_0x57c02d){socket['emit'](_0x2d6c('0xcc'),{'id':Number(_0x4b2639[_0x2d6c('0xb9')]['id']),'tags':_0x57c02d||[]});return{'id':Number(_0x4b2639[_0x2d6c('0xb9')]['id']),'tags':_0x57c02d||[]};});}})[_0x2d6c('0x2a')](respondWithResult(_0x362fbd,null))[_0x2d6c('0x2d')](handleError(_0x362fbd,null));};exports[_0x2d6c('0xcd')]=function(_0x12cd68,_0x590c18){return db[_0x2d6c('0x34')][_0x2d6c('0x5c')]({'where':{'id':_0x12cd68[_0x2d6c('0xb9')]['id']}})[_0x2d6c('0x2a')](handleEntityNotFound(_0x590c18,null))[_0x2d6c('0x2a')](function(_0x4c6678){if(_0x4c6678){return _0x4c6678[_0x2d6c('0xcd')](_0x12cd68[_0x2d6c('0x3a')][_0x2d6c('0xc4')]);}})['then'](respondWithStatusCode(_0x590c18,null))[_0x2d6c('0x2d')](handleError(_0x590c18,null));};exports[_0x2d6c('0xce')]=function(_0x446ef8,_0xa0eb3d){var _0x206a18=moment()[_0x2d6c('0xcf')]()[_0x2d6c('0x93')]();var _0x58286d=path[_0x2d6c('0xd0')](config[_0x2d6c('0xd1')],_0x2d6c('0xd2'),'files',_0x2d6c('0xd3'));var _0x3fdead=path[_0x2d6c('0xd0')](config['root'],_0x2d6c('0xd2'),_0x2d6c('0xd4'),_0x2d6c('0xd5'));var _0x2c656d=path[_0x2d6c('0xd0')](_0x58286d,_0x206a18);var _0xdb730d=util[_0x2d6c('0xc6')](_0x2d6c('0xd6'),_0x446ef8[_0x2d6c('0xb9')]['id'],_0x206a18);var _0x59496e=path[_0x2d6c('0xd0')](_0x58286d,_0xdb730d);var _0x3ceb29=[];if(_0x446ef8['query']['attachments']){_0x3ceb29['push']({'model':db[_0x2d6c('0xd7')],'as':_0x2d6c('0xd8'),'raw':!![]});}var _0x566b4b=[{'model':db[_0x2d6c('0x27')],'as':'Messages','attributes':['id',_0x2d6c('0xc1'),_0x2d6c('0x48'),'to','cc','bcc',_0x2d6c('0xd9'),_0x2d6c('0x71')],'where':{'secret':![]},'order':qs[_0x2d6c('0x43')]('id'),'include':_0x3ceb29}];return db[_0x2d6c('0x34')][_0x2d6c('0x5c')]({'where':{'id':_0x446ef8[_0x2d6c('0xb9')]['id']},'include':_0x566b4b})[_0x2d6c('0x2a')](handleEntityNotFound(_0xa0eb3d,null))[_0x2d6c('0x2a')](function(_0x2cfe75){if(_0x2cfe75&&_0x2cfe75[_0x2d6c('0xda')]){var _0x4caa8f=_0x2cfe75['get']({'plain':!![]});fs['mkdirSync'](_0x2c656d);return BPromise[_0x2d6c('0xdb')](_0x4caa8f[_0x2d6c('0xda')],function(_0x2b1c08,_0x235813){var _0x58453e={'from':_0x2b1c08[_0x2d6c('0x48')],'to':_0x2b1c08['to'],'subject':_0x2b1c08['subject'],'html':htmlEntities[_0x2d6c('0xdc')](_0x2b1c08[_0x2d6c('0xc1')]),'headers':{'Date':moment(_0x2b1c08['createdAt'])[_0x2d6c('0xc6')](_0x2d6c('0xdd'))},'attachments':[]};if(_0x2b1c08['cc']){_0x58453e[_0x2d6c('0xde')]['Cc']=_0x2b1c08['cc'];}if(_0x2b1c08[_0x2d6c('0xdf')]){_0x58453e[_0x2d6c('0xde')][_0x2d6c('0xe0')]=_0x2b1c08[_0x2d6c('0xdf')];}return new BPromise(function(_0x41a1cd,_0x6fdbbe){if(_0x2b1c08['Attachments']){for(var _0x5e502a=0x0;_0x5e502a<_0x2b1c08[_0x2d6c('0xd8')][_0x2d6c('0x3f')];_0x5e502a++){var _0x169942=_0x2b1c08[_0x2d6c('0xd8')][_0x5e502a];var _0x491e0b=path[_0x2d6c('0xd0')](_0x3fdead,_0x169942[_0x2d6c('0xe1')]);if(fs['existsSync'](_0x491e0b)){_0x58453e['attachments'][_0x2d6c('0x25')]({'name':_0x169942[_0x2d6c('0x1d')],'contentType':_0x169942[_0x2d6c('0x37')],'data':fs['readFileSync'](_0x491e0b)});}}}emlformat[_0x2d6c('0xe2')](_0x58453e,function(_0x28f97f,_0x2a3c6d){if(_0x28f97f)return _0x6fdbbe(_0x28f97f);fs[_0x2d6c('0xe3')](path[_0x2d6c('0xd0')](_0x2c656d,util['format'](_0x2d6c('0xe4'),_0x235813)),_0x2a3c6d);return _0x41a1cd(_0x2a3c6d);});});})[_0x2d6c('0x2a')](function(){return new BPromise(function(_0x1d4423,_0x3c25b6){zipdir(_0x2c656d,{'saveTo':_0x59496e},function(_0x5caa6d,_0xd7519f){if(_0x5caa6d)return _0x3c25b6(_0x5caa6d);return _0x1d4423(_0xd7519f);});})[_0x2d6c('0x2a')](function(){return new BPromise(function(_0x14681d,_0x4281a7){rimraf(_0x2c656d,function(_0x4678a5){if(_0x4678a5)_0x4281a7(_0x4678a5);return _0x14681d();});});})[_0x2d6c('0x2a')](function(){return _0xa0eb3d['download'](_0x59496e,_0xdb730d,function(_0x26feb6){if(!_0x26feb6)fs[_0x2d6c('0xe5')](_0x59496e);});});});}else{return _0xa0eb3d[_0x2d6c('0x10')](0xc8);}})[_0x2d6c('0x2d')](handleError(_0xa0eb3d,null));}; \ No newline at end of file +var _0x5ca8=['isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','role','sequelize','toString','merge','MailInteraction','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','rows','show','params','keys','rawAttributes','includeAll','include','options','create','body','destroy','describe','addMessage','ids','getMessages','nolimit','format','inlineCss','true','addTags','setTags','omit','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','Attachment','Attachments','bcc','subject','get','mkdirSync','each','Messages','decode','headers','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','squel','juice','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','register','end','json','offset','undefined','count','limit','set','Content-Range','update','then','sendStatus','stack','name','status','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','plainBody','lastMsgText','trimStart','catch','waiting','talking','total','closed','UserId','answered','unmanaged','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.id','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','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','find','value','having','`\x20>\x200','Contact','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?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','MailAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0x5ca8,0x71));var _0x85ca=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5ca8[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x85ca('0x0'));var rimraf=require(_0x85ca('0x1'));var zipdir=require(_0x85ca('0x2'));var moment=require(_0x85ca('0x3'));var BPromise=require(_0x85ca('0x4'));var util=require(_0x85ca('0x5'));var path=require(_0x85ca('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85ca('0x7'));var juice=require(_0x85ca('0x8'));var Redis=require(_0x85ca('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0x85ca('0xa'));var logger=require('../../config/logger')(_0x85ca('0xb'));var config=require(_0x85ca('0xc'));var db=require(_0x85ca('0xd'))['db'];var htmlEntities=require(_0x85ca('0xe'));config['redis']=_[_0x85ca('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85ca('0x10')]));require('./mailInteraction.socket')[_0x85ca('0x11')](socket);function respondWithStatusCode(_0x569b5e,_0x5032f3){_0x5032f3=_0x5032f3||0xcc;return function(_0x1b7063){if(_0x1b7063){return _0x569b5e['sendStatus'](_0x5032f3);}return _0x569b5e['status'](_0x5032f3)[_0x85ca('0x12')]();};}function respondWithResult(_0x2177c0,_0x359aee){_0x359aee=_0x359aee||0xc8;return function(_0x1444f8){if(_0x1444f8){return _0x2177c0['status'](_0x359aee)[_0x85ca('0x13')](_0x1444f8);}};}function respondWithFilteredResult(_0x506ce1,_0x28e906){return function(_0x3cb192){if(_0x3cb192){var _0x2619d0=typeof _0x28e906[_0x85ca('0x14')]===_0x85ca('0x15')&&typeof _0x28e906['limit']===_0x85ca('0x15');var _0x502e28=_0x3cb192[_0x85ca('0x16')];var _0x1acbce=_0x2619d0?0x0:_0x28e906[_0x85ca('0x14')];var _0x112d11=_0x2619d0?_0x3cb192['count']:_0x28e906[_0x85ca('0x14')]+_0x28e906[_0x85ca('0x17')];var _0x53abb7;if(_0x112d11>=_0x502e28){_0x112d11=_0x502e28;_0x53abb7=0xc8;}else{_0x53abb7=0xce;}_0x506ce1['status'](_0x53abb7);return _0x506ce1[_0x85ca('0x18')](_0x85ca('0x19'),_0x1acbce+'-'+_0x112d11+'/'+_0x502e28)[_0x85ca('0x13')](_0x3cb192);}return null;};}function saveUpdates(_0x1ff9e5){return function(_0xed2355){if(_0xed2355){return _0xed2355[_0x85ca('0x1a')](_0x1ff9e5)[_0x85ca('0x1b')](function(_0x25777){return _0x25777;});}return null;};}function removeEntity(_0x498244){return function(_0x34eff2){if(_0x34eff2){return _0x34eff2['destroy']()[_0x85ca('0x1b')](function(){_0x498244['status'](0xcc)[_0x85ca('0x12')]();});}};}function handleEntityNotFound(_0x485a7d){return function(_0xc3835c){if(!_0xc3835c){_0x485a7d[_0x85ca('0x1c')](0x194);}return _0xc3835c;};}function handleError(_0x53da01,_0x15fd14){_0x15fd14=_0x15fd14||0x1f4;return function(_0x30ea55){logger['error'](_0x30ea55[_0x85ca('0x1d')]);if(_0x30ea55[_0x85ca('0x1e')]){delete _0x30ea55[_0x85ca('0x1e')];}_0x53da01[_0x85ca('0x1f')](_0x15fd14)['send'](_0x30ea55);};}function getInteractionUsers(_0x577c2d,_0x445775){return new BPromise(function(_0x3fa143,_0x453068){try{if(_0x445775[_0x577c2d['id']]){_0x577c2d['Users']=_['map'](_0x445775[_0x577c2d['id']],function(_0x152001){return{'id':_0x152001['id'],'fullname':_0x152001[_0x85ca('0x20')]};});}}catch(_0x5eec3c){_0x453068(_0x5eec3c);}_0x3fa143(_0x577c2d);});}function getInteractionTags(_0x4e5b17,_0x4b9357){return new BPromise(function(_0x537148,_0x3e479d){try{if(_0x4e5b17[_0x85ca('0x21')]){_0x4e5b17[_0x85ca('0x22')]=[];_0x4e5b17[_0x85ca('0x21')][_0x85ca('0x23')](',')[_0x85ca('0x24')](function(_0x44081f){_0x4e5b17['Tags'][_0x85ca('0x25')](_0x4b9357[_0x44081f]);});}delete _0x4e5b17['TagIds'];}catch(_0x1243ad){_0x3e479d(_0x1243ad);}_0x537148(_0x4e5b17);});}function getLastMessageText(_0x37b1dc){return new BPromise(function(_0x436ea4,_0x2f03c8){return db[_0x85ca('0x26')][_0x85ca('0x27')]({'where':{'$and':[{'MailInteractionId':_0x37b1dc['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x85ca('0x1b')](function(_0x26563b){if(_0x26563b&&_0x26563b[_0x85ca('0x28')]){_0x37b1dc[_0x85ca('0x29')]=_[_0x85ca('0x2a')](_0x26563b[_0x85ca('0x28')]);}_0x436ea4(_0x37b1dc);})[_0x85ca('0x2b')](function(_0x351ed7){_0x2f03c8(_0x351ed7);});});}function updateMailInteraction(_0x3e887d,_0x5f5653,_0x40474a,_0x410ed5){return new BPromise(function(_0x4688c9,_0x25ff35){return getInteractionUsers(_0x3e887d,_0x40474a)[_0x85ca('0x1b')](function(_0xcce14e){return getInteractionTags(_0xcce14e,_0x5f5653);})[_0x85ca('0x1b')](function(_0xe6094c){return getStateInteraction(_0xe6094c);})[_0x85ca('0x1b')](function(_0x555f25){if(_0x410ed5){_0x4688c9(getLastMessageText(_0x555f25));}else{_0x4688c9(_0x555f25);}})[_0x85ca('0x2b')](function(_0x3209b8){_0x25ff35(_0x3209b8);});});}function getStateInteraction(_0x106571){return new BPromise(function(_0x3780f4){_0x106571[_0x85ca('0x2c')]=0x0;_0x106571[_0x85ca('0x2d')]=0x0;_0x106571['answered']=0x0;_0x106571['unmanaged']=0x0;_0x106571[_0x85ca('0x2e')]=0x0;if(!_0x106571[_0x85ca('0x2f')]&&!_0x106571[_0x85ca('0x30')]){_0x106571[_0x85ca('0x2c')]+=0x1;}if(!_0x106571[_0x85ca('0x2f')]&&_0x106571[_0x85ca('0x30')]){_0x106571[_0x85ca('0x2d')]+=0x1;if(_0x106571[_0x85ca('0x2c')]){_0x106571[_0x85ca('0x2c')]-=0x1;}}if(_0x106571['closed']&&_0x106571[_0x85ca('0x30')]){_0x106571[_0x85ca('0x31')]+=0x1;if(_0x106571[_0x85ca('0x2d')]){_0x106571[_0x85ca('0x2d')]-=0x1;}}if(_0x106571[_0x85ca('0x2f')]&&!_0x106571[_0x85ca('0x30')]){_0x106571[_0x85ca('0x32')]+=0x1;if(_0x106571['waiting']){_0x106571[_0x85ca('0x2c')]-=0x1;}}_0x106571[_0x85ca('0x2e')]+=0x1;_0x3780f4(_0x106571);});}exports[_0x85ca('0x33')]=function(_0x20e3e1,_0x3fcc4a){var _0x4c68f8={},_0x50d383={},_0x57adb3={'count':0x0,'rows':[]};var _0x2af0c6=_[_0x85ca('0x34')](db['MailInteraction']['rawAttributes'],function(_0x7749b5){return{'name':_0x7749b5[_0x85ca('0x35')],'type':_0x7749b5[_0x85ca('0x36')][_0x85ca('0x37')]};});_0x50d383[_0x85ca('0x38')]=_[_0x85ca('0x34')](_0x2af0c6,_0x85ca('0x1e'));_0x50d383[_0x85ca('0x39')]=_['keys'](_0x20e3e1['query']);_0x50d383[_0x85ca('0x3a')]=_[_0x85ca('0x3b')](_0x50d383[_0x85ca('0x38')],_0x50d383['query']);_0x4c68f8[_0x85ca('0x3c')]=_[_0x85ca('0x3b')](_0x50d383[_0x85ca('0x38')],qs[_0x85ca('0x3d')](_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x3d')]));_0x4c68f8['attributes']=_0x4c68f8[_0x85ca('0x3c')][_0x85ca('0x3e')]?_0x4c68f8['attributes']:_0x50d383[_0x85ca('0x38')];if(!_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x3f')]('nolimit')){_0x4c68f8[_0x85ca('0x17')]=qs[_0x85ca('0x17')](_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x17')]);_0x4c68f8[_0x85ca('0x14')]=qs['offset'](_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x14')]);}_0x4c68f8[_0x85ca('0x40')]=qs[_0x85ca('0x41')](_0x20e3e1['query'][_0x85ca('0x41')]);_0x4c68f8[_0x85ca('0x42')]=qs[_0x85ca('0x3a')](_[_0x85ca('0x43')](_0x20e3e1['query'],_0x50d383[_0x85ca('0x3a')]),_0x2af0c6);var _0x24f025=[];var _0x58c609=squel[_0x85ca('0x44')]()['field']('id')['field'](_0x85ca('0x1e'))[_0x85ca('0x45')](_0x85ca('0x46'))[_0x85ca('0x47')](_0x85ca('0x48'));var _0x5419c9=squel[_0x85ca('0x44')]()[_0x85ca('0x45')](_0x85ca('0x49'))['field']('u.fullname')[_0x85ca('0x45')]('ui.MailInteractionId')['from']('user_has_mail_interactions','ui')[_0x85ca('0x4a')](_0x85ca('0x4b'),'u',_0x85ca('0x4c'));var _0x5b6e14=squel['select']()[_0x85ca('0x47')](_0x85ca('0x4d'),'i')[_0x85ca('0x4a')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x85ca('0x4b'),'o',_0x85ca('0x4e'))[_0x85ca('0x4a')](_0x85ca('0x4f'),'a',_0x85ca('0x50'))[_0x85ca('0x4a')](_0x85ca('0x51'),'me',_0x85ca('0x52'))[_0x85ca('0x4a')](_0x85ca('0x53'),'it',_0x85ca('0x54'))[_0x85ca('0x4a')](_0x85ca('0x48'),'t',_0x85ca('0x55'));var _0x301f02=squel[_0x85ca('0x56')]();var _0x31c269=[];var _0x1c6759=squel[_0x85ca('0x56')]();var _0x1b0602;if(_0x20e3e1['query'][_0x85ca('0x57')]){_0x1b0602=as[_0x85ca('0x58')](_0x20e3e1[_0x85ca('0x39')]['search']);var _0x1c563b=_0x1b0602[_0x85ca('0x59')];for(var _0x11d96b=0x0;_0x11d96b<_0x1b0602[_0x85ca('0x5a')][_0x85ca('0x3e')];_0x11d96b++){var _0x13fbfb=_0x1b0602[_0x85ca('0x5a')][_0x11d96b];var _0x4d7f3f='i';var _0x1432fa=_[_0x85ca('0x5b')](_0x2af0c6,[_0x85ca('0x1e'),_0x13fbfb[_0x85ca('0x45')]]);if(!_0x1432fa){switch(_0x13fbfb[_0x85ca('0x45')]){case'unreadMessages':if(_0x13fbfb[_0x85ca('0x5c')]==0x1){_0x5b6e14[_0x85ca('0x5d')]('`'+_0x13fbfb['field']+'`\x20=\x200');}else{_0x5b6e14[_0x85ca('0x5d')]('`'+_0x13fbfb[_0x85ca('0x45')]+_0x85ca('0x5e'));}break;case _0x85ca('0x5f'):if(_0x13fbfb['operator']==='$substring'){if(_0x13fbfb['value']['split']('\x20')[_0x85ca('0x3e')]>0x1){_0x301f02[_0x1c563b](_0x85ca('0x60'),qs[_0x85ca('0x61')](_0x13fbfb[_0x85ca('0x5c')]),null);}else{var _0x1340d6='%'+_0x13fbfb[_0x85ca('0x5c')]+'%';_0x301f02[_0x1c563b](_0x85ca('0x62'),_0x1340d6,_0x1340d6,_0x1340d6);}}else{_0x1432fa=_[_0x85ca('0x5b')](_0x2af0c6,['name',_0x85ca('0x63')]);_0x13fbfb['field']=_0x85ca('0x63');_0x20d0be=as[_0x85ca('0x64')](_0x4d7f3f,_0x1432fa['type'],_0x13fbfb);_0x301f02[_0x1c563b](_0x20d0be[_0x85ca('0x65')],_0x20d0be['value'][_0x85ca('0x66')],_0x20d0be[_0x85ca('0x5c')][_0x85ca('0x12')]);}break;case _0x85ca('0x67'):var _0x4825ff=_0x13fbfb[_0x85ca('0x5c')][_0x85ca('0x23')](',')['map'](function(_0x13e411){return Number(_0x13e411);});_0x4825ff['forEach'](function(_0x42d886){_0x1c6759['or'](_0x85ca('0x68'),'%,'+_0x42d886+',%');});_0x31c269=_[_0x85ca('0x69')](_0x31c269,_0x4825ff);break;case _0x85ca('0x6a'):if(_0x13fbfb[_0x85ca('0x6b')]===_0x85ca('0x6c')){_0x301f02[_0x1c563b](_0x85ca('0x6d'),'%'+_0x13fbfb['value']+'%',null);}else{_0x1432fa=_[_0x85ca('0x5b')](_0x2af0c6,[_0x85ca('0x1e'),'UserId']);_0x13fbfb['field']=_0x85ca('0x30');_0x20d0be=as[_0x85ca('0x64')](_0x4d7f3f,_0x1432fa['type'],_0x13fbfb);_0x301f02[_0x1c563b](_0x20d0be[_0x85ca('0x65')],_0x20d0be[_0x85ca('0x5c')]['start'],_0x20d0be[_0x85ca('0x5c')][_0x85ca('0x12')]);}break;case _0x85ca('0x28'):_0x20d0be=as['buildExpression']('me',null,_0x13fbfb);_0x301f02[_0x1c563b](_0x20d0be[_0x85ca('0x65')],_0x20d0be['value'][_0x85ca('0x66')],_0x20d0be[_0x85ca('0x5c')]['end']);break;}}else{var _0x20d0be=as['buildExpression'](_0x4d7f3f,_0x1432fa[_0x85ca('0x36')],_0x13fbfb);_0x301f02[_0x1c563b](_0x20d0be[_0x85ca('0x65')],_0x20d0be[_0x85ca('0x5c')]['start'],_0x20d0be[_0x85ca('0x5c')][_0x85ca('0x12')]);}}}else{var _0x495741=_(_0x20e3e1[_0x85ca('0x39')])['keys']()[_0x85ca('0x34')](function(_0x2f7806){return _[_0x85ca('0x6e')](_0x2af0c6,[_0x85ca('0x1e'),_0x2f7806])?_0x2f7806:undefined;})['compact']()[_0x85ca('0x5c')]();if(!_['isEmpty'](_0x495741)){_0x495741['forEach'](function(_0x40a99b){if(_0x40a99b===_0x85ca('0x6f')){_0x5b6e14['where']('i.MailAccountId\x20IN\x20?',[][_0x85ca('0x70')](_0x20e3e1[_0x85ca('0x39')][_0x40a99b]));}else if(_0x40a99b===_0x85ca('0x71')){var _0x137cc8=JSON['parse'](_0x20e3e1['query'][_0x40a99b])[_0x85ca('0x72')];var _0x33853d=JSON[_0x85ca('0x73')](_0x20e3e1[_0x85ca('0x39')][_0x40a99b])[_0x85ca('0x74')];_0x5b6e14['where'](_0x85ca('0x75'),_0x137cc8,_0x33853d);}else{if(_0x20e3e1[_0x85ca('0x39')][_0x40a99b]==='null'){_0x5b6e14[_0x85ca('0x42')]('i.'+_0x40a99b+_0x85ca('0x76'));}else{_0x5b6e14[_0x85ca('0x42')]('i.'+_0x40a99b+_0x85ca('0x77'),_0x20e3e1[_0x85ca('0x39')][_0x40a99b]);}}});}if(_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x78')]){if(_0x20e3e1[_0x85ca('0x39')]['read']==0x1){_0x5b6e14[_0x85ca('0x5d')](_0x85ca('0x79'));}else{_0x5b6e14[_0x85ca('0x5d')](_0x85ca('0x7a'));}}if(_0x20e3e1['query'][_0x85ca('0x7b')]){_0x31c269=_[_0x85ca('0x7c')](_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x7b')])?_0x20e3e1[_0x85ca('0x39')]['tag']:new Array(_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x7b')]);_0x31c269[_0x85ca('0x24')](function(_0x1bfd08){_0x1c6759['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bfd08+',%');});}if(_0x20e3e1['query'][_0x85ca('0x7d')]){var _0x330fc3=_0x20e3e1['query'][_0x85ca('0x7d')]['replace']('\x5c','\x5c\x5c')[_0x85ca('0x7e')](/'/g,'\x27\x27');if(qs[_0x85ca('0x7f')](_0x330fc3)){_0x301f02['or'](_0x85ca('0x80'),_0x330fc3+'%');}else if(qs[_0x85ca('0x81')](_0x330fc3)){_0x301f02['or'](_0x85ca('0x82'),_0x330fc3+'%');}else{_0x301f02['or'](_0x85ca('0x83'),qs['getFullTextValue'](_0x330fc3))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x330fc3));}}}_0x5b6e14[_0x85ca('0x42')](_0x301f02);_0x5b6e14[_0x85ca('0x84')]('i.id');var _0x2344ad={'type':db[_0x85ca('0x85')]['QueryTypes']['SELECT'],'raw':!![]};var _0x11ba1b=_0x5b6e14[_0x85ca('0x86')]();_0x11ba1b[_0x85ca('0x45')]('i.id');_0x11ba1b[_0x85ca('0x45')](_0x85ca('0x87'),_0x85ca('0x88'));if(_0x4c68f8[_0x85ca('0x40')]){_0x4c68f8[_0x85ca('0x40')][_0x85ca('0x24')](function(_0x221549){var _0x25c7bc=_0x221549[0x0]===_0x85ca('0x89')?_0x221549[0x0]:'i.'+_0x221549[0x0];_0x5b6e14[_0x85ca('0x40')](_0x25c7bc,_0x221549[0x1]===_0x85ca('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x31c269)){_0x5b6e14[_0x85ca('0x5d')](_0x1c6759);_0x11ba1b[_0x85ca('0x42')](_0x85ca('0x8b'),_0x31c269);}BPromise['resolve']()[_0x85ca('0x1b')](function(){if(!_0x1b0602){if(_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x6f')])return;_0x11ba1b['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x5b6e14[_0x85ca('0x42')](_0x85ca('0x8c'));return;}if(_0x20e3e1[_0x85ca('0x8d')]['role']!==_0x85ca('0x8e'))return;return _0x20e3e1[_0x85ca('0x8d')][_0x85ca('0x8f')]({'attributes':['id'],'raw':!![]})[_0x85ca('0x1b')](function(_0x4816ac){if(_['isEmpty'](_0x4816ac)){_0x11ba1b['where'](_0x85ca('0x90'));_0x5b6e14['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x11ba1b[_0x85ca('0x42')](_0x85ca('0x91'),_['map'](_0x4816ac,'id'));_0x5b6e14[_0x85ca('0x42')](_0x85ca('0x91'),_[_0x85ca('0x34')](_0x4816ac,'id'));}});})[_0x85ca('0x1b')](function(){if(_0x20e3e1[_0x85ca('0x8d')][_0x85ca('0x92')]===_0x85ca('0x8e')&&!_0x1b0602&&!_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x6f')])return[];return db[_0x85ca('0x93')][_0x85ca('0x39')](_0x11ba1b[_0x85ca('0x94')](),_0x2344ad);})[_0x85ca('0x1b')](function(_0x5d8843){_0x57adb3[_0x85ca('0x16')]=_0x5d8843['length'];if(_0x57adb3['count']===0x0)return[];return db[_0x85ca('0x93')][_0x85ca('0x39')](_0x58c609[_0x85ca('0x94')](),_0x2344ad)[_0x85ca('0x1b')](function(_0x467708){_0x24f025=_['keyBy'](_0x467708,'id');_0x2344ad=_[_0x85ca('0x95')](_0x2344ad,{'model':db[_0x85ca('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20e3e1[_0x85ca('0x39')][_0x85ca('0x3d')]){_0x4c68f8[_0x85ca('0x3c')][_0x85ca('0x24')](function(_0x29a5a4){_0x5b6e14['field']('i.'+_0x29a5a4);});}else{_0x5b6e14[_0x85ca('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85ca('0x88'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0x97'),_0x85ca('0x98'));_0x5b6e14['field'](_0x85ca('0x99'),'Account.mandatoryDisposition');_0x5b6e14[_0x85ca('0x45')](_0x85ca('0x9a'),_0x85ca('0x9b'));_0x5b6e14['field'](_0x85ca('0x9c'),_0x85ca('0x89'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0x9d'));_0x5b6e14['field'](_0x85ca('0x9e'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0x9f'));_0x5b6e14[_0x85ca('0x45')]('i.closed');_0x5b6e14['field'](_0x85ca('0xa0'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa1'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa2'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa3'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa4'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa5'));_0x5b6e14['field'](_0x85ca('0xa6'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa7'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa8'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xa9'));_0x5b6e14['field'](_0x85ca('0xaa'));_0x5b6e14[_0x85ca('0x45')]('i.MailAccountId');_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xab'));_0x5b6e14['field']('c.firstName',_0x85ca('0xac'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xad'),_0x85ca('0xae'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xaf'),_0x85ca('0xb0'));_0x5b6e14['field'](_0x85ca('0xb1'),_0x85ca('0xb2'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xb3'),_0x85ca('0xb4'));_0x5b6e14[_0x85ca('0x45')]('c.fax','Contact.fax');_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xb5'),_0x85ca('0xb6'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xb7'),_0x85ca('0xb8'));_0x5b6e14[_0x85ca('0x45')](_0x85ca('0xb9'),_0x85ca('0x21'));}if(_0x4c68f8[_0x85ca('0x17')])_0x5b6e14['limit'](_0x4c68f8[_0x85ca('0x17')]);if(_0x4c68f8[_0x85ca('0x14')])_0x5b6e14[_0x85ca('0x14')](_0x4c68f8[_0x85ca('0x14')]);return db[_0x85ca('0x93')][_0x85ca('0x39')](_0x5b6e14['toString'](),_0x2344ad);})['then'](function(_0x52fba5){if(_0x52fba5[_0x85ca('0x3e')]>0x0)_0x5419c9['where'](_0x85ca('0xba'),_[_0x85ca('0x34')](_0x52fba5,'id'));return db[_0x85ca('0x93')][_0x85ca('0x39')](_0x5419c9[_0x85ca('0x94')](),_0x2344ad)[_0x85ca('0x1b')](function(_0x41c16a){var _0x56e39e=_[_0x85ca('0xbb')](_0x41c16a,_0x85ca('0xbc'));var _0x568a6a=[];return db['Setting'][_0x85ca('0x27')]({'attributes':[_0x85ca('0xbd')],'raw':!![]})[_0x85ca('0x1b')](function(_0x2c8e57){var _0x347dda=_0x2c8e57['enableEmailPreview'];_0x52fba5['forEach'](function(_0x12d855){_0x568a6a[_0x85ca('0x25')](updateMailInteraction(_0x12d855,_0x24f025,_0x56e39e,_0x347dda));});return BPromise[_0x85ca('0xbe')](_0x568a6a);});});});})[_0x85ca('0x1b')](function(_0x22d2c4){_0x57adb3[_0x85ca('0xbf')]=_0x22d2c4;return _0x57adb3;})[_0x85ca('0x1b')](respondWithFilteredResult(_0x3fcc4a,_0x4c68f8))[_0x85ca('0x2b')](handleError(_0x3fcc4a,null));};exports[_0x85ca('0xc0')]=function(_0x1322f3,_0x3d33b6){var _0x2055d9={'raw':![],'where':{'id':_0x1322f3[_0x85ca('0xc1')]['id']}},_0x22aa37={};_0x22aa37['model']=_[_0x85ca('0xc2')](db[_0x85ca('0x96')][_0x85ca('0xc3')]);_0x22aa37[_0x85ca('0x39')]=_['keys'](_0x1322f3[_0x85ca('0x39')]);_0x22aa37['filters']=_[_0x85ca('0x3b')](_0x22aa37['model'],_0x22aa37[_0x85ca('0x39')]);_0x2055d9[_0x85ca('0x3c')]=_['intersection'](_0x22aa37[_0x85ca('0x38')],qs[_0x85ca('0x3d')](_0x1322f3[_0x85ca('0x39')][_0x85ca('0x3d')]));_0x2055d9[_0x85ca('0x3c')]=_0x2055d9['attributes'][_0x85ca('0x3e')]?_0x2055d9[_0x85ca('0x3c')]:_0x22aa37[_0x85ca('0x38')];if(_0x1322f3[_0x85ca('0x39')][_0x85ca('0xc4')]){_0x2055d9[_0x85ca('0xc5')]=[{'all':!![]}];}_0x2055d9=_['merge']({},_0x2055d9,_0x1322f3[_0x85ca('0xc6')]);return db['MailInteraction'][_0x85ca('0x5b')](_0x2055d9)[_0x85ca('0x1b')](handleEntityNotFound(_0x3d33b6,null))[_0x85ca('0x1b')](respondWithResult(_0x3d33b6,null))[_0x85ca('0x2b')](handleError(_0x3d33b6,null));};exports[_0x85ca('0xc7')]=function(_0x362563,_0x5f1d04){return db[_0x85ca('0x96')][_0x85ca('0xc7')](_0x362563[_0x85ca('0xc8')],{})[_0x85ca('0x1b')](respondWithResult(_0x5f1d04,0xc9))[_0x85ca('0x2b')](handleError(_0x5f1d04,null));};exports['update']=function(_0x14fdb1,_0x573b96){if(_0x14fdb1[_0x85ca('0xc8')]['id']){delete _0x14fdb1['body']['id'];}return db[_0x85ca('0x96')][_0x85ca('0x5b')]({'where':{'id':_0x14fdb1[_0x85ca('0xc1')]['id']}})[_0x85ca('0x1b')](handleEntityNotFound(_0x573b96,null))[_0x85ca('0x1b')](saveUpdates(_0x14fdb1['body'],null))[_0x85ca('0x1b')](respondWithResult(_0x573b96,null))['catch'](handleError(_0x573b96,null));};exports[_0x85ca('0xc9')]=function(_0x87fe24,_0x4f7839){return db['MailInteraction'][_0x85ca('0x5b')]({'where':{'id':_0x87fe24[_0x85ca('0xc1')]['id']}})[_0x85ca('0x1b')](handleEntityNotFound(_0x4f7839,null))[_0x85ca('0x1b')](removeEntity(_0x4f7839,null))['catch'](handleError(_0x4f7839,null));};exports['describe']=function(_0x27ee42,_0x1f5281){return db[_0x85ca('0x96')][_0x85ca('0xca')]()[_0x85ca('0x1b')](respondWithResult(_0x1f5281,null))[_0x85ca('0x2b')](handleError(_0x1f5281,null));};exports[_0x85ca('0xcb')]=function(_0x394b15,_0x1806e1){return db['MailMessage']['find']({'where':{'id':_0x394b15[_0x85ca('0xc1')]['id']}})[_0x85ca('0x1b')](handleEntityNotFound(_0x1806e1,null))[_0x85ca('0x1b')](function(_0x301cd9){if(_0x301cd9){return _0x301cd9[_0x85ca('0xcb')](_0x394b15[_0x85ca('0xc8')][_0x85ca('0xcc')],_['omit'](_0x394b15[_0x85ca('0xc8')],['ids','id'])||{});}})['then'](respondWithResult(_0x1806e1,null))[_0x85ca('0x2b')](handleError(_0x1806e1,null));};exports[_0x85ca('0xcd')]=function(_0x4102c1,_0x3840ab){var _0x566657={'raw':![],'where':{}};var _0x463811={};var _0x1144ef={'count':0x0,'rows':[]};return db[_0x85ca('0x96')]['findOne']({'where':{'id':_0x4102c1[_0x85ca('0xc1')]['id']}})[_0x85ca('0x1b')](handleEntityNotFound(_0x3840ab,null))[_0x85ca('0x1b')](function(_0x315f73){if(_0x315f73){_0x463811['model']=_['keys'](db[_0x85ca('0x26')][_0x85ca('0xc3')]);_0x463811[_0x85ca('0x39')]=_[_0x85ca('0xc2')](_0x4102c1[_0x85ca('0x39')]);_0x463811[_0x85ca('0x3a')]=_['intersection'](_0x463811[_0x85ca('0x38')],_0x463811[_0x85ca('0x39')]);_0x566657[_0x85ca('0x3c')]=_[_0x85ca('0x3b')](_0x463811[_0x85ca('0x38')],qs[_0x85ca('0x3d')](_0x4102c1[_0x85ca('0x39')][_0x85ca('0x3d')]));_0x566657[_0x85ca('0x3c')]=_0x566657[_0x85ca('0x3c')]['length']?_0x566657['attributes']:_0x463811['model'];if(!_0x4102c1['query'][_0x85ca('0x3f')](_0x85ca('0xce'))){_0x566657[_0x85ca('0x17')]=qs[_0x85ca('0x17')](_0x4102c1[_0x85ca('0x39')][_0x85ca('0x17')]);_0x566657[_0x85ca('0x14')]=qs[_0x85ca('0x14')](_0x4102c1['query'][_0x85ca('0x14')]);}_0x566657[_0x85ca('0x40')]=qs[_0x85ca('0x41')](_0x4102c1[_0x85ca('0x39')][_0x85ca('0x41')]);_0x566657[_0x85ca('0x42')]=qs['filters'](_[_0x85ca('0x43')](_0x4102c1[_0x85ca('0x39')],_0x463811[_0x85ca('0x3a')]));_0x566657[_0x85ca('0x42')]['MailInteractionId']=_0x315f73['id'];if(_0x4102c1[_0x85ca('0x39')][_0x85ca('0x7d')]){_0x566657[_0x85ca('0x42')]=_[_0x85ca('0x95')](_0x566657[_0x85ca('0x42')],{'$or':_[_0x85ca('0x34')](_0x566657[_0x85ca('0x3c')],function(_0x52f48c){var _0x395e67={};_0x395e67[_0x52f48c]={'$like':'%'+_0x4102c1[_0x85ca('0x39')]['filter']+'%'};return _0x395e67;})});}if(_0x4102c1[_0x85ca('0x39')][_0x85ca('0x72')]){var _0x1c27a6=_0x4102c1[_0x85ca('0x39')][_0x85ca('0x72')]['split'](',');var _0x55f59b={};_0x55f59b[_0x1c27a6[0x0]]={'$gte':moment(_0x1c27a6[0x1])[_0x85ca('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x566657[_0x85ca('0x42')]=_[_0x85ca('0x95')](_0x566657[_0x85ca('0x42')],_0x55f59b);}_0x566657=_['merge']({},_0x566657,_0x4102c1[_0x85ca('0xc6')]);return db[_0x85ca('0x26')][_0x85ca('0x16')]({'where':_0x566657[_0x85ca('0x42')]})[_0x85ca('0x1b')](function(_0x202fd3){_0x1144ef[_0x85ca('0x16')]=_0x202fd3;if(_0x4102c1['query'][_0x85ca('0xc4')]){_0x566657[_0x85ca('0xc5')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x566657);})[_0x85ca('0x1b')](function(_0x3e1cf7){if(_0x4102c1[_0x85ca('0x39')][_0x85ca('0xd0')]===_0x85ca('0xd1')){for(var _0x8ea257=0x0;_0x8ea257<_0x3e1cf7[_0x85ca('0x3e')];_0x8ea257++){_0x3e1cf7[_0x8ea257][_0x85ca('0xc8')]=juice(_0x3e1cf7[_0x8ea257][_0x85ca('0xc8')]);}}_0x1144ef[_0x85ca('0xbf')]=_0x3e1cf7;return _0x1144ef;});}})[_0x85ca('0x1b')](respondWithFilteredResult(_0x3840ab,_0x566657))[_0x85ca('0x2b')](handleError(_0x3840ab,null));};exports[_0x85ca('0xd2')]=function(_0x23cce4,_0x1b521c){return db[_0x85ca('0x96')][_0x85ca('0x5b')]({'where':{'id':_0x23cce4[_0x85ca('0xc1')]['id']}})['then'](handleEntityNotFound(_0x1b521c,null))[_0x85ca('0x1b')](function(_0xcdc1b0){if(_0xcdc1b0){return _0xcdc1b0[_0x85ca('0xd3')](_0x23cce4[_0x85ca('0xc8')][_0x85ca('0xcc')],_[_0x85ca('0xd4')](_0x23cce4[_0x85ca('0xc8')],[_0x85ca('0xcc'),'id'])||{})['spread'](function(){return db[_0x85ca('0x67')]['findAll']({'attributes':['id',_0x85ca('0x1e'),'color'],'where':{'id':_0x23cce4['body'][_0x85ca('0xcc')]}});})[_0x85ca('0x1b')](function(_0x407ddf){socket[_0x85ca('0xd5')](_0x85ca('0xd6'),{'id':Number(_0x23cce4['params']['id']),'tags':_0x407ddf||[]});return{'id':Number(_0x23cce4[_0x85ca('0xc1')]['id']),'tags':_0x407ddf||[]};});}})[_0x85ca('0x1b')](respondWithResult(_0x1b521c,null))['catch'](handleError(_0x1b521c,null));};exports['removeTags']=function(_0x9f5bf4,_0x17c6ef){return db[_0x85ca('0x96')][_0x85ca('0x5b')]({'where':{'id':_0x9f5bf4['params']['id']}})[_0x85ca('0x1b')](handleEntityNotFound(_0x17c6ef,null))[_0x85ca('0x1b')](function(_0x3b37fd){if(_0x3b37fd){return _0x3b37fd[_0x85ca('0xd7')](_0x9f5bf4['query'][_0x85ca('0xcc')]);}})[_0x85ca('0x1b')](respondWithStatusCode(_0x17c6ef,null))[_0x85ca('0x2b')](handleError(_0x17c6ef,null));};exports[_0x85ca('0xd8')]=function(_0x152234,_0x5e884c){var _0x50f17a=moment()[_0x85ca('0xd9')]()[_0x85ca('0x94')]();var _0x4757a7=path['join'](config[_0x85ca('0xda')],_0x85ca('0xdb'),_0x85ca('0xdc'),_0x85ca('0xdd'));var _0x2e87d4=path[_0x85ca('0xde')](config[_0x85ca('0xda')],_0x85ca('0xdb'),_0x85ca('0xdc'),_0x85ca('0xdf'));var _0x15be25=path['join'](_0x4757a7,_0x50f17a);var _0x435253=util[_0x85ca('0xcf')]('transcript-%d-%s.zip',_0x152234[_0x85ca('0xc1')]['id'],_0x50f17a);var _0x53c827=path[_0x85ca('0xde')](_0x4757a7,_0x435253);var _0x527270=[];if(_0x152234[_0x85ca('0x39')][_0x85ca('0xdf')]){_0x527270[_0x85ca('0x25')]({'model':db[_0x85ca('0xe0')],'as':_0x85ca('0xe1'),'raw':!![]});}var _0x181570=[{'model':db[_0x85ca('0x26')],'as':'Messages','attributes':['id','body',_0x85ca('0x47'),'to','cc',_0x85ca('0xe2'),_0x85ca('0xe3'),_0x85ca('0x71')],'where':{'secret':![]},'order':qs[_0x85ca('0x41')]('id'),'include':_0x527270}];return db[_0x85ca('0x96')][_0x85ca('0x5b')]({'where':{'id':_0x152234[_0x85ca('0xc1')]['id']},'include':_0x181570})[_0x85ca('0x1b')](handleEntityNotFound(_0x5e884c,null))[_0x85ca('0x1b')](function(_0x38b52d){if(_0x38b52d&&_0x38b52d['Messages']){var _0xcb5aa9=_0x38b52d[_0x85ca('0xe4')]({'plain':!![]});fs[_0x85ca('0xe5')](_0x15be25);return BPromise[_0x85ca('0xe6')](_0xcb5aa9[_0x85ca('0xe7')],function(_0x33fa62,_0x4708e1){var _0x3ec2cf={'from':_0x33fa62[_0x85ca('0x47')],'to':_0x33fa62['to'],'subject':_0x33fa62[_0x85ca('0xe3')],'html':htmlEntities[_0x85ca('0xe8')](_0x33fa62[_0x85ca('0xc8')]),'headers':{'Date':moment(_0x33fa62[_0x85ca('0x71')])[_0x85ca('0xcf')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x33fa62['cc']){_0x3ec2cf[_0x85ca('0xe9')]['Cc']=_0x33fa62['cc'];}if(_0x33fa62[_0x85ca('0xe2')]){_0x3ec2cf['headers'][_0x85ca('0xea')]=_0x33fa62[_0x85ca('0xe2')];}return new BPromise(function(_0x262952,_0x561d9a){if(_0x33fa62['Attachments']){for(var _0x4e0f8f=0x0;_0x4e0f8f<_0x33fa62[_0x85ca('0xe1')][_0x85ca('0x3e')];_0x4e0f8f++){var _0x39cc5d=_0x33fa62[_0x85ca('0xe1')][_0x4e0f8f];var _0x69a536=path[_0x85ca('0xde')](_0x2e87d4,_0x39cc5d[_0x85ca('0xeb')]);if(fs[_0x85ca('0xec')](_0x69a536)){_0x3ec2cf[_0x85ca('0xdf')][_0x85ca('0x25')]({'name':_0x39cc5d['name'],'contentType':_0x39cc5d['type'],'data':fs['readFileSync'](_0x69a536)});}}}emlformat[_0x85ca('0xed')](_0x3ec2cf,function(_0x17d289,_0x1a628e){if(_0x17d289)return _0x561d9a(_0x17d289);fs['writeFileSync'](path[_0x85ca('0xde')](_0x15be25,util[_0x85ca('0xcf')](_0x85ca('0xee'),_0x4708e1)),_0x1a628e);return _0x262952(_0x1a628e);});});})[_0x85ca('0x1b')](function(){return new BPromise(function(_0x29ffa1,_0x2e28f2){zipdir(_0x15be25,{'saveTo':_0x53c827},function(_0x17d715,_0xbfab4e){if(_0x17d715)return _0x2e28f2(_0x17d715);return _0x29ffa1(_0xbfab4e);});})[_0x85ca('0x1b')](function(){return new BPromise(function(_0x358433,_0x453bdc){rimraf(_0x15be25,function(_0x5039ec){if(_0x5039ec)_0x453bdc(_0x5039ec);return _0x358433();});});})[_0x85ca('0x1b')](function(){return _0x5e884c['download'](_0x53c827,_0x435253,function(_0x10769b){if(!_0x10769b)fs[_0x85ca('0xef')](_0x53c827);});});});}else{return _0x5e884c['sendStatus'](0xc8);}})[_0x85ca('0x2b')](handleError(_0x5e884c,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 21f1dfe..1997958 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 _0x6624=['catch','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x5c555e,_0x7e20c2){var _0x56375f=function(_0x570ed8){while(--_0x570ed8){_0x5c555e['push'](_0x5c555e['shift']());}};_0x56375f(++_0x7e20c2);}(_0x6624,0x1c2));var _0x4662=function(_0x1ccd84,_0x1eab50){_0x1ccd84=_0x1ccd84-0x0;var _0xf47a97=_0x6624[_0x1ccd84];return _0xf47a97;};'use strict';var EventEmitter=require(_0x4662('0x0'));var MailInteraction=require(_0x4662('0x1'))['db'][_0x4662('0x2')];var MailMessage=require(_0x4662('0x1'))['db'][_0x4662('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4662('0x4')](0x0);var events={'afterCreate':_0x4662('0x5'),'afterUpdate':_0x4662('0x6'),'afterDestroy':'remove'};function emitEvent(_0x405e7a){return function(_0x5552a8,_0x20c259,_0x23a80c){_0x5552a8[_0x4662('0x7')]({'attributes':['id'],'raw':!![]})[_0x4662('0x8')](function(_0x10eaf8){_0x5552a8[_0x4662('0x9')](_0x4662('0xa'),_0x10eaf8[_0x4662('0xb')](function(_0x3ea01e){return{'id':_0x3ea01e['id']};}));return MailMessage[_0x4662('0xc')]({'where':{'MailInteractionId':_0x5552a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4662('0x8')](function(_0x1707dd){_0x5552a8[_0x4662('0x9')](_0x4662('0xd'),_0x1707dd['length']);MailInteractionEvents['emit'](_0x405e7a+':'+_0x5552a8['id'],_0x5552a8);MailInteractionEvents['emit'](_0x405e7a,_0x5552a8);_0x23a80c(null);})[_0x4662('0xe')](_0x23a80c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x4662('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x2a23=['../../mysqldb','MailMessage','save','update','remove','setDataValue','map','then','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x2a23,0x1be));var _0x32a2=function(_0x46ee2f,_0x5253fb){_0x46ee2f=_0x46ee2f-0x0;var _0x45ebeb=_0x2a23[_0x46ee2f];return _0x45ebeb;};'use strict';var EventEmitter=require(_0x32a2('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x32a2('0x1')];var MailMessage=require(_0x32a2('0x2'))['db'][_0x32a2('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32a2('0x4'),'afterUpdate':_0x32a2('0x5'),'afterDestroy':_0x32a2('0x6')};function emitEvent(_0x3dc48e){return function(_0x3f3ae4,_0x3f00c6,_0x2e33a8){_0x3f3ae4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x426f90){_0x3f3ae4[_0x32a2('0x7')]('Users',_0x426f90[_0x32a2('0x8')](function(_0x2f8497){return{'id':_0x2f8497['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3f3ae4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32a2('0x9')](function(_0x506344){_0x3f3ae4[_0x32a2('0x7')]('unreadMessages',_0x506344[_0x32a2('0xa')]);MailInteractionEvents[_0x32a2('0xb')](_0x3dc48e+':'+_0x3f3ae4['id'],_0x3f3ae4);MailInteractionEvents[_0x32a2('0xb')](_0x3dc48e,_0x3f3ae4);_0x2e33a8(null);})[_0x32a2('0xc')](_0x2e33a8(null));};}for(var e in events){if(events[_0x32a2('0xd')](e)){var event=events[e];MailInteraction[_0x32a2('0xe')](e,emitEvent(event));}}module[_0x32a2('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 99ede3c..f73a7aa 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 _0xd425=['models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xd425,0x1ab));var _0x5d42=function(_0x498381,_0x122bfc){_0x498381=_0x498381-0x0;var _0x7e0ae8=_0xd425[_0x498381];return _0x7e0ae8;};'use strict';var _=require(_0x5d42('0x0'));var util=require(_0x5d42('0x1'));var logger=require(_0x5d42('0x2'))(_0x5d42('0x3'));var moment=require(_0x5d42('0x4'));var BPromise=require(_0x5d42('0x5'));var rp=require(_0x5d42('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5d42('0x7'));var attributes=require(_0x5d42('0x8'));module[_0x5d42('0x9')]=function(_0x491afa,_0x3ea33b){return _0x491afa[_0x5d42('0xa')](_0x5d42('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x5d42('0xc'),'fields':['subject','to'],'type':_0x5d42('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x368cfe,_0x1de639,_0x5c62f8){if(_0x368cfe[_0x5d42('0xe')]){_0x368cfe[_0x5d42('0xf')]=moment()[_0x5d42('0x10')](_0x5d42('0x11'));}if(_0x368cfe['closed']){_0x368cfe[_0x5d42('0x12')]=moment()[_0x5d42('0x10')](_0x5d42('0x11'));}_0x5c62f8(null,_0x1de639);},'beforeUpdate':function(_0x3adc2c,_0x1e293e,_0x521915){if(_0x3adc2c[_0x5d42('0x13')](_0x5d42('0xe'))){_0x3adc2c['substatusAt']=_0x3adc2c['substatus']?moment()[_0x5d42('0x10')](_0x5d42('0x11')):null;}if(_0x3adc2c[_0x5d42('0x13')](_0x5d42('0x14'))){_0x3adc2c[_0x5d42('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3adc2c[_0x5d42('0xe')]=null;_0x3adc2c[_0x5d42('0xf')]=null;}_0x521915(null,_0x3adc2c);},'afterUpdate':function(_0x52e338,_0x4c4e13,_0x38c718){var _0x5ed5de=_0x491afa[_0x5d42('0x15')];var _0x5c3e04=_0x52e338[_0x5d42('0x16')]({'plain':!![]});if(_0x5c3e04['closed']){return _0x5ed5de[_0x5d42('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x5c3e04['id']}})[_0x5d42('0x18')](function(){_0x38c718();})[_0x5d42('0x19')](function(_0x108bbc){_0x38c718(_0x108bbc);});}else{_0x38c718();}}},'charset':_0x5d42('0x1a'),'collate':_0x5d42('0x1b')});}; \ No newline at end of file +var _0x326d=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','substatus','changed','closedAt','models','get','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x326d,0x136));var _0xd326=function(_0x3908dd,_0x20be62){_0x3908dd=_0x3908dd-0x0;var _0x31c27f=_0x326d[_0x3908dd];return _0x31c27f;};'use strict';var _=require(_0xd326('0x0'));var util=require('util');var logger=require(_0xd326('0x1'))('api');var moment=require(_0xd326('0x2'));var BPromise=require(_0xd326('0x3'));var rp=require(_0xd326('0x4'));var fs=require('fs');var path=require(_0xd326('0x5'));var rimraf=require(_0xd326('0x6'));var config=require(_0xd326('0x7'));var attributes=require(_0xd326('0x8'));module['exports']=function(_0x55ba5a,_0xf80013){return _0x55ba5a[_0xd326('0x9')](_0xd326('0xa'),attributes,{'tableName':_0xd326('0xb'),'paranoid':![],'indexes':[{'name':_0xd326('0xc'),'fields':[_0xd326('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f620d,_0x3180ea,_0x1ad902){if(_0x3f620d['substatus']){_0x3f620d[_0xd326('0xe')]=moment()[_0xd326('0xf')](_0xd326('0x10'));}if(_0x3f620d[_0xd326('0x11')]){_0x3f620d['closedAt']=moment()[_0xd326('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ad902(null,_0x3180ea);},'beforeUpdate':function(_0x5a1038,_0x50cd0a,_0x201c36){if(_0x5a1038['changed'](_0xd326('0x12'))){_0x5a1038['substatusAt']=_0x5a1038[_0xd326('0x12')]?moment()[_0xd326('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5a1038[_0xd326('0x13')](_0xd326('0x11'))){_0x5a1038[_0xd326('0x14')]=moment()[_0xd326('0xf')](_0xd326('0x10'));_0x5a1038[_0xd326('0x12')]=null;_0x5a1038['substatusAt']=null;}_0x201c36(null,_0x5a1038);},'afterUpdate':function(_0x283dee,_0x481cc7,_0x8d3340){var _0x52a8a5=_0x55ba5a[_0xd326('0x15')];var _0x3a488a=_0x283dee[_0xd326('0x16')]({'plain':!![]});if(_0x3a488a[_0xd326('0x11')]){return _0x52a8a5['MailMessage'][_0xd326('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x3a488a['id']}})['then'](function(){_0x8d3340();})[_0xd326('0x18')](function(_0x5183ad){_0x8d3340(_0x5183ad);});}else{_0x8d3340();}}},'charset':_0xd326('0x19'),'collate':_0xd326('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index dfaa29a..afc52e3 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 _0xb344=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./mailInteraction.socket','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','options','raw','where','attributes','limit','AddTagsToMailInteraction','MailInteraction','find','then','addTags','body','ids','omit'];(function(_0x58884e,_0x4a8fb6){var _0x4a5c87=function(_0x22d594){while(--_0x22d594){_0x58884e['push'](_0x58884e['shift']());}};_0x4a5c87(++_0x4a8fb6);}(_0xb344,0x152));var _0x4b34=function(_0x6b085f,_0x26959c){_0x6b085f=_0x6b085f-0x0;var _0x40a408=_0xb344[_0x6b085f];return _0x40a408;};'use strict';var _=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var moment=require(_0x4b34('0x2'));var BPromise=require(_0x4b34('0x3'));var rs=require(_0x4b34('0x4'));var fs=require('fs');var Redis=require(_0x4b34('0x5'));var db=require(_0x4b34('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b34('0x7'))(_0x4b34('0x8'));var config=require(_0x4b34('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b34('0xa')][_0x4b34('0xb')]({'port':0x232a});config['redis']=_[_0x4b34('0xc')](config['redis'],{'host':_0x4b34('0xd'),'port':0x18eb});var socket=require(_0x4b34('0xe'))(new Redis(config['redis']));require(_0x4b34('0xf'))['register'](socket);function respondWithRpcPromise(_0x481123,_0x57e24d,_0x55e478){return new BPromise(function(_0x334df8,_0x4b2b1d){return client['request'](_0x481123,_0x55e478)['then'](function(_0x29dfa8){logger[_0x4b34('0x10')](_0x4b34('0x11'),_0x57e24d,_0x4b34('0x12'));logger[_0x4b34('0x13')](_0x4b34('0x14'),_0x57e24d,_0x4b34('0x12'),JSON[_0x4b34('0x15')](_0x29dfa8));if(_0x29dfa8[_0x4b34('0x16')]){if(_0x29dfa8[_0x4b34('0x16')][_0x4b34('0x17')]===0x1f4){logger['error'](_0x4b34('0x11'),_0x57e24d,_0x29dfa8[_0x4b34('0x16')]['message']);return _0x4b2b1d(_0x29dfa8[_0x4b34('0x16')][_0x4b34('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x57e24d,_0x29dfa8[_0x4b34('0x16')][_0x4b34('0x18')]);return _0x334df8(_0x29dfa8[_0x4b34('0x16')][_0x4b34('0x18')]);}else{logger[_0x4b34('0x10')]('MailInteraction,\x20%s,\x20%s',_0x57e24d,'request\x20sent');_0x334df8(_0x29dfa8['result'][_0x4b34('0x18')]);}})[_0x4b34('0x19')](function(_0x5b2592){logger[_0x4b34('0x16')](_0x4b34('0x11'),_0x57e24d,_0x5b2592);_0x4b2b1d(_0x5b2592);});});}exports[_0x4b34('0x1a')]=function(_0x3ed29a){var _0x5fdbfc=this;return new Promise(function(_0x724b7b,_0x8701a7){return db['MailInteraction']['update'](_0x3ed29a['body'],{'raw':_0x3ed29a[_0x4b34('0x1b')]?_0x3ed29a['options'][_0x4b34('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed29a[_0x4b34('0x1b')]?_0x3ed29a['options'][_0x4b34('0x1d')]||null:null,'attributes':_0x3ed29a[_0x4b34('0x1b')]?_0x3ed29a[_0x4b34('0x1b')][_0x4b34('0x1e')]||null:null,'limit':_0x3ed29a[_0x4b34('0x1b')]?_0x3ed29a[_0x4b34('0x1b')][_0x4b34('0x1f')]||null:null})['then'](function(_0x1fb7fb){logger[_0x4b34('0x10')](_0x4b34('0x1a'),_0x3ed29a);logger[_0x4b34('0x13')](_0x4b34('0x1a'),_0x3ed29a,JSON['stringify'](_0x1fb7fb));_0x724b7b(_0x1fb7fb);})[_0x4b34('0x19')](function(_0x27d85b){logger[_0x4b34('0x16')](_0x4b34('0x1a'),_0x27d85b[_0x4b34('0x18')],_0x3ed29a);_0x8701a7(_0x5fdbfc[_0x4b34('0x16')](0x1f4,_0x27d85b[_0x4b34('0x18')]));});});};exports[_0x4b34('0x20')]=function(_0xe491a5){return new Promise(function(_0x3f3da0,_0x1a02aa){return db[_0x4b34('0x21')][_0x4b34('0x22')]({'where':_0xe491a5[_0x4b34('0x1b')]?_0xe491a5['options'][_0x4b34('0x1d')]||null:null})[_0x4b34('0x23')](function(_0x2a9734){if(_0x2a9734){return _0x2a9734[_0x4b34('0x24')](_0xe491a5[_0x4b34('0x25')][_0x4b34('0x26')],_[_0x4b34('0x27')](_0xe491a5[_0x4b34('0x25')],[_0x4b34('0x26'),'id'])||{});}})[_0x4b34('0x28')](function(_0x558ec8){logger[_0x4b34('0x10')](_0x4b34('0x29'),_0xe491a5);logger['debug'](_0x4b34('0x29'),_0xe491a5,JSON[_0x4b34('0x15')](_0x558ec8));_0x3f3da0(_0x558ec8);})[_0x4b34('0x19')](function(_0x54b562){logger['error'](_0x4b34('0x29'),_0x54b562[_0x4b34('0x18')],_0xe491a5);_0x1a02aa(_this[_0x4b34('0x16')](0x1f4,_0x54b562[_0x4b34('0x18')]));});});}; \ No newline at end of file +var _0x27eb=['UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','register','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','MailInteraction','update','body','options','raw','where','attributes','limit','then','debug'];(function(_0x47c346,_0xee8bbb){var _0xdb4c18=function(_0x1d8184){while(--_0x1d8184){_0x47c346['push'](_0x47c346['shift']());}};_0xdb4c18(++_0xee8bbb);}(_0x27eb,0xd0));var _0xb27e=function(_0x909fde,_0x4f211c){_0x909fde=_0x909fde-0x0;var _0x3cb7cd=_0x27eb[_0x909fde];return _0x3cb7cd;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb27e('0x2'));var fs=require('fs');var Redis=require(_0xb27e('0x3'));var db=require(_0xb27e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb27e('0x5'))(_0xb27e('0x6'));var config=require(_0xb27e('0x7'));var jayson=require(_0xb27e('0x8'));var client=jayson['client'][_0xb27e('0x9')]({'port':0x232a});config[_0xb27e('0xa')]=_[_0xb27e('0xb')](config[_0xb27e('0xa')],{'host':_0xb27e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27e('0xa')]));require(_0xb27e('0xd'))[_0xb27e('0xe')](socket);function respondWithRpcPromise(_0x2e9752,_0x26ea1f,_0x51a872){return new BPromise(function(_0x2b7bdc,_0x11bd85){return client['request'](_0x2e9752,_0x51a872)['then'](function(_0x38a41d){logger['info'](_0xb27e('0xf'),_0x26ea1f,_0xb27e('0x10'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x26ea1f,'request\x20sent',JSON[_0xb27e('0x11')](_0x38a41d));if(_0x38a41d['error']){if(_0x38a41d[_0xb27e('0x12')]['code']===0x1f4){logger[_0xb27e('0x12')]('MailInteraction,\x20%s,\x20%s',_0x26ea1f,_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);return _0x11bd85(_0x38a41d[_0xb27e('0x12')]['message']);}logger[_0xb27e('0x12')](_0xb27e('0xf'),_0x26ea1f,_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);return _0x2b7bdc(_0x38a41d[_0xb27e('0x12')][_0xb27e('0x13')]);}else{logger[_0xb27e('0x14')](_0xb27e('0xf'),_0x26ea1f,_0xb27e('0x10'));_0x2b7bdc(_0x38a41d['result'][_0xb27e('0x13')]);}})[_0xb27e('0x15')](function(_0x26bbf9){logger['error'](_0xb27e('0xf'),_0x26ea1f,_0x26bbf9);_0x11bd85(_0x26bbf9);});});}exports['UpdateMailInteraction']=function(_0x517932){var _0x13807f=this;return new Promise(function(_0x15dc7e,_0x4ec66c){return db[_0xb27e('0x16')][_0xb27e('0x17')](_0x517932[_0xb27e('0x18')],{'raw':_0x517932[_0xb27e('0x19')]?_0x517932['options'][_0xb27e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517932['options']?_0x517932[_0xb27e('0x19')][_0xb27e('0x1b')]||null:null,'attributes':_0x517932['options']?_0x517932['options'][_0xb27e('0x1c')]||null:null,'limit':_0x517932[_0xb27e('0x19')]?_0x517932[_0xb27e('0x19')][_0xb27e('0x1d')]||null:null})[_0xb27e('0x1e')](function(_0x5cf816){logger[_0xb27e('0x14')]('UpdateMailInteraction',_0x517932);logger[_0xb27e('0x1f')](_0xb27e('0x20'),_0x517932,JSON[_0xb27e('0x11')](_0x5cf816));_0x15dc7e(_0x5cf816);})[_0xb27e('0x15')](function(_0x3254fb){logger['error'](_0xb27e('0x20'),_0x3254fb['message'],_0x517932);_0x4ec66c(_0x13807f[_0xb27e('0x12')](0x1f4,_0x3254fb[_0xb27e('0x13')]));});});};exports[_0xb27e('0x21')]=function(_0x10dfc1){return new Promise(function(_0x3da666,_0x35169a){return db[_0xb27e('0x16')][_0xb27e('0x22')]({'where':_0x10dfc1[_0xb27e('0x19')]?_0x10dfc1['options'][_0xb27e('0x1b')]||null:null})[_0xb27e('0x1e')](function(_0x21c90e){if(_0x21c90e){return _0x21c90e[_0xb27e('0x23')](_0x10dfc1['body'][_0xb27e('0x24')],_[_0xb27e('0x25')](_0x10dfc1[_0xb27e('0x18')],[_0xb27e('0x24'),'id'])||{});}})[_0xb27e('0x26')](function(_0x127073){logger[_0xb27e('0x14')]('AddTags',_0x10dfc1);logger['debug'](_0xb27e('0x27'),_0x10dfc1,JSON['stringify'](_0x127073));_0x3da666(_0x127073);})[_0xb27e('0x15')](function(_0x54e58b){logger[_0xb27e('0x12')](_0xb27e('0x27'),_0x54e58b[_0xb27e('0x13')],_0x10dfc1);_0x35169a(_this[_0xb27e('0x12')](0x1f4,_0x54e58b[_0xb27e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a7b7f20..b261f03 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 _0x9dd4=['update','emit','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x5a0bab,_0x168def){var _0x32b15a=function(_0x52f391){while(--_0x52f391){_0x5a0bab['push'](_0x5a0bab['shift']());}};_0x32b15a(++_0x168def);}(_0x9dd4,0x138));var _0x49dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dd4[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x49dd('0x0'));var events=[_0x49dd('0x1'),_0x49dd('0x2'),_0x49dd('0x3')];function createListener(_0x54d822,_0x5e4e35){return function(_0x32efcd){_0x5e4e35[_0x49dd('0x4')](_0x54d822,_0x32efcd);};}function removeListener(_0x59d48a,_0x4c6422){return function(){MailInteractionEvents['removeListener'](_0x59d48a,_0x4c6422);};}exports['register']=function(_0x551d61){for(var _0x3233f0=0x0,_0x4e8e4b=events[_0x49dd('0x5')];_0x3233f0<_0x4e8e4b;_0x3233f0++){var _0x21fe5f=events[_0x3233f0];var _0x2c10d3=createListener(_0x49dd('0x6')+_0x21fe5f,_0x551d61);MailInteractionEvents['on'](_0x21fe5f,_0x2c10d3);}}; \ No newline at end of file +var _0xe806=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x34aa65,_0x457820){var _0x843cb3=function(_0x4655c6){while(--_0x4655c6){_0x34aa65['push'](_0x34aa65['shift']());}};_0x843cb3(++_0x457820);}(_0xe806,0xa6));var _0x6e80=function(_0x3dd1b7,_0x4d2ee6){_0x3dd1b7=_0x3dd1b7-0x0;var _0x1bd346=_0xe806[_0x3dd1b7];return _0x1bd346;};'use strict';var MailInteractionEvents=require(_0x6e80('0x0'));var events=[_0x6e80('0x1'),_0x6e80('0x2'),_0x6e80('0x3')];function createListener(_0x59e7e8,_0x429256){return function(_0x5474b9){_0x429256[_0x6e80('0x4')](_0x59e7e8,_0x5474b9);};}function removeListener(_0x346469,_0x2e556f){return function(){MailInteractionEvents[_0x6e80('0x5')](_0x346469,_0x2e556f);};}exports[_0x6e80('0x6')]=function(_0x45a83e){for(var _0x36332a=0x0,_0x24eda6=events[_0x6e80('0x7')];_0x36332a<_0x24eda6;_0x36332a++){var _0x177551=events[_0x36332a];var _0x4b19f7=createListener(_0x6e80('0x8')+_0x177551,_0x45a83e);MailInteractionEvents['on'](_0x177551,_0x4b19f7);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 55b487a..280f897 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 _0x23f2=['download','post','tracked','mail','mailmessage:create','put','update','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x23f2,0x1a2));var _0x223f=function(_0x56ab8f,_0x19b8d0){_0x56ab8f=_0x56ab8f-0x0;var _0x56d987=_0x23f2[_0x56ab8f];return _0x56d987;};'use strict';var multer=require(_0x223f('0x0'));var util=require(_0x223f('0x1'));var path=require(_0x223f('0x2'));var timeout=require('connect-timeout');var express=require(_0x223f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x223f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x223f('0x5'));var controller=require(_0x223f('0x6'));router['get']('/',auth[_0x223f('0x7')](),controller[_0x223f('0x8')]);router[_0x223f('0x9')](_0x223f('0xa'),auth[_0x223f('0x7')](),controller[_0x223f('0xb')]);router[_0x223f('0x9')]('/:id',auth[_0x223f('0x7')](),controller[_0x223f('0xc')]);router['get'](_0x223f('0xd'),auth[_0x223f('0x7')](),controller[_0x223f('0xe')]);router[_0x223f('0xf')]('/',auth[_0x223f('0x7')](),interaction[_0x223f('0x10')](_0x223f('0x11'),_0x223f('0x12')),controller['create']);router[_0x223f('0x13')]('/:id',auth[_0x223f('0x7')](),controller[_0x223f('0x14')]);router[_0x223f('0x13')]('/:id/accept',auth[_0x223f('0x7')](),controller['accept']);router[_0x223f('0x13')](_0x223f('0x15'),auth[_0x223f('0x7')](),controller[_0x223f('0x16')]);router[_0x223f('0x17')](_0x223f('0x18'),auth[_0x223f('0x7')](),controller[_0x223f('0x19')]);module[_0x223f('0x1a')]=router; \ No newline at end of file +var _0xd5e5=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x3331ea,_0x596894){var _0x394ffd=function(_0x490036){while(--_0x490036){_0x3331ea['push'](_0x3331ea['shift']());}};_0x394ffd(++_0x596894);}(_0xd5e5,0x187));var _0x5d5e=function(_0x23dcae,_0x5ac4e2){_0x23dcae=_0x23dcae-0x0;var _0x570ecc=_0xd5e5[_0x23dcae];return _0x570ecc;};'use strict';var multer=require('multer');var util=require(_0x5d5e('0x0'));var path=require('path');var timeout=require(_0x5d5e('0x1'));var express=require('express');var router=express[_0x5d5e('0x2')]();var fs_extra=require(_0x5d5e('0x3'));var auth=require(_0x5d5e('0x4'));var interaction=require(_0x5d5e('0x5'));var config=require(_0x5d5e('0x6'));var controller=require(_0x5d5e('0x7'));router[_0x5d5e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d5e('0x9')]);router[_0x5d5e('0x8')](_0x5d5e('0xa'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xc')]);router[_0x5d5e('0x8')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xe')]);router['get'](_0x5d5e('0xf'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x10')]);router[_0x5d5e('0x11')]('/',auth[_0x5d5e('0xb')](),interaction[_0x5d5e('0x12')](_0x5d5e('0x13'),_0x5d5e('0x14')),controller[_0x5d5e('0x15')]);router[_0x5d5e('0x16')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x17')]);router[_0x5d5e('0x16')](_0x5d5e('0x18'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x19')]);router[_0x5d5e('0x16')](_0x5d5e('0x1a'),auth['isAuthenticated'](),controller['reject']);router[_0x5d5e('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x5d5e('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 3a19ed1..6267f80 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 _0x4329=['ENUM','out','STRING','DATE','INTEGER','Chat','Email','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN'];(function(_0x4c5e14,_0xeee557){var _0xd244bc=function(_0x5e556b){while(--_0x5e556b){_0x4c5e14['push'](_0x4c5e14['shift']());}};_0xd244bc(++_0xeee557);}(_0x4329,0x13b));var _0x9432=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4329[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x9432('0x0'));var _=require(_0x9432('0x1'));module[_0x9432('0x2')]={'body':{'type':Sequelize[_0x9432('0x3')](_0x9432('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9432('0x3')](_0x9432('0x5'))},'read':{'type':Sequelize[_0x9432('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9432('0x7')]('in',_0x9432('0x8')),'defaultValue':_0x9432('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9432('0x9')](0x1fe)},'from':{'type':Sequelize[_0x9432('0x9')]},'to':{'type':Sequelize[_0x9432('0x3')]('long')},'cc':{'type':Sequelize[_0x9432('0x3')]('long')},'bcc':{'type':Sequelize[_0x9432('0x3')](_0x9432('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x9432('0xa')]},'attach':{'type':Sequelize[_0x9432('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9432('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x9432('0xa')]},'originTo':{'type':Sequelize[_0x9432('0x3')]('long')},'originCc':{'type':Sequelize[_0x9432('0x3')](_0x9432('0x4'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x9432('0xc')),'defaultValue':_0x9432('0xd'),'allowNull':![]}}; \ No newline at end of file +var _0x3b93=['Chat','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN','out','STRING','DATE','ENUM','Email'];(function(_0x208037,_0x88f602){var _0x425e53=function(_0x4b3f46){while(--_0x4b3f46){_0x208037['push'](_0x208037['shift']());}};_0x425e53(++_0x88f602);}(_0x3b93,0x112));var _0x33b9=function(_0x21ec49,_0x24f52c){_0x21ec49=_0x21ec49-0x0;var _0x6c0219=_0x3b93[_0x21ec49];return _0x6c0219;};'use strict';var Sequelize=require(_0x33b9('0x0'));var _=require(_0x33b9('0x1'));module[_0x33b9('0x2')]={'body':{'type':Sequelize['TEXT'](_0x33b9('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x33b9('0x4')](_0x33b9('0x5'))},'read':{'type':Sequelize[_0x33b9('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x33b9('0x7')),'defaultValue':_0x33b9('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x33b9('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x33b9('0x4')](_0x33b9('0x3'))},'bcc':{'type':Sequelize[_0x33b9('0x4')](_0x33b9('0x3'))},'subject':{'type':Sequelize[_0x33b9('0x4')]},'sentAt':{'type':Sequelize[_0x33b9('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x33b9('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x33b9('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x33b9('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x33b9('0xa')](_0x33b9('0xb'),_0x33b9('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 9912fc0..8f2ca67 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 _0xebfd=['writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','find','body','describe','create','direction','out','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','CloudProvider','Smtp','getSmtpOptions','attachments','root','server/files/attachments','Contacts','ListId','sendMail','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','internal','SIP/%s','download','toString','join','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','headers','Bcc','basename','existsSync','push','readFileSync'];(function(_0x443b20,_0x1f7118){var _0x49a084=function(_0x595322){while(--_0x595322){_0x443b20['push'](_0x443b20['shift']());}};_0x49a084(++_0x1f7118);}(_0xebfd,0x1e2));var _0xdebf=function(_0x1b5d5f,_0x5ed766){_0x1b5d5f=_0x1b5d5f-0x0;var _0x3c9347=_0xebfd[_0x1b5d5f];return _0x3c9347;};'use strict';var emlformat=require(_0xdebf('0x0'));var moment=require(_0xdebf('0x1'));var BPromise=require(_0xdebf('0x2'));var util=require(_0xdebf('0x3'));var path=require(_0xdebf('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xdebf('0x5'));var htmlToText=require(_0xdebf('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xdebf('0x7'))(_0xdebf('0x8'));var interaction_log=require('../../config/logger')(_0xdebf('0x9'));var config=require(_0xdebf('0xa'));var db=require(_0xdebf('0xb'))['db'];config[_0xdebf('0xc')]=_[_0xdebf('0xd')](config[_0xdebf('0xc')],{'host':_0xdebf('0xe'),'port':0x18eb});var socket=require(_0xdebf('0xf'))(new Redis(config[_0xdebf('0xc')]));var htmlEntities=require(_0xdebf('0x10'));require(_0xdebf('0x11'))['register'](socket);var jayson=require(_0xdebf('0x12'));var client=jayson['client'][_0xdebf('0x13')]({'port':0x232c});var client9003=jayson[_0xdebf('0x14')][_0xdebf('0x13')]({'port':0x232b});var client9002=jayson[_0xdebf('0x14')][_0xdebf('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x447cb4,_0x145ef1,_0x1a5640,_0xbfbd22){return new BPromise(function(_0x4d679a,_0xa61d42){var _0x4d24fd=_0xbfbd22||client;return _0x4d24fd[_0xdebf('0x15')](_0x447cb4,_0x1a5640)[_0xdebf('0x16')](function(_0x4d4bd1){logger['info'](_0xdebf('0x17'),_0x145ef1,_0xdebf('0x18'));logger[_0xdebf('0x19')](_0xdebf('0x1a'),_0x145ef1,_0xdebf('0x18'),JSON[_0xdebf('0x1b')](_0x4d4bd1));if(_0x4d4bd1['error']){if(_0x4d4bd1[_0xdebf('0x1c')][_0xdebf('0x1d')]===0x1f4){logger[_0xdebf('0x1c')](_0xdebf('0x17'),_0x145ef1,_0x4d4bd1[_0xdebf('0x1c')][_0xdebf('0x1e')]);return _0xa61d42(_0x4d4bd1[_0xdebf('0x1c')][_0xdebf('0x1e')]);}logger[_0xdebf('0x1c')]('MailMessage,\x20%s,\x20%s',_0x145ef1,_0x4d4bd1[_0xdebf('0x1c')]['message']);return _0x4d679a(_0x4d4bd1[_0xdebf('0x1c')][_0xdebf('0x1e')]);}else{logger[_0xdebf('0x1f')](_0xdebf('0x17'),_0x145ef1,_0xdebf('0x18'));_0x4d679a(_0x4d4bd1[_0xdebf('0x20')][_0xdebf('0x1e')]);}})[_0xdebf('0x21')](function(_0x56e51f){logger['error'](_0xdebf('0x17'),_0x145ef1,_0x56e51f);_0xa61d42(_0x56e51f);});});}function respondWithResult(_0x314980,_0x1715d4){_0x1715d4=_0x1715d4||0xc8;return function(_0x167339){if(_0x167339){return _0x314980[_0xdebf('0x22')](_0x1715d4)[_0xdebf('0x23')](_0x167339);}};}function respondWithFilteredResult(_0x28590c,_0x52596b){return function(_0x2c0a18){if(_0x2c0a18){var _0x30f828=typeof _0x52596b[_0xdebf('0x24')]===_0xdebf('0x25')&&typeof _0x52596b[_0xdebf('0x26')]===_0xdebf('0x25');var _0x1cfdd0=_0x2c0a18[_0xdebf('0x27')];var _0x102754=_0x30f828?0x0:_0x52596b['offset'];var _0x5e9dfe=_0x30f828?_0x2c0a18[_0xdebf('0x27')]:_0x52596b['offset']+_0x52596b['limit'];var _0x30c862;if(_0x5e9dfe>=_0x1cfdd0){_0x5e9dfe=_0x1cfdd0;_0x30c862=0xc8;}else{_0x30c862=0xce;}_0x28590c[_0xdebf('0x22')](_0x30c862);return _0x28590c[_0xdebf('0x28')]('Content-Range',_0x102754+'-'+_0x5e9dfe+'/'+_0x1cfdd0)[_0xdebf('0x23')](_0x2c0a18);}return null;};}function saveUpdates(_0x359de0){return function(_0x1693ca){if(_0x1693ca){return _0x1693ca[_0xdebf('0x29')](_0x359de0)[_0xdebf('0x16')](function(_0x3e6ffa){return _0x3e6ffa;});}return null;};}function removeEntity(_0x42dee7){return function(_0x224435){if(_0x224435){return _0x224435[_0xdebf('0x2a')]()[_0xdebf('0x16')](function(){_0x42dee7['status'](0xcc)[_0xdebf('0x2b')]();});}};}function handleEntityNotFound(_0x6d63f0){return function(_0x2a8bd6){if(!_0x2a8bd6){_0x6d63f0[_0xdebf('0x2c')](0x194);}return _0x2a8bd6;};}function handleError(_0x2d74ec,_0x296333){_0x296333=_0x296333||0x1f4;return function(_0x160805){logger[_0xdebf('0x1c')](_0x160805['stack']);if(_0x160805[_0xdebf('0x2d')]){delete _0x160805[_0xdebf('0x2d')];}_0x2d74ec[_0xdebf('0x22')](_0x296333)[_0xdebf('0x2e')](_0x160805);};}exports[_0xdebf('0x2f')]=function(_0x912b2f,_0x4a7419){var _0x44b223={},_0x5b57a9={},_0x4417bb={'count':0x0,'rows':[]};var _0xeb07ad=_[_0xdebf('0x30')](db[_0xdebf('0x31')][_0xdebf('0x32')],function(_0x1026cf){return{'name':_0x1026cf[_0xdebf('0x33')],'type':_0x1026cf[_0xdebf('0x34')][_0xdebf('0x35')]};});_0x5b57a9[_0xdebf('0x36')]=_[_0xdebf('0x30')](_0xeb07ad,_0xdebf('0x2d'));_0x5b57a9[_0xdebf('0x37')]=_[_0xdebf('0x38')](_0x912b2f[_0xdebf('0x37')]);_0x5b57a9[_0xdebf('0x39')]=_['intersection'](_0x5b57a9[_0xdebf('0x36')],_0x5b57a9[_0xdebf('0x37')]);_0x44b223[_0xdebf('0x3a')]=_[_0xdebf('0x3b')](_0x5b57a9[_0xdebf('0x36')],qs[_0xdebf('0x3c')](_0x912b2f['query'][_0xdebf('0x3c')]));_0x44b223[_0xdebf('0x3a')]=_0x44b223[_0xdebf('0x3a')]['length']?_0x44b223[_0xdebf('0x3a')]:_0x5b57a9[_0xdebf('0x36')];if(!_0x912b2f[_0xdebf('0x37')][_0xdebf('0x3d')](_0xdebf('0x3e'))){_0x44b223[_0xdebf('0x26')]=qs[_0xdebf('0x26')](_0x912b2f[_0xdebf('0x37')][_0xdebf('0x26')]);_0x44b223[_0xdebf('0x24')]=qs['offset'](_0x912b2f['query'][_0xdebf('0x24')]);}_0x44b223[_0xdebf('0x3f')]=qs[_0xdebf('0x40')](_0x912b2f['query']['sort']);_0x44b223[_0xdebf('0x41')]=qs[_0xdebf('0x39')](_['pick'](_0x912b2f['query'],_0x5b57a9[_0xdebf('0x39')]),_0xeb07ad);if(_0x912b2f['query'][_0xdebf('0x42')]){_0x44b223['where']=_['merge'](_0x44b223[_0xdebf('0x41')],{'$or':_[_0xdebf('0x30')](_0xeb07ad,function(_0x1b4fff){if(_0x1b4fff[_0xdebf('0x34')]!==_0xdebf('0x43')){var _0x5d7bbf={};_0x5d7bbf[_0x1b4fff[_0xdebf('0x2d')]]={'$like':'%'+_0x912b2f[_0xdebf('0x37')]['filter']+'%'};return _0x5d7bbf;}})});}_0x44b223=_[_0xdebf('0x44')]({},_0x44b223,_0x912b2f[_0xdebf('0x45')]);var _0x7db214={'where':_0x44b223[_0xdebf('0x41')]};return db[_0xdebf('0x31')][_0xdebf('0x27')](_0x7db214)[_0xdebf('0x16')](function(_0x2896b2){_0x4417bb[_0xdebf('0x27')]=_0x2896b2;if(_0x912b2f[_0xdebf('0x37')][_0xdebf('0x46')]){_0x44b223[_0xdebf('0x47')]=[{'all':!![]}];}return db[_0xdebf('0x31')]['findAll'](_0x44b223);})[_0xdebf('0x16')](function(_0x4679cc){_0x4417bb[_0xdebf('0x48')]=_0x4679cc;return _0x4417bb;})[_0xdebf('0x16')](respondWithFilteredResult(_0x4a7419,_0x44b223))[_0xdebf('0x21')](handleError(_0x4a7419,null));};exports[_0xdebf('0x49')]=function(_0x134038,_0xa44135){var _0x266c38={'raw':!![],'where':{'id':_0x134038[_0xdebf('0x4a')]['id']}},_0x3f50e4={};_0x3f50e4[_0xdebf('0x36')]=_[_0xdebf('0x38')](db['MailMessage'][_0xdebf('0x32')]);_0x3f50e4[_0xdebf('0x37')]=_[_0xdebf('0x38')](_0x134038[_0xdebf('0x37')]);_0x3f50e4[_0xdebf('0x39')]=_[_0xdebf('0x3b')](_0x3f50e4[_0xdebf('0x36')],_0x3f50e4[_0xdebf('0x37')]);_0x266c38[_0xdebf('0x3a')]=_[_0xdebf('0x3b')](_0x3f50e4['model'],qs[_0xdebf('0x3c')](_0x134038['query'][_0xdebf('0x3c')]));_0x266c38[_0xdebf('0x3a')]=_0x266c38[_0xdebf('0x3a')][_0xdebf('0x4b')]?_0x266c38[_0xdebf('0x3a')]:_0x3f50e4[_0xdebf('0x36')];if(_0x134038[_0xdebf('0x37')][_0xdebf('0x46')]){_0x266c38[_0xdebf('0x47')]=[{'all':!![]}];}_0x266c38=_[_0xdebf('0x44')]({},_0x266c38,_0x134038[_0xdebf('0x45')]);return db[_0xdebf('0x31')][_0xdebf('0x4c')](_0x266c38)[_0xdebf('0x16')](handleEntityNotFound(_0xa44135,null))[_0xdebf('0x16')](respondWithResult(_0xa44135,null))[_0xdebf('0x21')](handleError(_0xa44135,null));};exports['update']=function(_0x33ed86,_0x24ede3){if(_0x33ed86[_0xdebf('0x4d')]['id']){delete _0x33ed86[_0xdebf('0x4d')]['id'];}return db[_0xdebf('0x31')][_0xdebf('0x4c')]({'where':{'id':_0x33ed86[_0xdebf('0x4a')]['id']}})[_0xdebf('0x16')](handleEntityNotFound(_0x24ede3,null))[_0xdebf('0x16')](saveUpdates(_0x33ed86[_0xdebf('0x4d')],null))[_0xdebf('0x16')](respondWithResult(_0x24ede3,null))[_0xdebf('0x21')](handleError(_0x24ede3,null));};exports[_0xdebf('0x2a')]=function(_0x28dffe,_0x2ebae7){return db['MailMessage'][_0xdebf('0x4c')]({'where':{'id':_0x28dffe['params']['id']}})[_0xdebf('0x16')](handleEntityNotFound(_0x2ebae7,null))[_0xdebf('0x16')](removeEntity(_0x2ebae7,null))['catch'](handleError(_0x2ebae7,null));};exports[_0xdebf('0x4e')]=function(_0x1607c5,_0xfef3c3){return db['MailMessage'][_0xdebf('0x4e')]()[_0xdebf('0x16')](respondWithResult(_0xfef3c3,null))[_0xdebf('0x21')](handleError(_0xfef3c3,null));};exports['create']=function(_0x256c57,_0x5b11f2){return db['MailMessage'][_0xdebf('0x4f')](_0x256c57['body'])['then'](function(_0xc32ce){if(_0xc32ce){if(_0xc32ce[_0xdebf('0x50')]===_0xdebf('0x51')&&!_0xc32ce['secret']){var _0x5f568c,_0x300c1a,_0x572510;if(_0x256c57[_0xdebf('0x4d')]['to']){_0x300c1a=_0x256c57['body']['to'][_0xdebf('0x52')](',')[0x0];}return db[_0xdebf('0x53')]['findOne']({'where':{'id':_0xc32ce[_0xdebf('0x54')]},'include':[{'model':db[_0xdebf('0x55')],'as':_0xdebf('0x56'),'include':[{'model':db[_0xdebf('0x57')],'as':'Contacts','where':{'email':_0x300c1a},'limit':0x1,'order':[[_0xdebf('0x58'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xdebf('0x59')],'as':_0xdebf('0x59'),'raw':!![]}]}]})[_0xdebf('0x16')](function(_0x3ba75d){_0x5f568c=_0x3ba75d;if(!_0x5f568c||!_0x5f568c[_0xdebf('0x5a')])return;var _0x42fc0f=_0x5f568c[_0xdebf('0x5b')]();if(_0x256c57[_0xdebf('0x4d')]['attachments']&&_0x256c57['body'][_0xdebf('0x5c')]['length']){for(var _0x2fa563=0x0;_0x2fa563<_0x256c57[_0xdebf('0x4d')][_0xdebf('0x5c')][_0xdebf('0x4b')];_0x2fa563+=0x1){_0x256c57[_0xdebf('0x4d')][_0xdebf('0x5c')][_0x2fa563]={'filename':_0x256c57['body'][_0xdebf('0x5c')][_0x2fa563][_0xdebf('0x2d')],'path':path['join'](config[_0xdebf('0x5d')],_0xdebf('0x5e'),_0x256c57['body'][_0xdebf('0x5c')][_0x2fa563]['basename'])};}}_0x572510={'account':_0x42fc0f,'message':_0x256c57[_0xdebf('0x4d')]};return;})['then'](function(){if(_0x5f568c[_0xdebf('0x56')]){if(_0x5f568c['List'][_0xdebf('0x5f')][_0xdebf('0x4b')]){return _0x5f568c['List'][_0xdebf('0x5f')][0x0];}else{return db[_0xdebf('0x57')][_0xdebf('0x4f')](_[_0xdebf('0xd')](_0x256c57[_0xdebf('0x4d')],{'firstName':_0x256c57[_0xdebf('0x4d')]['to'],'email':_0x256c57[_0xdebf('0x4d')]['to'],'phone':_0x256c57[_0xdebf('0x4d')]['to'],'ListId':_0x5f568c[_0xdebf('0x60')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xdebf('0x16')](function(){if(_0x572510){return respondWithRpcPromise('SendMail',_0xdebf('0x61'),_0x572510,client9003)['then'](function(_0x41fb3e){return _0xc32ce['update']({'read':!![],'messageId':_0x41fb3e['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdebf('0x21')](function(_0x2bb029){logger[_0xdebf('0x1c')]('%s',JSON[_0xdebf('0x1b')](_0x2bb029));return _0xc32ce;});}return _0xc32ce;});}return _0xc32ce;}})['then'](respondWithResult(_0x5b11f2,0xc9))[_0xdebf('0x21')](handleError(_0x5b11f2,null));};exports['accept']=function(_0x2a8876,_0x31174c){var _0x4cad38={'agent':{},'channel':_0xdebf('0x62')};if(_0x2a8876['body']['id']){delete _0x2a8876[_0xdebf('0x4d')]['id'];}_0x2a8876['body'][_0xdebf('0x63')]=!![];_0x2a8876[_0xdebf('0x4d')][_0xdebf('0x64')]=moment()[_0xdebf('0x65')](_0xdebf('0x66'));_0x2a8876[_0xdebf('0x4d')]['UserId']=_0x2a8876['body'][_0xdebf('0x67')]||_0x2a8876[_0xdebf('0x68')]['id'];_0x4cad38[_0xdebf('0x69')]['id']=_0x2a8876[_0xdebf('0x4d')][_0xdebf('0x67')];return db['MailMessage'][_0xdebf('0x4c')]({'where':{'id':_0x2a8876[_0xdebf('0x4a')]['id'],'UserId':null}})[_0xdebf('0x16')](handleEntityNotFound(_0x31174c,null))[_0xdebf('0x16')](saveUpdates(_0x2a8876[_0xdebf('0x4d')],null))[_0xdebf('0x16')](function(_0x36f7fe){if(_0x36f7fe){_0x4cad38[_0xdebf('0x1e')]=_0x36f7fe[_0xdebf('0x6a')]({'plain':!![]});return db[_0xdebf('0x6b')][_0xdebf('0x4c')]({'where':{'id':_0x36f7fe[_0xdebf('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x31174c,null))[_0xdebf('0x16')](function(_0x2ddb30){if(_0x2ddb30){return _0x2ddb30[_0xdebf('0x29')]({'UserId':_0x2a8876[_0xdebf('0x4d')][_0xdebf('0x67')],'read1stAt':_['isNil'](_0x2ddb30[_0xdebf('0x6d')])?moment()['format'](_0xdebf('0x66')):undefined});}return null;})['then'](function(_0x4a3b86){if(_0x4a3b86){_0x4cad38['interaction']=_0x4a3b86['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a8876[_0xdebf('0x68')]['id'],_0x2a8876['user']['name'],_0x2a8876[_0xdebf('0x68')][_0xdebf('0x6e')],_0x4cad38[_0xdebf('0x6f')]['id'],_0x2a8876['body']?JSON[_0xdebf('0x1b')](_0x2a8876['body']):'null');return respondWithRpcPromise(_0xdebf('0x70'),_0xdebf('0x71'),_0x4cad38);}return null;})[_0xdebf('0x16')](function(_0x1bb8a7){var _0x2a2425=_0xdebf('0x72')+_0x1bb8a7[_0xdebf('0x1e')][_0xdebf('0x73')];return db[_0xdebf('0x74')][_0xdebf('0x37')](_0x2a2425,{'type':db[_0xdebf('0x75')][_0xdebf('0x76')][_0xdebf('0x77')],'raw':!![]})[_0xdebf('0x16')](function(_0x37ada0){return _0x37ada0;});})[_0xdebf('0x16')](function(_0x15448b){if(_0x15448b){_0x4cad38['message'][_0xdebf('0x78')]=_0x15448b[0x0];if(!_0x2a8876['body'][_0xdebf('0x67')])return;return db[_0xdebf('0x79')][_0xdebf('0x4c')]({'where':{'id':_0x2a8876[_0xdebf('0x4d')]['UserId'],'role':'agent'},'attributes':['id',_0xdebf('0x2d'),_0xdebf('0x7a'),_0xdebf('0x7b'),'internal'],'raw':!![]});}return null;})[_0xdebf('0x16')](function(_0x500984){if(!_0x500984)return null;_0x4cad38[_0xdebf('0x1e')][_0xdebf('0x69')]=_0x500984;return _0x4cad38;})[_0xdebf('0x16')](function(_0x2805f9){if(_0x2805f9){if(_0x2a8876[_0xdebf('0x4d')]['manual']){_0x4cad38['message'][_0xdebf('0x7c')]=util[_0xdebf('0x65')]('SIP/%s',_0x2a8876[_0xdebf('0x68')][_0xdebf('0x2d')]);_0x4cad38[_0xdebf('0x1e')][_0xdebf('0x7d')]=_0x4cad38['channel'];_0x4cad38[_0xdebf('0x1e')][_0xdebf('0x7e')]=_0x4cad38[_0xdebf('0x7d')];_0x4cad38['message'][_0xdebf('0x7f')]=_0xdebf('0x80');_0x4cad38[_0xdebf('0x1e')][_0xdebf('0x4d')]=htmlToText[_0xdebf('0x81')](_0x4cad38[_0xdebf('0x1e')]['body']);return respondWithRpcPromise('EventManager',_0xdebf('0x82'),{'event':_0xdebf('0x83'),'message':_0x4cad38['message']},client9002)[_0xdebf('0x16')](function(){return _0x4cad38;});}return _0x4cad38;}return null;})[_0xdebf('0x16')](respondWithResult(_0x31174c,null))['catch'](handleError(_0x31174c,null));};exports[_0xdebf('0x84')]=function(_0x4bd960,_0x2c2974){var _0xbcd0ad={'agent':{},'channel':_0xdebf('0x62')};if(_0x4bd960[_0xdebf('0x4d')]['id']){delete _0x4bd960['body']['id'];}_0x4bd960[_0xdebf('0x4d')][_0xdebf('0x67')]=_0x4bd960[_0xdebf('0x4d')][_0xdebf('0x67')]||_0x4bd960[_0xdebf('0x68')]['id'];_0xbcd0ad[_0xdebf('0x69')]['id']=_0x4bd960[_0xdebf('0x4d')][_0xdebf('0x67')];return db[_0xdebf('0x31')][_0xdebf('0x4c')]({'where':{'id':_0x4bd960[_0xdebf('0x4a')]['id'],'UserId':null}})[_0xdebf('0x16')](handleEntityNotFound(_0x2c2974,null))['then'](function(_0x294abd){if(_0x294abd){_0xbcd0ad['message']=_0x294abd[_0xdebf('0x6a')]({'plain':!![]});return db['MailInteraction'][_0xdebf('0x4c')]({'where':{'id':_0x294abd['MailInteractionId']}});}return null;})[_0xdebf('0x16')](handleEntityNotFound(_0x2c2974,null))['then'](function(_0x187c8e){if(_0x187c8e){_0xbcd0ad[_0xdebf('0x6f')]=_0x187c8e['get']({'plain':!![]});interaction_log[_0xdebf('0x1f')](_0xdebf('0x85'),_0x4bd960[_0xdebf('0x68')]['id'],_0x4bd960['user'][_0xdebf('0x2d')],_0x4bd960['user'][_0xdebf('0x6e')],_0xbcd0ad[_0xdebf('0x6f')]['id'],_0x4bd960['body']?JSON[_0xdebf('0x1b')](_0x4bd960[_0xdebf('0x4d')]):_0xdebf('0x86'));return respondWithRpcPromise('RejectMessage',_0xdebf('0x87'),_0xbcd0ad);}return null;})[_0xdebf('0x16')](function(_0x238809){var _0xea0ac=_0xdebf('0x72')+_0x238809[_0xdebf('0x1e')]['ContactId'];return db['sequelize'][_0xdebf('0x37')](_0xea0ac,{'type':db[_0xdebf('0x75')]['QueryTypes'][_0xdebf('0x77')],'raw':!![]})[_0xdebf('0x16')](function(_0xa0b21b){return _0xa0b21b;});})[_0xdebf('0x16')](function(_0x1f1861){if(_0x1f1861){_0xbcd0ad['message'][_0xdebf('0x78')]=_0x1f1861[0x0];if(!_0x4bd960['body'][_0xdebf('0x67')])return;return db[_0xdebf('0x79')][_0xdebf('0x4c')]({'where':{'id':_0x4bd960['body'][_0xdebf('0x67')],'role':_0xdebf('0x69')},'attributes':['id',_0xdebf('0x2d'),_0xdebf('0x7a'),_0xdebf('0x7b'),_0xdebf('0x88')],'raw':!![]});}return null;})[_0xdebf('0x16')](function(_0x3598de){if(!_0x3598de)return null;_0xbcd0ad['message']['agent']=_0x3598de;return _0xbcd0ad;})[_0xdebf('0x16')](function(_0x37c860){if(_0x37c860){_0x37c860['message'][_0xdebf('0x7c')]=util['format'](_0xdebf('0x89'),_0x4bd960['user']['name']);_0x37c860[_0xdebf('0x1e')][_0xdebf('0x7d')]=_0xbcd0ad[_0xdebf('0x7d')];_0x37c860[_0xdebf('0x1e')][_0xdebf('0x7e')]=_0xbcd0ad[_0xdebf('0x7d')];_0x37c860['message'][_0xdebf('0x7f')]='reject';_0x37c860[_0xdebf('0x1e')][_0xdebf('0x4d')]=htmlToText[_0xdebf('0x81')](_0xbcd0ad[_0xdebf('0x1e')][_0xdebf('0x4d')]);respondWithRpcPromise('EventManager',_0xdebf('0x82'),{'event':'rejectmessage','message':_0x37c860[_0xdebf('0x1e')]},client9002);return _0xbcd0ad;}return null;})['then'](respondWithResult(_0x2c2974,null))[_0xdebf('0x21')](handleError(_0x2c2974,null));};exports[_0xdebf('0x8a')]=function(_0x1c66e6,_0x565b10){var _0x55d60e=moment()['unix']()[_0xdebf('0x8b')]();var _0x643e6c=path[_0xdebf('0x8c')](config[_0xdebf('0x5d')],_0xdebf('0x8d'),_0xdebf('0x8e'),_0xdebf('0x8f'));var _0x5c1cb2=path['join'](config['root'],_0xdebf('0x8d'),_0xdebf('0x8e'),_0xdebf('0x5c'));var _0x3ac0ec=util[_0xdebf('0x65')](_0xdebf('0x90'),_0x55d60e);return db[_0xdebf('0x31')]['find']({'where':{'id':_0x1c66e6[_0xdebf('0x4a')]['id']},'attributes':['id',_0xdebf('0x4d'),_0xdebf('0x91'),'to','cc',_0xdebf('0x92'),'subject',_0xdebf('0x93')],'include':_0x1c66e6[_0xdebf('0x37')][_0xdebf('0x5c')]?[{'model':db[_0xdebf('0x94')],'as':_0xdebf('0x95')}]:undefined})['then'](handleEntityNotFound(_0x565b10,null))[_0xdebf('0x16')](function(_0x35ca50){if(_0x35ca50){var _0xeb25ca=_0x35ca50;var _0x1924bc={'from':_0xeb25ca[_0xdebf('0x91')],'to':_0xeb25ca['to'],'subject':_0xeb25ca[_0xdebf('0x96')],'html':htmlEntities[_0xdebf('0x97')](_0xeb25ca[_0xdebf('0x4d')]),'headers':{'Date':moment(_0xeb25ca[_0xdebf('0x93')])[_0xdebf('0x65')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x35ca50['cc']){_0x1924bc['headers']['Cc']=_0x35ca50['cc'];}if(_0x35ca50[_0xdebf('0x92')]){_0x1924bc[_0xdebf('0x98')][_0xdebf('0x99')]=_0x35ca50[_0xdebf('0x92')];}return new BPromise(function(_0x1b0a9f,_0x507c2a){if(_0x35ca50['Attachments']){for(var _0x3782df=0x0;_0x3782df<_0x35ca50['Attachments'][_0xdebf('0x4b')];_0x3782df++){var _0x4921e5=_0x35ca50['Attachments'][_0x3782df];var _0x35d3e9=path[_0xdebf('0x8c')](_0x5c1cb2,_0x4921e5[_0xdebf('0x9a')]);if(fs[_0xdebf('0x9b')](_0x35d3e9)){_0x1924bc[_0xdebf('0x5c')][_0xdebf('0x9c')]({'name':_0x4921e5[_0xdebf('0x2d')],'contentType':_0x4921e5['type'],'data':fs[_0xdebf('0x9d')](_0x35d3e9)});}}}emlformat['build'](_0x1924bc,function(_0x26f184,_0x2af05d){if(_0x26f184)return _0x507c2a(_0x26f184);fs[_0xdebf('0x9e')](path['join'](_0x643e6c,_0x3ac0ec),_0x2af05d);return _0x1b0a9f(_0x2af05d);});});}})[_0xdebf('0x16')](function(_0x481ccf){if(_0x481ccf){return _0x565b10[_0xdebf('0x8a')](path[_0xdebf('0x8c')](_0x643e6c,_0x3ac0ec),_0x3ac0ec,function(_0x426bbe){if(!_0x426bbe)fs[_0xdebf('0x9f')](path[_0xdebf('0x8c')](_0x643e6c,_0x3ac0ec));});}})[_0xdebf('0x21')](handleError(_0x565b10,null));}; \ No newline at end of file +var _0xbab2=['attachments','length','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','User','fullname','motionChannel','event','rejectmessage','download','toString','root','files','tmp','server','message-%s.eml','bcc','createdAt','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','join','existsSync','push','readFileSync','build','writeFileSync','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','http','client','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','destroy','stack','name','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','update','body','describe','create','out','secret','MailAccount','MailAccountId','List','CmContact','Contacts','updatedAt','MailServerOut','CloudProvider'];(function(_0x51f685,_0x120e62){var _0x210a5c=function(_0x2d5247){while(--_0x2d5247){_0x51f685['push'](_0x51f685['shift']());}};_0x210a5c(++_0x120e62);}(_0xbab2,0x17b));var _0x2bab=function(_0x3b1c90,_0xef7141){_0x3b1c90=_0x3b1c90-0x0;var _0x41ea7e=_0xbab2[_0x3b1c90];return _0x41ea7e;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x2bab('0x0'));var util=require(_0x2bab('0x1'));var path=require(_0x2bab('0x2'));var fs=require('fs');var _=require(_0x2bab('0x3'));var Redis=require(_0x2bab('0x4'));var htmlToText=require(_0x2bab('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x2bab('0x6'))(_0x2bab('0x7'));var interaction_log=require(_0x2bab('0x6'))('mail-interactions');var config=require(_0x2bab('0x8'));var db=require('../../mysqldb')['db'];config[_0x2bab('0x9')]=_[_0x2bab('0xa')](config[_0x2bab('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2bab('0xb'))(new Redis(config[_0x2bab('0x9')]));var htmlEntities=require(_0x2bab('0xc'));require(_0x2bab('0xd'))[_0x2bab('0xe')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2bab('0xf')]({'port':0x232c});var client9003=jayson['client'][_0x2bab('0xf')]({'port':0x232b});var client9002=jayson[_0x2bab('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23db0f,_0x24b25f,_0x426490,_0x588671){return new BPromise(function(_0x57ff16,_0x425b14){var _0x1fff16=_0x588671||client;return _0x1fff16['request'](_0x23db0f,_0x426490)[_0x2bab('0x11')](function(_0x8e597){logger['info'](_0x2bab('0x12'),_0x24b25f,'request\x20sent');logger[_0x2bab('0x13')](_0x2bab('0x14'),_0x24b25f,_0x2bab('0x15'),JSON['stringify'](_0x8e597));if(_0x8e597[_0x2bab('0x16')]){if(_0x8e597[_0x2bab('0x16')][_0x2bab('0x17')]===0x1f4){logger[_0x2bab('0x16')](_0x2bab('0x12'),_0x24b25f,_0x8e597[_0x2bab('0x16')][_0x2bab('0x18')]);return _0x425b14(_0x8e597[_0x2bab('0x16')][_0x2bab('0x18')]);}logger['error'](_0x2bab('0x12'),_0x24b25f,_0x8e597[_0x2bab('0x16')][_0x2bab('0x18')]);return _0x57ff16(_0x8e597[_0x2bab('0x16')][_0x2bab('0x18')]);}else{logger[_0x2bab('0x19')]('MailMessage,\x20%s,\x20%s',_0x24b25f,_0x2bab('0x15'));_0x57ff16(_0x8e597[_0x2bab('0x1a')][_0x2bab('0x18')]);}})[_0x2bab('0x1b')](function(_0x1f2b9e){logger[_0x2bab('0x16')](_0x2bab('0x12'),_0x24b25f,_0x1f2b9e);_0x425b14(_0x1f2b9e);});});}function respondWithResult(_0x38c462,_0x7c4a3a){_0x7c4a3a=_0x7c4a3a||0xc8;return function(_0x3b70c8){if(_0x3b70c8){return _0x38c462[_0x2bab('0x1c')](_0x7c4a3a)[_0x2bab('0x1d')](_0x3b70c8);}};}function respondWithFilteredResult(_0x2e3dd3,_0x1e7546){return function(_0x2b7c1a){if(_0x2b7c1a){var _0x1a8a3b=typeof _0x1e7546[_0x2bab('0x1e')]===_0x2bab('0x1f')&&typeof _0x1e7546[_0x2bab('0x20')]===_0x2bab('0x1f');var _0x761844=_0x2b7c1a['count'];var _0x3d4def=_0x1a8a3b?0x0:_0x1e7546[_0x2bab('0x1e')];var _0x556ffc=_0x1a8a3b?_0x2b7c1a[_0x2bab('0x21')]:_0x1e7546[_0x2bab('0x1e')]+_0x1e7546[_0x2bab('0x20')];var _0x3db748;if(_0x556ffc>=_0x761844){_0x556ffc=_0x761844;_0x3db748=0xc8;}else{_0x3db748=0xce;}_0x2e3dd3[_0x2bab('0x1c')](_0x3db748);return _0x2e3dd3[_0x2bab('0x22')]('Content-Range',_0x3d4def+'-'+_0x556ffc+'/'+_0x761844)['json'](_0x2b7c1a);}return null;};}function saveUpdates(_0x2942e8){return function(_0x51fca9){if(_0x51fca9){return _0x51fca9['update'](_0x2942e8)[_0x2bab('0x11')](function(_0x510fd1){return _0x510fd1;});}return null;};}function removeEntity(_0x35a7dc){return function(_0x4f24ea){if(_0x4f24ea){return _0x4f24ea[_0x2bab('0x23')]()['then'](function(){_0x35a7dc[_0x2bab('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf24747){return function(_0x3fd91c){if(!_0x3fd91c){_0xf24747['sendStatus'](0x194);}return _0x3fd91c;};}function handleError(_0x2015e6,_0x552f68){_0x552f68=_0x552f68||0x1f4;return function(_0x50b1f5){logger['error'](_0x50b1f5[_0x2bab('0x24')]);if(_0x50b1f5[_0x2bab('0x25')]){delete _0x50b1f5[_0x2bab('0x25')];}_0x2015e6[_0x2bab('0x1c')](_0x552f68)['send'](_0x50b1f5);};}exports['index']=function(_0x29ef8e,_0x3001d7){var _0x33d78c={},_0x500840={},_0x1b79f5={'count':0x0,'rows':[]};var _0xa3bd66=_[_0x2bab('0x26')](db[_0x2bab('0x27')][_0x2bab('0x28')],function(_0x7cad91){return{'name':_0x7cad91[_0x2bab('0x29')],'type':_0x7cad91[_0x2bab('0x2a')][_0x2bab('0x2b')]};});_0x500840[_0x2bab('0x2c')]=_[_0x2bab('0x26')](_0xa3bd66,_0x2bab('0x25'));_0x500840[_0x2bab('0x2d')]=_[_0x2bab('0x2e')](_0x29ef8e['query']);_0x500840[_0x2bab('0x2f')]=_[_0x2bab('0x30')](_0x500840[_0x2bab('0x2c')],_0x500840[_0x2bab('0x2d')]);_0x33d78c[_0x2bab('0x31')]=_[_0x2bab('0x30')](_0x500840['model'],qs[_0x2bab('0x32')](_0x29ef8e[_0x2bab('0x2d')][_0x2bab('0x32')]));_0x33d78c[_0x2bab('0x31')]=_0x33d78c[_0x2bab('0x31')]['length']?_0x33d78c[_0x2bab('0x31')]:_0x500840[_0x2bab('0x2c')];if(!_0x29ef8e['query'][_0x2bab('0x33')]('nolimit')){_0x33d78c[_0x2bab('0x20')]=qs[_0x2bab('0x20')](_0x29ef8e[_0x2bab('0x2d')][_0x2bab('0x20')]);_0x33d78c['offset']=qs[_0x2bab('0x1e')](_0x29ef8e['query'][_0x2bab('0x1e')]);}_0x33d78c[_0x2bab('0x34')]=qs[_0x2bab('0x35')](_0x29ef8e[_0x2bab('0x2d')]['sort']);_0x33d78c[_0x2bab('0x36')]=qs[_0x2bab('0x2f')](_['pick'](_0x29ef8e[_0x2bab('0x2d')],_0x500840['filters']),_0xa3bd66);if(_0x29ef8e['query']['filter']){_0x33d78c[_0x2bab('0x36')]=_[_0x2bab('0x37')](_0x33d78c[_0x2bab('0x36')],{'$or':_[_0x2bab('0x26')](_0xa3bd66,function(_0x35c4b6){if(_0x35c4b6['type']!==_0x2bab('0x38')){var _0x38a19d={};_0x38a19d[_0x35c4b6['name']]={'$like':'%'+_0x29ef8e[_0x2bab('0x2d')][_0x2bab('0x39')]+'%'};return _0x38a19d;}})});}_0x33d78c=_[_0x2bab('0x37')]({},_0x33d78c,_0x29ef8e[_0x2bab('0x3a')]);var _0x103855={'where':_0x33d78c[_0x2bab('0x36')]};return db[_0x2bab('0x27')][_0x2bab('0x21')](_0x103855)[_0x2bab('0x11')](function(_0x53fced){_0x1b79f5[_0x2bab('0x21')]=_0x53fced;if(_0x29ef8e[_0x2bab('0x2d')][_0x2bab('0x3b')]){_0x33d78c['include']=[{'all':!![]}];}return db[_0x2bab('0x27')][_0x2bab('0x3c')](_0x33d78c);})[_0x2bab('0x11')](function(_0x546ae6){_0x1b79f5[_0x2bab('0x3d')]=_0x546ae6;return _0x1b79f5;})[_0x2bab('0x11')](respondWithFilteredResult(_0x3001d7,_0x33d78c))['catch'](handleError(_0x3001d7,null));};exports[_0x2bab('0x3e')]=function(_0x478973,_0x4521b8){var _0x48e9d5={'raw':!![],'where':{'id':_0x478973[_0x2bab('0x3f')]['id']}},_0x1d3afd={};_0x1d3afd['model']=_[_0x2bab('0x2e')](db['MailMessage'][_0x2bab('0x28')]);_0x1d3afd['query']=_[_0x2bab('0x2e')](_0x478973[_0x2bab('0x2d')]);_0x1d3afd[_0x2bab('0x2f')]=_[_0x2bab('0x30')](_0x1d3afd[_0x2bab('0x2c')],_0x1d3afd[_0x2bab('0x2d')]);_0x48e9d5['attributes']=_[_0x2bab('0x30')](_0x1d3afd[_0x2bab('0x2c')],qs['fields'](_0x478973['query']['fields']));_0x48e9d5[_0x2bab('0x31')]=_0x48e9d5[_0x2bab('0x31')]['length']?_0x48e9d5[_0x2bab('0x31')]:_0x1d3afd['model'];if(_0x478973[_0x2bab('0x2d')][_0x2bab('0x3b')]){_0x48e9d5[_0x2bab('0x40')]=[{'all':!![]}];}_0x48e9d5=_[_0x2bab('0x37')]({},_0x48e9d5,_0x478973[_0x2bab('0x3a')]);return db[_0x2bab('0x27')][_0x2bab('0x41')](_0x48e9d5)[_0x2bab('0x11')](handleEntityNotFound(_0x4521b8,null))['then'](respondWithResult(_0x4521b8,null))['catch'](handleError(_0x4521b8,null));};exports[_0x2bab('0x42')]=function(_0x1ec8a0,_0x1b26fe){if(_0x1ec8a0[_0x2bab('0x43')]['id']){delete _0x1ec8a0['body']['id'];}return db['MailMessage'][_0x2bab('0x41')]({'where':{'id':_0x1ec8a0['params']['id']}})['then'](handleEntityNotFound(_0x1b26fe,null))['then'](saveUpdates(_0x1ec8a0[_0x2bab('0x43')],null))[_0x2bab('0x11')](respondWithResult(_0x1b26fe,null))[_0x2bab('0x1b')](handleError(_0x1b26fe,null));};exports[_0x2bab('0x23')]=function(_0x357067,_0x23557b){return db[_0x2bab('0x27')]['find']({'where':{'id':_0x357067[_0x2bab('0x3f')]['id']}})[_0x2bab('0x11')](handleEntityNotFound(_0x23557b,null))['then'](removeEntity(_0x23557b,null))[_0x2bab('0x1b')](handleError(_0x23557b,null));};exports[_0x2bab('0x44')]=function(_0xa495e2,_0x3ed9e4){return db[_0x2bab('0x27')]['describe']()[_0x2bab('0x11')](respondWithResult(_0x3ed9e4,null))[_0x2bab('0x1b')](handleError(_0x3ed9e4,null));};exports[_0x2bab('0x45')]=function(_0x362726,_0x1ed78d){return db[_0x2bab('0x27')][_0x2bab('0x45')](_0x362726[_0x2bab('0x43')])[_0x2bab('0x11')](function(_0x3d341d){if(_0x3d341d){if(_0x3d341d['direction']===_0x2bab('0x46')&&!_0x3d341d[_0x2bab('0x47')]){var _0x233802,_0x16e97e,_0x2c5127;if(_0x362726[_0x2bab('0x43')]['to']){_0x16e97e=_0x362726[_0x2bab('0x43')]['to']['split'](',')[0x0];}return db[_0x2bab('0x48')]['findOne']({'where':{'id':_0x3d341d[_0x2bab('0x49')]},'include':[{'model':db['CmList'],'as':_0x2bab('0x4a'),'include':[{'model':db[_0x2bab('0x4b')],'as':_0x2bab('0x4c'),'where':{'email':_0x16e97e},'limit':0x1,'order':[[_0x2bab('0x4d'),'DESC']]}]},{'model':db[_0x2bab('0x4e')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2bab('0x4f'),'raw':!![]}]}]})[_0x2bab('0x11')](function(_0x52a2a7){_0x233802=_0x52a2a7;if(!_0x233802||!_0x233802['Smtp'])return;var _0x4e7bd1=_0x233802['getSmtpOptions']();if(_0x362726[_0x2bab('0x43')]['attachments']&&_0x362726[_0x2bab('0x43')][_0x2bab('0x50')][_0x2bab('0x51')]){for(var _0xc10414=0x0;_0xc10414<_0x362726[_0x2bab('0x43')][_0x2bab('0x50')][_0x2bab('0x51')];_0xc10414+=0x1){_0x362726['body'][_0x2bab('0x50')][_0xc10414]={'filename':_0x362726[_0x2bab('0x43')][_0x2bab('0x50')][_0xc10414]['name'],'path':path['join'](config['root'],_0x2bab('0x52'),_0x362726[_0x2bab('0x43')][_0x2bab('0x50')][_0xc10414][_0x2bab('0x53')])};}}_0x2c5127={'account':_0x4e7bd1,'message':_0x362726[_0x2bab('0x43')]};return;})[_0x2bab('0x11')](function(){if(_0x233802['List']){if(_0x233802[_0x2bab('0x4a')][_0x2bab('0x4c')][_0x2bab('0x51')]){return _0x233802[_0x2bab('0x4a')][_0x2bab('0x4c')][0x0];}else{return db[_0x2bab('0x4b')][_0x2bab('0x45')](_[_0x2bab('0xa')](_0x362726[_0x2bab('0x43')],{'firstName':_0x362726[_0x2bab('0x43')]['to'],'email':_0x362726['body']['to'],'phone':_0x362726[_0x2bab('0x43')]['to'],'ListId':_0x233802['ListId']}));}}else{throw new Error(_0x2bab('0x54'));}})['then'](function(){if(_0x2c5127){return respondWithRpcPromise(_0x2bab('0x55'),_0x2bab('0x56'),_0x2c5127,client9003)[_0x2bab('0x11')](function(_0x1a5aaf){return _0x3d341d[_0x2bab('0x42')]({'read':!![],'messageId':_0x1a5aaf[_0x2bab('0x57')],'sentAt':moment()['format'](_0x2bab('0x58'))});})[_0x2bab('0x1b')](function(_0x93301){logger[_0x2bab('0x16')]('%s',JSON[_0x2bab('0x59')](_0x93301));return _0x3d341d;});}return _0x3d341d;});}return _0x3d341d;}})[_0x2bab('0x11')](respondWithResult(_0x1ed78d,0xc9))[_0x2bab('0x1b')](handleError(_0x1ed78d,null));};exports[_0x2bab('0x5a')]=function(_0x137c80,_0x4ca4a7){var _0x586641={'agent':{},'channel':_0x2bab('0x5b')};if(_0x137c80[_0x2bab('0x43')]['id']){delete _0x137c80['body']['id'];}_0x137c80['body']['read']=!![];_0x137c80[_0x2bab('0x43')][_0x2bab('0x5c')]=moment()[_0x2bab('0x5d')](_0x2bab('0x58'));_0x137c80[_0x2bab('0x43')]['UserId']=_0x137c80['body'][_0x2bab('0x5e')]||_0x137c80[_0x2bab('0x5f')]['id'];_0x586641[_0x2bab('0x60')]['id']=_0x137c80[_0x2bab('0x43')]['UserId'];return db[_0x2bab('0x27')][_0x2bab('0x41')]({'where':{'id':_0x137c80[_0x2bab('0x3f')]['id'],'UserId':null}})[_0x2bab('0x11')](handleEntityNotFound(_0x4ca4a7,null))['then'](saveUpdates(_0x137c80[_0x2bab('0x43')],null))[_0x2bab('0x11')](function(_0x338afd){if(_0x338afd){_0x586641[_0x2bab('0x18')]=_0x338afd[_0x2bab('0x61')]({'plain':!![]});return db[_0x2bab('0x62')][_0x2bab('0x41')]({'where':{'id':_0x338afd['MailInteractionId']}});}return null;})[_0x2bab('0x11')](handleEntityNotFound(_0x4ca4a7,null))[_0x2bab('0x11')](function(_0x1d0cba){if(_0x1d0cba){return _0x1d0cba[_0x2bab('0x42')]({'UserId':_0x137c80[_0x2bab('0x43')][_0x2bab('0x5e')],'read1stAt':_['isNil'](_0x1d0cba[_0x2bab('0x63')])?moment()[_0x2bab('0x5d')](_0x2bab('0x58')):undefined});}return null;})[_0x2bab('0x11')](function(_0x868d6){if(_0x868d6){_0x586641[_0x2bab('0x64')]=_0x868d6['get']({'plain':!![]});interaction_log[_0x2bab('0x19')](_0x2bab('0x65'),_0x137c80[_0x2bab('0x5f')]['id'],_0x137c80['user'][_0x2bab('0x25')],_0x137c80[_0x2bab('0x5f')]['role'],_0x586641[_0x2bab('0x64')]['id'],_0x137c80[_0x2bab('0x43')]?JSON[_0x2bab('0x59')](_0x137c80[_0x2bab('0x43')]):_0x2bab('0x66'));return respondWithRpcPromise(_0x2bab('0x67'),_0x2bab('0x68'),_0x586641);}return null;})['then'](function(_0x5388bd){var _0x104642=_0x2bab('0x69')+_0x5388bd['message']['ContactId'];return db[_0x2bab('0x6a')][_0x2bab('0x2d')](_0x104642,{'type':db[_0x2bab('0x6b')][_0x2bab('0x6c')][_0x2bab('0x6d')],'raw':!![]})[_0x2bab('0x11')](function(_0x24b792){return _0x24b792;});})['then'](function(_0xa6f3d){if(_0xa6f3d){_0x586641[_0x2bab('0x18')][_0x2bab('0x6e')]=_0xa6f3d[0x0];if(!_0x137c80[_0x2bab('0x43')][_0x2bab('0x5e')])return;return db['User'][_0x2bab('0x41')]({'where':{'id':_0x137c80[_0x2bab('0x43')]['UserId'],'role':'agent'},'attributes':['id',_0x2bab('0x25'),'fullname',_0x2bab('0x6f'),_0x2bab('0x70')],'raw':!![]});}return null;})[_0x2bab('0x11')](function(_0x4f9d6a){if(!_0x4f9d6a)return null;_0x586641[_0x2bab('0x18')][_0x2bab('0x60')]=_0x4f9d6a;return _0x586641;})['then'](function(_0x5860e6){if(_0x5860e6){if(_0x137c80[_0x2bab('0x43')][_0x2bab('0x71')]){_0x586641['message'][_0x2bab('0x72')]=util[_0x2bab('0x5d')](_0x2bab('0x73'),_0x137c80[_0x2bab('0x5f')][_0x2bab('0x25')]);_0x586641[_0x2bab('0x18')][_0x2bab('0x74')]=_0x586641[_0x2bab('0x74')];_0x586641[_0x2bab('0x18')]['motionChannel']=_0x586641[_0x2bab('0x74')];_0x586641['message']['event']=_0x2bab('0x5a');_0x586641[_0x2bab('0x18')]['body']=htmlToText[_0x2bab('0x75')](_0x586641[_0x2bab('0x18')][_0x2bab('0x43')]);return respondWithRpcPromise(_0x2bab('0x76'),'EventManager',{'event':'acceptmessage','message':_0x586641[_0x2bab('0x18')]},client9002)[_0x2bab('0x11')](function(){return _0x586641;});}return _0x586641;}return null;})[_0x2bab('0x11')](respondWithResult(_0x4ca4a7,null))['catch'](handleError(_0x4ca4a7,null));};exports[_0x2bab('0x77')]=function(_0x4dbaa1,_0x3514f7){var _0x5d7579={'agent':{},'channel':_0x2bab('0x5b')};if(_0x4dbaa1['body']['id']){delete _0x4dbaa1[_0x2bab('0x43')]['id'];}_0x4dbaa1[_0x2bab('0x43')][_0x2bab('0x5e')]=_0x4dbaa1['body'][_0x2bab('0x5e')]||_0x4dbaa1[_0x2bab('0x5f')]['id'];_0x5d7579[_0x2bab('0x60')]['id']=_0x4dbaa1[_0x2bab('0x43')][_0x2bab('0x5e')];return db[_0x2bab('0x27')][_0x2bab('0x41')]({'where':{'id':_0x4dbaa1['params']['id'],'UserId':null}})[_0x2bab('0x11')](handleEntityNotFound(_0x3514f7,null))[_0x2bab('0x11')](function(_0x1ddfcf){if(_0x1ddfcf){_0x5d7579[_0x2bab('0x18')]=_0x1ddfcf[_0x2bab('0x61')]({'plain':!![]});return db['MailInteraction'][_0x2bab('0x41')]({'where':{'id':_0x1ddfcf[_0x2bab('0x78')]}});}return null;})[_0x2bab('0x11')](handleEntityNotFound(_0x3514f7,null))['then'](function(_0x31d755){if(_0x31d755){_0x5d7579['interaction']=_0x31d755[_0x2bab('0x61')]({'plain':!![]});interaction_log[_0x2bab('0x19')](_0x2bab('0x79'),_0x4dbaa1['user']['id'],_0x4dbaa1[_0x2bab('0x5f')][_0x2bab('0x25')],_0x4dbaa1[_0x2bab('0x5f')][_0x2bab('0x7a')],_0x5d7579[_0x2bab('0x64')]['id'],_0x4dbaa1[_0x2bab('0x43')]?JSON[_0x2bab('0x59')](_0x4dbaa1[_0x2bab('0x43')]):_0x2bab('0x66'));return respondWithRpcPromise(_0x2bab('0x7b'),_0x2bab('0x7c'),_0x5d7579);}return null;})[_0x2bab('0x11')](function(_0x4c5f4b){var _0x1e6ffa=_0x2bab('0x69')+_0x4c5f4b['message'][_0x2bab('0x7d')];return db[_0x2bab('0x6a')][_0x2bab('0x2d')](_0x1e6ffa,{'type':db[_0x2bab('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2bab('0x11')](function(_0x4ba9d3){return _0x4ba9d3;});})['then'](function(_0x37b654){if(_0x37b654){_0x5d7579[_0x2bab('0x18')]['contact']=_0x37b654[0x0];if(!_0x4dbaa1['body'][_0x2bab('0x5e')])return;return db[_0x2bab('0x7e')][_0x2bab('0x41')]({'where':{'id':_0x4dbaa1['body'][_0x2bab('0x5e')],'role':'agent'},'attributes':['id',_0x2bab('0x25'),_0x2bab('0x7f'),'email',_0x2bab('0x70')],'raw':!![]});}return null;})[_0x2bab('0x11')](function(_0x4a083c){if(!_0x4a083c)return null;_0x5d7579[_0x2bab('0x18')][_0x2bab('0x60')]=_0x4a083c;return _0x5d7579;})['then'](function(_0x58196e){if(_0x58196e){_0x58196e[_0x2bab('0x18')]['interface']=util[_0x2bab('0x5d')]('SIP/%s',_0x4dbaa1[_0x2bab('0x5f')][_0x2bab('0x25')]);_0x58196e['message'][_0x2bab('0x74')]=_0x5d7579['channel'];_0x58196e[_0x2bab('0x18')][_0x2bab('0x80')]=_0x5d7579[_0x2bab('0x74')];_0x58196e['message'][_0x2bab('0x81')]=_0x2bab('0x77');_0x58196e['message'][_0x2bab('0x43')]=htmlToText[_0x2bab('0x75')](_0x5d7579[_0x2bab('0x18')][_0x2bab('0x43')]);respondWithRpcPromise(_0x2bab('0x76'),_0x2bab('0x76'),{'event':_0x2bab('0x82'),'message':_0x58196e['message']},client9002);return _0x5d7579;}return null;})['then'](respondWithResult(_0x3514f7,null))['catch'](handleError(_0x3514f7,null));};exports[_0x2bab('0x83')]=function(_0x21c013,_0x1621ea){var _0x5b7d37=moment()['unix']()[_0x2bab('0x84')]();var _0x23faae=path['join'](config[_0x2bab('0x85')],'server',_0x2bab('0x86'),_0x2bab('0x87'));var _0x22ab7f=path['join'](config[_0x2bab('0x85')],_0x2bab('0x88'),_0x2bab('0x86'),_0x2bab('0x50'));var _0x4495c4=util['format'](_0x2bab('0x89'),_0x5b7d37);return db[_0x2bab('0x27')][_0x2bab('0x41')]({'where':{'id':_0x21c013[_0x2bab('0x3f')]['id']},'attributes':['id',_0x2bab('0x43'),'from','to','cc',_0x2bab('0x8a'),'subject',_0x2bab('0x8b')],'include':_0x21c013[_0x2bab('0x2d')][_0x2bab('0x50')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x2bab('0x11')](handleEntityNotFound(_0x1621ea,null))['then'](function(_0x15c13e){if(_0x15c13e){var _0x4989df=_0x15c13e;var _0x1c82be={'from':_0x4989df[_0x2bab('0x8c')],'to':_0x4989df['to'],'subject':_0x4989df[_0x2bab('0x8d')],'html':htmlEntities[_0x2bab('0x8e')](_0x4989df[_0x2bab('0x43')]),'headers':{'Date':moment(_0x4989df[_0x2bab('0x8b')])[_0x2bab('0x5d')](_0x2bab('0x8f'))},'attachments':[]};if(_0x15c13e['cc']){_0x1c82be['headers']['Cc']=_0x15c13e['cc'];}if(_0x15c13e['bcc']){_0x1c82be[_0x2bab('0x90')][_0x2bab('0x91')]=_0x15c13e['bcc'];}return new BPromise(function(_0x5b80d4,_0x3e68b6){if(_0x15c13e['Attachments']){for(var _0x29ad5d=0x0;_0x29ad5d<_0x15c13e[_0x2bab('0x92')][_0x2bab('0x51')];_0x29ad5d++){var _0x58d4d3=_0x15c13e[_0x2bab('0x92')][_0x29ad5d];var _0x4c35cc=path[_0x2bab('0x93')](_0x22ab7f,_0x58d4d3[_0x2bab('0x53')]);if(fs[_0x2bab('0x94')](_0x4c35cc)){_0x1c82be[_0x2bab('0x50')][_0x2bab('0x95')]({'name':_0x58d4d3[_0x2bab('0x25')],'contentType':_0x58d4d3['type'],'data':fs[_0x2bab('0x96')](_0x4c35cc)});}}}emlformat[_0x2bab('0x97')](_0x1c82be,function(_0x5d9cb5,_0x20b236){if(_0x5d9cb5)return _0x3e68b6(_0x5d9cb5);fs[_0x2bab('0x98')](path[_0x2bab('0x93')](_0x23faae,_0x4495c4),_0x20b236);return _0x5b80d4(_0x20b236);});});}})[_0x2bab('0x11')](function(_0x5aa3dd){if(_0x5aa3dd){return _0x1621ea[_0x2bab('0x83')](path[_0x2bab('0x93')](_0x23faae,_0x4495c4),_0x4495c4,function(_0x3d8d48){if(!_0x3d8d48)fs['unlinkSync'](path[_0x2bab('0x93')](_0x23faae,_0x4495c4));});}})[_0x2bab('0x1b')](handleError(_0x1621ea,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 862612d..5e6e88d 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 _0x5020=['hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','emit'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5020,0xaa));var _0x0502=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x5020[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0x0502('0x0'));var MailMessage=require(_0x0502('0x1'))['db'][_0x0502('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0502('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0502('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4dca81){return function(_0x52b006,_0x5f232e,_0x5cdb17){MailMessageEvents[_0x0502('0x5')](_0x4dca81+':'+_0x52b006['id'],_0x52b006);MailMessageEvents[_0x0502('0x5')](_0x4dca81,_0x52b006);_0x5cdb17(null);};}for(var e in events){if(events[_0x0502('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x0502('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x47b5=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x47b5,0x178));var _0x547b=function(_0x15d1a2,_0x1fdf07){_0x15d1a2=_0x15d1a2-0x0;var _0x436cde=_0x47b5[_0x15d1a2];return _0x436cde;};'use strict';var EventEmitter=require(_0x547b('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x547b('0x1')](0x0);var events={'afterCreate':_0x547b('0x2'),'afterUpdate':_0x547b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x39b9c9){return function(_0x406f18,_0x2a29c3,_0x4eb028){MailMessageEvents[_0x547b('0x4')](_0x39b9c9+':'+_0x406f18['id'],_0x406f18);MailMessageEvents['emit'](_0x39b9c9,_0x406f18);_0x4eb028(null);};}for(var e in events){if(events[_0x547b('0x5')](e)){var event=events[e];MailMessage[_0x547b('0x6')](e,emitEvent(event));}}module[_0x547b('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 971841d..fc17f5b 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 _0xa61e=['catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt'];(function(_0x464efa,_0x130e41){var _0x54c772=function(_0x643bfd){while(--_0x643bfd){_0x464efa['push'](_0x464efa['shift']());}};_0x54c772(++_0x130e41);}(_0xa61e,0x19b));var _0xea61=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa61e[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xea61('0x0'));var util=require(_0xea61('0x1'));var logger=require(_0xea61('0x2'))(_0xea61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea61('0x4'));var htmlToText=require(_0xea61('0x5'));var fs=require('fs');var path=require(_0xea61('0x6'));var rimraf=require(_0xea61('0x7'));var config=require('../../config/environment');var attributes=require(_0xea61('0x8'));module[_0xea61('0x9')]=function(_0x23b077,_0x5779d7){return _0x23b077[_0xea61('0xa')](_0xea61('0xb'),attributes,{'tableName':_0xea61('0xc'),'paranoid':![],'indexes':[{'name':_0xea61('0xd'),'fields':[_0xea61('0xd')]},{'name':_0xea61('0xe'),'fields':[_0xea61('0xf'),'subject'],'type':_0xea61('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c7571,_0x2ad807,_0x10e2a2){if(_0x5c7571[_0xea61('0x11')]){_0x5c7571[_0xea61('0xf')]=htmlToText['fromString'](_0x5c7571[_0xea61('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x10e2a2(null,_0x2ad807);},'afterCreate':function(_0x4e7dc0,_0x514dfe,_0x2e6100){var _0x1a5e0b=_0x23b077[_0xea61('0x12')];var _0x400ea7=_0x4e7dc0[_0xea61('0x13')]({'plain':!![]});if(_0x400ea7['direction'][_0xea61('0x14')]()==='in'||_0x400ea7[_0xea61('0x15')]['toLowerCase']()===_0xea61('0x16')&&!_0x400ea7[_0xea61('0x17')]&&!_[_0xea61('0x18')](_0x400ea7[_0xea61('0x19')])){_0x1a5e0b[_0xea61('0x1a')]['findOne']({'where':{'id':_0x400ea7[_0xea61('0x1b')]}})[_0xea61('0x1c')](function(_0x2a3f0f){if(_0x2a3f0f){_0x2a3f0f[_0xea61('0x1d')]({'lastMsgAt':_0x400ea7[_0xea61('0x1e')],'lastMsgDirection':_0x400ea7[_0xea61('0x15')][_0xea61('0x14')]()});}})[_0xea61('0x1f')](function(_0x6e37ee){console[_0xea61('0x20')](_0x6e37ee);});}_0x2e6100();}},'charset':'utf8mb4','collate':_0xea61('0x21')});}; \ No newline at end of file +var _0xe412=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x197d8e,_0x3e7cdc){var _0x425081=function(_0x585fe7){while(--_0x585fe7){_0x197d8e['push'](_0x197d8e['shift']());}};_0x425081(++_0x3e7cdc);}(_0xe412,0x91));var _0x2e41=function(_0x5d1dd2,_0x26258a){_0x5d1dd2=_0x5d1dd2-0x0;var _0x45f9a8=_0xe412[_0x5d1dd2];return _0x45f9a8;};'use strict';var _=require('lodash');var util=require(_0x2e41('0x0'));var logger=require(_0x2e41('0x1'))(_0x2e41('0x2'));var moment=require('moment');var BPromise=require(_0x2e41('0x3'));var rp=require(_0x2e41('0x4'));var htmlToText=require(_0x2e41('0x5'));var fs=require('fs');var path=require(_0x2e41('0x6'));var rimraf=require(_0x2e41('0x7'));var config=require(_0x2e41('0x8'));var attributes=require(_0x2e41('0x9'));module[_0x2e41('0xa')]=function(_0x1bf0be,_0x222a5c){return _0x1bf0be[_0x2e41('0xb')](_0x2e41('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x2e41('0xd'),'fields':[_0x2e41('0xd')]},{'name':_0x2e41('0xe'),'fields':[_0x2e41('0xf'),_0x2e41('0x10')],'type':_0x2e41('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x281fd4,_0x445b3c,_0x35e700){if(_0x281fd4[_0x2e41('0x12')]){_0x281fd4[_0x2e41('0xf')]=htmlToText[_0x2e41('0x13')](_0x281fd4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x35e700(null,_0x445b3c);},'afterCreate':function(_0x44206,_0xda9340,_0x5aa360){var _0x294598=_0x1bf0be[_0x2e41('0x14')];var _0x73a013=_0x44206[_0x2e41('0x15')]({'plain':!![]});if(_0x73a013['direction'][_0x2e41('0x16')]()==='in'||_0x73a013[_0x2e41('0x17')][_0x2e41('0x16')]()===_0x2e41('0x18')&&!_0x73a013['secret']&&!_[_0x2e41('0x19')](_0x73a013[_0x2e41('0x1a')])){_0x294598[_0x2e41('0x1b')]['findOne']({'where':{'id':_0x73a013[_0x2e41('0x1c')]}})[_0x2e41('0x1d')](function(_0xb890d1){if(_0xb890d1){_0xb890d1[_0x2e41('0x1e')]({'lastMsgAt':_0x73a013[_0x2e41('0x1f')],'lastMsgDirection':_0x73a013[_0x2e41('0x17')]['toLowerCase']()});}})[_0x2e41('0x20')](function(_0x54cd98){console[_0x2e41('0x21')](_0x54cd98);});}_0x5aa360();}},'charset':_0x2e41('0x22'),'collate':_0x2e41('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0122819..b097a02 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 _0x66fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','request','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify'];(function(_0x485342,_0xe19f6f){var _0x54e30c=function(_0x5048a7){while(--_0x5048a7){_0x485342['push'](_0x485342['shift']());}};_0x54e30c(++_0xe19f6f);}(_0x66fa,0x117));var _0xa66f=function(_0x90c7cc,_0x3a99f4){_0x90c7cc=_0x90c7cc-0x0;var _0x272017=_0x66fa[_0x90c7cc];return _0x272017;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});}exports[_0xa66f('0x18')]=function(_0x408bc7){var _0x251f60=this;return new Promise(function(_0x150291,_0x2033a4){return db[_0xa66f('0x19')][_0xa66f('0x1a')](_0x408bc7[_0xa66f('0x1b')],{'raw':_0x408bc7[_0xa66f('0x1c')]?_0x408bc7[_0xa66f('0x1c')][_0xa66f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x27f570){logger[_0xa66f('0x16')](_0xa66f('0x18'),_0x408bc7);logger[_0xa66f('0x11')]('CreateMailMessage',_0x408bc7,JSON[_0xa66f('0x1e')](_0x27f570));_0x150291(_0x27f570);})[_0xa66f('0x17')](function(_0x209f4d){logger[_0xa66f('0x14')]('CreateMailMessage',_0x209f4d['message'],_0x408bc7);_0x2033a4(_0x251f60[_0xa66f('0x14')](0x1f4,_0x209f4d['message']));});});}; \ No newline at end of file +var _0x4024=['debug','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x6bc58c,_0x3935d4){var _0x42193a=function(_0x5ec624){while(--_0x5ec624){_0x6bc58c['push'](_0x6bc58c['shift']());}};_0x42193a(++_0x3935d4);}(_0x4024,0x89));var _0x4402=function(_0xd5007,_0x516c67){_0xd5007=_0xd5007-0x0;var _0x1cd3f9=_0x4024[_0xd5007];return _0x1cd3f9;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')](_0x5cb0c5[_0x4402('0x17')],{'raw':_0x5cb0c5['options']?_0x5cb0c5[_0x4402('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6f1f72){logger[_0x4402('0x12')](_0x4402('0x14'),_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x6f1f72));_0x4e0340(_0x6f1f72);})[_0x4402('0x13')](function(_0x6b1fc5){logger[_0x4402('0xf')]('CreateMailMessage',_0x6b1fc5[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459['error'](0x1f4,_0x6b1fc5[_0x4402('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index cef2359..d0fd623 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 _0xa181=['./mailMessage.events','save','remove','emit','register','length','mailMessage:'];(function(_0x28c752,_0x238454){var _0x30cd6c=function(_0x4c71be){while(--_0x4c71be){_0x28c752['push'](_0x28c752['shift']());}};_0x30cd6c(++_0x238454);}(_0xa181,0x10a));var _0x1a18=function(_0x52bb46,_0x1e8f5b){_0x52bb46=_0x52bb46-0x0;var _0x2303f6=_0xa181[_0x52bb46];return _0x2303f6;};'use strict';var MailMessageEvents=require(_0x1a18('0x0'));var events=[_0x1a18('0x1'),_0x1a18('0x2'),'update'];function createListener(_0x1bba3e,_0x373cdc){return function(_0x1053df){_0x373cdc[_0x1a18('0x3')](_0x1bba3e,_0x1053df);};}function removeListener(_0x3dd01c,_0x43c009){return function(){MailMessageEvents['removeListener'](_0x3dd01c,_0x43c009);};}exports[_0x1a18('0x4')]=function(_0x501ea2){for(var _0x246a4e=0x0,_0x33ac27=events[_0x1a18('0x5')];_0x246a4e<_0x33ac27;_0x246a4e++){var _0x436a14=events[_0x246a4e];var _0x49e0ab=createListener(_0x1a18('0x6')+_0x436a14,_0x501ea2);MailMessageEvents['on'](_0x436a14,_0x49e0ab);}}; \ No newline at end of file +var _0x0587=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x3b15d4,_0x5abd05){var _0x1e8ea4=function(_0x159c21){while(--_0x159c21){_0x3b15d4['push'](_0x3b15d4['shift']());}};_0x1e8ea4(++_0x5abd05);}(_0x0587,0x11d));var _0x7058=function(_0x466663,_0x44219b){_0x466663=_0x466663-0x0;var _0x1e4d52=_0x0587[_0x466663];return _0x1e4d52;};'use strict';var MailMessageEvents=require(_0x7058('0x0'));var events=[_0x7058('0x1'),_0x7058('0x2'),_0x7058('0x3')];function createListener(_0x321979,_0x270cb3){return function(_0x55b5a3){_0x270cb3[_0x7058('0x4')](_0x321979,_0x55b5a3);};}function removeListener(_0x14cc3d,_0x14fd16){return function(){MailMessageEvents[_0x7058('0x5')](_0x14cc3d,_0x14fd16);};}exports[_0x7058('0x6')]=function(_0x1acc16){for(var _0x2c0060=0x0,_0x273cd4=events[_0x7058('0x7')];_0x2c0060<_0x273cd4;_0x2c0060++){var _0xd07fbc=events[_0x2c0060];var _0x2e4590=createListener(_0x7058('0x8')+_0xd07fbc,_0x1acc16);MailMessageEvents['on'](_0xd07fbc,_0x2e4590);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 40f8a10..353c01d 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 _0x97b3=['/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get'];(function(_0x46b273,_0x3b016f){var _0x12445e=function(_0x220773){while(--_0x220773){_0x46b273['push'](_0x46b273['shift']());}};_0x12445e(++_0x3b016f);}(_0x97b3,0x79));var _0x397b=function(_0x38495b,_0x11e1e2){_0x38495b=_0x38495b-0x0;var _0x529cd6=_0x97b3[_0x38495b];return _0x529cd6;};'use strict';var multer=require(_0x397b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x397b('0x1'));var router=express['Router']();var fs_extra=require(_0x397b('0x2'));var auth=require(_0x397b('0x3'));var interaction=require(_0x397b('0x4'));var config=require('../../config/environment');var controller=require(_0x397b('0x5'));router['get']('/',auth[_0x397b('0x6')](),controller[_0x397b('0x7')]);router[_0x397b('0x8')](_0x397b('0x9'),auth[_0x397b('0x6')](),controller[_0x397b('0xa')]);router[_0x397b('0x8')]('/:id',auth[_0x397b('0x6')](),controller[_0x397b('0xb')]);router['get'](_0x397b('0xc'),auth['isAuthenticated'](),controller[_0x397b('0xd')]);router[_0x397b('0x8')](_0x397b('0xe'),auth[_0x397b('0x6')](),controller['getTeams']);router[_0x397b('0x8')](_0x397b('0xf'),auth[_0x397b('0x6')](),controller[_0x397b('0x10')]);router[_0x397b('0x11')]('/',auth[_0x397b('0x6')](),controller['create']);router['post']('/:id/teams',auth[_0x397b('0x6')](),controller[_0x397b('0x12')]);router[_0x397b('0x11')](_0x397b('0xf'),auth[_0x397b('0x6')](),controller[_0x397b('0x13')]);router[_0x397b('0x14')](_0x397b('0x15'),auth[_0x397b('0x6')](),controller['update']);router[_0x397b('0x16')](_0x397b('0x15'),auth[_0x397b('0x6')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x397b('0x17')]);router[_0x397b('0x16')](_0x397b('0xf'),auth[_0x397b('0x6')](),controller[_0x397b('0x18')]);module[_0x397b('0x19')]=router; \ No newline at end of file +var _0xdb38=['show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdb38,0x196));var _0x8db3=function(_0x246c88,_0x226e0d){_0x246c88=_0x246c88-0x0;var _0x41fc2f=_0xdb38[_0x246c88];return _0x41fc2f;};'use strict';var multer=require('multer');var util=require(_0x8db3('0x0'));var path=require(_0x8db3('0x1'));var timeout=require(_0x8db3('0x2'));var express=require(_0x8db3('0x3'));var router=express['Router']();var fs_extra=require(_0x8db3('0x4'));var auth=require(_0x8db3('0x5'));var interaction=require(_0x8db3('0x6'));var config=require(_0x8db3('0x7'));var controller=require(_0x8db3('0x8'));router[_0x8db3('0x9')]('/',auth[_0x8db3('0xa')](),controller['index']);router[_0x8db3('0x9')](_0x8db3('0xb'),auth['isAuthenticated'](),controller[_0x8db3('0xc')]);router[_0x8db3('0x9')](_0x8db3('0xd'),auth[_0x8db3('0xa')](),controller[_0x8db3('0xe')]);router[_0x8db3('0x9')](_0x8db3('0xf'),auth[_0x8db3('0xa')](),controller[_0x8db3('0x10')]);router[_0x8db3('0x9')]('/:id/teams',auth[_0x8db3('0xa')](),controller['getTeams']);router[_0x8db3('0x9')](_0x8db3('0x11'),auth['isAuthenticated'](),controller[_0x8db3('0x12')]);router[_0x8db3('0x13')]('/',auth[_0x8db3('0xa')](),controller[_0x8db3('0x14')]);router['post'](_0x8db3('0x15'),auth[_0x8db3('0xa')](),controller[_0x8db3('0x16')]);router['post'](_0x8db3('0x11'),auth[_0x8db3('0xa')](),controller[_0x8db3('0x17')]);router[_0x8db3('0x18')]('/:id',auth[_0x8db3('0xa')](),controller[_0x8db3('0x19')]);router['delete'](_0x8db3('0xd'),auth[_0x8db3('0xa')](),controller[_0x8db3('0x1a')]);router[_0x8db3('0x1b')](_0x8db3('0x15'),auth['isAuthenticated'](),controller[_0x8db3('0x1c')]);router[_0x8db3('0x1b')]('/:id/users',auth[_0x8db3('0xa')](),controller[_0x8db3('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4c72b48..e0fb625 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 _0x9937=['INTEGER','rrmemory','roundrobin','exports','STRING','name'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x9937,0x135));var _0x7993=function(_0x287f06,_0x151336){_0x287f06=_0x287f06-0x0;var _0x2f94a8=_0x9937[_0x287f06];return _0x2f94a8;};'use strict';var Sequelize=require('sequelize');module[_0x7993('0x0')]={'name':{'type':Sequelize[_0x7993('0x1')],'unique':_0x7993('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7993('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7993('0x4'),'beepall',_0x7993('0x5'))}}; \ No newline at end of file +var _0xe2d0=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe2d0,0x17a));var _0x0e2d=function(_0x523265,_0x47bc8d){_0x523265=_0x523265-0x0;var _0x355c98=_0xe2d0[_0x523265];return _0x355c98;};'use strict';var Sequelize=require('sequelize');module[_0x0e2d('0x0')]={'name':{'type':Sequelize[_0x0e2d('0x1')],'unique':_0x0e2d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e2d('0x1')]},'timeout':{'type':Sequelize[_0x0e2d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e2d('0x4')](_0x0e2d('0x5'),_0x0e2d('0x6'),_0x0e2d('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 04621da..089842e 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 _0x3149=['value','isEmpty','removeAgents','userMailQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','map','MailQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','describe','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact'];(function(_0x2cfd66,_0x182b28){var _0xddc62e=function(_0x3425b4){while(--_0x3425b4){_0x2cfd66['push'](_0x2cfd66['shift']());}};_0xddc62e(++_0x182b28);}(_0x3149,0x1b7));var _0x9314=function(_0xb6b7fc,_0x331a9b){_0xb6b7fc=_0xb6b7fc-0x0;var _0x1b530e=_0x3149[_0xb6b7fc];return _0x1b530e;};'use strict';var emlformat=require(_0x9314('0x0'));var rimraf=require(_0x9314('0x1'));var zipdir=require(_0x9314('0x2'));var jsonpatch=require(_0x9314('0x3'));var rp=require(_0x9314('0x4'));var moment=require(_0x9314('0x5'));var BPromise=require(_0x9314('0x6'));var Mustache=require('mustache');var util=require(_0x9314('0x7'));var path=require(_0x9314('0x8'));var sox=require(_0x9314('0x9'));var csv=require(_0x9314('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9314('0xb'));var _=require(_0x9314('0xc'));var squel=require('squel');var crypto=require(_0x9314('0xd'));var jsforce=require(_0x9314('0xe'));var deskjs=require(_0x9314('0xf'));var toCsv=require(_0x9314('0xa'));var querystring=require(_0x9314('0x10'));var Papa=require(_0x9314('0x11'));var Redis=require(_0x9314('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9314('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9314('0x14'));var logger=require('../../config/logger')(_0x9314('0x15'));var utils=require(_0x9314('0x16'));var config=require(_0x9314('0x17'));var licenseUtil=require(_0x9314('0x18'));var db=require(_0x9314('0x19'))['db'];config['redis']=_[_0x9314('0x1a')](config['redis'],{'host':_0x9314('0x1b'),'port':0x18eb});var socket=require(_0x9314('0x1c'))(new Redis(config[_0x9314('0x1d')]));require(_0x9314('0x1e'))[_0x9314('0x1f')](socket);function respondWithStatusCode(_0x198e57,_0x1eca03){_0x1eca03=_0x1eca03||0xcc;return function(_0x14473f){if(_0x14473f){return _0x198e57[_0x9314('0x20')](_0x1eca03);}return _0x198e57[_0x9314('0x21')](_0x1eca03)[_0x9314('0x22')]();};}function respondWithResult(_0x2c534c,_0x3b3cd6){_0x3b3cd6=_0x3b3cd6||0xc8;return function(_0x57648e){if(_0x57648e){return _0x2c534c['status'](_0x3b3cd6)[_0x9314('0x23')](_0x57648e);}};}function respondWithFilteredResult(_0x59edf9,_0x3efa46){return function(_0x1a3bd4){if(_0x1a3bd4){var _0x3244e8=typeof _0x3efa46[_0x9314('0x24')]===_0x9314('0x25')&&typeof _0x3efa46['limit']===_0x9314('0x25');var _0x2f7ea4=_0x1a3bd4[_0x9314('0x26')];var _0x4e6f1f=_0x3244e8?0x0:_0x3efa46[_0x9314('0x24')];var _0x10172=_0x3244e8?_0x1a3bd4[_0x9314('0x26')]:_0x3efa46['offset']+_0x3efa46[_0x9314('0x27')];var _0x33292c;if(_0x10172>=_0x2f7ea4){_0x10172=_0x2f7ea4;_0x33292c=0xc8;}else{_0x33292c=0xce;}_0x59edf9[_0x9314('0x21')](_0x33292c);return _0x59edf9[_0x9314('0x28')](_0x9314('0x29'),_0x4e6f1f+'-'+_0x10172+'/'+_0x2f7ea4)[_0x9314('0x23')](_0x1a3bd4);}return null;};}function patchUpdates(_0x273570){return function(_0x2eda37){try{jsonpatch[_0x9314('0x2a')](_0x2eda37,_0x273570,!![]);}catch(_0x3ce713){return BPromise[_0x9314('0x2b')](_0x3ce713);}return _0x2eda37[_0x9314('0x2c')]();};}function saveUpdates(_0x44ddb6,_0x462f30){return function(_0x556048){if(_0x556048){return _0x556048['update'](_0x44ddb6)[_0x9314('0x2d')](function(_0x4d8f57){return _0x4d8f57;});}return null;};}function removeEntity(_0x1142d0,_0x12d5ee){return function(_0x15d541){if(_0x15d541){return _0x15d541[_0x9314('0x2e')]()['then'](function(){var _0x52f54d=_0x15d541[_0x9314('0x2f')]({'plain':!![]});var _0x29d01a=_0x9314('0x30');return db[_0x9314('0x31')]['destroy']({'where':{'type':_0x29d01a,'resourceId':_0x52f54d['id']}})[_0x9314('0x2d')](function(){return _0x15d541;});})[_0x9314('0x2d')](function(){_0x1142d0[_0x9314('0x21')](0xcc)[_0x9314('0x22')]();});}};}function handleEntityNotFound(_0x260481,_0xd3d2e2){return function(_0x5e8735){if(!_0x5e8735){_0x260481[_0x9314('0x20')](0x194);}return _0x5e8735;};}function handleError(_0x443a7d,_0x63258a){_0x63258a=_0x63258a||0x1f4;return function(_0x56ef54){logger['error'](_0x56ef54[_0x9314('0x32')]);if(_0x56ef54['name']){delete _0x56ef54[_0x9314('0x33')];}_0x443a7d[_0x9314('0x21')](_0x63258a)[_0x9314('0x34')](_0x56ef54);};}exports['index']=function(_0x250e04,_0x11f93e){var _0x52ff11={},_0x11f696={},_0x5c4be0={'count':0x0,'rows':[]};var _0x204558=_[_0x9314('0x35')](db[_0x9314('0x36')][_0x9314('0x37')],function(_0xc301b5){return{'name':_0xc301b5['fieldName'],'type':_0xc301b5[_0x9314('0x38')][_0x9314('0x39')]};});_0x11f696['model']=_[_0x9314('0x35')](_0x204558,_0x9314('0x33'));_0x11f696[_0x9314('0x3a')]=_[_0x9314('0x3b')](_0x250e04[_0x9314('0x3a')]);_0x11f696[_0x9314('0x3c')]=_[_0x9314('0x3d')](_0x11f696[_0x9314('0x3e')],_0x11f696[_0x9314('0x3a')]);_0x52ff11[_0x9314('0x3f')]=_[_0x9314('0x3d')](_0x11f696[_0x9314('0x3e')],qs[_0x9314('0x40')](_0x250e04[_0x9314('0x3a')][_0x9314('0x40')]));_0x52ff11[_0x9314('0x3f')]=_0x52ff11[_0x9314('0x3f')][_0x9314('0x41')]?_0x52ff11['attributes']:_0x11f696[_0x9314('0x3e')];if(!_0x250e04[_0x9314('0x3a')][_0x9314('0x42')](_0x9314('0x43'))){_0x52ff11['limit']=qs[_0x9314('0x27')](_0x250e04[_0x9314('0x3a')][_0x9314('0x27')]);_0x52ff11[_0x9314('0x24')]=qs[_0x9314('0x24')](_0x250e04[_0x9314('0x3a')][_0x9314('0x24')]);}_0x52ff11[_0x9314('0x44')]=qs[_0x9314('0x45')](_0x250e04[_0x9314('0x3a')][_0x9314('0x45')]);_0x52ff11['where']=qs[_0x9314('0x3c')](_[_0x9314('0x46')](_0x250e04[_0x9314('0x3a')],_0x11f696[_0x9314('0x3c')]),_0x204558);if(_0x250e04[_0x9314('0x3a')]['filter']){_0x52ff11[_0x9314('0x47')]=_[_0x9314('0x48')](_0x52ff11[_0x9314('0x47')],{'$or':_[_0x9314('0x35')](_0x204558,function(_0x421b93){if(_0x421b93[_0x9314('0x38')]!==_0x9314('0x49')){var _0x5965aa={};_0x5965aa[_0x421b93[_0x9314('0x33')]]={'$like':'%'+_0x250e04['query'][_0x9314('0x4a')]+'%'};return _0x5965aa;}})});}_0x52ff11=_[_0x9314('0x48')]({},_0x52ff11,_0x250e04[_0x9314('0x4b')]);var _0x34fb17={'where':_0x52ff11['where']};return db[_0x9314('0x36')][_0x9314('0x26')](_0x34fb17)['then'](function(_0x45da44){_0x5c4be0[_0x9314('0x26')]=_0x45da44;if(_0x250e04[_0x9314('0x3a')][_0x9314('0x4c')]){_0x52ff11['include']=[{'all':!![]}];}return db[_0x9314('0x36')][_0x9314('0x4d')](_0x52ff11);})[_0x9314('0x2d')](function(_0x581ee8){_0x5c4be0[_0x9314('0x4e')]=_0x581ee8;return _0x5c4be0;})['then'](respondWithFilteredResult(_0x11f93e,_0x52ff11))[_0x9314('0x4f')](handleError(_0x11f93e,null));};exports['show']=function(_0x3cdf75,_0x53278b){var _0x371ef3={'raw':!![],'where':{'id':_0x3cdf75[_0x9314('0x50')]['id']}},_0x3aedb9={};_0x3aedb9[_0x9314('0x3e')]=_['keys'](db[_0x9314('0x36')][_0x9314('0x37')]);_0x3aedb9['query']=_[_0x9314('0x3b')](_0x3cdf75['query']);_0x3aedb9[_0x9314('0x3c')]=_['intersection'](_0x3aedb9['model'],_0x3aedb9['query']);_0x371ef3[_0x9314('0x3f')]=_[_0x9314('0x3d')](_0x3aedb9[_0x9314('0x3e')],qs[_0x9314('0x40')](_0x3cdf75[_0x9314('0x3a')][_0x9314('0x40')]));_0x371ef3[_0x9314('0x3f')]=_0x371ef3[_0x9314('0x3f')][_0x9314('0x41')]?_0x371ef3[_0x9314('0x3f')]:_0x3aedb9[_0x9314('0x3e')];if(_0x3cdf75[_0x9314('0x3a')][_0x9314('0x4c')]){_0x371ef3['include']=[{'all':!![]}];}_0x371ef3=_[_0x9314('0x48')]({},_0x371ef3,_0x3cdf75['options']);return db['MailQueue'][_0x9314('0x51')](_0x371ef3)['then'](handleEntityNotFound(_0x53278b,null))['then'](respondWithResult(_0x53278b,null))[_0x9314('0x4f')](handleError(_0x53278b,null));};exports['create']=function(_0x2dda14,_0x509bf6){return db['MailQueue']['create'](_0x2dda14[_0x9314('0x52')],{})[_0x9314('0x2d')](function(_0x1431ef){var _0x31c53d=_0x2dda14['user'][_0x9314('0x2f')]({'plain':!![]});if(!_0x31c53d)throw new Error(_0x9314('0x53'));if(_0x31c53d[_0x9314('0x54')]===_0x9314('0x55')){var _0x22b5fa=_0x1431ef['get']({'plain':!![]});var _0x5272c2='MailQueues';return db[_0x9314('0x56')]['find']({'where':{'name':_0x5272c2,'userProfileId':_0x31c53d[_0x9314('0x57')]},'raw':!![]})[_0x9314('0x2d')](function(_0x1640a4){if(_0x1640a4&&_0x1640a4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x22b5fa[_0x9314('0x33')],'resourceId':_0x22b5fa['id'],'type':_0x1640a4[_0x9314('0x33')],'sectionId':_0x1640a4['id']},{})['then'](function(){return _0x1431ef;});}else{return _0x1431ef;}})[_0x9314('0x4f')](function(_0x18af79){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18af79);throw _0x18af79;});}return _0x1431ef;})[_0x9314('0x2d')](respondWithResult(_0x509bf6,0xc9))[_0x9314('0x4f')](handleError(_0x509bf6,null));};exports[_0x9314('0x58')]=function(_0x26c4b3,_0x2322d7){if(_0x26c4b3[_0x9314('0x52')]['id']){delete _0x26c4b3[_0x9314('0x52')]['id'];}return db[_0x9314('0x36')][_0x9314('0x51')]({'where':{'id':_0x26c4b3[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x2322d7,null))['then'](saveUpdates(_0x26c4b3[_0x9314('0x52')],null))[_0x9314('0x2d')](respondWithResult(_0x2322d7,null))[_0x9314('0x4f')](handleError(_0x2322d7,null));};exports[_0x9314('0x2e')]=function(_0x2b0a84,_0x462b15){return db[_0x9314('0x36')][_0x9314('0x51')]({'where':{'id':_0x2b0a84[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x462b15,null))[_0x9314('0x2d')](removeEntity(_0x462b15,null))[_0x9314('0x4f')](handleError(_0x462b15,null));};exports[_0x9314('0x59')]=function(_0x101d71,_0x3f68ff){return db[_0x9314('0x36')][_0x9314('0x59')]()[_0x9314('0x2d')](respondWithResult(_0x3f68ff,null))[_0x9314('0x4f')](handleError(_0x3f68ff,null));};exports['getMembers']=function(_0xd23a24,_0x54eedc,_0x29fd71){var _0x1d5dd9={'raw':!![],'where':{}},_0x588ecb={},_0x5082b4;return db[_0x9314('0x36')][_0x9314('0x5a')]({'where':{'id':_0xd23a24[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x54eedc,null))['then'](function(_0x4a34c3){if(_0x4a34c3){_0x5082b4=_0x4a34c3[_0x9314('0x2f')]({'plain':!![]});_0x588ecb[_0x9314('0x3e')]=_[_0x9314('0x3b')](db[_0x9314('0x5b')]['rawAttributes']);_0x588ecb['query']=_[_0x9314('0x3b')](_0xd23a24[_0x9314('0x3a')]);_0x588ecb[_0x9314('0x3c')]=_[_0x9314('0x3d')](_0x588ecb[_0x9314('0x3e')],_0x588ecb[_0x9314('0x3a')]);_0x1d5dd9[_0x9314('0x3f')]=_[_0x9314('0x3d')](_0x588ecb[_0x9314('0x3e')],qs[_0x9314('0x40')](_0xd23a24[_0x9314('0x3a')][_0x9314('0x40')]));_0x1d5dd9['attributes']=_0x1d5dd9['attributes'][_0x9314('0x41')]?_0x1d5dd9[_0x9314('0x3f')]:_0x588ecb[_0x9314('0x3e')];if(!_0xd23a24[_0x9314('0x3a')][_0x9314('0x42')](_0x9314('0x43'))){_0x1d5dd9[_0x9314('0x27')]=qs[_0x9314('0x27')](_0xd23a24[_0x9314('0x3a')][_0x9314('0x27')]);_0x1d5dd9[_0x9314('0x24')]=qs[_0x9314('0x24')](_0xd23a24[_0x9314('0x3a')][_0x9314('0x24')]);}_0x1d5dd9[_0x9314('0x44')]=qs[_0x9314('0x45')](_0xd23a24['query'][_0x9314('0x45')]);_0x1d5dd9[_0x9314('0x47')]=qs[_0x9314('0x3c')](_[_0x9314('0x46')](_0xd23a24[_0x9314('0x3a')],_0x588ecb[_0x9314('0x3c')]));_0x1d5dd9[_0x9314('0x47')][_0x9314('0x5c')]=_0x4a34c3['id'];if(_0xd23a24['query'][_0x9314('0x4a')]){_0x1d5dd9['where']=_[_0x9314('0x48')](_0x1d5dd9['where'],{'$or':_[_0x9314('0x35')](_0x1d5dd9['attributes'],function(_0x3eaaed){var _0x3a4d67={};_0x3a4d67[_0x3eaaed]={'$like':'%'+_0xd23a24['query'][_0x9314('0x4a')]+'%'};return _0x3a4d67;})});}_0x1d5dd9=_[_0x9314('0x48')]({},_0x1d5dd9,_0xd23a24[_0x9314('0x4b')]);return db[_0x9314('0x5b')]['findAll'](_0x1d5dd9);}})[_0x9314('0x2d')](function(_0x3b79a7){if(_0x3b79a7){return db[_0x9314('0x5d')][_0x9314('0x5e')]({'where':{'id':_[_0x9314('0x35')](_0x3b79a7,_0x9314('0x5f')),'role':_0x9314('0x60')},'attributes':['id','name',_0x9314('0x61'),_0x9314('0x62'),'createdAt']});}})[_0x9314('0x2d')](function(_0x58d657){if(_0x58d657){return{'count':_0x58d657['count'],'rows':_[_0x9314('0x35')](_0x58d657[_0x9314('0x4e')],function(_0x19c158){return{'membername':_0x19c158['name'],'UserId':_0x19c158['id'],'queue_name':_0x5082b4[_0x9314('0x33')],'MailQueueId':_0x5082b4['id'],'interface':util['format'](_0x9314('0x63'),_0x9314('0x64'),_0x19c158[_0x9314('0x33')]),'penalty':0x0,'paused':_0x19c158[_0x9314('0x61')],'createdAt':_0x19c158[_0x9314('0x65')],'updatedAt':_0x19c158['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9314('0x2d')](respondWithFilteredResult(_0x54eedc,_0x1d5dd9))[_0x9314('0x4f')](handleError(_0x54eedc,null));};exports[_0x9314('0x66')]=function(_0x2a01e9,_0xa5c527,_0x6799fb){var _0x2f8f59={};var _0x2b44f8={};var _0x53aaed;var _0x2bb15a;return db['MailQueue']['findOne']({'where':{'id':_0x2a01e9[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0xa5c527,null))[_0x9314('0x2d')](function(_0xeddd83){if(_0xeddd83){_0x53aaed=_0xeddd83;_0x2b44f8['model']=_[_0x9314('0x3b')](db[_0x9314('0x67')][_0x9314('0x37')]);_0x2b44f8[_0x9314('0x3a')]=_[_0x9314('0x3b')](_0x2a01e9[_0x9314('0x3a')]);_0x2b44f8[_0x9314('0x3c')]=_[_0x9314('0x3d')](_0x2b44f8[_0x9314('0x3e')],_0x2b44f8[_0x9314('0x3a')]);_0x2f8f59['attributes']=_[_0x9314('0x3d')](_0x2b44f8[_0x9314('0x3e')],qs[_0x9314('0x40')](_0x2a01e9[_0x9314('0x3a')][_0x9314('0x40')]));_0x2f8f59[_0x9314('0x3f')]=_0x2f8f59[_0x9314('0x3f')][_0x9314('0x41')]?_0x2f8f59[_0x9314('0x3f')]:_0x2b44f8[_0x9314('0x3e')];_0x2f8f59[_0x9314('0x44')]=qs['sort'](_0x2a01e9['query']['sort']);_0x2f8f59[_0x9314('0x47')]=qs['filters'](_[_0x9314('0x46')](_0x2a01e9[_0x9314('0x3a')],_0x2b44f8[_0x9314('0x3c')]));if(_0x2a01e9[_0x9314('0x3a')][_0x9314('0x4a')]){_0x2f8f59[_0x9314('0x47')]=_[_0x9314('0x48')](_0x2f8f59['where'],{'$or':_[_0x9314('0x35')](_0x2f8f59[_0x9314('0x3f')],function(_0x3a569f){var _0x5ce634={};_0x5ce634[_0x3a569f]={'$like':'%'+_0x2a01e9[_0x9314('0x3a')][_0x9314('0x4a')]+'%'};return _0x5ce634;})});}_0x2f8f59=_[_0x9314('0x48')]({},_0x2f8f59,_0x2a01e9[_0x9314('0x4b')]);return _0x53aaed[_0x9314('0x66')](_0x2f8f59);}})[_0x9314('0x2d')](function(_0xbdb367){if(_0xbdb367){_0x2bb15a=_0xbdb367[_0x9314('0x41')];if(!_0x2a01e9[_0x9314('0x3a')][_0x9314('0x42')]('nolimit')){_0x2f8f59['limit']=qs[_0x9314('0x27')](_0x2a01e9['query'][_0x9314('0x27')]);_0x2f8f59[_0x9314('0x24')]=qs[_0x9314('0x24')](_0x2a01e9['query'][_0x9314('0x24')]);}return _0x53aaed[_0x9314('0x66')](_0x2f8f59);}})[_0x9314('0x2d')](function(_0x1e85f9){if(_0x1e85f9){return _0x1e85f9?{'count':_0x2bb15a,'rows':_0x1e85f9}:null;}})['then'](respondWithResult(_0xa5c527,null))[_0x9314('0x4f')](handleError(_0xa5c527,null));};exports['addTeams']=function(_0x59fd42,_0x4737a4,_0x1cfdfd){var _0x505293=_0x59fd42[_0x9314('0x52')][_0x9314('0x68')];return db[_0x9314('0x67')][_0x9314('0x4d')]({'where':{'id':_0x505293},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9314('0x69'),'attributes':['id',_0x9314('0x33'),'online',_0x9314('0x6a'),_0x9314('0x6b')],'raw':!![]}]})[_0x9314('0x2d')](function(_0xa7245c){if(_0xa7245c){var _0x58ae65=_[_0x9314('0x6c')](_0xa7245c,function(_0x120a0a){var _0x346b78=_0x120a0a['get']({'plain':!![]});return _0x346b78[_0x9314('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x59fd42[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](function(_0x98d9a5){return db[_0x9314('0x6d')][_0x9314('0x6e')](function(_0x34cfe7){return _0x98d9a5[_0x9314('0x6f')](_0x505293,{'transaction':_0x34cfe7})[_0x9314('0x2d')](function(){return BPromise[_0x9314('0x70')](_0x58ae65,function(_0x516402){return db[_0x9314('0x5b')][_0x9314('0x71')]({'where':{'UserId':_0x516402['id'],'MailQueueId':_0x59fd42['params']['id']},'transaction':_0x34cfe7});});})[_0x9314('0x2d')](function(){_0x58ae65[_0x9314('0x72')](function(_0x4e7faf){socket[_0x9314('0x73')](_0x9314('0x74'),{'UserId':_0x4e7faf['id'],'MailQueueId':_0x98d9a5['id']});});});});});}})[_0x9314('0x2d')](respondWithStatusCode(_0x4737a4,null))[_0x9314('0x4f')](handleError(_0x4737a4,null));};exports[_0x9314('0x75')]=function(_0x3fff67,_0x4de8e8,_0x95ce90){return db[_0x9314('0x67')][_0x9314('0x4d')]({'where':{'id':_0x3fff67[_0x9314('0x3a')][_0x9314('0x68')]},'attributes':['id'],'include':[{'model':db[_0x9314('0x5d')],'as':_0x9314('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4de8e8,null))[_0x9314('0x2d')](function(_0x4c7ab3){var _0x24c37d=_[_0x9314('0x35')](_0x4c7ab3,'id');var _0x365b1a=[];var _0x14760c=[];var _0x5b02c9=squel[_0x9314('0x76')]();_0x5b02c9[_0x9314('0x77')](_0x9314('0x78'))[_0x9314('0x79')](_0x9314('0x7a'),'tq')[_0x9314('0x7b')](_0x9314('0x7c'),'ut',_0x9314('0x7d'))[_0x9314('0x47')](_0x9314('0x7e'),_0x3fff67['params']['id']);for(var _0x5e3716=0x0;_0x5e3716<_0x4c7ab3[_0x9314('0x41')];_0x5e3716+=0x1){let _0x1c5444=_0x4c7ab3[_0x5e3716];for(var _0x302daf=0x0;_0x302daf<_0x1c5444[_0x9314('0x69')][_0x9314('0x41')];_0x302daf+=0x1){let _0x40c65d=_0x1c5444[_0x9314('0x69')][_0x302daf];var _0x3fff05=_0x5b02c9['clone']();_0x3fff05['where'](_0x9314('0x7f'),_0x40c65d['id']);_0x14760c[_0x9314('0x80')](db[_0x9314('0x6d')][_0x9314('0x3a')](_0x3fff05[_0x9314('0x81')](),{'type':db[_0x9314('0x6d')][_0x9314('0x82')][_0x9314('0x83')]})[_0x9314('0x2d')](function(_0x560288){if(_0x560288[_0x9314('0x41')]===0x1){return _0x40c65d['id'];}else{var _0x512fc2=_[_0x9314('0x84')](_['map'](_0x560288,_0x9314('0x85')),function(_0x1a279b){return _[_0x9314('0x86')](_0x24c37d,_0x1a279b);});if(_0x512fc2){return _0x40c65d['id'];}}}));}}return BPromise[_0x9314('0x87')](_0x14760c)[_0x9314('0x2d')](function(_0x534609){_0x365b1a=_(_0x365b1a)['union'](_0x534609)[_0x9314('0x88')]()[_0x9314('0x89')]();return db[_0x9314('0x36')][_0x9314('0x51')]({'where':{'id':_0x3fff67[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](function(_0x473518){return db[_0x9314('0x6d')][_0x9314('0x6e')](function(_0x6ee48e){return _0x473518['removeTeams'](_0x3fff67['query'][_0x9314('0x68')],{'transaction':_0x6ee48e})[_0x9314('0x2d')](function(){if(!_[_0x9314('0x8a')](_0x365b1a)){return _0x473518[_0x9314('0x8b')](_0x365b1a,{'transaction':_0x6ee48e});}})[_0x9314('0x2d')](function(){_0x365b1a[_0x9314('0x72')](function(_0x52b6a3){socket[_0x9314('0x73')](_0x9314('0x8c'),{'UserId':_0x52b6a3,'MailQueueId':_0x473518['id']});});});});});});})[_0x9314('0x2d')](respondWithStatusCode(_0x4de8e8,null))[_0x9314('0x4f')](handleError(_0x4de8e8,null));};exports[_0x9314('0x8d')]=function(_0x1102b,_0x45fc90,_0x70671a){return db[_0x9314('0x36')][_0x9314('0x51')]({'where':{'id':_0x1102b[_0x9314('0x50')]['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x45fc90,null))[_0x9314('0x2d')](function(_0x3030be){if(_0x3030be){return _0x3030be['addAgents'](_0x1102b['body'][_0x9314('0x68')],_['omit'](_0x1102b['body'],[_0x9314('0x68'),'id'])||{})['spread'](function(_0x3ba773){for(var _0x3c5acd=0x0;_0x3c5acd<_0x1102b[_0x9314('0x52')][_0x9314('0x68')]['length'];_0x3c5acd+=0x1){socket[_0x9314('0x73')](_0x9314('0x74'),{'UserId':Number(_0x1102b[_0x9314('0x52')][_0x9314('0x68')][_0x3c5acd]),'MailQueueId':Number(_0x1102b[_0x9314('0x50')]['id'])});}return _0x3ba773;});}})[_0x9314('0x2d')](respondWithResult(_0x45fc90,null))['catch'](handleError(_0x45fc90,null));};exports['removeAgents']=function(_0x4609a0,_0x19503b,_0x3c19cb){return db['MailQueue'][_0x9314('0x51')]({'where':{'id':_0x4609a0['params']['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x19503b,null))[_0x9314('0x2d')](function(_0x247f41){if(_0x247f41){return _0x247f41[_0x9314('0x8b')](_0x4609a0[_0x9314('0x3a')][_0x9314('0x68')])[_0x9314('0x2d')](function(){if(_[_0x9314('0x8e')](_0x4609a0[_0x9314('0x3a')]['ids'])){for(var _0x12fed4=0x0;_0x12fed4<_0x4609a0[_0x9314('0x3a')][_0x9314('0x68')][_0x9314('0x41')];_0x12fed4+=0x1){socket['emit'](_0x9314('0x8c'),{'UserId':Number(_0x4609a0[_0x9314('0x3a')]['ids'][_0x12fed4]),'MailQueueId':Number(_0x4609a0[_0x9314('0x50')]['id'])});}}else{socket[_0x9314('0x73')](_0x9314('0x8c'),{'UserId':Number(_0x4609a0[_0x9314('0x3a')]['ids']),'MailQueueId':Number(_0x4609a0[_0x9314('0x50')]['id'])});}});}})[_0x9314('0x2d')](respondWithStatusCode(_0x19503b,null))[_0x9314('0x4f')](handleError(_0x19503b,null));};exports['getAgents']=function(_0x4dadbf,_0x78d221,_0x33c2f7){var _0x5c7491={};var _0x3f3bf4={};var _0x1361cf;var _0x5b26d2;return db[_0x9314('0x36')][_0x9314('0x5a')]({'where':{'id':_0x4dadbf['params']['id']}})[_0x9314('0x2d')](handleEntityNotFound(_0x78d221,null))[_0x9314('0x2d')](function(_0x16c9d4){if(_0x16c9d4){_0x1361cf=_0x16c9d4;_0x3f3bf4[_0x9314('0x3e')]=_[_0x9314('0x3b')](db[_0x9314('0x5d')][_0x9314('0x37')]);_0x3f3bf4[_0x9314('0x3a')]=_['keys'](_0x4dadbf[_0x9314('0x3a')]);_0x3f3bf4[_0x9314('0x3c')]=_[_0x9314('0x3d')](_0x3f3bf4[_0x9314('0x3e')],_0x3f3bf4[_0x9314('0x3a')]);_0x5c7491[_0x9314('0x3f')]=_[_0x9314('0x3d')](_0x3f3bf4[_0x9314('0x3e')],qs['fields'](_0x4dadbf['query'][_0x9314('0x40')]));_0x5c7491[_0x9314('0x3f')]=_0x5c7491[_0x9314('0x3f')][_0x9314('0x41')]?_0x5c7491[_0x9314('0x3f')]:_0x3f3bf4[_0x9314('0x3e')];_0x5c7491[_0x9314('0x44')]=qs[_0x9314('0x45')](_0x4dadbf[_0x9314('0x3a')]['sort']);_0x5c7491[_0x9314('0x47')]=qs[_0x9314('0x3c')](_[_0x9314('0x46')](_0x4dadbf[_0x9314('0x3a')],_0x3f3bf4[_0x9314('0x3c')]));if(_0x4dadbf[_0x9314('0x3a')][_0x9314('0x4a')]){_0x5c7491[_0x9314('0x47')]=_[_0x9314('0x48')](_0x5c7491['where'],{'$or':_[_0x9314('0x35')](_0x5c7491['attributes'],function(_0x56b957){var _0x11ab08={};_0x11ab08[_0x56b957]={'$like':'%'+_0x4dadbf[_0x9314('0x3a')][_0x9314('0x4a')]+'%'};return _0x11ab08;})});}_0x5c7491=_[_0x9314('0x48')]({},_0x5c7491,_0x4dadbf[_0x9314('0x4b')]);return _0x1361cf[_0x9314('0x8f')](_0x5c7491);}})[_0x9314('0x2d')](function(_0xc32630){if(_0xc32630){_0x5b26d2=_0xc32630[_0x9314('0x41')];if(!_0x4dadbf['query'][_0x9314('0x42')](_0x9314('0x43'))){_0x5c7491['limit']=qs[_0x9314('0x27')](_0x4dadbf[_0x9314('0x3a')][_0x9314('0x27')]);_0x5c7491[_0x9314('0x24')]=qs[_0x9314('0x24')](_0x4dadbf[_0x9314('0x3a')][_0x9314('0x24')]);}return _0x1361cf[_0x9314('0x8f')](_0x5c7491);}})['then'](function(_0x5c4fcf){if(_0x5c4fcf){return _0x5c4fcf?{'count':_0x5b26d2,'rows':_0x5c4fcf}:null;}})[_0x9314('0x2d')](respondWithResult(_0x78d221,null))[_0x9314('0x4f')](handleError(_0x78d221,null));}; \ No newline at end of file +var _0xeaa7=['lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','end','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','fields','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','describe','getMembers','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','getTeams','ids','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','Agents','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','clone','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2330f0,_0x216008){var _0x47e37c=function(_0x1ee6dd){while(--_0x1ee6dd){_0x2330f0['push'](_0x2330f0['shift']());}};_0x47e37c(++_0x216008);}(_0xeaa7,0x113));var _0x7eaa=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xeaa7[_0x581af1];return _0x54c22e;};'use strict';var emlformat=require(_0x7eaa('0x0'));var rimraf=require(_0x7eaa('0x1'));var zipdir=require(_0x7eaa('0x2'));var jsonpatch=require(_0x7eaa('0x3'));var rp=require(_0x7eaa('0x4'));var moment=require(_0x7eaa('0x5'));var BPromise=require(_0x7eaa('0x6'));var Mustache=require(_0x7eaa('0x7'));var util=require(_0x7eaa('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7eaa('0x9'));var squel=require(_0x7eaa('0xa'));var crypto=require('crypto');var jsforce=require(_0x7eaa('0xb'));var deskjs=require(_0x7eaa('0xc'));var toCsv=require(_0x7eaa('0xd'));var querystring=require('querystring');var Papa=require(_0x7eaa('0xe'));var Redis=require(_0x7eaa('0xf'));var authService=require(_0x7eaa('0x10'));var qs=require(_0x7eaa('0x11'));var as=require(_0x7eaa('0x12'));var hardwareService=require(_0x7eaa('0x13'));var logger=require(_0x7eaa('0x14'))(_0x7eaa('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7eaa('0x16'))['db'];config[_0x7eaa('0x17')]=_[_0x7eaa('0x18')](config[_0x7eaa('0x17')],{'host':_0x7eaa('0x19'),'port':0x18eb});var socket=require(_0x7eaa('0x1a'))(new Redis(config[_0x7eaa('0x17')]));require(_0x7eaa('0x1b'))[_0x7eaa('0x1c')](socket);function respondWithStatusCode(_0x28851e,_0x18bc36){_0x18bc36=_0x18bc36||0xcc;return function(_0x13b542){if(_0x13b542){return _0x28851e['sendStatus'](_0x18bc36);}return _0x28851e['status'](_0x18bc36)[_0x7eaa('0x1d')]();};}function respondWithResult(_0x1ca501,_0x2b4355){_0x2b4355=_0x2b4355||0xc8;return function(_0x6e78bc){if(_0x6e78bc){return _0x1ca501['status'](_0x2b4355)['json'](_0x6e78bc);}};}function respondWithFilteredResult(_0x5e53a3,_0x1feec4){return function(_0x4e5dfd){if(_0x4e5dfd){var _0x489cfa=typeof _0x1feec4[_0x7eaa('0x1e')]===_0x7eaa('0x1f')&&typeof _0x1feec4[_0x7eaa('0x20')]===_0x7eaa('0x1f');var _0x7bc59b=_0x4e5dfd[_0x7eaa('0x21')];var _0x3c4944=_0x489cfa?0x0:_0x1feec4[_0x7eaa('0x1e')];var _0x48dea5=_0x489cfa?_0x4e5dfd[_0x7eaa('0x21')]:_0x1feec4[_0x7eaa('0x1e')]+_0x1feec4[_0x7eaa('0x20')];var _0x1f3f33;if(_0x48dea5>=_0x7bc59b){_0x48dea5=_0x7bc59b;_0x1f3f33=0xc8;}else{_0x1f3f33=0xce;}_0x5e53a3[_0x7eaa('0x22')](_0x1f3f33);return _0x5e53a3[_0x7eaa('0x23')](_0x7eaa('0x24'),_0x3c4944+'-'+_0x48dea5+'/'+_0x7bc59b)['json'](_0x4e5dfd);}return null;};}function patchUpdates(_0x2e8171){return function(_0x2148ba){try{jsonpatch[_0x7eaa('0x25')](_0x2148ba,_0x2e8171,!![]);}catch(_0x5e2588){return BPromise['reject'](_0x5e2588);}return _0x2148ba[_0x7eaa('0x26')]();};}function saveUpdates(_0xe7b51f,_0x2dc6c2){return function(_0x4ee464){if(_0x4ee464){return _0x4ee464[_0x7eaa('0x27')](_0xe7b51f)['then'](function(_0x288871){return _0x288871;});}return null;};}function removeEntity(_0x409b6e,_0x2a5ee4){return function(_0x49017e){if(_0x49017e){return _0x49017e['destroy']()[_0x7eaa('0x28')](function(){var _0x21eabc=_0x49017e[_0x7eaa('0x29')]({'plain':!![]});var _0x44ac69='MailQueues';return db[_0x7eaa('0x2a')][_0x7eaa('0x2b')]({'where':{'type':_0x44ac69,'resourceId':_0x21eabc['id']}})['then'](function(){return _0x49017e;});})[_0x7eaa('0x28')](function(){_0x409b6e[_0x7eaa('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267492,_0x5051a0){return function(_0x5ded77){if(!_0x5ded77){_0x267492[_0x7eaa('0x2c')](0x194);}return _0x5ded77;};}function handleError(_0x249956,_0x52074b){_0x52074b=_0x52074b||0x1f4;return function(_0x3f312d){logger[_0x7eaa('0x2d')](_0x3f312d[_0x7eaa('0x2e')]);if(_0x3f312d['name']){delete _0x3f312d[_0x7eaa('0x2f')];}_0x249956[_0x7eaa('0x22')](_0x52074b)[_0x7eaa('0x30')](_0x3f312d);};}exports[_0x7eaa('0x31')]=function(_0x3f339a,_0x5eb312){var _0x4665a8={},_0x1fb493={},_0x1c6eae={'count':0x0,'rows':[]};var _0x834aa9=_[_0x7eaa('0x32')](db[_0x7eaa('0x33')][_0x7eaa('0x34')],function(_0x4fb79d){return{'name':_0x4fb79d[_0x7eaa('0x35')],'type':_0x4fb79d['type'][_0x7eaa('0x36')]};});_0x1fb493[_0x7eaa('0x37')]=_[_0x7eaa('0x32')](_0x834aa9,_0x7eaa('0x2f'));_0x1fb493[_0x7eaa('0x38')]=_[_0x7eaa('0x39')](_0x3f339a[_0x7eaa('0x38')]);_0x1fb493[_0x7eaa('0x3a')]=_[_0x7eaa('0x3b')](_0x1fb493[_0x7eaa('0x37')],_0x1fb493[_0x7eaa('0x38')]);_0x4665a8['attributes']=_[_0x7eaa('0x3b')](_0x1fb493[_0x7eaa('0x37')],qs['fields'](_0x3f339a[_0x7eaa('0x38')]['fields']));_0x4665a8[_0x7eaa('0x3c')]=_0x4665a8['attributes']['length']?_0x4665a8[_0x7eaa('0x3c')]:_0x1fb493[_0x7eaa('0x37')];if(!_0x3f339a[_0x7eaa('0x38')][_0x7eaa('0x3d')](_0x7eaa('0x3e'))){_0x4665a8[_0x7eaa('0x20')]=qs[_0x7eaa('0x20')](_0x3f339a[_0x7eaa('0x38')][_0x7eaa('0x20')]);_0x4665a8[_0x7eaa('0x1e')]=qs['offset'](_0x3f339a[_0x7eaa('0x38')][_0x7eaa('0x1e')]);}_0x4665a8[_0x7eaa('0x3f')]=qs[_0x7eaa('0x40')](_0x3f339a[_0x7eaa('0x38')]['sort']);_0x4665a8[_0x7eaa('0x41')]=qs[_0x7eaa('0x3a')](_[_0x7eaa('0x42')](_0x3f339a['query'],_0x1fb493[_0x7eaa('0x3a')]),_0x834aa9);if(_0x3f339a['query']['filter']){_0x4665a8[_0x7eaa('0x41')]=_['merge'](_0x4665a8[_0x7eaa('0x41')],{'$or':_[_0x7eaa('0x32')](_0x834aa9,function(_0x666afe){if(_0x666afe[_0x7eaa('0x43')]!==_0x7eaa('0x44')){var _0x21d838={};_0x21d838[_0x666afe[_0x7eaa('0x2f')]]={'$like':'%'+_0x3f339a[_0x7eaa('0x38')][_0x7eaa('0x45')]+'%'};return _0x21d838;}})});}_0x4665a8=_[_0x7eaa('0x46')]({},_0x4665a8,_0x3f339a['options']);var _0x4349de={'where':_0x4665a8[_0x7eaa('0x41')]};return db[_0x7eaa('0x33')][_0x7eaa('0x21')](_0x4349de)[_0x7eaa('0x28')](function(_0x377ecc){_0x1c6eae['count']=_0x377ecc;if(_0x3f339a[_0x7eaa('0x38')][_0x7eaa('0x47')]){_0x4665a8[_0x7eaa('0x48')]=[{'all':!![]}];}return db[_0x7eaa('0x33')]['findAll'](_0x4665a8);})[_0x7eaa('0x28')](function(_0x2219bd){_0x1c6eae[_0x7eaa('0x49')]=_0x2219bd;return _0x1c6eae;})['then'](respondWithFilteredResult(_0x5eb312,_0x4665a8))[_0x7eaa('0x4a')](handleError(_0x5eb312,null));};exports[_0x7eaa('0x4b')]=function(_0xb117b7,_0xe52297){var _0xa29370={'raw':!![],'where':{'id':_0xb117b7['params']['id']}},_0x1ad0a1={};_0x1ad0a1[_0x7eaa('0x37')]=_[_0x7eaa('0x39')](db[_0x7eaa('0x33')]['rawAttributes']);_0x1ad0a1['query']=_['keys'](_0xb117b7[_0x7eaa('0x38')]);_0x1ad0a1['filters']=_[_0x7eaa('0x3b')](_0x1ad0a1[_0x7eaa('0x37')],_0x1ad0a1[_0x7eaa('0x38')]);_0xa29370[_0x7eaa('0x3c')]=_['intersection'](_0x1ad0a1[_0x7eaa('0x37')],qs[_0x7eaa('0x4c')](_0xb117b7[_0x7eaa('0x38')][_0x7eaa('0x4c')]));_0xa29370[_0x7eaa('0x3c')]=_0xa29370[_0x7eaa('0x3c')][_0x7eaa('0x4d')]?_0xa29370['attributes']:_0x1ad0a1[_0x7eaa('0x37')];if(_0xb117b7['query'][_0x7eaa('0x47')]){_0xa29370[_0x7eaa('0x48')]=[{'all':!![]}];}_0xa29370=_[_0x7eaa('0x46')]({},_0xa29370,_0xb117b7[_0x7eaa('0x4e')]);return db[_0x7eaa('0x33')]['find'](_0xa29370)['then'](handleEntityNotFound(_0xe52297,null))['then'](respondWithResult(_0xe52297,null))['catch'](handleError(_0xe52297,null));};exports[_0x7eaa('0x4f')]=function(_0x224fb5,_0x5aa1f3){return db[_0x7eaa('0x33')][_0x7eaa('0x4f')](_0x224fb5[_0x7eaa('0x50')],{})['then'](function(_0x47d1fc){var _0x47840b=_0x224fb5[_0x7eaa('0x51')][_0x7eaa('0x29')]({'plain':!![]});if(!_0x47840b)throw new Error(_0x7eaa('0x52'));if(_0x47840b[_0x7eaa('0x53')]==='user'){var _0x5adaae=_0x47d1fc[_0x7eaa('0x29')]({'plain':!![]});var _0x289910='MailQueues';return db[_0x7eaa('0x54')][_0x7eaa('0x55')]({'where':{'name':_0x289910,'userProfileId':_0x47840b[_0x7eaa('0x56')]},'raw':!![]})[_0x7eaa('0x28')](function(_0x246427){if(_0x246427&&_0x246427[_0x7eaa('0x57')]===0x0){return db[_0x7eaa('0x2a')]['create']({'name':_0x5adaae['name'],'resourceId':_0x5adaae['id'],'type':_0x246427[_0x7eaa('0x2f')],'sectionId':_0x246427['id']},{})[_0x7eaa('0x28')](function(){return _0x47d1fc;});}else{return _0x47d1fc;}})[_0x7eaa('0x4a')](function(_0x3011bf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3011bf);throw _0x3011bf;});}return _0x47d1fc;})[_0x7eaa('0x28')](respondWithResult(_0x5aa1f3,0xc9))[_0x7eaa('0x4a')](handleError(_0x5aa1f3,null));};exports[_0x7eaa('0x27')]=function(_0x59a134,_0x9b2c5b){if(_0x59a134[_0x7eaa('0x50')]['id']){delete _0x59a134['body']['id'];}return db[_0x7eaa('0x33')][_0x7eaa('0x55')]({'where':{'id':_0x59a134[_0x7eaa('0x58')]['id']}})['then'](handleEntityNotFound(_0x9b2c5b,null))[_0x7eaa('0x28')](saveUpdates(_0x59a134['body'],null))[_0x7eaa('0x28')](respondWithResult(_0x9b2c5b,null))[_0x7eaa('0x4a')](handleError(_0x9b2c5b,null));};exports[_0x7eaa('0x2b')]=function(_0x2ee04c,_0x4e6120){return db[_0x7eaa('0x33')][_0x7eaa('0x55')]({'where':{'id':_0x2ee04c[_0x7eaa('0x58')]['id']}})[_0x7eaa('0x28')](handleEntityNotFound(_0x4e6120,null))[_0x7eaa('0x28')](removeEntity(_0x4e6120,null))['catch'](handleError(_0x4e6120,null));};exports['describe']=function(_0x46e2ab,_0x40190d){return db[_0x7eaa('0x33')][_0x7eaa('0x59')]()['then'](respondWithResult(_0x40190d,null))[_0x7eaa('0x4a')](handleError(_0x40190d,null));};exports[_0x7eaa('0x5a')]=function(_0x53c567,_0x377459,_0x153cfc){var _0x9de69a={'raw':!![],'where':{}},_0x3cb1a2={},_0x2da78a;return db['MailQueue']['findOne']({'where':{'id':_0x53c567[_0x7eaa('0x58')]['id']}})[_0x7eaa('0x28')](handleEntityNotFound(_0x377459,null))[_0x7eaa('0x28')](function(_0x450f05){if(_0x450f05){_0x2da78a=_0x450f05[_0x7eaa('0x29')]({'plain':!![]});_0x3cb1a2['model']=_['keys'](db['UserMailQueue']['rawAttributes']);_0x3cb1a2[_0x7eaa('0x38')]=_[_0x7eaa('0x39')](_0x53c567[_0x7eaa('0x38')]);_0x3cb1a2[_0x7eaa('0x3a')]=_[_0x7eaa('0x3b')](_0x3cb1a2[_0x7eaa('0x37')],_0x3cb1a2[_0x7eaa('0x38')]);_0x9de69a['attributes']=_[_0x7eaa('0x3b')](_0x3cb1a2['model'],qs['fields'](_0x53c567[_0x7eaa('0x38')][_0x7eaa('0x4c')]));_0x9de69a[_0x7eaa('0x3c')]=_0x9de69a[_0x7eaa('0x3c')][_0x7eaa('0x4d')]?_0x9de69a['attributes']:_0x3cb1a2[_0x7eaa('0x37')];if(!_0x53c567[_0x7eaa('0x38')]['hasOwnProperty'](_0x7eaa('0x3e'))){_0x9de69a['limit']=qs['limit'](_0x53c567['query'][_0x7eaa('0x20')]);_0x9de69a['offset']=qs['offset'](_0x53c567[_0x7eaa('0x38')][_0x7eaa('0x1e')]);}_0x9de69a[_0x7eaa('0x3f')]=qs[_0x7eaa('0x40')](_0x53c567['query'][_0x7eaa('0x40')]);_0x9de69a[_0x7eaa('0x41')]=qs[_0x7eaa('0x3a')](_[_0x7eaa('0x42')](_0x53c567[_0x7eaa('0x38')],_0x3cb1a2[_0x7eaa('0x3a')]));_0x9de69a[_0x7eaa('0x41')][_0x7eaa('0x5b')]=_0x450f05['id'];if(_0x53c567['query'][_0x7eaa('0x45')]){_0x9de69a[_0x7eaa('0x41')]=_['merge'](_0x9de69a[_0x7eaa('0x41')],{'$or':_[_0x7eaa('0x32')](_0x9de69a['attributes'],function(_0x355854){var _0x30a730={};_0x30a730[_0x355854]={'$like':'%'+_0x53c567[_0x7eaa('0x38')][_0x7eaa('0x45')]+'%'};return _0x30a730;})});}_0x9de69a=_[_0x7eaa('0x46')]({},_0x9de69a,_0x53c567[_0x7eaa('0x4e')]);return db[_0x7eaa('0x5c')][_0x7eaa('0x5d')](_0x9de69a);}})['then'](function(_0x22b26f){if(_0x22b26f){return db[_0x7eaa('0x5e')][_0x7eaa('0x5f')]({'where':{'id':_[_0x7eaa('0x32')](_0x22b26f,_0x7eaa('0x60')),'role':_0x7eaa('0x61')},'attributes':['id','name',_0x7eaa('0x62'),_0x7eaa('0x63'),_0x7eaa('0x64')]});}})[_0x7eaa('0x28')](function(_0x506587){if(_0x506587){return{'count':_0x506587[_0x7eaa('0x21')],'rows':_[_0x7eaa('0x32')](_0x506587[_0x7eaa('0x49')],function(_0x45dfa7){return{'membername':_0x45dfa7[_0x7eaa('0x2f')],'UserId':_0x45dfa7['id'],'queue_name':_0x2da78a[_0x7eaa('0x2f')],'MailQueueId':_0x2da78a['id'],'interface':util['format'](_0x7eaa('0x65'),_0x7eaa('0x66'),_0x45dfa7['name']),'penalty':0x0,'paused':_0x45dfa7[_0x7eaa('0x62')],'createdAt':_0x45dfa7[_0x7eaa('0x64')],'updatedAt':_0x45dfa7[_0x7eaa('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7eaa('0x28')](respondWithFilteredResult(_0x377459,_0x9de69a))[_0x7eaa('0x4a')](handleError(_0x377459,null));};exports['getTeams']=function(_0x1705ee,_0x8e63dd,_0x57c925){var _0x180ab6={};var _0x17da9f={};var _0x548214;var _0x204e24;return db[_0x7eaa('0x33')][_0x7eaa('0x67')]({'where':{'id':_0x1705ee[_0x7eaa('0x58')]['id']}})[_0x7eaa('0x28')](handleEntityNotFound(_0x8e63dd,null))[_0x7eaa('0x28')](function(_0x3c5c8a){if(_0x3c5c8a){_0x548214=_0x3c5c8a;_0x17da9f[_0x7eaa('0x37')]=_[_0x7eaa('0x39')](db[_0x7eaa('0x68')]['rawAttributes']);_0x17da9f[_0x7eaa('0x38')]=_[_0x7eaa('0x39')](_0x1705ee[_0x7eaa('0x38')]);_0x17da9f[_0x7eaa('0x3a')]=_['intersection'](_0x17da9f['model'],_0x17da9f[_0x7eaa('0x38')]);_0x180ab6[_0x7eaa('0x3c')]=_['intersection'](_0x17da9f['model'],qs['fields'](_0x1705ee[_0x7eaa('0x38')][_0x7eaa('0x4c')]));_0x180ab6[_0x7eaa('0x3c')]=_0x180ab6['attributes']['length']?_0x180ab6[_0x7eaa('0x3c')]:_0x17da9f[_0x7eaa('0x37')];_0x180ab6[_0x7eaa('0x3f')]=qs['sort'](_0x1705ee[_0x7eaa('0x38')][_0x7eaa('0x40')]);_0x180ab6[_0x7eaa('0x41')]=qs['filters'](_['pick'](_0x1705ee[_0x7eaa('0x38')],_0x17da9f['filters']));if(_0x1705ee[_0x7eaa('0x38')][_0x7eaa('0x45')]){_0x180ab6[_0x7eaa('0x41')]=_[_0x7eaa('0x46')](_0x180ab6[_0x7eaa('0x41')],{'$or':_[_0x7eaa('0x32')](_0x180ab6[_0x7eaa('0x3c')],function(_0x408299){var _0x37715e={};_0x37715e[_0x408299]={'$like':'%'+_0x1705ee[_0x7eaa('0x38')][_0x7eaa('0x45')]+'%'};return _0x37715e;})});}_0x180ab6=_[_0x7eaa('0x46')]({},_0x180ab6,_0x1705ee[_0x7eaa('0x4e')]);return _0x548214[_0x7eaa('0x69')](_0x180ab6);}})['then'](function(_0x186b39){if(_0x186b39){_0x204e24=_0x186b39['length'];if(!_0x1705ee['query'][_0x7eaa('0x3d')](_0x7eaa('0x3e'))){_0x180ab6['limit']=qs[_0x7eaa('0x20')](_0x1705ee[_0x7eaa('0x38')]['limit']);_0x180ab6[_0x7eaa('0x1e')]=qs[_0x7eaa('0x1e')](_0x1705ee[_0x7eaa('0x38')]['offset']);}return _0x548214[_0x7eaa('0x69')](_0x180ab6);}})['then'](function(_0x322bd7){if(_0x322bd7){return _0x322bd7?{'count':_0x204e24,'rows':_0x322bd7}:null;}})[_0x7eaa('0x28')](respondWithResult(_0x8e63dd,null))[_0x7eaa('0x4a')](handleError(_0x8e63dd,null));};exports['addTeams']=function(_0x534e8c,_0xe4bf67,_0x5a220e){var _0x5664b0=_0x534e8c[_0x7eaa('0x50')][_0x7eaa('0x6a')];return db[_0x7eaa('0x68')][_0x7eaa('0x5d')]({'where':{'id':_0x5664b0},'attributes':['id'],'include':[{'model':db[_0x7eaa('0x5e')],'as':'Agents','attributes':['id',_0x7eaa('0x2f'),_0x7eaa('0x6b'),'voicePause',_0x7eaa('0x6c')],'raw':!![]}]})[_0x7eaa('0x28')](function(_0x2f2da2){if(_0x2f2da2){var _0x15dea8=_[_0x7eaa('0x6d')](_0x2f2da2,function(_0x139f02){var _0x2de30b=_0x139f02[_0x7eaa('0x29')]({'plain':!![]});return _0x2de30b['Agents'];});return db[_0x7eaa('0x33')]['find']({'where':{'id':_0x534e8c['params']['id']}})[_0x7eaa('0x28')](function(_0x35dde1){return db[_0x7eaa('0x6e')][_0x7eaa('0x6f')](function(_0x5ea989){return _0x35dde1['addTeams'](_0x5664b0,{'transaction':_0x5ea989})['then'](function(){return BPromise[_0x7eaa('0x70')](_0x15dea8,function(_0x308e69){return db[_0x7eaa('0x5c')][_0x7eaa('0x71')]({'where':{'UserId':_0x308e69['id'],'MailQueueId':_0x534e8c['params']['id']},'transaction':_0x5ea989});});})['then'](function(){_0x15dea8[_0x7eaa('0x72')](function(_0xa2bb35){socket[_0x7eaa('0x73')]('userMailQueue:save',{'UserId':_0xa2bb35['id'],'MailQueueId':_0x35dde1['id']});});});});});}})[_0x7eaa('0x28')](respondWithStatusCode(_0xe4bf67,null))[_0x7eaa('0x4a')](handleError(_0xe4bf67,null));};exports[_0x7eaa('0x74')]=function(_0x1860c0,_0xec44da,_0x9e5e70){return db[_0x7eaa('0x68')][_0x7eaa('0x5d')]({'where':{'id':_0x1860c0[_0x7eaa('0x38')][_0x7eaa('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7eaa('0x75'),'attributes':['id'],'raw':!![]}]})[_0x7eaa('0x28')](handleEntityNotFound(_0xec44da,null))[_0x7eaa('0x28')](function(_0xe3aedf){var _0x3dbfec=_[_0x7eaa('0x32')](_0xe3aedf,'id');var _0x36cec8=[];var _0x471893=[];var _0x8298b1=squel[_0x7eaa('0x76')]();_0x8298b1['field'](_0x7eaa('0x77'))[_0x7eaa('0x78')](_0x7eaa('0x79'),'tq')[_0x7eaa('0x7a')](_0x7eaa('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7eaa('0x41')]('MailQueueId\x20=\x20?',_0x1860c0['params']['id']);for(var _0x1da67a=0x0;_0x1da67a<_0xe3aedf[_0x7eaa('0x4d')];_0x1da67a+=0x1){let _0x41e7d0=_0xe3aedf[_0x1da67a];for(var _0x16a90f=0x0;_0x16a90f<_0x41e7d0[_0x7eaa('0x75')][_0x7eaa('0x4d')];_0x16a90f+=0x1){let _0x36be7d=_0x41e7d0[_0x7eaa('0x75')][_0x16a90f];var _0x9566d=_0x8298b1[_0x7eaa('0x7c')]();_0x9566d['where']('ut.UserId\x20=\x20?',_0x36be7d['id']);_0x471893['push'](db[_0x7eaa('0x6e')][_0x7eaa('0x38')](_0x9566d[_0x7eaa('0x7d')](),{'type':db[_0x7eaa('0x6e')]['QueryTypes'][_0x7eaa('0x7e')]})[_0x7eaa('0x28')](function(_0x3d92ae){if(_0x3d92ae[_0x7eaa('0x4d')]===0x1){return _0x36be7d['id'];}else{var _0x4b3dfd=_[_0x7eaa('0x7f')](_[_0x7eaa('0x32')](_0x3d92ae,'TeamId'),function(_0x2419d9){return _[_0x7eaa('0x80')](_0x3dbfec,_0x2419d9);});if(_0x4b3dfd){return _0x36be7d['id'];}}}));}}return BPromise[_0x7eaa('0x81')](_0x471893)['then'](function(_0x4a365c){_0x36cec8=_(_0x36cec8)[_0x7eaa('0x82')](_0x4a365c)[_0x7eaa('0x83')]()[_0x7eaa('0x84')]();return db['MailQueue']['find']({'where':{'id':_0x1860c0['params']['id']}})['then'](function(_0x1e1589){return db[_0x7eaa('0x6e')][_0x7eaa('0x6f')](function(_0x574081){return _0x1e1589['removeTeams'](_0x1860c0['query'][_0x7eaa('0x6a')],{'transaction':_0x574081})[_0x7eaa('0x28')](function(){if(!_[_0x7eaa('0x85')](_0x36cec8)){return _0x1e1589[_0x7eaa('0x86')](_0x36cec8,{'transaction':_0x574081});}})[_0x7eaa('0x28')](function(){_0x36cec8[_0x7eaa('0x72')](function(_0x131f90){socket[_0x7eaa('0x73')](_0x7eaa('0x87'),{'UserId':_0x131f90,'MailQueueId':_0x1e1589['id']});});});});});});})[_0x7eaa('0x28')](respondWithStatusCode(_0xec44da,null))['catch'](handleError(_0xec44da,null));};exports[_0x7eaa('0x88')]=function(_0x4bd611,_0x163776,_0x40ba12){return db[_0x7eaa('0x33')][_0x7eaa('0x55')]({'where':{'id':_0x4bd611[_0x7eaa('0x58')]['id']}})['then'](handleEntityNotFound(_0x163776,null))['then'](function(_0x145a24){if(_0x145a24){return _0x145a24[_0x7eaa('0x88')](_0x4bd611['body']['ids'],_[_0x7eaa('0x89')](_0x4bd611[_0x7eaa('0x50')],[_0x7eaa('0x6a'),'id'])||{})[_0x7eaa('0x8a')](function(_0x4f0bfd){for(var _0x50e517=0x0;_0x50e517<_0x4bd611['body']['ids']['length'];_0x50e517+=0x1){socket[_0x7eaa('0x73')](_0x7eaa('0x8b'),{'UserId':Number(_0x4bd611[_0x7eaa('0x50')][_0x7eaa('0x6a')][_0x50e517]),'MailQueueId':Number(_0x4bd611[_0x7eaa('0x58')]['id'])});}return _0x4f0bfd;});}})['then'](respondWithResult(_0x163776,null))[_0x7eaa('0x4a')](handleError(_0x163776,null));};exports[_0x7eaa('0x86')]=function(_0x39d75a,_0x80cc55,_0x2817c5){return db['MailQueue']['find']({'where':{'id':_0x39d75a[_0x7eaa('0x58')]['id']}})[_0x7eaa('0x28')](handleEntityNotFound(_0x80cc55,null))[_0x7eaa('0x28')](function(_0x2b1643){if(_0x2b1643){return _0x2b1643[_0x7eaa('0x86')](_0x39d75a['query'][_0x7eaa('0x6a')])[_0x7eaa('0x28')](function(){if(_[_0x7eaa('0x8c')](_0x39d75a['query'][_0x7eaa('0x6a')])){for(var _0x501f7e=0x0;_0x501f7e<_0x39d75a[_0x7eaa('0x38')][_0x7eaa('0x6a')]['length'];_0x501f7e+=0x1){socket['emit'](_0x7eaa('0x87'),{'UserId':Number(_0x39d75a['query'][_0x7eaa('0x6a')][_0x501f7e]),'MailQueueId':Number(_0x39d75a[_0x7eaa('0x58')]['id'])});}}else{socket[_0x7eaa('0x73')](_0x7eaa('0x87'),{'UserId':Number(_0x39d75a[_0x7eaa('0x38')][_0x7eaa('0x6a')]),'MailQueueId':Number(_0x39d75a[_0x7eaa('0x58')]['id'])});}});}})[_0x7eaa('0x28')](respondWithStatusCode(_0x80cc55,null))['catch'](handleError(_0x80cc55,null));};exports[_0x7eaa('0x8d')]=function(_0x5bb730,_0x20037f,_0x5b1890){var _0x2be52f={};var _0x481b17={};var _0x403cef;var _0x21d037;return db[_0x7eaa('0x33')][_0x7eaa('0x67')]({'where':{'id':_0x5bb730[_0x7eaa('0x58')]['id']}})[_0x7eaa('0x28')](handleEntityNotFound(_0x20037f,null))[_0x7eaa('0x28')](function(_0x107543){if(_0x107543){_0x403cef=_0x107543;_0x481b17[_0x7eaa('0x37')]=_['keys'](db['User']['rawAttributes']);_0x481b17[_0x7eaa('0x38')]=_[_0x7eaa('0x39')](_0x5bb730['query']);_0x481b17[_0x7eaa('0x3a')]=_[_0x7eaa('0x3b')](_0x481b17[_0x7eaa('0x37')],_0x481b17[_0x7eaa('0x38')]);_0x2be52f[_0x7eaa('0x3c')]=_[_0x7eaa('0x3b')](_0x481b17['model'],qs[_0x7eaa('0x4c')](_0x5bb730[_0x7eaa('0x38')][_0x7eaa('0x4c')]));_0x2be52f[_0x7eaa('0x3c')]=_0x2be52f['attributes'][_0x7eaa('0x4d')]?_0x2be52f[_0x7eaa('0x3c')]:_0x481b17[_0x7eaa('0x37')];_0x2be52f[_0x7eaa('0x3f')]=qs[_0x7eaa('0x40')](_0x5bb730['query'][_0x7eaa('0x40')]);_0x2be52f['where']=qs[_0x7eaa('0x3a')](_[_0x7eaa('0x42')](_0x5bb730['query'],_0x481b17[_0x7eaa('0x3a')]));if(_0x5bb730[_0x7eaa('0x38')][_0x7eaa('0x45')]){_0x2be52f[_0x7eaa('0x41')]=_[_0x7eaa('0x46')](_0x2be52f[_0x7eaa('0x41')],{'$or':_[_0x7eaa('0x32')](_0x2be52f[_0x7eaa('0x3c')],function(_0x3921f3){var _0x239c3a={};_0x239c3a[_0x3921f3]={'$like':'%'+_0x5bb730['query'][_0x7eaa('0x45')]+'%'};return _0x239c3a;})});}_0x2be52f=_[_0x7eaa('0x46')]({},_0x2be52f,_0x5bb730['options']);return _0x403cef[_0x7eaa('0x8d')](_0x2be52f);}})[_0x7eaa('0x28')](function(_0x586e1a){if(_0x586e1a){_0x21d037=_0x586e1a[_0x7eaa('0x4d')];if(!_0x5bb730[_0x7eaa('0x38')]['hasOwnProperty'](_0x7eaa('0x3e'))){_0x2be52f[_0x7eaa('0x20')]=qs[_0x7eaa('0x20')](_0x5bb730[_0x7eaa('0x38')][_0x7eaa('0x20')]);_0x2be52f[_0x7eaa('0x1e')]=qs['offset'](_0x5bb730[_0x7eaa('0x38')][_0x7eaa('0x1e')]);}return _0x403cef[_0x7eaa('0x8d')](_0x2be52f);}})[_0x7eaa('0x28')](function(_0xd4915c){if(_0xd4915c){return _0xd4915c?{'count':_0x21d037,'rows':_0xd4915c}:null;}})[_0x7eaa('0x28')](respondWithResult(_0x20037f,null))['catch'](handleError(_0x20037f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 39a4210..80af9a3 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 _0x4bd9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x4bd9,0x19f));var _0x94bd=function(_0x5b19da,_0x5d5d66){_0x5b19da=_0x5b19da-0x0;var _0x2608ed=_0x4bd9[_0x5b19da];return _0x2608ed;};'use strict';var EventEmitter=require(_0x94bd('0x0'));var MailQueue=require(_0x94bd('0x1'))['db'][_0x94bd('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x94bd('0x3')](0x0);var events={'afterCreate':_0x94bd('0x4'),'afterUpdate':_0x94bd('0x5'),'afterDestroy':_0x94bd('0x6')};function emitEvent(_0x1cf5d0){return function(_0x1d2400,_0x211196,_0x59e754){MailQueueEvents[_0x94bd('0x7')](_0x1cf5d0+':'+_0x1d2400['id'],_0x1d2400);MailQueueEvents[_0x94bd('0x7')](_0x1cf5d0,_0x1d2400);_0x59e754(null);};}for(var e in events){if(events[_0x94bd('0x8')](e)){var event=events[e];MailQueue[_0x94bd('0x9')](e,emitEvent(event));}}module[_0x94bd('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x64a0=['hook','events','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x64a0,0x1e9));var _0x064a=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x64a0[_0x90f34f];return _0x4b18cf;};'use strict';var EventEmitter=require(_0x064a('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x064a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x064a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x064a('0x3'),'afterDestroy':_0x064a('0x4')};function emitEvent(_0x23362a){return function(_0x155cee,_0x3e84d8,_0x4c1574){MailQueueEvents[_0x064a('0x5')](_0x23362a+':'+_0x155cee['id'],_0x155cee);MailQueueEvents['emit'](_0x23362a,_0x155cee);_0x4c1574(null);};}for(var e in events){if(events[_0x064a('0x6')](e)){var event=events[e];MailQueue[_0x064a('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 09fa4aa..8b5619f 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 _0xd3cb=['define','mail_queues','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./mailQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3cb,0x18e));var _0xbd3c=function(_0x49ee6b,_0x322613){_0x49ee6b=_0x49ee6b-0x0;var _0x5bc3ba=_0xd3cb[_0x49ee6b];return _0x5bc3ba;};'use strict';var _=require(_0xbd3c('0x0'));var util=require(_0xbd3c('0x1'));var logger=require(_0xbd3c('0x2'))(_0xbd3c('0x3'));var moment=require('moment');var BPromise=require(_0xbd3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd3c('0x5'));var rimraf=require('rimraf');var config=require(_0xbd3c('0x6'));var attributes=require(_0xbd3c('0x7'));module[_0xbd3c('0x8')]=function(_0x1efc09,_0x454e0f){return _0x1efc09[_0xbd3c('0x9')]('MailQueue',attributes,{'tableName':_0xbd3c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e53=['moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger'];(function(_0x293c66,_0x13fd15){var _0x175bdf=function(_0x1c5039){while(--_0x1c5039){_0x293c66['push'](_0x293c66['shift']());}};_0x175bdf(++_0x13fd15);}(_0x9e53,0xca));var _0x39e5=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0x9e53[_0x484cac];return _0x1d6e77;};'use strict';var _=require(_0x39e5('0x0'));var util=require('util');var logger=require(_0x39e5('0x1'))('api');var moment=require(_0x39e5('0x2'));var BPromise=require(_0x39e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39e5('0x4'));var rimraf=require(_0x39e5('0x5'));var config=require(_0x39e5('0x6'));var attributes=require(_0x39e5('0x7'));module[_0x39e5('0x8')]=function(_0x234fc2,_0xce9522){return _0x234fc2[_0x39e5('0x9')](_0x39e5('0xa'),attributes,{'tableName':_0x39e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 83a78cb..e9baf50 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 _0x3934=['map','debug','where','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','model'];(function(_0x17f7ed,_0x57cb76){var _0x8dbee6=function(_0x4c518e){while(--_0x4c518e){_0x17f7ed['push'](_0x17f7ed['shift']());}};_0x8dbee6(++_0x57cb76);}(_0x3934,0x10e));var _0x4393=function(_0x12bf44,_0x326a55){_0x12bf44=_0x12bf44-0x0;var _0x5d94b1=_0x3934[_0x12bf44];return _0x5d94b1;};'use strict';var _=require(_0x4393('0x0'));var util=require(_0x4393('0x1'));var moment=require(_0x4393('0x2'));var BPromise=require(_0x4393('0x3'));var rs=require(_0x4393('0x4'));var fs=require('fs');var Redis=require(_0x4393('0x5'));var db=require(_0x4393('0x6'))['db'];var utils=require(_0x4393('0x7'));var logger=require(_0x4393('0x8'))(_0x4393('0x9'));var config=require('../../config/environment');var jayson=require(_0x4393('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x4393('0xb')]=_[_0x4393('0xc')](config[_0x4393('0xb')],{'host':_0x4393('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4393('0xb')]));require('./mailQueue.socket')[_0x4393('0xe')](socket);function respondWithRpcPromise(_0x5687f8,_0x807b86,_0x51c68c){return new BPromise(function(_0x5099e9,_0x5e6b73){return client[_0x4393('0xf')](_0x5687f8,_0x51c68c)[_0x4393('0x10')](function(_0x4cd00c){logger['info'](_0x4393('0x11'),_0x807b86,_0x4393('0x12'));logger['debug'](_0x4393('0x13'),_0x807b86,_0x4393('0x12'),JSON[_0x4393('0x14')](_0x4cd00c));if(_0x4cd00c[_0x4393('0x15')]){if(_0x4cd00c[_0x4393('0x15')]['code']===0x1f4){logger[_0x4393('0x15')](_0x4393('0x11'),_0x807b86,_0x4cd00c[_0x4393('0x15')]['message']);return _0x5e6b73(_0x4cd00c['error'][_0x4393('0x16')]);}logger[_0x4393('0x15')]('MailQueue,\x20%s,\x20%s',_0x807b86,_0x4cd00c[_0x4393('0x15')][_0x4393('0x16')]);return _0x5099e9(_0x4cd00c[_0x4393('0x15')][_0x4393('0x16')]);}else{logger[_0x4393('0x17')](_0x4393('0x11'),_0x807b86,_0x4393('0x12'));_0x5099e9(_0x4cd00c[_0x4393('0x18')][_0x4393('0x16')]);}})[_0x4393('0x19')](function(_0x45fb24){logger['error']('MailQueue,\x20%s,\x20%s',_0x807b86,_0x45fb24);_0x5e6b73(_0x45fb24);});});}exports[_0x4393('0x1a')]=function(_0xade61c){var _0x5b5d46=this;return new Promise(function(_0x4a27a4,_0x29e935){return db[_0x4393('0x1b')][_0x4393('0x1c')]({'raw':_0xade61c[_0x4393('0x1d')]?_0xade61c[_0x4393('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xade61c[_0x4393('0x1d')]?_0xade61c['options']['where']||null:null,'attributes':_0xade61c[_0x4393('0x1d')]?_0xade61c[_0x4393('0x1d')][_0x4393('0x1e')]||null:null,'limit':_0xade61c[_0x4393('0x1d')]?_0xade61c[_0x4393('0x1d')][_0x4393('0x1f')]||null:null,'include':_0xade61c[_0x4393('0x1d')]?_0xade61c[_0x4393('0x1d')]['include']?_['map'](_0xade61c[_0x4393('0x1d')][_0x4393('0x20')],function(_0xc195b9){return{'model':db[_0xc195b9[_0x4393('0x21')]],'as':_0xc195b9['as'],'attributes':_0xc195b9[_0x4393('0x1e')],'include':_0xc195b9['include']?_[_0x4393('0x22')](_0xc195b9[_0x4393('0x20')],function(_0x4b56f0){return{'model':db[_0x4b56f0[_0x4393('0x21')]],'as':_0x4b56f0['as'],'attributes':_0x4b56f0[_0x4393('0x1e')],'include':_0x4b56f0['include']?_[_0x4393('0x22')](_0x4b56f0[_0x4393('0x20')],function(_0x11cf86){return{'model':db[_0x11cf86[_0x4393('0x21')]],'as':_0x11cf86['as'],'attributes':_0x11cf86['attributes']};}):[]};}):[]};}):[]:[]})[_0x4393('0x10')](function(_0x2ff251){logger[_0x4393('0x17')](_0x4393('0x1a'),_0xade61c);logger[_0x4393('0x23')]('GetMailQueue',_0xade61c,JSON[_0x4393('0x14')](_0x2ff251));_0x4a27a4(_0x2ff251);})[_0x4393('0x19')](function(_0x396b68){logger[_0x4393('0x15')](_0x4393('0x1a'),_0x396b68[_0x4393('0x16')],_0xade61c);_0x29e935(_0x5b5d46[_0x4393('0x15')](0x1f4,_0x396b68[_0x4393('0x16')]));});});};exports['ShowMailQueue']=function(_0x3988cb){var _0x40b297=this;return new Promise(function(_0x6c6373,_0xb0f04f){return db[_0x4393('0x1b')]['find']({'raw':_0x3988cb['options']?_0x3988cb[_0x4393('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3988cb[_0x4393('0x1d')]?_0x3988cb[_0x4393('0x1d')][_0x4393('0x24')]||null:null,'attributes':_0x3988cb[_0x4393('0x1d')]?_0x3988cb[_0x4393('0x1d')][_0x4393('0x1e')]||null:null,'include':_0x3988cb[_0x4393('0x1d')]?_0x3988cb['options'][_0x4393('0x20')]?_[_0x4393('0x22')](_0x3988cb[_0x4393('0x1d')][_0x4393('0x20')],function(_0x308044){return{'model':db[_0x308044[_0x4393('0x21')]],'as':_0x308044['as'],'attributes':_0x308044[_0x4393('0x1e')],'include':_0x308044['include']?_['map'](_0x308044[_0x4393('0x20')],function(_0xd27081){return{'model':db[_0xd27081[_0x4393('0x21')]],'as':_0xd27081['as'],'attributes':_0xd27081[_0x4393('0x1e')],'include':_0xd27081[_0x4393('0x20')]?_[_0x4393('0x22')](_0xd27081[_0x4393('0x20')],function(_0x5d9954){return{'model':db[_0x5d9954[_0x4393('0x21')]],'as':_0x5d9954['as'],'attributes':_0x5d9954[_0x4393('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x236796){logger[_0x4393('0x17')](_0x4393('0x25'),_0x3988cb);logger[_0x4393('0x23')](_0x4393('0x25'),_0x3988cb,JSON[_0x4393('0x14')](_0x236796));_0x6c6373(_0x236796);})[_0x4393('0x19')](function(_0x4fa0c5){logger[_0x4393('0x15')](_0x4393('0x25'),_0x4fa0c5['message'],_0x3988cb);_0xb0f04f(_0x40b297[_0x4393('0x15')](0x1f4,_0x4fa0c5[_0x4393('0x16')]));});});}; \ No newline at end of file +var _0xfae8=['ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','then'];(function(_0x20d3f0,_0x4aa1f6){var _0xad6ea3=function(_0x45b6c1){while(--_0x45b6c1){_0x20d3f0['push'](_0x20d3f0['shift']());}};_0xad6ea3(++_0x4aa1f6);}(_0xfae8,0x76));var _0x8fae=function(_0x146454,_0x5f8917){_0x146454=_0x146454-0x0;var _0x5050b2=_0xfae8[_0x146454];return _0x5050b2;};'use strict';var _=require(_0x8fae('0x0'));var util=require(_0x8fae('0x1'));var moment=require(_0x8fae('0x2'));var BPromise=require(_0x8fae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fae('0x5'));var logger=require(_0x8fae('0x6'))(_0x8fae('0x7'));var config=require(_0x8fae('0x8'));var jayson=require(_0x8fae('0x9'));var client=jayson[_0x8fae('0xa')][_0x8fae('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x8fae('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fae('0xd')]));require(_0x8fae('0xe'))[_0x8fae('0xf')](socket);function respondWithRpcPromise(_0x4e8427,_0x25a27c,_0x37a468){return new BPromise(function(_0x12af6b,_0x2f952a){return client[_0x8fae('0x10')](_0x4e8427,_0x37a468)['then'](function(_0x1481a5){logger[_0x8fae('0x11')](_0x8fae('0x12'),_0x25a27c,_0x8fae('0x13'));logger[_0x8fae('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x25a27c,_0x8fae('0x13'),JSON[_0x8fae('0x15')](_0x1481a5));if(_0x1481a5[_0x8fae('0x16')]){if(_0x1481a5[_0x8fae('0x16')]['code']===0x1f4){logger['error'](_0x8fae('0x12'),_0x25a27c,_0x1481a5['error'][_0x8fae('0x17')]);return _0x2f952a(_0x1481a5[_0x8fae('0x16')]['message']);}logger['error'](_0x8fae('0x12'),_0x25a27c,_0x1481a5['error'][_0x8fae('0x17')]);return _0x12af6b(_0x1481a5['error']['message']);}else{logger[_0x8fae('0x11')](_0x8fae('0x12'),_0x25a27c,_0x8fae('0x13'));_0x12af6b(_0x1481a5[_0x8fae('0x18')][_0x8fae('0x17')]);}})[_0x8fae('0x19')](function(_0xeb98fc){logger['error'](_0x8fae('0x12'),_0x25a27c,_0xeb98fc);_0x2f952a(_0xeb98fc);});});}exports[_0x8fae('0x1a')]=function(_0x3a1cf9){var _0x166c67=this;return new Promise(function(_0x4aad09,_0x45e154){return db[_0x8fae('0x1b')][_0x8fae('0x1c')]({'raw':_0x3a1cf9[_0x8fae('0x1d')]?_0x3a1cf9[_0x8fae('0x1d')][_0x8fae('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a1cf9['options']?_0x3a1cf9['options'][_0x8fae('0x1f')]||null:null,'attributes':_0x3a1cf9[_0x8fae('0x1d')]?_0x3a1cf9[_0x8fae('0x1d')][_0x8fae('0x20')]||null:null,'limit':_0x3a1cf9[_0x8fae('0x1d')]?_0x3a1cf9[_0x8fae('0x1d')][_0x8fae('0x21')]||null:null,'include':_0x3a1cf9[_0x8fae('0x1d')]?_0x3a1cf9[_0x8fae('0x1d')]['include']?_[_0x8fae('0x22')](_0x3a1cf9[_0x8fae('0x1d')][_0x8fae('0x23')],function(_0x57ac41){return{'model':db[_0x57ac41[_0x8fae('0x24')]],'as':_0x57ac41['as'],'attributes':_0x57ac41[_0x8fae('0x20')],'include':_0x57ac41['include']?_[_0x8fae('0x22')](_0x57ac41['include'],function(_0x17ce5d){return{'model':db[_0x17ce5d[_0x8fae('0x24')]],'as':_0x17ce5d['as'],'attributes':_0x17ce5d['attributes'],'include':_0x17ce5d[_0x8fae('0x23')]?_[_0x8fae('0x22')](_0x17ce5d[_0x8fae('0x23')],function(_0x182b42){return{'model':db[_0x182b42[_0x8fae('0x24')]],'as':_0x182b42['as'],'attributes':_0x182b42[_0x8fae('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8fae('0x25')](function(_0x1772fc){logger[_0x8fae('0x11')](_0x8fae('0x1a'),_0x3a1cf9);logger[_0x8fae('0x14')](_0x8fae('0x1a'),_0x3a1cf9,JSON['stringify'](_0x1772fc));_0x4aad09(_0x1772fc);})[_0x8fae('0x19')](function(_0x8c0204){logger[_0x8fae('0x16')]('GetMailQueue',_0x8c0204['message'],_0x3a1cf9);_0x45e154(_0x166c67[_0x8fae('0x16')](0x1f4,_0x8c0204[_0x8fae('0x17')]));});});};exports[_0x8fae('0x26')]=function(_0x27a6a9){var _0x198ab0=this;return new Promise(function(_0x1f4b01,_0x2017e6){return db[_0x8fae('0x1b')]['find']({'raw':_0x27a6a9['options']?_0x27a6a9[_0x8fae('0x1d')][_0x8fae('0x1e')]===undefined?!![]:![]:!![],'where':_0x27a6a9[_0x8fae('0x1d')]?_0x27a6a9[_0x8fae('0x1d')]['where']||null:null,'attributes':_0x27a6a9['options']?_0x27a6a9['options'][_0x8fae('0x20')]||null:null,'include':_0x27a6a9['options']?_0x27a6a9[_0x8fae('0x1d')][_0x8fae('0x23')]?_[_0x8fae('0x22')](_0x27a6a9['options'][_0x8fae('0x23')],function(_0x5e7897){return{'model':db[_0x5e7897[_0x8fae('0x24')]],'as':_0x5e7897['as'],'attributes':_0x5e7897[_0x8fae('0x20')],'include':_0x5e7897[_0x8fae('0x23')]?_[_0x8fae('0x22')](_0x5e7897[_0x8fae('0x23')],function(_0x262d81){return{'model':db[_0x262d81[_0x8fae('0x24')]],'as':_0x262d81['as'],'attributes':_0x262d81[_0x8fae('0x20')],'include':_0x262d81[_0x8fae('0x23')]?_[_0x8fae('0x22')](_0x262d81[_0x8fae('0x23')],function(_0x4899e5){return{'model':db[_0x4899e5['model']],'as':_0x4899e5['as'],'attributes':_0x4899e5[_0x8fae('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8fae('0x25')](function(_0x18507d){logger[_0x8fae('0x11')](_0x8fae('0x26'),_0x27a6a9);logger[_0x8fae('0x14')](_0x8fae('0x26'),_0x27a6a9,JSON[_0x8fae('0x15')](_0x18507d));_0x1f4b01(_0x18507d);})[_0x8fae('0x19')](function(_0xd8ee32){logger[_0x8fae('0x16')](_0x8fae('0x26'),_0xd8ee32[_0x8fae('0x17')],_0x27a6a9);_0x2017e6(_0x198ab0['error'](0x1f4,_0xd8ee32[_0x8fae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index cbe4d13..bee6f1b 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 _0x57e6=['update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save','remove'];(function(_0xa1afcb,_0x1d4d02){var _0x25555e=function(_0x2b8b16){while(--_0x2b8b16){_0xa1afcb['push'](_0xa1afcb['shift']());}};_0x25555e(++_0x1d4d02);}(_0x57e6,0x177));var _0x657e=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x57e6[_0x2e249d];return _0x1faa37;};'use strict';var MailQueueEvents=require(_0x657e('0x0'));var events=[_0x657e('0x1'),_0x657e('0x2'),_0x657e('0x3')];function createListener(_0x520ec0,_0x7980e0){return function(_0x48a582){_0x7980e0[_0x657e('0x4')](_0x520ec0,_0x48a582);};}function removeListener(_0x773dd8,_0x3324d3){return function(){MailQueueEvents[_0x657e('0x5')](_0x773dd8,_0x3324d3);};}exports[_0x657e('0x6')]=function(_0x24708a){for(var _0x3521b1=0x0,_0x4358f1=events[_0x657e('0x7')];_0x3521b1<_0x4358f1;_0x3521b1++){var _0x440667=events[_0x3521b1];var _0x12807d=createListener(_0x657e('0x8')+_0x440667,_0x24708a);MailQueueEvents['on'](_0x440667,_0x12807d);}}; \ No newline at end of file +var _0xdb28=['emit','removeListener','length','./mailQueue.events','save','update'];(function(_0x217968,_0x1fdb5b){var _0xebbda0=function(_0x589864){while(--_0x589864){_0x217968['push'](_0x217968['shift']());}};_0xebbda0(++_0x1fdb5b);}(_0xdb28,0x19b));var _0x8db2=function(_0x3819fc,_0x38ffae){_0x3819fc=_0x3819fc-0x0;var _0x23038b=_0xdb28[_0x3819fc];return _0x23038b;};'use strict';var MailQueueEvents=require(_0x8db2('0x0'));var events=[_0x8db2('0x1'),'remove',_0x8db2('0x2')];function createListener(_0x26c8b4,_0x1cd08d){return function(_0x39aa46){_0x1cd08d[_0x8db2('0x3')](_0x26c8b4,_0x39aa46);};}function removeListener(_0x3ac498,_0x4e9dbe){return function(){MailQueueEvents[_0x8db2('0x4')](_0x3ac498,_0x4e9dbe);};}exports['register']=function(_0x5b2724){for(var _0x29b55a=0x0,_0x406b56=events[_0x8db2('0x5')];_0x29b55a<_0x406b56;_0x29b55a++){var _0x25b49d=events[_0x29b55a];var _0x533b43=createListener('mailQueue:'+_0x25b49d,_0x5b2724);MailQueueEvents['on'](_0x25b49d,_0x533b43);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 8ce2166..6770f6e 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 _0xae42=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','destroy'];(function(_0x1230b8,_0x1c6702){var _0x2e0bc7=function(_0x1c7df4){while(--_0x1c7df4){_0x1230b8['push'](_0x1230b8['shift']());}};_0x2e0bc7(++_0x1c6702);}(_0xae42,0xa1));var _0x2ae4=function(_0x49d9b8,_0x567967){_0x49d9b8=_0x49d9b8-0x0;var _0x381325=_0xae42[_0x49d9b8];return _0x381325;};'use strict';var multer=require(_0x2ae4('0x0'));var util=require(_0x2ae4('0x1'));var path=require('path');var timeout=require(_0x2ae4('0x2'));var express=require('express');var router=express[_0x2ae4('0x3')]();var fs_extra=require(_0x2ae4('0x4'));var auth=require(_0x2ae4('0x5'));var interaction=require(_0x2ae4('0x6'));var config=require(_0x2ae4('0x7'));var controller=require(_0x2ae4('0x8'));router['get']('/',auth[_0x2ae4('0x9')](),controller[_0x2ae4('0xa')]);router[_0x2ae4('0xb')]('/describe',auth[_0x2ae4('0x9')](),controller[_0x2ae4('0xc')]);router['get'](_0x2ae4('0xd'),auth[_0x2ae4('0x9')](),controller[_0x2ae4('0xe')]);router[_0x2ae4('0xf')]('/',auth[_0x2ae4('0x9')](),controller[_0x2ae4('0x10')]);router['put'](_0x2ae4('0xd'),auth[_0x2ae4('0x9')](),controller[_0x2ae4('0x11')]);router['delete'](_0x2ae4('0xd'),auth['isAuthenticated'](),controller[_0x2ae4('0x12')]);module[_0x2ae4('0x13')]=router; \ No newline at end of file +var _0xcf9a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x433ebf,_0x28f838){var _0x4b9bc3=function(_0x29db62){while(--_0x29db62){_0x433ebf['push'](_0x433ebf['shift']());}};_0x4b9bc3(++_0x28f838);}(_0xcf9a,0x188));var _0xacf9=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcf9a[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0xacf9('0x0'));var util=require(_0xacf9('0x1'));var path=require(_0xacf9('0x2'));var timeout=require(_0xacf9('0x3'));var express=require(_0xacf9('0x4'));var router=express[_0xacf9('0x5')]();var fs_extra=require(_0xacf9('0x6'));var auth=require(_0xacf9('0x7'));var interaction=require(_0xacf9('0x8'));var config=require(_0xacf9('0x9'));var controller=require(_0xacf9('0xa'));router[_0xacf9('0xb')]('/',auth[_0xacf9('0xc')](),controller[_0xacf9('0xd')]);router[_0xacf9('0xb')](_0xacf9('0xe'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xacf9('0xc')](),controller[_0xacf9('0xf')]);router[_0xacf9('0x10')]('/',auth[_0xacf9('0xc')](),controller[_0xacf9('0x11')]);router['put'](_0xacf9('0x12'),auth['isAuthenticated'](),controller[_0xacf9('0x13')]);router[_0xacf9('0x14')](_0xacf9('0x12'),auth['isAuthenticated'](),controller[_0xacf9('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 605c681..8af633a 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 _0x4f80=['exports','STRING','DATE','moment','sequelize'];(function(_0x43192f,_0x45e191){var _0x227deb=function(_0x58a9c4){while(--_0x58a9c4){_0x43192f['push'](_0x43192f['shift']());}};_0x227deb(++_0x45e191);}(_0x4f80,0xcb));var _0x04f8=function(_0x57cc16,_0x444378){_0x57cc16=_0x57cc16-0x0;var _0x5421e5=_0x4f80[_0x57cc16];return _0x5421e5;};'use strict';var moment=require(_0x04f8('0x0'));var Sequelize=require(_0x04f8('0x1'));module[_0x04f8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x04f8('0x3')]},'joinAt':{'type':Sequelize[_0x04f8('0x4')]},'leaveAt':{'type':Sequelize[_0x04f8('0x4')]},'acceptAt':{'type':Sequelize[_0x04f8('0x4')]},'exitAt':{'type':Sequelize[_0x04f8('0x4')]},'reason':{'type':Sequelize[_0x04f8('0x3')]}}; \ No newline at end of file +var _0xef40=['sequelize','exports','STRING','DATE','moment'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xef40,0x18f));var _0x0ef4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xef40[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require(_0x0ef4('0x0'));var Sequelize=require(_0x0ef4('0x1'));module[_0x0ef4('0x2')]={'uniqueid':{'type':Sequelize[_0x0ef4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0ef4('0x3')]},'joinAt':{'type':Sequelize[_0x0ef4('0x4')]},'leaveAt':{'type':Sequelize[_0x0ef4('0x4')]},'acceptAt':{'type':Sequelize[_0x0ef4('0x4')]},'exitAt':{'type':Sequelize[_0x0ef4('0x4')]},'reason':{'type':Sequelize[_0x0ef4('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 2b2370d..cd4c6a1 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 _0x3a6d=['keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','type','options','includeAll','rows','catch','params','rawAttributes','merge','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','then','error','stack','name','send','index','map','MailQueueReport','fieldName','key','query'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3a6d,0x143));var _0xd3a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3a6d[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xd3a6('0x0'));var rimraf=require(_0xd3a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3a6('0x2'));var rp=require(_0xd3a6('0x3'));var moment=require(_0xd3a6('0x4'));var BPromise=require(_0xd3a6('0x5'));var Mustache=require(_0xd3a6('0x6'));var util=require('util');var path=require(_0xd3a6('0x7'));var sox=require(_0xd3a6('0x8'));var csv=require(_0xd3a6('0x9'));var ejs=require(_0xd3a6('0xa'));var fs=require('fs');var fs_extra=require(_0xd3a6('0xb'));var _=require(_0xd3a6('0xc'));var squel=require('squel');var crypto=require(_0xd3a6('0xd'));var jsforce=require(_0xd3a6('0xe'));var deskjs=require(_0xd3a6('0xf'));var toCsv=require(_0xd3a6('0x9'));var querystring=require(_0xd3a6('0x10'));var Papa=require(_0xd3a6('0x11'));var Redis=require(_0xd3a6('0x12'));var authService=require(_0xd3a6('0x13'));var qs=require(_0xd3a6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3a6('0x15'));var logger=require(_0xd3a6('0x16'))(_0xd3a6('0x17'));var utils=require(_0xd3a6('0x18'));var config=require(_0xd3a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0467,_0x1c6ad7){_0x1c6ad7=_0x1c6ad7||0xcc;return function(_0x671004){if(_0x671004){return _0x4b0467[_0xd3a6('0x1a')](_0x1c6ad7);}return _0x4b0467[_0xd3a6('0x1b')](_0x1c6ad7)[_0xd3a6('0x1c')]();};}function respondWithResult(_0x2911a0,_0xa56452){_0xa56452=_0xa56452||0xc8;return function(_0x4e67fb){if(_0x4e67fb){return _0x2911a0[_0xd3a6('0x1b')](_0xa56452)[_0xd3a6('0x1d')](_0x4e67fb);}};}function respondWithFilteredResult(_0x171a8f,_0x500a37){return function(_0x3c2399){if(_0x3c2399){var _0x305b61=typeof _0x500a37[_0xd3a6('0x1e')]==='undefined'&&typeof _0x500a37[_0xd3a6('0x1f')]==='undefined';var _0x518b6d=_0x3c2399[_0xd3a6('0x20')];var _0x8d1286=_0x305b61?0x0:_0x500a37[_0xd3a6('0x1e')];var _0xbe58b4=_0x305b61?_0x3c2399[_0xd3a6('0x20')]:_0x500a37[_0xd3a6('0x1e')]+_0x500a37[_0xd3a6('0x1f')];var _0x4ec27c;if(_0xbe58b4>=_0x518b6d){_0xbe58b4=_0x518b6d;_0x4ec27c=0xc8;}else{_0x4ec27c=0xce;}_0x171a8f[_0xd3a6('0x1b')](_0x4ec27c);return _0x171a8f['set'](_0xd3a6('0x21'),_0x8d1286+'-'+_0xbe58b4+'/'+_0x518b6d)[_0xd3a6('0x1d')](_0x3c2399);}return null;};}function patchUpdates(_0x12f2c1){return function(_0x20a34e){try{jsonpatch[_0xd3a6('0x22')](_0x20a34e,_0x12f2c1,!![]);}catch(_0x6ecd88){return BPromise['reject'](_0x6ecd88);}return _0x20a34e[_0xd3a6('0x23')]();};}function saveUpdates(_0x422f5c,_0x57cf15){return function(_0x543a6a){if(_0x543a6a){return _0x543a6a['update'](_0x422f5c)['then'](function(_0x5c9075){return _0x5c9075;});}return null;};}function removeEntity(_0x98a12a,_0x400982){return function(_0x3d0b28){if(_0x3d0b28){return _0x3d0b28['destroy']()[_0xd3a6('0x24')](function(){_0x98a12a['status'](0xcc)[_0xd3a6('0x1c')]();});}};}function handleEntityNotFound(_0x16afc8,_0x429079){return function(_0x4f6130){if(!_0x4f6130){_0x16afc8[_0xd3a6('0x1a')](0x194);}return _0x4f6130;};}function handleError(_0x3bc8d1,_0x1b09ac){_0x1b09ac=_0x1b09ac||0x1f4;return function(_0x219e32){logger[_0xd3a6('0x25')](_0x219e32[_0xd3a6('0x26')]);if(_0x219e32['name']){delete _0x219e32[_0xd3a6('0x27')];}_0x3bc8d1[_0xd3a6('0x1b')](_0x1b09ac)[_0xd3a6('0x28')](_0x219e32);};}exports[_0xd3a6('0x29')]=function(_0x30abc2,_0x45c628){var _0x5c2186={},_0x535bd4={},_0x1f4859={'count':0x0,'rows':[]};var _0x210aa1=_[_0xd3a6('0x2a')](db[_0xd3a6('0x2b')]['rawAttributes'],function(_0x3de3bb){return{'name':_0x3de3bb[_0xd3a6('0x2c')],'type':_0x3de3bb['type'][_0xd3a6('0x2d')]};});_0x535bd4['model']=_[_0xd3a6('0x2a')](_0x210aa1,_0xd3a6('0x27'));_0x535bd4[_0xd3a6('0x2e')]=_[_0xd3a6('0x2f')](_0x30abc2[_0xd3a6('0x2e')]);_0x535bd4[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x535bd4['model'],_0x535bd4['query']);_0x5c2186[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x535bd4[_0xd3a6('0x33')],qs['fields'](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x5c2186[_0xd3a6('0x32')]=_0x5c2186[_0xd3a6('0x32')][_0xd3a6('0x35')]?_0x5c2186[_0xd3a6('0x32')]:_0x535bd4[_0xd3a6('0x33')];if(!_0x30abc2[_0xd3a6('0x2e')]['hasOwnProperty'](_0xd3a6('0x36'))){_0x5c2186[_0xd3a6('0x1f')]=qs[_0xd3a6('0x1f')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x1f')]);_0x5c2186[_0xd3a6('0x1e')]=qs['offset'](_0x30abc2[_0xd3a6('0x2e')]['offset']);}_0x5c2186[_0xd3a6('0x37')]=qs[_0xd3a6('0x38')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x38')]);_0x5c2186['where']=qs['filters'](_[_0xd3a6('0x39')](_0x30abc2[_0xd3a6('0x2e')],_0x535bd4[_0xd3a6('0x30')]),_0x210aa1);if(_0x30abc2['query'][_0xd3a6('0x3a')]){_0x5c2186[_0xd3a6('0x3b')]=_['merge'](_0x5c2186[_0xd3a6('0x3b')],{'$or':_['map'](_0x210aa1,function(_0x1e695a){if(_0x1e695a[_0xd3a6('0x3c')]!=='VIRTUAL'){var _0x219ba5={};_0x219ba5[_0x1e695a['name']]={'$like':'%'+_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3a')]+'%'};return _0x219ba5;}})});}_0x5c2186=_['merge']({},_0x5c2186,_0x30abc2[_0xd3a6('0x3d')]);var _0xfcef03={'where':_0x5c2186[_0xd3a6('0x3b')]};return db[_0xd3a6('0x2b')]['count'](_0xfcef03)[_0xd3a6('0x24')](function(_0x324dbd){_0x1f4859[_0xd3a6('0x20')]=_0x324dbd;if(_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x5c2186['include']=[{'all':!![]}];}return db[_0xd3a6('0x2b')]['findAll'](_0x5c2186);})[_0xd3a6('0x24')](function(_0x1bc18a){_0x1f4859[_0xd3a6('0x3f')]=_0x1bc18a;return _0x1f4859;})['then'](respondWithFilteredResult(_0x45c628,_0x5c2186))[_0xd3a6('0x40')](handleError(_0x45c628,null));};exports['show']=function(_0x23aa99,_0x4cbf76){var _0x448213={'raw':!![],'where':{'id':_0x23aa99[_0xd3a6('0x41')]['id']}},_0x629153={};_0x629153[_0xd3a6('0x33')]=_[_0xd3a6('0x2f')](db[_0xd3a6('0x2b')][_0xd3a6('0x42')]);_0x629153['query']=_[_0xd3a6('0x2f')](_0x23aa99[_0xd3a6('0x2e')]);_0x629153[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x629153['model'],_0x629153[_0xd3a6('0x2e')]);_0x448213[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x629153[_0xd3a6('0x33')],qs[_0xd3a6('0x34')](_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x448213[_0xd3a6('0x32')]=_0x448213['attributes'][_0xd3a6('0x35')]?_0x448213[_0xd3a6('0x32')]:_0x629153[_0xd3a6('0x33')];if(_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x448213['include']=[{'all':!![]}];}_0x448213=_[_0xd3a6('0x43')]({},_0x448213,_0x23aa99[_0xd3a6('0x3d')]);return db[_0xd3a6('0x2b')][_0xd3a6('0x44')](_0x448213)[_0xd3a6('0x24')](handleEntityNotFound(_0x4cbf76,null))[_0xd3a6('0x24')](respondWithResult(_0x4cbf76,null))[_0xd3a6('0x40')](handleError(_0x4cbf76,null));};exports[_0xd3a6('0x45')]=function(_0x4ac576,_0x7828c2){return db['MailQueueReport'][_0xd3a6('0x45')](_0x4ac576[_0xd3a6('0x46')],{})['then'](respondWithResult(_0x7828c2,0xc9))[_0xd3a6('0x40')](handleError(_0x7828c2,null));};exports[_0xd3a6('0x47')]=function(_0x3cf99a,_0x375067){if(_0x3cf99a[_0xd3a6('0x46')]['id']){delete _0x3cf99a[_0xd3a6('0x46')]['id'];}return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x3cf99a[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x375067,null))['then'](saveUpdates(_0x3cf99a[_0xd3a6('0x46')],null))[_0xd3a6('0x24')](respondWithResult(_0x375067,null))[_0xd3a6('0x40')](handleError(_0x375067,null));};exports[_0xd3a6('0x48')]=function(_0x26bd65,_0x225393){return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x26bd65[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x225393,null))['then'](removeEntity(_0x225393,null))[_0xd3a6('0x40')](handleError(_0x225393,null));};exports[_0xd3a6('0x49')]=function(_0x618b72,_0x4995b7){return db[_0xd3a6('0x2b')]['describe']()['then'](respondWithResult(_0x4995b7,null))['catch'](handleError(_0x4995b7,null));}; \ No newline at end of file +var _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailQueueReport','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','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'];(function(_0x2c0174,_0x52753d){var _0x4a58b2=function(_0x27925b){while(--_0x27925b){_0x2c0174['push'](_0x2c0174['shift']());}};_0x4a58b2(++_0x52753d);}(_0x2ef3,0xba));var _0x32ef=function(_0x208d21,_0x31fc34){_0x208d21=_0x208d21-0x0;var _0x134ff6=_0x2ef3[_0x208d21];return _0x134ff6;};'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['MailQueueReport'][_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')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['MailQueueReport'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['MailQueueReport']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 0158bb0..d3adf04 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 _0xa7b4=['exports','define','MailQueueReport','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x382987,_0x58058b){var _0x29eb57=function(_0x646f43){while(--_0x646f43){_0x382987['push'](_0x382987['shift']());}};_0x29eb57(++_0x58058b);}(_0xa7b4,0x70));var _0x4a7b=function(_0xd2d5f7,_0xf4e61d){_0xd2d5f7=_0xd2d5f7-0x0;var _0x78116e=_0xa7b4[_0xd2d5f7];return _0x78116e;};'use strict';var _=require(_0x4a7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4a7b('0x1'));var moment=require(_0x4a7b('0x2'));var BPromise=require(_0x4a7b('0x3'));var rp=require(_0x4a7b('0x4'));var fs=require('fs');var path=require(_0x4a7b('0x5'));var rimraf=require(_0x4a7b('0x6'));var config=require(_0x4a7b('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x4a7b('0x8')]=function(_0xd54173,_0x1fcdde){return _0xd54173[_0x4a7b('0x9')](_0x4a7b('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x4a7b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaeb5=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xaeb5,0x184));var _0x5aeb=function(_0x2962e4,_0xc25e04){_0x2962e4=_0x2962e4-0x0;var _0x38a4a9=_0xaeb5[_0x2962e4];return _0x38a4a9;};'use strict';var _=require(_0x5aeb('0x0'));var util=require(_0x5aeb('0x1'));var logger=require('../../config/logger')(_0x5aeb('0x2'));var moment=require(_0x5aeb('0x3'));var BPromise=require(_0x5aeb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aeb('0x5'));var rimraf=require(_0x5aeb('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x5aeb('0x7')]=function(_0x2c358c,_0x2c4200){return _0x2c358c['define'](_0x5aeb('0x8'),attributes,{'tableName':_0x5aeb('0x9'),'paranoid':![],'indexes':[{'name':_0x5aeb('0xa'),'fields':[_0x5aeb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 109f26c..46f172d 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2646a5,_0x4c7180){var _0x2c8339=function(_0x8873ed){while(--_0x8873ed){_0x2646a5['push'](_0x2646a5['shift']());}};_0x2c8339(++_0x4c7180);}(_0xdb28,0x106));var _0x8db2=function(_0x18548e,_0x4de2f9){_0x18548e=_0x18548e-0x0;var _0x41349f=_0xdb28[_0x18548e];return _0x41349f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _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(_0xa3419f,_0x567537){var _0x3025b2=function(_0x18d8c9){while(--_0x18d8c9){_0xa3419f['push'](_0xa3419f['shift']());}};_0x3025b2(++_0x567537);}(_0x1261,0x144));var _0x1126=function(_0x31c201,_0x2f0396){_0x31c201=_0x31c201-0x0;var _0xe880b4=_0x1261[_0x31c201];return _0xe880b4;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 34f503d..7b7b499 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x30a8c3,_0x4b572f){var _0x52aad4=function(_0xbcb86b){while(--_0xbcb86b){_0x30a8c3['push'](_0x30a8c3['shift']());}};_0x52aad4(++_0x4b572f);}(_0xe706,0xa3));var _0x6e70=function(_0x31cb77,_0x348021){_0x31cb77=_0x31cb77-0x0;var _0x710374=_0xe706[_0x31cb77];return _0x710374;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x940455,_0x32ce9d){var _0x47fa7a=function(_0x43b218){while(--_0x43b218){_0x940455['push'](_0x940455['shift']());}};_0x47fa7a(++_0x32ce9d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcb91[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b9497aa..860e200 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 _0x88a3=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x88a3,0x190));var _0x388a=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x88a3[_0x277af0];return _0x43bd7c;};'use strict';var Sequelize=require(_0x388a('0x0'));module[_0x388a('0x1')]={'description':{'type':Sequelize[_0x388a('0x2')]},'host':{'type':Sequelize[_0x388a('0x2')]},'authentication':{'type':Sequelize[_0x388a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x388a('0x2')]},'password':{'type':Sequelize[_0x388a('0x2')]},'port':{'type':Sequelize[_0x388a('0x4')]},'tls':{'type':Sequelize[_0x388a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x388a('0x2')],'defaultValue':_0x388a('0x5')},'connTimeout':{'type':Sequelize[_0x388a('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6dd0=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x6dd0,0x1b9));var _0x06dd=function(_0x5268b3,_0x78bf33){_0x5268b3=_0x5268b3-0x0;var _0x550d94=_0x6dd0[_0x5268b3];return _0x550d94;};'use strict';var Sequelize=require(_0x06dd('0x0'));module[_0x06dd('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x06dd('0x2')]},'authentication':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x06dd('0x2')]},'port':{'type':Sequelize[_0x06dd('0x4')]},'tls':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x06dd('0x2')],'defaultValue':_0x06dd('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x06dd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x06dd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e055c9e..d73e2fd 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 _0x123f=['../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4b06c1,_0x3faaf1){var _0x30cfa7=function(_0x5b625a){while(--_0x5b625a){_0x4b06c1['push'](_0x4b06c1['shift']());}};_0x30cfa7(++_0x3faaf1);}(_0x123f,0xc6));var _0xf123=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x123f[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0xf123('0x0'));var util=require(_0xf123('0x1'));var logger=require(_0xf123('0x2'))('api');var moment=require(_0xf123('0x3'));var BPromise=require('bluebird');var rp=require(_0xf123('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf123('0x5'));var config=require(_0xf123('0x6'));var attributes=require(_0xf123('0x7'));module[_0xf123('0x8')]=function(_0x41594b,_0x6f346f){return _0x41594b[_0xf123('0x9')](_0xf123('0xa'),attributes,{'tableName':_0xf123('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3da2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3da2,0x155));var _0x23da=function(_0x4ed869,_0xc6bc90){_0x4ed869=_0x4ed869-0x0;var _0xac2f37=_0x3da2[_0x4ed869];return _0xac2f37;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x23da('0x0'))(_0x23da('0x1'));var moment=require(_0x23da('0x2'));var BPromise=require(_0x23da('0x3'));var rp=require(_0x23da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23da('0x5'));var config=require(_0x23da('0x6'));var attributes=require(_0x23da('0x7'));module[_0x23da('0x8')]=function(_0x5f5dcf,_0x24dd6e){return _0x5f5dcf['define'](_0x23da('0x9'),attributes,{'tableName':_0x23da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 2988d1a..d00db4d 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 _0x613f=['message','result','catch','GetMailServerIn','MailServerIn','findAll','options','limit','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x24bfc4,_0x2e7491){var _0x212767=function(_0x5d756b){while(--_0x5d756b){_0x24bfc4['push'](_0x24bfc4['shift']());}};_0x212767(++_0x2e7491);}(_0x613f,0x6d));var _0xf613=function(_0x196eca,_0x80dd36){_0x196eca=_0x196eca-0x0;var _0x1a1e3a=_0x613f[_0x196eca];return _0x1a1e3a;};'use strict';var _=require(_0xf613('0x0'));var util=require(_0xf613('0x1'));var moment=require(_0xf613('0x2'));var BPromise=require(_0xf613('0x3'));var rs=require(_0xf613('0x4'));var fs=require('fs');var Redis=require(_0xf613('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf613('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf613('0x7'));var jayson=require(_0xf613('0x8'));var client=jayson[_0xf613('0x9')][_0xf613('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb2c12d,_0x4c25df,_0x446cb1){return new BPromise(function(_0x53ade4,_0x38d54a){return client['request'](_0xb2c12d,_0x446cb1)[_0xf613('0xb')](function(_0x49658d){logger[_0xf613('0xc')](_0xf613('0xd'),_0x4c25df,'request\x20sent');logger[_0xf613('0xe')](_0xf613('0xf'),_0x4c25df,_0xf613('0x10'),JSON['stringify'](_0x49658d));if(_0x49658d['error']){if(_0x49658d['error'][_0xf613('0x11')]===0x1f4){logger[_0xf613('0x12')](_0xf613('0xd'),_0x4c25df,_0x49658d[_0xf613('0x12')][_0xf613('0x13')]);return _0x38d54a(_0x49658d['error'][_0xf613('0x13')]);}logger[_0xf613('0x12')](_0xf613('0xd'),_0x4c25df,_0x49658d[_0xf613('0x12')]['message']);return _0x53ade4(_0x49658d[_0xf613('0x12')][_0xf613('0x13')]);}else{logger['info'](_0xf613('0xd'),_0x4c25df,_0xf613('0x10'));_0x53ade4(_0x49658d[_0xf613('0x14')][_0xf613('0x13')]);}})[_0xf613('0x15')](function(_0x2a0e13){logger[_0xf613('0x12')](_0xf613('0xd'),_0x4c25df,_0x2a0e13);_0x38d54a(_0x2a0e13);});});}exports[_0xf613('0x16')]=function(_0x1018b3){var _0x4c01c2=this;return new Promise(function(_0x27ce70,_0x3b8591){return db[_0xf613('0x17')][_0xf613('0x18')]({'raw':_0x1018b3[_0xf613('0x19')]?_0x1018b3[_0xf613('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1018b3['options']?_0x1018b3[_0xf613('0x19')]['where']||null:null,'attributes':_0x1018b3[_0xf613('0x19')]?_0x1018b3['options']['attributes']||null:null,'limit':_0x1018b3['options']?_0x1018b3[_0xf613('0x19')][_0xf613('0x1a')]||null:null,'include':_0x1018b3['options']?_0x1018b3[_0xf613('0x19')][_0xf613('0x1b')]?_[_0xf613('0x1c')](_0x1018b3[_0xf613('0x19')][_0xf613('0x1b')],function(_0x14322d){return{'model':db[_0x14322d[_0xf613('0x1d')]],'as':_0x14322d['as'],'attributes':_0x14322d[_0xf613('0x1e')],'include':_0x14322d[_0xf613('0x1b')]?_[_0xf613('0x1c')](_0x14322d[_0xf613('0x1b')],function(_0xea3914){return{'model':db[_0xea3914[_0xf613('0x1d')]],'as':_0xea3914['as'],'attributes':_0xea3914[_0xf613('0x1e')],'include':_0xea3914['include']?_['map'](_0xea3914['include'],function(_0x1d4af5){return{'model':db[_0x1d4af5[_0xf613('0x1d')]],'as':_0x1d4af5['as'],'attributes':_0x1d4af5['attributes']};}):[]};}):[]};}):[]:[]})[_0xf613('0xb')](function(_0xd72d78){logger['info']('GetMailServerIn',_0x1018b3);logger[_0xf613('0xe')](_0xf613('0x16'),_0x1018b3,JSON[_0xf613('0x1f')](_0xd72d78));_0x27ce70(_0xd72d78);})[_0xf613('0x15')](function(_0x16f977){logger['error'](_0xf613('0x16'),_0x16f977[_0xf613('0x13')],_0x1018b3);_0x3b8591(_0x4c01c2[_0xf613('0x12')](0x1f4,_0x16f977[_0xf613('0x13')]));});});}; \ No newline at end of file +var _0xb20b=['map','include','model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit'];(function(_0x5e2cb4,_0x592c64){var _0x282902=function(_0x1c1836){while(--_0x1c1836){_0x5e2cb4['push'](_0x5e2cb4['shift']());}};_0x282902(++_0x592c64);}(_0xb20b,0x1b4));var _0xbb20=function(_0x3f5b60,_0x191d39){_0x3f5b60=_0x3f5b60-0x0;var _0x36efbb=_0xb20b[_0x3f5b60];return _0x36efbb;};'use strict';var _=require(_0xbb20('0x0'));var util=require(_0xbb20('0x1'));var moment=require(_0xbb20('0x2'));var BPromise=require(_0xbb20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb20('0x4'));var db=require(_0xbb20('0x5'))['db'];var utils=require(_0xbb20('0x6'));var logger=require('../../config/logger')(_0xbb20('0x7'));var config=require(_0xbb20('0x8'));var jayson=require(_0xbb20('0x9'));var client=jayson[_0xbb20('0xa')][_0xbb20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x192db2,_0x2b2864,_0x3b8a48){return new BPromise(function(_0x227289,_0x5f305f){return client[_0xbb20('0xc')](_0x192db2,_0x3b8a48)[_0xbb20('0xd')](function(_0x34677e){logger[_0xbb20('0xe')]('MailServerIn,\x20%s,\x20%s',_0x2b2864,'request\x20sent');logger[_0xbb20('0xf')](_0xbb20('0x10'),_0x2b2864,_0xbb20('0x11'),JSON[_0xbb20('0x12')](_0x34677e));if(_0x34677e[_0xbb20('0x13')]){if(_0x34677e[_0xbb20('0x13')][_0xbb20('0x14')]===0x1f4){logger[_0xbb20('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2b2864,_0x34677e[_0xbb20('0x13')][_0xbb20('0x15')]);return _0x5f305f(_0x34677e['error'][_0xbb20('0x15')]);}logger[_0xbb20('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2b2864,_0x34677e['error'][_0xbb20('0x15')]);return _0x227289(_0x34677e[_0xbb20('0x13')]['message']);}else{logger[_0xbb20('0xe')](_0xbb20('0x16'),_0x2b2864,_0xbb20('0x11'));_0x227289(_0x34677e[_0xbb20('0x17')]['message']);}})[_0xbb20('0x18')](function(_0x3fb302){logger[_0xbb20('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2b2864,_0x3fb302);_0x5f305f(_0x3fb302);});});}exports[_0xbb20('0x19')]=function(_0x5c6662){var _0x384e15=this;return new Promise(function(_0x3fa39a,_0x176e84){return db[_0xbb20('0x1a')][_0xbb20('0x1b')]({'raw':_0x5c6662[_0xbb20('0x1c')]?_0x5c6662['options'][_0xbb20('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c6662[_0xbb20('0x1c')]?_0x5c6662[_0xbb20('0x1c')][_0xbb20('0x1e')]||null:null,'attributes':_0x5c6662['options']?_0x5c6662[_0xbb20('0x1c')]['attributes']||null:null,'limit':_0x5c6662[_0xbb20('0x1c')]?_0x5c6662[_0xbb20('0x1c')][_0xbb20('0x1f')]||null:null,'include':_0x5c6662[_0xbb20('0x1c')]?_0x5c6662[_0xbb20('0x1c')]['include']?_[_0xbb20('0x20')](_0x5c6662[_0xbb20('0x1c')][_0xbb20('0x21')],function(_0x382d2a){return{'model':db[_0x382d2a[_0xbb20('0x22')]],'as':_0x382d2a['as'],'attributes':_0x382d2a[_0xbb20('0x23')],'include':_0x382d2a[_0xbb20('0x21')]?_[_0xbb20('0x20')](_0x382d2a[_0xbb20('0x21')],function(_0x2d8b45){return{'model':db[_0x2d8b45[_0xbb20('0x22')]],'as':_0x2d8b45['as'],'attributes':_0x2d8b45[_0xbb20('0x23')],'include':_0x2d8b45[_0xbb20('0x21')]?_['map'](_0x2d8b45['include'],function(_0x542084){return{'model':db[_0x542084[_0xbb20('0x22')]],'as':_0x542084['as'],'attributes':_0x542084['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c1196){logger[_0xbb20('0xe')]('GetMailServerIn',_0x5c6662);logger[_0xbb20('0xf')](_0xbb20('0x19'),_0x5c6662,JSON[_0xbb20('0x12')](_0x3c1196));_0x3fa39a(_0x3c1196);})[_0xbb20('0x18')](function(_0x1282c6){logger[_0xbb20('0x13')](_0xbb20('0x19'),_0x1282c6[_0xbb20('0x15')],_0x5c6662);_0x176e84(_0x384e15[_0xbb20('0x13')](0x1f4,_0x1282c6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4812a9a..a1a9e4d 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x305a3e,_0x407c41){_0x305a3e=_0x305a3e-0x0;var _0x509ab0=_0x7a54[_0x305a3e];return _0x509ab0;};'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 dd4aa0b..6b71448 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 _0x878f=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x103e4d,_0x4ba142){var _0x244a31=function(_0x4c1a61){while(--_0x4c1a61){_0x103e4d['push'](_0x103e4d['shift']());}};_0x244a31(++_0x4ba142);}(_0x878f,0x173));var _0xf878=function(_0xf9f437,_0xf1470f){_0xf9f437=_0xf9f437-0x0;var _0x4cd51e=_0x878f[_0xf9f437];return _0x4cd51e;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'description':{'type':Sequelize[_0xf878('0x1')]},'host':{'type':Sequelize[_0xf878('0x1')]},'user':{'type':Sequelize[_0xf878('0x1')]},'pass':{'type':Sequelize[_0xf878('0x1')]},'port':{'type':Sequelize[_0xf878('0x2')]},'secure':{'type':Sequelize[_0xf878('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xf878('0x1')]},'authentication':{'type':Sequelize[_0xf878('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xf878('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x757a=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x10985f,_0x8ba2c5){var _0x6fea68=function(_0x1d2a89){while(--_0x1d2a89){_0x10985f['push'](_0x10985f['shift']());}};_0x6fea68(++_0x8ba2c5);}(_0x757a,0xde));var _0xa757=function(_0x1f3ff6,_0x5d97b9){_0x1f3ff6=_0x1f3ff6-0x0;var _0x12b84f=_0x757a[_0x1f3ff6];return _0x12b84f;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa757('0x2')]},'secure':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa757('0x1')]},'authentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index b143004..c9c5fc9 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 _0x59d8=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','MailServerOut','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','params','merge','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3fcdf5,_0x503ca0){var _0x2d0786=function(_0x1ee5e2){while(--_0x1ee5e2){_0x3fcdf5['push'](_0x3fcdf5['shift']());}};_0x2d0786(++_0x503ca0);}(_0x59d8,0x11d));var _0x859d=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0x59d8[_0x3b594b];return _0x1ea5f8;};'use strict';var emlformat=require(_0x859d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x859d('0x1'));var jsonpatch=require(_0x859d('0x2'));var rp=require(_0x859d('0x3'));var moment=require(_0x859d('0x4'));var BPromise=require(_0x859d('0x5'));var Mustache=require(_0x859d('0x6'));var util=require(_0x859d('0x7'));var path=require(_0x859d('0x8'));var sox=require(_0x859d('0x9'));var csv=require('to-csv');var ejs=require(_0x859d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x859d('0xb'));var squel=require('squel');var crypto=require(_0x859d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x859d('0xd'));var toCsv=require(_0x859d('0xe'));var querystring=require(_0x859d('0xf'));var Papa=require(_0x859d('0x10'));var Redis=require(_0x859d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x859d('0x12'));var as=require(_0x859d('0x13'));var hardwareService=require(_0x859d('0x14'));var logger=require('../../config/logger')(_0x859d('0x15'));var utils=require(_0x859d('0x16'));var config=require(_0x859d('0x17'));var licenseUtil=require(_0x859d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c769f,_0x53c7c3){_0x53c7c3=_0x53c7c3||0xcc;return function(_0x26f242){if(_0x26f242){return _0x3c769f[_0x859d('0x19')](_0x53c7c3);}return _0x3c769f[_0x859d('0x1a')](_0x53c7c3)[_0x859d('0x1b')]();};}function respondWithResult(_0x5802cf,_0x318b9f){_0x318b9f=_0x318b9f||0xc8;return function(_0x3dd987){if(_0x3dd987){return _0x5802cf['status'](_0x318b9f)[_0x859d('0x1c')](_0x3dd987);}};}function respondWithFilteredResult(_0x45ac4c,_0x1aae19){return function(_0x36ccf5){if(_0x36ccf5){var _0xb3789d=typeof _0x1aae19[_0x859d('0x1d')]==='undefined'&&typeof _0x1aae19['limit']===_0x859d('0x1e');var _0x553556=_0x36ccf5[_0x859d('0x1f')];var _0x48754f=_0xb3789d?0x0:_0x1aae19[_0x859d('0x1d')];var _0xeac4b8=_0xb3789d?_0x36ccf5[_0x859d('0x1f')]:_0x1aae19['offset']+_0x1aae19[_0x859d('0x20')];var _0x405000;if(_0xeac4b8>=_0x553556){_0xeac4b8=_0x553556;_0x405000=0xc8;}else{_0x405000=0xce;}_0x45ac4c['status'](_0x405000);return _0x45ac4c[_0x859d('0x21')](_0x859d('0x22'),_0x48754f+'-'+_0xeac4b8+'/'+_0x553556)[_0x859d('0x1c')](_0x36ccf5);}return null;};}function patchUpdates(_0x1d26bd){return function(_0x453257){try{jsonpatch[_0x859d('0x23')](_0x453257,_0x1d26bd,!![]);}catch(_0x568710){return BPromise[_0x859d('0x24')](_0x568710);}return _0x453257[_0x859d('0x25')]();};}function saveUpdates(_0x49a269,_0x1d9c81){return function(_0x1776c2){if(_0x1776c2){return _0x1776c2[_0x859d('0x26')](_0x49a269)[_0x859d('0x27')](function(_0x4e552d){return _0x4e552d;});}return null;};}function removeEntity(_0x1dd280,_0x4a3bd7){return function(_0xbf5cf2){if(_0xbf5cf2){return _0xbf5cf2['destroy']()[_0x859d('0x27')](function(){_0x1dd280[_0x859d('0x1a')](0xcc)[_0x859d('0x1b')]();});}};}function handleEntityNotFound(_0x3831be,_0x2be4b3){return function(_0x906ed4){if(!_0x906ed4){_0x3831be['sendStatus'](0x194);}return _0x906ed4;};}function handleError(_0x4461d0,_0x5c9c8f){_0x5c9c8f=_0x5c9c8f||0x1f4;return function(_0x2b9ff7){logger[_0x859d('0x28')](_0x2b9ff7[_0x859d('0x29')]);if(_0x2b9ff7[_0x859d('0x2a')]){delete _0x2b9ff7[_0x859d('0x2a')];}_0x4461d0[_0x859d('0x1a')](_0x5c9c8f)[_0x859d('0x2b')](_0x2b9ff7);};}exports[_0x859d('0x2c')]=function(_0x4c69d9,_0x21289c){var _0x3238c4={},_0x505c09={},_0x1cf317={'count':0x0,'rows':[]};var _0x3c07e7=_[_0x859d('0x2d')](db[_0x859d('0x2e')]['rawAttributes'],function(_0x2a2cc4){return{'name':_0x2a2cc4[_0x859d('0x2f')],'type':_0x2a2cc4['type'][_0x859d('0x30')]};});_0x505c09[_0x859d('0x31')]=_['map'](_0x3c07e7,_0x859d('0x2a'));_0x505c09['query']=_[_0x859d('0x32')](_0x4c69d9[_0x859d('0x33')]);_0x505c09[_0x859d('0x34')]=_[_0x859d('0x35')](_0x505c09[_0x859d('0x31')],_0x505c09[_0x859d('0x33')]);_0x3238c4['attributes']=_['intersection'](_0x505c09['model'],qs['fields'](_0x4c69d9[_0x859d('0x33')][_0x859d('0x36')]));_0x3238c4['attributes']=_0x3238c4[_0x859d('0x37')][_0x859d('0x38')]?_0x3238c4[_0x859d('0x37')]:_0x505c09[_0x859d('0x31')];if(!_0x4c69d9[_0x859d('0x33')][_0x859d('0x39')](_0x859d('0x3a'))){_0x3238c4[_0x859d('0x20')]=qs['limit'](_0x4c69d9[_0x859d('0x33')][_0x859d('0x20')]);_0x3238c4[_0x859d('0x1d')]=qs['offset'](_0x4c69d9[_0x859d('0x33')][_0x859d('0x1d')]);}_0x3238c4[_0x859d('0x3b')]=qs[_0x859d('0x3c')](_0x4c69d9[_0x859d('0x33')][_0x859d('0x3c')]);_0x3238c4[_0x859d('0x3d')]=qs[_0x859d('0x34')](_[_0x859d('0x3e')](_0x4c69d9['query'],_0x505c09[_0x859d('0x34')]),_0x3c07e7);if(_0x4c69d9['query'][_0x859d('0x3f')]){_0x3238c4['where']=_['merge'](_0x3238c4['where'],{'$or':_[_0x859d('0x2d')](_0x3c07e7,function(_0x5b2aa9){if(_0x5b2aa9['type']!=='VIRTUAL'){var _0x59e9f9={};_0x59e9f9[_0x5b2aa9[_0x859d('0x2a')]]={'$like':'%'+_0x4c69d9[_0x859d('0x33')][_0x859d('0x3f')]+'%'};return _0x59e9f9;}})});}_0x3238c4=_['merge']({},_0x3238c4,_0x4c69d9[_0x859d('0x40')]);var _0x2e1988={'where':_0x3238c4[_0x859d('0x3d')]};return db[_0x859d('0x2e')][_0x859d('0x1f')](_0x2e1988)[_0x859d('0x27')](function(_0x5ec124){_0x1cf317[_0x859d('0x1f')]=_0x5ec124;if(_0x4c69d9[_0x859d('0x33')][_0x859d('0x41')]){_0x3238c4[_0x859d('0x42')]=[{'all':!![]}];}return db['MailServerOut'][_0x859d('0x43')](_0x3238c4);})[_0x859d('0x27')](function(_0x18958d){_0x1cf317[_0x859d('0x44')]=_0x18958d;return _0x1cf317;})[_0x859d('0x27')](respondWithFilteredResult(_0x21289c,_0x3238c4))['catch'](handleError(_0x21289c,null));};exports['show']=function(_0x282fad,_0x53049c){var _0x40c0a3={'raw':!![],'where':{'id':_0x282fad[_0x859d('0x45')]['id']}},_0x41f246={};_0x41f246[_0x859d('0x31')]=_[_0x859d('0x32')](db[_0x859d('0x2e')]['rawAttributes']);_0x41f246['query']=_[_0x859d('0x32')](_0x282fad[_0x859d('0x33')]);_0x41f246[_0x859d('0x34')]=_[_0x859d('0x35')](_0x41f246[_0x859d('0x31')],_0x41f246['query']);_0x40c0a3['attributes']=_[_0x859d('0x35')](_0x41f246['model'],qs[_0x859d('0x36')](_0x282fad[_0x859d('0x33')]['fields']));_0x40c0a3[_0x859d('0x37')]=_0x40c0a3['attributes'][_0x859d('0x38')]?_0x40c0a3['attributes']:_0x41f246[_0x859d('0x31')];if(_0x282fad[_0x859d('0x33')][_0x859d('0x41')]){_0x40c0a3['include']=[{'all':!![]}];}_0x40c0a3=_[_0x859d('0x46')]({},_0x40c0a3,_0x282fad[_0x859d('0x40')]);return db['MailServerOut'][_0x859d('0x47')](_0x40c0a3)[_0x859d('0x27')](handleEntityNotFound(_0x53049c,null))['then'](respondWithResult(_0x53049c,null))[_0x859d('0x48')](handleError(_0x53049c,null));};exports['create']=function(_0x195596,_0x547715){return db[_0x859d('0x2e')][_0x859d('0x49')](_0x195596[_0x859d('0x4a')],{})['then'](respondWithResult(_0x547715,0xc9))['catch'](handleError(_0x547715,null));};exports['update']=function(_0x4f1b46,_0x1cc3e5){if(_0x4f1b46[_0x859d('0x4a')]['id']){delete _0x4f1b46['body']['id'];}return db[_0x859d('0x2e')]['find']({'where':{'id':_0x4f1b46['params']['id']}})[_0x859d('0x27')](handleEntityNotFound(_0x1cc3e5,null))[_0x859d('0x27')](saveUpdates(_0x4f1b46[_0x859d('0x4a')],null))['then'](respondWithResult(_0x1cc3e5,null))['catch'](handleError(_0x1cc3e5,null));};exports[_0x859d('0x4b')]=function(_0x28dd95,_0xba745c){return db['MailServerOut'][_0x859d('0x47')]({'where':{'id':_0x28dd95[_0x859d('0x45')]['id']}})[_0x859d('0x27')](handleEntityNotFound(_0xba745c,null))[_0x859d('0x27')](removeEntity(_0xba745c,null))[_0x859d('0x48')](handleError(_0xba745c,null));}; \ No newline at end of file +var _0x2262=['squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x477038,_0x5f27f4){var _0x42c9de=function(_0x214b01){while(--_0x214b01){_0x477038['push'](_0x477038['shift']());}};_0x42c9de(++_0x5f27f4);}(_0x2262,0xd6));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2226('0x0'));var rimraf=require(_0x2226('0x1'));var zipdir=require(_0x2226('0x2'));var jsonpatch=require(_0x2226('0x3'));var rp=require(_0x2226('0x4'));var moment=require('moment');var BPromise=require(_0x2226('0x5'));var Mustache=require('mustache');var util=require(_0x2226('0x6'));var path=require(_0x2226('0x7'));var sox=require('sox');var csv=require(_0x2226('0x8'));var ejs=require(_0x2226('0x9'));var fs=require('fs');var fs_extra=require(_0x2226('0xa'));var _=require('lodash');var squel=require(_0x2226('0xb'));var crypto=require(_0x2226('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2226('0xd'));var toCsv=require(_0x2226('0x8'));var querystring=require(_0x2226('0xe'));var Papa=require('papaparse');var Redis=require(_0x2226('0xf'));var authService=require(_0x2226('0x10'));var qs=require(_0x2226('0x11'));var as=require(_0x2226('0x12'));var hardwareService=require(_0x2226('0x13'));var logger=require(_0x2226('0x14'))('api');var utils=require(_0x2226('0x15'));var config=require(_0x2226('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2226('0x17'))['db'];function respondWithStatusCode(_0x40b3b2,_0x4c9a89){_0x4c9a89=_0x4c9a89||0xcc;return function(_0x3d0070){if(_0x3d0070){return _0x40b3b2['sendStatus'](_0x4c9a89);}return _0x40b3b2[_0x2226('0x18')](_0x4c9a89)[_0x2226('0x19')]();};}function respondWithResult(_0x53d046,_0x54712c){_0x54712c=_0x54712c||0xc8;return function(_0x239254){if(_0x239254){return _0x53d046[_0x2226('0x18')](_0x54712c)[_0x2226('0x1a')](_0x239254);}};}function respondWithFilteredResult(_0x287b42,_0x1ddc38){return function(_0x389a1e){if(_0x389a1e){var _0x402fe6=typeof _0x1ddc38['offset']===_0x2226('0x1b')&&typeof _0x1ddc38[_0x2226('0x1c')]===_0x2226('0x1b');var _0x5bcaab=_0x389a1e[_0x2226('0x1d')];var _0xa2448f=_0x402fe6?0x0:_0x1ddc38[_0x2226('0x1e')];var _0x107efc=_0x402fe6?_0x389a1e['count']:_0x1ddc38[_0x2226('0x1e')]+_0x1ddc38[_0x2226('0x1c')];var _0x2c3f2e;if(_0x107efc>=_0x5bcaab){_0x107efc=_0x5bcaab;_0x2c3f2e=0xc8;}else{_0x2c3f2e=0xce;}_0x287b42[_0x2226('0x18')](_0x2c3f2e);return _0x287b42[_0x2226('0x1f')](_0x2226('0x20'),_0xa2448f+'-'+_0x107efc+'/'+_0x5bcaab)[_0x2226('0x1a')](_0x389a1e);}return null;};}function patchUpdates(_0x26a2db){return function(_0x463ef4){try{jsonpatch[_0x2226('0x21')](_0x463ef4,_0x26a2db,!![]);}catch(_0xbfb836){return BPromise[_0x2226('0x22')](_0xbfb836);}return _0x463ef4[_0x2226('0x23')]();};}function saveUpdates(_0x52819d,_0xbd8b2b){return function(_0x4ab733){if(_0x4ab733){return _0x4ab733['update'](_0x52819d)[_0x2226('0x24')](function(_0x1e2eb4){return _0x1e2eb4;});}return null;};}function removeEntity(_0x22e7f4,_0xac11fc){return function(_0x1ae2e9){if(_0x1ae2e9){return _0x1ae2e9[_0x2226('0x25')]()[_0x2226('0x24')](function(){_0x22e7f4[_0x2226('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2461a3,_0x39ffbd){return function(_0x210ef0){if(!_0x210ef0){_0x2461a3[_0x2226('0x26')](0x194);}return _0x210ef0;};}function handleError(_0x573bc1,_0xea98f2){_0xea98f2=_0xea98f2||0x1f4;return function(_0x610789){logger[_0x2226('0x27')](_0x610789['stack']);if(_0x610789[_0x2226('0x28')]){delete _0x610789[_0x2226('0x28')];}_0x573bc1[_0x2226('0x18')](_0xea98f2)[_0x2226('0x29')](_0x610789);};}exports[_0x2226('0x2a')]=function(_0xa8f3a2,_0x229fe7){var _0xa2b446={},_0x540a02={},_0x4f24d9={'count':0x0,'rows':[]};var _0x5c66bb=_[_0x2226('0x2b')](db[_0x2226('0x2c')][_0x2226('0x2d')],function(_0x2108ab){return{'name':_0x2108ab[_0x2226('0x2e')],'type':_0x2108ab[_0x2226('0x2f')][_0x2226('0x30')]};});_0x540a02[_0x2226('0x31')]=_[_0x2226('0x2b')](_0x5c66bb,_0x2226('0x28'));_0x540a02[_0x2226('0x32')]=_[_0x2226('0x33')](_0xa8f3a2['query']);_0x540a02['filters']=_[_0x2226('0x34')](_0x540a02['model'],_0x540a02[_0x2226('0x32')]);_0xa2b446[_0x2226('0x35')]=_[_0x2226('0x34')](_0x540a02[_0x2226('0x31')],qs[_0x2226('0x36')](_0xa8f3a2['query'][_0x2226('0x36')]));_0xa2b446[_0x2226('0x35')]=_0xa2b446[_0x2226('0x35')][_0x2226('0x37')]?_0xa2b446[_0x2226('0x35')]:_0x540a02['model'];if(!_0xa8f3a2['query'][_0x2226('0x38')](_0x2226('0x39'))){_0xa2b446['limit']=qs[_0x2226('0x1c')](_0xa8f3a2[_0x2226('0x32')]['limit']);_0xa2b446[_0x2226('0x1e')]=qs['offset'](_0xa8f3a2[_0x2226('0x32')][_0x2226('0x1e')]);}_0xa2b446[_0x2226('0x3a')]=qs[_0x2226('0x3b')](_0xa8f3a2['query'][_0x2226('0x3b')]);_0xa2b446[_0x2226('0x3c')]=qs[_0x2226('0x3d')](_[_0x2226('0x3e')](_0xa8f3a2[_0x2226('0x32')],_0x540a02[_0x2226('0x3d')]),_0x5c66bb);if(_0xa8f3a2[_0x2226('0x32')]['filter']){_0xa2b446[_0x2226('0x3c')]=_['merge'](_0xa2b446[_0x2226('0x3c')],{'$or':_[_0x2226('0x2b')](_0x5c66bb,function(_0x5b3c06){if(_0x5b3c06[_0x2226('0x2f')]!==_0x2226('0x3f')){var _0x34971d={};_0x34971d[_0x5b3c06[_0x2226('0x28')]]={'$like':'%'+_0xa8f3a2[_0x2226('0x32')][_0x2226('0x40')]+'%'};return _0x34971d;}})});}_0xa2b446=_[_0x2226('0x41')]({},_0xa2b446,_0xa8f3a2[_0x2226('0x42')]);var _0x2c182e={'where':_0xa2b446['where']};return db['MailServerOut'][_0x2226('0x1d')](_0x2c182e)[_0x2226('0x24')](function(_0x2aebf2){_0x4f24d9[_0x2226('0x1d')]=_0x2aebf2;if(_0xa8f3a2[_0x2226('0x32')][_0x2226('0x43')]){_0xa2b446[_0x2226('0x44')]=[{'all':!![]}];}return db[_0x2226('0x2c')]['findAll'](_0xa2b446);})['then'](function(_0x1b52cd){_0x4f24d9['rows']=_0x1b52cd;return _0x4f24d9;})[_0x2226('0x24')](respondWithFilteredResult(_0x229fe7,_0xa2b446))[_0x2226('0x45')](handleError(_0x229fe7,null));};exports[_0x2226('0x46')]=function(_0x48033d,_0x3d2887){var _0x1a743c={'raw':!![],'where':{'id':_0x48033d['params']['id']}},_0x374d95={};_0x374d95[_0x2226('0x31')]=_[_0x2226('0x33')](db[_0x2226('0x2c')][_0x2226('0x2d')]);_0x374d95['query']=_[_0x2226('0x33')](_0x48033d['query']);_0x374d95[_0x2226('0x3d')]=_[_0x2226('0x34')](_0x374d95[_0x2226('0x31')],_0x374d95[_0x2226('0x32')]);_0x1a743c[_0x2226('0x35')]=_[_0x2226('0x34')](_0x374d95[_0x2226('0x31')],qs['fields'](_0x48033d[_0x2226('0x32')][_0x2226('0x36')]));_0x1a743c['attributes']=_0x1a743c[_0x2226('0x35')][_0x2226('0x37')]?_0x1a743c[_0x2226('0x35')]:_0x374d95[_0x2226('0x31')];if(_0x48033d[_0x2226('0x32')][_0x2226('0x43')]){_0x1a743c[_0x2226('0x44')]=[{'all':!![]}];}_0x1a743c=_[_0x2226('0x41')]({},_0x1a743c,_0x48033d[_0x2226('0x42')]);return db[_0x2226('0x2c')][_0x2226('0x47')](_0x1a743c)[_0x2226('0x24')](handleEntityNotFound(_0x3d2887,null))['then'](respondWithResult(_0x3d2887,null))[_0x2226('0x45')](handleError(_0x3d2887,null));};exports[_0x2226('0x48')]=function(_0x51f93b,_0x5779b3){return db['MailServerOut'][_0x2226('0x48')](_0x51f93b[_0x2226('0x49')],{})[_0x2226('0x24')](respondWithResult(_0x5779b3,0xc9))[_0x2226('0x45')](handleError(_0x5779b3,null));};exports['update']=function(_0x29a169,_0x4ef99b){if(_0x29a169[_0x2226('0x49')]['id']){delete _0x29a169[_0x2226('0x49')]['id'];}return db[_0x2226('0x2c')][_0x2226('0x47')]({'where':{'id':_0x29a169[_0x2226('0x4a')]['id']}})[_0x2226('0x24')](handleEntityNotFound(_0x4ef99b,null))[_0x2226('0x24')](saveUpdates(_0x29a169[_0x2226('0x49')],null))['then'](respondWithResult(_0x4ef99b,null))['catch'](handleError(_0x4ef99b,null));};exports[_0x2226('0x25')]=function(_0x47f6cc,_0x4579fe){return db[_0x2226('0x2c')][_0x2226('0x47')]({'where':{'id':_0x47f6cc[_0x2226('0x4a')]['id']}})[_0x2226('0x24')](handleEntityNotFound(_0x4579fe,null))[_0x2226('0x24')](removeEntity(_0x4579fe,null))[_0x2226('0x45')](handleError(_0x4579fe,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 31dabb7..04a57b9 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 _0x9c1d=['define','MailServerOut','lodash','util','../../config/logger','moment','bluebird','rimraf','exports'];(function(_0x4bcbc2,_0x46cbff){var _0xe5b888=function(_0xd3a99d){while(--_0xd3a99d){_0x4bcbc2['push'](_0x4bcbc2['shift']());}};_0xe5b888(++_0x46cbff);}(_0x9c1d,0x13d));var _0xd9c1=function(_0x2be403,_0x53977d){_0x2be403=_0x2be403-0x0;var _0x189eaa=_0x9c1d[_0x2be403];return _0x189eaa;};'use strict';var _=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var logger=require(_0xd9c1('0x2'))('api');var moment=require(_0xd9c1('0x3'));var BPromise=require(_0xd9c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd9c1('0x5'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xd9c1('0x6')]=function(_0x27fe57,_0x3e7a9c){return _0x27fe57[_0xd9c1('0x7')](_0xd9c1('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c5=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird'];(function(_0xf48da1,_0x4bb9bd){var _0xc77595=function(_0x2d5874){while(--_0x2d5874){_0xf48da1['push'](_0xf48da1['shift']());}};_0xc77595(++_0x4bb9bd);}(_0xe0c5,0x1ad));var _0x5e0c=function(_0x56a55f,_0x2495da){_0x56a55f=_0x56a55f-0x0;var _0x367daa=_0xe0c5[_0x56a55f];return _0x367daa;};'use strict';var _=require(_0x5e0c('0x0'));var util=require(_0x5e0c('0x1'));var logger=require(_0x5e0c('0x2'))('api');var moment=require(_0x5e0c('0x3'));var BPromise=require(_0x5e0c('0x4'));var rp=require(_0x5e0c('0x5'));var fs=require('fs');var path=require(_0x5e0c('0x6'));var rimraf=require(_0x5e0c('0x7'));var config=require(_0x5e0c('0x8'));var attributes=require(_0x5e0c('0x9'));module[_0x5e0c('0xa')]=function(_0x4d079f,_0xb6125c){return _0x4d079f[_0x5e0c('0xb')](_0x5e0c('0xc'),attributes,{'tableName':_0x5e0c('0xd'),'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 757ec98..9fc3ba8 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2d97a6,_0x3933a5){var _0xcfa4a7=function(_0x274662){while(--_0x274662){_0x2d97a6['push'](_0x2d97a6['shift']());}};_0xcfa4a7(++_0x3933a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cadc4,_0x1257ab){_0x4cadc4=_0x4cadc4-0x0;var _0x590d3c=_0x5f2f[_0x4cadc4];return _0x590d3c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x11336b,_0x509309){var _0x9ce5cf=function(_0x2e8b94){while(--_0x2e8b94){_0x11336b['push'](_0x11336b['shift']());}};_0x9ce5cf(++_0x509309);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b58e2,_0x4fbf5f){_0x3b58e2=_0x3b58e2-0x0;var _0x5a6677=_0x5f2f[_0x3b58e2];return _0x5a6677;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 5b83d10..acecaba 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 _0x78eb=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','/:id','show','post','create','put','delete','exports','multer','util'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x78eb,0x7c));var _0xb78e=function(_0x522be5,_0x364142){_0x522be5=_0x522be5-0x0;var _0x36793e=_0x78eb[_0x522be5];return _0x36793e;};'use strict';var multer=require(_0xb78e('0x0'));var util=require(_0xb78e('0x1'));var path=require('path');var timeout=require(_0xb78e('0x2'));var express=require(_0xb78e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb78e('0x4'));var interaction=require(_0xb78e('0x5'));var config=require(_0xb78e('0x6'));var controller=require(_0xb78e('0x7'));router['get']('/',auth[_0xb78e('0x8')](),controller['index']);router[_0xb78e('0x9')](_0xb78e('0xa'),auth[_0xb78e('0x8')](),controller['describe']);router[_0xb78e('0x9')](_0xb78e('0xb'),auth[_0xb78e('0x8')](),controller[_0xb78e('0xc')]);router[_0xb78e('0xd')]('/',auth['isAuthenticated'](),controller[_0xb78e('0xe')]);router[_0xb78e('0xf')]('/:id',auth[_0xb78e('0x8')](),controller['update']);router[_0xb78e('0x10')](_0xb78e('0xb'),auth[_0xb78e('0x8')](),controller['destroy']);module[_0xb78e('0x11')]=router; \ No newline at end of file +var _0xb30c=['Router','../../config/environment','./mailSubstatus.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x54020b,_0x17793d){var _0x2823ed=function(_0x241d0b){while(--_0x241d0b){_0x54020b['push'](_0x54020b['shift']());}};_0x2823ed(++_0x17793d);}(_0xb30c,0x13e));var _0xcb30=function(_0x398817,_0x3f26be){_0x398817=_0x398817-0x0;var _0x1fe0bb=_0xb30c[_0x398817];return _0x1fe0bb;};'use strict';var multer=require(_0xcb30('0x0'));var util=require(_0xcb30('0x1'));var path=require(_0xcb30('0x2'));var timeout=require(_0xcb30('0x3'));var express=require(_0xcb30('0x4'));var router=express[_0xcb30('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb30('0x6'));var controller=require(_0xcb30('0x7'));router[_0xcb30('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb30('0x8')](_0xcb30('0x9'),auth[_0xcb30('0xa')](),controller['describe']);router[_0xcb30('0x8')](_0xcb30('0xb'),auth[_0xcb30('0xa')](),controller[_0xcb30('0xc')]);router[_0xcb30('0xd')]('/',auth['isAuthenticated'](),controller[_0xcb30('0xe')]);router[_0xcb30('0xf')]('/:id',auth[_0xcb30('0xa')](),controller['update']);router[_0xcb30('0x10')](_0xcb30('0xb'),auth[_0xcb30('0xa')](),controller[_0xcb30('0x11')]);module[_0xcb30('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index dc33f4b..7a3784c 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 _0xcca7=['STRING','name','sequelize','exports'];(function(_0x35a779,_0x27f8fb){var _0xca723b=function(_0x298df7){while(--_0x298df7){_0x35a779['push'](_0x35a779['shift']());}};_0xca723b(++_0x27f8fb);}(_0xcca7,0x1aa));var _0x7cca=function(_0x314656,_0x556548){_0x314656=_0x314656-0x0;var _0x51d05e=_0xcca7[_0x314656];return _0x51d05e;};'use strict';var Sequelize=require(_0x7cca('0x0'));module[_0x7cca('0x1')]={'name':{'type':Sequelize[_0x7cca('0x2')],'unique':_0x7cca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf98=['STRING','sequelize'];(function(_0x2f3ebc,_0x1616fb){var _0x29505a=function(_0x321e84){while(--_0x321e84){_0x2f3ebc['push'](_0x2f3ebc['shift']());}};_0x29505a(++_0x1616fb);}(_0xdf98,0xcf));var _0x8df9=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xdf98[_0x3cb30b];return _0x2ca717;};'use strict';var Sequelize=require(_0x8df9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8df9('0x1')],'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 fa971d7..ad5a245 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 _0x035e=['api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send','map','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','options','MailSubstatus','includeAll','include','findAll','catch','show','params','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x243f65,_0x25d5b6){var _0x2d919f=function(_0x537f85){while(--_0x537f85){_0x243f65['push'](_0x243f65['shift']());}};_0x2d919f(++_0x25d5b6);}(_0x035e,0x113));var _0xe035=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x035e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe035('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe035('0x1'));var jsonpatch=require(_0xe035('0x2'));var rp=require('request-promise');var moment=require(_0xe035('0x3'));var BPromise=require(_0xe035('0x4'));var Mustache=require(_0xe035('0x5'));var util=require(_0xe035('0x6'));var path=require(_0xe035('0x7'));var sox=require(_0xe035('0x8'));var csv=require(_0xe035('0x9'));var ejs=require(_0xe035('0xa'));var fs=require('fs');var fs_extra=require(_0xe035('0xb'));var _=require('lodash');var squel=require(_0xe035('0xc'));var crypto=require(_0xe035('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe035('0x9'));var querystring=require(_0xe035('0xe'));var Papa=require(_0xe035('0xf'));var Redis=require(_0xe035('0x10'));var authService=require(_0xe035('0x11'));var qs=require(_0xe035('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe035('0x13'));var logger=require(_0xe035('0x14'))(_0xe035('0x15'));var utils=require(_0xe035('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe035('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22aa18,_0x2d8449){_0x2d8449=_0x2d8449||0xcc;return function(_0x408cf1){if(_0x408cf1){return _0x22aa18[_0xe035('0x18')](_0x2d8449);}return _0x22aa18[_0xe035('0x19')](_0x2d8449)[_0xe035('0x1a')]();};}function respondWithResult(_0xad6070,_0x2c71f0){_0x2c71f0=_0x2c71f0||0xc8;return function(_0x282e22){if(_0x282e22){return _0xad6070[_0xe035('0x19')](_0x2c71f0)[_0xe035('0x1b')](_0x282e22);}};}function respondWithFilteredResult(_0x157d38,_0x3964c6){return function(_0x35d353){if(_0x35d353){var _0xd37541=typeof _0x3964c6[_0xe035('0x1c')]===_0xe035('0x1d')&&typeof _0x3964c6['limit']===_0xe035('0x1d');var _0x481f66=_0x35d353[_0xe035('0x1e')];var _0x4bf696=_0xd37541?0x0:_0x3964c6[_0xe035('0x1c')];var _0x798bf8=_0xd37541?_0x35d353[_0xe035('0x1e')]:_0x3964c6[_0xe035('0x1c')]+_0x3964c6[_0xe035('0x1f')];var _0x526161;if(_0x798bf8>=_0x481f66){_0x798bf8=_0x481f66;_0x526161=0xc8;}else{_0x526161=0xce;}_0x157d38['status'](_0x526161);return _0x157d38[_0xe035('0x20')](_0xe035('0x21'),_0x4bf696+'-'+_0x798bf8+'/'+_0x481f66)[_0xe035('0x1b')](_0x35d353);}return null;};}function patchUpdates(_0x54cbd7){return function(_0x3a980f){try{jsonpatch[_0xe035('0x22')](_0x3a980f,_0x54cbd7,!![]);}catch(_0x131318){return BPromise[_0xe035('0x23')](_0x131318);}return _0x3a980f[_0xe035('0x24')]();};}function saveUpdates(_0x4092ef,_0x41431a){return function(_0x239db2){if(_0x239db2){return _0x239db2['update'](_0x4092ef)[_0xe035('0x25')](function(_0x5be658){return _0x5be658;});}return null;};}function removeEntity(_0x37255d,_0x1099ba){return function(_0x189ed8){if(_0x189ed8){return _0x189ed8['destroy']()[_0xe035('0x25')](function(){_0x37255d[_0xe035('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ae0b,_0x12dd81){return function(_0x555c54){if(!_0x555c54){_0x29ae0b[_0xe035('0x18')](0x194);}return _0x555c54;};}function handleError(_0x4449d5,_0x45b1fa){_0x45b1fa=_0x45b1fa||0x1f4;return function(_0x7f06c8){logger['error'](_0x7f06c8[_0xe035('0x26')]);if(_0x7f06c8['name']){delete _0x7f06c8[_0xe035('0x27')];}_0x4449d5['status'](_0x45b1fa)[_0xe035('0x28')](_0x7f06c8);};}exports['index']=function(_0x3e9d71,_0x2fdcb1){var _0x2e1aaa={},_0x5d267b={},_0x6d1667={'count':0x0,'rows':[]};var _0x5e1ec6=_[_0xe035('0x29')](db['MailSubstatus'][_0xe035('0x2a')],function(_0x2e16af){return{'name':_0x2e16af['fieldName'],'type':_0x2e16af['type'][_0xe035('0x2b')]};});_0x5d267b['model']=_[_0xe035('0x29')](_0x5e1ec6,_0xe035('0x27'));_0x5d267b['query']=_[_0xe035('0x2c')](_0x3e9d71[_0xe035('0x2d')]);_0x5d267b[_0xe035('0x2e')]=_['intersection'](_0x5d267b[_0xe035('0x2f')],_0x5d267b[_0xe035('0x2d')]);_0x2e1aaa[_0xe035('0x30')]=_[_0xe035('0x31')](_0x5d267b[_0xe035('0x2f')],qs[_0xe035('0x32')](_0x3e9d71[_0xe035('0x2d')][_0xe035('0x32')]));_0x2e1aaa[_0xe035('0x30')]=_0x2e1aaa[_0xe035('0x30')][_0xe035('0x33')]?_0x2e1aaa[_0xe035('0x30')]:_0x5d267b[_0xe035('0x2f')];if(!_0x3e9d71[_0xe035('0x2d')][_0xe035('0x34')](_0xe035('0x35'))){_0x2e1aaa[_0xe035('0x1f')]=qs['limit'](_0x3e9d71[_0xe035('0x2d')][_0xe035('0x1f')]);_0x2e1aaa[_0xe035('0x1c')]=qs[_0xe035('0x1c')](_0x3e9d71[_0xe035('0x2d')][_0xe035('0x1c')]);}_0x2e1aaa[_0xe035('0x36')]=qs[_0xe035('0x37')](_0x3e9d71['query'][_0xe035('0x37')]);_0x2e1aaa[_0xe035('0x38')]=qs[_0xe035('0x2e')](_['pick'](_0x3e9d71[_0xe035('0x2d')],_0x5d267b[_0xe035('0x2e')]),_0x5e1ec6);if(_0x3e9d71[_0xe035('0x2d')]['filter']){_0x2e1aaa[_0xe035('0x38')]=_['merge'](_0x2e1aaa[_0xe035('0x38')],{'$or':_[_0xe035('0x29')](_0x5e1ec6,function(_0x42b7fc){if(_0x42b7fc[_0xe035('0x39')]!==_0xe035('0x3a')){var _0xac3959={};_0xac3959[_0x42b7fc[_0xe035('0x27')]]={'$like':'%'+_0x3e9d71[_0xe035('0x2d')][_0xe035('0x3b')]+'%'};return _0xac3959;}})});}_0x2e1aaa=_['merge']({},_0x2e1aaa,_0x3e9d71[_0xe035('0x3c')]);var _0xd266a8={'where':_0x2e1aaa['where']};return db[_0xe035('0x3d')][_0xe035('0x1e')](_0xd266a8)[_0xe035('0x25')](function(_0x3a2d68){_0x6d1667[_0xe035('0x1e')]=_0x3a2d68;if(_0x3e9d71[_0xe035('0x2d')][_0xe035('0x3e')]){_0x2e1aaa[_0xe035('0x3f')]=[{'all':!![]}];}return db[_0xe035('0x3d')][_0xe035('0x40')](_0x2e1aaa);})[_0xe035('0x25')](function(_0x14b315){_0x6d1667['rows']=_0x14b315;return _0x6d1667;})[_0xe035('0x25')](respondWithFilteredResult(_0x2fdcb1,_0x2e1aaa))[_0xe035('0x41')](handleError(_0x2fdcb1,null));};exports[_0xe035('0x42')]=function(_0xf05066,_0x1f2e6f){var _0x409260={'raw':!![],'where':{'id':_0xf05066[_0xe035('0x43')]['id']}},_0x11dac3={};_0x11dac3[_0xe035('0x2f')]=_[_0xe035('0x2c')](db[_0xe035('0x3d')][_0xe035('0x2a')]);_0x11dac3[_0xe035('0x2d')]=_[_0xe035('0x2c')](_0xf05066[_0xe035('0x2d')]);_0x11dac3[_0xe035('0x2e')]=_[_0xe035('0x31')](_0x11dac3['model'],_0x11dac3[_0xe035('0x2d')]);_0x409260[_0xe035('0x30')]=_[_0xe035('0x31')](_0x11dac3[_0xe035('0x2f')],qs[_0xe035('0x32')](_0xf05066[_0xe035('0x2d')][_0xe035('0x32')]));_0x409260[_0xe035('0x30')]=_0x409260[_0xe035('0x30')][_0xe035('0x33')]?_0x409260[_0xe035('0x30')]:_0x11dac3['model'];if(_0xf05066['query'][_0xe035('0x3e')]){_0x409260[_0xe035('0x3f')]=[{'all':!![]}];}_0x409260=_['merge']({},_0x409260,_0xf05066['options']);return db[_0xe035('0x3d')][_0xe035('0x44')](_0x409260)[_0xe035('0x25')](handleEntityNotFound(_0x1f2e6f,null))[_0xe035('0x25')](respondWithResult(_0x1f2e6f,null))[_0xe035('0x41')](handleError(_0x1f2e6f,null));};exports[_0xe035('0x45')]=function(_0x317f1e,_0x50ba35){return db[_0xe035('0x3d')][_0xe035('0x45')](_0x317f1e[_0xe035('0x46')],{})[_0xe035('0x25')](respondWithResult(_0x50ba35,0xc9))[_0xe035('0x41')](handleError(_0x50ba35,null));};exports[_0xe035('0x47')]=function(_0x58e475,_0x29ed13){if(_0x58e475[_0xe035('0x46')]['id']){delete _0x58e475['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x58e475[_0xe035('0x43')]['id']}})[_0xe035('0x25')](handleEntityNotFound(_0x29ed13,null))[_0xe035('0x25')](saveUpdates(_0x58e475[_0xe035('0x46')],null))[_0xe035('0x25')](respondWithResult(_0x29ed13,null))[_0xe035('0x41')](handleError(_0x29ed13,null));};exports[_0xe035('0x48')]=function(_0x3ab25c,_0x463cf7){return db[_0xe035('0x3d')][_0xe035('0x44')]({'where':{'id':_0x3ab25c[_0xe035('0x43')]['id']}})[_0xe035('0x25')](handleEntityNotFound(_0x463cf7,null))[_0xe035('0x25')](removeEntity(_0x463cf7,null))[_0xe035('0x41')](handleError(_0x463cf7,null));};exports[_0xe035('0x49')]=function(_0x278333,_0x2dddfd){return db[_0xe035('0x3d')]['describe']()['then'](respondWithResult(_0x2dddfd,null))[_0xe035('0x41')](handleError(_0x2dddfd,null));}; \ No newline at end of file +var _0x04c6=['MailSubstatus','rawAttributes','fieldName','model','name','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','intersection','length','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','moment','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','send','index','map'];(function(_0x1cc7eb,_0x139554){var _0x4f77e5=function(_0x4e9bec){while(--_0x4e9bec){_0x1cc7eb['push'](_0x1cc7eb['shift']());}};_0x4f77e5(++_0x139554);}(_0x04c6,0x106));var _0x604c=function(_0x533f0f,_0x4e4df0){_0x533f0f=_0x533f0f-0x0;var _0x140329=_0x04c6[_0x533f0f];return _0x140329;};'use strict';var emlformat=require(_0x604c('0x0'));var rimraf=require(_0x604c('0x1'));var zipdir=require(_0x604c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x604c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x604c('0x4'));var util=require(_0x604c('0x5'));var path=require(_0x604c('0x6'));var sox=require(_0x604c('0x7'));var csv=require('to-csv');var ejs=require(_0x604c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x604c('0x9'));var squel=require(_0x604c('0xa'));var crypto=require(_0x604c('0xb'));var jsforce=require(_0x604c('0xc'));var deskjs=require(_0x604c('0xd'));var toCsv=require(_0x604c('0xe'));var querystring=require(_0x604c('0xf'));var Papa=require(_0x604c('0x10'));var Redis=require(_0x604c('0x11'));var authService=require(_0x604c('0x12'));var qs=require(_0x604c('0x13'));var as=require(_0x604c('0x14'));var hardwareService=require(_0x604c('0x15'));var logger=require('../../config/logger')(_0x604c('0x16'));var utils=require(_0x604c('0x17'));var config=require(_0x604c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x604c('0x19'))['db'];function respondWithStatusCode(_0x133b82,_0x5ca593){_0x5ca593=_0x5ca593||0xcc;return function(_0x55c2d0){if(_0x55c2d0){return _0x133b82[_0x604c('0x1a')](_0x5ca593);}return _0x133b82[_0x604c('0x1b')](_0x5ca593)[_0x604c('0x1c')]();};}function respondWithResult(_0x4287df,_0x1f311a){_0x1f311a=_0x1f311a||0xc8;return function(_0x8de605){if(_0x8de605){return _0x4287df[_0x604c('0x1b')](_0x1f311a)[_0x604c('0x1d')](_0x8de605);}};}function respondWithFilteredResult(_0x4f83db,_0xcdd545){return function(_0x579eb7){if(_0x579eb7){var _0x55bdef=typeof _0xcdd545[_0x604c('0x1e')]==='undefined'&&typeof _0xcdd545[_0x604c('0x1f')]===_0x604c('0x20');var _0x51d7fb=_0x579eb7[_0x604c('0x21')];var _0x596272=_0x55bdef?0x0:_0xcdd545[_0x604c('0x1e')];var _0x1c9969=_0x55bdef?_0x579eb7[_0x604c('0x21')]:_0xcdd545['offset']+_0xcdd545[_0x604c('0x1f')];var _0x3ac762;if(_0x1c9969>=_0x51d7fb){_0x1c9969=_0x51d7fb;_0x3ac762=0xc8;}else{_0x3ac762=0xce;}_0x4f83db[_0x604c('0x1b')](_0x3ac762);return _0x4f83db[_0x604c('0x22')]('Content-Range',_0x596272+'-'+_0x1c9969+'/'+_0x51d7fb)[_0x604c('0x1d')](_0x579eb7);}return null;};}function patchUpdates(_0x1fb951){return function(_0x3d1437){try{jsonpatch[_0x604c('0x23')](_0x3d1437,_0x1fb951,!![]);}catch(_0x4850b3){return BPromise[_0x604c('0x24')](_0x4850b3);}return _0x3d1437[_0x604c('0x25')]();};}function saveUpdates(_0x74d60b,_0x587771){return function(_0x49835e){if(_0x49835e){return _0x49835e[_0x604c('0x26')](_0x74d60b)[_0x604c('0x27')](function(_0x4683d5){return _0x4683d5;});}return null;};}function removeEntity(_0x4dae37,_0x40d42f){return function(_0x356472){if(_0x356472){return _0x356472[_0x604c('0x28')]()[_0x604c('0x27')](function(){_0x4dae37['status'](0xcc)[_0x604c('0x1c')]();});}};}function handleEntityNotFound(_0x58a0d8,_0x20b1a4){return function(_0x171c3f){if(!_0x171c3f){_0x58a0d8[_0x604c('0x1a')](0x194);}return _0x171c3f;};}function handleError(_0xc464a2,_0x151c23){_0x151c23=_0x151c23||0x1f4;return function(_0x14b546){logger[_0x604c('0x29')](_0x14b546[_0x604c('0x2a')]);if(_0x14b546['name']){delete _0x14b546['name'];}_0xc464a2[_0x604c('0x1b')](_0x151c23)[_0x604c('0x2b')](_0x14b546);};}exports[_0x604c('0x2c')]=function(_0x5418b0,_0x213296){var _0x49e565={},_0x4a9b1b={},_0x16bcc7={'count':0x0,'rows':[]};var _0x37bf7a=_[_0x604c('0x2d')](db[_0x604c('0x2e')][_0x604c('0x2f')],function(_0x427424){return{'name':_0x427424[_0x604c('0x30')],'type':_0x427424['type']['key']};});_0x4a9b1b[_0x604c('0x31')]=_[_0x604c('0x2d')](_0x37bf7a,_0x604c('0x32'));_0x4a9b1b[_0x604c('0x33')]=_[_0x604c('0x34')](_0x5418b0[_0x604c('0x33')]);_0x4a9b1b[_0x604c('0x35')]=_['intersection'](_0x4a9b1b[_0x604c('0x31')],_0x4a9b1b['query']);_0x49e565[_0x604c('0x36')]=_['intersection'](_0x4a9b1b['model'],qs[_0x604c('0x37')](_0x5418b0[_0x604c('0x33')][_0x604c('0x37')]));_0x49e565[_0x604c('0x36')]=_0x49e565[_0x604c('0x36')]['length']?_0x49e565['attributes']:_0x4a9b1b[_0x604c('0x31')];if(!_0x5418b0[_0x604c('0x33')][_0x604c('0x38')](_0x604c('0x39'))){_0x49e565[_0x604c('0x1f')]=qs[_0x604c('0x1f')](_0x5418b0['query'][_0x604c('0x1f')]);_0x49e565[_0x604c('0x1e')]=qs['offset'](_0x5418b0[_0x604c('0x33')][_0x604c('0x1e')]);}_0x49e565['order']=qs[_0x604c('0x3a')](_0x5418b0[_0x604c('0x33')][_0x604c('0x3a')]);_0x49e565[_0x604c('0x3b')]=qs[_0x604c('0x35')](_[_0x604c('0x3c')](_0x5418b0[_0x604c('0x33')],_0x4a9b1b[_0x604c('0x35')]),_0x37bf7a);if(_0x5418b0[_0x604c('0x33')][_0x604c('0x3d')]){_0x49e565['where']=_[_0x604c('0x3e')](_0x49e565[_0x604c('0x3b')],{'$or':_['map'](_0x37bf7a,function(_0x1a9bfd){if(_0x1a9bfd['type']!==_0x604c('0x3f')){var _0x17dd8c={};_0x17dd8c[_0x1a9bfd[_0x604c('0x32')]]={'$like':'%'+_0x5418b0['query']['filter']+'%'};return _0x17dd8c;}})});}_0x49e565=_[_0x604c('0x3e')]({},_0x49e565,_0x5418b0[_0x604c('0x40')]);var _0x5baafe={'where':_0x49e565['where']};return db[_0x604c('0x2e')]['count'](_0x5baafe)['then'](function(_0x1d588b){_0x16bcc7[_0x604c('0x21')]=_0x1d588b;if(_0x5418b0[_0x604c('0x33')][_0x604c('0x41')]){_0x49e565['include']=[{'all':!![]}];}return db[_0x604c('0x2e')][_0x604c('0x42')](_0x49e565);})[_0x604c('0x27')](function(_0x28a91f){_0x16bcc7[_0x604c('0x43')]=_0x28a91f;return _0x16bcc7;})[_0x604c('0x27')](respondWithFilteredResult(_0x213296,_0x49e565))[_0x604c('0x44')](handleError(_0x213296,null));};exports['show']=function(_0xff921e,_0x399f61){var _0x220a85={'raw':!![],'where':{'id':_0xff921e['params']['id']}},_0x5eda44={};_0x5eda44[_0x604c('0x31')]=_['keys'](db['MailSubstatus'][_0x604c('0x2f')]);_0x5eda44[_0x604c('0x33')]=_[_0x604c('0x34')](_0xff921e[_0x604c('0x33')]);_0x5eda44[_0x604c('0x35')]=_[_0x604c('0x45')](_0x5eda44['model'],_0x5eda44[_0x604c('0x33')]);_0x220a85[_0x604c('0x36')]=_['intersection'](_0x5eda44[_0x604c('0x31')],qs['fields'](_0xff921e[_0x604c('0x33')][_0x604c('0x37')]));_0x220a85[_0x604c('0x36')]=_0x220a85[_0x604c('0x36')][_0x604c('0x46')]?_0x220a85[_0x604c('0x36')]:_0x5eda44[_0x604c('0x31')];if(_0xff921e['query'][_0x604c('0x41')]){_0x220a85[_0x604c('0x47')]=[{'all':!![]}];}_0x220a85=_[_0x604c('0x3e')]({},_0x220a85,_0xff921e['options']);return db[_0x604c('0x2e')]['find'](_0x220a85)['then'](handleEntityNotFound(_0x399f61,null))[_0x604c('0x27')](respondWithResult(_0x399f61,null))[_0x604c('0x44')](handleError(_0x399f61,null));};exports['create']=function(_0x2ebf47,_0x5656fb){return db[_0x604c('0x2e')][_0x604c('0x48')](_0x2ebf47['body'],{})[_0x604c('0x27')](respondWithResult(_0x5656fb,0xc9))[_0x604c('0x44')](handleError(_0x5656fb,null));};exports['update']=function(_0x5d63b3,_0x3a2d4a){if(_0x5d63b3[_0x604c('0x49')]['id']){delete _0x5d63b3['body']['id'];}return db[_0x604c('0x2e')][_0x604c('0x4a')]({'where':{'id':_0x5d63b3['params']['id']}})[_0x604c('0x27')](handleEntityNotFound(_0x3a2d4a,null))[_0x604c('0x27')](saveUpdates(_0x5d63b3['body'],null))['then'](respondWithResult(_0x3a2d4a,null))[_0x604c('0x44')](handleError(_0x3a2d4a,null));};exports['destroy']=function(_0x5dec9c,_0xe33b98){return db['MailSubstatus'][_0x604c('0x4a')]({'where':{'id':_0x5dec9c[_0x604c('0x4b')]['id']}})[_0x604c('0x27')](handleEntityNotFound(_0xe33b98,null))[_0x604c('0x27')](removeEntity(_0xe33b98,null))[_0x604c('0x44')](handleError(_0xe33b98,null));};exports[_0x604c('0x4c')]=function(_0x38a6c3,_0x4bf94d){return db[_0x604c('0x2e')][_0x604c('0x4c')]()[_0x604c('0x27')](respondWithResult(_0x4bf94d,null))[_0x604c('0x44')](handleError(_0x4bf94d,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0086691..d09078d 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebe3=['MailSubstatus','setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xebe3,0x1b7));var _0x3ebe=function(_0x38c9a6,_0x42830b){_0x38c9a6=_0x38c9a6-0x0;var _0x26857e=_0xebe3[_0x38c9a6];return _0x26857e;};'use strict';var EventEmitter=require(_0x3ebe('0x0'));var MailSubstatus=require(_0x3ebe('0x1'))['db'][_0x3ebe('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3ebe('0x3')](0x0);var events={'afterUpdate':_0x3ebe('0x4')};function emitEvent(_0x11a10c){return function(_0x42fe08,_0x3f0ca1,_0x2f024a){MailSubstatusEvents[_0x3ebe('0x5')](_0x11a10c+':'+_0x42fe08['id'],_0x42fe08);MailSubstatusEvents[_0x3ebe('0x5')](_0x11a10c,_0x42fe08);_0x2f024a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x3ebe('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xefb9=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xefb9,0x18a));var _0x9efb=function(_0xb096ef,_0x20ebdf){_0xb096ef=_0xb096ef-0x0;var _0x5ac5b=_0xefb9[_0xb096ef];return _0x5ac5b;};'use strict';var EventEmitter=require(_0x9efb('0x0'));var MailSubstatus=require(_0x9efb('0x1'))['db'][_0x9efb('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9efb('0x3')](0x0);var events={'afterUpdate':_0x9efb('0x4')};function emitEvent(_0x20f4c1){return function(_0x187304,_0x4c3807,_0x2602e2){MailSubstatusEvents[_0x9efb('0x5')](_0x20f4c1+':'+_0x187304['id'],_0x187304);MailSubstatusEvents[_0x9efb('0x5')](_0x20f4c1,_0x187304);_0x2602e2(null);};}for(var e in events){if(events[_0x9efb('0x6')](e)){var event=events[e];MailSubstatus[_0x9efb('0x7')](e,emitEvent(event));}}module[_0x9efb('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 8d5e68a..07b6abd 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 _0x0ac1=['mail_substatuses','Condition','update','name','then','./mailSubstatus.attributes','exports','models','MailSubstatus'];(function(_0x344179,_0xb1c8a7){var _0x38fb32=function(_0x601710){while(--_0x601710){_0x344179['push'](_0x344179['shift']());}};_0x38fb32(++_0xb1c8a7);}(_0x0ac1,0x1b5));var _0x10ac=function(_0x1e000c,_0x924525){_0x1e000c=_0x1e000c-0x0;var _0x3264e7=_0x0ac1[_0x1e000c];return _0x3264e7;};'use strict';var attributes=require(_0x10ac('0x0'));module[_0x10ac('0x1')]=function(_0xf55157){var _0x4af7c7=_0xf55157[_0x10ac('0x2')];return _0xf55157['define'](_0x10ac('0x3'),attributes,{'tableName':_0x10ac('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4462a1,_0x8ccd50,_0x32333f){return _0x4af7c7[_0x10ac('0x5')][_0x10ac('0x6')]({'value':_0x4462a1['name']},{'where':{'field':'mailSubstatus','value':_0x4462a1['_previousDataValues'][_0x10ac('0x7')]}})[_0x10ac('0x8')](function(){_0x32333f();})['catch'](function(_0xf58fff){_0x32333f(_0xf58fff);});}}});}; \ No newline at end of file +var _0x71cd=['then','catch','exports','define','MailSubstatus','Condition','name','mailSubstatus'];(function(_0x1f72e3,_0x1afb51){var _0x412562=function(_0xceedf4){while(--_0xceedf4){_0x1f72e3['push'](_0x1f72e3['shift']());}};_0x412562(++_0x1afb51);}(_0x71cd,0x9a));var _0xd71c=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0x71cd[_0x55c485];return _0x6bb521;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xd71c('0x0')]=function(_0x27baf6){var _0x3a7d24=_0x27baf6['models'];return _0x27baf6[_0xd71c('0x1')](_0xd71c('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5f2134,_0x147348,_0x1df325){return _0x3a7d24[_0xd71c('0x3')]['update']({'value':_0x5f2134[_0xd71c('0x4')]},{'where':{'field':_0xd71c('0x5'),'value':_0x5f2134['_previousDataValues']['name']}})[_0xd71c('0x6')](function(){_0x1df325();})[_0xd71c('0x7')](function(_0x185bc9){_0x1df325(_0x185bc9);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c07a15e..afc63a8 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 _0x792d=['rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1ddb15,_0x3f9ad4){var _0x5bd2e1=function(_0x575cb3){while(--_0x575cb3){_0x1ddb15['push'](_0x1ddb15['shift']());}};_0x5bd2e1(++_0x3f9ad4);}(_0x792d,0x1cf));var _0xd792=function(_0xad38ea,_0xc872b2){_0xad38ea=_0xad38ea-0x0;var _0x3cd4b7=_0x792d[_0xad38ea];return _0x3cd4b7;};'use strict';var _=require(_0xd792('0x0'));var util=require('util');var moment=require(_0xd792('0x1'));var BPromise=require(_0xd792('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd792('0x3'))['db'];var utils=require(_0xd792('0x4'));var logger=require('../../config/logger')(_0xd792('0x5'));var config=require(_0xd792('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd792('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdea090,_0x316c17,_0xe92fac){return new BPromise(function(_0x1d1d5a,_0x4db81b){return client[_0xd792('0x8')](_0xdea090,_0xe92fac)[_0xd792('0x9')](function(_0x498e2b){logger[_0xd792('0xa')](_0xd792('0xb'),_0x316c17,_0xd792('0xc'));logger['debug'](_0xd792('0xd'),_0x316c17,_0xd792('0xc'),JSON['stringify'](_0x498e2b));if(_0x498e2b[_0xd792('0xe')]){if(_0x498e2b[_0xd792('0xe')][_0xd792('0xf')]===0x1f4){logger[_0xd792('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x316c17,_0x498e2b[_0xd792('0xe')][_0xd792('0x10')]);return _0x4db81b(_0x498e2b[_0xd792('0xe')][_0xd792('0x10')]);}logger[_0xd792('0xe')](_0xd792('0xb'),_0x316c17,_0x498e2b[_0xd792('0xe')]['message']);return _0x1d1d5a(_0x498e2b[_0xd792('0xe')][_0xd792('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x316c17,_0xd792('0xc'));_0x1d1d5a(_0x498e2b[_0xd792('0x11')][_0xd792('0x10')]);}})['catch'](function(_0x265ee9){logger['error'](_0xd792('0xb'),_0x316c17,_0x265ee9);_0x4db81b(_0x265ee9);});});} \ No newline at end of file +var _0x6422=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x5424a7,_0x3dd4f4){var _0x338ca7=function(_0x79df38){while(--_0x79df38){_0x5424a7['push'](_0x5424a7['shift']());}};_0x338ca7(++_0x3dd4f4);}(_0x6422,0x117));var _0x2642=function(_0x44a27b,_0x1db292){_0x44a27b=_0x44a27b-0x0;var _0x4dd923=_0x6422[_0x44a27b];return _0x4dd923;};'use strict';var _=require(_0x2642('0x0'));var util=require(_0x2642('0x1'));var moment=require(_0x2642('0x2'));var BPromise=require(_0x2642('0x3'));var rs=require(_0x2642('0x4'));var fs=require('fs');var Redis=require(_0x2642('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2642('0x6'));var logger=require(_0x2642('0x7'))(_0x2642('0x8'));var config=require(_0x2642('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2642('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e1b51,_0x45561a,_0x431936){return new BPromise(function(_0x3a0b4,_0x6ad471){return client['request'](_0x5e1b51,_0x431936)['then'](function(_0x2e8c40){logger[_0x2642('0xb')](_0x2642('0xc'),_0x45561a,_0x2642('0xd'));logger[_0x2642('0xe')](_0x2642('0xf'),_0x45561a,_0x2642('0xd'),JSON[_0x2642('0x10')](_0x2e8c40));if(_0x2e8c40[_0x2642('0x11')]){if(_0x2e8c40['error']['code']===0x1f4){logger[_0x2642('0x11')](_0x2642('0xc'),_0x45561a,_0x2e8c40['error'][_0x2642('0x12')]);return _0x6ad471(_0x2e8c40['error'][_0x2642('0x12')]);}logger[_0x2642('0x11')](_0x2642('0xc'),_0x45561a,_0x2e8c40[_0x2642('0x11')][_0x2642('0x12')]);return _0x3a0b4(_0x2e8c40['error'][_0x2642('0x12')]);}else{logger[_0x2642('0xb')](_0x2642('0xc'),_0x45561a,_0x2642('0xd'));_0x3a0b4(_0x2e8c40['result'][_0x2642('0x12')]);}})[_0x2642('0x13')](function(_0x2e7d53){logger[_0x2642('0x11')](_0x2642('0xc'),_0x45561a,_0x2e7d53);_0x6ad471(_0x2e7d53);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b0b6d92..106741a 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 _0xe8ed=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x39c4c7,_0x2ddfa9){var _0x32f7b3=function(_0x22880f){while(--_0x22880f){_0x39c4c7['push'](_0x39c4c7['shift']());}};_0x32f7b3(++_0x2ddfa9);}(_0xe8ed,0xb6));var _0xde8e=function(_0x1eacaa,_0x3da655){_0x1eacaa=_0x1eacaa-0x0;var _0x411223=_0xe8ed[_0x1eacaa];return _0x411223;};'use strict';var multer=require(_0xde8e('0x0'));var util=require(_0xde8e('0x1'));var path=require('path');var timeout=require(_0xde8e('0x2'));var express=require(_0xde8e('0x3'));var router=express[_0xde8e('0x4')]();var fs_extra=require(_0xde8e('0x5'));var auth=require(_0xde8e('0x6'));var interaction=require(_0xde8e('0x7'));var config=require(_0xde8e('0x8'));var controller=require(_0xde8e('0x9'));router[_0xde8e('0xa')]('/',auth[_0xde8e('0xb')](),controller[_0xde8e('0xc')]);router[_0xde8e('0xa')](_0xde8e('0xd'),auth[_0xde8e('0xb')](),controller[_0xde8e('0xe')]);router[_0xde8e('0xa')](_0xde8e('0xf'),auth[_0xde8e('0xb')](),controller['show']);router[_0xde8e('0x10')]('/',auth[_0xde8e('0xb')](),controller[_0xde8e('0x11')]);router[_0xde8e('0x12')](_0xde8e('0xf'),auth[_0xde8e('0xb')](),controller[_0xde8e('0x13')]);router[_0xde8e('0x14')](_0xde8e('0xf'),auth[_0xde8e('0xb')](),controller[_0xde8e('0x15')]);module[_0xde8e('0x16')]=router; \ No newline at end of file +var _0x83f4=['path','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x7159c0,_0x490bcb){var _0x1d3a11=function(_0x5a0931){while(--_0x5a0931){_0x7159c0['push'](_0x7159c0['shift']());}};_0x1d3a11(++_0x490bcb);}(_0x83f4,0x90));var _0x483f=function(_0x1b1261,_0x5be06a){_0x1b1261=_0x1b1261-0x0;var _0x2ea766=_0x83f4[_0x1b1261];return _0x2ea766;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x483f('0x0'));var timeout=require('connect-timeout');var express=require(_0x483f('0x1'));var router=express[_0x483f('0x2')]();var fs_extra=require(_0x483f('0x3'));var auth=require(_0x483f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x483f('0x5'));router[_0x483f('0x6')]('/',auth[_0x483f('0x7')](),controller[_0x483f('0x8')]);router[_0x483f('0x6')](_0x483f('0x9'),auth[_0x483f('0x7')](),controller['describe']);router[_0x483f('0x6')](_0x483f('0xa'),auth[_0x483f('0x7')](),controller[_0x483f('0xb')]);router[_0x483f('0xc')]('/',auth[_0x483f('0x7')](),controller[_0x483f('0xd')]);router[_0x483f('0xe')](_0x483f('0xa'),auth[_0x483f('0x7')](),controller[_0x483f('0xf')]);router[_0x483f('0x10')]('/:id',auth[_0x483f('0x7')](),controller['destroy']);module[_0x483f('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 363f075..b940325 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1120c7,_0x18f931){var _0x436f8a=function(_0x19f1dd){while(--_0x19f1dd){_0x1120c7['push'](_0x1120c7['shift']());}};_0x436f8a(++_0x18f931);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0x9bde,0xe1));var _0xe9bd=function(_0xf52a5b,_0x304901){_0xf52a5b=_0xf52a5b-0x0;var _0x4890ef=_0x9bde[_0xf52a5b];return _0x4890ef;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6f6d42d..f9d303f 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 _0xffb0=['error','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','rows','catch','show','rawAttributes','intersection','find','create','body','params','describe','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','save','update','then','destroy'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xffb0,0x154));var _0x0ffb=function(_0x1068a2,_0x3134d7){_0x1068a2=_0x1068a2-0x0;var _0x1c1b9f=_0xffb0[_0x1068a2];return _0x1c1b9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ffb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ffb('0x1'));var moment=require(_0x0ffb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0ffb('0x3'));var util=require(_0x0ffb('0x4'));var path=require(_0x0ffb('0x5'));var sox=require(_0x0ffb('0x6'));var csv=require(_0x0ffb('0x7'));var ejs=require(_0x0ffb('0x8'));var fs=require('fs');var fs_extra=require(_0x0ffb('0x9'));var _=require(_0x0ffb('0xa'));var squel=require(_0x0ffb('0xb'));var crypto=require(_0x0ffb('0xc'));var jsforce=require(_0x0ffb('0xd'));var deskjs=require(_0x0ffb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ffb('0xf'));var Papa=require(_0x0ffb('0x10'));var Redis=require(_0x0ffb('0x11'));var authService=require(_0x0ffb('0x12'));var qs=require(_0x0ffb('0x13'));var as=require(_0x0ffb('0x14'));var hardwareService=require(_0x0ffb('0x15'));var logger=require(_0x0ffb('0x16'))(_0x0ffb('0x17'));var utils=require(_0x0ffb('0x18'));var config=require(_0x0ffb('0x19'));var licenseUtil=require(_0x0ffb('0x1a'));var db=require(_0x0ffb('0x1b'))['db'];function respondWithStatusCode(_0x142130,_0x151873){_0x151873=_0x151873||0xcc;return function(_0x5d840d){if(_0x5d840d){return _0x142130[_0x0ffb('0x1c')](_0x151873);}return _0x142130[_0x0ffb('0x1d')](_0x151873)[_0x0ffb('0x1e')]();};}function respondWithResult(_0x3f6ebd,_0x452e5e){_0x452e5e=_0x452e5e||0xc8;return function(_0x62eb91){if(_0x62eb91){return _0x3f6ebd[_0x0ffb('0x1d')](_0x452e5e)['json'](_0x62eb91);}};}function respondWithFilteredResult(_0x18f71f,_0x2bac76){return function(_0x39780b){if(_0x39780b){var _0x2372fd=typeof _0x2bac76[_0x0ffb('0x1f')]===_0x0ffb('0x20')&&typeof _0x2bac76[_0x0ffb('0x21')]===_0x0ffb('0x20');var _0x5bbb30=_0x39780b['count'];var _0x4bba26=_0x2372fd?0x0:_0x2bac76[_0x0ffb('0x1f')];var _0x218826=_0x2372fd?_0x39780b['count']:_0x2bac76[_0x0ffb('0x1f')]+_0x2bac76[_0x0ffb('0x21')];var _0x4a23d6;if(_0x218826>=_0x5bbb30){_0x218826=_0x5bbb30;_0x4a23d6=0xc8;}else{_0x4a23d6=0xce;}_0x18f71f[_0x0ffb('0x1d')](_0x4a23d6);return _0x18f71f[_0x0ffb('0x22')]('Content-Range',_0x4bba26+'-'+_0x218826+'/'+_0x5bbb30)['json'](_0x39780b);}return null;};}function patchUpdates(_0x5ea6bf){return function(_0xee0036){try{jsonpatch[_0x0ffb('0x23')](_0xee0036,_0x5ea6bf,!![]);}catch(_0x2c9e64){return BPromise['reject'](_0x2c9e64);}return _0xee0036[_0x0ffb('0x24')]();};}function saveUpdates(_0x1681f4,_0x23eff8){return function(_0x520d85){if(_0x520d85){return _0x520d85[_0x0ffb('0x25')](_0x1681f4)[_0x0ffb('0x26')](function(_0x417085){return _0x417085;});}return null;};}function removeEntity(_0xf0c39b,_0x303ee0){return function(_0xa2281c){if(_0xa2281c){return _0xa2281c[_0x0ffb('0x27')]()[_0x0ffb('0x26')](function(){_0xf0c39b[_0x0ffb('0x1d')](0xcc)[_0x0ffb('0x1e')]();});}};}function handleEntityNotFound(_0x1bc533,_0x28d7f7){return function(_0x5b744e){if(!_0x5b744e){_0x1bc533[_0x0ffb('0x1c')](0x194);}return _0x5b744e;};}function handleError(_0x5c5d49,_0x577296){_0x577296=_0x577296||0x1f4;return function(_0x2919d4){logger[_0x0ffb('0x28')](_0x2919d4['stack']);if(_0x2919d4[_0x0ffb('0x29')]){delete _0x2919d4[_0x0ffb('0x29')];}_0x5c5d49[_0x0ffb('0x1d')](_0x577296)[_0x0ffb('0x2a')](_0x2919d4);};}exports[_0x0ffb('0x2b')]=function(_0x419d67,_0x2b933f){var _0x351d12={},_0x546ea4={},_0x1315df={'count':0x0,'rows':[]};var _0x353901=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x19d3fe){return{'name':_0x19d3fe[_0x0ffb('0x2c')],'type':_0x19d3fe[_0x0ffb('0x2d')]['key']};});_0x546ea4[_0x0ffb('0x2e')]=_[_0x0ffb('0x2f')](_0x353901,_0x0ffb('0x29'));_0x546ea4[_0x0ffb('0x30')]=_[_0x0ffb('0x31')](_0x419d67[_0x0ffb('0x30')]);_0x546ea4[_0x0ffb('0x32')]=_['intersection'](_0x546ea4['model'],_0x546ea4[_0x0ffb('0x30')]);_0x351d12[_0x0ffb('0x33')]=_['intersection'](_0x546ea4[_0x0ffb('0x2e')],qs[_0x0ffb('0x34')](_0x419d67[_0x0ffb('0x30')][_0x0ffb('0x34')]));_0x351d12[_0x0ffb('0x33')]=_0x351d12[_0x0ffb('0x33')][_0x0ffb('0x35')]?_0x351d12[_0x0ffb('0x33')]:_0x546ea4[_0x0ffb('0x2e')];if(!_0x419d67[_0x0ffb('0x30')][_0x0ffb('0x36')](_0x0ffb('0x37'))){_0x351d12[_0x0ffb('0x21')]=qs[_0x0ffb('0x21')](_0x419d67['query']['limit']);_0x351d12[_0x0ffb('0x1f')]=qs[_0x0ffb('0x1f')](_0x419d67['query']['offset']);}_0x351d12[_0x0ffb('0x38')]=qs[_0x0ffb('0x39')](_0x419d67[_0x0ffb('0x30')]['sort']);_0x351d12[_0x0ffb('0x3a')]=qs[_0x0ffb('0x32')](_['pick'](_0x419d67['query'],_0x546ea4[_0x0ffb('0x32')]),_0x353901);if(_0x419d67[_0x0ffb('0x30')]['filter']){_0x351d12[_0x0ffb('0x3a')]=_[_0x0ffb('0x3b')](_0x351d12['where'],{'$or':_[_0x0ffb('0x2f')](_0x353901,function(_0x2f518e){if(_0x2f518e['type']!==_0x0ffb('0x3c')){var _0x1e127f={};_0x1e127f[_0x2f518e[_0x0ffb('0x29')]]={'$like':'%'+_0x419d67[_0x0ffb('0x30')]['filter']+'%'};return _0x1e127f;}})});}_0x351d12=_['merge']({},_0x351d12,_0x419d67[_0x0ffb('0x3d')]);var _0x8d1862={'where':_0x351d12[_0x0ffb('0x3a')]};return db[_0x0ffb('0x3e')][_0x0ffb('0x3f')](_0x8d1862)['then'](function(_0x22910b){_0x1315df[_0x0ffb('0x3f')]=_0x22910b;if(_0x419d67[_0x0ffb('0x30')][_0x0ffb('0x40')]){_0x351d12[_0x0ffb('0x41')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x351d12);})['then'](function(_0x406075){_0x1315df[_0x0ffb('0x42')]=_0x406075;return _0x1315df;})[_0x0ffb('0x26')](respondWithFilteredResult(_0x2b933f,_0x351d12))[_0x0ffb('0x43')](handleError(_0x2b933f,null));};exports[_0x0ffb('0x44')]=function(_0x8dfe0,_0xe1bdb0){var _0x37c715={'raw':!![],'where':{'id':_0x8dfe0['params']['id']}},_0x565d37={};_0x565d37[_0x0ffb('0x2e')]=_[_0x0ffb('0x31')](db['MailTransferReport'][_0x0ffb('0x45')]);_0x565d37[_0x0ffb('0x30')]=_[_0x0ffb('0x31')](_0x8dfe0['query']);_0x565d37[_0x0ffb('0x32')]=_[_0x0ffb('0x46')](_0x565d37[_0x0ffb('0x2e')],_0x565d37[_0x0ffb('0x30')]);_0x37c715[_0x0ffb('0x33')]=_[_0x0ffb('0x46')](_0x565d37[_0x0ffb('0x2e')],qs[_0x0ffb('0x34')](_0x8dfe0[_0x0ffb('0x30')][_0x0ffb('0x34')]));_0x37c715[_0x0ffb('0x33')]=_0x37c715['attributes'][_0x0ffb('0x35')]?_0x37c715[_0x0ffb('0x33')]:_0x565d37['model'];if(_0x8dfe0[_0x0ffb('0x30')][_0x0ffb('0x40')]){_0x37c715[_0x0ffb('0x41')]=[{'all':!![]}];}_0x37c715=_[_0x0ffb('0x3b')]({},_0x37c715,_0x8dfe0[_0x0ffb('0x3d')]);return db[_0x0ffb('0x3e')][_0x0ffb('0x47')](_0x37c715)['then'](handleEntityNotFound(_0xe1bdb0,null))[_0x0ffb('0x26')](respondWithResult(_0xe1bdb0,null))[_0x0ffb('0x43')](handleError(_0xe1bdb0,null));};exports[_0x0ffb('0x48')]=function(_0x5cf0f3,_0xe2c6b){return db[_0x0ffb('0x3e')][_0x0ffb('0x48')](_0x5cf0f3[_0x0ffb('0x49')],{})[_0x0ffb('0x26')](respondWithResult(_0xe2c6b,0xc9))[_0x0ffb('0x43')](handleError(_0xe2c6b,null));};exports[_0x0ffb('0x25')]=function(_0x22ee7b,_0x5e1f2f){if(_0x22ee7b[_0x0ffb('0x49')]['id']){delete _0x22ee7b['body']['id'];}return db[_0x0ffb('0x3e')]['find']({'where':{'id':_0x22ee7b[_0x0ffb('0x4a')]['id']}})[_0x0ffb('0x26')](handleEntityNotFound(_0x5e1f2f,null))['then'](saveUpdates(_0x22ee7b[_0x0ffb('0x49')],null))[_0x0ffb('0x26')](respondWithResult(_0x5e1f2f,null))[_0x0ffb('0x43')](handleError(_0x5e1f2f,null));};exports[_0x0ffb('0x27')]=function(_0xdbaf8c,_0x1fbb24){return db['MailTransferReport'][_0x0ffb('0x47')]({'where':{'id':_0xdbaf8c[_0x0ffb('0x4a')]['id']}})[_0x0ffb('0x26')](handleEntityNotFound(_0x1fbb24,null))[_0x0ffb('0x26')](removeEntity(_0x1fbb24,null))[_0x0ffb('0x43')](handleError(_0x1fbb24,null));};exports[_0x0ffb('0x4b')]=function(_0x1a44b2,_0x44024a){return db[_0x0ffb('0x3e')][_0x0ffb('0x4b')]()['then'](respondWithResult(_0x44024a,null))[_0x0ffb('0x43')](handleError(_0x44024a,null));}; \ No newline at end of file +var _0xcbbc=['path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','show','params','keys','length','includeAll','include','find','catch','create','body','update','fast-json-patch','request-promise','moment','util'];(function(_0x2d11df,_0x627e1c){var _0x1e1be5=function(_0x11b361){while(--_0x11b361){_0x2d11df['push'](_0x2d11df['shift']());}};_0x1e1be5(++_0x627e1c);}(_0xcbbc,0x1b8));var _0xccbb=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0xcbbc[_0x53afa6];return _0x51f86a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xccbb('0x0'));var rp=require(_0xccbb('0x1'));var moment=require(_0xccbb('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xccbb('0x3'));var path=require(_0xccbb('0x4'));var sox=require(_0xccbb('0x5'));var csv=require('to-csv');var ejs=require(_0xccbb('0x6'));var fs=require('fs');var fs_extra=require(_0xccbb('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xccbb('0x8'));var jsforce=require(_0xccbb('0x9'));var deskjs=require(_0xccbb('0xa'));var toCsv=require(_0xccbb('0xb'));var querystring=require(_0xccbb('0xc'));var Papa=require(_0xccbb('0xd'));var Redis=require(_0xccbb('0xe'));var authService=require(_0xccbb('0xf'));var qs=require(_0xccbb('0x10'));var as=require(_0xccbb('0x11'));var hardwareService=require(_0xccbb('0x12'));var logger=require(_0xccbb('0x13'))(_0xccbb('0x14'));var utils=require(_0xccbb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xccbb('0x16'))['db'];function respondWithStatusCode(_0x16bb4f,_0x56c2b3){_0x56c2b3=_0x56c2b3||0xcc;return function(_0x14dc29){if(_0x14dc29){return _0x16bb4f['sendStatus'](_0x56c2b3);}return _0x16bb4f[_0xccbb('0x17')](_0x56c2b3)[_0xccbb('0x18')]();};}function respondWithResult(_0x14df3c,_0x3b4fba){_0x3b4fba=_0x3b4fba||0xc8;return function(_0x2fea08){if(_0x2fea08){return _0x14df3c[_0xccbb('0x17')](_0x3b4fba)[_0xccbb('0x19')](_0x2fea08);}};}function respondWithFilteredResult(_0x5370ed,_0x36d17b){return function(_0x1449f6){if(_0x1449f6){var _0x50488b=typeof _0x36d17b['offset']==='undefined'&&typeof _0x36d17b[_0xccbb('0x1a')]===_0xccbb('0x1b');var _0x334c31=_0x1449f6[_0xccbb('0x1c')];var _0x411107=_0x50488b?0x0:_0x36d17b[_0xccbb('0x1d')];var _0x45944e=_0x50488b?_0x1449f6['count']:_0x36d17b['offset']+_0x36d17b['limit'];var _0x81d6a;if(_0x45944e>=_0x334c31){_0x45944e=_0x334c31;_0x81d6a=0xc8;}else{_0x81d6a=0xce;}_0x5370ed[_0xccbb('0x17')](_0x81d6a);return _0x5370ed[_0xccbb('0x1e')](_0xccbb('0x1f'),_0x411107+'-'+_0x45944e+'/'+_0x334c31)[_0xccbb('0x19')](_0x1449f6);}return null;};}function patchUpdates(_0x281964){return function(_0x344fef){try{jsonpatch[_0xccbb('0x20')](_0x344fef,_0x281964,!![]);}catch(_0x414f48){return BPromise[_0xccbb('0x21')](_0x414f48);}return _0x344fef[_0xccbb('0x22')]();};}function saveUpdates(_0x11a472,_0x56ebf8){return function(_0x33d202){if(_0x33d202){return _0x33d202['update'](_0x11a472)[_0xccbb('0x23')](function(_0x5d3ed9){return _0x5d3ed9;});}return null;};}function removeEntity(_0x2ff13d,_0x39140b){return function(_0x2ab9af){if(_0x2ab9af){return _0x2ab9af[_0xccbb('0x24')]()[_0xccbb('0x23')](function(){_0x2ff13d[_0xccbb('0x17')](0xcc)[_0xccbb('0x18')]();});}};}function handleEntityNotFound(_0x2cabac,_0x34746a){return function(_0x159aa5){if(!_0x159aa5){_0x2cabac[_0xccbb('0x25')](0x194);}return _0x159aa5;};}function handleError(_0x4174f3,_0xf948f6){_0xf948f6=_0xf948f6||0x1f4;return function(_0x4f9ed5){logger[_0xccbb('0x26')](_0x4f9ed5[_0xccbb('0x27')]);if(_0x4f9ed5[_0xccbb('0x28')]){delete _0x4f9ed5['name'];}_0x4174f3[_0xccbb('0x17')](_0xf948f6)['send'](_0x4f9ed5);};}exports[_0xccbb('0x29')]=function(_0x1d5b6f,_0x22858){var _0x32075d={},_0xe638={},_0x11d1ca={'count':0x0,'rows':[]};var _0x47417b=_[_0xccbb('0x2a')](db[_0xccbb('0x2b')][_0xccbb('0x2c')],function(_0x1d1981){return{'name':_0x1d1981[_0xccbb('0x2d')],'type':_0x1d1981[_0xccbb('0x2e')]['key']};});_0xe638[_0xccbb('0x2f')]=_[_0xccbb('0x2a')](_0x47417b,_0xccbb('0x28'));_0xe638['query']=_['keys'](_0x1d5b6f[_0xccbb('0x30')]);_0xe638[_0xccbb('0x31')]=_[_0xccbb('0x32')](_0xe638[_0xccbb('0x2f')],_0xe638[_0xccbb('0x30')]);_0x32075d[_0xccbb('0x33')]=_['intersection'](_0xe638['model'],qs[_0xccbb('0x34')](_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x34')]));_0x32075d[_0xccbb('0x33')]=_0x32075d['attributes']['length']?_0x32075d['attributes']:_0xe638['model'];if(!_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x35')](_0xccbb('0x36'))){_0x32075d[_0xccbb('0x1a')]=qs[_0xccbb('0x1a')](_0x1d5b6f[_0xccbb('0x30')]['limit']);_0x32075d[_0xccbb('0x1d')]=qs[_0xccbb('0x1d')](_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x1d')]);}_0x32075d[_0xccbb('0x37')]=qs['sort'](_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x38')]);_0x32075d[_0xccbb('0x39')]=qs[_0xccbb('0x31')](_[_0xccbb('0x3a')](_0x1d5b6f[_0xccbb('0x30')],_0xe638[_0xccbb('0x31')]),_0x47417b);if(_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x3b')]){_0x32075d['where']=_[_0xccbb('0x3c')](_0x32075d[_0xccbb('0x39')],{'$or':_[_0xccbb('0x2a')](_0x47417b,function(_0x28bb1f){if(_0x28bb1f[_0xccbb('0x2e')]!=='VIRTUAL'){var _0x4d5c15={};_0x4d5c15[_0x28bb1f[_0xccbb('0x28')]]={'$like':'%'+_0x1d5b6f[_0xccbb('0x30')][_0xccbb('0x3b')]+'%'};return _0x4d5c15;}})});}_0x32075d=_['merge']({},_0x32075d,_0x1d5b6f[_0xccbb('0x3d')]);var _0xe8cb89={'where':_0x32075d[_0xccbb('0x39')]};return db['MailTransferReport'][_0xccbb('0x1c')](_0xe8cb89)['then'](function(_0x13126){_0x11d1ca[_0xccbb('0x1c')]=_0x13126;if(_0x1d5b6f[_0xccbb('0x30')]['includeAll']){_0x32075d['include']=[{'all':!![]}];}return db['MailTransferReport'][_0xccbb('0x3e')](_0x32075d);})[_0xccbb('0x23')](function(_0x221f2c){_0x11d1ca['rows']=_0x221f2c;return _0x11d1ca;})[_0xccbb('0x23')](respondWithFilteredResult(_0x22858,_0x32075d))['catch'](handleError(_0x22858,null));};exports[_0xccbb('0x3f')]=function(_0x3c19b5,_0x103b5a){var _0x4ee9c6={'raw':!![],'where':{'id':_0x3c19b5[_0xccbb('0x40')]['id']}},_0x3692ef={};_0x3692ef[_0xccbb('0x2f')]=_[_0xccbb('0x41')](db['MailTransferReport']['rawAttributes']);_0x3692ef[_0xccbb('0x30')]=_[_0xccbb('0x41')](_0x3c19b5[_0xccbb('0x30')]);_0x3692ef[_0xccbb('0x31')]=_[_0xccbb('0x32')](_0x3692ef[_0xccbb('0x2f')],_0x3692ef[_0xccbb('0x30')]);_0x4ee9c6[_0xccbb('0x33')]=_[_0xccbb('0x32')](_0x3692ef[_0xccbb('0x2f')],qs[_0xccbb('0x34')](_0x3c19b5['query'][_0xccbb('0x34')]));_0x4ee9c6[_0xccbb('0x33')]=_0x4ee9c6[_0xccbb('0x33')][_0xccbb('0x42')]?_0x4ee9c6['attributes']:_0x3692ef['model'];if(_0x3c19b5['query'][_0xccbb('0x43')]){_0x4ee9c6[_0xccbb('0x44')]=[{'all':!![]}];}_0x4ee9c6=_[_0xccbb('0x3c')]({},_0x4ee9c6,_0x3c19b5[_0xccbb('0x3d')]);return db[_0xccbb('0x2b')][_0xccbb('0x45')](_0x4ee9c6)[_0xccbb('0x23')](handleEntityNotFound(_0x103b5a,null))['then'](respondWithResult(_0x103b5a,null))[_0xccbb('0x46')](handleError(_0x103b5a,null));};exports['create']=function(_0x157b22,_0x423878){return db[_0xccbb('0x2b')][_0xccbb('0x47')](_0x157b22[_0xccbb('0x48')],{})[_0xccbb('0x23')](respondWithResult(_0x423878,0xc9))['catch'](handleError(_0x423878,null));};exports[_0xccbb('0x49')]=function(_0x125f08,_0x550e8d){if(_0x125f08[_0xccbb('0x48')]['id']){delete _0x125f08[_0xccbb('0x48')]['id'];}return db[_0xccbb('0x2b')][_0xccbb('0x45')]({'where':{'id':_0x125f08[_0xccbb('0x40')]['id']}})['then'](handleEntityNotFound(_0x550e8d,null))['then'](saveUpdates(_0x125f08[_0xccbb('0x48')],null))['then'](respondWithResult(_0x550e8d,null))['catch'](handleError(_0x550e8d,null));};exports[_0xccbb('0x24')]=function(_0x35a874,_0x4bc8d9){return db[_0xccbb('0x2b')][_0xccbb('0x45')]({'where':{'id':_0x35a874[_0xccbb('0x40')]['id']}})[_0xccbb('0x23')](handleEntityNotFound(_0x4bc8d9,null))[_0xccbb('0x23')](removeEntity(_0x4bc8d9,null))[_0xccbb('0x46')](handleError(_0x4bc8d9,null));};exports['describe']=function(_0xbc52b,_0x401eba){return db['MailTransferReport']['describe']()[_0xccbb('0x23')](respondWithResult(_0x401eba,null))[_0xccbb('0x46')](handleError(_0x401eba,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index ce884a0..0a8bff8 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 _0x1738=['lodash','util','moment','bluebird','request-promise','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x1738,0x1bc));var _0x8173=function(_0x34c819,_0x2d4fd5){_0x34c819=_0x34c819-0x0;var _0x51912e=_0x1738[_0x34c819];return _0x51912e;};'use strict';var _=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8173('0x2'));var BPromise=require(_0x8173('0x3'));var rp=require(_0x8173('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8173('0x5'));var attributes=require(_0x8173('0x6'));module[_0x8173('0x7')]=function(_0x3cf9ac,_0x2220fd){return _0x3cf9ac[_0x8173('0x8')](_0x8173('0x9'),attributes,{'tableName':_0x8173('0xa'),'paranoid':![],'indexes':[{'name':_0x8173('0xb'),'fields':[_0x8173('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb94=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer'];(function(_0x349449,_0x407a2f){var _0x4025ff=function(_0x47731d){while(--_0x47731d){_0x349449['push'](_0x349449['shift']());}};_0x4025ff(++_0x407a2f);}(_0xdb94,0xe5));var _0x4db9=function(_0x78da7b,_0x24afc7){_0x78da7b=_0x78da7b-0x0;var _0x4b741a=_0xdb94[_0x78da7b];return _0x4b741a;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var logger=require(_0x4db9('0x1'))('api');var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var fs=require('fs');var path=require(_0x4db9('0x5'));var rimraf=require(_0x4db9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x1d21a8,_0xc76bc1){return _0x1d21a8[_0x4db9('0x8')](_0x4db9('0x9'),attributes,{'tableName':_0x4db9('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4db9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8d7569a..db960e1 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 _0xa235=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xa235,0xdc));var _0x5a23=function(_0x5edcd7,_0x4c5e59){_0x5edcd7=_0x5edcd7-0x0;var _0x2f5b45=_0xa235[_0x5edcd7];return _0x2f5b45;};'use strict';var _=require(_0x5a23('0x0'));var util=require(_0x5a23('0x1'));var moment=require(_0x5a23('0x2'));var BPromise=require(_0x5a23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a23('0x4'));var db=require(_0x5a23('0x5'))['db'];var utils=require(_0x5a23('0x6'));var logger=require('../../config/logger')(_0x5a23('0x7'));var config=require(_0x5a23('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5a23('0x9')][_0x5a23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37f40f,_0x230d66,_0x1736bf){return new BPromise(function(_0x3a3156,_0x1ba833){return client[_0x5a23('0xb')](_0x37f40f,_0x1736bf)[_0x5a23('0xc')](function(_0x134b00){logger['info'](_0x5a23('0xd'),_0x230d66,_0x5a23('0xe'));logger['debug'](_0x5a23('0xf'),_0x230d66,_0x5a23('0xe'),JSON[_0x5a23('0x10')](_0x134b00));if(_0x134b00[_0x5a23('0x11')]){if(_0x134b00[_0x5a23('0x11')]['code']===0x1f4){logger[_0x5a23('0x11')](_0x5a23('0xd'),_0x230d66,_0x134b00[_0x5a23('0x11')][_0x5a23('0x12')]);return _0x1ba833(_0x134b00[_0x5a23('0x11')][_0x5a23('0x12')]);}logger[_0x5a23('0x11')](_0x5a23('0xd'),_0x230d66,_0x134b00['error']['message']);return _0x3a3156(_0x134b00[_0x5a23('0x11')][_0x5a23('0x12')]);}else{logger[_0x5a23('0x13')](_0x5a23('0xd'),_0x230d66,_0x5a23('0xe'));_0x3a3156(_0x134b00[_0x5a23('0x14')][_0x5a23('0x12')]);}})[_0x5a23('0x15')](function(_0x3a597d){logger['error'](_0x5a23('0xd'),_0x230d66,_0x3a597d);_0x1ba833(_0x3a597d);});});} \ No newline at end of file +var _0x2f53=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x5dfdac,_0x21a4ea){var _0x4e871e=function(_0x22bb68){while(--_0x22bb68){_0x5dfdac['push'](_0x5dfdac['shift']());}};_0x4e871e(++_0x21a4ea);}(_0x2f53,0x14e));var _0x32f5=function(_0xf125de,_0x1b74aa){_0xf125de=_0xf125de-0x0;var _0x2dfdc0=_0x2f53[_0xf125de];return _0x2dfdc0;};'use strict';var _=require(_0x32f5('0x0'));var util=require(_0x32f5('0x1'));var moment=require(_0x32f5('0x2'));var BPromise=require('bluebird');var rs=require(_0x32f5('0x3'));var fs=require('fs');var Redis=require(_0x32f5('0x4'));var db=require(_0x32f5('0x5'))['db'];var utils=require(_0x32f5('0x6'));var logger=require(_0x32f5('0x7'))(_0x32f5('0x8'));var config=require(_0x32f5('0x9'));var jayson=require(_0x32f5('0xa'));var client=jayson[_0x32f5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46bf59,_0x4cba12,_0x1f7ef5){return new BPromise(function(_0x6b066b,_0x3295a1){return client[_0x32f5('0xc')](_0x46bf59,_0x1f7ef5)[_0x32f5('0xd')](function(_0x7ab154){logger[_0x32f5('0xe')](_0x32f5('0xf'),_0x4cba12,_0x32f5('0x10'));logger[_0x32f5('0x11')](_0x32f5('0x12'),_0x4cba12,_0x32f5('0x10'),JSON[_0x32f5('0x13')](_0x7ab154));if(_0x7ab154[_0x32f5('0x14')]){if(_0x7ab154[_0x32f5('0x14')]['code']===0x1f4){logger[_0x32f5('0x14')](_0x32f5('0xf'),_0x4cba12,_0x7ab154[_0x32f5('0x14')][_0x32f5('0x15')]);return _0x3295a1(_0x7ab154[_0x32f5('0x14')][_0x32f5('0x15')]);}logger[_0x32f5('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x4cba12,_0x7ab154[_0x32f5('0x14')]['message']);return _0x6b066b(_0x7ab154[_0x32f5('0x14')]['message']);}else{logger[_0x32f5('0xe')](_0x32f5('0xf'),_0x4cba12,_0x32f5('0x10'));_0x6b066b(_0x7ab154[_0x32f5('0x16')]['message']);}})[_0x32f5('0x17')](function(_0x3a51fb){logger['error'](_0x32f5('0xf'),_0x4cba12,_0x3a51fb);_0x3295a1(_0x3a51fb);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 3f85962..f5bf2e0 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 _0x9851=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','util','path'];(function(_0x37dbe8,_0x10e968){var _0x2416b6=function(_0xd39957){while(--_0xd39957){_0x37dbe8['push'](_0x37dbe8['shift']());}};_0x2416b6(++_0x10e968);}(_0x9851,0x178));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x1985('0x0'));var path=require(_0x1985('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1985('0x2'));var auth=require(_0x1985('0x3'));var interaction=require(_0x1985('0x4'));var config=require(_0x1985('0x5'));var controller=require(_0x1985('0x6'));router[_0x1985('0x7')]('/',auth[_0x1985('0x8')](),controller[_0x1985('0x9')]);router[_0x1985('0x7')](_0x1985('0xa'),auth['isAuthenticated'](),controller[_0x1985('0xb')]);router['get'](_0x1985('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1985('0xd')]);router[_0x1985('0xe')]('/:id',auth[_0x1985('0x8')](),controller[_0x1985('0xf')]);router[_0x1985('0x10')](_0x1985('0xc'),auth[_0x1985('0x8')](),controller[_0x1985('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb124=['describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','/describe'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xb124,0x104));var _0x4b12=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb124[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x4b12('0x0'));var util=require(_0x4b12('0x1'));var path=require(_0x4b12('0x2'));var timeout=require(_0x4b12('0x3'));var express=require(_0x4b12('0x4'));var router=express[_0x4b12('0x5')]();var fs_extra=require(_0x4b12('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4b12('0x7'));var config=require('../../config/environment');var controller=require(_0x4b12('0x8'));router['get']('/',auth[_0x4b12('0x9')](),controller[_0x4b12('0xa')]);router[_0x4b12('0xb')](_0x4b12('0xc'),auth[_0x4b12('0x9')](),controller[_0x4b12('0xd')]);router[_0x4b12('0xb')](_0x4b12('0xe'),auth[_0x4b12('0x9')](),controller[_0x4b12('0xf')]);router['post']('/',auth[_0x4b12('0x9')](),controller[_0x4b12('0x10')]);router[_0x4b12('0x11')](_0x4b12('0xe'),auth[_0x4b12('0x9')](),controller[_0x4b12('0x12')]);router['delete'](_0x4b12('0xe'),auth[_0x4b12('0x9')](),controller[_0x4b12('0x13')]);module[_0x4b12('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a865cdc..154ef32 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 _0xc1ac=['talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x267745,_0x5630f5){var _0x172518=function(_0x140bea){while(--_0x140bea){_0x267745['push'](_0x267745['shift']());}};_0x172518(++_0x5630f5);}(_0xc1ac,0xcd));var _0xcc1a=function(_0xe81a0c,_0x34ff25){_0xe81a0c=_0xe81a0c-0x0;var _0x1843e9=_0xc1ac[_0xe81a0c];return _0x1843e9;};'use strict';var Sequelize=require(_0xcc1a('0x0'));var moment=require(_0xcc1a('0x1'));module[_0xcc1a('0x2')]={'channel':{'type':Sequelize[_0xcc1a('0x3')]},'membername':{'type':Sequelize[_0xcc1a('0x3')]},'interface':{'type':Sequelize[_0xcc1a('0x3')]},'type':{'type':Sequelize[_0xcc1a('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xcc1a('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xcc1a('0x5')]},'exitAt':{'type':Sequelize[_0xcc1a('0x5')],'set':function(_0x32d1e6){var _0x32eb95=moment(_0x32d1e6);var _0x4e5840=moment(this[_0xcc1a('0x6')](_0xcc1a('0x7')));var _0x491ca2=_0x32eb95[_0xcc1a('0x8')](_0x4e5840,_0xcc1a('0x9'));this['setDataValue'](_0xcc1a('0xa'),_0x32d1e6);this[_0xcc1a('0xb')](_0xcc1a('0xc'),_0x491ca2>=0x0?_0x491ca2:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xcc1a('0xd')},'data2':{'type':Sequelize[_0xcc1a('0x3')],'comment':_0xcc1a('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xcc1a('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xcc1a('0x10')},'data5':{'type':Sequelize[_0xcc1a('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xcc1a('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xcc1a('0x3')]}}; \ No newline at end of file +var _0x6d10=['DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING'];(function(_0x3bfefb,_0x1099d7){var _0x2ecc6b=function(_0x265fd7){while(--_0x265fd7){_0x3bfefb['push'](_0x3bfefb['shift']());}};_0x2ecc6b(++_0x1099d7);}(_0x6d10,0x1c7));var _0x06d1=function(_0x441b1a,_0x5ab402){_0x441b1a=_0x441b1a-0x0;var _0x26e234=_0x6d10[_0x441b1a];return _0x26e234;};'use strict';var Sequelize=require(_0x06d1('0x0'));var moment=require(_0x06d1('0x1'));module[_0x06d1('0x2')]={'channel':{'type':Sequelize[_0x06d1('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x06d1('0x3')]},'type':{'type':Sequelize[_0x06d1('0x3')],'defaultValue':_0x06d1('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x06d1('0x5')]},'enterAt':{'type':Sequelize[_0x06d1('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x35ceb4){var _0x271caa=moment(_0x35ceb4);var _0x340cc5=moment(this[_0x06d1('0x7')](_0x06d1('0x8')));var _0x43b11a=_0x271caa[_0x06d1('0x9')](_0x340cc5,_0x06d1('0xa'));this[_0x06d1('0xb')](_0x06d1('0xc'),_0x35ceb4);this[_0x06d1('0xb')]('duration',_0x43b11a>=0x0?_0x43b11a:null);}},'data1':{'type':Sequelize[_0x06d1('0x3')],'comment':_0x06d1('0xd')},'data2':{'type':Sequelize[_0x06d1('0x3')],'comment':_0x06d1('0xe')},'data3':{'type':Sequelize[_0x06d1('0x3')],'comment':_0x06d1('0xf')},'data4':{'type':Sequelize[_0x06d1('0x3')],'comment':_0x06d1('0x10')},'data5':{'type':Sequelize[_0x06d1('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x06d1('0x3')]},'internal':{'type':Sequelize[_0x06d1('0x5')]},'uniqueid':{'type':Sequelize[_0x06d1('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d4e02c1..fc8957f 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55ca,0x126));var _0xa55c=function(_0x311c35,_0x54a2b0){_0x311c35=_0x311c35-0x0;var _0x31ff65=_0x55ca[_0x311c35];return _0x31ff65;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,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(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xedd9,0xfc));var _0x9edd=function(_0x52b424,_0x188f79){_0x52b424=_0x52b424-0x0;var _0x5725af=_0xedd9[_0x52b424];return _0x5725af;};'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 9dae9a3..91eccc4 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 _0xffae=['report_member','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport'];(function(_0x4b214a,_0xa7d2fe){var _0x2726db=function(_0x588ca4){while(--_0x588ca4){_0x4b214a['push'](_0x4b214a['shift']());}};_0x2726db(++_0xa7d2fe);}(_0xffae,0x73));var _0xeffa=function(_0x4c714b,_0x4967b7){_0x4c714b=_0x4c714b-0x0;var _0x94dc32=_0xffae[_0x4c714b];return _0x94dc32;};'use strict';var _=require(_0xeffa('0x0'));var util=require(_0xeffa('0x1'));var logger=require(_0xeffa('0x2'))(_0xeffa('0x3'));var moment=require(_0xeffa('0x4'));var BPromise=require(_0xeffa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeffa('0x6'));var rimraf=require(_0xeffa('0x7'));var config=require(_0xeffa('0x8'));var attributes=require(_0xeffa('0x9'));module[_0xeffa('0xa')]=function(_0x4a050a,_0x3fd013){return _0x4a050a[_0xeffa('0xb')](_0xeffa('0xc'),attributes,{'tableName':_0xeffa('0xd'),'paranoid':![],'indexes':[{'name':_0xeffa('0xe'),'fields':[_0xeffa('0xf'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3216=['MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x21455d,_0x440cd9){var _0x21270f=function(_0x3395dd){while(--_0x3395dd){_0x21455d['push'](_0x21455d['shift']());}};_0x21270f(++_0x440cd9);}(_0x3216,0xf6));var _0x6321=function(_0xbe6229,_0x58ea93){_0xbe6229=_0xbe6229-0x0;var _0x1a4191=_0x3216[_0xbe6229];return _0x1a4191;};'use strict';var _=require(_0x6321('0x0'));var util=require(_0x6321('0x1'));var logger=require(_0x6321('0x2'))('api');var moment=require(_0x6321('0x3'));var BPromise=require(_0x6321('0x4'));var rp=require(_0x6321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6321('0x6'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x2232bd,_0x434436){return _0x2232bd['define'](_0x6321('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x6321('0x8'),'fields':[_0x6321('0x9'),_0x6321('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index cda966d..d120485 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 _0xdb70=['rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options','raw','where','include','map','model','attributes','debug','catch','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26f77d,_0x35de2c){var _0x208fa9=function(_0x18eb90){while(--_0x18eb90){_0x26f77d['push'](_0x26f77d['shift']());}};_0x208fa9(++_0x35de2c);}(_0xdb70,0xa0));var _0x0db7=function(_0x8245ea,_0x51eeea){_0x8245ea=_0x8245ea-0x0;var _0x4de9a1=_0xdb70[_0x8245ea];return _0x4de9a1;};'use strict';var _=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var moment=require(_0x0db7('0x2'));var BPromise=require('bluebird');var rs=require(_0x0db7('0x3'));var fs=require('fs');var Redis=require(_0x0db7('0x4'));var db=require(_0x0db7('0x5'))['db'];var utils=require(_0x0db7('0x6'));var logger=require(_0x0db7('0x7'))(_0x0db7('0x8'));var config=require(_0x0db7('0x9'));var jayson=require(_0x0db7('0xa'));var client=jayson[_0x0db7('0xb')][_0x0db7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x191a8e,_0x4c404e,_0x399095){return new BPromise(function(_0x1db9fe,_0x196b91){return client[_0x0db7('0xd')](_0x191a8e,_0x399095)[_0x0db7('0xe')](function(_0x3d43d6){logger['info'](_0x0db7('0xf'),_0x4c404e,_0x0db7('0x10'));logger['debug'](_0x0db7('0x11'),_0x4c404e,_0x0db7('0x10'),JSON[_0x0db7('0x12')](_0x3d43d6));if(_0x3d43d6[_0x0db7('0x13')]){if(_0x3d43d6['error'][_0x0db7('0x14')]===0x1f4){logger['error'](_0x0db7('0xf'),_0x4c404e,_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);return _0x196b91(_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);}logger['error'](_0x0db7('0xf'),_0x4c404e,_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);return _0x1db9fe(_0x3d43d6[_0x0db7('0x13')][_0x0db7('0x15')]);}else{logger[_0x0db7('0x16')](_0x0db7('0xf'),_0x4c404e,_0x0db7('0x10'));_0x1db9fe(_0x3d43d6[_0x0db7('0x17')][_0x0db7('0x15')]);}})['catch'](function(_0x21cd17){logger[_0x0db7('0x13')](_0x0db7('0xf'),_0x4c404e,_0x21cd17);_0x196b91(_0x21cd17);});});}exports[_0x0db7('0x18')]=function(_0x31082b){var _0x359b37=this;return new Promise(function(_0x52e95e,_0x51fc0f){return db[_0x0db7('0x19')][_0x0db7('0x1a')]({'raw':_0x31082b[_0x0db7('0x1b')]?_0x31082b['options'][_0x0db7('0x1c')]===undefined?!![]:![]:!![],'where':_0x31082b[_0x0db7('0x1b')]?_0x31082b[_0x0db7('0x1b')][_0x0db7('0x1d')]||null:null,'attributes':_0x31082b['options']?_0x31082b[_0x0db7('0x1b')]['attributes']||null:null,'limit':_0x31082b[_0x0db7('0x1b')]?_0x31082b['options']['limit']||null:null,'include':_0x31082b[_0x0db7('0x1b')]?_0x31082b[_0x0db7('0x1b')][_0x0db7('0x1e')]?_[_0x0db7('0x1f')](_0x31082b[_0x0db7('0x1b')][_0x0db7('0x1e')],function(_0xc05009){return{'model':db[_0xc05009[_0x0db7('0x20')]],'as':_0xc05009['as'],'attributes':_0xc05009[_0x0db7('0x21')],'include':_0xc05009[_0x0db7('0x1e')]?_[_0x0db7('0x1f')](_0xc05009[_0x0db7('0x1e')],function(_0x299c22){return{'model':db[_0x299c22[_0x0db7('0x20')]],'as':_0x299c22['as'],'attributes':_0x299c22['attributes'],'include':_0x299c22['include']?_['map'](_0x299c22['include'],function(_0x5d2e46){return{'model':db[_0x5d2e46[_0x0db7('0x20')]],'as':_0x5d2e46['as'],'attributes':_0x5d2e46[_0x0db7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0db7('0xe')](function(_0x55637e){logger['info'](_0x0db7('0x18'),_0x31082b);logger[_0x0db7('0x22')](_0x0db7('0x18'),_0x31082b,JSON[_0x0db7('0x12')](_0x55637e));_0x52e95e(_0x55637e);})[_0x0db7('0x23')](function(_0xfc7311){logger['error'](_0x0db7('0x18'),_0xfc7311['message'],_0x31082b);_0x51fc0f(_0x359b37[_0x0db7('0x13')](0x1f4,_0xfc7311[_0x0db7('0x15')]));});});};exports[_0x0db7('0x24')]=function(_0x1b5b1d){var _0x530c3e=this;return new Promise(function(_0x5e0ded,_0x5625ce){return db[_0x0db7('0x19')][_0x0db7('0x25')](_0x1b5b1d[_0x0db7('0x26')],{'raw':_0x1b5b1d['options']?_0x1b5b1d[_0x0db7('0x1b')][_0x0db7('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4db0a0){logger[_0x0db7('0x16')](_0x0db7('0x24'),_0x1b5b1d);logger[_0x0db7('0x22')]('CreateMemberReport',_0x1b5b1d,JSON['stringify'](_0x4db0a0));_0x5e0ded(_0x4db0a0);})[_0x0db7('0x23')](function(_0x127cfc){logger[_0x0db7('0x13')]('CreateMemberReport',_0x127cfc[_0x0db7('0x15')],_0x1b5b1d);_0x5625ce(_0x530c3e[_0x0db7('0x13')](0x1f4,_0x127cfc[_0x0db7('0x15')]));});});};exports[_0x0db7('0x27')]=function(_0x5a21d2){var _0x20a5ff=this;return new Promise(function(_0x50a405,_0x225bd4){return db['MemberReport'][_0x0db7('0x28')](_0x5a21d2[_0x0db7('0x26')],{'raw':_0x5a21d2[_0x0db7('0x1b')]?_0x5a21d2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a21d2[_0x0db7('0x1b')]?_0x5a21d2[_0x0db7('0x1b')][_0x0db7('0x1d')]||null:null,'attributes':_0x5a21d2[_0x0db7('0x1b')]?_0x5a21d2[_0x0db7('0x1b')][_0x0db7('0x21')]||null:null,'limit':_0x5a21d2['options']?_0x5a21d2[_0x0db7('0x1b')][_0x0db7('0x29')]||null:null})['then'](function(_0x1169e2){logger['info'](_0x0db7('0x27'),_0x5a21d2);logger['debug'](_0x0db7('0x27'),_0x5a21d2,JSON[_0x0db7('0x12')](_0x1169e2));_0x50a405(_0x1169e2);})['catch'](function(_0x43c721){logger[_0x0db7('0x13')]('UpdateMemberReport',_0x43c721[_0x0db7('0x15')],_0x5a21d2);_0x225bd4(_0x20a5ff['error'](0x1f4,_0x43c721[_0x0db7('0x15')]));});});}; \ No newline at end of file +var _0x2428=['MemberReport,\x20%s,\x20%s','error','message','result','GetMemberReport','MemberReport','options','raw','attributes','include','map','model','stringify','catch','CreateMemberReport','create','body','update','where','limit','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x2f84d8,_0x1bf8f){var _0x4e8c72=function(_0xe4e105){while(--_0xe4e105){_0x2f84d8['push'](_0x2f84d8['shift']());}};_0x4e8c72(++_0x1bf8f);}(_0x2428,0xd3));var _0x8242=function(_0x28c094,_0x309f00){_0x28c094=_0x28c094-0x0;var _0x3d8c87=_0x2428[_0x28c094];return _0x3d8c87;};'use strict';var _=require('lodash');var util=require(_0x8242('0x0'));var moment=require(_0x8242('0x1'));var BPromise=require(_0x8242('0x2'));var rs=require(_0x8242('0x3'));var fs=require('fs');var Redis=require(_0x8242('0x4'));var db=require(_0x8242('0x5'))['db'];var utils=require(_0x8242('0x6'));var logger=require(_0x8242('0x7'))(_0x8242('0x8'));var config=require(_0x8242('0x9'));var jayson=require(_0x8242('0xa'));var client=jayson['client'][_0x8242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11da5f,_0x3fb12e,_0x3712f3){return new BPromise(function(_0x1501e8,_0x4b9617){return client[_0x8242('0xc')](_0x11da5f,_0x3712f3)[_0x8242('0xd')](function(_0x12b115){logger[_0x8242('0xe')]('MemberReport,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'));logger[_0x8242('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3fb12e,_0x8242('0xf'),JSON['stringify'](_0x12b115));if(_0x12b115['error']){if(_0x12b115['error']['code']===0x1f4){logger['error'](_0x8242('0x11'),_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x4b9617(_0x12b115['error'][_0x8242('0x13')]);}logger[_0x8242('0x12')]('MemberReport,\x20%s,\x20%s',_0x3fb12e,_0x12b115[_0x8242('0x12')]['message']);return _0x1501e8(_0x12b115[_0x8242('0x12')][_0x8242('0x13')]);}else{logger[_0x8242('0xe')](_0x8242('0x11'),_0x3fb12e,_0x8242('0xf'));_0x1501e8(_0x12b115[_0x8242('0x14')][_0x8242('0x13')]);}})['catch'](function(_0x4ad29d){logger[_0x8242('0x12')](_0x8242('0x11'),_0x3fb12e,_0x4ad29d);_0x4b9617(_0x4ad29d);});});}exports[_0x8242('0x15')]=function(_0xad2711){var _0x12b745=this;return new Promise(function(_0x473f67,_0x2de515){return db[_0x8242('0x16')]['findAll']({'raw':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![],'where':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')]['where']||null:null,'attributes':_0xad2711[_0x8242('0x17')]?_0xad2711['options'][_0x8242('0x19')]||null:null,'limit':_0xad2711[_0x8242('0x17')]?_0xad2711['options']['limit']||null:null,'include':_0xad2711[_0x8242('0x17')]?_0xad2711[_0x8242('0x17')][_0x8242('0x1a')]?_[_0x8242('0x1b')](_0xad2711[_0x8242('0x17')][_0x8242('0x1a')],function(_0x35196f){return{'model':db[_0x35196f['model']],'as':_0x35196f['as'],'attributes':_0x35196f['attributes'],'include':_0x35196f['include']?_[_0x8242('0x1b')](_0x35196f[_0x8242('0x1a')],function(_0x4e3caa){return{'model':db[_0x4e3caa['model']],'as':_0x4e3caa['as'],'attributes':_0x4e3caa[_0x8242('0x19')],'include':_0x4e3caa[_0x8242('0x1a')]?_['map'](_0x4e3caa[_0x8242('0x1a')],function(_0x483632){return{'model':db[_0x483632[_0x8242('0x1c')]],'as':_0x483632['as'],'attributes':_0x483632['attributes']};}):[]};}):[]};}):[]:[]})[_0x8242('0xd')](function(_0x20f2b7){logger['info'](_0x8242('0x15'),_0xad2711);logger[_0x8242('0x10')](_0x8242('0x15'),_0xad2711,JSON[_0x8242('0x1d')](_0x20f2b7));_0x473f67(_0x20f2b7);})[_0x8242('0x1e')](function(_0x2766b0){logger[_0x8242('0x12')](_0x8242('0x15'),_0x2766b0[_0x8242('0x13')],_0xad2711);_0x2de515(_0x12b745[_0x8242('0x12')](0x1f4,_0x2766b0[_0x8242('0x13')]));});});};exports[_0x8242('0x1f')]=function(_0x44f2ca){var _0x163b1e=this;return new Promise(function(_0x358fd1,_0x22edf0){return db[_0x8242('0x16')][_0x8242('0x20')](_0x44f2ca[_0x8242('0x21')],{'raw':_0x44f2ca[_0x8242('0x17')]?_0x44f2ca[_0x8242('0x17')][_0x8242('0x18')]===undefined?!![]:![]:!![]})[_0x8242('0xd')](function(_0x52de30){logger[_0x8242('0xe')](_0x8242('0x1f'),_0x44f2ca);logger[_0x8242('0x10')](_0x8242('0x1f'),_0x44f2ca,JSON[_0x8242('0x1d')](_0x52de30));_0x358fd1(_0x52de30);})[_0x8242('0x1e')](function(_0x31e36b){logger['error']('CreateMemberReport',_0x31e36b[_0x8242('0x13')],_0x44f2ca);_0x22edf0(_0x163b1e['error'](0x1f4,_0x31e36b[_0x8242('0x13')]));});});};exports['UpdateMemberReport']=function(_0x2b1668){var _0x27a6f8=this;return new Promise(function(_0x1176ed,_0x2a06b7){return db[_0x8242('0x16')][_0x8242('0x22')](_0x2b1668[_0x8242('0x21')],{'raw':_0x2b1668['options']?_0x2b1668['options'][_0x8242('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1668[_0x8242('0x17')]?_0x2b1668[_0x8242('0x17')][_0x8242('0x23')]||null:null,'attributes':_0x2b1668['options']?_0x2b1668[_0x8242('0x17')]['attributes']||null:null,'limit':_0x2b1668[_0x8242('0x17')]?_0x2b1668[_0x8242('0x17')][_0x8242('0x24')]||null:null})['then'](function(_0x4b8dd9){logger[_0x8242('0xe')](_0x8242('0x25'),_0x2b1668);logger['debug'](_0x8242('0x25'),_0x2b1668,JSON['stringify'](_0x4b8dd9));_0x1176ed(_0x4b8dd9);})['catch'](function(_0x693fa3){logger['error'](_0x8242('0x25'),_0x693fa3[_0x8242('0x13')],_0x2b1668);_0x2a06b7(_0x27a6f8[_0x8242('0x12')](0x1f4,_0x693fa3['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index decad96..5b8c091 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 _0xd2e3=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer'];(function(_0x3f5672,_0xacd24f){var _0x5c4b36=function(_0x120d7e){while(--_0x120d7e){_0x3f5672['push'](_0x3f5672['shift']());}};_0x5c4b36(++_0xacd24f);}(_0xd2e3,0x1e3));var _0x3d2e=function(_0x4e1a34,_0x40d7d3){_0x4e1a34=_0x4e1a34-0x0;var _0x1345a7=_0xd2e3[_0x4e1a34];return _0x1345a7;};'use strict';var multer=require(_0x3d2e('0x0'));var util=require('util');var path=require(_0x3d2e('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d2e('0x2'));var router=express[_0x3d2e('0x3')]();var fs_extra=require(_0x3d2e('0x4'));var auth=require(_0x3d2e('0x5'));var interaction=require(_0x3d2e('0x6'));var config=require(_0x3d2e('0x7'));var controller=require(_0x3d2e('0x8'));router[_0x3d2e('0x9')]('/',controller[_0x3d2e('0xa')]);module['exports']=router; \ No newline at end of file +var _0xf583=['get','index','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf583,0x111));var _0x3f58=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xf583[_0x313c96];return _0x522f53;};'use strict';var multer=require(_0x3f58('0x0'));var util=require(_0x3f58('0x1'));var path=require('path');var timeout=require(_0x3f58('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3f58('0x3'));var auth=require(_0x3f58('0x4'));var interaction=require(_0x3f58('0x5'));var config=require('../../config/environment');var controller=require(_0x3f58('0x6'));router[_0x3f58('0x7')]('/',controller[_0x3f58('0x8')]);module[_0x3f58('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 902b93f..2d66d0a 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 _0xbbbb=['STRING','sequelize','exports'];(function(_0x33408c,_0x4fe051){var _0x73c3=function(_0x2f3dd0){while(--_0x2f3dd0){_0x33408c['push'](_0x33408c['shift']());}};_0x73c3(++_0x4fe051);}(_0xbbbb,0x145));var _0xbbbb=function(_0x2ce529,_0x416354){_0x2ce529=_0x2ce529-0x0;var _0x2c92b7=_0xbbbb[_0x2ce529];return _0x2c92b7;};'use strict';var Sequelize=require(_0xbbbb('0x0'));module[_0xbbbb('0x1')]={'version':{'type':Sequelize[_0xbbbb('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x0fb9=['sequelize','exports','STRING'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0x0fb9,0x1e0));var _0x90fb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0fb9[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x90fb('0x0'));module[_0x90fb('0x1')]={'version':{'type':Sequelize[_0x90fb('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 7febbf6..514a3ba 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 _0x6e71=['update','then','end','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x6e7446,_0x120a01){var _0x167b36=function(_0x909f1a){while(--_0x909f1a){_0x6e7446['push'](_0x6e7446['shift']());}};_0x167b36(++_0x120a01);}(_0x6e71,0x1ac));var _0x16e7=function(_0x3a524e,_0x4bf183){_0x3a524e=_0x3a524e-0x0;var _0x44b8c0=_0x6e71[_0x3a524e];return _0x44b8c0;};'use strict';var emlformat=require(_0x16e7('0x0'));var rimraf=require(_0x16e7('0x1'));var zipdir=require(_0x16e7('0x2'));var jsonpatch=require(_0x16e7('0x3'));var rp=require(_0x16e7('0x4'));var moment=require(_0x16e7('0x5'));var BPromise=require(_0x16e7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x16e7('0x7'));var sox=require(_0x16e7('0x8'));var csv=require(_0x16e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16e7('0xa'));var _=require('lodash');var squel=require(_0x16e7('0xb'));var crypto=require(_0x16e7('0xc'));var jsforce=require(_0x16e7('0xd'));var deskjs=require(_0x16e7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x16e7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x16e7('0x10'));var as=require(_0x16e7('0x11'));var hardwareService=require(_0x16e7('0x12'));var logger=require('../../config/logger')(_0x16e7('0x13'));var utils=require(_0x16e7('0x14'));var config=require(_0x16e7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x16e7('0x16'))['db'];function respondWithStatusCode(_0x25cb95,_0x184c53){_0x184c53=_0x184c53||0xcc;return function(_0xad3752){if(_0xad3752){return _0x25cb95[_0x16e7('0x17')](_0x184c53);}return _0x25cb95[_0x16e7('0x18')](_0x184c53)['end']();};}function respondWithResult(_0x4fe6b0,_0x5082f0){_0x5082f0=_0x5082f0||0xc8;return function(_0x4ed951){if(_0x4ed951){return _0x4fe6b0[_0x16e7('0x18')](_0x5082f0)[_0x16e7('0x19')](_0x4ed951);}};}function respondWithFilteredResult(_0x1fb421,_0x2874cd){return function(_0x1bbfd2){if(_0x1bbfd2){var _0x469255=typeof _0x2874cd[_0x16e7('0x1a')]===_0x16e7('0x1b')&&typeof _0x2874cd[_0x16e7('0x1c')]==='undefined';var _0x13efd0=_0x1bbfd2[_0x16e7('0x1d')];var _0x6ee666=_0x469255?0x0:_0x2874cd[_0x16e7('0x1a')];var _0x4aacd0=_0x469255?_0x1bbfd2['count']:_0x2874cd[_0x16e7('0x1a')]+_0x2874cd[_0x16e7('0x1c')];var _0x178116;if(_0x4aacd0>=_0x13efd0){_0x4aacd0=_0x13efd0;_0x178116=0xc8;}else{_0x178116=0xce;}_0x1fb421[_0x16e7('0x18')](_0x178116);return _0x1fb421['set'](_0x16e7('0x1e'),_0x6ee666+'-'+_0x4aacd0+'/'+_0x13efd0)[_0x16e7('0x19')](_0x1bbfd2);}return null;};}function patchUpdates(_0x4a149c){return function(_0x246429){try{jsonpatch[_0x16e7('0x1f')](_0x246429,_0x4a149c,!![]);}catch(_0x57de01){return BPromise[_0x16e7('0x20')](_0x57de01);}return _0x246429[_0x16e7('0x21')]();};}function saveUpdates(_0x24cefd,_0x4704f6){return function(_0x3690f7){if(_0x3690f7){return _0x3690f7[_0x16e7('0x22')](_0x24cefd)['then'](function(_0x27abc9){return _0x27abc9;});}return null;};}function removeEntity(_0x471cfa,_0x28b9ff){return function(_0x4839b1){if(_0x4839b1){return _0x4839b1['destroy']()[_0x16e7('0x23')](function(){_0x471cfa[_0x16e7('0x18')](0xcc)[_0x16e7('0x24')]();});}};}function handleEntityNotFound(_0x18e480,_0x2117b1){return function(_0x2136b7){if(!_0x2136b7){_0x18e480['sendStatus'](0x194);}return _0x2136b7;};}function handleError(_0x595461,_0x57a96a){_0x57a96a=_0x57a96a||0x1f4;return function(_0xf005f0){logger['error'](_0xf005f0[_0x16e7('0x25')]);if(_0xf005f0[_0x16e7('0x26')]){delete _0xf005f0[_0x16e7('0x26')];}_0x595461[_0x16e7('0x18')](_0x57a96a)['send'](_0xf005f0);};}exports[_0x16e7('0x27')]=function(_0x10ef4a,_0x40a6c2){var _0x4eb7d8={},_0x165502={},_0x57da39={'count':0x0,'rows':[]};var _0x2705fc=_[_0x16e7('0x28')](db[_0x16e7('0x29')][_0x16e7('0x2a')],function(_0x59e0d3){return{'name':_0x59e0d3[_0x16e7('0x2b')],'type':_0x59e0d3[_0x16e7('0x2c')][_0x16e7('0x2d')]};});_0x165502[_0x16e7('0x2e')]=_[_0x16e7('0x28')](_0x2705fc,_0x16e7('0x26'));_0x165502[_0x16e7('0x2f')]=_[_0x16e7('0x30')](_0x10ef4a['query']);_0x165502['filters']=_[_0x16e7('0x31')](_0x165502['model'],_0x165502[_0x16e7('0x2f')]);_0x4eb7d8[_0x16e7('0x32')]=_[_0x16e7('0x31')](_0x165502['model'],qs[_0x16e7('0x33')](_0x10ef4a[_0x16e7('0x2f')][_0x16e7('0x33')]));_0x4eb7d8[_0x16e7('0x32')]=_0x4eb7d8['attributes'][_0x16e7('0x34')]?_0x4eb7d8[_0x16e7('0x32')]:_0x165502[_0x16e7('0x2e')];if(!_0x10ef4a[_0x16e7('0x2f')]['hasOwnProperty']('nolimit')){_0x4eb7d8['limit']=qs['limit'](_0x10ef4a[_0x16e7('0x2f')]['limit']);_0x4eb7d8[_0x16e7('0x1a')]=qs[_0x16e7('0x1a')](_0x10ef4a[_0x16e7('0x2f')][_0x16e7('0x1a')]);}_0x4eb7d8['order']=qs[_0x16e7('0x35')](_0x10ef4a[_0x16e7('0x2f')][_0x16e7('0x35')]);_0x4eb7d8['where']=qs[_0x16e7('0x36')](_[_0x16e7('0x37')](_0x10ef4a[_0x16e7('0x2f')],_0x165502['filters']),_0x2705fc);if(_0x10ef4a[_0x16e7('0x2f')][_0x16e7('0x38')]){_0x4eb7d8[_0x16e7('0x39')]=_[_0x16e7('0x3a')](_0x4eb7d8[_0x16e7('0x39')],{'$or':_[_0x16e7('0x28')](_0x2705fc,function(_0x2e21a2){if(_0x2e21a2[_0x16e7('0x2c')]!==_0x16e7('0x3b')){var _0x3e6db2={};_0x3e6db2[_0x2e21a2['name']]={'$like':'%'+_0x10ef4a[_0x16e7('0x2f')]['filter']+'%'};return _0x3e6db2;}})});}_0x4eb7d8=_[_0x16e7('0x3a')]({},_0x4eb7d8,_0x10ef4a[_0x16e7('0x3c')]);var _0x446d2c={'where':_0x4eb7d8[_0x16e7('0x39')]};return db[_0x16e7('0x29')][_0x16e7('0x1d')](_0x446d2c)[_0x16e7('0x23')](function(_0x1c2158){_0x57da39[_0x16e7('0x1d')]=_0x1c2158;if(_0x10ef4a[_0x16e7('0x2f')][_0x16e7('0x3d')]){_0x4eb7d8[_0x16e7('0x3e')]=[{'all':!![]}];}return db['Migration'][_0x16e7('0x3f')](_0x4eb7d8);})[_0x16e7('0x23')](function(_0x5c88ef){_0x57da39[_0x16e7('0x40')]=_0x5c88ef;return _0x57da39;})['then'](respondWithFilteredResult(_0x40a6c2,_0x4eb7d8))[_0x16e7('0x41')](handleError(_0x40a6c2,null));}; \ No newline at end of file +var _0xc668=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Migration','include','findAll','catch','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra'];(function(_0x23f642,_0x3c8f66){var _0x4ba0d0=function(_0x507a88){while(--_0x507a88){_0x23f642['push'](_0x23f642['shift']());}};_0x4ba0d0(++_0x3c8f66);}(_0xc668,0x107));var _0x8c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc668[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c66('0x0'));var zipdir=require(_0x8c66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c66('0x2'));var BPromise=require(_0x8c66('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c66('0x4'));var sox=require(_0x8c66('0x5'));var csv=require(_0x8c66('0x6'));var ejs=require(_0x8c66('0x7'));var fs=require('fs');var fs_extra=require(_0x8c66('0x8'));var _=require('lodash');var squel=require(_0x8c66('0x9'));var crypto=require(_0x8c66('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8c66('0xb'));var toCsv=require(_0x8c66('0x6'));var querystring=require(_0x8c66('0xc'));var Papa=require(_0x8c66('0xd'));var Redis=require(_0x8c66('0xe'));var authService=require(_0x8c66('0xf'));var qs=require(_0x8c66('0x10'));var as=require(_0x8c66('0x11'));var hardwareService=require(_0x8c66('0x12'));var logger=require(_0x8c66('0x13'))(_0x8c66('0x14'));var utils=require(_0x8c66('0x15'));var config=require(_0x8c66('0x16'));var licenseUtil=require(_0x8c66('0x17'));var db=require(_0x8c66('0x18'))['db'];function respondWithStatusCode(_0x1f62ee,_0x33b4f6){_0x33b4f6=_0x33b4f6||0xcc;return function(_0x380012){if(_0x380012){return _0x1f62ee[_0x8c66('0x19')](_0x33b4f6);}return _0x1f62ee[_0x8c66('0x1a')](_0x33b4f6)['end']();};}function respondWithResult(_0x5d3f53,_0x2206f7){_0x2206f7=_0x2206f7||0xc8;return function(_0x488876){if(_0x488876){return _0x5d3f53[_0x8c66('0x1a')](_0x2206f7)[_0x8c66('0x1b')](_0x488876);}};}function respondWithFilteredResult(_0x557fcd,_0x1bc5ea){return function(_0x5ac509){if(_0x5ac509){var _0x382122=typeof _0x1bc5ea['offset']===_0x8c66('0x1c')&&typeof _0x1bc5ea['limit']===_0x8c66('0x1c');var _0x97f96c=_0x5ac509[_0x8c66('0x1d')];var _0x3c6e1c=_0x382122?0x0:_0x1bc5ea[_0x8c66('0x1e')];var _0x4bbf9f=_0x382122?_0x5ac509[_0x8c66('0x1d')]:_0x1bc5ea[_0x8c66('0x1e')]+_0x1bc5ea[_0x8c66('0x1f')];var _0x56c9b9;if(_0x4bbf9f>=_0x97f96c){_0x4bbf9f=_0x97f96c;_0x56c9b9=0xc8;}else{_0x56c9b9=0xce;}_0x557fcd[_0x8c66('0x1a')](_0x56c9b9);return _0x557fcd[_0x8c66('0x20')](_0x8c66('0x21'),_0x3c6e1c+'-'+_0x4bbf9f+'/'+_0x97f96c)[_0x8c66('0x1b')](_0x5ac509);}return null;};}function patchUpdates(_0x8648db){return function(_0x30b82d){try{jsonpatch['apply'](_0x30b82d,_0x8648db,!![]);}catch(_0x5abce3){return BPromise['reject'](_0x5abce3);}return _0x30b82d['save']();};}function saveUpdates(_0x3b9cd2,_0x5e5f2b){return function(_0x3d548b){if(_0x3d548b){return _0x3d548b[_0x8c66('0x22')](_0x3b9cd2)[_0x8c66('0x23')](function(_0x5c37da){return _0x5c37da;});}return null;};}function removeEntity(_0x4934b6,_0x29cf26){return function(_0xf6157e){if(_0xf6157e){return _0xf6157e['destroy']()[_0x8c66('0x23')](function(){_0x4934b6[_0x8c66('0x1a')](0xcc)[_0x8c66('0x24')]();});}};}function handleEntityNotFound(_0x4747fe,_0x2a56b8){return function(_0x159be8){if(!_0x159be8){_0x4747fe[_0x8c66('0x19')](0x194);}return _0x159be8;};}function handleError(_0x534862,_0x3232bb){_0x3232bb=_0x3232bb||0x1f4;return function(_0x5e9462){logger[_0x8c66('0x25')](_0x5e9462[_0x8c66('0x26')]);if(_0x5e9462[_0x8c66('0x27')]){delete _0x5e9462['name'];}_0x534862[_0x8c66('0x1a')](_0x3232bb)[_0x8c66('0x28')](_0x5e9462);};}exports['index']=function(_0x43e5ac,_0x511ccc){var _0x570a14={},_0xa61bf4={},_0x18e0d0={'count':0x0,'rows':[]};var _0x1a066d=_[_0x8c66('0x29')](db['Migration'][_0x8c66('0x2a')],function(_0x3bcde6){return{'name':_0x3bcde6[_0x8c66('0x2b')],'type':_0x3bcde6[_0x8c66('0x2c')][_0x8c66('0x2d')]};});_0xa61bf4['model']=_[_0x8c66('0x29')](_0x1a066d,_0x8c66('0x27'));_0xa61bf4['query']=_[_0x8c66('0x2e')](_0x43e5ac['query']);_0xa61bf4[_0x8c66('0x2f')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],_0xa61bf4[_0x8c66('0x32')]);_0x570a14[_0x8c66('0x33')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],qs['fields'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x34')]));_0x570a14[_0x8c66('0x33')]=_0x570a14[_0x8c66('0x33')][_0x8c66('0x35')]?_0x570a14[_0x8c66('0x33')]:_0xa61bf4[_0x8c66('0x31')];if(!_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x36')](_0x8c66('0x37'))){_0x570a14[_0x8c66('0x1f')]=qs['limit'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x1f')]);_0x570a14[_0x8c66('0x1e')]=qs[_0x8c66('0x1e')](_0x43e5ac['query'][_0x8c66('0x1e')]);}_0x570a14[_0x8c66('0x38')]=qs[_0x8c66('0x39')](_0x43e5ac['query'][_0x8c66('0x39')]);_0x570a14[_0x8c66('0x3a')]=qs[_0x8c66('0x2f')](_[_0x8c66('0x3b')](_0x43e5ac[_0x8c66('0x32')],_0xa61bf4[_0x8c66('0x2f')]),_0x1a066d);if(_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]){_0x570a14[_0x8c66('0x3a')]=_['merge'](_0x570a14[_0x8c66('0x3a')],{'$or':_[_0x8c66('0x29')](_0x1a066d,function(_0x3b7ee3){if(_0x3b7ee3[_0x8c66('0x2c')]!==_0x8c66('0x3d')){var _0x11e69c={};_0x11e69c[_0x3b7ee3[_0x8c66('0x27')]]={'$like':'%'+_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]+'%'};return _0x11e69c;}})});}_0x570a14=_[_0x8c66('0x3e')]({},_0x570a14,_0x43e5ac[_0x8c66('0x3f')]);var _0x5ccae8={'where':_0x570a14['where']};return db[_0x8c66('0x40')][_0x8c66('0x1d')](_0x5ccae8)[_0x8c66('0x23')](function(_0x9e299){_0x18e0d0[_0x8c66('0x1d')]=_0x9e299;if(_0x43e5ac['query']['includeAll']){_0x570a14[_0x8c66('0x41')]=[{'all':!![]}];}return db[_0x8c66('0x40')][_0x8c66('0x42')](_0x570a14);})[_0x8c66('0x23')](function(_0xd40151){_0x18e0d0['rows']=_0xd40151;return _0x18e0d0;})[_0x8c66('0x23')](respondWithFilteredResult(_0x511ccc,_0x570a14))[_0x8c66('0x43')](handleError(_0x511ccc,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 610513d..6443a85 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 _0xddc4=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api','moment'];(function(_0x4e0ca5,_0x208bb8){var _0x4e9d4d=function(_0x284461){while(--_0x284461){_0x4e0ca5['push'](_0x4e0ca5['shift']());}};_0x4e9d4d(++_0x208bb8);}(_0xddc4,0xdc));var _0x4ddc=function(_0x1bc470,_0x576a04){_0x1bc470=_0x1bc470-0x0;var _0x18730b=_0xddc4[_0x1bc470];return _0x18730b;};'use strict';var _=require('lodash');var util=require(_0x4ddc('0x0'));var logger=require(_0x4ddc('0x1'))(_0x4ddc('0x2'));var moment=require(_0x4ddc('0x3'));var BPromise=require(_0x4ddc('0x4'));var rp=require(_0x4ddc('0x5'));var fs=require('fs');var path=require(_0x4ddc('0x6'));var rimraf=require(_0x4ddc('0x7'));var config=require(_0x4ddc('0x8'));var attributes=require(_0x4ddc('0x9'));module[_0x4ddc('0xa')]=function(_0xb16a9b,_0xbcb93e){return _0xb16a9b[_0x4ddc('0xb')](_0x4ddc('0xc'),attributes,{'tableName':_0x4ddc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ee5=['lodash','../../config/logger','api','path','rimraf','../../config/environment','./migration.attributes','Migration','migrations'];(function(_0x5b5473,_0x5c1a2f){var _0x32cfdb=function(_0x3ad8aa){while(--_0x3ad8aa){_0x5b5473['push'](_0x5b5473['shift']());}};_0x32cfdb(++_0x5c1a2f);}(_0x9ee5,0x18c));var _0x59ee=function(_0x446366,_0x45ecc3){_0x446366=_0x446366-0x0;var _0x9ff139=_0x9ee5[_0x446366];return _0x9ff139;};'use strict';var _=require(_0x59ee('0x0'));var util=require('util');var logger=require(_0x59ee('0x1'))(_0x59ee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x59ee('0x3'));var rimraf=require(_0x59ee('0x4'));var config=require(_0x59ee('0x5'));var attributes=require(_0x59ee('0x6'));module['exports']=function(_0x64b61b,_0x2623b4){return _0x64b61b['define'](_0x59ee('0x7'),attributes,{'tableName':_0x59ee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 8870ed7..25a8e98 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 _0xb469=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x6fbccf,_0x13be0e){var _0x4d7cd1=function(_0x57a66c){while(--_0x57a66c){_0x6fbccf['push'](_0x6fbccf['shift']());}};_0x4d7cd1(++_0x13be0e);}(_0xb469,0x13b));var _0x9b46=function(_0x179913,_0x590ea2){_0x179913=_0x179913-0x0;var _0x263647=_0xb469[_0x179913];return _0x263647;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});} \ No newline at end of file +var _0x9990=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xb57a35,_0xbe1fdf){var _0x1ffa00=function(_0x54efeb){while(--_0x54efeb){_0xb57a35['push'](_0xb57a35['shift']());}};_0x1ffa00(++_0xbe1fdf);}(_0x9990,0xf6));var _0x0999=function(_0x3ab14c,_0x4093a1){_0x3ab14c=_0x3ab14c-0x0;var _0x423753=_0x9990[_0x3ab14c];return _0x423753;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var moment=require(_0x0999('0x1'));var BPromise=require(_0x0999('0x2'));var rs=require(_0x0999('0x3'));var fs=require('fs');var Redis=require(_0x0999('0x4'));var db=require(_0x0999('0x5'))['db'];var utils=require(_0x0999('0x6'));var logger=require(_0x0999('0x7'))('rpc');var config=require(_0x0999('0x8'));var jayson=require(_0x0999('0x9'));var client=jayson[_0x0999('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6f23,_0xb1d8f9,_0x3fe805){return new BPromise(function(_0x304f75,_0x384a4e){return client[_0x0999('0xb')](_0x1a6f23,_0x3fe805)[_0x0999('0xc')](function(_0x52d196){logger[_0x0999('0xd')](_0x0999('0xe'),_0xb1d8f9,_0x0999('0xf'));logger['debug'](_0x0999('0x10'),_0xb1d8f9,_0x0999('0xf'),JSON[_0x0999('0x11')](_0x52d196));if(_0x52d196['error']){if(_0x52d196[_0x0999('0x12')]['code']===0x1f4){logger[_0x0999('0x12')](_0x0999('0xe'),_0xb1d8f9,_0x52d196[_0x0999('0x12')][_0x0999('0x13')]);return _0x384a4e(_0x52d196[_0x0999('0x12')]['message']);}logger[_0x0999('0x12')](_0x0999('0xe'),_0xb1d8f9,_0x52d196[_0x0999('0x12')][_0x0999('0x13')]);return _0x304f75(_0x52d196[_0x0999('0x12')]['message']);}else{logger[_0x0999('0xd')](_0x0999('0xe'),_0xb1d8f9,_0x0999('0xf'));_0x304f75(_0x52d196[_0x0999('0x14')][_0x0999('0x13')]);}})[_0x0999('0x15')](function(_0x2fa43e){logger['error'](_0x0999('0xe'),_0xb1d8f9,_0x2fa43e);_0x384a4e(_0x2fa43e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 53151c6..3ea95c3 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 _0x9a5e=['./network.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x9a5e,0xee));var _0xe9a5=function(_0x58fcad,_0x27b788){_0x58fcad=_0x58fcad-0x0;var _0x34d36d=_0x9a5e[_0x58fcad];return _0x34d36d;};'use strict';var multer=require(_0xe9a5('0x0'));var util=require(_0xe9a5('0x1'));var path=require(_0xe9a5('0x2'));var timeout=require(_0xe9a5('0x3'));var express=require(_0xe9a5('0x4'));var router=express[_0xe9a5('0x5')]();var fs_extra=require(_0xe9a5('0x6'));var auth=require(_0xe9a5('0x7'));var interaction=require(_0xe9a5('0x8'));var config=require('../../config/environment');var controller=require(_0xe9a5('0x9'));router[_0xe9a5('0xa')]('/',auth[_0xe9a5('0xb')](),controller['index']);router['get'](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0xd')]);router['post']('/',auth[_0xe9a5('0xb')](),controller[_0xe9a5('0xe')]);router[_0xe9a5('0xf')](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0x10')]);router[_0xe9a5('0x11')](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdbc6=['isAuthenticated','/:id','show','post','create','put','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1654e8,_0x3660d4){var _0x3a3451=function(_0x4bb67e){while(--_0x4bb67e){_0x1654e8['push'](_0x1654e8['shift']());}};_0x3a3451(++_0x3660d4);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x36896b,_0x431ac2){_0x36896b=_0x36896b-0x0;var _0x5d6bf7=_0xdbc6[_0x36896b];return _0x5d6bf7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6dbc('0x0'));var timeout=require('connect-timeout');var express=require(_0x6dbc('0x1'));var router=express[_0x6dbc('0x2')]();var fs_extra=require(_0x6dbc('0x3'));var auth=require(_0x6dbc('0x4'));var interaction=require(_0x6dbc('0x5'));var config=require(_0x6dbc('0x6'));var controller=require('./network.controller');router[_0x6dbc('0x7')]('/',auth[_0x6dbc('0x8')](),controller['index']);router[_0x6dbc('0x7')](_0x6dbc('0x9'),auth[_0x6dbc('0x8')](),controller[_0x6dbc('0xa')]);router[_0x6dbc('0xb')]('/',auth['isAuthenticated'](),controller[_0x6dbc('0xc')]);router[_0x6dbc('0xd')]('/:id',auth[_0x6dbc('0x8')](),controller[_0x6dbc('0xe')]);router['delete'](_0x6dbc('0x9'),auth[_0x6dbc('0x8')](),controller[_0x6dbc('0xf')]);module[_0x6dbc('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e65e3ad..faaf8a0 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 _0xf2a2=['stun','turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xf2a2,0x15a));var _0x2f2a=function(_0x2bfe36,_0x5773b3){_0x2bfe36=_0x2bfe36-0x0;var _0x17dd89=_0xf2a2[_0x2bfe36];return _0x17dd89;};'use strict';var Sequelize=require(_0x2f2a('0x0'));module['exports']={'type':{'type':Sequelize[_0x2f2a('0x1')](_0x2f2a('0x2'),_0x2f2a('0x3'),_0x2f2a('0x4'),_0x2f2a('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2f2a('0x6')]}}; \ No newline at end of file +var _0x37dc=['exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x455c52,_0x39a045){var _0xb217ea=function(_0xb6d8c1){while(--_0xb6d8c1){_0x455c52['push'](_0x455c52['shift']());}};_0xb217ea(++_0x39a045);}(_0x37dc,0x196));var _0xc37d=function(_0x58beae,_0x3634b3){_0x58beae=_0x58beae-0x0;var _0x33f2c6=_0x37dc[_0x58beae];return _0x33f2c6;};'use strict';var Sequelize=require('sequelize');module[_0xc37d('0x0')]={'type':{'type':Sequelize[_0xc37d('0x1')](_0xc37d('0x2'),_0xc37d('0x3'),_0xc37d('0x4'),_0xc37d('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc37d('0x6')]},'password':{'type':Sequelize[_0xc37d('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8e2a534..be4e077 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 _0x66c7=['Network,\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','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','show','params','find','create','body','findAll','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','toUpperCase','TURN','toLowerCase','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x66c7,0x13e));var _0x766c=function(_0x3fc81e,_0x24de72){_0x3fc81e=_0x3fc81e-0x0;var _0x4d0d12=_0x66c7[_0x3fc81e];return _0x4d0d12;};'use strict';var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x766c('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x766c('0x1'));var client=jayson[_0x766c('0x2')][_0x766c('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x5b644d,_0x4b2e72,_0x387edb,_0x50b09e){return new Promise(function(_0x216be7,_0x1b4fb5){var _0x249352=_0x50b09e||client;return _0x249352[_0x766c('0x4')](_0x5b644d,_0x387edb)['then'](function(_0x38c567){logger[_0x766c('0x5')](_0x766c('0x6'),_0x4b2e72,_0x766c('0x7'));logger[_0x766c('0x8')]('Network,\x20%s,\x20%s,\x20%s',_0x4b2e72,_0x766c('0x7'),JSON[_0x766c('0x9')](_0x38c567));if(_0x38c567[_0x766c('0xa')]){if(_0x38c567[_0x766c('0xa')][_0x766c('0xb')]===0x1f4){logger[_0x766c('0xa')]('Network,\x20%s,\x20%s',_0x4b2e72,_0x38c567[_0x766c('0xa')][_0x766c('0xc')]);return _0x1b4fb5(_0x38c567['error'][_0x766c('0xc')]);}logger[_0x766c('0xa')](_0x766c('0x6'),_0x4b2e72,_0x38c567[_0x766c('0xa')][_0x766c('0xc')]);return _0x216be7(_0x38c567[_0x766c('0xa')]['message']);}else{logger[_0x766c('0x5')](_0x766c('0x6'),_0x4b2e72,_0x766c('0x7'));_0x216be7(_0x38c567[_0x766c('0xd')][_0x766c('0xc')]);}})[_0x766c('0xe')](function(_0x32976b){logger[_0x766c('0xa')](_0x766c('0x6'),_0x4b2e72,_0x32976b);_0x1b4fb5(_0x32976b);});});}function respondWithResult(_0x2dc1d4,_0x139ae6){_0x139ae6=_0x139ae6||0xc8;return function(_0xa45fe5){if(_0xa45fe5){return _0x2dc1d4[_0x766c('0xf')](_0x139ae6)[_0x766c('0x10')](_0xa45fe5);}};}function respondWithFilteredResult(_0x419596,_0x188015){return function(_0x11b43d){if(_0x11b43d){var _0x1e31a7=typeof _0x188015[_0x766c('0x11')]===_0x766c('0x12')&&typeof _0x188015[_0x766c('0x13')]===_0x766c('0x12');var _0x18a1e4=_0x11b43d[_0x766c('0x14')];var _0x179b40=_0x1e31a7?0x0:_0x188015[_0x766c('0x11')];var _0x2739d=_0x1e31a7?_0x11b43d[_0x766c('0x14')]:_0x188015[_0x766c('0x11')]+_0x188015[_0x766c('0x13')];var _0x1a55da;if(_0x2739d>=_0x18a1e4){_0x2739d=_0x18a1e4;_0x1a55da=0xc8;}else{_0x1a55da=0xce;}_0x419596['status'](_0x1a55da);return _0x419596[_0x766c('0x15')](_0x766c('0x16'),_0x179b40+'-'+_0x2739d+'/'+_0x18a1e4)[_0x766c('0x10')](_0x11b43d);}return null;};}function saveUpdates(_0x2f6d91){return function(_0x102fb7){if(_0x102fb7){return _0x102fb7[_0x766c('0x17')](_0x2f6d91)[_0x766c('0x18')](function(_0x56b316){return _0x56b316;});}return null;};}function removeEntity(_0x16de71){return function(_0x4d305f){if(_0x4d305f){return _0x4d305f[_0x766c('0x19')]()[_0x766c('0x18')](function(){_0x16de71[_0x766c('0xf')](0xcc)[_0x766c('0x1a')]();});}};}function handleEntityNotFound(_0x559809){return function(_0x2063bb){if(!_0x2063bb){_0x559809[_0x766c('0x1b')](0x194);}return _0x2063bb;};}function handleError(_0x23c213,_0x4fdb95){_0x4fdb95=_0x4fdb95||0x1f4;return function(_0x1d1eee){logger[_0x766c('0xa')](_0x1d1eee[_0x766c('0x1c')]);if(_0x1d1eee[_0x766c('0x1d')]){delete _0x1d1eee[_0x766c('0x1d')];}_0x23c213[_0x766c('0xf')](_0x4fdb95)[_0x766c('0x1e')](_0x1d1eee);};}exports[_0x766c('0x1f')]=function(_0x4c9819,_0x155fe3){var _0x2435e3={},_0x4e1e98={},_0x123686={'count':0x0,'rows':[]};var _0xfdaccf=_[_0x766c('0x20')](db[_0x766c('0x21')][_0x766c('0x22')],function(_0x4feb18){return{'name':_0x4feb18[_0x766c('0x23')],'type':_0x4feb18[_0x766c('0x24')][_0x766c('0x25')]};});_0x4e1e98[_0x766c('0x26')]=_[_0x766c('0x20')](_0xfdaccf,_0x766c('0x1d'));_0x4e1e98['query']=_[_0x766c('0x27')](_0x4c9819[_0x766c('0x28')]);_0x4e1e98[_0x766c('0x29')]=_[_0x766c('0x2a')](_0x4e1e98['model'],_0x4e1e98[_0x766c('0x28')]);_0x2435e3[_0x766c('0x2b')]=_['intersection'](_0x4e1e98[_0x766c('0x26')],qs['fields'](_0x4c9819['query'][_0x766c('0x2c')]));_0x2435e3[_0x766c('0x2b')]=_0x2435e3[_0x766c('0x2b')][_0x766c('0x2d')]?_0x2435e3[_0x766c('0x2b')]:_0x4e1e98['model'];if(!_0x4c9819[_0x766c('0x28')][_0x766c('0x2e')]('nolimit')){_0x2435e3[_0x766c('0x13')]=qs[_0x766c('0x13')](_0x4c9819['query'][_0x766c('0x13')]);_0x2435e3[_0x766c('0x11')]=qs[_0x766c('0x11')](_0x4c9819['query']['offset']);}_0x2435e3[_0x766c('0x2f')]=qs[_0x766c('0x30')](_0x4c9819[_0x766c('0x28')][_0x766c('0x30')]);_0x2435e3[_0x766c('0x31')]=qs['filters'](_[_0x766c('0x32')](_0x4c9819[_0x766c('0x28')],_0x4e1e98[_0x766c('0x29')]),_0xfdaccf);if(_0x4c9819[_0x766c('0x28')]['filter']){_0x2435e3[_0x766c('0x31')]=_[_0x766c('0x33')](_0x2435e3['where'],{'$or':_[_0x766c('0x20')](_0xfdaccf,function(_0x4396f0){if(_0x4396f0[_0x766c('0x24')]!==_0x766c('0x34')){var _0x1af245={};_0x1af245[_0x4396f0['name']]={'$like':'%'+_0x4c9819[_0x766c('0x28')]['filter']+'%'};return _0x1af245;}})});}_0x2435e3=_[_0x766c('0x33')]({},_0x2435e3,_0x4c9819['options']);var _0x2c8c3c={'where':_0x2435e3[_0x766c('0x31')]};return db[_0x766c('0x21')]['count'](_0x2c8c3c)['then'](function(_0x3933c1){_0x123686[_0x766c('0x14')]=_0x3933c1;if(_0x4c9819[_0x766c('0x28')][_0x766c('0x35')]){_0x2435e3[_0x766c('0x36')]=[{'all':!![]}];}return db['Network']['findAll'](_0x2435e3);})[_0x766c('0x18')](function(_0x4f65ea){_0x123686[_0x766c('0x37')]=_0x4f65ea;return _0x123686;})[_0x766c('0x18')](respondWithFilteredResult(_0x155fe3,_0x2435e3))[_0x766c('0xe')](handleError(_0x155fe3,null));};exports[_0x766c('0x38')]=function(_0x4a28ef,_0x2ee515){var _0x1dc757={'raw':!![],'where':{'id':_0x4a28ef[_0x766c('0x39')]['id']}},_0x57f17d={};_0x57f17d[_0x766c('0x26')]=_[_0x766c('0x27')](db[_0x766c('0x21')][_0x766c('0x22')]);_0x57f17d[_0x766c('0x28')]=_[_0x766c('0x27')](_0x4a28ef['query']);_0x57f17d[_0x766c('0x29')]=_['intersection'](_0x57f17d[_0x766c('0x26')],_0x57f17d[_0x766c('0x28')]);_0x1dc757[_0x766c('0x2b')]=_['intersection'](_0x57f17d[_0x766c('0x26')],qs[_0x766c('0x2c')](_0x4a28ef['query'][_0x766c('0x2c')]));_0x1dc757['attributes']=_0x1dc757[_0x766c('0x2b')]['length']?_0x1dc757[_0x766c('0x2b')]:_0x57f17d[_0x766c('0x26')];if(_0x4a28ef[_0x766c('0x28')]['includeAll']){_0x1dc757[_0x766c('0x36')]=[{'all':!![]}];}_0x1dc757=_[_0x766c('0x33')]({},_0x1dc757,_0x4a28ef['options']);return db[_0x766c('0x21')][_0x766c('0x3a')](_0x1dc757)['then'](handleEntityNotFound(_0x2ee515,null))[_0x766c('0x18')](respondWithResult(_0x2ee515,null))[_0x766c('0xe')](handleError(_0x2ee515,null));};exports[_0x766c('0x3b')]=function(_0x4b71cd,_0x20a3f0){var _0x55ae7c;return db[_0x766c('0x21')][_0x766c('0x3b')](_0x4b71cd[_0x766c('0x3c')],{'raw':!![]})[_0x766c('0x18')](function(_0x2a51d2){_0x55ae7c=_0x2a51d2;return db[_0x766c('0x21')][_0x766c('0x3d')]({'where':{'type':_0x4b71cd[_0x766c('0x3c')]['type']},'raw':!![]});})[_0x766c('0x18')](function(_0x4f0f3e){if(_0x55ae7c['type']['toUpperCase']()==_0x766c('0x3e')){var _0xc9794b=fs[_0x766c('0x3f')](path['join'](config[_0x766c('0x40')],_0x766c('0x41')),_0x766c('0x42'));var _0x920780=ejs[_0x766c('0x43')](_0xc9794b,{'networks':_0x4f0f3e||[]});fs[_0x766c('0x44')]('/etc/asterisk/stun_xcally.conf',_0x920780);return respondWithRpcPromise(_0x766c('0x45'),_0x766c('0x3b'),{'module':_0x766c('0x46')});}else if(_0x55ae7c['type']['toUpperCase']()=='TURN'){var _0x4418fe=fs[_0x766c('0x3f')](path[_0x766c('0x47')](config[_0x766c('0x40')],_0x766c('0x48')),_0x766c('0x42'));var _0x51880b=ejs[_0x766c('0x43')](_0x4418fe,{'networks':_0x4f0f3e||[]});fs['writeFileSync'](_0x766c('0x49'),_0x51880b);return respondWithRpcPromise(_0x766c('0x45'),_0x766c('0x3b'),{'module':'res_stun_monitor.so'});}else{var _0x4e3adc=fs['readFileSync'](path[_0x766c('0x47')](config[_0x766c('0x40')],_0x766c('0x4a')),_0x766c('0x42'));var _0x3621ad=ejs[_0x766c('0x43')](_0x4e3adc,{'networks':_0x4f0f3e||[]});fs[_0x766c('0x44')](util[_0x766c('0x4b')](_0x766c('0x4c'),_0x4b71cd['body']['type']['toLowerCase']()),_0x3621ad);return respondWithRpcPromise('Reload',_0x766c('0x3b'),{'module':_0x766c('0x4d')});}})['then'](function(){return _0x55ae7c;})[_0x766c('0x18')](respondWithResult(_0x20a3f0,0xc9))['catch'](handleError(_0x20a3f0,null));};exports[_0x766c('0x17')]=function(_0x2e3f17,_0x59fa82){var _0x54ac56;return db['Network'][_0x766c('0x3a')]({'where':{'id':_0x2e3f17[_0x766c('0x39')]['id']}})[_0x766c('0x18')](handleEntityNotFound(_0x59fa82,null))[_0x766c('0x18')](saveUpdates(_0x2e3f17[_0x766c('0x3c')],null))['then'](function(_0x28363c){if(_0x28363c){_0x54ac56=_0x28363c;return db[_0x766c('0x21')][_0x766c('0x3d')]({'where':{'type':_0x54ac56[_0x766c('0x24')]},'raw':!![]});}return null;})[_0x766c('0x18')](function(_0x39db4c){if(_0x54ac56[_0x766c('0x24')]['toUpperCase']()==_0x766c('0x3e')){var _0x1bb74c=fs['readFileSync'](path[_0x766c('0x47')](config[_0x766c('0x40')],_0x766c('0x41')),_0x766c('0x42'));var _0x4fe22c=ejs[_0x766c('0x43')](_0x1bb74c,{'networks':_0x39db4c||[]});fs[_0x766c('0x44')]('/etc/asterisk/stun_xcally.conf',_0x4fe22c);return respondWithRpcPromise(_0x766c('0x45'),'update',{'module':_0x766c('0x46')});}else if(_0x54ac56[_0x766c('0x24')][_0x766c('0x4e')]()==_0x766c('0x4f')){var _0x52f70b=fs[_0x766c('0x3f')](path['join'](config[_0x766c('0x40')],_0x766c('0x48')),_0x766c('0x42'));var _0x245344=ejs['render'](_0x52f70b,{'networks':_0x39db4c||[]});fs[_0x766c('0x44')]('/etc/asterisk/turn_xcally.conf',_0x245344);return respondWithRpcPromise(_0x766c('0x45'),_0x766c('0x17'),{'module':'res_stun_monitor.so'});}else{var _0x288aac=fs['readFileSync'](path['join'](config[_0x766c('0x40')],'server/files/templates/network.ejs'),_0x766c('0x42'));var _0x51e01b=ejs[_0x766c('0x43')](_0x288aac,{'networks':_0x39db4c||[]});fs[_0x766c('0x44')](util[_0x766c('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x2e3f17['body']['type'][_0x766c('0x50')]()),_0x51e01b);return respondWithRpcPromise(_0x766c('0x45'),'update',{'module':_0x766c('0x4d')});}})[_0x766c('0x18')](function(_0x4db3f8){if(_0x4db3f8){return _0x54ac56;}return null;})[_0x766c('0x18')](respondWithResult(_0x59fa82,null))[_0x766c('0xe')](handleError(_0x59fa82,null));};exports[_0x766c('0x19')]=function(_0x24eb23,_0x3003f9){var _0x1c7052;return db[_0x766c('0x21')][_0x766c('0x3a')]({'where':{'id':_0x24eb23[_0x766c('0x39')]['id']}})[_0x766c('0x18')](function(_0x4e90f5){_0x1c7052=_0x4e90f5;return _0x4e90f5;})[_0x766c('0x18')](handleEntityNotFound(_0x3003f9,null))['then'](removeEntity(_0x3003f9,null))[_0x766c('0x18')](function(){if(_0x1c7052){return db[_0x766c('0x21')]['findAll']({'where':{'type':_0x1c7052['type']},'raw':!![]});}})[_0x766c('0x18')](function(_0x356385){if(_0x1c7052[_0x766c('0x24')][_0x766c('0x4e')]()==_0x766c('0x3e')){var _0x1d6988=fs[_0x766c('0x3f')](path['join'](config[_0x766c('0x40')],_0x766c('0x41')),'utf8');var _0x2e34f6=ejs['render'](_0x1d6988,{'networks':_0x356385||[]});fs[_0x766c('0x44')]('/etc/asterisk/stun_xcally.conf',_0x2e34f6);return respondWithRpcPromise(_0x766c('0x45'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x1c7052[_0x766c('0x24')]['toUpperCase']()=='TURN'){var _0x3052eb=fs[_0x766c('0x3f')](path['join'](config['root'],_0x766c('0x48')),_0x766c('0x42'));var _0x533bc8=ejs[_0x766c('0x43')](_0x3052eb,{'networks':_0x356385||[]});fs[_0x766c('0x44')]('/etc/asterisk/turn_xcally.conf',_0x533bc8);return respondWithRpcPromise(_0x766c('0x45'),_0x766c('0x19'),{'module':_0x766c('0x46')});}else{var _0x4dc2f9=fs[_0x766c('0x3f')](path[_0x766c('0x47')](config[_0x766c('0x40')],_0x766c('0x4a')),'utf8');var _0x2ff296=ejs[_0x766c('0x43')](_0x4dc2f9,{'networks':_0x356385||[]});fs[_0x766c('0x44')](util['format'](_0x766c('0x4c'),_0x1c7052[_0x766c('0x24')][_0x766c('0x50')]()),_0x2ff296);return respondWithRpcPromise(_0x766c('0x45'),_0x766c('0x19'),{'module':_0x766c('0x4d')});}})[_0x766c('0xe')](handleError(_0x3003f9,null));}; \ No newline at end of file +var _0xe939=['jayson/promise','http','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','update','then','destroy','end','stack','name','send','Network','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','root','render','/etc/asterisk/stun_xcally.conf','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','server/files/templates/turn_multiple.ejs','util','path','ejs','lodash','../../config/logger','../../mysqldb'];(function(_0xa8a83,_0xce285){var _0x38c704=function(_0x2a1a33){while(--_0x2a1a33){_0xa8a83['push'](_0xa8a83['shift']());}};_0x38c704(++_0xce285);}(_0xe939,0x18f));var _0x9e93=function(_0x152f5d,_0x32bb49){_0x152f5d=_0x152f5d-0x0;var _0x4bfae8=_0xe939[_0x152f5d];return _0x4bfae8;};'use strict';var util=require(_0x9e93('0x0'));var path=require(_0x9e93('0x1'));var ejs=require(_0x9e93('0x2'));var fs=require('fs');var _=require(_0x9e93('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x9e93('0x4'))('api');var config=require('../../config/environment');var db=require(_0x9e93('0x5'))['db'];var jayson=require(_0x9e93('0x6'));var client=jayson['client'][_0x9e93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5541b4,_0x3cf984,_0x11e894,_0x1d5898){return new Promise(function(_0x58dfcf,_0x393a31){var _0x1ee083=_0x1d5898||client;return _0x1ee083['request'](_0x5541b4,_0x11e894)['then'](function(_0x1e89db){logger[_0x9e93('0x8')](_0x9e93('0x9'),_0x3cf984,_0x9e93('0xa'));logger[_0x9e93('0xb')](_0x9e93('0xc'),_0x3cf984,_0x9e93('0xa'),JSON[_0x9e93('0xd')](_0x1e89db));if(_0x1e89db[_0x9e93('0xe')]){if(_0x1e89db[_0x9e93('0xe')][_0x9e93('0xf')]===0x1f4){logger[_0x9e93('0xe')](_0x9e93('0x9'),_0x3cf984,_0x1e89db[_0x9e93('0xe')]['message']);return _0x393a31(_0x1e89db[_0x9e93('0xe')][_0x9e93('0x10')]);}logger[_0x9e93('0xe')]('Network,\x20%s,\x20%s',_0x3cf984,_0x1e89db[_0x9e93('0xe')]['message']);return _0x58dfcf(_0x1e89db['error'][_0x9e93('0x10')]);}else{logger[_0x9e93('0x8')](_0x9e93('0x9'),_0x3cf984,'request\x20sent');_0x58dfcf(_0x1e89db[_0x9e93('0x11')][_0x9e93('0x10')]);}})['catch'](function(_0x2faabc){logger['error'](_0x9e93('0x9'),_0x3cf984,_0x2faabc);_0x393a31(_0x2faabc);});});}function respondWithResult(_0x466cfe,_0x44d4fb){_0x44d4fb=_0x44d4fb||0xc8;return function(_0x36672b){if(_0x36672b){return _0x466cfe[_0x9e93('0x12')](_0x44d4fb)[_0x9e93('0x13')](_0x36672b);}};}function respondWithFilteredResult(_0x27a19e,_0x402d97){return function(_0x188a23){if(_0x188a23){var _0x45ab86=typeof _0x402d97[_0x9e93('0x14')]===_0x9e93('0x15')&&typeof _0x402d97[_0x9e93('0x16')]==='undefined';var _0x14edc4=_0x188a23[_0x9e93('0x17')];var _0x4efa0c=_0x45ab86?0x0:_0x402d97['offset'];var _0x136883=_0x45ab86?_0x188a23[_0x9e93('0x17')]:_0x402d97['offset']+_0x402d97[_0x9e93('0x16')];var _0x2ff535;if(_0x136883>=_0x14edc4){_0x136883=_0x14edc4;_0x2ff535=0xc8;}else{_0x2ff535=0xce;}_0x27a19e['status'](_0x2ff535);return _0x27a19e[_0x9e93('0x18')]('Content-Range',_0x4efa0c+'-'+_0x136883+'/'+_0x14edc4)['json'](_0x188a23);}return null;};}function saveUpdates(_0x1c3051){return function(_0x214b99){if(_0x214b99){return _0x214b99[_0x9e93('0x19')](_0x1c3051)[_0x9e93('0x1a')](function(_0x2cb55a){return _0x2cb55a;});}return null;};}function removeEntity(_0x3416b4){return function(_0x10d4f5){if(_0x10d4f5){return _0x10d4f5[_0x9e93('0x1b')]()[_0x9e93('0x1a')](function(){_0x3416b4[_0x9e93('0x12')](0xcc)[_0x9e93('0x1c')]();});}};}function handleEntityNotFound(_0x51adda){return function(_0xc2dae0){if(!_0xc2dae0){_0x51adda['sendStatus'](0x194);}return _0xc2dae0;};}function handleError(_0x4a0323,_0x2095d2){_0x2095d2=_0x2095d2||0x1f4;return function(_0x56f58e){logger[_0x9e93('0xe')](_0x56f58e[_0x9e93('0x1d')]);if(_0x56f58e[_0x9e93('0x1e')]){delete _0x56f58e[_0x9e93('0x1e')];}_0x4a0323[_0x9e93('0x12')](_0x2095d2)[_0x9e93('0x1f')](_0x56f58e);};}exports['index']=function(_0x167d4b,_0x1e902d){var _0x183035={},_0x165553={},_0x350217={'count':0x0,'rows':[]};var _0x2529a8=_['map'](db[_0x9e93('0x20')][_0x9e93('0x21')],function(_0x5c85e7){return{'name':_0x5c85e7[_0x9e93('0x22')],'type':_0x5c85e7[_0x9e93('0x23')][_0x9e93('0x24')]};});_0x165553[_0x9e93('0x25')]=_[_0x9e93('0x26')](_0x2529a8,'name');_0x165553[_0x9e93('0x27')]=_[_0x9e93('0x28')](_0x167d4b['query']);_0x165553[_0x9e93('0x29')]=_[_0x9e93('0x2a')](_0x165553[_0x9e93('0x25')],_0x165553[_0x9e93('0x27')]);_0x183035[_0x9e93('0x2b')]=_[_0x9e93('0x2a')](_0x165553[_0x9e93('0x25')],qs[_0x9e93('0x2c')](_0x167d4b[_0x9e93('0x27')][_0x9e93('0x2c')]));_0x183035[_0x9e93('0x2b')]=_0x183035[_0x9e93('0x2b')][_0x9e93('0x2d')]?_0x183035[_0x9e93('0x2b')]:_0x165553[_0x9e93('0x25')];if(!_0x167d4b['query']['hasOwnProperty'](_0x9e93('0x2e'))){_0x183035[_0x9e93('0x16')]=qs[_0x9e93('0x16')](_0x167d4b[_0x9e93('0x27')][_0x9e93('0x16')]);_0x183035[_0x9e93('0x14')]=qs[_0x9e93('0x14')](_0x167d4b[_0x9e93('0x27')][_0x9e93('0x14')]);}_0x183035[_0x9e93('0x2f')]=qs['sort'](_0x167d4b['query'][_0x9e93('0x30')]);_0x183035[_0x9e93('0x31')]=qs[_0x9e93('0x29')](_['pick'](_0x167d4b[_0x9e93('0x27')],_0x165553[_0x9e93('0x29')]),_0x2529a8);if(_0x167d4b[_0x9e93('0x27')][_0x9e93('0x32')]){_0x183035[_0x9e93('0x31')]=_[_0x9e93('0x33')](_0x183035[_0x9e93('0x31')],{'$or':_[_0x9e93('0x26')](_0x2529a8,function(_0x55b2cf){if(_0x55b2cf[_0x9e93('0x23')]!=='VIRTUAL'){var _0x5eefc5={};_0x5eefc5[_0x55b2cf[_0x9e93('0x1e')]]={'$like':'%'+_0x167d4b[_0x9e93('0x27')][_0x9e93('0x32')]+'%'};return _0x5eefc5;}})});}_0x183035=_[_0x9e93('0x33')]({},_0x183035,_0x167d4b['options']);var _0x3b61d2={'where':_0x183035[_0x9e93('0x31')]};return db['Network'][_0x9e93('0x17')](_0x3b61d2)[_0x9e93('0x1a')](function(_0x125d8b){_0x350217[_0x9e93('0x17')]=_0x125d8b;if(_0x167d4b['query'][_0x9e93('0x34')]){_0x183035[_0x9e93('0x35')]=[{'all':!![]}];}return db['Network'][_0x9e93('0x36')](_0x183035);})[_0x9e93('0x1a')](function(_0x1d734e){_0x350217[_0x9e93('0x37')]=_0x1d734e;return _0x350217;})['then'](respondWithFilteredResult(_0x1e902d,_0x183035))[_0x9e93('0x38')](handleError(_0x1e902d,null));};exports[_0x9e93('0x39')]=function(_0xe3f7fe,_0x593b5e){var _0xa9d34c={'raw':!![],'where':{'id':_0xe3f7fe[_0x9e93('0x3a')]['id']}},_0x23a622={};_0x23a622[_0x9e93('0x25')]=_[_0x9e93('0x28')](db['Network'][_0x9e93('0x21')]);_0x23a622['query']=_['keys'](_0xe3f7fe[_0x9e93('0x27')]);_0x23a622[_0x9e93('0x29')]=_['intersection'](_0x23a622[_0x9e93('0x25')],_0x23a622['query']);_0xa9d34c[_0x9e93('0x2b')]=_['intersection'](_0x23a622['model'],qs[_0x9e93('0x2c')](_0xe3f7fe[_0x9e93('0x27')][_0x9e93('0x2c')]));_0xa9d34c['attributes']=_0xa9d34c[_0x9e93('0x2b')][_0x9e93('0x2d')]?_0xa9d34c[_0x9e93('0x2b')]:_0x23a622[_0x9e93('0x25')];if(_0xe3f7fe[_0x9e93('0x27')][_0x9e93('0x34')]){_0xa9d34c[_0x9e93('0x35')]=[{'all':!![]}];}_0xa9d34c=_['merge']({},_0xa9d34c,_0xe3f7fe['options']);return db['Network'][_0x9e93('0x3b')](_0xa9d34c)[_0x9e93('0x1a')](handleEntityNotFound(_0x593b5e,null))[_0x9e93('0x1a')](respondWithResult(_0x593b5e,null))[_0x9e93('0x38')](handleError(_0x593b5e,null));};exports[_0x9e93('0x3c')]=function(_0x1e52f5,_0x24bcba){var _0x1b799f;return db[_0x9e93('0x20')][_0x9e93('0x3c')](_0x1e52f5[_0x9e93('0x3d')],{'raw':!![]})[_0x9e93('0x1a')](function(_0x428fa9){_0x1b799f=_0x428fa9;return db[_0x9e93('0x20')][_0x9e93('0x36')]({'where':{'type':_0x1e52f5[_0x9e93('0x3d')][_0x9e93('0x23')]},'raw':!![]});})[_0x9e93('0x1a')](function(_0xb20e2b){if(_0x1b799f['type'][_0x9e93('0x3e')]()==_0x9e93('0x3f')){var _0x3b26f8=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config[_0x9e93('0x42')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x3e6b06=ejs[_0x9e93('0x43')](_0x3b26f8,{'networks':_0xb20e2b||[]});fs['writeFileSync'](_0x9e93('0x44'),_0x3e6b06);return respondWithRpcPromise('Reload',_0x9e93('0x3c'),{'module':'res_stun_monitor.so'});}else if(_0x1b799f[_0x9e93('0x23')][_0x9e93('0x3e')]()=='TURN'){var _0x15705b=fs[_0x9e93('0x40')](path['join'](config[_0x9e93('0x42')],'server/files/templates/turn_multiple.ejs'),_0x9e93('0x45'));var _0x48af45=ejs['render'](_0x15705b,{'networks':_0xb20e2b||[]});fs[_0x9e93('0x46')](_0x9e93('0x47'),_0x48af45);return respondWithRpcPromise(_0x9e93('0x48'),_0x9e93('0x3c'),{'module':_0x9e93('0x49')});}else{var _0x1ea76f=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config[_0x9e93('0x42')],_0x9e93('0x4a')),'utf8');var _0x557222=ejs['render'](_0x1ea76f,{'networks':_0xb20e2b||[]});fs['writeFileSync'](util[_0x9e93('0x4b')](_0x9e93('0x4c'),_0x1e52f5[_0x9e93('0x3d')][_0x9e93('0x23')][_0x9e93('0x4d')]()),_0x557222);return respondWithRpcPromise(_0x9e93('0x48'),_0x9e93('0x3c'),{'module':_0x9e93('0x4e')});}})[_0x9e93('0x1a')](function(){return _0x1b799f;})[_0x9e93('0x1a')](respondWithResult(_0x24bcba,0xc9))[_0x9e93('0x38')](handleError(_0x24bcba,null));};exports['update']=function(_0x15a4be,_0x3cc228){var _0x1a74fb;return db['Network'][_0x9e93('0x3b')]({'where':{'id':_0x15a4be[_0x9e93('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3cc228,null))[_0x9e93('0x1a')](saveUpdates(_0x15a4be[_0x9e93('0x3d')],null))[_0x9e93('0x1a')](function(_0x67578c){if(_0x67578c){_0x1a74fb=_0x67578c;return db[_0x9e93('0x20')][_0x9e93('0x36')]({'where':{'type':_0x1a74fb['type']},'raw':!![]});}return null;})[_0x9e93('0x1a')](function(_0x2a406b){if(_0x1a74fb['type'][_0x9e93('0x3e')]()==_0x9e93('0x3f')){var _0x3d08a4=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config[_0x9e93('0x42')],'server/files/templates/stun_multiple.ejs'),_0x9e93('0x45'));var _0x1fc861=ejs[_0x9e93('0x43')](_0x3d08a4,{'networks':_0x2a406b||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1fc861);return respondWithRpcPromise(_0x9e93('0x48'),_0x9e93('0x19'),{'module':_0x9e93('0x49')});}else if(_0x1a74fb[_0x9e93('0x23')]['toUpperCase']()==_0x9e93('0x4f')){var _0x4189bd=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config[_0x9e93('0x42')],_0x9e93('0x50')),_0x9e93('0x45'));var _0x395169=ejs[_0x9e93('0x43')](_0x4189bd,{'networks':_0x2a406b||[]});fs[_0x9e93('0x46')](_0x9e93('0x47'),_0x395169);return respondWithRpcPromise(_0x9e93('0x48'),_0x9e93('0x19'),{'module':_0x9e93('0x49')});}else{var _0x1cf161=fs['readFileSync'](path[_0x9e93('0x41')](config[_0x9e93('0x42')],'server/files/templates/network.ejs'),_0x9e93('0x45'));var _0x47f3f2=ejs[_0x9e93('0x43')](_0x1cf161,{'networks':_0x2a406b||[]});fs[_0x9e93('0x46')](util['format'](_0x9e93('0x4c'),_0x15a4be[_0x9e93('0x3d')][_0x9e93('0x23')][_0x9e93('0x4d')]()),_0x47f3f2);return respondWithRpcPromise('Reload',_0x9e93('0x19'),{'module':_0x9e93('0x4e')});}})[_0x9e93('0x1a')](function(_0x5d3dcb){if(_0x5d3dcb){return _0x1a74fb;}return null;})[_0x9e93('0x1a')](respondWithResult(_0x3cc228,null))[_0x9e93('0x38')](handleError(_0x3cc228,null));};exports[_0x9e93('0x1b')]=function(_0x57c26b,_0x533661){var _0x56de4c;return db[_0x9e93('0x20')]['find']({'where':{'id':_0x57c26b[_0x9e93('0x3a')]['id']}})[_0x9e93('0x1a')](function(_0x4abecb){_0x56de4c=_0x4abecb;return _0x4abecb;})['then'](handleEntityNotFound(_0x533661,null))[_0x9e93('0x1a')](removeEntity(_0x533661,null))[_0x9e93('0x1a')](function(){if(_0x56de4c){return db[_0x9e93('0x20')][_0x9e93('0x36')]({'where':{'type':_0x56de4c[_0x9e93('0x23')]},'raw':!![]});}})[_0x9e93('0x1a')](function(_0xc0a60e){if(_0x56de4c[_0x9e93('0x23')][_0x9e93('0x3e')]()==_0x9e93('0x3f')){var _0x42460c=fs['readFileSync'](path[_0x9e93('0x41')](config[_0x9e93('0x42')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0xeac4ab=ejs[_0x9e93('0x43')](_0x42460c,{'networks':_0xc0a60e||[]});fs['writeFileSync'](_0x9e93('0x44'),_0xeac4ab);return respondWithRpcPromise(_0x9e93('0x48'),_0x9e93('0x1b'),{'module':_0x9e93('0x49')});}else if(_0x56de4c['type'][_0x9e93('0x3e')]()=='TURN'){var _0x21a096=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config[_0x9e93('0x42')],_0x9e93('0x50')),'utf8');var _0x443905=ejs['render'](_0x21a096,{'networks':_0xc0a60e||[]});fs[_0x9e93('0x46')]('/etc/asterisk/turn_xcally.conf',_0x443905);return respondWithRpcPromise(_0x9e93('0x48'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0xe0940=fs[_0x9e93('0x40')](path[_0x9e93('0x41')](config['root'],_0x9e93('0x4a')),_0x9e93('0x45'));var _0xb49728=ejs[_0x9e93('0x43')](_0xe0940,{'networks':_0xc0a60e||[]});fs['writeFileSync'](util[_0x9e93('0x4b')](_0x9e93('0x4c'),_0x56de4c['type']['toLowerCase']()),_0xb49728);return respondWithRpcPromise('Reload',_0x9e93('0x1b'),{'module':_0x9e93('0x4e')});}})[_0x9e93('0x38')](handleError(_0x533661,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 7368194..c56598e 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 _0xa74f=['network','../../config/logger','bluebird','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0x473b12,_0x36c2a8){var _0x9bb646=function(_0x515947){while(--_0x515947){_0x473b12['push'](_0x473b12['shift']());}};_0x9bb646(++_0x36c2a8);}(_0xa74f,0x9a));var _0xfa74=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xa74f[_0x404957];return _0x4e0365;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6308=['bluebird','request-promise','path','rimraf','../../config/environment','define','Network','network','lodash','../../config/logger'];(function(_0x43ebe1,_0x5b8864){var _0x5068c2=function(_0x535464){while(--_0x535464){_0x43ebe1['push'](_0x43ebe1['shift']());}};_0x5068c2(++_0x5b8864);}(_0x6308,0x1f2));var _0x8630=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6308[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var logger=require(_0x8630('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8630('0x2'));var rp=require(_0x8630('0x3'));var fs=require('fs');var path=require(_0x8630('0x4'));var rimraf=require(_0x8630('0x5'));var config=require(_0x8630('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x1d62c8,_0x571543){return _0x1d62c8[_0x8630('0x7')](_0x8630('0x8'),attributes,{'tableName':_0x8630('0x9'),'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 3613d98..7fbe513 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d1683,_0x5c2e3d){var _0x22a928=function(_0x3dc27b){while(--_0x3dc27b){_0x5d1683['push'](_0x5d1683['shift']());}};_0x22a928(++_0x5c2e3d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f5334,_0x289695){var _0x4269d7=function(_0x139163){while(--_0x139163){_0x1f5334['push'](_0x1f5334['shift']());}};_0x4269d7(++_0x289695);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 1d453a0..1feffe9 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 _0x347a=['getInteractions','post','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','/:id/send','send','put','/:id','update','destroy','delete','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions'];(function(_0x37644a,_0x1a223a){var _0x48c516=function(_0x1fa32c){while(--_0x1fa32c){_0x37644a['push'](_0x37644a['shift']());}};_0x48c516(++_0x1a223a);}(_0x347a,0x1b5));var _0xa347=function(_0x3fd531,_0x538738){_0x3fd531=_0x3fd531-0x0;var _0x5bd9db=_0x347a[_0x3fd531];return _0x5bd9db;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa347('0x0'));var express=require(_0xa347('0x1'));var router=express[_0xa347('0x2')]();var fs_extra=require(_0xa347('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa347('0x4'));var config=require(_0xa347('0x5'));var controller=require(_0xa347('0x6'));router[_0xa347('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa347('0x7')](_0xa347('0x8'),auth[_0xa347('0x9')](),controller[_0xa347('0xa')]);router[_0xa347('0x7')]('/:id',auth[_0xa347('0x9')](),controller[_0xa347('0xb')]);router[_0xa347('0x7')](_0xa347('0xc'),auth[_0xa347('0x9')](),controller[_0xa347('0xd')]);router[_0xa347('0x7')](_0xa347('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xa347('0xf'),auth[_0xa347('0x9')](),controller[_0xa347('0x10')]);router[_0xa347('0x7')](_0xa347('0x11'),auth[_0xa347('0x9')](),controller[_0xa347('0x12')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xa347('0x13')]('/',auth[_0xa347('0x9')](),controller['create']);router['post'](_0xa347('0xc'),auth['isAuthenticated'](),controller[_0xa347('0x14')]);router['post'](_0xa347('0xe'),auth['isAuthenticated'](),controller[_0xa347('0x15')]);router[_0xa347('0x13')](_0xa347('0x16'),controller['notify']);router[_0xa347('0x13')]('/:id/applications',auth['isAuthenticated'](),controller[_0xa347('0x17')]);router[_0xa347('0x13')](_0xa347('0x18'),auth[_0xa347('0x9')](),controller[_0xa347('0x19')]);router[_0xa347('0x13')](_0xa347('0x1a'),auth[_0xa347('0x9')](),controller[_0xa347('0x1b')]);router[_0xa347('0x1c')](_0xa347('0x1d'),auth[_0xa347('0x9')](),controller[_0xa347('0x1e')]);router['delete']('/:id',auth[_0xa347('0x9')](),controller[_0xa347('0x1f')]);router[_0xa347('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xa347('0xe'),auth[_0xa347('0x9')](),controller['removeAnswers']);router[_0xa347('0x20')](_0xa347('0x18'),auth[_0xa347('0x9')](),controller[_0xa347('0x21')]);module[_0xa347('0x22')]=router; \ No newline at end of file +var _0x116d=['getDispositions','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x20ae87,_0x257d4a){var _0x307fe6=function(_0x2d9ca1){while(--_0x2d9ca1){_0x20ae87['push'](_0x20ae87['shift']());}};_0x307fe6(++_0x257d4a);}(_0x116d,0x15a));var _0xd116=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x116d[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xd116('0x0'));var util=require(_0xd116('0x1'));var path=require(_0xd116('0x2'));var timeout=require(_0xd116('0x3'));var express=require('express');var router=express[_0xd116('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd116('0x5'));var controller=require(_0xd116('0x6'));router[_0xd116('0x7')]('/',auth[_0xd116('0x8')](),controller['index']);router[_0xd116('0x7')](_0xd116('0x9'),auth[_0xd116('0x8')](),controller[_0xd116('0xa')]);router[_0xd116('0x7')](_0xd116('0xb'),auth[_0xd116('0x8')](),controller[_0xd116('0xc')]);router['get'](_0xd116('0xd'),auth[_0xd116('0x8')](),controller[_0xd116('0xe')]);router['get']('/:id/canned_answers',auth[_0xd116('0x8')](),controller[_0xd116('0xf')]);router[_0xd116('0x7')](_0xd116('0x10'),auth[_0xd116('0x8')](),controller['getApplications']);router[_0xd116('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xd116('0x11')]);router[_0xd116('0x7')](_0xd116('0x12'),auth[_0xd116('0x8')](),controller[_0xd116('0x13')]);router[_0xd116('0x14')]('/',auth[_0xd116('0x8')](),controller[_0xd116('0x15')]);router[_0xd116('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xd116('0x16'),auth[_0xd116('0x8')](),controller[_0xd116('0x17')]);router['post'](_0xd116('0x18'),controller[_0xd116('0x19')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xd116('0x1a')]);router['post'](_0xd116('0x12'),auth[_0xd116('0x8')](),controller[_0xd116('0x1b')]);router[_0xd116('0x14')]('/:id/send',auth[_0xd116('0x8')](),controller['send']);router[_0xd116('0x1c')](_0xd116('0xb'),auth[_0xd116('0x8')](),controller[_0xd116('0x1d')]);router[_0xd116('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0xd116('0x1f')]);router['delete']('/:id/dispositions',auth[_0xd116('0x8')](),controller[_0xd116('0x20')]);router[_0xd116('0x1e')](_0xd116('0x16'),auth[_0xd116('0x8')](),controller[_0xd116('0x21')]);router[_0xd116('0x1e')](_0xd116('0x12'),auth[_0xd116('0x8')](),controller[_0xd116('0x22')]);module[_0xd116('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 1bdd4bb..a6aaca1 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 _0xa9c2=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xc26950,_0x2d7860){var _0x1f2293=function(_0x5948e0){while(--_0x5948e0){_0xc26950['push'](_0xc26950['shift']());}};_0x1f2293(++_0x2d7860);}(_0xa9c2,0x1c1));var _0x2a9c=function(_0x28a9c5,_0x131baa){_0x28a9c5=_0x28a9c5-0x0;var _0x35910a=_0xa9c2[_0x28a9c5];return _0x35910a;};'use strict';var Sequelize=require(_0x2a9c('0x0'));var rs=require('randomstring');module[_0x2a9c('0x1')]={'name':{'type':Sequelize[_0x2a9c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2a9c('0x2')]},'token':{'type':Sequelize[_0x2a9c('0x2')],'defaultValue':function(){return rs[_0x2a9c('0x3')]();}},'replyUri':{'type':Sequelize[_0x2a9c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2a9c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2a9c('0x4')],'defaultValue':function(){return _0x2a9c('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2a9c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2a9c('0x2')]},'queueTransfer':{'type':Sequelize[_0x2a9c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2a9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2a9c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a9c('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x2a9c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x2a9c('0x6')],'defaultValue':![],'comment':_0x2a9c('0x9'),'set':function(_0x156e18){if(!_0x156e18)this[_0x2a9c('0xa')](_0x2a9c('0xb'),null);this[_0x2a9c('0xa')](_0x2a9c('0xc'),_0x156e18);}}}; \ No newline at end of file +var _0xce28=['randomstring','exports','generate','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize'];(function(_0x5ac041,_0x10b540){var _0x38c4ca=function(_0x50c4bb){while(--_0x50c4bb){_0x5ac041['push'](_0x5ac041['shift']());}};_0x38c4ca(++_0x10b540);}(_0xce28,0x83));var _0x8ce2=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xce28[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require(_0x8ce2('0x0'));var rs=require(_0x8ce2('0x1'));module[_0x8ce2('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8ce2('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8ce2('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8ce2('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8ce2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8ce2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8ce2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8ce2('0x4')]},'queueTransfer':{'type':Sequelize[_0x8ce2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8ce2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ce2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8ce2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8ce2('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x8ce2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x8ce2('0x6')],'defaultValue':![],'comment':_0x8ce2('0x9'),'set':function(_0x330c73){if(!_0x330c73)this[_0x8ce2('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x330c73);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 7afce65..29f62f0 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 _0x4abf=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelAccount','findAll','rows','show','fields','find','user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','findOne','Disposition','length','removeDispositions','addAnswer','CannedAnswer','nolimit','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','OpenchannelApplication','account','applications','list','List','orderBy','priority','asc','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x4abf,0xac));var _0xf4ab=function(_0x238e7c,_0x46ee86){_0x238e7c=_0x238e7c-0x0;var _0x128a39=_0x4abf[_0x238e7c];return _0x128a39;};'use strict';var emlformat=require(_0xf4ab('0x0'));var rimraf=require(_0xf4ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf4ab('0x3'));var util=require(_0xf4ab('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf4ab('0x5'));var ejs=require(_0xf4ab('0x6'));var fs=require('fs');var fs_extra=require(_0xf4ab('0x7'));var _=require(_0xf4ab('0x8'));var squel=require('squel');var crypto=require(_0xf4ab('0x9'));var jsforce=require(_0xf4ab('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf4ab('0x5'));var querystring=require('querystring');var Papa=require(_0xf4ab('0xb'));var Redis=require(_0xf4ab('0xc'));var authService=require(_0xf4ab('0xd'));var qs=require(_0xf4ab('0xe'));var as=require(_0xf4ab('0xf'));var hardwareService=require(_0xf4ab('0x10'));var logger=require(_0xf4ab('0x11'))(_0xf4ab('0x12'));var utils=require(_0xf4ab('0x13'));var config=require(_0xf4ab('0x14'));var licenseUtil=require(_0xf4ab('0x15'));var db=require(_0xf4ab('0x16'))['db'];config[_0xf4ab('0x17')]=_['defaults'](config['redis'],{'host':_0xf4ab('0x18'),'port':0x18eb});var socket=require(_0xf4ab('0x19'))(new Redis(config[_0xf4ab('0x17')]));require(_0xf4ab('0x1a'))[_0xf4ab('0x1b')](socket);var jayson=require(_0xf4ab('0x1c'));var client=jayson[_0xf4ab('0x1d')][_0xf4ab('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xf4ab('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1c5202,_0xc26111,_0x5d50cb,_0x1e1a02){return new BPromise(function(_0x21bdc0,_0x4b17e4){var _0x196ea7=_0x1e1a02||client;return _0x196ea7[_0xf4ab('0x1f')](_0x1c5202,_0x5d50cb)[_0xf4ab('0x20')](function(_0x2b8ac8){logger[_0xf4ab('0x21')](_0xf4ab('0x22'),_0xc26111,_0xf4ab('0x23'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xc26111,_0xf4ab('0x23'),JSON['stringify'](_0x2b8ac8));if(_0x2b8ac8[_0xf4ab('0x24')]){if(_0x2b8ac8[_0xf4ab('0x24')][_0xf4ab('0x25')]===0x1f4){logger['error'](_0xf4ab('0x22'),_0xc26111,_0x2b8ac8[_0xf4ab('0x24')][_0xf4ab('0x26')]);return _0x4b17e4(_0x2b8ac8[_0xf4ab('0x24')][_0xf4ab('0x26')]);}logger['error'](_0xf4ab('0x22'),_0xc26111,_0x2b8ac8[_0xf4ab('0x24')][_0xf4ab('0x26')]);return _0x21bdc0(_0x2b8ac8[_0xf4ab('0x24')][_0xf4ab('0x26')]);}else{logger[_0xf4ab('0x21')](_0xf4ab('0x22'),_0xc26111,'request\x20sent');_0x21bdc0(_0x2b8ac8[_0xf4ab('0x27')]['message']);}})[_0xf4ab('0x28')](function(_0x550e29){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0xc26111,_0x550e29);_0x4b17e4(_0x550e29);});});}function respondWithStatusCode(_0x58015c,_0x5781da){_0x5781da=_0x5781da||0xcc;return function(_0x5641b8){if(_0x5641b8){return _0x58015c['sendStatus'](_0x5781da);}return _0x58015c[_0xf4ab('0x29')](_0x5781da)[_0xf4ab('0x2a')]();};}function respondWithResult(_0x1abd31,_0x425e4e){_0x425e4e=_0x425e4e||0xc8;return function(_0x1efb48){if(_0x1efb48){return _0x1abd31['status'](_0x425e4e)['json'](_0x1efb48);}};}function respondWithFilteredResult(_0x325b38,_0x3cf5b1){return function(_0x52f419){if(_0x52f419){var _0x46877c=typeof _0x3cf5b1['offset']===_0xf4ab('0x2b')&&typeof _0x3cf5b1[_0xf4ab('0x2c')]===_0xf4ab('0x2b');var _0x3d195b=_0x52f419[_0xf4ab('0x2d')];var _0x3dcc37=_0x46877c?0x0:_0x3cf5b1[_0xf4ab('0x2e')];var _0x25d68f=_0x46877c?_0x52f419[_0xf4ab('0x2d')]:_0x3cf5b1[_0xf4ab('0x2e')]+_0x3cf5b1[_0xf4ab('0x2c')];var _0x495612;if(_0x25d68f>=_0x3d195b){_0x25d68f=_0x3d195b;_0x495612=0xc8;}else{_0x495612=0xce;}_0x325b38[_0xf4ab('0x29')](_0x495612);return _0x325b38['set'](_0xf4ab('0x2f'),_0x3dcc37+'-'+_0x25d68f+'/'+_0x3d195b)[_0xf4ab('0x30')](_0x52f419);}return null;};}function patchUpdates(_0x4cad6b){return function(_0x526710){try{jsonpatch[_0xf4ab('0x31')](_0x526710,_0x4cad6b,!![]);}catch(_0x3e1bb5){return BPromise[_0xf4ab('0x32')](_0x3e1bb5);}return _0x526710[_0xf4ab('0x33')]();};}function saveUpdates(_0x26a58b,_0x5eb7e1){return function(_0x59663d){if(_0x59663d){return _0x59663d[_0xf4ab('0x34')](_0x26a58b)[_0xf4ab('0x20')](function(_0x29bd4c){return _0x29bd4c;});}return null;};}function removeEntity(_0x526c68,_0x1411ab){return function(_0x18cf46){if(_0x18cf46){return _0x18cf46[_0xf4ab('0x35')]()[_0xf4ab('0x20')](function(){var _0x37c30b=_0x18cf46[_0xf4ab('0x36')]({'plain':!![]});var _0x146df9=_0xf4ab('0x37');return db[_0xf4ab('0x38')][_0xf4ab('0x35')]({'where':{'type':_0x146df9,'resourceId':_0x37c30b['id']}})[_0xf4ab('0x20')](function(){return _0x18cf46;});})[_0xf4ab('0x20')](function(){_0x526c68['status'](0xcc)[_0xf4ab('0x2a')]();});}};}function handleEntityNotFound(_0x1c6afb,_0x7bf0fd){return function(_0x460637){if(!_0x460637){_0x1c6afb[_0xf4ab('0x39')](0x194);}return _0x460637;};}function handleError(_0x2ead81,_0x2dfd08){_0x2dfd08=_0x2dfd08||0x1f4;return function(_0x1b15aa){logger[_0xf4ab('0x24')](_0x1b15aa[_0xf4ab('0x3a')]);if(_0x1b15aa[_0xf4ab('0x3b')]){delete _0x1b15aa[_0xf4ab('0x3b')];}_0x2ead81[_0xf4ab('0x29')](_0x2dfd08)[_0xf4ab('0x3c')](_0x1b15aa);};}exports['index']=function(_0x354ca8,_0x32eb5e){var _0x866dcc={'include':[{'model':db[_0xf4ab('0x3d')],'as':_0xf4ab('0x3e')}]},_0x1410db={},_0x52f90a={'count':0x0,'rows':[]};var _0x220281=_[_0xf4ab('0x3f')](db['OpenchannelAccount'][_0xf4ab('0x40')],function(_0x1fe448){return{'name':_0x1fe448[_0xf4ab('0x41')],'type':_0x1fe448['type'][_0xf4ab('0x42')]};});_0x1410db[_0xf4ab('0x43')]=_[_0xf4ab('0x3f')](_0x220281,_0xf4ab('0x3b'));_0x1410db[_0xf4ab('0x44')]=_[_0xf4ab('0x45')](_0x354ca8[_0xf4ab('0x44')]);_0x1410db['filters']=_[_0xf4ab('0x46')](_0x1410db[_0xf4ab('0x43')],_0x1410db['query']);_0x866dcc[_0xf4ab('0x47')]=_[_0xf4ab('0x46')](_0x1410db[_0xf4ab('0x43')],qs['fields'](_0x354ca8[_0xf4ab('0x44')]['fields']));_0x866dcc[_0xf4ab('0x47')]=_0x866dcc[_0xf4ab('0x47')]['length']?_0x866dcc[_0xf4ab('0x47')]:_0x1410db[_0xf4ab('0x43')];if(!_0x354ca8[_0xf4ab('0x44')][_0xf4ab('0x48')]('nolimit')){_0x866dcc['limit']=qs[_0xf4ab('0x2c')](_0x354ca8['query']['limit']);_0x866dcc[_0xf4ab('0x2e')]=qs[_0xf4ab('0x2e')](_0x354ca8[_0xf4ab('0x44')][_0xf4ab('0x2e')]);}_0x866dcc[_0xf4ab('0x49')]=qs[_0xf4ab('0x4a')](_0x354ca8[_0xf4ab('0x44')][_0xf4ab('0x4a')]);_0x866dcc[_0xf4ab('0x4b')]=qs[_0xf4ab('0x4c')](_[_0xf4ab('0x4d')](_0x354ca8[_0xf4ab('0x44')],_0x1410db[_0xf4ab('0x4c')]),_0x220281);if(_0x354ca8['query'][_0xf4ab('0x4e')]){_0x866dcc[_0xf4ab('0x4b')]=_[_0xf4ab('0x4f')](_0x866dcc[_0xf4ab('0x4b')],{'$or':_[_0xf4ab('0x3f')](_0x220281,function(_0x15395e){if(_0x15395e['type']!==_0xf4ab('0x50')){var _0x479c5c={};_0x479c5c[_0x15395e[_0xf4ab('0x3b')]]={'$like':'%'+_0x354ca8[_0xf4ab('0x44')][_0xf4ab('0x4e')]+'%'};return _0x479c5c;}})});}_0x866dcc=_[_0xf4ab('0x4f')]({},_0x866dcc,_0x354ca8[_0xf4ab('0x51')]);var _0x448646={'where':_0x866dcc[_0xf4ab('0x4b')]};return db['OpenchannelAccount'][_0xf4ab('0x2d')](_0x448646)[_0xf4ab('0x20')](function(_0x3d8bd6){_0x52f90a[_0xf4ab('0x2d')]=_0x3d8bd6;if(_0x354ca8[_0xf4ab('0x44')][_0xf4ab('0x52')]){_0x866dcc[_0xf4ab('0x53')]=[{'all':!![]}];}return db[_0xf4ab('0x54')][_0xf4ab('0x55')](_0x866dcc);})[_0xf4ab('0x20')](function(_0x55cf7a){_0x52f90a[_0xf4ab('0x56')]=_0x55cf7a;return _0x52f90a;})[_0xf4ab('0x20')](respondWithFilteredResult(_0x32eb5e,_0x866dcc))[_0xf4ab('0x28')](handleError(_0x32eb5e,null));};exports[_0xf4ab('0x57')]=function(_0x469e2f,_0x2537cd){var _0x3d333e={'raw':![],'where':{'id':_0x469e2f['params']['id']},'include':[{'model':db[_0xf4ab('0x3d')],'as':_0xf4ab('0x3e')}]},_0x3447c1={};_0x3447c1[_0xf4ab('0x43')]=_[_0xf4ab('0x45')](db[_0xf4ab('0x54')][_0xf4ab('0x40')]);_0x3447c1[_0xf4ab('0x44')]=_['keys'](_0x469e2f[_0xf4ab('0x44')]);_0x3447c1[_0xf4ab('0x4c')]=_['intersection'](_0x3447c1[_0xf4ab('0x43')],_0x3447c1[_0xf4ab('0x44')]);_0x3d333e[_0xf4ab('0x47')]=_[_0xf4ab('0x46')](_0x3447c1[_0xf4ab('0x43')],qs['fields'](_0x469e2f['query'][_0xf4ab('0x58')]));_0x3d333e[_0xf4ab('0x47')]=_0x3d333e[_0xf4ab('0x47')]['length']?_0x3d333e[_0xf4ab('0x47')]:_0x3447c1[_0xf4ab('0x43')];if(_0x469e2f[_0xf4ab('0x44')][_0xf4ab('0x52')]){_0x3d333e[_0xf4ab('0x53')]=[{'all':!![]}];}_0x3d333e=_[_0xf4ab('0x4f')]({},_0x3d333e,_0x469e2f['options']);return db[_0xf4ab('0x54')][_0xf4ab('0x59')](_0x3d333e)[_0xf4ab('0x20')](handleEntityNotFound(_0x2537cd,null))[_0xf4ab('0x20')](respondWithResult(_0x2537cd,null))['catch'](handleError(_0x2537cd,null));};exports['create']=function(_0x87f24b,_0x126ee0){return db[_0xf4ab('0x54')]['create'](_0x87f24b['body'],{})[_0xf4ab('0x20')](function(_0xbe0d69){var _0x5f1006=_0x87f24b[_0xf4ab('0x5a')][_0xf4ab('0x36')]({'plain':!![]});if(!_0x5f1006)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1006[_0xf4ab('0x5b')]===_0xf4ab('0x5a')){var _0x43c7c3=_0xbe0d69['get']({'plain':!![]});var _0x76fb29=_0xf4ab('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x76fb29,'userProfileId':_0x5f1006[_0xf4ab('0x5c')]},'raw':!![]})[_0xf4ab('0x20')](function(_0x4ce06e){if(_0x4ce06e&&_0x4ce06e[_0xf4ab('0x5d')]===0x0){return db[_0xf4ab('0x38')][_0xf4ab('0x5e')]({'name':_0x43c7c3[_0xf4ab('0x3b')],'resourceId':_0x43c7c3['id'],'type':_0x4ce06e['name'],'sectionId':_0x4ce06e['id']},{})[_0xf4ab('0x20')](function(){return _0xbe0d69;});}else{return _0xbe0d69;}})[_0xf4ab('0x28')](function(_0xab966a){logger[_0xf4ab('0x24')](_0xf4ab('0x5f'),_0xab966a);throw _0xab966a;});}return _0xbe0d69;})[_0xf4ab('0x20')](respondWithResult(_0x126ee0,0xc9))['catch'](handleError(_0x126ee0,null));};exports[_0xf4ab('0x34')]=function(_0x5a2b38,_0x5b1884){if(_0x5a2b38[_0xf4ab('0x60')]['id']){delete _0x5a2b38[_0xf4ab('0x60')]['id'];}return db[_0xf4ab('0x54')]['find']({'where':{'id':_0x5a2b38[_0xf4ab('0x61')]['id']},'include':[{'model':db[_0xf4ab('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xf4ab('0x20')](handleEntityNotFound(_0x5b1884,null))[_0xf4ab('0x20')](saveUpdates(_0x5a2b38[_0xf4ab('0x60')],null))[_0xf4ab('0x20')](respondWithResult(_0x5b1884,null))[_0xf4ab('0x28')](handleError(_0x5b1884,null));};exports[_0xf4ab('0x35')]=function(_0x3d30c2,_0x261047){return db['OpenchannelAccount'][_0xf4ab('0x59')]({'where':{'id':_0x3d30c2[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x261047,null))[_0xf4ab('0x20')](removeEntity(_0x261047,null))['catch'](handleError(_0x261047,null));};exports[_0xf4ab('0x62')]=function(_0x29c698,_0x2c01ba){return db['OpenchannelAccount'][_0xf4ab('0x62')]()['then'](respondWithResult(_0x2c01ba,null))[_0xf4ab('0x28')](handleError(_0x2c01ba,null));};exports[_0xf4ab('0x63')]=function(_0x1596c2,_0x354256,_0x3961ea){if(_0x1596c2[_0xf4ab('0x60')]['id']){delete _0x1596c2['body']['id'];}return db[_0xf4ab('0x54')][_0xf4ab('0x59')]({'where':{'id':_0x1596c2[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x354256,null))[_0xf4ab('0x20')](function(_0x36d990){if(_0x36d990){_0x1596c2[_0xf4ab('0x60')][_0xf4ab('0x64')]=_0x36d990['id'];return db['Disposition'][_0xf4ab('0x5e')](_0x1596c2['body']);}})[_0xf4ab('0x20')](respondWithResult(_0x354256,null))[_0xf4ab('0x28')](handleError(_0x354256,null));};exports['getDispositions']=function(_0x2a8c44,_0xce3eb6,_0x2eac87){var _0x2f8287={'raw':![],'where':{}};var _0x13a439={};var _0x43ce40={'count':0x0,'rows':[]};return db[_0xf4ab('0x54')][_0xf4ab('0x65')]({'where':{'id':_0x2a8c44[_0xf4ab('0x61')]['id']}})['then'](handleEntityNotFound(_0xce3eb6,null))['then'](function(_0x29c733){if(_0x29c733){_0x13a439[_0xf4ab('0x43')]=_[_0xf4ab('0x45')](db[_0xf4ab('0x66')]['rawAttributes']);_0x13a439['query']=_['keys'](_0x2a8c44[_0xf4ab('0x44')]);_0x13a439['filters']=_[_0xf4ab('0x46')](_0x13a439[_0xf4ab('0x43')],_0x13a439[_0xf4ab('0x44')]);_0x2f8287['attributes']=_[_0xf4ab('0x46')](_0x13a439[_0xf4ab('0x43')],qs[_0xf4ab('0x58')](_0x2a8c44['query'][_0xf4ab('0x58')]));_0x2f8287[_0xf4ab('0x47')]=_0x2f8287['attributes'][_0xf4ab('0x67')]?_0x2f8287[_0xf4ab('0x47')]:_0x13a439[_0xf4ab('0x43')];if(!_0x2a8c44['query'][_0xf4ab('0x48')]('nolimit')){_0x2f8287[_0xf4ab('0x2c')]=qs[_0xf4ab('0x2c')](_0x2a8c44[_0xf4ab('0x44')][_0xf4ab('0x2c')]);_0x2f8287['offset']=qs[_0xf4ab('0x2e')](_0x2a8c44[_0xf4ab('0x44')]['offset']);}_0x2f8287[_0xf4ab('0x49')]=qs[_0xf4ab('0x4a')](_0x2a8c44[_0xf4ab('0x44')][_0xf4ab('0x4a')]);_0x2f8287['where']=qs['filters'](_[_0xf4ab('0x4d')](_0x2a8c44[_0xf4ab('0x44')],_0x13a439[_0xf4ab('0x4c')]));_0x2f8287['where'][_0xf4ab('0x64')]=_0x29c733['id'];if(_0x2a8c44[_0xf4ab('0x44')]['filter']){_0x2f8287[_0xf4ab('0x4b')]=_['merge'](_0x2f8287['where'],{'$or':_[_0xf4ab('0x3f')](_0x2f8287[_0xf4ab('0x47')],function(_0x1abe91){var _0x4ec63a={};_0x4ec63a[_0x1abe91]={'$like':'%'+_0x2a8c44[_0xf4ab('0x44')][_0xf4ab('0x4e')]+'%'};return _0x4ec63a;})});}_0x2f8287=_[_0xf4ab('0x4f')]({},_0x2f8287,_0x2a8c44[_0xf4ab('0x51')]);return db[_0xf4ab('0x66')][_0xf4ab('0x2d')]({'where':_0x2f8287[_0xf4ab('0x4b')]})[_0xf4ab('0x20')](function(_0x26798e){_0x43ce40[_0xf4ab('0x2d')]=_0x26798e;if(_0x2a8c44['query'][_0xf4ab('0x52')]){_0x2f8287['include']=[{'all':!![]}];}return db['Disposition'][_0xf4ab('0x55')](_0x2f8287);})[_0xf4ab('0x20')](function(_0x423e85){_0x43ce40['rows']=_0x423e85;return _0x43ce40;});}})['then'](respondWithFilteredResult(_0xce3eb6,_0x2f8287))[_0xf4ab('0x28')](handleError(_0xce3eb6,null));};exports[_0xf4ab('0x68')]=function(_0x33b32f,_0x294843,_0x1df8cc){return db[_0xf4ab('0x54')][_0xf4ab('0x59')]({'where':{'id':_0x33b32f['params']['id']}})['then'](handleEntityNotFound(_0x294843,null))['then'](function(_0xe3d470){if(_0xe3d470){return _0xe3d470[_0xf4ab('0x68')](_0x33b32f[_0xf4ab('0x44')]['ids']);}})[_0xf4ab('0x20')](respondWithStatusCode(_0x294843,null))[_0xf4ab('0x28')](handleError(_0x294843,null));};exports[_0xf4ab('0x69')]=function(_0x262f9a,_0x19912a,_0x416954){if(_0x262f9a[_0xf4ab('0x60')]['id']){delete _0x262f9a[_0xf4ab('0x60')]['id'];}return db[_0xf4ab('0x54')]['find']({'where':{'id':_0x262f9a['params']['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x19912a,null))[_0xf4ab('0x20')](function(_0x28634d){if(_0x28634d){_0x262f9a[_0xf4ab('0x60')][_0xf4ab('0x64')]=_0x28634d['id'];return db[_0xf4ab('0x6a')][_0xf4ab('0x5e')](_0x262f9a['body']);}})[_0xf4ab('0x20')](respondWithResult(_0x19912a,null))[_0xf4ab('0x28')](handleError(_0x19912a,null));};exports['getAnswers']=function(_0xd94850,_0xec0be3,_0x521949){var _0x374324={'raw':![],'where':{}};var _0x26ee96={};var _0x37d591={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf4ab('0x65')]({'where':{'id':_0xd94850[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0xec0be3,null))[_0xf4ab('0x20')](function(_0x5117ac){if(_0x5117ac){_0x26ee96['model']=_[_0xf4ab('0x45')](db[_0xf4ab('0x6a')]['rawAttributes']);_0x26ee96['query']=_[_0xf4ab('0x45')](_0xd94850[_0xf4ab('0x44')]);_0x26ee96[_0xf4ab('0x4c')]=_[_0xf4ab('0x46')](_0x26ee96[_0xf4ab('0x43')],_0x26ee96[_0xf4ab('0x44')]);_0x374324['attributes']=_['intersection'](_0x26ee96['model'],qs[_0xf4ab('0x58')](_0xd94850['query']['fields']));_0x374324[_0xf4ab('0x47')]=_0x374324[_0xf4ab('0x47')][_0xf4ab('0x67')]?_0x374324[_0xf4ab('0x47')]:_0x26ee96[_0xf4ab('0x43')];if(!_0xd94850[_0xf4ab('0x44')][_0xf4ab('0x48')](_0xf4ab('0x6b'))){_0x374324['limit']=qs[_0xf4ab('0x2c')](_0xd94850['query'][_0xf4ab('0x2c')]);_0x374324[_0xf4ab('0x2e')]=qs[_0xf4ab('0x2e')](_0xd94850[_0xf4ab('0x44')][_0xf4ab('0x2e')]);}_0x374324[_0xf4ab('0x49')]=qs['sort'](_0xd94850['query']['sort']);_0x374324[_0xf4ab('0x4b')]=qs[_0xf4ab('0x4c')](_[_0xf4ab('0x4d')](_0xd94850[_0xf4ab('0x44')],_0x26ee96[_0xf4ab('0x4c')]));_0x374324[_0xf4ab('0x4b')][_0xf4ab('0x64')]=_0x5117ac['id'];if(_0xd94850[_0xf4ab('0x44')][_0xf4ab('0x4e')]){_0x374324[_0xf4ab('0x4b')]=_[_0xf4ab('0x4f')](_0x374324[_0xf4ab('0x4b')],{'$or':_[_0xf4ab('0x3f')](_0x374324[_0xf4ab('0x47')],function(_0xec53c){var _0x15ae89={};_0x15ae89[_0xec53c]={'$like':'%'+_0xd94850['query'][_0xf4ab('0x4e')]+'%'};return _0x15ae89;})});}_0x374324=_['merge']({},_0x374324,_0xd94850[_0xf4ab('0x51')]);return db[_0xf4ab('0x6a')][_0xf4ab('0x2d')]({'where':_0x374324[_0xf4ab('0x4b')]})['then'](function(_0x3a752f){_0x37d591['count']=_0x3a752f;if(_0xd94850[_0xf4ab('0x44')][_0xf4ab('0x52')]){_0x374324[_0xf4ab('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf4ab('0x55')](_0x374324);})[_0xf4ab('0x20')](function(_0x3c3364){_0x37d591[_0xf4ab('0x56')]=_0x3c3364;return _0x37d591;});}})['then'](respondWithFilteredResult(_0xec0be3,_0x374324))[_0xf4ab('0x28')](handleError(_0xec0be3,null));};exports[_0xf4ab('0x6c')]=function(_0x1c5d2e,_0x37c55f,_0xa1e116){return db[_0xf4ab('0x54')][_0xf4ab('0x59')]({'where':{'id':_0x1c5d2e[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x37c55f,null))[_0xf4ab('0x20')](function(_0x48f931){if(_0x48f931){return _0x48f931['removeAnswers'](_0x1c5d2e[_0xf4ab('0x44')][_0xf4ab('0x6d')]);}})[_0xf4ab('0x20')](respondWithStatusCode(_0x37c55f,null))[_0xf4ab('0x28')](handleError(_0x37c55f,null));};exports[_0xf4ab('0x6e')]=function(_0x168a5c,_0x1e6159,_0x5b264e){var _0x1aa3a4={'body':_0x168a5c[_0xf4ab('0x60')],'channel':_0xf4ab('0x6f')};var _0x82f48c=[];var _0x1e3571=[];var _0x53c5f1={};var _0x59cd8c=![];return db[_0xf4ab('0x70')][_0xf4ab('0x62')]()[_0xf4ab('0x20')](function(_0x408d09){if(!_0x408d09){throw new db[(_0xf4ab('0x71'))][(_0xf4ab('0x72'))](_0xf4ab('0x73'));}_0x82f48c=_[_0xf4ab('0x74')](_['keys'](_0x408d09),[_0xf4ab('0x75'),_0xf4ab('0x76')]);_0x1e3571=_['difference'](_['keys'](_0x408d09),[_0xf4ab('0x75'),'updatedAt','CompanyId',_0xf4ab('0x77')]);if(_0x168a5c['body']['id']){delete _0x168a5c[_0xf4ab('0x60')]['id'];}if(_[_0xf4ab('0x78')](_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x79')])){throw new db[(_0xf4ab('0x71'))][(_0xf4ab('0x72'))](_0xf4ab('0x7a'));}if(_['isNil'](_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x60')])||_0x168a5c[_0xf4ab('0x60')]['body']===''){throw new db[(_0xf4ab('0x71'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf4ab('0x78')](_0x168a5c['body'][_0xf4ab('0x7b')])){throw new db[(_0xf4ab('0x71'))][(_0xf4ab('0x72'))](_0xf4ab('0x7c')+_0x1e3571);}if(!_[_0xf4ab('0x7d')](_0x1e3571,_0x168a5c[_0xf4ab('0x60')]['mapKey'])){throw new db[(_0xf4ab('0x71'))][(_0xf4ab('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e3571);}_0x53c5f1[_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x7b')]]=_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x79')];})[_0xf4ab('0x20')](function(){return db['OpenchannelAccount'][_0xf4ab('0x59')]({'where':{'id':_0x168a5c[_0xf4ab('0x61')]['id']},'include':[{'model':db[_0xf4ab('0x7e')],'as':'List','include':[{'model':db[_0xf4ab('0x70')],'as':_0xf4ab('0x7f'),'where':_0x53c5f1,'limit':0x1,'order':[[_0xf4ab('0x76'),_0xf4ab('0x80')]]}]},{'model':db[_0xf4ab('0x81')],'as':'Applications'}]});})[_0xf4ab('0x20')](handleEntityNotFound(_0x1e6159,null))[_0xf4ab('0x20')](function(_0x2b1229){if(_0x2b1229&&_0x2b1229['List']){_0x1aa3a4[_0xf4ab('0x82')]=_0x2b1229;_0x1aa3a4[_0xf4ab('0x83')]=_0x2b1229['Applications'];_0x1aa3a4[_0xf4ab('0x84')]=_0x2b1229[_0xf4ab('0x85')];_0x1aa3a4[_0xf4ab('0x83')]=_[_0xf4ab('0x86')](_0x1aa3a4['applications'],[_0xf4ab('0x87')],[_0xf4ab('0x88')]);if(_0x1aa3a4[_0xf4ab('0x82')][_0xf4ab('0x89')]){delete _0x1aa3a4[_0xf4ab('0x82')]['Applications'];}if(_0x1aa3a4['account'][_0xf4ab('0x85')]&&_0x1aa3a4['account'][_0xf4ab('0x85')]['Contacts'][_0xf4ab('0x67')]){return _0x1aa3a4[_0xf4ab('0x82')][_0xf4ab('0x85')][_0xf4ab('0x7f')][0x0];}var _0x506dd2=_['defaults'](_0x168a5c['body'],{'firstName':_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x79')],'ListId':_0x2b1229[_0xf4ab('0x77')]});_0x506dd2[_0x168a5c['body'][_0xf4ab('0x7b')]]=_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x79')];return db[_0xf4ab('0x70')][_0xf4ab('0x5e')](_0x506dd2,{'fields':_0x82f48c,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e6159,null))[_0xf4ab('0x20')](function(_0x52d76a){_0x1aa3a4[_0xf4ab('0x8a')]=_0x52d76a;if(_0x52d76a){var _0x2e4eb3={'ContactId':_0x52d76a['id'],'OpenchannelAccountId':_0x168a5c[_0xf4ab('0x61')]['id'],'from':(_0x52d76a[_0xf4ab('0x8b')]||'')+'\x20'+(_0x52d76a[_0xf4ab('0x8c')]||'')};var _0x1846d5={'OpenchannelAccountId':_0x168a5c['params']['id'],'closed':![]};if(_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x8d')]){_0x1846d5[_0xf4ab('0x8d')]=_0x168a5c[_0xf4ab('0x60')]['threadId'];return db[_0xf4ab('0x8e')][_0xf4ab('0x59')]({'where':_0x1846d5})['then'](function(_0x2d9532){if(_0x2d9532){return[_0x2d9532,![]];}_0x2e4eb3[_0xf4ab('0x8d')]=_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x8d')];_0x2e4eb3[_0xf4ab('0x8f')]=_0x168a5c['body'][_0xf4ab('0x8f')];return db['OpenchannelInteraction'][_0xf4ab('0x5e')](_0x2e4eb3)[_0xf4ab('0x20')](function(_0x9d7db0){return[_0x9d7db0,!![]];});});}else{_0x1846d5[_0xf4ab('0x8d')]=null;}_0x1846d5[_0xf4ab('0x90')]=_0x52d76a['id'];return db['OpenchannelInteraction'][_0xf4ab('0x59')]({'where':_0x1846d5})[_0xf4ab('0x20')](function(_0x10a8f5){if(_0x10a8f5){return[_0x10a8f5,![]];}return db['OpenchannelInteraction'][_0xf4ab('0x5e')](_0x2e4eb3)[_0xf4ab('0x20')](function(_0x352e92){return[_0x352e92,!![]];});});}})[_0xf4ab('0x91')](function(_0x27aa84,_0x3292c1){if(_0x27aa84){_0x59cd8c=_0x3292c1;if(!_0x3292c1){var _0x7d9bcd={'from':(_0x1aa3a4[_0xf4ab('0x8a')]['firstName']||'')+'\x20'+(_0x1aa3a4[_0xf4ab('0x8a')][_0xf4ab('0x8c')]||'')};if(_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x8d')]&&_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x92')]&&_0x168a5c['body'][_0xf4ab('0x8d')]!=_0x168a5c['body'][_0xf4ab('0x92')]){_0x7d9bcd[_0xf4ab('0x8d')]=_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x92')];}return _0x27aa84[_0xf4ab('0x34')](_0x7d9bcd);}else{return _0x27aa84;}}})[_0xf4ab('0x20')](function(_0x5c1d51){_0x1aa3a4['interaction']=_0x5c1d51[_0xf4ab('0x36')]({'plain':!![]});_0x1aa3a4[_0xf4ab('0x93')][_0xf4ab('0x94')]=_0x59cd8c;if(_0x1aa3a4[_0xf4ab('0x93')]['created']){if(_0x1aa3a4[_0xf4ab('0x82')][_0xf4ab('0x95')]){_0x1aa3a4[_0xf4ab('0x83')][_0xf4ab('0x96')]({'id':0x0,'priority':_0x1aa3a4[_0xf4ab('0x83')][_0xf4ab('0x67')]+0x1,'app':_0xf4ab('0x97'),'appdata':_0xf4ab('0x98'),'interval':_0xf4ab('0x99')});}}return db['OpenchannelMessage'][_0xf4ab('0x5e')]({'body':_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x60')],'OpenchannelAccountId':_0x168a5c[_0xf4ab('0x61')]['id'],'OpenchannelInteractionId':_0x5c1d51['id'],'direction':'in','ContactId':_0x1aa3a4['contact']['id'],'AttachmentId':_0x168a5c[_0xf4ab('0x60')][_0xf4ab('0x9a')]});})[_0xf4ab('0x20')](function(_0x44dbb7){_0x1aa3a4[_0xf4ab('0x26')]=_0x44dbb7;if(_0x1aa3a4[_0xf4ab('0x93')]['UserId']){return db[_0xf4ab('0x9b')][_0xf4ab('0x59')]({'attributes':['id','name'],'where':{'id':_0x1aa3a4[_0xf4ab('0x93')][_0xf4ab('0x9c')]}})['then'](function(_0x1854d0){if(_0x1854d0){_0x1aa3a4[_0xf4ab('0x83')][_0xf4ab('0x9d')]({'id':0x0,'priority':0x0,'app':_0xf4ab('0x9e'),'appdata':_0x1854d0[_0xf4ab('0x3b')]+','+(_0x1aa3a4[_0xf4ab('0x82')][_0xf4ab('0x9f')]||0xa),'interval':_0xf4ab('0x99')});_0x1aa3a4['forcedOwnership']=![];}return respondWithRpcPromise('Start','startRouting',_0x1aa3a4);});}return respondWithRpcPromise(_0xf4ab('0xa0'),_0xf4ab('0xa1'),_0x1aa3a4);})[_0xf4ab('0x20')](function(_0x244f28){respondWithRpcPromise(_0xf4ab('0xa2'),_0xf4ab('0xa2'),{'event':_0xf4ab('0x6e'),'message':_0x244f28},client9002);return _0x244f28;})['then'](respondWithResult(_0x1e6159,null))[_0xf4ab('0x28')](handleError(_0x1e6159,null));};exports[_0xf4ab('0xa3')]=function(_0x56bed9,_0xe83268){var _0x3022d2=_0x56bed9['params']['id'];var _0x5dbaba=_0x56bed9['body'];var _0x1f63f0=0xc8;var _0x2a17bb=null;return db[_0xf4ab('0xa4')][_0xf4ab('0xa5')]({'isolationLevel':db['sequelize'][_0xf4ab('0xa6')][_0xf4ab('0xa7')][_0xf4ab('0xa8')]},function(_0x27094e){return db[_0xf4ab('0x54')][_0xf4ab('0x65')]({'where':{'id':_0x3022d2},'transaction':_0x27094e})[_0xf4ab('0x20')](function(_0x1b40d5){if(_0x1b40d5){return db[_0xf4ab('0x81')][_0xf4ab('0x35')]({'where':{'OpenchannelAccountId':_0x3022d2},'transaction':_0x27094e})['then'](function(){var _0x2c7158=_[_0xf4ab('0x3f')](_0x5dbaba,function(_0x27f48a){_0x27f48a[_0xf4ab('0x64')]=_0x3022d2;return _0x27f48a;});return db[_0xf4ab('0x81')][_0xf4ab('0xa9')](_0x2c7158,{'transaction':_0x27094e});});}else{_0x1f63f0=0x194;_0x2a17bb=[];}});})[_0xf4ab('0x20')](function(){if(_0x1f63f0!==0x194){return db[_0xf4ab('0x81')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3022d2},'order':_0xf4ab('0x87')})[_0xf4ab('0x20')](function(_0xb8eedf){_0x2a17bb=_0xb8eedf;});}})[_0xf4ab('0x28')](function(_0x4d0f7e){_0x1f63f0=0x1f4;logger['error'](_0x4d0f7e[_0xf4ab('0x3a')]);if(_0x4d0f7e[_0xf4ab('0x3b')]){delete _0x4d0f7e[_0xf4ab('0x3b')];}_0x2a17bb=_0x4d0f7e;})[_0xf4ab('0xaa')](function(){if(_0x2a17bb===null){_0xe83268[_0xf4ab('0x39')](_0x1f63f0);}else{if(_0x1f63f0===0x1f4){_0xe83268['status'](_0x1f63f0)['send'](_0x2a17bb);}else{_0xe83268[_0xf4ab('0x29')](_0x1f63f0)[_0xf4ab('0x30')](_0x2a17bb);}}});};exports[_0xf4ab('0xab')]=function(_0x18b085,_0x7822b2,_0x48f192){var _0x522104={};var _0x895d57={};var _0x3ff979;var _0x5049ed;return db[_0xf4ab('0x54')]['findOne']({'where':{'id':_0x18b085[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x7822b2,null))['then'](function(_0x4d679b){if(_0x4d679b){_0x3ff979=_0x4d679b;_0x895d57['model']=_['keys'](db[_0xf4ab('0x81')][_0xf4ab('0x40')]);_0x895d57[_0xf4ab('0x44')]=_[_0xf4ab('0x45')](_0x18b085['query']);_0x895d57['filters']=_[_0xf4ab('0x46')](_0x895d57[_0xf4ab('0x43')],_0x895d57[_0xf4ab('0x44')]);_0x522104[_0xf4ab('0x47')]=_['intersection'](_0x895d57['model'],qs[_0xf4ab('0x58')](_0x18b085[_0xf4ab('0x44')]['fields']));_0x522104[_0xf4ab('0x47')]=_0x522104[_0xf4ab('0x47')][_0xf4ab('0x67')]?_0x522104[_0xf4ab('0x47')]:_0x895d57['model'];_0x522104[_0xf4ab('0x49')]=qs[_0xf4ab('0x4a')](_0x18b085[_0xf4ab('0x44')][_0xf4ab('0x4a')]);_0x522104['where']=qs[_0xf4ab('0x4c')](_[_0xf4ab('0x4d')](_0x18b085[_0xf4ab('0x44')],_0x895d57[_0xf4ab('0x4c')]));if(_0x18b085[_0xf4ab('0x44')][_0xf4ab('0x4e')]){_0x522104['where']=_['merge'](_0x522104['where'],{'$or':_['map'](_0x522104[_0xf4ab('0x47')],function(_0x234c20){var _0x2290b6={};_0x2290b6[_0x234c20]={'$like':'%'+_0x18b085['query'][_0xf4ab('0x4e')]+'%'};return _0x2290b6;})});}_0x522104=_[_0xf4ab('0x4f')]({},_0x522104,_0x18b085[_0xf4ab('0x51')]);return _0x3ff979[_0xf4ab('0xab')](_0x522104);}})[_0xf4ab('0x20')](function(_0x4cbb8b){if(_0x4cbb8b){_0x5049ed=_0x4cbb8b[_0xf4ab('0x67')];if(!_0x18b085[_0xf4ab('0x44')][_0xf4ab('0x48')](_0xf4ab('0x6b'))){_0x522104[_0xf4ab('0x2c')]=qs[_0xf4ab('0x2c')](_0x18b085['query'][_0xf4ab('0x2c')]);_0x522104['offset']=qs[_0xf4ab('0x2e')](_0x18b085[_0xf4ab('0x44')][_0xf4ab('0x2e')]);}return _0x3ff979['getApplications'](_0x522104);}})['then'](function(_0x5950c5){if(_0x5950c5){return _0x5950c5?{'count':_0x5049ed,'rows':_0x5950c5}:null;}})[_0xf4ab('0x20')](respondWithResult(_0x7822b2,null))[_0xf4ab('0x28')](handleError(_0x7822b2,null));};exports[_0xf4ab('0xac')]=function(_0x3d01d3,_0x1bb631,_0x41e017){var _0x28e3ed={'raw':![],'where':{}};var _0x49a4db={};var _0x2b4703={'count':0x0,'rows':[]};return db[_0xf4ab('0x54')][_0xf4ab('0x65')]({'where':{'id':_0x3d01d3[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x1bb631,null))[_0xf4ab('0x20')](function(_0x56932f){if(_0x56932f){_0x49a4db[_0xf4ab('0x43')]=_[_0xf4ab('0x45')](db[_0xf4ab('0x8e')][_0xf4ab('0x40')]);_0x49a4db[_0xf4ab('0x44')]=_[_0xf4ab('0x45')](_0x3d01d3[_0xf4ab('0x44')]);_0x49a4db[_0xf4ab('0x4c')]=_[_0xf4ab('0x46')](_0x49a4db[_0xf4ab('0x43')],_0x49a4db[_0xf4ab('0x44')]);_0x28e3ed[_0xf4ab('0x47')]=_[_0xf4ab('0x46')](_0x49a4db[_0xf4ab('0x43')],qs[_0xf4ab('0x58')](_0x3d01d3['query'][_0xf4ab('0x58')]));_0x28e3ed[_0xf4ab('0x47')]=_0x28e3ed[_0xf4ab('0x47')][_0xf4ab('0x67')]?_0x28e3ed[_0xf4ab('0x47')]:_0x49a4db['model'];if(!_0x3d01d3['query'][_0xf4ab('0x48')](_0xf4ab('0x6b'))){_0x28e3ed[_0xf4ab('0x2c')]=qs[_0xf4ab('0x2c')](_0x3d01d3['query'][_0xf4ab('0x2c')]);_0x28e3ed[_0xf4ab('0x2e')]=qs['offset'](_0x3d01d3[_0xf4ab('0x44')][_0xf4ab('0x2e')]);}_0x28e3ed[_0xf4ab('0x49')]=qs[_0xf4ab('0x4a')](_0x3d01d3[_0xf4ab('0x44')][_0xf4ab('0x4a')]);_0x28e3ed[_0xf4ab('0x4b')]=qs[_0xf4ab('0x4c')](_[_0xf4ab('0x4d')](_0x3d01d3[_0xf4ab('0x44')],_0x49a4db[_0xf4ab('0x4c')]));_0x28e3ed[_0xf4ab('0x4b')][_0xf4ab('0x64')]=_0x56932f['id'];if(_0x3d01d3[_0xf4ab('0x44')]['filter']){_0x28e3ed[_0xf4ab('0x4b')]=_[_0xf4ab('0x4f')](_0x28e3ed[_0xf4ab('0x4b')],{'$or':_[_0xf4ab('0x3f')](_0x28e3ed['attributes'],function(_0x4909cc){var _0x3373d8={};_0x3373d8[_0x4909cc]={'$like':'%'+_0x3d01d3[_0xf4ab('0x44')]['filter']+'%'};return _0x3373d8;})});}_0x28e3ed=_[_0xf4ab('0x4f')]({},_0x28e3ed,_0x3d01d3[_0xf4ab('0x51')]);return db['OpenchannelInteraction'][_0xf4ab('0x2d')]({'where':_0x28e3ed[_0xf4ab('0x4b')]})['then'](function(_0x4c2b94){_0x2b4703[_0xf4ab('0x2d')]=_0x4c2b94;if(_0x3d01d3['query'][_0xf4ab('0x52')]){_0x28e3ed[_0xf4ab('0x53')]=[{'model':db[_0xf4ab('0x70')],'as':_0xf4ab('0xad'),'required':![]},{'model':db[_0xf4ab('0x9b')],'as':'Owner','attributes':[_0xf4ab('0x3b'),'fullname',_0xf4ab('0xae')],'required':![]},{'model':db[_0xf4ab('0xaf')],'as':_0xf4ab('0xb0'),'attributes':['id',_0xf4ab('0x3b'),'color'],'where':_0x3d01d3[_0xf4ab('0x44')][_0xf4ab('0xb1')]?{'id':_0x3d01d3[_0xf4ab('0x44')][_0xf4ab('0xb1')]}:undefined,'required':_0x3d01d3[_0xf4ab('0x44')][_0xf4ab('0xb1')]?!![]:![]}];}return db[_0xf4ab('0x8e')][_0xf4ab('0x55')](_0x28e3ed);})[_0xf4ab('0x20')](function(_0x26c663){_0x2b4703[_0xf4ab('0x56')]=_0x26c663;return _0x2b4703;});}})[_0xf4ab('0x20')](respondWithFilteredResult(_0x1bb631,_0x28e3ed))[_0xf4ab('0x28')](handleError(_0x1bb631,null));};exports[_0xf4ab('0xb2')]=function(_0x3cb962,_0x4d8056,_0x41a6f5){return db[_0xf4ab('0x54')][_0xf4ab('0x59')]({'where':{'id':_0x3cb962[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x4d8056,null))[_0xf4ab('0x20')](function(_0x21af1f){if(_0x21af1f){return _0x21af1f['addAgents'](_0x3cb962['body'][_0xf4ab('0x6d')],_[_0xf4ab('0xb3')](_0x3cb962[_0xf4ab('0x60')],[_0xf4ab('0x6d'),'id'])||{})[_0xf4ab('0x91')](function(_0x112c14){for(var _0xf8e77c=0x0;_0xf8e77c<_0x3cb962[_0xf4ab('0x60')][_0xf4ab('0x6d')][_0xf4ab('0x67')];_0xf8e77c+=0x1){socket[_0xf4ab('0xb4')](_0xf4ab('0xb5'),{'UserId':Number(_0x3cb962[_0xf4ab('0x60')][_0xf4ab('0x6d')][_0xf8e77c]),'OpenchannelAccountId':Number(_0x3cb962[_0xf4ab('0x61')]['id'])});}return _0x112c14;});}})[_0xf4ab('0x20')](respondWithResult(_0x4d8056,null))[_0xf4ab('0x28')](handleError(_0x4d8056,null));};exports[_0xf4ab('0xb6')]=function(_0x261f67,_0x495561,_0x69e5e5){return db['OpenchannelAccount'][_0xf4ab('0x59')]({'where':{'id':_0x261f67['params']['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x495561,null))['then'](function(_0x4afc8e){if(_0x4afc8e){return _0x4afc8e[_0xf4ab('0xb6')](_0x261f67[_0xf4ab('0x44')][_0xf4ab('0x6d')])[_0xf4ab('0x20')](function(){if(_[_0xf4ab('0xb7')](_0x261f67[_0xf4ab('0x44')]['ids'])){for(var _0x48b384=0x0;_0x48b384<_0x261f67[_0xf4ab('0x44')][_0xf4ab('0x6d')][_0xf4ab('0x67')];_0x48b384+=0x1){socket[_0xf4ab('0xb4')](_0xf4ab('0xb8'),{'UserId':Number(_0x261f67[_0xf4ab('0x44')][_0xf4ab('0x6d')][_0x48b384]),'OpenchannelAccountId':Number(_0x261f67[_0xf4ab('0x61')]['id'])});}}else{socket['emit'](_0xf4ab('0xb8'),{'UserId':Number(_0x261f67[_0xf4ab('0x44')][_0xf4ab('0x6d')]),'OpenchannelAccountId':Number(_0x261f67[_0xf4ab('0x61')]['id'])});}});}})[_0xf4ab('0x20')](respondWithStatusCode(_0x495561,null))[_0xf4ab('0x28')](handleError(_0x495561,null));};exports['getAgents']=function(_0x3fdb11,_0x55e412,_0x4912e5){var _0xa92ab2={};var _0xdfd465={};var _0x396859;var _0x3fd18e;return db[_0xf4ab('0x54')][_0xf4ab('0x65')]({'where':{'id':_0x3fdb11[_0xf4ab('0x61')]['id']}})[_0xf4ab('0x20')](handleEntityNotFound(_0x55e412,null))[_0xf4ab('0x20')](function(_0x5db978){if(_0x5db978){_0x396859=_0x5db978;_0xdfd465[_0xf4ab('0x43')]=_[_0xf4ab('0x45')](db[_0xf4ab('0x9b')][_0xf4ab('0x40')]);_0xdfd465[_0xf4ab('0x44')]=_[_0xf4ab('0x45')](_0x3fdb11[_0xf4ab('0x44')]);_0xdfd465[_0xf4ab('0x4c')]=_[_0xf4ab('0x46')](_0xdfd465[_0xf4ab('0x43')],_0xdfd465[_0xf4ab('0x44')]);_0xa92ab2[_0xf4ab('0x47')]=_[_0xf4ab('0x46')](_0xdfd465['model'],qs[_0xf4ab('0x58')](_0x3fdb11[_0xf4ab('0x44')][_0xf4ab('0x58')]));_0xa92ab2[_0xf4ab('0x47')]=_0xa92ab2[_0xf4ab('0x47')]['length']?_0xa92ab2[_0xf4ab('0x47')]:_0xdfd465['model'];_0xa92ab2['order']=qs[_0xf4ab('0x4a')](_0x3fdb11[_0xf4ab('0x44')]['sort']);_0xa92ab2[_0xf4ab('0x4b')]=qs[_0xf4ab('0x4c')](_[_0xf4ab('0x4d')](_0x3fdb11[_0xf4ab('0x44')],_0xdfd465[_0xf4ab('0x4c')]));if(_0x3fdb11[_0xf4ab('0x44')][_0xf4ab('0x4e')]){_0xa92ab2[_0xf4ab('0x4b')]=_['merge'](_0xa92ab2['where'],{'$or':_[_0xf4ab('0x3f')](_0xa92ab2[_0xf4ab('0x47')],function(_0x206553){var _0x277254={};_0x277254[_0x206553]={'$like':'%'+_0x3fdb11['query']['filter']+'%'};return _0x277254;})});}_0xa92ab2=_['merge']({},_0xa92ab2,_0x3fdb11['options']);return _0x396859[_0xf4ab('0xb9')](_0xa92ab2);}})[_0xf4ab('0x20')](function(_0x5b3cfa){if(_0x5b3cfa){_0x3fd18e=_0x5b3cfa[_0xf4ab('0x67')];if(!_0x3fdb11[_0xf4ab('0x44')][_0xf4ab('0x48')](_0xf4ab('0x6b'))){_0xa92ab2[_0xf4ab('0x2c')]=qs['limit'](_0x3fdb11['query'][_0xf4ab('0x2c')]);_0xa92ab2[_0xf4ab('0x2e')]=qs[_0xf4ab('0x2e')](_0x3fdb11[_0xf4ab('0x44')][_0xf4ab('0x2e')]);}return _0x396859[_0xf4ab('0xb9')](_0xa92ab2);}})[_0xf4ab('0x20')](function(_0x2cf994){if(_0x2cf994){return _0x2cf994?{'count':_0x3fd18e,'rows':_0x2cf994}:null;}})[_0xf4ab('0x20')](respondWithResult(_0x55e412,null))[_0xf4ab('0x28')](handleError(_0x55e412,null));};exports[_0xf4ab('0x3c')]=function(_0x293c2d,_0x5c1909,_0x75527b){var _0x4c2a98,_0x49a59a,_0x46f9f3;if(_[_0xf4ab('0x78')](_0x293c2d[_0xf4ab('0x60')][_0xf4ab('0x60')])||_0x293c2d[_0xf4ab('0x60')][_0xf4ab('0x60')]===''){throw new db[(_0xf4ab('0x71'))][(_0xf4ab('0x72'))](_0xf4ab('0xba'));}if(_[_0xf4ab('0x78')](_0x293c2d['body']['to'])){}_0x4c2a98=_0x293c2d['body']['to'];return db[_0xf4ab('0x54')][_0xf4ab('0x65')]({'where':{'id':_0x293c2d['params']['id']}})['then'](handleEntityNotFound(_0x5c1909,null))[_0xf4ab('0x20')](function(_0x28ce0f){if(_0x28ce0f){return db[_0xf4ab('0x54')]['find']({'where':{'id':_0x28ce0f['id']},'include':[{'model':db[_0xf4ab('0x7e')],'as':_0xf4ab('0x85'),'include':[{'model':db['CmContact'],'as':_0xf4ab('0x7f'),'where':{[_0x28ce0f['mapKey']]:_0x4c2a98},'limit':0x1,'order':[[_0xf4ab('0x76'),_0xf4ab('0x80')]]}]}]})[_0xf4ab('0x20')](handleEntityNotFound(_0x5c1909,null))['then'](function(_0x351beb){if(_0x351beb&&_0x351beb['List']){_0x49a59a=_0x351beb[_0xf4ab('0x36')]({'plain':!![]});if(_0x49a59a['List']&&_0x49a59a['List'][_0xf4ab('0x7f')]['length']){return _0x49a59a[_0xf4ab('0x85')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x293c2d['body'],{'firstName':_0x4c2a98,[_0x351beb[_0xf4ab('0x7b')]]:_0x4c2a98,'phone':_0x4c2a98,'ListId':_0x49a59a[_0xf4ab('0x77')]}));}})[_0xf4ab('0x20')](handleEntityNotFound(_0x5c1909,null))['then'](function(_0x244556){if(_0x244556){_0x46f9f3=_0x244556;return db[_0xf4ab('0x8e')]['find']({'where':{'ContactId':_0x46f9f3['id'],'closed':![],'OpenchannelAccountId':_0x49a59a['id']}})[_0xf4ab('0x20')](function(_0x2a82ed){if(_0x2a82ed){return[_0x2a82ed,![]];}return db[_0xf4ab('0x8e')][_0xf4ab('0x5e')]({'UserId':_0x293c2d[_0xf4ab('0x5a')]['id'],'ContactId':_0x46f9f3['id'],'OpenchannelAccountId':_0x49a59a['id'],'lastMsgDirection':_0xf4ab('0xbb'),'firstMsgDirection':'out','Messages':[_['merge'](_0x293c2d[_0xf4ab('0x60')],{'read':![],'body':_0x293c2d[_0xf4ab('0x60')][_0xf4ab('0x60')],'OpenchannelAccountId':_0x49a59a['id'],'UserId':_0x293c2d[_0xf4ab('0x5a')]['id'],'ContactId':_0x46f9f3['id']})]},{'include':[{'model':db[_0xf4ab('0xbc')],'as':_0xf4ab('0xbd')}]})[_0xf4ab('0x20')](function(_0x5afc22){return[_0x5afc22,!![]];});});}})[_0xf4ab('0x91')](function(_0x147435,_0x3f0e1e){if(_0x3f0e1e){return _0x147435;}return db[_0xf4ab('0xbc')][_0xf4ab('0x5e')](_[_0xf4ab('0x4f')](_0x293c2d['body'],{'read':![],'body':_0x293c2d[_0xf4ab('0x60')]['body'],'OpenchannelAccountId':_0x49a59a['id'],'OpenchannelInteractionId':_0x147435['id'],'UserId':_0x293c2d[_0xf4ab('0x5a')]['id'],'ContactId':_0x46f9f3['id']}))[_0xf4ab('0x20')](function(_0x36e4d4){_0x147435[_0xf4ab('0xbe')][_0xf4ab('0xbd')]=[];_0x147435[_0xf4ab('0xbe')][_0xf4ab('0xbd')][_0xf4ab('0x96')](_0x36e4d4[_0xf4ab('0xbe')]);return _0x147435;});});}})[_0xf4ab('0x20')](respondWithResult(_0x5c1909,null))[_0xf4ab('0x28')](handleError(_0x5c1909,null));}; \ No newline at end of file +var _0x4f82=['rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getDispositions','Disposition','hasOwnProperty','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','priority','asc','defaults','CmContact','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','tag','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','user','out','Messages','dataValues','eml-format'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x4f82,0xbc));var _0x24f8=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x4f82[_0x543084];return _0x306a57;};'use strict';var emlformat=require(_0x24f8('0x0'));var rimraf=require(_0x24f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24f8('0x2'));var rp=require('request-promise');var moment=require(_0x24f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24f8('0x4'));var util=require('util');var path=require(_0x24f8('0x5'));var sox=require(_0x24f8('0x6'));var csv=require(_0x24f8('0x7'));var ejs=require(_0x24f8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24f8('0x9'));var squel=require(_0x24f8('0xa'));var crypto=require(_0x24f8('0xb'));var jsforce=require(_0x24f8('0xc'));var deskjs=require(_0x24f8('0xd'));var toCsv=require(_0x24f8('0x7'));var querystring=require('querystring');var Papa=require(_0x24f8('0xe'));var Redis=require(_0x24f8('0xf'));var authService=require(_0x24f8('0x10'));var qs=require(_0x24f8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24f8('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x24f8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x24f8('0x14'))['db'];config['redis']=_['defaults'](config[_0x24f8('0x15')],{'host':_0x24f8('0x16'),'port':0x18eb});var socket=require(_0x24f8('0x17'))(new Redis(config[_0x24f8('0x15')]));require(_0x24f8('0x18'))[_0x24f8('0x19')](socket);var jayson=require(_0x24f8('0x1a'));var client=jayson[_0x24f8('0x1b')][_0x24f8('0x1c')]({'port':0x232c});var client9002=jayson[_0x24f8('0x1b')][_0x24f8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x57d554,_0x3a4760,_0x2a980d,_0x191bc9){return new BPromise(function(_0x3552aa,_0x1083a8){var _0xf6c4bc=_0x191bc9||client;return _0xf6c4bc[_0x24f8('0x1d')](_0x57d554,_0x2a980d)[_0x24f8('0x1e')](function(_0xdbece4){logger[_0x24f8('0x1f')](_0x24f8('0x20'),_0x3a4760,_0x24f8('0x21'));logger['debug'](_0x24f8('0x22'),_0x3a4760,_0x24f8('0x21'),JSON[_0x24f8('0x23')](_0xdbece4));if(_0xdbece4['error']){if(_0xdbece4[_0x24f8('0x24')]['code']===0x1f4){logger['error'](_0x24f8('0x20'),_0x3a4760,_0xdbece4[_0x24f8('0x24')]['message']);return _0x1083a8(_0xdbece4[_0x24f8('0x24')][_0x24f8('0x25')]);}logger[_0x24f8('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x3a4760,_0xdbece4['error'][_0x24f8('0x25')]);return _0x3552aa(_0xdbece4[_0x24f8('0x24')][_0x24f8('0x25')]);}else{logger[_0x24f8('0x1f')](_0x24f8('0x20'),_0x3a4760,_0x24f8('0x21'));_0x3552aa(_0xdbece4[_0x24f8('0x26')][_0x24f8('0x25')]);}})['catch'](function(_0x200d47){logger[_0x24f8('0x24')](_0x24f8('0x20'),_0x3a4760,_0x200d47);_0x1083a8(_0x200d47);});});}function respondWithStatusCode(_0x432c9d,_0x239014){_0x239014=_0x239014||0xcc;return function(_0x1a3335){if(_0x1a3335){return _0x432c9d[_0x24f8('0x27')](_0x239014);}return _0x432c9d[_0x24f8('0x28')](_0x239014)[_0x24f8('0x29')]();};}function respondWithResult(_0x206ca9,_0x533ce9){_0x533ce9=_0x533ce9||0xc8;return function(_0xd8ef1f){if(_0xd8ef1f){return _0x206ca9[_0x24f8('0x28')](_0x533ce9)[_0x24f8('0x2a')](_0xd8ef1f);}};}function respondWithFilteredResult(_0x2d3aa3,_0x41f9f0){return function(_0x15a093){if(_0x15a093){var _0x505648=typeof _0x41f9f0[_0x24f8('0x2b')]===_0x24f8('0x2c')&&typeof _0x41f9f0[_0x24f8('0x2d')]===_0x24f8('0x2c');var _0x513aaf=_0x15a093[_0x24f8('0x2e')];var _0x14712b=_0x505648?0x0:_0x41f9f0[_0x24f8('0x2b')];var _0x4949ed=_0x505648?_0x15a093['count']:_0x41f9f0['offset']+_0x41f9f0[_0x24f8('0x2d')];var _0x111291;if(_0x4949ed>=_0x513aaf){_0x4949ed=_0x513aaf;_0x111291=0xc8;}else{_0x111291=0xce;}_0x2d3aa3[_0x24f8('0x28')](_0x111291);return _0x2d3aa3[_0x24f8('0x2f')](_0x24f8('0x30'),_0x14712b+'-'+_0x4949ed+'/'+_0x513aaf)[_0x24f8('0x2a')](_0x15a093);}return null;};}function patchUpdates(_0x12d7be){return function(_0x38d898){try{jsonpatch['apply'](_0x38d898,_0x12d7be,!![]);}catch(_0x24a4fa){return BPromise[_0x24f8('0x31')](_0x24a4fa);}return _0x38d898[_0x24f8('0x32')]();};}function saveUpdates(_0x15eef6,_0x1616e3){return function(_0x46cefc){if(_0x46cefc){return _0x46cefc['update'](_0x15eef6)[_0x24f8('0x1e')](function(_0x2c553b){return _0x2c553b;});}return null;};}function removeEntity(_0x1a9da3,_0xfac07b){return function(_0x3a4903){if(_0x3a4903){return _0x3a4903['destroy']()[_0x24f8('0x1e')](function(){var _0x1302a7=_0x3a4903[_0x24f8('0x33')]({'plain':!![]});var _0x753178=_0x24f8('0x34');return db[_0x24f8('0x35')][_0x24f8('0x36')]({'where':{'type':_0x753178,'resourceId':_0x1302a7['id']}})[_0x24f8('0x1e')](function(){return _0x3a4903;});})['then'](function(){_0x1a9da3[_0x24f8('0x28')](0xcc)[_0x24f8('0x29')]();});}};}function handleEntityNotFound(_0x99c614,_0x470005){return function(_0x44f248){if(!_0x44f248){_0x99c614[_0x24f8('0x27')](0x194);}return _0x44f248;};}function handleError(_0x50a67e,_0x4e0a72){_0x4e0a72=_0x4e0a72||0x1f4;return function(_0x914288){logger['error'](_0x914288[_0x24f8('0x37')]);if(_0x914288['name']){delete _0x914288['name'];}_0x50a67e['status'](_0x4e0a72)[_0x24f8('0x38')](_0x914288);};}exports[_0x24f8('0x39')]=function(_0x21650a,_0x5e6d9b){var _0x4e7fc8={'include':[{'model':db[_0x24f8('0x3a')],'as':_0x24f8('0x3b')}]},_0xea6cb3={},_0xc12c02={'count':0x0,'rows':[]};var _0x4c9f56=_[_0x24f8('0x3c')](db[_0x24f8('0x3d')][_0x24f8('0x3e')],function(_0x4c2353){return{'name':_0x4c2353[_0x24f8('0x3f')],'type':_0x4c2353[_0x24f8('0x40')][_0x24f8('0x41')]};});_0xea6cb3[_0x24f8('0x42')]=_[_0x24f8('0x3c')](_0x4c9f56,_0x24f8('0x43'));_0xea6cb3[_0x24f8('0x44')]=_['keys'](_0x21650a[_0x24f8('0x44')]);_0xea6cb3[_0x24f8('0x45')]=_['intersection'](_0xea6cb3[_0x24f8('0x42')],_0xea6cb3[_0x24f8('0x44')]);_0x4e7fc8[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0xea6cb3[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x21650a[_0x24f8('0x44')][_0x24f8('0x48')]));_0x4e7fc8[_0x24f8('0x46')]=_0x4e7fc8['attributes']['length']?_0x4e7fc8['attributes']:_0xea6cb3[_0x24f8('0x42')];if(!_0x21650a['query']['hasOwnProperty'](_0x24f8('0x49'))){_0x4e7fc8[_0x24f8('0x2d')]=qs[_0x24f8('0x2d')](_0x21650a[_0x24f8('0x44')][_0x24f8('0x2d')]);_0x4e7fc8[_0x24f8('0x2b')]=qs[_0x24f8('0x2b')](_0x21650a[_0x24f8('0x44')]['offset']);}_0x4e7fc8[_0x24f8('0x4a')]=qs[_0x24f8('0x4b')](_0x21650a[_0x24f8('0x44')][_0x24f8('0x4b')]);_0x4e7fc8[_0x24f8('0x4c')]=qs[_0x24f8('0x45')](_[_0x24f8('0x4d')](_0x21650a['query'],_0xea6cb3[_0x24f8('0x45')]),_0x4c9f56);if(_0x21650a[_0x24f8('0x44')][_0x24f8('0x4e')]){_0x4e7fc8['where']=_[_0x24f8('0x4f')](_0x4e7fc8[_0x24f8('0x4c')],{'$or':_[_0x24f8('0x3c')](_0x4c9f56,function(_0x5f379f){if(_0x5f379f[_0x24f8('0x40')]!==_0x24f8('0x50')){var _0x42bc8e={};_0x42bc8e[_0x5f379f[_0x24f8('0x43')]]={'$like':'%'+_0x21650a[_0x24f8('0x44')][_0x24f8('0x4e')]+'%'};return _0x42bc8e;}})});}_0x4e7fc8=_[_0x24f8('0x4f')]({},_0x4e7fc8,_0x21650a[_0x24f8('0x51')]);var _0x344f66={'where':_0x4e7fc8[_0x24f8('0x4c')]};return db['OpenchannelAccount']['count'](_0x344f66)[_0x24f8('0x1e')](function(_0x1b4555){_0xc12c02[_0x24f8('0x2e')]=_0x1b4555;if(_0x21650a[_0x24f8('0x44')][_0x24f8('0x52')]){_0x4e7fc8['include']=[{'all':!![]}];}return db[_0x24f8('0x3d')][_0x24f8('0x53')](_0x4e7fc8);})[_0x24f8('0x1e')](function(_0x132258){_0xc12c02[_0x24f8('0x54')]=_0x132258;return _0xc12c02;})[_0x24f8('0x1e')](respondWithFilteredResult(_0x5e6d9b,_0x4e7fc8))[_0x24f8('0x55')](handleError(_0x5e6d9b,null));};exports['show']=function(_0x1b0dbf,_0x340125){var _0x139120={'raw':![],'where':{'id':_0x1b0dbf[_0x24f8('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x24f8('0x3b')}]},_0x2ce0ae={};_0x2ce0ae[_0x24f8('0x42')]=_[_0x24f8('0x57')](db[_0x24f8('0x3d')][_0x24f8('0x3e')]);_0x2ce0ae[_0x24f8('0x44')]=_[_0x24f8('0x57')](_0x1b0dbf[_0x24f8('0x44')]);_0x2ce0ae[_0x24f8('0x45')]=_[_0x24f8('0x47')](_0x2ce0ae['model'],_0x2ce0ae['query']);_0x139120[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0x2ce0ae[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x1b0dbf['query'][_0x24f8('0x48')]));_0x139120[_0x24f8('0x46')]=_0x139120['attributes'][_0x24f8('0x58')]?_0x139120['attributes']:_0x2ce0ae[_0x24f8('0x42')];if(_0x1b0dbf['query'][_0x24f8('0x52')]){_0x139120[_0x24f8('0x59')]=[{'all':!![]}];}_0x139120=_[_0x24f8('0x4f')]({},_0x139120,_0x1b0dbf['options']);return db['OpenchannelAccount'][_0x24f8('0x5a')](_0x139120)['then'](handleEntityNotFound(_0x340125,null))[_0x24f8('0x1e')](respondWithResult(_0x340125,null))[_0x24f8('0x55')](handleError(_0x340125,null));};exports[_0x24f8('0x5b')]=function(_0x326c98,_0x1da5c0){return db[_0x24f8('0x3d')][_0x24f8('0x5b')](_0x326c98[_0x24f8('0x5c')],{})[_0x24f8('0x1e')](function(_0xa90591){var _0x112cdc=_0x326c98['user']['get']({'plain':!![]});if(!_0x112cdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x112cdc['role']==='user'){var _0x2a837b=_0xa90591[_0x24f8('0x33')]({'plain':!![]});var _0x18c92a='OpenchannelAccounts';return db[_0x24f8('0x5d')][_0x24f8('0x5a')]({'where':{'name':_0x18c92a,'userProfileId':_0x112cdc[_0x24f8('0x5e')]},'raw':!![]})['then'](function(_0x51f2cf){if(_0x51f2cf&&_0x51f2cf[_0x24f8('0x5f')]===0x0){return db[_0x24f8('0x35')][_0x24f8('0x5b')]({'name':_0x2a837b[_0x24f8('0x43')],'resourceId':_0x2a837b['id'],'type':_0x51f2cf['name'],'sectionId':_0x51f2cf['id']},{})[_0x24f8('0x1e')](function(){return _0xa90591;});}else{return _0xa90591;}})[_0x24f8('0x55')](function(_0x286d91){logger[_0x24f8('0x24')](_0x24f8('0x60'),_0x286d91);throw _0x286d91;});}return _0xa90591;})[_0x24f8('0x1e')](respondWithResult(_0x1da5c0,0xc9))[_0x24f8('0x55')](handleError(_0x1da5c0,null));};exports[_0x24f8('0x61')]=function(_0x30d28e,_0x511c6e){if(_0x30d28e[_0x24f8('0x5c')]['id']){delete _0x30d28e[_0x24f8('0x5c')]['id'];}return db[_0x24f8('0x3d')][_0x24f8('0x5a')]({'where':{'id':_0x30d28e[_0x24f8('0x56')]['id']},'include':[{'model':db[_0x24f8('0x3a')],'as':_0x24f8('0x3b')}]})[_0x24f8('0x1e')](handleEntityNotFound(_0x511c6e,null))[_0x24f8('0x1e')](saveUpdates(_0x30d28e[_0x24f8('0x5c')],null))[_0x24f8('0x1e')](respondWithResult(_0x511c6e,null))[_0x24f8('0x55')](handleError(_0x511c6e,null));};exports[_0x24f8('0x36')]=function(_0x4c5fbb,_0x27c0f7){return db[_0x24f8('0x3d')]['find']({'where':{'id':_0x4c5fbb['params']['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x27c0f7,null))['then'](removeEntity(_0x27c0f7,null))[_0x24f8('0x55')](handleError(_0x27c0f7,null));};exports[_0x24f8('0x62')]=function(_0xf17b64,_0x3731db){return db['OpenchannelAccount'][_0x24f8('0x62')]()[_0x24f8('0x1e')](respondWithResult(_0x3731db,null))[_0x24f8('0x55')](handleError(_0x3731db,null));};exports['addDisposition']=function(_0x59c903,_0x3b4339,_0x125dd5){if(_0x59c903[_0x24f8('0x5c')]['id']){delete _0x59c903[_0x24f8('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x59c903[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x3b4339,null))[_0x24f8('0x1e')](function(_0xa02393){if(_0xa02393){_0x59c903['body']['OpenchannelAccountId']=_0xa02393['id'];return db['Disposition'][_0x24f8('0x5b')](_0x59c903['body']);}})['then'](respondWithResult(_0x3b4339,null))[_0x24f8('0x55')](handleError(_0x3b4339,null));};exports[_0x24f8('0x63')]=function(_0x4c6ae0,_0x26b661,_0xefe9cd){var _0x349153={'raw':![],'where':{}};var _0x214392={};var _0x2d4088={'count':0x0,'rows':[]};return db[_0x24f8('0x3d')]['findOne']({'where':{'id':_0x4c6ae0[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x26b661,null))['then'](function(_0x324eea){if(_0x324eea){_0x214392[_0x24f8('0x42')]=_[_0x24f8('0x57')](db[_0x24f8('0x64')][_0x24f8('0x3e')]);_0x214392[_0x24f8('0x44')]=_[_0x24f8('0x57')](_0x4c6ae0[_0x24f8('0x44')]);_0x214392[_0x24f8('0x45')]=_['intersection'](_0x214392['model'],_0x214392['query']);_0x349153['attributes']=_[_0x24f8('0x47')](_0x214392[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x4c6ae0[_0x24f8('0x44')][_0x24f8('0x48')]));_0x349153[_0x24f8('0x46')]=_0x349153[_0x24f8('0x46')]['length']?_0x349153[_0x24f8('0x46')]:_0x214392[_0x24f8('0x42')];if(!_0x4c6ae0[_0x24f8('0x44')][_0x24f8('0x65')]('nolimit')){_0x349153[_0x24f8('0x2d')]=qs[_0x24f8('0x2d')](_0x4c6ae0[_0x24f8('0x44')]['limit']);_0x349153[_0x24f8('0x2b')]=qs[_0x24f8('0x2b')](_0x4c6ae0[_0x24f8('0x44')]['offset']);}_0x349153[_0x24f8('0x4a')]=qs['sort'](_0x4c6ae0['query'][_0x24f8('0x4b')]);_0x349153[_0x24f8('0x4c')]=qs[_0x24f8('0x45')](_[_0x24f8('0x4d')](_0x4c6ae0['query'],_0x214392['filters']));_0x349153[_0x24f8('0x4c')][_0x24f8('0x66')]=_0x324eea['id'];if(_0x4c6ae0[_0x24f8('0x44')][_0x24f8('0x4e')]){_0x349153[_0x24f8('0x4c')]=_['merge'](_0x349153[_0x24f8('0x4c')],{'$or':_[_0x24f8('0x3c')](_0x349153[_0x24f8('0x46')],function(_0x1ca08c){var _0xc06d07={};_0xc06d07[_0x1ca08c]={'$like':'%'+_0x4c6ae0['query'][_0x24f8('0x4e')]+'%'};return _0xc06d07;})});}_0x349153=_[_0x24f8('0x4f')]({},_0x349153,_0x4c6ae0[_0x24f8('0x51')]);return db[_0x24f8('0x64')][_0x24f8('0x2e')]({'where':_0x349153[_0x24f8('0x4c')]})[_0x24f8('0x1e')](function(_0x2e58e3){_0x2d4088[_0x24f8('0x2e')]=_0x2e58e3;if(_0x4c6ae0['query']['includeAll']){_0x349153[_0x24f8('0x59')]=[{'all':!![]}];}return db[_0x24f8('0x64')][_0x24f8('0x53')](_0x349153);})['then'](function(_0x53859e){_0x2d4088[_0x24f8('0x54')]=_0x53859e;return _0x2d4088;});}})[_0x24f8('0x1e')](respondWithFilteredResult(_0x26b661,_0x349153))[_0x24f8('0x55')](handleError(_0x26b661,null));};exports[_0x24f8('0x67')]=function(_0x58c35b,_0x1fc5da,_0x440277){return db[_0x24f8('0x3d')][_0x24f8('0x5a')]({'where':{'id':_0x58c35b[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x1fc5da,null))[_0x24f8('0x1e')](function(_0x279fd1){if(_0x279fd1){return _0x279fd1['removeDispositions'](_0x58c35b[_0x24f8('0x44')][_0x24f8('0x68')]);}})[_0x24f8('0x1e')](respondWithStatusCode(_0x1fc5da,null))['catch'](handleError(_0x1fc5da,null));};exports[_0x24f8('0x69')]=function(_0x28f6ec,_0x46dc15,_0x3dea55){if(_0x28f6ec[_0x24f8('0x5c')]['id']){delete _0x28f6ec[_0x24f8('0x5c')]['id'];}return db[_0x24f8('0x3d')]['find']({'where':{'id':_0x28f6ec[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x46dc15,null))[_0x24f8('0x1e')](function(_0x5e3530){if(_0x5e3530){_0x28f6ec[_0x24f8('0x5c')][_0x24f8('0x66')]=_0x5e3530['id'];return db[_0x24f8('0x6a')][_0x24f8('0x5b')](_0x28f6ec[_0x24f8('0x5c')]);}})[_0x24f8('0x1e')](respondWithResult(_0x46dc15,null))['catch'](handleError(_0x46dc15,null));};exports[_0x24f8('0x6b')]=function(_0x4e7ed5,_0xba0276,_0xab67e){var _0x16a2ca={'raw':![],'where':{}};var _0x17ab45={};var _0x2e80e9={'count':0x0,'rows':[]};return db[_0x24f8('0x3d')][_0x24f8('0x6c')]({'where':{'id':_0x4e7ed5[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0xba0276,null))[_0x24f8('0x1e')](function(_0x206d80){if(_0x206d80){_0x17ab45['model']=_[_0x24f8('0x57')](db['CannedAnswer'][_0x24f8('0x3e')]);_0x17ab45['query']=_['keys'](_0x4e7ed5['query']);_0x17ab45['filters']=_[_0x24f8('0x47')](_0x17ab45['model'],_0x17ab45[_0x24f8('0x44')]);_0x16a2ca[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0x17ab45[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x4e7ed5[_0x24f8('0x44')]['fields']));_0x16a2ca[_0x24f8('0x46')]=_0x16a2ca[_0x24f8('0x46')][_0x24f8('0x58')]?_0x16a2ca[_0x24f8('0x46')]:_0x17ab45[_0x24f8('0x42')];if(!_0x4e7ed5[_0x24f8('0x44')][_0x24f8('0x65')](_0x24f8('0x49'))){_0x16a2ca[_0x24f8('0x2d')]=qs['limit'](_0x4e7ed5['query']['limit']);_0x16a2ca['offset']=qs[_0x24f8('0x2b')](_0x4e7ed5[_0x24f8('0x44')][_0x24f8('0x2b')]);}_0x16a2ca[_0x24f8('0x4a')]=qs[_0x24f8('0x4b')](_0x4e7ed5[_0x24f8('0x44')][_0x24f8('0x4b')]);_0x16a2ca[_0x24f8('0x4c')]=qs[_0x24f8('0x45')](_[_0x24f8('0x4d')](_0x4e7ed5[_0x24f8('0x44')],_0x17ab45['filters']));_0x16a2ca['where'][_0x24f8('0x66')]=_0x206d80['id'];if(_0x4e7ed5[_0x24f8('0x44')][_0x24f8('0x4e')]){_0x16a2ca[_0x24f8('0x4c')]=_[_0x24f8('0x4f')](_0x16a2ca[_0x24f8('0x4c')],{'$or':_[_0x24f8('0x3c')](_0x16a2ca[_0x24f8('0x46')],function(_0x1a7c3a){var _0x757855={};_0x757855[_0x1a7c3a]={'$like':'%'+_0x4e7ed5[_0x24f8('0x44')]['filter']+'%'};return _0x757855;})});}_0x16a2ca=_['merge']({},_0x16a2ca,_0x4e7ed5[_0x24f8('0x51')]);return db[_0x24f8('0x6a')][_0x24f8('0x2e')]({'where':_0x16a2ca[_0x24f8('0x4c')]})[_0x24f8('0x1e')](function(_0x805abb){_0x2e80e9['count']=_0x805abb;if(_0x4e7ed5[_0x24f8('0x44')][_0x24f8('0x52')]){_0x16a2ca[_0x24f8('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x24f8('0x53')](_0x16a2ca);})['then'](function(_0x2179ef){_0x2e80e9[_0x24f8('0x54')]=_0x2179ef;return _0x2e80e9;});}})[_0x24f8('0x1e')](respondWithFilteredResult(_0xba0276,_0x16a2ca))[_0x24f8('0x55')](handleError(_0xba0276,null));};exports['removeAnswers']=function(_0x5e6be6,_0x2a6b18,_0x5dac94){return db[_0x24f8('0x3d')][_0x24f8('0x5a')]({'where':{'id':_0x5e6be6['params']['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x2a6b18,null))[_0x24f8('0x1e')](function(_0x36ae38){if(_0x36ae38){return _0x36ae38[_0x24f8('0x6d')](_0x5e6be6['query'][_0x24f8('0x68')]);}})['then'](respondWithStatusCode(_0x2a6b18,null))[_0x24f8('0x55')](handleError(_0x2a6b18,null));};exports[_0x24f8('0x6e')]=function(_0x24ef0e,_0x376fba,_0x449e6a){var _0x879159={'body':_0x24ef0e[_0x24f8('0x5c')],'channel':_0x24f8('0x6f')};var _0x4e8e39=[];var _0x360671=[];var _0x3393f1={};var _0xccfdc=![];return db['CmContact'][_0x24f8('0x62')]()[_0x24f8('0x1e')](function(_0x330eb0){if(!_0x330eb0){throw new db[(_0x24f8('0x70'))][(_0x24f8('0x71'))]('no\x20available\x20attributes');}_0x4e8e39=_[_0x24f8('0x72')](_[_0x24f8('0x57')](_0x330eb0),[_0x24f8('0x73'),_0x24f8('0x74')]);_0x360671=_['difference'](_[_0x24f8('0x57')](_0x330eb0),[_0x24f8('0x73'),_0x24f8('0x74'),_0x24f8('0x75'),_0x24f8('0x76')]);if(_0x24ef0e['body']['id']){delete _0x24ef0e['body']['id'];}if(_[_0x24f8('0x77')](_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x78')])){throw new db['Sequelize'][(_0x24f8('0x71'))](_0x24f8('0x79'));}if(_[_0x24f8('0x77')](_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x5c')])||_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x5c')]===''){throw new db[(_0x24f8('0x70'))][(_0x24f8('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x24f8('0x77')](_0x24ef0e[_0x24f8('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x24f8('0x71'))](_0x24f8('0x7a')+_0x360671);}if(!_['includes'](_0x360671,_0x24ef0e['body'][_0x24f8('0x7b')])){throw new db['Sequelize'][(_0x24f8('0x71'))](_0x24f8('0x7c')+_0x360671);}_0x3393f1[_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x7b')]]=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x78')];})['then'](function(){return db[_0x24f8('0x3d')]['find']({'where':{'id':_0x24ef0e[_0x24f8('0x56')]['id']},'include':[{'model':db[_0x24f8('0x7d')],'as':_0x24f8('0x7e'),'include':[{'model':db['CmContact'],'as':_0x24f8('0x7f'),'where':_0x3393f1,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x24f8('0x80')],'as':_0x24f8('0x81')}]});})[_0x24f8('0x1e')](handleEntityNotFound(_0x376fba,null))['then'](function(_0x4a8491){if(_0x4a8491&&_0x4a8491['List']){_0x879159[_0x24f8('0x82')]=_0x4a8491;_0x879159[_0x24f8('0x83')]=_0x4a8491['Applications'];_0x879159[_0x24f8('0x84')]=_0x4a8491['List'];_0x879159[_0x24f8('0x83')]=_['orderBy'](_0x879159[_0x24f8('0x83')],[_0x24f8('0x85')],[_0x24f8('0x86')]);if(_0x879159[_0x24f8('0x82')][_0x24f8('0x81')]){delete _0x879159[_0x24f8('0x82')]['Applications'];}if(_0x879159[_0x24f8('0x82')]['List']&&_0x879159[_0x24f8('0x82')][_0x24f8('0x7e')][_0x24f8('0x7f')]['length']){return _0x879159['account'][_0x24f8('0x7e')][_0x24f8('0x7f')][0x0];}var _0x2fda96=_[_0x24f8('0x87')](_0x24ef0e[_0x24f8('0x5c')],{'firstName':_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x78')],'ListId':_0x4a8491[_0x24f8('0x76')]});_0x2fda96[_0x24ef0e['body'][_0x24f8('0x7b')]]=_0x24ef0e['body'][_0x24f8('0x78')];return db[_0x24f8('0x88')][_0x24f8('0x5b')](_0x2fda96,{'fields':_0x4e8e39,'raw':!![]});}})[_0x24f8('0x1e')](handleEntityNotFound(_0x376fba,null))[_0x24f8('0x1e')](function(_0x555e60){_0x879159[_0x24f8('0x89')]=_0x555e60;if(_0x555e60){var _0x42825d={'ContactId':_0x555e60['id'],'OpenchannelAccountId':_0x24ef0e[_0x24f8('0x56')]['id'],'from':(_0x555e60['firstName']||'')+'\x20'+(_0x555e60[_0x24f8('0x8a')]||'')};var _0x4e4e9d={'OpenchannelAccountId':_0x24ef0e[_0x24f8('0x56')]['id'],'closed':![]};if(_0x24ef0e[_0x24f8('0x5c')]['threadId']){_0x4e4e9d[_0x24f8('0x8b')]=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x8b')];return db[_0x24f8('0x8c')][_0x24f8('0x5a')]({'where':_0x4e4e9d})[_0x24f8('0x1e')](function(_0x2dab01){if(_0x2dab01){return[_0x2dab01,![]];}_0x42825d[_0x24f8('0x8b')]=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x8b')];_0x42825d[_0x24f8('0x8d')]=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x8d')];return db['OpenchannelInteraction'][_0x24f8('0x5b')](_0x42825d)[_0x24f8('0x1e')](function(_0x32c0f6){return[_0x32c0f6,!![]];});});}else{_0x4e4e9d[_0x24f8('0x8b')]=null;}_0x4e4e9d[_0x24f8('0x8e')]=_0x555e60['id'];return db[_0x24f8('0x8c')]['find']({'where':_0x4e4e9d})[_0x24f8('0x1e')](function(_0x20010d){if(_0x20010d){return[_0x20010d,![]];}return db[_0x24f8('0x8c')][_0x24f8('0x5b')](_0x42825d)[_0x24f8('0x1e')](function(_0x17071f){return[_0x17071f,!![]];});});}})['spread'](function(_0x75ae2b,_0xf8ac12){if(_0x75ae2b){_0xccfdc=_0xf8ac12;if(!_0xf8ac12){var _0x1a1229={'from':(_0x879159['contact'][_0x24f8('0x8f')]||'')+'\x20'+(_0x879159[_0x24f8('0x89')]['lastName']||'')};if(_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x8b')]&&_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x90')]&&_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x8b')]!=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x90')]){_0x1a1229['threadId']=_0x24ef0e[_0x24f8('0x5c')][_0x24f8('0x90')];}return _0x75ae2b[_0x24f8('0x61')](_0x1a1229);}else{return _0x75ae2b;}}})[_0x24f8('0x1e')](function(_0x177b95){_0x879159[_0x24f8('0x91')]=_0x177b95[_0x24f8('0x33')]({'plain':!![]});_0x879159['interaction'][_0x24f8('0x92')]=_0xccfdc;if(_0x879159['interaction'][_0x24f8('0x92')]){if(_0x879159[_0x24f8('0x82')][_0x24f8('0x93')]){_0x879159[_0x24f8('0x83')][_0x24f8('0x94')]({'id':0x0,'priority':_0x879159[_0x24f8('0x83')][_0x24f8('0x58')]+0x1,'app':_0x24f8('0x95'),'appdata':_0x24f8('0x96'),'interval':_0x24f8('0x97')});}}return db[_0x24f8('0x98')][_0x24f8('0x5b')]({'body':_0x24ef0e['body'][_0x24f8('0x5c')],'OpenchannelAccountId':_0x24ef0e[_0x24f8('0x56')]['id'],'OpenchannelInteractionId':_0x177b95['id'],'direction':'in','ContactId':_0x879159[_0x24f8('0x89')]['id'],'AttachmentId':_0x24ef0e[_0x24f8('0x5c')]['AttachmentId']});})['then'](function(_0x2c121a){_0x879159[_0x24f8('0x25')]=_0x2c121a;if(_0x879159[_0x24f8('0x91')][_0x24f8('0x99')]){return db[_0x24f8('0x9a')][_0x24f8('0x5a')]({'attributes':['id',_0x24f8('0x43')],'where':{'id':_0x879159[_0x24f8('0x91')]['UserId']}})[_0x24f8('0x1e')](function(_0x1b07d6){if(_0x1b07d6){_0x879159['applications'][_0x24f8('0x9b')]({'id':0x0,'priority':0x0,'app':_0x24f8('0x9c'),'appdata':_0x1b07d6[_0x24f8('0x43')]+','+(_0x879159['account'][_0x24f8('0x9d')]||0xa),'interval':_0x24f8('0x97')});_0x879159[_0x24f8('0x9e')]=![];}return respondWithRpcPromise(_0x24f8('0x9f'),_0x24f8('0xa0'),_0x879159);});}return respondWithRpcPromise(_0x24f8('0x9f'),'startRouting',_0x879159);})[_0x24f8('0x1e')](function(_0x411fdf){respondWithRpcPromise('EventManager',_0x24f8('0xa1'),{'event':'notify','message':_0x411fdf},client9002);return _0x411fdf;})['then'](respondWithResult(_0x376fba,null))[_0x24f8('0x55')](handleError(_0x376fba,null));};exports['addApplications']=function(_0x4ff450,_0x5e6e3b){var _0x47f6ae=_0x4ff450[_0x24f8('0x56')]['id'];var _0x2fa116=_0x4ff450[_0x24f8('0x5c')];var _0x30cd8b=0xc8;var _0x3be1fb=null;return db[_0x24f8('0xa2')][_0x24f8('0xa3')]({'isolationLevel':db[_0x24f8('0xa2')][_0x24f8('0xa4')][_0x24f8('0xa5')]['READ_COMMITTED']},function(_0x1751bf){return db[_0x24f8('0x3d')][_0x24f8('0x6c')]({'where':{'id':_0x47f6ae},'transaction':_0x1751bf})[_0x24f8('0x1e')](function(_0x2da6fb){if(_0x2da6fb){return db[_0x24f8('0x80')][_0x24f8('0x36')]({'where':{'OpenchannelAccountId':_0x47f6ae},'transaction':_0x1751bf})['then'](function(){var _0x51dc48=_[_0x24f8('0x3c')](_0x2fa116,function(_0x113370){_0x113370[_0x24f8('0x66')]=_0x47f6ae;return _0x113370;});return db[_0x24f8('0x80')][_0x24f8('0xa6')](_0x51dc48,{'transaction':_0x1751bf});});}else{_0x30cd8b=0x194;_0x3be1fb=[];}});})[_0x24f8('0x1e')](function(){if(_0x30cd8b!==0x194){return db[_0x24f8('0x80')][_0x24f8('0xa7')]({'where':{'OpenchannelAccountId':_0x47f6ae},'order':'priority'})[_0x24f8('0x1e')](function(_0x12adb6){_0x3be1fb=_0x12adb6;});}})[_0x24f8('0x55')](function(_0x596a59){_0x30cd8b=0x1f4;logger[_0x24f8('0x24')](_0x596a59[_0x24f8('0x37')]);if(_0x596a59['name']){delete _0x596a59[_0x24f8('0x43')];}_0x3be1fb=_0x596a59;})[_0x24f8('0xa8')](function(){if(_0x3be1fb===null){_0x5e6e3b['sendStatus'](_0x30cd8b);}else{if(_0x30cd8b===0x1f4){_0x5e6e3b[_0x24f8('0x28')](_0x30cd8b)[_0x24f8('0x38')](_0x3be1fb);}else{_0x5e6e3b[_0x24f8('0x28')](_0x30cd8b)[_0x24f8('0x2a')](_0x3be1fb);}}});};exports[_0x24f8('0xa9')]=function(_0x2f9fcd,_0x11ed33,_0x1a790d){var _0x1bb135={};var _0x29e7af={};var _0xb71777;var _0x455feb;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2f9fcd[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x11ed33,null))[_0x24f8('0x1e')](function(_0x3ef8ae){if(_0x3ef8ae){_0xb71777=_0x3ef8ae;_0x29e7af[_0x24f8('0x42')]=_[_0x24f8('0x57')](db[_0x24f8('0x80')][_0x24f8('0x3e')]);_0x29e7af[_0x24f8('0x44')]=_[_0x24f8('0x57')](_0x2f9fcd[_0x24f8('0x44')]);_0x29e7af[_0x24f8('0x45')]=_[_0x24f8('0x47')](_0x29e7af['model'],_0x29e7af['query']);_0x1bb135[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0x29e7af['model'],qs[_0x24f8('0x48')](_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x48')]));_0x1bb135[_0x24f8('0x46')]=_0x1bb135[_0x24f8('0x46')][_0x24f8('0x58')]?_0x1bb135[_0x24f8('0x46')]:_0x29e7af[_0x24f8('0x42')];_0x1bb135['order']=qs['sort'](_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x4b')]);_0x1bb135[_0x24f8('0x4c')]=qs['filters'](_[_0x24f8('0x4d')](_0x2f9fcd['query'],_0x29e7af[_0x24f8('0x45')]));if(_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x4e')]){_0x1bb135[_0x24f8('0x4c')]=_[_0x24f8('0x4f')](_0x1bb135['where'],{'$or':_[_0x24f8('0x3c')](_0x1bb135[_0x24f8('0x46')],function(_0x5c7213){var _0x30528f={};_0x30528f[_0x5c7213]={'$like':'%'+_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x4e')]+'%'};return _0x30528f;})});}_0x1bb135=_['merge']({},_0x1bb135,_0x2f9fcd[_0x24f8('0x51')]);return _0xb71777[_0x24f8('0xa9')](_0x1bb135);}})[_0x24f8('0x1e')](function(_0x1ed469){if(_0x1ed469){_0x455feb=_0x1ed469[_0x24f8('0x58')];if(!_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x65')](_0x24f8('0x49'))){_0x1bb135['limit']=qs[_0x24f8('0x2d')](_0x2f9fcd[_0x24f8('0x44')]['limit']);_0x1bb135[_0x24f8('0x2b')]=qs['offset'](_0x2f9fcd[_0x24f8('0x44')][_0x24f8('0x2b')]);}return _0xb71777[_0x24f8('0xa9')](_0x1bb135);}})[_0x24f8('0x1e')](function(_0x554f8e){if(_0x554f8e){return _0x554f8e?{'count':_0x455feb,'rows':_0x554f8e}:null;}})['then'](respondWithResult(_0x11ed33,null))[_0x24f8('0x55')](handleError(_0x11ed33,null));};exports[_0x24f8('0xaa')]=function(_0x56cf3a,_0x136cdd,_0x44b7e0){var _0x2e382c={'raw':![],'where':{}};var _0x407d6d={};var _0x2a90ad={'count':0x0,'rows':[]};return db[_0x24f8('0x3d')][_0x24f8('0x6c')]({'where':{'id':_0x56cf3a[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x136cdd,null))[_0x24f8('0x1e')](function(_0x4f4dd2){if(_0x4f4dd2){_0x407d6d[_0x24f8('0x42')]=_[_0x24f8('0x57')](db[_0x24f8('0x8c')][_0x24f8('0x3e')]);_0x407d6d[_0x24f8('0x44')]=_['keys'](_0x56cf3a[_0x24f8('0x44')]);_0x407d6d[_0x24f8('0x45')]=_[_0x24f8('0x47')](_0x407d6d[_0x24f8('0x42')],_0x407d6d[_0x24f8('0x44')]);_0x2e382c[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0x407d6d[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x48')]));_0x2e382c[_0x24f8('0x46')]=_0x2e382c[_0x24f8('0x46')][_0x24f8('0x58')]?_0x2e382c[_0x24f8('0x46')]:_0x407d6d[_0x24f8('0x42')];if(!_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x65')](_0x24f8('0x49'))){_0x2e382c[_0x24f8('0x2d')]=qs[_0x24f8('0x2d')](_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x2d')]);_0x2e382c['offset']=qs[_0x24f8('0x2b')](_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x2b')]);}_0x2e382c['order']=qs[_0x24f8('0x4b')](_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x4b')]);_0x2e382c[_0x24f8('0x4c')]=qs['filters'](_[_0x24f8('0x4d')](_0x56cf3a[_0x24f8('0x44')],_0x407d6d['filters']));_0x2e382c['where'][_0x24f8('0x66')]=_0x4f4dd2['id'];if(_0x56cf3a[_0x24f8('0x44')][_0x24f8('0x4e')]){_0x2e382c[_0x24f8('0x4c')]=_['merge'](_0x2e382c[_0x24f8('0x4c')],{'$or':_['map'](_0x2e382c[_0x24f8('0x46')],function(_0x771bc0){var _0x4aebab={};_0x4aebab[_0x771bc0]={'$like':'%'+_0x56cf3a[_0x24f8('0x44')]['filter']+'%'};return _0x4aebab;})});}_0x2e382c=_['merge']({},_0x2e382c,_0x56cf3a[_0x24f8('0x51')]);return db[_0x24f8('0x8c')]['count']({'where':_0x2e382c[_0x24f8('0x4c')]})[_0x24f8('0x1e')](function(_0x142660){_0x2a90ad['count']=_0x142660;if(_0x56cf3a['query']['includeAll']){_0x2e382c[_0x24f8('0x59')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x24f8('0x9a')],'as':_0x24f8('0xab'),'attributes':['name',_0x24f8('0xac'),_0x24f8('0xad')],'required':![]},{'model':db[_0x24f8('0xae')],'as':'Tags','attributes':['id',_0x24f8('0x43'),'color'],'where':_0x56cf3a[_0x24f8('0x44')][_0x24f8('0xaf')]?{'id':_0x56cf3a[_0x24f8('0x44')][_0x24f8('0xaf')]}:undefined,'required':_0x56cf3a[_0x24f8('0x44')]['tag']?!![]:![]}];}return db[_0x24f8('0x8c')][_0x24f8('0x53')](_0x2e382c);})[_0x24f8('0x1e')](function(_0x189e09){_0x2a90ad['rows']=_0x189e09;return _0x2a90ad;});}})[_0x24f8('0x1e')](respondWithFilteredResult(_0x136cdd,_0x2e382c))[_0x24f8('0x55')](handleError(_0x136cdd,null));};exports[_0x24f8('0xb0')]=function(_0xcb0a70,_0x420b6d,_0x2dd0b7){return db[_0x24f8('0x3d')]['find']({'where':{'id':_0xcb0a70[_0x24f8('0x56')]['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x420b6d,null))['then'](function(_0x1757fa){if(_0x1757fa){return _0x1757fa[_0x24f8('0xb0')](_0xcb0a70[_0x24f8('0x5c')][_0x24f8('0x68')],_[_0x24f8('0xb1')](_0xcb0a70[_0x24f8('0x5c')],['ids','id'])||{})[_0x24f8('0xb2')](function(_0x5af4a0){for(var _0x5c3907=0x0;_0x5c3907<_0xcb0a70['body'][_0x24f8('0x68')][_0x24f8('0x58')];_0x5c3907+=0x1){socket['emit'](_0x24f8('0xb3'),{'UserId':Number(_0xcb0a70['body']['ids'][_0x5c3907]),'OpenchannelAccountId':Number(_0xcb0a70[_0x24f8('0x56')]['id'])});}return _0x5af4a0;});}})[_0x24f8('0x1e')](respondWithResult(_0x420b6d,null))[_0x24f8('0x55')](handleError(_0x420b6d,null));};exports['removeAgents']=function(_0x2d168d,_0x2539eb,_0x297ada){return db[_0x24f8('0x3d')][_0x24f8('0x5a')]({'where':{'id':_0x2d168d['params']['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x2539eb,null))['then'](function(_0x493483){if(_0x493483){return _0x493483[_0x24f8('0xb4')](_0x2d168d[_0x24f8('0x44')][_0x24f8('0x68')])[_0x24f8('0x1e')](function(){if(_[_0x24f8('0xb5')](_0x2d168d['query'][_0x24f8('0x68')])){for(var _0x336b23=0x0;_0x336b23<_0x2d168d[_0x24f8('0x44')]['ids'][_0x24f8('0x58')];_0x336b23+=0x1){socket[_0x24f8('0xb6')](_0x24f8('0xb7'),{'UserId':Number(_0x2d168d['query'][_0x24f8('0x68')][_0x336b23]),'OpenchannelAccountId':Number(_0x2d168d[_0x24f8('0x56')]['id'])});}}else{socket['emit'](_0x24f8('0xb7'),{'UserId':Number(_0x2d168d[_0x24f8('0x44')][_0x24f8('0x68')]),'OpenchannelAccountId':Number(_0x2d168d[_0x24f8('0x56')]['id'])});}});}})[_0x24f8('0x1e')](respondWithStatusCode(_0x2539eb,null))['catch'](handleError(_0x2539eb,null));};exports[_0x24f8('0xb8')]=function(_0x294bed,_0x3e9abc,_0x3fde54){var _0x2e87a3={};var _0x388c2a={};var _0x473f1d;var _0x274e16;return db[_0x24f8('0x3d')][_0x24f8('0x6c')]({'where':{'id':_0x294bed['params']['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x3e9abc,null))['then'](function(_0x482686){if(_0x482686){_0x473f1d=_0x482686;_0x388c2a[_0x24f8('0x42')]=_[_0x24f8('0x57')](db[_0x24f8('0x9a')]['rawAttributes']);_0x388c2a['query']=_[_0x24f8('0x57')](_0x294bed['query']);_0x388c2a[_0x24f8('0x45')]=_[_0x24f8('0x47')](_0x388c2a['model'],_0x388c2a[_0x24f8('0x44')]);_0x2e87a3[_0x24f8('0x46')]=_[_0x24f8('0x47')](_0x388c2a[_0x24f8('0x42')],qs[_0x24f8('0x48')](_0x294bed['query'][_0x24f8('0x48')]));_0x2e87a3[_0x24f8('0x46')]=_0x2e87a3[_0x24f8('0x46')][_0x24f8('0x58')]?_0x2e87a3['attributes']:_0x388c2a[_0x24f8('0x42')];_0x2e87a3['order']=qs[_0x24f8('0x4b')](_0x294bed[_0x24f8('0x44')][_0x24f8('0x4b')]);_0x2e87a3[_0x24f8('0x4c')]=qs[_0x24f8('0x45')](_[_0x24f8('0x4d')](_0x294bed[_0x24f8('0x44')],_0x388c2a[_0x24f8('0x45')]));if(_0x294bed[_0x24f8('0x44')]['filter']){_0x2e87a3[_0x24f8('0x4c')]=_[_0x24f8('0x4f')](_0x2e87a3['where'],{'$or':_[_0x24f8('0x3c')](_0x2e87a3['attributes'],function(_0x2d117e){var _0x490947={};_0x490947[_0x2d117e]={'$like':'%'+_0x294bed[_0x24f8('0x44')][_0x24f8('0x4e')]+'%'};return _0x490947;})});}_0x2e87a3=_[_0x24f8('0x4f')]({},_0x2e87a3,_0x294bed[_0x24f8('0x51')]);return _0x473f1d['getAgents'](_0x2e87a3);}})[_0x24f8('0x1e')](function(_0x1ae575){if(_0x1ae575){_0x274e16=_0x1ae575['length'];if(!_0x294bed[_0x24f8('0x44')]['hasOwnProperty'](_0x24f8('0x49'))){_0x2e87a3[_0x24f8('0x2d')]=qs[_0x24f8('0x2d')](_0x294bed[_0x24f8('0x44')][_0x24f8('0x2d')]);_0x2e87a3[_0x24f8('0x2b')]=qs[_0x24f8('0x2b')](_0x294bed['query']['offset']);}return _0x473f1d[_0x24f8('0xb8')](_0x2e87a3);}})['then'](function(_0x515653){if(_0x515653){return _0x515653?{'count':_0x274e16,'rows':_0x515653}:null;}})['then'](respondWithResult(_0x3e9abc,null))[_0x24f8('0x55')](handleError(_0x3e9abc,null));};exports[_0x24f8('0x38')]=function(_0x5527cb,_0x3eef7c,_0x3f4d2a){var _0x3b1594,_0x1360ad,_0x4a967e;if(_['isNil'](_0x5527cb['body'][_0x24f8('0x5c')])||_0x5527cb[_0x24f8('0x5c')][_0x24f8('0x5c')]===''){throw new db['Sequelize'][(_0x24f8('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x24f8('0x77')](_0x5527cb[_0x24f8('0x5c')]['to'])){}_0x3b1594=_0x5527cb[_0x24f8('0x5c')]['to'];return db[_0x24f8('0x3d')][_0x24f8('0x6c')]({'where':{'id':_0x5527cb['params']['id']}})[_0x24f8('0x1e')](handleEntityNotFound(_0x3eef7c,null))[_0x24f8('0x1e')](function(_0x30f5d3){if(_0x30f5d3){return db[_0x24f8('0x3d')]['find']({'where':{'id':_0x30f5d3['id']},'include':[{'model':db[_0x24f8('0x7d')],'as':_0x24f8('0x7e'),'include':[{'model':db[_0x24f8('0x88')],'as':_0x24f8('0x7f'),'where':{[_0x30f5d3[_0x24f8('0x7b')]]:_0x3b1594},'limit':0x1,'order':[[_0x24f8('0x74'),'DESC']]}]}]})[_0x24f8('0x1e')](handleEntityNotFound(_0x3eef7c,null))[_0x24f8('0x1e')](function(_0x2f8627){if(_0x2f8627&&_0x2f8627[_0x24f8('0x7e')]){_0x1360ad=_0x2f8627[_0x24f8('0x33')]({'plain':!![]});if(_0x1360ad['List']&&_0x1360ad['List'][_0x24f8('0x7f')]['length']){return _0x1360ad[_0x24f8('0x7e')][_0x24f8('0x7f')][0x0];}return db[_0x24f8('0x88')][_0x24f8('0x5b')](_[_0x24f8('0x87')](_0x5527cb[_0x24f8('0x5c')],{'firstName':_0x3b1594,[_0x2f8627[_0x24f8('0x7b')]]:_0x3b1594,'phone':_0x3b1594,'ListId':_0x1360ad[_0x24f8('0x76')]}));}})[_0x24f8('0x1e')](handleEntityNotFound(_0x3eef7c,null))['then'](function(_0x2c9ad5){if(_0x2c9ad5){_0x4a967e=_0x2c9ad5;return db[_0x24f8('0x8c')][_0x24f8('0x5a')]({'where':{'ContactId':_0x4a967e['id'],'closed':![],'OpenchannelAccountId':_0x1360ad['id']}})[_0x24f8('0x1e')](function(_0x31256){if(_0x31256){return[_0x31256,![]];}return db[_0x24f8('0x8c')][_0x24f8('0x5b')]({'UserId':_0x5527cb[_0x24f8('0xb9')]['id'],'ContactId':_0x4a967e['id'],'OpenchannelAccountId':_0x1360ad['id'],'lastMsgDirection':_0x24f8('0xba'),'firstMsgDirection':_0x24f8('0xba'),'Messages':[_[_0x24f8('0x4f')](_0x5527cb[_0x24f8('0x5c')],{'read':![],'body':_0x5527cb[_0x24f8('0x5c')]['body'],'OpenchannelAccountId':_0x1360ad['id'],'UserId':_0x5527cb[_0x24f8('0xb9')]['id'],'ContactId':_0x4a967e['id']})]},{'include':[{'model':db[_0x24f8('0x98')],'as':_0x24f8('0xbb')}]})[_0x24f8('0x1e')](function(_0x2338ac){return[_0x2338ac,!![]];});});}})[_0x24f8('0xb2')](function(_0x1f8441,_0x23cdb8){if(_0x23cdb8){return _0x1f8441;}return db[_0x24f8('0x98')][_0x24f8('0x5b')](_[_0x24f8('0x4f')](_0x5527cb[_0x24f8('0x5c')],{'read':![],'body':_0x5527cb[_0x24f8('0x5c')][_0x24f8('0x5c')],'OpenchannelAccountId':_0x1360ad['id'],'OpenchannelInteractionId':_0x1f8441['id'],'UserId':_0x5527cb[_0x24f8('0xb9')]['id'],'ContactId':_0x4a967e['id']}))['then'](function(_0x4a503a){_0x1f8441[_0x24f8('0xbc')]['Messages']=[];_0x1f8441[_0x24f8('0xbc')][_0x24f8('0xbb')][_0x24f8('0x94')](_0x4a503a['dataValues']);return _0x1f8441;});});}})['then'](respondWithResult(_0x3eef7c,null))[_0x24f8('0x55')](handleError(_0x3eef7c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 7e4a43c..b2b9091 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 _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x4eb3c5,_0x448889){var _0x756ae2=function(_0x48c799){while(--_0x48c799){_0x4eb3c5['push'](_0x4eb3c5['shift']());}};_0x756ae2(++_0x448889);}(_0xa74f,0x9a));var _0xfa74=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xa74f[_0x243217];return _0x478029;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0x1f5345,_0x3f4b06){var _0x2bca12=function(_0x42f022){while(--_0x42f022){_0x1f5345['push'](_0x1f5345['shift']());}};_0x2bca12(++_0x3f4b06);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 29e3b19..0f9c869 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(_0x28d6e6,_0x3814ba){var _0x242fe8=function(_0x1f451e){while(--_0x1f451e){_0x28d6e6['push'](_0x28d6e6['shift']());}};_0x242fe8(++_0x3814ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x746fb1,_0x458ccf){var _0x471e77=function(_0x3006ff){while(--_0x3006ff){_0x746fb1['push'](_0x746fb1['shift']());}};_0x471e77(++_0x458ccf);}(_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 52239fb..7b1953c 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 _0x1ba2=['http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x21ba('0x0'));var util=require('util');var moment=require(_0x21ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x21ba('0x2'));var fs=require('fs');var Redis=require(_0x21ba('0x3'));var db=require(_0x21ba('0x4'))['db'];var utils=require(_0x21ba('0x5'));var logger=require(_0x21ba('0x6'))('rpc');var config=require(_0x21ba('0x7'));var jayson=require(_0x21ba('0x8'));var client=jayson['client'][_0x21ba('0x9')]({'port':0x232a});config['redis']=_[_0x21ba('0xa')](config[_0x21ba('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x21ba('0xc'))(new Redis(config['redis']));require(_0x21ba('0xd'))[_0x21ba('0xe')](socket);function respondWithRpcPromise(_0x48ddf3,_0x3063e9,_0x32393d){return new BPromise(function(_0x3926b5,_0x3512a2){return client[_0x21ba('0xf')](_0x48ddf3,_0x32393d)[_0x21ba('0x10')](function(_0x2953d2){logger[_0x21ba('0x11')](_0x21ba('0x12'),_0x3063e9,_0x21ba('0x13'));logger[_0x21ba('0x14')](_0x21ba('0x15'),_0x3063e9,'request\x20sent',JSON['stringify'](_0x2953d2));if(_0x2953d2[_0x21ba('0x16')]){if(_0x2953d2[_0x21ba('0x16')][_0x21ba('0x17')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3063e9,_0x2953d2[_0x21ba('0x16')]['message']);return _0x3512a2(_0x2953d2[_0x21ba('0x16')]['message']);}logger[_0x21ba('0x16')](_0x21ba('0x12'),_0x3063e9,_0x2953d2[_0x21ba('0x16')][_0x21ba('0x18')]);return _0x3926b5(_0x2953d2[_0x21ba('0x16')]['message']);}else{logger[_0x21ba('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3063e9,_0x21ba('0x13'));_0x3926b5(_0x2953d2[_0x21ba('0x19')][_0x21ba('0x18')]);}})[_0x21ba('0x1a')](function(_0x305c05){logger[_0x21ba('0x16')](_0x21ba('0x12'),_0x3063e9,_0x305c05);_0x3512a2(_0x305c05);});});} \ No newline at end of file +var _0x74f0=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4553cb,_0x300096){var _0x3814c4=function(_0x255415){while(--_0x255415){_0x4553cb['push'](_0x4553cb['shift']());}};_0x3814c4(++_0x300096);}(_0x74f0,0xf3));var _0x074f=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x74f0[_0x5f0501];return _0x3c2c45;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});config[_0x074f('0x9')]=_[_0x074f('0xa')](config[_0x074f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x074f('0xb'))(new Redis(config[_0x074f('0x9')]));require('./openchannelAccount.socket')[_0x074f('0xc')](socket);function respondWithRpcPromise(_0x1a778a,_0x4337f9,_0x33d8c4){return new BPromise(function(_0x40179d,_0x4f37e1){return client['request'](_0x1a778a,_0x33d8c4)[_0x074f('0xd')](function(_0x41646d){logger[_0x074f('0xe')](_0x074f('0xf'),_0x4337f9,_0x074f('0x10'));logger[_0x074f('0x11')](_0x074f('0x12'),_0x4337f9,_0x074f('0x10'),JSON[_0x074f('0x13')](_0x41646d));if(_0x41646d['error']){if(_0x41646d[_0x074f('0x14')]['code']===0x1f4){logger[_0x074f('0x14')](_0x074f('0xf'),_0x4337f9,_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);return _0x4f37e1(_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);}logger[_0x074f('0x14')](_0x074f('0xf'),_0x4337f9,_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);return _0x40179d(_0x41646d[_0x074f('0x14')]['message']);}else{logger[_0x074f('0xe')](_0x074f('0xf'),_0x4337f9,_0x074f('0x10'));_0x40179d(_0x41646d[_0x074f('0x16')][_0x074f('0x15')]);}})[_0x074f('0x17')](function(_0x548aab){logger['error'](_0x074f('0xf'),_0x4337f9,_0x548aab);_0x4f37e1(_0x548aab);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 72fc31b..95b0ce1 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 _0x3ae9=['register','length','openchannelAccount:','remove','update','emit'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3ae9,0xdb));var _0x93ae=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x3ae9[_0x487b0c];return _0x1adbdc;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x93ae('0x0'),_0x93ae('0x1')];function createListener(_0x189f64,_0x4a724f){return function(_0x946abf){_0x4a724f[_0x93ae('0x2')](_0x189f64,_0x946abf);};}function removeListener(_0x2dc540,_0x2af5aa){return function(){OpenchannelAccountEvents['removeListener'](_0x2dc540,_0x2af5aa);};}exports[_0x93ae('0x3')]=function(_0x51e450){for(var _0x3a9a9c=0x0,_0x32564c=events[_0x93ae('0x4')];_0x3a9a9c<_0x32564c;_0x3a9a9c++){var _0x36e141=events[_0x3a9a9c];var _0x22761c=createListener(_0x93ae('0x5')+_0x36e141,_0x51e450);OpenchannelAccountEvents['on'](_0x36e141,_0x22761c);}}; \ No newline at end of file +var _0xb945=['length','./openchannelAccount.events','remove','emit','removeListener','register'];(function(_0x1399e7,_0x1230f2){var _0x168759=function(_0x5f1a3b){while(--_0x5f1a3b){_0x1399e7['push'](_0x1399e7['shift']());}};_0x168759(++_0x1230f2);}(_0xb945,0x97));var _0x5b94=function(_0x1055d3,_0x5dce87){_0x1055d3=_0x1055d3-0x0;var _0x55b24a=_0xb945[_0x1055d3];return _0x55b24a;};'use strict';var OpenchannelAccountEvents=require(_0x5b94('0x0'));var events=['save',_0x5b94('0x1'),'update'];function createListener(_0x2b814e,_0x4cc83f){return function(_0x488e8d){_0x4cc83f[_0x5b94('0x2')](_0x2b814e,_0x488e8d);};}function removeListener(_0x3f7199,_0x30d552){return function(){OpenchannelAccountEvents[_0x5b94('0x3')](_0x3f7199,_0x30d552);};}exports[_0x5b94('0x4')]=function(_0x4bef06){for(var _0x492388=0x0,_0x2db8d8=events[_0x5b94('0x5')];_0x492388<_0x2db8d8;_0x492388++){var _0x42bd69=events[_0x492388];var _0x186d22=createListener('openchannelAccount:'+_0x42bd69,_0x4bef06);OpenchannelAccountEvents['on'](_0x42bd69,_0x186d22);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 09f7720..e873303 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 _0x90dd=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x4df9bf,_0x31b340){var _0x285791=function(_0x4b49ef){while(--_0x4b49ef){_0x4df9bf['push'](_0x4df9bf['shift']());}};_0x285791(++_0x31b340);}(_0x90dd,0x80));var _0xd90d=function(_0x362795,_0x2c7301){_0x362795=_0x362795-0x0;var _0x591278=_0x90dd[_0x362795];return _0x591278;};'use strict';var multer=require(_0xd90d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd90d('0x1'));var express=require(_0xd90d('0x2'));var router=express[_0xd90d('0x3')]();var fs_extra=require(_0xd90d('0x4'));var auth=require(_0xd90d('0x5'));var interaction=require(_0xd90d('0x6'));var config=require(_0xd90d('0x7'));var controller=require(_0xd90d('0x8'));router[_0xd90d('0x9')]('/',auth['isAuthenticated'](),controller[_0xd90d('0xa')]);router['get'](_0xd90d('0xb'),auth[_0xd90d('0xc')](),controller[_0xd90d('0xd')]);router[_0xd90d('0xe')]('/',auth[_0xd90d('0xc')](),controller['create']);router[_0xd90d('0xf')](_0xd90d('0xb'),auth[_0xd90d('0xc')](),controller['update']);router['delete'](_0xd90d('0xb'),auth[_0xd90d('0xc')](),controller[_0xd90d('0x10')]);module[_0xd90d('0x11')]=router; \ No newline at end of file +var _0xc69d=['show','post','create','put','update','delete','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x488464,_0x3ed292){var _0x4d3c86=function(_0x14127c){while(--_0x14127c){_0x488464['push'](_0x488464['shift']());}};_0x4d3c86(++_0x3ed292);}(_0xc69d,0x114));var _0xdc69=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc69d[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0xdc69('0x0'));var util=require('util');var path=require(_0xdc69('0x1'));var timeout=require(_0xdc69('0x2'));var express=require(_0xdc69('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc69('0x4'));var interaction=require(_0xdc69('0x5'));var config=require(_0xdc69('0x6'));var controller=require(_0xdc69('0x7'));router[_0xdc69('0x8')]('/',auth[_0xdc69('0x9')](),controller[_0xdc69('0xa')]);router['get'](_0xdc69('0xb'),auth[_0xdc69('0x9')](),controller[_0xdc69('0xc')]);router[_0xdc69('0xd')]('/',auth[_0xdc69('0x9')](),controller[_0xdc69('0xe')]);router[_0xdc69('0xf')]('/:id',auth[_0xdc69('0x9')](),controller[_0xdc69('0x10')]);router[_0xdc69('0x11')](_0xdc69('0xb'),auth[_0xdc69('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 2b44fbc..df20e77 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 _0xa3c5=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x454a5b,_0x42184b){var _0x2b7ad6=function(_0xa15ee1){while(--_0xa15ee1){_0x454a5b['push'](_0x454a5b['shift']());}};_0x2b7ad6(++_0x42184b);}(_0xa3c5,0x136));var _0x5a3c=function(_0x55e25c,_0x5de6a6){_0x55e25c=_0x55e25c-0x0;var _0xb42603=_0xa3c5[_0x55e25c];return _0xb42603;};'use strict';var Sequelize=require('sequelize');module[_0x5a3c('0x0')]={'priority':{'type':Sequelize[_0x5a3c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5a3c('0x2')],'allowNull':![],'defaultValue':_0x5a3c('0x3')},'appdata':{'type':Sequelize[_0x5a3c('0x4')]()},'description':{'type':Sequelize[_0x5a3c('0x2')]},'interval':{'type':Sequelize[_0x5a3c('0x2')],'defaultValue':_0x5a3c('0x5')}}; \ No newline at end of file +var _0x09b6=['STRING','noop','exports','INTEGER'];(function(_0x2eade5,_0x5593b8){var _0x1e9966=function(_0x4c6612){while(--_0x4c6612){_0x2eade5['push'](_0x2eade5['shift']());}};_0x1e9966(++_0x5593b8);}(_0x09b6,0xf2));var _0x609b=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x09b6[_0x1c510a];return _0x23cedd;};'use strict';var Sequelize=require('sequelize');module[_0x609b('0x0')]={'priority':{'type':Sequelize[_0x609b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x609b('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9e3d31f..1bbc25b 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 _0x537a=['count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','VIRTUAL','merge','options','OpenchannelApplication','includeAll','findAll','rows','catch','show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','limit','undefined'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x537a,0x1a3));var _0xa537=function(_0x4a6491,_0x4fc1de){_0x4a6491=_0x4a6491-0x0;var _0x1edf88=_0x537a[_0x4a6491];return _0x1edf88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa537('0x0'));var zipdir=require(_0xa537('0x1'));var jsonpatch=require(_0xa537('0x2'));var rp=require(_0xa537('0x3'));var moment=require(_0xa537('0x4'));var BPromise=require(_0xa537('0x5'));var Mustache=require('mustache');var util=require(_0xa537('0x6'));var path=require(_0xa537('0x7'));var sox=require(_0xa537('0x8'));var csv=require(_0xa537('0x9'));var ejs=require(_0xa537('0xa'));var fs=require('fs');var fs_extra=require(_0xa537('0xb'));var _=require(_0xa537('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa537('0xd'));var deskjs=require(_0xa537('0xe'));var toCsv=require(_0xa537('0x9'));var querystring=require(_0xa537('0xf'));var Papa=require(_0xa537('0x10'));var Redis=require(_0xa537('0x11'));var authService=require(_0xa537('0x12'));var qs=require(_0xa537('0x13'));var as=require(_0xa537('0x14'));var hardwareService=require(_0xa537('0x15'));var logger=require(_0xa537('0x16'))(_0xa537('0x17'));var utils=require(_0xa537('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa537('0x19'));var db=require(_0xa537('0x1a'))['db'];function respondWithStatusCode(_0x12b59f,_0x31dd68){_0x31dd68=_0x31dd68||0xcc;return function(_0x2b06b1){if(_0x2b06b1){return _0x12b59f[_0xa537('0x1b')](_0x31dd68);}return _0x12b59f['status'](_0x31dd68)['end']();};}function respondWithResult(_0x541587,_0x1d10c2){_0x1d10c2=_0x1d10c2||0xc8;return function(_0x474596){if(_0x474596){return _0x541587['status'](_0x1d10c2)[_0xa537('0x1c')](_0x474596);}};}function respondWithFilteredResult(_0x440090,_0x11e7c5){return function(_0x3db95d){if(_0x3db95d){var _0x395054=typeof _0x11e7c5['offset']==='undefined'&&typeof _0x11e7c5[_0xa537('0x1d')]===_0xa537('0x1e');var _0x5959d2=_0x3db95d[_0xa537('0x1f')];var _0x196e7a=_0x395054?0x0:_0x11e7c5['offset'];var _0x4c955b=_0x395054?_0x3db95d[_0xa537('0x1f')]:_0x11e7c5[_0xa537('0x20')]+_0x11e7c5[_0xa537('0x1d')];var _0x455655;if(_0x4c955b>=_0x5959d2){_0x4c955b=_0x5959d2;_0x455655=0xc8;}else{_0x455655=0xce;}_0x440090[_0xa537('0x21')](_0x455655);return _0x440090[_0xa537('0x22')](_0xa537('0x23'),_0x196e7a+'-'+_0x4c955b+'/'+_0x5959d2)['json'](_0x3db95d);}return null;};}function patchUpdates(_0x53a6d2){return function(_0x3fcc68){try{jsonpatch[_0xa537('0x24')](_0x3fcc68,_0x53a6d2,!![]);}catch(_0x9b8861){return BPromise[_0xa537('0x25')](_0x9b8861);}return _0x3fcc68[_0xa537('0x26')]();};}function saveUpdates(_0x1389a6,_0x99b988){return function(_0x2a8f31){if(_0x2a8f31){return _0x2a8f31[_0xa537('0x27')](_0x1389a6)[_0xa537('0x28')](function(_0x194935){return _0x194935;});}return null;};}function removeEntity(_0x350be6,_0x11c081){return function(_0x40de7c){if(_0x40de7c){return _0x40de7c[_0xa537('0x29')]()[_0xa537('0x28')](function(){_0x350be6['status'](0xcc)[_0xa537('0x2a')]();});}};}function handleEntityNotFound(_0x3c7cc4,_0x3b1698){return function(_0x1f8031){if(!_0x1f8031){_0x3c7cc4[_0xa537('0x1b')](0x194);}return _0x1f8031;};}function handleError(_0x43104b,_0x5acbc4){_0x5acbc4=_0x5acbc4||0x1f4;return function(_0x1dd63a){logger['error'](_0x1dd63a['stack']);if(_0x1dd63a[_0xa537('0x2b')]){delete _0x1dd63a[_0xa537('0x2b')];}_0x43104b['status'](_0x5acbc4)[_0xa537('0x2c')](_0x1dd63a);};}exports[_0xa537('0x2d')]=function(_0x14cdc0,_0x34d5ec){var _0x253500={},_0x14a816={},_0x2032e3={'count':0x0,'rows':[]};var _0x5afbd8=_[_0xa537('0x2e')](db['OpenchannelApplication'][_0xa537('0x2f')],function(_0x476330){return{'name':_0x476330['fieldName'],'type':_0x476330['type']['key']};});_0x14a816[_0xa537('0x30')]=_['map'](_0x5afbd8,_0xa537('0x2b'));_0x14a816[_0xa537('0x31')]=_[_0xa537('0x32')](_0x14cdc0[_0xa537('0x31')]);_0x14a816[_0xa537('0x33')]=_[_0xa537('0x34')](_0x14a816[_0xa537('0x30')],_0x14a816[_0xa537('0x31')]);_0x253500[_0xa537('0x35')]=_['intersection'](_0x14a816['model'],qs[_0xa537('0x36')](_0x14cdc0['query'][_0xa537('0x36')]));_0x253500[_0xa537('0x35')]=_0x253500[_0xa537('0x35')][_0xa537('0x37')]?_0x253500['attributes']:_0x14a816['model'];if(!_0x14cdc0[_0xa537('0x31')][_0xa537('0x38')]('nolimit')){_0x253500[_0xa537('0x1d')]=qs[_0xa537('0x1d')](_0x14cdc0[_0xa537('0x31')][_0xa537('0x1d')]);_0x253500['offset']=qs[_0xa537('0x20')](_0x14cdc0['query']['offset']);}_0x253500['order']=qs['sort'](_0x14cdc0[_0xa537('0x31')][_0xa537('0x39')]);_0x253500[_0xa537('0x3a')]=qs[_0xa537('0x33')](_['pick'](_0x14cdc0[_0xa537('0x31')],_0x14a816[_0xa537('0x33')]),_0x5afbd8);if(_0x14cdc0[_0xa537('0x31')][_0xa537('0x3b')]){_0x253500[_0xa537('0x3a')]=_['merge'](_0x253500['where'],{'$or':_[_0xa537('0x2e')](_0x5afbd8,function(_0x3fcfce){if(_0x3fcfce[_0xa537('0x3c')]!==_0xa537('0x3d')){var _0x43fb67={};_0x43fb67[_0x3fcfce[_0xa537('0x2b')]]={'$like':'%'+_0x14cdc0[_0xa537('0x31')][_0xa537('0x3b')]+'%'};return _0x43fb67;}})});}_0x253500=_[_0xa537('0x3e')]({},_0x253500,_0x14cdc0[_0xa537('0x3f')]);var _0x116184={'where':_0x253500[_0xa537('0x3a')]};return db[_0xa537('0x40')]['count'](_0x116184)[_0xa537('0x28')](function(_0x27fdbc){_0x2032e3[_0xa537('0x1f')]=_0x27fdbc;if(_0x14cdc0[_0xa537('0x31')][_0xa537('0x41')]){_0x253500['include']=[{'all':!![]}];}return db[_0xa537('0x40')][_0xa537('0x42')](_0x253500);})['then'](function(_0x30cf39){_0x2032e3[_0xa537('0x43')]=_0x30cf39;return _0x2032e3;})[_0xa537('0x28')](respondWithFilteredResult(_0x34d5ec,_0x253500))[_0xa537('0x44')](handleError(_0x34d5ec,null));};exports[_0xa537('0x45')]=function(_0x56069e,_0x3bbcb0){var _0xa4763e={'raw':!![],'where':{'id':_0x56069e[_0xa537('0x46')]['id']}},_0x24fbdc={};_0x24fbdc[_0xa537('0x30')]=_[_0xa537('0x32')](db[_0xa537('0x40')][_0xa537('0x2f')]);_0x24fbdc[_0xa537('0x31')]=_['keys'](_0x56069e['query']);_0x24fbdc[_0xa537('0x33')]=_[_0xa537('0x34')](_0x24fbdc[_0xa537('0x30')],_0x24fbdc[_0xa537('0x31')]);_0xa4763e[_0xa537('0x35')]=_[_0xa537('0x34')](_0x24fbdc[_0xa537('0x30')],qs[_0xa537('0x36')](_0x56069e['query']['fields']));_0xa4763e[_0xa537('0x35')]=_0xa4763e[_0xa537('0x35')]['length']?_0xa4763e[_0xa537('0x35')]:_0x24fbdc['model'];if(_0x56069e[_0xa537('0x31')][_0xa537('0x41')]){_0xa4763e[_0xa537('0x47')]=[{'all':!![]}];}_0xa4763e=_[_0xa537('0x3e')]({},_0xa4763e,_0x56069e[_0xa537('0x3f')]);return db[_0xa537('0x40')][_0xa537('0x48')](_0xa4763e)['then'](handleEntityNotFound(_0x3bbcb0,null))[_0xa537('0x28')](respondWithResult(_0x3bbcb0,null))[_0xa537('0x44')](handleError(_0x3bbcb0,null));};exports[_0xa537('0x49')]=function(_0x6b5354,_0x106c99){return db[_0xa537('0x40')][_0xa537('0x49')](_0x6b5354[_0xa537('0x4a')],{})[_0xa537('0x28')](respondWithResult(_0x106c99,0xc9))['catch'](handleError(_0x106c99,null));};exports['update']=function(_0x3d541e,_0x4ef067){if(_0x3d541e[_0xa537('0x4a')]['id']){delete _0x3d541e[_0xa537('0x4a')]['id'];}return db[_0xa537('0x40')]['find']({'where':{'id':_0x3d541e[_0xa537('0x46')]['id']}})[_0xa537('0x28')](handleEntityNotFound(_0x4ef067,null))[_0xa537('0x28')](saveUpdates(_0x3d541e[_0xa537('0x4a')],null))['then'](respondWithResult(_0x4ef067,null))[_0xa537('0x44')](handleError(_0x4ef067,null));};exports[_0xa537('0x29')]=function(_0x1b70b6,_0x1ad9ea){return db[_0xa537('0x40')][_0xa537('0x48')]({'where':{'id':_0x1b70b6[_0xa537('0x46')]['id']}})[_0xa537('0x28')](handleEntityNotFound(_0x1ad9ea,null))[_0xa537('0x28')](removeEntity(_0x1ad9ea,null))[_0xa537('0x44')](handleError(_0x1ad9ea,null));}; \ No newline at end of file +var _0x1483=['end','json','offset','limit','undefined','count','set','save','update','destroy','then','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','body','rimraf','bluebird','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2cc574,_0x1ac872){var _0xdd47d1=function(_0x53c2ab){while(--_0x53c2ab){_0x2cc574['push'](_0x2cc574['shift']());}};_0xdd47d1(++_0x1ac872);}(_0x1483,0x1d9));var _0x3148=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0x1483[_0x146be0];return _0x1bcc25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3148('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3148('0x1'));var Mustache=require('mustache');var util=require(_0x3148('0x2'));var path=require(_0x3148('0x3'));var sox=require(_0x3148('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3148('0x5'));var _=require(_0x3148('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3148('0x7'));var deskjs=require(_0x3148('0x8'));var toCsv=require(_0x3148('0x9'));var querystring=require('querystring');var Papa=require(_0x3148('0xa'));var Redis=require(_0x3148('0xb'));var authService=require(_0x3148('0xc'));var qs=require(_0x3148('0xd'));var as=require(_0x3148('0xe'));var hardwareService=require(_0x3148('0xf'));var logger=require(_0x3148('0x10'))(_0x3148('0x11'));var utils=require(_0x3148('0x12'));var config=require(_0x3148('0x13'));var licenseUtil=require(_0x3148('0x14'));var db=require(_0x3148('0x15'))['db'];function respondWithStatusCode(_0x2c68b1,_0x67d6f5){_0x67d6f5=_0x67d6f5||0xcc;return function(_0x2dd61b){if(_0x2dd61b){return _0x2c68b1[_0x3148('0x16')](_0x67d6f5);}return _0x2c68b1[_0x3148('0x17')](_0x67d6f5)[_0x3148('0x18')]();};}function respondWithResult(_0x36d7f9,_0x5769c5){_0x5769c5=_0x5769c5||0xc8;return function(_0x147ba8){if(_0x147ba8){return _0x36d7f9[_0x3148('0x17')](_0x5769c5)[_0x3148('0x19')](_0x147ba8);}};}function respondWithFilteredResult(_0x530dd3,_0x23b91d){return function(_0x50ee37){if(_0x50ee37){var _0x410a1d=typeof _0x23b91d[_0x3148('0x1a')]==='undefined'&&typeof _0x23b91d[_0x3148('0x1b')]===_0x3148('0x1c');var _0x53a23e=_0x50ee37[_0x3148('0x1d')];var _0x15b3a9=_0x410a1d?0x0:_0x23b91d['offset'];var _0x4d222a=_0x410a1d?_0x50ee37[_0x3148('0x1d')]:_0x23b91d[_0x3148('0x1a')]+_0x23b91d[_0x3148('0x1b')];var _0x19d362;if(_0x4d222a>=_0x53a23e){_0x4d222a=_0x53a23e;_0x19d362=0xc8;}else{_0x19d362=0xce;}_0x530dd3['status'](_0x19d362);return _0x530dd3[_0x3148('0x1e')]('Content-Range',_0x15b3a9+'-'+_0x4d222a+'/'+_0x53a23e)[_0x3148('0x19')](_0x50ee37);}return null;};}function patchUpdates(_0x1d0754){return function(_0x39994f){try{jsonpatch['apply'](_0x39994f,_0x1d0754,!![]);}catch(_0x31fc5f){return BPromise['reject'](_0x31fc5f);}return _0x39994f[_0x3148('0x1f')]();};}function saveUpdates(_0x275326,_0x2ed920){return function(_0x3013fd){if(_0x3013fd){return _0x3013fd[_0x3148('0x20')](_0x275326)['then'](function(_0xc9ea7b){return _0xc9ea7b;});}return null;};}function removeEntity(_0x192e0b,_0x3a4598){return function(_0x3fa60b){if(_0x3fa60b){return _0x3fa60b[_0x3148('0x21')]()[_0x3148('0x22')](function(){_0x192e0b['status'](0xcc)[_0x3148('0x18')]();});}};}function handleEntityNotFound(_0x5d16b9,_0x3208fb){return function(_0x148173){if(!_0x148173){_0x5d16b9[_0x3148('0x16')](0x194);}return _0x148173;};}function handleError(_0x4a8074,_0x264f3d){_0x264f3d=_0x264f3d||0x1f4;return function(_0x298707){logger[_0x3148('0x23')](_0x298707[_0x3148('0x24')]);if(_0x298707[_0x3148('0x25')]){delete _0x298707['name'];}_0x4a8074['status'](_0x264f3d)[_0x3148('0x26')](_0x298707);};}exports['index']=function(_0x13e9e0,_0x259807){var _0x5a328e={},_0x4b1ca9={},_0x6de361={'count':0x0,'rows':[]};var _0x2de64a=_[_0x3148('0x27')](db[_0x3148('0x28')][_0x3148('0x29')],function(_0x292292){return{'name':_0x292292[_0x3148('0x2a')],'type':_0x292292[_0x3148('0x2b')][_0x3148('0x2c')]};});_0x4b1ca9['model']=_[_0x3148('0x27')](_0x2de64a,'name');_0x4b1ca9[_0x3148('0x2d')]=_['keys'](_0x13e9e0['query']);_0x4b1ca9['filters']=_[_0x3148('0x2e')](_0x4b1ca9[_0x3148('0x2f')],_0x4b1ca9[_0x3148('0x2d')]);_0x5a328e[_0x3148('0x30')]=_[_0x3148('0x2e')](_0x4b1ca9[_0x3148('0x2f')],qs[_0x3148('0x31')](_0x13e9e0[_0x3148('0x2d')]['fields']));_0x5a328e[_0x3148('0x30')]=_0x5a328e[_0x3148('0x30')][_0x3148('0x32')]?_0x5a328e[_0x3148('0x30')]:_0x4b1ca9[_0x3148('0x2f')];if(!_0x13e9e0[_0x3148('0x2d')][_0x3148('0x33')](_0x3148('0x34'))){_0x5a328e['limit']=qs[_0x3148('0x1b')](_0x13e9e0[_0x3148('0x2d')][_0x3148('0x1b')]);_0x5a328e[_0x3148('0x1a')]=qs[_0x3148('0x1a')](_0x13e9e0[_0x3148('0x2d')][_0x3148('0x1a')]);}_0x5a328e['order']=qs[_0x3148('0x35')](_0x13e9e0['query'][_0x3148('0x35')]);_0x5a328e[_0x3148('0x36')]=qs[_0x3148('0x37')](_[_0x3148('0x38')](_0x13e9e0[_0x3148('0x2d')],_0x4b1ca9[_0x3148('0x37')]),_0x2de64a);if(_0x13e9e0[_0x3148('0x2d')][_0x3148('0x39')]){_0x5a328e[_0x3148('0x36')]=_[_0x3148('0x3a')](_0x5a328e[_0x3148('0x36')],{'$or':_['map'](_0x2de64a,function(_0x110e90){if(_0x110e90['type']!==_0x3148('0x3b')){var _0x50c088={};_0x50c088[_0x110e90[_0x3148('0x25')]]={'$like':'%'+_0x13e9e0['query'][_0x3148('0x39')]+'%'};return _0x50c088;}})});}_0x5a328e=_[_0x3148('0x3a')]({},_0x5a328e,_0x13e9e0[_0x3148('0x3c')]);var _0x44cb55={'where':_0x5a328e['where']};return db[_0x3148('0x28')]['count'](_0x44cb55)[_0x3148('0x22')](function(_0x1a3dbf){_0x6de361[_0x3148('0x1d')]=_0x1a3dbf;if(_0x13e9e0[_0x3148('0x2d')][_0x3148('0x3d')]){_0x5a328e['include']=[{'all':!![]}];}return db[_0x3148('0x28')][_0x3148('0x3e')](_0x5a328e);})[_0x3148('0x22')](function(_0x169172){_0x6de361[_0x3148('0x3f')]=_0x169172;return _0x6de361;})[_0x3148('0x22')](respondWithFilteredResult(_0x259807,_0x5a328e))[_0x3148('0x40')](handleError(_0x259807,null));};exports[_0x3148('0x41')]=function(_0x963c45,_0x588895){var _0xfacce2={'raw':!![],'where':{'id':_0x963c45[_0x3148('0x42')]['id']}},_0x42684f={};_0x42684f[_0x3148('0x2f')]=_['keys'](db[_0x3148('0x28')][_0x3148('0x29')]);_0x42684f['query']=_[_0x3148('0x43')](_0x963c45[_0x3148('0x2d')]);_0x42684f[_0x3148('0x37')]=_[_0x3148('0x2e')](_0x42684f['model'],_0x42684f[_0x3148('0x2d')]);_0xfacce2['attributes']=_[_0x3148('0x2e')](_0x42684f[_0x3148('0x2f')],qs['fields'](_0x963c45[_0x3148('0x2d')][_0x3148('0x31')]));_0xfacce2['attributes']=_0xfacce2[_0x3148('0x30')][_0x3148('0x32')]?_0xfacce2['attributes']:_0x42684f[_0x3148('0x2f')];if(_0x963c45[_0x3148('0x2d')][_0x3148('0x3d')]){_0xfacce2[_0x3148('0x44')]=[{'all':!![]}];}_0xfacce2=_['merge']({},_0xfacce2,_0x963c45[_0x3148('0x3c')]);return db['OpenchannelApplication'][_0x3148('0x45')](_0xfacce2)[_0x3148('0x22')](handleEntityNotFound(_0x588895,null))[_0x3148('0x22')](respondWithResult(_0x588895,null))['catch'](handleError(_0x588895,null));};exports['create']=function(_0xff6c42,_0x20cdee){return db[_0x3148('0x28')]['create'](_0xff6c42[_0x3148('0x46')],{})[_0x3148('0x22')](respondWithResult(_0x20cdee,0xc9))[_0x3148('0x40')](handleError(_0x20cdee,null));};exports[_0x3148('0x20')]=function(_0x42bae6,_0x7721e9){if(_0x42bae6[_0x3148('0x46')]['id']){delete _0x42bae6['body']['id'];}return db[_0x3148('0x28')][_0x3148('0x45')]({'where':{'id':_0x42bae6['params']['id']}})['then'](handleEntityNotFound(_0x7721e9,null))['then'](saveUpdates(_0x42bae6[_0x3148('0x46')],null))['then'](respondWithResult(_0x7721e9,null))['catch'](handleError(_0x7721e9,null));};exports[_0x3148('0x21')]=function(_0x53e8cb,_0x32130b){return db['OpenchannelApplication'][_0x3148('0x45')]({'where':{'id':_0x53e8cb['params']['id']}})[_0x3148('0x22')](handleEntityNotFound(_0x32130b,null))[_0x3148('0x22')](removeEntity(_0x32130b,null))[_0x3148('0x40')](handleError(_0x32130b,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c294d0f..746280c 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 _0xdda2=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2b9c8e,_0x481857){var _0x3e6953=function(_0x3a3dda){while(--_0x3a3dda){_0x2b9c8e['push'](_0x2b9c8e['shift']());}};_0x3e6953(++_0x481857);}(_0xdda2,0x106));var _0x2dda=function(_0x295b80,_0x3bf87d){_0x295b80=_0x295b80-0x0;var _0xfc29b6=_0xdda2[_0x295b80];return _0xfc29b6;};'use strict';var _=require('lodash');var util=require(_0x2dda('0x0'));var logger=require(_0x2dda('0x1'))(_0x2dda('0x2'));var moment=require(_0x2dda('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2dda('0x4'));var rimraf=require(_0x2dda('0x5'));var config=require(_0x2dda('0x6'));var attributes=require(_0x2dda('0x7'));module[_0x2dda('0x8')]=function(_0x477894,_0x5eeb16){return _0x477894[_0x2dda('0x9')](_0x2dda('0xa'),attributes,{'tableName':_0x2dda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dda('0xc'),'collate':_0x2dda('0xd')});}; \ No newline at end of file +var _0xc0c3=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5a68a8,_0x2289c3){var _0x417b35=function(_0x2e5ece){while(--_0x2e5ece){_0x5a68a8['push'](_0x5a68a8['shift']());}};_0x417b35(++_0x2289c3);}(_0xc0c3,0x191));var _0x3c0c=function(_0x2d8661,_0x4f3477){_0x2d8661=_0x2d8661-0x0;var _0x59b4a0=_0xc0c3[_0x2d8661];return _0x59b4a0;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var logger=require(_0x3c0c('0x2'))(_0x3c0c('0x3'));var moment=require('moment');var BPromise=require(_0x3c0c('0x4'));var rp=require(_0x3c0c('0x5'));var fs=require('fs');var path=require(_0x3c0c('0x6'));var rimraf=require(_0x3c0c('0x7'));var config=require(_0x3c0c('0x8'));var attributes=require(_0x3c0c('0x9'));module[_0x3c0c('0xa')]=function(_0x472c25,_0x2e9276){return _0x472c25[_0x3c0c('0xb')]('OpenchannelApplication',attributes,{'tableName':_0x3c0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c0c('0xd'),'collate':_0x3c0c('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 00aff28..45948dd 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 _0x195f=['raw','where','limit','UpdateOpenchannelApplication','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','OpenchannelApplication','body','options'];(function(_0x64b974,_0x3de08c){var _0x65eb42=function(_0x5200b2){while(--_0x5200b2){_0x64b974['push'](_0x64b974['shift']());}};_0x65eb42(++_0x3de08c);}(_0x195f,0x113));var _0xf195=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x195f[_0x576d8a];return _0x3dc3ef;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var moment=require('moment');var BPromise=require(_0xf195('0x2'));var rs=require(_0xf195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf195('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf195('0x5'))(_0xf195('0x6'));var config=require(_0xf195('0x7'));var jayson=require(_0xf195('0x8'));var client=jayson[_0xf195('0x9')][_0xf195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2770db,_0x59d783,_0x5eac33){return new BPromise(function(_0x327cc3,_0x15d465){return client[_0xf195('0xb')](_0x2770db,_0x5eac33)[_0xf195('0xc')](function(_0x7b3e6f){logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,'request\x20sent');logger[_0xf195('0xf')](_0xf195('0x10'),_0x59d783,_0xf195('0x11'),JSON['stringify'](_0x7b3e6f));if(_0x7b3e6f[_0xf195('0x12')]){if(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x13')]===0x1f4){logger[_0xf195('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x15d465(_0x7b3e6f['error'][_0xf195('0x14')]);}logger['error'](_0xf195('0xe'),_0x59d783,_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);return _0x327cc3(_0x7b3e6f[_0xf195('0x12')][_0xf195('0x14')]);}else{logger[_0xf195('0xd')](_0xf195('0xe'),_0x59d783,_0xf195('0x11'));_0x327cc3(_0x7b3e6f['result']['message']);}})[_0xf195('0x15')](function(_0x3ad05f){logger[_0xf195('0x12')](_0xf195('0xe'),_0x59d783,_0x3ad05f);_0x15d465(_0x3ad05f);});});}exports['UpdateOpenchannelApplication']=function(_0x374fc6){var _0x1ae33e=this;return new Promise(function(_0x5cf7dc,_0x452931){return db[_0xf195('0x16')]['update'](_0x374fc6[_0xf195('0x17')],{'raw':_0x374fc6[_0xf195('0x18')]?_0x374fc6['options'][_0xf195('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374fc6[_0xf195('0x18')]?_0x374fc6[_0xf195('0x18')][_0xf195('0x1a')]||null:null,'attributes':_0x374fc6['options']?_0x374fc6['options']['attributes']||null:null,'limit':_0x374fc6[_0xf195('0x18')]?_0x374fc6[_0xf195('0x18')][_0xf195('0x1b')]||null:null})[_0xf195('0xc')](function(_0x1c72f5){logger[_0xf195('0xd')](_0xf195('0x1c'),_0x374fc6);logger[_0xf195('0xf')](_0xf195('0x1c'),_0x374fc6,JSON[_0xf195('0x1d')](_0x1c72f5));_0x5cf7dc(_0x1c72f5);})[_0xf195('0x15')](function(_0x1481ae){logger['error'](_0xf195('0x1c'),_0x1481ae[_0xf195('0x14')],_0x374fc6);_0x452931(_0x1ae33e[_0xf195('0x12')](0x1f4,_0x1481ae[_0xf195('0x14')]));});});}; \ No newline at end of file +var _0xa43c=['info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0xa43c,0x157));var _0xca43=function(_0x2a8f39,_0x4c8d3b){_0x2a8f39=_0x2a8f39-0x0;var _0x35b6a6=_0xa43c[_0x2a8f39];return _0x35b6a6;};'use strict';var _=require(_0xca43('0x0'));var util=require(_0xca43('0x1'));var moment=require(_0xca43('0x2'));var BPromise=require(_0xca43('0x3'));var rs=require(_0xca43('0x4'));var fs=require('fs');var Redis=require(_0xca43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca43('0x6'));var logger=require(_0xca43('0x7'))(_0xca43('0x8'));var config=require(_0xca43('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xca43('0xa')][_0xca43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc0e224,_0x5549d7,_0x2b6c9b){return new BPromise(function(_0x46f437,_0x1486a8){return client[_0xca43('0xc')](_0xc0e224,_0x2b6c9b)[_0xca43('0xd')](function(_0x2201be){logger['info'](_0xca43('0xe'),_0x5549d7,_0xca43('0xf'));logger[_0xca43('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5549d7,_0xca43('0xf'),JSON['stringify'](_0x2201be));if(_0x2201be['error']){if(_0x2201be[_0xca43('0x11')][_0xca43('0x12')]===0x1f4){logger[_0xca43('0x11')](_0xca43('0xe'),_0x5549d7,_0x2201be['error'][_0xca43('0x13')]);return _0x1486a8(_0x2201be[_0xca43('0x11')][_0xca43('0x13')]);}logger[_0xca43('0x11')](_0xca43('0xe'),_0x5549d7,_0x2201be['error']['message']);return _0x46f437(_0x2201be['error']['message']);}else{logger[_0xca43('0x14')](_0xca43('0xe'),_0x5549d7,_0xca43('0xf'));_0x46f437(_0x2201be[_0xca43('0x15')][_0xca43('0x13')]);}})[_0xca43('0x16')](function(_0x4d1aa1){logger[_0xca43('0x11')](_0xca43('0xe'),_0x5549d7,_0x4d1aa1);_0x1486a8(_0x4d1aa1);});});}exports[_0xca43('0x17')]=function(_0x21e0cb){var _0x392631=this;return new Promise(function(_0x155694,_0x9cbf30){return db[_0xca43('0x18')][_0xca43('0x19')](_0x21e0cb[_0xca43('0x1a')],{'raw':_0x21e0cb['options']?_0x21e0cb[_0xca43('0x1b')][_0xca43('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21e0cb[_0xca43('0x1b')]?_0x21e0cb['options'][_0xca43('0x1d')]||null:null,'attributes':_0x21e0cb[_0xca43('0x1b')]?_0x21e0cb[_0xca43('0x1b')][_0xca43('0x1e')]||null:null,'limit':_0x21e0cb[_0xca43('0x1b')]?_0x21e0cb[_0xca43('0x1b')][_0xca43('0x1f')]||null:null})[_0xca43('0xd')](function(_0x47a665){logger[_0xca43('0x14')](_0xca43('0x17'),_0x21e0cb);logger[_0xca43('0x10')](_0xca43('0x17'),_0x21e0cb,JSON[_0xca43('0x20')](_0x47a665));_0x155694(_0x47a665);})[_0xca43('0x16')](function(_0x750936){logger[_0xca43('0x11')]('UpdateOpenchannelApplication',_0x750936['message'],_0x21e0cb);_0x9cbf30(_0x392631[_0xca43('0x11')](0x1f4,_0x750936[_0xca43('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e758e58..8ea6b0a 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 _0x8fe6=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','addTags','put','/:id','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x5f1351,_0x27cf33){var _0x322b44=function(_0x404599){while(--_0x404599){_0x5f1351['push'](_0x5f1351['shift']());}};_0x322b44(++_0x27cf33);}(_0x8fe6,0x14f));var _0x68fe=function(_0x4f3cd1,_0x4b666e){_0x4f3cd1=_0x4f3cd1-0x0;var _0x4f304d=_0x8fe6[_0x4f3cd1];return _0x4f304d;};'use strict';var multer=require(_0x68fe('0x0'));var util=require(_0x68fe('0x1'));var path=require(_0x68fe('0x2'));var timeout=require(_0x68fe('0x3'));var express=require(_0x68fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x68fe('0x5'));var config=require(_0x68fe('0x6'));var controller=require(_0x68fe('0x7'));router[_0x68fe('0x8')]('/',auth[_0x68fe('0x9')](),controller[_0x68fe('0xa')]);router[_0x68fe('0x8')](_0x68fe('0xb'),auth[_0x68fe('0x9')](),controller[_0x68fe('0xc')]);router[_0x68fe('0x8')]('/:id',auth[_0x68fe('0x9')](),controller[_0x68fe('0xd')]);router[_0x68fe('0x8')](_0x68fe('0xe'),auth[_0x68fe('0x9')](),controller[_0x68fe('0xf')]);router['get'](_0x68fe('0x10'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x11')]);router[_0x68fe('0x12')]('/',auth[_0x68fe('0x9')](),controller['create']);router[_0x68fe('0x12')](_0x68fe('0xe'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x13')]);router[_0x68fe('0x12')](_0x68fe('0x14'),auth[_0x68fe('0x9')](),interaction[_0x68fe('0x15')](_0x68fe('0x16'),'openchannelinteraction:addtags'),controller[_0x68fe('0x17')]);router[_0x68fe('0x18')](_0x68fe('0x19'),auth[_0x68fe('0x9')](),interaction[_0x68fe('0x15')]('openchannel','openchannelinteraction:update'),controller[_0x68fe('0x1a')]);router[_0x68fe('0x1b')]('/:id',auth[_0x68fe('0x9')](),interaction[_0x68fe('0x15')](_0x68fe('0x16'),_0x68fe('0x1c')),controller[_0x68fe('0x1d')]);router[_0x68fe('0x1b')](_0x68fe('0x14'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x0997=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','show','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x0997,0x1b4));var _0x7099=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0997[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7099('0x0'));var util=require(_0x7099('0x1'));var path=require('path');var timeout=require(_0x7099('0x2'));var express=require(_0x7099('0x3'));var router=express[_0x7099('0x4')]();var fs_extra=require(_0x7099('0x5'));var auth=require(_0x7099('0x6'));var interaction=require(_0x7099('0x7'));var config=require('../../config/environment');var controller=require(_0x7099('0x8'));router[_0x7099('0x9')]('/',auth[_0x7099('0xa')](),controller['index']);router[_0x7099('0x9')](_0x7099('0xb'),auth[_0x7099('0xa')](),controller[_0x7099('0xc')]);router[_0x7099('0x9')]('/:id',auth[_0x7099('0xa')](),controller[_0x7099('0xd')]);router['get']('/:id/messages',auth[_0x7099('0xa')](),controller[_0x7099('0xe')]);router['get']('/:id/download',auth[_0x7099('0xa')](),controller[_0x7099('0xf')]);router[_0x7099('0x10')]('/',auth[_0x7099('0xa')](),controller[_0x7099('0x11')]);router[_0x7099('0x10')]('/:id/messages',auth[_0x7099('0xa')](),controller[_0x7099('0x12')]);router['post'](_0x7099('0x13'),auth[_0x7099('0xa')](),interaction[_0x7099('0x14')](_0x7099('0x15'),'openchannelinteraction:addtags'),controller['addTags']);router[_0x7099('0x16')]('/:id',auth[_0x7099('0xa')](),interaction[_0x7099('0x14')](_0x7099('0x15'),_0x7099('0x17')),controller['update']);router[_0x7099('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x7099('0x14')](_0x7099('0x15'),_0x7099('0x19')),controller[_0x7099('0x1a')]);router[_0x7099('0x18')](_0x7099('0x13'),auth[_0x7099('0xa')](),controller[_0x7099('0x1b')]);module[_0x7099('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 020b388..f2a1d49 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 _0xca66=['BOOLEAN','sequelize','DATE','STRING','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca66,0x8b));var _0x6ca6=function(_0x17dd6e,_0x343e73){_0x17dd6e=_0x17dd6e-0x0;var _0x37693a=_0xca66[_0x17dd6e];return _0x37693a;};'use strict';var Sequelize=require(_0x6ca6('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6ca6('0x1')]},'disposition':{'type':Sequelize[_0x6ca6('0x2')]},'secondDisposition':{'type':Sequelize[_0x6ca6('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6ca6('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6ca6('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6ca6('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x6ca6('0x3')]('in',_0x6ca6('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6ca6('0x3')]('in',_0x6ca6('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6ca6('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x6ca6('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x22fb=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x30dfa4,_0x1a6275){var _0x185b37=function(_0x1a8025){while(--_0x1a8025){_0x30dfa4['push'](_0x30dfa4['shift']());}};_0x185b37(++_0x1a6275);}(_0x22fb,0x192));var _0xb22f=function(_0x5a3c60,_0x21e396){_0x5a3c60=_0x5a3c60-0x0;var _0x1afa4f=_0x22fb[_0x5a3c60];return _0x1afa4f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb22f('0x1')]},'secondDisposition':{'type':Sequelize[_0xb22f('0x1')]},'thirdDisposition':{'type':Sequelize[_0xb22f('0x1')]},'note':{'type':Sequelize[_0xb22f('0x1')]},'read1stAt':{'type':Sequelize[_0xb22f('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb22f('0x1')]},'lastMsgAt':{'type':Sequelize[_0xb22f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xb22f('0x3')]('in',_0xb22f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xb22f('0x3')]('in',_0xb22f('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 46bd408..2747821 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 _0x2550=['Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','show','params','OpenchannelInteraction','merge','options','catch','create','describe','OpenchannelMessage','addMessage','omit','ids','getMessages','findOne','nolimit','OpenchannelInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','format','transcript-%d-%s.zip','fullname','CmContact','attachments','Attachment','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','Messages','existsSync','createReadStream','createWriteStream','basename','out','System','Contact','firstName','lastName','direction','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','end','name','send','Users','TagIds','Tags','split','push','waiting','answered','unmanaged','closed','UserId','talking','total','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','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','search','parseSearch','conditions','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)','getFullTextValue','find','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','keys','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','count','keyBy','fields','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email'];(function(_0x3192c1,_0x3cdf2c){var _0x22e4ce=function(_0x57495f){while(--_0x57495f){_0x3192c1['push'](_0x3192c1['shift']());}};_0x22e4ce(++_0x3cdf2c);}(_0x2550,0x144));var _0x0255=function(_0x9a71bf,_0xb173d){_0x9a71bf=_0x9a71bf-0x0;var _0x5f2da3=_0x2550[_0x9a71bf];return _0x5f2da3;};'use strict';var emlformat=require(_0x0255('0x0'));var rimraf=require(_0x0255('0x1'));var zipdir=require(_0x0255('0x2'));var jsonpatch=require(_0x0255('0x3'));var rp=require(_0x0255('0x4'));var moment=require(_0x0255('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0255('0x6'));var path=require(_0x0255('0x7'));var sox=require(_0x0255('0x8'));var csv=require(_0x0255('0x9'));var ejs=require(_0x0255('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0255('0xb'));var crypto=require('crypto');var jsforce=require(_0x0255('0xc'));var deskjs=require(_0x0255('0xd'));var toCsv=require(_0x0255('0x9'));var querystring=require(_0x0255('0xe'));var Papa=require(_0x0255('0xf'));var Redis=require(_0x0255('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0255('0x11'));var pdf=require(_0x0255('0x12'));var hardwareService=require(_0x0255('0x13'));var logger=require(_0x0255('0x14'))('api');var utils=require(_0x0255('0x15'));var config=require(_0x0255('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0255('0x17'))['db'];config['redis']=_[_0x0255('0x18')](config['redis'],{'host':_0x0255('0x19'),'port':0x18eb});var socket=require(_0x0255('0x1a'))(new Redis(config[_0x0255('0x1b')]));require(_0x0255('0x1c'))[_0x0255('0x1d')](socket);function respondWithStatusCode(_0x2df8af,_0x845b9b){_0x845b9b=_0x845b9b||0xcc;return function(_0x1ebb7f){if(_0x1ebb7f){return _0x2df8af[_0x0255('0x1e')](_0x845b9b);}return _0x2df8af[_0x0255('0x1f')](_0x845b9b)['end']();};}function respondWithResult(_0x43a984,_0x4bae1b){_0x4bae1b=_0x4bae1b||0xc8;return function(_0x5d9bf8){if(_0x5d9bf8){return _0x43a984[_0x0255('0x1f')](_0x4bae1b)[_0x0255('0x20')](_0x5d9bf8);}};}function respondWithFilteredResult(_0x49c21b,_0x16baad){return function(_0x82f0d1){if(_0x82f0d1){var _0x323727=typeof _0x16baad[_0x0255('0x21')]==='undefined'&&typeof _0x16baad[_0x0255('0x22')]===_0x0255('0x23');var _0x594ea5=_0x82f0d1['count'];var _0x14bc7b=_0x323727?0x0:_0x16baad[_0x0255('0x21')];var _0x598021=_0x323727?_0x82f0d1['count']:_0x16baad[_0x0255('0x21')]+_0x16baad[_0x0255('0x22')];var _0x2ae769;if(_0x598021>=_0x594ea5){_0x598021=_0x594ea5;_0x2ae769=0xc8;}else{_0x2ae769=0xce;}_0x49c21b[_0x0255('0x1f')](_0x2ae769);return _0x49c21b[_0x0255('0x24')](_0x0255('0x25'),_0x14bc7b+'-'+_0x598021+'/'+_0x594ea5)[_0x0255('0x20')](_0x82f0d1);}return null;};}function patchUpdates(_0x469c64){return function(_0x5539b3){try{jsonpatch[_0x0255('0x26')](_0x5539b3,_0x469c64,!![]);}catch(_0x30fadb){return BPromise[_0x0255('0x27')](_0x30fadb);}return _0x5539b3[_0x0255('0x28')]();};}function saveUpdates(_0x427cd8,_0x58de7f){return function(_0x41f3a6){if(_0x41f3a6){return _0x41f3a6[_0x0255('0x29')](_0x427cd8)[_0x0255('0x2a')](function(_0xd0806a){return _0xd0806a;});}return null;};}function removeEntity(_0x25216d,_0x4dd065){return function(_0x431296){if(_0x431296){return _0x431296['destroy']()['then'](function(){_0x25216d[_0x0255('0x1f')](0xcc)[_0x0255('0x2b')]();});}};}function handleEntityNotFound(_0x4cfcf7,_0x3ca799){return function(_0x23cf31){if(!_0x23cf31){_0x4cfcf7[_0x0255('0x1e')](0x194);}return _0x23cf31;};}function handleError(_0x3cb603,_0x1b135b){_0x1b135b=_0x1b135b||0x1f4;return function(_0xe2dd0b){logger['error'](_0xe2dd0b['stack']);if(_0xe2dd0b['name']){delete _0xe2dd0b[_0x0255('0x2c')];}_0x3cb603['status'](_0x1b135b)[_0x0255('0x2d')](_0xe2dd0b);};}function getInteractionUsers(_0x41aa86,_0xff2f91){return new BPromise(function(_0x24f2ac,_0x34000c){try{if(_0xff2f91[_0x41aa86['id']]){_0x41aa86[_0x0255('0x2e')]=_['map'](_0xff2f91[_0x41aa86['id']],function(_0x5e6d9a){return{'id':_0x5e6d9a['id'],'fullname':_0x5e6d9a['fullname']};});}}catch(_0x18ae39){_0x34000c(_0x18ae39);}_0x24f2ac(_0x41aa86);});}function getInteractionTags(_0x1bc31e,_0x369d24){return new BPromise(function(_0x316955,_0x1de6f3){try{if(_0x1bc31e[_0x0255('0x2f')]){_0x1bc31e[_0x0255('0x30')]=[];_0x1bc31e['TagIds'][_0x0255('0x31')](',')['forEach'](function(_0x4b04fd){_0x1bc31e[_0x0255('0x30')][_0x0255('0x32')](_0x369d24[_0x4b04fd]);});}delete _0x1bc31e[_0x0255('0x2f')];}catch(_0x476507){_0x1de6f3(_0x476507);}_0x316955(_0x1bc31e);});}function updateOpenchannelInteraction(_0x354940,_0x527d4e,_0x1cfd66){return new BPromise(function(_0x1b891d,_0xd08cb1){return getInteractionUsers(_0x354940,_0x1cfd66)['then'](function(_0x4bbd7e){return getInteractionTags(_0x4bbd7e,_0x527d4e);})[_0x0255('0x2a')](function(_0x373df4){return getStateInteraction(_0x373df4);})[_0x0255('0x2a')](function(_0x3c6623){_0x1b891d(_0x3c6623);})['catch'](function(_0x2915c3){_0xd08cb1(_0x2915c3);});});}function getStateInteraction(_0x2c31c4){return new BPromise(function(_0x499359){_0x2c31c4[_0x0255('0x33')]=0x0;_0x2c31c4['talking']=0x0;_0x2c31c4[_0x0255('0x34')]=0x0;_0x2c31c4[_0x0255('0x35')]=0x0;_0x2c31c4['total']=0x0;if(!_0x2c31c4[_0x0255('0x36')]&&!_0x2c31c4['UserId']){_0x2c31c4[_0x0255('0x33')]+=0x1;}if(!_0x2c31c4[_0x0255('0x36')]&&_0x2c31c4['UserId']){_0x2c31c4['talking']+=0x1;if(_0x2c31c4['waiting']){_0x2c31c4['waiting']-=0x1;}}if(_0x2c31c4[_0x0255('0x36')]&&_0x2c31c4[_0x0255('0x37')]){_0x2c31c4[_0x0255('0x34')]+=0x1;if(_0x2c31c4['talking']){_0x2c31c4[_0x0255('0x38')]-=0x1;}}if(_0x2c31c4[_0x0255('0x36')]&&!_0x2c31c4[_0x0255('0x37')]){_0x2c31c4[_0x0255('0x35')]+=0x1;if(_0x2c31c4[_0x0255('0x33')]){_0x2c31c4[_0x0255('0x33')]-=0x1;}}_0x2c31c4[_0x0255('0x39')]+=0x1;_0x499359(_0x2c31c4);});}exports[_0x0255('0x3a')]=function(_0x48e462,_0x208f28){var _0x8a4ee9={},_0x5d9032={},_0x33e959={'count':0x0,'rows':[]};var _0x21884b=_[_0x0255('0x3b')](db['OpenchannelInteraction'][_0x0255('0x3c')],function(_0x32e430){return{'name':_0x32e430[_0x0255('0x3d')],'type':_0x32e430[_0x0255('0x3e')][_0x0255('0x3f')]};});_0x5d9032[_0x0255('0x40')]=_['map'](_0x21884b,'name');_0x5d9032[_0x0255('0x41')]=_['keys'](_0x48e462[_0x0255('0x41')]);_0x5d9032['filters']=_['intersection'](_0x5d9032['model'],_0x5d9032[_0x0255('0x41')]);_0x8a4ee9[_0x0255('0x42')]=_[_0x0255('0x43')](_0x5d9032[_0x0255('0x40')],qs['fields'](_0x48e462[_0x0255('0x41')]['fields']));_0x8a4ee9[_0x0255('0x42')]=_0x8a4ee9['attributes'][_0x0255('0x44')]?_0x8a4ee9[_0x0255('0x42')]:_0x5d9032[_0x0255('0x40')];if(!_0x48e462[_0x0255('0x41')][_0x0255('0x45')]('nolimit')){_0x8a4ee9[_0x0255('0x22')]=qs['limit'](_0x48e462[_0x0255('0x41')][_0x0255('0x22')]);_0x8a4ee9['offset']=qs[_0x0255('0x21')](_0x48e462[_0x0255('0x41')][_0x0255('0x21')]);}_0x8a4ee9['order']=qs[_0x0255('0x46')](_0x48e462[_0x0255('0x41')][_0x0255('0x46')]);_0x8a4ee9[_0x0255('0x47')]=qs[_0x0255('0x48')](_[_0x0255('0x49')](_0x48e462[_0x0255('0x41')],_0x5d9032[_0x0255('0x48')]),_0x21884b);var _0xe382fe=[];var _0x4d975e=squel[_0x0255('0x4a')]()[_0x0255('0x4b')]('id')[_0x0255('0x4b')](_0x0255('0x2c'))['field'](_0x0255('0x4c'))[_0x0255('0x4d')](_0x0255('0x4e'));var _0xc35601=squel[_0x0255('0x4a')]()['field'](_0x0255('0x4f'))['field'](_0x0255('0x50'))[_0x0255('0x4b')]('ui.OpenchannelInteractionId')['from'](_0x0255('0x51'),'ui')[_0x0255('0x52')](_0x0255('0x53'),'u',_0x0255('0x54'));var _0x854a2=squel[_0x0255('0x4a')]()[_0x0255('0x4d')](_0x0255('0x55'),'i')[_0x0255('0x52')](_0x0255('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0255('0x52')]('users','o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0x0255('0x57'))[_0x0255('0x52')](_0x0255('0x58'),'me',_0x0255('0x59'))['left_join'](_0x0255('0x5a'),'it',_0x0255('0x5b'))[_0x0255('0x52')](_0x0255('0x4e'),'t',_0x0255('0x5c'));var _0xf6d87a=squel['expr']();var _0x226941=[];var _0x4b694d=squel['expr']();var _0x4d8272;if(_0x48e462[_0x0255('0x41')][_0x0255('0x5d')]){_0x4d8272=as[_0x0255('0x5e')](_0x48e462[_0x0255('0x41')]['search']);var _0x37cb50=_0x4d8272['sqlOperator'];for(var _0xce316a=0x0;_0xce316a<_0x4d8272[_0x0255('0x5f')][_0x0255('0x44')];_0xce316a++){var _0x156ad0=_0x4d8272[_0x0255('0x5f')][_0xce316a];var _0x823b19='i';var _0x3f5617=_['find'](_0x21884b,[_0x0255('0x2c'),_0x156ad0[_0x0255('0x4b')]]);if(!_0x3f5617){switch(_0x156ad0[_0x0255('0x4b')]){case'unreadMessages':if(_0x156ad0[_0x0255('0x60')]==0x1){_0x854a2[_0x0255('0x61')]('`'+_0x156ad0[_0x0255('0x4b')]+_0x0255('0x62'));}else{_0x854a2[_0x0255('0x61')]('`'+_0x156ad0[_0x0255('0x4b')]+_0x0255('0x63'));}break;case'Contact':if(_0x156ad0[_0x0255('0x64')]===_0x0255('0x65')){if(_0x156ad0[_0x0255('0x60')][_0x0255('0x31')]('\x20')['length']>0x1){_0xf6d87a[_0x37cb50](_0x0255('0x66'),qs[_0x0255('0x67')](_0x156ad0[_0x0255('0x60')]),null);}else{var _0x2f6d75='%'+_0x156ad0[_0x0255('0x60')]+'%';_0xf6d87a[_0x37cb50]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2f6d75,_0x2f6d75,_0x2f6d75);}}else{_0x3f5617=_[_0x0255('0x68')](_0x21884b,[_0x0255('0x2c'),_0x0255('0x69')]);_0x156ad0[_0x0255('0x4b')]=_0x0255('0x69');_0x49150f=as[_0x0255('0x6a')](_0x823b19,_0x3f5617[_0x0255('0x3e')],_0x156ad0);_0xf6d87a[_0x37cb50](_0x49150f[_0x0255('0x6b')],_0x49150f['value']['start'],_0x49150f[_0x0255('0x60')][_0x0255('0x2b')]);}break;case _0x0255('0x6c'):var _0x59252c=_0x156ad0[_0x0255('0x60')][_0x0255('0x31')](',')[_0x0255('0x3b')](function(_0x370812){return Number(_0x370812);});_0x59252c[_0x0255('0x6d')](function(_0x3e6130){_0x4b694d['or'](_0x0255('0x6e'),'%,'+_0x3e6130+',%');});_0x226941=_['union'](_0x226941,_0x59252c);break;case _0x0255('0x6f'):if(_0x156ad0[_0x0255('0x64')]===_0x0255('0x65')){_0xf6d87a[_0x37cb50](_0x0255('0x70'),'%'+_0x156ad0[_0x0255('0x60')]+'%',null);}else{_0x3f5617=_[_0x0255('0x68')](_0x21884b,[_0x0255('0x2c'),_0x0255('0x37')]);_0x156ad0[_0x0255('0x4b')]='UserId';_0x49150f=as['buildExpression'](_0x823b19,_0x3f5617[_0x0255('0x3e')],_0x156ad0);_0xf6d87a[_0x37cb50](_0x49150f[_0x0255('0x6b')],_0x49150f[_0x0255('0x60')]['start'],_0x49150f[_0x0255('0x60')][_0x0255('0x2b')]);}break;case _0x0255('0x71'):_0x49150f=as['buildExpression']('me',null,_0x156ad0);_0xf6d87a[_0x37cb50](_0x49150f[_0x0255('0x6b')],_0x49150f[_0x0255('0x60')][_0x0255('0x72')],_0x49150f['value'][_0x0255('0x2b')]);break;}}else{var _0x49150f=as[_0x0255('0x6a')](_0x823b19,_0x3f5617[_0x0255('0x3e')],_0x156ad0);_0xf6d87a[_0x37cb50](_0x49150f[_0x0255('0x6b')],_0x49150f[_0x0255('0x60')]['start'],_0x49150f[_0x0255('0x60')][_0x0255('0x2b')]);}}}else{var _0xd3ff7c=_(_0x48e462['query'])[_0x0255('0x73')]()[_0x0255('0x3b')](function(_0x5bfd24){return _[_0x0255('0x74')](_0x21884b,[_0x0255('0x2c'),_0x5bfd24])?_0x5bfd24:undefined;})[_0x0255('0x75')]()[_0x0255('0x60')]();if(!_['isEmpty'](_0xd3ff7c)){_0xd3ff7c[_0x0255('0x6d')](function(_0x556ed1){if(_0x556ed1===_0x0255('0x76')){_0x854a2[_0x0255('0x47')](_0x0255('0x77'),[][_0x0255('0x78')](_0x48e462['query'][_0x556ed1]));}else if(_0x556ed1===_0x0255('0x79')){var _0x1ce582=JSON[_0x0255('0x7a')](_0x48e462[_0x0255('0x41')][_0x556ed1])[_0x0255('0x7b')];var _0x4a2ce4=JSON['parse'](_0x48e462[_0x0255('0x41')][_0x556ed1])[_0x0255('0x7c')];_0x854a2[_0x0255('0x47')](_0x0255('0x7d'),_0x1ce582,_0x4a2ce4);}else{if(_0x48e462[_0x0255('0x41')][_0x556ed1]===_0x0255('0x7e')){_0x854a2['where']('i.'+_0x556ed1+'\x20IS\x20NULL');}else{_0x854a2[_0x0255('0x47')]('i.'+_0x556ed1+_0x0255('0x7f'),_0x48e462[_0x0255('0x41')][_0x556ed1]);}}});}if(_0x48e462[_0x0255('0x41')][_0x0255('0x80')]){if(_0x48e462['query'][_0x0255('0x80')]==0x1){_0x854a2[_0x0255('0x61')](_0x0255('0x81'));}else{_0x854a2['having']('`unreadMessages`\x20>\x200');}}if(_0x48e462['query']['tag']){_0x226941=_['isArray'](_0x48e462['query'][_0x0255('0x82')])?_0x48e462[_0x0255('0x41')][_0x0255('0x82')]:new Array(_0x48e462[_0x0255('0x41')][_0x0255('0x82')]);_0x226941[_0x0255('0x6d')](function(_0x27cf52){_0x4b694d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x27cf52+',%');});}if(_0x48e462[_0x0255('0x41')]['filter']){var _0xd980b8=_0x48e462[_0x0255('0x41')]['filter'][_0x0255('0x83')]('\x5c','\x5c\x5c')[_0x0255('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xd980b8)){_0xf6d87a['or'](_0x0255('0x84'),_0xd980b8+'%');}else{_0xf6d87a['or'](_0x0255('0x85'),qs['getFullTextValue'](_0xd980b8))['or']('i.from\x20LIKE\x20?',_0xd980b8+'%')['or'](_0x0255('0x86'),_0xd980b8+'%');}}}_0x854a2['where'](_0xf6d87a);_0x854a2['group']('i.id');var _0x179e49={'type':db['Sequelize'][_0x0255('0x87')]['SELECT'],'raw':!![]};var _0x317e3f=_0x854a2['clone']();_0x317e3f[_0x0255('0x4b')]('i.id');_0x317e3f[_0x0255('0x4b')](_0x0255('0x88'),_0x0255('0x89'));if(_0x8a4ee9[_0x0255('0x8a')]){_0x8a4ee9['order'][_0x0255('0x6d')](function(_0x330950){var _0x5327e3=_0x330950[0x0]==='contactName'?_0x330950[0x0]:'i.'+_0x330950[0x0];_0x854a2[_0x0255('0x8a')](_0x5327e3,_0x330950[0x1]===_0x0255('0x8b')?![]:!![]);});}if(!_[_0x0255('0x8c')](_0x226941)){_0x854a2[_0x0255('0x61')](_0x4b694d);_0x317e3f[_0x0255('0x47')](_0x0255('0x8d'),_0x226941);}BPromise[_0x0255('0x8e')]()['then'](function(){if(!_0x4d8272){if(_0x48e462[_0x0255('0x41')][_0x0255('0x76')])return;_0x317e3f[_0x0255('0x47')](_0x0255('0x8f'));_0x854a2[_0x0255('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x48e462[_0x0255('0x90')]['role']!==_0x0255('0x91'))return;return _0x48e462[_0x0255('0x90')][_0x0255('0x92')]({'attributes':['id'],'raw':!![]})[_0x0255('0x2a')](function(_0x5bc2ec){if(_['isEmpty'](_0x5bc2ec)){_0x317e3f['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x854a2['where'](_0x0255('0x93'));}else{_0x317e3f[_0x0255('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x0255('0x3b')](_0x5bc2ec,'id'));_0x854a2[_0x0255('0x47')](_0x0255('0x77'),_[_0x0255('0x3b')](_0x5bc2ec,'id'));}});})[_0x0255('0x2a')](function(){if(_0x48e462[_0x0255('0x90')][_0x0255('0x94')]==='agent'&&!_0x4d8272&&!_0x48e462[_0x0255('0x41')][_0x0255('0x76')])return[];return db[_0x0255('0x95')]['query'](_0x317e3f[_0x0255('0x96')](),_0x179e49);})['then'](function(_0x51fb17){_0x33e959['count']=_0x51fb17[_0x0255('0x44')];if(_0x33e959[_0x0255('0x97')]===0x0)return[];return db[_0x0255('0x95')]['query'](_0x4d975e[_0x0255('0x96')](),_0x179e49)[_0x0255('0x2a')](function(_0x3568ba){_0xe382fe=_[_0x0255('0x98')](_0x3568ba,'id');_0x179e49=_['merge'](_0x179e49,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x48e462[_0x0255('0x41')][_0x0255('0x99')]){_0x8a4ee9[_0x0255('0x42')][_0x0255('0x6d')](function(_0x170f75){_0x854a2[_0x0255('0x4b')]('i.'+_0x170f75);});}else{_0x854a2[_0x0255('0x4b')](_0x0255('0x88'),_0x0255('0x89'));_0x854a2[_0x0255('0x4b')](_0x0255('0x9a'),_0x0255('0x9b'));_0x854a2[_0x0255('0x4b')]('a.mandatoryDisposition',_0x0255('0x9c'));_0x854a2[_0x0255('0x4b')](_0x0255('0x9d'),'contactName');_0x854a2[_0x0255('0x4b')](_0x0255('0x9e'));_0x854a2[_0x0255('0x4b')](_0x0255('0x9f'),_0x0255('0xa0'));_0x854a2[_0x0255('0x4b')](_0x0255('0xa1'),_0x0255('0xa2'));_0x854a2[_0x0255('0x4b')](_0x0255('0xa3'),_0x0255('0xa4'));_0x854a2[_0x0255('0x4b')](_0x0255('0xa5'),'Contact.phone');_0x854a2[_0x0255('0x4b')](_0x0255('0xa6'),_0x0255('0xa7'));_0x854a2['field'](_0x0255('0xa8'),_0x0255('0xa9'));_0x854a2[_0x0255('0x4b')]('o.fullname','Owner.fullname');_0x854a2[_0x0255('0x4b')]('o.internal',_0x0255('0xaa'));_0x854a2['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0255('0x2f'));}if(_0x8a4ee9[_0x0255('0x22')])_0x854a2[_0x0255('0x22')](_0x8a4ee9['limit']);if(_0x8a4ee9[_0x0255('0x21')])_0x854a2['offset'](_0x8a4ee9[_0x0255('0x21')]);return db[_0x0255('0x95')][_0x0255('0x41')](_0x854a2['toString'](),_0x179e49);})['then'](function(_0x2f9dd7){if(_0x2f9dd7['length']>0x0)_0xc35601[_0x0255('0x47')](_0x0255('0xab'),_[_0x0255('0x3b')](_0x2f9dd7,'id'));return db[_0x0255('0x95')]['query'](_0xc35601[_0x0255('0x96')](),_0x179e49)[_0x0255('0x2a')](function(_0x862160){var _0x2ae840=_[_0x0255('0xac')](_0x862160,'OpenchannelInteractionId');var _0x3a316d=[];_0x2f9dd7['forEach'](function(_0xccb60f){_0x3a316d[_0x0255('0x32')](updateOpenchannelInteraction(_0xccb60f,_0xe382fe,_0x2ae840));});return BPromise['all'](_0x3a316d);});});})['then'](function(_0x5a0b60){_0x33e959[_0x0255('0xad')]=_0x5a0b60;return _0x33e959;})[_0x0255('0x2a')](respondWithFilteredResult(_0x208f28,_0x8a4ee9))['catch'](handleError(_0x208f28,null));};exports[_0x0255('0xae')]=function(_0x4653bb,_0x4cb4e7){var _0x2e0b7d={};if(_0x4653bb[_0x0255('0x41')][_0x0255('0x3e')]&&_0x4653bb[_0x0255('0x41')][_0x0255('0x3e')]==='from'){_0x2e0b7d['from']=_0x4653bb[_0x0255('0xaf')]['id'];}else{_0x2e0b7d['id']=_0x4653bb['params']['id'];}var _0x5c5bf4={'raw':![],'where':_0x2e0b7d},_0x32451e={};_0x32451e[_0x0255('0x40')]=_['keys'](db[_0x0255('0xb0')][_0x0255('0x3c')]);_0x32451e['query']=_[_0x0255('0x73')](_0x4653bb['query']);_0x32451e[_0x0255('0x48')]=_[_0x0255('0x43')](_0x32451e['model'],_0x32451e['query']);_0x5c5bf4[_0x0255('0x42')]=_[_0x0255('0x43')](_0x32451e[_0x0255('0x40')],qs[_0x0255('0x99')](_0x4653bb['query'][_0x0255('0x99')]));_0x5c5bf4[_0x0255('0x42')]=_0x5c5bf4[_0x0255('0x42')][_0x0255('0x44')]?_0x5c5bf4[_0x0255('0x42')]:_0x32451e[_0x0255('0x40')];if(_0x4653bb[_0x0255('0x41')]['includeAll']){_0x5c5bf4['include']=[{'all':!![]}];}_0x5c5bf4=_[_0x0255('0xb1')]({},_0x5c5bf4,_0x4653bb[_0x0255('0xb2')]);return db[_0x0255('0xb0')]['find'](_0x5c5bf4)[_0x0255('0x2a')](handleEntityNotFound(_0x4cb4e7,null))[_0x0255('0x2a')](respondWithResult(_0x4cb4e7,null))[_0x0255('0xb3')](handleError(_0x4cb4e7,null));};exports[_0x0255('0xb4')]=function(_0x33e257,_0x44aabc){return db[_0x0255('0xb0')]['create'](_0x33e257[_0x0255('0x71')],{})[_0x0255('0x2a')](respondWithResult(_0x44aabc,0xc9))[_0x0255('0xb3')](handleError(_0x44aabc,null));};exports[_0x0255('0x29')]=function(_0x17a839,_0x1c925a){if(_0x17a839[_0x0255('0x71')]['id']){delete _0x17a839[_0x0255('0x71')]['id'];}return db[_0x0255('0xb0')][_0x0255('0x68')]({'where':{'id':_0x17a839[_0x0255('0xaf')]['id']}})['then'](handleEntityNotFound(_0x1c925a,null))[_0x0255('0x2a')](saveUpdates(_0x17a839[_0x0255('0x71')],null))[_0x0255('0x2a')](respondWithResult(_0x1c925a,null))[_0x0255('0xb3')](handleError(_0x1c925a,null));};exports['destroy']=function(_0x2a6f32,_0x32ec06){return db[_0x0255('0xb0')][_0x0255('0x68')]({'where':{'id':_0x2a6f32[_0x0255('0xaf')]['id']}})['then'](handleEntityNotFound(_0x32ec06,null))[_0x0255('0x2a')](removeEntity(_0x32ec06,null))['catch'](handleError(_0x32ec06,null));};exports[_0x0255('0xb5')]=function(_0x3b646b,_0x5a507c){return db[_0x0255('0xb0')][_0x0255('0xb5')]()[_0x0255('0x2a')](respondWithResult(_0x5a507c,null))[_0x0255('0xb3')](handleError(_0x5a507c,null));};exports['addMessage']=function(_0x4b46b8,_0x2bdb3c,_0x27dbee){return db[_0x0255('0xb6')][_0x0255('0x68')]({'where':{'id':_0x4b46b8[_0x0255('0xaf')]['id']}})[_0x0255('0x2a')](handleEntityNotFound(_0x2bdb3c,null))[_0x0255('0x2a')](function(_0x3de1d3){if(_0x3de1d3){return _0x3de1d3[_0x0255('0xb7')](_0x4b46b8[_0x0255('0x71')]['ids'],_[_0x0255('0xb8')](_0x4b46b8[_0x0255('0x71')],[_0x0255('0xb9'),'id'])||{});}})[_0x0255('0x2a')](respondWithResult(_0x2bdb3c,null))[_0x0255('0xb3')](handleError(_0x2bdb3c,null));};exports[_0x0255('0xba')]=function(_0x1013c5,_0x4e97f1,_0x4dca5e){var _0x3d0988={'raw':![],'where':{}};var _0x38e53b={};var _0x326bf3={'count':0x0,'rows':[]};return db[_0x0255('0xb0')][_0x0255('0xbb')]({'where':{'id':_0x1013c5[_0x0255('0xaf')]['id']}})['then'](handleEntityNotFound(_0x4e97f1,null))[_0x0255('0x2a')](function(_0x4972c8){if(_0x4972c8){_0x38e53b[_0x0255('0x40')]=_['keys'](db[_0x0255('0xb6')][_0x0255('0x3c')]);_0x38e53b[_0x0255('0x41')]=_[_0x0255('0x73')](_0x1013c5[_0x0255('0x41')]);_0x38e53b[_0x0255('0x48')]=_[_0x0255('0x43')](_0x38e53b['model'],_0x38e53b[_0x0255('0x41')]);_0x3d0988[_0x0255('0x42')]=_[_0x0255('0x43')](_0x38e53b[_0x0255('0x40')],qs[_0x0255('0x99')](_0x1013c5[_0x0255('0x41')][_0x0255('0x99')]));_0x3d0988[_0x0255('0x42')]=_0x3d0988[_0x0255('0x42')][_0x0255('0x44')]?_0x3d0988[_0x0255('0x42')]:_0x38e53b[_0x0255('0x40')];if(!_0x1013c5[_0x0255('0x41')][_0x0255('0x45')](_0x0255('0xbc'))){_0x3d0988['limit']=qs[_0x0255('0x22')](_0x1013c5[_0x0255('0x41')][_0x0255('0x22')]);_0x3d0988[_0x0255('0x21')]=qs['offset'](_0x1013c5[_0x0255('0x41')][_0x0255('0x21')]);}_0x3d0988['order']=qs['sort'](_0x1013c5[_0x0255('0x41')][_0x0255('0x46')]);_0x3d0988[_0x0255('0x47')]=qs[_0x0255('0x48')](_[_0x0255('0x49')](_0x1013c5['query'],_0x38e53b[_0x0255('0x48')]));_0x3d0988[_0x0255('0x47')][_0x0255('0xbd')]=_0x4972c8['id'];if(_0x1013c5[_0x0255('0x41')][_0x0255('0xbe')]){_0x3d0988['where']=_[_0x0255('0xb1')](_0x3d0988[_0x0255('0x47')],{'$or':_[_0x0255('0x3b')](_0x3d0988['attributes'],function(_0x1c455d){var _0xf241dd={};_0xf241dd[_0x1c455d]={'$like':'%'+_0x1013c5[_0x0255('0x41')]['filter']+'%'};return _0xf241dd;})});}if(_0x1013c5[_0x0255('0x41')][_0x0255('0x7b')]){var _0x252201=_0x1013c5['query'][_0x0255('0x7b')]['split'](',');var _0x58d30a={};_0x58d30a[_0x252201[0x0]]={'$gte':moment(_0x252201[0x1])['format'](_0x0255('0xbf'))};_0x3d0988[_0x0255('0x47')]=_[_0x0255('0xb1')](_0x3d0988['where'],_0x58d30a);}_0x3d0988=_['merge']({},_0x3d0988,_0x1013c5['options']);return db[_0x0255('0xb6')][_0x0255('0x97')]({'where':_0x3d0988[_0x0255('0x47')]})['then'](function(_0x481422){_0x326bf3[_0x0255('0x97')]=_0x481422;if(_0x1013c5[_0x0255('0x41')][_0x0255('0xc0')]){_0x3d0988[_0x0255('0xc1')]=[{'all':!![]}];}return db[_0x0255('0xb6')][_0x0255('0xc2')](_0x3d0988);})[_0x0255('0x2a')](function(_0x2e81ef){_0x326bf3[_0x0255('0xad')]=_0x2e81ef;return _0x326bf3;});}})[_0x0255('0x2a')](respondWithFilteredResult(_0x4e97f1,_0x3d0988))['catch'](handleError(_0x4e97f1,null));};exports[_0x0255('0xc3')]=function(_0x320b8d,_0x4a53e2,_0x53490c){return db[_0x0255('0xb0')][_0x0255('0x68')]({'where':{'id':_0x320b8d[_0x0255('0xaf')]['id']}})[_0x0255('0x2a')](handleEntityNotFound(_0x4a53e2,null))['then'](function(_0x2f5d3a){if(_0x2f5d3a){return _0x2f5d3a[_0x0255('0xc4')](_0x320b8d[_0x0255('0x71')][_0x0255('0xb9')],_[_0x0255('0xb8')](_0x320b8d[_0x0255('0x71')],[_0x0255('0xb9'),'id'])||{})[_0x0255('0xc5')](function(){return db['Tag'][_0x0255('0xc2')]({'attributes':['id',_0x0255('0x2c'),_0x0255('0x4c')],'where':{'id':_0x320b8d[_0x0255('0x71')][_0x0255('0xb9')]}});})[_0x0255('0x2a')](function(_0x227dd4){socket[_0x0255('0xc6')]('openchannelInteractionTags:save',{'id':Number(_0x320b8d[_0x0255('0xaf')]['id']),'tags':_0x227dd4||[]});return{'id':Number(_0x320b8d['params']['id']),'tags':_0x227dd4||[]};});}})['then'](respondWithResult(_0x4a53e2,null))[_0x0255('0xb3')](handleError(_0x4a53e2,null));};exports['removeTags']=function(_0x2e8a73,_0x3fb159,_0x480774){return db[_0x0255('0xb0')][_0x0255('0x68')]({'where':{'id':_0x2e8a73[_0x0255('0xaf')]['id']}})[_0x0255('0x2a')](handleEntityNotFound(_0x3fb159,null))[_0x0255('0x2a')](function(_0x26d7c2){if(_0x26d7c2){return _0x26d7c2[_0x0255('0xc7')](_0x2e8a73[_0x0255('0x41')][_0x0255('0xb9')]);}})[_0x0255('0x2a')](respondWithStatusCode(_0x3fb159,null))[_0x0255('0xb3')](handleError(_0x3fb159,null));};exports[_0x0255('0xc8')]=function(_0x41a709,_0x4e19d3){var _0x5be738=moment()[_0x0255('0xc9')]()[_0x0255('0x96')]();var _0xadc3c9=path[_0x0255('0xca')](config[_0x0255('0xcb')],'server','files','tmp');var _0x183a2a=path[_0x0255('0xca')](config[_0x0255('0xcb')],_0x0255('0xcc'),_0x0255('0xcd'),'attachments');var _0x333e18=path['join'](_0xadc3c9,_0x5be738);var _0x599fe5=util[_0x0255('0xce')](_0x0255('0xcf'),_0x41a709[_0x0255('0xaf')]['id'],_0x5be738);var _0x571e82=path[_0x0255('0xca')](_0xadc3c9,_0x599fe5);var _0x235298=[];_0x235298[_0x0255('0x32')]({'model':db['User'],'as':_0x0255('0x6f'),'attributes':['id',_0x0255('0xd0')],'raw':!![]});_0x235298['push']({'model':db[_0x0255('0xd1')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x41a709[_0x0255('0x41')][_0x0255('0xd2')]){_0x235298[_0x0255('0x32')]({'model':db[_0x0255('0xd3')],'as':_0x0255('0xd3'),'raw':!![]});}var _0x50bedd=[{'model':db[_0x0255('0xb6')],'as':'Messages','attributes':['id',_0x0255('0x71'),_0x0255('0x79'),'direction',_0x0255('0xd4'),_0x0255('0x80')],'include':_0x235298}];_0x50bedd[_0x0255('0x32')]({'model':db[_0x0255('0xd5')],'as':_0x0255('0xd6'),'attributes':['id',_0x0255('0x2c')]});_0x50bedd['push']({'model':db[_0x0255('0x6f')],'as':_0x0255('0xd7'),'attributes':['id',_0x0255('0xd0')]});return db[_0x0255('0xb0')][_0x0255('0x68')]({'where':{'id':_0x41a709[_0x0255('0xaf')]['id']},'include':_0x50bedd})[_0x0255('0x2a')](handleEntityNotFound(_0x4e19d3,null))[_0x0255('0x2a')](function(_0x3a5bb0){if(_0x3a5bb0){var _0x83eff1=_0x3a5bb0[_0x0255('0xd8')]({'plain':!![]});fs[_0x0255('0xd9')](_0x333e18);var _0x16798a={'channel':_0x0255('0xda'),'account':_0x83eff1[_0x0255('0xd6')][_0x0255('0x2c')],'agent':_0x83eff1['Owner']?_0x83eff1['Owner']['fullname']:_0x0255('0xdb'),'createdAt':moment(_0x83eff1[_0x0255('0x79')])[_0x0255('0xce')](_0x0255('0xbf'))[_0x0255('0x96')](),'closedAt':_0x83eff1[_0x0255('0x36')]?moment(_0x83eff1[_0x0255('0xdc')])[_0x0255('0xce')](_0x0255('0xbf'))['toString']():'','disposition':_0x83eff1[_0x0255('0xdd')],'visibility':_0x83eff1[_0x0255('0xde')]?_0x0255('0xdf'):_0x0255('0xe0'),'messages':_(_0x83eff1[_0x0255('0xe1')])[_0x0255('0xbe')]({'secret':![]})[_0x0255('0x3b')](function(_0x19dde3){if(_0x19dde3[_0x0255('0xd3')]){var _0x803edb=path['join'](_0x183a2a,_0x19dde3[_0x0255('0xd3')]['basename']);if(fs[_0x0255('0xe2')](_0x803edb)){fs[_0x0255('0xe3')](_0x803edb)['pipe'](fs[_0x0255('0xe4')](path[_0x0255('0xca')](_0x333e18,_0x19dde3[_0x0255('0xd3')][_0x0255('0xe5')])));}}return{'date':moment(_0x19dde3[_0x0255('0x79')])[_0x0255('0xce')](_0x0255('0xbf'))[_0x0255('0x96')](),'sender':_0x19dde3['direction']===_0x0255('0xe6')?_0x19dde3['User']?_0x19dde3['User'][_0x0255('0xd0')]:_0x0255('0xe7'):_0x19dde3[_0x0255('0xe8')][_0x0255('0xe9')]+(_0x19dde3[_0x0255('0xe8')][_0x0255('0xea')]?'\x20'+_0x19dde3['Contact'][_0x0255('0xea')]:''),'body':_0x19dde3[_0x0255('0xd3')]?_0x19dde3[_0x0255('0xd3')][_0x0255('0xe5')]:_0x19dde3[_0x0255('0x71')],'direction':_0x19dde3[_0x0255('0xeb')]===_0x0255('0xe6')?'A':'C','secret':_0x19dde3[_0x0255('0xd4')],'read':_0x19dde3[_0x0255('0x80')],'attachment':_0x19dde3['Attachment']};})[_0x0255('0x60')]()};return ejs['renderFile'](path[_0x0255('0xca')](config[_0x0255('0xcb')],_0x0255('0xcc'),_0x0255('0xec'),_0x0255('0xed')),{'interaction':_0x16798a})[_0x0255('0x2a')](function(_0x46a06e){var _0x44a198=path[_0x0255('0xca')](_0x333e18,_0x0255('0xee')+_0x83eff1['id']+'-'+_0x5be738+_0x0255('0xef'));var _0x3aa602={'path':_0x44a198,'channel':_0x0255('0xda'),'interactionId':_0x83eff1['id']};return pdf[_0x0255('0xf0')](_0x46a06e,_0x3aa602);})[_0x0255('0x2a')](function(){return new BPromise(function(_0xfba29b,_0x5db4fd){zipdir(_0x333e18,{'saveTo':_0x571e82},function(_0x488671,_0x5a8138){if(_0x488671)return _0x5db4fd(_0x488671);return _0xfba29b(_0x5a8138);});})[_0x0255('0x2a')](function(){return new BPromise(function(_0x2ca8dc,_0x2d4df1){rimraf(_0x333e18,function(_0x8e5cb3){if(_0x8e5cb3)_0x2d4df1(_0x8e5cb3);return _0x2ca8dc();});});})[_0x0255('0x2a')](function(){return _0x4e19d3[_0x0255('0xc8')](_0x571e82,_0x599fe5,function(_0x29027b){if(_0x29027b){console[_0x0255('0xf1')](_0x0255('0xf2'),_0x29027b);}else{fs[_0x0255('0xf3')](_0x571e82);}});});});}else{return _0x4e19d3[_0x0255('0x1e')](0xc8);}})[_0x0255('0xb3')](handleError(_0x4e19d3,null));}; \ No newline at end of file +var _0xbdd7=['catch','waiting','answered','total','closed','UserId','talking','OpenchannelInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.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','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','params','rawAttributes','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','$gte','findAll','addTags','setTags','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','mkdirSync','Openchannel','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push'];(function(_0x2aa84d,_0x51ef19){var _0x2362e0=function(_0x3bf22a){while(--_0x3bf22a){_0x2aa84d['push'](_0x2aa84d['shift']());}};_0x2362e0(++_0x51ef19);}(_0xbdd7,0x1a9));var _0x7bdd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbdd7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bdd('0x0'));var zipdir=require(_0x7bdd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7bdd('0x2'));var BPromise=require(_0x7bdd('0x3'));var Mustache=require(_0x7bdd('0x4'));var util=require('util');var path=require(_0x7bdd('0x5'));var sox=require('sox');var csv=require(_0x7bdd('0x6'));var ejs=require(_0x7bdd('0x7'));var fs=require('fs');var fs_extra=require(_0x7bdd('0x8'));var _=require(_0x7bdd('0x9'));var squel=require('squel');var crypto=require(_0x7bdd('0xa'));var jsforce=require(_0x7bdd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7bdd('0x6'));var querystring=require(_0x7bdd('0xc'));var Papa=require(_0x7bdd('0xd'));var Redis=require(_0x7bdd('0xe'));var authService=require(_0x7bdd('0xf'));var qs=require(_0x7bdd('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7bdd('0x11'));var hardwareService=require(_0x7bdd('0x12'));var logger=require(_0x7bdd('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7bdd('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7bdd('0x15')](config[_0x7bdd('0x16')],{'host':_0x7bdd('0x17'),'port':0x18eb});var socket=require(_0x7bdd('0x18'))(new Redis(config['redis']));require(_0x7bdd('0x19'))[_0x7bdd('0x1a')](socket);function respondWithStatusCode(_0x5d7b08,_0x2374a1){_0x2374a1=_0x2374a1||0xcc;return function(_0x1cebdc){if(_0x1cebdc){return _0x5d7b08[_0x7bdd('0x1b')](_0x2374a1);}return _0x5d7b08[_0x7bdd('0x1c')](_0x2374a1)[_0x7bdd('0x1d')]();};}function respondWithResult(_0x514b6a,_0x131f6f){_0x131f6f=_0x131f6f||0xc8;return function(_0x3fb73d){if(_0x3fb73d){return _0x514b6a[_0x7bdd('0x1c')](_0x131f6f)[_0x7bdd('0x1e')](_0x3fb73d);}};}function respondWithFilteredResult(_0x596c66,_0x168465){return function(_0x38518c){if(_0x38518c){var _0x94cc9c=typeof _0x168465[_0x7bdd('0x1f')]===_0x7bdd('0x20')&&typeof _0x168465[_0x7bdd('0x21')]===_0x7bdd('0x20');var _0x28be37=_0x38518c[_0x7bdd('0x22')];var _0x38120a=_0x94cc9c?0x0:_0x168465['offset'];var _0x35d676=_0x94cc9c?_0x38518c['count']:_0x168465[_0x7bdd('0x1f')]+_0x168465['limit'];var _0x47471a;if(_0x35d676>=_0x28be37){_0x35d676=_0x28be37;_0x47471a=0xc8;}else{_0x47471a=0xce;}_0x596c66[_0x7bdd('0x1c')](_0x47471a);return _0x596c66[_0x7bdd('0x23')](_0x7bdd('0x24'),_0x38120a+'-'+_0x35d676+'/'+_0x28be37)[_0x7bdd('0x1e')](_0x38518c);}return null;};}function patchUpdates(_0x3d2ab4){return function(_0x1cf640){try{jsonpatch[_0x7bdd('0x25')](_0x1cf640,_0x3d2ab4,!![]);}catch(_0x8dc4e7){return BPromise['reject'](_0x8dc4e7);}return _0x1cf640[_0x7bdd('0x26')]();};}function saveUpdates(_0x5c2866,_0x344f49){return function(_0x464b32){if(_0x464b32){return _0x464b32[_0x7bdd('0x27')](_0x5c2866)['then'](function(_0x1566df){return _0x1566df;});}return null;};}function removeEntity(_0x4cbf30,_0x4a9f28){return function(_0x23a916){if(_0x23a916){return _0x23a916['destroy']()[_0x7bdd('0x28')](function(){_0x4cbf30[_0x7bdd('0x1c')](0xcc)[_0x7bdd('0x1d')]();});}};}function handleEntityNotFound(_0x47cdf0,_0x2cd483){return function(_0x5c03d2){if(!_0x5c03d2){_0x47cdf0[_0x7bdd('0x1b')](0x194);}return _0x5c03d2;};}function handleError(_0x27dce2,_0x3aea05){_0x3aea05=_0x3aea05||0x1f4;return function(_0x37d771){logger[_0x7bdd('0x29')](_0x37d771[_0x7bdd('0x2a')]);if(_0x37d771['name']){delete _0x37d771[_0x7bdd('0x2b')];}_0x27dce2['status'](_0x3aea05)[_0x7bdd('0x2c')](_0x37d771);};}function getInteractionUsers(_0x52c9c4,_0x4b4a82){return new BPromise(function(_0x896ec7,_0x429672){try{if(_0x4b4a82[_0x52c9c4['id']]){_0x52c9c4[_0x7bdd('0x2d')]=_[_0x7bdd('0x2e')](_0x4b4a82[_0x52c9c4['id']],function(_0xe6ecd2){return{'id':_0xe6ecd2['id'],'fullname':_0xe6ecd2[_0x7bdd('0x2f')]};});}}catch(_0x24e383){_0x429672(_0x24e383);}_0x896ec7(_0x52c9c4);});}function getInteractionTags(_0x18663c,_0x19277d){return new BPromise(function(_0x181987,_0x254302){try{if(_0x18663c[_0x7bdd('0x30')]){_0x18663c[_0x7bdd('0x31')]=[];_0x18663c[_0x7bdd('0x30')][_0x7bdd('0x32')](',')[_0x7bdd('0x33')](function(_0x24239e){_0x18663c[_0x7bdd('0x31')][_0x7bdd('0x34')](_0x19277d[_0x24239e]);});}delete _0x18663c[_0x7bdd('0x30')];}catch(_0x1e1e96){_0x254302(_0x1e1e96);}_0x181987(_0x18663c);});}function updateOpenchannelInteraction(_0xc5725b,_0x940417,_0x2f91da){return new BPromise(function(_0x46dcd7,_0x5a41fe){return getInteractionUsers(_0xc5725b,_0x2f91da)[_0x7bdd('0x28')](function(_0x698a5b){return getInteractionTags(_0x698a5b,_0x940417);})[_0x7bdd('0x28')](function(_0x43632d){return getStateInteraction(_0x43632d);})[_0x7bdd('0x28')](function(_0xc74930){_0x46dcd7(_0xc74930);})[_0x7bdd('0x35')](function(_0x49c72c){_0x5a41fe(_0x49c72c);});});}function getStateInteraction(_0x442b5b){return new BPromise(function(_0x418e63){_0x442b5b[_0x7bdd('0x36')]=0x0;_0x442b5b['talking']=0x0;_0x442b5b[_0x7bdd('0x37')]=0x0;_0x442b5b['unmanaged']=0x0;_0x442b5b[_0x7bdd('0x38')]=0x0;if(!_0x442b5b[_0x7bdd('0x39')]&&!_0x442b5b[_0x7bdd('0x3a')]){_0x442b5b[_0x7bdd('0x36')]+=0x1;}if(!_0x442b5b[_0x7bdd('0x39')]&&_0x442b5b[_0x7bdd('0x3a')]){_0x442b5b[_0x7bdd('0x3b')]+=0x1;if(_0x442b5b[_0x7bdd('0x36')]){_0x442b5b[_0x7bdd('0x36')]-=0x1;}}if(_0x442b5b[_0x7bdd('0x39')]&&_0x442b5b[_0x7bdd('0x3a')]){_0x442b5b[_0x7bdd('0x37')]+=0x1;if(_0x442b5b[_0x7bdd('0x3b')]){_0x442b5b[_0x7bdd('0x3b')]-=0x1;}}if(_0x442b5b[_0x7bdd('0x39')]&&!_0x442b5b[_0x7bdd('0x3a')]){_0x442b5b['unmanaged']+=0x1;if(_0x442b5b[_0x7bdd('0x36')]){_0x442b5b['waiting']-=0x1;}}_0x442b5b[_0x7bdd('0x38')]+=0x1;_0x418e63(_0x442b5b);});}exports['index']=function(_0x1fbe55,_0x28d4d3){var _0x542688={},_0x5cd056={},_0x55ce7a={'count':0x0,'rows':[]};var _0x1baa41=_[_0x7bdd('0x2e')](db[_0x7bdd('0x3c')]['rawAttributes'],function(_0x77baa6){return{'name':_0x77baa6[_0x7bdd('0x3d')],'type':_0x77baa6[_0x7bdd('0x3e')][_0x7bdd('0x3f')]};});_0x5cd056[_0x7bdd('0x40')]=_[_0x7bdd('0x2e')](_0x1baa41,_0x7bdd('0x2b'));_0x5cd056[_0x7bdd('0x41')]=_[_0x7bdd('0x42')](_0x1fbe55[_0x7bdd('0x41')]);_0x5cd056[_0x7bdd('0x43')]=_[_0x7bdd('0x44')](_0x5cd056[_0x7bdd('0x40')],_0x5cd056[_0x7bdd('0x41')]);_0x542688[_0x7bdd('0x45')]=_[_0x7bdd('0x44')](_0x5cd056[_0x7bdd('0x40')],qs[_0x7bdd('0x46')](_0x1fbe55['query']['fields']));_0x542688[_0x7bdd('0x45')]=_0x542688[_0x7bdd('0x45')]['length']?_0x542688[_0x7bdd('0x45')]:_0x5cd056[_0x7bdd('0x40')];if(!_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x47')](_0x7bdd('0x48'))){_0x542688['limit']=qs['limit'](_0x1fbe55[_0x7bdd('0x41')]['limit']);_0x542688[_0x7bdd('0x1f')]=qs[_0x7bdd('0x1f')](_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x1f')]);}_0x542688[_0x7bdd('0x49')]=qs[_0x7bdd('0x4a')](_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x4a')]);_0x542688[_0x7bdd('0x4b')]=qs[_0x7bdd('0x43')](_[_0x7bdd('0x4c')](_0x1fbe55['query'],_0x5cd056[_0x7bdd('0x43')]),_0x1baa41);var _0x3e16fc=[];var _0x286429=squel[_0x7bdd('0x4d')]()[_0x7bdd('0x4e')]('id')[_0x7bdd('0x4e')](_0x7bdd('0x2b'))[_0x7bdd('0x4e')]('color')[_0x7bdd('0x4f')](_0x7bdd('0x50'));var _0x543aa3=squel[_0x7bdd('0x4d')]()[_0x7bdd('0x4e')](_0x7bdd('0x51'))[_0x7bdd('0x4e')]('u.fullname')[_0x7bdd('0x4e')]('ui.OpenchannelInteractionId')['from'](_0x7bdd('0x52'),'ui')[_0x7bdd('0x53')](_0x7bdd('0x54'),'u',_0x7bdd('0x55'));var _0x4c7021=squel['select']()[_0x7bdd('0x4f')]('openchannel_interactions','i')[_0x7bdd('0x53')](_0x7bdd('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x7bdd('0x53')]('users','o',_0x7bdd('0x57'))['left_join'](_0x7bdd('0x58'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x7bdd('0x59'),'me',_0x7bdd('0x5a'))[_0x7bdd('0x53')]('openchannel_interaction_has_tags','it',_0x7bdd('0x5b'))[_0x7bdd('0x53')](_0x7bdd('0x50'),'t',_0x7bdd('0x5c'));var _0x202f8e=squel['expr']();var _0x36c5bd=[];var _0x4f3b49=squel['expr']();var _0x35ce8a;if(_0x1fbe55[_0x7bdd('0x41')]['search']){_0x35ce8a=as['parseSearch'](_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x5d')]);var _0x48686c=_0x35ce8a['sqlOperator'];for(var _0x518ff1=0x0;_0x518ff1<_0x35ce8a[_0x7bdd('0x5e')][_0x7bdd('0x5f')];_0x518ff1++){var _0x306c6c=_0x35ce8a['conditions'][_0x518ff1];var _0x293ba9='i';var _0xaa6fd0=_[_0x7bdd('0x60')](_0x1baa41,[_0x7bdd('0x2b'),_0x306c6c[_0x7bdd('0x4e')]]);if(!_0xaa6fd0){switch(_0x306c6c[_0x7bdd('0x4e')]){case _0x7bdd('0x61'):if(_0x306c6c[_0x7bdd('0x62')]==0x1){_0x4c7021[_0x7bdd('0x63')]('`'+_0x306c6c[_0x7bdd('0x4e')]+_0x7bdd('0x64'));}else{_0x4c7021[_0x7bdd('0x63')]('`'+_0x306c6c[_0x7bdd('0x4e')]+_0x7bdd('0x65'));}break;case _0x7bdd('0x66'):if(_0x306c6c[_0x7bdd('0x67')]===_0x7bdd('0x68')){if(_0x306c6c[_0x7bdd('0x62')]['split']('\x20')[_0x7bdd('0x5f')]>0x1){_0x202f8e[_0x48686c](_0x7bdd('0x69'),qs['getFullTextValue'](_0x306c6c[_0x7bdd('0x62')]),null);}else{var _0x51e66f='%'+_0x306c6c[_0x7bdd('0x62')]+'%';_0x202f8e[_0x48686c](_0x7bdd('0x6a'),_0x51e66f,_0x51e66f,_0x51e66f);}}else{_0xaa6fd0=_[_0x7bdd('0x60')](_0x1baa41,[_0x7bdd('0x2b'),_0x7bdd('0x6b')]);_0x306c6c[_0x7bdd('0x4e')]=_0x7bdd('0x6b');_0x38d69f=as[_0x7bdd('0x6c')](_0x293ba9,_0xaa6fd0[_0x7bdd('0x3e')],_0x306c6c);_0x202f8e[_0x48686c](_0x38d69f[_0x7bdd('0x6d')],_0x38d69f[_0x7bdd('0x62')][_0x7bdd('0x6e')],_0x38d69f[_0x7bdd('0x62')][_0x7bdd('0x1d')]);}break;case _0x7bdd('0x6f'):var _0x589f6e=_0x306c6c[_0x7bdd('0x62')][_0x7bdd('0x32')](',')[_0x7bdd('0x2e')](function(_0x2299cf){return Number(_0x2299cf);});_0x589f6e[_0x7bdd('0x33')](function(_0x56b4fc){_0x4f3b49['or'](_0x7bdd('0x70'),'%,'+_0x56b4fc+',%');});_0x36c5bd=_[_0x7bdd('0x71')](_0x36c5bd,_0x589f6e);break;case'User':if(_0x306c6c['operator']==='$substring'){_0x202f8e[_0x48686c](_0x7bdd('0x72'),'%'+_0x306c6c[_0x7bdd('0x62')]+'%',null);}else{_0xaa6fd0=_[_0x7bdd('0x60')](_0x1baa41,[_0x7bdd('0x2b'),'UserId']);_0x306c6c[_0x7bdd('0x4e')]='UserId';_0x38d69f=as[_0x7bdd('0x6c')](_0x293ba9,_0xaa6fd0[_0x7bdd('0x3e')],_0x306c6c);_0x202f8e[_0x48686c](_0x38d69f[_0x7bdd('0x6d')],_0x38d69f[_0x7bdd('0x62')]['start'],_0x38d69f['value'][_0x7bdd('0x1d')]);}break;case _0x7bdd('0x73'):_0x38d69f=as[_0x7bdd('0x6c')]('me',null,_0x306c6c);_0x202f8e[_0x48686c](_0x38d69f['text'],_0x38d69f[_0x7bdd('0x62')][_0x7bdd('0x6e')],_0x38d69f[_0x7bdd('0x62')]['end']);break;}}else{var _0x38d69f=as['buildExpression'](_0x293ba9,_0xaa6fd0[_0x7bdd('0x3e')],_0x306c6c);_0x202f8e[_0x48686c](_0x38d69f[_0x7bdd('0x6d')],_0x38d69f[_0x7bdd('0x62')][_0x7bdd('0x6e')],_0x38d69f[_0x7bdd('0x62')][_0x7bdd('0x1d')]);}}}else{var _0x5005de=_(_0x1fbe55['query'])[_0x7bdd('0x42')]()[_0x7bdd('0x2e')](function(_0x4b96c1){return _[_0x7bdd('0x74')](_0x1baa41,[_0x7bdd('0x2b'),_0x4b96c1])?_0x4b96c1:undefined;})[_0x7bdd('0x75')]()['value']();if(!_[_0x7bdd('0x76')](_0x5005de)){_0x5005de['forEach'](function(_0x10d48c){if(_0x10d48c===_0x7bdd('0x77')){_0x4c7021[_0x7bdd('0x4b')](_0x7bdd('0x78'),[][_0x7bdd('0x79')](_0x1fbe55[_0x7bdd('0x41')][_0x10d48c]));}else if(_0x10d48c===_0x7bdd('0x7a')){var _0x4786ef=JSON[_0x7bdd('0x7b')](_0x1fbe55[_0x7bdd('0x41')][_0x10d48c])['$gte'];var _0x289fa0=JSON['parse'](_0x1fbe55[_0x7bdd('0x41')][_0x10d48c])[_0x7bdd('0x7c')];_0x4c7021[_0x7bdd('0x4b')](_0x7bdd('0x7d'),_0x4786ef,_0x289fa0);}else{if(_0x1fbe55[_0x7bdd('0x41')][_0x10d48c]===_0x7bdd('0x7e')){_0x4c7021[_0x7bdd('0x4b')]('i.'+_0x10d48c+'\x20IS\x20NULL');}else{_0x4c7021['where']('i.'+_0x10d48c+_0x7bdd('0x7f'),_0x1fbe55[_0x7bdd('0x41')][_0x10d48c]);}}});}if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x80')]){if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x80')]==0x1){_0x4c7021[_0x7bdd('0x63')](_0x7bdd('0x81'));}else{_0x4c7021[_0x7bdd('0x63')](_0x7bdd('0x82'));}}if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x83')]){_0x36c5bd=_['isArray'](_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x83')])?_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x83')]:new Array(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x83')]);_0x36c5bd[_0x7bdd('0x33')](function(_0x32b60f){_0x4f3b49['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32b60f+',%');});}if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x84')]){var _0x2a006a=_0x1fbe55['query'][_0x7bdd('0x84')]['replace']('\x5c','\x5c\x5c')[_0x7bdd('0x85')](/'/g,'\x27\x27');if(qs[_0x7bdd('0x86')](_0x2a006a)){_0x202f8e['or'](_0x7bdd('0x87'),_0x2a006a+'%');}else{_0x202f8e['or'](_0x7bdd('0x88'),qs['getFullTextValue'](_0x2a006a))['or']('i.from\x20LIKE\x20?',_0x2a006a+'%')['or'](_0x7bdd('0x89'),_0x2a006a+'%');}}}_0x4c7021[_0x7bdd('0x4b')](_0x202f8e);_0x4c7021[_0x7bdd('0x8a')]('i.id');var _0x15e87e={'type':db[_0x7bdd('0x8b')][_0x7bdd('0x8c')][_0x7bdd('0x8d')],'raw':!![]};var _0x117ae0=_0x4c7021[_0x7bdd('0x8e')]();_0x117ae0[_0x7bdd('0x4e')]('i.id');_0x117ae0[_0x7bdd('0x4e')](_0x7bdd('0x8f'),_0x7bdd('0x61'));if(_0x542688['order']){_0x542688[_0x7bdd('0x49')][_0x7bdd('0x33')](function(_0x678ea3){var _0x595aec=_0x678ea3[0x0]===_0x7bdd('0x90')?_0x678ea3[0x0]:'i.'+_0x678ea3[0x0];_0x4c7021[_0x7bdd('0x49')](_0x595aec,_0x678ea3[0x1]===_0x7bdd('0x91')?![]:!![]);});}if(!_[_0x7bdd('0x76')](_0x36c5bd)){_0x4c7021[_0x7bdd('0x63')](_0x4f3b49);_0x117ae0['where']('t.id\x20IN\x20?',_0x36c5bd);}BPromise[_0x7bdd('0x92')]()[_0x7bdd('0x28')](function(){if(!_0x35ce8a){if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x77')])return;_0x117ae0[_0x7bdd('0x4b')](_0x7bdd('0x93'));_0x4c7021[_0x7bdd('0x4b')](_0x7bdd('0x93'));return;}if(_0x1fbe55[_0x7bdd('0x94')]['role']!==_0x7bdd('0x95'))return;return _0x1fbe55[_0x7bdd('0x94')][_0x7bdd('0x96')]({'attributes':['id'],'raw':!![]})[_0x7bdd('0x28')](function(_0x4a4da8){if(_[_0x7bdd('0x76')](_0x4a4da8)){_0x117ae0[_0x7bdd('0x4b')](_0x7bdd('0x97'));_0x4c7021['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x117ae0['where'](_0x7bdd('0x78'),_[_0x7bdd('0x2e')](_0x4a4da8,'id'));_0x4c7021[_0x7bdd('0x4b')](_0x7bdd('0x78'),_[_0x7bdd('0x2e')](_0x4a4da8,'id'));}});})['then'](function(){if(_0x1fbe55[_0x7bdd('0x94')]['role']===_0x7bdd('0x95')&&!_0x35ce8a&&!_0x1fbe55['query'][_0x7bdd('0x77')])return[];return db[_0x7bdd('0x98')][_0x7bdd('0x41')](_0x117ae0[_0x7bdd('0x99')](),_0x15e87e);})[_0x7bdd('0x28')](function(_0x52f27a){_0x55ce7a[_0x7bdd('0x22')]=_0x52f27a['length'];if(_0x55ce7a[_0x7bdd('0x22')]===0x0)return[];return db[_0x7bdd('0x98')][_0x7bdd('0x41')](_0x286429['toString'](),_0x15e87e)[_0x7bdd('0x28')](function(_0x3552cb){_0x3e16fc=_['keyBy'](_0x3552cb,'id');_0x15e87e=_[_0x7bdd('0x9a')](_0x15e87e,{'model':db[_0x7bdd('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1fbe55[_0x7bdd('0x41')][_0x7bdd('0x46')]){_0x542688['attributes']['forEach'](function(_0x448fcc){_0x4c7021['field']('i.'+_0x448fcc);});}else{_0x4c7021[_0x7bdd('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0x9b'),_0x7bdd('0x9c'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0x9d'),'Account.mandatoryDisposition');_0x4c7021['field'](_0x7bdd('0x9e'),_0x7bdd('0x90'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0x9f'));_0x4c7021['field'](_0x7bdd('0xa0'),_0x7bdd('0xa1'));_0x4c7021[_0x7bdd('0x4e')]('c.lastName',_0x7bdd('0xa2'));_0x4c7021['field']('c.email',_0x7bdd('0xa3'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xa4'),_0x7bdd('0xa5'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xa6'),_0x7bdd('0xa7'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xa8'),_0x7bdd('0xa9'));_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xaa'),'Owner.fullname');_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xab'),'Owner.internal');_0x4c7021[_0x7bdd('0x4e')](_0x7bdd('0xac'),'TagIds');}if(_0x542688['limit'])_0x4c7021[_0x7bdd('0x21')](_0x542688[_0x7bdd('0x21')]);if(_0x542688['offset'])_0x4c7021['offset'](_0x542688['offset']);return db[_0x7bdd('0x98')]['query'](_0x4c7021['toString'](),_0x15e87e);})[_0x7bdd('0x28')](function(_0x15418d){if(_0x15418d['length']>0x0)_0x543aa3[_0x7bdd('0x4b')](_0x7bdd('0xad'),_[_0x7bdd('0x2e')](_0x15418d,'id'));return db['sequelize'][_0x7bdd('0x41')](_0x543aa3[_0x7bdd('0x99')](),_0x15e87e)[_0x7bdd('0x28')](function(_0x484997){var _0x570a90=_['groupBy'](_0x484997,_0x7bdd('0xae'));var _0x3bd7b8=[];_0x15418d['forEach'](function(_0x1cb6b4){_0x3bd7b8[_0x7bdd('0x34')](updateOpenchannelInteraction(_0x1cb6b4,_0x3e16fc,_0x570a90));});return BPromise[_0x7bdd('0xaf')](_0x3bd7b8);});});})[_0x7bdd('0x28')](function(_0x2c2e7d){_0x55ce7a[_0x7bdd('0xb0')]=_0x2c2e7d;return _0x55ce7a;})[_0x7bdd('0x28')](respondWithFilteredResult(_0x28d4d3,_0x542688))['catch'](handleError(_0x28d4d3,null));};exports['show']=function(_0x23a03a,_0x1d7fb6){var _0x12449d={};if(_0x23a03a['query'][_0x7bdd('0x3e')]&&_0x23a03a[_0x7bdd('0x41')][_0x7bdd('0x3e')]===_0x7bdd('0x4f')){_0x12449d[_0x7bdd('0x4f')]=_0x23a03a[_0x7bdd('0xb1')]['id'];}else{_0x12449d['id']=_0x23a03a[_0x7bdd('0xb1')]['id'];}var _0x4ced28={'raw':![],'where':_0x12449d},_0x3fdd51={};_0x3fdd51[_0x7bdd('0x40')]=_[_0x7bdd('0x42')](db['OpenchannelInteraction'][_0x7bdd('0xb2')]);_0x3fdd51[_0x7bdd('0x41')]=_[_0x7bdd('0x42')](_0x23a03a[_0x7bdd('0x41')]);_0x3fdd51['filters']=_['intersection'](_0x3fdd51[_0x7bdd('0x40')],_0x3fdd51['query']);_0x4ced28[_0x7bdd('0x45')]=_['intersection'](_0x3fdd51['model'],qs[_0x7bdd('0x46')](_0x23a03a['query'][_0x7bdd('0x46')]));_0x4ced28[_0x7bdd('0x45')]=_0x4ced28[_0x7bdd('0x45')]['length']?_0x4ced28[_0x7bdd('0x45')]:_0x3fdd51[_0x7bdd('0x40')];if(_0x23a03a[_0x7bdd('0x41')][_0x7bdd('0xb3')]){_0x4ced28[_0x7bdd('0xb4')]=[{'all':!![]}];}_0x4ced28=_[_0x7bdd('0x9a')]({},_0x4ced28,_0x23a03a[_0x7bdd('0xb5')]);return db['OpenchannelInteraction']['find'](_0x4ced28)[_0x7bdd('0x28')](handleEntityNotFound(_0x1d7fb6,null))[_0x7bdd('0x28')](respondWithResult(_0x1d7fb6,null))[_0x7bdd('0x35')](handleError(_0x1d7fb6,null));};exports[_0x7bdd('0xb6')]=function(_0x479e0a,_0x2e7e34){return db['OpenchannelInteraction'][_0x7bdd('0xb6')](_0x479e0a[_0x7bdd('0x73')],{})['then'](respondWithResult(_0x2e7e34,0xc9))['catch'](handleError(_0x2e7e34,null));};exports[_0x7bdd('0x27')]=function(_0x3537b5,_0xe63f21){if(_0x3537b5[_0x7bdd('0x73')]['id']){delete _0x3537b5['body']['id'];}return db[_0x7bdd('0x3c')][_0x7bdd('0x60')]({'where':{'id':_0x3537b5['params']['id']}})[_0x7bdd('0x28')](handleEntityNotFound(_0xe63f21,null))[_0x7bdd('0x28')](saveUpdates(_0x3537b5[_0x7bdd('0x73')],null))[_0x7bdd('0x28')](respondWithResult(_0xe63f21,null))[_0x7bdd('0x35')](handleError(_0xe63f21,null));};exports['destroy']=function(_0x182c98,_0x268347){return db[_0x7bdd('0x3c')][_0x7bdd('0x60')]({'where':{'id':_0x182c98['params']['id']}})[_0x7bdd('0x28')](handleEntityNotFound(_0x268347,null))[_0x7bdd('0x28')](removeEntity(_0x268347,null))[_0x7bdd('0x35')](handleError(_0x268347,null));};exports[_0x7bdd('0xb7')]=function(_0x42c9e2,_0xc38edf){return db[_0x7bdd('0x3c')]['describe']()['then'](respondWithResult(_0xc38edf,null))[_0x7bdd('0x35')](handleError(_0xc38edf,null));};exports[_0x7bdd('0xb8')]=function(_0x3725a3,_0x149677,_0x425e12){return db[_0x7bdd('0xb9')]['find']({'where':{'id':_0x3725a3['params']['id']}})[_0x7bdd('0x28')](handleEntityNotFound(_0x149677,null))[_0x7bdd('0x28')](function(_0x119ac7){if(_0x119ac7){return _0x119ac7[_0x7bdd('0xb8')](_0x3725a3[_0x7bdd('0x73')]['ids'],_[_0x7bdd('0xba')](_0x3725a3['body'],[_0x7bdd('0xbb'),'id'])||{});}})[_0x7bdd('0x28')](respondWithResult(_0x149677,null))[_0x7bdd('0x35')](handleError(_0x149677,null));};exports[_0x7bdd('0xbc')]=function(_0x253da2,_0x3ebd52,_0x87fd6){var _0x53900a={'raw':![],'where':{}};var _0x291d0a={};var _0x36c9ba={'count':0x0,'rows':[]};return db[_0x7bdd('0x3c')][_0x7bdd('0xbd')]({'where':{'id':_0x253da2[_0x7bdd('0xb1')]['id']}})[_0x7bdd('0x28')](handleEntityNotFound(_0x3ebd52,null))[_0x7bdd('0x28')](function(_0x566916){if(_0x566916){_0x291d0a[_0x7bdd('0x40')]=_[_0x7bdd('0x42')](db[_0x7bdd('0xb9')][_0x7bdd('0xb2')]);_0x291d0a[_0x7bdd('0x41')]=_[_0x7bdd('0x42')](_0x253da2[_0x7bdd('0x41')]);_0x291d0a['filters']=_[_0x7bdd('0x44')](_0x291d0a['model'],_0x291d0a[_0x7bdd('0x41')]);_0x53900a[_0x7bdd('0x45')]=_[_0x7bdd('0x44')](_0x291d0a[_0x7bdd('0x40')],qs[_0x7bdd('0x46')](_0x253da2[_0x7bdd('0x41')][_0x7bdd('0x46')]));_0x53900a['attributes']=_0x53900a[_0x7bdd('0x45')][_0x7bdd('0x5f')]?_0x53900a[_0x7bdd('0x45')]:_0x291d0a[_0x7bdd('0x40')];if(!_0x253da2[_0x7bdd('0x41')][_0x7bdd('0x47')]('nolimit')){_0x53900a[_0x7bdd('0x21')]=qs[_0x7bdd('0x21')](_0x253da2[_0x7bdd('0x41')][_0x7bdd('0x21')]);_0x53900a[_0x7bdd('0x1f')]=qs[_0x7bdd('0x1f')](_0x253da2[_0x7bdd('0x41')][_0x7bdd('0x1f')]);}_0x53900a[_0x7bdd('0x49')]=qs[_0x7bdd('0x4a')](_0x253da2[_0x7bdd('0x41')][_0x7bdd('0x4a')]);_0x53900a[_0x7bdd('0x4b')]=qs[_0x7bdd('0x43')](_['pick'](_0x253da2[_0x7bdd('0x41')],_0x291d0a[_0x7bdd('0x43')]));_0x53900a[_0x7bdd('0x4b')]['OpenchannelInteractionId']=_0x566916['id'];if(_0x253da2[_0x7bdd('0x41')]['filter']){_0x53900a['where']=_[_0x7bdd('0x9a')](_0x53900a[_0x7bdd('0x4b')],{'$or':_[_0x7bdd('0x2e')](_0x53900a[_0x7bdd('0x45')],function(_0x128be8){var _0x47a38e={};_0x47a38e[_0x128be8]={'$like':'%'+_0x253da2[_0x7bdd('0x41')]['filter']+'%'};return _0x47a38e;})});}if(_0x253da2[_0x7bdd('0x41')][_0x7bdd('0xbe')]){var _0x2270a1=_0x253da2[_0x7bdd('0x41')]['$gte'][_0x7bdd('0x32')](',');var _0x44caae={};_0x44caae[_0x2270a1[0x0]]={'$gte':moment(_0x2270a1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x53900a[_0x7bdd('0x4b')]=_[_0x7bdd('0x9a')](_0x53900a['where'],_0x44caae);}_0x53900a=_[_0x7bdd('0x9a')]({},_0x53900a,_0x253da2[_0x7bdd('0xb5')]);return db['OpenchannelMessage']['count']({'where':_0x53900a[_0x7bdd('0x4b')]})[_0x7bdd('0x28')](function(_0x8898a0){_0x36c9ba[_0x7bdd('0x22')]=_0x8898a0;if(_0x253da2[_0x7bdd('0x41')][_0x7bdd('0xb3')]){_0x53900a['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7bdd('0xbf')](_0x53900a);})[_0x7bdd('0x28')](function(_0x5f54e4){_0x36c9ba['rows']=_0x5f54e4;return _0x36c9ba;});}})[_0x7bdd('0x28')](respondWithFilteredResult(_0x3ebd52,_0x53900a))['catch'](handleError(_0x3ebd52,null));};exports[_0x7bdd('0xc0')]=function(_0x15c48a,_0x1412e4,_0x254fa2){return db['OpenchannelInteraction']['find']({'where':{'id':_0x15c48a[_0x7bdd('0xb1')]['id']}})[_0x7bdd('0x28')](handleEntityNotFound(_0x1412e4,null))[_0x7bdd('0x28')](function(_0x40eda1){if(_0x40eda1){return _0x40eda1[_0x7bdd('0xc1')](_0x15c48a['body']['ids'],_['omit'](_0x15c48a[_0x7bdd('0x73')],[_0x7bdd('0xbb'),'id'])||{})['spread'](function(){return db[_0x7bdd('0x6f')]['findAll']({'attributes':['id',_0x7bdd('0x2b'),_0x7bdd('0xc2')],'where':{'id':_0x15c48a['body'][_0x7bdd('0xbb')]}});})[_0x7bdd('0x28')](function(_0x49f02f){socket[_0x7bdd('0xc3')](_0x7bdd('0xc4'),{'id':Number(_0x15c48a[_0x7bdd('0xb1')]['id']),'tags':_0x49f02f||[]});return{'id':Number(_0x15c48a[_0x7bdd('0xb1')]['id']),'tags':_0x49f02f||[]};});}})[_0x7bdd('0x28')](respondWithResult(_0x1412e4,null))[_0x7bdd('0x35')](handleError(_0x1412e4,null));};exports[_0x7bdd('0xc5')]=function(_0x365356,_0x4daf3a,_0x247fa3){return db[_0x7bdd('0x3c')][_0x7bdd('0x60')]({'where':{'id':_0x365356[_0x7bdd('0xb1')]['id']}})['then'](handleEntityNotFound(_0x4daf3a,null))[_0x7bdd('0x28')](function(_0x48ea6d){if(_0x48ea6d){return _0x48ea6d[_0x7bdd('0xc5')](_0x365356[_0x7bdd('0x41')][_0x7bdd('0xbb')]);}})[_0x7bdd('0x28')](respondWithStatusCode(_0x4daf3a,null))['catch'](handleError(_0x4daf3a,null));};exports[_0x7bdd('0xc6')]=function(_0x547b08,_0x5aaf79){var _0x25f52=moment()[_0x7bdd('0xc7')]()[_0x7bdd('0x99')]();var _0x43c007=path[_0x7bdd('0xc8')](config[_0x7bdd('0xc9')],_0x7bdd('0xca'),'files',_0x7bdd('0xcb'));var _0x5180e4=path[_0x7bdd('0xc8')](config[_0x7bdd('0xc9')],'server',_0x7bdd('0xcc'),_0x7bdd('0xcd'));var _0x3a27f3=path[_0x7bdd('0xc8')](_0x43c007,_0x25f52);var _0x30803c=util[_0x7bdd('0xce')](_0x7bdd('0xcf'),_0x547b08[_0x7bdd('0xb1')]['id'],_0x25f52);var _0x31c62b=path[_0x7bdd('0xc8')](_0x43c007,_0x30803c);var _0x42ea3a=[];_0x42ea3a[_0x7bdd('0x34')]({'model':db[_0x7bdd('0xd0')],'as':_0x7bdd('0xd0'),'attributes':['id',_0x7bdd('0x2f')],'raw':!![]});_0x42ea3a[_0x7bdd('0x34')]({'model':db[_0x7bdd('0xd1')],'as':_0x7bdd('0x66'),'attributes':['id','firstName',_0x7bdd('0xd2')],'raw':!![]});if(_0x547b08[_0x7bdd('0x41')]['attachments']){_0x42ea3a[_0x7bdd('0x34')]({'model':db[_0x7bdd('0xd3')],'as':_0x7bdd('0xd3'),'raw':!![]});}var _0x1f44bc=[{'model':db['OpenchannelMessage'],'as':_0x7bdd('0xd4'),'attributes':['id',_0x7bdd('0x73'),_0x7bdd('0x7a'),_0x7bdd('0xd5'),_0x7bdd('0xd6'),_0x7bdd('0x80')],'include':_0x42ea3a}];_0x1f44bc['push']({'model':db[_0x7bdd('0xd7')],'as':'Account','attributes':['id',_0x7bdd('0x2b')]});_0x1f44bc[_0x7bdd('0x34')]({'model':db[_0x7bdd('0xd0')],'as':_0x7bdd('0xd8'),'attributes':['id',_0x7bdd('0x2f')]});return db[_0x7bdd('0x3c')][_0x7bdd('0x60')]({'where':{'id':_0x547b08['params']['id']},'include':_0x1f44bc})['then'](handleEntityNotFound(_0x5aaf79,null))['then'](function(_0x205dcf){if(_0x205dcf){var _0x45944e=_0x205dcf['get']({'plain':!![]});fs[_0x7bdd('0xd9')](_0x3a27f3);var _0x4d7ade={'channel':_0x7bdd('0xda'),'account':_0x45944e['Account'][_0x7bdd('0x2b')],'agent':_0x45944e[_0x7bdd('0xd8')]?_0x45944e['Owner'][_0x7bdd('0x2f')]:_0x7bdd('0xdb'),'createdAt':moment(_0x45944e[_0x7bdd('0x7a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7bdd('0x99')](),'closedAt':_0x45944e[_0x7bdd('0x39')]?moment(_0x45944e[_0x7bdd('0xdc')])[_0x7bdd('0xce')](_0x7bdd('0xdd'))['toString']():'','disposition':_0x45944e[_0x7bdd('0xde')],'visibility':_0x45944e[_0x7bdd('0xdf')]?_0x7bdd('0xe0'):'Private','messages':_(_0x45944e['Messages'])[_0x7bdd('0x84')]({'secret':![]})[_0x7bdd('0x2e')](function(_0x4bc72f){if(_0x4bc72f[_0x7bdd('0xd3')]){var _0x16b36d=path[_0x7bdd('0xc8')](_0x5180e4,_0x4bc72f[_0x7bdd('0xd3')][_0x7bdd('0xe1')]);if(fs[_0x7bdd('0xe2')](_0x16b36d)){fs[_0x7bdd('0xe3')](_0x16b36d)[_0x7bdd('0xe4')](fs[_0x7bdd('0xe5')](path[_0x7bdd('0xc8')](_0x3a27f3,_0x4bc72f[_0x7bdd('0xd3')][_0x7bdd('0xe1')])));}}return{'date':moment(_0x4bc72f[_0x7bdd('0x7a')])[_0x7bdd('0xce')](_0x7bdd('0xdd'))['toString'](),'sender':_0x4bc72f[_0x7bdd('0xd5')]===_0x7bdd('0xe6')?_0x4bc72f['User']?_0x4bc72f['User'][_0x7bdd('0x2f')]:_0x7bdd('0xe7'):_0x4bc72f['Contact'][_0x7bdd('0xe8')]+(_0x4bc72f['Contact'][_0x7bdd('0xd2')]?'\x20'+_0x4bc72f[_0x7bdd('0x66')][_0x7bdd('0xd2')]:''),'body':_0x4bc72f[_0x7bdd('0xd3')]?_0x4bc72f['Attachment'][_0x7bdd('0xe1')]:_0x4bc72f[_0x7bdd('0x73')],'direction':_0x4bc72f[_0x7bdd('0xd5')]==='out'?'A':'C','secret':_0x4bc72f[_0x7bdd('0xd6')],'read':_0x4bc72f[_0x7bdd('0x80')],'attachment':_0x4bc72f[_0x7bdd('0xd3')]};})[_0x7bdd('0x62')]()};return ejs['renderFile'](path[_0x7bdd('0xc8')](config[_0x7bdd('0xc9')],_0x7bdd('0xca'),_0x7bdd('0xe9'),_0x7bdd('0xea')),{'interaction':_0x4d7ade})[_0x7bdd('0x28')](function(_0x2fbc78){var _0x4e031b=path[_0x7bdd('0xc8')](_0x3a27f3,_0x7bdd('0xeb')+_0x45944e['id']+'-'+_0x25f52+_0x7bdd('0xec'));var _0x17ba99={'path':_0x4e031b,'channel':_0x7bdd('0xda'),'interactionId':_0x45944e['id']};return pdf[_0x7bdd('0xed')](_0x2fbc78,_0x17ba99);})['then'](function(){return new BPromise(function(_0x119284,_0x453539){zipdir(_0x3a27f3,{'saveTo':_0x31c62b},function(_0x5e446d,_0x178019){if(_0x5e446d)return _0x453539(_0x5e446d);return _0x119284(_0x178019);});})[_0x7bdd('0x28')](function(){return new BPromise(function(_0x38bbf7,_0x47e4fd){rimraf(_0x3a27f3,function(_0xdc4d90){if(_0xdc4d90)_0x47e4fd(_0xdc4d90);return _0x38bbf7();});});})[_0x7bdd('0x28')](function(){return _0x5aaf79['download'](_0x31c62b,_0x30803c,function(_0x3998c5){if(_0x3998c5){console['log'](_0x7bdd('0xee'),_0x3998c5);}else{fs['unlinkSync'](_0x31c62b);}});});});}else{return _0x5aaf79[_0x7bdd('0x1b')](0xc8);}})['catch'](handleError(_0x5aaf79,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3509766..7c9c62d 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 _0x46ec=['findAll','unreadMessages','length','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x46ec,0x1a7));var _0xc46e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x46ec[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xc46e('0x0'))['db'][_0xc46e('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc46e('0x2')](0x0);var events={'afterCreate':_0xc46e('0x3'),'afterUpdate':_0xc46e('0x4'),'afterDestroy':_0xc46e('0x5')};function emitEvent(_0x190fe3){return function(_0x4a85e5,_0x158afc,_0x1ce4a0){_0x4a85e5[_0xc46e('0x6')]({'attributes':['id'],'raw':!![]})[_0xc46e('0x7')](function(_0x179af9){_0x4a85e5[_0xc46e('0x8')]('Users',_0x179af9['map'](function(_0x2469c3){return{'id':_0x2469c3['id']};}));return OpenchannelMessage[_0xc46e('0x9')]({'where':{'OpenchannelInteractionId':_0x4a85e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc46e('0x7')](function(_0x17dc62){_0x4a85e5['setDataValue'](_0xc46e('0xa'),_0x17dc62[_0xc46e('0xb')]);OpenchannelInteractionEvents['emit'](_0x190fe3+':'+_0x4a85e5['id'],_0x4a85e5);OpenchannelInteractionEvents['emit'](_0x190fe3,_0x4a85e5);_0x1ce4a0(null);})[_0xc46e('0xc')](_0x1ce4a0(null));};}for(var e in events){if(events[_0xc46e('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xc46e('0xe')](e,emitEvent(event));}}module[_0xc46e('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8f69=['setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x72129f,_0x3d52e2){var _0xc0c836=function(_0xd26a50){while(--_0xd26a50){_0x72129f['push'](_0x72129f['shift']());}};_0xc0c836(++_0x3d52e2);}(_0x8f69,0x6c));var _0x98f6=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x8f69[_0x283127];return _0x43da5d;};'use strict';var EventEmitter=require(_0x98f6('0x0'));var OpenchannelInteraction=require(_0x98f6('0x1'))['db'][_0x98f6('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x98f6('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x98f6('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x98f6('0x5')};function emitEvent(_0x429e53){return function(_0x4419c0,_0x57cfe5,_0xa1a883){_0x4419c0[_0x98f6('0x6')]({'attributes':['id'],'raw':!![]})[_0x98f6('0x7')](function(_0x2476ff){_0x4419c0[_0x98f6('0x8')](_0x98f6('0x9'),_0x2476ff[_0x98f6('0xa')](function(_0x50bf4e){return{'id':_0x50bf4e['id']};}));return OpenchannelMessage[_0x98f6('0xb')]({'where':{'OpenchannelInteractionId':_0x4419c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x98f6('0x7')](function(_0x3b18a9){_0x4419c0[_0x98f6('0x8')]('unreadMessages',_0x3b18a9[_0x98f6('0xc')]);OpenchannelInteractionEvents['emit'](_0x429e53+':'+_0x4419c0['id'],_0x4419c0);OpenchannelInteractionEvents[_0x98f6('0xd')](_0x429e53,_0x4419c0);_0xa1a883(null);})[_0x98f6('0xe')](_0xa1a883(null));};}for(var e in events){if(events[_0x98f6('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3efbc46..7743261 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 _0xd089=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x2ac691,_0x4ada84){var _0x29eb24=function(_0x5aa289){while(--_0x5aa289){_0x2ac691['push'](_0x2ac691['shift']());}};_0x29eb24(++_0x4ada84);}(_0xd089,0x167));var _0x9d08=function(_0x1d257c,_0x97df2b){_0x1d257c=_0x1d257c-0x0;var _0x595d51=_0xd089[_0x1d257c];return _0x595d51;};'use strict';var _=require('lodash');var util=require(_0x9d08('0x0'));var logger=require(_0x9d08('0x1'))(_0x9d08('0x2'));var moment=require(_0x9d08('0x3'));var BPromise=require(_0x9d08('0x4'));var rp=require(_0x9d08('0x5'));var fs=require('fs');var path=require(_0x9d08('0x6'));var rimraf=require(_0x9d08('0x7'));var config=require(_0x9d08('0x8'));var attributes=require(_0x9d08('0x9'));module['exports']=function(_0xcce2ce,_0x57c5e5){return _0xcce2ce['define'](_0x9d08('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d08('0xb'),'collate':_0x9d08('0xc'),'hooks':{'beforeUpdate':function(_0x3f4afd,_0xacbc61,_0x107528){if(_0x3f4afd[_0x9d08('0xd')](_0x9d08('0xe'))){_0x3f4afd[_0x9d08('0xf')]=moment()[_0x9d08('0x10')](_0x9d08('0x11'));}_0x107528(null,_0x3f4afd);}}});}; \ No newline at end of file +var _0x7636=['format','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x3a9468,_0x2b6266){var _0x1d2345=function(_0x499728){while(--_0x499728){_0x3a9468['push'](_0x3a9468['shift']());}};_0x1d2345(++_0x2b6266);}(_0x7636,0x1e1));var _0x6763=function(_0x5bb9ac,_0x417c09){_0x5bb9ac=_0x5bb9ac-0x0;var _0x38fd65=_0x7636[_0x5bb9ac];return _0x38fd65;};'use strict';var _=require(_0x6763('0x0'));var util=require('util');var logger=require(_0x6763('0x1'))('api');var moment=require(_0x6763('0x2'));var BPromise=require(_0x6763('0x3'));var rp=require(_0x6763('0x4'));var fs=require('fs');var path=require(_0x6763('0x5'));var rimraf=require('rimraf');var config=require(_0x6763('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x6763('0x7')]=function(_0x3b94b5,_0x3ffafb){return _0x3b94b5[_0x6763('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6763('0x9'),'collate':_0x6763('0xa'),'hooks':{'beforeUpdate':function(_0x4be813,_0x4cbaa7,_0x5f5243){if(_0x4be813[_0x6763('0xb')](_0x6763('0xc'))){_0x4be813[_0x6763('0xd')]=moment()[_0x6763('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f5243(null,_0x4be813);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d739c33..3c57926 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 _0x0e20=['then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0e20,0x1a9));var _0x00e2=function(_0x231ee4,_0x207068){_0x231ee4=_0x231ee4-0x0;var _0x360a0e=_0x0e20[_0x231ee4];return _0x360a0e;};'use strict';var _=require('lodash');var util=require(_0x00e2('0x0'));var moment=require(_0x00e2('0x1'));var BPromise=require(_0x00e2('0x2'));var rs=require(_0x00e2('0x3'));var fs=require('fs');var Redis=require(_0x00e2('0x4'));var db=require(_0x00e2('0x5'))['db'];var utils=require(_0x00e2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x00e2('0x7'));var jayson=require(_0x00e2('0x8'));var client=jayson[_0x00e2('0x9')][_0x00e2('0xa')]({'port':0x232a});config[_0x00e2('0xb')]=_['defaults'](config[_0x00e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x00e2('0xc'))(new Redis(config[_0x00e2('0xb')]));require('./openchannelInteraction.socket')[_0x00e2('0xd')](socket);function respondWithRpcPromise(_0x506896,_0x245d61,_0xa199bd){return new BPromise(function(_0xd9e447,_0x3c12f9){return client[_0x00e2('0xe')](_0x506896,_0xa199bd)[_0x00e2('0xf')](function(_0x3093a2){logger[_0x00e2('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x245d61,'request\x20sent');logger[_0x00e2('0x11')](_0x00e2('0x12'),_0x245d61,_0x00e2('0x13'),JSON[_0x00e2('0x14')](_0x3093a2));if(_0x3093a2[_0x00e2('0x15')]){if(_0x3093a2[_0x00e2('0x15')][_0x00e2('0x16')]===0x1f4){logger[_0x00e2('0x15')](_0x00e2('0x17'),_0x245d61,_0x3093a2['error'][_0x00e2('0x18')]);return _0x3c12f9(_0x3093a2[_0x00e2('0x15')][_0x00e2('0x18')]);}logger[_0x00e2('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x245d61,_0x3093a2[_0x00e2('0x15')][_0x00e2('0x18')]);return _0xd9e447(_0x3093a2[_0x00e2('0x15')]['message']);}else{logger[_0x00e2('0x10')](_0x00e2('0x17'),_0x245d61,_0x00e2('0x13'));_0xd9e447(_0x3093a2[_0x00e2('0x19')][_0x00e2('0x18')]);}})[_0x00e2('0x1a')](function(_0x49c6bb){logger[_0x00e2('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x245d61,_0x49c6bb);_0x3c12f9(_0x49c6bb);});});}exports[_0x00e2('0x1b')]=function(_0x4dce83){var _0x4e9417=this;return new Promise(function(_0x4c7823,_0xb42237){return db['OpenchannelInteraction'][_0x00e2('0x1c')](_0x4dce83[_0x00e2('0x1d')],{'raw':_0x4dce83['options']?_0x4dce83[_0x00e2('0x1e')][_0x00e2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dce83[_0x00e2('0x1e')]?_0x4dce83[_0x00e2('0x1e')][_0x00e2('0x20')]||null:null,'attributes':_0x4dce83[_0x00e2('0x1e')]?_0x4dce83[_0x00e2('0x1e')][_0x00e2('0x21')]||null:null,'limit':_0x4dce83[_0x00e2('0x1e')]?_0x4dce83[_0x00e2('0x1e')][_0x00e2('0x22')]||null:null})['then'](function(_0x5799ee){logger[_0x00e2('0x10')]('UpdateOpenchannelInteraction',_0x4dce83);logger[_0x00e2('0x11')](_0x00e2('0x1b'),_0x4dce83,JSON[_0x00e2('0x14')](_0x5799ee));_0x4c7823(_0x5799ee);})[_0x00e2('0x1a')](function(_0x3040de){logger[_0x00e2('0x15')](_0x00e2('0x1b'),_0x3040de[_0x00e2('0x18')],_0x4dce83);_0xb42237(_0x4e9417[_0x00e2('0x15')](0x1f4,_0x3040de[_0x00e2('0x18')]));});});};exports[_0x00e2('0x23')]=function(_0x51c8e8){return new Promise(function(_0x860f24,_0x4a33d8){return db['OpenchannelInteraction'][_0x00e2('0x24')]({'where':_0x51c8e8[_0x00e2('0x1e')]?_0x51c8e8[_0x00e2('0x1e')][_0x00e2('0x20')]||null:null})[_0x00e2('0xf')](function(_0x6c05a0){if(_0x6c05a0){return _0x6c05a0[_0x00e2('0x25')](_0x51c8e8[_0x00e2('0x1d')]['ids'],_['omit'](_0x51c8e8[_0x00e2('0x1d')],['ids','id'])||{});}})[_0x00e2('0x26')](function(_0x7417bb){logger[_0x00e2('0x10')]('AddTags',_0x51c8e8);logger['debug'](_0x00e2('0x27'),_0x51c8e8,JSON[_0x00e2('0x14')](_0x7417bb));_0x860f24(_0x7417bb);})['catch'](function(_0x7831af){logger[_0x00e2('0x15')](_0x00e2('0x27'),_0x7831af['message'],_0x51c8e8);_0x4a33d8(_this[_0x00e2('0x15')](0x1f4,_0x7831af[_0x00e2('0x18')]));});});}; \ No newline at end of file +var _0xca6c=['request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','stringify','catch','AddTagsToOpenchannelInteraction','find','addTags','body','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelInteraction.socket','then','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0xa7a236,_0x359a74){var _0x16d086=function(_0x51f370){while(--_0x51f370){_0xa7a236['push'](_0xa7a236['shift']());}};_0x16d086(++_0x359a74);}(_0xca6c,0xf4));var _0xcca6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xca6c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xcca6('0x0'));var moment=require(_0xcca6('0x1'));var BPromise=require(_0xcca6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcca6('0x3'));var db=require(_0xcca6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcca6('0x5'))('rpc');var config=require(_0xcca6('0x6'));var jayson=require(_0xcca6('0x7'));var client=jayson[_0xcca6('0x8')]['http']({'port':0x232a});config[_0xcca6('0x9')]=_[_0xcca6('0xa')](config[_0xcca6('0x9')],{'host':_0xcca6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcca6('0x9')]));require(_0xcca6('0xc'))['register'](socket);function respondWithRpcPromise(_0xf09338,_0x32e63b,_0x2af62f){return new BPromise(function(_0x25144e,_0x3844f9){return client['request'](_0xf09338,_0x2af62f)[_0xcca6('0xd')](function(_0xe8bf1e){logger['info'](_0xcca6('0xe'),_0x32e63b,_0xcca6('0xf'));logger[_0xcca6('0x10')](_0xcca6('0x11'),_0x32e63b,'request\x20sent',JSON['stringify'](_0xe8bf1e));if(_0xe8bf1e[_0xcca6('0x12')]){if(_0xe8bf1e[_0xcca6('0x12')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x32e63b,_0xe8bf1e[_0xcca6('0x12')]['message']);return _0x3844f9(_0xe8bf1e[_0xcca6('0x12')][_0xcca6('0x13')]);}logger[_0xcca6('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x32e63b,_0xe8bf1e['error']['message']);return _0x25144e(_0xe8bf1e[_0xcca6('0x12')][_0xcca6('0x13')]);}else{logger[_0xcca6('0x14')](_0xcca6('0xe'),_0x32e63b,_0xcca6('0xf'));_0x25144e(_0xe8bf1e[_0xcca6('0x15')][_0xcca6('0x13')]);}})['catch'](function(_0x112473){logger[_0xcca6('0x12')](_0xcca6('0xe'),_0x32e63b,_0x112473);_0x3844f9(_0x112473);});});}exports[_0xcca6('0x16')]=function(_0x3db03a){var _0x35aab0=this;return new Promise(function(_0x20b059,_0xe385d7){return db[_0xcca6('0x17')]['update'](_0x3db03a['body'],{'raw':_0x3db03a[_0xcca6('0x18')]?_0x3db03a[_0xcca6('0x18')][_0xcca6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3db03a[_0xcca6('0x18')]?_0x3db03a[_0xcca6('0x18')][_0xcca6('0x1a')]||null:null,'attributes':_0x3db03a[_0xcca6('0x18')]?_0x3db03a['options'][_0xcca6('0x1b')]||null:null,'limit':_0x3db03a[_0xcca6('0x18')]?_0x3db03a['options']['limit']||null:null})[_0xcca6('0xd')](function(_0xcbc957){logger[_0xcca6('0x14')](_0xcca6('0x16'),_0x3db03a);logger[_0xcca6('0x10')]('UpdateOpenchannelInteraction',_0x3db03a,JSON[_0xcca6('0x1c')](_0xcbc957));_0x20b059(_0xcbc957);})[_0xcca6('0x1d')](function(_0x1d2a2d){logger[_0xcca6('0x12')]('UpdateOpenchannelInteraction',_0x1d2a2d[_0xcca6('0x13')],_0x3db03a);_0xe385d7(_0x35aab0[_0xcca6('0x12')](0x1f4,_0x1d2a2d['message']));});});};exports[_0xcca6('0x1e')]=function(_0x388564){return new Promise(function(_0x2210e0,_0x1228fd){return db[_0xcca6('0x17')][_0xcca6('0x1f')]({'where':_0x388564['options']?_0x388564['options'][_0xcca6('0x1a')]||null:null})['then'](function(_0x21d4cc){if(_0x21d4cc){return _0x21d4cc[_0xcca6('0x20')](_0x388564[_0xcca6('0x21')][_0xcca6('0x22')],_['omit'](_0x388564[_0xcca6('0x21')],[_0xcca6('0x22'),'id'])||{});}})[_0xcca6('0x23')](function(_0x4b7e60){logger[_0xcca6('0x14')](_0xcca6('0x24'),_0x388564);logger['debug'](_0xcca6('0x24'),_0x388564,JSON[_0xcca6('0x1c')](_0x4b7e60));_0x2210e0(_0x4b7e60);})[_0xcca6('0x1d')](function(_0x245e87){logger[_0xcca6('0x12')](_0xcca6('0x24'),_0x245e87[_0xcca6('0x13')],_0x388564);_0x1228fd(_this[_0xcca6('0x12')](0x1f4,_0x245e87[_0xcca6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ce72d4f..02e2e26 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 _0x80f7=['update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x80f7,0x6d));var _0x780f=function(_0x58df3b,_0x182132){_0x58df3b=_0x58df3b-0x0;var _0x1c82d6=_0x80f7[_0x58df3b];return _0x1c82d6;};'use strict';var OpenchannelInteractionEvents=require(_0x780f('0x0'));var events=[_0x780f('0x1'),_0x780f('0x2'),_0x780f('0x3')];function createListener(_0xed92c1,_0x11476d){return function(_0xadad43){_0x11476d[_0x780f('0x4')](_0xed92c1,_0xadad43);};}function removeListener(_0x3a727f,_0x142af5){return function(){OpenchannelInteractionEvents[_0x780f('0x5')](_0x3a727f,_0x142af5);};}exports[_0x780f('0x6')]=function(_0x3599c2){for(var _0x1abe85=0x0,_0x19ad78=events['length'];_0x1abe85<_0x19ad78;_0x1abe85++){var _0x1063d0=events[_0x1abe85];var _0x36ebf9=createListener(_0x780f('0x7')+_0x1063d0,_0x3599c2);OpenchannelInteractionEvents['on'](_0x1063d0,_0x36ebf9);}}; \ No newline at end of file +var _0x9634=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','register','length'];(function(_0x3fdaef,_0x766e45){var _0x5716e4=function(_0x3eb7f1){while(--_0x3eb7f1){_0x3fdaef['push'](_0x3fdaef['shift']());}};_0x5716e4(++_0x766e45);}(_0x9634,0x1c8));var _0x4963=function(_0x1b407e,_0x185951){_0x1b407e=_0x1b407e-0x0;var _0x2726c7=_0x9634[_0x1b407e];return _0x2726c7;};'use strict';var OpenchannelInteractionEvents=require(_0x4963('0x0'));var events=[_0x4963('0x1'),_0x4963('0x2'),_0x4963('0x3')];function createListener(_0x2c7827,_0x40d1a8){return function(_0x47c4){_0x40d1a8['emit'](_0x2c7827,_0x47c4);};}function removeListener(_0xf7e003,_0xf73811){return function(){OpenchannelInteractionEvents['removeListener'](_0xf7e003,_0xf73811);};}exports[_0x4963('0x4')]=function(_0xdb7a31){for(var _0x1d69a7=0x0,_0x260f05=events[_0x4963('0x5')];_0x1d69a7<_0x260f05;_0x1d69a7++){var _0x4d1ff4=events[_0x1d69a7];var _0x11d957=createListener(_0x4963('0x6')+_0x4d1ff4,_0xdb7a31);OpenchannelInteractionEvents['on'](_0x4d1ff4,_0x11d957);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 599a264..35f2de4 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x1c6ebe,_0x16b450){_0x1c6ebe=_0x1c6ebe-0x0;var _0x1d38c8=_0x70e0[_0x1c6ebe];return _0x1d38c8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x4170db,_0x4637a5){var _0x1c86f2=function(_0x255414){while(--_0x255414){_0x4170db['push'](_0x4170db['shift']());}};_0x1c86f2(++_0x4637a5);}(_0xe706,0xa3));var _0x6e70=function(_0x53c506,_0x1c0fe8){_0x53c506=_0x53c506-0x0;var _0x165888=_0xe706[_0x53c506];return _0x165888;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index ceedbd1..b5d49dd 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 _0xeef7=['exports','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x35994e,_0x3968be){var _0x1dc2e=function(_0x5443ed){while(--_0x5443ed){_0x35994e['push'](_0x35994e['shift']());}};_0x1dc2e(++_0x3968be);}(_0xeef7,0x7d));var _0x7eef=function(_0x5799ea,_0x3e2e46){_0x5799ea=_0x5799ea-0x0;var _0x3f89be=_0xeef7[_0x5799ea];return _0x3f89be;};'use strict';var Sequelize=require(_0x7eef('0x0'));module[_0x7eef('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7eef('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7eef('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7eef('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7eef('0x5')]},'providerName':{'type':Sequelize[_0x7eef('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3266=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x332ac7,_0x273040){var _0x2ecdb1=function(_0x4edd9b){while(--_0x4edd9b){_0x332ac7['push'](_0x332ac7['shift']());}};_0x2ecdb1(++_0x273040);}(_0x3266,0x6a));var _0x6326=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3266[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'body':{'type':Sequelize[_0x6326('0x2')](_0x6326('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6326('0x5')]('in',_0x6326('0x6')),'defaultValue':_0x6326('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6326('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c85fa8d..65bc739 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 _0xc60b=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','create','body','catch','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit'];(function(_0x548cef,_0x956093){var _0x24a867=function(_0x2cb5b8){while(--_0x2cb5b8){_0x548cef['push'](_0x548cef['shift']());}};_0x24a867(++_0x956093);}(_0xc60b,0x150));var _0xbc60=function(_0x486303,_0x3a55a0){_0x486303=_0x486303-0x0;var _0x123b9b=_0xc60b[_0x486303];return _0x123b9b;};'use strict';var emlformat=require(_0xbc60('0x0'));var rimraf=require(_0xbc60('0x1'));var zipdir=require(_0xbc60('0x2'));var jsonpatch=require(_0xbc60('0x3'));var rp=require(_0xbc60('0x4'));var moment=require(_0xbc60('0x5'));var BPromise=require(_0xbc60('0x6'));var Mustache=require(_0xbc60('0x7'));var util=require('util');var path=require(_0xbc60('0x8'));var sox=require(_0xbc60('0x9'));var csv=require(_0xbc60('0xa'));var ejs=require(_0xbc60('0xb'));var fs=require('fs');var fs_extra=require(_0xbc60('0xc'));var _=require(_0xbc60('0xd'));var squel=require('squel');var crypto=require(_0xbc60('0xe'));var jsforce=require(_0xbc60('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc60('0x10'));var Papa=require(_0xbc60('0x11'));var Redis=require(_0xbc60('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc60('0x13'));var hardwareService=require(_0xbc60('0x14'));var logger=require(_0xbc60('0x15'))(_0xbc60('0x16'));var utils=require(_0xbc60('0x17'));var config=require(_0xbc60('0x18'));var licenseUtil=require(_0xbc60('0x19'));var db=require(_0xbc60('0x1a'))['db'];config[_0xbc60('0x1b')]=_[_0xbc60('0x1c')](config[_0xbc60('0x1b')],{'host':_0xbc60('0x1d'),'port':0x18eb});var socket=require(_0xbc60('0x1e'))(new Redis(config[_0xbc60('0x1b')]));require(_0xbc60('0x1f'))[_0xbc60('0x20')](socket);var jayson=require(_0xbc60('0x21'));var client=jayson['client'][_0xbc60('0x22')]({'port':0x232c});var client9002=jayson[_0xbc60('0x23')][_0xbc60('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4e5874,_0x4e9cb4,_0x213377,_0x2e941e){return new BPromise(function(_0xb73e60,_0x1ad6e6){var _0x5919cd=_0x2e941e||client;return _0x5919cd[_0xbc60('0x24')](_0x4e5874,_0x213377)[_0xbc60('0x25')](function(_0x49a686){logger[_0xbc60('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4e9cb4,_0xbc60('0x27'));logger[_0xbc60('0x28')](_0xbc60('0x29'),_0x4e9cb4,_0xbc60('0x27'),JSON['stringify'](_0x49a686));if(_0x49a686['error']){if(_0x49a686[_0xbc60('0x2a')][_0xbc60('0x2b')]===0x1f4){logger[_0xbc60('0x2a')](_0xbc60('0x2c'),_0x4e9cb4,_0x49a686[_0xbc60('0x2a')][_0xbc60('0x2d')]);return _0x1ad6e6(_0x49a686[_0xbc60('0x2a')][_0xbc60('0x2d')]);}logger[_0xbc60('0x2a')](_0xbc60('0x2c'),_0x4e9cb4,_0x49a686[_0xbc60('0x2a')]['message']);return _0xb73e60(_0x49a686[_0xbc60('0x2a')][_0xbc60('0x2d')]);}else{logger[_0xbc60('0x26')](_0xbc60('0x2c'),_0x4e9cb4,_0xbc60('0x27'));_0xb73e60(_0x49a686[_0xbc60('0x2e')][_0xbc60('0x2d')]);}})['catch'](function(_0x2f3a64){logger[_0xbc60('0x2a')](_0xbc60('0x2c'),_0x4e9cb4,_0x2f3a64);_0x1ad6e6(_0x2f3a64);});});}function respondWithStatusCode(_0x53b321,_0x54b925){_0x54b925=_0x54b925||0xcc;return function(_0x46e876){if(_0x46e876){return _0x53b321[_0xbc60('0x2f')](_0x54b925);}return _0x53b321[_0xbc60('0x30')](_0x54b925)[_0xbc60('0x31')]();};}function respondWithResult(_0x45f624,_0x53c7c1){_0x53c7c1=_0x53c7c1||0xc8;return function(_0x56827c){if(_0x56827c){return _0x45f624[_0xbc60('0x30')](_0x53c7c1)['json'](_0x56827c);}};}function respondWithFilteredResult(_0x36ac52,_0x5a8f9b){return function(_0x26c019){if(_0x26c019){var _0x1b088a=typeof _0x5a8f9b[_0xbc60('0x32')]===_0xbc60('0x33')&&typeof _0x5a8f9b['limit']===_0xbc60('0x33');var _0x1c984f=_0x26c019['count'];var _0x40a100=_0x1b088a?0x0:_0x5a8f9b[_0xbc60('0x32')];var _0x446582=_0x1b088a?_0x26c019[_0xbc60('0x34')]:_0x5a8f9b[_0xbc60('0x32')]+_0x5a8f9b[_0xbc60('0x35')];var _0x26755e;if(_0x446582>=_0x1c984f){_0x446582=_0x1c984f;_0x26755e=0xc8;}else{_0x26755e=0xce;}_0x36ac52[_0xbc60('0x30')](_0x26755e);return _0x36ac52[_0xbc60('0x36')]('Content-Range',_0x40a100+'-'+_0x446582+'/'+_0x1c984f)[_0xbc60('0x37')](_0x26c019);}return null;};}function patchUpdates(_0x29dec6){return function(_0x49fcfc){try{jsonpatch[_0xbc60('0x38')](_0x49fcfc,_0x29dec6,!![]);}catch(_0x47349f){return BPromise[_0xbc60('0x39')](_0x47349f);}return _0x49fcfc[_0xbc60('0x3a')]();};}function saveUpdates(_0x31fc27,_0x2d57d3){return function(_0x4d41b9){if(_0x4d41b9){return _0x4d41b9[_0xbc60('0x3b')](_0x31fc27)[_0xbc60('0x25')](function(_0x4d586b){return _0x4d586b;});}return null;};}function removeEntity(_0x252291,_0x136a48){return function(_0x134e70){if(_0x134e70){return _0x134e70[_0xbc60('0x3c')]()[_0xbc60('0x25')](function(){_0x252291[_0xbc60('0x30')](0xcc)[_0xbc60('0x31')]();});}};}function handleEntityNotFound(_0x15773b,_0x574d73){return function(_0x3d82e4){if(!_0x3d82e4){_0x15773b['sendStatus'](0x194);}return _0x3d82e4;};}function handleError(_0x16ee7c,_0xf60ad9){_0xf60ad9=_0xf60ad9||0x1f4;return function(_0x424766){logger[_0xbc60('0x2a')](_0x424766[_0xbc60('0x3d')]);if(_0x424766[_0xbc60('0x3e')]){delete _0x424766[_0xbc60('0x3e')];}_0x16ee7c[_0xbc60('0x30')](_0xf60ad9)[_0xbc60('0x3f')](_0x424766);};}exports[_0xbc60('0x40')]=function(_0x45f96b,_0x85e73e){var _0x54ad0c={},_0x3cce76={},_0x442d04={'count':0x0,'rows':[]};var _0x5e7458=_[_0xbc60('0x41')](db[_0xbc60('0x42')]['rawAttributes'],function(_0x2505f3){return{'name':_0x2505f3[_0xbc60('0x43')],'type':_0x2505f3[_0xbc60('0x44')][_0xbc60('0x45')]};});_0x3cce76['model']=_[_0xbc60('0x41')](_0x5e7458,_0xbc60('0x3e'));_0x3cce76[_0xbc60('0x46')]=_[_0xbc60('0x47')](_0x45f96b[_0xbc60('0x46')]);_0x3cce76['filters']=_[_0xbc60('0x48')](_0x3cce76[_0xbc60('0x49')],_0x3cce76['query']);_0x54ad0c['attributes']=_[_0xbc60('0x48')](_0x3cce76[_0xbc60('0x49')],qs['fields'](_0x45f96b[_0xbc60('0x46')][_0xbc60('0x4a')]));_0x54ad0c[_0xbc60('0x4b')]=_0x54ad0c['attributes'][_0xbc60('0x4c')]?_0x54ad0c[_0xbc60('0x4b')]:_0x3cce76[_0xbc60('0x49')];if(!_0x45f96b[_0xbc60('0x46')]['hasOwnProperty'](_0xbc60('0x4d'))){_0x54ad0c[_0xbc60('0x35')]=qs[_0xbc60('0x35')](_0x45f96b[_0xbc60('0x46')]['limit']);_0x54ad0c[_0xbc60('0x32')]=qs[_0xbc60('0x32')](_0x45f96b[_0xbc60('0x46')][_0xbc60('0x32')]);}_0x54ad0c[_0xbc60('0x4e')]=qs[_0xbc60('0x4f')](_0x45f96b['query'][_0xbc60('0x4f')]);_0x54ad0c[_0xbc60('0x50')]=qs[_0xbc60('0x51')](_[_0xbc60('0x52')](_0x45f96b['query'],_0x3cce76[_0xbc60('0x51')]),_0x5e7458);if(_0x45f96b['query'][_0xbc60('0x53')]){_0x54ad0c[_0xbc60('0x50')]=_[_0xbc60('0x54')](_0x54ad0c['where'],{'$or':_[_0xbc60('0x41')](_0x5e7458,function(_0x340e52){if(_0x340e52[_0xbc60('0x44')]!==_0xbc60('0x55')){var _0x2cae39={};_0x2cae39[_0x340e52[_0xbc60('0x3e')]]={'$like':'%'+_0x45f96b[_0xbc60('0x46')][_0xbc60('0x53')]+'%'};return _0x2cae39;}})});}_0x54ad0c=_[_0xbc60('0x54')]({},_0x54ad0c,_0x45f96b[_0xbc60('0x56')]);var _0x4eb1da={'where':_0x54ad0c['where']};return db[_0xbc60('0x42')][_0xbc60('0x34')](_0x4eb1da)[_0xbc60('0x25')](function(_0x16afb2){_0x442d04[_0xbc60('0x34')]=_0x16afb2;if(_0x45f96b[_0xbc60('0x46')][_0xbc60('0x57')]){_0x54ad0c[_0xbc60('0x58')]=[{'all':!![]}];}return db[_0xbc60('0x42')][_0xbc60('0x59')](_0x54ad0c);})[_0xbc60('0x25')](function(_0x2d969f){_0x442d04['rows']=_0x2d969f;return _0x442d04;})[_0xbc60('0x25')](respondWithFilteredResult(_0x85e73e,_0x54ad0c))['catch'](handleError(_0x85e73e,null));};exports['show']=function(_0x239951,_0x2e710e){var _0x52a3e7={'raw':!![],'where':{'id':_0x239951[_0xbc60('0x5a')]['id']}},_0x499caa={};_0x499caa[_0xbc60('0x49')]=_[_0xbc60('0x47')](db[_0xbc60('0x42')][_0xbc60('0x5b')]);_0x499caa[_0xbc60('0x46')]=_[_0xbc60('0x47')](_0x239951[_0xbc60('0x46')]);_0x499caa[_0xbc60('0x51')]=_[_0xbc60('0x48')](_0x499caa[_0xbc60('0x49')],_0x499caa[_0xbc60('0x46')]);_0x52a3e7['attributes']=_[_0xbc60('0x48')](_0x499caa['model'],qs[_0xbc60('0x4a')](_0x239951[_0xbc60('0x46')][_0xbc60('0x4a')]));_0x52a3e7['attributes']=_0x52a3e7[_0xbc60('0x4b')]['length']?_0x52a3e7[_0xbc60('0x4b')]:_0x499caa[_0xbc60('0x49')];if(_0x239951[_0xbc60('0x46')][_0xbc60('0x57')]){_0x52a3e7[_0xbc60('0x58')]=[{'all':!![]}];}_0x52a3e7=_[_0xbc60('0x54')]({},_0x52a3e7,_0x239951[_0xbc60('0x56')]);return db[_0xbc60('0x42')][_0xbc60('0x5c')](_0x52a3e7)[_0xbc60('0x25')](handleEntityNotFound(_0x2e710e,null))[_0xbc60('0x25')](respondWithResult(_0x2e710e,null))['catch'](handleError(_0x2e710e,null));};exports['create']=function(_0x233dca,_0x7e7943){return db['OpenchannelMessage'][_0xbc60('0x5d')](_0x233dca[_0xbc60('0x5e')],{})[_0xbc60('0x25')](respondWithResult(_0x7e7943,0xc9))[_0xbc60('0x5f')](handleError(_0x7e7943,null));};exports['update']=function(_0x4c0b94,_0x43f463){if(_0x4c0b94['body']['id']){delete _0x4c0b94[_0xbc60('0x5e')]['id'];}return db['OpenchannelMessage'][_0xbc60('0x5c')]({'where':{'id':_0x4c0b94[_0xbc60('0x5a')]['id']}})[_0xbc60('0x25')](handleEntityNotFound(_0x43f463,null))[_0xbc60('0x25')](saveUpdates(_0x4c0b94[_0xbc60('0x5e')],null))['then'](respondWithResult(_0x43f463,null))[_0xbc60('0x5f')](handleError(_0x43f463,null));};exports['destroy']=function(_0xda6e7a,_0x2cd2d6){return db[_0xbc60('0x42')][_0xbc60('0x5c')]({'where':{'id':_0xda6e7a['params']['id']}})[_0xbc60('0x25')](handleEntityNotFound(_0x2cd2d6,null))[_0xbc60('0x25')](removeEntity(_0x2cd2d6,null))[_0xbc60('0x5f')](handleError(_0x2cd2d6,null));};exports['describe']=function(_0x4f9659,_0x173022){return db[_0xbc60('0x42')]['describe']()[_0xbc60('0x25')](respondWithResult(_0x173022,null))['catch'](handleError(_0x173022,null));};var interaction_log=require(_0xbc60('0x15'))(_0xbc60('0x60'));exports[_0xbc60('0x61')]=function(_0x5d701a,_0x1a2351,_0x2a1043){var _0x1227d1={'agent':{},'channel':_0xbc60('0x62')};if(_0x5d701a[_0xbc60('0x5e')]['id']){delete _0x5d701a[_0xbc60('0x5e')]['id'];}_0x5d701a[_0xbc60('0x5e')]['read']=!![];_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x63')]=moment()[_0xbc60('0x64')](_0xbc60('0x65'));_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x66')]=_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x66')]||_0x5d701a['user']['id'];_0x1227d1[_0xbc60('0x67')]['id']=_0x5d701a['body']['UserId'];return db[_0xbc60('0x42')][_0xbc60('0x5c')]({'where':{'id':_0x5d701a[_0xbc60('0x5a')]['id'],'UserId':null}})[_0xbc60('0x25')](handleEntityNotFound(_0x1a2351,null))[_0xbc60('0x25')](saveUpdates(_0x5d701a['body'],null))[_0xbc60('0x25')](function(_0x2e8621){if(_0x2e8621){_0x1227d1[_0xbc60('0x2d')]=_0x2e8621[_0xbc60('0x68')]({'plain':!![]});return db[_0xbc60('0x69')]['find']({'where':{'id':_0x2e8621[_0xbc60('0x6a')]}});}return null;})[_0xbc60('0x25')](handleEntityNotFound(_0x1a2351,null))['then'](function(_0x362d08){if(_0x362d08){return _0x362d08[_0xbc60('0x3b')]({'UserId':_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x66')],'read1stAt':_[_0xbc60('0x6b')](_0x362d08[_0xbc60('0x6c')])?moment()['format'](_0xbc60('0x65')):undefined});}return null;})[_0xbc60('0x25')](function(_0x473a29){if(_0x473a29){_0x1227d1[_0xbc60('0x6d')]=_0x473a29[_0xbc60('0x68')]({'plain':!![]});interaction_log[_0xbc60('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d701a[_0xbc60('0x6e')]['id'],_0x5d701a[_0xbc60('0x6e')][_0xbc60('0x3e')],_0x5d701a[_0xbc60('0x6e')][_0xbc60('0x6f')],_0x1227d1[_0xbc60('0x6d')]['id'],_0x5d701a[_0xbc60('0x5e')]?JSON[_0xbc60('0x70')](_0x5d701a[_0xbc60('0x5e')]):_0xbc60('0x71'));return respondWithRpcPromise(_0xbc60('0x72'),_0xbc60('0x73'),_0x1227d1);}return null;})[_0xbc60('0x25')](function(_0x5a5c42){var _0x440844=_0xbc60('0x74')+_0x5a5c42[_0xbc60('0x2d')][_0xbc60('0x75')];return db[_0xbc60('0x76')]['query'](_0x440844,{'type':db[_0xbc60('0x77')][_0xbc60('0x78')]['SELECT'],'raw':!![]})['then'](function(_0x27b56e){return _0x27b56e;});})[_0xbc60('0x25')](function(_0x4514e4){if(_0x4514e4){_0x1227d1[_0xbc60('0x2d')][_0xbc60('0x79')]=_0x4514e4[0x0];if(!_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x66')])return;return db[_0xbc60('0x7a')][_0xbc60('0x5c')]({'where':{'id':_0x5d701a[_0xbc60('0x5e')]['UserId'],'role':_0xbc60('0x67')},'attributes':['id','name',_0xbc60('0x7b'),_0xbc60('0x7c'),_0xbc60('0x7d')],'raw':!![]});}return null;})[_0xbc60('0x25')](function(_0x33e6e2){if(!_0x33e6e2)return null;_0x1227d1[_0xbc60('0x2d')]['agent']=_0x33e6e2;return _0x1227d1;})[_0xbc60('0x25')](function(_0x91c4d1){if(_0x91c4d1){if(_0x5d701a[_0xbc60('0x5e')][_0xbc60('0x7e')]){_0x1227d1['message'][_0xbc60('0x7f')]=util[_0xbc60('0x64')](_0xbc60('0x80'),_0x5d701a[_0xbc60('0x6e')][_0xbc60('0x3e')]);_0x1227d1['message'][_0xbc60('0x81')]=_0x1227d1['channel'];_0x1227d1[_0xbc60('0x2d')][_0xbc60('0x82')]=_0x1227d1[_0xbc60('0x81')];_0x1227d1['message'][_0xbc60('0x83')]=_0xbc60('0x61');return respondWithRpcPromise(_0xbc60('0x84'),_0xbc60('0x84'),{'event':_0xbc60('0x85'),'message':_0x1227d1[_0xbc60('0x2d')]},client9002)['then'](function(){return _0x1227d1;});}return _0x1227d1;}return null;})[_0xbc60('0x25')](respondWithResult(_0x1a2351,null))['catch'](handleError(_0x1a2351,null));};var interaction_log=require('../../config/logger')(_0xbc60('0x60'));exports['reject']=function(_0x4c9af5,_0x331ebe,_0x20b308){var _0x9a8599={'agent':{},'channel':_0xbc60('0x62')};if(_0x4c9af5['body']['id']){delete _0x4c9af5[_0xbc60('0x5e')]['id'];}_0x4c9af5[_0xbc60('0x5e')][_0xbc60('0x66')]=_0x4c9af5[_0xbc60('0x5e')][_0xbc60('0x66')]||_0x4c9af5['user']['id'];_0x9a8599[_0xbc60('0x67')]['id']=_0x4c9af5[_0xbc60('0x5e')][_0xbc60('0x66')];return db[_0xbc60('0x42')][_0xbc60('0x5c')]({'where':{'id':_0x4c9af5[_0xbc60('0x5a')]['id'],'UserId':null}})[_0xbc60('0x25')](handleEntityNotFound(_0x331ebe,null))[_0xbc60('0x25')](function(_0x6c846b){if(_0x6c846b){_0x9a8599[_0xbc60('0x2d')]=_0x6c846b[_0xbc60('0x68')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x6c846b['OpenchannelInteractionId']}});}return null;})[_0xbc60('0x25')](handleEntityNotFound(_0x331ebe,null))[_0xbc60('0x25')](function(_0xea0a86){if(_0xea0a86){_0x9a8599[_0xbc60('0x6d')]=_0xea0a86[_0xbc60('0x68')]({'plain':!![]});interaction_log[_0xbc60('0x26')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c9af5[_0xbc60('0x6e')]['id'],_0x4c9af5[_0xbc60('0x6e')][_0xbc60('0x3e')],_0x4c9af5[_0xbc60('0x6e')][_0xbc60('0x6f')],_0x9a8599[_0xbc60('0x6d')]['id'],_0x4c9af5[_0xbc60('0x5e')]?JSON['stringify'](_0x4c9af5[_0xbc60('0x5e')]):_0xbc60('0x71'));return respondWithRpcPromise(_0xbc60('0x86'),_0xbc60('0x87'),_0x9a8599);}return null;})[_0xbc60('0x25')](function(_0x37d9c6){var _0x4647d7=_0xbc60('0x74')+_0x37d9c6['message'][_0xbc60('0x75')];return db[_0xbc60('0x76')][_0xbc60('0x46')](_0x4647d7,{'type':db[_0xbc60('0x77')][_0xbc60('0x78')][_0xbc60('0x88')],'raw':!![]})[_0xbc60('0x25')](function(_0x5d8312){return _0x5d8312;});})[_0xbc60('0x25')](function(_0x3c6747){if(_0x3c6747){_0x9a8599[_0xbc60('0x2d')][_0xbc60('0x79')]=_0x3c6747[0x0];if(!_0x4c9af5[_0xbc60('0x5e')][_0xbc60('0x66')])return;return db['User']['find']({'where':{'id':_0x4c9af5[_0xbc60('0x5e')][_0xbc60('0x66')],'role':_0xbc60('0x67')},'attributes':['id',_0xbc60('0x3e'),_0xbc60('0x7b'),'email',_0xbc60('0x7d')],'raw':!![]});}return null;})[_0xbc60('0x25')](function(_0x5cf2d2){if(!_0x5cf2d2)return null;_0x9a8599[_0xbc60('0x2d')][_0xbc60('0x67')]=_0x5cf2d2;return _0x9a8599;})[_0xbc60('0x25')](function(_0x1e468e){if(_0x1e468e){_0x1e468e[_0xbc60('0x2d')][_0xbc60('0x7f')]=util[_0xbc60('0x64')](_0xbc60('0x80'),_0x4c9af5[_0xbc60('0x6e')][_0xbc60('0x3e')]);_0x1e468e['message']['channel']=_0x9a8599['channel'];_0x1e468e['message'][_0xbc60('0x82')]=_0x9a8599[_0xbc60('0x81')];_0x1e468e[_0xbc60('0x2d')]['event']=_0xbc60('0x39');respondWithRpcPromise(_0xbc60('0x84'),_0xbc60('0x84'),{'event':_0xbc60('0x89'),'message':_0x1e468e[_0xbc60('0x2d')]},client9002);return _0x9a8599;}return null;})['then'](respondWithResult(_0x331ebe,null))['catch'](handleError(_0x331ebe,null));}; \ No newline at end of file +var _0xc812=['include','findAll','rows','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','fullname','email','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','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','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll'];(function(_0x4c141a,_0x414f50){var _0x1417b9=function(_0x44516d){while(--_0x44516d){_0x4c141a['push'](_0x4c141a['shift']());}};_0x1417b9(++_0x414f50);}(_0xc812,0xbc));var _0x2c81=function(_0xc429,_0x2a3789){_0xc429=_0xc429-0x0;var _0xdada44=_0xc812[_0xc429];return _0xdada44;};'use strict';var emlformat=require(_0x2c81('0x0'));var rimraf=require(_0x2c81('0x1'));var zipdir=require(_0x2c81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c81('0x3'));var moment=require(_0x2c81('0x4'));var BPromise=require(_0x2c81('0x5'));var Mustache=require(_0x2c81('0x6'));var util=require('util');var path=require(_0x2c81('0x7'));var sox=require(_0x2c81('0x8'));var csv=require('to-csv');var ejs=require(_0x2c81('0x9'));var fs=require('fs');var fs_extra=require(_0x2c81('0xa'));var _=require(_0x2c81('0xb'));var squel=require(_0x2c81('0xc'));var crypto=require(_0x2c81('0xd'));var jsforce=require(_0x2c81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2c81('0xf'));var querystring=require(_0x2c81('0x10'));var Papa=require(_0x2c81('0x11'));var Redis=require(_0x2c81('0x12'));var authService=require(_0x2c81('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2c81('0x14'));var hardwareService=require(_0x2c81('0x15'));var logger=require(_0x2c81('0x16'))(_0x2c81('0x17'));var utils=require(_0x2c81('0x18'));var config=require(_0x2c81('0x19'));var licenseUtil=require(_0x2c81('0x1a'));var db=require('../../mysqldb')['db'];config[_0x2c81('0x1b')]=_[_0x2c81('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2c81('0x1d'))(new Redis(config[_0x2c81('0x1b')]));require('./openchannelMessage.socket')[_0x2c81('0x1e')](socket);var jayson=require(_0x2c81('0x1f'));var client=jayson[_0x2c81('0x20')][_0x2c81('0x21')]({'port':0x232c});var client9002=jayson[_0x2c81('0x20')][_0x2c81('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x35c42b,_0x169c74,_0x59ff30,_0x3541ea){return new BPromise(function(_0x24c35c,_0x4791d0){var _0xa53149=_0x3541ea||client;return _0xa53149[_0x2c81('0x22')](_0x35c42b,_0x59ff30)[_0x2c81('0x23')](function(_0x381eda){logger[_0x2c81('0x24')](_0x2c81('0x25'),_0x169c74,'request\x20sent');logger[_0x2c81('0x26')](_0x2c81('0x27'),_0x169c74,_0x2c81('0x28'),JSON[_0x2c81('0x29')](_0x381eda));if(_0x381eda[_0x2c81('0x2a')]){if(_0x381eda[_0x2c81('0x2a')][_0x2c81('0x2b')]===0x1f4){logger[_0x2c81('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x169c74,_0x381eda[_0x2c81('0x2a')][_0x2c81('0x2c')]);return _0x4791d0(_0x381eda['error'][_0x2c81('0x2c')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x169c74,_0x381eda['error'][_0x2c81('0x2c')]);return _0x24c35c(_0x381eda[_0x2c81('0x2a')][_0x2c81('0x2c')]);}else{logger[_0x2c81('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x169c74,_0x2c81('0x28'));_0x24c35c(_0x381eda[_0x2c81('0x2d')][_0x2c81('0x2c')]);}})[_0x2c81('0x2e')](function(_0x309b2f){logger[_0x2c81('0x2a')](_0x2c81('0x25'),_0x169c74,_0x309b2f);_0x4791d0(_0x309b2f);});});}function respondWithStatusCode(_0x5aaf99,_0x2ca1a1){_0x2ca1a1=_0x2ca1a1||0xcc;return function(_0x171d12){if(_0x171d12){return _0x5aaf99[_0x2c81('0x2f')](_0x2ca1a1);}return _0x5aaf99[_0x2c81('0x30')](_0x2ca1a1)[_0x2c81('0x31')]();};}function respondWithResult(_0x5959ab,_0x2486fb){_0x2486fb=_0x2486fb||0xc8;return function(_0xc98e18){if(_0xc98e18){return _0x5959ab[_0x2c81('0x30')](_0x2486fb)[_0x2c81('0x32')](_0xc98e18);}};}function respondWithFilteredResult(_0x4122bc,_0x44566d){return function(_0x238e5a){if(_0x238e5a){var _0x3adf97=typeof _0x44566d[_0x2c81('0x33')]===_0x2c81('0x34')&&typeof _0x44566d[_0x2c81('0x35')]===_0x2c81('0x34');var _0x2f443f=_0x238e5a[_0x2c81('0x36')];var _0x596091=_0x3adf97?0x0:_0x44566d[_0x2c81('0x33')];var _0x12b457=_0x3adf97?_0x238e5a[_0x2c81('0x36')]:_0x44566d[_0x2c81('0x33')]+_0x44566d['limit'];var _0x1c87a9;if(_0x12b457>=_0x2f443f){_0x12b457=_0x2f443f;_0x1c87a9=0xc8;}else{_0x1c87a9=0xce;}_0x4122bc[_0x2c81('0x30')](_0x1c87a9);return _0x4122bc[_0x2c81('0x37')](_0x2c81('0x38'),_0x596091+'-'+_0x12b457+'/'+_0x2f443f)[_0x2c81('0x32')](_0x238e5a);}return null;};}function patchUpdates(_0x27d643){return function(_0x2f2f84){try{jsonpatch[_0x2c81('0x39')](_0x2f2f84,_0x27d643,!![]);}catch(_0x2b18e7){return BPromise[_0x2c81('0x3a')](_0x2b18e7);}return _0x2f2f84['save']();};}function saveUpdates(_0x54e84f,_0x3477b2){return function(_0x362d3e){if(_0x362d3e){return _0x362d3e[_0x2c81('0x3b')](_0x54e84f)[_0x2c81('0x23')](function(_0x453537){return _0x453537;});}return null;};}function removeEntity(_0xf3dbdc,_0x5c7658){return function(_0x23334f){if(_0x23334f){return _0x23334f[_0x2c81('0x3c')]()['then'](function(){_0xf3dbdc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e5ad,_0x4b3be7){return function(_0x33323c){if(!_0x33323c){_0x31e5ad[_0x2c81('0x2f')](0x194);}return _0x33323c;};}function handleError(_0x2f8301,_0x123fe1){_0x123fe1=_0x123fe1||0x1f4;return function(_0xfd68e2){logger[_0x2c81('0x2a')](_0xfd68e2['stack']);if(_0xfd68e2[_0x2c81('0x3d')]){delete _0xfd68e2[_0x2c81('0x3d')];}_0x2f8301[_0x2c81('0x30')](_0x123fe1)[_0x2c81('0x3e')](_0xfd68e2);};}exports[_0x2c81('0x3f')]=function(_0x221f2b,_0xa9a730){var _0x4376d8={},_0x3a7884={},_0x25ee92={'count':0x0,'rows':[]};var _0xda392e=_[_0x2c81('0x40')](db[_0x2c81('0x41')][_0x2c81('0x42')],function(_0x43e4ff){return{'name':_0x43e4ff[_0x2c81('0x43')],'type':_0x43e4ff[_0x2c81('0x44')]['key']};});_0x3a7884[_0x2c81('0x45')]=_['map'](_0xda392e,_0x2c81('0x3d'));_0x3a7884[_0x2c81('0x46')]=_['keys'](_0x221f2b[_0x2c81('0x46')]);_0x3a7884['filters']=_[_0x2c81('0x47')](_0x3a7884['model'],_0x3a7884[_0x2c81('0x46')]);_0x4376d8[_0x2c81('0x48')]=_[_0x2c81('0x47')](_0x3a7884[_0x2c81('0x45')],qs[_0x2c81('0x49')](_0x221f2b[_0x2c81('0x46')][_0x2c81('0x49')]));_0x4376d8['attributes']=_0x4376d8['attributes'][_0x2c81('0x4a')]?_0x4376d8[_0x2c81('0x48')]:_0x3a7884[_0x2c81('0x45')];if(!_0x221f2b[_0x2c81('0x46')][_0x2c81('0x4b')](_0x2c81('0x4c'))){_0x4376d8[_0x2c81('0x35')]=qs['limit'](_0x221f2b['query'][_0x2c81('0x35')]);_0x4376d8[_0x2c81('0x33')]=qs['offset'](_0x221f2b[_0x2c81('0x46')][_0x2c81('0x33')]);}_0x4376d8[_0x2c81('0x4d')]=qs[_0x2c81('0x4e')](_0x221f2b[_0x2c81('0x46')][_0x2c81('0x4e')]);_0x4376d8[_0x2c81('0x4f')]=qs[_0x2c81('0x50')](_[_0x2c81('0x51')](_0x221f2b[_0x2c81('0x46')],_0x3a7884[_0x2c81('0x50')]),_0xda392e);if(_0x221f2b[_0x2c81('0x46')][_0x2c81('0x52')]){_0x4376d8['where']=_[_0x2c81('0x53')](_0x4376d8[_0x2c81('0x4f')],{'$or':_[_0x2c81('0x40')](_0xda392e,function(_0x4caeb4){if(_0x4caeb4[_0x2c81('0x44')]!=='VIRTUAL'){var _0x25eba5={};_0x25eba5[_0x4caeb4[_0x2c81('0x3d')]]={'$like':'%'+_0x221f2b[_0x2c81('0x46')][_0x2c81('0x52')]+'%'};return _0x25eba5;}})});}_0x4376d8=_[_0x2c81('0x53')]({},_0x4376d8,_0x221f2b[_0x2c81('0x54')]);var _0x3bb76b={'where':_0x4376d8[_0x2c81('0x4f')]};return db[_0x2c81('0x41')]['count'](_0x3bb76b)[_0x2c81('0x23')](function(_0x7c08){_0x25ee92[_0x2c81('0x36')]=_0x7c08;if(_0x221f2b['query'][_0x2c81('0x55')]){_0x4376d8[_0x2c81('0x56')]=[{'all':!![]}];}return db[_0x2c81('0x41')][_0x2c81('0x57')](_0x4376d8);})[_0x2c81('0x23')](function(_0xcffcce){_0x25ee92[_0x2c81('0x58')]=_0xcffcce;return _0x25ee92;})[_0x2c81('0x23')](respondWithFilteredResult(_0xa9a730,_0x4376d8))[_0x2c81('0x2e')](handleError(_0xa9a730,null));};exports[_0x2c81('0x59')]=function(_0x53fe5f,_0x2141d3){var _0x1fb65e={'raw':!![],'where':{'id':_0x53fe5f[_0x2c81('0x5a')]['id']}},_0x15daac={};_0x15daac[_0x2c81('0x45')]=_[_0x2c81('0x5b')](db[_0x2c81('0x41')][_0x2c81('0x42')]);_0x15daac[_0x2c81('0x46')]=_[_0x2c81('0x5b')](_0x53fe5f[_0x2c81('0x46')]);_0x15daac['filters']=_['intersection'](_0x15daac[_0x2c81('0x45')],_0x15daac[_0x2c81('0x46')]);_0x1fb65e['attributes']=_[_0x2c81('0x47')](_0x15daac[_0x2c81('0x45')],qs[_0x2c81('0x49')](_0x53fe5f['query'][_0x2c81('0x49')]));_0x1fb65e[_0x2c81('0x48')]=_0x1fb65e[_0x2c81('0x48')][_0x2c81('0x4a')]?_0x1fb65e[_0x2c81('0x48')]:_0x15daac['model'];if(_0x53fe5f[_0x2c81('0x46')][_0x2c81('0x55')]){_0x1fb65e[_0x2c81('0x56')]=[{'all':!![]}];}_0x1fb65e=_[_0x2c81('0x53')]({},_0x1fb65e,_0x53fe5f[_0x2c81('0x54')]);return db[_0x2c81('0x41')][_0x2c81('0x5c')](_0x1fb65e)[_0x2c81('0x23')](handleEntityNotFound(_0x2141d3,null))['then'](respondWithResult(_0x2141d3,null))[_0x2c81('0x2e')](handleError(_0x2141d3,null));};exports[_0x2c81('0x5d')]=function(_0x157722,_0x2a983d){return db[_0x2c81('0x41')][_0x2c81('0x5d')](_0x157722[_0x2c81('0x5e')],{})['then'](respondWithResult(_0x2a983d,0xc9))[_0x2c81('0x2e')](handleError(_0x2a983d,null));};exports[_0x2c81('0x3b')]=function(_0x4cc82a,_0xbd32c3){if(_0x4cc82a[_0x2c81('0x5e')]['id']){delete _0x4cc82a[_0x2c81('0x5e')]['id'];}return db['OpenchannelMessage'][_0x2c81('0x5c')]({'where':{'id':_0x4cc82a[_0x2c81('0x5a')]['id']}})['then'](handleEntityNotFound(_0xbd32c3,null))['then'](saveUpdates(_0x4cc82a[_0x2c81('0x5e')],null))[_0x2c81('0x23')](respondWithResult(_0xbd32c3,null))[_0x2c81('0x2e')](handleError(_0xbd32c3,null));};exports[_0x2c81('0x3c')]=function(_0x2aab3e,_0x3bcfbb){return db[_0x2c81('0x41')][_0x2c81('0x5c')]({'where':{'id':_0x2aab3e[_0x2c81('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3bcfbb,null))[_0x2c81('0x23')](removeEntity(_0x3bcfbb,null))['catch'](handleError(_0x3bcfbb,null));};exports[_0x2c81('0x5f')]=function(_0x36bc7a,_0x2fd575){return db[_0x2c81('0x41')][_0x2c81('0x5f')]()[_0x2c81('0x23')](respondWithResult(_0x2fd575,null))['catch'](handleError(_0x2fd575,null));};var interaction_log=require(_0x2c81('0x16'))(_0x2c81('0x60'));exports[_0x2c81('0x61')]=function(_0xfa660a,_0x146e5a,_0x520b65){var _0x4d1b8c={'agent':{},'channel':_0x2c81('0x62')};if(_0xfa660a[_0x2c81('0x5e')]['id']){delete _0xfa660a[_0x2c81('0x5e')]['id'];}_0xfa660a[_0x2c81('0x5e')]['read']=!![];_0xfa660a['body'][_0x2c81('0x63')]=moment()[_0x2c81('0x64')](_0x2c81('0x65'));_0xfa660a[_0x2c81('0x5e')][_0x2c81('0x66')]=_0xfa660a[_0x2c81('0x5e')][_0x2c81('0x66')]||_0xfa660a[_0x2c81('0x67')]['id'];_0x4d1b8c[_0x2c81('0x68')]['id']=_0xfa660a[_0x2c81('0x5e')]['UserId'];return db[_0x2c81('0x41')]['find']({'where':{'id':_0xfa660a[_0x2c81('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x146e5a,null))[_0x2c81('0x23')](saveUpdates(_0xfa660a[_0x2c81('0x5e')],null))[_0x2c81('0x23')](function(_0x5392e7){if(_0x5392e7){_0x4d1b8c[_0x2c81('0x2c')]=_0x5392e7[_0x2c81('0x69')]({'plain':!![]});return db[_0x2c81('0x6a')]['find']({'where':{'id':_0x5392e7[_0x2c81('0x6b')]}});}return null;})[_0x2c81('0x23')](handleEntityNotFound(_0x146e5a,null))[_0x2c81('0x23')](function(_0x5dfbde){if(_0x5dfbde){return _0x5dfbde[_0x2c81('0x3b')]({'UserId':_0xfa660a[_0x2c81('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x5dfbde[_0x2c81('0x6c')])?moment()[_0x2c81('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2c81('0x23')](function(_0x2d3b69){if(_0x2d3b69){_0x4d1b8c[_0x2c81('0x6d')]=_0x2d3b69['get']({'plain':!![]});interaction_log[_0x2c81('0x24')](_0x2c81('0x6e'),_0xfa660a['user']['id'],_0xfa660a[_0x2c81('0x67')][_0x2c81('0x3d')],_0xfa660a['user'][_0x2c81('0x6f')],_0x4d1b8c[_0x2c81('0x6d')]['id'],_0xfa660a[_0x2c81('0x5e')]?JSON['stringify'](_0xfa660a[_0x2c81('0x5e')]):'null');return respondWithRpcPromise('AcceptMessage',_0x2c81('0x70'),_0x4d1b8c);}return null;})[_0x2c81('0x23')](function(_0x410128){var _0x55be33=_0x2c81('0x71')+_0x410128[_0x2c81('0x2c')][_0x2c81('0x72')];return db[_0x2c81('0x73')][_0x2c81('0x46')](_0x55be33,{'type':db[_0x2c81('0x74')]['QueryTypes'][_0x2c81('0x75')],'raw':!![]})[_0x2c81('0x23')](function(_0x33dda1){return _0x33dda1;});})['then'](function(_0x2869e2){if(_0x2869e2){_0x4d1b8c['message'][_0x2c81('0x76')]=_0x2869e2[0x0];if(!_0xfa660a[_0x2c81('0x5e')][_0x2c81('0x66')])return;return db[_0x2c81('0x77')][_0x2c81('0x5c')]({'where':{'id':_0xfa660a[_0x2c81('0x5e')]['UserId'],'role':_0x2c81('0x68')},'attributes':['id',_0x2c81('0x3d'),'fullname','email',_0x2c81('0x78')],'raw':!![]});}return null;})['then'](function(_0x2bf18f){if(!_0x2bf18f)return null;_0x4d1b8c[_0x2c81('0x2c')][_0x2c81('0x68')]=_0x2bf18f;return _0x4d1b8c;})['then'](function(_0x199e17){if(_0x199e17){if(_0xfa660a[_0x2c81('0x5e')][_0x2c81('0x79')]){_0x4d1b8c['message'][_0x2c81('0x7a')]=util[_0x2c81('0x64')](_0x2c81('0x7b'),_0xfa660a[_0x2c81('0x67')][_0x2c81('0x3d')]);_0x4d1b8c['message']['channel']=_0x4d1b8c[_0x2c81('0x7c')];_0x4d1b8c[_0x2c81('0x2c')][_0x2c81('0x7d')]=_0x4d1b8c[_0x2c81('0x7c')];_0x4d1b8c['message'][_0x2c81('0x7e')]=_0x2c81('0x61');return respondWithRpcPromise(_0x2c81('0x7f'),_0x2c81('0x7f'),{'event':_0x2c81('0x80'),'message':_0x4d1b8c[_0x2c81('0x2c')]},client9002)['then'](function(){return _0x4d1b8c;});}return _0x4d1b8c;}return null;})[_0x2c81('0x23')](respondWithResult(_0x146e5a,null))[_0x2c81('0x2e')](handleError(_0x146e5a,null));};var interaction_log=require(_0x2c81('0x16'))(_0x2c81('0x60'));exports[_0x2c81('0x3a')]=function(_0x24120b,_0x26cf34,_0x287d30){var _0x684599={'agent':{},'channel':'openchannel'};if(_0x24120b[_0x2c81('0x5e')]['id']){delete _0x24120b[_0x2c81('0x5e')]['id'];}_0x24120b[_0x2c81('0x5e')]['UserId']=_0x24120b[_0x2c81('0x5e')][_0x2c81('0x66')]||_0x24120b[_0x2c81('0x67')]['id'];_0x684599[_0x2c81('0x68')]['id']=_0x24120b[_0x2c81('0x5e')]['UserId'];return db[_0x2c81('0x41')]['find']({'where':{'id':_0x24120b[_0x2c81('0x5a')]['id'],'UserId':null}})[_0x2c81('0x23')](handleEntityNotFound(_0x26cf34,null))[_0x2c81('0x23')](function(_0x4c0a79){if(_0x4c0a79){_0x684599[_0x2c81('0x2c')]=_0x4c0a79['get']({'plain':!![]});return db[_0x2c81('0x6a')][_0x2c81('0x5c')]({'where':{'id':_0x4c0a79['OpenchannelInteractionId']}});}return null;})[_0x2c81('0x23')](handleEntityNotFound(_0x26cf34,null))[_0x2c81('0x23')](function(_0x5d9fd2){if(_0x5d9fd2){_0x684599[_0x2c81('0x6d')]=_0x5d9fd2['get']({'plain':!![]});interaction_log[_0x2c81('0x24')](_0x2c81('0x81'),_0x24120b[_0x2c81('0x67')]['id'],_0x24120b[_0x2c81('0x67')][_0x2c81('0x3d')],_0x24120b[_0x2c81('0x67')]['role'],_0x684599['interaction']['id'],_0x24120b[_0x2c81('0x5e')]?JSON[_0x2c81('0x29')](_0x24120b[_0x2c81('0x5e')]):_0x2c81('0x82'));return respondWithRpcPromise(_0x2c81('0x83'),_0x2c81('0x84'),_0x684599);}return null;})[_0x2c81('0x23')](function(_0x31797c){var _0x295229='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31797c[_0x2c81('0x2c')][_0x2c81('0x72')];return db['sequelize'][_0x2c81('0x46')](_0x295229,{'type':db[_0x2c81('0x74')][_0x2c81('0x85')][_0x2c81('0x75')],'raw':!![]})[_0x2c81('0x23')](function(_0x439cea){return _0x439cea;});})[_0x2c81('0x23')](function(_0x1ba71a){if(_0x1ba71a){_0x684599[_0x2c81('0x2c')]['contact']=_0x1ba71a[0x0];if(!_0x24120b['body']['UserId'])return;return db['User'][_0x2c81('0x5c')]({'where':{'id':_0x24120b[_0x2c81('0x5e')][_0x2c81('0x66')],'role':_0x2c81('0x68')},'attributes':['id','name',_0x2c81('0x86'),_0x2c81('0x87'),'internal'],'raw':!![]});}return null;})[_0x2c81('0x23')](function(_0xead7ce){if(!_0xead7ce)return null;_0x684599[_0x2c81('0x2c')][_0x2c81('0x68')]=_0xead7ce;return _0x684599;})['then'](function(_0x26d9d0){if(_0x26d9d0){_0x26d9d0[_0x2c81('0x2c')][_0x2c81('0x7a')]=util[_0x2c81('0x64')]('SIP/%s',_0x24120b[_0x2c81('0x67')][_0x2c81('0x3d')]);_0x26d9d0[_0x2c81('0x2c')][_0x2c81('0x7c')]=_0x684599[_0x2c81('0x7c')];_0x26d9d0[_0x2c81('0x2c')][_0x2c81('0x7d')]=_0x684599[_0x2c81('0x7c')];_0x26d9d0[_0x2c81('0x2c')][_0x2c81('0x7e')]=_0x2c81('0x3a');respondWithRpcPromise('EventManager','EventManager',{'event':_0x2c81('0x88'),'message':_0x26d9d0[_0x2c81('0x2c')]},client9002);return _0x684599;}return null;})[_0x2c81('0x23')](respondWithResult(_0x26cf34,null))['catch'](handleError(_0x26cf34,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 3b14a9b..8579bcb 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 _0x0c63=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x3ede43,_0x2c1338){var _0x5ed193=function(_0x542ca8){while(--_0x542ca8){_0x3ede43['push'](_0x3ede43['shift']());}};_0x5ed193(++_0x2c1338);}(_0x0c63,0x1ed));var _0x30c6=function(_0x5655ea,_0x394586){_0x5655ea=_0x5655ea-0x0;var _0xc711ac=_0x0c63[_0x5655ea];return _0xc711ac;};'use strict';var EventEmitter=require(_0x30c6('0x0'));var OpenchannelMessage=require(_0x30c6('0x1'))['db'][_0x30c6('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x30c6('0x3')](0x0);var events={'afterCreate':_0x30c6('0x4'),'afterUpdate':_0x30c6('0x5'),'afterDestroy':_0x30c6('0x6')};function emitEvent(_0x1d6fd4){return function(_0x5a6183,_0x4fd5ba,_0x3e7777){OpenchannelMessageEvents[_0x30c6('0x7')](_0x1d6fd4+':'+_0x5a6183['id'],_0x5a6183);OpenchannelMessageEvents[_0x30c6('0x7')](_0x1d6fd4,_0x5a6183);_0x3e7777(null);};}for(var e in events){if(events[_0x30c6('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x30c6('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8b2e=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x22ec8d,_0x2b08fd){var _0x5413cc=function(_0x2ffc7f){while(--_0x2ffc7f){_0x22ec8d['push'](_0x22ec8d['shift']());}};_0x5413cc(++_0x2b08fd);}(_0x8b2e,0x1a5));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xe8b2('0x0'))['db'][_0xe8b2('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe8b2('0x2')](0x0);var events={'afterCreate':_0xe8b2('0x3'),'afterUpdate':_0xe8b2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b0929){return function(_0xef9566,_0x24fb61,_0x1fc3bb){OpenchannelMessageEvents['emit'](_0x7b0929+':'+_0xef9566['id'],_0xef9566);OpenchannelMessageEvents[_0xe8b2('0x5')](_0x7b0929,_0xef9566);_0x1fc3bb(null);};}for(var e in events){if(events[_0xe8b2('0x6')](e)){var event=events[e];OpenchannelMessage[_0xe8b2('0x7')](e,emitEvent(event));}}module[_0xe8b2('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 6b08df4..8a20132 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 _0x0062=['method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4','lodash','../../config/logger','api','bluebird','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST'];(function(_0x21679c,_0x5064c8){var _0x3cbd03=function(_0x268a25){while(--_0x268a25){_0x21679c['push'](_0x21679c['shift']());}};_0x3cbd03(++_0x5064c8);}(_0x0062,0x66));var _0x2006=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x0062[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0x2006('0x0'));var util=require('util');var logger=require(_0x2006('0x1'))(_0x2006('0x2'));var moment=require('moment');var BPromise=require(_0x2006('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2006('0x4'));var config=require('../../config/environment');var attributes=require(_0x2006('0x5'));module[_0x2006('0x6')]=function(_0x41fe34,_0x576614){return _0x41fe34[_0x2006('0x7')](_0x2006('0x8'),attributes,{'tableName':_0x2006('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x2006('0xa')],'type':_0x2006('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f25a8,_0x52521e,_0x5e4eeb){var _0x197c02=_0x41fe34[_0x2006('0xc')];var _0x185bee=_0x3f25a8['get']({'plain':!![]});if(_0x185bee[_0x2006('0xd')][_0x2006('0xe')]()==='in'||_0x185bee['direction'][_0x2006('0xe')]()===_0x2006('0xf')&&!_0x185bee[_0x2006('0x10')]&&!_[_0x2006('0x11')](_0x185bee['UserId'])){_0x197c02[_0x2006('0x12')]['findOne']({'where':{'id':_0x185bee[_0x2006('0x13')]}})[_0x2006('0x14')](function(_0x3396cb){if(_0x3396cb){_0x3396cb['update']({'lastMsgAt':_0x185bee[_0x2006('0x15')],'lastMsgDirection':_0x185bee[_0x2006('0xd')][_0x2006('0xe')]()});}})[_0x2006('0x16')](function(_0x416a55){console[_0x2006('0x17')](_0x416a55);});}if(_0x185bee['direction']===_0x2006('0xf')&&!_0x185bee['secret']){var _0x4a0d41;_0x197c02[_0x2006('0x18')][_0x2006('0x19')]()[_0x2006('0x14')](function(_0x5417fb){return _0x197c02[_0x2006('0x1a')]['find']({'where':{'id':_0x185bee['OpenchannelAccountId']},'include':[{'model':_0x197c02[_0x2006('0x12')],'as':_0x2006('0x1b'),'where':{'id':_0x185bee[_0x2006('0x13')]},'limit':0x1,'include':[{'model':_0x197c02['CmContact'],'as':_0x2006('0x1c'),'attributes':_[_0x2006('0x1d')](_0x5417fb)}]}]});})['then'](function(_0x4d200c){_0x4a0d41=_0x4d200c['get']({'plain':!![]});if(_0x4a0d41&&_0x4a0d41[_0x2006('0x1e')]){logger[_0x2006('0x1f')](_0x2006('0x20'),_0x2006('0x21'),util[_0x2006('0x22')](_0x2006('0x23'),_0x185bee['id'],_0x4a0d41[_0x2006('0x1e')]));if(_0x4a0d41[_0x2006('0x1b')]&&_0x4a0d41[_0x2006('0x1b')]['length']){_0x185bee[_0x2006('0x24')]=_[_0x2006('0x25')](_0x4a0d41[_0x2006('0x1b')][0x0],'Contact');_0x185bee[_0x2006('0x1c')]=_0x4a0d41[_0x2006('0x1b')][0x0]['Contact'];}var _0x52521e={'method':_0x2006('0x26'),'uri':encodeURI(_0x4a0d41[_0x2006('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x52521e[_0x2006('0x27')]){case _0x2006('0x28'):_0x52521e['qs']=_0x185bee;break;case _0x2006('0x26'):_0x52521e['body']=_0x185bee;break;}return rp(_0x52521e)[_0x2006('0x14')](function(_0x3a83b1){logger[_0x2006('0x1f')](_0x2006('0x20'),'afterCreate',util[_0x2006('0x22')](_0x2006('0x29'),_0x185bee['id'],_0x4a0d41[_0x2006('0x1e')]));if(_0x3a83b1['body']['threadId']&&_0x3a83b1[_0x2006('0xa')][_0x2006('0x2a')]!=_0x185bee[_0x2006('0x24')][_0x2006('0x2a')]){return _0x197c02[_0x2006('0x12')]['update']({'threadId':_0x3a83b1[_0x2006('0xa')][_0x2006('0x2a')]},{'where':{'id':_0x185bee[_0x2006('0x24')]['id']}});}else{return;}})[_0x2006('0x14')](function(){return _0x3f25a8[_0x2006('0x2b')]({'read':!![]});})[_0x2006('0x16')](function(_0x399d8c){logger['error'](_0x2006('0x20'),_0x2006('0x21'),util[_0x2006('0x2c')](_0x399d8c,{'showHidden':![],'depth':null}));_0x5e4eeb();});}else{_0x5e4eeb();}})[_0x2006('0x2d')](function(){_0x5e4eeb();});}else{_0x5e4eeb();}}},'charset':_0x2006('0x2e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xba61=['FULLTEXT','get','toLowerCase','direction','out','secret','isNil','OpenchannelInteractionId','then','update','createdAt','error','describe','find','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','exports','OpenchannelMessage'];(function(_0x596053,_0x1a9efd){var _0x1fb180=function(_0x14ccdf){while(--_0x14ccdf){_0x596053['push'](_0x596053['shift']());}};_0x1fb180(++_0x1a9efd);}(_0xba61,0x1b9));var _0x1ba6=function(_0xf5327e,_0x453773){_0xf5327e=_0xf5327e-0x0;var _0x4c1f6e=_0xba61[_0xf5327e];return _0x4c1f6e;};'use strict';var _=require(_0x1ba6('0x0'));var util=require(_0x1ba6('0x1'));var logger=require(_0x1ba6('0x2'))(_0x1ba6('0x3'));var moment=require(_0x1ba6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ba6('0x5'));var rimraf=require(_0x1ba6('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x1ba6('0x7')]=function(_0x9d8fad,_0xc9abe3){return _0x9d8fad['define'](_0x1ba6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x1ba6('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cdbe3,_0x5154f5,_0x13dc92){var _0x4b1a63=_0x9d8fad['models'];var _0x410d06=_0x4cdbe3[_0x1ba6('0xa')]({'plain':!![]});if(_0x410d06['direction'][_0x1ba6('0xb')]()==='in'||_0x410d06[_0x1ba6('0xc')][_0x1ba6('0xb')]()===_0x1ba6('0xd')&&!_0x410d06[_0x1ba6('0xe')]&&!_[_0x1ba6('0xf')](_0x410d06['UserId'])){_0x4b1a63['OpenchannelInteraction']['findOne']({'where':{'id':_0x410d06[_0x1ba6('0x10')]}})[_0x1ba6('0x11')](function(_0x1217eb){if(_0x1217eb){_0x1217eb[_0x1ba6('0x12')]({'lastMsgAt':_0x410d06[_0x1ba6('0x13')],'lastMsgDirection':_0x410d06[_0x1ba6('0xc')]['toLowerCase']()});}})['catch'](function(_0x397a08){console[_0x1ba6('0x14')](_0x397a08);});}if(_0x410d06[_0x1ba6('0xc')]===_0x1ba6('0xd')&&!_0x410d06['secret']){var _0x53b2cc;_0x4b1a63['CmContact'][_0x1ba6('0x15')]()[_0x1ba6('0x11')](function(_0x3e3051){return _0x4b1a63['OpenchannelAccount'][_0x1ba6('0x16')]({'where':{'id':_0x410d06['OpenchannelAccountId']},'include':[{'model':_0x4b1a63[_0x1ba6('0x17')],'as':_0x1ba6('0x18'),'where':{'id':_0x410d06['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x4b1a63[_0x1ba6('0x19')],'as':_0x1ba6('0x1a'),'attributes':_[_0x1ba6('0x1b')](_0x3e3051)}]}]});})['then'](function(_0x2b9c6f){_0x53b2cc=_0x2b9c6f['get']({'plain':!![]});if(_0x53b2cc&&_0x53b2cc[_0x1ba6('0x1c')]){logger[_0x1ba6('0x1d')](_0x1ba6('0x1e'),'afterCreate',util[_0x1ba6('0x1f')](_0x1ba6('0x20'),_0x410d06['id'],_0x53b2cc[_0x1ba6('0x1c')]));if(_0x53b2cc['Interactions']&&_0x53b2cc[_0x1ba6('0x18')][_0x1ba6('0x21')]){_0x410d06[_0x1ba6('0x22')]=_[_0x1ba6('0x23')](_0x53b2cc[_0x1ba6('0x18')][0x0],_0x1ba6('0x1a'));_0x410d06[_0x1ba6('0x1a')]=_0x53b2cc[_0x1ba6('0x18')][0x0][_0x1ba6('0x1a')];}var _0x5154f5={'method':'POST','uri':encodeURI(_0x53b2cc[_0x1ba6('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5154f5['method']){case _0x1ba6('0x24'):_0x5154f5['qs']=_0x410d06;break;case _0x1ba6('0x25'):_0x5154f5[_0x1ba6('0x26')]=_0x410d06;break;}return rp(_0x5154f5)['then'](function(_0x28879d){logger[_0x1ba6('0x1d')](_0x1ba6('0x1e'),'afterCreate',util[_0x1ba6('0x1f')](_0x1ba6('0x27'),_0x410d06['id'],_0x53b2cc['replyUri']));if(_0x28879d[_0x1ba6('0x26')][_0x1ba6('0x28')]&&_0x28879d[_0x1ba6('0x26')][_0x1ba6('0x28')]!=_0x410d06['Interaction'][_0x1ba6('0x28')]){return _0x4b1a63[_0x1ba6('0x17')][_0x1ba6('0x12')]({'threadId':_0x28879d[_0x1ba6('0x26')][_0x1ba6('0x28')]},{'where':{'id':_0x410d06['Interaction']['id']}});}else{return;}})['then'](function(){return _0x4cdbe3['update']({'read':!![]});})[_0x1ba6('0x29')](function(_0x347a24){logger[_0x1ba6('0x14')](_0x1ba6('0x1e'),'afterCreate',util[_0x1ba6('0x2a')](_0x347a24,{'showHidden':![],'depth':null}));_0x13dc92();});}else{_0x13dc92();}})[_0x1ba6('0x2b')](function(){_0x13dc92();});}else{_0x13dc92();}}},'charset':'utf8mb4','collate':_0x1ba6('0x2c')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 03dc125..87e5cfd 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x42f92a,_0x2bdd20){var _0x24a7d1=function(_0x537a3a){while(--_0x537a3a){_0x42f92a['push'](_0x42f92a['shift']());}};_0x24a7d1(++_0x2bdd20);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1aa0fc,_0x441679){_0x1aa0fc=_0x1aa0fc-0x0;var _0x2c3977=_0x5f2f[_0x1aa0fc];return _0x2c3977;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32b667,_0x3c2149){var _0x29bfee=function(_0x3ee6ef){while(--_0x3ee6ef){_0x32b667['push'](_0x32b667['shift']());}};_0x29bfee(++_0x3c2149);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ab001,_0x532960){_0x4ab001=_0x4ab001-0x0;var _0x52c134=_0x5f2f[_0x4ab001];return _0x52c134;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index dfcb008..e31e809 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 _0x9485=['removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0x9485,0x8b));var _0x5948=function(_0x25b7f9,_0x2f9aee){_0x25b7f9=_0x25b7f9-0x0;var _0x1d1598=_0x9485[_0x25b7f9];return _0x1d1598;};'use strict';var OpenchannelMessageEvents=require(_0x5948('0x0'));var events=[_0x5948('0x1'),_0x5948('0x2'),_0x5948('0x3')];function createListener(_0x5ca17a,_0x42393d){return function(_0xc057c8){_0x42393d[_0x5948('0x4')](_0x5ca17a,_0xc057c8);};}function removeListener(_0x47b3f3,_0xcfd4b6){return function(){OpenchannelMessageEvents[_0x5948('0x5')](_0x47b3f3,_0xcfd4b6);};}exports[_0x5948('0x6')]=function(_0x4312a8){for(var _0x19ccdd=0x0,_0x283a13=events['length'];_0x19ccdd<_0x283a13;_0x19ccdd++){var _0x2cf314=events[_0x19ccdd];var _0x4e7f15=createListener(_0x5948('0x7')+_0x2cf314,_0x4312a8);OpenchannelMessageEvents['on'](_0x2cf314,_0x4e7f15);}}; \ No newline at end of file +var _0xf8af=['remove','update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x454e8b,_0x579a1b){var _0x4f5c96=function(_0x3b7f23){while(--_0x3b7f23){_0x454e8b['push'](_0x454e8b['shift']());}};_0x4f5c96(++_0x579a1b);}(_0xf8af,0x8b));var _0xff8a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf8af[_0x27af45];return _0x18df21;};'use strict';var OpenchannelMessageEvents=require(_0xff8a('0x0'));var events=['save',_0xff8a('0x1'),_0xff8a('0x2')];function createListener(_0x3645f5,_0xdc6efe){return function(_0x5f0706){_0xdc6efe[_0xff8a('0x3')](_0x3645f5,_0x5f0706);};}function removeListener(_0x460bf6,_0x11cfa2){return function(){OpenchannelMessageEvents[_0xff8a('0x4')](_0x460bf6,_0x11cfa2);};}exports['register']=function(_0x5a4a51){for(var _0x1fc99e=0x0,_0x571a7f=events[_0xff8a('0x5')];_0x1fc99e<_0x571a7f;_0x1fc99e++){var _0x406e06=events[_0x1fc99e];var _0x46e262=createListener(_0xff8a('0x6')+_0x406e06,_0x5a4a51);OpenchannelMessageEvents['on'](_0x406e06,_0x46e262);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5b0b193..6a8ebae 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 _0x47f9=['removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users'];(function(_0x1293bd,_0x479537){var _0x435472=function(_0x19edc6){while(--_0x19edc6){_0x1293bd['push'](_0x1293bd['shift']());}};_0x435472(++_0x479537);}(_0x47f9,0x151));var _0x947f=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x47f9[_0x2a558d];return _0xa7bc9c;};'use strict';var multer=require(_0x947f('0x0'));var util=require(_0x947f('0x1'));var path=require(_0x947f('0x2'));var timeout=require(_0x947f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x947f('0x4'));var auth=require(_0x947f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x947f('0x6'));var controller=require(_0x947f('0x7'));router[_0x947f('0x8')]('/',auth[_0x947f('0x9')](),controller['index']);router[_0x947f('0x8')]('/describe',auth[_0x947f('0x9')](),controller['describe']);router['get'](_0x947f('0xa'),auth[_0x947f('0x9')](),controller[_0x947f('0xb')]);router[_0x947f('0x8')](_0x947f('0xc'),auth[_0x947f('0x9')](),controller[_0x947f('0xd')]);router[_0x947f('0x8')]('/:id/teams',auth[_0x947f('0x9')](),controller[_0x947f('0xe')]);router[_0x947f('0x8')]('/:id/users',auth[_0x947f('0x9')](),controller[_0x947f('0xf')]);router[_0x947f('0x10')]('/',auth['isAuthenticated'](),controller[_0x947f('0x11')]);router[_0x947f('0x10')](_0x947f('0x12'),auth[_0x947f('0x9')](),controller[_0x947f('0x13')]);router[_0x947f('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x947f('0x14')]);router[_0x947f('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x947f('0x16')]);router[_0x947f('0x17')](_0x947f('0xa'),auth[_0x947f('0x9')](),controller[_0x947f('0x18')]);router[_0x947f('0x17')]('/:id/teams',auth[_0x947f('0x9')](),controller[_0x947f('0x19')]);router[_0x947f('0x17')](_0x947f('0x1a'),auth[_0x947f('0x9')](),controller[_0x947f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xab8d=['show','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x17a21e,_0x325777){var _0x3c5ac6=function(_0x1848d9){while(--_0x1848d9){_0x17a21e['push'](_0x17a21e['shift']());}};_0x3c5ac6(++_0x325777);}(_0xab8d,0x1b3));var _0xdab8=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xab8d[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0xdab8('0x0'));var util=require(_0xdab8('0x1'));var path=require('path');var timeout=require(_0xdab8('0x2'));var express=require(_0xdab8('0x3'));var router=express[_0xdab8('0x4')]();var fs_extra=require(_0xdab8('0x5'));var auth=require(_0xdab8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdab8('0x7'));var controller=require('./openchannelQueue.controller');router[_0xdab8('0x8')]('/',auth[_0xdab8('0x9')](),controller['index']);router[_0xdab8('0x8')](_0xdab8('0xa'),auth[_0xdab8('0x9')](),controller[_0xdab8('0xb')]);router['get'](_0xdab8('0xc'),auth[_0xdab8('0x9')](),controller[_0xdab8('0xd')]);router[_0xdab8('0x8')]('/:id/members',auth[_0xdab8('0x9')](),controller['getMembers']);router[_0xdab8('0x8')](_0xdab8('0xe'),auth[_0xdab8('0x9')](),controller['getTeams']);router[_0xdab8('0x8')](_0xdab8('0xf'),auth[_0xdab8('0x9')](),controller[_0xdab8('0x10')]);router[_0xdab8('0x11')]('/',auth[_0xdab8('0x9')](),controller[_0xdab8('0x12')]);router[_0xdab8('0x11')](_0xdab8('0xe'),auth['isAuthenticated'](),controller[_0xdab8('0x13')]);router['post'](_0xdab8('0xf'),auth[_0xdab8('0x9')](),controller[_0xdab8('0x14')]);router[_0xdab8('0x15')]('/:id',auth[_0xdab8('0x9')](),controller[_0xdab8('0x16')]);router[_0xdab8('0x17')](_0xdab8('0xc'),auth[_0xdab8('0x9')](),controller[_0xdab8('0x18')]);router['delete'](_0xdab8('0xe'),auth['isAuthenticated'](),controller[_0xdab8('0x19')]);router[_0xdab8('0x17')](_0xdab8('0xf'),auth[_0xdab8('0x9')](),controller[_0xdab8('0x1a')]);module[_0xdab8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 57f4c6a..1a3876b 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 _0xb3b1=['ENUM','rrmemory','beepall','sequelize','exports','name','INTEGER'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xb3b1,0x11b));var _0x1b3b=function(_0x3e4061,_0x502d0b){_0x3e4061=_0x3e4061-0x0;var _0xfac9e9=_0xb3b1[_0x3e4061];return _0xfac9e9;};'use strict';var Sequelize=require(_0x1b3b('0x0'));module[_0x1b3b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1b3b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1b3b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b3b('0x4')](_0x1b3b('0x5'),_0x1b3b('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x8130=['name','INTEGER','ENUM','rrmemory','exports'];(function(_0x1b0297,_0x473019){var _0x420ceb=function(_0x53a669){while(--_0x53a669){_0x1b0297['push'](_0x1b0297['shift']());}};_0x420ceb(++_0x473019);}(_0x8130,0xf4));var _0x0813=function(_0x295c88,_0x2d2b7b){_0x295c88=_0x295c88-0x0;var _0x3c4be1=_0x8130[_0x295c88];return _0x3c4be1;};'use strict';var Sequelize=require('sequelize');module[_0x0813('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0813('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0813('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0813('0x3')](_0x0813('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a91284e..95233f0 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 _0x98f4=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','stack','name','send','index','map','OpenchannelQueue','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','includeAll','rows','catch','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','params','UserOpenchannelQueue','sort','pick','User','UserId','agent','openchannelPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','rawAttributes','addTeams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','findAll','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','value','removeAgents','userOpenchannelQueue:remove','addAgents','ids','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x154a86,_0x4f08d3){var _0x4cb64e=function(_0x1032c2){while(--_0x1032c2){_0x154a86['push'](_0x154a86['shift']());}};_0x4cb64e(++_0x4f08d3);}(_0x98f4,0xf9));var _0x498f=function(_0x317d4e,_0x3de942){_0x317d4e=_0x317d4e-0x0;var _0x56ce3d=_0x98f4[_0x317d4e];return _0x56ce3d;};'use strict';var emlformat=require(_0x498f('0x0'));var rimraf=require(_0x498f('0x1'));var zipdir=require(_0x498f('0x2'));var jsonpatch=require(_0x498f('0x3'));var rp=require(_0x498f('0x4'));var moment=require(_0x498f('0x5'));var BPromise=require(_0x498f('0x6'));var Mustache=require(_0x498f('0x7'));var util=require(_0x498f('0x8'));var path=require(_0x498f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x498f('0xa'));var _=require(_0x498f('0xb'));var squel=require(_0x498f('0xc'));var crypto=require(_0x498f('0xd'));var jsforce=require(_0x498f('0xe'));var deskjs=require(_0x498f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x498f('0x10'));var Redis=require(_0x498f('0x11'));var authService=require(_0x498f('0x12'));var qs=require(_0x498f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x498f('0x14'));var logger=require('../../config/logger')(_0x498f('0x15'));var utils=require(_0x498f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x498f('0x17'));var db=require(_0x498f('0x18'))['db'];config[_0x498f('0x19')]=_[_0x498f('0x1a')](config[_0x498f('0x19')],{'host':_0x498f('0x1b'),'port':0x18eb});var socket=require(_0x498f('0x1c'))(new Redis(config[_0x498f('0x19')]));require(_0x498f('0x1d'))[_0x498f('0x1e')](socket);function respondWithStatusCode(_0x1eac11,_0x14914c){_0x14914c=_0x14914c||0xcc;return function(_0x5331bc){if(_0x5331bc){return _0x1eac11['sendStatus'](_0x14914c);}return _0x1eac11[_0x498f('0x1f')](_0x14914c)[_0x498f('0x20')]();};}function respondWithResult(_0x132bae,_0x52319d){_0x52319d=_0x52319d||0xc8;return function(_0x316ce2){if(_0x316ce2){return _0x132bae[_0x498f('0x1f')](_0x52319d)['json'](_0x316ce2);}};}function respondWithFilteredResult(_0x29ac61,_0x4cc065){return function(_0x5b448f){if(_0x5b448f){var _0x5b751b=typeof _0x4cc065[_0x498f('0x21')]===_0x498f('0x22')&&typeof _0x4cc065[_0x498f('0x23')]===_0x498f('0x22');var _0x441af7=_0x5b448f[_0x498f('0x24')];var _0x1f7b77=_0x5b751b?0x0:_0x4cc065[_0x498f('0x21')];var _0x5b506c=_0x5b751b?_0x5b448f[_0x498f('0x24')]:_0x4cc065[_0x498f('0x21')]+_0x4cc065[_0x498f('0x23')];var _0x16acaa;if(_0x5b506c>=_0x441af7){_0x5b506c=_0x441af7;_0x16acaa=0xc8;}else{_0x16acaa=0xce;}_0x29ac61['status'](_0x16acaa);return _0x29ac61[_0x498f('0x25')](_0x498f('0x26'),_0x1f7b77+'-'+_0x5b506c+'/'+_0x441af7)['json'](_0x5b448f);}return null;};}function patchUpdates(_0x205389){return function(_0x50563f){try{jsonpatch[_0x498f('0x27')](_0x50563f,_0x205389,!![]);}catch(_0x11ef39){return BPromise['reject'](_0x11ef39);}return _0x50563f['save']();};}function saveUpdates(_0x5d2aa0,_0x14dcdc){return function(_0x9a968f){if(_0x9a968f){return _0x9a968f['update'](_0x5d2aa0)[_0x498f('0x28')](function(_0x47ec7c){return _0x47ec7c;});}return null;};}function removeEntity(_0x11053c,_0x133bd7){return function(_0x4b25b5){if(_0x4b25b5){return _0x4b25b5[_0x498f('0x29')]()['then'](function(){var _0x48da87=_0x4b25b5[_0x498f('0x2a')]({'plain':!![]});var _0x22efa5='OpenchannelQueues';return db['UserProfileResource'][_0x498f('0x29')]({'where':{'type':_0x22efa5,'resourceId':_0x48da87['id']}})['then'](function(){return _0x4b25b5;});})[_0x498f('0x28')](function(){_0x11053c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x114637,_0x561b28){return function(_0x950dd5){if(!_0x950dd5){_0x114637['sendStatus'](0x194);}return _0x950dd5;};}function handleError(_0x21f789,_0xfc1931){_0xfc1931=_0xfc1931||0x1f4;return function(_0x2caaee){logger['error'](_0x2caaee[_0x498f('0x2b')]);if(_0x2caaee[_0x498f('0x2c')]){delete _0x2caaee[_0x498f('0x2c')];}_0x21f789[_0x498f('0x1f')](_0xfc1931)[_0x498f('0x2d')](_0x2caaee);};}exports[_0x498f('0x2e')]=function(_0x10b2d0,_0x4f5326){var _0xf44af3={},_0x27f950={},_0x4ce18f={'count':0x0,'rows':[]};var _0x28d2ed=_[_0x498f('0x2f')](db[_0x498f('0x30')]['rawAttributes'],function(_0x347e92){return{'name':_0x347e92[_0x498f('0x31')],'type':_0x347e92[_0x498f('0x32')]['key']};});_0x27f950[_0x498f('0x33')]=_[_0x498f('0x2f')](_0x28d2ed,_0x498f('0x2c'));_0x27f950[_0x498f('0x34')]=_[_0x498f('0x35')](_0x10b2d0[_0x498f('0x34')]);_0x27f950[_0x498f('0x36')]=_['intersection'](_0x27f950['model'],_0x27f950['query']);_0xf44af3[_0x498f('0x37')]=_[_0x498f('0x38')](_0x27f950[_0x498f('0x33')],qs[_0x498f('0x39')](_0x10b2d0[_0x498f('0x34')][_0x498f('0x39')]));_0xf44af3[_0x498f('0x37')]=_0xf44af3['attributes'][_0x498f('0x3a')]?_0xf44af3[_0x498f('0x37')]:_0x27f950[_0x498f('0x33')];if(!_0x10b2d0[_0x498f('0x34')][_0x498f('0x3b')](_0x498f('0x3c'))){_0xf44af3[_0x498f('0x23')]=qs[_0x498f('0x23')](_0x10b2d0[_0x498f('0x34')]['limit']);_0xf44af3[_0x498f('0x21')]=qs[_0x498f('0x21')](_0x10b2d0[_0x498f('0x34')]['offset']);}_0xf44af3[_0x498f('0x3d')]=qs['sort'](_0x10b2d0[_0x498f('0x34')]['sort']);_0xf44af3[_0x498f('0x3e')]=qs['filters'](_['pick'](_0x10b2d0[_0x498f('0x34')],_0x27f950[_0x498f('0x36')]),_0x28d2ed);if(_0x10b2d0[_0x498f('0x34')]['filter']){_0xf44af3[_0x498f('0x3e')]=_['merge'](_0xf44af3['where'],{'$or':_[_0x498f('0x2f')](_0x28d2ed,function(_0x4dee4a){if(_0x4dee4a['type']!=='VIRTUAL'){var _0x409dc5={};_0x409dc5[_0x4dee4a[_0x498f('0x2c')]]={'$like':'%'+_0x10b2d0[_0x498f('0x34')][_0x498f('0x3f')]+'%'};return _0x409dc5;}})});}_0xf44af3=_[_0x498f('0x40')]({},_0xf44af3,_0x10b2d0['options']);var _0x43f1fa={'where':_0xf44af3[_0x498f('0x3e')]};return db['OpenchannelQueue']['count'](_0x43f1fa)[_0x498f('0x28')](function(_0x4b396b){_0x4ce18f[_0x498f('0x24')]=_0x4b396b;if(_0x10b2d0['query'][_0x498f('0x41')]){_0xf44af3['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0xf44af3);})[_0x498f('0x28')](function(_0xde07){_0x4ce18f[_0x498f('0x42')]=_0xde07;return _0x4ce18f;})[_0x498f('0x28')](respondWithFilteredResult(_0x4f5326,_0xf44af3))[_0x498f('0x43')](handleError(_0x4f5326,null));};exports['show']=function(_0x41c92e,_0x40166d){var _0x9b32f6={'raw':!![],'where':{'id':_0x41c92e['params']['id']}},_0xa5bc8b={};_0xa5bc8b[_0x498f('0x33')]=_[_0x498f('0x35')](db['OpenchannelQueue']['rawAttributes']);_0xa5bc8b[_0x498f('0x34')]=_[_0x498f('0x35')](_0x41c92e[_0x498f('0x34')]);_0xa5bc8b['filters']=_[_0x498f('0x38')](_0xa5bc8b[_0x498f('0x33')],_0xa5bc8b['query']);_0x9b32f6[_0x498f('0x37')]=_['intersection'](_0xa5bc8b[_0x498f('0x33')],qs[_0x498f('0x39')](_0x41c92e['query'][_0x498f('0x39')]));_0x9b32f6[_0x498f('0x37')]=_0x9b32f6[_0x498f('0x37')]['length']?_0x9b32f6[_0x498f('0x37')]:_0xa5bc8b[_0x498f('0x33')];if(_0x41c92e[_0x498f('0x34')][_0x498f('0x41')]){_0x9b32f6[_0x498f('0x44')]=[{'all':!![]}];}_0x9b32f6=_[_0x498f('0x40')]({},_0x9b32f6,_0x41c92e[_0x498f('0x45')]);return db[_0x498f('0x30')]['find'](_0x9b32f6)['then'](handleEntityNotFound(_0x40166d,null))[_0x498f('0x28')](respondWithResult(_0x40166d,null))[_0x498f('0x43')](handleError(_0x40166d,null));};exports['create']=function(_0x5a7848,_0x24691b){return db[_0x498f('0x30')][_0x498f('0x46')](_0x5a7848[_0x498f('0x47')],{})[_0x498f('0x28')](function(_0x543043){var _0x4e99a5=_0x5a7848[_0x498f('0x48')][_0x498f('0x2a')]({'plain':!![]});if(!_0x4e99a5)throw new Error(_0x498f('0x49'));if(_0x4e99a5[_0x498f('0x4a')]===_0x498f('0x48')){var _0x1d940a=_0x543043[_0x498f('0x2a')]({'plain':!![]});var _0x261632=_0x498f('0x4b');return db[_0x498f('0x4c')][_0x498f('0x4d')]({'where':{'name':_0x261632,'userProfileId':_0x4e99a5[_0x498f('0x4e')]},'raw':!![]})[_0x498f('0x28')](function(_0x3d859d){if(_0x3d859d&&_0x3d859d['autoAssociation']===0x0){return db['UserProfileResource'][_0x498f('0x46')]({'name':_0x1d940a['name'],'resourceId':_0x1d940a['id'],'type':_0x3d859d[_0x498f('0x2c')],'sectionId':_0x3d859d['id']},{})[_0x498f('0x28')](function(){return _0x543043;});}else{return _0x543043;}})[_0x498f('0x43')](function(_0x39ac86){logger[_0x498f('0x4f')](_0x498f('0x50'),_0x39ac86);throw _0x39ac86;});}return _0x543043;})[_0x498f('0x28')](respondWithResult(_0x24691b,0xc9))[_0x498f('0x43')](handleError(_0x24691b,null));};exports[_0x498f('0x51')]=function(_0xea8d8c,_0x1934db){if(_0xea8d8c['body']['id']){delete _0xea8d8c[_0x498f('0x47')]['id'];}return db[_0x498f('0x30')][_0x498f('0x4d')]({'where':{'id':_0xea8d8c['params']['id']}})[_0x498f('0x28')](handleEntityNotFound(_0x1934db,null))['then'](saveUpdates(_0xea8d8c['body'],null))[_0x498f('0x28')](respondWithResult(_0x1934db,null))[_0x498f('0x43')](handleError(_0x1934db,null));};exports['destroy']=function(_0x1fae7e,_0x3a23af){return db[_0x498f('0x30')][_0x498f('0x4d')]({'where':{'id':_0x1fae7e['params']['id']}})[_0x498f('0x28')](handleEntityNotFound(_0x3a23af,null))['then'](removeEntity(_0x3a23af,null))[_0x498f('0x43')](handleError(_0x3a23af,null));};exports['describe']=function(_0x196b8c,_0x1b228e){return db['OpenchannelQueue']['describe']()[_0x498f('0x28')](respondWithResult(_0x1b228e,null))[_0x498f('0x43')](handleError(_0x1b228e,null));};exports[_0x498f('0x52')]=function(_0x6e92a4,_0xbe35ed,_0x3b6360){var _0x2edb42={'raw':!![],'where':{}},_0xa6e368={},_0x5ee6b2;return db[_0x498f('0x30')][_0x498f('0x53')]({'where':{'id':_0x6e92a4[_0x498f('0x54')]['id']}})['then'](handleEntityNotFound(_0xbe35ed,null))['then'](function(_0x5cd90f){if(_0x5cd90f){_0x5ee6b2=_0x5cd90f[_0x498f('0x2a')]({'plain':!![]});_0xa6e368[_0x498f('0x33')]=_[_0x498f('0x35')](db[_0x498f('0x55')]['rawAttributes']);_0xa6e368[_0x498f('0x34')]=_['keys'](_0x6e92a4[_0x498f('0x34')]);_0xa6e368[_0x498f('0x36')]=_[_0x498f('0x38')](_0xa6e368[_0x498f('0x33')],_0xa6e368[_0x498f('0x34')]);_0x2edb42[_0x498f('0x37')]=_[_0x498f('0x38')](_0xa6e368[_0x498f('0x33')],qs[_0x498f('0x39')](_0x6e92a4[_0x498f('0x34')]['fields']));_0x2edb42[_0x498f('0x37')]=_0x2edb42[_0x498f('0x37')][_0x498f('0x3a')]?_0x2edb42[_0x498f('0x37')]:_0xa6e368['model'];if(!_0x6e92a4[_0x498f('0x34')]['hasOwnProperty'](_0x498f('0x3c'))){_0x2edb42[_0x498f('0x23')]=qs['limit'](_0x6e92a4['query']['limit']);_0x2edb42[_0x498f('0x21')]=qs[_0x498f('0x21')](_0x6e92a4[_0x498f('0x34')][_0x498f('0x21')]);}_0x2edb42['order']=qs[_0x498f('0x56')](_0x6e92a4[_0x498f('0x34')]['sort']);_0x2edb42['where']=qs[_0x498f('0x36')](_[_0x498f('0x57')](_0x6e92a4[_0x498f('0x34')],_0xa6e368['filters']));_0x2edb42[_0x498f('0x3e')]['OpenchannelQueueId']=_0x5cd90f['id'];if(_0x6e92a4[_0x498f('0x34')]['filter']){_0x2edb42['where']=_['merge'](_0x2edb42[_0x498f('0x3e')],{'$or':_[_0x498f('0x2f')](_0x2edb42[_0x498f('0x37')],function(_0x3c3c29){var _0x55bb3d={};_0x55bb3d[_0x3c3c29]={'$like':'%'+_0x6e92a4[_0x498f('0x34')]['filter']+'%'};return _0x55bb3d;})});}_0x2edb42=_[_0x498f('0x40')]({},_0x2edb42,_0x6e92a4[_0x498f('0x45')]);return db['UserOpenchannelQueue']['findAll'](_0x2edb42);}})[_0x498f('0x28')](function(_0x26ca59){if(_0x26ca59){return db[_0x498f('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0x26ca59,_0x498f('0x59')),'role':_0x498f('0x5a')},'attributes':['id','name',_0x498f('0x5b'),_0x498f('0x5c'),'createdAt']});}})[_0x498f('0x28')](function(_0xa12107){if(_0xa12107){return{'count':_0xa12107[_0x498f('0x24')],'rows':_[_0x498f('0x2f')](_0xa12107[_0x498f('0x42')],function(_0x53a7ee){return{'membername':_0x53a7ee[_0x498f('0x2c')],'UserId':_0x53a7ee['id'],'queue_name':_0x5ee6b2[_0x498f('0x2c')],'OpenchannelQueueId':_0x5ee6b2['id'],'interface':util['format'](_0x498f('0x5d'),_0x498f('0x5e'),_0x53a7ee['name']),'penalty':0x0,'paused':_0x53a7ee[_0x498f('0x5b')],'createdAt':_0x53a7ee[_0x498f('0x5f')],'updatedAt':_0x53a7ee['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x498f('0x28')](respondWithFilteredResult(_0xbe35ed,_0x2edb42))['catch'](handleError(_0xbe35ed,null));};exports[_0x498f('0x60')]=function(_0x4064a7,_0x45dc88,_0x3d8405){var _0x1582ee={};var _0x4a0c9c={};var _0x5f0a18;var _0x188519;return db[_0x498f('0x30')][_0x498f('0x53')]({'where':{'id':_0x4064a7['params']['id']}})[_0x498f('0x28')](handleEntityNotFound(_0x45dc88,null))[_0x498f('0x28')](function(_0x1e640a){if(_0x1e640a){_0x5f0a18=_0x1e640a;_0x4a0c9c[_0x498f('0x33')]=_[_0x498f('0x35')](db[_0x498f('0x61')][_0x498f('0x62')]);_0x4a0c9c['query']=_[_0x498f('0x35')](_0x4064a7[_0x498f('0x34')]);_0x4a0c9c[_0x498f('0x36')]=_[_0x498f('0x38')](_0x4a0c9c[_0x498f('0x33')],_0x4a0c9c[_0x498f('0x34')]);_0x1582ee[_0x498f('0x37')]=_[_0x498f('0x38')](_0x4a0c9c[_0x498f('0x33')],qs[_0x498f('0x39')](_0x4064a7[_0x498f('0x34')][_0x498f('0x39')]));_0x1582ee[_0x498f('0x37')]=_0x1582ee['attributes']['length']?_0x1582ee[_0x498f('0x37')]:_0x4a0c9c[_0x498f('0x33')];_0x1582ee[_0x498f('0x3d')]=qs[_0x498f('0x56')](_0x4064a7[_0x498f('0x34')]['sort']);_0x1582ee['where']=qs[_0x498f('0x36')](_[_0x498f('0x57')](_0x4064a7[_0x498f('0x34')],_0x4a0c9c[_0x498f('0x36')]));if(_0x4064a7['query'][_0x498f('0x3f')]){_0x1582ee[_0x498f('0x3e')]=_[_0x498f('0x40')](_0x1582ee[_0x498f('0x3e')],{'$or':_['map'](_0x1582ee[_0x498f('0x37')],function(_0x214f86){var _0xd26a76={};_0xd26a76[_0x214f86]={'$like':'%'+_0x4064a7[_0x498f('0x34')][_0x498f('0x3f')]+'%'};return _0xd26a76;})});}_0x1582ee=_[_0x498f('0x40')]({},_0x1582ee,_0x4064a7[_0x498f('0x45')]);return _0x5f0a18['getTeams'](_0x1582ee);}})['then'](function(_0x4fd8ae){if(_0x4fd8ae){_0x188519=_0x4fd8ae[_0x498f('0x3a')];if(!_0x4064a7[_0x498f('0x34')][_0x498f('0x3b')]('nolimit')){_0x1582ee[_0x498f('0x23')]=qs[_0x498f('0x23')](_0x4064a7[_0x498f('0x34')]['limit']);_0x1582ee[_0x498f('0x21')]=qs[_0x498f('0x21')](_0x4064a7[_0x498f('0x34')]['offset']);}return _0x5f0a18[_0x498f('0x60')](_0x1582ee);}})[_0x498f('0x28')](function(_0x4ca6d2){if(_0x4ca6d2){return _0x4ca6d2?{'count':_0x188519,'rows':_0x4ca6d2}:null;}})[_0x498f('0x28')](respondWithResult(_0x45dc88,null))['catch'](handleError(_0x45dc88,null));};exports[_0x498f('0x63')]=function(_0x1c78d5,_0x348adf,_0x57e4ae){var _0x421aee=_0x1c78d5[_0x498f('0x47')]['ids'];return db['Team']['findAll']({'where':{'id':_0x421aee},'attributes':['id'],'include':[{'model':db[_0x498f('0x58')],'as':_0x498f('0x64'),'attributes':['id',_0x498f('0x2c'),_0x498f('0x65'),_0x498f('0x66'),_0x498f('0x67')],'raw':!![]}]})[_0x498f('0x28')](function(_0x24098d){if(_0x24098d){var _0x3bab7b=_['flatMap'](_0x24098d,function(_0x5cdbaf){var _0xcf0f14=_0x5cdbaf[_0x498f('0x2a')]({'plain':!![]});return _0xcf0f14[_0x498f('0x64')];});return db['OpenchannelQueue'][_0x498f('0x4d')]({'where':{'id':_0x1c78d5['params']['id']}})[_0x498f('0x28')](function(_0x4a0b63){return db[_0x498f('0x68')]['transaction'](function(_0x446001){return _0x4a0b63[_0x498f('0x63')](_0x421aee,{'transaction':_0x446001})[_0x498f('0x28')](function(){return BPromise[_0x498f('0x69')](_0x3bab7b,function(_0x44f464){return db[_0x498f('0x55')][_0x498f('0x6a')]({'where':{'UserId':_0x44f464['id'],'OpenchannelQueueId':_0x1c78d5[_0x498f('0x54')]['id']},'transaction':_0x446001});});})[_0x498f('0x28')](function(){_0x3bab7b[_0x498f('0x6b')](function(_0x3fcd58){socket[_0x498f('0x6c')](_0x498f('0x6d'),{'UserId':_0x3fcd58['id'],'OpenchannelQueueId':_0x4a0b63['id']});});});});});}})['then'](respondWithStatusCode(_0x348adf,null))[_0x498f('0x43')](handleError(_0x348adf,null));};exports[_0x498f('0x6e')]=function(_0x508a9c,_0x55909d,_0x3090ac){return db['Team'][_0x498f('0x6f')]({'where':{'id':_0x508a9c[_0x498f('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x498f('0x58')],'as':_0x498f('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55909d,null))[_0x498f('0x28')](function(_0x5bf338){var _0x229e5e=_[_0x498f('0x2f')](_0x5bf338,'id');var _0xc16891=[];var _0x1750a0=[];var _0x593ab6=squel[_0x498f('0x70')]();_0x593ab6[_0x498f('0x71')](_0x498f('0x72'))[_0x498f('0x73')](_0x498f('0x74'),'tq')[_0x498f('0x75')](_0x498f('0x76'),'ut',_0x498f('0x77'))[_0x498f('0x3e')](_0x498f('0x78'),_0x508a9c[_0x498f('0x54')]['id']);for(var _0x293a7a=0x0;_0x293a7a<_0x5bf338['length'];_0x293a7a+=0x1){let _0x343e50=_0x5bf338[_0x293a7a];for(var _0x3b9e94=0x0;_0x3b9e94<_0x343e50['Agents']['length'];_0x3b9e94+=0x1){let _0xdc5a29=_0x343e50['Agents'][_0x3b9e94];var _0x410b14=_0x593ab6[_0x498f('0x79')]();_0x410b14[_0x498f('0x3e')](_0x498f('0x7a'),_0xdc5a29['id']);_0x1750a0['push'](db[_0x498f('0x68')]['query'](_0x410b14[_0x498f('0x7b')](),{'type':db[_0x498f('0x68')]['QueryTypes'][_0x498f('0x7c')]})[_0x498f('0x28')](function(_0x3bd9c4){if(_0x3bd9c4['length']===0x1){return _0xdc5a29['id'];}else{var _0x4a29da=_['every'](_[_0x498f('0x2f')](_0x3bd9c4,_0x498f('0x7d')),function(_0x41c9b6){return _[_0x498f('0x7e')](_0x229e5e,_0x41c9b6);});if(_0x4a29da){return _0xdc5a29['id'];}}}));}}return BPromise[_0x498f('0x7f')](_0x1750a0)['then'](function(_0x48c219){_0xc16891=_(_0xc16891)['union'](_0x48c219)['compact']()[_0x498f('0x80')]();return db['OpenchannelQueue'][_0x498f('0x4d')]({'where':{'id':_0x508a9c['params']['id']}})['then'](function(_0x5c75f){return db[_0x498f('0x68')]['transaction'](function(_0x106925){return _0x5c75f['removeTeams'](_0x508a9c[_0x498f('0x34')]['ids'],{'transaction':_0x106925})[_0x498f('0x28')](function(){if(!_['isEmpty'](_0xc16891)){return _0x5c75f[_0x498f('0x81')](_0xc16891,{'transaction':_0x106925});}})[_0x498f('0x28')](function(){_0xc16891[_0x498f('0x6b')](function(_0x27fdd2){socket['emit'](_0x498f('0x82'),{'UserId':_0x27fdd2,'OpenchannelQueueId':_0x5c75f['id']});});});});});});})['then'](respondWithStatusCode(_0x55909d,null))['catch'](handleError(_0x55909d,null));};exports[_0x498f('0x83')]=function(_0x55c45e,_0x5db2bc,_0x526d14){return db[_0x498f('0x30')][_0x498f('0x4d')]({'where':{'id':_0x55c45e[_0x498f('0x54')]['id']}})['then'](handleEntityNotFound(_0x5db2bc,null))[_0x498f('0x28')](function(_0x1c5f15){if(_0x1c5f15){return _0x1c5f15['addAgents'](_0x55c45e[_0x498f('0x47')][_0x498f('0x84')],_[_0x498f('0x85')](_0x55c45e[_0x498f('0x47')],[_0x498f('0x84'),'id'])||{})['spread'](function(_0x59bc12){for(var _0x41ca1f=0x0;_0x41ca1f<_0x55c45e[_0x498f('0x47')]['ids']['length'];_0x41ca1f+=0x1){socket[_0x498f('0x6c')](_0x498f('0x6d'),{'UserId':Number(_0x55c45e[_0x498f('0x47')][_0x498f('0x84')][_0x41ca1f]),'OpenchannelQueueId':Number(_0x55c45e[_0x498f('0x54')]['id'])});}return _0x59bc12;});}})['then'](respondWithResult(_0x5db2bc,null))[_0x498f('0x43')](handleError(_0x5db2bc,null));};exports['removeAgents']=function(_0x5bedfc,_0x5b3373,_0x54266c){return db[_0x498f('0x30')][_0x498f('0x4d')]({'where':{'id':_0x5bedfc[_0x498f('0x54')]['id']}})['then'](handleEntityNotFound(_0x5b3373,null))[_0x498f('0x28')](function(_0x2f6be1){if(_0x2f6be1){return _0x2f6be1[_0x498f('0x81')](_0x5bedfc['query'][_0x498f('0x84')])[_0x498f('0x28')](function(){if(_[_0x498f('0x86')](_0x5bedfc['query'][_0x498f('0x84')])){for(var _0x15d4fe=0x0;_0x15d4fe<_0x5bedfc[_0x498f('0x34')][_0x498f('0x84')][_0x498f('0x3a')];_0x15d4fe+=0x1){socket[_0x498f('0x6c')](_0x498f('0x82'),{'UserId':Number(_0x5bedfc['query'][_0x498f('0x84')][_0x15d4fe]),'OpenchannelQueueId':Number(_0x5bedfc['params']['id'])});}}else{socket[_0x498f('0x6c')](_0x498f('0x82'),{'UserId':Number(_0x5bedfc[_0x498f('0x34')][_0x498f('0x84')]),'OpenchannelQueueId':Number(_0x5bedfc[_0x498f('0x54')]['id'])});}});}})[_0x498f('0x28')](respondWithStatusCode(_0x5b3373,null))[_0x498f('0x43')](handleError(_0x5b3373,null));};exports[_0x498f('0x87')]=function(_0x28581d,_0x178da7,_0x5dbca4){var _0x2888f5={};var _0x2a8b5c={};var _0x420fa3;var _0x25e0f0;return db[_0x498f('0x30')][_0x498f('0x53')]({'where':{'id':_0x28581d[_0x498f('0x54')]['id']}})[_0x498f('0x28')](handleEntityNotFound(_0x178da7,null))[_0x498f('0x28')](function(_0x18db14){if(_0x18db14){_0x420fa3=_0x18db14;_0x2a8b5c[_0x498f('0x33')]=_[_0x498f('0x35')](db['User'][_0x498f('0x62')]);_0x2a8b5c[_0x498f('0x34')]=_[_0x498f('0x35')](_0x28581d[_0x498f('0x34')]);_0x2a8b5c[_0x498f('0x36')]=_[_0x498f('0x38')](_0x2a8b5c[_0x498f('0x33')],_0x2a8b5c['query']);_0x2888f5[_0x498f('0x37')]=_[_0x498f('0x38')](_0x2a8b5c[_0x498f('0x33')],qs[_0x498f('0x39')](_0x28581d[_0x498f('0x34')][_0x498f('0x39')]));_0x2888f5[_0x498f('0x37')]=_0x2888f5['attributes'][_0x498f('0x3a')]?_0x2888f5[_0x498f('0x37')]:_0x2a8b5c['model'];_0x2888f5[_0x498f('0x3d')]=qs['sort'](_0x28581d['query']['sort']);_0x2888f5[_0x498f('0x3e')]=qs[_0x498f('0x36')](_['pick'](_0x28581d[_0x498f('0x34')],_0x2a8b5c[_0x498f('0x36')]));if(_0x28581d['query'][_0x498f('0x3f')]){_0x2888f5['where']=_[_0x498f('0x40')](_0x2888f5[_0x498f('0x3e')],{'$or':_[_0x498f('0x2f')](_0x2888f5[_0x498f('0x37')],function(_0x539fae){var _0x42fa9d={};_0x42fa9d[_0x539fae]={'$like':'%'+_0x28581d['query'][_0x498f('0x3f')]+'%'};return _0x42fa9d;})});}_0x2888f5=_[_0x498f('0x40')]({},_0x2888f5,_0x28581d['options']);return _0x420fa3['getAgents'](_0x2888f5);}})[_0x498f('0x28')](function(_0x18c1d2){if(_0x18c1d2){_0x25e0f0=_0x18c1d2[_0x498f('0x3a')];if(!_0x28581d[_0x498f('0x34')][_0x498f('0x3b')](_0x498f('0x3c'))){_0x2888f5[_0x498f('0x23')]=qs[_0x498f('0x23')](_0x28581d[_0x498f('0x34')][_0x498f('0x23')]);_0x2888f5[_0x498f('0x21')]=qs['offset'](_0x28581d[_0x498f('0x34')][_0x498f('0x21')]);}return _0x420fa3['getAgents'](_0x2888f5);}})[_0x498f('0x28')](function(_0x45b427){if(_0x45b427){return _0x45b427?{'count':_0x25e0f0,'rows':_0x45b427}:null;}})['then'](respondWithResult(_0x178da7,null))[_0x498f('0x43')](handleError(_0x178da7,null));}; \ No newline at end of file +var _0x265a=['spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','OpenchannelQueues','UserProfileResource','destroy','end','stack','name','index','map','OpenchannelQueue','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','order','OpenchannelQueueId','User','findAndCountAll','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','omit'];(function(_0x10af0e,_0x45d7ba){var _0x3cf97b=function(_0x2a62fc){while(--_0x2a62fc){_0x10af0e['push'](_0x10af0e['shift']());}};_0x3cf97b(++_0x45d7ba);}(_0x265a,0x1b9));var _0xa265=function(_0x5c0cb2,_0x2bf20a){_0x5c0cb2=_0x5c0cb2-0x0;var _0x4a26ed=_0x265a[_0x5c0cb2];return _0x4a26ed;};'use strict';var emlformat=require(_0xa265('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa265('0x1'));var jsonpatch=require(_0xa265('0x2'));var rp=require(_0xa265('0x3'));var moment=require(_0xa265('0x4'));var BPromise=require(_0xa265('0x5'));var Mustache=require(_0xa265('0x6'));var util=require('util');var path=require(_0xa265('0x7'));var sox=require('sox');var csv=require(_0xa265('0x8'));var ejs=require(_0xa265('0x9'));var fs=require('fs');var fs_extra=require(_0xa265('0xa'));var _=require(_0xa265('0xb'));var squel=require(_0xa265('0xc'));var crypto=require(_0xa265('0xd'));var jsforce=require(_0xa265('0xe'));var deskjs=require(_0xa265('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa265('0x10'));var Papa=require(_0xa265('0x11'));var Redis=require(_0xa265('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa265('0x13'));var as=require(_0xa265('0x14'));var hardwareService=require(_0xa265('0x15'));var logger=require(_0xa265('0x16'))(_0xa265('0x17'));var utils=require(_0xa265('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa265('0x19'))['db'];config[_0xa265('0x1a')]=_['defaults'](config['redis'],{'host':_0xa265('0x1b'),'port':0x18eb});var socket=require(_0xa265('0x1c'))(new Redis(config['redis']));require(_0xa265('0x1d'))['register'](socket);function respondWithStatusCode(_0x33ec3b,_0x3dc8af){_0x3dc8af=_0x3dc8af||0xcc;return function(_0x80c699){if(_0x80c699){return _0x33ec3b[_0xa265('0x1e')](_0x3dc8af);}return _0x33ec3b[_0xa265('0x1f')](_0x3dc8af)['end']();};}function respondWithResult(_0x26c828,_0x4cd208){_0x4cd208=_0x4cd208||0xc8;return function(_0x13f5c3){if(_0x13f5c3){return _0x26c828[_0xa265('0x1f')](_0x4cd208)['json'](_0x13f5c3);}};}function respondWithFilteredResult(_0x5b8f48,_0x27cfc6){return function(_0x5a1339){if(_0x5a1339){var _0x5c4303=typeof _0x27cfc6[_0xa265('0x20')]===_0xa265('0x21')&&typeof _0x27cfc6[_0xa265('0x22')]===_0xa265('0x21');var _0x1038a1=_0x5a1339[_0xa265('0x23')];var _0xeaf928=_0x5c4303?0x0:_0x27cfc6[_0xa265('0x20')];var _0x4b64eb=_0x5c4303?_0x5a1339[_0xa265('0x23')]:_0x27cfc6[_0xa265('0x20')]+_0x27cfc6[_0xa265('0x22')];var _0x3a83b2;if(_0x4b64eb>=_0x1038a1){_0x4b64eb=_0x1038a1;_0x3a83b2=0xc8;}else{_0x3a83b2=0xce;}_0x5b8f48[_0xa265('0x1f')](_0x3a83b2);return _0x5b8f48[_0xa265('0x24')](_0xa265('0x25'),_0xeaf928+'-'+_0x4b64eb+'/'+_0x1038a1)['json'](_0x5a1339);}return null;};}function patchUpdates(_0x120612){return function(_0xa1fca1){try{jsonpatch['apply'](_0xa1fca1,_0x120612,!![]);}catch(_0x33aa33){return BPromise[_0xa265('0x26')](_0x33aa33);}return _0xa1fca1['save']();};}function saveUpdates(_0x447aa2,_0x39ff9d){return function(_0xa22c62){if(_0xa22c62){return _0xa22c62[_0xa265('0x27')](_0x447aa2)[_0xa265('0x28')](function(_0x1229db){return _0x1229db;});}return null;};}function removeEntity(_0x5eb31e,_0x332173){return function(_0x20ae7c){if(_0x20ae7c){return _0x20ae7c['destroy']()[_0xa265('0x28')](function(){var _0x348074=_0x20ae7c[_0xa265('0x29')]({'plain':!![]});var _0x97b63d=_0xa265('0x2a');return db[_0xa265('0x2b')][_0xa265('0x2c')]({'where':{'type':_0x97b63d,'resourceId':_0x348074['id']}})[_0xa265('0x28')](function(){return _0x20ae7c;});})['then'](function(){_0x5eb31e['status'](0xcc)[_0xa265('0x2d')]();});}};}function handleEntityNotFound(_0x56c6f3,_0x593708){return function(_0x1f9cbd){if(!_0x1f9cbd){_0x56c6f3[_0xa265('0x1e')](0x194);}return _0x1f9cbd;};}function handleError(_0x5ee8ab,_0x5188e3){_0x5188e3=_0x5188e3||0x1f4;return function(_0x53a53d){logger['error'](_0x53a53d[_0xa265('0x2e')]);if(_0x53a53d[_0xa265('0x2f')]){delete _0x53a53d[_0xa265('0x2f')];}_0x5ee8ab[_0xa265('0x1f')](_0x5188e3)['send'](_0x53a53d);};}exports[_0xa265('0x30')]=function(_0x114543,_0x5c6dc2){var _0x20b959={},_0x591db6={},_0x3df650={'count':0x0,'rows':[]};var _0x5ec098=_[_0xa265('0x31')](db[_0xa265('0x32')]['rawAttributes'],function(_0x29781c){return{'name':_0x29781c[_0xa265('0x33')],'type':_0x29781c[_0xa265('0x34')][_0xa265('0x35')]};});_0x591db6['model']=_[_0xa265('0x31')](_0x5ec098,'name');_0x591db6[_0xa265('0x36')]=_[_0xa265('0x37')](_0x114543[_0xa265('0x36')]);_0x591db6[_0xa265('0x38')]=_[_0xa265('0x39')](_0x591db6[_0xa265('0x3a')],_0x591db6[_0xa265('0x36')]);_0x20b959['attributes']=_[_0xa265('0x39')](_0x591db6[_0xa265('0x3a')],qs[_0xa265('0x3b')](_0x114543[_0xa265('0x36')][_0xa265('0x3b')]));_0x20b959[_0xa265('0x3c')]=_0x20b959[_0xa265('0x3c')][_0xa265('0x3d')]?_0x20b959['attributes']:_0x591db6[_0xa265('0x3a')];if(!_0x114543[_0xa265('0x36')][_0xa265('0x3e')](_0xa265('0x3f'))){_0x20b959['limit']=qs[_0xa265('0x22')](_0x114543[_0xa265('0x36')][_0xa265('0x22')]);_0x20b959['offset']=qs['offset'](_0x114543['query'][_0xa265('0x20')]);}_0x20b959['order']=qs['sort'](_0x114543[_0xa265('0x36')][_0xa265('0x40')]);_0x20b959[_0xa265('0x41')]=qs[_0xa265('0x38')](_[_0xa265('0x42')](_0x114543[_0xa265('0x36')],_0x591db6[_0xa265('0x38')]),_0x5ec098);if(_0x114543['query'][_0xa265('0x43')]){_0x20b959[_0xa265('0x41')]=_[_0xa265('0x44')](_0x20b959[_0xa265('0x41')],{'$or':_['map'](_0x5ec098,function(_0x40bc9f){if(_0x40bc9f[_0xa265('0x34')]!==_0xa265('0x45')){var _0x5a597e={};_0x5a597e[_0x40bc9f['name']]={'$like':'%'+_0x114543[_0xa265('0x36')]['filter']+'%'};return _0x5a597e;}})});}_0x20b959=_['merge']({},_0x20b959,_0x114543[_0xa265('0x46')]);var _0x5b11fb={'where':_0x20b959[_0xa265('0x41')]};return db['OpenchannelQueue'][_0xa265('0x23')](_0x5b11fb)[_0xa265('0x28')](function(_0x41fb54){_0x3df650['count']=_0x41fb54;if(_0x114543[_0xa265('0x36')]['includeAll']){_0x20b959[_0xa265('0x47')]=[{'all':!![]}];}return db[_0xa265('0x32')][_0xa265('0x48')](_0x20b959);})['then'](function(_0x3c6b97){_0x3df650[_0xa265('0x49')]=_0x3c6b97;return _0x3df650;})[_0xa265('0x28')](respondWithFilteredResult(_0x5c6dc2,_0x20b959))['catch'](handleError(_0x5c6dc2,null));};exports[_0xa265('0x4a')]=function(_0x37627b,_0x6621f){var _0x561cf5={'raw':!![],'where':{'id':_0x37627b[_0xa265('0x4b')]['id']}},_0x790f60={};_0x790f60['model']=_['keys'](db[_0xa265('0x32')][_0xa265('0x4c')]);_0x790f60[_0xa265('0x36')]=_[_0xa265('0x37')](_0x37627b[_0xa265('0x36')]);_0x790f60[_0xa265('0x38')]=_[_0xa265('0x39')](_0x790f60[_0xa265('0x3a')],_0x790f60[_0xa265('0x36')]);_0x561cf5[_0xa265('0x3c')]=_[_0xa265('0x39')](_0x790f60['model'],qs['fields'](_0x37627b[_0xa265('0x36')]['fields']));_0x561cf5[_0xa265('0x3c')]=_0x561cf5[_0xa265('0x3c')][_0xa265('0x3d')]?_0x561cf5[_0xa265('0x3c')]:_0x790f60[_0xa265('0x3a')];if(_0x37627b['query'][_0xa265('0x4d')]){_0x561cf5['include']=[{'all':!![]}];}_0x561cf5=_[_0xa265('0x44')]({},_0x561cf5,_0x37627b[_0xa265('0x46')]);return db[_0xa265('0x32')][_0xa265('0x4e')](_0x561cf5)[_0xa265('0x28')](handleEntityNotFound(_0x6621f,null))[_0xa265('0x28')](respondWithResult(_0x6621f,null))[_0xa265('0x4f')](handleError(_0x6621f,null));};exports[_0xa265('0x50')]=function(_0x392234,_0x5ae879){return db[_0xa265('0x32')][_0xa265('0x50')](_0x392234[_0xa265('0x51')],{})[_0xa265('0x28')](function(_0x3fa505){var _0x5497a8=_0x392234[_0xa265('0x52')]['get']({'plain':!![]});if(!_0x5497a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5497a8[_0xa265('0x53')]===_0xa265('0x52')){var _0x45dc05=_0x3fa505['get']({'plain':!![]});var _0x538fb1=_0xa265('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x538fb1,'userProfileId':_0x5497a8[_0xa265('0x54')]},'raw':!![]})[_0xa265('0x28')](function(_0x413edc){if(_0x413edc&&_0x413edc[_0xa265('0x55')]===0x0){return db[_0xa265('0x2b')][_0xa265('0x50')]({'name':_0x45dc05[_0xa265('0x2f')],'resourceId':_0x45dc05['id'],'type':_0x413edc['name'],'sectionId':_0x413edc['id']},{})[_0xa265('0x28')](function(){return _0x3fa505;});}else{return _0x3fa505;}})['catch'](function(_0xeb20ea){logger[_0xa265('0x56')](_0xa265('0x57'),_0xeb20ea);throw _0xeb20ea;});}return _0x3fa505;})['then'](respondWithResult(_0x5ae879,0xc9))['catch'](handleError(_0x5ae879,null));};exports['update']=function(_0xd316d4,_0x436128){if(_0xd316d4['body']['id']){delete _0xd316d4[_0xa265('0x51')]['id'];}return db['OpenchannelQueue'][_0xa265('0x4e')]({'where':{'id':_0xd316d4['params']['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x436128,null))['then'](saveUpdates(_0xd316d4[_0xa265('0x51')],null))[_0xa265('0x28')](respondWithResult(_0x436128,null))[_0xa265('0x4f')](handleError(_0x436128,null));};exports[_0xa265('0x2c')]=function(_0x41a1b0,_0xfa2abb){return db[_0xa265('0x32')][_0xa265('0x4e')]({'where':{'id':_0x41a1b0[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0xfa2abb,null))[_0xa265('0x28')](removeEntity(_0xfa2abb,null))[_0xa265('0x4f')](handleError(_0xfa2abb,null));};exports[_0xa265('0x58')]=function(_0x1244dc,_0x3f58f4){return db[_0xa265('0x32')][_0xa265('0x58')]()['then'](respondWithResult(_0x3f58f4,null))['catch'](handleError(_0x3f58f4,null));};exports['getMembers']=function(_0x1efd44,_0x139224,_0x8690bd){var _0x3ee412={'raw':!![],'where':{}},_0x4aab31={},_0x2a21f2;return db[_0xa265('0x32')]['findOne']({'where':{'id':_0x1efd44[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x139224,null))[_0xa265('0x28')](function(_0x4e458a){if(_0x4e458a){_0x2a21f2=_0x4e458a[_0xa265('0x29')]({'plain':!![]});_0x4aab31['model']=_[_0xa265('0x37')](db[_0xa265('0x59')][_0xa265('0x4c')]);_0x4aab31['query']=_[_0xa265('0x37')](_0x1efd44[_0xa265('0x36')]);_0x4aab31['filters']=_[_0xa265('0x39')](_0x4aab31[_0xa265('0x3a')],_0x4aab31['query']);_0x3ee412['attributes']=_[_0xa265('0x39')](_0x4aab31['model'],qs[_0xa265('0x3b')](_0x1efd44[_0xa265('0x36')][_0xa265('0x3b')]));_0x3ee412[_0xa265('0x3c')]=_0x3ee412[_0xa265('0x3c')][_0xa265('0x3d')]?_0x3ee412[_0xa265('0x3c')]:_0x4aab31[_0xa265('0x3a')];if(!_0x1efd44['query'][_0xa265('0x3e')]('nolimit')){_0x3ee412[_0xa265('0x22')]=qs[_0xa265('0x22')](_0x1efd44[_0xa265('0x36')][_0xa265('0x22')]);_0x3ee412[_0xa265('0x20')]=qs[_0xa265('0x20')](_0x1efd44['query'][_0xa265('0x20')]);}_0x3ee412[_0xa265('0x5a')]=qs[_0xa265('0x40')](_0x1efd44[_0xa265('0x36')][_0xa265('0x40')]);_0x3ee412[_0xa265('0x41')]=qs[_0xa265('0x38')](_['pick'](_0x1efd44['query'],_0x4aab31['filters']));_0x3ee412[_0xa265('0x41')][_0xa265('0x5b')]=_0x4e458a['id'];if(_0x1efd44[_0xa265('0x36')][_0xa265('0x43')]){_0x3ee412[_0xa265('0x41')]=_[_0xa265('0x44')](_0x3ee412[_0xa265('0x41')],{'$or':_['map'](_0x3ee412[_0xa265('0x3c')],function(_0x3ed06e){var _0x3816ce={};_0x3816ce[_0x3ed06e]={'$like':'%'+_0x1efd44[_0xa265('0x36')][_0xa265('0x43')]+'%'};return _0x3816ce;})});}_0x3ee412=_[_0xa265('0x44')]({},_0x3ee412,_0x1efd44[_0xa265('0x46')]);return db[_0xa265('0x59')][_0xa265('0x48')](_0x3ee412);}})[_0xa265('0x28')](function(_0x2eb456){if(_0x2eb456){return db[_0xa265('0x5c')][_0xa265('0x5d')]({'where':{'id':_['map'](_0x2eb456,'UserId'),'role':'agent'},'attributes':['id',_0xa265('0x2f'),'openchannelPause',_0xa265('0x5e'),_0xa265('0x5f')]});}})[_0xa265('0x28')](function(_0x4267e8){if(_0x4267e8){return{'count':_0x4267e8[_0xa265('0x23')],'rows':_['map'](_0x4267e8[_0xa265('0x49')],function(_0x4fae89){return{'membername':_0x4fae89[_0xa265('0x2f')],'UserId':_0x4fae89['id'],'queue_name':_0x2a21f2['name'],'OpenchannelQueueId':_0x2a21f2['id'],'interface':util[_0xa265('0x60')](_0xa265('0x61'),_0xa265('0x62'),_0x4fae89['name']),'penalty':0x0,'paused':_0x4fae89[_0xa265('0x63')],'createdAt':_0x4fae89[_0xa265('0x5f')],'updatedAt':_0x4fae89[_0xa265('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x139224,_0x3ee412))[_0xa265('0x4f')](handleError(_0x139224,null));};exports[_0xa265('0x64')]=function(_0x4a0e5b,_0x1f004c,_0x594f8a){var _0x1f4bca={};var _0x44aaab={};var _0x5bc464;var _0x4b0e22;return db[_0xa265('0x32')][_0xa265('0x65')]({'where':{'id':_0x4a0e5b[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x1f004c,null))[_0xa265('0x28')](function(_0x16dc2a){if(_0x16dc2a){_0x5bc464=_0x16dc2a;_0x44aaab['model']=_[_0xa265('0x37')](db[_0xa265('0x66')][_0xa265('0x4c')]);_0x44aaab[_0xa265('0x36')]=_[_0xa265('0x37')](_0x4a0e5b[_0xa265('0x36')]);_0x44aaab[_0xa265('0x38')]=_[_0xa265('0x39')](_0x44aaab[_0xa265('0x3a')],_0x44aaab[_0xa265('0x36')]);_0x1f4bca['attributes']=_['intersection'](_0x44aaab[_0xa265('0x3a')],qs[_0xa265('0x3b')](_0x4a0e5b['query']['fields']));_0x1f4bca[_0xa265('0x3c')]=_0x1f4bca['attributes'][_0xa265('0x3d')]?_0x1f4bca[_0xa265('0x3c')]:_0x44aaab[_0xa265('0x3a')];_0x1f4bca['order']=qs[_0xa265('0x40')](_0x4a0e5b[_0xa265('0x36')]['sort']);_0x1f4bca[_0xa265('0x41')]=qs[_0xa265('0x38')](_[_0xa265('0x42')](_0x4a0e5b['query'],_0x44aaab['filters']));if(_0x4a0e5b[_0xa265('0x36')][_0xa265('0x43')]){_0x1f4bca['where']=_[_0xa265('0x44')](_0x1f4bca['where'],{'$or':_[_0xa265('0x31')](_0x1f4bca[_0xa265('0x3c')],function(_0x2cab3b){var _0x3aaac0={};_0x3aaac0[_0x2cab3b]={'$like':'%'+_0x4a0e5b[_0xa265('0x36')][_0xa265('0x43')]+'%'};return _0x3aaac0;})});}_0x1f4bca=_['merge']({},_0x1f4bca,_0x4a0e5b[_0xa265('0x46')]);return _0x5bc464[_0xa265('0x64')](_0x1f4bca);}})[_0xa265('0x28')](function(_0x25f6a4){if(_0x25f6a4){_0x4b0e22=_0x25f6a4[_0xa265('0x3d')];if(!_0x4a0e5b[_0xa265('0x36')][_0xa265('0x3e')](_0xa265('0x3f'))){_0x1f4bca[_0xa265('0x22')]=qs[_0xa265('0x22')](_0x4a0e5b['query'][_0xa265('0x22')]);_0x1f4bca[_0xa265('0x20')]=qs[_0xa265('0x20')](_0x4a0e5b[_0xa265('0x36')][_0xa265('0x20')]);}return _0x5bc464[_0xa265('0x64')](_0x1f4bca);}})[_0xa265('0x28')](function(_0x2287d2){if(_0x2287d2){return _0x2287d2?{'count':_0x4b0e22,'rows':_0x2287d2}:null;}})['then'](respondWithResult(_0x1f004c,null))[_0xa265('0x4f')](handleError(_0x1f004c,null));};exports[_0xa265('0x67')]=function(_0x4ed843,_0x19d38d,_0x87190){var _0x194b91=_0x4ed843[_0xa265('0x51')]['ids'];return db['Team'][_0xa265('0x48')]({'where':{'id':_0x194b91},'attributes':['id'],'include':[{'model':db[_0xa265('0x5c')],'as':_0xa265('0x68'),'attributes':['id','name',_0xa265('0x69'),_0xa265('0x6a'),_0xa265('0x6b')],'raw':!![]}]})['then'](function(_0x55ec8e){if(_0x55ec8e){var _0x2a87ab=_[_0xa265('0x6c')](_0x55ec8e,function(_0x114089){var _0x57fe9c=_0x114089['get']({'plain':!![]});return _0x57fe9c[_0xa265('0x68')];});return db['OpenchannelQueue'][_0xa265('0x4e')]({'where':{'id':_0x4ed843[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](function(_0x22ebc1){return db[_0xa265('0x6d')][_0xa265('0x6e')](function(_0x55c24c){return _0x22ebc1['addTeams'](_0x194b91,{'transaction':_0x55c24c})[_0xa265('0x28')](function(){return BPromise[_0xa265('0x6f')](_0x2a87ab,function(_0x26ddc3){return db['UserOpenchannelQueue'][_0xa265('0x70')]({'where':{'UserId':_0x26ddc3['id'],'OpenchannelQueueId':_0x4ed843[_0xa265('0x4b')]['id']},'transaction':_0x55c24c});});})[_0xa265('0x28')](function(){_0x2a87ab[_0xa265('0x71')](function(_0x712191){socket[_0xa265('0x72')](_0xa265('0x73'),{'UserId':_0x712191['id'],'OpenchannelQueueId':_0x22ebc1['id']});});});});});}})['then'](respondWithStatusCode(_0x19d38d,null))[_0xa265('0x4f')](handleError(_0x19d38d,null));};exports[_0xa265('0x74')]=function(_0x34533d,_0x2ca62d,_0x575cc4){return db['Team'][_0xa265('0x48')]({'where':{'id':_0x34533d[_0xa265('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa265('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa265('0x28')](handleEntityNotFound(_0x2ca62d,null))[_0xa265('0x28')](function(_0xe38c30){var _0x266c8a=_[_0xa265('0x31')](_0xe38c30,'id');var _0x495279=[];var _0x368375=[];var _0x25ada8=squel[_0xa265('0x75')]();_0x25ada8[_0xa265('0x76')](_0xa265('0x77'))[_0xa265('0x78')](_0xa265('0x79'),'tq')[_0xa265('0x7a')](_0xa265('0x7b'),'ut',_0xa265('0x7c'))[_0xa265('0x41')](_0xa265('0x7d'),_0x34533d['params']['id']);for(var _0x3ea726=0x0;_0x3ea726<_0xe38c30[_0xa265('0x3d')];_0x3ea726+=0x1){let _0x375864=_0xe38c30[_0x3ea726];for(var _0x40aa05=0x0;_0x40aa05<_0x375864[_0xa265('0x68')][_0xa265('0x3d')];_0x40aa05+=0x1){let _0x3827d4=_0x375864['Agents'][_0x40aa05];var _0x1b4d63=_0x25ada8[_0xa265('0x7e')]();_0x1b4d63[_0xa265('0x41')](_0xa265('0x7f'),_0x3827d4['id']);_0x368375[_0xa265('0x80')](db['sequelize'][_0xa265('0x36')](_0x1b4d63[_0xa265('0x81')](),{'type':db['sequelize'][_0xa265('0x82')][_0xa265('0x83')]})[_0xa265('0x28')](function(_0x5af438){if(_0x5af438['length']===0x1){return _0x3827d4['id'];}else{var _0xb14eba=_[_0xa265('0x84')](_[_0xa265('0x31')](_0x5af438,_0xa265('0x85')),function(_0xbf3b52){return _['includes'](_0x266c8a,_0xbf3b52);});if(_0xb14eba){return _0x3827d4['id'];}}}));}}return BPromise[_0xa265('0x86')](_0x368375)['then'](function(_0x3e465c){_0x495279=_(_0x495279)[_0xa265('0x87')](_0x3e465c)[_0xa265('0x88')]()[_0xa265('0x89')]();return db[_0xa265('0x32')]['find']({'where':{'id':_0x34533d[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](function(_0x39f6ce){return db[_0xa265('0x6d')][_0xa265('0x6e')](function(_0x4d540f){return _0x39f6ce['removeTeams'](_0x34533d[_0xa265('0x36')][_0xa265('0x8a')],{'transaction':_0x4d540f})[_0xa265('0x28')](function(){if(!_[_0xa265('0x8b')](_0x495279)){return _0x39f6ce[_0xa265('0x8c')](_0x495279,{'transaction':_0x4d540f});}})['then'](function(){_0x495279[_0xa265('0x71')](function(_0x42c440){socket[_0xa265('0x72')](_0xa265('0x8d'),{'UserId':_0x42c440,'OpenchannelQueueId':_0x39f6ce['id']});});});});});});})[_0xa265('0x28')](respondWithStatusCode(_0x2ca62d,null))[_0xa265('0x4f')](handleError(_0x2ca62d,null));};exports['addAgents']=function(_0x166325,_0x466dde,_0x4790c7){return db[_0xa265('0x32')]['find']({'where':{'id':_0x166325[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x466dde,null))[_0xa265('0x28')](function(_0x19ec69){if(_0x19ec69){return _0x19ec69['addAgents'](_0x166325[_0xa265('0x51')][_0xa265('0x8a')],_[_0xa265('0x8e')](_0x166325[_0xa265('0x51')],[_0xa265('0x8a'),'id'])||{})[_0xa265('0x8f')](function(_0x27f26d){for(var _0x1afb47=0x0;_0x1afb47<_0x166325[_0xa265('0x51')]['ids'][_0xa265('0x3d')];_0x1afb47+=0x1){socket['emit'](_0xa265('0x73'),{'UserId':Number(_0x166325[_0xa265('0x51')][_0xa265('0x8a')][_0x1afb47]),'OpenchannelQueueId':Number(_0x166325[_0xa265('0x4b')]['id'])});}return _0x27f26d;});}})['then'](respondWithResult(_0x466dde,null))['catch'](handleError(_0x466dde,null));};exports[_0xa265('0x8c')]=function(_0x11afcc,_0x3f06e6,_0x49f5b9){return db[_0xa265('0x32')][_0xa265('0x4e')]({'where':{'id':_0x11afcc[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x3f06e6,null))['then'](function(_0x18d7b8){if(_0x18d7b8){return _0x18d7b8[_0xa265('0x8c')](_0x11afcc[_0xa265('0x36')][_0xa265('0x8a')])['then'](function(){if(_[_0xa265('0x90')](_0x11afcc[_0xa265('0x36')]['ids'])){for(var _0x242794=0x0;_0x242794<_0x11afcc[_0xa265('0x36')][_0xa265('0x8a')][_0xa265('0x3d')];_0x242794+=0x1){socket[_0xa265('0x72')](_0xa265('0x8d'),{'UserId':Number(_0x11afcc[_0xa265('0x36')]['ids'][_0x242794]),'OpenchannelQueueId':Number(_0x11afcc['params']['id'])});}}else{socket[_0xa265('0x72')](_0xa265('0x8d'),{'UserId':Number(_0x11afcc[_0xa265('0x36')]['ids']),'OpenchannelQueueId':Number(_0x11afcc[_0xa265('0x4b')]['id'])});}});}})[_0xa265('0x28')](respondWithStatusCode(_0x3f06e6,null))[_0xa265('0x4f')](handleError(_0x3f06e6,null));};exports[_0xa265('0x91')]=function(_0x1932e7,_0x42be7f,_0x4b35f3){var _0x27ba93={};var _0x5976cb={};var _0x156a5a;var _0x3d607b;return db[_0xa265('0x32')]['findOne']({'where':{'id':_0x1932e7[_0xa265('0x4b')]['id']}})[_0xa265('0x28')](handleEntityNotFound(_0x42be7f,null))['then'](function(_0x43ee7e){if(_0x43ee7e){_0x156a5a=_0x43ee7e;_0x5976cb['model']=_[_0xa265('0x37')](db[_0xa265('0x5c')]['rawAttributes']);_0x5976cb[_0xa265('0x36')]=_[_0xa265('0x37')](_0x1932e7[_0xa265('0x36')]);_0x5976cb[_0xa265('0x38')]=_[_0xa265('0x39')](_0x5976cb[_0xa265('0x3a')],_0x5976cb[_0xa265('0x36')]);_0x27ba93[_0xa265('0x3c')]=_[_0xa265('0x39')](_0x5976cb[_0xa265('0x3a')],qs[_0xa265('0x3b')](_0x1932e7[_0xa265('0x36')][_0xa265('0x3b')]));_0x27ba93[_0xa265('0x3c')]=_0x27ba93['attributes']['length']?_0x27ba93['attributes']:_0x5976cb['model'];_0x27ba93[_0xa265('0x5a')]=qs[_0xa265('0x40')](_0x1932e7[_0xa265('0x36')][_0xa265('0x40')]);_0x27ba93[_0xa265('0x41')]=qs[_0xa265('0x38')](_[_0xa265('0x42')](_0x1932e7[_0xa265('0x36')],_0x5976cb[_0xa265('0x38')]));if(_0x1932e7[_0xa265('0x36')][_0xa265('0x43')]){_0x27ba93[_0xa265('0x41')]=_['merge'](_0x27ba93[_0xa265('0x41')],{'$or':_['map'](_0x27ba93[_0xa265('0x3c')],function(_0x582d61){var _0x2a8aa9={};_0x2a8aa9[_0x582d61]={'$like':'%'+_0x1932e7[_0xa265('0x36')]['filter']+'%'};return _0x2a8aa9;})});}_0x27ba93=_[_0xa265('0x44')]({},_0x27ba93,_0x1932e7['options']);return _0x156a5a['getAgents'](_0x27ba93);}})[_0xa265('0x28')](function(_0x3f9ac1){if(_0x3f9ac1){_0x3d607b=_0x3f9ac1[_0xa265('0x3d')];if(!_0x1932e7['query']['hasOwnProperty'](_0xa265('0x3f'))){_0x27ba93['limit']=qs[_0xa265('0x22')](_0x1932e7['query']['limit']);_0x27ba93[_0xa265('0x20')]=qs[_0xa265('0x20')](_0x1932e7[_0xa265('0x36')][_0xa265('0x20')]);}return _0x156a5a[_0xa265('0x91')](_0x27ba93);}})[_0xa265('0x28')](function(_0x126e68){if(_0x126e68){return _0x126e68?{'count':_0x3d607b,'rows':_0x126e68}:null;}})[_0xa265('0x28')](respondWithResult(_0x42be7f,null))[_0xa265('0x4f')](handleError(_0x42be7f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 2812b3e..911fe43 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 _0x06e1=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x30d7b5,_0x55ad20){var _0x45356d=function(_0x2252e0){while(--_0x2252e0){_0x30d7b5['push'](_0x30d7b5['shift']());}};_0x45356d(++_0x55ad20);}(_0x06e1,0xc2));var _0x106e=function(_0x2a16c4,_0x47dd61){_0x2a16c4=_0x2a16c4-0x0;var _0x2ce251=_0x06e1[_0x2a16c4];return _0x2ce251;};'use strict';var EventEmitter=require(_0x106e('0x0'));var OpenchannelQueue=require(_0x106e('0x1'))['db'][_0x106e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x106e('0x3')](0x0);var events={'afterCreate':_0x106e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x135b47){return function(_0x45cc23,_0x1d0c2e,_0x3e5df7){OpenchannelQueueEvents['emit'](_0x135b47+':'+_0x45cc23['id'],_0x45cc23);OpenchannelQueueEvents[_0x106e('0x5')](_0x135b47,_0x45cc23);_0x3e5df7(null);};}for(var e in events){if(events[_0x106e('0x6')](e)){var event=events[e];OpenchannelQueue[_0x106e('0x7')](e,emitEvent(event));}}module[_0x106e('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x86d5=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit'];(function(_0x117b32,_0x4b1cc2){var _0x35ffa6=function(_0x5e737b){while(--_0x5e737b){_0x117b32['push'](_0x117b32['shift']());}};_0x35ffa6(++_0x4b1cc2);}(_0x86d5,0x71));var _0x586d=function(_0x523671,_0x4657fc){_0x523671=_0x523671-0x0;var _0x5b0bdc=_0x86d5[_0x523671];return _0x5b0bdc;};'use strict';var EventEmitter=require(_0x586d('0x0'));var OpenchannelQueue=require(_0x586d('0x1'))['db'][_0x586d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x586d('0x3')](0x0);var events={'afterCreate':_0x586d('0x4'),'afterUpdate':_0x586d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2f0b54){return function(_0x361768,_0x3fee90,_0x329d04){OpenchannelQueueEvents[_0x586d('0x6')](_0x2f0b54+':'+_0x361768['id'],_0x361768);OpenchannelQueueEvents[_0x586d('0x6')](_0x2f0b54,_0x361768);_0x329d04(null);};}for(var e in events){if(events[_0x586d('0x7')](e)){var event=events[e];OpenchannelQueue[_0x586d('0x8')](e,emitEvent(event));}}module[_0x586d('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 0440ca2..9abd22b 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 _0x6ac7=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6ac7,0xe4));var _0x76ac=function(_0x279daa,_0x21eab9){_0x279daa=_0x279daa-0x0;var _0x52882b=_0x6ac7[_0x279daa];return _0x52882b;};'use strict';var _=require(_0x76ac('0x0'));var util=require(_0x76ac('0x1'));var logger=require('../../config/logger')(_0x76ac('0x2'));var moment=require(_0x76ac('0x3'));var BPromise=require(_0x76ac('0x4'));var rp=require(_0x76ac('0x5'));var fs=require('fs');var path=require(_0x76ac('0x6'));var rimraf=require(_0x76ac('0x7'));var config=require('../../config/environment');var attributes=require(_0x76ac('0x8'));module[_0x76ac('0x9')]=function(_0x692e45,_0x5e2faa){return _0x692e45[_0x76ac('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x76ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb24b=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x3439f2,_0x208e64){var _0xc1977f=function(_0x3e0ec3){while(--_0x3e0ec3){_0x3439f2['push'](_0x3439f2['shift']());}};_0xc1977f(++_0x208e64);}(_0xb24b,0xc0));var _0xbb24=function(_0x335e9c,_0x344543){_0x335e9c=_0x335e9c-0x0;var _0x1da1ec=_0xb24b[_0x335e9c];return _0x1da1ec;};'use strict';var _=require(_0xbb24('0x0'));var util=require(_0xbb24('0x1'));var logger=require(_0xbb24('0x2'))('api');var moment=require(_0xbb24('0x3'));var BPromise=require(_0xbb24('0x4'));var rp=require(_0xbb24('0x5'));var fs=require('fs');var path=require(_0xbb24('0x6'));var rimraf=require(_0xbb24('0x7'));var config=require(_0xbb24('0x8'));var attributes=require(_0xbb24('0x9'));module[_0xbb24('0xa')]=function(_0x2e9e2a,_0x47330c){return _0x2e9e2a[_0xbb24('0xb')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index a816a1f..11479c2 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 _0xcdfe=['defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','OpenchannelQueue','find','ShowOpenchannelQueue','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x14cba6,_0x2f7aae){var _0x29c735=function(_0x13b8e1){while(--_0x13b8e1){_0x14cba6['push'](_0x14cba6['shift']());}};_0x29c735(++_0x2f7aae);}(_0xcdfe,0x96));var _0xecdf=function(_0x1c6d21,_0x25f6aa){_0x1c6d21=_0x1c6d21-0x0;var _0xf03c0c=_0xcdfe[_0x1c6d21];return _0xf03c0c;};'use strict';var _=require('lodash');var util=require(_0xecdf('0x0'));var moment=require(_0xecdf('0x1'));var BPromise=require('bluebird');var rs=require(_0xecdf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecdf('0x3'))['db'];var utils=require(_0xecdf('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xecdf('0x5'));var jayson=require(_0xecdf('0x6'));var client=jayson[_0xecdf('0x7')][_0xecdf('0x8')]({'port':0x232a});config[_0xecdf('0x9')]=_[_0xecdf('0xa')](config[_0xecdf('0x9')],{'host':_0xecdf('0xb'),'port':0x18eb});var socket=require(_0xecdf('0xc'))(new Redis(config['redis']));require(_0xecdf('0xd'))[_0xecdf('0xe')](socket);function respondWithRpcPromise(_0x4ae9cb,_0x326747,_0x47b437){return new BPromise(function(_0x19c39d,_0x57e88a){return client['request'](_0x4ae9cb,_0x47b437)[_0xecdf('0xf')](function(_0x1a3e10){logger[_0xecdf('0x10')](_0xecdf('0x11'),_0x326747,_0xecdf('0x12'));logger[_0xecdf('0x13')](_0xecdf('0x14'),_0x326747,_0xecdf('0x12'),JSON[_0xecdf('0x15')](_0x1a3e10));if(_0x1a3e10['error']){if(_0x1a3e10[_0xecdf('0x16')][_0xecdf('0x17')]===0x1f4){logger[_0xecdf('0x16')](_0xecdf('0x11'),_0x326747,_0x1a3e10[_0xecdf('0x16')][_0xecdf('0x18')]);return _0x57e88a(_0x1a3e10['error'][_0xecdf('0x18')]);}logger[_0xecdf('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x326747,_0x1a3e10[_0xecdf('0x16')][_0xecdf('0x18')]);return _0x19c39d(_0x1a3e10[_0xecdf('0x16')][_0xecdf('0x18')]);}else{logger['info'](_0xecdf('0x11'),_0x326747,'request\x20sent');_0x19c39d(_0x1a3e10[_0xecdf('0x19')]['message']);}})['catch'](function(_0x26ca57){logger[_0xecdf('0x16')](_0xecdf('0x11'),_0x326747,_0x26ca57);_0x57e88a(_0x26ca57);});});}exports['GetOpenchannelQueue']=function(_0x35eacc){var _0x18b9b2=this;return new Promise(function(_0x40f699,_0x54cb1e){return db['OpenchannelQueue'][_0xecdf('0x1a')]({'raw':_0x35eacc[_0xecdf('0x1b')]?_0x35eacc['options'][_0xecdf('0x1c')]===undefined?!![]:![]:!![],'where':_0x35eacc['options']?_0x35eacc['options'][_0xecdf('0x1d')]||null:null,'attributes':_0x35eacc['options']?_0x35eacc[_0xecdf('0x1b')][_0xecdf('0x1e')]||null:null,'limit':_0x35eacc[_0xecdf('0x1b')]?_0x35eacc[_0xecdf('0x1b')][_0xecdf('0x1f')]||null:null,'include':_0x35eacc[_0xecdf('0x1b')]?_0x35eacc['options'][_0xecdf('0x20')]?_[_0xecdf('0x21')](_0x35eacc[_0xecdf('0x1b')][_0xecdf('0x20')],function(_0x24fc93){return{'model':db[_0x24fc93[_0xecdf('0x22')]],'as':_0x24fc93['as'],'attributes':_0x24fc93[_0xecdf('0x1e')],'include':_0x24fc93['include']?_[_0xecdf('0x21')](_0x24fc93[_0xecdf('0x20')],function(_0x4133b5){return{'model':db[_0x4133b5[_0xecdf('0x22')]],'as':_0x4133b5['as'],'attributes':_0x4133b5['attributes'],'include':_0x4133b5[_0xecdf('0x20')]?_[_0xecdf('0x21')](_0x4133b5[_0xecdf('0x20')],function(_0x446884){return{'model':db[_0x446884[_0xecdf('0x22')]],'as':_0x446884['as'],'attributes':_0x446884['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4b96){logger['info'](_0xecdf('0x23'),_0x35eacc);logger['debug'](_0xecdf('0x23'),_0x35eacc,JSON[_0xecdf('0x15')](_0x4f4b96));_0x40f699(_0x4f4b96);})['catch'](function(_0x1cc3f6){logger[_0xecdf('0x16')]('GetOpenchannelQueue',_0x1cc3f6[_0xecdf('0x18')],_0x35eacc);_0x54cb1e(_0x18b9b2[_0xecdf('0x16')](0x1f4,_0x1cc3f6[_0xecdf('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x471a9a){var _0x2d0962=this;return new Promise(function(_0x360120,_0x2d7700){return db[_0xecdf('0x24')][_0xecdf('0x25')]({'raw':_0x471a9a[_0xecdf('0x1b')]?_0x471a9a[_0xecdf('0x1b')][_0xecdf('0x1c')]===undefined?!![]:![]:!![],'where':_0x471a9a[_0xecdf('0x1b')]?_0x471a9a[_0xecdf('0x1b')]['where']||null:null,'attributes':_0x471a9a[_0xecdf('0x1b')]?_0x471a9a[_0xecdf('0x1b')][_0xecdf('0x1e')]||null:null,'include':_0x471a9a[_0xecdf('0x1b')]?_0x471a9a[_0xecdf('0x1b')][_0xecdf('0x20')]?_[_0xecdf('0x21')](_0x471a9a[_0xecdf('0x1b')][_0xecdf('0x20')],function(_0x13461a){return{'model':db[_0x13461a[_0xecdf('0x22')]],'as':_0x13461a['as'],'attributes':_0x13461a['attributes'],'include':_0x13461a[_0xecdf('0x20')]?_['map'](_0x13461a[_0xecdf('0x20')],function(_0x4d4bfe){return{'model':db[_0x4d4bfe[_0xecdf('0x22')]],'as':_0x4d4bfe['as'],'attributes':_0x4d4bfe[_0xecdf('0x1e')],'include':_0x4d4bfe[_0xecdf('0x20')]?_['map'](_0x4d4bfe[_0xecdf('0x20')],function(_0x3d8415){return{'model':db[_0x3d8415['model']],'as':_0x3d8415['as'],'attributes':_0x3d8415[_0xecdf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xecdf('0xf')](function(_0x45c6af){logger[_0xecdf('0x10')](_0xecdf('0x26'),_0x471a9a);logger[_0xecdf('0x13')](_0xecdf('0x26'),_0x471a9a,JSON[_0xecdf('0x15')](_0x45c6af));_0x360120(_0x45c6af);})[_0xecdf('0x27')](function(_0x42a747){logger['error'](_0xecdf('0x26'),_0x42a747[_0xecdf('0x18')],_0x471a9a);_0x2d7700(_0x2d0962['error'](0x1f4,_0x42a747[_0xecdf('0x18')]));});});}; \ No newline at end of file +var _0x9075=['ShowOpenchannelQueue','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x35dadd,_0x3ed50f){var _0x2728ed=function(_0x80656f){while(--_0x80656f){_0x35dadd['push'](_0x35dadd['shift']());}};_0x2728ed(++_0x3ed50f);}(_0x9075,0x1e1));var _0x5907=function(_0x5c609f,_0x121078){_0x5c609f=_0x5c609f-0x0;var _0x3e934d=_0x9075[_0x5c609f];return _0x3e934d;};'use strict';var _=require(_0x5907('0x0'));var util=require(_0x5907('0x1'));var moment=require(_0x5907('0x2'));var BPromise=require(_0x5907('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5907('0x4'));var logger=require(_0x5907('0x5'))(_0x5907('0x6'));var config=require(_0x5907('0x7'));var jayson=require(_0x5907('0x8'));var client=jayson[_0x5907('0x9')][_0x5907('0xa')]({'port':0x232a});config[_0x5907('0xb')]=_[_0x5907('0xc')](config[_0x5907('0xb')],{'host':_0x5907('0xd'),'port':0x18eb});var socket=require(_0x5907('0xe'))(new Redis(config[_0x5907('0xb')]));require(_0x5907('0xf'))[_0x5907('0x10')](socket);function respondWithRpcPromise(_0x453784,_0x4848d3,_0x230c57){return new BPromise(function(_0x34ca33,_0x103cd0){return client[_0x5907('0x11')](_0x453784,_0x230c57)[_0x5907('0x12')](function(_0x27094c){logger[_0x5907('0x13')](_0x5907('0x14'),_0x4848d3,'request\x20sent');logger[_0x5907('0x15')](_0x5907('0x16'),_0x4848d3,'request\x20sent',JSON[_0x5907('0x17')](_0x27094c));if(_0x27094c[_0x5907('0x18')]){if(_0x27094c[_0x5907('0x18')]['code']===0x1f4){logger[_0x5907('0x18')](_0x5907('0x14'),_0x4848d3,_0x27094c[_0x5907('0x18')][_0x5907('0x19')]);return _0x103cd0(_0x27094c[_0x5907('0x18')][_0x5907('0x19')]);}logger[_0x5907('0x18')](_0x5907('0x14'),_0x4848d3,_0x27094c['error']['message']);return _0x34ca33(_0x27094c['error']['message']);}else{logger['info'](_0x5907('0x14'),_0x4848d3,'request\x20sent');_0x34ca33(_0x27094c[_0x5907('0x1a')][_0x5907('0x19')]);}})[_0x5907('0x1b')](function(_0x55e982){logger[_0x5907('0x18')](_0x5907('0x14'),_0x4848d3,_0x55e982);_0x103cd0(_0x55e982);});});}exports[_0x5907('0x1c')]=function(_0x6a43e6){var _0x2ae518=this;return new Promise(function(_0x5309b2,_0x44c139){return db[_0x5907('0x1d')][_0x5907('0x1e')]({'raw':_0x6a43e6['options']?_0x6a43e6[_0x5907('0x1f')][_0x5907('0x20')]===undefined?!![]:![]:!![],'where':_0x6a43e6[_0x5907('0x1f')]?_0x6a43e6[_0x5907('0x1f')][_0x5907('0x21')]||null:null,'attributes':_0x6a43e6[_0x5907('0x1f')]?_0x6a43e6[_0x5907('0x1f')]['attributes']||null:null,'limit':_0x6a43e6[_0x5907('0x1f')]?_0x6a43e6['options'][_0x5907('0x22')]||null:null,'include':_0x6a43e6[_0x5907('0x1f')]?_0x6a43e6[_0x5907('0x1f')][_0x5907('0x23')]?_[_0x5907('0x24')](_0x6a43e6['options']['include'],function(_0x1329fa){return{'model':db[_0x1329fa[_0x5907('0x25')]],'as':_0x1329fa['as'],'attributes':_0x1329fa[_0x5907('0x26')],'include':_0x1329fa[_0x5907('0x23')]?_[_0x5907('0x24')](_0x1329fa[_0x5907('0x23')],function(_0x991a99){return{'model':db[_0x991a99[_0x5907('0x25')]],'as':_0x991a99['as'],'attributes':_0x991a99['attributes'],'include':_0x991a99[_0x5907('0x23')]?_[_0x5907('0x24')](_0x991a99[_0x5907('0x23')],function(_0x270b74){return{'model':db[_0x270b74[_0x5907('0x25')]],'as':_0x270b74['as'],'attributes':_0x270b74[_0x5907('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5907('0x12')](function(_0x4fe279){logger[_0x5907('0x13')](_0x5907('0x1c'),_0x6a43e6);logger['debug'](_0x5907('0x1c'),_0x6a43e6,JSON['stringify'](_0x4fe279));_0x5309b2(_0x4fe279);})[_0x5907('0x1b')](function(_0x1e558){logger[_0x5907('0x18')](_0x5907('0x1c'),_0x1e558['message'],_0x6a43e6);_0x44c139(_0x2ae518[_0x5907('0x18')](0x1f4,_0x1e558[_0x5907('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x5bdc36){var _0x58df50=this;return new Promise(function(_0x3cdfb0,_0xe64a36){return db['OpenchannelQueue']['find']({'raw':_0x5bdc36[_0x5907('0x1f')]?_0x5bdc36[_0x5907('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5bdc36[_0x5907('0x1f')]?_0x5bdc36['options'][_0x5907('0x21')]||null:null,'attributes':_0x5bdc36[_0x5907('0x1f')]?_0x5bdc36[_0x5907('0x1f')][_0x5907('0x26')]||null:null,'include':_0x5bdc36[_0x5907('0x1f')]?_0x5bdc36['options'][_0x5907('0x23')]?_[_0x5907('0x24')](_0x5bdc36['options']['include'],function(_0x3f383a){return{'model':db[_0x3f383a['model']],'as':_0x3f383a['as'],'attributes':_0x3f383a[_0x5907('0x26')],'include':_0x3f383a[_0x5907('0x23')]?_['map'](_0x3f383a['include'],function(_0x3cdac7){return{'model':db[_0x3cdac7[_0x5907('0x25')]],'as':_0x3cdac7['as'],'attributes':_0x3cdac7['attributes'],'include':_0x3cdac7['include']?_[_0x5907('0x24')](_0x3cdac7[_0x5907('0x23')],function(_0x455470){return{'model':db[_0x455470['model']],'as':_0x455470['as'],'attributes':_0x455470[_0x5907('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x123dcb){logger[_0x5907('0x13')](_0x5907('0x27'),_0x5bdc36);logger[_0x5907('0x15')]('ShowOpenchannelQueue',_0x5bdc36,JSON[_0x5907('0x17')](_0x123dcb));_0x3cdfb0(_0x123dcb);})[_0x5907('0x1b')](function(_0x5bade0){logger[_0x5907('0x18')]('ShowOpenchannelQueue',_0x5bade0['message'],_0x5bdc36);_0xe64a36(_0x58df50[_0x5907('0x18')](0x1f4,_0x5bade0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e2cadb2..cb5d5b0 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 _0x1f7f=['emit','removeListener','register','save','remove'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1f7f,0x13e));var _0xf1f7=function(_0x8cd627,_0x1bf5ca){_0x8cd627=_0x8cd627-0x0;var _0x7e454=_0x1f7f[_0x8cd627];return _0x7e454;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xf1f7('0x0'),_0xf1f7('0x1'),'update'];function createListener(_0x594921,_0x1192a5){return function(_0x592b91){_0x1192a5[_0xf1f7('0x2')](_0x594921,_0x592b91);};}function removeListener(_0x5254e1,_0x1fcd3a){return function(){OpenchannelQueueEvents[_0xf1f7('0x3')](_0x5254e1,_0x1fcd3a);};}exports[_0xf1f7('0x4')]=function(_0x5a8523){for(var _0x58f2df=0x0,_0x53a84e=events['length'];_0x58f2df<_0x53a84e;_0x58f2df++){var _0x4151db=events[_0x58f2df];var _0x45a5c0=createListener('openchannelQueue:'+_0x4151db,_0x5a8523);OpenchannelQueueEvents['on'](_0x4151db,_0x45a5c0);}}; \ No newline at end of file +var _0xf1f2=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0x48e617,_0xc6fbc1){var _0x5bcb0b=function(_0x574451){while(--_0x574451){_0x48e617['push'](_0x48e617['shift']());}};_0x5bcb0b(++_0xc6fbc1);}(_0xf1f2,0xa4));var _0x2f1f=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0xf1f2[_0x38841c];return _0x500610;};'use strict';var OpenchannelQueueEvents=require(_0x2f1f('0x0'));var events=[_0x2f1f('0x1'),_0x2f1f('0x2'),_0x2f1f('0x3')];function createListener(_0x2eb64f,_0x3af5d0){return function(_0x3e98d8){_0x3af5d0['emit'](_0x2eb64f,_0x3e98d8);};}function removeListener(_0x367f39,_0x4979c9){return function(){OpenchannelQueueEvents[_0x2f1f('0x4')](_0x367f39,_0x4979c9);};}exports[_0x2f1f('0x5')]=function(_0x42850c){for(var _0x50ff21=0x0,_0x2ea2ec=events[_0x2f1f('0x6')];_0x50ff21<_0x2ea2ec;_0x50ff21++){var _0x14c886=events[_0x50ff21];var _0x533ff0=createListener(_0x2f1f('0x7')+_0x14c886,_0x42850c);OpenchannelQueueEvents['on'](_0x14c886,_0x533ff0);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 9783944..65dff4b 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 _0x386a=['delete','destroy','multer','util','express','Router','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x51750e,_0x44147c){var _0x3e703f=function(_0xfca091){while(--_0xfca091){_0x51750e['push'](_0x51750e['shift']());}};_0x3e703f(++_0x44147c);}(_0x386a,0x1ab));var _0xa386=function(_0x343463,_0x1cdc12){_0x343463=_0x343463-0x0;var _0x3d2ae9=_0x386a[_0x343463];return _0x3d2ae9;};'use strict';var multer=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa386('0x2'));var router=express[_0xa386('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa386('0x4'));var controller=require(_0xa386('0x5'));router[_0xa386('0x6')]('/',auth[_0xa386('0x7')](),controller[_0xa386('0x8')]);router[_0xa386('0x6')](_0xa386('0x9'),auth[_0xa386('0x7')](),controller[_0xa386('0xa')]);router[_0xa386('0x6')](_0xa386('0xb'),auth[_0xa386('0x7')](),controller['show']);router[_0xa386('0xc')]('/',auth['isAuthenticated'](),controller[_0xa386('0xd')]);router[_0xa386('0xe')](_0xa386('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa386('0xf')](_0xa386('0xb'),auth[_0xa386('0x7')](),controller[_0xa386('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb9b0=['isAuthenticated','index','get','/describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x57f802,_0x51b159){var _0x324c9b=function(_0x4b70ea){while(--_0x4b70ea){_0x57f802['push'](_0x57f802['shift']());}};_0x324c9b(++_0x51b159);}(_0xb9b0,0xa3));var _0x0b9b=function(_0x20169c,_0x51a788){_0x20169c=_0x20169c-0x0;var _0x4a561b=_0xb9b0[_0x20169c];return _0x4a561b;};'use strict';var multer=require(_0x0b9b('0x0'));var util=require(_0x0b9b('0x1'));var path=require(_0x0b9b('0x2'));var timeout=require(_0x0b9b('0x3'));var express=require('express');var router=express[_0x0b9b('0x4')]();var fs_extra=require(_0x0b9b('0x5'));var auth=require(_0x0b9b('0x6'));var interaction=require(_0x0b9b('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x0b9b('0x8')](),controller[_0x0b9b('0x9')]);router[_0x0b9b('0xa')](_0x0b9b('0xb'),auth[_0x0b9b('0x8')](),controller['describe']);router[_0x0b9b('0xa')](_0x0b9b('0xc'),auth[_0x0b9b('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0b9b('0xd')]);router[_0x0b9b('0xe')]('/:id',auth[_0x0b9b('0x8')](),controller[_0x0b9b('0xf')]);router[_0x0b9b('0x10')](_0x0b9b('0xc'),auth[_0x0b9b('0x8')](),controller[_0x0b9b('0x11')]);module[_0x0b9b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 72e6ea4..d098591 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 _0x5d3f=['STRING','DATE','moment','sequelize','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x5d3f,0x18d));var _0xf5d3=function(_0x91da37,_0x154b3a){_0x91da37=_0x91da37-0x0;var _0x32bd3e=_0x5d3f[_0x91da37];return _0x32bd3e;};'use strict';var moment=require(_0xf5d3('0x0'));var Sequelize=require(_0xf5d3('0x1'));module[_0xf5d3('0x2')]={'uniqueid':{'type':Sequelize[_0xf5d3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf5d3('0x3')]},'joinAt':{'type':Sequelize[_0xf5d3('0x4')]},'leaveAt':{'type':Sequelize[_0xf5d3('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf5d3('0x3')]}}; \ No newline at end of file +var _0xd089=['DATE','moment','sequelize','STRING'];(function(_0x96a951,_0x2ac0a6){var _0x3371c0=function(_0x59a262){while(--_0x59a262){_0x96a951['push'](_0x96a951['shift']());}};_0x3371c0(++_0x2ac0a6);}(_0xd089,0xb9));var _0x9d08=function(_0x4a5663,_0x9fa597){_0x4a5663=_0x4a5663-0x0;var _0x1b08bb=_0xd089[_0x4a5663];return _0x1b08bb;};'use strict';var moment=require(_0x9d08('0x0'));var Sequelize=require(_0x9d08('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9d08('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9d08('0x2')]},'joinAt':{'type':Sequelize[_0x9d08('0x3')]},'leaveAt':{'type':Sequelize[_0x9d08('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 0908a7f..9c3a96d 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 _0x1479=['includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','OpenchannelQueueReport','rawAttributes','fieldName','type','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x1c3dde,_0x157a15){var _0x3f3e84=function(_0x16860f){while(--_0x16860f){_0x1c3dde['push'](_0x1c3dde['shift']());}};_0x3f3e84(++_0x157a15);}(_0x1479,0x1af));var _0x9147=function(_0x199165,_0x542072){_0x199165=_0x199165-0x0;var _0x1e4816=_0x1479[_0x199165];return _0x1e4816;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9147('0x0'));var jsonpatch=require(_0x9147('0x1'));var rp=require(_0x9147('0x2'));var moment=require('moment');var BPromise=require(_0x9147('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9147('0x4'));var sox=require(_0x9147('0x5'));var csv=require(_0x9147('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9147('0x7'));var _=require(_0x9147('0x8'));var squel=require(_0x9147('0x9'));var crypto=require(_0x9147('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9147('0xb'));var toCsv=require(_0x9147('0x6'));var querystring=require(_0x9147('0xc'));var Papa=require(_0x9147('0xd'));var Redis=require(_0x9147('0xe'));var authService=require(_0x9147('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9147('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9147('0x11'));var utils=require(_0x9147('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9147('0x13'));var db=require(_0x9147('0x14'))['db'];function respondWithStatusCode(_0x51d4f8,_0x219a29){_0x219a29=_0x219a29||0xcc;return function(_0xc685ee){if(_0xc685ee){return _0x51d4f8[_0x9147('0x15')](_0x219a29);}return _0x51d4f8['status'](_0x219a29)[_0x9147('0x16')]();};}function respondWithResult(_0xc9a3e5,_0x5da0a4){_0x5da0a4=_0x5da0a4||0xc8;return function(_0x3f0316){if(_0x3f0316){return _0xc9a3e5['status'](_0x5da0a4)['json'](_0x3f0316);}};}function respondWithFilteredResult(_0x3389d2,_0x49a813){return function(_0x2ad809){if(_0x2ad809){var _0x1a0ecc=typeof _0x49a813['offset']===_0x9147('0x17')&&typeof _0x49a813['limit']===_0x9147('0x17');var _0x112047=_0x2ad809[_0x9147('0x18')];var _0x46cfa8=_0x1a0ecc?0x0:_0x49a813['offset'];var _0x5553e3=_0x1a0ecc?_0x2ad809[_0x9147('0x18')]:_0x49a813[_0x9147('0x19')]+_0x49a813[_0x9147('0x1a')];var _0xf5cfe2;if(_0x5553e3>=_0x112047){_0x5553e3=_0x112047;_0xf5cfe2=0xc8;}else{_0xf5cfe2=0xce;}_0x3389d2[_0x9147('0x1b')](_0xf5cfe2);return _0x3389d2[_0x9147('0x1c')](_0x9147('0x1d'),_0x46cfa8+'-'+_0x5553e3+'/'+_0x112047)['json'](_0x2ad809);}return null;};}function patchUpdates(_0x53ee36){return function(_0x1eed5b){try{jsonpatch[_0x9147('0x1e')](_0x1eed5b,_0x53ee36,!![]);}catch(_0x56f27d){return BPromise[_0x9147('0x1f')](_0x56f27d);}return _0x1eed5b[_0x9147('0x20')]();};}function saveUpdates(_0x15c6c4,_0x11f49d){return function(_0xae8e81){if(_0xae8e81){return _0xae8e81[_0x9147('0x21')](_0x15c6c4)[_0x9147('0x22')](function(_0x31e26a){return _0x31e26a;});}return null;};}function removeEntity(_0x43a27d,_0x28706c){return function(_0x331eee){if(_0x331eee){return _0x331eee[_0x9147('0x23')]()[_0x9147('0x22')](function(){_0x43a27d[_0x9147('0x1b')](0xcc)[_0x9147('0x16')]();});}};}function handleEntityNotFound(_0x4f8078,_0x23b746){return function(_0x1550de){if(!_0x1550de){_0x4f8078['sendStatus'](0x194);}return _0x1550de;};}function handleError(_0x3e0b16,_0x236890){_0x236890=_0x236890||0x1f4;return function(_0x2006d1){logger[_0x9147('0x24')](_0x2006d1[_0x9147('0x25')]);if(_0x2006d1['name']){delete _0x2006d1['name'];}_0x3e0b16[_0x9147('0x1b')](_0x236890)['send'](_0x2006d1);};}exports[_0x9147('0x26')]=function(_0x2306bb,_0x27ac2f){var _0x3860ec={},_0x5b2349={},_0x51da07={'count':0x0,'rows':[]};var _0x5efb26=_['map'](db[_0x9147('0x27')][_0x9147('0x28')],function(_0x3765ee){return{'name':_0x3765ee[_0x9147('0x29')],'type':_0x3765ee[_0x9147('0x2a')]['key']};});_0x5b2349[_0x9147('0x2b')]=_[_0x9147('0x2c')](_0x5efb26,_0x9147('0x2d'));_0x5b2349[_0x9147('0x2e')]=_['keys'](_0x2306bb[_0x9147('0x2e')]);_0x5b2349[_0x9147('0x2f')]=_['intersection'](_0x5b2349[_0x9147('0x2b')],_0x5b2349[_0x9147('0x2e')]);_0x3860ec[_0x9147('0x30')]=_[_0x9147('0x31')](_0x5b2349[_0x9147('0x2b')],qs[_0x9147('0x32')](_0x2306bb[_0x9147('0x2e')][_0x9147('0x32')]));_0x3860ec[_0x9147('0x30')]=_0x3860ec[_0x9147('0x30')][_0x9147('0x33')]?_0x3860ec[_0x9147('0x30')]:_0x5b2349[_0x9147('0x2b')];if(!_0x2306bb['query'][_0x9147('0x34')](_0x9147('0x35'))){_0x3860ec['limit']=qs[_0x9147('0x1a')](_0x2306bb['query'][_0x9147('0x1a')]);_0x3860ec['offset']=qs[_0x9147('0x19')](_0x2306bb[_0x9147('0x2e')][_0x9147('0x19')]);}_0x3860ec[_0x9147('0x36')]=qs[_0x9147('0x37')](_0x2306bb[_0x9147('0x2e')][_0x9147('0x37')]);_0x3860ec[_0x9147('0x38')]=qs[_0x9147('0x2f')](_['pick'](_0x2306bb[_0x9147('0x2e')],_0x5b2349[_0x9147('0x2f')]),_0x5efb26);if(_0x2306bb[_0x9147('0x2e')][_0x9147('0x39')]){_0x3860ec[_0x9147('0x38')]=_[_0x9147('0x3a')](_0x3860ec[_0x9147('0x38')],{'$or':_[_0x9147('0x2c')](_0x5efb26,function(_0xafe824){if(_0xafe824[_0x9147('0x2a')]!=='VIRTUAL'){var _0x4d4289={};_0x4d4289[_0xafe824[_0x9147('0x2d')]]={'$like':'%'+_0x2306bb[_0x9147('0x2e')][_0x9147('0x39')]+'%'};return _0x4d4289;}})});}_0x3860ec=_[_0x9147('0x3a')]({},_0x3860ec,_0x2306bb['options']);var _0x5a7686={'where':_0x3860ec[_0x9147('0x38')]};return db[_0x9147('0x27')][_0x9147('0x18')](_0x5a7686)[_0x9147('0x22')](function(_0x153dc1){_0x51da07[_0x9147('0x18')]=_0x153dc1;if(_0x2306bb[_0x9147('0x2e')][_0x9147('0x3b')]){_0x3860ec[_0x9147('0x3c')]=[{'all':!![]}];}return db[_0x9147('0x27')][_0x9147('0x3d')](_0x3860ec);})[_0x9147('0x22')](function(_0x270a8a){_0x51da07['rows']=_0x270a8a;return _0x51da07;})[_0x9147('0x22')](respondWithFilteredResult(_0x27ac2f,_0x3860ec))[_0x9147('0x3e')](handleError(_0x27ac2f,null));};exports[_0x9147('0x3f')]=function(_0x2cd725,_0x33e524){var _0x1eaca1={'raw':!![],'where':{'id':_0x2cd725[_0x9147('0x40')]['id']}},_0x45c199={};_0x45c199['model']=_[_0x9147('0x41')](db[_0x9147('0x27')][_0x9147('0x28')]);_0x45c199[_0x9147('0x2e')]=_[_0x9147('0x41')](_0x2cd725[_0x9147('0x2e')]);_0x45c199[_0x9147('0x2f')]=_[_0x9147('0x31')](_0x45c199[_0x9147('0x2b')],_0x45c199['query']);_0x1eaca1['attributes']=_[_0x9147('0x31')](_0x45c199[_0x9147('0x2b')],qs['fields'](_0x2cd725['query'][_0x9147('0x32')]));_0x1eaca1[_0x9147('0x30')]=_0x1eaca1[_0x9147('0x30')][_0x9147('0x33')]?_0x1eaca1['attributes']:_0x45c199['model'];if(_0x2cd725[_0x9147('0x2e')][_0x9147('0x3b')]){_0x1eaca1['include']=[{'all':!![]}];}_0x1eaca1=_[_0x9147('0x3a')]({},_0x1eaca1,_0x2cd725['options']);return db[_0x9147('0x27')][_0x9147('0x42')](_0x1eaca1)['then'](handleEntityNotFound(_0x33e524,null))['then'](respondWithResult(_0x33e524,null))[_0x9147('0x3e')](handleError(_0x33e524,null));};exports[_0x9147('0x43')]=function(_0x3ffc9c,_0x35d1ab){return db[_0x9147('0x27')][_0x9147('0x43')](_0x3ffc9c[_0x9147('0x44')],{})['then'](respondWithResult(_0x35d1ab,0xc9))[_0x9147('0x3e')](handleError(_0x35d1ab,null));};exports[_0x9147('0x21')]=function(_0x1a08a5,_0x2dedf7){if(_0x1a08a5['body']['id']){delete _0x1a08a5['body']['id'];}return db[_0x9147('0x27')][_0x9147('0x42')]({'where':{'id':_0x1a08a5[_0x9147('0x40')]['id']}})['then'](handleEntityNotFound(_0x2dedf7,null))[_0x9147('0x22')](saveUpdates(_0x1a08a5[_0x9147('0x44')],null))[_0x9147('0x22')](respondWithResult(_0x2dedf7,null))[_0x9147('0x3e')](handleError(_0x2dedf7,null));};exports[_0x9147('0x23')]=function(_0x4e0994,_0xa4eb1d){return db[_0x9147('0x27')][_0x9147('0x42')]({'where':{'id':_0x4e0994['params']['id']}})[_0x9147('0x22')](handleEntityNotFound(_0xa4eb1d,null))[_0x9147('0x22')](removeEntity(_0xa4eb1d,null))[_0x9147('0x3e')](handleError(_0xa4eb1d,null));};exports[_0x9147('0x45')]=function(_0x49f6b8,_0x1dc418){return db['OpenchannelQueueReport'][_0x9147('0x45')]()['then'](respondWithResult(_0x1dc418,null))[_0x9147('0x3e')](handleError(_0x1dc418,null));}; \ No newline at end of file +var _0xe529=['then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','reject','save'];(function(_0x2fea44,_0x4c909e){var _0x358c67=function(_0x53dd2c){while(--_0x53dd2c){_0x2fea44['push'](_0x2fea44['shift']());}};_0x358c67(++_0x4c909e);}(_0xe529,0x160));var _0x9e52=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0xe529[_0x52ae40];return _0xab6ed1;};'use strict';var emlformat=require(_0x9e52('0x0'));var rimraf=require(_0x9e52('0x1'));var zipdir=require(_0x9e52('0x2'));var jsonpatch=require(_0x9e52('0x3'));var rp=require('request-promise');var moment=require(_0x9e52('0x4'));var BPromise=require(_0x9e52('0x5'));var Mustache=require(_0x9e52('0x6'));var util=require(_0x9e52('0x7'));var path=require(_0x9e52('0x8'));var sox=require(_0x9e52('0x9'));var csv=require('to-csv');var ejs=require(_0x9e52('0xa'));var fs=require('fs');var fs_extra=require(_0x9e52('0xb'));var _=require(_0x9e52('0xc'));var squel=require(_0x9e52('0xd'));var crypto=require(_0x9e52('0xe'));var jsforce=require(_0x9e52('0xf'));var deskjs=require(_0x9e52('0x10'));var toCsv=require(_0x9e52('0x11'));var querystring=require(_0x9e52('0x12'));var Papa=require(_0x9e52('0x13'));var Redis=require(_0x9e52('0x14'));var authService=require(_0x9e52('0x15'));var qs=require(_0x9e52('0x16'));var as=require(_0x9e52('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9e52('0x18'));var utils=require(_0x9e52('0x19'));var config=require(_0x9e52('0x1a'));var licenseUtil=require(_0x9e52('0x1b'));var db=require(_0x9e52('0x1c'))['db'];function respondWithStatusCode(_0x2acbf1,_0x56f615){_0x56f615=_0x56f615||0xcc;return function(_0x20cbac){if(_0x20cbac){return _0x2acbf1['sendStatus'](_0x56f615);}return _0x2acbf1[_0x9e52('0x1d')](_0x56f615)[_0x9e52('0x1e')]();};}function respondWithResult(_0x2ab0d6,_0x332f4d){_0x332f4d=_0x332f4d||0xc8;return function(_0x60b2a){if(_0x60b2a){return _0x2ab0d6[_0x9e52('0x1d')](_0x332f4d)[_0x9e52('0x1f')](_0x60b2a);}};}function respondWithFilteredResult(_0x5c289a,_0x7a047c){return function(_0x5101ed){if(_0x5101ed){var _0x14f2ed=typeof _0x7a047c[_0x9e52('0x20')]===_0x9e52('0x21')&&typeof _0x7a047c['limit']===_0x9e52('0x21');var _0x1e0a97=_0x5101ed[_0x9e52('0x22')];var _0xb71806=_0x14f2ed?0x0:_0x7a047c[_0x9e52('0x20')];var _0x3efe50=_0x14f2ed?_0x5101ed['count']:_0x7a047c[_0x9e52('0x20')]+_0x7a047c[_0x9e52('0x23')];var _0x45febe;if(_0x3efe50>=_0x1e0a97){_0x3efe50=_0x1e0a97;_0x45febe=0xc8;}else{_0x45febe=0xce;}_0x5c289a[_0x9e52('0x1d')](_0x45febe);return _0x5c289a['set']('Content-Range',_0xb71806+'-'+_0x3efe50+'/'+_0x1e0a97)['json'](_0x5101ed);}return null;};}function patchUpdates(_0x523ea3){return function(_0x5e952c){try{jsonpatch['apply'](_0x5e952c,_0x523ea3,!![]);}catch(_0x4eb873){return BPromise[_0x9e52('0x24')](_0x4eb873);}return _0x5e952c[_0x9e52('0x25')]();};}function saveUpdates(_0x4c110b,_0x19792b){return function(_0x45a9da){if(_0x45a9da){return _0x45a9da['update'](_0x4c110b)[_0x9e52('0x26')](function(_0x599d05){return _0x599d05;});}return null;};}function removeEntity(_0x23020b,_0x17ec7f){return function(_0x5f45ea){if(_0x5f45ea){return _0x5f45ea[_0x9e52('0x27')]()[_0x9e52('0x26')](function(){_0x23020b[_0x9e52('0x1d')](0xcc)[_0x9e52('0x1e')]();});}};}function handleEntityNotFound(_0x4426e3,_0x530be0){return function(_0x295105){if(!_0x295105){_0x4426e3['sendStatus'](0x194);}return _0x295105;};}function handleError(_0x52879b,_0x4f99af){_0x4f99af=_0x4f99af||0x1f4;return function(_0x119a25){logger[_0x9e52('0x28')](_0x119a25[_0x9e52('0x29')]);if(_0x119a25[_0x9e52('0x2a')]){delete _0x119a25[_0x9e52('0x2a')];}_0x52879b[_0x9e52('0x1d')](_0x4f99af)[_0x9e52('0x2b')](_0x119a25);};}exports['index']=function(_0x8146c2,_0x24f44e){var _0x2f2954={},_0x575ae6={},_0x5b55a6={'count':0x0,'rows':[]};var _0x58283d=_[_0x9e52('0x2c')](db[_0x9e52('0x2d')][_0x9e52('0x2e')],function(_0x1fcc29){return{'name':_0x1fcc29[_0x9e52('0x2f')],'type':_0x1fcc29['type'][_0x9e52('0x30')]};});_0x575ae6[_0x9e52('0x31')]=_[_0x9e52('0x2c')](_0x58283d,'name');_0x575ae6['query']=_[_0x9e52('0x32')](_0x8146c2[_0x9e52('0x33')]);_0x575ae6['filters']=_['intersection'](_0x575ae6[_0x9e52('0x31')],_0x575ae6[_0x9e52('0x33')]);_0x2f2954[_0x9e52('0x34')]=_[_0x9e52('0x35')](_0x575ae6[_0x9e52('0x31')],qs[_0x9e52('0x36')](_0x8146c2['query'][_0x9e52('0x36')]));_0x2f2954[_0x9e52('0x34')]=_0x2f2954['attributes'][_0x9e52('0x37')]?_0x2f2954[_0x9e52('0x34')]:_0x575ae6[_0x9e52('0x31')];if(!_0x8146c2[_0x9e52('0x33')][_0x9e52('0x38')](_0x9e52('0x39'))){_0x2f2954['limit']=qs[_0x9e52('0x23')](_0x8146c2[_0x9e52('0x33')][_0x9e52('0x23')]);_0x2f2954[_0x9e52('0x20')]=qs['offset'](_0x8146c2[_0x9e52('0x33')][_0x9e52('0x20')]);}_0x2f2954[_0x9e52('0x3a')]=qs[_0x9e52('0x3b')](_0x8146c2[_0x9e52('0x33')][_0x9e52('0x3b')]);_0x2f2954[_0x9e52('0x3c')]=qs[_0x9e52('0x3d')](_[_0x9e52('0x3e')](_0x8146c2[_0x9e52('0x33')],_0x575ae6[_0x9e52('0x3d')]),_0x58283d);if(_0x8146c2[_0x9e52('0x33')][_0x9e52('0x3f')]){_0x2f2954[_0x9e52('0x3c')]=_[_0x9e52('0x40')](_0x2f2954['where'],{'$or':_['map'](_0x58283d,function(_0x5d38e2){if(_0x5d38e2[_0x9e52('0x41')]!==_0x9e52('0x42')){var _0x5034fa={};_0x5034fa[_0x5d38e2[_0x9e52('0x2a')]]={'$like':'%'+_0x8146c2[_0x9e52('0x33')][_0x9e52('0x3f')]+'%'};return _0x5034fa;}})});}_0x2f2954=_['merge']({},_0x2f2954,_0x8146c2[_0x9e52('0x43')]);var _0x314233={'where':_0x2f2954[_0x9e52('0x3c')]};return db[_0x9e52('0x2d')]['count'](_0x314233)[_0x9e52('0x26')](function(_0x19bced){_0x5b55a6['count']=_0x19bced;if(_0x8146c2[_0x9e52('0x33')][_0x9e52('0x44')]){_0x2f2954[_0x9e52('0x45')]=[{'all':!![]}];}return db[_0x9e52('0x2d')][_0x9e52('0x46')](_0x2f2954);})[_0x9e52('0x26')](function(_0x452a22){_0x5b55a6['rows']=_0x452a22;return _0x5b55a6;})[_0x9e52('0x26')](respondWithFilteredResult(_0x24f44e,_0x2f2954))['catch'](handleError(_0x24f44e,null));};exports[_0x9e52('0x47')]=function(_0x170cf,_0x97187e){var _0xe7dc35={'raw':!![],'where':{'id':_0x170cf[_0x9e52('0x48')]['id']}},_0xf725a4={};_0xf725a4[_0x9e52('0x31')]=_['keys'](db[_0x9e52('0x2d')]['rawAttributes']);_0xf725a4[_0x9e52('0x33')]=_[_0x9e52('0x32')](_0x170cf[_0x9e52('0x33')]);_0xf725a4[_0x9e52('0x3d')]=_['intersection'](_0xf725a4[_0x9e52('0x31')],_0xf725a4[_0x9e52('0x33')]);_0xe7dc35[_0x9e52('0x34')]=_[_0x9e52('0x35')](_0xf725a4[_0x9e52('0x31')],qs['fields'](_0x170cf[_0x9e52('0x33')][_0x9e52('0x36')]));_0xe7dc35[_0x9e52('0x34')]=_0xe7dc35[_0x9e52('0x34')][_0x9e52('0x37')]?_0xe7dc35[_0x9e52('0x34')]:_0xf725a4[_0x9e52('0x31')];if(_0x170cf[_0x9e52('0x33')]['includeAll']){_0xe7dc35[_0x9e52('0x45')]=[{'all':!![]}];}_0xe7dc35=_[_0x9e52('0x40')]({},_0xe7dc35,_0x170cf['options']);return db[_0x9e52('0x2d')][_0x9e52('0x49')](_0xe7dc35)['then'](handleEntityNotFound(_0x97187e,null))[_0x9e52('0x26')](respondWithResult(_0x97187e,null))[_0x9e52('0x4a')](handleError(_0x97187e,null));};exports['create']=function(_0x7c8c6b,_0xf509fd){return db['OpenchannelQueueReport']['create'](_0x7c8c6b[_0x9e52('0x4b')],{})[_0x9e52('0x26')](respondWithResult(_0xf509fd,0xc9))['catch'](handleError(_0xf509fd,null));};exports[_0x9e52('0x4c')]=function(_0x3a159d,_0x29d133){if(_0x3a159d[_0x9e52('0x4b')]['id']){delete _0x3a159d['body']['id'];}return db[_0x9e52('0x2d')]['find']({'where':{'id':_0x3a159d[_0x9e52('0x48')]['id']}})[_0x9e52('0x26')](handleEntityNotFound(_0x29d133,null))[_0x9e52('0x26')](saveUpdates(_0x3a159d['body'],null))['then'](respondWithResult(_0x29d133,null))[_0x9e52('0x4a')](handleError(_0x29d133,null));};exports['destroy']=function(_0x1dbc60,_0x15dfd3){return db[_0x9e52('0x2d')][_0x9e52('0x49')]({'where':{'id':_0x1dbc60[_0x9e52('0x48')]['id']}})[_0x9e52('0x26')](handleEntityNotFound(_0x15dfd3,null))[_0x9e52('0x26')](removeEntity(_0x15dfd3,null))['catch'](handleError(_0x15dfd3,null));};exports[_0x9e52('0x4d')]=function(_0x25fcf3,_0x44aa39){return db[_0x9e52('0x2d')][_0x9e52('0x4d')]()[_0x9e52('0x26')](respondWithResult(_0x44aa39,null))[_0x9e52('0x4a')](handleError(_0x44aa39,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6f88e07..e62176d 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x215a21,_0x595fc1){var _0x556364=function(_0x1badcf){while(--_0x1badcf){_0x215a21['push'](_0x215a21['shift']());}};_0x556364(++_0x595fc1);}(_0x326f,0xd1));var _0xf326=function(_0x281f73,_0x1fa724){_0x281f73=_0x281f73-0x0;var _0x48443e=_0x326f[_0x281f73];return _0x48443e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x234982,_0x2c4d54){var _0x17df7d=function(_0x25c6e7){while(--_0x25c6e7){_0x234982['push'](_0x234982['shift']());}};_0x17df7d(++_0x2c4d54);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6b7615a..94e89a8 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 _0x58a4=['request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelQueueReport','body','options','raw','OpenchannelQueueReport','update','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x52fb2e,_0x34af37){var _0x132747=function(_0x28cc25){while(--_0x28cc25){_0x52fb2e['push'](_0x52fb2e['shift']());}};_0x132747(++_0x34af37);}(_0x58a4,0xbf));var _0x458a=function(_0x5da73f,_0x592980){_0x5da73f=_0x5da73f-0x0;var _0x1b3d73=_0x58a4[_0x5da73f];return _0x1b3d73;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var moment=require(_0x458a('0x2'));var BPromise=require(_0x458a('0x3'));var rs=require(_0x458a('0x4'));var fs=require('fs');var Redis=require(_0x458a('0x5'));var db=require(_0x458a('0x6'))['db'];var utils=require(_0x458a('0x7'));var logger=require(_0x458a('0x8'))(_0x458a('0x9'));var config=require(_0x458a('0xa'));var jayson=require(_0x458a('0xb'));var client=jayson[_0x458a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5358c2,_0x30b095,_0x11fcaa){return new BPromise(function(_0x2029bc,_0x1e658e){return client[_0x458a('0xd')](_0x5358c2,_0x11fcaa)['then'](function(_0x4bedce){logger[_0x458a('0xe')](_0x458a('0xf'),_0x30b095,_0x458a('0x10'));logger[_0x458a('0x11')](_0x458a('0x12'),_0x30b095,'request\x20sent',JSON[_0x458a('0x13')](_0x4bedce));if(_0x4bedce[_0x458a('0x14')]){if(_0x4bedce['error'][_0x458a('0x15')]===0x1f4){logger[_0x458a('0x14')](_0x458a('0xf'),_0x30b095,_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);return _0x1e658e(_0x4bedce['error']['message']);}logger[_0x458a('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x30b095,_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);return _0x2029bc(_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);}else{logger[_0x458a('0xe')](_0x458a('0xf'),_0x30b095,'request\x20sent');_0x2029bc(_0x4bedce['result']['message']);}})[_0x458a('0x17')](function(_0x3fd6d4){logger[_0x458a('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x30b095,_0x3fd6d4);_0x1e658e(_0x3fd6d4);});});}exports[_0x458a('0x18')]=function(_0x260c87){var _0x18504d=this;return new Promise(function(_0x392986,_0xa91473){return db['OpenchannelQueueReport']['create'](_0x260c87[_0x458a('0x19')],{'raw':_0x260c87['options']?_0x260c87[_0x458a('0x1a')][_0x458a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x468416){logger['info'](_0x458a('0x18'),_0x260c87);logger[_0x458a('0x11')]('CreateOpenchannelQueueReport',_0x260c87,JSON[_0x458a('0x13')](_0x468416));_0x392986(_0x468416);})[_0x458a('0x17')](function(_0x5a2bcb){logger[_0x458a('0x14')]('CreateOpenchannelQueueReport',_0x5a2bcb[_0x458a('0x16')],_0x260c87);_0xa91473(_0x18504d['error'](0x1f4,_0x5a2bcb[_0x458a('0x16')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x36b08e){var _0x911eaf=this;return new Promise(function(_0xcb0756,_0xcda8cc){return db[_0x458a('0x1c')][_0x458a('0x1d')](_0x36b08e[_0x458a('0x19')],{'raw':_0x36b08e[_0x458a('0x1a')]?_0x36b08e[_0x458a('0x1a')][_0x458a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b08e[_0x458a('0x1a')]?_0x36b08e[_0x458a('0x1a')][_0x458a('0x1e')]||null:null,'attributes':_0x36b08e['options']?_0x36b08e[_0x458a('0x1a')][_0x458a('0x1f')]||null:null,'limit':_0x36b08e['options']?_0x36b08e['options'][_0x458a('0x20')]||null:null})['then'](function(_0x33c5d8){logger[_0x458a('0xe')](_0x458a('0x21'),_0x36b08e);logger['debug'](_0x458a('0x21'),_0x36b08e,JSON[_0x458a('0x13')](_0x33c5d8));_0xcb0756(_0x33c5d8);})[_0x458a('0x17')](function(_0x562c36){logger['error'](_0x458a('0x21'),_0x562c36['message'],_0x36b08e);_0xcda8cc(_0x911eaf[_0x458a('0x14')](0x1f4,_0x562c36['message']));});});}; \ No newline at end of file +var _0xf65d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','stringify','UpdateOpenchannelQueueReport','update','raw','attributes','limit','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf65d,0x9f));var _0xdf65=function(_0x37e7a4,_0xb7a496){_0x37e7a4=_0x37e7a4-0x0;var _0x269b2a=_0xf65d[_0x37e7a4];return _0x269b2a;};'use strict';var _=require(_0xdf65('0x0'));var util=require('util');var moment=require(_0xdf65('0x1'));var BPromise=require(_0xdf65('0x2'));var rs=require(_0xdf65('0x3'));var fs=require('fs');var Redis=require(_0xdf65('0x4'));var db=require(_0xdf65('0x5'))['db'];var utils=require(_0xdf65('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf65('0x7'));var client=jayson['client'][_0xdf65('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33efa2,_0x4c4054,_0x40cc08){return new BPromise(function(_0x3f5cae,_0x97292b){return client[_0xdf65('0x9')](_0x33efa2,_0x40cc08)[_0xdf65('0xa')](function(_0x46a70d){logger['info'](_0xdf65('0xb'),_0x4c4054,'request\x20sent');logger[_0xdf65('0xc')](_0xdf65('0xd'),_0x4c4054,_0xdf65('0xe'),JSON['stringify'](_0x46a70d));if(_0x46a70d['error']){if(_0x46a70d[_0xdf65('0xf')][_0xdf65('0x10')]===0x1f4){logger[_0xdf65('0xf')](_0xdf65('0xb'),_0x4c4054,_0x46a70d[_0xdf65('0xf')][_0xdf65('0x11')]);return _0x97292b(_0x46a70d['error'][_0xdf65('0x11')]);}logger[_0xdf65('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4c4054,_0x46a70d['error']['message']);return _0x3f5cae(_0x46a70d[_0xdf65('0xf')][_0xdf65('0x11')]);}else{logger[_0xdf65('0x12')](_0xdf65('0xb'),_0x4c4054,_0xdf65('0xe'));_0x3f5cae(_0x46a70d[_0xdf65('0x13')][_0xdf65('0x11')]);}})[_0xdf65('0x14')](function(_0x208b93){logger[_0xdf65('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4c4054,_0x208b93);_0x97292b(_0x208b93);});});}exports[_0xdf65('0x15')]=function(_0x532215){var _0x28fcd1=this;return new Promise(function(_0x3a175b,_0x2337da){return db[_0xdf65('0x16')][_0xdf65('0x17')](_0x532215[_0xdf65('0x18')],{'raw':_0x532215['options']?_0x532215[_0xdf65('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xdf65('0xa')](function(_0x299ed3){logger[_0xdf65('0x12')](_0xdf65('0x15'),_0x532215);logger[_0xdf65('0xc')]('CreateOpenchannelQueueReport',_0x532215,JSON[_0xdf65('0x1a')](_0x299ed3));_0x3a175b(_0x299ed3);})[_0xdf65('0x14')](function(_0x5ee78d){logger[_0xdf65('0xf')](_0xdf65('0x15'),_0x5ee78d[_0xdf65('0x11')],_0x532215);_0x2337da(_0x28fcd1[_0xdf65('0xf')](0x1f4,_0x5ee78d['message']));});});};exports[_0xdf65('0x1b')]=function(_0x2eff40){var _0x5cfe90=this;return new Promise(function(_0x5ae6a3,_0x14a54c){return db[_0xdf65('0x16')][_0xdf65('0x1c')](_0x2eff40['body'],{'raw':_0x2eff40['options']?_0x2eff40[_0xdf65('0x19')][_0xdf65('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eff40['options']?_0x2eff40['options']['where']||null:null,'attributes':_0x2eff40[_0xdf65('0x19')]?_0x2eff40['options'][_0xdf65('0x1e')]||null:null,'limit':_0x2eff40['options']?_0x2eff40[_0xdf65('0x19')][_0xdf65('0x1f')]||null:null})[_0xdf65('0xa')](function(_0x2cca76){logger[_0xdf65('0x12')](_0xdf65('0x1b'),_0x2eff40);logger[_0xdf65('0xc')](_0xdf65('0x1b'),_0x2eff40,JSON[_0xdf65('0x1a')](_0x2cca76));_0x5ae6a3(_0x2cca76);})[_0xdf65('0x14')](function(_0x4507f1){logger['error']('UpdateOpenchannelQueueReport',_0x4507f1[_0xdf65('0x11')],_0x2eff40);_0x14a54c(_0x5cfe90[_0xdf65('0xf')](0x1f4,_0x4507f1[_0xdf65('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d1007dc..8cdc4d8 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 _0xb30e=['index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated'];(function(_0x3c50e8,_0x58bffd){var _0x2e3455=function(_0x303d96){while(--_0x303d96){_0x3c50e8['push'](_0x3c50e8['shift']());}};_0x2e3455(++_0x58bffd);}(_0xb30e,0x11f));var _0xeb30=function(_0x4bf140,_0x2bc15c){_0x4bf140=_0x4bf140-0x0;var _0x337cbf=_0xb30e[_0x4bf140];return _0x337cbf;};'use strict';var multer=require(_0xeb30('0x0'));var util=require(_0xeb30('0x1'));var path=require(_0xeb30('0x2'));var timeout=require(_0xeb30('0x3'));var express=require(_0xeb30('0x4'));var router=express[_0xeb30('0x5')]();var fs_extra=require(_0xeb30('0x6'));var auth=require(_0xeb30('0x7'));var interaction=require(_0xeb30('0x8'));var config=require('../../config/environment');var controller=require(_0xeb30('0x9'));router[_0xeb30('0xa')]('/',auth[_0xeb30('0xb')](),controller[_0xeb30('0xc')]);router[_0xeb30('0xa')]('/describe',auth[_0xeb30('0xb')](),controller[_0xeb30('0xd')]);router[_0xeb30('0xa')](_0xeb30('0xe'),auth[_0xeb30('0xb')](),controller[_0xeb30('0xf')]);router[_0xeb30('0x10')]('/',auth['isAuthenticated'](),controller[_0xeb30('0x11')]);router[_0xeb30('0x12')](_0xeb30('0xe'),auth[_0xeb30('0xb')](),controller[_0xeb30('0x13')]);router[_0xeb30('0x14')](_0xeb30('0xe'),auth[_0xeb30('0xb')](),controller[_0xeb30('0x15')]);module[_0xeb30('0x16')]=router; \ No newline at end of file +var _0xeca0=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5e3191,_0x47fe85){var _0xc8d5e6=function(_0x478881){while(--_0x478881){_0x5e3191['push'](_0x5e3191['shift']());}};_0xc8d5e6(++_0x47fe85);}(_0xeca0,0x14b));var _0x0eca=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xeca0[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0x0eca('0x0'));var path=require(_0x0eca('0x1'));var timeout=require(_0x0eca('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0eca('0x3'));var auth=require(_0x0eca('0x4'));var interaction=require(_0x0eca('0x5'));var config=require(_0x0eca('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x0eca('0x7')]('/',auth[_0x0eca('0x8')](),controller[_0x0eca('0x9')]);router[_0x0eca('0x7')](_0x0eca('0xa'),auth[_0x0eca('0x8')](),controller[_0x0eca('0xb')]);router[_0x0eca('0x7')](_0x0eca('0xc'),auth[_0x0eca('0x8')](),controller[_0x0eca('0xd')]);router[_0x0eca('0xe')]('/',auth[_0x0eca('0x8')](),controller[_0x0eca('0xf')]);router[_0x0eca('0x10')](_0x0eca('0xc'),auth[_0x0eca('0x8')](),controller[_0x0eca('0x11')]);router[_0x0eca('0x12')](_0x0eca('0xc'),auth[_0x0eca('0x8')](),controller[_0x0eca('0x13')]);module[_0x0eca('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8188c43..06c961a 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(_0x407604,_0x58f902){var _0x2da97a=function(_0x461868){while(--_0x461868){_0x407604['push'](_0x407604['shift']());}};_0x2da97a(++_0x58f902);}(_0x008c,0x188));var _0xc008=function(_0x300b26,_0x3a9b67){_0x300b26=_0x300b26-0x0;var _0x5cb1ae=_0x008c[_0x300b26];return _0x5cb1ae;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4479ac,_0x52b588){_0x4479ac=_0x4479ac-0x0;var _0x15bcc7=_0x9bde[_0x4479ac];return _0x15bcc7;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6bb54e9..b147188 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 _0xd007=['length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes'];(function(_0x5194d5,_0x5e6651){var _0x8aad91=function(_0x7e083c){while(--_0x7e083c){_0x5194d5['push'](_0x5194d5['shift']());}};_0x8aad91(++_0x5e6651);}(_0xd007,0x18b));var _0x7d00=function(_0x551131,_0x37b965){_0x551131=_0x551131-0x0;var _0x177dce=_0xd007[_0x551131];return _0x177dce;};'use strict';var emlformat=require(_0x7d00('0x0'));var rimraf=require(_0x7d00('0x1'));var zipdir=require(_0x7d00('0x2'));var jsonpatch=require(_0x7d00('0x3'));var rp=require(_0x7d00('0x4'));var moment=require('moment');var BPromise=require(_0x7d00('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d00('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d00('0x7'));var _=require(_0x7d00('0x8'));var squel=require(_0x7d00('0x9'));var crypto=require(_0x7d00('0xa'));var jsforce=require(_0x7d00('0xb'));var deskjs=require(_0x7d00('0xc'));var toCsv=require(_0x7d00('0xd'));var querystring=require(_0x7d00('0xe'));var Papa=require(_0x7d00('0xf'));var Redis=require(_0x7d00('0x10'));var authService=require(_0x7d00('0x11'));var qs=require(_0x7d00('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d00('0x13'));var logger=require(_0x7d00('0x14'))('api');var utils=require(_0x7d00('0x15'));var config=require(_0x7d00('0x16'));var licenseUtil=require(_0x7d00('0x17'));var db=require(_0x7d00('0x18'))['db'];function respondWithStatusCode(_0x4f3659,_0x100bab){_0x100bab=_0x100bab||0xcc;return function(_0xa9ef5){if(_0xa9ef5){return _0x4f3659['sendStatus'](_0x100bab);}return _0x4f3659[_0x7d00('0x19')](_0x100bab)[_0x7d00('0x1a')]();};}function respondWithResult(_0x29d3f3,_0x8ea94b){_0x8ea94b=_0x8ea94b||0xc8;return function(_0x45d9b1){if(_0x45d9b1){return _0x29d3f3[_0x7d00('0x19')](_0x8ea94b)[_0x7d00('0x1b')](_0x45d9b1);}};}function respondWithFilteredResult(_0x2ec8ba,_0x73ceb){return function(_0x20ab4d){if(_0x20ab4d){var _0xcc254e=typeof _0x73ceb[_0x7d00('0x1c')]===_0x7d00('0x1d')&&typeof _0x73ceb['limit']===_0x7d00('0x1d');var _0x88460a=_0x20ab4d[_0x7d00('0x1e')];var _0x40b980=_0xcc254e?0x0:_0x73ceb[_0x7d00('0x1c')];var _0x4594a0=_0xcc254e?_0x20ab4d['count']:_0x73ceb['offset']+_0x73ceb['limit'];var _0x33b105;if(_0x4594a0>=_0x88460a){_0x4594a0=_0x88460a;_0x33b105=0xc8;}else{_0x33b105=0xce;}_0x2ec8ba[_0x7d00('0x19')](_0x33b105);return _0x2ec8ba['set'](_0x7d00('0x1f'),_0x40b980+'-'+_0x4594a0+'/'+_0x88460a)[_0x7d00('0x1b')](_0x20ab4d);}return null;};}function patchUpdates(_0xee5be){return function(_0x4b0713){try{jsonpatch[_0x7d00('0x20')](_0x4b0713,_0xee5be,!![]);}catch(_0x4c62c8){return BPromise[_0x7d00('0x21')](_0x4c62c8);}return _0x4b0713[_0x7d00('0x22')]();};}function saveUpdates(_0x483d7f,_0x37fb9e){return function(_0x5d3bfa){if(_0x5d3bfa){return _0x5d3bfa[_0x7d00('0x23')](_0x483d7f)[_0x7d00('0x24')](function(_0x41d859){return _0x41d859;});}return null;};}function removeEntity(_0x4d48a3,_0x3de720){return function(_0x1b89eb){if(_0x1b89eb){return _0x1b89eb[_0x7d00('0x25')]()[_0x7d00('0x24')](function(){_0x4d48a3[_0x7d00('0x19')](0xcc)[_0x7d00('0x1a')]();});}};}function handleEntityNotFound(_0x5ec76d,_0x508335){return function(_0x2f5bda){if(!_0x2f5bda){_0x5ec76d[_0x7d00('0x26')](0x194);}return _0x2f5bda;};}function handleError(_0x221b81,_0x45a157){_0x45a157=_0x45a157||0x1f4;return function(_0x332e21){logger[_0x7d00('0x27')](_0x332e21[_0x7d00('0x28')]);if(_0x332e21[_0x7d00('0x29')]){delete _0x332e21[_0x7d00('0x29')];}_0x221b81[_0x7d00('0x19')](_0x45a157)[_0x7d00('0x2a')](_0x332e21);};}exports['index']=function(_0x59c124,_0x153127){var _0x1c70bf={},_0x471700={},_0x4ad4ff={'count':0x0,'rows':[]};var _0x407bc3=_[_0x7d00('0x2b')](db[_0x7d00('0x2c')][_0x7d00('0x2d')],function(_0x26e2f0){return{'name':_0x26e2f0[_0x7d00('0x2e')],'type':_0x26e2f0['type'][_0x7d00('0x2f')]};});_0x471700['model']=_[_0x7d00('0x2b')](_0x407bc3,_0x7d00('0x29'));_0x471700[_0x7d00('0x30')]=_[_0x7d00('0x31')](_0x59c124['query']);_0x471700[_0x7d00('0x32')]=_['intersection'](_0x471700[_0x7d00('0x33')],_0x471700[_0x7d00('0x30')]);_0x1c70bf['attributes']=_[_0x7d00('0x34')](_0x471700['model'],qs[_0x7d00('0x35')](_0x59c124[_0x7d00('0x30')][_0x7d00('0x35')]));_0x1c70bf['attributes']=_0x1c70bf[_0x7d00('0x36')][_0x7d00('0x37')]?_0x1c70bf[_0x7d00('0x36')]:_0x471700[_0x7d00('0x33')];if(!_0x59c124['query'][_0x7d00('0x38')](_0x7d00('0x39'))){_0x1c70bf['limit']=qs[_0x7d00('0x3a')](_0x59c124[_0x7d00('0x30')]['limit']);_0x1c70bf[_0x7d00('0x1c')]=qs[_0x7d00('0x1c')](_0x59c124[_0x7d00('0x30')][_0x7d00('0x1c')]);}_0x1c70bf[_0x7d00('0x3b')]=qs['sort'](_0x59c124[_0x7d00('0x30')][_0x7d00('0x3c')]);_0x1c70bf['where']=qs[_0x7d00('0x32')](_[_0x7d00('0x3d')](_0x59c124[_0x7d00('0x30')],_0x471700[_0x7d00('0x32')]),_0x407bc3);if(_0x59c124[_0x7d00('0x30')][_0x7d00('0x3e')]){_0x1c70bf[_0x7d00('0x3f')]=_[_0x7d00('0x40')](_0x1c70bf[_0x7d00('0x3f')],{'$or':_[_0x7d00('0x2b')](_0x407bc3,function(_0x118ed4){if(_0x118ed4['type']!=='VIRTUAL'){var _0x4fa17b={};_0x4fa17b[_0x118ed4[_0x7d00('0x29')]]={'$like':'%'+_0x59c124[_0x7d00('0x30')][_0x7d00('0x3e')]+'%'};return _0x4fa17b;}})});}_0x1c70bf=_[_0x7d00('0x40')]({},_0x1c70bf,_0x59c124[_0x7d00('0x41')]);var _0x10f72d={'where':_0x1c70bf[_0x7d00('0x3f')]};return db[_0x7d00('0x2c')][_0x7d00('0x1e')](_0x10f72d)[_0x7d00('0x24')](function(_0x7a7ddf){_0x4ad4ff[_0x7d00('0x1e')]=_0x7a7ddf;if(_0x59c124['query'][_0x7d00('0x42')]){_0x1c70bf[_0x7d00('0x43')]=[{'all':!![]}];}return db[_0x7d00('0x2c')][_0x7d00('0x44')](_0x1c70bf);})[_0x7d00('0x24')](function(_0x5df36a){_0x4ad4ff[_0x7d00('0x45')]=_0x5df36a;return _0x4ad4ff;})[_0x7d00('0x24')](respondWithFilteredResult(_0x153127,_0x1c70bf))['catch'](handleError(_0x153127,null));};exports['show']=function(_0x10cbe3,_0x4c2c14){var _0x2e982b={'raw':!![],'where':{'id':_0x10cbe3[_0x7d00('0x46')]['id']}},_0x47bf6b={};_0x47bf6b[_0x7d00('0x33')]=_[_0x7d00('0x31')](db[_0x7d00('0x2c')][_0x7d00('0x2d')]);_0x47bf6b[_0x7d00('0x30')]=_[_0x7d00('0x31')](_0x10cbe3[_0x7d00('0x30')]);_0x47bf6b['filters']=_[_0x7d00('0x34')](_0x47bf6b['model'],_0x47bf6b[_0x7d00('0x30')]);_0x2e982b[_0x7d00('0x36')]=_[_0x7d00('0x34')](_0x47bf6b['model'],qs[_0x7d00('0x35')](_0x10cbe3[_0x7d00('0x30')][_0x7d00('0x35')]));_0x2e982b[_0x7d00('0x36')]=_0x2e982b[_0x7d00('0x36')][_0x7d00('0x37')]?_0x2e982b[_0x7d00('0x36')]:_0x47bf6b['model'];if(_0x10cbe3[_0x7d00('0x30')][_0x7d00('0x42')]){_0x2e982b['include']=[{'all':!![]}];}_0x2e982b=_[_0x7d00('0x40')]({},_0x2e982b,_0x10cbe3[_0x7d00('0x41')]);return db[_0x7d00('0x2c')][_0x7d00('0x47')](_0x2e982b)[_0x7d00('0x24')](handleEntityNotFound(_0x4c2c14,null))[_0x7d00('0x24')](respondWithResult(_0x4c2c14,null))[_0x7d00('0x48')](handleError(_0x4c2c14,null));};exports[_0x7d00('0x49')]=function(_0x3663ff,_0x355db4){return db['OpenchannelTransferReport'][_0x7d00('0x49')](_0x3663ff['body'],{})[_0x7d00('0x24')](respondWithResult(_0x355db4,0xc9))[_0x7d00('0x48')](handleError(_0x355db4,null));};exports['update']=function(_0x23c6ed,_0x271d0b){if(_0x23c6ed[_0x7d00('0x4a')]['id']){delete _0x23c6ed[_0x7d00('0x4a')]['id'];}return db['OpenchannelTransferReport'][_0x7d00('0x47')]({'where':{'id':_0x23c6ed[_0x7d00('0x46')]['id']}})[_0x7d00('0x24')](handleEntityNotFound(_0x271d0b,null))[_0x7d00('0x24')](saveUpdates(_0x23c6ed['body'],null))[_0x7d00('0x24')](respondWithResult(_0x271d0b,null))[_0x7d00('0x48')](handleError(_0x271d0b,null));};exports['destroy']=function(_0x54b658,_0x53d635){return db['OpenchannelTransferReport'][_0x7d00('0x47')]({'where':{'id':_0x54b658[_0x7d00('0x46')]['id']}})[_0x7d00('0x24')](handleEntityNotFound(_0x53d635,null))[_0x7d00('0x24')](removeEntity(_0x53d635,null))['catch'](handleError(_0x53d635,null));};exports['describe']=function(_0x1539fd,_0x4d0e13){return db[_0x7d00('0x2c')]['describe']()[_0x7d00('0x24')](respondWithResult(_0x4d0e13,null))[_0x7d00('0x48')](handleError(_0x4d0e13,null));}; \ No newline at end of file +var _0x963e=['rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','includeAll','include','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','json','apply','reject','save','update','then','stack','name','send','index','OpenchannelTransferReport'];(function(_0x427f2b,_0x323d77){var _0x53d037=function(_0x19657c){while(--_0x19657c){_0x427f2b['push'](_0x427f2b['shift']());}};_0x53d037(++_0x323d77);}(_0x963e,0x135));var _0xe963=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x963e[_0x5400a1];return _0x4006c7;};'use strict';var emlformat=require(_0xe963('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe963('0x1'));var jsonpatch=require(_0xe963('0x2'));var rp=require(_0xe963('0x3'));var moment=require(_0xe963('0x4'));var BPromise=require(_0xe963('0x5'));var Mustache=require(_0xe963('0x6'));var util=require(_0xe963('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe963('0x8'));var fs=require('fs');var fs_extra=require(_0xe963('0x9'));var _=require(_0xe963('0xa'));var squel=require(_0xe963('0xb'));var crypto=require(_0xe963('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe963('0xd'));var toCsv=require(_0xe963('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe963('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe963('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe963('0x11'))(_0xe963('0x12'));var utils=require(_0xe963('0x13'));var config=require(_0xe963('0x14'));var licenseUtil=require(_0xe963('0x15'));var db=require(_0xe963('0x16'))['db'];function respondWithStatusCode(_0x4fbb2d,_0xc7a7cb){_0xc7a7cb=_0xc7a7cb||0xcc;return function(_0x3de361){if(_0x3de361){return _0x4fbb2d[_0xe963('0x17')](_0xc7a7cb);}return _0x4fbb2d['status'](_0xc7a7cb)[_0xe963('0x18')]();};}function respondWithResult(_0x5637b0,_0x18a6cc){_0x18a6cc=_0x18a6cc||0xc8;return function(_0x4fa2f3){if(_0x4fa2f3){return _0x5637b0['status'](_0x18a6cc)['json'](_0x4fa2f3);}};}function respondWithFilteredResult(_0x60e31e,_0x4568bd){return function(_0x551de1){if(_0x551de1){var _0x470820=typeof _0x4568bd[_0xe963('0x19')]===_0xe963('0x1a')&&typeof _0x4568bd['limit']===_0xe963('0x1a');var _0x553c84=_0x551de1['count'];var _0x1e5e8a=_0x470820?0x0:_0x4568bd['offset'];var _0x5394bd=_0x470820?_0x551de1[_0xe963('0x1b')]:_0x4568bd[_0xe963('0x19')]+_0x4568bd[_0xe963('0x1c')];var _0x55c790;if(_0x5394bd>=_0x553c84){_0x5394bd=_0x553c84;_0x55c790=0xc8;}else{_0x55c790=0xce;}_0x60e31e[_0xe963('0x1d')](_0x55c790);return _0x60e31e['set']('Content-Range',_0x1e5e8a+'-'+_0x5394bd+'/'+_0x553c84)[_0xe963('0x1e')](_0x551de1);}return null;};}function patchUpdates(_0x19eade){return function(_0x2a4f43){try{jsonpatch[_0xe963('0x1f')](_0x2a4f43,_0x19eade,!![]);}catch(_0x26a8eb){return BPromise[_0xe963('0x20')](_0x26a8eb);}return _0x2a4f43[_0xe963('0x21')]();};}function saveUpdates(_0x472a66,_0x87dc62){return function(_0x2608a1){if(_0x2608a1){return _0x2608a1[_0xe963('0x22')](_0x472a66)[_0xe963('0x23')](function(_0x5ddec6){return _0x5ddec6;});}return null;};}function removeEntity(_0x43a58d,_0x410ff6){return function(_0x3001b7){if(_0x3001b7){return _0x3001b7['destroy']()[_0xe963('0x23')](function(){_0x43a58d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x590b83,_0x4ac6fb){return function(_0x5809c1){if(!_0x5809c1){_0x590b83[_0xe963('0x17')](0x194);}return _0x5809c1;};}function handleError(_0x2749f4,_0x9a2cbb){_0x9a2cbb=_0x9a2cbb||0x1f4;return function(_0x2e6122){logger['error'](_0x2e6122[_0xe963('0x24')]);if(_0x2e6122[_0xe963('0x25')]){delete _0x2e6122[_0xe963('0x25')];}_0x2749f4['status'](_0x9a2cbb)[_0xe963('0x26')](_0x2e6122);};}exports[_0xe963('0x27')]=function(_0x2a5cd8,_0x1751ba){var _0x407016={},_0x41a692={},_0x5ac28f={'count':0x0,'rows':[]};var _0x7a49e5=_['map'](db[_0xe963('0x28')][_0xe963('0x29')],function(_0xe9641d){return{'name':_0xe9641d['fieldName'],'type':_0xe9641d[_0xe963('0x2a')]['key']};});_0x41a692[_0xe963('0x2b')]=_[_0xe963('0x2c')](_0x7a49e5,_0xe963('0x25'));_0x41a692[_0xe963('0x2d')]=_[_0xe963('0x2e')](_0x2a5cd8[_0xe963('0x2d')]);_0x41a692[_0xe963('0x2f')]=_[_0xe963('0x30')](_0x41a692[_0xe963('0x2b')],_0x41a692[_0xe963('0x2d')]);_0x407016[_0xe963('0x31')]=_[_0xe963('0x30')](_0x41a692[_0xe963('0x2b')],qs[_0xe963('0x32')](_0x2a5cd8['query'][_0xe963('0x32')]));_0x407016[_0xe963('0x31')]=_0x407016[_0xe963('0x31')][_0xe963('0x33')]?_0x407016[_0xe963('0x31')]:_0x41a692['model'];if(!_0x2a5cd8['query']['hasOwnProperty'](_0xe963('0x34'))){_0x407016[_0xe963('0x1c')]=qs['limit'](_0x2a5cd8[_0xe963('0x2d')][_0xe963('0x1c')]);_0x407016['offset']=qs[_0xe963('0x19')](_0x2a5cd8[_0xe963('0x2d')][_0xe963('0x19')]);}_0x407016[_0xe963('0x35')]=qs[_0xe963('0x36')](_0x2a5cd8[_0xe963('0x2d')][_0xe963('0x36')]);_0x407016[_0xe963('0x37')]=qs[_0xe963('0x2f')](_['pick'](_0x2a5cd8['query'],_0x41a692[_0xe963('0x2f')]),_0x7a49e5);if(_0x2a5cd8[_0xe963('0x2d')][_0xe963('0x38')]){_0x407016[_0xe963('0x37')]=_[_0xe963('0x39')](_0x407016['where'],{'$or':_['map'](_0x7a49e5,function(_0x56f2f6){if(_0x56f2f6[_0xe963('0x2a')]!=='VIRTUAL'){var _0x314380={};_0x314380[_0x56f2f6[_0xe963('0x25')]]={'$like':'%'+_0x2a5cd8[_0xe963('0x2d')][_0xe963('0x38')]+'%'};return _0x314380;}})});}_0x407016=_['merge']({},_0x407016,_0x2a5cd8[_0xe963('0x3a')]);var _0x366e4c={'where':_0x407016[_0xe963('0x37')]};return db[_0xe963('0x28')][_0xe963('0x1b')](_0x366e4c)[_0xe963('0x23')](function(_0x4e1ed6){_0x5ac28f['count']=_0x4e1ed6;if(_0x2a5cd8[_0xe963('0x2d')]['includeAll']){_0x407016['include']=[{'all':!![]}];}return db[_0xe963('0x28')][_0xe963('0x3b')](_0x407016);})[_0xe963('0x23')](function(_0x2858e0){_0x5ac28f[_0xe963('0x3c')]=_0x2858e0;return _0x5ac28f;})['then'](respondWithFilteredResult(_0x1751ba,_0x407016))[_0xe963('0x3d')](handleError(_0x1751ba,null));};exports['show']=function(_0x5cc5f8,_0x9a91b5){var _0x241044={'raw':!![],'where':{'id':_0x5cc5f8['params']['id']}},_0x2f4785={};_0x2f4785['model']=_[_0xe963('0x2e')](db[_0xe963('0x28')][_0xe963('0x29')]);_0x2f4785['query']=_['keys'](_0x5cc5f8[_0xe963('0x2d')]);_0x2f4785[_0xe963('0x2f')]=_[_0xe963('0x30')](_0x2f4785[_0xe963('0x2b')],_0x2f4785[_0xe963('0x2d')]);_0x241044[_0xe963('0x31')]=_[_0xe963('0x30')](_0x2f4785[_0xe963('0x2b')],qs[_0xe963('0x32')](_0x5cc5f8[_0xe963('0x2d')][_0xe963('0x32')]));_0x241044[_0xe963('0x31')]=_0x241044['attributes'][_0xe963('0x33')]?_0x241044[_0xe963('0x31')]:_0x2f4785[_0xe963('0x2b')];if(_0x5cc5f8[_0xe963('0x2d')][_0xe963('0x3e')]){_0x241044[_0xe963('0x3f')]=[{'all':!![]}];}_0x241044=_[_0xe963('0x39')]({},_0x241044,_0x5cc5f8[_0xe963('0x3a')]);return db[_0xe963('0x28')][_0xe963('0x40')](_0x241044)[_0xe963('0x23')](handleEntityNotFound(_0x9a91b5,null))['then'](respondWithResult(_0x9a91b5,null))[_0xe963('0x3d')](handleError(_0x9a91b5,null));};exports['create']=function(_0x2681d8,_0x2cab9e){return db[_0xe963('0x28')][_0xe963('0x41')](_0x2681d8[_0xe963('0x42')],{})[_0xe963('0x23')](respondWithResult(_0x2cab9e,0xc9))[_0xe963('0x3d')](handleError(_0x2cab9e,null));};exports[_0xe963('0x22')]=function(_0x3037d2,_0x3ff1df){if(_0x3037d2['body']['id']){delete _0x3037d2['body']['id'];}return db[_0xe963('0x28')][_0xe963('0x40')]({'where':{'id':_0x3037d2[_0xe963('0x43')]['id']}})[_0xe963('0x23')](handleEntityNotFound(_0x3ff1df,null))['then'](saveUpdates(_0x3037d2[_0xe963('0x42')],null))[_0xe963('0x23')](respondWithResult(_0x3ff1df,null))[_0xe963('0x3d')](handleError(_0x3ff1df,null));};exports[_0xe963('0x44')]=function(_0xb71b17,_0x59d7af){return db['OpenchannelTransferReport'][_0xe963('0x40')]({'where':{'id':_0xb71b17[_0xe963('0x43')]['id']}})['then'](handleEntityNotFound(_0x59d7af,null))[_0xe963('0x23')](removeEntity(_0x59d7af,null))[_0xe963('0x3d')](handleError(_0x59d7af,null));};exports[_0xe963('0x45')]=function(_0x49dfc9,_0x5cd578){return db['OpenchannelTransferReport'][_0xe963('0x45')]()[_0xe963('0x23')](respondWithResult(_0x5cd578,null))[_0xe963('0x3d')](handleError(_0x5cd578,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index efdf47f..03a1248 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 _0x127d=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x218899,_0x4ccc76){var _0x199aa1=function(_0x37fad6){while(--_0x37fad6){_0x218899['push'](_0x218899['shift']());}};_0x199aa1(++_0x4ccc76);}(_0x127d,0x9e));var _0xd127=function(_0x32eabf,_0x1a6dfe){_0x32eabf=_0x32eabf-0x0;var _0xeebf76=_0x127d[_0x32eabf];return _0xeebf76;};'use strict';var _=require(_0xd127('0x0'));var util=require(_0xd127('0x1'));var logger=require(_0xd127('0x2'))(_0xd127('0x3'));var moment=require('moment');var BPromise=require(_0xd127('0x4'));var rp=require(_0xd127('0x5'));var fs=require('fs');var path=require(_0xd127('0x6'));var rimraf=require('rimraf');var config=require(_0xd127('0x7'));var attributes=require(_0xd127('0x8'));module['exports']=function(_0x1e6d46,_0x194400){return _0x1e6d46[_0xd127('0x9')](_0xd127('0xa'),attributes,{'tableName':_0xd127('0xb'),'paranoid':![],'indexes':[{'name':_0xd127('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3e3=['moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4a06df,_0x525532){var _0x5a48b8=function(_0x487ada){while(--_0x487ada){_0x4a06df['push'](_0x4a06df['shift']());}};_0x5a48b8(++_0x525532);}(_0xd3e3,0x137));var _0x3d3e=function(_0xd068cf,_0x2b7044){_0xd068cf=_0xd068cf-0x0;var _0x1fd63b=_0xd3e3[_0xd068cf];return _0x1fd63b;};'use strict';var _=require(_0x3d3e('0x0'));var util=require(_0x3d3e('0x1'));var logger=require(_0x3d3e('0x2'))(_0x3d3e('0x3'));var moment=require(_0x3d3e('0x4'));var BPromise=require(_0x3d3e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d3e('0x6'));var rimraf=require(_0x3d3e('0x7'));var config=require(_0x3d3e('0x8'));var attributes=require(_0x3d3e('0x9'));module[_0x3d3e('0xa')]=function(_0x422c32,_0x44c4bb){return _0x422c32[_0x3d3e('0xb')](_0x3d3e('0xc'),attributes,{'tableName':_0x3d3e('0xd'),'paranoid':![],'indexes':[{'name':_0x3d3e('0xe'),'fields':[_0x3d3e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 1249833..f3b01d2 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 _0xac95=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x307e7e,_0x5b7197){var _0x1941b6=function(_0x1c5bf4){while(--_0x1c5bf4){_0x307e7e['push'](_0x307e7e['shift']());}};_0x1941b6(++_0x5b7197);}(_0xac95,0xa8));var _0x5ac9=function(_0x43da1a,_0x1c2c08){_0x43da1a=_0x43da1a-0x0;var _0x1c515b=_0xac95[_0x43da1a];return _0x1c515b;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var moment=require(_0x5ac9('0x2'));var BPromise=require(_0x5ac9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac9('0x4'))['db'];var utils=require(_0x5ac9('0x5'));var logger=require('../../config/logger')(_0x5ac9('0x6'));var config=require(_0x5ac9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ac9('0x8')][_0x5ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8675ec,_0x4bddcf,_0x4dffb8){return new BPromise(function(_0x32afbc,_0x2ab11c){return client[_0x5ac9('0xa')](_0x8675ec,_0x4dffb8)[_0x5ac9('0xb')](function(_0x397bb8){logger[_0x5ac9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'));logger[_0x5ac9('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'),JSON['stringify'](_0x397bb8));if(_0x397bb8[_0x5ac9('0xf')]){if(_0x397bb8['error'][_0x5ac9('0x10')]===0x1f4){logger[_0x5ac9('0xf')](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x2ab11c(_0x397bb8['error'][_0x5ac9('0x12')]);}logger['error'](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x32afbc(_0x397bb8[_0x5ac9('0xf')][_0x5ac9('0x12')]);}else{logger[_0x5ac9('0xc')](_0x5ac9('0x11'),_0x4bddcf,_0x5ac9('0xd'));_0x32afbc(_0x397bb8[_0x5ac9('0x13')][_0x5ac9('0x12')]);}})[_0x5ac9('0x14')](function(_0x460fd7){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x460fd7);_0x2ab11c(_0x460fd7);});});} \ No newline at end of file +var _0xdad2=['request','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x59d353,_0x481a8a){var _0x278444=function(_0x5dc3c9){while(--_0x5dc3c9){_0x59d353['push'](_0x59d353['shift']());}};_0x278444(++_0x481a8a);}(_0xdad2,0x14c));var _0x2dad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdad2[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var moment=require(_0x2dad('0x1'));var BPromise=require('bluebird');var rs=require(_0x2dad('0x2'));var fs=require('fs');var Redis=require(_0x2dad('0x3'));var db=require(_0x2dad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dad('0x5'))(_0x2dad('0x6'));var config=require('../../config/environment');var jayson=require(_0x2dad('0x7'));var client=jayson[_0x2dad('0x8')][_0x2dad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf0022b,_0x51dec0,_0x5b6aa2){return new BPromise(function(_0x217e41,_0x3c696f){return client[_0x2dad('0xa')](_0xf0022b,_0x5b6aa2)[_0x2dad('0xb')](function(_0x24bb74){logger[_0x2dad('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x51dec0,_0x2dad('0xd'));logger['debug'](_0x2dad('0xe'),_0x51dec0,_0x2dad('0xd'),JSON['stringify'](_0x24bb74));if(_0x24bb74[_0x2dad('0xf')]){if(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x10')]===0x1f4){logger['error'](_0x2dad('0x11'),_0x51dec0,_0x24bb74[_0x2dad('0xf')]['message']);return _0x3c696f(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x12')]);}logger[_0x2dad('0xf')](_0x2dad('0x11'),_0x51dec0,_0x24bb74['error'][_0x2dad('0x12')]);return _0x217e41(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x12')]);}else{logger[_0x2dad('0xc')](_0x2dad('0x11'),_0x51dec0,'request\x20sent');_0x217e41(_0x24bb74['result'][_0x2dad('0x12')]);}})['catch'](function(_0x5d5897){logger['error'](_0x2dad('0x11'),_0x51dec0,_0x5d5897);_0x3c696f(_0x5d5897);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0ffb5b2..26ffd21 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 _0xf34c=['express','Router','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0xf34c,0x10d));var _0xcf34=function(_0x2a07b0,_0x3151e2){_0x2a07b0=_0x2a07b0-0x0;var _0x55a518=_0xf34c[_0x2a07b0];return _0x55a518;};'use strict';var multer=require(_0xcf34('0x0'));var util=require(_0xcf34('0x1'));var path=require(_0xcf34('0x2'));var timeout=require(_0xcf34('0x3'));var express=require(_0xcf34('0x4'));var router=express[_0xcf34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcf34('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf34('0x7'));var controller=require(_0xcf34('0x8'));router[_0xcf34('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf34('0xa')]);router['get'](_0xcf34('0xb'),auth[_0xcf34('0xc')](),controller[_0xcf34('0xd')]);router[_0xcf34('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf34('0xf')]);router[_0xcf34('0x10')](_0xcf34('0xb'),auth[_0xcf34('0xc')](),controller[_0xcf34('0x11')]);router[_0xcf34('0x12')]('/:id',auth[_0xcf34('0xc')](),controller[_0xcf34('0x13')]);module[_0xcf34('0x14')]=router; \ No newline at end of file +var _0x8396=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','util','path'];(function(_0x4537c0,_0x4c1f04){var _0x13e9f8=function(_0x3b74cb){while(--_0x3b74cb){_0x4537c0['push'](_0x4537c0['shift']());}};_0x13e9f8(++_0x4c1f04);}(_0x8396,0x116));var _0x6839=function(_0x288f81,_0xd3edf6){_0x288f81=_0x288f81-0x0;var _0x164f1c=_0x8396[_0x288f81];return _0x164f1c;};'use strict';var multer=require('multer');var util=require(_0x6839('0x0'));var path=require(_0x6839('0x1'));var timeout=require(_0x6839('0x2'));var express=require(_0x6839('0x3'));var router=express[_0x6839('0x4')]();var fs_extra=require(_0x6839('0x5'));var auth=require(_0x6839('0x6'));var interaction=require(_0x6839('0x7'));var config=require(_0x6839('0x8'));var controller=require(_0x6839('0x9'));router[_0x6839('0xa')]('/',auth['isAuthenticated'](),controller[_0x6839('0xb')]);router[_0x6839('0xa')](_0x6839('0xc'),auth[_0x6839('0xd')](),controller[_0x6839('0xe')]);router[_0x6839('0xf')]('/',auth[_0x6839('0xd')](),controller[_0x6839('0x10')]);router[_0x6839('0x11')](_0x6839('0xc'),auth[_0x6839('0xd')](),controller['update']);router[_0x6839('0x12')](_0x6839('0xc'),auth[_0x6839('0xd')](),controller['destroy']);module[_0x6839('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 5027bf4..480947e 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 _0x80d9=['STRING','name','sequelize','exports'];(function(_0xea897b,_0x269096){var _0x8a736e=function(_0x2b13b6){while(--_0x2b13b6){_0xea897b['push'](_0xea897b['shift']());}};_0x8a736e(++_0x269096);}(_0x80d9,0xca));var _0x980d=function(_0x2c46ba,_0x2b6948){_0x2c46ba=_0x2c46ba-0x0;var _0x7dc2e9=_0x80d9[_0x2c46ba];return _0x7dc2e9;};'use strict';var Sequelize=require(_0x980d('0x0'));module[_0x980d('0x1')]={'name':{'type':Sequelize[_0x980d('0x2')],'unique':_0x980d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x980d('0x2')]}}; \ No newline at end of file +var _0xb13d=['STRING','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb13d,0xb7));var _0xdb13=function(_0x57faa7,_0x1d5aaf){_0x57faa7=_0x57faa7-0x0;var _0xcf1623=_0xb13d[_0x57faa7];return _0xcf1623;};'use strict';var Sequelize=require(_0xdb13('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb13('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xdb13('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index edd73f5..e2d0b98 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 _0x3e23=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','Pauses','UserProfileResource','end','name','index','map','Pause','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x196e1f,_0x18a7e1){var _0x2b5e77=function(_0x32ff81){while(--_0x32ff81){_0x196e1f['push'](_0x196e1f['shift']());}};_0x2b5e77(++_0x18a7e1);}(_0x3e23,0x88));var _0x33e2=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0x3e23[_0x548200];return _0x1a6d74;};'use strict';var emlformat=require(_0x33e2('0x0'));var rimraf=require(_0x33e2('0x1'));var zipdir=require(_0x33e2('0x2'));var jsonpatch=require(_0x33e2('0x3'));var rp=require(_0x33e2('0x4'));var moment=require(_0x33e2('0x5'));var BPromise=require(_0x33e2('0x6'));var Mustache=require(_0x33e2('0x7'));var util=require(_0x33e2('0x8'));var path=require(_0x33e2('0x9'));var sox=require('sox');var csv=require(_0x33e2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33e2('0xb'));var squel=require('squel');var crypto=require(_0x33e2('0xc'));var jsforce=require(_0x33e2('0xd'));var deskjs=require(_0x33e2('0xe'));var toCsv=require(_0x33e2('0xa'));var querystring=require(_0x33e2('0xf'));var Papa=require(_0x33e2('0x10'));var Redis=require(_0x33e2('0x11'));var authService=require(_0x33e2('0x12'));var qs=require(_0x33e2('0x13'));var as=require(_0x33e2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x33e2('0x15'));var config=require(_0x33e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x33e2('0x17'))['db'];function respondWithStatusCode(_0x48ff08,_0x45a9ac){_0x45a9ac=_0x45a9ac||0xcc;return function(_0x275633){if(_0x275633){return _0x48ff08[_0x33e2('0x18')](_0x45a9ac);}return _0x48ff08[_0x33e2('0x19')](_0x45a9ac)['end']();};}function respondWithResult(_0x136762,_0x1fd661){_0x1fd661=_0x1fd661||0xc8;return function(_0x3d493e){if(_0x3d493e){return _0x136762[_0x33e2('0x19')](_0x1fd661)[_0x33e2('0x1a')](_0x3d493e);}};}function respondWithFilteredResult(_0x49fd00,_0x509c4b){return function(_0x5a1e2b){if(_0x5a1e2b){var _0x5f57cf=typeof _0x509c4b[_0x33e2('0x1b')]===_0x33e2('0x1c')&&typeof _0x509c4b[_0x33e2('0x1d')]==='undefined';var _0x4f1909=_0x5a1e2b[_0x33e2('0x1e')];var _0x13c170=_0x5f57cf?0x0:_0x509c4b[_0x33e2('0x1b')];var _0x2bda9a=_0x5f57cf?_0x5a1e2b[_0x33e2('0x1e')]:_0x509c4b[_0x33e2('0x1b')]+_0x509c4b[_0x33e2('0x1d')];var _0x3c7089;if(_0x2bda9a>=_0x4f1909){_0x2bda9a=_0x4f1909;_0x3c7089=0xc8;}else{_0x3c7089=0xce;}_0x49fd00[_0x33e2('0x19')](_0x3c7089);return _0x49fd00[_0x33e2('0x1f')](_0x33e2('0x20'),_0x13c170+'-'+_0x2bda9a+'/'+_0x4f1909)[_0x33e2('0x1a')](_0x5a1e2b);}return null;};}function patchUpdates(_0x141ad3){return function(_0x524b5f){try{jsonpatch[_0x33e2('0x21')](_0x524b5f,_0x141ad3,!![]);}catch(_0x4f183c){return BPromise[_0x33e2('0x22')](_0x4f183c);}return _0x524b5f['save']();};}function saveUpdates(_0x50a103,_0x5ed7a9){return function(_0x2f0528){if(_0x2f0528){return _0x2f0528['update'](_0x50a103)[_0x33e2('0x23')](function(_0xde0a03){return _0xde0a03;});}return null;};}function removeEntity(_0x286f16,_0x5f1ee2){return function(_0x223bcf){if(_0x223bcf){return _0x223bcf['destroy']()[_0x33e2('0x23')](function(){var _0x2991f1=_0x223bcf[_0x33e2('0x24')]({'plain':!![]});var _0x29df61=_0x33e2('0x25');return db[_0x33e2('0x26')]['destroy']({'where':{'type':_0x29df61,'resourceId':_0x2991f1['id']}})['then'](function(){return _0x223bcf;});})[_0x33e2('0x23')](function(){_0x286f16[_0x33e2('0x19')](0xcc)[_0x33e2('0x27')]();});}};}function handleEntityNotFound(_0x418d38,_0x3ef757){return function(_0x559e77){if(!_0x559e77){_0x418d38[_0x33e2('0x18')](0x194);}return _0x559e77;};}function handleError(_0x419139,_0x214a9b){_0x214a9b=_0x214a9b||0x1f4;return function(_0x1dd863){logger['error'](_0x1dd863['stack']);if(_0x1dd863['name']){delete _0x1dd863[_0x33e2('0x28')];}_0x419139['status'](_0x214a9b)['send'](_0x1dd863);};}exports[_0x33e2('0x29')]=function(_0x457c7d,_0x17a3f0){var _0x216f53={},_0x324b68={},_0x20a1d1={'count':0x0,'rows':[]};var _0x2f347d=_[_0x33e2('0x2a')](db[_0x33e2('0x2b')]['rawAttributes'],function(_0x17d94d){return{'name':_0x17d94d[_0x33e2('0x2c')],'type':_0x17d94d['type'][_0x33e2('0x2d')]};});_0x324b68[_0x33e2('0x2e')]=_['map'](_0x2f347d,'name');_0x324b68[_0x33e2('0x2f')]=_[_0x33e2('0x30')](_0x457c7d[_0x33e2('0x2f')]);_0x324b68[_0x33e2('0x31')]=_['intersection'](_0x324b68[_0x33e2('0x2e')],_0x324b68[_0x33e2('0x2f')]);_0x216f53[_0x33e2('0x32')]=_[_0x33e2('0x33')](_0x324b68[_0x33e2('0x2e')],qs[_0x33e2('0x34')](_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x34')]));_0x216f53[_0x33e2('0x32')]=_0x216f53[_0x33e2('0x32')]['length']?_0x216f53[_0x33e2('0x32')]:_0x324b68[_0x33e2('0x2e')];if(!_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x35')]('nolimit')){_0x216f53['limit']=qs[_0x33e2('0x1d')](_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x1d')]);_0x216f53[_0x33e2('0x1b')]=qs[_0x33e2('0x1b')](_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x1b')]);}_0x216f53[_0x33e2('0x36')]=qs[_0x33e2('0x37')](_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x37')]);_0x216f53[_0x33e2('0x38')]=qs[_0x33e2('0x31')](_[_0x33e2('0x39')](_0x457c7d[_0x33e2('0x2f')],_0x324b68[_0x33e2('0x31')]),_0x2f347d);if(_0x457c7d['query'][_0x33e2('0x3a')]){_0x216f53['where']=_[_0x33e2('0x3b')](_0x216f53[_0x33e2('0x38')],{'$or':_[_0x33e2('0x2a')](_0x2f347d,function(_0x4791e2){if(_0x4791e2['type']!==_0x33e2('0x3c')){var _0x100911={};_0x100911[_0x4791e2[_0x33e2('0x28')]]={'$like':'%'+_0x457c7d[_0x33e2('0x2f')][_0x33e2('0x3a')]+'%'};return _0x100911;}})});}_0x216f53=_[_0x33e2('0x3b')]({},_0x216f53,_0x457c7d[_0x33e2('0x3d')]);var _0x49bb8f={'where':_0x216f53[_0x33e2('0x38')]};return db[_0x33e2('0x2b')][_0x33e2('0x1e')](_0x49bb8f)['then'](function(_0x33b879){_0x20a1d1['count']=_0x33b879;if(_0x457c7d['query'][_0x33e2('0x3e')]){_0x216f53[_0x33e2('0x3f')]=[{'all':!![]}];}return db[_0x33e2('0x2b')][_0x33e2('0x40')](_0x216f53);})[_0x33e2('0x23')](function(_0xb64efb){_0x20a1d1['rows']=_0xb64efb;return _0x20a1d1;})['then'](respondWithFilteredResult(_0x17a3f0,_0x216f53))[_0x33e2('0x41')](handleError(_0x17a3f0,null));};exports[_0x33e2('0x42')]=function(_0x11b313,_0xa988d4){var _0xe69bf6={'raw':!![],'where':{'id':_0x11b313[_0x33e2('0x43')]['id']}},_0x15fc6a={};_0x15fc6a['model']=_['keys'](db[_0x33e2('0x2b')]['rawAttributes']);_0x15fc6a[_0x33e2('0x2f')]=_[_0x33e2('0x30')](_0x11b313[_0x33e2('0x2f')]);_0x15fc6a[_0x33e2('0x31')]=_[_0x33e2('0x33')](_0x15fc6a[_0x33e2('0x2e')],_0x15fc6a[_0x33e2('0x2f')]);_0xe69bf6[_0x33e2('0x32')]=_[_0x33e2('0x33')](_0x15fc6a[_0x33e2('0x2e')],qs['fields'](_0x11b313[_0x33e2('0x2f')][_0x33e2('0x34')]));_0xe69bf6[_0x33e2('0x32')]=_0xe69bf6['attributes'][_0x33e2('0x44')]?_0xe69bf6[_0x33e2('0x32')]:_0x15fc6a[_0x33e2('0x2e')];if(_0x11b313[_0x33e2('0x2f')][_0x33e2('0x3e')]){_0xe69bf6[_0x33e2('0x3f')]=[{'all':!![]}];}_0xe69bf6=_['merge']({},_0xe69bf6,_0x11b313[_0x33e2('0x3d')]);return db[_0x33e2('0x2b')]['find'](_0xe69bf6)[_0x33e2('0x23')](handleEntityNotFound(_0xa988d4,null))[_0x33e2('0x23')](respondWithResult(_0xa988d4,null))[_0x33e2('0x41')](handleError(_0xa988d4,null));};exports[_0x33e2('0x45')]=function(_0x1abeaf,_0xd04afe){return db[_0x33e2('0x2b')][_0x33e2('0x45')](_0x1abeaf[_0x33e2('0x46')],{})[_0x33e2('0x23')](function(_0x158cdc){var _0x512abd=_0x1abeaf[_0x33e2('0x47')][_0x33e2('0x24')]({'plain':!![]});if(!_0x512abd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x512abd[_0x33e2('0x48')]===_0x33e2('0x47')){var _0x398b38=_0x158cdc['get']({'plain':!![]});var _0x231533=_0x33e2('0x25');return db[_0x33e2('0x49')][_0x33e2('0x4a')]({'where':{'name':_0x231533,'userProfileId':_0x512abd[_0x33e2('0x4b')]},'raw':!![]})[_0x33e2('0x23')](function(_0x1956e8){if(_0x1956e8&&_0x1956e8['autoAssociation']===0x0){return db[_0x33e2('0x26')][_0x33e2('0x45')]({'name':_0x398b38['name'],'resourceId':_0x398b38['id'],'type':_0x1956e8['name'],'sectionId':_0x1956e8['id']},{})[_0x33e2('0x23')](function(){return _0x158cdc;});}else{return _0x158cdc;}})[_0x33e2('0x41')](function(_0x1f62ce){logger[_0x33e2('0x4c')](_0x33e2('0x4d'),_0x1f62ce);throw _0x1f62ce;});}return _0x158cdc;})['then'](respondWithResult(_0xd04afe,0xc9))[_0x33e2('0x41')](handleError(_0xd04afe,null));};exports[_0x33e2('0x4e')]=function(_0x7a0333,_0x6d1b4a){if(_0x7a0333[_0x33e2('0x46')]['id']){delete _0x7a0333[_0x33e2('0x46')]['id'];}return db[_0x33e2('0x2b')][_0x33e2('0x4a')]({'where':{'id':_0x7a0333[_0x33e2('0x43')]['id']}})[_0x33e2('0x23')](handleEntityNotFound(_0x6d1b4a,null))[_0x33e2('0x23')](saveUpdates(_0x7a0333[_0x33e2('0x46')],null))[_0x33e2('0x23')](respondWithResult(_0x6d1b4a,null))[_0x33e2('0x41')](handleError(_0x6d1b4a,null));};exports[_0x33e2('0x4f')]=function(_0x3da4d3,_0x900a9f){return db['Pause'][_0x33e2('0x4a')]({'where':{'id':_0x3da4d3['params']['id']}})['then'](handleEntityNotFound(_0x900a9f,null))['then'](removeEntity(_0x900a9f,null))[_0x33e2('0x41')](handleError(_0x900a9f,null));}; \ No newline at end of file +var _0xc2ff=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','reject','update','Pauses','then','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','sort','pick','filter','where','merge','options','count','includeAll','include','rows','show','params','find','catch','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create'];(function(_0x3044da,_0x67a6f5){var _0xaea31b=function(_0x530cfb){while(--_0x530cfb){_0x3044da['push'](_0x3044da['shift']());}};_0xaea31b(++_0x67a6f5);}(_0xc2ff,0xfc));var _0xfc2f=function(_0x5bf174,_0x52067d){_0x5bf174=_0x5bf174-0x0;var _0x56c4da=_0xc2ff[_0x5bf174];return _0x56c4da;};'use strict';var emlformat=require(_0xfc2f('0x0'));var rimraf=require(_0xfc2f('0x1'));var zipdir=require(_0xfc2f('0x2'));var jsonpatch=require(_0xfc2f('0x3'));var rp=require(_0xfc2f('0x4'));var moment=require(_0xfc2f('0x5'));var BPromise=require(_0xfc2f('0x6'));var Mustache=require(_0xfc2f('0x7'));var util=require(_0xfc2f('0x8'));var path=require(_0xfc2f('0x9'));var sox=require('sox');var csv=require(_0xfc2f('0xa'));var ejs=require(_0xfc2f('0xb'));var fs=require('fs');var fs_extra=require(_0xfc2f('0xc'));var _=require(_0xfc2f('0xd'));var squel=require(_0xfc2f('0xe'));var crypto=require(_0xfc2f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xfc2f('0x10'));var toCsv=require(_0xfc2f('0xa'));var querystring=require(_0xfc2f('0x11'));var Papa=require(_0xfc2f('0x12'));var Redis=require(_0xfc2f('0x13'));var authService=require(_0xfc2f('0x14'));var qs=require(_0xfc2f('0x15'));var as=require(_0xfc2f('0x16'));var hardwareService=require(_0xfc2f('0x17'));var logger=require(_0xfc2f('0x18'))('api');var utils=require(_0xfc2f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfc2f('0x1a'))['db'];function respondWithStatusCode(_0x3a762f,_0x5abbb8){_0x5abbb8=_0x5abbb8||0xcc;return function(_0x39238e){if(_0x39238e){return _0x3a762f[_0xfc2f('0x1b')](_0x5abbb8);}return _0x3a762f[_0xfc2f('0x1c')](_0x5abbb8)[_0xfc2f('0x1d')]();};}function respondWithResult(_0x39ff5c,_0x4079c8){_0x4079c8=_0x4079c8||0xc8;return function(_0x759556){if(_0x759556){return _0x39ff5c[_0xfc2f('0x1c')](_0x4079c8)[_0xfc2f('0x1e')](_0x759556);}};}function respondWithFilteredResult(_0x198d01,_0x5a78c5){return function(_0x1c8019){if(_0x1c8019){var _0x1f3815=typeof _0x5a78c5[_0xfc2f('0x1f')]===_0xfc2f('0x20')&&typeof _0x5a78c5[_0xfc2f('0x21')]===_0xfc2f('0x20');var _0x4ecad8=_0x1c8019['count'];var _0x68c2d=_0x1f3815?0x0:_0x5a78c5[_0xfc2f('0x1f')];var _0x5f469e=_0x1f3815?_0x1c8019['count']:_0x5a78c5[_0xfc2f('0x1f')]+_0x5a78c5['limit'];var _0x504f2c;if(_0x5f469e>=_0x4ecad8){_0x5f469e=_0x4ecad8;_0x504f2c=0xc8;}else{_0x504f2c=0xce;}_0x198d01['status'](_0x504f2c);return _0x198d01['set']('Content-Range',_0x68c2d+'-'+_0x5f469e+'/'+_0x4ecad8)[_0xfc2f('0x1e')](_0x1c8019);}return null;};}function patchUpdates(_0x73b699){return function(_0x4d62a6){try{jsonpatch['apply'](_0x4d62a6,_0x73b699,!![]);}catch(_0x91b93b){return BPromise[_0xfc2f('0x22')](_0x91b93b);}return _0x4d62a6['save']();};}function saveUpdates(_0x5104ba,_0x306b2f){return function(_0x557472){if(_0x557472){return _0x557472[_0xfc2f('0x23')](_0x5104ba)['then'](function(_0x22be53){return _0x22be53;});}return null;};}function removeEntity(_0x477380,_0x191fa9){return function(_0x957885){if(_0x957885){return _0x957885['destroy']()['then'](function(){var _0x1f9160=_0x957885['get']({'plain':!![]});var _0x5c093d=_0xfc2f('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5c093d,'resourceId':_0x1f9160['id']}})[_0xfc2f('0x25')](function(){return _0x957885;});})[_0xfc2f('0x25')](function(){_0x477380[_0xfc2f('0x1c')](0xcc)[_0xfc2f('0x1d')]();});}};}function handleEntityNotFound(_0x27cfe0,_0x3d9b2e){return function(_0x34e6a7){if(!_0x34e6a7){_0x27cfe0['sendStatus'](0x194);}return _0x34e6a7;};}function handleError(_0x335e03,_0x25e4e0){_0x25e4e0=_0x25e4e0||0x1f4;return function(_0x200e78){logger[_0xfc2f('0x26')](_0x200e78[_0xfc2f('0x27')]);if(_0x200e78['name']){delete _0x200e78[_0xfc2f('0x28')];}_0x335e03[_0xfc2f('0x1c')](_0x25e4e0)[_0xfc2f('0x29')](_0x200e78);};}exports[_0xfc2f('0x2a')]=function(_0x3bdf88,_0x1cb9df){var _0x185b81={},_0x2b9bde={},_0xe0b459={'count':0x0,'rows':[]};var _0x5c0e65=_[_0xfc2f('0x2b')](db[_0xfc2f('0x2c')][_0xfc2f('0x2d')],function(_0x249e6d){return{'name':_0x249e6d[_0xfc2f('0x2e')],'type':_0x249e6d[_0xfc2f('0x2f')][_0xfc2f('0x30')]};});_0x2b9bde['model']=_[_0xfc2f('0x2b')](_0x5c0e65,'name');_0x2b9bde[_0xfc2f('0x31')]=_[_0xfc2f('0x32')](_0x3bdf88[_0xfc2f('0x31')]);_0x2b9bde[_0xfc2f('0x33')]=_['intersection'](_0x2b9bde['model'],_0x2b9bde[_0xfc2f('0x31')]);_0x185b81[_0xfc2f('0x34')]=_[_0xfc2f('0x35')](_0x2b9bde[_0xfc2f('0x36')],qs[_0xfc2f('0x37')](_0x3bdf88[_0xfc2f('0x31')]['fields']));_0x185b81['attributes']=_0x185b81['attributes'][_0xfc2f('0x38')]?_0x185b81[_0xfc2f('0x34')]:_0x2b9bde[_0xfc2f('0x36')];if(!_0x3bdf88[_0xfc2f('0x31')]['hasOwnProperty']('nolimit')){_0x185b81['limit']=qs['limit'](_0x3bdf88[_0xfc2f('0x31')]['limit']);_0x185b81['offset']=qs[_0xfc2f('0x1f')](_0x3bdf88[_0xfc2f('0x31')]['offset']);}_0x185b81['order']=qs[_0xfc2f('0x39')](_0x3bdf88[_0xfc2f('0x31')][_0xfc2f('0x39')]);_0x185b81['where']=qs[_0xfc2f('0x33')](_[_0xfc2f('0x3a')](_0x3bdf88[_0xfc2f('0x31')],_0x2b9bde['filters']),_0x5c0e65);if(_0x3bdf88[_0xfc2f('0x31')][_0xfc2f('0x3b')]){_0x185b81[_0xfc2f('0x3c')]=_[_0xfc2f('0x3d')](_0x185b81[_0xfc2f('0x3c')],{'$or':_[_0xfc2f('0x2b')](_0x5c0e65,function(_0x1e3e3d){if(_0x1e3e3d[_0xfc2f('0x2f')]!=='VIRTUAL'){var _0x5a1314={};_0x5a1314[_0x1e3e3d[_0xfc2f('0x28')]]={'$like':'%'+_0x3bdf88[_0xfc2f('0x31')][_0xfc2f('0x3b')]+'%'};return _0x5a1314;}})});}_0x185b81=_['merge']({},_0x185b81,_0x3bdf88[_0xfc2f('0x3e')]);var _0x11694c={'where':_0x185b81[_0xfc2f('0x3c')]};return db['Pause'][_0xfc2f('0x3f')](_0x11694c)[_0xfc2f('0x25')](function(_0x41a51e){_0xe0b459[_0xfc2f('0x3f')]=_0x41a51e;if(_0x3bdf88[_0xfc2f('0x31')][_0xfc2f('0x40')]){_0x185b81[_0xfc2f('0x41')]=[{'all':!![]}];}return db[_0xfc2f('0x2c')]['findAll'](_0x185b81);})[_0xfc2f('0x25')](function(_0x2a9145){_0xe0b459[_0xfc2f('0x42')]=_0x2a9145;return _0xe0b459;})[_0xfc2f('0x25')](respondWithFilteredResult(_0x1cb9df,_0x185b81))['catch'](handleError(_0x1cb9df,null));};exports[_0xfc2f('0x43')]=function(_0x31f610,_0x42f39e){var _0x1976b0={'raw':!![],'where':{'id':_0x31f610[_0xfc2f('0x44')]['id']}},_0x4025eb={};_0x4025eb[_0xfc2f('0x36')]=_['keys'](db[_0xfc2f('0x2c')][_0xfc2f('0x2d')]);_0x4025eb['query']=_['keys'](_0x31f610[_0xfc2f('0x31')]);_0x4025eb['filters']=_[_0xfc2f('0x35')](_0x4025eb['model'],_0x4025eb[_0xfc2f('0x31')]);_0x1976b0[_0xfc2f('0x34')]=_[_0xfc2f('0x35')](_0x4025eb[_0xfc2f('0x36')],qs[_0xfc2f('0x37')](_0x31f610[_0xfc2f('0x31')][_0xfc2f('0x37')]));_0x1976b0[_0xfc2f('0x34')]=_0x1976b0[_0xfc2f('0x34')]['length']?_0x1976b0[_0xfc2f('0x34')]:_0x4025eb[_0xfc2f('0x36')];if(_0x31f610['query'][_0xfc2f('0x40')]){_0x1976b0[_0xfc2f('0x41')]=[{'all':!![]}];}_0x1976b0=_[_0xfc2f('0x3d')]({},_0x1976b0,_0x31f610[_0xfc2f('0x3e')]);return db['Pause'][_0xfc2f('0x45')](_0x1976b0)[_0xfc2f('0x25')](handleEntityNotFound(_0x42f39e,null))[_0xfc2f('0x25')](respondWithResult(_0x42f39e,null))[_0xfc2f('0x46')](handleError(_0x42f39e,null));};exports['create']=function(_0x46dedb,_0x3e6d99){return db[_0xfc2f('0x2c')]['create'](_0x46dedb['body'],{})[_0xfc2f('0x25')](function(_0x1de7d6){var _0x8eabc9=_0x46dedb['user'][_0xfc2f('0x47')]({'plain':!![]});if(!_0x8eabc9)throw new Error(_0xfc2f('0x48'));if(_0x8eabc9[_0xfc2f('0x49')]===_0xfc2f('0x4a')){var _0x2b21cb=_0x1de7d6['get']({'plain':!![]});var _0x3c4814=_0xfc2f('0x24');return db[_0xfc2f('0x4b')][_0xfc2f('0x45')]({'where':{'name':_0x3c4814,'userProfileId':_0x8eabc9[_0xfc2f('0x4c')]},'raw':!![]})['then'](function(_0x6ea73b){if(_0x6ea73b&&_0x6ea73b[_0xfc2f('0x4d')]===0x0){return db[_0xfc2f('0x4e')][_0xfc2f('0x4f')]({'name':_0x2b21cb['name'],'resourceId':_0x2b21cb['id'],'type':_0x6ea73b['name'],'sectionId':_0x6ea73b['id']},{})[_0xfc2f('0x25')](function(){return _0x1de7d6;});}else{return _0x1de7d6;}})['catch'](function(_0x1f9e58){logger[_0xfc2f('0x26')](_0xfc2f('0x50'),_0x1f9e58);throw _0x1f9e58;});}return _0x1de7d6;})[_0xfc2f('0x25')](respondWithResult(_0x3e6d99,0xc9))[_0xfc2f('0x46')](handleError(_0x3e6d99,null));};exports['update']=function(_0x3daa96,_0x109dff){if(_0x3daa96[_0xfc2f('0x51')]['id']){delete _0x3daa96['body']['id'];}return db['Pause'][_0xfc2f('0x45')]({'where':{'id':_0x3daa96['params']['id']}})[_0xfc2f('0x25')](handleEntityNotFound(_0x109dff,null))['then'](saveUpdates(_0x3daa96[_0xfc2f('0x51')],null))[_0xfc2f('0x25')](respondWithResult(_0x109dff,null))[_0xfc2f('0x46')](handleError(_0x109dff,null));};exports[_0xfc2f('0x52')]=function(_0x46fc5b,_0xad3dc8){return db[_0xfc2f('0x2c')][_0xfc2f('0x45')]({'where':{'id':_0x46fc5b[_0xfc2f('0x44')]['id']}})[_0xfc2f('0x25')](handleEntityNotFound(_0xad3dc8,null))[_0xfc2f('0x25')](removeEntity(_0xad3dc8,null))[_0xfc2f('0x46')](handleError(_0xad3dc8,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ac51a3b..f60a2a4 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x2acbcb,_0x4d11ba){var _0x102fc6=function(_0x547c9c){while(--_0x547c9c){_0x2acbcb['push'](_0x2acbcb['shift']());}};_0x102fc6(++_0x4d11ba);}(_0xf494,0x1c6));var _0x4f49=function(_0x10ef79,_0x52233b){_0x10ef79=_0x10ef79-0x0;var _0x3cc423=_0xf494[_0x10ef79];return _0x3cc423;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x7fbe[_0x1cd674];return _0x27928f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b6984ca..72a1d93 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(_0x4a525e,_0x615150){var _0x149a94=function(_0xa51727){while(--_0xa51727){_0x4a525e['push'](_0x4a525e['shift']());}};_0x149a94(++_0x615150);}(_0x7a54,0x106));var _0x47a5=function(_0x6f41c8,_0x2bf83a){_0x6f41c8=_0x6f41c8-0x0;var _0x45e478=_0x7a54[_0x6f41c8];return _0x45e478;};'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 _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(_0x327b5e,_0x519464){var _0x4118fb=function(_0x311d85){while(--_0x311d85){_0x327b5e['push'](_0x327b5e['shift']());}};_0x4118fb(++_0x519464);}(_0x7a54,0x106));var _0x47a5=function(_0x35039a,_0x56f931){_0x35039a=_0x35039a-0x0;var _0x50617f=_0x7a54[_0x35039a];return _0x50617f;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 7c009de..c853e15 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 _0x2dae=['put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','file','upload'];(function(_0x5dafeb,_0x12878c){var _0x5424c6=function(_0x30fb2c){while(--_0x30fb2c){_0x5dafeb['push'](_0x5dafeb['shift']());}};_0x5424c6(++_0x12878c);}(_0x2dae,0xc3));var _0xe2da=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x2dae[_0xf2662b];return _0x257dc7;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),controller[_0xe2da('0xc')]);router[_0xe2da('0x9')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0xf')]);router[_0xe2da('0x9')]('/:id/download',auth[_0xe2da('0xe')](),controller[_0xe2da('0x10')]);var upload=multer({'storage':multer[_0xe2da('0x11')]({'destination':function(_0x17086c,_0x3c1309,_0x44ec3e){_0x44ec3e(null,path[_0xe2da('0x12')](config[_0xe2da('0x13')],'server/files/plugins'));},'filename':function(_0xb98909,_0x5200b1,_0x4377c6){_0x5200b1[_0xe2da('0x14')]=_0x5200b1[_0xe2da('0x14')][_0xe2da('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4377c6(null,util[_0xe2da('0x16')](_0xe2da('0x17'),path[_0xe2da('0x18')](_0x5200b1['originalname'],path[_0xe2da('0x19')](_0x5200b1['originalname'])),Date['now'](),path[_0xe2da('0x19')](_0x5200b1[_0xe2da('0x14')])));}})});router[_0xe2da('0x1a')]('/',upload['single'](_0xe2da('0x1b')),controller[_0xe2da('0x1c')]);router[_0xe2da('0x1a')](_0xe2da('0xb'),controller['webhookPost']);router[_0xe2da('0x1d')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0x1e')]);router[_0xe2da('0x1f')]('/:id',auth[_0xe2da('0xe')](),controller[_0xe2da('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x032e=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id'];(function(_0x5b2055,_0x54d67f){var _0x260d67=function(_0x2a0f1a){while(--_0x2a0f1a){_0x5b2055['push'](_0x5b2055['shift']());}};_0x260d67(++_0x54d67f);}(_0x032e,0x124));var _0xe032=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x032e[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0x8')](_0xe032('0xf'),auth[_0xe032('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xe032('0x10')]({'destination':function(_0x1ce2ae,_0x13c126,_0x42e2ba){_0x42e2ba(null,path[_0xe032('0x11')](config[_0xe032('0x12')],_0xe032('0x13')));},'filename':function(_0x5bcb5b,_0x646979,_0x266d71){_0x646979[_0xe032('0x14')]=_0x646979[_0xe032('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x266d71(null,util[_0xe032('0x15')](_0xe032('0x16'),path[_0xe032('0x17')](_0x646979[_0xe032('0x14')],path[_0xe032('0x18')](_0x646979[_0xe032('0x14')])),Date[_0xe032('0x19')](),path['extname'](_0x646979[_0xe032('0x14')])));}})});router[_0xe032('0x1a')]('/',upload[_0xe032('0x1b')](_0xe032('0x1c')),controller[_0xe032('0x1d')]);router[_0xe032('0x1a')]('/webhook',controller[_0xe032('0x1e')]);router[_0xe032('0x1f')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe032('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index a13493a..3a8d7c0 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 _0x0633=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','script'];(function(_0x24a79e,_0x6d3f4f){var _0x42034d=function(_0x5ef6ee){while(--_0x5ef6ee){_0x24a79e['push'](_0x24a79e['shift']());}};_0x42034d(++_0x6d3f4f);}(_0x0633,0x188));var _0x3063=function(_0x1d3990,_0x39869a){_0x1d3990=_0x1d3990-0x0;var _0x46b55d=_0x0633[_0x1d3990];return _0x46b55d;};'use strict';var Sequelize=require(_0x3063('0x0'));module[_0x3063('0x1')]={'name':{'type':Sequelize[_0x3063('0x2')]},'type':{'type':Sequelize['ENUM']('html',_0x3063('0x3'))},'description':{'type':Sequelize[_0x3063('0x4')]},'version':{'type':Sequelize[_0x3063('0x4')]},'path':{'type':Sequelize[_0x3063('0x2')],'comment':_0x3063('0x5')},'active':{'type':Sequelize[_0x3063('0x6')],'defaultValue':0x0,'comment':_0x3063('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x3063('0x8'),'agentOnly',_0x3063('0x9'),'never'),'defaultValue':_0x3063('0x9'),'comment':_0x3063('0xa')},'icon':{'type':Sequelize[_0x3063('0x2')]},'adminUrl':{'type':Sequelize[_0x3063('0x2')]},'agentUrl':{'type':Sequelize[_0x3063('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x3063('0x2')]}}; \ No newline at end of file +var _0xe29f=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports','STRING','ENUM','script'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe29f,0x1dc));var _0xfe29=function(_0x10b334,_0x267216){_0x10b334=_0x10b334-0x0;var _0x58206e=_0xe29f[_0x10b334];return _0x58206e;};'use strict';var Sequelize=require(_0xfe29('0x0'));module[_0xfe29('0x1')]={'name':{'type':Sequelize[_0xfe29('0x2')]},'type':{'type':Sequelize[_0xfe29('0x3')]('html',_0xfe29('0x4'))},'description':{'type':Sequelize[_0xfe29('0x5')]},'version':{'type':Sequelize[_0xfe29('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xfe29('0x6')},'active':{'type':Sequelize[_0xfe29('0x7')],'defaultValue':0x0,'comment':_0xfe29('0x8')},'sidebar':{'type':Sequelize[_0xfe29('0x3')](_0xfe29('0x9'),_0xfe29('0xa'),_0xfe29('0xb'),_0xfe29('0xc')),'defaultValue':_0xfe29('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xfe29('0x2')]},'scriptName':{'type':Sequelize[_0xfe29('0x2')]},'scriptPath':{'type':Sequelize[_0xfe29('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c098236..d781371 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 _0xb415=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','Plugins','UserProfileResource','destroy','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','params','join','root','server/files/plugins','format','%s.zip','warning','ENOENT','error','Sequelize','Error','glob','**/*','dirname','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','download','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x199588,_0x14777c){var _0x478dd3=function(_0x437dc9){while(--_0x437dc9){_0x199588['push'](_0x199588['shift']());}};_0x478dd3(++_0x14777c);}(_0xb415,0x142));var _0x5b41=function(_0x478aa0,_0x30bb33){_0x478aa0=_0x478aa0-0x0;var _0xa60f72=_0xb415[_0x478aa0];return _0xa60f72;};'use strict';var emlformat=require(_0x5b41('0x0'));var rimraf=require(_0x5b41('0x1'));var zipdir=require(_0x5b41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b41('0x3'));var BPromise=require(_0x5b41('0x4'));var Mustache=require('mustache');var util=require(_0x5b41('0x5'));var path=require(_0x5b41('0x6'));var sox=require('sox');var csv=require(_0x5b41('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b41('0x8'));var _=require(_0x5b41('0x9'));var squel=require(_0x5b41('0xa'));var crypto=require(_0x5b41('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5b41('0xc'));var toCsv=require(_0x5b41('0x7'));var querystring=require(_0x5b41('0xd'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x5b41('0xe'));var authService=require(_0x5b41('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5b41('0x10'));var hardwareService=require(_0x5b41('0x11'));var logger=require(_0x5b41('0x12'))(_0x5b41('0x13'));var utils=require(_0x5b41('0x14'));var config=require(_0x5b41('0x15'));var licenseUtil=require(_0x5b41('0x16'));var db=require(_0x5b41('0x17'))['db'];config[_0x5b41('0x18')]=_[_0x5b41('0x19')](config['redis'],{'host':_0x5b41('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5b41('0x1b'))[_0x5b41('0x1c')](socket);function respondWithStatusCode(_0x1b45a4,_0x3c3476){_0x3c3476=_0x3c3476||0xcc;return function(_0x1bc652){if(_0x1bc652){return _0x1b45a4[_0x5b41('0x1d')](_0x3c3476);}return _0x1b45a4['status'](_0x3c3476)[_0x5b41('0x1e')]();};}function respondWithResult(_0x7647ce,_0x34446c){_0x34446c=_0x34446c||0xc8;return function(_0x2402f0){if(_0x2402f0){return _0x7647ce[_0x5b41('0x1f')](_0x34446c)[_0x5b41('0x20')](_0x2402f0);}};}function respondWithFilteredResult(_0x150bbb,_0xb95687){return function(_0x120684){if(_0x120684){var _0x428ede=typeof _0xb95687[_0x5b41('0x21')]===_0x5b41('0x22')&&typeof _0xb95687[_0x5b41('0x23')]===_0x5b41('0x22');var _0x11ec3b=_0x120684[_0x5b41('0x24')];var _0x5d0b3e=_0x428ede?0x0:_0xb95687[_0x5b41('0x21')];var _0x1cf516=_0x428ede?_0x120684[_0x5b41('0x24')]:_0xb95687['offset']+_0xb95687[_0x5b41('0x23')];var _0x4e1b92;if(_0x1cf516>=_0x11ec3b){_0x1cf516=_0x11ec3b;_0x4e1b92=0xc8;}else{_0x4e1b92=0xce;}_0x150bbb[_0x5b41('0x1f')](_0x4e1b92);return _0x150bbb[_0x5b41('0x25')](_0x5b41('0x26'),_0x5d0b3e+'-'+_0x1cf516+'/'+_0x11ec3b)[_0x5b41('0x20')](_0x120684);}return null;};}function patchUpdates(_0x58ca7a){return function(_0x502e23){try{jsonpatch['apply'](_0x502e23,_0x58ca7a,!![]);}catch(_0x16b39b){return BPromise[_0x5b41('0x27')](_0x16b39b);}return _0x502e23['save']();};}function saveUpdates(_0x13492f,_0x12ba89){return function(_0x4201f7){if(_0x4201f7){return _0x4201f7['update'](_0x13492f)[_0x5b41('0x28')](function(_0x4e03b9){return _0x4e03b9;});}return null;};}function removeEntity(_0xa09959,_0x3a5978){return function(_0x5dd0d4){if(_0x5dd0d4){return _0x5dd0d4['destroy']()[_0x5b41('0x28')](function(){var _0x518f1=_0x5dd0d4[_0x5b41('0x29')]({'plain':!![]});var _0x10be4e=_0x5b41('0x2a');return db[_0x5b41('0x2b')][_0x5b41('0x2c')]({'where':{'type':_0x10be4e,'resourceId':_0x518f1['id']}})[_0x5b41('0x28')](function(){return _0x5dd0d4;});})[_0x5b41('0x28')](function(){_0xa09959[_0x5b41('0x1f')](0xcc)[_0x5b41('0x1e')]();});}};}function handleEntityNotFound(_0x103960,_0xc0852c){return function(_0x5bbef4){if(!_0x5bbef4){_0x103960[_0x5b41('0x1d')](0x194);}return _0x5bbef4;};}function handleError(_0x5bf32b,_0x3bfa99){_0x3bfa99=_0x3bfa99||0x1f4;return function(_0x2ba6e7){logger['error'](_0x2ba6e7[_0x5b41('0x2d')]);if(_0x2ba6e7[_0x5b41('0x2e')]){delete _0x2ba6e7['name'];}_0x5bf32b[_0x5b41('0x1f')](_0x3bfa99)[_0x5b41('0x2f')](_0x2ba6e7);};}exports[_0x5b41('0x30')]=function(_0x5a62b2,_0x1d5f12){var _0x279e2e={},_0x29549d={},_0x3541f5={'count':0x0,'rows':[]};var _0x4f7d46=_[_0x5b41('0x31')](db[_0x5b41('0x32')][_0x5b41('0x33')],function(_0x48d0df){return{'name':_0x48d0df[_0x5b41('0x34')],'type':_0x48d0df[_0x5b41('0x35')]['key']};});_0x29549d[_0x5b41('0x36')]=_['map'](_0x4f7d46,_0x5b41('0x2e'));_0x29549d[_0x5b41('0x37')]=_[_0x5b41('0x38')](_0x5a62b2[_0x5b41('0x37')]);_0x29549d[_0x5b41('0x39')]=_[_0x5b41('0x3a')](_0x29549d[_0x5b41('0x36')],_0x29549d[_0x5b41('0x37')]);_0x279e2e[_0x5b41('0x3b')]=_[_0x5b41('0x3a')](_0x29549d[_0x5b41('0x36')],qs['fields'](_0x5a62b2['query'][_0x5b41('0x3c')]));_0x279e2e[_0x5b41('0x3b')]=_0x279e2e[_0x5b41('0x3b')][_0x5b41('0x3d')]?_0x279e2e[_0x5b41('0x3b')]:_0x29549d[_0x5b41('0x36')];if(!_0x5a62b2[_0x5b41('0x37')][_0x5b41('0x3e')]('nolimit')){_0x279e2e[_0x5b41('0x23')]=qs[_0x5b41('0x23')](_0x5a62b2[_0x5b41('0x37')]['limit']);_0x279e2e[_0x5b41('0x21')]=qs[_0x5b41('0x21')](_0x5a62b2['query'][_0x5b41('0x21')]);}_0x279e2e[_0x5b41('0x3f')]=qs[_0x5b41('0x40')](_0x5a62b2[_0x5b41('0x37')][_0x5b41('0x40')]);_0x279e2e[_0x5b41('0x41')]=qs['filters'](_[_0x5b41('0x42')](_0x5a62b2[_0x5b41('0x37')],_0x29549d[_0x5b41('0x39')]),_0x4f7d46);if(_0x5a62b2[_0x5b41('0x37')][_0x5b41('0x43')]){_0x279e2e[_0x5b41('0x41')]=_[_0x5b41('0x44')](_0x279e2e[_0x5b41('0x41')],{'$or':_[_0x5b41('0x31')](_0x4f7d46,function(_0x17e094){if(_0x17e094['type']!==_0x5b41('0x45')){var _0x14fa34={};_0x14fa34[_0x17e094[_0x5b41('0x2e')]]={'$like':'%'+_0x5a62b2[_0x5b41('0x37')][_0x5b41('0x43')]+'%'};return _0x14fa34;}})});}_0x279e2e=_[_0x5b41('0x44')]({},_0x279e2e,_0x5a62b2[_0x5b41('0x46')]);var _0xfe783f={'where':_0x279e2e[_0x5b41('0x41')]};return db['Plugin'][_0x5b41('0x24')](_0xfe783f)['then'](function(_0x2a6d0c){_0x3541f5['count']=_0x2a6d0c;if(_0x5a62b2[_0x5b41('0x37')]['includeAll']){_0x279e2e[_0x5b41('0x47')]=[{'all':!![]}];}return db[_0x5b41('0x32')][_0x5b41('0x48')](_0x279e2e);})[_0x5b41('0x28')](function(_0x4858e2){_0x3541f5[_0x5b41('0x49')]=_0x4858e2;return _0x3541f5;})['then'](respondWithFilteredResult(_0x1d5f12,_0x279e2e))[_0x5b41('0x4a')](handleError(_0x1d5f12,null));};exports[_0x5b41('0x4b')]=function(_0x345d5a,_0x125413){var _0x52cd3e={'raw':!![],'where':{'id':_0x345d5a['params']['id']}},_0x65304a={};_0x65304a[_0x5b41('0x36')]=_['keys'](db[_0x5b41('0x32')]['rawAttributes']);_0x65304a[_0x5b41('0x37')]=_[_0x5b41('0x38')](_0x345d5a[_0x5b41('0x37')]);_0x65304a[_0x5b41('0x39')]=_[_0x5b41('0x3a')](_0x65304a[_0x5b41('0x36')],_0x65304a['query']);_0x52cd3e[_0x5b41('0x3b')]=_['intersection'](_0x65304a[_0x5b41('0x36')],qs['fields'](_0x345d5a[_0x5b41('0x37')][_0x5b41('0x3c')]));_0x52cd3e[_0x5b41('0x3b')]=_0x52cd3e[_0x5b41('0x3b')]['length']?_0x52cd3e['attributes']:_0x65304a['model'];if(_0x345d5a['query'][_0x5b41('0x4c')]){_0x52cd3e[_0x5b41('0x47')]=[{'all':!![]}];}_0x52cd3e=_[_0x5b41('0x44')]({},_0x52cd3e,_0x345d5a[_0x5b41('0x46')]);return db[_0x5b41('0x32')]['find'](_0x52cd3e)[_0x5b41('0x28')](handleEntityNotFound(_0x125413,null))[_0x5b41('0x28')](respondWithResult(_0x125413,null))['catch'](handleError(_0x125413,null));};exports['download']=function(_0x2dabd9,_0x1810d2,_0x2c1652){return db[_0x5b41('0x32')]['find']({'where':{'id':_0x2dabd9[_0x5b41('0x4d')]['id']},'attributes':[_0x5b41('0x2e'),_0x5b41('0x6')],'raw':!![]})[_0x5b41('0x28')](handleEntityNotFound(_0x1810d2,null))[_0x5b41('0x28')](function(_0xe694f){if(_0xe694f){var _0x2d642a=path[_0x5b41('0x4e')](config[_0x5b41('0x4f')],_0x5b41('0x50'),util[_0x5b41('0x51')](_0x5b41('0x52'),path['basename'](_0xe694f[_0x5b41('0x6')])));var _0x16a11d=fs['createWriteStream'](_0x2d642a);var _0x554697=archiver('zip',{'zlib':{'level':0x9}});_0x554697['on'](_0x5b41('0x53'),function(_0x55580a){if(_0x55580a['code']===_0x5b41('0x54')){logger[_0x5b41('0x55')](_0x55580a);}else{throw new db[(_0x5b41('0x56'))][(_0x5b41('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x554697['on'](_0x5b41('0x55'),function(_0x2ad881){throw new db['Sequelize'][(_0x5b41('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x554697['pipe'](_0x16a11d);_0x554697[_0x5b41('0x58')](_0x5b41('0x59'),{'cwd':path[_0x5b41('0x4e')](config[_0x5b41('0x4f')],'server/files/plugins',path[_0x5b41('0x5a')](_0xe694f[_0x5b41('0x6')])),'ignore':[path['join'](path['basename'](_0xe694f[_0x5b41('0x6')]),_0x5b41('0x5b')),path['join'](path[_0x5b41('0x5c')](_0xe694f[_0x5b41('0x6')]),_0x5b41('0x5d'))],'nodir':!![]})[_0x5b41('0x5e')]();_0x16a11d['on'](_0x5b41('0x5f'),function(){if(!fs[_0x5b41('0x60')](_0x2d642a)){throw new db[(_0x5b41('0x56'))][(_0x5b41('0x57'))](_0x5b41('0x61'));}return _0x1810d2['download'](_0x2d642a,util[_0x5b41('0x51')](_0x5b41('0x52'),path[_0x5b41('0x5c')](_0xe694f[_0x5b41('0x6')])),function(_0x2faf01){if(_0x2faf01){throw new db[(_0x5b41('0x56'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x5b41('0x62')](_0x2d642a);logger[_0x5b41('0x63')](_0x5b41('0x64'));logger[_0x5b41('0x63')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x1810d2,null));};exports[_0x5b41('0x65')]=function(_0x2df493,_0x2b6131,_0x431f93){var _0x4147c8=path[_0x5b41('0x5c')](_0x2df493[_0x5b41('0x66')][_0x5b41('0x67')],path[_0x5b41('0x68')](_0x2df493[_0x5b41('0x66')][_0x5b41('0x67')]));var _0x3dce65=path['join'](config['root'],_0x5b41('0x50'),_0x2df493[_0x5b41('0x66')][_0x5b41('0x67')]);var _0x48dcd4=path[_0x5b41('0x4e')](config[_0x5b41('0x4f')],_0x5b41('0x50'),_0x4147c8);logger[_0x5b41('0x63')](_0x5b41('0x69'),_0x3dce65);logger[_0x5b41('0x63')](_0x5b41('0x6a'),_0x48dcd4);try{fs[_0x5b41('0x6b')](_0x3dce65,parseInt(_0x5b41('0x6c'),0x8));extract(_0x3dce65,{'dir':_0x48dcd4},function(_0x54192a){if(_0x54192a){logger['error'](_0x54192a);handleError(_0x54192a,!![]);};var _0x46bbcc=fs['readdirSync'](_0x48dcd4);if(_0x46bbcc[_0x5b41('0x3d')]>0x1){removeReferences(_0x3dce65,_0x48dcd4);logger[_0x5b41('0x55')](_0x5b41('0x6d'));return _0x431f93(new Error(_0x5b41('0x6d')));}var _0x1bad85=fs['lstatSync'](path[_0x5b41('0x4e')](_0x48dcd4,_0x46bbcc[0x0]));if(_0x1bad85[_0x5b41('0x6e')]()){removeReferences(_0x3dce65,_0x48dcd4);logger[_0x5b41('0x55')](_0x5b41('0x6d'));return _0x431f93(new Error(_0x5b41('0x6d')));}if(_0x1bad85['isDirectory']()){var _0x15ac58=fs[_0x5b41('0x6f')](path[_0x5b41('0x4e')](_0x48dcd4,_0x46bbcc[0x0]));if(_0x15ac58[_0x5b41('0x3d')]===0x0){removeReferences(_0x3dce65,_0x48dcd4);logger[_0x5b41('0x55')](_0x5b41('0x6d'));return _0x431f93(new Error('Invalid\x20plugin\x20structure'));}var _0x5c1e05=_0x15ac58[_0x5b41('0x70')](function(_0x4f3cb1){return _0x4f3cb1==='manifest.json';});if(!_0x5c1e05){return _0x431f93(new Error(_0x5b41('0x71')));}var _0x729dab=fs[_0x5b41('0x72')](path[_0x5b41('0x4e')](_0x48dcd4,_0x46bbcc[0x0],_0x5b41('0x73')));var _0x91df80=JSON[_0x5b41('0x74')](_0x729dab);if(_0x5b41('0x22')==typeof _0x91df80[_0x5b41('0x2e')]){return _0x431f93(new Error(_0x5b41('0x75')));}if(_0x5b41('0x22')==typeof _0x91df80['type']){return _0x431f93(new Error(_0x5b41('0x76')));}if(_0x5b41('0x22')==typeof _0x91df80['version']){return _0x431f93(new Error(_0x5b41('0x77')));}if(_0x5b41('0x22')==typeof _0x91df80[_0x5b41('0x78')]){return _0x431f93(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x91df80[_0x5b41('0x35')]===_0x5b41('0x79')){if(_0x5b41('0x22')==typeof _0x91df80['parameters'][_0x5b41('0x7a')]){return _0x431f93(new Error(_0x5b41('0x7b')));}if(_0x5b41('0x22')==typeof _0x91df80[_0x5b41('0x78')]['views'][_0x5b41('0x7c')]&&_0x5b41('0x22')==typeof _0x91df80['parameters'][_0x5b41('0x7a')][_0x5b41('0x7d')]){return _0x431f93(new Error(_0x5b41('0x7e')));}}else if(_0x91df80[_0x5b41('0x35')]===_0x5b41('0x7f')){if(_0x5b41('0x22')==typeof _0x91df80[_0x5b41('0x78')][_0x5b41('0x80')]){return _0x431f93(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x5b41('0x22')==typeof _0x91df80[_0x5b41('0x78')]['scriptPath']){return _0x431f93(new Error(_0x5b41('0x81')));}}else{return _0x431f93(new Error(_0x5b41('0x82')));}var _0x11beb2=_0x91df80[_0x5b41('0x2e')];var _0x175672=_0x91df80['description'];var _0x37b99e=_0x91df80[_0x5b41('0x35')];var _0x4c15bb=_0x91df80[_0x5b41('0x83')]?_0x91df80['sidebar']:_0x5b41('0x84');var _0x5ecd45=_0x91df80[_0x5b41('0x85')]?_0x91df80[_0x5b41('0x85')]:_0x5b41('0x86');var _0xe1b7ff='';var _0x422516='';var _0x42168a='';var _0x190114='';var _0x199e3a=_0x91df80['version'];if(_0x37b99e===_0x5b41('0x79')){if(_0x5b41('0x22')!=typeof _0x91df80['parameters'][_0x5b41('0x7a')][_0x5b41('0x7c')]){var _0x37a2ec=_0x91df80[_0x5b41('0x78')][_0x5b41('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5b41('0x87')](_0x37a2ec)){_0xe1b7ff=path[_0x5b41('0x4e')](_0x5b41('0x88'),_0x4147c8,_0x46bbcc[0x0],_0x37a2ec);}else{_0xe1b7ff=_0x37a2ec;}}else{logger[_0x5b41('0x63')](_0x5b41('0x89'));}if('undefined'!=typeof _0x91df80[_0x5b41('0x78')][_0x5b41('0x7a')][_0x5b41('0x7d')]){var _0x41b8fc=_0x91df80[_0x5b41('0x78')][_0x5b41('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x41b8fc)){_0x422516=path[_0x5b41('0x4e')](_0x5b41('0x88'),_0x4147c8,_0x46bbcc[0x0],_0x41b8fc);}else{_0x422516=_0x41b8fc;}}else{logger[_0x5b41('0x63')](_0x5b41('0x8a'));}}else if(_0x37b99e===_0x5b41('0x7f')){_0x42168a=_0x91df80['parameters'][_0x5b41('0x80')];_0x190114=_0x91df80['parameters'][_0x5b41('0x8b')];if('undefined'!=typeof _0x91df80['parameters']['views']){if(_0x5b41('0x22')!=typeof _0x91df80[_0x5b41('0x78')]['views'][_0x5b41('0x7c')]){var _0x37a2ec=_0x91df80[_0x5b41('0x78')][_0x5b41('0x7a')][_0x5b41('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x5b41('0x87')](_0x37a2ec)){_0xe1b7ff=path['join'](_0x5b41('0x88'),_0x4147c8,_0x46bbcc[0x0],_0x37a2ec);}else{_0xe1b7ff=_0x37a2ec;}}if('undefined'!=typeof _0x91df80['parameters']['views'][_0x5b41('0x7d')]){var _0x41b8fc=_0x91df80[_0x5b41('0x78')][_0x5b41('0x7a')][_0x5b41('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x5b41('0x87')](_0x41b8fc)){_0x422516=path[_0x5b41('0x4e')](_0x5b41('0x88'),_0x4147c8,_0x46bbcc[0x0],_0x41b8fc);}else{_0x422516=_0x41b8fc;}}}}var _0x526138={'name':_0x11beb2,'description':_0x175672,'path':path[_0x5b41('0x4e')](_0x4147c8,_0x46bbcc[0x0]),'type':_0x37b99e,'sidebar':_0x4c15bb,'icon':_0x5ecd45,'adminUrl':_0xe1b7ff,'agentUrl':_0x422516,'scriptName':_0x42168a,'scriptPath':_0x190114,'version':_0x199e3a};removeReferences(_0x3dce65,null);return db['Plugin'][_0x5b41('0x8c')](_0x526138)[_0x5b41('0x28')](function(_0x274880){var _0x357a42={'role':_0x2df493[_0x5b41('0x8d')][_0x5b41('0x8e')],'userProfileId':_0x2df493[_0x5b41('0x8d')]['userProfileId']};if(!_0x357a42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x357a42['role']===_0x5b41('0x8f')){var _0x2d7a35=_0x274880['get']({'plain':!![]});return db[_0x5b41('0x90')][_0x5b41('0x91')]({'where':{'name':'Plugins','userProfileId':_0x357a42[_0x5b41('0x92')]},'raw':!![]})[_0x5b41('0x28')](function(_0x296ca3){if(_0x296ca3&&_0x296ca3[_0x5b41('0x93')]===0x0){return db[_0x5b41('0x2b')][_0x5b41('0x8c')]({'name':_0x2d7a35[_0x5b41('0x2e')],'resourceId':_0x2d7a35['id'],'type':_0x296ca3['name'],'sectionId':_0x296ca3['id']},{})[_0x5b41('0x28')](function(){return _0x274880;});}else{return _0x274880;}})[_0x5b41('0x4a')](function(_0x1e96bc){logger[_0x5b41('0x55')](_0x5b41('0x94'),_0x1e96bc);throw _0x1e96bc;});}return _0x274880;})['then'](respondWithResult(_0x2b6131,null))[_0x5b41('0x4a')](handleError(_0x2b6131,null));}});}catch(_0x34a9c6){_0x2b6131[_0x5b41('0x1f')](0x1f4)['send'](_0x34a9c6);}};function removeReferences(_0x2f51f9,_0x54a44f){try{if(_0x2f51f9){fs['unlinkSync'](_0x2f51f9);logger['info'](_0x5b41('0x95'));}if(_0x54a44f){rimraf(_0x54a44f,function(){});logger[_0x5b41('0x63')](_0x5b41('0x96'));}}catch(_0xb5110a){logger[_0x5b41('0x55')](_0xb5110a);}}exports[_0x5b41('0x97')]=function(_0x51c8b2,_0x5553f8,_0x33ef3f){return db[_0x5b41('0x32')]['find']({'where':{'id':_0x51c8b2['params']['id']}})[_0x5b41('0x28')](handleEntityNotFound(_0x5553f8,null))[_0x5b41('0x28')](saveUpdates(_0x51c8b2[_0x5b41('0x8d')],null))[_0x5b41('0x28')](respondWithResult(_0x5553f8,null))[_0x5b41('0x4a')](handleError(_0x5553f8,null));};exports['delete']=function(_0x1105b4,_0x3525b1,_0x225c63){return db[_0x5b41('0x32')][_0x5b41('0x91')]({'where':{'id':_0x1105b4[_0x5b41('0x4d')]['id']}})['then'](function(_0x4042b0){if(_0x4042b0){return _0x4042b0[_0x5b41('0x2c')]();}})[_0x5b41('0x28')](function(_0x4ef753){rimraf(path['join'](config['root'],_0x5b41('0x50'),path[_0x5b41('0x5a')](_0x4ef753['path'])),function(){});return _0x4ef753;})[_0x5b41('0x28')](handleEntityNotFound(_0x3525b1,null))[_0x5b41('0x28')](respondWithStatusCode(_0x3525b1,null))[_0x5b41('0x4a')](handleError(_0x3525b1,null));};exports[_0x5b41('0x98')]=function(_0x42c1ea,_0x4594e8,_0x561c0d){return BPromise[_0x5b41('0x99')]()[_0x5b41('0x28')](function(){if(!_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x6')]){throw new Error(_0x5b41('0x9a'));}if(!_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x27a70d=_0x42c1ea['query']['hostname']?_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x9c')]+':'+_0x42c1ea[_0x5b41('0x37')]['port']:_0x5b41('0x9d')+_0x42c1ea['query']['port'];var _0x2cd69d=_0x42c1ea['query'][_0x5b41('0x20')]?_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x20')]:!![];var _0x1edb44=_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x9e')]?_0x42c1ea['query'][_0x5b41('0x9e')]:null;var _0x5ebe00={'method':_0x42c1ea[_0x5b41('0x9f')],'uri':util['format'](_0x5b41('0xa0'),_0x27a70d,_0x42c1ea['query']['path']),'json':_0x2cd69d,'resolveWithFullResponse':!![],'encoding':_0x1edb44,'qs':_0x42c1ea[_0x5b41('0x37')]};if(_0x42c1ea['headers']){_0x5ebe00[_0x5b41('0xa1')]=_0x42c1ea['headers'];if(_0x5ebe00[_0x5b41('0xa1')][_0x5b41('0xa2')]){delete _0x5ebe00[_0x5b41('0xa1')]['content-length'];}}if(_0x5ebe00[_0x5b41('0xa1')][_0x5b41('0xa3')]){delete _0x5ebe00['headers']['content-type'];}return rp(_0x5ebe00);})['then'](function(_0x3d5240){if(_0x3d5240){_0x4594e8[_0x5b41('0x25')](_0x3d5240[_0x5b41('0xa1')]);logger[_0x5b41('0x63')](_0x3d5240[_0x5b41('0x8d')]);if(_[_0x5b41('0xa4')](_0x42c1ea[_0x5b41('0x37')][_0x5b41('0x6')],_0x5b41('0xa5'))&&_0x3d5240[_0x5b41('0xa6')]==0x1f4){return _0x4594e8['sendStatus'](_0x3d5240[_0x5b41('0xa6')]);}else{return _0x4594e8['status'](_0x3d5240[_0x5b41('0xa6')])[_0x5b41('0x2f')](_0x3d5240[_0x5b41('0x8d')]);}}else{return _0x4594e8['sendStatus'](0xc8);}})[_0x5b41('0x4a')](handleError(_0x4594e8,null));};exports[_0x5b41('0xa7')]=function(_0x1c31e6,_0x186fa4,_0x6a913e){return BPromise['resolve']()['then'](function(){if(!_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x9b')]){throw new Error(_0x5b41('0xa8'));}var _0x553c4b=_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x9c')]?_0x1c31e6['query'][_0x5b41('0x9c')]+':'+_0x1c31e6[_0x5b41('0x37')]['port']:_0x5b41('0x9d')+_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x9b')];var _0x47eac8=_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x20')]?_0x1c31e6['query'][_0x5b41('0x20')]:!![];var _0x2d42b1=_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x9e')]?_0x1c31e6[_0x5b41('0x37')]['encoding']:null;var _0x349ea5={'method':_0x1c31e6[_0x5b41('0x9f')],'uri':util[_0x5b41('0x51')]('%s%s',_0x553c4b,_0x1c31e6[_0x5b41('0x37')][_0x5b41('0x6')]),'json':_0x47eac8,'resolveWithFullResponse':!![],'encoding':_0x2d42b1,'body':_0x1c31e6[_0x5b41('0x8d')]};if(_0x1c31e6['headers']){_0x349ea5[_0x5b41('0xa1')]=_0x1c31e6[_0x5b41('0xa1')];if(_0x349ea5['headers']['content-length']){delete _0x349ea5[_0x5b41('0xa1')][_0x5b41('0xa2')];}}if(_0x349ea5['headers'][_0x5b41('0xa3')]){delete _0x349ea5['headers'][_0x5b41('0xa3')];}return rp(_0x349ea5);})[_0x5b41('0x28')](function(_0x21e803){if(_0x21e803){_0x186fa4['set'](_0x21e803[_0x5b41('0xa1')]);logger[_0x5b41('0x63')](_0x21e803[_0x5b41('0x8d')]);return _0x186fa4['status'](_0x21e803[_0x5b41('0xa6')])[_0x5b41('0x2f')](_0x21e803['body']);}else{return _0x186fa4[_0x5b41('0x1d')](0xc8);}})[_0x5b41('0x4a')](handleError(_0x186fa4,null));}; \ No newline at end of file +var _0x1a87=['readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptPath','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','extract-zip','rimraf','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','get','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','fieldName','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','findAll','params','rawAttributes','includeAll','include','options','catch','join','server/files/plugins','format','%s.zip','createWriteStream','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','root','dirname','node_modules/**/*','finalize','Plugin\x20not\x20found','download','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x1a87,0x18a));var _0x71a8=function(_0x5b0164,_0x5a413b){_0x5b0164=_0x5b0164-0x0;var _0x375c69=_0x1a87[_0x5b0164];return _0x375c69;};'use strict';var emlformat=require(_0x71a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x71a8('0x1'));var jsonpatch=require(_0x71a8('0x2'));var rp=require(_0x71a8('0x3'));var moment=require('moment');var BPromise=require(_0x71a8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x71a8('0x5'));var sox=require(_0x71a8('0x6'));var csv=require(_0x71a8('0x7'));var ejs=require(_0x71a8('0x8'));var fs=require('fs');var fs_extra=require(_0x71a8('0x9'));var _=require(_0x71a8('0xa'));var squel=require(_0x71a8('0xb'));var crypto=require(_0x71a8('0xc'));var jsforce=require(_0x71a8('0xd'));var deskjs=require(_0x71a8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x71a8('0xf'));var rimraf=require(_0x71a8('0x10'));var archiver=require('archiver');var Redis=require(_0x71a8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x71a8('0x12'));var as=require(_0x71a8('0x13'));var hardwareService=require(_0x71a8('0x14'));var logger=require('../../config/logger')(_0x71a8('0x15'));var utils=require(_0x71a8('0x16'));var config=require(_0x71a8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x71a8('0x18')]=_['defaults'](config[_0x71a8('0x18')],{'host':_0x71a8('0x19'),'port':0x18eb});var socket=require(_0x71a8('0x1a'))(new Redis(config[_0x71a8('0x18')]));require(_0x71a8('0x1b'))[_0x71a8('0x1c')](socket);function respondWithStatusCode(_0x218408,_0x1ca3b7){_0x1ca3b7=_0x1ca3b7||0xcc;return function(_0x1e2b38){if(_0x1e2b38){return _0x218408[_0x71a8('0x1d')](_0x1ca3b7);}return _0x218408['status'](_0x1ca3b7)[_0x71a8('0x1e')]();};}function respondWithResult(_0x4d0204,_0x187055){_0x187055=_0x187055||0xc8;return function(_0x4771c7){if(_0x4771c7){return _0x4d0204['status'](_0x187055)['json'](_0x4771c7);}};}function respondWithFilteredResult(_0x41ac50,_0x3f0a51){return function(_0x32921a){if(_0x32921a){var _0x1849b0=typeof _0x3f0a51[_0x71a8('0x1f')]===_0x71a8('0x20')&&typeof _0x3f0a51[_0x71a8('0x21')]==='undefined';var _0x503fba=_0x32921a[_0x71a8('0x22')];var _0x5a0c9d=_0x1849b0?0x0:_0x3f0a51[_0x71a8('0x1f')];var _0x3058c7=_0x1849b0?_0x32921a[_0x71a8('0x22')]:_0x3f0a51[_0x71a8('0x1f')]+_0x3f0a51['limit'];var _0x464c34;if(_0x3058c7>=_0x503fba){_0x3058c7=_0x503fba;_0x464c34=0xc8;}else{_0x464c34=0xce;}_0x41ac50[_0x71a8('0x23')](_0x464c34);return _0x41ac50['set'](_0x71a8('0x24'),_0x5a0c9d+'-'+_0x3058c7+'/'+_0x503fba)['json'](_0x32921a);}return null;};}function patchUpdates(_0x4f05d0){return function(_0x582252){try{jsonpatch[_0x71a8('0x25')](_0x582252,_0x4f05d0,!![]);}catch(_0x25792a){return BPromise[_0x71a8('0x26')](_0x25792a);}return _0x582252['save']();};}function saveUpdates(_0x19ea68,_0x176899){return function(_0x479bff){if(_0x479bff){return _0x479bff[_0x71a8('0x27')](_0x19ea68)[_0x71a8('0x28')](function(_0xdea843){return _0xdea843;});}return null;};}function removeEntity(_0x586c86,_0x52469b){return function(_0x2634e8){if(_0x2634e8){return _0x2634e8['destroy']()[_0x71a8('0x28')](function(){var _0x129df9=_0x2634e8[_0x71a8('0x29')]({'plain':!![]});var _0xac5efa=_0x71a8('0x2a');return db[_0x71a8('0x2b')]['destroy']({'where':{'type':_0xac5efa,'resourceId':_0x129df9['id']}})[_0x71a8('0x28')](function(){return _0x2634e8;});})['then'](function(){_0x586c86['status'](0xcc)[_0x71a8('0x1e')]();});}};}function handleEntityNotFound(_0x5a0f03,_0x535987){return function(_0x32e5a5){if(!_0x32e5a5){_0x5a0f03[_0x71a8('0x1d')](0x194);}return _0x32e5a5;};}function handleError(_0xc10a68,_0x2514d4){_0x2514d4=_0x2514d4||0x1f4;return function(_0x4b6488){logger[_0x71a8('0x2c')](_0x4b6488[_0x71a8('0x2d')]);if(_0x4b6488[_0x71a8('0x2e')]){delete _0x4b6488[_0x71a8('0x2e')];}_0xc10a68['status'](_0x2514d4)['send'](_0x4b6488);};}exports[_0x71a8('0x2f')]=function(_0x23b47a,_0x12f3a6){var _0x23bc33={},_0x1a71cf={},_0x3a441a={'count':0x0,'rows':[]};var _0x2c65c2=_[_0x71a8('0x30')](db[_0x71a8('0x31')]['rawAttributes'],function(_0x46e93b){return{'name':_0x46e93b[_0x71a8('0x32')],'type':_0x46e93b['type']['key']};});_0x1a71cf[_0x71a8('0x33')]=_['map'](_0x2c65c2,_0x71a8('0x2e'));_0x1a71cf[_0x71a8('0x34')]=_[_0x71a8('0x35')](_0x23b47a[_0x71a8('0x34')]);_0x1a71cf[_0x71a8('0x36')]=_['intersection'](_0x1a71cf[_0x71a8('0x33')],_0x1a71cf[_0x71a8('0x34')]);_0x23bc33[_0x71a8('0x37')]=_[_0x71a8('0x38')](_0x1a71cf[_0x71a8('0x33')],qs['fields'](_0x23b47a[_0x71a8('0x34')][_0x71a8('0x39')]));_0x23bc33[_0x71a8('0x37')]=_0x23bc33[_0x71a8('0x37')][_0x71a8('0x3a')]?_0x23bc33['attributes']:_0x1a71cf[_0x71a8('0x33')];if(!_0x23b47a[_0x71a8('0x34')]['hasOwnProperty']('nolimit')){_0x23bc33[_0x71a8('0x21')]=qs['limit'](_0x23b47a[_0x71a8('0x34')][_0x71a8('0x21')]);_0x23bc33[_0x71a8('0x1f')]=qs[_0x71a8('0x1f')](_0x23b47a['query']['offset']);}_0x23bc33[_0x71a8('0x3b')]=qs[_0x71a8('0x3c')](_0x23b47a['query'][_0x71a8('0x3c')]);_0x23bc33['where']=qs['filters'](_[_0x71a8('0x3d')](_0x23b47a[_0x71a8('0x34')],_0x1a71cf[_0x71a8('0x36')]),_0x2c65c2);if(_0x23b47a[_0x71a8('0x34')][_0x71a8('0x3e')]){_0x23bc33[_0x71a8('0x3f')]=_[_0x71a8('0x40')](_0x23bc33['where'],{'$or':_[_0x71a8('0x30')](_0x2c65c2,function(_0x2cf80f){if(_0x2cf80f[_0x71a8('0x41')]!==_0x71a8('0x42')){var _0x314970={};_0x314970[_0x2cf80f[_0x71a8('0x2e')]]={'$like':'%'+_0x23b47a[_0x71a8('0x34')]['filter']+'%'};return _0x314970;}})});}_0x23bc33=_[_0x71a8('0x40')]({},_0x23bc33,_0x23b47a['options']);var _0x4588b0={'where':_0x23bc33['where']};return db['Plugin'][_0x71a8('0x22')](_0x4588b0)[_0x71a8('0x28')](function(_0x332a77){_0x3a441a[_0x71a8('0x22')]=_0x332a77;if(_0x23b47a[_0x71a8('0x34')]['includeAll']){_0x23bc33['include']=[{'all':!![]}];}return db[_0x71a8('0x31')][_0x71a8('0x43')](_0x23bc33);})[_0x71a8('0x28')](function(_0x342bc3){_0x3a441a['rows']=_0x342bc3;return _0x3a441a;})[_0x71a8('0x28')](respondWithFilteredResult(_0x12f3a6,_0x23bc33))['catch'](handleError(_0x12f3a6,null));};exports['show']=function(_0x39b981,_0x2404b9){var _0x2c507f={'raw':!![],'where':{'id':_0x39b981[_0x71a8('0x44')]['id']}},_0x1f1c8e={};_0x1f1c8e[_0x71a8('0x33')]=_[_0x71a8('0x35')](db[_0x71a8('0x31')][_0x71a8('0x45')]);_0x1f1c8e[_0x71a8('0x34')]=_['keys'](_0x39b981[_0x71a8('0x34')]);_0x1f1c8e[_0x71a8('0x36')]=_[_0x71a8('0x38')](_0x1f1c8e[_0x71a8('0x33')],_0x1f1c8e[_0x71a8('0x34')]);_0x2c507f['attributes']=_[_0x71a8('0x38')](_0x1f1c8e['model'],qs[_0x71a8('0x39')](_0x39b981[_0x71a8('0x34')][_0x71a8('0x39')]));_0x2c507f[_0x71a8('0x37')]=_0x2c507f[_0x71a8('0x37')][_0x71a8('0x3a')]?_0x2c507f[_0x71a8('0x37')]:_0x1f1c8e['model'];if(_0x39b981[_0x71a8('0x34')][_0x71a8('0x46')]){_0x2c507f[_0x71a8('0x47')]=[{'all':!![]}];}_0x2c507f=_['merge']({},_0x2c507f,_0x39b981[_0x71a8('0x48')]);return db[_0x71a8('0x31')]['find'](_0x2c507f)['then'](handleEntityNotFound(_0x2404b9,null))[_0x71a8('0x28')](respondWithResult(_0x2404b9,null))[_0x71a8('0x49')](handleError(_0x2404b9,null));};exports['download']=function(_0xd185cd,_0x589a39,_0x5bab4d){return db[_0x71a8('0x31')]['find']({'where':{'id':_0xd185cd[_0x71a8('0x44')]['id']},'attributes':['name',_0x71a8('0x5')],'raw':!![]})[_0x71a8('0x28')](handleEntityNotFound(_0x589a39,null))['then'](function(_0x4dc081){if(_0x4dc081){var _0x50fb9e=path[_0x71a8('0x4a')](config['root'],_0x71a8('0x4b'),util[_0x71a8('0x4c')](_0x71a8('0x4d'),path['basename'](_0x4dc081[_0x71a8('0x5')])));var _0xd130dc=fs[_0x71a8('0x4e')](_0x50fb9e);var _0x579e95=archiver('zip',{'zlib':{'level':0x9}});_0x579e95['on'](_0x71a8('0x4f'),function(_0x2b26f8){if(_0x2b26f8[_0x71a8('0x50')]===_0x71a8('0x51')){logger[_0x71a8('0x2c')](_0x2b26f8);}else{throw new db[(_0x71a8('0x52'))]['Error'](_0x71a8('0x53'));}});_0x579e95['on'](_0x71a8('0x2c'),function(_0x336a00){throw new db[(_0x71a8('0x52'))][(_0x71a8('0x54'))](_0x71a8('0x53'));});_0x579e95[_0x71a8('0x55')](_0xd130dc);_0x579e95[_0x71a8('0x56')](_0x71a8('0x57'),{'cwd':path[_0x71a8('0x4a')](config[_0x71a8('0x58')],_0x71a8('0x4b'),path[_0x71a8('0x59')](_0x4dc081[_0x71a8('0x5')])),'ignore':[path[_0x71a8('0x4a')](path['basename'](_0x4dc081[_0x71a8('0x5')]),_0x71a8('0x5a')),path[_0x71a8('0x4a')](path['basename'](_0x4dc081[_0x71a8('0x5')]),'attachments/**/*')],'nodir':!![]})[_0x71a8('0x5b')]();_0xd130dc['on']('close',function(){if(!fs['existsSync'](_0x50fb9e)){throw new db[(_0x71a8('0x52'))][(_0x71a8('0x54'))](_0x71a8('0x5c'));}return _0x589a39[_0x71a8('0x5d')](_0x50fb9e,util[_0x71a8('0x4c')](_0x71a8('0x4d'),path[_0x71a8('0x5e')](_0x4dc081['path'])),function(_0x474a14){if(_0x474a14){throw new db[(_0x71a8('0x52'))]['Error'](_0x71a8('0x5f'));}fs[_0x71a8('0x60')](_0x50fb9e);logger['info'](_0x71a8('0x61'));logger[_0x71a8('0x62')](_0x71a8('0x63'));});});}return null;})[_0x71a8('0x49')](handleError(_0x589a39,null));};exports['upload']=function(_0x1e43eb,_0x45471b,_0x467870){var _0x4691e8=path[_0x71a8('0x5e')](_0x1e43eb[_0x71a8('0x64')]['filename'],path[_0x71a8('0x65')](_0x1e43eb[_0x71a8('0x64')]['filename']));var _0x5de4bd=path[_0x71a8('0x4a')](config['root'],'server/files/plugins',_0x1e43eb[_0x71a8('0x64')][_0x71a8('0x66')]);var _0x106641=path[_0x71a8('0x4a')](config[_0x71a8('0x58')],'server/files/plugins',_0x4691e8);logger[_0x71a8('0x62')](_0x71a8('0x67'),_0x5de4bd);logger['info'](_0x71a8('0x68'),_0x106641);try{fs[_0x71a8('0x69')](_0x5de4bd,parseInt(_0x71a8('0x6a'),0x8));extract(_0x5de4bd,{'dir':_0x106641},function(_0x394f7b){if(_0x394f7b){logger[_0x71a8('0x2c')](_0x394f7b);handleError(_0x394f7b,!![]);};var _0x4f9c6f=fs[_0x71a8('0x6b')](_0x106641);if(_0x4f9c6f[_0x71a8('0x3a')]>0x1){removeReferences(_0x5de4bd,_0x106641);logger[_0x71a8('0x2c')](_0x71a8('0x6c'));return _0x467870(new Error('Invalid\x20plugin\x20structure'));}var _0x2cd77f=fs[_0x71a8('0x6d')](path[_0x71a8('0x4a')](_0x106641,_0x4f9c6f[0x0]));if(_0x2cd77f[_0x71a8('0x6e')]()){removeReferences(_0x5de4bd,_0x106641);logger[_0x71a8('0x2c')]('Invalid\x20plugin\x20structure');return _0x467870(new Error(_0x71a8('0x6c')));}if(_0x2cd77f['isDirectory']()){var _0x1bc2eb=fs['readdirSync'](path['join'](_0x106641,_0x4f9c6f[0x0]));if(_0x1bc2eb[_0x71a8('0x3a')]===0x0){removeReferences(_0x5de4bd,_0x106641);logger[_0x71a8('0x2c')]('Invalid\x20plugin\x20structure');return _0x467870(new Error(_0x71a8('0x6c')));}var _0x43184a=_0x1bc2eb['some'](function(_0x4d848e){return _0x4d848e===_0x71a8('0x6f');});if(!_0x43184a){return _0x467870(new Error(_0x71a8('0x70')));}var _0x34af02=fs[_0x71a8('0x71')](path[_0x71a8('0x4a')](_0x106641,_0x4f9c6f[0x0],_0x71a8('0x6f')));var _0x5601df=JSON[_0x71a8('0x72')](_0x34af02);if(_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x2e')]){return _0x467870(new Error(_0x71a8('0x73')));}if(_0x71a8('0x20')==typeof _0x5601df['type']){return _0x467870(new Error(_0x71a8('0x74')));}if(_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x75')]){return _0x467870(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x76')]){return _0x467870(new Error(_0x71a8('0x77')));}if(_0x5601df[_0x71a8('0x41')]===_0x71a8('0x78')){if(_0x71a8('0x20')==typeof _0x5601df['parameters'][_0x71a8('0x79')]){return _0x467870(new Error(_0x71a8('0x7a')));}if(_0x71a8('0x20')==typeof _0x5601df['parameters'][_0x71a8('0x79')][_0x71a8('0x7b')]&&_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x79')][_0x71a8('0x7c')]){return _0x467870(new Error(_0x71a8('0x7d')));}}else if(_0x5601df[_0x71a8('0x41')]===_0x71a8('0x7e')){if(_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x7f')]){return _0x467870(new Error(_0x71a8('0x80')));}if(_0x71a8('0x20')==typeof _0x5601df[_0x71a8('0x76')]['scriptPath']){return _0x467870(new Error(_0x71a8('0x81')));}}else{return _0x467870(new Error(_0x71a8('0x82')));}var _0x13f087=_0x5601df[_0x71a8('0x2e')];var _0x22d9f1=_0x5601df['description'];var _0x39bcd4=_0x5601df[_0x71a8('0x41')];var _0x21247a=_0x5601df[_0x71a8('0x83')]?_0x5601df[_0x71a8('0x83')]:_0x71a8('0x84');var _0x370523=_0x5601df[_0x71a8('0x85')]?_0x5601df[_0x71a8('0x85')]:'icon-apps';var _0x271994='';var _0x1ed47e='';var _0x32e2a3='';var _0x2ff0e0='';var _0x543a63=_0x5601df['version'];if(_0x39bcd4==='html'){if(_0x71a8('0x20')!=typeof _0x5601df[_0x71a8('0x76')]['views'][_0x71a8('0x7b')]){var _0x3fd6da=_0x5601df[_0x71a8('0x76')][_0x71a8('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x71a8('0x86')](_0x3fd6da)){_0x271994=path[_0x71a8('0x4a')](_0x71a8('0x87'),_0x4691e8,_0x4f9c6f[0x0],_0x3fd6da);}else{_0x271994=_0x3fd6da;}}else{logger[_0x71a8('0x62')](_0x71a8('0x88'));}if('undefined'!=typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x79')]['agent']){var _0x283818=_0x5601df[_0x71a8('0x76')][_0x71a8('0x79')][_0x71a8('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x71a8('0x86')](_0x283818)){_0x1ed47e=path['join'](_0x71a8('0x87'),_0x4691e8,_0x4f9c6f[0x0],_0x283818);}else{_0x1ed47e=_0x283818;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x39bcd4===_0x71a8('0x7e')){_0x32e2a3=_0x5601df[_0x71a8('0x76')][_0x71a8('0x7f')];_0x2ff0e0=_0x5601df['parameters'][_0x71a8('0x89')];if(_0x71a8('0x20')!=typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x79')]){if(_0x71a8('0x20')!=typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x79')]['admin']){var _0x3fd6da=_0x5601df['parameters'][_0x71a8('0x79')][_0x71a8('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3fd6da)){_0x271994=path[_0x71a8('0x4a')](_0x71a8('0x87'),_0x4691e8,_0x4f9c6f[0x0],_0x3fd6da);}else{_0x271994=_0x3fd6da;}}if(_0x71a8('0x20')!=typeof _0x5601df[_0x71a8('0x76')][_0x71a8('0x79')][_0x71a8('0x7c')]){var _0x283818=_0x5601df['parameters']['views'][_0x71a8('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x71a8('0x86')](_0x283818)){_0x1ed47e=path[_0x71a8('0x4a')](_0x71a8('0x87'),_0x4691e8,_0x4f9c6f[0x0],_0x283818);}else{_0x1ed47e=_0x283818;}}}}var _0x24b86b={'name':_0x13f087,'description':_0x22d9f1,'path':path['join'](_0x4691e8,_0x4f9c6f[0x0]),'type':_0x39bcd4,'sidebar':_0x21247a,'icon':_0x370523,'adminUrl':_0x271994,'agentUrl':_0x1ed47e,'scriptName':_0x32e2a3,'scriptPath':_0x2ff0e0,'version':_0x543a63};removeReferences(_0x5de4bd,null);return db[_0x71a8('0x31')]['create'](_0x24b86b)[_0x71a8('0x28')](function(_0x162273){var _0x2c7404={'role':_0x1e43eb[_0x71a8('0x8a')][_0x71a8('0x8b')],'userProfileId':_0x1e43eb[_0x71a8('0x8a')][_0x71a8('0x8c')]};if(!_0x2c7404)throw new Error(_0x71a8('0x8d'));if(_0x2c7404[_0x71a8('0x8b')]===_0x71a8('0x8e')){var _0x257229=_0x162273[_0x71a8('0x29')]({'plain':!![]});return db[_0x71a8('0x8f')][_0x71a8('0x90')]({'where':{'name':_0x71a8('0x2a'),'userProfileId':_0x2c7404[_0x71a8('0x8c')]},'raw':!![]})[_0x71a8('0x28')](function(_0x27e0ac){if(_0x27e0ac&&_0x27e0ac[_0x71a8('0x91')]===0x0){return db[_0x71a8('0x2b')][_0x71a8('0x92')]({'name':_0x257229[_0x71a8('0x2e')],'resourceId':_0x257229['id'],'type':_0x27e0ac[_0x71a8('0x2e')],'sectionId':_0x27e0ac['id']},{})[_0x71a8('0x28')](function(){return _0x162273;});}else{return _0x162273;}})[_0x71a8('0x49')](function(_0x11cf14){logger[_0x71a8('0x2c')](_0x71a8('0x93'),_0x11cf14);throw _0x11cf14;});}return _0x162273;})[_0x71a8('0x28')](respondWithResult(_0x45471b,null))['catch'](handleError(_0x45471b,null));}});}catch(_0x3377e8){_0x45471b[_0x71a8('0x23')](0x1f4)[_0x71a8('0x94')](_0x3377e8);}};function removeReferences(_0x2981a1,_0x37b671){try{if(_0x2981a1){fs[_0x71a8('0x60')](_0x2981a1);logger[_0x71a8('0x62')](_0x71a8('0x95'));}if(_0x37b671){rimraf(_0x37b671,function(){});logger[_0x71a8('0x62')](_0x71a8('0x96'));}}catch(_0x4b428e){logger[_0x71a8('0x2c')](_0x4b428e);}}exports['update']=function(_0x294ba3,_0x2775e7,_0x4964ee){return db[_0x71a8('0x31')][_0x71a8('0x90')]({'where':{'id':_0x294ba3['params']['id']}})[_0x71a8('0x28')](handleEntityNotFound(_0x2775e7,null))[_0x71a8('0x28')](saveUpdates(_0x294ba3[_0x71a8('0x8a')],null))['then'](respondWithResult(_0x2775e7,null))[_0x71a8('0x49')](handleError(_0x2775e7,null));};exports[_0x71a8('0x97')]=function(_0x46b46b,_0x378fbc,_0x2df79f){return db[_0x71a8('0x31')][_0x71a8('0x90')]({'where':{'id':_0x46b46b[_0x71a8('0x44')]['id']}})['then'](function(_0x2e88d8){if(_0x2e88d8){return _0x2e88d8[_0x71a8('0x98')]();}})[_0x71a8('0x28')](function(_0xc849fd){rimraf(path['join'](config[_0x71a8('0x58')],_0x71a8('0x4b'),path[_0x71a8('0x59')](_0xc849fd[_0x71a8('0x5')])),function(){});return _0xc849fd;})[_0x71a8('0x28')](handleEntityNotFound(_0x378fbc,null))[_0x71a8('0x28')](respondWithStatusCode(_0x378fbc,null))[_0x71a8('0x49')](handleError(_0x378fbc,null));};exports['webhookGet']=function(_0x25ab7e,_0xd2524e,_0x2c6ab4){return BPromise[_0x71a8('0x99')]()[_0x71a8('0x28')](function(){if(!_0x25ab7e[_0x71a8('0x34')][_0x71a8('0x5')]){throw new Error(_0x71a8('0x9a'));}if(!_0x25ab7e['query']['port']){throw new Error(_0x71a8('0x9b'));}var _0x332247=_0x25ab7e['query'][_0x71a8('0x9c')]?_0x25ab7e[_0x71a8('0x34')][_0x71a8('0x9c')]+':'+_0x25ab7e['query'][_0x71a8('0x9d')]:_0x71a8('0x9e')+_0x25ab7e[_0x71a8('0x34')][_0x71a8('0x9d')];var _0x53d3c7=_0x25ab7e[_0x71a8('0x34')]['json']?_0x25ab7e[_0x71a8('0x34')][_0x71a8('0x9f')]:!![];var _0x38fa28=_0x25ab7e['query']['encoding']?_0x25ab7e[_0x71a8('0x34')][_0x71a8('0xa0')]:null;var _0x56967a={'method':_0x25ab7e[_0x71a8('0xa1')],'uri':util[_0x71a8('0x4c')](_0x71a8('0xa2'),_0x332247,_0x25ab7e['query'][_0x71a8('0x5')]),'json':_0x53d3c7,'resolveWithFullResponse':!![],'encoding':_0x38fa28,'qs':_0x25ab7e[_0x71a8('0x34')]};if(_0x25ab7e[_0x71a8('0xa3')]){_0x56967a[_0x71a8('0xa3')]=_0x25ab7e[_0x71a8('0xa3')];if(_0x56967a[_0x71a8('0xa3')][_0x71a8('0xa4')]){delete _0x56967a[_0x71a8('0xa3')][_0x71a8('0xa4')];}}if(_0x56967a[_0x71a8('0xa3')][_0x71a8('0xa5')]){delete _0x56967a[_0x71a8('0xa3')][_0x71a8('0xa5')];}return rp(_0x56967a);})['then'](function(_0x1f94b7){if(_0x1f94b7){_0xd2524e[_0x71a8('0xa6')](_0x1f94b7[_0x71a8('0xa3')]);logger[_0x71a8('0x62')](_0x1f94b7[_0x71a8('0x8a')]);if(_['endsWith'](_0x25ab7e[_0x71a8('0x34')][_0x71a8('0x5')],'download')&&_0x1f94b7[_0x71a8('0xa7')]==0x1f4){return _0xd2524e['sendStatus'](_0x1f94b7['statusCode']);}else{return _0xd2524e[_0x71a8('0x23')](_0x1f94b7[_0x71a8('0xa7')])[_0x71a8('0x94')](_0x1f94b7[_0x71a8('0x8a')]);}}else{return _0xd2524e['sendStatus'](0xc8);}})['catch'](handleError(_0xd2524e,null));};exports[_0x71a8('0xa8')]=function(_0x464038,_0x2fca50,_0x51e6ef){return BPromise[_0x71a8('0x99')]()[_0x71a8('0x28')](function(){if(!_0x464038[_0x71a8('0x34')][_0x71a8('0x5')]){throw new Error(_0x71a8('0x9a'));}if(!_0x464038[_0x71a8('0x34')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x149f2d=_0x464038[_0x71a8('0x34')][_0x71a8('0x9c')]?_0x464038[_0x71a8('0x34')][_0x71a8('0x9c')]+':'+_0x464038['query'][_0x71a8('0x9d')]:_0x71a8('0x9e')+_0x464038['query'][_0x71a8('0x9d')];var _0x5f54fe=_0x464038['query'][_0x71a8('0x9f')]?_0x464038['query'][_0x71a8('0x9f')]:!![];var _0x437ae8=_0x464038[_0x71a8('0x34')][_0x71a8('0xa0')]?_0x464038[_0x71a8('0x34')]['encoding']:null;var _0x23a5ef={'method':_0x464038[_0x71a8('0xa1')],'uri':util[_0x71a8('0x4c')]('%s%s',_0x149f2d,_0x464038[_0x71a8('0x34')][_0x71a8('0x5')]),'json':_0x5f54fe,'resolveWithFullResponse':!![],'encoding':_0x437ae8,'body':_0x464038[_0x71a8('0x8a')]};if(_0x464038[_0x71a8('0xa3')]){_0x23a5ef[_0x71a8('0xa3')]=_0x464038['headers'];if(_0x23a5ef[_0x71a8('0xa3')][_0x71a8('0xa4')]){delete _0x23a5ef[_0x71a8('0xa3')][_0x71a8('0xa4')];}}if(_0x23a5ef[_0x71a8('0xa3')][_0x71a8('0xa5')]){delete _0x23a5ef['headers'][_0x71a8('0xa5')];}return rp(_0x23a5ef);})['then'](function(_0x42336d){if(_0x42336d){_0x2fca50[_0x71a8('0xa6')](_0x42336d[_0x71a8('0xa3')]);logger[_0x71a8('0x62')](_0x42336d['body']);return _0x2fca50['status'](_0x42336d[_0x71a8('0xa7')])[_0x71a8('0x94')](_0x42336d[_0x71a8('0x8a')]);}else{return _0x2fca50[_0x71a8('0x1d')](0xc8);}})['catch'](handleError(_0x2fca50,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 3c415c7..b025b46 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 _0x9300=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x9300,0x153));var _0x0930=function(_0xacabb,_0x1fbcd9){_0xacabb=_0xacabb-0x0;var _0x2b4a14=_0x9300[_0xacabb];return _0x2b4a14;};'use strict';var EventEmitter=require(_0x0930('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x0930('0x1')](0x0);var events={'afterCreate':_0x0930('0x2'),'afterUpdate':_0x0930('0x3'),'afterDestroy':_0x0930('0x4')};function emitEvent(_0x4130f8){return function(_0x49d993,_0x298c01,_0x1a61a6){PluginEvents['emit'](_0x4130f8+':'+_0x49d993['id'],_0x49d993);PluginEvents[_0x0930('0x5')](_0x4130f8,_0x49d993);_0x1a61a6(null);};}for(var e in events){if(events[_0x0930('0x6')](e)){var event=events[e];Plugin[_0x0930('0x7')](e,emitEvent(event));}}module[_0x0930('0x8')]=PluginEvents; \ No newline at end of file +var _0x0650=['events','../../mysqldb','Plugin','setMaxListeners','update','hasOwnProperty'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0650,0x1aa));var _0x0065=function(_0x93d86c,_0x54e7ee){_0x93d86c=_0x93d86c-0x0;var _0x58e497=_0x0650[_0x93d86c];return _0x58e497;};'use strict';var EventEmitter=require(_0x0065('0x0'));var Plugin=require(_0x0065('0x1'))['db'][_0x0065('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x0065('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0065('0x4'),'afterDestroy':'remove'};function emitEvent(_0x49a595){return function(_0x1798d6,_0xe2785,_0x185c29){PluginEvents['emit'](_0x49a595+':'+_0x1798d6['id'],_0x1798d6);PluginEvents['emit'](_0x49a595,_0x1798d6);_0x185c29(null);};}for(var e in events){if(events[_0x0065('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 5cbb6aa..45aa3e2 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 _0xc114=['../../config/logger','api','moment','bluebird','request-promise','Plugin','plugins','util'];(function(_0xefe8df,_0x399303){var _0x55b239=function(_0xd0ba4f){while(--_0xd0ba4f){_0xefe8df['push'](_0xefe8df['shift']());}};_0x55b239(++_0x399303);}(_0xc114,0x1e7));var _0x4c11=function(_0x5be773,_0x1be551){_0x5be773=_0x5be773-0x0;var _0x2fc751=_0xc114[_0x5be773];return _0x2fc751;};'use strict';var _=require('lodash');var util=require(_0x4c11('0x0'));var logger=require(_0x4c11('0x1'))(_0x4c11('0x2'));var moment=require(_0x4c11('0x3'));var BPromise=require(_0x4c11('0x4'));var rp=require(_0x4c11('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x50a3bd,_0x5002a7){return _0x50a3bd['define'](_0x4c11('0x6'),attributes,{'tableName':_0x4c11('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x927c=['util','bluebird','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x249800,_0x3e4ce2){var _0x45b7c1=function(_0x154c2c){while(--_0x154c2c){_0x249800['push'](_0x249800['shift']());}};_0x45b7c1(++_0x3e4ce2);}(_0x927c,0x190));var _0xc927=function(_0x59eae0,_0x54bedb){_0x59eae0=_0x59eae0-0x0;var _0x5aead7=_0x927c[_0x59eae0];return _0x5aead7;};'use strict';var _=require('lodash');var util=require(_0xc927('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc927('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc927('0x2'));var config=require(_0xc927('0x3'));var attributes=require(_0xc927('0x4'));module[_0xc927('0x5')]=function(_0xa9e945,_0x411603){return _0xa9e945[_0xc927('0x6')](_0xc927('0x7'),attributes,{'tableName':'plugins','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 5acb838..6d9849a 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 _0x6f02=['error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0x6f02,0xf0));var _0x26f0=function(_0x5b4506,_0x2ec972){_0x5b4506=_0x5b4506-0x0;var _0x27aad3=_0x6f02[_0x5b4506];return _0x27aad3;};'use strict';var _=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var moment=require('moment');var BPromise=require(_0x26f0('0x2'));var rs=require(_0x26f0('0x3'));var fs=require('fs');var Redis=require(_0x26f0('0x4'));var db=require(_0x26f0('0x5'))['db'];var utils=require(_0x26f0('0x6'));var logger=require(_0x26f0('0x7'))(_0x26f0('0x8'));var config=require(_0x26f0('0x9'));var jayson=require(_0x26f0('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x26f0('0xb')]=_[_0x26f0('0xc')](config[_0x26f0('0xb')],{'host':_0x26f0('0xd'),'port':0x18eb});var socket=require(_0x26f0('0xe'))(new Redis(config['redis']));require(_0x26f0('0xf'))[_0x26f0('0x10')](socket);function respondWithRpcPromise(_0x587fa9,_0x4b2431,_0x457474){return new BPromise(function(_0x3b75f6,_0x256b99){return client[_0x26f0('0x11')](_0x587fa9,_0x457474)[_0x26f0('0x12')](function(_0x31a858){logger[_0x26f0('0x13')]('Plugin,\x20%s,\x20%s',_0x4b2431,_0x26f0('0x14'));logger[_0x26f0('0x15')](_0x26f0('0x16'),_0x4b2431,'request\x20sent',JSON[_0x26f0('0x17')](_0x31a858));if(_0x31a858[_0x26f0('0x18')]){if(_0x31a858[_0x26f0('0x18')][_0x26f0('0x19')]===0x1f4){logger['error'](_0x26f0('0x1a'),_0x4b2431,_0x31a858['error'][_0x26f0('0x1b')]);return _0x256b99(_0x31a858['error'][_0x26f0('0x1b')]);}logger[_0x26f0('0x18')](_0x26f0('0x1a'),_0x4b2431,_0x31a858['error'][_0x26f0('0x1b')]);return _0x3b75f6(_0x31a858['error'][_0x26f0('0x1b')]);}else{logger[_0x26f0('0x13')](_0x26f0('0x1a'),_0x4b2431,_0x26f0('0x14'));_0x3b75f6(_0x31a858[_0x26f0('0x1c')]['message']);}})['catch'](function(_0x3fa81f){logger[_0x26f0('0x18')](_0x26f0('0x1a'),_0x4b2431,_0x3fa81f);_0x256b99(_0x3fa81f);});});}exports[_0x26f0('0x1d')]=function(_0xf84fbe){var _0xe74a37=this;return new Promise(function(_0xb1513c,_0x3ec0f7){return db[_0x26f0('0x1e')]['create'](_0xf84fbe['body'],{'raw':_0xf84fbe['options']?_0xf84fbe[_0x26f0('0x1f')][_0x26f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3910ab){logger[_0x26f0('0x13')](_0x26f0('0x1d'),_0xf84fbe);logger[_0x26f0('0x15')]('CreatePlugin',_0xf84fbe,JSON[_0x26f0('0x17')](_0x3910ab));_0xb1513c(_0x3910ab);})['catch'](function(_0x48441d){logger[_0x26f0('0x18')](_0x26f0('0x1d'),_0x48441d[_0x26f0('0x1b')],_0xf84fbe);_0x3ec0f7(_0xe74a37[_0x26f0('0x18')](0x1f4,_0x48441d[_0x26f0('0x1b')]));});});}; \ No newline at end of file +var _0x2daf=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreatePlugin','Plugin','create','options','raw','catch','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x388d1a,_0x2a8a81){var _0x7d8672=function(_0x251e45){while(--_0x251e45){_0x388d1a['push'](_0x388d1a['shift']());}};_0x7d8672(++_0x2a8a81);}(_0x2daf,0x8c));var _0xf2da=function(_0x407fb2,_0x4b6813){_0x407fb2=_0x407fb2-0x0;var _0xfde875=_0x2daf[_0x407fb2];return _0xfde875;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf2da('0x0'));var BPromise=require('bluebird');var rs=require(_0xf2da('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf2da('0x2'));var logger=require(_0xf2da('0x3'))(_0xf2da('0x4'));var config=require(_0xf2da('0x5'));var jayson=require(_0xf2da('0x6'));var client=jayson[_0xf2da('0x7')][_0xf2da('0x8')]({'port':0x232a});config[_0xf2da('0x9')]=_[_0xf2da('0xa')](config[_0xf2da('0x9')],{'host':_0xf2da('0xb'),'port':0x18eb});var socket=require(_0xf2da('0xc'))(new Redis(config[_0xf2da('0x9')]));require(_0xf2da('0xd'))[_0xf2da('0xe')](socket);function respondWithRpcPromise(_0x3c1435,_0x3aa42a,_0x2deabd){return new BPromise(function(_0x52c04b,_0x99b107){return client[_0xf2da('0xf')](_0x3c1435,_0x2deabd)[_0xf2da('0x10')](function(_0x53c919){logger[_0xf2da('0x11')](_0xf2da('0x12'),_0x3aa42a,_0xf2da('0x13'));logger[_0xf2da('0x14')](_0xf2da('0x15'),_0x3aa42a,'request\x20sent',JSON[_0xf2da('0x16')](_0x53c919));if(_0x53c919['error']){if(_0x53c919[_0xf2da('0x17')]['code']===0x1f4){logger[_0xf2da('0x17')](_0xf2da('0x12'),_0x3aa42a,_0x53c919[_0xf2da('0x17')][_0xf2da('0x18')]);return _0x99b107(_0x53c919['error'][_0xf2da('0x18')]);}logger[_0xf2da('0x17')](_0xf2da('0x12'),_0x3aa42a,_0x53c919[_0xf2da('0x17')][_0xf2da('0x18')]);return _0x52c04b(_0x53c919[_0xf2da('0x17')]['message']);}else{logger['info'](_0xf2da('0x12'),_0x3aa42a,_0xf2da('0x13'));_0x52c04b(_0x53c919[_0xf2da('0x19')][_0xf2da('0x18')]);}})['catch'](function(_0x221cb1){logger[_0xf2da('0x17')](_0xf2da('0x12'),_0x3aa42a,_0x221cb1);_0x99b107(_0x221cb1);});});}exports[_0xf2da('0x1a')]=function(_0x3d2abe){var _0x172c9c=this;return new Promise(function(_0xab52e9,_0x266d0f){return db[_0xf2da('0x1b')][_0xf2da('0x1c')](_0x3d2abe['body'],{'raw':_0x3d2abe[_0xf2da('0x1d')]?_0x3d2abe[_0xf2da('0x1d')][_0xf2da('0x1e')]===undefined?!![]:![]:!![]})[_0xf2da('0x10')](function(_0x2f732d){logger[_0xf2da('0x11')](_0xf2da('0x1a'),_0x3d2abe);logger[_0xf2da('0x14')](_0xf2da('0x1a'),_0x3d2abe,JSON['stringify'](_0x2f732d));_0xab52e9(_0x2f732d);})[_0xf2da('0x1f')](function(_0x4ce17f){logger[_0xf2da('0x17')](_0xf2da('0x1a'),_0x4ce17f['message'],_0x3d2abe);_0x266d0f(_0x172c9c[_0xf2da('0x17')](0x1f4,_0x4ce17f[_0xf2da('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 02d0493..bb043f4 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 _0x4ebc=['register','length','plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x2419d2,_0x63d417){var _0x1ea483=function(_0x5d85ff){while(--_0x5d85ff){_0x2419d2['push'](_0x2419d2['shift']());}};_0x1ea483(++_0x63d417);}(_0x4ebc,0x150));var _0xc4eb=function(_0x59fae8,_0x4f483f){_0x59fae8=_0x59fae8-0x0;var _0x1039bf=_0x4ebc[_0x59fae8];return _0x1039bf;};'use strict';var PluginEvents=require(_0xc4eb('0x0'));var events=[_0xc4eb('0x1'),_0xc4eb('0x2'),_0xc4eb('0x3')];function createListener(_0x378aee,_0x202683){return function(_0x2f7600){_0x202683[_0xc4eb('0x4')](_0x378aee,_0x2f7600);};}function removeListener(_0x1cb844,_0x1cf20f){return function(){PluginEvents[_0xc4eb('0x5')](_0x1cb844,_0x1cf20f);};}exports[_0xc4eb('0x6')]=function(_0xe27637){for(var _0x27e2fb=0x0,_0x2c31b6=events[_0xc4eb('0x7')];_0x27e2fb<_0x2c31b6;_0x27e2fb++){var _0x12e8b2=events[_0x27e2fb];var _0x4cea82=createListener(_0xc4eb('0x8')+_0x12e8b2,_0xe27637);PluginEvents['on'](_0x12e8b2,_0x4cea82);}}; \ No newline at end of file +var _0x1fc8=['register','plugin:','./plugin.events','save','update','removeListener'];(function(_0x362eba,_0x95fd06){var _0x20f595=function(_0x4a70ed){while(--_0x4a70ed){_0x362eba['push'](_0x362eba['shift']());}};_0x20f595(++_0x95fd06);}(_0x1fc8,0x13a));var _0x81fc=function(_0x55eda3,_0x3cea93){_0x55eda3=_0x55eda3-0x0;var _0x39a8cf=_0x1fc8[_0x55eda3];return _0x39a8cf;};'use strict';var PluginEvents=require(_0x81fc('0x0'));var events=[_0x81fc('0x1'),'remove',_0x81fc('0x2')];function createListener(_0x28b744,_0x25d886){return function(_0x15ecb6){_0x25d886['emit'](_0x28b744,_0x15ecb6);};}function removeListener(_0x2f6141,_0x46c0ab){return function(){PluginEvents[_0x81fc('0x3')](_0x2f6141,_0x46c0ab);};}exports[_0x81fc('0x4')]=function(_0x4d01c0){for(var _0x400d64=0x0,_0x55b1ed=events['length'];_0x400d64<_0x55b1ed;_0x400d64++){var _0x57a50c=events[_0x400d64];var _0x2dc461=createListener(_0x81fc('0x5')+_0x57a50c,_0x4d01c0);PluginEvents['on'](_0x57a50c,_0x2dc461);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index a42ed84..62ec160 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(_0x126895,_0x468fb0){var _0x2df6da=function(_0x3d1ee1){while(--_0x3d1ee1){_0x126895['push'](_0x126895['shift']());}};_0x2df6da(++_0x468fb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x6acc78,_0xf5c65d){var _0x1f763c=function(_0x3be3d6){while(--_0x3be3d6){_0x6acc78['push'](_0x6acc78['shift']());}};_0x1f763c(++_0xf5c65d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 8d7637b..1907f31 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 _0xa74f=['child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','body','script','cwd','chdir','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','params','delete','dump','../../config/logger'];(function(_0x1ade47,_0x3b9723){var _0x431dd4=function(_0x402ac3){while(--_0x402ac3){_0x1ade47['push'](_0x1ade47['shift']());}};_0x431dd4(++_0x3b9723);}(_0xa74f,0x9a));var _0xfa74=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xa74f[_0x16aaef];return _0x1c82ef;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0xfa74('0x0'))('api');var path=require('path');var exec=require(_0xfa74('0x1'))[_0xfa74('0x2')];var BPromise=require(_0xfa74('0x3'));function handleEntityNotFound(_0x25a9b7,_0x5b367b){return function(_0x141625){if(!_0x141625){_0x25a9b7['sendStatus'](0x194);;}return _0x141625;};}function respondWithResult(_0x543cfe,_0x43dd2f){_0x43dd2f=_0x43dd2f||0xc8;return function(_0x9ddbd2){if(_0x9ddbd2){return _0x543cfe[_0xfa74('0x4')](_0x43dd2f)[_0xfa74('0x5')](_0x9ddbd2);}return null;};}function handleError(_0x287921,_0x344e04){_0x344e04=_0x344e04||0x1f4;return function(_0x5c0eb2){logger[_0xfa74('0x6')](_0x5c0eb2[_0xfa74('0x7')]);if(_0x5c0eb2[_0xfa74('0x8')]){delete _0x5c0eb2[_0xfa74('0x8')];}_0x287921['status'](_0x344e04)[_0xfa74('0x9')](_0x5c0eb2);};}function execChildProcess(){return new BPromise(function(_0x4f8891,_0x48695c){exec(_0xfa74('0xa'),function(_0x1d919d,_0x30b2d5,_0x307d35){logger['info'](_0x30b2d5);logger[_0xfa74('0xb')](_0x307d35);if(_0x1d919d){logger[_0xfa74('0x6')](_0x1d919d);return _0x48695c(_0x1d919d);}return _0x4f8891(_0x30b2d5);});});}exports[_0xfa74('0xc')]=function(_0x278e8b,_0x4ad407){return pm2[_0xfa74('0xd')]()[_0xfa74('0xe')](function(_0x3eb49b){if(_0x3eb49b){var _0x3947ca=_[_0xfa74('0xf')](_0x3eb49b,function(_0x47c8fb){return _0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x10')||_0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x11');});return{'rows':_0x3947ca,'count':_0x3947ca[_0xfa74('0x12')]};}return null;})[_0xfa74('0xe')](respondWithResult(_0x4ad407,null))[_0xfa74('0x13')](handleError(_0x4ad407,null));};exports['show']=function(_0x58a67a,_0xe0e33d){return pm2['describe'](_0x58a67a['params']['id'])[_0xfa74('0xe')](respondWithResult(_0xe0e33d,null))[_0xfa74('0xe')](handleEntityNotFound(_0xe0e33d,null))[_0xfa74('0x13')](handleError(_0xe0e33d,null));};exports['create']=function(_0x3bede6,_0x2edebb){if(_0x3bede6[_0xfa74('0x14')]['name']&&_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]){var _0x2e6c33=path['join'](__dirname,'../../files/plugins',_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]);var _0x9932db=process[_0xfa74('0x16')]();process[_0xfa74('0x17')](path['dirname'](_0x2e6c33));return execChildProcess()['then'](function(_0x3721bf){process['chdir'](_0x9932db);return pm2['start']({'name':_0x3bede6['body'][_0xfa74('0x8')],'script':_0x2e6c33});})[_0xfa74('0xe')](function(_0x42d9bf){pm2['dump']();return _0x42d9bf[0x0];})['then'](respondWithResult(_0x2edebb,0xc9))[_0xfa74('0x13')](handleError(_0x2edebb,null));}else{return _0x2edebb[_0xfa74('0x4')](0x1f4)['send']({'message':_0xfa74('0x18')});}};exports['update']=function(_0x1a8cf7,_0x153b2a){if(_0x1a8cf7['body']['id']){delete _0x1a8cf7[_0xfa74('0x14')]['id'];}var _0x1130de={'online':_0xfa74('0x19'),'stopped':_0xfa74('0x1a')};if(_0x1130de['hasOwnProperty'](_0x1a8cf7[_0xfa74('0x14')][_0xfa74('0x4')])){return pm2[_0x1130de[_0x1a8cf7[_0xfa74('0x14')]['status']]](_0x1a8cf7['params']['id'])[_0xfa74('0xe')](respondWithResult(_0x153b2a,0xc8))[_0xfa74('0x13')](handleError(_0x153b2a,null));}else{return _0x153b2a['status'](0x1f4)['send']({'message':_0xfa74('0x1b')});}};exports['destroy']=function(_0x2238d4,_0x4d6d0a){if(_0x2238d4[_0xfa74('0x14')]['id']){delete _0x2238d4[_0xfa74('0x14')]['id'];}if(_0x2238d4[_0xfa74('0x1c')]['id']){return pm2[_0xfa74('0x1d')](_0x2238d4['params']['id'])[_0xfa74('0xe')](function(_0x102d47){pm2[_0xfa74('0x1e')]();return _0x102d47[0x0];})[_0xfa74('0xe')](respondWithResult(_0x4d6d0a,null))[_0xfa74('0x13')](handleError(_0x4d6d0a,null));}else{return _0x4d6d0a[_0xfa74('0x4')](0x1f4)[_0xfa74('0x9')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x984b=['reject','express','motion2','catch','show','describe','params','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','destroy','delete','Unknown\x20id','api','path','child_process','status','json','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0x334d07,_0x4b643a){var _0x4f959a=function(_0x319358){while(--_0x319358){_0x334d07['push'](_0x334d07['shift']());}};_0x4f959a(++_0x4b643a);}(_0x984b,0xee));var _0xb984=function(_0x2daf5d,_0x5b1b52){_0x2daf5d=_0x2daf5d-0x0;var _0x5b2325=_0x984b[_0x2daf5d];return _0x5b2325;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb984('0x0'));var path=require(_0xb984('0x1'));var exec=require(_0xb984('0x2'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x8384b0,_0x340f2c){return function(_0x4d8f6a){if(!_0x4d8f6a){_0x8384b0['sendStatus'](0x194);;}return _0x4d8f6a;};}function respondWithResult(_0x2cca53,_0x46c541){_0x46c541=_0x46c541||0xc8;return function(_0x5a605a){if(_0x5a605a){return _0x2cca53[_0xb984('0x3')](_0x46c541)[_0xb984('0x4')](_0x5a605a);}return null;};}function handleError(_0x4d72b7,_0x37fd36){_0x37fd36=_0x37fd36||0x1f4;return function(_0x4e6b9a){logger[_0xb984('0x5')](_0x4e6b9a[_0xb984('0x6')]);if(_0x4e6b9a[_0xb984('0x7')]){delete _0x4e6b9a[_0xb984('0x7')];}_0x4d72b7[_0xb984('0x3')](_0x37fd36)[_0xb984('0x8')](_0x4e6b9a);};}function execChildProcess(){return new BPromise(function(_0x11525c,_0xfca315){exec(_0xb984('0x9'),function(_0x3c3e8a,_0x1f107f,_0x39e612){logger['info'](_0x1f107f);logger[_0xb984('0xa')](_0x39e612);if(_0x3c3e8a){logger['error'](_0x3c3e8a);return _0xfca315(_0x3c3e8a);}return _0x11525c(_0x1f107f);});});}exports[_0xb984('0xb')]=function(_0x2dba22,_0x594a5e){return pm2[_0xb984('0xc')]()[_0xb984('0xd')](function(_0x564d24){if(_0x564d24){var _0x203dba=_[_0xb984('0xe')](_0x564d24,function(_0x549791){return _0x549791[_0xb984('0x7')]===_0xb984('0xf')||_0x549791['name']===_0xb984('0x10');});return{'rows':_0x203dba,'count':_0x203dba['length']};}return null;})[_0xb984('0xd')](respondWithResult(_0x594a5e,null))[_0xb984('0x11')](handleError(_0x594a5e,null));};exports[_0xb984('0x12')]=function(_0x3f7cff,_0x59dcb7){return pm2[_0xb984('0x13')](_0x3f7cff[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x59dcb7,null))[_0xb984('0xd')](handleEntityNotFound(_0x59dcb7,null))[_0xb984('0x11')](handleError(_0x59dcb7,null));};exports[_0xb984('0x15')]=function(_0x5c2e25,_0x2492f4){if(_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')]&&_0x5c2e25[_0xb984('0x16')][_0xb984('0x17')]){var _0xcf9365=path['join'](__dirname,_0xb984('0x18'),_0x5c2e25[_0xb984('0x16')]['script']);var _0x44b570=process[_0xb984('0x19')]();process[_0xb984('0x1a')](path[_0xb984('0x1b')](_0xcf9365));return execChildProcess()[_0xb984('0xd')](function(_0x286033){process[_0xb984('0x1a')](_0x44b570);return pm2['start']({'name':_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')],'script':_0xcf9365});})[_0xb984('0xd')](function(_0x5d4d38){pm2[_0xb984('0x1c')]();return _0x5d4d38[0x0];})[_0xb984('0xd')](respondWithResult(_0x2492f4,0xc9))[_0xb984('0x11')](handleError(_0x2492f4,null));}else{return _0x2492f4[_0xb984('0x3')](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x1d')});}};exports[_0xb984('0x1e')]=function(_0x4b3da0,_0x5d93d9){if(_0x4b3da0[_0xb984('0x16')]['id']){delete _0x4b3da0[_0xb984('0x16')]['id'];}var _0x3e254b={'online':_0xb984('0x1f'),'stopped':'stop'};if(_0x3e254b[_0xb984('0x20')](_0x4b3da0[_0xb984('0x16')][_0xb984('0x3')])){return pm2[_0x3e254b[_0x4b3da0['body'][_0xb984('0x3')]]](_0x4b3da0[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x5d93d9,0xc8))[_0xb984('0x11')](handleError(_0x5d93d9,null));}else{return _0x5d93d9['status'](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0xb984('0x21')]=function(_0x23ecf6,_0x58a98c){if(_0x23ecf6[_0xb984('0x16')]['id']){delete _0x23ecf6[_0xb984('0x16')]['id'];}if(_0x23ecf6[_0xb984('0x14')]['id']){return pm2[_0xb984('0x22')](_0x23ecf6['params']['id'])['then'](function(_0x315f70){pm2[_0xb984('0x1c')]();return _0x315f70[0x0];})[_0xb984('0xd')](respondWithResult(_0x58a98c,null))[_0xb984('0x11')](handleError(_0x58a98c,null));}else{return _0x58a98c['status'](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 153c893..3506053 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 _0x5fbe=['/agents','getAgents','get','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0xf930,_0x51dc94){var _0x1c1541=function(_0x10a993){while(--_0x10a993){_0xf930['push'](_0xf930['shift']());}};_0x1c1541(++_0x51dc94);}(_0x5fbe,0x1d2));var _0xe5fb=function(_0x3ff94a,_0x2d3599){_0x3ff94a=_0x3ff94a-0x0;var _0xacea64=_0x5fbe[_0x3ff94a];return _0xacea64;};'use strict';var express=require(_0xe5fb('0x0'));var router=express[_0xe5fb('0x1')]();var auth=require(_0xe5fb('0x2'));var controller=require(_0xe5fb('0x3'));router['get'](_0xe5fb('0x4'),auth['isAuthenticated'](),controller[_0xe5fb('0x5')]);router[_0xe5fb('0x6')](_0xe5fb('0x7'),auth['isAuthenticated'](),controller[_0xe5fb('0x8')]);module[_0xe5fb('0x9')]=router; \ No newline at end of file +var _0x22e9=['exports','express','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues'];(function(_0x28094e,_0x177dea){var _0x391994=function(_0x5a9b1a){while(--_0x5a9b1a){_0x28094e['push'](_0x28094e['shift']());}};_0x391994(++_0x177dea);}(_0x22e9,0x121));var _0x922e=function(_0x300d13,_0x412659){_0x300d13=_0x300d13-0x0;var _0x39541d=_0x22e9[_0x300d13];return _0x39541d;};'use strict';var express=require(_0x922e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x922e('0x1'));router[_0x922e('0x2')](_0x922e('0x3'),auth[_0x922e('0x4')](),controller[_0x922e('0x5')]);router[_0x922e('0x2')](_0x922e('0x6'),auth[_0x922e('0x4')](),controller[_0x922e('0x7')]);module[_0x922e('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 18c90ad..a3f6533 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 _0x3bbf=['agent','getOptions','raw','where','user','role','userProfileId','nolimit','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','QueueCampaigns','Queues','UserProfile','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','outbound','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','map','get','agents','paused','talking','busy','find','pick','filter','queue','length','some','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','push','User','Queue','QueueId','loggedInDb','idle','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','mail','sms','whatsapp','includes','Invalid\x20channel','isArray','findOne','getAgents','all','uniq','value','split','globalStatus','order','startsWith','DESC','ASC','sort','pause','pauseType','userpic','lastLoginAt','lastPauseAt','address','openchannelCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','channel','fields','globalQueueFilter','type','key'];(function(_0x48d55c,_0x475769){var _0x311b8a=function(_0xa9c1f4){while(--_0xa9c1f4){_0x48d55c['push'](_0x48d55c['shift']());}};_0x311b8a(++_0x475769);}(_0x3bbf,0xb4));var _0xf3bb=function(_0x12113b,_0x1a3c1c){_0x12113b=_0x12113b-0x0;var _0x525a50=_0x3bbf[_0x12113b];return _0x525a50;};'use strict';var util=require(_0xf3bb('0x0'));var _=require('lodash');var jayson=require(_0xf3bb('0x1'));var qs=require(_0xf3bb('0x2'));var logger=require(_0xf3bb('0x3'))(_0xf3bb('0x4'));var db=require(_0xf3bb('0x5'))['db'];var amiClient=jayson[_0xf3bb('0x6')][_0xf3bb('0x7')]({'port':0x232a});var routingClient=jayson[_0xf3bb('0x6')][_0xf3bb('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x444489,_0x15687b){return function(_0x3d89e0){if(_0x3d89e0){var _0x45e4e4=typeof _0x15687b[_0xf3bb('0x8')]===_0xf3bb('0x9')&&typeof _0x15687b[_0xf3bb('0xa')]==='undefined';var _0x38fb22=_0x3d89e0['count'];var _0x26d3b4=_0x45e4e4?0x0:_0x15687b[_0xf3bb('0x8')];var _0x2f8f10=_0x45e4e4?_0x3d89e0[_0xf3bb('0xb')]:_0x15687b[_0xf3bb('0x8')]+_0x15687b[_0xf3bb('0xa')];var _0x519e2b;if(_0x2f8f10>=_0x38fb22){_0x2f8f10=_0x38fb22;_0x519e2b=0xc8;}else{_0x519e2b=0xce;}_0x444489[_0xf3bb('0xc')](_0x519e2b);return _0x444489[_0xf3bb('0xd')](_0xf3bb('0xe'),_0x26d3b4+'-'+_0x2f8f10+'/'+_0x38fb22)['json'](_0x3d89e0);}return null;};}function handleError(_0xb59017,_0x4a5ec8){_0x4a5ec8=_0x4a5ec8||0x1f4;return function(_0x5d4ee9){logger[_0xf3bb('0xf')](_0x5d4ee9[_0xf3bb('0x10')]);if(_0x5d4ee9[_0xf3bb('0x11')]){delete _0x5d4ee9[_0xf3bb('0x11')];}_0xb59017[_0xf3bb('0xc')](_0x4a5ec8)[_0xf3bb('0x12')](_0x5d4ee9);};}function getRealtimeAgents(){return new Promise(function(_0x9fd93,_0x4ca266){return amiClient[_0xf3bb('0x13')](_0xf3bb('0x14'),{})[_0xf3bb('0x15')](function(_0x54f349){if(_0x54f349[_0xf3bb('0xf')])throw new Error(_0xf3bb('0x16'));var _0x5d843d=_0x54f349[_0xf3bb('0x17')];return routingClient[_0xf3bb('0x13')](_0xf3bb('0x14'),{})['then'](function(_0x105228){if(_0x105228[_0xf3bb('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x35e7c7=_0x105228[_0xf3bb('0x17')];return _0x9fd93(_[_0xf3bb('0x18')]({},_0x5d843d,_0x35e7c7));});})[_0xf3bb('0x19')](function(_0x35d96c){_0x4ca266(_0x35d96c);});});}function getRealtimeQueues(_0x5e5aee,_0x175e59){return new Promise(function(_0x1fd97d,_0x12e597){var _0xf6416e=_0x175e59===_0xf3bb('0x1a')?amiClient:routingClient;return _0xf6416e['request'](_[_0xf3bb('0x1b')](_0x175e59)+'Queues',_0x5e5aee)[_0xf3bb('0x15')](function(_0x569844){if(_0x569844['error'])throw new Error(util[_0xf3bb('0x1c')](_0xf3bb('0x1d'),_0x175e59));return _0x1fd97d(_0x569844[_0xf3bb('0x17')]);})['catch'](function(_0x263d51){_0x12e597(_0x263d51);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x456d0a,_0x51ad00){return amiClient[_0xf3bb('0x13')](_0xf3bb('0x1e'),{})[_0xf3bb('0x15')](function(_0x3e947e){if(_0x3e947e['error'])throw new Error(_0xf3bb('0x1f'));return _0x456d0a(_0x3e947e['result']);})[_0xf3bb('0x19')](function(_0x456287){_0x51ad00(_0x456287);});});}function initializeQueues(_0x16b41c,_0x9a714c,_0x10278d,_0x244837){var _0x1a91ed=[_0xf3bb('0x20'),_0xf3bb('0x21'),_0xf3bb('0x22'),'talking','paused'];if(_0x10278d===_0xf3bb('0x1a')&&_0x244837===_0xf3bb('0x23')){_0x1a91ed['push'](_0xf3bb('0x24'),_0xf3bb('0x25'),'message',_0xf3bb('0x26'),_0xf3bb('0x27'),_0xf3bb('0x28'),_0xf3bb('0x29'),'startProgressive',_0xf3bb('0x2a'),_0xf3bb('0x2b'),_0xf3bb('0x2c'),_0xf3bb('0x2d'),'dialPredictiveInterval',_0xf3bb('0x2e'),_0xf3bb('0x2f'),_0xf3bb('0x30'),'predictiveIntervalTotalCalls',_0xf3bb('0x31'),_0xf3bb('0x32'),'predictiveIntervalDroppedCallsCallersExit',_0xf3bb('0x33'),'predictiveIntervalAvgTalktime');}return _0x16b41c[_0xf3bb('0x34')](function(_0xa62062){var _0x18f586=_0xa62062[_0xf3bb('0x35')]({'plain':!![]});_0x18f586[_0xf3bb('0x36')]=[];_0x18f586[_0xf3bb('0x37')]=0x0;_0x18f586['loggedInDb']=0x0;_0x18f586[_0xf3bb('0x20')]=0x0;_0x18f586['available']=0x0;_0x18f586[_0xf3bb('0x22')]=0x0;if(_0x10278d===_0xf3bb('0x1a')){_0x18f586[_0xf3bb('0x38')]=0x0;_0x18f586[_0xf3bb('0x39')]=0x0;if(_0x244837==='outbound'){_0x18f586[_0xf3bb('0x24')]=0x0;_0x18f586['originated']=0x0;}}var _0x1ec0ca=_[_0xf3bb('0x3a')](_0x9a714c,['id',_0x18f586['id']]);if(_0x1ec0ca)_[_0xf3bb('0x18')](_0x18f586,_[_0xf3bb('0x3b')](_0x1ec0ca,_0x1a91ed));return _0x18f586;});}function updateAgentVoiceStatus(_0x40f635,_0x548454,_0x34fdaa){var _0x419988=_[_0xf3bb('0x3c')](_0x34fdaa,[_0xf3bb('0x3d'),_0x548454[_0xf3bb('0x11')]]);if(_0x419988[_0xf3bb('0x3e')]===0x0)return _0x40f635[_0xf3bb('0x39')]=!![];if(_[_0xf3bb('0x3f')](_0x419988,['connectedlinenum',_0x40f635[_0xf3bb('0x40')][_0xf3bb('0x41')]()]))return _0x40f635['talking']=!![];if(!_0x40f635['talking'])return _0x40f635[_0xf3bb('0x39')]=!![];}function getVoiceQueueAgents(_0x2af96a,_0x1d1c97,_0x256391,_0x1142cb){var _0x25c018=_[_0xf3bb('0x3a')](_0x1d1c97,['id',_0x2af96a['id']]);if(!_0x25c018)return _0x2af96a;return _0x25c018[_0xf3bb('0x42')]({'raw':!![]})[_0xf3bb('0x15')](function(_0x2c8c96){for(var _0x33442b=0x0;_0x33442b<_0x2c8c96[_0xf3bb('0x3e')];_0x33442b++){var _0xb63154=_[_0xf3bb('0x3a')](_0x256391,['id',_0x2c8c96[_0x33442b]['UserId']]);if(!_0xb63154){_0xb63154={'id':_0x2c8c96[_0x33442b][_0xf3bb('0x43')],'name':_0x2c8c96[_0x33442b]['UserId'],'accountcode':'','online':![]};}var _0x3b53d3={'id':_0xb63154['id'],'name':_0xb63154['name'],'internal':_0xb63154[_0xf3bb('0x44')],'online':Boolean(_0xb63154[_0xf3bb('0x45')]),'paused':Boolean(_0x2c8c96[_0x33442b][_0xf3bb('0x37')])};if(_0xb63154[_0xf3bb('0x46')]===_0xf3bb('0x38'))updateAgentVoiceStatus(_0x3b53d3,_0x2af96a,_0x1142cb);if(_0x3b53d3[_0xf3bb('0x45')])_0x2af96a['loggedInDb']++;if(_0x3b53d3[_0xf3bb('0x39')])_0x2af96a[_0xf3bb('0x39')]++;if(_0x3b53d3[_0xf3bb('0x37')]&&!_0x3b53d3[_0xf3bb('0x39')]&&!_0x3b53d3[_0xf3bb('0x38')])_0x2af96a['paused']++;_0x2af96a[_0xf3bb('0x36')][_0xf3bb('0x47')](_0x3b53d3);}return _0x2af96a;});}function getQueueAgents(_0x1c457c,_0x33eca8,_0x1e9443){var _0xfcd9c6=_0xf3bb('0x48')+_[_0xf3bb('0x1b')](_0x1e9443)+_0xf3bb('0x49');var _0x3ffc2b=_0x1e9443+'Pause';return db[_0xfcd9c6]['findAll']({'where':{[_[_0xf3bb('0x1b')](_0x1e9443)+_0xf3bb('0x4a')]:_0x1c457c['id']},'raw':!![]})[_0xf3bb('0x15')](function(_0x365de2){for(var _0x102ef4=0x0;_0x102ef4<_0x365de2[_0xf3bb('0x3e')];_0x102ef4++){var _0x286187=_[_0xf3bb('0x3a')](_0x33eca8,['id',_0x365de2[_0x102ef4]['UserId']]);if(!_0x286187){_0x286187={'id':_0x365de2[_0x102ef4][_0xf3bb('0x43')],'name':_0x365de2[_0x102ef4]['UserId'],'online':![],['pauseField']:![]};}var _0x1867c3={'id':_0x286187['id'],'name':_0x286187[_0xf3bb('0x11')],'online':Boolean(_0x286187[_0xf3bb('0x45')]),'paused':Boolean(_0x286187[_0x3ffc2b])};if(_0x1867c3[_0xf3bb('0x45')])_0x1c457c[_0xf3bb('0x4b')]++;_0x1c457c[_0xf3bb('0x36')][_0xf3bb('0x47')](_0x1867c3);}return _0x1c457c;});}function isIdle(_0x15b404){return _0x15b404===_0xf3bb('0x4c')||_0x15b404==='unknown'||_0x15b404===_0xf3bb('0x4d')||_0x15b404===_0xf3bb('0x4e')||_[_0xf3bb('0x4f')](_0x15b404);}function isAgentPaused(_0x335ff3,_0x4eac70){var _0x1e7946=[_0x335ff3[_0xf3bb('0x50')],_0x335ff3[_0xf3bb('0x51')],_0x335ff3[_0xf3bb('0x52')],_0x335ff3[_0xf3bb('0x53')],_0x335ff3[_0xf3bb('0x54')],_0x335ff3[_0xf3bb('0x55')],_0x335ff3[_0xf3bb('0x56')]];if(!_0x4eac70)return _[_0xf3bb('0x57')](_0x1e7946);var _0x314626=_[_0xf3bb('0x3c')](_0x1e7946);return _0x314626['length']>0x0&&_0x314626[_0xf3bb('0x3e')]<_0x1e7946[_0xf3bb('0x3e')]?!![]:![];}function isAgentIdle(_0x16561d){if(_0x16561d[_0xf3bb('0x46')]!=='idle'&&_0x16561d[_0xf3bb('0x55')]){_0x16561d[_0xf3bb('0x46')]='pause';return![];}return _['every']([_0x16561d[_0xf3bb('0x58')],_0x16561d['faxStatus'],_0x16561d[_0xf3bb('0x59')],_0x16561d[_0xf3bb('0x5a')],_0x16561d[_0xf3bb('0x5b')],_0x16561d[_0xf3bb('0x46')],_0x16561d[_0xf3bb('0x5c')]],isIdle);}function getAgentStatus(_0x455fb5){var _0x5429a4='unknown';if(isAgentPaused(_0x455fb5))_0x5429a4='pause';else if(isAgentPaused(_0x455fb5,!![]))_0x5429a4=_0xf3bb('0x5d');else if(isAgentIdle(_0x455fb5))_0x5429a4=_0xf3bb('0x4c');else _0x5429a4='busy';return _0x5429a4;}function validateChannel(_0x1d8d2e){var _0x55870a=[_0xf3bb('0x5e'),'chat',_0xf3bb('0x5f'),'openchannel','fax',_0xf3bb('0x60'),_0xf3bb('0x1a')];if(!_[_0xf3bb('0x61')](_0x55870a,_0x1d8d2e['toLowerCase']()))throw new Error(_0xf3bb('0x62'));return _0x1d8d2e['toLowerCase']();}function getFilteredAgentIds(_0x2737f7,_0xfdd00c){var _0x14ed0=_[_0xf3bb('0x63')](_0x2737f7)?_0x2737f7:[_0x2737f7];var _0x12489c=_['map'](_0x14ed0,function(_0x2c3967){return db[_0xfdd00c][_0xf3bb('0x64')]({'where':{'name':_0x2c3967}})[_0xf3bb('0x15')](function(_0x396d38){if(!_0x396d38)return[];return _0x396d38[_0xf3bb('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xf3bb('0x66')](_0x12489c)[_0xf3bb('0x15')](function(_0x5b8ab2){var _0xf7cd11=_(_0x5b8ab2)['flatten']()[_0xf3bb('0x34')]('id')[_0xf3bb('0x67')]()[_0xf3bb('0x68')]();return _0xf7cd11;});}function getUpdatedSortOptions(_0x4577a1){var _0x231d38={'fields':[],'order':null};var _0x14f708=_0x4577a1[_0xf3bb('0x69')](',');_0x231d38['fields']=_['filter'](_0x14f708,function(_0x3eb5e8){if(!_0x3eb5e8[_0xf3bb('0x61')](_0xf3bb('0x6a')))return!![];_0x231d38[_0xf3bb('0x6b')]=_[_0xf3bb('0x6c')](_0x3eb5e8,'-')?_0xf3bb('0x6d'):_0xf3bb('0x6e');return![];});return _0x231d38;}function orderAgentsByStatus(_0x206393,_0x2113bd){return _0x206393[_0xf3bb('0x6f')](function(_0x2e088d,_0x5d1628){if(_0x2e088d[_0xf3bb('0x6a')]===_0x5d1628[_0xf3bb('0x6a')]&&_0x2e088d[_0xf3bb('0x6a')]===_0xf3bb('0x70')){if(_0x2113bd==='DESC')return(_0x2e088d[_0xf3bb('0x71')]||'')<(_0x5d1628[_0xf3bb('0x71')]||'')?0x1:-0x1;return _0x2e088d[_0xf3bb('0x71')]<_0x5d1628[_0xf3bb('0x71')]?-0x1:0x1;}else{if(_0x2113bd===_0xf3bb('0x6d'))return _0x2e088d[_0xf3bb('0x6a')]<_0x5d1628[_0xf3bb('0x6a')]?0x1:-0x1;return _0x2e088d[_0xf3bb('0x6a')]<_0x5d1628[_0xf3bb('0x6a')]?-0x1:0x1;}});}exports['getAgents']=function(_0x485e1b,_0x123187){var _0x3235c1={'count':0x0,'rows':[]},_0x2fae1e={},_0x1e6c39,_0x3f2747,_0x5b14db,_0x5ac2ac,_0x50f70a=[_0xf3bb('0x72'),'online',_0xf3bb('0x73'),_0xf3bb('0x74'),_0xf3bb('0x71'),_0xf3bb('0x74'),_0xf3bb('0x40'),_0xf3bb('0x75'),_0xf3bb('0x50'),'openchannelPause','mailPause','smsPause',_0xf3bb('0x56'),_0xf3bb('0x51'),_0xf3bb('0x55'),'chatCapacity',_0xf3bb('0x76'),'mailCapacity',_0xf3bb('0x77'),_0xf3bb('0x78'),'faxCapacity',_0xf3bb('0x79'),_0xf3bb('0x7a'),_0xf3bb('0x7b'),_0xf3bb('0x7c'),_0xf3bb('0x7d'),_0xf3bb('0x7e'),_0xf3bb('0x58'),'openchannelStatus',_0xf3bb('0x59'),_0xf3bb('0x5b'),_0xf3bb('0x5c'),_0xf3bb('0x7f'),_0xf3bb('0x46'),_0xf3bb('0x80'),_0xf3bb('0x81'),_0xf3bb('0x82'),_0xf3bb('0x83'),'whatsappStatusTime','faxStatusTime',_0xf3bb('0x84'),'queue','destconnectedlinenum',_0xf3bb('0x85'),_0xf3bb('0x86'),_0xf3bb('0x87'),_0xf3bb('0x88')],_0x209172=[_0xf3bb('0x50'),'openchannelPause',_0xf3bb('0x52'),_0xf3bb('0x54'),_0xf3bb('0x56'),_0xf3bb('0x51'),_0xf3bb('0x55'),_0xf3bb('0x45')];Promise[_0xf3bb('0x89')]()['then'](function(){if(_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x8b')])_0x1e6c39=validateChannel(_0x485e1b[_0xf3bb('0x8a')]['channel']);if(!_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x6f')]||!_0x485e1b['query'][_0xf3bb('0x6f')][_0xf3bb('0x61')]('globalStatus'))return;var _0x36a7ad=getUpdatedSortOptions(_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x6f')]);_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x6f')]=_0x36a7ad[_0xf3bb('0x8c')]['join'](',');_0x3f2747=_0x36a7ad[_0xf3bb('0x6b')];})[_0xf3bb('0x15')](function(){if(!_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x8d')])return[];var _0x3b5fe6=_[_0xf3bb('0x1b')](_0x1e6c39)+_0xf3bb('0x49');return getFilteredAgentIds(_0x485e1b['query']['globalQueueFilter'],_0x3b5fe6);})[_0xf3bb('0x15')](function(_0x3612b0){var _0x2648ef=_[_0xf3bb('0x34')](db[_0xf3bb('0x48')]['rawAttributes'],function(_0xe31139){return{'name':_0xe31139['fieldName'],'type':_0xe31139[_0xf3bb('0x8e')][_0xf3bb('0x8f')]};});_0x485e1b[_0xf3bb('0x8a')]['role']=_0xf3bb('0x90');_0x485e1b['query']['online']=!![];_0x2fae1e=qs[_0xf3bb('0x91')](_0x2648ef,_0x485e1b);_0x2fae1e[_0xf3bb('0x92')]=!![];if(!_['isEmpty'](_0x3612b0)){_0x2fae1e[_0xf3bb('0x93')]=_[_0xf3bb('0x18')](_0x2fae1e[_0xf3bb('0x93')],{'$and':[{'id':{'$in':_0x3612b0}}]});}else if(!_['isEmpty'](_0x485e1b[_0xf3bb('0x8a')]['globalQueueFilter'])){return _0x3235c1;}if(_0x485e1b[_0xf3bb('0x94')][_0xf3bb('0x95')]===_0xf3bb('0x94')){var _0x590d97={'params':{'id':_0x485e1b[_0xf3bb('0x94')][_0xf3bb('0x96')]},'query':{'section':_0xf3bb('0x14'),'role':_0xf3bb('0x90'),'online':!![],'nolimit':_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x97')],'sort':_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x6f')],'filter':_0x485e1b[_0xf3bb('0x8a')]['filter'],'raw':!![],'ids':_0x3612b0}};return db['UserProfile'][_0xf3bb('0x98')](_0x590d97);}return db[_0xf3bb('0x48')][_0xf3bb('0x99')](_0x2fae1e);})[_0xf3bb('0x15')](function(_0x518b26){_0x3235c1[_0xf3bb('0xb')]=_0x518b26[_0xf3bb('0xb')];_0x5b14db=_0x518b26[_0xf3bb('0x9a')];return getRealtimeAgents();})[_0xf3bb('0x15')](function(_0x3131ee){_0x5ac2ac=_0x3131ee['rows'];return _0x5b14db[_0xf3bb('0x34')](function(_0x100bb1){var _0x4d7612=_[_0xf3bb('0x3a')](_0x5ac2ac,['id',_0x100bb1['id']]);if(_0x4d7612)_[_0xf3bb('0x18')](_0x100bb1,_[_0xf3bb('0x3b')](_[_0xf3bb('0x9b')](_0x4d7612,_0x209172),_0x50f70a));_0x100bb1['globalStatus']=getAgentStatus(_0x100bb1);return _0x100bb1;});})[_0xf3bb('0x15')](function(_0x3d0950){var _0x517d57;if(_0x485e1b['query']['globalStatusFilter']){_0x517d57=_[_0xf3bb('0x3c')](_0x3d0950,[_0xf3bb('0x6a'),_0x485e1b[_0xf3bb('0x8a')][_0xf3bb('0x9c')]]);if(_0x485e1b[_0xf3bb('0x8a')]['pauseTypeFilter']){_0x517d57=_['filter'](_0x517d57,[_0xf3bb('0x71'),_0x485e1b['query'][_0xf3bb('0x9d')]]);}}if(_0x517d57)_0x3d0950=_0x517d57;if(!_0x3f2747)return _0x3d0950;return orderAgentsByStatus(_0x3d0950,_0x3f2747);})['then'](function(_0xb9c519){_0x3235c1[_0xf3bb('0x9a')]=_0xb9c519;return _0x3235c1;})[_0xf3bb('0x15')](respondWithFilteredResult(_0x123187,_0x2fae1e))[_0xf3bb('0x19')](handleError(_0x123187,null));};exports[_0xf3bb('0x9e')]=function(_0x50b3f6,_0x3aa200){var _0x4a7244={'count':0x0,'rows':[]},_0x5a5a48={},_0x32985f,_0x582cfb,_0x284ee6,_0x204b95,_0x2047da;Promise[_0xf3bb('0x89')]()[_0xf3bb('0x15')](function(){if(_0x50b3f6['query']['channel'])_0x32985f=validateChannel(_0x50b3f6['query']['channel']);var _0x34c3c3=_['startCase'](_0x32985f)+'Queue';var _0x8b9f7b=_[_0xf3bb('0x34')](db[_0x34c3c3]['rawAttributes'],function(_0x428f4a){return{'name':_0x428f4a['fieldName'],'type':_0x428f4a['type'][_0xf3bb('0x8f')]};});_0x5a5a48=qs[_0xf3bb('0x91')](_0x8b9f7b,_0x50b3f6);if(_0x50b3f6[_0xf3bb('0x94')][_0xf3bb('0x95')]===_0xf3bb('0x94')){var _0x196fe5={'params':{'id':_0x50b3f6[_0xf3bb('0x94')][_0xf3bb('0x96')]},'query':{'section':_0x32985f==='voice'&&_0x50b3f6[_0xf3bb('0x8a')][_0xf3bb('0x8e')]===_0xf3bb('0x23')?_0xf3bb('0x9f'):_[_0xf3bb('0x1b')](_0x32985f)+_0xf3bb('0xa0'),'type':_0x50b3f6[_0xf3bb('0x8a')]['type'],'nolimit':!![],'sort':_0xf3bb('0x11'),'filter':_0x50b3f6[_0xf3bb('0x8a')][_0xf3bb('0x3c')]}};return db[_0xf3bb('0xa1')][_0xf3bb('0x98')](_0x196fe5);}return db[_0x34c3c3][_0xf3bb('0x99')](_0x5a5a48);})['then'](function(_0x16c790){_0x4a7244[_0xf3bb('0xb')]=_0x16c790[_0xf3bb('0xb')];_0x582cfb=_0x16c790[_0xf3bb('0x9a')];return getRealtimeQueues(_0x50b3f6,_0x32985f);})[_0xf3bb('0x15')](function(_0x248eaa){_0x204b95=_0x248eaa['rows'];return getRealtimeAgents();})[_0xf3bb('0x15')](function(_0x54f5c8){_0x284ee6=_0x54f5c8[_0xf3bb('0x9a')];if(_0x32985f!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x1a3be9){_0x2047da=_0x1a3be9?_0x1a3be9['rows']:[];return initializeQueues(_0x582cfb,_0x204b95,_0x32985f,_0x50b3f6[_0xf3bb('0x8a')]['type']);})[_0xf3bb('0x15')](function(_0x1310ad){var _0x60e87c=_0x1310ad[_0xf3bb('0x34')](function(_0x306f17){if(_0x32985f===_0xf3bb('0x1a'))return getVoiceQueueAgents(_0x306f17,_0x582cfb,_0x284ee6,_0x2047da);else return getQueueAgents(_0x306f17,_0x284ee6,_0x32985f);});return Promise[_0xf3bb('0x66')](_0x60e87c);})['then'](function(_0x11657f){_0x4a7244['rows']=_0x11657f;return _0x4a7244;})[_0xf3bb('0x15')](respondWithFilteredResult(_0x3aa200,_0x5a5a48))[_0xf3bb('0x19')](handleError(_0x3aa200,null));}; \ No newline at end of file +var _0xd2a7=['client','http','undefined','count','offset','limit','status','set','Content-Range','json','error','stack','name','send','request','Agents','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','startCase','Queues','format','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','originated','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','busy','outbound','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','push','User','Queue','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','whatsappPause','every','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','mail','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','isArray','findOne','all','flatten','value','split','fields','order','DESC','ASC','sort','globalStatus','pauseType','getAgents','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','query','channel','join','globalQueueFilter','map','rawAttributes','fieldName','type','key','role','getOptions','raw','where','isEmpty','user','userProfileId','agent','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','resolve','util','jayson/promise','../../components/parsers/qs','api','../../mysqldb'];(function(_0x114a59,_0x2fb874){var _0x3a8354=function(_0x2815d1){while(--_0x2815d1){_0x114a59['push'](_0x114a59['shift']());}};_0x3a8354(++_0x2fb874);}(_0xd2a7,0x15d));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7d2a('0x0'));var _=require('lodash');var jayson=require(_0x7d2a('0x1'));var qs=require(_0x7d2a('0x2'));var logger=require('../../config/logger')(_0x7d2a('0x3'));var db=require(_0x7d2a('0x4'))['db'];var amiClient=jayson[_0x7d2a('0x5')][_0x7d2a('0x6')]({'port':0x232a});var routingClient=jayson[_0x7d2a('0x5')][_0x7d2a('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x307fb6,_0x3c3901){return function(_0x1fca6b){if(_0x1fca6b){var _0x313358=typeof _0x3c3901['offset']===_0x7d2a('0x7')&&typeof _0x3c3901['limit']==='undefined';var _0x1a4f21=_0x1fca6b[_0x7d2a('0x8')];var _0x6b6b2d=_0x313358?0x0:_0x3c3901[_0x7d2a('0x9')];var _0x38ab9e=_0x313358?_0x1fca6b['count']:_0x3c3901[_0x7d2a('0x9')]+_0x3c3901[_0x7d2a('0xa')];var _0x552673;if(_0x38ab9e>=_0x1a4f21){_0x38ab9e=_0x1a4f21;_0x552673=0xc8;}else{_0x552673=0xce;}_0x307fb6[_0x7d2a('0xb')](_0x552673);return _0x307fb6[_0x7d2a('0xc')](_0x7d2a('0xd'),_0x6b6b2d+'-'+_0x38ab9e+'/'+_0x1a4f21)[_0x7d2a('0xe')](_0x1fca6b);}return null;};}function handleError(_0x397b54,_0x3c8072){_0x3c8072=_0x3c8072||0x1f4;return function(_0x1c89c5){logger[_0x7d2a('0xf')](_0x1c89c5[_0x7d2a('0x10')]);if(_0x1c89c5[_0x7d2a('0x11')]){delete _0x1c89c5[_0x7d2a('0x11')];}_0x397b54[_0x7d2a('0xb')](_0x3c8072)[_0x7d2a('0x12')](_0x1c89c5);};}function getRealtimeAgents(){return new Promise(function(_0x422d2d,_0x4c09aa){return amiClient[_0x7d2a('0x13')](_0x7d2a('0x14'),{})[_0x7d2a('0x15')](function(_0x3f405a){if(_0x3f405a[_0x7d2a('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x429ae1=_0x3f405a[_0x7d2a('0x16')];return routingClient['request']('Agents',{})['then'](function(_0x2d571e){if(_0x2d571e[_0x7d2a('0xf')])throw new Error(_0x7d2a('0x17'));var _0x2abb27=_0x2d571e[_0x7d2a('0x16')];return _0x422d2d(_[_0x7d2a('0x18')]({},_0x429ae1,_0x2abb27));});})['catch'](function(_0x36ca00){_0x4c09aa(_0x36ca00);});});}function getRealtimeQueues(_0x40936d,_0x17811b){return new Promise(function(_0x10d18e,_0x7f9a48){var _0x4220ad=_0x17811b===_0x7d2a('0x19')?amiClient:routingClient;return _0x4220ad['request'](_[_0x7d2a('0x1a')](_0x17811b)+_0x7d2a('0x1b'),_0x40936d)['then'](function(_0x4c2acd){if(_0x4c2acd['error'])throw new Error(util[_0x7d2a('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x17811b));return _0x10d18e(_0x4c2acd[_0x7d2a('0x16')]);})[_0x7d2a('0x1d')](function(_0x58aba4){_0x7f9a48(_0x58aba4);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4cc33b,_0x50ad25){return amiClient[_0x7d2a('0x13')](_0x7d2a('0x1e'),{})[_0x7d2a('0x15')](function(_0x54f869){if(_0x54f869[_0x7d2a('0xf')])throw new Error(_0x7d2a('0x1f'));return _0x4cc33b(_0x54f869[_0x7d2a('0x16')]);})[_0x7d2a('0x1d')](function(_0x36a9e8){_0x50ad25(_0x36a9e8);});});}function initializeQueues(_0x11ab08,_0x56e06a,_0x48686a,_0x719f55){var _0x170e36=[_0x7d2a('0x20'),_0x7d2a('0x21'),_0x7d2a('0x22'),_0x7d2a('0x23'),_0x7d2a('0x24')];if(_0x48686a===_0x7d2a('0x19')&&_0x719f55==='outbound'){_0x170e36['push']('pTalking',_0x7d2a('0x25'),'message',_0x7d2a('0x26'),_0x7d2a('0x27'),'Trunk',_0x7d2a('0x28'),_0x7d2a('0x29'),_0x7d2a('0x2a'),_0x7d2a('0x2b'),_0x7d2a('0x2c'),_0x7d2a('0x2d'),_0x7d2a('0x2e'),_0x7d2a('0x2f'),_0x7d2a('0x30'),_0x7d2a('0x31'),_0x7d2a('0x32'),'predictiveIntervalAnsweredCalls',_0x7d2a('0x33'),_0x7d2a('0x34'),_0x7d2a('0x35'),_0x7d2a('0x36'));}return _0x11ab08['map'](function(_0x132747){var _0x462069=_0x132747[_0x7d2a('0x37')]({'plain':!![]});_0x462069[_0x7d2a('0x38')]=[];_0x462069[_0x7d2a('0x24')]=0x0;_0x462069['loggedInDb']=0x0;_0x462069['loggedIn']=0x0;_0x462069[_0x7d2a('0x21')]=0x0;_0x462069[_0x7d2a('0x22')]=0x0;if(_0x48686a===_0x7d2a('0x19')){_0x462069[_0x7d2a('0x23')]=0x0;_0x462069[_0x7d2a('0x39')]=0x0;if(_0x719f55===_0x7d2a('0x3a')){_0x462069['pTalking']=0x0;_0x462069['originated']=0x0;}}var _0x80d6c9=_[_0x7d2a('0x3b')](_0x56e06a,['id',_0x462069['id']]);if(_0x80d6c9)_[_0x7d2a('0x18')](_0x462069,_[_0x7d2a('0x3c')](_0x80d6c9,_0x170e36));return _0x462069;});}function updateAgentVoiceStatus(_0x132956,_0x4830c1,_0x3d7e36){var _0x65fd57=_[_0x7d2a('0x3d')](_0x3d7e36,[_0x7d2a('0x3e'),_0x4830c1['name']]);if(_0x65fd57[_0x7d2a('0x3f')]===0x0)return _0x132956['busy']=!![];if(_[_0x7d2a('0x40')](_0x65fd57,[_0x7d2a('0x41'),_0x132956[_0x7d2a('0x42')][_0x7d2a('0x43')]()]))return _0x132956['talking']=!![];if(!_0x132956[_0x7d2a('0x23')])return _0x132956[_0x7d2a('0x39')]=!![];}function getVoiceQueueAgents(_0x15d4e5,_0x39448b,_0x4822a8,_0x10b849){var _0x4bc73c=_['find'](_0x39448b,['id',_0x15d4e5['id']]);if(!_0x4bc73c)return _0x15d4e5;return _0x4bc73c[_0x7d2a('0x44')]({'raw':!![]})['then'](function(_0x48cfcb){for(var _0x24a610=0x0;_0x24a610<_0x48cfcb[_0x7d2a('0x3f')];_0x24a610++){var _0x416df6=_[_0x7d2a('0x3b')](_0x4822a8,['id',_0x48cfcb[_0x24a610][_0x7d2a('0x45')]]);if(!_0x416df6){_0x416df6={'id':_0x48cfcb[_0x24a610][_0x7d2a('0x45')],'name':_0x48cfcb[_0x24a610]['UserId'],'accountcode':'','online':![]};}var _0x19f95c={'id':_0x416df6['id'],'name':_0x416df6[_0x7d2a('0x11')],'internal':_0x416df6[_0x7d2a('0x46')],'online':Boolean(_0x416df6[_0x7d2a('0x47')]),'paused':Boolean(_0x48cfcb[_0x24a610][_0x7d2a('0x24')])};if(_0x416df6[_0x7d2a('0x48')]==='talking')updateAgentVoiceStatus(_0x19f95c,_0x15d4e5,_0x10b849);if(_0x19f95c[_0x7d2a('0x47')])_0x15d4e5['loggedInDb']++;if(_0x19f95c['busy'])_0x15d4e5['busy']++;if(_0x19f95c[_0x7d2a('0x24')]&&!_0x19f95c[_0x7d2a('0x39')]&&!_0x19f95c['talking'])_0x15d4e5[_0x7d2a('0x24')]++;_0x15d4e5['agents'][_0x7d2a('0x49')](_0x19f95c);}return _0x15d4e5;});}function getQueueAgents(_0x3e943b,_0x2a7306,_0x230c56){var _0x58c5c6=_0x7d2a('0x4a')+_[_0x7d2a('0x1a')](_0x230c56)+_0x7d2a('0x4b');var _0x541f08=_0x230c56+_0x7d2a('0x4c');return db[_0x58c5c6][_0x7d2a('0x4d')]({'where':{[_[_0x7d2a('0x1a')](_0x230c56)+_0x7d2a('0x4e')]:_0x3e943b['id']},'raw':!![]})[_0x7d2a('0x15')](function(_0x4acec5){for(var _0x445fd4=0x0;_0x445fd4<_0x4acec5['length'];_0x445fd4++){var _0x356beb=_[_0x7d2a('0x3b')](_0x2a7306,['id',_0x4acec5[_0x445fd4][_0x7d2a('0x45')]]);if(!_0x356beb){_0x356beb={'id':_0x4acec5[_0x445fd4]['UserId'],'name':_0x4acec5[_0x445fd4][_0x7d2a('0x45')],'online':![],['pauseField']:![]};}var _0x6eccfe={'id':_0x356beb['id'],'name':_0x356beb['name'],'online':Boolean(_0x356beb['online']),'paused':Boolean(_0x356beb[_0x541f08])};if(_0x6eccfe['online'])_0x3e943b['loggedInDb']++;_0x3e943b['agents'][_0x7d2a('0x49')](_0x6eccfe);}return _0x3e943b;});}function isIdle(_0x3844fc){return _0x3844fc===_0x7d2a('0x4f')||_0x3844fc===_0x7d2a('0x50')||_0x3844fc===_0x7d2a('0x51')||_0x3844fc===_0x7d2a('0x52')||_[_0x7d2a('0x53')](_0x3844fc);}function isAgentPaused(_0xa28cc7,_0x3170db){var _0x5231e5=[_0xa28cc7[_0x7d2a('0x54')],_0xa28cc7[_0x7d2a('0x55')],_0xa28cc7[_0x7d2a('0x56')],_0xa28cc7[_0x7d2a('0x57')],_0xa28cc7['smsPause'],_0xa28cc7['voicePause'],_0xa28cc7[_0x7d2a('0x58')]];if(!_0x3170db)return _[_0x7d2a('0x59')](_0x5231e5);var _0x2c4f1a=_[_0x7d2a('0x3d')](_0x5231e5);return _0x2c4f1a[_0x7d2a('0x3f')]>0x0&&_0x2c4f1a[_0x7d2a('0x3f')]<_0x5231e5[_0x7d2a('0x3f')]?!![]:![];}function isAgentIdle(_0x51170f){if(_0x51170f['voiceStatus']!==_0x7d2a('0x4f')&&_0x51170f[_0x7d2a('0x5a')]){_0x51170f['voiceStatus']=_0x7d2a('0x5b');return![];}return _['every']([_0x51170f[_0x7d2a('0x5c')],_0x51170f[_0x7d2a('0x5d')],_0x51170f[_0x7d2a('0x5e')],_0x51170f[_0x7d2a('0x5f')],_0x51170f[_0x7d2a('0x60')],_0x51170f[_0x7d2a('0x48')],_0x51170f[_0x7d2a('0x61')]],isIdle);}function getAgentStatus(_0x46e148){var _0xa3b40f='unknown';if(isAgentPaused(_0x46e148))_0xa3b40f=_0x7d2a('0x5b');else if(isAgentPaused(_0x46e148,!![]))_0xa3b40f=_0x7d2a('0x62');else if(isAgentIdle(_0x46e148))_0xa3b40f=_0x7d2a('0x4f');else _0xa3b40f='busy';return _0xa3b40f;}function validateChannel(_0x4727d3){var _0x9657c0=[_0x7d2a('0x63'),_0x7d2a('0x64'),_0x7d2a('0x65'),_0x7d2a('0x66'),_0x7d2a('0x67'),_0x7d2a('0x68'),_0x7d2a('0x19')];if(!_[_0x7d2a('0x69')](_0x9657c0,_0x4727d3[_0x7d2a('0x6a')]()))throw new Error(_0x7d2a('0x6b'));return _0x4727d3['toLowerCase']();}function getFilteredAgentIds(_0x2fa948,_0x43acaf){var _0x2c8f86=_[_0x7d2a('0x6c')](_0x2fa948)?_0x2fa948:[_0x2fa948];var _0x4d6208=_['map'](_0x2c8f86,function(_0x1fbb85){return db[_0x43acaf][_0x7d2a('0x6d')]({'where':{'name':_0x1fbb85}})[_0x7d2a('0x15')](function(_0x6ea782){if(!_0x6ea782)return[];return _0x6ea782['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x7d2a('0x6e')](_0x4d6208)['then'](function(_0x22a85b){var _0x3588cc=_(_0x22a85b)[_0x7d2a('0x6f')]()['map']('id')['uniq']()[_0x7d2a('0x70')]();return _0x3588cc;});}function getUpdatedSortOptions(_0x44ec0e){var _0x2f86ef={'fields':[],'order':null};var _0x457980=_0x44ec0e[_0x7d2a('0x71')](',');_0x2f86ef[_0x7d2a('0x72')]=_['filter'](_0x457980,function(_0x478568){if(!_0x478568[_0x7d2a('0x69')]('globalStatus'))return!![];_0x2f86ef[_0x7d2a('0x73')]=_['startsWith'](_0x478568,'-')?_0x7d2a('0x74'):_0x7d2a('0x75');return![];});return _0x2f86ef;}function orderAgentsByStatus(_0x436594,_0x512008){return _0x436594[_0x7d2a('0x76')](function(_0x27298b,_0x4f188f){if(_0x27298b[_0x7d2a('0x77')]===_0x4f188f[_0x7d2a('0x77')]&&_0x27298b[_0x7d2a('0x77')]===_0x7d2a('0x5b')){if(_0x512008===_0x7d2a('0x74'))return(_0x27298b[_0x7d2a('0x78')]||'')<(_0x4f188f[_0x7d2a('0x78')]||'')?0x1:-0x1;return _0x27298b['pauseType']<_0x4f188f[_0x7d2a('0x78')]?-0x1:0x1;}else{if(_0x512008==='DESC')return _0x27298b[_0x7d2a('0x77')]<_0x4f188f[_0x7d2a('0x77')]?0x1:-0x1;return _0x27298b[_0x7d2a('0x77')]<_0x4f188f['globalStatus']?-0x1:0x1;}});}exports[_0x7d2a('0x79')]=function(_0x412c9d,_0x10fe5d){var _0x2c2c7e={'count':0x0,'rows':[]},_0x817479={},_0x4a712e,_0x2c9609,_0xec35d0,_0x50af26,_0x322e01=[_0x7d2a('0x7a'),_0x7d2a('0x47'),_0x7d2a('0x7b'),_0x7d2a('0x7c'),_0x7d2a('0x78'),_0x7d2a('0x7c'),_0x7d2a('0x42'),_0x7d2a('0x7d'),_0x7d2a('0x54'),_0x7d2a('0x57'),_0x7d2a('0x56'),'smsPause',_0x7d2a('0x58'),'faxPause',_0x7d2a('0x5a'),_0x7d2a('0x7e'),_0x7d2a('0x7f'),_0x7d2a('0x80'),_0x7d2a('0x81'),_0x7d2a('0x82'),_0x7d2a('0x83'),_0x7d2a('0x84'),'openchannelCurrentCapacity',_0x7d2a('0x85'),_0x7d2a('0x86'),_0x7d2a('0x87'),_0x7d2a('0x88'),'chatStatus',_0x7d2a('0x5f'),_0x7d2a('0x5e'),_0x7d2a('0x60'),_0x7d2a('0x61'),'faxStatus','voiceStatus',_0x7d2a('0x89'),_0x7d2a('0x8a'),_0x7d2a('0x8b'),_0x7d2a('0x8c'),_0x7d2a('0x8d'),_0x7d2a('0x8e'),_0x7d2a('0x8f'),_0x7d2a('0x3e'),_0x7d2a('0x90'),_0x7d2a('0x91'),_0x7d2a('0x92'),_0x7d2a('0x93'),_0x7d2a('0x94')],_0x54e343=[_0x7d2a('0x54'),_0x7d2a('0x57'),'mailPause',_0x7d2a('0x95'),_0x7d2a('0x58'),_0x7d2a('0x55'),_0x7d2a('0x5a'),_0x7d2a('0x47')];Promise['resolve']()['then'](function(){if(_0x412c9d['query']['channel'])_0x4a712e=validateChannel(_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x97')]);if(!_0x412c9d[_0x7d2a('0x96')]['sort']||!_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x76')][_0x7d2a('0x69')]('globalStatus'))return;var _0x4f1383=getUpdatedSortOptions(_0x412c9d[_0x7d2a('0x96')]['sort']);_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x76')]=_0x4f1383[_0x7d2a('0x72')][_0x7d2a('0x98')](',');_0x2c9609=_0x4f1383[_0x7d2a('0x73')];})[_0x7d2a('0x15')](function(){if(!_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x99')])return[];var _0x51e84b=_[_0x7d2a('0x1a')](_0x4a712e)+'Queue';return getFilteredAgentIds(_0x412c9d['query'][_0x7d2a('0x99')],_0x51e84b);})[_0x7d2a('0x15')](function(_0x4a3f76){var _0x1098ec=_[_0x7d2a('0x9a')](db[_0x7d2a('0x4a')][_0x7d2a('0x9b')],function(_0x1dfc9f){return{'name':_0x1dfc9f[_0x7d2a('0x9c')],'type':_0x1dfc9f[_0x7d2a('0x9d')][_0x7d2a('0x9e')]};});_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x9f')]='agent';_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x47')]=!![];_0x817479=qs[_0x7d2a('0xa0')](_0x1098ec,_0x412c9d);_0x817479[_0x7d2a('0xa1')]=!![];if(!_['isEmpty'](_0x4a3f76)){_0x817479[_0x7d2a('0xa2')]=_['merge'](_0x817479[_0x7d2a('0xa2')],{'$and':[{'id':{'$in':_0x4a3f76}}]});}else if(!_[_0x7d2a('0xa3')](_0x412c9d['query'][_0x7d2a('0x99')])){return _0x2c2c7e;}if(_0x412c9d[_0x7d2a('0xa4')][_0x7d2a('0x9f')]===_0x7d2a('0xa4')){var _0xe8cd51={'params':{'id':_0x412c9d[_0x7d2a('0xa4')][_0x7d2a('0xa5')]},'query':{'section':'Agents','role':_0x7d2a('0xa6'),'online':!![],'nolimit':_0x412c9d['query'][_0x7d2a('0xa7')],'sort':_0x412c9d[_0x7d2a('0x96')]['sort'],'filter':_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0x3d')],'raw':!![],'ids':_0x4a3f76}};return db[_0x7d2a('0xa8')][_0x7d2a('0xa9')](_0xe8cd51);}return db[_0x7d2a('0x4a')][_0x7d2a('0xaa')](_0x817479);})[_0x7d2a('0x15')](function(_0x2ecdb9){_0x2c2c7e[_0x7d2a('0x8')]=_0x2ecdb9['count'];_0xec35d0=_0x2ecdb9[_0x7d2a('0xab')];return getRealtimeAgents();})[_0x7d2a('0x15')](function(_0x5a834c){_0x50af26=_0x5a834c[_0x7d2a('0xab')];return _0xec35d0['map'](function(_0x391321){var _0x21768f=_[_0x7d2a('0x3b')](_0x50af26,['id',_0x391321['id']]);if(_0x21768f)_[_0x7d2a('0x18')](_0x391321,_[_0x7d2a('0x3c')](_[_0x7d2a('0xac')](_0x21768f,_0x54e343),_0x322e01));_0x391321[_0x7d2a('0x77')]=getAgentStatus(_0x391321);return _0x391321;});})['then'](function(_0x38c7e6){var _0x3b64e8;if(_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0xad')]){_0x3b64e8=_['filter'](_0x38c7e6,[_0x7d2a('0x77'),_0x412c9d['query'][_0x7d2a('0xad')]]);if(_0x412c9d[_0x7d2a('0x96')][_0x7d2a('0xae')]){_0x3b64e8=_[_0x7d2a('0x3d')](_0x3b64e8,[_0x7d2a('0x78'),_0x412c9d['query'][_0x7d2a('0xae')]]);}}if(_0x3b64e8)_0x38c7e6=_0x3b64e8;if(!_0x2c9609)return _0x38c7e6;return orderAgentsByStatus(_0x38c7e6,_0x2c9609);})[_0x7d2a('0x15')](function(_0x5e4414){_0x2c2c7e['rows']=_0x5e4414;return _0x2c2c7e;})['then'](respondWithFilteredResult(_0x10fe5d,_0x817479))[_0x7d2a('0x1d')](handleError(_0x10fe5d,null));};exports[_0x7d2a('0xaf')]=function(_0x77e9ae,_0x11eda3){var _0x2b6a06={'count':0x0,'rows':[]},_0x1f77ba={},_0x364a8a,_0x37d7d6,_0x307dbb,_0x4b5390,_0x400499;Promise[_0x7d2a('0xb0')]()[_0x7d2a('0x15')](function(){if(_0x77e9ae['query'][_0x7d2a('0x97')])_0x364a8a=validateChannel(_0x77e9ae['query']['channel']);var _0x4af2ad=_[_0x7d2a('0x1a')](_0x364a8a)+_0x7d2a('0x4b');var _0xdcc4ff=_['map'](db[_0x4af2ad][_0x7d2a('0x9b')],function(_0x1f143e){return{'name':_0x1f143e[_0x7d2a('0x9c')],'type':_0x1f143e[_0x7d2a('0x9d')][_0x7d2a('0x9e')]};});_0x1f77ba=qs[_0x7d2a('0xa0')](_0xdcc4ff,_0x77e9ae);if(_0x77e9ae[_0x7d2a('0xa4')][_0x7d2a('0x9f')]==='user'){var _0x46fa22={'params':{'id':_0x77e9ae[_0x7d2a('0xa4')][_0x7d2a('0xa5')]},'query':{'section':_0x364a8a===_0x7d2a('0x19')&&_0x77e9ae[_0x7d2a('0x96')][_0x7d2a('0x9d')]==='outbound'?'QueueCampaigns':_[_0x7d2a('0x1a')](_0x364a8a)+_0x7d2a('0x1b'),'type':_0x77e9ae[_0x7d2a('0x96')][_0x7d2a('0x9d')],'nolimit':!![],'sort':_0x7d2a('0x11'),'filter':_0x77e9ae[_0x7d2a('0x96')]['filter']}};return db['UserProfile']['getResources'](_0x46fa22);}return db[_0x4af2ad][_0x7d2a('0xaa')](_0x1f77ba);})[_0x7d2a('0x15')](function(_0x40e542){_0x2b6a06['count']=_0x40e542['count'];_0x37d7d6=_0x40e542[_0x7d2a('0xab')];return getRealtimeQueues(_0x77e9ae,_0x364a8a);})['then'](function(_0x4ce0d4){_0x4b5390=_0x4ce0d4['rows'];return getRealtimeAgents();})['then'](function(_0x54b809){_0x307dbb=_0x54b809[_0x7d2a('0xab')];if(_0x364a8a!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x7d2a('0x15')](function(_0x3bf057){_0x400499=_0x3bf057?_0x3bf057[_0x7d2a('0xab')]:[];return initializeQueues(_0x37d7d6,_0x4b5390,_0x364a8a,_0x77e9ae[_0x7d2a('0x96')][_0x7d2a('0x9d')]);})['then'](function(_0x3afb3f){var _0x4662ad=_0x3afb3f[_0x7d2a('0x9a')](function(_0x511960){if(_0x364a8a===_0x7d2a('0x19'))return getVoiceQueueAgents(_0x511960,_0x37d7d6,_0x307dbb,_0x400499);else return getQueueAgents(_0x511960,_0x307dbb,_0x364a8a);});return Promise[_0x7d2a('0x6e')](_0x4662ad);})[_0x7d2a('0x15')](function(_0x43fd91){_0x2b6a06[_0x7d2a('0xab')]=_0x43fd91;return _0x2b6a06;})[_0x7d2a('0x15')](respondWithFilteredResult(_0x11eda3,_0x1f77ba))[_0x7d2a('0x1d')](handleError(_0x11eda3,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 634ac1c..9c3cf4b 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3f415c,_0x310f72){var _0x8f2df8=function(_0x3e7afe){while(--_0x3e7afe){_0x3f415c['push'](_0x3f415c['shift']());}};_0x8f2df8(++_0x310f72);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4c3ac3,_0x7177d8){var _0xd7ff02=function(_0x5b9ac8){while(--_0x5b9ac8){_0x4c3ac3['push'](_0x4c3ac3['shift']());}};_0xd7ff02(++_0x7177d8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e1d9a9f..7f1dae3 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 _0xaf1b=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x281ee8,_0x27acb7){var _0x2c11cc=function(_0x5f11d4){while(--_0x5f11d4){_0x281ee8['push'](_0x281ee8['shift']());}};_0x2c11cc(++_0x27acb7);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x293b70,_0x3b4ab2){_0x293b70=_0x293b70-0x0;var _0x31697b=_0xaf1b[_0x293b70];return _0x31697b;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'state':{'type':Sequelize[_0xbaf1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbaf1('0x3')]},'scheduledat':{'type':Sequelize[_0xbaf1('0x4')]},'uniqueid':{'type':Sequelize[_0xbaf1('0x3')]},'starttime':{'type':Sequelize[_0xbaf1('0x4')]},'responsetime':{'type':Sequelize[_0xbaf1('0x4')]},'ringtime':{'type':Sequelize[_0xbaf1('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xbaf1('0x3')]},'campaigntype':{'type':Sequelize[_0xbaf1('0x3')]},'membername':{'type':Sequelize[_0xbaf1('0x3')]}}; \ No newline at end of file +var _0x9aac=['DATE','sequelize','INTEGER','STRING'];(function(_0x25edea,_0x1fc36a){var _0x4d59dc=function(_0x3662b9){while(--_0x3662b9){_0x25edea['push'](_0x25edea['shift']());}};_0x4d59dc(++_0x1fc36a);}(_0x9aac,0x135));var _0xc9aa=function(_0x173afd,_0x45b4d7){_0x173afd=_0x173afd-0x0;var _0x5c43d7=_0x9aac[_0x173afd];return _0x5c43d7;};'use strict';var Sequelize=require(_0xc9aa('0x0'));module['exports']={'state':{'type':Sequelize[_0xc9aa('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9aa('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc9aa('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc9aa('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc9aa('0x2')]},'campaigntype':{'type':Sequelize[_0xc9aa('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c98502f..82d4542 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 _0xc4f6=['define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x855676,_0x130028){var _0xcbcac0=function(_0x5206a6){while(--_0x5206a6){_0x855676['push'](_0x855676['shift']());}};_0xcbcac0(++_0x130028);}(_0xc4f6,0x16f));var _0x6c4f=function(_0x27c2f0,_0x2a12e1){_0x27c2f0=_0x27c2f0-0x0;var _0x110cd0=_0xc4f6[_0x27c2f0];return _0x110cd0;};'use strict';var _=require(_0x6c4f('0x0'));var util=require(_0x6c4f('0x1'));var logger=require(_0x6c4f('0x2'))(_0x6c4f('0x3'));var moment=require(_0x6c4f('0x4'));var BPromise=require('bluebird');var rp=require(_0x6c4f('0x5'));var fs=require('fs');var path=require(_0x6c4f('0x6'));var rimraf=require(_0x6c4f('0x7'));var config=require(_0x6c4f('0x8'));var attributes=require(_0x6c4f('0x9'));module['exports']=function(_0x4926b9,_0xb73e01){return _0x4926b9[_0x6c4f('0xa')](_0x6c4f('0xb'),attributes,{'tableName':_0x6c4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa06=['bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api'];(function(_0x1f9702,_0xaf550d){var _0x51ce2c=function(_0x15afd1){while(--_0x15afd1){_0x1f9702['push'](_0x1f9702['shift']());}};_0x51ce2c(++_0xaf550d);}(_0xaa06,0x171));var _0x6aa0=function(_0x1a155d,_0x252167){_0x1a155d=_0x1a155d-0x0;var _0x27e817=_0xaa06[_0x1a155d];return _0x27e817;};'use strict';var _=require(_0x6aa0('0x0'));var util=require('util');var logger=require(_0x6aa0('0x1'))(_0x6aa0('0x2'));var moment=require('moment');var BPromise=require(_0x6aa0('0x3'));var rp=require(_0x6aa0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6aa0('0x5'));var config=require(_0x6aa0('0x6'));var attributes=require(_0x6aa0('0x7'));module[_0x6aa0('0x8')]=function(_0x2448af,_0x32e36f){return _0x2448af[_0x6aa0('0x9')](_0x6aa0('0xa'),attributes,{'tableName':_0x6aa0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index bd4584b..c991916 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 _0xb760=['result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2733d2,_0x315770){var _0xf53cc3=function(_0x1c979b){while(--_0x1c979b){_0x2733d2['push'](_0x2733d2['shift']());}};_0xf53cc3(++_0x315770);}(_0xb760,0x171));var _0x0b76=function(_0x27e460,_0xee1cfc){_0x27e460=_0x27e460-0x0;var _0x1ee6f8=_0xb760[_0x27e460];return _0x1ee6f8;};'use strict';var _=require(_0x0b76('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b76('0x1'));var rs=require(_0x0b76('0x2'));var fs=require('fs');var Redis=require(_0x0b76('0x3'));var db=require(_0x0b76('0x4'))['db'];var utils=require(_0x0b76('0x5'));var logger=require(_0x0b76('0x6'))(_0x0b76('0x7'));var config=require(_0x0b76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0b76('0x9')][_0x0b76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3edd19,_0x2df881,_0x5da043){return new BPromise(function(_0x3262e7,_0x30e95d){return client[_0x0b76('0xb')](_0x3edd19,_0x5da043)[_0x0b76('0xc')](function(_0x2b8e85){logger[_0x0b76('0xd')](_0x0b76('0xe'),_0x2df881,'request\x20sent');logger[_0x0b76('0xf')](_0x0b76('0x10'),_0x2df881,_0x0b76('0x11'),JSON['stringify'](_0x2b8e85));if(_0x2b8e85[_0x0b76('0x12')]){if(_0x2b8e85[_0x0b76('0x12')][_0x0b76('0x13')]===0x1f4){logger[_0x0b76('0x12')](_0x0b76('0xe'),_0x2df881,_0x2b8e85['error'][_0x0b76('0x14')]);return _0x30e95d(_0x2b8e85['error'][_0x0b76('0x14')]);}logger[_0x0b76('0x12')](_0x0b76('0xe'),_0x2df881,_0x2b8e85['error'][_0x0b76('0x14')]);return _0x3262e7(_0x2b8e85[_0x0b76('0x12')][_0x0b76('0x14')]);}else{logger['info'](_0x0b76('0xe'),_0x2df881,_0x0b76('0x11'));_0x3262e7(_0x2b8e85[_0x0b76('0x15')]['message']);}})[_0x0b76('0x16')](function(_0x3ebd1c){logger[_0x0b76('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x2df881,_0x3ebd1c);_0x30e95d(_0x3ebd1c);});});}exports[_0x0b76('0x17')]=function(_0x4be154){var _0x3ff10c=this;return new Promise(function(_0x281e28,_0x258cee){return db[_0x0b76('0x18')][_0x0b76('0x19')](_0x4be154[_0x0b76('0x1a')],{'raw':_0x4be154[_0x0b76('0x1b')]?_0x4be154[_0x0b76('0x1b')][_0x0b76('0x1c')]===undefined?!![]:![]:!![]})[_0x0b76('0xc')](function(_0x3ab1f9){logger[_0x0b76('0xd')](_0x0b76('0x17'),_0x4be154);logger[_0x0b76('0xf')]('CreateReportAgentPreview',_0x4be154,JSON[_0x0b76('0x1d')](_0x3ab1f9));_0x281e28(_0x3ab1f9);})[_0x0b76('0x16')](function(_0x51dc41){logger[_0x0b76('0x12')](_0x0b76('0x17'),_0x51dc41[_0x0b76('0x14')],_0x4be154);_0x258cee(_0x3ff10c[_0x0b76('0x12')](0x1f4,_0x51dc41[_0x0b76('0x14')]));});});}; \ No newline at end of file +var _0x7592=['info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3b6873,_0x5eef7f){var _0x322c5e=function(_0x187a5b){while(--_0x187a5b){_0x3b6873['push'](_0x3b6873['shift']());}};_0x322c5e(++_0x5eef7f);}(_0x7592,0x85));var _0x2759=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x7592[_0x324012];return _0x435cf2;};'use strict';var _=require('lodash');var util=require(_0x2759('0x0'));var moment=require(_0x2759('0x1'));var BPromise=require('bluebird');var rs=require(_0x2759('0x2'));var fs=require('fs');var Redis=require(_0x2759('0x3'));var db=require(_0x2759('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2759('0x5'))(_0x2759('0x6'));var config=require(_0x2759('0x7'));var jayson=require(_0x2759('0x8'));var client=jayson[_0x2759('0x9')][_0x2759('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a48da,_0x43a80a,_0x21eca8){return new BPromise(function(_0x48982f,_0x13767d){return client['request'](_0x3a48da,_0x21eca8)[_0x2759('0xb')](function(_0x22d654){logger[_0x2759('0xc')](_0x2759('0xd'),_0x43a80a,_0x2759('0xe'));logger[_0x2759('0xf')](_0x2759('0x10'),_0x43a80a,_0x2759('0xe'),JSON[_0x2759('0x11')](_0x22d654));if(_0x22d654['error']){if(_0x22d654[_0x2759('0x12')][_0x2759('0x13')]===0x1f4){logger[_0x2759('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x43a80a,_0x22d654[_0x2759('0x12')][_0x2759('0x14')]);return _0x13767d(_0x22d654[_0x2759('0x12')][_0x2759('0x14')]);}logger[_0x2759('0x12')](_0x2759('0xd'),_0x43a80a,_0x22d654[_0x2759('0x12')][_0x2759('0x14')]);return _0x48982f(_0x22d654[_0x2759('0x12')][_0x2759('0x14')]);}else{logger[_0x2759('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x43a80a,_0x2759('0xe'));_0x48982f(_0x22d654[_0x2759('0x15')]['message']);}})[_0x2759('0x16')](function(_0x21e3d7){logger['error'](_0x2759('0xd'),_0x43a80a,_0x21e3d7);_0x13767d(_0x21e3d7);});});}exports[_0x2759('0x17')]=function(_0x1a4648){var _0x35701a=this;return new Promise(function(_0x4fd3ee,_0x420bcc){return db[_0x2759('0x18')][_0x2759('0x19')](_0x1a4648[_0x2759('0x1a')],{'raw':_0x1a4648['options']?_0x1a4648[_0x2759('0x1b')][_0x2759('0x1c')]===undefined?!![]:![]:!![]})[_0x2759('0xb')](function(_0x16e252){logger[_0x2759('0xc')](_0x2759('0x17'),_0x1a4648);logger[_0x2759('0xf')](_0x2759('0x17'),_0x1a4648,JSON[_0x2759('0x11')](_0x16e252));_0x4fd3ee(_0x16e252);})[_0x2759('0x16')](function(_0x44cae0){logger[_0x2759('0x12')](_0x2759('0x17'),_0x44cae0[_0x2759('0x14')],_0x1a4648);_0x420bcc(_0x35701a[_0x2759('0x12')](0x1f4,_0x44cae0[_0x2759('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 094fa92..1511d54 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 _0xbaf4=['sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x47abbc,_0x5a8c7a){var _0x55a157=function(_0x1e3f32){while(--_0x1e3f32){_0x47abbc['push'](_0x47abbc['shift']());}};_0x55a157(++_0x5a8c7a);}(_0xbaf4,0x13f));var _0x4baf=function(_0x1d80c9,_0x3c5a56){_0x1d80c9=_0x1d80c9-0x0;var _0x2bd6b4=_0xbaf4[_0x1d80c9];return _0x2bd6b4;};'use strict';var multer=require(_0x4baf('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x4baf('0x1'));router[_0x4baf('0x2')](_0x4baf('0x3'),auth['isAuthenticated'](),controller[_0x4baf('0x4')]);router['get'](_0x4baf('0x5'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x7')]);router['get'](_0x4baf('0x8'),auth['isAuthenticated'](),controller[_0x4baf('0x9')]);router[_0x4baf('0x2')](_0x4baf('0xa'),auth[_0x4baf('0x6')](),controller['voiceQueues']);router['get'](_0x4baf('0xb'),auth['isAuthenticated'](),controller[_0x4baf('0xc')]);router[_0x4baf('0x2')](_0x4baf('0xd'),auth[_0x4baf('0x6')](),controller[_0x4baf('0xe')]);router[_0x4baf('0x2')]('/mail/accounts',auth[_0x4baf('0x6')](),controller[_0x4baf('0xf')]);router[_0x4baf('0x2')](_0x4baf('0x10'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get']('/sms/queues',auth[_0x4baf('0x6')](),controller[_0x4baf('0x11')]);router[_0x4baf('0x2')](_0x4baf('0x12'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x13')]);router['get']('/fax/queues',auth[_0x4baf('0x6')](),controller[_0x4baf('0x14')]);router[_0x4baf('0x2')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x4baf('0x15')]);router['get'](_0x4baf('0x16'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x17')]);router[_0x4baf('0x2')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x4baf('0x18')]);router['get'](_0x4baf('0x19'),auth['isAuthenticated'](),controller[_0x4baf('0x1a')]);router[_0x4baf('0x2')](_0x4baf('0x1b'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x1c')]);router[_0x4baf('0x2')](_0x4baf('0x1d'),auth['isAuthenticated'](),controller[_0x4baf('0x1e')]);router[_0x4baf('0x1f')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x4baf('0x20')]);router[_0x4baf('0x2')]('/outbound',auth[_0x4baf('0x6')](),controller[_0x4baf('0x21')]);router[_0x4baf('0x2')](_0x4baf('0x22'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x23')]);router[_0x4baf('0x2')](_0x4baf('0x24'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x25')]);router[_0x4baf('0x1f')](_0x4baf('0x26'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x27')]);router['get'](_0x4baf('0x28'),auth['isAuthenticated'](),controller['telephones']);router[_0x4baf('0x2')](_0x4baf('0x29'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x2a')]);router[_0x4baf('0x2')](_0x4baf('0x2b'),auth['isAuthenticated'](),controller['campaigns']);router[_0x4baf('0x2')](_0x4baf('0x2c'),auth[_0x4baf('0x6')](),controller['faxAccounts']);router[_0x4baf('0x2')](_0x4baf('0x2d'),auth[_0x4baf('0x6')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x4baf('0x2e'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x2f')]);router['get'](_0x4baf('0x30'),auth['isAuthenticated'](),controller[_0x4baf('0x31')]);router[_0x4baf('0x2')](_0x4baf('0x32'),auth['isAuthenticated'](),controller[_0x4baf('0x33')]);router[_0x4baf('0x2')](_0x4baf('0x34'),auth[_0x4baf('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x4baf('0x2')](_0x4baf('0x35'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x36')]);router['get'](_0x4baf('0x37'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x38')]);router[_0x4baf('0x39')]('/mail/queues/:id/notify',auth[_0x4baf('0x6')](),controller['queueNotify'](_0x4baf('0x3a')));router[_0x4baf('0x2')]('/mail/queues/:id',auth[_0x4baf('0x6')](),controller['showMailQueues']);router[_0x4baf('0x39')](_0x4baf('0x3b'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x3c')](_0x4baf('0x3d')));router[_0x4baf('0x2')]('/chat/queues/:id',auth[_0x4baf('0x6')](),controller[_0x4baf('0x3e')]);router[_0x4baf('0x39')](_0x4baf('0x3f'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x3c')](_0x4baf('0x40')));router[_0x4baf('0x2')](_0x4baf('0x41'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x42')]);router[_0x4baf('0x39')](_0x4baf('0x43'),auth['isAuthenticated'](),controller[_0x4baf('0x3c')](_0x4baf('0x44')));router['get']('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x4baf('0x45')]);router[_0x4baf('0x39')](_0x4baf('0x46'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x3c')](_0x4baf('0x47')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x4baf('0x3c')](_0x4baf('0x48')));router[_0x4baf('0x2')](_0x4baf('0x49'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x4a')]);router[_0x4baf('0x2')](_0x4baf('0x4b'),auth[_0x4baf('0x6')](),controller[_0x4baf('0x4c')]);router[_0x4baf('0x39')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x4baf('0x4d')]);module['exports']=router; \ No newline at end of file +var _0x2ac8=['chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0x925d57,_0x348cee){var _0x5a3dbd=function(_0x598bb2){while(--_0x598bb2){_0x925d57['push'](_0x925d57['shift']());}};_0x5a3dbd(++_0x348cee);}(_0x2ac8,0x1d8));var _0x82ac=function(_0x57d08e,_0x180598){_0x57d08e=_0x57d08e-0x0;var _0x59f113=_0x2ac8[_0x57d08e];return _0x59f113;};'use strict';var multer=require(_0x82ac('0x0'));var util=require('util');var path=require(_0x82ac('0x1'));var express=require(_0x82ac('0x2'));var router=express[_0x82ac('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x82ac('0x4')](_0x82ac('0x5'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x7')]);router[_0x82ac('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x82ac('0x6')](),controller['voiceChannelMixMonitor']);router[_0x82ac('0x4')](_0x82ac('0x8'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x9')]);router['get']('/voice/queues',auth[_0x82ac('0x6')](),controller[_0x82ac('0xa')]);router['get'](_0x82ac('0xb'),auth[_0x82ac('0x6')](),controller[_0x82ac('0xc')]);router['get'](_0x82ac('0xd'),auth[_0x82ac('0x6')](),controller['mailQueues']);router[_0x82ac('0x4')]('/mail/accounts',auth[_0x82ac('0x6')](),controller[_0x82ac('0xe')]);router['get'](_0x82ac('0xf'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x82ac('0x4')](_0x82ac('0x10'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x11')]);router[_0x82ac('0x4')](_0x82ac('0x12'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x82ac('0x4')](_0x82ac('0x13'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x14')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x82ac('0x15')]);router['get'](_0x82ac('0x16'),auth['isAuthenticated'](),controller[_0x82ac('0x17')]);router['get'](_0x82ac('0x18'),auth['isAuthenticated'](),controller[_0x82ac('0x19')]);router[_0x82ac('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x82ac('0x6')](),controller[_0x82ac('0x1a')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x82ac('0x6')](),controller[_0x82ac('0x1b')]);router[_0x82ac('0x4')](_0x82ac('0x1c'),auth[_0x82ac('0x6')](),controller['showVoiceQueues']);router[_0x82ac('0x1d')](_0x82ac('0x1c'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x1e')]);router[_0x82ac('0x4')]('/outbound',auth[_0x82ac('0x6')](),controller['outbound']);router[_0x82ac('0x4')](_0x82ac('0x1f'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x20')]);router[_0x82ac('0x4')]('/agents',auth[_0x82ac('0x6')](),controller[_0x82ac('0x21')]);router[_0x82ac('0x1d')](_0x82ac('0x22'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x23')]);router[_0x82ac('0x4')](_0x82ac('0x24'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x25')]);router[_0x82ac('0x4')](_0x82ac('0x26'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x27')]);router[_0x82ac('0x4')](_0x82ac('0x28'),auth['isAuthenticated'](),controller['campaigns']);router[_0x82ac('0x4')](_0x82ac('0x29'),auth['isAuthenticated'](),controller[_0x82ac('0x2a')]);router[_0x82ac('0x4')](_0x82ac('0x2b'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x2c')]);router[_0x82ac('0x4')]('/mail/queues/waitinginteractions',auth[_0x82ac('0x6')](),controller[_0x82ac('0x2d')]);router[_0x82ac('0x4')](_0x82ac('0x2e'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x2f')]);router['get'](_0x82ac('0x30'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth[_0x82ac('0x6')](),controller[_0x82ac('0x31')]);router['get'](_0x82ac('0x32'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x33')]);router[_0x82ac('0x4')](_0x82ac('0x34'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x35')]);router[_0x82ac('0x36')](_0x82ac('0x37'),auth['isAuthenticated'](),controller[_0x82ac('0x38')](_0x82ac('0x39')));router[_0x82ac('0x4')](_0x82ac('0x3a'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x3b')]);router['post']('/chat/queues/:id/notify',auth[_0x82ac('0x6')](),controller[_0x82ac('0x38')](_0x82ac('0x3c')));router[_0x82ac('0x4')](_0x82ac('0x3d'),auth[_0x82ac('0x6')](),controller['showChatQueues']);router[_0x82ac('0x36')](_0x82ac('0x3e'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x38')](_0x82ac('0x3f')));router[_0x82ac('0x4')](_0x82ac('0x40'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x41')]);router[_0x82ac('0x36')]('/openchannel/queues/:id/notify',auth[_0x82ac('0x6')](),controller[_0x82ac('0x38')]('openchannel'));router[_0x82ac('0x4')](_0x82ac('0x42'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x43')]);router['post'](_0x82ac('0x44'),auth[_0x82ac('0x6')](),controller['queueNotify']('sms'));router[_0x82ac('0x36')](_0x82ac('0x45'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x38')](_0x82ac('0x46')));router[_0x82ac('0x4')](_0x82ac('0x47'),auth[_0x82ac('0x6')](),controller[_0x82ac('0x48')]);router['get'](_0x82ac('0x49'),auth['isAuthenticated'](),controller[_0x82ac('0x4a')]);router[_0x82ac('0x36')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x82ac('0x4b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6044239..11e9ef7 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 _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xac9d,0x14d));var _0xdac9=function(_0x9f48e6,_0x8f87aa){_0x9f48e6=_0x9f48e6-0x0;var _0x45fc5c=_0xac9d[_0x9f48e6];return _0x45fc5c;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file +var _0x5d17=['whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment','../../mysqldb','../../config/logger','api','client','http','code','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions'];(function(_0x243b15,_0x4a71c5){var _0xc3dfe4=function(_0x5549b5){while(--_0x5549b5){_0x243b15['push'](_0x243b15['shift']());}};_0xc3dfe4(++_0x4a71c5);}(_0x5d17,0x114));var _0x75d1=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x5d17[_0x9adcd6];return _0xdf8ff2;};'use strict';var BPromise=require(_0x75d1('0x0'));var moment=require(_0x75d1('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x75d1('0x2'))['db'];var logger=require(_0x75d1('0x3'))(_0x75d1('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x75d1('0x5')][_0x75d1('0x6')]({'port':0x232a});var mailClient=jayson[_0x75d1('0x5')][_0x75d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x75d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){var _0xf9f8e=_0x1ee61b?_0x1ee61b:amiClient;return _0xf9f8e['request'](_0x116a51,_0x5c957a)['then'](function(_0x40df40){if(_0x40df40['error']){if(_0x40df40['error'][_0x75d1('0x7')]===0x1f4){return _0x105607(_0x40df40[_0x75d1('0x8')]['message']);}return _0x3a9d5e(_0x40df40[_0x75d1('0x8')][_0x75d1('0x9')]);}else{_0x3a9d5e(_0x40df40[_0x75d1('0xa')]);}})[_0x75d1('0xb')](function(_0x6c1265){_0x105607(_0x6c1265);});});}function respondWithResult(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xc8;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0xc')](_0x49667a)[_0x75d1('0xd')](_0x19e825);}return _0xd089cf[_0x75d1('0xe')](0x194);};}function handleError(_0x49d723,_0x553697){_0x553697=_0x553697||0x1f4;return function(_0x55b8a0){logger[_0x75d1('0x8')](_0x55b8a0[_0x75d1('0xf')]);if(_0x55b8a0[_0x75d1('0x10')]){delete _0x55b8a0['name'];}_0x49d723[_0x75d1('0xc')](_0x553697)[_0x75d1('0x11')](_0x55b8a0);};}function findById(_0x1d30f3){return function(_0x269e82){if(!_[_0x75d1('0x12')](_0x1d30f3)&&!_[_0x75d1('0x12')](_0x269e82)&&!_[_0x75d1('0x12')](_0x269e82[_0x75d1('0x13')])){return _[_0x75d1('0x14')](_0x269e82[_0x75d1('0x13')],function(_0x2c2a6d){return _0x2c2a6d['id']==_0x1d30f3;});}return null;};}exports['voiceChannels']=function(_0x493fff,_0xc6b282){return respondWithRpcPromise(_0x75d1('0x15'),_0x493fff['query'])[_0x75d1('0x16')](respondWithResult(_0xc6b282,null))[_0x75d1('0xb')](handleError(_0xc6b282,null));};exports[_0x75d1('0x17')]=function(_0xf6cc70,_0xa42dbe){return respondWithRpcPromise(_0x75d1('0x18'),_['merge'](_0xf6cc70[_0x75d1('0x19')],_0xf6cc70[_0x75d1('0x1a')]))['then'](respondWithResult(_0xa42dbe,null))[_0x75d1('0xb')](handleError(_0xa42dbe,null));};exports[_0x75d1('0x1b')]=function(_0x526f6c,_0x2c0c21){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x75d1('0x1c')](_0x526f6c[_0x75d1('0x19')],_0x526f6c[_0x75d1('0x1a')]))['then'](respondWithResult(_0x2c0c21,null))['catch'](handleError(_0x2c0c21,null));};exports[_0x75d1('0x1d')]=function(_0x45b18f,_0x315ce5){return respondWithRpcPromise(_0x75d1('0x1e'),_0x45b18f['query'])[_0x75d1('0x16')](respondWithResult(_0x315ce5,null))[_0x75d1('0xb')](handleError(_0x315ce5,null));};exports[_0x75d1('0x1f')]=function(_0x51138e,_0x54095d){return respondWithRpcPromise('VoiceQueues',_0x51138e[_0x75d1('0x19')])[_0x75d1('0x16')](findById(_0x51138e[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x54095d,null))[_0x75d1('0xb')](handleError(_0x54095d,null));};exports['updateVoiceQueue']=function(_0x4d292e,_0x410e16){return respondWithRpcPromise(_0x75d1('0x20'),_['merge'](_0x4d292e[_0x75d1('0x21')],_0x4d292e['params']))[_0x75d1('0x16')](respondWithResult(_0x410e16,null))[_0x75d1('0xb')](handleError(_0x410e16,null));};exports[_0x75d1('0x22')]=function(_0x3fb7b9,_0x36ae86){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x75d1('0x1c')](_0x3fb7b9[_0x75d1('0x19')],_0x3fb7b9[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x36ae86,null))['catch'](handleError(_0x36ae86,null));};exports[_0x75d1('0x23')]=function(_0x551824,_0x1b2bbb){return respondWithRpcPromise(_0x75d1('0x24'),_0x551824['query'])[_0x75d1('0x16')](respondWithResult(_0x1b2bbb,null))[_0x75d1('0xb')](handleError(_0x1b2bbb,null));};exports[_0x75d1('0x25')]=function(_0x100a4b,_0x22b190){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x75d1('0x1c')](_0x100a4b[_0x75d1('0x19')],_0x100a4b[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x22b190,null))['catch'](handleError(_0x22b190,null));};exports['voiceQueuesChannelHangup']=function(_0x551723,_0x3d9275){return respondWithRpcPromise(_0x75d1('0x26'),_[_0x75d1('0x1c')](_0x551723[_0x75d1('0x19')],_0x551723[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x3d9275,null))[_0x75d1('0xb')](handleError(_0x3d9275,null));};exports[_0x75d1('0x27')]=function(_0x433092,_0x534511){return respondWithRpcPromise(_0x75d1('0x28'),_[_0x75d1('0x1c')](_0x433092[_0x75d1('0x19')],_0x433092[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x534511,null))['catch'](handleError(_0x534511,null));};exports['outbound']=function(_0x487431,_0x1058b7){return respondWithRpcPromise(_0x75d1('0x29'),_0x487431[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x1058b7,null))[_0x75d1('0xb')](handleError(_0x1058b7,null));};exports[_0x75d1('0x2a')]=function(_0x48f9f3,_0x5553b9){return respondWithRpcPromise('OutboundChannels',_0x48f9f3[_0x75d1('0x19')])['then'](respondWithResult(_0x5553b9,null))['catch'](handleError(_0x5553b9,null));};exports[_0x75d1('0x2b')]=function(_0x21bfd8,_0x45eea3){var _0x46854c;return respondWithRpcPromise('Agents',_0x21bfd8[_0x75d1('0x19')])[_0x75d1('0x16')](function(_0x38bf47){_0x46854c=_0x38bf47;return respondWithRpcPromise(_0x75d1('0x2c'),_0x21bfd8[_0x75d1('0x19')],routingClient);})[_0x75d1('0x16')](function(_0x33df05){return _[_0x75d1('0x1c')]({},_0x33df05,_0x46854c);})[_0x75d1('0x16')](respondWithResult(_0x45eea3,null))[_0x75d1('0xb')](handleError(_0x45eea3,null));};exports[_0x75d1('0x2d')]=function(_0x93922f,_0xe14be9){if(_0x93922f[_0x75d1('0x21')]&&_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')]&&_0x93922f[_0x75d1('0x2f')]&&_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')]){for(var _0x2384aa in _0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')]){if(_0x93922f['body']['interaction'][_0x75d1('0x30')](_0x2384aa)){db[_0x75d1('0x31')][_0x75d1('0x32')]({'where':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')]['name'],'type':_0x75d1('0x33'),'exitAt':null,'uniqueid':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa]&&_0x93922f[_0x75d1('0x21')]['interaction'][_0x2384aa][_0x75d1('0x34')]?{'$notIn':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa]}:{'$ne':null}}})[_0x75d1('0x16')](function(_0x5b486d){var _0x34d132=moment()['format'](_0x75d1('0x35'));for(var _0x1d063d=0x0,_0x9bc1ed=_0x5b486d[_0x75d1('0x34')];_0x1d063d<_0x9bc1ed;_0x1d063d+=0x1){_0x5b486d[_0x1d063d][_0x75d1('0x36')]({'exitAt':_0x34d132});}});for(var _0x2137e1=0x0;_0x2137e1<_0x93922f['body'][_0x75d1('0x2e')][_0x2384aa]['length'];_0x2137e1+=0x1){db['MemberReport'][_0x75d1('0x37')]({'where':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')],'type':_0x75d1('0x33'),'uniqueid':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa][_0x2137e1],'exitAt':null},'defaults':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')]['name'],'interface':_['isNil'](_0x93922f[_0x75d1('0x2f')][_0x75d1('0x38')])?util['format'](_0x75d1('0x39'),_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')]):_0x93922f['user'][_0x75d1('0x38')],'type':_0x75d1('0x33'),'enterAt':moment()[_0x75d1('0x3a')](_0x75d1('0x35')),'role':_0x75d1('0x3b'),'internal':_0x93922f[_0x75d1('0x2f')][_0x75d1('0x3c')],'uniqueid':_0x93922f['body'][_0x75d1('0x2e')][_0x2384aa][_0x2137e1]}});}}}}return respondWithRpcPromise(_0x75d1('0x3d'),{'id':_0x93922f[_0x75d1('0x1a')]['id'],'capacity':_0x93922f[_0x75d1('0x21')][_0x75d1('0x3e')]},routingClient)[_0x75d1('0x16')](respondWithResult(_0xe14be9,null))[_0x75d1('0xb')](handleError(_0xe14be9,null));};exports['telephones']=function(_0x7da202,_0x3af9c5){return respondWithRpcPromise(_0x75d1('0x3f'),_0x7da202['query'])[_0x75d1('0x16')](respondWithResult(_0x3af9c5,null))[_0x75d1('0xb')](handleError(_0x3af9c5,null));};exports[_0x75d1('0x40')]=function(_0x382760,_0x281123){return respondWithRpcPromise(_0x75d1('0x41'),_0x382760['query'])[_0x75d1('0x16')](respondWithResult(_0x281123,null))[_0x75d1('0xb')](handleError(_0x281123,null));};exports[_0x75d1('0x42')]=function(_0x46e665,_0x2e746a){return respondWithRpcPromise(_0x75d1('0x43'),_0x46e665[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x2e746a,null))[_0x75d1('0xb')](handleError(_0x2e746a,null));};exports[_0x75d1('0x44')]=function(_0x1038d2,_0x13050e){return respondWithRpcPromise('ChatQueues',_0x1038d2['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x13050e,null))['catch'](handleError(_0x13050e,null));};exports[_0x75d1('0x45')]=function(_0x1e149b,_0x5dcb55){return respondWithRpcPromise(_0x75d1('0x46'),_0x1e149b[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](findById(_0x1e149b[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x5dcb55,null))[_0x75d1('0xb')](handleError(_0x5dcb55,null));};exports[_0x75d1('0x47')]=function(_0x5048ef,_0x3c5da6){return respondWithRpcPromise(_0x75d1('0x48'),_0x5048ef[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x3c5da6,null))[_0x75d1('0xb')](handleError(_0x3c5da6,null));};exports[_0x75d1('0x49')]=function(_0x41f98f,_0x3b30fb){return respondWithRpcPromise(_0x75d1('0x48'),_0x41f98f[_0x75d1('0x19')],routingClient)['then'](findById(_0x41f98f['params']['id']))[_0x75d1('0x16')](respondWithResult(_0x3b30fb,null))[_0x75d1('0xb')](handleError(_0x3b30fb,null));};exports[_0x75d1('0x4a')]=function(_0x49d9ca,_0x1d7de1){return respondWithRpcPromise('MailAccounts',_0x49d9ca[_0x75d1('0x19')],mailClient)[_0x75d1('0x16')](respondWithResult(_0x1d7de1,null))[_0x75d1('0xb')](handleError(_0x1d7de1,null));};exports[_0x75d1('0x4b')]=function(_0x5d2219,_0x22ce12){return respondWithRpcPromise('OpenchannelQueues',_0x5d2219['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x22ce12,null))[_0x75d1('0xb')](handleError(_0x22ce12,null));};exports[_0x75d1('0x4c')]=function(_0x3c8119,_0x4fd170){return respondWithRpcPromise('OpenchannelQueues',_0x3c8119[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](findById(_0x3c8119[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x4fd170,null))[_0x75d1('0xb')](handleError(_0x4fd170,null));};exports['smsQueues']=function(_0x223db6,_0x44173c){return respondWithRpcPromise(_0x75d1('0x4d'),_0x223db6[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x44173c,null))[_0x75d1('0xb')](handleError(_0x44173c,null));};exports[_0x75d1('0x4e')]=function(_0x1092fb,_0x40f50b){return respondWithRpcPromise(_0x75d1('0x4d'),_0x1092fb[_0x75d1('0x19')],routingClient)['then'](findById(_0x1092fb[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x40f50b,null))[_0x75d1('0xb')](handleError(_0x40f50b,null));};exports[_0x75d1('0x4f')]=function(_0x3754b1,_0x174fde){return respondWithRpcPromise(_0x75d1('0x50'),_0x3754b1['query'],routingClient)['then'](respondWithResult(_0x174fde,null))[_0x75d1('0xb')](handleError(_0x174fde,null));};exports[_0x75d1('0x51')]=function(_0x6f8ca2,_0x13ddbb){return respondWithRpcPromise(_0x75d1('0x50'),_0x6f8ca2['query'],routingClient)['then'](findById(_0x6f8ca2[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x13ddbb,null))['catch'](handleError(_0x13ddbb,null));};exports[_0x75d1('0x52')]=function(_0x29b1f4,_0x25dfa1){return respondWithRpcPromise(_0x75d1('0x53'),_0x29b1f4[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x25dfa1,null))['catch'](handleError(_0x25dfa1,null));};exports['showFaxQueues']=function(_0x2c0452,_0x3fad5c){return respondWithRpcPromise('FaxQueues',_0x2c0452[_0x75d1('0x19')],routingClient)['then'](findById(_0x2c0452[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x3fad5c,null))[_0x75d1('0xb')](handleError(_0x3fad5c,null));};exports['faxAccounts']=function(_0x254cfe,_0x1f9ac2){return respondWithRpcPromise(_0x75d1('0x54'),_0x254cfe[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x1f9ac2,null))['catch'](handleError(_0x1f9ac2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3785fd,_0x58d20b){return respondWithRpcPromise(_0x75d1('0x55'),_0x3785fd[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x58d20b,null))['catch'](handleError(_0x58d20b,null));};exports['mailQueuesWaitingInteractions']=function(_0x2e6849,_0x486977){return respondWithRpcPromise(_0x75d1('0x56'),_0x2e6849[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x486977,null))['catch'](handleError(_0x486977,null));};exports[_0x75d1('0x57')]=function(_0x353bec,_0x644ced){return respondWithRpcPromise(_0x75d1('0x58'),_0x353bec[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x644ced,null))[_0x75d1('0xb')](handleError(_0x644ced,null));};exports[_0x75d1('0x59')]=function(_0x3af4a7,_0x1ca2ee){return respondWithRpcPromise(_0x75d1('0x58'),_0x3af4a7[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](function(_0x44ef76){if(_0x3af4a7['query']['type']!==undefined){var _0x410fa1=_(_0x44ef76[_0x75d1('0x13')])['filter']([_0x3af4a7[_0x75d1('0x19')]['type'],_0x3af4a7['params']['id']])['map'](_0x75d1('0x5a'))[_0x75d1('0x5b')]()[_0x75d1('0x5c')]();return _0x44ef76[_0x75d1('0x13')][_0x75d1('0x5d')](function(_0x5d5a72){return _0x410fa1[_0x75d1('0x5e')](_0x5d5a72[_0x75d1('0x5a')])>-0x1;});}else{return _0x44ef76[_0x75d1('0x13')][_0x75d1('0x5d')](function(_0x29960e){return _0x29960e['queue_id']===parseInt(_0x3af4a7[_0x75d1('0x1a')]['id']);});}})['then'](respondWithResult(_0x1ca2ee,null))[_0x75d1('0xb')](handleError(_0x1ca2ee,null));};exports[_0x75d1('0x5f')]=function(_0x3d5355,_0x526d98){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x3d5355['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x526d98,null))[_0x75d1('0xb')](handleError(_0x526d98,null));};exports[_0x75d1('0x60')]=function(_0x22caf3,_0x17ec6d){return respondWithRpcPromise(_0x75d1('0x61'),_0x22caf3['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x17ec6d,null))[_0x75d1('0xb')](handleError(_0x17ec6d,null));};exports['faxQueuesWaitingInteractions']=function(_0x4eda90,_0x5c16be){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4eda90['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x5c16be,null))['catch'](handleError(_0x5c16be,null));};exports['queueNotify']=function(_0x3f582c){return function(_0x4e546f,_0x451828){var _0x13179c,_0x739cc2;var _0xc939c9=_[_0x75d1('0x62')](_0x3f582c);var _0x1aa806=_0x3f582c===_0x75d1('0x63')?_0x75d1('0x64'):'Account';return db[_0xc939c9+_0x75d1('0x65')]['findOne']({'raw':!![],'where':{'id':_0x4e546f[_0x75d1('0x1a')]['id']}})[_0x75d1('0x16')](function(_0x358c70){if(_['isNil'](_0x358c70)){throw new Error(_0xc939c9+_0x75d1('0x66'));}_0x13179c=_0x358c70;return db[_0xc939c9+_0x75d1('0x67')][_0x75d1('0x68')]({'where':{'id':_0x4e546f[_0x75d1('0x21')][_0x75d1('0x69')]},'include':[{'model':db[_0xc939c9+_0x75d1('0x6a')],'as':_0x75d1('0x6a')},{'model':db[_0xc939c9+_0x1aa806],'as':'Account'}]});})[_0x75d1('0x16')](function(_0x21932b){if(_[_0x75d1('0x12')](_0x21932b)){throw new Error(_0xc939c9+_0x75d1('0x6b'));}_0x739cc2=_0x21932b;return _0x21932b[_0x75d1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4814d8={'uniqueid':_0x3f582c+'.'+_0x739cc2['id']+'.'+_0x739cc2[_0x75d1('0x6a')]['id'],'FromUserId':_0x4e546f['user']['id'],'type':_0x75d1('0x6d')};_0x4814d8[_0xc939c9+_0x75d1('0x6e')]=_0x739cc2['id'];_0x4814d8[_0xc939c9+_0x75d1('0x6f')]=_0x739cc2[_0x75d1('0x6a')]['id'];_0x4814d8['From'+_0xc939c9+_0x1aa806+'Id']=_0x739cc2['Account']['id'];_0x4814d8['To'+_0xc939c9+_0x75d1('0x70')]=_0x13179c['id'];return db[_0xc939c9+_0x75d1('0x71')][_0x75d1('0x72')](_0x4814d8);})[_0x75d1('0x16')](function(){return respondWithRpcPromise(_0x75d1('0x73'),{'channel':_0x3f582c,'interaction':_0x739cc2['Interaction'],'message':_0x739cc2,'account':_0x739cc2[_0x75d1('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x75d1('0x6d'),'appdata':_0x13179c['name']+','+(_0x739cc2[_0x75d1('0x74')][_0x75d1('0x75')]||0x12c),'interval':_0x75d1('0x76')}]},routingClient);})[_0x75d1('0x16')](respondWithResult(_0x451828,null))[_0x75d1('0xb')](handleError(_0x451828,null));};};exports[_0x75d1('0x77')]=function(_0x54405a,_0x145b7f){var _0x1b026e,_0x39084f;if(_[_0x75d1('0x12')](_0x54405a[_0x75d1('0x21')][_0x75d1('0x78')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x30214e=_0x54405a['body'][_0x75d1('0x78')];var _0x400d3a=_[_0x75d1('0x62')](_0x30214e);var _0x15ac7b=_0x30214e===_0x75d1('0x63')?_0x75d1('0x64'):'Account';return db[_0x75d1('0x79')][_0x75d1('0x68')]({'raw':!![],'where':{'id':_0x54405a[_0x75d1('0x1a')]['id'],'role':'agent'}})[_0x75d1('0x16')](function(_0x4433ff){if(_['isNil'](_0x4433ff)){throw new Error(_0x75d1('0x7a'));}_0x1b026e=_0x4433ff;return db[_0x400d3a+_0x75d1('0x67')][_0x75d1('0x68')]({'where':{'id':_0x54405a[_0x75d1('0x21')][_0x75d1('0x69')]},'include':[{'model':db[_0x400d3a+_0x75d1('0x6a')],'as':_0x75d1('0x6a')},{'model':db[_0x400d3a+_0x15ac7b],'as':_0x75d1('0x74')}]});})[_0x75d1('0x16')](function(_0x57653d){if(_[_0x75d1('0x12')](_0x57653d)){throw new Error(_0x400d3a+_0x75d1('0x6b'));}_0x39084f=_0x57653d;return _0x57653d['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x75d1('0x16')](function(){var _0x2e9cf1={'uniqueid':_0x30214e+'.'+_0x39084f['id']+'.'+_0x39084f['Interaction']['id'],'FromUserId':_0x54405a['user']['id'],'type':_0x75d1('0x6d'),'ToUserId':_0x1b026e['id']};_0x2e9cf1[_0x400d3a+_0x75d1('0x6e')]=_0x39084f['id'];_0x2e9cf1[_0x400d3a+_0x75d1('0x6f')]=_0x39084f[_0x75d1('0x6a')]['id'];_0x2e9cf1['From'+_0x400d3a+_0x15ac7b+'Id']=_0x39084f[_0x75d1('0x74')]['id'];return db[_0x400d3a+'TransferReport'][_0x75d1('0x72')](_0x2e9cf1);})[_0x75d1('0x16')](function(){return respondWithRpcPromise(_0x75d1('0x73'),{'channel':_0x30214e,'interaction':_0x39084f[_0x75d1('0x6a')],'message':_0x39084f,'account':_0x39084f[_0x75d1('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x75d1('0x3b'),'appdata':_0x1b026e[_0x75d1('0x10')]+','+(_0x39084f[_0x75d1('0x74')][_0x75d1('0x7b')]||0x12c),'interval':_0x75d1('0x76')}]},routingClient);})[_0x75d1('0x16')](respondWithResult(_0x145b7f,null))[_0x75d1('0xb')](handleError(_0x145b7f,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3cc5550..874fe0a 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 _0x4d22=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/run','post','create','put','update'];(function(_0x2d84c1,_0x5191eb){var _0x39fe4f=function(_0x47ff04){while(--_0x47ff04){_0x2d84c1['push'](_0x2d84c1['shift']());}};_0x39fe4f(++_0x5191eb);}(_0x4d22,0x1d0));var _0x24d2=function(_0x3d7450,_0x51a35c){_0x3d7450=_0x3d7450-0x0;var _0x5e895a=_0x4d22[_0x3d7450];return _0x5e895a;};'use strict';var multer=require(_0x24d2('0x0'));var util=require(_0x24d2('0x1'));var path=require(_0x24d2('0x2'));var timeout=require(_0x24d2('0x3'));var express=require(_0x24d2('0x4'));var router=express[_0x24d2('0x5')]();var fs_extra=require(_0x24d2('0x6'));var auth=require(_0x24d2('0x7'));var interaction=require(_0x24d2('0x8'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0x24d2('0x9')](),controller[_0x24d2('0xa')]);router[_0x24d2('0xb')](_0x24d2('0xc'),auth['isAuthenticated'](),controller[_0x24d2('0xd')]);router[_0x24d2('0xb')](_0x24d2('0xe'),auth[_0x24d2('0x9')](),controller['run']);router[_0x24d2('0xf')]('/',auth[_0x24d2('0x9')](),controller[_0x24d2('0x10')]);router[_0x24d2('0x11')](_0x24d2('0xc'),auth[_0x24d2('0x9')](),controller[_0x24d2('0x12')]);router[_0x24d2('0x13')](_0x24d2('0xc'),auth[_0x24d2('0x9')](),controller[_0x24d2('0x14')]);module['exports']=router; \ No newline at end of file +var _0xec01=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0xec01,0x160));var _0x1ec0=function(_0x1ae460,_0x51a1aa){_0x1ae460=_0x1ae460-0x0;var _0x7dd736=_0xec01[_0x1ae460];return _0x7dd736;};'use strict';var multer=require(_0x1ec0('0x0'));var util=require(_0x1ec0('0x1'));var path=require(_0x1ec0('0x2'));var timeout=require(_0x1ec0('0x3'));var express=require(_0x1ec0('0x4'));var router=express[_0x1ec0('0x5')]();var fs_extra=require(_0x1ec0('0x6'));var auth=require(_0x1ec0('0x7'));var interaction=require(_0x1ec0('0x8'));var config=require(_0x1ec0('0x9'));var controller=require('./schedule.controller');router[_0x1ec0('0xa')]('/',auth[_0x1ec0('0xb')](),controller[_0x1ec0('0xc')]);router[_0x1ec0('0xa')](_0x1ec0('0xd'),auth[_0x1ec0('0xb')](),controller[_0x1ec0('0xe')]);router[_0x1ec0('0xa')](_0x1ec0('0xf'),auth[_0x1ec0('0xb')](),controller['run']);router[_0x1ec0('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ec0('0x11')](_0x1ec0('0xd'),auth[_0x1ec0('0xb')](),controller['update']);router['delete'](_0x1ec0('0xd'),auth[_0x1ec0('0xb')](),controller[_0x1ec0('0x12')]);module[_0x1ec0('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 4700d83..63c4500 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 _0x01e1=['BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','hours','minutes','xlsx','csv','custom','default'];(function(_0x53e73e,_0x5d2b07){var _0x56758c=function(_0x27d8e2){while(--_0x27d8e2){_0x53e73e['push'](_0x53e73e['shift']());}};_0x56758c(++_0x5d2b07);}(_0x01e1,0x152));var _0x101e=function(_0x1368a4,_0x717e38){_0x1368a4=_0x1368a4-0x0;var _0x3961ae=_0x01e1[_0x1368a4];return _0x3961ae;};'use strict';var Sequelize=require(_0x101e('0x0'));module['exports']={'name':{'type':Sequelize[_0x101e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x101e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x101e('0x2')},'startAt':{'type':Sequelize[_0x101e('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x101e('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x101e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x101e('0x5')](_0x101e('0x6'),_0x101e('0x7'),'months','weeks','days',_0x101e('0x8'),_0x101e('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM']('csv','pdf',_0x101e('0xa')),'allowNull':![],'defaultValue':_0x101e('0xb')},'type':{'type':Sequelize[_0x101e('0x5')](_0x101e('0xc'),_0x101e('0xd')),'allowNull':![],'defaultValue':_0x101e('0xc')},'sendMail':{'type':Sequelize[_0x101e('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x101e('0x1')]},'cc':{'type':Sequelize[_0x101e('0xf')]},'bcc':{'type':Sequelize[_0x101e('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x101e('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0dd0=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks','days','hours','minutes','ENUM','csv','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x19dbf2,_0x45e0fc){var _0x3f3973=function(_0x1d425c){while(--_0x1d425c){_0x19dbf2['push'](_0x19dbf2['shift']());}};_0x3f3973(++_0x45e0fc);}(_0x0dd0,0x7b));var _0x00dd=function(_0x555f75,_0x5362dd){_0x555f75=_0x555f75-0x0;var _0x548a96=_0x0dd0[_0x555f75];return _0x548a96;};'use strict';var Sequelize=require(_0x00dd('0x0'));module[_0x00dd('0x1')]={'name':{'type':Sequelize[_0x00dd('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x00dd('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x00dd('0x4')},'startAt':{'type':Sequelize[_0x00dd('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x00dd('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x00dd('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x00dd('0x7'),'quarters',_0x00dd('0x8'),_0x00dd('0x9'),_0x00dd('0xa'),_0x00dd('0xb'),_0x00dd('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x00dd('0xd')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x00dd('0xe')},'type':{'type':Sequelize[_0x00dd('0xd')](_0x00dd('0xf'),_0x00dd('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x00dd('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x00dd('0x11')]},'bcc':{'type':Sequelize[_0x00dd('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x00dd('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 e365009..4a405cc 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 _0x0291=['../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../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','Content-Range','apply','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','count','includeAll','include','findAll','rows','catch','find','create','body','user','userProfileId','autoAssociation','params','run'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x0291,0xf1));var _0x1029=function(_0x57d3c2,_0x589178){_0x57d3c2=_0x57d3c2-0x0;var _0x414954=_0x0291[_0x57d3c2];return _0x414954;};'use strict';var emlformat=require(_0x1029('0x0'));var rimraf=require(_0x1029('0x1'));var zipdir=require(_0x1029('0x2'));var jsonpatch=require(_0x1029('0x3'));var rp=require('request-promise');var moment=require(_0x1029('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1029('0x5'));var util=require('util');var path=require(_0x1029('0x6'));var sox=require(_0x1029('0x7'));var csv=require(_0x1029('0x8'));var ejs=require(_0x1029('0x9'));var fs=require('fs');var fs_extra=require(_0x1029('0xa'));var _=require('lodash');var squel=require(_0x1029('0xb'));var crypto=require(_0x1029('0xc'));var jsforce=require(_0x1029('0xd'));var deskjs=require(_0x1029('0xe'));var toCsv=require(_0x1029('0x8'));var querystring=require(_0x1029('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1029('0x10'));var as=require(_0x1029('0x11'));var hardwareService=require(_0x1029('0x12'));var logger=require(_0x1029('0x13'))(_0x1029('0x14'));var utils=require(_0x1029('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1029('0x16'));var db=require(_0x1029('0x17'))['db'];function respondWithStatusCode(_0x337c90,_0x5f3125){_0x5f3125=_0x5f3125||0xcc;return function(_0xba4264){if(_0xba4264){return _0x337c90[_0x1029('0x18')](_0x5f3125);}return _0x337c90[_0x1029('0x19')](_0x5f3125)[_0x1029('0x1a')]();};}function respondWithResult(_0x1043b6,_0x324621){_0x324621=_0x324621||0xc8;return function(_0x24a5f9){if(_0x24a5f9){return _0x1043b6[_0x1029('0x19')](_0x324621)[_0x1029('0x1b')](_0x24a5f9);}};}function respondWithFilteredResult(_0x23a054,_0x19c72d){return function(_0x185a5f){if(_0x185a5f){var _0xe2e1db=typeof _0x19c72d[_0x1029('0x1c')]===_0x1029('0x1d')&&typeof _0x19c72d[_0x1029('0x1e')]===_0x1029('0x1d');var _0x20c454=_0x185a5f['count'];var _0x542ff9=_0xe2e1db?0x0:_0x19c72d[_0x1029('0x1c')];var _0x5ab1f2=_0xe2e1db?_0x185a5f['count']:_0x19c72d[_0x1029('0x1c')]+_0x19c72d[_0x1029('0x1e')];var _0x1ad1f4;if(_0x5ab1f2>=_0x20c454){_0x5ab1f2=_0x20c454;_0x1ad1f4=0xc8;}else{_0x1ad1f4=0xce;}_0x23a054[_0x1029('0x19')](_0x1ad1f4);return _0x23a054['set'](_0x1029('0x1f'),_0x542ff9+'-'+_0x5ab1f2+'/'+_0x20c454)[_0x1029('0x1b')](_0x185a5f);}return null;};}function patchUpdates(_0xf51059){return function(_0x5b4a14){try{jsonpatch[_0x1029('0x20')](_0x5b4a14,_0xf51059,!![]);}catch(_0x247aef){return BPromise['reject'](_0x247aef);}return _0x5b4a14['save']();};}function saveUpdates(_0x475588,_0x50d213){return function(_0x1934d){if(_0x1934d){return _0x1934d[_0x1029('0x21')](_0x475588)[_0x1029('0x22')](function(_0x4d8eb9){return _0x4d8eb9;});}return null;};}function removeEntity(_0x13286c,_0x4fc6fd){return function(_0xb77bc){if(_0xb77bc){return _0xb77bc[_0x1029('0x23')]()[_0x1029('0x22')](function(){var _0x9a83f5=_0xb77bc[_0x1029('0x24')]({'plain':!![]});var _0x5b3d98=_0x1029('0x25');return db[_0x1029('0x26')][_0x1029('0x23')]({'where':{'type':_0x5b3d98,'resourceId':_0x9a83f5['id']}})[_0x1029('0x22')](function(){return _0xb77bc;});})[_0x1029('0x22')](function(){_0x13286c[_0x1029('0x19')](0xcc)[_0x1029('0x1a')]();});}};}function handleEntityNotFound(_0x4155a7,_0x2849e2){return function(_0x1a14ac){if(!_0x1a14ac){_0x4155a7['sendStatus'](0x194);}return _0x1a14ac;};}function handleError(_0x5d16d7,_0x4aad22){_0x4aad22=_0x4aad22||0x1f4;return function(_0x1135ee){logger[_0x1029('0x27')](_0x1135ee[_0x1029('0x28')]);if(_0x1135ee[_0x1029('0x29')]){delete _0x1135ee[_0x1029('0x29')];}_0x5d16d7['status'](_0x4aad22)[_0x1029('0x2a')](_0x1135ee);};}exports['index']=function(_0xbeaef,_0x4f2321){var _0x48bf8e={},_0x3bbf96={},_0x217668={'count':0x0,'rows':[]};var _0x976eba=_[_0x1029('0x2b')](db[_0x1029('0x2c')][_0x1029('0x2d')],function(_0x23fc7){return{'name':_0x23fc7[_0x1029('0x2e')],'type':_0x23fc7[_0x1029('0x2f')][_0x1029('0x30')]};});_0x3bbf96[_0x1029('0x31')]=_[_0x1029('0x2b')](_0x976eba,_0x1029('0x29'));_0x3bbf96['query']=_[_0x1029('0x32')](_0xbeaef['query']);_0x3bbf96['filters']=_[_0x1029('0x33')](_0x3bbf96[_0x1029('0x31')],_0x3bbf96[_0x1029('0x34')]);_0x48bf8e['attributes']=_['intersection'](_0x3bbf96[_0x1029('0x31')],qs[_0x1029('0x35')](_0xbeaef[_0x1029('0x34')][_0x1029('0x35')]));_0x48bf8e['attributes']=_0x48bf8e[_0x1029('0x36')][_0x1029('0x37')]?_0x48bf8e[_0x1029('0x36')]:_0x3bbf96[_0x1029('0x31')];if(!_0xbeaef['query'][_0x1029('0x38')](_0x1029('0x39'))){_0x48bf8e[_0x1029('0x1e')]=qs[_0x1029('0x1e')](_0xbeaef['query'][_0x1029('0x1e')]);_0x48bf8e['offset']=qs['offset'](_0xbeaef[_0x1029('0x34')]['offset']);}_0x48bf8e[_0x1029('0x3a')]=qs['sort'](_0xbeaef['query'][_0x1029('0x3b')]);_0x48bf8e[_0x1029('0x3c')]=qs[_0x1029('0x3d')](_[_0x1029('0x3e')](_0xbeaef[_0x1029('0x34')],_0x3bbf96[_0x1029('0x3d')]),_0x976eba);if(_0xbeaef['query'][_0x1029('0x3f')]){_0x48bf8e['where']=_[_0x1029('0x40')](_0x48bf8e[_0x1029('0x3c')],{'$or':_[_0x1029('0x2b')](_0x976eba,function(_0x2f32ce){if(_0x2f32ce[_0x1029('0x2f')]!=='VIRTUAL'){var _0x29ea7={};_0x29ea7[_0x2f32ce['name']]={'$like':'%'+_0xbeaef['query'][_0x1029('0x3f')]+'%'};return _0x29ea7;}})});}_0x48bf8e=_[_0x1029('0x40')]({},_0x48bf8e,_0xbeaef['options']);var _0x122aed={'where':_0x48bf8e[_0x1029('0x3c')]};return db[_0x1029('0x2c')][_0x1029('0x41')](_0x122aed)['then'](function(_0x5b7c9a){_0x217668['count']=_0x5b7c9a;if(_0xbeaef[_0x1029('0x34')][_0x1029('0x42')]){_0x48bf8e[_0x1029('0x43')]=[{'all':!![]}];}return db['Schedule'][_0x1029('0x44')](_0x48bf8e);})[_0x1029('0x22')](function(_0x46d78c){_0x217668[_0x1029('0x45')]=_0x46d78c;return _0x217668;})[_0x1029('0x22')](respondWithFilteredResult(_0x4f2321,_0x48bf8e))[_0x1029('0x46')](handleError(_0x4f2321,null));};exports['show']=function(_0x242cd8,_0x33b110){var _0x1e4615={'raw':![],'where':{'id':_0x242cd8['params']['id']}},_0x326dd3={};_0x326dd3['model']=_[_0x1029('0x32')](db[_0x1029('0x2c')]['rawAttributes']);_0x326dd3[_0x1029('0x34')]=_['keys'](_0x242cd8[_0x1029('0x34')]);_0x326dd3[_0x1029('0x3d')]=_[_0x1029('0x33')](_0x326dd3[_0x1029('0x31')],_0x326dd3[_0x1029('0x34')]);_0x1e4615[_0x1029('0x36')]=_[_0x1029('0x33')](_0x326dd3[_0x1029('0x31')],qs[_0x1029('0x35')](_0x242cd8[_0x1029('0x34')][_0x1029('0x35')]));_0x1e4615[_0x1029('0x36')]=_0x1e4615[_0x1029('0x36')][_0x1029('0x37')]?_0x1e4615[_0x1029('0x36')]:_0x326dd3[_0x1029('0x31')];if(_0x242cd8[_0x1029('0x34')]['includeAll']){_0x1e4615[_0x1029('0x43')]=[{'all':!![]}];}_0x1e4615=_['merge']({},_0x1e4615,_0x242cd8['options']);return db[_0x1029('0x2c')][_0x1029('0x47')](_0x1e4615)[_0x1029('0x22')](handleEntityNotFound(_0x33b110,null))[_0x1029('0x22')](respondWithResult(_0x33b110,null))[_0x1029('0x46')](handleError(_0x33b110,null));};exports[_0x1029('0x48')]=function(_0x27176,_0x38c2f5){return db[_0x1029('0x2c')][_0x1029('0x48')](_0x27176[_0x1029('0x49')],{})[_0x1029('0x22')](function(_0x4a4064){var _0xa69fbc=_0x27176['user'][_0x1029('0x24')]({'plain':!![]});if(!_0xa69fbc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa69fbc['role']===_0x1029('0x4a')){var _0x9b06e6=_0x4a4064[_0x1029('0x24')]({'plain':!![]});var _0x3e069c=_0x1029('0x25');return db['UserProfileSection'][_0x1029('0x47')]({'where':{'name':_0x3e069c,'userProfileId':_0xa69fbc[_0x1029('0x4b')]},'raw':!![]})[_0x1029('0x22')](function(_0x25a201){if(_0x25a201&&_0x25a201[_0x1029('0x4c')]===0x0){return db[_0x1029('0x26')][_0x1029('0x48')]({'name':_0x9b06e6[_0x1029('0x29')],'resourceId':_0x9b06e6['id'],'type':_0x25a201[_0x1029('0x29')],'sectionId':_0x25a201['id']},{})[_0x1029('0x22')](function(){return _0x4a4064;});}else{return _0x4a4064;}})['catch'](function(_0x1dfc92){logger[_0x1029('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dfc92);throw _0x1dfc92;});}return _0x4a4064;})[_0x1029('0x22')](respondWithResult(_0x38c2f5,0xc9))[_0x1029('0x46')](handleError(_0x38c2f5,null));};exports[_0x1029('0x21')]=function(_0x38fa7d,_0x286f29){if(_0x38fa7d[_0x1029('0x49')]['id']){delete _0x38fa7d[_0x1029('0x49')]['id'];}return db[_0x1029('0x2c')][_0x1029('0x47')]({'where':{'id':_0x38fa7d[_0x1029('0x4d')]['id']}})['then'](handleEntityNotFound(_0x286f29,null))[_0x1029('0x22')](saveUpdates(_0x38fa7d[_0x1029('0x49')],null))[_0x1029('0x22')](respondWithResult(_0x286f29,null))[_0x1029('0x46')](handleError(_0x286f29,null));};exports[_0x1029('0x23')]=function(_0x562dbd,_0x2e5f76){return db[_0x1029('0x2c')][_0x1029('0x47')]({'where':{'id':_0x562dbd[_0x1029('0x4d')]['id']}})[_0x1029('0x22')](handleEntityNotFound(_0x2e5f76,null))[_0x1029('0x22')](removeEntity(_0x2e5f76,null))[_0x1029('0x46')](handleError(_0x2e5f76,null));};exports[_0x1029('0x4e')]=function(_0x81d291,_0x2f54c5,_0x4799bf){var _0x5b95b3=require(_0x1029('0x4f'));return db[_0x1029('0x2c')][_0x1029('0x47')]({'where':{'id':_0x81d291[_0x1029('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2f54c5,null))[_0x1029('0x22')](function(){_0x5b95b3[_0x1029('0x4e')](_0x81d291[_0x1029('0x4d')]['id']);})['then'](respondWithStatusCode(_0x2f54c5,null))[_0x1029('0x46')](handleError(_0x2f54c5,null));}; \ No newline at end of file +var _0x7156=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filter','merge','options','where','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','run','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api'];(function(_0x20f7d2,_0x41678d){var _0x3c6e14=function(_0x183896){while(--_0x183896){_0x20f7d2['push'](_0x20f7d2['shift']());}};_0x3c6e14(++_0x41678d);}(_0x7156,0x122));var _0x6715=function(_0x149cc1,_0x5c10a5){_0x149cc1=_0x149cc1-0x0;var _0x4ab381=_0x7156[_0x149cc1];return _0x4ab381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6715('0x0'));var zipdir=require(_0x6715('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6715('0x2'));var moment=require(_0x6715('0x3'));var BPromise=require(_0x6715('0x4'));var Mustache=require(_0x6715('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6715('0x6'));var csv=require(_0x6715('0x7'));var ejs=require(_0x6715('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6715('0x9'));var squel=require(_0x6715('0xa'));var crypto=require(_0x6715('0xb'));var jsforce=require(_0x6715('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6715('0x7'));var querystring=require(_0x6715('0xd'));var Papa=require(_0x6715('0xe'));var Redis=require('ioredis');var authService=require(_0x6715('0xf'));var qs=require(_0x6715('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6715('0x11'));var utils=require('../../config/utils');var config=require(_0x6715('0x12'));var licenseUtil=require(_0x6715('0x13'));var db=require(_0x6715('0x14'))['db'];function respondWithStatusCode(_0x5996a0,_0x13f644){_0x13f644=_0x13f644||0xcc;return function(_0x199706){if(_0x199706){return _0x5996a0[_0x6715('0x15')](_0x13f644);}return _0x5996a0[_0x6715('0x16')](_0x13f644)[_0x6715('0x17')]();};}function respondWithResult(_0x2ee2a4,_0x1e0e54){_0x1e0e54=_0x1e0e54||0xc8;return function(_0x4e9a98){if(_0x4e9a98){return _0x2ee2a4['status'](_0x1e0e54)['json'](_0x4e9a98);}};}function respondWithFilteredResult(_0xed85ba,_0x535cc5){return function(_0x57fc60){if(_0x57fc60){var _0xf5a401=typeof _0x535cc5['offset']===_0x6715('0x18')&&typeof _0x535cc5[_0x6715('0x19')]===_0x6715('0x18');var _0x488d35=_0x57fc60[_0x6715('0x1a')];var _0x2efcec=_0xf5a401?0x0:_0x535cc5['offset'];var _0x2372ee=_0xf5a401?_0x57fc60[_0x6715('0x1a')]:_0x535cc5['offset']+_0x535cc5[_0x6715('0x19')];var _0x30dbb7;if(_0x2372ee>=_0x488d35){_0x2372ee=_0x488d35;_0x30dbb7=0xc8;}else{_0x30dbb7=0xce;}_0xed85ba[_0x6715('0x16')](_0x30dbb7);return _0xed85ba[_0x6715('0x1b')](_0x6715('0x1c'),_0x2efcec+'-'+_0x2372ee+'/'+_0x488d35)[_0x6715('0x1d')](_0x57fc60);}return null;};}function patchUpdates(_0x506c03){return function(_0x38baff){try{jsonpatch[_0x6715('0x1e')](_0x38baff,_0x506c03,!![]);}catch(_0x3dd4cc){return BPromise[_0x6715('0x1f')](_0x3dd4cc);}return _0x38baff['save']();};}function saveUpdates(_0xf667f6,_0x38ccf4){return function(_0x1f58e0){if(_0x1f58e0){return _0x1f58e0[_0x6715('0x20')](_0xf667f6)['then'](function(_0x3aced5){return _0x3aced5;});}return null;};}function removeEntity(_0x7e6beb,_0x50acc3){return function(_0x34f4ec){if(_0x34f4ec){return _0x34f4ec['destroy']()[_0x6715('0x21')](function(){var _0x5cb87e=_0x34f4ec[_0x6715('0x22')]({'plain':!![]});var _0x56e2ef=_0x6715('0x23');return db[_0x6715('0x24')][_0x6715('0x25')]({'where':{'type':_0x56e2ef,'resourceId':_0x5cb87e['id']}})[_0x6715('0x21')](function(){return _0x34f4ec;});})[_0x6715('0x21')](function(){_0x7e6beb[_0x6715('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b276f,_0x1dbe42){return function(_0x27a7f3){if(!_0x27a7f3){_0x4b276f[_0x6715('0x15')](0x194);}return _0x27a7f3;};}function handleError(_0x35e720,_0x118887){_0x118887=_0x118887||0x1f4;return function(_0x307ced){logger[_0x6715('0x26')](_0x307ced[_0x6715('0x27')]);if(_0x307ced[_0x6715('0x28')]){delete _0x307ced[_0x6715('0x28')];}_0x35e720[_0x6715('0x16')](_0x118887)[_0x6715('0x29')](_0x307ced);};}exports[_0x6715('0x2a')]=function(_0x5bc63b,_0x11965c){var _0x38ca48={},_0x44d6d2={},_0x26a539={'count':0x0,'rows':[]};var _0x1f8bb2=_[_0x6715('0x2b')](db[_0x6715('0x2c')]['rawAttributes'],function(_0x320388){return{'name':_0x320388[_0x6715('0x2d')],'type':_0x320388['type'][_0x6715('0x2e')]};});_0x44d6d2[_0x6715('0x2f')]=_['map'](_0x1f8bb2,_0x6715('0x28'));_0x44d6d2[_0x6715('0x30')]=_['keys'](_0x5bc63b['query']);_0x44d6d2[_0x6715('0x31')]=_[_0x6715('0x32')](_0x44d6d2['model'],_0x44d6d2[_0x6715('0x30')]);_0x38ca48[_0x6715('0x33')]=_[_0x6715('0x32')](_0x44d6d2[_0x6715('0x2f')],qs[_0x6715('0x34')](_0x5bc63b[_0x6715('0x30')][_0x6715('0x34')]));_0x38ca48['attributes']=_0x38ca48[_0x6715('0x33')][_0x6715('0x35')]?_0x38ca48[_0x6715('0x33')]:_0x44d6d2[_0x6715('0x2f')];if(!_0x5bc63b['query'][_0x6715('0x36')]('nolimit')){_0x38ca48[_0x6715('0x19')]=qs['limit'](_0x5bc63b[_0x6715('0x30')][_0x6715('0x19')]);_0x38ca48[_0x6715('0x37')]=qs[_0x6715('0x37')](_0x5bc63b['query'][_0x6715('0x37')]);}_0x38ca48[_0x6715('0x38')]=qs[_0x6715('0x39')](_0x5bc63b[_0x6715('0x30')]['sort']);_0x38ca48['where']=qs[_0x6715('0x31')](_['pick'](_0x5bc63b[_0x6715('0x30')],_0x44d6d2['filters']),_0x1f8bb2);if(_0x5bc63b[_0x6715('0x30')][_0x6715('0x3a')]){_0x38ca48['where']=_[_0x6715('0x3b')](_0x38ca48['where'],{'$or':_[_0x6715('0x2b')](_0x1f8bb2,function(_0x8f9fd0){if(_0x8f9fd0['type']!=='VIRTUAL'){var _0x2edf95={};_0x2edf95[_0x8f9fd0['name']]={'$like':'%'+_0x5bc63b[_0x6715('0x30')][_0x6715('0x3a')]+'%'};return _0x2edf95;}})});}_0x38ca48=_['merge']({},_0x38ca48,_0x5bc63b[_0x6715('0x3c')]);var _0x2949bc={'where':_0x38ca48[_0x6715('0x3d')]};return db[_0x6715('0x2c')]['count'](_0x2949bc)[_0x6715('0x21')](function(_0x44d6f8){_0x26a539[_0x6715('0x1a')]=_0x44d6f8;if(_0x5bc63b[_0x6715('0x30')][_0x6715('0x3e')]){_0x38ca48[_0x6715('0x3f')]=[{'all':!![]}];}return db[_0x6715('0x2c')][_0x6715('0x40')](_0x38ca48);})[_0x6715('0x21')](function(_0x38bfe2){_0x26a539['rows']=_0x38bfe2;return _0x26a539;})['then'](respondWithFilteredResult(_0x11965c,_0x38ca48))[_0x6715('0x41')](handleError(_0x11965c,null));};exports[_0x6715('0x42')]=function(_0x164d73,_0x104a51){var _0x1f5dba={'raw':![],'where':{'id':_0x164d73[_0x6715('0x43')]['id']}},_0x514024={};_0x514024[_0x6715('0x2f')]=_[_0x6715('0x44')](db[_0x6715('0x2c')][_0x6715('0x45')]);_0x514024[_0x6715('0x30')]=_[_0x6715('0x44')](_0x164d73['query']);_0x514024['filters']=_[_0x6715('0x32')](_0x514024[_0x6715('0x2f')],_0x514024['query']);_0x1f5dba[_0x6715('0x33')]=_[_0x6715('0x32')](_0x514024[_0x6715('0x2f')],qs[_0x6715('0x34')](_0x164d73['query'][_0x6715('0x34')]));_0x1f5dba['attributes']=_0x1f5dba[_0x6715('0x33')][_0x6715('0x35')]?_0x1f5dba[_0x6715('0x33')]:_0x514024[_0x6715('0x2f')];if(_0x164d73[_0x6715('0x30')]['includeAll']){_0x1f5dba[_0x6715('0x3f')]=[{'all':!![]}];}_0x1f5dba=_['merge']({},_0x1f5dba,_0x164d73[_0x6715('0x3c')]);return db[_0x6715('0x2c')][_0x6715('0x46')](_0x1f5dba)[_0x6715('0x21')](handleEntityNotFound(_0x104a51,null))[_0x6715('0x21')](respondWithResult(_0x104a51,null))[_0x6715('0x41')](handleError(_0x104a51,null));};exports[_0x6715('0x47')]=function(_0x16cb83,_0x359224){return db['Schedule'][_0x6715('0x47')](_0x16cb83[_0x6715('0x48')],{})[_0x6715('0x21')](function(_0x4672f2){var _0x2d2c17=_0x16cb83['user']['get']({'plain':!![]});if(!_0x2d2c17)throw new Error(_0x6715('0x49'));if(_0x2d2c17['role']==='user'){var _0xb0a6a3=_0x4672f2[_0x6715('0x22')]({'plain':!![]});var _0x28a521=_0x6715('0x23');return db[_0x6715('0x4a')]['find']({'where':{'name':_0x28a521,'userProfileId':_0x2d2c17[_0x6715('0x4b')]},'raw':!![]})[_0x6715('0x21')](function(_0x140da8){if(_0x140da8&&_0x140da8['autoAssociation']===0x0){return db[_0x6715('0x24')]['create']({'name':_0xb0a6a3[_0x6715('0x28')],'resourceId':_0xb0a6a3['id'],'type':_0x140da8[_0x6715('0x28')],'sectionId':_0x140da8['id']},{})[_0x6715('0x21')](function(){return _0x4672f2;});}else{return _0x4672f2;}})[_0x6715('0x41')](function(_0x303987){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x303987);throw _0x303987;});}return _0x4672f2;})[_0x6715('0x21')](respondWithResult(_0x359224,0xc9))[_0x6715('0x41')](handleError(_0x359224,null));};exports['update']=function(_0x20a989,_0x2d393f){if(_0x20a989['body']['id']){delete _0x20a989[_0x6715('0x48')]['id'];}return db['Schedule']['find']({'where':{'id':_0x20a989[_0x6715('0x43')]['id']}})[_0x6715('0x21')](handleEntityNotFound(_0x2d393f,null))['then'](saveUpdates(_0x20a989[_0x6715('0x48')],null))[_0x6715('0x21')](respondWithResult(_0x2d393f,null))[_0x6715('0x41')](handleError(_0x2d393f,null));};exports['destroy']=function(_0x2374d4,_0x4a7718){return db[_0x6715('0x2c')][_0x6715('0x46')]({'where':{'id':_0x2374d4['params']['id']}})[_0x6715('0x21')](handleEntityNotFound(_0x4a7718,null))[_0x6715('0x21')](removeEntity(_0x4a7718,null))['catch'](handleError(_0x4a7718,null));};exports['run']=function(_0x477115,_0x5a0db4,_0xe9baad){var _0x323159=require('../../config/schedule');return db['Schedule'][_0x6715('0x46')]({'where':{'id':_0x477115[_0x6715('0x43')]['id']},'raw':!![]})[_0x6715('0x21')](handleEntityNotFound(_0x5a0db4,null))[_0x6715('0x21')](function(){_0x323159[_0x6715('0x4c')](_0x477115[_0x6715('0x43')]['id']);})[_0x6715('0x21')](respondWithStatusCode(_0x5a0db4,null))[_0x6715('0x41')](handleError(_0x5a0db4,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 29a5b9b..497d3bd 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 _0x8d61=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0x36f39c,_0x3cc2b0){var _0x4dbd28=function(_0x13b194){while(--_0x13b194){_0x36f39c['push'](_0x36f39c['shift']());}};_0x4dbd28(++_0x3cc2b0);}(_0x8d61,0x196));var _0x18d6=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x8d61[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0x18d6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18d6('0x1'));var moment=require(_0x18d6('0x2'));var BPromise=require(_0x18d6('0x3'));var rp=require(_0x18d6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18d6('0x5'));var config=require(_0x18d6('0x6'));var attributes=require(_0x18d6('0x7'));module[_0x18d6('0x8')]=function(_0x533240,_0x2175ae){return _0x533240[_0x18d6('0x9')](_0x18d6('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd0d=['../../config/environment','exports','define','tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd0d,0x10c));var _0xdcd0=function(_0x3b9afb,_0x2133f4){_0x3b9afb=_0x3b9afb-0x0;var _0x136e05=_0xcd0d[_0x3b9afb];return _0x136e05;};'use strict';var _=require(_0xdcd0('0x0'));var util=require(_0xdcd0('0x1'));var logger=require(_0xdcd0('0x2'))('api');var moment=require(_0xdcd0('0x3'));var BPromise=require(_0xdcd0('0x4'));var rp=require(_0xdcd0('0x5'));var fs=require('fs');var path=require(_0xdcd0('0x6'));var rimraf=require(_0xdcd0('0x7'));var config=require(_0xdcd0('0x8'));var attributes=require('./schedule.attributes');module[_0xdcd0('0x9')]=function(_0xe5efa4,_0xc82f6c){return _0xe5efa4[_0xdcd0('0xa')]('Schedule',attributes,{'tableName':_0xdcd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 3b3cff5..31fad8b 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 _0x1e4a=['../../config/environment','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2e5f21,_0x539f49){var _0x90fcb4=function(_0x33704f){while(--_0x33704f){_0x2e5f21['push'](_0x2e5f21['shift']());}};_0x90fcb4(++_0x539f49);}(_0x1e4a,0x92));var _0xa1e4=function(_0x10e557,_0xfb23c8){_0x10e557=_0x10e557-0x0;var _0x3e4e93=_0x1e4a[_0x10e557];return _0x3e4e93;};'use strict';var _=require(_0xa1e4('0x0'));var util=require('util');var moment=require(_0xa1e4('0x1'));var BPromise=require(_0xa1e4('0x2'));var rs=require(_0xa1e4('0x3'));var fs=require('fs');var Redis=require(_0xa1e4('0x4'));var db=require(_0xa1e4('0x5'))['db'];var utils=require(_0xa1e4('0x6'));var logger=require('../../config/logger')(_0xa1e4('0x7'));var config=require(_0xa1e4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b6467,_0x435644,_0x50a3e4){return new BPromise(function(_0x6dfe19,_0x50eb9d){return client[_0xa1e4('0x9')](_0x2b6467,_0x50a3e4)[_0xa1e4('0xa')](function(_0x2c2c28){logger[_0xa1e4('0xb')]('Schedule,\x20%s,\x20%s',_0x435644,_0xa1e4('0xc'));logger[_0xa1e4('0xd')](_0xa1e4('0xe'),_0x435644,_0xa1e4('0xc'),JSON[_0xa1e4('0xf')](_0x2c2c28));if(_0x2c2c28[_0xa1e4('0x10')]){if(_0x2c2c28[_0xa1e4('0x10')][_0xa1e4('0x11')]===0x1f4){logger['error'](_0xa1e4('0x12'),_0x435644,_0x2c2c28[_0xa1e4('0x10')]['message']);return _0x50eb9d(_0x2c2c28[_0xa1e4('0x10')][_0xa1e4('0x13')]);}logger[_0xa1e4('0x10')]('Schedule,\x20%s,\x20%s',_0x435644,_0x2c2c28['error']['message']);return _0x6dfe19(_0x2c2c28[_0xa1e4('0x10')][_0xa1e4('0x13')]);}else{logger['info'](_0xa1e4('0x12'),_0x435644,'request\x20sent');_0x6dfe19(_0x2c2c28[_0xa1e4('0x14')]['message']);}})[_0xa1e4('0x15')](function(_0x464bd8){logger['error'](_0xa1e4('0x12'),_0x435644,_0x464bd8);_0x50eb9d(_0x464bd8);});});} \ No newline at end of file +var _0x185e=['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','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1cdfb7,_0x3aede2){var _0x539857=function(_0x58f505){while(--_0x58f505){_0x1cdfb7['push'](_0x1cdfb7['shift']());}};_0x539857(++_0x3aede2);}(_0x185e,0xb3));var _0xe185=function(_0x33bd99,_0xc5f114){_0x33bd99=_0x33bd99-0x0;var _0x2c253c=_0x185e[_0x33bd99];return _0x2c253c;};'use strict';var _=require(_0xe185('0x0'));var util=require(_0xe185('0x1'));var moment=require(_0xe185('0x2'));var BPromise=require(_0xe185('0x3'));var rs=require(_0xe185('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe185('0x5'));var logger=require(_0xe185('0x6'))('rpc');var config=require(_0xe185('0x7'));var jayson=require(_0xe185('0x8'));var client=jayson[_0xe185('0x9')][_0xe185('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x166a66,_0x1387e8,_0x4798c3){return new BPromise(function(_0x39e98c,_0x187963){return client[_0xe185('0xb')](_0x166a66,_0x4798c3)[_0xe185('0xc')](function(_0x47fb40){logger[_0xe185('0xd')](_0xe185('0xe'),_0x1387e8,_0xe185('0xf'));logger[_0xe185('0x10')](_0xe185('0x11'),_0x1387e8,_0xe185('0xf'),JSON[_0xe185('0x12')](_0x47fb40));if(_0x47fb40[_0xe185('0x13')]){if(_0x47fb40[_0xe185('0x13')][_0xe185('0x14')]===0x1f4){logger[_0xe185('0x13')]('Schedule,\x20%s,\x20%s',_0x1387e8,_0x47fb40['error'][_0xe185('0x15')]);return _0x187963(_0x47fb40[_0xe185('0x13')]['message']);}logger[_0xe185('0x13')](_0xe185('0xe'),_0x1387e8,_0x47fb40[_0xe185('0x13')]['message']);return _0x39e98c(_0x47fb40[_0xe185('0x13')][_0xe185('0x15')]);}else{logger[_0xe185('0xd')](_0xe185('0xe'),_0x1387e8,_0xe185('0xf'));_0x39e98c(_0x47fb40[_0xe185('0x16')][_0xe185('0x15')]);}})[_0xe185('0x17')](function(_0x159450){logger[_0xe185('0x13')]('Schedule,\x20%s,\x20%s',_0x1387e8,_0x159450);_0x187963(_0x159450);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 2de19c6..c75b43b 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 _0x79a0=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','post','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x164eb1,_0x198a7d){var _0x73311=function(_0xde4d4a){while(--_0xde4d4a){_0x164eb1['push'](_0x164eb1['shift']());}};_0x73311(++_0x198a7d);}(_0x79a0,0x1c1));var _0x079a=function(_0x108fe3,_0xe4163f){_0x108fe3=_0x108fe3-0x0;var _0x48cbef=_0x79a0[_0x108fe3];return _0x48cbef;};'use strict';var multer=require('multer');var util=require(_0x079a('0x0'));var path=require(_0x079a('0x1'));var timeout=require(_0x079a('0x2'));var express=require(_0x079a('0x3'));var router=express[_0x079a('0x4')]();var fs_extra=require(_0x079a('0x5'));var auth=require(_0x079a('0x6'));var interaction=require(_0x079a('0x7'));var config=require(_0x079a('0x8'));var controller=require(_0x079a('0x9'));router[_0x079a('0xa')]('/',auth[_0x079a('0xb')](),controller[_0x079a('0xc')]);router[_0x079a('0xa')](_0x079a('0xd'),auth['isAuthenticated'](),controller[_0x079a('0xe')]);router['get']('/:id',auth[_0x079a('0xb')](),controller[_0x079a('0xf')]);router[_0x079a('0xa')](_0x079a('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x079a('0x11')]('/',auth[_0x079a('0xb')](),controller['create']);router[_0x079a('0x12')]('/:id',auth[_0x079a('0xb')](),controller[_0x079a('0x13')]);router[_0x079a('0x14')](_0x079a('0x15'),auth['isAuthenticated'](),controller[_0x079a('0x16')]);module[_0x079a('0x17')]=router; \ No newline at end of file +var _0x6a08=['/:id','show','/:id/download','post','create','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x5ef55b,_0x2c71df){var _0x4edd5c=function(_0x340a34){while(--_0x340a34){_0x5ef55b['push'](_0x5ef55b['shift']());}};_0x4edd5c(++_0x2c71df);}(_0x6a08,0x97));var _0x86a0=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x6a08[_0x1deee5];return _0x1d6c3a;};'use strict';var multer=require(_0x86a0('0x0'));var util=require(_0x86a0('0x1'));var path=require('path');var timeout=require(_0x86a0('0x2'));var express=require('express');var router=express[_0x86a0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86a0('0x4'));var interaction=require(_0x86a0('0x5'));var config=require(_0x86a0('0x6'));var controller=require(_0x86a0('0x7'));router[_0x86a0('0x8')]('/',auth[_0x86a0('0x9')](),controller[_0x86a0('0xa')]);router[_0x86a0('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x86a0('0x8')](_0x86a0('0xb'),auth[_0x86a0('0x9')](),controller[_0x86a0('0xc')]);router['get'](_0x86a0('0xd'),auth[_0x86a0('0x9')](),controller['download']);router[_0x86a0('0xe')]('/',auth[_0x86a0('0x9')](),controller[_0x86a0('0xf')]);router['put'](_0x86a0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x86a0('0x10')](_0x86a0('0xb'),auth['isAuthenticated'](),controller[_0x86a0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index a413deb..cc9118c 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 _0x8212=['moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','toString','closedAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize'];(function(_0xa51ba0,_0x3bf58d){var _0x17f343=function(_0x149d7a){while(--_0x149d7a){_0xa51ba0['push'](_0xa51ba0['shift']());}};_0x17f343(++_0x3bf58d);}(_0x8212,0xb3));var _0x2821=function(_0x312c24,_0x3fc1cc){_0x312c24=_0x312c24-0x0;var _0x4c80d9=_0x8212[_0x312c24];return _0x4c80d9;};'use strict';var Sequelize=require(_0x2821('0x0'));var moment=require(_0x2821('0x1'));var path=require('path');var config=require(_0x2821('0x2'));module[_0x2821('0x3')]={'format':{'type':Sequelize[_0x2821('0x4')],'get':function(){return this[_0x2821('0x5')](_0x2821('0x6'))?path[_0x2821('0x7')](this[_0x2821('0x5')](_0x2821('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2821('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x376c57){var _0x1dc078=_0x376c57['replace'](/\\/g,'/');this[_0x2821('0x9')](_0x2821('0x6'),_0x1dc078);}},'rating':{'type':Sequelize[_0x2821('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2821('0xa')],'set':function(_0x16003f){this[_0x2821('0x9')](_0x2821('0xb'),moment()[_0x2821('0xc')](_0x16003f,'ms'));this[_0x2821('0x9')]('closedAt',moment());this[_0x2821('0x9')](_0x2821('0xd'),_0x16003f);}},'startedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x2821('0xf')]();}},'closedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this[_0x2821('0x5')](_0x2821('0x10')))[_0x2821('0x11')](_0x2821('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x2821('0x11')](_0x2821('0x12'))[_0x2821('0xf')]();}},'updatedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue'](_0x2821('0x13')))['format'](_0x2821('0x12'))[_0x2821('0xf')]();}}}; \ No newline at end of file +var _0x723c=['format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','subtract','closedAt','DATE','startedAt'];(function(_0x8718af,_0x3d5f1c){var _0x24df2c=function(_0x563925){while(--_0x563925){_0x8718af['push'](_0x8718af['shift']());}};_0x24df2c(++_0x3d5f1c);}(_0x723c,0x1ad));var _0xc723=function(_0x4bdd63,_0x4335ff){_0x4bdd63=_0x4bdd63-0x0;var _0x1dd420=_0x723c[_0x4bdd63];return _0x1dd420;};'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 diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 23ece99..d9ccb80 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 _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5358ca,_0x41c67e){var _0x4175d2=function(_0x1fefab){while(--_0x1fefab){_0x5358ca['push'](_0x5358ca['shift']());}};_0x4175d2(++_0x41c67e);}(_0x8958,0x93));var _0x8895=function(_0x103bfe,_0x534617){_0x103bfe=_0x103bfe-0x0;var _0x38f00e=_0x8958[_0x103bfe];return _0x38f00e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));}; \ No newline at end of file +var _0x0e85=['duration','createdAt','closedAt','params','describe','download','uniqueid','join','root','value','existsSync','secrets','recording','server/files/screen_recordings','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','keys','fields','find','create','body'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0x0e85,0x7c));var _0x50e8=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x0e85[_0x20ef64];return _0x3707d8;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['differenceBy'](_['map'](_0x126c99,_0x50e8('0x26')),[_0x50e8('0x2e')]);_0x4f0b88[_0x50e8('0x2f')]=_['keys'](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x30')]=_[_0x50e8('0x31')](_0x4f0b88['model'],_0x4f0b88[_0x50e8('0x2f')]);_0x42bbef[_0x50e8('0x32')]=_[_0x50e8('0x31')](_0x4f0b88[_0x50e8('0x2d')],qs['fields'](_0x30fedf[_0x50e8('0x2f')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef[_0x50e8('0x32')][_0x50e8('0x33')]?_0x42bbef['attributes']:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf[_0x50e8('0x2f')]['hasOwnProperty'](_0x50e8('0x34'))){_0x42bbef[_0x50e8('0x1d')]=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2f')]['limit']);_0x42bbef[_0x50e8('0x1b')]=qs[_0x50e8('0x1b')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x1b')]);}_0x42bbef['order']=qs[_0x50e8('0x35')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x35')]);_0x42bbef['where']=qs['filters'](_['pick'](_0x30fedf[_0x50e8('0x2f')],_0x4f0b88[_0x50e8('0x30')]),_0x126c99);if(_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]){_0x42bbef[_0x50e8('0x37')]=_[_0x50e8('0x38')](_0x42bbef[_0x50e8('0x37')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0x35f802){if(_0x35f802[_0x50e8('0x39')]!=='VIRTUAL'){var _0x3371a4={};_0x3371a4[_0x35f802[_0x50e8('0x26')]]={'$like':'%'+_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]+'%'};return _0x3371a4;}})});}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x3a')]);var _0x944e46={'where':_0x42bbef[_0x50e8('0x37')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x944e46)['then'](function(_0x53b198){_0x1041b9[_0x50e8('0x1e')]=_0x53b198;if(_0x30fedf[_0x50e8('0x2f')]['includeAll']){_0x42bbef[_0x50e8('0x3b')]=[{'all':!![]}];}return db[_0x50e8('0x29')][_0x50e8('0x3c')](_0x42bbef);})[_0x50e8('0x23')](function(_0x251e1c){_0x1041b9[_0x50e8('0x3d')]=_0x251e1c;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x3e')](handleError(_0x39c0c6,null));};exports['show']=function(_0x3d26bd,_0x44e0ca){var _0x3ea251={'raw':![],'where':{'id':_0x3d26bd['params']['id']}},_0x2adae0={};_0x2adae0[_0x50e8('0x2d')]=_[_0x50e8('0x3f')](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x2adae0['query']=_[_0x50e8('0x3f')](_0x3d26bd['query']);_0x2adae0['filters']=_['intersection'](_0x2adae0[_0x50e8('0x2d')],_0x2adae0[_0x50e8('0x2f')]);_0x3ea251['attributes']=_[_0x50e8('0x31')](_0x2adae0[_0x50e8('0x2d')],qs[_0x50e8('0x40')](_0x3d26bd[_0x50e8('0x2f')][_0x50e8('0x40')]));_0x3ea251[_0x50e8('0x32')]=_0x3ea251['attributes'][_0x50e8('0x33')]?_0x3ea251['attributes']:_0x2adae0[_0x50e8('0x2d')];if(_0x3d26bd[_0x50e8('0x2f')]['includeAll']){_0x3ea251[_0x50e8('0x3b')]=[{'all':!![]}];}_0x3ea251=_['merge']({},_0x3ea251,_0x3d26bd[_0x50e8('0x3a')]);return db[_0x50e8('0x29')][_0x50e8('0x41')](_0x3ea251)[_0x50e8('0x23')](handleEntityNotFound(_0x44e0ca,null))[_0x50e8('0x23')](respondWithResult(_0x44e0ca,null))[_0x50e8('0x3e')](handleError(_0x44e0ca,null));};exports[_0x50e8('0x42')]=function(_0x3e52b3,_0x141bd4){return db[_0x50e8('0x29')][_0x50e8('0x42')](_0x3e52b3['body'],{})[_0x50e8('0x23')](respondWithResult(_0x141bd4,0xc9))[_0x50e8('0x3e')](handleError(_0x141bd4,null));};exports['update']=function(_0x3692ba,_0x58f14e){if(_0x3692ba[_0x50e8('0x43')]['id']){delete _0x3692ba['body']['id'];}delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x44')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x45')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x46')];delete _0x3692ba[_0x50e8('0x43')]['value'];return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x3692ba[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x58f14e,null))[_0x50e8('0x23')](saveUpdates(_0x3692ba[_0x50e8('0x43')],null))['then'](respondWithResult(_0x58f14e,null))[_0x50e8('0x3e')](handleError(_0x58f14e,null));};exports[_0x50e8('0x48')]=function(_0xff2e24,_0x27c80a){return db['ScreenRecording'][_0x50e8('0x48')]()[_0x50e8('0x23')](respondWithResult(_0x27c80a,null))[_0x50e8('0x3e')](handleError(_0x27c80a,null));};exports[_0x50e8('0x49')]=function(_0x207f06,_0x1372e3,_0x320b00){var _0x5f5220=require('../../components/encryptor');var _0x55083e=![];var _0x2b54ad={};if(_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]&&_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]===_0x50e8('0x4a')){_0x2b54ad['uniqueid']=_0x207f06[_0x50e8('0x47')]['id'];}else{_0x2b54ad['id']=_0x207f06[_0x50e8('0x47')]['id'];}return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':_0x2b54ad,'attributes':['id','value'],'raw':!![]})[_0x50e8('0x23')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x23')](function(_0x373b41){if(_0x373b41){var _0x1cc5ba=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],'server/files/screen_recordings',_0x373b41[_0x50e8('0x4d')]);var _0x5d0d54=util['format']('%s.cypher',_0x1cc5ba);if(fs[_0x50e8('0x4e')](_0x5d0d54)){_0x55083e=!![];return _0x5f5220['decryptFile'](_0x5d0d54,_0x1cc5ba,config[_0x50e8('0x4f')][_0x50e8('0x50')])[_0x50e8('0x23')](function(){return _0x373b41;});}return _0x373b41;}})[_0x50e8('0x23')](function(_0x279cf4){if(_0x279cf4){var _0x12224d=path[_0x50e8('0x4b')](config['root'],_0x50e8('0x51'),_0x279cf4[_0x50e8('0x4d')]);if(!fs[_0x50e8('0x4e')](_0x12224d)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x279cf4[_0x50e8('0x52')]){return _0x1372e3[_0x50e8('0x49')](_0x12224d,_0x279cf4[_0x50e8('0x52')]+path[_0x50e8('0x53')](_0x12224d),function(){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}else{return _0x1372e3[_0x50e8('0x49')](_0x12224d,function(_0x583d6a){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}}})['catch'](function(_0x255b48){if(_0x255b48[_0x50e8('0x55')]==='ScreenRecording\x20not\x20found'){_0x1372e3['status'](0x194)['send'](_0x50e8('0x56'));}else{return handleError(_0x1372e3,null);}});};exports[_0x50e8('0x57')]=function(_0x5d1fc8,_0x351047){return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x5d1fc8[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](function(_0x47b428){if(_[_0x50e8('0x58')](_0x47b428)){throw new ReferenceError(_0x50e8('0x59'));}return _0x47b428;})[_0x50e8('0x23')](function(_0x4b80ac){var _0x583e58=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],_0x50e8('0x51'),_0x4b80ac[_0x50e8('0x4d')]);logger[_0x50e8('0x5a')](_0x50e8('0x5b'),_0x583e58);if(!_['isNil'](_0x4b80ac['value'])&&fs[_0x50e8('0x4e')](_0x583e58)){logger['info'](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs['unlinkSync'](_0x583e58);}_0x583e58=_0x583e58+_0x50e8('0x5e');if(!_['isNil'](_0x4b80ac['value'])&&fs['existsSync'](_0x583e58)){logger[_0x50e8('0x5a')](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs[_0x50e8('0x5f')](_0x583e58);}return _0x4b80ac;})['then'](function(_0x480362){if(!_0x480362)throw new InternalError();return _0x480362[_0x50e8('0x57')]();})[_0x50e8('0x23')](function(){_0x351047[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();})[_0x50e8('0x3e')](handleError(_0x351047,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 102f693..26a1abd 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 _0x8d6f=['moment','bluebird','request-promise','path','rimraf','exports','define','ScreenRecording','interactionid','lodash','util','../../config/logger'];(function(_0x10e2b9,_0x3c7ab6){var _0x3fbc38=function(_0x115eda){while(--_0x115eda){_0x10e2b9['push'](_0x10e2b9['shift']());}};_0x3fbc38(++_0x3c7ab6);}(_0x8d6f,0x14d));var _0xf8d6=function(_0x22b1d2,_0x189aab){_0x22b1d2=_0x22b1d2-0x0;var _0x18dd75=_0x8d6f[_0x22b1d2];return _0x18dd75;};'use strict';var _=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var logger=require(_0xf8d6('0x2'))('api');var moment=require(_0xf8d6('0x3'));var BPromise=require(_0xf8d6('0x4'));var rp=require(_0xf8d6('0x5'));var fs=require('fs');var path=require(_0xf8d6('0x6'));var rimraf=require(_0xf8d6('0x7'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xf8d6('0x8')]=function(_0x558273,_0xfb91b){return _0x558273[_0xf8d6('0x9')](_0xf8d6('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xf8d6('0xb'),'fields':[_0xf8d6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16d4=['ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','define'];(function(_0x1ec981,_0x2c084f){var _0x4174cf=function(_0x3f76f3){while(--_0x3f76f3){_0x1ec981['push'](_0x1ec981['shift']());}};_0x4174cf(++_0x2c084f);}(_0x16d4,0x17c));var _0x416d=function(_0x5b735e,_0x31410f){_0x5b735e=_0x5b735e-0x0;var _0x240ace=_0x16d4[_0x5b735e];return _0x240ace;};'use strict';var _=require(_0x416d('0x0'));var util=require(_0x416d('0x1'));var logger=require(_0x416d('0x2'))(_0x416d('0x3'));var moment=require(_0x416d('0x4'));var BPromise=require(_0x416d('0x5'));var rp=require(_0x416d('0x6'));var fs=require('fs');var path=require(_0x416d('0x7'));var rimraf=require(_0x416d('0x8'));var config=require('../../config/environment');var attributes=require(_0x416d('0x9'));module[_0x416d('0xa')]=function(_0xe363bc,_0x57e387){return _0xe363bc[_0x416d('0xb')](_0x416d('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x416d('0xd'),'fields':[_0x416d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 638d6ba..dda4eb7 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 _0x84a1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2fa1f8,_0x3d5fb3){var _0x3a62b3=function(_0x56f394){while(--_0x56f394){_0x2fa1f8['push'](_0x2fa1f8['shift']());}};_0x3a62b3(++_0x3d5fb3);}(_0x84a1,0x1b2));var _0x184a=function(_0x35dc4c,_0x534f37){_0x35dc4c=_0x35dc4c-0x0;var _0x1f001f=_0x84a1[_0x35dc4c];return _0x1f001f;};'use strict';var _=require(_0x184a('0x0'));var util=require(_0x184a('0x1'));var moment=require(_0x184a('0x2'));var BPromise=require(_0x184a('0x3'));var rs=require(_0x184a('0x4'));var fs=require('fs');var Redis=require(_0x184a('0x5'));var db=require(_0x184a('0x6'))['db'];var utils=require(_0x184a('0x7'));var logger=require(_0x184a('0x8'))('rpc');var config=require(_0x184a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x184a('0xa')][_0x184a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bb97c,_0x4a4af8,_0x4b7b96){return new BPromise(function(_0x473636,_0x167c1b){return client[_0x184a('0xc')](_0x4bb97c,_0x4b7b96)[_0x184a('0xd')](function(_0x14c887){logger[_0x184a('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x4a4af8,_0x184a('0xf'));logger['debug'](_0x184a('0x10'),_0x4a4af8,_0x184a('0xf'),JSON['stringify'](_0x14c887));if(_0x14c887[_0x184a('0x11')]){if(_0x14c887[_0x184a('0x11')][_0x184a('0x12')]===0x1f4){logger[_0x184a('0x11')](_0x184a('0x13'),_0x4a4af8,_0x14c887[_0x184a('0x11')][_0x184a('0x14')]);return _0x167c1b(_0x14c887[_0x184a('0x11')][_0x184a('0x14')]);}logger[_0x184a('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4a4af8,_0x14c887['error'][_0x184a('0x14')]);return _0x473636(_0x14c887[_0x184a('0x11')][_0x184a('0x14')]);}else{logger['info'](_0x184a('0x13'),_0x4a4af8,_0x184a('0xf'));_0x473636(_0x14c887[_0x184a('0x15')][_0x184a('0x14')]);}})[_0x184a('0x16')](function(_0x176bf8){logger[_0x184a('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4a4af8,_0x176bf8);_0x167c1b(_0x176bf8);});});} \ No newline at end of file +var _0xebbe=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3b76b1,_0x1bb8b9){var _0xfa0367=function(_0x7cab2c){while(--_0x7cab2c){_0x3b76b1['push'](_0x3b76b1['shift']());}};_0xfa0367(++_0x1bb8b9);}(_0xebbe,0x1a1));var _0xeebb=function(_0x3c4825,_0x3dde08){_0x3c4825=_0x3c4825-0x0;var _0x53c8bd=_0xebbe[_0x3c4825];return _0x53c8bd;};'use strict';var _=require(_0xeebb('0x0'));var util=require(_0xeebb('0x1'));var moment=require(_0xeebb('0x2'));var BPromise=require(_0xeebb('0x3'));var rs=require(_0xeebb('0x4'));var fs=require('fs');var Redis=require(_0xeebb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeebb('0x6'));var logger=require(_0xeebb('0x7'))(_0xeebb('0x8'));var config=require(_0xeebb('0x9'));var jayson=require(_0xeebb('0xa'));var client=jayson[_0xeebb('0xb')][_0xeebb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ec642,_0x3fbb54,_0x34493f){return new BPromise(function(_0x5b6bec,_0x45189e){return client[_0xeebb('0xd')](_0x1ec642,_0x34493f)[_0xeebb('0xe')](function(_0xc2231c){logger[_0xeebb('0xf')](_0xeebb('0x10'),_0x3fbb54,_0xeebb('0x11'));logger[_0xeebb('0x12')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3fbb54,_0xeebb('0x11'),JSON[_0xeebb('0x13')](_0xc2231c));if(_0xc2231c[_0xeebb('0x14')]){if(_0xc2231c['error'][_0xeebb('0x15')]===0x1f4){logger['error'](_0xeebb('0x10'),_0x3fbb54,_0xc2231c['error'][_0xeebb('0x16')]);return _0x45189e(_0xc2231c['error'][_0xeebb('0x16')]);}logger[_0xeebb('0x14')](_0xeebb('0x10'),_0x3fbb54,_0xc2231c[_0xeebb('0x14')]['message']);return _0x5b6bec(_0xc2231c[_0xeebb('0x14')][_0xeebb('0x16')]);}else{logger['info'](_0xeebb('0x10'),_0x3fbb54,_0xeebb('0x11'));_0x5b6bec(_0xc2231c[_0xeebb('0x17')]['message']);}})[_0xeebb('0x18')](function(_0x3d899d){logger[_0xeebb('0x14')](_0xeebb('0x10'),_0x3fbb54,_0x3d899d);_0x45189e(_0x3d899d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 4328044..0fbe727 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 _0xb18e=['format','logologin','extname','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','join','root','server/files/images/logos/','%s%s','logo','originalname','post','/:id/logo','single','file','diskStorage'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb18e,0x67));var _0xeb18=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0xb18e[_0x217ff6];return _0x417c93;};'use strict';var multer=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var path=require(_0xeb18('0x2'));var timeout=require(_0xeb18('0x3'));var express=require(_0xeb18('0x4'));var router=express['Router']();var fs_extra=require(_0xeb18('0x5'));var auth=require(_0xeb18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb18('0x7'));var controller=require(_0xeb18('0x8'));router[_0xeb18('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb18('0x9')](_0xeb18('0xa'),controller[_0xeb18('0xb')]);router[_0xeb18('0x9')](_0xeb18('0xc'),controller[_0xeb18('0xd')]);router['get']('/:id/logo',controller[_0xeb18('0xe')]);router['get'](_0xeb18('0xf'),controller[_0xeb18('0x10')]);router[_0xeb18('0x9')](_0xeb18('0x11'),controller[_0xeb18('0x12')]);router[_0xeb18('0x9')]('/:id/preferred',controller[_0xeb18('0x13')]);router[_0xeb18('0x9')](_0xeb18('0x14'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43c220,_0x402f18,_0x7b55d0){_0x7b55d0(null,path[_0xeb18('0x15')](config[_0xeb18('0x16')],_0xeb18('0x17')));},'filename':function(_0xcd2095,_0x13b1b3,_0x356d44){_0x356d44(null,util['format'](_0xeb18('0x18'),_0xeb18('0x19'),path['extname'](_0x13b1b3[_0xeb18('0x1a')])));}})});router[_0xeb18('0x1b')](_0xeb18('0x1c'),upload[_0xeb18('0x1d')](_0xeb18('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xeb18('0x1f')]({'destination':function(_0x393836,_0x4e286b,_0x5c7009){_0x5c7009(null,path['join'](config['root'],_0xeb18('0x17')));},'filename':function(_0x2580a3,_0x507d50,_0x13ba6a){_0x13ba6a(null,util[_0xeb18('0x20')](_0xeb18('0x18'),_0xeb18('0x21'),path[_0xeb18('0x22')](_0x507d50[_0xeb18('0x1a')])));}})});router[_0xeb18('0x1b')](_0xeb18('0xf'),upload[_0xeb18('0x1d')](_0xeb18('0x1e')),controller[_0xeb18('0x23')]);var upload=multer({'storage':multer[_0xeb18('0x1f')]({'destination':function(_0x360b15,_0x2141be,_0x22ae36){_0x22ae36(null,path[_0xeb18('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5ba720,_0x20c90a,_0x54bd1d){_0x54bd1d(null,util['format'](_0xeb18('0x18'),_0xeb18('0x24'),path['extname'](_0x20c90a[_0xeb18('0x1a')])));}})});router[_0xeb18('0x1b')](_0xeb18('0x25'),upload[_0xeb18('0x1d')](_0xeb18('0x1e')),controller[_0xeb18('0x26')]);var upload=multer({'storage':multer[_0xeb18('0x1f')]({'destination':function(_0x378994,_0x1ae64d,_0x2ca8f0){_0x2ca8f0(null,path[_0xeb18('0x15')](config[_0xeb18('0x16')],_0xeb18('0x17')));},'filename':function(_0x15fdb7,_0x412b94,_0x3c922e){_0x3c922e(null,util['format'](_0xeb18('0x18'),_0xeb18('0x27'),path[_0xeb18('0x22')](_0x412b94[_0xeb18('0x1a')])));}})});router['post']('/:id/favicon',upload[_0xeb18('0x1d')](_0xeb18('0x1e')),controller[_0xeb18('0x28')]);router[_0xeb18('0x29')](_0xeb18('0xc'),auth[_0xeb18('0x2a')](),controller[_0xeb18('0x2b')]);module[_0xeb18('0x2c')]=router; \ No newline at end of file +var _0x6661=['single','file','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','/:id','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','addLogo','root'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0x6661,0x1de));var _0x1666=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6661[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x1666('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1666('0x1'));var router=express['Router']();var fs_extra=require(_0x1666('0x2'));var auth=require(_0x1666('0x3'));var interaction=require(_0x1666('0x4'));var config=require(_0x1666('0x5'));var controller=require('./setting.controller');router[_0x1666('0x6')]('/',auth[_0x1666('0x7')](),controller[_0x1666('0x8')]);router['get'](_0x1666('0x9'),controller[_0x1666('0xa')]);router['get']('/:id',controller['show']);router[_0x1666('0x6')](_0x1666('0xb'),controller[_0x1666('0xc')]);router['get'](_0x1666('0xd'),controller[_0x1666('0xe')]);router['get'](_0x1666('0xf'),controller['gdpr']);router[_0x1666('0x6')](_0x1666('0x10'),controller[_0x1666('0x11')]);router[_0x1666('0x6')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x1666('0x12')]({'destination':function(_0x52a691,_0x727193,_0x4c9bca){_0x4c9bca(null,path[_0x1666('0x13')](config['root'],_0x1666('0x14')));},'filename':function(_0x1b09df,_0x5adea1,_0x12f060){_0x12f060(null,util[_0x1666('0x15')](_0x1666('0x16'),_0x1666('0x17'),path[_0x1666('0x18')](_0x5adea1[_0x1666('0x19')])));}})});router[_0x1666('0x1a')](_0x1666('0xb'),upload['single']('file'),controller[_0x1666('0x1b')]);var upload=multer({'storage':multer[_0x1666('0x12')]({'destination':function(_0x1a1456,_0x59ca8d,_0x5868c7){_0x5868c7(null,path[_0x1666('0x13')](config[_0x1666('0x1c')],_0x1666('0x14')));},'filename':function(_0xa87d44,_0x4b3e07,_0x360c15){_0x360c15(null,util[_0x1666('0x15')](_0x1666('0x16'),'logologin',path[_0x1666('0x18')](_0x4b3e07['originalname'])));}})});router[_0x1666('0x1a')]('/:id/logo_login',upload[_0x1666('0x1d')](_0x1666('0x1e')),controller[_0x1666('0x1f')]);var upload=multer({'storage':multer[_0x1666('0x12')]({'destination':function(_0x54575e,_0x4d9698,_0x316da2){_0x316da2(null,path[_0x1666('0x13')](config[_0x1666('0x1c')],_0x1666('0x14')));},'filename':function(_0x44485a,_0x586de6,_0x146b29){_0x146b29(null,util[_0x1666('0x15')](_0x1666('0x16'),_0x1666('0x20'),path[_0x1666('0x18')](_0x586de6[_0x1666('0x19')])));}})});router['post'](_0x1666('0x10'),upload[_0x1666('0x1d')](_0x1666('0x1e')),controller[_0x1666('0x21')]);var upload=multer({'storage':multer[_0x1666('0x12')]({'destination':function(_0x26f07b,_0x525a93,_0x2c7223){_0x2c7223(null,path[_0x1666('0x13')](config['root'],_0x1666('0x14')));},'filename':function(_0x3fbd78,_0x5b6c7c,_0xa404cf){_0xa404cf(null,util[_0x1666('0x15')](_0x1666('0x16'),_0x1666('0x22'),path[_0x1666('0x18')](_0x5b6c7c['originalname'])));}})});router[_0x1666('0x1a')](_0x1666('0x23'),upload[_0x1666('0x1d')](_0x1666('0x1e')),controller[_0x1666('0x24')]);router['put'](_0x1666('0x25'),auth[_0x1666('0x7')](),controller['update']);module[_0x1666('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 23b19b1..c4608ef 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x22085a,_0x589318){var _0x528c36=function(_0x4bcd66){while(--_0x4bcd66){_0x22085a['push'](_0x22085a['shift']());}};_0x528c36(++_0x589318);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x56afb0,_0x399355){var _0x2e3028=function(_0x2608d2){while(--_0x2608d2){_0x56afb0['push'](_0x56afb0['shift']());}};_0x2e3028(++_0x399355);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index bf4c852..c82cbe3 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 _0xbf04=['apply','save','update','stack','name','send','index','map','rawAttributes','type','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','show','params','length','find','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','logo','root','default_logo.svg','custom','Sequelize','ValidationError','\x20not\x20found','getLicense','default_loginLogo.svg','upperFirst','download','securePassword','addPreferred','defaultLogo','default_preferred.png','getFavicon','default_favicon.ico','default','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','Setting,\x20%s,\x20%s','message','catch','status','end','json','offset','limit','count','set','Content-Range'];(function(_0x5438a5,_0x29c8ed){var _0x4fedaa=function(_0x3d5c04){while(--_0x3d5c04){_0x5438a5['push'](_0x5438a5['shift']());}};_0x4fedaa(++_0x29c8ed);}(_0xbf04,0xc1));var _0x4bf0=function(_0x4f6ebc,_0x343ffb){_0x4f6ebc=_0x4f6ebc-0x0;var _0x43c18a=_0xbf04[_0x4f6ebc];return _0x43c18a;};'use strict';var emlformat=require(_0x4bf0('0x0'));var rimraf=require(_0x4bf0('0x1'));var zipdir=require(_0x4bf0('0x2'));var jsonpatch=require(_0x4bf0('0x3'));var rp=require('request-promise');var moment=require(_0x4bf0('0x4'));var BPromise=require(_0x4bf0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4bf0('0x6'));var sox=require(_0x4bf0('0x7'));var csv=require('to-csv');var ejs=require(_0x4bf0('0x8'));var fs=require('fs');var fs_extra=require(_0x4bf0('0x9'));var _=require(_0x4bf0('0xa'));var squel=require(_0x4bf0('0xb'));var crypto=require('crypto');var jsforce=require(_0x4bf0('0xc'));var deskjs=require(_0x4bf0('0xd'));var toCsv=require(_0x4bf0('0xe'));var querystring=require(_0x4bf0('0xf'));var Papa=require(_0x4bf0('0x10'));var Redis=require('ioredis');var authService=require(_0x4bf0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4bf0('0x12'));var hardwareService=require(_0x4bf0('0x13'));var logger=require(_0x4bf0('0x14'))(_0x4bf0('0x15'));var utils=require('../../config/utils');var config=require(_0x4bf0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x4bf0('0x17'));var client=jayson[_0x4bf0('0x18')][_0x4bf0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2e3f67,_0x542545,_0x58a47c,_0x4b088f){return new BPromise(function(_0x2cfb14,_0x13a30e){var _0xaa8b5e=_0x4b088f||client;return _0xaa8b5e[_0x4bf0('0x1a')](_0x2e3f67,_0x58a47c)[_0x4bf0('0x1b')](function(_0x2659ad){logger[_0x4bf0('0x1c')]('Setting,\x20%s,\x20%s',_0x542545,_0x4bf0('0x1d'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x542545,_0x4bf0('0x1d'),JSON['stringify'](_0x2659ad));if(_0x2659ad[_0x4bf0('0x1e')]){if(_0x2659ad[_0x4bf0('0x1e')][_0x4bf0('0x1f')]===0x1f4){logger[_0x4bf0('0x1e')](_0x4bf0('0x20'),_0x542545,_0x2659ad[_0x4bf0('0x1e')]['message']);return _0x13a30e(_0x2659ad[_0x4bf0('0x1e')][_0x4bf0('0x21')]);}logger[_0x4bf0('0x1e')]('Setting,\x20%s,\x20%s',_0x542545,_0x2659ad['error'][_0x4bf0('0x21')]);return _0x2cfb14(_0x2659ad['error'][_0x4bf0('0x21')]);}else{logger[_0x4bf0('0x1c')]('Setting,\x20%s,\x20%s',_0x542545,_0x4bf0('0x1d'));_0x2cfb14(_0x2659ad['result']['message']);}})[_0x4bf0('0x22')](function(_0x4f9004){logger[_0x4bf0('0x1e')]('Setting,\x20%s,\x20%s',_0x542545,_0x4f9004);_0x13a30e(_0x4f9004);});});}function respondWithStatusCode(_0x202ad8,_0x40bf5a){_0x40bf5a=_0x40bf5a||0xcc;return function(_0x2ae478){if(_0x2ae478){return _0x202ad8['sendStatus'](_0x40bf5a);}return _0x202ad8[_0x4bf0('0x23')](_0x40bf5a)[_0x4bf0('0x24')]();};}function respondWithResult(_0x83e7ec,_0x28f065){_0x28f065=_0x28f065||0xc8;return function(_0x3f3708){if(_0x3f3708){return _0x83e7ec[_0x4bf0('0x23')](_0x28f065)[_0x4bf0('0x25')](_0x3f3708);}};}function respondWithFilteredResult(_0x150427,_0x2b0c8e){return function(_0x49bb67){if(_0x49bb67){var _0x421663=typeof _0x2b0c8e[_0x4bf0('0x26')]==='undefined'&&typeof _0x2b0c8e[_0x4bf0('0x27')]==='undefined';var _0x2773da=_0x49bb67[_0x4bf0('0x28')];var _0x4de014=_0x421663?0x0:_0x2b0c8e[_0x4bf0('0x26')];var _0x43d2d3=_0x421663?_0x49bb67['count']:_0x2b0c8e['offset']+_0x2b0c8e['limit'];var _0x332a66;if(_0x43d2d3>=_0x2773da){_0x43d2d3=_0x2773da;_0x332a66=0xc8;}else{_0x332a66=0xce;}_0x150427[_0x4bf0('0x23')](_0x332a66);return _0x150427[_0x4bf0('0x29')](_0x4bf0('0x2a'),_0x4de014+'-'+_0x43d2d3+'/'+_0x2773da)[_0x4bf0('0x25')](_0x49bb67);}return null;};}function patchUpdates(_0x443fac){return function(_0x7799a7){try{jsonpatch[_0x4bf0('0x2b')](_0x7799a7,_0x443fac,!![]);}catch(_0x3cc049){return BPromise['reject'](_0x3cc049);}return _0x7799a7[_0x4bf0('0x2c')]();};}function saveUpdates(_0x1868e4,_0x3d583d){return function(_0x1fae0f){if(_0x1fae0f){return _0x1fae0f[_0x4bf0('0x2d')](_0x1868e4)['then'](function(_0xb4f415){return _0xb4f415;});}return null;};}function removeEntity(_0x2102c9,_0x1cdbf3){return function(_0x2c009a){if(_0x2c009a){return _0x2c009a['destroy']()[_0x4bf0('0x1b')](function(){_0x2102c9[_0x4bf0('0x23')](0xcc)[_0x4bf0('0x24')]();});}};}function handleEntityNotFound(_0x22ad76,_0x53ab7f){return function(_0x4af327){if(!_0x4af327){_0x22ad76['sendStatus'](0x194);}return _0x4af327;};}function handleError(_0x43b2c6,_0x23306f){_0x23306f=_0x23306f||0x1f4;return function(_0x3cdf5f){logger[_0x4bf0('0x1e')](_0x3cdf5f[_0x4bf0('0x2e')]);if(_0x3cdf5f[_0x4bf0('0x2f')]){delete _0x3cdf5f[_0x4bf0('0x2f')];}_0x43b2c6['status'](_0x23306f)[_0x4bf0('0x30')](_0x3cdf5f);};}exports[_0x4bf0('0x31')]=function(_0x3630bc,_0x2853f8){var _0x5b7a0={},_0x5390b0={},_0x2c9fd1={'count':0x0,'rows':[]};var _0x33a207=_[_0x4bf0('0x32')](db['Setting'][_0x4bf0('0x33')],function(_0x2ba575){return{'name':_0x2ba575['fieldName'],'type':_0x2ba575[_0x4bf0('0x34')][_0x4bf0('0x35')]};});_0x5390b0['model']=_[_0x4bf0('0x32')](_0x33a207,'name');_0x5390b0['query']=_[_0x4bf0('0x36')](_0x3630bc['query']);_0x5390b0[_0x4bf0('0x37')]=_['intersection'](_0x5390b0[_0x4bf0('0x38')],_0x5390b0[_0x4bf0('0x39')]);_0x5b7a0[_0x4bf0('0x3a')]=_[_0x4bf0('0x3b')](_0x5390b0['model'],qs[_0x4bf0('0x3c')](_0x3630bc['query']['fields']));_0x5b7a0[_0x4bf0('0x3a')]=_0x5b7a0[_0x4bf0('0x3a')]['length']?_0x5b7a0[_0x4bf0('0x3a')]:_0x5390b0[_0x4bf0('0x38')];if(!_0x3630bc['query'][_0x4bf0('0x3d')]('nolimit')){_0x5b7a0[_0x4bf0('0x27')]=qs[_0x4bf0('0x27')](_0x3630bc[_0x4bf0('0x39')][_0x4bf0('0x27')]);_0x5b7a0[_0x4bf0('0x26')]=qs['offset'](_0x3630bc['query']['offset']);}_0x5b7a0[_0x4bf0('0x3e')]=qs['sort'](_0x3630bc[_0x4bf0('0x39')][_0x4bf0('0x3f')]);_0x5b7a0['where']=qs[_0x4bf0('0x37')](_['pick'](_0x3630bc[_0x4bf0('0x39')],_0x5390b0[_0x4bf0('0x37')]),_0x33a207);if(_0x3630bc[_0x4bf0('0x39')][_0x4bf0('0x40')]){_0x5b7a0[_0x4bf0('0x41')]=_[_0x4bf0('0x42')](_0x5b7a0[_0x4bf0('0x41')],{'$or':_[_0x4bf0('0x32')](_0x33a207,function(_0x90ff62){if(_0x90ff62[_0x4bf0('0x34')]!==_0x4bf0('0x43')){var _0x5e65b5={};_0x5e65b5[_0x90ff62[_0x4bf0('0x2f')]]={'$like':'%'+_0x3630bc[_0x4bf0('0x39')][_0x4bf0('0x40')]+'%'};return _0x5e65b5;}})});}_0x5b7a0=_[_0x4bf0('0x42')]({},_0x5b7a0,_0x3630bc[_0x4bf0('0x44')]);var _0xd787cc={'where':_0x5b7a0[_0x4bf0('0x41')]};return db[_0x4bf0('0x45')][_0x4bf0('0x28')](_0xd787cc)[_0x4bf0('0x1b')](function(_0x567d6d){_0x2c9fd1[_0x4bf0('0x28')]=_0x567d6d;if(_0x3630bc[_0x4bf0('0x39')][_0x4bf0('0x46')]){_0x5b7a0[_0x4bf0('0x47')]=[{'all':!![]}];}return db[_0x4bf0('0x45')][_0x4bf0('0x48')](_0x5b7a0);})[_0x4bf0('0x1b')](function(_0x5c5157){_0x2c9fd1[_0x4bf0('0x49')]=_0x5c5157;return _0x2c9fd1;})['then'](respondWithFilteredResult(_0x2853f8,_0x5b7a0))[_0x4bf0('0x22')](handleError(_0x2853f8,null));};exports[_0x4bf0('0x4a')]=function(_0x2561d8,_0x24dfd0){var _0x52dc0={'raw':![],'where':{'id':_0x2561d8[_0x4bf0('0x4b')]['id']}},_0x52f650={};_0x52f650['model']=_[_0x4bf0('0x36')](db[_0x4bf0('0x45')][_0x4bf0('0x33')]);_0x52f650[_0x4bf0('0x39')]=_[_0x4bf0('0x36')](_0x2561d8[_0x4bf0('0x39')]);_0x52f650['filters']=_['intersection'](_0x52f650[_0x4bf0('0x38')],_0x52f650[_0x4bf0('0x39')]);_0x52dc0[_0x4bf0('0x3a')]=_[_0x4bf0('0x3b')](_0x52f650[_0x4bf0('0x38')],qs['fields'](_0x2561d8['query'][_0x4bf0('0x3c')]));_0x52dc0['attributes']=_0x52dc0[_0x4bf0('0x3a')][_0x4bf0('0x4c')]?_0x52dc0[_0x4bf0('0x3a')]:_0x52f650[_0x4bf0('0x38')];if(_0x2561d8[_0x4bf0('0x39')][_0x4bf0('0x46')]){_0x52dc0[_0x4bf0('0x47')]=[{'all':!![]}];}_0x52dc0=_[_0x4bf0('0x42')]({},_0x52dc0,_0x2561d8['options']);return db[_0x4bf0('0x45')][_0x4bf0('0x4d')](_0x52dc0)[_0x4bf0('0x1b')](handleEntityNotFound(_0x24dfd0,null))[_0x4bf0('0x1b')](respondWithResult(_0x24dfd0,null))[_0x4bf0('0x22')](handleError(_0x24dfd0,null));};exports[_0x4bf0('0x2d')]=function(_0x443f46,_0x9df00d){if(_0x443f46[_0x4bf0('0x4e')]['id']){delete _0x443f46['body']['id'];}return db[_0x4bf0('0x45')]['find']({'where':{'id':_0x443f46[_0x4bf0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9df00d,null))[_0x4bf0('0x1b')](saveUpdates(_0x443f46['body'],null))[_0x4bf0('0x1b')](respondWithResult(_0x9df00d,null))[_0x4bf0('0x22')](handleError(_0x9df00d,null));};exports[_0x4bf0('0x4f')]=function(_0x311ad4,_0x143e0d,_0x5ab35c){if(_0x311ad4['file']&&_0x311ad4[_0x4bf0('0x50')]['filename']){_0x311ad4[_0x4bf0('0x4e')]['logo']=_0x311ad4['file'][_0x4bf0('0x51')];}return db['Setting']['find']({'where':{'id':_0x311ad4[_0x4bf0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x143e0d,null))[_0x4bf0('0x1b')](saveUpdates(_0x311ad4[_0x4bf0('0x4e')],null))['then'](respondWithResult(_0x143e0d,null))['catch'](handleError(_0x143e0d,null));};exports[_0x4bf0('0x52')]=function(_0x476310,_0xbf04f7,_0x58c1b8){if(_0x476310[_0x4bf0('0x50')]&&_0x476310[_0x4bf0('0x50')][_0x4bf0('0x51')]){_0x476310['body'][_0x4bf0('0x53')]=_0x476310[_0x4bf0('0x50')][_0x4bf0('0x51')];}return db[_0x4bf0('0x45')][_0x4bf0('0x4d')]({'where':{'id':_0x476310[_0x4bf0('0x4b')]['id']}})[_0x4bf0('0x1b')](handleEntityNotFound(_0xbf04f7,null))[_0x4bf0('0x1b')](saveUpdates(_0x476310['body'],null))['then'](respondWithResult(_0xbf04f7,null))[_0x4bf0('0x22')](handleError(_0xbf04f7,null));};var utilLicense=require(_0x4bf0('0x54'));exports[_0x4bf0('0x55')]=function(_0x2bb0e8,_0x11a0aa,_0x57b422){var _0x164288=_0x4bf0('0x56');var _0x44a785={'custom':![]};return utilLicense['getLicense']()[_0x4bf0('0x1b')](function(_0x13a432){if(_0x13a432){_0x44a785=_0x13a432;}return db['Setting'][_0x4bf0('0x4d')]({'where':{'id':_0x2bb0e8[_0x4bf0('0x4b')]['id']},'attributes':['logo',_0x4bf0('0x53'),_0x4bf0('0x57'),_0x4bf0('0x58'),'defaultLogo',_0x4bf0('0x59'),_0x4bf0('0x5a'),_0x4bf0('0x5b')],'raw':!![]});})[_0x4bf0('0x1b')](handleEntityNotFound(_0x11a0aa,null))[_0x4bf0('0x1b')](function(_0x13a375){if(_0x13a375){var _0x51f393=_0x13a375['logo']&&fs[_0x4bf0('0x5c')](path[_0x4bf0('0x5d')](config['root'],_0x164288,_[_0x4bf0('0x5e')](_0x13a375[_0x4bf0('0x5f')])))?path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x164288,_[_0x4bf0('0x5e')](_0x13a375[_0x4bf0('0x5f')])):path[_0x4bf0('0x5d')](config['root'],_0x164288,_[_0x4bf0('0x5e')](_0x4bf0('0x61')));var _0x45b661='default'+_['upperFirst']('logo');if(_0x13a375[_0x45b661]||!_0x44a785[_0x4bf0('0x62')]){_0x51f393=path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x164288,_['toLower'](_0x4bf0('0x61')));}if(!fs[_0x4bf0('0x5c')](_0x51f393)){throw new db[(_0x4bf0('0x63'))][(_0x4bf0('0x64'))](_['upperFirst'](_0x4bf0('0x5f'))+_0x4bf0('0x65'));}return _0x11a0aa['download'](_0x51f393);}})[_0x4bf0('0x22')](handleError(_0x11a0aa,null));};var utilLicense=require(_0x4bf0('0x54'));exports['getLogoLogin']=function(_0x27d88d,_0x20319b,_0x24a0ba){var _0x5b9d4a=_0x4bf0('0x56');var _0x40fe20={'custom':![]};return utilLicense[_0x4bf0('0x66')]()['then'](function(_0x22fea4){if(_0x22fea4){_0x40fe20=_0x22fea4;}return db['Setting']['find']({'where':{'id':_0x27d88d['params']['id']},'attributes':['logo',_0x4bf0('0x53'),_0x4bf0('0x57'),'favicon','defaultLogo',_0x4bf0('0x59'),_0x4bf0('0x5a'),_0x4bf0('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x20319b,null))[_0x4bf0('0x1b')](function(_0x2d29f3){if(_0x2d29f3){var _0x42db29=_0x2d29f3[_0x4bf0('0x53')]&&fs['existsSync'](path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x5b9d4a,_[_0x4bf0('0x5e')](_0x2d29f3[_0x4bf0('0x53')])))?path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x5b9d4a,_['toLower'](_0x2d29f3['loginLogo'])):path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x5b9d4a,_[_0x4bf0('0x5e')](_0x4bf0('0x67')));var _0x1474d4='default'+_[_0x4bf0('0x68')](_0x4bf0('0x53'));if(_0x2d29f3[_0x1474d4]||!_0x40fe20['custom']){_0x42db29=path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x5b9d4a,_[_0x4bf0('0x5e')]('default_loginLogo.svg'));}if(!fs[_0x4bf0('0x5c')](_0x42db29)){throw new db['Sequelize'][(_0x4bf0('0x64'))](_[_0x4bf0('0x68')]('loginLogo')+_0x4bf0('0x65'));}return _0x20319b[_0x4bf0('0x69')](_0x42db29);}})[_0x4bf0('0x22')](handleError(_0x20319b,null));};exports['gdpr']=function(_0x398117,_0x4a622f){return db[_0x4bf0('0x45')][_0x4bf0('0x4d')]({'where':{'id':_0x398117['params']['id']},'attributes':[_0x4bf0('0x6a')]})[_0x4bf0('0x1b')](respondWithResult(_0x4a622f,null))[_0x4bf0('0x22')](handleError(_0x4a622f,null));};exports[_0x4bf0('0x6b')]=function(_0x7cfbfc,_0x4f43a9,_0x12d1fa){if(_0x7cfbfc[_0x4bf0('0x50')]&&_0x7cfbfc[_0x4bf0('0x50')][_0x4bf0('0x51')]){_0x7cfbfc[_0x4bf0('0x4e')][_0x4bf0('0x57')]=_0x7cfbfc[_0x4bf0('0x50')][_0x4bf0('0x51')];}return db[_0x4bf0('0x45')][_0x4bf0('0x4d')]({'where':{'id':_0x7cfbfc[_0x4bf0('0x4b')]['id']}})[_0x4bf0('0x1b')](handleEntityNotFound(_0x4f43a9,null))['then'](saveUpdates(_0x7cfbfc[_0x4bf0('0x4e')],null))[_0x4bf0('0x1b')](respondWithResult(_0x4f43a9,null))['catch'](handleError(_0x4f43a9,null));};var utilLicense=require(_0x4bf0('0x54'));exports['getPreferred']=function(_0x23fa18,_0x4120cd,_0x432c02){var _0x2719c7='server/files/images/logos';var _0x149a8e={'custom':![]};return utilLicense[_0x4bf0('0x66')]()[_0x4bf0('0x1b')](function(_0x1db4ae){if(_0x1db4ae){_0x149a8e=_0x1db4ae;}return db[_0x4bf0('0x45')]['find']({'where':{'id':_0x23fa18[_0x4bf0('0x4b')]['id']},'attributes':[_0x4bf0('0x5f'),_0x4bf0('0x53'),_0x4bf0('0x57'),_0x4bf0('0x58'),_0x4bf0('0x6c'),_0x4bf0('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x4bf0('0x1b')](handleEntityNotFound(_0x4120cd,null))[_0x4bf0('0x1b')](function(_0x291bc0){if(_0x291bc0){var _0x57c3f2=_0x291bc0[_0x4bf0('0x57')]&&fs['existsSync'](path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x2719c7,_[_0x4bf0('0x5e')](_0x291bc0[_0x4bf0('0x57')])))?path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x2719c7,_['toLower'](_0x291bc0[_0x4bf0('0x57')])):path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x2719c7,_[_0x4bf0('0x5e')](_0x4bf0('0x6d')));var _0x2073e0='default'+_[_0x4bf0('0x68')](_0x4bf0('0x57'));if(_0x291bc0[_0x2073e0]||!_0x149a8e[_0x4bf0('0x62')]||!_0x149a8e['preferred']){_0x57c3f2=path[_0x4bf0('0x5d')](config[_0x4bf0('0x60')],_0x2719c7,_['toLower']('default_preferred.png'));}if(!fs[_0x4bf0('0x5c')](_0x57c3f2)){throw new db[(_0x4bf0('0x63'))]['ValidationError'](_['upperFirst']('preferred')+_0x4bf0('0x65'));}return _0x4120cd[_0x4bf0('0x69')](_0x57c3f2);}})[_0x4bf0('0x22')](handleError(_0x4120cd,null));};exports['addFavicon']=function(_0x3a7667,_0x1e8976,_0x47c8fe){if(_0x3a7667[_0x4bf0('0x50')]&&_0x3a7667[_0x4bf0('0x50')]['filename']){_0x3a7667[_0x4bf0('0x4e')][_0x4bf0('0x58')]=_0x3a7667[_0x4bf0('0x50')][_0x4bf0('0x51')];}return db['Setting']['find']({'where':{'id':_0x3a7667['params']['id']}})[_0x4bf0('0x1b')](handleEntityNotFound(_0x1e8976,null))[_0x4bf0('0x1b')](saveUpdates(_0x3a7667['body'],null))[_0x4bf0('0x1b')](respondWithResult(_0x1e8976,null))[_0x4bf0('0x22')](handleError(_0x1e8976,null));};var utilLicense=require(_0x4bf0('0x54'));exports[_0x4bf0('0x6e')]=function(_0x3b4de3,_0x597c78,_0x530ee2){var _0x45aaf1=_0x4bf0('0x56');var _0x47d63b={'custom':![]};return utilLicense[_0x4bf0('0x66')]()['then'](function(_0x24b081){if(_0x24b081){_0x47d63b=_0x24b081;}return db[_0x4bf0('0x45')][_0x4bf0('0x4d')]({'where':{'id':_0x3b4de3['params']['id']},'attributes':[_0x4bf0('0x5f'),_0x4bf0('0x53'),_0x4bf0('0x57'),'favicon',_0x4bf0('0x6c'),_0x4bf0('0x59'),_0x4bf0('0x5a'),'defaultFavicon'],'raw':!![]});})[_0x4bf0('0x1b')](handleEntityNotFound(_0x597c78,null))[_0x4bf0('0x1b')](function(_0x1d2b47){if(_0x1d2b47){var _0xd41f08=_0x1d2b47[_0x4bf0('0x58')]&&fs[_0x4bf0('0x5c')](path['join'](config[_0x4bf0('0x60')],_0x45aaf1,_['toLower'](_0x1d2b47['favicon'])))?path['join'](config['root'],_0x45aaf1,_[_0x4bf0('0x5e')](_0x1d2b47[_0x4bf0('0x58')])):path['join'](config[_0x4bf0('0x60')],_0x45aaf1,_[_0x4bf0('0x5e')](_0x4bf0('0x6f')));var _0x5e166a=_0x4bf0('0x70')+_[_0x4bf0('0x68')]('favicon');if(_0x1d2b47[_0x5e166a]||!_0x47d63b[_0x4bf0('0x62')]){_0xd41f08=path[_0x4bf0('0x5d')](config['root'],_0x45aaf1,_[_0x4bf0('0x5e')](_0x4bf0('0x6f')));}if(!fs[_0x4bf0('0x5c')](_0xd41f08)){throw new db[(_0x4bf0('0x63'))]['ValidationError'](_['upperFirst'](_0x4bf0('0x58'))+'\x20not\x20found');}return _0x597c78[_0x4bf0('0x69')](_0xd41f08);}})['catch'](handleError(_0x597c78,null));};exports[_0x4bf0('0x71')]=function(_0x9b8f85,_0xb46d0){var _0x5c37fa={'offset':moment()['utcOffset']()};_0x5c37fa[_0x4bf0('0x72')]=moment()[_0x4bf0('0x73')](_0x5c37fa[_0x4bf0('0x26')])[_0x4bf0('0x74')](_0x4bf0('0x75'));return _0xb46d0[_0x4bf0('0x23')](0xc8)[_0x4bf0('0x30')](_0x5c37fa);}; \ No newline at end of file +var _0xfa5d=['order','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','body','addLogo','file','filename','logo','loginLogo','getLogo','getLicense','favicon','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','download','getLogoLogin','server/files/images/logos','defaultLogo','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','preferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xfa5d,0x19e));var _0xdfa5=function(_0xabe17,_0xfdd083){_0xabe17=_0xabe17-0x0;var _0x3b6c1f=_0xfa5d[_0xabe17];return _0x3b6c1f;};'use strict';var emlformat=require(_0xdfa5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfa5('0x1'));var moment=require(_0xdfa5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdfa5('0x3'));var path=require('path');var sox=require(_0xdfa5('0x4'));var csv=require(_0xdfa5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfa5('0x6'));var _=require('lodash');var squel=require(_0xdfa5('0x7'));var crypto=require(_0xdfa5('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xdfa5('0x9'));var toCsv=require('to-csv');var querystring=require(_0xdfa5('0xa'));var Papa=require(_0xdfa5('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa5('0xc'));var as=require(_0xdfa5('0xd'));var hardwareService=require(_0xdfa5('0xe'));var logger=require(_0xdfa5('0xf'))(_0xdfa5('0x10'));var utils=require(_0xdfa5('0x11'));var config=require(_0xdfa5('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xdfa5('0x13'));var client=jayson[_0xdfa5('0x14')][_0xdfa5('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x3aec3e,_0x2911b9,_0x22c25d,_0x28ccf0){return new BPromise(function(_0x240657,_0x3d5c9b){var _0x1515e3=_0x28ccf0||client;return _0x1515e3[_0xdfa5('0x16')](_0x3aec3e,_0x22c25d)['then'](function(_0x291ec2){logger[_0xdfa5('0x17')]('Setting,\x20%s,\x20%s',_0x2911b9,_0xdfa5('0x18'));logger[_0xdfa5('0x19')](_0xdfa5('0x1a'),_0x2911b9,_0xdfa5('0x18'),JSON[_0xdfa5('0x1b')](_0x291ec2));if(_0x291ec2['error']){if(_0x291ec2[_0xdfa5('0x1c')][_0xdfa5('0x1d')]===0x1f4){logger[_0xdfa5('0x1c')]('Setting,\x20%s,\x20%s',_0x2911b9,_0x291ec2[_0xdfa5('0x1c')][_0xdfa5('0x1e')]);return _0x3d5c9b(_0x291ec2[_0xdfa5('0x1c')][_0xdfa5('0x1e')]);}logger[_0xdfa5('0x1c')](_0xdfa5('0x1f'),_0x2911b9,_0x291ec2[_0xdfa5('0x1c')][_0xdfa5('0x1e')]);return _0x240657(_0x291ec2['error'][_0xdfa5('0x1e')]);}else{logger[_0xdfa5('0x17')](_0xdfa5('0x1f'),_0x2911b9,_0xdfa5('0x18'));_0x240657(_0x291ec2[_0xdfa5('0x20')]['message']);}})[_0xdfa5('0x21')](function(_0x5f5d4d){logger[_0xdfa5('0x1c')](_0xdfa5('0x1f'),_0x2911b9,_0x5f5d4d);_0x3d5c9b(_0x5f5d4d);});});}function respondWithStatusCode(_0x251656,_0xdb656e){_0xdb656e=_0xdb656e||0xcc;return function(_0x428147){if(_0x428147){return _0x251656[_0xdfa5('0x22')](_0xdb656e);}return _0x251656[_0xdfa5('0x23')](_0xdb656e)[_0xdfa5('0x24')]();};}function respondWithResult(_0x59dba5,_0x25ce4f){_0x25ce4f=_0x25ce4f||0xc8;return function(_0x2c2497){if(_0x2c2497){return _0x59dba5[_0xdfa5('0x23')](_0x25ce4f)['json'](_0x2c2497);}};}function respondWithFilteredResult(_0x1b7c20,_0xdeed53){return function(_0x41340f){if(_0x41340f){var _0x34ebf2=typeof _0xdeed53[_0xdfa5('0x25')]===_0xdfa5('0x26')&&typeof _0xdeed53[_0xdfa5('0x27')]===_0xdfa5('0x26');var _0xe01aff=_0x41340f[_0xdfa5('0x28')];var _0x1ec03a=_0x34ebf2?0x0:_0xdeed53[_0xdfa5('0x25')];var _0x34121a=_0x34ebf2?_0x41340f['count']:_0xdeed53[_0xdfa5('0x25')]+_0xdeed53['limit'];var _0x52c9fa;if(_0x34121a>=_0xe01aff){_0x34121a=_0xe01aff;_0x52c9fa=0xc8;}else{_0x52c9fa=0xce;}_0x1b7c20[_0xdfa5('0x23')](_0x52c9fa);return _0x1b7c20[_0xdfa5('0x29')](_0xdfa5('0x2a'),_0x1ec03a+'-'+_0x34121a+'/'+_0xe01aff)[_0xdfa5('0x2b')](_0x41340f);}return null;};}function patchUpdates(_0x3a975c){return function(_0x3d5e43){try{jsonpatch[_0xdfa5('0x2c')](_0x3d5e43,_0x3a975c,!![]);}catch(_0x44fdf6){return BPromise[_0xdfa5('0x2d')](_0x44fdf6);}return _0x3d5e43['save']();};}function saveUpdates(_0x3a5914,_0x1c6360){return function(_0x1f35f0){if(_0x1f35f0){return _0x1f35f0[_0xdfa5('0x2e')](_0x3a5914)[_0xdfa5('0x2f')](function(_0x4e1a9d){return _0x4e1a9d;});}return null;};}function removeEntity(_0x5b47fd,_0x19e7a3){return function(_0x4563f4){if(_0x4563f4){return _0x4563f4[_0xdfa5('0x30')]()[_0xdfa5('0x2f')](function(){_0x5b47fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b368a,_0x34b714){return function(_0x11f070){if(!_0x11f070){_0x4b368a[_0xdfa5('0x22')](0x194);}return _0x11f070;};}function handleError(_0x675c0f,_0x38ff17){_0x38ff17=_0x38ff17||0x1f4;return function(_0x354012){logger[_0xdfa5('0x1c')](_0x354012[_0xdfa5('0x31')]);if(_0x354012[_0xdfa5('0x32')]){delete _0x354012['name'];}_0x675c0f[_0xdfa5('0x23')](_0x38ff17)[_0xdfa5('0x33')](_0x354012);};}exports[_0xdfa5('0x34')]=function(_0xaf85c8,_0x26b639){var _0x35f171={},_0x3ed69a={},_0x4df07e={'count':0x0,'rows':[]};var _0x5a0fe3=_[_0xdfa5('0x35')](db[_0xdfa5('0x36')][_0xdfa5('0x37')],function(_0x2f1ae3){return{'name':_0x2f1ae3[_0xdfa5('0x38')],'type':_0x2f1ae3[_0xdfa5('0x39')]['key']};});_0x3ed69a[_0xdfa5('0x3a')]=_[_0xdfa5('0x35')](_0x5a0fe3,_0xdfa5('0x32'));_0x3ed69a[_0xdfa5('0x3b')]=_[_0xdfa5('0x3c')](_0xaf85c8['query']);_0x3ed69a[_0xdfa5('0x3d')]=_[_0xdfa5('0x3e')](_0x3ed69a[_0xdfa5('0x3a')],_0x3ed69a[_0xdfa5('0x3b')]);_0x35f171['attributes']=_[_0xdfa5('0x3e')](_0x3ed69a['model'],qs[_0xdfa5('0x3f')](_0xaf85c8[_0xdfa5('0x3b')][_0xdfa5('0x3f')]));_0x35f171[_0xdfa5('0x40')]=_0x35f171['attributes']['length']?_0x35f171[_0xdfa5('0x40')]:_0x3ed69a[_0xdfa5('0x3a')];if(!_0xaf85c8[_0xdfa5('0x3b')][_0xdfa5('0x41')]('nolimit')){_0x35f171[_0xdfa5('0x27')]=qs[_0xdfa5('0x27')](_0xaf85c8['query'][_0xdfa5('0x27')]);_0x35f171[_0xdfa5('0x25')]=qs['offset'](_0xaf85c8[_0xdfa5('0x3b')][_0xdfa5('0x25')]);}_0x35f171[_0xdfa5('0x42')]=qs['sort'](_0xaf85c8[_0xdfa5('0x3b')]['sort']);_0x35f171[_0xdfa5('0x43')]=qs[_0xdfa5('0x3d')](_[_0xdfa5('0x44')](_0xaf85c8[_0xdfa5('0x3b')],_0x3ed69a[_0xdfa5('0x3d')]),_0x5a0fe3);if(_0xaf85c8[_0xdfa5('0x3b')]['filter']){_0x35f171['where']=_[_0xdfa5('0x45')](_0x35f171[_0xdfa5('0x43')],{'$or':_['map'](_0x5a0fe3,function(_0x48e12d){if(_0x48e12d[_0xdfa5('0x39')]!==_0xdfa5('0x46')){var _0x6fbea2={};_0x6fbea2[_0x48e12d[_0xdfa5('0x32')]]={'$like':'%'+_0xaf85c8[_0xdfa5('0x3b')]['filter']+'%'};return _0x6fbea2;}})});}_0x35f171=_[_0xdfa5('0x45')]({},_0x35f171,_0xaf85c8[_0xdfa5('0x47')]);var _0x575ccf={'where':_0x35f171[_0xdfa5('0x43')]};return db[_0xdfa5('0x36')]['count'](_0x575ccf)[_0xdfa5('0x2f')](function(_0xeed5b4){_0x4df07e[_0xdfa5('0x28')]=_0xeed5b4;if(_0xaf85c8[_0xdfa5('0x3b')][_0xdfa5('0x48')]){_0x35f171[_0xdfa5('0x49')]=[{'all':!![]}];}return db[_0xdfa5('0x36')]['findAll'](_0x35f171);})[_0xdfa5('0x2f')](function(_0x7d30be){_0x4df07e[_0xdfa5('0x4a')]=_0x7d30be;return _0x4df07e;})[_0xdfa5('0x2f')](respondWithFilteredResult(_0x26b639,_0x35f171))['catch'](handleError(_0x26b639,null));};exports[_0xdfa5('0x4b')]=function(_0x1c163f,_0x1ae4d2){var _0x41447b={'raw':![],'where':{'id':_0x1c163f[_0xdfa5('0x4c')]['id']}},_0x173479={};_0x173479['model']=_['keys'](db[_0xdfa5('0x36')][_0xdfa5('0x37')]);_0x173479[_0xdfa5('0x3b')]=_[_0xdfa5('0x3c')](_0x1c163f[_0xdfa5('0x3b')]);_0x173479[_0xdfa5('0x3d')]=_['intersection'](_0x173479['model'],_0x173479[_0xdfa5('0x3b')]);_0x41447b[_0xdfa5('0x40')]=_[_0xdfa5('0x3e')](_0x173479[_0xdfa5('0x3a')],qs[_0xdfa5('0x3f')](_0x1c163f['query']['fields']));_0x41447b['attributes']=_0x41447b[_0xdfa5('0x40')][_0xdfa5('0x4d')]?_0x41447b['attributes']:_0x173479['model'];if(_0x1c163f[_0xdfa5('0x3b')][_0xdfa5('0x48')]){_0x41447b['include']=[{'all':!![]}];}_0x41447b=_[_0xdfa5('0x45')]({},_0x41447b,_0x1c163f['options']);return db['Setting'][_0xdfa5('0x4e')](_0x41447b)['then'](handleEntityNotFound(_0x1ae4d2,null))[_0xdfa5('0x2f')](respondWithResult(_0x1ae4d2,null))[_0xdfa5('0x21')](handleError(_0x1ae4d2,null));};exports[_0xdfa5('0x2e')]=function(_0x511560,_0xea3b2d){if(_0x511560[_0xdfa5('0x4f')]['id']){delete _0x511560[_0xdfa5('0x4f')]['id'];}return db[_0xdfa5('0x36')]['find']({'where':{'id':_0x511560[_0xdfa5('0x4c')]['id']}})[_0xdfa5('0x2f')](handleEntityNotFound(_0xea3b2d,null))[_0xdfa5('0x2f')](saveUpdates(_0x511560['body'],null))[_0xdfa5('0x2f')](respondWithResult(_0xea3b2d,null))['catch'](handleError(_0xea3b2d,null));};exports[_0xdfa5('0x50')]=function(_0x5dbe10,_0x510a94,_0x37655d){if(_0x5dbe10[_0xdfa5('0x51')]&&_0x5dbe10[_0xdfa5('0x51')][_0xdfa5('0x52')]){_0x5dbe10['body'][_0xdfa5('0x53')]=_0x5dbe10[_0xdfa5('0x51')]['filename'];}return db[_0xdfa5('0x36')]['find']({'where':{'id':_0x5dbe10[_0xdfa5('0x4c')]['id']}})[_0xdfa5('0x2f')](handleEntityNotFound(_0x510a94,null))[_0xdfa5('0x2f')](saveUpdates(_0x5dbe10[_0xdfa5('0x4f')],null))[_0xdfa5('0x2f')](respondWithResult(_0x510a94,null))[_0xdfa5('0x21')](handleError(_0x510a94,null));};exports['addLogoLogin']=function(_0x4b8fbd,_0x2ac964,_0xbe22c5){if(_0x4b8fbd[_0xdfa5('0x51')]&&_0x4b8fbd['file'][_0xdfa5('0x52')]){_0x4b8fbd['body'][_0xdfa5('0x54')]=_0x4b8fbd[_0xdfa5('0x51')][_0xdfa5('0x52')];}return db[_0xdfa5('0x36')][_0xdfa5('0x4e')]({'where':{'id':_0x4b8fbd[_0xdfa5('0x4c')]['id']}})[_0xdfa5('0x2f')](handleEntityNotFound(_0x2ac964,null))[_0xdfa5('0x2f')](saveUpdates(_0x4b8fbd[_0xdfa5('0x4f')],null))['then'](respondWithResult(_0x2ac964,null))['catch'](handleError(_0x2ac964,null));};var utilLicense=require('../../config/license/util');exports[_0xdfa5('0x55')]=function(_0x277495,_0x219eb2,_0x8a6999){var _0x3a1182='server/files/images/logos';var _0x4c46de={'custom':![]};return utilLicense[_0xdfa5('0x56')]()[_0xdfa5('0x2f')](function(_0x19bef1){if(_0x19bef1){_0x4c46de=_0x19bef1;}return db[_0xdfa5('0x36')][_0xdfa5('0x4e')]({'where':{'id':_0x277495[_0xdfa5('0x4c')]['id']},'attributes':[_0xdfa5('0x53'),_0xdfa5('0x54'),'preferred',_0xdfa5('0x57'),'defaultLogo','defaultLoginLogo',_0xdfa5('0x58'),_0xdfa5('0x59')],'raw':!![]});})[_0xdfa5('0x2f')](handleEntityNotFound(_0x219eb2,null))[_0xdfa5('0x2f')](function(_0x590526){if(_0x590526){var _0x2188c3=_0x590526[_0xdfa5('0x53')]&&fs[_0xdfa5('0x5a')](path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x3a1182,_['toLower'](_0x590526[_0xdfa5('0x53')])))?path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x3a1182,_[_0xdfa5('0x5d')](_0x590526[_0xdfa5('0x53')])):path[_0xdfa5('0x5b')](config['root'],_0x3a1182,_[_0xdfa5('0x5d')](_0xdfa5('0x5e')));var _0x45dfe5=_0xdfa5('0x5f')+_[_0xdfa5('0x60')](_0xdfa5('0x53'));if(_0x590526[_0x45dfe5]||!_0x4c46de[_0xdfa5('0x61')]){_0x2188c3=path['join'](config[_0xdfa5('0x5c')],_0x3a1182,_['toLower'](_0xdfa5('0x5e')));}if(!fs[_0xdfa5('0x5a')](_0x2188c3)){throw new db[(_0xdfa5('0x62'))]['ValidationError'](_['upperFirst'](_0xdfa5('0x53'))+'\x20not\x20found');}return _0x219eb2[_0xdfa5('0x63')](_0x2188c3);}})[_0xdfa5('0x21')](handleError(_0x219eb2,null));};var utilLicense=require('../../config/license/util');exports[_0xdfa5('0x64')]=function(_0x2a5393,_0x1572f8,_0x58ccb3){var _0x16e2fe=_0xdfa5('0x65');var _0x1bdadb={'custom':![]};return utilLicense[_0xdfa5('0x56')]()[_0xdfa5('0x2f')](function(_0x4adec5){if(_0x4adec5){_0x1bdadb=_0x4adec5;}return db[_0xdfa5('0x36')]['find']({'where':{'id':_0x2a5393[_0xdfa5('0x4c')]['id']},'attributes':[_0xdfa5('0x53'),_0xdfa5('0x54'),'preferred',_0xdfa5('0x57'),_0xdfa5('0x66'),'defaultLoginLogo',_0xdfa5('0x58'),'defaultFavicon'],'raw':!![]});})[_0xdfa5('0x2f')](handleEntityNotFound(_0x1572f8,null))['then'](function(_0x5473b9){if(_0x5473b9){var _0x240add=_0x5473b9[_0xdfa5('0x54')]&&fs[_0xdfa5('0x5a')](path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x16e2fe,_[_0xdfa5('0x5d')](_0x5473b9[_0xdfa5('0x54')])))?path[_0xdfa5('0x5b')](config['root'],_0x16e2fe,_['toLower'](_0x5473b9['loginLogo'])):path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x16e2fe,_['toLower'](_0xdfa5('0x67')));var _0x35b92c=_0xdfa5('0x5f')+_[_0xdfa5('0x60')](_0xdfa5('0x54'));if(_0x5473b9[_0x35b92c]||!_0x1bdadb[_0xdfa5('0x61')]){_0x240add=path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x16e2fe,_['toLower'](_0xdfa5('0x67')));}if(!fs[_0xdfa5('0x5a')](_0x240add)){throw new db[(_0xdfa5('0x62'))][(_0xdfa5('0x68'))](_[_0xdfa5('0x60')](_0xdfa5('0x54'))+_0xdfa5('0x69'));}return _0x1572f8[_0xdfa5('0x63')](_0x240add);}})[_0xdfa5('0x21')](handleError(_0x1572f8,null));};exports[_0xdfa5('0x6a')]=function(_0x38e1a8,_0x28d774){return db[_0xdfa5('0x36')]['find']({'where':{'id':_0x38e1a8[_0xdfa5('0x4c')]['id']},'attributes':[_0xdfa5('0x6b')]})[_0xdfa5('0x2f')](respondWithResult(_0x28d774,null))[_0xdfa5('0x21')](handleError(_0x28d774,null));};exports[_0xdfa5('0x6c')]=function(_0xbafaa8,_0x50b006,_0xb8697c){if(_0xbafaa8['file']&&_0xbafaa8[_0xdfa5('0x51')][_0xdfa5('0x52')]){_0xbafaa8[_0xdfa5('0x4f')][_0xdfa5('0x6d')]=_0xbafaa8[_0xdfa5('0x51')]['filename'];}return db[_0xdfa5('0x36')][_0xdfa5('0x4e')]({'where':{'id':_0xbafaa8[_0xdfa5('0x4c')]['id']}})[_0xdfa5('0x2f')](handleEntityNotFound(_0x50b006,null))[_0xdfa5('0x2f')](saveUpdates(_0xbafaa8['body'],null))['then'](respondWithResult(_0x50b006,null))[_0xdfa5('0x21')](handleError(_0x50b006,null));};var utilLicense=require('../../config/license/util');exports[_0xdfa5('0x6e')]=function(_0x568c39,_0x1f6a95,_0x305c5d){var _0x31d096=_0xdfa5('0x65');var _0x130e2e={'custom':![]};return utilLicense[_0xdfa5('0x56')]()[_0xdfa5('0x2f')](function(_0x2fbd81){if(_0x2fbd81){_0x130e2e=_0x2fbd81;}return db['Setting'][_0xdfa5('0x4e')]({'where':{'id':_0x568c39['params']['id']},'attributes':[_0xdfa5('0x53'),_0xdfa5('0x54'),_0xdfa5('0x6d'),_0xdfa5('0x57'),_0xdfa5('0x66'),_0xdfa5('0x6f'),_0xdfa5('0x58'),'defaultFavicon'],'raw':!![]});})[_0xdfa5('0x2f')](handleEntityNotFound(_0x1f6a95,null))[_0xdfa5('0x2f')](function(_0x1f439d){if(_0x1f439d){var _0x204751=_0x1f439d[_0xdfa5('0x6d')]&&fs[_0xdfa5('0x5a')](path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x31d096,_[_0xdfa5('0x5d')](_0x1f439d[_0xdfa5('0x6d')])))?path[_0xdfa5('0x5b')](config['root'],_0x31d096,_[_0xdfa5('0x5d')](_0x1f439d[_0xdfa5('0x6d')])):path[_0xdfa5('0x5b')](config['root'],_0x31d096,_[_0xdfa5('0x5d')]('default_preferred.png'));var _0xe8e7bf='default'+_[_0xdfa5('0x60')]('preferred');if(_0x1f439d[_0xe8e7bf]||!_0x130e2e[_0xdfa5('0x61')]||!_0x130e2e[_0xdfa5('0x6d')]){_0x204751=path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x31d096,_[_0xdfa5('0x5d')](_0xdfa5('0x70')));}if(!fs[_0xdfa5('0x5a')](_0x204751)){throw new db[(_0xdfa5('0x62'))]['ValidationError'](_['upperFirst']('preferred')+'\x20not\x20found');}return _0x1f6a95[_0xdfa5('0x63')](_0x204751);}})['catch'](handleError(_0x1f6a95,null));};exports[_0xdfa5('0x71')]=function(_0x435dbb,_0x344b7f,_0x27f2d3){if(_0x435dbb[_0xdfa5('0x51')]&&_0x435dbb[_0xdfa5('0x51')][_0xdfa5('0x52')]){_0x435dbb[_0xdfa5('0x4f')][_0xdfa5('0x57')]=_0x435dbb[_0xdfa5('0x51')][_0xdfa5('0x52')];}return db[_0xdfa5('0x36')][_0xdfa5('0x4e')]({'where':{'id':_0x435dbb[_0xdfa5('0x4c')]['id']}})[_0xdfa5('0x2f')](handleEntityNotFound(_0x344b7f,null))['then'](saveUpdates(_0x435dbb[_0xdfa5('0x4f')],null))[_0xdfa5('0x2f')](respondWithResult(_0x344b7f,null))[_0xdfa5('0x21')](handleError(_0x344b7f,null));};var utilLicense=require('../../config/license/util');exports[_0xdfa5('0x72')]=function(_0x2a76b5,_0x5f131f,_0x4eb07e){var _0x1d0610=_0xdfa5('0x65');var _0x5dd6b5={'custom':![]};return utilLicense[_0xdfa5('0x56')]()[_0xdfa5('0x2f')](function(_0x5e325e){if(_0x5e325e){_0x5dd6b5=_0x5e325e;}return db['Setting'][_0xdfa5('0x4e')]({'where':{'id':_0x2a76b5[_0xdfa5('0x4c')]['id']},'attributes':['logo',_0xdfa5('0x54'),_0xdfa5('0x6d'),'favicon','defaultLogo',_0xdfa5('0x6f'),_0xdfa5('0x58'),_0xdfa5('0x59')],'raw':!![]});})[_0xdfa5('0x2f')](handleEntityNotFound(_0x5f131f,null))['then'](function(_0x45038b){if(_0x45038b){var _0x31b049=_0x45038b[_0xdfa5('0x57')]&&fs['existsSync'](path[_0xdfa5('0x5b')](config['root'],_0x1d0610,_[_0xdfa5('0x5d')](_0x45038b[_0xdfa5('0x57')])))?path['join'](config[_0xdfa5('0x5c')],_0x1d0610,_['toLower'](_0x45038b['favicon'])):path[_0xdfa5('0x5b')](config['root'],_0x1d0610,_[_0xdfa5('0x5d')](_0xdfa5('0x73')));var _0x5eac0c=_0xdfa5('0x5f')+_[_0xdfa5('0x60')]('favicon');if(_0x45038b[_0x5eac0c]||!_0x5dd6b5[_0xdfa5('0x61')]){_0x31b049=path[_0xdfa5('0x5b')](config[_0xdfa5('0x5c')],_0x1d0610,_['toLower']('default_favicon.ico'));}if(!fs[_0xdfa5('0x5a')](_0x31b049)){throw new db[(_0xdfa5('0x62'))]['ValidationError'](_['upperFirst'](_0xdfa5('0x57'))+_0xdfa5('0x69'));}return _0x5f131f['download'](_0x31b049);}})[_0xdfa5('0x21')](handleError(_0x5f131f,null));};exports[_0xdfa5('0x74')]=function(_0x2c51fd,_0x2ecb2d){var _0x198002={'offset':moment()['utcOffset']()};_0x198002['now']=moment()[_0xdfa5('0x75')](_0x198002[_0xdfa5('0x25')])[_0xdfa5('0x76')](_0xdfa5('0x77'));return _0x2ecb2d[_0xdfa5('0x23')](0xc8)[_0xdfa5('0x33')](_0x198002);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e9cf535..44d1ccb 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x402048,_0x217130){var _0x4340fd=function(_0x134916){while(--_0x134916){_0x402048['push'](_0x402048['shift']());}};_0x4340fd(++_0x217130);}(_0xedd9,0xfc));var _0x9edd=function(_0x5554da,_0x6cc7fc){_0x5554da=_0x5554da-0x0;var _0x447f56=_0xedd9[_0x5554da];return _0x447f56;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0x55ca,0x126));var _0xa55c=function(_0xb4ec3a,_0x2bace0){_0xb4ec3a=_0xb4ec3a-0x0;var _0x1b83db=_0x55ca[_0xb4ec3a];return _0x1b83db;};'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 46a503a..4834d48 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 _0x847d=['http','then','info','request\x20sent','debug','stringify','error','Setting,\x20%s,\x20%s','message','catch','ShowSetting','Setting','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x847d,0x13f));var _0xd847=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x847d[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xd847('0x0'));var util=require(_0xd847('0x1'));var moment=require(_0xd847('0x2'));var BPromise=require(_0xd847('0x3'));var rs=require(_0xd847('0x4'));var fs=require('fs');var Redis=require(_0xd847('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x6'));var logger=require(_0xd847('0x7'))('rpc');var config=require(_0xd847('0x8'));var jayson=require(_0xd847('0x9'));var client=jayson[_0xd847('0xa')][_0xd847('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398936,_0x2ea586,_0x1c6fd3){return new BPromise(function(_0x1083e2,_0x5bc1e0){return client['request'](_0x398936,_0x1c6fd3)[_0xd847('0xc')](function(_0x28ec4f){logger[_0xd847('0xd')]('Setting,\x20%s,\x20%s',_0x2ea586,_0xd847('0xe'));logger[_0xd847('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x2ea586,_0xd847('0xe'),JSON[_0xd847('0x10')](_0x28ec4f));if(_0x28ec4f[_0xd847('0x11')]){if(_0x28ec4f[_0xd847('0x11')]['code']===0x1f4){logger['error'](_0xd847('0x12'),_0x2ea586,_0x28ec4f[_0xd847('0x11')]['message']);return _0x5bc1e0(_0x28ec4f[_0xd847('0x11')][_0xd847('0x13')]);}logger[_0xd847('0x11')](_0xd847('0x12'),_0x2ea586,_0x28ec4f[_0xd847('0x11')]['message']);return _0x1083e2(_0x28ec4f[_0xd847('0x11')][_0xd847('0x13')]);}else{logger[_0xd847('0xd')](_0xd847('0x12'),_0x2ea586,'request\x20sent');_0x1083e2(_0x28ec4f['result'][_0xd847('0x13')]);}})[_0xd847('0x14')](function(_0x1e30db){logger[_0xd847('0x11')](_0xd847('0x12'),_0x2ea586,_0x1e30db);_0x5bc1e0(_0x1e30db);});});}exports[_0xd847('0x15')]=function(_0x335cd2){var _0x34cdcc=this;return new Promise(function(_0x15ce0e,_0x6f368f){return db[_0xd847('0x16')]['find']({'raw':_0x335cd2['options']?_0x335cd2[_0xd847('0x17')][_0xd847('0x18')]===undefined?!![]:![]:!![],'where':_0x335cd2[_0xd847('0x17')]?_0x335cd2['options'][_0xd847('0x19')]||null:null,'attributes':_0x335cd2[_0xd847('0x17')]?_0x335cd2[_0xd847('0x17')][_0xd847('0x1a')]||null:null,'include':_0x335cd2['options']?_0x335cd2['options'][_0xd847('0x1b')]?_['map'](_0x335cd2[_0xd847('0x17')][_0xd847('0x1b')],function(_0x58ef64){return{'model':db[_0x58ef64[_0xd847('0x1c')]],'as':_0x58ef64['as'],'attributes':_0x58ef64['attributes'],'include':_0x58ef64['include']?_[_0xd847('0x1d')](_0x58ef64[_0xd847('0x1b')],function(_0x5bc130){return{'model':db[_0x5bc130[_0xd847('0x1c')]],'as':_0x5bc130['as'],'attributes':_0x5bc130['attributes'],'include':_0x5bc130[_0xd847('0x1b')]?_['map'](_0x5bc130[_0xd847('0x1b')],function(_0x65f475){return{'model':db[_0x65f475[_0xd847('0x1c')]],'as':_0x65f475['as'],'attributes':_0x65f475[_0xd847('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa72027){logger[_0xd847('0xd')]('ShowSetting',_0x335cd2);logger[_0xd847('0xf')](_0xd847('0x15'),_0x335cd2,JSON[_0xd847('0x10')](_0xa72027));_0x15ce0e(_0xa72027);})[_0xd847('0x14')](function(_0x78b2a1){logger[_0xd847('0x11')](_0xd847('0x15'),_0x78b2a1[_0xd847('0x13')],_0x335cd2);_0x6f368f(_0x34cdcc['error'](0x1f4,_0x78b2a1[_0xd847('0x13')]));});});}; \ No newline at end of file +var _0x8753=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','info','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','catch','lodash','util','moment'];(function(_0x4ee585,_0x3aa9fa){var _0x561c7a=function(_0x4e16b1){while(--_0x4e16b1){_0x4ee585['push'](_0x4ee585['shift']());}};_0x561c7a(++_0x3aa9fa);}(_0x8753,0x11d));var _0x3875=function(_0x101327,_0x3e5bae){_0x101327=_0x101327-0x0;var _0x1e4a6c=_0x8753[_0x101327];return _0x1e4a6c;};'use strict';var _=require(_0x3875('0x0'));var util=require(_0x3875('0x1'));var moment=require(_0x3875('0x2'));var BPromise=require(_0x3875('0x3'));var rs=require(_0x3875('0x4'));var fs=require('fs');var Redis=require(_0x3875('0x5'));var db=require(_0x3875('0x6'))['db'];var utils=require(_0x3875('0x7'));var logger=require(_0x3875('0x8'))(_0x3875('0x9'));var config=require(_0x3875('0xa'));var jayson=require(_0x3875('0xb'));var client=jayson['client'][_0x3875('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x558959,_0x2972cc,_0x7eac9){return new BPromise(function(_0x2ea2e3,_0x56a3d6){return client['request'](_0x558959,_0x7eac9)[_0x3875('0xd')](function(_0x2d162e){logger['info'](_0x3875('0xe'),_0x2972cc,_0x3875('0xf'));logger[_0x3875('0x10')](_0x3875('0x11'),_0x2972cc,_0x3875('0xf'),JSON['stringify'](_0x2d162e));if(_0x2d162e['error']){if(_0x2d162e[_0x3875('0x12')]['code']===0x1f4){logger['error'](_0x3875('0xe'),_0x2972cc,_0x2d162e['error'][_0x3875('0x13')]);return _0x56a3d6(_0x2d162e[_0x3875('0x12')][_0x3875('0x13')]);}logger[_0x3875('0x12')](_0x3875('0xe'),_0x2972cc,_0x2d162e['error'][_0x3875('0x13')]);return _0x2ea2e3(_0x2d162e[_0x3875('0x12')]['message']);}else{logger[_0x3875('0x14')]('Setting,\x20%s,\x20%s',_0x2972cc,'request\x20sent');_0x2ea2e3(_0x2d162e['result'][_0x3875('0x13')]);}})['catch'](function(_0x2d4310){logger[_0x3875('0x12')](_0x3875('0xe'),_0x2972cc,_0x2d4310);_0x56a3d6(_0x2d4310);});});}exports[_0x3875('0x15')]=function(_0x3595b5){var _0x2d41c5=this;return new Promise(function(_0xbfefe1,_0xeca3ac){return db[_0x3875('0x16')][_0x3875('0x17')]({'raw':_0x3595b5[_0x3875('0x18')]?_0x3595b5[_0x3875('0x18')][_0x3875('0x19')]===undefined?!![]:![]:!![],'where':_0x3595b5[_0x3875('0x18')]?_0x3595b5[_0x3875('0x18')][_0x3875('0x1a')]||null:null,'attributes':_0x3595b5[_0x3875('0x18')]?_0x3595b5[_0x3875('0x18')][_0x3875('0x1b')]||null:null,'include':_0x3595b5['options']?_0x3595b5[_0x3875('0x18')][_0x3875('0x1c')]?_['map'](_0x3595b5['options'][_0x3875('0x1c')],function(_0x4adcf1){return{'model':db[_0x4adcf1[_0x3875('0x1d')]],'as':_0x4adcf1['as'],'attributes':_0x4adcf1['attributes'],'include':_0x4adcf1[_0x3875('0x1c')]?_[_0x3875('0x1e')](_0x4adcf1[_0x3875('0x1c')],function(_0x42a59a){return{'model':db[_0x42a59a[_0x3875('0x1d')]],'as':_0x42a59a['as'],'attributes':_0x42a59a[_0x3875('0x1b')],'include':_0x42a59a['include']?_[_0x3875('0x1e')](_0x42a59a[_0x3875('0x1c')],function(_0x45a168){return{'model':db[_0x45a168[_0x3875('0x1d')]],'as':_0x45a168['as'],'attributes':_0x45a168[_0x3875('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3875('0xd')](function(_0xc8efe2){logger['info'](_0x3875('0x15'),_0x3595b5);logger[_0x3875('0x10')](_0x3875('0x15'),_0x3595b5,JSON['stringify'](_0xc8efe2));_0xbfefe1(_0xc8efe2);})[_0x3875('0x1f')](function(_0x1dd4e7){logger[_0x3875('0x12')](_0x3875('0x15'),_0x1dd4e7[_0x3875('0x13')],_0x3595b5);_0xeca3ac(_0x2d41c5['error'](0x1f4,_0x1dd4e7[_0x3875('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 30f9092..a21bc12 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x5f480f,_0x5807c9){var _0x34a4b0=function(_0x43f256){while(--_0x43f256){_0x5f480f['push'](_0x5f480f['shift']());}};_0x34a4b0(++_0x5807c9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x34246b,_0x1d5f54){_0x34246b=_0x34246b-0x0;var _0x314402=_0x7fbe[_0x34246b];return _0x314402;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x4b59fd,_0x15969a){var _0x3d2b10=function(_0x38a844){while(--_0x38a844){_0x4b59fd['push'](_0x4b59fd['shift']());}};_0x3d2b10(++_0x15969a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('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 5d30dac..3174020 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 _0xea50=['generate','ENUM','connectel','clicksend','plivo','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xea50,0x100));var _0x0ea5=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0xea50[_0x2dbcef];return _0x5a90ea;};'use strict';var Sequelize=require(_0x0ea5('0x0'));var rs=require(_0x0ea5('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0ea5('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0ea5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0ea5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0ea5('0x3')],'defaultValue':function(){return rs[_0x0ea5('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0ea5('0x5')]('twilio','skebby',_0x0ea5('0x6'),_0x0ea5('0x7'),_0x0ea5('0x8'),'clickatell',_0x0ea5('0x9'),'csc',_0x0ea5('0xa'),_0x0ea5('0xb'))},'accountSid':{'type':Sequelize[_0x0ea5('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x0ea5('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0ea5('0x3')]},'apiKey':{'type':Sequelize[_0x0ea5('0x3')]},'applicationId':{'type':Sequelize[_0x0ea5('0x3')]},'accountId':{'type':Sequelize[_0x0ea5('0x3')]},'senderString':{'type':Sequelize[_0x0ea5('0x3')]},'deliveryReport':{'type':Sequelize[_0x0ea5('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x0ea5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0ea5('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0ea5('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0ea5('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0ea5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0ea5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0ea5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0ea5('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ea5('0xe')],'comment':_0x0ea5('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x0ea5('0xc')],'defaultValue':![],'comment':_0x0ea5('0x10'),'set':function(_0x561414){if(!_0x561414)this[_0x0ea5('0x11')](_0x0ea5('0x12'),null);this[_0x0ea5('0x11')](_0x0ea5('0x13'),_0x561414);}}}; \ No newline at end of file +var _0x6870=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','csc','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x2e8917,_0x872c43){var _0x31b759=function(_0x7a5461){while(--_0x7a5461){_0x2e8917['push'](_0x2e8917['shift']());}};_0x31b759(++_0x872c43);}(_0x6870,0x1e0));var _0x0687=function(_0x31bcbe,_0x4ce65b){_0x31bcbe=_0x31bcbe-0x0;var _0x485320=_0x6870[_0x31bcbe];return _0x485320;};'use strict';var Sequelize=require(_0x0687('0x0'));var rs=require('randomstring');module[_0x0687('0x1')]={'name':{'type':Sequelize[_0x0687('0x2')],'unique':_0x0687('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x0687('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0687('0x4')]();}},'phone':{'type':Sequelize[_0x0687('0x2')]},'type':{'type':Sequelize[_0x0687('0x5')](_0x0687('0x6'),_0x0687('0x7'),'connectel',_0x0687('0x8'),'plivo','clickatell','bandwidth',_0x0687('0x9'),'infobip',_0x0687('0xa'))},'accountSid':{'type':Sequelize[_0x0687('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0687('0x2')]},'smsMethod':{'type':Sequelize[_0x0687('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0687('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x0687('0x2')]},'applicationId':{'type':Sequelize[_0x0687('0x2')]},'accountId':{'type':Sequelize[_0x0687('0x2')]},'senderString':{'type':Sequelize[_0x0687('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0687('0x2')]},'notificationTemplate':{'type':Sequelize[_0x0687('0xb')],'defaultValue':function(){return _0x0687('0xc');}},'notificationSound':{'type':Sequelize[_0x0687('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0687('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0687('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0687('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0687('0xe')],'comment':_0x0687('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x0687('0xd')],'defaultValue':![],'comment':_0x0687('0x10'),'set':function(_0x423a1a){if(!_0x423a1a)this[_0x0687('0x11')](_0x0687('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x423a1a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cb4811b..3a07c99 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 _0xe256=['connectel','clicksend','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','Tags','color','tag','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','SmsMessage','requestid','statusInt','status_code','groupName','redif','error_code','DELIVERED','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','omit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','get','UserProfileResource','destroy','end','name','send','index','Pause','SmsAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','show','params','mandatoryDispositionPause','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','SmsAccountId','Disposition','hasOwnProperty','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','type','twilio','Body','messageId','skebby','from','sender','text'];(function(_0x28df77,_0x2af511){var _0x18c84f=function(_0x22494c){while(--_0x22494c){_0x28df77['push'](_0x28df77['shift']());}};_0x18c84f(++_0x2af511);}(_0xe256,0x13e));var _0x6e25=function(_0x471ef2,_0x1e28ca){_0x471ef2=_0x471ef2-0x0;var _0x3a735d=_0xe256[_0x471ef2];return _0x3a735d;};'use strict';var emlformat=require(_0x6e25('0x0'));var rimraf=require(_0x6e25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e25('0x2'));var rp=require(_0x6e25('0x3'));var moment=require(_0x6e25('0x4'));var BPromise=require(_0x6e25('0x5'));var Mustache=require(_0x6e25('0x6'));var util=require(_0x6e25('0x7'));var path=require(_0x6e25('0x8'));var sox=require(_0x6e25('0x9'));var csv=require(_0x6e25('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e25('0xb'));var _=require('lodash');var squel=require(_0x6e25('0xc'));var crypto=require(_0x6e25('0xd'));var jsforce=require(_0x6e25('0xe'));var deskjs=require(_0x6e25('0xf'));var toCsv=require(_0x6e25('0xa'));var querystring=require(_0x6e25('0x10'));var Papa=require(_0x6e25('0x11'));var Redis=require(_0x6e25('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6e25('0x13'));var as=require(_0x6e25('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e25('0x15'));var utils=require(_0x6e25('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6e25('0x17'));var db=require('../../mysqldb')['db'];config[_0x6e25('0x18')]=_[_0x6e25('0x19')](config[_0x6e25('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e25('0x1a'))(new Redis(config[_0x6e25('0x18')]));require(_0x6e25('0x1b'))['register'](socket);var jayson=require(_0x6e25('0x1c'));var client=jayson[_0x6e25('0x1d')][_0x6e25('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x1b96cc,_0x5ea4b6,_0x1f176a,_0x1cec2c){return new BPromise(function(_0x573198,_0x267a6a){var _0x488a47=_0x1cec2c||client;return _0x488a47[_0x6e25('0x1f')](_0x1b96cc,_0x1f176a)[_0x6e25('0x20')](function(_0x292e6b){logger[_0x6e25('0x21')](_0x6e25('0x22'),_0x5ea4b6,'request\x20sent');logger['debug'](_0x6e25('0x23'),_0x5ea4b6,_0x6e25('0x24'),JSON[_0x6e25('0x25')](_0x292e6b));if(_0x292e6b[_0x6e25('0x26')]){if(_0x292e6b[_0x6e25('0x26')][_0x6e25('0x27')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5ea4b6,_0x292e6b[_0x6e25('0x26')]['message']);return _0x267a6a(_0x292e6b[_0x6e25('0x26')][_0x6e25('0x28')]);}logger[_0x6e25('0x26')](_0x6e25('0x22'),_0x5ea4b6,_0x292e6b[_0x6e25('0x26')][_0x6e25('0x28')]);return _0x573198(_0x292e6b[_0x6e25('0x26')][_0x6e25('0x28')]);}else{logger['info'](_0x6e25('0x22'),_0x5ea4b6,_0x6e25('0x24'));_0x573198(_0x292e6b['result'][_0x6e25('0x28')]);}})[_0x6e25('0x29')](function(_0x235f87){logger[_0x6e25('0x26')](_0x6e25('0x22'),_0x5ea4b6,_0x235f87);_0x267a6a(_0x235f87);});});}function respondWithStatusCode(_0x275134,_0xf7653c){_0xf7653c=_0xf7653c||0xcc;return function(_0x780b32){if(_0x780b32){return _0x275134[_0x6e25('0x2a')](_0xf7653c);}return _0x275134[_0x6e25('0x2b')](_0xf7653c)['end']();};}function respondWithResult(_0x12d3d4,_0x50bc77){_0x50bc77=_0x50bc77||0xc8;return function(_0x46a21f){if(_0x46a21f){return _0x12d3d4[_0x6e25('0x2b')](_0x50bc77)['json'](_0x46a21f);}};}function respondWithFilteredResult(_0x3e37e5,_0x37e4e7){return function(_0x32390d){if(_0x32390d){var _0x5a0fe1=typeof _0x37e4e7[_0x6e25('0x2c')]===_0x6e25('0x2d')&&typeof _0x37e4e7[_0x6e25('0x2e')]===_0x6e25('0x2d');var _0x598955=_0x32390d['count'];var _0x34696e=_0x5a0fe1?0x0:_0x37e4e7[_0x6e25('0x2c')];var _0x482a08=_0x5a0fe1?_0x32390d['count']:_0x37e4e7[_0x6e25('0x2c')]+_0x37e4e7[_0x6e25('0x2e')];var _0x29e940;if(_0x482a08>=_0x598955){_0x482a08=_0x598955;_0x29e940=0xc8;}else{_0x29e940=0xce;}_0x3e37e5[_0x6e25('0x2b')](_0x29e940);return _0x3e37e5[_0x6e25('0x2f')](_0x6e25('0x30'),_0x34696e+'-'+_0x482a08+'/'+_0x598955)[_0x6e25('0x31')](_0x32390d);}return null;};}function patchUpdates(_0x3f0345){return function(_0x435853){try{jsonpatch[_0x6e25('0x32')](_0x435853,_0x3f0345,!![]);}catch(_0x26ce87){return BPromise[_0x6e25('0x33')](_0x26ce87);}return _0x435853['save']();};}function saveUpdates(_0x404884,_0xa5ee35){return function(_0x2231e1){if(_0x2231e1){return _0x2231e1[_0x6e25('0x34')](_0x404884)[_0x6e25('0x20')](function(_0x3d52e6){return _0x3d52e6;});}return null;};}function removeEntity(_0x23ce88,_0x4aac7a){return function(_0x13b0db){if(_0x13b0db){return _0x13b0db['destroy']()[_0x6e25('0x20')](function(){var _0x47bd70=_0x13b0db[_0x6e25('0x35')]({'plain':!![]});var _0x26b1a5='SmsAccounts';return db[_0x6e25('0x36')][_0x6e25('0x37')]({'where':{'type':_0x26b1a5,'resourceId':_0x47bd70['id']}})['then'](function(){return _0x13b0db;});})[_0x6e25('0x20')](function(){_0x23ce88[_0x6e25('0x2b')](0xcc)[_0x6e25('0x38')]();});}};}function handleEntityNotFound(_0x44d239,_0x131c28){return function(_0x54e534){if(!_0x54e534){_0x44d239['sendStatus'](0x194);}return _0x54e534;};}function handleError(_0x142fb2,_0x2f49f4){_0x2f49f4=_0x2f49f4||0x1f4;return function(_0x57f475){logger[_0x6e25('0x26')](_0x57f475['stack']);if(_0x57f475['name']){delete _0x57f475[_0x6e25('0x39')];}_0x142fb2[_0x6e25('0x2b')](_0x2f49f4)[_0x6e25('0x3a')](_0x57f475);};}exports[_0x6e25('0x3b')]=function(_0x4677a1,_0x3c76a6){var _0x293fc={'include':[{'model':db[_0x6e25('0x3c')],'as':'mandatoryDispositionPause'}]},_0x14c30c={},_0x361fcb={'count':0x0,'rows':[]};var _0x564815=_['map'](db[_0x6e25('0x3d')][_0x6e25('0x3e')],function(_0x43a3a0){return{'name':_0x43a3a0[_0x6e25('0x3f')],'type':_0x43a3a0['type'][_0x6e25('0x40')]};});_0x14c30c[_0x6e25('0x41')]=_[_0x6e25('0x42')](_0x564815,'name');_0x14c30c[_0x6e25('0x43')]=_[_0x6e25('0x44')](_0x4677a1[_0x6e25('0x43')]);_0x14c30c['filters']=_[_0x6e25('0x45')](_0x14c30c[_0x6e25('0x41')],_0x14c30c['query']);_0x293fc[_0x6e25('0x46')]=_[_0x6e25('0x45')](_0x14c30c[_0x6e25('0x41')],qs[_0x6e25('0x47')](_0x4677a1[_0x6e25('0x43')][_0x6e25('0x47')]));_0x293fc[_0x6e25('0x46')]=_0x293fc[_0x6e25('0x46')]['length']?_0x293fc['attributes']:_0x14c30c[_0x6e25('0x41')];if(!_0x4677a1[_0x6e25('0x43')]['hasOwnProperty'](_0x6e25('0x48'))){_0x293fc[_0x6e25('0x2e')]=qs['limit'](_0x4677a1[_0x6e25('0x43')]['limit']);_0x293fc['offset']=qs[_0x6e25('0x2c')](_0x4677a1['query']['offset']);}_0x293fc[_0x6e25('0x49')]=qs[_0x6e25('0x4a')](_0x4677a1[_0x6e25('0x43')][_0x6e25('0x4a')]);_0x293fc[_0x6e25('0x4b')]=qs[_0x6e25('0x4c')](_[_0x6e25('0x4d')](_0x4677a1['query'],_0x14c30c[_0x6e25('0x4c')]),_0x564815);if(_0x4677a1[_0x6e25('0x43')]['filter']){_0x293fc[_0x6e25('0x4b')]=_[_0x6e25('0x4e')](_0x293fc['where'],{'$or':_['map'](_0x564815,function(_0x10c0d2){if(_0x10c0d2['type']!==_0x6e25('0x4f')){var _0x215fa6={};_0x215fa6[_0x10c0d2[_0x6e25('0x39')]]={'$like':'%'+_0x4677a1[_0x6e25('0x43')][_0x6e25('0x50')]+'%'};return _0x215fa6;}})});}_0x293fc=_['merge']({},_0x293fc,_0x4677a1[_0x6e25('0x51')]);var _0x412607={'where':_0x293fc[_0x6e25('0x4b')]};return db['SmsAccount'][_0x6e25('0x52')](_0x412607)[_0x6e25('0x20')](function(_0x465305){_0x361fcb[_0x6e25('0x52')]=_0x465305;if(_0x4677a1['query']['includeAll']){_0x293fc[_0x6e25('0x53')]=[{'all':!![]}];}return db[_0x6e25('0x3d')][_0x6e25('0x54')](_0x293fc);})[_0x6e25('0x20')](function(_0xdf77f6){_0x361fcb[_0x6e25('0x55')]=_0xdf77f6;return _0x361fcb;})['then'](respondWithFilteredResult(_0x3c76a6,_0x293fc))['catch'](handleError(_0x3c76a6,null));};exports[_0x6e25('0x56')]=function(_0x35cbf7,_0x36cc10){var _0x280681={'raw':![],'where':{'id':_0x35cbf7[_0x6e25('0x57')]['id']},'include':[{'model':db[_0x6e25('0x3c')],'as':_0x6e25('0x58')}]},_0x3c7fd3={};_0x3c7fd3[_0x6e25('0x41')]=_['keys'](db[_0x6e25('0x3d')][_0x6e25('0x3e')]);_0x3c7fd3[_0x6e25('0x43')]=_[_0x6e25('0x44')](_0x35cbf7[_0x6e25('0x43')]);_0x3c7fd3[_0x6e25('0x4c')]=_[_0x6e25('0x45')](_0x3c7fd3[_0x6e25('0x41')],_0x3c7fd3['query']);_0x280681['attributes']=_[_0x6e25('0x45')](_0x3c7fd3[_0x6e25('0x41')],qs[_0x6e25('0x47')](_0x35cbf7[_0x6e25('0x43')][_0x6e25('0x47')]));_0x280681[_0x6e25('0x46')]=_0x280681[_0x6e25('0x46')][_0x6e25('0x59')]?_0x280681[_0x6e25('0x46')]:_0x3c7fd3['model'];if(_0x35cbf7[_0x6e25('0x43')][_0x6e25('0x5a')]){_0x280681[_0x6e25('0x53')]=[{'all':!![]}];}_0x280681=_[_0x6e25('0x4e')]({},_0x280681,_0x35cbf7[_0x6e25('0x51')]);return db[_0x6e25('0x3d')]['find'](_0x280681)['then'](handleEntityNotFound(_0x36cc10,null))[_0x6e25('0x20')](respondWithResult(_0x36cc10,null))['catch'](handleError(_0x36cc10,null));};exports[_0x6e25('0x5b')]=function(_0x2627a9,_0x504fcd){return db[_0x6e25('0x3d')][_0x6e25('0x5b')](_0x2627a9[_0x6e25('0x5c')],{})[_0x6e25('0x20')](function(_0x5e559e){var _0x4936da=_0x2627a9[_0x6e25('0x5d')]['get']({'plain':!![]});if(!_0x4936da)throw new Error(_0x6e25('0x5e'));if(_0x4936da['role']===_0x6e25('0x5d')){var _0x151c82=_0x5e559e[_0x6e25('0x35')]({'plain':!![]});var _0x2aaf7d='SmsAccounts';return db[_0x6e25('0x5f')][_0x6e25('0x60')]({'where':{'name':_0x2aaf7d,'userProfileId':_0x4936da[_0x6e25('0x61')]},'raw':!![]})[_0x6e25('0x20')](function(_0x4d07bd){if(_0x4d07bd&&_0x4d07bd[_0x6e25('0x62')]===0x0){return db['UserProfileResource'][_0x6e25('0x5b')]({'name':_0x151c82[_0x6e25('0x39')],'resourceId':_0x151c82['id'],'type':_0x4d07bd[_0x6e25('0x39')],'sectionId':_0x4d07bd['id']},{})[_0x6e25('0x20')](function(){return _0x5e559e;});}else{return _0x5e559e;}})[_0x6e25('0x29')](function(_0x15f874){logger[_0x6e25('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15f874);throw _0x15f874;});}return _0x5e559e;})[_0x6e25('0x20')](respondWithResult(_0x504fcd,0xc9))[_0x6e25('0x29')](handleError(_0x504fcd,null));};exports[_0x6e25('0x34')]=function(_0x5a1f17,_0x20a51a){if(_0x5a1f17[_0x6e25('0x5c')]['id']){delete _0x5a1f17[_0x6e25('0x5c')]['id'];}return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x5a1f17['params']['id']},'include':[{'model':db[_0x6e25('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x20a51a,null))[_0x6e25('0x20')](saveUpdates(_0x5a1f17[_0x6e25('0x5c')],null))[_0x6e25('0x20')](respondWithResult(_0x20a51a,null))[_0x6e25('0x29')](handleError(_0x20a51a,null));};exports[_0x6e25('0x37')]=function(_0xac1fb1,_0x2020eb){return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0xac1fb1[_0x6e25('0x57')]['id']}})['then'](handleEntityNotFound(_0x2020eb,null))['then'](removeEntity(_0x2020eb,null))[_0x6e25('0x29')](handleError(_0x2020eb,null));};exports[_0x6e25('0x63')]=function(_0x4080a0,_0x53baf8){return db[_0x6e25('0x3d')][_0x6e25('0x63')]()['then'](respondWithResult(_0x53baf8,null))[_0x6e25('0x29')](handleError(_0x53baf8,null));};exports['addDisposition']=function(_0x2ab506,_0x31f9c6,_0x21fce1){if(_0x2ab506['body']['id']){delete _0x2ab506[_0x6e25('0x5c')]['id'];}return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x2ab506['params']['id']}})['then'](handleEntityNotFound(_0x31f9c6,null))[_0x6e25('0x20')](function(_0x204b02){if(_0x204b02){_0x2ab506[_0x6e25('0x5c')][_0x6e25('0x64')]=_0x204b02['id'];return db['Disposition']['create'](_0x2ab506['body']);}})[_0x6e25('0x20')](respondWithResult(_0x31f9c6,null))[_0x6e25('0x29')](handleError(_0x31f9c6,null));};exports['getDispositions']=function(_0x1b8809,_0x333220,_0x137902){var _0x138eb6={'raw':![],'where':{}};var _0x2ffe0f={};var _0x4fc830={'count':0x0,'rows':[]};return db[_0x6e25('0x3d')]['findOne']({'where':{'id':_0x1b8809[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x333220,null))[_0x6e25('0x20')](function(_0x39c440){if(_0x39c440){_0x2ffe0f[_0x6e25('0x41')]=_[_0x6e25('0x44')](db[_0x6e25('0x65')][_0x6e25('0x3e')]);_0x2ffe0f[_0x6e25('0x43')]=_['keys'](_0x1b8809[_0x6e25('0x43')]);_0x2ffe0f[_0x6e25('0x4c')]=_[_0x6e25('0x45')](_0x2ffe0f[_0x6e25('0x41')],_0x2ffe0f['query']);_0x138eb6[_0x6e25('0x46')]=_['intersection'](_0x2ffe0f['model'],qs[_0x6e25('0x47')](_0x1b8809[_0x6e25('0x43')][_0x6e25('0x47')]));_0x138eb6['attributes']=_0x138eb6[_0x6e25('0x46')][_0x6e25('0x59')]?_0x138eb6[_0x6e25('0x46')]:_0x2ffe0f[_0x6e25('0x41')];if(!_0x1b8809[_0x6e25('0x43')][_0x6e25('0x66')](_0x6e25('0x48'))){_0x138eb6[_0x6e25('0x2e')]=qs['limit'](_0x1b8809['query']['limit']);_0x138eb6[_0x6e25('0x2c')]=qs[_0x6e25('0x2c')](_0x1b8809[_0x6e25('0x43')]['offset']);}_0x138eb6[_0x6e25('0x49')]=qs[_0x6e25('0x4a')](_0x1b8809[_0x6e25('0x43')][_0x6e25('0x4a')]);_0x138eb6[_0x6e25('0x4b')]=qs[_0x6e25('0x4c')](_[_0x6e25('0x4d')](_0x1b8809[_0x6e25('0x43')],_0x2ffe0f[_0x6e25('0x4c')]));_0x138eb6[_0x6e25('0x4b')][_0x6e25('0x64')]=_0x39c440['id'];if(_0x1b8809['query']['filter']){_0x138eb6[_0x6e25('0x4b')]=_[_0x6e25('0x4e')](_0x138eb6[_0x6e25('0x4b')],{'$or':_['map'](_0x138eb6[_0x6e25('0x46')],function(_0x36adca){var _0x56b28a={};_0x56b28a[_0x36adca]={'$like':'%'+_0x1b8809['query'][_0x6e25('0x50')]+'%'};return _0x56b28a;})});}_0x138eb6=_[_0x6e25('0x4e')]({},_0x138eb6,_0x1b8809['options']);return db[_0x6e25('0x65')][_0x6e25('0x52')]({'where':_0x138eb6[_0x6e25('0x4b')]})[_0x6e25('0x20')](function(_0xbbc9df){_0x4fc830['count']=_0xbbc9df;if(_0x1b8809[_0x6e25('0x43')][_0x6e25('0x5a')]){_0x138eb6[_0x6e25('0x53')]=[{'all':!![]}];}return db[_0x6e25('0x65')][_0x6e25('0x54')](_0x138eb6);})[_0x6e25('0x20')](function(_0xb51022){_0x4fc830[_0x6e25('0x55')]=_0xb51022;return _0x4fc830;});}})[_0x6e25('0x20')](respondWithFilteredResult(_0x333220,_0x138eb6))[_0x6e25('0x29')](handleError(_0x333220,null));};exports[_0x6e25('0x67')]=function(_0x5e6da4,_0x5c0cdf,_0xf9ce47){return db['SmsAccount'][_0x6e25('0x60')]({'where':{'id':_0x5e6da4[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x5c0cdf,null))['then'](function(_0xfba816){if(_0xfba816){return _0xfba816[_0x6e25('0x67')](_0x5e6da4['query'][_0x6e25('0x68')]);}})[_0x6e25('0x20')](respondWithStatusCode(_0x5c0cdf,null))['catch'](handleError(_0x5c0cdf,null));};exports['addAnswer']=function(_0x37a296,_0x505d70,_0x13fe66){if(_0x37a296[_0x6e25('0x5c')]['id']){delete _0x37a296[_0x6e25('0x5c')]['id'];}return db[_0x6e25('0x3d')]['find']({'where':{'id':_0x37a296['params']['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x505d70,null))[_0x6e25('0x20')](function(_0x5587b1){if(_0x5587b1){_0x37a296[_0x6e25('0x5c')][_0x6e25('0x64')]=_0x5587b1['id'];return db['CannedAnswer']['create'](_0x37a296[_0x6e25('0x5c')]);}})['then'](respondWithResult(_0x505d70,null))[_0x6e25('0x29')](handleError(_0x505d70,null));};exports[_0x6e25('0x69')]=function(_0x115ea9,_0x899601,_0x412bfe){var _0x5c2575={'raw':![],'where':{}};var _0x245ec8={};var _0x58ba07={'count':0x0,'rows':[]};return db[_0x6e25('0x3d')][_0x6e25('0x6a')]({'where':{'id':_0x115ea9[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x899601,null))[_0x6e25('0x20')](function(_0x3520fa){if(_0x3520fa){_0x245ec8[_0x6e25('0x41')]=_['keys'](db[_0x6e25('0x6b')][_0x6e25('0x3e')]);_0x245ec8[_0x6e25('0x43')]=_['keys'](_0x115ea9[_0x6e25('0x43')]);_0x245ec8[_0x6e25('0x4c')]=_[_0x6e25('0x45')](_0x245ec8[_0x6e25('0x41')],_0x245ec8[_0x6e25('0x43')]);_0x5c2575[_0x6e25('0x46')]=_[_0x6e25('0x45')](_0x245ec8['model'],qs[_0x6e25('0x47')](_0x115ea9[_0x6e25('0x43')][_0x6e25('0x47')]));_0x5c2575['attributes']=_0x5c2575[_0x6e25('0x46')]['length']?_0x5c2575[_0x6e25('0x46')]:_0x245ec8[_0x6e25('0x41')];if(!_0x115ea9[_0x6e25('0x43')]['hasOwnProperty'](_0x6e25('0x48'))){_0x5c2575[_0x6e25('0x2e')]=qs[_0x6e25('0x2e')](_0x115ea9[_0x6e25('0x43')][_0x6e25('0x2e')]);_0x5c2575[_0x6e25('0x2c')]=qs[_0x6e25('0x2c')](_0x115ea9[_0x6e25('0x43')][_0x6e25('0x2c')]);}_0x5c2575[_0x6e25('0x49')]=qs[_0x6e25('0x4a')](_0x115ea9['query'][_0x6e25('0x4a')]);_0x5c2575[_0x6e25('0x4b')]=qs['filters'](_['pick'](_0x115ea9['query'],_0x245ec8[_0x6e25('0x4c')]));_0x5c2575['where'][_0x6e25('0x64')]=_0x3520fa['id'];if(_0x115ea9[_0x6e25('0x43')]['filter']){_0x5c2575['where']=_[_0x6e25('0x4e')](_0x5c2575[_0x6e25('0x4b')],{'$or':_[_0x6e25('0x42')](_0x5c2575['attributes'],function(_0x195731){var _0x2a424c={};_0x2a424c[_0x195731]={'$like':'%'+_0x115ea9[_0x6e25('0x43')][_0x6e25('0x50')]+'%'};return _0x2a424c;})});}_0x5c2575=_['merge']({},_0x5c2575,_0x115ea9[_0x6e25('0x51')]);return db[_0x6e25('0x6b')][_0x6e25('0x52')]({'where':_0x5c2575['where']})[_0x6e25('0x20')](function(_0x5e5f45){_0x58ba07[_0x6e25('0x52')]=_0x5e5f45;if(_0x115ea9[_0x6e25('0x43')][_0x6e25('0x5a')]){_0x5c2575[_0x6e25('0x53')]=[{'all':!![]}];}return db[_0x6e25('0x6b')]['findAll'](_0x5c2575);})['then'](function(_0x3cc305){_0x58ba07[_0x6e25('0x55')]=_0x3cc305;return _0x58ba07;});}})[_0x6e25('0x20')](respondWithFilteredResult(_0x899601,_0x5c2575))[_0x6e25('0x29')](handleError(_0x899601,null));};exports[_0x6e25('0x6c')]=function(_0x24bc36,_0x139a90,_0x4a0b20){return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x24bc36[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x139a90,null))[_0x6e25('0x20')](function(_0x12ea7a){if(_0x12ea7a){return _0x12ea7a[_0x6e25('0x6c')](_0x24bc36[_0x6e25('0x43')][_0x6e25('0x68')]);}})[_0x6e25('0x20')](respondWithStatusCode(_0x139a90,null))['catch'](handleError(_0x139a90,null));};exports['notify']=function(_0x36f97b,_0x1cef79,_0x146171){var _0x28dd3b={'channel':_0x6e25('0x6d')};var _0x567ab6=[];var _0x23d6b2=[];var _0x5e6ee4={};return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x36f97b[_0x6e25('0x57')]['id']},'include':[{'model':db[_0x6e25('0x6e')],'as':_0x6e25('0x6f')}]})['then'](handleEntityNotFound(_0x1cef79,null))['then'](function(_0x5d9e2a){_0x28dd3b[_0x6e25('0x70')]=_0x5d9e2a;_0x28dd3b[_0x6e25('0x71')]=_[_0x6e25('0x72')](_0x5d9e2a[_0x6e25('0x6f')],[_0x6e25('0x73')],[_0x6e25('0x74')]);if(_0x28dd3b['account'][_0x6e25('0x6f')]){delete _0x28dd3b[_0x6e25('0x70')][_0x6e25('0x6f')];}return db[_0x6e25('0x75')]['describe']();})[_0x6e25('0x20')](function(_0x131c1c){if(!_0x131c1c){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))]('no\x20available\x20attributes');}_0x567ab6=_[_0x6e25('0x78')](_['keys'](_0x131c1c),['createdAt',_0x6e25('0x79')]);_0x23d6b2=_[_0x6e25('0x78')](_[_0x6e25('0x44')](_0x131c1c),[_0x6e25('0x7a'),'updatedAt',_0x6e25('0x7b'),_0x6e25('0x7c')]);_0x28dd3b[_0x6e25('0x5c')]={'mapKey':_0x6e25('0x7d')};if(_0x28dd3b['account'][_0x6e25('0x7e')]){switch(_0x28dd3b['account'][_0x6e25('0x7e')]){case _0x6e25('0x7f'):_0x28dd3b['body']['from']=_0x36f97b[_0x6e25('0x5c')]['From'];_0x28dd3b[_0x6e25('0x5c')]['body']=_0x36f97b['body'][_0x6e25('0x80')];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x81')]=_0x36f97b[_0x6e25('0x5c')]['MessageSid'];break;case _0x6e25('0x82'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]='+'+_0x36f97b['body'][_0x6e25('0x84')];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x85')];break;case _0x6e25('0x86'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x83')];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')]=_0x36f97b[_0x6e25('0x5c')]['message'];break;case _0x6e25('0x87'):_0x28dd3b[_0x6e25('0x5c')]['from']=_0x36f97b[_0x6e25('0x5c')]['from'];_0x28dd3b['body']['body']=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x5c')];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x81')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x88')];break;case'plivo':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x89')];_0x28dd3b['body']['body']=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x8a')];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x81')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x8b')];break;case _0x6e25('0x8c'):_0x28dd3b['body'][_0x6e25('0x83')]='+'+_0x36f97b['body'][_0x6e25('0x8d')][0x0]['from'];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')]=_0x36f97b['body'][_0x6e25('0x8d')][0x0][_0x6e25('0x85')];_0x28dd3b[_0x6e25('0x5c')]['messageId']=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x8d')][0x0][_0x6e25('0x81')];break;case _0x6e25('0x8e'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x8f')];_0x28dd3b['body'][_0x6e25('0x5c')]=_0x36f97b['body'][_0x6e25('0x90')][_0x6e25('0x28')];break;case _0x6e25('0x91'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]=_0x36f97b['body'][_0x6e25('0x92')];_0x28dd3b['body'][_0x6e25('0x5c')]=_0x36f97b[_0x6e25('0x5c')]['text'];_0x28dd3b['body']['messageId']=_0x36f97b[_0x6e25('0x5c')]['replyMessageId'];break;case _0x6e25('0x93'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x81')]=_0x36f97b[_0x6e25('0x5c')][0x0][_0x6e25('0x28')]['id'];_0x28dd3b['body'][_0x6e25('0x83')]=_0x36f97b[_0x6e25('0x5c')][0x0][_0x6e25('0x28')][_0x6e25('0x83')];_0x28dd3b['body'][_0x6e25('0x5c')]=_0x36f97b[_0x6e25('0x5c')][0x0]['message']['text'];break;case _0x6e25('0x94'):_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')]=_0x36f97b[_0x6e25('0x5c')]['from'];_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')]=_0x36f97b[_0x6e25('0x5c')]['message'];_0x28dd3b[_0x6e25('0x5c')]['messageId']=_0x36f97b[_0x6e25('0x5c')][_0x6e25('0x95')];break;}}if(_0x28dd3b['body']['id']){delete _0x28dd3b[_0x6e25('0x5c')]['id'];}if(_[_0x6e25('0x96')](_0x28dd3b['body'][_0x6e25('0x83')])){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))](_0x6e25('0x97'));}if(_[_0x6e25('0x96')](_0x28dd3b[_0x6e25('0x5c')]['body'])||_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')]===''){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))](_0x6e25('0x98'));}if(_[_0x6e25('0x96')](_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x99')])){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))](_0x6e25('0x9a')+_0x23d6b2);}if(!_[_0x6e25('0x9b')](_0x23d6b2,_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x99')])){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))](_0x6e25('0x9c')+_0x23d6b2);}_0x5e6ee4[_0x28dd3b['body'][_0x6e25('0x99')]]=_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')];return db['CmList'][_0x6e25('0x60')]({'where':{'id':_0x28dd3b['account'][_0x6e25('0x7c')]},'include':[{'model':db['CmContact'],'as':_0x6e25('0x9d'),'where':_0x5e6ee4,'limit':0x1,'order':[['updatedAt',_0x6e25('0x9e')]]}]});})[_0x6e25('0x20')](handleEntityNotFound(_0x1cef79,null))[_0x6e25('0x20')](function(_0x77db75){if(_0x77db75){_0x28dd3b[_0x6e25('0x9f')]=_['omit'](_0x77db75,[_0x6e25('0x9d')]);if(_0x77db75[_0x6e25('0x9d')][_0x6e25('0x59')]){return _0x77db75[_0x6e25('0x9d')][0x0];}var _0x16a5a7=_['defaults'](_0x28dd3b[_0x6e25('0x5c')],{'firstName':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')],'ListId':_0x77db75['id']});_0x16a5a7[_0x28dd3b['body'][_0x6e25('0x99')]]=_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')];return db[_0x6e25('0x75')][_0x6e25('0x5b')](_0x16a5a7,{'fields':_0x567ab6,'raw':!![]});}})[_0x6e25('0x20')](handleEntityNotFound(_0x1cef79,null))['then'](function(_0x2c3256){if(_0x2c3256){_0x28dd3b[_0x6e25('0xa0')]=_0x2c3256;var _0x26c182={'ContactId':_0x2c3256['id'],'phone':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')],'SmsAccountId':_0x36f97b['params']['id']};var _0xb557af={'ContactId':_0x2c3256['id'],'SmsAccountId':_0x36f97b[_0x6e25('0x57')]['id'],'closed':![]};return db[_0x6e25('0xa1')][_0x6e25('0x60')]({'where':_0xb557af})['then'](function(_0x2b6e88){if(_0x2b6e88){return[_0x2b6e88,![]];}return db['SmsInteraction']['create'](_0x26c182)[_0x6e25('0x20')](function(_0x5009e3){return[_0x5009e3,!![]];});});}})[_0x6e25('0xa2')](function(_0xfa2098,_0x417af8){_0x28dd3b[_0x6e25('0xa3')]=_0xfa2098[_0x6e25('0x35')]({'plain':!![]});_0x28dd3b['interaction'][_0x6e25('0xa4')]=![];if(_0x417af8){if(_0x28dd3b[_0x6e25('0x70')][_0x6e25('0xa5')]){_0x28dd3b[_0x6e25('0x71')][_0x6e25('0xa6')]({'id':0x0,'priority':_0x28dd3b['applications'][_0x6e25('0x59')]+0x1,'app':_0x6e25('0xa7'),'appdata':_0x6e25('0xa8'),'interval':_0x6e25('0xa9')});}_0x28dd3b[_0x6e25('0xa3')][_0x6e25('0xa4')]=!![];}return db['SmsMessage'][_0x6e25('0x5b')]({'phone':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x83')],'messageId':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x81')],'body':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0x5c')],'SmsAccountId':_0x36f97b['params']['id'],'SmsInteractionId':_0xfa2098['id'],'direction':'in','ContactId':_0xfa2098[_0x6e25('0xaa')],'AttachmentId':_0x28dd3b[_0x6e25('0x5c')][_0x6e25('0xab')]});})[_0x6e25('0x20')](function(_0xa7cfc1){_0x28dd3b[_0x6e25('0x28')]=_0xa7cfc1;if(_0x28dd3b[_0x6e25('0xa3')][_0x6e25('0xac')]){return db['User'][_0x6e25('0x60')]({'attributes':['id','name'],'where':{'id':_0x28dd3b[_0x6e25('0xa3')][_0x6e25('0xac')]}})[_0x6e25('0x20')](function(_0x86145f){if(_0x86145f){_0x28dd3b['applications'][_0x6e25('0xad')]({'id':0x0,'priority':0x0,'app':_0x6e25('0xae'),'appdata':_0x86145f['name']+','+(_0x28dd3b[_0x6e25('0x70')]['waitForTheAssignedAgent']||0xa),'interval':_0x6e25('0xa9')});}return respondWithRpcPromise(_0x6e25('0xaf'),'startRouting',_0x28dd3b);});}return respondWithRpcPromise('Start',_0x6e25('0xb0'),_0x28dd3b);})[_0x6e25('0x20')](function(_0x139961){if(_0x139961){var _0x3958d4=0xc8;var _0xe753dd=_0x6e25('0xb1');logger[_0x6e25('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe753dd,_0x3958d4,_0x6e25('0xb2'));logger[_0x6e25('0xb3')](_0x6e25('0xb4'),_0xe753dd,_0x3958d4,_0x6e25('0xb2'),JSON[_0x6e25('0x25')](_0x139961));if(_0x28dd3b['account'][_0x6e25('0x7e')]===_0x6e25('0x7f')){return _0x1cef79['status'](_0x3958d4)[_0x6e25('0x2f')](_0x6e25('0xb5'),'text/xml')[_0x6e25('0x3a')](_0x6e25('0xb6'));}else{return _0x1cef79[_0x6e25('0x2b')](_0x3958d4)['json'](_0x139961);}}})[_0x6e25('0x29')](handleError(_0x1cef79,null));};exports[_0x6e25('0xb7')]=function(_0x2d00d6,_0x272b2d){var _0x53c834=_0x2d00d6[_0x6e25('0x57')]['id'];var _0x34234e=_0x2d00d6[_0x6e25('0x5c')];var _0x19d645=0xc8;var _0x409441=null;return db[_0x6e25('0xb8')][_0x6e25('0xb9')]({'isolationLevel':db[_0x6e25('0xb8')][_0x6e25('0xba')]['ISOLATION_LEVELS'][_0x6e25('0xbb')]},function(_0x3de78a){return db[_0x6e25('0x3d')][_0x6e25('0x6a')]({'where':{'id':_0x53c834},'transaction':_0x3de78a})[_0x6e25('0x20')](function(_0x3f3de9){if(_0x3f3de9){return db[_0x6e25('0x6e')][_0x6e25('0x37')]({'where':{'SmsAccountId':_0x53c834},'transaction':_0x3de78a})['then'](function(){var _0x462d92=_[_0x6e25('0x42')](_0x34234e,function(_0xa28320){_0xa28320[_0x6e25('0x64')]=_0x53c834;return _0xa28320;});return db['SmsApplication']['bulkCreate'](_0x462d92,{'transaction':_0x3de78a});});}else{_0x19d645=0x194;_0x409441=[];}});})[_0x6e25('0x20')](function(){if(_0x19d645!==0x194){return db['SmsApplication'][_0x6e25('0xbc')]({'where':{'SmsAccountId':_0x53c834},'order':_0x6e25('0x73')})['then'](function(_0x5163cc){_0x409441=_0x5163cc;});}})[_0x6e25('0x29')](function(_0x570848){_0x19d645=0x1f4;logger[_0x6e25('0x26')](_0x570848[_0x6e25('0xbd')]);if(_0x570848[_0x6e25('0x39')]){delete _0x570848[_0x6e25('0x39')];}_0x409441=_0x570848;})[_0x6e25('0xbe')](function(){if(_0x409441===null){_0x272b2d[_0x6e25('0x2a')](_0x19d645);}else{if(_0x19d645===0x1f4){_0x272b2d[_0x6e25('0x2b')](_0x19d645)['send'](_0x409441);}else{_0x272b2d[_0x6e25('0x2b')](_0x19d645)[_0x6e25('0x31')](_0x409441);}}});};exports['getApplications']=function(_0x487674,_0x32b254,_0x267326){var _0xf890c8={};var _0x250ca8={};var _0x383ae2;var _0x329f45;return db[_0x6e25('0x3d')][_0x6e25('0x6a')]({'where':{'id':_0x487674[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x32b254,null))[_0x6e25('0x20')](function(_0x28363d){if(_0x28363d){_0x383ae2=_0x28363d;_0x250ca8[_0x6e25('0x41')]=_[_0x6e25('0x44')](db[_0x6e25('0x6e')]['rawAttributes']);_0x250ca8[_0x6e25('0x43')]=_[_0x6e25('0x44')](_0x487674[_0x6e25('0x43')]);_0x250ca8[_0x6e25('0x4c')]=_[_0x6e25('0x45')](_0x250ca8[_0x6e25('0x41')],_0x250ca8[_0x6e25('0x43')]);_0xf890c8['attributes']=_['intersection'](_0x250ca8[_0x6e25('0x41')],qs[_0x6e25('0x47')](_0x487674[_0x6e25('0x43')][_0x6e25('0x47')]));_0xf890c8[_0x6e25('0x46')]=_0xf890c8[_0x6e25('0x46')][_0x6e25('0x59')]?_0xf890c8[_0x6e25('0x46')]:_0x250ca8[_0x6e25('0x41')];_0xf890c8[_0x6e25('0x49')]=qs[_0x6e25('0x4a')](_0x487674['query'][_0x6e25('0x4a')]);_0xf890c8[_0x6e25('0x4b')]=qs[_0x6e25('0x4c')](_['pick'](_0x487674[_0x6e25('0x43')],_0x250ca8[_0x6e25('0x4c')]));if(_0x487674['query']['filter']){_0xf890c8[_0x6e25('0x4b')]=_['merge'](_0xf890c8[_0x6e25('0x4b')],{'$or':_[_0x6e25('0x42')](_0xf890c8[_0x6e25('0x46')],function(_0x39f3cb){var _0x45a941={};_0x45a941[_0x39f3cb]={'$like':'%'+_0x487674[_0x6e25('0x43')][_0x6e25('0x50')]+'%'};return _0x45a941;})});}_0xf890c8=_[_0x6e25('0x4e')]({},_0xf890c8,_0x487674['options']);return _0x383ae2[_0x6e25('0xbf')](_0xf890c8);}})[_0x6e25('0x20')](function(_0xe666d9){if(_0xe666d9){_0x329f45=_0xe666d9[_0x6e25('0x59')];if(!_0x487674[_0x6e25('0x43')][_0x6e25('0x66')](_0x6e25('0x48'))){_0xf890c8[_0x6e25('0x2e')]=qs[_0x6e25('0x2e')](_0x487674[_0x6e25('0x43')][_0x6e25('0x2e')]);_0xf890c8[_0x6e25('0x2c')]=qs['offset'](_0x487674['query'][_0x6e25('0x2c')]);}return _0x383ae2[_0x6e25('0xbf')](_0xf890c8);}})['then'](function(_0x417b45){if(_0x417b45){return _0x417b45?{'count':_0x329f45,'rows':_0x417b45}:null;}})['then'](respondWithResult(_0x32b254,null))[_0x6e25('0x29')](handleError(_0x32b254,null));};exports[_0x6e25('0xc0')]=function(_0x377dcd,_0x4a4336,_0x439f07){var _0x5bf05b={'raw':![],'where':{}};var _0x13f2c0={};var _0x14a4a8={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x377dcd[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x4a4336,null))[_0x6e25('0x20')](function(_0x41f02f){if(_0x41f02f){_0x13f2c0[_0x6e25('0x41')]=_[_0x6e25('0x44')](db[_0x6e25('0xa1')]['rawAttributes']);_0x13f2c0['query']=_[_0x6e25('0x44')](_0x377dcd[_0x6e25('0x43')]);_0x13f2c0[_0x6e25('0x4c')]=_[_0x6e25('0x45')](_0x13f2c0['model'],_0x13f2c0[_0x6e25('0x43')]);_0x5bf05b[_0x6e25('0x46')]=_[_0x6e25('0x45')](_0x13f2c0['model'],qs[_0x6e25('0x47')](_0x377dcd[_0x6e25('0x43')][_0x6e25('0x47')]));_0x5bf05b[_0x6e25('0x46')]=_0x5bf05b[_0x6e25('0x46')][_0x6e25('0x59')]?_0x5bf05b[_0x6e25('0x46')]:_0x13f2c0[_0x6e25('0x41')];if(!_0x377dcd['query'][_0x6e25('0x66')](_0x6e25('0x48'))){_0x5bf05b[_0x6e25('0x2e')]=qs[_0x6e25('0x2e')](_0x377dcd['query']['limit']);_0x5bf05b[_0x6e25('0x2c')]=qs[_0x6e25('0x2c')](_0x377dcd[_0x6e25('0x43')][_0x6e25('0x2c')]);}_0x5bf05b['order']=qs[_0x6e25('0x4a')](_0x377dcd[_0x6e25('0x43')][_0x6e25('0x4a')]);_0x5bf05b[_0x6e25('0x4b')]=qs['filters'](_[_0x6e25('0x4d')](_0x377dcd[_0x6e25('0x43')],_0x13f2c0[_0x6e25('0x4c')]));_0x5bf05b['where']['SmsAccountId']=_0x41f02f['id'];if(_0x377dcd[_0x6e25('0x43')]['filter']){_0x5bf05b['where']=_[_0x6e25('0x4e')](_0x5bf05b[_0x6e25('0x4b')],{'$or':_[_0x6e25('0x42')](_0x5bf05b[_0x6e25('0x46')],function(_0x357b4b){var _0x14a538={};_0x14a538[_0x357b4b]={'$like':'%'+_0x377dcd[_0x6e25('0x43')][_0x6e25('0x50')]+'%'};return _0x14a538;})});}_0x5bf05b=_[_0x6e25('0x4e')]({},_0x5bf05b,_0x377dcd[_0x6e25('0x51')]);return db[_0x6e25('0xa1')]['count']({'where':_0x5bf05b[_0x6e25('0x4b')]})['then'](function(_0x57aa7f){_0x14a4a8[_0x6e25('0x52')]=_0x57aa7f;if(_0x377dcd[_0x6e25('0x43')]['includeAll']){_0x5bf05b[_0x6e25('0x53')]=[{'model':db[_0x6e25('0x75')],'as':_0x6e25('0xc1'),'required':![]},{'model':db['User'],'as':_0x6e25('0xc2'),'attributes':[_0x6e25('0x39'),_0x6e25('0xc3'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x6e25('0xc4'),'attributes':['id',_0x6e25('0x39'),_0x6e25('0xc5')],'where':_0x377dcd[_0x6e25('0x43')][_0x6e25('0xc6')]?{'id':_0x377dcd[_0x6e25('0x43')]['tag']}:undefined,'required':_0x377dcd[_0x6e25('0x43')][_0x6e25('0xc6')]?!![]:![]}];}return db['SmsInteraction'][_0x6e25('0x54')](_0x5bf05b);})[_0x6e25('0x20')](function(_0x149a58){_0x14a4a8[_0x6e25('0x55')]=_0x149a58;return _0x14a4a8;});}})[_0x6e25('0x20')](respondWithFilteredResult(_0x4a4336,_0x5bf05b))[_0x6e25('0x29')](handleError(_0x4a4336,null));};exports[_0x6e25('0x3a')]=function(_0x4968d6,_0x237180,_0x454764){var _0x5127f4,_0x66189f,_0x5be18e;if(_['isNil'](_0x4968d6['body'][_0x6e25('0x5c')])||_0x4968d6[_0x6e25('0x5c')][_0x6e25('0x5c')]===''){throw new db[(_0x6e25('0x76'))][(_0x6e25('0x77'))](_0x6e25('0x98'));}if(_[_0x6e25('0x96')](_0x4968d6['body']['to'])){throw new db[(_0x6e25('0x76'))]['ValidationError']('to\x20is\x20mandatory');}_0x5127f4=_0x4968d6[_0x6e25('0x5c')]['to'];return db['SmsAccount'][_0x6e25('0x60')]({'where':{'id':_0x4968d6['params']['id']},'include':[{'model':db['CmList'],'as':_0x6e25('0xc7'),'include':[{'model':db[_0x6e25('0x75')],'as':_0x6e25('0x9d'),'where':{'mobile':_0x5127f4},'limit':0x1,'order':[[_0x6e25('0x79'),_0x6e25('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x237180,null))[_0x6e25('0x20')](function(_0x40a619){if(_0x40a619&&_0x40a619['List']){_0x66189f=_0x40a619[_0x6e25('0x35')]({'plain':!![]});if(_0x66189f[_0x6e25('0xc7')]&&_0x66189f[_0x6e25('0xc7')]['Contacts'][_0x6e25('0x59')]){return _0x66189f['List'][_0x6e25('0x9d')][0x0];}return db['CmContact'][_0x6e25('0x5b')](_[_0x6e25('0x19')](_0x4968d6[_0x6e25('0x5c')],{'firstName':_0x5127f4,'mobile':_0x5127f4,'phone':_0x5127f4,'ListId':_0x66189f['ListId']}));}})[_0x6e25('0x20')](handleEntityNotFound(_0x237180,null))[_0x6e25('0x20')](function(_0x50063f){if(_0x50063f){_0x5be18e=_0x50063f;return db[_0x6e25('0xa1')][_0x6e25('0x60')]({'where':{'ContactId':_0x5be18e['id'],'closed':![],'SmsAccountId':_0x66189f['id']}})[_0x6e25('0x20')](function(_0x4f3306){if(_0x4f3306){return[_0x4f3306,![]];}return db['SmsInteraction'][_0x6e25('0x5b')]({'UserId':_0x4968d6['user']['id'],'ContactId':_0x5be18e['id'],'SmsAccountId':_0x66189f['id'],'phone':_0x5127f4,'firstMsgDirection':'out','Messages':[_[_0x6e25('0x4e')](_0x4968d6[_0x6e25('0x5c')],{'read':![],'body':_0x4968d6[_0x6e25('0x5c')][_0x6e25('0x5c')],'phone':_0x5127f4,'SmsAccountId':_0x66189f['id'],'UserId':_0x4968d6[_0x6e25('0x5d')]['id'],'ContactId':_0x5be18e['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6e25('0xc8')}]})[_0x6e25('0x20')](function(_0x32ac52){return[_0x32ac52,!![]];});});}})['spread'](function(_0x2567e4,_0x5ddff0){if(_0x5ddff0){return _0x2567e4;}return db['SmsMessage'][_0x6e25('0x5b')](_[_0x6e25('0x4e')](_0x4968d6[_0x6e25('0x5c')],{'read':![],'body':_0x4968d6[_0x6e25('0x5c')][_0x6e25('0x5c')],'phone':_0x5127f4,'SmsAccountId':_0x66189f['id'],'SmsInteractionId':_0x2567e4['id'],'UserId':_0x4968d6[_0x6e25('0x5d')]['id'],'ContactId':_0x5be18e['id']}))[_0x6e25('0x20')](function(_0x9afaca){_0x2567e4[_0x6e25('0xc9')][_0x6e25('0xc8')]=[];_0x2567e4[_0x6e25('0xc9')][_0x6e25('0xc8')][_0x6e25('0xa6')](_0x9afaca[_0x6e25('0xc9')]);return _0x2567e4;});})['then'](respondWithResult(_0x237180,null))[_0x6e25('0x29')](handleError(_0x237180,null));};exports['status']=function(_0x5bf43e,_0x5b5311,_0x221a4a){if(_0x5bf43e[_0x6e25('0x5c')]['id']){delete _0x5bf43e[_0x6e25('0x5c')]['id'];}var _0x16e21b,_0x5b6dad,_0x4ea41f;return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x5bf43e[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x5b5311,null))['then'](function(_0xfdaad0){if(_0xfdaad0){_0x4ea41f=_0xfdaad0;logger[_0x6e25('0xb3')](_0x6e25('0x23'),'status',_0x6e25('0xca'),_0xfdaad0[_0x6e25('0x7e')],util[_0x6e25('0xcb')](_0x5bf43e[_0x6e25('0x5c')],{'showHidden':![],'depth':null}));switch(_0xfdaad0['type']){case _0x6e25('0x82'):if(_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xcc')]&&_0x5bf43e[_0x6e25('0x5c')]['status']){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x2b')];return db[_0x6e25('0xcd')]['find']({'where':{'messageId':_0x5bf43e['body']['skebby_dispatch_id']}});}break;case _0x6e25('0x86'):if(_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xce')]&&_0x5bf43e[_0x6e25('0x5c')]['statusInt']){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xcf')];return db[_0x6e25('0xcd')][_0x6e25('0x60')]({'where':{'messageId':_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xce')]}});}break;case _0x6e25('0x87'):if(_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x88')]&&_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xd0')]){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xd0')];return db[_0x6e25('0xcd')]['find']({'where':{'messageId':_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x88')]}});}break;case _0x6e25('0x8c'):var _0x151fbd=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x8d')][0x0];if(_0x151fbd[_0x6e25('0x81')]&&_0x151fbd[_0x6e25('0x2b')][_0x6e25('0xd1')]==='DELIVERED'){_0x5b6dad=_0x151fbd[_0x6e25('0x2b')][_0x6e25('0xd1')];return db[_0x6e25('0xcd')][_0x6e25('0x60')]({'where':{'messageId':_0x151fbd[_0x6e25('0x81')]}});}break;case'clickatell':if(_0x5bf43e[_0x6e25('0x5c')]['messageId']&&_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x2b')]){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x2b')];return db['SmsMessage']['find']({'where':{'messageId':_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x81')]}});}break;case'bandwidth':if(_0x5bf43e[_0x6e25('0x5c')][0x0][_0x6e25('0x28')]['id']){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][0x0][_0x6e25('0x7e')];return db[_0x6e25('0xcd')][_0x6e25('0x60')]({'where':{'messageId':_0x5bf43e['body'][0x0][_0x6e25('0x28')]['id']}});}break;case'intelepeer':if(_0x5bf43e['body']['redif']&&_0x5bf43e['body'][_0x6e25('0x2b')]){_0x5b6dad=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x2b')];return db[_0x6e25('0xcd')]['find']({'where':{'messageId':_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0xd2')]}});}break;}}})[_0x6e25('0x20')](handleEntityNotFound(_0x5b5311,null))['then'](function(_0x47c2fe){if(_0x47c2fe){_0x16e21b=_0x47c2fe;switch(_0x4ea41f[_0x6e25('0x7e')]){case _0x6e25('0x82'):if(_0x5b6dad==='DELIVERED'){return _0x16e21b[_0x6e25('0x34')]({'read':!![]});}else{logger[_0x6e25('0x26')](_0x6e25('0x23'),_0x6e25('0x2b'),_0x6e25('0x82'),util['inspect'](_0x5bf43e['body'],{'showHidden':![],'depth':null}));}break;case _0x6e25('0x86'):if(_0x5b6dad==='1'){return _0x16e21b[_0x6e25('0x34')]({'read':!![]});}else{logger[_0x6e25('0x26')](_0x6e25('0x23'),'status',_0x6e25('0x82'),util[_0x6e25('0xcb')](_0x5bf43e['body'],{'showHidden':![],'depth':null}));}break;case _0x6e25('0x87'):if(!_0x5bf43e['body'][_0x6e25('0xd3')]&&_0x5b6dad>=0xc8&&_0x5b6dad<=0xce){return _0x16e21b['update']({'read':!![]});}else{logger[_0x6e25('0x26')](_0x6e25('0x23'),_0x6e25('0x2b'),_0x6e25('0x87'),util['inspect'](_0x5bf43e[_0x6e25('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3b2cfd=_0x5bf43e[_0x6e25('0x5c')][_0x6e25('0x8d')][0x0];if(_0x3b2cfd[_0x6e25('0x2b')][_0x6e25('0xd1')]===_0x6e25('0xd4')){return _0x16e21b[_0x6e25('0x34')]({'read':!![]});}else{logger['error'](_0x6e25('0x23'),_0x6e25('0x2b'),_0x6e25('0x8c'),util[_0x6e25('0xcb')](_0x5bf43e[_0x6e25('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6e25('0x91'):if(_0x5b6dad=='DELIVERED_TO_GATEWAY'||_0x5b6dad=='RECEIVED_BY_RECIPIENT'){return _0x16e21b[_0x6e25('0x34')]({'read':!![]});}else{logger[_0x6e25('0x26')](_0x6e25('0x23'),'status',_0x6e25('0x91'),util['inspect'](_0x5bf43e['body'],{'showHidden':![],'depth':null}));}break;case _0x6e25('0x93'):if(_0x5b6dad==_0x6e25('0xd5')){return _0x16e21b['update']({'read':!![]});}else{logger[_0x6e25('0x26')](_0x6e25('0x23'),_0x6e25('0x2b'),_0x6e25('0x93'),util[_0x6e25('0xcb')](_0x5bf43e[_0x6e25('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6e25('0x94'):if(_0x5b6dad===_0x6e25('0xd6')||_0x5b6dad==='ACCEPTD'){return _0x16e21b[_0x6e25('0x34')]({'read':!![]});}else{logger[_0x6e25('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6e25('0x2b'),_0x6e25('0x94'),util['inspect'](_0x5bf43e[_0x6e25('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x16e21b;}})[_0x6e25('0x20')](respondWithResult(_0x5b5311,null))[_0x6e25('0x29')](handleError(_0x5b5311,null));};exports[_0x6e25('0xd7')]=function(_0x387c64,_0x566185,_0x31e80c){var _0x557715,_0x1da60d,_0x5f548a;return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x387c64[_0x6e25('0x57')]['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x566185,null))[_0x6e25('0x20')](function(_0x315e1a){if(_0x315e1a){_0x5f548a=_0x315e1a;logger[_0x6e25('0xb3')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6e25('0x2b'),'received\x20delivery\x20report\x20from',_0x315e1a['type'],util['inspect'](_0x387c64[_0x6e25('0x43')],{'showHidden':![],'depth':null}));switch(_0x315e1a['type']){case'csc':if(_0x387c64['query'][_0x6e25('0xd8')]&&_0x387c64[_0x6e25('0x43')][_0x6e25('0xd9')]){_0x1da60d=_0x387c64[_0x6e25('0x43')][_0x6e25('0xd9')];return db[_0x6e25('0xcd')][_0x6e25('0x60')]({'where':{'messageId':_0x387c64[_0x6e25('0x43')][_0x6e25('0xd8')]}});}break;}}})[_0x6e25('0x20')](handleEntityNotFound(_0x566185,null))[_0x6e25('0x20')](function(_0x4381a2){if(_0x4381a2){_0x557715=_0x4381a2;switch(_0x5f548a[_0x6e25('0x7e')]){case _0x6e25('0x8e'):if(_0x1da60d==='2'||_0x1da60d==='6'){return _0x557715[_0x6e25('0x34')]({'read':!![]});}else{logger['error'](_0x6e25('0x23'),_0x6e25('0x2b'),'csc',util[_0x6e25('0xcb')](_0x387c64[_0x6e25('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x557715;}})['then'](respondWithResult(_0x566185,null))['catch'](handleError(_0x566185,null));};exports['addAgents']=function(_0x864753,_0x4ae8e4,_0x399e34){return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x864753['params']['id']}})[_0x6e25('0x20')](handleEntityNotFound(_0x4ae8e4,null))[_0x6e25('0x20')](function(_0x5d46f7){if(_0x5d46f7){return _0x5d46f7[_0x6e25('0xda')](_0x864753[_0x6e25('0x5c')][_0x6e25('0x68')],_[_0x6e25('0xdb')](_0x864753[_0x6e25('0x5c')],[_0x6e25('0x68'),'id'])||{})['spread'](function(_0x20c9d8){for(var _0x1a6420=0x0;_0x1a6420<_0x864753[_0x6e25('0x5c')][_0x6e25('0x68')][_0x6e25('0x59')];_0x1a6420+=0x1){socket['emit'](_0x6e25('0xdc'),{'UserId':Number(_0x864753['body'][_0x6e25('0x68')][_0x1a6420]),'SmsAccountId':Number(_0x864753[_0x6e25('0x57')]['id'])});}return _0x20c9d8;});}})[_0x6e25('0x20')](respondWithResult(_0x4ae8e4,null))[_0x6e25('0x29')](handleError(_0x4ae8e4,null));};exports[_0x6e25('0xdd')]=function(_0x5b9009,_0x321b78,_0xd9af3d){return db[_0x6e25('0x3d')][_0x6e25('0x60')]({'where':{'id':_0x5b9009['params']['id']}})['then'](handleEntityNotFound(_0x321b78,null))[_0x6e25('0x20')](function(_0xe4509a){if(_0xe4509a){return _0xe4509a['removeAgents'](_0x5b9009[_0x6e25('0x43')]['ids'])['then'](function(){if(_[_0x6e25('0xde')](_0x5b9009[_0x6e25('0x43')][_0x6e25('0x68')])){for(var _0x12b419=0x0;_0x12b419<_0x5b9009['query']['ids'][_0x6e25('0x59')];_0x12b419+=0x1){socket['emit'](_0x6e25('0xdf'),{'UserId':Number(_0x5b9009[_0x6e25('0x43')][_0x6e25('0x68')][_0x12b419]),'SmsAccountId':Number(_0x5b9009[_0x6e25('0x57')]['id'])});}}else{socket[_0x6e25('0xe0')](_0x6e25('0xdf'),{'UserId':Number(_0x5b9009[_0x6e25('0x43')][_0x6e25('0x68')]),'SmsAccountId':Number(_0x5b9009[_0x6e25('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x321b78,null))['catch'](handleError(_0x321b78,null));};exports[_0x6e25('0xe1')]=function(_0x302aa7,_0x3bd063,_0x34cd95){var _0x47e3ee={};var _0x468c5b={};var _0x3234f8;var _0x54faec;return db[_0x6e25('0x3d')][_0x6e25('0x6a')]({'where':{'id':_0x302aa7[_0x6e25('0x57')]['id']}})['then'](handleEntityNotFound(_0x3bd063,null))['then'](function(_0x247d74){if(_0x247d74){_0x3234f8=_0x247d74;_0x468c5b[_0x6e25('0x41')]=_[_0x6e25('0x44')](db['User'][_0x6e25('0x3e')]);_0x468c5b[_0x6e25('0x43')]=_['keys'](_0x302aa7['query']);_0x468c5b[_0x6e25('0x4c')]=_['intersection'](_0x468c5b['model'],_0x468c5b[_0x6e25('0x43')]);_0x47e3ee[_0x6e25('0x46')]=_[_0x6e25('0x45')](_0x468c5b[_0x6e25('0x41')],qs[_0x6e25('0x47')](_0x302aa7[_0x6e25('0x43')][_0x6e25('0x47')]));_0x47e3ee[_0x6e25('0x46')]=_0x47e3ee[_0x6e25('0x46')]['length']?_0x47e3ee[_0x6e25('0x46')]:_0x468c5b[_0x6e25('0x41')];_0x47e3ee[_0x6e25('0x49')]=qs[_0x6e25('0x4a')](_0x302aa7[_0x6e25('0x43')][_0x6e25('0x4a')]);_0x47e3ee[_0x6e25('0x4b')]=qs[_0x6e25('0x4c')](_['pick'](_0x302aa7[_0x6e25('0x43')],_0x468c5b[_0x6e25('0x4c')]));if(_0x302aa7[_0x6e25('0x43')][_0x6e25('0x50')]){_0x47e3ee[_0x6e25('0x4b')]=_[_0x6e25('0x4e')](_0x47e3ee[_0x6e25('0x4b')],{'$or':_[_0x6e25('0x42')](_0x47e3ee['attributes'],function(_0x41db05){var _0x1d1f3d={};_0x1d1f3d[_0x41db05]={'$like':'%'+_0x302aa7[_0x6e25('0x43')][_0x6e25('0x50')]+'%'};return _0x1d1f3d;})});}_0x47e3ee=_[_0x6e25('0x4e')]({},_0x47e3ee,_0x302aa7[_0x6e25('0x51')]);return _0x3234f8['getAgents'](_0x47e3ee);}})[_0x6e25('0x20')](function(_0x5d9937){if(_0x5d9937){_0x54faec=_0x5d9937[_0x6e25('0x59')];if(!_0x302aa7[_0x6e25('0x43')][_0x6e25('0x66')](_0x6e25('0x48'))){_0x47e3ee[_0x6e25('0x2e')]=qs[_0x6e25('0x2e')](_0x302aa7[_0x6e25('0x43')][_0x6e25('0x2e')]);_0x47e3ee[_0x6e25('0x2c')]=qs[_0x6e25('0x2c')](_0x302aa7['query'][_0x6e25('0x2c')]);}return _0x3234f8[_0x6e25('0xe1')](_0x47e3ee);}})['then'](function(_0x51dec2){if(_0x51dec2){return _0x51dec2?{'count':_0x54faec,'rows':_0x51dec2}:null;}})['then'](respondWithResult(_0x3bd063,null))[_0x6e25('0x29')](handleError(_0x3bd063,null));}; \ No newline at end of file +var _0x95c6=['client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','get','UserProfileResource','end','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','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','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','sms','SmsApplication','account','applications','orderBy','priority','asc','Applications','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','MessageSid','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','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','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','set','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','dataValues','Messages','push','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','bandwidth','redif','inspect','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','jayson/promise'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x95c6,0xcd));var _0x695c=function(_0x1979a,_0x3f5614){_0x1979a=_0x1979a-0x0;var _0x8a835=_0x95c6[_0x1979a];return _0x8a835;};'use strict';var emlformat=require(_0x695c('0x0'));var rimraf=require(_0x695c('0x1'));var zipdir=require(_0x695c('0x2'));var jsonpatch=require(_0x695c('0x3'));var rp=require(_0x695c('0x4'));var moment=require('moment');var BPromise=require(_0x695c('0x5'));var Mustache=require(_0x695c('0x6'));var util=require(_0x695c('0x7'));var path=require(_0x695c('0x8'));var sox=require(_0x695c('0x9'));var csv=require(_0x695c('0xa'));var ejs=require(_0x695c('0xb'));var fs=require('fs');var fs_extra=require(_0x695c('0xc'));var _=require('lodash');var squel=require(_0x695c('0xd'));var crypto=require('crypto');var jsforce=require(_0x695c('0xe'));var deskjs=require(_0x695c('0xf'));var toCsv=require(_0x695c('0xa'));var querystring=require('querystring');var Papa=require(_0x695c('0x10'));var Redis=require(_0x695c('0x11'));var authService=require(_0x695c('0x12'));var qs=require(_0x695c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x695c('0x14'));var logger=require('../../config/logger')(_0x695c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x695c('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x695c('0x17')](config['redis'],{'host':_0x695c('0x18'),'port':0x18eb});var socket=require(_0x695c('0x19'))(new Redis(config[_0x695c('0x1a')]));require(_0x695c('0x1b'))['register'](socket);var jayson=require(_0x695c('0x1c'));var client=jayson[_0x695c('0x1d')][_0x695c('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x34f7b8,_0x28ca25,_0xee84cf,_0x4f6943){return new BPromise(function(_0x3cec67,_0x17f538){var _0x2377e0=_0x4f6943||client;return _0x2377e0['request'](_0x34f7b8,_0xee84cf)[_0x695c('0x1f')](function(_0x1e2c90){logger[_0x695c('0x20')](_0x695c('0x21'),_0x28ca25,_0x695c('0x22'));logger['debug'](_0x695c('0x23'),_0x28ca25,_0x695c('0x22'),JSON['stringify'](_0x1e2c90));if(_0x1e2c90['error']){if(_0x1e2c90[_0x695c('0x24')][_0x695c('0x25')]===0x1f4){logger[_0x695c('0x24')]('SmsAccount,\x20%s,\x20%s',_0x28ca25,_0x1e2c90[_0x695c('0x24')][_0x695c('0x26')]);return _0x17f538(_0x1e2c90[_0x695c('0x24')][_0x695c('0x26')]);}logger[_0x695c('0x24')](_0x695c('0x21'),_0x28ca25,_0x1e2c90[_0x695c('0x24')][_0x695c('0x26')]);return _0x3cec67(_0x1e2c90[_0x695c('0x24')]['message']);}else{logger['info'](_0x695c('0x21'),_0x28ca25,_0x695c('0x22'));_0x3cec67(_0x1e2c90[_0x695c('0x27')][_0x695c('0x26')]);}})[_0x695c('0x28')](function(_0x688c7){logger[_0x695c('0x24')](_0x695c('0x21'),_0x28ca25,_0x688c7);_0x17f538(_0x688c7);});});}function respondWithStatusCode(_0x349107,_0x2d6730){_0x2d6730=_0x2d6730||0xcc;return function(_0x1cebda){if(_0x1cebda){return _0x349107[_0x695c('0x29')](_0x2d6730);}return _0x349107['status'](_0x2d6730)['end']();};}function respondWithResult(_0x30cdd8,_0x6c9ace){_0x6c9ace=_0x6c9ace||0xc8;return function(_0x296a50){if(_0x296a50){return _0x30cdd8[_0x695c('0x2a')](_0x6c9ace)[_0x695c('0x2b')](_0x296a50);}};}function respondWithFilteredResult(_0x4e7d70,_0x3128c9){return function(_0x35fd88){if(_0x35fd88){var _0x21301e=typeof _0x3128c9[_0x695c('0x2c')]===_0x695c('0x2d')&&typeof _0x3128c9[_0x695c('0x2e')]==='undefined';var _0x20212c=_0x35fd88[_0x695c('0x2f')];var _0x2d3daf=_0x21301e?0x0:_0x3128c9[_0x695c('0x2c')];var _0x30a199=_0x21301e?_0x35fd88[_0x695c('0x2f')]:_0x3128c9[_0x695c('0x2c')]+_0x3128c9['limit'];var _0x4ac98f;if(_0x30a199>=_0x20212c){_0x30a199=_0x20212c;_0x4ac98f=0xc8;}else{_0x4ac98f=0xce;}_0x4e7d70[_0x695c('0x2a')](_0x4ac98f);return _0x4e7d70['set'](_0x695c('0x30'),_0x2d3daf+'-'+_0x30a199+'/'+_0x20212c)[_0x695c('0x2b')](_0x35fd88);}return null;};}function patchUpdates(_0x16cd65){return function(_0x24e0c4){try{jsonpatch[_0x695c('0x31')](_0x24e0c4,_0x16cd65,!![]);}catch(_0x59f20c){return BPromise['reject'](_0x59f20c);}return _0x24e0c4['save']();};}function saveUpdates(_0x137a0a,_0xde4bb9){return function(_0x27c228){if(_0x27c228){return _0x27c228[_0x695c('0x32')](_0x137a0a)[_0x695c('0x1f')](function(_0x415377){return _0x415377;});}return null;};}function removeEntity(_0x4bfd5a,_0x3f033b){return function(_0x3a85a3){if(_0x3a85a3){return _0x3a85a3[_0x695c('0x33')]()[_0x695c('0x1f')](function(){var _0x12ed00=_0x3a85a3[_0x695c('0x34')]({'plain':!![]});var _0x396c70='SmsAccounts';return db[_0x695c('0x35')][_0x695c('0x33')]({'where':{'type':_0x396c70,'resourceId':_0x12ed00['id']}})[_0x695c('0x1f')](function(){return _0x3a85a3;});})[_0x695c('0x1f')](function(){_0x4bfd5a[_0x695c('0x2a')](0xcc)[_0x695c('0x36')]();});}};}function handleEntityNotFound(_0x48e6a9,_0x1192c9){return function(_0x261aea){if(!_0x261aea){_0x48e6a9[_0x695c('0x29')](0x194);}return _0x261aea;};}function handleError(_0x27ce2b,_0x398612){_0x398612=_0x398612||0x1f4;return function(_0x1361fd){logger['error'](_0x1361fd['stack']);if(_0x1361fd['name']){delete _0x1361fd[_0x695c('0x37')];}_0x27ce2b[_0x695c('0x2a')](_0x398612)['send'](_0x1361fd);};}exports[_0x695c('0x38')]=function(_0x596da3,_0x321492){var _0x1f9cca={'include':[{'model':db[_0x695c('0x39')],'as':_0x695c('0x3a')}]},_0xc97384={},_0x3fe38b={'count':0x0,'rows':[]};var _0x294cd2=_['map'](db[_0x695c('0x3b')][_0x695c('0x3c')],function(_0x334cb1){return{'name':_0x334cb1['fieldName'],'type':_0x334cb1['type'][_0x695c('0x3d')]};});_0xc97384[_0x695c('0x3e')]=_[_0x695c('0x3f')](_0x294cd2,_0x695c('0x37'));_0xc97384[_0x695c('0x40')]=_[_0x695c('0x41')](_0x596da3['query']);_0xc97384[_0x695c('0x42')]=_[_0x695c('0x43')](_0xc97384[_0x695c('0x3e')],_0xc97384[_0x695c('0x40')]);_0x1f9cca[_0x695c('0x44')]=_[_0x695c('0x43')](_0xc97384[_0x695c('0x3e')],qs[_0x695c('0x45')](_0x596da3['query'][_0x695c('0x45')]));_0x1f9cca[_0x695c('0x44')]=_0x1f9cca[_0x695c('0x44')]['length']?_0x1f9cca['attributes']:_0xc97384[_0x695c('0x3e')];if(!_0x596da3[_0x695c('0x40')][_0x695c('0x46')](_0x695c('0x47'))){_0x1f9cca['limit']=qs[_0x695c('0x2e')](_0x596da3[_0x695c('0x40')]['limit']);_0x1f9cca[_0x695c('0x2c')]=qs['offset'](_0x596da3[_0x695c('0x40')][_0x695c('0x2c')]);}_0x1f9cca[_0x695c('0x48')]=qs[_0x695c('0x49')](_0x596da3[_0x695c('0x40')][_0x695c('0x49')]);_0x1f9cca['where']=qs[_0x695c('0x42')](_['pick'](_0x596da3[_0x695c('0x40')],_0xc97384['filters']),_0x294cd2);if(_0x596da3[_0x695c('0x40')]['filter']){_0x1f9cca[_0x695c('0x4a')]=_[_0x695c('0x4b')](_0x1f9cca[_0x695c('0x4a')],{'$or':_[_0x695c('0x3f')](_0x294cd2,function(_0x157c8c){if(_0x157c8c[_0x695c('0x4c')]!==_0x695c('0x4d')){var _0xa62118={};_0xa62118[_0x157c8c['name']]={'$like':'%'+_0x596da3[_0x695c('0x40')][_0x695c('0x4e')]+'%'};return _0xa62118;}})});}_0x1f9cca=_[_0x695c('0x4b')]({},_0x1f9cca,_0x596da3[_0x695c('0x4f')]);var _0x303976={'where':_0x1f9cca[_0x695c('0x4a')]};return db[_0x695c('0x3b')][_0x695c('0x2f')](_0x303976)['then'](function(_0x1f452e){_0x3fe38b[_0x695c('0x2f')]=_0x1f452e;if(_0x596da3[_0x695c('0x40')][_0x695c('0x50')]){_0x1f9cca[_0x695c('0x51')]=[{'all':!![]}];}return db[_0x695c('0x3b')][_0x695c('0x52')](_0x1f9cca);})[_0x695c('0x1f')](function(_0x1cae2b){_0x3fe38b['rows']=_0x1cae2b;return _0x3fe38b;})[_0x695c('0x1f')](respondWithFilteredResult(_0x321492,_0x1f9cca))[_0x695c('0x28')](handleError(_0x321492,null));};exports[_0x695c('0x53')]=function(_0x1e6a07,_0x4b8d08){var _0x3be444={'raw':![],'where':{'id':_0x1e6a07[_0x695c('0x54')]['id']},'include':[{'model':db[_0x695c('0x39')],'as':_0x695c('0x3a')}]},_0x41c4ea={};_0x41c4ea[_0x695c('0x3e')]=_[_0x695c('0x41')](db[_0x695c('0x3b')][_0x695c('0x3c')]);_0x41c4ea[_0x695c('0x40')]=_[_0x695c('0x41')](_0x1e6a07[_0x695c('0x40')]);_0x41c4ea[_0x695c('0x42')]=_[_0x695c('0x43')](_0x41c4ea['model'],_0x41c4ea['query']);_0x3be444[_0x695c('0x44')]=_[_0x695c('0x43')](_0x41c4ea['model'],qs[_0x695c('0x45')](_0x1e6a07[_0x695c('0x40')]['fields']));_0x3be444[_0x695c('0x44')]=_0x3be444[_0x695c('0x44')][_0x695c('0x55')]?_0x3be444['attributes']:_0x41c4ea[_0x695c('0x3e')];if(_0x1e6a07[_0x695c('0x40')][_0x695c('0x50')]){_0x3be444[_0x695c('0x51')]=[{'all':!![]}];}_0x3be444=_['merge']({},_0x3be444,_0x1e6a07[_0x695c('0x4f')]);return db[_0x695c('0x3b')][_0x695c('0x56')](_0x3be444)[_0x695c('0x1f')](handleEntityNotFound(_0x4b8d08,null))['then'](respondWithResult(_0x4b8d08,null))[_0x695c('0x28')](handleError(_0x4b8d08,null));};exports[_0x695c('0x57')]=function(_0x31a817,_0x4224aa){return db['SmsAccount'][_0x695c('0x57')](_0x31a817[_0x695c('0x58')],{})[_0x695c('0x1f')](function(_0x1d15bc){var _0x5ea86d=_0x31a817['user'][_0x695c('0x34')]({'plain':!![]});if(!_0x5ea86d)throw new Error(_0x695c('0x59'));if(_0x5ea86d[_0x695c('0x5a')]===_0x695c('0x5b')){var _0x5a206e=_0x1d15bc[_0x695c('0x34')]({'plain':!![]});var _0x32075c='SmsAccounts';return db[_0x695c('0x5c')][_0x695c('0x56')]({'where':{'name':_0x32075c,'userProfileId':_0x5ea86d[_0x695c('0x5d')]},'raw':!![]})['then'](function(_0x27aa09){if(_0x27aa09&&_0x27aa09[_0x695c('0x5e')]===0x0){return db['UserProfileResource'][_0x695c('0x57')]({'name':_0x5a206e[_0x695c('0x37')],'resourceId':_0x5a206e['id'],'type':_0x27aa09['name'],'sectionId':_0x27aa09['id']},{})[_0x695c('0x1f')](function(){return _0x1d15bc;});}else{return _0x1d15bc;}})['catch'](function(_0x54a201){logger['error'](_0x695c('0x5f'),_0x54a201);throw _0x54a201;});}return _0x1d15bc;})[_0x695c('0x1f')](respondWithResult(_0x4224aa,0xc9))['catch'](handleError(_0x4224aa,null));};exports['update']=function(_0x29d5a8,_0x1f72b7){if(_0x29d5a8[_0x695c('0x58')]['id']){delete _0x29d5a8[_0x695c('0x58')]['id'];}return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x29d5a8[_0x695c('0x54')]['id']},'include':[{'model':db[_0x695c('0x39')],'as':_0x695c('0x3a')}]})[_0x695c('0x1f')](handleEntityNotFound(_0x1f72b7,null))[_0x695c('0x1f')](saveUpdates(_0x29d5a8[_0x695c('0x58')],null))[_0x695c('0x1f')](respondWithResult(_0x1f72b7,null))[_0x695c('0x28')](handleError(_0x1f72b7,null));};exports['destroy']=function(_0x55a786,_0x260958){return db['SmsAccount']['find']({'where':{'id':_0x55a786['params']['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x260958,null))[_0x695c('0x1f')](removeEntity(_0x260958,null))[_0x695c('0x28')](handleError(_0x260958,null));};exports[_0x695c('0x60')]=function(_0xd85b7c,_0x34cbb){return db[_0x695c('0x3b')][_0x695c('0x60')]()[_0x695c('0x1f')](respondWithResult(_0x34cbb,null))[_0x695c('0x28')](handleError(_0x34cbb,null));};exports[_0x695c('0x61')]=function(_0x35041e,_0x5438b9,_0x3d19c6){if(_0x35041e[_0x695c('0x58')]['id']){delete _0x35041e[_0x695c('0x58')]['id'];}return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x35041e[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x5438b9,null))[_0x695c('0x1f')](function(_0x2086da){if(_0x2086da){_0x35041e[_0x695c('0x58')][_0x695c('0x62')]=_0x2086da['id'];return db[_0x695c('0x63')]['create'](_0x35041e[_0x695c('0x58')]);}})['then'](respondWithResult(_0x5438b9,null))['catch'](handleError(_0x5438b9,null));};exports[_0x695c('0x64')]=function(_0x604833,_0xf2586e,_0x1f6093){var _0x471d18={'raw':![],'where':{}};var _0x35a05d={};var _0x422e8e={'count':0x0,'rows':[]};return db[_0x695c('0x3b')][_0x695c('0x65')]({'where':{'id':_0x604833['params']['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0xf2586e,null))[_0x695c('0x1f')](function(_0x4e983a){if(_0x4e983a){_0x35a05d['model']=_[_0x695c('0x41')](db[_0x695c('0x63')][_0x695c('0x3c')]);_0x35a05d[_0x695c('0x40')]=_[_0x695c('0x41')](_0x604833[_0x695c('0x40')]);_0x35a05d[_0x695c('0x42')]=_[_0x695c('0x43')](_0x35a05d[_0x695c('0x3e')],_0x35a05d[_0x695c('0x40')]);_0x471d18[_0x695c('0x44')]=_[_0x695c('0x43')](_0x35a05d[_0x695c('0x3e')],qs[_0x695c('0x45')](_0x604833[_0x695c('0x40')][_0x695c('0x45')]));_0x471d18[_0x695c('0x44')]=_0x471d18[_0x695c('0x44')][_0x695c('0x55')]?_0x471d18[_0x695c('0x44')]:_0x35a05d[_0x695c('0x3e')];if(!_0x604833['query'][_0x695c('0x46')](_0x695c('0x47'))){_0x471d18[_0x695c('0x2e')]=qs[_0x695c('0x2e')](_0x604833[_0x695c('0x40')][_0x695c('0x2e')]);_0x471d18['offset']=qs[_0x695c('0x2c')](_0x604833['query'][_0x695c('0x2c')]);}_0x471d18[_0x695c('0x48')]=qs[_0x695c('0x49')](_0x604833['query'][_0x695c('0x49')]);_0x471d18[_0x695c('0x4a')]=qs['filters'](_['pick'](_0x604833['query'],_0x35a05d['filters']));_0x471d18[_0x695c('0x4a')][_0x695c('0x62')]=_0x4e983a['id'];if(_0x604833[_0x695c('0x40')]['filter']){_0x471d18['where']=_['merge'](_0x471d18['where'],{'$or':_[_0x695c('0x3f')](_0x471d18[_0x695c('0x44')],function(_0x3c94e7){var _0x3a83d5={};_0x3a83d5[_0x3c94e7]={'$like':'%'+_0x604833['query'][_0x695c('0x4e')]+'%'};return _0x3a83d5;})});}_0x471d18=_[_0x695c('0x4b')]({},_0x471d18,_0x604833[_0x695c('0x4f')]);return db['Disposition']['count']({'where':_0x471d18[_0x695c('0x4a')]})[_0x695c('0x1f')](function(_0x357ddc){_0x422e8e[_0x695c('0x2f')]=_0x357ddc;if(_0x604833[_0x695c('0x40')][_0x695c('0x50')]){_0x471d18[_0x695c('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x695c('0x52')](_0x471d18);})[_0x695c('0x1f')](function(_0x32fb9a){_0x422e8e[_0x695c('0x66')]=_0x32fb9a;return _0x422e8e;});}})[_0x695c('0x1f')](respondWithFilteredResult(_0xf2586e,_0x471d18))[_0x695c('0x28')](handleError(_0xf2586e,null));};exports[_0x695c('0x67')]=function(_0x4616ac,_0x1b53c6,_0x4e64be){return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x4616ac['params']['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x1b53c6,null))['then'](function(_0x345109){if(_0x345109){return _0x345109[_0x695c('0x67')](_0x4616ac[_0x695c('0x40')][_0x695c('0x68')]);}})[_0x695c('0x1f')](respondWithStatusCode(_0x1b53c6,null))[_0x695c('0x28')](handleError(_0x1b53c6,null));};exports[_0x695c('0x69')]=function(_0x5c538f,_0x3078c6,_0x44f4e7){if(_0x5c538f[_0x695c('0x58')]['id']){delete _0x5c538f['body']['id'];}return db[_0x695c('0x3b')]['find']({'where':{'id':_0x5c538f[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x3078c6,null))[_0x695c('0x1f')](function(_0x3e7af6){if(_0x3e7af6){_0x5c538f[_0x695c('0x58')][_0x695c('0x62')]=_0x3e7af6['id'];return db[_0x695c('0x6a')]['create'](_0x5c538f['body']);}})[_0x695c('0x1f')](respondWithResult(_0x3078c6,null))['catch'](handleError(_0x3078c6,null));};exports[_0x695c('0x6b')]=function(_0xd082f4,_0x685c72,_0x43d2cc){var _0x5acaa6={'raw':![],'where':{}};var _0x4e29e2={};var _0x56f631={'count':0x0,'rows':[]};return db[_0x695c('0x3b')][_0x695c('0x65')]({'where':{'id':_0xd082f4[_0x695c('0x54')]['id']}})['then'](handleEntityNotFound(_0x685c72,null))['then'](function(_0x2ab26b){if(_0x2ab26b){_0x4e29e2[_0x695c('0x3e')]=_[_0x695c('0x41')](db['CannedAnswer'][_0x695c('0x3c')]);_0x4e29e2['query']=_[_0x695c('0x41')](_0xd082f4[_0x695c('0x40')]);_0x4e29e2[_0x695c('0x42')]=_['intersection'](_0x4e29e2[_0x695c('0x3e')],_0x4e29e2[_0x695c('0x40')]);_0x5acaa6['attributes']=_[_0x695c('0x43')](_0x4e29e2[_0x695c('0x3e')],qs[_0x695c('0x45')](_0xd082f4[_0x695c('0x40')][_0x695c('0x45')]));_0x5acaa6[_0x695c('0x44')]=_0x5acaa6['attributes'][_0x695c('0x55')]?_0x5acaa6[_0x695c('0x44')]:_0x4e29e2['model'];if(!_0xd082f4[_0x695c('0x40')]['hasOwnProperty'](_0x695c('0x47'))){_0x5acaa6['limit']=qs[_0x695c('0x2e')](_0xd082f4[_0x695c('0x40')][_0x695c('0x2e')]);_0x5acaa6[_0x695c('0x2c')]=qs[_0x695c('0x2c')](_0xd082f4[_0x695c('0x40')][_0x695c('0x2c')]);}_0x5acaa6[_0x695c('0x48')]=qs['sort'](_0xd082f4[_0x695c('0x40')][_0x695c('0x49')]);_0x5acaa6[_0x695c('0x4a')]=qs['filters'](_[_0x695c('0x6c')](_0xd082f4[_0x695c('0x40')],_0x4e29e2[_0x695c('0x42')]));_0x5acaa6[_0x695c('0x4a')][_0x695c('0x62')]=_0x2ab26b['id'];if(_0xd082f4[_0x695c('0x40')][_0x695c('0x4e')]){_0x5acaa6[_0x695c('0x4a')]=_['merge'](_0x5acaa6[_0x695c('0x4a')],{'$or':_[_0x695c('0x3f')](_0x5acaa6['attributes'],function(_0x584b5d){var _0x313da9={};_0x313da9[_0x584b5d]={'$like':'%'+_0xd082f4[_0x695c('0x40')][_0x695c('0x4e')]+'%'};return _0x313da9;})});}_0x5acaa6=_['merge']({},_0x5acaa6,_0xd082f4[_0x695c('0x4f')]);return db['CannedAnswer']['count']({'where':_0x5acaa6[_0x695c('0x4a')]})[_0x695c('0x1f')](function(_0x2f11b0){_0x56f631[_0x695c('0x2f')]=_0x2f11b0;if(_0xd082f4['query'][_0x695c('0x50')]){_0x5acaa6['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x695c('0x52')](_0x5acaa6);})[_0x695c('0x1f')](function(_0x5a5b93){_0x56f631[_0x695c('0x66')]=_0x5a5b93;return _0x56f631;});}})[_0x695c('0x1f')](respondWithFilteredResult(_0x685c72,_0x5acaa6))[_0x695c('0x28')](handleError(_0x685c72,null));};exports[_0x695c('0x6d')]=function(_0x3dc6e0,_0x5e3b69,_0x4da64a){return db['SmsAccount'][_0x695c('0x56')]({'where':{'id':_0x3dc6e0['params']['id']}})['then'](handleEntityNotFound(_0x5e3b69,null))['then'](function(_0x43370b){if(_0x43370b){return _0x43370b[_0x695c('0x6d')](_0x3dc6e0[_0x695c('0x40')][_0x695c('0x68')]);}})[_0x695c('0x1f')](respondWithStatusCode(_0x5e3b69,null))[_0x695c('0x28')](handleError(_0x5e3b69,null));};exports['notify']=function(_0x16ff4e,_0x115ff9,_0xf7c4c3){var _0x43eba1={'channel':_0x695c('0x6e')};var _0x2ec01a=[];var _0x21caa3=[];var _0x3d5f4a={};return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x16ff4e[_0x695c('0x54')]['id']},'include':[{'model':db[_0x695c('0x6f')],'as':'Applications'}]})[_0x695c('0x1f')](handleEntityNotFound(_0x115ff9,null))[_0x695c('0x1f')](function(_0x1619e0){_0x43eba1[_0x695c('0x70')]=_0x1619e0;_0x43eba1[_0x695c('0x71')]=_[_0x695c('0x72')](_0x1619e0['Applications'],[_0x695c('0x73')],[_0x695c('0x74')]);if(_0x43eba1[_0x695c('0x70')][_0x695c('0x75')]){delete _0x43eba1['account'][_0x695c('0x75')];}return db['CmContact'][_0x695c('0x60')]();})['then'](function(_0x6edb76){if(!_0x6edb76){throw new db['Sequelize'][(_0x695c('0x76'))](_0x695c('0x77'));}_0x2ec01a=_[_0x695c('0x78')](_['keys'](_0x6edb76),['createdAt',_0x695c('0x79')]);_0x21caa3=_[_0x695c('0x78')](_[_0x695c('0x41')](_0x6edb76),[_0x695c('0x7a'),_0x695c('0x79'),_0x695c('0x7b'),_0x695c('0x7c')]);_0x43eba1[_0x695c('0x58')]={'mapKey':_0x695c('0x7d')};if(_0x43eba1[_0x695c('0x70')]['type']){switch(_0x43eba1[_0x695c('0x70')]['type']){case'twilio':_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x7f')];_0x43eba1['body'][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')]['Body'];_0x43eba1['body']['messageId']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x80')];break;case'skebby':_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')]='+'+_0x16ff4e[_0x695c('0x58')]['sender'];_0x43eba1['body']['body']=_0x16ff4e[_0x695c('0x58')]['text'];break;case _0x695c('0x81'):_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x7e')];_0x43eba1[_0x695c('0x58')][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x26')];break;case _0x695c('0x82'):_0x43eba1['body'][_0x695c('0x7e')]=_0x16ff4e['body'][_0x695c('0x7e')];_0x43eba1['body']['body']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x58')];_0x43eba1[_0x695c('0x58')][_0x695c('0x83')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x84')];break;case _0x695c('0x85'):_0x43eba1[_0x695c('0x58')]['from']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x7f')];_0x43eba1['body'][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x86')];_0x43eba1[_0x695c('0x58')]['messageId']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x87')];break;case'infobip':_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')]='+'+_0x16ff4e[_0x695c('0x58')][_0x695c('0x88')][0x0][_0x695c('0x7e')];_0x43eba1['body'][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x88')][0x0][_0x695c('0x89')];_0x43eba1['body'][_0x695c('0x83')]=_0x16ff4e['body'][_0x695c('0x88')][0x0][_0x695c('0x83')];break;case _0x695c('0x8a'):_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x8b')];_0x43eba1['body']['body']=_0x16ff4e['body'][_0x695c('0x8c')][_0x695c('0x26')];break;case _0x695c('0x8d'):_0x43eba1[_0x695c('0x58')]['from']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x8e')];_0x43eba1[_0x695c('0x58')][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x89')];_0x43eba1[_0x695c('0x58')][_0x695c('0x83')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x8f')];break;case'bandwidth':_0x43eba1[_0x695c('0x58')][_0x695c('0x83')]=_0x16ff4e['body'][0x0][_0x695c('0x26')]['id'];_0x43eba1['body'][_0x695c('0x7e')]=_0x16ff4e[_0x695c('0x58')][0x0][_0x695c('0x26')][_0x695c('0x7e')];_0x43eba1[_0x695c('0x58')][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][0x0][_0x695c('0x26')][_0x695c('0x89')];break;case _0x695c('0x90'):_0x43eba1[_0x695c('0x58')]['from']=_0x16ff4e[_0x695c('0x58')][_0x695c('0x7e')];_0x43eba1[_0x695c('0x58')][_0x695c('0x58')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x26')];_0x43eba1['body'][_0x695c('0x83')]=_0x16ff4e[_0x695c('0x58')][_0x695c('0x91')];break;}}if(_0x43eba1[_0x695c('0x58')]['id']){delete _0x43eba1['body']['id'];}if(_[_0x695c('0x92')](_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')])){throw new db[(_0x695c('0x93'))][(_0x695c('0x76'))](_0x695c('0x94'));}if(_['isNil'](_0x43eba1[_0x695c('0x58')]['body'])||_0x43eba1['body'][_0x695c('0x58')]===''){throw new db[(_0x695c('0x93'))][(_0x695c('0x76'))](_0x695c('0x95'));}if(_[_0x695c('0x92')](_0x43eba1[_0x695c('0x58')][_0x695c('0x96')])){throw new db[(_0x695c('0x93'))]['ValidationError'](_0x695c('0x97')+_0x21caa3);}if(!_[_0x695c('0x98')](_0x21caa3,_0x43eba1[_0x695c('0x58')][_0x695c('0x96')])){throw new db[(_0x695c('0x93'))][(_0x695c('0x76'))](_0x695c('0x99')+_0x21caa3);}_0x3d5f4a[_0x43eba1[_0x695c('0x58')][_0x695c('0x96')]]=_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')];return db['CmList'][_0x695c('0x56')]({'where':{'id':_0x43eba1[_0x695c('0x70')][_0x695c('0x7c')]},'include':[{'model':db[_0x695c('0x9a')],'as':_0x695c('0x9b'),'where':_0x3d5f4a,'limit':0x1,'order':[[_0x695c('0x79'),_0x695c('0x9c')]]}]});})[_0x695c('0x1f')](handleEntityNotFound(_0x115ff9,null))[_0x695c('0x1f')](function(_0x9152e7){if(_0x9152e7){_0x43eba1[_0x695c('0x9d')]=_[_0x695c('0x9e')](_0x9152e7,['Contacts']);if(_0x9152e7[_0x695c('0x9b')][_0x695c('0x55')]){return _0x9152e7[_0x695c('0x9b')][0x0];}var _0x46d947=_[_0x695c('0x17')](_0x43eba1[_0x695c('0x58')],{'firstName':_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')],'ListId':_0x9152e7['id']});_0x46d947[_0x43eba1['body'][_0x695c('0x96')]]=_0x43eba1[_0x695c('0x58')]['from'];return db[_0x695c('0x9a')][_0x695c('0x57')](_0x46d947,{'fields':_0x2ec01a,'raw':!![]});}})[_0x695c('0x1f')](handleEntityNotFound(_0x115ff9,null))[_0x695c('0x1f')](function(_0x58a860){if(_0x58a860){_0x43eba1[_0x695c('0x9f')]=_0x58a860;var _0x3fa61e={'ContactId':_0x58a860['id'],'phone':_0x43eba1[_0x695c('0x58')][_0x695c('0x7e')],'SmsAccountId':_0x16ff4e['params']['id']};var _0x1cdaae={'ContactId':_0x58a860['id'],'SmsAccountId':_0x16ff4e[_0x695c('0x54')]['id'],'closed':![]};return db[_0x695c('0xa0')]['find']({'where':_0x1cdaae})[_0x695c('0x1f')](function(_0x201c29){if(_0x201c29){return[_0x201c29,![]];}return db[_0x695c('0xa0')][_0x695c('0x57')](_0x3fa61e)['then'](function(_0x3d9743){return[_0x3d9743,!![]];});});}})[_0x695c('0xa1')](function(_0x1d473a,_0x164698){_0x43eba1[_0x695c('0xa2')]=_0x1d473a['get']({'plain':!![]});_0x43eba1['interaction'][_0x695c('0xa3')]=![];if(_0x164698){if(_0x43eba1['account'][_0x695c('0xa4')]){_0x43eba1[_0x695c('0x71')]['push']({'id':0x0,'priority':_0x43eba1['applications'][_0x695c('0x55')]+0x1,'app':_0x695c('0xa5'),'appdata':'unmanaged','interval':_0x695c('0xa6')});}_0x43eba1[_0x695c('0xa2')][_0x695c('0xa3')]=!![];}return db[_0x695c('0xa7')][_0x695c('0x57')]({'phone':_0x43eba1[_0x695c('0x58')]['from'],'messageId':_0x43eba1[_0x695c('0x58')][_0x695c('0x83')],'body':_0x43eba1[_0x695c('0x58')][_0x695c('0x58')],'SmsAccountId':_0x16ff4e['params']['id'],'SmsInteractionId':_0x1d473a['id'],'direction':'in','ContactId':_0x1d473a['ContactId'],'AttachmentId':_0x43eba1[_0x695c('0x58')][_0x695c('0xa8')]});})[_0x695c('0x1f')](function(_0x28ffdf){_0x43eba1[_0x695c('0x26')]=_0x28ffdf;if(_0x43eba1[_0x695c('0xa2')][_0x695c('0xa9')]){return db[_0x695c('0xaa')]['find']({'attributes':['id',_0x695c('0x37')],'where':{'id':_0x43eba1[_0x695c('0xa2')][_0x695c('0xa9')]}})['then'](function(_0xbecd5){if(_0xbecd5){_0x43eba1[_0x695c('0x71')][_0x695c('0xab')]({'id':0x0,'priority':0x0,'app':_0x695c('0xac'),'appdata':_0xbecd5[_0x695c('0x37')]+','+(_0x43eba1[_0x695c('0x70')]['waitForTheAssignedAgent']||0xa),'interval':_0x695c('0xa6')});}return respondWithRpcPromise(_0x695c('0xad'),_0x695c('0xae'),_0x43eba1);});}return respondWithRpcPromise('Start','startRouting',_0x43eba1);})['then'](function(_0x7cb941){if(_0x7cb941){var _0x1aed1b=0xc8;var _0x37f92f=_0x695c('0xaf');logger[_0x695c('0x20')](_0x695c('0x23'),_0x37f92f,_0x1aed1b,_0x695c('0xb0'));logger[_0x695c('0xb1')](_0x695c('0xb2'),_0x37f92f,_0x1aed1b,_0x695c('0xb0'),JSON[_0x695c('0xb3')](_0x7cb941));if(_0x43eba1[_0x695c('0x70')][_0x695c('0x4c')]===_0x695c('0xb4')){return _0x115ff9[_0x695c('0x2a')](_0x1aed1b)[_0x695c('0xb5')]('Content-Type','text/xml')['send'](_0x695c('0xb6'));}else{return _0x115ff9[_0x695c('0x2a')](_0x1aed1b)[_0x695c('0x2b')](_0x7cb941);}}})[_0x695c('0x28')](handleError(_0x115ff9,null));};exports[_0x695c('0xb7')]=function(_0x227bd4,_0x26e0c5){var _0x2ff62a=_0x227bd4[_0x695c('0x54')]['id'];var _0x11926d=_0x227bd4[_0x695c('0x58')];var _0x44410d=0xc8;var _0x12b85f=null;return db[_0x695c('0xb8')][_0x695c('0xb9')]({'isolationLevel':db[_0x695c('0xb8')][_0x695c('0xba')]['ISOLATION_LEVELS'][_0x695c('0xbb')]},function(_0x29b140){return db[_0x695c('0x3b')][_0x695c('0x65')]({'where':{'id':_0x2ff62a},'transaction':_0x29b140})[_0x695c('0x1f')](function(_0x178100){if(_0x178100){return db[_0x695c('0x6f')][_0x695c('0x33')]({'where':{'SmsAccountId':_0x2ff62a},'transaction':_0x29b140})[_0x695c('0x1f')](function(){var _0x145735=_[_0x695c('0x3f')](_0x11926d,function(_0x13b38e){_0x13b38e[_0x695c('0x62')]=_0x2ff62a;return _0x13b38e;});return db[_0x695c('0x6f')]['bulkCreate'](_0x145735,{'transaction':_0x29b140});});}else{_0x44410d=0x194;_0x12b85f=[];}});})[_0x695c('0x1f')](function(){if(_0x44410d!==0x194){return db[_0x695c('0x6f')][_0x695c('0xbc')]({'where':{'SmsAccountId':_0x2ff62a},'order':'priority'})[_0x695c('0x1f')](function(_0x4e5165){_0x12b85f=_0x4e5165;});}})[_0x695c('0x28')](function(_0x2edeb8){_0x44410d=0x1f4;logger[_0x695c('0x24')](_0x2edeb8[_0x695c('0xbd')]);if(_0x2edeb8[_0x695c('0x37')]){delete _0x2edeb8[_0x695c('0x37')];}_0x12b85f=_0x2edeb8;})[_0x695c('0xbe')](function(){if(_0x12b85f===null){_0x26e0c5[_0x695c('0x29')](_0x44410d);}else{if(_0x44410d===0x1f4){_0x26e0c5[_0x695c('0x2a')](_0x44410d)[_0x695c('0xbf')](_0x12b85f);}else{_0x26e0c5['status'](_0x44410d)[_0x695c('0x2b')](_0x12b85f);}}});};exports[_0x695c('0xc0')]=function(_0x3ac05c,_0x45fe0e,_0x478594){var _0x22f0e5={};var _0x52e271={};var _0x3ed3c9;var _0x1d1701;return db[_0x695c('0x3b')][_0x695c('0x65')]({'where':{'id':_0x3ac05c['params']['id']}})['then'](handleEntityNotFound(_0x45fe0e,null))[_0x695c('0x1f')](function(_0x171748){if(_0x171748){_0x3ed3c9=_0x171748;_0x52e271['model']=_[_0x695c('0x41')](db[_0x695c('0x6f')]['rawAttributes']);_0x52e271[_0x695c('0x40')]=_[_0x695c('0x41')](_0x3ac05c[_0x695c('0x40')]);_0x52e271['filters']=_[_0x695c('0x43')](_0x52e271[_0x695c('0x3e')],_0x52e271[_0x695c('0x40')]);_0x22f0e5[_0x695c('0x44')]=_[_0x695c('0x43')](_0x52e271[_0x695c('0x3e')],qs[_0x695c('0x45')](_0x3ac05c[_0x695c('0x40')][_0x695c('0x45')]));_0x22f0e5[_0x695c('0x44')]=_0x22f0e5[_0x695c('0x44')][_0x695c('0x55')]?_0x22f0e5['attributes']:_0x52e271['model'];_0x22f0e5[_0x695c('0x48')]=qs['sort'](_0x3ac05c[_0x695c('0x40')][_0x695c('0x49')]);_0x22f0e5[_0x695c('0x4a')]=qs[_0x695c('0x42')](_['pick'](_0x3ac05c[_0x695c('0x40')],_0x52e271[_0x695c('0x42')]));if(_0x3ac05c[_0x695c('0x40')][_0x695c('0x4e')]){_0x22f0e5[_0x695c('0x4a')]=_[_0x695c('0x4b')](_0x22f0e5[_0x695c('0x4a')],{'$or':_['map'](_0x22f0e5[_0x695c('0x44')],function(_0x14a1f8){var _0x164b9f={};_0x164b9f[_0x14a1f8]={'$like':'%'+_0x3ac05c['query']['filter']+'%'};return _0x164b9f;})});}_0x22f0e5=_[_0x695c('0x4b')]({},_0x22f0e5,_0x3ac05c[_0x695c('0x4f')]);return _0x3ed3c9[_0x695c('0xc0')](_0x22f0e5);}})[_0x695c('0x1f')](function(_0x4c43cd){if(_0x4c43cd){_0x1d1701=_0x4c43cd[_0x695c('0x55')];if(!_0x3ac05c[_0x695c('0x40')]['hasOwnProperty'](_0x695c('0x47'))){_0x22f0e5[_0x695c('0x2e')]=qs['limit'](_0x3ac05c[_0x695c('0x40')][_0x695c('0x2e')]);_0x22f0e5[_0x695c('0x2c')]=qs[_0x695c('0x2c')](_0x3ac05c[_0x695c('0x40')][_0x695c('0x2c')]);}return _0x3ed3c9[_0x695c('0xc0')](_0x22f0e5);}})[_0x695c('0x1f')](function(_0x7407b8){if(_0x7407b8){return _0x7407b8?{'count':_0x1d1701,'rows':_0x7407b8}:null;}})[_0x695c('0x1f')](respondWithResult(_0x45fe0e,null))[_0x695c('0x28')](handleError(_0x45fe0e,null));};exports[_0x695c('0xc1')]=function(_0x821978,_0x535e05,_0x20cfe8){var _0x6c15ef={'raw':![],'where':{}};var _0x37c453={};var _0xa2ffdd={'count':0x0,'rows':[]};return db[_0x695c('0x3b')][_0x695c('0x65')]({'where':{'id':_0x821978[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x535e05,null))[_0x695c('0x1f')](function(_0x248df5){if(_0x248df5){_0x37c453['model']=_[_0x695c('0x41')](db[_0x695c('0xa0')]['rawAttributes']);_0x37c453[_0x695c('0x40')]=_[_0x695c('0x41')](_0x821978[_0x695c('0x40')]);_0x37c453[_0x695c('0x42')]=_['intersection'](_0x37c453['model'],_0x37c453[_0x695c('0x40')]);_0x6c15ef[_0x695c('0x44')]=_[_0x695c('0x43')](_0x37c453[_0x695c('0x3e')],qs[_0x695c('0x45')](_0x821978[_0x695c('0x40')]['fields']));_0x6c15ef[_0x695c('0x44')]=_0x6c15ef[_0x695c('0x44')]['length']?_0x6c15ef['attributes']:_0x37c453[_0x695c('0x3e')];if(!_0x821978[_0x695c('0x40')][_0x695c('0x46')](_0x695c('0x47'))){_0x6c15ef[_0x695c('0x2e')]=qs[_0x695c('0x2e')](_0x821978['query']['limit']);_0x6c15ef[_0x695c('0x2c')]=qs[_0x695c('0x2c')](_0x821978[_0x695c('0x40')][_0x695c('0x2c')]);}_0x6c15ef[_0x695c('0x48')]=qs['sort'](_0x821978[_0x695c('0x40')][_0x695c('0x49')]);_0x6c15ef[_0x695c('0x4a')]=qs[_0x695c('0x42')](_[_0x695c('0x6c')](_0x821978[_0x695c('0x40')],_0x37c453[_0x695c('0x42')]));_0x6c15ef[_0x695c('0x4a')][_0x695c('0x62')]=_0x248df5['id'];if(_0x821978[_0x695c('0x40')][_0x695c('0x4e')]){_0x6c15ef[_0x695c('0x4a')]=_[_0x695c('0x4b')](_0x6c15ef[_0x695c('0x4a')],{'$or':_[_0x695c('0x3f')](_0x6c15ef['attributes'],function(_0x37f394){var _0xbbaee6={};_0xbbaee6[_0x37f394]={'$like':'%'+_0x821978['query'][_0x695c('0x4e')]+'%'};return _0xbbaee6;})});}_0x6c15ef=_[_0x695c('0x4b')]({},_0x6c15ef,_0x821978['options']);return db[_0x695c('0xa0')][_0x695c('0x2f')]({'where':_0x6c15ef[_0x695c('0x4a')]})['then'](function(_0x82d6bd){_0xa2ffdd[_0x695c('0x2f')]=_0x82d6bd;if(_0x821978['query'][_0x695c('0x50')]){_0x6c15ef[_0x695c('0x51')]=[{'model':db[_0x695c('0x9a')],'as':_0x695c('0xc2'),'required':![]},{'model':db[_0x695c('0xaa')],'as':_0x695c('0xc3'),'attributes':[_0x695c('0x37'),_0x695c('0xc4'),_0x695c('0xc5')],'required':![]},{'model':db[_0x695c('0xc6')],'as':_0x695c('0xc7'),'attributes':['id',_0x695c('0x37'),_0x695c('0xc8')],'where':_0x821978[_0x695c('0x40')][_0x695c('0xc9')]?{'id':_0x821978[_0x695c('0x40')][_0x695c('0xc9')]}:undefined,'required':_0x821978['query'][_0x695c('0xc9')]?!![]:![]}];}return db[_0x695c('0xa0')][_0x695c('0x52')](_0x6c15ef);})['then'](function(_0x182ff1){_0xa2ffdd[_0x695c('0x66')]=_0x182ff1;return _0xa2ffdd;});}})[_0x695c('0x1f')](respondWithFilteredResult(_0x535e05,_0x6c15ef))[_0x695c('0x28')](handleError(_0x535e05,null));};exports[_0x695c('0xbf')]=function(_0x517d71,_0x24d162,_0x4994af){var _0x5dc4f4,_0x2eb7b2,_0xf80f99;if(_[_0x695c('0x92')](_0x517d71[_0x695c('0x58')]['body'])||_0x517d71['body']['body']===''){throw new db[(_0x695c('0x93'))][(_0x695c('0x76'))](_0x695c('0x95'));}if(_[_0x695c('0x92')](_0x517d71[_0x695c('0x58')]['to'])){throw new db[(_0x695c('0x93'))]['ValidationError'](_0x695c('0xca'));}_0x5dc4f4=_0x517d71[_0x695c('0x58')]['to'];return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x517d71[_0x695c('0x54')]['id']},'include':[{'model':db[_0x695c('0xcb')],'as':_0x695c('0xcc'),'include':[{'model':db[_0x695c('0x9a')],'as':_0x695c('0x9b'),'where':{'mobile':_0x5dc4f4},'limit':0x1,'order':[[_0x695c('0x79'),_0x695c('0x9c')]]}]}]})[_0x695c('0x1f')](handleEntityNotFound(_0x24d162,null))[_0x695c('0x1f')](function(_0x15f902){if(_0x15f902&&_0x15f902[_0x695c('0xcc')]){_0x2eb7b2=_0x15f902[_0x695c('0x34')]({'plain':!![]});if(_0x2eb7b2[_0x695c('0xcc')]&&_0x2eb7b2[_0x695c('0xcc')][_0x695c('0x9b')][_0x695c('0x55')]){return _0x2eb7b2[_0x695c('0xcc')][_0x695c('0x9b')][0x0];}return db['CmContact']['create'](_['defaults'](_0x517d71[_0x695c('0x58')],{'firstName':_0x5dc4f4,'mobile':_0x5dc4f4,'phone':_0x5dc4f4,'ListId':_0x2eb7b2[_0x695c('0x7c')]}));}})['then'](handleEntityNotFound(_0x24d162,null))['then'](function(_0xe23880){if(_0xe23880){_0xf80f99=_0xe23880;return db[_0x695c('0xa0')][_0x695c('0x56')]({'where':{'ContactId':_0xf80f99['id'],'closed':![],'SmsAccountId':_0x2eb7b2['id']}})['then'](function(_0x3a0b4e){if(_0x3a0b4e){return[_0x3a0b4e,![]];}return db[_0x695c('0xa0')][_0x695c('0x57')]({'UserId':_0x517d71[_0x695c('0x5b')]['id'],'ContactId':_0xf80f99['id'],'SmsAccountId':_0x2eb7b2['id'],'phone':_0x5dc4f4,'firstMsgDirection':_0x695c('0xcd'),'Messages':[_[_0x695c('0x4b')](_0x517d71['body'],{'read':![],'body':_0x517d71['body'][_0x695c('0x58')],'phone':_0x5dc4f4,'SmsAccountId':_0x2eb7b2['id'],'UserId':_0x517d71['user']['id'],'ContactId':_0xf80f99['id']})]},{'include':[{'model':db[_0x695c('0xa7')],'as':'Messages'}]})[_0x695c('0x1f')](function(_0x19cd62){return[_0x19cd62,!![]];});});}})[_0x695c('0xa1')](function(_0x194eff,_0x194158){if(_0x194158){return _0x194eff;}return db[_0x695c('0xa7')][_0x695c('0x57')](_[_0x695c('0x4b')](_0x517d71['body'],{'read':![],'body':_0x517d71['body']['body'],'phone':_0x5dc4f4,'SmsAccountId':_0x2eb7b2['id'],'SmsInteractionId':_0x194eff['id'],'UserId':_0x517d71[_0x695c('0x5b')]['id'],'ContactId':_0xf80f99['id']}))[_0x695c('0x1f')](function(_0x37b2c8){_0x194eff[_0x695c('0xce')][_0x695c('0xcf')]=[];_0x194eff[_0x695c('0xce')][_0x695c('0xcf')][_0x695c('0xd0')](_0x37b2c8[_0x695c('0xce')]);return _0x194eff;});})[_0x695c('0x1f')](respondWithResult(_0x24d162,null))[_0x695c('0x28')](handleError(_0x24d162,null));};exports[_0x695c('0x2a')]=function(_0x10d494,_0x5c9d84,_0x5b947e){if(_0x10d494['body']['id']){delete _0x10d494[_0x695c('0x58')]['id'];}var _0x12f0c4,_0x3caf0a,_0x8f8842;return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x10d494['params']['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x5c9d84,null))[_0x695c('0x1f')](function(_0x3eae78){if(_0x3eae78){_0x8f8842=_0x3eae78;logger[_0x695c('0xb1')](_0x695c('0x23'),_0x695c('0x2a'),_0x695c('0xd1'),_0x3eae78['type'],util['inspect'](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));switch(_0x3eae78['type']){case _0x695c('0xd2'):if(_0x10d494[_0x695c('0x58')][_0x695c('0xd3')]&&_0x10d494[_0x695c('0x58')][_0x695c('0x2a')]){_0x3caf0a=_0x10d494[_0x695c('0x58')][_0x695c('0x2a')];return db[_0x695c('0xa7')][_0x695c('0x56')]({'where':{'messageId':_0x10d494['body'][_0x695c('0xd3')]}});}break;case _0x695c('0x81'):if(_0x10d494[_0x695c('0x58')][_0x695c('0xd4')]&&_0x10d494[_0x695c('0x58')][_0x695c('0xd5')]){_0x3caf0a=_0x10d494['body'][_0x695c('0xd5')];return db[_0x695c('0xa7')]['find']({'where':{'messageId':_0x10d494['body'][_0x695c('0xd4')]}});}break;case _0x695c('0x82'):if(_0x10d494[_0x695c('0x58')][_0x695c('0x84')]&&_0x10d494['body'][_0x695c('0xd6')]){_0x3caf0a=_0x10d494['body']['status_code'];return db['SmsMessage'][_0x695c('0x56')]({'where':{'messageId':_0x10d494['body'][_0x695c('0x84')]}});}break;case _0x695c('0xd7'):var _0x24e784=_0x10d494['body'][_0x695c('0x88')][0x0];if(_0x24e784[_0x695c('0x83')]&&_0x24e784[_0x695c('0x2a')][_0x695c('0xd8')]===_0x695c('0xd9')){_0x3caf0a=_0x24e784[_0x695c('0x2a')][_0x695c('0xd8')];return db[_0x695c('0xa7')][_0x695c('0x56')]({'where':{'messageId':_0x24e784['messageId']}});}break;case _0x695c('0x8d'):if(_0x10d494[_0x695c('0x58')][_0x695c('0x83')]&&_0x10d494[_0x695c('0x58')]['status']){_0x3caf0a=_0x10d494[_0x695c('0x58')][_0x695c('0x2a')];return db[_0x695c('0xa7')][_0x695c('0x56')]({'where':{'messageId':_0x10d494[_0x695c('0x58')][_0x695c('0x83')]}});}break;case _0x695c('0xda'):if(_0x10d494[_0x695c('0x58')][0x0][_0x695c('0x26')]['id']){_0x3caf0a=_0x10d494['body'][0x0][_0x695c('0x4c')];return db[_0x695c('0xa7')][_0x695c('0x56')]({'where':{'messageId':_0x10d494[_0x695c('0x58')][0x0][_0x695c('0x26')]['id']}});}break;case _0x695c('0x90'):if(_0x10d494[_0x695c('0x58')][_0x695c('0xdb')]&&_0x10d494[_0x695c('0x58')][_0x695c('0x2a')]){_0x3caf0a=_0x10d494[_0x695c('0x58')][_0x695c('0x2a')];return db[_0x695c('0xa7')]['find']({'where':{'messageId':_0x10d494['body'][_0x695c('0xdb')]}});}break;}}})[_0x695c('0x1f')](handleEntityNotFound(_0x5c9d84,null))['then'](function(_0x33b4a7){if(_0x33b4a7){_0x12f0c4=_0x33b4a7;switch(_0x8f8842['type']){case _0x695c('0xd2'):if(_0x3caf0a===_0x695c('0xd9')){return _0x12f0c4[_0x695c('0x32')]({'read':!![]});}else{logger[_0x695c('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x695c('0x2a'),_0x695c('0xd2'),util[_0x695c('0xdc')](_0x10d494['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3caf0a==='1'){return _0x12f0c4[_0x695c('0x32')]({'read':!![]});}else{logger[_0x695c('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x695c('0x2a'),_0x695c('0xd2'),util['inspect'](_0x10d494['body'],{'showHidden':![],'depth':null}));}break;case _0x695c('0x82'):if(!_0x10d494['body'][_0x695c('0xdd')]&&_0x3caf0a>=0xc8&&_0x3caf0a<=0xce){return _0x12f0c4[_0x695c('0x32')]({'read':!![]});}else{logger[_0x695c('0x24')](_0x695c('0x23'),'status',_0x695c('0x82'),util[_0x695c('0xdc')](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));}break;case _0x695c('0xd7'):var _0x301927=_0x10d494[_0x695c('0x58')][_0x695c('0x88')][0x0];if(_0x301927[_0x695c('0x2a')][_0x695c('0xd8')]===_0x695c('0xd9')){return _0x12f0c4['update']({'read':!![]});}else{logger['error'](_0x695c('0x23'),'status',_0x695c('0xd7'),util[_0x695c('0xdc')](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3caf0a==_0x695c('0xde')||_0x3caf0a=='RECEIVED_BY_RECIPIENT'){return _0x12f0c4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x695c('0x2a'),_0x695c('0x8d'),util[_0x695c('0xdc')](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));}break;case _0x695c('0xda'):if(_0x3caf0a==_0x695c('0xdf')){return _0x12f0c4[_0x695c('0x32')]({'read':!![]});}else{logger[_0x695c('0x24')](_0x695c('0x23'),'status','bandwidth',util[_0x695c('0xdc')](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));}break;case _0x695c('0x90'):if(_0x3caf0a===_0x695c('0xe0')||_0x3caf0a===_0x695c('0xe1')){return _0x12f0c4[_0x695c('0x32')]({'read':!![]});}else{logger[_0x695c('0x24')](_0x695c('0x23'),'status',_0x695c('0x90'),util[_0x695c('0xdc')](_0x10d494[_0x695c('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x12f0c4;}})[_0x695c('0x1f')](respondWithResult(_0x5c9d84,null))[_0x695c('0x28')](handleError(_0x5c9d84,null));};exports[_0x695c('0xe2')]=function(_0x4083a4,_0x4be890,_0x1d49f8){var _0x4f6e3f,_0x3a751c,_0x1eef83;return db['SmsAccount']['find']({'where':{'id':_0x4083a4[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x4be890,null))[_0x695c('0x1f')](function(_0x14fb07){if(_0x14fb07){_0x1eef83=_0x14fb07;logger['debug'](_0x695c('0x23'),_0x695c('0x2a'),_0x695c('0xd1'),_0x14fb07[_0x695c('0x4c')],util[_0x695c('0xdc')](_0x4083a4['query'],{'showHidden':![],'depth':null}));switch(_0x14fb07[_0x695c('0x4c')]){case _0x695c('0x8a'):if(_0x4083a4[_0x695c('0x40')]['message-id']&&_0x4083a4[_0x695c('0x40')][_0x695c('0xe3')]){_0x3a751c=_0x4083a4[_0x695c('0x40')][_0x695c('0xe3')];return db['SmsMessage'][_0x695c('0x56')]({'where':{'messageId':_0x4083a4[_0x695c('0x40')]['message-id']}});}break;}}})[_0x695c('0x1f')](handleEntityNotFound(_0x4be890,null))[_0x695c('0x1f')](function(_0x5ab298){if(_0x5ab298){_0x4f6e3f=_0x5ab298;switch(_0x1eef83[_0x695c('0x4c')]){case _0x695c('0x8a'):if(_0x3a751c==='2'||_0x3a751c==='6'){return _0x4f6e3f[_0x695c('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x695c('0x2a'),_0x695c('0x8a'),util[_0x695c('0xdc')](_0x4083a4[_0x695c('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x4f6e3f;}})['then'](respondWithResult(_0x4be890,null))[_0x695c('0x28')](handleError(_0x4be890,null));};exports['addAgents']=function(_0x333751,_0xc1ff41,_0x424cfa){return db[_0x695c('0x3b')]['find']({'where':{'id':_0x333751[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0xc1ff41,null))[_0x695c('0x1f')](function(_0x4af91b){if(_0x4af91b){return _0x4af91b[_0x695c('0xe4')](_0x333751[_0x695c('0x58')][_0x695c('0x68')],_[_0x695c('0x9e')](_0x333751[_0x695c('0x58')],[_0x695c('0x68'),'id'])||{})[_0x695c('0xa1')](function(_0x51d79f){for(var _0x5a8a5f=0x0;_0x5a8a5f<_0x333751[_0x695c('0x58')]['ids'][_0x695c('0x55')];_0x5a8a5f+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x333751[_0x695c('0x58')][_0x695c('0x68')][_0x5a8a5f]),'SmsAccountId':Number(_0x333751[_0x695c('0x54')]['id'])});}return _0x51d79f;});}})[_0x695c('0x1f')](respondWithResult(_0xc1ff41,null))['catch'](handleError(_0xc1ff41,null));};exports[_0x695c('0xe5')]=function(_0x264313,_0x3b9d9b,_0x484751){return db[_0x695c('0x3b')][_0x695c('0x56')]({'where':{'id':_0x264313[_0x695c('0x54')]['id']}})[_0x695c('0x1f')](handleEntityNotFound(_0x3b9d9b,null))[_0x695c('0x1f')](function(_0x4dd2f1){if(_0x4dd2f1){return _0x4dd2f1['removeAgents'](_0x264313['query'][_0x695c('0x68')])[_0x695c('0x1f')](function(){if(_[_0x695c('0xe6')](_0x264313[_0x695c('0x40')][_0x695c('0x68')])){for(var _0x46f1e2=0x0;_0x46f1e2<_0x264313[_0x695c('0x40')]['ids']['length'];_0x46f1e2+=0x1){socket[_0x695c('0xe7')](_0x695c('0xe8'),{'UserId':Number(_0x264313[_0x695c('0x40')][_0x695c('0x68')][_0x46f1e2]),'SmsAccountId':Number(_0x264313[_0x695c('0x54')]['id'])});}}else{socket[_0x695c('0xe7')](_0x695c('0xe8'),{'UserId':Number(_0x264313['query'][_0x695c('0x68')]),'SmsAccountId':Number(_0x264313['params']['id'])});}});}})[_0x695c('0x1f')](respondWithStatusCode(_0x3b9d9b,null))[_0x695c('0x28')](handleError(_0x3b9d9b,null));};exports['getAgents']=function(_0x1be1ee,_0x584d9e,_0x42ef5b){var _0x39cf1b={};var _0x457374={};var _0x36cea7;var _0x147b40;return db[_0x695c('0x3b')]['findOne']({'where':{'id':_0x1be1ee[_0x695c('0x54')]['id']}})['then'](handleEntityNotFound(_0x584d9e,null))[_0x695c('0x1f')](function(_0x23cf22){if(_0x23cf22){_0x36cea7=_0x23cf22;_0x457374[_0x695c('0x3e')]=_[_0x695c('0x41')](db[_0x695c('0xaa')]['rawAttributes']);_0x457374[_0x695c('0x40')]=_[_0x695c('0x41')](_0x1be1ee[_0x695c('0x40')]);_0x457374[_0x695c('0x42')]=_['intersection'](_0x457374['model'],_0x457374[_0x695c('0x40')]);_0x39cf1b['attributes']=_[_0x695c('0x43')](_0x457374[_0x695c('0x3e')],qs[_0x695c('0x45')](_0x1be1ee[_0x695c('0x40')][_0x695c('0x45')]));_0x39cf1b['attributes']=_0x39cf1b[_0x695c('0x44')][_0x695c('0x55')]?_0x39cf1b[_0x695c('0x44')]:_0x457374[_0x695c('0x3e')];_0x39cf1b[_0x695c('0x48')]=qs['sort'](_0x1be1ee[_0x695c('0x40')][_0x695c('0x49')]);_0x39cf1b[_0x695c('0x4a')]=qs[_0x695c('0x42')](_[_0x695c('0x6c')](_0x1be1ee['query'],_0x457374[_0x695c('0x42')]));if(_0x1be1ee[_0x695c('0x40')][_0x695c('0x4e')]){_0x39cf1b['where']=_['merge'](_0x39cf1b[_0x695c('0x4a')],{'$or':_[_0x695c('0x3f')](_0x39cf1b[_0x695c('0x44')],function(_0x3d2945){var _0x39d199={};_0x39d199[_0x3d2945]={'$like':'%'+_0x1be1ee[_0x695c('0x40')]['filter']+'%'};return _0x39d199;})});}_0x39cf1b=_[_0x695c('0x4b')]({},_0x39cf1b,_0x1be1ee[_0x695c('0x4f')]);return _0x36cea7[_0x695c('0xe9')](_0x39cf1b);}})['then'](function(_0x26fab3){if(_0x26fab3){_0x147b40=_0x26fab3['length'];if(!_0x1be1ee['query'][_0x695c('0x46')](_0x695c('0x47'))){_0x39cf1b[_0x695c('0x2e')]=qs[_0x695c('0x2e')](_0x1be1ee[_0x695c('0x40')][_0x695c('0x2e')]);_0x39cf1b[_0x695c('0x2c')]=qs[_0x695c('0x2c')](_0x1be1ee[_0x695c('0x40')][_0x695c('0x2c')]);}return _0x36cea7[_0x695c('0xe9')](_0x39cf1b);}})[_0x695c('0x1f')](function(_0x1320b2){if(_0x1320b2){return _0x1320b2?{'count':_0x147b40,'rows':_0x1320b2}:null;}})[_0x695c('0x1f')](respondWithResult(_0x584d9e,null))[_0x695c('0x28')](handleError(_0x584d9e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f18b948..828a9bb 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 _0xd8b9=['hook','exports','events','SmsAccount','setMaxListeners','emit','hasOwnProperty'];(function(_0x583929,_0x1c46a0){var _0x59b3ea=function(_0x176a71){while(--_0x176a71){_0x583929['push'](_0x583929['shift']());}};_0x59b3ea(++_0x1c46a0);}(_0xd8b9,0xf7));var _0x9d8b=function(_0x4ee207,_0x2fa141){_0x4ee207=_0x4ee207-0x0;var _0x338168=_0xd8b9[_0x4ee207];return _0x338168;};'use strict';var EventEmitter=require(_0x9d8b('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x9d8b('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9d8b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x35467c){return function(_0x513ee0,_0x4839d7,_0x172984){SmsAccountEvents[_0x9d8b('0x3')](_0x35467c+':'+_0x513ee0['id'],_0x513ee0);SmsAccountEvents[_0x9d8b('0x3')](_0x35467c,_0x513ee0);_0x172984(null);};}for(var e in events){if(events[_0x9d8b('0x4')](e)){var event=events[e];SmsAccount[_0x9d8b('0x5')](e,emitEvent(event));}}module[_0x9d8b('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x35be=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x35be,0x8f));var _0xe35b=function(_0x43f4c8,_0x22a037){_0x43f4c8=_0x43f4c8-0x0;var _0x3a2e0c=_0x35be[_0x43f4c8];return _0x3a2e0c;};'use strict';var EventEmitter=require(_0xe35b('0x0'));var SmsAccount=require(_0xe35b('0x1'))['db'][_0xe35b('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe35b('0x3')](0x0);var events={'afterCreate':_0xe35b('0x4'),'afterUpdate':_0xe35b('0x5'),'afterDestroy':_0xe35b('0x6')};function emitEvent(_0x2d9551){return function(_0x1206dd,_0x16ebb4,_0x4efdc7){SmsAccountEvents[_0xe35b('0x7')](_0x2d9551+':'+_0x1206dd['id'],_0x1206dd);SmsAccountEvents[_0xe35b('0x7')](_0x2d9551,_0x1206dd);_0x4efdc7(null);};}for(var e in events){if(events[_0xe35b('0x8')](e)){var event=events[e];SmsAccount[_0xe35b('0x9')](e,emitEvent(event));}}module[_0xe35b('0xa')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 2601d35..80b0c0a 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 _0xc8f1=['lodash','util','api','moment','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts'];(function(_0x300a4d,_0x30dd6f){var _0x291ef5=function(_0x287fcf){while(--_0x287fcf){_0x300a4d['push'](_0x300a4d['shift']());}};_0x291ef5(++_0x30dd6f);}(_0xc8f1,0xb0));var _0x1c8f=function(_0x3298cf,_0x20986b){_0x3298cf=_0x3298cf-0x0;var _0x414814=_0xc8f1[_0x3298cf];return _0x414814;};'use strict';var _=require(_0x1c8f('0x0'));var util=require(_0x1c8f('0x1'));var logger=require('../../config/logger')(_0x1c8f('0x2'));var moment=require(_0x1c8f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c8f('0x4'));var rimraf=require(_0x1c8f('0x5'));var config=require(_0x1c8f('0x6'));var attributes=require(_0x1c8f('0x7'));module[_0x1c8f('0x8')]=function(_0x36142d,_0x197dab){return _0x36142d['define'](_0x1c8f('0x9'),attributes,{'tableName':_0x1c8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x289c=['define','SmsAccount','sms_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x289c,0x1bd));var _0xc289=function(_0x2faa7c,_0xd8a61a){_0x2faa7c=_0x2faa7c-0x0;var _0x190a35=_0x289c[_0x2faa7c];return _0x190a35;};'use strict';var _=require(_0xc289('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc289('0x1'));var moment=require(_0xc289('0x2'));var BPromise=require(_0xc289('0x3'));var rp=require(_0xc289('0x4'));var fs=require('fs');var path=require(_0xc289('0x5'));var rimraf=require(_0xc289('0x6'));var config=require(_0xc289('0x7'));var attributes=require(_0xc289('0x8'));module[_0xc289('0x9')]=function(_0x2fed7f,_0x637efe){return _0x2fed7f[_0xc289('0xa')](_0xc289('0xb'),attributes,{'tableName':_0xc289('0xc'),'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 bfaf04b..e3599a8 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 _0xd09d=['debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsAccount','options','where','attributes','include','map','model','ShowSmsAccount','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x2f3af7,_0x2c4f3e){var _0x1d399c=function(_0x2871ba){while(--_0x2871ba){_0x2f3af7['push'](_0x2f3af7['shift']());}};_0x1d399c(++_0x2c4f3e);}(_0xd09d,0x105));var _0xdd09=function(_0x388548,_0x12b4f0){_0x388548=_0x388548-0x0;var _0xcab9e7=_0xd09d[_0x388548];return _0xcab9e7;};'use strict';var _=require('lodash');var util=require(_0xdd09('0x0'));var moment=require(_0xdd09('0x1'));var BPromise=require(_0xdd09('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd09('0x3'))['db'];var utils=require(_0xdd09('0x4'));var logger=require(_0xdd09('0x5'))(_0xdd09('0x6'));var config=require(_0xdd09('0x7'));var jayson=require(_0xdd09('0x8'));var client=jayson['client'][_0xdd09('0x9')]({'port':0x232a});config[_0xdd09('0xa')]=_[_0xdd09('0xb')](config[_0xdd09('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd09('0xc'))(new Redis(config['redis']));require(_0xdd09('0xd'))[_0xdd09('0xe')](socket);function respondWithRpcPromise(_0xd00803,_0x21de83,_0x44e198){return new BPromise(function(_0x2d666a,_0x5ecc40){return client[_0xdd09('0xf')](_0xd00803,_0x44e198)[_0xdd09('0x10')](function(_0x3ed8e8){logger[_0xdd09('0x11')](_0xdd09('0x12'),_0x21de83,'request\x20sent');logger[_0xdd09('0x13')](_0xdd09('0x14'),_0x21de83,_0xdd09('0x15'),JSON[_0xdd09('0x16')](_0x3ed8e8));if(_0x3ed8e8[_0xdd09('0x17')]){if(_0x3ed8e8[_0xdd09('0x17')][_0xdd09('0x18')]===0x1f4){logger['error'](_0xdd09('0x12'),_0x21de83,_0x3ed8e8[_0xdd09('0x17')][_0xdd09('0x19')]);return _0x5ecc40(_0x3ed8e8['error'][_0xdd09('0x19')]);}logger['error'](_0xdd09('0x12'),_0x21de83,_0x3ed8e8[_0xdd09('0x17')][_0xdd09('0x19')]);return _0x2d666a(_0x3ed8e8['error'][_0xdd09('0x19')]);}else{logger[_0xdd09('0x11')](_0xdd09('0x12'),_0x21de83,_0xdd09('0x15'));_0x2d666a(_0x3ed8e8['result']['message']);}})[_0xdd09('0x1a')](function(_0x4d64fb){logger[_0xdd09('0x17')](_0xdd09('0x12'),_0x21de83,_0x4d64fb);_0x5ecc40(_0x4d64fb);});});}exports['ShowSmsAccount']=function(_0x4c3386){var _0x174bdb=this;return new Promise(function(_0x3f3f35,_0x4bce0e){return db[_0xdd09('0x1b')]['find']({'raw':_0x4c3386['options']?_0x4c3386['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c3386['options']?_0x4c3386[_0xdd09('0x1c')][_0xdd09('0x1d')]||null:null,'attributes':_0x4c3386['options']?_0x4c3386[_0xdd09('0x1c')][_0xdd09('0x1e')]||null:null,'include':_0x4c3386[_0xdd09('0x1c')]?_0x4c3386[_0xdd09('0x1c')][_0xdd09('0x1f')]?_[_0xdd09('0x20')](_0x4c3386[_0xdd09('0x1c')]['include'],function(_0x4b81df){return{'model':db[_0x4b81df['model']],'as':_0x4b81df['as'],'attributes':_0x4b81df[_0xdd09('0x1e')],'include':_0x4b81df['include']?_['map'](_0x4b81df[_0xdd09('0x1f')],function(_0x39ecae){return{'model':db[_0x39ecae[_0xdd09('0x21')]],'as':_0x39ecae['as'],'attributes':_0x39ecae[_0xdd09('0x1e')],'include':_0x39ecae['include']?_[_0xdd09('0x20')](_0x39ecae[_0xdd09('0x1f')],function(_0x500f73){return{'model':db[_0x500f73[_0xdd09('0x21')]],'as':_0x500f73['as'],'attributes':_0x500f73['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd09('0x10')](function(_0x5c9b2e){logger[_0xdd09('0x11')]('ShowSmsAccount',_0x4c3386);logger[_0xdd09('0x13')](_0xdd09('0x22'),_0x4c3386,JSON[_0xdd09('0x16')](_0x5c9b2e));_0x3f3f35(_0x5c9b2e);})[_0xdd09('0x1a')](function(_0x1a600d){logger[_0xdd09('0x17')]('ShowSmsAccount',_0x1a600d[_0xdd09('0x19')],_0x4c3386);_0x4bce0e(_0x174bdb[_0xdd09('0x17')](0x1f4,_0x1a600d['message']));});});}; \ No newline at end of file +var _0x3a45=['localhost','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0x485539,_0x5491b7){var _0x2d3d75=function(_0x46ae89){while(--_0x46ae89){_0x485539['push'](_0x485539['shift']());}};_0x2d3d75(++_0x5491b7);}(_0x3a45,0xb6));var _0x53a4=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x3a45[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x53a4('0x0'));var util=require('util');var moment=require(_0x53a4('0x1'));var BPromise=require(_0x53a4('0x2'));var rs=require(_0x53a4('0x3'));var fs=require('fs');var Redis=require(_0x53a4('0x4'));var db=require(_0x53a4('0x5'))['db'];var utils=require(_0x53a4('0x6'));var logger=require(_0x53a4('0x7'))(_0x53a4('0x8'));var config=require('../../config/environment');var jayson=require(_0x53a4('0x9'));var client=jayson[_0x53a4('0xa')][_0x53a4('0xb')]({'port':0x232a});config['redis']=_[_0x53a4('0xc')](config['redis'],{'host':_0x53a4('0xd'),'port':0x18eb});var socket=require(_0x53a4('0xe'))(new Redis(config[_0x53a4('0xf')]));require(_0x53a4('0x10'))[_0x53a4('0x11')](socket);function respondWithRpcPromise(_0x43a48c,_0x4c3e5c,_0x38f5c4){return new BPromise(function(_0x50e000,_0x3fbc7f){return client[_0x53a4('0x12')](_0x43a48c,_0x38f5c4)[_0x53a4('0x13')](function(_0x29ef81){logger[_0x53a4('0x14')](_0x53a4('0x15'),_0x4c3e5c,_0x53a4('0x16'));logger[_0x53a4('0x17')](_0x53a4('0x18'),_0x4c3e5c,_0x53a4('0x16'),JSON[_0x53a4('0x19')](_0x29ef81));if(_0x29ef81[_0x53a4('0x1a')]){if(_0x29ef81['error'][_0x53a4('0x1b')]===0x1f4){logger[_0x53a4('0x1a')](_0x53a4('0x15'),_0x4c3e5c,_0x29ef81['error'][_0x53a4('0x1c')]);return _0x3fbc7f(_0x29ef81[_0x53a4('0x1a')][_0x53a4('0x1c')]);}logger[_0x53a4('0x1a')](_0x53a4('0x15'),_0x4c3e5c,_0x29ef81['error']['message']);return _0x50e000(_0x29ef81[_0x53a4('0x1a')]['message']);}else{logger['info'](_0x53a4('0x15'),_0x4c3e5c,'request\x20sent');_0x50e000(_0x29ef81[_0x53a4('0x1d')]['message']);}})['catch'](function(_0x28a9ce){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4c3e5c,_0x28a9ce);_0x3fbc7f(_0x28a9ce);});});}exports[_0x53a4('0x1e')]=function(_0x123dda){var _0x569e3d=this;return new Promise(function(_0x5179e0,_0x4080bf){return db[_0x53a4('0x1f')][_0x53a4('0x20')]({'raw':_0x123dda[_0x53a4('0x21')]?_0x123dda[_0x53a4('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x123dda[_0x53a4('0x21')]?_0x123dda[_0x53a4('0x21')]['where']||null:null,'attributes':_0x123dda[_0x53a4('0x21')]?_0x123dda['options'][_0x53a4('0x22')]||null:null,'include':_0x123dda[_0x53a4('0x21')]?_0x123dda[_0x53a4('0x21')][_0x53a4('0x23')]?_[_0x53a4('0x24')](_0x123dda[_0x53a4('0x21')][_0x53a4('0x23')],function(_0x532680){return{'model':db[_0x532680['model']],'as':_0x532680['as'],'attributes':_0x532680[_0x53a4('0x22')],'include':_0x532680[_0x53a4('0x23')]?_[_0x53a4('0x24')](_0x532680[_0x53a4('0x23')],function(_0x29dd9c){return{'model':db[_0x29dd9c['model']],'as':_0x29dd9c['as'],'attributes':_0x29dd9c[_0x53a4('0x22')],'include':_0x29dd9c['include']?_['map'](_0x29dd9c[_0x53a4('0x23')],function(_0x352697){return{'model':db[_0x352697[_0x53a4('0x25')]],'as':_0x352697['as'],'attributes':_0x352697[_0x53a4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53a4('0x13')](function(_0x52e94f){logger[_0x53a4('0x14')](_0x53a4('0x1e'),_0x123dda);logger[_0x53a4('0x17')](_0x53a4('0x1e'),_0x123dda,JSON[_0x53a4('0x19')](_0x52e94f));_0x5179e0(_0x52e94f);})[_0x53a4('0x26')](function(_0x1c2f8f){logger[_0x53a4('0x1a')](_0x53a4('0x1e'),_0x1c2f8f[_0x53a4('0x1c')],_0x123dda);_0x4080bf(_0x569e3d['error'](0x1f4,_0x1c2f8f[_0x53a4('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d91f2b7..328f438 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 210ff25..3026b9f 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x137bcf,_0x5d9120){var _0x3ffe78=function(_0x420140){while(--_0x420140){_0x137bcf['push'](_0x137bcf['shift']());}};_0x3ffe78(++_0x5d9120);}(_0x3e74,0x175));var _0x43e7=function(_0x5614b5,_0x5955fa){_0x5614b5=_0x5614b5-0x0;var _0x57acff=_0x3e74[_0x5614b5];return _0x57acff;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 411cd1a..edc4c85 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 _0xdc3e=['STRING','noop','exports','INTEGER'];(function(_0x1f3345,_0x42fbdb){var _0x26f672=function(_0x33ad20){while(--_0x33ad20){_0x1f3345['push'](_0x1f3345['shift']());}};_0x26f672(++_0x42fbdb);}(_0xdc3e,0xf2));var _0xedc3=function(_0x7dc993,_0x5c007a){_0x7dc993=_0x7dc993-0x0;var _0x2da520=_0xdc3e[_0x7dc993];return _0x2da520;};'use strict';var Sequelize=require('sequelize');module[_0xedc3('0x0')]={'priority':{'type':Sequelize[_0xedc3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xedc3('0x2')],'allowNull':![],'defaultValue':_0xedc3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xedc3('0x2')]},'interval':{'type':Sequelize[_0xedc3('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1b2c=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x345368,_0x289b74){var _0x13b5c0=function(_0x726641){while(--_0x726641){_0x345368['push'](_0x345368['shift']());}};_0x13b5c0(++_0x289b74);}(_0x1b2c,0xf4));var _0xc1b2=function(_0x14ef2b,_0x290e93){_0x14ef2b=_0x14ef2b-0x0;var _0xb64e79=_0x1b2c[_0x14ef2b];return _0xb64e79;};'use strict';var Sequelize=require('sequelize');module[_0xc1b2('0x0')]={'priority':{'type':Sequelize[_0xc1b2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc1b2('0x2')],'allowNull':![],'defaultValue':_0xc1b2('0x3')},'appdata':{'type':Sequelize[_0xc1b2('0x4')]()},'description':{'type':Sequelize[_0xc1b2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c322ada..7c85d36 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 _0x42e3=['reject','save','update','then','destroy','end','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','merge','type','filter','includeAll','findAll','rows','catch','show','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x2aa1e9,_0x1294b4){var _0x16faa5=function(_0x474302){while(--_0x474302){_0x2aa1e9['push'](_0x2aa1e9['shift']());}};_0x16faa5(++_0x1294b4);}(_0x42e3,0x189));var _0x342e=function(_0x34ca2d,_0x36e0ca){_0x34ca2d=_0x34ca2d-0x0;var _0x4e7669=_0x42e3[_0x34ca2d];return _0x4e7669;};'use strict';var emlformat=require(_0x342e('0x0'));var rimraf=require(_0x342e('0x1'));var zipdir=require(_0x342e('0x2'));var jsonpatch=require(_0x342e('0x3'));var rp=require(_0x342e('0x4'));var moment=require('moment');var BPromise=require(_0x342e('0x5'));var Mustache=require(_0x342e('0x6'));var util=require(_0x342e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x342e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x342e('0x9'));var _=require(_0x342e('0xa'));var squel=require(_0x342e('0xb'));var crypto=require(_0x342e('0xc'));var jsforce=require(_0x342e('0xd'));var deskjs=require(_0x342e('0xe'));var toCsv=require(_0x342e('0x8'));var querystring=require(_0x342e('0xf'));var Papa=require(_0x342e('0x10'));var Redis=require(_0x342e('0x11'));var authService=require(_0x342e('0x12'));var qs=require(_0x342e('0x13'));var as=require(_0x342e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x342e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x342e('0x16'));var licenseUtil=require(_0x342e('0x17'));var db=require(_0x342e('0x18'))['db'];function respondWithStatusCode(_0x326321,_0x40be97){_0x40be97=_0x40be97||0xcc;return function(_0x2d99b6){if(_0x2d99b6){return _0x326321[_0x342e('0x19')](_0x40be97);}return _0x326321['status'](_0x40be97)['end']();};}function respondWithResult(_0x3d2749,_0x45335f){_0x45335f=_0x45335f||0xc8;return function(_0x4010b8){if(_0x4010b8){return _0x3d2749[_0x342e('0x1a')](_0x45335f)[_0x342e('0x1b')](_0x4010b8);}};}function respondWithFilteredResult(_0x7f1c29,_0xcd9977){return function(_0x595328){if(_0x595328){var _0x51534f=typeof _0xcd9977[_0x342e('0x1c')]===_0x342e('0x1d')&&typeof _0xcd9977[_0x342e('0x1e')]==='undefined';var _0x3a0213=_0x595328[_0x342e('0x1f')];var _0x388042=_0x51534f?0x0:_0xcd9977[_0x342e('0x1c')];var _0x10b26d=_0x51534f?_0x595328[_0x342e('0x1f')]:_0xcd9977[_0x342e('0x1c')]+_0xcd9977['limit'];var _0x188cfa;if(_0x10b26d>=_0x3a0213){_0x10b26d=_0x3a0213;_0x188cfa=0xc8;}else{_0x188cfa=0xce;}_0x7f1c29[_0x342e('0x1a')](_0x188cfa);return _0x7f1c29['set'](_0x342e('0x20'),_0x388042+'-'+_0x10b26d+'/'+_0x3a0213)[_0x342e('0x1b')](_0x595328);}return null;};}function patchUpdates(_0x580b82){return function(_0x2a2936){try{jsonpatch['apply'](_0x2a2936,_0x580b82,!![]);}catch(_0x1542b0){return BPromise[_0x342e('0x21')](_0x1542b0);}return _0x2a2936[_0x342e('0x22')]();};}function saveUpdates(_0x50485f,_0x18f4ce){return function(_0x1b691c){if(_0x1b691c){return _0x1b691c[_0x342e('0x23')](_0x50485f)[_0x342e('0x24')](function(_0x29a895){return _0x29a895;});}return null;};}function removeEntity(_0x1c828f,_0x3d549c){return function(_0x437eb0){if(_0x437eb0){return _0x437eb0[_0x342e('0x25')]()['then'](function(){_0x1c828f[_0x342e('0x1a')](0xcc)[_0x342e('0x26')]();});}};}function handleEntityNotFound(_0x2266c7,_0x4d90be){return function(_0x189961){if(!_0x189961){_0x2266c7[_0x342e('0x19')](0x194);}return _0x189961;};}function handleError(_0x2195f5,_0x57800e){_0x57800e=_0x57800e||0x1f4;return function(_0x53af03){logger['error'](_0x53af03['stack']);if(_0x53af03[_0x342e('0x27')]){delete _0x53af03[_0x342e('0x27')];}_0x2195f5[_0x342e('0x1a')](_0x57800e)[_0x342e('0x28')](_0x53af03);};}exports[_0x342e('0x29')]=function(_0x29b9f3,_0x4e3660){var _0x216d04={},_0x9f53b9={},_0x1b4b50={'count':0x0,'rows':[]};var _0x1d7829=_[_0x342e('0x2a')](db[_0x342e('0x2b')][_0x342e('0x2c')],function(_0x2dfbae){return{'name':_0x2dfbae[_0x342e('0x2d')],'type':_0x2dfbae['type'][_0x342e('0x2e')]};});_0x9f53b9['model']=_[_0x342e('0x2a')](_0x1d7829,_0x342e('0x27'));_0x9f53b9[_0x342e('0x2f')]=_[_0x342e('0x30')](_0x29b9f3[_0x342e('0x2f')]);_0x9f53b9[_0x342e('0x31')]=_[_0x342e('0x32')](_0x9f53b9[_0x342e('0x33')],_0x9f53b9[_0x342e('0x2f')]);_0x216d04[_0x342e('0x34')]=_[_0x342e('0x32')](_0x9f53b9['model'],qs[_0x342e('0x35')](_0x29b9f3[_0x342e('0x2f')]['fields']));_0x216d04[_0x342e('0x34')]=_0x216d04[_0x342e('0x34')][_0x342e('0x36')]?_0x216d04[_0x342e('0x34')]:_0x9f53b9[_0x342e('0x33')];if(!_0x29b9f3[_0x342e('0x2f')]['hasOwnProperty'](_0x342e('0x37'))){_0x216d04[_0x342e('0x1e')]=qs[_0x342e('0x1e')](_0x29b9f3[_0x342e('0x2f')]['limit']);_0x216d04['offset']=qs[_0x342e('0x1c')](_0x29b9f3[_0x342e('0x2f')][_0x342e('0x1c')]);}_0x216d04['order']=qs[_0x342e('0x38')](_0x29b9f3[_0x342e('0x2f')]['sort']);_0x216d04['where']=qs[_0x342e('0x31')](_['pick'](_0x29b9f3[_0x342e('0x2f')],_0x9f53b9[_0x342e('0x31')]),_0x1d7829);if(_0x29b9f3['query']['filter']){_0x216d04[_0x342e('0x39')]=_[_0x342e('0x3a')](_0x216d04[_0x342e('0x39')],{'$or':_[_0x342e('0x2a')](_0x1d7829,function(_0x39a16f){if(_0x39a16f[_0x342e('0x3b')]!=='VIRTUAL'){var _0x2107d1={};_0x2107d1[_0x39a16f['name']]={'$like':'%'+_0x29b9f3[_0x342e('0x2f')][_0x342e('0x3c')]+'%'};return _0x2107d1;}})});}_0x216d04=_[_0x342e('0x3a')]({},_0x216d04,_0x29b9f3['options']);var _0x36879d={'where':_0x216d04[_0x342e('0x39')]};return db['SmsApplication'][_0x342e('0x1f')](_0x36879d)[_0x342e('0x24')](function(_0x39af05){_0x1b4b50[_0x342e('0x1f')]=_0x39af05;if(_0x29b9f3[_0x342e('0x2f')][_0x342e('0x3d')]){_0x216d04['include']=[{'all':!![]}];}return db[_0x342e('0x2b')][_0x342e('0x3e')](_0x216d04);})[_0x342e('0x24')](function(_0x316a61){_0x1b4b50[_0x342e('0x3f')]=_0x316a61;return _0x1b4b50;})[_0x342e('0x24')](respondWithFilteredResult(_0x4e3660,_0x216d04))[_0x342e('0x40')](handleError(_0x4e3660,null));};exports[_0x342e('0x41')]=function(_0x5193d3,_0x1676b8){var _0x27d702={'raw':!![],'where':{'id':_0x5193d3['params']['id']}},_0x2f69d8={};_0x2f69d8[_0x342e('0x33')]=_[_0x342e('0x30')](db[_0x342e('0x2b')][_0x342e('0x2c')]);_0x2f69d8[_0x342e('0x2f')]=_[_0x342e('0x30')](_0x5193d3[_0x342e('0x2f')]);_0x2f69d8['filters']=_['intersection'](_0x2f69d8[_0x342e('0x33')],_0x2f69d8['query']);_0x27d702[_0x342e('0x34')]=_['intersection'](_0x2f69d8['model'],qs[_0x342e('0x35')](_0x5193d3['query']['fields']));_0x27d702[_0x342e('0x34')]=_0x27d702[_0x342e('0x34')][_0x342e('0x36')]?_0x27d702[_0x342e('0x34')]:_0x2f69d8[_0x342e('0x33')];if(_0x5193d3[_0x342e('0x2f')][_0x342e('0x3d')]){_0x27d702['include']=[{'all':!![]}];}_0x27d702=_[_0x342e('0x3a')]({},_0x27d702,_0x5193d3[_0x342e('0x42')]);return db['SmsApplication']['find'](_0x27d702)[_0x342e('0x24')](handleEntityNotFound(_0x1676b8,null))[_0x342e('0x24')](respondWithResult(_0x1676b8,null))[_0x342e('0x40')](handleError(_0x1676b8,null));};exports[_0x342e('0x43')]=function(_0x4c0767,_0x50e53a){return db[_0x342e('0x2b')]['create'](_0x4c0767['body'],{})[_0x342e('0x24')](respondWithResult(_0x50e53a,0xc9))[_0x342e('0x40')](handleError(_0x50e53a,null));};exports[_0x342e('0x23')]=function(_0x358c15,_0xe60a09){if(_0x358c15['body']['id']){delete _0x358c15[_0x342e('0x44')]['id'];}return db[_0x342e('0x2b')][_0x342e('0x45')]({'where':{'id':_0x358c15[_0x342e('0x46')]['id']}})[_0x342e('0x24')](handleEntityNotFound(_0xe60a09,null))[_0x342e('0x24')](saveUpdates(_0x358c15[_0x342e('0x44')],null))[_0x342e('0x24')](respondWithResult(_0xe60a09,null))['catch'](handleError(_0xe60a09,null));};exports[_0x342e('0x25')]=function(_0x4bdb63,_0xfb44e4){return db[_0x342e('0x2b')][_0x342e('0x45')]({'where':{'id':_0x4bdb63[_0x342e('0x46')]['id']}})['then'](handleEntityNotFound(_0xfb44e4,null))[_0x342e('0x24')](removeEntity(_0xfb44e4,null))[_0x342e('0x40')](handleError(_0xfb44e4,null));}; \ No newline at end of file +var _0x54ee=['show','params','options','SmsApplication','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x54ee,0x1c3));var _0xe54e=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x54ee[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0xe54e('0x0'));var rimraf=require(_0xe54e('0x1'));var zipdir=require(_0xe54e('0x2'));var jsonpatch=require(_0xe54e('0x3'));var rp=require('request-promise');var moment=require(_0xe54e('0x4'));var BPromise=require(_0xe54e('0x5'));var Mustache=require(_0xe54e('0x6'));var util=require('util');var path=require(_0xe54e('0x7'));var sox=require(_0xe54e('0x8'));var csv=require(_0xe54e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe54e('0xa'));var _=require(_0xe54e('0xb'));var squel=require(_0xe54e('0xc'));var crypto=require(_0xe54e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe54e('0xe'));var Papa=require(_0xe54e('0xf'));var Redis=require(_0xe54e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe54e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe54e('0x12'))(_0xe54e('0x13'));var utils=require(_0xe54e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe54e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x111d56,_0x36732b){_0x36732b=_0x36732b||0xcc;return function(_0x216436){if(_0x216436){return _0x111d56[_0xe54e('0x16')](_0x36732b);}return _0x111d56[_0xe54e('0x17')](_0x36732b)[_0xe54e('0x18')]();};}function respondWithResult(_0x344aec,_0xbb1a82){_0xbb1a82=_0xbb1a82||0xc8;return function(_0x59265c){if(_0x59265c){return _0x344aec[_0xe54e('0x17')](_0xbb1a82)[_0xe54e('0x19')](_0x59265c);}};}function respondWithFilteredResult(_0xbd7589,_0x48a76e){return function(_0x1846a6){if(_0x1846a6){var _0x67faa8=typeof _0x48a76e['offset']===_0xe54e('0x1a')&&typeof _0x48a76e[_0xe54e('0x1b')]===_0xe54e('0x1a');var _0x15d297=_0x1846a6[_0xe54e('0x1c')];var _0x697aef=_0x67faa8?0x0:_0x48a76e[_0xe54e('0x1d')];var _0x456762=_0x67faa8?_0x1846a6[_0xe54e('0x1c')]:_0x48a76e['offset']+_0x48a76e[_0xe54e('0x1b')];var _0x13bc57;if(_0x456762>=_0x15d297){_0x456762=_0x15d297;_0x13bc57=0xc8;}else{_0x13bc57=0xce;}_0xbd7589[_0xe54e('0x17')](_0x13bc57);return _0xbd7589[_0xe54e('0x1e')](_0xe54e('0x1f'),_0x697aef+'-'+_0x456762+'/'+_0x15d297)[_0xe54e('0x19')](_0x1846a6);}return null;};}function patchUpdates(_0x3153f3){return function(_0x4ca6f0){try{jsonpatch[_0xe54e('0x20')](_0x4ca6f0,_0x3153f3,!![]);}catch(_0x1f008a){return BPromise[_0xe54e('0x21')](_0x1f008a);}return _0x4ca6f0[_0xe54e('0x22')]();};}function saveUpdates(_0x18f16b,_0x17f15c){return function(_0x1ad3ff){if(_0x1ad3ff){return _0x1ad3ff['update'](_0x18f16b)[_0xe54e('0x23')](function(_0x5ea640){return _0x5ea640;});}return null;};}function removeEntity(_0xa45815,_0x2065b4){return function(_0x72ff88){if(_0x72ff88){return _0x72ff88[_0xe54e('0x24')]()[_0xe54e('0x23')](function(){_0xa45815[_0xe54e('0x17')](0xcc)[_0xe54e('0x18')]();});}};}function handleEntityNotFound(_0x43d610,_0x5084be){return function(_0x8d4ccf){if(!_0x8d4ccf){_0x43d610[_0xe54e('0x16')](0x194);}return _0x8d4ccf;};}function handleError(_0x4dc640,_0x1dc867){_0x1dc867=_0x1dc867||0x1f4;return function(_0x3947f4){logger[_0xe54e('0x25')](_0x3947f4[_0xe54e('0x26')]);if(_0x3947f4[_0xe54e('0x27')]){delete _0x3947f4['name'];}_0x4dc640['status'](_0x1dc867)[_0xe54e('0x28')](_0x3947f4);};}exports[_0xe54e('0x29')]=function(_0x1ba18a,_0x357b9b){var _0x3f59a6={},_0x50931e={},_0x5bc257={'count':0x0,'rows':[]};var _0x7b47a=_[_0xe54e('0x2a')](db['SmsApplication'][_0xe54e('0x2b')],function(_0x51a9b2){return{'name':_0x51a9b2[_0xe54e('0x2c')],'type':_0x51a9b2[_0xe54e('0x2d')][_0xe54e('0x2e')]};});_0x50931e[_0xe54e('0x2f')]=_['map'](_0x7b47a,'name');_0x50931e[_0xe54e('0x30')]=_[_0xe54e('0x31')](_0x1ba18a[_0xe54e('0x30')]);_0x50931e['filters']=_['intersection'](_0x50931e[_0xe54e('0x2f')],_0x50931e['query']);_0x3f59a6[_0xe54e('0x32')]=_[_0xe54e('0x33')](_0x50931e[_0xe54e('0x2f')],qs[_0xe54e('0x34')](_0x1ba18a[_0xe54e('0x30')][_0xe54e('0x34')]));_0x3f59a6[_0xe54e('0x32')]=_0x3f59a6[_0xe54e('0x32')][_0xe54e('0x35')]?_0x3f59a6[_0xe54e('0x32')]:_0x50931e['model'];if(!_0x1ba18a['query'][_0xe54e('0x36')](_0xe54e('0x37'))){_0x3f59a6[_0xe54e('0x1b')]=qs['limit'](_0x1ba18a['query'][_0xe54e('0x1b')]);_0x3f59a6[_0xe54e('0x1d')]=qs[_0xe54e('0x1d')](_0x1ba18a[_0xe54e('0x30')][_0xe54e('0x1d')]);}_0x3f59a6[_0xe54e('0x38')]=qs[_0xe54e('0x39')](_0x1ba18a[_0xe54e('0x30')]['sort']);_0x3f59a6[_0xe54e('0x3a')]=qs[_0xe54e('0x3b')](_[_0xe54e('0x3c')](_0x1ba18a['query'],_0x50931e[_0xe54e('0x3b')]),_0x7b47a);if(_0x1ba18a[_0xe54e('0x30')]['filter']){_0x3f59a6[_0xe54e('0x3a')]=_['merge'](_0x3f59a6['where'],{'$or':_[_0xe54e('0x2a')](_0x7b47a,function(_0x4eda21){if(_0x4eda21[_0xe54e('0x2d')]!=='VIRTUAL'){var _0x26feeb={};_0x26feeb[_0x4eda21['name']]={'$like':'%'+_0x1ba18a['query'][_0xe54e('0x3d')]+'%'};return _0x26feeb;}})});}_0x3f59a6=_[_0xe54e('0x3e')]({},_0x3f59a6,_0x1ba18a['options']);var _0x29b767={'where':_0x3f59a6['where']};return db['SmsApplication'][_0xe54e('0x1c')](_0x29b767)['then'](function(_0x387961){_0x5bc257['count']=_0x387961;if(_0x1ba18a['query'][_0xe54e('0x3f')]){_0x3f59a6[_0xe54e('0x40')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x3f59a6);})['then'](function(_0x5b526e){_0x5bc257[_0xe54e('0x41')]=_0x5b526e;return _0x5bc257;})[_0xe54e('0x23')](respondWithFilteredResult(_0x357b9b,_0x3f59a6))[_0xe54e('0x42')](handleError(_0x357b9b,null));};exports[_0xe54e('0x43')]=function(_0x54f257,_0x47c3ea){var _0xa4d378={'raw':!![],'where':{'id':_0x54f257[_0xe54e('0x44')]['id']}},_0x194940={};_0x194940['model']=_[_0xe54e('0x31')](db['SmsApplication'][_0xe54e('0x2b')]);_0x194940[_0xe54e('0x30')]=_[_0xe54e('0x31')](_0x54f257[_0xe54e('0x30')]);_0x194940[_0xe54e('0x3b')]=_[_0xe54e('0x33')](_0x194940[_0xe54e('0x2f')],_0x194940[_0xe54e('0x30')]);_0xa4d378[_0xe54e('0x32')]=_[_0xe54e('0x33')](_0x194940['model'],qs[_0xe54e('0x34')](_0x54f257[_0xe54e('0x30')]['fields']));_0xa4d378[_0xe54e('0x32')]=_0xa4d378['attributes'][_0xe54e('0x35')]?_0xa4d378['attributes']:_0x194940[_0xe54e('0x2f')];if(_0x54f257[_0xe54e('0x30')][_0xe54e('0x3f')]){_0xa4d378[_0xe54e('0x40')]=[{'all':!![]}];}_0xa4d378=_[_0xe54e('0x3e')]({},_0xa4d378,_0x54f257[_0xe54e('0x45')]);return db[_0xe54e('0x46')][_0xe54e('0x47')](_0xa4d378)['then'](handleEntityNotFound(_0x47c3ea,null))[_0xe54e('0x23')](respondWithResult(_0x47c3ea,null))['catch'](handleError(_0x47c3ea,null));};exports[_0xe54e('0x48')]=function(_0x160733,_0xd8e6d4){return db[_0xe54e('0x46')][_0xe54e('0x48')](_0x160733[_0xe54e('0x49')],{})[_0xe54e('0x23')](respondWithResult(_0xd8e6d4,0xc9))[_0xe54e('0x42')](handleError(_0xd8e6d4,null));};exports['update']=function(_0x3a5ed9,_0x29a2ac){if(_0x3a5ed9['body']['id']){delete _0x3a5ed9[_0xe54e('0x49')]['id'];}return db['SmsApplication'][_0xe54e('0x47')]({'where':{'id':_0x3a5ed9[_0xe54e('0x44')]['id']}})[_0xe54e('0x23')](handleEntityNotFound(_0x29a2ac,null))['then'](saveUpdates(_0x3a5ed9[_0xe54e('0x49')],null))[_0xe54e('0x23')](respondWithResult(_0x29a2ac,null))[_0xe54e('0x42')](handleError(_0x29a2ac,null));};exports[_0xe54e('0x24')]=function(_0x2e0f8e,_0x4dfe93){return db[_0xe54e('0x46')][_0xe54e('0x47')]({'where':{'id':_0x2e0f8e[_0xe54e('0x44')]['id']}})[_0xe54e('0x23')](handleEntityNotFound(_0x4dfe93,null))[_0xe54e('0x23')](removeEntity(_0x4dfe93,null))[_0xe54e('0x42')](handleError(_0x4dfe93,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ae7d2a5..b839179 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 _0x9806=['bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x9806,0x193));var _0x6980=function(_0x23f044,_0x7b66b5){_0x23f044=_0x23f044-0x0;var _0x2fc4fb=_0x9806[_0x23f044];return _0x2fc4fb;};'use strict';var _=require(_0x6980('0x0'));var util=require(_0x6980('0x1'));var logger=require(_0x6980('0x2'))(_0x6980('0x3'));var moment=require(_0x6980('0x4'));var BPromise=require(_0x6980('0x5'));var rp=require(_0x6980('0x6'));var fs=require('fs');var path=require(_0x6980('0x7'));var rimraf=require(_0x6980('0x8'));var config=require(_0x6980('0x9'));var attributes=require(_0x6980('0xa'));module[_0x6980('0xb')]=function(_0x5b14fa,_0x2f5995){return _0x5b14fa[_0x6980('0xc')](_0x6980('0xd'),attributes,{'tableName':_0x6980('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6980('0xf'),'collate':_0x6980('0x10')});}; \ No newline at end of file +var _0x782b=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x45759c,_0x5139db){var _0x331be4=function(_0x39d80a){while(--_0x39d80a){_0x45759c['push'](_0x45759c['shift']());}};_0x331be4(++_0x5139db);}(_0x782b,0xa6));var _0xb782=function(_0x1c6a90,_0x65a557){_0x1c6a90=_0x1c6a90-0x0;var _0x29b97d=_0x782b[_0x1c6a90];return _0x29b97d;};'use strict';var _=require(_0xb782('0x0'));var util=require(_0xb782('0x1'));var logger=require(_0xb782('0x2'))(_0xb782('0x3'));var moment=require(_0xb782('0x4'));var BPromise=require('bluebird');var rp=require(_0xb782('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb782('0x6'));var config=require(_0xb782('0x7'));var attributes=require(_0xb782('0x8'));module[_0xb782('0x9')]=function(_0x41031f,_0x390567){return _0x41031f[_0xb782('0xa')]('SmsApplication',attributes,{'tableName':_0xb782('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb782('0xc'),'collate':_0xb782('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1c5642c..bc71427 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 _0x68fd=['error','code','message','info','SmsApplication,\x20%s,\x20%s','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2cd051,_0x458b28){var _0x36a151=function(_0x32bcfd){while(--_0x32bcfd){_0x2cd051['push'](_0x2cd051['shift']());}};_0x36a151(++_0x458b28);}(_0x68fd,0x1e9));var _0xd68f=function(_0x29c6f,_0x38d350){_0x29c6f=_0x29c6f-0x0;var _0x17394e=_0x68fd[_0x29c6f];return _0x17394e;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var moment=require(_0xd68f('0x1'));var BPromise=require(_0xd68f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd68f('0x3'));var db=require(_0xd68f('0x4'))['db'];var utils=require(_0xd68f('0x5'));var logger=require(_0xd68f('0x6'))(_0xd68f('0x7'));var config=require(_0xd68f('0x8'));var jayson=require(_0xd68f('0x9'));var client=jayson[_0xd68f('0xa')][_0xd68f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e59f5,_0xb3cb35,_0x182353){return new BPromise(function(_0x26f6ca,_0x22c199){return client[_0xd68f('0xc')](_0x4e59f5,_0x182353)[_0xd68f('0xd')](function(_0x18438e){logger['info']('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0xd68f('0xe'));logger['debug'](_0xd68f('0xf'),_0xb3cb35,_0xd68f('0xe'),JSON[_0xd68f('0x10')](_0x18438e));if(_0x18438e[_0xd68f('0x11')]){if(_0x18438e[_0xd68f('0x11')][_0xd68f('0x12')]===0x1f4){logger[_0xd68f('0x11')]('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0x18438e['error']['message']);return _0x22c199(_0x18438e['error'][_0xd68f('0x13')]);}logger[_0xd68f('0x11')]('SmsApplication,\x20%s,\x20%s',_0xb3cb35,_0x18438e[_0xd68f('0x11')][_0xd68f('0x13')]);return _0x26f6ca(_0x18438e[_0xd68f('0x11')][_0xd68f('0x13')]);}else{logger[_0xd68f('0x14')](_0xd68f('0x15'),_0xb3cb35,_0xd68f('0xe'));_0x26f6ca(_0x18438e['result'][_0xd68f('0x13')]);}})['catch'](function(_0x5db5b1){logger[_0xd68f('0x11')](_0xd68f('0x15'),_0xb3cb35,_0x5db5b1);_0x22c199(_0x5db5b1);});});} \ No newline at end of file +var _0xabad=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xabad,0x150));var _0xdaba=function(_0x46fdbb,_0x217295){_0x46fdbb=_0x46fdbb-0x0;var _0x219d7e=_0xabad[_0x46fdbb];return _0x219d7e;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var moment=require(_0xdaba('0x1'));var BPromise=require(_0xdaba('0x2'));var rs=require(_0xdaba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x4'))['db'];var utils=require(_0xdaba('0x5'));var logger=require('../../config/logger')(_0xdaba('0x6'));var config=require(_0xdaba('0x7'));var jayson=require(_0xdaba('0x8'));var client=jayson[_0xdaba('0x9')][_0xdaba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ae0f,_0x4045f5,_0x352a74){return new BPromise(function(_0x5214dc,_0x2344d1){return client[_0xdaba('0xb')](_0x23ae0f,_0x352a74)[_0xdaba('0xc')](function(_0x1e22ba){logger['info'](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x4045f5,_0xdaba('0xe'),JSON[_0xdaba('0x11')](_0x1e22ba));if(_0x1e22ba[_0xdaba('0x12')]){if(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x13')]===0x1f4){logger['error'](_0xdaba('0xd'),_0x4045f5,_0x1e22ba['error'][_0xdaba('0x14')]);return _0x2344d1(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);}logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);return _0x5214dc(_0x1e22ba['error'][_0xdaba('0x14')]);}else{logger[_0xdaba('0x15')](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));_0x5214dc(_0x1e22ba[_0xdaba('0x16')][_0xdaba('0x14')]);}})[_0xdaba('0x17')](function(_0x5c4ec1){logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x5c4ec1);_0x2344d1(_0x5c4ec1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 9a1ef74..7f53483 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 _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x2251c9,_0x2a2091){var _0x56d17b=function(_0x3fd083){while(--_0x3fd083){_0x2251c9['push'](_0x2251c9['shift']());}};_0x56d17b(++_0x2a2091);}(_0x7708,0x188));var _0x8770=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0x7708[_0x4a7e98];return _0x27d10d;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file +var _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4063d3,_0x98596b){var _0x36f01f=function(_0x2e7979){while(--_0x2e7979){_0x4063d3['push'](_0x4063d3['shift']());}};_0x36f01f(++_0x98596b);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'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('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 26d9a53..9617e74 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 _0x3edc=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x41a7cc,_0x4700fd){_0x41a7cc=_0x41a7cc-0x0;var _0x4ed37d=_0x3edc[_0x41a7cc];return _0x4ed37d;};'use strict';var Sequelize=require(_0xc3ed('0x0'));var moment=require(_0xc3ed('0x1'));module[_0xc3ed('0x2')]={'closed':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc3ed('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc3ed('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc3ed('0x5')]},'phone':{'type':Sequelize[_0xc3ed('0x5')]},'read1stAt':{'type':Sequelize[_0xc3ed('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc3ed('0x6')]('in',_0xc3ed('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc3ed('0x6')]('in',_0xc3ed('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x95d9=['moment','exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x5da284,_0x431e2c){var _0x5bdaab=function(_0x50422d){while(--_0x50422d){_0x5da284['push'](_0x5da284['shift']());}};_0x5bdaab(++_0x431e2c);}(_0x95d9,0x97));var _0x995d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x95d9[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x995d('0x0'));var moment=require(_0x995d('0x1'));module[_0x995d('0x2')]={'closed':{'type':Sequelize[_0x995d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x995d('0x4')]},'secondDisposition':{'type':Sequelize[_0x995d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x995d('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x995d('0x4')]},'read1stAt':{'type':Sequelize[_0x995d('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x995d('0x6')]('in',_0x995d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x995d('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x995d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x995d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 0d75948..8610f8e 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 _0xc8c8=['sort','where','pick','select','field','color','tools_tags','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','role','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','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','params','keys','includeAll','include','merge','options','create','body','destroy','describe','SmsMessage','addMessage','ids','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','omit','spread','findAll','smsInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','firstName','lastName','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','disposition','Messages','System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./smsInteraction.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','talking','unmanaged','total','UserId','waiting','closed','SmsInteraction','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x5bf008,_0x489920){var _0x160e7b=function(_0x36f6ab){while(--_0x36f6ab){_0x5bf008['push'](_0x5bf008['shift']());}};_0x160e7b(++_0x489920);}(_0xc8c8,0x186));var _0x8c8c=function(_0x1612fe,_0x3e99ea){_0x1612fe=_0x1612fe-0x0;var _0x137e97=_0xc8c8[_0x1612fe];return _0x137e97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c8c('0x0'));var zipdir=require(_0x8c8c('0x1'));var jsonpatch=require(_0x8c8c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c8c('0x3'));var Mustache=require(_0x8c8c('0x4'));var util=require(_0x8c8c('0x5'));var path=require(_0x8c8c('0x6'));var sox=require('sox');var csv=require(_0x8c8c('0x7'));var ejs=require(_0x8c8c('0x8'));var fs=require('fs');var fs_extra=require(_0x8c8c('0x9'));var _=require(_0x8c8c('0xa'));var squel=require(_0x8c8c('0xb'));var crypto=require(_0x8c8c('0xc'));var jsforce=require(_0x8c8c('0xd'));var deskjs=require(_0x8c8c('0xe'));var toCsv=require(_0x8c8c('0x7'));var querystring=require(_0x8c8c('0xf'));var Papa=require(_0x8c8c('0x10'));var Redis=require(_0x8c8c('0x11'));var authService=require(_0x8c8c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8c8c('0x13'));var pdf=require(_0x8c8c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c8c('0x15'))('api');var utils=require(_0x8c8c('0x16'));var config=require(_0x8c8c('0x17'));var licenseUtil=require(_0x8c8c('0x18'));var db=require(_0x8c8c('0x19'))['db'];config['redis']=_[_0x8c8c('0x1a')](config[_0x8c8c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c8c('0x1b')]));require(_0x8c8c('0x1c'))['register'](socket);function respondWithStatusCode(_0x2eea10,_0x59a92d){_0x59a92d=_0x59a92d||0xcc;return function(_0x1b23c2){if(_0x1b23c2){return _0x2eea10[_0x8c8c('0x1d')](_0x59a92d);}return _0x2eea10[_0x8c8c('0x1e')](_0x59a92d)[_0x8c8c('0x1f')]();};}function respondWithResult(_0x2efbcd,_0x5e38be){_0x5e38be=_0x5e38be||0xc8;return function(_0x2f7927){if(_0x2f7927){return _0x2efbcd[_0x8c8c('0x1e')](_0x5e38be)['json'](_0x2f7927);}};}function respondWithFilteredResult(_0x527abd,_0x2a0752){return function(_0x1fc3c8){if(_0x1fc3c8){var _0x247ce2=typeof _0x2a0752[_0x8c8c('0x20')]===_0x8c8c('0x21')&&typeof _0x2a0752['limit']===_0x8c8c('0x21');var _0x525cb1=_0x1fc3c8[_0x8c8c('0x22')];var _0x3051ea=_0x247ce2?0x0:_0x2a0752[_0x8c8c('0x20')];var _0x2d4653=_0x247ce2?_0x1fc3c8[_0x8c8c('0x22')]:_0x2a0752[_0x8c8c('0x20')]+_0x2a0752[_0x8c8c('0x23')];var _0xf83ff4;if(_0x2d4653>=_0x525cb1){_0x2d4653=_0x525cb1;_0xf83ff4=0xc8;}else{_0xf83ff4=0xce;}_0x527abd[_0x8c8c('0x1e')](_0xf83ff4);return _0x527abd[_0x8c8c('0x24')](_0x8c8c('0x25'),_0x3051ea+'-'+_0x2d4653+'/'+_0x525cb1)[_0x8c8c('0x26')](_0x1fc3c8);}return null;};}function patchUpdates(_0x135497){return function(_0x2374a4){try{jsonpatch[_0x8c8c('0x27')](_0x2374a4,_0x135497,!![]);}catch(_0x57c4b6){return BPromise['reject'](_0x57c4b6);}return _0x2374a4[_0x8c8c('0x28')]();};}function saveUpdates(_0x21f523,_0x1e6e7b){return function(_0x1a5ebd){if(_0x1a5ebd){return _0x1a5ebd[_0x8c8c('0x29')](_0x21f523)['then'](function(_0x436176){return _0x436176;});}return null;};}function removeEntity(_0x4dd305,_0x6f30f8){return function(_0x12b350){if(_0x12b350){return _0x12b350['destroy']()[_0x8c8c('0x2a')](function(){_0x4dd305[_0x8c8c('0x1e')](0xcc)[_0x8c8c('0x1f')]();});}};}function handleEntityNotFound(_0x532f3a,_0xda69d1){return function(_0x588251){if(!_0x588251){_0x532f3a[_0x8c8c('0x1d')](0x194);}return _0x588251;};}function handleError(_0x344ef3,_0x10524a){_0x10524a=_0x10524a||0x1f4;return function(_0x3eeedc){logger['error'](_0x3eeedc[_0x8c8c('0x2b')]);if(_0x3eeedc['name']){delete _0x3eeedc[_0x8c8c('0x2c')];}_0x344ef3[_0x8c8c('0x1e')](_0x10524a)[_0x8c8c('0x2d')](_0x3eeedc);};}function getInteractionUsers(_0x1ecd84,_0x528e5a){return new BPromise(function(_0x2274d6,_0x2ff03b){try{if(_0x528e5a[_0x1ecd84['id']]){_0x1ecd84[_0x8c8c('0x2e')]=_[_0x8c8c('0x2f')](_0x528e5a[_0x1ecd84['id']],function(_0x40ac4){return{'id':_0x40ac4['id'],'fullname':_0x40ac4[_0x8c8c('0x30')]};});}}catch(_0x2b10b3){_0x2ff03b(_0x2b10b3);}_0x2274d6(_0x1ecd84);});}function getInteractionTags(_0x5f2fcc,_0x316a32){return new BPromise(function(_0x4596b1,_0x149e5c){try{if(_0x5f2fcc[_0x8c8c('0x31')]){_0x5f2fcc['Tags']=[];_0x5f2fcc[_0x8c8c('0x31')][_0x8c8c('0x32')](',')[_0x8c8c('0x33')](function(_0x73d42c){_0x5f2fcc['Tags'][_0x8c8c('0x34')](_0x316a32[_0x73d42c]);});}delete _0x5f2fcc[_0x8c8c('0x31')];}catch(_0x8262d){_0x149e5c(_0x8262d);}_0x4596b1(_0x5f2fcc);});}function updateSmsInteraction(_0x5d94cc,_0x106a16,_0x180b78){return new BPromise(function(_0x5bb444,_0xdd0a81){return getInteractionUsers(_0x5d94cc,_0x180b78)[_0x8c8c('0x2a')](function(_0x4f19a4){return getInteractionTags(_0x4f19a4,_0x106a16);})['then'](function(_0x4f4d47){return getStateInteraction(_0x4f4d47);})[_0x8c8c('0x2a')](function(_0xb5f7c){_0x5bb444(_0xb5f7c);})[_0x8c8c('0x35')](function(_0x57a8e3){_0xdd0a81(_0x57a8e3);});});}function getStateInteraction(_0x5f1bab){return new BPromise(function(_0x41150a){_0x5f1bab['waiting']=0x0;_0x5f1bab[_0x8c8c('0x36')]=0x0;_0x5f1bab['answered']=0x0;_0x5f1bab[_0x8c8c('0x37')]=0x0;_0x5f1bab[_0x8c8c('0x38')]=0x0;if(!_0x5f1bab['closed']&&!_0x5f1bab[_0x8c8c('0x39')]){_0x5f1bab[_0x8c8c('0x3a')]+=0x1;}if(!_0x5f1bab[_0x8c8c('0x3b')]&&_0x5f1bab['UserId']){_0x5f1bab[_0x8c8c('0x36')]+=0x1;if(_0x5f1bab['waiting']){_0x5f1bab['waiting']-=0x1;}}if(_0x5f1bab[_0x8c8c('0x3b')]&&_0x5f1bab[_0x8c8c('0x39')]){_0x5f1bab['answered']+=0x1;if(_0x5f1bab[_0x8c8c('0x36')]){_0x5f1bab[_0x8c8c('0x36')]-=0x1;}}if(_0x5f1bab[_0x8c8c('0x3b')]&&!_0x5f1bab[_0x8c8c('0x39')]){_0x5f1bab['unmanaged']+=0x1;if(_0x5f1bab[_0x8c8c('0x3a')]){_0x5f1bab[_0x8c8c('0x3a')]-=0x1;}}_0x5f1bab[_0x8c8c('0x38')]+=0x1;_0x41150a(_0x5f1bab);});}exports['index']=function(_0x3843fe,_0xafe82f){var _0x3a6583={},_0x4b1c27={},_0x16b81e={'count':0x0,'rows':[]};var _0x4fa2ff=_[_0x8c8c('0x2f')](db[_0x8c8c('0x3c')]['rawAttributes'],function(_0x37955a){return{'name':_0x37955a[_0x8c8c('0x3d')],'type':_0x37955a[_0x8c8c('0x3e')]['key']};});_0x4b1c27[_0x8c8c('0x3f')]=_['map'](_0x4fa2ff,_0x8c8c('0x2c'));_0x4b1c27[_0x8c8c('0x40')]=_['keys'](_0x3843fe[_0x8c8c('0x40')]);_0x4b1c27[_0x8c8c('0x41')]=_[_0x8c8c('0x42')](_0x4b1c27[_0x8c8c('0x3f')],_0x4b1c27[_0x8c8c('0x40')]);_0x3a6583[_0x8c8c('0x43')]=_[_0x8c8c('0x42')](_0x4b1c27['model'],qs[_0x8c8c('0x44')](_0x3843fe['query'][_0x8c8c('0x44')]));_0x3a6583[_0x8c8c('0x43')]=_0x3a6583[_0x8c8c('0x43')][_0x8c8c('0x45')]?_0x3a6583[_0x8c8c('0x43')]:_0x4b1c27[_0x8c8c('0x3f')];if(!_0x3843fe['query'][_0x8c8c('0x46')]('nolimit')){_0x3a6583[_0x8c8c('0x23')]=qs[_0x8c8c('0x23')](_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x23')]);_0x3a6583[_0x8c8c('0x20')]=qs['offset'](_0x3843fe['query'][_0x8c8c('0x20')]);}_0x3a6583[_0x8c8c('0x47')]=qs[_0x8c8c('0x48')](_0x3843fe['query'][_0x8c8c('0x48')]);_0x3a6583[_0x8c8c('0x49')]=qs[_0x8c8c('0x41')](_[_0x8c8c('0x4a')](_0x3843fe[_0x8c8c('0x40')],_0x4b1c27[_0x8c8c('0x41')]),_0x4fa2ff);var _0x2318bc=[];var _0x11cded=squel[_0x8c8c('0x4b')]()['field']('id')[_0x8c8c('0x4c')](_0x8c8c('0x2c'))[_0x8c8c('0x4c')](_0x8c8c('0x4d'))['from'](_0x8c8c('0x4e'));var _0x18624a=squel[_0x8c8c('0x4b')]()[_0x8c8c('0x4c')]('u.id')[_0x8c8c('0x4c')](_0x8c8c('0x4f'))[_0x8c8c('0x4c')](_0x8c8c('0x50'))[_0x8c8c('0x51')](_0x8c8c('0x52'),'ui')[_0x8c8c('0x53')](_0x8c8c('0x54'),'u',_0x8c8c('0x55'));var _0x8dc7c1=squel[_0x8c8c('0x4b')]()['from'](_0x8c8c('0x56'),'i')['left_join']('cm_contacts','c',_0x8c8c('0x57'))[_0x8c8c('0x53')](_0x8c8c('0x54'),'o',_0x8c8c('0x58'))[_0x8c8c('0x53')](_0x8c8c('0x59'),'a',_0x8c8c('0x5a'))['left_join'](_0x8c8c('0x5b'),'me',_0x8c8c('0x5c'))[_0x8c8c('0x53')]('sms_interaction_has_tags','it',_0x8c8c('0x5d'))[_0x8c8c('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x560e35=squel['expr']();var _0x211e6a=[];var _0x5daade=squel[_0x8c8c('0x5e')]();var _0x5b2f84;if(_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x5f')]){_0x5b2f84=as['parseSearch'](_0x3843fe['query'][_0x8c8c('0x5f')]);var _0x4723b5=_0x5b2f84['sqlOperator'];for(var _0x20aa79=0x0;_0x20aa79<_0x5b2f84[_0x8c8c('0x60')][_0x8c8c('0x45')];_0x20aa79++){var _0x2da14e=_0x5b2f84[_0x8c8c('0x60')][_0x20aa79];var _0x332985='i';var _0x26a7dd=_[_0x8c8c('0x61')](_0x4fa2ff,[_0x8c8c('0x2c'),_0x2da14e['field']]);if(!_0x26a7dd){switch(_0x2da14e[_0x8c8c('0x4c')]){case _0x8c8c('0x62'):if(_0x2da14e[_0x8c8c('0x63')]==0x1){_0x8dc7c1[_0x8c8c('0x64')]('`'+_0x2da14e[_0x8c8c('0x4c')]+_0x8c8c('0x65'));}else{_0x8dc7c1[_0x8c8c('0x64')]('`'+_0x2da14e[_0x8c8c('0x4c')]+_0x8c8c('0x66'));}break;case _0x8c8c('0x67'):if(_0x2da14e[_0x8c8c('0x68')]===_0x8c8c('0x69')){if(_0x2da14e['value'][_0x8c8c('0x32')]('\x20')['length']>0x1){_0x560e35[_0x4723b5](_0x8c8c('0x6a'),qs[_0x8c8c('0x6b')](_0x2da14e['value']),null);}else{var _0x524d17='%'+_0x2da14e['value']+'%';_0x560e35[_0x4723b5](_0x8c8c('0x6c'),_0x524d17,_0x524d17,_0x524d17);}}else{_0x26a7dd=_['find'](_0x4fa2ff,[_0x8c8c('0x2c'),_0x8c8c('0x6d')]);_0x2da14e[_0x8c8c('0x4c')]='ContactId';_0x14027e=as['buildExpression'](_0x332985,_0x26a7dd[_0x8c8c('0x3e')],_0x2da14e);_0x560e35[_0x4723b5](_0x14027e[_0x8c8c('0x6e')],_0x14027e['value']['start'],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x1f')]);}break;case _0x8c8c('0x6f'):var _0x228403=_0x2da14e[_0x8c8c('0x63')]['split'](',')[_0x8c8c('0x2f')](function(_0x1057d0){return Number(_0x1057d0);});_0x228403[_0x8c8c('0x33')](function(_0x3b277b){_0x5daade['or'](_0x8c8c('0x70'),'%,'+_0x3b277b+',%');});_0x211e6a=_[_0x8c8c('0x71')](_0x211e6a,_0x228403);break;case'User':if(_0x2da14e[_0x8c8c('0x68')]===_0x8c8c('0x69')){_0x560e35[_0x4723b5](_0x8c8c('0x72'),'%'+_0x2da14e[_0x8c8c('0x63')]+'%',null);}else{_0x26a7dd=_['find'](_0x4fa2ff,['name',_0x8c8c('0x39')]);_0x2da14e[_0x8c8c('0x4c')]=_0x8c8c('0x39');_0x14027e=as[_0x8c8c('0x73')](_0x332985,_0x26a7dd[_0x8c8c('0x3e')],_0x2da14e);_0x560e35[_0x4723b5](_0x14027e['text'],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x74')],_0x14027e[_0x8c8c('0x63')]['end']);}break;case'body':_0x14027e=as[_0x8c8c('0x73')]('me',null,_0x2da14e);_0x560e35[_0x4723b5](_0x14027e[_0x8c8c('0x6e')],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x74')],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x1f')]);break;}}else{var _0x14027e=as[_0x8c8c('0x73')](_0x332985,_0x26a7dd[_0x8c8c('0x3e')],_0x2da14e);_0x560e35[_0x4723b5](_0x14027e[_0x8c8c('0x6e')],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x74')],_0x14027e[_0x8c8c('0x63')][_0x8c8c('0x1f')]);}}}else{var _0x3c7418=_(_0x3843fe[_0x8c8c('0x40')])['keys']()['map'](function(_0x4228f3){return _['some'](_0x4fa2ff,[_0x8c8c('0x2c'),_0x4228f3])?_0x4228f3:undefined;})[_0x8c8c('0x75')]()['value']();if(!_[_0x8c8c('0x76')](_0x3c7418)){_0x3c7418[_0x8c8c('0x33')](function(_0x58284c){if(_0x58284c===_0x8c8c('0x77')){_0x8dc7c1['where'](_0x8c8c('0x78'),[][_0x8c8c('0x79')](_0x3843fe['query'][_0x58284c]));}else if(_0x58284c===_0x8c8c('0x7a')){var _0x22b5a5=JSON[_0x8c8c('0x7b')](_0x3843fe['query'][_0x58284c])[_0x8c8c('0x7c')];var _0x1e9d27=JSON[_0x8c8c('0x7b')](_0x3843fe[_0x8c8c('0x40')][_0x58284c])[_0x8c8c('0x7d')];_0x8dc7c1[_0x8c8c('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x22b5a5,_0x1e9d27);}else{if(_0x3843fe[_0x8c8c('0x40')][_0x58284c]===_0x8c8c('0x7e')){_0x8dc7c1[_0x8c8c('0x49')]('i.'+_0x58284c+_0x8c8c('0x7f'));}else{_0x8dc7c1[_0x8c8c('0x49')]('i.'+_0x58284c+_0x8c8c('0x80'),_0x3843fe[_0x8c8c('0x40')][_0x58284c]);}}});}if(_0x3843fe[_0x8c8c('0x40')]['read']){if(_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x81')]==0x1){_0x8dc7c1[_0x8c8c('0x64')](_0x8c8c('0x82'));}else{_0x8dc7c1[_0x8c8c('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x83')]){_0x211e6a=_[_0x8c8c('0x84')](_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x83')])?_0x3843fe['query'][_0x8c8c('0x83')]:new Array(_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x83')]);_0x211e6a[_0x8c8c('0x33')](function(_0x35fb9e){_0x5daade['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35fb9e+',%');});}if(_0x3843fe[_0x8c8c('0x40')]['filter']){var _0x3edf99=_0x3843fe[_0x8c8c('0x40')][_0x8c8c('0x85')][_0x8c8c('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8c8c('0x87')](_0x3edf99)){_0x560e35['or']('i.id\x20LIKE\x20?',_0x3edf99+'%')['or'](_0x8c8c('0x88'),_0x3edf99+'%');}else{_0x560e35['or'](_0x8c8c('0x89'),qs[_0x8c8c('0x6b')](_0x3edf99))['or'](_0x8c8c('0x8a'),_0x3edf99+'%');}}}_0x8dc7c1[_0x8c8c('0x49')](_0x560e35);_0x8dc7c1[_0x8c8c('0x8b')](_0x8c8c('0x8c'));var _0x19f47a={'type':db['Sequelize'][_0x8c8c('0x8d')][_0x8c8c('0x8e')],'raw':!![]};var _0x3864c4=_0x8dc7c1[_0x8c8c('0x8f')]();_0x3864c4[_0x8c8c('0x4c')]('i.id');_0x3864c4[_0x8c8c('0x4c')](_0x8c8c('0x90'),_0x8c8c('0x62'));if(_0x3a6583[_0x8c8c('0x47')]){_0x3a6583[_0x8c8c('0x47')][_0x8c8c('0x33')](function(_0x4fe04e){var _0x86c2f2=_0x4fe04e[0x0]===_0x8c8c('0x91')?_0x4fe04e[0x0]:'i.'+_0x4fe04e[0x0];_0x8dc7c1[_0x8c8c('0x47')](_0x86c2f2,_0x4fe04e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8c8c('0x76')](_0x211e6a)){_0x8dc7c1[_0x8c8c('0x64')](_0x5daade);_0x3864c4[_0x8c8c('0x49')]('t.id\x20IN\x20?',_0x211e6a);}BPromise['resolve']()['then'](function(){if(!_0x5b2f84){if(_0x3843fe['query'][_0x8c8c('0x77')])return;_0x3864c4[_0x8c8c('0x49')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x8dc7c1[_0x8c8c('0x49')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3843fe['user'][_0x8c8c('0x92')]!==_0x8c8c('0x93'))return;return _0x3843fe[_0x8c8c('0x94')][_0x8c8c('0x95')]({'attributes':['id'],'raw':!![]})[_0x8c8c('0x2a')](function(_0x27a7ba){if(_['isEmpty'](_0x27a7ba)){_0x3864c4['where']('i.SmsAccountId\x20IS\x20NULL');_0x8dc7c1['where'](_0x8c8c('0x96'));}else{_0x3864c4[_0x8c8c('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x8c8c('0x2f')](_0x27a7ba,'id'));_0x8dc7c1[_0x8c8c('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x8c8c('0x2f')](_0x27a7ba,'id'));}});})[_0x8c8c('0x2a')](function(){if(_0x3843fe[_0x8c8c('0x94')][_0x8c8c('0x92')]===_0x8c8c('0x93')&&!_0x5b2f84&&!_0x3843fe[_0x8c8c('0x40')]['SmsAccountId'])return[];return db[_0x8c8c('0x97')][_0x8c8c('0x40')](_0x3864c4[_0x8c8c('0x98')](),_0x19f47a);})['then'](function(_0x26732d){_0x16b81e['count']=_0x26732d[_0x8c8c('0x45')];if(_0x16b81e[_0x8c8c('0x22')]===0x0)return[];return db[_0x8c8c('0x97')]['query'](_0x11cded[_0x8c8c('0x98')](),_0x19f47a)[_0x8c8c('0x2a')](function(_0x41c416){_0x2318bc=_[_0x8c8c('0x99')](_0x41c416,'id');_0x19f47a=_['merge'](_0x19f47a,{'model':db[_0x8c8c('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3843fe[_0x8c8c('0x40')]['fields']){_0x3a6583[_0x8c8c('0x43')][_0x8c8c('0x33')](function(_0x4a4cf1){_0x8dc7c1['field']('i.'+_0x4a4cf1);});}else{_0x8dc7c1[_0x8c8c('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8c8c('0x62'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0x9a'),_0x8c8c('0x9b'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0x9c'),_0x8c8c('0x9d'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0x9e'),_0x8c8c('0x91'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0x9f'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xa0'),_0x8c8c('0xa1'));_0x8dc7c1[_0x8c8c('0x4c')]('c.lastName',_0x8c8c('0xa2'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xa3'),'Contact.email');_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xa4'),_0x8c8c('0xa5'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xa6'),_0x8c8c('0xa7'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xa8'),_0x8c8c('0xa9'));_0x8dc7c1[_0x8c8c('0x4c')]('o.fullname',_0x8c8c('0xaa'));_0x8dc7c1[_0x8c8c('0x4c')]('o.internal',_0x8c8c('0xab'));_0x8dc7c1[_0x8c8c('0x4c')](_0x8c8c('0xac'),'TagIds');}if(_0x3a6583[_0x8c8c('0x23')])_0x8dc7c1[_0x8c8c('0x23')](_0x3a6583[_0x8c8c('0x23')]);if(_0x3a6583[_0x8c8c('0x20')])_0x8dc7c1[_0x8c8c('0x20')](_0x3a6583[_0x8c8c('0x20')]);return db['sequelize'][_0x8c8c('0x40')](_0x8dc7c1[_0x8c8c('0x98')](),_0x19f47a);})['then'](function(_0x30853d){if(_0x30853d['length']>0x0)_0x18624a[_0x8c8c('0x49')](_0x8c8c('0xad'),_[_0x8c8c('0x2f')](_0x30853d,'id'));return db[_0x8c8c('0x97')]['query'](_0x18624a[_0x8c8c('0x98')](),_0x19f47a)[_0x8c8c('0x2a')](function(_0x5126d9){var _0x5148af=_['groupBy'](_0x5126d9,_0x8c8c('0xae'));var _0x5a4147=[];_0x30853d[_0x8c8c('0x33')](function(_0x392962){_0x5a4147[_0x8c8c('0x34')](updateSmsInteraction(_0x392962,_0x2318bc,_0x5148af));});return BPromise[_0x8c8c('0xaf')](_0x5a4147);});});})[_0x8c8c('0x2a')](function(_0x3bcce6){_0x16b81e[_0x8c8c('0xb0')]=_0x3bcce6;return _0x16b81e;})[_0x8c8c('0x2a')](respondWithFilteredResult(_0xafe82f,_0x3a6583))['catch'](handleError(_0xafe82f,null));};exports['show']=function(_0x1a834d,_0x9b3836){var _0x27c5c8={'raw':![],'where':{'id':_0x1a834d[_0x8c8c('0xb1')]['id']}},_0x13594e={};_0x13594e[_0x8c8c('0x3f')]=_[_0x8c8c('0xb2')](db[_0x8c8c('0x3c')]['rawAttributes']);_0x13594e[_0x8c8c('0x40')]=_[_0x8c8c('0xb2')](_0x1a834d[_0x8c8c('0x40')]);_0x13594e[_0x8c8c('0x41')]=_[_0x8c8c('0x42')](_0x13594e[_0x8c8c('0x3f')],_0x13594e[_0x8c8c('0x40')]);_0x27c5c8[_0x8c8c('0x43')]=_[_0x8c8c('0x42')](_0x13594e[_0x8c8c('0x3f')],qs[_0x8c8c('0x44')](_0x1a834d['query']['fields']));_0x27c5c8[_0x8c8c('0x43')]=_0x27c5c8['attributes'][_0x8c8c('0x45')]?_0x27c5c8[_0x8c8c('0x43')]:_0x13594e[_0x8c8c('0x3f')];if(_0x1a834d[_0x8c8c('0x40')][_0x8c8c('0xb3')]){_0x27c5c8[_0x8c8c('0xb4')]=[{'all':!![]}];}_0x27c5c8=_[_0x8c8c('0xb5')]({},_0x27c5c8,_0x1a834d[_0x8c8c('0xb6')]);return db[_0x8c8c('0x3c')][_0x8c8c('0x61')](_0x27c5c8)[_0x8c8c('0x2a')](handleEntityNotFound(_0x9b3836,null))[_0x8c8c('0x2a')](respondWithResult(_0x9b3836,null))[_0x8c8c('0x35')](handleError(_0x9b3836,null));};exports[_0x8c8c('0xb7')]=function(_0x1f23d7,_0x1be23e){return db[_0x8c8c('0x3c')][_0x8c8c('0xb7')](_0x1f23d7[_0x8c8c('0xb8')],{})[_0x8c8c('0x2a')](respondWithResult(_0x1be23e,0xc9))[_0x8c8c('0x35')](handleError(_0x1be23e,null));};exports[_0x8c8c('0x29')]=function(_0x4c3531,_0x4235fa){if(_0x4c3531[_0x8c8c('0xb8')]['id']){delete _0x4c3531[_0x8c8c('0xb8')]['id'];}return db[_0x8c8c('0x3c')][_0x8c8c('0x61')]({'where':{'id':_0x4c3531['params']['id']}})[_0x8c8c('0x2a')](handleEntityNotFound(_0x4235fa,null))[_0x8c8c('0x2a')](saveUpdates(_0x4c3531['body'],null))['then'](respondWithResult(_0x4235fa,null))['catch'](handleError(_0x4235fa,null));};exports[_0x8c8c('0xb9')]=function(_0x5dbda5,_0x2ad74c){return db[_0x8c8c('0x3c')][_0x8c8c('0x61')]({'where':{'id':_0x5dbda5[_0x8c8c('0xb1')]['id']}})['then'](handleEntityNotFound(_0x2ad74c,null))[_0x8c8c('0x2a')](removeEntity(_0x2ad74c,null))[_0x8c8c('0x35')](handleError(_0x2ad74c,null));};exports[_0x8c8c('0xba')]=function(_0x52571a,_0xbb0ae3){return db[_0x8c8c('0x3c')][_0x8c8c('0xba')]()[_0x8c8c('0x2a')](respondWithResult(_0xbb0ae3,null))[_0x8c8c('0x35')](handleError(_0xbb0ae3,null));};exports['addMessage']=function(_0x2761cb,_0x47f8d4,_0x481768){return db[_0x8c8c('0xbb')][_0x8c8c('0x61')]({'where':{'id':_0x2761cb[_0x8c8c('0xb1')]['id']}})[_0x8c8c('0x2a')](handleEntityNotFound(_0x47f8d4,null))[_0x8c8c('0x2a')](function(_0x521210){if(_0x521210){return _0x521210[_0x8c8c('0xbc')](_0x2761cb[_0x8c8c('0xb8')][_0x8c8c('0xbd')],_['omit'](_0x2761cb[_0x8c8c('0xb8')],[_0x8c8c('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x47f8d4,null))[_0x8c8c('0x35')](handleError(_0x47f8d4,null));};exports['getMessages']=function(_0x2612e2,_0x317513,_0x45d8b2){var _0x15c2ec={'raw':![],'where':{}};var _0x3b43b8={};var _0x141599={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x2612e2[_0x8c8c('0xb1')]['id']}})['then'](handleEntityNotFound(_0x317513,null))[_0x8c8c('0x2a')](function(_0x3a58de){if(_0x3a58de){_0x3b43b8[_0x8c8c('0x3f')]=_[_0x8c8c('0xb2')](db['SmsMessage'][_0x8c8c('0xbe')]);_0x3b43b8[_0x8c8c('0x40')]=_[_0x8c8c('0xb2')](_0x2612e2[_0x8c8c('0x40')]);_0x3b43b8[_0x8c8c('0x41')]=_[_0x8c8c('0x42')](_0x3b43b8[_0x8c8c('0x3f')],_0x3b43b8[_0x8c8c('0x40')]);_0x15c2ec[_0x8c8c('0x43')]=_[_0x8c8c('0x42')](_0x3b43b8[_0x8c8c('0x3f')],qs[_0x8c8c('0x44')](_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0x44')]));_0x15c2ec[_0x8c8c('0x43')]=_0x15c2ec[_0x8c8c('0x43')][_0x8c8c('0x45')]?_0x15c2ec[_0x8c8c('0x43')]:_0x3b43b8[_0x8c8c('0x3f')];if(!_0x2612e2['query'][_0x8c8c('0x46')]('nolimit')){_0x15c2ec[_0x8c8c('0x23')]=qs[_0x8c8c('0x23')](_0x2612e2['query']['limit']);_0x15c2ec[_0x8c8c('0x20')]=qs[_0x8c8c('0x20')](_0x2612e2['query'][_0x8c8c('0x20')]);}_0x15c2ec[_0x8c8c('0x47')]=qs[_0x8c8c('0x48')](_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0x48')]);_0x15c2ec[_0x8c8c('0x49')]=qs[_0x8c8c('0x41')](_[_0x8c8c('0x4a')](_0x2612e2['query'],_0x3b43b8[_0x8c8c('0x41')]));_0x15c2ec['where']['SmsInteractionId']=_0x3a58de['id'];if(_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0x85')]){_0x15c2ec['where']=_['merge'](_0x15c2ec[_0x8c8c('0x49')],{'$or':_['map'](_0x15c2ec[_0x8c8c('0x43')],function(_0x52b0ad){var _0x51fe8d={};_0x51fe8d[_0x52b0ad]={'$like':'%'+_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0x85')]+'%'};return _0x51fe8d;})});}if(_0x2612e2[_0x8c8c('0x40')]['$gte']){var _0xf000ff=_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0x7c')][_0x8c8c('0x32')](',');var _0x413a36={};_0x413a36[_0xf000ff[0x0]]={'$gte':moment(_0xf000ff[0x1])[_0x8c8c('0xbf')](_0x8c8c('0xc0'))};_0x15c2ec[_0x8c8c('0x49')]=_[_0x8c8c('0xb5')](_0x15c2ec[_0x8c8c('0x49')],_0x413a36);}_0x15c2ec=_[_0x8c8c('0xb5')]({},_0x15c2ec,_0x2612e2[_0x8c8c('0xb6')]);return db['SmsMessage'][_0x8c8c('0x22')]({'where':_0x15c2ec['where']})[_0x8c8c('0x2a')](function(_0x367b35){_0x141599[_0x8c8c('0x22')]=_0x367b35;if(_0x2612e2[_0x8c8c('0x40')][_0x8c8c('0xb3')]){_0x15c2ec[_0x8c8c('0xb4')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x15c2ec);})[_0x8c8c('0x2a')](function(_0x29887a){_0x141599[_0x8c8c('0xb0')]=_0x29887a;return _0x141599;});}})['then'](respondWithFilteredResult(_0x317513,_0x15c2ec))[_0x8c8c('0x35')](handleError(_0x317513,null));};exports['addTags']=function(_0x5c5c70,_0x2ee0dd,_0x5cf2c3){return db['SmsInteraction'][_0x8c8c('0x61')]({'where':{'id':_0x5c5c70[_0x8c8c('0xb1')]['id']}})[_0x8c8c('0x2a')](handleEntityNotFound(_0x2ee0dd,null))[_0x8c8c('0x2a')](function(_0x89a262){if(_0x89a262){return _0x89a262['setTags'](_0x5c5c70[_0x8c8c('0xb8')]['ids'],_[_0x8c8c('0xc1')](_0x5c5c70[_0x8c8c('0xb8')],[_0x8c8c('0xbd'),'id'])||{})[_0x8c8c('0xc2')](function(){return db[_0x8c8c('0x6f')][_0x8c8c('0xc3')]({'attributes':['id','name',_0x8c8c('0x4d')],'where':{'id':_0x5c5c70[_0x8c8c('0xb8')]['ids']}});})['then'](function(_0x558278){socket['emit'](_0x8c8c('0xc4'),{'id':Number(_0x5c5c70[_0x8c8c('0xb1')]['id']),'tags':_0x558278||[]});return{'id':Number(_0x5c5c70['params']['id']),'tags':_0x558278||[]};});}})[_0x8c8c('0x2a')](respondWithResult(_0x2ee0dd,null))[_0x8c8c('0x35')](handleError(_0x2ee0dd,null));};exports['removeTags']=function(_0x6c46b3,_0x2c94e8,_0x126441){return db[_0x8c8c('0x3c')][_0x8c8c('0x61')]({'where':{'id':_0x6c46b3[_0x8c8c('0xb1')]['id']}})[_0x8c8c('0x2a')](handleEntityNotFound(_0x2c94e8,null))[_0x8c8c('0x2a')](function(_0x321e94){if(_0x321e94){return _0x321e94[_0x8c8c('0xc5')](_0x6c46b3[_0x8c8c('0x40')][_0x8c8c('0xbd')]);}})[_0x8c8c('0x2a')](respondWithStatusCode(_0x2c94e8,null))['catch'](handleError(_0x2c94e8,null));};exports[_0x8c8c('0xc6')]=function(_0x3987d7,_0x151021){var _0x37379c=moment()[_0x8c8c('0xc7')]()[_0x8c8c('0x98')]();var _0x31699b=path[_0x8c8c('0xc8')](config[_0x8c8c('0xc9')],'server',_0x8c8c('0xca'),_0x8c8c('0xcb'));var _0x2f3260=path[_0x8c8c('0xc8')](config[_0x8c8c('0xc9')],_0x8c8c('0xcc'),_0x8c8c('0xca'),_0x8c8c('0xcd'));var _0x28f531=path[_0x8c8c('0xc8')](_0x31699b,_0x37379c);var _0x4da863=util[_0x8c8c('0xbf')](_0x8c8c('0xce'),_0x3987d7[_0x8c8c('0xb1')]['id'],_0x37379c);var _0x2e68ab=path[_0x8c8c('0xc8')](_0x31699b,_0x4da863);var _0x243e42=[];_0x243e42['push']({'model':db[_0x8c8c('0xcf')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x243e42[_0x8c8c('0x34')]({'model':db['CmContact'],'as':_0x8c8c('0x67'),'attributes':['id',_0x8c8c('0xd0'),_0x8c8c('0xd1')],'raw':!![]});var _0xbc2b59=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x8c8c('0xb8'),_0x8c8c('0x7a'),_0x8c8c('0xd2'),_0x8c8c('0xd3'),_0x8c8c('0x81')],'include':_0x243e42}];_0xbc2b59[_0x8c8c('0x34')]({'model':db[_0x8c8c('0xd4')],'as':_0x8c8c('0xd5'),'attributes':['id',_0x8c8c('0x2c')]});_0xbc2b59[_0x8c8c('0x34')]({'model':db[_0x8c8c('0xcf')],'as':_0x8c8c('0xd6'),'attributes':['id',_0x8c8c('0x30')]});return db['SmsInteraction']['find']({'where':{'id':_0x3987d7[_0x8c8c('0xb1')]['id']},'include':_0xbc2b59})[_0x8c8c('0x2a')](handleEntityNotFound(_0x151021,null))[_0x8c8c('0x2a')](function(_0x48312e){if(_0x48312e){var _0x5c340d=_0x48312e[_0x8c8c('0xd7')]({'plain':!![]});fs[_0x8c8c('0xd8')](_0x28f531);var _0x4fdfda={'channel':'Sms','account':_0x5c340d['Account'][_0x8c8c('0x2c')],'agent':_0x5c340d[_0x8c8c('0xd6')]?_0x5c340d[_0x8c8c('0xd6')][_0x8c8c('0x30')]:'N.A.','createdAt':moment(_0x5c340d[_0x8c8c('0x7a')])[_0x8c8c('0xbf')](_0x8c8c('0xc0'))[_0x8c8c('0x98')](),'closedAt':_0x5c340d[_0x8c8c('0x3b')]?moment(_0x5c340d['closedAt'])['format'](_0x8c8c('0xc0'))['toString']():'','disposition':_0x5c340d[_0x8c8c('0xd9')],'messages':_(_0x5c340d[_0x8c8c('0xda')])[_0x8c8c('0x85')]({'secret':![]})[_0x8c8c('0x2f')](function(_0x22a11b){return{'date':moment(_0x22a11b['createdAt'])['format'](_0x8c8c('0xc0'))[_0x8c8c('0x98')](),'sender':_0x22a11b[_0x8c8c('0xd2')]==='out'?_0x22a11b['User']?_0x22a11b[_0x8c8c('0xcf')][_0x8c8c('0x30')]:_0x8c8c('0xdb'):_0x22a11b[_0x8c8c('0x67')]['firstName']+(_0x22a11b[_0x8c8c('0x67')]['lastName']?'\x20'+_0x22a11b[_0x8c8c('0x67')][_0x8c8c('0xd1')]:''),'body':_0x22a11b[_0x8c8c('0xb8')],'direction':_0x22a11b['direction']===_0x8c8c('0xdc')?'A':'C','secret':_0x22a11b['secret'],'read':_0x22a11b[_0x8c8c('0x81')]};})[_0x8c8c('0x63')]()};return ejs[_0x8c8c('0xdd')](path[_0x8c8c('0xc8')](config['root'],_0x8c8c('0xcc'),_0x8c8c('0xde'),_0x8c8c('0xdf')),{'interaction':_0x4fdfda})[_0x8c8c('0x2a')](function(_0x491df8){var _0x4f75ed=path[_0x8c8c('0xc8')](_0x28f531,_0x8c8c('0xe0')+_0x5c340d['id']+'-'+_0x37379c+_0x8c8c('0xe1'));var _0x5cd179={'path':_0x4f75ed,'channel':_0x8c8c('0xe2'),'interactionId':_0x5c340d['id']};return pdf[_0x8c8c('0xe3')](_0x491df8,_0x5cd179);})[_0x8c8c('0x2a')](function(){return new BPromise(function(_0x5ad633,_0x44a3){zipdir(_0x28f531,{'saveTo':_0x2e68ab},function(_0x581345,_0x1e3730){if(_0x581345)return _0x44a3(_0x581345);return _0x5ad633(_0x1e3730);});})[_0x8c8c('0x2a')](function(){return new BPromise(function(_0x377d30,_0x5f09ef){rimraf(_0x28f531,function(_0x4bcebd){if(_0x4bcebd)_0x5f09ef(_0x4bcebd);return _0x377d30();});});})[_0x8c8c('0x2a')](function(){return _0x151021['download'](_0x2e68ab,_0x4da863,function(_0x4c6155){if(_0x4c6155){console[_0x8c8c('0xe4')](_0x8c8c('0xe5'),_0x4c6155);}else{fs[_0x8c8c('0xe6')](_0x2e68ab);}});});});}else{return _0x151021['sendStatus'](0xc8);}})[_0x8c8c('0x35')](handleError(_0x151021,null));}; \ No newline at end of file +var _0xc015=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','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)','contactName','DESC','t.id\x20IN\x20?','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.fax','o.internal','Owner.internal','groupBy','SmsInteractionId','rows','show','SmsInteraction','includeAll','include','find','create','params','describe','SmsMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','download','unix','root','server','files','tmp','join','attachments','fullname','CmContact','Contact','firstName','lastName','Messages','direction','SmsAccount','Owner','get','mkdirSync','N.A.','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','reject','save','update','then','destroy','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','waiting','answered','total','closed','UserId','talking','index','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','field','from','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring'];(function(_0x2d5cde,_0x21e0f5){var _0x46b780=function(_0x5295eb){while(--_0x5295eb){_0x2d5cde['push'](_0x2d5cde['shift']());}};_0x46b780(++_0x21e0f5);}(_0xc015,0x81));var _0x5c01=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xc015[_0x1fb4e1];return _0x22d1b0;};'use strict';var emlformat=require(_0x5c01('0x0'));var rimraf=require(_0x5c01('0x1'));var zipdir=require(_0x5c01('0x2'));var jsonpatch=require(_0x5c01('0x3'));var rp=require(_0x5c01('0x4'));var moment=require(_0x5c01('0x5'));var BPromise=require(_0x5c01('0x6'));var Mustache=require(_0x5c01('0x7'));var util=require(_0x5c01('0x8'));var path=require('path');var sox=require(_0x5c01('0x9'));var csv=require(_0x5c01('0xa'));var ejs=require(_0x5c01('0xb'));var fs=require('fs');var fs_extra=require(_0x5c01('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5c01('0xe'));var toCsv=require(_0x5c01('0xa'));var querystring=require(_0x5c01('0xf'));var Papa=require('papaparse');var Redis=require(_0x5c01('0x10'));var authService=require(_0x5c01('0x11'));var qs=require(_0x5c01('0x12'));var as=require(_0x5c01('0x13'));var pdf=require(_0x5c01('0x14'));var hardwareService=require(_0x5c01('0x15'));var logger=require(_0x5c01('0x16'))(_0x5c01('0x17'));var utils=require(_0x5c01('0x18'));var config=require(_0x5c01('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c01('0x1a'))['db'];config[_0x5c01('0x1b')]=_[_0x5c01('0x1c')](config[_0x5c01('0x1b')],{'host':_0x5c01('0x1d'),'port':0x18eb});var socket=require(_0x5c01('0x1e'))(new Redis(config[_0x5c01('0x1b')]));require('./smsInteraction.socket')[_0x5c01('0x1f')](socket);function respondWithStatusCode(_0x2fe77b,_0x6b21e7){_0x6b21e7=_0x6b21e7||0xcc;return function(_0x950057){if(_0x950057){return _0x2fe77b[_0x5c01('0x20')](_0x6b21e7);}return _0x2fe77b['status'](_0x6b21e7)[_0x5c01('0x21')]();};}function respondWithResult(_0xe88089,_0x14e8f1){_0x14e8f1=_0x14e8f1||0xc8;return function(_0x57573f){if(_0x57573f){return _0xe88089['status'](_0x14e8f1)[_0x5c01('0x22')](_0x57573f);}};}function respondWithFilteredResult(_0x157b91,_0x295af7){return function(_0x38b590){if(_0x38b590){var _0x337d12=typeof _0x295af7[_0x5c01('0x23')]==='undefined'&&typeof _0x295af7[_0x5c01('0x24')]===_0x5c01('0x25');var _0x3a76e2=_0x38b590[_0x5c01('0x26')];var _0x2985b7=_0x337d12?0x0:_0x295af7[_0x5c01('0x23')];var _0xc0b7bd=_0x337d12?_0x38b590[_0x5c01('0x26')]:_0x295af7[_0x5c01('0x23')]+_0x295af7[_0x5c01('0x24')];var _0x15044a;if(_0xc0b7bd>=_0x3a76e2){_0xc0b7bd=_0x3a76e2;_0x15044a=0xc8;}else{_0x15044a=0xce;}_0x157b91[_0x5c01('0x27')](_0x15044a);return _0x157b91['set'](_0x5c01('0x28'),_0x2985b7+'-'+_0xc0b7bd+'/'+_0x3a76e2)['json'](_0x38b590);}return null;};}function patchUpdates(_0x13f67d){return function(_0x9b364d){try{jsonpatch['apply'](_0x9b364d,_0x13f67d,!![]);}catch(_0x4a2bd0){return BPromise[_0x5c01('0x29')](_0x4a2bd0);}return _0x9b364d[_0x5c01('0x2a')]();};}function saveUpdates(_0x33526b,_0xf5881){return function(_0x7735a1){if(_0x7735a1){return _0x7735a1[_0x5c01('0x2b')](_0x33526b)[_0x5c01('0x2c')](function(_0x42b2b0){return _0x42b2b0;});}return null;};}function removeEntity(_0x38c59d,_0x2e992a){return function(_0x4cc236){if(_0x4cc236){return _0x4cc236[_0x5c01('0x2d')]()[_0x5c01('0x2c')](function(){_0x38c59d[_0x5c01('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599440,_0x32eeb5){return function(_0xa15fc1){if(!_0xa15fc1){_0x599440[_0x5c01('0x20')](0x194);}return _0xa15fc1;};}function handleError(_0x1078cd,_0x536b4d){_0x536b4d=_0x536b4d||0x1f4;return function(_0x5074ce){logger['error'](_0x5074ce['stack']);if(_0x5074ce[_0x5c01('0x2e')]){delete _0x5074ce[_0x5c01('0x2e')];}_0x1078cd['status'](_0x536b4d)[_0x5c01('0x2f')](_0x5074ce);};}function getInteractionUsers(_0x1f250f,_0x37ffe1){return new BPromise(function(_0x35076d,_0x12b7f6){try{if(_0x37ffe1[_0x1f250f['id']]){_0x1f250f[_0x5c01('0x30')]=_[_0x5c01('0x31')](_0x37ffe1[_0x1f250f['id']],function(_0xf8ae1){return{'id':_0xf8ae1['id'],'fullname':_0xf8ae1['fullname']};});}}catch(_0x3f4360){_0x12b7f6(_0x3f4360);}_0x35076d(_0x1f250f);});}function getInteractionTags(_0x19c19c,_0x2a6079){return new BPromise(function(_0x1664af,_0x390427){try{if(_0x19c19c['TagIds']){_0x19c19c[_0x5c01('0x32')]=[];_0x19c19c[_0x5c01('0x33')][_0x5c01('0x34')](',')[_0x5c01('0x35')](function(_0x1a847f){_0x19c19c[_0x5c01('0x32')][_0x5c01('0x36')](_0x2a6079[_0x1a847f]);});}delete _0x19c19c['TagIds'];}catch(_0x4089e3){_0x390427(_0x4089e3);}_0x1664af(_0x19c19c);});}function updateSmsInteraction(_0x3bddc6,_0x251e73,_0x528ac6){return new BPromise(function(_0x22bb6a,_0x27d278){return getInteractionUsers(_0x3bddc6,_0x528ac6)['then'](function(_0x589a9){return getInteractionTags(_0x589a9,_0x251e73);})['then'](function(_0x45a276){return getStateInteraction(_0x45a276);})[_0x5c01('0x2c')](function(_0x42c84d){_0x22bb6a(_0x42c84d);})[_0x5c01('0x37')](function(_0x181ad4){_0x27d278(_0x181ad4);});});}function getStateInteraction(_0x4801e8){return new BPromise(function(_0x33e48e){_0x4801e8[_0x5c01('0x38')]=0x0;_0x4801e8['talking']=0x0;_0x4801e8[_0x5c01('0x39')]=0x0;_0x4801e8['unmanaged']=0x0;_0x4801e8[_0x5c01('0x3a')]=0x0;if(!_0x4801e8[_0x5c01('0x3b')]&&!_0x4801e8['UserId']){_0x4801e8[_0x5c01('0x38')]+=0x1;}if(!_0x4801e8['closed']&&_0x4801e8[_0x5c01('0x3c')]){_0x4801e8[_0x5c01('0x3d')]+=0x1;if(_0x4801e8['waiting']){_0x4801e8['waiting']-=0x1;}}if(_0x4801e8['closed']&&_0x4801e8[_0x5c01('0x3c')]){_0x4801e8[_0x5c01('0x39')]+=0x1;if(_0x4801e8['talking']){_0x4801e8[_0x5c01('0x3d')]-=0x1;}}if(_0x4801e8['closed']&&!_0x4801e8[_0x5c01('0x3c')]){_0x4801e8['unmanaged']+=0x1;if(_0x4801e8[_0x5c01('0x38')]){_0x4801e8[_0x5c01('0x38')]-=0x1;}}_0x4801e8['total']+=0x1;_0x33e48e(_0x4801e8);});}exports[_0x5c01('0x3e')]=function(_0x367cc1,_0x5bc90d){var _0x4c5e7d={},_0x888ea6={},_0x2f9174={'count':0x0,'rows':[]};var _0x37977b=_['map'](db['SmsInteraction'][_0x5c01('0x3f')],function(_0x1195c2){return{'name':_0x1195c2[_0x5c01('0x40')],'type':_0x1195c2['type']['key']};});_0x888ea6[_0x5c01('0x41')]=_['map'](_0x37977b,_0x5c01('0x2e'));_0x888ea6[_0x5c01('0x42')]=_[_0x5c01('0x43')](_0x367cc1[_0x5c01('0x42')]);_0x888ea6['filters']=_[_0x5c01('0x44')](_0x888ea6[_0x5c01('0x41')],_0x888ea6['query']);_0x4c5e7d[_0x5c01('0x45')]=_[_0x5c01('0x44')](_0x888ea6[_0x5c01('0x41')],qs['fields'](_0x367cc1[_0x5c01('0x42')][_0x5c01('0x46')]));_0x4c5e7d[_0x5c01('0x45')]=_0x4c5e7d[_0x5c01('0x45')][_0x5c01('0x47')]?_0x4c5e7d[_0x5c01('0x45')]:_0x888ea6['model'];if(!_0x367cc1[_0x5c01('0x42')][_0x5c01('0x48')](_0x5c01('0x49'))){_0x4c5e7d[_0x5c01('0x24')]=qs[_0x5c01('0x24')](_0x367cc1[_0x5c01('0x42')][_0x5c01('0x24')]);_0x4c5e7d[_0x5c01('0x23')]=qs[_0x5c01('0x23')](_0x367cc1[_0x5c01('0x42')][_0x5c01('0x23')]);}_0x4c5e7d[_0x5c01('0x4a')]=qs['sort'](_0x367cc1[_0x5c01('0x42')][_0x5c01('0x4b')]);_0x4c5e7d['where']=qs['filters'](_[_0x5c01('0x4c')](_0x367cc1[_0x5c01('0x42')],_0x888ea6[_0x5c01('0x4d')]),_0x37977b);var _0x479e91=[];var _0x41acdb=squel['select']()[_0x5c01('0x4e')]('id')['field'](_0x5c01('0x2e'))['field']('color')[_0x5c01('0x4f')](_0x5c01('0x50'));var _0x4166e9=squel[_0x5c01('0x51')]()[_0x5c01('0x4e')]('u.id')[_0x5c01('0x4e')](_0x5c01('0x52'))[_0x5c01('0x4e')](_0x5c01('0x53'))[_0x5c01('0x4f')](_0x5c01('0x54'),'ui')[_0x5c01('0x55')](_0x5c01('0x56'),'u',_0x5c01('0x57'));var _0x1dae27=squel[_0x5c01('0x51')]()[_0x5c01('0x4f')](_0x5c01('0x58'),'i')[_0x5c01('0x55')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x5c01('0x59'))[_0x5c01('0x55')](_0x5c01('0x5a'),'a',_0x5c01('0x5b'))[_0x5c01('0x55')](_0x5c01('0x5c'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x5c01('0x5d'),'it',_0x5c01('0x5e'))[_0x5c01('0x55')](_0x5c01('0x50'),'t','t.id\x20=\x20it.TagId');var _0x56d0bd=squel[_0x5c01('0x5f')]();var _0x2a03fc=[];var _0x2e1364=squel[_0x5c01('0x5f')]();var _0x485d2b;if(_0x367cc1[_0x5c01('0x42')][_0x5c01('0x60')]){_0x485d2b=as['parseSearch'](_0x367cc1[_0x5c01('0x42')]['search']);var _0x45037d=_0x485d2b['sqlOperator'];for(var _0x239cd4=0x0;_0x239cd4<_0x485d2b[_0x5c01('0x61')]['length'];_0x239cd4++){var _0x34c73b=_0x485d2b[_0x5c01('0x61')][_0x239cd4];var _0x46661f='i';var _0x132c93=_['find'](_0x37977b,['name',_0x34c73b[_0x5c01('0x4e')]]);if(!_0x132c93){switch(_0x34c73b['field']){case _0x5c01('0x62'):if(_0x34c73b[_0x5c01('0x63')]==0x1){_0x1dae27[_0x5c01('0x64')]('`'+_0x34c73b[_0x5c01('0x4e')]+_0x5c01('0x65'));}else{_0x1dae27[_0x5c01('0x64')]('`'+_0x34c73b[_0x5c01('0x4e')]+_0x5c01('0x66'));}break;case'Contact':if(_0x34c73b[_0x5c01('0x67')]===_0x5c01('0x68')){if(_0x34c73b['value'][_0x5c01('0x34')]('\x20')[_0x5c01('0x47')]>0x1){_0x56d0bd[_0x45037d](_0x5c01('0x69'),qs[_0x5c01('0x6a')](_0x34c73b['value']),null);}else{var _0x37fc1f='%'+_0x34c73b[_0x5c01('0x63')]+'%';_0x56d0bd[_0x45037d](_0x5c01('0x6b'),_0x37fc1f,_0x37fc1f,_0x37fc1f);}}else{_0x132c93=_['find'](_0x37977b,[_0x5c01('0x2e'),_0x5c01('0x6c')]);_0x34c73b[_0x5c01('0x4e')]='ContactId';_0x50d8b0=as[_0x5c01('0x6d')](_0x46661f,_0x132c93[_0x5c01('0x6e')],_0x34c73b);_0x56d0bd[_0x45037d](_0x50d8b0[_0x5c01('0x6f')],_0x50d8b0[_0x5c01('0x63')][_0x5c01('0x70')],_0x50d8b0['value'][_0x5c01('0x21')]);}break;case _0x5c01('0x71'):var _0x239420=_0x34c73b[_0x5c01('0x63')][_0x5c01('0x34')](',')[_0x5c01('0x31')](function(_0x1417d8){return Number(_0x1417d8);});_0x239420[_0x5c01('0x35')](function(_0x19de31){_0x2e1364['or'](_0x5c01('0x72'),'%,'+_0x19de31+',%');});_0x2a03fc=_[_0x5c01('0x73')](_0x2a03fc,_0x239420);break;case _0x5c01('0x74'):if(_0x34c73b[_0x5c01('0x67')]===_0x5c01('0x68')){_0x56d0bd[_0x45037d](_0x5c01('0x75'),'%'+_0x34c73b['value']+'%',null);}else{_0x132c93=_['find'](_0x37977b,[_0x5c01('0x2e'),_0x5c01('0x3c')]);_0x34c73b[_0x5c01('0x4e')]=_0x5c01('0x3c');_0x50d8b0=as['buildExpression'](_0x46661f,_0x132c93[_0x5c01('0x6e')],_0x34c73b);_0x56d0bd[_0x45037d](_0x50d8b0[_0x5c01('0x6f')],_0x50d8b0['value'][_0x5c01('0x70')],_0x50d8b0[_0x5c01('0x63')][_0x5c01('0x21')]);}break;case _0x5c01('0x76'):_0x50d8b0=as[_0x5c01('0x6d')]('me',null,_0x34c73b);_0x56d0bd[_0x45037d](_0x50d8b0['text'],_0x50d8b0[_0x5c01('0x63')][_0x5c01('0x70')],_0x50d8b0[_0x5c01('0x63')]['end']);break;}}else{var _0x50d8b0=as['buildExpression'](_0x46661f,_0x132c93[_0x5c01('0x6e')],_0x34c73b);_0x56d0bd[_0x45037d](_0x50d8b0[_0x5c01('0x6f')],_0x50d8b0[_0x5c01('0x63')][_0x5c01('0x70')],_0x50d8b0['value'][_0x5c01('0x21')]);}}}else{var _0xe45a5f=_(_0x367cc1[_0x5c01('0x42')])[_0x5c01('0x43')]()[_0x5c01('0x31')](function(_0x4e2ca3){return _[_0x5c01('0x77')](_0x37977b,[_0x5c01('0x2e'),_0x4e2ca3])?_0x4e2ca3:undefined;})[_0x5c01('0x78')]()[_0x5c01('0x63')]();if(!_[_0x5c01('0x79')](_0xe45a5f)){_0xe45a5f[_0x5c01('0x35')](function(_0xb80f4f){if(_0xb80f4f==='SmsAccountId'){_0x1dae27[_0x5c01('0x7a')](_0x5c01('0x7b'),[][_0x5c01('0x7c')](_0x367cc1[_0x5c01('0x42')][_0xb80f4f]));}else if(_0xb80f4f===_0x5c01('0x7d')){var _0x5c8fac=JSON[_0x5c01('0x7e')](_0x367cc1['query'][_0xb80f4f])[_0x5c01('0x7f')];var _0x93a58c=JSON[_0x5c01('0x7e')](_0x367cc1[_0x5c01('0x42')][_0xb80f4f])[_0x5c01('0x80')];_0x1dae27[_0x5c01('0x7a')](_0x5c01('0x81'),_0x5c8fac,_0x93a58c);}else{if(_0x367cc1[_0x5c01('0x42')][_0xb80f4f]===_0x5c01('0x82')){_0x1dae27[_0x5c01('0x7a')]('i.'+_0xb80f4f+_0x5c01('0x83'));}else{_0x1dae27[_0x5c01('0x7a')]('i.'+_0xb80f4f+_0x5c01('0x84'),_0x367cc1[_0x5c01('0x42')][_0xb80f4f]);}}});}if(_0x367cc1[_0x5c01('0x42')][_0x5c01('0x85')]){if(_0x367cc1['query']['read']==0x1){_0x1dae27['having']('`unreadMessages`\x20=\x200');}else{_0x1dae27['having'](_0x5c01('0x86'));}}if(_0x367cc1[_0x5c01('0x42')][_0x5c01('0x87')]){_0x2a03fc=_[_0x5c01('0x88')](_0x367cc1[_0x5c01('0x42')][_0x5c01('0x87')])?_0x367cc1[_0x5c01('0x42')][_0x5c01('0x87')]:new Array(_0x367cc1[_0x5c01('0x42')][_0x5c01('0x87')]);_0x2a03fc[_0x5c01('0x35')](function(_0x3a7c26){_0x2e1364['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a7c26+',%');});}if(_0x367cc1['query'][_0x5c01('0x89')]){var _0x21a865=_0x367cc1[_0x5c01('0x42')][_0x5c01('0x89')]['replace']('\x5c','\x5c\x5c')[_0x5c01('0x8a')](/'/g,'\x27\x27');if(qs[_0x5c01('0x8b')](_0x21a865)){_0x56d0bd['or'](_0x5c01('0x8c'),_0x21a865+'%')['or']('i.phone\x20LIKE\x20?',_0x21a865+'%');}else{_0x56d0bd['or'](_0x5c01('0x8d'),qs[_0x5c01('0x6a')](_0x21a865))['or'](_0x5c01('0x8e'),_0x21a865+'%');}}}_0x1dae27[_0x5c01('0x7a')](_0x56d0bd);_0x1dae27[_0x5c01('0x8f')](_0x5c01('0x90'));var _0x55fc82={'type':db[_0x5c01('0x91')][_0x5c01('0x92')][_0x5c01('0x93')],'raw':!![]};var _0x4e8165=_0x1dae27[_0x5c01('0x94')]();_0x4e8165[_0x5c01('0x4e')](_0x5c01('0x90'));_0x4e8165['field'](_0x5c01('0x95'),'unreadMessages');if(_0x4c5e7d['order']){_0x4c5e7d[_0x5c01('0x4a')][_0x5c01('0x35')](function(_0x27d2e4){var _0x4aa58c=_0x27d2e4[0x0]===_0x5c01('0x96')?_0x27d2e4[0x0]:'i.'+_0x27d2e4[0x0];_0x1dae27[_0x5c01('0x4a')](_0x4aa58c,_0x27d2e4[0x1]===_0x5c01('0x97')?![]:!![]);});}if(!_[_0x5c01('0x79')](_0x2a03fc)){_0x1dae27['having'](_0x2e1364);_0x4e8165[_0x5c01('0x7a')](_0x5c01('0x98'),_0x2a03fc);}BPromise['resolve']()[_0x5c01('0x2c')](function(){if(!_0x485d2b){if(_0x367cc1[_0x5c01('0x42')][_0x5c01('0x99')])return;_0x4e8165[_0x5c01('0x7a')](_0x5c01('0x9a'));_0x1dae27[_0x5c01('0x7a')](_0x5c01('0x9a'));return;}if(_0x367cc1[_0x5c01('0x9b')][_0x5c01('0x9c')]!==_0x5c01('0x9d'))return;return _0x367cc1[_0x5c01('0x9b')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x5c01('0x2c')](function(_0x11f73a){if(_[_0x5c01('0x79')](_0x11f73a)){_0x4e8165[_0x5c01('0x7a')]('i.SmsAccountId\x20IS\x20NULL');_0x1dae27['where'](_0x5c01('0x9e'));}else{_0x4e8165[_0x5c01('0x7a')](_0x5c01('0x7b'),_['map'](_0x11f73a,'id'));_0x1dae27[_0x5c01('0x7a')](_0x5c01('0x7b'),_[_0x5c01('0x31')](_0x11f73a,'id'));}});})[_0x5c01('0x2c')](function(){if(_0x367cc1['user']['role']===_0x5c01('0x9d')&&!_0x485d2b&&!_0x367cc1['query'][_0x5c01('0x99')])return[];return db[_0x5c01('0x9f')][_0x5c01('0x42')](_0x4e8165[_0x5c01('0xa0')](),_0x55fc82);})['then'](function(_0x45626a){_0x2f9174['count']=_0x45626a[_0x5c01('0x47')];if(_0x2f9174[_0x5c01('0x26')]===0x0)return[];return db[_0x5c01('0x9f')][_0x5c01('0x42')](_0x41acdb[_0x5c01('0xa0')](),_0x55fc82)[_0x5c01('0x2c')](function(_0x3891aa){_0x479e91=_[_0x5c01('0xa1')](_0x3891aa,'id');_0x55fc82=_[_0x5c01('0xa2')](_0x55fc82,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x367cc1['query'][_0x5c01('0x46')]){_0x4c5e7d[_0x5c01('0x45')][_0x5c01('0x35')](function(_0x262afe){_0x1dae27[_0x5c01('0x4e')]('i.'+_0x262afe);});}else{_0x1dae27[_0x5c01('0x4e')](_0x5c01('0x95'),_0x5c01('0x62'));_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xa3'),_0x5c01('0xa4'));_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xa5'),_0x5c01('0xa6'));_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xa7'),_0x5c01('0x96'));_0x1dae27['field']('i.*');_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xa8'),_0x5c01('0xa9'));_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xaa'),'Contact.lastName');_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xab'),_0x5c01('0xac'));_0x1dae27[_0x5c01('0x4e')]('c.phone',_0x5c01('0xad'));_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xae'),'Contact.mobile');_0x1dae27['field']('c.fax',_0x5c01('0xaf'));_0x1dae27[_0x5c01('0x4e')]('o.fullname','Owner.fullname');_0x1dae27[_0x5c01('0x4e')](_0x5c01('0xb0'),_0x5c01('0xb1'));_0x1dae27[_0x5c01('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5c01('0x33'));}if(_0x4c5e7d[_0x5c01('0x24')])_0x1dae27[_0x5c01('0x24')](_0x4c5e7d[_0x5c01('0x24')]);if(_0x4c5e7d[_0x5c01('0x23')])_0x1dae27[_0x5c01('0x23')](_0x4c5e7d[_0x5c01('0x23')]);return db['sequelize'][_0x5c01('0x42')](_0x1dae27[_0x5c01('0xa0')](),_0x55fc82);})[_0x5c01('0x2c')](function(_0x3f0041){if(_0x3f0041[_0x5c01('0x47')]>0x0)_0x4166e9[_0x5c01('0x7a')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x3f0041,'id'));return db[_0x5c01('0x9f')]['query'](_0x4166e9[_0x5c01('0xa0')](),_0x55fc82)[_0x5c01('0x2c')](function(_0x261e7e){var _0x4987c2=_[_0x5c01('0xb2')](_0x261e7e,_0x5c01('0xb3'));var _0x42b2c8=[];_0x3f0041[_0x5c01('0x35')](function(_0x218e73){_0x42b2c8['push'](updateSmsInteraction(_0x218e73,_0x479e91,_0x4987c2));});return BPromise['all'](_0x42b2c8);});});})['then'](function(_0x1129df){_0x2f9174[_0x5c01('0xb4')]=_0x1129df;return _0x2f9174;})[_0x5c01('0x2c')](respondWithFilteredResult(_0x5bc90d,_0x4c5e7d))['catch'](handleError(_0x5bc90d,null));};exports[_0x5c01('0xb5')]=function(_0x3c4029,_0xae0916){var _0xf904b={'raw':![],'where':{'id':_0x3c4029['params']['id']}},_0x2b5b6b={};_0x2b5b6b['model']=_['keys'](db[_0x5c01('0xb6')][_0x5c01('0x3f')]);_0x2b5b6b[_0x5c01('0x42')]=_[_0x5c01('0x43')](_0x3c4029[_0x5c01('0x42')]);_0x2b5b6b['filters']=_[_0x5c01('0x44')](_0x2b5b6b[_0x5c01('0x41')],_0x2b5b6b['query']);_0xf904b[_0x5c01('0x45')]=_['intersection'](_0x2b5b6b[_0x5c01('0x41')],qs[_0x5c01('0x46')](_0x3c4029['query'][_0x5c01('0x46')]));_0xf904b['attributes']=_0xf904b[_0x5c01('0x45')]['length']?_0xf904b['attributes']:_0x2b5b6b[_0x5c01('0x41')];if(_0x3c4029[_0x5c01('0x42')][_0x5c01('0xb7')]){_0xf904b[_0x5c01('0xb8')]=[{'all':!![]}];}_0xf904b=_[_0x5c01('0xa2')]({},_0xf904b,_0x3c4029['options']);return db[_0x5c01('0xb6')][_0x5c01('0xb9')](_0xf904b)[_0x5c01('0x2c')](handleEntityNotFound(_0xae0916,null))[_0x5c01('0x2c')](respondWithResult(_0xae0916,null))['catch'](handleError(_0xae0916,null));};exports[_0x5c01('0xba')]=function(_0x1e6f10,_0x3b7eeb){return db[_0x5c01('0xb6')][_0x5c01('0xba')](_0x1e6f10[_0x5c01('0x76')],{})[_0x5c01('0x2c')](respondWithResult(_0x3b7eeb,0xc9))[_0x5c01('0x37')](handleError(_0x3b7eeb,null));};exports['update']=function(_0xee74b0,_0x2064bf){if(_0xee74b0[_0x5c01('0x76')]['id']){delete _0xee74b0[_0x5c01('0x76')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0xee74b0[_0x5c01('0xbb')]['id']}})[_0x5c01('0x2c')](handleEntityNotFound(_0x2064bf,null))[_0x5c01('0x2c')](saveUpdates(_0xee74b0[_0x5c01('0x76')],null))['then'](respondWithResult(_0x2064bf,null))[_0x5c01('0x37')](handleError(_0x2064bf,null));};exports['destroy']=function(_0x2616d1,_0x205808){return db['SmsInteraction']['find']({'where':{'id':_0x2616d1[_0x5c01('0xbb')]['id']}})[_0x5c01('0x2c')](handleEntityNotFound(_0x205808,null))[_0x5c01('0x2c')](removeEntity(_0x205808,null))['catch'](handleError(_0x205808,null));};exports[_0x5c01('0xbc')]=function(_0x4c056a,_0x2890ee){return db['SmsInteraction'][_0x5c01('0xbc')]()[_0x5c01('0x2c')](respondWithResult(_0x2890ee,null))['catch'](handleError(_0x2890ee,null));};exports['addMessage']=function(_0x12bc26,_0x363477,_0x1b6396){return db[_0x5c01('0xbd')][_0x5c01('0xb9')]({'where':{'id':_0x12bc26[_0x5c01('0xbb')]['id']}})[_0x5c01('0x2c')](handleEntityNotFound(_0x363477,null))[_0x5c01('0x2c')](function(_0x432e77){if(_0x432e77){return _0x432e77['addMessage'](_0x12bc26[_0x5c01('0x76')][_0x5c01('0xbe')],_[_0x5c01('0xbf')](_0x12bc26[_0x5c01('0x76')],[_0x5c01('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x363477,null))[_0x5c01('0x37')](handleError(_0x363477,null));};exports['getMessages']=function(_0x1a03f0,_0x3388bd,_0xdf5662){var _0x146f53={'raw':![],'where':{}};var _0x1caea8={};var _0x256e9d={'count':0x0,'rows':[]};return db[_0x5c01('0xb6')][_0x5c01('0xc0')]({'where':{'id':_0x1a03f0['params']['id']}})[_0x5c01('0x2c')](handleEntityNotFound(_0x3388bd,null))[_0x5c01('0x2c')](function(_0x26933f){if(_0x26933f){_0x1caea8['model']=_[_0x5c01('0x43')](db[_0x5c01('0xbd')][_0x5c01('0x3f')]);_0x1caea8['query']=_[_0x5c01('0x43')](_0x1a03f0[_0x5c01('0x42')]);_0x1caea8[_0x5c01('0x4d')]=_[_0x5c01('0x44')](_0x1caea8[_0x5c01('0x41')],_0x1caea8[_0x5c01('0x42')]);_0x146f53[_0x5c01('0x45')]=_['intersection'](_0x1caea8['model'],qs[_0x5c01('0x46')](_0x1a03f0[_0x5c01('0x42')][_0x5c01('0x46')]));_0x146f53[_0x5c01('0x45')]=_0x146f53[_0x5c01('0x45')]['length']?_0x146f53[_0x5c01('0x45')]:_0x1caea8[_0x5c01('0x41')];if(!_0x1a03f0['query'][_0x5c01('0x48')](_0x5c01('0x49'))){_0x146f53[_0x5c01('0x24')]=qs[_0x5c01('0x24')](_0x1a03f0[_0x5c01('0x42')][_0x5c01('0x24')]);_0x146f53[_0x5c01('0x23')]=qs[_0x5c01('0x23')](_0x1a03f0['query'][_0x5c01('0x23')]);}_0x146f53[_0x5c01('0x4a')]=qs[_0x5c01('0x4b')](_0x1a03f0[_0x5c01('0x42')][_0x5c01('0x4b')]);_0x146f53['where']=qs[_0x5c01('0x4d')](_[_0x5c01('0x4c')](_0x1a03f0[_0x5c01('0x42')],_0x1caea8[_0x5c01('0x4d')]));_0x146f53[_0x5c01('0x7a')][_0x5c01('0xb3')]=_0x26933f['id'];if(_0x1a03f0[_0x5c01('0x42')][_0x5c01('0x89')]){_0x146f53[_0x5c01('0x7a')]=_['merge'](_0x146f53['where'],{'$or':_[_0x5c01('0x31')](_0x146f53[_0x5c01('0x45')],function(_0x25610b){var _0x249f56={};_0x249f56[_0x25610b]={'$like':'%'+_0x1a03f0['query'][_0x5c01('0x89')]+'%'};return _0x249f56;})});}if(_0x1a03f0[_0x5c01('0x42')]['$gte']){var _0x50222f=_0x1a03f0[_0x5c01('0x42')][_0x5c01('0x7f')][_0x5c01('0x34')](',');var _0x566a99={};_0x566a99[_0x50222f[0x0]]={'$gte':moment(_0x50222f[0x1])[_0x5c01('0xc1')](_0x5c01('0xc2'))};_0x146f53[_0x5c01('0x7a')]=_[_0x5c01('0xa2')](_0x146f53[_0x5c01('0x7a')],_0x566a99);}_0x146f53=_[_0x5c01('0xa2')]({},_0x146f53,_0x1a03f0[_0x5c01('0xc3')]);return db[_0x5c01('0xbd')]['count']({'where':_0x146f53[_0x5c01('0x7a')]})[_0x5c01('0x2c')](function(_0x33730d){_0x256e9d[_0x5c01('0x26')]=_0x33730d;if(_0x1a03f0['query']['includeAll']){_0x146f53[_0x5c01('0xb8')]=[{'all':!![]}];}return db[_0x5c01('0xbd')][_0x5c01('0xc4')](_0x146f53);})['then'](function(_0x35e06f){_0x256e9d['rows']=_0x35e06f;return _0x256e9d;});}})['then'](respondWithFilteredResult(_0x3388bd,_0x146f53))[_0x5c01('0x37')](handleError(_0x3388bd,null));};exports[_0x5c01('0xc5')]=function(_0x1713e1,_0x5a960f,_0x421800){return db['SmsInteraction'][_0x5c01('0xb9')]({'where':{'id':_0x1713e1[_0x5c01('0xbb')]['id']}})['then'](handleEntityNotFound(_0x5a960f,null))[_0x5c01('0x2c')](function(_0x382df7){if(_0x382df7){return _0x382df7[_0x5c01('0xc6')](_0x1713e1['body'][_0x5c01('0xbe')],_[_0x5c01('0xbf')](_0x1713e1[_0x5c01('0x76')],[_0x5c01('0xbe'),'id'])||{})[_0x5c01('0xc7')](function(){return db['Tag'][_0x5c01('0xc4')]({'attributes':['id',_0x5c01('0x2e'),_0x5c01('0xc8')],'where':{'id':_0x1713e1[_0x5c01('0x76')][_0x5c01('0xbe')]}});})['then'](function(_0x4e833e){socket[_0x5c01('0xc9')](_0x5c01('0xca'),{'id':Number(_0x1713e1[_0x5c01('0xbb')]['id']),'tags':_0x4e833e||[]});return{'id':Number(_0x1713e1[_0x5c01('0xbb')]['id']),'tags':_0x4e833e||[]};});}})[_0x5c01('0x2c')](respondWithResult(_0x5a960f,null))[_0x5c01('0x37')](handleError(_0x5a960f,null));};exports['removeTags']=function(_0x1e75f2,_0x10f0a7,_0x1c91d2){return db[_0x5c01('0xb6')][_0x5c01('0xb9')]({'where':{'id':_0x1e75f2['params']['id']}})[_0x5c01('0x2c')](handleEntityNotFound(_0x10f0a7,null))[_0x5c01('0x2c')](function(_0x29ed51){if(_0x29ed51){return _0x29ed51['removeTags'](_0x1e75f2[_0x5c01('0x42')]['ids']);}})[_0x5c01('0x2c')](respondWithStatusCode(_0x10f0a7,null))['catch'](handleError(_0x10f0a7,null));};exports[_0x5c01('0xcb')]=function(_0x3c9c10,_0x1b4ba7){var _0x5a1eb8=moment()[_0x5c01('0xcc')]()[_0x5c01('0xa0')]();var _0x1a9bc3=path['join'](config[_0x5c01('0xcd')],_0x5c01('0xce'),_0x5c01('0xcf'),_0x5c01('0xd0'));var _0xdb0705=path[_0x5c01('0xd1')](config['root'],_0x5c01('0xce'),_0x5c01('0xcf'),_0x5c01('0xd2'));var _0x2327bd=path[_0x5c01('0xd1')](_0x1a9bc3,_0x5a1eb8);var _0x3a6824=util[_0x5c01('0xc1')]('transcript-%d-%s.zip',_0x3c9c10[_0x5c01('0xbb')]['id'],_0x5a1eb8);var _0x2296ea=path['join'](_0x1a9bc3,_0x3a6824);var _0x5c3662=[];_0x5c3662['push']({'model':db[_0x5c01('0x74')],'as':_0x5c01('0x74'),'attributes':['id',_0x5c01('0xd3')],'raw':!![]});_0x5c3662['push']({'model':db[_0x5c01('0xd4')],'as':_0x5c01('0xd5'),'attributes':['id',_0x5c01('0xd6'),_0x5c01('0xd7')],'raw':!![]});var _0x324801=[{'model':db['SmsMessage'],'as':_0x5c01('0xd8'),'attributes':['id',_0x5c01('0x76'),_0x5c01('0x7d'),_0x5c01('0xd9'),'secret',_0x5c01('0x85')],'include':_0x5c3662}];_0x324801['push']({'model':db[_0x5c01('0xda')],'as':'Account','attributes':['id',_0x5c01('0x2e')]});_0x324801[_0x5c01('0x36')]({'model':db[_0x5c01('0x74')],'as':_0x5c01('0xdb'),'attributes':['id',_0x5c01('0xd3')]});return db[_0x5c01('0xb6')]['find']({'where':{'id':_0x3c9c10[_0x5c01('0xbb')]['id']},'include':_0x324801})[_0x5c01('0x2c')](handleEntityNotFound(_0x1b4ba7,null))[_0x5c01('0x2c')](function(_0x5a79bd){if(_0x5a79bd){var _0x451890=_0x5a79bd[_0x5c01('0xdc')]({'plain':!![]});fs[_0x5c01('0xdd')](_0x2327bd);var _0x49ecf3={'channel':'Sms','account':_0x451890['Account'][_0x5c01('0x2e')],'agent':_0x451890[_0x5c01('0xdb')]?_0x451890[_0x5c01('0xdb')][_0x5c01('0xd3')]:_0x5c01('0xde'),'createdAt':moment(_0x451890[_0x5c01('0x7d')])[_0x5c01('0xc1')](_0x5c01('0xc2'))[_0x5c01('0xa0')](),'closedAt':_0x451890[_0x5c01('0x3b')]?moment(_0x451890['closedAt'])[_0x5c01('0xc1')](_0x5c01('0xc2'))[_0x5c01('0xa0')]():'','disposition':_0x451890['disposition'],'messages':_(_0x451890[_0x5c01('0xd8')])[_0x5c01('0x89')]({'secret':![]})[_0x5c01('0x31')](function(_0x5d86cd){return{'date':moment(_0x5d86cd[_0x5c01('0x7d')])[_0x5c01('0xc1')](_0x5c01('0xc2'))[_0x5c01('0xa0')](),'sender':_0x5d86cd['direction']==='out'?_0x5d86cd[_0x5c01('0x74')]?_0x5d86cd['User'][_0x5c01('0xd3')]:_0x5c01('0xdf'):_0x5d86cd[_0x5c01('0xd5')][_0x5c01('0xd6')]+(_0x5d86cd['Contact']['lastName']?'\x20'+_0x5d86cd[_0x5c01('0xd5')][_0x5c01('0xd7')]:''),'body':_0x5d86cd['body'],'direction':_0x5d86cd[_0x5c01('0xd9')]==='out'?'A':'C','secret':_0x5d86cd[_0x5c01('0xe0')],'read':_0x5d86cd[_0x5c01('0x85')]};})[_0x5c01('0x63')]()};return ejs[_0x5c01('0xe1')](path[_0x5c01('0xd1')](config[_0x5c01('0xcd')],_0x5c01('0xce'),_0x5c01('0xe2'),_0x5c01('0xe3')),{'interaction':_0x49ecf3})[_0x5c01('0x2c')](function(_0xe581f5){var _0x49bd61=path[_0x5c01('0xd1')](_0x2327bd,_0x5c01('0xe4')+_0x451890['id']+'-'+_0x5a1eb8+_0x5c01('0xe5'));var _0x3f0896={'path':_0x49bd61,'channel':_0x5c01('0xe6'),'interactionId':_0x451890['id']};return pdf[_0x5c01('0xe7')](_0xe581f5,_0x3f0896);})[_0x5c01('0x2c')](function(){return new BPromise(function(_0x2e47ff,_0xc92076){zipdir(_0x2327bd,{'saveTo':_0x2296ea},function(_0x22c290,_0x583dbe){if(_0x22c290)return _0xc92076(_0x22c290);return _0x2e47ff(_0x583dbe);});})['then'](function(){return new BPromise(function(_0x3510b5,_0x519b19){rimraf(_0x2327bd,function(_0x4faa53){if(_0x4faa53)_0x519b19(_0x4faa53);return _0x3510b5();});});})[_0x5c01('0x2c')](function(){return _0x1b4ba7[_0x5c01('0xcb')](_0x2296ea,_0x3a6824,function(_0x4a436e){if(_0x4a436e){console[_0x5c01('0xe8')](_0x5c01('0xe9'),_0x4a436e);}else{fs['unlinkSync'](_0x2296ea);}});});});}else{return _0x1b4ba7[_0x5c01('0x20')](0xc8);}})[_0x5c01('0x37')](handleError(_0x1b4ba7,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2380539..7c315e6 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 _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x10bcf9,_0x422019){var _0x554af6=function(_0x143f97){while(--_0x143f97){_0x10bcf9['push'](_0x10bcf9['shift']());}};_0x554af6(++_0x422019);}(_0x4991,0xf7));var _0x1499=function(_0x254c5d,_0x5763fa){_0x254c5d=_0x254c5d-0x0;var _0x5e4f74=_0x4991[_0x254c5d];return _0x5e4f74;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x5fdc=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','map'];(function(_0x23c180,_0x355555){var _0xba7177=function(_0x4fcfcd){while(--_0x4fcfcd){_0x23c180['push'](_0x23c180['shift']());}};_0xba7177(++_0x355555);}(_0x5fdc,0x127));var _0xc5fd=function(_0xae0a6f,_0x18ead3){_0xae0a6f=_0xae0a6f-0x0;var _0x84476e=_0x5fdc[_0xae0a6f];return _0x84476e;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var SmsInteraction=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var SmsMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5fd('0x4')](0x0);var events={'afterCreate':_0xc5fd('0x5'),'afterUpdate':_0xc5fd('0x6'),'afterDestroy':_0xc5fd('0x7')};function emitEvent(_0x1b6205){return function(_0xca27a0,_0xea5748,_0x44722b){_0xca27a0[_0xc5fd('0x8')]({'attributes':['id'],'raw':!![]})[_0xc5fd('0x9')](function(_0x5a2eb4){_0xca27a0['setDataValue']('Users',_0x5a2eb4[_0xc5fd('0xa')](function(_0x46bce3){return{'id':_0x46bce3['id']};}));return SmsMessage[_0xc5fd('0xb')]({'where':{'SmsInteractionId':_0xca27a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5fd('0x9')](function(_0x4e6d35){_0xca27a0['setDataValue'](_0xc5fd('0xc'),_0x4e6d35[_0xc5fd('0xd')]);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205+':'+_0xca27a0['id'],_0xca27a0);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205,_0xca27a0);_0x44722b(null);})[_0xc5fd('0xf')](_0x44722b(null));};}for(var e in events){if(events[_0xc5fd('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc5fd('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 9c16018..3a7b294 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 _0x8856=['exports','define','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x8856,0x111));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6885('0x0'))(_0x6885('0x1'));var moment=require('moment');var BPromise=require(_0x6885('0x2'));var rp=require(_0x6885('0x3'));var fs=require('fs');var path=require(_0x6885('0x4'));var rimraf=require(_0x6885('0x5'));var config=require(_0x6885('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x6885('0x7')]=function(_0x374a00,_0x5a60f7){return _0x374a00[_0x6885('0x8')](_0x6885('0x9'),attributes,{'tableName':_0x6885('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50a073,_0xa36429,_0x23c1b2){if(_0x50a073[_0x6885('0xb')]('closed')){_0x50a073[_0x6885('0xc')]=moment()['format'](_0x6885('0xd'));}_0x23c1b2(null,_0x50a073);}}});}; \ No newline at end of file +var _0x38c5=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise'];(function(_0x51c580,_0x15c627){var _0x11df09=function(_0x4abce8){while(--_0x4abce8){_0x51c580['push'](_0x51c580['shift']());}};_0x11df09(++_0x15c627);}(_0x38c5,0x82));var _0x538c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x38c5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x538c('0x0'));var util=require(_0x538c('0x1'));var logger=require('../../config/logger')(_0x538c('0x2'));var moment=require(_0x538c('0x3'));var BPromise=require(_0x538c('0x4'));var rp=require(_0x538c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x538c('0x6'));var config=require(_0x538c('0x7'));var attributes=require(_0x538c('0x8'));module[_0x538c('0x9')]=function(_0x29a585,_0x3723b0){return _0x29a585[_0x538c('0xa')](_0x538c('0xb'),attributes,{'tableName':_0x538c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x301e9c,_0x21c3d8,_0x4623f1){if(_0x301e9c[_0x538c('0xd')](_0x538c('0xe'))){_0x301e9c[_0x538c('0xf')]=moment()[_0x538c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4623f1(null,_0x301e9c);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index e37455c..4afbb24 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 _0xb275=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','body','options','raw','where','attributes','limit','then','UpdateSmsInteraction','debug','find','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5e1295,_0x7773f){var _0xffda50=function(_0x2a088f){while(--_0x2a088f){_0x5e1295['push'](_0x5e1295['shift']());}};_0xffda50(++_0x7773f);}(_0xb275,0x193));var _0x5b27=function(_0xcdf208,_0x4eaa81){_0xcdf208=_0xcdf208-0x0;var _0x448380=_0xb275[_0xcdf208];return _0x448380;};'use strict';var _=require('lodash');var util=require(_0x5b27('0x0'));var moment=require(_0x5b27('0x1'));var BPromise=require(_0x5b27('0x2'));var rs=require(_0x5b27('0x3'));var fs=require('fs');var Redis=require(_0x5b27('0x4'));var db=require(_0x5b27('0x5'))['db'];var utils=require(_0x5b27('0x6'));var logger=require(_0x5b27('0x7'))(_0x5b27('0x8'));var config=require(_0x5b27('0x9'));var jayson=require(_0x5b27('0xa'));var client=jayson[_0x5b27('0xb')][_0x5b27('0xc')]({'port':0x232a});config[_0x5b27('0xd')]=_[_0x5b27('0xe')](config['redis'],{'host':_0x5b27('0xf'),'port':0x18eb});var socket=require(_0x5b27('0x10'))(new Redis(config[_0x5b27('0xd')]));require('./smsInteraction.socket')[_0x5b27('0x11')](socket);function respondWithRpcPromise(_0x4cc41b,_0x14141b,_0x479730){return new BPromise(function(_0x1ceca2,_0xc6695c){return client['request'](_0x4cc41b,_0x479730)['then'](function(_0x19cb80){logger[_0x5b27('0x12')](_0x5b27('0x13'),_0x14141b,_0x5b27('0x14'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x14141b,'request\x20sent',JSON[_0x5b27('0x15')](_0x19cb80));if(_0x19cb80['error']){if(_0x19cb80[_0x5b27('0x16')]['code']===0x1f4){logger[_0x5b27('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x14141b,_0x19cb80[_0x5b27('0x16')]['message']);return _0xc6695c(_0x19cb80[_0x5b27('0x16')][_0x5b27('0x17')]);}logger[_0x5b27('0x16')](_0x5b27('0x13'),_0x14141b,_0x19cb80[_0x5b27('0x16')][_0x5b27('0x17')]);return _0x1ceca2(_0x19cb80[_0x5b27('0x16')][_0x5b27('0x17')]);}else{logger[_0x5b27('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x14141b,_0x5b27('0x14'));_0x1ceca2(_0x19cb80[_0x5b27('0x18')][_0x5b27('0x17')]);}})[_0x5b27('0x19')](function(_0x4996eb){logger[_0x5b27('0x16')](_0x5b27('0x13'),_0x14141b,_0x4996eb);_0xc6695c(_0x4996eb);});});}exports['UpdateSmsInteraction']=function(_0x4690a6){var _0x30c99a=this;return new Promise(function(_0x5c5ee0,_0x4ca0c4){return db['SmsInteraction']['update'](_0x4690a6[_0x5b27('0x1a')],{'raw':_0x4690a6[_0x5b27('0x1b')]?_0x4690a6[_0x5b27('0x1b')][_0x5b27('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4690a6[_0x5b27('0x1b')]?_0x4690a6['options'][_0x5b27('0x1d')]||null:null,'attributes':_0x4690a6[_0x5b27('0x1b')]?_0x4690a6[_0x5b27('0x1b')][_0x5b27('0x1e')]||null:null,'limit':_0x4690a6[_0x5b27('0x1b')]?_0x4690a6[_0x5b27('0x1b')][_0x5b27('0x1f')]||null:null})[_0x5b27('0x20')](function(_0x430f64){logger[_0x5b27('0x12')](_0x5b27('0x21'),_0x4690a6);logger[_0x5b27('0x22')]('UpdateSmsInteraction',_0x4690a6,JSON[_0x5b27('0x15')](_0x430f64));_0x5c5ee0(_0x430f64);})['catch'](function(_0x50cd46){logger['error'](_0x5b27('0x21'),_0x50cd46[_0x5b27('0x17')],_0x4690a6);_0x4ca0c4(_0x30c99a['error'](0x1f4,_0x50cd46['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x22ea8d){return new Promise(function(_0x4cb534,_0x16072a){return db['SmsInteraction'][_0x5b27('0x23')]({'where':_0x22ea8d[_0x5b27('0x1b')]?_0x22ea8d[_0x5b27('0x1b')][_0x5b27('0x1d')]||null:null})[_0x5b27('0x20')](function(_0x9410d7){if(_0x9410d7){return _0x9410d7[_0x5b27('0x24')](_0x22ea8d[_0x5b27('0x1a')]['ids'],_[_0x5b27('0x25')](_0x22ea8d['body'],[_0x5b27('0x26'),'id'])||{});}})[_0x5b27('0x27')](function(_0x3adc43){logger[_0x5b27('0x12')](_0x5b27('0x28'),_0x22ea8d);logger['debug']('AddTags',_0x22ea8d,JSON['stringify'](_0x3adc43));_0x4cb534(_0x3adc43);})['catch'](function(_0x46d9c1){logger[_0x5b27('0x16')](_0x5b27('0x28'),_0x46d9c1[_0x5b27('0x17')],_0x22ea8d);_0x16072a(_this[_0x5b27('0x16')](0x1f4,_0x46d9c1['message']));});});}; \ No newline at end of file +var _0x18ee=['socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x32b5a8,_0xa3f556){var _0x59b752=function(_0x21d2cc){while(--_0x21d2cc){_0x32b5a8['push'](_0x32b5a8['shift']());}};_0x59b752(++_0xa3f556);}(_0x18ee,0xef));var _0xe18e=function(_0x17ed69,_0x1ee0a9){_0x17ed69=_0x17ed69-0x0;var _0x6776e7=_0x18ee[_0x17ed69];return _0x6776e7;};'use strict';var _=require(_0xe18e('0x0'));var util=require(_0xe18e('0x1'));var moment=require(_0xe18e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe18e('0x3'));var fs=require('fs');var Redis=require(_0xe18e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe18e('0x5'));var logger=require(_0xe18e('0x6'))(_0xe18e('0x7'));var config=require(_0xe18e('0x8'));var jayson=require(_0xe18e('0x9'));var client=jayson[_0xe18e('0xa')]['http']({'port':0x232a});config[_0xe18e('0xb')]=_['defaults'](config[_0xe18e('0xb')],{'host':_0xe18e('0xc'),'port':0x18eb});var socket=require(_0xe18e('0xd'))(new Redis(config[_0xe18e('0xb')]));require(_0xe18e('0xe'))[_0xe18e('0xf')](socket);function respondWithRpcPromise(_0x554367,_0x2aec22,_0x5145e9){return new BPromise(function(_0x22afdd,_0x515eb1){return client[_0xe18e('0x10')](_0x554367,_0x5145e9)[_0xe18e('0x11')](function(_0x41ff58){logger[_0xe18e('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2aec22,_0xe18e('0x13'));logger[_0xe18e('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2aec22,_0xe18e('0x13'),JSON[_0xe18e('0x15')](_0x41ff58));if(_0x41ff58['error']){if(_0x41ff58['error']['code']===0x1f4){logger[_0xe18e('0x16')](_0xe18e('0x17'),_0x2aec22,_0x41ff58[_0xe18e('0x16')][_0xe18e('0x18')]);return _0x515eb1(_0x41ff58[_0xe18e('0x16')][_0xe18e('0x18')]);}logger[_0xe18e('0x16')](_0xe18e('0x17'),_0x2aec22,_0x41ff58[_0xe18e('0x16')][_0xe18e('0x18')]);return _0x22afdd(_0x41ff58[_0xe18e('0x16')][_0xe18e('0x18')]);}else{logger[_0xe18e('0x12')](_0xe18e('0x17'),_0x2aec22,_0xe18e('0x13'));_0x22afdd(_0x41ff58[_0xe18e('0x19')][_0xe18e('0x18')]);}})[_0xe18e('0x1a')](function(_0x4370f9){logger[_0xe18e('0x16')](_0xe18e('0x17'),_0x2aec22,_0x4370f9);_0x515eb1(_0x4370f9);});});}exports['UpdateSmsInteraction']=function(_0x4ef93d){var _0x2fc68f=this;return new Promise(function(_0x343bd8,_0x44e0ad){return db['SmsInteraction'][_0xe18e('0x1b')](_0x4ef93d[_0xe18e('0x1c')],{'raw':_0x4ef93d[_0xe18e('0x1d')]?_0x4ef93d[_0xe18e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ef93d['options']?_0x4ef93d[_0xe18e('0x1d')][_0xe18e('0x1e')]||null:null,'attributes':_0x4ef93d[_0xe18e('0x1d')]?_0x4ef93d[_0xe18e('0x1d')][_0xe18e('0x1f')]||null:null,'limit':_0x4ef93d[_0xe18e('0x1d')]?_0x4ef93d['options'][_0xe18e('0x20')]||null:null})[_0xe18e('0x11')](function(_0x38b126){logger[_0xe18e('0x12')](_0xe18e('0x21'),_0x4ef93d);logger['debug'](_0xe18e('0x21'),_0x4ef93d,JSON[_0xe18e('0x15')](_0x38b126));_0x343bd8(_0x38b126);})[_0xe18e('0x1a')](function(_0x1cc9a4){logger[_0xe18e('0x16')](_0xe18e('0x21'),_0x1cc9a4['message'],_0x4ef93d);_0x44e0ad(_0x2fc68f[_0xe18e('0x16')](0x1f4,_0x1cc9a4[_0xe18e('0x18')]));});});};exports[_0xe18e('0x22')]=function(_0x10b606){return new Promise(function(_0x97a8a0,_0xd3f7e5){return db[_0xe18e('0x23')][_0xe18e('0x24')]({'where':_0x10b606[_0xe18e('0x1d')]?_0x10b606['options'][_0xe18e('0x1e')]||null:null})['then'](function(_0x148996){if(_0x148996){return _0x148996[_0xe18e('0x25')](_0x10b606[_0xe18e('0x1c')][_0xe18e('0x26')],_[_0xe18e('0x27')](_0x10b606['body'],[_0xe18e('0x26'),'id'])||{});}})[_0xe18e('0x28')](function(_0xe00adf){logger[_0xe18e('0x12')]('AddTags',_0x10b606);logger['debug'](_0xe18e('0x29'),_0x10b606,JSON[_0xe18e('0x15')](_0xe00adf));_0x97a8a0(_0xe00adf);})[_0xe18e('0x1a')](function(_0x2a1dc0){logger[_0xe18e('0x16')]('AddTags',_0x2a1dc0['message'],_0x10b606);_0xd3f7e5(_this[_0xe18e('0x16')](0x1f4,_0x2a1dc0['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8201b65..51dd911 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 _0x35f4=['register','length','smsInteraction:','./smsInteraction.events','save','update','emit'];(function(_0xd99bcd,_0x11e7d4){var _0x9c77be=function(_0x126733){while(--_0x126733){_0xd99bcd['push'](_0xd99bcd['shift']());}};_0x9c77be(++_0x11e7d4);}(_0x35f4,0xc7));var _0x435f=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x35f4[_0x1911ed];return _0x11edaa;};'use strict';var SmsInteractionEvents=require(_0x435f('0x0'));var events=[_0x435f('0x1'),'remove',_0x435f('0x2')];function createListener(_0x3e8f80,_0x4096b4){return function(_0x216265){_0x4096b4[_0x435f('0x3')](_0x3e8f80,_0x216265);};}function removeListener(_0x5b8338,_0x17988f){return function(){SmsInteractionEvents['removeListener'](_0x5b8338,_0x17988f);};}exports[_0x435f('0x4')]=function(_0x255e0f){for(var _0x28b6c8=0x0,_0x2e9f89=events[_0x435f('0x5')];_0x28b6c8<_0x2e9f89;_0x28b6c8++){var _0x5530a4=events[_0x28b6c8];var _0x265969=createListener(_0x435f('0x6')+_0x5530a4,_0x255e0f);SmsInteractionEvents['on'](_0x5530a4,_0x265969);}}; \ No newline at end of file +var _0x4e98=['update','emit','removeListener','register','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e98,0x18d));var _0x84e9=function(_0x1764a3,_0x27b90c){_0x1764a3=_0x1764a3-0x0;var _0x229087=_0x4e98[_0x1764a3];return _0x229087;};'use strict';var SmsInteractionEvents=require(_0x84e9('0x0'));var events=[_0x84e9('0x1'),_0x84e9('0x2'),_0x84e9('0x3')];function createListener(_0x54da54,_0x384471){return function(_0x4f761a){_0x384471[_0x84e9('0x4')](_0x54da54,_0x4f761a);};}function removeListener(_0x544791,_0x182fff){return function(){SmsInteractionEvents[_0x84e9('0x5')](_0x544791,_0x182fff);};}exports[_0x84e9('0x6')]=function(_0x5b2dc7){for(var _0x2d61f9=0x0,_0x35ba94=events['length'];_0x2d61f9<_0x35ba94;_0x2d61f9++){var _0x249604=events[_0x2d61f9];var _0x95b3d0=createListener(_0x84e9('0x7')+_0x249604,_0x5b2dc7);SmsInteractionEvents['on'](_0x249604,_0x95b3d0);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index fd66491..91a2e2b 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 _0x7cc0=['describe','/:id','show','post','tracked','smsmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','get','/describe','isAuthenticated'];(function(_0x27ddca,_0x4ab14d){var _0x4be413=function(_0x4e3525){while(--_0x4e3525){_0x27ddca['push'](_0x27ddca['shift']());}};_0x4be413(++_0x4ab14d);}(_0x7cc0,0x96));var _0x07cc=function(_0x459d34,_0x3c66f2){_0x459d34=_0x459d34-0x0;var _0x154781=_0x7cc0[_0x459d34];return _0x154781;};'use strict';var multer=require(_0x07cc('0x0'));var util=require(_0x07cc('0x1'));var path=require(_0x07cc('0x2'));var timeout=require(_0x07cc('0x3'));var express=require(_0x07cc('0x4'));var router=express[_0x07cc('0x5')]();var fs_extra=require(_0x07cc('0x6'));var auth=require(_0x07cc('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x07cc('0x8'));router[_0x07cc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x07cc('0x9')](_0x07cc('0xa'),auth[_0x07cc('0xb')](),controller[_0x07cc('0xc')]);router[_0x07cc('0x9')](_0x07cc('0xd'),auth['isAuthenticated'](),controller[_0x07cc('0xe')]);router[_0x07cc('0xf')]('/',auth[_0x07cc('0xb')](),interaction[_0x07cc('0x10')]('sms',_0x07cc('0x11')),controller[_0x07cc('0x12')]);router[_0x07cc('0xf')]('/:id/status',controller['status']);router[_0x07cc('0x13')](_0x07cc('0xd'),auth['isAuthenticated'](),controller[_0x07cc('0x14')]);router[_0x07cc('0x13')](_0x07cc('0x15'),auth[_0x07cc('0xb')](),controller[_0x07cc('0x16')]);router[_0x07cc('0x13')](_0x07cc('0x17'),auth['isAuthenticated'](),controller[_0x07cc('0x18')]);router['delete'](_0x07cc('0xd'),auth['isAuthenticated'](),controller[_0x07cc('0x19')]);module[_0x07cc('0x1a')]=router; \ No newline at end of file +var _0x1e8b=['tracked','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','/:id'];(function(_0xcbb683,_0x13da0b){var _0x44628b=function(_0x29e87a){while(--_0x29e87a){_0xcbb683['push'](_0xcbb683['shift']());}};_0x44628b(++_0x13da0b);}(_0x1e8b,0x1eb));var _0xb1e8=function(_0x5024d5,_0x41bfb1){_0x5024d5=_0x5024d5-0x0;var _0x51f5a3=_0x1e8b[_0x5024d5];return _0x51f5a3;};'use strict';var multer=require(_0xb1e8('0x0'));var util=require('util');var path=require(_0xb1e8('0x1'));var timeout=require(_0xb1e8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb1e8('0x3'));var auth=require(_0xb1e8('0x4'));var interaction=require(_0xb1e8('0x5'));var config=require(_0xb1e8('0x6'));var controller=require(_0xb1e8('0x7'));router[_0xb1e8('0x8')]('/',auth['isAuthenticated'](),controller[_0xb1e8('0x9')]);router[_0xb1e8('0x8')]('/describe',auth[_0xb1e8('0xa')](),controller[_0xb1e8('0xb')]);router['get'](_0xb1e8('0xc'),auth[_0xb1e8('0xa')](),controller['show']);router['post']('/',auth[_0xb1e8('0xa')](),interaction[_0xb1e8('0xd')]('sms',_0xb1e8('0xe')),controller[_0xb1e8('0xf')]);router[_0xb1e8('0x10')](_0xb1e8('0x11'),controller[_0xb1e8('0x12')]);router[_0xb1e8('0x13')](_0xb1e8('0xc'),auth['isAuthenticated'](),controller[_0xb1e8('0x14')]);router[_0xb1e8('0x13')](_0xb1e8('0x15'),auth[_0xb1e8('0xa')](),controller[_0xb1e8('0x16')]);router['put'](_0xb1e8('0x17'),auth[_0xb1e8('0xa')](),controller[_0xb1e8('0x18')]);router[_0xb1e8('0x19')]('/:id',auth[_0xb1e8('0xa')](),controller[_0xb1e8('0x1a')]);module[_0xb1e8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index cab4c2b..62a6e0b 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 _0xb34e=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x154b4c,_0xa38e2){var _0x100586=function(_0x2912a8){while(--_0x2912a8){_0x154b4c['push'](_0x154b4c['shift']());}};_0x100586(++_0xa38e2);}(_0xb34e,0x181));var _0xeb34=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb34e[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0xeb34('0x0'));module[_0xeb34('0x1')]={'body':{'type':Sequelize[_0xeb34('0x2')](_0xeb34('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xeb34('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb34('0x5')]('in',_0xeb34('0x6')),'defaultValue':_0xeb34('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeb34('0x7')](0xbe)},'phone':{'type':Sequelize[_0xeb34('0x7')]},'readAt':{'type':Sequelize[_0xeb34('0x8')]},'secret':{'type':Sequelize[_0xeb34('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xeb34('0x2')]}}; \ No newline at end of file +var _0xa8eb=['TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3e162a,_0x361a87){var _0x1ef94b=function(_0x19310b){while(--_0x19310b){_0x3e162a['push'](_0x3e162a['shift']());}};_0x1ef94b(++_0x361a87);}(_0xa8eb,0x179));var _0xba8e=function(_0x4d03f4,_0x10ab16){_0x4d03f4=_0x4d03f4-0x0;var _0x59318a=_0xa8eb[_0x4d03f4];return _0x59318a;};'use strict';var Sequelize=require(_0xba8e('0x0'));module['exports']={'body':{'type':Sequelize[_0xba8e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xba8e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba8e('0x3')]('in',_0xba8e('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xba8e('0x5')](0xbe)},'phone':{'type':Sequelize[_0xba8e('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xba8e('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xba8e('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 57c4159..07c98ac 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 _0x2431=['user','UserId','get','SmsInteraction','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','SELECT','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','SmsMessage','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','sms-interactions','accept','sms','readAt','format'];(function(_0x3dbf6b,_0x24ce2c){var _0x475c6a=function(_0x120c2a){while(--_0x120c2a){_0x3dbf6b['push'](_0x3dbf6b['shift']());}};_0x475c6a(++_0x24ce2c);}(_0x2431,0xc9));var _0x1243=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2431[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x1243('0x0'));var rimraf=require(_0x1243('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1243('0x2'));var rp=require(_0x1243('0x3'));var moment=require('moment');var BPromise=require(_0x1243('0x4'));var Mustache=require(_0x1243('0x5'));var util=require(_0x1243('0x6'));var path=require(_0x1243('0x7'));var sox=require(_0x1243('0x8'));var csv=require(_0x1243('0x9'));var ejs=require(_0x1243('0xa'));var fs=require('fs');var fs_extra=require(_0x1243('0xb'));var _=require(_0x1243('0xc'));var squel=require(_0x1243('0xd'));var crypto=require(_0x1243('0xe'));var jsforce=require(_0x1243('0xf'));var deskjs=require(_0x1243('0x10'));var toCsv=require(_0x1243('0x9'));var querystring=require('querystring');var Papa=require(_0x1243('0x11'));var Redis=require(_0x1243('0x12'));var authService=require(_0x1243('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1243('0x14'));var hardwareService=require(_0x1243('0x15'));var logger=require(_0x1243('0x16'))(_0x1243('0x17'));var utils=require(_0x1243('0x18'));var config=require(_0x1243('0x19'));var licenseUtil=require(_0x1243('0x1a'));var db=require(_0x1243('0x1b'))['db'];config['redis']=_[_0x1243('0x1c')](config[_0x1243('0x1d')],{'host':_0x1243('0x1e'),'port':0x18eb});var socket=require(_0x1243('0x1f'))(new Redis(config[_0x1243('0x1d')]));require(_0x1243('0x20'))[_0x1243('0x21')](socket);var jayson=require(_0x1243('0x22'));var client=jayson[_0x1243('0x23')][_0x1243('0x24')]({'port':0x232c});var client9002=jayson[_0x1243('0x23')][_0x1243('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3d8428,_0x376a47,_0x59ad0e,_0x1400d9){return new BPromise(function(_0x49af55,_0x108e91){var _0x4dec1e=_0x1400d9||client;return _0x4dec1e[_0x1243('0x25')](_0x3d8428,_0x59ad0e)[_0x1243('0x26')](function(_0x29be66){logger[_0x1243('0x27')](_0x1243('0x28'),_0x376a47,_0x1243('0x29'));logger[_0x1243('0x2a')](_0x1243('0x2b'),_0x376a47,'request\x20sent',JSON['stringify'](_0x29be66));if(_0x29be66[_0x1243('0x2c')]){if(_0x29be66[_0x1243('0x2c')][_0x1243('0x2d')]===0x1f4){logger[_0x1243('0x2c')](_0x1243('0x28'),_0x376a47,_0x29be66['error']['message']);return _0x108e91(_0x29be66['error']['message']);}logger['error'](_0x1243('0x28'),_0x376a47,_0x29be66[_0x1243('0x2c')][_0x1243('0x2e')]);return _0x49af55(_0x29be66[_0x1243('0x2c')][_0x1243('0x2e')]);}else{logger[_0x1243('0x27')](_0x1243('0x28'),_0x376a47,'request\x20sent');_0x49af55(_0x29be66['result']['message']);}})['catch'](function(_0x1cf67c){logger[_0x1243('0x2c')](_0x1243('0x28'),_0x376a47,_0x1cf67c);_0x108e91(_0x1cf67c);});});}function respondWithStatusCode(_0x556cfd,_0x4fa15d){_0x4fa15d=_0x4fa15d||0xcc;return function(_0x390b9c){if(_0x390b9c){return _0x556cfd['sendStatus'](_0x4fa15d);}return _0x556cfd[_0x1243('0x2f')](_0x4fa15d)[_0x1243('0x30')]();};}function respondWithResult(_0x1fa82f,_0x44e8b8){_0x44e8b8=_0x44e8b8||0xc8;return function(_0x2cf8b8){if(_0x2cf8b8){return _0x1fa82f[_0x1243('0x2f')](_0x44e8b8)['json'](_0x2cf8b8);}};}function respondWithFilteredResult(_0x1499a2,_0x28bb8b){return function(_0x341d55){if(_0x341d55){var _0x36f424=typeof _0x28bb8b[_0x1243('0x31')]===_0x1243('0x32')&&typeof _0x28bb8b[_0x1243('0x33')]===_0x1243('0x32');var _0x33f58a=_0x341d55['count'];var _0x3d6ba3=_0x36f424?0x0:_0x28bb8b['offset'];var _0x3e9dc1=_0x36f424?_0x341d55[_0x1243('0x34')]:_0x28bb8b[_0x1243('0x31')]+_0x28bb8b[_0x1243('0x33')];var _0x2b2378;if(_0x3e9dc1>=_0x33f58a){_0x3e9dc1=_0x33f58a;_0x2b2378=0xc8;}else{_0x2b2378=0xce;}_0x1499a2[_0x1243('0x2f')](_0x2b2378);return _0x1499a2[_0x1243('0x35')](_0x1243('0x36'),_0x3d6ba3+'-'+_0x3e9dc1+'/'+_0x33f58a)[_0x1243('0x37')](_0x341d55);}return null;};}function patchUpdates(_0x5c3f85){return function(_0x2643b8){try{jsonpatch['apply'](_0x2643b8,_0x5c3f85,!![]);}catch(_0x37c02f){return BPromise[_0x1243('0x38')](_0x37c02f);}return _0x2643b8[_0x1243('0x39')]();};}function saveUpdates(_0x193f25,_0x5ef820){return function(_0x857273){if(_0x857273){return _0x857273[_0x1243('0x3a')](_0x193f25)[_0x1243('0x26')](function(_0x3a0efd){return _0x3a0efd;});}return null;};}function removeEntity(_0x2c4f38,_0xa9550c){return function(_0x4770dc){if(_0x4770dc){return _0x4770dc[_0x1243('0x3b')]()[_0x1243('0x26')](function(){_0x2c4f38['status'](0xcc)[_0x1243('0x30')]();});}};}function handleEntityNotFound(_0x30b9ba,_0x57013d){return function(_0x348b68){if(!_0x348b68){_0x30b9ba[_0x1243('0x3c')](0x194);}return _0x348b68;};}function handleError(_0x1a12d1,_0x156ef3){_0x156ef3=_0x156ef3||0x1f4;return function(_0x5c7967){logger['error'](_0x5c7967[_0x1243('0x3d')]);if(_0x5c7967['name']){delete _0x5c7967[_0x1243('0x3e')];}_0x1a12d1['status'](_0x156ef3)[_0x1243('0x3f')](_0x5c7967);};}exports['index']=function(_0x4a5ddb,_0x3c9d36){var _0x51ec09={},_0x2b47c6={},_0x3be51f={'count':0x0,'rows':[]};var _0x15d40a=_['map'](db[_0x1243('0x40')][_0x1243('0x41')],function(_0x14b6ab){return{'name':_0x14b6ab['fieldName'],'type':_0x14b6ab['type'][_0x1243('0x42')]};});_0x2b47c6[_0x1243('0x43')]=_[_0x1243('0x44')](_0x15d40a,_0x1243('0x3e'));_0x2b47c6[_0x1243('0x45')]=_[_0x1243('0x46')](_0x4a5ddb[_0x1243('0x45')]);_0x2b47c6[_0x1243('0x47')]=_[_0x1243('0x48')](_0x2b47c6['model'],_0x2b47c6[_0x1243('0x45')]);_0x51ec09[_0x1243('0x49')]=_[_0x1243('0x48')](_0x2b47c6[_0x1243('0x43')],qs['fields'](_0x4a5ddb[_0x1243('0x45')][_0x1243('0x4a')]));_0x51ec09[_0x1243('0x49')]=_0x51ec09[_0x1243('0x49')][_0x1243('0x4b')]?_0x51ec09['attributes']:_0x2b47c6[_0x1243('0x43')];if(!_0x4a5ddb['query']['hasOwnProperty'](_0x1243('0x4c'))){_0x51ec09[_0x1243('0x33')]=qs[_0x1243('0x33')](_0x4a5ddb[_0x1243('0x45')]['limit']);_0x51ec09[_0x1243('0x31')]=qs[_0x1243('0x31')](_0x4a5ddb[_0x1243('0x45')][_0x1243('0x31')]);}_0x51ec09[_0x1243('0x4d')]=qs['sort'](_0x4a5ddb[_0x1243('0x45')]['sort']);_0x51ec09[_0x1243('0x4e')]=qs[_0x1243('0x47')](_['pick'](_0x4a5ddb[_0x1243('0x45')],_0x2b47c6[_0x1243('0x47')]),_0x15d40a);if(_0x4a5ddb[_0x1243('0x45')]['filter']){_0x51ec09['where']=_['merge'](_0x51ec09[_0x1243('0x4e')],{'$or':_[_0x1243('0x44')](_0x15d40a,function(_0x2ef7fb){if(_0x2ef7fb['type']!=='VIRTUAL'){var _0x221981={};_0x221981[_0x2ef7fb[_0x1243('0x3e')]]={'$like':'%'+_0x4a5ddb[_0x1243('0x45')]['filter']+'%'};return _0x221981;}})});}_0x51ec09=_[_0x1243('0x4f')]({},_0x51ec09,_0x4a5ddb[_0x1243('0x50')]);var _0x1b19ea={'where':_0x51ec09[_0x1243('0x4e')]};return db['SmsMessage'][_0x1243('0x34')](_0x1b19ea)['then'](function(_0x2b56b0){_0x3be51f[_0x1243('0x34')]=_0x2b56b0;if(_0x4a5ddb['query'][_0x1243('0x51')]){_0x51ec09[_0x1243('0x52')]=[{'all':!![]}];}return db[_0x1243('0x40')][_0x1243('0x53')](_0x51ec09);})[_0x1243('0x26')](function(_0x227b36){_0x3be51f['rows']=_0x227b36;return _0x3be51f;})[_0x1243('0x26')](respondWithFilteredResult(_0x3c9d36,_0x51ec09))[_0x1243('0x54')](handleError(_0x3c9d36,null));};exports['show']=function(_0x4626af,_0x381ff1){var _0x2d74c0={'raw':!![],'where':{'id':_0x4626af[_0x1243('0x55')]['id']}},_0x22c945={};_0x22c945['model']=_[_0x1243('0x46')](db[_0x1243('0x40')][_0x1243('0x41')]);_0x22c945[_0x1243('0x45')]=_[_0x1243('0x46')](_0x4626af[_0x1243('0x45')]);_0x22c945[_0x1243('0x47')]=_['intersection'](_0x22c945[_0x1243('0x43')],_0x22c945['query']);_0x2d74c0[_0x1243('0x49')]=_[_0x1243('0x48')](_0x22c945[_0x1243('0x43')],qs[_0x1243('0x4a')](_0x4626af[_0x1243('0x45')][_0x1243('0x4a')]));_0x2d74c0['attributes']=_0x2d74c0[_0x1243('0x49')][_0x1243('0x4b')]?_0x2d74c0[_0x1243('0x49')]:_0x22c945[_0x1243('0x43')];if(_0x4626af[_0x1243('0x45')]['includeAll']){_0x2d74c0[_0x1243('0x52')]=[{'all':!![]}];}_0x2d74c0=_['merge']({},_0x2d74c0,_0x4626af[_0x1243('0x50')]);return db[_0x1243('0x40')][_0x1243('0x56')](_0x2d74c0)['then'](handleEntityNotFound(_0x381ff1,null))[_0x1243('0x26')](respondWithResult(_0x381ff1,null))['catch'](handleError(_0x381ff1,null));};exports['create']=function(_0x4c8f41,_0x3d2829){return db[_0x1243('0x40')][_0x1243('0x57')](_0x4c8f41['body'],{})[_0x1243('0x26')](respondWithResult(_0x3d2829,0xc9))[_0x1243('0x54')](handleError(_0x3d2829,null));};exports[_0x1243('0x3a')]=function(_0x5e35d7,_0x522121){if(_0x5e35d7[_0x1243('0x58')]['id']){delete _0x5e35d7[_0x1243('0x58')]['id'];}return db[_0x1243('0x40')][_0x1243('0x56')]({'where':{'id':_0x5e35d7[_0x1243('0x55')]['id']}})[_0x1243('0x26')](handleEntityNotFound(_0x522121,null))['then'](saveUpdates(_0x5e35d7[_0x1243('0x58')],null))['then'](respondWithResult(_0x522121,null))[_0x1243('0x54')](handleError(_0x522121,null));};exports[_0x1243('0x3b')]=function(_0x1529a4,_0x48b956){return db[_0x1243('0x40')][_0x1243('0x56')]({'where':{'id':_0x1529a4[_0x1243('0x55')]['id']}})[_0x1243('0x26')](handleEntityNotFound(_0x48b956,null))[_0x1243('0x26')](removeEntity(_0x48b956,null))[_0x1243('0x54')](handleError(_0x48b956,null));};exports[_0x1243('0x59')]=function(_0x5a7b79,_0x514679){return db['SmsMessage'][_0x1243('0x59')]()[_0x1243('0x26')](respondWithResult(_0x514679,null))['catch'](handleError(_0x514679,null));};var interaction_log=require(_0x1243('0x16'))(_0x1243('0x5a'));exports[_0x1243('0x5b')]=function(_0x133c60,_0x29f68d,_0x4084e3){var _0x5378ea={'agent':{},'channel':_0x1243('0x5c')};if(_0x133c60[_0x1243('0x58')]['id']){delete _0x133c60[_0x1243('0x58')]['id'];}_0x133c60['body']['read']=!![];_0x133c60[_0x1243('0x58')][_0x1243('0x5d')]=moment()[_0x1243('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x133c60[_0x1243('0x58')]['UserId']=_0x133c60[_0x1243('0x58')]['UserId']||_0x133c60[_0x1243('0x5f')]['id'];_0x5378ea['agent']['id']=_0x133c60['body'][_0x1243('0x60')];return db[_0x1243('0x40')][_0x1243('0x56')]({'where':{'id':_0x133c60[_0x1243('0x55')]['id'],'UserId':null}})[_0x1243('0x26')](handleEntityNotFound(_0x29f68d,null))[_0x1243('0x26')](saveUpdates(_0x133c60[_0x1243('0x58')],null))[_0x1243('0x26')](function(_0x1c3669){if(_0x1c3669){_0x5378ea['message']=_0x1c3669[_0x1243('0x61')]({'plain':!![]});return db[_0x1243('0x62')][_0x1243('0x56')]({'where':{'id':_0x1c3669[_0x1243('0x63')]}});}return null;})[_0x1243('0x26')](handleEntityNotFound(_0x29f68d,null))[_0x1243('0x26')](function(_0xa7e89c){if(_0xa7e89c){return _0xa7e89c['update']({'UserId':_0x133c60[_0x1243('0x58')][_0x1243('0x60')],'read1stAt':_[_0x1243('0x64')](_0xa7e89c['read1stAt'])?moment()[_0x1243('0x5e')](_0x1243('0x65')):undefined});}return null;})[_0x1243('0x26')](function(_0x58954a){if(_0x58954a){_0x5378ea[_0x1243('0x66')]=_0x58954a[_0x1243('0x61')]({'plain':!![]});interaction_log[_0x1243('0x27')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x133c60[_0x1243('0x5f')]['id'],_0x133c60[_0x1243('0x5f')][_0x1243('0x3e')],_0x133c60[_0x1243('0x5f')][_0x1243('0x67')],_0x5378ea[_0x1243('0x66')]['id'],_0x133c60['body']?JSON[_0x1243('0x68')](_0x133c60[_0x1243('0x58')]):_0x1243('0x69'));return respondWithRpcPromise(_0x1243('0x6a'),'acceptMessage',_0x5378ea);}return null;})[_0x1243('0x26')](function(_0x4a463a){var _0x17fc43=_0x1243('0x6b')+_0x4a463a['message']['ContactId'];return db['sequelize']['query'](_0x17fc43,{'type':db['Sequelize'][_0x1243('0x6c')]['SELECT'],'raw':!![]})[_0x1243('0x26')](function(_0x916bf0){return _0x916bf0;});})['then'](function(_0x805c73){if(_0x805c73){_0x5378ea[_0x1243('0x2e')][_0x1243('0x6d')]=_0x805c73[0x0];if(!_0x133c60[_0x1243('0x58')][_0x1243('0x60')])return;return db[_0x1243('0x6e')][_0x1243('0x56')]({'where':{'id':_0x133c60[_0x1243('0x58')]['UserId'],'role':_0x1243('0x6f')},'attributes':['id',_0x1243('0x3e'),_0x1243('0x70'),_0x1243('0x71'),_0x1243('0x72')],'raw':!![]});}return null;})[_0x1243('0x26')](function(_0x667c97){if(!_0x667c97)return null;_0x5378ea[_0x1243('0x2e')][_0x1243('0x6f')]=_0x667c97;return _0x5378ea;})[_0x1243('0x26')](function(_0x540221){if(_0x540221){if(_0x133c60[_0x1243('0x58')][_0x1243('0x73')]){_0x5378ea[_0x1243('0x2e')][_0x1243('0x74')]=util[_0x1243('0x5e')](_0x1243('0x75'),_0x133c60['user'][_0x1243('0x3e')]);_0x5378ea[_0x1243('0x2e')][_0x1243('0x76')]=_0x5378ea[_0x1243('0x76')];_0x5378ea['message'][_0x1243('0x77')]=_0x5378ea[_0x1243('0x76')];_0x5378ea[_0x1243('0x2e')][_0x1243('0x78')]='accept';return respondWithRpcPromise(_0x1243('0x79'),_0x1243('0x79'),{'event':_0x1243('0x7a'),'message':_0x5378ea[_0x1243('0x2e')]},client9002)[_0x1243('0x26')](function(){return _0x5378ea;});}return _0x5378ea;}return null;})['then'](respondWithResult(_0x29f68d,null))[_0x1243('0x54')](handleError(_0x29f68d,null));};var interaction_log=require(_0x1243('0x16'))(_0x1243('0x5a'));exports[_0x1243('0x38')]=function(_0x28a4a6,_0x487431,_0x2d8090){var _0x3d5b7d={'agent':{},'channel':_0x1243('0x5c')};if(_0x28a4a6[_0x1243('0x58')]['id']){delete _0x28a4a6[_0x1243('0x58')]['id'];}_0x28a4a6[_0x1243('0x58')][_0x1243('0x60')]=_0x28a4a6['body'][_0x1243('0x60')]||_0x28a4a6[_0x1243('0x5f')]['id'];_0x3d5b7d[_0x1243('0x6f')]['id']=_0x28a4a6[_0x1243('0x58')][_0x1243('0x60')];return db[_0x1243('0x40')][_0x1243('0x56')]({'where':{'id':_0x28a4a6['params']['id'],'UserId':null}})[_0x1243('0x26')](handleEntityNotFound(_0x487431,null))[_0x1243('0x26')](function(_0x4b0d4c){if(_0x4b0d4c){_0x3d5b7d[_0x1243('0x2e')]=_0x4b0d4c[_0x1243('0x61')]({'plain':!![]});return db[_0x1243('0x62')][_0x1243('0x56')]({'where':{'id':_0x4b0d4c[_0x1243('0x63')]}});}return null;})[_0x1243('0x26')](handleEntityNotFound(_0x487431,null))[_0x1243('0x26')](function(_0x3fc6ee){if(_0x3fc6ee){_0x3d5b7d[_0x1243('0x66')]=_0x3fc6ee[_0x1243('0x61')]({'plain':!![]});interaction_log[_0x1243('0x27')](_0x1243('0x7b'),_0x28a4a6[_0x1243('0x5f')]['id'],_0x28a4a6[_0x1243('0x5f')][_0x1243('0x3e')],_0x28a4a6[_0x1243('0x5f')]['role'],_0x3d5b7d[_0x1243('0x66')]['id'],_0x28a4a6[_0x1243('0x58')]?JSON[_0x1243('0x68')](_0x28a4a6[_0x1243('0x58')]):_0x1243('0x69'));return respondWithRpcPromise(_0x1243('0x7c'),_0x1243('0x7d'),_0x3d5b7d);}return null;})[_0x1243('0x26')](function(_0x5eda5f){var _0x49d26e=_0x1243('0x6b')+_0x5eda5f[_0x1243('0x2e')][_0x1243('0x7e')];return db[_0x1243('0x7f')][_0x1243('0x45')](_0x49d26e,{'type':db['Sequelize']['QueryTypes'][_0x1243('0x80')],'raw':!![]})['then'](function(_0x5e5833){return _0x5e5833;});})[_0x1243('0x26')](function(_0x2339da){if(_0x2339da){_0x3d5b7d[_0x1243('0x2e')]['contact']=_0x2339da[0x0];if(!_0x28a4a6[_0x1243('0x58')][_0x1243('0x60')])return;return db[_0x1243('0x6e')][_0x1243('0x56')]({'where':{'id':_0x28a4a6[_0x1243('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x1243('0x3e'),_0x1243('0x70'),_0x1243('0x71'),_0x1243('0x72')],'raw':!![]});}return null;})[_0x1243('0x26')](function(_0x220d54){if(!_0x220d54)return null;_0x3d5b7d[_0x1243('0x2e')][_0x1243('0x6f')]=_0x220d54;return _0x3d5b7d;})[_0x1243('0x26')](function(_0x14929b){if(_0x14929b){_0x14929b[_0x1243('0x2e')][_0x1243('0x74')]=util[_0x1243('0x5e')]('SIP/%s',_0x28a4a6[_0x1243('0x5f')][_0x1243('0x3e')]);_0x14929b['message'][_0x1243('0x76')]=_0x3d5b7d[_0x1243('0x76')];_0x14929b[_0x1243('0x2e')][_0x1243('0x77')]=_0x3d5b7d[_0x1243('0x76')];_0x14929b[_0x1243('0x2e')][_0x1243('0x78')]=_0x1243('0x38');respondWithRpcPromise(_0x1243('0x79'),_0x1243('0x79'),{'event':_0x1243('0x81'),'message':_0x14929b[_0x1243('0x2e')]},client9002);return _0x3d5b7d;}return null;})[_0x1243('0x26')](respondWithResult(_0x487431,null))['catch'](handleError(_0x487431,null));};exports[_0x1243('0x2f')]=function(_0x35ccff,_0x1f74dc,_0xa26ec2){if(_0x35ccff[_0x1243('0x58')]['id']){delete _0x35ccff[_0x1243('0x58')]['id'];}var _0x50eb80;return db[_0x1243('0x40')][_0x1243('0x56')]({'where':{'id':_0x35ccff['params']['id']}})[_0x1243('0x26')](handleEntityNotFound(_0x1f74dc,null))[_0x1243('0x26')](function(_0x5cfc2a){if(_0x5cfc2a){_0x50eb80=_0x5cfc2a;return db[_0x1243('0x82')][_0x1243('0x56')]({'where':{'id':_0x5cfc2a[_0x1243('0x83')]}});}})[_0x1243('0x26')](handleEntityNotFound(_0x1f74dc,null))[_0x1243('0x26')](function(_0x3ace40){if(_0x3ace40){logger['debug'](_0x1243('0x2b'),_0x1243('0x2f'),_0x1243('0x84'),_0x3ace40[_0x1243('0x85')],util[_0x1243('0x86')](_0x35ccff[_0x1243('0x58')],{'showHidden':![],'depth':null}));switch(_0x3ace40['type']){case'twilio':if(_0x35ccff[_0x1243('0x58')][_0x1243('0x87')]&&_0x35ccff[_0x1243('0x58')][_0x1243('0x87')]===_0x50eb80[_0x1243('0x88')]){return _0x50eb80[_0x1243('0x3a')]({'read':!![]});}else{logger[_0x1243('0x2c')](_0x1243('0x89'),_0x1243('0x2f'),_0x1243('0x8a'),util[_0x1243('0x86')](_0x35ccff['body'],{'showHidden':![],'depth':null}));}break;case _0x1243('0x8b'):if(_0x35ccff[_0x1243('0x58')]['MessageUUID']&&_0x35ccff['body']['MessageUUID']===_0x50eb80[_0x1243('0x88')]&&_[_0x1243('0x8c')]([_0x1243('0x8d'),_0x1243('0x8e')],_0x35ccff[_0x1243('0x58')][_0x1243('0x8f')])>=0x0){return _0x50eb80[_0x1243('0x3a')]({'read':!![]});}else{logger['error'](_0x1243('0x89'),_0x1243('0x2f'),_0x1243('0x90'),util[_0x1243('0x86')](_0x35ccff[_0x1243('0x58')],{'showHidden':![],'depth':null}));}break;case _0x1243('0x91'):var _0x29ee57=_0x35ccff['body']['results'][0x0];if(_0x29ee57[_0x1243('0x2f')][_0x1243('0x92')]===_0x1243('0x93')){return _0x50eb80[_0x1243('0x3a')]({'read':!![]});}else{logger[_0x1243('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1243('0x2f'),_0x1243('0x91'),util['inspect'](_0x35ccff[_0x1243('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x50eb80;}})[_0x1243('0x26')](respondWithResult(_0x1f74dc,null))['catch'](handleError(_0x1f74dc,null));}; \ No newline at end of file +var _0xeaa0=['findAll','rows','show','length','options','find','create','body','update','params','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','get','null','RejectMessage','rejectMessage','sequelize','User','email','event','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','indexOf','Status','plivio','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','reject','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeaa0,0x16e));var _0x0eaa=function(_0x4efb4a,_0x43bd7a){_0x4efb4a=_0x4efb4a-0x0;var _0x265085=_0xeaa0[_0x4efb4a];return _0x265085;};'use strict';var emlformat=require(_0x0eaa('0x0'));var rimraf=require(_0x0eaa('0x1'));var zipdir=require(_0x0eaa('0x2'));var jsonpatch=require(_0x0eaa('0x3'));var rp=require(_0x0eaa('0x4'));var moment=require('moment');var BPromise=require(_0x0eaa('0x5'));var Mustache=require(_0x0eaa('0x6'));var util=require('util');var path=require(_0x0eaa('0x7'));var sox=require(_0x0eaa('0x8'));var csv=require(_0x0eaa('0x9'));var ejs=require(_0x0eaa('0xa'));var fs=require('fs');var fs_extra=require(_0x0eaa('0xb'));var _=require('lodash');var squel=require(_0x0eaa('0xc'));var crypto=require(_0x0eaa('0xd'));var jsforce=require(_0x0eaa('0xe'));var deskjs=require(_0x0eaa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0eaa('0x10'));var Papa=require(_0x0eaa('0x11'));var Redis=require(_0x0eaa('0x12'));var authService=require(_0x0eaa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0eaa('0x14'));var hardwareService=require(_0x0eaa('0x15'));var logger=require(_0x0eaa('0x16'))('api');var utils=require(_0x0eaa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0eaa('0x18'));var db=require(_0x0eaa('0x19'))['db'];config['redis']=_[_0x0eaa('0x1a')](config[_0x0eaa('0x1b')],{'host':_0x0eaa('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0eaa('0x1b')]));require(_0x0eaa('0x1d'))[_0x0eaa('0x1e')](socket);var jayson=require(_0x0eaa('0x1f'));var client=jayson[_0x0eaa('0x20')][_0x0eaa('0x21')]({'port':0x232c});var client9002=jayson[_0x0eaa('0x20')][_0x0eaa('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1e7a37,_0x340168,_0x35b866,_0x46b2bb){return new BPromise(function(_0x289166,_0x411687){var _0x337ac4=_0x46b2bb||client;return _0x337ac4[_0x0eaa('0x22')](_0x1e7a37,_0x35b866)[_0x0eaa('0x23')](function(_0x349b5a){logger[_0x0eaa('0x24')](_0x0eaa('0x25'),_0x340168,'request\x20sent');logger[_0x0eaa('0x26')](_0x0eaa('0x27'),_0x340168,_0x0eaa('0x28'),JSON['stringify'](_0x349b5a));if(_0x349b5a[_0x0eaa('0x29')]){if(_0x349b5a[_0x0eaa('0x29')][_0x0eaa('0x2a')]===0x1f4){logger['error'](_0x0eaa('0x25'),_0x340168,_0x349b5a['error'][_0x0eaa('0x2b')]);return _0x411687(_0x349b5a[_0x0eaa('0x29')][_0x0eaa('0x2b')]);}logger[_0x0eaa('0x29')](_0x0eaa('0x25'),_0x340168,_0x349b5a[_0x0eaa('0x29')]['message']);return _0x289166(_0x349b5a['error'][_0x0eaa('0x2b')]);}else{logger[_0x0eaa('0x24')](_0x0eaa('0x25'),_0x340168,'request\x20sent');_0x289166(_0x349b5a[_0x0eaa('0x2c')][_0x0eaa('0x2b')]);}})[_0x0eaa('0x2d')](function(_0x466781){logger[_0x0eaa('0x29')](_0x0eaa('0x25'),_0x340168,_0x466781);_0x411687(_0x466781);});});}function respondWithStatusCode(_0x4bd060,_0x225c34){_0x225c34=_0x225c34||0xcc;return function(_0x52b3f4){if(_0x52b3f4){return _0x4bd060[_0x0eaa('0x2e')](_0x225c34);}return _0x4bd060[_0x0eaa('0x2f')](_0x225c34)[_0x0eaa('0x30')]();};}function respondWithResult(_0x5c0b1f,_0x21d7e7){_0x21d7e7=_0x21d7e7||0xc8;return function(_0x463fbd){if(_0x463fbd){return _0x5c0b1f[_0x0eaa('0x2f')](_0x21d7e7)[_0x0eaa('0x31')](_0x463fbd);}};}function respondWithFilteredResult(_0x22dfe1,_0x5eabe1){return function(_0xc03a90){if(_0xc03a90){var _0x1ea242=typeof _0x5eabe1['offset']==='undefined'&&typeof _0x5eabe1[_0x0eaa('0x32')]===_0x0eaa('0x33');var _0x8b1b50=_0xc03a90['count'];var _0x49a18b=_0x1ea242?0x0:_0x5eabe1['offset'];var _0x2ab268=_0x1ea242?_0xc03a90[_0x0eaa('0x34')]:_0x5eabe1['offset']+_0x5eabe1['limit'];var _0x2af48d;if(_0x2ab268>=_0x8b1b50){_0x2ab268=_0x8b1b50;_0x2af48d=0xc8;}else{_0x2af48d=0xce;}_0x22dfe1[_0x0eaa('0x2f')](_0x2af48d);return _0x22dfe1['set']('Content-Range',_0x49a18b+'-'+_0x2ab268+'/'+_0x8b1b50)[_0x0eaa('0x31')](_0xc03a90);}return null;};}function patchUpdates(_0x34b04d){return function(_0xf0c112){try{jsonpatch['apply'](_0xf0c112,_0x34b04d,!![]);}catch(_0x135355){return BPromise[_0x0eaa('0x35')](_0x135355);}return _0xf0c112['save']();};}function saveUpdates(_0x2de232,_0x2415a4){return function(_0xbd7c1f){if(_0xbd7c1f){return _0xbd7c1f['update'](_0x2de232)[_0x0eaa('0x23')](function(_0x3c118c){return _0x3c118c;});}return null;};}function removeEntity(_0x16c50d,_0x1d97d4){return function(_0x317569){if(_0x317569){return _0x317569[_0x0eaa('0x36')]()[_0x0eaa('0x23')](function(){_0x16c50d[_0x0eaa('0x2f')](0xcc)[_0x0eaa('0x30')]();});}};}function handleEntityNotFound(_0x232b52,_0x2e846b){return function(_0x3fedd6){if(!_0x3fedd6){_0x232b52[_0x0eaa('0x2e')](0x194);}return _0x3fedd6;};}function handleError(_0x287e40,_0xb939a4){_0xb939a4=_0xb939a4||0x1f4;return function(_0x32e585){logger['error'](_0x32e585[_0x0eaa('0x37')]);if(_0x32e585[_0x0eaa('0x38')]){delete _0x32e585[_0x0eaa('0x38')];}_0x287e40['status'](_0xb939a4)[_0x0eaa('0x39')](_0x32e585);};}exports[_0x0eaa('0x3a')]=function(_0x2fd80e,_0x5b3906){var _0x14003d={},_0x49afc4={},_0xd04340={'count':0x0,'rows':[]};var _0x1ad7c1=_[_0x0eaa('0x3b')](db[_0x0eaa('0x3c')][_0x0eaa('0x3d')],function(_0x159cf4){return{'name':_0x159cf4[_0x0eaa('0x3e')],'type':_0x159cf4[_0x0eaa('0x3f')][_0x0eaa('0x40')]};});_0x49afc4[_0x0eaa('0x41')]=_[_0x0eaa('0x3b')](_0x1ad7c1,_0x0eaa('0x38'));_0x49afc4[_0x0eaa('0x42')]=_[_0x0eaa('0x43')](_0x2fd80e['query']);_0x49afc4[_0x0eaa('0x44')]=_[_0x0eaa('0x45')](_0x49afc4[_0x0eaa('0x41')],_0x49afc4['query']);_0x14003d['attributes']=_[_0x0eaa('0x45')](_0x49afc4['model'],qs[_0x0eaa('0x46')](_0x2fd80e[_0x0eaa('0x42')][_0x0eaa('0x46')]));_0x14003d[_0x0eaa('0x47')]=_0x14003d[_0x0eaa('0x47')]['length']?_0x14003d[_0x0eaa('0x47')]:_0x49afc4[_0x0eaa('0x41')];if(!_0x2fd80e['query'][_0x0eaa('0x48')](_0x0eaa('0x49'))){_0x14003d[_0x0eaa('0x32')]=qs['limit'](_0x2fd80e['query'][_0x0eaa('0x32')]);_0x14003d['offset']=qs[_0x0eaa('0x4a')](_0x2fd80e[_0x0eaa('0x42')][_0x0eaa('0x4a')]);}_0x14003d[_0x0eaa('0x4b')]=qs['sort'](_0x2fd80e[_0x0eaa('0x42')][_0x0eaa('0x4c')]);_0x14003d[_0x0eaa('0x4d')]=qs[_0x0eaa('0x44')](_[_0x0eaa('0x4e')](_0x2fd80e[_0x0eaa('0x42')],_0x49afc4[_0x0eaa('0x44')]),_0x1ad7c1);if(_0x2fd80e[_0x0eaa('0x42')][_0x0eaa('0x4f')]){_0x14003d[_0x0eaa('0x4d')]=_[_0x0eaa('0x50')](_0x14003d['where'],{'$or':_[_0x0eaa('0x3b')](_0x1ad7c1,function(_0x1fb322){if(_0x1fb322[_0x0eaa('0x3f')]!==_0x0eaa('0x51')){var _0xa9aef9={};_0xa9aef9[_0x1fb322[_0x0eaa('0x38')]]={'$like':'%'+_0x2fd80e[_0x0eaa('0x42')][_0x0eaa('0x4f')]+'%'};return _0xa9aef9;}})});}_0x14003d=_[_0x0eaa('0x50')]({},_0x14003d,_0x2fd80e['options']);var _0x3c8935={'where':_0x14003d[_0x0eaa('0x4d')]};return db[_0x0eaa('0x3c')]['count'](_0x3c8935)[_0x0eaa('0x23')](function(_0x51bfb6){_0xd04340[_0x0eaa('0x34')]=_0x51bfb6;if(_0x2fd80e['query'][_0x0eaa('0x52')]){_0x14003d[_0x0eaa('0x53')]=[{'all':!![]}];}return db[_0x0eaa('0x3c')][_0x0eaa('0x54')](_0x14003d);})[_0x0eaa('0x23')](function(_0x1c04b6){_0xd04340[_0x0eaa('0x55')]=_0x1c04b6;return _0xd04340;})[_0x0eaa('0x23')](respondWithFilteredResult(_0x5b3906,_0x14003d))[_0x0eaa('0x2d')](handleError(_0x5b3906,null));};exports[_0x0eaa('0x56')]=function(_0x2fb05e,_0x42f412){var _0x5efce5={'raw':!![],'where':{'id':_0x2fb05e['params']['id']}},_0x55fbd9={};_0x55fbd9[_0x0eaa('0x41')]=_[_0x0eaa('0x43')](db[_0x0eaa('0x3c')]['rawAttributes']);_0x55fbd9[_0x0eaa('0x42')]=_[_0x0eaa('0x43')](_0x2fb05e[_0x0eaa('0x42')]);_0x55fbd9[_0x0eaa('0x44')]=_[_0x0eaa('0x45')](_0x55fbd9['model'],_0x55fbd9['query']);_0x5efce5[_0x0eaa('0x47')]=_['intersection'](_0x55fbd9['model'],qs[_0x0eaa('0x46')](_0x2fb05e[_0x0eaa('0x42')]['fields']));_0x5efce5[_0x0eaa('0x47')]=_0x5efce5[_0x0eaa('0x47')][_0x0eaa('0x57')]?_0x5efce5['attributes']:_0x55fbd9[_0x0eaa('0x41')];if(_0x2fb05e['query'][_0x0eaa('0x52')]){_0x5efce5[_0x0eaa('0x53')]=[{'all':!![]}];}_0x5efce5=_['merge']({},_0x5efce5,_0x2fb05e[_0x0eaa('0x58')]);return db[_0x0eaa('0x3c')][_0x0eaa('0x59')](_0x5efce5)[_0x0eaa('0x23')](handleEntityNotFound(_0x42f412,null))[_0x0eaa('0x23')](respondWithResult(_0x42f412,null))[_0x0eaa('0x2d')](handleError(_0x42f412,null));};exports['create']=function(_0x48b1f1,_0x55f4ab){return db[_0x0eaa('0x3c')][_0x0eaa('0x5a')](_0x48b1f1[_0x0eaa('0x5b')],{})[_0x0eaa('0x23')](respondWithResult(_0x55f4ab,0xc9))[_0x0eaa('0x2d')](handleError(_0x55f4ab,null));};exports[_0x0eaa('0x5c')]=function(_0x3744bb,_0xd86519){if(_0x3744bb[_0x0eaa('0x5b')]['id']){delete _0x3744bb[_0x0eaa('0x5b')]['id'];}return db['SmsMessage'][_0x0eaa('0x59')]({'where':{'id':_0x3744bb[_0x0eaa('0x5d')]['id']}})[_0x0eaa('0x23')](handleEntityNotFound(_0xd86519,null))[_0x0eaa('0x23')](saveUpdates(_0x3744bb[_0x0eaa('0x5b')],null))['then'](respondWithResult(_0xd86519,null))['catch'](handleError(_0xd86519,null));};exports[_0x0eaa('0x36')]=function(_0x445778,_0x59c6a0){return db[_0x0eaa('0x3c')][_0x0eaa('0x59')]({'where':{'id':_0x445778[_0x0eaa('0x5d')]['id']}})[_0x0eaa('0x23')](handleEntityNotFound(_0x59c6a0,null))[_0x0eaa('0x23')](removeEntity(_0x59c6a0,null))[_0x0eaa('0x2d')](handleError(_0x59c6a0,null));};exports[_0x0eaa('0x5e')]=function(_0xd77722,_0x54d457){return db[_0x0eaa('0x3c')][_0x0eaa('0x5e')]()['then'](respondWithResult(_0x54d457,null))[_0x0eaa('0x2d')](handleError(_0x54d457,null));};var interaction_log=require(_0x0eaa('0x16'))(_0x0eaa('0x5f'));exports[_0x0eaa('0x60')]=function(_0x38d3e1,_0x41f9c7,_0x2bfcd2){var _0x1d51c6={'agent':{},'channel':_0x0eaa('0x61')};if(_0x38d3e1[_0x0eaa('0x5b')]['id']){delete _0x38d3e1['body']['id'];}_0x38d3e1[_0x0eaa('0x5b')][_0x0eaa('0x62')]=!![];_0x38d3e1[_0x0eaa('0x5b')][_0x0eaa('0x63')]=moment()['format'](_0x0eaa('0x64'));_0x38d3e1['body'][_0x0eaa('0x65')]=_0x38d3e1[_0x0eaa('0x5b')]['UserId']||_0x38d3e1['user']['id'];_0x1d51c6[_0x0eaa('0x66')]['id']=_0x38d3e1[_0x0eaa('0x5b')][_0x0eaa('0x65')];return db[_0x0eaa('0x3c')][_0x0eaa('0x59')]({'where':{'id':_0x38d3e1[_0x0eaa('0x5d')]['id'],'UserId':null}})[_0x0eaa('0x23')](handleEntityNotFound(_0x41f9c7,null))[_0x0eaa('0x23')](saveUpdates(_0x38d3e1[_0x0eaa('0x5b')],null))['then'](function(_0x406872){if(_0x406872){_0x1d51c6[_0x0eaa('0x2b')]=_0x406872['get']({'plain':!![]});return db[_0x0eaa('0x67')][_0x0eaa('0x59')]({'where':{'id':_0x406872['SmsInteractionId']}});}return null;})[_0x0eaa('0x23')](handleEntityNotFound(_0x41f9c7,null))[_0x0eaa('0x23')](function(_0x401b83){if(_0x401b83){return _0x401b83[_0x0eaa('0x5c')]({'UserId':_0x38d3e1['body'][_0x0eaa('0x65')],'read1stAt':_[_0x0eaa('0x68')](_0x401b83[_0x0eaa('0x69')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0eaa('0x23')](function(_0x3e834a){if(_0x3e834a){_0x1d51c6[_0x0eaa('0x6a')]=_0x3e834a['get']({'plain':!![]});interaction_log[_0x0eaa('0x24')](_0x0eaa('0x6b'),_0x38d3e1['user']['id'],_0x38d3e1[_0x0eaa('0x6c')][_0x0eaa('0x38')],_0x38d3e1['user'][_0x0eaa('0x6d')],_0x1d51c6[_0x0eaa('0x6a')]['id'],_0x38d3e1[_0x0eaa('0x5b')]?JSON['stringify'](_0x38d3e1['body']):'null');return respondWithRpcPromise(_0x0eaa('0x6e'),'acceptMessage',_0x1d51c6);}return null;})[_0x0eaa('0x23')](function(_0x56c856){var _0x1c35ad=_0x0eaa('0x6f')+_0x56c856[_0x0eaa('0x2b')][_0x0eaa('0x70')];return db['sequelize'][_0x0eaa('0x42')](_0x1c35ad,{'type':db[_0x0eaa('0x71')][_0x0eaa('0x72')][_0x0eaa('0x73')],'raw':!![]})['then'](function(_0x37bd12){return _0x37bd12;});})[_0x0eaa('0x23')](function(_0x5efda0){if(_0x5efda0){_0x1d51c6[_0x0eaa('0x2b')][_0x0eaa('0x74')]=_0x5efda0[0x0];if(!_0x38d3e1[_0x0eaa('0x5b')][_0x0eaa('0x65')])return;return db['User']['find']({'where':{'id':_0x38d3e1[_0x0eaa('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x0eaa('0x38'),_0x0eaa('0x75'),'email',_0x0eaa('0x76')],'raw':!![]});}return null;})[_0x0eaa('0x23')](function(_0x3a9b63){if(!_0x3a9b63)return null;_0x1d51c6[_0x0eaa('0x2b')][_0x0eaa('0x66')]=_0x3a9b63;return _0x1d51c6;})[_0x0eaa('0x23')](function(_0x3447a4){if(_0x3447a4){if(_0x38d3e1['body'][_0x0eaa('0x77')]){_0x1d51c6[_0x0eaa('0x2b')][_0x0eaa('0x78')]=util[_0x0eaa('0x79')](_0x0eaa('0x7a'),_0x38d3e1['user'][_0x0eaa('0x38')]);_0x1d51c6[_0x0eaa('0x2b')][_0x0eaa('0x7b')]=_0x1d51c6['channel'];_0x1d51c6[_0x0eaa('0x2b')][_0x0eaa('0x7c')]=_0x1d51c6[_0x0eaa('0x7b')];_0x1d51c6[_0x0eaa('0x2b')]['event']='accept';return respondWithRpcPromise('EventManager',_0x0eaa('0x7d'),{'event':_0x0eaa('0x7e'),'message':_0x1d51c6[_0x0eaa('0x2b')]},client9002)[_0x0eaa('0x23')](function(){return _0x1d51c6;});}return _0x1d51c6;}return null;})['then'](respondWithResult(_0x41f9c7,null))[_0x0eaa('0x2d')](handleError(_0x41f9c7,null));};var interaction_log=require(_0x0eaa('0x16'))('sms-interactions');exports[_0x0eaa('0x35')]=function(_0x207881,_0x4a1112,_0xf565f7){var _0xc8695c={'agent':{},'channel':_0x0eaa('0x61')};if(_0x207881[_0x0eaa('0x5b')]['id']){delete _0x207881[_0x0eaa('0x5b')]['id'];}_0x207881[_0x0eaa('0x5b')][_0x0eaa('0x65')]=_0x207881[_0x0eaa('0x5b')][_0x0eaa('0x65')]||_0x207881[_0x0eaa('0x6c')]['id'];_0xc8695c['agent']['id']=_0x207881[_0x0eaa('0x5b')][_0x0eaa('0x65')];return db[_0x0eaa('0x3c')]['find']({'where':{'id':_0x207881[_0x0eaa('0x5d')]['id'],'UserId':null}})[_0x0eaa('0x23')](handleEntityNotFound(_0x4a1112,null))[_0x0eaa('0x23')](function(_0x5c3eaa){if(_0x5c3eaa){_0xc8695c[_0x0eaa('0x2b')]=_0x5c3eaa[_0x0eaa('0x7f')]({'plain':!![]});return db[_0x0eaa('0x67')]['find']({'where':{'id':_0x5c3eaa['SmsInteractionId']}});}return null;})[_0x0eaa('0x23')](handleEntityNotFound(_0x4a1112,null))[_0x0eaa('0x23')](function(_0x590596){if(_0x590596){_0xc8695c[_0x0eaa('0x6a')]=_0x590596[_0x0eaa('0x7f')]({'plain':!![]});interaction_log[_0x0eaa('0x24')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x207881[_0x0eaa('0x6c')]['id'],_0x207881['user'][_0x0eaa('0x38')],_0x207881[_0x0eaa('0x6c')][_0x0eaa('0x6d')],_0xc8695c['interaction']['id'],_0x207881['body']?JSON['stringify'](_0x207881[_0x0eaa('0x5b')]):_0x0eaa('0x80'));return respondWithRpcPromise(_0x0eaa('0x81'),_0x0eaa('0x82'),_0xc8695c);}return null;})[_0x0eaa('0x23')](function(_0x1943c1){var _0x41d6f0=_0x0eaa('0x6f')+_0x1943c1['message']['ContactId'];return db[_0x0eaa('0x83')][_0x0eaa('0x42')](_0x41d6f0,{'type':db['Sequelize'][_0x0eaa('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x210b68){return _0x210b68;});})[_0x0eaa('0x23')](function(_0x474597){if(_0x474597){_0xc8695c[_0x0eaa('0x2b')][_0x0eaa('0x74')]=_0x474597[0x0];if(!_0x207881[_0x0eaa('0x5b')][_0x0eaa('0x65')])return;return db[_0x0eaa('0x84')][_0x0eaa('0x59')]({'where':{'id':_0x207881['body']['UserId'],'role':_0x0eaa('0x66')},'attributes':['id',_0x0eaa('0x38'),_0x0eaa('0x75'),_0x0eaa('0x85'),_0x0eaa('0x76')],'raw':!![]});}return null;})[_0x0eaa('0x23')](function(_0x98eac7){if(!_0x98eac7)return null;_0xc8695c[_0x0eaa('0x2b')][_0x0eaa('0x66')]=_0x98eac7;return _0xc8695c;})[_0x0eaa('0x23')](function(_0x1191a8){if(_0x1191a8){_0x1191a8[_0x0eaa('0x2b')][_0x0eaa('0x78')]=util[_0x0eaa('0x79')]('SIP/%s',_0x207881[_0x0eaa('0x6c')][_0x0eaa('0x38')]);_0x1191a8[_0x0eaa('0x2b')][_0x0eaa('0x7b')]=_0xc8695c[_0x0eaa('0x7b')];_0x1191a8[_0x0eaa('0x2b')]['motionChannel']=_0xc8695c[_0x0eaa('0x7b')];_0x1191a8[_0x0eaa('0x2b')][_0x0eaa('0x86')]=_0x0eaa('0x35');respondWithRpcPromise(_0x0eaa('0x7d'),'EventManager',{'event':_0x0eaa('0x87'),'message':_0x1191a8[_0x0eaa('0x2b')]},client9002);return _0xc8695c;}return null;})['then'](respondWithResult(_0x4a1112,null))[_0x0eaa('0x2d')](handleError(_0x4a1112,null));};exports[_0x0eaa('0x2f')]=function(_0x51b83a,_0x2c04d5,_0x4e2620){if(_0x51b83a[_0x0eaa('0x5b')]['id']){delete _0x51b83a[_0x0eaa('0x5b')]['id'];}var _0x547cf7;return db['SmsMessage']['find']({'where':{'id':_0x51b83a['params']['id']}})[_0x0eaa('0x23')](handleEntityNotFound(_0x2c04d5,null))[_0x0eaa('0x23')](function(_0x55024e){if(_0x55024e){_0x547cf7=_0x55024e;return db[_0x0eaa('0x88')][_0x0eaa('0x59')]({'where':{'id':_0x55024e[_0x0eaa('0x89')]}});}})['then'](handleEntityNotFound(_0x2c04d5,null))[_0x0eaa('0x23')](function(_0x1c26e2){if(_0x1c26e2){logger[_0x0eaa('0x26')](_0x0eaa('0x27'),_0x0eaa('0x2f'),'received\x20delivery\x20report\x20from',_0x1c26e2['type'],util[_0x0eaa('0x8a')](_0x51b83a[_0x0eaa('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1c26e2[_0x0eaa('0x3f')]){case _0x0eaa('0x8b'):if(_0x51b83a[_0x0eaa('0x5b')][_0x0eaa('0x8c')]&&_0x51b83a[_0x0eaa('0x5b')][_0x0eaa('0x8c')]===_0x547cf7[_0x0eaa('0x8d')]){return _0x547cf7[_0x0eaa('0x5c')]({'read':!![]});}else{logger['error'](_0x0eaa('0x8e'),_0x0eaa('0x2f'),_0x0eaa('0x8b'),util[_0x0eaa('0x8a')](_0x51b83a[_0x0eaa('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x0eaa('0x8f'):if(_0x51b83a[_0x0eaa('0x5b')]['MessageUUID']&&_0x51b83a[_0x0eaa('0x5b')]['MessageUUID']===_0x547cf7[_0x0eaa('0x8d')]&&_[_0x0eaa('0x90')](['sent','delivered'],_0x51b83a[_0x0eaa('0x5b')][_0x0eaa('0x91')])>=0x0){return _0x547cf7[_0x0eaa('0x5c')]({'read':!![]});}else{logger[_0x0eaa('0x29')](_0x0eaa('0x8e'),_0x0eaa('0x2f'),_0x0eaa('0x92'),util[_0x0eaa('0x8a')](_0x51b83a[_0x0eaa('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x25c0c8=_0x51b83a['body']['results'][0x0];if(_0x25c0c8['status'][_0x0eaa('0x93')]===_0x0eaa('0x94')){return _0x547cf7[_0x0eaa('0x5c')]({'read':!![]});}else{logger[_0x0eaa('0x29')](_0x0eaa('0x8e'),_0x0eaa('0x2f'),_0x0eaa('0x95'),util[_0x0eaa('0x8a')](_0x51b83a['body'],{'showHidden':![],'depth':null}));}break;}return _0x547cf7;}})[_0x0eaa('0x23')](respondWithResult(_0x2c04d5,null))[_0x0eaa('0x2d')](handleError(_0x2c04d5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d08fb08..6243862 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 _0x6ba5=['hasOwnProperty','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit'];(function(_0x22d72b,_0x112e6d){var _0x35f65f=function(_0x23d67f){while(--_0x23d67f){_0x22d72b['push'](_0x22d72b['shift']());}};_0x35f65f(++_0x112e6d);}(_0x6ba5,0x11a));var _0x56ba=function(_0x565374,_0x395149){_0x565374=_0x565374-0x0;var _0x31cd93=_0x6ba5[_0x565374];return _0x31cd93;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x56ba('0x0'))['db'][_0x56ba('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x56ba('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x56ba('0x3'),'afterDestroy':_0x56ba('0x4')};function emitEvent(_0x276ff7){return function(_0x5a4eab,_0x37b28a,_0x5db921){SmsMessageEvents[_0x56ba('0x5')](_0x276ff7+':'+_0x5a4eab['id'],_0x5a4eab);SmsMessageEvents[_0x56ba('0x5')](_0x276ff7,_0x5a4eab);_0x5db921(null);};}for(var e in events){if(events[_0x56ba('0x6')](e)){var event=events[e];SmsMessage[_0x56ba('0x7')](e,emitEvent(event));}}module[_0x56ba('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x3b6a=['../../mysqldb','SmsMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0x3b6a,0x1c0));var _0xa3b6=function(_0x14d99c,_0xa1b029){_0x14d99c=_0x14d99c-0x0;var _0x2a8f65=_0x3b6a[_0x14d99c];return _0x2a8f65;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xa3b6('0x0'))['db'][_0xa3b6('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa3b6('0x2'),'afterDestroy':_0xa3b6('0x3')};function emitEvent(_0x1f2d61){return function(_0x142034,_0xff239d,_0x20531d){SmsMessageEvents[_0xa3b6('0x4')](_0x1f2d61+':'+_0x142034['id'],_0x142034);SmsMessageEvents[_0xa3b6('0x4')](_0x1f2d61,_0x142034);_0x20531d(null);};}for(var e in events){if(events[_0xa3b6('0x5')](e)){var event=events[e];SmsMessage[_0xa3b6('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index cc9dcef..f947bd4 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 _0x63bf=['/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','smsMethod','sender','&password=','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','afterCreate','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','authId','/status?token=','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','sort','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','accountId'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x63bf,0x100));var _0xf63b=function(_0x4c5dc1,_0x527f20){_0x4c5dc1=_0x4c5dc1-0x0;var _0x12055e=_0x63bf[_0x4c5dc1];return _0x12055e;};'use strict';var _=require(_0xf63b('0x0'));var util=require(_0xf63b('0x1'));var logger=require(_0xf63b('0x2'))('api');var moment=require(_0xf63b('0x3'));var BPromise=require(_0xf63b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf63b('0x5'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x1b6ea5,_0x291d68){return _0x1b6ea5[_0xf63b('0x6')](_0xf63b('0x7'),attributes,{'tableName':_0xf63b('0x8'),'paranoid':![],'indexes':[{'name':_0xf63b('0x9'),'fields':['messageId']},{'name':_0xf63b('0xa'),'fields':[_0xf63b('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e8ba,_0x126659,_0x4f6c6e){var _0x98b540=_0x1b6ea5[_0xf63b('0xc')];var _0x3bf42b=_0x49e8ba[_0xf63b('0xd')]({'plain':!![]});if(_0x3bf42b['direction'][_0xf63b('0xe')]()==='in'||_0x3bf42b[_0xf63b('0xf')][_0xf63b('0xe')]()==='out'&&!_0x3bf42b[_0xf63b('0x10')]&&!_[_0xf63b('0x11')](_0x3bf42b[_0xf63b('0x12')])&&!_['isNil'](_0x3bf42b[_0xf63b('0x13')])){_0x98b540[_0xf63b('0x14')][_0xf63b('0x15')]({'where':{'id':_0x3bf42b[_0xf63b('0x13')]}})[_0xf63b('0x16')](function(_0x3571fa){if(_0x3571fa){_0x3571fa['update']({'lastMsgAt':_0x3bf42b[_0xf63b('0x17')],'lastMsgDirection':_0x3bf42b['direction'][_0xf63b('0xe')]()});}})[_0xf63b('0x18')](function(_0x529bb4){console[_0xf63b('0x19')](_0x529bb4);});}if(_0x3bf42b[_0xf63b('0xf')]===_0xf63b('0x1a')&&!_0x3bf42b['secret']){var _0x4cf1b1;_0x98b540[_0xf63b('0x1b')][_0xf63b('0x1c')]({'where':{'id':_0x3bf42b[_0xf63b('0x1d')]},'raw':!![]})[_0xf63b('0x16')](function(_0x4cb41f){_0x4cf1b1=_0x4cb41f;if(_0x4cf1b1&&_0x4cf1b1[_0xf63b('0x1e')]){switch(_0x4cf1b1[_0xf63b('0x1e')]){case _0xf63b('0x1f'):var _0x19b2c9=require('twilio');if(_0x4cf1b1[_0xf63b('0x20')]&&_0x4cf1b1[_0xf63b('0x21')]&&_0x4cf1b1[_0xf63b('0x22')]){var _0x41d02e=new _0x19b2c9(_0x4cf1b1[_0xf63b('0x20')],_0x4cf1b1[_0xf63b('0x21')]);_0x41d02e['messages'][_0xf63b('0x23')]({'body':_0x3bf42b['body'],'to':_0x3bf42b[_0xf63b('0x22')],'from':_0x4cf1b1[_0xf63b('0x22')],'statusCallback':_0x4cf1b1[_0xf63b('0x24')]+_0xf63b('0x25')+_0x3bf42b['id']+'/status?token='+_0x4cf1b1[_0xf63b('0x26')]})['then'](function(_0x219b55){if(_0x219b55[_0xf63b('0x27')]){return _0x49e8ba[_0xf63b('0x28')]({'messageId':_0x219b55[_0xf63b('0x27')]});}})[_0xf63b('0x18')](function(_0x225116){logger[_0xf63b('0x19')](_0xf63b('0x29'),'afterCreate',_0xf63b('0x1f'),util[_0xf63b('0x2a')](_0x225116,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),'afterCreate',_0xf63b('0x1f'),_0xf63b('0x2b'));}break;case'skebby':var _0x98a5ea='https://api.skebby.it/API/v1.0/REST/';if(_0x4cf1b1[_0xf63b('0x2c')]&&_0x4cf1b1[_0xf63b('0x2d')]){var _0x485d68={'recipient':[_0x3bf42b[_0xf63b('0x22')]],'message':_0x3bf42b['body'],'message_type':_0x4cf1b1['smsMethod']};if(_0x4cf1b1[_0xf63b('0x2e')]&&_0x4cf1b1[_0xf63b('0x2e')]!=='SI'){_0x485d68[_0xf63b('0x2f')]=_0x4cf1b1[_0xf63b('0x22')];}var _0x5e3751={'url':_0x98a5ea+'login?username='+_0x4cf1b1['username']+_0xf63b('0x30')+_0x4cf1b1['password'],'method':'GET'};rp(_0x5e3751)['then'](function(_0x359841){var _0x5df74e=_0x359841['split'](';');var _0x551875={'user_key':_0x5df74e[0x0],'session_key':_0x5df74e[0x1]};_0x5e3751={'url':_0x98a5ea+_0xf63b('0x31'),'method':_0xf63b('0x32'),'headers':{'user_key':_0x551875[_0xf63b('0x33')],'Session_key':_0x551875[_0xf63b('0x34')]},'json':!![],'body':_0x485d68};return rp(_0x5e3751);})[_0xf63b('0x16')](function(_0x3679f8){if(_0x3679f8[_0xf63b('0x35')]>=0x1){var _0x440b4b={'messageId':_0x3679f8[_0xf63b('0x36')]};if(_0x4cf1b1[_0xf63b('0x2e')]!=='GP'||!_0x4cf1b1[_0xf63b('0x37')]){_0x440b4b[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0x440b4b);}else{return logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),'skebby',util[_0xf63b('0x2a')](_0x3679f8,{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x35e958){return logger['error'](_0xf63b('0x29'),'afterCreate',_0xf63b('0x3a'),util[_0xf63b('0x2a')](_0x35e958,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x3a'),_0xf63b('0x3b'));}break;case _0xf63b('0x3c'):if(_0x4cf1b1['authToken']){var _0x3d48f={'recipient':_0x3bf42b[_0xf63b('0x22')],'message':_0x3bf42b[_0xf63b('0xb')],'sender':_0x4cf1b1[_0xf63b('0x3d')]||_0x4cf1b1['phone'],'authorization':_0x4cf1b1[_0xf63b('0x21')]};var _0x126659={'method':_0xf63b('0x32'),'uri':_0xf63b('0x3e'),'body':_0x3d48f,'json':!![]};rp(_0x126659)['then'](function(_0x469e4a){var _0x3d8ae1={'messageId':_0x469e4a[_0xf63b('0x3f')]};if(!_0x4cf1b1[_0xf63b('0x37')]){_0x3d8ae1[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0x3d8ae1);})[_0xf63b('0x18')](function(_0x32f752){logger[_0xf63b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),_0xf63b('0x3c'),util['inspect'](_0x32f752,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xf63b('0x40'):if(_0x4cf1b1[_0xf63b('0x2c')]&&_0x4cf1b1['password']){var _0x3d48f={'messages':[{'source':'xCALLY\x20Motion','to':_0x3bf42b[_0xf63b('0x22')],'body':_0x3bf42b[_0xf63b('0xb')],'from':_0x4cf1b1['senderString']||_0x4cf1b1['phone']}]};var _0xa03842=util[_0xf63b('0x41')](_0xf63b('0x42'),_0x4cf1b1[_0xf63b('0x2c')],_0x4cf1b1[_0xf63b('0x2d')]);var _0x126659={'method':'POST','uri':_0xf63b('0x43'),'body':_0x3d48f,'headers':{'Authorization':util['format'](_0xf63b('0x44'),new Buffer(_0xa03842)[_0xf63b('0x45')]('base64'))},'json':!![]};rp(_0x126659)['then'](function(_0x301817){if(_0x301817[_0xf63b('0x46')]>=0xc8&&_0x301817[_0xf63b('0x46')]<=0xce){if(_0x301817['data']&&_0x301817[_0xf63b('0x47')][_0xf63b('0x48')]>0x0){var _0x27b26b=_[_0xf63b('0x49')](_0x301817[_0xf63b('0x47')][_0xf63b('0x4a')]);var _0xd75ca9={'messageId':_0x27b26b[_0xf63b('0x4b')]};if(!_0x4cf1b1[_0xf63b('0x37')]){_0xd75ca9[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0xd75ca9);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),_0xf63b('0x4c'),util['inspect'](_0x301817,{'showHidden':![],'depth':null}));}}else{logger[_0xf63b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),_0xf63b('0x4c'),util['inspect'](_0x301817,{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x5d714d){logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),'clickSend',util[_0xf63b('0x2a')](_0x5d714d,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x4c'),_0xf63b('0x3b'));}break;case'plivo':if(_0x4cf1b1[_0xf63b('0x4d')]&&_0x4cf1b1[_0xf63b('0x21')]){var _0x3d48f={'dst':_0x3bf42b['phone'],'text':_0x3bf42b[_0xf63b('0xb')],'src':_0x4cf1b1[_0xf63b('0x3d')]||_0x4cf1b1['phone'],'url':_0x4cf1b1[_0xf63b('0x24')]+_0xf63b('0x25')+_0x3bf42b['id']+_0xf63b('0x4e')+_0x4cf1b1[_0xf63b('0x26')]};var _0xa03842=util['format']('%s:%s',_0x4cf1b1['authId'],_0x4cf1b1[_0xf63b('0x21')]);var _0x126659={'method':_0xf63b('0x32'),'uri':util[_0xf63b('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4cf1b1['authId']),'body':_0x3d48f,'headers':{'Authorization':util[_0xf63b('0x41')](_0xf63b('0x44'),new Buffer(_0xa03842)['toString'](_0xf63b('0x4f')))},'json':!![]};rp(_0x126659)[_0xf63b('0x16')](function(_0x327d6c){var _0x41257b={'messageId':_0x327d6c['message_uuid'][0x0]};return _0x49e8ba[_0xf63b('0x28')](_0x41257b);})['catch'](function(_0x4e5fa4){logger[_0xf63b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0xf63b('0x2a')](_0x4e5fa4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xf63b('0x50'));}break;case _0xf63b('0x51'):if(_0x4cf1b1[_0xf63b('0x2c')]&&_0x4cf1b1[_0xf63b('0x2d')]){if(_0x4cf1b1[_0xf63b('0x52')]){var _0x169545={'method':'POST','uri':_0x4cf1b1[_0xf63b('0x52')]+'/auth/1/session','body':{'username':_0x4cf1b1[_0xf63b('0x2c')],'password':_0x4cf1b1[_0xf63b('0x2d')]},'json':!![]};return rp(_0x169545)['then'](function(_0x183266){var _0x5b303a={'method':_0xf63b('0x32'),'uri':_0x4cf1b1[_0xf63b('0x52')]+_0xf63b('0x53'),'body':{'messages':[{'from':_0x4cf1b1['phone'],'destinations':[{'to':_0x3bf42b['phone']}],'text':_0x3bf42b[_0xf63b('0xb')],'notifyUrl':_0x4cf1b1[_0xf63b('0x24')]+_0xf63b('0x25')+_0x3bf42b['id']+_0xf63b('0x4e')+_0x4cf1b1[_0xf63b('0x26')],'notifyContentType':_0xf63b('0x54'),'callbackData':_0x4cf1b1[_0xf63b('0x22')]+';'+_0x3bf42b[_0xf63b('0xb')]}]},'headers':{'Authorization':_0xf63b('0x55')+_0x183266[_0xf63b('0x26')]},'json':!![]};return rp(_0x5b303a)[_0xf63b('0x16')](function(_0x46f53c){if(_0x46f53c['messages']){var _0x4ce22e={'messageId':_0x46f53c[_0xf63b('0x4a')][0x0][_0xf63b('0x9')]};if(!_0x4cf1b1['deliveryReport']){_0x4ce22e[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0x4ce22e);}else{return logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x51'),util[_0xf63b('0x2a')](_0x46f53c,{'showHidden':![],'depth':null}));}});})[_0xf63b('0x18')](function(_0x40fc69){return logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x51'),util[_0xf63b('0x2a')](_0x40fc69,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x51'),_0xf63b('0x56'));}}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),'infobip',_0xf63b('0x3b'));}break;case'csc':var _0x23a96d=require(_0xf63b('0x57'));if(_0x4cf1b1[_0xf63b('0x58')]){var _0x31c2d4={};_0x31c2d4[_0xf63b('0x59')]=_0x4cf1b1[_0xf63b('0x2c')];_0x31c2d4['phone']=_0x3bf42b[_0xf63b('0x22')];_0x31c2d4[_0xf63b('0x2f')]=_0x4cf1b1[_0xf63b('0x22')];_0x31c2d4[_0xf63b('0x5a')]=_0x3bf42b[_0xf63b('0xb')];_0x31c2d4[_0xf63b('0x5b')]=+new Date();var _0x479424='';var _0x40adbe='';var _0x540f47=Object['keys'](_0x31c2d4);_0x540f47[_0xf63b('0x5c')]();for(var _0x5b024f=0x0;_0x5b024f<_0x540f47['length'];_0x5b024f++){if(_0x479424!=''){_0x479424+='&';}_0x479424+=_0x540f47[_0x5b024f]+'='+encodeURIComponent(_0x31c2d4[_0x540f47[_0x5b024f]]);_0x40adbe+=_0x31c2d4[_0x540f47[_0x5b024f]];}_0x40adbe+=_0x4cf1b1[_0xf63b('0x58')];_0x40adbe=_0x23a96d[_0xf63b('0x5d')](_0xf63b('0x5e'))[_0xf63b('0x28')](_0x40adbe)['digest'](_0xf63b('0x5f'));if(_0x479424!==''){_0x479424+='&';}_0x479424+=_0xf63b('0x60')+_0x40adbe;var _0x5e3751={'method':'GET','uri':_0x4cf1b1['baseUrl']+_0xf63b('0x61')+_0x479424,'json':!![]};return rp(_0x5e3751)[_0xf63b('0x16')](function(_0x1e326c){var _0x2d4304=Object['keys'](_0x1e326c);if(_0x1e326c[_0x2d4304[0x0]]['error']&&parseInt(_0x1e326c[_0x2d4304[0x0]][_0xf63b('0x19')])===0x0){var _0xbcba60={'messageId':_0x1e326c[_0x2d4304[0x0]][_0xf63b('0x62')]};if(!_0x4cf1b1['deliveryReport']){_0xbcba60[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0xbcba60);}else{return logger['error'](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x63'),util[_0xf63b('0x2a')](_0x1e326c[_0xf63b('0x19')],{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x23ac4b){return logger['error'](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x63'),util[_0xf63b('0x2a')](_0x23ac4b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),'csc',_0xf63b('0x64'));}break;case _0xf63b('0x65'):if(_0x4cf1b1['apiKey']){var _0x245321={'method':_0xf63b('0x32'),'uri':_0xf63b('0x66'),'headers':{'Authorization':_0x4cf1b1['apiKey']},'body':{'content':_0x3bf42b[_0xf63b('0xb')],'to':[_0x3bf42b['phone']],'from':_0x4cf1b1[_0xf63b('0x22')],'binary':![],'clientMessageId':_0xf63b('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x245321)[_0xf63b('0x16')](function(_0x396f46){if(!_0x396f46[_0xf63b('0x19')]){var _0x57d54d={'messageId':_0x396f46['messages'][0x0][_0xf63b('0x68')]};if(!_0x4cf1b1[_0xf63b('0x37')]){_0x57d54d[_0xf63b('0x38')]=!![];}return _0x49e8ba[_0xf63b('0x28')](_0x57d54d);}else{return logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),'clickatell',util[_0xf63b('0x2a')](_0x396f46['error'],{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x3e2e75){return logger['error'](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x65'),util['inspect'](_0x3e2e75,{'showHidden':![],'depth':null}));});}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0xf63b('0x69'):if(_0x4cf1b1[_0xf63b('0x2c')]&&_0x4cf1b1[_0xf63b('0x2d')]){var _0xa03842=util[_0xf63b('0x41')](_0xf63b('0x42'),_0x4cf1b1[_0xf63b('0x2c')],_0x4cf1b1[_0xf63b('0x2d')]);var _0x126659={'method':_0xf63b('0x32'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4cf1b1[_0xf63b('0x6a')]+_0xf63b('0x6b'),'body':{'to':[_0x3bf42b[_0xf63b('0x22')]],'text':_0x3bf42b[_0xf63b('0xb')],'from':_0x4cf1b1[_0xf63b('0x22')],'applicationId':_0x4cf1b1[_0xf63b('0x6c')]},'headers':{'Authorization':util[_0xf63b('0x41')](_0xf63b('0x44'),new Buffer(_0xa03842)[_0xf63b('0x45')](_0xf63b('0x4f')))},'json':!![]};rp(_0x126659)[_0xf63b('0x16')](function(_0x13c01c){if(_0x13c01c['id']){var _0xdf93fa={'messageId':_0x13c01c['id']};return _0x49e8ba['update'](_0xdf93fa);}else{logger[_0xf63b('0x19')](_0xf63b('0x29'),_0xf63b('0x39'),'bandwidth',util['inspect'](_0x13c01c,{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x5a2c4e){logger['error'](_0xf63b('0x29'),_0xf63b('0x39'),_0xf63b('0x69'),util[_0xf63b('0x2a')](_0x5a2c4e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),_0xf63b('0x69'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf63b('0x6d'):if(_0x4cf1b1[_0xf63b('0x58')]){var _0x4042b6={};var _0x5e3751={'method':_0xf63b('0x32'),'uri':_0xf63b('0x6e'),'headers':{'Authorization':_0xf63b('0x6f')+_0x4cf1b1[_0xf63b('0x58')],'Content-Type':_0xf63b('0x54')},'body':{'from':_0x4cf1b1[_0xf63b('0x22')],'to':_0x3bf42b[_0xf63b('0x22')],'text':_0x3bf42b[_0xf63b('0xb')]},'json':!![]};return rp(_0x5e3751)[_0xf63b('0x16')](function(_0x536441){if(_0x536441[_0xf63b('0x70')]==0xca){_0x4042b6['message']=_0x536441;var _0x323456={'method':'POST','uri':_0xf63b('0x71'),'headers':{'Authorization':_0xf63b('0x6f')+_0x4cf1b1['apiKey'],'Content-Type':_0xf63b('0x54')},'body':{'refid':_0x4042b6[_0xf63b('0x72')][_0xf63b('0x73')]},'json':!![]};return rp(_0x323456)[_0xf63b('0x16')](function(_0x36ee79){_0x4042b6[_0xf63b('0x74')]=_0x36ee79;var _0x23890d={'messageId':_0x4042b6[_0xf63b('0x72')][_0xf63b('0x73')],'read':!![]};return _0x49e8ba['update'](_0x23890d);});}else{return logger[_0xf63b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf63b('0x6d'),util[_0xf63b('0x2a')](_0x536441,{'showHidden':![],'depth':null}));}})[_0xf63b('0x18')](function(_0x9a44){return logger[_0xf63b('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf63b('0x39'),_0xf63b('0x6d'),util[_0xf63b('0x2a')](_0x9a44,{'showHidden':![],'depth':null}));});}else{return logger[_0xf63b('0x19')](_0xf63b('0x29'),'afterCreate',_0xf63b('0x6d'),_0xf63b('0x75'));}break;}}})[_0xf63b('0x76')](function(){_0x4f6c6e();});}else{_0x4f6c6e();}}},'charset':_0xf63b('0x77'),'collate':_0xf63b('0x78')});}; \ No newline at end of file +var _0xa51b=['http_code','data','queued_count','head','messages','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','text','timestamp','keys','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','../../config/logger','api','bluebird','request-promise','path','../../config/environment','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','then','createdAt','find','type','twilio','authToken','phone','accountSid','create','remote','/api/sms/messages/','/status?token=','token','sid','update','catch','error','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64'];(function(_0x393c55,_0x43b06c){var _0x4085fc=function(_0x541e20){while(--_0x541e20){_0x393c55['push'](_0x393c55['shift']());}};_0x4085fc(++_0x43b06c);}(_0xa51b,0x117));var _0xba51=function(_0x413812,_0x2ad176){_0x413812=_0x413812-0x0;var _0x51cb42=_0xa51b[_0x413812];return _0x51cb42;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba51('0x0'))(_0xba51('0x1'));var moment=require('moment');var BPromise=require(_0xba51('0x2'));var rp=require(_0xba51('0x3'));var fs=require('fs');var path=require(_0xba51('0x4'));var rimraf=require('rimraf');var config=require(_0xba51('0x5'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x322b6c,_0x1d1915){return _0x322b6c['define'](_0xba51('0x6'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xba51('0x7'),'fields':[_0xba51('0x7')]},{'name':_0xba51('0x8'),'fields':[_0xba51('0x9')],'type':_0xba51('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d04ac,_0x26722d,_0x563a91){var _0xd6c52f=_0x322b6c['models'];var _0x15aabc=_0x2d04ac[_0xba51('0xb')]({'plain':!![]});if(_0x15aabc[_0xba51('0xc')][_0xba51('0xd')]()==='in'||_0x15aabc[_0xba51('0xc')][_0xba51('0xd')]()===_0xba51('0xe')&&!_0x15aabc[_0xba51('0xf')]&&!_[_0xba51('0x10')](_0x15aabc['UserId'])&&!_['isNil'](_0x15aabc['SmsInteractionId'])){_0xd6c52f['SmsInteraction']['findOne']({'where':{'id':_0x15aabc[_0xba51('0x11')]}})[_0xba51('0x12')](function(_0x5f13b1){if(_0x5f13b1){_0x5f13b1['update']({'lastMsgAt':_0x15aabc[_0xba51('0x13')],'lastMsgDirection':_0x15aabc['direction']['toLowerCase']()});}})['catch'](function(_0xb99f7f){console['error'](_0xb99f7f);});}if(_0x15aabc['direction']===_0xba51('0xe')&&!_0x15aabc['secret']){var _0x361c7c;_0xd6c52f['SmsAccount'][_0xba51('0x14')]({'where':{'id':_0x15aabc['SmsAccountId']},'raw':!![]})[_0xba51('0x12')](function(_0x2710ab){_0x361c7c=_0x2710ab;if(_0x361c7c&&_0x361c7c['type']){switch(_0x361c7c[_0xba51('0x15')]){case _0xba51('0x16'):var _0x402b18=require(_0xba51('0x16'));if(_0x361c7c['accountSid']&&_0x361c7c[_0xba51('0x17')]&&_0x361c7c[_0xba51('0x18')]){var _0x3fbe1e=new _0x402b18(_0x361c7c[_0xba51('0x19')],_0x361c7c['authToken']);_0x3fbe1e['messages'][_0xba51('0x1a')]({'body':_0x15aabc[_0xba51('0x9')],'to':_0x15aabc[_0xba51('0x18')],'from':_0x361c7c['phone'],'statusCallback':_0x361c7c[_0xba51('0x1b')]+_0xba51('0x1c')+_0x15aabc['id']+_0xba51('0x1d')+_0x361c7c[_0xba51('0x1e')]})['then'](function(_0x32be16){if(_0x32be16[_0xba51('0x1f')]){return _0x2d04ac[_0xba51('0x20')]({'messageId':_0x32be16[_0xba51('0x1f')]});}})[_0xba51('0x21')](function(_0x40ca1c){logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x16'),util['inspect'](_0x40ca1c,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x16'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xba51('0x25'):var _0x422acf='https://api.skebby.it/API/v1.0/REST/';if(_0x361c7c[_0xba51('0x26')]&&_0x361c7c[_0xba51('0x27')]){var _0x14d0a0={'recipient':[_0x15aabc[_0xba51('0x18')]],'message':_0x15aabc['body'],'message_type':_0x361c7c[_0xba51('0x28')]};if(_0x361c7c[_0xba51('0x28')]&&_0x361c7c[_0xba51('0x28')]!=='SI'){_0x14d0a0[_0xba51('0x29')]=_0x361c7c[_0xba51('0x18')];}var _0x13dab5={'url':_0x422acf+_0xba51('0x2a')+_0x361c7c['username']+_0xba51('0x2b')+_0x361c7c[_0xba51('0x27')],'method':_0xba51('0x2c')};rp(_0x13dab5)[_0xba51('0x12')](function(_0x43c5b5){var _0x17db9b=_0x43c5b5[_0xba51('0x2d')](';');var _0x4d2996={'user_key':_0x17db9b[0x0],'session_key':_0x17db9b[0x1]};_0x13dab5={'url':_0x422acf+_0xba51('0x2e'),'method':_0xba51('0x2f'),'headers':{'user_key':_0x4d2996[_0xba51('0x30')],'Session_key':_0x4d2996[_0xba51('0x31')]},'json':!![],'body':_0x14d0a0};return rp(_0x13dab5);})[_0xba51('0x12')](function(_0x1ad1dd){if(_0x1ad1dd[_0xba51('0x32')]>=0x1){var _0x4cf3e5={'messageId':_0x1ad1dd[_0xba51('0x33')]};if(_0x361c7c[_0xba51('0x28')]!=='GP'||!_0x361c7c[_0xba51('0x34')]){_0x4cf3e5[_0xba51('0x35')]=!![];}return _0x2d04ac[_0xba51('0x20')](_0x4cf3e5);}else{return logger['error'](_0xba51('0x24'),'afterCreate',_0xba51('0x25'),util[_0xba51('0x36')](_0x1ad1dd,{'showHidden':![],'depth':null}));}})[_0xba51('0x21')](function(_0x428ce1){return logger[_0xba51('0x22')](_0xba51('0x24'),'afterCreate',_0xba51('0x25'),util['inspect'](_0x428ce1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x25'),_0xba51('0x37'));}break;case _0xba51('0x38'):if(_0x361c7c[_0xba51('0x17')]){var _0x5a9751={'recipient':_0x15aabc[_0xba51('0x18')],'message':_0x15aabc[_0xba51('0x9')],'sender':_0x361c7c[_0xba51('0x39')]||_0x361c7c[_0xba51('0x18')],'authorization':_0x361c7c[_0xba51('0x17')]};var _0x26722d={'method':_0xba51('0x2f'),'uri':_0xba51('0x3a'),'body':_0x5a9751,'json':!![]};rp(_0x26722d)[_0xba51('0x12')](function(_0x5815a5){var _0x2b95d4={'messageId':_0x5815a5[_0xba51('0x3b')]};if(!_0x361c7c[_0xba51('0x34')]){_0x2b95d4[_0xba51('0x35')]=!![];}return _0x2d04ac[_0xba51('0x20')](_0x2b95d4);})[_0xba51('0x21')](function(_0x11fea7){logger[_0xba51('0x22')](_0xba51('0x24'),'afterCreate',_0xba51('0x38'),util[_0xba51('0x36')](_0x11fea7,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xba51('0x3c'):if(_0x361c7c[_0xba51('0x26')]&&_0x361c7c[_0xba51('0x27')]){var _0x5a9751={'messages':[{'source':'xCALLY\x20Motion','to':_0x15aabc['phone'],'body':_0x15aabc[_0xba51('0x9')],'from':_0x361c7c[_0xba51('0x39')]||_0x361c7c['phone']}]};var _0x3b71d2=util[_0xba51('0x3d')]('%s:%s',_0x361c7c[_0xba51('0x26')],_0x361c7c[_0xba51('0x27')]);var _0x26722d={'method':_0xba51('0x2f'),'uri':_0xba51('0x3e'),'body':_0x5a9751,'headers':{'Authorization':util['format'](_0xba51('0x3f'),new Buffer(_0x3b71d2)[_0xba51('0x40')](_0xba51('0x41')))},'json':!![]};rp(_0x26722d)['then'](function(_0x4290b2){if(_0x4290b2[_0xba51('0x42')]>=0xc8&&_0x4290b2[_0xba51('0x42')]<=0xce){if(_0x4290b2[_0xba51('0x43')]&&_0x4290b2[_0xba51('0x43')][_0xba51('0x44')]>0x0){var _0x543ae8=_[_0xba51('0x45')](_0x4290b2['data'][_0xba51('0x46')]);var _0x3e28ff={'messageId':_0x543ae8['message_id']};if(!_0x361c7c[_0xba51('0x34')]){_0x3e28ff['read']=!![];}return _0x2d04ac['update'](_0x3e28ff);}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),'clickSend',util[_0xba51('0x36')](_0x4290b2,{'showHidden':![],'depth':null}));}}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x47'),util[_0xba51('0x36')](_0x4290b2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b0e87){logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x47'),util[_0xba51('0x36')](_0x1b0e87,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x47'),_0xba51('0x37'));}break;case _0xba51('0x48'):if(_0x361c7c[_0xba51('0x49')]&&_0x361c7c[_0xba51('0x17')]){var _0x5a9751={'dst':_0x15aabc[_0xba51('0x18')],'text':_0x15aabc['body'],'src':_0x361c7c[_0xba51('0x39')]||_0x361c7c[_0xba51('0x18')],'url':_0x361c7c[_0xba51('0x1b')]+_0xba51('0x1c')+_0x15aabc['id']+_0xba51('0x1d')+_0x361c7c[_0xba51('0x1e')]};var _0x3b71d2=util[_0xba51('0x3d')](_0xba51('0x4a'),_0x361c7c[_0xba51('0x49')],_0x361c7c[_0xba51('0x17')]);var _0x26722d={'method':_0xba51('0x2f'),'uri':util[_0xba51('0x3d')](_0xba51('0x4b'),_0x361c7c[_0xba51('0x49')]),'body':_0x5a9751,'headers':{'Authorization':util[_0xba51('0x3d')](_0xba51('0x3f'),new Buffer(_0x3b71d2)[_0xba51('0x40')](_0xba51('0x41')))},'json':!![]};rp(_0x26722d)[_0xba51('0x12')](function(_0x465cb0){var _0x1097d2={'messageId':_0x465cb0[_0xba51('0x4c')][0x0]};return _0x2d04ac[_0xba51('0x20')](_0x1097d2);})[_0xba51('0x21')](function(_0x58ae68){logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),'plivo',util[_0xba51('0x36')](_0x58ae68,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x48'),_0xba51('0x4d'));}break;case _0xba51('0x4e'):if(_0x361c7c[_0xba51('0x26')]&&_0x361c7c['password']){if(_0x361c7c[_0xba51('0x4f')]){var _0x529688={'method':_0xba51('0x2f'),'uri':_0x361c7c[_0xba51('0x4f')]+_0xba51('0x50'),'body':{'username':_0x361c7c[_0xba51('0x26')],'password':_0x361c7c[_0xba51('0x27')]},'json':!![]};return rp(_0x529688)['then'](function(_0x271d0d){var _0x5b15c6={'method':_0xba51('0x2f'),'uri':_0x361c7c['baseUrl']+_0xba51('0x51'),'body':{'messages':[{'from':_0x361c7c['phone'],'destinations':[{'to':_0x15aabc['phone']}],'text':_0x15aabc[_0xba51('0x9')],'notifyUrl':_0x361c7c['remote']+_0xba51('0x1c')+_0x15aabc['id']+_0xba51('0x1d')+_0x361c7c[_0xba51('0x1e')],'notifyContentType':'application/json','callbackData':_0x361c7c['phone']+';'+_0x15aabc['body']}]},'headers':{'Authorization':_0xba51('0x52')+_0x271d0d[_0xba51('0x1e')]},'json':!![]};return rp(_0x5b15c6)[_0xba51('0x12')](function(_0x106f95){if(_0x106f95[_0xba51('0x46')]){var _0x116048={'messageId':_0x106f95[_0xba51('0x46')][0x0][_0xba51('0x7')]};if(!_0x361c7c['deliveryReport']){_0x116048[_0xba51('0x35')]=!![];}return _0x2d04ac[_0xba51('0x20')](_0x116048);}else{return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x4e'),util[_0xba51('0x36')](_0x106f95,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x325f50){return logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x4e'),util[_0xba51('0x36')](_0x325f50,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x4e'),_0xba51('0x53'));}}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5d02c8=require(_0xba51('0x54'));if(_0x361c7c['apiKey']){var _0x35a59b={};_0x35a59b[_0xba51('0x55')]=_0x361c7c[_0xba51('0x26')];_0x35a59b[_0xba51('0x18')]=_0x15aabc[_0xba51('0x18')];_0x35a59b['sender']=_0x361c7c['phone'];_0x35a59b[_0xba51('0x56')]=_0x15aabc[_0xba51('0x9')];_0x35a59b[_0xba51('0x57')]=+new Date();var _0x130801='';var _0x1109e4='';var _0x554c4a=Object[_0xba51('0x58')](_0x35a59b);_0x554c4a['sort']();for(var _0x3692be=0x0;_0x3692be<_0x554c4a[_0xba51('0x59')];_0x3692be++){if(_0x130801!=''){_0x130801+='&';}_0x130801+=_0x554c4a[_0x3692be]+'='+encodeURIComponent(_0x35a59b[_0x554c4a[_0x3692be]]);_0x1109e4+=_0x35a59b[_0x554c4a[_0x3692be]];}_0x1109e4+=_0x361c7c[_0xba51('0x5a')];_0x1109e4=_0x5d02c8[_0xba51('0x5b')](_0xba51('0x5c'))[_0xba51('0x20')](_0x1109e4)[_0xba51('0x5d')](_0xba51('0x5e'));if(_0x130801!==''){_0x130801+='&';}_0x130801+=_0xba51('0x5f')+_0x1109e4;var _0x13dab5={'method':_0xba51('0x2c'),'uri':_0x361c7c[_0xba51('0x4f')]+_0xba51('0x60')+_0x130801,'json':!![]};return rp(_0x13dab5)['then'](function(_0x473bd5){var _0x185aac=Object[_0xba51('0x58')](_0x473bd5);if(_0x473bd5[_0x185aac[0x0]][_0xba51('0x22')]&&parseInt(_0x473bd5[_0x185aac[0x0]]['error'])===0x0){var _0x1a63a7={'messageId':_0x473bd5[_0x185aac[0x0]]['id_sms']};if(!_0x361c7c[_0xba51('0x34')]){_0x1a63a7[_0xba51('0x35')]=!![];}return _0x2d04ac[_0xba51('0x20')](_0x1a63a7);}else{return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x61'),util[_0xba51('0x36')](_0x473bd5[_0xba51('0x22')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3b6431){return logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x61'),util[_0xba51('0x36')](_0x3b6431,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x61'),'Missing\x20parameters:\x20apiKey');}break;case _0xba51('0x62'):if(_0x361c7c[_0xba51('0x5a')]){var _0x2edbb9={'method':_0xba51('0x2f'),'uri':_0xba51('0x63'),'headers':{'Authorization':_0x361c7c[_0xba51('0x5a')]},'body':{'content':_0x15aabc[_0xba51('0x9')],'to':[_0x15aabc['phone']],'from':_0x361c7c['phone'],'binary':![],'clientMessageId':_0xba51('0x64'),'charset':_0xba51('0x65')},'json':!![]};rp(_0x2edbb9)[_0xba51('0x12')](function(_0x112d59){if(!_0x112d59[_0xba51('0x22')]){var _0x1b3c62={'messageId':_0x112d59[_0xba51('0x46')][0x0][_0xba51('0x66')]};if(!_0x361c7c[_0xba51('0x34')]){_0x1b3c62['read']=!![];}return _0x2d04ac['update'](_0x1b3c62);}else{return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x62'),util[_0xba51('0x36')](_0x112d59[_0xba51('0x22')],{'showHidden':![],'depth':null}));}})[_0xba51('0x21')](function(_0x23e5e8){return logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),'clickatell',util[_0xba51('0x36')](_0x23e5e8,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0xba51('0x67'):if(_0x361c7c[_0xba51('0x26')]&&_0x361c7c[_0xba51('0x27')]){var _0x3b71d2=util[_0xba51('0x3d')](_0xba51('0x4a'),_0x361c7c[_0xba51('0x26')],_0x361c7c[_0xba51('0x27')]);var _0x26722d={'method':_0xba51('0x2f'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x361c7c[_0xba51('0x68')]+_0xba51('0x69'),'body':{'to':[_0x15aabc[_0xba51('0x18')]],'text':_0x15aabc[_0xba51('0x9')],'from':_0x361c7c[_0xba51('0x18')],'applicationId':_0x361c7c['applicationId']},'headers':{'Authorization':util[_0xba51('0x3d')](_0xba51('0x3f'),new Buffer(_0x3b71d2)[_0xba51('0x40')](_0xba51('0x41')))},'json':!![]};rp(_0x26722d)['then'](function(_0x35c6ed){if(_0x35c6ed['id']){var _0x4cd832={'messageId':_0x35c6ed['id']};return _0x2d04ac['update'](_0x4cd832);}else{logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x67'),util[_0xba51('0x36')](_0x35c6ed,{'showHidden':![],'depth':null}));}})['catch'](function(_0x6f46b3){logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x67'),util[_0xba51('0x36')](_0x6f46b3,{'showHidden':![],'depth':null}));});}else{logger[_0xba51('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba51('0x23'),_0xba51('0x67'),_0xba51('0x37'));}break;case _0xba51('0x6a'):if(_0x361c7c[_0xba51('0x5a')]){var _0x57648d={};var _0x13dab5={'method':_0xba51('0x2f'),'uri':_0xba51('0x6b'),'headers':{'Authorization':_0xba51('0x6c')+_0x361c7c[_0xba51('0x5a')],'Content-Type':_0xba51('0x6d')},'body':{'from':_0x361c7c[_0xba51('0x18')],'to':_0x15aabc['phone'],'text':_0x15aabc[_0xba51('0x9')]},'json':!![]};return rp(_0x13dab5)[_0xba51('0x12')](function(_0x2d8ec2){if(_0x2d8ec2[_0xba51('0x6e')]==0xca){_0x57648d[_0xba51('0x6f')]=_0x2d8ec2;var _0x54cf98={'method':'POST','uri':_0xba51('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x361c7c[_0xba51('0x5a')],'Content-Type':_0xba51('0x6d')},'body':{'refid':_0x57648d[_0xba51('0x6f')]['refid']},'json':!![]};return rp(_0x54cf98)['then'](function(_0x1241a5){_0x57648d[_0xba51('0x71')]=_0x1241a5;var _0x5e1f8e={'messageId':_0x57648d['message']['refid'],'read':!![]};return _0x2d04ac[_0xba51('0x20')](_0x5e1f8e);});}else{return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),'intelepeer',util[_0xba51('0x36')](_0x2d8ec2,{'showHidden':![],'depth':null}));}})[_0xba51('0x21')](function(_0x3abbd9){return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),'intelepeer',util[_0xba51('0x36')](_0x3abbd9,{'showHidden':![],'depth':null}));});}else{return logger[_0xba51('0x22')](_0xba51('0x24'),_0xba51('0x23'),_0xba51('0x6a'),_0xba51('0x72'));}break;}}})['finally'](function(){_0x563a91();});}else{_0x563a91();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index d2687d0..a02dd8b 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 _0xbac7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw'];(function(_0x5062da,_0x4400d2){var _0x46d327=function(_0x269596){while(--_0x269596){_0x5062da['push'](_0x5062da['shift']());}};_0x46d327(++_0x4400d2);}(_0xbac7,0xc6));var _0x7bac=function(_0x3d7b62,_0x2cfb1d){_0x3d7b62=_0x3d7b62-0x0;var _0x44bcaf=_0xbac7[_0x3d7b62];return _0x44bcaf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7bac('0x0'));var BPromise=require(_0x7bac('0x1'));var rs=require(_0x7bac('0x2'));var fs=require('fs');var Redis=require(_0x7bac('0x3'));var db=require(_0x7bac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bac('0x5'))(_0x7bac('0x6'));var config=require(_0x7bac('0x7'));var jayson=require(_0x7bac('0x8'));var client=jayson[_0x7bac('0x9')]['http']({'port':0x232a});config[_0x7bac('0xa')]=_['defaults'](config[_0x7bac('0xa')],{'host':_0x7bac('0xb'),'port':0x18eb});var socket=require(_0x7bac('0xc'))(new Redis(config[_0x7bac('0xa')]));require(_0x7bac('0xd'))[_0x7bac('0xe')](socket);function respondWithRpcPromise(_0x149665,_0x37e5f6,_0xfa05cb){return new BPromise(function(_0x4fa1d8,_0x1e2281){return client[_0x7bac('0xf')](_0x149665,_0xfa05cb)[_0x7bac('0x10')](function(_0x1aea70){logger[_0x7bac('0x11')](_0x7bac('0x12'),_0x37e5f6,_0x7bac('0x13'));logger[_0x7bac('0x14')](_0x7bac('0x15'),_0x37e5f6,_0x7bac('0x13'),JSON['stringify'](_0x1aea70));if(_0x1aea70[_0x7bac('0x16')]){if(_0x1aea70[_0x7bac('0x16')][_0x7bac('0x17')]===0x1f4){logger[_0x7bac('0x16')](_0x7bac('0x12'),_0x37e5f6,_0x1aea70[_0x7bac('0x16')]['message']);return _0x1e2281(_0x1aea70['error'][_0x7bac('0x18')]);}logger['error'](_0x7bac('0x12'),_0x37e5f6,_0x1aea70['error']['message']);return _0x4fa1d8(_0x1aea70[_0x7bac('0x16')][_0x7bac('0x18')]);}else{logger[_0x7bac('0x11')](_0x7bac('0x12'),_0x37e5f6,_0x7bac('0x13'));_0x4fa1d8(_0x1aea70[_0x7bac('0x19')][_0x7bac('0x18')]);}})[_0x7bac('0x1a')](function(_0xd24724){logger[_0x7bac('0x16')](_0x7bac('0x12'),_0x37e5f6,_0xd24724);_0x1e2281(_0xd24724);});});}exports[_0x7bac('0x1b')]=function(_0x10fe83){var _0x1aff15=this;return new Promise(function(_0x28d500,_0x71fd34){return db[_0x7bac('0x1c')][_0x7bac('0x1d')](_0x10fe83[_0x7bac('0x1e')],{'raw':_0x10fe83[_0x7bac('0x1f')]?_0x10fe83[_0x7bac('0x1f')][_0x7bac('0x20')]===undefined?!![]:![]:!![]})[_0x7bac('0x10')](function(_0xef674c){logger[_0x7bac('0x11')](_0x7bac('0x1b'),_0x10fe83);logger[_0x7bac('0x14')](_0x7bac('0x1b'),_0x10fe83,JSON['stringify'](_0xef674c));_0x28d500(_0xef674c);})[_0x7bac('0x1a')](function(_0x567094){logger[_0x7bac('0x16')](_0x7bac('0x1b'),_0x567094[_0x7bac('0x18')],_0x10fe83);_0x71fd34(_0x1aff15['error'](0x1f4,_0x567094['message']));});});}; \ No newline at end of file +var _0x0f7a=['SmsMessage','create','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsMessage'];(function(_0x4431d9,_0x3c4830){var _0x596fe1=function(_0x1c3ab2){while(--_0x1c3ab2){_0x4431d9['push'](_0x4431d9['shift']());}};_0x596fe1(++_0x3c4830);}(_0x0f7a,0xb8));var _0xa0f7=function(_0xf54a80,_0x4f0c6a){_0xf54a80=_0xf54a80-0x0;var _0x208e95=_0x0f7a[_0xf54a80];return _0x208e95;};'use strict';var _=require(_0xa0f7('0x0'));var util=require(_0xa0f7('0x1'));var moment=require(_0xa0f7('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0f7('0x4'))['db'];var utils=require(_0xa0f7('0x5'));var logger=require(_0xa0f7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0f7('0x7'));var client=jayson[_0xa0f7('0x8')][_0xa0f7('0x9')]({'port':0x232a});config[_0xa0f7('0xa')]=_['defaults'](config[_0xa0f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0f7('0xb'))(new Redis(config['redis']));require(_0xa0f7('0xc'))[_0xa0f7('0xd')](socket);function respondWithRpcPromise(_0x51b5f2,_0x16ed81,_0x4b48f8){return new BPromise(function(_0x1054b1,_0x4f3565){return client['request'](_0x51b5f2,_0x4b48f8)[_0xa0f7('0xe')](function(_0x4190cf){logger[_0xa0f7('0xf')](_0xa0f7('0x10'),_0x16ed81,_0xa0f7('0x11'));logger[_0xa0f7('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x16ed81,_0xa0f7('0x11'),JSON[_0xa0f7('0x13')](_0x4190cf));if(_0x4190cf[_0xa0f7('0x14')]){if(_0x4190cf[_0xa0f7('0x14')][_0xa0f7('0x15')]===0x1f4){logger[_0xa0f7('0x14')]('SmsMessage,\x20%s,\x20%s',_0x16ed81,_0x4190cf[_0xa0f7('0x14')][_0xa0f7('0x16')]);return _0x4f3565(_0x4190cf[_0xa0f7('0x14')][_0xa0f7('0x16')]);}logger[_0xa0f7('0x14')](_0xa0f7('0x10'),_0x16ed81,_0x4190cf[_0xa0f7('0x14')][_0xa0f7('0x16')]);return _0x1054b1(_0x4190cf['error'][_0xa0f7('0x16')]);}else{logger[_0xa0f7('0xf')](_0xa0f7('0x10'),_0x16ed81,_0xa0f7('0x11'));_0x1054b1(_0x4190cf[_0xa0f7('0x17')]['message']);}})[_0xa0f7('0x18')](function(_0x344f3b){logger[_0xa0f7('0x14')](_0xa0f7('0x10'),_0x16ed81,_0x344f3b);_0x4f3565(_0x344f3b);});});}exports[_0xa0f7('0x19')]=function(_0x1772ba){var _0x4556c9=this;return new Promise(function(_0x56b4f0,_0x22e0da){return db[_0xa0f7('0x1a')][_0xa0f7('0x1b')](_0x1772ba['body'],{'raw':_0x1772ba[_0xa0f7('0x1c')]?_0x1772ba['options'][_0xa0f7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x525777){logger[_0xa0f7('0xf')](_0xa0f7('0x19'),_0x1772ba);logger[_0xa0f7('0x12')](_0xa0f7('0x19'),_0x1772ba,JSON[_0xa0f7('0x13')](_0x525777));_0x56b4f0(_0x525777);})[_0xa0f7('0x18')](function(_0x38a308){logger[_0xa0f7('0x14')](_0xa0f7('0x19'),_0x38a308[_0xa0f7('0x16')],_0x1772ba);_0x22e0da(_0x4556c9[_0xa0f7('0x14')](0x1f4,_0x38a308[_0xa0f7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c0ba696..90f9a77 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 _0x5743=['update','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x597f01,_0x83ba4a){var _0xa2ec4b=function(_0x4285ae){while(--_0x4285ae){_0x597f01['push'](_0x597f01['shift']());}};_0xa2ec4b(++_0x83ba4a);}(_0x5743,0x1bd));var _0x3574=function(_0x33f140,_0x577e45){_0x33f140=_0x33f140-0x0;var _0x5bbc77=_0x5743[_0x33f140];return _0x5bbc77;};'use strict';var SmsMessageEvents=require(_0x3574('0x0'));var events=[_0x3574('0x1'),_0x3574('0x2'),_0x3574('0x3')];function createListener(_0x4380c6,_0x46ad21){return function(_0x25c801){_0x46ad21['emit'](_0x4380c6,_0x25c801);};}function removeListener(_0xe14553,_0x8e4dd9){return function(){SmsMessageEvents[_0x3574('0x4')](_0xe14553,_0x8e4dd9);};}exports[_0x3574('0x5')]=function(_0x3f8ed2){for(var _0x2ed296=0x0,_0x35f42f=events[_0x3574('0x6')];_0x2ed296<_0x35f42f;_0x2ed296++){var _0x25551b=events[_0x2ed296];var _0x18b923=createListener(_0x3574('0x7')+_0x25551b,_0x3f8ed2);SmsMessageEvents['on'](_0x25551b,_0x18b923);}}; \ No newline at end of file +var _0x0880=['./smsMessage.events','save','remove','update','emit','removeListener','length','smsMessage:'];(function(_0x5a67d2,_0x101dea){var _0xcf4fa=function(_0x4dd648){while(--_0x4dd648){_0x5a67d2['push'](_0x5a67d2['shift']());}};_0xcf4fa(++_0x101dea);}(_0x0880,0x150));var _0x0088=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x0880[_0x3fc97b];return _0x3a0c82;};'use strict';var SmsMessageEvents=require(_0x0088('0x0'));var events=[_0x0088('0x1'),_0x0088('0x2'),_0x0088('0x3')];function createListener(_0x57c90c,_0x205b33){return function(_0x27bf94){_0x205b33[_0x0088('0x4')](_0x57c90c,_0x27bf94);};}function removeListener(_0x194fdd,_0x3c2545){return function(){SmsMessageEvents[_0x0088('0x5')](_0x194fdd,_0x3c2545);};}exports['register']=function(_0x5bcbfb){for(var _0x525ca0=0x0,_0x27aea0=events[_0x0088('0x6')];_0x525ca0<_0x27aea0;_0x525ca0++){var _0x420ba0=events[_0x525ca0];var _0xaba7cf=createListener(_0x0088('0x7')+_0x420ba0,_0x5bcbfb);SmsMessageEvents['on'](_0x420ba0,_0xaba7cf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index d6c1080..c686b6f 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 _0xe524=['/:id/users','addAgents','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','post','create','addTeams'];(function(_0x3b04c5,_0x5c4d3a){var _0xa0dc3a=function(_0x11051b){while(--_0x11051b){_0x3b04c5['push'](_0x3b04c5['shift']());}};_0xa0dc3a(++_0x5c4d3a);}(_0xe524,0x8d));var _0x4e52=function(_0x4aca44,_0x5aa3d5){_0x4aca44=_0x4aca44-0x0;var _0x55e521=_0xe524[_0x4aca44];return _0x55e521;};'use strict';var multer=require(_0x4e52('0x0'));var util=require(_0x4e52('0x1'));var path=require(_0x4e52('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e52('0x3'));var router=express[_0x4e52('0x4')]();var fs_extra=require(_0x4e52('0x5'));var auth=require(_0x4e52('0x6'));var interaction=require(_0x4e52('0x7'));var config=require(_0x4e52('0x8'));var controller=require(_0x4e52('0x9'));router[_0x4e52('0xa')]('/',auth[_0x4e52('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4e52('0xc')]);router[_0x4e52('0xa')](_0x4e52('0xd'),auth[_0x4e52('0xb')](),controller[_0x4e52('0xe')]);router['get'](_0x4e52('0xf'),auth[_0x4e52('0xb')](),controller['getMembers']);router[_0x4e52('0xa')](_0x4e52('0x10'),auth['isAuthenticated'](),controller[_0x4e52('0x11')]);router['get']('/:id/users',auth[_0x4e52('0xb')](),controller['getAgents']);router[_0x4e52('0x12')]('/',auth[_0x4e52('0xb')](),controller[_0x4e52('0x13')]);router[_0x4e52('0x12')]('/:id/teams',auth[_0x4e52('0xb')](),controller[_0x4e52('0x14')]);router[_0x4e52('0x12')](_0x4e52('0x15'),auth[_0x4e52('0xb')](),controller[_0x4e52('0x16')]);router['put'](_0x4e52('0xd'),auth[_0x4e52('0xb')](),controller[_0x4e52('0x17')]);router[_0x4e52('0x18')](_0x4e52('0xd'),auth[_0x4e52('0xb')](),controller['destroy']);router[_0x4e52('0x18')](_0x4e52('0x10'),auth[_0x4e52('0xb')](),controller['removeTeams']);router[_0x4e52('0x18')](_0x4e52('0x15'),auth[_0x4e52('0xb')](),controller[_0x4e52('0x19')]);module[_0x4e52('0x1a')]=router; \ No newline at end of file +var _0x5516=['create','/:id/teams','addTeams','addAgents','put','destroy','removeTeams','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','getTeams','/:id/users','post'];(function(_0x149761,_0x24242d){var _0x27e4d3=function(_0x3a8e90){while(--_0x3a8e90){_0x149761['push'](_0x149761['shift']());}};_0x27e4d3(++_0x24242d);}(_0x5516,0x1bc));var _0x6551=function(_0x1d99a1,_0x2baa4b){_0x1d99a1=_0x1d99a1-0x0;var _0x46571b=_0x5516[_0x1d99a1];return _0x46571b;};'use strict';var multer=require(_0x6551('0x0'));var util=require(_0x6551('0x1'));var path=require(_0x6551('0x2'));var timeout=require(_0x6551('0x3'));var express=require(_0x6551('0x4'));var router=express[_0x6551('0x5')]();var fs_extra=require(_0x6551('0x6'));var auth=require(_0x6551('0x7'));var interaction=require(_0x6551('0x8'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x6551('0x9')]('/',auth['isAuthenticated'](),controller[_0x6551('0xa')]);router[_0x6551('0x9')](_0x6551('0xb'),auth['isAuthenticated'](),controller[_0x6551('0xc')]);router[_0x6551('0x9')](_0x6551('0xd'),auth[_0x6551('0xe')](),controller[_0x6551('0xf')]);router[_0x6551('0x9')]('/:id/members',auth[_0x6551('0xe')](),controller[_0x6551('0x10')]);router[_0x6551('0x9')]('/:id/teams',auth[_0x6551('0xe')](),controller[_0x6551('0x11')]);router[_0x6551('0x9')](_0x6551('0x12'),auth[_0x6551('0xe')](),controller['getAgents']);router[_0x6551('0x13')]('/',auth['isAuthenticated'](),controller[_0x6551('0x14')]);router[_0x6551('0x13')](_0x6551('0x15'),auth['isAuthenticated'](),controller[_0x6551('0x16')]);router[_0x6551('0x13')](_0x6551('0x12'),auth[_0x6551('0xe')](),controller[_0x6551('0x17')]);router[_0x6551('0x18')](_0x6551('0xd'),auth[_0x6551('0xe')](),controller['update']);router['delete'](_0x6551('0xd'),auth[_0x6551('0xe')](),controller[_0x6551('0x19')]);router['delete'](_0x6551('0x15'),auth[_0x6551('0xe')](),controller[_0x6551('0x1a')]);router[_0x6551('0x1b')]('/:id/users',auth[_0x6551('0xe')](),controller[_0x6551('0x1c')]);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 4bbda9b..bf4e180 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 _0x4b36=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x104c7f,_0x23fbcc){var _0x55856b=function(_0x46b543){while(--_0x46b543){_0x104c7f['push'](_0x104c7f['shift']());}};_0x55856b(++_0x23fbcc);}(_0x4b36,0x154));var _0x64b3=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x4b36[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require(_0x64b3('0x0'));module[_0x64b3('0x1')]={'name':{'type':Sequelize[_0x64b3('0x2')],'unique':_0x64b3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x64b3('0x2')]},'timeout':{'type':Sequelize[_0x64b3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x64b3('0x5')](_0x64b3('0x6'),_0x64b3('0x7'),_0x64b3('0x8'))}}; \ No newline at end of file +var _0x5383=['ENUM','beepall','roundrobin','sequelize'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5383,0x1ab));var _0x3538=function(_0x5e8d0a,_0x37bd76){_0x5e8d0a=_0x5e8d0a-0x0;var _0x3b6644=_0x5383[_0x5e8d0a];return _0x3b6644;};'use strict';var Sequelize=require(_0x3538('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3538('0x1')]('rrmemory',_0x3538('0x2'),_0x3538('0x3'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b1ae292..798a027 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 _0x442b=['register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','stack','name','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','include','findAll','rows','catch','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','params','describe','getMembers','findOne','UserSmsQueue','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','createdAt','Team','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','each','forEach','emit','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','userSmsQueue:save','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x442b,0x6f));var _0xb442=function(_0x87c2f0,_0xeb511f){_0x87c2f0=_0x87c2f0-0x0;var _0x2542af=_0x442b[_0x87c2f0];return _0x2542af;};'use strict';var emlformat=require(_0xb442('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb442('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb442('0x2'));var moment=require(_0xb442('0x3'));var BPromise=require(_0xb442('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb442('0x5'));var sox=require(_0xb442('0x6'));var csv=require('to-csv');var ejs=require(_0xb442('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb442('0x8'));var squel=require(_0xb442('0x9'));var crypto=require(_0xb442('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb442('0xb'));var toCsv=require(_0xb442('0xc'));var querystring=require(_0xb442('0xd'));var Papa=require(_0xb442('0xe'));var Redis=require('ioredis');var authService=require(_0xb442('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb442('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb442('0x11'))(_0xb442('0x12'));var utils=require(_0xb442('0x13'));var config=require(_0xb442('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb442('0x15'))['db'];config[_0xb442('0x16')]=_['defaults'](config[_0xb442('0x16')],{'host':_0xb442('0x17'),'port':0x18eb});var socket=require(_0xb442('0x18'))(new Redis(config[_0xb442('0x16')]));require(_0xb442('0x19'))[_0xb442('0x1a')](socket);function respondWithStatusCode(_0x2fd072,_0x25353a){_0x25353a=_0x25353a||0xcc;return function(_0x508052){if(_0x508052){return _0x2fd072[_0xb442('0x1b')](_0x25353a);}return _0x2fd072['status'](_0x25353a)[_0xb442('0x1c')]();};}function respondWithResult(_0x3c5487,_0x567fc9){_0x567fc9=_0x567fc9||0xc8;return function(_0x1cd20d){if(_0x1cd20d){return _0x3c5487[_0xb442('0x1d')](_0x567fc9)[_0xb442('0x1e')](_0x1cd20d);}};}function respondWithFilteredResult(_0x1f8eee,_0x301880){return function(_0x141695){if(_0x141695){var _0x33dcc3=typeof _0x301880[_0xb442('0x1f')]===_0xb442('0x20')&&typeof _0x301880[_0xb442('0x21')]===_0xb442('0x20');var _0x429e1c=_0x141695['count'];var _0xe816ba=_0x33dcc3?0x0:_0x301880['offset'];var _0x28c8b1=_0x33dcc3?_0x141695[_0xb442('0x22')]:_0x301880[_0xb442('0x1f')]+_0x301880['limit'];var _0x298b9a;if(_0x28c8b1>=_0x429e1c){_0x28c8b1=_0x429e1c;_0x298b9a=0xc8;}else{_0x298b9a=0xce;}_0x1f8eee[_0xb442('0x1d')](_0x298b9a);return _0x1f8eee[_0xb442('0x23')](_0xb442('0x24'),_0xe816ba+'-'+_0x28c8b1+'/'+_0x429e1c)[_0xb442('0x1e')](_0x141695);}return null;};}function patchUpdates(_0x1c5f3a){return function(_0x100afc){try{jsonpatch['apply'](_0x100afc,_0x1c5f3a,!![]);}catch(_0x2f57b4){return BPromise[_0xb442('0x25')](_0x2f57b4);}return _0x100afc[_0xb442('0x26')]();};}function saveUpdates(_0xedd848,_0x527a72){return function(_0x3c3940){if(_0x3c3940){return _0x3c3940['update'](_0xedd848)[_0xb442('0x27')](function(_0x1e4298){return _0x1e4298;});}return null;};}function removeEntity(_0x39d8ea,_0x521d87){return function(_0x3334ca){if(_0x3334ca){return _0x3334ca[_0xb442('0x28')]()[_0xb442('0x27')](function(){var _0x579b4c=_0x3334ca['get']({'plain':!![]});var _0x18fbd4='SmsQueues';return db[_0xb442('0x29')]['destroy']({'where':{'type':_0x18fbd4,'resourceId':_0x579b4c['id']}})[_0xb442('0x27')](function(){return _0x3334ca;});})[_0xb442('0x27')](function(){_0x39d8ea['status'](0xcc)[_0xb442('0x1c')]();});}};}function handleEntityNotFound(_0x47a1ae,_0x54a7b3){return function(_0x41f1c4){if(!_0x41f1c4){_0x47a1ae['sendStatus'](0x194);}return _0x41f1c4;};}function handleError(_0x6abfbf,_0x1264c3){_0x1264c3=_0x1264c3||0x1f4;return function(_0x2eac67){logger['error'](_0x2eac67[_0xb442('0x2a')]);if(_0x2eac67['name']){delete _0x2eac67[_0xb442('0x2b')];}_0x6abfbf[_0xb442('0x1d')](_0x1264c3)['send'](_0x2eac67);};}exports[_0xb442('0x2c')]=function(_0xf0274e,_0x12a79f){var _0x10c44d={},_0x1fc0c7={},_0x5167d4={'count':0x0,'rows':[]};var _0x24225e=_['map'](db[_0xb442('0x2d')][_0xb442('0x2e')],function(_0x27e5d8){return{'name':_0x27e5d8[_0xb442('0x2f')],'type':_0x27e5d8[_0xb442('0x30')][_0xb442('0x31')]};});_0x1fc0c7[_0xb442('0x32')]=_['map'](_0x24225e,_0xb442('0x2b'));_0x1fc0c7[_0xb442('0x33')]=_[_0xb442('0x34')](_0xf0274e['query']);_0x1fc0c7[_0xb442('0x35')]=_[_0xb442('0x36')](_0x1fc0c7[_0xb442('0x32')],_0x1fc0c7[_0xb442('0x33')]);_0x10c44d['attributes']=_[_0xb442('0x36')](_0x1fc0c7[_0xb442('0x32')],qs[_0xb442('0x37')](_0xf0274e[_0xb442('0x33')][_0xb442('0x37')]));_0x10c44d['attributes']=_0x10c44d[_0xb442('0x38')][_0xb442('0x39')]?_0x10c44d[_0xb442('0x38')]:_0x1fc0c7['model'];if(!_0xf0274e[_0xb442('0x33')][_0xb442('0x3a')](_0xb442('0x3b'))){_0x10c44d['limit']=qs[_0xb442('0x21')](_0xf0274e[_0xb442('0x33')][_0xb442('0x21')]);_0x10c44d[_0xb442('0x1f')]=qs[_0xb442('0x1f')](_0xf0274e[_0xb442('0x33')][_0xb442('0x1f')]);}_0x10c44d[_0xb442('0x3c')]=qs['sort'](_0xf0274e['query'][_0xb442('0x3d')]);_0x10c44d[_0xb442('0x3e')]=qs[_0xb442('0x35')](_[_0xb442('0x3f')](_0xf0274e[_0xb442('0x33')],_0x1fc0c7[_0xb442('0x35')]),_0x24225e);if(_0xf0274e[_0xb442('0x33')][_0xb442('0x40')]){_0x10c44d[_0xb442('0x3e')]=_['merge'](_0x10c44d['where'],{'$or':_[_0xb442('0x41')](_0x24225e,function(_0x2166c1){if(_0x2166c1[_0xb442('0x30')]!==_0xb442('0x42')){var _0x2c9f07={};_0x2c9f07[_0x2166c1[_0xb442('0x2b')]]={'$like':'%'+_0xf0274e[_0xb442('0x33')][_0xb442('0x40')]+'%'};return _0x2c9f07;}})});}_0x10c44d=_['merge']({},_0x10c44d,_0xf0274e['options']);var _0x414dbe={'where':_0x10c44d[_0xb442('0x3e')]};return db[_0xb442('0x2d')]['count'](_0x414dbe)[_0xb442('0x27')](function(_0x428cd4){_0x5167d4[_0xb442('0x22')]=_0x428cd4;if(_0xf0274e[_0xb442('0x33')]['includeAll']){_0x10c44d[_0xb442('0x43')]=[{'all':!![]}];}return db[_0xb442('0x2d')][_0xb442('0x44')](_0x10c44d);})[_0xb442('0x27')](function(_0x4ba9ff){_0x5167d4[_0xb442('0x45')]=_0x4ba9ff;return _0x5167d4;})['then'](respondWithFilteredResult(_0x12a79f,_0x10c44d))[_0xb442('0x46')](handleError(_0x12a79f,null));};exports['show']=function(_0x206235,_0x2db200){var _0x5efb0a={'raw':!![],'where':{'id':_0x206235['params']['id']}},_0xdac3f2={};_0xdac3f2['model']=_[_0xb442('0x34')](db[_0xb442('0x2d')][_0xb442('0x2e')]);_0xdac3f2[_0xb442('0x33')]=_[_0xb442('0x34')](_0x206235[_0xb442('0x33')]);_0xdac3f2[_0xb442('0x35')]=_[_0xb442('0x36')](_0xdac3f2[_0xb442('0x32')],_0xdac3f2[_0xb442('0x33')]);_0x5efb0a[_0xb442('0x38')]=_['intersection'](_0xdac3f2[_0xb442('0x32')],qs[_0xb442('0x37')](_0x206235['query'][_0xb442('0x37')]));_0x5efb0a[_0xb442('0x38')]=_0x5efb0a[_0xb442('0x38')][_0xb442('0x39')]?_0x5efb0a[_0xb442('0x38')]:_0xdac3f2[_0xb442('0x32')];if(_0x206235[_0xb442('0x33')][_0xb442('0x47')]){_0x5efb0a[_0xb442('0x43')]=[{'all':!![]}];}_0x5efb0a=_[_0xb442('0x48')]({},_0x5efb0a,_0x206235[_0xb442('0x49')]);return db[_0xb442('0x2d')][_0xb442('0x4a')](_0x5efb0a)[_0xb442('0x27')](handleEntityNotFound(_0x2db200,null))[_0xb442('0x27')](respondWithResult(_0x2db200,null))['catch'](handleError(_0x2db200,null));};exports['create']=function(_0x4cf3a9,_0x1f0a39){return db[_0xb442('0x2d')][_0xb442('0x4b')](_0x4cf3a9[_0xb442('0x4c')],{})[_0xb442('0x27')](function(_0xb09974){var _0x3a5806=_0x4cf3a9[_0xb442('0x4d')][_0xb442('0x4e')]({'plain':!![]});if(!_0x3a5806)throw new Error(_0xb442('0x4f'));if(_0x3a5806[_0xb442('0x50')]===_0xb442('0x4d')){var _0x4ae919=_0xb09974[_0xb442('0x4e')]({'plain':!![]});var _0x387865='SmsQueues';return db[_0xb442('0x51')][_0xb442('0x4a')]({'where':{'name':_0x387865,'userProfileId':_0x3a5806[_0xb442('0x52')]},'raw':!![]})[_0xb442('0x27')](function(_0x330fe6){if(_0x330fe6&&_0x330fe6[_0xb442('0x53')]===0x0){return db[_0xb442('0x29')][_0xb442('0x4b')]({'name':_0x4ae919[_0xb442('0x2b')],'resourceId':_0x4ae919['id'],'type':_0x330fe6['name'],'sectionId':_0x330fe6['id']},{})[_0xb442('0x27')](function(){return _0xb09974;});}else{return _0xb09974;}})[_0xb442('0x46')](function(_0x3cc712){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cc712);throw _0x3cc712;});}return _0xb09974;})[_0xb442('0x27')](respondWithResult(_0x1f0a39,0xc9))['catch'](handleError(_0x1f0a39,null));};exports[_0xb442('0x54')]=function(_0xeaecaf,_0x5e8f22){if(_0xeaecaf[_0xb442('0x4c')]['id']){delete _0xeaecaf[_0xb442('0x4c')]['id'];}return db[_0xb442('0x2d')][_0xb442('0x4a')]({'where':{'id':_0xeaecaf[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0x5e8f22,null))[_0xb442('0x27')](saveUpdates(_0xeaecaf[_0xb442('0x4c')],null))[_0xb442('0x27')](respondWithResult(_0x5e8f22,null))['catch'](handleError(_0x5e8f22,null));};exports[_0xb442('0x28')]=function(_0x1c0038,_0x1f9aaf){return db['SmsQueue']['find']({'where':{'id':_0x1c0038[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0x1f9aaf,null))[_0xb442('0x27')](removeEntity(_0x1f9aaf,null))[_0xb442('0x46')](handleError(_0x1f9aaf,null));};exports[_0xb442('0x56')]=function(_0x4021c6,_0x490e08){return db[_0xb442('0x2d')][_0xb442('0x56')]()[_0xb442('0x27')](respondWithResult(_0x490e08,null))[_0xb442('0x46')](handleError(_0x490e08,null));};exports[_0xb442('0x57')]=function(_0x35146c,_0x3aef4b,_0x369126){var _0x1fe4db={'raw':!![],'where':{}},_0x257d21={},_0x519188;return db[_0xb442('0x2d')][_0xb442('0x58')]({'where':{'id':_0x35146c[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0x3aef4b,null))[_0xb442('0x27')](function(_0x1e6722){if(_0x1e6722){_0x519188=_0x1e6722[_0xb442('0x4e')]({'plain':!![]});_0x257d21[_0xb442('0x32')]=_[_0xb442('0x34')](db[_0xb442('0x59')][_0xb442('0x2e')]);_0x257d21[_0xb442('0x33')]=_[_0xb442('0x34')](_0x35146c[_0xb442('0x33')]);_0x257d21[_0xb442('0x35')]=_[_0xb442('0x36')](_0x257d21['model'],_0x257d21['query']);_0x1fe4db[_0xb442('0x38')]=_[_0xb442('0x36')](_0x257d21['model'],qs[_0xb442('0x37')](_0x35146c[_0xb442('0x33')][_0xb442('0x37')]));_0x1fe4db[_0xb442('0x38')]=_0x1fe4db[_0xb442('0x38')][_0xb442('0x39')]?_0x1fe4db[_0xb442('0x38')]:_0x257d21[_0xb442('0x32')];if(!_0x35146c[_0xb442('0x33')][_0xb442('0x3a')](_0xb442('0x3b'))){_0x1fe4db['limit']=qs[_0xb442('0x21')](_0x35146c[_0xb442('0x33')][_0xb442('0x21')]);_0x1fe4db[_0xb442('0x1f')]=qs[_0xb442('0x1f')](_0x35146c[_0xb442('0x33')]['offset']);}_0x1fe4db[_0xb442('0x3c')]=qs[_0xb442('0x3d')](_0x35146c[_0xb442('0x33')][_0xb442('0x3d')]);_0x1fe4db[_0xb442('0x3e')]=qs[_0xb442('0x35')](_[_0xb442('0x3f')](_0x35146c[_0xb442('0x33')],_0x257d21[_0xb442('0x35')]));_0x1fe4db[_0xb442('0x3e')]['SmsQueueId']=_0x1e6722['id'];if(_0x35146c[_0xb442('0x33')][_0xb442('0x40')]){_0x1fe4db[_0xb442('0x3e')]=_[_0xb442('0x48')](_0x1fe4db[_0xb442('0x3e')],{'$or':_[_0xb442('0x41')](_0x1fe4db['attributes'],function(_0x2321c2){var _0x20b707={};_0x20b707[_0x2321c2]={'$like':'%'+_0x35146c[_0xb442('0x33')][_0xb442('0x40')]+'%'};return _0x20b707;})});}_0x1fe4db=_[_0xb442('0x48')]({},_0x1fe4db,_0x35146c['options']);return db[_0xb442('0x59')][_0xb442('0x44')](_0x1fe4db);}})[_0xb442('0x27')](function(_0x437047){if(_0x437047){return db[_0xb442('0x5a')][_0xb442('0x5b')]({'where':{'id':_[_0xb442('0x41')](_0x437047,_0xb442('0x5c')),'role':_0xb442('0x5d')},'attributes':['id',_0xb442('0x2b'),'smsPause',_0xb442('0x5e'),'createdAt']});}})[_0xb442('0x27')](function(_0x1830a0){if(_0x1830a0){return{'count':_0x1830a0[_0xb442('0x22')],'rows':_['map'](_0x1830a0['rows'],function(_0x43a4ad){return{'membername':_0x43a4ad[_0xb442('0x2b')],'UserId':_0x43a4ad['id'],'queue_name':_0x519188[_0xb442('0x2b')],'SmsQueueId':_0x519188['id'],'interface':util[_0xb442('0x5f')]('%s/%s',_0xb442('0x60'),_0x43a4ad['name']),'penalty':0x0,'paused':_0x43a4ad['smsPause'],'createdAt':_0x43a4ad[_0xb442('0x61')],'updatedAt':_0x43a4ad['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb442('0x27')](respondWithFilteredResult(_0x3aef4b,_0x1fe4db))[_0xb442('0x46')](handleError(_0x3aef4b,null));};exports['getTeams']=function(_0x1fdc1c,_0x21ff26,_0xad0d46){var _0x37b98a={};var _0x33307a={};var _0x3bff9d;var _0x104fbf;return db[_0xb442('0x2d')][_0xb442('0x58')]({'where':{'id':_0x1fdc1c[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0x21ff26,null))['then'](function(_0x1ed265){if(_0x1ed265){_0x3bff9d=_0x1ed265;_0x33307a[_0xb442('0x32')]=_[_0xb442('0x34')](db[_0xb442('0x62')][_0xb442('0x2e')]);_0x33307a['query']=_[_0xb442('0x34')](_0x1fdc1c[_0xb442('0x33')]);_0x33307a[_0xb442('0x35')]=_[_0xb442('0x36')](_0x33307a[_0xb442('0x32')],_0x33307a['query']);_0x37b98a['attributes']=_[_0xb442('0x36')](_0x33307a[_0xb442('0x32')],qs[_0xb442('0x37')](_0x1fdc1c[_0xb442('0x33')][_0xb442('0x37')]));_0x37b98a['attributes']=_0x37b98a[_0xb442('0x38')][_0xb442('0x39')]?_0x37b98a[_0xb442('0x38')]:_0x33307a[_0xb442('0x32')];_0x37b98a[_0xb442('0x3c')]=qs['sort'](_0x1fdc1c[_0xb442('0x33')][_0xb442('0x3d')]);_0x37b98a['where']=qs[_0xb442('0x35')](_[_0xb442('0x3f')](_0x1fdc1c[_0xb442('0x33')],_0x33307a['filters']));if(_0x1fdc1c[_0xb442('0x33')][_0xb442('0x40')]){_0x37b98a['where']=_[_0xb442('0x48')](_0x37b98a['where'],{'$or':_[_0xb442('0x41')](_0x37b98a['attributes'],function(_0x49bee6){var _0x1a5861={};_0x1a5861[_0x49bee6]={'$like':'%'+_0x1fdc1c[_0xb442('0x33')][_0xb442('0x40')]+'%'};return _0x1a5861;})});}_0x37b98a=_['merge']({},_0x37b98a,_0x1fdc1c[_0xb442('0x49')]);return _0x3bff9d[_0xb442('0x63')](_0x37b98a);}})['then'](function(_0x567455){if(_0x567455){_0x104fbf=_0x567455[_0xb442('0x39')];if(!_0x1fdc1c[_0xb442('0x33')][_0xb442('0x3a')](_0xb442('0x3b'))){_0x37b98a[_0xb442('0x21')]=qs[_0xb442('0x21')](_0x1fdc1c[_0xb442('0x33')]['limit']);_0x37b98a[_0xb442('0x1f')]=qs[_0xb442('0x1f')](_0x1fdc1c[_0xb442('0x33')][_0xb442('0x1f')]);}return _0x3bff9d[_0xb442('0x63')](_0x37b98a);}})[_0xb442('0x27')](function(_0x5234a1){if(_0x5234a1){return _0x5234a1?{'count':_0x104fbf,'rows':_0x5234a1}:null;}})[_0xb442('0x27')](respondWithResult(_0x21ff26,null))[_0xb442('0x46')](handleError(_0x21ff26,null));};exports[_0xb442('0x64')]=function(_0x9281aa,_0x41a3d5,_0xc58f72){var _0x32fe69=_0x9281aa[_0xb442('0x4c')][_0xb442('0x65')];return db['Team'][_0xb442('0x44')]({'where':{'id':_0x32fe69},'attributes':['id'],'include':[{'model':db[_0xb442('0x5a')],'as':'Agents','attributes':['id',_0xb442('0x2b'),_0xb442('0x66'),_0xb442('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x1e3943){if(_0x1e3943){var _0x33aa70=_[_0xb442('0x68')](_0x1e3943,function(_0x549cf9){var _0x5aa976=_0x549cf9[_0xb442('0x4e')]({'plain':!![]});return _0x5aa976[_0xb442('0x69')];});return db['SmsQueue'][_0xb442('0x4a')]({'where':{'id':_0x9281aa[_0xb442('0x55')]['id']}})['then'](function(_0x56d307){return db['sequelize']['transaction'](function(_0x4133ee){return _0x56d307[_0xb442('0x64')](_0x32fe69,{'transaction':_0x4133ee})[_0xb442('0x27')](function(){return BPromise[_0xb442('0x6a')](_0x33aa70,function(_0x2eda55){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x2eda55['id'],'SmsQueueId':_0x9281aa[_0xb442('0x55')]['id']},'transaction':_0x4133ee});});})[_0xb442('0x27')](function(){_0x33aa70[_0xb442('0x6b')](function(_0x145b5d){socket[_0xb442('0x6c')]('userSmsQueue:save',{'UserId':_0x145b5d['id'],'SmsQueueId':_0x56d307['id']});});});});});}})['then'](respondWithStatusCode(_0x41a3d5,null))[_0xb442('0x46')](handleError(_0x41a3d5,null));};exports['removeTeams']=function(_0x3436d7,_0x3e2630,_0x470027){return db['Team'][_0xb442('0x44')]({'where':{'id':_0x3436d7[_0xb442('0x33')][_0xb442('0x65')]},'attributes':['id'],'include':[{'model':db[_0xb442('0x5a')],'as':_0xb442('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb442('0x27')](handleEntityNotFound(_0x3e2630,null))[_0xb442('0x27')](function(_0x35de2d){var _0x5c6de0=_[_0xb442('0x41')](_0x35de2d,'id');var _0x1cee12=[];var _0x59b55a=[];var _0x34759c=squel[_0xb442('0x6d')]();_0x34759c[_0xb442('0x6e')](_0xb442('0x6f'))[_0xb442('0x70')](_0xb442('0x71'),'tq')['join'](_0xb442('0x72'),'ut',_0xb442('0x73'))[_0xb442('0x3e')]('SmsQueueId\x20=\x20?',_0x3436d7[_0xb442('0x55')]['id']);for(var _0xfa3a50=0x0;_0xfa3a50<_0x35de2d[_0xb442('0x39')];_0xfa3a50+=0x1){let _0x39af85=_0x35de2d[_0xfa3a50];for(var _0x1d7d46=0x0;_0x1d7d46<_0x39af85[_0xb442('0x69')][_0xb442('0x39')];_0x1d7d46+=0x1){let _0x544a85=_0x39af85[_0xb442('0x69')][_0x1d7d46];var _0x29fbe2=_0x34759c['clone']();_0x29fbe2['where'](_0xb442('0x74'),_0x544a85['id']);_0x59b55a[_0xb442('0x75')](db['sequelize'][_0xb442('0x33')](_0x29fbe2[_0xb442('0x76')](),{'type':db[_0xb442('0x77')][_0xb442('0x78')][_0xb442('0x79')]})[_0xb442('0x27')](function(_0x1962ae){if(_0x1962ae[_0xb442('0x39')]===0x1){return _0x544a85['id'];}else{var _0x2b18a8=_[_0xb442('0x7a')](_[_0xb442('0x41')](_0x1962ae,_0xb442('0x7b')),function(_0x4d27bc){return _[_0xb442('0x7c')](_0x5c6de0,_0x4d27bc);});if(_0x2b18a8){return _0x544a85['id'];}}}));}}return BPromise['all'](_0x59b55a)[_0xb442('0x27')](function(_0x31da02){_0x1cee12=_(_0x1cee12)[_0xb442('0x7d')](_0x31da02)[_0xb442('0x7e')]()[_0xb442('0x7f')]();return db[_0xb442('0x2d')][_0xb442('0x4a')]({'where':{'id':_0x3436d7[_0xb442('0x55')]['id']}})['then'](function(_0x3984e3){return db[_0xb442('0x77')]['transaction'](function(_0x555f83){return _0x3984e3[_0xb442('0x80')](_0x3436d7['query'][_0xb442('0x65')],{'transaction':_0x555f83})[_0xb442('0x27')](function(){if(!_[_0xb442('0x81')](_0x1cee12)){return _0x3984e3[_0xb442('0x82')](_0x1cee12,{'transaction':_0x555f83});}})['then'](function(){_0x1cee12[_0xb442('0x6b')](function(_0x4d7ce8){socket[_0xb442('0x6c')](_0xb442('0x83'),{'UserId':_0x4d7ce8,'SmsQueueId':_0x3984e3['id']});});});});});});})[_0xb442('0x27')](respondWithStatusCode(_0x3e2630,null))[_0xb442('0x46')](handleError(_0x3e2630,null));};exports[_0xb442('0x84')]=function(_0x4e4eeb,_0x21f4cb,_0x2790a2){return db[_0xb442('0x2d')][_0xb442('0x4a')]({'where':{'id':_0x4e4eeb['params']['id']}})['then'](handleEntityNotFound(_0x21f4cb,null))[_0xb442('0x27')](function(_0x5f3a7e){if(_0x5f3a7e){return _0x5f3a7e['addAgents'](_0x4e4eeb[_0xb442('0x4c')][_0xb442('0x65')],_[_0xb442('0x85')](_0x4e4eeb[_0xb442('0x4c')],[_0xb442('0x65'),'id'])||{})['spread'](function(_0x3bfa11){for(var _0x33ea4c=0x0;_0x33ea4c<_0x4e4eeb['body']['ids'][_0xb442('0x39')];_0x33ea4c+=0x1){socket[_0xb442('0x6c')](_0xb442('0x86'),{'UserId':Number(_0x4e4eeb[_0xb442('0x4c')]['ids'][_0x33ea4c]),'SmsQueueId':Number(_0x4e4eeb['params']['id'])});}return _0x3bfa11;});}})[_0xb442('0x27')](respondWithResult(_0x21f4cb,null))[_0xb442('0x46')](handleError(_0x21f4cb,null));};exports[_0xb442('0x82')]=function(_0xa1b7bb,_0xb2fe65,_0x5e193f){return db[_0xb442('0x2d')][_0xb442('0x4a')]({'where':{'id':_0xa1b7bb[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0xb2fe65,null))['then'](function(_0x40cd27){if(_0x40cd27){return _0x40cd27[_0xb442('0x82')](_0xa1b7bb[_0xb442('0x33')][_0xb442('0x65')])[_0xb442('0x27')](function(){if(_[_0xb442('0x87')](_0xa1b7bb[_0xb442('0x33')][_0xb442('0x65')])){for(var _0x459cdc=0x0;_0x459cdc<_0xa1b7bb[_0xb442('0x33')][_0xb442('0x65')][_0xb442('0x39')];_0x459cdc+=0x1){socket[_0xb442('0x6c')](_0xb442('0x83'),{'UserId':Number(_0xa1b7bb[_0xb442('0x33')][_0xb442('0x65')][_0x459cdc]),'SmsQueueId':Number(_0xa1b7bb[_0xb442('0x55')]['id'])});}}else{socket[_0xb442('0x6c')](_0xb442('0x83'),{'UserId':Number(_0xa1b7bb['query']['ids']),'SmsQueueId':Number(_0xa1b7bb[_0xb442('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xb2fe65,null))[_0xb442('0x46')](handleError(_0xb2fe65,null));};exports[_0xb442('0x88')]=function(_0x3f877e,_0x353a73,_0x3a709f){var _0x484a65={};var _0x414af0={};var _0x415607;var _0x2ae8fd;return db[_0xb442('0x2d')][_0xb442('0x58')]({'where':{'id':_0x3f877e[_0xb442('0x55')]['id']}})[_0xb442('0x27')](handleEntityNotFound(_0x353a73,null))['then'](function(_0x1bb23b){if(_0x1bb23b){_0x415607=_0x1bb23b;_0x414af0['model']=_[_0xb442('0x34')](db[_0xb442('0x5a')][_0xb442('0x2e')]);_0x414af0[_0xb442('0x33')]=_[_0xb442('0x34')](_0x3f877e[_0xb442('0x33')]);_0x414af0[_0xb442('0x35')]=_['intersection'](_0x414af0['model'],_0x414af0['query']);_0x484a65[_0xb442('0x38')]=_[_0xb442('0x36')](_0x414af0['model'],qs[_0xb442('0x37')](_0x3f877e[_0xb442('0x33')][_0xb442('0x37')]));_0x484a65['attributes']=_0x484a65[_0xb442('0x38')][_0xb442('0x39')]?_0x484a65[_0xb442('0x38')]:_0x414af0[_0xb442('0x32')];_0x484a65[_0xb442('0x3c')]=qs[_0xb442('0x3d')](_0x3f877e[_0xb442('0x33')][_0xb442('0x3d')]);_0x484a65[_0xb442('0x3e')]=qs['filters'](_['pick'](_0x3f877e[_0xb442('0x33')],_0x414af0[_0xb442('0x35')]));if(_0x3f877e[_0xb442('0x33')][_0xb442('0x40')]){_0x484a65[_0xb442('0x3e')]=_[_0xb442('0x48')](_0x484a65[_0xb442('0x3e')],{'$or':_['map'](_0x484a65[_0xb442('0x38')],function(_0xd1f6fb){var _0x1763c0={};_0x1763c0[_0xd1f6fb]={'$like':'%'+_0x3f877e[_0xb442('0x33')]['filter']+'%'};return _0x1763c0;})});}_0x484a65=_['merge']({},_0x484a65,_0x3f877e[_0xb442('0x49')]);return _0x415607[_0xb442('0x88')](_0x484a65);}})[_0xb442('0x27')](function(_0x368976){if(_0x368976){_0x2ae8fd=_0x368976[_0xb442('0x39')];if(!_0x3f877e[_0xb442('0x33')][_0xb442('0x3a')](_0xb442('0x3b'))){_0x484a65['limit']=qs[_0xb442('0x21')](_0x3f877e[_0xb442('0x33')][_0xb442('0x21')]);_0x484a65[_0xb442('0x1f')]=qs['offset'](_0x3f877e[_0xb442('0x33')][_0xb442('0x1f')]);}return _0x415607[_0xb442('0x88')](_0x484a65);}})['then'](function(_0x45b912){if(_0x45b912){return _0x45b912?{'count':_0x2ae8fd,'rows':_0x45b912}:null;}})[_0xb442('0x27')](respondWithResult(_0x353a73,null))['catch'](handleError(_0x353a73,null));}; \ No newline at end of file +var _0x7b81=['findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','transaction','isEmpty','userSmsQueue:remove','addAgents','removeAgents','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','json','reject','save','update','then','SmsQueues','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','filter','UserSmsQueue','findAndCountAll','UserId','smsPause','updatedAt','format','%s/%s','SIP','Team','getTeams','online','interface','flatMap','Agents','addTeams'];(function(_0x192bca,_0x38d771){var _0x5411cc=function(_0x1e723e){while(--_0x1e723e){_0x192bca['push'](_0x192bca['shift']());}};_0x5411cc(++_0x38d771);}(_0x7b81,0xab));var _0x17b8=function(_0x430f52,_0x251858){_0x430f52=_0x430f52-0x0;var _0x3045cb=_0x7b81[_0x430f52];return _0x3045cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17b8('0x0'));var zipdir=require(_0x17b8('0x1'));var jsonpatch=require(_0x17b8('0x2'));var rp=require(_0x17b8('0x3'));var moment=require(_0x17b8('0x4'));var BPromise=require(_0x17b8('0x5'));var Mustache=require('mustache');var util=require(_0x17b8('0x6'));var path=require(_0x17b8('0x7'));var sox=require(_0x17b8('0x8'));var csv=require(_0x17b8('0x9'));var ejs=require(_0x17b8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17b8('0xb'));var squel=require('squel');var crypto=require(_0x17b8('0xc'));var jsforce=require(_0x17b8('0xd'));var deskjs=require(_0x17b8('0xe'));var toCsv=require(_0x17b8('0x9'));var querystring=require(_0x17b8('0xf'));var Papa=require(_0x17b8('0x10'));var Redis=require(_0x17b8('0x11'));var authService=require(_0x17b8('0x12'));var qs=require(_0x17b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x17b8('0x14'))(_0x17b8('0x15'));var utils=require('../../config/utils');var config=require(_0x17b8('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x17b8('0x17')](config['redis'],{'host':_0x17b8('0x18'),'port':0x18eb});var socket=require(_0x17b8('0x19'))(new Redis(config[_0x17b8('0x1a')]));require(_0x17b8('0x1b'))[_0x17b8('0x1c')](socket);function respondWithStatusCode(_0x5f3899,_0x170358){_0x170358=_0x170358||0xcc;return function(_0x54d7f8){if(_0x54d7f8){return _0x5f3899[_0x17b8('0x1d')](_0x170358);}return _0x5f3899[_0x17b8('0x1e')](_0x170358)[_0x17b8('0x1f')]();};}function respondWithResult(_0xabaca2,_0x4e37a0){_0x4e37a0=_0x4e37a0||0xc8;return function(_0x55a2d9){if(_0x55a2d9){return _0xabaca2[_0x17b8('0x1e')](_0x4e37a0)['json'](_0x55a2d9);}};}function respondWithFilteredResult(_0x527755,_0x3768){return function(_0x2b4143){if(_0x2b4143){var _0x30eae3=typeof _0x3768[_0x17b8('0x20')]===_0x17b8('0x21')&&typeof _0x3768['limit']==='undefined';var _0x1d1252=_0x2b4143[_0x17b8('0x22')];var _0xee2438=_0x30eae3?0x0:_0x3768['offset'];var _0x3dbb01=_0x30eae3?_0x2b4143[_0x17b8('0x22')]:_0x3768[_0x17b8('0x20')]+_0x3768[_0x17b8('0x23')];var _0x1f1b09;if(_0x3dbb01>=_0x1d1252){_0x3dbb01=_0x1d1252;_0x1f1b09=0xc8;}else{_0x1f1b09=0xce;}_0x527755[_0x17b8('0x1e')](_0x1f1b09);return _0x527755['set']('Content-Range',_0xee2438+'-'+_0x3dbb01+'/'+_0x1d1252)[_0x17b8('0x24')](_0x2b4143);}return null;};}function patchUpdates(_0x410aef){return function(_0x1c53e8){try{jsonpatch['apply'](_0x1c53e8,_0x410aef,!![]);}catch(_0x4f930f){return BPromise[_0x17b8('0x25')](_0x4f930f);}return _0x1c53e8[_0x17b8('0x26')]();};}function saveUpdates(_0x42ce36,_0x8ffc5b){return function(_0x47679d){if(_0x47679d){return _0x47679d[_0x17b8('0x27')](_0x42ce36)[_0x17b8('0x28')](function(_0x38221d){return _0x38221d;});}return null;};}function removeEntity(_0x71ce11,_0x3b45f2){return function(_0x371ac2){if(_0x371ac2){return _0x371ac2['destroy']()['then'](function(){var _0x172d5b=_0x371ac2['get']({'plain':!![]});var _0x4b98dc=_0x17b8('0x29');return db['UserProfileResource'][_0x17b8('0x2a')]({'where':{'type':_0x4b98dc,'resourceId':_0x172d5b['id']}})['then'](function(){return _0x371ac2;});})['then'](function(){_0x71ce11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5632,_0x47f564){return function(_0x4e05c7){if(!_0x4e05c7){_0x2c5632[_0x17b8('0x1d')](0x194);}return _0x4e05c7;};}function handleError(_0x26262e,_0x1a1b73){_0x1a1b73=_0x1a1b73||0x1f4;return function(_0x160aac){logger[_0x17b8('0x2b')](_0x160aac[_0x17b8('0x2c')]);if(_0x160aac[_0x17b8('0x2d')]){delete _0x160aac['name'];}_0x26262e[_0x17b8('0x1e')](_0x1a1b73)[_0x17b8('0x2e')](_0x160aac);};}exports[_0x17b8('0x2f')]=function(_0x29853a,_0x56ffa8){var _0x3821eb={},_0x22210e={},_0x1b8f9a={'count':0x0,'rows':[]};var _0x38fdfa=_[_0x17b8('0x30')](db[_0x17b8('0x31')][_0x17b8('0x32')],function(_0x1436b2){return{'name':_0x1436b2[_0x17b8('0x33')],'type':_0x1436b2['type'][_0x17b8('0x34')]};});_0x22210e[_0x17b8('0x35')]=_[_0x17b8('0x30')](_0x38fdfa,_0x17b8('0x2d'));_0x22210e['query']=_[_0x17b8('0x36')](_0x29853a[_0x17b8('0x37')]);_0x22210e[_0x17b8('0x38')]=_[_0x17b8('0x39')](_0x22210e[_0x17b8('0x35')],_0x22210e[_0x17b8('0x37')]);_0x3821eb[_0x17b8('0x3a')]=_[_0x17b8('0x39')](_0x22210e[_0x17b8('0x35')],qs['fields'](_0x29853a[_0x17b8('0x37')]['fields']));_0x3821eb[_0x17b8('0x3a')]=_0x3821eb[_0x17b8('0x3a')]['length']?_0x3821eb[_0x17b8('0x3a')]:_0x22210e['model'];if(!_0x29853a['query'][_0x17b8('0x3b')](_0x17b8('0x3c'))){_0x3821eb[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x29853a[_0x17b8('0x37')][_0x17b8('0x23')]);_0x3821eb[_0x17b8('0x20')]=qs[_0x17b8('0x20')](_0x29853a[_0x17b8('0x37')][_0x17b8('0x20')]);}_0x3821eb[_0x17b8('0x3d')]=qs[_0x17b8('0x3e')](_0x29853a['query'][_0x17b8('0x3e')]);_0x3821eb[_0x17b8('0x3f')]=qs['filters'](_[_0x17b8('0x40')](_0x29853a[_0x17b8('0x37')],_0x22210e[_0x17b8('0x38')]),_0x38fdfa);if(_0x29853a['query']['filter']){_0x3821eb[_0x17b8('0x3f')]=_[_0x17b8('0x41')](_0x3821eb['where'],{'$or':_[_0x17b8('0x30')](_0x38fdfa,function(_0xcc2d55){if(_0xcc2d55[_0x17b8('0x42')]!=='VIRTUAL'){var _0x14fce1={};_0x14fce1[_0xcc2d55[_0x17b8('0x2d')]]={'$like':'%'+_0x29853a['query']['filter']+'%'};return _0x14fce1;}})});}_0x3821eb=_[_0x17b8('0x41')]({},_0x3821eb,_0x29853a[_0x17b8('0x43')]);var _0x19e6f9={'where':_0x3821eb['where']};return db[_0x17b8('0x31')]['count'](_0x19e6f9)[_0x17b8('0x28')](function(_0xaa03c){_0x1b8f9a[_0x17b8('0x22')]=_0xaa03c;if(_0x29853a[_0x17b8('0x37')][_0x17b8('0x44')]){_0x3821eb[_0x17b8('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0x17b8('0x46')](_0x3821eb);})[_0x17b8('0x28')](function(_0x4644fd){_0x1b8f9a[_0x17b8('0x47')]=_0x4644fd;return _0x1b8f9a;})[_0x17b8('0x28')](respondWithFilteredResult(_0x56ffa8,_0x3821eb))[_0x17b8('0x48')](handleError(_0x56ffa8,null));};exports[_0x17b8('0x49')]=function(_0x110dfe,_0x22f8f3){var _0x45f335={'raw':!![],'where':{'id':_0x110dfe[_0x17b8('0x4a')]['id']}},_0x21f986={};_0x21f986['model']=_['keys'](db['SmsQueue'][_0x17b8('0x32')]);_0x21f986[_0x17b8('0x37')]=_[_0x17b8('0x36')](_0x110dfe[_0x17b8('0x37')]);_0x21f986[_0x17b8('0x38')]=_[_0x17b8('0x39')](_0x21f986[_0x17b8('0x35')],_0x21f986[_0x17b8('0x37')]);_0x45f335['attributes']=_['intersection'](_0x21f986[_0x17b8('0x35')],qs[_0x17b8('0x4b')](_0x110dfe[_0x17b8('0x37')][_0x17b8('0x4b')]));_0x45f335[_0x17b8('0x3a')]=_0x45f335[_0x17b8('0x3a')][_0x17b8('0x4c')]?_0x45f335[_0x17b8('0x3a')]:_0x21f986[_0x17b8('0x35')];if(_0x110dfe[_0x17b8('0x37')][_0x17b8('0x44')]){_0x45f335[_0x17b8('0x45')]=[{'all':!![]}];}_0x45f335=_[_0x17b8('0x41')]({},_0x45f335,_0x110dfe['options']);return db[_0x17b8('0x31')][_0x17b8('0x4d')](_0x45f335)[_0x17b8('0x28')](handleEntityNotFound(_0x22f8f3,null))[_0x17b8('0x28')](respondWithResult(_0x22f8f3,null))['catch'](handleError(_0x22f8f3,null));};exports[_0x17b8('0x4e')]=function(_0x311a5f,_0x391959){return db['SmsQueue'][_0x17b8('0x4e')](_0x311a5f[_0x17b8('0x4f')],{})[_0x17b8('0x28')](function(_0x2b78fa){var _0x2ae211=_0x311a5f[_0x17b8('0x50')]['get']({'plain':!![]});if(!_0x2ae211)throw new Error(_0x17b8('0x51'));if(_0x2ae211[_0x17b8('0x52')]===_0x17b8('0x50')){var _0x2acf0e=_0x2b78fa[_0x17b8('0x53')]({'plain':!![]});var _0x3d919f='SmsQueues';return db[_0x17b8('0x54')][_0x17b8('0x4d')]({'where':{'name':_0x3d919f,'userProfileId':_0x2ae211[_0x17b8('0x55')]},'raw':!![]})[_0x17b8('0x28')](function(_0x1efc76){if(_0x1efc76&&_0x1efc76[_0x17b8('0x56')]===0x0){return db['UserProfileResource'][_0x17b8('0x4e')]({'name':_0x2acf0e[_0x17b8('0x2d')],'resourceId':_0x2acf0e['id'],'type':_0x1efc76[_0x17b8('0x2d')],'sectionId':_0x1efc76['id']},{})[_0x17b8('0x28')](function(){return _0x2b78fa;});}else{return _0x2b78fa;}})[_0x17b8('0x48')](function(_0xc84354){logger[_0x17b8('0x2b')](_0x17b8('0x57'),_0xc84354);throw _0xc84354;});}return _0x2b78fa;})[_0x17b8('0x28')](respondWithResult(_0x391959,0xc9))[_0x17b8('0x48')](handleError(_0x391959,null));};exports['update']=function(_0x45f263,_0x595ac4){if(_0x45f263['body']['id']){delete _0x45f263[_0x17b8('0x4f')]['id'];}return db[_0x17b8('0x31')][_0x17b8('0x4d')]({'where':{'id':_0x45f263[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](handleEntityNotFound(_0x595ac4,null))[_0x17b8('0x28')](saveUpdates(_0x45f263['body'],null))[_0x17b8('0x28')](respondWithResult(_0x595ac4,null))[_0x17b8('0x48')](handleError(_0x595ac4,null));};exports['destroy']=function(_0x1630c4,_0x2fff55){return db[_0x17b8('0x31')][_0x17b8('0x4d')]({'where':{'id':_0x1630c4['params']['id']}})['then'](handleEntityNotFound(_0x2fff55,null))[_0x17b8('0x28')](removeEntity(_0x2fff55,null))[_0x17b8('0x48')](handleError(_0x2fff55,null));};exports[_0x17b8('0x58')]=function(_0x56991d,_0x41a559){return db[_0x17b8('0x31')]['describe']()[_0x17b8('0x28')](respondWithResult(_0x41a559,null))[_0x17b8('0x48')](handleError(_0x41a559,null));};exports[_0x17b8('0x59')]=function(_0x5288e0,_0x35ba4a,_0x57ee80){var _0xd17eb5={'raw':!![],'where':{}},_0x185076={},_0x4cc7cd;return db[_0x17b8('0x31')][_0x17b8('0x5a')]({'where':{'id':_0x5288e0[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](handleEntityNotFound(_0x35ba4a,null))[_0x17b8('0x28')](function(_0x18c796){if(_0x18c796){_0x4cc7cd=_0x18c796[_0x17b8('0x53')]({'plain':!![]});_0x185076[_0x17b8('0x35')]=_['keys'](db['UserSmsQueue'][_0x17b8('0x32')]);_0x185076[_0x17b8('0x37')]=_[_0x17b8('0x36')](_0x5288e0[_0x17b8('0x37')]);_0x185076[_0x17b8('0x38')]=_[_0x17b8('0x39')](_0x185076['model'],_0x185076['query']);_0xd17eb5[_0x17b8('0x3a')]=_[_0x17b8('0x39')](_0x185076[_0x17b8('0x35')],qs[_0x17b8('0x4b')](_0x5288e0[_0x17b8('0x37')][_0x17b8('0x4b')]));_0xd17eb5['attributes']=_0xd17eb5[_0x17b8('0x3a')][_0x17b8('0x4c')]?_0xd17eb5[_0x17b8('0x3a')]:_0x185076['model'];if(!_0x5288e0[_0x17b8('0x37')]['hasOwnProperty'](_0x17b8('0x3c'))){_0xd17eb5[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x5288e0[_0x17b8('0x37')][_0x17b8('0x23')]);_0xd17eb5['offset']=qs[_0x17b8('0x20')](_0x5288e0['query'][_0x17b8('0x20')]);}_0xd17eb5[_0x17b8('0x3d')]=qs[_0x17b8('0x3e')](_0x5288e0[_0x17b8('0x37')][_0x17b8('0x3e')]);_0xd17eb5[_0x17b8('0x3f')]=qs[_0x17b8('0x38')](_['pick'](_0x5288e0[_0x17b8('0x37')],_0x185076[_0x17b8('0x38')]));_0xd17eb5[_0x17b8('0x3f')]['SmsQueueId']=_0x18c796['id'];if(_0x5288e0[_0x17b8('0x37')][_0x17b8('0x5b')]){_0xd17eb5[_0x17b8('0x3f')]=_[_0x17b8('0x41')](_0xd17eb5[_0x17b8('0x3f')],{'$or':_[_0x17b8('0x30')](_0xd17eb5[_0x17b8('0x3a')],function(_0x120a71){var _0x26651d={};_0x26651d[_0x120a71]={'$like':'%'+_0x5288e0[_0x17b8('0x37')]['filter']+'%'};return _0x26651d;})});}_0xd17eb5=_['merge']({},_0xd17eb5,_0x5288e0['options']);return db[_0x17b8('0x5c')][_0x17b8('0x46')](_0xd17eb5);}})[_0x17b8('0x28')](function(_0x3bea28){if(_0x3bea28){return db['User'][_0x17b8('0x5d')]({'where':{'id':_[_0x17b8('0x30')](_0x3bea28,_0x17b8('0x5e')),'role':'agent'},'attributes':['id',_0x17b8('0x2d'),_0x17b8('0x5f'),_0x17b8('0x60'),'createdAt']});}})[_0x17b8('0x28')](function(_0x5a6f10){if(_0x5a6f10){return{'count':_0x5a6f10[_0x17b8('0x22')],'rows':_[_0x17b8('0x30')](_0x5a6f10[_0x17b8('0x47')],function(_0x5111ab){return{'membername':_0x5111ab[_0x17b8('0x2d')],'UserId':_0x5111ab['id'],'queue_name':_0x4cc7cd[_0x17b8('0x2d')],'SmsQueueId':_0x4cc7cd['id'],'interface':util[_0x17b8('0x61')](_0x17b8('0x62'),_0x17b8('0x63'),_0x5111ab[_0x17b8('0x2d')]),'penalty':0x0,'paused':_0x5111ab[_0x17b8('0x5f')],'createdAt':_0x5111ab['createdAt'],'updatedAt':_0x5111ab[_0x17b8('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x17b8('0x28')](respondWithFilteredResult(_0x35ba4a,_0xd17eb5))[_0x17b8('0x48')](handleError(_0x35ba4a,null));};exports['getTeams']=function(_0x32f45a,_0x3d8ae0,_0x22b625){var _0x2da97b={};var _0x398af9={};var _0x44165f;var _0x41e97e;return db[_0x17b8('0x31')][_0x17b8('0x5a')]({'where':{'id':_0x32f45a[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](handleEntityNotFound(_0x3d8ae0,null))[_0x17b8('0x28')](function(_0x844697){if(_0x844697){_0x44165f=_0x844697;_0x398af9[_0x17b8('0x35')]=_[_0x17b8('0x36')](db[_0x17b8('0x64')][_0x17b8('0x32')]);_0x398af9['query']=_['keys'](_0x32f45a['query']);_0x398af9['filters']=_[_0x17b8('0x39')](_0x398af9[_0x17b8('0x35')],_0x398af9[_0x17b8('0x37')]);_0x2da97b['attributes']=_['intersection'](_0x398af9['model'],qs[_0x17b8('0x4b')](_0x32f45a[_0x17b8('0x37')][_0x17b8('0x4b')]));_0x2da97b['attributes']=_0x2da97b['attributes'][_0x17b8('0x4c')]?_0x2da97b['attributes']:_0x398af9['model'];_0x2da97b[_0x17b8('0x3d')]=qs[_0x17b8('0x3e')](_0x32f45a[_0x17b8('0x37')]['sort']);_0x2da97b['where']=qs[_0x17b8('0x38')](_[_0x17b8('0x40')](_0x32f45a[_0x17b8('0x37')],_0x398af9[_0x17b8('0x38')]));if(_0x32f45a[_0x17b8('0x37')][_0x17b8('0x5b')]){_0x2da97b[_0x17b8('0x3f')]=_['merge'](_0x2da97b[_0x17b8('0x3f')],{'$or':_[_0x17b8('0x30')](_0x2da97b[_0x17b8('0x3a')],function(_0x1778c4){var _0xa39b5b={};_0xa39b5b[_0x1778c4]={'$like':'%'+_0x32f45a[_0x17b8('0x37')][_0x17b8('0x5b')]+'%'};return _0xa39b5b;})});}_0x2da97b=_[_0x17b8('0x41')]({},_0x2da97b,_0x32f45a[_0x17b8('0x43')]);return _0x44165f[_0x17b8('0x65')](_0x2da97b);}})[_0x17b8('0x28')](function(_0x683d69){if(_0x683d69){_0x41e97e=_0x683d69[_0x17b8('0x4c')];if(!_0x32f45a['query'][_0x17b8('0x3b')](_0x17b8('0x3c'))){_0x2da97b[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x32f45a[_0x17b8('0x37')]['limit']);_0x2da97b[_0x17b8('0x20')]=qs[_0x17b8('0x20')](_0x32f45a[_0x17b8('0x37')][_0x17b8('0x20')]);}return _0x44165f[_0x17b8('0x65')](_0x2da97b);}})['then'](function(_0x4b3edc){if(_0x4b3edc){return _0x4b3edc?{'count':_0x41e97e,'rows':_0x4b3edc}:null;}})[_0x17b8('0x28')](respondWithResult(_0x3d8ae0,null))['catch'](handleError(_0x3d8ae0,null));};exports['addTeams']=function(_0x113a7e,_0x3fe92c,_0x7a12ce){var _0x2ca547=_0x113a7e[_0x17b8('0x4f')]['ids'];return db['Team'][_0x17b8('0x46')]({'where':{'id':_0x2ca547},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x17b8('0x2d'),_0x17b8('0x66'),'voicePause',_0x17b8('0x67')],'raw':!![]}]})[_0x17b8('0x28')](function(_0x394123){if(_0x394123){var _0x43e552=_[_0x17b8('0x68')](_0x394123,function(_0x26382b){var _0x1c1d2d=_0x26382b[_0x17b8('0x53')]({'plain':!![]});return _0x1c1d2d[_0x17b8('0x69')];});return db[_0x17b8('0x31')][_0x17b8('0x4d')]({'where':{'id':_0x113a7e[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](function(_0x33fcb4){return db['sequelize']['transaction'](function(_0x9bf90d){return _0x33fcb4[_0x17b8('0x6a')](_0x2ca547,{'transaction':_0x9bf90d})['then'](function(){return BPromise['each'](_0x43e552,function(_0x1af99d){return db[_0x17b8('0x5c')][_0x17b8('0x6b')]({'where':{'UserId':_0x1af99d['id'],'SmsQueueId':_0x113a7e['params']['id']},'transaction':_0x9bf90d});});})['then'](function(){_0x43e552[_0x17b8('0x6c')](function(_0x51ab8c){socket[_0x17b8('0x6d')](_0x17b8('0x6e'),{'UserId':_0x51ab8c['id'],'SmsQueueId':_0x33fcb4['id']});});});});});}})[_0x17b8('0x28')](respondWithStatusCode(_0x3fe92c,null))[_0x17b8('0x48')](handleError(_0x3fe92c,null));};exports[_0x17b8('0x6f')]=function(_0xe225ce,_0x323b63,_0x162c74){return db[_0x17b8('0x64')]['findAll']({'where':{'id':_0xe225ce['query'][_0x17b8('0x70')]},'attributes':['id'],'include':[{'model':db[_0x17b8('0x71')],'as':_0x17b8('0x69'),'attributes':['id'],'raw':!![]}]})[_0x17b8('0x28')](handleEntityNotFound(_0x323b63,null))[_0x17b8('0x28')](function(_0x58aef8){var _0x4bf831=_['map'](_0x58aef8,'id');var _0x4d96dd=[];var _0x1c10d7=[];var _0x5b4642=squel[_0x17b8('0x72')]();_0x5b4642['field'](_0x17b8('0x73'))[_0x17b8('0x74')](_0x17b8('0x75'),'tq')['join'](_0x17b8('0x76'),'ut',_0x17b8('0x77'))[_0x17b8('0x3f')](_0x17b8('0x78'),_0xe225ce[_0x17b8('0x4a')]['id']);for(var _0x38d39a=0x0;_0x38d39a<_0x58aef8[_0x17b8('0x4c')];_0x38d39a+=0x1){let _0x2cb15e=_0x58aef8[_0x38d39a];for(var _0x2c2b61=0x0;_0x2c2b61<_0x2cb15e[_0x17b8('0x69')]['length'];_0x2c2b61+=0x1){let _0x1b1c4b=_0x2cb15e[_0x17b8('0x69')][_0x2c2b61];var _0x100170=_0x5b4642[_0x17b8('0x79')]();_0x100170[_0x17b8('0x3f')](_0x17b8('0x7a'),_0x1b1c4b['id']);_0x1c10d7[_0x17b8('0x7b')](db[_0x17b8('0x7c')]['query'](_0x100170[_0x17b8('0x7d')](),{'type':db['sequelize'][_0x17b8('0x7e')][_0x17b8('0x7f')]})[_0x17b8('0x28')](function(_0x53a01f){if(_0x53a01f[_0x17b8('0x4c')]===0x1){return _0x1b1c4b['id'];}else{var _0x37332f=_[_0x17b8('0x80')](_[_0x17b8('0x30')](_0x53a01f,_0x17b8('0x81')),function(_0x26a94b){return _[_0x17b8('0x82')](_0x4bf831,_0x26a94b);});if(_0x37332f){return _0x1b1c4b['id'];}}}));}}return BPromise['all'](_0x1c10d7)[_0x17b8('0x28')](function(_0x1369a1){_0x4d96dd=_(_0x4d96dd)[_0x17b8('0x83')](_0x1369a1)[_0x17b8('0x84')]()['value']();return db['SmsQueue'][_0x17b8('0x4d')]({'where':{'id':_0xe225ce[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](function(_0x30427a){return db[_0x17b8('0x7c')][_0x17b8('0x85')](function(_0xe6002f){return _0x30427a['removeTeams'](_0xe225ce[_0x17b8('0x37')][_0x17b8('0x70')],{'transaction':_0xe6002f})['then'](function(){if(!_[_0x17b8('0x86')](_0x4d96dd)){return _0x30427a['removeAgents'](_0x4d96dd,{'transaction':_0xe6002f});}})[_0x17b8('0x28')](function(){_0x4d96dd['forEach'](function(_0x554d87){socket['emit'](_0x17b8('0x87'),{'UserId':_0x554d87,'SmsQueueId':_0x30427a['id']});});});});});});})[_0x17b8('0x28')](respondWithStatusCode(_0x323b63,null))[_0x17b8('0x48')](handleError(_0x323b63,null));};exports[_0x17b8('0x88')]=function(_0x2ff9bb,_0x407c62,_0x110d5f){return db[_0x17b8('0x31')]['find']({'where':{'id':_0x2ff9bb[_0x17b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x407c62,null))[_0x17b8('0x28')](function(_0x20fda9){if(_0x20fda9){return _0x20fda9[_0x17b8('0x88')](_0x2ff9bb[_0x17b8('0x4f')]['ids'],_['omit'](_0x2ff9bb[_0x17b8('0x4f')],[_0x17b8('0x70'),'id'])||{})['spread'](function(_0x2273e7){for(var _0x3d8b5a=0x0;_0x3d8b5a<_0x2ff9bb['body']['ids']['length'];_0x3d8b5a+=0x1){socket['emit'](_0x17b8('0x6e'),{'UserId':Number(_0x2ff9bb[_0x17b8('0x4f')]['ids'][_0x3d8b5a]),'SmsQueueId':Number(_0x2ff9bb['params']['id'])});}return _0x2273e7;});}})[_0x17b8('0x28')](respondWithResult(_0x407c62,null))['catch'](handleError(_0x407c62,null));};exports['removeAgents']=function(_0x26bb31,_0x117fc9,_0xe92ab0){return db[_0x17b8('0x31')][_0x17b8('0x4d')]({'where':{'id':_0x26bb31[_0x17b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x117fc9,null))[_0x17b8('0x28')](function(_0x287475){if(_0x287475){return _0x287475[_0x17b8('0x89')](_0x26bb31['query'][_0x17b8('0x70')])[_0x17b8('0x28')](function(){if(_['isArray'](_0x26bb31['query'][_0x17b8('0x70')])){for(var _0x57cfdd=0x0;_0x57cfdd<_0x26bb31[_0x17b8('0x37')][_0x17b8('0x70')][_0x17b8('0x4c')];_0x57cfdd+=0x1){socket[_0x17b8('0x6d')](_0x17b8('0x87'),{'UserId':Number(_0x26bb31[_0x17b8('0x37')][_0x17b8('0x70')][_0x57cfdd]),'SmsQueueId':Number(_0x26bb31[_0x17b8('0x4a')]['id'])});}}else{socket['emit'](_0x17b8('0x87'),{'UserId':Number(_0x26bb31[_0x17b8('0x37')][_0x17b8('0x70')]),'SmsQueueId':Number(_0x26bb31['params']['id'])});}});}})[_0x17b8('0x28')](respondWithStatusCode(_0x117fc9,null))['catch'](handleError(_0x117fc9,null));};exports[_0x17b8('0x8a')]=function(_0x3e930d,_0x2b4bae,_0x37457f){var _0x54a7af={};var _0x2b2916={};var _0x42e005;var _0x129804;return db[_0x17b8('0x31')][_0x17b8('0x5a')]({'where':{'id':_0x3e930d[_0x17b8('0x4a')]['id']}})[_0x17b8('0x28')](handleEntityNotFound(_0x2b4bae,null))[_0x17b8('0x28')](function(_0x426565){if(_0x426565){_0x42e005=_0x426565;_0x2b2916[_0x17b8('0x35')]=_['keys'](db['User'][_0x17b8('0x32')]);_0x2b2916[_0x17b8('0x37')]=_[_0x17b8('0x36')](_0x3e930d[_0x17b8('0x37')]);_0x2b2916['filters']=_['intersection'](_0x2b2916[_0x17b8('0x35')],_0x2b2916['query']);_0x54a7af[_0x17b8('0x3a')]=_[_0x17b8('0x39')](_0x2b2916[_0x17b8('0x35')],qs[_0x17b8('0x4b')](_0x3e930d[_0x17b8('0x37')][_0x17b8('0x4b')]));_0x54a7af['attributes']=_0x54a7af[_0x17b8('0x3a')][_0x17b8('0x4c')]?_0x54a7af['attributes']:_0x2b2916[_0x17b8('0x35')];_0x54a7af[_0x17b8('0x3d')]=qs[_0x17b8('0x3e')](_0x3e930d[_0x17b8('0x37')][_0x17b8('0x3e')]);_0x54a7af[_0x17b8('0x3f')]=qs[_0x17b8('0x38')](_[_0x17b8('0x40')](_0x3e930d[_0x17b8('0x37')],_0x2b2916['filters']));if(_0x3e930d[_0x17b8('0x37')][_0x17b8('0x5b')]){_0x54a7af[_0x17b8('0x3f')]=_['merge'](_0x54a7af['where'],{'$or':_[_0x17b8('0x30')](_0x54a7af['attributes'],function(_0x4d0605){var _0x3fdfe5={};_0x3fdfe5[_0x4d0605]={'$like':'%'+_0x3e930d[_0x17b8('0x37')][_0x17b8('0x5b')]+'%'};return _0x3fdfe5;})});}_0x54a7af=_[_0x17b8('0x41')]({},_0x54a7af,_0x3e930d[_0x17b8('0x43')]);return _0x42e005[_0x17b8('0x8a')](_0x54a7af);}})['then'](function(_0x1d3234){if(_0x1d3234){_0x129804=_0x1d3234[_0x17b8('0x4c')];if(!_0x3e930d[_0x17b8('0x37')][_0x17b8('0x3b')](_0x17b8('0x3c'))){_0x54a7af['limit']=qs[_0x17b8('0x23')](_0x3e930d[_0x17b8('0x37')][_0x17b8('0x23')]);_0x54a7af[_0x17b8('0x20')]=qs[_0x17b8('0x20')](_0x3e930d[_0x17b8('0x37')][_0x17b8('0x20')]);}return _0x42e005[_0x17b8('0x8a')](_0x54a7af);}})[_0x17b8('0x28')](function(_0xef45c2){if(_0xef45c2){return _0xef45c2?{'count':_0x129804,'rows':_0xef45c2}:null;}})[_0x17b8('0x28')](respondWithResult(_0x2b4bae,null))[_0x17b8('0x48')](handleError(_0x2b4bae,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8d6ed16..15633cf 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 _0x3036=['save','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0xf17d71,_0x3bbe72){var _0x2502f3=function(_0x2e7c34){while(--_0x2e7c34){_0xf17d71['push'](_0xf17d71['shift']());}};_0x2502f3(++_0x3bbe72);}(_0x3036,0x128));var _0x6303=function(_0x414765,_0x3b2bd4){_0x414765=_0x414765-0x0;var _0x2162bb=_0x3036[_0x414765];return _0x2162bb;};'use strict';var EventEmitter=require(_0x6303('0x0'));var SmsQueue=require(_0x6303('0x1'))['db'][_0x6303('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6303('0x3')](0x0);var events={'afterCreate':_0x6303('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b8712){return function(_0x2b1d7f,_0x31bfa7,_0x568e29){SmsQueueEvents['emit'](_0x2b8712+':'+_0x2b1d7f['id'],_0x2b1d7f);SmsQueueEvents['emit'](_0x2b8712,_0x2b1d7f);_0x568e29(null);};}for(var e in events){if(events[_0x6303('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xbfd9=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xc719a9,_0x262573){var _0x427ed5=function(_0x57945c){while(--_0x57945c){_0xc719a9['push'](_0xc719a9['shift']());}};_0x427ed5(++_0x262573);}(_0xbfd9,0x121));var _0x9bfd=function(_0x530d95,_0x3a41d7){_0x530d95=_0x530d95-0x0;var _0x27e413=_0xbfd9[_0x530d95];return _0x27e413;};'use strict';var EventEmitter=require(_0x9bfd('0x0'));var SmsQueue=require(_0x9bfd('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9bfd('0x2')](0x0);var events={'afterCreate':_0x9bfd('0x3'),'afterUpdate':_0x9bfd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x485a0b){return function(_0x1bd8a3,_0x3d91e8,_0x40d286){SmsQueueEvents[_0x9bfd('0x5')](_0x485a0b+':'+_0x1bd8a3['id'],_0x1bd8a3);SmsQueueEvents[_0x9bfd('0x5')](_0x485a0b,_0x1bd8a3);_0x40d286(null);};}for(var e in events){if(events[_0x9bfd('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x9bfd('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 1716519..c7da804 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 _0x1527=['exports','define','SmsQueue','util','../../config/logger','api','moment','path','rimraf','./smsQueue.attributes'];(function(_0x347343,_0x213c66){var _0x37444e=function(_0x32bc77){while(--_0x32bc77){_0x347343['push'](_0x347343['shift']());}};_0x37444e(++_0x213c66);}(_0x1527,0xc1));var _0x7152=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x1527[_0x491faa];return _0x414440;};'use strict';var _=require('lodash');var util=require(_0x7152('0x0'));var logger=require(_0x7152('0x1'))(_0x7152('0x2'));var moment=require(_0x7152('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7152('0x4'));var rimraf=require(_0x7152('0x5'));var config=require('../../config/environment');var attributes=require(_0x7152('0x6'));module[_0x7152('0x7')]=function(_0x524660,_0x46595a){return _0x524660[_0x7152('0x8')](_0x7152('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cb2=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsQueue','sms_queues'];(function(_0x366378,_0x33a2fa){var _0x19bbf0=function(_0x27900e){while(--_0x27900e){_0x366378['push'](_0x366378['shift']());}};_0x19bbf0(++_0x33a2fa);}(_0x0cb2,0xf0));var _0x20cb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0cb2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x20cb('0x0'));var util=require('util');var logger=require(_0x20cb('0x1'))(_0x20cb('0x2'));var moment=require(_0x20cb('0x3'));var BPromise=require(_0x20cb('0x4'));var rp=require(_0x20cb('0x5'));var fs=require('fs');var path=require(_0x20cb('0x6'));var rimraf=require('rimraf');var config=require(_0x20cb('0x7'));var attributes=require('./smsQueue.attributes');module[_0x20cb('0x8')]=function(_0x3da029,_0x1b070e){return _0x3da029[_0x20cb('0x9')](_0x20cb('0xa'),attributes,{'tableName':_0x20cb('0xb'),'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 8b5938a..7923477 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 _0x3abc=['socket.io-emitter','./smsQueue.socket','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','catch','find','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4c34d8,_0x383073){var _0x4c21df=function(_0x36150e){while(--_0x36150e){_0x4c34d8['push'](_0x4c34d8['shift']());}};_0x4c21df(++_0x383073);}(_0x3abc,0xe8));var _0xc3ab=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x3abc[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var moment=require(_0xc3ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3ab('0x3'));var fs=require('fs');var Redis=require(_0xc3ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3ab('0x5'))(_0xc3ab('0x6'));var config=require(_0xc3ab('0x7'));var jayson=require(_0xc3ab('0x8'));var client=jayson[_0xc3ab('0x9')][_0xc3ab('0xa')]({'port':0x232a});config[_0xc3ab('0xb')]=_[_0xc3ab('0xc')](config[_0xc3ab('0xb')],{'host':_0xc3ab('0xd'),'port':0x18eb});var socket=require(_0xc3ab('0xe'))(new Redis(config['redis']));require(_0xc3ab('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f5d9e,_0x4a2427,_0x414151){return new BPromise(function(_0x20cd14,_0x4e4479){return client['request'](_0x2f5d9e,_0x414151)[_0xc3ab('0x10')](function(_0x223126){logger['info'](_0xc3ab('0x11'),_0x4a2427,'request\x20sent');logger[_0xc3ab('0x12')](_0xc3ab('0x13'),_0x4a2427,_0xc3ab('0x14'),JSON[_0xc3ab('0x15')](_0x223126));if(_0x223126[_0xc3ab('0x16')]){if(_0x223126[_0xc3ab('0x16')][_0xc3ab('0x17')]===0x1f4){logger[_0xc3ab('0x16')]('SmsQueue,\x20%s,\x20%s',_0x4a2427,_0x223126[_0xc3ab('0x16')][_0xc3ab('0x18')]);return _0x4e4479(_0x223126[_0xc3ab('0x16')][_0xc3ab('0x18')]);}logger[_0xc3ab('0x16')](_0xc3ab('0x11'),_0x4a2427,_0x223126[_0xc3ab('0x16')]['message']);return _0x20cd14(_0x223126[_0xc3ab('0x16')][_0xc3ab('0x18')]);}else{logger[_0xc3ab('0x19')](_0xc3ab('0x11'),_0x4a2427,_0xc3ab('0x14'));_0x20cd14(_0x223126[_0xc3ab('0x1a')][_0xc3ab('0x18')]);}})['catch'](function(_0x600828){logger[_0xc3ab('0x16')](_0xc3ab('0x11'),_0x4a2427,_0x600828);_0x4e4479(_0x600828);});});}exports[_0xc3ab('0x1b')]=function(_0x120f4a){var _0x395a1a=this;return new Promise(function(_0x54e1c9,_0x44ec53){return db[_0xc3ab('0x1c')][_0xc3ab('0x1d')]({'raw':_0x120f4a[_0xc3ab('0x1e')]?_0x120f4a['options'][_0xc3ab('0x1f')]===undefined?!![]:![]:!![],'where':_0x120f4a[_0xc3ab('0x1e')]?_0x120f4a[_0xc3ab('0x1e')][_0xc3ab('0x20')]||null:null,'attributes':_0x120f4a[_0xc3ab('0x1e')]?_0x120f4a[_0xc3ab('0x1e')][_0xc3ab('0x21')]||null:null,'limit':_0x120f4a['options']?_0x120f4a[_0xc3ab('0x1e')][_0xc3ab('0x22')]||null:null,'include':_0x120f4a[_0xc3ab('0x1e')]?_0x120f4a[_0xc3ab('0x1e')][_0xc3ab('0x23')]?_['map'](_0x120f4a[_0xc3ab('0x1e')][_0xc3ab('0x23')],function(_0x1b1402){return{'model':db[_0x1b1402[_0xc3ab('0x24')]],'as':_0x1b1402['as'],'attributes':_0x1b1402[_0xc3ab('0x21')],'include':_0x1b1402[_0xc3ab('0x23')]?_[_0xc3ab('0x25')](_0x1b1402[_0xc3ab('0x23')],function(_0x3a4c70){return{'model':db[_0x3a4c70[_0xc3ab('0x24')]],'as':_0x3a4c70['as'],'attributes':_0x3a4c70[_0xc3ab('0x21')],'include':_0x3a4c70['include']?_[_0xc3ab('0x25')](_0x3a4c70[_0xc3ab('0x23')],function(_0x47da22){return{'model':db[_0x47da22[_0xc3ab('0x24')]],'as':_0x47da22['as'],'attributes':_0x47da22[_0xc3ab('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b2bd7){logger[_0xc3ab('0x19')]('GetSmsQueue',_0x120f4a);logger[_0xc3ab('0x12')](_0xc3ab('0x1b'),_0x120f4a,JSON[_0xc3ab('0x15')](_0x5b2bd7));_0x54e1c9(_0x5b2bd7);})[_0xc3ab('0x26')](function(_0x40a997){logger[_0xc3ab('0x16')](_0xc3ab('0x1b'),_0x40a997[_0xc3ab('0x18')],_0x120f4a);_0x44ec53(_0x395a1a[_0xc3ab('0x16')](0x1f4,_0x40a997[_0xc3ab('0x18')]));});});};exports['ShowSmsQueue']=function(_0x5a9d98){var _0x531530=this;return new Promise(function(_0x4a324c,_0x50e3e6){return db[_0xc3ab('0x1c')][_0xc3ab('0x27')]({'raw':_0x5a9d98['options']?_0x5a9d98['options'][_0xc3ab('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a9d98[_0xc3ab('0x1e')]?_0x5a9d98['options'][_0xc3ab('0x20')]||null:null,'attributes':_0x5a9d98[_0xc3ab('0x1e')]?_0x5a9d98[_0xc3ab('0x1e')][_0xc3ab('0x21')]||null:null,'include':_0x5a9d98[_0xc3ab('0x1e')]?_0x5a9d98[_0xc3ab('0x1e')]['include']?_[_0xc3ab('0x25')](_0x5a9d98[_0xc3ab('0x1e')]['include'],function(_0x3da2ed){return{'model':db[_0x3da2ed[_0xc3ab('0x24')]],'as':_0x3da2ed['as'],'attributes':_0x3da2ed['attributes'],'include':_0x3da2ed[_0xc3ab('0x23')]?_['map'](_0x3da2ed['include'],function(_0x31e954){return{'model':db[_0x31e954['model']],'as':_0x31e954['as'],'attributes':_0x31e954[_0xc3ab('0x21')],'include':_0x31e954[_0xc3ab('0x23')]?_['map'](_0x31e954[_0xc3ab('0x23')],function(_0x3e987e){return{'model':db[_0x3e987e[_0xc3ab('0x24')]],'as':_0x3e987e['as'],'attributes':_0x3e987e[_0xc3ab('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c016d){logger[_0xc3ab('0x19')]('ShowSmsQueue',_0x5a9d98);logger[_0xc3ab('0x12')]('ShowSmsQueue',_0x5a9d98,JSON[_0xc3ab('0x15')](_0x2c016d));_0x4a324c(_0x2c016d);})[_0xc3ab('0x26')](function(_0x546096){logger[_0xc3ab('0x16')](_0xc3ab('0x28'),_0x546096[_0xc3ab('0x18')],_0x5a9d98);_0x50e3e6(_0x531530[_0xc3ab('0x16')](0x1f4,_0x546096[_0xc3ab('0x18')]));});});}; \ No newline at end of file +var _0x4774=['findAll','options','raw','attributes','limit','include','map','model','GetSmsQueue','stringify','ShowSmsQueue','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsQueue'];(function(_0x496acd,_0x144020){var _0x5171b1=function(_0x302a6d){while(--_0x302a6d){_0x496acd['push'](_0x496acd['shift']());}};_0x5171b1(++_0x144020);}(_0x4774,0xd4));var _0x4477=function(_0x2d791b,_0x345312){_0x2d791b=_0x2d791b-0x0;var _0x5989a8=_0x4774[_0x2d791b];return _0x5989a8;};'use strict';var _=require(_0x4477('0x0'));var util=require('util');var moment=require(_0x4477('0x1'));var BPromise=require(_0x4477('0x2'));var rs=require(_0x4477('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4477('0x4'))['db'];var utils=require(_0x4477('0x5'));var logger=require('../../config/logger')(_0x4477('0x6'));var config=require(_0x4477('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4477('0x8')][_0x4477('0x9')]({'port':0x232a});config[_0x4477('0xa')]=_[_0x4477('0xb')](config[_0x4477('0xa')],{'host':_0x4477('0xc'),'port':0x18eb});var socket=require(_0x4477('0xd'))(new Redis(config['redis']));require(_0x4477('0xe'))[_0x4477('0xf')](socket);function respondWithRpcPromise(_0x402ac4,_0x1baeba,_0x50d431){return new BPromise(function(_0x25b620,_0x248a85){return client['request'](_0x402ac4,_0x50d431)[_0x4477('0x10')](function(_0xbb62d6){logger[_0x4477('0x11')](_0x4477('0x12'),_0x1baeba,_0x4477('0x13'));logger[_0x4477('0x14')](_0x4477('0x15'),_0x1baeba,'request\x20sent',JSON['stringify'](_0xbb62d6));if(_0xbb62d6[_0x4477('0x16')]){if(_0xbb62d6['error'][_0x4477('0x17')]===0x1f4){logger[_0x4477('0x16')](_0x4477('0x12'),_0x1baeba,_0xbb62d6[_0x4477('0x16')][_0x4477('0x18')]);return _0x248a85(_0xbb62d6['error'][_0x4477('0x18')]);}logger['error'](_0x4477('0x12'),_0x1baeba,_0xbb62d6['error'][_0x4477('0x18')]);return _0x25b620(_0xbb62d6[_0x4477('0x16')]['message']);}else{logger['info'](_0x4477('0x12'),_0x1baeba,_0x4477('0x13'));_0x25b620(_0xbb62d6[_0x4477('0x19')][_0x4477('0x18')]);}})[_0x4477('0x1a')](function(_0x37855b){logger[_0x4477('0x16')](_0x4477('0x12'),_0x1baeba,_0x37855b);_0x248a85(_0x37855b);});});}exports['GetSmsQueue']=function(_0x1b4621){var _0x350082=this;return new Promise(function(_0x15a2df,_0x6d3293){return db[_0x4477('0x1b')][_0x4477('0x1c')]({'raw':_0x1b4621[_0x4477('0x1d')]?_0x1b4621['options'][_0x4477('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b4621[_0x4477('0x1d')]?_0x1b4621[_0x4477('0x1d')]['where']||null:null,'attributes':_0x1b4621[_0x4477('0x1d')]?_0x1b4621[_0x4477('0x1d')][_0x4477('0x1f')]||null:null,'limit':_0x1b4621[_0x4477('0x1d')]?_0x1b4621[_0x4477('0x1d')][_0x4477('0x20')]||null:null,'include':_0x1b4621['options']?_0x1b4621[_0x4477('0x1d')][_0x4477('0x21')]?_[_0x4477('0x22')](_0x1b4621[_0x4477('0x1d')][_0x4477('0x21')],function(_0x5d3a2e){return{'model':db[_0x5d3a2e['model']],'as':_0x5d3a2e['as'],'attributes':_0x5d3a2e[_0x4477('0x1f')],'include':_0x5d3a2e['include']?_[_0x4477('0x22')](_0x5d3a2e[_0x4477('0x21')],function(_0x16de1a){return{'model':db[_0x16de1a['model']],'as':_0x16de1a['as'],'attributes':_0x16de1a[_0x4477('0x1f')],'include':_0x16de1a[_0x4477('0x21')]?_[_0x4477('0x22')](_0x16de1a[_0x4477('0x21')],function(_0x3ae19d){return{'model':db[_0x3ae19d[_0x4477('0x23')]],'as':_0x3ae19d['as'],'attributes':_0x3ae19d[_0x4477('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21cfa0){logger[_0x4477('0x11')]('GetSmsQueue',_0x1b4621);logger[_0x4477('0x14')](_0x4477('0x24'),_0x1b4621,JSON[_0x4477('0x25')](_0x21cfa0));_0x15a2df(_0x21cfa0);})['catch'](function(_0x373508){logger[_0x4477('0x16')]('GetSmsQueue',_0x373508[_0x4477('0x18')],_0x1b4621);_0x6d3293(_0x350082['error'](0x1f4,_0x373508[_0x4477('0x18')]));});});};exports[_0x4477('0x26')]=function(_0x232276){var _0x145618=this;return new Promise(function(_0x40f6aa,_0x43f950){return db[_0x4477('0x1b')]['find']({'raw':_0x232276[_0x4477('0x1d')]?_0x232276[_0x4477('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x232276[_0x4477('0x1d')]?_0x232276['options'][_0x4477('0x27')]||null:null,'attributes':_0x232276[_0x4477('0x1d')]?_0x232276[_0x4477('0x1d')][_0x4477('0x1f')]||null:null,'include':_0x232276[_0x4477('0x1d')]?_0x232276[_0x4477('0x1d')][_0x4477('0x21')]?_['map'](_0x232276[_0x4477('0x1d')]['include'],function(_0x64723d){return{'model':db[_0x64723d[_0x4477('0x23')]],'as':_0x64723d['as'],'attributes':_0x64723d[_0x4477('0x1f')],'include':_0x64723d[_0x4477('0x21')]?_[_0x4477('0x22')](_0x64723d[_0x4477('0x21')],function(_0x1f46bd){return{'model':db[_0x1f46bd[_0x4477('0x23')]],'as':_0x1f46bd['as'],'attributes':_0x1f46bd[_0x4477('0x1f')],'include':_0x1f46bd[_0x4477('0x21')]?_[_0x4477('0x22')](_0x1f46bd[_0x4477('0x21')],function(_0x2a0cbe){return{'model':db[_0x2a0cbe[_0x4477('0x23')]],'as':_0x2a0cbe['as'],'attributes':_0x2a0cbe['attributes']};}):[]};}):[]};}):[]:[]})[_0x4477('0x10')](function(_0x3f720b){logger[_0x4477('0x11')]('ShowSmsQueue',_0x232276);logger[_0x4477('0x14')]('ShowSmsQueue',_0x232276,JSON[_0x4477('0x25')](_0x3f720b));_0x40f6aa(_0x3f720b);})[_0x4477('0x1a')](function(_0x2bc124){logger[_0x4477('0x16')]('ShowSmsQueue',_0x2bc124[_0x4477('0x18')],_0x232276);_0x43f950(_0x145618[_0x4477('0x16')](0x1f4,_0x2bc124[_0x4477('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index ddf20e7..31c6d26 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 _0xecdd=['./smsQueue.events','save','remove','emit','removeListener','register','length','smsQueue:'];(function(_0x350f0e,_0x2d6eba){var _0x1355fe=function(_0x1a93bc){while(--_0x1a93bc){_0x350f0e['push'](_0x350f0e['shift']());}};_0x1355fe(++_0x2d6eba);}(_0xecdd,0xf8));var _0xdecd=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xecdd[_0x38a7ac];return _0x53061a;};'use strict';var SmsQueueEvents=require(_0xdecd('0x0'));var events=[_0xdecd('0x1'),_0xdecd('0x2'),'update'];function createListener(_0x277e0b,_0x36c19b){return function(_0x3b6c10){_0x36c19b[_0xdecd('0x3')](_0x277e0b,_0x3b6c10);};}function removeListener(_0x5b82ff,_0x5bd842){return function(){SmsQueueEvents[_0xdecd('0x4')](_0x5b82ff,_0x5bd842);};}exports[_0xdecd('0x5')]=function(_0x11fd10){for(var _0x4c54a0=0x0,_0x147811=events[_0xdecd('0x6')];_0x4c54a0<_0x147811;_0x4c54a0++){var _0xf000d4=events[_0x4c54a0];var _0x424a10=createListener(_0xdecd('0x7')+_0xf000d4,_0x11fd10);SmsQueueEvents['on'](_0xf000d4,_0x424a10);}}; \ No newline at end of file +var _0x04fb=['update','emit','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x1ff85b,_0x9eac7b){var _0x29c214=function(_0x1617b9){while(--_0x1617b9){_0x1ff85b['push'](_0x1ff85b['shift']());}};_0x29c214(++_0x9eac7b);}(_0x04fb,0x105));var _0xb04f=function(_0x396723,_0x1fa65e){_0x396723=_0x396723-0x0;var _0x4e3e98=_0x04fb[_0x396723];return _0x4e3e98;};'use strict';var SmsQueueEvents=require(_0xb04f('0x0'));var events=[_0xb04f('0x1'),_0xb04f('0x2'),_0xb04f('0x3')];function createListener(_0x144f90,_0x2d445c){return function(_0x5bc144){_0x2d445c[_0xb04f('0x4')](_0x144f90,_0x5bc144);};}function removeListener(_0x1e3292,_0x4c21ff){return function(){SmsQueueEvents['removeListener'](_0x1e3292,_0x4c21ff);};}exports[_0xb04f('0x5')]=function(_0x3cf67c){for(var _0x4aeb2e=0x0,_0x5c9256=events[_0xb04f('0x6')];_0x4aeb2e<_0x5c9256;_0x4aeb2e++){var _0x19580c=events[_0x4aeb2e];var _0x78110b=createListener(_0xb04f('0x7')+_0x19580c,_0x3cf67c);SmsQueueEvents['on'](_0x19580c,_0x78110b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index de209e4..6499f2d 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 _0x5398=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5398,0xe2));var _0x8539=function(_0x41b8b8,_0x4a867a){_0x41b8b8=_0x41b8b8-0x0;var _0x431ada=_0x5398[_0x41b8b8];return _0x431ada;};'use strict';var multer=require('multer');var util=require(_0x8539('0x0'));var path=require(_0x8539('0x1'));var timeout=require(_0x8539('0x2'));var express=require(_0x8539('0x3'));var router=express[_0x8539('0x4')]();var fs_extra=require(_0x8539('0x5'));var auth=require(_0x8539('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8539('0x7'));router[_0x8539('0x8')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xa')]);router[_0x8539('0x8')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0xc')]);router[_0x8539('0x8')](_0x8539('0xd'),auth[_0x8539('0x9')](),controller[_0x8539('0xe')]);router[_0x8539('0xf')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0x10')]);router[_0x8539('0x11')](_0x8539('0xd'),auth['isAuthenticated'](),controller[_0x8539('0x12')]);router[_0x8539('0x13')](_0x8539('0xd'),auth['isAuthenticated'](),controller[_0x8539('0x14')]);module[_0x8539('0x15')]=router; \ No newline at end of file +var _0x65ac=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x123395,_0x39b70b){var _0xf032fe=function(_0x383118){while(--_0x383118){_0x123395['push'](_0x123395['shift']());}};_0xf032fe(++_0x39b70b);}(_0x65ac,0x100));var _0xc65a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x65ac[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require(_0xc65a('0x0'));var path=require(_0xc65a('0x1'));var timeout=require(_0xc65a('0x2'));var express=require('express');var router=express[_0xc65a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc65a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc65a('0x5'));var controller=require(_0xc65a('0x6'));router[_0xc65a('0x7')]('/',auth[_0xc65a('0x8')](),controller[_0xc65a('0x9')]);router[_0xc65a('0x7')](_0xc65a('0xa'),auth[_0xc65a('0x8')](),controller[_0xc65a('0xb')]);router[_0xc65a('0x7')](_0xc65a('0xc'),auth[_0xc65a('0x8')](),controller[_0xc65a('0xd')]);router[_0xc65a('0xe')]('/',auth[_0xc65a('0x8')](),controller[_0xc65a('0xf')]);router[_0xc65a('0x10')](_0xc65a('0xc'),auth[_0xc65a('0x8')](),controller[_0xc65a('0x11')]);router[_0xc65a('0x12')](_0xc65a('0xc'),auth[_0xc65a('0x8')](),controller[_0xc65a('0x13')]);module[_0xc65a('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d60e5f8..6f17b6a 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 _0xe53c=['moment','sequelize','STRING','DATE'];(function(_0x1c051a,_0x16039f){var _0x350a44=function(_0x18523c){while(--_0x18523c){_0x1c051a['push'](_0x1c051a['shift']());}};_0x350a44(++_0x16039f);}(_0xe53c,0xbc));var _0xce53=function(_0x1b00d0,_0x265b67){_0x1b00d0=_0x1b00d0-0x0;var _0x31446c=_0xe53c[_0x1b00d0];return _0x31446c;};'use strict';var moment=require(_0xce53('0x0'));var Sequelize=require(_0xce53('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xce53('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xce53('0x3')]},'acceptAt':{'type':Sequelize[_0xce53('0x3')]},'exitAt':{'type':Sequelize[_0xce53('0x3')]},'reason':{'type':Sequelize[_0xce53('0x2')]}}; \ No newline at end of file +var _0x356d=['DATE','moment','STRING'];(function(_0xd9af4e,_0x157e34){var _0x11942e=function(_0x37aba8){while(--_0x37aba8){_0xd9af4e['push'](_0xd9af4e['shift']());}};_0x11942e(++_0x157e34);}(_0x356d,0x199));var _0xd356=function(_0x4c894b,_0x54fa91){_0x4c894b=_0x4c894b-0x0;var _0x490258=_0x356d[_0x4c894b];return _0x490258;};'use strict';var moment=require(_0xd356('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xd356('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd356('0x2')]},'leaveAt':{'type':Sequelize[_0xd356('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 12d0abe..568643d 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 _0x0aab=['status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','rawAttributes','key','model','map','keys','attributes','intersection','fields','query','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','sendStatus'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0aab,0x80));var _0xb0aa=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0x0aab[_0x120bc2];return _0x454a41;};'use strict';var emlformat=require(_0xb0aa('0x0'));var rimraf=require(_0xb0aa('0x1'));var zipdir=require(_0xb0aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0aa('0x3'));var moment=require(_0xb0aa('0x4'));var BPromise=require(_0xb0aa('0x5'));var Mustache=require(_0xb0aa('0x6'));var util=require(_0xb0aa('0x7'));var path=require('path');var sox=require(_0xb0aa('0x8'));var csv=require(_0xb0aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0aa('0xa'));var _=require(_0xb0aa('0xb'));var squel=require(_0xb0aa('0xc'));var crypto=require(_0xb0aa('0xd'));var jsforce=require(_0xb0aa('0xe'));var deskjs=require(_0xb0aa('0xf'));var toCsv=require(_0xb0aa('0x9'));var querystring=require(_0xb0aa('0x10'));var Papa=require('papaparse');var Redis=require(_0xb0aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb0aa('0x12'));var as=require(_0xb0aa('0x13'));var hardwareService=require(_0xb0aa('0x14'));var logger=require(_0xb0aa('0x15'))(_0xb0aa('0x16'));var utils=require(_0xb0aa('0x17'));var config=require(_0xb0aa('0x18'));var licenseUtil=require(_0xb0aa('0x19'));var db=require(_0xb0aa('0x1a'))['db'];function respondWithStatusCode(_0x4067b0,_0x3165c7){_0x3165c7=_0x3165c7||0xcc;return function(_0x55bbc1){if(_0x55bbc1){return _0x4067b0[_0xb0aa('0x1b')](_0x3165c7);}return _0x4067b0[_0xb0aa('0x1c')](_0x3165c7)[_0xb0aa('0x1d')]();};}function respondWithResult(_0x3c2ff0,_0x5550bc){_0x5550bc=_0x5550bc||0xc8;return function(_0x4c1adc){if(_0x4c1adc){return _0x3c2ff0['status'](_0x5550bc)[_0xb0aa('0x1e')](_0x4c1adc);}};}function respondWithFilteredResult(_0x52859e,_0x1e9f09){return function(_0x2bd90d){if(_0x2bd90d){var _0x2b1c96=typeof _0x1e9f09[_0xb0aa('0x1f')]===_0xb0aa('0x20')&&typeof _0x1e9f09[_0xb0aa('0x21')]===_0xb0aa('0x20');var _0x491f36=_0x2bd90d['count'];var _0x231ad2=_0x2b1c96?0x0:_0x1e9f09[_0xb0aa('0x1f')];var _0x1a31a9=_0x2b1c96?_0x2bd90d[_0xb0aa('0x22')]:_0x1e9f09['offset']+_0x1e9f09['limit'];var _0x4541aa;if(_0x1a31a9>=_0x491f36){_0x1a31a9=_0x491f36;_0x4541aa=0xc8;}else{_0x4541aa=0xce;}_0x52859e['status'](_0x4541aa);return _0x52859e[_0xb0aa('0x23')]('Content-Range',_0x231ad2+'-'+_0x1a31a9+'/'+_0x491f36)[_0xb0aa('0x1e')](_0x2bd90d);}return null;};}function patchUpdates(_0x39249b){return function(_0x951584){try{jsonpatch[_0xb0aa('0x24')](_0x951584,_0x39249b,!![]);}catch(_0x242a00){return BPromise['reject'](_0x242a00);}return _0x951584['save']();};}function saveUpdates(_0x10be80,_0x4422a2){return function(_0x5119e0){if(_0x5119e0){return _0x5119e0[_0xb0aa('0x25')](_0x10be80)[_0xb0aa('0x26')](function(_0x260c82){return _0x260c82;});}return null;};}function removeEntity(_0xd86e9a,_0x4b7d3a){return function(_0x128c33){if(_0x128c33){return _0x128c33[_0xb0aa('0x27')]()[_0xb0aa('0x26')](function(){_0xd86e9a[_0xb0aa('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa0536,_0x430fb3){return function(_0x151826){if(!_0x151826){_0xaa0536[_0xb0aa('0x1b')](0x194);}return _0x151826;};}function handleError(_0x511649,_0x5b333e){_0x5b333e=_0x5b333e||0x1f4;return function(_0x2acaa3){logger[_0xb0aa('0x28')](_0x2acaa3[_0xb0aa('0x29')]);if(_0x2acaa3[_0xb0aa('0x2a')]){delete _0x2acaa3[_0xb0aa('0x2a')];}_0x511649[_0xb0aa('0x1c')](_0x5b333e)[_0xb0aa('0x2b')](_0x2acaa3);};}exports[_0xb0aa('0x2c')]=function(_0x220df6,_0x327a9c){var _0x4aa830={},_0x3a8843={},_0x30771d={'count':0x0,'rows':[]};var _0x34a984=_['map'](db['SmsQueueReport'][_0xb0aa('0x2d')],function(_0x428a99){return{'name':_0x428a99['fieldName'],'type':_0x428a99['type'][_0xb0aa('0x2e')]};});_0x3a8843[_0xb0aa('0x2f')]=_[_0xb0aa('0x30')](_0x34a984,_0xb0aa('0x2a'));_0x3a8843['query']=_[_0xb0aa('0x31')](_0x220df6['query']);_0x3a8843['filters']=_['intersection'](_0x3a8843['model'],_0x3a8843['query']);_0x4aa830[_0xb0aa('0x32')]=_[_0xb0aa('0x33')](_0x3a8843['model'],qs[_0xb0aa('0x34')](_0x220df6[_0xb0aa('0x35')][_0xb0aa('0x34')]));_0x4aa830[_0xb0aa('0x32')]=_0x4aa830[_0xb0aa('0x32')][_0xb0aa('0x36')]?_0x4aa830[_0xb0aa('0x32')]:_0x3a8843['model'];if(!_0x220df6['query']['hasOwnProperty'](_0xb0aa('0x37'))){_0x4aa830[_0xb0aa('0x21')]=qs[_0xb0aa('0x21')](_0x220df6[_0xb0aa('0x35')][_0xb0aa('0x21')]);_0x4aa830[_0xb0aa('0x1f')]=qs[_0xb0aa('0x1f')](_0x220df6[_0xb0aa('0x35')][_0xb0aa('0x1f')]);}_0x4aa830[_0xb0aa('0x38')]=qs[_0xb0aa('0x39')](_0x220df6['query'][_0xb0aa('0x39')]);_0x4aa830[_0xb0aa('0x3a')]=qs[_0xb0aa('0x3b')](_[_0xb0aa('0x3c')](_0x220df6[_0xb0aa('0x35')],_0x3a8843['filters']),_0x34a984);if(_0x220df6[_0xb0aa('0x35')][_0xb0aa('0x3d')]){_0x4aa830[_0xb0aa('0x3a')]=_[_0xb0aa('0x3e')](_0x4aa830[_0xb0aa('0x3a')],{'$or':_[_0xb0aa('0x30')](_0x34a984,function(_0x3427ef){if(_0x3427ef[_0xb0aa('0x3f')]!==_0xb0aa('0x40')){var _0x140616={};_0x140616[_0x3427ef[_0xb0aa('0x2a')]]={'$like':'%'+_0x220df6[_0xb0aa('0x35')]['filter']+'%'};return _0x140616;}})});}_0x4aa830=_[_0xb0aa('0x3e')]({},_0x4aa830,_0x220df6[_0xb0aa('0x41')]);var _0x35d1ee={'where':_0x4aa830[_0xb0aa('0x3a')]};return db[_0xb0aa('0x42')][_0xb0aa('0x22')](_0x35d1ee)['then'](function(_0x30e397){_0x30771d[_0xb0aa('0x22')]=_0x30e397;if(_0x220df6[_0xb0aa('0x35')][_0xb0aa('0x43')]){_0x4aa830[_0xb0aa('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb0aa('0x45')](_0x4aa830);})['then'](function(_0x11d9c7){_0x30771d[_0xb0aa('0x46')]=_0x11d9c7;return _0x30771d;})[_0xb0aa('0x26')](respondWithFilteredResult(_0x327a9c,_0x4aa830))[_0xb0aa('0x47')](handleError(_0x327a9c,null));};exports[_0xb0aa('0x48')]=function(_0x3cae02,_0x5f1c96){var _0x5a6f00={'raw':!![],'where':{'id':_0x3cae02[_0xb0aa('0x49')]['id']}},_0x1558e0={};_0x1558e0[_0xb0aa('0x2f')]=_[_0xb0aa('0x31')](db[_0xb0aa('0x42')]['rawAttributes']);_0x1558e0[_0xb0aa('0x35')]=_[_0xb0aa('0x31')](_0x3cae02[_0xb0aa('0x35')]);_0x1558e0[_0xb0aa('0x3b')]=_[_0xb0aa('0x33')](_0x1558e0[_0xb0aa('0x2f')],_0x1558e0[_0xb0aa('0x35')]);_0x5a6f00[_0xb0aa('0x32')]=_[_0xb0aa('0x33')](_0x1558e0['model'],qs['fields'](_0x3cae02['query']['fields']));_0x5a6f00['attributes']=_0x5a6f00[_0xb0aa('0x32')][_0xb0aa('0x36')]?_0x5a6f00['attributes']:_0x1558e0[_0xb0aa('0x2f')];if(_0x3cae02['query'][_0xb0aa('0x43')]){_0x5a6f00[_0xb0aa('0x44')]=[{'all':!![]}];}_0x5a6f00=_[_0xb0aa('0x3e')]({},_0x5a6f00,_0x3cae02[_0xb0aa('0x41')]);return db[_0xb0aa('0x42')]['find'](_0x5a6f00)[_0xb0aa('0x26')](handleEntityNotFound(_0x5f1c96,null))[_0xb0aa('0x26')](respondWithResult(_0x5f1c96,null))[_0xb0aa('0x47')](handleError(_0x5f1c96,null));};exports[_0xb0aa('0x4a')]=function(_0xef91b7,_0x5f115d){return db[_0xb0aa('0x42')][_0xb0aa('0x4a')](_0xef91b7[_0xb0aa('0x4b')],{})[_0xb0aa('0x26')](respondWithResult(_0x5f115d,0xc9))['catch'](handleError(_0x5f115d,null));};exports[_0xb0aa('0x25')]=function(_0x59f937,_0x12039b){if(_0x59f937['body']['id']){delete _0x59f937[_0xb0aa('0x4b')]['id'];}return db[_0xb0aa('0x42')][_0xb0aa('0x4c')]({'where':{'id':_0x59f937[_0xb0aa('0x49')]['id']}})[_0xb0aa('0x26')](handleEntityNotFound(_0x12039b,null))[_0xb0aa('0x26')](saveUpdates(_0x59f937[_0xb0aa('0x4b')],null))[_0xb0aa('0x26')](respondWithResult(_0x12039b,null))[_0xb0aa('0x47')](handleError(_0x12039b,null));};exports['destroy']=function(_0x39c11e,_0x5f2ad9){return db[_0xb0aa('0x42')]['find']({'where':{'id':_0x39c11e[_0xb0aa('0x49')]['id']}})[_0xb0aa('0x26')](handleEntityNotFound(_0x5f2ad9,null))[_0xb0aa('0x26')](removeEntity(_0x5f2ad9,null))[_0xb0aa('0x47')](handleError(_0x5f2ad9,null));};exports[_0xb0aa('0x4d')]=function(_0xec9b5c,_0x2a85b3){return db[_0xb0aa('0x42')][_0xb0aa('0x4d')]()[_0xb0aa('0x26')](respondWithResult(_0x2a85b3,null))[_0xb0aa('0x47')](handleError(_0x2a85b3,null));}; \ No newline at end of file +var _0x012d=['status','set','Content-Range','apply','reject','destroy','then','error','stack','name','SmsQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','where','pick','merge','type','VIRTUAL','includeAll','rows','catch','rawAttributes','include','options','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit'];(function(_0x26a810,_0x247776){var _0x4758a3=function(_0xa1fbb9){while(--_0xa1fbb9){_0x26a810['push'](_0x26a810['shift']());}};_0x4758a3(++_0x247776);}(_0x012d,0x1c5));var _0xd012=function(_0x3aa671,_0x392e38){_0x3aa671=_0x3aa671-0x0;var _0xb2faba=_0x012d[_0x3aa671];return _0xb2faba;};'use strict';var emlformat=require(_0xd012('0x0'));var rimraf=require(_0xd012('0x1'));var zipdir=require(_0xd012('0x2'));var jsonpatch=require(_0xd012('0x3'));var rp=require('request-promise');var moment=require(_0xd012('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd012('0x5'));var path=require(_0xd012('0x6'));var sox=require('sox');var csv=require(_0xd012('0x7'));var ejs=require(_0xd012('0x8'));var fs=require('fs');var fs_extra=require(_0xd012('0x9'));var _=require(_0xd012('0xa'));var squel=require('squel');var crypto=require(_0xd012('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd012('0x7'));var querystring=require(_0xd012('0xc'));var Papa=require(_0xd012('0xd'));var Redis=require(_0xd012('0xe'));var authService=require(_0xd012('0xf'));var qs=require(_0xd012('0x10'));var as=require(_0xd012('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd012('0x12'));var utils=require(_0xd012('0x13'));var config=require(_0xd012('0x14'));var licenseUtil=require(_0xd012('0x15'));var db=require(_0xd012('0x16'))['db'];function respondWithStatusCode(_0x16999f,_0x427c5e){_0x427c5e=_0x427c5e||0xcc;return function(_0x562cfb){if(_0x562cfb){return _0x16999f[_0xd012('0x17')](_0x427c5e);}return _0x16999f['status'](_0x427c5e)[_0xd012('0x18')]();};}function respondWithResult(_0x4425a1,_0x301cfa){_0x301cfa=_0x301cfa||0xc8;return function(_0x4c3221){if(_0x4c3221){return _0x4425a1['status'](_0x301cfa)[_0xd012('0x19')](_0x4c3221);}};}function respondWithFilteredResult(_0x27c314,_0x45a33d){return function(_0x1aa1f3){if(_0x1aa1f3){var _0x32fd85=typeof _0x45a33d['offset']===_0xd012('0x1a')&&typeof _0x45a33d['limit']===_0xd012('0x1a');var _0x9cb888=_0x1aa1f3[_0xd012('0x1b')];var _0x3b0d3a=_0x32fd85?0x0:_0x45a33d['offset'];var _0x520c92=_0x32fd85?_0x1aa1f3[_0xd012('0x1b')]:_0x45a33d[_0xd012('0x1c')]+_0x45a33d[_0xd012('0x1d')];var _0x390e1e;if(_0x520c92>=_0x9cb888){_0x520c92=_0x9cb888;_0x390e1e=0xc8;}else{_0x390e1e=0xce;}_0x27c314[_0xd012('0x1e')](_0x390e1e);return _0x27c314[_0xd012('0x1f')](_0xd012('0x20'),_0x3b0d3a+'-'+_0x520c92+'/'+_0x9cb888)[_0xd012('0x19')](_0x1aa1f3);}return null;};}function patchUpdates(_0x1c2e9b){return function(_0x678c3){try{jsonpatch[_0xd012('0x21')](_0x678c3,_0x1c2e9b,!![]);}catch(_0x5a2e2f){return BPromise[_0xd012('0x22')](_0x5a2e2f);}return _0x678c3['save']();};}function saveUpdates(_0x12cb37,_0x158b34){return function(_0x2641b3){if(_0x2641b3){return _0x2641b3['update'](_0x12cb37)['then'](function(_0x4e8791){return _0x4e8791;});}return null;};}function removeEntity(_0x33b8a6,_0x3cef9c){return function(_0x5d1c17){if(_0x5d1c17){return _0x5d1c17[_0xd012('0x23')]()[_0xd012('0x24')](function(){_0x33b8a6[_0xd012('0x1e')](0xcc)[_0xd012('0x18')]();});}};}function handleEntityNotFound(_0x5dec5e,_0x3ccf3b){return function(_0x152a4a){if(!_0x152a4a){_0x5dec5e['sendStatus'](0x194);}return _0x152a4a;};}function handleError(_0x379917,_0x171680){_0x171680=_0x171680||0x1f4;return function(_0x133e25){logger[_0xd012('0x25')](_0x133e25[_0xd012('0x26')]);if(_0x133e25[_0xd012('0x27')]){delete _0x133e25[_0xd012('0x27')];}_0x379917[_0xd012('0x1e')](_0x171680)['send'](_0x133e25);};}exports['index']=function(_0x40587c,_0x5c333f){var _0xf14f23={},_0x495c99={},_0x29a014={'count':0x0,'rows':[]};var _0x1c9e77=_['map'](db[_0xd012('0x28')]['rawAttributes'],function(_0x9bdcac){return{'name':_0x9bdcac[_0xd012('0x29')],'type':_0x9bdcac['type'][_0xd012('0x2a')]};});_0x495c99[_0xd012('0x2b')]=_['map'](_0x1c9e77,_0xd012('0x27'));_0x495c99[_0xd012('0x2c')]=_[_0xd012('0x2d')](_0x40587c[_0xd012('0x2c')]);_0x495c99[_0xd012('0x2e')]=_[_0xd012('0x2f')](_0x495c99[_0xd012('0x2b')],_0x495c99[_0xd012('0x2c')]);_0xf14f23['attributes']=_[_0xd012('0x2f')](_0x495c99[_0xd012('0x2b')],qs[_0xd012('0x30')](_0x40587c[_0xd012('0x2c')][_0xd012('0x30')]));_0xf14f23[_0xd012('0x31')]=_0xf14f23[_0xd012('0x31')]['length']?_0xf14f23[_0xd012('0x31')]:_0x495c99[_0xd012('0x2b')];if(!_0x40587c[_0xd012('0x2c')][_0xd012('0x32')]('nolimit')){_0xf14f23[_0xd012('0x1d')]=qs[_0xd012('0x1d')](_0x40587c[_0xd012('0x2c')][_0xd012('0x1d')]);_0xf14f23[_0xd012('0x1c')]=qs[_0xd012('0x1c')](_0x40587c[_0xd012('0x2c')][_0xd012('0x1c')]);}_0xf14f23[_0xd012('0x33')]=qs['sort'](_0x40587c[_0xd012('0x2c')]['sort']);_0xf14f23[_0xd012('0x34')]=qs[_0xd012('0x2e')](_[_0xd012('0x35')](_0x40587c[_0xd012('0x2c')],_0x495c99['filters']),_0x1c9e77);if(_0x40587c[_0xd012('0x2c')]['filter']){_0xf14f23[_0xd012('0x34')]=_[_0xd012('0x36')](_0xf14f23[_0xd012('0x34')],{'$or':_['map'](_0x1c9e77,function(_0x41ea4e){if(_0x41ea4e[_0xd012('0x37')]!==_0xd012('0x38')){var _0x3e7792={};_0x3e7792[_0x41ea4e[_0xd012('0x27')]]={'$like':'%'+_0x40587c[_0xd012('0x2c')]['filter']+'%'};return _0x3e7792;}})});}_0xf14f23=_[_0xd012('0x36')]({},_0xf14f23,_0x40587c['options']);var _0x2af2ff={'where':_0xf14f23['where']};return db[_0xd012('0x28')][_0xd012('0x1b')](_0x2af2ff)['then'](function(_0x3e9a49){_0x29a014[_0xd012('0x1b')]=_0x3e9a49;if(_0x40587c[_0xd012('0x2c')][_0xd012('0x39')]){_0xf14f23['include']=[{'all':!![]}];}return db[_0xd012('0x28')]['findAll'](_0xf14f23);})[_0xd012('0x24')](function(_0x22b1cf){_0x29a014[_0xd012('0x3a')]=_0x22b1cf;return _0x29a014;})[_0xd012('0x24')](respondWithFilteredResult(_0x5c333f,_0xf14f23))[_0xd012('0x3b')](handleError(_0x5c333f,null));};exports['show']=function(_0x2aad05,_0x718b60){var _0x3fc135={'raw':!![],'where':{'id':_0x2aad05['params']['id']}},_0x3d4db1={};_0x3d4db1[_0xd012('0x2b')]=_[_0xd012('0x2d')](db[_0xd012('0x28')][_0xd012('0x3c')]);_0x3d4db1[_0xd012('0x2c')]=_[_0xd012('0x2d')](_0x2aad05[_0xd012('0x2c')]);_0x3d4db1[_0xd012('0x2e')]=_[_0xd012('0x2f')](_0x3d4db1[_0xd012('0x2b')],_0x3d4db1['query']);_0x3fc135[_0xd012('0x31')]=_[_0xd012('0x2f')](_0x3d4db1[_0xd012('0x2b')],qs[_0xd012('0x30')](_0x2aad05[_0xd012('0x2c')][_0xd012('0x30')]));_0x3fc135['attributes']=_0x3fc135['attributes']['length']?_0x3fc135[_0xd012('0x31')]:_0x3d4db1[_0xd012('0x2b')];if(_0x2aad05[_0xd012('0x2c')]['includeAll']){_0x3fc135[_0xd012('0x3d')]=[{'all':!![]}];}_0x3fc135=_[_0xd012('0x36')]({},_0x3fc135,_0x2aad05[_0xd012('0x3e')]);return db['SmsQueueReport']['find'](_0x3fc135)[_0xd012('0x24')](handleEntityNotFound(_0x718b60,null))['then'](respondWithResult(_0x718b60,null))[_0xd012('0x3b')](handleError(_0x718b60,null));};exports['create']=function(_0x34e082,_0x542977){return db[_0xd012('0x28')][_0xd012('0x3f')](_0x34e082['body'],{})[_0xd012('0x24')](respondWithResult(_0x542977,0xc9))[_0xd012('0x3b')](handleError(_0x542977,null));};exports[_0xd012('0x40')]=function(_0x5ca094,_0x47eda1){if(_0x5ca094['body']['id']){delete _0x5ca094[_0xd012('0x41')]['id'];}return db[_0xd012('0x28')][_0xd012('0x42')]({'where':{'id':_0x5ca094[_0xd012('0x43')]['id']}})[_0xd012('0x24')](handleEntityNotFound(_0x47eda1,null))[_0xd012('0x24')](saveUpdates(_0x5ca094[_0xd012('0x41')],null))[_0xd012('0x24')](respondWithResult(_0x47eda1,null))[_0xd012('0x3b')](handleError(_0x47eda1,null));};exports[_0xd012('0x23')]=function(_0x2c472d,_0x293e68){return db[_0xd012('0x28')][_0xd012('0x42')]({'where':{'id':_0x2c472d[_0xd012('0x43')]['id']}})[_0xd012('0x24')](handleEntityNotFound(_0x293e68,null))[_0xd012('0x24')](removeEntity(_0x293e68,null))['catch'](handleError(_0x293e68,null));};exports[_0xd012('0x44')]=function(_0x29babe,_0x56af12){return db[_0xd012('0x28')][_0xd012('0x44')]()[_0xd012('0x24')](respondWithResult(_0x56af12,null))['catch'](handleError(_0x56af12,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 83b2d36..5d10fa5 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(_0x4386ce,_0x2fd0b7){var _0x5de545=function(_0x4bfcda){while(--_0x4bfcda){_0x4386ce['push'](_0x4386ce['shift']());}};_0x5de545(++_0x2fd0b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e202c,_0x4b76ac){var _0x3cc463=function(_0x49d536){while(--_0x49d536){_0x5e202c['push'](_0x5e202c['shift']());}};_0x3cc463(++_0x4b76ac);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'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 afa18db..f96729d 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 _0x1ce4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','lodash','moment','bluebird'];(function(_0x4819c1,_0x11e719){var _0x45d265=function(_0x339f3f){while(--_0x339f3f){_0x4819c1['push'](_0x4819c1['shift']());}};_0x45d265(++_0x11e719);}(_0x1ce4,0xc3));var _0x41ce=function(_0x5cd0d3,_0x4979af){_0x5cd0d3=_0x5cd0d3-0x0;var _0x579dd8=_0x1ce4[_0x5cd0d3];return _0x579dd8;};'use strict';var _=require(_0x41ce('0x0'));var util=require('util');var moment=require(_0x41ce('0x1'));var BPromise=require(_0x41ce('0x2'));var rs=require(_0x41ce('0x3'));var fs=require('fs');var Redis=require(_0x41ce('0x4'));var db=require(_0x41ce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x41ce('0x6'))(_0x41ce('0x7'));var config=require(_0x41ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41ce('0x9')][_0x41ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24aa08,_0xeec27b,_0x394ab0){return new BPromise(function(_0x27a053,_0x554147){return client[_0x41ce('0xb')](_0x24aa08,_0x394ab0)[_0x41ce('0xc')](function(_0x4ed1d7){logger['info'](_0x41ce('0xd'),_0xeec27b,'request\x20sent');logger[_0x41ce('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xeec27b,_0x41ce('0xf'),JSON[_0x41ce('0x10')](_0x4ed1d7));if(_0x4ed1d7[_0x41ce('0x11')]){if(_0x4ed1d7[_0x41ce('0x11')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0xeec27b,_0x4ed1d7[_0x41ce('0x11')][_0x41ce('0x12')]);return _0x554147(_0x4ed1d7[_0x41ce('0x11')]['message']);}logger['error'](_0x41ce('0xd'),_0xeec27b,_0x4ed1d7['error']['message']);return _0x27a053(_0x4ed1d7[_0x41ce('0x11')]['message']);}else{logger[_0x41ce('0x13')](_0x41ce('0xd'),_0xeec27b,_0x41ce('0xf'));_0x27a053(_0x4ed1d7[_0x41ce('0x14')][_0x41ce('0x12')]);}})[_0x41ce('0x15')](function(_0x957fb7){logger[_0x41ce('0x11')](_0x41ce('0xd'),_0xeec27b,_0x957fb7);_0x554147(_0x957fb7);});});}exports[_0x41ce('0x16')]=function(_0x46c0ed){var _0x44cac4=this;return new Promise(function(_0x48c908,_0x177cfb){return db[_0x41ce('0x17')][_0x41ce('0x18')](_0x46c0ed[_0x41ce('0x19')],{'raw':_0x46c0ed[_0x41ce('0x1a')]?_0x46c0ed[_0x41ce('0x1a')][_0x41ce('0x1b')]===undefined?!![]:![]:!![]})[_0x41ce('0xc')](function(_0x400cc3){logger[_0x41ce('0x13')](_0x41ce('0x16'),_0x46c0ed);logger['debug'](_0x41ce('0x16'),_0x46c0ed,JSON[_0x41ce('0x10')](_0x400cc3));_0x48c908(_0x400cc3);})['catch'](function(_0x47e2f6){logger[_0x41ce('0x11')](_0x41ce('0x16'),_0x47e2f6[_0x41ce('0x12')],_0x46c0ed);_0x177cfb(_0x44cac4[_0x41ce('0x11')](0x1f4,_0x47e2f6['message']));});});};exports[_0x41ce('0x1c')]=function(_0x3628c7){var _0x55f637=this;return new Promise(function(_0x3a32c2,_0x488e59){return db[_0x41ce('0x17')][_0x41ce('0x1d')](_0x3628c7[_0x41ce('0x19')],{'raw':_0x3628c7[_0x41ce('0x1a')]?_0x3628c7['options'][_0x41ce('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3628c7[_0x41ce('0x1a')]?_0x3628c7[_0x41ce('0x1a')][_0x41ce('0x1e')]||null:null,'attributes':_0x3628c7['options']?_0x3628c7[_0x41ce('0x1a')][_0x41ce('0x1f')]||null:null,'limit':_0x3628c7['options']?_0x3628c7['options'][_0x41ce('0x20')]||null:null})[_0x41ce('0xc')](function(_0x422374){logger[_0x41ce('0x13')]('UpdateSmsQueueReport',_0x3628c7);logger[_0x41ce('0xe')](_0x41ce('0x1c'),_0x3628c7,JSON[_0x41ce('0x10')](_0x422374));_0x3a32c2(_0x422374);})[_0x41ce('0x15')](function(_0x4b7d7e){logger['error'](_0x41ce('0x1c'),_0x4b7d7e[_0x41ce('0x12')],_0x3628c7);_0x488e59(_0x55f637[_0x41ce('0x11')](0x1f4,_0x4b7d7e[_0x41ce('0x12')]));});});}; \ No newline at end of file +var _0xf0a5=['error','code','message','result','catch','SmsQueueReport','create','body','CreateSmsQueueReport','debug','stringify','update','options','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x2ddb80,_0x4a72ab){var _0x41eea6=function(_0x33cfb1){while(--_0x33cfb1){_0x2ddb80['push'](_0x2ddb80['shift']());}};_0x41eea6(++_0x4a72ab);}(_0xf0a5,0xf0));var _0x5f0a=function(_0x420c07,_0x4b6c7c){_0x420c07=_0x420c07-0x0;var _0x1acc01=_0xf0a5[_0x420c07];return _0x1acc01;};'use strict';var _=require(_0x5f0a('0x0'));var util=require(_0x5f0a('0x1'));var moment=require(_0x5f0a('0x2'));var BPromise=require(_0x5f0a('0x3'));var rs=require(_0x5f0a('0x4'));var fs=require('fs');var Redis=require(_0x5f0a('0x5'));var db=require(_0x5f0a('0x6'))['db'];var utils=require(_0x5f0a('0x7'));var logger=require(_0x5f0a('0x8'))('rpc');var config=require(_0x5f0a('0x9'));var jayson=require(_0x5f0a('0xa'));var client=jayson[_0x5f0a('0xb')][_0x5f0a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x334896,_0x3b6c5,_0x132022){return new BPromise(function(_0x3ba6f9,_0x3bccda){return client[_0x5f0a('0xd')](_0x334896,_0x132022)[_0x5f0a('0xe')](function(_0x108926){logger[_0x5f0a('0xf')](_0x5f0a('0x10'),_0x3b6c5,_0x5f0a('0x11'));logger['debug'](_0x5f0a('0x12'),_0x3b6c5,_0x5f0a('0x11'),JSON['stringify'](_0x108926));if(_0x108926['error']){if(_0x108926[_0x5f0a('0x13')][_0x5f0a('0x14')]===0x1f4){logger[_0x5f0a('0x13')](_0x5f0a('0x10'),_0x3b6c5,_0x108926[_0x5f0a('0x13')][_0x5f0a('0x15')]);return _0x3bccda(_0x108926['error'][_0x5f0a('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3b6c5,_0x108926['error'][_0x5f0a('0x15')]);return _0x3ba6f9(_0x108926[_0x5f0a('0x13')][_0x5f0a('0x15')]);}else{logger[_0x5f0a('0xf')](_0x5f0a('0x10'),_0x3b6c5,_0x5f0a('0x11'));_0x3ba6f9(_0x108926[_0x5f0a('0x16')]['message']);}})[_0x5f0a('0x17')](function(_0x2cf316){logger[_0x5f0a('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x3b6c5,_0x2cf316);_0x3bccda(_0x2cf316);});});}exports['CreateSmsQueueReport']=function(_0x20a5fc){var _0x1c8843=this;return new Promise(function(_0x1b7b02,_0x47d470){return db[_0x5f0a('0x18')][_0x5f0a('0x19')](_0x20a5fc[_0x5f0a('0x1a')],{'raw':_0x20a5fc['options']?_0x20a5fc['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c5602){logger[_0x5f0a('0xf')](_0x5f0a('0x1b'),_0x20a5fc);logger[_0x5f0a('0x1c')](_0x5f0a('0x1b'),_0x20a5fc,JSON[_0x5f0a('0x1d')](_0x2c5602));_0x1b7b02(_0x2c5602);})['catch'](function(_0xad4dac){logger[_0x5f0a('0x13')](_0x5f0a('0x1b'),_0xad4dac['message'],_0x20a5fc);_0x47d470(_0x1c8843['error'](0x1f4,_0xad4dac[_0x5f0a('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x244005){var _0x2e4133=this;return new Promise(function(_0x442939,_0x23cfc2){return db[_0x5f0a('0x18')][_0x5f0a('0x1e')](_0x244005[_0x5f0a('0x1a')],{'raw':_0x244005[_0x5f0a('0x1f')]?_0x244005[_0x5f0a('0x1f')][_0x5f0a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x244005[_0x5f0a('0x1f')]?_0x244005[_0x5f0a('0x1f')][_0x5f0a('0x21')]||null:null,'attributes':_0x244005[_0x5f0a('0x1f')]?_0x244005[_0x5f0a('0x1f')][_0x5f0a('0x22')]||null:null,'limit':_0x244005[_0x5f0a('0x1f')]?_0x244005[_0x5f0a('0x1f')][_0x5f0a('0x23')]||null:null})[_0x5f0a('0xe')](function(_0xdfd1cd){logger[_0x5f0a('0xf')](_0x5f0a('0x24'),_0x244005);logger[_0x5f0a('0x1c')](_0x5f0a('0x24'),_0x244005,JSON[_0x5f0a('0x1d')](_0xdfd1cd));_0x442939(_0xdfd1cd);})[_0x5f0a('0x17')](function(_0x584020){logger[_0x5f0a('0x13')](_0x5f0a('0x24'),_0x584020[_0x5f0a('0x15')],_0x244005);_0x23cfc2(_0x2e4133['error'](0x1f4,_0x584020[_0x5f0a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a7986d4..6da016b 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 _0xf873=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x14aeff,_0x1e8ea7){var _0xa04f9f=function(_0xb48b4f){while(--_0xb48b4f){_0x14aeff['push'](_0x14aeff['shift']());}};_0xa04f9f(++_0x1e8ea7);}(_0xf873,0xb2));var _0x3f87=function(_0x2e439c,_0x2c2b08){_0x2e439c=_0x2e439c-0x0;var _0x190893=_0xf873[_0x2e439c];return _0x190893;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./smsTransferReport.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0x9')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller['show']);router[_0x3f87('0xf')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);router[_0x3f87('0x13')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x14')]);module[_0x3f87('0x15')]=router; \ No newline at end of file +var _0xab86=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3aaf5d,_0x2b5189){var _0x522b20=function(_0x5d7c9b){while(--_0x5d7c9b){_0x3aaf5d['push'](_0x3aaf5d['shift']());}};_0x522b20(++_0x2b5189);}(_0xab86,0x13e));var _0x6ab8=function(_0xb92a3e,_0x3e688f){_0xb92a3e=_0xb92a3e-0x0;var _0x313731=_0xab86[_0xb92a3e];return _0x313731;};'use strict';var multer=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var path=require(_0x6ab8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ab8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ab8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ab8('0x5'));var controller=require(_0x6ab8('0x6'));router[_0x6ab8('0x7')]('/',auth[_0x6ab8('0x8')](),controller[_0x6ab8('0x9')]);router[_0x6ab8('0x7')](_0x6ab8('0xa'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xb')]);router[_0x6ab8('0x7')](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6ab8('0xe')]);router['put'](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xf')]);router['delete'](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller['destroy']);module[_0x6ab8('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6d88826..3588c0f 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x173dda,_0x511bac){var _0x524fcb=function(_0x1abeb1){while(--_0x1abeb1){_0x173dda['push'](_0x173dda['shift']());}};_0x524fcb(++_0x511bac);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1bae33,_0xdfa441){_0x1bae33=_0x1bae33-0x0;var _0x1af1c8=_0xf4eb[_0x1bae33];return _0x1af1c8;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x55ab86,_0x1a45a9){var _0x545451=function(_0x4f2409){while(--_0x4f2409){_0x55ab86['push'](_0x55ab86['shift']());}};_0x545451(++_0x1a45a9);}(_0x70e0,0x17b));var _0x070e=function(_0x2c96a7,_0x3984e8){_0x2c96a7=_0x2c96a7-0x0;var _0x5b55a5=_0x70e0[_0x2c96a7];return _0x5b55a5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 251bdee..8904798 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 _0xbfd8=['save','update','then','destroy','error','stack','name','index','map','SmsTransferReport','rawAttributes','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','filter','options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','describe','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x55b318,_0x530d80){var _0x4093b6=function(_0x5bb201){while(--_0x5bb201){_0x55b318['push'](_0x55b318['shift']());}};_0x4093b6(++_0x530d80);}(_0xbfd8,0x147));var _0x8bfd=function(_0x301f16,_0x70a095){_0x301f16=_0x301f16-0x0;var _0x358d25=_0xbfd8[_0x301f16];return _0x358d25;};'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(_0x8bfd('0x0'));var moment=require(_0x8bfd('0x1'));var BPromise=require(_0x8bfd('0x2'));var Mustache=require(_0x8bfd('0x3'));var util=require(_0x8bfd('0x4'));var path=require(_0x8bfd('0x5'));var sox=require(_0x8bfd('0x6'));var csv=require('to-csv');var ejs=require(_0x8bfd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bfd('0x8'));var squel=require(_0x8bfd('0x9'));var crypto=require(_0x8bfd('0xa'));var jsforce=require(_0x8bfd('0xb'));var deskjs=require(_0x8bfd('0xc'));var toCsv=require(_0x8bfd('0xd'));var querystring=require(_0x8bfd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8bfd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8bfd('0x10'));var hardwareService=require(_0x8bfd('0x11'));var logger=require(_0x8bfd('0x12'))(_0x8bfd('0x13'));var utils=require(_0x8bfd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8bfd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x640c58,_0x128a85){_0x128a85=_0x128a85||0xcc;return function(_0x593ffc){if(_0x593ffc){return _0x640c58[_0x8bfd('0x16')](_0x128a85);}return _0x640c58[_0x8bfd('0x17')](_0x128a85)['end']();};}function respondWithResult(_0x51c53b,_0x4f34ba){_0x4f34ba=_0x4f34ba||0xc8;return function(_0x54fd05){if(_0x54fd05){return _0x51c53b[_0x8bfd('0x17')](_0x4f34ba)['json'](_0x54fd05);}};}function respondWithFilteredResult(_0x189024,_0x869025){return function(_0x4185b8){if(_0x4185b8){var _0xce8c36=typeof _0x869025[_0x8bfd('0x18')]===_0x8bfd('0x19')&&typeof _0x869025[_0x8bfd('0x1a')]===_0x8bfd('0x19');var _0x201237=_0x4185b8['count'];var _0x14c2b4=_0xce8c36?0x0:_0x869025[_0x8bfd('0x18')];var _0x522c47=_0xce8c36?_0x4185b8[_0x8bfd('0x1b')]:_0x869025[_0x8bfd('0x18')]+_0x869025[_0x8bfd('0x1a')];var _0x4c19cd;if(_0x522c47>=_0x201237){_0x522c47=_0x201237;_0x4c19cd=0xc8;}else{_0x4c19cd=0xce;}_0x189024[_0x8bfd('0x17')](_0x4c19cd);return _0x189024[_0x8bfd('0x1c')](_0x8bfd('0x1d'),_0x14c2b4+'-'+_0x522c47+'/'+_0x201237)[_0x8bfd('0x1e')](_0x4185b8);}return null;};}function patchUpdates(_0x56c2ac){return function(_0x365954){try{jsonpatch[_0x8bfd('0x1f')](_0x365954,_0x56c2ac,!![]);}catch(_0x22dceb){return BPromise[_0x8bfd('0x20')](_0x22dceb);}return _0x365954[_0x8bfd('0x21')]();};}function saveUpdates(_0x18eb46,_0x56de7a){return function(_0x557d3b){if(_0x557d3b){return _0x557d3b[_0x8bfd('0x22')](_0x18eb46)[_0x8bfd('0x23')](function(_0x17389c){return _0x17389c;});}return null;};}function removeEntity(_0x11a8ad,_0x40120d){return function(_0x2f7221){if(_0x2f7221){return _0x2f7221[_0x8bfd('0x24')]()[_0x8bfd('0x23')](function(){_0x11a8ad[_0x8bfd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e8fd,_0x2b18be){return function(_0x299194){if(!_0x299194){_0x24e8fd[_0x8bfd('0x16')](0x194);}return _0x299194;};}function handleError(_0x313aab,_0x4c96ee){_0x4c96ee=_0x4c96ee||0x1f4;return function(_0x2afe63){logger[_0x8bfd('0x25')](_0x2afe63[_0x8bfd('0x26')]);if(_0x2afe63[_0x8bfd('0x27')]){delete _0x2afe63[_0x8bfd('0x27')];}_0x313aab['status'](_0x4c96ee)['send'](_0x2afe63);};}exports[_0x8bfd('0x28')]=function(_0x493cd7,_0x3cab0f){var _0x1a93da={},_0x2e6ddd={},_0x55bff8={'count':0x0,'rows':[]};var _0x1173fb=_[_0x8bfd('0x29')](db[_0x8bfd('0x2a')][_0x8bfd('0x2b')],function(_0x2efa08){return{'name':_0x2efa08['fieldName'],'type':_0x2efa08['type'][_0x8bfd('0x2c')]};});_0x2e6ddd['model']=_['map'](_0x1173fb,'name');_0x2e6ddd[_0x8bfd('0x2d')]=_[_0x8bfd('0x2e')](_0x493cd7['query']);_0x2e6ddd[_0x8bfd('0x2f')]=_['intersection'](_0x2e6ddd[_0x8bfd('0x30')],_0x2e6ddd[_0x8bfd('0x2d')]);_0x1a93da[_0x8bfd('0x31')]=_['intersection'](_0x2e6ddd[_0x8bfd('0x30')],qs[_0x8bfd('0x32')](_0x493cd7[_0x8bfd('0x2d')]['fields']));_0x1a93da['attributes']=_0x1a93da[_0x8bfd('0x31')][_0x8bfd('0x33')]?_0x1a93da[_0x8bfd('0x31')]:_0x2e6ddd[_0x8bfd('0x30')];if(!_0x493cd7[_0x8bfd('0x2d')][_0x8bfd('0x34')](_0x8bfd('0x35'))){_0x1a93da['limit']=qs[_0x8bfd('0x1a')](_0x493cd7['query'][_0x8bfd('0x1a')]);_0x1a93da[_0x8bfd('0x18')]=qs[_0x8bfd('0x18')](_0x493cd7[_0x8bfd('0x2d')][_0x8bfd('0x18')]);}_0x1a93da['order']=qs[_0x8bfd('0x36')](_0x493cd7['query'][_0x8bfd('0x36')]);_0x1a93da['where']=qs[_0x8bfd('0x2f')](_[_0x8bfd('0x37')](_0x493cd7[_0x8bfd('0x2d')],_0x2e6ddd[_0x8bfd('0x2f')]),_0x1173fb);if(_0x493cd7[_0x8bfd('0x2d')]['filter']){_0x1a93da['where']=_[_0x8bfd('0x38')](_0x1a93da[_0x8bfd('0x39')],{'$or':_['map'](_0x1173fb,function(_0x1b332f){if(_0x1b332f['type']!=='VIRTUAL'){var _0xdd098a={};_0xdd098a[_0x1b332f['name']]={'$like':'%'+_0x493cd7['query'][_0x8bfd('0x3a')]+'%'};return _0xdd098a;}})});}_0x1a93da=_[_0x8bfd('0x38')]({},_0x1a93da,_0x493cd7[_0x8bfd('0x3b')]);var _0x11c6e5={'where':_0x1a93da[_0x8bfd('0x39')]};return db[_0x8bfd('0x2a')]['count'](_0x11c6e5)['then'](function(_0x4a36f6){_0x55bff8[_0x8bfd('0x1b')]=_0x4a36f6;if(_0x493cd7[_0x8bfd('0x2d')][_0x8bfd('0x3c')]){_0x1a93da[_0x8bfd('0x3d')]=[{'all':!![]}];}return db[_0x8bfd('0x2a')][_0x8bfd('0x3e')](_0x1a93da);})[_0x8bfd('0x23')](function(_0x2034aa){_0x55bff8[_0x8bfd('0x3f')]=_0x2034aa;return _0x55bff8;})[_0x8bfd('0x23')](respondWithFilteredResult(_0x3cab0f,_0x1a93da))['catch'](handleError(_0x3cab0f,null));};exports[_0x8bfd('0x40')]=function(_0x5bf88a,_0x3ef773){var _0x11e7c0={'raw':!![],'where':{'id':_0x5bf88a[_0x8bfd('0x41')]['id']}},_0x6723b4={};_0x6723b4[_0x8bfd('0x30')]=_[_0x8bfd('0x2e')](db[_0x8bfd('0x2a')][_0x8bfd('0x2b')]);_0x6723b4[_0x8bfd('0x2d')]=_[_0x8bfd('0x2e')](_0x5bf88a[_0x8bfd('0x2d')]);_0x6723b4[_0x8bfd('0x2f')]=_[_0x8bfd('0x42')](_0x6723b4['model'],_0x6723b4[_0x8bfd('0x2d')]);_0x11e7c0[_0x8bfd('0x31')]=_[_0x8bfd('0x42')](_0x6723b4[_0x8bfd('0x30')],qs['fields'](_0x5bf88a[_0x8bfd('0x2d')]['fields']));_0x11e7c0[_0x8bfd('0x31')]=_0x11e7c0[_0x8bfd('0x31')][_0x8bfd('0x33')]?_0x11e7c0[_0x8bfd('0x31')]:_0x6723b4[_0x8bfd('0x30')];if(_0x5bf88a['query'][_0x8bfd('0x3c')]){_0x11e7c0['include']=[{'all':!![]}];}_0x11e7c0=_['merge']({},_0x11e7c0,_0x5bf88a['options']);return db['SmsTransferReport'][_0x8bfd('0x43')](_0x11e7c0)['then'](handleEntityNotFound(_0x3ef773,null))[_0x8bfd('0x23')](respondWithResult(_0x3ef773,null))['catch'](handleError(_0x3ef773,null));};exports[_0x8bfd('0x44')]=function(_0x310d16,_0x3d3187){return db[_0x8bfd('0x2a')][_0x8bfd('0x44')](_0x310d16[_0x8bfd('0x45')],{})[_0x8bfd('0x23')](respondWithResult(_0x3d3187,0xc9))[_0x8bfd('0x46')](handleError(_0x3d3187,null));};exports[_0x8bfd('0x22')]=function(_0xaaf092,_0x450df0){if(_0xaaf092['body']['id']){delete _0xaaf092[_0x8bfd('0x45')]['id'];}return db[_0x8bfd('0x2a')][_0x8bfd('0x43')]({'where':{'id':_0xaaf092[_0x8bfd('0x41')]['id']}})[_0x8bfd('0x23')](handleEntityNotFound(_0x450df0,null))[_0x8bfd('0x23')](saveUpdates(_0xaaf092[_0x8bfd('0x45')],null))[_0x8bfd('0x23')](respondWithResult(_0x450df0,null))[_0x8bfd('0x46')](handleError(_0x450df0,null));};exports[_0x8bfd('0x24')]=function(_0x5b3799,_0x54c701){return db[_0x8bfd('0x2a')][_0x8bfd('0x43')]({'where':{'id':_0x5b3799['params']['id']}})[_0x8bfd('0x23')](handleEntityNotFound(_0x54c701,null))[_0x8bfd('0x23')](removeEntity(_0x54c701,null))[_0x8bfd('0x46')](handleError(_0x54c701,null));};exports[_0x8bfd('0x47')]=function(_0x189580,_0x4ccdbb){return db[_0x8bfd('0x2a')][_0x8bfd('0x47')]()[_0x8bfd('0x23')](respondWithResult(_0x4ccdbb,null))['catch'](handleError(_0x4ccdbb,null));}; \ No newline at end of file +var _0x1151=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','save','update','destroy','then','error','stack','name','map','SmsTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x15e464,_0x3605fd){var _0x1e139f=function(_0x4d14c8){while(--_0x4d14c8){_0x15e464['push'](_0x15e464['shift']());}};_0x1e139f(++_0x3605fd);}(_0x1151,0x1c8));var _0x1115=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x1151[_0x1ee0a1];return _0x1d2d5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1115('0x0'));var zipdir=require(_0x1115('0x1'));var jsonpatch=require(_0x1115('0x2'));var rp=require(_0x1115('0x3'));var moment=require('moment');var BPromise=require(_0x1115('0x4'));var Mustache=require('mustache');var util=require(_0x1115('0x5'));var path=require(_0x1115('0x6'));var sox=require(_0x1115('0x7'));var csv=require(_0x1115('0x8'));var ejs=require(_0x1115('0x9'));var fs=require('fs');var fs_extra=require(_0x1115('0xa'));var _=require(_0x1115('0xb'));var squel=require(_0x1115('0xc'));var crypto=require(_0x1115('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1115('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1115('0xf'));var Papa=require('papaparse');var Redis=require(_0x1115('0x10'));var authService=require(_0x1115('0x11'));var qs=require(_0x1115('0x12'));var as=require(_0x1115('0x13'));var hardwareService=require(_0x1115('0x14'));var logger=require(_0x1115('0x15'))(_0x1115('0x16'));var utils=require('../../config/utils');var config=require(_0x1115('0x17'));var licenseUtil=require(_0x1115('0x18'));var db=require(_0x1115('0x19'))['db'];function respondWithStatusCode(_0x1e1c21,_0x9fc1f){_0x9fc1f=_0x9fc1f||0xcc;return function(_0x18a9b0){if(_0x18a9b0){return _0x1e1c21[_0x1115('0x1a')](_0x9fc1f);}return _0x1e1c21[_0x1115('0x1b')](_0x9fc1f)[_0x1115('0x1c')]();};}function respondWithResult(_0x2d0b60,_0x16ac84){_0x16ac84=_0x16ac84||0xc8;return function(_0x494029){if(_0x494029){return _0x2d0b60['status'](_0x16ac84)['json'](_0x494029);}};}function respondWithFilteredResult(_0x3a5905,_0x329edc){return function(_0x3a4300){if(_0x3a4300){var _0x2d25ce=typeof _0x329edc[_0x1115('0x1d')]===_0x1115('0x1e')&&typeof _0x329edc[_0x1115('0x1f')]==='undefined';var _0x2f9fea=_0x3a4300[_0x1115('0x20')];var _0x68552=_0x2d25ce?0x0:_0x329edc['offset'];var _0xcdf66d=_0x2d25ce?_0x3a4300[_0x1115('0x20')]:_0x329edc[_0x1115('0x1d')]+_0x329edc[_0x1115('0x1f')];var _0x9c6b2d;if(_0xcdf66d>=_0x2f9fea){_0xcdf66d=_0x2f9fea;_0x9c6b2d=0xc8;}else{_0x9c6b2d=0xce;}_0x3a5905['status'](_0x9c6b2d);return _0x3a5905['set']('Content-Range',_0x68552+'-'+_0xcdf66d+'/'+_0x2f9fea)['json'](_0x3a4300);}return null;};}function patchUpdates(_0x351847){return function(_0x1284d7){try{jsonpatch[_0x1115('0x21')](_0x1284d7,_0x351847,!![]);}catch(_0x5accab){return BPromise['reject'](_0x5accab);}return _0x1284d7[_0x1115('0x22')]();};}function saveUpdates(_0x1b6368,_0xdd481e){return function(_0x44f98c){if(_0x44f98c){return _0x44f98c[_0x1115('0x23')](_0x1b6368)['then'](function(_0x345c20){return _0x345c20;});}return null;};}function removeEntity(_0x4842ef,_0x2d73c0){return function(_0x22232f){if(_0x22232f){return _0x22232f[_0x1115('0x24')]()[_0x1115('0x25')](function(){_0x4842ef[_0x1115('0x1b')](0xcc)[_0x1115('0x1c')]();});}};}function handleEntityNotFound(_0x1aa0e6,_0x54c72e){return function(_0x111a1b){if(!_0x111a1b){_0x1aa0e6['sendStatus'](0x194);}return _0x111a1b;};}function handleError(_0x5e87c9,_0x164f12){_0x164f12=_0x164f12||0x1f4;return function(_0x1d6466){logger[_0x1115('0x26')](_0x1d6466[_0x1115('0x27')]);if(_0x1d6466[_0x1115('0x28')]){delete _0x1d6466['name'];}_0x5e87c9[_0x1115('0x1b')](_0x164f12)['send'](_0x1d6466);};}exports['index']=function(_0x40e9b4,_0x32da63){var _0xc98e74={},_0x28f6dd={},_0x3581f1={'count':0x0,'rows':[]};var _0x18ae1f=_[_0x1115('0x29')](db[_0x1115('0x2a')][_0x1115('0x2b')],function(_0x27e013){return{'name':_0x27e013['fieldName'],'type':_0x27e013[_0x1115('0x2c')]['key']};});_0x28f6dd[_0x1115('0x2d')]=_['map'](_0x18ae1f,'name');_0x28f6dd[_0x1115('0x2e')]=_[_0x1115('0x2f')](_0x40e9b4[_0x1115('0x2e')]);_0x28f6dd['filters']=_[_0x1115('0x30')](_0x28f6dd['model'],_0x28f6dd['query']);_0xc98e74[_0x1115('0x31')]=_[_0x1115('0x30')](_0x28f6dd['model'],qs[_0x1115('0x32')](_0x40e9b4[_0x1115('0x2e')][_0x1115('0x32')]));_0xc98e74[_0x1115('0x31')]=_0xc98e74[_0x1115('0x31')][_0x1115('0x33')]?_0xc98e74[_0x1115('0x31')]:_0x28f6dd[_0x1115('0x2d')];if(!_0x40e9b4[_0x1115('0x2e')][_0x1115('0x34')](_0x1115('0x35'))){_0xc98e74['limit']=qs[_0x1115('0x1f')](_0x40e9b4[_0x1115('0x2e')]['limit']);_0xc98e74[_0x1115('0x1d')]=qs['offset'](_0x40e9b4['query'][_0x1115('0x1d')]);}_0xc98e74[_0x1115('0x36')]=qs[_0x1115('0x37')](_0x40e9b4[_0x1115('0x2e')][_0x1115('0x37')]);_0xc98e74[_0x1115('0x38')]=qs[_0x1115('0x39')](_[_0x1115('0x3a')](_0x40e9b4[_0x1115('0x2e')],_0x28f6dd[_0x1115('0x39')]),_0x18ae1f);if(_0x40e9b4['query'][_0x1115('0x3b')]){_0xc98e74[_0x1115('0x38')]=_[_0x1115('0x3c')](_0xc98e74[_0x1115('0x38')],{'$or':_['map'](_0x18ae1f,function(_0x3fdd34){if(_0x3fdd34['type']!==_0x1115('0x3d')){var _0x576c20={};_0x576c20[_0x3fdd34['name']]={'$like':'%'+_0x40e9b4[_0x1115('0x2e')][_0x1115('0x3b')]+'%'};return _0x576c20;}})});}_0xc98e74=_[_0x1115('0x3c')]({},_0xc98e74,_0x40e9b4[_0x1115('0x3e')]);var _0x4c0b56={'where':_0xc98e74[_0x1115('0x38')]};return db[_0x1115('0x2a')][_0x1115('0x20')](_0x4c0b56)['then'](function(_0x3a6e46){_0x3581f1[_0x1115('0x20')]=_0x3a6e46;if(_0x40e9b4[_0x1115('0x2e')][_0x1115('0x3f')]){_0xc98e74[_0x1115('0x40')]=[{'all':!![]}];}return db[_0x1115('0x2a')][_0x1115('0x41')](_0xc98e74);})['then'](function(_0x2cd2d8){_0x3581f1[_0x1115('0x42')]=_0x2cd2d8;return _0x3581f1;})['then'](respondWithFilteredResult(_0x32da63,_0xc98e74))[_0x1115('0x43')](handleError(_0x32da63,null));};exports[_0x1115('0x44')]=function(_0x3fa985,_0xefa1c9){var _0x1bebc6={'raw':!![],'where':{'id':_0x3fa985[_0x1115('0x45')]['id']}},_0x14b9d0={};_0x14b9d0[_0x1115('0x2d')]=_[_0x1115('0x2f')](db[_0x1115('0x2a')]['rawAttributes']);_0x14b9d0['query']=_[_0x1115('0x2f')](_0x3fa985[_0x1115('0x2e')]);_0x14b9d0['filters']=_['intersection'](_0x14b9d0[_0x1115('0x2d')],_0x14b9d0[_0x1115('0x2e')]);_0x1bebc6['attributes']=_[_0x1115('0x30')](_0x14b9d0[_0x1115('0x2d')],qs[_0x1115('0x32')](_0x3fa985['query'][_0x1115('0x32')]));_0x1bebc6['attributes']=_0x1bebc6[_0x1115('0x31')][_0x1115('0x33')]?_0x1bebc6[_0x1115('0x31')]:_0x14b9d0[_0x1115('0x2d')];if(_0x3fa985[_0x1115('0x2e')][_0x1115('0x3f')]){_0x1bebc6[_0x1115('0x40')]=[{'all':!![]}];}_0x1bebc6=_['merge']({},_0x1bebc6,_0x3fa985[_0x1115('0x3e')]);return db['SmsTransferReport'][_0x1115('0x46')](_0x1bebc6)[_0x1115('0x25')](handleEntityNotFound(_0xefa1c9,null))[_0x1115('0x25')](respondWithResult(_0xefa1c9,null))[_0x1115('0x43')](handleError(_0xefa1c9,null));};exports[_0x1115('0x47')]=function(_0x23b466,_0x5a47fa){return db[_0x1115('0x2a')]['create'](_0x23b466['body'],{})[_0x1115('0x25')](respondWithResult(_0x5a47fa,0xc9))[_0x1115('0x43')](handleError(_0x5a47fa,null));};exports[_0x1115('0x23')]=function(_0x49107e,_0x17e9c1){if(_0x49107e[_0x1115('0x48')]['id']){delete _0x49107e[_0x1115('0x48')]['id'];}return db[_0x1115('0x2a')][_0x1115('0x46')]({'where':{'id':_0x49107e[_0x1115('0x45')]['id']}})[_0x1115('0x25')](handleEntityNotFound(_0x17e9c1,null))[_0x1115('0x25')](saveUpdates(_0x49107e['body'],null))['then'](respondWithResult(_0x17e9c1,null))['catch'](handleError(_0x17e9c1,null));};exports[_0x1115('0x24')]=function(_0x3709f9,_0x546489){return db[_0x1115('0x2a')]['find']({'where':{'id':_0x3709f9['params']['id']}})[_0x1115('0x25')](handleEntityNotFound(_0x546489,null))[_0x1115('0x25')](removeEntity(_0x546489,null))['catch'](handleError(_0x546489,null));};exports[_0x1115('0x49')]=function(_0x23ffe4,_0x58222e){return db[_0x1115('0x2a')][_0x1115('0x49')]()[_0x1115('0x25')](respondWithResult(_0x58222e,null))[_0x1115('0x43')](handleError(_0x58222e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0c72d41..7791a41 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 _0x850a=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4a73f2,_0xa4870d){var _0x7189be=function(_0x194b9d){while(--_0x194b9d){_0x4a73f2['push'](_0x4a73f2['shift']());}};_0x7189be(++_0xa4870d);}(_0x850a,0x123));var _0xa850=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x850a[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0xa850('0x0'));var util=require(_0xa850('0x1'));var logger=require(_0xa850('0x2'))(_0xa850('0x3'));var moment=require(_0xa850('0x4'));var BPromise=require('bluebird');var rp=require(_0xa850('0x5'));var fs=require('fs');var path=require(_0xa850('0x6'));var rimraf=require(_0xa850('0x7'));var config=require(_0xa850('0x8'));var attributes=require(_0xa850('0x9'));module[_0xa850('0xa')]=function(_0x5501ab,_0x48a0a8){return _0x5501ab[_0xa850('0xb')](_0xa850('0xc'),attributes,{'tableName':_0xa850('0xd'),'paranoid':![],'indexes':[{'name':_0xa850('0xe'),'fields':[_0xa850('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd28c=['moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util','../../config/logger','api'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xd28c,0x72));var _0xcd28=function(_0x49333e,_0x11b1a9){_0x49333e=_0x49333e-0x0;var _0x4b78ef=_0xd28c[_0x49333e];return _0x4b78ef;};'use strict';var _=require('lodash');var util=require(_0xcd28('0x0'));var logger=require(_0xcd28('0x1'))(_0xcd28('0x2'));var moment=require(_0xcd28('0x3'));var BPromise=require(_0xcd28('0x4'));var rp=require(_0xcd28('0x5'));var fs=require('fs');var path=require(_0xcd28('0x6'));var rimraf=require(_0xcd28('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd28('0x8'));module[_0xcd28('0x9')]=function(_0x4ddfda,_0x71e64a){return _0x4ddfda[_0xcd28('0xa')]('SmsTransferReport',attributes,{'tableName':_0xcd28('0xb'),'paranoid':![],'indexes':[{'name':_0xcd28('0xc'),'fields':[_0xcd28('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b263ca6..31dd7bd 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 _0xa566=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','info'];(function(_0x676eeb,_0xd633e7){var _0x100672=function(_0x2b5cc3){while(--_0x2b5cc3){_0x676eeb['push'](_0x676eeb['shift']());}};_0x100672(++_0xd633e7);}(_0xa566,0x1c1));var _0x6a56=function(_0x3af49f,_0xbb77f5){_0x3af49f=_0x3af49f-0x0;var _0x4297b1=_0xa566[_0x3af49f];return _0x4297b1;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var moment=require(_0x6a56('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a56('0x3'));var fs=require('fs');var Redis=require(_0x6a56('0x4'));var db=require(_0x6a56('0x5'))['db'];var utils=require(_0x6a56('0x6'));var logger=require('../../config/logger')(_0x6a56('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3712ee,_0x50ae34,_0x472c60){return new BPromise(function(_0x4947a9,_0x33240c){return client[_0x6a56('0x8')](_0x3712ee,_0x472c60)['then'](function(_0x2f49ab){logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));logger['debug'](_0x6a56('0xc'),_0x50ae34,_0x6a56('0xb'),JSON['stringify'](_0x2f49ab));if(_0x2f49ab['error']){if(_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xe')]===0x1f4){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x33240c(_0x2f49ab[_0x6a56('0xd')]['message']);}logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x4947a9(_0x2f49ab[_0x6a56('0xd')]['message']);}else{logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));_0x4947a9(_0x2f49ab[_0x6a56('0x10')][_0x6a56('0xf')]);}})['catch'](function(_0x5e9895){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x5e9895);_0x33240c(_0x5e9895);});});} \ No newline at end of file +var _0x3248=['SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x3248,0x1bc));var _0x8324=function(_0x47816a,_0x22c911){_0x47816a=_0x47816a-0x0;var _0x53a44f=_0x3248[_0x47816a];return _0x53a44f;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8324('0x1'));var fs=require('fs');var Redis=require(_0x8324('0x2'));var db=require(_0x8324('0x3'))['db'];var utils=require(_0x8324('0x4'));var logger=require(_0x8324('0x5'))(_0x8324('0x6'));var config=require('../../config/environment');var jayson=require(_0x8324('0x7'));var client=jayson[_0x8324('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ee7a,_0x459a62,_0x4302c5){return new BPromise(function(_0x1514c0,_0x5a482d){return client[_0x8324('0x9')](_0x25ee7a,_0x4302c5)[_0x8324('0xa')](function(_0x3f00e6){logger[_0x8324('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'));logger[_0x8324('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'),JSON[_0x8324('0xe')](_0x3f00e6));if(_0x3f00e6['error']){if(_0x3f00e6['error']['code']===0x1f4){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x5a482d(_0x3f00e6['error'][_0x8324('0x11')]);}logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x1514c0(_0x3f00e6['error'][_0x8324('0x11')]);}else{logger[_0x8324('0xb')](_0x8324('0x10'),_0x459a62,_0x8324('0xc'));_0x1514c0(_0x3f00e6[_0x8324('0x12')]['message']);}})[_0x8324('0x13')](function(_0xaf20a5){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0xaf20a5);_0x5a482d(_0xaf20a5);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d8b3480..adf7911 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 _0xf1de=['download','diskStorage','join','root','originalname','replace','%s-%s%s','extname','single','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download'];(function(_0x2c60d8,_0x2d01a1){var _0xf24735=function(_0x432108){while(--_0x432108){_0x2c60d8['push'](_0x2c60d8['shift']());}};_0xf24735(++_0x2d01a1);}(_0xf1de,0x1d9));var _0xef1d=function(_0x274fdc,_0x3bb4b7){_0x274fdc=_0x274fdc-0x0;var _0x5552da=_0xf1de[_0x274fdc];return _0x5552da;};'use strict';var multer=require(_0xef1d('0x0'));var util=require(_0xef1d('0x1'));var path=require(_0xef1d('0x2'));var timeout=require('connect-timeout');var express=require(_0xef1d('0x3'));var router=express['Router']();var fs_extra=require(_0xef1d('0x4'));var auth=require(_0xef1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef1d('0x6'));var controller=require(_0xef1d('0x7'));router[_0xef1d('0x8')]('/',auth[_0xef1d('0x9')](),controller[_0xef1d('0xa')]);router[_0xef1d('0x8')](_0xef1d('0xb'),auth[_0xef1d('0x9')](),controller['show']);router['get'](_0xef1d('0xc'),auth[_0xef1d('0x9')](),controller[_0xef1d('0xd')]);var upload=multer({'storage':multer[_0xef1d('0xe')]({'destination':function(_0x20a372,_0xbd0e4b,_0x56f648){_0x56f648(null,path[_0xef1d('0xf')](config[_0xef1d('0x10')],'server/files/sounds/original/'));},'filename':function(_0x1e151b,_0x548f90,_0x22d09){_0x548f90['originalname']=_0x548f90[_0xef1d('0x11')][_0xef1d('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x22d09(null,util['format'](_0xef1d('0x13'),path['basename'](_0x548f90['originalname'],path['extname'](_0x548f90['originalname'])),Date['now'](),path[_0xef1d('0x14')](_0x548f90[_0xef1d('0x11')])));}})});router['post']('/',upload[_0xef1d('0x15')]('file'),controller[_0xef1d('0x16')]);router[_0xef1d('0x17')]('/:id',auth[_0xef1d('0x9')](),controller[_0xef1d('0x18')]);router[_0xef1d('0x19')](_0xef1d('0xb'),auth[_0xef1d('0x9')](),controller[_0xef1d('0x19')]);module[_0xef1d('0x1a')]=router; \ No newline at end of file +var _0xeea5=['create','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','download','diskStorage','join','root','server/files/sounds/original/','%s-%s%s','basename','originalname','now','extname','post','file'];(function(_0x5bbb0d,_0x261a3e){var _0x3c841f=function(_0x2d9fc9){while(--_0x2d9fc9){_0x5bbb0d['push'](_0x5bbb0d['shift']());}};_0x3c841f(++_0x261a3e);}(_0xeea5,0x6f));var _0x5eea=function(_0x5be08c,_0x3af9a5){_0x5be08c=_0x5be08c-0x0;var _0x4a7467=_0xeea5[_0x5be08c];return _0x4a7467;};'use strict';var multer=require(_0x5eea('0x0'));var util=require(_0x5eea('0x1'));var path=require(_0x5eea('0x2'));var timeout=require(_0x5eea('0x3'));var express=require(_0x5eea('0x4'));var router=express[_0x5eea('0x5')]();var fs_extra=require(_0x5eea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5eea('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x5eea('0x8')]('/',auth[_0x5eea('0x9')](),controller[_0x5eea('0xa')]);router[_0x5eea('0x8')]('/:id',auth[_0x5eea('0x9')](),controller[_0x5eea('0xb')]);router[_0x5eea('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5eea('0xc')]);var upload=multer({'storage':multer[_0x5eea('0xd')]({'destination':function(_0x3c7351,_0x47f3d8,_0x2b329c){_0x2b329c(null,path[_0x5eea('0xe')](config[_0x5eea('0xf')],_0x5eea('0x10')));},'filename':function(_0x2a396c,_0x3f993a,_0x515a36){_0x3f993a['originalname']=_0x3f993a['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x515a36(null,util['format'](_0x5eea('0x11'),path[_0x5eea('0x12')](_0x3f993a[_0x5eea('0x13')],path['extname'](_0x3f993a[_0x5eea('0x13')])),Date[_0x5eea('0x14')](),path[_0x5eea('0x15')](_0x3f993a[_0x5eea('0x13')])));}})});router[_0x5eea('0x16')]('/',upload['single'](_0x5eea('0x17')),controller[_0x5eea('0x18')]);router['put']('/:id',auth[_0x5eea('0x9')](),controller['update']);router['delete'](_0x5eea('0x19'),auth[_0x5eea('0x9')](),controller['delete']);module[_0x5eea('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 436609b..ae34805 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 _0x35fa=['INTEGER','FLOAT','BIGINT','sequelize','exports','STRING','name'];(function(_0x3c2efd,_0x405f28){var _0x433b01=function(_0xd9f231){while(--_0xd9f231){_0x3c2efd['push'](_0x3c2efd['shift']());}};_0x433b01(++_0x405f28);}(_0x35fa,0xb2));var _0xa35f=function(_0x396b02,_0x20798d){_0x396b02=_0x396b02-0x0;var _0x2c227c=_0x35fa[_0x396b02];return _0x2c227c;};'use strict';var Sequelize=require(_0xa35f('0x0'));module[_0xa35f('0x1')]={'name':{'type':Sequelize[_0xa35f('0x2')],'unique':_0xa35f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa35f('0x2')]},'display_name':{'type':Sequelize[_0xa35f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xa35f('0x2')]},'original_format':{'type':Sequelize[_0xa35f('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa35f('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xa35f('0x4')]},'converted_format':{'type':Sequelize[_0xa35f('0x2')]},'converted_duration':{'type':Sequelize[_0xa35f('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa35f('0x6')]},'converted_sampleRate':{'type':Sequelize[_0xa35f('0x4')]}}; \ No newline at end of file +var _0xabfe=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x4aaed2,_0x2ee12a){var _0x2f247a=function(_0x4273a9){while(--_0x4273a9){_0x4aaed2['push'](_0x4aaed2['shift']());}};_0x2f247a(++_0x2ee12a);}(_0xabfe,0x1ad));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xeabf('0x0'));module[_0xeabf('0x1')]={'name':{'type':Sequelize[_0xeabf('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xeabf('0x2')]},'display_name':{'type':Sequelize[_0xeabf('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xeabf('0x2')]},'original_format':{'type':Sequelize[_0xeabf('0x2')]},'original_duration':{'type':Sequelize[_0xeabf('0x3')]},'original_sampleCount':{'type':Sequelize[_0xeabf('0x4')]},'original_channelCount':{'type':Sequelize[_0xeabf('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xeabf('0x5')]},'converted_format':{'type':Sequelize[_0xeabf('0x2')]},'converted_duration':{'type':Sequelize[_0xeabf('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xeabf('0x4')]},'converted_channelCount':{'type':Sequelize[_0xeabf('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'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 c297bca..aa5095e 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 _0x668f=['length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','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','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_sampleRate','role','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','original_format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','model','keys','query','filters','fields','attributes'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x668f,0x131));var _0xf668=function(_0x2c8b47,_0x4a3777){_0x2c8b47=_0x2c8b47-0x0;var _0x503983=_0x668f[_0x2c8b47];return _0x503983;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf668('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf668('0x1'));var rp=require(_0xf668('0x2'));var moment=require(_0xf668('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf668('0x4'));var util=require('util');var path=require(_0xf668('0x5'));var sox=require(_0xf668('0x6'));var csv=require(_0xf668('0x7'));var ejs=require(_0xf668('0x8'));var fs=require('fs');var fs_extra=require(_0xf668('0x9'));var _=require('lodash');var squel=require(_0xf668('0xa'));var crypto=require(_0xf668('0xb'));var jsforce=require(_0xf668('0xc'));var deskjs=require(_0xf668('0xd'));var toCsv=require(_0xf668('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf668('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf668('0xf'));var as=require(_0xf668('0x10'));var hardwareService=require(_0xf668('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf668('0x12'));var licenseUtil=require(_0xf668('0x13'));var db=require(_0xf668('0x14'))['db'];function respondWithStatusCode(_0x281f92,_0x5dc5fe){_0x5dc5fe=_0x5dc5fe||0xcc;return function(_0x34aa8d){if(_0x34aa8d){return _0x281f92[_0xf668('0x15')](_0x5dc5fe);}return _0x281f92[_0xf668('0x16')](_0x5dc5fe)[_0xf668('0x17')]();};}function respondWithResult(_0x3da670,_0x3c098c){_0x3c098c=_0x3c098c||0xc8;return function(_0x4fcae8){if(_0x4fcae8){return _0x3da670[_0xf668('0x16')](_0x3c098c)[_0xf668('0x18')](_0x4fcae8);}};}function respondWithFilteredResult(_0x370a69,_0x20f1f6){return function(_0x39458f){if(_0x39458f){var _0xe8cbe2=typeof _0x20f1f6['offset']==='undefined'&&typeof _0x20f1f6[_0xf668('0x19')]==='undefined';var _0x114867=_0x39458f[_0xf668('0x1a')];var _0x46b8a2=_0xe8cbe2?0x0:_0x20f1f6[_0xf668('0x1b')];var _0x4e5309=_0xe8cbe2?_0x39458f['count']:_0x20f1f6[_0xf668('0x1b')]+_0x20f1f6['limit'];var _0x374474;if(_0x4e5309>=_0x114867){_0x4e5309=_0x114867;_0x374474=0xc8;}else{_0x374474=0xce;}_0x370a69[_0xf668('0x16')](_0x374474);return _0x370a69[_0xf668('0x1c')](_0xf668('0x1d'),_0x46b8a2+'-'+_0x4e5309+'/'+_0x114867)[_0xf668('0x18')](_0x39458f);}return null;};}function patchUpdates(_0x2c2deb){return function(_0x12d882){try{jsonpatch['apply'](_0x12d882,_0x2c2deb,!![]);}catch(_0x1dff32){return BPromise['reject'](_0x1dff32);}return _0x12d882[_0xf668('0x1e')]();};}function saveUpdates(_0x56c9ab,_0x27d17c){return function(_0xb58dfb){if(_0xb58dfb){return _0xb58dfb[_0xf668('0x1f')](_0x56c9ab)[_0xf668('0x20')](function(_0x5ca734){return _0x5ca734;});}return null;};}function removeEntity(_0x43d0d9,_0xe63902){return function(_0x34bfc3){if(_0x34bfc3){return _0x34bfc3[_0xf668('0x21')]()[_0xf668('0x20')](function(){var _0x4a8901=_0x34bfc3[_0xf668('0x22')]({'plain':!![]});var _0x538300=_0xf668('0x23');return db[_0xf668('0x24')][_0xf668('0x21')]({'where':{'type':_0x538300,'resourceId':_0x4a8901['id']}})['then'](function(){return _0x34bfc3;});})[_0xf668('0x20')](function(){_0x43d0d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589733,_0x5a96a9){return function(_0x32d94d){if(!_0x32d94d){_0x589733[_0xf668('0x15')](0x194);}return _0x32d94d;};}function handleError(_0x539295,_0x596719){_0x596719=_0x596719||0x1f4;return function(_0xd55346){logger[_0xf668('0x25')](_0xd55346[_0xf668('0x26')]);if(_0xd55346[_0xf668('0x27')]){delete _0xd55346[_0xf668('0x27')];}_0x539295[_0xf668('0x16')](_0x596719)[_0xf668('0x28')](_0xd55346);};}exports['index']=function(_0x3598b8,_0x57e8bb){var _0x2c6b0e={},_0x11742d={},_0x246e3b={'count':0x0,'rows':[]};var _0x133f5b=_[_0xf668('0x29')](db[_0xf668('0x2a')][_0xf668('0x2b')],function(_0x28f6e6){return{'name':_0x28f6e6[_0xf668('0x2c')],'type':_0x28f6e6[_0xf668('0x2d')]['key']};});_0x11742d[_0xf668('0x2e')]=_[_0xf668('0x29')](_0x133f5b,_0xf668('0x27'));_0x11742d['query']=_[_0xf668('0x2f')](_0x3598b8[_0xf668('0x30')]);_0x11742d[_0xf668('0x31')]=_['intersection'](_0x11742d[_0xf668('0x2e')],_0x11742d['query']);_0x2c6b0e['attributes']=_['intersection'](_0x11742d[_0xf668('0x2e')],qs['fields'](_0x3598b8['query'][_0xf668('0x32')]));_0x2c6b0e[_0xf668('0x33')]=_0x2c6b0e[_0xf668('0x33')][_0xf668('0x34')]?_0x2c6b0e['attributes']:_0x11742d[_0xf668('0x2e')];if(!_0x3598b8[_0xf668('0x30')]['hasOwnProperty']('nolimit')){_0x2c6b0e[_0xf668('0x19')]=qs[_0xf668('0x19')](_0x3598b8['query'][_0xf668('0x19')]);_0x2c6b0e[_0xf668('0x1b')]=qs[_0xf668('0x1b')](_0x3598b8['query'][_0xf668('0x1b')]);}_0x2c6b0e[_0xf668('0x35')]=qs[_0xf668('0x36')](_0x3598b8[_0xf668('0x30')][_0xf668('0x36')]);_0x2c6b0e[_0xf668('0x37')]=qs['filters'](_[_0xf668('0x38')](_0x3598b8[_0xf668('0x30')],_0x11742d[_0xf668('0x31')]),_0x133f5b);if(_0x3598b8['query'][_0xf668('0x39')]){_0x2c6b0e['where']=_[_0xf668('0x3a')](_0x2c6b0e[_0xf668('0x37')],{'$or':_[_0xf668('0x29')](_0x133f5b,function(_0xfa43e0){if(_0xfa43e0[_0xf668('0x2d')]!==_0xf668('0x3b')){var _0x271cf4={};_0x271cf4[_0xfa43e0[_0xf668('0x27')]]={'$like':'%'+_0x3598b8[_0xf668('0x30')]['filter']+'%'};return _0x271cf4;}})});}_0x2c6b0e=_['merge']({},_0x2c6b0e,_0x3598b8[_0xf668('0x3c')]);var _0x5102e0={'where':_0x2c6b0e[_0xf668('0x37')]};return db[_0xf668('0x2a')]['count'](_0x5102e0)[_0xf668('0x20')](function(_0x5ac521){_0x246e3b['count']=_0x5ac521;if(_0x3598b8[_0xf668('0x30')][_0xf668('0x3d')]){_0x2c6b0e[_0xf668('0x3e')]=[{'all':!![]}];}return db['Sound'][_0xf668('0x3f')](_0x2c6b0e);})['then'](function(_0x1e7f06){_0x246e3b[_0xf668('0x40')]=_0x1e7f06;return _0x246e3b;})['then'](respondWithFilteredResult(_0x57e8bb,_0x2c6b0e))['catch'](handleError(_0x57e8bb,null));};exports[_0xf668('0x41')]=function(_0x312dff,_0x3e1704){var _0x3cd01d={'raw':!![],'where':{'id':_0x312dff[_0xf668('0x42')]['id']}},_0x507936={};_0x507936[_0xf668('0x2e')]=_[_0xf668('0x2f')](db['Sound'][_0xf668('0x2b')]);_0x507936[_0xf668('0x30')]=_[_0xf668('0x2f')](_0x312dff['query']);_0x507936[_0xf668('0x31')]=_[_0xf668('0x43')](_0x507936['model'],_0x507936[_0xf668('0x30')]);_0x3cd01d['attributes']=_[_0xf668('0x43')](_0x507936[_0xf668('0x2e')],qs[_0xf668('0x32')](_0x312dff['query'][_0xf668('0x32')]));_0x3cd01d[_0xf668('0x33')]=_0x3cd01d[_0xf668('0x33')][_0xf668('0x34')]?_0x3cd01d[_0xf668('0x33')]:_0x507936[_0xf668('0x2e')];if(_0x312dff[_0xf668('0x30')][_0xf668('0x3d')]){_0x3cd01d[_0xf668('0x3e')]=[{'all':!![]}];}_0x3cd01d=_[_0xf668('0x3a')]({},_0x3cd01d,_0x312dff[_0xf668('0x3c')]);return db[_0xf668('0x2a')][_0xf668('0x44')](_0x3cd01d)[_0xf668('0x20')](handleEntityNotFound(_0x3e1704,null))[_0xf668('0x20')](respondWithResult(_0x3e1704,null))[_0xf668('0x45')](handleError(_0x3e1704,null));};exports[_0xf668('0x46')]=function(_0x20485c,_0x1049fb,_0x73c627){return db[_0xf668('0x2a')][_0xf668('0x44')]({'where':{'id':_0x20485c[_0xf668('0x42')]['id']},'attributes':[_0xf668('0x27'),_0xf668('0x47'),_0xf668('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x1049fb,null))['then'](function(_0x3c1b27){if(_0x3c1b27){if(!fs[_0xf668('0x49')](path[_0xf668('0x4a')](config[_0xf668('0x4b')],_0xf668('0x4c'),_0x3c1b27[_0xf668('0x47')]+'.'+_0x3c1b27['converted_format']))){throw new db[(_0xf668('0x4d'))][(_0xf668('0x4e'))](_0xf668('0x4f'));}return _0x1049fb[_0xf668('0x46')](path[_0xf668('0x4a')](config[_0xf668('0x4b')],_0xf668('0x4c'),util[_0xf668('0x50')](_0xf668('0x51'),_0x3c1b27[_0xf668('0x47')],_0x3c1b27[_0xf668('0x48')])),util[_0xf668('0x50')](_0xf668('0x51'),_0x3c1b27['name'],_0x3c1b27[_0xf668('0x48')]));}return null;})['catch'](handleError(_0x1049fb,null));};exports[_0xf668('0x52')]=function(_0x30c441,_0x5e8dee,_0xd8528f){var _0x22c100={'name':path[_0xf668('0x53')](_0x30c441[_0xf668('0x54')][_0xf668('0x55')],path[_0xf668('0x56')](_0x30c441[_0xf668('0x54')][_0xf668('0x55')])),'save_name':path[_0xf668('0x53')](_0x30c441[_0xf668('0x54')]['filename'],path['extname'](_0x30c441['file'][_0xf668('0x57')])),'original_format':path[_0xf668('0x56')](_0x30c441['file'][_0xf668('0x55')])[_0xf668('0x58')](0x1),'converted_format':'wav'};var _0x37487d=path['join'](config['root'],_0xf668('0x59'),_0x30c441[_0xf668('0x54')][_0xf668('0x57')]);var _0x377c3e=path[_0xf668('0x4a')](config['root'],'server/files/sounds/converted',util[_0xf668('0x50')](_0xf668('0x51'),path[_0xf668('0x53')](_0x30c441[_0xf668('0x54')][_0xf668('0x57')],path[_0xf668('0x56')](_0x30c441[_0xf668('0x54')][_0xf668('0x57')])),_0x22c100['converted_format']));logger[_0xf668('0x5a')](_0xf668('0x5b'),_0x37487d);logger[_0xf668('0x5a')](_0xf668('0x5c'),_0x377c3e);try{fs[_0xf668('0x5d')](_0x37487d,parseInt(_0xf668('0x5e'),0x8));var _0x7763cf=sox[_0xf668('0x5f')](_0x37487d,_0x377c3e,{'sampleRate':0x1f40,'format':_0xf668('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7763cf['on']('error',function(_0x39cdee){fs[_0xf668('0x61')](_0x37487d);_0x5e8dee[_0xf668('0x16')](0x1f4)['send'](_0x39cdee);});_0x7763cf['on'](_0xf668('0x62'),function(_0x5b064a){_0x22c100[_0xf668('0x63')]=isNaN(_0x5b064a[_0xf668('0x64')])?null:_0x5b064a[_0xf668('0x64')]*0x3e8;_0x22c100[_0xf668('0x65')]=isNaN(_0x5b064a[_0xf668('0x66')])?null:_0x5b064a['sampleCount'];_0x22c100[_0xf668('0x67')]=isNaN(_0x5b064a[_0xf668('0x68')])?null:_0x5b064a['channelCount'];_0x22c100[_0xf668('0x69')]=isNaN(_0x5b064a[_0xf668('0x6a')])?null:_0x5b064a[_0xf668('0x6a')];_0x22c100[_0xf668('0x6b')]=isNaN(_0x5b064a[_0xf668('0x6c')])?null:_0x5b064a['sampleRate'];});_0x7763cf['on'](_0xf668('0x6d'),function(_0x347dc3){_0x22c100['converted_duration']=isNaN(_0x347dc3[_0xf668('0x64')])?null:_0x347dc3[_0xf668('0x64')]*0x3e8;_0x22c100[_0xf668('0x6e')]=isNaN(_0x347dc3['sampleCount'])?null:_0x347dc3[_0xf668('0x66')];_0x22c100['converted_channelCount']=isNaN(_0x347dc3[_0xf668('0x68')])?null:_0x347dc3[_0xf668('0x68')];_0x22c100['converted_bitRate']=isNaN(_0x347dc3[_0xf668('0x6a')])?null:_0x347dc3[_0xf668('0x6a')];_0x22c100[_0xf668('0x6f')]=isNaN(_0x347dc3[_0xf668('0x6c')])?null:_0x347dc3[_0xf668('0x6c')];});_0x7763cf['on'](_0xf668('0x17'),function(){fs[_0xf668('0x5d')](_0x377c3e,parseInt(_0xf668('0x5e'),0x8));return db[_0xf668('0x2a')][_0xf668('0x52')](_0x22c100)[_0xf668('0x20')](function(_0x3543c0){var _0x2d0fbb={'role':_0x30c441['body'][_0xf668('0x70')],'userProfileId':_0x30c441['body'][_0xf668('0x71')]};if(!_0x2d0fbb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d0fbb[_0xf668('0x70')]===_0xf668('0x72')){var _0x4e9612=_0x3543c0[_0xf668('0x22')]({'plain':!![]});return db[_0xf668('0x73')][_0xf668('0x44')]({'where':{'name':'Sounds','userProfileId':_0x2d0fbb[_0xf668('0x71')]},'raw':!![]})['then'](function(_0x3aeadc){if(_0x3aeadc&&_0x3aeadc['autoAssociation']===0x0){return db[_0xf668('0x24')][_0xf668('0x52')]({'name':_0x4e9612[_0xf668('0x27')],'resourceId':_0x4e9612['id'],'type':_0x3aeadc[_0xf668('0x27')],'sectionId':_0x3aeadc['id']},{})[_0xf668('0x20')](function(){return _0x3543c0;});}else{return _0x3543c0;}})['catch'](function(_0x333afe){logger[_0xf668('0x25')](_0xf668('0x74'),_0x333afe);throw _0x333afe;});}return _0x3543c0;})[_0xf668('0x20')](respondWithResult(_0x5e8dee,null))['catch'](handleError(_0x5e8dee,null));});_0x7763cf['start']();}catch(_0x39add4){_0x5e8dee[_0xf668('0x16')](0x1f4)[_0xf668('0x28')](_0x39add4);}};exports['update']=function(_0x15268d,_0xf5a661,_0xa9f0d2){return db[_0xf668('0x2a')][_0xf668('0x44')]({'where':{'id':_0x15268d['params']['id']}})['then'](handleEntityNotFound(_0xf5a661,null))[_0xf668('0x20')](saveUpdates(_[_0xf668('0x38')](_0x15268d[_0xf668('0x75')],[_0xf668('0x27'),'description']),null))[_0xf668('0x20')](respondWithResult(_0xf5a661,null))[_0xf668('0x45')](handleError(_0xf5a661,null));};exports['delete']=function(_0x24ec86,_0x324113,_0x18a948){return db[_0xf668('0x2a')][_0xf668('0x44')]({'where':{'id':_0x24ec86[_0xf668('0x42')]['id']}})[_0xf668('0x20')](function(_0x4ba12b){if(_0x4ba12b){return _0x4ba12b[_0xf668('0x21')]();}})[_0xf668('0x20')](function(_0x1bde78){var _0x324324=path[_0xf668('0x4a')](config[_0xf668('0x4b')],_0xf668('0x59'),util[_0xf668('0x50')]('%s.%s',_0x1bde78[_0xf668('0x47')],_0x1bde78[_0xf668('0x76')]));var _0x4ef821=path[_0xf668('0x4a')](config['root'],_0xf668('0x4c'),util['format'](_0xf668('0x51'),_0x1bde78[_0xf668('0x47')],_0x1bde78[_0xf668('0x48')]));fs['unlinkSync'](_0x324324);fs[_0xf668('0x61')](_0x4ef821);return _0x1bde78;})['then'](function(_0x5c0b06){if(_0x5c0b06){return _0x324113[_0xf668('0x16')](0xcc)[_0xf668('0x17')]();}})[_0xf668('0x20')](handleEntityNotFound(_0x324113,null))[_0xf668('0x45')](handleError(_0x324113,null));}; \ No newline at end of file +var _0x3ce0=['params','options','find','catch','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','originalname','file','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_sampleRate','create','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','includeAll','include','show'];(function(_0xd32fba,_0xa2dc58){var _0x343833=function(_0xce4045){while(--_0xce4045){_0xd32fba['push'](_0xd32fba['shift']());}};_0x343833(++_0xa2dc58);}(_0x3ce0,0x124));var _0x03ce=function(_0x39ce11,_0x3240f9){_0x39ce11=_0x39ce11-0x0;var _0x5dfee0=_0x3ce0[_0x39ce11];return _0x5dfee0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03ce('0x0'));var zipdir=require(_0x03ce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ce('0x2'));var moment=require(_0x03ce('0x3'));var BPromise=require(_0x03ce('0x4'));var Mustache=require(_0x03ce('0x5'));var util=require(_0x03ce('0x6'));var path=require('path');var sox=require(_0x03ce('0x7'));var csv=require(_0x03ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03ce('0x9'));var _=require(_0x03ce('0xa'));var squel=require(_0x03ce('0xb'));var crypto=require(_0x03ce('0xc'));var jsforce=require(_0x03ce('0xd'));var deskjs=require(_0x03ce('0xe'));var toCsv=require(_0x03ce('0x8'));var querystring=require(_0x03ce('0xf'));var Papa=require(_0x03ce('0x10'));var Redis=require(_0x03ce('0x11'));var authService=require(_0x03ce('0x12'));var qs=require(_0x03ce('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03ce('0x14'));var logger=require('../../config/logger')(_0x03ce('0x15'));var utils=require(_0x03ce('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x03ce('0x17'));var db=require(_0x03ce('0x18'))['db'];function respondWithStatusCode(_0x2940e2,_0x381756){_0x381756=_0x381756||0xcc;return function(_0x57fbea){if(_0x57fbea){return _0x2940e2[_0x03ce('0x19')](_0x381756);}return _0x2940e2['status'](_0x381756)[_0x03ce('0x1a')]();};}function respondWithResult(_0x38b2b1,_0x5c542c){_0x5c542c=_0x5c542c||0xc8;return function(_0x9df9a){if(_0x9df9a){return _0x38b2b1[_0x03ce('0x1b')](_0x5c542c)[_0x03ce('0x1c')](_0x9df9a);}};}function respondWithFilteredResult(_0x49cce6,_0xd3c6b9){return function(_0x30845a){if(_0x30845a){var _0x327a0f=typeof _0xd3c6b9[_0x03ce('0x1d')]==='undefined'&&typeof _0xd3c6b9[_0x03ce('0x1e')]===_0x03ce('0x1f');var _0x477f8c=_0x30845a[_0x03ce('0x20')];var _0x3f3036=_0x327a0f?0x0:_0xd3c6b9[_0x03ce('0x1d')];var _0x380706=_0x327a0f?_0x30845a[_0x03ce('0x20')]:_0xd3c6b9[_0x03ce('0x1d')]+_0xd3c6b9[_0x03ce('0x1e')];var _0x5e4644;if(_0x380706>=_0x477f8c){_0x380706=_0x477f8c;_0x5e4644=0xc8;}else{_0x5e4644=0xce;}_0x49cce6[_0x03ce('0x1b')](_0x5e4644);return _0x49cce6[_0x03ce('0x21')]('Content-Range',_0x3f3036+'-'+_0x380706+'/'+_0x477f8c)[_0x03ce('0x1c')](_0x30845a);}return null;};}function patchUpdates(_0x375687){return function(_0x358770){try{jsonpatch[_0x03ce('0x22')](_0x358770,_0x375687,!![]);}catch(_0x1bb75a){return BPromise[_0x03ce('0x23')](_0x1bb75a);}return _0x358770[_0x03ce('0x24')]();};}function saveUpdates(_0x345574,_0x46e793){return function(_0x658db8){if(_0x658db8){return _0x658db8[_0x03ce('0x25')](_0x345574)[_0x03ce('0x26')](function(_0x334008){return _0x334008;});}return null;};}function removeEntity(_0x20306a,_0x3148b0){return function(_0x5a6b38){if(_0x5a6b38){return _0x5a6b38[_0x03ce('0x27')]()[_0x03ce('0x26')](function(){var _0x195bb2=_0x5a6b38[_0x03ce('0x28')]({'plain':!![]});var _0x371f30=_0x03ce('0x29');return db[_0x03ce('0x2a')]['destroy']({'where':{'type':_0x371f30,'resourceId':_0x195bb2['id']}})[_0x03ce('0x26')](function(){return _0x5a6b38;});})[_0x03ce('0x26')](function(){_0x20306a[_0x03ce('0x1b')](0xcc)[_0x03ce('0x1a')]();});}};}function handleEntityNotFound(_0x35374c,_0x5a81c6){return function(_0x8acfa2){if(!_0x8acfa2){_0x35374c['sendStatus'](0x194);}return _0x8acfa2;};}function handleError(_0x38867f,_0x1d3ad6){_0x1d3ad6=_0x1d3ad6||0x1f4;return function(_0x4ab55e){logger[_0x03ce('0x2b')](_0x4ab55e[_0x03ce('0x2c')]);if(_0x4ab55e[_0x03ce('0x2d')]){delete _0x4ab55e[_0x03ce('0x2d')];}_0x38867f[_0x03ce('0x1b')](_0x1d3ad6)[_0x03ce('0x2e')](_0x4ab55e);};}exports[_0x03ce('0x2f')]=function(_0x3876a0,_0x59fd85){var _0x2a5032={},_0x274eed={},_0x64c4b0={'count':0x0,'rows':[]};var _0x1f498b=_[_0x03ce('0x30')](db[_0x03ce('0x31')][_0x03ce('0x32')],function(_0x2db4bc){return{'name':_0x2db4bc['fieldName'],'type':_0x2db4bc[_0x03ce('0x33')][_0x03ce('0x34')]};});_0x274eed[_0x03ce('0x35')]=_[_0x03ce('0x30')](_0x1f498b,_0x03ce('0x2d'));_0x274eed[_0x03ce('0x36')]=_['keys'](_0x3876a0[_0x03ce('0x36')]);_0x274eed[_0x03ce('0x37')]=_[_0x03ce('0x38')](_0x274eed[_0x03ce('0x35')],_0x274eed[_0x03ce('0x36')]);_0x2a5032[_0x03ce('0x39')]=_['intersection'](_0x274eed[_0x03ce('0x35')],qs[_0x03ce('0x3a')](_0x3876a0[_0x03ce('0x36')]['fields']));_0x2a5032[_0x03ce('0x39')]=_0x2a5032[_0x03ce('0x39')][_0x03ce('0x3b')]?_0x2a5032[_0x03ce('0x39')]:_0x274eed[_0x03ce('0x35')];if(!_0x3876a0['query']['hasOwnProperty']('nolimit')){_0x2a5032[_0x03ce('0x1e')]=qs['limit'](_0x3876a0['query'][_0x03ce('0x1e')]);_0x2a5032[_0x03ce('0x1d')]=qs[_0x03ce('0x1d')](_0x3876a0[_0x03ce('0x36')][_0x03ce('0x1d')]);}_0x2a5032[_0x03ce('0x3c')]=qs[_0x03ce('0x3d')](_0x3876a0[_0x03ce('0x36')][_0x03ce('0x3d')]);_0x2a5032[_0x03ce('0x3e')]=qs[_0x03ce('0x37')](_[_0x03ce('0x3f')](_0x3876a0[_0x03ce('0x36')],_0x274eed[_0x03ce('0x37')]),_0x1f498b);if(_0x3876a0['query'][_0x03ce('0x40')]){_0x2a5032[_0x03ce('0x3e')]=_['merge'](_0x2a5032[_0x03ce('0x3e')],{'$or':_[_0x03ce('0x30')](_0x1f498b,function(_0x3df5a4){if(_0x3df5a4['type']!=='VIRTUAL'){var _0x5b875d={};_0x5b875d[_0x3df5a4['name']]={'$like':'%'+_0x3876a0[_0x03ce('0x36')]['filter']+'%'};return _0x5b875d;}})});}_0x2a5032=_['merge']({},_0x2a5032,_0x3876a0['options']);var _0x210201={'where':_0x2a5032[_0x03ce('0x3e')]};return db['Sound'][_0x03ce('0x20')](_0x210201)[_0x03ce('0x26')](function(_0x104dba){_0x64c4b0[_0x03ce('0x20')]=_0x104dba;if(_0x3876a0['query'][_0x03ce('0x41')]){_0x2a5032[_0x03ce('0x42')]=[{'all':!![]}];}return db[_0x03ce('0x31')]['findAll'](_0x2a5032);})[_0x03ce('0x26')](function(_0x2782e9){_0x64c4b0['rows']=_0x2782e9;return _0x64c4b0;})[_0x03ce('0x26')](respondWithFilteredResult(_0x59fd85,_0x2a5032))['catch'](handleError(_0x59fd85,null));};exports[_0x03ce('0x43')]=function(_0x3c89c5,_0x5f0a6f){var _0x3a478f={'raw':!![],'where':{'id':_0x3c89c5[_0x03ce('0x44')]['id']}},_0x4ed088={};_0x4ed088['model']=_['keys'](db[_0x03ce('0x31')][_0x03ce('0x32')]);_0x4ed088[_0x03ce('0x36')]=_['keys'](_0x3c89c5[_0x03ce('0x36')]);_0x4ed088[_0x03ce('0x37')]=_[_0x03ce('0x38')](_0x4ed088[_0x03ce('0x35')],_0x4ed088[_0x03ce('0x36')]);_0x3a478f[_0x03ce('0x39')]=_[_0x03ce('0x38')](_0x4ed088['model'],qs['fields'](_0x3c89c5[_0x03ce('0x36')]['fields']));_0x3a478f[_0x03ce('0x39')]=_0x3a478f[_0x03ce('0x39')][_0x03ce('0x3b')]?_0x3a478f[_0x03ce('0x39')]:_0x4ed088['model'];if(_0x3c89c5['query']['includeAll']){_0x3a478f['include']=[{'all':!![]}];}_0x3a478f=_['merge']({},_0x3a478f,_0x3c89c5[_0x03ce('0x45')]);return db[_0x03ce('0x31')][_0x03ce('0x46')](_0x3a478f)['then'](handleEntityNotFound(_0x5f0a6f,null))[_0x03ce('0x26')](respondWithResult(_0x5f0a6f,null))[_0x03ce('0x47')](handleError(_0x5f0a6f,null));};exports[_0x03ce('0x48')]=function(_0x532027,_0x65da24,_0x2c7acc){return db[_0x03ce('0x31')]['find']({'where':{'id':_0x532027[_0x03ce('0x44')]['id']},'attributes':[_0x03ce('0x2d'),_0x03ce('0x49'),_0x03ce('0x4a')],'raw':!![]})[_0x03ce('0x26')](handleEntityNotFound(_0x65da24,null))['then'](function(_0x1ee366){if(_0x1ee366){if(!fs['existsSync'](path[_0x03ce('0x4b')](config[_0x03ce('0x4c')],_0x03ce('0x4d'),_0x1ee366[_0x03ce('0x49')]+'.'+_0x1ee366['converted_format']))){throw new db[(_0x03ce('0x4e'))][(_0x03ce('0x4f'))](_0x03ce('0x50'));}return _0x65da24[_0x03ce('0x48')](path[_0x03ce('0x4b')](config[_0x03ce('0x4c')],_0x03ce('0x4d'),util[_0x03ce('0x51')](_0x03ce('0x52'),_0x1ee366[_0x03ce('0x49')],_0x1ee366[_0x03ce('0x4a')])),util['format'](_0x03ce('0x52'),_0x1ee366[_0x03ce('0x2d')],_0x1ee366[_0x03ce('0x4a')]));}return null;})[_0x03ce('0x47')](handleError(_0x65da24,null));};exports['create']=function(_0x186fe5,_0x97b630,_0x56e09a){var _0x2d545a={'name':path[_0x03ce('0x53')](_0x186fe5['file'][_0x03ce('0x54')],path['extname'](_0x186fe5['file'][_0x03ce('0x54')])),'save_name':path['basename'](_0x186fe5[_0x03ce('0x55')][_0x03ce('0x56')],path[_0x03ce('0x57')](_0x186fe5['file'][_0x03ce('0x56')])),'original_format':path['extname'](_0x186fe5[_0x03ce('0x55')][_0x03ce('0x54')])[_0x03ce('0x58')](0x1),'converted_format':_0x03ce('0x59')};var _0x14f327=path[_0x03ce('0x4b')](config[_0x03ce('0x4c')],_0x03ce('0x5a'),_0x186fe5[_0x03ce('0x55')][_0x03ce('0x56')]);var _0x5945c6=path[_0x03ce('0x4b')](config[_0x03ce('0x4c')],_0x03ce('0x4d'),util[_0x03ce('0x51')](_0x03ce('0x52'),path[_0x03ce('0x53')](_0x186fe5[_0x03ce('0x55')][_0x03ce('0x56')],path[_0x03ce('0x57')](_0x186fe5[_0x03ce('0x55')][_0x03ce('0x56')])),_0x2d545a[_0x03ce('0x4a')]));logger[_0x03ce('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x14f327);logger[_0x03ce('0x5b')](_0x03ce('0x5c'),_0x5945c6);try{fs[_0x03ce('0x5d')](_0x14f327,parseInt(_0x03ce('0x5e'),0x8));var _0x67c6bb=sox[_0x03ce('0x5f')](_0x14f327,_0x5945c6,{'sampleRate':0x1f40,'format':_0x03ce('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x67c6bb['on'](_0x03ce('0x2b'),function(_0x1408c0){fs[_0x03ce('0x60')](_0x14f327);_0x97b630[_0x03ce('0x1b')](0x1f4)['send'](_0x1408c0);});_0x67c6bb['on'](_0x03ce('0x61'),function(_0x1ddd80){_0x2d545a[_0x03ce('0x62')]=isNaN(_0x1ddd80[_0x03ce('0x63')])?null:_0x1ddd80[_0x03ce('0x63')]*0x3e8;_0x2d545a[_0x03ce('0x64')]=isNaN(_0x1ddd80[_0x03ce('0x65')])?null:_0x1ddd80[_0x03ce('0x65')];_0x2d545a['original_channelCount']=isNaN(_0x1ddd80['channelCount'])?null:_0x1ddd80[_0x03ce('0x66')];_0x2d545a[_0x03ce('0x67')]=isNaN(_0x1ddd80['bitRate'])?null:_0x1ddd80[_0x03ce('0x68')];_0x2d545a[_0x03ce('0x69')]=isNaN(_0x1ddd80[_0x03ce('0x6a')])?null:_0x1ddd80[_0x03ce('0x6a')];});_0x67c6bb['on'](_0x03ce('0x6b'),function(_0x184d3d){_0x2d545a[_0x03ce('0x6c')]=isNaN(_0x184d3d[_0x03ce('0x63')])?null:_0x184d3d[_0x03ce('0x63')]*0x3e8;_0x2d545a['converted_sampleCount']=isNaN(_0x184d3d['sampleCount'])?null:_0x184d3d[_0x03ce('0x65')];_0x2d545a[_0x03ce('0x6d')]=isNaN(_0x184d3d['channelCount'])?null:_0x184d3d[_0x03ce('0x66')];_0x2d545a['converted_bitRate']=isNaN(_0x184d3d[_0x03ce('0x68')])?null:_0x184d3d[_0x03ce('0x68')];_0x2d545a[_0x03ce('0x6e')]=isNaN(_0x184d3d[_0x03ce('0x6a')])?null:_0x184d3d['sampleRate'];});_0x67c6bb['on'](_0x03ce('0x1a'),function(){fs['chmodSync'](_0x5945c6,parseInt(_0x03ce('0x5e'),0x8));return db[_0x03ce('0x31')][_0x03ce('0x6f')](_0x2d545a)[_0x03ce('0x26')](function(_0x44e979){var _0x445c2a={'role':_0x186fe5[_0x03ce('0x70')][_0x03ce('0x71')],'userProfileId':_0x186fe5[_0x03ce('0x70')]['userProfileId']};if(!_0x445c2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x445c2a[_0x03ce('0x71')]===_0x03ce('0x72')){var _0x4f23cc=_0x44e979['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x03ce('0x29'),'userProfileId':_0x445c2a[_0x03ce('0x73')]},'raw':!![]})[_0x03ce('0x26')](function(_0x4ed8be){if(_0x4ed8be&&_0x4ed8be['autoAssociation']===0x0){return db['UserProfileResource'][_0x03ce('0x6f')]({'name':_0x4f23cc['name'],'resourceId':_0x4f23cc['id'],'type':_0x4ed8be[_0x03ce('0x2d')],'sectionId':_0x4ed8be['id']},{})[_0x03ce('0x26')](function(){return _0x44e979;});}else{return _0x44e979;}})[_0x03ce('0x47')](function(_0x1c131b){logger[_0x03ce('0x2b')](_0x03ce('0x74'),_0x1c131b);throw _0x1c131b;});}return _0x44e979;})['then'](respondWithResult(_0x97b630,null))[_0x03ce('0x47')](handleError(_0x97b630,null));});_0x67c6bb['start']();}catch(_0x126a6f){_0x97b630[_0x03ce('0x1b')](0x1f4)[_0x03ce('0x2e')](_0x126a6f);}};exports[_0x03ce('0x25')]=function(_0x6cee0c,_0x485737,_0xe5bcc5){return db[_0x03ce('0x31')][_0x03ce('0x46')]({'where':{'id':_0x6cee0c[_0x03ce('0x44')]['id']}})['then'](handleEntityNotFound(_0x485737,null))[_0x03ce('0x26')](saveUpdates(_[_0x03ce('0x3f')](_0x6cee0c[_0x03ce('0x70')],[_0x03ce('0x2d'),_0x03ce('0x75')]),null))[_0x03ce('0x26')](respondWithResult(_0x485737,null))['catch'](handleError(_0x485737,null));};exports[_0x03ce('0x76')]=function(_0x4d9cf1,_0x1fef91,_0x24da9c){return db[_0x03ce('0x31')][_0x03ce('0x46')]({'where':{'id':_0x4d9cf1[_0x03ce('0x44')]['id']}})[_0x03ce('0x26')](function(_0x25dc8d){if(_0x25dc8d){return _0x25dc8d[_0x03ce('0x27')]();}})[_0x03ce('0x26')](function(_0x382420){var _0x36844b=path[_0x03ce('0x4b')](config[_0x03ce('0x4c')],_0x03ce('0x5a'),util[_0x03ce('0x51')](_0x03ce('0x52'),_0x382420[_0x03ce('0x49')],_0x382420[_0x03ce('0x77')]));var _0x5c7c3f=path['join'](config['root'],'server/files/sounds/converted',util[_0x03ce('0x51')](_0x03ce('0x52'),_0x382420[_0x03ce('0x49')],_0x382420['converted_format']));fs[_0x03ce('0x60')](_0x36844b);fs[_0x03ce('0x60')](_0x5c7c3f);return _0x382420;})[_0x03ce('0x26')](function(_0xbd44c2){if(_0xbd44c2){return _0x1fef91['status'](0xcc)[_0x03ce('0x1a')]();}})[_0x03ce('0x26')](handleEntityNotFound(_0x1fef91,null))[_0x03ce('0x47')](handleError(_0x1fef91,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e457414..f6a0cd7 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 _0x93e8=['Sound','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x93e8,0x173));var _0x893e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x93e8[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x893e('0x0'));var util=require(_0x893e('0x1'));var logger=require(_0x893e('0x2'))(_0x893e('0x3'));var moment=require('moment');var BPromise=require(_0x893e('0x4'));var rp=require(_0x893e('0x5'));var fs=require('fs');var path=require(_0x893e('0x6'));var rimraf=require(_0x893e('0x7'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x893e('0x8')]=function(_0x16cdc4,_0x150b30){return _0x16cdc4['define'](_0x893e('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4658=['api','moment','request-promise','rimraf','./sound.attributes','define','lodash','util','../../config/logger'];(function(_0x4cea7d,_0x50f55b){var _0x36e72a=function(_0x342d13){while(--_0x342d13){_0x4cea7d['push'](_0x4cea7d['shift']());}};_0x36e72a(++_0x50f55b);}(_0x4658,0xe7));var _0x8465=function(_0x49d64b,_0x4e9b80){_0x49d64b=_0x49d64b-0x0;var _0x18d7e8=_0x4658[_0x49d64b];return _0x18d7e8;};'use strict';var _=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var logger=require(_0x8465('0x2'))(_0x8465('0x3'));var moment=require(_0x8465('0x4'));var BPromise=require('bluebird');var rp=require(_0x8465('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8465('0x6'));var config=require('../../config/environment');var attributes=require(_0x8465('0x7'));module['exports']=function(_0x4b7701,_0x1645e7){return _0x4b7701[_0x8465('0x8')]('Sound',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 86bf3f5..fb3ab17 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 _0x4ca3=['catch','ShowSound','Sound','options','raw','where','attributes','map','include','model','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1adf54,_0x9214e5){var _0x4b46ca=function(_0x17b86f){while(--_0x17b86f){_0x1adf54['push'](_0x1adf54['shift']());}};_0x4b46ca(++_0x9214e5);}(_0x4ca3,0x1dc));var _0x34ca=function(_0x22e102,_0x501a33){_0x22e102=_0x22e102-0x0;var _0x553f21=_0x4ca3[_0x22e102];return _0x553f21;};'use strict';var _=require(_0x34ca('0x0'));var util=require(_0x34ca('0x1'));var moment=require(_0x34ca('0x2'));var BPromise=require(_0x34ca('0x3'));var rs=require(_0x34ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34ca('0x5'));var logger=require('../../config/logger')(_0x34ca('0x6'));var config=require(_0x34ca('0x7'));var jayson=require(_0x34ca('0x8'));var client=jayson[_0x34ca('0x9')][_0x34ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5b61,_0x4a020d,_0x3d1b90){return new BPromise(function(_0x509650,_0x1c8136){return client[_0x34ca('0xb')](_0x1b5b61,_0x3d1b90)[_0x34ca('0xc')](function(_0x1a487b){logger['info'](_0x34ca('0xd'),_0x4a020d,_0x34ca('0xe'));logger[_0x34ca('0xf')](_0x34ca('0x10'),_0x4a020d,'request\x20sent',JSON['stringify'](_0x1a487b));if(_0x1a487b[_0x34ca('0x11')]){if(_0x1a487b['error'][_0x34ca('0x12')]===0x1f4){logger[_0x34ca('0x11')](_0x34ca('0xd'),_0x4a020d,_0x1a487b['error'][_0x34ca('0x13')]);return _0x1c8136(_0x1a487b[_0x34ca('0x11')][_0x34ca('0x13')]);}logger[_0x34ca('0x11')](_0x34ca('0xd'),_0x4a020d,_0x1a487b['error'][_0x34ca('0x13')]);return _0x509650(_0x1a487b[_0x34ca('0x11')]['message']);}else{logger['info'](_0x34ca('0xd'),_0x4a020d,'request\x20sent');_0x509650(_0x1a487b['result'][_0x34ca('0x13')]);}})[_0x34ca('0x14')](function(_0x2e9773){logger[_0x34ca('0x11')]('Sound,\x20%s,\x20%s',_0x4a020d,_0x2e9773);_0x1c8136(_0x2e9773);});});}exports[_0x34ca('0x15')]=function(_0x422ea5){var _0x3a8835=this;return new Promise(function(_0x51c39f,_0x343655){return db[_0x34ca('0x16')]['find']({'raw':_0x422ea5[_0x34ca('0x17')]?_0x422ea5['options'][_0x34ca('0x18')]===undefined?!![]:![]:!![],'where':_0x422ea5[_0x34ca('0x17')]?_0x422ea5[_0x34ca('0x17')][_0x34ca('0x19')]||null:null,'attributes':_0x422ea5[_0x34ca('0x17')]?_0x422ea5['options'][_0x34ca('0x1a')]||null:null,'include':_0x422ea5['options']?_0x422ea5['options']['include']?_[_0x34ca('0x1b')](_0x422ea5[_0x34ca('0x17')][_0x34ca('0x1c')],function(_0x4b1c76){return{'model':db[_0x4b1c76['model']],'as':_0x4b1c76['as'],'attributes':_0x4b1c76[_0x34ca('0x1a')],'include':_0x4b1c76[_0x34ca('0x1c')]?_[_0x34ca('0x1b')](_0x4b1c76[_0x34ca('0x1c')],function(_0x203303){return{'model':db[_0x203303[_0x34ca('0x1d')]],'as':_0x203303['as'],'attributes':_0x203303['attributes'],'include':_0x203303['include']?_[_0x34ca('0x1b')](_0x203303['include'],function(_0x5d2f6e){return{'model':db[_0x5d2f6e[_0x34ca('0x1d')]],'as':_0x5d2f6e['as'],'attributes':_0x5d2f6e[_0x34ca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x34ca('0xc')](function(_0x160077){logger['info'](_0x34ca('0x15'),_0x422ea5);logger['debug']('ShowSound',_0x422ea5,JSON[_0x34ca('0x1e')](_0x160077));_0x51c39f(_0x160077);})[_0x34ca('0x14')](function(_0x9db8f9){logger[_0x34ca('0x11')]('ShowSound',_0x9db8f9[_0x34ca('0x13')],_0x422ea5);_0x343655(_0x3a8835[_0x34ca('0x11')](0x1f4,_0x9db8f9['message']));});});}; \ No newline at end of file +var _0x2146=['stringify','error','code','message','catch','Sound','options','raw','where','attributes','map','include','model','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x478c9e,_0x26492f){var _0x2eb7e1=function(_0x36ef0a){while(--_0x36ef0a){_0x478c9e['push'](_0x478c9e['shift']());}};_0x2eb7e1(++_0x26492f);}(_0x2146,0x8e));var _0x6214=function(_0x5670cd,_0x48c031){_0x5670cd=_0x5670cd-0x0;var _0x52e7f4=_0x2146[_0x5670cd];return _0x52e7f4;};'use strict';var _=require(_0x6214('0x0'));var util=require(_0x6214('0x1'));var moment=require(_0x6214('0x2'));var BPromise=require(_0x6214('0x3'));var rs=require(_0x6214('0x4'));var fs=require('fs');var Redis=require(_0x6214('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6214('0x6'));var logger=require(_0x6214('0x7'))(_0x6214('0x8'));var config=require(_0x6214('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6214('0xa')][_0x6214('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5375d7,_0x1a0ecc,_0x59e5aa){return new BPromise(function(_0x3592ac,_0x1e5c9c){return client[_0x6214('0xc')](_0x5375d7,_0x59e5aa)[_0x6214('0xd')](function(_0x5e36eb){logger[_0x6214('0xe')](_0x6214('0xf'),_0x1a0ecc,_0x6214('0x10'));logger[_0x6214('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x1a0ecc,'request\x20sent',JSON[_0x6214('0x12')](_0x5e36eb));if(_0x5e36eb[_0x6214('0x13')]){if(_0x5e36eb[_0x6214('0x13')][_0x6214('0x14')]===0x1f4){logger[_0x6214('0x13')](_0x6214('0xf'),_0x1a0ecc,_0x5e36eb[_0x6214('0x13')][_0x6214('0x15')]);return _0x1e5c9c(_0x5e36eb[_0x6214('0x13')][_0x6214('0x15')]);}logger[_0x6214('0x13')](_0x6214('0xf'),_0x1a0ecc,_0x5e36eb[_0x6214('0x13')][_0x6214('0x15')]);return _0x3592ac(_0x5e36eb[_0x6214('0x13')]['message']);}else{logger[_0x6214('0xe')](_0x6214('0xf'),_0x1a0ecc,_0x6214('0x10'));_0x3592ac(_0x5e36eb['result'][_0x6214('0x15')]);}})[_0x6214('0x16')](function(_0x22d557){logger[_0x6214('0x13')]('Sound,\x20%s,\x20%s',_0x1a0ecc,_0x22d557);_0x1e5c9c(_0x22d557);});});}exports['ShowSound']=function(_0x561cc5){var _0x59ff04=this;return new Promise(function(_0xa6b6d8,_0x3ed5ba){return db[_0x6214('0x17')]['find']({'raw':_0x561cc5['options']?_0x561cc5[_0x6214('0x18')][_0x6214('0x19')]===undefined?!![]:![]:!![],'where':_0x561cc5[_0x6214('0x18')]?_0x561cc5[_0x6214('0x18')][_0x6214('0x1a')]||null:null,'attributes':_0x561cc5[_0x6214('0x18')]?_0x561cc5['options'][_0x6214('0x1b')]||null:null,'include':_0x561cc5[_0x6214('0x18')]?_0x561cc5[_0x6214('0x18')]['include']?_[_0x6214('0x1c')](_0x561cc5[_0x6214('0x18')][_0x6214('0x1d')],function(_0xfc9a3a){return{'model':db[_0xfc9a3a[_0x6214('0x1e')]],'as':_0xfc9a3a['as'],'attributes':_0xfc9a3a['attributes'],'include':_0xfc9a3a[_0x6214('0x1d')]?_[_0x6214('0x1c')](_0xfc9a3a['include'],function(_0x565252){return{'model':db[_0x565252['model']],'as':_0x565252['as'],'attributes':_0x565252[_0x6214('0x1b')],'include':_0x565252[_0x6214('0x1d')]?_[_0x6214('0x1c')](_0x565252[_0x6214('0x1d')],function(_0x244078){return{'model':db[_0x244078[_0x6214('0x1e')]],'as':_0x244078['as'],'attributes':_0x244078[_0x6214('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6214('0xd')](function(_0x37932c){logger[_0x6214('0xe')](_0x6214('0x1f'),_0x561cc5);logger['debug'](_0x6214('0x1f'),_0x561cc5,JSON[_0x6214('0x12')](_0x37932c));_0xa6b6d8(_0x37932c);})[_0x6214('0x16')](function(_0x88f958){logger[_0x6214('0x13')](_0x6214('0x1f'),_0x88f958[_0x6214('0x15')],_0x561cc5);_0x3ed5ba(_0x59ff04[_0x6214('0x13')](0x1f4,_0x88f958[_0x6214('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 18833ae..8cc7b09 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x51b33e,_0xf6f8f5){var _0x4bfa5f=function(_0x270e60){while(--_0x270e60){_0x51b33e['push'](_0x51b33e['shift']());}};_0x4bfa5f(++_0xf6f8f5);}(_0x757a,0xde));var _0xa757=function(_0xb148f,_0x1d7602){_0xb148f=_0xb148f-0x0;var _0x1e5779=_0x757a[_0xb148f];return _0x1e5779;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f377d,_0x57e7b4){var _0x584cb3=function(_0xbadef){while(--_0xbadef){_0x1f377d['push'](_0x1f377d['shift']());}};_0x584cb3(++_0x57e7b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x23292a,_0x1e08ea){_0x23292a=_0x23292a-0x0;var _0x4564f2=_0xb10b[_0x23292a];return _0x4564f2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2884e6c..dc6695f 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 _0x8952=['out','TEXT','sequelize','exports','STRING','ENUM'];(function(_0xe409c1,_0x398654){var _0x418bf3=function(_0x2d5efc){while(--_0x2d5efc){_0xe409c1['push'](_0xe409c1['shift']());}};_0x418bf3(++_0x398654);}(_0x8952,0x1ca));var _0x2895=function(_0x24d19e,_0x390b3e){_0x24d19e=_0x24d19e-0x0;var _0x8cbda1=_0x8952[_0x24d19e];return _0x8cbda1;};'use strict';var Sequelize=require(_0x2895('0x0'));module[_0x2895('0x1')]={'uniqueid':{'type':Sequelize[_0x2895('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x2895('0x3')]('in','out'),'defaultValue':_0x2895('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2895('0x2')]},'providerResponse':{'type':Sequelize[_0x2895('0x5')]}}; \ No newline at end of file +var _0xc9d2=['out','TEXT','exports','STRING','medium','ENUM'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xc9d2,0xbc));var _0x2c9d=function(_0x382c29,_0x21666f){_0x382c29=_0x382c29-0x0;var _0x4ec957=_0xc9d2[_0x382c29];return _0x4ec957;};'use strict';var Sequelize=require('sequelize');module[_0x2c9d('0x0')]={'uniqueid':{'type':Sequelize[_0x2c9d('0x1')]},'body':{'type':Sequelize['TEXT'](_0x2c9d('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2c9d('0x3')]('in',_0x2c9d('0x4')),'defaultValue':_0x2c9d('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2c9d('0x1')]},'providerResponse':{'type':Sequelize[_0x2c9d('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ef0a09e..ff93721 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 _0x5ef6=['VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SquareMessage','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where'];(function(_0x43f326,_0x3c4cd3){var _0x3005b3=function(_0x279d86){while(--_0x279d86){_0x43f326['push'](_0x43f326['shift']());}};_0x3005b3(++_0x3c4cd3);}(_0x5ef6,0xe8));var _0x65ef=function(_0x83cc7b,_0x337a6b){_0x83cc7b=_0x83cc7b-0x0;var _0x77e5ab=_0x5ef6[_0x83cc7b];return _0x77e5ab;};'use strict';var emlformat=require(_0x65ef('0x0'));var rimraf=require(_0x65ef('0x1'));var zipdir=require(_0x65ef('0x2'));var jsonpatch=require(_0x65ef('0x3'));var rp=require(_0x65ef('0x4'));var moment=require(_0x65ef('0x5'));var BPromise=require(_0x65ef('0x6'));var Mustache=require('mustache');var util=require(_0x65ef('0x7'));var path=require(_0x65ef('0x8'));var sox=require(_0x65ef('0x9'));var csv=require(_0x65ef('0xa'));var ejs=require(_0x65ef('0xb'));var fs=require('fs');var fs_extra=require(_0x65ef('0xc'));var _=require(_0x65ef('0xd'));var squel=require('squel');var crypto=require(_0x65ef('0xe'));var jsforce=require(_0x65ef('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x65ef('0xa'));var querystring=require(_0x65ef('0x10'));var Papa=require(_0x65ef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x65ef('0x12'));var as=require(_0x65ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65ef('0x14'))('api');var utils=require(_0x65ef('0x15'));var config=require(_0x65ef('0x16'));var licenseUtil=require(_0x65ef('0x17'));var db=require(_0x65ef('0x18'))['db'];function respondWithStatusCode(_0x5abd48,_0x3fc77c){_0x3fc77c=_0x3fc77c||0xcc;return function(_0x4bf04e){if(_0x4bf04e){return _0x5abd48['sendStatus'](_0x3fc77c);}return _0x5abd48[_0x65ef('0x19')](_0x3fc77c)[_0x65ef('0x1a')]();};}function respondWithResult(_0x227a4e,_0x2c4fee){_0x2c4fee=_0x2c4fee||0xc8;return function(_0x3d971b){if(_0x3d971b){return _0x227a4e[_0x65ef('0x19')](_0x2c4fee)['json'](_0x3d971b);}};}function respondWithFilteredResult(_0x1a441c,_0x542074){return function(_0x23db04){if(_0x23db04){var _0x81862=typeof _0x542074[_0x65ef('0x1b')]===_0x65ef('0x1c')&&typeof _0x542074[_0x65ef('0x1d')]==='undefined';var _0x2ffd75=_0x23db04[_0x65ef('0x1e')];var _0xf1c8ba=_0x81862?0x0:_0x542074['offset'];var _0x15168d=_0x81862?_0x23db04[_0x65ef('0x1e')]:_0x542074[_0x65ef('0x1b')]+_0x542074[_0x65ef('0x1d')];var _0x51d167;if(_0x15168d>=_0x2ffd75){_0x15168d=_0x2ffd75;_0x51d167=0xc8;}else{_0x51d167=0xce;}_0x1a441c[_0x65ef('0x19')](_0x51d167);return _0x1a441c[_0x65ef('0x1f')]('Content-Range',_0xf1c8ba+'-'+_0x15168d+'/'+_0x2ffd75)[_0x65ef('0x20')](_0x23db04);}return null;};}function patchUpdates(_0xda0630){return function(_0x5ef956){try{jsonpatch['apply'](_0x5ef956,_0xda0630,!![]);}catch(_0x2805b0){return BPromise[_0x65ef('0x21')](_0x2805b0);}return _0x5ef956[_0x65ef('0x22')]();};}function saveUpdates(_0x22df8b,_0x9b386a){return function(_0x5acdac){if(_0x5acdac){return _0x5acdac[_0x65ef('0x23')](_0x22df8b)[_0x65ef('0x24')](function(_0x349b27){return _0x349b27;});}return null;};}function removeEntity(_0xb37256,_0x27a8f7){return function(_0x42b35f){if(_0x42b35f){return _0x42b35f[_0x65ef('0x25')]()[_0x65ef('0x24')](function(){_0xb37256[_0x65ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a7f3,_0x350ed6){return function(_0x4454e0){if(!_0x4454e0){_0x46a7f3[_0x65ef('0x26')](0x194);}return _0x4454e0;};}function handleError(_0x404bc9,_0x16bbfb){_0x16bbfb=_0x16bbfb||0x1f4;return function(_0xde36e0){logger[_0x65ef('0x27')](_0xde36e0[_0x65ef('0x28')]);if(_0xde36e0[_0x65ef('0x29')]){delete _0xde36e0[_0x65ef('0x29')];}_0x404bc9[_0x65ef('0x19')](_0x16bbfb)[_0x65ef('0x2a')](_0xde36e0);};}exports['index']=function(_0x4490e6,_0x1af6ec){var _0x31e277={},_0x2638fa={},_0x56ec1d={'count':0x0,'rows':[]};var _0x410a97=_[_0x65ef('0x2b')](db[_0x65ef('0x2c')][_0x65ef('0x2d')],function(_0x50254b){return{'name':_0x50254b['fieldName'],'type':_0x50254b[_0x65ef('0x2e')]['key']};});_0x2638fa['model']=_[_0x65ef('0x2b')](_0x410a97,'name');_0x2638fa[_0x65ef('0x2f')]=_['keys'](_0x4490e6[_0x65ef('0x2f')]);_0x2638fa['filters']=_[_0x65ef('0x30')](_0x2638fa[_0x65ef('0x31')],_0x2638fa[_0x65ef('0x2f')]);_0x31e277[_0x65ef('0x32')]=_['intersection'](_0x2638fa[_0x65ef('0x31')],qs[_0x65ef('0x33')](_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x33')]));_0x31e277[_0x65ef('0x32')]=_0x31e277['attributes'][_0x65ef('0x34')]?_0x31e277[_0x65ef('0x32')]:_0x2638fa[_0x65ef('0x31')];if(!_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x35')]('nolimit')){_0x31e277[_0x65ef('0x1d')]=qs[_0x65ef('0x1d')](_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x1d')]);_0x31e277[_0x65ef('0x1b')]=qs[_0x65ef('0x1b')](_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x1b')]);}_0x31e277[_0x65ef('0x36')]=qs[_0x65ef('0x37')](_0x4490e6[_0x65ef('0x2f')]['sort']);_0x31e277['where']=qs[_0x65ef('0x38')](_[_0x65ef('0x39')](_0x4490e6[_0x65ef('0x2f')],_0x2638fa[_0x65ef('0x38')]),_0x410a97);if(_0x4490e6['query'][_0x65ef('0x3a')]){_0x31e277[_0x65ef('0x3b')]=_['merge'](_0x31e277[_0x65ef('0x3b')],{'$or':_[_0x65ef('0x2b')](_0x410a97,function(_0x533488){if(_0x533488['type']!==_0x65ef('0x3c')){var _0x1ef92a={};_0x1ef92a[_0x533488['name']]={'$like':'%'+_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x3a')]+'%'};return _0x1ef92a;}})});}_0x31e277=_[_0x65ef('0x3d')]({},_0x31e277,_0x4490e6[_0x65ef('0x3e')]);var _0x53c8da={'where':_0x31e277[_0x65ef('0x3b')]};return db[_0x65ef('0x2c')][_0x65ef('0x1e')](_0x53c8da)[_0x65ef('0x24')](function(_0x469b24){_0x56ec1d[_0x65ef('0x1e')]=_0x469b24;if(_0x4490e6[_0x65ef('0x2f')][_0x65ef('0x3f')]){_0x31e277['include']=[{'all':!![]}];}return db[_0x65ef('0x2c')][_0x65ef('0x40')](_0x31e277);})[_0x65ef('0x24')](function(_0x32ec9d){_0x56ec1d[_0x65ef('0x41')]=_0x32ec9d;return _0x56ec1d;})['then'](respondWithFilteredResult(_0x1af6ec,_0x31e277))['catch'](handleError(_0x1af6ec,null));};exports[_0x65ef('0x42')]=function(_0x53c9b6,_0xdeb4fe){var _0x4c169d={'raw':!![],'where':{'id':_0x53c9b6[_0x65ef('0x43')]['id']}},_0xe78d32={};_0xe78d32['model']=_['keys'](db[_0x65ef('0x2c')][_0x65ef('0x2d')]);_0xe78d32[_0x65ef('0x2f')]=_['keys'](_0x53c9b6['query']);_0xe78d32['filters']=_[_0x65ef('0x30')](_0xe78d32['model'],_0xe78d32['query']);_0x4c169d['attributes']=_['intersection'](_0xe78d32['model'],qs[_0x65ef('0x33')](_0x53c9b6['query'][_0x65ef('0x33')]));_0x4c169d['attributes']=_0x4c169d[_0x65ef('0x32')][_0x65ef('0x34')]?_0x4c169d[_0x65ef('0x32')]:_0xe78d32[_0x65ef('0x31')];if(_0x53c9b6['query'][_0x65ef('0x3f')]){_0x4c169d[_0x65ef('0x44')]=[{'all':!![]}];}_0x4c169d=_['merge']({},_0x4c169d,_0x53c9b6['options']);return db[_0x65ef('0x2c')][_0x65ef('0x45')](_0x4c169d)[_0x65ef('0x24')](handleEntityNotFound(_0xdeb4fe,null))[_0x65ef('0x24')](respondWithResult(_0xdeb4fe,null))[_0x65ef('0x46')](handleError(_0xdeb4fe,null));};exports['create']=function(_0x5afad2,_0x38d1fa){return db[_0x65ef('0x2c')][_0x65ef('0x47')](_0x5afad2[_0x65ef('0x48')],{})['then'](respondWithResult(_0x38d1fa,0xc9))[_0x65ef('0x46')](handleError(_0x38d1fa,null));};exports['update']=function(_0x45dde8,_0x1a9943){if(_0x45dde8['body']['id']){delete _0x45dde8[_0x65ef('0x48')]['id'];}return db['SquareMessage'][_0x65ef('0x45')]({'where':{'id':_0x45dde8[_0x65ef('0x43')]['id']}})[_0x65ef('0x24')](handleEntityNotFound(_0x1a9943,null))[_0x65ef('0x24')](saveUpdates(_0x45dde8[_0x65ef('0x48')],null))[_0x65ef('0x24')](respondWithResult(_0x1a9943,null))['catch'](handleError(_0x1a9943,null));};exports[_0x65ef('0x25')]=function(_0x5423ec,_0x46c385){return db[_0x65ef('0x2c')]['find']({'where':{'id':_0x5423ec[_0x65ef('0x43')]['id']}})['then'](handleEntityNotFound(_0x46c385,null))[_0x65ef('0x24')](removeEntity(_0x46c385,null))['catch'](handleError(_0x46c385,null));}; \ No newline at end of file +var _0x4134=['offset','save','then','destroy','end','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','key','model','map','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','catch','show','params','keys','length','create','body','find','rimraf','zip-dir','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count'];(function(_0x5f23bd,_0x217a77){var _0x2d1866=function(_0x5dc429){while(--_0x5dc429){_0x5f23bd['push'](_0x5f23bd['shift']());}};_0x2d1866(++_0x217a77);}(_0x4134,0x17c));var _0x4413=function(_0x2c599b,_0xd391d9){_0x2c599b=_0x2c599b-0x0;var _0x5978fb=_0x4134[_0x2c599b];return _0x5978fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4413('0x0'));var zipdir=require(_0x4413('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4413('0x2'));var util=require('util');var path=require(_0x4413('0x3'));var sox=require(_0x4413('0x4'));var csv=require('to-csv');var ejs=require(_0x4413('0x5'));var fs=require('fs');var fs_extra=require(_0x4413('0x6'));var _=require(_0x4413('0x7'));var squel=require(_0x4413('0x8'));var crypto=require(_0x4413('0x9'));var jsforce=require(_0x4413('0xa'));var deskjs=require(_0x4413('0xb'));var toCsv=require(_0x4413('0xc'));var querystring=require('querystring');var Papa=require(_0x4413('0xd'));var Redis=require(_0x4413('0xe'));var authService=require(_0x4413('0xf'));var qs=require(_0x4413('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4413('0x11'));var logger=require(_0x4413('0x12'))(_0x4413('0x13'));var utils=require('../../config/utils');var config=require(_0x4413('0x14'));var licenseUtil=require(_0x4413('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37b550,_0x318753){_0x318753=_0x318753||0xcc;return function(_0x3c319f){if(_0x3c319f){return _0x37b550[_0x4413('0x16')](_0x318753);}return _0x37b550[_0x4413('0x17')](_0x318753)['end']();};}function respondWithResult(_0x56421e,_0x2b4bda){_0x2b4bda=_0x2b4bda||0xc8;return function(_0x3e8081){if(_0x3e8081){return _0x56421e['status'](_0x2b4bda)[_0x4413('0x18')](_0x3e8081);}};}function respondWithFilteredResult(_0x3a7506,_0x450986){return function(_0x3eec73){if(_0x3eec73){var _0x7456b2=typeof _0x450986['offset']===_0x4413('0x19')&&typeof _0x450986[_0x4413('0x1a')]==='undefined';var _0x23d0c1=_0x3eec73[_0x4413('0x1b')];var _0x30484f=_0x7456b2?0x0:_0x450986[_0x4413('0x1c')];var _0x329280=_0x7456b2?_0x3eec73[_0x4413('0x1b')]:_0x450986[_0x4413('0x1c')]+_0x450986[_0x4413('0x1a')];var _0x12db10;if(_0x329280>=_0x23d0c1){_0x329280=_0x23d0c1;_0x12db10=0xc8;}else{_0x12db10=0xce;}_0x3a7506['status'](_0x12db10);return _0x3a7506['set']('Content-Range',_0x30484f+'-'+_0x329280+'/'+_0x23d0c1)[_0x4413('0x18')](_0x3eec73);}return null;};}function patchUpdates(_0x15aa4e){return function(_0x40be2a){try{jsonpatch['apply'](_0x40be2a,_0x15aa4e,!![]);}catch(_0x4532bb){return BPromise['reject'](_0x4532bb);}return _0x40be2a[_0x4413('0x1d')]();};}function saveUpdates(_0x167aca,_0x39c4b8){return function(_0xd8d380){if(_0xd8d380){return _0xd8d380['update'](_0x167aca)[_0x4413('0x1e')](function(_0x571661){return _0x571661;});}return null;};}function removeEntity(_0x510709,_0x5a6370){return function(_0x4afe15){if(_0x4afe15){return _0x4afe15[_0x4413('0x1f')]()[_0x4413('0x1e')](function(){_0x510709[_0x4413('0x17')](0xcc)[_0x4413('0x20')]();});}};}function handleEntityNotFound(_0x16c49a,_0x550757){return function(_0x2d0951){if(!_0x2d0951){_0x16c49a[_0x4413('0x16')](0x194);}return _0x2d0951;};}function handleError(_0x595f13,_0x21dd3f){_0x21dd3f=_0x21dd3f||0x1f4;return function(_0x4e0c1e){logger[_0x4413('0x21')](_0x4e0c1e[_0x4413('0x22')]);if(_0x4e0c1e[_0x4413('0x23')]){delete _0x4e0c1e[_0x4413('0x23')];}_0x595f13[_0x4413('0x17')](_0x21dd3f)[_0x4413('0x24')](_0x4e0c1e);};}exports[_0x4413('0x25')]=function(_0x11e319,_0x3162f5){var _0x261d9b={},_0x4fe869={},_0xf6f30a={'count':0x0,'rows':[]};var _0x11fa6f=_['map'](db[_0x4413('0x26')][_0x4413('0x27')],function(_0x192f7e){return{'name':_0x192f7e[_0x4413('0x28')],'type':_0x192f7e['type'][_0x4413('0x29')]};});_0x4fe869[_0x4413('0x2a')]=_[_0x4413('0x2b')](_0x11fa6f,_0x4413('0x23'));_0x4fe869['query']=_['keys'](_0x11e319['query']);_0x4fe869['filters']=_[_0x4413('0x2c')](_0x4fe869[_0x4413('0x2a')],_0x4fe869[_0x4413('0x2d')]);_0x261d9b[_0x4413('0x2e')]=_[_0x4413('0x2c')](_0x4fe869[_0x4413('0x2a')],qs['fields'](_0x11e319[_0x4413('0x2d')][_0x4413('0x2f')]));_0x261d9b[_0x4413('0x2e')]=_0x261d9b[_0x4413('0x2e')]['length']?_0x261d9b['attributes']:_0x4fe869['model'];if(!_0x11e319[_0x4413('0x2d')]['hasOwnProperty'](_0x4413('0x30'))){_0x261d9b[_0x4413('0x1a')]=qs[_0x4413('0x1a')](_0x11e319['query'][_0x4413('0x1a')]);_0x261d9b['offset']=qs['offset'](_0x11e319[_0x4413('0x2d')][_0x4413('0x1c')]);}_0x261d9b['order']=qs['sort'](_0x11e319[_0x4413('0x2d')][_0x4413('0x31')]);_0x261d9b[_0x4413('0x32')]=qs[_0x4413('0x33')](_[_0x4413('0x34')](_0x11e319['query'],_0x4fe869['filters']),_0x11fa6f);if(_0x11e319[_0x4413('0x2d')][_0x4413('0x35')]){_0x261d9b['where']=_['merge'](_0x261d9b[_0x4413('0x32')],{'$or':_[_0x4413('0x2b')](_0x11fa6f,function(_0x3475d7){if(_0x3475d7[_0x4413('0x36')]!=='VIRTUAL'){var _0xf5904d={};_0xf5904d[_0x3475d7['name']]={'$like':'%'+_0x11e319[_0x4413('0x2d')]['filter']+'%'};return _0xf5904d;}})});}_0x261d9b=_[_0x4413('0x37')]({},_0x261d9b,_0x11e319[_0x4413('0x38')]);var _0x515836={'where':_0x261d9b[_0x4413('0x32')]};return db[_0x4413('0x26')]['count'](_0x515836)[_0x4413('0x1e')](function(_0x524dda){_0xf6f30a[_0x4413('0x1b')]=_0x524dda;if(_0x11e319['query'][_0x4413('0x39')]){_0x261d9b[_0x4413('0x3a')]=[{'all':!![]}];}return db[_0x4413('0x26')][_0x4413('0x3b')](_0x261d9b);})[_0x4413('0x1e')](function(_0x6442de){_0xf6f30a['rows']=_0x6442de;return _0xf6f30a;})[_0x4413('0x1e')](respondWithFilteredResult(_0x3162f5,_0x261d9b))[_0x4413('0x3c')](handleError(_0x3162f5,null));};exports[_0x4413('0x3d')]=function(_0x37f5f7,_0x389be7){var _0x37686e={'raw':!![],'where':{'id':_0x37f5f7[_0x4413('0x3e')]['id']}},_0x25c71d={};_0x25c71d['model']=_['keys'](db['SquareMessage']['rawAttributes']);_0x25c71d['query']=_[_0x4413('0x3f')](_0x37f5f7[_0x4413('0x2d')]);_0x25c71d['filters']=_[_0x4413('0x2c')](_0x25c71d['model'],_0x25c71d[_0x4413('0x2d')]);_0x37686e[_0x4413('0x2e')]=_[_0x4413('0x2c')](_0x25c71d[_0x4413('0x2a')],qs[_0x4413('0x2f')](_0x37f5f7[_0x4413('0x2d')]['fields']));_0x37686e[_0x4413('0x2e')]=_0x37686e[_0x4413('0x2e')][_0x4413('0x40')]?_0x37686e['attributes']:_0x25c71d['model'];if(_0x37f5f7[_0x4413('0x2d')][_0x4413('0x39')]){_0x37686e[_0x4413('0x3a')]=[{'all':!![]}];}_0x37686e=_['merge']({},_0x37686e,_0x37f5f7[_0x4413('0x38')]);return db[_0x4413('0x26')]['find'](_0x37686e)['then'](handleEntityNotFound(_0x389be7,null))[_0x4413('0x1e')](respondWithResult(_0x389be7,null))[_0x4413('0x3c')](handleError(_0x389be7,null));};exports[_0x4413('0x41')]=function(_0x1a88c9,_0x3af405){return db['SquareMessage'][_0x4413('0x41')](_0x1a88c9[_0x4413('0x42')],{})[_0x4413('0x1e')](respondWithResult(_0x3af405,0xc9))['catch'](handleError(_0x3af405,null));};exports['update']=function(_0x33ec73,_0x21fd36){if(_0x33ec73[_0x4413('0x42')]['id']){delete _0x33ec73['body']['id'];}return db[_0x4413('0x26')][_0x4413('0x43')]({'where':{'id':_0x33ec73[_0x4413('0x3e')]['id']}})[_0x4413('0x1e')](handleEntityNotFound(_0x21fd36,null))[_0x4413('0x1e')](saveUpdates(_0x33ec73[_0x4413('0x42')],null))[_0x4413('0x1e')](respondWithResult(_0x21fd36,null))[_0x4413('0x3c')](handleError(_0x21fd36,null));};exports[_0x4413('0x1f')]=function(_0x97dbd5,_0x21df02){return db[_0x4413('0x26')]['find']({'where':{'id':_0x97dbd5[_0x4413('0x3e')]['id']}})[_0x4413('0x1e')](handleEntityNotFound(_0x21df02,null))[_0x4413('0x1e')](removeEntity(_0x21df02,null))[_0x4413('0x3c')](handleError(_0x21df02,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3dfa57a..6b619ed 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 _0x83b3=['define','SquareMessage','square_messages','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x4a1c00,_0x410a9e){var _0x387359=function(_0x4c8698){while(--_0x4c8698){_0x4a1c00['push'](_0x4a1c00['shift']());}};_0x387359(++_0x410a9e);}(_0x83b3,0x179));var _0x383b=function(_0x4f9e12,_0x5c3b24){_0x4f9e12=_0x4f9e12-0x0;var _0x4563b0=_0x83b3[_0x4f9e12];return _0x4563b0;};'use strict';var _=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x383b('0x2'));var BPromise=require(_0x383b('0x3'));var rp=require(_0x383b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x383b('0x5'));var config=require(_0x383b('0x6'));var attributes=require(_0x383b('0x7'));module['exports']=function(_0x148fce,_0x1d7031){return _0x148fce[_0x383b('0x8')](_0x383b('0x9'),attributes,{'tableName':_0x383b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x329c=['square_messages','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x329c,0x140));var _0xc329=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x329c[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0xc329('0x0'));var util=require('util');var logger=require(_0xc329('0x1'))(_0xc329('0x2'));var moment=require(_0xc329('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc329('0x4'));var config=require(_0xc329('0x5'));var attributes=require(_0xc329('0x6'));module[_0xc329('0x7')]=function(_0x334862,_0x460768){return _0x334862[_0xc329('0x8')](_0xc329('0x9'),attributes,{'tableName':_0xc329('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 f7886b6..bd8bc82 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 _0x362a=['SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x362a,0x171));var _0xa362=function(_0x1ea9b6,_0xa01d61){_0x1ea9b6=_0x1ea9b6-0x0;var _0x2fbbf2=_0x362a[_0x1ea9b6];return _0x2fbbf2;};'use strict';var _=require(_0xa362('0x0'));var util=require(_0xa362('0x1'));var moment=require(_0xa362('0x2'));var BPromise=require(_0xa362('0x3'));var rs=require(_0xa362('0x4'));var fs=require('fs');var Redis=require(_0xa362('0x5'));var db=require(_0xa362('0x6'))['db'];var utils=require(_0xa362('0x7'));var logger=require(_0xa362('0x8'))(_0xa362('0x9'));var config=require(_0xa362('0xa'));var jayson=require(_0xa362('0xb'));var client=jayson[_0xa362('0xc')][_0xa362('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x177f8d,_0x327738,_0x109490){return new BPromise(function(_0x385a7f,_0x4a9729){return client['request'](_0x177f8d,_0x109490)[_0xa362('0xe')](function(_0x414716){logger[_0xa362('0xf')]('SquareMessage,\x20%s,\x20%s',_0x327738,_0xa362('0x10'));logger[_0xa362('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x327738,'request\x20sent',JSON[_0xa362('0x12')](_0x414716));if(_0x414716['error']){if(_0x414716[_0xa362('0x13')][_0xa362('0x14')]===0x1f4){logger[_0xa362('0x13')](_0xa362('0x15'),_0x327738,_0x414716[_0xa362('0x13')][_0xa362('0x16')]);return _0x4a9729(_0x414716[_0xa362('0x13')][_0xa362('0x16')]);}logger[_0xa362('0x13')](_0xa362('0x15'),_0x327738,_0x414716[_0xa362('0x13')][_0xa362('0x16')]);return _0x385a7f(_0x414716[_0xa362('0x13')][_0xa362('0x16')]);}else{logger[_0xa362('0xf')]('SquareMessage,\x20%s,\x20%s',_0x327738,'request\x20sent');_0x385a7f(_0x414716[_0xa362('0x17')]['message']);}})[_0xa362('0x18')](function(_0x572797){logger['error']('SquareMessage,\x20%s,\x20%s',_0x327738,_0x572797);_0x4a9729(_0x572797);});});}exports[_0xa362('0x19')]=function(_0x202740){var _0x2e1b15=this;return new Promise(function(_0x3e29b3,_0x49be62){return db[_0xa362('0x1a')][_0xa362('0x1b')](_0x202740['body'],{'raw':_0x202740[_0xa362('0x1c')]?_0x202740[_0xa362('0x1c')][_0xa362('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3d5fe1){logger[_0xa362('0xf')](_0xa362('0x19'),_0x202740);logger[_0xa362('0x11')](_0xa362('0x19'),_0x202740,JSON[_0xa362('0x12')](_0x3d5fe1));_0x3e29b3(_0x3d5fe1);})[_0xa362('0x18')](function(_0x51427b){logger[_0xa362('0x13')](_0xa362('0x19'),_0x51427b[_0xa362('0x16')],_0x202740);_0x49be62(_0x2e1b15[_0xa362('0x13')](0x1f4,_0x51427b[_0xa362('0x16')]));});});}; \ No newline at end of file +var _0x4c82=['then','CreateSquareMessage','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','request\x20sent','debug','stringify','error','SquareMessage,\x20%s,\x20%s','message','catch','SquareMessage','create','body','options','raw'];(function(_0xfb02c9,_0x43c274){var _0x9afb71=function(_0x56dff0){while(--_0x56dff0){_0xfb02c9['push'](_0xfb02c9['shift']());}};_0x9afb71(++_0x43c274);}(_0x4c82,0x120));var _0x24c8=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0x4c82[_0x1a3243];return _0x33f2ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x24c8('0x0'));var rs=require(_0x24c8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24c8('0x2'))['db'];var utils=require(_0x24c8('0x3'));var logger=require('../../config/logger')(_0x24c8('0x4'));var config=require('../../config/environment');var jayson=require(_0x24c8('0x5'));var client=jayson['client'][_0x24c8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x21d5f9,_0x2142e9,_0x32bee0){return new BPromise(function(_0x43d726,_0x5e0dd8){return client[_0x24c8('0x7')](_0x21d5f9,_0x32bee0)['then'](function(_0x131ec0){logger['info']('SquareMessage,\x20%s,\x20%s',_0x2142e9,_0x24c8('0x8'));logger[_0x24c8('0x9')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2142e9,_0x24c8('0x8'),JSON[_0x24c8('0xa')](_0x131ec0));if(_0x131ec0['error']){if(_0x131ec0[_0x24c8('0xb')]['code']===0x1f4){logger['error'](_0x24c8('0xc'),_0x2142e9,_0x131ec0[_0x24c8('0xb')][_0x24c8('0xd')]);return _0x5e0dd8(_0x131ec0[_0x24c8('0xb')][_0x24c8('0xd')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x2142e9,_0x131ec0[_0x24c8('0xb')][_0x24c8('0xd')]);return _0x43d726(_0x131ec0['error'][_0x24c8('0xd')]);}else{logger['info'](_0x24c8('0xc'),_0x2142e9,_0x24c8('0x8'));_0x43d726(_0x131ec0['result']['message']);}})[_0x24c8('0xe')](function(_0x120b9d){logger[_0x24c8('0xb')](_0x24c8('0xc'),_0x2142e9,_0x120b9d);_0x5e0dd8(_0x120b9d);});});}exports['CreateSquareMessage']=function(_0xd9957b){var _0x507404=this;return new Promise(function(_0x70bdfa,_0xff40e3){return db[_0x24c8('0xf')][_0x24c8('0x10')](_0xd9957b[_0x24c8('0x11')],{'raw':_0xd9957b[_0x24c8('0x12')]?_0xd9957b[_0x24c8('0x12')][_0x24c8('0x13')]===undefined?!![]:![]:!![]})[_0x24c8('0x14')](function(_0x22633f){logger['info'](_0x24c8('0x15'),_0xd9957b);logger[_0x24c8('0x9')](_0x24c8('0x15'),_0xd9957b,JSON[_0x24c8('0xa')](_0x22633f));_0x70bdfa(_0x22633f);})[_0x24c8('0xe')](function(_0x1f92ef){logger[_0x24c8('0xb')](_0x24c8('0x15'),_0x1f92ef[_0x24c8('0xd')],_0xd9957b);_0xff40e3(_0x507404[_0x24c8('0xb')](0x1f4,_0x1f92ef[_0x24c8('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e975bbc..c68065c 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 _0xe670=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','15s','test','post','create','put','update','delete','destroy','exports','path'];(function(_0xd7e9f1,_0xdca35c){var _0x5eba2a=function(_0x5c64b2){while(--_0x5c64b2){_0xd7e9f1['push'](_0xd7e9f1['shift']());}};_0x5eba2a(++_0xdca35c);}(_0xe670,0xe6));var _0x0e67=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0xe670[_0xb7a459];return _0x104ab5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e67('0x0'));var timeout=require(_0x0e67('0x1'));var express=require(_0x0e67('0x2'));var router=express[_0x0e67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0e67('0x4'));var interaction=require(_0x0e67('0x5'));var config=require(_0x0e67('0x6'));var controller=require('./squareOdbc.controller');router[_0x0e67('0x7')]('/',auth[_0x0e67('0x8')](),controller[_0x0e67('0x9')]);router[_0x0e67('0x7')](_0x0e67('0xa'),auth[_0x0e67('0x8')](),controller[_0x0e67('0xb')]);router[_0x0e67('0x7')]('/:id/test',auth[_0x0e67('0x8')](),timeout(_0x0e67('0xc')),controller[_0x0e67('0xd')]);router[_0x0e67('0xe')]('/',auth['isAuthenticated'](),controller[_0x0e67('0xf')]);router[_0x0e67('0x10')](_0x0e67('0xa'),auth['isAuthenticated'](),controller[_0x0e67('0x11')]);router[_0x0e67('0x12')]('/:id',auth[_0x0e67('0x8')](),controller[_0x0e67('0x13')]);module[_0x0e67('0x14')]=router; \ No newline at end of file +var _0x9e27=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','15s','test','put','update','delete','destroy'];(function(_0x201f2f,_0x214225){var _0x143162=function(_0x369564){while(--_0x369564){_0x201f2f['push'](_0x201f2f['shift']());}};_0x143162(++_0x214225);}(_0x9e27,0xf0));var _0x79e2=function(_0x3b8f3d,_0x1f2777){_0x3b8f3d=_0x3b8f3d-0x0;var _0x3ae564=_0x9e27[_0x3b8f3d];return _0x3ae564;};'use strict';var multer=require(_0x79e2('0x0'));var util=require(_0x79e2('0x1'));var path=require('path');var timeout=require(_0x79e2('0x2'));var express=require('express');var router=express[_0x79e2('0x3')]();var fs_extra=require(_0x79e2('0x4'));var auth=require(_0x79e2('0x5'));var interaction=require(_0x79e2('0x6'));var config=require(_0x79e2('0x7'));var controller=require(_0x79e2('0x8'));router['get']('/',auth[_0x79e2('0x9')](),controller[_0x79e2('0xa')]);router[_0x79e2('0xb')](_0x79e2('0xc'),auth['isAuthenticated'](),controller[_0x79e2('0xd')]);router['get']('/:id/test',auth[_0x79e2('0x9')](),timeout(_0x79e2('0xe')),controller[_0x79e2('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x79e2('0x10')](_0x79e2('0xc'),auth[_0x79e2('0x9')](),controller[_0x79e2('0x11')]);router[_0x79e2('0x12')](_0x79e2('0xc'),auth[_0x79e2('0x9')](),controller[_0x79e2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2c2e667..528e323 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 _0x3de8=['STRING','sequelize','exports','name'];(function(_0x5df780,_0x3460c8){var _0x535f5b=function(_0x505237){while(--_0x505237){_0x5df780['push'](_0x5df780['shift']());}};_0x535f5b(++_0x3460c8);}(_0x3de8,0xe9));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x83de('0x0'));module[_0x83de('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x83de('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x83de('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8742=['name','STRING'];(function(_0x3d8387,_0x4ae38c){var _0x226e3d=function(_0x47754d){while(--_0x47754d){_0x3d8387['push'](_0x3d8387['shift']());}};_0x226e3d(++_0x4ae38c);}(_0x8742,0x6e));var _0x2874=function(_0x1d130c,_0x2dcc74){_0x1d130c=_0x1d130c-0x0;var _0x100b1a=_0x8742[_0x1d130c];return _0x100b1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2874('0x0'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2874('0x1')]},'description':{'type':Sequelize[_0x2874('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 9c079cb..d8310b4 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 _0x751f=['stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x751f,0x133));var _0xf751=function(_0x1fb43,_0x54ae6b){_0x1fb43=_0x1fb43-0x0;var _0x317af5=_0x751f[_0x1fb43];return _0x317af5;};'use strict';var emlformat=require(_0xf751('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf751('0x1'));var jsonpatch=require(_0xf751('0x2'));var rp=require(_0xf751('0x3'));var moment=require(_0xf751('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf751('0x5'));var path=require(_0xf751('0x6'));var sox=require(_0xf751('0x7'));var csv=require(_0xf751('0x8'));var ejs=require(_0xf751('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf751('0xa'));var squel=require(_0xf751('0xb'));var crypto=require(_0xf751('0xc'));var jsforce=require(_0xf751('0xd'));var deskjs=require(_0xf751('0xe'));var toCsv=require(_0xf751('0x8'));var querystring=require('querystring');var Papa=require(_0xf751('0xf'));var Redis=require(_0xf751('0x10'));var authService=require(_0xf751('0x11'));var qs=require(_0xf751('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf751('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf751('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x274f2a,_0x3c14bf){_0x3c14bf=_0x3c14bf||0xcc;return function(_0xce1982){if(_0xce1982){return _0x274f2a['sendStatus'](_0x3c14bf);}return _0x274f2a[_0xf751('0x15')](_0x3c14bf)[_0xf751('0x16')]();};}function respondWithResult(_0xeb8b8,_0x27daa6){_0x27daa6=_0x27daa6||0xc8;return function(_0x5a0bb3){if(_0x5a0bb3){return _0xeb8b8['status'](_0x27daa6)[_0xf751('0x17')](_0x5a0bb3);}};}function respondWithFilteredResult(_0x2246b9,_0x9ccb5b){return function(_0x42dc25){if(_0x42dc25){var _0x312fde=typeof _0x9ccb5b[_0xf751('0x18')]===_0xf751('0x19')&&typeof _0x9ccb5b[_0xf751('0x1a')]===_0xf751('0x19');var _0x5db4b8=_0x42dc25['count'];var _0xf10e88=_0x312fde?0x0:_0x9ccb5b['offset'];var _0x58ce67=_0x312fde?_0x42dc25[_0xf751('0x1b')]:_0x9ccb5b[_0xf751('0x18')]+_0x9ccb5b[_0xf751('0x1a')];var _0x371f12;if(_0x58ce67>=_0x5db4b8){_0x58ce67=_0x5db4b8;_0x371f12=0xc8;}else{_0x371f12=0xce;}_0x2246b9[_0xf751('0x15')](_0x371f12);return _0x2246b9[_0xf751('0x1c')](_0xf751('0x1d'),_0xf10e88+'-'+_0x58ce67+'/'+_0x5db4b8)[_0xf751('0x17')](_0x42dc25);}return null;};}function patchUpdates(_0x1a9af4){return function(_0x268e7f){try{jsonpatch[_0xf751('0x1e')](_0x268e7f,_0x1a9af4,!![]);}catch(_0x334acc){return BPromise[_0xf751('0x1f')](_0x334acc);}return _0x268e7f[_0xf751('0x20')]();};}function saveUpdates(_0x27bc1c,_0x5a151e){return function(_0x3fe78f){if(_0x3fe78f){return _0x3fe78f[_0xf751('0x21')](_0x27bc1c)[_0xf751('0x22')](function(_0x4149f3){return _0x4149f3;});}return null;};}function removeEntity(_0x1179eb,_0x5b21c8){return function(_0x43c406){if(_0x43c406){return _0x43c406[_0xf751('0x23')]()[_0xf751('0x22')](function(){var _0x18e28b=_0x43c406[_0xf751('0x24')]({'plain':!![]});var _0x132317=_0xf751('0x25');return db[_0xf751('0x26')][_0xf751('0x23')]({'where':{'type':_0x132317,'resourceId':_0x18e28b['id']}})[_0xf751('0x22')](function(){return _0x43c406;});})['then'](function(){_0x1179eb[_0xf751('0x15')](0xcc)[_0xf751('0x16')]();});}};}function handleEntityNotFound(_0x377112,_0x2a3239){return function(_0x4f1c5c){if(!_0x4f1c5c){_0x377112[_0xf751('0x27')](0x194);}return _0x4f1c5c;};}function handleError(_0xf7dc9c,_0x340555){_0x340555=_0x340555||0x1f4;return function(_0x26d217){logger[_0xf751('0x28')](_0x26d217[_0xf751('0x29')]);if(_0x26d217[_0xf751('0x2a')]){delete _0x26d217[_0xf751('0x2a')];}_0xf7dc9c[_0xf751('0x15')](_0x340555)[_0xf751('0x2b')](_0x26d217);};}exports[_0xf751('0x2c')]=function(_0x49f029,_0x43a913){var _0x54c9f9={},_0xca2552={},_0x185e58={'count':0x0,'rows':[]};var _0x20a0cd=_['map'](db[_0xf751('0x2d')][_0xf751('0x2e')],function(_0x512175){return{'name':_0x512175[_0xf751('0x2f')],'type':_0x512175[_0xf751('0x30')][_0xf751('0x31')]};});_0xca2552['model']=_['map'](_0x20a0cd,_0xf751('0x2a'));_0xca2552[_0xf751('0x32')]=_['keys'](_0x49f029['query']);_0xca2552[_0xf751('0x33')]=_['intersection'](_0xca2552['model'],_0xca2552[_0xf751('0x32')]);_0x54c9f9[_0xf751('0x34')]=_[_0xf751('0x35')](_0xca2552[_0xf751('0x36')],qs[_0xf751('0x37')](_0x49f029['query'][_0xf751('0x37')]));_0x54c9f9['attributes']=_0x54c9f9[_0xf751('0x34')][_0xf751('0x38')]?_0x54c9f9['attributes']:_0xca2552['model'];if(!_0x49f029[_0xf751('0x32')][_0xf751('0x39')](_0xf751('0x3a'))){_0x54c9f9['limit']=qs[_0xf751('0x1a')](_0x49f029['query']['limit']);_0x54c9f9[_0xf751('0x18')]=qs[_0xf751('0x18')](_0x49f029[_0xf751('0x32')][_0xf751('0x18')]);}_0x54c9f9[_0xf751('0x3b')]=qs[_0xf751('0x3c')](_0x49f029[_0xf751('0x32')]['sort']);_0x54c9f9[_0xf751('0x3d')]=qs[_0xf751('0x33')](_[_0xf751('0x3e')](_0x49f029[_0xf751('0x32')],_0xca2552[_0xf751('0x33')]),_0x20a0cd);if(_0x49f029['query'][_0xf751('0x3f')]){_0x54c9f9[_0xf751('0x3d')]=_[_0xf751('0x40')](_0x54c9f9[_0xf751('0x3d')],{'$or':_[_0xf751('0x41')](_0x20a0cd,function(_0x51afe5){if(_0x51afe5['type']!==_0xf751('0x42')){var _0x497ffb={};_0x497ffb[_0x51afe5[_0xf751('0x2a')]]={'$like':'%'+_0x49f029[_0xf751('0x32')][_0xf751('0x3f')]+'%'};return _0x497ffb;}})});}_0x54c9f9=_[_0xf751('0x40')]({},_0x54c9f9,_0x49f029['options']);var _0x1c2109={'where':_0x54c9f9[_0xf751('0x3d')]};return db[_0xf751('0x2d')][_0xf751('0x1b')](_0x1c2109)[_0xf751('0x22')](function(_0x54be5f){_0x185e58[_0xf751('0x1b')]=_0x54be5f;if(_0x49f029['query']['includeAll']){_0x54c9f9[_0xf751('0x43')]=[{'all':!![]}];}return db[_0xf751('0x2d')][_0xf751('0x44')](_0x54c9f9);})[_0xf751('0x22')](function(_0x5e77e8){_0x185e58['rows']=_0x5e77e8;return _0x185e58;})[_0xf751('0x22')](respondWithFilteredResult(_0x43a913,_0x54c9f9))[_0xf751('0x45')](handleError(_0x43a913,null));};exports[_0xf751('0x46')]=function(_0x171b19,_0x56c99c){var _0x25a673={'raw':!![],'where':{'id':_0x171b19[_0xf751('0x47')]['id']}},_0x5acf10={};_0x5acf10[_0xf751('0x36')]=_[_0xf751('0x48')](db['SquareOdbc']['rawAttributes']);_0x5acf10['query']=_[_0xf751('0x48')](_0x171b19['query']);_0x5acf10[_0xf751('0x33')]=_[_0xf751('0x35')](_0x5acf10[_0xf751('0x36')],_0x5acf10[_0xf751('0x32')]);_0x25a673['attributes']=_[_0xf751('0x35')](_0x5acf10['model'],qs[_0xf751('0x37')](_0x171b19[_0xf751('0x32')]['fields']));_0x25a673['attributes']=_0x25a673[_0xf751('0x34')][_0xf751('0x38')]?_0x25a673[_0xf751('0x34')]:_0x5acf10['model'];if(_0x171b19[_0xf751('0x32')][_0xf751('0x49')]){_0x25a673[_0xf751('0x43')]=[{'all':!![]}];}_0x25a673=_['merge']({},_0x25a673,_0x171b19[_0xf751('0x4a')]);return db['SquareOdbc'][_0xf751('0x4b')](_0x25a673)[_0xf751('0x22')](handleEntityNotFound(_0x56c99c,null))['then'](respondWithResult(_0x56c99c,null))[_0xf751('0x45')](handleError(_0x56c99c,null));};exports['create']=function(_0x8c8ab3,_0x25b2ee){return db[_0xf751('0x2d')][_0xf751('0x4c')](_0x8c8ab3[_0xf751('0x4d')],{})[_0xf751('0x22')](function(_0x319c43){var _0x12a765=_0x8c8ab3[_0xf751('0x4e')][_0xf751('0x24')]({'plain':!![]});if(!_0x12a765)throw new Error(_0xf751('0x4f'));if(_0x12a765['role']===_0xf751('0x4e')){var _0x2c53aa=_0x319c43[_0xf751('0x24')]({'plain':!![]});var _0xaa3cce=_0xf751('0x25');return db[_0xf751('0x50')]['find']({'where':{'name':_0xaa3cce,'userProfileId':_0x12a765[_0xf751('0x51')]},'raw':!![]})[_0xf751('0x22')](function(_0x385b48){if(_0x385b48&&_0x385b48['autoAssociation']===0x0){return db[_0xf751('0x26')]['create']({'name':_0x2c53aa[_0xf751('0x2a')],'resourceId':_0x2c53aa['id'],'type':_0x385b48[_0xf751('0x2a')],'sectionId':_0x385b48['id']},{})[_0xf751('0x22')](function(){return _0x319c43;});}else{return _0x319c43;}})[_0xf751('0x45')](function(_0x108960){logger[_0xf751('0x28')](_0xf751('0x52'),_0x108960);throw _0x108960;});}return _0x319c43;})[_0xf751('0x22')](respondWithResult(_0x25b2ee,0xc9))[_0xf751('0x45')](handleError(_0x25b2ee,null));};exports[_0xf751('0x21')]=function(_0x38b119,_0x2ae40e){if(_0x38b119[_0xf751('0x4d')]['id']){delete _0x38b119[_0xf751('0x4d')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x38b119[_0xf751('0x47')]['id']}})[_0xf751('0x22')](handleEntityNotFound(_0x2ae40e,null))['then'](saveUpdates(_0x38b119[_0xf751('0x4d')],null))['then'](respondWithResult(_0x2ae40e,null))[_0xf751('0x45')](handleError(_0x2ae40e,null));};exports[_0xf751('0x23')]=function(_0xf8ef83,_0x2a2440){return db[_0xf751('0x2d')][_0xf751('0x4b')]({'where':{'id':_0xf8ef83['params']['id']}})[_0xf751('0x22')](handleEntityNotFound(_0x2a2440,null))['then'](removeEntity(_0x2a2440,null))[_0xf751('0x45')](handleError(_0x2a2440,null));};exports[_0xf751('0x53')]=function(_0x1b684a,_0x2489c7,_0x2ecc9a){var _0x5bca06;return db['SquareOdbc'][_0xf751('0x4b')]({'where':{'id':_0x1b684a[_0xf751('0x47')]['id']},'attributes':['id','dsn']})[_0xf751('0x22')](handleEntityNotFound(_0x2489c7,null))[_0xf751('0x22')](function(_0x20ca04){if(_0x20ca04){var _0x29f466=require('odbc')();_0x29f466[_0xf751('0x54')](_0x20ca04[_0xf751('0x55')]);_0x29f466[_0xf751('0x56')]();return _0x20ca04;}})[_0xf751('0x22')](respondWithResult(_0x2489c7,null))['catch'](handleError(_0x2489c7,null));}; \ No newline at end of file +var _0xee10=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','test','odbc','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','ODBC','UserProfileResource','error','stack','name','map','SquareOdbc','rawAttributes'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xee10,0x7a));var _0x0ee1=function(_0x55cc1e,_0x1db905){_0x55cc1e=_0x55cc1e-0x0;var _0x4af08f=_0xee10[_0x55cc1e];return _0x4af08f;};'use strict';var emlformat=require(_0x0ee1('0x0'));var rimraf=require(_0x0ee1('0x1'));var zipdir=require(_0x0ee1('0x2'));var jsonpatch=require(_0x0ee1('0x3'));var rp=require(_0x0ee1('0x4'));var moment=require(_0x0ee1('0x5'));var BPromise=require(_0x0ee1('0x6'));var Mustache=require('mustache');var util=require(_0x0ee1('0x7'));var path=require('path');var sox=require(_0x0ee1('0x8'));var csv=require(_0x0ee1('0x9'));var ejs=require(_0x0ee1('0xa'));var fs=require('fs');var fs_extra=require(_0x0ee1('0xb'));var _=require(_0x0ee1('0xc'));var squel=require(_0x0ee1('0xd'));var crypto=require(_0x0ee1('0xe'));var jsforce=require(_0x0ee1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0ee1('0x9'));var querystring=require(_0x0ee1('0x10'));var Papa=require('papaparse');var Redis=require(_0x0ee1('0x11'));var authService=require(_0x0ee1('0x12'));var qs=require(_0x0ee1('0x13'));var as=require(_0x0ee1('0x14'));var hardwareService=require(_0x0ee1('0x15'));var logger=require(_0x0ee1('0x16'))(_0x0ee1('0x17'));var utils=require(_0x0ee1('0x18'));var config=require(_0x0ee1('0x19'));var licenseUtil=require(_0x0ee1('0x1a'));var db=require(_0x0ee1('0x1b'))['db'];function respondWithStatusCode(_0x2ac77e,_0x5bd06f){_0x5bd06f=_0x5bd06f||0xcc;return function(_0x18e30c){if(_0x18e30c){return _0x2ac77e[_0x0ee1('0x1c')](_0x5bd06f);}return _0x2ac77e[_0x0ee1('0x1d')](_0x5bd06f)[_0x0ee1('0x1e')]();};}function respondWithResult(_0x28beb3,_0x13f149){_0x13f149=_0x13f149||0xc8;return function(_0x1be40a){if(_0x1be40a){return _0x28beb3['status'](_0x13f149)['json'](_0x1be40a);}};}function respondWithFilteredResult(_0x4070af,_0x5e5623){return function(_0x13673c){if(_0x13673c){var _0xd845b1=typeof _0x5e5623[_0x0ee1('0x1f')]===_0x0ee1('0x20')&&typeof _0x5e5623[_0x0ee1('0x21')]==='undefined';var _0x5b1f4f=_0x13673c['count'];var _0x1ea91c=_0xd845b1?0x0:_0x5e5623[_0x0ee1('0x1f')];var _0x3360f4=_0xd845b1?_0x13673c[_0x0ee1('0x22')]:_0x5e5623[_0x0ee1('0x1f')]+_0x5e5623[_0x0ee1('0x21')];var _0x309f37;if(_0x3360f4>=_0x5b1f4f){_0x3360f4=_0x5b1f4f;_0x309f37=0xc8;}else{_0x309f37=0xce;}_0x4070af[_0x0ee1('0x1d')](_0x309f37);return _0x4070af['set'](_0x0ee1('0x23'),_0x1ea91c+'-'+_0x3360f4+'/'+_0x5b1f4f)[_0x0ee1('0x24')](_0x13673c);}return null;};}function patchUpdates(_0x1ccb63){return function(_0x166e66){try{jsonpatch[_0x0ee1('0x25')](_0x166e66,_0x1ccb63,!![]);}catch(_0x40298e){return BPromise[_0x0ee1('0x26')](_0x40298e);}return _0x166e66['save']();};}function saveUpdates(_0x1f09d4,_0x5a8046){return function(_0x2b0952){if(_0x2b0952){return _0x2b0952[_0x0ee1('0x27')](_0x1f09d4)[_0x0ee1('0x28')](function(_0x58b61a){return _0x58b61a;});}return null;};}function removeEntity(_0x5678c5,_0x58d443){return function(_0x9edef2){if(_0x9edef2){return _0x9edef2[_0x0ee1('0x29')]()[_0x0ee1('0x28')](function(){var _0x5067ce=_0x9edef2['get']({'plain':!![]});var _0x133c55=_0x0ee1('0x2a');return db[_0x0ee1('0x2b')][_0x0ee1('0x29')]({'where':{'type':_0x133c55,'resourceId':_0x5067ce['id']}})['then'](function(){return _0x9edef2;});})['then'](function(){_0x5678c5[_0x0ee1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16599a,_0x2b24ce){return function(_0x2587db){if(!_0x2587db){_0x16599a[_0x0ee1('0x1c')](0x194);}return _0x2587db;};}function handleError(_0x301230,_0xbebdca){_0xbebdca=_0xbebdca||0x1f4;return function(_0x1159c7){logger[_0x0ee1('0x2c')](_0x1159c7[_0x0ee1('0x2d')]);if(_0x1159c7[_0x0ee1('0x2e')]){delete _0x1159c7['name'];}_0x301230['status'](_0xbebdca)['send'](_0x1159c7);};}exports['index']=function(_0x551e2d,_0x381082){var _0x413326={},_0x5ee68a={},_0x14b6c8={'count':0x0,'rows':[]};var _0x5c188e=_[_0x0ee1('0x2f')](db[_0x0ee1('0x30')][_0x0ee1('0x31')],function(_0x2f99d8){return{'name':_0x2f99d8[_0x0ee1('0x32')],'type':_0x2f99d8[_0x0ee1('0x33')]['key']};});_0x5ee68a[_0x0ee1('0x34')]=_[_0x0ee1('0x2f')](_0x5c188e,'name');_0x5ee68a[_0x0ee1('0x35')]=_[_0x0ee1('0x36')](_0x551e2d[_0x0ee1('0x35')]);_0x5ee68a[_0x0ee1('0x37')]=_[_0x0ee1('0x38')](_0x5ee68a[_0x0ee1('0x34')],_0x5ee68a[_0x0ee1('0x35')]);_0x413326[_0x0ee1('0x39')]=_[_0x0ee1('0x38')](_0x5ee68a[_0x0ee1('0x34')],qs['fields'](_0x551e2d[_0x0ee1('0x35')][_0x0ee1('0x3a')]));_0x413326[_0x0ee1('0x39')]=_0x413326['attributes']['length']?_0x413326[_0x0ee1('0x39')]:_0x5ee68a['model'];if(!_0x551e2d[_0x0ee1('0x35')][_0x0ee1('0x3b')](_0x0ee1('0x3c'))){_0x413326[_0x0ee1('0x21')]=qs[_0x0ee1('0x21')](_0x551e2d[_0x0ee1('0x35')][_0x0ee1('0x21')]);_0x413326['offset']=qs['offset'](_0x551e2d['query'][_0x0ee1('0x1f')]);}_0x413326['order']=qs[_0x0ee1('0x3d')](_0x551e2d[_0x0ee1('0x35')][_0x0ee1('0x3d')]);_0x413326['where']=qs[_0x0ee1('0x37')](_['pick'](_0x551e2d[_0x0ee1('0x35')],_0x5ee68a['filters']),_0x5c188e);if(_0x551e2d['query'][_0x0ee1('0x3e')]){_0x413326[_0x0ee1('0x3f')]=_[_0x0ee1('0x40')](_0x413326[_0x0ee1('0x3f')],{'$or':_['map'](_0x5c188e,function(_0x566701){if(_0x566701[_0x0ee1('0x33')]!==_0x0ee1('0x41')){var _0x5ef388={};_0x5ef388[_0x566701[_0x0ee1('0x2e')]]={'$like':'%'+_0x551e2d[_0x0ee1('0x35')][_0x0ee1('0x3e')]+'%'};return _0x5ef388;}})});}_0x413326=_[_0x0ee1('0x40')]({},_0x413326,_0x551e2d[_0x0ee1('0x42')]);var _0x21604d={'where':_0x413326[_0x0ee1('0x3f')]};return db[_0x0ee1('0x30')]['count'](_0x21604d)[_0x0ee1('0x28')](function(_0x2fc732){_0x14b6c8['count']=_0x2fc732;if(_0x551e2d[_0x0ee1('0x35')]['includeAll']){_0x413326[_0x0ee1('0x43')]=[{'all':!![]}];}return db[_0x0ee1('0x30')][_0x0ee1('0x44')](_0x413326);})[_0x0ee1('0x28')](function(_0xf8cd85){_0x14b6c8[_0x0ee1('0x45')]=_0xf8cd85;return _0x14b6c8;})['then'](respondWithFilteredResult(_0x381082,_0x413326))[_0x0ee1('0x46')](handleError(_0x381082,null));};exports['show']=function(_0x2de3b1,_0x2fc890){var _0x249b99={'raw':!![],'where':{'id':_0x2de3b1[_0x0ee1('0x47')]['id']}},_0x188eec={};_0x188eec[_0x0ee1('0x34')]=_[_0x0ee1('0x36')](db[_0x0ee1('0x30')][_0x0ee1('0x31')]);_0x188eec[_0x0ee1('0x35')]=_[_0x0ee1('0x36')](_0x2de3b1[_0x0ee1('0x35')]);_0x188eec['filters']=_[_0x0ee1('0x38')](_0x188eec[_0x0ee1('0x34')],_0x188eec[_0x0ee1('0x35')]);_0x249b99['attributes']=_['intersection'](_0x188eec[_0x0ee1('0x34')],qs[_0x0ee1('0x3a')](_0x2de3b1[_0x0ee1('0x35')][_0x0ee1('0x3a')]));_0x249b99[_0x0ee1('0x39')]=_0x249b99[_0x0ee1('0x39')]['length']?_0x249b99[_0x0ee1('0x39')]:_0x188eec[_0x0ee1('0x34')];if(_0x2de3b1[_0x0ee1('0x35')][_0x0ee1('0x48')]){_0x249b99['include']=[{'all':!![]}];}_0x249b99=_[_0x0ee1('0x40')]({},_0x249b99,_0x2de3b1[_0x0ee1('0x42')]);return db[_0x0ee1('0x30')][_0x0ee1('0x49')](_0x249b99)['then'](handleEntityNotFound(_0x2fc890,null))[_0x0ee1('0x28')](respondWithResult(_0x2fc890,null))[_0x0ee1('0x46')](handleError(_0x2fc890,null));};exports['create']=function(_0x4a84da,_0x4c89bc){return db[_0x0ee1('0x30')][_0x0ee1('0x4a')](_0x4a84da[_0x0ee1('0x4b')],{})[_0x0ee1('0x28')](function(_0x397174){var _0x1c440f=_0x4a84da[_0x0ee1('0x4c')][_0x0ee1('0x4d')]({'plain':!![]});if(!_0x1c440f)throw new Error(_0x0ee1('0x4e'));if(_0x1c440f[_0x0ee1('0x4f')]===_0x0ee1('0x4c')){var _0x30410c=_0x397174[_0x0ee1('0x4d')]({'plain':!![]});var _0x55bb10='ODBC';return db[_0x0ee1('0x50')][_0x0ee1('0x49')]({'where':{'name':_0x55bb10,'userProfileId':_0x1c440f[_0x0ee1('0x51')]},'raw':!![]})['then'](function(_0x359c49){if(_0x359c49&&_0x359c49['autoAssociation']===0x0){return db[_0x0ee1('0x2b')][_0x0ee1('0x4a')]({'name':_0x30410c[_0x0ee1('0x2e')],'resourceId':_0x30410c['id'],'type':_0x359c49[_0x0ee1('0x2e')],'sectionId':_0x359c49['id']},{})[_0x0ee1('0x28')](function(){return _0x397174;});}else{return _0x397174;}})['catch'](function(_0x49fd80){logger[_0x0ee1('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49fd80);throw _0x49fd80;});}return _0x397174;})['then'](respondWithResult(_0x4c89bc,0xc9))[_0x0ee1('0x46')](handleError(_0x4c89bc,null));};exports['update']=function(_0x2eed6c,_0x2dcacb){if(_0x2eed6c[_0x0ee1('0x4b')]['id']){delete _0x2eed6c['body']['id'];}return db[_0x0ee1('0x30')][_0x0ee1('0x49')]({'where':{'id':_0x2eed6c[_0x0ee1('0x47')]['id']}})[_0x0ee1('0x28')](handleEntityNotFound(_0x2dcacb,null))[_0x0ee1('0x28')](saveUpdates(_0x2eed6c[_0x0ee1('0x4b')],null))['then'](respondWithResult(_0x2dcacb,null))[_0x0ee1('0x46')](handleError(_0x2dcacb,null));};exports[_0x0ee1('0x29')]=function(_0x5faf38,_0x1f5157){return db['SquareOdbc']['find']({'where':{'id':_0x5faf38[_0x0ee1('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f5157,null))[_0x0ee1('0x28')](removeEntity(_0x1f5157,null))[_0x0ee1('0x46')](handleError(_0x1f5157,null));};exports[_0x0ee1('0x52')]=function(_0x1b3502,_0x3280b2,_0x48af20){var _0x530432;return db[_0x0ee1('0x30')][_0x0ee1('0x49')]({'where':{'id':_0x1b3502[_0x0ee1('0x47')]['id']},'attributes':['id','dsn']})[_0x0ee1('0x28')](handleEntityNotFound(_0x3280b2,null))[_0x0ee1('0x28')](function(_0xbe1f8f){if(_0xbe1f8f){var _0x426c31=require(_0x0ee1('0x53'))();_0x426c31['openSync'](_0xbe1f8f[_0x0ee1('0x54')]);_0x426c31[_0x0ee1('0x55')]();return _0xbe1f8f;}})[_0x0ee1('0x28')](respondWithResult(_0x3280b2,null))['catch'](handleError(_0x3280b2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index cacb68a..16f8800 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 _0xed96=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','moment','bluebird','request-promise','path'];(function(_0x5a5322,_0x1d8e4d){var _0x3541db=function(_0x134246){while(--_0x134246){_0x5a5322['push'](_0x5a5322['shift']());}};_0x3541db(++_0x1d8e4d);}(_0xed96,0x1e6));var _0x6ed9=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xed96[_0x1b3564];return _0x504069;};'use strict';var _=require(_0x6ed9('0x0'));var util=require(_0x6ed9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6ed9('0x2'));var BPromise=require(_0x6ed9('0x3'));var rp=require(_0x6ed9('0x4'));var fs=require('fs');var path=require(_0x6ed9('0x5'));var rimraf=require('rimraf');var config=require(_0x6ed9('0x6'));var attributes=require(_0x6ed9('0x7'));module[_0x6ed9('0x8')]=function(_0x13f0d2,_0x4cf311){return _0x13f0d2[_0x6ed9('0x9')](_0x6ed9('0xa'),attributes,{'tableName':_0x6ed9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76e8=['define','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x76e8,0x1ca));var _0x876e=function(_0x54a5b6,_0x1fe85a){_0x54a5b6=_0x54a5b6-0x0;var _0x2f0864=_0x76e8[_0x54a5b6];return _0x2f0864;};'use strict';var _=require(_0x876e('0x0'));var util=require(_0x876e('0x1'));var logger=require(_0x876e('0x2'))('api');var moment=require(_0x876e('0x3'));var BPromise=require(_0x876e('0x4'));var rp=require(_0x876e('0x5'));var fs=require('fs');var path=require(_0x876e('0x6'));var rimraf=require(_0x876e('0x7'));var config=require(_0x876e('0x8'));var attributes=require(_0x876e('0x9'));module['exports']=function(_0x574366,_0x3144aa){return _0x574366[_0x876e('0xa')]('SquareOdbc',attributes,{'tableName':_0x876e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 20a4b3c..582f909 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 _0xdc86=['map','model','attributes','ShowSquareOdbc','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','SquareOdbc','options','raw','where','include'];(function(_0x3cbb90,_0x3ffd66){var _0x392d10=function(_0x2b4560){while(--_0x2b4560){_0x3cbb90['push'](_0x3cbb90['shift']());}};_0x392d10(++_0x3ffd66);}(_0xdc86,0x1c5));var _0x6dc8=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xdc86[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x6dc8('0x0'));var util=require(_0x6dc8('0x1'));var moment=require(_0x6dc8('0x2'));var BPromise=require(_0x6dc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dc8('0x4'));var db=require(_0x6dc8('0x5'))['db'];var utils=require(_0x6dc8('0x6'));var logger=require(_0x6dc8('0x7'))(_0x6dc8('0x8'));var config=require(_0x6dc8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6dc8('0xa')][_0x6dc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5969e9,_0x533355,_0x5938a7){return new BPromise(function(_0x4f2e82,_0x436f9a){return client['request'](_0x5969e9,_0x5938a7)[_0x6dc8('0xc')](function(_0x2a3784){logger[_0x6dc8('0xd')](_0x6dc8('0xe'),_0x533355,'request\x20sent');logger[_0x6dc8('0xf')](_0x6dc8('0x10'),_0x533355,'request\x20sent',JSON[_0x6dc8('0x11')](_0x2a3784));if(_0x2a3784[_0x6dc8('0x12')]){if(_0x2a3784[_0x6dc8('0x12')][_0x6dc8('0x13')]===0x1f4){logger[_0x6dc8('0x12')](_0x6dc8('0xe'),_0x533355,_0x2a3784[_0x6dc8('0x12')]['message']);return _0x436f9a(_0x2a3784['error'][_0x6dc8('0x14')]);}logger[_0x6dc8('0x12')](_0x6dc8('0xe'),_0x533355,_0x2a3784[_0x6dc8('0x12')][_0x6dc8('0x14')]);return _0x4f2e82(_0x2a3784[_0x6dc8('0x12')][_0x6dc8('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x533355,_0x6dc8('0x15'));_0x4f2e82(_0x2a3784['result'][_0x6dc8('0x14')]);}})['catch'](function(_0x2387f0){logger[_0x6dc8('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x533355,_0x2387f0);_0x436f9a(_0x2387f0);});});}exports['ShowSquareOdbc']=function(_0x1e7c0b){var _0x1857a2=this;return new Promise(function(_0x4e647b,_0x32ae7c){return db[_0x6dc8('0x16')]['find']({'raw':_0x1e7c0b[_0x6dc8('0x17')]?_0x1e7c0b[_0x6dc8('0x17')][_0x6dc8('0x18')]===undefined?!![]:![]:!![],'where':_0x1e7c0b[_0x6dc8('0x17')]?_0x1e7c0b[_0x6dc8('0x17')][_0x6dc8('0x19')]||null:null,'attributes':_0x1e7c0b[_0x6dc8('0x17')]?_0x1e7c0b[_0x6dc8('0x17')]['attributes']||null:null,'include':_0x1e7c0b['options']?_0x1e7c0b[_0x6dc8('0x17')][_0x6dc8('0x1a')]?_[_0x6dc8('0x1b')](_0x1e7c0b['options'][_0x6dc8('0x1a')],function(_0x2c4c51){return{'model':db[_0x2c4c51[_0x6dc8('0x1c')]],'as':_0x2c4c51['as'],'attributes':_0x2c4c51[_0x6dc8('0x1d')],'include':_0x2c4c51[_0x6dc8('0x1a')]?_['map'](_0x2c4c51['include'],function(_0x533f0f){return{'model':db[_0x533f0f['model']],'as':_0x533f0f['as'],'attributes':_0x533f0f[_0x6dc8('0x1d')],'include':_0x533f0f[_0x6dc8('0x1a')]?_[_0x6dc8('0x1b')](_0x533f0f[_0x6dc8('0x1a')],function(_0x3c79b0){return{'model':db[_0x3c79b0[_0x6dc8('0x1c')]],'as':_0x3c79b0['as'],'attributes':_0x3c79b0[_0x6dc8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37b62d){logger[_0x6dc8('0xd')](_0x6dc8('0x1e'),_0x1e7c0b);logger[_0x6dc8('0xf')](_0x6dc8('0x1e'),_0x1e7c0b,JSON[_0x6dc8('0x11')](_0x37b62d));_0x4e647b(_0x37b62d);})[_0x6dc8('0x1f')](function(_0x5a05ef){logger[_0x6dc8('0x12')](_0x6dc8('0x1e'),_0x5a05ef['message'],_0x1e7c0b);_0x32ae7c(_0x1857a2[_0x6dc8('0x12')](0x1f4,_0x5a05ef[_0x6dc8('0x14')]));});});}; \ No newline at end of file +var _0x57de=['include','map','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57de,0x1bd));var _0xe57d=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x57de[_0x44dba1];return _0x2fbd3f;};'use strict';var _=require(_0xe57d('0x0'));var util=require('util');var moment=require(_0xe57d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe57d('0x2'));var fs=require('fs');var Redis=require(_0xe57d('0x3'));var db=require(_0xe57d('0x4'))['db'];var utils=require(_0xe57d('0x5'));var logger=require('../../config/logger')(_0xe57d('0x6'));var config=require(_0xe57d('0x7'));var jayson=require(_0xe57d('0x8'));var client=jayson[_0xe57d('0x9')][_0xe57d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ca12,_0x142a72,_0x935f0c){return new BPromise(function(_0x297a92,_0x1f5789){return client[_0xe57d('0xb')](_0x13ca12,_0x935f0c)[_0xe57d('0xc')](function(_0x43f270){logger[_0xe57d('0xd')](_0xe57d('0xe'),_0x142a72,_0xe57d('0xf'));logger[_0xe57d('0x10')](_0xe57d('0x11'),_0x142a72,_0xe57d('0xf'),JSON[_0xe57d('0x12')](_0x43f270));if(_0x43f270[_0xe57d('0x13')]){if(_0x43f270[_0xe57d('0x13')][_0xe57d('0x14')]===0x1f4){logger[_0xe57d('0x13')](_0xe57d('0xe'),_0x142a72,_0x43f270['error'][_0xe57d('0x15')]);return _0x1f5789(_0x43f270['error']['message']);}logger[_0xe57d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x142a72,_0x43f270[_0xe57d('0x13')]['message']);return _0x297a92(_0x43f270[_0xe57d('0x13')]['message']);}else{logger['info'](_0xe57d('0xe'),_0x142a72,_0xe57d('0xf'));_0x297a92(_0x43f270[_0xe57d('0x16')][_0xe57d('0x15')]);}})[_0xe57d('0x17')](function(_0x11e621){logger['error'](_0xe57d('0xe'),_0x142a72,_0x11e621);_0x1f5789(_0x11e621);});});}exports[_0xe57d('0x18')]=function(_0x342084){var _0x1ed9e9=this;return new Promise(function(_0x168b36,_0x2e646e){return db[_0xe57d('0x19')][_0xe57d('0x1a')]({'raw':_0x342084['options']?_0x342084[_0xe57d('0x1b')][_0xe57d('0x1c')]===undefined?!![]:![]:!![],'where':_0x342084[_0xe57d('0x1b')]?_0x342084[_0xe57d('0x1b')][_0xe57d('0x1d')]||null:null,'attributes':_0x342084[_0xe57d('0x1b')]?_0x342084[_0xe57d('0x1b')][_0xe57d('0x1e')]||null:null,'include':_0x342084['options']?_0x342084['options'][_0xe57d('0x1f')]?_[_0xe57d('0x20')](_0x342084['options'][_0xe57d('0x1f')],function(_0x552d68){return{'model':db[_0x552d68[_0xe57d('0x21')]],'as':_0x552d68['as'],'attributes':_0x552d68['attributes'],'include':_0x552d68[_0xe57d('0x1f')]?_[_0xe57d('0x20')](_0x552d68['include'],function(_0x5a0b88){return{'model':db[_0x5a0b88[_0xe57d('0x21')]],'as':_0x5a0b88['as'],'attributes':_0x5a0b88[_0xe57d('0x1e')],'include':_0x5a0b88[_0xe57d('0x1f')]?_[_0xe57d('0x20')](_0x5a0b88[_0xe57d('0x1f')],function(_0x37f0f0){return{'model':db[_0x37f0f0[_0xe57d('0x21')]],'as':_0x37f0f0['as'],'attributes':_0x37f0f0[_0xe57d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe57d('0xc')](function(_0x1cf917){logger[_0xe57d('0xd')](_0xe57d('0x18'),_0x342084);logger['debug']('ShowSquareOdbc',_0x342084,JSON[_0xe57d('0x12')](_0x1cf917));_0x168b36(_0x1cf917);})['catch'](function(_0x515d9b){logger[_0xe57d('0x13')](_0xe57d('0x18'),_0x515d9b[_0xe57d('0x15')],_0x342084);_0x2e646e(_0x1ed9e9[_0xe57d('0x13')](0x1f4,_0x515d9b[_0xe57d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index db3dddd..206acce 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 _0x9bb3=['../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','post','addUsers','put','destroy','delete','removeUsers','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5a6d21,_0x3f8681){var _0x1230b8=function(_0x5ab770){while(--_0x5ab770){_0x5a6d21['push'](_0x5a6d21['shift']());}};_0x1230b8(++_0x3f8681);}(_0x9bb3,0x134));var _0x39bb=function(_0x194b78,_0x28588b){_0x194b78=_0x194b78-0x0;var _0x414a0a=_0x9bb3[_0x194b78];return _0x414a0a;};'use strict';var multer=require(_0x39bb('0x0'));var util=require(_0x39bb('0x1'));var path=require(_0x39bb('0x2'));var timeout=require(_0x39bb('0x3'));var express=require(_0x39bb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x39bb('0x5'));var interaction=require(_0x39bb('0x6'));var config=require(_0x39bb('0x7'));var controller=require(_0x39bb('0x8'));router[_0x39bb('0x9')]('/',auth[_0x39bb('0xa')](),controller[_0x39bb('0xb')]);router[_0x39bb('0x9')](_0x39bb('0xc'),auth[_0x39bb('0xa')](),controller[_0x39bb('0xd')]);router[_0x39bb('0x9')](_0x39bb('0xe'),auth['isAuthenticated'](),controller['getUsers']);router[_0x39bb('0xf')]('/',auth[_0x39bb('0xa')](),controller['create']);router[_0x39bb('0xf')]('/:id/users',auth[_0x39bb('0xa')](),controller[_0x39bb('0x10')]);router[_0x39bb('0x11')]('/:id',auth[_0x39bb('0xa')](),controller['update']);router['delete'](_0x39bb('0xc'),auth[_0x39bb('0xa')](),controller[_0x39bb('0x12')]);router[_0x39bb('0x13')](_0x39bb('0xe'),auth[_0x39bb('0xa')](),controller[_0x39bb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6f18=['../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','post','create','addUsers','put','update','delete','/:id','destroy','removeUsers','exports','multer','path','express','Router'];(function(_0xc3170c,_0x5cf3f8){var _0x1420db=function(_0x575137){while(--_0x575137){_0xc3170c['push'](_0xc3170c['shift']());}};_0x1420db(++_0x5cf3f8);}(_0x6f18,0x1b4));var _0x86f1=function(_0x5a4607,_0x481a4a){_0x5a4607=_0x5a4607-0x0;var _0x30b49f=_0x6f18[_0x5a4607];return _0x30b49f;};'use strict';var multer=require(_0x86f1('0x0'));var util=require('util');var path=require(_0x86f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x86f1('0x2'));var router=express[_0x86f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86f1('0x4'));var interaction=require(_0x86f1('0x5'));var config=require('../../config/environment');var controller=require(_0x86f1('0x6'));router[_0x86f1('0x7')]('/',auth[_0x86f1('0x8')](),controller[_0x86f1('0x9')]);router[_0x86f1('0x7')]('/:id',auth[_0x86f1('0x8')](),controller[_0x86f1('0xa')]);router[_0x86f1('0x7')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller['getUsers']);router[_0x86f1('0xc')]('/',auth[_0x86f1('0x8')](),controller[_0x86f1('0xd')]);router[_0x86f1('0xc')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller[_0x86f1('0xe')]);router[_0x86f1('0xf')]('/:id',auth[_0x86f1('0x8')](),controller[_0x86f1('0x10')]);router[_0x86f1('0x11')](_0x86f1('0x12'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x13')]);router['delete'](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x14')]);module[_0x86f1('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 5a18070..e6e809b 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 _0x221c=['getDataValue','preproduction','toString','utf8','production','DATE','STRING','name','TEXT','BLOB','long'];(function(_0x5b0e3d,_0x22f432){var _0x67a168=function(_0x1bf796){while(--_0x1bf796){_0x5b0e3d['push'](_0x5b0e3d['shift']());}};_0x67a168(++_0x22f432);}(_0x221c,0x17c));var _0xc221=function(_0x1eb162,_0x13aea0){_0x1eb162=_0x1eb162-0x0;var _0x1e3ef7=_0x221c[_0x1eb162];return _0x1e3ef7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc221('0x0')],'unique':_0xc221('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc221('0x0')]},'notes':{'type':Sequelize[_0xc221('0x2')]},'preproduction':{'type':Sequelize[_0xc221('0x3')](_0xc221('0x4')),'get':function(){if(this[_0xc221('0x5')](_0xc221('0x6'))){return this[_0xc221('0x5')](_0xc221('0x6'))[_0xc221('0x7')](_0xc221('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xc221('0x4')),'get':function(){if(this[_0xc221('0x5')]('production')){return this['getDataValue'](_0xc221('0x9'))[_0xc221('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0xc221('0xa')]},'publishedAt':{'type':Sequelize[_0xc221('0xa')]}}; \ No newline at end of file +var _0x6546=['DATE','sequelize','exports','STRING','name','TEXT','long','getDataValue','preproduction','BLOB','production','toString','utf8'];(function(_0x52cbc6,_0x3a9e07){var _0x5b7ee5=function(_0x5caebb){while(--_0x5caebb){_0x52cbc6['push'](_0x52cbc6['shift']());}};_0x5b7ee5(++_0x3a9e07);}(_0x6546,0x139));var _0x6654=function(_0x24956e,_0x31514a){_0x24956e=_0x24956e-0x0;var _0x1a9ead=_0x6546[_0x24956e];return _0x1a9ead;};'use strict';var Sequelize=require(_0x6654('0x0'));module[_0x6654('0x1')]={'name':{'type':Sequelize[_0x6654('0x2')],'unique':_0x6654('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6654('0x2')]},'notes':{'type':Sequelize[_0x6654('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x6654('0x5')),'get':function(){if(this[_0x6654('0x6')](_0x6654('0x7'))){return this[_0x6654('0x6')](_0x6654('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x6654('0x8')](_0x6654('0x5')),'get':function(){if(this['getDataValue'](_0x6654('0x9'))){return this[_0x6654('0x6')](_0x6654('0x9'))[_0x6654('0xa')](_0x6654('0xb'));}}},'savedAt':{'type':Sequelize[_0x6654('0xc')]},'publishedAt':{'type':Sequelize[_0x6654('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index bf7c3bc..e1859dd 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 _0xafc4=['VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','undefined','limit','count','offset','json','update','then','destroy','get','UserProfileResource','publish','agi','stringify','error','stack','name','send','index','SquareProject','rawAttributes','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type'];(function(_0x43635e,_0x12619b){var _0x1b972f=function(_0x1f0618){while(--_0x1f0618){_0x43635e['push'](_0x43635e['shift']());}};_0x1b972f(++_0x12619b);}(_0xafc4,0x69));var _0x4afc=function(_0x40575b,_0x8cf588){_0x40575b=_0x40575b-0x0;var _0x2fd04f=_0xafc4[_0x40575b];return _0x2fd04f;};'use strict';var _=require(_0x4afc('0x0'));var Redis=require('ioredis');var qs=require(_0x4afc('0x1'));var logger=require('../../config/logger')(_0x4afc('0x2'));var config=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];config[_0x4afc('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4afc('0x6'))(new Redis(config[_0x4afc('0x5')]));require(_0x4afc('0x7'))[_0x4afc('0x8')](socket);function respondWithStatusCode(_0xc828d9,_0xaf053d){_0xaf053d=_0xaf053d||0xcc;return function(_0x5e1e29){if(_0x5e1e29){return _0xc828d9[_0x4afc('0x9')](_0xaf053d);}return _0xc828d9[_0x4afc('0xa')](_0xaf053d)[_0x4afc('0xb')]();};}function respondWithResult(_0x1e6bf5,_0x1b8981){_0x1b8981=_0x1b8981||0xc8;return function(_0x458fde){if(_0x458fde){return _0x1e6bf5['status'](_0x1b8981)['json'](_0x458fde);}};}function respondWithFilteredResult(_0x7f127f,_0x49222e){return function(_0x281230){if(_0x281230){var _0x225793=typeof _0x49222e['offset']===_0x4afc('0xc')&&typeof _0x49222e[_0x4afc('0xd')]===_0x4afc('0xc');var _0x2768bf=_0x281230[_0x4afc('0xe')];var _0x2f1c59=_0x225793?0x0:_0x49222e[_0x4afc('0xf')];var _0x23b03e=_0x225793?_0x281230['count']:_0x49222e[_0x4afc('0xf')]+_0x49222e[_0x4afc('0xd')];var _0x2c636b;if(_0x23b03e>=_0x2768bf){_0x23b03e=_0x2768bf;_0x2c636b=0xc8;}else{_0x2c636b=0xce;}_0x7f127f[_0x4afc('0xa')](_0x2c636b);return _0x7f127f['set']('Content-Range',_0x2f1c59+'-'+_0x23b03e+'/'+_0x2768bf)[_0x4afc('0x10')](_0x281230);}return null;};}function saveUpdates(_0x4f3127){return function(_0x23ae30){if(_0x23ae30){return _0x23ae30[_0x4afc('0x11')](_0x4f3127)[_0x4afc('0x12')](function(_0x31eec4){return _0x31eec4;});}return null;};}function removeEntity(_0x3a306f){return function(_0x3ebdc8){if(_0x3ebdc8){return _0x3ebdc8[_0x4afc('0x13')]()[_0x4afc('0x12')](function(){var _0x16365f=_0x3ebdc8[_0x4afc('0x14')]({'plain':!![]});var _0x178229='SquareProjects';return db[_0x4afc('0x15')][_0x4afc('0x13')]({'where':{'type':_0x178229,'resourceId':_0x16365f['id']}})[_0x4afc('0x12')](function(){return _0x3ebdc8;});})[_0x4afc('0x12')](function(){var _0x557a7e=new Redis(config[_0x4afc('0x5')]);_0x557a7e[_0x4afc('0x16')](_0x4afc('0x17'),JSON[_0x4afc('0x18')]({'id':_0x3ebdc8['id'],'deleted':!![]}));})[_0x4afc('0x12')](function(){_0x3a306f[_0x4afc('0xa')](0xcc)[_0x4afc('0xb')]();});}};}function handleEntityNotFound(_0x573a75){return function(_0x5403e4){if(!_0x5403e4){_0x573a75[_0x4afc('0x9')](0x194);}return _0x5403e4;};}function handleError(_0x57f37c,_0x37debf){_0x37debf=_0x37debf||0x1f4;return function(_0x4e9a48){logger[_0x4afc('0x19')](_0x4e9a48[_0x4afc('0x1a')]);if(_0x4e9a48[_0x4afc('0x1b')]){delete _0x4e9a48[_0x4afc('0x1b')];}_0x57f37c[_0x4afc('0xa')](_0x37debf)[_0x4afc('0x1c')](_0x4e9a48);};}exports[_0x4afc('0x1d')]=function(_0x383a71,_0x2bb837){var _0x100220={},_0x4e8273={},_0x359c07={'count':0x0,'rows':[]};var _0x35f5b3=_['map'](db[_0x4afc('0x1e')][_0x4afc('0x1f')],function(_0x2d6112){return{'name':_0x2d6112['fieldName'],'type':_0x2d6112['type']['key']};});_0x4e8273[_0x4afc('0x20')]=_[_0x4afc('0x21')](_0x35f5b3,'name');_0x4e8273[_0x4afc('0x22')]=_[_0x4afc('0x23')](_0x383a71['query']);_0x4e8273['filters']=_['intersection'](_0x4e8273[_0x4afc('0x20')],_0x4e8273[_0x4afc('0x22')]);_0x100220[_0x4afc('0x24')]=_[_0x4afc('0x25')](_0x4e8273[_0x4afc('0x20')],qs[_0x4afc('0x26')](_0x383a71['query'][_0x4afc('0x26')]));_0x100220[_0x4afc('0x24')]=_0x100220[_0x4afc('0x24')][_0x4afc('0x27')]?_0x100220[_0x4afc('0x24')]:_0x4e8273[_0x4afc('0x20')];if(!_0x383a71[_0x4afc('0x22')][_0x4afc('0x28')]('nolimit')){_0x100220[_0x4afc('0xd')]=qs['limit'](_0x383a71['query'][_0x4afc('0xd')]);_0x100220[_0x4afc('0xf')]=qs[_0x4afc('0xf')](_0x383a71[_0x4afc('0x22')][_0x4afc('0xf')]);}_0x100220[_0x4afc('0x29')]=qs['sort'](_0x383a71[_0x4afc('0x22')][_0x4afc('0x2a')]);_0x100220[_0x4afc('0x2b')]=qs[_0x4afc('0x2c')](_[_0x4afc('0x2d')](_0x383a71[_0x4afc('0x22')],_0x4e8273['filters']),_0x35f5b3);if(_0x383a71[_0x4afc('0x22')][_0x4afc('0x2e')]){_0x100220[_0x4afc('0x2b')]=_[_0x4afc('0x2f')](_0x100220['where'],{'$or':_['map'](_0x35f5b3,function(_0x43c341){if(_0x43c341[_0x4afc('0x30')]!==_0x4afc('0x31')){var _0x5edfe1={};_0x5edfe1[_0x43c341['name']]={'$like':'%'+_0x383a71[_0x4afc('0x22')]['filter']+'%'};return _0x5edfe1;}})});}_0x100220=_['merge']({},_0x100220,_0x383a71[_0x4afc('0x32')]);var _0x1dc853={'where':_0x100220[_0x4afc('0x2b')]};return db[_0x4afc('0x1e')][_0x4afc('0xe')](_0x1dc853)[_0x4afc('0x12')](function(_0x453e12){_0x359c07[_0x4afc('0xe')]=_0x453e12;if(_0x383a71[_0x4afc('0x22')][_0x4afc('0x33')]){_0x100220[_0x4afc('0x34')]=[{'all':!![]}];}return db[_0x4afc('0x1e')][_0x4afc('0x35')](_0x100220);})[_0x4afc('0x12')](function(_0x46dd2a){_0x359c07['rows']=_0x46dd2a;return _0x359c07;})[_0x4afc('0x12')](respondWithFilteredResult(_0x2bb837,_0x100220))[_0x4afc('0x36')](handleError(_0x2bb837,null));};exports[_0x4afc('0x37')]=function(_0xe6db12,_0x12db1d){var _0x260b06={'raw':![],'where':{'id':_0xe6db12['params']['id']}},_0x3e87f0={};_0x3e87f0['model']=_['keys'](db[_0x4afc('0x1e')][_0x4afc('0x1f')]);_0x3e87f0['query']=_[_0x4afc('0x23')](_0xe6db12[_0x4afc('0x22')]);_0x3e87f0[_0x4afc('0x2c')]=_[_0x4afc('0x25')](_0x3e87f0['model'],_0x3e87f0[_0x4afc('0x22')]);_0x260b06[_0x4afc('0x24')]=_[_0x4afc('0x25')](_0x3e87f0[_0x4afc('0x20')],qs[_0x4afc('0x26')](_0xe6db12[_0x4afc('0x22')]['fields']));_0x260b06[_0x4afc('0x24')]=_0x260b06['attributes'][_0x4afc('0x27')]?_0x260b06[_0x4afc('0x24')]:_0x3e87f0[_0x4afc('0x20')];if(_0xe6db12['query']['includeAll']){_0x260b06[_0x4afc('0x34')]=[{'all':!![]}];}_0x260b06=_[_0x4afc('0x2f')]({},_0x260b06,_0xe6db12[_0x4afc('0x32')]);return db[_0x4afc('0x1e')][_0x4afc('0x38')](_0x260b06)[_0x4afc('0x12')](handleEntityNotFound(_0x12db1d,null))[_0x4afc('0x12')](respondWithResult(_0x12db1d,null))[_0x4afc('0x36')](handleError(_0x12db1d,null));};exports['create']=function(_0x658c5b,_0xb1e91e){return db['SquareProject'][_0x4afc('0x39')](_0x658c5b['body'],{})[_0x4afc('0x12')](function(_0x24a731){var _0x16c6c4=_0x658c5b['user'][_0x4afc('0x14')]({'plain':!![]});if(!_0x16c6c4)throw new Error(_0x4afc('0x3a'));if(_0x16c6c4[_0x4afc('0x3b')]===_0x4afc('0x3c')){var _0x4772db=_0x24a731[_0x4afc('0x14')]({'plain':!![]});var _0x5d9d90='SquareProjects';return db['UserProfileSection'][_0x4afc('0x38')]({'where':{'name':_0x5d9d90,'userProfileId':_0x16c6c4[_0x4afc('0x3d')]},'raw':!![]})[_0x4afc('0x12')](function(_0x269c24){if(_0x269c24&&_0x269c24[_0x4afc('0x3e')]===0x0){return db[_0x4afc('0x15')][_0x4afc('0x39')]({'name':_0x4772db[_0x4afc('0x1b')],'resourceId':_0x4772db['id'],'type':_0x269c24[_0x4afc('0x1b')],'sectionId':_0x269c24['id']},{})[_0x4afc('0x12')](function(){return _0x24a731;});}else{return _0x24a731;}})['catch'](function(_0x40bb3b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40bb3b);throw _0x40bb3b;});}return _0x24a731;})[_0x4afc('0x12')](respondWithResult(_0xb1e91e,0xc9))['catch'](handleError(_0xb1e91e,null));};exports[_0x4afc('0x11')]=function(_0x355198,_0x2fe2ae){if(_0x355198[_0x4afc('0x3f')]['id']){delete _0x355198['body']['id'];}return db[_0x4afc('0x1e')]['find']({'where':{'id':_0x355198[_0x4afc('0x40')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x2fe2ae,null))[_0x4afc('0x12')](saveUpdates(_0x355198[_0x4afc('0x3f')],null))[_0x4afc('0x12')](function(_0xd46c35){if(!_0xd46c35)return;var _0x3d965d=_0xd46c35[_0x4afc('0x14')]({'plain':!![]});return _0x3d965d;})[_0x4afc('0x12')](function(_0x824900){var _0x322eb8=new Redis(config[_0x4afc('0x5')]);_0x322eb8['publish'](_0x4afc('0x17'),JSON[_0x4afc('0x18')](_[_0x4afc('0x2d')](_0x824900,['id',_0x4afc('0x1b'),_0x4afc('0x41')])));return _0x824900;})[_0x4afc('0x12')](respondWithResult(_0x2fe2ae,null))[_0x4afc('0x36')](handleError(_0x2fe2ae,null));};exports[_0x4afc('0x13')]=function(_0x369f01,_0x3df333){return db[_0x4afc('0x1e')][_0x4afc('0x38')]({'where':{'id':_0x369f01[_0x4afc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3df333,null))[_0x4afc('0x12')](removeEntity(_0x3df333,null))['catch'](handleError(_0x3df333,null));};exports[_0x4afc('0x42')]=function(_0x2abc1b,_0x427122){return db[_0x4afc('0x1e')]['find']({'where':{'id':_0x2abc1b['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x427122,null))[_0x4afc('0x12')](function(_0x5f16cb){if(_0x5f16cb){return _0x5f16cb[_0x4afc('0x42')](_0x2abc1b[_0x4afc('0x3f')][_0x4afc('0x43')],_[_0x4afc('0x44')](_0x2abc1b[_0x4afc('0x3f')],[_0x4afc('0x43'),'id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x427122,null))[_0x4afc('0x36')](handleError(_0x427122,null));};exports[_0x4afc('0x45')]=function(_0x3369a8,_0x4295a5){return db[_0x4afc('0x1e')][_0x4afc('0x38')]({'where':{'id':_0x3369a8[_0x4afc('0x40')]['id']}})['then'](handleEntityNotFound(_0x4295a5,null))[_0x4afc('0x12')](function(_0x59fb43){if(_0x59fb43){return _0x59fb43[_0x4afc('0x45')](_0x3369a8[_0x4afc('0x22')][_0x4afc('0x43')])[_0x4afc('0x12')](function(){if(_[_0x4afc('0x46')](_0x3369a8['query'][_0x4afc('0x43')])){for(var _0x323c65=0x0;_0x323c65<_0x3369a8['query']['ids'][_0x4afc('0x27')];_0x323c65+=0x1){socket[_0x4afc('0x47')](_0x4afc('0x48'),{'UserId':Number(_0x3369a8[_0x4afc('0x22')][_0x4afc('0x43')][_0x323c65]),'SquareProjectId':Number(_0x3369a8[_0x4afc('0x40')]['id'])});}}else{socket[_0x4afc('0x47')](_0x4afc('0x48'),{'UserId':Number(_0x3369a8[_0x4afc('0x22')][_0x4afc('0x43')]),'SquareProjectId':Number(_0x3369a8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4295a5,null))[_0x4afc('0x36')](handleError(_0x4295a5,null));};exports[_0x4afc('0x49')]=function(_0x5884f2,_0x38971b){var _0x25e470={};var _0x5be1a7={};var _0x56573a;var _0x1b49cd;return db[_0x4afc('0x1e')][_0x4afc('0x4a')]({'where':{'id':_0x5884f2['params']['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x38971b,null))['then'](function(_0x5a2be2){if(_0x5a2be2){_0x56573a=_0x5a2be2;_0x5be1a7[_0x4afc('0x20')]=_[_0x4afc('0x23')](db[_0x4afc('0x4b')][_0x4afc('0x1f')]);_0x5be1a7[_0x4afc('0x22')]=_[_0x4afc('0x23')](_0x5884f2[_0x4afc('0x22')]);_0x5be1a7[_0x4afc('0x2c')]=_[_0x4afc('0x25')](_0x5be1a7['model'],_0x5be1a7[_0x4afc('0x22')]);_0x25e470[_0x4afc('0x24')]=_[_0x4afc('0x25')](_0x5be1a7['model'],qs['fields'](_0x5884f2['query'][_0x4afc('0x26')]));_0x25e470[_0x4afc('0x24')]=_0x25e470[_0x4afc('0x24')]['length']?_0x25e470[_0x4afc('0x24')]:_0x5be1a7['model'];_0x25e470['order']=qs['sort'](_0x5884f2[_0x4afc('0x22')][_0x4afc('0x2a')]);_0x25e470[_0x4afc('0x2b')]=qs['filters'](_[_0x4afc('0x2d')](_0x5884f2[_0x4afc('0x22')],_0x5be1a7[_0x4afc('0x2c')]));if(_0x5884f2['query'][_0x4afc('0x2e')]){_0x25e470[_0x4afc('0x2b')]=_[_0x4afc('0x2f')](_0x25e470[_0x4afc('0x2b')],{'$or':_[_0x4afc('0x21')](_0x25e470['attributes'],function(_0x549e31){var _0x367224={};_0x367224[_0x549e31]={'$like':'%'+_0x5884f2[_0x4afc('0x22')][_0x4afc('0x2e')]+'%'};return _0x367224;})});}_0x25e470=_['merge']({},_0x25e470,_0x5884f2[_0x4afc('0x32')]);return _0x56573a[_0x4afc('0x49')](_0x25e470);}})[_0x4afc('0x12')](function(_0x306a45){if(_0x306a45){_0x1b49cd=_0x306a45[_0x4afc('0x27')];if(!_0x5884f2['query'][_0x4afc('0x28')](_0x4afc('0x4c'))){_0x25e470['limit']=qs[_0x4afc('0xd')](_0x5884f2[_0x4afc('0x22')][_0x4afc('0xd')]);_0x25e470['offset']=qs[_0x4afc('0xf')](_0x5884f2[_0x4afc('0x22')][_0x4afc('0xf')]);}return _0x56573a[_0x4afc('0x49')](_0x25e470);}})[_0x4afc('0x12')](function(_0x3c0339){if(_0x3c0339){return _0x3c0339?{'count':_0x1b49cd,'rows':_0x3c0339}:null;}})[_0x4afc('0x12')](respondWithResult(_0x38971b,null))[_0x4afc('0x36')](handleError(_0x38971b,null));}; \ No newline at end of file +var _0x01d9=['SquareProject','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','agi','stringify','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x36bbd8,_0x4e8d7d){var _0x3f1659=function(_0x1c90e0){while(--_0x1c90e0){_0x36bbd8['push'](_0x36bbd8['shift']());}};_0x3f1659(++_0x4e8d7d);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var Redis=require(_0x901d('0x1'));var qs=require(_0x901d('0x2'));var logger=require(_0x901d('0x3'))('api');var config=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];config[_0x901d('0x6')]=_[_0x901d('0x7')](config[_0x901d('0x6')],{'host':_0x901d('0x8'),'port':0x18eb});var socket=require(_0x901d('0x9'))(new Redis(config['redis']));require(_0x901d('0xa'))[_0x901d('0xb')](socket);function respondWithStatusCode(_0x21e1d7,_0x12c39f){_0x12c39f=_0x12c39f||0xcc;return function(_0x313f85){if(_0x313f85){return _0x21e1d7[_0x901d('0xc')](_0x12c39f);}return _0x21e1d7[_0x901d('0xd')](_0x12c39f)[_0x901d('0xe')]();};}function respondWithResult(_0x15076e,_0xacff40){_0xacff40=_0xacff40||0xc8;return function(_0x440fb0){if(_0x440fb0){return _0x15076e[_0x901d('0xd')](_0xacff40)[_0x901d('0xf')](_0x440fb0);}};}function respondWithFilteredResult(_0x5d74e2,_0x439f17){return function(_0x5ba100){if(_0x5ba100){var _0x220153=typeof _0x439f17[_0x901d('0x10')]===_0x901d('0x11')&&typeof _0x439f17[_0x901d('0x12')]===_0x901d('0x11');var _0x5d2345=_0x5ba100[_0x901d('0x13')];var _0x31cbbd=_0x220153?0x0:_0x439f17[_0x901d('0x10')];var _0x1618a8=_0x220153?_0x5ba100[_0x901d('0x13')]:_0x439f17[_0x901d('0x10')]+_0x439f17['limit'];var _0x991ee2;if(_0x1618a8>=_0x5d2345){_0x1618a8=_0x5d2345;_0x991ee2=0xc8;}else{_0x991ee2=0xce;}_0x5d74e2[_0x901d('0xd')](_0x991ee2);return _0x5d74e2[_0x901d('0x14')](_0x901d('0x15'),_0x31cbbd+'-'+_0x1618a8+'/'+_0x5d2345)[_0x901d('0xf')](_0x5ba100);}return null;};}function saveUpdates(_0x7dd5f4){return function(_0x477cd4){if(_0x477cd4){return _0x477cd4[_0x901d('0x16')](_0x7dd5f4)[_0x901d('0x17')](function(_0x3b62e5){return _0x3b62e5;});}return null;};}function removeEntity(_0x28caae){return function(_0x390c33){if(_0x390c33){return _0x390c33[_0x901d('0x18')]()[_0x901d('0x17')](function(){var _0x38f42b=_0x390c33[_0x901d('0x19')]({'plain':!![]});var _0xf3c66a=_0x901d('0x1a');return db['UserProfileResource'][_0x901d('0x18')]({'where':{'type':_0xf3c66a,'resourceId':_0x38f42b['id']}})[_0x901d('0x17')](function(){return _0x390c33;});})['then'](function(){var _0x5bdff4=new Redis(config['redis']);_0x5bdff4['publish'](_0x901d('0x1b'),JSON[_0x901d('0x1c')]({'id':_0x390c33['id'],'deleted':!![]}));})['then'](function(){_0x28caae[_0x901d('0xd')](0xcc)[_0x901d('0xe')]();});}};}function handleEntityNotFound(_0x488e24){return function(_0x20778b){if(!_0x20778b){_0x488e24[_0x901d('0xc')](0x194);}return _0x20778b;};}function handleError(_0x2402de,_0x3f80b9){_0x3f80b9=_0x3f80b9||0x1f4;return function(_0x1e7d36){logger[_0x901d('0x1d')](_0x1e7d36[_0x901d('0x1e')]);if(_0x1e7d36[_0x901d('0x1f')]){delete _0x1e7d36['name'];}_0x2402de[_0x901d('0xd')](_0x3f80b9)[_0x901d('0x20')](_0x1e7d36);};}exports[_0x901d('0x21')]=function(_0x1f0ee5,_0x557809){var _0x293119={},_0x23fd43={},_0x27f4ca={'count':0x0,'rows':[]};var _0x3cbe43=_[_0x901d('0x22')](db['SquareProject'][_0x901d('0x23')],function(_0xc52d0f){return{'name':_0xc52d0f[_0x901d('0x24')],'type':_0xc52d0f[_0x901d('0x25')][_0x901d('0x26')]};});_0x23fd43[_0x901d('0x27')]=_['map'](_0x3cbe43,_0x901d('0x1f'));_0x23fd43['query']=_[_0x901d('0x28')](_0x1f0ee5[_0x901d('0x29')]);_0x23fd43[_0x901d('0x2a')]=_[_0x901d('0x2b')](_0x23fd43[_0x901d('0x27')],_0x23fd43[_0x901d('0x29')]);_0x293119[_0x901d('0x2c')]=_[_0x901d('0x2b')](_0x23fd43[_0x901d('0x27')],qs[_0x901d('0x2d')](_0x1f0ee5[_0x901d('0x29')][_0x901d('0x2d')]));_0x293119[_0x901d('0x2c')]=_0x293119[_0x901d('0x2c')][_0x901d('0x2e')]?_0x293119['attributes']:_0x23fd43[_0x901d('0x27')];if(!_0x1f0ee5[_0x901d('0x29')][_0x901d('0x2f')]('nolimit')){_0x293119[_0x901d('0x12')]=qs[_0x901d('0x12')](_0x1f0ee5[_0x901d('0x29')][_0x901d('0x12')]);_0x293119[_0x901d('0x10')]=qs[_0x901d('0x10')](_0x1f0ee5[_0x901d('0x29')][_0x901d('0x10')]);}_0x293119[_0x901d('0x30')]=qs[_0x901d('0x31')](_0x1f0ee5['query']['sort']);_0x293119[_0x901d('0x32')]=qs['filters'](_[_0x901d('0x33')](_0x1f0ee5[_0x901d('0x29')],_0x23fd43['filters']),_0x3cbe43);if(_0x1f0ee5[_0x901d('0x29')][_0x901d('0x34')]){_0x293119[_0x901d('0x32')]=_['merge'](_0x293119[_0x901d('0x32')],{'$or':_[_0x901d('0x22')](_0x3cbe43,function(_0x1a1f9c){if(_0x1a1f9c[_0x901d('0x25')]!==_0x901d('0x35')){var _0x32aa29={};_0x32aa29[_0x1a1f9c[_0x901d('0x1f')]]={'$like':'%'+_0x1f0ee5[_0x901d('0x29')][_0x901d('0x34')]+'%'};return _0x32aa29;}})});}_0x293119=_[_0x901d('0x36')]({},_0x293119,_0x1f0ee5[_0x901d('0x37')]);var _0x3d4f8b={'where':_0x293119[_0x901d('0x32')]};return db[_0x901d('0x38')][_0x901d('0x13')](_0x3d4f8b)[_0x901d('0x17')](function(_0x54a654){_0x27f4ca[_0x901d('0x13')]=_0x54a654;if(_0x1f0ee5[_0x901d('0x29')]['includeAll']){_0x293119['include']=[{'all':!![]}];}return db[_0x901d('0x38')]['findAll'](_0x293119);})[_0x901d('0x17')](function(_0x3d0556){_0x27f4ca[_0x901d('0x39')]=_0x3d0556;return _0x27f4ca;})[_0x901d('0x17')](respondWithFilteredResult(_0x557809,_0x293119))[_0x901d('0x3a')](handleError(_0x557809,null));};exports[_0x901d('0x3b')]=function(_0x5df4cb,_0x4ce6e4){var _0x4ee804={'raw':![],'where':{'id':_0x5df4cb[_0x901d('0x3c')]['id']}},_0x4c4fd0={};_0x4c4fd0[_0x901d('0x27')]=_['keys'](db[_0x901d('0x38')][_0x901d('0x23')]);_0x4c4fd0['query']=_[_0x901d('0x28')](_0x5df4cb[_0x901d('0x29')]);_0x4c4fd0[_0x901d('0x2a')]=_[_0x901d('0x2b')](_0x4c4fd0['model'],_0x4c4fd0['query']);_0x4ee804[_0x901d('0x2c')]=_[_0x901d('0x2b')](_0x4c4fd0[_0x901d('0x27')],qs[_0x901d('0x2d')](_0x5df4cb[_0x901d('0x29')][_0x901d('0x2d')]));_0x4ee804[_0x901d('0x2c')]=_0x4ee804[_0x901d('0x2c')][_0x901d('0x2e')]?_0x4ee804[_0x901d('0x2c')]:_0x4c4fd0[_0x901d('0x27')];if(_0x5df4cb['query'][_0x901d('0x3d')]){_0x4ee804['include']=[{'all':!![]}];}_0x4ee804=_[_0x901d('0x36')]({},_0x4ee804,_0x5df4cb['options']);return db[_0x901d('0x38')]['find'](_0x4ee804)[_0x901d('0x17')](handleEntityNotFound(_0x4ce6e4,null))[_0x901d('0x17')](respondWithResult(_0x4ce6e4,null))[_0x901d('0x3a')](handleError(_0x4ce6e4,null));};exports[_0x901d('0x3e')]=function(_0x2fc1d2,_0x2787ae){return db[_0x901d('0x38')][_0x901d('0x3e')](_0x2fc1d2[_0x901d('0x3f')],{})[_0x901d('0x17')](function(_0x1a27c0){var _0x54fc19=_0x2fc1d2[_0x901d('0x40')][_0x901d('0x19')]({'plain':!![]});if(!_0x54fc19)throw new Error(_0x901d('0x41'));if(_0x54fc19[_0x901d('0x42')]===_0x901d('0x40')){var _0x24b6fa=_0x1a27c0[_0x901d('0x19')]({'plain':!![]});var _0x43135c=_0x901d('0x1a');return db[_0x901d('0x43')][_0x901d('0x44')]({'where':{'name':_0x43135c,'userProfileId':_0x54fc19[_0x901d('0x45')]},'raw':!![]})[_0x901d('0x17')](function(_0x23f2a9){if(_0x23f2a9&&_0x23f2a9['autoAssociation']===0x0){return db['UserProfileResource'][_0x901d('0x3e')]({'name':_0x24b6fa[_0x901d('0x1f')],'resourceId':_0x24b6fa['id'],'type':_0x23f2a9[_0x901d('0x1f')],'sectionId':_0x23f2a9['id']},{})[_0x901d('0x17')](function(){return _0x1a27c0;});}else{return _0x1a27c0;}})[_0x901d('0x3a')](function(_0x5cbc90){logger['error'](_0x901d('0x46'),_0x5cbc90);throw _0x5cbc90;});}return _0x1a27c0;})[_0x901d('0x17')](respondWithResult(_0x2787ae,0xc9))['catch'](handleError(_0x2787ae,null));};exports[_0x901d('0x16')]=function(_0x165207,_0x4d2b2d){if(_0x165207[_0x901d('0x3f')]['id']){delete _0x165207['body']['id'];}return db[_0x901d('0x38')][_0x901d('0x44')]({'where':{'id':_0x165207[_0x901d('0x3c')]['id']}})[_0x901d('0x17')](handleEntityNotFound(_0x4d2b2d,null))['then'](saveUpdates(_0x165207[_0x901d('0x3f')],null))[_0x901d('0x17')](function(_0x1d5880){if(!_0x1d5880)return;var _0x8af950=_0x1d5880[_0x901d('0x19')]({'plain':!![]});return _0x8af950;})[_0x901d('0x17')](function(_0x17c716){var _0x42ddd=new Redis(config[_0x901d('0x6')]);_0x42ddd[_0x901d('0x47')]('agi',JSON[_0x901d('0x1c')](_['pick'](_0x17c716,['id',_0x901d('0x1f'),_0x901d('0x48')])));return _0x17c716;})[_0x901d('0x17')](respondWithResult(_0x4d2b2d,null))[_0x901d('0x3a')](handleError(_0x4d2b2d,null));};exports[_0x901d('0x18')]=function(_0x21f3bd,_0x45c730){return db[_0x901d('0x38')]['find']({'where':{'id':_0x21f3bd[_0x901d('0x3c')]['id']}})[_0x901d('0x17')](handleEntityNotFound(_0x45c730,null))[_0x901d('0x17')](removeEntity(_0x45c730,null))['catch'](handleError(_0x45c730,null));};exports[_0x901d('0x49')]=function(_0x5d049d,_0x1c99ce){return db[_0x901d('0x38')][_0x901d('0x44')]({'where':{'id':_0x5d049d['params']['id']}})[_0x901d('0x17')](handleEntityNotFound(_0x1c99ce,null))[_0x901d('0x17')](function(_0x3740a3){if(_0x3740a3){return _0x3740a3[_0x901d('0x49')](_0x5d049d[_0x901d('0x3f')][_0x901d('0x4a')],_['omit'](_0x5d049d[_0x901d('0x3f')],[_0x901d('0x4a'),'id'])||{});}})[_0x901d('0x17')](respondWithResult(_0x1c99ce,null))[_0x901d('0x3a')](handleError(_0x1c99ce,null));};exports[_0x901d('0x4b')]=function(_0x41f8a5,_0x52eb30){return db[_0x901d('0x38')]['find']({'where':{'id':_0x41f8a5['params']['id']}})['then'](handleEntityNotFound(_0x52eb30,null))['then'](function(_0x23a9aa){if(_0x23a9aa){return _0x23a9aa[_0x901d('0x4b')](_0x41f8a5[_0x901d('0x29')]['ids'])[_0x901d('0x17')](function(){if(_['isArray'](_0x41f8a5[_0x901d('0x29')][_0x901d('0x4a')])){for(var _0xecc8f9=0x0;_0xecc8f9<_0x41f8a5[_0x901d('0x29')][_0x901d('0x4a')][_0x901d('0x2e')];_0xecc8f9+=0x1){socket[_0x901d('0x4c')](_0x901d('0x4d'),{'UserId':Number(_0x41f8a5[_0x901d('0x29')][_0x901d('0x4a')][_0xecc8f9]),'SquareProjectId':Number(_0x41f8a5[_0x901d('0x3c')]['id'])});}}else{socket[_0x901d('0x4c')](_0x901d('0x4d'),{'UserId':Number(_0x41f8a5[_0x901d('0x29')]['ids']),'SquareProjectId':Number(_0x41f8a5['params']['id'])});}});}})[_0x901d('0x17')](respondWithStatusCode(_0x52eb30,null))[_0x901d('0x3a')](handleError(_0x52eb30,null));};exports[_0x901d('0x4e')]=function(_0x3fbb32,_0x109e0a){var _0x383b06={};var _0x2d6431={};var _0x4e9d42;var _0x596a04;return db['SquareProject'][_0x901d('0x4f')]({'where':{'id':_0x3fbb32[_0x901d('0x3c')]['id']}})[_0x901d('0x17')](handleEntityNotFound(_0x109e0a,null))[_0x901d('0x17')](function(_0x32bb51){if(_0x32bb51){_0x4e9d42=_0x32bb51;_0x2d6431[_0x901d('0x27')]=_[_0x901d('0x28')](db[_0x901d('0x50')][_0x901d('0x23')]);_0x2d6431['query']=_['keys'](_0x3fbb32[_0x901d('0x29')]);_0x2d6431[_0x901d('0x2a')]=_[_0x901d('0x2b')](_0x2d6431[_0x901d('0x27')],_0x2d6431[_0x901d('0x29')]);_0x383b06[_0x901d('0x2c')]=_[_0x901d('0x2b')](_0x2d6431[_0x901d('0x27')],qs[_0x901d('0x2d')](_0x3fbb32[_0x901d('0x29')]['fields']));_0x383b06[_0x901d('0x2c')]=_0x383b06[_0x901d('0x2c')]['length']?_0x383b06['attributes']:_0x2d6431[_0x901d('0x27')];_0x383b06[_0x901d('0x30')]=qs['sort'](_0x3fbb32[_0x901d('0x29')][_0x901d('0x31')]);_0x383b06[_0x901d('0x32')]=qs[_0x901d('0x2a')](_['pick'](_0x3fbb32[_0x901d('0x29')],_0x2d6431[_0x901d('0x2a')]));if(_0x3fbb32[_0x901d('0x29')][_0x901d('0x34')]){_0x383b06[_0x901d('0x32')]=_[_0x901d('0x36')](_0x383b06['where'],{'$or':_[_0x901d('0x22')](_0x383b06[_0x901d('0x2c')],function(_0x26b498){var _0x5763ef={};_0x5763ef[_0x26b498]={'$like':'%'+_0x3fbb32[_0x901d('0x29')][_0x901d('0x34')]+'%'};return _0x5763ef;})});}_0x383b06=_[_0x901d('0x36')]({},_0x383b06,_0x3fbb32['options']);return _0x4e9d42['getUsers'](_0x383b06);}})['then'](function(_0x2350ac){if(_0x2350ac){_0x596a04=_0x2350ac[_0x901d('0x2e')];if(!_0x3fbb32['query']['hasOwnProperty'](_0x901d('0x51'))){_0x383b06[_0x901d('0x12')]=qs[_0x901d('0x12')](_0x3fbb32[_0x901d('0x29')][_0x901d('0x12')]);_0x383b06['offset']=qs[_0x901d('0x10')](_0x3fbb32[_0x901d('0x29')][_0x901d('0x10')]);}return _0x4e9d42[_0x901d('0x4e')](_0x383b06);}})['then'](function(_0x2e1dcb){if(_0x2e1dcb){return _0x2e1dcb?{'count':_0x596a04,'rows':_0x2e1dcb}:null;}})['then'](respondWithResult(_0x109e0a,null))[_0x901d('0x3a')](handleError(_0x109e0a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 49c0bdb..fd24474 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 _0xfab9=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x1bff99,_0x374547){var _0xd1ac27=function(_0x5d996d){while(--_0x5d996d){_0x1bff99['push'](_0x1bff99['shift']());}};_0xd1ac27(++_0x374547);}(_0xfab9,0x185));var _0x9fab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfab9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x9fab('0x0'));var SquareProject=require(_0x9fab('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9fab('0x2'),'afterUpdate':_0x9fab('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10384c){return function(_0x457f71,_0x3623c5,_0x40d5e7){SquareProjectEvents[_0x9fab('0x4')](_0x10384c+':'+_0x457f71['id'],_0x457f71);SquareProjectEvents['emit'](_0x10384c,_0x457f71);_0x40d5e7(null);};}for(var e in events){if(events[_0x9fab('0x5')](e)){var event=events[e];SquareProject[_0x9fab('0x6')](e,emitEvent(event));}}module[_0x9fab('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xbc7a=['hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0xa0885e,_0x8b0ad5){var _0x4eff1f=function(_0x238295){while(--_0x238295){_0xa0885e['push'](_0xa0885e['shift']());}};_0x4eff1f(++_0x8b0ad5);}(_0xbc7a,0xcb));var _0xabc7=function(_0x4864b5,_0x51d79e){_0x4864b5=_0x4864b5-0x0;var _0x3806c5=_0xbc7a[_0x4864b5];return _0x3806c5;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xabc7('0x0'))['db'][_0xabc7('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xabc7('0x2')](0x0);var events={'afterCreate':_0xabc7('0x3'),'afterUpdate':_0xabc7('0x4'),'afterDestroy':_0xabc7('0x5')};function emitEvent(_0x156755){return function(_0x4add61,_0x303cc3,_0x1bfe88){SquareProjectEvents[_0xabc7('0x6')](_0x156755+':'+_0x4add61['id'],_0x4add61);SquareProjectEvents[_0xabc7('0x6')](_0x156755,_0x4add61);_0x1bfe88(null);};}for(var e in events){if(events[_0xabc7('0x7')](e)){var event=events[e];SquareProject[_0xabc7('0x8')](e,emitEvent(event));}}module[_0xabc7('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6663130..8f1f56c 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 _0xe007=['api','moment','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger'];(function(_0x4d3e21,_0x56be03){var _0x214312=function(_0x3758f9){while(--_0x3758f9){_0x4d3e21['push'](_0x4d3e21['shift']());}};_0x214312(++_0x56be03);}(_0xe007,0xa8));var _0x7e00=function(_0xf1eeeb,_0x5c0de4){_0xf1eeeb=_0xf1eeeb-0x0;var _0xe010d8=_0xe007[_0xf1eeeb];return _0xe010d8;};'use strict';var _=require('lodash');var util=require(_0x7e00('0x0'));var logger=require(_0x7e00('0x1'))(_0x7e00('0x2'));var moment=require(_0x7e00('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e00('0x4'));var config=require('../../config/environment');var attributes=require(_0x7e00('0x5'));module[_0x7e00('0x6')]=function(_0x29eb62,_0x12b189){return _0x29eb62[_0x7e00('0x7')](_0x7e00('0x8'),attributes,{'tableName':_0x7e00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x328948,_0x2853e2,_0x2c2dba){if(_0x328948[_0x7e00('0xa')](_0x7e00('0xb'))){_0x328948[_0x7e00('0xc')]=moment()[_0x7e00('0xd')](_0x7e00('0xe'));}if(_0x328948[_0x7e00('0xa')](_0x7e00('0xf'))){_0x328948[_0x7e00('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2c2dba(null,_0x328948);}}});}; \ No newline at end of file +var _0xcafd=['publishedAt','format','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0xcafd,0x1b4));var _0xdcaf=function(_0x5df877,_0x124acb){_0x5df877=_0x5df877-0x0;var _0x44d193=_0xcafd[_0x5df877];return _0x44d193;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdcaf('0x0'));var moment=require('moment');var BPromise=require(_0xdcaf('0x1'));var rp=require(_0xdcaf('0x2'));var fs=require('fs');var path=require(_0xdcaf('0x3'));var rimraf=require(_0xdcaf('0x4'));var config=require(_0xdcaf('0x5'));var attributes=require(_0xdcaf('0x6'));module[_0xdcaf('0x7')]=function(_0xe1b9a0,_0x1cfd0d){return _0xe1b9a0[_0xdcaf('0x8')]('SquareProject',attributes,{'tableName':_0xdcaf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x410173,_0x5a1bbc,_0x5ad671){if(_0x410173[_0xdcaf('0xa')]('preproduction')){_0x410173['savedAt']=moment()['format'](_0xdcaf('0xb'));}if(_0x410173[_0xdcaf('0xa')]('production')){_0x410173[_0xdcaf('0xc')]=moment()[_0xdcaf('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5ad671(null,_0x410173);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 3e35b27..613a786 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 _0x3178=['defaults','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','map','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0x3178,0xbe));var _0x8317=function(_0x527930,_0x34c538){_0x527930=_0x527930-0x0;var _0x4e643c=_0x3178[_0x527930];return _0x4e643c;};'use strict';var _=require(_0x8317('0x0'));var Redis=require('ioredis');var db=require(_0x8317('0x1'))['db'];var logger=require(_0x8317('0x2'))(_0x8317('0x3'));var config=require(_0x8317('0x4'));config[_0x8317('0x5')]=_[_0x8317('0x6')](config[_0x8317('0x5')],{'host':_0x8317('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8317('0x8'))[_0x8317('0x9')](socket);exports[_0x8317('0xa')]=function(_0x4a9a1b){var _0x5440e5=this;return new Promise(function(_0x2117f8,_0x37da29){return db[_0x8317('0xb')][_0x8317('0xc')]({'raw':_0x4a9a1b[_0x8317('0xd')]?_0x4a9a1b[_0x8317('0xd')][_0x8317('0xe')]===undefined?!![]:![]:!![],'where':_0x4a9a1b[_0x8317('0xd')]?_0x4a9a1b[_0x8317('0xd')][_0x8317('0xf')]||null:null,'attributes':_0x4a9a1b[_0x8317('0xd')]?_0x4a9a1b[_0x8317('0xd')][_0x8317('0x10')]||null:null,'limit':_0x4a9a1b[_0x8317('0xd')]?_0x4a9a1b[_0x8317('0xd')]['limit']||null:null,'include':_0x4a9a1b[_0x8317('0xd')]?_0x4a9a1b[_0x8317('0xd')][_0x8317('0x11')]?_[_0x8317('0x12')](_0x4a9a1b[_0x8317('0xd')][_0x8317('0x11')],function(_0x2622b5){return{'model':db[_0x2622b5[_0x8317('0x13')]],'as':_0x2622b5['as'],'attributes':_0x2622b5[_0x8317('0x10')],'include':_0x2622b5['include']?_[_0x8317('0x12')](_0x2622b5[_0x8317('0x11')],function(_0x3e4881){return{'model':db[_0x3e4881[_0x8317('0x13')]],'as':_0x3e4881['as'],'attributes':_0x3e4881[_0x8317('0x10')],'include':_0x3e4881[_0x8317('0x11')]?_[_0x8317('0x12')](_0x3e4881[_0x8317('0x11')],function(_0x2a7ade){return{'model':db[_0x2a7ade['model']],'as':_0x2a7ade['as'],'attributes':_0x2a7ade[_0x8317('0x10')]};}):[]};}):[]};}):[]:[]})[_0x8317('0x14')](function(_0x565b91){logger[_0x8317('0x15')](_0x8317('0xa'),_0x4a9a1b);logger[_0x8317('0x16')]('GetSquareProjects',_0x4a9a1b,JSON[_0x8317('0x17')](_0x565b91));_0x2117f8(_0x565b91);})[_0x8317('0x18')](function(_0xef1b76){logger[_0x8317('0x19')]('GetSquareProjects',_0xef1b76[_0x8317('0x1a')],_0x4a9a1b);_0x37da29(_0x5440e5[_0x8317('0x19')](0x1f4,_0xef1b76[_0x8317('0x1a')]));});});};exports['ShowSquareProject']=function(_0x5037af){var _0xffe53b=this;return new Promise(function(_0x35c1b7,_0x18866d){return db['SquareProject']['find']({'raw':_0x5037af[_0x8317('0xd')]?_0x5037af[_0x8317('0xd')][_0x8317('0xe')]===undefined?!![]:![]:!![],'where':_0x5037af['options']?_0x5037af['options'][_0x8317('0xf')]||null:null,'attributes':_0x5037af[_0x8317('0xd')]?_0x5037af['options'][_0x8317('0x10')]||null:null,'include':_0x5037af['options']?_0x5037af[_0x8317('0xd')]['include']?_[_0x8317('0x12')](_0x5037af[_0x8317('0xd')][_0x8317('0x11')],function(_0xeb26ee){return{'model':db[_0xeb26ee[_0x8317('0x13')]],'as':_0xeb26ee['as'],'attributes':_0xeb26ee['attributes'],'include':_0xeb26ee['include']?_[_0x8317('0x12')](_0xeb26ee['include'],function(_0x5c9517){return{'model':db[_0x5c9517[_0x8317('0x13')]],'as':_0x5c9517['as'],'attributes':_0x5c9517['attributes'],'include':_0x5c9517[_0x8317('0x11')]?_[_0x8317('0x12')](_0x5c9517[_0x8317('0x11')],function(_0x343b4d){return{'model':db[_0x343b4d[_0x8317('0x13')]],'as':_0x343b4d['as'],'attributes':_0x343b4d[_0x8317('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3acf2d){logger['info'](_0x8317('0x1b'),_0x5037af);logger[_0x8317('0x16')]('ShowSquareProject',_0x5037af,JSON[_0x8317('0x17')](_0x3acf2d));_0x35c1b7(_0x3acf2d);})[_0x8317('0x18')](function(_0x1c2dfa){logger[_0x8317('0x19')]('ShowSquareProject',_0x1c2dfa['message'],_0x5037af);_0x18866d(_0xffe53b[_0x8317('0x19')](0x1f4,_0x1c2dfa[_0x8317('0x1a')]));});});}; \ No newline at end of file +var _0x2833=['../../config/environment','redis','defaults','./squareProject.socket','register','findAll','options','raw','where','attributes','include','model','map','then','info','GetSquareProjects','debug','stringify','catch','message','error','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1f6c77,_0x837680){var _0x5e021d=function(_0x1a4998){while(--_0x1a4998){_0x1f6c77['push'](_0x1f6c77['shift']());}};_0x5e021d(++_0x837680);}(_0x2833,0x6b));var _0x3283=function(_0x156b70,_0x36f56e){_0x156b70=_0x156b70-0x0;var _0x5dcc58=_0x2833[_0x156b70];return _0x5dcc58;};'use strict';var _=require(_0x3283('0x0'));var Redis=require(_0x3283('0x1'));var db=require(_0x3283('0x2'))['db'];var logger=require(_0x3283('0x3'))(_0x3283('0x4'));var config=require(_0x3283('0x5'));config[_0x3283('0x6')]=_[_0x3283('0x7')](config[_0x3283('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3283('0x8'))[_0x3283('0x9')](socket);exports['GetSquareProjects']=function(_0xb8aabf){var _0x57fd82=this;return new Promise(function(_0x1f6723,_0x50fe68){return db['SquareProject'][_0x3283('0xa')]({'raw':_0xb8aabf[_0x3283('0xb')]?_0xb8aabf[_0x3283('0xb')][_0x3283('0xc')]===undefined?!![]:![]:!![],'where':_0xb8aabf[_0x3283('0xb')]?_0xb8aabf[_0x3283('0xb')][_0x3283('0xd')]||null:null,'attributes':_0xb8aabf[_0x3283('0xb')]?_0xb8aabf[_0x3283('0xb')][_0x3283('0xe')]||null:null,'limit':_0xb8aabf[_0x3283('0xb')]?_0xb8aabf[_0x3283('0xb')]['limit']||null:null,'include':_0xb8aabf[_0x3283('0xb')]?_0xb8aabf[_0x3283('0xb')]['include']?_['map'](_0xb8aabf['options'][_0x3283('0xf')],function(_0x3e217c){return{'model':db[_0x3e217c[_0x3283('0x10')]],'as':_0x3e217c['as'],'attributes':_0x3e217c[_0x3283('0xe')],'include':_0x3e217c[_0x3283('0xf')]?_[_0x3283('0x11')](_0x3e217c[_0x3283('0xf')],function(_0x380b75){return{'model':db[_0x380b75[_0x3283('0x10')]],'as':_0x380b75['as'],'attributes':_0x380b75[_0x3283('0xe')],'include':_0x380b75['include']?_[_0x3283('0x11')](_0x380b75['include'],function(_0x274c66){return{'model':db[_0x274c66[_0x3283('0x10')]],'as':_0x274c66['as'],'attributes':_0x274c66['attributes']};}):[]};}):[]};}):[]:[]})[_0x3283('0x12')](function(_0x38fba5){logger[_0x3283('0x13')](_0x3283('0x14'),_0xb8aabf);logger[_0x3283('0x15')](_0x3283('0x14'),_0xb8aabf,JSON[_0x3283('0x16')](_0x38fba5));_0x1f6723(_0x38fba5);})[_0x3283('0x17')](function(_0x713e58){logger['error']('GetSquareProjects',_0x713e58[_0x3283('0x18')],_0xb8aabf);_0x50fe68(_0x57fd82[_0x3283('0x19')](0x1f4,_0x713e58[_0x3283('0x18')]));});});};exports[_0x3283('0x1a')]=function(_0x3cb591){var _0x1e433c=this;return new Promise(function(_0x336796,_0x30f7c9){return db['SquareProject'][_0x3283('0x1b')]({'raw':_0x3cb591['options']?_0x3cb591[_0x3283('0xb')][_0x3283('0xc')]===undefined?!![]:![]:!![],'where':_0x3cb591[_0x3283('0xb')]?_0x3cb591[_0x3283('0xb')][_0x3283('0xd')]||null:null,'attributes':_0x3cb591[_0x3283('0xb')]?_0x3cb591[_0x3283('0xb')]['attributes']||null:null,'include':_0x3cb591[_0x3283('0xb')]?_0x3cb591[_0x3283('0xb')][_0x3283('0xf')]?_[_0x3283('0x11')](_0x3cb591[_0x3283('0xb')][_0x3283('0xf')],function(_0xee5188){return{'model':db[_0xee5188[_0x3283('0x10')]],'as':_0xee5188['as'],'attributes':_0xee5188['attributes'],'include':_0xee5188[_0x3283('0xf')]?_[_0x3283('0x11')](_0xee5188[_0x3283('0xf')],function(_0x410c8d){return{'model':db[_0x410c8d[_0x3283('0x10')]],'as':_0x410c8d['as'],'attributes':_0x410c8d[_0x3283('0xe')],'include':_0x410c8d['include']?_[_0x3283('0x11')](_0x410c8d[_0x3283('0xf')],function(_0x2a814b){return{'model':db[_0x2a814b['model']],'as':_0x2a814b['as'],'attributes':_0x2a814b[_0x3283('0xe')]};}):[]};}):[]};}):[]:[]})[_0x3283('0x12')](function(_0x30c819){logger['info'](_0x3283('0x1a'),_0x3cb591);logger['debug'](_0x3283('0x1a'),_0x3cb591,JSON[_0x3283('0x16')](_0x30c819));_0x336796(_0x30c819);})[_0x3283('0x17')](function(_0x30f3c2){logger[_0x3283('0x19')](_0x3283('0x1a'),_0x30f3c2[_0x3283('0x18')],_0x3cb591);_0x30f7c9(_0x1e433c[_0x3283('0x19')](0x1f4,_0x30f3c2['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 58b7a4e..7fe9c32 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 _0x997f=['save','remove','update','removeListener','register','squareProject:','./squareProject.events'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x997f,0xc3));var _0xf997=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x997f[_0x50007c];return _0x5c1ec7;};'use strict';var SquareProjectEvents=require(_0xf997('0x0'));var events=[_0xf997('0x1'),_0xf997('0x2'),_0xf997('0x3')];function createListener(_0x37b046,_0x106098){return function(_0x3a89eb){_0x106098['emit'](_0x37b046,_0x3a89eb);};}function removeListener(_0xe91766,_0x2848ca){return function(){SquareProjectEvents[_0xf997('0x4')](_0xe91766,_0x2848ca);};}exports[_0xf997('0x5')]=function(_0x19e2a2){for(var _0x2ab4a8=0x0,_0x56df7c=events['length'];_0x2ab4a8<_0x56df7c;_0x2ab4a8++){var _0x4a914e=events[_0x2ab4a8];var _0x322dc8=createListener(_0xf997('0x6')+_0x4a914e,_0x19e2a2);SquareProjectEvents['on'](_0x4a914e,_0x322dc8);}}; \ No newline at end of file +var _0x7e8c=['removeListener','register','./squareProject.events','remove','update','emit'];(function(_0x37d7e4,_0x3817e3){var _0xfc35d9=function(_0xff9687){while(--_0xff9687){_0x37d7e4['push'](_0x37d7e4['shift']());}};_0xfc35d9(++_0x3817e3);}(_0x7e8c,0x1be));var _0xc7e8=function(_0x2277b6,_0xdbebd7){_0x2277b6=_0x2277b6-0x0;var _0x4a12fa=_0x7e8c[_0x2277b6];return _0x4a12fa;};'use strict';var SquareProjectEvents=require(_0xc7e8('0x0'));var events=['save',_0xc7e8('0x1'),_0xc7e8('0x2')];function createListener(_0x2b3402,_0x4a84ed){return function(_0xeb1d27){_0x4a84ed[_0xc7e8('0x3')](_0x2b3402,_0xeb1d27);};}function removeListener(_0x3d8d36,_0x35cf13){return function(){SquareProjectEvents[_0xc7e8('0x4')](_0x3d8d36,_0x35cf13);};}exports[_0xc7e8('0x5')]=function(_0x91c223){for(var _0x3789d0=0x0,_0x658286=events['length'];_0x3789d0<_0x658286;_0x3789d0++){var _0x8cc4de=events[_0x3789d0];var _0x17809b=createListener('squareProject:'+_0x8cc4de,_0x91c223);SquareProjectEvents['on'](_0x8cc4de,_0x17809b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 68e1f27..126de87 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30c28,_0xb2caaa){var _0x4b4701=function(_0x2ec220){while(--_0x2ec220){_0x30c28['push'](_0x30c28['shift']());}};_0x4b4701(++_0xb2caaa);}(_0xf494,0x1c6));var _0x4f49=function(_0x4e5622,_0x4b41a0){_0x4e5622=_0x4e5622-0x0;var _0x1e9995=_0xf494[_0x4e5622];return _0x1e9995;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0xdb5b5a,_0x31866d){var _0x2b7246=function(_0x406fb8){while(--_0x406fb8){_0xdb5b5a['push'](_0xdb5b5a['shift']());}};_0x2b7246(++_0x31866d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x5fc3[_0x3b711c];return _0x2685f0;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index d33d152..177595e 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 _0xda19=['getDataValue','exports','STRING','VIRTUAL'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xda19,0xd5));var _0x9da1=function(_0x5a8281,_0x3f6be7){_0x5a8281=_0x5a8281-0x0;var _0x49c418=_0xda19[_0x5a8281];return _0x49c418;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'uniqueid':{'type':Sequelize[_0x9da1('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9da1('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'dnid':{'type':Sequelize[_0x9da1('0x1')]},'projectName':{'type':Sequelize[_0x9da1('0x1')]},'saveName':{'type':Sequelize[_0x9da1('0x1')]},'filename':{'type':Sequelize[_0x9da1('0x1')]},'savePath':{'type':Sequelize[_0x9da1('0x1')]},'format':{'type':Sequelize[_0x9da1('0x2')],'get':function(){var _0x2c3cdd='';var _0x1c24e6=this[_0x9da1('0x3')]('savePath');if(_0x1c24e6){_0x2c3cdd=_0x1c24e6['substring'](_0x1c24e6['lastIndexOf']('.'));}return _0x2c3cdd;}}}; \ No newline at end of file +var _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x53569a,_0x3647ae){var _0x11e4ba=function(_0x28976b){while(--_0x28976b){_0x53569a['push'](_0x53569a['shift']());}};_0x11e4ba(++_0x3647ae);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf2ca[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c20a703..b39569c 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 _0x574d=['model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','params','options','create','body','download','uniqueid','find','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x574d,0x1a1));var _0xd574=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x574d[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xd574('0x0'));var rimraf=require(_0xd574('0x1'));var zipdir=require(_0xd574('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd574('0x3'));var Mustache=require('mustache');var util=require(_0xd574('0x4'));var path=require(_0xd574('0x5'));var sox=require(_0xd574('0x6'));var csv=require(_0xd574('0x7'));var ejs=require(_0xd574('0x8'));var fs=require('fs');var fs_extra=require(_0xd574('0x9'));var _=require(_0xd574('0xa'));var squel=require('squel');var crypto=require(_0xd574('0xb'));var jsforce=require(_0xd574('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd574('0x7'));var querystring=require(_0xd574('0xd'));var Papa=require(_0xd574('0xe'));var Redis=require(_0xd574('0xf'));var authService=require(_0xd574('0x10'));var qs=require(_0xd574('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd574('0x12'));var logger=require('../../config/logger')(_0xd574('0x13'));var utils=require('../../config/utils');var config=require(_0xd574('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd574('0x15'))['db'];function respondWithStatusCode(_0x44f3f0,_0x1df9f8){_0x1df9f8=_0x1df9f8||0xcc;return function(_0x150a83){if(_0x150a83){return _0x44f3f0[_0xd574('0x16')](_0x1df9f8);}return _0x44f3f0[_0xd574('0x17')](_0x1df9f8)[_0xd574('0x18')]();};}function respondWithResult(_0x475b74,_0x202285){_0x202285=_0x202285||0xc8;return function(_0x187c12){if(_0x187c12){return _0x475b74[_0xd574('0x17')](_0x202285)['json'](_0x187c12);}};}function respondWithFilteredResult(_0x5b44cd,_0x27fd14){return function(_0x20c43e){if(_0x20c43e){var _0x48ffeb=typeof _0x27fd14[_0xd574('0x19')]==='undefined'&&typeof _0x27fd14['limit']===_0xd574('0x1a');var _0x8c7c7a=_0x20c43e['count'];var _0x4b2cd2=_0x48ffeb?0x0:_0x27fd14[_0xd574('0x19')];var _0x44d5af=_0x48ffeb?_0x20c43e[_0xd574('0x1b')]:_0x27fd14['offset']+_0x27fd14[_0xd574('0x1c')];var _0x1a8221;if(_0x44d5af>=_0x8c7c7a){_0x44d5af=_0x8c7c7a;_0x1a8221=0xc8;}else{_0x1a8221=0xce;}_0x5b44cd[_0xd574('0x17')](_0x1a8221);return _0x5b44cd[_0xd574('0x1d')]('Content-Range',_0x4b2cd2+'-'+_0x44d5af+'/'+_0x8c7c7a)[_0xd574('0x1e')](_0x20c43e);}return null;};}function patchUpdates(_0x47f162){return function(_0x5951c3){try{jsonpatch[_0xd574('0x1f')](_0x5951c3,_0x47f162,!![]);}catch(_0x5ac1ce){return BPromise[_0xd574('0x20')](_0x5ac1ce);}return _0x5951c3[_0xd574('0x21')]();};}function saveUpdates(_0x45749e,_0x5b3efb){return function(_0x5f1a81){if(_0x5f1a81){return _0x5f1a81[_0xd574('0x22')](_0x45749e)[_0xd574('0x23')](function(_0x423b27){return _0x423b27;});}return null;};}function removeEntity(_0x4467ff,_0x40d4f4){return function(_0x21d422){if(_0x21d422){return _0x21d422[_0xd574('0x24')]()[_0xd574('0x23')](function(){_0x4467ff[_0xd574('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49faff,_0x24b3ed){return function(_0x224690){if(!_0x224690){_0x49faff[_0xd574('0x16')](0x194);}return _0x224690;};}function handleError(_0x37f71e,_0x1a6a59){_0x1a6a59=_0x1a6a59||0x1f4;return function(_0x4b45d3){logger[_0xd574('0x25')](_0x4b45d3[_0xd574('0x26')]);if(_0x4b45d3[_0xd574('0x27')]){delete _0x4b45d3['name'];}_0x37f71e['status'](_0x1a6a59)[_0xd574('0x28')](_0x4b45d3);};}exports[_0xd574('0x29')]=function(_0x192d7a,_0x31219f){var _0x17a329={},_0x5772ba={},_0x4a9c5f={'count':0x0,'rows':[]};var _0x3f7f2f=_[_0xd574('0x2a')](db[_0xd574('0x2b')][_0xd574('0x2c')],function(_0x3e7ebe){return{'name':_0x3e7ebe[_0xd574('0x2d')],'type':_0x3e7ebe[_0xd574('0x2e')][_0xd574('0x2f')]};});_0x5772ba[_0xd574('0x30')]=_['map'](_0x3f7f2f,_0xd574('0x27'));_0x5772ba[_0xd574('0x31')]=_[_0xd574('0x32')](_0x192d7a[_0xd574('0x31')]);_0x5772ba[_0xd574('0x33')]=_[_0xd574('0x34')](_0x5772ba['model'],_0x5772ba[_0xd574('0x31')]);_0x17a329[_0xd574('0x35')]=_['intersection'](_0x5772ba['model'],qs[_0xd574('0x36')](_0x192d7a[_0xd574('0x31')][_0xd574('0x36')]));_0x17a329[_0xd574('0x35')]=_0x17a329[_0xd574('0x35')][_0xd574('0x37')]?_0x17a329[_0xd574('0x35')]:_0x5772ba[_0xd574('0x30')];if(!_0x192d7a[_0xd574('0x31')]['hasOwnProperty'](_0xd574('0x38'))){_0x17a329[_0xd574('0x1c')]=qs[_0xd574('0x1c')](_0x192d7a[_0xd574('0x31')][_0xd574('0x1c')]);_0x17a329[_0xd574('0x19')]=qs[_0xd574('0x19')](_0x192d7a[_0xd574('0x31')]['offset']);}_0x17a329[_0xd574('0x39')]=qs[_0xd574('0x3a')](_0x192d7a['query'][_0xd574('0x3a')]);_0x17a329[_0xd574('0x3b')]=qs[_0xd574('0x33')](_[_0xd574('0x3c')](_0x192d7a[_0xd574('0x31')],_0x5772ba[_0xd574('0x33')]),_0x3f7f2f);if(_0x192d7a[_0xd574('0x31')][_0xd574('0x3d')]){_0x17a329[_0xd574('0x3b')]=_['merge'](_0x17a329[_0xd574('0x3b')],{'$or':_[_0xd574('0x2a')](_0x3f7f2f,function(_0x2113b5){if(_0x2113b5[_0xd574('0x2e')]!=='VIRTUAL'){var _0x2e6976={};_0x2e6976[_0x2113b5[_0xd574('0x27')]]={'$like':'%'+_0x192d7a[_0xd574('0x31')][_0xd574('0x3d')]+'%'};return _0x2e6976;}})});}_0x17a329=_['merge']({},_0x17a329,_0x192d7a['options']);var _0x29c008={'where':_0x17a329[_0xd574('0x3b')]};return db['SquareRecording']['count'](_0x29c008)[_0xd574('0x23')](function(_0xd13f19){_0x4a9c5f[_0xd574('0x1b')]=_0xd13f19;if(_0x192d7a[_0xd574('0x31')][_0xd574('0x3e')]){_0x17a329[_0xd574('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0xd574('0x40')](_0x17a329);})['then'](function(_0x119da6){_0x4a9c5f[_0xd574('0x41')]=_0x119da6;return _0x4a9c5f;})[_0xd574('0x23')](respondWithFilteredResult(_0x31219f,_0x17a329))[_0xd574('0x42')](handleError(_0x31219f,null));};exports['show']=function(_0xac635e,_0x3ea330){var _0x16befd={'raw':!![],'where':{'id':_0xac635e[_0xd574('0x43')]['id']}},_0x5c1ea3={};_0x5c1ea3[_0xd574('0x30')]=_[_0xd574('0x32')](db[_0xd574('0x2b')][_0xd574('0x2c')]);_0x5c1ea3[_0xd574('0x31')]=_[_0xd574('0x32')](_0xac635e[_0xd574('0x31')]);_0x5c1ea3[_0xd574('0x33')]=_[_0xd574('0x34')](_0x5c1ea3[_0xd574('0x30')],_0x5c1ea3[_0xd574('0x31')]);_0x16befd[_0xd574('0x35')]=_[_0xd574('0x34')](_0x5c1ea3[_0xd574('0x30')],qs['fields'](_0xac635e[_0xd574('0x31')]['fields']));_0x16befd[_0xd574('0x35')]=_0x16befd['attributes'][_0xd574('0x37')]?_0x16befd[_0xd574('0x35')]:_0x5c1ea3['model'];if(_0xac635e['query'][_0xd574('0x3e')]){_0x16befd[_0xd574('0x3f')]=[{'all':!![]}];}_0x16befd=_['merge']({},_0x16befd,_0xac635e[_0xd574('0x44')]);return db['SquareRecording']['find'](_0x16befd)[_0xd574('0x23')](handleEntityNotFound(_0x3ea330,null))[_0xd574('0x23')](respondWithResult(_0x3ea330,null))[_0xd574('0x42')](handleError(_0x3ea330,null));};exports[_0xd574('0x45')]=function(_0x54cb5e,_0x3df7e9){return db[_0xd574('0x2b')]['create'](_0x54cb5e['body'],{})[_0xd574('0x23')](respondWithResult(_0x3df7e9,0xc9))[_0xd574('0x42')](handleError(_0x3df7e9,null));};exports[_0xd574('0x22')]=function(_0x6c47b2,_0x42ec50){if(_0x6c47b2['body']['id']){delete _0x6c47b2['body']['id'];}return db[_0xd574('0x2b')]['find']({'where':{'id':_0x6c47b2[_0xd574('0x43')]['id']}})[_0xd574('0x23')](handleEntityNotFound(_0x42ec50,null))[_0xd574('0x23')](saveUpdates(_0x6c47b2[_0xd574('0x46')],null))[_0xd574('0x23')](respondWithResult(_0x42ec50,null))[_0xd574('0x42')](handleError(_0x42ec50,null));};exports[_0xd574('0x47')]=function(_0xc462a6,_0x48c333,_0x4233c5){var _0x28e83a=require('../../components/encryptor');var _0x14313f=![];var _0xb17bcf={};if(_0xc462a6[_0xd574('0x31')][_0xd574('0x2e')]&&_0xc462a6['query'][_0xd574('0x2e')]==='uniqueid'){_0xb17bcf[_0xd574('0x48')]=_0xc462a6[_0xd574('0x43')]['id'];}else{_0xb17bcf['id']=_0xc462a6['params']['id'];}return db[_0xd574('0x2b')][_0xd574('0x49')]({'where':_0xb17bcf,'attributes':['id',_0xd574('0x4a'),_0xd574('0x4b')],'raw':!![]})[_0xd574('0x23')](handleEntityNotFound(_0x48c333,null))[_0xd574('0x23')](function(_0x5f11b3){if(_0x5f11b3){var _0x1c5068=_0x5f11b3[_0xd574('0x4a')];var _0x57ba8b=util[_0xd574('0x4c')](_0xd574('0x4d'),_0x1c5068);if(fs[_0xd574('0x4e')](_0x57ba8b)){_0x14313f=!![];return _0x28e83a[_0xd574('0x4f')](_0x57ba8b,_0x1c5068,config['secrets'][_0xd574('0x50')])['then'](function(){return _0x5f11b3;});}return _0x5f11b3;}})['then'](function(_0x531a2e){if(_0x531a2e){var _0x32979d=_0x531a2e[_0xd574('0x4a')];if(!fs[_0xd574('0x4e')](_0x32979d)){throw new db[(_0xd574('0x51'))][(_0xd574('0x52'))](_0xd574('0x53'));}if(_0x531a2e['filename']){return _0x48c333[_0xd574('0x47')](_0x32979d,_0x531a2e['filename']+path[_0xd574('0x54')](_0x32979d),function(){if(_0x14313f){fs[_0xd574('0x55')](_0x32979d);}});}else{return _0x48c333[_0xd574('0x47')](_0x32979d,function(_0x109d48){if(_0x14313f){fs[_0xd574('0x55')](_0x32979d);}});}}})[_0xd574('0x42')](function(_0x3bb01a){if(_0x3bb01a[_0xd574('0x56')]==='SquareRecording\x20not\x20found'){_0x48c333[_0xd574('0x17')](0x194)[_0xd574('0x28')]('Not\x20found');}else{return handleError(_0x48c333,null);}});};exports[_0xd574('0x24')]=function(_0x2358e1,_0x2c2fdd){return db[_0xd574('0x2b')][_0xd574('0x49')]({'where':{'id':_0x2358e1['params']['id']}})[_0xd574('0x23')](function(_0x55b20e){if(_[_0xd574('0x57')](_0x55b20e)){throw new ReferenceError(_0xd574('0x58'));}return _0x55b20e;})['then'](function(_0xe831db){var _0x18c025=_0xe831db['savePath'];logger[_0xd574('0x59')]('cancellazione\x20fisica\x20documento\x20%s',_0x18c025);if(!_['isNil'](_0xe831db[_0xd574('0x4a')])&&fs[_0xd574('0x4e')](_0x18c025)){logger[_0xd574('0x59')](_0xd574('0x5a')+_0x18c025+_0xd574('0x5b'));fs[_0xd574('0x5c')](_0x18c025);}_0x18c025=_0x18c025+'.cypher';if(!_[_0xd574('0x57')](_0xe831db['savePath'])&&fs[_0xd574('0x4e')](_0x18c025)){logger[_0xd574('0x59')](_0xd574('0x5a')+_0x18c025+_0xd574('0x5b'));fs['unlinkSync'](_0x18c025);}return _0xe831db;})[_0xd574('0x23')](function(_0x3e85e5){if(!_0x3e85e5)throw new InternalError();return _0x3e85e5[_0xd574('0x24')]();})['then'](function(){_0x2c2fdd['status'](0xcc)[_0xd574('0x18')]();})['catch'](handleError(_0x2c2fdd,null));}; \ No newline at end of file +var _0xb611=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','map','SquareRecording','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xb611,0x1c8));var _0x1b61=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xb611[_0x5d7227];return _0x15ac55;};'use strict';var emlformat=require(_0x1b61('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b61('0x1'));var rp=require('request-promise');var moment=require(_0x1b61('0x2'));var BPromise=require(_0x1b61('0x3'));var Mustache=require('mustache');var util=require(_0x1b61('0x4'));var path=require(_0x1b61('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b61('0x6'));var _=require(_0x1b61('0x7'));var squel=require('squel');var crypto=require(_0x1b61('0x8'));var jsforce=require(_0x1b61('0x9'));var deskjs=require(_0x1b61('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1b61('0xb'));var Papa=require('papaparse');var Redis=require(_0x1b61('0xc'));var authService=require(_0x1b61('0xd'));var qs=require(_0x1b61('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b61('0xf'));var logger=require(_0x1b61('0x10'))(_0x1b61('0x11'));var utils=require(_0x1b61('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1b61('0x13'));var db=require(_0x1b61('0x14'))['db'];function respondWithStatusCode(_0x5d7f01,_0x3f3ad7){_0x3f3ad7=_0x3f3ad7||0xcc;return function(_0x425377){if(_0x425377){return _0x5d7f01[_0x1b61('0x15')](_0x3f3ad7);}return _0x5d7f01[_0x1b61('0x16')](_0x3f3ad7)[_0x1b61('0x17')]();};}function respondWithResult(_0xcbf1c2,_0x5e48c8){_0x5e48c8=_0x5e48c8||0xc8;return function(_0x397eae){if(_0x397eae){return _0xcbf1c2[_0x1b61('0x16')](_0x5e48c8)[_0x1b61('0x18')](_0x397eae);}};}function respondWithFilteredResult(_0x186325,_0x2059f6){return function(_0x394a68){if(_0x394a68){var _0x2e151e=typeof _0x2059f6['offset']===_0x1b61('0x19')&&typeof _0x2059f6[_0x1b61('0x1a')]==='undefined';var _0x4dc289=_0x394a68[_0x1b61('0x1b')];var _0x36f600=_0x2e151e?0x0:_0x2059f6[_0x1b61('0x1c')];var _0xee8900=_0x2e151e?_0x394a68['count']:_0x2059f6[_0x1b61('0x1c')]+_0x2059f6[_0x1b61('0x1a')];var _0x4a4d4c;if(_0xee8900>=_0x4dc289){_0xee8900=_0x4dc289;_0x4a4d4c=0xc8;}else{_0x4a4d4c=0xce;}_0x186325[_0x1b61('0x16')](_0x4a4d4c);return _0x186325[_0x1b61('0x1d')]('Content-Range',_0x36f600+'-'+_0xee8900+'/'+_0x4dc289)[_0x1b61('0x18')](_0x394a68);}return null;};}function patchUpdates(_0xa20b56){return function(_0x420475){try{jsonpatch[_0x1b61('0x1e')](_0x420475,_0xa20b56,!![]);}catch(_0x12d623){return BPromise[_0x1b61('0x1f')](_0x12d623);}return _0x420475[_0x1b61('0x20')]();};}function saveUpdates(_0x384b73,_0x197fcd){return function(_0xc19a08){if(_0xc19a08){return _0xc19a08[_0x1b61('0x21')](_0x384b73)[_0x1b61('0x22')](function(_0x14f2fc){return _0x14f2fc;});}return null;};}function removeEntity(_0x164efe,_0x5ce629){return function(_0x30f2f9){if(_0x30f2f9){return _0x30f2f9[_0x1b61('0x23')]()[_0x1b61('0x22')](function(){_0x164efe[_0x1b61('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c226,_0x41bb8d){return function(_0x333655){if(!_0x333655){_0x22c226[_0x1b61('0x15')](0x194);}return _0x333655;};}function handleError(_0x3894d6,_0x2677f2){_0x2677f2=_0x2677f2||0x1f4;return function(_0x3cbf4f){logger['error'](_0x3cbf4f[_0x1b61('0x24')]);if(_0x3cbf4f[_0x1b61('0x25')]){delete _0x3cbf4f['name'];}_0x3894d6[_0x1b61('0x16')](_0x2677f2)['send'](_0x3cbf4f);};}exports['index']=function(_0x1e5193,_0x46973d){var _0x3b44a7={},_0x181a6a={},_0x3787a2={'count':0x0,'rows':[]};var _0xff7027=_[_0x1b61('0x26')](db[_0x1b61('0x27')]['rawAttributes'],function(_0x4e5017){return{'name':_0x4e5017[_0x1b61('0x28')],'type':_0x4e5017[_0x1b61('0x29')][_0x1b61('0x2a')]};});_0x181a6a['model']=_[_0x1b61('0x26')](_0xff7027,'name');_0x181a6a[_0x1b61('0x2b')]=_[_0x1b61('0x2c')](_0x1e5193[_0x1b61('0x2b')]);_0x181a6a['filters']=_['intersection'](_0x181a6a[_0x1b61('0x2d')],_0x181a6a['query']);_0x3b44a7[_0x1b61('0x2e')]=_[_0x1b61('0x2f')](_0x181a6a[_0x1b61('0x2d')],qs[_0x1b61('0x30')](_0x1e5193[_0x1b61('0x2b')][_0x1b61('0x30')]));_0x3b44a7[_0x1b61('0x2e')]=_0x3b44a7[_0x1b61('0x2e')][_0x1b61('0x31')]?_0x3b44a7['attributes']:_0x181a6a[_0x1b61('0x2d')];if(!_0x1e5193[_0x1b61('0x2b')][_0x1b61('0x32')](_0x1b61('0x33'))){_0x3b44a7['limit']=qs['limit'](_0x1e5193['query'][_0x1b61('0x1a')]);_0x3b44a7[_0x1b61('0x1c')]=qs[_0x1b61('0x1c')](_0x1e5193[_0x1b61('0x2b')]['offset']);}_0x3b44a7[_0x1b61('0x34')]=qs['sort'](_0x1e5193['query'][_0x1b61('0x35')]);_0x3b44a7[_0x1b61('0x36')]=qs[_0x1b61('0x37')](_[_0x1b61('0x38')](_0x1e5193[_0x1b61('0x2b')],_0x181a6a[_0x1b61('0x37')]),_0xff7027);if(_0x1e5193[_0x1b61('0x2b')][_0x1b61('0x39')]){_0x3b44a7['where']=_['merge'](_0x3b44a7[_0x1b61('0x36')],{'$or':_[_0x1b61('0x26')](_0xff7027,function(_0x56a8bd){if(_0x56a8bd[_0x1b61('0x29')]!==_0x1b61('0x3a')){var _0x5848d2={};_0x5848d2[_0x56a8bd[_0x1b61('0x25')]]={'$like':'%'+_0x1e5193['query']['filter']+'%'};return _0x5848d2;}})});}_0x3b44a7=_['merge']({},_0x3b44a7,_0x1e5193[_0x1b61('0x3b')]);var _0x3293b6={'where':_0x3b44a7['where']};return db[_0x1b61('0x27')][_0x1b61('0x1b')](_0x3293b6)[_0x1b61('0x22')](function(_0x1b73ac){_0x3787a2['count']=_0x1b73ac;if(_0x1e5193['query'][_0x1b61('0x3c')]){_0x3b44a7[_0x1b61('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x1b61('0x3e')](_0x3b44a7);})[_0x1b61('0x22')](function(_0x3720b7){_0x3787a2['rows']=_0x3720b7;return _0x3787a2;})[_0x1b61('0x22')](respondWithFilteredResult(_0x46973d,_0x3b44a7))[_0x1b61('0x3f')](handleError(_0x46973d,null));};exports[_0x1b61('0x40')]=function(_0x13066c,_0x3c5401){var _0xc457ec={'raw':!![],'where':{'id':_0x13066c[_0x1b61('0x41')]['id']}},_0x18dc1d={};_0x18dc1d[_0x1b61('0x2d')]=_[_0x1b61('0x2c')](db[_0x1b61('0x27')][_0x1b61('0x42')]);_0x18dc1d['query']=_[_0x1b61('0x2c')](_0x13066c['query']);_0x18dc1d[_0x1b61('0x37')]=_['intersection'](_0x18dc1d[_0x1b61('0x2d')],_0x18dc1d['query']);_0xc457ec[_0x1b61('0x2e')]=_[_0x1b61('0x2f')](_0x18dc1d['model'],qs['fields'](_0x13066c[_0x1b61('0x2b')][_0x1b61('0x30')]));_0xc457ec[_0x1b61('0x2e')]=_0xc457ec[_0x1b61('0x2e')][_0x1b61('0x31')]?_0xc457ec[_0x1b61('0x2e')]:_0x18dc1d[_0x1b61('0x2d')];if(_0x13066c[_0x1b61('0x2b')][_0x1b61('0x3c')]){_0xc457ec['include']=[{'all':!![]}];}_0xc457ec=_[_0x1b61('0x43')]({},_0xc457ec,_0x13066c[_0x1b61('0x3b')]);return db[_0x1b61('0x27')][_0x1b61('0x44')](_0xc457ec)[_0x1b61('0x22')](handleEntityNotFound(_0x3c5401,null))[_0x1b61('0x22')](respondWithResult(_0x3c5401,null))[_0x1b61('0x3f')](handleError(_0x3c5401,null));};exports['create']=function(_0x36f728,_0x1cc681){return db['SquareRecording'][_0x1b61('0x45')](_0x36f728[_0x1b61('0x46')],{})[_0x1b61('0x22')](respondWithResult(_0x1cc681,0xc9))[_0x1b61('0x3f')](handleError(_0x1cc681,null));};exports[_0x1b61('0x21')]=function(_0xa30b02,_0x3a2d87){if(_0xa30b02[_0x1b61('0x46')]['id']){delete _0xa30b02['body']['id'];}return db[_0x1b61('0x27')]['find']({'where':{'id':_0xa30b02[_0x1b61('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a2d87,null))['then'](saveUpdates(_0xa30b02[_0x1b61('0x46')],null))[_0x1b61('0x22')](respondWithResult(_0x3a2d87,null))[_0x1b61('0x3f')](handleError(_0x3a2d87,null));};exports[_0x1b61('0x47')]=function(_0x1d5ed7,_0x5b1606,_0x1a369e){var _0x429f4e=require(_0x1b61('0x48'));var _0xac080=![];var _0x8126a1={};if(_0x1d5ed7[_0x1b61('0x2b')][_0x1b61('0x29')]&&_0x1d5ed7[_0x1b61('0x2b')][_0x1b61('0x29')]==='uniqueid'){_0x8126a1[_0x1b61('0x49')]=_0x1d5ed7['params']['id'];}else{_0x8126a1['id']=_0x1d5ed7[_0x1b61('0x41')]['id'];}return db[_0x1b61('0x27')][_0x1b61('0x44')]({'where':_0x8126a1,'attributes':['id',_0x1b61('0x4a'),'filename'],'raw':!![]})[_0x1b61('0x22')](handleEntityNotFound(_0x5b1606,null))[_0x1b61('0x22')](function(_0x2d167a){if(_0x2d167a){var _0x2dfeca=_0x2d167a[_0x1b61('0x4a')];var _0x2819e6=util[_0x1b61('0x4b')](_0x1b61('0x4c'),_0x2dfeca);if(fs[_0x1b61('0x4d')](_0x2819e6)){_0xac080=!![];return _0x429f4e[_0x1b61('0x4e')](_0x2819e6,_0x2dfeca,config[_0x1b61('0x4f')][_0x1b61('0x50')])[_0x1b61('0x22')](function(){return _0x2d167a;});}return _0x2d167a;}})[_0x1b61('0x22')](function(_0x1c7559){if(_0x1c7559){var _0x4da2b9=_0x1c7559[_0x1b61('0x4a')];if(!fs[_0x1b61('0x4d')](_0x4da2b9)){throw new db[(_0x1b61('0x51'))][(_0x1b61('0x52'))](_0x1b61('0x53'));}if(_0x1c7559['filename']){return _0x5b1606[_0x1b61('0x47')](_0x4da2b9,_0x1c7559['filename']+path[_0x1b61('0x54')](_0x4da2b9),function(){if(_0xac080){fs[_0x1b61('0x55')](_0x4da2b9);}});}else{return _0x5b1606['download'](_0x4da2b9,function(_0x28e66c){if(_0xac080){fs[_0x1b61('0x55')](_0x4da2b9);}});}}})[_0x1b61('0x3f')](function(_0x157517){if(_0x157517[_0x1b61('0x56')]===_0x1b61('0x53')){_0x5b1606[_0x1b61('0x16')](0x194)['send']('Not\x20found');}else{return handleError(_0x5b1606,null);}});};exports[_0x1b61('0x23')]=function(_0x4d1feb,_0x101700){return db['SquareRecording'][_0x1b61('0x44')]({'where':{'id':_0x4d1feb[_0x1b61('0x41')]['id']}})['then'](function(_0x3368c9){if(_[_0x1b61('0x57')](_0x3368c9)){throw new ReferenceError(_0x1b61('0x58'));}return _0x3368c9;})[_0x1b61('0x22')](function(_0x933596){var _0x434027=_0x933596[_0x1b61('0x4a')];logger[_0x1b61('0x59')](_0x1b61('0x5a'),_0x434027);if(!_['isNil'](_0x933596[_0x1b61('0x4a')])&&fs[_0x1b61('0x4d')](_0x434027)){logger['info'](_0x1b61('0x5b')+_0x434027+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1b61('0x5c')](_0x434027);}_0x434027=_0x434027+_0x1b61('0x5d');if(!_[_0x1b61('0x57')](_0x933596[_0x1b61('0x4a')])&&fs[_0x1b61('0x4d')](_0x434027)){logger['info'](_0x1b61('0x5b')+_0x434027+_0x1b61('0x5e'));fs[_0x1b61('0x5c')](_0x434027);}return _0x933596;})[_0x1b61('0x22')](function(_0x57c6ec){if(!_0x57c6ec)throw new InternalError();return _0x57c6ec[_0x1b61('0x23')]();})[_0x1b61('0x22')](function(){_0x101700['status'](0xcc)[_0x1b61('0x17')]();})['catch'](handleError(_0x101700,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4ae48f2..9104c3e 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 _0x63a6=['rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','util','../../config/logger','moment','bluebird','path'];(function(_0x40cc9f,_0x105496){var _0x5895c9=function(_0x197924){while(--_0x197924){_0x40cc9f['push'](_0x40cc9f['shift']());}};_0x5895c9(++_0x105496);}(_0x63a6,0x1c7));var _0x663a=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x63a6[_0x2a7210];return _0x460766;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cfd=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording','../../config/logger','api'];(function(_0x41affa,_0x2e1230){var _0xad894d=function(_0x4dba10){while(--_0x4dba10){_0x41affa['push'](_0x41affa['shift']());}};_0xad894d(++_0x2e1230);}(_0x6cfd,0x1b7));var _0xd6cf=function(_0x1eeff6,_0x340765){_0x1eeff6=_0x1eeff6-0x0;var _0x58ec17=_0x6cfd[_0x1eeff6];return _0x58ec17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6cf('0x0'))(_0xd6cf('0x1'));var moment=require(_0xd6cf('0x2'));var BPromise=require(_0xd6cf('0x3'));var rp=require(_0xd6cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6cf('0x5'));var config=require(_0xd6cf('0x6'));var attributes=require(_0xd6cf('0x7'));module['exports']=function(_0x517713,_0x1681fc){return _0x517713['define'](_0xd6cf('0x8'),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 e0f3672..57e5e34 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 _0x1c60=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','moment','bluebird'];(function(_0x4acab0,_0x221db9){var _0x587ad4=function(_0x4c7162){while(--_0x4c7162){_0x4acab0['push'](_0x4acab0['shift']());}};_0x587ad4(++_0x221db9);}(_0x1c60,0xb9));var _0x01c6=function(_0x5d3550,_0x107033){_0x5d3550=_0x5d3550-0x0;var _0x5d1299=_0x1c60[_0x5d3550];return _0x5d1299;};'use strict';var _=require(_0x01c6('0x0'));var util=require(_0x01c6('0x1'));var moment=require(_0x01c6('0x2'));var BPromise=require(_0x01c6('0x3'));var rs=require(_0x01c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01c6('0x6'))(_0x01c6('0x7'));var config=require('../../config/environment');var jayson=require(_0x01c6('0x8'));var client=jayson[_0x01c6('0x9')][_0x01c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa9060e,_0x39d1e7,_0x3d50a1){return new BPromise(function(_0x4f094c,_0x2171c7){return client[_0x01c6('0xb')](_0xa9060e,_0x3d50a1)[_0x01c6('0xc')](function(_0xbd2a49){logger[_0x01c6('0xd')](_0x01c6('0xe'),_0x39d1e7,_0x01c6('0xf'));logger[_0x01c6('0x10')](_0x01c6('0x11'),_0x39d1e7,'request\x20sent',JSON[_0x01c6('0x12')](_0xbd2a49));if(_0xbd2a49[_0x01c6('0x13')]){if(_0xbd2a49[_0x01c6('0x13')]['code']===0x1f4){logger[_0x01c6('0x13')](_0x01c6('0xe'),_0x39d1e7,_0xbd2a49['error'][_0x01c6('0x14')]);return _0x2171c7(_0xbd2a49[_0x01c6('0x13')][_0x01c6('0x14')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x39d1e7,_0xbd2a49['error'][_0x01c6('0x14')]);return _0x4f094c(_0xbd2a49['error'][_0x01c6('0x14')]);}else{logger[_0x01c6('0xd')](_0x01c6('0xe'),_0x39d1e7,_0x01c6('0xf'));_0x4f094c(_0xbd2a49['result'][_0x01c6('0x14')]);}})[_0x01c6('0x15')](function(_0x35dff3){logger[_0x01c6('0x13')]('SquareRecording,\x20%s,\x20%s',_0x39d1e7,_0x35dff3);_0x2171c7(_0x35dff3);});});}exports[_0x01c6('0x16')]=function(_0x3c31fa){var _0x3926bd=this;return new Promise(function(_0x1a4074,_0x534ab0){return db[_0x01c6('0x17')][_0x01c6('0x18')](_0x3c31fa['body'],{'raw':_0x3c31fa[_0x01c6('0x19')]?_0x3c31fa[_0x01c6('0x19')][_0x01c6('0x1a')]===undefined?!![]:![]:!![]})[_0x01c6('0xc')](function(_0x2c327b){logger['info'](_0x01c6('0x16'),_0x3c31fa);logger['debug'](_0x01c6('0x16'),_0x3c31fa,JSON[_0x01c6('0x12')](_0x2c327b));_0x1a4074(_0x2c327b);})[_0x01c6('0x15')](function(_0x311afe){logger[_0x01c6('0x13')](_0x01c6('0x16'),_0x311afe['message'],_0x3c31fa);_0x534ab0(_0x3926bd[_0x01c6('0x13')](0x1f4,_0x311afe[_0x01c6('0x14')]));});});}; \ No newline at end of file +var _0xfc5e=['body','options','then','CreateSquareRecording','lodash','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','create'];(function(_0x331ce0,_0xe335b9){var _0x31c3c7=function(_0x2bf43c){while(--_0x2bf43c){_0x331ce0['push'](_0x331ce0['shift']());}};_0x31c3c7(++_0xe335b9);}(_0xfc5e,0x1df));var _0xefc5=function(_0xfa472e,_0xa1535){_0xfa472e=_0xfa472e-0x0;var _0x87c347=_0xfc5e[_0xfa472e];return _0x87c347;};'use strict';var _=require(_0xefc5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xefc5('0x1'));var fs=require('fs');var Redis=require(_0xefc5('0x2'));var db=require(_0xefc5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xefc5('0x4'));var client=jayson[_0xefc5('0x5')][_0xefc5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2b79c3,_0xb85022,_0x37acbe){return new BPromise(function(_0x129ab4,_0x3f51be){return client[_0xefc5('0x7')](_0x2b79c3,_0x37acbe)['then'](function(_0x7d8090){logger[_0xefc5('0x8')](_0xefc5('0x9'),_0xb85022,_0xefc5('0xa'));logger[_0xefc5('0xb')](_0xefc5('0xc'),_0xb85022,_0xefc5('0xa'),JSON[_0xefc5('0xd')](_0x7d8090));if(_0x7d8090[_0xefc5('0xe')]){if(_0x7d8090[_0xefc5('0xe')][_0xefc5('0xf')]===0x1f4){logger[_0xefc5('0xe')](_0xefc5('0x9'),_0xb85022,_0x7d8090['error']['message']);return _0x3f51be(_0x7d8090[_0xefc5('0xe')][_0xefc5('0x10')]);}logger[_0xefc5('0xe')](_0xefc5('0x9'),_0xb85022,_0x7d8090[_0xefc5('0xe')]['message']);return _0x129ab4(_0x7d8090[_0xefc5('0xe')]['message']);}else{logger[_0xefc5('0x8')](_0xefc5('0x9'),_0xb85022,_0xefc5('0xa'));_0x129ab4(_0x7d8090[_0xefc5('0x11')][_0xefc5('0x10')]);}})[_0xefc5('0x12')](function(_0x3c2dfc){logger['error'](_0xefc5('0x9'),_0xb85022,_0x3c2dfc);_0x3f51be(_0x3c2dfc);});});}exports['CreateSquareRecording']=function(_0x27d675){var _0x2c8fe5=this;return new Promise(function(_0x47049b,_0x4baadd){return db[_0xefc5('0x13')][_0xefc5('0x14')](_0x27d675[_0xefc5('0x15')],{'raw':_0x27d675[_0xefc5('0x16')]?_0x27d675[_0xefc5('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xefc5('0x17')](function(_0x37ccd6){logger[_0xefc5('0x8')](_0xefc5('0x18'),_0x27d675);logger[_0xefc5('0xb')](_0xefc5('0x18'),_0x27d675,JSON[_0xefc5('0xd')](_0x37ccd6));_0x47049b(_0x37ccd6);})['catch'](function(_0x2d117b){logger[_0xefc5('0xe')]('CreateSquareRecording',_0x2d117b['message'],_0x27d675);_0x4baadd(_0x2c8fe5[_0xefc5('0xe')](0x1f4,_0x2d117b[_0xefc5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 93b7f65..14f0987 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x401065,_0x4b92af){var _0x4162e5=function(_0x406ff5){while(--_0x406ff5){_0x401065['push'](_0x401065['shift']());}};_0x4162e5(++_0x4b92af);}(_0xb10b,0x12a));var _0xbb10=function(_0x196ce1,_0x46e836){_0x196ce1=_0x196ce1-0x0;var _0x360a64=_0xb10b[_0x196ce1];return _0x360a64;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x25680f,_0x49646a){var _0x135948=function(_0x4b6ebe){while(--_0x4b6ebe){_0x25680f['push'](_0x25680f['shift']());}};_0x135948(++_0x49646a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index efe616b..3d0743c 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 _0x05ca=['STRING','DATE','BOOLEAN','sequelize'];(function(_0xa9100,_0x44f6d4){var _0x3fbbf6=function(_0x2faa2a){while(--_0x2faa2a){_0xa9100['push'](_0xa9100['shift']());}};_0x3fbbf6(++_0x44f6d4);}(_0x05ca,0xbf));var _0xa05c=function(_0x290bf1,_0x164867){_0x290bf1=_0x290bf1-0x0;var _0x37d086=_0x05ca[_0x290bf1];return _0x37d086;};'use strict';var Sequelize=require(_0xa05c('0x0'));module['exports']={'network':{'type':Sequelize[_0xa05c('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xa05c('0x1')]},'channel':{'type':Sequelize[_0xa05c('0x1')]},'language':{'type':Sequelize[_0xa05c('0x1')]},'type':{'type':Sequelize[_0xa05c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xa05c('0x1')]},'callerid':{'type':Sequelize[_0xa05c('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xa05c('0x1')]},'callingtns':{'type':Sequelize[_0xa05c('0x1')]},'dnid':{'type':Sequelize[_0xa05c('0x1')]},'rdnis':{'type':Sequelize[_0xa05c('0x1')]},'context':{'type':Sequelize[_0xa05c('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa05c('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa05c('0x1')]},'threadid':{'type':Sequelize[_0xa05c('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa05c('0x2')]},'leaveAt':{'type':Sequelize[_0xa05c('0x2')]},'bot':{'type':Sequelize[_0xa05c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb3ab=['exports','STRING','DATE'];(function(_0x252344,_0x5a97e8){var _0x5612e2=function(_0x13e572){while(--_0x13e572){_0x252344['push'](_0x252344['shift']());}};_0x5612e2(++_0x5a97e8);}(_0xb3ab,0xf9));var _0xbb3a=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xb3ab[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require('sequelize');module[_0xbb3a('0x0')]={'network':{'type':Sequelize[_0xbb3a('0x1')]},'network_script':{'type':Sequelize[_0xbb3a('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbb3a('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbb3a('0x1')]},'uniqueid':{'type':Sequelize[_0xbb3a('0x1')]},'version':{'type':Sequelize[_0xbb3a('0x1')]},'callerid':{'type':Sequelize[_0xbb3a('0x1')]},'calleridname':{'type':Sequelize[_0xbb3a('0x1')]},'callingpres':{'type':Sequelize[_0xbb3a('0x1')]},'callingani2':{'type':Sequelize[_0xbb3a('0x1')]},'callington':{'type':Sequelize[_0xbb3a('0x1')]},'callingtns':{'type':Sequelize[_0xbb3a('0x1')]},'dnid':{'type':Sequelize[_0xbb3a('0x1')]},'rdnis':{'type':Sequelize[_0xbb3a('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xbb3a('0x1')]},'priority':{'type':Sequelize[_0xbb3a('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xbb3a('0x1')]},'project_name':{'type':Sequelize[_0xbb3a('0x1')]},'joinAt':{'type':Sequelize[_0xbb3a('0x2')]},'leaveAt':{'type':Sequelize[_0xbb3a('0x2')]},'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 88d6a61..11278d3 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 _0xa92d=['catch','show','merge','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','reject','save','update','then','destroy','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include'];(function(_0x34f8ba,_0x2bb6a8){var _0xa5ed05=function(_0x497771){while(--_0x497771){_0x34f8ba['push'](_0x34f8ba['shift']());}};_0xa5ed05(++_0x2bb6a8);}(_0xa92d,0x130));var _0xda92=function(_0x4cc60f,_0x475f0a){_0x4cc60f=_0x4cc60f-0x0;var _0x25a0ee=_0xa92d[_0x4cc60f];return _0x25a0ee;};'use strict';var emlformat=require(_0xda92('0x0'));var rimraf=require(_0xda92('0x1'));var zipdir=require(_0xda92('0x2'));var jsonpatch=require(_0xda92('0x3'));var rp=require(_0xda92('0x4'));var moment=require('moment');var BPromise=require(_0xda92('0x5'));var Mustache=require(_0xda92('0x6'));var util=require(_0xda92('0x7'));var path=require(_0xda92('0x8'));var sox=require(_0xda92('0x9'));var csv=require(_0xda92('0xa'));var ejs=require(_0xda92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda92('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda92('0xd'));var deskjs=require(_0xda92('0xe'));var toCsv=require(_0xda92('0xa'));var querystring=require(_0xda92('0xf'));var Papa=require(_0xda92('0x10'));var Redis=require(_0xda92('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda92('0x12'));var as=require(_0xda92('0x13'));var hardwareService=require(_0xda92('0x14'));var logger=require(_0xda92('0x15'))(_0xda92('0x16'));var utils=require('../../config/utils');var config=require(_0xda92('0x17'));var licenseUtil=require(_0xda92('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7672,_0x5885b4){_0x5885b4=_0x5885b4||0xcc;return function(_0xff2e70){if(_0xff2e70){return _0x7672[_0xda92('0x19')](_0x5885b4);}return _0x7672[_0xda92('0x1a')](_0x5885b4)[_0xda92('0x1b')]();};}function respondWithResult(_0x12c76c,_0x55f376){_0x55f376=_0x55f376||0xc8;return function(_0x4fc8b3){if(_0x4fc8b3){return _0x12c76c['status'](_0x55f376)['json'](_0x4fc8b3);}};}function respondWithFilteredResult(_0x5d4ff9,_0x370657){return function(_0x348431){if(_0x348431){var _0x237ce4=typeof _0x370657['offset']===_0xda92('0x1c')&&typeof _0x370657[_0xda92('0x1d')]==='undefined';var _0x548896=_0x348431[_0xda92('0x1e')];var _0x2d10f8=_0x237ce4?0x0:_0x370657[_0xda92('0x1f')];var _0x1d4963=_0x237ce4?_0x348431[_0xda92('0x1e')]:_0x370657[_0xda92('0x1f')]+_0x370657[_0xda92('0x1d')];var _0xe6b02c;if(_0x1d4963>=_0x548896){_0x1d4963=_0x548896;_0xe6b02c=0xc8;}else{_0xe6b02c=0xce;}_0x5d4ff9[_0xda92('0x1a')](_0xe6b02c);return _0x5d4ff9[_0xda92('0x20')]('Content-Range',_0x2d10f8+'-'+_0x1d4963+'/'+_0x548896)['json'](_0x348431);}return null;};}function patchUpdates(_0x4b40c7){return function(_0x407f1a){try{jsonpatch['apply'](_0x407f1a,_0x4b40c7,!![]);}catch(_0x42a3ba){return BPromise[_0xda92('0x21')](_0x42a3ba);}return _0x407f1a[_0xda92('0x22')]();};}function saveUpdates(_0x4fe7d2,_0x5ef573){return function(_0x1cc49d){if(_0x1cc49d){return _0x1cc49d[_0xda92('0x23')](_0x4fe7d2)[_0xda92('0x24')](function(_0x364ec8){return _0x364ec8;});}return null;};}function removeEntity(_0x5dc61d,_0x177e69){return function(_0x18243a){if(_0x18243a){return _0x18243a[_0xda92('0x25')]()[_0xda92('0x24')](function(){_0x5dc61d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e9e4,_0x2fab39){return function(_0x50e71b){if(!_0x50e71b){_0x56e9e4[_0xda92('0x19')](0x194);}return _0x50e71b;};}function handleError(_0x39f4ff,_0x6c2458){_0x6c2458=_0x6c2458||0x1f4;return function(_0x34a81b){logger['error'](_0x34a81b[_0xda92('0x26')]);if(_0x34a81b[_0xda92('0x27')]){delete _0x34a81b[_0xda92('0x27')];}_0x39f4ff[_0xda92('0x1a')](_0x6c2458)[_0xda92('0x28')](_0x34a81b);};}exports[_0xda92('0x29')]=function(_0x2e1ecf,_0x4948d6){var _0x3eec78={},_0x472614={},_0x5f0cac={'count':0x0,'rows':[]};var _0x417dfb=_[_0xda92('0x2a')](db[_0xda92('0x2b')][_0xda92('0x2c')],function(_0x275af9){return{'name':_0x275af9[_0xda92('0x2d')],'type':_0x275af9[_0xda92('0x2e')][_0xda92('0x2f')]};});_0x472614['model']=_[_0xda92('0x2a')](_0x417dfb,_0xda92('0x27'));_0x472614['query']=_[_0xda92('0x30')](_0x2e1ecf[_0xda92('0x31')]);_0x472614[_0xda92('0x32')]=_[_0xda92('0x33')](_0x472614[_0xda92('0x34')],_0x472614[_0xda92('0x31')]);_0x3eec78['attributes']=_[_0xda92('0x33')](_0x472614[_0xda92('0x34')],qs[_0xda92('0x35')](_0x2e1ecf[_0xda92('0x31')][_0xda92('0x35')]));_0x3eec78[_0xda92('0x36')]=_0x3eec78[_0xda92('0x36')][_0xda92('0x37')]?_0x3eec78[_0xda92('0x36')]:_0x472614[_0xda92('0x34')];if(!_0x2e1ecf[_0xda92('0x31')][_0xda92('0x38')](_0xda92('0x39'))){_0x3eec78[_0xda92('0x1d')]=qs[_0xda92('0x1d')](_0x2e1ecf[_0xda92('0x31')][_0xda92('0x1d')]);_0x3eec78['offset']=qs[_0xda92('0x1f')](_0x2e1ecf[_0xda92('0x31')][_0xda92('0x1f')]);}_0x3eec78[_0xda92('0x3a')]=qs[_0xda92('0x3b')](_0x2e1ecf['query']['sort']);_0x3eec78['where']=qs[_0xda92('0x32')](_['pick'](_0x2e1ecf[_0xda92('0x31')],_0x472614[_0xda92('0x32')]),_0x417dfb);if(_0x2e1ecf[_0xda92('0x31')][_0xda92('0x3c')]){_0x3eec78['where']=_['merge'](_0x3eec78[_0xda92('0x3d')],{'$or':_[_0xda92('0x2a')](_0x417dfb,function(_0x3f0969){if(_0x3f0969[_0xda92('0x2e')]!==_0xda92('0x3e')){var _0x157677={};_0x157677[_0x3f0969['name']]={'$like':'%'+_0x2e1ecf['query']['filter']+'%'};return _0x157677;}})});}_0x3eec78=_['merge']({},_0x3eec78,_0x2e1ecf[_0xda92('0x3f')]);var _0x4d7e04={'where':_0x3eec78[_0xda92('0x3d')]};return db[_0xda92('0x2b')][_0xda92('0x1e')](_0x4d7e04)[_0xda92('0x24')](function(_0x519f02){_0x5f0cac[_0xda92('0x1e')]=_0x519f02;if(_0x2e1ecf[_0xda92('0x31')][_0xda92('0x40')]){_0x3eec78[_0xda92('0x41')]=[{'all':!![]}];}return db[_0xda92('0x2b')]['findAll'](_0x3eec78);})['then'](function(_0x1ef3df){_0x5f0cac['rows']=_0x1ef3df;return _0x5f0cac;})[_0xda92('0x24')](respondWithFilteredResult(_0x4948d6,_0x3eec78))[_0xda92('0x42')](handleError(_0x4948d6,null));};exports[_0xda92('0x43')]=function(_0x57dd33,_0x2aaaac){var _0x1a7d66={'raw':!![],'where':{'id':_0x57dd33['params']['id']}},_0x48328e={};_0x48328e[_0xda92('0x34')]=_['keys'](db[_0xda92('0x2b')][_0xda92('0x2c')]);_0x48328e[_0xda92('0x31')]=_[_0xda92('0x30')](_0x57dd33[_0xda92('0x31')]);_0x48328e[_0xda92('0x32')]=_[_0xda92('0x33')](_0x48328e[_0xda92('0x34')],_0x48328e[_0xda92('0x31')]);_0x1a7d66['attributes']=_[_0xda92('0x33')](_0x48328e['model'],qs[_0xda92('0x35')](_0x57dd33[_0xda92('0x31')]['fields']));_0x1a7d66[_0xda92('0x36')]=_0x1a7d66[_0xda92('0x36')]['length']?_0x1a7d66[_0xda92('0x36')]:_0x48328e[_0xda92('0x34')];if(_0x57dd33[_0xda92('0x31')]['includeAll']){_0x1a7d66[_0xda92('0x41')]=[{'all':!![]}];}_0x1a7d66=_[_0xda92('0x44')]({},_0x1a7d66,_0x57dd33[_0xda92('0x3f')]);return db[_0xda92('0x2b')][_0xda92('0x45')](_0x1a7d66)[_0xda92('0x24')](handleEntityNotFound(_0x2aaaac,null))[_0xda92('0x24')](respondWithResult(_0x2aaaac,null))[_0xda92('0x42')](handleError(_0x2aaaac,null));};exports[_0xda92('0x46')]=function(_0x2a4544,_0x19c310){return db['SquareReport'][_0xda92('0x46')](_0x2a4544['body'],{})[_0xda92('0x24')](respondWithResult(_0x19c310,0xc9))[_0xda92('0x42')](handleError(_0x19c310,null));};exports['update']=function(_0x47f916,_0x431733){if(_0x47f916['body']['id']){delete _0x47f916[_0xda92('0x47')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x47f916[_0xda92('0x48')]['id']}})[_0xda92('0x24')](handleEntityNotFound(_0x431733,null))[_0xda92('0x24')](saveUpdates(_0x47f916['body'],null))[_0xda92('0x24')](respondWithResult(_0x431733,null))['catch'](handleError(_0x431733,null));};exports[_0xda92('0x25')]=function(_0x23ab8a,_0x2ed6a1){return db[_0xda92('0x2b')]['find']({'where':{'id':_0x23ab8a[_0xda92('0x48')]['id']}})[_0xda92('0x24')](handleEntityNotFound(_0x2ed6a1,null))['then'](removeEntity(_0x2ed6a1,null))[_0xda92('0x42')](handleError(_0x2ed6a1,null));};exports[_0xda92('0x49')]=function(_0x40236a,_0x3c1cb6){return db[_0xda92('0x2b')][_0xda92('0x49')]()[_0xda92('0x24')](respondWithResult(_0x3c1cb6,null))[_0xda92('0x42')](handleError(_0x3c1cb6,null));}; \ No newline at end of file +var _0x2972=['error','stack','name','send','index','SquareReport','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end'];(function(_0x1a6f99,_0x2048ce){var _0x223b7f=function(_0x2fe861){while(--_0x2fe861){_0x1a6f99['push'](_0x1a6f99['shift']());}};_0x223b7f(++_0x2048ce);}(_0x2972,0x6d));var _0x2297=function(_0x466d73,_0x24439d){_0x466d73=_0x466d73-0x0;var _0x223650=_0x2972[_0x466d73];return _0x223650;};'use strict';var emlformat=require(_0x2297('0x0'));var rimraf=require(_0x2297('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2297('0x2'));var rp=require(_0x2297('0x3'));var moment=require(_0x2297('0x4'));var BPromise=require(_0x2297('0x5'));var Mustache=require(_0x2297('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2297('0x7'));var csv=require(_0x2297('0x8'));var ejs=require(_0x2297('0x9'));var fs=require('fs');var fs_extra=require(_0x2297('0xa'));var _=require(_0x2297('0xb'));var squel=require('squel');var crypto=require(_0x2297('0xc'));var jsforce=require(_0x2297('0xd'));var deskjs=require(_0x2297('0xe'));var toCsv=require(_0x2297('0x8'));var querystring=require(_0x2297('0xf'));var Papa=require('papaparse');var Redis=require(_0x2297('0x10'));var authService=require(_0x2297('0x11'));var qs=require(_0x2297('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2297('0x13'));var logger=require(_0x2297('0x14'))('api');var utils=require(_0x2297('0x15'));var config=require(_0x2297('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2297('0x17'))['db'];function respondWithStatusCode(_0x393c7b,_0xbc356c){_0xbc356c=_0xbc356c||0xcc;return function(_0x2ac736){if(_0x2ac736){return _0x393c7b[_0x2297('0x18')](_0xbc356c);}return _0x393c7b[_0x2297('0x19')](_0xbc356c)['end']();};}function respondWithResult(_0xf75b8b,_0x49b6ad){_0x49b6ad=_0x49b6ad||0xc8;return function(_0x163f60){if(_0x163f60){return _0xf75b8b[_0x2297('0x19')](_0x49b6ad)[_0x2297('0x1a')](_0x163f60);}};}function respondWithFilteredResult(_0xda663c,_0x50d8a8){return function(_0x4ab87a){if(_0x4ab87a){var _0x59be53=typeof _0x50d8a8[_0x2297('0x1b')]===_0x2297('0x1c')&&typeof _0x50d8a8[_0x2297('0x1d')]===_0x2297('0x1c');var _0x2ef4cc=_0x4ab87a[_0x2297('0x1e')];var _0x2d15e9=_0x59be53?0x0:_0x50d8a8['offset'];var _0x1503c6=_0x59be53?_0x4ab87a[_0x2297('0x1e')]:_0x50d8a8[_0x2297('0x1b')]+_0x50d8a8[_0x2297('0x1d')];var _0x230623;if(_0x1503c6>=_0x2ef4cc){_0x1503c6=_0x2ef4cc;_0x230623=0xc8;}else{_0x230623=0xce;}_0xda663c[_0x2297('0x19')](_0x230623);return _0xda663c[_0x2297('0x1f')](_0x2297('0x20'),_0x2d15e9+'-'+_0x1503c6+'/'+_0x2ef4cc)[_0x2297('0x1a')](_0x4ab87a);}return null;};}function patchUpdates(_0x4af1f9){return function(_0x1d29ee){try{jsonpatch['apply'](_0x1d29ee,_0x4af1f9,!![]);}catch(_0xc95b16){return BPromise[_0x2297('0x21')](_0xc95b16);}return _0x1d29ee[_0x2297('0x22')]();};}function saveUpdates(_0x9f0d19,_0x43451e){return function(_0x411049){if(_0x411049){return _0x411049[_0x2297('0x23')](_0x9f0d19)[_0x2297('0x24')](function(_0x757022){return _0x757022;});}return null;};}function removeEntity(_0x5a26ab,_0x2f6104){return function(_0x544033){if(_0x544033){return _0x544033[_0x2297('0x25')]()['then'](function(){_0x5a26ab[_0x2297('0x19')](0xcc)[_0x2297('0x26')]();});}};}function handleEntityNotFound(_0x5a100e,_0x3c6eb8){return function(_0x321a69){if(!_0x321a69){_0x5a100e[_0x2297('0x18')](0x194);}return _0x321a69;};}function handleError(_0x40391c,_0x14e49e){_0x14e49e=_0x14e49e||0x1f4;return function(_0x43a97c){logger[_0x2297('0x27')](_0x43a97c[_0x2297('0x28')]);if(_0x43a97c[_0x2297('0x29')]){delete _0x43a97c['name'];}_0x40391c[_0x2297('0x19')](_0x14e49e)[_0x2297('0x2a')](_0x43a97c);};}exports[_0x2297('0x2b')]=function(_0x345f2c,_0x278ff3){var _0x4bee02={},_0xea54cd={},_0xdc7f46={'count':0x0,'rows':[]};var _0x118ce1=_['map'](db[_0x2297('0x2c')]['rawAttributes'],function(_0x3f0ee2){return{'name':_0x3f0ee2[_0x2297('0x2d')],'type':_0x3f0ee2[_0x2297('0x2e')]['key']};});_0xea54cd[_0x2297('0x2f')]=_[_0x2297('0x30')](_0x118ce1,_0x2297('0x29'));_0xea54cd[_0x2297('0x31')]=_[_0x2297('0x32')](_0x345f2c[_0x2297('0x31')]);_0xea54cd[_0x2297('0x33')]=_['intersection'](_0xea54cd[_0x2297('0x2f')],_0xea54cd[_0x2297('0x31')]);_0x4bee02[_0x2297('0x34')]=_['intersection'](_0xea54cd[_0x2297('0x2f')],qs['fields'](_0x345f2c[_0x2297('0x31')][_0x2297('0x35')]));_0x4bee02['attributes']=_0x4bee02[_0x2297('0x34')][_0x2297('0x36')]?_0x4bee02[_0x2297('0x34')]:_0xea54cd[_0x2297('0x2f')];if(!_0x345f2c[_0x2297('0x31')][_0x2297('0x37')]('nolimit')){_0x4bee02[_0x2297('0x1d')]=qs[_0x2297('0x1d')](_0x345f2c['query']['limit']);_0x4bee02['offset']=qs[_0x2297('0x1b')](_0x345f2c[_0x2297('0x31')][_0x2297('0x1b')]);}_0x4bee02[_0x2297('0x38')]=qs['sort'](_0x345f2c[_0x2297('0x31')][_0x2297('0x39')]);_0x4bee02['where']=qs[_0x2297('0x33')](_[_0x2297('0x3a')](_0x345f2c[_0x2297('0x31')],_0xea54cd[_0x2297('0x33')]),_0x118ce1);if(_0x345f2c[_0x2297('0x31')]['filter']){_0x4bee02[_0x2297('0x3b')]=_[_0x2297('0x3c')](_0x4bee02['where'],{'$or':_[_0x2297('0x30')](_0x118ce1,function(_0x5c5ae6){if(_0x5c5ae6[_0x2297('0x2e')]!==_0x2297('0x3d')){var _0x1b54bb={};_0x1b54bb[_0x5c5ae6[_0x2297('0x29')]]={'$like':'%'+_0x345f2c[_0x2297('0x31')][_0x2297('0x3e')]+'%'};return _0x1b54bb;}})});}_0x4bee02=_[_0x2297('0x3c')]({},_0x4bee02,_0x345f2c[_0x2297('0x3f')]);var _0x61fc30={'where':_0x4bee02[_0x2297('0x3b')]};return db['SquareReport'][_0x2297('0x1e')](_0x61fc30)[_0x2297('0x24')](function(_0x2ca6ef){_0xdc7f46[_0x2297('0x1e')]=_0x2ca6ef;if(_0x345f2c[_0x2297('0x31')][_0x2297('0x40')]){_0x4bee02[_0x2297('0x41')]=[{'all':!![]}];}return db[_0x2297('0x2c')][_0x2297('0x42')](_0x4bee02);})[_0x2297('0x24')](function(_0xb66b32){_0xdc7f46['rows']=_0xb66b32;return _0xdc7f46;})[_0x2297('0x24')](respondWithFilteredResult(_0x278ff3,_0x4bee02))[_0x2297('0x43')](handleError(_0x278ff3,null));};exports['show']=function(_0x174814,_0x10d117){var _0x9719f0={'raw':!![],'where':{'id':_0x174814[_0x2297('0x44')]['id']}},_0x78a95={};_0x78a95['model']=_[_0x2297('0x32')](db[_0x2297('0x2c')]['rawAttributes']);_0x78a95[_0x2297('0x31')]=_[_0x2297('0x32')](_0x174814[_0x2297('0x31')]);_0x78a95[_0x2297('0x33')]=_['intersection'](_0x78a95[_0x2297('0x2f')],_0x78a95[_0x2297('0x31')]);_0x9719f0[_0x2297('0x34')]=_[_0x2297('0x45')](_0x78a95[_0x2297('0x2f')],qs[_0x2297('0x35')](_0x174814[_0x2297('0x31')][_0x2297('0x35')]));_0x9719f0[_0x2297('0x34')]=_0x9719f0[_0x2297('0x34')][_0x2297('0x36')]?_0x9719f0[_0x2297('0x34')]:_0x78a95['model'];if(_0x174814[_0x2297('0x31')][_0x2297('0x40')]){_0x9719f0[_0x2297('0x41')]=[{'all':!![]}];}_0x9719f0=_['merge']({},_0x9719f0,_0x174814['options']);return db[_0x2297('0x2c')][_0x2297('0x46')](_0x9719f0)['then'](handleEntityNotFound(_0x10d117,null))[_0x2297('0x24')](respondWithResult(_0x10d117,null))['catch'](handleError(_0x10d117,null));};exports[_0x2297('0x47')]=function(_0x440968,_0x44081a){return db[_0x2297('0x2c')][_0x2297('0x47')](_0x440968[_0x2297('0x48')],{})[_0x2297('0x24')](respondWithResult(_0x44081a,0xc9))[_0x2297('0x43')](handleError(_0x44081a,null));};exports[_0x2297('0x23')]=function(_0x17d5f2,_0x20c694){if(_0x17d5f2['body']['id']){delete _0x17d5f2[_0x2297('0x48')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x17d5f2[_0x2297('0x44')]['id']}})[_0x2297('0x24')](handleEntityNotFound(_0x20c694,null))[_0x2297('0x24')](saveUpdates(_0x17d5f2[_0x2297('0x48')],null))[_0x2297('0x24')](respondWithResult(_0x20c694,null))[_0x2297('0x43')](handleError(_0x20c694,null));};exports[_0x2297('0x25')]=function(_0x10ca8a,_0x14cebd){return db[_0x2297('0x2c')][_0x2297('0x46')]({'where':{'id':_0x10ca8a[_0x2297('0x44')]['id']}})[_0x2297('0x24')](handleEntityNotFound(_0x14cebd,null))[_0x2297('0x24')](removeEntity(_0x14cebd,null))[_0x2297('0x43')](handleError(_0x14cebd,null));};exports['describe']=function(_0x42d176,_0x49c050){return db['SquareReport'][_0x2297('0x49')]()['then'](respondWithResult(_0x49c050,null))[_0x2297('0x43')](handleError(_0x49c050,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 62fb158..572df0e 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 _0x940c=['rimraf','../../config/environment','./squareReport.attributes','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','path'];(function(_0x44fe5d,_0x50366b){var _0x1526f0=function(_0x303672){while(--_0x303672){_0x44fe5d['push'](_0x44fe5d['shift']());}};_0x1526f0(++_0x50366b);}(_0x940c,0x18e));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc940('0x0'));var util=require(_0xc940('0x1'));var logger=require(_0xc940('0x2'))(_0xc940('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc940('0x4'));var rimraf=require(_0xc940('0x5'));var config=require(_0xc940('0x6'));var attributes=require(_0xc940('0x7'));module['exports']=function(_0x13e0f9,_0x3854d6){return _0x13e0f9['define'](_0xc940('0x8'),attributes,{'tableName':_0xc940('0x9'),'paranoid':![],'indexes':[{'name':_0xc940('0xa'),'fields':[_0xc940('0xb'),'project_name']},{'name':_0xc940('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5114=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment'];(function(_0x288371,_0x35f999){var _0x5a1ad1=function(_0xc35a07){while(--_0xc35a07){_0x288371['push'](_0x288371['shift']());}};_0x5a1ad1(++_0x35f999);}(_0x5114,0xfa));var _0x4511=function(_0x1eac43,_0x1f70ce){_0x1eac43=_0x1eac43-0x0;var _0x3287db=_0x5114[_0x1eac43];return _0x3287db;};'use strict';var _=require(_0x4511('0x0'));var util=require(_0x4511('0x1'));var logger=require(_0x4511('0x2'))(_0x4511('0x3'));var moment=require(_0x4511('0x4'));var BPromise=require(_0x4511('0x5'));var rp=require(_0x4511('0x6'));var fs=require('fs');var path=require(_0x4511('0x7'));var rimraf=require(_0x4511('0x8'));var config=require(_0x4511('0x9'));var attributes=require(_0x4511('0xa'));module[_0x4511('0xb')]=function(_0x5993ab,_0xf9f747){return _0x5993ab[_0x4511('0xc')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x4511('0xd'),'fields':[_0x4511('0xe'),_0x4511('0xf')]},{'name':'leaveAt','fields':[_0x4511('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d363398..a8b4271 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 _0xbb6d=['rpc','../../config/environment','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','UpdateSquareReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18cfed,_0x430563){var _0x25b422=function(_0x44ad28){while(--_0x44ad28){_0x18cfed['push'](_0x18cfed['shift']());}};_0x25b422(++_0x430563);}(_0xbb6d,0x132));var _0xdbb6=function(_0x4650e0,_0x5bc21d){_0x4650e0=_0x4650e0-0x0;var _0x4b9fab=_0xbb6d[_0x4650e0];return _0x4b9fab;};'use strict';var _=require(_0xdbb6('0x0'));var util=require(_0xdbb6('0x1'));var moment=require(_0xdbb6('0x2'));var BPromise=require(_0xdbb6('0x3'));var rs=require(_0xdbb6('0x4'));var fs=require('fs');var Redis=require(_0xdbb6('0x5'));var db=require(_0xdbb6('0x6'))['db'];var utils=require(_0xdbb6('0x7'));var logger=require(_0xdbb6('0x8'))(_0xdbb6('0x9'));var config=require(_0xdbb6('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3345ea,_0x88a6e5,_0x4d5ee3){return new BPromise(function(_0x35d4fa,_0x315bc5){return client[_0xdbb6('0xb')](_0x3345ea,_0x4d5ee3)[_0xdbb6('0xc')](function(_0x39ffba){logger[_0xdbb6('0xd')](_0xdbb6('0xe'),_0x88a6e5,_0xdbb6('0xf'));logger[_0xdbb6('0x10')](_0xdbb6('0x11'),_0x88a6e5,'request\x20sent',JSON[_0xdbb6('0x12')](_0x39ffba));if(_0x39ffba[_0xdbb6('0x13')]){if(_0x39ffba[_0xdbb6('0x13')][_0xdbb6('0x14')]===0x1f4){logger[_0xdbb6('0x13')]('SquareReport,\x20%s,\x20%s',_0x88a6e5,_0x39ffba[_0xdbb6('0x13')]['message']);return _0x315bc5(_0x39ffba[_0xdbb6('0x13')][_0xdbb6('0x15')]);}logger[_0xdbb6('0x13')](_0xdbb6('0xe'),_0x88a6e5,_0x39ffba[_0xdbb6('0x13')]['message']);return _0x35d4fa(_0x39ffba[_0xdbb6('0x13')][_0xdbb6('0x15')]);}else{logger[_0xdbb6('0xd')](_0xdbb6('0xe'),_0x88a6e5,_0xdbb6('0xf'));_0x35d4fa(_0x39ffba[_0xdbb6('0x16')]['message']);}})[_0xdbb6('0x17')](function(_0x1b7423){logger[_0xdbb6('0x13')](_0xdbb6('0xe'),_0x88a6e5,_0x1b7423);_0x315bc5(_0x1b7423);});});}exports[_0xdbb6('0x18')]=function(_0xf004c2){var _0x5aacf8=this;return new Promise(function(_0xc6550,_0x3b4d06){return db[_0xdbb6('0x19')][_0xdbb6('0x1a')](_0xf004c2[_0xdbb6('0x1b')],{'raw':_0xf004c2[_0xdbb6('0x1c')]?_0xf004c2[_0xdbb6('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xdbb6('0xc')](function(_0x4b371f){logger[_0xdbb6('0xd')]('CreateSquareReport',_0xf004c2);logger[_0xdbb6('0x10')](_0xdbb6('0x18'),_0xf004c2,JSON[_0xdbb6('0x12')](_0x4b371f));_0xc6550(_0x4b371f);})[_0xdbb6('0x17')](function(_0x9ce78){logger['error']('CreateSquareReport',_0x9ce78[_0xdbb6('0x15')],_0xf004c2);_0x3b4d06(_0x5aacf8[_0xdbb6('0x13')](0x1f4,_0x9ce78[_0xdbb6('0x15')]));});});};exports[_0xdbb6('0x1d')]=function(_0x546a9b){var _0x585abf=this;return new Promise(function(_0x4f937f,_0x371f82){return db['SquareReport'][_0xdbb6('0x1e')](_0x546a9b[_0xdbb6('0x1b')],{'raw':_0x546a9b[_0xdbb6('0x1c')]?_0x546a9b['options'][_0xdbb6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x546a9b[_0xdbb6('0x1c')]?_0x546a9b[_0xdbb6('0x1c')][_0xdbb6('0x20')]||null:null,'attributes':_0x546a9b[_0xdbb6('0x1c')]?_0x546a9b[_0xdbb6('0x1c')][_0xdbb6('0x21')]||null:null,'limit':_0x546a9b[_0xdbb6('0x1c')]?_0x546a9b[_0xdbb6('0x1c')][_0xdbb6('0x22')]||null:null})[_0xdbb6('0xc')](function(_0x5327bd){logger[_0xdbb6('0xd')]('UpdateSquareReport',_0x546a9b);logger[_0xdbb6('0x10')](_0xdbb6('0x1d'),_0x546a9b,JSON[_0xdbb6('0x12')](_0x5327bd));_0x4f937f(_0x5327bd);})[_0xdbb6('0x17')](function(_0x309e96){logger[_0xdbb6('0x13')]('UpdateSquareReport',_0x309e96[_0xdbb6('0x15')],_0x546a9b);_0x371f82(_0x585abf['error'](0x1f4,_0x309e96[_0xdbb6('0x15')]));});});}; \ No newline at end of file +var _0x60ae=['../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x201f73,_0x17489c){var _0x24516d=function(_0x347913){while(--_0x347913){_0x201f73['push'](_0x201f73['shift']());}};_0x24516d(++_0x17489c);}(_0x60ae,0xbe));var _0xe60a=function(_0x232583,_0x44bdb5){_0x232583=_0x232583-0x0;var _0x49ddc1=_0x60ae[_0x232583];return _0x49ddc1;};'use strict';var _=require('lodash');var util=require(_0xe60a('0x0'));var moment=require(_0xe60a('0x1'));var BPromise=require(_0xe60a('0x2'));var rs=require(_0xe60a('0x3'));var fs=require('fs');var Redis=require(_0xe60a('0x4'));var db=require(_0xe60a('0x5'))['db'];var utils=require(_0xe60a('0x6'));var logger=require('../../config/logger')(_0xe60a('0x7'));var config=require(_0xe60a('0x8'));var jayson=require(_0xe60a('0x9'));var client=jayson[_0xe60a('0xa')][_0xe60a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58a424,_0x80ca16,_0x4f12fa){return new BPromise(function(_0x6408af,_0x23c7ab){return client[_0xe60a('0xc')](_0x58a424,_0x4f12fa)[_0xe60a('0xd')](function(_0x5849d5){logger['info'](_0xe60a('0xe'),_0x80ca16,_0xe60a('0xf'));logger[_0xe60a('0x10')](_0xe60a('0x11'),_0x80ca16,_0xe60a('0xf'),JSON[_0xe60a('0x12')](_0x5849d5));if(_0x5849d5[_0xe60a('0x13')]){if(_0x5849d5[_0xe60a('0x13')][_0xe60a('0x14')]===0x1f4){logger[_0xe60a('0x13')](_0xe60a('0xe'),_0x80ca16,_0x5849d5['error'][_0xe60a('0x15')]);return _0x23c7ab(_0x5849d5[_0xe60a('0x13')]['message']);}logger[_0xe60a('0x13')](_0xe60a('0xe'),_0x80ca16,_0x5849d5[_0xe60a('0x13')][_0xe60a('0x15')]);return _0x6408af(_0x5849d5[_0xe60a('0x13')][_0xe60a('0x15')]);}else{logger[_0xe60a('0x16')](_0xe60a('0xe'),_0x80ca16,_0xe60a('0xf'));_0x6408af(_0x5849d5[_0xe60a('0x17')][_0xe60a('0x15')]);}})['catch'](function(_0x557e67){logger['error'](_0xe60a('0xe'),_0x80ca16,_0x557e67);_0x23c7ab(_0x557e67);});});}exports[_0xe60a('0x18')]=function(_0x7b0f79){var _0x569e21=this;return new Promise(function(_0x797e99,_0x72a181){return db[_0xe60a('0x19')][_0xe60a('0x1a')](_0x7b0f79[_0xe60a('0x1b')],{'raw':_0x7b0f79[_0xe60a('0x1c')]?_0x7b0f79[_0xe60a('0x1c')][_0xe60a('0x1d')]===undefined?!![]:![]:!![]})[_0xe60a('0xd')](function(_0x5bae5f){logger[_0xe60a('0x16')](_0xe60a('0x18'),_0x7b0f79);logger['debug']('CreateSquareReport',_0x7b0f79,JSON[_0xe60a('0x12')](_0x5bae5f));_0x797e99(_0x5bae5f);})[_0xe60a('0x1e')](function(_0x23a193){logger['error'](_0xe60a('0x18'),_0x23a193[_0xe60a('0x15')],_0x7b0f79);_0x72a181(_0x569e21['error'](0x1f4,_0x23a193['message']));});});};exports[_0xe60a('0x1f')]=function(_0x35cf64){var _0x13ea16=this;return new Promise(function(_0x51e174,_0x1c9151){return db[_0xe60a('0x19')]['update'](_0x35cf64['body'],{'raw':_0x35cf64[_0xe60a('0x1c')]?_0x35cf64[_0xe60a('0x1c')][_0xe60a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35cf64[_0xe60a('0x1c')]?_0x35cf64['options']['where']||null:null,'attributes':_0x35cf64[_0xe60a('0x1c')]?_0x35cf64[_0xe60a('0x1c')][_0xe60a('0x20')]||null:null,'limit':_0x35cf64[_0xe60a('0x1c')]?_0x35cf64['options']['limit']||null:null})[_0xe60a('0xd')](function(_0x43813c){logger[_0xe60a('0x16')]('UpdateSquareReport',_0x35cf64);logger['debug']('UpdateSquareReport',_0x35cf64,JSON[_0xe60a('0x12')](_0x43813c));_0x51e174(_0x43813c);})[_0xe60a('0x1e')](function(_0x56385e){logger['error'](_0xe60a('0x1f'),_0x56385e['message'],_0x35cf64);_0x1c9151(_0x13ea16['error'](0x1f4,_0x56385e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a4c508b..ee0ecc0 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 _0xfb59=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x3499a6,_0xd09ace){var _0x5b2674=function(_0x6b39af){while(--_0x6b39af){_0x3499a6['push'](_0x3499a6['shift']());}};_0x5b2674(++_0xd09ace);}(_0xfb59,0x176));var _0x9fb5=function(_0x517431,_0x21efaf){_0x517431=_0x517431-0x0;var _0x13a675=_0xfb59[_0x517431];return _0x13a675;};'use strict';var multer=require('multer');var util=require(_0x9fb5('0x0'));var path=require(_0x9fb5('0x1'));var timeout=require(_0x9fb5('0x2'));var express=require(_0x9fb5('0x3'));var router=express[_0x9fb5('0x4')]();var fs_extra=require(_0x9fb5('0x5'));var auth=require(_0x9fb5('0x6'));var interaction=require(_0x9fb5('0x7'));var config=require('../../config/environment');var controller=require(_0x9fb5('0x8'));router[_0x9fb5('0x9')]('/',auth[_0x9fb5('0xa')](),controller[_0x9fb5('0xb')]);router[_0x9fb5('0x9')](_0x9fb5('0xc'),auth[_0x9fb5('0xa')](),controller[_0x9fb5('0xd')]);router[_0x9fb5('0x9')](_0x9fb5('0xe'),auth[_0x9fb5('0xa')](),controller[_0x9fb5('0xf')]);router[_0x9fb5('0x10')]('/',auth[_0x9fb5('0xa')](),controller[_0x9fb5('0x11')]);router[_0x9fb5('0x12')]('/:id',auth[_0x9fb5('0xa')](),controller['update']);router[_0x9fb5('0x13')]('/:id',auth[_0x9fb5('0xa')](),controller[_0x9fb5('0x14')]);module[_0x9fb5('0x15')]=router; \ No newline at end of file +var _0xdd8e=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','show','create','put','update','delete','/:id'];(function(_0x2169d3,_0x333b7c){var _0x49551c=function(_0x1e057e){while(--_0x1e057e){_0x2169d3['push'](_0x2169d3['shift']());}};_0x49551c(++_0x333b7c);}(_0xdd8e,0xdd));var _0xedd8=function(_0x416840,_0x59a299){_0x416840=_0x416840-0x0;var _0x118276=_0xdd8e[_0x416840];return _0x118276;};'use strict';var multer=require(_0xedd8('0x0'));var util=require(_0xedd8('0x1'));var path=require(_0xedd8('0x2'));var timeout=require(_0xedd8('0x3'));var express=require(_0xedd8('0x4'));var router=express[_0xedd8('0x5')]();var fs_extra=require(_0xedd8('0x6'));var auth=require(_0xedd8('0x7'));var interaction=require(_0xedd8('0x8'));var config=require(_0xedd8('0x9'));var controller=require(_0xedd8('0xa'));router[_0xedd8('0xb')]('/',auth[_0xedd8('0xc')](),controller[_0xedd8('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xedd8('0xe')]);router[_0xedd8('0xb')]('/:id',auth[_0xedd8('0xc')](),controller[_0xedd8('0xf')]);router['post']('/',auth[_0xedd8('0xc')](),controller[_0xedd8('0x10')]);router[_0xedd8('0x11')]('/:id',auth[_0xedd8('0xc')](),controller[_0xedd8('0x12')]);router[_0xedd8('0x13')](_0xedd8('0x14'),auth[_0xedd8('0xc')](),controller['destroy']);module[_0xedd8('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0f9894a..73df0f9 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 _0x1746=['sequelize','exports','STRING','TEXT'];(function(_0x4dfa14,_0x3e6fa1){var _0x367eca=function(_0x5cce45){while(--_0x5cce45){_0x4dfa14['push'](_0x4dfa14['shift']());}};_0x367eca(++_0x3e6fa1);}(_0x1746,0x1a0));var _0x6174=function(_0x31f15d,_0x5eebc7){_0x31f15d=_0x31f15d-0x0;var _0x1ad428=_0x1746[_0x31f15d];return _0x1ad428;};'use strict';var Sequelize=require(_0x6174('0x0'));module[_0x6174('0x1')]={'uniqueid':{'type':Sequelize[_0x6174('0x2')]},'node':{'type':Sequelize[_0x6174('0x2')]},'application':{'type':Sequelize[_0x6174('0x2')]},'data':{'type':Sequelize[_0x6174('0x3')]},'project_name':{'type':Sequelize[_0x6174('0x2')]},'callerid':{'type':Sequelize[_0x6174('0x2')]}}; \ No newline at end of file +var _0xd55a=['STRING','TEXT','sequelize'];(function(_0x2e66dc,_0x28eb6e){var _0x27c28d=function(_0x29267f){while(--_0x29267f){_0x2e66dc['push'](_0x2e66dc['shift']());}};_0x27c28d(++_0x28eb6e);}(_0xd55a,0x1b2));var _0xad55=function(_0x35bd18,_0x57c4ea){_0x35bd18=_0x35bd18-0x0;var _0x1d8663=_0xd55a[_0x35bd18];return _0x1d8663;};'use strict';var Sequelize=require(_0xad55('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xad55('0x1')]},'node':{'type':Sequelize[_0xad55('0x1')]},'application':{'type':Sequelize[_0xad55('0x1')]},'data':{'type':Sequelize[_0xad55('0x2')]},'project_name':{'type':Sequelize[_0xad55('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 391cf37..379139c 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 _0xe334=['query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','SquareDetailsReport','map'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xe334,0x199));var _0x4e33=function(_0x46595c,_0x48272f){_0x46595c=_0x46595c-0x0;var _0x1e8fab=_0xe334[_0x46595c];return _0x1e8fab;};'use strict';var emlformat=require(_0x4e33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e33('0x1'));var jsonpatch=require(_0x4e33('0x2'));var rp=require(_0x4e33('0x3'));var moment=require(_0x4e33('0x4'));var BPromise=require(_0x4e33('0x5'));var Mustache=require(_0x4e33('0x6'));var util=require(_0x4e33('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4e33('0x8'));var ejs=require(_0x4e33('0x9'));var fs=require('fs');var fs_extra=require(_0x4e33('0xa'));var _=require('lodash');var squel=require(_0x4e33('0xb'));var crypto=require(_0x4e33('0xc'));var jsforce=require(_0x4e33('0xd'));var deskjs=require(_0x4e33('0xe'));var toCsv=require(_0x4e33('0x8'));var querystring=require(_0x4e33('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e33('0x10'));var authService=require(_0x4e33('0x11'));var qs=require(_0x4e33('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e33('0x13'));var logger=require(_0x4e33('0x14'))(_0x4e33('0x15'));var utils=require('../../config/utils');var config=require(_0x4e33('0x16'));var licenseUtil=require(_0x4e33('0x17'));var db=require(_0x4e33('0x18'))['db'];function respondWithStatusCode(_0x537ea6,_0x8cc3b9){_0x8cc3b9=_0x8cc3b9||0xcc;return function(_0x3d0541){if(_0x3d0541){return _0x537ea6[_0x4e33('0x19')](_0x8cc3b9);}return _0x537ea6[_0x4e33('0x1a')](_0x8cc3b9)['end']();};}function respondWithResult(_0x129658,_0x323690){_0x323690=_0x323690||0xc8;return function(_0x459a00){if(_0x459a00){return _0x129658['status'](_0x323690)['json'](_0x459a00);}};}function respondWithFilteredResult(_0x49e874,_0x1103e9){return function(_0x10401e){if(_0x10401e){var _0x40749b=typeof _0x1103e9['offset']===_0x4e33('0x1b')&&typeof _0x1103e9[_0x4e33('0x1c')]===_0x4e33('0x1b');var _0x596068=_0x10401e[_0x4e33('0x1d')];var _0x4a8d0f=_0x40749b?0x0:_0x1103e9[_0x4e33('0x1e')];var _0x2e0beb=_0x40749b?_0x10401e['count']:_0x1103e9[_0x4e33('0x1e')]+_0x1103e9[_0x4e33('0x1c')];var _0x5d83fa;if(_0x2e0beb>=_0x596068){_0x2e0beb=_0x596068;_0x5d83fa=0xc8;}else{_0x5d83fa=0xce;}_0x49e874[_0x4e33('0x1a')](_0x5d83fa);return _0x49e874[_0x4e33('0x1f')](_0x4e33('0x20'),_0x4a8d0f+'-'+_0x2e0beb+'/'+_0x596068)[_0x4e33('0x21')](_0x10401e);}return null;};}function patchUpdates(_0x524cb0){return function(_0x26eef4){try{jsonpatch[_0x4e33('0x22')](_0x26eef4,_0x524cb0,!![]);}catch(_0x24c220){return BPromise[_0x4e33('0x23')](_0x24c220);}return _0x26eef4[_0x4e33('0x24')]();};}function saveUpdates(_0x3faaea,_0x4eb95f){return function(_0x488736){if(_0x488736){return _0x488736[_0x4e33('0x25')](_0x3faaea)[_0x4e33('0x26')](function(_0x28b069){return _0x28b069;});}return null;};}function removeEntity(_0x4b1bf0,_0x58d893){return function(_0x2ec1e5){if(_0x2ec1e5){return _0x2ec1e5[_0x4e33('0x27')]()['then'](function(){_0x4b1bf0[_0x4e33('0x1a')](0xcc)[_0x4e33('0x28')]();});}};}function handleEntityNotFound(_0x343b22,_0x269a8c){return function(_0x1aef6b){if(!_0x1aef6b){_0x343b22[_0x4e33('0x19')](0x194);}return _0x1aef6b;};}function handleError(_0x1e88a3,_0x115844){_0x115844=_0x115844||0x1f4;return function(_0x2a5530){logger['error'](_0x2a5530[_0x4e33('0x29')]);if(_0x2a5530[_0x4e33('0x2a')]){delete _0x2a5530[_0x4e33('0x2a')];}_0x1e88a3[_0x4e33('0x1a')](_0x115844)[_0x4e33('0x2b')](_0x2a5530);};}exports[_0x4e33('0x2c')]=function(_0x275042,_0x50b845){var _0x18069e={},_0x104b58={},_0x482c4d={'count':0x0,'rows':[]};var _0x2e8691=_['map'](db[_0x4e33('0x2d')]['rawAttributes'],function(_0x497fb2){return{'name':_0x497fb2['fieldName'],'type':_0x497fb2['type']['key']};});_0x104b58['model']=_[_0x4e33('0x2e')](_0x2e8691,_0x4e33('0x2a'));_0x104b58[_0x4e33('0x2f')]=_['keys'](_0x275042[_0x4e33('0x2f')]);_0x104b58[_0x4e33('0x30')]=_['intersection'](_0x104b58[_0x4e33('0x31')],_0x104b58[_0x4e33('0x2f')]);_0x18069e[_0x4e33('0x32')]=_[_0x4e33('0x33')](_0x104b58[_0x4e33('0x31')],qs['fields'](_0x275042[_0x4e33('0x2f')][_0x4e33('0x34')]));_0x18069e[_0x4e33('0x32')]=_0x18069e[_0x4e33('0x32')][_0x4e33('0x35')]?_0x18069e['attributes']:_0x104b58[_0x4e33('0x31')];if(!_0x275042['query']['hasOwnProperty'](_0x4e33('0x36'))){_0x18069e[_0x4e33('0x1c')]=qs['limit'](_0x275042[_0x4e33('0x2f')]['limit']);_0x18069e[_0x4e33('0x1e')]=qs['offset'](_0x275042[_0x4e33('0x2f')]['offset']);}_0x18069e[_0x4e33('0x37')]=qs[_0x4e33('0x38')](_0x275042['query'][_0x4e33('0x38')]);_0x18069e[_0x4e33('0x39')]=qs[_0x4e33('0x30')](_[_0x4e33('0x3a')](_0x275042['query'],_0x104b58[_0x4e33('0x30')]),_0x2e8691);if(_0x275042[_0x4e33('0x2f')]['filter']){_0x18069e[_0x4e33('0x39')]=_[_0x4e33('0x3b')](_0x18069e['where'],{'$or':_['map'](_0x2e8691,function(_0x2259c3){if(_0x2259c3[_0x4e33('0x3c')]!==_0x4e33('0x3d')){var _0x481b9a={};_0x481b9a[_0x2259c3[_0x4e33('0x2a')]]={'$like':'%'+_0x275042[_0x4e33('0x2f')][_0x4e33('0x3e')]+'%'};return _0x481b9a;}})});}_0x18069e=_['merge']({},_0x18069e,_0x275042[_0x4e33('0x3f')]);var _0x229e58={'where':_0x18069e[_0x4e33('0x39')]};return db[_0x4e33('0x2d')]['count'](_0x229e58)['then'](function(_0x4a6852){_0x482c4d[_0x4e33('0x1d')]=_0x4a6852;if(_0x275042[_0x4e33('0x2f')][_0x4e33('0x40')]){_0x18069e[_0x4e33('0x41')]=[{'all':!![]}];}return db[_0x4e33('0x2d')]['findAll'](_0x18069e);})[_0x4e33('0x26')](function(_0x49ba70){_0x482c4d[_0x4e33('0x42')]=_0x49ba70;return _0x482c4d;})[_0x4e33('0x26')](respondWithFilteredResult(_0x50b845,_0x18069e))[_0x4e33('0x43')](handleError(_0x50b845,null));};exports[_0x4e33('0x44')]=function(_0x1063e3,_0xb9d9e2){var _0x2b7515={'raw':!![],'where':{'id':_0x1063e3[_0x4e33('0x45')]['id']}},_0x1933dd={};_0x1933dd[_0x4e33('0x31')]=_['keys'](db[_0x4e33('0x2d')][_0x4e33('0x46')]);_0x1933dd[_0x4e33('0x2f')]=_[_0x4e33('0x47')](_0x1063e3[_0x4e33('0x2f')]);_0x1933dd[_0x4e33('0x30')]=_[_0x4e33('0x33')](_0x1933dd[_0x4e33('0x31')],_0x1933dd['query']);_0x2b7515[_0x4e33('0x32')]=_[_0x4e33('0x33')](_0x1933dd['model'],qs[_0x4e33('0x34')](_0x1063e3[_0x4e33('0x2f')]['fields']));_0x2b7515[_0x4e33('0x32')]=_0x2b7515[_0x4e33('0x32')][_0x4e33('0x35')]?_0x2b7515[_0x4e33('0x32')]:_0x1933dd['model'];if(_0x1063e3['query'][_0x4e33('0x40')]){_0x2b7515[_0x4e33('0x41')]=[{'all':!![]}];}_0x2b7515=_[_0x4e33('0x3b')]({},_0x2b7515,_0x1063e3[_0x4e33('0x3f')]);return db[_0x4e33('0x2d')]['find'](_0x2b7515)['then'](handleEntityNotFound(_0xb9d9e2,null))[_0x4e33('0x26')](respondWithResult(_0xb9d9e2,null))[_0x4e33('0x43')](handleError(_0xb9d9e2,null));};exports[_0x4e33('0x48')]=function(_0x1cc369,_0x5c19fb){return db[_0x4e33('0x2d')][_0x4e33('0x48')](_0x1cc369[_0x4e33('0x49')],{})[_0x4e33('0x26')](respondWithResult(_0x5c19fb,0xc9))[_0x4e33('0x43')](handleError(_0x5c19fb,null));};exports[_0x4e33('0x25')]=function(_0x5ee7a0,_0x266f8b){if(_0x5ee7a0[_0x4e33('0x49')]['id']){delete _0x5ee7a0['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x5ee7a0[_0x4e33('0x45')]['id']}})[_0x4e33('0x26')](handleEntityNotFound(_0x266f8b,null))['then'](saveUpdates(_0x5ee7a0[_0x4e33('0x49')],null))['then'](respondWithResult(_0x266f8b,null))['catch'](handleError(_0x266f8b,null));};exports[_0x4e33('0x27')]=function(_0x5d6a7d,_0x426473){return db[_0x4e33('0x2d')][_0x4e33('0x4a')]({'where':{'id':_0x5d6a7d[_0x4e33('0x45')]['id']}})[_0x4e33('0x26')](handleEntityNotFound(_0x426473,null))['then'](removeEntity(_0x426473,null))[_0x4e33('0x43')](handleError(_0x426473,null));};exports[_0x4e33('0x4b')]=function(_0x254636,_0x5ccda5){return db[_0x4e33('0x2d')][_0x4e33('0x4b')]()[_0x4e33('0x26')](respondWithResult(_0x5ccda5,null))['catch'](handleError(_0x5ccda5,null));}; \ No newline at end of file +var _0xe73c=['sort','pick','where','VIRTUAL','filter','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x215913,_0x338380){var _0x468591=function(_0x36eb36){while(--_0x36eb36){_0x215913['push'](_0x215913['shift']());}};_0x468591(++_0x338380);}(_0xe73c,0xf6));var _0xce73=function(_0x3187c8,_0x21aaba){_0x3187c8=_0x3187c8-0x0;var _0x380950=_0xe73c[_0x3187c8];return _0x380950;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce73('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce73('0x1'));var moment=require(_0xce73('0x2'));var BPromise=require(_0xce73('0x3'));var Mustache=require(_0xce73('0x4'));var util=require(_0xce73('0x5'));var path=require(_0xce73('0x6'));var sox=require(_0xce73('0x7'));var csv=require(_0xce73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce73('0x9'));var _=require('lodash');var squel=require(_0xce73('0xa'));var crypto=require(_0xce73('0xb'));var jsforce=require(_0xce73('0xc'));var deskjs=require(_0xce73('0xd'));var toCsv=require(_0xce73('0x8'));var querystring=require(_0xce73('0xe'));var Papa=require(_0xce73('0xf'));var Redis=require(_0xce73('0x10'));var authService=require(_0xce73('0x11'));var qs=require(_0xce73('0x12'));var as=require(_0xce73('0x13'));var hardwareService=require(_0xce73('0x14'));var logger=require('../../config/logger')(_0xce73('0x15'));var utils=require(_0xce73('0x16'));var config=require(_0xce73('0x17'));var licenseUtil=require(_0xce73('0x18'));var db=require(_0xce73('0x19'))['db'];function respondWithStatusCode(_0x27cc29,_0xc4fc25){_0xc4fc25=_0xc4fc25||0xcc;return function(_0x2f0d37){if(_0x2f0d37){return _0x27cc29[_0xce73('0x1a')](_0xc4fc25);}return _0x27cc29[_0xce73('0x1b')](_0xc4fc25)[_0xce73('0x1c')]();};}function respondWithResult(_0x58c632,_0x430a71){_0x430a71=_0x430a71||0xc8;return function(_0x5a9adb){if(_0x5a9adb){return _0x58c632['status'](_0x430a71)[_0xce73('0x1d')](_0x5a9adb);}};}function respondWithFilteredResult(_0x147f8f,_0x2c7b2b){return function(_0x1f11e9){if(_0x1f11e9){var _0x3ab130=typeof _0x2c7b2b[_0xce73('0x1e')]==='undefined'&&typeof _0x2c7b2b[_0xce73('0x1f')]===_0xce73('0x20');var _0xc48a35=_0x1f11e9[_0xce73('0x21')];var _0x8daf06=_0x3ab130?0x0:_0x2c7b2b[_0xce73('0x1e')];var _0x76f106=_0x3ab130?_0x1f11e9[_0xce73('0x21')]:_0x2c7b2b[_0xce73('0x1e')]+_0x2c7b2b[_0xce73('0x1f')];var _0x50a1ad;if(_0x76f106>=_0xc48a35){_0x76f106=_0xc48a35;_0x50a1ad=0xc8;}else{_0x50a1ad=0xce;}_0x147f8f[_0xce73('0x1b')](_0x50a1ad);return _0x147f8f['set']('Content-Range',_0x8daf06+'-'+_0x76f106+'/'+_0xc48a35)[_0xce73('0x1d')](_0x1f11e9);}return null;};}function patchUpdates(_0x1cdb81){return function(_0x24a056){try{jsonpatch[_0xce73('0x22')](_0x24a056,_0x1cdb81,!![]);}catch(_0x558d98){return BPromise[_0xce73('0x23')](_0x558d98);}return _0x24a056['save']();};}function saveUpdates(_0x4e01d7,_0x393bb0){return function(_0x44f35f){if(_0x44f35f){return _0x44f35f[_0xce73('0x24')](_0x4e01d7)[_0xce73('0x25')](function(_0x22d4c1){return _0x22d4c1;});}return null;};}function removeEntity(_0x537d38,_0x1ba807){return function(_0x33e495){if(_0x33e495){return _0x33e495[_0xce73('0x26')]()[_0xce73('0x25')](function(){_0x537d38[_0xce73('0x1b')](0xcc)[_0xce73('0x1c')]();});}};}function handleEntityNotFound(_0xc56dcf,_0x31133a){return function(_0xa65a59){if(!_0xa65a59){_0xc56dcf[_0xce73('0x1a')](0x194);}return _0xa65a59;};}function handleError(_0x4a6985,_0x18db31){_0x18db31=_0x18db31||0x1f4;return function(_0x3e36c4){logger[_0xce73('0x27')](_0x3e36c4['stack']);if(_0x3e36c4['name']){delete _0x3e36c4[_0xce73('0x28')];}_0x4a6985[_0xce73('0x1b')](_0x18db31)[_0xce73('0x29')](_0x3e36c4);};}exports[_0xce73('0x2a')]=function(_0x50a7b6,_0x51024e){var _0x56de61={},_0x2c61a0={},_0x179f54={'count':0x0,'rows':[]};var _0x2e2b44=_[_0xce73('0x2b')](db['SquareDetailsReport'][_0xce73('0x2c')],function(_0x475881){return{'name':_0x475881[_0xce73('0x2d')],'type':_0x475881[_0xce73('0x2e')]['key']};});_0x2c61a0[_0xce73('0x2f')]=_[_0xce73('0x2b')](_0x2e2b44,_0xce73('0x28'));_0x2c61a0[_0xce73('0x30')]=_[_0xce73('0x31')](_0x50a7b6[_0xce73('0x30')]);_0x2c61a0[_0xce73('0x32')]=_[_0xce73('0x33')](_0x2c61a0[_0xce73('0x2f')],_0x2c61a0[_0xce73('0x30')]);_0x56de61[_0xce73('0x34')]=_[_0xce73('0x33')](_0x2c61a0['model'],qs[_0xce73('0x35')](_0x50a7b6[_0xce73('0x30')][_0xce73('0x35')]));_0x56de61['attributes']=_0x56de61['attributes'][_0xce73('0x36')]?_0x56de61[_0xce73('0x34')]:_0x2c61a0[_0xce73('0x2f')];if(!_0x50a7b6[_0xce73('0x30')][_0xce73('0x37')](_0xce73('0x38'))){_0x56de61[_0xce73('0x1f')]=qs[_0xce73('0x1f')](_0x50a7b6[_0xce73('0x30')][_0xce73('0x1f')]);_0x56de61[_0xce73('0x1e')]=qs[_0xce73('0x1e')](_0x50a7b6['query'][_0xce73('0x1e')]);}_0x56de61[_0xce73('0x39')]=qs[_0xce73('0x3a')](_0x50a7b6[_0xce73('0x30')][_0xce73('0x3a')]);_0x56de61['where']=qs[_0xce73('0x32')](_[_0xce73('0x3b')](_0x50a7b6['query'],_0x2c61a0[_0xce73('0x32')]),_0x2e2b44);if(_0x50a7b6[_0xce73('0x30')]['filter']){_0x56de61[_0xce73('0x3c')]=_['merge'](_0x56de61[_0xce73('0x3c')],{'$or':_[_0xce73('0x2b')](_0x2e2b44,function(_0x36ede2){if(_0x36ede2[_0xce73('0x2e')]!==_0xce73('0x3d')){var _0x2fa505={};_0x2fa505[_0x36ede2['name']]={'$like':'%'+_0x50a7b6[_0xce73('0x30')][_0xce73('0x3e')]+'%'};return _0x2fa505;}})});}_0x56de61=_[_0xce73('0x3f')]({},_0x56de61,_0x50a7b6[_0xce73('0x40')]);var _0x38b759={'where':_0x56de61[_0xce73('0x3c')]};return db[_0xce73('0x41')][_0xce73('0x21')](_0x38b759)[_0xce73('0x25')](function(_0x8a9819){_0x179f54['count']=_0x8a9819;if(_0x50a7b6[_0xce73('0x30')][_0xce73('0x42')]){_0x56de61[_0xce73('0x43')]=[{'all':!![]}];}return db[_0xce73('0x41')][_0xce73('0x44')](_0x56de61);})[_0xce73('0x25')](function(_0x3d3343){_0x179f54[_0xce73('0x45')]=_0x3d3343;return _0x179f54;})[_0xce73('0x25')](respondWithFilteredResult(_0x51024e,_0x56de61))[_0xce73('0x46')](handleError(_0x51024e,null));};exports['show']=function(_0x440389,_0x485764){var _0x13b8a0={'raw':!![],'where':{'id':_0x440389[_0xce73('0x47')]['id']}},_0x349d14={};_0x349d14[_0xce73('0x2f')]=_[_0xce73('0x31')](db[_0xce73('0x41')]['rawAttributes']);_0x349d14[_0xce73('0x30')]=_[_0xce73('0x31')](_0x440389[_0xce73('0x30')]);_0x349d14['filters']=_[_0xce73('0x33')](_0x349d14[_0xce73('0x2f')],_0x349d14[_0xce73('0x30')]);_0x13b8a0['attributes']=_[_0xce73('0x33')](_0x349d14[_0xce73('0x2f')],qs[_0xce73('0x35')](_0x440389[_0xce73('0x30')]['fields']));_0x13b8a0['attributes']=_0x13b8a0['attributes'][_0xce73('0x36')]?_0x13b8a0[_0xce73('0x34')]:_0x349d14[_0xce73('0x2f')];if(_0x440389[_0xce73('0x30')][_0xce73('0x42')]){_0x13b8a0[_0xce73('0x43')]=[{'all':!![]}];}_0x13b8a0=_[_0xce73('0x3f')]({},_0x13b8a0,_0x440389[_0xce73('0x40')]);return db[_0xce73('0x41')][_0xce73('0x48')](_0x13b8a0)[_0xce73('0x25')](handleEntityNotFound(_0x485764,null))['then'](respondWithResult(_0x485764,null))['catch'](handleError(_0x485764,null));};exports[_0xce73('0x49')]=function(_0x522099,_0x5e4f82){return db['SquareDetailsReport'][_0xce73('0x49')](_0x522099[_0xce73('0x4a')],{})[_0xce73('0x25')](respondWithResult(_0x5e4f82,0xc9))[_0xce73('0x46')](handleError(_0x5e4f82,null));};exports['update']=function(_0x3fa7e1,_0x339d97){if(_0x3fa7e1[_0xce73('0x4a')]['id']){delete _0x3fa7e1[_0xce73('0x4a')]['id'];}return db['SquareDetailsReport'][_0xce73('0x48')]({'where':{'id':_0x3fa7e1[_0xce73('0x47')]['id']}})[_0xce73('0x25')](handleEntityNotFound(_0x339d97,null))[_0xce73('0x25')](saveUpdates(_0x3fa7e1['body'],null))[_0xce73('0x25')](respondWithResult(_0x339d97,null))[_0xce73('0x46')](handleError(_0x339d97,null));};exports[_0xce73('0x26')]=function(_0x5ba865,_0x2cb616){return db[_0xce73('0x41')][_0xce73('0x48')]({'where':{'id':_0x5ba865[_0xce73('0x47')]['id']}})[_0xce73('0x25')](handleEntityNotFound(_0x2cb616,null))['then'](removeEntity(_0x2cb616,null))[_0xce73('0x46')](handleError(_0x2cb616,null));};exports[_0xce73('0x4b')]=function(_0x1659cc,_0x5da3c6){return db[_0xce73('0x41')]['describe']()[_0xce73('0x25')](respondWithResult(_0x5da3c6,null))[_0xce73('0x46')](handleError(_0x5da3c6,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 98be966..50294d8 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 _0xbcb9=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','api','moment','request-promise'];(function(_0xe540c0,_0x2d98e5){var _0x130549=function(_0x4cfd79){while(--_0x4cfd79){_0xe540c0['push'](_0xe540c0['shift']());}};_0x130549(++_0x2d98e5);}(_0xbcb9,0xa4));var _0x9bcb=function(_0x102c20,_0x187eb4){_0x102c20=_0x102c20-0x0;var _0x3ba7d5=_0xbcb9[_0x102c20];return _0x3ba7d5;};'use strict';var _=require(_0x9bcb('0x0'));var util=require(_0x9bcb('0x1'));var logger=require('../../config/logger')(_0x9bcb('0x2'));var moment=require(_0x9bcb('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bcb('0x4'));var fs=require('fs');var path=require(_0x9bcb('0x5'));var rimraf=require(_0x9bcb('0x6'));var config=require(_0x9bcb('0x7'));var attributes=require(_0x9bcb('0x8'));module[_0x9bcb('0x9')]=function(_0x58ecc8,_0x4b9fd4){return _0x58ecc8[_0x9bcb('0xa')](_0x9bcb('0xb'),attributes,{'tableName':_0x9bcb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5702=['moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','../../config/logger','api'];(function(_0x1309f9,_0x3f6f6c){var _0x1815e2=function(_0x57ae7a){while(--_0x57ae7a){_0x1309f9['push'](_0x1309f9['shift']());}};_0x1815e2(++_0x3f6f6c);}(_0x5702,0x15c));var _0x2570=function(_0x267f71,_0x4c29b0){_0x267f71=_0x267f71-0x0;var _0x538048=_0x5702[_0x267f71];return _0x538048;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2570('0x0'))(_0x2570('0x1'));var moment=require(_0x2570('0x2'));var BPromise=require(_0x2570('0x3'));var rp=require(_0x2570('0x4'));var fs=require('fs');var path=require(_0x2570('0x5'));var rimraf=require(_0x2570('0x6'));var config=require('../../config/environment');var attributes=require(_0x2570('0x7'));module['exports']=function(_0x31c984,_0x32a83d){return _0x31c984['define'](_0x2570('0x8'),attributes,{'tableName':_0x2570('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 cca565d..8ee2b00 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 _0x8603=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8603,0x190));var _0x3860=function(_0x318fc2,_0x4c5017){_0x318fc2=_0x318fc2-0x0;var _0x5295c0=_0x8603[_0x318fc2];return _0x5295c0;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')](_0x45b799['body'],{'raw':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![]})[_0x3860('0x9')](function(_0x20a5b0){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger[_0x3860('0x17')](_0x3860('0x12'),_0x45b799,JSON[_0x3860('0x18')](_0x20a5b0));_0x4863bd(_0x20a5b0);})[_0x3860('0x11')](function(_0x2e0b6e){logger[_0x3860('0xd')](_0x3860('0x12'),_0x2e0b6e[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15['error'](0x1f4,_0x2e0b6e[_0x3860('0xe')]));});});}; \ No newline at end of file +var _0x793b=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x793b,0x189));var _0xb793=function(_0x12e3de,_0x475c50){_0x12e3de=_0x12e3de-0x0;var _0x58cb0d=_0x793b[_0x12e3de];return _0x58cb0d;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}exports[_0xb793('0x16')]=function(_0x977026){var _0x2914a2=this;return new Promise(function(_0x2c9e87,_0x101162){return db[_0xb793('0x17')][_0xb793('0x18')](_0x977026[_0xb793('0x19')],{'raw':_0x977026[_0xb793('0x1a')]?_0x977026['options'][_0xb793('0x1b')]===undefined?!![]:![]:!![]})[_0xb793('0xc')](function(_0x54bfd4){logger[_0xb793('0xd')](_0xb793('0x16'),_0x977026);logger[_0xb793('0xf')](_0xb793('0x16'),_0x977026,JSON[_0xb793('0x1c')](_0x54bfd4));_0x2c9e87(_0x54bfd4);})['catch'](function(_0x5ecf9c){logger[_0xb793('0x11')](_0xb793('0x16'),_0x5ecf9c[_0xb793('0x12')],_0x977026);_0x101162(_0x2914a2[_0xb793('0x11')](0x1f4,_0x5ecf9c[_0xb793('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index afce5c1..ee2faa9 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 _0xfdad=['index','killProcess','exports','express','Router','./system.controller','get','isAuthenticated'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xfdad,0x14b));var _0xdfda=function(_0x760d71,_0x231004){_0x760d71=_0x760d71-0x0;var _0x8dfc7b=_0xfdad[_0x760d71];return _0x8dfc7b;};'use strict';var express=require(_0xdfda('0x0'));var router=express[_0xdfda('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdfda('0x2'));router[_0xdfda('0x3')]('/',auth[_0xdfda('0x4')](),controller[_0xdfda('0x5')]);router[_0xdfda('0x3')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0xdfda('0x6')]);module[_0xdfda('0x7')]=router; \ No newline at end of file +var _0x29b4=['../../components/auth/service','./system.controller','index','get','/process/:pid/kill','isAuthenticated','killProcess','express'];(function(_0x292c77,_0x17cb80){var _0x277de5=function(_0xbd65a2){while(--_0xbd65a2){_0x292c77['push'](_0x292c77['shift']());}};_0x277de5(++_0x17cb80);}(_0x29b4,0xaf));var _0x429b=function(_0x102037,_0x2c1064){_0x102037=_0x102037-0x0;var _0x3f7b69=_0x29b4[_0x102037];return _0x3f7b69;};'use strict';var express=require(_0x429b('0x0'));var router=express['Router']();var auth=require(_0x429b('0x1'));var controller=require(_0x429b('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x429b('0x3')]);router[_0x429b('0x4')](_0x429b('0x5'),auth[_0x429b('0x6')](),controller[_0x429b('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 00b321b..758ac8d 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 _0x90e8=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','exec','api','util','bluebird','error','inspect','name','send','index','getAllData','status','json','catch','format','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x1db834,_0x5e564d){var _0x436f37=function(_0x47194a){while(--_0x47194a){_0x1db834['push'](_0x1db834['shift']());}};_0x436f37(++_0x5e564d);}(_0x90e8,0x1b7));var _0x890e=function(_0x133502,_0x302ac0){_0x133502=_0x133502-0x0;var _0x18b0ff=_0x90e8[_0x133502];return _0x18b0ff;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x890e('0x0')];var logger=require('../../config/logger')(_0x890e('0x1'));var util=require(_0x890e('0x2'));var BPromise=require(_0x890e('0x3'));var _=require('lodash');function handleError(_0x866bef,_0x59f730,_0x254eef){_0x59f730=_0x59f730||0x1f4;return function(_0x2079c8){logger[_0x890e('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x254eef,_0x59f730,util[_0x890e('0x5')](_0x2079c8,{'showHidden':![],'depth':null}));delete _0x2079c8[_0x890e('0x6')];_0x866bef['status'](_0x59f730)[_0x890e('0x7')](_0x2079c8);};}exports[_0x890e('0x8')]=function(_0xb6226,_0x30adf7){return info[_0x890e('0x9')]()['then'](function(_0x4f123a){return _0x30adf7[_0x890e('0xa')](0xc8)[_0x890e('0xb')](_0x4f123a);})[_0x890e('0xc')](function(_0x5ece5a){return _0x30adf7[_0x890e('0xa')](0x1f4)[_0x890e('0xb')](_0x5ece5a);});};exports['killProcess']=function(_0x59e510,_0x239b40){var _0x5427f3=['components/import/cm'];return new BPromise(function(_0x26a9b4,_0x52c349){return exec(util[_0x890e('0xd')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x59e510[_0x890e('0xe')][_0x890e('0xf')]),function(_0x7a0a01,_0x106ab1,_0x528188){if(_0x7a0a01){return _0x52c349(_0x7a0a01);}return _0x26a9b4(_0x106ab1);});})[_0x890e('0x10')](function(_0x2ceef0){var _0x290918=![];var _0x22ba46=_0x2ceef0['split'](/\n/);for(var _0x399f33=0x0,_0x2f2329=_0x5427f3[_0x890e('0x11')];_0x399f33<_0x2f2329,_0x290918===![];_0x399f33+=0x1){if(_0x2ceef0[_0x890e('0x12')](_0x5427f3[_0x399f33])>=0x0){_0x290918=!![];}}if(!_0x290918){throw new Error(util[_0x890e('0xd')](_0x890e('0x13'),_0x59e510['params']['pid']));}process[_0x890e('0x14')](_0x59e510['params'][_0x890e('0xf')],_0x890e('0x15'));return _0x239b40[_0x890e('0xa')](0xc8)[_0x890e('0xb')]({'message':util[_0x890e('0xd')](_0x890e('0x16'),_0x59e510[_0x890e('0xe')][_0x890e('0xf')])});})[_0x890e('0xc')](handleError(_0x239b40,null,'killProcess'));}; \ No newline at end of file +var _0xd473=['params','pid','length','indexOf','format','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x1db08b,_0x112908){var _0x11880e=function(_0x157559){while(--_0x157559){_0x1db08b['push'](_0x1db08b['shift']());}};_0x11880e(++_0x112908);}(_0xd473,0x158));var _0x3d47=function(_0x4afde0,_0x3453ee){_0x4afde0=_0x4afde0-0x0;var _0xdff577=_0xd473[_0x4afde0];return _0xdff577;};'use strict';var info=require('systeminformation');var exec=require(_0x3d47('0x0'))[_0x3d47('0x1')];var logger=require('../../config/logger')(_0x3d47('0x2'));var util=require(_0x3d47('0x3'));var BPromise=require(_0x3d47('0x4'));var _=require(_0x3d47('0x5'));function handleError(_0x4797fa,_0x185dc1,_0xee0219){_0x185dc1=_0x185dc1||0x1f4;return function(_0x262b88){logger[_0x3d47('0x6')](_0x3d47('0x7'),_0xee0219,_0x185dc1,util[_0x3d47('0x8')](_0x262b88,{'showHidden':![],'depth':null}));delete _0x262b88[_0x3d47('0x9')];_0x4797fa[_0x3d47('0xa')](_0x185dc1)[_0x3d47('0xb')](_0x262b88);};}exports[_0x3d47('0xc')]=function(_0x56c565,_0x4dc07e){return info[_0x3d47('0xd')]()[_0x3d47('0xe')](function(_0x24b3f8){return _0x4dc07e[_0x3d47('0xa')](0xc8)['json'](_0x24b3f8);})[_0x3d47('0xf')](function(_0x3a471e){return _0x4dc07e[_0x3d47('0xa')](0x1f4)[_0x3d47('0x10')](_0x3a471e);});};exports[_0x3d47('0x11')]=function(_0x1299b8,_0xdfc361){var _0x1ce24c=[_0x3d47('0x12')];return new BPromise(function(_0x15ad01,_0x4d3314){return exec(util['format'](_0x3d47('0x13'),_0x1299b8[_0x3d47('0x14')][_0x3d47('0x15')]),function(_0x238043,_0xbbc077,_0x5aefb0){if(_0x238043){return _0x4d3314(_0x238043);}return _0x15ad01(_0xbbc077);});})[_0x3d47('0xe')](function(_0x1e0e2d){var _0x56a196=![];var _0x1a0f4c=_0x1e0e2d['split'](/\n/);for(var _0x40d176=0x0,_0x304bd6=_0x1ce24c[_0x3d47('0x16')];_0x40d176<_0x304bd6,_0x56a196===![];_0x40d176+=0x1){if(_0x1e0e2d[_0x3d47('0x17')](_0x1ce24c[_0x40d176])>=0x0){_0x56a196=!![];}}if(!_0x56a196){throw new Error(util[_0x3d47('0x18')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1299b8['params']['pid']));}process[_0x3d47('0x19')](_0x1299b8['params'][_0x3d47('0x15')],_0x3d47('0x1a'));return _0xdfc361['status'](0xc8)[_0x3d47('0x10')]({'message':util[_0x3d47('0x18')](_0x3d47('0x1b'),_0x1299b8['params']['pid'])});})[_0x3d47('0xf')](handleError(_0xdfc361,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6ebe1f1..1c141b1 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 _0xbacd=['../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','update','/:id','destroy','exports','multer','util','path','express'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xbacd,0x194));var _0xdbac=function(_0x5200e3,_0x5386d8){_0x5200e3=_0x5200e3-0x0;var _0x1590da=_0xbacd[_0x5200e3];return _0x1590da;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require(_0xdbac('0x2'));var timeout=require('connect-timeout');var express=require(_0xdbac('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbac('0x4'));var config=require(_0xdbac('0x5'));var controller=require(_0xdbac('0x6'));router[_0xdbac('0x7')]('/',auth[_0xdbac('0x8')](),controller[_0xdbac('0x9')]);router[_0xdbac('0x7')]('/:id',auth[_0xdbac('0x8')](),controller[_0xdbac('0xa')]);router[_0xdbac('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbac('0xc')]);router['put']('/:id',auth[_0xdbac('0x8')](),controller[_0xdbac('0xd')]);router['delete'](_0xdbac('0xe'),auth['isAuthenticated'](),controller[_0xdbac('0xf')]);module[_0xdbac('0x10')]=router; \ No newline at end of file +var _0x63a6=['/:id','post','isAuthenticated','create','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x63a6,0x1c7));var _0x663a=function(_0x543eac,_0x3a39a1){_0x543eac=_0x543eac-0x0;var _0x16c036=_0x63a6[_0x543eac];return _0x16c036;};'use strict';var multer=require('multer');var util=require(_0x663a('0x0'));var path=require(_0x663a('0x1'));var timeout=require('connect-timeout');var express=require(_0x663a('0x2'));var router=express[_0x663a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x663a('0x4'));var interaction=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var controller=require(_0x663a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x663a('0x8')](_0x663a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x663a('0xa')]('/',auth[_0x663a('0xb')](),controller[_0x663a('0xc')]);router['put']('/:id',auth[_0x663a('0xb')](),controller[_0x663a('0xd')]);router[_0x663a('0xe')](_0x663a('0x9'),auth[_0x663a('0xb')](),controller[_0x663a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c8c9241..45930f3 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 _0xca1d=['#0091EA','sequelize','exports','STRING','name'];(function(_0x356880,_0x45bf61){var _0x27b743=function(_0x2acb65){while(--_0x2acb65){_0x356880['push'](_0x356880['shift']());}};_0x27b743(++_0x45bf61);}(_0xca1d,0x1e6));var _0xdca1=function(_0x2d538e,_0x3df38b){_0x2d538e=_0x2d538e-0x0;var _0x4a4712=_0xca1d[_0x2d538e];return _0x4a4712;};'use strict';var Sequelize=require(_0xdca1('0x0'));module[_0xdca1('0x1')]={'name':{'type':Sequelize[_0xdca1('0x2')],'unique':_0xdca1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xdca1('0x2')],'defaultValue':_0xdca1('0x4')},'description':{'type':Sequelize[_0xdca1('0x2')]}}; \ No newline at end of file +var _0x337f=['sequelize','exports','STRING','#0091EA'];(function(_0x3b11e1,_0x419332){var _0x3e6697=function(_0xaa9f0a){while(--_0xaa9f0a){_0x3b11e1['push'](_0x3b11e1['shift']());}};_0x3e6697(++_0x419332);}(_0x337f,0x11c));var _0xf337=function(_0x5dc768,_0x5501ac){_0x5dc768=_0x5dc768-0x0;var _0x59ee8a=_0x337f[_0x5dc768];return _0x59ee8a;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'name':{'type':Sequelize[_0xf337('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf337('0x2')],'defaultValue':_0xf337('0x3')},'description':{'type':Sequelize[_0xf337('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index bc763ef..48a0722 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 _0xbec5=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','name','send','index','map','Tag','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','options','includeAll','include','catch','show','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x5e1c4e,_0x3282fb){var _0x4fea36=function(_0x5d0fa3){while(--_0x5d0fa3){_0x5e1c4e['push'](_0x5e1c4e['shift']());}};_0x4fea36(++_0x3282fb);}(_0xbec5,0xe5));var _0x5bec=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0xbec5[_0x476b00];return _0x44ec8e;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x1c888f,_0x589d14){_0x589d14=_0x589d14||0xcc;return function(_0x2d2ba2){if(_0x2d2ba2){return _0x1c888f[_0x5bec('0x19')](_0x589d14);}return _0x1c888f[_0x5bec('0x1a')](_0x589d14)[_0x5bec('0x1b')]();};}function respondWithResult(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xc8;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1a')](_0xcd6d90)[_0x5bec('0x1c')](_0x24dcd6);}};}function respondWithFilteredResult(_0x3ebc41,_0x31b9e4){return function(_0x325daf){if(_0x325daf){var _0x11fb8e=typeof _0x31b9e4['offset']==='undefined'&&typeof _0x31b9e4[_0x5bec('0x1d')]===_0x5bec('0x1e');var _0x31ad9c=_0x325daf[_0x5bec('0x1f')];var _0x5cd7ae=_0x11fb8e?0x0:_0x31b9e4['offset'];var _0x3cd354=_0x11fb8e?_0x325daf[_0x5bec('0x1f')]:_0x31b9e4['offset']+_0x31b9e4[_0x5bec('0x1d')];var _0xa7e223;if(_0x3cd354>=_0x31ad9c){_0x3cd354=_0x31ad9c;_0xa7e223=0xc8;}else{_0xa7e223=0xce;}_0x3ebc41[_0x5bec('0x1a')](_0xa7e223);return _0x3ebc41[_0x5bec('0x20')]('Content-Range',_0x5cd7ae+'-'+_0x3cd354+'/'+_0x31ad9c)[_0x5bec('0x1c')](_0x325daf);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x21')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x22')](_0x3e1896);}return _0x191c0f[_0x5bec('0x23')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x24')](_0x5e154e)[_0x5bec('0x25')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x26')]()[_0x5bec('0x25')](function(){var _0x43d460=_0x4e0ca2[_0x5bec('0x27')]({'plain':!![]});var _0x226d55=_0x5bec('0x28');return db[_0x5bec('0x29')]['destroy']({'where':{'type':_0x226d55,'resourceId':_0x43d460['id']}})['then'](function(){return _0x4e0ca2;});})['then'](function(){_0xa414f8[_0x5bec('0x1a')](0xcc)[_0x5bec('0x1b')]();});}};}function handleEntityNotFound(_0x338c25,_0x4939a5){return function(_0x2b3b2c){if(!_0x2b3b2c){_0x338c25[_0x5bec('0x19')](0x194);}return _0x2b3b2c;};}function handleError(_0x57331b,_0x29e358){_0x29e358=_0x29e358||0x1f4;return function(_0x63ac8){logger['error'](_0x63ac8['stack']);if(_0x63ac8[_0x5bec('0x2a')]){delete _0x63ac8[_0x5bec('0x2a')];}_0x57331b[_0x5bec('0x1a')](_0x29e358)[_0x5bec('0x2b')](_0x63ac8);};}exports[_0x5bec('0x2c')]=function(_0x3f224c,_0x5d6621){var _0x2987ca={},_0x59b5b6={},_0x45863b={'count':0x0,'rows':[]};var _0xafbd94=_[_0x5bec('0x2d')](db[_0x5bec('0x2e')]['rawAttributes'],function(_0x2b42c8){return{'name':_0x2b42c8[_0x5bec('0x2f')],'type':_0x2b42c8[_0x5bec('0x30')]['key']};});_0x59b5b6[_0x5bec('0x31')]=_['map'](_0xafbd94,_0x5bec('0x2a'));_0x59b5b6[_0x5bec('0x32')]=_[_0x5bec('0x33')](_0x3f224c['query']);_0x59b5b6[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x59b5b6['model'],_0x59b5b6[_0x5bec('0x32')]);_0x2987ca[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x59b5b6[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x3f224c['query'][_0x5bec('0x37')]));_0x2987ca['attributes']=_0x2987ca[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2987ca[_0x5bec('0x36')]:_0x59b5b6[_0x5bec('0x31')];if(!_0x3f224c[_0x5bec('0x32')][_0x5bec('0x39')]('nolimit')){_0x2987ca[_0x5bec('0x1d')]=qs[_0x5bec('0x1d')](_0x3f224c[_0x5bec('0x32')]['limit']);_0x2987ca[_0x5bec('0x3a')]=qs[_0x5bec('0x3a')](_0x3f224c['query'][_0x5bec('0x3a')]);}_0x2987ca['order']=qs[_0x5bec('0x3b')](_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3b')]);_0x2987ca['where']=qs[_0x5bec('0x34')](_[_0x5bec('0x3c')](_0x3f224c[_0x5bec('0x32')],_0x59b5b6[_0x5bec('0x34')]),_0xafbd94);if(_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3d')]){_0x2987ca[_0x5bec('0x3e')]=_['merge'](_0x2987ca[_0x5bec('0x3e')],{'$or':_[_0x5bec('0x2d')](_0xafbd94,function(_0x323812){if(_0x323812[_0x5bec('0x30')]!=='VIRTUAL'){var _0x27863b={};_0x27863b[_0x323812[_0x5bec('0x2a')]]={'$like':'%'+_0x3f224c[_0x5bec('0x32')]['filter']+'%'};return _0x27863b;}})});}_0x2987ca=_['merge']({},_0x2987ca,_0x3f224c[_0x5bec('0x3f')]);var _0x153d02={'where':_0x2987ca[_0x5bec('0x3e')]};return db[_0x5bec('0x2e')][_0x5bec('0x1f')](_0x153d02)['then'](function(_0x4fee8a){_0x45863b[_0x5bec('0x1f')]=_0x4fee8a;if(_0x3f224c['query'][_0x5bec('0x40')]){_0x2987ca[_0x5bec('0x41')]=[{'all':!![]}];}return db[_0x5bec('0x2e')]['findAll'](_0x2987ca);})[_0x5bec('0x25')](function(_0x26a4a5){_0x45863b['rows']=_0x26a4a5;return _0x45863b;})[_0x5bec('0x25')](respondWithFilteredResult(_0x5d6621,_0x2987ca))[_0x5bec('0x42')](handleError(_0x5d6621,null));};exports[_0x5bec('0x43')]=function(_0x2b51f7,_0x3b5631){var _0x2724cf={'raw':!![],'where':{'id':_0x2b51f7['params']['id']}},_0x3a795c={};_0x3a795c['model']=_[_0x5bec('0x33')](db['Tag']['rawAttributes']);_0x3a795c[_0x5bec('0x32')]=_['keys'](_0x2b51f7['query']);_0x3a795c['filters']=_[_0x5bec('0x35')](_0x3a795c[_0x5bec('0x31')],_0x3a795c[_0x5bec('0x32')]);_0x2724cf[_0x5bec('0x36')]=_['intersection'](_0x3a795c[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x2b51f7[_0x5bec('0x32')][_0x5bec('0x37')]));_0x2724cf['attributes']=_0x2724cf[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2724cf[_0x5bec('0x36')]:_0x3a795c['model'];if(_0x2b51f7[_0x5bec('0x32')]['includeAll']){_0x2724cf[_0x5bec('0x41')]=[{'all':!![]}];}_0x2724cf=_[_0x5bec('0x44')]({},_0x2724cf,_0x2b51f7[_0x5bec('0x3f')]);return db[_0x5bec('0x2e')]['find'](_0x2724cf)[_0x5bec('0x25')](handleEntityNotFound(_0x3b5631,null))[_0x5bec('0x25')](respondWithResult(_0x3b5631,null))[_0x5bec('0x42')](handleError(_0x3b5631,null));};exports[_0x5bec('0x45')]=function(_0x35b250,_0x123758){return db[_0x5bec('0x2e')]['create'](_0x35b250[_0x5bec('0x46')],{})[_0x5bec('0x25')](function(_0x5775ca){var _0x273e09=_0x35b250[_0x5bec('0x47')][_0x5bec('0x27')]({'plain':!![]});if(!_0x273e09)throw new Error(_0x5bec('0x48'));if(_0x273e09[_0x5bec('0x49')]===_0x5bec('0x47')){var _0x3545a5=_0x5775ca['get']({'plain':!![]});var _0x101dcb='Tags';return db[_0x5bec('0x4a')][_0x5bec('0x4b')]({'where':{'name':_0x101dcb,'userProfileId':_0x273e09[_0x5bec('0x4c')]},'raw':!![]})[_0x5bec('0x25')](function(_0x158e8e){if(_0x158e8e&&_0x158e8e[_0x5bec('0x4d')]===0x0){return db[_0x5bec('0x29')][_0x5bec('0x45')]({'name':_0x3545a5[_0x5bec('0x2a')],'resourceId':_0x3545a5['id'],'type':_0x158e8e[_0x5bec('0x2a')],'sectionId':_0x158e8e['id']},{})['then'](function(){return _0x5775ca;});}else{return _0x5775ca;}})[_0x5bec('0x42')](function(_0x51af88){logger['error'](_0x5bec('0x4e'),_0x51af88);throw _0x51af88;});}return _0x5775ca;})['then'](respondWithResult(_0x123758,0xc9))['catch'](handleError(_0x123758,null));};exports[_0x5bec('0x24')]=function(_0x2114e5,_0x416058){if(_0x2114e5['body']['id']){delete _0x2114e5[_0x5bec('0x46')]['id'];}return db[_0x5bec('0x2e')][_0x5bec('0x4b')]({'where':{'id':_0x2114e5[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x416058,null))[_0x5bec('0x25')](saveUpdates(_0x2114e5[_0x5bec('0x46')],null))[_0x5bec('0x25')](respondWithResult(_0x416058,null))[_0x5bec('0x42')](handleError(_0x416058,null));};exports[_0x5bec('0x26')]=function(_0x3ddf28,_0x33b924){return db['Tag']['find']({'where':{'id':_0x3ddf28[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33b924,null))[_0x5bec('0x25')](removeEntity(_0x33b924,null))[_0x5bec('0x42')](handleError(_0x33b924,null));}; \ No newline at end of file +var _0x01fe=['where','filters','pick','filter','merge','options','includeAll','include','catch','show','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','stack','name','send','index','map','Tag','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x876980,_0x3a8737){var _0x128e19=function(_0x5e8bc0){while(--_0x5e8bc0){_0x876980['push'](_0x876980['shift']());}};_0x128e19(++_0x3a8737);}(_0x01fe,0x102));var _0xe01f=function(_0x5dfd8b,_0x41e1e0){_0x5dfd8b=_0x5dfd8b-0x0;var _0x29d20f=_0x01fe[_0x5dfd8b];return _0x29d20f;};'use strict';var emlformat=require(_0xe01f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe01f('0x1'));var jsonpatch=require(_0xe01f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe01f('0x3'));var Mustache=require(_0xe01f('0x4'));var util=require(_0xe01f('0x5'));var path=require(_0xe01f('0x6'));var sox=require('sox');var csv=require(_0xe01f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe01f('0x8'));var _=require(_0xe01f('0x9'));var squel=require(_0xe01f('0xa'));var crypto=require(_0xe01f('0xb'));var jsforce=require(_0xe01f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe01f('0x7'));var querystring=require(_0xe01f('0xd'));var Papa=require('papaparse');var Redis=require(_0xe01f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe01f('0xf'));var as=require(_0xe01f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe01f('0x11'))('api');var utils=require(_0xe01f('0x12'));var config=require(_0xe01f('0x13'));var licenseUtil=require(_0xe01f('0x14'));var db=require(_0xe01f('0x15'))['db'];function respondWithStatusCode(_0x2d3162,_0x94e3d8){_0x94e3d8=_0x94e3d8||0xcc;return function(_0x81aef3){if(_0x81aef3){return _0x2d3162[_0xe01f('0x16')](_0x94e3d8);}return _0x2d3162['status'](_0x94e3d8)[_0xe01f('0x17')]();};}function respondWithResult(_0x3a9b4b,_0x2d55c8){_0x2d55c8=_0x2d55c8||0xc8;return function(_0x3cb8ac){if(_0x3cb8ac){return _0x3a9b4b[_0xe01f('0x18')](_0x2d55c8)[_0xe01f('0x19')](_0x3cb8ac);}};}function respondWithFilteredResult(_0x664fbb,_0x5e5e30){return function(_0x53d3a1){if(_0x53d3a1){var _0x5e3877=typeof _0x5e5e30[_0xe01f('0x1a')]===_0xe01f('0x1b')&&typeof _0x5e5e30[_0xe01f('0x1c')]===_0xe01f('0x1b');var _0x26cd4c=_0x53d3a1[_0xe01f('0x1d')];var _0x144eef=_0x5e3877?0x0:_0x5e5e30[_0xe01f('0x1a')];var _0x9ee4b5=_0x5e3877?_0x53d3a1[_0xe01f('0x1d')]:_0x5e5e30['offset']+_0x5e5e30[_0xe01f('0x1c')];var _0x5ca305;if(_0x9ee4b5>=_0x26cd4c){_0x9ee4b5=_0x26cd4c;_0x5ca305=0xc8;}else{_0x5ca305=0xce;}_0x664fbb[_0xe01f('0x18')](_0x5ca305);return _0x664fbb[_0xe01f('0x1e')](_0xe01f('0x1f'),_0x144eef+'-'+_0x9ee4b5+'/'+_0x26cd4c)[_0xe01f('0x19')](_0x53d3a1);}return null;};}function patchUpdates(_0x5e9523){return function(_0x32a6b9){try{jsonpatch[_0xe01f('0x20')](_0x32a6b9,_0x5e9523,!![]);}catch(_0xccaf80){return BPromise[_0xe01f('0x21')](_0xccaf80);}return _0x32a6b9[_0xe01f('0x22')]();};}function saveUpdates(_0x3c34fa,_0x570d48){return function(_0x1faeb8){if(_0x1faeb8){return _0x1faeb8[_0xe01f('0x23')](_0x3c34fa)[_0xe01f('0x24')](function(_0xa6da95){return _0xa6da95;});}return null;};}function removeEntity(_0x2480ec,_0x38efcc){return function(_0x1ea55b){if(_0x1ea55b){return _0x1ea55b[_0xe01f('0x25')]()[_0xe01f('0x24')](function(){var _0x4b44b6=_0x1ea55b['get']({'plain':!![]});var _0x3138d3=_0xe01f('0x26');return db[_0xe01f('0x27')][_0xe01f('0x25')]({'where':{'type':_0x3138d3,'resourceId':_0x4b44b6['id']}})['then'](function(){return _0x1ea55b;});})[_0xe01f('0x24')](function(){_0x2480ec[_0xe01f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x378c93,_0x5b9c5e){return function(_0x1b77c8){if(!_0x1b77c8){_0x378c93[_0xe01f('0x16')](0x194);}return _0x1b77c8;};}function handleError(_0x13dcd4,_0x4b85b8){_0x4b85b8=_0x4b85b8||0x1f4;return function(_0x940cb6){logger['error'](_0x940cb6[_0xe01f('0x28')]);if(_0x940cb6[_0xe01f('0x29')]){delete _0x940cb6[_0xe01f('0x29')];}_0x13dcd4[_0xe01f('0x18')](_0x4b85b8)[_0xe01f('0x2a')](_0x940cb6);};}exports[_0xe01f('0x2b')]=function(_0x11386e,_0x41d13d){var _0x1bdfcf={},_0x590598={},_0x3f725a={'count':0x0,'rows':[]};var _0x4bc3c8=_[_0xe01f('0x2c')](db[_0xe01f('0x2d')]['rawAttributes'],function(_0x15f98f){return{'name':_0x15f98f[_0xe01f('0x2e')],'type':_0x15f98f[_0xe01f('0x2f')]['key']};});_0x590598[_0xe01f('0x30')]=_[_0xe01f('0x2c')](_0x4bc3c8,_0xe01f('0x29'));_0x590598[_0xe01f('0x31')]=_[_0xe01f('0x32')](_0x11386e['query']);_0x590598['filters']=_['intersection'](_0x590598[_0xe01f('0x30')],_0x590598['query']);_0x1bdfcf[_0xe01f('0x33')]=_[_0xe01f('0x34')](_0x590598[_0xe01f('0x30')],qs[_0xe01f('0x35')](_0x11386e[_0xe01f('0x31')][_0xe01f('0x35')]));_0x1bdfcf[_0xe01f('0x33')]=_0x1bdfcf[_0xe01f('0x33')]['length']?_0x1bdfcf['attributes']:_0x590598[_0xe01f('0x30')];if(!_0x11386e[_0xe01f('0x31')][_0xe01f('0x36')](_0xe01f('0x37'))){_0x1bdfcf['limit']=qs[_0xe01f('0x1c')](_0x11386e[_0xe01f('0x31')][_0xe01f('0x1c')]);_0x1bdfcf['offset']=qs[_0xe01f('0x1a')](_0x11386e[_0xe01f('0x31')][_0xe01f('0x1a')]);}_0x1bdfcf[_0xe01f('0x38')]=qs[_0xe01f('0x39')](_0x11386e[_0xe01f('0x31')][_0xe01f('0x39')]);_0x1bdfcf[_0xe01f('0x3a')]=qs[_0xe01f('0x3b')](_[_0xe01f('0x3c')](_0x11386e[_0xe01f('0x31')],_0x590598[_0xe01f('0x3b')]),_0x4bc3c8);if(_0x11386e[_0xe01f('0x31')][_0xe01f('0x3d')]){_0x1bdfcf[_0xe01f('0x3a')]=_['merge'](_0x1bdfcf[_0xe01f('0x3a')],{'$or':_[_0xe01f('0x2c')](_0x4bc3c8,function(_0x1deac7){if(_0x1deac7[_0xe01f('0x2f')]!=='VIRTUAL'){var _0x36783f={};_0x36783f[_0x1deac7[_0xe01f('0x29')]]={'$like':'%'+_0x11386e[_0xe01f('0x31')][_0xe01f('0x3d')]+'%'};return _0x36783f;}})});}_0x1bdfcf=_[_0xe01f('0x3e')]({},_0x1bdfcf,_0x11386e[_0xe01f('0x3f')]);var _0x4fbb62={'where':_0x1bdfcf[_0xe01f('0x3a')]};return db[_0xe01f('0x2d')][_0xe01f('0x1d')](_0x4fbb62)[_0xe01f('0x24')](function(_0x20421f){_0x3f725a[_0xe01f('0x1d')]=_0x20421f;if(_0x11386e[_0xe01f('0x31')][_0xe01f('0x40')]){_0x1bdfcf[_0xe01f('0x41')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x1bdfcf);})[_0xe01f('0x24')](function(_0x50b47){_0x3f725a['rows']=_0x50b47;return _0x3f725a;})[_0xe01f('0x24')](respondWithFilteredResult(_0x41d13d,_0x1bdfcf))[_0xe01f('0x42')](handleError(_0x41d13d,null));};exports[_0xe01f('0x43')]=function(_0x5625d8,_0x2eb993){var _0x2da2e9={'raw':!![],'where':{'id':_0x5625d8['params']['id']}},_0x56785b={};_0x56785b['model']=_[_0xe01f('0x32')](db['Tag'][_0xe01f('0x44')]);_0x56785b['query']=_[_0xe01f('0x32')](_0x5625d8[_0xe01f('0x31')]);_0x56785b[_0xe01f('0x3b')]=_[_0xe01f('0x34')](_0x56785b[_0xe01f('0x30')],_0x56785b[_0xe01f('0x31')]);_0x2da2e9[_0xe01f('0x33')]=_[_0xe01f('0x34')](_0x56785b[_0xe01f('0x30')],qs[_0xe01f('0x35')](_0x5625d8[_0xe01f('0x31')]['fields']));_0x2da2e9[_0xe01f('0x33')]=_0x2da2e9[_0xe01f('0x33')][_0xe01f('0x45')]?_0x2da2e9[_0xe01f('0x33')]:_0x56785b[_0xe01f('0x30')];if(_0x5625d8['query'][_0xe01f('0x40')]){_0x2da2e9['include']=[{'all':!![]}];}_0x2da2e9=_['merge']({},_0x2da2e9,_0x5625d8[_0xe01f('0x3f')]);return db[_0xe01f('0x2d')][_0xe01f('0x46')](_0x2da2e9)[_0xe01f('0x24')](handleEntityNotFound(_0x2eb993,null))[_0xe01f('0x24')](respondWithResult(_0x2eb993,null))['catch'](handleError(_0x2eb993,null));};exports[_0xe01f('0x47')]=function(_0x337c5d,_0x3bb3b7){return db[_0xe01f('0x2d')][_0xe01f('0x47')](_0x337c5d[_0xe01f('0x48')],{})[_0xe01f('0x24')](function(_0x5a511c){var _0x3f4ae0=_0x337c5d['user'][_0xe01f('0x49')]({'plain':!![]});if(!_0x3f4ae0)throw new Error(_0xe01f('0x4a'));if(_0x3f4ae0['role']===_0xe01f('0x4b')){var _0x100742=_0x5a511c[_0xe01f('0x49')]({'plain':!![]});var _0xea4320=_0xe01f('0x26');return db[_0xe01f('0x4c')]['find']({'where':{'name':_0xea4320,'userProfileId':_0x3f4ae0['userProfileId']},'raw':!![]})[_0xe01f('0x24')](function(_0x216f69){if(_0x216f69&&_0x216f69['autoAssociation']===0x0){return db[_0xe01f('0x27')][_0xe01f('0x47')]({'name':_0x100742[_0xe01f('0x29')],'resourceId':_0x100742['id'],'type':_0x216f69[_0xe01f('0x29')],'sectionId':_0x216f69['id']},{})[_0xe01f('0x24')](function(){return _0x5a511c;});}else{return _0x5a511c;}})[_0xe01f('0x42')](function(_0x4ffa43){logger[_0xe01f('0x4d')](_0xe01f('0x4e'),_0x4ffa43);throw _0x4ffa43;});}return _0x5a511c;})['then'](respondWithResult(_0x3bb3b7,0xc9))[_0xe01f('0x42')](handleError(_0x3bb3b7,null));};exports[_0xe01f('0x23')]=function(_0x33b9a8,_0x47089f){if(_0x33b9a8[_0xe01f('0x48')]['id']){delete _0x33b9a8[_0xe01f('0x48')]['id'];}return db['Tag'][_0xe01f('0x46')]({'where':{'id':_0x33b9a8['params']['id']}})['then'](handleEntityNotFound(_0x47089f,null))[_0xe01f('0x24')](saveUpdates(_0x33b9a8[_0xe01f('0x48')],null))[_0xe01f('0x24')](respondWithResult(_0x47089f,null))[_0xe01f('0x42')](handleError(_0x47089f,null));};exports[_0xe01f('0x25')]=function(_0x3b0ab1,_0x3949e1){return db[_0xe01f('0x2d')]['find']({'where':{'id':_0x3b0ab1['params']['id']}})[_0xe01f('0x24')](handleEntityNotFound(_0x3949e1,null))['then'](removeEntity(_0x3949e1,null))[_0xe01f('0x42')](handleError(_0x3949e1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2bca76b..9416346 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 _0x0f69=['Tag','tools_tags','../../config/logger','moment','bluebird','path','rimraf','./tag.attributes','define'];(function(_0xddc8d,_0x28a9db){var _0xc78f00=function(_0x159fa0){while(--_0x159fa0){_0xddc8d['push'](_0xddc8d['shift']());}};_0xc78f00(++_0x28a9db);}(_0x0f69,0x173));var _0x90f6=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x0f69[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90f6('0x0'))('api');var moment=require(_0x90f6('0x1'));var BPromise=require(_0x90f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f6('0x3'));var rimraf=require(_0x90f6('0x4'));var config=require('../../config/environment');var attributes=require(_0x90f6('0x5'));module['exports']=function(_0x1840a5,_0x3dfd95){return _0x1840a5[_0x90f6('0x6')](_0x90f6('0x7'),attributes,{'tableName':_0x90f6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x246f=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash'];(function(_0xf52d2f,_0x2f35f2){var _0x50646c=function(_0x5b3f1f){while(--_0x5b3f1f){_0xf52d2f['push'](_0xf52d2f['shift']());}};_0x50646c(++_0x2f35f2);}(_0x246f,0x1c6));var _0xf246=function(_0x42b54b,_0x2a7ffb){_0x42b54b=_0x42b54b-0x0;var _0x4123a3=_0x246f[_0x42b54b];return _0x4123a3;};'use strict';var _=require(_0xf246('0x0'));var util=require(_0xf246('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf246('0x2'));var BPromise=require(_0xf246('0x3'));var rp=require(_0xf246('0x4'));var fs=require('fs');var path=require(_0xf246('0x5'));var rimraf=require(_0xf246('0x6'));var config=require(_0xf246('0x7'));var attributes=require(_0xf246('0x8'));module[_0xf246('0x9')]=function(_0x159b9b,_0x3f21e2){return _0x159b9b[_0xf246('0xa')](_0xf246('0xb'),attributes,{'tableName':_0xf246('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 57dc904..31ff23f 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 _0xac31=['code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xac31,0xca));var _0x1ac3=function(_0x545b9a,_0x1eff16){_0x545b9a=_0x545b9a-0x0;var _0x421120=_0xac31[_0x545b9a];return _0x421120;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('Tag,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xdace,0xc5));var _0xedac=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xdace[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('Tag,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 78a2c42..0953488 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(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 4a14c4e..f2f1fdd 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 _0xd8b0=['exports','sequelize'];(function(_0xc78025,_0x40f2fc){var _0x11dacb=function(_0x38d8f8){while(--_0x38d8f8){_0xc78025['push'](_0xc78025['shift']());}};_0x11dacb(++_0x40f2fc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index cd3afd5..d01476d 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 _0x0cf4=['./team.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','name','index','map','Team','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','VIRTUAL','merge','findAll','then','rows','show','params','includeAll','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','sequelize','transaction','Sequelize','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','QueryTypes','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','findOne','channel','ValidationError','Unknown\x20channel','capitalize','Queue','pick','options','toLowerCase','Queues','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','penalty','QueueId','User','findOrCreate','emit','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','TeamVoiceQueue','all','Openchannel','removeAgents','Queue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','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','defaults','localhost','socket.io-emitter','redis'];(function(_0x32574a,_0x583170){var _0x534081=function(_0x3c6fb2){while(--_0x3c6fb2){_0x32574a['push'](_0x32574a['shift']());}};_0x534081(++_0x583170);}(_0x0cf4,0x7c));var _0x40cf=function(_0x1f2b50,_0x20b570){_0x1f2b50=_0x1f2b50-0x0;var _0x5675c1=_0x0cf4[_0x1f2b50];return _0x5675c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40cf('0x0'));var zipdir=require(_0x40cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40cf('0x2'));var moment=require(_0x40cf('0x3'));var BPromise=require(_0x40cf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x40cf('0x5'));var sox=require('sox');var csv=require(_0x40cf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40cf('0x7'));var squel=require(_0x40cf('0x8'));var crypto=require(_0x40cf('0x9'));var jsforce=require(_0x40cf('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x40cf('0xb'));var Redis=require(_0x40cf('0xc'));var authService=require(_0x40cf('0xd'));var qs=require(_0x40cf('0xe'));var as=require(_0x40cf('0xf'));var hardwareService=require(_0x40cf('0x10'));var logger=require(_0x40cf('0x11'))(_0x40cf('0x12'));var utils=require(_0x40cf('0x13'));var config=require(_0x40cf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x40cf('0x15'))['db'];config['redis']=_[_0x40cf('0x16')](config['redis'],{'host':_0x40cf('0x17'),'port':0x18eb});var socket=require(_0x40cf('0x18'))(new Redis(config[_0x40cf('0x19')]));require(_0x40cf('0x1a'))[_0x40cf('0x1b')](socket);function respondWithStatusCode(_0x267345,_0x28f021){_0x28f021=_0x28f021||0xcc;return function(_0x4c40c4){if(_0x4c40c4){return _0x267345[_0x40cf('0x1c')](_0x28f021);}return _0x267345[_0x40cf('0x1d')](_0x28f021)[_0x40cf('0x1e')]();};}function respondWithResult(_0x87cadc,_0x22009b){_0x22009b=_0x22009b||0xc8;return function(_0x17086b){if(_0x17086b){return _0x87cadc[_0x40cf('0x1d')](_0x22009b)[_0x40cf('0x1f')](_0x17086b);}};}function respondWithFilteredResult(_0xcd61fe,_0x3b3bea){return function(_0x449f2e){if(_0x449f2e){var _0x4127fb=typeof _0x3b3bea[_0x40cf('0x20')]===_0x40cf('0x21')&&typeof _0x3b3bea['limit']===_0x40cf('0x21');var _0x5605ee=_0x449f2e[_0x40cf('0x22')];var _0x5e0d73=_0x4127fb?0x0:_0x3b3bea[_0x40cf('0x20')];var _0x5b8f9f=_0x4127fb?_0x449f2e[_0x40cf('0x22')]:_0x3b3bea[_0x40cf('0x20')]+_0x3b3bea['limit'];var _0x8bb950;if(_0x5b8f9f>=_0x5605ee){_0x5b8f9f=_0x5605ee;_0x8bb950=0xc8;}else{_0x8bb950=0xce;}_0xcd61fe[_0x40cf('0x1d')](_0x8bb950);return _0xcd61fe[_0x40cf('0x23')](_0x40cf('0x24'),_0x5e0d73+'-'+_0x5b8f9f+'/'+_0x5605ee)[_0x40cf('0x1f')](_0x449f2e);}return null;};}function patchUpdates(_0x483400){return function(_0x229e35){try{jsonpatch[_0x40cf('0x25')](_0x229e35,_0x483400,!![]);}catch(_0x107549){return BPromise[_0x40cf('0x26')](_0x107549);}return _0x229e35['save']();};}function saveUpdates(_0x251d84,_0xca0245){return function(_0x183ecf){if(_0x183ecf){return _0x183ecf[_0x40cf('0x27')](_0x251d84)['then'](function(_0x583b71){return _0x583b71;});}return null;};}function handleEntityNotFound(_0x230c7d,_0x1cb301){return function(_0x2c77df){if(!_0x2c77df){_0x230c7d['sendStatus'](0x194);}return _0x2c77df;};}function handleError(_0x2a2667,_0x418dee){_0x418dee=_0x418dee||0x1f4;return function(_0x65f5be){logger['error'](_0x65f5be['stack']);if(_0x65f5be[_0x40cf('0x28')]){delete _0x65f5be[_0x40cf('0x28')];}_0x2a2667[_0x40cf('0x1d')](_0x418dee)['send'](_0x65f5be);};}exports[_0x40cf('0x29')]=function(_0x576759,_0x15cb3b){var _0x1326ff={},_0x35b699={},_0x3c0fdf={'count':0x0,'rows':[]};var _0x2ee9e1=_[_0x40cf('0x2a')](db[_0x40cf('0x2b')][_0x40cf('0x2c')],function(_0x2fd341){return{'name':_0x2fd341['fieldName'],'type':_0x2fd341[_0x40cf('0x2d')][_0x40cf('0x2e')]};});_0x35b699[_0x40cf('0x2f')]=_[_0x40cf('0x2a')](_0x2ee9e1,'name');_0x35b699[_0x40cf('0x30')]=_[_0x40cf('0x31')](_0x576759[_0x40cf('0x30')]);_0x35b699[_0x40cf('0x32')]=_['intersection'](_0x35b699[_0x40cf('0x2f')],_0x35b699[_0x40cf('0x30')]);_0x1326ff[_0x40cf('0x33')]=_[_0x40cf('0x34')](_0x35b699[_0x40cf('0x2f')],qs['fields'](_0x576759[_0x40cf('0x30')][_0x40cf('0x35')]));_0x1326ff[_0x40cf('0x33')]=_0x1326ff[_0x40cf('0x33')][_0x40cf('0x36')]?_0x1326ff[_0x40cf('0x33')]:_0x35b699[_0x40cf('0x2f')];if(!_0x576759[_0x40cf('0x30')]['hasOwnProperty']('nolimit')){_0x1326ff['limit']=qs[_0x40cf('0x37')](_0x576759[_0x40cf('0x30')][_0x40cf('0x37')]);_0x1326ff[_0x40cf('0x20')]=qs[_0x40cf('0x20')](_0x576759[_0x40cf('0x30')][_0x40cf('0x20')]);}_0x1326ff[_0x40cf('0x38')]=qs[_0x40cf('0x39')](_0x576759[_0x40cf('0x30')][_0x40cf('0x39')]);_0x1326ff[_0x40cf('0x3a')]=qs[_0x40cf('0x32')](_['pick'](_0x576759[_0x40cf('0x30')],_0x35b699[_0x40cf('0x32')]),_0x2ee9e1);if(_0x576759[_0x40cf('0x30')][_0x40cf('0x3b')]){_0x1326ff[_0x40cf('0x3a')]=_['merge'](_0x1326ff['where'],{'$or':_['map'](_0x2ee9e1,function(_0x1b4d09){if(_0x1b4d09['type']!==_0x40cf('0x3c')){var _0x4a037b={};_0x4a037b[_0x1b4d09[_0x40cf('0x28')]]={'$like':'%'+_0x576759[_0x40cf('0x30')][_0x40cf('0x3b')]+'%'};return _0x4a037b;}})});}_0x1326ff=_[_0x40cf('0x3d')]({},_0x1326ff,_0x576759['options']);var _0x20bda5={'where':_0x1326ff[_0x40cf('0x3a')]};return db[_0x40cf('0x2b')][_0x40cf('0x22')](_0x20bda5)['then'](function(_0xd252d4){_0x3c0fdf[_0x40cf('0x22')]=_0xd252d4;if(_0x576759[_0x40cf('0x30')]['includeAll']){_0x1326ff['include']=[{'all':!![]}];}return db[_0x40cf('0x2b')][_0x40cf('0x3e')](_0x1326ff);})[_0x40cf('0x3f')](function(_0x20defd){_0x3c0fdf[_0x40cf('0x40')]=_0x20defd;return _0x3c0fdf;})[_0x40cf('0x3f')](respondWithFilteredResult(_0x15cb3b,_0x1326ff))['catch'](handleError(_0x15cb3b,null));};exports[_0x40cf('0x41')]=function(_0x3dd956,_0x3166b6){var _0x22add8={'raw':![],'where':{'id':_0x3dd956[_0x40cf('0x42')]['id']}},_0x2c9b26={};_0x2c9b26[_0x40cf('0x2f')]=_[_0x40cf('0x31')](db[_0x40cf('0x2b')][_0x40cf('0x2c')]);_0x2c9b26['query']=_[_0x40cf('0x31')](_0x3dd956['query']);_0x2c9b26[_0x40cf('0x32')]=_[_0x40cf('0x34')](_0x2c9b26[_0x40cf('0x2f')],_0x2c9b26['query']);_0x22add8['attributes']=_[_0x40cf('0x34')](_0x2c9b26['model'],qs[_0x40cf('0x35')](_0x3dd956[_0x40cf('0x30')][_0x40cf('0x35')]));_0x22add8['attributes']=_0x22add8[_0x40cf('0x33')][_0x40cf('0x36')]?_0x22add8[_0x40cf('0x33')]:_0x2c9b26[_0x40cf('0x2f')];if(_0x3dd956[_0x40cf('0x30')][_0x40cf('0x43')]){_0x22add8[_0x40cf('0x44')]=[{'all':!![]}];}_0x22add8=_[_0x40cf('0x3d')]({},_0x22add8,_0x3dd956['options']);return db[_0x40cf('0x2b')]['find'](_0x22add8)[_0x40cf('0x3f')](handleEntityNotFound(_0x3166b6,null))[_0x40cf('0x3f')](respondWithResult(_0x3166b6,null))['catch'](handleError(_0x3166b6,null));};exports[_0x40cf('0x45')]=function(_0x10e0f1,_0x368073){return db['Team'][_0x40cf('0x45')](_0x10e0f1['body'],{})['then'](function(_0x565694){var _0x2521f7=_0x10e0f1[_0x40cf('0x46')][_0x40cf('0x47')]({'plain':!![]});if(!_0x2521f7)throw new Error(_0x40cf('0x48'));if(_0x2521f7[_0x40cf('0x49')]==='user'){var _0x4064b6=_0x565694['get']({'plain':!![]});var _0x3eb24e=_0x40cf('0x4a');return db[_0x40cf('0x4b')]['find']({'where':{'name':_0x3eb24e,'userProfileId':_0x2521f7[_0x40cf('0x4c')]},'raw':!![]})[_0x40cf('0x3f')](function(_0x4cab7c){if(_0x4cab7c&&_0x4cab7c[_0x40cf('0x4d')]===0x0){return db[_0x40cf('0x4e')][_0x40cf('0x45')]({'name':_0x4064b6[_0x40cf('0x28')],'resourceId':_0x4064b6['id'],'type':_0x4cab7c[_0x40cf('0x28')],'sectionId':_0x4cab7c['id']},{})[_0x40cf('0x3f')](function(){return _0x565694;});}else{return _0x565694;}})[_0x40cf('0x4f')](function(_0xb552e8){logger[_0x40cf('0x50')](_0x40cf('0x51'),_0xb552e8);throw _0xb552e8;});}return _0x565694;})[_0x40cf('0x3f')](respondWithResult(_0x368073,0xc9))[_0x40cf('0x4f')](handleError(_0x368073,null));};exports[_0x40cf('0x27')]=function(_0x5b53b3,_0x5bf324){if(_0x5b53b3[_0x40cf('0x52')]['id']){delete _0x5b53b3['body']['id'];}return db[_0x40cf('0x2b')][_0x40cf('0x53')]({'where':{'id':_0x5b53b3['params']['id']}})['then'](handleEntityNotFound(_0x5bf324,null))[_0x40cf('0x3f')](saveUpdates(_0x5b53b3['body'],null))[_0x40cf('0x3f')](respondWithResult(_0x5bf324,null))[_0x40cf('0x4f')](handleError(_0x5bf324,null));};exports['destroy']=function(_0x5048e3,_0x253b9f){var _0x192160=_0x5048e3['params']['id'];var _0xd48ff7=[];return db[_0x40cf('0x54')][_0x40cf('0x55')](function(_0x202a8b){var _0x1a9b21='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x1a9b21,{'type':db[_0x40cf('0x56')]['QueryTypes'][_0x40cf('0x57')],'raw':!![],'transaction':_0x202a8b})['then'](function(_0x3ed267){_0xd48ff7=_[_0x40cf('0x2a')](_0x3ed267,function(_0x15cfe0){return Number(_0x15cfe0[_0x40cf('0x58')]);});})[_0x40cf('0x3f')](function(){var _0x3539bc=_0x40cf('0x59')+_0x192160;return db['sequelize'][_0x40cf('0x30')](_0x3539bc,{'type':db[_0x40cf('0x56')]['QueryTypes'][_0x40cf('0x57')],'raw':!![],'transaction':_0x202a8b});})['then'](function(_0x71dfbb){var _0x61d9b4=_['map'](_0x71dfbb,function(_0x34bf4c){return Number(_0x34bf4c[_0x40cf('0x5a')]);});return db[_0x40cf('0x5b')]['destroy']({'where':{'UserId':{'$in':_0xd48ff7},'VoiceQueueId':{'$in':_0x61d9b4}},'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(){var _0x449041=_0x40cf('0x5c')+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x449041,{'type':db['Sequelize'][_0x40cf('0x5d')]['SELECT'],'raw':!![],'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(_0x1221fa){var _0x4ab33b=_[_0x40cf('0x2a')](_0x1221fa,function(_0x288582){return Number(_0x288582[_0x40cf('0x5e')]);});return db[_0x40cf('0x5f')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'MailQueueId':{'$in':_0x4ab33b}},'transaction':_0x202a8b});})['then'](function(){var _0x55fddd=_0x40cf('0x61')+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x55fddd,{'type':db[_0x40cf('0x56')][_0x40cf('0x5d')]['SELECT'],'raw':!![],'transaction':_0x202a8b});})['then'](function(_0x3de43e){var _0x4a571d=_[_0x40cf('0x2a')](_0x3de43e,function(_0x22edcc){return Number(_0x22edcc[_0x40cf('0x62')]);});return db[_0x40cf('0x63')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'SmsQueueId':{'$in':_0x4a571d}},'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(){var _0x3f61ea='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x3f61ea,{'type':db['Sequelize'][_0x40cf('0x5d')][_0x40cf('0x57')],'raw':!![],'transaction':_0x202a8b});})['then'](function(_0x334ff7){var _0x3574af=_[_0x40cf('0x2a')](_0x334ff7,function(_0x5b5974){return Number(_0x5b5974[_0x40cf('0x64')]);});return db[_0x40cf('0x65')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'ChatQueueId':{'$in':_0x3574af}},'transaction':_0x202a8b});})['then'](function(){var _0xa3aa78=_0x40cf('0x66')+_0x192160;return db[_0x40cf('0x54')]['query'](_0xa3aa78,{'type':db[_0x40cf('0x56')][_0x40cf('0x5d')][_0x40cf('0x57')],'raw':!![],'transaction':_0x202a8b});})['then'](function(_0x5b033f){var _0x58ac62=_[_0x40cf('0x2a')](_0x5b033f,function(_0x27c438){return Number(_0x27c438['FaxQueueId']);});return db['UserFaxQueue'][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'FaxQueueId':{'$in':_0x58ac62}},'transaction':_0x202a8b});})['then'](function(){var _0x5dbade='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x5dbade,{'type':db[_0x40cf('0x56')][_0x40cf('0x5d')][_0x40cf('0x57')],'raw':!![],'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(_0x1a3278){var _0x1e7993=_[_0x40cf('0x2a')](_0x1a3278,function(_0x597782){return Number(_0x597782[_0x40cf('0x67')]);});return db[_0x40cf('0x68')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'OpenchannelQueueId':{'$in':_0x1e7993}},'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(){var _0x5009c5='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x192160;return db[_0x40cf('0x54')][_0x40cf('0x30')](_0x5009c5,{'type':db['Sequelize'][_0x40cf('0x5d')]['SELECT'],'raw':!![],'transaction':_0x202a8b});})['then'](function(_0x2cae66){var _0x3059fc=_['map'](_0x2cae66,function(_0x3c9be0){return Number(_0x3c9be0[_0x40cf('0x69')]);});return db[_0x40cf('0x6a')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'WhatsappQueueId':{'$in':_0x3059fc}},'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(){return db[_0x40cf('0x6b')][_0x40cf('0x53')]({'where':{'TeamId':_0x192160}});})['then'](function(_0x285279){if(_0x285279===null){return;}return db[_0x40cf('0x6c')][_0x40cf('0x60')]({'where':{'UserId':{'$in':_0xd48ff7},'VoicePrefixId':_0x285279[_0x40cf('0x6d')]},'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(){return db['Team'][_0x40cf('0x60')]({'where':{'id':_0x192160},'cascade':!![],'transaction':_0x202a8b});})[_0x40cf('0x3f')](function(_0x2f9f7b){if(_0x2f9f7b===0x0){_0x253b9f[_0x40cf('0x1c')](0x194);}else{return db[_0x40cf('0x4e')][_0x40cf('0x60')]({'where':{'type':'Teams','resourceId':_0x192160},'cascade':!![],'transaction':_0x202a8b})[_0x40cf('0x3f')](function(){_0x253b9f['status'](0xcc)[_0x40cf('0x1e')]();});}})['catch'](function(_0x2721c6){_0x253b9f[_0x40cf('0x1d')](0x1f4)[_0x40cf('0x6e')](_0x2721c6);});});};exports['getQueues']=function(_0x3b6642,_0x538984,_0x106287){return db[_0x40cf('0x2b')][_0x40cf('0x6f')]({'where':{'id':_0x3b6642[_0x40cf('0x42')]['id']}})[_0x40cf('0x3f')](handleEntityNotFound(_0x538984,null))['then'](function(_0x118cee){if(!_0x3b6642['query'][_0x40cf('0x70')]||!utils['isValidChannel'](_0x3b6642[_0x40cf('0x30')]['channel'])){throw new db[(_0x40cf('0x56'))][(_0x40cf('0x71'))](_0x40cf('0x72'));}var _0x16c7c9={};var _0x2cce86={};_0x2cce86['model']=_[_0x40cf('0x31')](db[_[_0x40cf('0x73')](_0x3b6642[_0x40cf('0x30')]['channel']['toLowerCase']())+_0x40cf('0x74')][_0x40cf('0x2c')]);_0x2cce86['query']=_['keys'](_0x3b6642[_0x40cf('0x30')]);_0x2cce86[_0x40cf('0x32')]=_[_0x40cf('0x34')](_0x2cce86[_0x40cf('0x2f')],_0x2cce86['query']);_0x16c7c9[_0x40cf('0x33')]=_[_0x40cf('0x34')](_0x2cce86[_0x40cf('0x2f')],qs['fields'](_0x3b6642['query'][_0x40cf('0x35')]));_0x16c7c9[_0x40cf('0x33')]=_0x16c7c9['attributes']['length']?_0x16c7c9['attributes']:_0x2cce86[_0x40cf('0x2f')];_0x16c7c9[_0x40cf('0x37')]=qs[_0x40cf('0x37')](_0x3b6642['query']['limit']);_0x16c7c9['offset']=qs[_0x40cf('0x20')](_0x3b6642[_0x40cf('0x30')]['offset']);_0x16c7c9[_0x40cf('0x38')]=qs[_0x40cf('0x39')](_0x3b6642[_0x40cf('0x30')][_0x40cf('0x39')]);_0x16c7c9[_0x40cf('0x3a')]=qs[_0x40cf('0x32')](_[_0x40cf('0x75')](_0x3b6642[_0x40cf('0x30')],_0x2cce86[_0x40cf('0x32')]));_0x16c7c9=_[_0x40cf('0x3d')]({},_0x16c7c9,_0x3b6642[_0x40cf('0x76')]);return _0x118cee[_0x40cf('0x47')+_[_0x40cf('0x73')](_0x3b6642[_0x40cf('0x30')][_0x40cf('0x70')][_0x40cf('0x77')]())+_0x40cf('0x78')](_0x16c7c9);})[_0x40cf('0x3f')](respondWithResult(_0x538984,null))['catch'](handleError(_0x538984,null));};exports['addQueues']=function(_0x36e596,_0x4fd0a1,_0x2ee769){return db[_0x40cf('0x2b')]['findOne']({'where':{'id':_0x36e596['params']['id']}})[_0x40cf('0x3f')](function(_0x4a4b02){if(_0x4a4b02){if(!_0x36e596[_0x40cf('0x52')][_0x40cf('0x70')]||!utils['isValidChannel'](_0x36e596['body'][_0x40cf('0x70')])){throw new db['Sequelize'][(_0x40cf('0x71'))](_0x40cf('0x72'));}return _0x4a4b02['add'+_[_0x40cf('0x73')](_0x36e596['body'][_0x40cf('0x70')]['toLowerCase']())+_0x40cf('0x78')](_0x36e596[_0x40cf('0x52')][_0x40cf('0x79')]);}return null;})[_0x40cf('0x3f')](handleEntityNotFound(_0x4fd0a1,null))[_0x40cf('0x3f')](respondWithStatusCode(_0x4fd0a1,null))[_0x40cf('0x4f')](handleError(_0x4fd0a1,null));};exports[_0x40cf('0x7a')]=function(_0x3a36f6,_0xedea1a,_0x316cd7){return db['Team'][_0x40cf('0x6f')]({'where':{'id':_0x3a36f6[_0x40cf('0x42')]['id']}})[_0x40cf('0x3f')](function(_0x2a391e){if(_0x2a391e){if(!_0x3a36f6[_0x40cf('0x30')][_0x40cf('0x70')]||!utils[_0x40cf('0x7b')](_0x3a36f6[_0x40cf('0x30')][_0x40cf('0x70')])){throw new db['Sequelize'][(_0x40cf('0x71'))](_0x40cf('0x72'));}return _0x2a391e[_0x40cf('0x7c')+_[_0x40cf('0x73')](_0x3a36f6[_0x40cf('0x30')]['channel'][_0x40cf('0x77')]())+'Queues'](_0x3a36f6[_0x40cf('0x30')][_0x40cf('0x79')]);}return null;})[_0x40cf('0x3f')](handleEntityNotFound(_0xedea1a,null))['then'](respondWithStatusCode(_0xedea1a,null))[_0x40cf('0x4f')](handleError(_0xedea1a,null));};exports[_0x40cf('0x7d')]=function(_0x13528b,_0x5962b4){var _0x3382db=_[_0x40cf('0x7e')](_0x13528b[_0x40cf('0x52')][_0x40cf('0x79')])?_0x13528b[_0x40cf('0x52')][_0x40cf('0x79')]:[_0x13528b[_0x40cf('0x52')][_0x40cf('0x79')]];var _0x3b8dc8=_0x13528b[_0x40cf('0x42')]['id'];return db[_0x40cf('0x2b')][_0x40cf('0x53')]({'where':{'id':_0x3b8dc8}})[_0x40cf('0x3f')](handleEntityNotFound(_0x5962b4,null))[_0x40cf('0x3f')](function(_0x3ccfee){if(_0x3ccfee){var _0x5e97b2=[_0x40cf('0x7f'),_0x40cf('0x80'),_0x40cf('0x81'),_0x40cf('0x82'),_0x40cf('0x83'),'Openchannel',_0x40cf('0x84')];return db[_0x40cf('0x54')][_0x40cf('0x55')](function(_0x396e3c){var _0x57af42=_['map'](_0x5e97b2,function(_0x1f2e47){var _0x3d5392={'attributes':['id',_0x40cf('0x28')]};if(_0x1f2e47==='Voice'){_0x3d5392['through']={'attributes':[_0x40cf('0x85')]};}return _0x3ccfee['get'+_0x1f2e47+_0x40cf('0x78')](_0x3d5392)[_0x40cf('0x3f')](function(_0x1357cb){var _0x2e25a0=_['map'](_0x1357cb,function(_0xcb36cc){var _0xd6b992=_[_0x40cf('0x2a')](_0x3382db,function(_0x577f4f){var _0xe98211={'where':{'UserId':_0x577f4f,[_0x1f2e47+_0x40cf('0x86')]:_0xcb36cc['id']},'transaction':_0x396e3c};if(_0x1f2e47===_0x40cf('0x7f')){_0xe98211[_0x40cf('0x16')]={'penalty':_0xcb36cc['TeamVoiceQueue'][_0x40cf('0x85')]};}return db[_0x40cf('0x87')+_0x1f2e47+_0x40cf('0x74')][_0x40cf('0x88')](_0xe98211)['then'](function(){socket[_0x40cf('0x89')](_0x40cf('0x46')+_0x1f2e47+'Queue:save',{'UserId':_0x577f4f,[_0x1f2e47+'QueueId']:_0xcb36cc['id']});if(_0x1f2e47!==_0x40cf('0x7f')){return;}return db['User'][_0x40cf('0x3e')]({'where':{'id':_0x3382db,'online':0x1},'attributes':['id',_0x40cf('0x28'),'online',_0x40cf('0x8a'),_0x40cf('0x8b')],'raw':!![]})['then'](function(_0xfadc95){var _0xb16652=_[_0x40cf('0x2a')](_0xfadc95,function(_0x2bdf8f){return db[_0x40cf('0x8c')][_0x40cf('0x8d')]({'membername':_0x2bdf8f[_0x40cf('0x28')],'UserId':_0x2bdf8f['id'],'queue_name':_0xcb36cc[_0x40cf('0x28')],'VoiceQueueId':_0xcb36cc['id'],'interface':_['isNil'](_0x2bdf8f[_0x40cf('0x8b')])?util[_0x40cf('0x8e')](_0x40cf('0x8f'),_0x2bdf8f[_0x40cf('0x28')]):_0x2bdf8f['interface'],'paused':_0x2bdf8f[_0x40cf('0x8a')]||![],'penalty':_0xcb36cc[_0x40cf('0x90')]['penalty']},{'transaction':_0x396e3c});});return Promise['all'](_0xb16652);});});});return Promise[_0x40cf('0x91')](_0xd6b992);});return Promise[_0x40cf('0x91')](_0x2e25a0);})[_0x40cf('0x3f')](function(){return db[_0x40cf('0x6b')][_0x40cf('0x6f')]({'where':{'teamId':_0x3b8dc8}})[_0x40cf('0x3f')](function(_0x14f73d){if(_0x14f73d){var _0x485211=_[_0x40cf('0x2a')](_0x3382db,function(_0x2b4158){db[_0x40cf('0x6c')]['upsert']({'UserId':_0x2b4158,'VoicePrefixId':_0x14f73d[_0x40cf('0x6d')]});});return Promise[_0x40cf('0x91')](_0x485211);}});});});return Promise[_0x40cf('0x91')](_0x57af42)[_0x40cf('0x3f')](function(){return _0x3ccfee[_0x40cf('0x7d')](_0x3382db,{'transaction':_0x396e3c})['spread'](function(_0x281f59){return _0x281f59;});});});}})[_0x40cf('0x3f')](respondWithResult(_0x5962b4,null))[_0x40cf('0x4f')](handleError(_0x5962b4,null));};exports['removeAgents']=function(_0x2dc425,_0x2727f5){var _0xa4d416=_[_0x40cf('0x7e')](_0x2dc425['query']['ids'])?_0x2dc425[_0x40cf('0x30')][_0x40cf('0x79')]:[_0x2dc425['query'][_0x40cf('0x79')]];var _0x3b0389=_0x2dc425[_0x40cf('0x42')]['id'];return db[_0x40cf('0x2b')][_0x40cf('0x53')]({'where':{'id':_0x3b0389}})[_0x40cf('0x3f')](handleEntityNotFound(_0x2727f5,null))[_0x40cf('0x3f')](function(_0x289688){if(_0x289688){var _0x362d2e=[_0x40cf('0x7f'),_0x40cf('0x80'),'Mail',_0x40cf('0x82'),'Fax',_0x40cf('0x92'),'Whatsapp'];return db[_0x40cf('0x54')][_0x40cf('0x55')](function(_0x55bd7c){var _0x1e6486=_[_0x40cf('0x2a')](_0x362d2e,function(_0x5d7303){var _0x2a4e47={'attributes':['id',_0x40cf('0x28')]};return _0x289688[_0x40cf('0x47')+_0x5d7303+_0x40cf('0x78')](_0x2a4e47)[_0x40cf('0x3f')](function(_0x2f29d6){var _0x36fec1=_[_0x40cf('0x2a')](_0x2f29d6,function(_0xe23853){return _0xe23853[_0x40cf('0x93')](_0xa4d416,{'transaction':_0x55bd7c})[_0x40cf('0x3f')](function(){var _0x3b7c61=_[_0x40cf('0x2a')](_0xa4d416,function(_0x5cb6ed){socket['emit'](_0x40cf('0x46')+_0x5d7303+_0x40cf('0x94'),{'UserId':Number(_0x5cb6ed),[_0x5d7303+_0x40cf('0x86')]:_0xe23853['id']});if(_0x5d7303!==_0x40cf('0x7f')){return;}return db[_0x40cf('0x8c')][_0x40cf('0x60')]({'where':{'VoiceQueueId':_0xe23853['id'],'UserId':_0x5cb6ed},'transaction':_0x55bd7c});});return Promise['all'](_0x3b7c61);});});return Promise['all'](_0x36fec1);});});return Promise[_0x40cf('0x91')](_0x1e6486)[_0x40cf('0x3f')](function(){return _0x289688[_0x40cf('0x93')](_0xa4d416,{'transaction':_0x55bd7c});})[_0x40cf('0x3f')](function(){return db[_0x40cf('0x6b')][_0x40cf('0x6f')]({'where':{'teamId':_0x3b0389}})[_0x40cf('0x3f')](function(_0x397470){if(_0x397470){var _0xd6d11d=_[_0x40cf('0x2a')](_0xa4d416,function(_0x332f39){db[_0x40cf('0x6c')][_0x40cf('0x60')]({'where':{'UserId':_0x332f39,'VoicePrefixId':_0x397470['VoicePrefixId']}});});return Promise['all'](_0xd6d11d);}});});});}})[_0x40cf('0x3f')](respondWithStatusCode(_0x2727f5,null))['catch'](handleError(_0x2727f5,null));};exports[_0x40cf('0x95')]=function(_0x539ec7,_0x2f974e,_0x296854){var _0x3c1494={};var _0x56eafb={};var _0x58269a;var _0x1b2774;return db[_0x40cf('0x2b')][_0x40cf('0x6f')]({'where':{'id':_0x539ec7[_0x40cf('0x42')]['id']}})[_0x40cf('0x3f')](handleEntityNotFound(_0x2f974e,null))['then'](function(_0x37e593){if(_0x37e593){_0x58269a=_0x37e593;_0x56eafb[_0x40cf('0x2f')]=_['keys'](db[_0x40cf('0x87')][_0x40cf('0x2c')]);_0x56eafb[_0x40cf('0x30')]=_[_0x40cf('0x31')](_0x539ec7['query']);_0x56eafb[_0x40cf('0x32')]=_[_0x40cf('0x34')](_0x56eafb[_0x40cf('0x2f')],_0x56eafb[_0x40cf('0x30')]);_0x3c1494['attributes']=_[_0x40cf('0x34')](_0x56eafb[_0x40cf('0x2f')],qs[_0x40cf('0x35')](_0x539ec7[_0x40cf('0x30')]['fields']));_0x3c1494['attributes']=_0x3c1494[_0x40cf('0x33')][_0x40cf('0x36')]?_0x3c1494[_0x40cf('0x33')]:_0x56eafb[_0x40cf('0x2f')];_0x3c1494[_0x40cf('0x38')]=qs[_0x40cf('0x39')](_0x539ec7[_0x40cf('0x30')]['sort']);_0x3c1494['where']=qs[_0x40cf('0x32')](_[_0x40cf('0x75')](_0x539ec7[_0x40cf('0x30')],_0x56eafb['filters']));if(_0x539ec7[_0x40cf('0x30')][_0x40cf('0x3b')]){_0x3c1494[_0x40cf('0x3a')]=_[_0x40cf('0x3d')](_0x3c1494['where'],{'$or':_[_0x40cf('0x2a')](_0x3c1494[_0x40cf('0x33')],function(_0x40edf2){var _0x15855d={};_0x15855d[_0x40edf2]={'$like':'%'+_0x539ec7[_0x40cf('0x30')][_0x40cf('0x3b')]+'%'};return _0x15855d;})});}_0x3c1494=_['merge']({},_0x3c1494,_0x539ec7[_0x40cf('0x76')]);return _0x58269a[_0x40cf('0x95')](_0x3c1494);}})[_0x40cf('0x3f')](function(_0x4f02c1){if(_0x4f02c1){_0x1b2774=_0x4f02c1['length'];if(!_0x539ec7['query']['hasOwnProperty']('nolimit')){_0x3c1494[_0x40cf('0x37')]=qs[_0x40cf('0x37')](_0x539ec7[_0x40cf('0x30')]['limit']);_0x3c1494[_0x40cf('0x20')]=qs[_0x40cf('0x20')](_0x539ec7[_0x40cf('0x30')][_0x40cf('0x20')]);}return _0x58269a[_0x40cf('0x95')](_0x3c1494);}})[_0x40cf('0x3f')](function(_0x295d42){if(_0x295d42){return _0x295d42?{'count':_0x1b2774,'rows':_0x295d42}:null;}})['then'](respondWithResult(_0x2f974e,null))[_0x40cf('0x4f')](handleError(_0x2f974e,null));}; \ No newline at end of file +var _0x187c=['transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','find','UserVoicePrefix','VoicePrefixId','sendStatus','getQueues','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','findOne','isValidChannel','add','ids','removeQueues','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','penalty','QueueId','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','TeamVoiceQueue','all','removeAgents','Chat','Fax','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','error','stack','name','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','Team','then','include','findAll','rows','show','rawAttributes','catch','create','body','user','get','role','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','sequelize'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x187c,0xdc));var _0xc187=function(_0x36b7f5,_0x5e836f){_0x36b7f5=_0x36b7f5-0x0;var _0x20e925=_0x187c[_0x36b7f5];return _0x20e925;};'use strict';var emlformat=require(_0xc187('0x0'));var rimraf=require(_0xc187('0x1'));var zipdir=require(_0xc187('0x2'));var jsonpatch=require(_0xc187('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc187('0x4'));var util=require(_0xc187('0x5'));var path=require(_0xc187('0x6'));var sox=require(_0xc187('0x7'));var csv=require(_0xc187('0x8'));var ejs=require(_0xc187('0x9'));var fs=require('fs');var fs_extra=require(_0xc187('0xa'));var _=require(_0xc187('0xb'));var squel=require(_0xc187('0xc'));var crypto=require(_0xc187('0xd'));var jsforce=require(_0xc187('0xe'));var deskjs=require(_0xc187('0xf'));var toCsv=require(_0xc187('0x8'));var querystring=require(_0xc187('0x10'));var Papa=require(_0xc187('0x11'));var Redis=require(_0xc187('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc187('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc187('0x14'));var logger=require('../../config/logger')(_0xc187('0x15'));var utils=require(_0xc187('0x16'));var config=require(_0xc187('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc187('0x18'))['db'];config['redis']=_[_0xc187('0x19')](config[_0xc187('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc187('0x1b'))(new Redis(config['redis']));require(_0xc187('0x1c'))[_0xc187('0x1d')](socket);function respondWithStatusCode(_0x4eaa57,_0x101106){_0x101106=_0x101106||0xcc;return function(_0x55e191){if(_0x55e191){return _0x4eaa57['sendStatus'](_0x101106);}return _0x4eaa57[_0xc187('0x1e')](_0x101106)[_0xc187('0x1f')]();};}function respondWithResult(_0x95683e,_0x12e111){_0x12e111=_0x12e111||0xc8;return function(_0x295d8e){if(_0x295d8e){return _0x95683e[_0xc187('0x1e')](_0x12e111)[_0xc187('0x20')](_0x295d8e);}};}function respondWithFilteredResult(_0x293c95,_0x41df12){return function(_0x401f91){if(_0x401f91){var _0x3e3c52=typeof _0x41df12[_0xc187('0x21')]===_0xc187('0x22')&&typeof _0x41df12['limit']===_0xc187('0x22');var _0x455f21=_0x401f91['count'];var _0x160c63=_0x3e3c52?0x0:_0x41df12['offset'];var _0x44dc60=_0x3e3c52?_0x401f91['count']:_0x41df12[_0xc187('0x21')]+_0x41df12[_0xc187('0x23')];var _0x28e3b6;if(_0x44dc60>=_0x455f21){_0x44dc60=_0x455f21;_0x28e3b6=0xc8;}else{_0x28e3b6=0xce;}_0x293c95[_0xc187('0x1e')](_0x28e3b6);return _0x293c95[_0xc187('0x24')](_0xc187('0x25'),_0x160c63+'-'+_0x44dc60+'/'+_0x455f21)[_0xc187('0x20')](_0x401f91);}return null;};}function patchUpdates(_0x5ce398){return function(_0x32dd02){try{jsonpatch['apply'](_0x32dd02,_0x5ce398,!![]);}catch(_0x21c865){return BPromise[_0xc187('0x26')](_0x21c865);}return _0x32dd02[_0xc187('0x27')]();};}function saveUpdates(_0x41603b,_0x3e39b7){return function(_0x231297){if(_0x231297){return _0x231297[_0xc187('0x28')](_0x41603b)['then'](function(_0x61b938){return _0x61b938;});}return null;};}function handleEntityNotFound(_0x46a690,_0x3572c5){return function(_0xf7bd0b){if(!_0xf7bd0b){_0x46a690['sendStatus'](0x194);}return _0xf7bd0b;};}function handleError(_0xceaa64,_0x2bcee6){_0x2bcee6=_0x2bcee6||0x1f4;return function(_0xfcfc87){logger[_0xc187('0x29')](_0xfcfc87[_0xc187('0x2a')]);if(_0xfcfc87[_0xc187('0x2b')]){delete _0xfcfc87['name'];}_0xceaa64[_0xc187('0x1e')](_0x2bcee6)['send'](_0xfcfc87);};}exports[_0xc187('0x2c')]=function(_0x318c83,_0x2c38a6){var _0x2174e7={},_0x12360b={},_0x284772={'count':0x0,'rows':[]};var _0x1cfdd8=_[_0xc187('0x2d')](db['Team']['rawAttributes'],function(_0x4ba856){return{'name':_0x4ba856[_0xc187('0x2e')],'type':_0x4ba856['type'][_0xc187('0x2f')]};});_0x12360b['model']=_[_0xc187('0x2d')](_0x1cfdd8,_0xc187('0x2b'));_0x12360b[_0xc187('0x30')]=_[_0xc187('0x31')](_0x318c83[_0xc187('0x30')]);_0x12360b['filters']=_[_0xc187('0x32')](_0x12360b[_0xc187('0x33')],_0x12360b['query']);_0x2174e7[_0xc187('0x34')]=_[_0xc187('0x32')](_0x12360b[_0xc187('0x33')],qs['fields'](_0x318c83[_0xc187('0x30')][_0xc187('0x35')]));_0x2174e7[_0xc187('0x34')]=_0x2174e7['attributes'][_0xc187('0x36')]?_0x2174e7[_0xc187('0x34')]:_0x12360b[_0xc187('0x33')];if(!_0x318c83[_0xc187('0x30')]['hasOwnProperty'](_0xc187('0x37'))){_0x2174e7[_0xc187('0x23')]=qs[_0xc187('0x23')](_0x318c83[_0xc187('0x30')][_0xc187('0x23')]);_0x2174e7[_0xc187('0x21')]=qs[_0xc187('0x21')](_0x318c83[_0xc187('0x30')][_0xc187('0x21')]);}_0x2174e7[_0xc187('0x38')]=qs['sort'](_0x318c83['query'][_0xc187('0x39')]);_0x2174e7['where']=qs['filters'](_[_0xc187('0x3a')](_0x318c83[_0xc187('0x30')],_0x12360b[_0xc187('0x3b')]),_0x1cfdd8);if(_0x318c83[_0xc187('0x30')][_0xc187('0x3c')]){_0x2174e7[_0xc187('0x3d')]=_['merge'](_0x2174e7[_0xc187('0x3d')],{'$or':_[_0xc187('0x2d')](_0x1cfdd8,function(_0x518d0c){if(_0x518d0c['type']!==_0xc187('0x3e')){var _0x5bc2bd={};_0x5bc2bd[_0x518d0c[_0xc187('0x2b')]]={'$like':'%'+_0x318c83[_0xc187('0x30')][_0xc187('0x3c')]+'%'};return _0x5bc2bd;}})});}_0x2174e7=_[_0xc187('0x3f')]({},_0x2174e7,_0x318c83[_0xc187('0x40')]);var _0x5b0789={'where':_0x2174e7[_0xc187('0x3d')]};return db[_0xc187('0x41')]['count'](_0x5b0789)[_0xc187('0x42')](function(_0x45e614){_0x284772['count']=_0x45e614;if(_0x318c83[_0xc187('0x30')]['includeAll']){_0x2174e7[_0xc187('0x43')]=[{'all':!![]}];}return db['Team'][_0xc187('0x44')](_0x2174e7);})[_0xc187('0x42')](function(_0x35e991){_0x284772[_0xc187('0x45')]=_0x35e991;return _0x284772;})[_0xc187('0x42')](respondWithFilteredResult(_0x2c38a6,_0x2174e7))['catch'](handleError(_0x2c38a6,null));};exports[_0xc187('0x46')]=function(_0x4f8866,_0x1e8886){var _0x243326={'raw':![],'where':{'id':_0x4f8866['params']['id']}},_0x33a962={};_0x33a962[_0xc187('0x33')]=_[_0xc187('0x31')](db[_0xc187('0x41')][_0xc187('0x47')]);_0x33a962[_0xc187('0x30')]=_[_0xc187('0x31')](_0x4f8866[_0xc187('0x30')]);_0x33a962[_0xc187('0x3b')]=_[_0xc187('0x32')](_0x33a962['model'],_0x33a962[_0xc187('0x30')]);_0x243326[_0xc187('0x34')]=_[_0xc187('0x32')](_0x33a962[_0xc187('0x33')],qs['fields'](_0x4f8866[_0xc187('0x30')][_0xc187('0x35')]));_0x243326[_0xc187('0x34')]=_0x243326[_0xc187('0x34')][_0xc187('0x36')]?_0x243326['attributes']:_0x33a962[_0xc187('0x33')];if(_0x4f8866[_0xc187('0x30')]['includeAll']){_0x243326['include']=[{'all':!![]}];}_0x243326=_[_0xc187('0x3f')]({},_0x243326,_0x4f8866[_0xc187('0x40')]);return db[_0xc187('0x41')]['find'](_0x243326)[_0xc187('0x42')](handleEntityNotFound(_0x1e8886,null))['then'](respondWithResult(_0x1e8886,null))[_0xc187('0x48')](handleError(_0x1e8886,null));};exports['create']=function(_0x3bd96d,_0x21cadc){return db['Team'][_0xc187('0x49')](_0x3bd96d[_0xc187('0x4a')],{})[_0xc187('0x42')](function(_0x5ace2d){var _0x1a34fd=_0x3bd96d[_0xc187('0x4b')][_0xc187('0x4c')]({'plain':!![]});if(!_0x1a34fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a34fd[_0xc187('0x4d')]===_0xc187('0x4b')){var _0x4ff1de=_0x5ace2d[_0xc187('0x4c')]({'plain':!![]});var _0xc225d6=_0xc187('0x4e');return db[_0xc187('0x4f')]['find']({'where':{'name':_0xc225d6,'userProfileId':_0x1a34fd['userProfileId']},'raw':!![]})[_0xc187('0x42')](function(_0x17ff73){if(_0x17ff73&&_0x17ff73[_0xc187('0x50')]===0x0){return db[_0xc187('0x51')][_0xc187('0x49')]({'name':_0x4ff1de[_0xc187('0x2b')],'resourceId':_0x4ff1de['id'],'type':_0x17ff73['name'],'sectionId':_0x17ff73['id']},{})[_0xc187('0x42')](function(){return _0x5ace2d;});}else{return _0x5ace2d;}})[_0xc187('0x48')](function(_0x263c53){logger[_0xc187('0x29')](_0xc187('0x52'),_0x263c53);throw _0x263c53;});}return _0x5ace2d;})['then'](respondWithResult(_0x21cadc,0xc9))[_0xc187('0x48')](handleError(_0x21cadc,null));};exports['update']=function(_0x48a206,_0x1a121a){if(_0x48a206[_0xc187('0x4a')]['id']){delete _0x48a206[_0xc187('0x4a')]['id'];}return db[_0xc187('0x41')]['find']({'where':{'id':_0x48a206['params']['id']}})[_0xc187('0x42')](handleEntityNotFound(_0x1a121a,null))[_0xc187('0x42')](saveUpdates(_0x48a206['body'],null))[_0xc187('0x42')](respondWithResult(_0x1a121a,null))[_0xc187('0x48')](handleError(_0x1a121a,null));};exports[_0xc187('0x53')]=function(_0x306257,_0x153d99){var _0x2b71ac=_0x306257[_0xc187('0x54')]['id'];var _0x3e5966=[];return db[_0xc187('0x55')][_0xc187('0x56')](function(_0x288401){var _0x2c7fb9=_0xc187('0x57')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x2c7fb9,{'type':db['Sequelize'][_0xc187('0x58')][_0xc187('0x59')],'raw':!![],'transaction':_0x288401})[_0xc187('0x42')](function(_0x67186){_0x3e5966=_['map'](_0x67186,function(_0x5286fc){return Number(_0x5286fc['UserId']);});})[_0xc187('0x42')](function(){var _0x1293e8=_0xc187('0x5a')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x1293e8,{'type':db[_0xc187('0x5b')][_0xc187('0x58')][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0x2df7ab){var _0x4fc7e3=_[_0xc187('0x2d')](_0x2df7ab,function(_0x56d08e){return Number(_0x56d08e[_0xc187('0x5c')]);});return db['UserVoiceQueue'][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'VoiceQueueId':{'$in':_0x4fc7e3}},'transaction':_0x288401});})[_0xc187('0x42')](function(){var _0x1182c9=_0xc187('0x5d')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x1182c9,{'type':db[_0xc187('0x5b')]['QueryTypes'][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0x440d77){var _0x2bc2ef=_[_0xc187('0x2d')](_0x440d77,function(_0x1d937b){return Number(_0x1d937b['MailQueueId']);});return db[_0xc187('0x5e')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'MailQueueId':{'$in':_0x2bc2ef}},'transaction':_0x288401});})['then'](function(){var _0x4e15e7=_0xc187('0x5f')+_0x2b71ac;return db[_0xc187('0x55')]['query'](_0x4e15e7,{'type':db[_0xc187('0x5b')][_0xc187('0x58')][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0x4ea12e){var _0x2b1bbf=_[_0xc187('0x2d')](_0x4ea12e,function(_0x16f26a){return Number(_0x16f26a[_0xc187('0x60')]);});return db[_0xc187('0x61')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'SmsQueueId':{'$in':_0x2b1bbf}},'transaction':_0x288401});})[_0xc187('0x42')](function(){var _0x3decdc=_0xc187('0x62')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x3decdc,{'type':db[_0xc187('0x5b')][_0xc187('0x58')][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0x33ec99){var _0x4236ad=_[_0xc187('0x2d')](_0x33ec99,function(_0x21a371){return Number(_0x21a371[_0xc187('0x63')]);});return db[_0xc187('0x64')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'ChatQueueId':{'$in':_0x4236ad}},'transaction':_0x288401});})['then'](function(){var _0x4823b2=_0xc187('0x65')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x4823b2,{'type':db[_0xc187('0x5b')][_0xc187('0x58')][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})['then'](function(_0x40c9d3){var _0x76f42f=_[_0xc187('0x2d')](_0x40c9d3,function(_0x257369){return Number(_0x257369[_0xc187('0x66')]);});return db['UserFaxQueue'][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'FaxQueueId':{'$in':_0x76f42f}},'transaction':_0x288401});})[_0xc187('0x42')](function(){var _0x4714ea='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x4714ea,{'type':db[_0xc187('0x5b')]['QueryTypes'][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0x126fe2){var _0x39445e=_[_0xc187('0x2d')](_0x126fe2,function(_0x3667e5){return Number(_0x3667e5[_0xc187('0x67')]);});return db[_0xc187('0x68')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'OpenchannelQueueId':{'$in':_0x39445e}},'transaction':_0x288401});})[_0xc187('0x42')](function(){var _0x4e8494=_0xc187('0x69')+_0x2b71ac;return db[_0xc187('0x55')][_0xc187('0x30')](_0x4e8494,{'type':db[_0xc187('0x5b')]['QueryTypes'][_0xc187('0x59')],'raw':!![],'transaction':_0x288401});})[_0xc187('0x42')](function(_0xeac791){var _0x10d758=_[_0xc187('0x2d')](_0xeac791,function(_0x52e02c){return Number(_0x52e02c[_0xc187('0x6a')]);});return db[_0xc187('0x6b')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'WhatsappQueueId':{'$in':_0x10d758}},'transaction':_0x288401});})[_0xc187('0x42')](function(){return db[_0xc187('0x6c')][_0xc187('0x6d')]({'where':{'TeamId':_0x2b71ac}});})[_0xc187('0x42')](function(_0x58ca78){if(_0x58ca78===null){return;}return db[_0xc187('0x6e')][_0xc187('0x53')]({'where':{'UserId':{'$in':_0x3e5966},'VoicePrefixId':_0x58ca78[_0xc187('0x6f')]},'transaction':_0x288401});})['then'](function(){return db['Team'][_0xc187('0x53')]({'where':{'id':_0x2b71ac},'cascade':!![],'transaction':_0x288401});})['then'](function(_0xadcfe6){if(_0xadcfe6===0x0){_0x153d99[_0xc187('0x70')](0x194);}else{return db[_0xc187('0x51')][_0xc187('0x53')]({'where':{'type':_0xc187('0x4e'),'resourceId':_0x2b71ac},'cascade':!![],'transaction':_0x288401})[_0xc187('0x42')](function(){_0x153d99[_0xc187('0x1e')](0xcc)[_0xc187('0x1f')]();});}})[_0xc187('0x48')](function(_0x366799){_0x153d99[_0xc187('0x1e')](0x1f4)['send'](_0x366799);});});};exports[_0xc187('0x71')]=function(_0x3f3d1a,_0x35791c,_0x38385a){return db['Team']['findOne']({'where':{'id':_0x3f3d1a['params']['id']}})['then'](handleEntityNotFound(_0x35791c,null))[_0xc187('0x42')](function(_0x45f27a){if(!_0x3f3d1a[_0xc187('0x30')][_0xc187('0x72')]||!utils['isValidChannel'](_0x3f3d1a[_0xc187('0x30')]['channel'])){throw new db[(_0xc187('0x5b'))][(_0xc187('0x73'))](_0xc187('0x74'));}var _0x2a51fe={};var _0x4e43e4={};_0x4e43e4[_0xc187('0x33')]=_[_0xc187('0x31')](db[_['capitalize'](_0x3f3d1a[_0xc187('0x30')]['channel'][_0xc187('0x75')]())+_0xc187('0x76')][_0xc187('0x47')]);_0x4e43e4[_0xc187('0x30')]=_[_0xc187('0x31')](_0x3f3d1a['query']);_0x4e43e4[_0xc187('0x3b')]=_[_0xc187('0x32')](_0x4e43e4[_0xc187('0x33')],_0x4e43e4['query']);_0x2a51fe[_0xc187('0x34')]=_[_0xc187('0x32')](_0x4e43e4['model'],qs[_0xc187('0x35')](_0x3f3d1a['query'][_0xc187('0x35')]));_0x2a51fe[_0xc187('0x34')]=_0x2a51fe[_0xc187('0x34')]['length']?_0x2a51fe[_0xc187('0x34')]:_0x4e43e4[_0xc187('0x33')];_0x2a51fe['limit']=qs[_0xc187('0x23')](_0x3f3d1a[_0xc187('0x30')][_0xc187('0x23')]);_0x2a51fe[_0xc187('0x21')]=qs[_0xc187('0x21')](_0x3f3d1a[_0xc187('0x30')][_0xc187('0x21')]);_0x2a51fe[_0xc187('0x38')]=qs[_0xc187('0x39')](_0x3f3d1a[_0xc187('0x30')][_0xc187('0x39')]);_0x2a51fe['where']=qs[_0xc187('0x3b')](_[_0xc187('0x3a')](_0x3f3d1a['query'],_0x4e43e4[_0xc187('0x3b')]));_0x2a51fe=_[_0xc187('0x3f')]({},_0x2a51fe,_0x3f3d1a[_0xc187('0x40')]);return _0x45f27a[_0xc187('0x4c')+_[_0xc187('0x77')](_0x3f3d1a[_0xc187('0x30')][_0xc187('0x72')]['toLowerCase']())+_0xc187('0x78')](_0x2a51fe);})['then'](respondWithResult(_0x35791c,null))[_0xc187('0x48')](handleError(_0x35791c,null));};exports[_0xc187('0x79')]=function(_0x21c36a,_0x219515,_0x391569){return db[_0xc187('0x41')][_0xc187('0x7a')]({'where':{'id':_0x21c36a['params']['id']}})[_0xc187('0x42')](function(_0x19fde2){if(_0x19fde2){if(!_0x21c36a[_0xc187('0x4a')][_0xc187('0x72')]||!utils[_0xc187('0x7b')](_0x21c36a['body'][_0xc187('0x72')])){throw new db[(_0xc187('0x5b'))]['ValidationError'](_0xc187('0x74'));}return _0x19fde2[_0xc187('0x7c')+_[_0xc187('0x77')](_0x21c36a[_0xc187('0x4a')][_0xc187('0x72')]['toLowerCase']())+_0xc187('0x78')](_0x21c36a[_0xc187('0x4a')][_0xc187('0x7d')]);}return null;})[_0xc187('0x42')](handleEntityNotFound(_0x219515,null))[_0xc187('0x42')](respondWithStatusCode(_0x219515,null))['catch'](handleError(_0x219515,null));};exports[_0xc187('0x7e')]=function(_0x3dd343,_0x48e00c,_0x286049){return db[_0xc187('0x41')]['findOne']({'where':{'id':_0x3dd343['params']['id']}})[_0xc187('0x42')](function(_0x392656){if(_0x392656){if(!_0x3dd343[_0xc187('0x30')]['channel']||!utils[_0xc187('0x7b')](_0x3dd343[_0xc187('0x30')][_0xc187('0x72')])){throw new db['Sequelize'][(_0xc187('0x73'))](_0xc187('0x74'));}return _0x392656['remove'+_['capitalize'](_0x3dd343[_0xc187('0x30')][_0xc187('0x72')][_0xc187('0x75')]())+_0xc187('0x78')](_0x3dd343[_0xc187('0x30')][_0xc187('0x7d')]);}return null;})[_0xc187('0x42')](handleEntityNotFound(_0x48e00c,null))[_0xc187('0x42')](respondWithStatusCode(_0x48e00c,null))[_0xc187('0x48')](handleError(_0x48e00c,null));};exports[_0xc187('0x7f')]=function(_0x5efb42,_0x45368d){var _0x5ab250=_[_0xc187('0x80')](_0x5efb42[_0xc187('0x4a')][_0xc187('0x7d')])?_0x5efb42['body'][_0xc187('0x7d')]:[_0x5efb42[_0xc187('0x4a')]['ids']];var _0x289225=_0x5efb42[_0xc187('0x54')]['id'];return db[_0xc187('0x41')][_0xc187('0x6d')]({'where':{'id':_0x289225}})[_0xc187('0x42')](handleEntityNotFound(_0x45368d,null))[_0xc187('0x42')](function(_0x300e21){if(_0x300e21){var _0x2444d9=[_0xc187('0x81'),'Chat',_0xc187('0x82'),_0xc187('0x83'),'Fax',_0xc187('0x84'),_0xc187('0x85')];return db[_0xc187('0x55')][_0xc187('0x56')](function(_0x3fb840){var _0x356b7f=_[_0xc187('0x2d')](_0x2444d9,function(_0x376c7c){var _0x2cf757={'attributes':['id','name']};if(_0x376c7c==='Voice'){_0x2cf757['through']={'attributes':[_0xc187('0x86')]};}return _0x300e21[_0xc187('0x4c')+_0x376c7c+_0xc187('0x78')](_0x2cf757)['then'](function(_0x4c99ca){var _0x4c56ed=_[_0xc187('0x2d')](_0x4c99ca,function(_0x1eab91){var _0x411034=_['map'](_0x5ab250,function(_0x2b4b99){var _0x4a2620={'where':{'UserId':_0x2b4b99,[_0x376c7c+_0xc187('0x87')]:_0x1eab91['id']},'transaction':_0x3fb840};if(_0x376c7c===_0xc187('0x81')){_0x4a2620[_0xc187('0x19')]={'penalty':_0x1eab91['TeamVoiceQueue'][_0xc187('0x86')]};}return db[_0xc187('0x88')+_0x376c7c+_0xc187('0x76')][_0xc187('0x89')](_0x4a2620)[_0xc187('0x42')](function(){socket[_0xc187('0x8a')]('user'+_0x376c7c+'Queue:save',{'UserId':_0x2b4b99,[_0x376c7c+'QueueId']:_0x1eab91['id']});if(_0x376c7c!==_0xc187('0x81')){return;}return db[_0xc187('0x88')][_0xc187('0x44')]({'where':{'id':_0x5ab250,'online':0x1},'attributes':['id',_0xc187('0x2b'),_0xc187('0x8b'),_0xc187('0x8c'),_0xc187('0x8d')],'raw':!![]})[_0xc187('0x42')](function(_0x134887){var _0x5e63ba=_['map'](_0x134887,function(_0x2d1d4a){return db[_0xc187('0x8e')][_0xc187('0x8f')]({'membername':_0x2d1d4a[_0xc187('0x2b')],'UserId':_0x2d1d4a['id'],'queue_name':_0x1eab91['name'],'VoiceQueueId':_0x1eab91['id'],'interface':_['isNil'](_0x2d1d4a[_0xc187('0x8d')])?util[_0xc187('0x90')](_0xc187('0x91'),_0x2d1d4a[_0xc187('0x2b')]):_0x2d1d4a[_0xc187('0x8d')],'paused':_0x2d1d4a[_0xc187('0x8c')]||![],'penalty':_0x1eab91[_0xc187('0x92')][_0xc187('0x86')]},{'transaction':_0x3fb840});});return Promise[_0xc187('0x93')](_0x5e63ba);});});});return Promise['all'](_0x411034);});return Promise[_0xc187('0x93')](_0x4c56ed);})[_0xc187('0x42')](function(){return db[_0xc187('0x6c')][_0xc187('0x7a')]({'where':{'teamId':_0x289225}})[_0xc187('0x42')](function(_0x325164){if(_0x325164){var _0x517b6b=_[_0xc187('0x2d')](_0x5ab250,function(_0x145a79){db['UserVoicePrefix'][_0xc187('0x8f')]({'UserId':_0x145a79,'VoicePrefixId':_0x325164[_0xc187('0x6f')]});});return Promise[_0xc187('0x93')](_0x517b6b);}});});});return Promise['all'](_0x356b7f)[_0xc187('0x42')](function(){return _0x300e21[_0xc187('0x7f')](_0x5ab250,{'transaction':_0x3fb840})['spread'](function(_0x5cb833){return _0x5cb833;});});});}})[_0xc187('0x42')](respondWithResult(_0x45368d,null))[_0xc187('0x48')](handleError(_0x45368d,null));};exports[_0xc187('0x94')]=function(_0x2d1d60,_0x25d9f3){var _0x452243=_['isArray'](_0x2d1d60['query'][_0xc187('0x7d')])?_0x2d1d60[_0xc187('0x30')][_0xc187('0x7d')]:[_0x2d1d60[_0xc187('0x30')][_0xc187('0x7d')]];var _0x57a8e7=_0x2d1d60[_0xc187('0x54')]['id'];return db[_0xc187('0x41')]['find']({'where':{'id':_0x57a8e7}})['then'](handleEntityNotFound(_0x25d9f3,null))[_0xc187('0x42')](function(_0x3e96a9){if(_0x3e96a9){var _0x4f016c=[_0xc187('0x81'),_0xc187('0x95'),_0xc187('0x82'),'Sms',_0xc187('0x96'),_0xc187('0x84'),_0xc187('0x85')];return db[_0xc187('0x55')][_0xc187('0x56')](function(_0x597009){var _0x5dc1fe=_[_0xc187('0x2d')](_0x4f016c,function(_0x137720){var _0x4883d7={'attributes':['id',_0xc187('0x2b')]};return _0x3e96a9[_0xc187('0x4c')+_0x137720+_0xc187('0x78')](_0x4883d7)[_0xc187('0x42')](function(_0x24a1fe){var _0x165eb7=_['map'](_0x24a1fe,function(_0x5ac17a){return _0x5ac17a[_0xc187('0x94')](_0x452243,{'transaction':_0x597009})[_0xc187('0x42')](function(){var _0x214655=_[_0xc187('0x2d')](_0x452243,function(_0xaa8e11){socket[_0xc187('0x8a')](_0xc187('0x4b')+_0x137720+'Queue:remove',{'UserId':Number(_0xaa8e11),[_0x137720+_0xc187('0x87')]:_0x5ac17a['id']});if(_0x137720!==_0xc187('0x81')){return;}return db['UserVoiceQueueRt'][_0xc187('0x53')]({'where':{'VoiceQueueId':_0x5ac17a['id'],'UserId':_0xaa8e11},'transaction':_0x597009});});return Promise[_0xc187('0x93')](_0x214655);});});return Promise[_0xc187('0x93')](_0x165eb7);});});return Promise[_0xc187('0x93')](_0x5dc1fe)['then'](function(){return _0x3e96a9[_0xc187('0x94')](_0x452243,{'transaction':_0x597009});})[_0xc187('0x42')](function(){return db[_0xc187('0x6c')][_0xc187('0x7a')]({'where':{'teamId':_0x57a8e7}})[_0xc187('0x42')](function(_0x4becd5){if(_0x4becd5){var _0x2f870a=_['map'](_0x452243,function(_0x365eed){db['UserVoicePrefix'][_0xc187('0x53')]({'where':{'UserId':_0x365eed,'VoicePrefixId':_0x4becd5[_0xc187('0x6f')]}});});return Promise[_0xc187('0x93')](_0x2f870a);}});});});}})[_0xc187('0x42')](respondWithStatusCode(_0x25d9f3,null))[_0xc187('0x48')](handleError(_0x25d9f3,null));};exports['getAgents']=function(_0x4431af,_0x40f54d,_0x36bf6e){var _0x4f1eb={};var _0x5c2dc8={};var _0x5789d0;var _0x34028c;return db[_0xc187('0x41')]['findOne']({'where':{'id':_0x4431af[_0xc187('0x54')]['id']}})[_0xc187('0x42')](handleEntityNotFound(_0x40f54d,null))['then'](function(_0x5b5c37){if(_0x5b5c37){_0x5789d0=_0x5b5c37;_0x5c2dc8[_0xc187('0x33')]=_[_0xc187('0x31')](db[_0xc187('0x88')][_0xc187('0x47')]);_0x5c2dc8[_0xc187('0x30')]=_[_0xc187('0x31')](_0x4431af[_0xc187('0x30')]);_0x5c2dc8['filters']=_['intersection'](_0x5c2dc8['model'],_0x5c2dc8[_0xc187('0x30')]);_0x4f1eb[_0xc187('0x34')]=_['intersection'](_0x5c2dc8[_0xc187('0x33')],qs[_0xc187('0x35')](_0x4431af['query'][_0xc187('0x35')]));_0x4f1eb[_0xc187('0x34')]=_0x4f1eb[_0xc187('0x34')][_0xc187('0x36')]?_0x4f1eb['attributes']:_0x5c2dc8[_0xc187('0x33')];_0x4f1eb['order']=qs['sort'](_0x4431af[_0xc187('0x30')][_0xc187('0x39')]);_0x4f1eb[_0xc187('0x3d')]=qs[_0xc187('0x3b')](_[_0xc187('0x3a')](_0x4431af[_0xc187('0x30')],_0x5c2dc8[_0xc187('0x3b')]));if(_0x4431af['query'][_0xc187('0x3c')]){_0x4f1eb[_0xc187('0x3d')]=_[_0xc187('0x3f')](_0x4f1eb[_0xc187('0x3d')],{'$or':_[_0xc187('0x2d')](_0x4f1eb[_0xc187('0x34')],function(_0x11dc22){var _0x14bc54={};_0x14bc54[_0x11dc22]={'$like':'%'+_0x4431af[_0xc187('0x30')][_0xc187('0x3c')]+'%'};return _0x14bc54;})});}_0x4f1eb=_['merge']({},_0x4f1eb,_0x4431af[_0xc187('0x40')]);return _0x5789d0[_0xc187('0x97')](_0x4f1eb);}})[_0xc187('0x42')](function(_0x3e88fb){if(_0x3e88fb){_0x34028c=_0x3e88fb[_0xc187('0x36')];if(!_0x4431af[_0xc187('0x30')][_0xc187('0x98')](_0xc187('0x37'))){_0x4f1eb[_0xc187('0x23')]=qs[_0xc187('0x23')](_0x4431af[_0xc187('0x30')]['limit']);_0x4f1eb[_0xc187('0x21')]=qs[_0xc187('0x21')](_0x4431af['query']['offset']);}return _0x5789d0[_0xc187('0x97')](_0x4f1eb);}})[_0xc187('0x42')](function(_0x34c08c){if(_0x34c08c){return _0x34c08c?{'count':_0x34028c,'rows':_0x34c08c}:null;}})[_0xc187('0x42')](respondWithResult(_0x40f54d,null))[_0xc187('0x48')](handleError(_0x40f54d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 425b1cf..8997127 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 _0x777b=['setMaxListeners','save','update','emit','hasOwnProperty','events','Team'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0x777b,0x15c));var _0xb777=function(_0x1efa2a,_0x50ea23){_0x1efa2a=_0x1efa2a-0x0;var _0x38e115=_0x777b[_0x1efa2a];return _0x38e115;};'use strict';var EventEmitter=require(_0xb777('0x0'));var Team=require('../../mysqldb')['db'][_0xb777('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xb777('0x2')](0x0);var events={'afterCreate':_0xb777('0x3'),'afterUpdate':_0xb777('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa7f992){return function(_0x2c6bb7,_0x419ad9,_0x2d9635){TeamEvents[_0xb777('0x5')](_0xa7f992+':'+_0x2c6bb7['id'],_0x2c6bb7);TeamEvents['emit'](_0xa7f992,_0x2c6bb7);_0x2d9635(null);};}for(var e in events){if(events[_0xb777('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x36f5=['events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4fc77b,_0x3deff2){var _0x53fa6a=function(_0xd6445a){while(--_0xd6445a){_0x4fc77b['push'](_0x4fc77b['shift']());}};_0x53fa6a(++_0x3deff2);}(_0x36f5,0x168));var _0x536f=function(_0x4e1694,_0x4b1827){_0x4e1694=_0x4e1694-0x0;var _0x59c2b3=_0x36f5[_0x4e1694];return _0x59c2b3;};'use strict';var EventEmitter=require(_0x536f('0x0'));var Team=require(_0x536f('0x1'))['db'][_0x536f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x536f('0x3')](0x0);var events={'afterCreate':_0x536f('0x4'),'afterUpdate':'update','afterDestroy':_0x536f('0x5')};function emitEvent(_0x4e5938){return function(_0x122ad0,_0x29c591,_0x4c31fa){TeamEvents[_0x536f('0x6')](_0x4e5938+':'+_0x122ad0['id'],_0x122ad0);TeamEvents[_0x536f('0x6')](_0x4e5938,_0x122ad0);_0x4c31fa(null);};}for(var e in events){if(events[_0x536f('0x7')](e)){var event=events[e];Team[_0x536f('0x8')](e,emitEvent(event));}}module[_0x536f('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 180cb6c..15b3385 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 _0xc6cb=['channel','catch','exports','define','Team','teams','Chat','Mail','Openchannel','Sms','resolve','all','lodash','Queues','then','map','setDataValue'];(function(_0x236912,_0x4167cd){var _0x582904=function(_0x3d9a19){while(--_0x3d9a19){_0x236912['push'](_0x236912['shift']());}};_0x582904(++_0x4167cd);}(_0xc6cb,0x182));var _0xbc6c=function(_0x500a52,_0xbd1990){_0x500a52=_0x500a52-0x0;var _0x54f8c4=_0xc6cb[_0x500a52];return _0x54f8c4;};'use strict';var _=require(_0xbc6c('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x3ca782,_0x307498){var _0x115b69='get'+_0x307498+_0xbc6c('0x1');return _0x3ca782[_0x115b69]()[_0xbc6c('0x2')](function(_0x4d22e9){return _[_0xbc6c('0x3')](_0x4d22e9,function(_0x5494cb){_0x5494cb[_0xbc6c('0x4')](_0xbc6c('0x5'),_0x307498);return _0x5494cb;});})[_0xbc6c('0x6')](function(_0x233d7c){throw _0x233d7c;});}module[_0xbc6c('0x7')]=function(_0x524a40){return _0x524a40[_0xbc6c('0x8')](_0xbc6c('0x9'),attributes,{'tableName':_0xbc6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x446372=this;var _0x3404eb=[_0xbc6c('0xb'),'Fax',_0xbc6c('0xc'),_0xbc6c('0xd'),_0xbc6c('0xe'),'Voice','Whatsapp'];return Promise[_0xbc6c('0xf')]()[_0xbc6c('0x2')](function(){var _0x29b2d9=_[_0xbc6c('0x3')](_0x3404eb,function(_0xf3eb03){return getQueuesByChannel(_0x446372,_0xf3eb03);});return Promise[_0xbc6c('0x10')](_0x29b2d9);})[_0xbc6c('0x6')](function(_0xa8e7cd){throw _0xa8e7cd;});}}});}; \ No newline at end of file +var _0x8cd6=['./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','teams','Fax','Openchannel','Sms','Voice','Whatsapp','resolve','all'];(function(_0x19c7bf,_0x130f9d){var _0x4c5970=function(_0x4fc7cf){while(--_0x4fc7cf){_0x19c7bf['push'](_0x19c7bf['shift']());}};_0x4c5970(++_0x130f9d);}(_0x8cd6,0x11d));var _0x68cd=function(_0x1e3c2a,_0x33acf3){_0x1e3c2a=_0x1e3c2a-0x0;var _0x10fa0c=_0x8cd6[_0x1e3c2a];return _0x10fa0c;};'use strict';var _=require('lodash');var attributes=require(_0x68cd('0x0'));function getQueuesByChannel(_0x4bc148,_0xc85396){var _0x20c030=_0x68cd('0x1')+_0xc85396+_0x68cd('0x2');return _0x4bc148[_0x20c030]()[_0x68cd('0x3')](function(_0x1e36f9){return _[_0x68cd('0x4')](_0x1e36f9,function(_0x2dd6c5){_0x2dd6c5[_0x68cd('0x5')](_0x68cd('0x6'),_0xc85396);return _0x2dd6c5;});})[_0x68cd('0x7')](function(_0x5a27e9){throw _0x5a27e9;});}module[_0x68cd('0x8')]=function(_0x2d57b6){return _0x2d57b6[_0x68cd('0x9')](_0x68cd('0xa'),attributes,{'tableName':_0x68cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xeaaf8e=this;var _0x4da687=['Chat',_0x68cd('0xc'),'Mail',_0x68cd('0xd'),_0x68cd('0xe'),_0x68cd('0xf'),_0x68cd('0x10')];return Promise[_0x68cd('0x11')]()[_0x68cd('0x3')](function(){var _0x3dc180=_[_0x68cd('0x4')](_0x4da687,function(_0x5bc70b){return getQueuesByChannel(_0xeaaf8e,_0x5bc70b);});return Promise[_0x68cd('0x12')](_0x3dc180);})[_0x68cd('0x7')](function(_0x169c53){throw _0x169c53;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 46b7cb6..a5833ce 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 _0xa9c8=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0xa9c8,0x11c));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a9c('0x0'));var BPromise=require(_0x8a9c('0x1'));var rs=require(_0x8a9c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a9c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a9c('0x4'))(_0x8a9c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a9c('0x6')][_0x8a9c('0x7')]({'port':0x232a});config[_0x8a9c('0x8')]=_[_0x8a9c('0x9')](config[_0x8a9c('0x8')],{'host':_0x8a9c('0xa'),'port':0x18eb});var socket=require(_0x8a9c('0xb'))(new Redis(config['redis']));require(_0x8a9c('0xc'))[_0x8a9c('0xd')](socket);function respondWithRpcPromise(_0x7d8b69,_0xfca5c6,_0x20a839){return new BPromise(function(_0x4719f5,_0x413792){return client[_0x8a9c('0xe')](_0x7d8b69,_0x20a839)[_0x8a9c('0xf')](function(_0x24d78a){logger[_0x8a9c('0x10')](_0x8a9c('0x11'),_0xfca5c6,'request\x20sent');logger[_0x8a9c('0x12')](_0x8a9c('0x13'),_0xfca5c6,_0x8a9c('0x14'),JSON[_0x8a9c('0x15')](_0x24d78a));if(_0x24d78a[_0x8a9c('0x16')]){if(_0x24d78a[_0x8a9c('0x16')][_0x8a9c('0x17')]===0x1f4){logger[_0x8a9c('0x16')](_0x8a9c('0x11'),_0xfca5c6,_0x24d78a[_0x8a9c('0x16')][_0x8a9c('0x18')]);return _0x413792(_0x24d78a[_0x8a9c('0x16')][_0x8a9c('0x18')]);}logger[_0x8a9c('0x16')]('Team,\x20%s,\x20%s',_0xfca5c6,_0x24d78a['error']['message']);return _0x4719f5(_0x24d78a[_0x8a9c('0x16')]['message']);}else{logger[_0x8a9c('0x10')](_0x8a9c('0x11'),_0xfca5c6,_0x8a9c('0x14'));_0x4719f5(_0x24d78a[_0x8a9c('0x19')][_0x8a9c('0x18')]);}})['catch'](function(_0xb20a61){logger['error']('Team,\x20%s,\x20%s',_0xfca5c6,_0xb20a61);_0x413792(_0xb20a61);});});} \ No newline at end of file +var _0x7881=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7881,0x1b0));var _0x1788=function(_0x39b0a9,_0x3181c7){_0x39b0a9=_0x39b0a9-0x0;var _0x4b6884=_0x7881[_0x39b0a9];return _0x4b6884;};'use strict';var _=require(_0x1788('0x0'));var util=require('util');var moment=require(_0x1788('0x1'));var BPromise=require('bluebird');var rs=require(_0x1788('0x2'));var fs=require('fs');var Redis=require(_0x1788('0x3'));var db=require(_0x1788('0x4'))['db'];var utils=require(_0x1788('0x5'));var logger=require(_0x1788('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1788('0x7'));var client=jayson['client'][_0x1788('0x8')]({'port':0x232a});config[_0x1788('0x9')]=_[_0x1788('0xa')](config[_0x1788('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1788('0x9')]));require(_0x1788('0xb'))[_0x1788('0xc')](socket);function respondWithRpcPromise(_0x524c93,_0x2adceb,_0xfd8b65){return new BPromise(function(_0x2ea03c,_0xc2949d){return client[_0x1788('0xd')](_0x524c93,_0xfd8b65)[_0x1788('0xe')](function(_0x21ffb0){logger[_0x1788('0xf')](_0x1788('0x10'),_0x2adceb,_0x1788('0x11'));logger[_0x1788('0x12')](_0x1788('0x13'),_0x2adceb,_0x1788('0x11'),JSON[_0x1788('0x14')](_0x21ffb0));if(_0x21ffb0['error']){if(_0x21ffb0[_0x1788('0x15')]['code']===0x1f4){logger[_0x1788('0x15')](_0x1788('0x10'),_0x2adceb,_0x21ffb0[_0x1788('0x15')][_0x1788('0x16')]);return _0xc2949d(_0x21ffb0[_0x1788('0x15')][_0x1788('0x16')]);}logger[_0x1788('0x15')](_0x1788('0x10'),_0x2adceb,_0x21ffb0['error']['message']);return _0x2ea03c(_0x21ffb0[_0x1788('0x15')][_0x1788('0x16')]);}else{logger[_0x1788('0xf')](_0x1788('0x10'),_0x2adceb,_0x1788('0x11'));_0x2ea03c(_0x21ffb0['result'][_0x1788('0x16')]);}})[_0x1788('0x17')](function(_0x493f9a){logger['error'](_0x1788('0x10'),_0x2adceb,_0x493f9a);_0xc2949d(_0x493f9a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 6743066..ba94aa0 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 _0x3fe7=['save','remove','update','emit','removeListener','register','./team.events'];(function(_0x40cacb,_0x2d291f){var _0x57491f=function(_0x4b22bb){while(--_0x4b22bb){_0x40cacb['push'](_0x40cacb['shift']());}};_0x57491f(++_0x2d291f);}(_0x3fe7,0x125));var _0x73fe=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0x3fe7[_0x15f724];return _0x49b152;};'use strict';var TeamEvents=require(_0x73fe('0x0'));var events=[_0x73fe('0x1'),_0x73fe('0x2'),_0x73fe('0x3')];function createListener(_0x4d70c0,_0x421c71){return function(_0x498b0e){_0x421c71[_0x73fe('0x4')](_0x4d70c0,_0x498b0e);};}function removeListener(_0x4b7460,_0x509ad5){return function(){TeamEvents[_0x73fe('0x5')](_0x4b7460,_0x509ad5);};}exports[_0x73fe('0x6')]=function(_0x556b87){for(var _0x44df50=0x0,_0x1bf8c8=events['length'];_0x44df50<_0x1bf8c8;_0x44df50++){var _0x1cbbb9=events[_0x44df50];var _0x19bd6f=createListener('team:'+_0x1cbbb9,_0x556b87);TeamEvents['on'](_0x1cbbb9,_0x19bd6f);}}; \ No newline at end of file +var _0x8a64=['update','emit','removeListener','length','team:','./team.events','save','remove'];(function(_0x2432e2,_0xb3d453){var _0x3b58e0=function(_0x3b2378){while(--_0x3b2378){_0x2432e2['push'](_0x2432e2['shift']());}};_0x3b58e0(++_0xb3d453);}(_0x8a64,0xfd));var _0x48a6=function(_0x2eb601,_0x14022f){_0x2eb601=_0x2eb601-0x0;var _0x1e7ed8=_0x8a64[_0x2eb601];return _0x1e7ed8;};'use strict';var TeamEvents=require(_0x48a6('0x0'));var events=[_0x48a6('0x1'),_0x48a6('0x2'),_0x48a6('0x3')];function createListener(_0x5085bf,_0x3b312f){return function(_0x4b0cc4){_0x3b312f[_0x48a6('0x4')](_0x5085bf,_0x4b0cc4);};}function removeListener(_0x6b8a3c,_0x139cb1){return function(){TeamEvents[_0x48a6('0x5')](_0x6b8a3c,_0x139cb1);};}exports['register']=function(_0x5604f6){for(var _0x16b094=0x0,_0x380936=events[_0x48a6('0x6')];_0x16b094<_0x380936;_0x16b094++){var _0x381831=events[_0x16b094];var _0x174b6d=createListener(_0x48a6('0x7')+_0x381831,_0x5604f6);TeamEvents['on'](_0x381831,_0x174b6d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index d5b5f4d..364423a 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 _0xea12=['exports','INTEGER','sequelize'];(function(_0x3c4f7c,_0x462787){var _0xb5b7cc=function(_0x555b7a){while(--_0x555b7a){_0x3c4f7c['push'](_0x3c4f7c['shift']());}};_0xb5b7cc(++_0x462787);}(_0xea12,0x149));var _0x2ea1=function(_0x50ec23,_0x3c11c0){_0x50ec23=_0x50ec23-0x0;var _0x223fb5=_0xea12[_0x50ec23];return _0x223fb5;};'use strict';var Sequelize=require(_0x2ea1('0x0'));module[_0x2ea1('0x1')]={'TeamId':{'type':Sequelize[_0x2ea1('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2ea1('0x2')]}}; \ No newline at end of file +var _0x9809=['sequelize','exports','INTEGER'];(function(_0x12ae97,_0x385f36){var _0xb50847=function(_0x50238c){while(--_0x50238c){_0x12ae97['push'](_0x12ae97['shift']());}};_0xb50847(++_0x385f36);}(_0x9809,0x1da));var _0x9980=function(_0x5d834c,_0x464e9b){_0x5d834c=_0x5d834c-0x0;var _0x34bb53=_0x9809[_0x5d834c];return _0x34bb53;};'use strict';var Sequelize=require(_0x9980('0x0'));module[_0x9980('0x1')]={'TeamId':{'type':Sequelize[_0x9980('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x9980('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a6b3d63..14dc8c2 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 _0x88c3=['../../config/logger','bluebird','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x3650cc,_0x2489d6){var _0x165164=function(_0x107bca){while(--_0x107bca){_0x3650cc['push'](_0x3650cc['shift']());}};_0x165164(++_0x2489d6);}(_0x88c3,0x1ee));var _0x388c=function(_0x1be011,_0x2c9ccd){_0x1be011=_0x1be011-0x0;var _0x5eaf84=_0x88c3[_0x1be011];return _0x5eaf84;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var logger=require(_0x388c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x388c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x388c('0x3'));var config=require(_0x388c('0x4'));var attributes=require(_0x388c('0x5'));module[_0x388c('0x6')]=function(_0x28ed4d,_0x23199c){return _0x28ed4d['define'](_0x388c('0x7'),attributes,{'tableName':_0x388c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19cb=['TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','request-promise','./teamVoicePrefix.attributes','exports','define'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x19cb,0x146));var _0xb19c=function(_0x3b1433,_0x2d39d1){_0x3b1433=_0x3b1433-0x0;var _0x1356c2=_0x19cb[_0x3b1433];return _0x1356c2;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var logger=require(_0xb19c('0x1'))('api');var moment=require(_0xb19c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb19c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb19c('0x4'));module[_0xb19c('0x5')]=function(_0x5a145d,_0x551f8d){return _0x5a145d[_0xb19c('0x6')](_0xb19c('0x7'),attributes,{'tableName':_0xb19c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 6e7c1da..90445ba 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a1108,_0x3371c1){var _0x4656e3=function(_0x2b643b){while(--_0x2b643b){_0x2a1108['push'](_0x2a1108['shift']());}};_0x4656e3(++_0x3371c1);}(_0x70e0,0x17b));var _0x070e=function(_0x2752d2,_0x1a6312){_0x2752d2=_0x2752d2-0x0;var _0x2037a6=_0x70e0[_0x2752d2];return _0x2037a6;};'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(_0x19e578,_0x250e24){var _0x595b41=function(_0x48d80f){while(--_0x48d80f){_0x19e578['push'](_0x19e578['shift']());}};_0x595b41(++_0x250e24);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 5f14c57..1d7f2af 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 _0x22c0=['sequelize','exports'];(function(_0x2c9f67,_0x2dd30a){var _0x4efd42=function(_0x4fdf83){while(--_0x4fdf83){_0x2c9f67['push'](_0x2c9f67['shift']());}};_0x4efd42(++_0x2dd30a);}(_0x22c0,0x1c4));var _0x022c=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0x22c0[_0x2142c8];return _0x4286e9;};'use strict';var Sequelize=require(_0x022c('0x0'));module[_0x022c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c06=['sequelize','INTEGER'];(function(_0x104085,_0x21da34){var _0x596c4d=function(_0x510c29){while(--_0x510c29){_0x104085['push'](_0x104085['shift']());}};_0x596c4d(++_0x21da34);}(_0x5c06,0x6c));var _0x65c0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5c06[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x65c0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x65c0('0x1')],'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 65c4dc5..22e2df3 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 _0xa1db=['request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x3ce667,_0x504d04){var _0x4af254=function(_0x517f72){while(--_0x517f72){_0x3ce667['push'](_0x3ce667['shift']());}};_0x4af254(++_0x504d04);}(_0xa1db,0xb0));var _0xba1d=function(_0x241ada,_0x38127a){_0x241ada=_0x241ada-0x0;var _0x3662b7=_0xa1db[_0x241ada];return _0x3662b7;};'use strict';var _=require(_0xba1d('0x0'));var util=require(_0xba1d('0x1'));var logger=require(_0xba1d('0x2'))(_0xba1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba1d('0x4'));var fs=require('fs');var path=require(_0xba1d('0x5'));var rimraf=require('rimraf');var config=require(_0xba1d('0x6'));var attributes=require(_0xba1d('0x7'));module[_0xba1d('0x8')]=function(_0xf79440,_0xea5887){return _0xf79440[_0xba1d('0x9')](_0xba1d('0xa'),attributes,{'tableName':_0xba1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bde=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','api','bluebird'];(function(_0x5431c8,_0x2dbf8c){var _0x2b5920=function(_0x3829ee){while(--_0x3829ee){_0x5431c8['push'](_0x5431c8['shift']());}};_0x2b5920(++_0x2dbf8c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3fb3ca,_0x1e2272){_0x3fb3ca=_0x3fb3ca-0x0;var _0x4db381=_0x9bde[_0x3fb3ca];return _0x4db381;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'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 9c4e29b..66c7e9c 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 _0x887e=['../../config/logger','../../config/environment','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21dd5e,_0x56ce80){var _0x3ff04b=function(_0x468db2){while(--_0x468db2){_0x21dd5e['push'](_0x21dd5e['shift']());}};_0x3ff04b(++_0x56ce80);}(_0x887e,0x14d));var _0xe887=function(_0x59a6db,_0x2442f6){_0x59a6db=_0x59a6db-0x0;var _0x5a34e6=_0x887e[_0x59a6db];return _0x5a34e6;};'use strict';var _=require(_0xe887('0x0'));var util=require(_0xe887('0x1'));var moment=require(_0xe887('0x2'));var BPromise=require(_0xe887('0x3'));var rs=require(_0xe887('0x4'));var fs=require('fs');var Redis=require(_0xe887('0x5'));var db=require(_0xe887('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe887('0x7'))('rpc');var config=require(_0xe887('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe887('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xddbe2a,_0x509280,_0x506c99){return new BPromise(function(_0xc48ea1,_0xf8e18d){return client[_0xe887('0xa')](_0xddbe2a,_0x506c99)['then'](function(_0x4beea3){logger[_0xe887('0xb')](_0xe887('0xc'),_0x509280,_0xe887('0xd'));logger['debug'](_0xe887('0xe'),_0x509280,_0xe887('0xd'),JSON[_0xe887('0xf')](_0x4beea3));if(_0x4beea3['error']){if(_0x4beea3[_0xe887('0x10')][_0xe887('0x11')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x509280,_0x4beea3[_0xe887('0x10')][_0xe887('0x12')]);return _0xf8e18d(_0x4beea3[_0xe887('0x10')]['message']);}logger[_0xe887('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x509280,_0x4beea3['error'][_0xe887('0x12')]);return _0xc48ea1(_0x4beea3[_0xe887('0x10')]['message']);}else{logger[_0xe887('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x509280,_0xe887('0xd'));_0xc48ea1(_0x4beea3['result']['message']);}})[_0xe887('0x13')](function(_0x2e82ea){logger[_0xe887('0x10')](_0xe887('0xc'),_0x509280,_0x2e82ea);_0xf8e18d(_0x2e82ea);});});} \ No newline at end of file +var _0x4de7=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x59b439,_0x4e16b6){var _0x74d02b=function(_0x319ddc){while(--_0x319ddc){_0x59b439['push'](_0x59b439['shift']());}};_0x74d02b(++_0x4e16b6);}(_0x4de7,0x1f3));var _0x74de=function(_0x141332,_0x228da0){_0x141332=_0x141332-0x0;var _0x327633=_0x4de7[_0x141332];return _0x327633;};'use strict';var _=require(_0x74de('0x0'));var util=require('util');var moment=require(_0x74de('0x1'));var BPromise=require(_0x74de('0x2'));var rs=require(_0x74de('0x3'));var fs=require('fs');var Redis=require(_0x74de('0x4'));var db=require(_0x74de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74de('0x6'))(_0x74de('0x7'));var config=require(_0x74de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x74de('0x9')][_0x74de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2133a6,_0x6ffd41,_0x370dcf){return new BPromise(function(_0x285159,_0x175c71){return client[_0x74de('0xb')](_0x2133a6,_0x370dcf)[_0x74de('0xc')](function(_0x3ef690){logger['info'](_0x74de('0xd'),_0x6ffd41,'request\x20sent');logger[_0x74de('0xe')](_0x74de('0xf'),_0x6ffd41,'request\x20sent',JSON[_0x74de('0x10')](_0x3ef690));if(_0x3ef690[_0x74de('0x11')]){if(_0x3ef690[_0x74de('0x11')][_0x74de('0x12')]===0x1f4){logger[_0x74de('0x11')](_0x74de('0xd'),_0x6ffd41,_0x3ef690['error'][_0x74de('0x13')]);return _0x175c71(_0x3ef690['error'][_0x74de('0x13')]);}logger[_0x74de('0x11')](_0x74de('0xd'),_0x6ffd41,_0x3ef690['error'][_0x74de('0x13')]);return _0x285159(_0x3ef690[_0x74de('0x11')]['message']);}else{logger[_0x74de('0x14')](_0x74de('0xd'),_0x6ffd41,_0x74de('0x15'));_0x285159(_0x3ef690[_0x74de('0x16')][_0x74de('0x13')]);}})[_0x74de('0x17')](function(_0x3116ef){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x6ffd41,_0x3116ef);_0x175c71(_0x3116ef);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5f24d5e..e904b99 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 _0x59ac=['index','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x587a45,_0x302087){var _0x22561c=function(_0x292083){while(--_0x292083){_0x587a45['push'](_0x587a45['shift']());}};_0x22561c(++_0x302087);}(_0x59ac,0x73));var _0xc59a=function(_0x56a69f,_0x1bf698){_0x56a69f=_0x56a69f-0x0;var _0x1cb629=_0x59ac[_0x56a69f];return _0x1cb629;};'use strict';var multer=require(_0xc59a('0x0'));var util=require(_0xc59a('0x1'));var path=require(_0xc59a('0x2'));var timeout=require(_0xc59a('0x3'));var express=require(_0xc59a('0x4'));var router=express['Router']();var fs_extra=require(_0xc59a('0x5'));var auth=require(_0xc59a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc59a('0x7'));var controller=require(_0xc59a('0x8'));router[_0xc59a('0x9')]('/',auth[_0xc59a('0xa')](),controller[_0xc59a('0xb')]);router['get'](_0xc59a('0xc'),auth['isAuthenticated'](),controller[_0xc59a('0xd')]);router['post']('/',auth[_0xc59a('0xa')](),controller['create']);router[_0xc59a('0xe')]('/:id',auth[_0xc59a('0xa')](),controller['update']);router[_0xc59a('0xf')]('/:id',auth[_0xc59a('0xa')](),controller[_0xc59a('0x10')]);module[_0xc59a('0x11')]=router; \ No newline at end of file +var _0xc3ed=['show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x34af74,_0x59ab9d){var _0x12d74b=function(_0x51a854){while(--_0x51a854){_0x34af74['push'](_0x34af74['shift']());}};_0x12d74b(++_0x59ab9d);}(_0xc3ed,0x111));var _0xdc3e=function(_0x5a7e7e,_0x14d5ad){_0x5a7e7e=_0x5a7e7e-0x0;var _0x57e099=_0xc3ed[_0x5a7e7e];return _0x57e099;};'use strict';var multer=require(_0xdc3e('0x0'));var util=require(_0xdc3e('0x1'));var path=require('path');var timeout=require(_0xdc3e('0x2'));var express=require(_0xdc3e('0x3'));var router=express[_0xdc3e('0x4')]();var fs_extra=require(_0xdc3e('0x5'));var auth=require(_0xdc3e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdc3e('0x7'));var controller=require('./template.controller');router[_0xdc3e('0x8')]('/',auth[_0xdc3e('0x9')](),controller[_0xdc3e('0xa')]);router[_0xdc3e('0x8')](_0xdc3e('0xb'),auth[_0xdc3e('0x9')](),controller[_0xdc3e('0xc')]);router[_0xdc3e('0xd')]('/',auth[_0xdc3e('0x9')](),controller[_0xdc3e('0xe')]);router[_0xdc3e('0xf')](_0xdc3e('0xb'),auth[_0xdc3e('0x9')](),controller[_0xdc3e('0x10')]);router[_0xdc3e('0x11')](_0xdc3e('0xb'),auth[_0xdc3e('0x9')](),controller['destroy']);module[_0xdc3e('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 b2f3027..3df1d97 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 _0x9756=['exports','STRING','TEXT','sequelize'];(function(_0x19b840,_0x1c9624){var _0x4d76b8=function(_0x4e8989){while(--_0x4e8989){_0x19b840['push'](_0x19b840['shift']());}};_0x4d76b8(++_0x1c9624);}(_0x9756,0x1d7));var _0x6975=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9756[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x6975('0x0'));module[_0x6975('0x1')]={'name':{'type':Sequelize[_0x6975('0x2')]},'description':{'type':Sequelize[_0x6975('0x2')]},'html':{'type':Sequelize[_0x6975('0x3')]}}; \ No newline at end of file +var _0x6a0c=['STRING','TEXT','sequelize'];(function(_0x2ac8b0,_0x39b949){var _0xe9d3b7=function(_0x529ac5){while(--_0x529ac5){_0x2ac8b0['push'](_0x2ac8b0['shift']());}};_0xe9d3b7(++_0x39b949);}(_0x6a0c,0xc5));var _0xc6a0=function(_0x373147,_0x1e58d8){_0x373147=_0x373147-0x0;var _0x27567d=_0x6a0c[_0x373147];return _0x27567d;};'use strict';var Sequelize=require(_0xc6a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc6a0('0x1')]},'html':{'type':Sequelize[_0xc6a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f0ecd60..527ed17 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 _0x1bea=['Template','findAll','rows','catch','show','params','fields','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include'];(function(_0x577789,_0x24b8e8){var _0x403787=function(_0x4eca9a){while(--_0x4eca9a){_0x577789['push'](_0x577789['shift']());}};_0x403787(++_0x24b8e8);}(_0x1bea,0x67));var _0xa1be=function(_0x3ad202,_0x30668a){_0x3ad202=_0x3ad202-0x0;var _0x1bd6e4=_0x1bea[_0x3ad202];return _0x1bd6e4;};'use strict';var emlformat=require(_0xa1be('0x0'));var rimraf=require(_0xa1be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1be('0x2'));var rp=require(_0xa1be('0x3'));var moment=require(_0xa1be('0x4'));var BPromise=require(_0xa1be('0x5'));var Mustache=require('mustache');var util=require(_0xa1be('0x6'));var path=require(_0xa1be('0x7'));var sox=require(_0xa1be('0x8'));var csv=require('to-csv');var ejs=require(_0xa1be('0x9'));var fs=require('fs');var fs_extra=require(_0xa1be('0xa'));var _=require(_0xa1be('0xb'));var squel=require('squel');var crypto=require(_0xa1be('0xc'));var jsforce=require(_0xa1be('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa1be('0xe'));var querystring=require(_0xa1be('0xf'));var Papa=require(_0xa1be('0x10'));var Redis=require(_0xa1be('0x11'));var authService=require(_0xa1be('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa1be('0x13'));var hardwareService=require(_0xa1be('0x14'));var logger=require('../../config/logger')(_0xa1be('0x15'));var utils=require('../../config/utils');var config=require(_0xa1be('0x16'));var licenseUtil=require(_0xa1be('0x17'));var db=require(_0xa1be('0x18'))['db'];function respondWithStatusCode(_0x5db43a,_0x2f8e31){_0x2f8e31=_0x2f8e31||0xcc;return function(_0x36f359){if(_0x36f359){return _0x5db43a[_0xa1be('0x19')](_0x2f8e31);}return _0x5db43a[_0xa1be('0x1a')](_0x2f8e31)[_0xa1be('0x1b')]();};}function respondWithResult(_0x4d0f7b,_0x576526){_0x576526=_0x576526||0xc8;return function(_0x2fde12){if(_0x2fde12){return _0x4d0f7b[_0xa1be('0x1a')](_0x576526)[_0xa1be('0x1c')](_0x2fde12);}};}function respondWithFilteredResult(_0x44d7cc,_0x2066b4){return function(_0x1b6c5e){if(_0x1b6c5e){var _0x5d1566=typeof _0x2066b4[_0xa1be('0x1d')]==='undefined'&&typeof _0x2066b4[_0xa1be('0x1e')]===_0xa1be('0x1f');var _0x9ac3f0=_0x1b6c5e[_0xa1be('0x20')];var _0x63200=_0x5d1566?0x0:_0x2066b4[_0xa1be('0x1d')];var _0x422b01=_0x5d1566?_0x1b6c5e['count']:_0x2066b4['offset']+_0x2066b4[_0xa1be('0x1e')];var _0xe85e63;if(_0x422b01>=_0x9ac3f0){_0x422b01=_0x9ac3f0;_0xe85e63=0xc8;}else{_0xe85e63=0xce;}_0x44d7cc['status'](_0xe85e63);return _0x44d7cc[_0xa1be('0x21')](_0xa1be('0x22'),_0x63200+'-'+_0x422b01+'/'+_0x9ac3f0)[_0xa1be('0x1c')](_0x1b6c5e);}return null;};}function patchUpdates(_0x2e8159){return function(_0x18bb59){try{jsonpatch['apply'](_0x18bb59,_0x2e8159,!![]);}catch(_0x5905ac){return BPromise[_0xa1be('0x23')](_0x5905ac);}return _0x18bb59[_0xa1be('0x24')]();};}function saveUpdates(_0x46ff97,_0x504d98){return function(_0x2431b0){if(_0x2431b0){return _0x2431b0['update'](_0x46ff97)[_0xa1be('0x25')](function(_0x5282a2){return _0x5282a2;});}return null;};}function removeEntity(_0x4b4816,_0x2f35d1){return function(_0x29527d){if(_0x29527d){return _0x29527d[_0xa1be('0x26')]()['then'](function(){var _0x5c0dd9=_0x29527d[_0xa1be('0x27')]({'plain':!![]});var _0x17b1d2=_0xa1be('0x28');return db[_0xa1be('0x29')][_0xa1be('0x26')]({'where':{'type':_0x17b1d2,'resourceId':_0x5c0dd9['id']}})[_0xa1be('0x25')](function(){return _0x29527d;});})['then'](function(){_0x4b4816['status'](0xcc)[_0xa1be('0x1b')]();});}};}function handleEntityNotFound(_0x5427ba,_0x1e07be){return function(_0x24c2cf){if(!_0x24c2cf){_0x5427ba['sendStatus'](0x194);}return _0x24c2cf;};}function handleError(_0x509f03,_0x18edf4){_0x18edf4=_0x18edf4||0x1f4;return function(_0x1643c8){logger[_0xa1be('0x2a')](_0x1643c8[_0xa1be('0x2b')]);if(_0x1643c8['name']){delete _0x1643c8['name'];}_0x509f03['status'](_0x18edf4)[_0xa1be('0x2c')](_0x1643c8);};}exports[_0xa1be('0x2d')]=function(_0x40f102,_0x15ecfa){var _0x100afb={},_0x5a6f80={},_0x3ab681={'count':0x0,'rows':[]};var _0x391e94=_['map'](db['Template'][_0xa1be('0x2e')],function(_0x245bf7){return{'name':_0x245bf7[_0xa1be('0x2f')],'type':_0x245bf7[_0xa1be('0x30')][_0xa1be('0x31')]};});_0x5a6f80['model']=_['map'](_0x391e94,_0xa1be('0x32'));_0x5a6f80[_0xa1be('0x33')]=_[_0xa1be('0x34')](_0x40f102[_0xa1be('0x33')]);_0x5a6f80[_0xa1be('0x35')]=_[_0xa1be('0x36')](_0x5a6f80[_0xa1be('0x37')],_0x5a6f80[_0xa1be('0x33')]);_0x100afb['attributes']=_['intersection'](_0x5a6f80[_0xa1be('0x37')],qs['fields'](_0x40f102[_0xa1be('0x33')]['fields']));_0x100afb[_0xa1be('0x38')]=_0x100afb['attributes'][_0xa1be('0x39')]?_0x100afb[_0xa1be('0x38')]:_0x5a6f80[_0xa1be('0x37')];if(!_0x40f102[_0xa1be('0x33')][_0xa1be('0x3a')](_0xa1be('0x3b'))){_0x100afb['limit']=qs[_0xa1be('0x1e')](_0x40f102['query'][_0xa1be('0x1e')]);_0x100afb[_0xa1be('0x1d')]=qs['offset'](_0x40f102[_0xa1be('0x33')][_0xa1be('0x1d')]);}_0x100afb[_0xa1be('0x3c')]=qs[_0xa1be('0x3d')](_0x40f102[_0xa1be('0x33')]['sort']);_0x100afb['where']=qs['filters'](_[_0xa1be('0x3e')](_0x40f102[_0xa1be('0x33')],_0x5a6f80[_0xa1be('0x35')]),_0x391e94);if(_0x40f102[_0xa1be('0x33')][_0xa1be('0x3f')]){_0x100afb[_0xa1be('0x40')]=_[_0xa1be('0x41')](_0x100afb['where'],{'$or':_[_0xa1be('0x42')](_0x391e94,function(_0xe2a565){if(_0xe2a565['type']!==_0xa1be('0x43')){var _0x36268c={};_0x36268c[_0xe2a565[_0xa1be('0x32')]]={'$like':'%'+_0x40f102[_0xa1be('0x33')][_0xa1be('0x3f')]+'%'};return _0x36268c;}})});}_0x100afb=_['merge']({},_0x100afb,_0x40f102[_0xa1be('0x44')]);var _0x235027={'where':_0x100afb[_0xa1be('0x40')]};return db['Template'][_0xa1be('0x20')](_0x235027)['then'](function(_0x289978){_0x3ab681[_0xa1be('0x20')]=_0x289978;if(_0x40f102[_0xa1be('0x33')][_0xa1be('0x45')]){_0x100afb[_0xa1be('0x46')]=[{'all':!![]}];}return db[_0xa1be('0x47')][_0xa1be('0x48')](_0x100afb);})[_0xa1be('0x25')](function(_0x1b3c7c){_0x3ab681[_0xa1be('0x49')]=_0x1b3c7c;return _0x3ab681;})[_0xa1be('0x25')](respondWithFilteredResult(_0x15ecfa,_0x100afb))[_0xa1be('0x4a')](handleError(_0x15ecfa,null));};exports[_0xa1be('0x4b')]=function(_0x39c32f,_0x52a98d){var _0x20a7c9={'raw':!![],'where':{'id':_0x39c32f[_0xa1be('0x4c')]['id']}},_0x3a1530={};_0x3a1530[_0xa1be('0x37')]=_[_0xa1be('0x34')](db[_0xa1be('0x47')]['rawAttributes']);_0x3a1530[_0xa1be('0x33')]=_['keys'](_0x39c32f['query']);_0x3a1530[_0xa1be('0x35')]=_[_0xa1be('0x36')](_0x3a1530[_0xa1be('0x37')],_0x3a1530[_0xa1be('0x33')]);_0x20a7c9[_0xa1be('0x38')]=_['intersection'](_0x3a1530[_0xa1be('0x37')],qs['fields'](_0x39c32f[_0xa1be('0x33')][_0xa1be('0x4d')]));_0x20a7c9[_0xa1be('0x38')]=_0x20a7c9[_0xa1be('0x38')]['length']?_0x20a7c9[_0xa1be('0x38')]:_0x3a1530[_0xa1be('0x37')];if(_0x39c32f['query'][_0xa1be('0x45')]){_0x20a7c9[_0xa1be('0x46')]=[{'all':!![]}];}_0x20a7c9=_[_0xa1be('0x41')]({},_0x20a7c9,_0x39c32f[_0xa1be('0x44')]);return db[_0xa1be('0x47')]['find'](_0x20a7c9)[_0xa1be('0x25')](handleEntityNotFound(_0x52a98d,null))['then'](respondWithResult(_0x52a98d,null))[_0xa1be('0x4a')](handleError(_0x52a98d,null));};exports[_0xa1be('0x4e')]=function(_0x514a39,_0x14bb90){return db[_0xa1be('0x47')][_0xa1be('0x4e')](_0x514a39[_0xa1be('0x4f')],{})[_0xa1be('0x25')](function(_0x3ff107){var _0x49905c=_0x514a39[_0xa1be('0x50')]['get']({'plain':!![]});if(!_0x49905c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49905c['role']===_0xa1be('0x50')){var _0x3bc19f=_0x3ff107[_0xa1be('0x27')]({'plain':!![]});var _0x52ef4b=_0xa1be('0x28');return db[_0xa1be('0x51')][_0xa1be('0x52')]({'where':{'name':_0x52ef4b,'userProfileId':_0x49905c[_0xa1be('0x53')]},'raw':!![]})['then'](function(_0x413266){if(_0x413266&&_0x413266[_0xa1be('0x54')]===0x0){return db[_0xa1be('0x29')][_0xa1be('0x4e')]({'name':_0x3bc19f[_0xa1be('0x32')],'resourceId':_0x3bc19f['id'],'type':_0x413266[_0xa1be('0x32')],'sectionId':_0x413266['id']},{})[_0xa1be('0x25')](function(){return _0x3ff107;});}else{return _0x3ff107;}})[_0xa1be('0x4a')](function(_0x30eb18){logger[_0xa1be('0x2a')](_0xa1be('0x55'),_0x30eb18);throw _0x30eb18;});}return _0x3ff107;})['then'](respondWithResult(_0x14bb90,0xc9))[_0xa1be('0x4a')](handleError(_0x14bb90,null));};exports[_0xa1be('0x56')]=function(_0x31a6e5,_0x2d8bd3){if(_0x31a6e5[_0xa1be('0x4f')]['id']){delete _0x31a6e5[_0xa1be('0x4f')]['id'];}return db[_0xa1be('0x47')][_0xa1be('0x52')]({'where':{'id':_0x31a6e5[_0xa1be('0x4c')]['id']}})[_0xa1be('0x25')](handleEntityNotFound(_0x2d8bd3,null))['then'](saveUpdates(_0x31a6e5[_0xa1be('0x4f')],null))[_0xa1be('0x25')](respondWithResult(_0x2d8bd3,null))['catch'](handleError(_0x2d8bd3,null));};exports[_0xa1be('0x26')]=function(_0x57c19e,_0x41c707){return db['Template'][_0xa1be('0x52')]({'where':{'id':_0x57c19e[_0xa1be('0x4c')]['id']}})[_0xa1be('0x25')](handleEntityNotFound(_0x41c707,null))['then'](removeEntity(_0x41c707,null))['catch'](handleError(_0x41c707,null));}; \ No newline at end of file +var _0xf018=['filter','merge','VIRTUAL','includeAll','include','Template','rows','catch','show','params','keys','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick'];(function(_0x506133,_0x38eefa){var _0x5e4868=function(_0x528ecb){while(--_0x528ecb){_0x506133['push'](_0x506133['shift']());}};_0x5e4868(++_0x38eefa);}(_0xf018,0x16b));var _0x8f01=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf018[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x8f01('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f01('0x1'));var jsonpatch=require(_0x8f01('0x2'));var rp=require(_0x8f01('0x3'));var moment=require(_0x8f01('0x4'));var BPromise=require(_0x8f01('0x5'));var Mustache=require(_0x8f01('0x6'));var util=require(_0x8f01('0x7'));var path=require('path');var sox=require(_0x8f01('0x8'));var csv=require(_0x8f01('0x9'));var ejs=require(_0x8f01('0xa'));var fs=require('fs');var fs_extra=require(_0x8f01('0xb'));var _=require('lodash');var squel=require(_0x8f01('0xc'));var crypto=require('crypto');var jsforce=require(_0x8f01('0xd'));var deskjs=require(_0x8f01('0xe'));var toCsv=require(_0x8f01('0x9'));var querystring=require(_0x8f01('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f01('0x10'));var authService=require(_0x8f01('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8f01('0x12'));var hardwareService=require(_0x8f01('0x13'));var logger=require(_0x8f01('0x14'))(_0x8f01('0x15'));var utils=require(_0x8f01('0x16'));var config=require(_0x8f01('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f01('0x18'))['db'];function respondWithStatusCode(_0x57ea7e,_0x3bd7c3){_0x3bd7c3=_0x3bd7c3||0xcc;return function(_0x2fb108){if(_0x2fb108){return _0x57ea7e[_0x8f01('0x19')](_0x3bd7c3);}return _0x57ea7e[_0x8f01('0x1a')](_0x3bd7c3)[_0x8f01('0x1b')]();};}function respondWithResult(_0x5268cf,_0x463fcb){_0x463fcb=_0x463fcb||0xc8;return function(_0x2d1ba9){if(_0x2d1ba9){return _0x5268cf[_0x8f01('0x1a')](_0x463fcb)[_0x8f01('0x1c')](_0x2d1ba9);}};}function respondWithFilteredResult(_0x1582cf,_0x2b1d15){return function(_0x2a6460){if(_0x2a6460){var _0x4d27a9=typeof _0x2b1d15[_0x8f01('0x1d')]===_0x8f01('0x1e')&&typeof _0x2b1d15['limit']===_0x8f01('0x1e');var _0x14772f=_0x2a6460[_0x8f01('0x1f')];var _0x2db45e=_0x4d27a9?0x0:_0x2b1d15[_0x8f01('0x1d')];var _0x3ed7d4=_0x4d27a9?_0x2a6460[_0x8f01('0x1f')]:_0x2b1d15[_0x8f01('0x1d')]+_0x2b1d15[_0x8f01('0x20')];var _0x4f7247;if(_0x3ed7d4>=_0x14772f){_0x3ed7d4=_0x14772f;_0x4f7247=0xc8;}else{_0x4f7247=0xce;}_0x1582cf[_0x8f01('0x1a')](_0x4f7247);return _0x1582cf[_0x8f01('0x21')]('Content-Range',_0x2db45e+'-'+_0x3ed7d4+'/'+_0x14772f)[_0x8f01('0x1c')](_0x2a6460);}return null;};}function patchUpdates(_0x275508){return function(_0x39ef34){try{jsonpatch[_0x8f01('0x22')](_0x39ef34,_0x275508,!![]);}catch(_0x3a727e){return BPromise[_0x8f01('0x23')](_0x3a727e);}return _0x39ef34[_0x8f01('0x24')]();};}function saveUpdates(_0x3c20c8,_0xfe9c2a){return function(_0x40f880){if(_0x40f880){return _0x40f880[_0x8f01('0x25')](_0x3c20c8)[_0x8f01('0x26')](function(_0x4af0e0){return _0x4af0e0;});}return null;};}function removeEntity(_0x3c29fa,_0x41ea35){return function(_0x168eb6){if(_0x168eb6){return _0x168eb6[_0x8f01('0x27')]()[_0x8f01('0x26')](function(){var _0x30b596=_0x168eb6[_0x8f01('0x28')]({'plain':!![]});var _0x6d2ab7=_0x8f01('0x29');return db[_0x8f01('0x2a')][_0x8f01('0x27')]({'where':{'type':_0x6d2ab7,'resourceId':_0x30b596['id']}})['then'](function(){return _0x168eb6;});})['then'](function(){_0x3c29fa[_0x8f01('0x1a')](0xcc)[_0x8f01('0x1b')]();});}};}function handleEntityNotFound(_0x4d2ff7,_0x29f891){return function(_0x423e18){if(!_0x423e18){_0x4d2ff7['sendStatus'](0x194);}return _0x423e18;};}function handleError(_0x3f3f8c,_0x1632ba){_0x1632ba=_0x1632ba||0x1f4;return function(_0x322105){logger['error'](_0x322105[_0x8f01('0x2b')]);if(_0x322105[_0x8f01('0x2c')]){delete _0x322105[_0x8f01('0x2c')];}_0x3f3f8c[_0x8f01('0x1a')](_0x1632ba)[_0x8f01('0x2d')](_0x322105);};}exports[_0x8f01('0x2e')]=function(_0x2d057e,_0x20ad8c){var _0x2f7c2e={},_0xc4d30c={},_0x2c15ad={'count':0x0,'rows':[]};var _0x4b5d62=_[_0x8f01('0x2f')](db['Template']['rawAttributes'],function(_0x1b69b7){return{'name':_0x1b69b7[_0x8f01('0x30')],'type':_0x1b69b7[_0x8f01('0x31')][_0x8f01('0x32')]};});_0xc4d30c[_0x8f01('0x33')]=_[_0x8f01('0x2f')](_0x4b5d62,_0x8f01('0x2c'));_0xc4d30c[_0x8f01('0x34')]=_['keys'](_0x2d057e[_0x8f01('0x34')]);_0xc4d30c['filters']=_[_0x8f01('0x35')](_0xc4d30c['model'],_0xc4d30c[_0x8f01('0x34')]);_0x2f7c2e[_0x8f01('0x36')]=_['intersection'](_0xc4d30c[_0x8f01('0x33')],qs[_0x8f01('0x37')](_0x2d057e[_0x8f01('0x34')][_0x8f01('0x37')]));_0x2f7c2e[_0x8f01('0x36')]=_0x2f7c2e[_0x8f01('0x36')][_0x8f01('0x38')]?_0x2f7c2e['attributes']:_0xc4d30c[_0x8f01('0x33')];if(!_0x2d057e[_0x8f01('0x34')]['hasOwnProperty'](_0x8f01('0x39'))){_0x2f7c2e['limit']=qs[_0x8f01('0x20')](_0x2d057e['query'][_0x8f01('0x20')]);_0x2f7c2e['offset']=qs[_0x8f01('0x1d')](_0x2d057e[_0x8f01('0x34')]['offset']);}_0x2f7c2e['order']=qs[_0x8f01('0x3a')](_0x2d057e[_0x8f01('0x34')][_0x8f01('0x3a')]);_0x2f7c2e[_0x8f01('0x3b')]=qs[_0x8f01('0x3c')](_[_0x8f01('0x3d')](_0x2d057e[_0x8f01('0x34')],_0xc4d30c['filters']),_0x4b5d62);if(_0x2d057e[_0x8f01('0x34')][_0x8f01('0x3e')]){_0x2f7c2e[_0x8f01('0x3b')]=_[_0x8f01('0x3f')](_0x2f7c2e[_0x8f01('0x3b')],{'$or':_[_0x8f01('0x2f')](_0x4b5d62,function(_0x51adc2){if(_0x51adc2[_0x8f01('0x31')]!==_0x8f01('0x40')){var _0x50b730={};_0x50b730[_0x51adc2[_0x8f01('0x2c')]]={'$like':'%'+_0x2d057e[_0x8f01('0x34')][_0x8f01('0x3e')]+'%'};return _0x50b730;}})});}_0x2f7c2e=_[_0x8f01('0x3f')]({},_0x2f7c2e,_0x2d057e['options']);var _0x35b90e={'where':_0x2f7c2e[_0x8f01('0x3b')]};return db['Template']['count'](_0x35b90e)[_0x8f01('0x26')](function(_0x52a7ba){_0x2c15ad[_0x8f01('0x1f')]=_0x52a7ba;if(_0x2d057e['query'][_0x8f01('0x41')]){_0x2f7c2e[_0x8f01('0x42')]=[{'all':!![]}];}return db[_0x8f01('0x43')]['findAll'](_0x2f7c2e);})[_0x8f01('0x26')](function(_0xe467a3){_0x2c15ad[_0x8f01('0x44')]=_0xe467a3;return _0x2c15ad;})[_0x8f01('0x26')](respondWithFilteredResult(_0x20ad8c,_0x2f7c2e))[_0x8f01('0x45')](handleError(_0x20ad8c,null));};exports[_0x8f01('0x46')]=function(_0x20492a,_0x567a4b){var _0xe9a63a={'raw':!![],'where':{'id':_0x20492a[_0x8f01('0x47')]['id']}},_0x2968ec={};_0x2968ec[_0x8f01('0x33')]=_[_0x8f01('0x48')](db[_0x8f01('0x43')][_0x8f01('0x49')]);_0x2968ec[_0x8f01('0x34')]=_[_0x8f01('0x48')](_0x20492a[_0x8f01('0x34')]);_0x2968ec[_0x8f01('0x3c')]=_[_0x8f01('0x35')](_0x2968ec[_0x8f01('0x33')],_0x2968ec[_0x8f01('0x34')]);_0xe9a63a[_0x8f01('0x36')]=_[_0x8f01('0x35')](_0x2968ec[_0x8f01('0x33')],qs[_0x8f01('0x37')](_0x20492a[_0x8f01('0x34')][_0x8f01('0x37')]));_0xe9a63a[_0x8f01('0x36')]=_0xe9a63a[_0x8f01('0x36')]['length']?_0xe9a63a[_0x8f01('0x36')]:_0x2968ec[_0x8f01('0x33')];if(_0x20492a[_0x8f01('0x34')][_0x8f01('0x41')]){_0xe9a63a[_0x8f01('0x42')]=[{'all':!![]}];}_0xe9a63a=_[_0x8f01('0x3f')]({},_0xe9a63a,_0x20492a[_0x8f01('0x4a')]);return db[_0x8f01('0x43')]['find'](_0xe9a63a)[_0x8f01('0x26')](handleEntityNotFound(_0x567a4b,null))[_0x8f01('0x26')](respondWithResult(_0x567a4b,null))[_0x8f01('0x45')](handleError(_0x567a4b,null));};exports['create']=function(_0x53e860,_0x488afe){return db[_0x8f01('0x43')][_0x8f01('0x4b')](_0x53e860['body'],{})[_0x8f01('0x26')](function(_0x3986f3){var _0x155f4d=_0x53e860[_0x8f01('0x4c')][_0x8f01('0x28')]({'plain':!![]});if(!_0x155f4d)throw new Error(_0x8f01('0x4d'));if(_0x155f4d['role']===_0x8f01('0x4c')){var _0x265ba2=_0x3986f3['get']({'plain':!![]});var _0x23e0ab=_0x8f01('0x29');return db[_0x8f01('0x4e')]['find']({'where':{'name':_0x23e0ab,'userProfileId':_0x155f4d[_0x8f01('0x4f')]},'raw':!![]})['then'](function(_0x3c9cb9){if(_0x3c9cb9&&_0x3c9cb9[_0x8f01('0x50')]===0x0){return db[_0x8f01('0x2a')][_0x8f01('0x4b')]({'name':_0x265ba2[_0x8f01('0x2c')],'resourceId':_0x265ba2['id'],'type':_0x3c9cb9[_0x8f01('0x2c')],'sectionId':_0x3c9cb9['id']},{})[_0x8f01('0x26')](function(){return _0x3986f3;});}else{return _0x3986f3;}})[_0x8f01('0x45')](function(_0x47c3d7){logger[_0x8f01('0x51')](_0x8f01('0x52'),_0x47c3d7);throw _0x47c3d7;});}return _0x3986f3;})[_0x8f01('0x26')](respondWithResult(_0x488afe,0xc9))[_0x8f01('0x45')](handleError(_0x488afe,null));};exports[_0x8f01('0x25')]=function(_0x21e605,_0x1dd5d5){if(_0x21e605[_0x8f01('0x53')]['id']){delete _0x21e605[_0x8f01('0x53')]['id'];}return db['Template'][_0x8f01('0x54')]({'where':{'id':_0x21e605[_0x8f01('0x47')]['id']}})['then'](handleEntityNotFound(_0x1dd5d5,null))[_0x8f01('0x26')](saveUpdates(_0x21e605[_0x8f01('0x53')],null))['then'](respondWithResult(_0x1dd5d5,null))[_0x8f01('0x45')](handleError(_0x1dd5d5,null));};exports[_0x8f01('0x27')]=function(_0x54abbe,_0x32f61d){return db[_0x8f01('0x43')][_0x8f01('0x54')]({'where':{'id':_0x54abbe['params']['id']}})[_0x8f01('0x26')](handleEntityNotFound(_0x32f61d,null))[_0x8f01('0x26')](removeEntity(_0x32f61d,null))[_0x8f01('0x45')](handleError(_0x32f61d,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b6730d7..30fc81e 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 _0x7248=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x535d8b,_0x44f161){var _0x40fcd4=function(_0x1ff4a0){while(--_0x1ff4a0){_0x535d8b['push'](_0x535d8b['shift']());}};_0x40fcd4(++_0x44f161);}(_0x7248,0x15c));var _0x8724=function(_0x5bcdb9,_0x2bef44){_0x5bcdb9=_0x5bcdb9-0x0;var _0x4f0dda=_0x7248[_0x5bcdb9];return _0x4f0dda;};'use strict';var _=require(_0x8724('0x0'));var util=require(_0x8724('0x1'));var logger=require(_0x8724('0x2'))(_0x8724('0x3'));var moment=require(_0x8724('0x4'));var BPromise=require(_0x8724('0x5'));var rp=require(_0x8724('0x6'));var fs=require('fs');var path=require(_0x8724('0x7'));var rimraf=require('rimraf');var config=require(_0x8724('0x8'));var attributes=require(_0x8724('0x9'));module[_0x8724('0xa')]=function(_0x11851f,_0x5a3229){return _0x11851f[_0x8724('0xb')](_0x8724('0xc'),attributes,{'tableName':_0x8724('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x105c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','define','Template','tools_templates','lodash'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x105c,0x110));var _0xc105=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x105c[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0xc105('0x0'));var util=require(_0xc105('0x1'));var logger=require(_0xc105('0x2'))(_0xc105('0x3'));var moment=require(_0xc105('0x4'));var BPromise=require(_0xc105('0x5'));var rp=require(_0xc105('0x6'));var fs=require('fs');var path=require(_0xc105('0x7'));var rimraf=require('rimraf');var config=require(_0xc105('0x8'));var attributes=require(_0xc105('0x9'));module['exports']=function(_0x412cd2,_0x2d52e7){return _0x412cd2[_0xc105('0xa')](_0xc105('0xb'),attributes,{'tableName':_0xc105('0xc'),'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 2ad4146..3d8b332 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 _0x8549=['options','raw','attributes','include','map','model','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','GetTemplate','findAll'];(function(_0x6353ab,_0x34de58){var _0x19b8bd=function(_0x5e636c){while(--_0x5e636c){_0x6353ab['push'](_0x6353ab['shift']());}};_0x19b8bd(++_0x34de58);}(_0x8549,0xd3));var _0x9854=function(_0x33c342,_0x1ce8d7){_0x33c342=_0x33c342-0x0;var _0x46f946=_0x8549[_0x33c342];return _0x46f946;};'use strict';var _=require(_0x9854('0x0'));var util=require('util');var moment=require(_0x9854('0x1'));var BPromise=require(_0x9854('0x2'));var rs=require(_0x9854('0x3'));var fs=require('fs');var Redis=require(_0x9854('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9854('0x5'))(_0x9854('0x6'));var config=require(_0x9854('0x7'));var jayson=require(_0x9854('0x8'));var client=jayson['client'][_0x9854('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4737ab,_0x184a6a,_0x476204){return new BPromise(function(_0x2c4fdc,_0x5824de){return client['request'](_0x4737ab,_0x476204)[_0x9854('0xa')](function(_0x4ac59e){logger['info'](_0x9854('0xb'),_0x184a6a,'request\x20sent');logger['debug'](_0x9854('0xc'),_0x184a6a,_0x9854('0xd'),JSON['stringify'](_0x4ac59e));if(_0x4ac59e[_0x9854('0xe')]){if(_0x4ac59e[_0x9854('0xe')]['code']===0x1f4){logger[_0x9854('0xe')](_0x9854('0xb'),_0x184a6a,_0x4ac59e['error']['message']);return _0x5824de(_0x4ac59e[_0x9854('0xe')]['message']);}logger['error'](_0x9854('0xb'),_0x184a6a,_0x4ac59e[_0x9854('0xe')][_0x9854('0xf')]);return _0x2c4fdc(_0x4ac59e[_0x9854('0xe')]['message']);}else{logger[_0x9854('0x10')](_0x9854('0xb'),_0x184a6a,_0x9854('0xd'));_0x2c4fdc(_0x4ac59e[_0x9854('0x11')][_0x9854('0xf')]);}})[_0x9854('0x12')](function(_0x3cbe5b){logger[_0x9854('0xe')](_0x9854('0xb'),_0x184a6a,_0x3cbe5b);_0x5824de(_0x3cbe5b);});});}exports[_0x9854('0x13')]=function(_0x1ebdf9){var _0x269468=this;return new Promise(function(_0x4e378b,_0x3f913b){return db['Template'][_0x9854('0x14')]({'raw':_0x1ebdf9[_0x9854('0x15')]?_0x1ebdf9[_0x9854('0x15')][_0x9854('0x16')]===undefined?!![]:![]:!![],'where':_0x1ebdf9[_0x9854('0x15')]?_0x1ebdf9['options']['where']||null:null,'attributes':_0x1ebdf9['options']?_0x1ebdf9[_0x9854('0x15')][_0x9854('0x17')]||null:null,'limit':_0x1ebdf9[_0x9854('0x15')]?_0x1ebdf9[_0x9854('0x15')]['limit']||null:null,'include':_0x1ebdf9[_0x9854('0x15')]?_0x1ebdf9[_0x9854('0x15')][_0x9854('0x18')]?_[_0x9854('0x19')](_0x1ebdf9[_0x9854('0x15')][_0x9854('0x18')],function(_0xc26853){return{'model':db[_0xc26853[_0x9854('0x1a')]],'as':_0xc26853['as'],'attributes':_0xc26853[_0x9854('0x17')],'include':_0xc26853['include']?_[_0x9854('0x19')](_0xc26853[_0x9854('0x18')],function(_0x25425c){return{'model':db[_0x25425c['model']],'as':_0x25425c['as'],'attributes':_0x25425c['attributes'],'include':_0x25425c['include']?_[_0x9854('0x19')](_0x25425c[_0x9854('0x18')],function(_0x2a4f8c){return{'model':db[_0x2a4f8c['model']],'as':_0x2a4f8c['as'],'attributes':_0x2a4f8c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16c5a0){logger['info']('GetTemplate',_0x1ebdf9);logger[_0x9854('0x1b')](_0x9854('0x13'),_0x1ebdf9,JSON[_0x9854('0x1c')](_0x16c5a0));_0x4e378b(_0x16c5a0);})['catch'](function(_0x51186d){logger[_0x9854('0xe')](_0x9854('0x13'),_0x51186d[_0x9854('0xf')],_0x1ebdf9);_0x3f913b(_0x269468[_0x9854('0xe')](0x1f4,_0x51186d[_0x9854('0xf')]));});});}; \ No newline at end of file +var _0x84b8=['include','map','model','attributes','GetTemplate','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','Template','findAll','raw','options'];(function(_0x51f26e,_0x384343){var _0x47cd02=function(_0x340b7f){while(--_0x340b7f){_0x51f26e['push'](_0x51f26e['shift']());}};_0x47cd02(++_0x384343);}(_0x84b8,0x19a));var _0x884b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x84b8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x884b('0x0'));var BPromise=require(_0x884b('0x1'));var rs=require(_0x884b('0x2'));var fs=require('fs');var Redis=require(_0x884b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x884b('0x4'));var config=require('../../config/environment');var jayson=require(_0x884b('0x5'));var client=jayson['client'][_0x884b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x172eed,_0x5cdc5b,_0x203f0f){return new BPromise(function(_0x4c1de3,_0x53fd8c){return client[_0x884b('0x7')](_0x172eed,_0x203f0f)[_0x884b('0x8')](function(_0x297bd9){logger['info'](_0x884b('0x9'),_0x5cdc5b,_0x884b('0xa'));logger[_0x884b('0xb')](_0x884b('0xc'),_0x5cdc5b,'request\x20sent',JSON['stringify'](_0x297bd9));if(_0x297bd9[_0x884b('0xd')]){if(_0x297bd9[_0x884b('0xd')]['code']===0x1f4){logger[_0x884b('0xd')](_0x884b('0x9'),_0x5cdc5b,_0x297bd9[_0x884b('0xd')][_0x884b('0xe')]);return _0x53fd8c(_0x297bd9[_0x884b('0xd')][_0x884b('0xe')]);}logger['error'](_0x884b('0x9'),_0x5cdc5b,_0x297bd9[_0x884b('0xd')]['message']);return _0x4c1de3(_0x297bd9[_0x884b('0xd')][_0x884b('0xe')]);}else{logger[_0x884b('0xf')]('Template,\x20%s,\x20%s',_0x5cdc5b,_0x884b('0xa'));_0x4c1de3(_0x297bd9[_0x884b('0x10')][_0x884b('0xe')]);}})[_0x884b('0x11')](function(_0x3856ef){logger[_0x884b('0xd')]('Template,\x20%s,\x20%s',_0x5cdc5b,_0x3856ef);_0x53fd8c(_0x3856ef);});});}exports['GetTemplate']=function(_0x1cb05b){var _0x2748d5=this;return new Promise(function(_0x4fa0e9,_0x1ca753){return db[_0x884b('0x12')][_0x884b('0x13')]({'raw':_0x1cb05b['options']?_0x1cb05b['options'][_0x884b('0x14')]===undefined?!![]:![]:!![],'where':_0x1cb05b[_0x884b('0x15')]?_0x1cb05b[_0x884b('0x15')]['where']||null:null,'attributes':_0x1cb05b[_0x884b('0x15')]?_0x1cb05b[_0x884b('0x15')]['attributes']||null:null,'limit':_0x1cb05b[_0x884b('0x15')]?_0x1cb05b['options']['limit']||null:null,'include':_0x1cb05b['options']?_0x1cb05b[_0x884b('0x15')][_0x884b('0x16')]?_[_0x884b('0x17')](_0x1cb05b[_0x884b('0x15')]['include'],function(_0x3a4e7d){return{'model':db[_0x3a4e7d[_0x884b('0x18')]],'as':_0x3a4e7d['as'],'attributes':_0x3a4e7d[_0x884b('0x19')],'include':_0x3a4e7d['include']?_['map'](_0x3a4e7d[_0x884b('0x16')],function(_0x1ef73e){return{'model':db[_0x1ef73e['model']],'as':_0x1ef73e['as'],'attributes':_0x1ef73e[_0x884b('0x19')],'include':_0x1ef73e['include']?_[_0x884b('0x17')](_0x1ef73e['include'],function(_0xfcc7ea){return{'model':db[_0xfcc7ea['model']],'as':_0xfcc7ea['as'],'attributes':_0xfcc7ea[_0x884b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x884b('0x8')](function(_0x8e33b5){logger[_0x884b('0xf')](_0x884b('0x1a'),_0x1cb05b);logger[_0x884b('0xb')](_0x884b('0x1a'),_0x1cb05b,JSON['stringify'](_0x8e33b5));_0x4fa0e9(_0x8e33b5);})['catch'](function(_0x13c143){logger[_0x884b('0xd')](_0x884b('0x1a'),_0x13c143['message'],_0x1cb05b);_0x1ca753(_0x2748d5[_0x884b('0xd')](0x1f4,_0x13c143[_0x884b('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 361ca83..b0ed777 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 _0xb57d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','/:id','update','delete','exports','multer','util','path'];(function(_0x38ac44,_0x38c414){var _0x42e9ae=function(_0x5f261c){while(--_0x5f261c){_0x38ac44['push'](_0x38ac44['shift']());}};_0x42e9ae(++_0x38c414);}(_0xb57d,0x18d));var _0xdb57=function(_0x7320ec,_0x3a3a7f){_0x7320ec=_0x7320ec-0x0;var _0x3c3b1b=_0xb57d[_0x7320ec];return _0x3c3b1b;};'use strict';var multer=require(_0xdb57('0x0'));var util=require(_0xdb57('0x1'));var path=require(_0xdb57('0x2'));var timeout=require(_0xdb57('0x3'));var express=require(_0xdb57('0x4'));var router=express['Router']();var fs_extra=require(_0xdb57('0x5'));var auth=require(_0xdb57('0x6'));var interaction=require(_0xdb57('0x7'));var config=require(_0xdb57('0x8'));var controller=require('./trigger.controller');router[_0xdb57('0x9')]('/',auth[_0xdb57('0xa')](),controller['index']);router[_0xdb57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdb57('0xb')]);router[_0xdb57('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xdb57('0xc')]);router[_0xdb57('0x9')](_0xdb57('0xd'),auth[_0xdb57('0xa')](),controller[_0xdb57('0xe')]);router[_0xdb57('0x9')]('/:id/actions',auth[_0xdb57('0xa')](),controller['getActions']);router[_0xdb57('0xf')]('/',auth[_0xdb57('0xa')](),controller[_0xdb57('0x10')]);router[_0xdb57('0xf')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xdb57('0x11')]);router[_0xdb57('0xf')](_0xdb57('0xd'),auth['isAuthenticated'](),controller[_0xdb57('0x12')]);router[_0xdb57('0xf')](_0xdb57('0x13'),auth[_0xdb57('0xa')](),controller[_0xdb57('0x14')]);router['put'](_0xdb57('0x15'),auth[_0xdb57('0xa')](),controller[_0xdb57('0x16')]);router[_0xdb57('0x17')]('/:id',auth[_0xdb57('0xa')](),controller['destroy']);module[_0xdb57('0x18')]=router; \ No newline at end of file +var _0x4030=['index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','/:id/actions','addAction','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4030,0x1ee));var _0x0403=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x4030[_0x43fdf8];return _0x1160c6;};'use strict';var multer=require(_0x0403('0x0'));var util=require(_0x0403('0x1'));var path=require('path');var timeout=require(_0x0403('0x2'));var express=require(_0x0403('0x3'));var router=express[_0x0403('0x4')]();var fs_extra=require(_0x0403('0x5'));var auth=require(_0x0403('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0403('0x7'));var controller=require(_0x0403('0x8'));router['get']('/',auth[_0x0403('0x9')](),controller[_0x0403('0xa')]);router[_0x0403('0xb')]('/:id',auth[_0x0403('0x9')](),controller[_0x0403('0xc')]);router[_0x0403('0xb')](_0x0403('0xd'),auth['isAuthenticated'](),controller[_0x0403('0xe')]);router[_0x0403('0xb')](_0x0403('0xf'),auth['isAuthenticated'](),controller[_0x0403('0x10')]);router[_0x0403('0xb')]('/:id/actions',auth[_0x0403('0x9')](),controller[_0x0403('0x11')]);router[_0x0403('0x12')]('/',auth[_0x0403('0x9')](),controller[_0x0403('0x13')]);router['post'](_0x0403('0xd'),auth[_0x0403('0x9')](),controller[_0x0403('0x14')]);router[_0x0403('0x12')]('/:id/any_conditions',auth[_0x0403('0x9')](),controller['addAnyCondition']);router['post'](_0x0403('0x15'),auth[_0x0403('0x9')](),controller[_0x0403('0x16')]);router[_0x0403('0x17')](_0x0403('0x18'),auth[_0x0403('0x9')](),controller[_0x0403('0x19')]);router[_0x0403('0x1a')](_0x0403('0x18'),auth['isAuthenticated'](),controller[_0x0403('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 24fe527..15102b1 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 _0xe8a1=['exports','STRING','sequelize'];(function(_0x31aa2f,_0x130943){var _0x4864a6=function(_0x296714){while(--_0x296714){_0x31aa2f['push'](_0x31aa2f['shift']());}};_0x4864a6(++_0x130943);}(_0xe8a1,0xad));var _0x1e8a=function(_0x3b5f08,_0x9e52a3){_0x3b5f08=_0x3b5f08-0x0;var _0x1961d2=_0xe8a1[_0x3b5f08];return _0x1961d2;};'use strict';var Sequelize=require(_0x1e8a('0x0'));module[_0x1e8a('0x1')]={'name':{'type':Sequelize[_0x1e8a('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e8a('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x539f=['exports','STRING','BOOLEAN'];(function(_0x3eda90,_0x2bc4c9){var _0x1064cd=function(_0x141f69){while(--_0x141f69){_0x3eda90['push'](_0x3eda90['shift']());}};_0x1064cd(++_0x2bc4c9);}(_0x539f,0xde));var _0xf539=function(_0x4bd054,_0x14e636){_0x4bd054=_0x4bd054-0x0;var _0x2c433e=_0x539f[_0x4bd054];return _0x2c433e;};'use strict';var Sequelize=require('sequelize');module[_0xf539('0x0')]={'name':{'type':Sequelize[_0xf539('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf539('0x1')]},'status':{'type':Sequelize[_0xf539('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 99408fd..cb2b392 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 _0x9bb2=['addAnyCondition','TriggerAnyId','filter','options','getAllConditions','nolimit','getAnyConditions','findOne','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','end','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition'];(function(_0x3c0615,_0x462546){var _0x10e867=function(_0x4a9668){while(--_0x4a9668){_0x3c0615['push'](_0x3c0615['shift']());}};_0x10e867(++_0x462546);}(_0x9bb2,0x128));var _0x29bb=function(_0x280b6c,_0x39daa7){_0x280b6c=_0x280b6c-0x0;var _0x4e8ed5=_0x9bb2[_0x280b6c];return _0x4e8ed5;};'use strict';var emlformat=require(_0x29bb('0x0'));var rimraf=require(_0x29bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29bb('0x2'));var rp=require(_0x29bb('0x3'));var moment=require(_0x29bb('0x4'));var BPromise=require(_0x29bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x29bb('0x6'));var ejs=require(_0x29bb('0x7'));var fs=require('fs');var fs_extra=require(_0x29bb('0x8'));var _=require(_0x29bb('0x9'));var squel=require(_0x29bb('0xa'));var crypto=require(_0x29bb('0xb'));var jsforce=require(_0x29bb('0xc'));var deskjs=require(_0x29bb('0xd'));var toCsv=require(_0x29bb('0x6'));var querystring=require(_0x29bb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x29bb('0xf'));var qs=require(_0x29bb('0x10'));var as=require(_0x29bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29bb('0x12'))(_0x29bb('0x13'));var utils=require(_0x29bb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x29bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x84281c,_0x4e3a05){_0x4e3a05=_0x4e3a05||0xcc;return function(_0x546ad3){if(_0x546ad3){return _0x84281c[_0x29bb('0x16')](_0x4e3a05);}return _0x84281c[_0x29bb('0x17')](_0x4e3a05)['end']();};}function respondWithResult(_0x52bc62,_0x15a3f3){_0x15a3f3=_0x15a3f3||0xc8;return function(_0x371c67){if(_0x371c67){return _0x52bc62[_0x29bb('0x17')](_0x15a3f3)[_0x29bb('0x18')](_0x371c67);}};}function respondWithFilteredResult(_0x778721,_0x27c3b9){return function(_0x1b21e9){if(_0x1b21e9){var _0x269c16=typeof _0x27c3b9['offset']==='undefined'&&typeof _0x27c3b9[_0x29bb('0x19')]===_0x29bb('0x1a');var _0x51173b=_0x1b21e9[_0x29bb('0x1b')];var _0x395d46=_0x269c16?0x0:_0x27c3b9[_0x29bb('0x1c')];var _0x5b5be9=_0x269c16?_0x1b21e9[_0x29bb('0x1b')]:_0x27c3b9['offset']+_0x27c3b9[_0x29bb('0x19')];var _0x27e236;if(_0x5b5be9>=_0x51173b){_0x5b5be9=_0x51173b;_0x27e236=0xc8;}else{_0x27e236=0xce;}_0x778721[_0x29bb('0x17')](_0x27e236);return _0x778721[_0x29bb('0x1d')](_0x29bb('0x1e'),_0x395d46+'-'+_0x5b5be9+'/'+_0x51173b)[_0x29bb('0x18')](_0x1b21e9);}return null;};}function patchUpdates(_0x16e802){return function(_0x590ec0){try{jsonpatch[_0x29bb('0x1f')](_0x590ec0,_0x16e802,!![]);}catch(_0x47c725){return BPromise[_0x29bb('0x20')](_0x47c725);}return _0x590ec0[_0x29bb('0x21')]();};}function saveUpdates(_0xae103,_0x53adff){return function(_0x9009df){if(_0x9009df){return _0x9009df[_0x29bb('0x22')](_0xae103)[_0x29bb('0x23')](function(_0x10f6e1){return _0x10f6e1;});}return null;};}function removeEntity(_0x364d85,_0x5f3bd5){return function(_0x267064){if(_0x267064){return _0x267064[_0x29bb('0x24')]()[_0x29bb('0x23')](function(){var _0x20a554=_0x267064['get']({'plain':!![]});var _0x55fe62=_0x29bb('0x25');return db['UserProfileResource'][_0x29bb('0x24')]({'where':{'type':_0x55fe62,'resourceId':_0x20a554['id']}})[_0x29bb('0x23')](function(){return _0x267064;});})[_0x29bb('0x23')](function(){_0x364d85[_0x29bb('0x17')](0xcc)[_0x29bb('0x26')]();});}};}function handleEntityNotFound(_0x3430cc,_0x5781b3){return function(_0x5233cb){if(!_0x5233cb){_0x3430cc[_0x29bb('0x16')](0x194);}return _0x5233cb;};}function handleError(_0x2584bc,_0xd71bf8){_0xd71bf8=_0xd71bf8||0x1f4;return function(_0x4c3533){logger['error'](_0x4c3533[_0x29bb('0x27')]);if(_0x4c3533[_0x29bb('0x28')]){delete _0x4c3533[_0x29bb('0x28')];}_0x2584bc[_0x29bb('0x17')](_0xd71bf8)[_0x29bb('0x29')](_0x4c3533);};}exports[_0x29bb('0x2a')]=function(_0x3cc685,_0x3760cc){var _0x20f6c8={},_0x194bfc={},_0x321c1d={'count':0x0,'rows':[]};var _0x257744=_['map'](db[_0x29bb('0x2b')][_0x29bb('0x2c')],function(_0x2273b0){return{'name':_0x2273b0[_0x29bb('0x2d')],'type':_0x2273b0[_0x29bb('0x2e')][_0x29bb('0x2f')]};});_0x194bfc['model']=_[_0x29bb('0x30')](_0x257744,_0x29bb('0x28'));_0x194bfc[_0x29bb('0x31')]=_[_0x29bb('0x32')](_0x3cc685[_0x29bb('0x31')]);_0x194bfc['filters']=_['intersection'](_0x194bfc[_0x29bb('0x33')],_0x194bfc[_0x29bb('0x31')]);_0x20f6c8[_0x29bb('0x34')]=_['intersection'](_0x194bfc['model'],qs[_0x29bb('0x35')](_0x3cc685[_0x29bb('0x31')][_0x29bb('0x35')]));_0x20f6c8[_0x29bb('0x34')]=_0x20f6c8[_0x29bb('0x34')][_0x29bb('0x36')]?_0x20f6c8[_0x29bb('0x34')]:_0x194bfc[_0x29bb('0x33')];if(!_0x3cc685[_0x29bb('0x31')][_0x29bb('0x37')]('nolimit')){_0x20f6c8[_0x29bb('0x19')]=qs[_0x29bb('0x19')](_0x3cc685[_0x29bb('0x31')]['limit']);_0x20f6c8[_0x29bb('0x1c')]=qs[_0x29bb('0x1c')](_0x3cc685[_0x29bb('0x31')][_0x29bb('0x1c')]);}_0x20f6c8[_0x29bb('0x38')]=qs[_0x29bb('0x39')](_0x3cc685[_0x29bb('0x31')]['sort']);_0x20f6c8['where']=qs[_0x29bb('0x3a')](_[_0x29bb('0x3b')](_0x3cc685['query'],_0x194bfc[_0x29bb('0x3a')]),_0x257744);if(_0x3cc685[_0x29bb('0x31')]['filter']){_0x20f6c8['where']=_['merge'](_0x20f6c8[_0x29bb('0x3c')],{'$or':_['map'](_0x257744,function(_0x25c6d5){if(_0x25c6d5[_0x29bb('0x2e')]!==_0x29bb('0x3d')){var _0x3d41c6={};_0x3d41c6[_0x25c6d5[_0x29bb('0x28')]]={'$like':'%'+_0x3cc685[_0x29bb('0x31')]['filter']+'%'};return _0x3d41c6;}})});}_0x20f6c8=_[_0x29bb('0x3e')]({},_0x20f6c8,_0x3cc685['options']);var _0x300325={'where':_0x20f6c8[_0x29bb('0x3c')]};return db[_0x29bb('0x2b')]['count'](_0x300325)[_0x29bb('0x23')](function(_0x59a219){_0x321c1d[_0x29bb('0x1b')]=_0x59a219;if(_0x3cc685['query'][_0x29bb('0x3f')]){_0x20f6c8[_0x29bb('0x40')]=[{'all':!![]}];}return db[_0x29bb('0x2b')][_0x29bb('0x41')](_0x20f6c8);})[_0x29bb('0x23')](function(_0x4f17ef){_0x321c1d[_0x29bb('0x42')]=_0x4f17ef;return _0x321c1d;})['then'](respondWithFilteredResult(_0x3760cc,_0x20f6c8))['catch'](handleError(_0x3760cc,null));};exports[_0x29bb('0x43')]=function(_0x3ebcc5,_0x4d7857){var _0x42ef71={'raw':![],'where':{'id':_0x3ebcc5[_0x29bb('0x44')]['id']}},_0x344c32={};_0x344c32[_0x29bb('0x33')]=_[_0x29bb('0x32')](db[_0x29bb('0x2b')][_0x29bb('0x2c')]);_0x344c32['query']=_[_0x29bb('0x32')](_0x3ebcc5['query']);_0x344c32[_0x29bb('0x3a')]=_['intersection'](_0x344c32['model'],_0x344c32[_0x29bb('0x31')]);_0x42ef71[_0x29bb('0x34')]=_[_0x29bb('0x45')](_0x344c32[_0x29bb('0x33')],qs[_0x29bb('0x35')](_0x3ebcc5[_0x29bb('0x31')][_0x29bb('0x35')]));_0x42ef71[_0x29bb('0x34')]=_0x42ef71['attributes'][_0x29bb('0x36')]?_0x42ef71['attributes']:_0x344c32[_0x29bb('0x33')];if(_0x3ebcc5[_0x29bb('0x31')][_0x29bb('0x3f')]){_0x42ef71[_0x29bb('0x40')]=[{'all':!![]}];}_0x42ef71=_[_0x29bb('0x3e')]({},_0x42ef71,_0x3ebcc5['options']);return db[_0x29bb('0x2b')][_0x29bb('0x46')](_0x42ef71)['then'](handleEntityNotFound(_0x4d7857,null))[_0x29bb('0x23')](respondWithResult(_0x4d7857,null))[_0x29bb('0x47')](handleError(_0x4d7857,null));};exports[_0x29bb('0x48')]=function(_0xed9e3f,_0x5623a4){return db[_0x29bb('0x2b')]['create'](_0xed9e3f['body'],{})['then'](function(_0x938b3b){var _0x5e3bac=_0xed9e3f[_0x29bb('0x49')]['get']({'plain':!![]});if(!_0x5e3bac)throw new Error(_0x29bb('0x4a'));if(_0x5e3bac[_0x29bb('0x4b')]===_0x29bb('0x49')){var _0x49c61a=_0x938b3b[_0x29bb('0x4c')]({'plain':!![]});var _0x1a01a3=_0x29bb('0x25');return db[_0x29bb('0x4d')][_0x29bb('0x46')]({'where':{'name':_0x1a01a3,'userProfileId':_0x5e3bac['userProfileId']},'raw':!![]})[_0x29bb('0x23')](function(_0x5e8336){if(_0x5e8336&&_0x5e8336['autoAssociation']===0x0){return db[_0x29bb('0x4e')][_0x29bb('0x48')]({'name':_0x49c61a[_0x29bb('0x28')],'resourceId':_0x49c61a['id'],'type':_0x5e8336[_0x29bb('0x28')],'sectionId':_0x5e8336['id']},{})[_0x29bb('0x23')](function(){return _0x938b3b;});}else{return _0x938b3b;}})[_0x29bb('0x47')](function(_0x32f877){logger[_0x29bb('0x4f')](_0x29bb('0x50'),_0x32f877);throw _0x32f877;});}return _0x938b3b;})[_0x29bb('0x23')](respondWithResult(_0x5623a4,0xc9))[_0x29bb('0x47')](handleError(_0x5623a4,null));};exports[_0x29bb('0x22')]=function(_0x2b65e0,_0x5f2330){if(_0x2b65e0['body']['id']){delete _0x2b65e0['body']['id'];}return db[_0x29bb('0x2b')][_0x29bb('0x46')]({'where':{'id':_0x2b65e0['params']['id']}})[_0x29bb('0x23')](handleEntityNotFound(_0x5f2330,null))['then'](saveUpdates(_0x2b65e0[_0x29bb('0x51')],null))['then'](respondWithResult(_0x5f2330,null))[_0x29bb('0x47')](handleError(_0x5f2330,null));};exports[_0x29bb('0x24')]=function(_0x4326f5,_0x27758a){return db[_0x29bb('0x2b')][_0x29bb('0x46')]({'where':{'id':_0x4326f5['params']['id']}})['then'](handleEntityNotFound(_0x27758a,null))[_0x29bb('0x23')](removeEntity(_0x27758a,null))[_0x29bb('0x47')](handleError(_0x27758a,null));};exports[_0x29bb('0x52')]=function(_0x1013d1,_0x29f46f,_0x1c5fec){if(_0x1013d1['body']['id']){delete _0x1013d1[_0x29bb('0x51')]['id'];}return db[_0x29bb('0x2b')][_0x29bb('0x46')]({'where':{'id':_0x1013d1[_0x29bb('0x44')]['id']}})[_0x29bb('0x23')](handleEntityNotFound(_0x29f46f,null))['then'](function(_0x5f516a){if(_0x5f516a){_0x1013d1[_0x29bb('0x51')]['TriggerAllId']=_0x5f516a['id'];return db[_0x29bb('0x53')][_0x29bb('0x48')](_0x1013d1[_0x29bb('0x51')]);}})[_0x29bb('0x23')](respondWithResult(_0x29f46f,null))[_0x29bb('0x47')](handleError(_0x29f46f,null));};exports[_0x29bb('0x54')]=function(_0x5ace32,_0xdf118f,_0xc7c3dd){if(_0x5ace32[_0x29bb('0x51')]['id']){delete _0x5ace32[_0x29bb('0x51')]['id'];}return db['Trigger'][_0x29bb('0x46')]({'where':{'id':_0x5ace32['params']['id']}})['then'](handleEntityNotFound(_0xdf118f,null))[_0x29bb('0x23')](function(_0x581892){if(_0x581892){_0x5ace32['body'][_0x29bb('0x55')]=_0x581892['id'];return db[_0x29bb('0x53')]['create'](_0x5ace32[_0x29bb('0x51')]);}})['then'](respondWithResult(_0xdf118f,null))[_0x29bb('0x47')](handleError(_0xdf118f,null));};exports['getAllConditions']=function(_0x445a40,_0x412ac9,_0x51ed7b){var _0x5a5211={};var _0x4e2a7f={};var _0x3bd8cf;var _0x56f9d6;return db[_0x29bb('0x2b')]['findOne']({'where':{'id':_0x445a40['params']['id']}})[_0x29bb('0x23')](handleEntityNotFound(_0x412ac9,null))[_0x29bb('0x23')](function(_0x3f17f5){if(_0x3f17f5){_0x3bd8cf=_0x3f17f5;_0x4e2a7f[_0x29bb('0x33')]=_['keys'](db[_0x29bb('0x53')][_0x29bb('0x2c')]);_0x4e2a7f[_0x29bb('0x31')]=_['keys'](_0x445a40[_0x29bb('0x31')]);_0x4e2a7f['filters']=_[_0x29bb('0x45')](_0x4e2a7f['model'],_0x4e2a7f[_0x29bb('0x31')]);_0x5a5211['attributes']=_['intersection'](_0x4e2a7f[_0x29bb('0x33')],qs[_0x29bb('0x35')](_0x445a40['query']['fields']));_0x5a5211['attributes']=_0x5a5211[_0x29bb('0x34')]['length']?_0x5a5211[_0x29bb('0x34')]:_0x4e2a7f['model'];_0x5a5211[_0x29bb('0x38')]=qs['sort'](_0x445a40[_0x29bb('0x31')][_0x29bb('0x39')]);_0x5a5211['where']=qs[_0x29bb('0x3a')](_['pick'](_0x445a40[_0x29bb('0x31')],_0x4e2a7f[_0x29bb('0x3a')]));if(_0x445a40[_0x29bb('0x31')][_0x29bb('0x56')]){_0x5a5211[_0x29bb('0x3c')]=_[_0x29bb('0x3e')](_0x5a5211['where'],{'$or':_['map'](_0x5a5211[_0x29bb('0x34')],function(_0x4ff040){var _0x58ecd3={};_0x58ecd3[_0x4ff040]={'$like':'%'+_0x445a40[_0x29bb('0x31')][_0x29bb('0x56')]+'%'};return _0x58ecd3;})});}_0x5a5211=_[_0x29bb('0x3e')]({},_0x5a5211,_0x445a40[_0x29bb('0x57')]);return _0x3bd8cf[_0x29bb('0x58')](_0x5a5211);}})[_0x29bb('0x23')](function(_0x4d11d6){if(_0x4d11d6){_0x56f9d6=_0x4d11d6[_0x29bb('0x36')];if(!_0x445a40['query'][_0x29bb('0x37')](_0x29bb('0x59'))){_0x5a5211['limit']=qs[_0x29bb('0x19')](_0x445a40[_0x29bb('0x31')][_0x29bb('0x19')]);_0x5a5211['offset']=qs[_0x29bb('0x1c')](_0x445a40[_0x29bb('0x31')][_0x29bb('0x1c')]);}return _0x3bd8cf[_0x29bb('0x58')](_0x5a5211);}})[_0x29bb('0x23')](function(_0x38dff5){if(_0x38dff5){return _0x38dff5?{'count':_0x56f9d6,'rows':_0x38dff5}:null;}})[_0x29bb('0x23')](respondWithResult(_0x412ac9,null))[_0x29bb('0x47')](handleError(_0x412ac9,null));};exports[_0x29bb('0x5a')]=function(_0x23271b,_0x5eb056,_0x122900){var _0x54a532={};var _0x50c31c={};var _0xc57f9c;var _0x4459ff;return db[_0x29bb('0x2b')][_0x29bb('0x5b')]({'where':{'id':_0x23271b[_0x29bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x5eb056,null))[_0x29bb('0x23')](function(_0x22fc62){if(_0x22fc62){_0xc57f9c=_0x22fc62;_0x50c31c[_0x29bb('0x33')]=_['keys'](db[_0x29bb('0x53')][_0x29bb('0x2c')]);_0x50c31c[_0x29bb('0x31')]=_['keys'](_0x23271b['query']);_0x50c31c[_0x29bb('0x3a')]=_[_0x29bb('0x45')](_0x50c31c[_0x29bb('0x33')],_0x50c31c[_0x29bb('0x31')]);_0x54a532[_0x29bb('0x34')]=_[_0x29bb('0x45')](_0x50c31c[_0x29bb('0x33')],qs[_0x29bb('0x35')](_0x23271b[_0x29bb('0x31')][_0x29bb('0x35')]));_0x54a532['attributes']=_0x54a532[_0x29bb('0x34')][_0x29bb('0x36')]?_0x54a532[_0x29bb('0x34')]:_0x50c31c[_0x29bb('0x33')];_0x54a532[_0x29bb('0x38')]=qs[_0x29bb('0x39')](_0x23271b[_0x29bb('0x31')][_0x29bb('0x39')]);_0x54a532[_0x29bb('0x3c')]=qs[_0x29bb('0x3a')](_[_0x29bb('0x3b')](_0x23271b[_0x29bb('0x31')],_0x50c31c[_0x29bb('0x3a')]));if(_0x23271b[_0x29bb('0x31')][_0x29bb('0x56')]){_0x54a532[_0x29bb('0x3c')]=_[_0x29bb('0x3e')](_0x54a532[_0x29bb('0x3c')],{'$or':_[_0x29bb('0x30')](_0x54a532[_0x29bb('0x34')],function(_0xd87735){var _0x3691ad={};_0x3691ad[_0xd87735]={'$like':'%'+_0x23271b[_0x29bb('0x31')][_0x29bb('0x56')]+'%'};return _0x3691ad;})});}_0x54a532=_[_0x29bb('0x3e')]({},_0x54a532,_0x23271b[_0x29bb('0x57')]);return _0xc57f9c[_0x29bb('0x5a')](_0x54a532);}})[_0x29bb('0x23')](function(_0x5e5a5e){if(_0x5e5a5e){_0x4459ff=_0x5e5a5e[_0x29bb('0x36')];if(!_0x23271b['query']['hasOwnProperty'](_0x29bb('0x59'))){_0x54a532[_0x29bb('0x19')]=qs[_0x29bb('0x19')](_0x23271b['query'][_0x29bb('0x19')]);_0x54a532['offset']=qs[_0x29bb('0x1c')](_0x23271b[_0x29bb('0x31')][_0x29bb('0x1c')]);}return _0xc57f9c[_0x29bb('0x5a')](_0x54a532);}})['then'](function(_0x432cde){if(_0x432cde){return _0x432cde?{'count':_0x4459ff,'rows':_0x432cde}:null;}})['then'](respondWithResult(_0x5eb056,null))[_0x29bb('0x47')](handleError(_0x5eb056,null));};exports['addAction']=function(_0xc9d34e,_0x1ceb51,_0x39cedd){if(_0xc9d34e['body']['id']){delete _0xc9d34e[_0x29bb('0x51')]['id'];}return db['Trigger'][_0x29bb('0x46')]({'where':{'id':_0xc9d34e['params']['id']}})[_0x29bb('0x23')](handleEntityNotFound(_0x1ceb51,null))['then'](function(_0x3f0727){if(_0x3f0727){_0xc9d34e[_0x29bb('0x51')][_0x29bb('0x5c')]=_0x3f0727['id'];return db[_0x29bb('0x5d')][_0x29bb('0x48')](_0xc9d34e[_0x29bb('0x51')]);}})['then'](respondWithResult(_0x1ceb51,null))[_0x29bb('0x47')](handleError(_0x1ceb51,null));};exports['getActions']=function(_0x37f844,_0x2edb91,_0x2a9375){var _0x1d313d={};var _0x1effe5={};var _0x3aec97;var _0x4fc69a;return db[_0x29bb('0x2b')][_0x29bb('0x5b')]({'where':{'id':_0x37f844['params']['id']}})[_0x29bb('0x23')](handleEntityNotFound(_0x2edb91,null))[_0x29bb('0x23')](function(_0x537028){if(_0x537028){_0x3aec97=_0x537028;_0x1effe5['model']=_[_0x29bb('0x32')](db[_0x29bb('0x5d')][_0x29bb('0x2c')]);_0x1effe5[_0x29bb('0x31')]=_['keys'](_0x37f844['query']);_0x1effe5[_0x29bb('0x3a')]=_[_0x29bb('0x45')](_0x1effe5[_0x29bb('0x33')],_0x1effe5[_0x29bb('0x31')]);_0x1d313d[_0x29bb('0x34')]=_['intersection'](_0x1effe5['model'],qs[_0x29bb('0x35')](_0x37f844[_0x29bb('0x31')][_0x29bb('0x35')]));_0x1d313d['attributes']=_0x1d313d[_0x29bb('0x34')][_0x29bb('0x36')]?_0x1d313d[_0x29bb('0x34')]:_0x1effe5['model'];_0x1d313d['order']=qs[_0x29bb('0x39')](_0x37f844[_0x29bb('0x31')]['sort']);_0x1d313d[_0x29bb('0x3c')]=qs[_0x29bb('0x3a')](_[_0x29bb('0x3b')](_0x37f844[_0x29bb('0x31')],_0x1effe5['filters']));if(_0x37f844[_0x29bb('0x31')][_0x29bb('0x56')]){_0x1d313d[_0x29bb('0x3c')]=_[_0x29bb('0x3e')](_0x1d313d[_0x29bb('0x3c')],{'$or':_[_0x29bb('0x30')](_0x1d313d['attributes'],function(_0xc81415){var _0x3cd1bb={};_0x3cd1bb[_0xc81415]={'$like':'%'+_0x37f844[_0x29bb('0x31')][_0x29bb('0x56')]+'%'};return _0x3cd1bb;})});}_0x1d313d=_[_0x29bb('0x3e')]({},_0x1d313d,_0x37f844[_0x29bb('0x57')]);return _0x3aec97[_0x29bb('0x5e')](_0x1d313d);}})[_0x29bb('0x23')](function(_0x44dd6d){if(_0x44dd6d){_0x4fc69a=_0x44dd6d[_0x29bb('0x36')];if(!_0x37f844['query']['hasOwnProperty'](_0x29bb('0x59'))){_0x1d313d[_0x29bb('0x19')]=qs[_0x29bb('0x19')](_0x37f844[_0x29bb('0x31')][_0x29bb('0x19')]);_0x1d313d[_0x29bb('0x1c')]=qs[_0x29bb('0x1c')](_0x37f844[_0x29bb('0x31')][_0x29bb('0x1c')]);}return _0x3aec97[_0x29bb('0x5e')](_0x1d313d);}})['then'](function(_0x3d61ee){if(_0x3d61ee){return _0x3d61ee?{'count':_0x4fc69a,'rows':_0x3d61ee}:null;}})[_0x29bb('0x23')](respondWithResult(_0x2edb91,null))[_0x29bb('0x47')](handleError(_0x2edb91,null));}; \ No newline at end of file +var _0x7e4b=['fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','options','addAction','TriggerId','Action','getActions','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','name','send','map','Trigger','type','model','keys','filters','intersection','attributes'];(function(_0x1d6140,_0x440976){var _0x5f818b=function(_0x33206b){while(--_0x33206b){_0x1d6140['push'](_0x1d6140['shift']());}};_0x5f818b(++_0x440976);}(_0x7e4b,0x1e9));var _0xb7e4=function(_0x12061a,_0x239a0d){_0x12061a=_0x12061a-0x0;var _0x3f9808=_0x7e4b[_0x12061a];return _0x3f9808;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb7e4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7e4('0x1'));var moment=require(_0xb7e4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb7e4('0x3'));var util=require(_0xb7e4('0x4'));var path=require(_0xb7e4('0x5'));var sox=require(_0xb7e4('0x6'));var csv=require(_0xb7e4('0x7'));var ejs=require(_0xb7e4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7e4('0x9'));var squel=require('squel');var crypto=require(_0xb7e4('0xa'));var jsforce=require(_0xb7e4('0xb'));var deskjs=require(_0xb7e4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7e4('0xd'));var authService=require(_0xb7e4('0xe'));var qs=require(_0xb7e4('0xf'));var as=require(_0xb7e4('0x10'));var hardwareService=require(_0xb7e4('0x11'));var logger=require(_0xb7e4('0x12'))(_0xb7e4('0x13'));var utils=require(_0xb7e4('0x14'));var config=require(_0xb7e4('0x15'));var licenseUtil=require(_0xb7e4('0x16'));var db=require(_0xb7e4('0x17'))['db'];function respondWithStatusCode(_0x73ba14,_0x1168c4){_0x1168c4=_0x1168c4||0xcc;return function(_0x88c124){if(_0x88c124){return _0x73ba14[_0xb7e4('0x18')](_0x1168c4);}return _0x73ba14['status'](_0x1168c4)[_0xb7e4('0x19')]();};}function respondWithResult(_0x5ac0b8,_0x122731){_0x122731=_0x122731||0xc8;return function(_0x38b841){if(_0x38b841){return _0x5ac0b8[_0xb7e4('0x1a')](_0x122731)['json'](_0x38b841);}};}function respondWithFilteredResult(_0x353f93,_0x5c0648){return function(_0x53969b){if(_0x53969b){var _0x153c68=typeof _0x5c0648[_0xb7e4('0x1b')]===_0xb7e4('0x1c')&&typeof _0x5c0648[_0xb7e4('0x1d')]===_0xb7e4('0x1c');var _0xa58fa6=_0x53969b['count'];var _0x21dace=_0x153c68?0x0:_0x5c0648[_0xb7e4('0x1b')];var _0x2cb5d0=_0x153c68?_0x53969b['count']:_0x5c0648[_0xb7e4('0x1b')]+_0x5c0648[_0xb7e4('0x1d')];var _0x250eee;if(_0x2cb5d0>=_0xa58fa6){_0x2cb5d0=_0xa58fa6;_0x250eee=0xc8;}else{_0x250eee=0xce;}_0x353f93[_0xb7e4('0x1a')](_0x250eee);return _0x353f93[_0xb7e4('0x1e')]('Content-Range',_0x21dace+'-'+_0x2cb5d0+'/'+_0xa58fa6)['json'](_0x53969b);}return null;};}function patchUpdates(_0xc983d2){return function(_0x4bb5bc){try{jsonpatch[_0xb7e4('0x1f')](_0x4bb5bc,_0xc983d2,!![]);}catch(_0x1fd9f8){return BPromise[_0xb7e4('0x20')](_0x1fd9f8);}return _0x4bb5bc[_0xb7e4('0x21')]();};}function saveUpdates(_0x149438,_0xcc07a7){return function(_0xf77330){if(_0xf77330){return _0xf77330[_0xb7e4('0x22')](_0x149438)[_0xb7e4('0x23')](function(_0x1c8370){return _0x1c8370;});}return null;};}function removeEntity(_0x4650ae,_0x3c5d1a){return function(_0x5a522a){if(_0x5a522a){return _0x5a522a['destroy']()[_0xb7e4('0x23')](function(){var _0x456a58=_0x5a522a[_0xb7e4('0x24')]({'plain':!![]});var _0x3f4245=_0xb7e4('0x25');return db[_0xb7e4('0x26')][_0xb7e4('0x27')]({'where':{'type':_0x3f4245,'resourceId':_0x456a58['id']}})[_0xb7e4('0x23')](function(){return _0x5a522a;});})[_0xb7e4('0x23')](function(){_0x4650ae[_0xb7e4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5371bc,_0x579d28){return function(_0x5eda50){if(!_0x5eda50){_0x5371bc[_0xb7e4('0x18')](0x194);}return _0x5eda50;};}function handleError(_0x56b08d,_0x4d56ae){_0x4d56ae=_0x4d56ae||0x1f4;return function(_0x254feb){logger[_0xb7e4('0x28')](_0x254feb['stack']);if(_0x254feb['name']){delete _0x254feb[_0xb7e4('0x29')];}_0x56b08d[_0xb7e4('0x1a')](_0x4d56ae)[_0xb7e4('0x2a')](_0x254feb);};}exports['index']=function(_0x5a0693,_0x5efb37){var _0x49eba6={},_0x7f9807={},_0x5053e6={'count':0x0,'rows':[]};var _0x45c84e=_[_0xb7e4('0x2b')](db[_0xb7e4('0x2c')]['rawAttributes'],function(_0xe0e37){return{'name':_0xe0e37['fieldName'],'type':_0xe0e37[_0xb7e4('0x2d')]['key']};});_0x7f9807[_0xb7e4('0x2e')]=_[_0xb7e4('0x2b')](_0x45c84e,_0xb7e4('0x29'));_0x7f9807['query']=_[_0xb7e4('0x2f')](_0x5a0693['query']);_0x7f9807[_0xb7e4('0x30')]=_[_0xb7e4('0x31')](_0x7f9807['model'],_0x7f9807['query']);_0x49eba6[_0xb7e4('0x32')]=_['intersection'](_0x7f9807[_0xb7e4('0x2e')],qs[_0xb7e4('0x33')](_0x5a0693[_0xb7e4('0x34')][_0xb7e4('0x33')]));_0x49eba6[_0xb7e4('0x32')]=_0x49eba6['attributes'][_0xb7e4('0x35')]?_0x49eba6[_0xb7e4('0x32')]:_0x7f9807[_0xb7e4('0x2e')];if(!_0x5a0693[_0xb7e4('0x34')][_0xb7e4('0x36')](_0xb7e4('0x37'))){_0x49eba6[_0xb7e4('0x1d')]=qs[_0xb7e4('0x1d')](_0x5a0693['query']['limit']);_0x49eba6[_0xb7e4('0x1b')]=qs[_0xb7e4('0x1b')](_0x5a0693[_0xb7e4('0x34')]['offset']);}_0x49eba6[_0xb7e4('0x38')]=qs[_0xb7e4('0x39')](_0x5a0693[_0xb7e4('0x34')][_0xb7e4('0x39')]);_0x49eba6[_0xb7e4('0x3a')]=qs[_0xb7e4('0x30')](_[_0xb7e4('0x3b')](_0x5a0693[_0xb7e4('0x34')],_0x7f9807[_0xb7e4('0x30')]),_0x45c84e);if(_0x5a0693[_0xb7e4('0x34')][_0xb7e4('0x3c')]){_0x49eba6[_0xb7e4('0x3a')]=_['merge'](_0x49eba6[_0xb7e4('0x3a')],{'$or':_['map'](_0x45c84e,function(_0x7eeec6){if(_0x7eeec6[_0xb7e4('0x2d')]!==_0xb7e4('0x3d')){var _0x580f65={};_0x580f65[_0x7eeec6[_0xb7e4('0x29')]]={'$like':'%'+_0x5a0693[_0xb7e4('0x34')][_0xb7e4('0x3c')]+'%'};return _0x580f65;}})});}_0x49eba6=_[_0xb7e4('0x3e')]({},_0x49eba6,_0x5a0693['options']);var _0x3c6dac={'where':_0x49eba6[_0xb7e4('0x3a')]};return db['Trigger'][_0xb7e4('0x3f')](_0x3c6dac)[_0xb7e4('0x23')](function(_0x536fdf){_0x5053e6[_0xb7e4('0x3f')]=_0x536fdf;if(_0x5a0693[_0xb7e4('0x34')]['includeAll']){_0x49eba6['include']=[{'all':!![]}];}return db['Trigger'][_0xb7e4('0x40')](_0x49eba6);})[_0xb7e4('0x23')](function(_0x546841){_0x5053e6[_0xb7e4('0x41')]=_0x546841;return _0x5053e6;})[_0xb7e4('0x23')](respondWithFilteredResult(_0x5efb37,_0x49eba6))[_0xb7e4('0x42')](handleError(_0x5efb37,null));};exports['show']=function(_0xa53a04,_0x29b545){var _0x390708={'raw':![],'where':{'id':_0xa53a04[_0xb7e4('0x43')]['id']}},_0xd68400={};_0xd68400[_0xb7e4('0x2e')]=_[_0xb7e4('0x2f')](db[_0xb7e4('0x2c')][_0xb7e4('0x44')]);_0xd68400[_0xb7e4('0x34')]=_['keys'](_0xa53a04[_0xb7e4('0x34')]);_0xd68400[_0xb7e4('0x30')]=_['intersection'](_0xd68400['model'],_0xd68400[_0xb7e4('0x34')]);_0x390708['attributes']=_[_0xb7e4('0x31')](_0xd68400['model'],qs[_0xb7e4('0x33')](_0xa53a04[_0xb7e4('0x34')]['fields']));_0x390708[_0xb7e4('0x32')]=_0x390708[_0xb7e4('0x32')][_0xb7e4('0x35')]?_0x390708[_0xb7e4('0x32')]:_0xd68400[_0xb7e4('0x2e')];if(_0xa53a04[_0xb7e4('0x34')][_0xb7e4('0x45')]){_0x390708[_0xb7e4('0x46')]=[{'all':!![]}];}_0x390708=_[_0xb7e4('0x3e')]({},_0x390708,_0xa53a04['options']);return db[_0xb7e4('0x2c')][_0xb7e4('0x47')](_0x390708)['then'](handleEntityNotFound(_0x29b545,null))[_0xb7e4('0x23')](respondWithResult(_0x29b545,null))[_0xb7e4('0x42')](handleError(_0x29b545,null));};exports[_0xb7e4('0x48')]=function(_0x4bf8f5,_0xe69e83){return db['Trigger']['create'](_0x4bf8f5[_0xb7e4('0x49')],{})[_0xb7e4('0x23')](function(_0xbcb50a){var _0xec6b2f=_0x4bf8f5[_0xb7e4('0x4a')]['get']({'plain':!![]});if(!_0xec6b2f)throw new Error(_0xb7e4('0x4b'));if(_0xec6b2f[_0xb7e4('0x4c')]===_0xb7e4('0x4a')){var _0x4d320d=_0xbcb50a[_0xb7e4('0x24')]({'plain':!![]});var _0x1821f4=_0xb7e4('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x1821f4,'userProfileId':_0xec6b2f[_0xb7e4('0x4d')]},'raw':!![]})['then'](function(_0x372c8f){if(_0x372c8f&&_0x372c8f['autoAssociation']===0x0){return db[_0xb7e4('0x26')][_0xb7e4('0x48')]({'name':_0x4d320d[_0xb7e4('0x29')],'resourceId':_0x4d320d['id'],'type':_0x372c8f[_0xb7e4('0x29')],'sectionId':_0x372c8f['id']},{})['then'](function(){return _0xbcb50a;});}else{return _0xbcb50a;}})[_0xb7e4('0x42')](function(_0x235f0b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x235f0b);throw _0x235f0b;});}return _0xbcb50a;})[_0xb7e4('0x23')](respondWithResult(_0xe69e83,0xc9))[_0xb7e4('0x42')](handleError(_0xe69e83,null));};exports['update']=function(_0x5c7d06,_0x295e7e){if(_0x5c7d06[_0xb7e4('0x49')]['id']){delete _0x5c7d06[_0xb7e4('0x49')]['id'];}return db['Trigger'][_0xb7e4('0x47')]({'where':{'id':_0x5c7d06[_0xb7e4('0x43')]['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x295e7e,null))[_0xb7e4('0x23')](saveUpdates(_0x5c7d06[_0xb7e4('0x49')],null))[_0xb7e4('0x23')](respondWithResult(_0x295e7e,null))[_0xb7e4('0x42')](handleError(_0x295e7e,null));};exports[_0xb7e4('0x27')]=function(_0x833428,_0x37a381){return db[_0xb7e4('0x2c')][_0xb7e4('0x47')]({'where':{'id':_0x833428[_0xb7e4('0x43')]['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x37a381,null))['then'](removeEntity(_0x37a381,null))[_0xb7e4('0x42')](handleError(_0x37a381,null));};exports[_0xb7e4('0x4e')]=function(_0x40e9b8,_0x1769fa,_0x30c995){if(_0x40e9b8[_0xb7e4('0x49')]['id']){delete _0x40e9b8[_0xb7e4('0x49')]['id'];}return db[_0xb7e4('0x2c')][_0xb7e4('0x47')]({'where':{'id':_0x40e9b8['params']['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x1769fa,null))[_0xb7e4('0x23')](function(_0x316e16){if(_0x316e16){_0x40e9b8[_0xb7e4('0x49')]['TriggerAllId']=_0x316e16['id'];return db[_0xb7e4('0x4f')][_0xb7e4('0x48')](_0x40e9b8[_0xb7e4('0x49')]);}})['then'](respondWithResult(_0x1769fa,null))['catch'](handleError(_0x1769fa,null));};exports[_0xb7e4('0x50')]=function(_0x6c93a4,_0x1ac798,_0x3b6eab){if(_0x6c93a4['body']['id']){delete _0x6c93a4[_0xb7e4('0x49')]['id'];}return db[_0xb7e4('0x2c')]['find']({'where':{'id':_0x6c93a4['params']['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x1ac798,null))['then'](function(_0x26c7bf){if(_0x26c7bf){_0x6c93a4[_0xb7e4('0x49')][_0xb7e4('0x51')]=_0x26c7bf['id'];return db[_0xb7e4('0x4f')][_0xb7e4('0x48')](_0x6c93a4[_0xb7e4('0x49')]);}})[_0xb7e4('0x23')](respondWithResult(_0x1ac798,null))[_0xb7e4('0x42')](handleError(_0x1ac798,null));};exports[_0xb7e4('0x52')]=function(_0x2f3f1f,_0x14e2b4,_0x11607e){var _0x2a3b8e={};var _0x39f521={};var _0x66b637;var _0x2d364d;return db[_0xb7e4('0x2c')][_0xb7e4('0x53')]({'where':{'id':_0x2f3f1f[_0xb7e4('0x43')]['id']}})['then'](handleEntityNotFound(_0x14e2b4,null))[_0xb7e4('0x23')](function(_0x30f0dd){if(_0x30f0dd){_0x66b637=_0x30f0dd;_0x39f521[_0xb7e4('0x2e')]=_[_0xb7e4('0x2f')](db[_0xb7e4('0x4f')]['rawAttributes']);_0x39f521[_0xb7e4('0x34')]=_[_0xb7e4('0x2f')](_0x2f3f1f[_0xb7e4('0x34')]);_0x39f521[_0xb7e4('0x30')]=_[_0xb7e4('0x31')](_0x39f521[_0xb7e4('0x2e')],_0x39f521[_0xb7e4('0x34')]);_0x2a3b8e[_0xb7e4('0x32')]=_['intersection'](_0x39f521[_0xb7e4('0x2e')],qs[_0xb7e4('0x33')](_0x2f3f1f[_0xb7e4('0x34')]['fields']));_0x2a3b8e[_0xb7e4('0x32')]=_0x2a3b8e[_0xb7e4('0x32')][_0xb7e4('0x35')]?_0x2a3b8e['attributes']:_0x39f521[_0xb7e4('0x2e')];_0x2a3b8e[_0xb7e4('0x38')]=qs[_0xb7e4('0x39')](_0x2f3f1f[_0xb7e4('0x34')][_0xb7e4('0x39')]);_0x2a3b8e[_0xb7e4('0x3a')]=qs['filters'](_[_0xb7e4('0x3b')](_0x2f3f1f[_0xb7e4('0x34')],_0x39f521[_0xb7e4('0x30')]));if(_0x2f3f1f['query'][_0xb7e4('0x3c')]){_0x2a3b8e[_0xb7e4('0x3a')]=_['merge'](_0x2a3b8e['where'],{'$or':_[_0xb7e4('0x2b')](_0x2a3b8e[_0xb7e4('0x32')],function(_0x331dcc){var _0xa5f49c={};_0xa5f49c[_0x331dcc]={'$like':'%'+_0x2f3f1f[_0xb7e4('0x34')][_0xb7e4('0x3c')]+'%'};return _0xa5f49c;})});}_0x2a3b8e=_['merge']({},_0x2a3b8e,_0x2f3f1f['options']);return _0x66b637[_0xb7e4('0x52')](_0x2a3b8e);}})[_0xb7e4('0x23')](function(_0x37f499){if(_0x37f499){_0x2d364d=_0x37f499[_0xb7e4('0x35')];if(!_0x2f3f1f[_0xb7e4('0x34')]['hasOwnProperty'](_0xb7e4('0x37'))){_0x2a3b8e[_0xb7e4('0x1d')]=qs[_0xb7e4('0x1d')](_0x2f3f1f[_0xb7e4('0x34')][_0xb7e4('0x1d')]);_0x2a3b8e[_0xb7e4('0x1b')]=qs[_0xb7e4('0x1b')](_0x2f3f1f[_0xb7e4('0x34')][_0xb7e4('0x1b')]);}return _0x66b637[_0xb7e4('0x52')](_0x2a3b8e);}})[_0xb7e4('0x23')](function(_0x37bd3d){if(_0x37bd3d){return _0x37bd3d?{'count':_0x2d364d,'rows':_0x37bd3d}:null;}})[_0xb7e4('0x23')](respondWithResult(_0x14e2b4,null))[_0xb7e4('0x42')](handleError(_0x14e2b4,null));};exports[_0xb7e4('0x54')]=function(_0x261366,_0x340188,_0xfbeaad){var _0x58d35e={};var _0x53ce79={};var _0xa5b04;var _0x68d83;return db[_0xb7e4('0x2c')][_0xb7e4('0x53')]({'where':{'id':_0x261366[_0xb7e4('0x43')]['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x340188,null))[_0xb7e4('0x23')](function(_0x28c3d2){if(_0x28c3d2){_0xa5b04=_0x28c3d2;_0x53ce79['model']=_[_0xb7e4('0x2f')](db[_0xb7e4('0x4f')][_0xb7e4('0x44')]);_0x53ce79[_0xb7e4('0x34')]=_[_0xb7e4('0x2f')](_0x261366[_0xb7e4('0x34')]);_0x53ce79[_0xb7e4('0x30')]=_[_0xb7e4('0x31')](_0x53ce79['model'],_0x53ce79[_0xb7e4('0x34')]);_0x58d35e[_0xb7e4('0x32')]=_[_0xb7e4('0x31')](_0x53ce79[_0xb7e4('0x2e')],qs[_0xb7e4('0x33')](_0x261366[_0xb7e4('0x34')][_0xb7e4('0x33')]));_0x58d35e['attributes']=_0x58d35e[_0xb7e4('0x32')]['length']?_0x58d35e[_0xb7e4('0x32')]:_0x53ce79[_0xb7e4('0x2e')];_0x58d35e[_0xb7e4('0x38')]=qs[_0xb7e4('0x39')](_0x261366[_0xb7e4('0x34')][_0xb7e4('0x39')]);_0x58d35e['where']=qs[_0xb7e4('0x30')](_['pick'](_0x261366['query'],_0x53ce79[_0xb7e4('0x30')]));if(_0x261366[_0xb7e4('0x34')][_0xb7e4('0x3c')]){_0x58d35e[_0xb7e4('0x3a')]=_[_0xb7e4('0x3e')](_0x58d35e[_0xb7e4('0x3a')],{'$or':_[_0xb7e4('0x2b')](_0x58d35e['attributes'],function(_0x15c1dc){var _0x741bb2={};_0x741bb2[_0x15c1dc]={'$like':'%'+_0x261366[_0xb7e4('0x34')]['filter']+'%'};return _0x741bb2;})});}_0x58d35e=_[_0xb7e4('0x3e')]({},_0x58d35e,_0x261366[_0xb7e4('0x55')]);return _0xa5b04[_0xb7e4('0x54')](_0x58d35e);}})[_0xb7e4('0x23')](function(_0x189d37){if(_0x189d37){_0x68d83=_0x189d37['length'];if(!_0x261366[_0xb7e4('0x34')]['hasOwnProperty'](_0xb7e4('0x37'))){_0x58d35e['limit']=qs[_0xb7e4('0x1d')](_0x261366[_0xb7e4('0x34')][_0xb7e4('0x1d')]);_0x58d35e[_0xb7e4('0x1b')]=qs[_0xb7e4('0x1b')](_0x261366[_0xb7e4('0x34')][_0xb7e4('0x1b')]);}return _0xa5b04['getAnyConditions'](_0x58d35e);}})[_0xb7e4('0x23')](function(_0x2316f9){if(_0x2316f9){return _0x2316f9?{'count':_0x68d83,'rows':_0x2316f9}:null;}})['then'](respondWithResult(_0x340188,null))[_0xb7e4('0x42')](handleError(_0x340188,null));};exports[_0xb7e4('0x56')]=function(_0x13aea3,_0x2e0dc8,_0x327c92){if(_0x13aea3['body']['id']){delete _0x13aea3['body']['id'];}return db['Trigger'][_0xb7e4('0x47')]({'where':{'id':_0x13aea3[_0xb7e4('0x43')]['id']}})[_0xb7e4('0x23')](handleEntityNotFound(_0x2e0dc8,null))['then'](function(_0x16ff49){if(_0x16ff49){_0x13aea3['body'][_0xb7e4('0x57')]=_0x16ff49['id'];return db[_0xb7e4('0x58')][_0xb7e4('0x48')](_0x13aea3['body']);}})[_0xb7e4('0x23')](respondWithResult(_0x2e0dc8,null))[_0xb7e4('0x42')](handleError(_0x2e0dc8,null));};exports[_0xb7e4('0x59')]=function(_0x4177ed,_0xd36b68,_0x4f613c){var _0x1b2a4c={};var _0x2a2835={};var _0x2bfb72;var _0x367de4;return db['Trigger'][_0xb7e4('0x53')]({'where':{'id':_0x4177ed[_0xb7e4('0x43')]['id']}})['then'](handleEntityNotFound(_0xd36b68,null))['then'](function(_0x5f1345){if(_0x5f1345){_0x2bfb72=_0x5f1345;_0x2a2835['model']=_[_0xb7e4('0x2f')](db[_0xb7e4('0x58')][_0xb7e4('0x44')]);_0x2a2835[_0xb7e4('0x34')]=_['keys'](_0x4177ed[_0xb7e4('0x34')]);_0x2a2835['filters']=_['intersection'](_0x2a2835[_0xb7e4('0x2e')],_0x2a2835[_0xb7e4('0x34')]);_0x1b2a4c[_0xb7e4('0x32')]=_[_0xb7e4('0x31')](_0x2a2835['model'],qs[_0xb7e4('0x33')](_0x4177ed[_0xb7e4('0x34')][_0xb7e4('0x33')]));_0x1b2a4c['attributes']=_0x1b2a4c[_0xb7e4('0x32')][_0xb7e4('0x35')]?_0x1b2a4c['attributes']:_0x2a2835['model'];_0x1b2a4c[_0xb7e4('0x38')]=qs[_0xb7e4('0x39')](_0x4177ed[_0xb7e4('0x34')]['sort']);_0x1b2a4c['where']=qs['filters'](_[_0xb7e4('0x3b')](_0x4177ed['query'],_0x2a2835[_0xb7e4('0x30')]));if(_0x4177ed[_0xb7e4('0x34')][_0xb7e4('0x3c')]){_0x1b2a4c[_0xb7e4('0x3a')]=_[_0xb7e4('0x3e')](_0x1b2a4c[_0xb7e4('0x3a')],{'$or':_[_0xb7e4('0x2b')](_0x1b2a4c[_0xb7e4('0x32')],function(_0x100102){var _0x425cdc={};_0x425cdc[_0x100102]={'$like':'%'+_0x4177ed[_0xb7e4('0x34')]['filter']+'%'};return _0x425cdc;})});}_0x1b2a4c=_[_0xb7e4('0x3e')]({},_0x1b2a4c,_0x4177ed['options']);return _0x2bfb72[_0xb7e4('0x59')](_0x1b2a4c);}})[_0xb7e4('0x23')](function(_0x4693d1){if(_0x4693d1){_0x367de4=_0x4693d1[_0xb7e4('0x35')];if(!_0x4177ed[_0xb7e4('0x34')][_0xb7e4('0x36')](_0xb7e4('0x37'))){_0x1b2a4c[_0xb7e4('0x1d')]=qs['limit'](_0x4177ed['query'][_0xb7e4('0x1d')]);_0x1b2a4c[_0xb7e4('0x1b')]=qs[_0xb7e4('0x1b')](_0x4177ed[_0xb7e4('0x34')][_0xb7e4('0x1b')]);}return _0x2bfb72[_0xb7e4('0x59')](_0x1b2a4c);}})['then'](function(_0xe33bca){if(_0xe33bca){return _0xe33bca?{'count':_0x367de4,'rows':_0xe33bca}:null;}})[_0xb7e4('0x23')](respondWithResult(_0xd36b68,null))[_0xb7e4('0x42')](handleError(_0xd36b68,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 265888b..283d9f5 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 _0x2557=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','Trigger','tools_triggers'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2557,0x11e));var _0x7255=function(_0x37ef1a,_0x2485cb){_0x37ef1a=_0x37ef1a-0x0;var _0xf2faea=_0x2557[_0x37ef1a];return _0xf2faea;};'use strict';var _=require(_0x7255('0x0'));var util=require('util');var logger=require(_0x7255('0x1'))(_0x7255('0x2'));var moment=require(_0x7255('0x3'));var BPromise=require(_0x7255('0x4'));var rp=require(_0x7255('0x5'));var fs=require('fs');var path=require(_0x7255('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x7255('0x7')]=function(_0x937dce,_0x46c30e){return _0x937dce[_0x7255('0x8')](_0x7255('0x9'),attributes,{'tableName':_0x7255('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82f5=['api','moment','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','lodash','util','../../config/logger'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x82f5,0x15d));var _0x582f=function(_0x474d2f,_0xe50ffe){_0x474d2f=_0x474d2f-0x0;var _0x382cf9=_0x82f5[_0x474d2f];return _0x382cf9;};'use strict';var _=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var logger=require(_0x582f('0x2'))(_0x582f('0x3'));var moment=require(_0x582f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x582f('0x5'));var rimraf=require(_0x582f('0x6'));var config=require(_0x582f('0x7'));var attributes=require(_0x582f('0x8'));module[_0x582f('0x9')]=function(_0x15d332,_0x459755){return _0x15d332['define'](_0x582f('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 106d758..faa62ee 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 _0x9386=['GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrigger','lodash','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x9386,0x1cd));var _0x6938=function(_0x42d221,_0x5d2385){_0x42d221=_0x42d221-0x0;var _0x3b0816=_0x9386[_0x42d221];return _0x3b0816;};'use strict';var _=require(_0x6938('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6938('0x1'))['db'];var utils=require(_0x6938('0x2'));var logger=require(_0x6938('0x3'))('rpc');var config=require(_0x6938('0x4'));var jayson=require(_0x6938('0x5'));var client=jayson[_0x6938('0x6')][_0x6938('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x221830,_0x3f2052,_0x30d2f9){return new BPromise(function(_0x40e68d,_0x5825a8){return client['request'](_0x221830,_0x30d2f9)[_0x6938('0x8')](function(_0x2726cf){logger[_0x6938('0x9')](_0x6938('0xa'),_0x3f2052,_0x6938('0xb'));logger[_0x6938('0xc')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3f2052,_0x6938('0xb'),JSON[_0x6938('0xd')](_0x2726cf));if(_0x2726cf[_0x6938('0xe')]){if(_0x2726cf[_0x6938('0xe')][_0x6938('0xf')]===0x1f4){logger[_0x6938('0xe')]('Trigger,\x20%s,\x20%s',_0x3f2052,_0x2726cf[_0x6938('0xe')][_0x6938('0x10')]);return _0x5825a8(_0x2726cf[_0x6938('0xe')][_0x6938('0x10')]);}logger[_0x6938('0xe')](_0x6938('0xa'),_0x3f2052,_0x2726cf[_0x6938('0xe')]['message']);return _0x40e68d(_0x2726cf[_0x6938('0xe')][_0x6938('0x10')]);}else{logger[_0x6938('0x9')](_0x6938('0xa'),_0x3f2052,_0x6938('0xb'));_0x40e68d(_0x2726cf[_0x6938('0x11')][_0x6938('0x10')]);}})[_0x6938('0x12')](function(_0x4b79af){logger['error'](_0x6938('0xa'),_0x3f2052,_0x4b79af);_0x5825a8(_0x4b79af);});});}exports[_0x6938('0x13')]=function(_0x2a1e4e){var _0x1338d9=this;return new Promise(function(_0x1e4d2b,_0x2ea2cf){return db[_0x6938('0x14')][_0x6938('0x15')]({'raw':_0x2a1e4e[_0x6938('0x16')]?_0x2a1e4e[_0x6938('0x16')][_0x6938('0x17')]===undefined?!![]:![]:!![],'where':_0x2a1e4e[_0x6938('0x16')]?_0x2a1e4e[_0x6938('0x16')][_0x6938('0x18')]||null:null,'attributes':_0x2a1e4e['options']?_0x2a1e4e['options'][_0x6938('0x19')]||null:null,'limit':_0x2a1e4e[_0x6938('0x16')]?_0x2a1e4e[_0x6938('0x16')][_0x6938('0x1a')]||null:null,'include':_0x2a1e4e[_0x6938('0x16')]?_0x2a1e4e[_0x6938('0x16')][_0x6938('0x1b')]?_[_0x6938('0x1c')](_0x2a1e4e[_0x6938('0x16')][_0x6938('0x1b')],function(_0x173744){return{'model':db[_0x173744['model']],'as':_0x173744['as'],'attributes':_0x173744[_0x6938('0x19')],'include':_0x173744[_0x6938('0x1b')]?_[_0x6938('0x1c')](_0x173744['include'],function(_0x3983e2){return{'model':db[_0x3983e2['model']],'as':_0x3983e2['as'],'attributes':_0x3983e2[_0x6938('0x19')],'include':_0x3983e2[_0x6938('0x1b')]?_[_0x6938('0x1c')](_0x3983e2[_0x6938('0x1b')],function(_0x45a776){return{'model':db[_0x45a776[_0x6938('0x1d')]],'as':_0x45a776['as'],'attributes':_0x45a776[_0x6938('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6938('0x8')](function(_0x2ef25d){logger['info'](_0x6938('0x13'),_0x2a1e4e);logger[_0x6938('0xc')](_0x6938('0x13'),_0x2a1e4e,JSON[_0x6938('0xd')](_0x2ef25d));_0x1e4d2b(_0x2ef25d);})[_0x6938('0x12')](function(_0x34439b){logger[_0x6938('0xe')](_0x6938('0x13'),_0x34439b[_0x6938('0x10')],_0x2a1e4e);_0x2ea2cf(_0x1338d9[_0x6938('0xe')](0x1f4,_0x34439b[_0x6938('0x10')]));});});};exports['ShowTrigger']=function(_0x35f579){var _0x12d882=this;return new Promise(function(_0xec6e38,_0x4c08d6){return db['Trigger'][_0x6938('0x1e')]({'raw':_0x35f579['options']?_0x35f579['options'][_0x6938('0x17')]===undefined?!![]:![]:!![],'where':_0x35f579[_0x6938('0x16')]?_0x35f579[_0x6938('0x16')]['where']||null:null,'attributes':_0x35f579[_0x6938('0x16')]?_0x35f579['options'][_0x6938('0x19')]||null:null,'include':_0x35f579['options']?_0x35f579[_0x6938('0x16')]['include']?_['map'](_0x35f579[_0x6938('0x16')][_0x6938('0x1b')],function(_0x239804){return{'model':db[_0x239804[_0x6938('0x1d')]],'as':_0x239804['as'],'attributes':_0x239804[_0x6938('0x19')],'include':_0x239804[_0x6938('0x1b')]?_[_0x6938('0x1c')](_0x239804[_0x6938('0x1b')],function(_0x43f7a4){return{'model':db[_0x43f7a4['model']],'as':_0x43f7a4['as'],'attributes':_0x43f7a4[_0x6938('0x19')],'include':_0x43f7a4[_0x6938('0x1b')]?_[_0x6938('0x1c')](_0x43f7a4['include'],function(_0x4120c2){return{'model':db[_0x4120c2['model']],'as':_0x4120c2['as'],'attributes':_0x4120c2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bd82c){logger[_0x6938('0x9')](_0x6938('0x1f'),_0x35f579);logger['debug']('ShowTrigger',_0x35f579,JSON['stringify'](_0x1bd82c));_0xec6e38(_0x1bd82c);})[_0x6938('0x12')](function(_0x3c92c7){logger[_0x6938('0xe')]('ShowTrigger',_0x3c92c7[_0x6938('0x10')],_0x35f579);_0x4c08d6(_0x12d882[_0x6938('0xe')](0x1f4,_0x3c92c7[_0x6938('0x10')]));});});}; \ No newline at end of file +var _0x0591=['catch','GetTrigger','Trigger','options','raw','attributes','limit','map','include','model','info','debug','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x503fce,_0x8a5b60){var _0x36bef5=function(_0x432461){while(--_0x432461){_0x503fce['push'](_0x503fce['shift']());}};_0x36bef5(++_0x8a5b60);}(_0x0591,0xe0));var _0x1059=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0x0591[_0x49aab7];return _0x587b6f;};'use strict';var _=require(_0x1059('0x0'));var util=require(_0x1059('0x1'));var moment=require(_0x1059('0x2'));var BPromise=require(_0x1059('0x3'));var rs=require(_0x1059('0x4'));var fs=require('fs');var Redis=require(_0x1059('0x5'));var db=require(_0x1059('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1059('0x7'))(_0x1059('0x8'));var config=require(_0x1059('0x9'));var jayson=require(_0x1059('0xa'));var client=jayson[_0x1059('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4519fd,_0x209306,_0x14da57){return new BPromise(function(_0x3065ab,_0x50592e){return client[_0x1059('0xc')](_0x4519fd,_0x14da57)[_0x1059('0xd')](function(_0xffd9ca){logger['info'](_0x1059('0xe'),_0x209306,_0x1059('0xf'));logger['debug'](_0x1059('0x10'),_0x209306,_0x1059('0xf'),JSON[_0x1059('0x11')](_0xffd9ca));if(_0xffd9ca[_0x1059('0x12')]){if(_0xffd9ca[_0x1059('0x12')][_0x1059('0x13')]===0x1f4){logger[_0x1059('0x12')](_0x1059('0xe'),_0x209306,_0xffd9ca[_0x1059('0x12')][_0x1059('0x14')]);return _0x50592e(_0xffd9ca[_0x1059('0x12')][_0x1059('0x14')]);}logger[_0x1059('0x12')]('Trigger,\x20%s,\x20%s',_0x209306,_0xffd9ca[_0x1059('0x12')][_0x1059('0x14')]);return _0x3065ab(_0xffd9ca['error']['message']);}else{logger['info'](_0x1059('0xe'),_0x209306,_0x1059('0xf'));_0x3065ab(_0xffd9ca['result']['message']);}})[_0x1059('0x15')](function(_0x43b96b){logger[_0x1059('0x12')](_0x1059('0xe'),_0x209306,_0x43b96b);_0x50592e(_0x43b96b);});});}exports[_0x1059('0x16')]=function(_0x4df9f1){var _0x28f0c6=this;return new Promise(function(_0x50bbd5,_0x1cb981){return db[_0x1059('0x17')]['findAll']({'raw':_0x4df9f1['options']?_0x4df9f1[_0x1059('0x18')][_0x1059('0x19')]===undefined?!![]:![]:!![],'where':_0x4df9f1[_0x1059('0x18')]?_0x4df9f1[_0x1059('0x18')]['where']||null:null,'attributes':_0x4df9f1['options']?_0x4df9f1[_0x1059('0x18')][_0x1059('0x1a')]||null:null,'limit':_0x4df9f1['options']?_0x4df9f1[_0x1059('0x18')][_0x1059('0x1b')]||null:null,'include':_0x4df9f1[_0x1059('0x18')]?_0x4df9f1[_0x1059('0x18')]['include']?_[_0x1059('0x1c')](_0x4df9f1[_0x1059('0x18')][_0x1059('0x1d')],function(_0x61b3b1){return{'model':db[_0x61b3b1[_0x1059('0x1e')]],'as':_0x61b3b1['as'],'attributes':_0x61b3b1['attributes'],'include':_0x61b3b1[_0x1059('0x1d')]?_[_0x1059('0x1c')](_0x61b3b1[_0x1059('0x1d')],function(_0x2059ff){return{'model':db[_0x2059ff[_0x1059('0x1e')]],'as':_0x2059ff['as'],'attributes':_0x2059ff[_0x1059('0x1a')],'include':_0x2059ff[_0x1059('0x1d')]?_[_0x1059('0x1c')](_0x2059ff[_0x1059('0x1d')],function(_0x5f0f0e){return{'model':db[_0x5f0f0e['model']],'as':_0x5f0f0e['as'],'attributes':_0x5f0f0e[_0x1059('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1059('0xd')](function(_0x53d4b2){logger[_0x1059('0x1f')]('GetTrigger',_0x4df9f1);logger[_0x1059('0x20')](_0x1059('0x16'),_0x4df9f1,JSON[_0x1059('0x11')](_0x53d4b2));_0x50bbd5(_0x53d4b2);})['catch'](function(_0x442055){logger[_0x1059('0x12')](_0x1059('0x16'),_0x442055['message'],_0x4df9f1);_0x1cb981(_0x28f0c6['error'](0x1f4,_0x442055['message']));});});};exports[_0x1059('0x21')]=function(_0x53f2da){var _0x1b754f=this;return new Promise(function(_0x39460f,_0x3887ea){return db[_0x1059('0x17')][_0x1059('0x22')]({'raw':_0x53f2da[_0x1059('0x18')]?_0x53f2da[_0x1059('0x18')][_0x1059('0x19')]===undefined?!![]:![]:!![],'where':_0x53f2da[_0x1059('0x18')]?_0x53f2da['options']['where']||null:null,'attributes':_0x53f2da[_0x1059('0x18')]?_0x53f2da[_0x1059('0x18')][_0x1059('0x1a')]||null:null,'include':_0x53f2da['options']?_0x53f2da['options'][_0x1059('0x1d')]?_['map'](_0x53f2da[_0x1059('0x18')][_0x1059('0x1d')],function(_0x5aa160){return{'model':db[_0x5aa160[_0x1059('0x1e')]],'as':_0x5aa160['as'],'attributes':_0x5aa160['attributes'],'include':_0x5aa160[_0x1059('0x1d')]?_[_0x1059('0x1c')](_0x5aa160[_0x1059('0x1d')],function(_0x16c575){return{'model':db[_0x16c575[_0x1059('0x1e')]],'as':_0x16c575['as'],'attributes':_0x16c575[_0x1059('0x1a')],'include':_0x16c575[_0x1059('0x1d')]?_[_0x1059('0x1c')](_0x16c575['include'],function(_0x5cb579){return{'model':db[_0x5cb579[_0x1059('0x1e')]],'as':_0x5cb579['as'],'attributes':_0x5cb579[_0x1059('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1059('0xd')](function(_0x607628){logger[_0x1059('0x1f')](_0x1059('0x21'),_0x53f2da);logger[_0x1059('0x20')](_0x1059('0x21'),_0x53f2da,JSON['stringify'](_0x607628));_0x39460f(_0x607628);})[_0x1059('0x15')](function(_0x1a3360){logger[_0x1059('0x12')](_0x1059('0x21'),_0x1a3360[_0x1059('0x14')],_0x53f2da);_0x3887ea(_0x1b754f[_0x1059('0x12')](0x1f4,_0x1a3360[_0x1059('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 55b4b20..0031e92 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 _0xfebc=['express','fs-extra','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','post','/:id/clone','clone','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x5e7ee9,_0x4dbc4b){var _0xadb900=function(_0x5eecb3){while(--_0x5eecb3){_0x5e7ee9['push'](_0x5e7ee9['shift']());}};_0xadb900(++_0x4dbc4b);}(_0xfebc,0x189));var _0xcfeb=function(_0x3add10,_0x457d16){_0x3add10=_0x3add10-0x0;var _0x2da348=_0xfebc[_0x3add10];return _0x2da348;};'use strict';var multer=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var path=require('path');var timeout=require(_0xcfeb('0x2'));var express=require(_0xcfeb('0x3'));var router=express['Router']();var fs_extra=require(_0xcfeb('0x4'));var auth=require(_0xcfeb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcfeb('0x6'));router[_0xcfeb('0x7')]('/',auth[_0xcfeb('0x8')](),controller['index']);router['get'](_0xcfeb('0x9'),auth[_0xcfeb('0x8')](),controller['show']);router[_0xcfeb('0xa')](_0xcfeb('0xb'),auth[_0xcfeb('0x8')](),controller[_0xcfeb('0xc')]);router[_0xcfeb('0xa')]('/',auth[_0xcfeb('0x8')](),controller[_0xcfeb('0xd')]);router[_0xcfeb('0xe')]('/:id',auth[_0xcfeb('0x8')](),controller[_0xcfeb('0xf')]);router[_0xcfeb('0x10')](_0xcfeb('0x9'),auth[_0xcfeb('0x8')](),controller[_0xcfeb('0x11')]);module['exports']=router; \ No newline at end of file +var _0xaa9f=['../../config/environment','isAuthenticated','show','/:id/clone','clone','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x35ec33,_0x31dfa1){var _0x18c22e=function(_0x28ba0a){while(--_0x28ba0a){_0x35ec33['push'](_0x35ec33['shift']());}};_0x18c22e(++_0x31dfa1);}(_0xaa9f,0x7e));var _0xfaa9=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xaa9f[_0x1e081a];return _0x428209;};'use strict';var multer=require(_0xfaa9('0x0'));var util=require('util');var path=require(_0xfaa9('0x1'));var timeout=require(_0xfaa9('0x2'));var express=require(_0xfaa9('0x3'));var router=express[_0xfaa9('0x4')]();var fs_extra=require(_0xfaa9('0x5'));var auth=require(_0xfaa9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfaa9('0x7'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xfaa9('0x8')](),controller[_0xfaa9('0x9')]);router['post'](_0xfaa9('0xa'),auth[_0xfaa9('0x8')](),controller[_0xfaa9('0xb')]);router[_0xfaa9('0xc')]('/',auth[_0xfaa9('0x8')](),controller[_0xfaa9('0xd')]);router[_0xfaa9('0xe')](_0xfaa9('0xf'),auth[_0xfaa9('0x8')](),controller[_0xfaa9('0x10')]);router['delete'](_0xfaa9('0xf'),auth['isAuthenticated'](),controller[_0xfaa9('0x11')]);module[_0xfaa9('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index d77627e..da9ef03 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 _0x5871=['user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','BOOLEAN','exports','STRING','ENUM','friend'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x5871,0x128));var _0x1587=function(_0x3ec784,_0xffce2e){_0x3ec784=_0x3ec784-0x0;var _0x12001a=_0x5871[_0x3ec784];return _0x12001a;};'use strict';var Sequelize=require('sequelize');module[_0x1587('0x0')]={'name':{'type':Sequelize[_0x1587('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x3'),_0x1587('0x4'),_0x1587('0x5')),'allowNull':![],'defaultValue':_0x1587('0x3')},'context':{'type':Sequelize[_0x1587('0x1')],'allowNull':![],'defaultValue':_0x1587('0x6')},'callingpres':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x7'),_0x1587('0x8'),_0x1587('0x9'),_0x1587('0xa'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x1587('0xb'),_0x1587('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x1587('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x1587('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x1587('0xd'),'set':function(_0x364bd9){this[_0x1587('0xe')](_0x1587('0xf'),_0x364bd9?_0x364bd9[_0x1587('0x10')](','):null);},'get':function(){return this[_0x1587('0x11')](_0x1587('0xf'))?this['getDataValue'](_0x1587('0xf'))[_0x1587('0x12')](','):null;},'comment':_0x1587('0x13')},'dtmfmode':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x14'),'info','shortinfo',_0x1587('0x15'),_0x1587('0x16')),'defaultValue':_0x1587('0x14')},'directmedia':{'type':Sequelize[_0x1587('0x2')]('yes','no',_0x1587('0x17'),_0x1587('0x18'),_0x1587('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1587('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x1587('0x1')],'defaultValue':_0x1587('0x1b'),'set':function(_0x3c9005){this[_0x1587('0xe')](_0x1587('0x1c'),_0x3c9005?_0x3c9005[_0x1587('0x10')](','):null);},'get':function(){return this[_0x1587('0x11')](_0x1587('0x1c'))?this[_0x1587('0x11')]('nat')['split'](','):null;},'comment':_0x1587('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1587('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x1587('0x1')]},'language':{'type':Sequelize[_0x1587('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1587('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1587('0x1')],'defaultValue':_0x1587('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x17662c){this[_0x1587('0xe')]('allow',_0x17662c?_0x17662c['join'](';'):_0x1587('0x1f'));},'get':function(){return this[_0x1587('0x11')](_0x1587('0x20'))?this['getDataValue'](_0x1587('0x20'))[_0x1587('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1587('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x1587('0x21'),'set':function(_0x455262){this[_0x1587('0xe')]('insecure',_0x455262?_0x455262[_0x1587('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x1587('0x22'))?this[_0x1587('0x11')](_0x1587('0x22'))[_0x1587('0x12')](','):null;},'comment':_0x1587('0x23')},'trustrpid':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0x1587('0x2')]('yes','no')},'useclientcode':{'type':Sequelize[_0x1587('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0x1587('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x1587('0x1')]},'callcounter':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':_0x1587('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x1587('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no',_0x1587('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1587('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x1587('0x1')]},'session_timers':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x26'),_0x1587('0x27'),_0x1587('0x28'))},'session_expires':{'type':Sequelize[_0x1587('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x1587('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x29'),_0x1587('0x2a')),'defaultValue':_0x1587('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':_0x1587('0x1a')},'keepalive':{'type':Sequelize[_0x1587('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x1587('0x1')]},'defaultuser':{'type':Sequelize[_0x1587('0x1')]},'rtptimeout':{'type':Sequelize[_0x1587('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x1587('0x2')]('yes','no',_0x1587('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1587('0x1')]},'callbackextension':{'type':Sequelize[_0x1587('0x1')]},'timert1':{'type':Sequelize[_0x1587('0x24')](0xb)},'timerb':{'type':Sequelize[_0x1587('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1587('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1587('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x1587('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x1587('0x1a'),'no',_0x1587('0x2c'),_0x1587('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x1587('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x1587('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1587('0x1')]},'dtlscapath':{'type':Sequelize[_0x1587('0x1')]},'dtlssetup':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x2e'),_0x1587('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x1587('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1587('0x1')]},'recordofffeature':{'type':Sequelize[_0x1587('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x1587('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x1587('0x1')]},'description':{'type':Sequelize[_0x1587('0x1')]},'host':{'type':Sequelize[_0x1587('0x1')],'defaultValue':_0x1587('0x30')},'canreinvite':{'type':Sequelize[_0x1587('0x2')](_0x1587('0x1a'),'no',_0x1587('0x17'),_0x1587('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x1587('0x1')]},'active':{'type':Sequelize[_0x1587('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xcede=['shortinfo','inband','update','outgoing','yes','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','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','\x22\x22\x20<>','always','INTEGER','accept','originate','uac','uas','pai','fingerprint','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x43e199,_0x4ece43){var _0x2edb58=function(_0x557f3c){while(--_0x557f3c){_0x43e199['push'](_0x43e199['shift']());}};_0x2edb58(++_0x4ece43);}(_0xcede,0x1ce));var _0xeced=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xcede[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xeced('0x0'));module[_0xeced('0x1')]={'name':{'type':Sequelize[_0xeced('0x2')],'allowNull':![],'unique':_0xeced('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x5'),_0xeced('0x6'),_0xeced('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xeced('0x2')],'allowNull':![],'defaultValue':_0xeced('0x8')},'callingpres':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x9'),_0xeced('0xa'),_0xeced('0xb'),'ALLOWED',_0xeced('0xc'),_0xeced('0xd'),_0xeced('0xe'),_0xeced('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xeced('0x2')]},'secret':{'type':Sequelize[_0xeced('0x2')]},'md5secret':{'type':Sequelize[_0xeced('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xeced('0x2')],'defaultValue':'udp','set':function(_0x3419f7){this[_0xeced('0x10')](_0xeced('0x11'),_0x3419f7?_0x3419f7[_0xeced('0x12')](','):null);},'get':function(){return this[_0xeced('0x13')](_0xeced('0x11'))?this[_0xeced('0x13')](_0xeced('0x11'))[_0xeced('0x14')](','):null;},'comment':_0xeced('0x15')},'dtmfmode':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x16'),_0xeced('0x17'),_0xeced('0x18'),_0xeced('0x19'),'auto'),'defaultValue':_0xeced('0x16')},'directmedia':{'type':Sequelize[_0xeced('0x4')]('yes','no','nonat',_0xeced('0x1a'),_0xeced('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xeced('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xeced('0x1d'),'set':function(_0x16f504){this[_0xeced('0x10')](_0xeced('0x1e'),_0x16f504?_0x16f504[_0xeced('0x12')](','):null);},'get':function(){return this[_0xeced('0x13')](_0xeced('0x1e'))?this[_0xeced('0x13')](_0xeced('0x1e'))[_0xeced('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xeced('0x2')]},'pickupgroup':{'type':Sequelize[_0xeced('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xeced('0x2')]},'language':{'type':Sequelize[_0xeced('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xeced('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xeced('0x2')],'defaultValue':_0xeced('0x1f')},'allow':{'type':Sequelize[_0xeced('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2ae0b7){this[_0xeced('0x10')](_0xeced('0x20'),_0x2ae0b7?_0x2ae0b7[_0xeced('0x12')](';'):_0xeced('0x21'));},'get':function(){return this[_0xeced('0x13')](_0xeced('0x20'))?this['getDataValue'](_0xeced('0x20'))[_0xeced('0x14')](';'):null;},'comment':_0xeced('0x22')},'autoframing':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'insecure':{'type':Sequelize[_0xeced('0x2')],'defaultValue':_0xeced('0x23'),'set':function(_0x557c1c){this[_0xeced('0x10')](_0xeced('0x24'),_0x557c1c?_0x557c1c['join'](','):null);},'get':function(){return this[_0xeced('0x13')](_0xeced('0x24'))?this[_0xeced('0x13')](_0xeced('0x24'))[_0xeced('0x14')](','):null;},'comment':_0xeced('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0xeced('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xeced('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no',_0xeced('0x26'))},'promiscredir':{'type':Sequelize['ENUM'](_0xeced('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xeced('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xeced('0x27')},'amaflags':{'type':Sequelize[_0xeced('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xeced('0x1c')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0xeced('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xeced('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xeced('0x2')]},'template':{'type':Sequelize[_0xeced('0x2')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xeced('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xeced('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xeced('0x2')]},'session_timers':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x2a'),'refuse',_0xeced('0x2b'))},'session_expires':{'type':Sequelize[_0xeced('0x29')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xeced('0x2c'),_0xeced('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xeced('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xeced('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no'),'defaultValue':_0xeced('0x1c')},'keepalive':{'type':Sequelize[_0xeced('0x29')](0xb)},'defaultip':{'type':Sequelize[_0xeced('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xeced('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xeced('0x29')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xeced('0x1c'),'no',_0xeced('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xeced('0x2')]},'timert1':{'type':Sequelize[_0xeced('0x29')](0xb)},'timerb':{'type':Sequelize[_0xeced('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xeced('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xeced('0x2')]},'use_q850_reason':{'type':Sequelize[_0xeced('0x2')]},'maxforwards':{'type':Sequelize[_0xeced('0x29')](0xb)},'encryption':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0xeced('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'dtlsverify':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no',_0xeced('0x2f'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xeced('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0xeced('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xeced('0x2')]},'dtlscafile':{'type':Sequelize[_0xeced('0x2')]},'dtlscapath':{'type':Sequelize[_0xeced('0x2')]},'dtlssetup':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x30'),'passive',_0xeced('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xeced('0x2')]},'call_limit':{'type':Sequelize[_0xeced('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no')},'vmexten':{'type':Sequelize[_0xeced('0x2')]},'mohinterpret':{'type':Sequelize[_0xeced('0x2')]},'mohsuggest':{'type':Sequelize[_0xeced('0x2')]},'parkinglot':{'type':Sequelize[_0xeced('0x2')]},'description':{'type':Sequelize[_0xeced('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xeced('0x32')},'canreinvite':{'type':Sequelize[_0xeced('0x4')](_0xeced('0x1c'),'no',_0xeced('0x33'),_0xeced('0x1a'),_0xeced('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xeced('0x2')]},'otherFields':{'type':Sequelize[_0xeced('0x2')]},'active':{'type':Sequelize[_0xeced('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 49d5310..4ef399f 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 _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4b4145,_0x359c02){var _0x46433a=function(_0x2980f6){while(--_0x2980f6){_0x4b4145['push'](_0x4b4145['shift']());}};_0x46433a(++_0x359c02);}(_0x24ca,0x1bc));var _0xa24c=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x24ca[_0x274dd7];return _0x148829;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x200a48,_0x3646b1){var _0x38b343=function(_0x3a2233){while(--_0x3a2233){_0x200a48['push'](_0x200a48['shift']());}};_0x38b343(++_0x3646b1);}(_0x98a8,0x12c));var _0x898a=function(_0x295705,_0x4d4245){_0x295705=_0x295705-0x0;var _0xbe2760=_0x98a8[_0x295705];return _0xbe2760;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index fc4a715..66ed0f2 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 _0x7130=['tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','Trunk'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7130,0x1cf));var _0x0713=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x7130[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x0713('0x0'));var util=require(_0x0713('0x1'));var logger=require(_0x0713('0x2'))(_0x0713('0x3'));var moment=require(_0x0713('0x4'));var BPromise=require(_0x0713('0x5'));var rp=require(_0x0713('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0713('0x7'));var attributes=require('./trunk.attributes');module['exports']=function(_0x32b667,_0x5bbecb){return _0x32b667[_0x0713('0x8')](_0x0713('0x9'),attributes,{'tableName':_0x0713('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62c2=['api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','util','../../config/logger'];(function(_0x292d5d,_0xc51812){var _0x4354b8=function(_0xbaf819){while(--_0xbaf819){_0x292d5d['push'](_0x292d5d['shift']());}};_0x4354b8(++_0xc51812);}(_0x62c2,0x9a));var _0x262c=function(_0x199c41,_0x1796c7){_0x199c41=_0x199c41-0x0;var _0x4a5dd0=_0x62c2[_0x199c41];return _0x4a5dd0;};'use strict';var _=require('lodash');var util=require(_0x262c('0x0'));var logger=require(_0x262c('0x1'))(_0x262c('0x2'));var moment=require(_0x262c('0x3'));var BPromise=require(_0x262c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x262c('0x5'));var rimraf=require(_0x262c('0x6'));var config=require(_0x262c('0x7'));var attributes=require(_0x262c('0x8'));module[_0x262c('0x9')]=function(_0xdc51cf,_0x2dc084){return _0xdc51cf[_0x262c('0xa')](_0x262c('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index e5e28bd..14d4280 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 _0x9780=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','then','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent'];(function(_0x33b6f6,_0x3e377f){var _0x230c01=function(_0x1a8cf5){while(--_0x1a8cf5){_0x33b6f6['push'](_0x33b6f6['shift']());}};_0x230c01(++_0x3e377f);}(_0x9780,0x196));var _0x0978=function(_0x35ef7a,_0x2b3df3){_0x35ef7a=_0x35ef7a-0x0;var _0x3e1c56=_0x9780[_0x35ef7a];return _0x3e1c56;};'use strict';var _=require(_0x0978('0x0'));var util=require('util');var moment=require(_0x0978('0x1'));var BPromise=require(_0x0978('0x2'));var rs=require(_0x0978('0x3'));var fs=require('fs');var Redis=require(_0x0978('0x4'));var db=require(_0x0978('0x5'))['db'];var utils=require(_0x0978('0x6'));var logger=require(_0x0978('0x7'))(_0x0978('0x8'));var config=require('../../config/environment');var jayson=require(_0x0978('0x9'));var client=jayson[_0x0978('0xa')][_0x0978('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13581c,_0x1936c3,_0x5b7c8a){return new BPromise(function(_0x1b9454,_0x1d3c41){return client['request'](_0x13581c,_0x5b7c8a)['then'](function(_0x483e86){logger[_0x0978('0xc')]('Trunk,\x20%s,\x20%s',_0x1936c3,_0x0978('0xd'));logger[_0x0978('0xe')](_0x0978('0xf'),_0x1936c3,'request\x20sent',JSON[_0x0978('0x10')](_0x483e86));if(_0x483e86['error']){if(_0x483e86['error'][_0x0978('0x11')]===0x1f4){logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x483e86[_0x0978('0x12')][_0x0978('0x14')]);return _0x1d3c41(_0x483e86[_0x0978('0x12')]['message']);}logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x483e86[_0x0978('0x12')]['message']);return _0x1b9454(_0x483e86[_0x0978('0x12')][_0x0978('0x14')]);}else{logger[_0x0978('0xc')]('Trunk,\x20%s,\x20%s',_0x1936c3,_0x0978('0xd'));_0x1b9454(_0x483e86[_0x0978('0x15')]['message']);}})[_0x0978('0x16')](function(_0x3f396b){logger[_0x0978('0x12')](_0x0978('0x13'),_0x1936c3,_0x3f396b);_0x1d3c41(_0x3f396b);});});}exports[_0x0978('0x17')]=function(_0x15f90d){var _0x2b8b8b=this;return new Promise(function(_0x448839,_0x25bc83){return db[_0x0978('0x18')][_0x0978('0x19')]({'raw':_0x15f90d[_0x0978('0x1a')]?_0x15f90d['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f90d[_0x0978('0x1a')]?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1b')]||null:null,'attributes':_0x15f90d['options']?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1c')]||null:null,'limit':_0x15f90d['options']?_0x15f90d['options'][_0x0978('0x1d')]||null:null,'include':_0x15f90d[_0x0978('0x1a')]?_0x15f90d[_0x0978('0x1a')][_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x15f90d[_0x0978('0x1a')][_0x0978('0x1e')],function(_0x579a5d){return{'model':db[_0x579a5d[_0x0978('0x20')]],'as':_0x579a5d['as'],'attributes':_0x579a5d['attributes'],'include':_0x579a5d[_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x579a5d[_0x0978('0x1e')],function(_0x3fd8df){return{'model':db[_0x3fd8df[_0x0978('0x20')]],'as':_0x3fd8df['as'],'attributes':_0x3fd8df['attributes'],'include':_0x3fd8df[_0x0978('0x1e')]?_[_0x0978('0x1f')](_0x3fd8df[_0x0978('0x1e')],function(_0x1c563c){return{'model':db[_0x1c563c['model']],'as':_0x1c563c['as'],'attributes':_0x1c563c[_0x0978('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0978('0x21')](function(_0x25d8be){logger['info'](_0x0978('0x17'),_0x15f90d);logger[_0x0978('0xe')]('GetTrunk',_0x15f90d,JSON[_0x0978('0x10')](_0x25d8be));_0x448839(_0x25d8be);})[_0x0978('0x16')](function(_0x1de3ce){logger[_0x0978('0x12')](_0x0978('0x17'),_0x1de3ce['message'],_0x15f90d);_0x25bc83(_0x2b8b8b[_0x0978('0x12')](0x1f4,_0x1de3ce['message']));});});};exports['ShowTrunk']=function(_0x14b97f){var _0x2e649=this;return new Promise(function(_0x274933,_0x555c12){return db[_0x0978('0x18')]['find']({'raw':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1b')]||null:null,'attributes':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1c')]||null:null,'include':_0x14b97f[_0x0978('0x1a')]?_0x14b97f[_0x0978('0x1a')][_0x0978('0x1e')]?_['map'](_0x14b97f[_0x0978('0x1a')]['include'],function(_0x1d2112){return{'model':db[_0x1d2112[_0x0978('0x20')]],'as':_0x1d2112['as'],'attributes':_0x1d2112[_0x0978('0x1c')],'include':_0x1d2112[_0x0978('0x1e')]?_['map'](_0x1d2112['include'],function(_0x343cc7){return{'model':db[_0x343cc7['model']],'as':_0x343cc7['as'],'attributes':_0x343cc7[_0x0978('0x1c')],'include':_0x343cc7[_0x0978('0x1e')]?_['map'](_0x343cc7[_0x0978('0x1e')],function(_0x5ed3fd){return{'model':db[_0x5ed3fd[_0x0978('0x20')]],'as':_0x5ed3fd['as'],'attributes':_0x5ed3fd[_0x0978('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0978('0x21')](function(_0x41e600){logger[_0x0978('0xc')](_0x0978('0x22'),_0x14b97f);logger[_0x0978('0xe')]('ShowTrunk',_0x14b97f,JSON['stringify'](_0x41e600));_0x274933(_0x41e600);})[_0x0978('0x16')](function(_0x23f5fb){logger[_0x0978('0x12')](_0x0978('0x22'),_0x23f5fb['message'],_0x14b97f);_0x555c12(_0x2e649['error'](0x1f4,_0x23f5fb[_0x0978('0x14')]));});});}; \ No newline at end of file +var _0x0ad6=['result','catch','GetTrunk','Trunk','findAll','options','where','limit','include','model','attributes','map','then','ShowTrunk','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x0ad6,0x1ef));var _0x60ad=function(_0x1fefe3,_0x302099){_0x1fefe3=_0x1fefe3-0x0;var _0x52b9a3=_0x0ad6[_0x1fefe3];return _0x52b9a3;};'use strict';var _=require(_0x60ad('0x0'));var util=require('util');var moment=require(_0x60ad('0x1'));var BPromise=require(_0x60ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60ad('0x3'));var db=require(_0x60ad('0x4'))['db'];var utils=require(_0x60ad('0x5'));var logger=require(_0x60ad('0x6'))('rpc');var config=require(_0x60ad('0x7'));var jayson=require(_0x60ad('0x8'));var client=jayson['client'][_0x60ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30e19b,_0x4c890a,_0x21f230){return new BPromise(function(_0x2a5839,_0x58a5ad){return client['request'](_0x30e19b,_0x21f230)['then'](function(_0x314ee9){logger['info'](_0x60ad('0xa'),_0x4c890a,_0x60ad('0xb'));logger[_0x60ad('0xc')](_0x60ad('0xd'),_0x4c890a,_0x60ad('0xb'),JSON['stringify'](_0x314ee9));if(_0x314ee9['error']){if(_0x314ee9[_0x60ad('0xe')]['code']===0x1f4){logger[_0x60ad('0xe')](_0x60ad('0xa'),_0x4c890a,_0x314ee9[_0x60ad('0xe')][_0x60ad('0xf')]);return _0x58a5ad(_0x314ee9[_0x60ad('0xe')]['message']);}logger['error'](_0x60ad('0xa'),_0x4c890a,_0x314ee9[_0x60ad('0xe')][_0x60ad('0xf')]);return _0x2a5839(_0x314ee9[_0x60ad('0xe')][_0x60ad('0xf')]);}else{logger[_0x60ad('0x10')](_0x60ad('0xa'),_0x4c890a,'request\x20sent');_0x2a5839(_0x314ee9[_0x60ad('0x11')][_0x60ad('0xf')]);}})[_0x60ad('0x12')](function(_0x582637){logger['error'](_0x60ad('0xa'),_0x4c890a,_0x582637);_0x58a5ad(_0x582637);});});}exports[_0x60ad('0x13')]=function(_0x4aaeb4){var _0x3902e4=this;return new Promise(function(_0x5ce780,_0xfc662c){return db[_0x60ad('0x14')][_0x60ad('0x15')]({'raw':_0x4aaeb4[_0x60ad('0x16')]?_0x4aaeb4['options']['raw']===undefined?!![]:![]:!![],'where':_0x4aaeb4[_0x60ad('0x16')]?_0x4aaeb4['options'][_0x60ad('0x17')]||null:null,'attributes':_0x4aaeb4[_0x60ad('0x16')]?_0x4aaeb4['options']['attributes']||null:null,'limit':_0x4aaeb4[_0x60ad('0x16')]?_0x4aaeb4[_0x60ad('0x16')][_0x60ad('0x18')]||null:null,'include':_0x4aaeb4[_0x60ad('0x16')]?_0x4aaeb4[_0x60ad('0x16')][_0x60ad('0x19')]?_['map'](_0x4aaeb4[_0x60ad('0x16')][_0x60ad('0x19')],function(_0x305c17){return{'model':db[_0x305c17[_0x60ad('0x1a')]],'as':_0x305c17['as'],'attributes':_0x305c17[_0x60ad('0x1b')],'include':_0x305c17[_0x60ad('0x19')]?_[_0x60ad('0x1c')](_0x305c17[_0x60ad('0x19')],function(_0xff4fa6){return{'model':db[_0xff4fa6[_0x60ad('0x1a')]],'as':_0xff4fa6['as'],'attributes':_0xff4fa6[_0x60ad('0x1b')],'include':_0xff4fa6['include']?_[_0x60ad('0x1c')](_0xff4fa6[_0x60ad('0x19')],function(_0x2625da){return{'model':db[_0x2625da[_0x60ad('0x1a')]],'as':_0x2625da['as'],'attributes':_0x2625da['attributes']};}):[]};}):[]};}):[]:[]})[_0x60ad('0x1d')](function(_0x5ef2ec){logger[_0x60ad('0x10')]('GetTrunk',_0x4aaeb4);logger['debug'](_0x60ad('0x13'),_0x4aaeb4,JSON['stringify'](_0x5ef2ec));_0x5ce780(_0x5ef2ec);})['catch'](function(_0xdf3933){logger[_0x60ad('0xe')](_0x60ad('0x13'),_0xdf3933[_0x60ad('0xf')],_0x4aaeb4);_0xfc662c(_0x3902e4[_0x60ad('0xe')](0x1f4,_0xdf3933[_0x60ad('0xf')]));});});};exports[_0x60ad('0x1e')]=function(_0x481825){var _0x533f1c=this;return new Promise(function(_0x4188c1,_0x25b019){return db[_0x60ad('0x14')][_0x60ad('0x1f')]({'raw':_0x481825['options']?_0x481825[_0x60ad('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x481825[_0x60ad('0x16')]?_0x481825[_0x60ad('0x16')][_0x60ad('0x17')]||null:null,'attributes':_0x481825[_0x60ad('0x16')]?_0x481825[_0x60ad('0x16')]['attributes']||null:null,'include':_0x481825[_0x60ad('0x16')]?_0x481825[_0x60ad('0x16')]['include']?_[_0x60ad('0x1c')](_0x481825[_0x60ad('0x16')][_0x60ad('0x19')],function(_0x1f8e95){return{'model':db[_0x1f8e95[_0x60ad('0x1a')]],'as':_0x1f8e95['as'],'attributes':_0x1f8e95['attributes'],'include':_0x1f8e95[_0x60ad('0x19')]?_[_0x60ad('0x1c')](_0x1f8e95['include'],function(_0x20b1b4){return{'model':db[_0x20b1b4[_0x60ad('0x1a')]],'as':_0x20b1b4['as'],'attributes':_0x20b1b4[_0x60ad('0x1b')],'include':_0x20b1b4[_0x60ad('0x19')]?_[_0x60ad('0x1c')](_0x20b1b4[_0x60ad('0x19')],function(_0x5282c0){return{'model':db[_0x5282c0['model']],'as':_0x5282c0['as'],'attributes':_0x5282c0[_0x60ad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x60ad('0x1d')](function(_0x5874be){logger[_0x60ad('0x10')](_0x60ad('0x1e'),_0x481825);logger['debug'](_0x60ad('0x1e'),_0x481825,JSON['stringify'](_0x5874be));_0x4188c1(_0x5874be);})[_0x60ad('0x12')](function(_0x2aa176){logger[_0x60ad('0xe')](_0x60ad('0x1e'),_0x2aa176[_0x60ad('0xf')],_0x481825);_0x25b019(_0x533f1c[_0x60ad('0xe')](0x1f4,_0x2aa176['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 952b973..623ab0e 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3901=['/:id','isAuthenticated','update','exports','express','Router','./user-setting.controller','put'];(function(_0x316b5e,_0xa819a2){var _0x106a68=function(_0x27f991){while(--_0x27f991){_0x316b5e['push'](_0x316b5e['shift']());}};_0x106a68(++_0xa819a2);}(_0x3901,0xc4));var _0x1390=function(_0x2fc1e0,_0x3a77a9){_0x2fc1e0=_0x2fc1e0-0x0;var _0x2f29e7=_0x3901[_0x2fc1e0];return _0x2f29e7;};'use strict';var express=require(_0x1390('0x0'));var router=express[_0x1390('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1390('0x2'));router[_0x1390('0x3')](_0x1390('0x4'),auth[_0x1390('0x5')](),controller[_0x1390('0x6')]);module[_0x1390('0x7')]=router; \ No newline at end of file +var _0x071d=['express','Router','./user-setting.controller','/:id','isAuthenticated','update'];(function(_0x53e139,_0x1513e4){var _0x67b52f=function(_0x47bceb){while(--_0x47bceb){_0x53e139['push'](_0x53e139['shift']());}};_0x67b52f(++_0x1513e4);}(_0x071d,0x14a));var _0xd071=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x071d[_0x257b0e];return _0x27ac2a;};'use strict';var express=require(_0xd071('0x0'));var router=express[_0xd071('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd071('0x2'));router['put'](_0xd071('0x3'),auth[_0xd071('0x4')](),controller[_0xd071('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 1f27b2d..da67e33 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d0f=['ENUM','BOOLEAN','TEXT','INTEGER','UserId','sequelize','error','warning','info','exports'];(function(_0x568ae0,_0x454193){var _0x5b7f0f=function(_0x20a4a2){while(--_0x20a4a2){_0x568ae0['push'](_0x568ae0['shift']());}};_0x5b7f0f(++_0x454193);}(_0x0d0f,0x1db));var _0xf0d0=function(_0x5e80fc,_0x1fec90){_0x5e80fc=_0x5e80fc-0x0;var _0x288ab8=_0x0d0f[_0x5e80fc];return _0x288ab8;};'use strict';var Sequelize=require(_0xf0d0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf0d0('0x1'),_0xf0d0('0x2'),_0xf0d0('0x3'),'debug'];module[_0xf0d0('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf0d0('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf0d0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf0d0('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf0d0('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf0d0('0x8')],'unique':_0xf0d0('0x9')}}; \ No newline at end of file +var _0xf60f=['error','INTEGER','UserId','info','debug'];(function(_0x3e15ea,_0x475c60){var _0x2cef16=function(_0xcd885){while(--_0xcd885){_0x3e15ea['push'](_0x3e15ea['shift']());}};_0x2cef16(++_0x475c60);}(_0xf60f,0x9e));var _0xff60=function(_0x31d39b,_0x1fcb10){_0x31d39b=_0x31d39b-0x0;var _0x4ad091=_0xf60f[_0x31d39b];return _0x4ad091;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0xff60('0x0'),_0xff60('0x1')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xff60('0x2'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xff60('0x3')],'unique':_0xff60('0x4')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 3432df4..67bff34 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['register','defaults','localhost','status','json','update','stack','name','send','user','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','catch','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket'];(function(_0x57182a,_0x1f0016){var _0x4fddc6=function(_0x20e83c){while(--_0x20e83c){_0x57182a['push'](_0x57182a['shift']());}};_0x4fddc6(++_0x1f0016);}(_0x7217,0xa9));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x7721('0x0'))('api');var config=require(_0x7721('0x1'));var db=require(_0x7721('0x2'))['db'];var socket=require(_0x7721('0x3'))(new Redis(config[_0x7721('0x4')]));require(_0x7721('0x5'))[_0x7721('0x6')](socket);config[_0x7721('0x4')]=_[_0x7721('0x7')](config[_0x7721('0x4')],{'host':_0x7721('0x8'),'port':0x18eb});function respondWithResult(_0x560535,_0x45f1fa){_0x45f1fa=_0x45f1fa||0xc8;return function(_0x2ddbba){if(_0x2ddbba){return _0x560535[_0x7721('0x9')](_0x45f1fa)[_0x7721('0xa')](_0x2ddbba);}};}function saveUpdates(_0x5c609c){return function(_0x26a6e0){if(_0x26a6e0){return _0x26a6e0[_0x7721('0xb')](_0x5c609c)['then'](function(_0x938a36){return _0x938a36;});}return null;};}function handleEntityNotFound(_0x2d6e8d){return function(_0x3d73a3){if(!_0x3d73a3){_0x2d6e8d['sendStatus'](0x194);}return _0x3d73a3;};}function handleError(_0x72662d,_0x6ae385){_0x6ae385=_0x6ae385||0x1f4;return function(_0x199bae){logger['error'](_0x199bae[_0x7721('0xc')]);if(_0x199bae[_0x7721('0xd')]){delete _0x199bae['name'];}_0x72662d[_0x7721('0x9')](_0x6ae385)[_0x7721('0xe')](_0x199bae);};}exports['update']=function(_0x1c2545,_0x34bb02){if(_0x1c2545[_0x7721('0xf')][_0x7721('0x10')]!==_0x7721('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x1c2545[_0x7721('0x12')]['id'])))throw new Error(_0x7721('0x13'));return db[_0x7721('0x14')][_0x7721('0x15')]({'where':{'id':_0x1c2545['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x34bb02,null))['then'](saveUpdates(_0x1c2545[_0x7721('0x17')],null))['then'](respondWithResult(_0x34bb02,null))[_0x7721('0x18')](handleError(_0x34bb02,null));}; \ No newline at end of file +var _0x3d15=['../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','localhost','status','sendStatus','error','stack','name','send','update','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','catch','ioredis','../../config/logger'];(function(_0x2641d8,_0x5ed7b4){var _0x1bf395=function(_0x26e58e){while(--_0x26e58e){_0x2641d8['push'](_0x2641d8['shift']());}};_0x1bf395(++_0x5ed7b4);}(_0x3d15,0x127));var _0x53d1=function(_0x357fca,_0x26e179){_0x357fca=_0x357fca-0x0;var _0x58897e=_0x3d15[_0x357fca];return _0x58897e;};'use strict';var _=require('lodash');var Redis=require(_0x53d1('0x0'));var logger=require(_0x53d1('0x1'))('api');var config=require(_0x53d1('0x2'));var db=require(_0x53d1('0x3'))['db'];var socket=require(_0x53d1('0x4'))(new Redis(config['redis']));require(_0x53d1('0x5'))[_0x53d1('0x6')](socket);config[_0x53d1('0x7')]=_['defaults'](config[_0x53d1('0x7')],{'host':_0x53d1('0x8'),'port':0x18eb});function respondWithResult(_0x4b4385,_0x8abe67){_0x8abe67=_0x8abe67||0xc8;return function(_0x32dfe1){if(_0x32dfe1){return _0x4b4385[_0x53d1('0x9')](_0x8abe67)['json'](_0x32dfe1);}};}function saveUpdates(_0x328eb3){return function(_0x38a208){if(_0x38a208){return _0x38a208['update'](_0x328eb3)['then'](function(_0x309b9c){return _0x309b9c;});}return null;};}function handleEntityNotFound(_0x4a93e8){return function(_0x110035){if(!_0x110035){_0x4a93e8[_0x53d1('0xa')](0x194);}return _0x110035;};}function handleError(_0x24058e,_0x182f7d){_0x182f7d=_0x182f7d||0x1f4;return function(_0x22d8d7){logger[_0x53d1('0xb')](_0x22d8d7[_0x53d1('0xc')]);if(_0x22d8d7[_0x53d1('0xd')]){delete _0x22d8d7['name'];}_0x24058e[_0x53d1('0x9')](_0x182f7d)[_0x53d1('0xe')](_0x22d8d7);};}exports[_0x53d1('0xf')]=function(_0x18ed44,_0xfa18c){if(_0x18ed44[_0x53d1('0x10')][_0x53d1('0x11')]!==_0x53d1('0x12'))throw new Error(_0x53d1('0x13'));if(isNaN(Number(_0x18ed44[_0x53d1('0x14')]['id'])))throw new Error(_0x53d1('0x15'));return db[_0x53d1('0x16')][_0x53d1('0x17')]({'where':{'id':_0x18ed44['params']['id']}})[_0x53d1('0x18')](handleEntityNotFound(_0xfa18c,null))[_0x53d1('0x18')](saveUpdates(_0x18ed44[_0x53d1('0x19')],null))['then'](respondWithResult(_0xfa18c,null))[_0x53d1('0x1a')](handleError(_0xfa18c,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 068af0e..cf2f4fe 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7038=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x7038,0x160));var _0x8703=function(_0x255b66,_0x3d8084){_0x255b66=_0x255b66-0x0;var _0x49ad98=_0x7038[_0x255b66];return _0x49ad98;};'use strict';var EventEmitter=require(_0x8703('0x0'));var UserSetting=require(_0x8703('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8703('0x2')](0x0);var events={'afterCreate':_0x8703('0x3'),'afterUpdate':_0x8703('0x4'),'afterDestroy':_0x8703('0x5')};function emitEvent(_0x13a362){return function(_0x56874c,_0x576e3d,_0x201608){UserSettingEvents[_0x8703('0x6')](_0x13a362+':'+_0x56874c['id'],_0x56874c);UserSettingEvents[_0x8703('0x6')](_0x13a362,_0x56874c);_0x201608(null);};}for(var e in events){if(events[_0x8703('0x7')](e)){var event=events[e];UserSetting[_0x8703('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xdb51=['hasOwnProperty','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb51,0x7a));var _0x1db5=function(_0x2d8ddc,_0x35b941){_0x2d8ddc=_0x2d8ddc-0x0;var _0x5c7a4a=_0xdb51[_0x2d8ddc];return _0x5c7a4a;};'use strict';var EventEmitter=require(_0x1db5('0x0'));var UserSetting=require(_0x1db5('0x1'))['db'][_0x1db5('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1db5('0x3')](0x0);var events={'afterCreate':_0x1db5('0x4'),'afterUpdate':_0x1db5('0x5'),'afterDestroy':_0x1db5('0x6')};function emitEvent(_0x2a94a6){return function(_0x1374d9,_0x212ea6,_0x3a5ec9){UserSettingEvents[_0x1db5('0x7')](_0x2a94a6+':'+_0x1374d9['id'],_0x1374d9);UserSettingEvents[_0x1db5('0x7')](_0x2a94a6,_0x1374d9);_0x3a5ec9(null);};}for(var e in events){if(events[_0x1db5('0x8')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x1db5('0x9')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index a8056f1..73885ff 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3715=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x3b7184,_0x53297b){var _0x3ef45e=function(_0x3c780e){while(--_0x3c780e){_0x3b7184['push'](_0x3b7184['shift']());}};_0x3ef45e(++_0x53297b);}(_0x3715,0xc3));var _0x5371=function(_0x328711,_0x1e608a){_0x328711=_0x328711-0x0;var _0x52c05f=_0x3715[_0x328711];return _0x52c05f;};'use strict';var attributes=require(_0x5371('0x0'));module[_0x5371('0x1')]=function(_0x7a44a0){return _0x7a44a0[_0x5371('0x2')](_0x5371('0x3'),attributes,{'tableName':_0x5371('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x132ef3){if(!_0x132ef3[_0x5371('0x5')])_0x132ef3[_0x5371('0x6')]=null;else if(_0x132ef3[_0x5371('0x6')]===null)_0x132ef3[_0x5371('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x8e44=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0x8e44,0x1ac));var _0x48e4=function(_0x4e859c,_0xc2b230){_0x4e859c=_0x4e859c-0x0;var _0x3b571d=_0x8e44[_0x4e859c];return _0x3b571d;};'use strict';var attributes=require(_0x48e4('0x0'));module[_0x48e4('0x1')]=function(_0xb82c83){return _0xb82c83['define']('UserSetting',attributes,{'tableName':_0x48e4('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30d851){if(!_0x30d851[_0x48e4('0x3')])_0x30d851[_0x48e4('0x4')]=null;else if(_0x30d851['clientSideLoggingEnabledSince']===null)_0x30d851[_0x48e4('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 19c42dd..efb042a 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6719=['UserId','register','length','user-setting:','./user-setting.events','save','remove','update','user-setting:update','emit','user-setting:update:user-'];(function(_0x596033,_0x488f80){var _0x5194da=function(_0x4a45e9){while(--_0x4a45e9){_0x596033['push'](_0x596033['shift']());}};_0x5194da(++_0x488f80);}(_0x6719,0xf6));var _0x9671=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x6719[_0x420f2a];return _0x28f802;};'use strict';var UserSettingEvents=require(_0x9671('0x0'));var events=[_0x9671('0x1'),_0x9671('0x2'),_0x9671('0x3')];function createListener(_0x5e9f5f,_0x5bfdaa){return function(_0x21653c){_0x5bfdaa['emit'](_0x5e9f5f,_0x21653c);if(_0x5e9f5f===_0x9671('0x4')){_0x5bfdaa[_0x9671('0x5')](_0x9671('0x6')+_0x21653c[_0x9671('0x7')],_0x21653c);}};}exports[_0x9671('0x8')]=function(_0x5e536c){for(var _0x3674c2=0x0,_0x57bb95=events[_0x9671('0x9')];_0x3674c2<_0x57bb95;_0x3674c2++){var _0x9054ed=events[_0x3674c2];var _0x5388d3=createListener(_0x9671('0xa')+_0x9054ed,_0x5e536c);UserSettingEvents['on'](_0x9054ed,_0x5388d3);}}; \ No newline at end of file +var _0x0565=['save','remove','update','emit','user-setting:update','UserId','register','user-setting:','./user-setting.events'];(function(_0x3255ec,_0x2fdf7f){var _0x4e888d=function(_0x5066b9){while(--_0x5066b9){_0x3255ec['push'](_0x3255ec['shift']());}};_0x4e888d(++_0x2fdf7f);}(_0x0565,0xf2));var _0x5056=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x0565[_0x166d93];return _0xba708;};'use strict';var UserSettingEvents=require(_0x5056('0x0'));var events=[_0x5056('0x1'),_0x5056('0x2'),_0x5056('0x3')];function createListener(_0x354d5d,_0x397289){return function(_0xd4624d){_0x397289[_0x5056('0x4')](_0x354d5d,_0xd4624d);if(_0x354d5d===_0x5056('0x5')){_0x397289[_0x5056('0x4')]('user-setting:update:user-'+_0xd4624d[_0x5056('0x6')],_0xd4624d);}};}exports[_0x5056('0x7')]=function(_0x1143df){for(var _0x22afb7=0x0,_0x4b8280=events['length'];_0x22afb7<_0x4b8280;_0x22afb7++){var _0x38f74=events[_0x22afb7];var _0x223c92=createListener(_0x5056('0x8')+_0x38f74,_0x1143df);UserSettingEvents['on'](_0x38f74,_0x223c92);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0531eaf..2602e68 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 _0x2f5f=['index','/describe','describe','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','now','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','put','/:id/password','/:id/queues','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated'];(function(_0x26d7a1,_0x340669){var _0x339bdf=function(_0x30abe9){while(--_0x30abe9){_0x26d7a1['push'](_0x26d7a1['shift']());}};_0x339bdf(++_0x340669);}(_0x2f5f,0x65));var _0xf2f5=function(_0x3054a4,_0x2a270b){_0x3054a4=_0x3054a4-0x0;var _0x11292d=_0x2f5f[_0x3054a4];return _0x11292d;};'use strict';var multer=require('multer');var util=require(_0xf2f5('0x0'));var path=require('path');var timeout=require(_0xf2f5('0x1'));var express=require(_0xf2f5('0x2'));var router=express[_0xf2f5('0x3')]();var fs_extra=require(_0xf2f5('0x4'));var auth=require(_0xf2f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf2f5('0x6'));var controller=require(_0xf2f5('0x7'));router[_0xf2f5('0x8')]('/',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0xa')]);router[_0xf2f5('0x8')](_0xf2f5('0xb'),auth['isAuthenticated'](),controller[_0xf2f5('0xc')]);router[_0xf2f5('0x8')]('/whoami',auth[_0xf2f5('0x9')](),controller['whoami']);router[_0xf2f5('0x8')](_0xf2f5('0xd'),auth['isAuthenticated'](),controller[_0xf2f5('0xe')]);router['get'](_0xf2f5('0xf'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x10')]);router[_0xf2f5('0x8')](_0xf2f5('0x11'),controller[_0xf2f5('0x12')]);router[_0xf2f5('0x8')](_0xf2f5('0x13'),auth[_0xf2f5('0x9')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0xf2f5('0x14')]);router[_0xf2f5('0x8')]('/:id/queues',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x15')]);router[_0xf2f5('0x8')](_0xf2f5('0x16'),auth['isAuthenticated'](),controller[_0xf2f5('0x17')]);router[_0xf2f5('0x8')]('/:id/groups',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x18')]);router['get']('/:id/recordings',auth['isAuthenticated'](),controller[_0xf2f5('0x19')]);router[_0xf2f5('0x8')](_0xf2f5('0x1a'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0xf2f5('0x1b'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x1c')]);router[_0xf2f5('0x8')](_0xf2f5('0x1d'),auth['isAuthenticated'](),controller[_0xf2f5('0x1e')]);router[_0xf2f5('0x8')]('/:id/mail/interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x1f')]);router[_0xf2f5('0x8')]('/:id/sms/interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x20')]);router[_0xf2f5('0x8')](_0xf2f5('0x21'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x22')]);router[_0xf2f5('0x8')]('/:id/whatsapp/interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x23')]);router[_0xf2f5('0x8')](_0xf2f5('0x24'),auth[_0xf2f5('0x9')](),controller['getTeams']);router[_0xf2f5('0x8')](_0xf2f5('0x25'),auth[_0xf2f5('0x9')](),controller['getLists']);router[_0xf2f5('0x8')](_0xf2f5('0x26'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x27')]);router[_0xf2f5('0x8')]('/:id/prefixes',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x28')]);router[_0xf2f5('0x8')](_0xf2f5('0x29'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x2a')]);router[_0xf2f5('0x8')](_0xf2f5('0x2b'),auth['isAuthenticated'](),controller[_0xf2f5('0x2c')]);router[_0xf2f5('0x8')]('/:id/openchannel_accounts',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x2d')]);router['get'](_0xf2f5('0x2e'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x2f')]);router[_0xf2f5('0x8')]('/:id/chat_websites',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x30')]);router[_0xf2f5('0x8')]('/:id/whatsapp_accounts',auth[_0xf2f5('0x9')](),controller['getWhatsappAccounts']);router[_0xf2f5('0x8')](_0xf2f5('0x31'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x32')]);router[_0xf2f5('0x8')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0xf2f5('0x33')]);router[_0xf2f5('0x8')](_0xf2f5('0x34'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x35')]);router[_0xf2f5('0x36')](_0xf2f5('0x37'),auth['isAuthenticated'](),controller['addContacts']);router[_0xf2f5('0x36')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf2f5('0x36')]('/create_many',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x38')]);router[_0xf2f5('0x36')]('/:id/queues',auth['isAuthenticated'](),controller[_0xf2f5('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36bfa3,_0x1e9522,_0x4b5a39){_0x4b5a39(null,path[_0xf2f5('0x3a')](config[_0xf2f5('0x3b')],_0xf2f5('0x3c')));},'filename':function(_0x204d78,_0x5b3ea5,_0x2a3e15){_0x2a3e15(null,util[_0xf2f5('0x3d')](_0xf2f5('0x3e'),Date[_0xf2f5('0x3f')](),_0x5b3ea5['originalname']));}})});router['post'](_0xf2f5('0x11'),upload['single']('file'),controller['addAvatar']);router[_0xf2f5('0x36')](_0xf2f5('0x40'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x41')]);router[_0xf2f5('0x36')](_0xf2f5('0x42'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x43')]);router[_0xf2f5('0x36')](_0xf2f5('0x44'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x45')]);router[_0xf2f5('0x36')]('/:id/unpause',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x46')]);router[_0xf2f5('0x36')]('/:id/teams',auth[_0xf2f5('0x9')](),controller['addTeams']);router[_0xf2f5('0x36')]('/:id/chat_interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x47')]);router[_0xf2f5('0x36')](_0xf2f5('0x48'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x49')]);router[_0xf2f5('0x36')](_0xf2f5('0x4a'),auth['isAuthenticated'](),controller[_0xf2f5('0x4b')]);router['post']('/:id/sms_interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x4c')]);router[_0xf2f5('0x36')](_0xf2f5('0x4d'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x4e')]);router[_0xf2f5('0x36')]('/:id/whatsapp_interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x4f')]);router[_0xf2f5('0x36')](_0xf2f5('0x29'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x50')]);router[_0xf2f5('0x36')](_0xf2f5('0x2b'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x51')]);router[_0xf2f5('0x36')]('/:id/openchannel_accounts',auth[_0xf2f5('0x9')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xf2f5('0x52')]);router[_0xf2f5('0x36')](_0xf2f5('0x53'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x54')]);router['post'](_0xf2f5('0x55'),auth['isAuthenticated'](),controller[_0xf2f5('0x56')]);router[_0xf2f5('0x36')](_0xf2f5('0x31'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x57')]);router[_0xf2f5('0x36')](_0xf2f5('0x34'),auth['isAuthenticated'](),controller['createApiKey']);router[_0xf2f5('0x58')](_0xf2f5('0xf'),auth[_0xf2f5('0x9')](),controller['update']);router[_0xf2f5('0x58')](_0xf2f5('0x59'),auth[_0xf2f5('0x9')](),controller['changePassword']);router['delete'](_0xf2f5('0x5a'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x5b')]);router[_0xf2f5('0x5c')](_0xf2f5('0x24'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x5d')]);router[_0xf2f5('0x5c')](_0xf2f5('0xf'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x5e')]);router[_0xf2f5('0x5c')](_0xf2f5('0x5f'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x60')]);router[_0xf2f5('0x5c')]('/:id/mail_interactions',auth[_0xf2f5('0x9')](),controller['removeMailInteractions']);router['delete'](_0xf2f5('0x4a'),auth['isAuthenticated'](),controller[_0xf2f5('0x61')]);router[_0xf2f5('0x5c')]('/:id/sms_interactions',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x62')]);router[_0xf2f5('0x5c')](_0xf2f5('0x4d'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x63')]);router[_0xf2f5('0x5c')](_0xf2f5('0x64'),auth[_0xf2f5('0x9')](),controller['removeWhatsappInteractions']);router[_0xf2f5('0x5c')](_0xf2f5('0x29'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x65')]);router[_0xf2f5('0x5c')](_0xf2f5('0x2b'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x66')]);router[_0xf2f5('0x5c')](_0xf2f5('0x67'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x68')]);router[_0xf2f5('0x5c')]('/:id/sms_accounts',auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x69')]);router[_0xf2f5('0x5c')](_0xf2f5('0x53'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x6a')]);router['delete'](_0xf2f5('0x55'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x6b')]);router[_0xf2f5('0x5c')](_0xf2f5('0x31'),auth[_0xf2f5('0x9')](),controller[_0xf2f5('0x6c')]);router['delete'](_0xf2f5('0x34'),auth['isAuthenticated'](),controller[_0xf2f5('0x6d')]);module[_0xf2f5('0x6e')]=router; \ No newline at end of file +var _0x1046=['login','/:id/logout','pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeSquareProjects','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','getPresence','/:id','/:id/avatar','getAvatar','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','%s-%s','originalname','file','addAvatar'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1046,0x1ee));var _0x6104=function(_0x40876a,_0x5239bd){_0x40876a=_0x40876a-0x0;var _0x9d473e=_0x1046[_0x40876a];return _0x9d473e;};'use strict';var multer=require(_0x6104('0x0'));var util=require(_0x6104('0x1'));var path=require('path');var timeout=require(_0x6104('0x2'));var express=require('express');var router=express[_0x6104('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6104('0x4'));var config=require(_0x6104('0x5'));var controller=require(_0x6104('0x6'));router[_0x6104('0x7')]('/',auth[_0x6104('0x8')](),controller[_0x6104('0x9')]);router[_0x6104('0x7')](_0x6104('0xa'),auth[_0x6104('0x8')](),controller[_0x6104('0xb')]);router['get']('/whoami',auth['isAuthenticated'](),controller['whoami']);router['get'](_0x6104('0xc'),auth[_0x6104('0x8')](),controller[_0x6104('0xd')]);router['get'](_0x6104('0xe'),auth[_0x6104('0x8')](),controller['show']);router[_0x6104('0x7')](_0x6104('0xf'),controller[_0x6104('0x10')]);router['get']('/:id/open_tabs',auth[_0x6104('0x8')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x6104('0x8')](),controller[_0x6104('0x11')]);router[_0x6104('0x7')]('/:id/queues',auth[_0x6104('0x8')](),controller[_0x6104('0x12')]);router[_0x6104('0x7')]('/:id/queues_rt',auth[_0x6104('0x8')](),controller[_0x6104('0x13')]);router['get'](_0x6104('0x14'),auth[_0x6104('0x8')](),controller[_0x6104('0x15')]);router[_0x6104('0x7')](_0x6104('0x16'),auth[_0x6104('0x8')](),controller[_0x6104('0x17')]);router[_0x6104('0x7')](_0x6104('0x18'),auth[_0x6104('0x8')](),controller['getScreenRecordings']);router['get'](_0x6104('0x19'),auth[_0x6104('0x8')](),controller[_0x6104('0x1a')]);router['get'](_0x6104('0x1b'),auth['isAuthenticated'](),controller[_0x6104('0x1c')]);router[_0x6104('0x7')](_0x6104('0x1d'),auth[_0x6104('0x8')](),controller[_0x6104('0x1e')]);router[_0x6104('0x7')](_0x6104('0x1f'),auth[_0x6104('0x8')](),controller[_0x6104('0x20')]);router['get']('/:id/fax/interactions',auth[_0x6104('0x8')](),controller[_0x6104('0x21')]);router[_0x6104('0x7')](_0x6104('0x22'),auth['isAuthenticated'](),controller[_0x6104('0x23')]);router[_0x6104('0x7')]('/:id/teams',auth[_0x6104('0x8')](),controller[_0x6104('0x24')]);router[_0x6104('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0x6104('0x25')]);router[_0x6104('0x7')](_0x6104('0x26'),auth[_0x6104('0x8')](),controller[_0x6104('0x27')]);router[_0x6104('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x6104('0x28')]);router['get']('/:id/fax_accounts',auth[_0x6104('0x8')](),controller['getFaxAccounts']);router[_0x6104('0x7')](_0x6104('0x29'),auth[_0x6104('0x8')](),controller['getMailAccounts']);router[_0x6104('0x7')](_0x6104('0x2a'),auth['isAuthenticated'](),controller[_0x6104('0x2b')]);router[_0x6104('0x7')](_0x6104('0x2c'),auth[_0x6104('0x8')](),controller[_0x6104('0x2d')]);router[_0x6104('0x7')]('/:id/chat_websites',auth[_0x6104('0x8')](),controller['getChatWebsites']);router['get'](_0x6104('0x2e'),auth[_0x6104('0x8')](),controller[_0x6104('0x2f')]);router[_0x6104('0x7')](_0x6104('0x30'),auth[_0x6104('0x8')](),controller['getSquareProjects']);router[_0x6104('0x7')](_0x6104('0x31'),auth[_0x6104('0x8')](),controller[_0x6104('0x32')]);router[_0x6104('0x7')]('/:id/api_key',auth[_0x6104('0x8')](),controller[_0x6104('0x33')]);router[_0x6104('0x34')](_0x6104('0x35'),auth[_0x6104('0x8')](),controller[_0x6104('0x36')]);router[_0x6104('0x34')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6104('0x34')]('/create_many',auth[_0x6104('0x8')](),controller[_0x6104('0x37')]);router['post'](_0x6104('0x38'),auth[_0x6104('0x8')](),controller[_0x6104('0x39')]);var upload=multer({'storage':multer[_0x6104('0x3a')]({'destination':function(_0x4a1064,_0x22865a,_0x308b7f){_0x308b7f(null,path[_0x6104('0x3b')](config[_0x6104('0x3c')],_0x6104('0x3d')));},'filename':function(_0xf22481,_0x20a5c8,_0x52101e){_0x52101e(null,util['format'](_0x6104('0x3e'),Date['now'](),_0x20a5c8[_0x6104('0x3f')]));}})});router[_0x6104('0x34')]('/:id/avatar',upload['single'](_0x6104('0x40')),controller[_0x6104('0x41')]);router[_0x6104('0x34')]('/:id/login',auth[_0x6104('0x8')](),controller[_0x6104('0x42')]);router[_0x6104('0x34')](_0x6104('0x43'),auth[_0x6104('0x8')](),controller['logout']);router['post']('/:id/pause',auth[_0x6104('0x8')](),controller[_0x6104('0x44')]);router['post'](_0x6104('0x45'),auth[_0x6104('0x8')](),controller[_0x6104('0x46')]);router[_0x6104('0x34')](_0x6104('0x47'),auth[_0x6104('0x8')](),controller[_0x6104('0x48')]);router['post']('/:id/chat_interactions',auth[_0x6104('0x8')](),controller[_0x6104('0x49')]);router[_0x6104('0x34')](_0x6104('0x4a'),auth[_0x6104('0x8')](),controller[_0x6104('0x4b')]);router[_0x6104('0x34')]('/:id/fax_interactions',auth[_0x6104('0x8')](),controller[_0x6104('0x4c')]);router[_0x6104('0x34')](_0x6104('0x4d'),auth[_0x6104('0x8')](),controller[_0x6104('0x4e')]);router['post'](_0x6104('0x4f'),auth[_0x6104('0x8')](),controller['addOpenchannelInteractions']);router['post'](_0x6104('0x50'),auth[_0x6104('0x8')](),controller[_0x6104('0x51')]);router[_0x6104('0x34')](_0x6104('0x52'),auth[_0x6104('0x8')](),controller[_0x6104('0x53')]);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x6104('0x34')]('/:id/openchannel_accounts',auth[_0x6104('0x8')](),controller[_0x6104('0x54')]);router[_0x6104('0x34')](_0x6104('0x2c'),auth[_0x6104('0x8')](),controller[_0x6104('0x55')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x6104('0x56')]);router[_0x6104('0x34')](_0x6104('0x2e'),auth[_0x6104('0x8')](),controller[_0x6104('0x57')]);router[_0x6104('0x34')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x6104('0x58')]);router[_0x6104('0x34')](_0x6104('0x59'),auth['isAuthenticated'](),controller[_0x6104('0x5a')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['put'](_0x6104('0x5b'),auth['isAuthenticated'](),controller[_0x6104('0x5c')]);router[_0x6104('0x5d')](_0x6104('0x38'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x6104('0x5d')](_0x6104('0x47'),auth['isAuthenticated'](),controller[_0x6104('0x5e')]);router['delete'](_0x6104('0xe'),auth[_0x6104('0x8')](),controller[_0x6104('0x5f')]);router['delete'](_0x6104('0x60'),auth['isAuthenticated'](),controller[_0x6104('0x61')]);router[_0x6104('0x5d')](_0x6104('0x4a'),auth['isAuthenticated'](),controller[_0x6104('0x62')]);router[_0x6104('0x5d')](_0x6104('0x63'),auth[_0x6104('0x8')](),controller[_0x6104('0x64')]);router[_0x6104('0x5d')](_0x6104('0x4d'),auth[_0x6104('0x8')](),controller[_0x6104('0x65')]);router[_0x6104('0x5d')](_0x6104('0x4f'),auth[_0x6104('0x8')](),controller[_0x6104('0x66')]);router['delete']('/:id/whatsapp_interactions',auth[_0x6104('0x8')](),controller[_0x6104('0x67')]);router[_0x6104('0x5d')](_0x6104('0x52'),auth[_0x6104('0x8')](),controller[_0x6104('0x68')]);router[_0x6104('0x5d')](_0x6104('0x29'),auth[_0x6104('0x8')](),controller[_0x6104('0x69')]);router[_0x6104('0x5d')](_0x6104('0x2a'),auth[_0x6104('0x8')](),controller[_0x6104('0x6a')]);router[_0x6104('0x5d')](_0x6104('0x2c'),auth[_0x6104('0x8')](),controller[_0x6104('0x6b')]);router['delete'](_0x6104('0x6c'),auth[_0x6104('0x8')](),controller[_0x6104('0x6d')]);router[_0x6104('0x5d')](_0x6104('0x2e'),auth[_0x6104('0x8')](),controller['removeWhatsappAccounts']);router[_0x6104('0x5d')](_0x6104('0x30'),auth[_0x6104('0x8')](),controller[_0x6104('0x6e')]);router['delete'](_0x6104('0x59'),auth[_0x6104('0x8')](),controller['removeApiKey']);module[_0x6104('0x6f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 038a02c..476484d 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 _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x2fb531,_0xdb0c4e){var _0x1ad0bc=function(_0x2abb07){while(--_0x2abb07){_0x2fb531['push'](_0x2fb531['shift']());}};_0x1ad0bc(++_0xdb0c4e);}(_0x008c,0x188));var _0xc008=function(_0x3025e0,_0xf2c52d){_0x3025e0=_0x3025e0-0x0;var _0x4ee7c5=_0x008c[_0x3025e0];return _0x4ee7c5;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x1af1a1,_0x16c4fe){var _0x105874=function(_0x316738){while(--_0x316738){_0x1af1a1['push'](_0x1af1a1['shift']());}};_0x105874(++_0x16c4fe);}(_0x008c,0x188));var _0xc008=function(_0x3f4ba6,_0x133cd6){_0x3f4ba6=_0x3f4ba6-0x0;var _0x4fa5a3=_0x008c[_0x3f4ba6];return _0x4fa5a3;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 1e5783b..6662a1e 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 _0xd953=['spread','capitalize','QueueId','Queue:save','VoiceQueue','voice','online','interface','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','openchannel','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tags','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','loginInPause','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','forEach','device','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','resolve','User\x20with\x20id\x20%s\x20not\x20found','transaction','flattenDeep','addAgent','Voice','voicePause','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','getDataValue','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','addSmsInteractions','removeSmsInteractions','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$lt','$lte','$ne','$not','$in','$notIn','$notLike','$contains','$contained','$any','lastName','Contact','dialActive','CmHopper','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','flatten','col','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','toString','OpenTabs','bluebird','util','path','lodash','squel','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','handleError','socket.io-emitter','register','redis','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','emit','userNotification:recalc:','destroy','get','admin','Users','Agents','agent','Telephones','telephone','filter','map','value','includes','role','find','name','UserProfileResource','sendStatus','stack','send','index','rawAttributes','fieldName','type','key','salt','getOptions','where','includeAll','query','userSetting','true','include','UserSetting','attributes','User','findAll','openTabs','push','rows','dataValues','fax','mail','whatsapp','all','show','params','model','keys','filters','intersection','fields','length','merge','options','chat','sms','update','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','password','max','isNil','internal','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','103','113','104','106','107','108','100','111','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','userProfileId','UserProfileSection','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','channel','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty'];(function(_0x3dce36,_0xf5a5fe){var _0x281cb4=function(_0x58754d){while(--_0x58754d){_0x3dce36['push'](_0x3dce36['shift']());}};_0x281cb4(++_0xf5a5fe);}(_0xd953,0xe6));var _0x3d95=function(_0x3c07f8,_0x55082f){_0x3c07f8=_0x3c07f8-0x0;var _0x139006=_0xd953[_0x3c07f8];return _0x139006;};'use strict';var moment=require('moment');var BPromise=require(_0x3d95('0x0'));var util=require(_0x3d95('0x1'));var path=require(_0x3d95('0x2'));var fs=require('fs');var _=require(_0x3d95('0x3'));var squel=require(_0x3d95('0x4'));var jayson=require(_0x3d95('0x5'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d95('0x6'));var logger=require(_0x3d95('0x7'))(_0x3d95('0x8'));var utils=require(_0x3d95('0x9'));var config=require(_0x3d95('0xa'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x3d95('0xb'))[_0x3d95('0xc')];var APINotFoundError=require(_0x3d95('0xb'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x3d95('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x3d95('0xe'))(new Redis(config['redis']));require('./user.socket')[_0x3d95('0xf')](socket);config[_0x3d95('0x10')]=_[_0x3d95('0x11')](config[_0x3d95('0x10')],{'host':_0x3d95('0x12'),'port':0x18eb});var client=jayson[_0x3d95('0x13')][_0x3d95('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x261843,_0x56be2a,_0x43a928,_0x4709f9){return new BPromise(function(_0x16ee7a,_0xd06c86){var _0x64fd05=_0x4709f9||client;return _0x64fd05[_0x3d95('0x15')](_0x261843,_0x43a928)[_0x3d95('0x16')](function(_0x1d4f2a){logger[_0x3d95('0x17')](_0x3d95('0x18'),_0x56be2a,_0x3d95('0x19'));logger['debug'](_0x3d95('0x1a'),_0x56be2a,'request\x20sent',JSON[_0x3d95('0x1b')](_0x1d4f2a));if(_0x1d4f2a[_0x3d95('0x1c')]){if(_0x1d4f2a[_0x3d95('0x1c')][_0x3d95('0x1d')]===0x1f4){logger[_0x3d95('0x1c')]('User,\x20%s,\x20%s',_0x56be2a,_0x1d4f2a[_0x3d95('0x1c')][_0x3d95('0x1e')]);return _0xd06c86(_0x1d4f2a[_0x3d95('0x1c')]['message']);}logger[_0x3d95('0x1c')]('User,\x20%s,\x20%s',_0x56be2a,_0x1d4f2a[_0x3d95('0x1c')][_0x3d95('0x1e')]);return _0x16ee7a(_0x1d4f2a['error'][_0x3d95('0x1e')]);}else{logger['info'](_0x3d95('0x18'),_0x56be2a,'request\x20sent');_0x16ee7a(_0x1d4f2a[_0x3d95('0x1f')][_0x3d95('0x1e')]);}})[_0x3d95('0x20')](function(_0x263e7c){logger[_0x3d95('0x1c')](_0x3d95('0x18'),_0x56be2a,_0x263e7c);_0xd06c86(_0x263e7c);});});}function respondWithStatusCode(_0x4e29b9,_0x16f6cd){_0x16f6cd=_0x16f6cd||0xcc;return function(_0x14d5ce){if(_0x14d5ce){return _0x4e29b9['sendStatus'](_0x16f6cd);}return _0x4e29b9[_0x3d95('0x21')](_0x16f6cd)[_0x3d95('0x22')]();};}function respondWithResult(_0x2e13d8,_0x8780b5){_0x8780b5=_0x8780b5||0xc8;return function(_0xce3919){if(_0xce3919){return _0x2e13d8['status'](_0x8780b5)[_0x3d95('0x23')](_0xce3919);}};}function respondWithFilteredResult(_0x270418,_0x426135){return function(_0x57b176){if(_0x57b176){var _0x83a74e=typeof _0x426135[_0x3d95('0x24')]===_0x3d95('0x25')&&typeof _0x426135[_0x3d95('0x26')]===_0x3d95('0x25');var _0x14c261=_0x57b176[_0x3d95('0x27')];var _0x5611c5=_0x83a74e?0x0:_0x426135[_0x3d95('0x24')];var _0x3d7195=_0x83a74e?_0x57b176[_0x3d95('0x27')]:_0x426135[_0x3d95('0x24')]+_0x426135['limit'];var _0x59063c;if(_0x3d7195>=_0x14c261){_0x3d7195=_0x14c261;_0x59063c=0xc8;}else{_0x59063c=0xce;}_0x270418['status'](_0x59063c);return _0x270418[_0x3d95('0x28')]('Content-Range',_0x5611c5+'-'+_0x3d7195+'/'+_0x14c261)['json'](_0x57b176);}return null;};}function saveUpdates(_0x4f9048){return function(_0x3d1090){if(_0x3d1090){return _0x3d1090['update'](_0x4f9048)[_0x3d95('0x16')](function(_0x4318b4){socket[_0x3d95('0x29')](_0x3d95('0x2a')+_0x4318b4['id'],{});return _0x4318b4;});}return null;};}function removeEntity(_0x521eb7){return function(_0x5cc23a){if(_0x5cc23a){return _0x5cc23a[_0x3d95('0x2b')]()[_0x3d95('0x16')](function(){var _0x330cb2=_0x5cc23a[_0x3d95('0x2c')]({'plain':!![]});if(_0x330cb2['role']===_0x3d95('0x2d'))return;var _0x342d30=[{'name':_0x3d95('0x2e'),'value':'user','ignore':!![]},{'name':_0x3d95('0x2f'),'value':_0x3d95('0x30'),'ignore':![]},{'name':_0x3d95('0x31'),'value':_0x3d95('0x32'),'ignore':![]}];var _0x4fb71c=_(_0x342d30)[_0x3d95('0x33')]('ignore')[_0x3d95('0x34')](_0x3d95('0x35'))['value']();if(_[_0x3d95('0x36')](_0x4fb71c,_0x330cb2[_0x3d95('0x37')])){return;}var _0x2a8d93=_[_0x3d95('0x38')](_0x342d30,[_0x3d95('0x35'),_0x330cb2[_0x3d95('0x37')]])[_0x3d95('0x39')];return db[_0x3d95('0x3a')][_0x3d95('0x2b')]({'where':{'type':_0x2a8d93,'resourceId':_0x330cb2['id']}})['then'](function(){return _0x5cc23a;});})[_0x3d95('0x16')](function(){_0x521eb7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x458aad){return function(_0x18af4d){if(!_0x18af4d){_0x458aad[_0x3d95('0x3b')](0x194);}return _0x18af4d;};}function handleError(_0x1878d5,_0x41a0c6){_0x41a0c6=_0x41a0c6||0x1f4;return function(_0x48b29a){logger['error'](_0x48b29a[_0x3d95('0x3c')]);if(_0x48b29a[_0x3d95('0x39')]){delete _0x48b29a[_0x3d95('0x39')];}_0x1878d5[_0x3d95('0x21')](_0x41a0c6)[_0x3d95('0x3d')](_0x48b29a);};}exports[_0x3d95('0x3e')]=function(_0x121939,_0x492d0b){var _0xe6c530={},_0x25bce7={'count':0x0,'rows':[]};var _0x464423=_(db['User'][_0x3d95('0x3f')])[_0x3d95('0x34')](function(_0x1d0e89){return{'name':_0x1d0e89[_0x3d95('0x40')],'type':_0x1d0e89[_0x3d95('0x41')][_0x3d95('0x42')]};})[_0x3d95('0x33')](function(_0x2bb783){return!_[_0x3d95('0x36')](['password',_0x3d95('0x43')],_0x2bb783['name']);})[_0x3d95('0x35')]();_0xe6c530=qs[_0x3d95('0x44')](_0x464423,_0x121939);var _0x2bc0e4={'where':_0xe6c530[_0x3d95('0x45')]};return db['User'][_0x3d95('0x27')](_0x2bc0e4)[_0x3d95('0x16')](function(_0x530f32){_0x25bce7[_0x3d95('0x27')]=_0x530f32;if(_0x121939['query'][_0x3d95('0x46')]){_0xe6c530['include']=[{'all':!![]}];}if(_0x121939[_0x3d95('0x47')][_0x3d95('0x48')]===_0x3d95('0x49')){_0xe6c530[_0x3d95('0x4a')]=[{'model':db[_0x3d95('0x4b')],'as':_0x3d95('0x48')}];}if(!_[_0x3d95('0x36')](_0xe6c530[_0x3d95('0x4c')],'id')){_0xe6c530[_0x3d95('0x4c')]['push']('id');}return db[_0x3d95('0x4d')][_0x3d95('0x4e')](_0xe6c530);})[_0x3d95('0x16')](function(_0x4e2406){_0x25bce7['rows']=_0x4e2406;if(_0x121939[_0x3d95('0x47')][_0x3d95('0x4f')]===_0x3d95('0x49')){var _0x10e649=[];for(var _0x34d7a3=0x0;_0x34d7a3<_0x25bce7['rows']['length'];_0x34d7a3++){_0x10e649[_0x3d95('0x50')](get_open_tabs('chat',_0x25bce7[_0x3d95('0x51')][_0x34d7a3][_0x3d95('0x52')]));_0x10e649[_0x3d95('0x50')](get_open_tabs('sms',_0x25bce7[_0x3d95('0x51')][_0x34d7a3][_0x3d95('0x52')]));_0x10e649[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x53'),_0x25bce7['rows'][_0x34d7a3]['dataValues']));_0x10e649['push'](get_open_tabs(_0x3d95('0x54'),_0x25bce7['rows'][_0x34d7a3][_0x3d95('0x52')]));_0x10e649[_0x3d95('0x50')](get_open_tabs('openchannel',_0x25bce7[_0x3d95('0x51')][_0x34d7a3][_0x3d95('0x52')]));_0x10e649[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x55'),_0x25bce7['rows'][_0x34d7a3][_0x3d95('0x52')]));}return BPromise[_0x3d95('0x56')](_0x10e649)[_0x3d95('0x16')](function(){return _0x25bce7;});}else{return _0x25bce7;}})[_0x3d95('0x16')](respondWithFilteredResult(_0x492d0b,_0xe6c530))[_0x3d95('0x20')](handleError(_0x492d0b,null));};exports[_0x3d95('0x57')]=function(_0x35f3c0,_0x1028e9){var _0x541e7c={'raw':![],'where':{'id':_0x35f3c0[_0x3d95('0x58')]['id']}},_0x212985={};_0x212985[_0x3d95('0x59')]=_['differenceBy'](_[_0x3d95('0x5a')](db['User'][_0x3d95('0x3f')]),['password',_0x3d95('0x43')]);_0x212985[_0x3d95('0x47')]=_['keys'](_0x35f3c0['query']);_0x212985[_0x3d95('0x5b')]=_['intersection'](_0x212985[_0x3d95('0x59')],_0x212985[_0x3d95('0x47')]);_0x541e7c[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x212985[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x35f3c0[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x541e7c[_0x3d95('0x4c')]=_0x541e7c['attributes'][_0x3d95('0x5e')]?_0x541e7c[_0x3d95('0x4c')]:_0x212985[_0x3d95('0x59')];if(_0x35f3c0[_0x3d95('0x47')][_0x3d95('0x46')]){_0x541e7c['include']=[{'all':!![]}];}if(_0x35f3c0[_0x3d95('0x47')][_0x3d95('0x48')]===_0x3d95('0x49')){_0x541e7c['include']=[{'model':db[_0x3d95('0x4b')],'as':_0x3d95('0x48')}];}_0x541e7c=_[_0x3d95('0x5f')]({},_0x541e7c,_0x35f3c0[_0x3d95('0x60')]);if(!_[_0x3d95('0x36')](_0x541e7c[_0x3d95('0x4c')],'id')){_0x541e7c[_0x3d95('0x4c')][_0x3d95('0x50')]('id');}return db[_0x3d95('0x4d')]['find'](_0x541e7c)[_0x3d95('0x16')](handleEntityNotFound(_0x1028e9,null))['then'](function(_0x3f42be){var _0x546f2f=[];values=_0x3f42be;if(_0x35f3c0['query'][_0x3d95('0x4f')]===_0x3d95('0x49')){_0x546f2f[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x61'),_0x3f42be[_0x3d95('0x52')]));_0x546f2f[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x62'),_0x3f42be[_0x3d95('0x52')]));_0x546f2f[_0x3d95('0x50')](get_open_tabs('openchannel',_0x3f42be['dataValues']));_0x546f2f[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x55'),_0x3f42be[_0x3d95('0x52')]));_0x546f2f['push'](get_open_tabs('fax',_0x3f42be[_0x3d95('0x52')]));_0x546f2f[_0x3d95('0x50')](get_open_tabs(_0x3d95('0x54'),_0x3f42be[_0x3d95('0x52')]));return BPromise[_0x3d95('0x56')](_0x546f2f);}else{return values;}})[_0x3d95('0x16')](function(){return values;})['then'](respondWithResult(_0x1028e9,null))[_0x3d95('0x20')](handleError(_0x1028e9,null));};exports[_0x3d95('0x63')]=function(_0x2de522,_0x11c084){if(_0x2de522[_0x3d95('0x64')]['id']){delete _0x2de522[_0x3d95('0x64')]['id'];}delete _0x2de522[_0x3d95('0x64')][_0x3d95('0x37')];return db[_0x3d95('0x4d')]['find']({'where':{'id':_0x2de522[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x11c084,null))[_0x3d95('0x16')](saveUpdates(_0x2de522[_0x3d95('0x64')],null))[_0x3d95('0x16')](respondWithResult(_0x11c084,null))[_0x3d95('0x20')](handleError(_0x11c084,null));};exports['describe']=function(_0x53968f,_0x143042){return db['User'][_0x3d95('0x65')]()[_0x3d95('0x16')](respondWithResult(_0x143042,null))[_0x3d95('0x20')](handleError(_0x143042,null));};exports['addContacts']=function(_0x342c00,_0x5d5834){return db['User'][_0x3d95('0x38')]({'where':{'id':_0x342c00['params']['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x5d5834,null))[_0x3d95('0x16')](function(_0x2905fe){if(_0x2905fe){return _0x2905fe[_0x3d95('0x66')](_0x342c00['body'][_0x3d95('0x67')],_[_0x3d95('0x68')](_0x342c00[_0x3d95('0x64')],['ids','id'])||{});}})[_0x3d95('0x16')](respondWithResult(_0x5d5834,null))[_0x3d95('0x20')](handleError(_0x5d5834,null));};function validateUser(_0x708038){return new BPromise(function(_0x1ac6ad,_0xd50913){if(_0x708038['internal'])return _0x1ac6ad(_0x708038);return db[_0x3d95('0x69')][_0x3d95('0x6a')](0x1)[_0x3d95('0x16')](function(_0x2c2a82){if(_0x2c2a82[_0x3d95('0x6b')])authService[_0x3d95('0x6c')](_0x708038[_0x3d95('0x6d')]);db['User'][_0x3d95('0x6e')]('internal')[_0x3d95('0x16')](function(_0x5e2d61){if(_[_0x3d95('0x6f')](_0x5e2d61)){_0x708038[_0x3d95('0x70')]=_0x2c2a82['min_internal']||0x1;return;}if(_[_0x3d95('0x6f')](_0x2c2a82[_0x3d95('0x71')])||_0x2c2a82[_0x3d95('0x71')]===_0x5e2d61){_0x708038[_0x3d95('0x70')]=_0x5e2d61+0x1;return;}if(_0x2c2a82[_0x3d95('0x71')]>_0x5e2d61){_0x708038[_0x3d95('0x70')]=_0x2c2a82[_0x3d95('0x71')];return;}return db[_0x3d95('0x72')][_0x3d95('0x47')](_0x3d95('0x73'),{'type':db[_0x3d95('0x72')][_0x3d95('0x74')][_0x3d95('0x75')]})[_0x3d95('0x16')](function(_0x22d5c1){if(_0x22d5c1&&_0x22d5c1[_0x3d95('0x5e')]){for(var _0x2b03a9=0x0,_0xa8b235=_0x22d5c1['length'];_0x2b03a9<_0xa8b235&&_[_0x3d95('0x6f')](_0x708038[_0x3d95('0x70')]);_0x2b03a9++){if(_0x2c2a82[_0x3d95('0x71')]<=_0x22d5c1[_0x2b03a9][_0x3d95('0x76')]){_0x708038[_0x3d95('0x70')]=_0x22d5c1[_0x2b03a9]['from'];}else if(_0x2c2a82['min_internal']>_0x22d5c1[_0x2b03a9][_0x3d95('0x76')]&&_0x2c2a82['min_internal']<=_0x22d5c1[_0x2b03a9]['to']){_0x708038[_0x3d95('0x70')]=_0x2c2a82[_0x3d95('0x71')];}}}if(_[_0x3d95('0x6f')](_0x708038[_0x3d95('0x70')])){_0x708038['internal']=_0x5e2d61+0x1;}return _0x1ac6ad(_0x708038);});});})[_0x3d95('0x20')](function(_0x2d03e9){_0xd50913(_0x2d03e9);});});}function updateUser(_0x3a5d62){return new BPromise(function(_0x55563e,_0x253841){try{if(_0x3a5d62['voicemail']){_0x3a5d62[_0x3d95('0x77')]=_0x3a5d62[_0x3d95('0x70')];_0x3a5d62[_0x3d95('0x78')]={'mailbox':_0x3a5d62[_0x3d95('0x70')],'password':_0x3a5d62['password'],'fullname':_0x3a5d62[_0x3d95('0x79')],'email':_0x3a5d62[_0x3d95('0x7a')]};}if(_0x3a5d62['role']==='agent'){if(!_0x3a5d62[_0x3d95('0x7b')])_0x3a5d62[_0x3d95('0x7b')]=[_0x3d95('0x7c'),'102',_0x3d95('0x7d'),_0x3d95('0x7e'),'110',_0x3d95('0x7f'),'105',_0x3d95('0x80'),_0x3d95('0x81'),_0x3d95('0x82'),'109',_0x3d95('0x83'),_0x3d95('0x84'),'114',_0x3d95('0x85')];}_0x55563e(_0x3a5d62);}catch(_0x5f1805){_0x253841(_0x5f1805);}});}exports[_0x3d95('0x86')]=function(_0x5749e0,_0x2aa156){if(_0x5749e0[_0x3d95('0x87')][_0x3d95('0x37')]===_0x3d95('0x30'))throw new Error(_0x3d95('0x88'));if(_0x5749e0[_0x3d95('0x64')][_0x3d95('0x37')]==='user'&&_0x5749e0[_0x3d95('0x87')]['role']!==_0x3d95('0x2d')){throw new Error(_0x3d95('0x89'));}if(_0x5749e0[_0x3d95('0x64')][_0x3d95('0x37')]===_0x3d95('0x2d')&&_0x5749e0['user'][_0x3d95('0x37')]!=='admin'){throw new Error(_0x3d95('0x8a'));}return licenseUtil[_0x3d95('0x8b')]([_0x5749e0[_0x3d95('0x64')]])[_0x3d95('0x16')](function(){return validateUser(_0x5749e0[_0x3d95('0x64')]);})[_0x3d95('0x16')](function(_0x485a83){return updateUser(_0x485a83)[_0x3d95('0x16')](function(_0x28e891){if(_0x28e891[_0x3d95('0x37')]===_0x3d95('0x2d')){_0x28e891['settingsEnabled']=_0x5749e0[_0x3d95('0x87')]['settingsEnabled'];delete _0x28e891[_0x3d95('0x8c')];}return _0x28e891;});})[_0x3d95('0x16')](function(_0x555ec9){return db[_0x3d95('0x4d')]['create'](_0x555ec9,{'include':[{'model':db['VoiceMail'],'as':_0x3d95('0x78')}]});})[_0x3d95('0x16')](function(_0x14667d){if(_0x5749e0[_0x3d95('0x64')]['role']===_0x3d95('0x87'))return _0x14667d;if(_0x5749e0[_0x3d95('0x87')]['role']!==_0x3d95('0x87'))return _0x14667d;return db[_0x3d95('0x8d')][_0x3d95('0x38')]({'where':{'name':_0x14667d[_0x3d95('0x37')]==='agent'?_0x3d95('0x2f'):_0x3d95('0x31'),'userProfileId':_0x5749e0['user'][_0x3d95('0x8c')]},'raw':!![]})[_0x3d95('0x16')](function(_0x46ceae){if(!_0x46ceae||_0x46ceae['autoAssociation']!=0x0)return _0x14667d;return db[_0x3d95('0x3a')][_0x3d95('0x86')]({'name':_0x14667d[_0x3d95('0x39')],'resourceId':_0x14667d['id'],'type':_0x46ceae[_0x3d95('0x39')],'sectionId':_0x46ceae['id']},{})[_0x3d95('0x16')](function(){return _0x14667d;});})['catch'](function(_0x1788e5){logger[_0x3d95('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1788e5);throw _0x1788e5;});})['then'](respondWithResult(_0x2aa156,0xc9))[_0x3d95('0x20')](handleError(_0x2aa156,null));};exports[_0x3d95('0x8e')]=function(_0x630ada,_0x23f602){var _0x2d786f=_0x630ada[_0x3d95('0x64')];var _0x4ed0aa=[];if(_0x630ada['user'][_0x3d95('0x37')]===_0x3d95('0x30'))throw new Error(_0x3d95('0x88'));if(_[_0x3d95('0x8f')](_0x2d786f,[_0x3d95('0x37'),'user'])&&_0x630ada['user']['role']!=='admin'){throw new Error(_0x3d95('0x89'));}if(_['some'](_0x2d786f,[_0x3d95('0x37'),_0x3d95('0x2d')])&&_0x630ada[_0x3d95('0x87')][_0x3d95('0x37')]!==_0x3d95('0x2d')){throw new Error(_0x3d95('0x90'));}return licenseUtil[_0x3d95('0x8b')](_0x2d786f)[_0x3d95('0x16')](function(){return validateUser(_0x2d786f[0x0]);})[_0x3d95('0x16')](function(){for(var _0x51f668=0x1;_0x51f668<_0x2d786f[_0x3d95('0x5e')];_0x51f668++){var _0x240301=_0x2d786f[_0x51f668-0x1][_0x3d95('0x70')];if(!_0x2d786f[_0x51f668][_0x3d95('0x70')])_0x2d786f[_0x51f668][_0x3d95('0x70')]=_0x240301+0x1;_0x4ed0aa['push'](validateUser(_0x2d786f[_0x51f668]));}return BPromise[_0x3d95('0x56')](_0x4ed0aa);})[_0x3d95('0x16')](function(){_0x4ed0aa=[];for(var _0x215cf7=0x0;_0x215cf7<_0x2d786f[_0x3d95('0x5e')];_0x215cf7++){_0x4ed0aa['push'](updateUser(_0x2d786f[_0x215cf7]));}return BPromise[_0x3d95('0x56')](_0x4ed0aa);})['then'](function(){return BPromise[_0x3d95('0x91')](_0x2d786f,function(_0x1a4d51){return db['User'][_0x3d95('0x86')](_0x1a4d51,{'include':[{'model':db[_0x3d95('0x78')],'as':_0x3d95('0x78')}]})[_0x3d95('0x16')](function(_0x2ef3ad){_0x1a4d51['id']=_0x2ef3ad['id'];return _0x1a4d51;});});})[_0x3d95('0x16')](function(_0x36e4ca){if(_0x630ada[_0x3d95('0x64')]['role']===_0x3d95('0x87'))return _0x36e4ca;if(_0x630ada[_0x3d95('0x87')]['role']!==_0x3d95('0x87'))return _0x36e4ca;var _0x3d599c=_[_0x3d95('0x8f')](_0x36e4ca,function(_0x3eadca){return _0x3eadca['role']===_0x3d95('0x30')||_0x3eadca[_0x3d95('0x37')]===_0x3d95('0x32');});if(!_0x3d599c)return _0x36e4ca;return db[_0x3d95('0x8d')][_0x3d95('0x4e')]({'where':{'name':{'$or':[_0x3d95('0x2f'),_0x3d95('0x31')]},'userProfileId':_0x630ada[_0x3d95('0x87')][_0x3d95('0x8c')]},'raw':!![]})[_0x3d95('0x16')](function(_0x3f306c){if(_['isEmpty'](_0x3f306c)||!_[_0x3d95('0x8f')](_0x3f306c,[_0x3d95('0x92'),0x0]))return _0x36e4ca;_0x4ed0aa=[];var _0x31b769=_(_0x3f306c)[_0x3d95('0x34')](function(_0x30bfcf){if(_0x30bfcf[_0x3d95('0x92')]===0x1)return;return _0x30bfcf[_0x3d95('0x39')]===_0x3d95('0x2f')?_0x3d95('0x30'):'telephone';})[_0x3d95('0x93')]()['value']();for(var _0x1d6e72=0x0;_0x1d6e72<_0x36e4ca[_0x3d95('0x5e')];_0x1d6e72++){if(!_['includes'](_0x31b769,_0x36e4ca[_0x1d6e72]['role']))return;var _0x1e4fa5=_0x36e4ca[_0x1d6e72][_0x3d95('0x37')]===_0x3d95('0x30')?_0x3d95('0x2f'):_0x3d95('0x31');_0x4ed0aa['push'](db[_0x3d95('0x3a')][_0x3d95('0x86')]({'name':_0x36e4ca[_0x1d6e72][_0x3d95('0x39')],'resourceId':_0x36e4ca[_0x1d6e72]['id'],'type':_0x1e4fa5,'sectionId':_[_0x3d95('0x38')](_0x3f306c,[_0x3d95('0x39'),_0x1e4fa5])['id']},{}));}return BPromise[_0x3d95('0x56')](_0x4ed0aa);});})[_0x3d95('0x16')](respondWithResult(_0x23f602,0xc9))['catch'](handleError(_0x23f602,null));};exports[_0x3d95('0x94')]=function(_0x21ea8c,_0x12f4ec){if(_0x21ea8c['body']['id']){delete _0x21ea8c['body']['id'];}return db[_0x3d95('0x4d')][_0x3d95('0x38')]({'where':{'id':_0x21ea8c[_0x3d95('0x58')]['id']}})['then'](function(_0x25a6e9){if(!_0x25a6e9)return null;if(_0x25a6e9['id']===_0x21ea8c[_0x3d95('0x87')]['id']){if(!_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x95')]||!_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')]){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))](_0x3d95('0x99'));}if(!_0x25a6e9[_0x3d95('0x9a')](_0x21ea8c['body']['oldPassword'])){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))](_0x3d95('0x9b'));}if(_0x21ea8c['body'][_0x3d95('0x95')]===_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')]){throw new db['Sequelize'][(_0x3d95('0x98'))](_0x3d95('0x9c'));}}else if(_0x21ea8c[_0x3d95('0x87')][_0x3d95('0x37')]===_0x3d95('0x2d')){if(!_0x21ea8c['body']['newPassword']){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x21ea8c[_0x3d95('0x87')]['role']===_0x3d95('0x87')){if(!_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')]){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))](_0x3d95('0x9d'));}if(_0x25a6e9[_0x3d95('0x37')]!=='agent'){throw new db[(_0x3d95('0x97'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize']['ValidationError'](_0x3d95('0x88'));}return _0x25a6e9;})[_0x3d95('0x16')](handleEntityNotFound(_0x12f4ec,null))[_0x3d95('0x16')](function(_0x5ee48c){return db[_0x3d95('0x69')][_0x3d95('0x9e')]({'attributes':['id',_0x3d95('0x6b'),'enforcePasswordHistory',_0x3d95('0x9f')]})[_0x3d95('0x16')](function(_0x340bf9){if(_0x340bf9['securePassword'])authService[_0x3d95('0x6c')](_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')]);if(!_0x340bf9[_0x3d95('0xa0')]||!_0x5ee48c[_0x3d95('0xa1')])return _0x5ee48c;authService['validatePasswordHistory'](_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')],_0x5ee48c[_0x3d95('0xa1')],_0x340bf9[_0x3d95('0x9f')]);return _0x5ee48c;})['then'](saveUpdates({'password':_0x21ea8c[_0x3d95('0x64')][_0x3d95('0x96')],'passwordResetAt':_0x21ea8c[_0x3d95('0x87')]['id']==_0x21ea8c[_0x3d95('0x58')]['id']?moment():null,'previousPasswords':authService[_0x3d95('0xa2')](_0x21ea8c['body'][_0x3d95('0x96')],_0x5ee48c[_0x3d95('0xa1')])},null));})[_0x3d95('0x16')](respondWithResult(_0x12f4ec,null))[_0x3d95('0x20')](handleError(_0x12f4ec,null));};exports[_0x3d95('0xa3')]=function(_0x4ee5a5,_0x431036){var _0x5a0bf6=_0x4ee5a5['body'][_0x3d95('0xa4')];return db[_0x3d95('0x4d')][_0x3d95('0x38')]({'where':{'id':_0x4ee5a5[_0x3d95('0x58')]['id']},'attributes':['id','name',_0x3d95('0x37'),'online','loginInPause','voicePause','interface']})[_0x3d95('0x16')](handleEntityNotFound(_0x431036,null))['then'](function(_0x2c2279){if(_0x2c2279){if(!utils[_0x3d95('0xa5')](_0x5a0bf6)){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))](_0x3d95('0xa6'));}return _0x2c2279[_0x3d95('0xa7')+_['capitalize'](_0x5a0bf6[_0x3d95('0xa8')]())+_0x3d95('0xa9')](_0x4ee5a5[_0x3d95('0x64')]['ids'],{'penalty':_0x4ee5a5[_0x3d95('0x64')][_0x3d95('0xaa')]||0x0})[_0x3d95('0xab')](function(_0x369ce1){for(var _0x269b96=0x0;_0x269b96<_0x4ee5a5[_0x3d95('0x64')]['ids'][_0x3d95('0x5e')];_0x269b96+=0x1){var _0x159253={'UserId':Number(_0x4ee5a5['params']['id'])};_0x159253[_[_0x3d95('0xac')](_0x5a0bf6[_0x3d95('0xa8')]())+_0x3d95('0xad')]=Number(_0x4ee5a5[_0x3d95('0x64')][_0x3d95('0x67')][_0x269b96]);socket[_0x3d95('0x29')]('user'+_[_0x3d95('0xac')](_0x5a0bf6[_0x3d95('0xa8')]())+_0x3d95('0xae'),_0x159253);}return _0x369ce1;})[_0x3d95('0x16')](function(){if(_0x5a0bf6==='voice'){return db[_0x3d95('0xaf')][_0x3d95('0x4e')]({'where':{'id':_0x4ee5a5['body'][_0x3d95('0x67')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x3d95('0x16')](function(_0x5723d7){var _0x31db22=_0x2c2279[_0x3d95('0x2c')]({'plain':!![]});var _0x11c3d2=[];if(_0x5a0bf6===_0x3d95('0xb0')&&_0x31db22[_0x3d95('0x37')]===_0x3d95('0x30')&&_0x31db22[_0x3d95('0xb1')]){for(var _0x27ce15=0x0;_0x27ce15<_0x5723d7[_0x3d95('0x5e')];_0x27ce15+=0x1){_0x11c3d2[_0x3d95('0x50')]({'membername':_0x31db22[_0x3d95('0x39')],'UserId':_0x31db22['id'],'queue_name':_0x5723d7[_0x27ce15][_0x3d95('0x39')],'VoiceQueueId':_0x5723d7[_0x27ce15]['id'],'interface':_['isNil'](_0x31db22['interface'])?util['format']('SIP/%s',_0x31db22[_0x3d95('0x39')]):_0x31db22[_0x3d95('0xb2')],'paused':_0x31db22['voicePause']||![],'penalty':_0x4ee5a5[_0x3d95('0x64')][_0x3d95('0xaa')]||0x0});}return BPromise[_0x3d95('0x91')](_0x11c3d2,function(_0x54a737){return db[_0x3d95('0xb3')][_0x3d95('0xb4')](_0x54a737);});}return _0x2c2279;});}})['then'](respondWithStatusCode(_0x431036,null))[_0x3d95('0x20')](handleError(_0x431036,null));};exports[_0x3d95('0xb5')]=function(_0x528bd8,_0x58021d){var _0x130341,_0x52715e;return db[_0x3d95('0x4d')]['find']({'where':{'id':_0x528bd8[_0x3d95('0x58')]['id']},'attributes':['id',_0x3d95('0x39'),_0x3d95('0x37')]})[_0x3d95('0x16')](handleEntityNotFound(_0x58021d,null))['then'](function(_0xfca234){if(_0xfca234){_0x130341=_0xfca234;if(!_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')]||!utils[_0x3d95('0xa5')](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')])){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))]('Unknown\x20channel');}return _0xfca234[_0x3d95('0xb6')+_[_0x3d95('0xac')](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')][_0x3d95('0xa8')]())+_0x3d95('0xa9')](_0x528bd8['query'][_0x3d95('0x67')]);}})['then'](function(_0x3c7c8b){if(_[_0x3d95('0xb7')](_0x528bd8['query']['ids'])){for(var _0x1d5dd2=0x0;_0x1d5dd2<_0x528bd8[_0x3d95('0x47')][_0x3d95('0x67')][_0x3d95('0x5e')];_0x1d5dd2+=0x1){_0x52715e={'UserId':Number(_0x528bd8[_0x3d95('0x58')]['id'])};_0x52715e[_[_0x3d95('0xac')](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')][_0x3d95('0xa8')]())+_0x3d95('0xad')]=Number(_0x528bd8['query'][_0x3d95('0x67')][_0x1d5dd2]);socket[_0x3d95('0x29')](_0x3d95('0x87')+_[_0x3d95('0xac')](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')][_0x3d95('0xa8')]())+'Queue:remove',_0x52715e);}}else{_0x52715e={'UserId':Number(_0x528bd8[_0x3d95('0x58')]['id'])};_0x52715e[_[_0x3d95('0xac')](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')]['toLowerCase']())+_0x3d95('0xad')]=Number(_0x528bd8['query']['ids']);socket[_0x3d95('0x29')](_0x3d95('0x87')+_['capitalize'](_0x528bd8[_0x3d95('0x47')][_0x3d95('0xa4')]['toLowerCase']())+_0x3d95('0xb8'),_0x52715e);}return _0x3c7c8b;})[_0x3d95('0x16')](function(){if(_0x528bd8[_0x3d95('0x47')]['channel']===_0x3d95('0xb0')){return db[_0x3d95('0xb3')]['destroy']({'where':{'UserId':_0x528bd8[_0x3d95('0x58')]['id'],'VoiceQueueId':_0x528bd8[_0x3d95('0x47')][_0x3d95('0x67')]},'individualHooks':!![]})['then'](function(){return _0x130341;});}return _0x130341;})[_0x3d95('0x16')](respondWithStatusCode(_0x58021d,null))['catch'](handleError(_0x58021d,null));};exports[_0x3d95('0xb9')]=function(_0x35a4e7,_0x6f1408){_0x35a4e7[_0x3d95('0x64')][_0x3d95('0xba')]=_0x35a4e7['file'][_0x3d95('0xbb')];return db['User'][_0x3d95('0x38')]({'where':{'id':_0x35a4e7[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x6f1408,null))[_0x3d95('0x16')](saveUpdates(_0x35a4e7[_0x3d95('0x64')],null))[_0x3d95('0x16')](respondWithResult(_0x6f1408,null))[_0x3d95('0x20')](handleError(_0x6f1408,null));};exports['getAvatar']=function(_0x312faa,_0x2dbdf3){var _0x56bd86=path[_0x3d95('0xbc')](config[_0x3d95('0xbd')],_0x3d95('0xbe'));return db['User']['find']({'where':{'id':_0x312faa['params']['id']},'attributes':['id',_0x3d95('0xba')],'raw':!![]})[_0x3d95('0x16')](handleEntityNotFound(_0x2dbdf3,null))[_0x3d95('0x16')](function(_0xe9fc8a){if(_0xe9fc8a){if(_[_0x3d95('0x6f')](_0xe9fc8a[_0x3d95('0xba')])){return _0x2dbdf3[_0x3d95('0xbf')](_0x56bd86);}else{if(!fs[_0x3d95('0xc0')](path['join'](config[_0x3d95('0xbd')],_0x3d95('0xc1'),_0xe9fc8a['userpic']))){return _0x2dbdf3[_0x3d95('0xbf')](_0x56bd86);}return _0x2dbdf3[_0x3d95('0xbf')](path['join'](config[_0x3d95('0xbd')],'server/files/images/',_0xe9fc8a[_0x3d95('0xba')]));}}})[_0x3d95('0x20')](handleError(_0x2dbdf3,null));};exports[_0x3d95('0xc2')]=function(_0x51da59,_0x5c15c1){return db[_0x3d95('0x4d')][_0x3d95('0x38')]({'where':{'id':_0x51da59[_0x3d95('0x58')]['id']},'attributes':['id']})[_0x3d95('0x16')](handleEntityNotFound(_0x5c15c1,null))[_0x3d95('0x16')](function(_0x3e5c8d){var _0x5a2284=[];values=_0x3e5c8d[_0x3d95('0x52')];_0x5a2284['push'](get_open_tabs('chat',_0x3e5c8d[_0x3d95('0x52')]));_0x5a2284['push'](get_open_tabs(_0x3d95('0x62'),_0x3e5c8d['dataValues']));_0x5a2284['push'](get_open_tabs(_0x3d95('0xc3'),_0x3e5c8d[_0x3d95('0x52')]));_0x5a2284['push'](get_open_tabs(_0x3d95('0x55'),_0x3e5c8d['dataValues']));_0x5a2284['push'](get_open_tabs(_0x3d95('0x53'),_0x3e5c8d['dataValues']));_0x5a2284['push'](get_open_tabs(_0x3d95('0x54'),_0x3e5c8d[_0x3d95('0x52')]));return BPromise[_0x3d95('0x56')](_0x5a2284);})[_0x3d95('0x16')](function(_0x358117){if(_0x358117){var _0x123a73=_[_0x3d95('0x34')](values[_0x3d95('0xc4')],function(_0x28280f){return{'channel':_0x3d95('0xc5'),'id':_0x28280f['id'],'createdAt':_0x28280f[_0x3d95('0xc6')]};});var _0x500ada=_['map'](values[_0x3d95('0xc7')],function(_0x21c76b){return{'channel':'FAX','id':_0x21c76b['id'],'createdAt':_0x21c76b[_0x3d95('0xc6')]};});var _0xe89f4a=_[_0x3d95('0x34')](values['OpenchannelOpenTabs'],function(_0x5a72b1){return{'channel':_0x3d95('0xc8'),'id':_0x5a72b1['id'],'createdAt':_0x5a72b1[_0x3d95('0xc6')]};});var _0x33fc5e=_[_0x3d95('0x34')](values[_0x3d95('0xc9')],function(_0x3e90d9){return{'channel':_0x3d95('0xca'),'id':_0x3e90d9['id'],'createdAt':_0x3e90d9[_0x3d95('0xc6')]};});var _0x3c16af=_['map'](values[_0x3d95('0xcb')],function(_0x4f0899){return{'channel':'SMS','id':_0x4f0899['id'],'createdAt':_0x4f0899['createdAt']};});var _0x2c10ef=_[_0x3d95('0x34')](values[_0x3d95('0xcc')],function(_0x5da00f){return{'channel':_0x3d95('0xcd'),'id':_0x5da00f['id'],'createdAt':_0x5da00f['createdAt']};});var _0x4f0996=_[_0x3d95('0xce')](_0x123a73,_0x500ada,_0xe89f4a,_0x33fc5e,_0x3c16af,_0x2c10ef);var _0x57aeff={'count':_0x4f0996[_0x3d95('0x5e')],'rows':_0x4f0996};return _0x57aeff;}else return null;})[_0x3d95('0x16')](respondWithResult(_0x5c15c1,null))[_0x3d95('0x20')](handleError(_0x5c15c1,null));};exports[_0x3d95('0xcf')]=function(_0x338700,_0x380077){var _0x276bb7={};var _0x4827a6={};var _0x262637;var _0x118660;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x338700[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x380077,null))[_0x3d95('0x16')](function(_0x216fe7){if(_0x216fe7){_0x262637=_0x216fe7;_0x4827a6[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0xd0')][_0x3d95('0x3f')]);_0x4827a6[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x338700[_0x3d95('0x47')]);_0x4827a6[_0x3d95('0x5b')]=_['intersection'](_0x4827a6['model'],_0x4827a6['query']);_0x276bb7[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x4827a6[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x338700[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x276bb7['attributes']=_0x276bb7[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x276bb7[_0x3d95('0x4c')]:_0x4827a6[_0x3d95('0x59')];_0x276bb7[_0x3d95('0xd1')]=qs['sort'](_0x338700['query'][_0x3d95('0xd2')]);_0x276bb7[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x338700['query'],_0x4827a6['filters']));if(_0x338700['query'][_0x3d95('0x33')]){_0x276bb7[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x276bb7[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x276bb7[_0x3d95('0x4c')],function(_0x5d17d3){var _0x360c2b={};_0x360c2b[_0x5d17d3]={'$like':'%'+_0x338700['query'][_0x3d95('0x33')]+'%'};return _0x360c2b;})});}_0x276bb7=_[_0x3d95('0x5f')]({},_0x276bb7,_0x338700[_0x3d95('0x60')]);return _0x262637['getContacts'](_0x276bb7);}})[_0x3d95('0x16')](function(_0x2d93c0){if(_0x2d93c0){_0x118660=_0x2d93c0[_0x3d95('0x5e')];if(_0x338700['query'][_0x3d95('0xd4')](_0x3d95('0x46'))){_0x276bb7[_0x3d95('0x4a')]=[{'model':db[_0x3d95('0xd5')],'as':_0x3d95('0xd6'),'required':![]},{'model':db['Tag'],'as':_0x3d95('0xd7'),'attributes':['id','name',_0x3d95('0xd8')],'where':_0x338700[_0x3d95('0x47')][_0x3d95('0xd9')]?{'id':_0x338700[_0x3d95('0x47')][_0x3d95('0xd9')]}:undefined,'required':_0x338700[_0x3d95('0x47')][_0x3d95('0xd9')]?!![]:![]}];}if(!_0x338700[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x276bb7[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x338700[_0x3d95('0x47')]['limit']);_0x276bb7[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x338700[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x262637['getContacts'](_0x276bb7);}})[_0x3d95('0x16')](function(_0x340e7e){if(_0x340e7e){return _0x340e7e?{'count':_0x118660,'rows':_0x340e7e}:null;}})[_0x3d95('0x16')](respondWithResult(_0x380077,null))[_0x3d95('0x20')](handleError(_0x380077,null));};exports[_0x3d95('0xdb')]=function(_0x5e97f7,_0x10418a){var _0x28def6;var _0x1c4da0={};var _0x17cee7;return db['User'][_0x3d95('0x9e')]({'where':{'id':_0x5e97f7['params']['id']},'attributes':['id',_0x3d95('0x39'),_0x3d95('0x37')]})[_0x3d95('0x16')](handleEntityNotFound(_0x10418a,null))[_0x3d95('0x16')](function(_0x3c61a1){if(!utils[_0x3d95('0xa5')](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0xa4')])){throw new db['Sequelize'][(_0x3d95('0x98'))](_0x3d95('0xa6'));}_0x28def6=_0x3c61a1;var _0x21f4b3={};_0x21f4b3[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_['capitalize'](_0x5e97f7[_0x3d95('0x47')]['channel'])+_0x3d95('0xdc')]['rawAttributes']);_0x21f4b3['query']=_[_0x3d95('0x5a')](_0x5e97f7['query']);_0x21f4b3[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x21f4b3['model'],_0x21f4b3['query']);_0x1c4da0[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x21f4b3[_0x3d95('0x59')],qs['fields'](_0x5e97f7[_0x3d95('0x47')]['fields']));_0x1c4da0['attributes']=_0x1c4da0[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x1c4da0[_0x3d95('0x4c')]:_0x21f4b3[_0x3d95('0x59')];_0x1c4da0['order']=qs[_0x3d95('0xd2')](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0xd2')]);_0x1c4da0[_0x3d95('0x45')]=qs['filters'](_[_0x3d95('0xd3')](_0x5e97f7[_0x3d95('0x47')],_0x21f4b3[_0x3d95('0x5b')]));if(_0x5e97f7['query'][_0x3d95('0x33')]){_0x1c4da0[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x1c4da0[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x1c4da0[_0x3d95('0x4c')],function(_0x1c01d2){var _0x23d649={};_0x23d649[_0x1c01d2]={'$like':'%'+_0x5e97f7['query'][_0x3d95('0x33')]+'%'};return _0x23d649;})});}_0x1c4da0=_[_0x3d95('0x5f')]({},_0x1c4da0,_0x5e97f7[_0x3d95('0x60')]);switch(_0x28def6[_0x3d95('0x37')]){case _0x3d95('0x2d'):return db[_['capitalize'](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0xa4')])+_0x3d95('0xdc')][_0x3d95('0x4e')](_0x1c4da0);case _0x3d95('0x87'):case _0x3d95('0x30'):return _0x28def6[_0x3d95('0x2c')+_[_0x3d95('0xac')](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0xa4')])+'Queues'](_0x1c4da0);default:throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))]('Unknown\x20role');}})[_0x3d95('0x16')](function(_0x2dabed){_0x17cee7=_0x2dabed[_0x3d95('0x5e')];if(!_0x5e97f7['query'][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x1c4da0[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0x26')]);_0x1c4da0['offset']=qs[_0x3d95('0x24')](_0x5e97f7[_0x3d95('0x47')][_0x3d95('0x24')]);}switch(_0x28def6['role']){case _0x3d95('0x2d'):return db[_['capitalize'](_0x5e97f7[_0x3d95('0x47')]['channel'])+_0x3d95('0xdc')]['findAll'](_0x1c4da0);case'user':case _0x3d95('0x30'):return _0x28def6[_0x3d95('0x2c')+_[_0x3d95('0xac')](_0x5e97f7[_0x3d95('0x47')]['channel'])+'Queues'](_0x1c4da0);}})['then'](function(_0x4c8c51){return{'count':_0x17cee7,'rows':_0x4c8c51};})['then'](respondWithResult(_0x10418a,null))[_0x3d95('0x20')](handleError(_0x10418a,null));};exports[_0x3d95('0xdd')]=function(_0x2f7db2,_0x5d978e){var _0x2b0144={};var _0x1977ed={};var _0x2f09f2;var _0x30f902;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x2f7db2[_0x3d95('0x58')]['id']}})['then'](handleEntityNotFound(_0x5d978e,null))[_0x3d95('0x16')](function(_0x57130b){if(_0x57130b){_0x2f09f2=_0x57130b;_0x1977ed[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db['UserVoiceQueueRt']['rawAttributes']);_0x1977ed[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x2f7db2[_0x3d95('0x47')]);_0x1977ed[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x1977ed[_0x3d95('0x59')],_0x1977ed[_0x3d95('0x47')]);_0x2b0144[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x1977ed[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x2f7db2[_0x3d95('0x47')]['fields']));_0x2b0144[_0x3d95('0x4c')]=_0x2b0144[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x2b0144[_0x3d95('0x4c')]:_0x1977ed[_0x3d95('0x59')];_0x2b0144['order']=qs[_0x3d95('0xd2')](_0x2f7db2[_0x3d95('0x47')]['sort']);_0x2b0144['where']=qs[_0x3d95('0x5b')](_['pick'](_0x2f7db2[_0x3d95('0x47')],_0x1977ed['filters']));if(_0x2f7db2[_0x3d95('0x47')]['filter']){_0x2b0144[_0x3d95('0x45')]=_['merge'](_0x2b0144[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x2b0144[_0x3d95('0x4c')],function(_0xd36ef0){var _0xb0886a={};_0xb0886a[_0xd36ef0]={'$like':'%'+_0x2f7db2[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0xb0886a;})});}_0x2b0144=_['merge']({},_0x2b0144,_0x2f7db2['options']);return _0x2f09f2['getVoiceQueuesRt'](_0x2b0144);}})[_0x3d95('0x16')](function(_0x1febbd){if(_0x1febbd){_0x30f902=_0x1febbd[_0x3d95('0x5e')];if(!_0x2f7db2['query'][_0x3d95('0xd4')]('nolimit')){_0x2b0144[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x2f7db2[_0x3d95('0x47')][_0x3d95('0x26')]);_0x2b0144[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x2f7db2[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x2f09f2[_0x3d95('0xdd')](_0x2b0144);}})[_0x3d95('0x16')](function(_0x416792){if(_0x416792){return _0x416792?{'count':_0x30f902,'rows':_0x416792}:null;}})[_0x3d95('0x16')](respondWithResult(_0x5d978e,null))[_0x3d95('0x20')](handleError(_0x5d978e,null));};exports['getGroups']=function(_0x3a686a,_0x4d5c3c){var _0x15a4a1={};var _0x431275={};var _0x575d53;var _0x44fd52;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x3a686a['params']['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x4d5c3c,null))[_0x3d95('0x16')](function(_0x4534e4){if(_0x4534e4){_0x575d53=_0x4534e4;_0x431275[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0xde')][_0x3d95('0x3f')]);_0x431275[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x3a686a[_0x3d95('0x47')]);_0x431275[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x431275['model'],_0x431275[_0x3d95('0x47')]);_0x15a4a1[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x431275[_0x3d95('0x59')],qs['fields'](_0x3a686a[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x15a4a1[_0x3d95('0x4c')]=_0x15a4a1[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x15a4a1[_0x3d95('0x4c')]:_0x431275[_0x3d95('0x59')];_0x15a4a1[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x3a686a[_0x3d95('0x47')]['sort']);_0x15a4a1[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x3a686a[_0x3d95('0x47')],_0x431275[_0x3d95('0x5b')]));if(_0x3a686a[_0x3d95('0x47')][_0x3d95('0x33')]){_0x15a4a1['where']=_[_0x3d95('0x5f')](_0x15a4a1[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x15a4a1[_0x3d95('0x4c')],function(_0x5ac44b){var _0x13cad2={};_0x13cad2[_0x5ac44b]={'$like':'%'+_0x3a686a[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x13cad2;})});}_0x15a4a1=_[_0x3d95('0x5f')]({},_0x15a4a1,_0x3a686a[_0x3d95('0x60')]);return _0x575d53[_0x3d95('0xdf')](_0x15a4a1);}})[_0x3d95('0x16')](function(_0x23e443){if(_0x23e443){_0x44fd52=_0x23e443[_0x3d95('0x5e')];if(!_0x3a686a[_0x3d95('0x47')]['hasOwnProperty'](_0x3d95('0xda'))){_0x15a4a1[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x3a686a[_0x3d95('0x47')][_0x3d95('0x26')]);_0x15a4a1[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x3a686a['query']['offset']);}return _0x575d53[_0x3d95('0xdf')](_0x15a4a1);}})[_0x3d95('0x16')](function(_0xe84068){if(_0xe84068){return _0xe84068?{'count':_0x44fd52,'rows':_0xe84068}:null;}})[_0x3d95('0x16')](respondWithResult(_0x4d5c3c,null))[_0x3d95('0x20')](handleError(_0x4d5c3c,null));};exports[_0x3d95('0xe0')]=function(_0x1d58af,_0x19333b){var _0x316966={'raw':!![],'where':{}};var _0x577d05={};var _0x27d3cd={'count':0x0,'rows':[]};return db[_0x3d95('0x4d')]['findOne']({'where':{'id':_0x1d58af['params']['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x19333b,null))[_0x3d95('0x16')](function(_0x165ac1){if(_0x165ac1){_0x577d05[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db['VoiceRecording'][_0x3d95('0x3f')]);_0x577d05['query']=_['keys'](_0x1d58af[_0x3d95('0x47')]);_0x577d05['filters']=_[_0x3d95('0x5c')](_0x577d05[_0x3d95('0x59')],_0x577d05[_0x3d95('0x47')]);_0x316966[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x577d05['model'],qs[_0x3d95('0x5d')](_0x1d58af['query'][_0x3d95('0x5d')]));_0x316966[_0x3d95('0x4c')]=_0x316966['attributes'][_0x3d95('0x5e')]?_0x316966['attributes']:_0x577d05[_0x3d95('0x59')];if(!_0x1d58af[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x316966[_0x3d95('0x26')]=qs['limit'](_0x1d58af[_0x3d95('0x47')][_0x3d95('0x26')]);_0x316966['offset']=qs[_0x3d95('0x24')](_0x1d58af[_0x3d95('0x47')][_0x3d95('0x24')]);}_0x316966['order']=qs[_0x3d95('0xd2')](_0x1d58af['query'][_0x3d95('0xd2')]);_0x316966['where']=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x1d58af[_0x3d95('0x47')],_0x577d05['filters']));_0x316966[_0x3d95('0x45')][_0x3d95('0xe1')]=_0x165ac1['id'];if(_0x1d58af[_0x3d95('0x47')]['filter']){_0x316966[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x316966[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x316966[_0x3d95('0x4c')],function(_0x32c83f){var _0x1e2ec2={};_0x1e2ec2[_0x32c83f]={'$like':'%'+_0x1d58af[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x1e2ec2;})});}_0x316966=_[_0x3d95('0x5f')]({},_0x316966,_0x1d58af[_0x3d95('0x60')]);return db['VoiceRecording'][_0x3d95('0x27')]({'where':_0x316966[_0x3d95('0x45')]})[_0x3d95('0x16')](function(_0x41f07f){_0x27d3cd[_0x3d95('0x27')]=_0x41f07f;if(_0x1d58af[_0x3d95('0x47')][_0x3d95('0x46')]){_0x316966[_0x3d95('0x4a')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x316966);})[_0x3d95('0x16')](function(_0x7861d1){_0x27d3cd['rows']=_0x7861d1;return _0x27d3cd;});}})[_0x3d95('0x16')](respondWithFilteredResult(_0x19333b,_0x316966))[_0x3d95('0x20')](handleError(_0x19333b,null));};exports[_0x3d95('0xe2')]=function(_0x3bb7dd,_0x4babd9){var _0x430ce9={'raw':!![],'where':{}};var _0x82ee62={};var _0x38ed5d={'count':0x0,'rows':[]};return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x3bb7dd[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x4babd9,null))[_0x3d95('0x16')](function(_0x39c814){if(_0x39c814){_0x82ee62[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db['ScreenRecording']['rawAttributes']);_0x82ee62[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x3bb7dd[_0x3d95('0x47')]);_0x82ee62[_0x3d95('0x5b')]=_['intersection'](_0x82ee62[_0x3d95('0x59')],_0x82ee62['query']);_0x430ce9[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x82ee62[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x430ce9[_0x3d95('0x4c')]=_0x430ce9[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x430ce9[_0x3d95('0x4c')]:_0x82ee62[_0x3d95('0x59')];if(!_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x430ce9['limit']=qs[_0x3d95('0x26')](_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x26')]);_0x430ce9[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x24')]);}_0x430ce9[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x3bb7dd['query']['sort']);_0x430ce9[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_['pick'](_0x3bb7dd[_0x3d95('0x47')],_0x82ee62[_0x3d95('0x5b')]));_0x430ce9[_0x3d95('0x45')][_0x3d95('0xe1')]=_0x39c814['id'];if(_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x33')]){_0x430ce9[_0x3d95('0x45')]=_['merge'](_0x430ce9[_0x3d95('0x45')],{'$or':_['map'](_0x430ce9[_0x3d95('0x4c')],function(_0x159209){var _0x3edd64={};_0x3edd64[_0x159209]={'$like':'%'+_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x3edd64;})});}_0x430ce9=_['merge']({},_0x430ce9,_0x3bb7dd[_0x3d95('0x60')]);return db[_0x3d95('0xe3')][_0x3d95('0x27')]({'where':_0x430ce9[_0x3d95('0x45')]})[_0x3d95('0x16')](function(_0xf53681){_0x38ed5d[_0x3d95('0x27')]=_0xf53681;if(_0x3bb7dd[_0x3d95('0x47')][_0x3d95('0x46')]){_0x430ce9['include']=[{'all':!![]}];}return db[_0x3d95('0xe3')][_0x3d95('0x4e')](_0x430ce9);})[_0x3d95('0x16')](function(_0x45d9f1){_0x38ed5d[_0x3d95('0x51')]=_0x45d9f1;return _0x38ed5d;});}})[_0x3d95('0x16')](respondWithFilteredResult(_0x4babd9,_0x430ce9))[_0x3d95('0x20')](handleError(_0x4babd9,null));};exports[_0x3d95('0xe4')]=function(_0x219dae,_0x20fd47){var _0x2e20cc={};var _0xd17fa5={};var _0x46135a;var _0x39ed00;return db[_0x3d95('0x4d')]['findOne']({'where':{'id':_0x219dae['params']['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x20fd47,null))[_0x3d95('0x16')](function(_0x488640){if(_0x488640){_0x46135a=_0x488640;_0xd17fa5[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0xe5')][_0x3d95('0x3f')]);_0xd17fa5[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x219dae['query']);_0xd17fa5[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0xd17fa5[_0x3d95('0x59')],_0xd17fa5['query']);_0x2e20cc[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0xd17fa5['model'],qs[_0x3d95('0x5d')](_0x219dae[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x2e20cc['attributes']=_0x2e20cc[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x2e20cc[_0x3d95('0x4c')]:_0xd17fa5[_0x3d95('0x59')];_0x2e20cc[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x219dae[_0x3d95('0x47')][_0x3d95('0xd2')]);_0x2e20cc[_0x3d95('0x45')]=qs['filters'](_[_0x3d95('0xd3')](_0x219dae[_0x3d95('0x47')],_0xd17fa5['filters']));if(_0x219dae[_0x3d95('0x47')][_0x3d95('0x33')]){_0x2e20cc[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x2e20cc[_0x3d95('0x45')],{'$or':_['map'](_0x2e20cc['attributes'],function(_0x10694d){var _0x2f76a4={};_0x2f76a4[_0x10694d]={'$like':'%'+_0x219dae[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x2f76a4;})});}_0x2e20cc=_[_0x3d95('0x5f')]({},_0x2e20cc,_0x219dae[_0x3d95('0x60')]);return _0x46135a[_0x3d95('0xe4')](_0x2e20cc);}})['then'](function(_0x46132c){if(_0x46132c){_0x39ed00=_0x46132c['length'];if(!_0x219dae[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x2e20cc[_0x3d95('0x26')]=qs['limit'](_0x219dae[_0x3d95('0x47')][_0x3d95('0x26')]);_0x2e20cc[_0x3d95('0x24')]=qs['offset'](_0x219dae[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x46135a['getChatInteractions'](_0x2e20cc);}})['then'](function(_0x438dbc){if(_0x438dbc){return _0x438dbc?{'count':_0x39ed00,'rows':_0x438dbc}:null;}})[_0x3d95('0x16')](respondWithResult(_0x20fd47,null))[_0x3d95('0x20')](handleError(_0x20fd47,null));};exports[_0x3d95('0xe6')]=function(_0x20ab1c,_0x4fc308){var _0x1c6dff={};var _0x2f3669={};var _0x5f50a3;var _0x36a5eb;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x20ab1c[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x4fc308,null))[_0x3d95('0x16')](function(_0x4cbc50){if(_0x4cbc50){_0x5f50a3=_0x4cbc50;_0x2f3669[_0x3d95('0x59')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x2f3669[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x20ab1c[_0x3d95('0x47')]);_0x2f3669[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x2f3669[_0x3d95('0x59')],_0x2f3669[_0x3d95('0x47')]);_0x1c6dff[_0x3d95('0x4c')]=_['intersection'](_0x2f3669['model'],qs[_0x3d95('0x5d')](_0x20ab1c[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x1c6dff[_0x3d95('0x4c')]=_0x1c6dff[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x1c6dff['attributes']:_0x2f3669['model'];_0x1c6dff[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x20ab1c[_0x3d95('0x47')]['sort']);_0x1c6dff[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x20ab1c['query'],_0x2f3669[_0x3d95('0x5b')]));if(_0x20ab1c[_0x3d95('0x47')][_0x3d95('0x33')]){_0x1c6dff['where']=_['merge'](_0x1c6dff['where'],{'$or':_['map'](_0x1c6dff[_0x3d95('0x4c')],function(_0x474783){var _0xed9a8b={};_0xed9a8b[_0x474783]={'$like':'%'+_0x20ab1c[_0x3d95('0x47')]['filter']+'%'};return _0xed9a8b;})});}_0x1c6dff=_[_0x3d95('0x5f')]({},_0x1c6dff,_0x20ab1c[_0x3d95('0x60')]);return _0x5f50a3[_0x3d95('0xe6')](_0x1c6dff);}})[_0x3d95('0x16')](function(_0x504037){if(_0x504037){_0x36a5eb=_0x504037[_0x3d95('0x5e')];if(!_0x20ab1c[_0x3d95('0x47')]['hasOwnProperty'](_0x3d95('0xda'))){_0x1c6dff[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x20ab1c[_0x3d95('0x47')][_0x3d95('0x26')]);_0x1c6dff[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x20ab1c[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x5f50a3[_0x3d95('0xe6')](_0x1c6dff);}})[_0x3d95('0x16')](function(_0x2e7678){if(_0x2e7678){return _0x2e7678?{'count':_0x36a5eb,'rows':_0x2e7678}:null;}})[_0x3d95('0x16')](respondWithResult(_0x4fc308,null))['catch'](handleError(_0x4fc308,null));};exports['getMailInteractions']=function(_0x17f200,_0x2d6cc5){var _0x4d8b72={'raw':!![],'where':{}};var _0x485c4d={};var _0xe321fa={'count':0x0,'rows':[]};return db[_0x3d95('0x4d')]['findOne']({'where':{'id':_0x17f200['params']['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x2d6cc5,null))[_0x3d95('0x16')](function(_0x4aea81){if(_0x4aea81){_0x485c4d[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0xe7')][_0x3d95('0x3f')]);_0x485c4d[_0x3d95('0x47')]=_['keys'](_0x17f200[_0x3d95('0x47')]);_0x485c4d['filters']=_[_0x3d95('0x5c')](_0x485c4d[_0x3d95('0x59')],_0x485c4d['query']);_0x4d8b72['attributes']=_[_0x3d95('0x5c')](_0x485c4d['model'],qs[_0x3d95('0x5d')](_0x17f200[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x4d8b72[_0x3d95('0x4c')]=_0x4d8b72['attributes'][_0x3d95('0x5e')]?_0x4d8b72[_0x3d95('0x4c')]:_0x485c4d[_0x3d95('0x59')];if(!_0x17f200[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x4d8b72['limit']=qs[_0x3d95('0x26')](_0x17f200[_0x3d95('0x47')][_0x3d95('0x26')]);_0x4d8b72['offset']=qs['offset'](_0x17f200[_0x3d95('0x47')][_0x3d95('0x24')]);}_0x4d8b72[_0x3d95('0xd1')]=qs['sort'](_0x17f200[_0x3d95('0x47')]['sort']);_0x4d8b72[_0x3d95('0x45')]=qs['filters'](_[_0x3d95('0xd3')](_0x17f200['query'],_0x485c4d[_0x3d95('0x5b')]));_0x4d8b72[_0x3d95('0x45')][_0x3d95('0xe1')]=_0x4aea81['id'];if(_0x17f200[_0x3d95('0x47')][_0x3d95('0x33')]){_0x4d8b72[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x4d8b72[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x4d8b72[_0x3d95('0x4c')],function(_0x2c70e9){var _0x1719df={};_0x1719df[_0x2c70e9]={'$like':'%'+_0x17f200[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x1719df;})});}_0x4d8b72=_['merge']({},_0x4d8b72,_0x17f200['options']);return db[_0x3d95('0xe7')]['count']({'where':_0x4d8b72[_0x3d95('0x45')]})[_0x3d95('0x16')](function(_0x4e8fcb){_0xe321fa[_0x3d95('0x27')]=_0x4e8fcb;if(_0x17f200['query']['includeAll']){_0x4d8b72[_0x3d95('0x4a')]=[{'all':!![]}];}return db[_0x3d95('0xe7')][_0x3d95('0x4e')](_0x4d8b72);})[_0x3d95('0x16')](function(_0x226030){_0xe321fa[_0x3d95('0x51')]=_0x226030;return _0xe321fa;});}})[_0x3d95('0x16')](respondWithFilteredResult(_0x2d6cc5,_0x4d8b72))['catch'](handleError(_0x2d6cc5,null));};exports[_0x3d95('0xe8')]=function(_0x5c1826,_0x1ded0a){var _0x3e5562={};var _0x5b8fe0={};var _0x2ab804;var _0x12d946;return db['User'][_0x3d95('0x9e')]({'where':{'id':_0x5c1826[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x1ded0a,null))['then'](function(_0x4c96bb){if(_0x4c96bb){_0x2ab804=_0x4c96bb;_0x5b8fe0[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db['SmsInteraction'][_0x3d95('0x3f')]);_0x5b8fe0[_0x3d95('0x47')]=_['keys'](_0x5c1826[_0x3d95('0x47')]);_0x5b8fe0[_0x3d95('0x5b')]=_['intersection'](_0x5b8fe0[_0x3d95('0x59')],_0x5b8fe0[_0x3d95('0x47')]);_0x3e5562[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x5b8fe0[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x5c1826[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x3e5562['attributes']=_0x3e5562['attributes'][_0x3d95('0x5e')]?_0x3e5562[_0x3d95('0x4c')]:_0x5b8fe0[_0x3d95('0x59')];_0x3e5562[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x5c1826[_0x3d95('0x47')][_0x3d95('0xd2')]);_0x3e5562[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x5c1826[_0x3d95('0x47')],_0x5b8fe0[_0x3d95('0x5b')]));if(_0x5c1826[_0x3d95('0x47')][_0x3d95('0x33')]){_0x3e5562[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x3e5562[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x3e5562[_0x3d95('0x4c')],function(_0x451bb7){var _0x5951bb={};_0x5951bb[_0x451bb7]={'$like':'%'+_0x5c1826['query']['filter']+'%'};return _0x5951bb;})});}_0x3e5562=_['merge']({},_0x3e5562,_0x5c1826[_0x3d95('0x60')]);return _0x2ab804[_0x3d95('0xe8')](_0x3e5562);}})[_0x3d95('0x16')](function(_0x2e60ff){if(_0x2e60ff){_0x12d946=_0x2e60ff[_0x3d95('0x5e')];if(!_0x5c1826[_0x3d95('0x47')][_0x3d95('0xd4')]('nolimit')){_0x3e5562[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x5c1826[_0x3d95('0x47')][_0x3d95('0x26')]);_0x3e5562[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x5c1826[_0x3d95('0x47')]['offset']);}return _0x2ab804[_0x3d95('0xe8')](_0x3e5562);}})[_0x3d95('0x16')](function(_0x4597b7){if(_0x4597b7){return _0x4597b7?{'count':_0x12d946,'rows':_0x4597b7}:null;}})['then'](respondWithResult(_0x1ded0a,null))[_0x3d95('0x20')](handleError(_0x1ded0a,null));};exports['getFaxInteractions']=function(_0x28e004,_0x3adbec){var _0x23af48={};var _0x577d85={};var _0x4736ba;var _0x9f8035;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x28e004[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x3adbec,null))[_0x3d95('0x16')](function(_0x177ae9){if(_0x177ae9){_0x4736ba=_0x177ae9;_0x577d85[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0xe9')][_0x3d95('0x3f')]);_0x577d85[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x28e004['query']);_0x577d85[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x577d85[_0x3d95('0x59')],_0x577d85[_0x3d95('0x47')]);_0x23af48[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x577d85[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x28e004[_0x3d95('0x47')]['fields']));_0x23af48['attributes']=_0x23af48['attributes']['length']?_0x23af48[_0x3d95('0x4c')]:_0x577d85[_0x3d95('0x59')];_0x23af48[_0x3d95('0xd1')]=qs['sort'](_0x28e004[_0x3d95('0x47')]['sort']);_0x23af48['where']=qs['filters'](_[_0x3d95('0xd3')](_0x28e004[_0x3d95('0x47')],_0x577d85[_0x3d95('0x5b')]));if(_0x28e004[_0x3d95('0x47')][_0x3d95('0x33')]){_0x23af48[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x23af48[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x23af48['attributes'],function(_0x1598e2){var _0x53d346={};_0x53d346[_0x1598e2]={'$like':'%'+_0x28e004['query'][_0x3d95('0x33')]+'%'};return _0x53d346;})});}_0x23af48=_['merge']({},_0x23af48,_0x28e004[_0x3d95('0x60')]);return _0x4736ba[_0x3d95('0xea')](_0x23af48);}})[_0x3d95('0x16')](function(_0x3c2396){if(_0x3c2396){_0x9f8035=_0x3c2396['length'];if(!_0x28e004[_0x3d95('0x47')][_0x3d95('0xd4')](_0x3d95('0xda'))){_0x23af48[_0x3d95('0x26')]=qs[_0x3d95('0x26')](_0x28e004[_0x3d95('0x47')]['limit']);_0x23af48[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0x28e004[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x4736ba[_0x3d95('0xea')](_0x23af48);}})[_0x3d95('0x16')](function(_0x558947){if(_0x558947){return _0x558947?{'count':_0x9f8035,'rows':_0x558947}:null;}})[_0x3d95('0x16')](respondWithResult(_0x3adbec,null))[_0x3d95('0x20')](handleError(_0x3adbec,null));};exports[_0x3d95('0xeb')]=function(_0xe83dd8,_0x47a1be){var _0x2add31={};var _0x4ba733={};var _0x153c70;var _0x3942d7;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0xe83dd8[_0x3d95('0x58')]['id']}})[_0x3d95('0x16')](handleEntityNotFound(_0x47a1be,null))['then'](function(_0x27a630){if(_0x27a630){_0x153c70=_0x27a630;_0x4ba733[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db['WhatsappInteraction'][_0x3d95('0x3f')]);_0x4ba733[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0xe83dd8[_0x3d95('0x47')]);_0x4ba733[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x4ba733[_0x3d95('0x59')],_0x4ba733[_0x3d95('0x47')]);_0x2add31[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x4ba733['model'],qs[_0x3d95('0x5d')](_0xe83dd8[_0x3d95('0x47')][_0x3d95('0x5d')]));_0x2add31[_0x3d95('0x4c')]=_0x2add31[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x2add31[_0x3d95('0x4c')]:_0x4ba733[_0x3d95('0x59')];_0x2add31[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0xe83dd8['query'][_0x3d95('0xd2')]);_0x2add31[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0xe83dd8[_0x3d95('0x47')],_0x4ba733[_0x3d95('0x5b')]));if(_0xe83dd8[_0x3d95('0x47')][_0x3d95('0x33')]){_0x2add31[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x2add31[_0x3d95('0x45')],{'$or':_['map'](_0x2add31['attributes'],function(_0x54782e){var _0x7dd6fe={};_0x7dd6fe[_0x54782e]={'$like':'%'+_0xe83dd8[_0x3d95('0x47')]['filter']+'%'};return _0x7dd6fe;})});}_0x2add31=_[_0x3d95('0x5f')]({},_0x2add31,_0xe83dd8['options']);return _0x153c70[_0x3d95('0xeb')](_0x2add31);}})[_0x3d95('0x16')](function(_0x2c8fc5){if(_0x2c8fc5){_0x3942d7=_0x2c8fc5[_0x3d95('0x5e')];if(!_0xe83dd8[_0x3d95('0x47')][_0x3d95('0xd4')]('nolimit')){_0x2add31[_0x3d95('0x26')]=qs['limit'](_0xe83dd8[_0x3d95('0x47')][_0x3d95('0x26')]);_0x2add31[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0xe83dd8[_0x3d95('0x47')][_0x3d95('0x24')]);}return _0x153c70[_0x3d95('0xeb')](_0x2add31);}})[_0x3d95('0x16')](function(_0x40b520){if(_0x40b520){return _0x40b520?{'count':_0x3942d7,'rows':_0x40b520}:null;}})[_0x3d95('0x16')](respondWithResult(_0x47a1be,null))[_0x3d95('0x20')](handleError(_0x47a1be,null));};exports[_0x3d95('0xec')]=function(_0x54c3ee,_0x46de58,_0x2cb273){var _0x4b0475;var _0x24f971;var _0x2bf1da;var _0x3140b7=!_[_0x3d95('0x6f')](_0x54c3ee[_0x3d95('0x58')]['id'])?_0x54c3ee['params']['id']:!_[_0x3d95('0x6f')](_0x54c3ee['user']['id'])?_0x54c3ee[_0x3d95('0x87')]['id']:null;return db['User'][_0x3d95('0x38')]({'where':{'id':_0x3140b7,'role':{'$or':[_0x3d95('0x2d'),'user',_0x3d95('0x30')]}},'attributes':['id','name',_0x3d95('0xed'),_0x3d95('0xee'),_0x3d95('0x37'),_0x3d95('0x70'),_0x3d95('0xef')]})[_0x3d95('0x16')](function(_0x4ce4fb){if(_0x4ce4fb){if(_0x4ce4fb['role']==='agent'){_0x4b0475=_0x4ce4fb;if(_0x54c3ee[_0x3d95('0x64')]['interface']){_0x2bf1da=util[_0x3d95('0xf0')](_0x3d95('0xf1'),_0x4b0475[_0x54c3ee[_0x3d95('0x64')][_0x3d95('0xb2')]]);}else if(_0x54c3ee[_0x3d95('0x64')][_0x3d95('0xf2')]){_0x2bf1da=util[_0x3d95('0xf0')](_0x3d95('0xf3'),_0x54c3ee['body']['intrf']);}else{_0x2bf1da=util[_0x3d95('0xf0')](_0x3d95('0xf3'),_0x4b0475[_0x3d95('0x39')]);}socket['to'](util[_0x3d95('0xf0')](_0x3d95('0xf4'),_0x4b0475[_0x3d95('0x39')]))[_0x3d95('0x29')]('user:forcelogout',{'user':{'id':_0x4b0475['id'],'name':_0x4b0475[_0x3d95('0x39')]},'ip':_0x54c3ee['headers'][_0x3d95('0xf5')]||_0x54c3ee[_0x3d95('0xf6')]['remoteAddress']||_0x54c3ee['socket'][_0x3d95('0xf7')]||_0x54c3ee[_0x3d95('0xf6')]['socket']['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4b0475['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x3d95('0x98'))](_0x3d95('0xf8'));}})['then'](function(){if(_0x4b0475){return _0x4b0475[_0x3d95('0xf9')]({'raw':!![]});}})['then'](function(_0x5abd3e){if(_0x4b0475){var _0x3d4517=[];if(_0x5abd3e){_0x24f971=_0x5abd3e;if(_0x24f971['length']){for(var _0x3c2ed9=0x0;_0x3c2ed9<_0x24f971[_0x3d95('0x5e')];_0x3c2ed9++){_0x3d4517['push']({'membername':_0x4b0475[_0x3d95('0x39')],'UserId':_0x4b0475['id'],'queue_name':_0x24f971[_0x3c2ed9][_0x3d95('0x39')],'VoiceQueueId':_0x24f971[_0x3c2ed9]['id'],'interface':_0x2bf1da,'paused':_0x4b0475['loginInPause']||![],'penalty':_0x24f971[_0x3c2ed9][_0x3d95('0xfa')]||0x0});}return BPromise[_0x3d95('0x91')](_0x3d4517,function(_0x4a52d8){return db['UserVoiceQueueRt'][_0x3d95('0xb4')](_0x4a52d8);});}}}})[_0x3d95('0x16')](function(){if(_0x4b0475){return db[_0x3d95('0xfb')][_0x3d95('0x4e')]({'where':{'membername':_0x4b0475[_0x3d95('0x39')],'exitAt':null}});}})[_0x3d95('0x16')](function(_0x3d0213){if(_0x4b0475){var _0x1ba4dc=[];_0x3d0213['forEach'](function(_0x2d0f47){_0x1ba4dc[_0x3d95('0x50')](_0x2d0f47[_0x3d95('0x63')]({'exitAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc'))}));});return BPromise[_0x3d95('0x56')](_0x1ba4dc);}})['then'](function(){if(_0x4b0475){var _0x410e3d=[];var _0x447f41=[];var _0x75bc2c=utils['getChannels']();var _0x1602c1={'membername':_0x4b0475[_0x3d95('0x39')],'interface':_0x2bf1da,'enterAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc')),'role':_0x4b0475[_0x3d95('0x37')],'internal':_0x4b0475[_0x3d95('0x70')]};_0x75bc2c[_0x3d95('0xfd')](function(_0x51152a){_0x410e3d[_0x3d95('0x50')](_['merge']({'channel':_0x51152a,'type':'LOGIN','data1':_0x54c3ee[_0x3d95('0x64')][_0x3d95('0xfe')],'data2':_0x2bf1da},_0x1602c1));if(_0x4b0475[_0x3d95('0xef')]){_0x447f41['push'](_[_0x3d95('0x5f')]({'channel':_0x51152a,'type':_0x3d95('0xff'),'data1':_0x3d95('0x100')},_0x1602c1));}});return db['MemberReport'][_0x3d95('0x8e')](_0x410e3d[_0x3d95('0xce')](_0x447f41),{'individualHooks':!![]});}})[_0x3d95('0x16')](function(){if(_0x4b0475){return _0x4b0475[_0x3d95('0x63')]({'online':!![],'lastLoginAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc')),'voicePause':_0x4b0475[_0x3d95('0xef')]||![],'mailPause':_0x4b0475[_0x3d95('0xef')]||![],'chatPause':_0x4b0475['loginInPause']||![],'faxPause':_0x4b0475[_0x3d95('0xef')]||![],'smsPause':_0x4b0475[_0x3d95('0xef')]||![],'openchannelPause':_0x4b0475[_0x3d95('0xef')]||![],'whatsappPause':_0x4b0475[_0x3d95('0xef')]||![],'pauseType':_0x4b0475['loginInPause']?_0x3d95('0x100'):null,'interface':_0x2bf1da,'lastPauseAt':moment()['format'](_0x3d95('0xfc'))});}})['then'](function(_0x596c23){if(_0x54c3ee[_0x3d95('0x101')]){return _0x2cb273();}else{return BPromise['resolve'](_0x596c23)[_0x3d95('0x16')](respondWithResult(_0x46de58,null));}})[_0x3d95('0x20')](handleError(_0x46de58,null));};exports[_0x3d95('0x102')]=function(_0x423ed0,_0x46ca58){var _0xf98d13;return db[_0x3d95('0x4d')][_0x3d95('0x38')]({'where':{'id':_0x423ed0[_0x3d95('0x58')]['id'],'role':_0x3d95('0x30')},'attributes':['id','name',_0x3d95('0x37')]})[_0x3d95('0x16')](handleEntityNotFound(_0x46ca58,null))[_0x3d95('0x16')](function(_0x467d17){if(_0x467d17){_0xf98d13=_0x467d17;return db[_0x3d95('0xb3')][_0x3d95('0x2b')]({'where':{'membername':_0xf98d13[_0x3d95('0x39')]},'individualHooks':!![]});}})[_0x3d95('0x16')](function(){return db['MemberReport'][_0x3d95('0x4e')]({'where':{'membername':_0xf98d13['name'],'exitAt':null}});})['then'](function(_0x24f032){var _0x14e81a=[];_0x24f032[_0x3d95('0xfd')](function(_0x352667){_0x14e81a[_0x3d95('0x50')](_0x352667[_0x3d95('0x63')]({'exitAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc'))}));});return BPromise[_0x3d95('0x56')](_0x14e81a);})[_0x3d95('0x16')](function(){return _0xf98d13[_0x3d95('0x63')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x3d95('0x16')](respondWithResult(_0x46ca58,null))[_0x3d95('0x20')](handleError(_0x46ca58,null));};exports[_0x3d95('0x103')]=function(_0x592320,_0x5115ed){var _0x2d7548;return db[_0x3d95('0xb3')]['update']({'paused':0x1},{'where':{'UserId':_0x592320[_0x3d95('0x58')]['id']},'individualHooks':!![]})[_0x3d95('0x16')](function(){return db[_0x3d95('0x4d')][_0x3d95('0x38')]({'where':{'id':_0x592320[_0x3d95('0x58')]['id'],'role':'agent'},'attributes':['id','name',_0x3d95('0x37'),_0x3d95('0x70'),'interface']});})[_0x3d95('0x16')](handleEntityNotFound(_0x5115ed,null))['then'](function(_0x5c9628){if(_0x5c9628){_0x2d7548=_0x5c9628;return respondWithRpcPromise(_0x3d95('0x104'),_0x3d95('0x103'),{'id':_0x2d7548['id'],'name':_0x2d7548[_0x3d95('0x39')],'pause':!![]});}})[_0x3d95('0x16')](function(){if(_0x2d7548){return db['MemberReport'][_0x3d95('0x4e')]({'where':{'membername':_0x2d7548[_0x3d95('0x39')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x114de6){if(_0x114de6[_0x3d95('0x5e')]){var _0xf3f267=moment()[_0x3d95('0xf0')](_0x3d95('0xfc'));for(var _0x3fab7c=0x0,_0x9a533f=_0x114de6[_0x3d95('0x5e')];_0x3fab7c<_0x9a533f;_0x3fab7c++){_0x114de6[_0x3fab7c][_0x3d95('0x105')]({'exitAt':_0xf3f267});}}})[_0x3d95('0x16')](function(){var _0xb648e2=[];var _0x1e4377=utils['getChannels']();_0x1e4377[_0x3d95('0xfd')](function(_0x282185){_0xb648e2['push']({'channel':_0x282185,'membername':_0x2d7548['name'],'interface':_[_0x3d95('0x6f')](_0x2d7548[_0x3d95('0xb2')])?util[_0x3d95('0xf0')](_0x3d95('0xf3'),_0x2d7548['name']):_0x2d7548[_0x3d95('0xb2')],'type':'PAUSE','enterAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc')),'data1':_0x592320[_0x3d95('0x64')][_0x3d95('0x41')]||_0x3d95('0x106'),'role':_0x2d7548['role'],'internal':_0x2d7548[_0x3d95('0x70')]});});return db[_0x3d95('0xfb')][_0x3d95('0x8e')](_0xb648e2,{'individualHooks':!![]});})[_0x3d95('0x16')](function(){return _0x2d7548['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x592320['body'][_0x3d95('0x41')]||_0x3d95('0x106'),'lastPauseAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc'))});})[_0x3d95('0x16')](respondWithResult(_0x5115ed,null))[_0x3d95('0x20')](handleError(_0x5115ed,null));};exports[_0x3d95('0x107')]=function(_0xe4a9fb,_0x41888d){var _0x17a0e7;return db['User']['find']({'where':{'id':_0xe4a9fb[_0x3d95('0x58')]['id']},'attributes':['id',_0x3d95('0x39'),_0x3d95('0x37'),'voicePause',_0x3d95('0x108'),_0x3d95('0x109'),_0x3d95('0x10a'),_0x3d95('0x10b'),'smsPause',_0x3d95('0x10c'),_0x3d95('0x10d'),_0x3d95('0x10e')]})[_0x3d95('0x16')](handleEntityNotFound(_0x41888d,null))[_0x3d95('0x16')](function(_0x58e041){if(_0x58e041){_0x17a0e7=_0x58e041;if(_0xe4a9fb[_0x3d95('0x64')][_0x3d95('0xa4')]&&!utils['isValidChannel'](_0xe4a9fb[_0x3d95('0x64')][_0x3d95('0xa4')])){throw new db[(_0x3d95('0x97'))][(_0x3d95('0x98'))](_0x3d95('0xa6'));}switch(_0xe4a9fb[_0x3d95('0x64')][_0x3d95('0xa4')]){case _0x3d95('0xb0'):return respondWithRpcPromise(_0x3d95('0x104'),_0x3d95('0x107'),{'id':_0x17a0e7['id'],'name':_0x17a0e7[_0x3d95('0x39')],'pause':![]})[_0x3d95('0x16')](function(){return db[_0x3d95('0xb3')][_0x3d95('0x63')]({'paused':0x0},{'where':{'UserId':_0x17a0e7['id']},'individualHooks':!![]});})[_0x3d95('0x16')](function(){return db[_0x3d95('0xfb')]['find']({'where':{'channel':_0xe4a9fb[_0x3d95('0x64')][_0x3d95('0xa4')],'membername':_0x17a0e7[_0x3d95('0x39')],'type':'PAUSE','exitAt':null}});})[_0x3d95('0x16')](function(_0x28c938){if(_0x28c938){return _0x28c938[_0x3d95('0x63')]({'exitAt':moment()['format'](_0x3d95('0xfc')),'data2':_0x3d95('0x10f')},{'individualHooks':!![]});}return null;})[_0x3d95('0x16')](function(){return _0x17a0e7[_0x3d95('0x63')]({'voicePause':![]});});case _0x3d95('0x54'):case'chat':case'fax':case'sms':case'whatsapp':case _0x3d95('0xc3'):return db[_0x3d95('0xfb')][_0x3d95('0x38')]({'where':{'channel':_0xe4a9fb[_0x3d95('0x64')][_0x3d95('0xa4')],'membername':_0x17a0e7[_0x3d95('0x39')],'type':'PAUSE','exitAt':null}})['then'](function(_0x556b44){if(_0x556b44){return _0x556b44[_0x3d95('0x63')]({'exitAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc')),'data2':_0x3d95('0x10f')},{'individualHooks':!![]});}return null;})[_0x3d95('0x16')](function(){var _0x1020db={};_[_0x3d95('0x28')](_0x1020db,util[_0x3d95('0xf0')](_0x3d95('0x110'),_0xe4a9fb['body']['channel'],_0x3d95('0x111')),![]);return _0x17a0e7['update'](_0x1020db);});default:return respondWithRpcPromise(_0x3d95('0x104'),'unpause',{'id':_0x17a0e7['id'],'name':_0x17a0e7[_0x3d95('0x39')],'pause':![]})[_0x3d95('0x16')](function(){return db['UserVoiceQueueRt'][_0x3d95('0x63')]({'paused':0x0},{'where':{'UserId':_0x17a0e7['id']}});})[_0x3d95('0x16')](function(){return db[_0x3d95('0xfb')][_0x3d95('0x4e')]({'where':{'membername':_0x17a0e7[_0x3d95('0x39')],'type':_0x3d95('0xff'),'exitAt':null}});})[_0x3d95('0x16')](function(_0x1a7b5f){var _0xf371a7=[];_0x1a7b5f['forEach'](function(_0x123dfb){_0xf371a7[_0x3d95('0x50')](_0x123dfb[_0x3d95('0x63')]({'exitAt':moment()[_0x3d95('0xf0')](_0x3d95('0xfc')),'data2':_0x3d95('0x10f')}));});return BPromise['all'](_0xf371a7);})[_0x3d95('0x16')](function(){return _0x17a0e7[_0x3d95('0x63')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x3d95('0x16')](respondWithResult(_0x41888d,null))[_0x3d95('0x20')](handleError(_0x41888d,null));};exports[_0x3d95('0x112')]=function(_0x53d334,_0x226659){var _0x2ec221={};var _0x447309={};var _0x106df1;var _0x2b294d;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x53d334[_0x3d95('0x58')]['id']}})['then'](handleEntityNotFound(_0x226659,null))[_0x3d95('0x16')](function(_0xe4ff7a){if(_0xe4ff7a){_0x106df1=_0xe4ff7a;_0x447309[_0x3d95('0x59')]=_[_0x3d95('0x5a')](db[_0x3d95('0x113')][_0x3d95('0x3f')]);_0x447309[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x53d334['query']);_0x447309[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x447309['model'],_0x447309[_0x3d95('0x47')]);_0x2ec221[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x447309[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x53d334[_0x3d95('0x47')]['fields']));_0x2ec221[_0x3d95('0x4c')]=_0x2ec221[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x2ec221[_0x3d95('0x4c')]:_0x447309[_0x3d95('0x59')];_0x2ec221[_0x3d95('0xd1')]=qs[_0x3d95('0xd2')](_0x53d334[_0x3d95('0x47')][_0x3d95('0xd2')]);_0x2ec221[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_[_0x3d95('0xd3')](_0x53d334['query'],_0x447309[_0x3d95('0x5b')]));if(_0x53d334[_0x3d95('0x47')][_0x3d95('0x33')]){_0x2ec221[_0x3d95('0x45')]=_['merge'](_0x2ec221['where'],{'$or':_[_0x3d95('0x34')](_0x2ec221[_0x3d95('0x4c')],function(_0x31797d){var _0xa32929={};_0xa32929[_0x31797d]={'$like':'%'+_0x53d334['query']['filter']+'%'};return _0xa32929;})});}_0x2ec221=_[_0x3d95('0x5f')]({},_0x2ec221,_0x53d334[_0x3d95('0x60')]);return _0x106df1[_0x3d95('0x112')](_0x2ec221);}})[_0x3d95('0x16')](function(_0x2746ab){if(_0x2746ab){_0x2b294d=_0x2746ab['length'];if(!_0x53d334[_0x3d95('0x47')][_0x3d95('0xd4')]('nolimit')){_0x2ec221['limit']=qs[_0x3d95('0x26')](_0x53d334['query'][_0x3d95('0x26')]);_0x2ec221[_0x3d95('0x24')]=qs['offset'](_0x53d334['query']['offset']);}return _0x106df1[_0x3d95('0x112')](_0x2ec221);}})[_0x3d95('0x16')](function(_0x2fcd96){if(_0x2fcd96){return _0x2fcd96?{'count':_0x2b294d,'rows':_0x2fcd96}:null;}})[_0x3d95('0x16')](respondWithResult(_0x226659,null))[_0x3d95('0x20')](handleError(_0x226659,null));};exports[_0x3d95('0x114')]=function(_0x5279bb,_0x1bcf9b){var _0x122622=_0x5279bb[_0x3d95('0x58')]['id'];var _0x1ff562=_0x5279bb[_0x3d95('0x64')]?_0x5279bb['body'][_0x3d95('0x67')]:null;var _0x3989f0=[];return Promise[_0x3d95('0x115')]()[_0x3d95('0x16')](function(){if(!_0x1ff562)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x3d95('0x16')](function(){return db['User'][_0x3d95('0x9e')]({'where':{'id':_0x122622}});})[_0x3d95('0x16')](function(_0x29ba05){if(!_0x29ba05)throw new APINotFoundError(util['format'](_0x3d95('0x116'),_0x5279bb[_0x3d95('0x58')]['id']));return db['sequelize'][_0x3d95('0x117')](function(_0x2caa94){return _0x29ba05[_0x3d95('0x114')](_0x1ff562,{'transaction':_0x2caa94})[_0x3d95('0x16')](function(){return db[_0x3d95('0x113')][_0x3d95('0x4e')]({'where':{'id':{'$in':_0x1ff562}}});})[_0x3d95('0x16')](function(_0x2dceb3){var _0x38a63e=_[_0x3d95('0x34')](_0x2dceb3,function(_0x3cf33a){return _0x3cf33a['getAssociatedQueues']();});return Promise[_0x3d95('0x56')](_0x38a63e);})[_0x3d95('0x16')](function(_0x137de4){_0x3989f0=_[_0x3d95('0x118')](_0x137de4);var _0x419add=_['map'](_0x3989f0,function(_0x4959f7){return _0x4959f7[_0x3d95('0x119')](_0x29ba05['id'],{'transaction':_0x2caa94});});return Promise[_0x3d95('0x56')](_0x419add);})['then'](function(){if(!_0x29ba05['online'])return;var _0x49e732=_[_0x3d95('0x33')](_0x3989f0,function(_0x5b52d3){return _0x5b52d3['getDataValue'](_0x3d95('0xa4'))===_0x3d95('0x11a');});var _0x4b6e77=_[_0x3d95('0x34')](_0x49e732,function(_0x499730){return db[_0x3d95('0xb3')][_0x3d95('0xb4')]({'membername':_0x29ba05['name'],'UserId':_0x29ba05['id'],'queue_name':_0x499730['name'],'VoiceQueueId':_0x499730['id'],'interface':_[_0x3d95('0x6f')](_0x29ba05[_0x3d95('0xb2')])?util['format'](_0x3d95('0xf3'),_0x29ba05[_0x3d95('0x39')]):_0x29ba05['interface'],'paused':_0x29ba05[_0x3d95('0x11b')]||![],'penalty':_0x29ba05[_0x3d95('0xaa')]},{'transaction':_0x2caa94});});return Promise['all'](_0x4b6e77);})[_0x3d95('0x16')](function(){return db[_0x3d95('0x11c')][_0x3d95('0x4e')]({'where':{'teamId':{'$in':_0x1ff562}}});})[_0x3d95('0x16')](function(_0x411c7b){var _0x6fbdd7=_[_0x3d95('0x34')](_0x411c7b,function(_0x1b8647){return db[_0x3d95('0x11d')]['create']({'UserId':_0x29ba05['id'],'VoicePrefixId':_0x1b8647[_0x3d95('0x11e')]},{'transaction':_0x2caa94});});return Promise[_0x3d95('0x56')](_0x6fbdd7);});});})[_0x3d95('0x16')](function(){for(var _0x32900f=0x0;_0x32900f<_0x3989f0['length'];_0x32900f++){var _0x5e48bd=_0x3989f0[_0x32900f]['getDataValue']('channel');var _0x5e9634=_0x5e48bd+_0x3d95('0xad');socket[_0x3d95('0x29')](_0x3d95('0x87')+_0x5e48bd+_0x3d95('0xae'),{'UserId':_0x122622,['queueField']:_0x3989f0[_0x32900f]['id']});}})[_0x3d95('0x16')](respondWithStatusCode(_0x1bcf9b,null))[_0x3d95('0x20')](APIHandleError(_0x1bcf9b));};exports[_0x3d95('0x11f')]=function(_0x8eca6b,_0xa47043){var _0x1bd47f=_0x8eca6b[_0x3d95('0x58')]['id'];var _0x1e02bf=null;if(_0x8eca6b[_0x3d95('0x47')][_0x3d95('0x67')]){_0x1e02bf=_[_0x3d95('0xb7')](_0x8eca6b[_0x3d95('0x47')][_0x3d95('0x67')])?_0x8eca6b[_0x3d95('0x47')][_0x3d95('0x67')]:[_0x8eca6b[_0x3d95('0x47')][_0x3d95('0x67')]];}var _0x37ebff=[];return Promise[_0x3d95('0x115')]()['then'](function(){if(!_0x1e02bf)throw new APIBadRequestError(_0x3d95('0x120'));})['then'](function(){return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0x1bd47f}});})[_0x3d95('0x16')](function(_0x4dd284){if(!_0x4dd284)throw new APINotFoundError(util[_0x3d95('0xf0')](_0x3d95('0x116'),_0x8eca6b['params']['id']));return db[_0x3d95('0x72')][_0x3d95('0x117')](function(_0x54fad3){return _0x4dd284[_0x3d95('0x11f')](_0x1e02bf,{'transaction':_0x54fad3})['then'](function(){return db[_0x3d95('0x113')]['findAll']({'where':{'id':{'$in':_0x1e02bf}}});})[_0x3d95('0x16')](function(_0x5f509a){var _0x3b8f7f=_[_0x3d95('0x34')](_0x5f509a,function(_0xc51565){return _0xc51565[_0x3d95('0x121')]();});return Promise['all'](_0x3b8f7f);})[_0x3d95('0x16')](function(_0x3453e5){_0x37ebff=_[_0x3d95('0x118')](_0x3453e5);var _0x2d9392=_[_0x3d95('0x34')](_0x37ebff,function(_0x2bb1e7){return _0x2bb1e7[_0x3d95('0x122')](_0x4dd284['id'],{'transaction':_0x54fad3});});return Promise[_0x3d95('0x56')](_0x2d9392);})[_0x3d95('0x16')](function(){if(!_0x4dd284[_0x3d95('0xb1')])return;var _0x3ef9f4=_[_0x3d95('0x33')](_0x37ebff,function(_0x483b03){return _0x483b03[_0x3d95('0x123')]('channel')==='Voice';});var _0x25c53e=_[_0x3d95('0x34')](_0x3ef9f4,function(_0x51fa66){return db[_0x3d95('0xb3')][_0x3d95('0x2b')]({'where':{'VoiceQueueId':_0x51fa66['id'],'UserId':_0x4dd284['id']},'transaction':_0x54fad3});});return Promise[_0x3d95('0x56')](_0x25c53e);})[_0x3d95('0x16')](function(){return db[_0x3d95('0x11c')][_0x3d95('0x4e')]({'where':{'teamId':{'$in':_0x1e02bf}}});})['then'](function(_0x4f071b){var _0x55e259=_[_0x3d95('0x34')](_0x4f071b,function(_0xa12e13){return db[_0x3d95('0x11d')]['destroy']({'where':{'UserId':_0x4dd284['id'],'VoicePrefixId':_0xa12e13[_0x3d95('0x11e')]}},{'transaction':_0x54fad3});});return Promise[_0x3d95('0x56')](_0x55e259);});});})[_0x3d95('0x16')](function(){for(var _0x2a4e8d=0x0;_0x2a4e8d<_0x37ebff[_0x3d95('0x5e')];_0x2a4e8d++){var _0x22b0c9=_0x37ebff[_0x2a4e8d]['getDataValue']('channel');var _0x5d5b8a=_0x22b0c9+_0x3d95('0xad');socket[_0x3d95('0x29')]('user'+_0x22b0c9+_0x3d95('0xb8'),{'UserId':_0x1bd47f,['queueField']:_0x37ebff[_0x2a4e8d]['id']});}})[_0x3d95('0x16')](respondWithStatusCode(_0xa47043,null))[_0x3d95('0x20')](APIHandleError(_0xa47043));};exports['getLists']=function(_0xbe0039,_0x5337d3){var _0xd1ab97={};var _0x53a9d5={};var _0x5d0497;var _0x3ba37c;return db[_0x3d95('0x4d')][_0x3d95('0x9e')]({'where':{'id':_0xbe0039['params']['id']}})['then'](handleEntityNotFound(_0x5337d3,null))['then'](function(_0x166871){if(_0x166871){_0x5d0497=_0x166871;_0x53a9d5['model']=_['keys'](db[_0x3d95('0xd5')][_0x3d95('0x3f')]);_0x53a9d5[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0xbe0039[_0x3d95('0x47')]);_0x53a9d5['filters']=_[_0x3d95('0x5c')](_0x53a9d5['model'],_0x53a9d5['query']);_0xd1ab97[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x53a9d5[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0xbe0039[_0x3d95('0x47')][_0x3d95('0x5d')]));_0xd1ab97['attributes']=_0xd1ab97[_0x3d95('0x4c')]['length']?_0xd1ab97[_0x3d95('0x4c')]:_0x53a9d5['model'];_0xd1ab97['order']=qs[_0x3d95('0xd2')](_0xbe0039[_0x3d95('0x47')][_0x3d95('0xd2')]);_0xd1ab97[_0x3d95('0x45')]=qs['filters'](_[_0x3d95('0xd3')](_0xbe0039[_0x3d95('0x47')],_0x53a9d5[_0x3d95('0x5b')]));if(_0xbe0039['query'][_0x3d95('0x33')]){_0xd1ab97[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0xd1ab97[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0xd1ab97['attributes'],function(_0x2f9d94){var _0x116719={};_0x116719[_0x2f9d94]={'$like':'%'+_0xbe0039[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x116719;})});}_0xd1ab97=_[_0x3d95('0x5f')]({},_0xd1ab97,_0xbe0039[_0x3d95('0x60')]);return _0x5d0497['getLists'](_0xd1ab97);}})[_0x3d95('0x16')](function(_0x384826){if(_0x384826){_0x3ba37c=_0x384826['length'];if(!_0xbe0039['query'][_0x3d95('0xd4')]('nolimit')){_0xd1ab97[_0x3d95('0x26')]=qs['limit'](_0xbe0039[_0x3d95('0x47')][_0x3d95('0x26')]);_0xd1ab97[_0x3d95('0x24')]=qs[_0x3d95('0x24')](_0xbe0039['query'][_0x3d95('0x24')]);}return _0x5d0497['getLists'](_0xd1ab97);}})['then'](function(_0x478761){if(_0x478761){return _0x478761?{'count':_0x3ba37c,'rows':_0x478761}:null;}})[_0x3d95('0x16')](respondWithResult(_0x5337d3,null))['catch'](handleError(_0x5337d3,null));};exports[_0x3d95('0x124')]=function(_0x4e7d8b,_0x2cb782){var _0x2c5395={};var _0x4c4cd2={};var _0x598ea3;return db['User'][_0x3d95('0x9e')]({'where':{'id':_0x4e7d8b[_0x3d95('0x58')]['id']}})['then'](handleEntityNotFound(_0x2cb782,null))[_0x3d95('0x16')](function(_0x47093b){if(_0x47093b){_0x598ea3=_0x47093b;_0x4c4cd2[_0x3d95('0x59')]=_['keys'](db[_0x3d95('0x4d')][_0x3d95('0x3f')]);_0x4c4cd2[_0x3d95('0x47')]=_[_0x3d95('0x5a')](_0x4e7d8b[_0x3d95('0x47')]);_0x4c4cd2[_0x3d95('0x5b')]=_[_0x3d95('0x5c')](_0x4c4cd2[_0x3d95('0x59')],_0x4c4cd2[_0x3d95('0x47')]);_0x2c5395[_0x3d95('0x4c')]=_[_0x3d95('0x5c')](_0x4c4cd2[_0x3d95('0x59')],qs[_0x3d95('0x5d')](_0x4e7d8b[_0x3d95('0x47')]['fields']));_0x2c5395[_0x3d95('0x4c')]=_0x2c5395[_0x3d95('0x4c')][_0x3d95('0x5e')]?_0x2c5395[_0x3d95('0x4c')]:_0x4c4cd2[_0x3d95('0x59')];_0x2c5395['order']=qs['sort'](_0x4e7d8b[_0x3d95('0x47')]['sort']);_0x2c5395[_0x3d95('0x45')]=qs[_0x3d95('0x5b')](_['pick'](_0x4e7d8b['query'],_0x4c4cd2[_0x3d95('0x5b')]));if(_0x4e7d8b[_0x3d95('0x47')][_0x3d95('0x33')]){_0x2c5395[_0x3d95('0x45')]=_[_0x3d95('0x5f')](_0x2c5395[_0x3d95('0x45')],{'$or':_[_0x3d95('0x34')](_0x2c5395[_0x3d95('0x4c')],function(_0x28bed0){var _0x3ca79c={};_0x3ca79c[_0x28bed0]={'$like':'%'+_0x4e7d8b[_0x3d95('0x47')][_0x3d95('0x33')]+'%'};return _0x3ca79c;})});}_0x2c5395[_0x3d95('0x59')]=db['User'];_0x2c5395['as']=_0x3d95('0x2f');_0x2c5395=_[_0x3d95('0x5f')]({},_0x2c5395,_0x4e7d8b[_0x3d95('0x60')]);return _0x598ea3[_0x3d95('0xf9')]({'include':[_0x2c5395]});}})['then'](function(_0x131dcf){if(_0x131dcf){var _0x12c2ec={},_0x5c161b=[];for(var _0x4dcede=0x0;_0x4dcede<_0x131dcf[_0x3d95('0x5e')];_0x4dcede+=0x1){for(var _0x933fc0=0x0,_0x2f3d54;_0x933fc0<_0x131dcf[_0x4dcede][_0x3d95('0x2f')][_0x3d95('0x5e')];_0x933fc0+=0x1){_0x2f3d54=_0x131dcf[_0x4dcede][_0x3d95('0x2f')][_0x933fc0][_0x3d95('0x2c')]({'plain':!![]});_0x12c2ec[_0x2f3d54['id']]=_0x2f3d54;}}_0x12c2ec=_[_0x3d95('0x125')](_0x12c2ec);for(var _0x39fec0=qs['offset'](_0x4e7d8b[_0x3d95('0x47')][_0x3d95('0x24')]);_0x39fec0<_0x12c2ec[_0x3d95('0x5e')]&&_0x5c161b[_0x3d95('0x5e')]=_0x9ef5b3){_0x1193a2=_0x9ef5b3;_0x4a48e0=0xc8;}else{_0x4a48e0=0xce;}_0x4e6e4a[_0xbef8('0x1e')](_0x4a48e0);return _0x4e6e4a[_0xbef8('0x24')]('Content-Range',_0x265fde+'-'+_0x1193a2+'/'+_0x9ef5b3)['json'](_0x21d4d9);}return null;};}function saveUpdates(_0x2c89b5){return function(_0x4961e1){if(_0x4961e1){return _0x4961e1['update'](_0x2c89b5)[_0xbef8('0x12')](function(_0x1d8d17){socket[_0xbef8('0x25')](_0xbef8('0x26')+_0x1d8d17['id'],{});return _0x1d8d17;});}return null;};}function removeEntity(_0x2790f3){return function(_0x19652b){if(_0x19652b){return _0x19652b[_0xbef8('0x27')]()[_0xbef8('0x12')](function(){var _0x2b24f4=_0x19652b[_0xbef8('0x28')]({'plain':!![]});if(_0x2b24f4[_0xbef8('0x29')]===_0xbef8('0x2a'))return;var _0x37ed7d=[{'name':_0xbef8('0x2b'),'value':_0xbef8('0x2c'),'ignore':!![]},{'name':'Agents','value':_0xbef8('0x2d'),'ignore':![]},{'name':_0xbef8('0x2e'),'value':'telephone','ignore':![]}];var _0x4a1369=_(_0x37ed7d)['filter'](_0xbef8('0x2f'))[_0xbef8('0x30')]('value')[_0xbef8('0x31')]();if(_[_0xbef8('0x32')](_0x4a1369,_0x2b24f4[_0xbef8('0x29')])){return;}var _0x487cf2=_[_0xbef8('0x33')](_0x37ed7d,[_0xbef8('0x31'),_0x2b24f4[_0xbef8('0x29')]])[_0xbef8('0x34')];return db[_0xbef8('0x35')][_0xbef8('0x27')]({'where':{'type':_0x487cf2,'resourceId':_0x2b24f4['id']}})[_0xbef8('0x12')](function(){return _0x19652b;});})[_0xbef8('0x12')](function(){_0x2790f3[_0xbef8('0x1e')](0xcc)[_0xbef8('0x1f')]();});}};}function handleEntityNotFound(_0x488f41){return function(_0x12f419){if(!_0x12f419){_0x488f41[_0xbef8('0x1d')](0x194);}return _0x12f419;};}function handleError(_0x45e420,_0x3dbea5){_0x3dbea5=_0x3dbea5||0x1f4;return function(_0x13da57){logger['error'](_0x13da57[_0xbef8('0x36')]);if(_0x13da57[_0xbef8('0x34')]){delete _0x13da57['name'];}_0x45e420[_0xbef8('0x1e')](_0x3dbea5)[_0xbef8('0x37')](_0x13da57);};}exports[_0xbef8('0x38')]=function(_0x48a895,_0x2a738b){var _0x41c781={},_0x2f4bc4={'count':0x0,'rows':[]};var _0x16ee82=_(db[_0xbef8('0x39')]['rawAttributes'])['map'](function(_0x55b15e){return{'name':_0x55b15e[_0xbef8('0x3a')],'type':_0x55b15e[_0xbef8('0x3b')][_0xbef8('0x3c')]};})['filter'](function(_0x58a6d7){return!_[_0xbef8('0x32')]([_0xbef8('0x3d'),_0xbef8('0x3e')],_0x58a6d7[_0xbef8('0x34')]);})[_0xbef8('0x31')]();_0x41c781=qs[_0xbef8('0x3f')](_0x16ee82,_0x48a895);var _0x56bdd7={'where':_0x41c781[_0xbef8('0x40')]};return db[_0xbef8('0x39')][_0xbef8('0x23')](_0x56bdd7)['then'](function(_0x3d55ff){_0x2f4bc4[_0xbef8('0x23')]=_0x3d55ff;if(_0x48a895[_0xbef8('0x41')][_0xbef8('0x42')]){_0x41c781['include']=[{'all':!![]}];}if(_0x48a895[_0xbef8('0x41')][_0xbef8('0x43')]===_0xbef8('0x44')){_0x41c781[_0xbef8('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0xbef8('0x32')](_0x41c781[_0xbef8('0x46')],'id')){_0x41c781[_0xbef8('0x46')][_0xbef8('0x47')]('id');}return db[_0xbef8('0x39')][_0xbef8('0x48')](_0x41c781);})['then'](function(_0x561608){_0x2f4bc4[_0xbef8('0x49')]=_0x561608;if(_0x48a895[_0xbef8('0x41')][_0xbef8('0x4a')]===_0xbef8('0x44')){var _0x581378=[];for(var _0x368e04=0x0;_0x368e04<_0x2f4bc4['rows'][_0xbef8('0x4b')];_0x368e04++){_0x581378[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4c'),_0x2f4bc4[_0xbef8('0x49')][_0x368e04]['dataValues']));_0x581378[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4d'),_0x2f4bc4[_0xbef8('0x49')][_0x368e04][_0xbef8('0x4e')]));_0x581378[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4f'),_0x2f4bc4['rows'][_0x368e04][_0xbef8('0x4e')]));_0x581378[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x50'),_0x2f4bc4['rows'][_0x368e04][_0xbef8('0x4e')]));_0x581378[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x51'),_0x2f4bc4[_0xbef8('0x49')][_0x368e04]['dataValues']));_0x581378['push'](get_open_tabs(_0xbef8('0x52'),_0x2f4bc4[_0xbef8('0x49')][_0x368e04]['dataValues']));}return BPromise[_0xbef8('0x53')](_0x581378)['then'](function(){return _0x2f4bc4;});}else{return _0x2f4bc4;}})['then'](respondWithFilteredResult(_0x2a738b,_0x41c781))[_0xbef8('0x1c')](handleError(_0x2a738b,null));};exports['show']=function(_0xd97030,_0x2f5e50){var _0x426851={'raw':![],'where':{'id':_0xd97030['params']['id']}},_0x19f0ae={};_0x19f0ae[_0xbef8('0x54')]=_[_0xbef8('0x55')](_[_0xbef8('0x56')](db[_0xbef8('0x39')]['rawAttributes']),['password',_0xbef8('0x3e')]);_0x19f0ae[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0xd97030[_0xbef8('0x41')]);_0x19f0ae['filters']=_[_0xbef8('0x57')](_0x19f0ae[_0xbef8('0x54')],_0x19f0ae['query']);_0x426851[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0x19f0ae[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0xd97030['query'][_0xbef8('0x58')]));_0x426851[_0xbef8('0x46')]=_0x426851[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x426851[_0xbef8('0x46')]:_0x19f0ae['model'];if(_0xd97030[_0xbef8('0x41')][_0xbef8('0x42')]){_0x426851[_0xbef8('0x45')]=[{'all':!![]}];}if(_0xd97030[_0xbef8('0x41')][_0xbef8('0x43')]===_0xbef8('0x44')){_0x426851[_0xbef8('0x45')]=[{'model':db[_0xbef8('0x59')],'as':_0xbef8('0x43')}];}_0x426851=_['merge']({},_0x426851,_0xd97030[_0xbef8('0x5a')]);if(!_[_0xbef8('0x32')](_0x426851[_0xbef8('0x46')],'id')){_0x426851[_0xbef8('0x46')][_0xbef8('0x47')]('id');}return db[_0xbef8('0x39')][_0xbef8('0x33')](_0x426851)[_0xbef8('0x12')](handleEntityNotFound(_0x2f5e50,null))[_0xbef8('0x12')](function(_0xa51880){var _0x53432a=[];values=_0xa51880;if(_0xd97030[_0xbef8('0x41')][_0xbef8('0x4a')]===_0xbef8('0x44')){_0x53432a[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4c'),_0xa51880[_0xbef8('0x4e')]));_0x53432a[_0xbef8('0x47')](get_open_tabs('sms',_0xa51880[_0xbef8('0x4e')]));_0x53432a[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x51'),_0xa51880['dataValues']));_0x53432a[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x52'),_0xa51880['dataValues']));_0x53432a[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4f'),_0xa51880[_0xbef8('0x4e')]));_0x53432a[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x50'),_0xa51880[_0xbef8('0x4e')]));return BPromise[_0xbef8('0x53')](_0x53432a);}else{return values;}})[_0xbef8('0x12')](function(){return values;})['then'](respondWithResult(_0x2f5e50,null))[_0xbef8('0x1c')](handleError(_0x2f5e50,null));};exports['update']=function(_0xe28c94,_0x1d5474){if(_0xe28c94['body']['id']){delete _0xe28c94['body']['id'];}delete _0xe28c94[_0xbef8('0x5b')][_0xbef8('0x29')];return db[_0xbef8('0x39')]['find']({'where':{'id':_0xe28c94[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x1d5474,null))[_0xbef8('0x12')](saveUpdates(_0xe28c94[_0xbef8('0x5b')],null))[_0xbef8('0x12')](respondWithResult(_0x1d5474,null))['catch'](handleError(_0x1d5474,null));};exports[_0xbef8('0x5d')]=function(_0x32a3c5,_0xef5a79){return db[_0xbef8('0x39')][_0xbef8('0x5d')]()[_0xbef8('0x12')](respondWithResult(_0xef5a79,null))['catch'](handleError(_0xef5a79,null));};exports['addContacts']=function(_0x46ed72,_0x43926d){return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x46ed72[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x43926d,null))['then'](function(_0x3e283a){if(_0x3e283a){return _0x3e283a[_0xbef8('0x5e')](_0x46ed72[_0xbef8('0x5b')]['ids'],_[_0xbef8('0x5f')](_0x46ed72[_0xbef8('0x5b')],[_0xbef8('0x60'),'id'])||{});}})[_0xbef8('0x12')](respondWithResult(_0x43926d,null))[_0xbef8('0x1c')](handleError(_0x43926d,null));};function validateUser(_0x386c70){return new BPromise(function(_0x2f8ac3,_0x3e44d6){if(_0x386c70['internal'])return _0x2f8ac3(_0x386c70);return db[_0xbef8('0x61')][_0xbef8('0x62')](0x1)[_0xbef8('0x12')](function(_0x584e25){if(_0x584e25['securePassword'])authService[_0xbef8('0x63')](_0x386c70[_0xbef8('0x3d')]);db[_0xbef8('0x39')][_0xbef8('0x64')]('internal')[_0xbef8('0x12')](function(_0x187b3d){if(_['isNil'](_0x187b3d)){_0x386c70[_0xbef8('0x65')]=_0x584e25[_0xbef8('0x66')]||0x1;return;}if(_[_0xbef8('0x67')](_0x584e25[_0xbef8('0x66')])||_0x584e25[_0xbef8('0x66')]===_0x187b3d){_0x386c70['internal']=_0x187b3d+0x1;return;}if(_0x584e25[_0xbef8('0x66')]>_0x187b3d){_0x386c70['internal']=_0x584e25[_0xbef8('0x66')];return;}return db['sequelize'][_0xbef8('0x41')](_0xbef8('0x68'),{'type':db[_0xbef8('0x69')]['QueryTypes'][_0xbef8('0x6a')]})[_0xbef8('0x12')](function(_0xeead9e){if(_0xeead9e&&_0xeead9e[_0xbef8('0x4b')]){for(var _0x446ade=0x0,_0x2f7e62=_0xeead9e['length'];_0x446ade<_0x2f7e62&&_['isNil'](_0x386c70[_0xbef8('0x65')]);_0x446ade++){if(_0x584e25[_0xbef8('0x66')]<=_0xeead9e[_0x446ade][_0xbef8('0x6b')]){_0x386c70[_0xbef8('0x65')]=_0xeead9e[_0x446ade][_0xbef8('0x6b')];}else if(_0x584e25[_0xbef8('0x66')]>_0xeead9e[_0x446ade][_0xbef8('0x6b')]&&_0x584e25[_0xbef8('0x66')]<=_0xeead9e[_0x446ade]['to']){_0x386c70[_0xbef8('0x65')]=_0x584e25['min_internal'];}}}if(_[_0xbef8('0x67')](_0x386c70[_0xbef8('0x65')])){_0x386c70[_0xbef8('0x65')]=_0x187b3d+0x1;}return _0x2f8ac3(_0x386c70);});});})[_0xbef8('0x1c')](function(_0x47ae1c){_0x3e44d6(_0x47ae1c);});});}function updateUser(_0x1e8b32){return new BPromise(function(_0x458a5d,_0x19701a){try{if(_0x1e8b32[_0xbef8('0x6c')]){_0x1e8b32[_0xbef8('0x6d')]=_0x1e8b32[_0xbef8('0x65')];_0x1e8b32['VoiceMail']={'mailbox':_0x1e8b32[_0xbef8('0x65')],'password':_0x1e8b32['password'],'fullname':_0x1e8b32[_0xbef8('0x6e')],'email':_0x1e8b32[_0xbef8('0x6f')]};}if(_0x1e8b32['role']==='agent'){if(!_0x1e8b32['permissions'])_0x1e8b32[_0xbef8('0x70')]=['101',_0xbef8('0x71'),_0xbef8('0x72'),_0xbef8('0x73'),'110',_0xbef8('0x74'),'105',_0xbef8('0x75'),'107',_0xbef8('0x76'),_0xbef8('0x77'),_0xbef8('0x78'),_0xbef8('0x79'),_0xbef8('0x7a'),_0xbef8('0x7b')];}_0x458a5d(_0x1e8b32);}catch(_0x37902f){_0x19701a(_0x37902f);}});}exports['create']=function(_0x3ed7b3,_0x54f863){if(_0x3ed7b3[_0xbef8('0x2c')][_0xbef8('0x29')]==='agent')throw new Error(_0xbef8('0x7c'));if(_0x3ed7b3[_0xbef8('0x5b')]['role']===_0xbef8('0x2c')&&_0x3ed7b3['user'][_0xbef8('0x29')]!=='admin'){throw new Error(_0xbef8('0x7d'));}if(_0x3ed7b3[_0xbef8('0x5b')][_0xbef8('0x29')]===_0xbef8('0x2a')&&_0x3ed7b3[_0xbef8('0x2c')][_0xbef8('0x29')]!=='admin'){throw new Error(_0xbef8('0x7e'));}return licenseUtil[_0xbef8('0x7f')]([_0x3ed7b3['body']])[_0xbef8('0x12')](function(){return validateUser(_0x3ed7b3['body']);})[_0xbef8('0x12')](function(_0x57a863){return updateUser(_0x57a863)[_0xbef8('0x12')](function(_0x7d4a55){if(_0x7d4a55[_0xbef8('0x29')]==='admin'){_0x7d4a55[_0xbef8('0x80')]=_0x3ed7b3[_0xbef8('0x2c')][_0xbef8('0x80')];delete _0x7d4a55['userProfileId'];}return _0x7d4a55;});})['then'](function(_0x31eeab){return db[_0xbef8('0x39')][_0xbef8('0x81')](_0x31eeab,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x211a3b){if(_0x3ed7b3['body'][_0xbef8('0x29')]===_0xbef8('0x2c'))return _0x211a3b;if(_0x3ed7b3[_0xbef8('0x2c')]['role']!=='user')return _0x211a3b;return db[_0xbef8('0x82')][_0xbef8('0x33')]({'where':{'name':_0x211a3b['role']===_0xbef8('0x2d')?'Agents':_0xbef8('0x2e'),'userProfileId':_0x3ed7b3[_0xbef8('0x2c')][_0xbef8('0x83')]},'raw':!![]})[_0xbef8('0x12')](function(_0x3d752f){if(!_0x3d752f||_0x3d752f[_0xbef8('0x84')]!=0x0)return _0x211a3b;return db[_0xbef8('0x35')][_0xbef8('0x81')]({'name':_0x211a3b[_0xbef8('0x34')],'resourceId':_0x211a3b['id'],'type':_0x3d752f[_0xbef8('0x34')],'sectionId':_0x3d752f['id']},{})[_0xbef8('0x12')](function(){return _0x211a3b;});})[_0xbef8('0x1c')](function(_0x125956){logger[_0xbef8('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x125956);throw _0x125956;});})[_0xbef8('0x12')](respondWithResult(_0x54f863,0xc9))[_0xbef8('0x1c')](handleError(_0x54f863,null));};exports['bulkCreate']=function(_0x2feb6c,_0x8184db){var _0x525b17=_0x2feb6c[_0xbef8('0x5b')];var _0x59104e=[];if(_0x2feb6c[_0xbef8('0x2c')][_0xbef8('0x29')]===_0xbef8('0x2d'))throw new Error(_0xbef8('0x7c'));if(_[_0xbef8('0x85')](_0x525b17,[_0xbef8('0x29'),_0xbef8('0x2c')])&&_0x2feb6c['user'][_0xbef8('0x29')]!==_0xbef8('0x2a')){throw new Error(_0xbef8('0x7d'));}if(_[_0xbef8('0x85')](_0x525b17,[_0xbef8('0x29'),_0xbef8('0x2a')])&&_0x2feb6c[_0xbef8('0x2c')][_0xbef8('0x29')]!==_0xbef8('0x2a')){throw new Error(_0xbef8('0x86'));}return licenseUtil[_0xbef8('0x7f')](_0x525b17)[_0xbef8('0x12')](function(){return validateUser(_0x525b17[0x0]);})[_0xbef8('0x12')](function(){for(var _0x5b2c95=0x1;_0x5b2c95<_0x525b17[_0xbef8('0x4b')];_0x5b2c95++){var _0x497a09=_0x525b17[_0x5b2c95-0x1][_0xbef8('0x65')];if(!_0x525b17[_0x5b2c95]['internal'])_0x525b17[_0x5b2c95]['internal']=_0x497a09+0x1;_0x59104e[_0xbef8('0x47')](validateUser(_0x525b17[_0x5b2c95]));}return BPromise[_0xbef8('0x53')](_0x59104e);})[_0xbef8('0x12')](function(){_0x59104e=[];for(var _0x7fffb7=0x0;_0x7fffb7<_0x525b17[_0xbef8('0x4b')];_0x7fffb7++){_0x59104e[_0xbef8('0x47')](updateUser(_0x525b17[_0x7fffb7]));}return BPromise['all'](_0x59104e);})[_0xbef8('0x12')](function(){return BPromise[_0xbef8('0x87')](_0x525b17,function(_0xfac7c1){return db['User'][_0xbef8('0x81')](_0xfac7c1,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0xbef8('0x12')](function(_0x5e975c){_0xfac7c1['id']=_0x5e975c['id'];return _0xfac7c1;});});})[_0xbef8('0x12')](function(_0x335300){if(_0x2feb6c[_0xbef8('0x5b')][_0xbef8('0x29')]===_0xbef8('0x2c'))return _0x335300;if(_0x2feb6c[_0xbef8('0x2c')][_0xbef8('0x29')]!==_0xbef8('0x2c'))return _0x335300;var _0x3fc129=_[_0xbef8('0x85')](_0x335300,function(_0x2129f7){return _0x2129f7['role']===_0xbef8('0x2d')||_0x2129f7['role']===_0xbef8('0x88');});if(!_0x3fc129)return _0x335300;return db[_0xbef8('0x82')][_0xbef8('0x48')]({'where':{'name':{'$or':[_0xbef8('0x89'),_0xbef8('0x2e')]},'userProfileId':_0x2feb6c[_0xbef8('0x2c')][_0xbef8('0x83')]},'raw':!![]})['then'](function(_0x217c8b){if(_[_0xbef8('0x8a')](_0x217c8b)||!_['some'](_0x217c8b,[_0xbef8('0x84'),0x0]))return _0x335300;_0x59104e=[];var _0x1d0d31=_(_0x217c8b)['map'](function(_0x265708){if(_0x265708['autoAssociation']===0x1)return;return _0x265708[_0xbef8('0x34')]==='Agents'?_0xbef8('0x2d'):_0xbef8('0x88');})[_0xbef8('0x8b')]()[_0xbef8('0x31')]();for(var _0x572cbd=0x0;_0x572cbd<_0x335300[_0xbef8('0x4b')];_0x572cbd++){if(!_[_0xbef8('0x32')](_0x1d0d31,_0x335300[_0x572cbd][_0xbef8('0x29')]))return;var _0xa40d52=_0x335300[_0x572cbd][_0xbef8('0x29')]===_0xbef8('0x2d')?_0xbef8('0x89'):_0xbef8('0x2e');_0x59104e[_0xbef8('0x47')](db[_0xbef8('0x35')][_0xbef8('0x81')]({'name':_0x335300[_0x572cbd][_0xbef8('0x34')],'resourceId':_0x335300[_0x572cbd]['id'],'type':_0xa40d52,'sectionId':_['find'](_0x217c8b,[_0xbef8('0x34'),_0xa40d52])['id']},{}));}return BPromise[_0xbef8('0x53')](_0x59104e);});})[_0xbef8('0x12')](respondWithResult(_0x8184db,0xc9))['catch'](handleError(_0x8184db,null));};exports['changePassword']=function(_0xdac5ec,_0x59e301){if(_0xdac5ec[_0xbef8('0x5b')]['id']){delete _0xdac5ec[_0xbef8('0x5b')]['id'];}return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0xdac5ec['params']['id']}})[_0xbef8('0x12')](function(_0xcdb00d){if(!_0xcdb00d)return null;if(_0xcdb00d['id']===_0xdac5ec[_0xbef8('0x2c')]['id']){if(!_0xdac5ec[_0xbef8('0x5b')][_0xbef8('0x8c')]||!_0xdac5ec['body'][_0xbef8('0x8d')]){throw new db[(_0xbef8('0x8e'))]['ValidationError'](_0xbef8('0x8f'));}if(!_0xcdb00d[_0xbef8('0x90')](_0xdac5ec[_0xbef8('0x5b')][_0xbef8('0x8c')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0xdac5ec[_0xbef8('0x5b')]['oldPassword']===_0xdac5ec[_0xbef8('0x5b')][_0xbef8('0x8d')]){throw new db['Sequelize']['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xdac5ec[_0xbef8('0x2c')][_0xbef8('0x29')]===_0xbef8('0x2a')){if(!_0xdac5ec['body']['newPassword']){throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xdac5ec[_0xbef8('0x2c')][_0xbef8('0x29')]===_0xbef8('0x2c')){if(!_0xdac5ec[_0xbef8('0x5b')][_0xbef8('0x8d')]){throw new db['Sequelize'][(_0xbef8('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xcdb00d[_0xbef8('0x29')]!==_0xbef8('0x2d')){throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))](_0xbef8('0x7c'));}}else{throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))](_0xbef8('0x7c'));}return _0xcdb00d;})[_0xbef8('0x12')](handleEntityNotFound(_0x59e301,null))['then'](function(_0x5bc23f){return db[_0xbef8('0x61')][_0xbef8('0x92')]({'attributes':['id',_0xbef8('0x93'),_0xbef8('0x94'),_0xbef8('0x95')]})[_0xbef8('0x12')](function(_0x32ccc6){if(_0x32ccc6[_0xbef8('0x93')])authService[_0xbef8('0x63')](_0xdac5ec[_0xbef8('0x5b')][_0xbef8('0x8d')]);if(!_0x32ccc6['enforcePasswordHistory']||!_0x5bc23f[_0xbef8('0x96')])return _0x5bc23f;authService[_0xbef8('0x97')](_0xdac5ec['body'][_0xbef8('0x8d')],_0x5bc23f[_0xbef8('0x96')],_0x32ccc6[_0xbef8('0x95')]);return _0x5bc23f;})[_0xbef8('0x12')](saveUpdates({'password':_0xdac5ec[_0xbef8('0x5b')]['newPassword'],'passwordResetAt':_0xdac5ec[_0xbef8('0x2c')]['id']==_0xdac5ec[_0xbef8('0x5c')]['id']?moment():null,'previousPasswords':authService[_0xbef8('0x98')](_0xdac5ec['body'][_0xbef8('0x8d')],_0x5bc23f[_0xbef8('0x96')])},null));})[_0xbef8('0x12')](respondWithResult(_0x59e301,null))[_0xbef8('0x1c')](handleError(_0x59e301,null));};exports[_0xbef8('0x99')]=function(_0x3ce35d,_0x1ac7e1){var _0x9ce7eb=_0x3ce35d[_0xbef8('0x5b')]['channel'];return db['User'][_0xbef8('0x33')]({'where':{'id':_0x3ce35d[_0xbef8('0x5c')]['id']},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29'),'online',_0xbef8('0x9a'),_0xbef8('0x9b'),_0xbef8('0x9c')]})[_0xbef8('0x12')](handleEntityNotFound(_0x1ac7e1,null))['then'](function(_0x2089a4){if(_0x2089a4){if(!utils['isValidChannel'](_0x9ce7eb)){throw new db['Sequelize'][(_0xbef8('0x91'))](_0xbef8('0x9d'));}return _0x2089a4[_0xbef8('0x9e')+_[_0xbef8('0x9f')](_0x9ce7eb[_0xbef8('0xa0')]())+_0xbef8('0xa1')](_0x3ce35d['body'][_0xbef8('0x60')],{'penalty':_0x3ce35d[_0xbef8('0x5b')]['penalty']||0x0})[_0xbef8('0xa2')](function(_0x11221c){for(var _0x5ca2a2=0x0;_0x5ca2a2<_0x3ce35d[_0xbef8('0x5b')][_0xbef8('0x60')][_0xbef8('0x4b')];_0x5ca2a2+=0x1){var _0x3a207e={'UserId':Number(_0x3ce35d[_0xbef8('0x5c')]['id'])};_0x3a207e[_[_0xbef8('0x9f')](_0x9ce7eb[_0xbef8('0xa0')]())+_0xbef8('0xa3')]=Number(_0x3ce35d[_0xbef8('0x5b')]['ids'][_0x5ca2a2]);socket[_0xbef8('0x25')](_0xbef8('0x2c')+_['capitalize'](_0x9ce7eb['toLowerCase']())+_0xbef8('0xa4'),_0x3a207e);}return _0x11221c;})[_0xbef8('0x12')](function(){if(_0x9ce7eb==='voice'){return db[_0xbef8('0xa5')]['findAll']({'where':{'id':_0x3ce35d[_0xbef8('0x5b')]['ids']||[]},'raw':!![],'attributes':['id',_0xbef8('0x34')]});}})['then'](function(_0x332f0b){var _0x385356=_0x2089a4[_0xbef8('0x28')]({'plain':!![]});var _0xf88ca5=[];if(_0x9ce7eb===_0xbef8('0xa6')&&_0x385356['role']===_0xbef8('0x2d')&&_0x385356['online']){for(var _0x36ab14=0x0;_0x36ab14<_0x332f0b[_0xbef8('0x4b')];_0x36ab14+=0x1){_0xf88ca5[_0xbef8('0x47')]({'membername':_0x385356[_0xbef8('0x34')],'UserId':_0x385356['id'],'queue_name':_0x332f0b[_0x36ab14][_0xbef8('0x34')],'VoiceQueueId':_0x332f0b[_0x36ab14]['id'],'interface':_['isNil'](_0x385356[_0xbef8('0x9c')])?util[_0xbef8('0xa7')]('SIP/%s',_0x385356[_0xbef8('0x34')]):_0x385356['interface'],'paused':_0x385356[_0xbef8('0x9b')]||![],'penalty':_0x3ce35d[_0xbef8('0x5b')][_0xbef8('0xa8')]||0x0});}return BPromise[_0xbef8('0x87')](_0xf88ca5,function(_0x15faa9){return db['UserVoiceQueueRt']['upsert'](_0x15faa9);});}return _0x2089a4;});}})['then'](respondWithStatusCode(_0x1ac7e1,null))[_0xbef8('0x1c')](handleError(_0x1ac7e1,null));};exports[_0xbef8('0xa9')]=function(_0x4e6fff,_0x3c0064){var _0x18fccf,_0x24070c;return db['User'][_0xbef8('0x33')]({'where':{'id':_0x4e6fff['params']['id']},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29')]})[_0xbef8('0x12')](handleEntityNotFound(_0x3c0064,null))[_0xbef8('0x12')](function(_0x5b0cb1){if(_0x5b0cb1){_0x18fccf=_0x5b0cb1;if(!_0x4e6fff['query'][_0xbef8('0xaa')]||!utils[_0xbef8('0xab')](_0x4e6fff[_0xbef8('0x41')]['channel'])){throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))](_0xbef8('0x9d'));}return _0x5b0cb1['remove'+_[_0xbef8('0x9f')](_0x4e6fff[_0xbef8('0x41')][_0xbef8('0xaa')]['toLowerCase']())+_0xbef8('0xa1')](_0x4e6fff[_0xbef8('0x41')][_0xbef8('0x60')]);}})[_0xbef8('0x12')](function(_0x3dd39b){if(_[_0xbef8('0xac')](_0x4e6fff['query'][_0xbef8('0x60')])){for(var _0x2a3cc2=0x0;_0x2a3cc2<_0x4e6fff['query']['ids']['length'];_0x2a3cc2+=0x1){_0x24070c={'UserId':Number(_0x4e6fff[_0xbef8('0x5c')]['id'])};_0x24070c[_[_0xbef8('0x9f')](_0x4e6fff[_0xbef8('0x41')]['channel'][_0xbef8('0xa0')]())+_0xbef8('0xa3')]=Number(_0x4e6fff[_0xbef8('0x41')]['ids'][_0x2a3cc2]);socket['emit'](_0xbef8('0x2c')+_['capitalize'](_0x4e6fff[_0xbef8('0x41')][_0xbef8('0xaa')][_0xbef8('0xa0')]())+_0xbef8('0xad'),_0x24070c);}}else{_0x24070c={'UserId':Number(_0x4e6fff[_0xbef8('0x5c')]['id'])};_0x24070c[_[_0xbef8('0x9f')](_0x4e6fff['query']['channel'][_0xbef8('0xa0')]())+_0xbef8('0xa3')]=Number(_0x4e6fff[_0xbef8('0x41')]['ids']);socket[_0xbef8('0x25')](_0xbef8('0x2c')+_[_0xbef8('0x9f')](_0x4e6fff[_0xbef8('0x41')][_0xbef8('0xaa')]['toLowerCase']())+_0xbef8('0xad'),_0x24070c);}return _0x3dd39b;})[_0xbef8('0x12')](function(){if(_0x4e6fff['query'][_0xbef8('0xaa')]===_0xbef8('0xa6')){return db[_0xbef8('0xae')]['destroy']({'where':{'UserId':_0x4e6fff[_0xbef8('0x5c')]['id'],'VoiceQueueId':_0x4e6fff[_0xbef8('0x41')][_0xbef8('0x60')]},'individualHooks':!![]})[_0xbef8('0x12')](function(){return _0x18fccf;});}return _0x18fccf;})[_0xbef8('0x12')](respondWithStatusCode(_0x3c0064,null))['catch'](handleError(_0x3c0064,null));};exports['addAvatar']=function(_0x59b610,_0x17bb40){_0x59b610[_0xbef8('0x5b')]['userpic']=_0x59b610['file'][_0xbef8('0xaf')];return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x59b610[_0xbef8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x17bb40,null))[_0xbef8('0x12')](saveUpdates(_0x59b610['body'],null))['then'](respondWithResult(_0x17bb40,null))[_0xbef8('0x1c')](handleError(_0x17bb40,null));};exports[_0xbef8('0xb0')]=function(_0x22addb,_0x33d3c3){var _0x5c8935=path[_0xbef8('0xb1')](config[_0xbef8('0xb2')],'server/files/images/logos/default_profile.png');return db['User'][_0xbef8('0x33')]({'where':{'id':_0x22addb['params']['id']},'attributes':['id',_0xbef8('0xb3')],'raw':!![]})[_0xbef8('0x12')](handleEntityNotFound(_0x33d3c3,null))[_0xbef8('0x12')](function(_0xba9431){if(_0xba9431){if(_[_0xbef8('0x67')](_0xba9431['userpic'])){return _0x33d3c3[_0xbef8('0xb4')](_0x5c8935);}else{if(!fs[_0xbef8('0xb5')](path[_0xbef8('0xb1')](config[_0xbef8('0xb2')],'server/files/images/',_0xba9431[_0xbef8('0xb3')]))){return _0x33d3c3[_0xbef8('0xb4')](_0x5c8935);}return _0x33d3c3[_0xbef8('0xb4')](path[_0xbef8('0xb1')](config[_0xbef8('0xb2')],'server/files/images/',_0xba9431['userpic']));}}})['catch'](handleError(_0x33d3c3,null));};exports[_0xbef8('0xb6')]=function(_0x44fd18,_0x4e82eb){return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x44fd18[_0xbef8('0x5c')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4e82eb,null))[_0xbef8('0x12')](function(_0x595222){var _0x52dc72=[];values=_0x595222[_0xbef8('0x4e')];_0x52dc72['push'](get_open_tabs(_0xbef8('0x4c'),_0x595222[_0xbef8('0x4e')]));_0x52dc72[_0xbef8('0x47')](get_open_tabs(_0xbef8('0x4d'),_0x595222[_0xbef8('0x4e')]));_0x52dc72['push'](get_open_tabs(_0xbef8('0x51'),_0x595222['dataValues']));_0x52dc72[_0xbef8('0x47')](get_open_tabs('whatsapp',_0x595222[_0xbef8('0x4e')]));_0x52dc72[_0xbef8('0x47')](get_open_tabs('fax',_0x595222[_0xbef8('0x4e')]));_0x52dc72[_0xbef8('0x47')](get_open_tabs('mail',_0x595222[_0xbef8('0x4e')]));return BPromise[_0xbef8('0x53')](_0x52dc72);})[_0xbef8('0x12')](function(_0x295f43){if(_0x295f43){var _0x507dad=_[_0xbef8('0x30')](values[_0xbef8('0xb7')],function(_0x4e7d8c){return{'channel':_0xbef8('0xb8'),'id':_0x4e7d8c['id'],'createdAt':_0x4e7d8c['createdAt']};});var _0x5a3af3=_[_0xbef8('0x30')](values[_0xbef8('0xb9')],function(_0x1d32e1){return{'channel':_0xbef8('0xba'),'id':_0x1d32e1['id'],'createdAt':_0x1d32e1[_0xbef8('0xbb')]};});var _0x3c1519=_[_0xbef8('0x30')](values[_0xbef8('0xbc')],function(_0x556e04){return{'channel':_0xbef8('0xbd'),'id':_0x556e04['id'],'createdAt':_0x556e04[_0xbef8('0xbb')]};});var _0x354872=_[_0xbef8('0x30')](values[_0xbef8('0xbe')],function(_0x2bf0f9){return{'channel':_0xbef8('0xbf'),'id':_0x2bf0f9['id'],'createdAt':_0x2bf0f9[_0xbef8('0xbb')]};});var _0x79de98=_['map'](values[_0xbef8('0xc0')],function(_0x40a706){return{'channel':_0xbef8('0xc1'),'id':_0x40a706['id'],'createdAt':_0x40a706[_0xbef8('0xbb')]};});var _0x3960f5=_[_0xbef8('0x30')](values[_0xbef8('0xc2')],function(_0x512931){return{'channel':_0xbef8('0xc3'),'id':_0x512931['id'],'createdAt':_0x512931[_0xbef8('0xbb')]};});var _0x2edbb7=_[_0xbef8('0xc4')](_0x507dad,_0x5a3af3,_0x3c1519,_0x354872,_0x79de98,_0x3960f5);var _0x409f82={'count':_0x2edbb7['length'],'rows':_0x2edbb7};return _0x409f82;}else return null;})[_0xbef8('0x12')](respondWithResult(_0x4e82eb,null))['catch'](handleError(_0x4e82eb,null));};exports[_0xbef8('0xc5')]=function(_0x5e598a,_0x4c0658){var _0x3d0d38={};var _0x5e1c41={};var _0x711582;var _0x444021;return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x5e598a[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x4c0658,null))[_0xbef8('0x12')](function(_0x528812){if(_0x528812){_0x711582=_0x528812;_0x5e1c41[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_0xbef8('0xc6')][_0xbef8('0xc7')]);_0x5e1c41[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x5e598a['query']);_0x5e1c41[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x5e1c41[_0xbef8('0x54')],_0x5e1c41['query']);_0x3d0d38['attributes']=_[_0xbef8('0x57')](_0x5e1c41['model'],qs[_0xbef8('0x58')](_0x5e598a['query'][_0xbef8('0x58')]));_0x3d0d38['attributes']=_0x3d0d38[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x3d0d38[_0xbef8('0x46')]:_0x5e1c41[_0xbef8('0x54')];_0x3d0d38[_0xbef8('0xc9')]=qs['sort'](_0x5e598a[_0xbef8('0x41')][_0xbef8('0xca')]);_0x3d0d38['where']=qs[_0xbef8('0xc8')](_['pick'](_0x5e598a['query'],_0x5e1c41[_0xbef8('0xc8')]));if(_0x5e598a[_0xbef8('0x41')]['filter']){_0x3d0d38[_0xbef8('0x40')]=_['merge'](_0x3d0d38[_0xbef8('0x40')],{'$or':_['map'](_0x3d0d38[_0xbef8('0x46')],function(_0x3ae224){var _0x415bb3={};_0x415bb3[_0x3ae224]={'$like':'%'+_0x5e598a[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x415bb3;})});}_0x3d0d38=_[_0xbef8('0xcc')]({},_0x3d0d38,_0x5e598a[_0xbef8('0x5a')]);return _0x711582[_0xbef8('0xc5')](_0x3d0d38);}})[_0xbef8('0x12')](function(_0x275cda){if(_0x275cda){_0x444021=_0x275cda['length'];if(_0x5e598a[_0xbef8('0x41')][_0xbef8('0xcd')]('includeAll')){_0x3d0d38[_0xbef8('0x45')]=[{'model':db['CmList'],'as':_0xbef8('0xce'),'required':![]},{'model':db[_0xbef8('0xcf')],'as':'Tags','attributes':['id','name',_0xbef8('0xd0')],'where':_0x5e598a[_0xbef8('0x41')][_0xbef8('0xd1')]?{'id':_0x5e598a['query'][_0xbef8('0xd1')]}:undefined,'required':_0x5e598a[_0xbef8('0x41')][_0xbef8('0xd1')]?!![]:![]}];}if(!_0x5e598a['query'][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x3d0d38['limit']=qs['limit'](_0x5e598a[_0xbef8('0x41')][_0xbef8('0x22')]);_0x3d0d38[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x5e598a['query'][_0xbef8('0x21')]);}return _0x711582[_0xbef8('0xc5')](_0x3d0d38);}})[_0xbef8('0x12')](function(_0x57c3cf){if(_0x57c3cf){return _0x57c3cf?{'count':_0x444021,'rows':_0x57c3cf}:null;}})['then'](respondWithResult(_0x4c0658,null))[_0xbef8('0x1c')](handleError(_0x4c0658,null));};exports['getQueues']=function(_0x82e0e5,_0x86e1d1){var _0x59c458;var _0x4bd437={};var _0x146b82;return db[_0xbef8('0x39')]['findOne']({'where':{'id':_0x82e0e5[_0xbef8('0x5c')]['id']},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29')]})[_0xbef8('0x12')](handleEntityNotFound(_0x86e1d1,null))[_0xbef8('0x12')](function(_0x4f2b8f){if(!utils[_0xbef8('0xab')](_0x82e0e5['query'][_0xbef8('0xaa')])){throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))]('Unknown\x20channel');}_0x59c458=_0x4f2b8f;var _0x14dd74={};_0x14dd74[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_['capitalize'](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xaa')])+_0xbef8('0xd3')]['rawAttributes']);_0x14dd74[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x82e0e5[_0xbef8('0x41')]);_0x14dd74[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x14dd74[_0xbef8('0x54')],_0x14dd74[_0xbef8('0x41')]);_0x4bd437[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0x14dd74[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0x58')]));_0x4bd437[_0xbef8('0x46')]=_0x4bd437[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x4bd437[_0xbef8('0x46')]:_0x14dd74[_0xbef8('0x54')];_0x4bd437['order']=qs[_0xbef8('0xca')](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xca')]);_0x4bd437['where']=qs[_0xbef8('0xc8')](_['pick'](_0x82e0e5['query'],_0x14dd74['filters']));if(_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x4bd437[_0xbef8('0x40')]=_['merge'](_0x4bd437['where'],{'$or':_['map'](_0x4bd437[_0xbef8('0x46')],function(_0x12a573){var _0x477eb2={};_0x477eb2[_0x12a573]={'$like':'%'+_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x477eb2;})});}_0x4bd437=_[_0xbef8('0xcc')]({},_0x4bd437,_0x82e0e5[_0xbef8('0x5a')]);switch(_0x59c458['role']){case _0xbef8('0x2a'):return db[_['capitalize'](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xaa')])+_0xbef8('0xd3')][_0xbef8('0x48')](_0x4bd437);case _0xbef8('0x2c'):case'agent':return _0x59c458[_0xbef8('0x28')+_['capitalize'](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xaa')])+_0xbef8('0xa1')](_0x4bd437);default:throw new db['Sequelize'][(_0xbef8('0x91'))]('Unknown\x20role');}})[_0xbef8('0x12')](function(_0x473f7b){_0x146b82=_0x473f7b[_0xbef8('0x4b')];if(!_0x82e0e5['query']['hasOwnProperty'](_0xbef8('0xd2'))){_0x4bd437[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0x22')]);_0x4bd437[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x82e0e5[_0xbef8('0x41')]['offset']);}switch(_0x59c458['role']){case _0xbef8('0x2a'):return db[_[_0xbef8('0x9f')](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xaa')])+_0xbef8('0xd3')]['findAll'](_0x4bd437);case'user':case _0xbef8('0x2d'):return _0x59c458[_0xbef8('0x28')+_[_0xbef8('0x9f')](_0x82e0e5[_0xbef8('0x41')][_0xbef8('0xaa')])+_0xbef8('0xa1')](_0x4bd437);}})[_0xbef8('0x12')](function(_0x1b36f0){return{'count':_0x146b82,'rows':_0x1b36f0};})[_0xbef8('0x12')](respondWithResult(_0x86e1d1,null))[_0xbef8('0x1c')](handleError(_0x86e1d1,null));};exports[_0xbef8('0xd4')]=function(_0x222821,_0x43ed09){var _0xa11688={};var _0x262324={};var _0x10aab2;var _0x5eeb54;return db['User'][_0xbef8('0x92')]({'where':{'id':_0x222821[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x43ed09,null))[_0xbef8('0x12')](function(_0x2ffeb0){if(_0x2ffeb0){_0x10aab2=_0x2ffeb0;_0x262324[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_0xbef8('0xae')][_0xbef8('0xc7')]);_0x262324['query']=_['keys'](_0x222821[_0xbef8('0x41')]);_0x262324[_0xbef8('0xc8')]=_['intersection'](_0x262324['model'],_0x262324[_0xbef8('0x41')]);_0xa11688[_0xbef8('0x46')]=_['intersection'](_0x262324['model'],qs[_0xbef8('0x58')](_0x222821[_0xbef8('0x41')][_0xbef8('0x58')]));_0xa11688[_0xbef8('0x46')]=_0xa11688[_0xbef8('0x46')][_0xbef8('0x4b')]?_0xa11688[_0xbef8('0x46')]:_0x262324[_0xbef8('0x54')];_0xa11688[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x222821['query'][_0xbef8('0xca')]);_0xa11688[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x222821['query'],_0x262324[_0xbef8('0xc8')]));if(_0x222821[_0xbef8('0x41')][_0xbef8('0xcb')]){_0xa11688['where']=_[_0xbef8('0xcc')](_0xa11688[_0xbef8('0x40')],{'$or':_['map'](_0xa11688[_0xbef8('0x46')],function(_0x4a9f81){var _0x46ea52={};_0x46ea52[_0x4a9f81]={'$like':'%'+_0x222821[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x46ea52;})});}_0xa11688=_[_0xbef8('0xcc')]({},_0xa11688,_0x222821[_0xbef8('0x5a')]);return _0x10aab2[_0xbef8('0xd4')](_0xa11688);}})[_0xbef8('0x12')](function(_0x1f441b){if(_0x1f441b){_0x5eeb54=_0x1f441b['length'];if(!_0x222821[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0xa11688[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x222821[_0xbef8('0x41')][_0xbef8('0x22')]);_0xa11688[_0xbef8('0x21')]=qs['offset'](_0x222821[_0xbef8('0x41')][_0xbef8('0x21')]);}return _0x10aab2[_0xbef8('0xd4')](_0xa11688);}})[_0xbef8('0x12')](function(_0x53a9f2){if(_0x53a9f2){return _0x53a9f2?{'count':_0x5eeb54,'rows':_0x53a9f2}:null;}})['then'](respondWithResult(_0x43ed09,null))[_0xbef8('0x1c')](handleError(_0x43ed09,null));};exports['getGroups']=function(_0x35ac33,_0x19e9a5){var _0x4122a7={};var _0x721960={};var _0x2cfc3f;var _0x46838f;return db[_0xbef8('0x39')]['findOne']({'where':{'id':_0x35ac33['params']['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x19e9a5,null))[_0xbef8('0x12')](function(_0x23e190){if(_0x23e190){_0x2cfc3f=_0x23e190;_0x721960['model']=_[_0xbef8('0x56')](db[_0xbef8('0xd6')][_0xbef8('0xc7')]);_0x721960['query']=_[_0xbef8('0x56')](_0x35ac33['query']);_0x721960[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x721960[_0xbef8('0x54')],_0x721960['query']);_0x4122a7['attributes']=_[_0xbef8('0x57')](_0x721960['model'],qs[_0xbef8('0x58')](_0x35ac33[_0xbef8('0x41')]['fields']));_0x4122a7['attributes']=_0x4122a7[_0xbef8('0x46')]['length']?_0x4122a7[_0xbef8('0x46')]:_0x721960['model'];_0x4122a7[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x35ac33[_0xbef8('0x41')][_0xbef8('0xca')]);_0x4122a7[_0xbef8('0x40')]=qs['filters'](_[_0xbef8('0xd5')](_0x35ac33[_0xbef8('0x41')],_0x721960[_0xbef8('0xc8')]));if(_0x35ac33['query']['filter']){_0x4122a7[_0xbef8('0x40')]=_['merge'](_0x4122a7[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x4122a7[_0xbef8('0x46')],function(_0x5374a3){var _0x32b36c={};_0x32b36c[_0x5374a3]={'$like':'%'+_0x35ac33[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x32b36c;})});}_0x4122a7=_[_0xbef8('0xcc')]({},_0x4122a7,_0x35ac33[_0xbef8('0x5a')]);return _0x2cfc3f[_0xbef8('0xd7')](_0x4122a7);}})[_0xbef8('0x12')](function(_0x258a0c){if(_0x258a0c){_0x46838f=_0x258a0c[_0xbef8('0x4b')];if(!_0x35ac33[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x4122a7[_0xbef8('0x22')]=qs['limit'](_0x35ac33[_0xbef8('0x41')][_0xbef8('0x22')]);_0x4122a7['offset']=qs['offset'](_0x35ac33['query'][_0xbef8('0x21')]);}return _0x2cfc3f[_0xbef8('0xd7')](_0x4122a7);}})[_0xbef8('0x12')](function(_0x35ecf7){if(_0x35ecf7){return _0x35ecf7?{'count':_0x46838f,'rows':_0x35ecf7}:null;}})['then'](respondWithResult(_0x19e9a5,null))['catch'](handleError(_0x19e9a5,null));};exports[_0xbef8('0xd8')]=function(_0xf5f98b,_0xf5f047){var _0xa3ef6f={'raw':!![],'where':{}};var _0x4b6883={};var _0x5c4d38={'count':0x0,'rows':[]};return db['User'][_0xbef8('0x92')]({'where':{'id':_0xf5f98b['params']['id']}})['then'](handleEntityNotFound(_0xf5f047,null))[_0xbef8('0x12')](function(_0x491acf){if(_0x491acf){_0x4b6883[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_0xbef8('0xd9')][_0xbef8('0xc7')]);_0x4b6883[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0xf5f98b[_0xbef8('0x41')]);_0x4b6883[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x4b6883[_0xbef8('0x54')],_0x4b6883[_0xbef8('0x41')]);_0xa3ef6f['attributes']=_[_0xbef8('0x57')](_0x4b6883[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0xf5f98b['query'][_0xbef8('0x58')]));_0xa3ef6f[_0xbef8('0x46')]=_0xa3ef6f['attributes']['length']?_0xa3ef6f['attributes']:_0x4b6883[_0xbef8('0x54')];if(!_0xf5f98b[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0xa3ef6f[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0xf5f98b[_0xbef8('0x41')][_0xbef8('0x22')]);_0xa3ef6f[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0xf5f98b[_0xbef8('0x41')][_0xbef8('0x21')]);}_0xa3ef6f[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0xf5f98b[_0xbef8('0x41')]['sort']);_0xa3ef6f['where']=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0xf5f98b[_0xbef8('0x41')],_0x4b6883['filters']));_0xa3ef6f['where'][_0xbef8('0xda')]=_0x491acf['id'];if(_0xf5f98b['query']['filter']){_0xa3ef6f[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0xa3ef6f[_0xbef8('0x40')],{'$or':_['map'](_0xa3ef6f['attributes'],function(_0x2d355e){var _0x4a1eb5={};_0x4a1eb5[_0x2d355e]={'$like':'%'+_0xf5f98b['query'][_0xbef8('0xcb')]+'%'};return _0x4a1eb5;})});}_0xa3ef6f=_[_0xbef8('0xcc')]({},_0xa3ef6f,_0xf5f98b[_0xbef8('0x5a')]);return db['VoiceRecording'][_0xbef8('0x23')]({'where':_0xa3ef6f[_0xbef8('0x40')]})[_0xbef8('0x12')](function(_0x5111ac){_0x5c4d38[_0xbef8('0x23')]=_0x5111ac;if(_0xf5f98b[_0xbef8('0x41')][_0xbef8('0x42')]){_0xa3ef6f['include']=[{'all':!![]}];}return db[_0xbef8('0xd9')][_0xbef8('0x48')](_0xa3ef6f);})[_0xbef8('0x12')](function(_0x2fe414){_0x5c4d38[_0xbef8('0x49')]=_0x2fe414;return _0x5c4d38;});}})[_0xbef8('0x12')](respondWithFilteredResult(_0xf5f047,_0xa3ef6f))[_0xbef8('0x1c')](handleError(_0xf5f047,null));};exports[_0xbef8('0xdb')]=function(_0x415e8d,_0x5ea31f){var _0x20d824={'raw':!![],'where':{}};var _0x4bbc02={};var _0x363af8={'count':0x0,'rows':[]};return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x415e8d[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x5ea31f,null))[_0xbef8('0x12')](function(_0x9a0b15){if(_0x9a0b15){_0x4bbc02[_0xbef8('0x54')]=_[_0xbef8('0x56')](db['ScreenRecording']['rawAttributes']);_0x4bbc02['query']=_[_0xbef8('0x56')](_0x415e8d[_0xbef8('0x41')]);_0x4bbc02[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x4bbc02['model'],_0x4bbc02[_0xbef8('0x41')]);_0x20d824[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0x4bbc02[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x415e8d['query'][_0xbef8('0x58')]));_0x20d824[_0xbef8('0x46')]=_0x20d824[_0xbef8('0x46')]['length']?_0x20d824[_0xbef8('0x46')]:_0x4bbc02['model'];if(!_0x415e8d['query']['hasOwnProperty'](_0xbef8('0xd2'))){_0x20d824['limit']=qs['limit'](_0x415e8d['query'][_0xbef8('0x22')]);_0x20d824[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x415e8d[_0xbef8('0x41')]['offset']);}_0x20d824['order']=qs[_0xbef8('0xca')](_0x415e8d[_0xbef8('0x41')][_0xbef8('0xca')]);_0x20d824[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_['pick'](_0x415e8d[_0xbef8('0x41')],_0x4bbc02[_0xbef8('0xc8')]));_0x20d824[_0xbef8('0x40')][_0xbef8('0xda')]=_0x9a0b15['id'];if(_0x415e8d[_0xbef8('0x41')]['filter']){_0x20d824['where']=_['merge'](_0x20d824['where'],{'$or':_['map'](_0x20d824[_0xbef8('0x46')],function(_0x3fb462){var _0x5734fa={};_0x5734fa[_0x3fb462]={'$like':'%'+_0x415e8d[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x5734fa;})});}_0x20d824=_['merge']({},_0x20d824,_0x415e8d[_0xbef8('0x5a')]);return db[_0xbef8('0xdc')]['count']({'where':_0x20d824['where']})[_0xbef8('0x12')](function(_0x32f7a2){_0x363af8['count']=_0x32f7a2;if(_0x415e8d[_0xbef8('0x41')][_0xbef8('0x42')]){_0x20d824[_0xbef8('0x45')]=[{'all':!![]}];}return db[_0xbef8('0xdc')][_0xbef8('0x48')](_0x20d824);})['then'](function(_0x48196d){_0x363af8[_0xbef8('0x49')]=_0x48196d;return _0x363af8;});}})[_0xbef8('0x12')](respondWithFilteredResult(_0x5ea31f,_0x20d824))[_0xbef8('0x1c')](handleError(_0x5ea31f,null));};exports['getChatInteractions']=function(_0x2ad9c3,_0x699650){var _0x44a057={};var _0x3918c7={};var _0x527c11;var _0x16e785;return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x2ad9c3[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x699650,null))[_0xbef8('0x12')](function(_0xa91787){if(_0xa91787){_0x527c11=_0xa91787;_0x3918c7['model']=_[_0xbef8('0x56')](db[_0xbef8('0xdd')][_0xbef8('0xc7')]);_0x3918c7[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x2ad9c3[_0xbef8('0x41')]);_0x3918c7[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x3918c7[_0xbef8('0x54')],_0x3918c7[_0xbef8('0x41')]);_0x44a057[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0x3918c7[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x2ad9c3[_0xbef8('0x41')]['fields']));_0x44a057[_0xbef8('0x46')]=_0x44a057[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x44a057[_0xbef8('0x46')]:_0x3918c7[_0xbef8('0x54')];_0x44a057[_0xbef8('0xc9')]=qs['sort'](_0x2ad9c3[_0xbef8('0x41')]['sort']);_0x44a057[_0xbef8('0x40')]=qs['filters'](_[_0xbef8('0xd5')](_0x2ad9c3[_0xbef8('0x41')],_0x3918c7[_0xbef8('0xc8')]));if(_0x2ad9c3['query'][_0xbef8('0xcb')]){_0x44a057[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0x44a057[_0xbef8('0x40')],{'$or':_['map'](_0x44a057[_0xbef8('0x46')],function(_0x4568a9){var _0x299aeb={};_0x299aeb[_0x4568a9]={'$like':'%'+_0x2ad9c3[_0xbef8('0x41')]['filter']+'%'};return _0x299aeb;})});}_0x44a057=_[_0xbef8('0xcc')]({},_0x44a057,_0x2ad9c3[_0xbef8('0x5a')]);return _0x527c11[_0xbef8('0xde')](_0x44a057);}})[_0xbef8('0x12')](function(_0x92439b){if(_0x92439b){_0x16e785=_0x92439b[_0xbef8('0x4b')];if(!_0x2ad9c3['query'][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x44a057[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x2ad9c3[_0xbef8('0x41')][_0xbef8('0x22')]);_0x44a057['offset']=qs[_0xbef8('0x21')](_0x2ad9c3['query'][_0xbef8('0x21')]);}return _0x527c11[_0xbef8('0xde')](_0x44a057);}})[_0xbef8('0x12')](function(_0x37ad38){if(_0x37ad38){return _0x37ad38?{'count':_0x16e785,'rows':_0x37ad38}:null;}})['then'](respondWithResult(_0x699650,null))[_0xbef8('0x1c')](handleError(_0x699650,null));};exports['getOpenchannelInteractions']=function(_0x1ffeae,_0x2a093a){var _0x169092={};var _0x303404={};var _0x195edc;var _0x86b356;return db[_0xbef8('0x39')]['findOne']({'where':{'id':_0x1ffeae[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x2a093a,null))['then'](function(_0xab9ac6){if(_0xab9ac6){_0x195edc=_0xab9ac6;_0x303404[_0xbef8('0x54')]=_['keys'](db[_0xbef8('0xdf')][_0xbef8('0xc7')]);_0x303404[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x1ffeae[_0xbef8('0x41')]);_0x303404[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x303404[_0xbef8('0x54')],_0x303404[_0xbef8('0x41')]);_0x169092[_0xbef8('0x46')]=_['intersection'](_0x303404[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x1ffeae['query'][_0xbef8('0x58')]));_0x169092[_0xbef8('0x46')]=_0x169092['attributes'][_0xbef8('0x4b')]?_0x169092[_0xbef8('0x46')]:_0x303404[_0xbef8('0x54')];_0x169092[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x1ffeae['query'][_0xbef8('0xca')]);_0x169092['where']=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x1ffeae[_0xbef8('0x41')],_0x303404[_0xbef8('0xc8')]));if(_0x1ffeae[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x169092[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0x169092[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x169092['attributes'],function(_0x2f8f91){var _0xb69b92={};_0xb69b92[_0x2f8f91]={'$like':'%'+_0x1ffeae[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0xb69b92;})});}_0x169092=_[_0xbef8('0xcc')]({},_0x169092,_0x1ffeae[_0xbef8('0x5a')]);return _0x195edc[_0xbef8('0xe0')](_0x169092);}})[_0xbef8('0x12')](function(_0x45044a){if(_0x45044a){_0x86b356=_0x45044a[_0xbef8('0x4b')];if(!_0x1ffeae[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x169092[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x1ffeae[_0xbef8('0x41')][_0xbef8('0x22')]);_0x169092['offset']=qs[_0xbef8('0x21')](_0x1ffeae['query']['offset']);}return _0x195edc[_0xbef8('0xe0')](_0x169092);}})['then'](function(_0x163f71){if(_0x163f71){return _0x163f71?{'count':_0x86b356,'rows':_0x163f71}:null;}})[_0xbef8('0x12')](respondWithResult(_0x2a093a,null))['catch'](handleError(_0x2a093a,null));};exports[_0xbef8('0xe1')]=function(_0x34e746,_0x24ed41){var _0x4988d6={'raw':!![],'where':{}};var _0x360c70={};var _0x517547={'count':0x0,'rows':[]};return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x34e746[_0xbef8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x24ed41,null))[_0xbef8('0x12')](function(_0x31f5dc){if(_0x31f5dc){_0x360c70[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_0xbef8('0xe2')]['rawAttributes']);_0x360c70[_0xbef8('0x41')]=_['keys'](_0x34e746[_0xbef8('0x41')]);_0x360c70[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x360c70[_0xbef8('0x54')],_0x360c70[_0xbef8('0x41')]);_0x4988d6[_0xbef8('0x46')]=_['intersection'](_0x360c70[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x34e746[_0xbef8('0x41')]['fields']));_0x4988d6[_0xbef8('0x46')]=_0x4988d6[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x4988d6[_0xbef8('0x46')]:_0x360c70['model'];if(!_0x34e746[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x4988d6[_0xbef8('0x22')]=qs['limit'](_0x34e746[_0xbef8('0x41')]['limit']);_0x4988d6[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x34e746[_0xbef8('0x41')][_0xbef8('0x21')]);}_0x4988d6[_0xbef8('0xc9')]=qs['sort'](_0x34e746[_0xbef8('0x41')]['sort']);_0x4988d6[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x34e746[_0xbef8('0x41')],_0x360c70[_0xbef8('0xc8')]));_0x4988d6['where'][_0xbef8('0xda')]=_0x31f5dc['id'];if(_0x34e746[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x4988d6[_0xbef8('0x40')]=_['merge'](_0x4988d6['where'],{'$or':_['map'](_0x4988d6[_0xbef8('0x46')],function(_0x4278cd){var _0x52ee27={};_0x52ee27[_0x4278cd]={'$like':'%'+_0x34e746['query'][_0xbef8('0xcb')]+'%'};return _0x52ee27;})});}_0x4988d6=_[_0xbef8('0xcc')]({},_0x4988d6,_0x34e746[_0xbef8('0x5a')]);return db['MailInteraction'][_0xbef8('0x23')]({'where':_0x4988d6[_0xbef8('0x40')]})['then'](function(_0x4d5da9){_0x517547[_0xbef8('0x23')]=_0x4d5da9;if(_0x34e746[_0xbef8('0x41')]['includeAll']){_0x4988d6['include']=[{'all':!![]}];}return db['MailInteraction'][_0xbef8('0x48')](_0x4988d6);})['then'](function(_0x4ed213){_0x517547[_0xbef8('0x49')]=_0x4ed213;return _0x517547;});}})['then'](respondWithFilteredResult(_0x24ed41,_0x4988d6))[_0xbef8('0x1c')](handleError(_0x24ed41,null));};exports[_0xbef8('0xe3')]=function(_0x434ec3,_0x2c6759){var _0x202ea2={};var _0xcc6920={};var _0xf46f03;var _0x567ce5;return db['User'][_0xbef8('0x92')]({'where':{'id':_0x434ec3[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x2c6759,null))[_0xbef8('0x12')](function(_0x501945){if(_0x501945){_0xf46f03=_0x501945;_0xcc6920['model']=_['keys'](db[_0xbef8('0xe4')][_0xbef8('0xc7')]);_0xcc6920[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x434ec3[_0xbef8('0x41')]);_0xcc6920['filters']=_[_0xbef8('0x57')](_0xcc6920[_0xbef8('0x54')],_0xcc6920[_0xbef8('0x41')]);_0x202ea2[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0xcc6920[_0xbef8('0x54')],qs['fields'](_0x434ec3['query']['fields']));_0x202ea2[_0xbef8('0x46')]=_0x202ea2[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x202ea2[_0xbef8('0x46')]:_0xcc6920[_0xbef8('0x54')];_0x202ea2['order']=qs['sort'](_0x434ec3[_0xbef8('0x41')][_0xbef8('0xca')]);_0x202ea2[_0xbef8('0x40')]=qs['filters'](_[_0xbef8('0xd5')](_0x434ec3[_0xbef8('0x41')],_0xcc6920[_0xbef8('0xc8')]));if(_0x434ec3['query'][_0xbef8('0xcb')]){_0x202ea2['where']=_[_0xbef8('0xcc')](_0x202ea2[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x202ea2['attributes'],function(_0x47ed49){var _0x57b81c={};_0x57b81c[_0x47ed49]={'$like':'%'+_0x434ec3[_0xbef8('0x41')]['filter']+'%'};return _0x57b81c;})});}_0x202ea2=_['merge']({},_0x202ea2,_0x434ec3[_0xbef8('0x5a')]);return _0xf46f03[_0xbef8('0xe3')](_0x202ea2);}})['then'](function(_0x35d9d2){if(_0x35d9d2){_0x567ce5=_0x35d9d2['length'];if(!_0x434ec3[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x202ea2[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x434ec3[_0xbef8('0x41')]['limit']);_0x202ea2[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x434ec3['query'][_0xbef8('0x21')]);}return _0xf46f03['getSmsInteractions'](_0x202ea2);}})[_0xbef8('0x12')](function(_0x4d129e){if(_0x4d129e){return _0x4d129e?{'count':_0x567ce5,'rows':_0x4d129e}:null;}})[_0xbef8('0x12')](respondWithResult(_0x2c6759,null))[_0xbef8('0x1c')](handleError(_0x2c6759,null));};exports[_0xbef8('0xe5')]=function(_0x5488dc,_0x1acd45){var _0x263f36={};var _0xa58dc4={};var _0x15f23b;var _0x4cc0ba;return db[_0xbef8('0x39')]['findOne']({'where':{'id':_0x5488dc[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x1acd45,null))['then'](function(_0x55be68){if(_0x55be68){_0x15f23b=_0x55be68;_0xa58dc4['model']=_[_0xbef8('0x56')](db[_0xbef8('0xe6')][_0xbef8('0xc7')]);_0xa58dc4[_0xbef8('0x41')]=_['keys'](_0x5488dc[_0xbef8('0x41')]);_0xa58dc4['filters']=_[_0xbef8('0x57')](_0xa58dc4['model'],_0xa58dc4[_0xbef8('0x41')]);_0x263f36['attributes']=_['intersection'](_0xa58dc4[_0xbef8('0x54')],qs['fields'](_0x5488dc[_0xbef8('0x41')][_0xbef8('0x58')]));_0x263f36[_0xbef8('0x46')]=_0x263f36[_0xbef8('0x46')]['length']?_0x263f36['attributes']:_0xa58dc4['model'];_0x263f36['order']=qs[_0xbef8('0xca')](_0x5488dc[_0xbef8('0x41')][_0xbef8('0xca')]);_0x263f36[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x5488dc['query'],_0xa58dc4[_0xbef8('0xc8')]));if(_0x5488dc[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x263f36[_0xbef8('0x40')]=_['merge'](_0x263f36[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x263f36[_0xbef8('0x46')],function(_0x20b5e7){var _0x1e4b8a={};_0x1e4b8a[_0x20b5e7]={'$like':'%'+_0x5488dc[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x1e4b8a;})});}_0x263f36=_[_0xbef8('0xcc')]({},_0x263f36,_0x5488dc['options']);return _0x15f23b['getFaxInteractions'](_0x263f36);}})[_0xbef8('0x12')](function(_0x36787a){if(_0x36787a){_0x4cc0ba=_0x36787a[_0xbef8('0x4b')];if(!_0x5488dc[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x263f36['limit']=qs['limit'](_0x5488dc[_0xbef8('0x41')][_0xbef8('0x22')]);_0x263f36[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x5488dc['query'][_0xbef8('0x21')]);}return _0x15f23b[_0xbef8('0xe5')](_0x263f36);}})['then'](function(_0x279405){if(_0x279405){return _0x279405?{'count':_0x4cc0ba,'rows':_0x279405}:null;}})[_0xbef8('0x12')](respondWithResult(_0x1acd45,null))[_0xbef8('0x1c')](handleError(_0x1acd45,null));};exports['getWhatsappInteractions']=function(_0x1eba78,_0x326853){var _0x33ac28={};var _0x20af61={};var _0x5be010;var _0x349758;return db['User']['findOne']({'where':{'id':_0x1eba78['params']['id']}})['then'](handleEntityNotFound(_0x326853,null))['then'](function(_0x227dbf){if(_0x227dbf){_0x5be010=_0x227dbf;_0x20af61[_0xbef8('0x54')]=_[_0xbef8('0x56')](db['WhatsappInteraction'][_0xbef8('0xc7')]);_0x20af61[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x1eba78[_0xbef8('0x41')]);_0x20af61[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x20af61[_0xbef8('0x54')],_0x20af61[_0xbef8('0x41')]);_0x33ac28[_0xbef8('0x46')]=_[_0xbef8('0x57')](_0x20af61[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x1eba78[_0xbef8('0x41')][_0xbef8('0x58')]));_0x33ac28[_0xbef8('0x46')]=_0x33ac28[_0xbef8('0x46')]['length']?_0x33ac28[_0xbef8('0x46')]:_0x20af61['model'];_0x33ac28[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x1eba78['query'][_0xbef8('0xca')]);_0x33ac28[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x1eba78[_0xbef8('0x41')],_0x20af61['filters']));if(_0x1eba78[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x33ac28[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0x33ac28[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x33ac28[_0xbef8('0x46')],function(_0x44e402){var _0x1c426d={};_0x1c426d[_0x44e402]={'$like':'%'+_0x1eba78[_0xbef8('0x41')]['filter']+'%'};return _0x1c426d;})});}_0x33ac28=_[_0xbef8('0xcc')]({},_0x33ac28,_0x1eba78['options']);return _0x5be010[_0xbef8('0xe7')](_0x33ac28);}})[_0xbef8('0x12')](function(_0x1dd3e8){if(_0x1dd3e8){_0x349758=_0x1dd3e8[_0xbef8('0x4b')];if(!_0x1eba78[_0xbef8('0x41')][_0xbef8('0xcd')](_0xbef8('0xd2'))){_0x33ac28[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x1eba78[_0xbef8('0x41')][_0xbef8('0x22')]);_0x33ac28[_0xbef8('0x21')]=qs['offset'](_0x1eba78['query'][_0xbef8('0x21')]);}return _0x5be010['getWhatsappInteractions'](_0x33ac28);}})[_0xbef8('0x12')](function(_0x1d0c96){if(_0x1d0c96){return _0x1d0c96?{'count':_0x349758,'rows':_0x1d0c96}:null;}})[_0xbef8('0x12')](respondWithResult(_0x326853,null))['catch'](handleError(_0x326853,null));};exports['login']=function(_0x265d9b,_0x6e8b41,_0x2b5f03){var _0xee9cc8;var _0x393c06;var _0x47d887;var _0x516b28=!_[_0xbef8('0x67')](_0x265d9b[_0xbef8('0x5c')]['id'])?_0x265d9b[_0xbef8('0x5c')]['id']:!_['isNil'](_0x265d9b[_0xbef8('0x2c')]['id'])?_0x265d9b[_0xbef8('0x2c')]['id']:null;return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x516b28,'role':{'$or':[_0xbef8('0x2a'),_0xbef8('0x2c'),_0xbef8('0x2d')]}},'attributes':['id',_0xbef8('0x34'),_0xbef8('0xe8'),'mobile',_0xbef8('0x29'),'internal','loginInPause']})[_0xbef8('0x12')](function(_0x18e992){if(_0x18e992){if(_0x18e992[_0xbef8('0x29')]===_0xbef8('0x2d')){_0xee9cc8=_0x18e992;if(_0x265d9b[_0xbef8('0x5b')]['interface']){_0x47d887=util[_0xbef8('0xa7')](_0xbef8('0xe9'),_0xee9cc8[_0x265d9b[_0xbef8('0x5b')][_0xbef8('0x9c')]]);}else if(_0x265d9b[_0xbef8('0x5b')][_0xbef8('0xea')]){_0x47d887=util['format'](_0xbef8('0xeb'),_0x265d9b[_0xbef8('0x5b')]['intrf']);}else{_0x47d887=util[_0xbef8('0xa7')](_0xbef8('0xeb'),_0xee9cc8[_0xbef8('0x34')]);}socket['to'](util[_0xbef8('0xa7')](_0xbef8('0xec'),_0xee9cc8[_0xbef8('0x34')]))[_0xbef8('0x25')](_0xbef8('0xed'),{'user':{'id':_0xee9cc8['id'],'name':_0xee9cc8[_0xbef8('0x34')]},'ip':_0x265d9b['headers'][_0xbef8('0xee')]||_0x265d9b[_0xbef8('0xef')][_0xbef8('0xf0')]||_0x265d9b[_0xbef8('0xf1')][_0xbef8('0xf0')]||_0x265d9b[_0xbef8('0xef')]['socket'][_0xbef8('0xf0')]});return db[_0xbef8('0xae')][_0xbef8('0x27')]({'where':{'membername':_0xee9cc8['name']},'individualHooks':!![]});}}else{throw new db[(_0xbef8('0x8e'))][(_0xbef8('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xee9cc8){return _0xee9cc8['getVoiceQueues']({'raw':!![]});}})[_0xbef8('0x12')](function(_0x439c99){if(_0xee9cc8){var _0x16d321=[];if(_0x439c99){_0x393c06=_0x439c99;if(_0x393c06['length']){for(var _0xb54fb4=0x0;_0xb54fb4<_0x393c06['length'];_0xb54fb4++){_0x16d321['push']({'membername':_0xee9cc8['name'],'UserId':_0xee9cc8['id'],'queue_name':_0x393c06[_0xb54fb4][_0xbef8('0x34')],'VoiceQueueId':_0x393c06[_0xb54fb4]['id'],'interface':_0x47d887,'paused':_0xee9cc8['loginInPause']||![],'penalty':_0x393c06[_0xb54fb4]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xbef8('0x87')](_0x16d321,function(_0x47e526){return db['UserVoiceQueueRt'][_0xbef8('0xf2')](_0x47e526);});}}}})['then'](function(){if(_0xee9cc8){return db[_0xbef8('0xf3')][_0xbef8('0x48')]({'where':{'membername':_0xee9cc8['name'],'exitAt':null}});}})['then'](function(_0xe57f04){if(_0xee9cc8){var _0x84b4ff=[];_0xe57f04['forEach'](function(_0x5a95b0){_0x84b4ff['push'](_0x5a95b0[_0xbef8('0xf4')]({'exitAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5'))}));});return BPromise['all'](_0x84b4ff);}})[_0xbef8('0x12')](function(){if(_0xee9cc8){var _0x5e7ade=[];var _0x44ce6b=[];var _0x4a3311=utils[_0xbef8('0xf6')]();var _0x25d494={'membername':_0xee9cc8[_0xbef8('0x34')],'interface':_0x47d887,'enterAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5')),'role':_0xee9cc8['role'],'internal':_0xee9cc8['internal']};_0x4a3311[_0xbef8('0xf7')](function(_0x5e0a14){_0x5e7ade['push'](_[_0xbef8('0xcc')]({'channel':_0x5e0a14,'type':_0xbef8('0xf8'),'data1':_0x265d9b[_0xbef8('0x5b')][_0xbef8('0xf9')],'data2':_0x47d887},_0x25d494));if(_0xee9cc8[_0xbef8('0x9a')]){_0x44ce6b['push'](_[_0xbef8('0xcc')]({'channel':_0x5e0a14,'type':_0xbef8('0xfa'),'data1':_0xbef8('0xfb')},_0x25d494));}});return db['MemberReport'][_0xbef8('0xfc')](_0x5e7ade[_0xbef8('0xc4')](_0x44ce6b),{'individualHooks':!![]});}})[_0xbef8('0x12')](function(){if(_0xee9cc8){return _0xee9cc8['update']({'online':!![],'lastLoginAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5')),'voicePause':_0xee9cc8['loginInPause']||![],'mailPause':_0xee9cc8[_0xbef8('0x9a')]||![],'chatPause':_0xee9cc8[_0xbef8('0x9a')]||![],'faxPause':_0xee9cc8[_0xbef8('0x9a')]||![],'smsPause':_0xee9cc8[_0xbef8('0x9a')]||![],'openchannelPause':_0xee9cc8[_0xbef8('0x9a')]||![],'whatsappPause':_0xee9cc8['loginInPause']||![],'pauseType':_0xee9cc8[_0xbef8('0x9a')]?_0xbef8('0xfb'):null,'interface':_0x47d887,'lastPauseAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5'))});}})['then'](function(_0x196e49){if(_0x265d9b[_0xbef8('0xfd')]){return _0x2b5f03();}else{return BPromise[_0xbef8('0xfe')](_0x196e49)[_0xbef8('0x12')](respondWithResult(_0x6e8b41,null));}})[_0xbef8('0x1c')](handleError(_0x6e8b41,null));};exports[_0xbef8('0xff')]=function(_0x5b3d54,_0x53e503){var _0x4877b5;return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x5b3d54[_0xbef8('0x5c')]['id'],'role':_0xbef8('0x2d')},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29')]})[_0xbef8('0x12')](handleEntityNotFound(_0x53e503,null))[_0xbef8('0x12')](function(_0x2b915b){if(_0x2b915b){_0x4877b5=_0x2b915b;return db[_0xbef8('0xae')]['destroy']({'where':{'membername':_0x4877b5[_0xbef8('0x34')]},'individualHooks':!![]});}})[_0xbef8('0x12')](function(){return db[_0xbef8('0xf3')][_0xbef8('0x48')]({'where':{'membername':_0x4877b5[_0xbef8('0x34')],'exitAt':null}});})['then'](function(_0x508635){var _0x154ba2=[];_0x508635['forEach'](function(_0x67ccf3){_0x154ba2[_0xbef8('0x47')](_0x67ccf3[_0xbef8('0xf4')]({'exitAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5'))}));});return BPromise[_0xbef8('0x53')](_0x154ba2);})[_0xbef8('0x12')](function(){return _0x4877b5[_0xbef8('0xf4')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xbef8('0x12')](respondWithResult(_0x53e503,null))[_0xbef8('0x1c')](handleError(_0x53e503,null));};exports[_0xbef8('0x100')]=function(_0x67e020,_0x25ec24){var _0x337b47;return db[_0xbef8('0xae')][_0xbef8('0xf4')]({'paused':0x1},{'where':{'UserId':_0x67e020[_0xbef8('0x5c')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x67e020[_0xbef8('0x5c')]['id'],'role':_0xbef8('0x2d')},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29'),'internal',_0xbef8('0x9c')]});})[_0xbef8('0x12')](handleEntityNotFound(_0x25ec24,null))['then'](function(_0x235a04){if(_0x235a04){_0x337b47=_0x235a04;return respondWithRpcPromise(_0xbef8('0x101'),_0xbef8('0x100'),{'id':_0x337b47['id'],'name':_0x337b47['name'],'pause':!![]});}})[_0xbef8('0x12')](function(){if(_0x337b47){return db[_0xbef8('0xf3')][_0xbef8('0x48')]({'where':{'membername':_0x337b47[_0xbef8('0x34')],'type':_0xbef8('0xfa'),'exitAt':null}});}})['then'](function(_0x53903e){if(_0x53903e[_0xbef8('0x4b')]){var _0x5199e0=moment()[_0xbef8('0xa7')](_0xbef8('0xf5'));for(var _0x4045ae=0x0,_0x57e490=_0x53903e[_0xbef8('0x4b')];_0x4045ae<_0x57e490;_0x4045ae++){_0x53903e[_0x4045ae]['updateAttributes']({'exitAt':_0x5199e0});}}})[_0xbef8('0x12')](function(){var _0x3ef8cb=[];var _0x470980=utils[_0xbef8('0xf6')]();_0x470980[_0xbef8('0xf7')](function(_0x2a7fd5){_0x3ef8cb[_0xbef8('0x47')]({'channel':_0x2a7fd5,'membername':_0x337b47[_0xbef8('0x34')],'interface':_['isNil'](_0x337b47[_0xbef8('0x9c')])?util[_0xbef8('0xa7')]('SIP/%s',_0x337b47[_0xbef8('0x34')]):_0x337b47[_0xbef8('0x9c')],'type':'PAUSE','enterAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5')),'data1':_0x67e020[_0xbef8('0x5b')][_0xbef8('0x3b')]||_0xbef8('0x102'),'role':_0x337b47['role'],'internal':_0x337b47[_0xbef8('0x65')]});});return db[_0xbef8('0xf3')]['bulkCreate'](_0x3ef8cb,{'individualHooks':!![]});})['then'](function(){return _0x337b47[_0xbef8('0xf4')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x67e020[_0xbef8('0x5b')][_0xbef8('0x3b')]||_0xbef8('0x102'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x25ec24,null))[_0xbef8('0x1c')](handleError(_0x25ec24,null));};exports['unpause']=function(_0x34f43d,_0x199bf5){var _0x585645;return db[_0xbef8('0x39')][_0xbef8('0x33')]({'where':{'id':_0x34f43d[_0xbef8('0x5c')]['id']},'attributes':['id',_0xbef8('0x34'),_0xbef8('0x29'),_0xbef8('0x9b'),_0xbef8('0x103'),_0xbef8('0x104'),_0xbef8('0x105'),_0xbef8('0x106'),_0xbef8('0x107'),'whatsapppause',_0xbef8('0x108'),'lastPauseAt']})['then'](handleEntityNotFound(_0x199bf5,null))[_0xbef8('0x12')](function(_0x459fa6){if(_0x459fa6){_0x585645=_0x459fa6;if(_0x34f43d[_0xbef8('0x5b')]['channel']&&!utils[_0xbef8('0xab')](_0x34f43d['body']['channel'])){throw new db[(_0xbef8('0x8e'))]['ValidationError'](_0xbef8('0x9d'));}switch(_0x34f43d[_0xbef8('0x5b')][_0xbef8('0xaa')]){case _0xbef8('0xa6'):return respondWithRpcPromise('QueuePause',_0xbef8('0x109'),{'id':_0x585645['id'],'name':_0x585645[_0xbef8('0x34')],'pause':![]})['then'](function(){return db[_0xbef8('0xae')][_0xbef8('0xf4')]({'paused':0x0},{'where':{'UserId':_0x585645['id']},'individualHooks':!![]});})[_0xbef8('0x12')](function(){return db[_0xbef8('0xf3')]['find']({'where':{'channel':_0x34f43d['body'][_0xbef8('0xaa')],'membername':_0x585645[_0xbef8('0x34')],'type':_0xbef8('0xfa'),'exitAt':null}});})[_0xbef8('0x12')](function(_0x321ff9){if(_0x321ff9){return _0x321ff9['update']({'exitAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5')),'data2':_0xbef8('0x10a')},{'individualHooks':!![]});}return null;})[_0xbef8('0x12')](function(){return _0x585645[_0xbef8('0xf4')]({'voicePause':![]});});case _0xbef8('0x50'):case'chat':case _0xbef8('0x4f'):case'sms':case _0xbef8('0x52'):case _0xbef8('0x51'):return db[_0xbef8('0xf3')]['find']({'where':{'channel':_0x34f43d['body'][_0xbef8('0xaa')],'membername':_0x585645['name'],'type':_0xbef8('0xfa'),'exitAt':null}})[_0xbef8('0x12')](function(_0x3f9d38){if(_0x3f9d38){return _0x3f9d38[_0xbef8('0xf4')]({'exitAt':moment()[_0xbef8('0xa7')](_0xbef8('0xf5')),'data2':_0xbef8('0x10a')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x1d8d0e={};_['set'](_0x1d8d0e,util['format']('%s%s',_0x34f43d['body']['channel'],_0xbef8('0x10b')),![]);return _0x585645['update'](_0x1d8d0e);});default:return respondWithRpcPromise('QueuePause',_0xbef8('0x109'),{'id':_0x585645['id'],'name':_0x585645['name'],'pause':![]})[_0xbef8('0x12')](function(){return db[_0xbef8('0xae')][_0xbef8('0xf4')]({'paused':0x0},{'where':{'UserId':_0x585645['id']}});})['then'](function(){return db[_0xbef8('0xf3')][_0xbef8('0x48')]({'where':{'membername':_0x585645['name'],'type':_0xbef8('0xfa'),'exitAt':null}});})[_0xbef8('0x12')](function(_0x303278){var _0x1f34d7=[];_0x303278[_0xbef8('0xf7')](function(_0x3bec3b){_0x1f34d7[_0xbef8('0x47')](_0x3bec3b[_0xbef8('0xf4')]({'exitAt':moment()['format'](_0xbef8('0xf5')),'data2':_0xbef8('0x10a')}));});return BPromise[_0xbef8('0x53')](_0x1f34d7);})['then'](function(){return _0x585645[_0xbef8('0xf4')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xbef8('0x12')](respondWithResult(_0x199bf5,null))[_0xbef8('0x1c')](handleError(_0x199bf5,null));};exports[_0xbef8('0x10c')]=function(_0x109cbf,_0x5a7831){var _0x1f951f={};var _0x747fe5={};var _0x3ba83a;var _0x2b7452;return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x109cbf[_0xbef8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5a7831,null))[_0xbef8('0x12')](function(_0x38bc1a){if(_0x38bc1a){_0x3ba83a=_0x38bc1a;_0x747fe5[_0xbef8('0x54')]=_['keys'](db[_0xbef8('0x10d')]['rawAttributes']);_0x747fe5[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x109cbf[_0xbef8('0x41')]);_0x747fe5['filters']=_['intersection'](_0x747fe5[_0xbef8('0x54')],_0x747fe5[_0xbef8('0x41')]);_0x1f951f[_0xbef8('0x46')]=_['intersection'](_0x747fe5[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x109cbf[_0xbef8('0x41')]['fields']));_0x1f951f[_0xbef8('0x46')]=_0x1f951f[_0xbef8('0x46')][_0xbef8('0x4b')]?_0x1f951f[_0xbef8('0x46')]:_0x747fe5[_0xbef8('0x54')];_0x1f951f[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x109cbf['query'][_0xbef8('0xca')]);_0x1f951f['where']=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x109cbf[_0xbef8('0x41')],_0x747fe5[_0xbef8('0xc8')]));if(_0x109cbf['query'][_0xbef8('0xcb')]){_0x1f951f[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0x1f951f[_0xbef8('0x40')],{'$or':_['map'](_0x1f951f[_0xbef8('0x46')],function(_0xda2fea){var _0x1e2361={};_0x1e2361[_0xda2fea]={'$like':'%'+_0x109cbf[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x1e2361;})});}_0x1f951f=_[_0xbef8('0xcc')]({},_0x1f951f,_0x109cbf['options']);return _0x3ba83a[_0xbef8('0x10c')](_0x1f951f);}})[_0xbef8('0x12')](function(_0x9a696e){if(_0x9a696e){_0x2b7452=_0x9a696e[_0xbef8('0x4b')];if(!_0x109cbf[_0xbef8('0x41')][_0xbef8('0xcd')]('nolimit')){_0x1f951f[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x109cbf[_0xbef8('0x41')][_0xbef8('0x22')]);_0x1f951f[_0xbef8('0x21')]=qs[_0xbef8('0x21')](_0x109cbf[_0xbef8('0x41')][_0xbef8('0x21')]);}return _0x3ba83a['getTeams'](_0x1f951f);}})['then'](function(_0x1a2c2e){if(_0x1a2c2e){return _0x1a2c2e?{'count':_0x2b7452,'rows':_0x1a2c2e}:null;}})[_0xbef8('0x12')](respondWithResult(_0x5a7831,null))[_0xbef8('0x1c')](handleError(_0x5a7831,null));};exports[_0xbef8('0x10e')]=function(_0x463a6c,_0x3b9713){var _0x56b30d=_0x463a6c[_0xbef8('0x5c')]['id'];var _0x1e1e1d=_0x463a6c[_0xbef8('0x5b')]?_0x463a6c[_0xbef8('0x5b')][_0xbef8('0x60')]:null;var _0x2ce184=[];return Promise[_0xbef8('0xfe')]()[_0xbef8('0x12')](function(){if(!_0x1e1e1d)throw new APIBadRequestError(_0xbef8('0x10f'));})[_0xbef8('0x12')](function(){return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x56b30d}});})[_0xbef8('0x12')](function(_0x1d45fe){if(!_0x1d45fe)throw new APINotFoundError(util['format'](_0xbef8('0x110'),_0x463a6c[_0xbef8('0x5c')]['id']));return db['sequelize'][_0xbef8('0x111')](function(_0x512828){return _0x1d45fe['addTeams'](_0x1e1e1d,{'transaction':_0x512828})['then'](function(){return db[_0xbef8('0x10d')][_0xbef8('0x48')]({'where':{'id':{'$in':_0x1e1e1d}}});})[_0xbef8('0x12')](function(_0x2ba5fc){var _0x393f88=_['map'](_0x2ba5fc,function(_0x3aa7bb){return _0x3aa7bb[_0xbef8('0x112')]();});return Promise[_0xbef8('0x53')](_0x393f88);})[_0xbef8('0x12')](function(_0x3e6e7a){_0x2ce184=_['flattenDeep'](_0x3e6e7a);var _0x5dd15e=_[_0xbef8('0x30')](_0x2ce184,function(_0x1a80d0){return _0x1a80d0[_0xbef8('0x113')](_0x1d45fe['id'],{'transaction':_0x512828});});return Promise[_0xbef8('0x53')](_0x5dd15e);})[_0xbef8('0x12')](function(){if(!_0x1d45fe[_0xbef8('0x114')])return;var _0x20ee2d=_[_0xbef8('0xcb')](_0x2ce184,function(_0x470c14){return _0x470c14[_0xbef8('0x115')]('channel')==='Voice';});var _0x39e8f4=_['map'](_0x20ee2d,function(_0x33be78){return db[_0xbef8('0xae')][_0xbef8('0xf2')]({'membername':_0x1d45fe[_0xbef8('0x34')],'UserId':_0x1d45fe['id'],'queue_name':_0x33be78['name'],'VoiceQueueId':_0x33be78['id'],'interface':_['isNil'](_0x1d45fe[_0xbef8('0x9c')])?util[_0xbef8('0xa7')](_0xbef8('0xeb'),_0x1d45fe[_0xbef8('0x34')]):_0x1d45fe['interface'],'paused':_0x1d45fe['voicePause']||![],'penalty':_0x1d45fe[_0xbef8('0xa8')]},{'transaction':_0x512828});});return Promise[_0xbef8('0x53')](_0x39e8f4);})[_0xbef8('0x12')](function(){return db[_0xbef8('0x116')][_0xbef8('0x48')]({'where':{'teamId':{'$in':_0x1e1e1d}}});})['then'](function(_0x465a9c){var _0xfbb76d=_[_0xbef8('0x30')](_0x465a9c,function(_0x2b309b){return db[_0xbef8('0x117')][_0xbef8('0x81')]({'UserId':_0x1d45fe['id'],'VoicePrefixId':_0x2b309b[_0xbef8('0x118')]},{'transaction':_0x512828});});return Promise[_0xbef8('0x53')](_0xfbb76d);});});})[_0xbef8('0x12')](function(){for(var _0x2993a5=0x0;_0x2993a5<_0x2ce184[_0xbef8('0x4b')];_0x2993a5++){var _0x219fa=_0x2ce184[_0x2993a5][_0xbef8('0x115')](_0xbef8('0xaa'));var _0x17fee1=_0x219fa+'QueueId';socket['emit'](_0xbef8('0x2c')+_0x219fa+'Queue:save',{'UserId':_0x56b30d,['queueField']:_0x2ce184[_0x2993a5]['id']});}})['then'](respondWithStatusCode(_0x3b9713,null))['catch'](APIHandleError(_0x3b9713));};exports['removeTeams']=function(_0x177f5b,_0x188507){var _0x3b7e6d=_0x177f5b[_0xbef8('0x5c')]['id'];var _0x305b69=null;if(_0x177f5b[_0xbef8('0x41')][_0xbef8('0x60')]){_0x305b69=_['isArray'](_0x177f5b['query'][_0xbef8('0x60')])?_0x177f5b[_0xbef8('0x41')][_0xbef8('0x60')]:[_0x177f5b['query'][_0xbef8('0x60')]];}var _0x2f9595=[];return Promise[_0xbef8('0xfe')]()[_0xbef8('0x12')](function(){if(!_0x305b69)throw new APIBadRequestError(_0xbef8('0x119'));})[_0xbef8('0x12')](function(){return db[_0xbef8('0x39')][_0xbef8('0x92')]({'where':{'id':_0x3b7e6d}});})['then'](function(_0x115bee){if(!_0x115bee)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x177f5b[_0xbef8('0x5c')]['id']));return db['sequelize'][_0xbef8('0x111')](function(_0x3cb2e9){return _0x115bee[_0xbef8('0x11a')](_0x305b69,{'transaction':_0x3cb2e9})[_0xbef8('0x12')](function(){return db[_0xbef8('0x10d')]['findAll']({'where':{'id':{'$in':_0x305b69}}});})[_0xbef8('0x12')](function(_0x451d6a){var _0x24c37c=_[_0xbef8('0x30')](_0x451d6a,function(_0x18dee0){return _0x18dee0['getAssociatedQueues']();});return Promise[_0xbef8('0x53')](_0x24c37c);})[_0xbef8('0x12')](function(_0x40df77){_0x2f9595=_[_0xbef8('0x11b')](_0x40df77);var _0x5389f6=_[_0xbef8('0x30')](_0x2f9595,function(_0x17201d){return _0x17201d[_0xbef8('0x11c')](_0x115bee['id'],{'transaction':_0x3cb2e9});});return Promise[_0xbef8('0x53')](_0x5389f6);})[_0xbef8('0x12')](function(){if(!_0x115bee[_0xbef8('0x114')])return;var _0x154ce8=_[_0xbef8('0xcb')](_0x2f9595,function(_0x19c7cb){return _0x19c7cb[_0xbef8('0x115')](_0xbef8('0xaa'))===_0xbef8('0x11d');});var _0x366f10=_[_0xbef8('0x30')](_0x154ce8,function(_0x110dba){return db[_0xbef8('0xae')][_0xbef8('0x27')]({'where':{'VoiceQueueId':_0x110dba['id'],'UserId':_0x115bee['id']},'transaction':_0x3cb2e9});});return Promise[_0xbef8('0x53')](_0x366f10);})['then'](function(){return db[_0xbef8('0x116')][_0xbef8('0x48')]({'where':{'teamId':{'$in':_0x305b69}}});})[_0xbef8('0x12')](function(_0x2b70cb){var _0x4b64e5=_[_0xbef8('0x30')](_0x2b70cb,function(_0x2b35a0){return db[_0xbef8('0x117')][_0xbef8('0x27')]({'where':{'UserId':_0x115bee['id'],'VoicePrefixId':_0x2b35a0['VoicePrefixId']}},{'transaction':_0x3cb2e9});});return Promise[_0xbef8('0x53')](_0x4b64e5);});});})[_0xbef8('0x12')](function(){for(var _0x4339bd=0x0;_0x4339bd<_0x2f9595[_0xbef8('0x4b')];_0x4339bd++){var _0x5ebccb=_0x2f9595[_0x4339bd]['getDataValue']('channel');var _0x36f68d=_0x5ebccb+_0xbef8('0xa3');socket['emit'](_0xbef8('0x2c')+_0x5ebccb+_0xbef8('0xad'),{'UserId':_0x3b7e6d,['queueField']:_0x2f9595[_0x4339bd]['id']});}})[_0xbef8('0x12')](respondWithStatusCode(_0x188507,null))[_0xbef8('0x1c')](APIHandleError(_0x188507));};exports[_0xbef8('0x11e')]=function(_0x34392a,_0x1d6cae){var _0x3b655a={};var _0x23bd2e={};var _0x54ac35;var _0x5b0e3e;return db['User'][_0xbef8('0x92')]({'where':{'id':_0x34392a[_0xbef8('0x5c')]['id']}})[_0xbef8('0x12')](handleEntityNotFound(_0x1d6cae,null))[_0xbef8('0x12')](function(_0x368f05){if(_0x368f05){_0x54ac35=_0x368f05;_0x23bd2e[_0xbef8('0x54')]=_['keys'](db['CmList'][_0xbef8('0xc7')]);_0x23bd2e[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x34392a[_0xbef8('0x41')]);_0x23bd2e[_0xbef8('0xc8')]=_['intersection'](_0x23bd2e[_0xbef8('0x54')],_0x23bd2e[_0xbef8('0x41')]);_0x3b655a['attributes']=_['intersection'](_0x23bd2e['model'],qs['fields'](_0x34392a[_0xbef8('0x41')]['fields']));_0x3b655a[_0xbef8('0x46')]=_0x3b655a['attributes'][_0xbef8('0x4b')]?_0x3b655a[_0xbef8('0x46')]:_0x23bd2e[_0xbef8('0x54')];_0x3b655a['order']=qs[_0xbef8('0xca')](_0x34392a['query'][_0xbef8('0xca')]);_0x3b655a[_0xbef8('0x40')]=qs['filters'](_[_0xbef8('0xd5')](_0x34392a['query'],_0x23bd2e[_0xbef8('0xc8')]));if(_0x34392a[_0xbef8('0x41')][_0xbef8('0xcb')]){_0x3b655a[_0xbef8('0x40')]=_['merge'](_0x3b655a[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x3b655a['attributes'],function(_0x21871d){var _0x387af1={};_0x387af1[_0x21871d]={'$like':'%'+_0x34392a[_0xbef8('0x41')][_0xbef8('0xcb')]+'%'};return _0x387af1;})});}_0x3b655a=_[_0xbef8('0xcc')]({},_0x3b655a,_0x34392a['options']);return _0x54ac35[_0xbef8('0x11e')](_0x3b655a);}})[_0xbef8('0x12')](function(_0x21276b){if(_0x21276b){_0x5b0e3e=_0x21276b[_0xbef8('0x4b')];if(!_0x34392a[_0xbef8('0x41')][_0xbef8('0xcd')]('nolimit')){_0x3b655a[_0xbef8('0x22')]=qs[_0xbef8('0x22')](_0x34392a['query']['limit']);_0x3b655a['offset']=qs[_0xbef8('0x21')](_0x34392a[_0xbef8('0x41')]['offset']);}return _0x54ac35[_0xbef8('0x11e')](_0x3b655a);}})['then'](function(_0x5c4506){if(_0x5c4506){return _0x5c4506?{'count':_0x5b0e3e,'rows':_0x5c4506}:null;}})['then'](respondWithResult(_0x1d6cae,null))[_0xbef8('0x1c')](handleError(_0x1d6cae,null));};exports['getAgents']=function(_0x404a8e,_0x43941b){var _0x2e1799={};var _0x4eb8de={};var _0x41b600;return db[_0xbef8('0x39')]['findOne']({'where':{'id':_0x404a8e[_0xbef8('0x5c')]['id']}})['then'](handleEntityNotFound(_0x43941b,null))['then'](function(_0x1a5a85){if(_0x1a5a85){_0x41b600=_0x1a5a85;_0x4eb8de[_0xbef8('0x54')]=_[_0xbef8('0x56')](db[_0xbef8('0x39')][_0xbef8('0xc7')]);_0x4eb8de[_0xbef8('0x41')]=_[_0xbef8('0x56')](_0x404a8e[_0xbef8('0x41')]);_0x4eb8de[_0xbef8('0xc8')]=_[_0xbef8('0x57')](_0x4eb8de[_0xbef8('0x54')],_0x4eb8de['query']);_0x2e1799['attributes']=_['intersection'](_0x4eb8de[_0xbef8('0x54')],qs[_0xbef8('0x58')](_0x404a8e[_0xbef8('0x41')][_0xbef8('0x58')]));_0x2e1799[_0xbef8('0x46')]=_0x2e1799[_0xbef8('0x46')]['length']?_0x2e1799['attributes']:_0x4eb8de[_0xbef8('0x54')];_0x2e1799[_0xbef8('0xc9')]=qs[_0xbef8('0xca')](_0x404a8e[_0xbef8('0x41')][_0xbef8('0xca')]);_0x2e1799[_0xbef8('0x40')]=qs[_0xbef8('0xc8')](_[_0xbef8('0xd5')](_0x404a8e[_0xbef8('0x41')],_0x4eb8de[_0xbef8('0xc8')]));if(_0x404a8e['query'][_0xbef8('0xcb')]){_0x2e1799[_0xbef8('0x40')]=_[_0xbef8('0xcc')](_0x2e1799[_0xbef8('0x40')],{'$or':_[_0xbef8('0x30')](_0x2e1799[_0xbef8('0x46')],function(_0x25046d){var _0x5c9faa={};_0x5c9faa[_0x25046d]={'$like':'%'+_0x404a8e[_0xbef8('0x41')]['filter']+'%'};return _0x5c9faa;})});}_0x2e1799['model']=db['User'];_0x2e1799['as']='Agents';_0x2e1799=_[_0xbef8('0xcc')]({},_0x2e1799,_0x404a8e[_0xbef8('0x5a')]);return _0x41b600[_0xbef8('0x11f')]({'include':[_0x2e1799]});}})['then'](function(_0x578fba){if(_0x578fba){var _0x2852aa={},_0x3f765d=[];for(var _0x49168b=0x0;_0x49168b<_0x578fba[_0xbef8('0x4b')];_0x49168b+=0x1){for(var _0x792f42=0x0,_0x2a251c;_0x792f42<_0x578fba[_0x49168b][_0xbef8('0x89')][_0xbef8('0x4b')];_0x792f42+=0x1){_0x2a251c=_0x578fba[_0x49168b]['Agents'][_0x792f42][_0xbef8('0x28')]({'plain':!![]});_0x2852aa[_0x2a251c['id']]=_0x2a251c;}}_0x2852aa=_[_0xbef8('0x120')](_0x2852aa);for(var _0x306999=qs[_0xbef8('0x21')](_0x404a8e[_0xbef8('0x41')][_0xbef8('0x21')]);_0x306999<_0x2852aa['length']&&_0x3f765d[_0xbef8('0x4b')]=_0x305004[_0x5ce6('0x53')]){throw new Error(_0x5ce6('0x54'));}})[_0x5ce6('0x23')](function(){if(_0x17f1ea){return db['UserVoiceQueueRt'][_0x5ce6('0x4b')]({'where':{'membername':_0x17f1ea[_0x5ce6('0x2b')]},'individualHooks':!![]});}})[_0x5ce6('0x23')](function(){if(_0x17f1ea){return _0x17f1ea[_0x5ce6('0x55')]({'raw':!![]});}})[_0x5ce6('0x23')](function(_0x5955e5){if(_0x17f1ea){if(_0x5955e5){var _0x5ea1a3=[];_0x183ec5=_0x5955e5;if(_0x183ec5['length']){for(var _0x2a1b77=0x0;_0x2a1b77<_0x183ec5[_0x5ce6('0x2d')];_0x2a1b77++){_0x5ea1a3[_0x5ce6('0x32')](db[_0x5ce6('0x40')][_0x5ce6('0x56')]({'membername':_0x17f1ea[_0x5ce6('0x2b')],'UserId':_0x17f1ea['id'],'queue_name':_0x183ec5[_0x2a1b77][_0x5ce6('0x2b')],'VoiceQueueId':_0x183ec5[_0x2a1b77]['id'],'interface':_0xe4e887,'paused':_0x17f1ea['loginInPause']||![],'penalty':_0x183ec5[_0x2a1b77][_0x5ce6('0x57')]||0x0}));}return BPromise['all'](_0x5ea1a3);}}}})[_0x5ce6('0x23')](function(){if(_0x17f1ea){return db['MemberReport'][_0x5ce6('0x1a')]({'where':{'membername':_0x17f1ea['name'],'exitAt':null}});}})[_0x5ce6('0x23')](function(_0x2759ab){if(_0x17f1ea){if(_0x2759ab&&_0x2759ab[_0x5ce6('0x2d')]){var _0x3546b6=[];_0x2759ab['forEach'](function(_0x59a8f0){_0x3546b6[_0x5ce6('0x32')](_0x59a8f0[_0x5ce6('0x3a')]({'exitAt':moment()[_0x5ce6('0x2e')](_0x5ce6('0x2f'))}));});return BPromise[_0x5ce6('0x49')](_0x3546b6);}}})[_0x5ce6('0x23')](function(_0x303722){if(_0x17f1ea){var _0x48ffd8=[];var _0x3c3ddb=[];var _0x41ff2c=utils[_0x5ce6('0x31')]();var _0x10ff38={'membername':_0x17f1ea[_0x5ce6('0x2b')],'interface':_0xe4e887,'enterAt':moment()[_0x5ce6('0x2e')](_0x5ce6('0x2f')),'role':_0x17f1ea[_0x5ce6('0x27')],'internal':_0x17f1ea[_0x5ce6('0x28')]};_0x41ff2c[_0x5ce6('0x48')](function(_0x11d3d9){_0x48ffd8[_0x5ce6('0x32')](_[_0x5ce6('0x58')]({'channel':_0x11d3d9,'type':_0x5ce6('0x59'),'data1':_0x5ce6('0x5a'),'data2':_0xe4e887},_0x10ff38));if(_0x17f1ea[_0x5ce6('0x4f')]){_0x3c3ddb[_0x5ce6('0x32')](_[_0x5ce6('0x58')]({'channel':_0x11d3d9,'type':_0x5ce6('0x2c'),'data1':'LOGININPAUSE'},_0x10ff38));}});return db['MemberReport'][_0x5ce6('0x39')](_0x48ffd8[_0x5ce6('0x5b')](_0x3c3ddb),{'individualHooks':!![]});}})[_0x5ce6('0x23')](function(){if(_0x17f1ea){return _0x17f1ea[_0x5ce6('0x3a')]({'online':!![],'lastLoginAt':moment()[_0x5ce6('0x2e')](_0x5ce6('0x2f')),'voicePause':_0x17f1ea[_0x5ce6('0x4f')]||![],'mailPause':_0x17f1ea[_0x5ce6('0x4f')]||![],'chatPause':_0x17f1ea[_0x5ce6('0x4f')]||![],'faxPause':_0x17f1ea[_0x5ce6('0x4f')]||![],'smsPause':_0x17f1ea[_0x5ce6('0x4f')]||![],'openchannelPause':_0x17f1ea[_0x5ce6('0x4f')]||![],'pauseType':_0x17f1ea[_0x5ce6('0x4f')]?_0x5ce6('0x5c'):null,'lastPauseAt':moment()[_0x5ce6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0xe4e887});}})[_0x5ce6('0x23')](function(_0x354186){_0x124430(_0x354186);})['catch'](function(_0x4fbaef){_0x34ac64(_0x2da22e['error'](0x1f4,_0x4fbaef[_0x5ce6('0x16')]));});});}; \ No newline at end of file +var _0xf3dd=['UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','concat','LOGININPAUSE','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','GetUser','ShowUser','User','find','model','PauseUser','role','interface','UserVoiceQueueRt','update','findAll','name','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','internal','uniqueid','MemberReport','bulkCreate','DEFAULT\x20PAUSE','findOne','channel','isValidChannel','Unknown\x20channel','mail','chat','fax','sms','openchannel','whatsapp','system','%s%s','Pause','LogoutUser','destroy','LoginUser','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert'];(function(_0x3321b5,_0x16cdba){var _0x275c7e=function(_0x3def70){while(--_0x3def70){_0x3321b5['push'](_0x3321b5['shift']());}};_0x275c7e(++_0x16cdba);}(_0xf3dd,0xc7));var _0xdf3d=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0xf3dd[_0x7729b1];return _0x349504;};'use strict';var _=require('lodash');var util=require(_0xdf3d('0x0'));var moment=require('moment');var BPromise=require(_0xdf3d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf3d('0x2'));var db=require(_0xdf3d('0x3'))['db'];var utils=require(_0xdf3d('0x4'));var logger=require(_0xdf3d('0x5'))(_0xdf3d('0x6'));var config=require(_0xdf3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdf3d('0x8')][_0xdf3d('0x9')]({'port':0x232a});config[_0xdf3d('0xa')]=_[_0xdf3d('0xb')](config[_0xdf3d('0xa')],{'host':_0xdf3d('0xc'),'port':0x18eb});var socket=require(_0xdf3d('0xd'))(new Redis(config[_0xdf3d('0xa')]));require(_0xdf3d('0xe'))[_0xdf3d('0xf')](socket);function respondWithRpcPromise(_0x332aa8,_0x5bb9dd,_0x44470b){return new BPromise(function(_0x3a5fc5,_0x34324b){return client[_0xdf3d('0x10')](_0x332aa8,_0x44470b)[_0xdf3d('0x11')](function(_0x158e4d){logger[_0xdf3d('0x12')](_0xdf3d('0x13'),_0x5bb9dd,_0xdf3d('0x14'));logger[_0xdf3d('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x5bb9dd,'request\x20sent',JSON[_0xdf3d('0x16')](_0x158e4d));if(_0x158e4d['error']){if(_0x158e4d[_0xdf3d('0x17')][_0xdf3d('0x18')]===0x1f4){logger[_0xdf3d('0x17')](_0xdf3d('0x13'),_0x5bb9dd,_0x158e4d['error'][_0xdf3d('0x19')]);return _0x34324b(_0x158e4d[_0xdf3d('0x17')]['message']);}logger[_0xdf3d('0x17')](_0xdf3d('0x13'),_0x5bb9dd,_0x158e4d['error']['message']);return _0x3a5fc5(_0x158e4d[_0xdf3d('0x17')][_0xdf3d('0x19')]);}else{logger[_0xdf3d('0x12')](_0xdf3d('0x13'),_0x5bb9dd,'request\x20sent');_0x3a5fc5(_0x158e4d[_0xdf3d('0x1a')][_0xdf3d('0x19')]);}})[_0xdf3d('0x1b')](function(_0x4be137){logger[_0xdf3d('0x17')](_0xdf3d('0x13'),_0x5bb9dd,_0x4be137);_0x34324b(_0x4be137);});});}exports['GetUser']=function(_0x54fc71){var _0x3f1338=this;return new Promise(function(_0x2f64db,_0x3b2e43){return db['User']['findAll']({'raw':_0x54fc71[_0xdf3d('0x1c')]?_0x54fc71['options'][_0xdf3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x54fc71[_0xdf3d('0x1c')]?_0x54fc71['options'][_0xdf3d('0x1e')]||null:null,'attributes':_0x54fc71[_0xdf3d('0x1c')]?_0x54fc71[_0xdf3d('0x1c')][_0xdf3d('0x1f')]||null:null,'limit':_0x54fc71['options']?_0x54fc71[_0xdf3d('0x1c')][_0xdf3d('0x20')]||null:null,'include':_0x54fc71[_0xdf3d('0x1c')]?_0x54fc71['options'][_0xdf3d('0x21')]?_[_0xdf3d('0x22')](_0x54fc71[_0xdf3d('0x1c')][_0xdf3d('0x21')],function(_0x48f055){return{'model':db[_0x48f055['model']],'as':_0x48f055['as'],'attributes':_0x48f055['attributes'],'include':_0x48f055['include']?_[_0xdf3d('0x22')](_0x48f055[_0xdf3d('0x21')],function(_0x5826f){return{'model':db[_0x5826f['model']],'as':_0x5826f['as'],'attributes':_0x5826f[_0xdf3d('0x1f')],'include':_0x5826f[_0xdf3d('0x21')]?_[_0xdf3d('0x22')](_0x5826f[_0xdf3d('0x21')],function(_0x433a21){return{'model':db[_0x433a21['model']],'as':_0x433a21['as'],'attributes':_0x433a21['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf3d('0x11')](function(_0x52f684){logger[_0xdf3d('0x12')](_0xdf3d('0x23'),_0x54fc71);logger[_0xdf3d('0x15')]('GetUser',_0x54fc71,JSON[_0xdf3d('0x16')](_0x52f684));_0x2f64db(_0x52f684);})[_0xdf3d('0x1b')](function(_0x4712de){logger[_0xdf3d('0x17')](_0xdf3d('0x23'),_0x4712de[_0xdf3d('0x19')],_0x54fc71);_0x3b2e43(_0x3f1338['error'](0x1f4,_0x4712de[_0xdf3d('0x19')]));});});};exports[_0xdf3d('0x24')]=function(_0x21fb74){var _0x248915=this;return new Promise(function(_0x102a08,_0x52e91d){return db[_0xdf3d('0x25')][_0xdf3d('0x26')]({'raw':_0x21fb74[_0xdf3d('0x1c')]?_0x21fb74[_0xdf3d('0x1c')][_0xdf3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x21fb74[_0xdf3d('0x1c')]?_0x21fb74['options']['where']||null:null,'attributes':_0x21fb74[_0xdf3d('0x1c')]?_0x21fb74[_0xdf3d('0x1c')][_0xdf3d('0x1f')]||null:null,'include':_0x21fb74[_0xdf3d('0x1c')]?_0x21fb74[_0xdf3d('0x1c')]['include']?_[_0xdf3d('0x22')](_0x21fb74[_0xdf3d('0x1c')]['include'],function(_0x597b40){return{'model':db[_0x597b40[_0xdf3d('0x27')]],'as':_0x597b40['as'],'attributes':_0x597b40['attributes'],'include':_0x597b40[_0xdf3d('0x21')]?_[_0xdf3d('0x22')](_0x597b40[_0xdf3d('0x21')],function(_0xc1061a){return{'model':db[_0xc1061a[_0xdf3d('0x27')]],'as':_0xc1061a['as'],'attributes':_0xc1061a[_0xdf3d('0x1f')],'include':_0xc1061a['include']?_[_0xdf3d('0x22')](_0xc1061a[_0xdf3d('0x21')],function(_0x418bef){return{'model':db[_0x418bef['model']],'as':_0x418bef['as'],'attributes':_0x418bef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f2eb7){logger['info'](_0xdf3d('0x24'),_0x21fb74);logger[_0xdf3d('0x15')](_0xdf3d('0x24'),_0x21fb74,JSON['stringify'](_0x2f2eb7));_0x102a08(_0x2f2eb7);})[_0xdf3d('0x1b')](function(_0xc9012e){logger[_0xdf3d('0x17')](_0xdf3d('0x24'),_0xc9012e['message'],_0x21fb74);_0x52e91d(_0x248915[_0xdf3d('0x17')](0x1f4,_0xc9012e[_0xdf3d('0x19')]));});});};exports[_0xdf3d('0x28')]=function(_0x2e3e3a){var _0x489c70=this;return new Promise(function(_0x34e826,_0x2c8be9){var _0xb17dbc;return db['User'][_0xdf3d('0x26')]({'where':_0x2e3e3a[_0xdf3d('0x1c')][_0xdf3d('0x1e')]||{},'attributes':['id','name',_0xdf3d('0x29'),'internal',_0xdf3d('0x2a')]})[_0xdf3d('0x11')](function(_0x246b3a){if(_0x246b3a){_0xb17dbc=_0x246b3a;return db[_0xdf3d('0x2b')][_0xdf3d('0x2c')]({'paused':0x1},{'where':{'UserId':_0xb17dbc['id']},'individualHooks':!![]});}})['then'](function(){if(_0xb17dbc){return db['MemberReport'][_0xdf3d('0x2d')]({'where':{'membername':_0xb17dbc[_0xdf3d('0x2e')],'type':_0xdf3d('0x2f'),'exitAt':null}});}})[_0xdf3d('0x11')](function(_0x340ce8){if(_0xb17dbc){if(_0x340ce8&&_0x340ce8[_0xdf3d('0x30')]){var _0x19ef0c=moment()[_0xdf3d('0x31')](_0xdf3d('0x32'));for(var _0x9240c=0x0,_0x5a35bb=_0x340ce8[_0xdf3d('0x30')];_0x9240c<_0x5a35bb;_0x9240c++){_0x340ce8[_0x9240c][_0xdf3d('0x33')]({'exitAt':_0x19ef0c});}}}})[_0xdf3d('0x11')](function(){if(_0xb17dbc){var _0x2479f4=[];var _0x5974be=utils[_0xdf3d('0x34')]();_0x5974be[_0xdf3d('0x35')](function(_0xa70696){_0x2479f4[_0xdf3d('0x36')]({'channel':_0xa70696,'membername':_0xb17dbc['name'],'interface':_[_0xdf3d('0x37')](_0xb17dbc[_0xdf3d('0x2a')])?util['format'](_0xdf3d('0x38'),_0xb17dbc[_0xdf3d('0x2e')]):_0xb17dbc[_0xdf3d('0x2a')],'type':_0xdf3d('0x2f'),'enterAt':moment()[_0xdf3d('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2e3e3a[_0xdf3d('0x39')][_0xdf3d('0x3a')]||'DEFAULT\x20PAUSE','role':_0xb17dbc[_0xdf3d('0x29')],'internal':_0xb17dbc[_0xdf3d('0x3b')],'uniqueid':_0x2e3e3a[_0xdf3d('0x39')][_0xdf3d('0x3c')]||null});});return db[_0xdf3d('0x3d')][_0xdf3d('0x3e')](_0x2479f4,{'individualHooks':!![]});}})[_0xdf3d('0x11')](function(){if(_0xb17dbc){return _0xb17dbc[_0xdf3d('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e3e3a[_0xdf3d('0x39')]['type']||_0xdf3d('0x3f'),'lastPauseAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32'))});}})[_0xdf3d('0x11')](function(_0x156b61){_0x34e826(_0x156b61);})['catch'](function(_0x58d322){_0x2c8be9(_0x489c70[_0xdf3d('0x17')](0x1f4,_0x58d322[_0xdf3d('0x19')]));});});};exports['UnpauseUser']=function(_0x128c4f){var _0x1ad617=this;return new Promise(function(_0x48945d,_0x24acf6){var _0x2b8a13;return db[_0xdf3d('0x25')][_0xdf3d('0x40')]({'where':_0x128c4f[_0xdf3d('0x1c')][_0xdf3d('0x1e')]||{},'attributes':['id',_0xdf3d('0x2e')]})[_0xdf3d('0x11')](function(_0x5ce8f0){if(_0x5ce8f0){_0x2b8a13=_0x5ce8f0;if(_0x128c4f[_0xdf3d('0x39')][_0xdf3d('0x41')]&&!utils[_0xdf3d('0x42')](_0x128c4f[_0xdf3d('0x39')]['channel'])){throw new Error(_0xdf3d('0x43'));}switch(_0x128c4f[_0xdf3d('0x39')][_0xdf3d('0x41')]){case'voice':return db[_0xdf3d('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x2b8a13['id']}})[_0xdf3d('0x11')](function(){return db['MemberReport'][_0xdf3d('0x26')]({'where':{'channel':_0x128c4f[_0xdf3d('0x39')][_0xdf3d('0x41')],'membername':_0x2b8a13[_0xdf3d('0x2e')],'type':_0xdf3d('0x2f'),'exitAt':null}});})['then'](function(_0x4e5801){if(_0x4e5801){return _0x4e5801[_0xdf3d('0x2c')]({'exitAt':moment()['format'](_0xdf3d('0x32')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2b8a13['update']({'voicePause':![]});});case _0xdf3d('0x44'):case _0xdf3d('0x45'):case _0xdf3d('0x46'):case _0xdf3d('0x47'):case _0xdf3d('0x48'):case _0xdf3d('0x49'):return db[_0xdf3d('0x3d')][_0xdf3d('0x26')]({'where':{'channel':_0x128c4f[_0xdf3d('0x39')]['channel'],'membername':_0x2b8a13[_0xdf3d('0x2e')],'type':_0xdf3d('0x2f'),'exitAt':null}})['then'](function(_0x4183d2){return _0x4183d2['update']({'exitAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32')),'data2':_0xdf3d('0x4a')},{'individualHooks':!![]});})[_0xdf3d('0x11')](function(){var _0x32e350={};_['set'](_0x32e350,util['format'](_0xdf3d('0x4b'),_0x128c4f[_0xdf3d('0x39')]['channel'],_0xdf3d('0x4c')),![]);return _0x2b8a13[_0xdf3d('0x2c')](_0x32e350);});default:return db[_0xdf3d('0x2b')][_0xdf3d('0x2c')]({'paused':0x0},{'where':{'UserId':_0x2b8a13['id']}})[_0xdf3d('0x11')](function(){return db['MemberReport'][_0xdf3d('0x2d')]({'where':{'membername':_0x2b8a13['name'],'type':_0xdf3d('0x2f'),'exitAt':null}});})[_0xdf3d('0x11')](function(_0x22bf48){var _0x3e3371=[];_0x22bf48[_0xdf3d('0x35')](function(_0x4e0201){_0x3e3371[_0xdf3d('0x36')](_0x4e0201[_0xdf3d('0x2c')]({'exitAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32')),'data2':_0xdf3d('0x4a')}));});return BPromise['all'](_0x3e3371);})[_0xdf3d('0x11')](function(){return _0x2b8a13[_0xdf3d('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xdf3d('0x11')](function(_0x49449d){_0x48945d(_0x49449d);})[_0xdf3d('0x1b')](function(_0x4ab3af){_0x24acf6(_0x1ad617[_0xdf3d('0x17')](0x1f4,_0x4ab3af[_0xdf3d('0x19')]));});});};exports[_0xdf3d('0x4d')]=function(_0x1445c3){var _0x545d60=this;return new Promise(function(_0x1b61c9,_0x12fc76){var _0x59cdaa;return db[_0xdf3d('0x25')][_0xdf3d('0x40')]({'where':_0x1445c3['options'][_0xdf3d('0x1e')]||{},'attributes':['id',_0xdf3d('0x2e')]})[_0xdf3d('0x11')](function(_0x459a5b){if(_0x459a5b){_0x59cdaa=_0x459a5b;return db['UserVoiceQueueRt'][_0xdf3d('0x4e')]({'where':{'membername':_0x59cdaa[_0xdf3d('0x2e')]},'individualHooks':!![]});}})[_0xdf3d('0x11')](function(){if(_0x59cdaa){return db[_0xdf3d('0x3d')][_0xdf3d('0x2d')]({'where':{'membername':_0x59cdaa['name'],'exitAt':null}});}})['then'](function(_0x364545){if(_0x59cdaa){if(_0x364545&&_0x364545[_0xdf3d('0x30')]){var _0x5a406f=[];_0x364545[_0xdf3d('0x35')](function(_0x3f5d92){_0x5a406f[_0xdf3d('0x36')](_0x3f5d92['update']({'exitAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32'))}));});return BPromise['all'](_0x5a406f);}}})[_0xdf3d('0x11')](function(){if(_0x59cdaa){return _0x59cdaa['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xdf3d('0x11')](function(_0x2ab56b){_0x1b61c9(_0x2ab56b);})[_0xdf3d('0x1b')](function(_0x15728b){_0x12fc76(_0x545d60[_0xdf3d('0x17')](0x1f4,_0x15728b['message']));});});};exports[_0xdf3d('0x4f')]=function(_0x5c4ddb){var _0x3e5412=this;return new Promise(function(_0x40f7aa,_0x3b37ae){var _0x458cf5;var _0xa41cc7;var _0x535008;var _0x2581c5;return db['User']['findOne']({'where':_0x5c4ddb[_0xdf3d('0x1c')][_0xdf3d('0x1e')]||{},'attributes':['id','name',_0xdf3d('0x29'),'mobile',_0xdf3d('0x50'),_0xdf3d('0x3b'),_0xdf3d('0x51'),_0xdf3d('0x2a')]})[_0xdf3d('0x11')](function(_0x496b73){if(_0x496b73){_0x458cf5=_0x496b73;_0x2581c5=_0x5c4ddb['body']['interface']?_0x5c4ddb[_0xdf3d('0x39')][_0xdf3d('0x2a')]:util['format'](_0xdf3d('0x38'),_0x458cf5[_0xdf3d('0x2e')]);return db[_0xdf3d('0x25')][_0xdf3d('0x52')]({'where':{'role':_0xdf3d('0x53'),'online':!![],'id':{'$ne':_0x458cf5['id']}}});}})[_0xdf3d('0x11')](function(_0x3d3843){if(_0x3d3843){_0x535008=_0x3d3843;return require(_0xdf3d('0x54'))['getLicense']();}})[_0xdf3d('0x11')](function(_0x27da17){if(_0x27da17&&_0x27da17[_0xdf3d('0x55')]&&_0x535008>=_0x27da17[_0xdf3d('0x55')]){throw new Error(_0xdf3d('0x56'));}})[_0xdf3d('0x11')](function(){if(_0x458cf5){return db['UserVoiceQueueRt'][_0xdf3d('0x4e')]({'where':{'membername':_0x458cf5[_0xdf3d('0x2e')]},'individualHooks':!![]});}})['then'](function(){if(_0x458cf5){return _0x458cf5[_0xdf3d('0x57')]({'raw':!![]});}})[_0xdf3d('0x11')](function(_0x579b91){if(_0x458cf5){if(_0x579b91){var _0x10f7cf=[];_0xa41cc7=_0x579b91;if(_0xa41cc7['length']){for(var _0x36cc73=0x0;_0x36cc73<_0xa41cc7[_0xdf3d('0x30')];_0x36cc73++){_0x10f7cf[_0xdf3d('0x36')](db[_0xdf3d('0x2b')][_0xdf3d('0x58')]({'membername':_0x458cf5[_0xdf3d('0x2e')],'UserId':_0x458cf5['id'],'queue_name':_0xa41cc7[_0x36cc73][_0xdf3d('0x2e')],'VoiceQueueId':_0xa41cc7[_0x36cc73]['id'],'interface':_0x2581c5,'paused':_0x458cf5[_0xdf3d('0x51')]||![],'penalty':_0xa41cc7[_0x36cc73][_0xdf3d('0x59')]||0x0}));}return BPromise[_0xdf3d('0x5a')](_0x10f7cf);}}}})['then'](function(){if(_0x458cf5){return db[_0xdf3d('0x3d')][_0xdf3d('0x2d')]({'where':{'membername':_0x458cf5[_0xdf3d('0x2e')],'exitAt':null}});}})[_0xdf3d('0x11')](function(_0x247bf0){if(_0x458cf5){if(_0x247bf0&&_0x247bf0[_0xdf3d('0x30')]){var _0x1683cb=[];_0x247bf0['forEach'](function(_0x1f8c88){_0x1683cb[_0xdf3d('0x36')](_0x1f8c88['update']({'exitAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32'))}));});return BPromise['all'](_0x1683cb);}}})[_0xdf3d('0x11')](function(_0x507784){if(_0x458cf5){var _0x5335e8=[];var _0x5f3e23=[];var _0x5d928d=utils['getChannels']();var _0xc1097c={'membername':_0x458cf5[_0xdf3d('0x2e')],'interface':_0x2581c5,'enterAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32')),'role':_0x458cf5['role'],'internal':_0x458cf5[_0xdf3d('0x3b')]};_0x5d928d[_0xdf3d('0x35')](function(_0x536ddf){_0x5335e8['push'](_[_0xdf3d('0x5b')]({'channel':_0x536ddf,'type':_0xdf3d('0x5c'),'data1':_0xdf3d('0x5d'),'data2':_0x2581c5},_0xc1097c));if(_0x458cf5[_0xdf3d('0x51')]){_0x5f3e23[_0xdf3d('0x36')](_[_0xdf3d('0x5b')]({'channel':_0x536ddf,'type':_0xdf3d('0x2f'),'data1':'LOGININPAUSE'},_0xc1097c));}});return db['MemberReport']['bulkCreate'](_0x5335e8[_0xdf3d('0x5e')](_0x5f3e23),{'individualHooks':!![]});}})[_0xdf3d('0x11')](function(){if(_0x458cf5){return _0x458cf5[_0xdf3d('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xdf3d('0x31')](_0xdf3d('0x32')),'voicePause':_0x458cf5[_0xdf3d('0x51')]||![],'mailPause':_0x458cf5[_0xdf3d('0x51')]||![],'chatPause':_0x458cf5[_0xdf3d('0x51')]||![],'faxPause':_0x458cf5[_0xdf3d('0x51')]||![],'smsPause':_0x458cf5[_0xdf3d('0x51')]||![],'openchannelPause':_0x458cf5['loginInPause']||![],'pauseType':_0x458cf5[_0xdf3d('0x51')]?_0xdf3d('0x5f'):null,'lastPauseAt':moment()[_0xdf3d('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2581c5});}})[_0xdf3d('0x11')](function(_0x2fa4fd){_0x40f7aa(_0x2fa4fd);})['catch'](function(_0x3eaf42){_0x3b37ae(_0x3e5412[_0xdf3d('0x17')](0x1f4,_0x3eaf42[_0xdf3d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 4becb30..65b7981 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 _0xe04c=['./user.events','save','update','emit','removeListener','length','user:'];(function(_0x4b01af,_0x566ed5){var _0x2ac08f=function(_0x4645aa){while(--_0x4645aa){_0x4b01af['push'](_0x4b01af['shift']());}};_0x2ac08f(++_0x566ed5);}(_0xe04c,0xaf));var _0xce04=function(_0x5e9995,_0x41f494){_0x5e9995=_0x5e9995-0x0;var _0x15b3bb=_0xe04c[_0x5e9995];return _0x15b3bb;};'use strict';var UserEvents=require(_0xce04('0x0'));var events=[_0xce04('0x1'),'remove',_0xce04('0x2')];function createListener(_0x26dd5d,_0x3da789){return function(_0xa7f59f){_0x3da789[_0xce04('0x3')](_0x26dd5d,_0xa7f59f);};}function removeListener(_0x38da59,_0x31f833){return function(){UserEvents[_0xce04('0x4')](_0x38da59,_0x31f833);};}exports['register']=function(_0x2b9479){for(var _0xc2cca6=0x0,_0x2edeaa=events[_0xce04('0x5')];_0xc2cca6<_0x2edeaa;_0xc2cca6++){var _0x460965=events[_0xc2cca6];var _0x4b9885=createListener(_0xce04('0x6')+_0x460965,_0x2b9479);UserEvents['on'](_0x460965,_0x4b9885);}}; \ No newline at end of file +var _0xc2c3=['user:','./user.events','remove','emit','register','length'];(function(_0x2492dc,_0x3284a7){var _0x310431=function(_0x2e7d91){while(--_0x2e7d91){_0x2492dc['push'](_0x2492dc['shift']());}};_0x310431(++_0x3284a7);}(_0xc2c3,0x187));var _0x3c2c=function(_0x338126,_0x356ff9){_0x338126=_0x338126-0x0;var _0x2a5b1e=_0xc2c3[_0x338126];return _0x2a5b1e;};'use strict';var UserEvents=require(_0x3c2c('0x0'));var events=['save',_0x3c2c('0x1'),'update'];function createListener(_0x5f0228,_0x21f283){return function(_0x4ec171){_0x21f283[_0x3c2c('0x2')](_0x5f0228,_0x4ec171);};}function removeListener(_0x29f3c9,_0x57de14){return function(){UserEvents['removeListener'](_0x29f3c9,_0x57de14);};}exports[_0x3c2c('0x3')]=function(_0x1b249a){for(var _0x476ae4=0x0,_0x3c3963=events[_0x3c2c('0x4')];_0x476ae4<_0x3c3963;_0x476ae4++){var _0x1f61a9=events[_0x476ae4];var _0x5745da=createListener(_0x3c2c('0x5')+_0x1f61a9,_0x1b249a);UserEvents['on'](_0x1f61a9,_0x5745da);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 8e6ea82..7a1e4d5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x17b6ca,_0x1918f4){var _0x6d2d16=function(_0x84c7ce){while(--_0x84c7ce){_0x17b6ca['push'](_0x17b6ca['shift']());}};_0x6d2d16(++_0x1918f4);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4d79cc,_0x52e011){var _0x370bc8=function(_0x2d81d0){while(--_0x2d81d0){_0x4d79cc['push'](_0x4d79cc['shift']());}};_0x370bc8(++_0x52e011);}(_0x70e0,0x17b));var _0x070e=function(_0x28cf60,_0x40400e){_0x28cf60=_0x28cf60-0x0;var _0x17e4a7=_0x70e0[_0x28cf60];return _0x17e4a7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8556f35..7738342 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 _0x385b=['sequelize','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x385b,0x17a));var _0xb385=function(_0xfaf19d,_0x57304b){_0xfaf19d=_0xfaf19d-0x0;var _0x14a9d9=_0x385b[_0xfaf19d];return _0x14a9d9;};'use strict';var Sequelize=require(_0xb385('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb385('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7301=['sequelize','exports','INTEGER'];(function(_0x503185,_0x20d261){var _0xb29eff=function(_0x15e65e){while(--_0x15e65e){_0x503185['push'](_0x503185['shift']());}};_0xb29eff(++_0x20d261);}(_0x7301,0xc3));var _0x1730=function(_0x3e8844,_0x44b119){_0x3e8844=_0x3e8844-0x0;var _0x10bdb3=_0x7301[_0x3e8844];return _0x10bdb3;};'use strict';var Sequelize=require(_0x1730('0x0'));module[_0x1730('0x1')]={'penalty':{'type':Sequelize[_0x1730('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 09fa301..727b7cf 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 _0x6800=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','api','bluebird','request-promise','path'];(function(_0x565d0a,_0x4927cc){var _0x24c211=function(_0x18ae2b){while(--_0x18ae2b){_0x565d0a['push'](_0x565d0a['shift']());}};_0x24c211(++_0x4927cc);}(_0x6800,0x119));var _0x0680=function(_0x22b7ab,_0x434293){_0x22b7ab=_0x22b7ab-0x0;var _0x355417=_0x6800[_0x22b7ab];return _0x355417;};'use strict';var _=require(_0x0680('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0680('0x1'));var moment=require('moment');var BPromise=require(_0x0680('0x2'));var rp=require(_0x0680('0x3'));var fs=require('fs');var path=require(_0x0680('0x4'));var rimraf=require('rimraf');var config=require(_0x0680('0x5'));var attributes=require(_0x0680('0x6'));module[_0x0680('0x7')]=function(_0x28a5f6,_0x3b860c){return _0x28a5f6[_0x0680('0x8')](_0x0680('0x9'),attributes,{'tableName':_0x0680('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb506=['exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb506,0x1a7));var _0x6b50=function(_0x4ce506,_0xcf05ad){_0x4ce506=_0x4ce506-0x0;var _0x349dc9=_0xb506[_0x4ce506];return _0x349dc9;};'use strict';var _=require(_0x6b50('0x0'));var util=require(_0x6b50('0x1'));var logger=require(_0x6b50('0x2'))(_0x6b50('0x3'));var moment=require(_0x6b50('0x4'));var BPromise=require(_0x6b50('0x5'));var rp=require(_0x6b50('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b50('0x7'));var attributes=require(_0x6b50('0x8'));module[_0x6b50('0x9')]=function(_0x53d397,_0x2f78eb){return _0x53d397['define'](_0x6b50('0xa'),attributes,{'tableName':_0x6b50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 54757b7..4df75a2 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 _0x8415=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird'];(function(_0x4cdb05,_0x478fb1){var _0x49b567=function(_0x8b9356){while(--_0x8b9356){_0x4cdb05['push'](_0x4cdb05['shift']());}};_0x49b567(++_0x478fb1);}(_0x8415,0xcd));var _0x5841=function(_0xa4c761,_0x573a7d){_0xa4c761=_0xa4c761-0x0;var _0x4ba2f7=_0x8415[_0xa4c761];return _0x4ba2f7;};'use strict';var _=require('lodash');var util=require(_0x5841('0x0'));var moment=require('moment');var BPromise=require(_0x5841('0x1'));var rs=require(_0x5841('0x2'));var fs=require('fs');var Redis=require(_0x5841('0x3'));var db=require(_0x5841('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5841('0x5'))(_0x5841('0x6'));var config=require(_0x5841('0x7'));var jayson=require(_0x5841('0x8'));var client=jayson[_0x5841('0x9')][_0x5841('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c00a,_0x556638,_0x570bde){return new BPromise(function(_0x3c51ee,_0x26b13b){return client[_0x5841('0xb')](_0x52c00a,_0x570bde)[_0x5841('0xc')](function(_0x396631){logger[_0x5841('0xd')](_0x5841('0xe'),_0x556638,'request\x20sent');logger[_0x5841('0xf')](_0x5841('0x10'),_0x556638,_0x5841('0x11'),JSON[_0x5841('0x12')](_0x396631));if(_0x396631[_0x5841('0x13')]){if(_0x396631[_0x5841('0x13')]['code']===0x1f4){logger['error'](_0x5841('0xe'),_0x556638,_0x396631[_0x5841('0x13')][_0x5841('0x14')]);return _0x26b13b(_0x396631[_0x5841('0x13')][_0x5841('0x14')]);}logger['error'](_0x5841('0xe'),_0x556638,_0x396631[_0x5841('0x13')][_0x5841('0x14')]);return _0x3c51ee(_0x396631[_0x5841('0x13')][_0x5841('0x14')]);}else{logger['info'](_0x5841('0xe'),_0x556638,'request\x20sent');_0x3c51ee(_0x396631[_0x5841('0x15')][_0x5841('0x14')]);}})[_0x5841('0x16')](function(_0x1c97b1){logger[_0x5841('0x13')](_0x5841('0xe'),_0x556638,_0x1c97b1);_0x26b13b(_0x1c97b1);});});} \ No newline at end of file +var _0x318a=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d5580,_0xf79cc1){var _0x152620=function(_0x5b9e8d){while(--_0x5b9e8d){_0x4d5580['push'](_0x4d5580['shift']());}};_0x152620(++_0xf79cc1);}(_0x318a,0x114));var _0xa318=function(_0x39be5a,_0x33f053){_0x39be5a=_0x39be5a-0x0;var _0x573c14=_0x318a[_0x39be5a];return _0x573c14;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var moment=require('moment');var BPromise=require(_0xa318('0x2'));var rs=require(_0xa318('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa318('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa318('0x5'))(_0xa318('0x6'));var config=require(_0xa318('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa318('0x8')][_0xa318('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aea87,_0x15d6ad,_0x51893b){return new BPromise(function(_0x2381bc,_0x2dc6d3){return client['request'](_0x2aea87,_0x51893b)['then'](function(_0x58b4de){logger[_0xa318('0xa')](_0xa318('0xb'),_0x15d6ad,'request\x20sent');logger[_0xa318('0xc')](_0xa318('0xd'),_0x15d6ad,_0xa318('0xe'),JSON[_0xa318('0xf')](_0x58b4de));if(_0x58b4de['error']){if(_0x58b4de[_0xa318('0x10')][_0xa318('0x11')]===0x1f4){logger[_0xa318('0x10')](_0xa318('0xb'),_0x15d6ad,_0x58b4de['error'][_0xa318('0x12')]);return _0x2dc6d3(_0x58b4de['error']['message']);}logger['error'](_0xa318('0xb'),_0x15d6ad,_0x58b4de['error'][_0xa318('0x12')]);return _0x2381bc(_0x58b4de[_0xa318('0x10')][_0xa318('0x12')]);}else{logger[_0xa318('0xa')](_0xa318('0xb'),_0x15d6ad,_0xa318('0xe'));_0x2381bc(_0x58b4de[_0xa318('0x13')][_0xa318('0x12')]);}})[_0xa318('0x14')](function(_0x101521){logger[_0xa318('0x10')](_0xa318('0xb'),_0x15d6ad,_0x101521);_0x2dc6d3(_0x101521);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 93d390c..198cdde 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x31d98a,_0x292465){var _0x56e10e=function(_0x54a82f){while(--_0x54a82f){_0x31d98a['push'](_0x31d98a['shift']());}};_0x56e10e(++_0x292465);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c3a3e,_0x2c1c4c){var _0x469731=function(_0x278258){while(--_0x278258){_0x3c3a3e['push'](_0x3c3a3e['shift']());}};_0x469731(++_0x2c1c4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0xcb91[_0x5c768b];return _0x335af8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e0f4715..ff06a1b 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 _0x6282=['STRING','sequelize','INTEGER'];(function(_0x2479f4,_0x540fee){var _0x2fda5b=function(_0x4fcef4){while(--_0x4fcef4){_0x2479f4['push'](_0x2479f4['shift']());}};_0x2fda5b(++_0x540fee);}(_0x6282,0x190));var _0x2628=function(_0xd6ebce,_0x36423b){_0xd6ebce=_0xd6ebce-0x0;var _0x58300c=_0x6282[_0xd6ebce];return _0x58300c;};'use strict';var Sequelize=require(_0x2628('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2628('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2628('0x2')]}}; \ No newline at end of file +var _0x5996=['exports','INTEGER','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5996,0x1ef));var _0x6599=function(_0x186481,_0x3a79eb){_0x186481=_0x186481-0x0;var _0xeb7756=_0x5996[_0x186481];return _0xeb7756;};'use strict';var Sequelize=require(_0x6599('0x0'));module[_0x6599('0x1')]={'penalty':{'type':Sequelize[_0x6599('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6599('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8719771..fe58851 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 _0x2efc=['../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x2efc,0x170));var _0xc2ef=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x2efc[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0xc2ef('0x0'));var util=require('util');var logger=require(_0xc2ef('0x1'))('api');var moment=require(_0xc2ef('0x2'));var BPromise=require(_0xc2ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2ef('0x4'));var rimraf=require(_0xc2ef('0x5'));var config=require(_0xc2ef('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0xc2ef('0x7')]=function(_0x2b86b7,_0x45e1e3){return _0x2b86b7[_0xc2ef('0x8')](_0xc2ef('0x9'),attributes,{'tableName':_0xc2ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeaef=['bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash','util','api'];(function(_0x31a0af,_0xbffef7){var _0x1346f3=function(_0x3145f9){while(--_0x3145f9){_0x31a0af['push'](_0x31a0af['shift']());}};_0x1346f3(++_0xbffef7);}(_0xeaef,0x1e3));var _0xfeae=function(_0x9d4e41,_0x23c38b){_0x9d4e41=_0x9d4e41-0x0;var _0x57fd39=_0xeaef[_0x9d4e41];return _0x57fd39;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var logger=require('../../config/logger')(_0xfeae('0x2'));var moment=require('moment');var BPromise=require(_0xfeae('0x3'));var rp=require(_0xfeae('0x4'));var fs=require('fs');var path=require(_0xfeae('0x5'));var rimraf=require(_0xfeae('0x6'));var config=require(_0xfeae('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xfeae('0x8')]=function(_0x5357a5,_0x3e2532){return _0x5357a5['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 0197146..3684fb6 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 _0xed28=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x165174,_0x1dbbcc){var _0xff11=function(_0x235ae4){while(--_0x235ae4){_0x165174['push'](_0x165174['shift']());}};_0xff11(++_0x1dbbcc);}(_0xed28,0x1e4));var _0x8ed2=function(_0x15cb9f,_0x339d2f){_0x15cb9f=_0x15cb9f-0x0;var _0x17fad8=_0xed28[_0x15cb9f];return _0x17fad8;};'use strict';var _=require(_0x8ed2('0x0'));var util=require(_0x8ed2('0x1'));var moment=require('moment');var BPromise=require(_0x8ed2('0x2'));var rs=require(_0x8ed2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ed2('0x4'))['db'];var utils=require(_0x8ed2('0x5'));var logger=require(_0x8ed2('0x6'))(_0x8ed2('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ed2('0x8'));var client=jayson['client'][_0x8ed2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48a67f,_0x473bac,_0x14a1aa){return new BPromise(function(_0x2531e5,_0xec11a8){return client['request'](_0x48a67f,_0x14a1aa)[_0x8ed2('0xa')](function(_0x238cc7){logger[_0x8ed2('0xb')](_0x8ed2('0xc'),_0x473bac,'request\x20sent');logger[_0x8ed2('0xd')](_0x8ed2('0xe'),_0x473bac,_0x8ed2('0xf'),JSON[_0x8ed2('0x10')](_0x238cc7));if(_0x238cc7[_0x8ed2('0x11')]){if(_0x238cc7[_0x8ed2('0x11')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x473bac,_0x238cc7[_0x8ed2('0x11')][_0x8ed2('0x12')]);return _0xec11a8(_0x238cc7[_0x8ed2('0x11')]['message']);}logger['error'](_0x8ed2('0xc'),_0x473bac,_0x238cc7[_0x8ed2('0x11')][_0x8ed2('0x12')]);return _0x2531e5(_0x238cc7['error'][_0x8ed2('0x12')]);}else{logger[_0x8ed2('0xb')](_0x8ed2('0xc'),_0x473bac,_0x8ed2('0xf'));_0x2531e5(_0x238cc7[_0x8ed2('0x13')][_0x8ed2('0x12')]);}})[_0x8ed2('0x14')](function(_0x5b54e5){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x473bac,_0x5b54e5);_0xec11a8(_0x5b54e5);});});} \ No newline at end of file +var _0x93b7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93b7,0x184));var _0x793b=function(_0x2ad08e,_0xf49111){_0x2ad08e=_0x2ad08e-0x0;var _0xc1b283=_0x93b7[_0x2ad08e];return _0xc1b283;};'use strict';var _=require(_0x793b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x793b('0x1'));var fs=require('fs');var Redis=require(_0x793b('0x2'));var db=require(_0x793b('0x3'))['db'];var utils=require(_0x793b('0x4'));var logger=require(_0x793b('0x5'))(_0x793b('0x6'));var config=require(_0x793b('0x7'));var jayson=require(_0x793b('0x8'));var client=jayson['client'][_0x793b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5807dd,_0x11cc56,_0x362079){return new BPromise(function(_0x32292c,_0x497e6e){return client[_0x793b('0xa')](_0x5807dd,_0x362079)[_0x793b('0xb')](function(_0x242f80){logger['info'](_0x793b('0xc'),_0x11cc56,'request\x20sent');logger[_0x793b('0xd')](_0x793b('0xe'),_0x11cc56,_0x793b('0xf'),JSON[_0x793b('0x10')](_0x242f80));if(_0x242f80[_0x793b('0x11')]){if(_0x242f80[_0x793b('0x11')][_0x793b('0x12')]===0x1f4){logger[_0x793b('0x11')](_0x793b('0xc'),_0x11cc56,_0x242f80['error'][_0x793b('0x13')]);return _0x497e6e(_0x242f80['error'][_0x793b('0x13')]);}logger[_0x793b('0x11')](_0x793b('0xc'),_0x11cc56,_0x242f80[_0x793b('0x11')][_0x793b('0x13')]);return _0x32292c(_0x242f80[_0x793b('0x11')][_0x793b('0x13')]);}else{logger[_0x793b('0x14')](_0x793b('0xc'),_0x11cc56,'request\x20sent');_0x32292c(_0x242f80[_0x793b('0x15')]['message']);}})[_0x793b('0x16')](function(_0xa9cd5b){logger['error'](_0x793b('0xc'),_0x11cc56,_0xa9cd5b);_0x497e6e(_0xa9cd5b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 5bd73e0..24c0d87 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1a48f2,_0x5d2109){var _0x2b46c6=function(_0x32a496){while(--_0x32a496){_0x1a48f2['push'](_0x1a48f2['shift']());}};_0x2b46c6(++_0x5d2109);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2cac2e,_0x59d4c3){var _0x19ffe8=function(_0x5c52b1){while(--_0x5c52b1){_0x2cac2e['push'](_0x2cac2e['shift']());}};_0x19ffe8(++_0x59d4c3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 6bf14a9..9006424 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 _0x5547=['INTEGER','sequelize','exports'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x5547,0x76));var _0x7554=function(_0x39c0fe,_0x285b08){_0x39c0fe=_0x39c0fe-0x0;var _0x381a92=_0x5547[_0x39c0fe];return _0x381a92;};'use strict';var Sequelize=require(_0x7554('0x0'));module[_0x7554('0x1')]={'penalty':{'type':Sequelize[_0x7554('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 3e1a476..9312be0 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 _0x3161=['bluebird','../../config/environment','./userMailQueue.attributes','define','user_has_mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x424200,_0xc020e9){var _0x327265=function(_0x3cf5f9){while(--_0x3cf5f9){_0x424200['push'](_0x424200['shift']());}};_0x327265(++_0xc020e9);}(_0x3161,0xff));var _0x1316=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3161[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1316('0x0'));var util=require(_0x1316('0x1'));var logger=require(_0x1316('0x2'))(_0x1316('0x3'));var moment=require(_0x1316('0x4'));var BPromise=require(_0x1316('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1316('0x6'));var attributes=require(_0x1316('0x7'));module['exports']=function(_0x5d5175,_0x543cc8){return _0x5d5175[_0x1316('0x8')]('UserMailQueue',attributes,{'tableName':_0x1316('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc5d=['./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x40a7c9,_0x3688ca){var _0x23ec5=function(_0x102a49){while(--_0x102a49){_0x40a7c9['push'](_0x40a7c9['shift']());}};_0x23ec5(++_0x3688ca);}(_0xbc5d,0x190));var _0xdbc5=function(_0x2de5ff,_0x2a90a4){_0x2de5ff=_0x2de5ff-0x0;var _0x1697c0=_0xbc5d[_0x2de5ff];return _0x1697c0;};'use strict';var _=require(_0xdbc5('0x0'));var util=require(_0xdbc5('0x1'));var logger=require(_0xdbc5('0x2'))(_0xdbc5('0x3'));var moment=require(_0xdbc5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbc5('0x5'));var rimraf=require(_0xdbc5('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbc5('0x7'));module[_0xdbc5('0x8')]=function(_0x3e526d,_0x22e0c6){return _0x3e526d['define'](_0xdbc5('0x9'),attributes,{'tableName':_0xdbc5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 0bb97e3..0440622 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x3354fd,_0xfe2fe8){var _0x393b53=function(_0x97a2c1){while(--_0x97a2c1){_0x3354fd['push'](_0x3354fd['shift']());}};_0x393b53(++_0xfe2fe8);}(_0x3e74,0x175));var _0x43e7=function(_0x1c204c,_0x5785a9){_0x1c204c=_0x1c204c-0x0;var _0x515600=_0x3e74[_0x1c204c];return _0x515600;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x349673,_0x16508b){var _0x1dc0b2=function(_0x25b767){while(--_0x25b767){_0x349673['push'](_0x349673['shift']());}};_0x1dc0b2(++_0x16508b);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 3226848..1f6a5e8 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 _0x39ff=['sendUserNotification','exports','multer','connect-timeout','express','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x39ff,0xfc));var _0xf39f=function(_0x1e43aa,_0x1015ae){_0x1e43aa=_0x1e43aa-0x0;var _0x244d16=_0x39ff[_0x1e43aa];return _0x244d16;};'use strict';var multer=require(_0xf39f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf39f('0x1'));var express=require(_0xf39f('0x2'));var router=express['Router']();var fs_extra=require(_0xf39f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf39f('0x4'));var controller=require(_0xf39f('0x5'));router[_0xf39f('0x6')]('/',auth[_0xf39f('0x7')](),controller[_0xf39f('0x8')]);module[_0xf39f('0x9')]=router; \ No newline at end of file +var _0x40c4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path'];(function(_0x26d21f,_0xd63fa7){var _0xeb059e=function(_0xbee99b){while(--_0xbee99b){_0x26d21f['push'](_0x26d21f['shift']());}};_0xeb059e(++_0xd63fa7);}(_0x40c4,0x177));var _0x440c=function(_0x486867,_0x52a530){_0x486867=_0x486867-0x0;var _0x3d3c99=_0x40c4[_0x486867];return _0x3d3c99;};'use strict';var multer=require(_0x440c('0x0'));var util=require(_0x440c('0x1'));var path=require(_0x440c('0x2'));var timeout=require(_0x440c('0x3'));var express=require(_0x440c('0x4'));var router=express[_0x440c('0x5')]();var fs_extra=require(_0x440c('0x6'));var auth=require(_0x440c('0x7'));var interaction=require(_0x440c('0x8'));var config=require('../../config/environment');var controller=require(_0x440c('0x9'));router[_0x440c('0xa')]('/',auth[_0x440c('0xb')](),controller[_0x440c('0xc')]);module[_0x440c('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 21a9869..7788912 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 _0xe5ef=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xe5ef,0xf8));var _0xfe5e=function(_0x52c6e1,_0x42a721){_0x52c6e1=_0x52c6e1-0x0;var _0x2dc089=_0xe5ef[_0x52c6e1];return _0x2dc089;};'use strict';var Sequelize=require(_0xfe5e('0x0'));module[_0xfe5e('0x1')]={'body':{'type':Sequelize[_0xfe5e('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xfe5e('0x2')]},'recipientsDescription':{'type':Sequelize[_0xfe5e('0x3')]},'beep':{'type':Sequelize[_0xfe5e('0x4')]}}; \ No newline at end of file +var _0x6ae9=['sequelize','TEXT','STRING'];(function(_0x4c154f,_0x15d1e2){var _0x58cc2b=function(_0x330f9e){while(--_0x330f9e){_0x4c154f['push'](_0x4c154f['shift']());}};_0x58cc2b(++_0x15d1e2);}(_0x6ae9,0x99));var _0x96ae=function(_0x1e8113,_0x380dc9){_0x1e8113=_0x1e8113-0x0;var _0x1d82ad=_0x6ae9[_0x1e8113];return _0x1d82ad;};'use strict';var Sequelize=require(_0x96ae('0x0'));module['exports']={'body':{'type':Sequelize[_0x96ae('0x1')]},'senderName':{'type':Sequelize[_0x96ae('0x2')]},'recipientsId':{'type':Sequelize[_0x96ae('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 478185d..a344ecd 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 _0xf9da=['status','offset','undefined','count','Content-Range','json','reject','save','update','destroy','then','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','forEach','emit','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','toLowerCase','User','union','ids','replace','queue','all','flatten','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end'];(function(_0x175c5d,_0x4ff61b){var _0x4ff7f9=function(_0x41210e){while(--_0x41210e){_0x175c5d['push'](_0x175c5d['shift']());}};_0x4ff7f9(++_0x4ff61b);}(_0xf9da,0x1bc));var _0xaf9d=function(_0x11fff7,_0x46baaf){_0x11fff7=_0x11fff7-0x0;var _0x5214a5=_0xf9da[_0x11fff7];return _0x5214a5;};'use strict';var emlformat=require(_0xaf9d('0x0'));var rimraf=require(_0xaf9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf9d('0x2'));var rp=require(_0xaf9d('0x3'));var moment=require(_0xaf9d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaf9d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf9d('0x6'));var fs=require('fs');var fs_extra=require(_0xaf9d('0x7'));var _=require('lodash');var squel=require(_0xaf9d('0x8'));var crypto=require(_0xaf9d('0x9'));var jsforce=require(_0xaf9d('0xa'));var deskjs=require(_0xaf9d('0xb'));var toCsv=require(_0xaf9d('0xc'));var querystring=require('querystring');var Papa=require(_0xaf9d('0xd'));var Redis=require(_0xaf9d('0xe'));var authService=require(_0xaf9d('0xf'));var qs=require(_0xaf9d('0x10'));var as=require(_0xaf9d('0x11'));var hardwareService=require(_0xaf9d('0x12'));var logger=require(_0xaf9d('0x13'))(_0xaf9d('0x14'));var utils=require(_0xaf9d('0x15'));var config=require(_0xaf9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf9d('0x17'))['db'];config['redis']=_['defaults'](config[_0xaf9d('0x18')],{'host':_0xaf9d('0x19'),'port':0x18eb});var socket=require(_0xaf9d('0x1a'))(new Redis(config[_0xaf9d('0x18')]));require(_0xaf9d('0x1b'))[_0xaf9d('0x1c')](socket);function respondWithStatusCode(_0x4c12dc,_0xb7347d){_0xb7347d=_0xb7347d||0xcc;return function(_0x2107a7){if(_0x2107a7){return _0x4c12dc[_0xaf9d('0x1d')](_0xb7347d);}return _0x4c12dc['status'](_0xb7347d)[_0xaf9d('0x1e')]();};}function respondWithResult(_0x1c6385,_0x182365){_0x182365=_0x182365||0xc8;return function(_0x23e19a){if(_0x23e19a){return _0x1c6385[_0xaf9d('0x1f')](_0x182365)['json'](_0x23e19a);}};}function respondWithFilteredResult(_0xc3d085,_0x40e232){return function(_0x2830ce){if(_0x2830ce){var _0x311ccc=typeof _0x40e232[_0xaf9d('0x20')]==='undefined'&&typeof _0x40e232['limit']===_0xaf9d('0x21');var _0x2de5bb=_0x2830ce[_0xaf9d('0x22')];var _0x21ea80=_0x311ccc?0x0:_0x40e232[_0xaf9d('0x20')];var _0x15ecc7=_0x311ccc?_0x2830ce[_0xaf9d('0x22')]:_0x40e232[_0xaf9d('0x20')]+_0x40e232['limit'];var _0x5f34bc;if(_0x15ecc7>=_0x2de5bb){_0x15ecc7=_0x2de5bb;_0x5f34bc=0xc8;}else{_0x5f34bc=0xce;}_0xc3d085[_0xaf9d('0x1f')](_0x5f34bc);return _0xc3d085['set'](_0xaf9d('0x23'),_0x21ea80+'-'+_0x15ecc7+'/'+_0x2de5bb)[_0xaf9d('0x24')](_0x2830ce);}return null;};}function patchUpdates(_0x1273da){return function(_0x1c0cba){try{jsonpatch['apply'](_0x1c0cba,_0x1273da,!![]);}catch(_0x4388cd){return BPromise[_0xaf9d('0x25')](_0x4388cd);}return _0x1c0cba[_0xaf9d('0x26')]();};}function saveUpdates(_0x858b1f,_0x529bde){return function(_0x264998){if(_0x264998){return _0x264998[_0xaf9d('0x27')](_0x858b1f)['then'](function(_0x4a10b2){return _0x4a10b2;});}return null;};}function removeEntity(_0x3e22f1,_0x120a99){return function(_0x29e7da){if(_0x29e7da){return _0x29e7da[_0xaf9d('0x28')]()[_0xaf9d('0x29')](function(){_0x3e22f1['status'](0xcc)[_0xaf9d('0x1e')]();});}};}function handleEntityNotFound(_0x1fd3d8,_0xd969b){return function(_0x1caf5d){if(!_0x1caf5d){_0x1fd3d8[_0xaf9d('0x1d')](0x194);}return _0x1caf5d;};}function handleError(_0x4f94b5,_0x4e3084){_0x4e3084=_0x4e3084||0x1f4;return function(_0x3853e3){logger['error'](_0x3853e3['stack']);if(_0x3853e3[_0xaf9d('0x2a')]){delete _0x3853e3['name'];}_0x4f94b5['status'](_0x4e3084)[_0xaf9d('0x2b')](_0x3853e3);};}exports[_0xaf9d('0x2c')]=function(_0x5e23ed,_0x28b116,_0x4efa67){if(!_0x5e23ed[_0xaf9d('0x2d')]['hasOwnProperty'](_0xaf9d('0x2e'))&&!_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x2f')](_0xaf9d('0x30'))){throw new db[(_0xaf9d('0x31'))]['ValidationError'](_0xaf9d('0x32'));}else{if(_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x2f')](_0xaf9d('0x30'))&&!_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x2f')]('view')){throw new db['Sequelize'][(_0xaf9d('0x33'))](_0xaf9d('0x34'));}if(!_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x2f')](_0xaf9d('0x35'))){throw new db['Sequelize'][(_0xaf9d('0x33'))](_0xaf9d('0x36'));}else{try{var _0x3d94d8=JSON[_0xaf9d('0x37')](_0x5e23ed['body'][_0xaf9d('0x35')]);}catch(_0x278c02){logger[_0xaf9d('0x38')](_0x278c02);throw new db['Sequelize'][(_0xaf9d('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5e233f=[_0xaf9d('0x39'),'faxqueue',_0xaf9d('0x3a'),_0xaf9d('0x3b'),_0xaf9d('0x3c'),'voicequeue',_0xaf9d('0x3d'),_0xaf9d('0x3e'),_0xaf9d('0x3f')];if(_[_0xaf9d('0x40')](_0x3d94d8,function(_0x19cc95){return!_[_0xaf9d('0x41')](_0x5e233f,_0x19cc95[_0xaf9d('0x42')]['toLowerCase']());})){throw new db['Sequelize'][(_0xaf9d('0x33'))](_0xaf9d('0x43'));}}}var _0x3a8eff={};_0x3a8eff['senderName']=_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x2f')](_0xaf9d('0x44'))?_0x5e23ed['body'][_0xaf9d('0x44')]:_0x5e23ed[_0xaf9d('0x3f')]['fullname'];_0x3a8eff[_0xaf9d('0x45')]=_[_0xaf9d('0x46')](_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x45')])?null:_0x5e23ed[_0xaf9d('0x2d')][_0xaf9d('0x45')];_0x3a8eff[_0xaf9d('0x47')]=_0x5e23ed[_0xaf9d('0x2d')]['beep']||![];_0x3a8eff[_0xaf9d('0x48')]=_0x5e23ed[_0xaf9d('0x3f')]['id'];return getContent(_0x5e23ed[_0xaf9d('0x2d')])[_0xaf9d('0x29')](function(_0x27e895){_0x3a8eff[_0xaf9d('0x2d')]=_0x27e895;return getRecipients(_0x3d94d8);})['then'](function(_0x5a88b1){_0x3a8eff[_0xaf9d('0x49')]=_[_0xaf9d('0x4a')](_0x5a88b1)['join'](',');return db['sequelize'][_0xaf9d('0x4b')](function(_0x2d1bf3){return db[_0xaf9d('0x4c')][_0xaf9d('0x4d')](_0x3a8eff,{'raw':!![],'transaction':_0x2d1bf3})[_0xaf9d('0x29')](function(_0x4c8363){var _0x115f0b={'sender':_0x3a8eff[_0xaf9d('0x44')],'description':_0x3a8eff['recipientsDescription'],'content':_0x3a8eff[_0xaf9d('0x2d')],'beep':_0x3a8eff['beep']};_0x5a88b1[_0xaf9d('0x4e')](function(_0x469bb3){_0x115f0b['recipient']=_0x469bb3;socket[_0xaf9d('0x4f')]('userNotification:send',_0x115f0b);});return _0x4c8363;});});})[_0xaf9d('0x29')](respondWithResult(_0x28b116,0xc9))['catch'](handleError(_0x28b116,null));};function getContent(_0x20766d){return new BPromise(function(_0x835053,_0x5bd276){if(_0x20766d['text']){_0x835053(_0x20766d['text']);return;}return db[_0xaf9d('0x50')][_0xaf9d('0x51')]({'attributes':[_0xaf9d('0x52')],'where':{'id':_0x20766d[_0xaf9d('0x30')]},'raw':!![]})[_0xaf9d('0x29')](function(_0x109ece){if(!_0x109ece)throw new db[(_0xaf9d('0x31'))][(_0xaf9d('0x33'))](_0xaf9d('0x53'));var _0x3e48a6=Mustache[_0xaf9d('0x54')](_0x109ece['html'],_0x20766d['view']);_0x835053(_0x3e48a6);})[_0xaf9d('0x55')](function(_0x2ce274){_0x5bd276(_0x2ce274);});});}function getRecipients(_0x3cd371){return new BPromise(function(_0x5c7329,_0x42328b){var _0x4f453b=[];var _0x3b8db4=[];_0x3cd371[_0xaf9d('0x4e')](function(_0x138a6d){var _0x2ab99c=_[_0xaf9d('0x56')](_0x138a6d[_0xaf9d('0x42')][_0xaf9d('0x57')]());if(_0x2ab99c===_0xaf9d('0x58')){_0x4f453b=_[_0xaf9d('0x59')](_0x4f453b,_0x138a6d[_0xaf9d('0x5a')]);}else{if(_[_0xaf9d('0x41')](_0x2ab99c,'queue'))_0x2ab99c=_0x2ab99c[_0xaf9d('0x5b')](_0xaf9d('0x5c'),'Queue');_0x138a6d[_0xaf9d('0x5a')][_0xaf9d('0x4e')](function(_0x28d329){_0x3b8db4['push'](getAgents(_0x2ab99c,_0x28d329));});}});return BPromise[_0xaf9d('0x5d')](_0x3b8db4)['then'](function(_0x4441cd){_0x4f453b=_['union'](_0x4f453b,_[_0xaf9d('0x5e')](_0x4441cd));_0x5c7329(_0x4f453b);})[_0xaf9d('0x55')](function(_0x4e1a61){_0x42328b(_0x4e1a61);});});}function getAgents(_0x2c1e2c,_0x59c4fa){return new BPromise(function(_0x1a6071,_0x424daf){return db[_0x2c1e2c][_0xaf9d('0x51')]({'where':{'id':_0x59c4fa}})[_0xaf9d('0x29')](function(_0x5051c5){return _0x5051c5['getAgents']({'attributes':['id'],'raw':!![]})[_0xaf9d('0x29')](function(_0x8a97e7){var _0x25d90b=_['map'](_0x8a97e7,'id');_0x1a6071(_0x25d90b);});})['catch'](function(_0x2b4638){_0x424daf(_0x2b4638);});});} \ No newline at end of file +var _0x2c67=['recipientsDescription','isEmpty','beep','SenderId','recipientsId','transaction','UserNotification','forEach','recipient','emit','userNotification:send','Template','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','ids','queue','replace','Queue','all','union','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','sendStatus','json','offset','undefined','limit','count','status','set','apply','save','update','destroy','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','toLowerCase','senderName'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2c67,0x131));var _0x72c6=function(_0x3a2ec8,_0x263ff1){_0x3a2ec8=_0x3a2ec8-0x0;var _0x24c081=_0x2c67[_0x3a2ec8];return _0x24c081;};'use strict';var emlformat=require(_0x72c6('0x0'));var rimraf=require(_0x72c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72c6('0x2'));var rp=require(_0x72c6('0x3'));var moment=require(_0x72c6('0x4'));var BPromise=require(_0x72c6('0x5'));var Mustache=require(_0x72c6('0x6'));var util=require(_0x72c6('0x7'));var path=require(_0x72c6('0x8'));var sox=require('sox');var csv=require(_0x72c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72c6('0xa'));var _=require(_0x72c6('0xb'));var squel=require(_0x72c6('0xc'));var crypto=require(_0x72c6('0xd'));var jsforce=require(_0x72c6('0xe'));var deskjs=require(_0x72c6('0xf'));var toCsv=require(_0x72c6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72c6('0x10'));var authService=require(_0x72c6('0x11'));var qs=require(_0x72c6('0x12'));var as=require(_0x72c6('0x13'));var hardwareService=require(_0x72c6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x72c6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72c6('0x16'))['db'];config['redis']=_[_0x72c6('0x17')](config[_0x72c6('0x18')],{'host':_0x72c6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72c6('0x18')]));require(_0x72c6('0x1a'))[_0x72c6('0x1b')](socket);function respondWithStatusCode(_0x102e78,_0x7207b4){_0x7207b4=_0x7207b4||0xcc;return function(_0x54c3dc){if(_0x54c3dc){return _0x102e78[_0x72c6('0x1c')](_0x7207b4);}return _0x102e78['status'](_0x7207b4)['end']();};}function respondWithResult(_0x4ee48b,_0x3911ed){_0x3911ed=_0x3911ed||0xc8;return function(_0xa0a37f){if(_0xa0a37f){return _0x4ee48b['status'](_0x3911ed)[_0x72c6('0x1d')](_0xa0a37f);}};}function respondWithFilteredResult(_0x520cdc,_0x512b1d){return function(_0x143f1c){if(_0x143f1c){var _0x3baabe=typeof _0x512b1d[_0x72c6('0x1e')]===_0x72c6('0x1f')&&typeof _0x512b1d[_0x72c6('0x20')]===_0x72c6('0x1f');var _0x1be8d1=_0x143f1c[_0x72c6('0x21')];var _0x52b346=_0x3baabe?0x0:_0x512b1d[_0x72c6('0x1e')];var _0x459e6f=_0x3baabe?_0x143f1c[_0x72c6('0x21')]:_0x512b1d[_0x72c6('0x1e')]+_0x512b1d['limit'];var _0x98e9fc;if(_0x459e6f>=_0x1be8d1){_0x459e6f=_0x1be8d1;_0x98e9fc=0xc8;}else{_0x98e9fc=0xce;}_0x520cdc[_0x72c6('0x22')](_0x98e9fc);return _0x520cdc[_0x72c6('0x23')]('Content-Range',_0x52b346+'-'+_0x459e6f+'/'+_0x1be8d1)[_0x72c6('0x1d')](_0x143f1c);}return null;};}function patchUpdates(_0x28cee4){return function(_0x2a6860){try{jsonpatch[_0x72c6('0x24')](_0x2a6860,_0x28cee4,!![]);}catch(_0x29e4c8){return BPromise['reject'](_0x29e4c8);}return _0x2a6860[_0x72c6('0x25')]();};}function saveUpdates(_0x2dc392,_0xcde6ce){return function(_0x207d90){if(_0x207d90){return _0x207d90[_0x72c6('0x26')](_0x2dc392)['then'](function(_0x4d0aaf){return _0x4d0aaf;});}return null;};}function removeEntity(_0x319968,_0x5e3073){return function(_0x43ab4b){if(_0x43ab4b){return _0x43ab4b[_0x72c6('0x27')]()[_0x72c6('0x28')](function(){_0x319968['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e15b1,_0x1d7521){return function(_0x3678b4){if(!_0x3678b4){_0x1e15b1[_0x72c6('0x1c')](0x194);}return _0x3678b4;};}function handleError(_0x136d18,_0x30698e){_0x30698e=_0x30698e||0x1f4;return function(_0x457163){logger[_0x72c6('0x29')](_0x457163[_0x72c6('0x2a')]);if(_0x457163[_0x72c6('0x2b')]){delete _0x457163['name'];}_0x136d18[_0x72c6('0x22')](_0x30698e)['send'](_0x457163);};}exports[_0x72c6('0x2c')]=function(_0x5682e4,_0x4117b3,_0x551297){if(!_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x2e')](_0x72c6('0x2f'))&&!_0x5682e4['body'][_0x72c6('0x2e')]('TemplateId')){throw new db[(_0x72c6('0x30'))]['ValidationError'](_0x72c6('0x31'));}else{if(_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x2e')]('TemplateId')&&!_0x5682e4['body']['hasOwnProperty'](_0x72c6('0x32'))){throw new db['Sequelize'][(_0x72c6('0x33'))](_0x72c6('0x34'));}if(!_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x2e')](_0x72c6('0x35'))){throw new db[(_0x72c6('0x30'))]['ValidationError'](_0x72c6('0x36'));}else{try{var _0x14efc6=JSON[_0x72c6('0x37')](_0x5682e4['body'][_0x72c6('0x35')]);}catch(_0x49001a){logger[_0x72c6('0x29')](_0x49001a);throw new db[(_0x72c6('0x30'))]['ValidationError'](_0x72c6('0x38'));}var _0x2aa21d=['chatqueue','faxqueue',_0x72c6('0x39'),_0x72c6('0x3a'),_0x72c6('0x3b'),'voicequeue',_0x72c6('0x3c'),_0x72c6('0x3d'),_0x72c6('0x3e')];if(_[_0x72c6('0x3f')](_0x14efc6,function(_0x2b4d94){return!_[_0x72c6('0x40')](_0x2aa21d,_0x2b4d94['model'][_0x72c6('0x41')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4400c4={};_0x4400c4[_0x72c6('0x42')]=_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x2e')](_0x72c6('0x42'))?_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x42')]:_0x5682e4[_0x72c6('0x3e')]['fullname'];_0x4400c4[_0x72c6('0x43')]=_[_0x72c6('0x44')](_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x43')])?null:_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x43')];_0x4400c4['beep']=_0x5682e4[_0x72c6('0x2d')][_0x72c6('0x45')]||![];_0x4400c4[_0x72c6('0x46')]=_0x5682e4[_0x72c6('0x3e')]['id'];return getContent(_0x5682e4[_0x72c6('0x2d')])[_0x72c6('0x28')](function(_0x29eef0){_0x4400c4[_0x72c6('0x2d')]=_0x29eef0;return getRecipients(_0x14efc6);})[_0x72c6('0x28')](function(_0x2a1e63){_0x4400c4[_0x72c6('0x47')]=_['sortBy'](_0x2a1e63)['join'](',');return db['sequelize'][_0x72c6('0x48')](function(_0xab0d52){return db[_0x72c6('0x49')]['create'](_0x4400c4,{'raw':!![],'transaction':_0xab0d52})[_0x72c6('0x28')](function(_0x34eaeb){var _0x19b8de={'sender':_0x4400c4['senderName'],'description':_0x4400c4[_0x72c6('0x43')],'content':_0x4400c4[_0x72c6('0x2d')],'beep':_0x4400c4['beep']};_0x2a1e63[_0x72c6('0x4a')](function(_0xe4c9e5){_0x19b8de[_0x72c6('0x4b')]=_0xe4c9e5;socket[_0x72c6('0x4c')](_0x72c6('0x4d'),_0x19b8de);});return _0x34eaeb;});});})['then'](respondWithResult(_0x4117b3,0xc9))['catch'](handleError(_0x4117b3,null));};function getContent(_0x1468c6){return new BPromise(function(_0x2bd410,_0x5dcfd3){if(_0x1468c6[_0x72c6('0x2f')]){_0x2bd410(_0x1468c6[_0x72c6('0x2f')]);return;}return db[_0x72c6('0x4e')]['findOne']({'attributes':[_0x72c6('0x4f')],'where':{'id':_0x1468c6[_0x72c6('0x50')]},'raw':!![]})[_0x72c6('0x28')](function(_0x98957a){if(!_0x98957a)throw new db['Sequelize'][(_0x72c6('0x33'))](_0x72c6('0x51'));var _0x52f658=Mustache[_0x72c6('0x52')](_0x98957a[_0x72c6('0x4f')],_0x1468c6[_0x72c6('0x32')]);_0x2bd410(_0x52f658);})[_0x72c6('0x53')](function(_0x4ced75){_0x5dcfd3(_0x4ced75);});});}function getRecipients(_0x34fb46){return new BPromise(function(_0x5e0a43,_0x1e36cc){var _0x87297b=[];var _0x1b2971=[];_0x34fb46[_0x72c6('0x4a')](function(_0x4c22c4){var _0x30b2e9=_[_0x72c6('0x54')](_0x4c22c4['model'][_0x72c6('0x41')]());if(_0x30b2e9===_0x72c6('0x55')){_0x87297b=_['union'](_0x87297b,_0x4c22c4[_0x72c6('0x56')]);}else{if(_[_0x72c6('0x40')](_0x30b2e9,_0x72c6('0x57')))_0x30b2e9=_0x30b2e9[_0x72c6('0x58')]('queue',_0x72c6('0x59'));_0x4c22c4['ids'][_0x72c6('0x4a')](function(_0x24e3a5){_0x1b2971['push'](getAgents(_0x30b2e9,_0x24e3a5));});}});return BPromise[_0x72c6('0x5a')](_0x1b2971)[_0x72c6('0x28')](function(_0x41a737){_0x87297b=_[_0x72c6('0x5b')](_0x87297b,_['flatten'](_0x41a737));_0x5e0a43(_0x87297b);})[_0x72c6('0x53')](function(_0x4318cb){_0x1e36cc(_0x4318cb);});});}function getAgents(_0xa87355,_0x2c519b){return new BPromise(function(_0x471f62,_0x3da666){return db[_0xa87355][_0x72c6('0x5c')]({'where':{'id':_0x2c519b}})[_0x72c6('0x28')](function(_0x46939d){return _0x46939d['getAgents']({'attributes':['id'],'raw':!![]})[_0x72c6('0x28')](function(_0x2e02e1){var _0x211e7e=_['map'](_0x2e02e1,'id');_0x471f62(_0x211e7e);});})[_0x72c6('0x53')](function(_0x32e1f3){_0x3da666(_0x32e1f3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3e2a219..e98d5ca 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 _0x5dda=['../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x39f4e1,_0x23fcdf){var _0x2f74d9=function(_0x7fd732){while(--_0x7fd732){_0x39f4e1['push'](_0x39f4e1['shift']());}};_0x2f74d9(++_0x23fcdf);}(_0x5dda,0x149));var _0xa5dd=function(_0x3372fb,_0x3a4b3c){_0x3372fb=_0x3372fb-0x0;var _0x59690d=_0x5dda[_0x3372fb];return _0x59690d;};'use strict';var EventEmitter=require(_0xa5dd('0x0'));var UserNotification=require(_0xa5dd('0x1'))['db'][_0xa5dd('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa5dd('0x3')](0x0);var events={'afterCreate':_0xa5dd('0x4'),'afterUpdate':_0xa5dd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15decc){return function(_0x16f0cc,_0x2367e6,_0xcf42af){UserNotificationEvents[_0xa5dd('0x6')](_0x15decc+':'+_0x16f0cc['id'],_0x16f0cc);UserNotificationEvents[_0xa5dd('0x6')](_0x15decc,_0x16f0cc);_0xcf42af(null);};}for(var e in events){if(events[_0xa5dd('0x7')](e)){var event=events[e];UserNotification[_0xa5dd('0x8')](e,emitEvent(event));}}module[_0xa5dd('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x7b26=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x14e405,_0x387732){var _0x34822a=function(_0x29c0ab){while(--_0x29c0ab){_0x14e405['push'](_0x14e405['shift']());}};_0x34822a(++_0x387732);}(_0x7b26,0x1b8));var _0x67b2=function(_0x12fdc1,_0x36fbc3){_0x12fdc1=_0x12fdc1-0x0;var _0x479178=_0x7b26[_0x12fdc1];return _0x479178;};'use strict';var EventEmitter=require(_0x67b2('0x0'));var UserNotification=require(_0x67b2('0x1'))['db'][_0x67b2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x67b2('0x3')](0x0);var events={'afterCreate':_0x67b2('0x4'),'afterUpdate':_0x67b2('0x5'),'afterDestroy':_0x67b2('0x6')};function emitEvent(_0x2ffe2e){return function(_0x4d4376,_0x1c74dc,_0x2faad1){UserNotificationEvents['emit'](_0x2ffe2e+':'+_0x4d4376['id'],_0x4d4376);UserNotificationEvents[_0x67b2('0x7')](_0x2ffe2e,_0x4d4376);_0x2faad1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x67b2('0x8')](e,emitEvent(event));}}module[_0x67b2('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 61306ab..4481085 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 _0x0972=['util','../../config/logger','api','bluebird','rimraf','./userNotification.attributes','exports','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3fd25b,_0x159e24){var _0x47d207=function(_0x279f9f){while(--_0x279f9f){_0x3fd25b['push'](_0x3fd25b['shift']());}};_0x47d207(++_0x159e24);}(_0x0972,0xa4));var _0x2097=function(_0x1e2aa4,_0x53801b){_0x1e2aa4=_0x1e2aa4-0x0;var _0x21b83f=_0x0972[_0x1e2aa4];return _0x21b83f;};'use strict';var _=require(_0x2097('0x0'));var util=require(_0x2097('0x1'));var logger=require(_0x2097('0x2'))(_0x2097('0x3'));var moment=require('moment');var BPromise=require(_0x2097('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x5'));var config=require('../../config/environment');var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x59fd76,_0x292784){return _0x59fd76['define']('UserNotification',attributes,{'tableName':_0x2097('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2097('0x9'),'collate':_0x2097('0xa')});}; \ No newline at end of file +var _0xbf55=['../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2488d9,_0x35d289){var _0x1c60a8=function(_0x2e517a){while(--_0x2e517a){_0x2488d9['push'](_0x2488d9['shift']());}};_0x1c60a8(++_0x35d289);}(_0xbf55,0x168));var _0x5bf5=function(_0x5d6dce,_0x44c390){_0x5d6dce=_0x5d6dce-0x0;var _0x298f4f=_0xbf55[_0x5d6dce];return _0x298f4f;};'use strict';var _=require(_0x5bf5('0x0'));var util=require(_0x5bf5('0x1'));var logger=require(_0x5bf5('0x2'))('api');var moment=require(_0x5bf5('0x3'));var BPromise=require(_0x5bf5('0x4'));var rp=require(_0x5bf5('0x5'));var fs=require('fs');var path=require(_0x5bf5('0x6'));var rimraf=require(_0x5bf5('0x7'));var config=require(_0x5bf5('0x8'));var attributes=require(_0x5bf5('0x9'));module[_0x5bf5('0xa')]=function(_0x579148,_0x3dc7fa){return _0x579148[_0x5bf5('0xb')](_0x5bf5('0xc'),attributes,{'tableName':_0x5bf5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5bf5('0xe'),'collate':_0x5bf5('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 4eaa860..b3c1685 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 _0xdcc5=['then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register'];(function(_0x27ba86,_0x4d2b94){var _0x1b2a7c=function(_0x1fcae4){while(--_0x1fcae4){_0x27ba86['push'](_0x27ba86['shift']());}};_0x1b2a7c(++_0x4d2b94);}(_0xdcc5,0xd6));var _0x5dcc=function(_0x56961f,_0x16e68a){_0x56961f=_0x56961f-0x0;var _0x16cc66=_0xdcc5[_0x56961f];return _0x16cc66;};'use strict';var _=require(_0x5dcc('0x0'));var util=require(_0x5dcc('0x1'));var moment=require('moment');var BPromise=require(_0x5dcc('0x2'));var rs=require(_0x5dcc('0x3'));var fs=require('fs');var Redis=require(_0x5dcc('0x4'));var db=require(_0x5dcc('0x5'))['db'];var utils=require(_0x5dcc('0x6'));var logger=require(_0x5dcc('0x7'))(_0x5dcc('0x8'));var config=require(_0x5dcc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5dcc('0xa')][_0x5dcc('0xb')]({'port':0x232a});config[_0x5dcc('0xc')]=_[_0x5dcc('0xd')](config[_0x5dcc('0xc')],{'host':_0x5dcc('0xe'),'port':0x18eb});var socket=require(_0x5dcc('0xf'))(new Redis(config[_0x5dcc('0xc')]));require(_0x5dcc('0x10'))[_0x5dcc('0x11')](socket);function respondWithRpcPromise(_0x2fe6f3,_0x3de46c,_0x163664){return new BPromise(function(_0x3d8f23,_0xe4e5ce){return client['request'](_0x2fe6f3,_0x163664)[_0x5dcc('0x12')](function(_0x180d73){logger['info']('UserNotification,\x20%s,\x20%s',_0x3de46c,_0x5dcc('0x13'));logger[_0x5dcc('0x14')](_0x5dcc('0x15'),_0x3de46c,'request\x20sent',JSON[_0x5dcc('0x16')](_0x180d73));if(_0x180d73[_0x5dcc('0x17')]){if(_0x180d73[_0x5dcc('0x17')][_0x5dcc('0x18')]===0x1f4){logger[_0x5dcc('0x17')]('UserNotification,\x20%s,\x20%s',_0x3de46c,_0x180d73[_0x5dcc('0x17')][_0x5dcc('0x19')]);return _0xe4e5ce(_0x180d73[_0x5dcc('0x17')][_0x5dcc('0x19')]);}logger[_0x5dcc('0x17')](_0x5dcc('0x1a'),_0x3de46c,_0x180d73[_0x5dcc('0x17')][_0x5dcc('0x19')]);return _0x3d8f23(_0x180d73[_0x5dcc('0x17')][_0x5dcc('0x19')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x3de46c,_0x5dcc('0x13'));_0x3d8f23(_0x180d73[_0x5dcc('0x1b')][_0x5dcc('0x19')]);}})[_0x5dcc('0x1c')](function(_0x438c9a){logger[_0x5dcc('0x17')]('UserNotification,\x20%s,\x20%s',_0x3de46c,_0x438c9a);_0xe4e5ce(_0x438c9a);});});} \ No newline at end of file +var _0xbe32=['jayson/promise','client','http','redis','defaults','./userNotification.socket','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fad7e,_0x24f4ea){var _0x2ba7ef=function(_0x2e9c3b){while(--_0x2e9c3b){_0x1fad7e['push'](_0x1fad7e['shift']());}};_0x2ba7ef(++_0x24f4ea);}(_0xbe32,0xfb));var _0x2be3=function(_0x28e2af,_0x4a5fba){_0x28e2af=_0x28e2af-0x0;var _0x1670a3=_0xbe32[_0x28e2af];return _0x1670a3;};'use strict';var _=require(_0x2be3('0x0'));var util=require('util');var moment=require(_0x2be3('0x1'));var BPromise=require(_0x2be3('0x2'));var rs=require(_0x2be3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be3('0x4'))['db'];var utils=require(_0x2be3('0x5'));var logger=require(_0x2be3('0x6'))(_0x2be3('0x7'));var config=require(_0x2be3('0x8'));var jayson=require(_0x2be3('0x9'));var client=jayson[_0x2be3('0xa')][_0x2be3('0xb')]({'port':0x232a});config[_0x2be3('0xc')]=_[_0x2be3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2be3('0xc')]));require(_0x2be3('0xe'))['register'](socket);function respondWithRpcPromise(_0x504ddc,_0x271dfc,_0x453e14){return new BPromise(function(_0x429f82,_0x3ab839){return client['request'](_0x504ddc,_0x453e14)['then'](function(_0xfda600){logger[_0x2be3('0xf')](_0x2be3('0x10'),_0x271dfc,'request\x20sent');logger[_0x2be3('0x11')](_0x2be3('0x12'),_0x271dfc,_0x2be3('0x13'),JSON[_0x2be3('0x14')](_0xfda600));if(_0xfda600[_0x2be3('0x15')]){if(_0xfda600[_0x2be3('0x15')][_0x2be3('0x16')]===0x1f4){logger[_0x2be3('0x15')](_0x2be3('0x10'),_0x271dfc,_0xfda600[_0x2be3('0x15')]['message']);return _0x3ab839(_0xfda600[_0x2be3('0x15')][_0x2be3('0x17')]);}logger['error'](_0x2be3('0x10'),_0x271dfc,_0xfda600['error']['message']);return _0x429f82(_0xfda600['error'][_0x2be3('0x17')]);}else{logger['info'](_0x2be3('0x10'),_0x271dfc,_0x2be3('0x13'));_0x429f82(_0xfda600[_0x2be3('0x18')][_0x2be3('0x17')]);}})[_0x2be3('0x19')](function(_0x443029){logger['error'](_0x2be3('0x10'),_0x271dfc,_0x443029);_0x3ab839(_0x443029);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3433466..ebdd49b 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 _0xfde0=['userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xfde0,0x171));var _0x0fde=function(_0x3e72b4,_0x549d01){_0x3e72b4=_0x3e72b4-0x0;var _0x4bc41f=_0xfde0[_0x3e72b4];return _0x4bc41f;};'use strict';var UserNotificationEvents=require(_0x0fde('0x0'));var events=[_0x0fde('0x1'),_0x0fde('0x2'),_0x0fde('0x3')];function createListener(_0x101da3,_0x12ed5d){return function(_0x5502cc){_0x12ed5d[_0x0fde('0x4')](_0x101da3,_0x5502cc);};}function removeListener(_0x92a79,_0x350594){return function(){UserNotificationEvents[_0x0fde('0x5')](_0x92a79,_0x350594);};}exports[_0x0fde('0x6')]=function(_0x119455){for(var _0x4553fd=0x0,_0x3bfe3d=events['length'];_0x4553fd<_0x3bfe3d;_0x4553fd++){var _0xa2515b=events[_0x4553fd];var _0x569097=createListener(_0x0fde('0x7')+_0xa2515b,_0x119455);UserNotificationEvents['on'](_0xa2515b,_0x569097);}}; \ No newline at end of file +var _0xac9a=['userNotification:','remove','update','emit','removeListener','register','length'];(function(_0x1755cb,_0x5c4bd6){var _0x38023a=function(_0x300005){while(--_0x300005){_0x1755cb['push'](_0x1755cb['shift']());}};_0x38023a(++_0x5c4bd6);}(_0xac9a,0x6a));var _0xaac9=function(_0x731b66,_0x3ea811){_0x731b66=_0x731b66-0x0;var _0x4c648d=_0xac9a[_0x731b66];return _0x4c648d;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0xaac9('0x0'),_0xaac9('0x1')];function createListener(_0x2f8c30,_0x38cb8a){return function(_0x5e6d0b){_0x38cb8a[_0xaac9('0x2')](_0x2f8c30,_0x5e6d0b);};}function removeListener(_0x106e90,_0xb7a757){return function(){UserNotificationEvents[_0xaac9('0x3')](_0x106e90,_0xb7a757);};}exports[_0xaac9('0x4')]=function(_0x3f6b52){for(var _0x1e762d=0x0,_0x80979a=events[_0xaac9('0x5')];_0x1e762d<_0x80979a;_0x1e762d++){var _0xbb82cd=events[_0x1e762d];var _0x3ef901=createListener(_0xaac9('0x6')+_0xbb82cd,_0x3f6b52);UserNotificationEvents['on'](_0xbb82cd,_0x3ef901);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 1f7659c..d04fc2b 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x368964,_0x57fb42){var _0x5d74cd=function(_0x53d695){while(--_0x53d695){_0x368964['push'](_0x368964['shift']());}};_0x5d74cd(++_0x57fb42);}(_0xe706,0xa3));var _0x6e70=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xe706[_0x3b3210];return _0x5b5484;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x28946f,_0x47b1fa){var _0x3122d5=function(_0x5e0ff5){while(--_0x5e0ff5){_0x28946f['push'](_0x28946f['shift']());}};_0x3122d5(++_0x47b1fa);}(_0xe706,0xa3));var _0x6e70=function(_0x373b3e,_0x347ac7){_0x373b3e=_0x373b3e-0x0;var _0xa4ce3=_0xe706[_0x373b3e];return _0xa4ce3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index ef64dd4..5e25253 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 _0x6d3e=['sequelize','exports','INTEGER'];(function(_0x29d42c,_0x2698b0){var _0x3c91b0=function(_0x498ac6){while(--_0x498ac6){_0x29d42c['push'](_0x29d42c['shift']());}};_0x3c91b0(++_0x2698b0);}(_0x6d3e,0x186));var _0xe6d3=function(_0x4a6bec,_0x5e1c11){_0x4a6bec=_0x4a6bec-0x0;var _0x29a59e=_0x6d3e[_0x4a6bec];return _0x29a59e;};'use strict';var Sequelize=require(_0xe6d3('0x0'));module[_0xe6d3('0x1')]={'penalty':{'type':Sequelize[_0xe6d3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3de6=['exports','INTEGER'];(function(_0x50aaac,_0x22bc34){var _0x485fce=function(_0x2c5446){while(--_0x2c5446){_0x50aaac['push'](_0x50aaac['shift']());}};_0x485fce(++_0x22bc34);}(_0x3de6,0x12c));var _0x63de=function(_0x53ada1,_0x13fe81){_0x53ada1=_0x53ada1-0x0;var _0x2af008=_0x3de6[_0x53ada1];return _0x2af008;};'use strict';var Sequelize=require('sequelize');module[_0x63de('0x0')]={'penalty':{'type':Sequelize[_0x63de('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 b2a2f75..a5a6e1e 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 _0xbf9a=['moment','bluebird','path','../../config/environment','exports','define','user_has_openchannel_queues','util','../../config/logger','api'];(function(_0x333622,_0x339cd1){var _0x5f5196=function(_0x45c2ad){while(--_0x45c2ad){_0x333622['push'](_0x333622['shift']());}};_0x5f5196(++_0x339cd1);}(_0xbf9a,0x1d3));var _0xabf9=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xbf9a[_0x114b7c];return _0x47185f;};'use strict';var _=require('lodash');var util=require(_0xabf9('0x0'));var logger=require(_0xabf9('0x1'))(_0xabf9('0x2'));var moment=require(_0xabf9('0x3'));var BPromise=require(_0xabf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabf9('0x5'));var rimraf=require('rimraf');var config=require(_0xabf9('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xabf9('0x7')]=function(_0x265579,_0x57a1a8){return _0x265579[_0xabf9('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0xabf9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3e=['path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42a192,_0x3105bb){var _0x260fbc=function(_0x5aa52f){while(--_0x5aa52f){_0x42a192['push'](_0x42a192['shift']());}};_0x260fbc(++_0x3105bb);}(_0x5c3e,0x10f));var _0xe5c3=function(_0x37a7bd,_0x2953e5){_0x37a7bd=_0x37a7bd-0x0;var _0x135536=_0x5c3e[_0x37a7bd];return _0x135536;};'use strict';var _=require(_0xe5c3('0x0'));var util=require('util');var logger=require(_0xe5c3('0x1'))(_0xe5c3('0x2'));var moment=require(_0xe5c3('0x3'));var BPromise=require(_0xe5c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5c3('0x5'));var rimraf=require('rimraf');var config=require(_0xe5c3('0x6'));var attributes=require(_0xe5c3('0x7'));module[_0xe5c3('0x8')]=function(_0xeb4cd7,_0x45d820){return _0xeb4cd7[_0xe5c3('0x9')](_0xe5c3('0xa'),attributes,{'tableName':_0xe5c3('0xb'),'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 8c784d1..b330ef3 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 _0xeb42=['error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x6c1c47,_0xe3da9c){var _0xbfa2ae=function(_0x1e04e5){while(--_0x1e04e5){_0x6c1c47['push'](_0x6c1c47['shift']());}};_0xbfa2ae(++_0xe3da9c);}(_0xeb42,0xcc));var _0x2eb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2eb4('0x0'));var moment=require('moment');var BPromise=require(_0x2eb4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2eb4('0x2'));var db=require(_0x2eb4('0x3'))['db'];var utils=require(_0x2eb4('0x4'));var logger=require(_0x2eb4('0x5'))(_0x2eb4('0x6'));var config=require(_0x2eb4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2eb4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5469f2,_0xc3c14c,_0x31548f){return new BPromise(function(_0x2e4bf9,_0x96a456){return client['request'](_0x5469f2,_0x31548f)[_0x2eb4('0x9')](function(_0x399354){logger[_0x2eb4('0xa')](_0x2eb4('0xb'),_0xc3c14c,'request\x20sent');logger[_0x2eb4('0xc')](_0x2eb4('0xd'),_0xc3c14c,_0x2eb4('0xe'),JSON[_0x2eb4('0xf')](_0x399354));if(_0x399354[_0x2eb4('0x10')]){if(_0x399354[_0x2eb4('0x10')][_0x2eb4('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xc3c14c,_0x399354[_0x2eb4('0x10')]['message']);return _0x96a456(_0x399354[_0x2eb4('0x10')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xc3c14c,_0x399354[_0x2eb4('0x10')][_0x2eb4('0x12')]);return _0x2e4bf9(_0x399354[_0x2eb4('0x10')][_0x2eb4('0x12')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0xc3c14c,_0x2eb4('0xe'));_0x2e4bf9(_0x399354[_0x2eb4('0x13')][_0x2eb4('0x12')]);}})['catch'](function(_0x44108e){logger[_0x2eb4('0x10')](_0x2eb4('0xb'),_0xc3c14c,_0x44108e);_0x96a456(_0x44108e);});});} \ No newline at end of file +var _0xa185=['client','http','request','then','request\x20sent','stringify','code','error','UserOpenchannelQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1a5439,_0x2a00fa){var _0x349e21=function(_0x3ec4bf){while(--_0x3ec4bf){_0x1a5439['push'](_0x1a5439['shift']());}};_0x349e21(++_0x2a00fa);}(_0xa185,0xe8));var _0x5a18=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa185[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5a18('0x0'));var util=require(_0x5a18('0x1'));var moment=require(_0x5a18('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a18('0x3'));var fs=require('fs');var Redis=require(_0x5a18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a18('0x5'));var logger=require(_0x5a18('0x6'))(_0x5a18('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a18('0x8')][_0x5a18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e367a,_0x2970fa,_0x458dbf){return new BPromise(function(_0x1a7de1,_0xaa88a9){return client[_0x5a18('0xa')](_0x4e367a,_0x458dbf)[_0x5a18('0xb')](function(_0x320995){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2970fa,_0x5a18('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2970fa,_0x5a18('0xc'),JSON[_0x5a18('0xd')](_0x320995));if(_0x320995['error']){if(_0x320995['error'][_0x5a18('0xe')]===0x1f4){logger[_0x5a18('0xf')](_0x5a18('0x10'),_0x2970fa,_0x320995[_0x5a18('0xf')][_0x5a18('0x11')]);return _0xaa88a9(_0x320995[_0x5a18('0xf')][_0x5a18('0x11')]);}logger[_0x5a18('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2970fa,_0x320995[_0x5a18('0xf')][_0x5a18('0x11')]);return _0x1a7de1(_0x320995[_0x5a18('0xf')][_0x5a18('0x11')]);}else{logger[_0x5a18('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2970fa,_0x5a18('0xc'));_0x1a7de1(_0x320995['result'][_0x5a18('0x11')]);}})[_0x5a18('0x13')](function(_0x359f7a){logger[_0x5a18('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2970fa,_0x359f7a);_0xaa88a9(_0x359f7a);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c18c992..0e4029f 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 _0x3b0b=['/:id/clone','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sections','getSections','/:id/resources','create','post'];(function(_0x255f6b,_0x17841a){var _0x462485=function(_0x570fb2){while(--_0x570fb2){_0x255f6b['push'](_0x255f6b['shift']());}};_0x462485(++_0x17841a);}(_0x3b0b,0xea));var _0xb3b0=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x3b0b[_0x13ea00];return _0x1f7347;};'use strict';var multer=require('multer');var util=require(_0xb3b0('0x0'));var path=require(_0xb3b0('0x1'));var timeout=require(_0xb3b0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb3b0('0x3'));var interaction=require(_0xb3b0('0x4'));var config=require(_0xb3b0('0x5'));var controller=require('./userProfile.controller');router[_0xb3b0('0x6')]('/',auth[_0xb3b0('0x7')](),controller[_0xb3b0('0x8')]);router['get']('/describe',auth[_0xb3b0('0x7')](),controller['describe']);router[_0xb3b0('0x6')](_0xb3b0('0x9'),auth['isAuthenticated'](),controller[_0xb3b0('0xa')]);router[_0xb3b0('0x6')](_0xb3b0('0xb'),auth['isAuthenticated'](),controller[_0xb3b0('0xc')]);router[_0xb3b0('0x6')](_0xb3b0('0xd'),auth[_0xb3b0('0x7')](),controller['getResources']);router['post']('/',auth[_0xb3b0('0x7')](),controller[_0xb3b0('0xe')]);router[_0xb3b0('0xf')](_0xb3b0('0x10'),auth['isAuthenticated'](),controller[_0xb3b0('0x11')]);router[_0xb3b0('0xf')](_0xb3b0('0xb'),auth[_0xb3b0('0x7')](),controller[_0xb3b0('0x12')]);router['post'](_0xb3b0('0xd'),auth[_0xb3b0('0x7')](),controller[_0xb3b0('0x13')]);router[_0xb3b0('0x14')]('/:id',auth[_0xb3b0('0x7')](),controller['update']);router[_0xb3b0('0x15')](_0xb3b0('0x9'),auth['isAuthenticated'](),controller[_0xb3b0('0x16')]);router[_0xb3b0('0x15')](_0xb3b0('0xb'),auth[_0xb3b0('0x7')](),controller[_0xb3b0('0x17')]);router[_0xb3b0('0x15')](_0xb3b0('0xd'),auth[_0xb3b0('0x7')](),controller[_0xb3b0('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb2ce=['put','update','destroy','delete','removeSections','removeResources','exports','util','path','Router','fs-extra','../../components/auth/service','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources'];(function(_0x1dac4c,_0x2953a0){var _0x4034f5=function(_0x153558){while(--_0x153558){_0x1dac4c['push'](_0x1dac4c['shift']());}};_0x4034f5(++_0x2953a0);}(_0xb2ce,0x77));var _0xeb2c=function(_0x195744,_0x3f8094){_0x195744=_0x195744-0x0;var _0x4ab599=_0xb2ce[_0x195744];return _0x4ab599;};'use strict';var multer=require('multer');var util=require(_0xeb2c('0x0'));var path=require(_0xeb2c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb2c('0x2')]();var fs_extra=require(_0xeb2c('0x3'));var auth=require(_0xeb2c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb2c('0x5'));router['get']('/',auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x7')]);router[_0xeb2c('0x8')](_0xeb2c('0x9'),auth['isAuthenticated'](),controller[_0xeb2c('0xa')]);router[_0xeb2c('0x8')](_0xeb2c('0xb'),auth[_0xeb2c('0x6')](),controller['show']);router[_0xeb2c('0x8')](_0xeb2c('0xc'),auth[_0xeb2c('0x6')](),controller['getSections']);router[_0xeb2c('0x8')](_0xeb2c('0xd'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0xe')]);router[_0xeb2c('0xf')]('/',auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x10')]);router[_0xeb2c('0xf')](_0xeb2c('0x11'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x12')]);router['post'](_0xeb2c('0xc'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x13')]);router[_0xeb2c('0xf')](_0xeb2c('0xd'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x14')]);router[_0xeb2c('0x15')](_0xeb2c('0xb'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x16')]);router['delete'](_0xeb2c('0xb'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x17')]);router[_0xeb2c('0x18')](_0xeb2c('0xc'),auth['isAuthenticated'](),controller[_0xeb2c('0x19')]);router['delete'](_0xeb2c('0xd'),auth[_0xeb2c('0x6')](),controller[_0xeb2c('0x1a')]);module[_0xeb2c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 82fc878..a0ffd79 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 _0xa8a5=['STRING','crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x4a5308,_0x1f7513){var _0x3ae596=function(_0x1fdf50){while(--_0x1fdf50){_0x4a5308['push'](_0x4a5308['shift']());}};_0x3ae596(++_0x1f7513);}(_0xa8a5,0x1be));var _0x5a8a=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa8a5[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x5a8a('0x0'));module[_0x5a8a('0x1')]={'name':{'type':Sequelize[_0x5a8a('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x5a8a('0x2')],'set':function(_0x236c6c){this['setDataValue'](_0x5a8a('0x3'),_0x236c6c?_0x236c6c[_0x5a8a('0x4')](''):[]);},'get':function(){return this[_0x5a8a('0x5')]('crudPermissions')?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5a8a('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x824b=['getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0xf79d54,_0x178b79){var _0x3a3732=function(_0xc76183){while(--_0xc76183){_0xf79d54['push'](_0xf79d54['shift']());}};_0x3a3732(++_0x178b79);}(_0x824b,0x82));var _0xb824=function(_0x3828f4,_0x123595){_0x3828f4=_0x3828f4-0x0;var _0x30c0b5=_0x824b[_0x3828f4];return _0x30c0b5;};'use strict';var Sequelize=require(_0xb824('0x0'));module[_0xb824('0x1')]={'name':{'type':Sequelize[_0xb824('0x2')],'allowNull':![],'unique':_0xb824('0x3')},'crudPermissions':{'type':Sequelize[_0xb824('0x2')],'set':function(_0x27de09){this[_0xb824('0x4')]('crudPermissions',_0x27de09?_0x27de09['join'](''):[]);},'get':function(){return this[_0xb824('0x5')](_0xb824('0x6'))?this[_0xb824('0x5')]('crudPermissions')[_0xb824('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb824('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb824('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb824('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 7658576..b97dbf3 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 _0x57ef=['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/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','offset','count','set','apply','save','update','then','destroy','error','name','send','index','map','UserProfile','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','catch','params','length','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','Resources','UserProfileResource','describe','addSections','sectionId','userProfileId','push','ids','getSections','includes','isEmpty','subsections','enabled','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ef,0xdb));var _0xf57e=function(_0x52b318,_0x4be22f){_0x52b318=_0x52b318-0x0;var _0x274755=_0x57ef[_0x52b318];return _0x274755;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf57e('0x0'));var zipdir=require(_0xf57e('0x1'));var jsonpatch=require(_0xf57e('0x2'));var rp=require(_0xf57e('0x3'));var moment=require(_0xf57e('0x4'));var BPromise=require(_0xf57e('0x5'));var Mustache=require(_0xf57e('0x6'));var util=require('util');var path=require(_0xf57e('0x7'));var sox=require(_0xf57e('0x8'));var csv=require(_0xf57e('0x9'));var ejs=require(_0xf57e('0xa'));var fs=require('fs');var fs_extra=require(_0xf57e('0xb'));var _=require(_0xf57e('0xc'));var squel=require(_0xf57e('0xd'));var crypto=require(_0xf57e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf57e('0xf'));var toCsv=require(_0xf57e('0x9'));var querystring=require(_0xf57e('0x10'));var Papa=require(_0xf57e('0x11'));var Redis=require(_0xf57e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf57e('0x13'));var as=require(_0xf57e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf57e('0x15'))(_0xf57e('0x16'));var utils=require(_0xf57e('0x17'));var config=require(_0xf57e('0x18'));var licenseUtil=require(_0xf57e('0x19'));var db=require(_0xf57e('0x1a'))['db'];config['redis']=_[_0xf57e('0x1b')](config[_0xf57e('0x1c')],{'host':_0xf57e('0x1d'),'port':0x18eb});var socket=require(_0xf57e('0x1e'))(new Redis(config[_0xf57e('0x1c')]));require(_0xf57e('0x1f'))[_0xf57e('0x20')](socket);function respondWithStatusCode(_0x2f0d23,_0x122be7){_0x122be7=_0x122be7||0xcc;return function(_0x419b4a){if(_0x419b4a){return _0x2f0d23[_0xf57e('0x21')](_0x122be7);}return _0x2f0d23[_0xf57e('0x22')](_0x122be7)[_0xf57e('0x23')]();};}function respondWithResult(_0x302c46,_0x37e548){_0x37e548=_0x37e548||0xc8;return function(_0x20050d){if(_0x20050d){return _0x302c46[_0xf57e('0x22')](_0x37e548)[_0xf57e('0x24')](_0x20050d);}};}function respondWithFilteredResult(_0x236c0f,_0xe45878){return function(_0x186f69){if(_0x186f69){var _0x3858e4=typeof _0xe45878['offset']==='undefined'&&typeof _0xe45878[_0xf57e('0x25')]==='undefined';var _0x3100ce=_0x186f69['count'];var _0x5ada9b=_0x3858e4?0x0:_0xe45878[_0xf57e('0x26')];var _0x17afb0=_0x3858e4?_0x186f69[_0xf57e('0x27')]:_0xe45878['offset']+_0xe45878[_0xf57e('0x25')];var _0x582ca5;if(_0x17afb0>=_0x3100ce){_0x17afb0=_0x3100ce;_0x582ca5=0xc8;}else{_0x582ca5=0xce;}_0x236c0f[_0xf57e('0x22')](_0x582ca5);return _0x236c0f[_0xf57e('0x28')]('Content-Range',_0x5ada9b+'-'+_0x17afb0+'/'+_0x3100ce)['json'](_0x186f69);}return null;};}function patchUpdates(_0x2068bc){return function(_0x622649){try{jsonpatch[_0xf57e('0x29')](_0x622649,_0x2068bc,!![]);}catch(_0x297b2f){return BPromise['reject'](_0x297b2f);}return _0x622649[_0xf57e('0x2a')]();};}function saveUpdates(_0x1cd065,_0x4b0a0c){return function(_0x45843b){if(_0x45843b){return _0x45843b[_0xf57e('0x2b')](_0x1cd065)[_0xf57e('0x2c')](function(_0xa3072d){return _0xa3072d;});}return null;};}function removeEntity(_0x3eab72,_0x3666e8){return function(_0x5c7414){if(_0x5c7414){return _0x5c7414[_0xf57e('0x2d')]()['then'](function(){_0x3eab72[_0xf57e('0x22')](0xcc)[_0xf57e('0x23')]();});}};}function handleEntityNotFound(_0x1b7f19,_0x4df26d){return function(_0x52147d){if(!_0x52147d){_0x1b7f19[_0xf57e('0x21')](0x194);}return _0x52147d;};}function handleError(_0x22aeb6,_0x4f4c73){_0x4f4c73=_0x4f4c73||0x1f4;return function(_0x468048){logger[_0xf57e('0x2e')](_0x468048['stack']);if(_0x468048['name']){delete _0x468048[_0xf57e('0x2f')];}_0x22aeb6['status'](_0x4f4c73)[_0xf57e('0x30')](_0x468048);};}exports[_0xf57e('0x31')]=function(_0x93f436,_0x27ee9f){var _0x502211={},_0x4e5ec2={},_0xc821b7={'count':0x0,'rows':[]};var _0x4bfefb=_[_0xf57e('0x32')](db[_0xf57e('0x33')][_0xf57e('0x34')],function(_0x488fb0){return{'name':_0x488fb0[_0xf57e('0x35')],'type':_0x488fb0[_0xf57e('0x36')]['key']};});_0x4e5ec2['model']=_[_0xf57e('0x32')](_0x4bfefb,'name');_0x4e5ec2[_0xf57e('0x37')]=_[_0xf57e('0x38')](_0x93f436['query']);_0x4e5ec2['filters']=_[_0xf57e('0x39')](_0x4e5ec2[_0xf57e('0x3a')],_0x4e5ec2[_0xf57e('0x37')]);_0x502211[_0xf57e('0x3b')]=_['intersection'](_0x4e5ec2['model'],qs[_0xf57e('0x3c')](_0x93f436[_0xf57e('0x37')][_0xf57e('0x3c')]));_0x502211[_0xf57e('0x3b')]=_0x502211[_0xf57e('0x3b')]['length']?_0x502211[_0xf57e('0x3b')]:_0x4e5ec2['model'];if(!_0x93f436['query'][_0xf57e('0x3d')]('nolimit')){_0x502211[_0xf57e('0x25')]=qs[_0xf57e('0x25')](_0x93f436['query'][_0xf57e('0x25')]);_0x502211[_0xf57e('0x26')]=qs[_0xf57e('0x26')](_0x93f436[_0xf57e('0x37')][_0xf57e('0x26')]);}_0x502211[_0xf57e('0x3e')]=qs[_0xf57e('0x3f')](_0x93f436[_0xf57e('0x37')][_0xf57e('0x3f')]);_0x502211[_0xf57e('0x40')]=qs[_0xf57e('0x41')](_[_0xf57e('0x42')](_0x93f436[_0xf57e('0x37')],_0x4e5ec2[_0xf57e('0x41')]),_0x4bfefb);if(_0x93f436['query'][_0xf57e('0x43')]){_0x502211['where']=_['merge'](_0x502211['where'],{'$or':_[_0xf57e('0x32')](_0x4bfefb,function(_0x16da7f){if(_0x16da7f['type']!=='VIRTUAL'){var _0x526a62={};_0x526a62[_0x16da7f[_0xf57e('0x2f')]]={'$like':'%'+_0x93f436[_0xf57e('0x37')][_0xf57e('0x43')]+'%'};return _0x526a62;}})});}_0x502211=_[_0xf57e('0x44')]({},_0x502211,_0x93f436[_0xf57e('0x45')]);var _0x55ad0d={'where':_0x502211[_0xf57e('0x40')]};return db[_0xf57e('0x33')][_0xf57e('0x27')](_0x55ad0d)['then'](function(_0x2de3c7){_0xc821b7['count']=_0x2de3c7;if(_0x93f436['query']['includeAll']){_0x502211[_0xf57e('0x46')]=[{'all':!![]}];}return db[_0xf57e('0x33')][_0xf57e('0x47')](_0x502211);})['then'](function(_0x48d305){_0xc821b7['rows']=_0x48d305;return _0xc821b7;})[_0xf57e('0x2c')](respondWithFilteredResult(_0x27ee9f,_0x502211))[_0xf57e('0x48')](handleError(_0x27ee9f,null));};exports['show']=function(_0x41aff1,_0x17cf8d){var _0x1c6fb8={'raw':![],'where':{'id':_0x41aff1[_0xf57e('0x49')]['id']}},_0x2afd40={};_0x2afd40['model']=_[_0xf57e('0x38')](db['UserProfile']['rawAttributes']);_0x2afd40[_0xf57e('0x37')]=_[_0xf57e('0x38')](_0x41aff1[_0xf57e('0x37')]);_0x2afd40[_0xf57e('0x41')]=_[_0xf57e('0x39')](_0x2afd40['model'],_0x2afd40['query']);_0x1c6fb8[_0xf57e('0x3b')]=_[_0xf57e('0x39')](_0x2afd40[_0xf57e('0x3a')],qs[_0xf57e('0x3c')](_0x41aff1[_0xf57e('0x37')][_0xf57e('0x3c')]));_0x1c6fb8['attributes']=_0x1c6fb8[_0xf57e('0x3b')][_0xf57e('0x4a')]?_0x1c6fb8[_0xf57e('0x3b')]:_0x2afd40[_0xf57e('0x3a')];if(_0x41aff1[_0xf57e('0x37')][_0xf57e('0x4b')]){_0x1c6fb8[_0xf57e('0x46')]=[{'all':!![]}];}_0x1c6fb8=_[_0xf57e('0x44')]({},_0x1c6fb8,_0x41aff1['options']);return db[_0xf57e('0x33')][_0xf57e('0x4c')](_0x1c6fb8)['then'](handleEntityNotFound(_0x17cf8d,null))[_0xf57e('0x2c')](respondWithResult(_0x17cf8d,null))[_0xf57e('0x48')](handleError(_0x17cf8d,null));};exports[_0xf57e('0x4d')]=function(_0x31b625,_0x12aeac){return db[_0xf57e('0x33')][_0xf57e('0x4d')](_0x31b625[_0xf57e('0x4e')],{})['then'](respondWithResult(_0x12aeac,0xc9))[_0xf57e('0x48')](handleError(_0x12aeac,null));};exports[_0xf57e('0x4f')]=function(_0x1dfdb7,_0x3289f9){var _0x15d39c={'where':{'id':_0x1dfdb7['params']['id']}},_0x1c6ec8={};_0x1c6ec8[_0xf57e('0x3a')]=_[_0xf57e('0x38')](db[_0xf57e('0x33')][_0xf57e('0x34')]);_0x15d39c[_0xf57e('0x3b')]=_[_0xf57e('0x39')](_0x1c6ec8['model'],qs[_0xf57e('0x3c')](_0x1dfdb7[_0xf57e('0x37')][_0xf57e('0x3c')]));_0x15d39c['attributes']=_0x15d39c[_0xf57e('0x3b')]['length']?_0x15d39c['attributes']:_0x1c6ec8[_0xf57e('0x3a')];if(_0x1dfdb7[_0xf57e('0x37')][_0xf57e('0x4b')]){_0x15d39c[_0xf57e('0x46')]=[{'all':!![]}];}_0x15d39c=_[_0xf57e('0x44')]({},_0x15d39c,_0x1dfdb7[_0xf57e('0x45')]);return db[_0xf57e('0x33')][_0xf57e('0x4c')](_0x15d39c)['then'](handleEntityNotFound(_0x3289f9,null))[_0xf57e('0x2c')](function(_0x2a8edb){if(_0x2a8edb){var _0x22e1dc=_0x2a8edb[_0xf57e('0x50')]({'plain':!![]});_0x22e1dc=qs[_0xf57e('0x51')](_0x22e1dc,['id',_0xf57e('0x52'),_0xf57e('0x53'),_0xf57e('0x54')]);_0x1dfdb7[_0xf57e('0x4e')]=_[_0xf57e('0x51')](_0x1dfdb7[_0xf57e('0x4e')],['id',_0xf57e('0x52'),_0xf57e('0x53')]);return db[_0xf57e('0x55')][_0xf57e('0x56')](function(_0xe9b349){return db['UserProfile']['create'](_[_0xf57e('0x44')](_0x22e1dc,_0x1dfdb7[_0xf57e('0x4e')]),{'include':_0x1dfdb7[_0xf57e('0x37')][_0xf57e('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0xe9b349})['then'](function(_0x9bd532){var _0x57b75a=_0x9bd532['get']({'plain':!![]});return db[_0xf57e('0x57')][_0xf57e('0x47')]({'where':{'userProfileId':_0x1dfdb7['params']['id']},'raw':!![]})[_0xf57e('0x2c')](function(_0x1fbd6b){if(_0x1fbd6b){return BPromise[_0xf57e('0x58')](_0x1fbd6b,function(_0x3d2cde){return new BPromise(function(_0x9937b1,_0x8dd24f){if(_0x3d2cde[_0xf57e('0x59')]===null||_0x3d2cde[_0xf57e('0x59')]===0x1)_0x9937b1(null);return db['UserProfileResource'][_0xf57e('0x47')]({'where':{'sectionId':_0x3d2cde['id']},'raw':!![]})[_0xf57e('0x2c')](function(_0x539b41){var _0x4fc61c=_[_0xf57e('0x32')](_0x539b41,function(_0x14d410){return qs['omit'](_0x14d410,['id',_0xf57e('0x52'),_0xf57e('0x53'),'sectionId']);});_0x9937b1(_0x4fc61c);})[_0xf57e('0x48')](function(_0x26bd0f){_0x8dd24f(_0x26bd0f);});})[_0xf57e('0x2c')](function(_0x261b6c){var _0x13a349=qs['omit'](_0x3d2cde,['id','createdAt',_0xf57e('0x53')]);_0x13a349['userProfileId']=_0x57b75a['id'];if(_0x261b6c)_0x13a349[_0xf57e('0x5a')]=_0x261b6c;return _0x13a349;})[_0xf57e('0x2c')](function(_0x36b738){return db[_0xf57e('0x57')]['create'](_0x36b738,{'include':[{'model':db[_0xf57e('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0xe9b349});});})[_0xf57e('0x2c')](function(){return _0x57b75a;});}});});});}})[_0xf57e('0x2c')](respondWithResult(_0x3289f9,0xc9))['catch'](handleError(_0x3289f9,null));};exports[_0xf57e('0x2b')]=function(_0x5e7886,_0x6e0d02){if(_0x5e7886['body']['id']){delete _0x5e7886[_0xf57e('0x4e')]['id'];}return db[_0xf57e('0x33')][_0xf57e('0x4c')]({'where':{'id':_0x5e7886[_0xf57e('0x49')]['id']}})[_0xf57e('0x2c')](handleEntityNotFound(_0x6e0d02,null))[_0xf57e('0x2c')](saveUpdates(_0x5e7886[_0xf57e('0x4e')],null))[_0xf57e('0x2c')](respondWithResult(_0x6e0d02,null))[_0xf57e('0x48')](handleError(_0x6e0d02,null));};exports['destroy']=function(_0x30f689,_0x40a998){return db[_0xf57e('0x33')][_0xf57e('0x4c')]({'where':{'id':_0x30f689['params']['id']}})[_0xf57e('0x2c')](handleEntityNotFound(_0x40a998,null))['then'](removeEntity(_0x40a998,null))[_0xf57e('0x48')](handleError(_0x40a998,null));};exports[_0xf57e('0x5c')]=function(_0x5afed5,_0x662965){return db[_0xf57e('0x33')][_0xf57e('0x5c')]()[_0xf57e('0x2c')](respondWithResult(_0x662965,null))[_0xf57e('0x48')](handleError(_0x662965,null));};exports[_0xf57e('0x5d')]=function(_0x40647f,_0x5258d1){var _0x25745f=_0x40647f[_0xf57e('0x4e')];return db[_0xf57e('0x33')][_0xf57e('0x4c')]({'where':{'id':_0x40647f[_0xf57e('0x49')]['id']}})[_0xf57e('0x2c')](handleEntityNotFound(_0x5258d1,null))['then'](function(_0x41769f){if(_0x41769f){return db[_0xf57e('0x55')][_0xf57e('0x56')](function(_0x373344){return db[_0xf57e('0x57')][_0xf57e('0x2d')]({'where':{'userProfileId':_0x40647f[_0xf57e('0x49')]['id'],'sectionId':_[_0xf57e('0x32')](_0x25745f,function(_0x19c4be){return _0x19c4be[_0xf57e('0x5e')];})},'transaction':_0x373344})['then'](function(){var _0x4f7947=_[_0xf57e('0x32')](_0x25745f,function(_0x1c9190){_0x1c9190[_0xf57e('0x5f')]=_0x40647f[_0xf57e('0x49')]['id'];return _0x1c9190;});var _0x1664df=[];return BPromise[_0xf57e('0x58')](_0x4f7947,function(_0x255424){return db[_0xf57e('0x57')][_0xf57e('0x4d')](_0x255424,{'include':[{'model':db[_0xf57e('0x5b')],'as':_0xf57e('0x5a')}],'raw':!![],'transaction':_0x373344})[_0xf57e('0x2c')](function(_0x1278b6){_0x1664df[_0xf57e('0x60')](_0x1278b6['get']({'plain':!![]}));});})[_0xf57e('0x2c')](function(){return _0x1664df;});});});}})[_0xf57e('0x2c')](function(_0x52d728){return _0x52d728;})[_0xf57e('0x2c')](respondWithResult(_0x5258d1,null))[_0xf57e('0x48')](handleError(_0x5258d1,null));};exports['removeSections']=function(_0x2c4d22,_0x3fc0d1){var _0xcc5828;return db['UserProfile'][_0xf57e('0x4c')]({'where':{'id':_0x2c4d22[_0xf57e('0x49')]['id']},'attributes':['id',_0xf57e('0x2f')]})[_0xf57e('0x2c')](handleEntityNotFound(_0x3fc0d1,null))[_0xf57e('0x2c')](function(_0x26a61f){if(_0x26a61f){_0xcc5828=_0x26a61f;return db[_0xf57e('0x57')][_0xf57e('0x2d')]({'where':{'userProfileId':_0x2c4d22[_0xf57e('0x49')]['id'],'sectionId':_0x2c4d22[_0xf57e('0x37')][_0xf57e('0x61')]}});}})[_0xf57e('0x2c')](function(){return _0xcc5828;})[_0xf57e('0x2c')](respondWithStatusCode(_0x3fc0d1,null))['catch'](handleError(_0x3fc0d1,null));};exports[_0xf57e('0x62')]=function(_0x4fdbfa,_0x3a92f3){var _0x550b7d=[];var _0x21b8e7=[];return db['UserProfileSection'][_0xf57e('0x47')]({'where':{'userProfileId':_0x4fdbfa['params']['id']},'raw':!![]})['then'](function(_0x3c00ad){_0x550b7d=_[_0xf57e('0x43')](_0x3c00ad,function(_0xecd292){return _0xecd292['enabled']===0x1||_[_0xf57e('0x63')]([0x3eb,0x709],_0xecd292[_0xf57e('0x5e')]);});if(!_[_0xf57e('0x64')](_0x550b7d)){return _[_0xf57e('0x32')](_0x550b7d,function(_0x44aeee){return _0x44aeee['sectionId'];});}else{return;}})[_0xf57e('0x2c')](function(_0x16efcf){if(_0x16efcf)_0x21b8e7=_0x16efcf;if(_[_0xf57e('0x63')](_0x21b8e7,0x64)){var _0x5ac57f=_[_0xf57e('0x4c')](_0x550b7d,{'sectionId':0x64});return hasDefaultDashboard(_0x5ac57f)[_0xf57e('0x2c')](function(_0x51cbb2){return _[_0xf57e('0x32')](_0x550b7d,function(_0x2977d1){if(_0x2977d1['sectionId']===0x64){_0x2977d1[_0xf57e('0x65')]=_0x51cbb2;}return _0x2977d1;});});}else{return;}})['then'](function(_0x135c04){if(_0x135c04)_0x550b7d=_0x135c04;if(_[_0xf57e('0x63')](_0x21b8e7,0x3eb)){var _0xaaf2fd=_['find'](_0x550b7d,{'sectionId':0x3eb});return getCustomDashboards(_0xaaf2fd)[_0xf57e('0x2c')](function(_0x5ab676){return _[_0xf57e('0x32')](_0x550b7d,function(_0x475f3c){if(_0xaaf2fd[_0xf57e('0x66')]){if(_0x475f3c[_0xf57e('0x5e')]===0x3eb){_0x475f3c[_0xf57e('0x65')]=_0x5ab676;}}else{if(_0x475f3c[_0xf57e('0x5e')]===0x64){_0x475f3c[_0xf57e('0x65')]=_0x5ab676;}}return _0x475f3c;});});}else{return;}})[_0xf57e('0x2c')](function(_0x31f0e7){if(_0x31f0e7)_0x550b7d=_0x31f0e7;if(_['includes'](_0x21b8e7,0x709)){var _0x2b48ba=_[_0xf57e('0x4c')](_0x550b7d,{'sectionId':0x709});return getPlugins(_0x2b48ba)[_0xf57e('0x2c')](function(_0x3fa0a1){if(_0x2b48ba[_0xf57e('0x66')]){return _[_0xf57e('0x32')](_0x550b7d,function(_0x2c4cf9){if(_0x2c4cf9[_0xf57e('0x5e')]===0x709){_0x2c4cf9[_0xf57e('0x65')]=_0x3fa0a1;}return _0x2c4cf9;});}else{var _0x235194={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3fa0a1};var _0x2f3598=_[_0xf57e('0x32')](_0x550b7d);_0x2f3598[_0xf57e('0x60')](_0x235194);return _0x2f3598;}});}else{return;}})[_0xf57e('0x2c')](function(_0x156d47){if(_0x156d47)_0x550b7d=_0x156d47;return _['filter'](_0x550b7d,[_0xf57e('0x66'),0x1]);})[_0xf57e('0x2c')](respondWithResult(_0x3a92f3,null))[_0xf57e('0x48')](handleError(_0x3a92f3,null));};function hasDefaultDashboard(_0x14e17f){var _0x3db8b9=[0x65];return new BPromise(function(_0x2f8269,_0x28fb7e){try{if(_0x14e17f[_0xf57e('0x59')]){_0x2f8269(_0x3db8b9);}else{return db['UserProfileResource'][_0xf57e('0x67')]({'where':{'sectionId':_0x14e17f['id']},'raw':!![]})['then'](function(_0x1463ae){_0x1463ae?_0x2f8269(_0x3db8b9):_0x2f8269();});}}catch(_0xb29009){_0x28fb7e(_0xb29009);}});}function getCustomDashboards(_0x1e84f4){var _0x59ec8e=[];return new BPromise(function(_0x55cc7e,_0x275f72){try{if(_0x1e84f4['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})[_0xf57e('0x2c')](function(_0x161c0e){_0x161c0e[_0xf57e('0x68')](function(_0x3107e4){_0x59ec8e[_0xf57e('0x60')](_0x3107e4['id']+0x1869f);});_0x55cc7e(_0x59ec8e);});}else{return db['UserProfileResource'][_0xf57e('0x47')]({'where':{'sectionId':_0x1e84f4['id']},'raw':!![]})[_0xf57e('0x2c')](function(_0x1fbf94){_0x1fbf94['forEach'](function(_0x47bdc7){_0x59ec8e['push'](_0x47bdc7[_0xf57e('0x69')]+0x1869f);});_0x55cc7e(_0x59ec8e);});}}catch(_0x12f92b){_0x275f72(_0x12f92b);}});}function getPlugins(_0x17b0ff){var _0x32044d=[];return new BPromise(function(_0x336916,_0x202a43){try{if(_0x17b0ff[_0xf57e('0x59')]){return db[_0xf57e('0x6a')][_0xf57e('0x47')]({'raw':!![]})[_0xf57e('0x2c')](function(_0x36b8e0){_0x36b8e0[_0xf57e('0x68')](function(_0x548c73){_0x32044d[_0xf57e('0x60')](_0x548c73['id']+0x15b38);});_0x336916(_0x32044d);});}else{return db[_0xf57e('0x5b')][_0xf57e('0x47')]({'where':{'sectionId':_0x17b0ff['id']},'raw':!![]})[_0xf57e('0x2c')](function(_0x42b48e){_0x42b48e[_0xf57e('0x68')](function(_0x64ef8a){_0x32044d[_0xf57e('0x60')](_0x64ef8a[_0xf57e('0x69')]+0x15b38);});_0x336916(_0x32044d);});}}catch(_0x114681){_0x202a43(_0x114681);}});}exports['addResources']=function(_0x4a909d,_0x357b9e){return db[_0xf57e('0x33')][_0xf57e('0x4c')]({'where':{'id':_0x4a909d[_0xf57e('0x49')]['id']}})[_0xf57e('0x2c')](handleEntityNotFound(_0x357b9e,null))['then'](function(_0x3c3652){if(_0x3c3652){return db['sequelize'][_0xf57e('0x56')](function(_0xfb335){return db[_0xf57e('0x57')][_0xf57e('0x47')]({'where':{'userProfileId':_0x4a909d[_0xf57e('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0xf57e('0x2c')](function(_0x136876){if(_0x136876){return db[_0xf57e('0x57')][_0xf57e('0x2d')]({'where':{'userProfileId':_0x4a909d[_0xf57e('0x49')]['id'],'id':_[_0xf57e('0x32')](_0x136876,function(_0x2bdfa2){return _0x2bdfa2['id'];})},'transaction':_0xfb335});}})['then'](function(_0x32e5bc){var _0x95e89e=_[_0xf57e('0x32')](_0x4a909d[_0xf57e('0x4e')],function(_0x4896fa){_0x4896fa[_0xf57e('0x5f')]=_0x4a909d[_0xf57e('0x49')]['id'];return _0x4896fa;});return db['UserProfileSection']['bulkCreate'](_0x95e89e,{'raw':!![],'transaction':_0xfb335});})[_0xf57e('0x2c')](function(_0x440ec7){var _0x1c1762=_['filter'](_['map'](_0x440ec7,function(_0x28da91){return _0x28da91[_0xf57e('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x1c1762){return db[_0xf57e('0x57')]['findAll']({'where':{'userProfileId':_0x4a909d[_0xf57e('0x49')]['id'],'sectionId':_[_0xf57e('0x32')](_0x1c1762,function(_0x6949c1){return _0x6949c1[_0xf57e('0x5e')];})},'attributes':['id',_0xf57e('0x5e')],'raw':!![]})[_0xf57e('0x2c')](function(_0x2fe011){var _0x1907b0=_[_0xf57e('0x32')](_0x4a909d['body'],function(_0x32c943){_0x32c943['userProfileId']=_0x4a909d[_0xf57e('0x49')]['id'];return _0x32c943;});return db[_0xf57e('0x5b')][_0xf57e('0x6b')](_0x1907b0,{'raw':!![],'transaction':_0xfb335});});}})[_0xf57e('0x48')](handleError(_0x357b9e,null));});}})[_0xf57e('0x2c')](function(_0x31220e){var _0x2aae9d=_[_0xf57e('0x32')](_0x31220e,function(_0x1b7e3c){return _0x1b7e3c[_0xf57e('0x50')]({'plain':!![]});});})[_0xf57e('0x2c')](respondWithResult(_0x357b9e,null))[_0xf57e('0x48')](handleError(_0x357b9e,null));};exports[_0xf57e('0x6c')]=function(_0x2a8c7c,_0x2a32af,_0x45859c){return db[_0xf57e('0x33')]['find']({'where':{'id':_0x2a8c7c[_0xf57e('0x49')]['id']}})[_0xf57e('0x2c')](handleEntityNotFound(_0x2a32af,null))['then'](function(_0x28e958){if(_0x28e958){return _0x28e958[_0xf57e('0x6c')](_0x2a8c7c['query']['ids']);}})[_0xf57e('0x2c')](respondWithStatusCode(_0x2a32af,null))[_0xf57e('0x48')](handleError(_0x2a32af,null));};exports[_0xf57e('0x6d')]=function(_0x27b460,_0x3d123d){var _0x448b5b={};if(!_0x27b460['query'][_0xf57e('0x6e')])throw new Error(_0xf57e('0x6f'));if(!_0x27b460[_0xf57e('0x37')]['hasOwnProperty'](_0xf57e('0x70'))){_0x448b5b[_0xf57e('0x25')]=qs[_0xf57e('0x25')](_0x27b460[_0xf57e('0x37')][_0xf57e('0x25')]);_0x448b5b[_0xf57e('0x26')]=qs[_0xf57e('0x26')](_0x27b460[_0xf57e('0x37')][_0xf57e('0x26')]);}return db[_0xf57e('0x33')]['find']({'where':{'id':_0x27b460['params']['id']}})[_0xf57e('0x2c')](function(_0x212dd3){if(!_0x212dd3)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x27b460['params']['id']);return db[_0xf57e('0x33')][_0xf57e('0x6d')](_0x27b460);})[_0xf57e('0x2c')](respondWithFilteredResult(_0x3d123d,_0x448b5b))[_0xf57e('0x48')](handleError(_0x3d123d,null));}; \ No newline at end of file +var _0x5d0a=['omit','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','params','describe','destroy','userProfileId','removeSections','ids','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','rows','show','length','options','find','catch','create','body','clone','get','createdAt','crudPermissions'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5d0a,0x175));var _0xa5d0=function(_0x15f490,_0x16130d){_0x15f490=_0x15f490-0x0;var _0x1d1093=_0x5d0a[_0x15f490];return _0x1d1093;};'use strict';var emlformat=require(_0xa5d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5d0('0x2'));var moment=require(_0xa5d0('0x3'));var BPromise=require(_0xa5d0('0x4'));var Mustache=require(_0xa5d0('0x5'));var util=require('util');var path=require(_0xa5d0('0x6'));var sox=require(_0xa5d0('0x7'));var csv=require(_0xa5d0('0x8'));var ejs=require(_0xa5d0('0x9'));var fs=require('fs');var fs_extra=require(_0xa5d0('0xa'));var _=require(_0xa5d0('0xb'));var squel=require(_0xa5d0('0xc'));var crypto=require(_0xa5d0('0xd'));var jsforce=require(_0xa5d0('0xe'));var deskjs=require(_0xa5d0('0xf'));var toCsv=require(_0xa5d0('0x8'));var querystring=require('querystring');var Papa=require(_0xa5d0('0x10'));var Redis=require(_0xa5d0('0x11'));var authService=require(_0xa5d0('0x12'));var qs=require(_0xa5d0('0x13'));var as=require(_0xa5d0('0x14'));var hardwareService=require(_0xa5d0('0x15'));var logger=require(_0xa5d0('0x16'))(_0xa5d0('0x17'));var utils=require(_0xa5d0('0x18'));var config=require(_0xa5d0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d0('0x1a'))['db'];config['redis']=_['defaults'](config[_0xa5d0('0x1b')],{'host':_0xa5d0('0x1c'),'port':0x18eb});var socket=require(_0xa5d0('0x1d'))(new Redis(config[_0xa5d0('0x1b')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0xf06747,_0x2a138b){_0x2a138b=_0x2a138b||0xcc;return function(_0x38afdb){if(_0x38afdb){return _0xf06747[_0xa5d0('0x1e')](_0x2a138b);}return _0xf06747[_0xa5d0('0x1f')](_0x2a138b)[_0xa5d0('0x20')]();};}function respondWithResult(_0x1461d5,_0x5b267d){_0x5b267d=_0x5b267d||0xc8;return function(_0x2da9ec){if(_0x2da9ec){return _0x1461d5['status'](_0x5b267d)[_0xa5d0('0x21')](_0x2da9ec);}};}function respondWithFilteredResult(_0x3c00fd,_0x5d1dec){return function(_0x5bc068){if(_0x5bc068){var _0x87f13e=typeof _0x5d1dec[_0xa5d0('0x22')]==='undefined'&&typeof _0x5d1dec[_0xa5d0('0x23')]===_0xa5d0('0x24');var _0x9fab4=_0x5bc068[_0xa5d0('0x25')];var _0x10e7be=_0x87f13e?0x0:_0x5d1dec[_0xa5d0('0x22')];var _0x4a8e8b=_0x87f13e?_0x5bc068['count']:_0x5d1dec[_0xa5d0('0x22')]+_0x5d1dec[_0xa5d0('0x23')];var _0x4cc587;if(_0x4a8e8b>=_0x9fab4){_0x4a8e8b=_0x9fab4;_0x4cc587=0xc8;}else{_0x4cc587=0xce;}_0x3c00fd['status'](_0x4cc587);return _0x3c00fd[_0xa5d0('0x26')](_0xa5d0('0x27'),_0x10e7be+'-'+_0x4a8e8b+'/'+_0x9fab4)[_0xa5d0('0x21')](_0x5bc068);}return null;};}function patchUpdates(_0xde8c41){return function(_0x3ebbc6){try{jsonpatch[_0xa5d0('0x28')](_0x3ebbc6,_0xde8c41,!![]);}catch(_0x518a60){return BPromise[_0xa5d0('0x29')](_0x518a60);}return _0x3ebbc6[_0xa5d0('0x2a')]();};}function saveUpdates(_0xefd903,_0x5b363f){return function(_0x36797a){if(_0x36797a){return _0x36797a[_0xa5d0('0x2b')](_0xefd903)[_0xa5d0('0x2c')](function(_0x4d5e7a){return _0x4d5e7a;});}return null;};}function removeEntity(_0x4916f6,_0x758789){return function(_0x4b8241){if(_0x4b8241){return _0x4b8241['destroy']()['then'](function(){_0x4916f6[_0xa5d0('0x1f')](0xcc)[_0xa5d0('0x20')]();});}};}function handleEntityNotFound(_0x5ca6f7,_0x313edd){return function(_0x5437f6){if(!_0x5437f6){_0x5ca6f7[_0xa5d0('0x1e')](0x194);}return _0x5437f6;};}function handleError(_0x48b0b8,_0x3ab3d5){_0x3ab3d5=_0x3ab3d5||0x1f4;return function(_0xc3336f){logger[_0xa5d0('0x2d')](_0xc3336f['stack']);if(_0xc3336f['name']){delete _0xc3336f['name'];}_0x48b0b8[_0xa5d0('0x1f')](_0x3ab3d5)[_0xa5d0('0x2e')](_0xc3336f);};}exports[_0xa5d0('0x2f')]=function(_0x223200,_0x5e876c){var _0xb84ec4={},_0xa0ae78={},_0x5183b7={'count':0x0,'rows':[]};var _0xfdad6a=_[_0xa5d0('0x30')](db[_0xa5d0('0x31')][_0xa5d0('0x32')],function(_0x1159d1){return{'name':_0x1159d1[_0xa5d0('0x33')],'type':_0x1159d1[_0xa5d0('0x34')][_0xa5d0('0x35')]};});_0xa0ae78[_0xa5d0('0x36')]=_[_0xa5d0('0x30')](_0xfdad6a,_0xa5d0('0x37'));_0xa0ae78['query']=_[_0xa5d0('0x38')](_0x223200[_0xa5d0('0x39')]);_0xa0ae78[_0xa5d0('0x3a')]=_[_0xa5d0('0x3b')](_0xa0ae78['model'],_0xa0ae78[_0xa5d0('0x39')]);_0xb84ec4[_0xa5d0('0x3c')]=_['intersection'](_0xa0ae78[_0xa5d0('0x36')],qs['fields'](_0x223200[_0xa5d0('0x39')][_0xa5d0('0x3d')]));_0xb84ec4['attributes']=_0xb84ec4['attributes']['length']?_0xb84ec4[_0xa5d0('0x3c')]:_0xa0ae78['model'];if(!_0x223200[_0xa5d0('0x39')][_0xa5d0('0x3e')]('nolimit')){_0xb84ec4[_0xa5d0('0x23')]=qs[_0xa5d0('0x23')](_0x223200[_0xa5d0('0x39')][_0xa5d0('0x23')]);_0xb84ec4[_0xa5d0('0x22')]=qs[_0xa5d0('0x22')](_0x223200[_0xa5d0('0x39')][_0xa5d0('0x22')]);}_0xb84ec4[_0xa5d0('0x3f')]=qs[_0xa5d0('0x40')](_0x223200[_0xa5d0('0x39')][_0xa5d0('0x40')]);_0xb84ec4['where']=qs[_0xa5d0('0x3a')](_['pick'](_0x223200[_0xa5d0('0x39')],_0xa0ae78[_0xa5d0('0x3a')]),_0xfdad6a);if(_0x223200[_0xa5d0('0x39')][_0xa5d0('0x41')]){_0xb84ec4[_0xa5d0('0x42')]=_[_0xa5d0('0x43')](_0xb84ec4['where'],{'$or':_[_0xa5d0('0x30')](_0xfdad6a,function(_0x5dbe9b){if(_0x5dbe9b[_0xa5d0('0x34')]!=='VIRTUAL'){var _0x5c2839={};_0x5c2839[_0x5dbe9b[_0xa5d0('0x37')]]={'$like':'%'+_0x223200[_0xa5d0('0x39')][_0xa5d0('0x41')]+'%'};return _0x5c2839;}})});}_0xb84ec4=_[_0xa5d0('0x43')]({},_0xb84ec4,_0x223200['options']);var _0x38f85a={'where':_0xb84ec4[_0xa5d0('0x42')]};return db[_0xa5d0('0x31')][_0xa5d0('0x25')](_0x38f85a)[_0xa5d0('0x2c')](function(_0x26d37f){_0x5183b7[_0xa5d0('0x25')]=_0x26d37f;if(_0x223200['query'][_0xa5d0('0x44')]){_0xb84ec4[_0xa5d0('0x45')]=[{'all':!![]}];}return db[_0xa5d0('0x31')][_0xa5d0('0x46')](_0xb84ec4);})[_0xa5d0('0x2c')](function(_0x358b23){_0x5183b7[_0xa5d0('0x47')]=_0x358b23;return _0x5183b7;})[_0xa5d0('0x2c')](respondWithFilteredResult(_0x5e876c,_0xb84ec4))['catch'](handleError(_0x5e876c,null));};exports[_0xa5d0('0x48')]=function(_0x5b901c,_0x1d58a4){var _0x556e2e={'raw':![],'where':{'id':_0x5b901c['params']['id']}},_0x1c1336={};_0x1c1336[_0xa5d0('0x36')]=_['keys'](db[_0xa5d0('0x31')][_0xa5d0('0x32')]);_0x1c1336['query']=_[_0xa5d0('0x38')](_0x5b901c[_0xa5d0('0x39')]);_0x1c1336[_0xa5d0('0x3a')]=_[_0xa5d0('0x3b')](_0x1c1336['model'],_0x1c1336['query']);_0x556e2e[_0xa5d0('0x3c')]=_[_0xa5d0('0x3b')](_0x1c1336[_0xa5d0('0x36')],qs[_0xa5d0('0x3d')](_0x5b901c['query']['fields']));_0x556e2e[_0xa5d0('0x3c')]=_0x556e2e[_0xa5d0('0x3c')][_0xa5d0('0x49')]?_0x556e2e[_0xa5d0('0x3c')]:_0x1c1336[_0xa5d0('0x36')];if(_0x5b901c['query']['includeAll']){_0x556e2e[_0xa5d0('0x45')]=[{'all':!![]}];}_0x556e2e=_[_0xa5d0('0x43')]({},_0x556e2e,_0x5b901c[_0xa5d0('0x4a')]);return db[_0xa5d0('0x31')][_0xa5d0('0x4b')](_0x556e2e)[_0xa5d0('0x2c')](handleEntityNotFound(_0x1d58a4,null))[_0xa5d0('0x2c')](respondWithResult(_0x1d58a4,null))[_0xa5d0('0x4c')](handleError(_0x1d58a4,null));};exports[_0xa5d0('0x4d')]=function(_0xbb7c45,_0x555ec8){return db[_0xa5d0('0x31')]['create'](_0xbb7c45[_0xa5d0('0x4e')],{})[_0xa5d0('0x2c')](respondWithResult(_0x555ec8,0xc9))['catch'](handleError(_0x555ec8,null));};exports[_0xa5d0('0x4f')]=function(_0xbb1f26,_0x1e87e7){var _0x2e9328={'where':{'id':_0xbb1f26['params']['id']}},_0x241423={};_0x241423[_0xa5d0('0x36')]=_[_0xa5d0('0x38')](db[_0xa5d0('0x31')][_0xa5d0('0x32')]);_0x2e9328[_0xa5d0('0x3c')]=_[_0xa5d0('0x3b')](_0x241423['model'],qs['fields'](_0xbb1f26['query'][_0xa5d0('0x3d')]));_0x2e9328['attributes']=_0x2e9328[_0xa5d0('0x3c')][_0xa5d0('0x49')]?_0x2e9328[_0xa5d0('0x3c')]:_0x241423['model'];if(_0xbb1f26['query']['includeAll']){_0x2e9328[_0xa5d0('0x45')]=[{'all':!![]}];}_0x2e9328=_[_0xa5d0('0x43')]({},_0x2e9328,_0xbb1f26[_0xa5d0('0x4a')]);return db[_0xa5d0('0x31')][_0xa5d0('0x4b')](_0x2e9328)['then'](handleEntityNotFound(_0x1e87e7,null))[_0xa5d0('0x2c')](function(_0x189f79){if(_0x189f79){var _0x3aa5fe=_0x189f79[_0xa5d0('0x50')]({'plain':!![]});_0x3aa5fe=qs['omit'](_0x3aa5fe,['id',_0xa5d0('0x51'),'updatedAt',_0xa5d0('0x52')]);_0xbb1f26[_0xa5d0('0x4e')]=_[_0xa5d0('0x53')](_0xbb1f26[_0xa5d0('0x4e')],['id',_0xa5d0('0x51'),_0xa5d0('0x54')]);return db[_0xa5d0('0x55')][_0xa5d0('0x56')](function(_0x34c5ee){return db['UserProfile'][_0xa5d0('0x4d')](_[_0xa5d0('0x43')](_0x3aa5fe,_0xbb1f26[_0xa5d0('0x4e')]),{'include':_0xbb1f26['query'][_0xa5d0('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x34c5ee})[_0xa5d0('0x2c')](function(_0x52b82c){var _0x59f8ee=_0x52b82c[_0xa5d0('0x50')]({'plain':!![]});return db[_0xa5d0('0x57')][_0xa5d0('0x46')]({'where':{'userProfileId':_0xbb1f26['params']['id']},'raw':!![]})['then'](function(_0x387f27){if(_0x387f27){return BPromise[_0xa5d0('0x58')](_0x387f27,function(_0x27acd2){return new BPromise(function(_0xcc3b60,_0x542e51){if(_0x27acd2[_0xa5d0('0x59')]===null||_0x27acd2['autoAssociation']===0x1)_0xcc3b60(null);return db[_0xa5d0('0x5a')][_0xa5d0('0x46')]({'where':{'sectionId':_0x27acd2['id']},'raw':!![]})['then'](function(_0x5c65a0){var _0x24aad0=_['map'](_0x5c65a0,function(_0x34c9d9){return qs[_0xa5d0('0x53')](_0x34c9d9,['id',_0xa5d0('0x51'),_0xa5d0('0x54'),_0xa5d0('0x5b')]);});_0xcc3b60(_0x24aad0);})['catch'](function(_0x430099){_0x542e51(_0x430099);});})[_0xa5d0('0x2c')](function(_0x4e87e7){var _0x4339c7=qs[_0xa5d0('0x53')](_0x27acd2,['id',_0xa5d0('0x51'),_0xa5d0('0x54')]);_0x4339c7['userProfileId']=_0x59f8ee['id'];if(_0x4e87e7)_0x4339c7[_0xa5d0('0x5c')]=_0x4e87e7;return _0x4339c7;})['then'](function(_0x8c7ada){return db[_0xa5d0('0x57')][_0xa5d0('0x4d')](_0x8c7ada,{'include':[{'model':db[_0xa5d0('0x5a')],'as':_0xa5d0('0x5c')}],'raw':!![],'transaction':_0x34c5ee});});})[_0xa5d0('0x2c')](function(){return _0x59f8ee;});}});});});}})[_0xa5d0('0x2c')](respondWithResult(_0x1e87e7,0xc9))[_0xa5d0('0x4c')](handleError(_0x1e87e7,null));};exports['update']=function(_0x227ae7,_0x3ea714){if(_0x227ae7['body']['id']){delete _0x227ae7[_0xa5d0('0x4e')]['id'];}return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x227ae7[_0xa5d0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ea714,null))['then'](saveUpdates(_0x227ae7['body'],null))[_0xa5d0('0x2c')](respondWithResult(_0x3ea714,null))['catch'](handleError(_0x3ea714,null));};exports['destroy']=function(_0x147bd2,_0x4a3910){return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x147bd2[_0xa5d0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4a3910,null))['then'](removeEntity(_0x4a3910,null))['catch'](handleError(_0x4a3910,null));};exports[_0xa5d0('0x5e')]=function(_0x1103bf,_0x48de99){return db[_0xa5d0('0x31')][_0xa5d0('0x5e')]()['then'](respondWithResult(_0x48de99,null))[_0xa5d0('0x4c')](handleError(_0x48de99,null));};exports['addSections']=function(_0x57f778,_0x565cc6){var _0xd2dd69=_0x57f778[_0xa5d0('0x4e')];return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x57f778[_0xa5d0('0x5d')]['id']}})[_0xa5d0('0x2c')](handleEntityNotFound(_0x565cc6,null))[_0xa5d0('0x2c')](function(_0x538405){if(_0x538405){return db[_0xa5d0('0x55')][_0xa5d0('0x56')](function(_0x24a3e8){return db[_0xa5d0('0x57')][_0xa5d0('0x5f')]({'where':{'userProfileId':_0x57f778['params']['id'],'sectionId':_[_0xa5d0('0x30')](_0xd2dd69,function(_0x1f54cf){return _0x1f54cf['sectionId'];})},'transaction':_0x24a3e8})[_0xa5d0('0x2c')](function(){var _0x3adf0d=_[_0xa5d0('0x30')](_0xd2dd69,function(_0x328160){_0x328160[_0xa5d0('0x60')]=_0x57f778[_0xa5d0('0x5d')]['id'];return _0x328160;});var _0x2b9e93=[];return BPromise[_0xa5d0('0x58')](_0x3adf0d,function(_0x4fc50c){return db['UserProfileSection'][_0xa5d0('0x4d')](_0x4fc50c,{'include':[{'model':db[_0xa5d0('0x5a')],'as':_0xa5d0('0x5c')}],'raw':!![],'transaction':_0x24a3e8})[_0xa5d0('0x2c')](function(_0x349e5c){_0x2b9e93['push'](_0x349e5c[_0xa5d0('0x50')]({'plain':!![]}));});})['then'](function(){return _0x2b9e93;});});});}})[_0xa5d0('0x2c')](function(_0x5c3f6e){return _0x5c3f6e;})[_0xa5d0('0x2c')](respondWithResult(_0x565cc6,null))[_0xa5d0('0x4c')](handleError(_0x565cc6,null));};exports[_0xa5d0('0x61')]=function(_0x3a364c,_0x22b432){var _0x9226f3;return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x3a364c[_0xa5d0('0x5d')]['id']},'attributes':['id','name']})[_0xa5d0('0x2c')](handleEntityNotFound(_0x22b432,null))[_0xa5d0('0x2c')](function(_0x4a6a19){if(_0x4a6a19){_0x9226f3=_0x4a6a19;return db[_0xa5d0('0x57')][_0xa5d0('0x5f')]({'where':{'userProfileId':_0x3a364c['params']['id'],'sectionId':_0x3a364c[_0xa5d0('0x39')][_0xa5d0('0x62')]}});}})['then'](function(){return _0x9226f3;})[_0xa5d0('0x2c')](respondWithStatusCode(_0x22b432,null))['catch'](handleError(_0x22b432,null));};exports['getSections']=function(_0x3ee4e8,_0x906c66){var _0x5b2103=[];var _0x5edfc8=[];return db[_0xa5d0('0x57')][_0xa5d0('0x46')]({'where':{'userProfileId':_0x3ee4e8['params']['id']},'raw':!![]})[_0xa5d0('0x2c')](function(_0x2bc99e){_0x5b2103=_[_0xa5d0('0x41')](_0x2bc99e,function(_0x1b656f){return _0x1b656f[_0xa5d0('0x63')]===0x1||_[_0xa5d0('0x64')]([0x3eb,0x709],_0x1b656f[_0xa5d0('0x5b')]);});if(!_[_0xa5d0('0x65')](_0x5b2103)){return _[_0xa5d0('0x30')](_0x5b2103,function(_0x151dce){return _0x151dce[_0xa5d0('0x5b')];});}else{return;}})[_0xa5d0('0x2c')](function(_0x39b31d){if(_0x39b31d)_0x5edfc8=_0x39b31d;if(_[_0xa5d0('0x64')](_0x5edfc8,0x64)){var _0x2b4cac=_[_0xa5d0('0x4b')](_0x5b2103,{'sectionId':0x64});return hasDefaultDashboard(_0x2b4cac)['then'](function(_0x2e4a95){return _[_0xa5d0('0x30')](_0x5b2103,function(_0x536ff5){if(_0x536ff5['sectionId']===0x64){_0x536ff5[_0xa5d0('0x66')]=_0x2e4a95;}return _0x536ff5;});});}else{return;}})['then'](function(_0x330a2a){if(_0x330a2a)_0x5b2103=_0x330a2a;if(_[_0xa5d0('0x64')](_0x5edfc8,0x3eb)){var _0x33b7f2=_[_0xa5d0('0x4b')](_0x5b2103,{'sectionId':0x3eb});return getCustomDashboards(_0x33b7f2)[_0xa5d0('0x2c')](function(_0x205573){return _[_0xa5d0('0x30')](_0x5b2103,function(_0x22ba58){if(_0x33b7f2[_0xa5d0('0x63')]){if(_0x22ba58[_0xa5d0('0x5b')]===0x3eb){_0x22ba58['subsections']=_0x205573;}}else{if(_0x22ba58['sectionId']===0x64){_0x22ba58[_0xa5d0('0x66')]=_0x205573;}}return _0x22ba58;});});}else{return;}})['then'](function(_0x2d400c){if(_0x2d400c)_0x5b2103=_0x2d400c;if(_[_0xa5d0('0x64')](_0x5edfc8,0x709)){var _0x3b729a=_[_0xa5d0('0x4b')](_0x5b2103,{'sectionId':0x709});return getPlugins(_0x3b729a)[_0xa5d0('0x2c')](function(_0x109fbc){if(_0x3b729a['enabled']){return _[_0xa5d0('0x30')](_0x5b2103,function(_0x2aebd2){if(_0x2aebd2[_0xa5d0('0x5b')]===0x709){_0x2aebd2['subsections']=_0x109fbc;}return _0x2aebd2;});}else{var _0x3c034d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x109fbc};var _0xa11d1d=_[_0xa5d0('0x30')](_0x5b2103);_0xa11d1d[_0xa5d0('0x67')](_0x3c034d);return _0xa11d1d;}});}else{return;}})[_0xa5d0('0x2c')](function(_0x35bd19){if(_0x35bd19)_0x5b2103=_0x35bd19;return _['filter'](_0x5b2103,[_0xa5d0('0x63'),0x1]);})[_0xa5d0('0x2c')](respondWithResult(_0x906c66,null))['catch'](handleError(_0x906c66,null));};function hasDefaultDashboard(_0x543242){var _0x48547e=[0x65];return new BPromise(function(_0x361c6d,_0x418770){try{if(_0x543242[_0xa5d0('0x59')]){_0x361c6d(_0x48547e);}else{return db[_0xa5d0('0x5a')][_0xa5d0('0x68')]({'where':{'sectionId':_0x543242['id']},'raw':!![]})[_0xa5d0('0x2c')](function(_0x4b51bc){_0x4b51bc?_0x361c6d(_0x48547e):_0x361c6d();});}}catch(_0x41902e){_0x418770(_0x41902e);}});}function getCustomDashboards(_0x2292c5){var _0x31bf8a=[];return new BPromise(function(_0x40db70,_0x374207){try{if(_0x2292c5[_0xa5d0('0x59')]){return db[_0xa5d0('0x69')]['findAll']({'raw':!![]})['then'](function(_0x307289){_0x307289[_0xa5d0('0x6a')](function(_0x5043b8){_0x31bf8a[_0xa5d0('0x67')](_0x5043b8['id']+0x1869f);});_0x40db70(_0x31bf8a);});}else{return db[_0xa5d0('0x5a')][_0xa5d0('0x46')]({'where':{'sectionId':_0x2292c5['id']},'raw':!![]})[_0xa5d0('0x2c')](function(_0x58dca8){_0x58dca8['forEach'](function(_0x32afbb){_0x31bf8a[_0xa5d0('0x67')](_0x32afbb[_0xa5d0('0x6b')]+0x1869f);});_0x40db70(_0x31bf8a);});}}catch(_0x45e160){_0x374207(_0x45e160);}});}function getPlugins(_0x3933b0){var _0x22d635=[];return new BPromise(function(_0x136456,_0x5f091b){try{if(_0x3933b0[_0xa5d0('0x59')]){return db['Plugin']['findAll']({'raw':!![]})[_0xa5d0('0x2c')](function(_0x44ecc4){_0x44ecc4[_0xa5d0('0x6a')](function(_0x5c7caf){_0x22d635[_0xa5d0('0x67')](_0x5c7caf['id']+0x15b38);});_0x136456(_0x22d635);});}else{return db['UserProfileResource'][_0xa5d0('0x46')]({'where':{'sectionId':_0x3933b0['id']},'raw':!![]})[_0xa5d0('0x2c')](function(_0x1de657){_0x1de657[_0xa5d0('0x6a')](function(_0x43feb5){_0x22d635['push'](_0x43feb5[_0xa5d0('0x6b')]+0x15b38);});_0x136456(_0x22d635);});}}catch(_0x4ab3b8){_0x5f091b(_0x4ab3b8);}});}exports['addResources']=function(_0x138768,_0x57705f){return db['UserProfile'][_0xa5d0('0x4b')]({'where':{'id':_0x138768[_0xa5d0('0x5d')]['id']}})[_0xa5d0('0x2c')](handleEntityNotFound(_0x57705f,null))[_0xa5d0('0x2c')](function(_0x322637){if(_0x322637){return db[_0xa5d0('0x55')][_0xa5d0('0x56')](function(_0x217009){return db[_0xa5d0('0x57')][_0xa5d0('0x46')]({'where':{'userProfileId':_0x138768[_0xa5d0('0x5d')]['id']},'attributes':['id'],'raw':!![]})[_0xa5d0('0x2c')](function(_0x170c87){if(_0x170c87){return db[_0xa5d0('0x57')][_0xa5d0('0x5f')]({'where':{'userProfileId':_0x138768['params']['id'],'id':_[_0xa5d0('0x30')](_0x170c87,function(_0x2b2b07){return _0x2b2b07['id'];})},'transaction':_0x217009});}})['then'](function(_0x112676){var _0xc639b0=_[_0xa5d0('0x30')](_0x138768[_0xa5d0('0x4e')],function(_0xadf013){_0xadf013['userProfileId']=_0x138768[_0xa5d0('0x5d')]['id'];return _0xadf013;});return db[_0xa5d0('0x57')][_0xa5d0('0x6c')](_0xc639b0,{'raw':!![],'transaction':_0x217009});})[_0xa5d0('0x2c')](function(_0x52cd06){var _0x32e6d2=_[_0xa5d0('0x41')](_['map'](_0x52cd06,function(_0x103707){return _0x103707['get']({'plain':!![]});}),{'includeAll':![]});if(_0x32e6d2){return db[_0xa5d0('0x57')][_0xa5d0('0x46')]({'where':{'userProfileId':_0x138768['params']['id'],'sectionId':_[_0xa5d0('0x30')](_0x32e6d2,function(_0x58532c){return _0x58532c['sectionId'];})},'attributes':['id',_0xa5d0('0x5b')],'raw':!![]})[_0xa5d0('0x2c')](function(_0x164243){var _0x190713=_[_0xa5d0('0x30')](_0x138768[_0xa5d0('0x4e')],function(_0x3adc25){_0x3adc25[_0xa5d0('0x60')]=_0x138768[_0xa5d0('0x5d')]['id'];return _0x3adc25;});return db['UserProfileResource'][_0xa5d0('0x6c')](_0x190713,{'raw':!![],'transaction':_0x217009});});}})['catch'](handleError(_0x57705f,null));});}})[_0xa5d0('0x2c')](function(_0x41f44b){var _0x391b23=_[_0xa5d0('0x30')](_0x41f44b,function(_0x116060){return _0x116060[_0xa5d0('0x50')]({'plain':!![]});});})[_0xa5d0('0x2c')](respondWithResult(_0x57705f,null))[_0xa5d0('0x4c')](handleError(_0x57705f,null));};exports['removeResources']=function(_0x4b3705,_0x570171,_0x47cfa1){return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x4b3705[_0xa5d0('0x5d')]['id']}})[_0xa5d0('0x2c')](handleEntityNotFound(_0x570171,null))[_0xa5d0('0x2c')](function(_0x431470){if(_0x431470){return _0x431470[_0xa5d0('0x6d')](_0x4b3705[_0xa5d0('0x39')][_0xa5d0('0x62')]);}})[_0xa5d0('0x2c')](respondWithStatusCode(_0x570171,null))[_0xa5d0('0x4c')](handleError(_0x570171,null));};exports[_0xa5d0('0x6e')]=function(_0x1db4f5,_0x3ecdea){var _0x4533db={};if(!_0x1db4f5[_0xa5d0('0x39')][_0xa5d0('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x1db4f5['query']['hasOwnProperty'](_0xa5d0('0x70'))){_0x4533db[_0xa5d0('0x23')]=qs['limit'](_0x1db4f5[_0xa5d0('0x39')]['limit']);_0x4533db['offset']=qs[_0xa5d0('0x22')](_0x1db4f5[_0xa5d0('0x39')]['offset']);}return db[_0xa5d0('0x31')][_0xa5d0('0x4b')]({'where':{'id':_0x1db4f5[_0xa5d0('0x5d')]['id']}})[_0xa5d0('0x2c')](function(_0x555955){if(!_0x555955)throw new Error(_0xa5d0('0x71')+_0x1db4f5[_0xa5d0('0x5d')]['id']);return db[_0xa5d0('0x31')]['getResources'](_0x1db4f5);})['then'](respondWithFilteredResult(_0x3ecdea,_0x4533db))[_0xa5d0('0x4c')](handleError(_0x3ecdea,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2ca6918..b451ca9 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 _0x7096=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x3cca8f,_0x3e3a0e){var _0x3ca038=function(_0x833601){while(--_0x833601){_0x3cca8f['push'](_0x3cca8f['shift']());}};_0x3ca038(++_0x3e3a0e);}(_0x7096,0x10c));var _0x6709=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7096[_0x5608a3];return _0x1ed50a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x6709('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6709('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6709('0x2'),'afterDestroy':_0x6709('0x3')};function emitEvent(_0x3e85e4){return function(_0xccdcb5,_0x3cd087,_0x3c8599){UserProfileEvents[_0x6709('0x4')](_0x3e85e4+':'+_0xccdcb5['id'],_0xccdcb5);UserProfileEvents[_0x6709('0x4')](_0x3e85e4,_0xccdcb5);_0x3c8599(null);};}for(var e in events){if(events[_0x6709('0x5')](e)){var event=events[e];UserProfile[_0x6709('0x6')](e,emitEvent(event));}}module[_0x6709('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x9bd9=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x247086,_0x577bad){var _0x59be5e=function(_0x1f6abe){while(--_0x1f6abe){_0x247086['push'](_0x247086['shift']());}};_0x59be5e(++_0x577bad);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x9bd9[_0x20118a];return _0x538b5f;};'use strict';var EventEmitter=require(_0x99bd('0x0'));var UserProfile=require(_0x99bd('0x1'))['db'][_0x99bd('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x99bd('0x3')](0x0);var events={'afterCreate':_0x99bd('0x4'),'afterUpdate':_0x99bd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34aff7){return function(_0x4a0491,_0x204fbb,_0x1b3141){UserProfileEvents['emit'](_0x34aff7+':'+_0x4a0491['id'],_0x4a0491);UserProfileEvents[_0x99bd('0x6')](_0x34aff7,_0x4a0491);_0x1b3141(null);};}for(var e in events){if(events[_0x99bd('0x7')](e)){var event=events[e];UserProfile[_0x99bd('0x8')](e,emitEvent(event));}}module[_0x99bd('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index bb63cc6..14a2091 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 _0xd943=['contacts','parentSections','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','intervals','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','DefaultReports','count','ids','CmContact','Tags','color','ThroughTags','tag','openTabs','true','rows','chat','dataValues','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','field','filter','then','associatedResources','catch','value','model','name','UserProfileResource','findAll','AnalyticExtractedReport','map','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject'];(function(_0x352faf,_0x2ff7dd){var _0x17b07f=function(_0x431fa3){while(--_0x431fa3){_0x352faf['push'](_0x352faf['shift']());}};_0x17b07f(++_0x2ff7dd);}(_0xd943,0x15d));var _0x3d94=function(_0x26b542,_0x1f64c2){_0x26b542=_0x26b542-0x0;var _0x130b99=_0xd943[_0x26b542];return _0x130b99;};'use strict';var _=require(_0x3d94('0x0'));var attributes=require(_0x3d94('0x1'));var qs=require(_0x3d94('0x2'));var squel=require(_0x3d94('0x3'));module['exports']=function(_0x691e28){var _0x3edd1b=_0x691e28[_0x3d94('0x4')];function _0xc13b61(_0xaf8962,_0x5751f6){return new Promise(function(_0x54e692,_0x34c9c3){if(!_0x5751f6)return _0x54e692(null);var _0x51cf1f=_0x5751f6['filter']?{[_0x5751f6['filter'][_0x3d94('0x5')]]:_0x5751f6[_0x3d94('0x6')]['value']}:undefined;return _0x3edd1b[_0xaf8962]['findAll']({'where':_0x51cf1f,'raw':!![]})[_0x3d94('0x7')](function(_0x27e381){_0x5751f6[_0x3d94('0x8')]=_['map'](_0x27e381,'id');_0x54e692(_0x5751f6);})[_0x3d94('0x9')](function(_0x4ac968){_0x34c9c3(_0x4ac968);});});}function _0x39e2fa(_0x301536,_0x5f5041){return new Promise(function(_0x1897de,_0xe5c5fb){var _0x203aa0=_0x301536[_0x3d94('0x6')]?{[_0x301536[_0x3d94('0x6')]['field']]:_0x301536[_0x3d94('0x6')][_0x3d94('0xa')]}:undefined;return _0x3edd1b[_0x301536[_0x3d94('0xb')]]['findAll']({'where':_0x203aa0,'raw':!![]})[_0x3d94('0x7')](function(_0x29608d){_0x5f5041[_0x3d94('0x8')]=_['map'](_0x29608d,function(_0x14ea5f){return _0x14ea5f[_0x3d94('0xc')];});_0x1897de(_0x5f5041);})[_0x3d94('0x9')](function(_0x34098e){_0xe5c5fb(_0x34098e);});});}function _0xaf939a(_0xd8efaa,_0x31c6e8,_0x9893cb){if(!_0x31c6e8)return Promise['resolve'](null);return new Promise(function(_0x22676a,_0x1a9315){return _0x3edd1b[_0x3d94('0xd')][_0x3d94('0xe')]({'where':{'sectionId':_0x31c6e8['id']},'raw':!![]})[_0x3d94('0x7')](function(_0x3ca0e3){if(_0xd8efaa[_0x3d94('0x5')]&&_0xd8efaa['field']!=='id'){_0x31c6e8[_0x3d94('0x8')]=_['map'](_0x3ca0e3,function(_0x28bead){return _0x28bead[_0xd8efaa[_0x3d94('0x5')]];});}else{if(_0x9893cb===_0x3d94('0xf')){_0x31c6e8[_0x3d94('0x8')]=_[_0x3d94('0x10')](_0x3ca0e3,function(_0x4f0beb){return{'id':_0x4f0beb['resourceId'],'type':_0x4f0beb[_0x3d94('0x11')]};});}else{_0x31c6e8[_0x3d94('0x8')]=_[_0x3d94('0x10')](_0x3ca0e3,function(_0x4edee4){return _0x4edee4[_0x3d94('0x12')];});}}_0x22676a(_0x31c6e8);})[_0x3d94('0x9')](function(_0x123adc){_0x1a9315(_0x123adc);});});}function _0x384f76(_0x395133,_0x4093a4){var _0x295493={'parentSections':[]};switch(_0x395133[_0x3d94('0x13')]()){case _0x3d94('0x14'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x16');break;case _0x3d94('0x17'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x18');break;case _0x3d94('0x19'):_0x295493['childModel']=_0x3d94('0x1a');_0x295493['parentSections']=[{'name':_0x3d94('0x1b'),'field':_0x3d94('0xc'),'foreignKey':_0x3d94('0x1c')}];break;case _0x3d94('0x1d'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x1e');break;case _0x3d94('0x1f'):_0x295493['childModel']='CmContact';_0x295493[_0x3d94('0x20')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x3d94('0x21'):_0x295493['childModel']=_0x3d94('0x22');break;case _0x3d94('0x23'):_0x295493[_0x3d94('0x15')]='CmCompany';break;case _0x3d94('0x24'):_0x295493['childModel']=_0x3d94('0x25');break;case'chatqueues':_0x295493[_0x3d94('0x15')]=_0x3d94('0x26');break;case _0x3d94('0x27'):_0x295493[_0x3d94('0x15')]='ChatWebsite';break;case _0x3d94('0x28'):_0x295493['childModel']=_0x3d94('0x29');break;case _0x3d94('0x2a'):_0x295493['childModel']='FaxAccount';break;case _0x3d94('0x2b'):case _0x3d94('0x2c'):case _0x3d94('0x2d'):_0x295493['childModel']=_0x3d94('0x2e');break;case _0x3d94('0x2f'):_0x295493['childModel']=_0x3d94('0x30');break;case _0x3d94('0x31'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x32');break;case _0x3d94('0x33'):_0x295493['childModel']=_0x3d94('0x34');_0x295493[_0x3d94('0x20')]=[{'name':_0x3d94('0x35'),'field':_0x3d94('0xc'),'foreignKey':_0x3d94('0x36'),'model':_0x3d94('0x37'),'filter':{'field':'role','value':['agent']}},{'name':_0x3d94('0x38'),'field':_0x3d94('0xc'),'foreignKey':_0x3d94('0x36'),'model':_0x3d94('0x37'),'filter':{'field':_0x3d94('0x39'),'value':[_0x3d94('0x3a')]}},{'name':_0x3d94('0x3b'),'field':_0x3d94('0xc'),'foreignKey':_0x3d94('0x3c'),'model':_0x3d94('0x3d'),'filter':{'field':'type','value':[_0x3d94('0x3e')]}},{'name':_0x3d94('0x3f'),'field':_0x3d94('0xc'),'foreignKey':_0x3d94('0x3c'),'model':'VoiceQueue','filter':{'field':_0x3d94('0x11'),'value':[_0x3d94('0x40')]}}];break;case _0x3d94('0x41'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x42');break;case'chanspies':_0x295493[_0x3d94('0x15')]=_0x3d94('0x43');break;case _0x3d94('0x44'):_0x295493['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x295493['childModel']=_0x3d94('0x45');break;case _0x3d94('0x46'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x47');break;case _0x3d94('0x48'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x49');break;case'mailsubstatuses':_0x295493['childModel']=_0x3d94('0x4a');break;case _0x3d94('0x4b'):_0x295493['childModel']=_0x3d94('0x4c');break;case'openchannelaccounts':_0x295493[_0x3d94('0x15')]=_0x3d94('0x4d');break;case _0x3d94('0x4e'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x4f');break;case'smsaccounts':_0x295493[_0x3d94('0x15')]=_0x3d94('0x50');break;case _0x3d94('0x51'):_0x295493['childModel']=_0x3d94('0x52');break;case'whatsappaccounts':_0x295493['childModel']=_0x3d94('0x53');break;case _0x3d94('0x54'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x55');break;case'voicequeues':case _0x3d94('0x56'):_0x295493['childModel']=_0x3d94('0x3d');if(_0x4093a4){_0x295493[_0x3d94('0x20')]=[{'name':_0x3d94('0x3b')},{'name':_0x3d94('0x3f')}];}break;case _0x3d94('0x57'):case _0x3d94('0x58'):case _0x3d94('0x59'):_0x295493['childModel']=_0x3d94('0x37');if(_0x4093a4){_0x295493[_0x3d94('0x20')]=[{'name':'Users','filter':{'field':'role','value':[_0x3d94('0x5a'),_0x3d94('0x5b')]},'ignore':!![]},{'name':'Agents'},{'name':_0x3d94('0x38')}];}break;case _0x3d94('0x5c'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x5d');break;case _0x3d94('0x5e'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x5f');break;case _0x3d94('0x60'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x61');break;case _0x3d94('0x62'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x63');break;case _0x3d94('0x64'):_0x295493[_0x3d94('0x15')]='DeskAccount';break;case _0x3d94('0x65'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x66');break;case _0x3d94('0x67'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x37');break;case _0x3d94('0x68'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x69');break;case'dispositions':_0x295493[_0x3d94('0x15')]='Disposition';break;case _0x3d94('0x6a'):_0x295493[_0x3d94('0x15')]='Dashboard';break;case _0x3d94('0x6b'):_0x295493['childModel']='Interval';break;case _0x3d94('0x6c'):_0x295493['childModel']=_0x3d94('0x6d');break;case _0x3d94('0x6e'):_0x295493['childModel']=_0x3d94('0x6f');break;case'sounds':_0x295493['childModel']=_0x3d94('0x70');break;case _0x3d94('0x71'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x72');break;case _0x3d94('0x73'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x74');break;case _0x3d94('0x75'):_0x295493[_0x3d94('0x15')]='Trigger';break;case _0x3d94('0x76'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x77');break;case _0x3d94('0x78'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x79');break;case _0x3d94('0x7a'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x7b');break;case _0x3d94('0x7c'):_0x295493[_0x3d94('0x15')]='AnalyticExtractedReport';_0x295493[_0x3d94('0x20')]=[{'name':'Reports','field':'id','foreignKey':_0x3d94('0x7d')}];break;case _0x3d94('0x7e'):_0x295493[_0x3d94('0x15')]=_0x3d94('0x7f');break;}return _0x295493;}function _0x3a837b(_0x36428e,_0x1c503d){var _0x169aa1=_0x36428e[_0x3d94('0x80')](0x0)['toUpperCase']()+_0x36428e['slice'](0x1);var _0x46bff3={'type':_0x3edd1b['Sequelize'][_0x3d94('0x81')][_0x3d94('0x82')],'raw':!![]};return new Promise(function(_0x557bb4,_0x211f0e){var _0x2d3fdd=squel[_0x3d94('0x83')]()[_0x3d94('0x5')](_0x3d94('0x84')+_0x169aa1+_0x3d94('0x85'),'id')[_0x3d94('0x5')]('ui.createdAt')[_0x3d94('0x86')](_0x3d94('0x87')+_0x36428e+_0x3d94('0x88'),'ui')['where'](_0x3d94('0x89'),_0x1c503d['id']);return _0x3edd1b[_0x3d94('0x8a')][_0x3d94('0x8b')](_0x2d3fdd[_0x3d94('0x8c')](),_0x46bff3)['then'](function(_0x5292cc){_0x1c503d[_0x169aa1+_0x3d94('0x8d')]=_0x5292cc;_0x557bb4(_0x5292cc);})[_0x3d94('0x9')](function(_0x4190ef){_0x211f0e(_0x4190ef);});});}return _0x691e28[_0x3d94('0x8e')]('UserProfile',attributes,{'tableName':_0x3d94('0x8f'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1c99d1){var _0x49bfb0={'raw':_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0x90')],'where':{}};var _0x336e36={};var _0x4eee2b={'count':0x0,'rows':[]};var _0x3135f3=_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0x91')];var _0x5747a8=_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0x92')]||![];var _0x5c7aac=_0x384f76(_0x3135f3,_0x5747a8);if(!_0x5c7aac['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x3135f3+'\x27');var _0x3ac9ea=[{'name':_0x3135f3}];if(!_[_0x3d94('0x93')](_0x5c7aac[_0x3d94('0x20')]))_0x3ac9ea=_0x5c7aac[_0x3d94('0x20')];var _0x196ed6=[];for(var _0x4ecfa2=0x0;_0x4ecfa2<_0x3ac9ea[_0x3d94('0x94')];_0x4ecfa2++){_0x196ed6[_0x3d94('0x95')](_0x3edd1b[_0x3d94('0x96')][_0x3d94('0x97')]({'where':{'userProfileId':_0x1c99d1[_0x3d94('0x98')]['id'],'name':_0x3ac9ea[_0x4ecfa2][_0x3d94('0xc')]},'raw':!![]}));}return Promise['all'](_0x196ed6)[_0x3d94('0x7')](function(_0x4b6838){var _0x1f3551=_[_0x3d94('0x6')](_0x4b6838,function(_0x437fff){return _0x437fff?_0x437fff:undefined;});var _0x393ac9=_[_0x3d94('0x6')](_0x3ac9ea,[_0x3d94('0x99'),!![]]);var _0x48b108=_['isEmpty'](_0x1f3551)&&_[_0x3d94('0x93')](_0x393ac9)?null:_['union'](_0x393ac9,_0x1f3551);if(!_0x48b108)return null;var _0x56b5dc=[];for(var _0x5c5fb2=0x0;_0x5c5fb2<_0x48b108[_0x3d94('0x94')];_0x5c5fb2++){var _0x262a6a=_[_0x3d94('0x97')](_0x3ac9ea,function(_0x396146){return _0x48b108[_0x5c5fb2]?_0x396146[_0x3d94('0xc')]===_0x48b108[_0x5c5fb2][_0x3d94('0xc')]:null;});if(_0x262a6a){if(_0x48b108[_0x5c5fb2][_0x3d94('0x99')]){_0x56b5dc[_0x3d94('0x95')](_0xc13b61(_0x5c7aac['childModel'],_0x48b108[_0x5c5fb2]));}else{if(!_0x48b108[_0x5c5fb2][_0x3d94('0x9a')]){_0x56b5dc['push'](_0xaf939a(_0x262a6a,_0x48b108[_0x5c5fb2],_0x5c7aac[_0x3d94('0x15')]));}else{if(_0x262a6a[_0x3d94('0xb')]){_0x56b5dc[_0x3d94('0x95')](_0x39e2fa(_0x262a6a,_0x48b108[_0x5c5fb2]));}}}}}return Promise['all'](_0x56b5dc);})['then'](function(_0x4f0f84){var _0x426ef5=_0x4f0f84;var _0x406098=null;if(_0x426ef5){_0x406098=_0x426ef5[_0x3d94('0x94')]===0x1?_0x426ef5[0x0]:null;}if(!_0x406098&&!_0x426ef5)return _0x4eee2b;var _0x1c7ea5=_0x3edd1b[_0x5c7aac[_0x3d94('0x15')]]['rawAttributes'];_0x336e36['model']=_[_0x3d94('0x9b')](_0x1c7ea5);_0x336e36[_0x3d94('0x8b')]=_[_0x3d94('0x9b')](_0x1c99d1['query']);_0x336e36[_0x3d94('0x9c')]=_['intersection'](_0x336e36[_0x3d94('0xb')],_0x336e36[_0x3d94('0x8b')]);_0x49bfb0[_0x3d94('0x9d')]=_[_0x3d94('0x9e')](_0x336e36[_0x3d94('0xb')],qs[_0x3d94('0x9f')](_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0x9f')]));_0x49bfb0[_0x3d94('0x9d')]=_0x49bfb0[_0x3d94('0x9d')][_0x3d94('0x94')]?_0x49bfb0[_0x3d94('0x9d')]:_0x336e36[_0x3d94('0xb')];if(!_0x1c99d1['query'][_0x3d94('0xa0')](_0x3d94('0xa1'))){_0x49bfb0[_0x3d94('0xa2')]=qs[_0x3d94('0xa2')](_0x1c99d1['query'][_0x3d94('0xa2')]);_0x49bfb0['offset']=qs['offset'](_0x1c99d1[_0x3d94('0x8b')]['offset']);}_0x49bfb0[_0x3d94('0xa3')]=qs[_0x3d94('0xa4')](_0x1c99d1['query'][_0x3d94('0xa4')]);_0x49bfb0['where']=qs[_0x3d94('0x9c')](_[_0x3d94('0xa5')](_0x1c99d1['query'],_0x336e36['filters']));if(_0x1c99d1['query'][_0x3d94('0x6')]){_0x49bfb0['where']=_['merge'](_0x49bfb0[_0x3d94('0xa6')],{'$or':_[_0x3d94('0x10')](_0x1c7ea5,function(_0x184c4b){if(_0x184c4b[_0x3d94('0x11')]['key']!==_0x3d94('0xa7')){var _0x3fc0e7={};_0x3fc0e7[_0x184c4b[_0x3d94('0x5')]]={'$like':'%'+_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0x6')]+'%'};return _0x3fc0e7;}})});}var _0x200cc2=[];var _0x53c0f0=null;var _0x467ccb={};if(_0x406098){_0x53c0f0=_[_0x3d94('0x97')](_0x3ac9ea,[_0x3d94('0xc'),_0x406098[_0x3d94('0xc')]]);if(_0x53c0f0[_0x3d94('0x5')]){_0x467ccb={};if(_0x5c7aac[_0x3d94('0x15')]===_0x3d94('0xf')){_0x467ccb[_0x53c0f0[_0x3d94('0xa8')]]=_['map'](_0x406098['associatedResources'],'id');}else{_0x467ccb[_0x53c0f0[_0x3d94('0xa8')]]=_0x406098[_0x3d94('0x8')];}_0x200cc2[_0x3d94('0x95')](_0x467ccb);}else{_0x49bfb0['where']['id']=_0x406098[_0x3d94('0x8')];}}else{for(var _0xa193a1=0x0;_0xa193a1<_0x426ef5[_0x3d94('0x94')];_0xa193a1++){_0x53c0f0=_[_0x3d94('0x97')](_0x3ac9ea,[_0x3d94('0xc'),_0x426ef5[_0xa193a1]['name']]);if(_0x53c0f0['field']){_0x467ccb={};_0x467ccb[_0x53c0f0[_0x3d94('0xa8')]]=_0x426ef5[_0xa193a1][_0x3d94('0x8')];_0x200cc2[_0x3d94('0x95')](_0x467ccb);}else{if(!_0x49bfb0[_0x3d94('0xa6')]['id'])_0x49bfb0[_0x3d94('0xa6')]['id']=[];_0x426ef5[_0xa193a1][_0x3d94('0x8')][_0x3d94('0xa9')](function(_0x3bcc86){_0x49bfb0[_0x3d94('0xa6')]['id'][_0x3d94('0x95')](_0x3bcc86);});}}}if(!_[_0x3d94('0x93')](_0x200cc2)){_0x49bfb0[_0x3d94('0xa6')]=_[_0x3d94('0xaa')](_0x49bfb0['where'],{'$and':{'$or':_0x200cc2}});}_0x49bfb0=_[_0x3d94('0xaa')]({},_0x49bfb0,_0x1c99d1[_0x3d94('0xab')]);if(_0x406098&&!_0x406098['autoAssociation']&&_0x5c7aac['childModel']===_0x3d94('0xf')){if(_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xac')]){_0x49bfb0[_0x3d94('0xad')]=[{'all':!![]}];}return _0x3edd1b[_0x5c7aac['childModel']]['findAll'](_0x49bfb0)[_0x3d94('0x7')](function(_0x2ec7d9){var _0x243db0=[];_0x2ec7d9[_0x3d94('0xa9')](function(_0x106b3b){var _0x5350a3;switch(_0x106b3b[_0x3d94('0xae')]){case'default':_0x5350a3=_[_0x3d94('0x97')](_0x406098[_0x3d94('0x8')],function(_0x472151){return _0x472151['id']===_0x106b3b['reportId']&&_0x472151[_0x3d94('0x11')]===_0x3d94('0xaf');});break;case'custom':_0x5350a3=_[_0x3d94('0x97')](_0x406098['associatedResources'],function(_0x3c62ec){return _0x3c62ec['id']===_0x106b3b[_0x3d94('0x7d')]&&_0x3c62ec[_0x3d94('0x11')]==='CustomReports';});break;}if(_0x5350a3)_0x243db0[_0x3d94('0x95')](_0x106b3b);});_0x4eee2b[_0x3d94('0xb0')]=_0x243db0[_0x3d94('0x94')];_0x4eee2b['rows']=_0x243db0;return _0x4eee2b;});}else{if(!_[_0x3d94('0x93')](_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xb1')])){_0x49bfb0[_0x3d94('0xa6')]['id']=_0x49bfb0[_0x3d94('0xa6')]['id']?_[_0x3d94('0x9e')](_0x49bfb0[_0x3d94('0xa6')]['id'],_0x1c99d1[_0x3d94('0x8b')]['ids']):_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xb1')];}return _0x3edd1b[_0x5c7aac[_0x3d94('0x15')]][_0x3d94('0xb0')]({'where':_0x49bfb0[_0x3d94('0xa6')]})[_0x3d94('0x7')](function(_0x5716fd){_0x4eee2b[_0x3d94('0xb0')]=_0x5716fd;if(_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xac')]){if(_0x5c7aac['childModel']===_0x3d94('0xb2')){_0x49bfb0['include']=[{'model':_0x3edd1b[_0x3d94('0x72')],'as':_0x3d94('0xb3'),'attributes':['id','name',_0x3d94('0xb4')],'required':_0x1c99d1[_0x3d94('0x8b')]['tag']?!![]:![]},{'model':_0x3edd1b['Tag'],'as':_0x3d94('0xb5'),'attributes':['id',_0x3d94('0xc'),'color'],'through':_0x1c99d1['query']['tag']?{'attributes':[],'where':{'TagId':_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xb6')]||undefined}}:{},'required':_0x1c99d1[_0x3d94('0x8b')][_0x3d94('0xb6')]?!![]:![]}];}else{_0x49bfb0[_0x3d94('0xad')]=[{'all':!![]}];}}return _0x3edd1b[_0x5c7aac['childModel']][_0x3d94('0xe')](_0x49bfb0);})[_0x3d94('0x7')](function(_0x239992){_0x4eee2b['rows']=_0x239992;if(_0x3135f3===_0x3d94('0x35')&&_0x1c99d1['query'][_0x3d94('0xb7')]===_0x3d94('0xb8')){var _0x25015e=[];for(var _0xbf625a=0x0;_0xbf625a<_0x4eee2b[_0x3d94('0xb9')]['length'];_0xbf625a++){_0x25015e['push'](_0x3a837b(_0x3d94('0xba'),_0x4eee2b[_0x3d94('0xb9')][_0xbf625a]['dataValues']));_0x25015e[_0x3d94('0x95')](_0x3a837b('sms',_0x4eee2b[_0x3d94('0xb9')][_0xbf625a][_0x3d94('0xbb')]));_0x25015e[_0x3d94('0x95')](_0x3a837b('fax',_0x4eee2b[_0x3d94('0xb9')][_0xbf625a]['dataValues']));_0x25015e[_0x3d94('0x95')](_0x3a837b(_0x3d94('0xbc'),_0x4eee2b[_0x3d94('0xb9')][_0xbf625a][_0x3d94('0xbb')]));_0x25015e['push'](_0x3a837b('openchannel',_0x4eee2b[_0x3d94('0xb9')][_0xbf625a][_0x3d94('0xbb')]));_0x25015e[_0x3d94('0x95')](_0x3a837b(_0x3d94('0xbd'),_0x4eee2b['rows'][_0xbf625a][_0x3d94('0xbb')]));}return Promise['all'](_0x25015e)['then'](function(){return _0x4eee2b;});}return _0x4eee2b;});}});}}});}; \ No newline at end of file +var _0x4137=['QueryTypes','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','define','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','ignore','autoAssociation','model','all','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','pick','VIRTUAL','push','foreignKey','forEach','merge','options','include','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','ids','count','includeAll','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','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','metrics','toUpperCase','slice','Sequelize'];(function(_0x32724f,_0x3e7c06){var _0x2a524f=function(_0xfaff29){while(--_0xfaff29){_0x32724f['push'](_0x32724f['shift']());}};_0x2a524f(++_0x3e7c06);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'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':_0xb7dd83[_0x7413('0x81')][_0x7413('0x82')],'where':{}};var _0x3db284={};var _0x2f0f0c={'count':0x0,'rows':[]};var _0x295a0a=_0xb7dd83[_0x7413('0x81')][_0x7413('0x83')];var _0x3f9cfd=_0xb7dd83[_0x7413('0x81')][_0x7413('0x84')]||![];var _0x4b381e=_0x1585ba(_0x295a0a,_0x3f9cfd);if(!_0x4b381e[_0x7413('0x14')])throw new Error(_0x7413('0x85')+_0x295a0a+'\x27');var _0x4cab22=[{'name':_0x295a0a}];if(!_[_0x7413('0x86')](_0x4b381e[_0x7413('0x19')]))_0x4cab22=_0x4b381e[_0x7413('0x19')];var _0x5e4aa1=[];for(var _0x102fd2=0x0;_0x102fd2<_0x4cab22[_0x7413('0x87')];_0x102fd2++){_0x5e4aa1['push'](_0x2e6df7[_0x7413('0x88')][_0x7413('0x89')]({'where':{'userProfileId':_0xb7dd83['params']['id'],'name':_0x4cab22[_0x102fd2][_0x7413('0x34')]},'raw':!![]}));}return Promise['all'](_0x5e4aa1)['then'](function(_0xbb819a){var _0xbd74d9=_[_0x7413('0x6')](_0xbb819a,function(_0x3d2f93){return _0x3d2f93?_0x3d2f93:undefined;});var _0x128419=_[_0x7413('0x6')](_0x4cab22,[_0x7413('0x8a'),!![]]);var _0x2f8637=_['isEmpty'](_0xbd74d9)&&_[_0x7413('0x86')](_0x128419)?null:_['union'](_0x128419,_0xbd74d9);if(!_0x2f8637)return null;var _0xd9c741=[];for(var _0x3deb37=0x0;_0x3deb37<_0x2f8637[_0x7413('0x87')];_0x3deb37++){var _0x3054f5=_[_0x7413('0x89')](_0x4cab22,function(_0x29d919){return _0x2f8637[_0x3deb37]?_0x29d919[_0x7413('0x34')]===_0x2f8637[_0x3deb37][_0x7413('0x34')]:null;});if(_0x3054f5){if(_0x2f8637[_0x3deb37][_0x7413('0x8a')]){_0xd9c741['push'](_0x258255(_0x4b381e[_0x7413('0x14')],_0x2f8637[_0x3deb37]));}else{if(!_0x2f8637[_0x3deb37][_0x7413('0x8b')]){_0xd9c741['push'](_0x4b9a5b(_0x3054f5,_0x2f8637[_0x3deb37],_0x4b381e[_0x7413('0x14')]));}else{if(_0x3054f5[_0x7413('0x8c')]){_0xd9c741['push'](_0x737ab4(_0x3054f5,_0x2f8637[_0x3deb37]));}}}}}return Promise[_0x7413('0x8d')](_0xd9c741);})['then'](function(_0xcbc6e){var _0x3d4ce3=_0xcbc6e;var _0x54f03d=null;if(_0x3d4ce3){_0x54f03d=_0x3d4ce3['length']===0x1?_0x3d4ce3[0x0]:null;}if(!_0x54f03d&&!_0x3d4ce3)return _0x2f0f0c;var _0x227a66=_0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0x8e')];_0x3db284['model']=_[_0x7413('0x8f')](_0x227a66);_0x3db284[_0x7413('0x81')]=_[_0x7413('0x8f')](_0xb7dd83[_0x7413('0x81')]);_0x3db284[_0x7413('0x90')]=_[_0x7413('0x91')](_0x3db284['model'],_0x3db284[_0x7413('0x81')]);_0x12544d[_0x7413('0x92')]=_[_0x7413('0x91')](_0x3db284['model'],qs[_0x7413('0x93')](_0xb7dd83[_0x7413('0x81')][_0x7413('0x93')]));_0x12544d[_0x7413('0x92')]=_0x12544d[_0x7413('0x92')][_0x7413('0x87')]?_0x12544d[_0x7413('0x92')]:_0x3db284[_0x7413('0x8c')];if(!_0xb7dd83[_0x7413('0x81')]['hasOwnProperty'](_0x7413('0x94'))){_0x12544d[_0x7413('0x95')]=qs[_0x7413('0x95')](_0xb7dd83[_0x7413('0x81')][_0x7413('0x95')]);_0x12544d[_0x7413('0x96')]=qs['offset'](_0xb7dd83[_0x7413('0x81')]['offset']);}_0x12544d['order']=qs[_0x7413('0x97')](_0xb7dd83[_0x7413('0x81')]['sort']);_0x12544d[_0x7413('0x7c')]=qs[_0x7413('0x90')](_[_0x7413('0x98')](_0xb7dd83[_0x7413('0x81')],_0x3db284[_0x7413('0x90')]));if(_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]){_0x12544d[_0x7413('0x7c')]=_['merge'](_0x12544d[_0x7413('0x7c')],{'$or':_['map'](_0x227a66,function(_0xeaf166){if(_0xeaf166[_0x7413('0x11')]['key']!==_0x7413('0x99')){var _0x1f4ce0={};_0x1f4ce0[_0xeaf166[_0x7413('0x7')]]={'$like':'%'+_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]+'%'};return _0x1f4ce0;}})});}var _0x3920b5=[];var _0x3dcbfb=null;var _0x12fbb2={};if(_0x54f03d){_0x3dcbfb=_[_0x7413('0x89')](_0x4cab22,[_0x7413('0x34'),_0x54f03d['name']]);if(_0x3dcbfb[_0x7413('0x7')]){_0x12fbb2={};if(_0x4b381e[_0x7413('0x14')]==='AnalyticExtractedReport'){_0x12fbb2[_0x3dcbfb['foreignKey']]=_['map'](_0x54f03d[_0x7413('0xa')],'id');}else{_0x12fbb2[_0x3dcbfb['foreignKey']]=_0x54f03d[_0x7413('0xa')];}_0x3920b5[_0x7413('0x9a')](_0x12fbb2);}else{_0x12544d[_0x7413('0x7c')]['id']=_0x54f03d[_0x7413('0xa')];}}else{for(var _0x470c21=0x0;_0x470c21<_0x3d4ce3[_0x7413('0x87')];_0x470c21++){_0x3dcbfb=_[_0x7413('0x89')](_0x4cab22,[_0x7413('0x34'),_0x3d4ce3[_0x470c21][_0x7413('0x34')]]);if(_0x3dcbfb['field']){_0x12fbb2={};_0x12fbb2[_0x3dcbfb[_0x7413('0x9b')]]=_0x3d4ce3[_0x470c21][_0x7413('0xa')];_0x3920b5[_0x7413('0x9a')](_0x12fbb2);}else{if(!_0x12544d['where']['id'])_0x12544d[_0x7413('0x7c')]['id']=[];_0x3d4ce3[_0x470c21][_0x7413('0xa')][_0x7413('0x9c')](function(_0x432906){_0x12544d[_0x7413('0x7c')]['id'][_0x7413('0x9a')](_0x432906);});}}}if(!_[_0x7413('0x86')](_0x3920b5)){_0x12544d[_0x7413('0x7c')]=_[_0x7413('0x9d')](_0x12544d[_0x7413('0x7c')],{'$and':{'$or':_0x3920b5}});}_0x12544d=_['merge']({},_0x12544d,_0xb7dd83[_0x7413('0x9e')]);if(_0x54f03d&&!_0x54f03d[_0x7413('0x8b')]&&_0x4b381e['childModel']===_0x7413('0xf')){if(_0xb7dd83[_0x7413('0x81')]['includeAll']){_0x12544d[_0x7413('0x9f')]=[{'all':!![]}];}return _0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0x9')](_0x12544d)['then'](function(_0x36d8cf){var _0x5a44bd=[];_0x36d8cf[_0x7413('0x9c')](function(_0x35f721){var _0x4537b5;switch(_0x35f721[_0x7413('0xa0')]){case _0x7413('0xa1'):_0x4537b5=_[_0x7413('0x89')](_0x54f03d['associatedResources'],function(_0x4ece1){return _0x4ece1['id']===_0x35f721[_0x7413('0xa2')]&&_0x4ece1[_0x7413('0x11')]===_0x7413('0xa3');});break;case _0x7413('0xa4'):_0x4537b5=_['find'](_0x54f03d[_0x7413('0xa')],function(_0x566ee0){return _0x566ee0['id']===_0x35f721[_0x7413('0xa2')]&&_0x566ee0[_0x7413('0x11')]===_0x7413('0xa5');});break;}if(_0x4537b5)_0x5a44bd['push'](_0x35f721);});_0x2f0f0c['count']=_0x5a44bd[_0x7413('0x87')];_0x2f0f0c[_0x7413('0xa6')]=_0x5a44bd;return _0x2f0f0c;});}else{if(!_[_0x7413('0x86')](_0xb7dd83[_0x7413('0x81')]['ids'])){_0x12544d['where']['id']=_0x12544d[_0x7413('0x7c')]['id']?_[_0x7413('0x91')](_0x12544d[_0x7413('0x7c')]['id'],_0xb7dd83['query']['ids']):_0xb7dd83[_0x7413('0x81')][_0x7413('0xa7')];}return _0x2e6df7[_0x4b381e[_0x7413('0x14')]][_0x7413('0xa8')]({'where':_0x12544d[_0x7413('0x7c')]})[_0x7413('0xc')](function(_0x5fd045){_0x2f0f0c['count']=_0x5fd045;if(_0xb7dd83['query'][_0x7413('0xa9')]){if(_0x4b381e[_0x7413('0x14')]==='CmContact'){_0x12544d[_0x7413('0x9f')]=[{'model':_0x2e6df7[_0x7413('0x68')],'as':_0x7413('0xaa'),'attributes':['id',_0x7413('0x34'),_0x7413('0xab')],'required':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]?!![]:![]},{'model':_0x2e6df7[_0x7413('0x68')],'as':_0x7413('0xad'),'attributes':['id','name',_0x7413('0xab')],'through':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]?{'attributes':[],'where':{'TagId':_0xb7dd83[_0x7413('0x81')][_0x7413('0xac')]||undefined}}:{},'required':_0xb7dd83[_0x7413('0x81')]['tag']?!![]:![]}];}else{_0x12544d['include']=[{'all':!![]}];}}return _0x2e6df7[_0x4b381e['childModel']][_0x7413('0x9')](_0x12544d);})[_0x7413('0xc')](function(_0x999109){_0x2f0f0c[_0x7413('0xa6')]=_0x999109;if(_0x295a0a===_0x7413('0xae')&&_0xb7dd83[_0x7413('0x81')][_0x7413('0xaf')]===_0x7413('0xb0')){var _0x4e872e=[];for(var _0x11f5a3=0x0;_0x11f5a3<_0x2f0f0c['rows'][_0x7413('0x87')];_0x11f5a3++){_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb1'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e['push'](_0x269976(_0x7413('0xb3'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb4'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb5'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e[_0x7413('0x9a')](_0x269976(_0x7413('0xb6'),_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));_0x4e872e['push'](_0x269976('whatsapp',_0x2f0f0c[_0x7413('0xa6')][_0x11f5a3][_0x7413('0xb2')]));}return Promise['all'](_0x4e872e)[_0x7413('0xc')](function(){return _0x2f0f0c;});}return _0x2f0f0c;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f19b7b2..1a376e8 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 _0x27a0=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http'];(function(_0x178f1c,_0x343a61){var _0x568ab3=function(_0x283b33){while(--_0x283b33){_0x178f1c['push'](_0x178f1c['shift']());}};_0x568ab3(++_0x343a61);}(_0x27a0,0xbf));var _0x027a=function(_0x47aae2,_0x2ba7ea){_0x47aae2=_0x47aae2-0x0;var _0x549183=_0x27a0[_0x47aae2];return _0x549183;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});config[_0x027a('0x9')]=_[_0x027a('0xa')](config['redis'],{'host':_0x027a('0xb'),'port':0x18eb});var socket=require(_0x027a('0xc'))(new Redis(config[_0x027a('0x9')]));require('./userProfile.socket')[_0x027a('0xd')](socket);function respondWithRpcPromise(_0x42ccac,_0x2d13a2,_0x534902){return new BPromise(function(_0x6d5b04,_0xe5df59){return client[_0x027a('0xe')](_0x42ccac,_0x534902)[_0x027a('0xf')](function(_0x172eb4){logger[_0x027a('0x10')](_0x027a('0x11'),_0x2d13a2,_0x027a('0x12'));logger[_0x027a('0x13')](_0x027a('0x14'),_0x2d13a2,_0x027a('0x12'),JSON['stringify'](_0x172eb4));if(_0x172eb4[_0x027a('0x15')]){if(_0x172eb4[_0x027a('0x15')][_0x027a('0x16')]===0x1f4){logger[_0x027a('0x15')](_0x027a('0x11'),_0x2d13a2,_0x172eb4['error']['message']);return _0xe5df59(_0x172eb4[_0x027a('0x15')]['message']);}logger[_0x027a('0x15')]('UserProfile,\x20%s,\x20%s',_0x2d13a2,_0x172eb4[_0x027a('0x15')]['message']);return _0x6d5b04(_0x172eb4['error']['message']);}else{logger[_0x027a('0x10')](_0x027a('0x11'),_0x2d13a2,_0x027a('0x12'));_0x6d5b04(_0x172eb4[_0x027a('0x17')]['message']);}})[_0x027a('0x18')](function(_0x2fccf6){logger['error']('UserProfile,\x20%s,\x20%s',_0x2d13a2,_0x2fccf6);_0xe5df59(_0x2fccf6);});});} \ No newline at end of file +var _0xf105=['register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket'];(function(_0x53dcdd,_0x34c812){var _0x1997dc=function(_0x4b11c3){while(--_0x4b11c3){_0x53dcdd['push'](_0x53dcdd['shift']());}};_0x1997dc(++_0x34c812);}(_0xf105,0x1b0));var _0x5f10=function(_0x54eef0,_0x5deaf1){_0x54eef0=_0x54eef0-0x0;var _0x29a51a=_0xf105[_0x54eef0];return _0x29a51a;};'use strict';var _=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var moment=require(_0x5f10('0x2'));var BPromise=require(_0x5f10('0x3'));var rs=require(_0x5f10('0x4'));var fs=require('fs');var Redis=require(_0x5f10('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f10('0x6'));var logger=require('../../config/logger')(_0x5f10('0x7'));var config=require(_0x5f10('0x8'));var jayson=require(_0x5f10('0x9'));var client=jayson[_0x5f10('0xa')][_0x5f10('0xb')]({'port':0x232a});config[_0x5f10('0xc')]=_[_0x5f10('0xd')](config[_0x5f10('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f10('0xe'))(new Redis(config[_0x5f10('0xc')]));require(_0x5f10('0xf'))[_0x5f10('0x10')](socket);function respondWithRpcPromise(_0x1b5463,_0x6dc96e,_0x540d92){return new BPromise(function(_0x1009b9,_0x3fd8eb){return client[_0x5f10('0x11')](_0x1b5463,_0x540d92)[_0x5f10('0x12')](function(_0x20fad6){logger[_0x5f10('0x13')]('UserProfile,\x20%s,\x20%s',_0x6dc96e,_0x5f10('0x14'));logger[_0x5f10('0x15')](_0x5f10('0x16'),_0x6dc96e,_0x5f10('0x14'),JSON['stringify'](_0x20fad6));if(_0x20fad6['error']){if(_0x20fad6[_0x5f10('0x17')][_0x5f10('0x18')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x6dc96e,_0x20fad6[_0x5f10('0x17')]['message']);return _0x3fd8eb(_0x20fad6['error']['message']);}logger[_0x5f10('0x17')](_0x5f10('0x19'),_0x6dc96e,_0x20fad6['error'][_0x5f10('0x1a')]);return _0x1009b9(_0x20fad6[_0x5f10('0x17')]['message']);}else{logger[_0x5f10('0x13')](_0x5f10('0x19'),_0x6dc96e,_0x5f10('0x14'));_0x1009b9(_0x20fad6[_0x5f10('0x1b')]['message']);}})['catch'](function(_0x40c679){logger[_0x5f10('0x17')](_0x5f10('0x19'),_0x6dc96e,_0x40c679);_0x3fd8eb(_0x40c679);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 38b1ca0..a03cb8e 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 _0x7b5a=['userProfile:','./userProfile.events','save','remove','update','emit','register','length'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x7b5a,0x1e1));var _0xa7b5=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x7b5a[_0x454018];return _0x24697d;};'use strict';var UserProfileEvents=require(_0xa7b5('0x0'));var events=[_0xa7b5('0x1'),_0xa7b5('0x2'),_0xa7b5('0x3')];function createListener(_0x2f4b25,_0x261a51){return function(_0x3617e7){_0x261a51[_0xa7b5('0x4')](_0x2f4b25,_0x3617e7);};}function removeListener(_0x4136d9,_0x433af9){return function(){UserProfileEvents['removeListener'](_0x4136d9,_0x433af9);};}exports[_0xa7b5('0x5')]=function(_0x168599){for(var _0x332808=0x0,_0x3b2280=events[_0xa7b5('0x6')];_0x332808<_0x3b2280;_0x332808++){var _0x254865=events[_0x332808];var _0x40ab22=createListener(_0xa7b5('0x7')+_0x254865,_0x168599);UserProfileEvents['on'](_0x254865,_0x40ab22);}}; \ No newline at end of file +var _0x2742=['register','./userProfile.events','save','remove','update','removeListener'];(function(_0x56099e,_0x15f445){var _0x402a97=function(_0x7cb24){while(--_0x7cb24){_0x56099e['push'](_0x56099e['shift']());}};_0x402a97(++_0x15f445);}(_0x2742,0x79));var _0x2274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2742[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x2274('0x0'));var events=[_0x2274('0x1'),_0x2274('0x2'),_0x2274('0x3')];function createListener(_0x32ad50,_0x2aa944){return function(_0xb62b1b){_0x2aa944['emit'](_0x32ad50,_0xb62b1b);};}function removeListener(_0x4c743f,_0x4ea030){return function(){UserProfileEvents[_0x2274('0x4')](_0x4c743f,_0x4ea030);};}exports[_0x2274('0x5')]=function(_0x1d38b8){for(var _0x268749=0x0,_0x595c34=events['length'];_0x268749<_0x595c34;_0x268749++){var _0x1b2eb6=events[_0x268749];var _0x8a05bc=createListener('userProfile:'+_0x1b2eb6,_0x1d38b8);UserProfileEvents['on'](_0x1b2eb6,_0x8a05bc);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index df30997..91895ba 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 _0x9443=['create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','isAuthenticated','/:id','show'];(function(_0x2afd20,_0x5b2e59){var _0x56fa34=function(_0x4a5fc8){while(--_0x4a5fc8){_0x2afd20['push'](_0x2afd20['shift']());}};_0x56fa34(++_0x5b2e59);}(_0x9443,0xc3));var _0x3944=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x9443[_0x4da356];return _0x321b07;};'use strict';var multer=require(_0x3944('0x0'));var util=require(_0x3944('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3944('0x2'));var router=express[_0x3944('0x3')]();var fs_extra=require(_0x3944('0x4'));var auth=require(_0x3944('0x5'));var interaction=require(_0x3944('0x6'));var config=require(_0x3944('0x7'));var controller=require(_0x3944('0x8'));router[_0x3944('0x9')]('/',auth['isAuthenticated'](),controller[_0x3944('0xa')]);router[_0x3944('0x9')]('/describe',auth[_0x3944('0xb')](),controller['describe']);router[_0x3944('0x9')](_0x3944('0xc'),auth[_0x3944('0xb')](),controller[_0x3944('0xd')]);router['post']('/',auth[_0x3944('0xb')](),controller[_0x3944('0xe')]);router[_0x3944('0xf')](_0x3944('0xc'),auth[_0x3944('0xb')](),controller[_0x3944('0x10')]);router[_0x3944('0x11')](_0x3944('0xc'),auth[_0x3944('0xb')](),controller['destroy']);module[_0x3944('0x12')]=router; \ No newline at end of file +var _0xd39e=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','index','get','/describe'];(function(_0x491ee6,_0x290b18){var _0x541e79=function(_0x4f1b11){while(--_0x4f1b11){_0x491ee6['push'](_0x491ee6['shift']());}};_0x541e79(++_0x290b18);}(_0xd39e,0xd9));var _0xed39=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xd39e[_0x53f0db];return _0xae0a5c;};'use strict';var multer=require(_0xed39('0x0'));var util=require('util');var path=require(_0xed39('0x1'));var timeout=require(_0xed39('0x2'));var express=require(_0xed39('0x3'));var router=express[_0xed39('0x4')]();var fs_extra=require(_0xed39('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xed39('0x6'));var config=require('../../config/environment');var controller=require(_0xed39('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xed39('0x8')]);router[_0xed39('0x9')](_0xed39('0xa'),auth[_0xed39('0xb')](),controller['describe']);router[_0xed39('0x9')](_0xed39('0xc'),auth[_0xed39('0xb')](),controller['show']);router[_0xed39('0xd')]('/',auth[_0xed39('0xb')](),controller[_0xed39('0xe')]);router[_0xed39('0xf')]('/:id',auth[_0xed39('0xb')](),controller['update']);router[_0xed39('0x10')]('/:id',auth[_0xed39('0xb')](),controller[_0xed39('0x11')]);module[_0xed39('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 2214c91..04f7dbf 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 _0x8322=['exports','STRING','sequelize'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x8322,0xd1));var _0x2832=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x8322[_0x16629d];return _0x56ccee;};'use strict';var Sequelize=require(_0x2832('0x0'));module[_0x2832('0x1')]={'name':{'type':Sequelize[_0x2832('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2832('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa133=['sequelize'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xa133,0x65));var _0x3a13=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xa133[_0x4b91c4];return _0x25cb80;};'use strict';var Sequelize=require(_0x3a13('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 8c0edd5..a1936e8 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 _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x6d38,0x1ef));var _0x86d3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6d38[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['UserProfileResource'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));}; \ No newline at end of file +var _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x781d,0x14a));var _0xd781=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x781d[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index daa3d17..336e4ae 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 _0x45b1=['./userProfileResource.attributes','exports','define','compositeIndex','sectionId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x45b1,0x123));var _0x145b=function(_0x38b099,_0x1148f8){_0x38b099=_0x38b099-0x0;var _0x40dd56=_0x45b1[_0x38b099];return _0x40dd56;};'use strict';var _=require(_0x145b('0x0'));var util=require(_0x145b('0x1'));var logger=require('../../config/logger')(_0x145b('0x2'));var moment=require(_0x145b('0x3'));var BPromise=require(_0x145b('0x4'));var rp=require(_0x145b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x145b('0x6'));var config=require(_0x145b('0x7'));var attributes=require(_0x145b('0x8'));module[_0x145b('0x9')]=function(_0x16fd7a,_0x27b28a){return _0x16fd7a[_0x145b('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x145b('0xb'),'fields':['resourceId',_0x145b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd178=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x4bf8c2,_0x17f83){var _0xf2ecfe=function(_0x2a9da5){while(--_0x2a9da5){_0x4bf8c2['push'](_0x4bf8c2['shift']());}};_0xf2ecfe(++_0x17f83);}(_0xd178,0x130));var _0x8d17=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xd178[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x8d17('0x0'));var util=require(_0x8d17('0x1'));var logger=require(_0x8d17('0x2'))('api');var moment=require(_0x8d17('0x3'));var BPromise=require(_0x8d17('0x4'));var rp=require(_0x8d17('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d17('0x6'));var config=require(_0x8d17('0x7'));var attributes=require(_0x8d17('0x8'));module[_0x8d17('0x9')]=function(_0x205e9b,_0x1683a9){return _0x205e9b[_0x8d17('0xa')](_0x8d17('0xb'),attributes,{'tableName':_0x8d17('0xc'),'paranoid':![],'indexes':[{'name':_0x8d17('0xd'),'fields':[_0x8d17('0xe'),_0x8d17('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 692c028..b78eac1 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 _0xb010=['client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xb010,0x8b));var _0x0b01=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb010[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x0b01('0x0'));var moment=require('moment');var BPromise=require(_0x0b01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b01('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b01('0x3'));var logger=require(_0x0b01('0x4'))(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var jayson=require(_0x0b01('0x7'));var client=jayson[_0x0b01('0x8')][_0x0b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c65ed,_0x824a23,_0x33eb05){return new BPromise(function(_0xcdfdfd,_0x15364b){return client[_0x0b01('0xa')](_0x3c65ed,_0x33eb05)['then'](function(_0x46d839){logger[_0x0b01('0xb')](_0x0b01('0xc'),_0x824a23,_0x0b01('0xd'));logger[_0x0b01('0xe')](_0x0b01('0xf'),_0x824a23,_0x0b01('0xd'),JSON[_0x0b01('0x10')](_0x46d839));if(_0x46d839[_0x0b01('0x11')]){if(_0x46d839[_0x0b01('0x11')]['code']===0x1f4){logger[_0x0b01('0x11')](_0x0b01('0xc'),_0x824a23,_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);return _0x15364b(_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);}logger[_0x0b01('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x824a23,_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);return _0xcdfdfd(_0x46d839[_0x0b01('0x11')][_0x0b01('0x12')]);}else{logger[_0x0b01('0xb')](_0x0b01('0xc'),_0x824a23,_0x0b01('0xd'));_0xcdfdfd(_0x46d839[_0x0b01('0x13')][_0x0b01('0x12')]);}})[_0x0b01('0x14')](function(_0x458baf){logger[_0x0b01('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x824a23,_0x458baf);_0x15364b(_0x458baf);});});} \ No newline at end of file +var _0x379a=['stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x2146dc,_0x5736a0){var _0x958647=function(_0xca09d){while(--_0xca09d){_0x2146dc['push'](_0x2146dc['shift']());}};_0x958647(++_0x5736a0);}(_0x379a,0x146));var _0xa379=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x379a[_0x52096b];return _0x2b1cc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa379('0x0'));var BPromise=require(_0xa379('0x1'));var rs=require(_0xa379('0x2'));var fs=require('fs');var Redis=require(_0xa379('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa379('0x4'));var logger=require('../../config/logger')(_0xa379('0x5'));var config=require(_0xa379('0x6'));var jayson=require(_0xa379('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4110a1,_0x257db3,_0x2ae1ae){return new BPromise(function(_0x4a7604,_0x2f26c7){return client[_0xa379('0x8')](_0x4110a1,_0x2ae1ae)[_0xa379('0x9')](function(_0x1a7337){logger['info'](_0xa379('0xa'),_0x257db3,_0xa379('0xb'));logger[_0xa379('0xc')](_0xa379('0xd'),_0x257db3,_0xa379('0xb'),JSON[_0xa379('0xe')](_0x1a7337));if(_0x1a7337[_0xa379('0xf')]){if(_0x1a7337['error'][_0xa379('0x10')]===0x1f4){logger[_0xa379('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x257db3,_0x1a7337[_0xa379('0xf')][_0xa379('0x11')]);return _0x2f26c7(_0x1a7337[_0xa379('0xf')][_0xa379('0x11')]);}logger[_0xa379('0xf')](_0xa379('0xa'),_0x257db3,_0x1a7337[_0xa379('0xf')][_0xa379('0x11')]);return _0x4a7604(_0x1a7337[_0xa379('0xf')][_0xa379('0x11')]);}else{logger[_0xa379('0x12')](_0xa379('0xa'),_0x257db3,_0xa379('0xb'));_0x4a7604(_0x1a7337['result'][_0xa379('0x11')]);}})[_0xa379('0x13')](function(_0x5e5e44){logger['error'](_0xa379('0xa'),_0x257db3,_0x5e5e44);_0x2f26c7(_0x5e5e44);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index da0cdca..1187f5b 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 _0xead1=['exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xead1,0x1c9));var _0x1ead=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xead1[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x1ead('0x0'));var util=require(_0x1ead('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ead('0x2'));var router=express['Router']();var fs_extra=require(_0x1ead('0x3'));var auth=require(_0x1ead('0x4'));var interaction=require(_0x1ead('0x5'));var config=require('../../config/environment');var controller=require(_0x1ead('0x6'));router['get']('/',auth[_0x1ead('0x7')](),controller[_0x1ead('0x8')]);router[_0x1ead('0x9')](_0x1ead('0xa'),auth['isAuthenticated'](),controller[_0x1ead('0xb')]);router['get'](_0x1ead('0xc'),auth[_0x1ead('0x7')](),controller[_0x1ead('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ead('0xe')]);router[_0x1ead('0xf')](_0x1ead('0xc'),auth[_0x1ead('0x7')](),controller[_0x1ead('0x10')]);router[_0x1ead('0x11')](_0x1ead('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x1ead('0x12')]=router; \ No newline at end of file +var _0x1b81=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','index','/describe','isAuthenticated','get','/:id','post','put','update','delete'];(function(_0x3f3f1f,_0x28b7ea){var _0x16872b=function(_0xb81b23){while(--_0xb81b23){_0x3f3f1f['push'](_0x3f3f1f['shift']());}};_0x16872b(++_0x28b7ea);}(_0x1b81,0x131));var _0x11b8=function(_0x29b051,_0x5133eb){_0x29b051=_0x29b051-0x0;var _0x33cf04=_0x1b81[_0x29b051];return _0x33cf04;};'use strict';var multer=require(_0x11b8('0x0'));var util=require(_0x11b8('0x1'));var path=require(_0x11b8('0x2'));var timeout=require(_0x11b8('0x3'));var express=require('express');var router=express[_0x11b8('0x4')]();var fs_extra=require(_0x11b8('0x5'));var auth=require(_0x11b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x11b8('0x7'));var controller=require(_0x11b8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x11b8('0x9')]);router['get'](_0x11b8('0xa'),auth[_0x11b8('0xb')](),controller['describe']);router[_0x11b8('0xc')](_0x11b8('0xd'),auth[_0x11b8('0xb')](),controller['show']);router[_0x11b8('0xe')]('/',auth[_0x11b8('0xb')](),controller['create']);router[_0x11b8('0xf')](_0x11b8('0xd'),auth[_0x11b8('0xb')](),controller[_0x11b8('0x10')]);router[_0x11b8('0x11')](_0x11b8('0xd'),auth[_0x11b8('0xb')](),controller[_0x11b8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ee9efa1..c865f47 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['getDataValue','split','sequelize','STRING','INTEGER','setDataValue','crudPermissions','join'];(function(_0x414d3b,_0x3a3741){var _0x374042=function(_0x40b8c5){while(--_0x40b8c5){_0x414d3b['push'](_0x414d3b['shift']());}};_0x374042(++_0x3a3741);}(_0xf7b4,0x152));var _0x4f7b=function(_0x17a6f8,_0x3c5730){_0x17a6f8=_0x17a6f8-0x0;var _0x16cf3f=_0xf7b4[_0x17a6f8];return _0x16cf3f;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f7b('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f7b('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f7b('0x1')],'set':function(_0x3e18fd){this[_0x4f7b('0x3')](_0x4f7b('0x4'),_0x3e18fd?_0x3e18fd[_0x4f7b('0x5')](''):[]);},'get':function(){return this[_0x4f7b('0x6')](_0x4f7b('0x4'))?this[_0x4f7b('0x6')](_0x4f7b('0x4'))[_0x4f7b('0x7')](''):[];}}}; \ No newline at end of file +var _0x1775=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x35f556,_0x4ea6b8){var _0x18630f=function(_0x4287d0){while(--_0x4287d0){_0x35f556['push'](_0x35f556['shift']());}};_0x18630f(++_0x4ea6b8);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'name':{'type':Sequelize[_0x5177('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x5177('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5177('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5177('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5177('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5177('0x1')],'set':function(_0x2027bf){this[_0x5177('0x4')](_0x5177('0x5'),_0x2027bf?_0x2027bf[_0x5177('0x6')](''):[]);},'get':function(){return this[_0x5177('0x7')](_0x5177('0x5'))?this[_0x5177('0x7')](_0x5177('0x5'))[_0x5177('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6d49a66..a59b403 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 _0x0181=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','save','update','then','destroy','end','error','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x470f71,_0x735e3a){var _0x4fdbb0=function(_0x51b3ff){while(--_0x51b3ff){_0x470f71['push'](_0x470f71['shift']());}};_0x4fdbb0(++_0x735e3a);}(_0x0181,0xc6));var _0x1018=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0181[_0x31a371];return _0x2a5bd6;};'use strict';var emlformat=require(_0x1018('0x0'));var rimraf=require(_0x1018('0x1'));var zipdir=require(_0x1018('0x2'));var jsonpatch=require(_0x1018('0x3'));var rp=require(_0x1018('0x4'));var moment=require(_0x1018('0x5'));var BPromise=require(_0x1018('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1018('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1018('0x8'));var fs=require('fs');var fs_extra=require(_0x1018('0x9'));var _=require(_0x1018('0xa'));var squel=require(_0x1018('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1018('0xc'));var querystring=require(_0x1018('0xd'));var Papa=require(_0x1018('0xe'));var Redis=require(_0x1018('0xf'));var authService=require(_0x1018('0x10'));var qs=require(_0x1018('0x11'));var as=require(_0x1018('0x12'));var hardwareService=require(_0x1018('0x13'));var logger=require('../../config/logger')(_0x1018('0x14'));var utils=require(_0x1018('0x15'));var config=require(_0x1018('0x16'));var licenseUtil=require(_0x1018('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4251ef,_0x585354){_0x585354=_0x585354||0xcc;return function(_0x561f13){if(_0x561f13){return _0x4251ef[_0x1018('0x18')](_0x585354);}return _0x4251ef[_0x1018('0x19')](_0x585354)['end']();};}function respondWithResult(_0x36e3c8,_0x4b39bf){_0x4b39bf=_0x4b39bf||0xc8;return function(_0x42c1e8){if(_0x42c1e8){return _0x36e3c8['status'](_0x4b39bf)[_0x1018('0x1a')](_0x42c1e8);}};}function respondWithFilteredResult(_0x265af2,_0x13af2a){return function(_0x139b2a){if(_0x139b2a){var _0x174d1f=typeof _0x13af2a[_0x1018('0x1b')]===_0x1018('0x1c')&&typeof _0x13af2a['limit']==='undefined';var _0x597249=_0x139b2a['count'];var _0x25b369=_0x174d1f?0x0:_0x13af2a['offset'];var _0x336170=_0x174d1f?_0x139b2a['count']:_0x13af2a['offset']+_0x13af2a['limit'];var _0x4aa000;if(_0x336170>=_0x597249){_0x336170=_0x597249;_0x4aa000=0xc8;}else{_0x4aa000=0xce;}_0x265af2[_0x1018('0x19')](_0x4aa000);return _0x265af2['set']('Content-Range',_0x25b369+'-'+_0x336170+'/'+_0x597249)['json'](_0x139b2a);}return null;};}function patchUpdates(_0x274a09){return function(_0x114918){try{jsonpatch['apply'](_0x114918,_0x274a09,!![]);}catch(_0xd86868){return BPromise['reject'](_0xd86868);}return _0x114918[_0x1018('0x1d')]();};}function saveUpdates(_0x53466b,_0x208bf4){return function(_0x4c6138){if(_0x4c6138){return _0x4c6138[_0x1018('0x1e')](_0x53466b)[_0x1018('0x1f')](function(_0x5f118b){return _0x5f118b;});}return null;};}function removeEntity(_0x3d1b52,_0x5018f5){return function(_0x17163a){if(_0x17163a){return _0x17163a[_0x1018('0x20')]()[_0x1018('0x1f')](function(){_0x3d1b52[_0x1018('0x19')](0xcc)[_0x1018('0x21')]();});}};}function handleEntityNotFound(_0x21c0c9,_0x317207){return function(_0x159207){if(!_0x159207){_0x21c0c9[_0x1018('0x18')](0x194);}return _0x159207;};}function handleError(_0x5a5127,_0x4a35d1){_0x4a35d1=_0x4a35d1||0x1f4;return function(_0x121543){logger[_0x1018('0x22')](_0x121543['stack']);if(_0x121543[_0x1018('0x23')]){delete _0x121543[_0x1018('0x23')];}_0x5a5127[_0x1018('0x19')](_0x4a35d1)['send'](_0x121543);};}exports[_0x1018('0x24')]=function(_0x44113b,_0x4fbb2a){var _0x3c4c64={},_0x908cf8={},_0x39a827={'count':0x0,'rows':[]};var _0x21b600=_[_0x1018('0x25')](db[_0x1018('0x26')][_0x1018('0x27')],function(_0x20d911){return{'name':_0x20d911[_0x1018('0x28')],'type':_0x20d911[_0x1018('0x29')][_0x1018('0x2a')]};});_0x908cf8[_0x1018('0x2b')]=_['map'](_0x21b600,_0x1018('0x23'));_0x908cf8[_0x1018('0x2c')]=_['keys'](_0x44113b[_0x1018('0x2c')]);_0x908cf8[_0x1018('0x2d')]=_['intersection'](_0x908cf8[_0x1018('0x2b')],_0x908cf8[_0x1018('0x2c')]);_0x3c4c64[_0x1018('0x2e')]=_[_0x1018('0x2f')](_0x908cf8[_0x1018('0x2b')],qs[_0x1018('0x30')](_0x44113b[_0x1018('0x2c')][_0x1018('0x30')]));_0x3c4c64[_0x1018('0x2e')]=_0x3c4c64[_0x1018('0x2e')][_0x1018('0x31')]?_0x3c4c64[_0x1018('0x2e')]:_0x908cf8[_0x1018('0x2b')];if(!_0x44113b['query'][_0x1018('0x32')](_0x1018('0x33'))){_0x3c4c64[_0x1018('0x34')]=qs['limit'](_0x44113b[_0x1018('0x2c')][_0x1018('0x34')]);_0x3c4c64[_0x1018('0x1b')]=qs['offset'](_0x44113b[_0x1018('0x2c')][_0x1018('0x1b')]);}_0x3c4c64[_0x1018('0x35')]=qs[_0x1018('0x36')](_0x44113b['query'][_0x1018('0x36')]);_0x3c4c64[_0x1018('0x37')]=qs['filters'](_['pick'](_0x44113b[_0x1018('0x2c')],_0x908cf8['filters']),_0x21b600);if(_0x44113b[_0x1018('0x2c')][_0x1018('0x38')]){_0x3c4c64[_0x1018('0x37')]=_[_0x1018('0x39')](_0x3c4c64[_0x1018('0x37')],{'$or':_[_0x1018('0x25')](_0x21b600,function(_0x2586da){if(_0x2586da[_0x1018('0x29')]!==_0x1018('0x3a')){var _0x407fdd={};_0x407fdd[_0x2586da[_0x1018('0x23')]]={'$like':'%'+_0x44113b[_0x1018('0x2c')][_0x1018('0x38')]+'%'};return _0x407fdd;}})});}_0x3c4c64=_[_0x1018('0x39')]({},_0x3c4c64,_0x44113b[_0x1018('0x3b')]);var _0x970b23={'where':_0x3c4c64[_0x1018('0x37')]};return db['UserProfileSection'][_0x1018('0x3c')](_0x970b23)[_0x1018('0x1f')](function(_0x2b57a7){_0x39a827[_0x1018('0x3c')]=_0x2b57a7;if(_0x44113b[_0x1018('0x2c')][_0x1018('0x3d')]){_0x3c4c64[_0x1018('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1018('0x3f')](_0x3c4c64);})['then'](function(_0x1009e9){_0x39a827[_0x1018('0x40')]=_0x1009e9;return _0x39a827;})[_0x1018('0x1f')](respondWithFilteredResult(_0x4fbb2a,_0x3c4c64))[_0x1018('0x41')](handleError(_0x4fbb2a,null));};exports[_0x1018('0x42')]=function(_0x1df5d3,_0x3e5216){var _0xfed37f={'raw':![],'where':{'id':_0x1df5d3[_0x1018('0x43')]['id']}},_0x424c24={};_0x424c24['model']=_['keys'](db[_0x1018('0x26')]['rawAttributes']);_0x424c24[_0x1018('0x2c')]=_['keys'](_0x1df5d3[_0x1018('0x2c')]);_0x424c24[_0x1018('0x2d')]=_[_0x1018('0x2f')](_0x424c24[_0x1018('0x2b')],_0x424c24[_0x1018('0x2c')]);_0xfed37f[_0x1018('0x2e')]=_[_0x1018('0x2f')](_0x424c24[_0x1018('0x2b')],qs[_0x1018('0x30')](_0x1df5d3[_0x1018('0x2c')]['fields']));_0xfed37f[_0x1018('0x2e')]=_0xfed37f[_0x1018('0x2e')]['length']?_0xfed37f[_0x1018('0x2e')]:_0x424c24['model'];if(_0x1df5d3['query'][_0x1018('0x3d')]){_0xfed37f[_0x1018('0x3e')]=[{'all':!![]}];}_0xfed37f=_['merge']({},_0xfed37f,_0x1df5d3[_0x1018('0x3b')]);return db[_0x1018('0x26')][_0x1018('0x44')](_0xfed37f)[_0x1018('0x1f')](handleEntityNotFound(_0x3e5216,null))[_0x1018('0x1f')](respondWithResult(_0x3e5216,null))[_0x1018('0x41')](handleError(_0x3e5216,null));};exports[_0x1018('0x45')]=function(_0x4a2a1c,_0x9e415c){return db['UserProfileSection']['create'](_0x4a2a1c[_0x1018('0x46')],{})[_0x1018('0x1f')](respondWithResult(_0x9e415c,0xc9))['catch'](handleError(_0x9e415c,null));};exports['update']=function(_0x50937d,_0x56dd18){if(_0x50937d[_0x1018('0x46')]['id']){delete _0x50937d[_0x1018('0x46')]['id'];}return db[_0x1018('0x26')][_0x1018('0x44')]({'where':{'id':_0x50937d[_0x1018('0x43')]['id']}})[_0x1018('0x1f')](handleEntityNotFound(_0x56dd18,null))['then'](saveUpdates(_0x50937d[_0x1018('0x46')],null))[_0x1018('0x1f')](respondWithResult(_0x56dd18,null))['catch'](handleError(_0x56dd18,null));};exports[_0x1018('0x20')]=function(_0x1eb57f,_0x5e9c23){return db['UserProfileSection'][_0x1018('0x44')]({'where':{'id':_0x1eb57f[_0x1018('0x43')]['id']}})[_0x1018('0x1f')](handleEntityNotFound(_0x5e9c23,null))[_0x1018('0x1f')](removeEntity(_0x5e9c23,null))[_0x1018('0x41')](handleError(_0x5e9c23,null));};exports[_0x1018('0x47')]=function(_0x1baea1,_0x405e31){return db[_0x1018('0x26')][_0x1018('0x47')]()['then'](respondWithResult(_0x405e31,null))[_0x1018('0x41')](handleError(_0x405e31,null));}; \ No newline at end of file +var _0x4331=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','includeAll','include','rows','show','options','find','catch','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xc7496f,_0x198920){var _0x16a05a=function(_0x5489d7){while(--_0x5489d7){_0xc7496f['push'](_0xc7496f['shift']());}};_0x16a05a(++_0x198920);}(_0x4331,0x113));var _0x1433=function(_0x597065,_0x453bfd){_0x597065=_0x597065-0x0;var _0xb8e1fb=_0x4331[_0x597065];return _0xb8e1fb;};'use strict';var emlformat=require(_0x1433('0x0'));var rimraf=require(_0x1433('0x1'));var zipdir=require(_0x1433('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1433('0x3'));var moment=require(_0x1433('0x4'));var BPromise=require(_0x1433('0x5'));var Mustache=require(_0x1433('0x6'));var util=require('util');var path=require(_0x1433('0x7'));var sox=require(_0x1433('0x8'));var csv=require('to-csv');var ejs=require(_0x1433('0x9'));var fs=require('fs');var fs_extra=require(_0x1433('0xa'));var _=require(_0x1433('0xb'));var squel=require(_0x1433('0xc'));var crypto=require(_0x1433('0xd'));var jsforce=require(_0x1433('0xe'));var deskjs=require(_0x1433('0xf'));var toCsv=require(_0x1433('0x10'));var querystring=require(_0x1433('0x11'));var Papa=require(_0x1433('0x12'));var Redis=require(_0x1433('0x13'));var authService=require(_0x1433('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1433('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1433('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1433('0x17'));var db=require(_0x1433('0x18'))['db'];function respondWithStatusCode(_0x524780,_0x1dd5e4){_0x1dd5e4=_0x1dd5e4||0xcc;return function(_0x7a08bf){if(_0x7a08bf){return _0x524780[_0x1433('0x19')](_0x1dd5e4);}return _0x524780[_0x1433('0x1a')](_0x1dd5e4)[_0x1433('0x1b')]();};}function respondWithResult(_0x57e4a5,_0x181b3a){_0x181b3a=_0x181b3a||0xc8;return function(_0x5ee8b4){if(_0x5ee8b4){return _0x57e4a5[_0x1433('0x1a')](_0x181b3a)[_0x1433('0x1c')](_0x5ee8b4);}};}function respondWithFilteredResult(_0x1d6a2e,_0xa10196){return function(_0x4c889d){if(_0x4c889d){var _0x53a88a=typeof _0xa10196[_0x1433('0x1d')]===_0x1433('0x1e')&&typeof _0xa10196[_0x1433('0x1f')]===_0x1433('0x1e');var _0x27f2da=_0x4c889d['count'];var _0x245750=_0x53a88a?0x0:_0xa10196[_0x1433('0x1d')];var _0x265fd6=_0x53a88a?_0x4c889d[_0x1433('0x20')]:_0xa10196[_0x1433('0x1d')]+_0xa10196[_0x1433('0x1f')];var _0x4b8417;if(_0x265fd6>=_0x27f2da){_0x265fd6=_0x27f2da;_0x4b8417=0xc8;}else{_0x4b8417=0xce;}_0x1d6a2e[_0x1433('0x1a')](_0x4b8417);return _0x1d6a2e['set'](_0x1433('0x21'),_0x245750+'-'+_0x265fd6+'/'+_0x27f2da)[_0x1433('0x1c')](_0x4c889d);}return null;};}function patchUpdates(_0x533c49){return function(_0x4de63c){try{jsonpatch['apply'](_0x4de63c,_0x533c49,!![]);}catch(_0xa8ec3c){return BPromise['reject'](_0xa8ec3c);}return _0x4de63c[_0x1433('0x22')]();};}function saveUpdates(_0x29b769,_0x3729e3){return function(_0x283c81){if(_0x283c81){return _0x283c81[_0x1433('0x23')](_0x29b769)[_0x1433('0x24')](function(_0x41d26d){return _0x41d26d;});}return null;};}function removeEntity(_0x1ae3bd,_0x3a288d){return function(_0xff7dcd){if(_0xff7dcd){return _0xff7dcd[_0x1433('0x25')]()[_0x1433('0x24')](function(){_0x1ae3bd[_0x1433('0x1a')](0xcc)[_0x1433('0x1b')]();});}};}function handleEntityNotFound(_0x40279,_0x76138c){return function(_0x43d9ed){if(!_0x43d9ed){_0x40279[_0x1433('0x19')](0x194);}return _0x43d9ed;};}function handleError(_0x1d7494,_0x32b41d){_0x32b41d=_0x32b41d||0x1f4;return function(_0x329a35){logger[_0x1433('0x26')](_0x329a35[_0x1433('0x27')]);if(_0x329a35[_0x1433('0x28')]){delete _0x329a35[_0x1433('0x28')];}_0x1d7494['status'](_0x32b41d)[_0x1433('0x29')](_0x329a35);};}exports['index']=function(_0x3cf006,_0x14b0d2){var _0x3e99c9={},_0x210660={},_0x19f211={'count':0x0,'rows':[]};var _0x296d7a=_[_0x1433('0x2a')](db[_0x1433('0x2b')][_0x1433('0x2c')],function(_0x29312f){return{'name':_0x29312f['fieldName'],'type':_0x29312f[_0x1433('0x2d')][_0x1433('0x2e')]};});_0x210660[_0x1433('0x2f')]=_[_0x1433('0x2a')](_0x296d7a,_0x1433('0x28'));_0x210660[_0x1433('0x30')]=_[_0x1433('0x31')](_0x3cf006[_0x1433('0x30')]);_0x210660[_0x1433('0x32')]=_[_0x1433('0x33')](_0x210660[_0x1433('0x2f')],_0x210660[_0x1433('0x30')]);_0x3e99c9[_0x1433('0x34')]=_[_0x1433('0x33')](_0x210660[_0x1433('0x2f')],qs[_0x1433('0x35')](_0x3cf006[_0x1433('0x30')][_0x1433('0x35')]));_0x3e99c9['attributes']=_0x3e99c9['attributes'][_0x1433('0x36')]?_0x3e99c9['attributes']:_0x210660[_0x1433('0x2f')];if(!_0x3cf006[_0x1433('0x30')]['hasOwnProperty']('nolimit')){_0x3e99c9[_0x1433('0x1f')]=qs[_0x1433('0x1f')](_0x3cf006['query'][_0x1433('0x1f')]);_0x3e99c9[_0x1433('0x1d')]=qs[_0x1433('0x1d')](_0x3cf006[_0x1433('0x30')][_0x1433('0x1d')]);}_0x3e99c9[_0x1433('0x37')]=qs[_0x1433('0x38')](_0x3cf006[_0x1433('0x30')][_0x1433('0x38')]);_0x3e99c9['where']=qs[_0x1433('0x32')](_[_0x1433('0x39')](_0x3cf006[_0x1433('0x30')],_0x210660['filters']),_0x296d7a);if(_0x3cf006[_0x1433('0x30')][_0x1433('0x3a')]){_0x3e99c9[_0x1433('0x3b')]=_[_0x1433('0x3c')](_0x3e99c9[_0x1433('0x3b')],{'$or':_[_0x1433('0x2a')](_0x296d7a,function(_0x53f423){if(_0x53f423['type']!=='VIRTUAL'){var _0x5843d3={};_0x5843d3[_0x53f423[_0x1433('0x28')]]={'$like':'%'+_0x3cf006[_0x1433('0x30')]['filter']+'%'};return _0x5843d3;}})});}_0x3e99c9=_[_0x1433('0x3c')]({},_0x3e99c9,_0x3cf006['options']);var _0x45c55c={'where':_0x3e99c9[_0x1433('0x3b')]};return db[_0x1433('0x2b')][_0x1433('0x20')](_0x45c55c)[_0x1433('0x24')](function(_0x5566a2){_0x19f211['count']=_0x5566a2;if(_0x3cf006[_0x1433('0x30')][_0x1433('0x3d')]){_0x3e99c9[_0x1433('0x3e')]=[{'all':!![]}];}return db[_0x1433('0x2b')]['findAll'](_0x3e99c9);})[_0x1433('0x24')](function(_0x484804){_0x19f211[_0x1433('0x3f')]=_0x484804;return _0x19f211;})['then'](respondWithFilteredResult(_0x14b0d2,_0x3e99c9))['catch'](handleError(_0x14b0d2,null));};exports[_0x1433('0x40')]=function(_0x2462d2,_0x259dea){var _0x192193={'raw':![],'where':{'id':_0x2462d2['params']['id']}},_0x672318={};_0x672318[_0x1433('0x2f')]=_['keys'](db[_0x1433('0x2b')][_0x1433('0x2c')]);_0x672318[_0x1433('0x30')]=_['keys'](_0x2462d2['query']);_0x672318[_0x1433('0x32')]=_['intersection'](_0x672318[_0x1433('0x2f')],_0x672318['query']);_0x192193[_0x1433('0x34')]=_[_0x1433('0x33')](_0x672318[_0x1433('0x2f')],qs['fields'](_0x2462d2[_0x1433('0x30')]['fields']));_0x192193[_0x1433('0x34')]=_0x192193[_0x1433('0x34')][_0x1433('0x36')]?_0x192193[_0x1433('0x34')]:_0x672318[_0x1433('0x2f')];if(_0x2462d2['query'][_0x1433('0x3d')]){_0x192193['include']=[{'all':!![]}];}_0x192193=_['merge']({},_0x192193,_0x2462d2[_0x1433('0x41')]);return db[_0x1433('0x2b')][_0x1433('0x42')](_0x192193)[_0x1433('0x24')](handleEntityNotFound(_0x259dea,null))['then'](respondWithResult(_0x259dea,null))['catch'](handleError(_0x259dea,null));};exports['create']=function(_0x4d8d04,_0xd57a07){return db[_0x1433('0x2b')]['create'](_0x4d8d04['body'],{})[_0x1433('0x24')](respondWithResult(_0xd57a07,0xc9))[_0x1433('0x43')](handleError(_0xd57a07,null));};exports[_0x1433('0x23')]=function(_0x941072,_0x19783b){if(_0x941072[_0x1433('0x44')]['id']){delete _0x941072['body']['id'];}return db['UserProfileSection'][_0x1433('0x42')]({'where':{'id':_0x941072[_0x1433('0x45')]['id']}})[_0x1433('0x24')](handleEntityNotFound(_0x19783b,null))['then'](saveUpdates(_0x941072[_0x1433('0x44')],null))[_0x1433('0x24')](respondWithResult(_0x19783b,null))['catch'](handleError(_0x19783b,null));};exports[_0x1433('0x25')]=function(_0x4cce3b,_0x4f3b1d){return db[_0x1433('0x2b')][_0x1433('0x42')]({'where':{'id':_0x4cce3b['params']['id']}})[_0x1433('0x24')](handleEntityNotFound(_0x4f3b1d,null))[_0x1433('0x24')](removeEntity(_0x4f3b1d,null))[_0x1433('0x43')](handleError(_0x4f3b1d,null));};exports['describe']=function(_0x36cfa4,_0x187e36){return db[_0x1433('0x2b')][_0x1433('0x46')]()[_0x1433('0x24')](respondWithResult(_0x187e36,null))[_0x1433('0x43')](handleError(_0x187e36,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 8e9db3a..af2c490 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 _0x1279=['userProfileId','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','sectionId'];(function(_0x5eb64c,_0x2a3a54){var _0x5f00e1=function(_0x1d9b48){while(--_0x1d9b48){_0x5eb64c['push'](_0x5eb64c['shift']());}};_0x5f00e1(++_0x2a3a54);}(_0x1279,0x1b9));var _0x9127=function(_0x589ead,_0x3142ee){_0x589ead=_0x589ead-0x0;var _0x2a5499=_0x1279[_0x589ead];return _0x2a5499;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9127('0x0'))(_0x9127('0x1'));var moment=require('moment');var BPromise=require(_0x9127('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9127('0x3'));var rimraf=require(_0x9127('0x4'));var config=require(_0x9127('0x5'));var attributes=require(_0x9127('0x6'));module[_0x9127('0x7')]=function(_0x5eb983,_0x3e9e12){return _0x5eb983[_0x9127('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x9127('0x9'),_0x9127('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde42=['moment','bluebird','request-promise','path','rimraf','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api'];(function(_0x558c04,_0x34467d){var _0x4d2100=function(_0x34f2f0){while(--_0x34f2f0){_0x558c04['push'](_0x558c04['shift']());}};_0x4d2100(++_0x34467d);}(_0xde42,0xa6));var _0x2de4=function(_0x54a687,_0x4ce189){_0x54a687=_0x54a687-0x0;var _0x4b5083=_0xde42[_0x54a687];return _0x4b5083;};'use strict';var _=require(_0x2de4('0x0'));var util=require('util');var logger=require(_0x2de4('0x1'))(_0x2de4('0x2'));var moment=require(_0x2de4('0x3'));var BPromise=require(_0x2de4('0x4'));var rp=require(_0x2de4('0x5'));var fs=require('fs');var path=require(_0x2de4('0x6'));var rimraf=require(_0x2de4('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x3bb8b2,_0x8cffeb){return _0x3bb8b2['define'](_0x2de4('0x8'),attributes,{'tableName':_0x2de4('0x9'),'paranoid':![],'indexes':[{'name':_0x2de4('0xa'),'fields':[_0x2de4('0xb'),_0x2de4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 80ccb56..537d684 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 _0x1ddb=['info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','request','then'];(function(_0x4eb933,_0xa5016b){var _0x3c24e6=function(_0x5ab0a2){while(--_0x5ab0a2){_0x4eb933['push'](_0x4eb933['shift']());}};_0x3c24e6(++_0xa5016b);}(_0x1ddb,0xa1));var _0xb1dd=function(_0x39758d,_0x346423){_0x39758d=_0x39758d-0x0;var _0x44ac11=_0x1ddb[_0x39758d];return _0x44ac11;};'use strict';var _=require(_0xb1dd('0x0'));var util=require(_0xb1dd('0x1'));var moment=require(_0xb1dd('0x2'));var BPromise=require(_0xb1dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb1dd('0x4'));var logger=require('../../config/logger')(_0xb1dd('0x5'));var config=require('../../config/environment');var jayson=require(_0xb1dd('0x6'));var client=jayson[_0xb1dd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x441807,_0x277f7d,_0x1a0840){return new BPromise(function(_0x75b4bc,_0x288d9a){return client[_0xb1dd('0x8')](_0x441807,_0x1a0840)[_0xb1dd('0x9')](function(_0x4dc243){logger[_0xb1dd('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x277f7d,_0xb1dd('0xb'));logger['debug'](_0xb1dd('0xc'),_0x277f7d,_0xb1dd('0xb'),JSON[_0xb1dd('0xd')](_0x4dc243));if(_0x4dc243[_0xb1dd('0xe')]){if(_0x4dc243[_0xb1dd('0xe')][_0xb1dd('0xf')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x277f7d,_0x4dc243['error']['message']);return _0x288d9a(_0x4dc243[_0xb1dd('0xe')][_0xb1dd('0x10')]);}logger[_0xb1dd('0xe')](_0xb1dd('0x11'),_0x277f7d,_0x4dc243[_0xb1dd('0xe')][_0xb1dd('0x10')]);return _0x75b4bc(_0x4dc243[_0xb1dd('0xe')][_0xb1dd('0x10')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x277f7d,_0xb1dd('0xb'));_0x75b4bc(_0x4dc243[_0xb1dd('0x12')][_0xb1dd('0x10')]);}})['catch'](function(_0x18ed9c){logger['error'](_0xb1dd('0x11'),_0x277f7d,_0x18ed9c);_0x288d9a(_0x18ed9c);});});} \ No newline at end of file +var _0x966f=['error','message','UserProfileSection,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x966f,0x82));var _0xf966=function(_0x2ab0b6,_0x411775){_0x2ab0b6=_0x2ab0b6-0x0;var _0x401eb3=_0x966f[_0x2ab0b6];return _0x401eb3;};'use strict';var _=require(_0xf966('0x0'));var util=require('util');var moment=require(_0xf966('0x1'));var BPromise=require(_0xf966('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf966('0x3'));var db=require(_0xf966('0x4'))['db'];var utils=require(_0xf966('0x5'));var logger=require('../../config/logger')(_0xf966('0x6'));var config=require(_0xf966('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf966('0x8')][_0xf966('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151c62,_0x5b193e,_0x40333b){return new BPromise(function(_0xfb0c7,_0x19433c){return client[_0xf966('0xa')](_0x151c62,_0x40333b)[_0xf966('0xb')](function(_0x4ee0fc){logger[_0xf966('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x5b193e,_0xf966('0xd'));logger[_0xf966('0xe')](_0xf966('0xf'),_0x5b193e,_0xf966('0xd'),JSON[_0xf966('0x10')](_0x4ee0fc));if(_0x4ee0fc[_0xf966('0x11')]){if(_0x4ee0fc['error']['code']===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5b193e,_0x4ee0fc[_0xf966('0x11')][_0xf966('0x12')]);return _0x19433c(_0x4ee0fc['error'][_0xf966('0x12')]);}logger[_0xf966('0x11')](_0xf966('0x13'),_0x5b193e,_0x4ee0fc[_0xf966('0x11')][_0xf966('0x12')]);return _0xfb0c7(_0x4ee0fc[_0xf966('0x11')][_0xf966('0x12')]);}else{logger['info'](_0xf966('0x13'),_0x5b193e,_0xf966('0xd'));_0xfb0c7(_0x4ee0fc['result'][_0xf966('0x12')]);}})[_0xf966('0x14')](function(_0x2affe5){logger[_0xf966('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x5b193e,_0x2affe5);_0x19433c(_0x2affe5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index dfc8913..164806b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xca8f32,_0xe6ba73){var _0x4c23f8=function(_0x469c16){while(--_0x469c16){_0xca8f32['push'](_0xca8f32['shift']());}};_0x4c23f8(++_0xe6ba73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2aef75,_0x13edab){var _0x26e106=function(_0x37b29a){while(--_0x37b29a){_0x2aef75['push'](_0x2aef75['shift']());}};_0x26e106(++_0x13edab);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2f35506..e4bd753 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 _0x59ca=['sequelize','exports','INTEGER'];(function(_0x1e3f81,_0x905eaa){var _0x254459=function(_0x54ee1a){while(--_0x54ee1a){_0x1e3f81['push'](_0x1e3f81['shift']());}};_0x254459(++_0x905eaa);}(_0x59ca,0x162));var _0xa59c=function(_0x309e39,_0xad34c5){_0x309e39=_0x309e39-0x0;var _0x4ac0ac=_0x59ca[_0x309e39];return _0x4ac0ac;};'use strict';var Sequelize=require(_0xa59c('0x0'));module[_0xa59c('0x1')]={'penalty':{'type':Sequelize[_0xa59c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2690=['exports','INTEGER','sequelize'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x2690,0xa7));var _0x0269=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x2690[_0x12c34e];return _0x244e88;};'use strict';var Sequelize=require(_0x0269('0x0'));module[_0x0269('0x1')]={'penalty':{'type':Sequelize[_0x0269('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 2096060..69f8207 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 _0xc4aa=['bluebird','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83d0=['./userSmsQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xdad4ab,_0x23a404){var _0x968b4a=function(_0x56b5bb){while(--_0x56b5bb){_0xdad4ab['push'](_0xdad4ab['shift']());}};_0x968b4a(++_0x23a404);}(_0x83d0,0xb7));var _0x083d=function(_0x3428fa,_0x27cb9d){_0x3428fa=_0x3428fa-0x0;var _0x151e4c=_0x83d0[_0x3428fa];return _0x151e4c;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var logger=require(_0x083d('0x2'))(_0x083d('0x3'));var moment=require(_0x083d('0x4'));var BPromise=require(_0x083d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x083d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x083d('0x7'));module[_0x083d('0x8')]=function(_0x3c4b8c,_0x2e75e8){return _0x3c4b8c[_0x083d('0x9')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 2e467d2..2700fba 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 _0xcd02=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x6848c7,_0x1d76d5){var _0x17d568=function(_0x3a9c28){while(--_0x3a9c28){_0x6848c7['push'](_0x6848c7['shift']());}};_0x17d568(++_0x1d76d5);}(_0xcd02,0x1e8));var _0x2cd0=function(_0x11ea72,_0x36c5ae){_0x11ea72=_0x11ea72-0x0;var _0x147bef=_0xcd02[_0x11ea72];return _0x147bef;};'use strict';var _=require(_0x2cd0('0x0'));var util=require(_0x2cd0('0x1'));var moment=require(_0x2cd0('0x2'));var BPromise=require(_0x2cd0('0x3'));var rs=require(_0x2cd0('0x4'));var fs=require('fs');var Redis=require(_0x2cd0('0x5'));var db=require(_0x2cd0('0x6'))['db'];var utils=require(_0x2cd0('0x7'));var logger=require(_0x2cd0('0x8'))('rpc');var config=require(_0x2cd0('0x9'));var jayson=require(_0x2cd0('0xa'));var client=jayson[_0x2cd0('0xb')][_0x2cd0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe247bc,_0x4264c2,_0x394ead){return new BPromise(function(_0x9bf382,_0x4abc87){return client['request'](_0xe247bc,_0x394ead)['then'](function(_0x2041ba){logger['info'](_0x2cd0('0xd'),_0x4264c2,_0x2cd0('0xe'));logger[_0x2cd0('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4264c2,_0x2cd0('0xe'),JSON[_0x2cd0('0x10')](_0x2041ba));if(_0x2041ba['error']){if(_0x2041ba[_0x2cd0('0x11')][_0x2cd0('0x12')]===0x1f4){logger[_0x2cd0('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x4264c2,_0x2041ba['error'][_0x2cd0('0x13')]);return _0x4abc87(_0x2041ba[_0x2cd0('0x11')][_0x2cd0('0x13')]);}logger[_0x2cd0('0x11')](_0x2cd0('0xd'),_0x4264c2,_0x2041ba[_0x2cd0('0x11')]['message']);return _0x9bf382(_0x2041ba[_0x2cd0('0x11')][_0x2cd0('0x13')]);}else{logger[_0x2cd0('0x14')](_0x2cd0('0xd'),_0x4264c2,'request\x20sent');_0x9bf382(_0x2041ba[_0x2cd0('0x15')][_0x2cd0('0x13')]);}})[_0x2cd0('0x16')](function(_0x174da4){logger[_0x2cd0('0x11')](_0x2cd0('0xd'),_0x4264c2,_0x174da4);_0x4abc87(_0x174da4);});});} \ No newline at end of file +var _0x5bf8=['UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug'];(function(_0x4ba254,_0x347d9b){var _0x4efbb7=function(_0x309e71){while(--_0x309e71){_0x4ba254['push'](_0x4ba254['shift']());}};_0x4efbb7(++_0x347d9b);}(_0x5bf8,0x192));var _0x85bf=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0x5bf8[_0xc1263e];return _0x471f07;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var moment=require(_0x85bf('0x2'));var BPromise=require(_0x85bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85bf('0x4'));var db=require(_0x85bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x85bf('0x6'))(_0x85bf('0x7'));var config=require(_0x85bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x85bf('0x9')][_0x85bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f8533,_0x348219,_0x5930bb){return new BPromise(function(_0x47bf1d,_0x478e32){return client[_0x85bf('0xb')](_0x3f8533,_0x5930bb)[_0x85bf('0xc')](function(_0xd8b428){logger[_0x85bf('0xd')](_0x85bf('0xe'),_0x348219,'request\x20sent');logger[_0x85bf('0xf')](_0x85bf('0x10'),_0x348219,'request\x20sent',JSON[_0x85bf('0x11')](_0xd8b428));if(_0xd8b428[_0x85bf('0x12')]){if(_0xd8b428['error']['code']===0x1f4){logger[_0x85bf('0x12')](_0x85bf('0xe'),_0x348219,_0xd8b428[_0x85bf('0x12')][_0x85bf('0x13')]);return _0x478e32(_0xd8b428[_0x85bf('0x12')][_0x85bf('0x13')]);}logger[_0x85bf('0x12')](_0x85bf('0xe'),_0x348219,_0xd8b428[_0x85bf('0x12')][_0x85bf('0x13')]);return _0x47bf1d(_0xd8b428['error']['message']);}else{logger[_0x85bf('0xd')](_0x85bf('0xe'),_0x348219,_0x85bf('0x14'));_0x47bf1d(_0xd8b428['result'][_0x85bf('0x13')]);}})[_0x85bf('0x15')](function(_0x19dfe0){logger[_0x85bf('0x12')](_0x85bf('0xe'),_0x348219,_0x19dfe0);_0x478e32(_0x19dfe0);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index e2f4d69..034b18a 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 _0x1eec=['INTEGER','sequelize'];(function(_0x2eb8c1,_0x2c21ea){var _0x1299de=function(_0x3dfeb8){while(--_0x3dfeb8){_0x2eb8c1['push'](_0x2eb8c1['shift']());}};_0x1299de(++_0x2c21ea);}(_0x1eec,0x157));var _0xc1ee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1eec[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xc1ee('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xc1ee('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe7b8=['INTEGER'];(function(_0x592ac8,_0x546a71){var _0x1e123=function(_0xb0d996){while(--_0xb0d996){_0x592ac8['push'](_0x592ac8['shift']());}};_0x1e123(++_0x546a71);}(_0xe7b8,0x1e1));var _0x8e7b=function(_0x4e5fe3,_0x27bd75){_0x4e5fe3=_0x4e5fe3-0x0;var _0x3f9aac=_0xe7b8[_0x4e5fe3];return _0x3f9aac;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0x8e7b('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 1662875..e06803a 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(_0x53649a,_0x5a278d){var _0x1a5c2f=function(_0x5b44db){while(--_0x5b44db){_0x53649a['push'](_0x53649a['shift']());}};_0x1a5c2f(++_0x5a278d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x36ccc1,_0x53aa40){var _0x162dcf=function(_0x122fd2){while(--_0x122fd2){_0x36ccc1['push'](_0x36ccc1['shift']());}};_0x162dcf(++_0x53aa40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 cbaf324..e71c6fd 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x36585e,_0x436e16){var _0x4a1816=function(_0x3cffa2){while(--_0x3cffa2){_0x36585e['push'](_0x36585e['shift']());}};_0x4a1816(++_0x436e16);}(_0x70e0,0x17b));var _0x070e=function(_0x5064d5,_0x1dedb5){_0x5064d5=_0x5064d5-0x0;var _0x1715a5=_0x70e0[_0x5064d5];return _0x1715a5;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x21b8db,_0x2593ee){var _0x2d14c8=function(_0x17c21){while(--_0x17c21){_0x21b8db['push'](_0x21b8db['shift']());}};_0x2d14c8(++_0x2593ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 71cf18c..0186759 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 _0xe93b=['exports','INTEGER'];(function(_0x2fb866,_0x59bc0c){var _0x5d310f=function(_0x13bf75){while(--_0x13bf75){_0x2fb866['push'](_0x2fb866['shift']());}};_0x5d310f(++_0x59bc0c);}(_0xe93b,0x1c2));var _0xbe93=function(_0x32c3cc,_0x1cf566){_0x32c3cc=_0x32c3cc-0x0;var _0x3a8c35=_0xe93b[_0x32c3cc];return _0x3a8c35;};'use strict';var Sequelize=require('sequelize');module[_0xbe93('0x0')]={'penalty':{'type':Sequelize[_0xbe93('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf505=['INTEGER'];(function(_0x1c5adf,_0x12a026){var _0x3dd9c2=function(_0x25e4d9){while(--_0x25e4d9){_0x1c5adf['push'](_0x1c5adf['shift']());}};_0x3dd9c2(++_0x12a026);}(_0xf505,0x14b));var _0x5f50=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xf505[_0x8ba19a];return _0x2bd8b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5f50('0x0')],'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 6835528..21d79c0 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 _0x3004=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x5f445c,_0x42725b){var _0x4b44cf=function(_0x5580fd){while(--_0x5580fd){_0x5f445c['push'](_0x5f445c['shift']());}};_0x4b44cf(++_0x42725b);}(_0x3004,0x1c3));var _0x4300=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3004[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0x4300('0x0'));var logger=require(_0x4300('0x1'))(_0x4300('0x2'));var moment=require('moment');var BPromise=require(_0x4300('0x3'));var rp=require(_0x4300('0x4'));var fs=require('fs');var path=require(_0x4300('0x5'));var rimraf=require(_0x4300('0x6'));var config=require(_0x4300('0x7'));var attributes=require(_0x4300('0x8'));module[_0x4300('0x9')]=function(_0x5f5421,_0x5785b8){return _0x5f5421[_0x4300('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25a=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','user_has_voice_queues'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xa25a,0x6e));var _0xaa25=function(_0x3977f8,_0x38abe4){_0x3977f8=_0x3977f8-0x0;var _0x49629d=_0xa25a[_0x3977f8];return _0x49629d;};'use strict';var _=require(_0xaa25('0x0'));var util=require('util');var logger=require(_0xaa25('0x1'))(_0xaa25('0x2'));var moment=require(_0xaa25('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa25('0x4'));var fs=require('fs');var path=require(_0xaa25('0x5'));var rimraf=require(_0xaa25('0x6'));var config=require('../../config/environment');var attributes=require(_0xaa25('0x7'));module[_0xaa25('0x8')]=function(_0x159b79,_0xf29af8){return _0x159b79['define']('UserVoiceQueue',attributes,{'tableName':_0xaa25('0x9'),'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 b2a9966..063ab25 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 _0x8c00=['code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d082d,_0x155828){var _0xcd82e9=function(_0x44a203){while(--_0x44a203){_0x4d082d['push'](_0x4d082d['shift']());}};_0xcd82e9(++_0x155828);}(_0x8c00,0x17e));var _0x08c0=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0x8c00[_0xfb65aa];return _0x2aee31;};'use strict';var _=require('lodash');var util=require(_0x08c0('0x0'));var moment=require(_0x08c0('0x1'));var BPromise=require(_0x08c0('0x2'));var rs=require(_0x08c0('0x3'));var fs=require('fs');var Redis=require(_0x08c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x08c0('0x5'))(_0x08c0('0x6'));var config=require(_0x08c0('0x7'));var jayson=require(_0x08c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x442835,_0x56e582,_0x35e6d4){return new BPromise(function(_0x5d3e5a,_0x4172f8){return client[_0x08c0('0x9')](_0x442835,_0x35e6d4)[_0x08c0('0xa')](function(_0x29aff5){logger['info'](_0x08c0('0xb'),_0x56e582,_0x08c0('0xc'));logger[_0x08c0('0xd')](_0x08c0('0xe'),_0x56e582,_0x08c0('0xc'),JSON[_0x08c0('0xf')](_0x29aff5));if(_0x29aff5[_0x08c0('0x10')]){if(_0x29aff5[_0x08c0('0x10')][_0x08c0('0x11')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x56e582,_0x29aff5[_0x08c0('0x10')][_0x08c0('0x12')]);return _0x4172f8(_0x29aff5[_0x08c0('0x10')][_0x08c0('0x12')]);}logger[_0x08c0('0x10')](_0x08c0('0xb'),_0x56e582,_0x29aff5[_0x08c0('0x10')][_0x08c0('0x12')]);return _0x5d3e5a(_0x29aff5[_0x08c0('0x10')][_0x08c0('0x12')]);}else{logger[_0x08c0('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x56e582,_0x08c0('0xc'));_0x5d3e5a(_0x29aff5[_0x08c0('0x14')][_0x08c0('0x12')]);}})['catch'](function(_0x53aa6a){logger['error'](_0x08c0('0xb'),_0x56e582,_0x53aa6a);_0x4172f8(_0x53aa6a);});});} \ No newline at end of file +var _0xe84f=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x103032,_0x160287){var _0x12dfc9=function(_0x98ef3f){while(--_0x98ef3f){_0x103032['push'](_0x103032['shift']());}};_0x12dfc9(++_0x160287);}(_0xe84f,0xba));var _0xfe84=function(_0x343a2c,_0x4a9805){_0x343a2c=_0x343a2c-0x0;var _0x255906=_0xe84f[_0x343a2c];return _0x255906;};'use strict';var _=require('lodash');var util=require(_0xfe84('0x0'));var moment=require(_0xfe84('0x1'));var BPromise=require(_0xfe84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe84('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe84('0x4'))(_0xfe84('0x5'));var config=require('../../config/environment');var jayson=require(_0xfe84('0x6'));var client=jayson[_0xfe84('0x7')][_0xfe84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ee89a,_0x4fe6c7,_0x5489cd){return new BPromise(function(_0x427463,_0x98c981){return client[_0xfe84('0x9')](_0x1ee89a,_0x5489cd)[_0xfe84('0xa')](function(_0x437e68){logger[_0xfe84('0xb')](_0xfe84('0xc'),_0x4fe6c7,_0xfe84('0xd'));logger[_0xfe84('0xe')](_0xfe84('0xf'),_0x4fe6c7,_0xfe84('0xd'),JSON[_0xfe84('0x10')](_0x437e68));if(_0x437e68[_0xfe84('0x11')]){if(_0x437e68['error']['code']===0x1f4){logger[_0xfe84('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x4fe6c7,_0x437e68[_0xfe84('0x11')][_0xfe84('0x12')]);return _0x98c981(_0x437e68['error'][_0xfe84('0x12')]);}logger[_0xfe84('0x11')](_0xfe84('0xc'),_0x4fe6c7,_0x437e68[_0xfe84('0x11')][_0xfe84('0x12')]);return _0x427463(_0x437e68[_0xfe84('0x11')][_0xfe84('0x12')]);}else{logger[_0xfe84('0xb')](_0xfe84('0xc'),_0x4fe6c7,_0xfe84('0xd'));_0x427463(_0x437e68['result']['message']);}})[_0xfe84('0x13')](function(_0x2b9b42){logger['error'](_0xfe84('0xc'),_0x4fe6c7,_0x2b9b42);_0x98c981(_0x2b9b42);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index eace1b2..e6f555d 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3ee4c9,_0xe764b1){var _0x4669ca=function(_0x21112a){while(--_0x21112a){_0x3ee4c9['push'](_0x3ee4c9['shift']());}};_0x4669ca(++_0xe764b1);}(_0x70e0,0x17b));var _0x070e=function(_0x19efb0,_0x3b193e){_0x19efb0=_0x19efb0-0x0;var _0x4cbda2=_0x70e0[_0x19efb0];return _0x4cbda2;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x592e8e,_0x182f70){var _0x59fcfa=function(_0x1717be){while(--_0x1717be){_0x592e8e['push'](_0x592e8e['shift']());}};_0x59fcfa(++_0x182f70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('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 164329d..b086d06 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 _0xa16e=['STRING','queue_interface','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa16e,0x189));var _0xea16=function(_0x57c741,_0x26dcc5){_0x57c741=_0x57c741-0x0;var _0x248821=_0xa16e[_0x57c741];return _0x248821;};'use strict';var Sequelize=require(_0xea16('0x0'));module[_0xea16('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xea16('0x2')},'membername':{'type':Sequelize[_0xea16('0x3')],'allowNull':![],'comment':_0xea16('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xea16('0x3')],'allowNull':![],'unique':_0xea16('0x4'),'comment':_0xea16('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xea16('0x3')],'allowNull':![],'unique':_0xea16('0x4'),'comment':_0xea16('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xea16('0x2')},'paused':{'type':Sequelize[_0xea16('0x5')](0xb),'defaultValue':0x0,'comment':_0xea16('0x2')}}; \ No newline at end of file +var _0x3feb=['STRING','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4e3939,_0x51d584){var _0x258e04=function(_0x4ec56b){while(--_0x4ec56b){_0x4e3939['push'](_0x4e3939['shift']());}};_0x258e04(++_0x51d584);}(_0x3feb,0xf4));var _0xb3fe=function(_0x2ff71e,_0x33622c){_0x2ff71e=_0x2ff71e-0x0;var _0x2d1053=_0x3feb[_0x2ff71e];return _0x2d1053;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb3fe('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb3fe('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb3fe('0x1')},'UserId':{'type':Sequelize[_0xb3fe('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xb3fe('0x1')},'VoiceQueueId':{'type':Sequelize[_0xb3fe('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0xb3fe('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xb3fe('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xb3fe('0x0')](0xb),'defaultValue':0x0,'comment':_0xb3fe('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 16743a4..46906b3 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 _0x18ff=['hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x18ff,0x1a7));var _0xf18f=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x18ff[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xf18f('0x0'))['db'][_0xf18f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf18f('0x2')](0x0);var events={'afterCreate':_0xf18f('0x3'),'afterUpdate':_0xf18f('0x4'),'afterDestroy':_0xf18f('0x5')};function emitEvent(_0x5f1472){return function(_0x5d3eea,_0x1c7778,_0x3222fb){UserVoiceQueueRtEvents[_0xf18f('0x6')](_0x5f1472+':'+_0x5d3eea['id'],_0x5d3eea);UserVoiceQueueRtEvents[_0xf18f('0x6')](_0x5f1472,_0x5d3eea);_0x3222fb(null);};}for(var e in events){if(events[_0xf18f('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xf18f('0x8')](e,emitEvent(event));}}module[_0xf18f('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x44e1=['remove','emit','hasOwnProperty','../../mysqldb','UserVoiceQueueRt','save','update'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x44e1,0x18b));var _0x144e=function(_0x197df3,_0x57d366){_0x197df3=_0x197df3-0x0;var _0xafdaf7=_0x44e1[_0x197df3];return _0xafdaf7;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x144e('0x0'))['db'][_0x144e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x144e('0x2'),'afterUpdate':_0x144e('0x3'),'afterDestroy':_0x144e('0x4')};function emitEvent(_0x56a1eb){return function(_0x161315,_0xe824e3,_0x22b789){UserVoiceQueueRtEvents[_0x144e('0x5')](_0x56a1eb+':'+_0x161315['id'],_0x161315);UserVoiceQueueRtEvents[_0x144e('0x5')](_0x56a1eb,_0x161315);_0x22b789(null);};}for(var e in events){if(events[_0x144e('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 1f52bb6..5067ee9 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 _0x7b51=['exports','define','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x4750da,_0x25dd7e){var _0x38cb4d=function(_0x3cd17e){while(--_0x3cd17e){_0x4750da['push'](_0x4750da['shift']());}};_0x38cb4d(++_0x25dd7e);}(_0x7b51,0x92));var _0x17b5=function(_0x3199ea,_0x4d36e5){_0x3199ea=_0x3199ea-0x0;var _0x41abc4=_0x7b51[_0x3199ea];return _0x41abc4;};'use strict';var _=require(_0x17b5('0x0'));var util=require('util');var logger=require(_0x17b5('0x1'))(_0x17b5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x17b5('0x3'));var rimraf=require(_0x17b5('0x4'));var config=require(_0x17b5('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x17b5('0x6')]=function(_0x257e63,_0x5e9288){return _0x257e63[_0x17b5('0x7')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9330=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x9330,0x1f2));var _0x0933=function(_0xabbbff,_0x1d2c79){_0xabbbff=_0xabbbff-0x0;var _0x2315ba=_0x9330[_0xabbbff];return _0x2315ba;};'use strict';var _=require(_0x0933('0x0'));var util=require(_0x0933('0x1'));var logger=require(_0x0933('0x2'))('api');var moment=require(_0x0933('0x3'));var BPromise=require(_0x0933('0x4'));var rp=require(_0x0933('0x5'));var fs=require('fs');var path=require(_0x0933('0x6'));var rimraf=require(_0x0933('0x7'));var config=require(_0x0933('0x8'));var attributes=require(_0x0933('0x9'));module['exports']=function(_0x597a9e,_0x2f8836){return _0x597a9e['define'](_0x0933('0xa'),attributes,{'tableName':_0x0933('0xb'),'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 cf57243..c0e12b3 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 _0x6006=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','raw','options','where','COUNT','sequelize','literal','outboundQueuePauses','lodash','util'];(function(_0x4e8db9,_0x15ff81){var _0x1fc3be=function(_0x1cc230){while(--_0x1cc230){_0x4e8db9['push'](_0x4e8db9['shift']());}};_0x1fc3be(++_0x15ff81);}(_0x6006,0xc1));var _0x6600=function(_0x162567,_0x320778){_0x162567=_0x162567-0x0;var _0x325239=_0x6006[_0x162567];return _0x325239;};'use strict';var _=require(_0x6600('0x0'));var util=require(_0x6600('0x1'));var moment=require(_0x6600('0x2'));var BPromise=require('bluebird');var rs=require(_0x6600('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6600('0x4'))['db'];var utils=require(_0x6600('0x5'));var logger=require(_0x6600('0x6'))(_0x6600('0x7'));var config=require('../../config/environment');var jayson=require(_0x6600('0x8'));var client=jayson[_0x6600('0x9')][_0x6600('0xa')]({'port':0x232a});config[_0x6600('0xb')]=_[_0x6600('0xc')](config[_0x6600('0xb')],{'host':_0x6600('0xd'),'port':0x18eb});var socket=require(_0x6600('0xe'))(new Redis(config[_0x6600('0xb')]));require(_0x6600('0xf'))[_0x6600('0x10')](socket);function respondWithRpcPromise(_0x10c129,_0x35015c,_0x336fb6){return new BPromise(function(_0xf205d4,_0x5ce5b8){return client[_0x6600('0x11')](_0x10c129,_0x336fb6)[_0x6600('0x12')](function(_0x37f351){logger[_0x6600('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x35015c,_0x6600('0x14'));logger[_0x6600('0x15')](_0x6600('0x16'),_0x35015c,_0x6600('0x14'),JSON[_0x6600('0x17')](_0x37f351));if(_0x37f351[_0x6600('0x18')]){if(_0x37f351[_0x6600('0x18')][_0x6600('0x19')]===0x1f4){logger[_0x6600('0x18')](_0x6600('0x1a'),_0x35015c,_0x37f351[_0x6600('0x18')]['message']);return _0x5ce5b8(_0x37f351['error']['message']);}logger[_0x6600('0x18')](_0x6600('0x1a'),_0x35015c,_0x37f351[_0x6600('0x18')][_0x6600('0x1b')]);return _0xf205d4(_0x37f351[_0x6600('0x18')][_0x6600('0x1b')]);}else{logger[_0x6600('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x35015c,'request\x20sent');_0xf205d4(_0x37f351[_0x6600('0x1c')][_0x6600('0x1b')]);}})[_0x6600('0x1d')](function(_0x261b17){logger[_0x6600('0x18')](_0x6600('0x1a'),_0x35015c,_0x261b17);_0x5ce5b8(_0x261b17);});});}exports[_0x6600('0x1e')]=function(_0x39a9a3){var _0x44d3fd=this;return new Promise(function(_0x1224bd,_0xe7574c){return db[_0x6600('0x1f')]['findAll']({'raw':_0x39a9a3['options']?_0x39a9a3['options'][_0x6600('0x20')]===undefined?!![]:![]:!![],'where':_0x39a9a3[_0x6600('0x21')]?_0x39a9a3[_0x6600('0x21')][_0x6600('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6600('0x23'),db[_0x6600('0x24')]['fn']('IF',db['sequelize'][_0x6600('0x25')]('`paused`\x20=\x201,\x201,\x20null'))),_0x6600('0x26')]]})[_0x6600('0x12')](function(_0x5f3d94){logger['info']('GetVoiceQueueRtPauses',_0x39a9a3);logger['debug'](_0x6600('0x1e'),_0x39a9a3,JSON[_0x6600('0x17')](_0x5f3d94));_0x1224bd(_0x5f3d94);})['catch'](function(_0x51ca47){logger['error'](_0x6600('0x1e'),_0x51ca47[_0x6600('0x1b')],_0x39a9a3);_0xe7574c(_0x44d3fd[_0x6600('0x18')](0x1f4,_0x51ca47[_0x6600('0x1b')]));});});}; \ No newline at end of file +var _0xbfe1=['error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xbfe1,0x9e));var _0x1bfe=function(_0x3ed24b,_0x4a15b5){_0x3ed24b=_0x3ed24b-0x0;var _0x4f5eaf=_0xbfe1[_0x3ed24b];return _0x4f5eaf;};'use strict';var _=require(_0x1bfe('0x0'));var util=require(_0x1bfe('0x1'));var moment=require(_0x1bfe('0x2'));var BPromise=require(_0x1bfe('0x3'));var rs=require(_0x1bfe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1bfe('0x5'));var logger=require(_0x1bfe('0x6'))(_0x1bfe('0x7'));var config=require(_0x1bfe('0x8'));var jayson=require(_0x1bfe('0x9'));var client=jayson[_0x1bfe('0xa')][_0x1bfe('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1bfe('0xc')],{'host':_0x1bfe('0xd'),'port':0x18eb});var socket=require(_0x1bfe('0xe'))(new Redis(config['redis']));require(_0x1bfe('0xf'))['register'](socket);function respondWithRpcPromise(_0x576388,_0x70457,_0x37715d){return new BPromise(function(_0x298362,_0x48257e){return client['request'](_0x576388,_0x37715d)[_0x1bfe('0x10')](function(_0x4a1cd7){logger[_0x1bfe('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x70457,_0x1bfe('0x12'));logger[_0x1bfe('0x13')](_0x1bfe('0x14'),_0x70457,'request\x20sent',JSON[_0x1bfe('0x15')](_0x4a1cd7));if(_0x4a1cd7['error']){if(_0x4a1cd7[_0x1bfe('0x16')][_0x1bfe('0x17')]===0x1f4){logger['error'](_0x1bfe('0x18'),_0x70457,_0x4a1cd7[_0x1bfe('0x16')][_0x1bfe('0x19')]);return _0x48257e(_0x4a1cd7[_0x1bfe('0x16')]['message']);}logger['error'](_0x1bfe('0x18'),_0x70457,_0x4a1cd7[_0x1bfe('0x16')]['message']);return _0x298362(_0x4a1cd7[_0x1bfe('0x16')][_0x1bfe('0x19')]);}else{logger[_0x1bfe('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x70457,_0x1bfe('0x12'));_0x298362(_0x4a1cd7[_0x1bfe('0x1a')][_0x1bfe('0x19')]);}})[_0x1bfe('0x1b')](function(_0x4ff47e){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x70457,_0x4ff47e);_0x48257e(_0x4ff47e);});});}exports['GetVoiceQueueRtPauses']=function(_0x520660){var _0x1ce517=this;return new Promise(function(_0x628635,_0x47391d){return db['UserVoiceQueueRt']['findAll']({'raw':_0x520660[_0x1bfe('0x1c')]?_0x520660[_0x1bfe('0x1c')][_0x1bfe('0x1d')]===undefined?!![]:![]:!![],'where':_0x520660[_0x1bfe('0x1c')]?_0x520660[_0x1bfe('0x1c')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x1bfe('0x1e'),db[_0x1bfe('0x1f')]['fn']('IF',db['sequelize'][_0x1bfe('0x20')](_0x1bfe('0x21')))),_0x1bfe('0x22')]]})[_0x1bfe('0x10')](function(_0x3efe95){logger[_0x1bfe('0x11')](_0x1bfe('0x23'),_0x520660);logger['debug'](_0x1bfe('0x23'),_0x520660,JSON[_0x1bfe('0x15')](_0x3efe95));_0x628635(_0x3efe95);})[_0x1bfe('0x1b')](function(_0xb51d70){logger[_0x1bfe('0x16')](_0x1bfe('0x23'),_0xb51d70['message'],_0x520660);_0x47391d(_0x1ce517[_0x1bfe('0x16')](0x1f4,_0xb51d70['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c021a79..3759cca 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 _0xd6bb=['update','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xd6bb[_0x7275e9];return _0x17b99d;};'use strict';var UserVoiceQueueRtEvents=require(_0xbd6b('0x0'));var events=['save',_0xbd6b('0x1'),_0xbd6b('0x2')];function createListener(_0x3c0eb7,_0x29f456){return function(_0x426b33){_0x29f456['emit'](_0x3c0eb7,_0x426b33);};}function removeListener(_0x43b80d,_0x1785c7){return function(){UserVoiceQueueRtEvents[_0xbd6b('0x3')](_0x43b80d,_0x1785c7);};}exports['register']=function(_0x256a94){for(var _0x15d0eb=0x0,_0xc309ad=events[_0xbd6b('0x4')];_0x15d0eb<_0xc309ad;_0x15d0eb++){var _0x31cae6=events[_0x15d0eb];var _0x315761=createListener(_0xbd6b('0x5')+_0x31cae6,_0x256a94);UserVoiceQueueRtEvents['on'](_0x31cae6,_0x315761);}}; \ No newline at end of file +var _0xf8bb=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener','register','length'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xf8bb,0x111));var _0xbf8b=function(_0x518e39,_0x2354d8){_0x518e39=_0x518e39-0x0;var _0x3531bc=_0xf8bb[_0x518e39];return _0x3531bc;};'use strict';var UserVoiceQueueRtEvents=require(_0xbf8b('0x0'));var events=[_0xbf8b('0x1'),_0xbf8b('0x2'),'update'];function createListener(_0x3b85fe,_0x27af0c){return function(_0x2d4a12){_0x27af0c[_0xbf8b('0x3')](_0x3b85fe,_0x2d4a12);};}function removeListener(_0x1d5006,_0x1a0b38){return function(){UserVoiceQueueRtEvents[_0xbf8b('0x4')](_0x1d5006,_0x1a0b38);};}exports[_0xbf8b('0x5')]=function(_0x441686){for(var _0x8d5666=0x0,_0x3b5f9e=events[_0xbf8b('0x6')];_0x8d5666<_0x3b5f9e;_0x8d5666++){var _0xd17f35=events[_0x8d5666];var _0x4b554f=createListener(_0xbf8b('0x7')+_0xd17f35,_0x441686);UserVoiceQueueRtEvents['on'](_0xd17f35,_0x4b554f);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5f9d53a..44265bf 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2cf64e,_0x48e77e){var _0x3174ec=function(_0x26412b){while(--_0x26412b){_0x2cf64e['push'](_0x2cf64e['shift']());}};_0x3174ec(++_0x48e77e);}(_0x70e0,0x17b));var _0x070e=function(_0x182a38,_0x218b62){_0x182a38=_0x182a38-0x0;var _0x2c62dd=_0x70e0[_0x182a38];return _0x2c62dd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2e5727,_0x1a1910){var _0x41faad=function(_0x309ab9){while(--_0x309ab9){_0x2e5727['push'](_0x2e5727['shift']());}};_0x41faad(++_0x1a1910);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 9cb4e0c..0959ac1 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 _0xea1c=['INTEGER','exports'];(function(_0x2d385b,_0x33ca46){var _0x24c994=function(_0x27324e){while(--_0x27324e){_0x2d385b['push'](_0x2d385b['shift']());}};_0x24c994(++_0x33ca46);}(_0xea1c,0xc1));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcea1('0x0')]={'penalty':{'type':Sequelize[_0xcea1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5977=['sequelize','exports','INTEGER'];(function(_0x12db6b,_0x1d7892){var _0x2da331=function(_0x5a01b6){while(--_0x5a01b6){_0x12db6b['push'](_0x12db6b['shift']());}};_0x2da331(++_0x1d7892);}(_0x5977,0xe1));var _0x7597=function(_0x49d5f1,_0x2e7846){_0x49d5f1=_0x49d5f1-0x0;var _0x4f827e=_0x5977[_0x49d5f1];return _0x4f827e;};'use strict';var Sequelize=require(_0x7597('0x0'));module[_0x7597('0x1')]={'penalty':{'type':Sequelize[_0x7597('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 292ec5e..a9bc460 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 _0xa8e3=['user_has_whatsapp_queues','lodash','../../config/logger','bluebird','request-promise','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x4433b,_0x1eded1){var _0xffc1da=function(_0x3d1d18){while(--_0x3d1d18){_0x4433b['push'](_0x4433b['shift']());}};_0xffc1da(++_0x1eded1);}(_0xa8e3,0x12d));var _0x3a8e=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xa8e3[_0x1d2bbb];return _0x38082b;};'use strict';var _=require(_0x3a8e('0x0'));var util=require('util');var logger=require(_0x3a8e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3a8e('0x2'));var rp=require(_0x3a8e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a8e('0x4'));var attributes=require(_0x3a8e('0x5'));module[_0x3a8e('0x6')]=function(_0x545ba2,_0x23b1dd){return _0x545ba2[_0x3a8e('0x7')](_0x3a8e('0x8'),attributes,{'tableName':_0x3a8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x239f=['request-promise','path','rimraf','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x3e695e,_0x45c96f){var _0x2107b8=function(_0x2da3fc){while(--_0x2da3fc){_0x3e695e['push'](_0x3e695e['shift']());}};_0x2107b8(++_0x45c96f);}(_0x239f,0xd8));var _0xf239=function(_0x40e99d,_0x2b3f46){_0x40e99d=_0x40e99d-0x0;var _0x30eb60=_0x239f[_0x40e99d];return _0x30eb60;};'use strict';var _=require(_0xf239('0x0'));var util=require('util');var logger=require(_0xf239('0x1'))('api');var moment=require(_0xf239('0x2'));var BPromise=require(_0xf239('0x3'));var rp=require(_0xf239('0x4'));var fs=require('fs');var path=require(_0xf239('0x5'));var rimraf=require(_0xf239('0x6'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xf239('0x7')]=function(_0x44e38d,_0x546d98){return _0x44e38d[_0xf239('0x8')](_0xf239('0x9'),attributes,{'tableName':_0xf239('0xa'),'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 2a542b6..7f7bfcb 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 _0x568d=['rpc','../../config/environment','jayson/promise','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x568d,0x19d));var _0xd568=function(_0x33aefe,_0x371ccd){_0x33aefe=_0x33aefe-0x0;var _0x471d19=_0x568d[_0x33aefe];return _0x471d19;};'use strict';var _=require(_0xd568('0x0'));var util=require(_0xd568('0x1'));var moment=require(_0xd568('0x2'));var BPromise=require(_0xd568('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd568('0x4'));var db=require(_0xd568('0x5'))['db'];var utils=require(_0xd568('0x6'));var logger=require('../../config/logger')(_0xd568('0x7'));var config=require(_0xd568('0x8'));var jayson=require(_0xd568('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b9aa1,_0xd34578,_0x381fed){return new BPromise(function(_0x5495f9,_0x5620b9){return client[_0xd568('0xa')](_0x3b9aa1,_0x381fed)[_0xd568('0xb')](function(_0x25566e){logger['info'](_0xd568('0xc'),_0xd34578,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xd34578,_0xd568('0xd'),JSON[_0xd568('0xe')](_0x25566e));if(_0x25566e[_0xd568('0xf')]){if(_0x25566e[_0xd568('0xf')][_0xd568('0x10')]===0x1f4){logger[_0xd568('0xf')](_0xd568('0xc'),_0xd34578,_0x25566e[_0xd568('0xf')]['message']);return _0x5620b9(_0x25566e[_0xd568('0xf')][_0xd568('0x11')]);}logger[_0xd568('0xf')](_0xd568('0xc'),_0xd34578,_0x25566e['error']['message']);return _0x5495f9(_0x25566e[_0xd568('0xf')]['message']);}else{logger[_0xd568('0x12')](_0xd568('0xc'),_0xd34578,_0xd568('0xd'));_0x5495f9(_0x25566e[_0xd568('0x13')][_0xd568('0x11')]);}})['catch'](function(_0x1b52ef){logger['error'](_0xd568('0xc'),_0xd34578,_0x1b52ef);_0x5620b9(_0x1b52ef);});});} \ No newline at end of file +var _0x448b=['../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x448b,0xa0));var _0xb448=function(_0x34bdd7,_0x478539){_0x34bdd7=_0x34bdd7-0x0;var _0x3fc1b3=_0x448b[_0x34bdd7];return _0x3fc1b3;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb448('0x2'))['db'];var utils=require(_0xb448('0x3'));var logger=require(_0xb448('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb448('0x5')][_0xb448('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34d74a,_0x3cb649,_0x2fc5ab){return new BPromise(function(_0x3e9f4f,_0x374ae7){return client[_0xb448('0x7')](_0x34d74a,_0x2fc5ab)[_0xb448('0x8')](function(_0x467ca2){logger[_0xb448('0x9')](_0xb448('0xa'),_0x3cb649,_0xb448('0xb'));logger[_0xb448('0xc')](_0xb448('0xd'),_0x3cb649,_0xb448('0xb'),JSON[_0xb448('0xe')](_0x467ca2));if(_0x467ca2[_0xb448('0xf')]){if(_0x467ca2[_0xb448('0xf')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x3cb649,_0x467ca2['error'][_0xb448('0x10')]);return _0x374ae7(_0x467ca2[_0xb448('0xf')]['message']);}logger['error'](_0xb448('0xa'),_0x3cb649,_0x467ca2[_0xb448('0xf')]['message']);return _0x3e9f4f(_0x467ca2[_0xb448('0xf')]['message']);}else{logger[_0xb448('0x9')](_0xb448('0xa'),_0x3cb649,'request\x20sent');_0x3e9f4f(_0x467ca2['result']['message']);}})[_0xb448('0x11')](function(_0x182718){logger[_0xb448('0xf')](_0xb448('0xa'),_0x3cb649,_0x182718);_0x374ae7(_0x182718);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 528c673..88d7c0c 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 _0xc252=['./variable.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0xc252,0x118));var _0x2c25=function(_0xff8c81,_0xd6f787){_0xff8c81=_0xff8c81-0x0;var _0x50f2cf=_0xc252[_0xff8c81];return _0x50f2cf;};'use strict';var multer=require(_0x2c25('0x0'));var util=require(_0x2c25('0x1'));var path=require(_0x2c25('0x2'));var timeout=require(_0x2c25('0x3'));var express=require(_0x2c25('0x4'));var router=express[_0x2c25('0x5')]();var fs_extra=require(_0x2c25('0x6'));var auth=require(_0x2c25('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c25('0x8'));router['get']('/',auth[_0x2c25('0x9')](),controller[_0x2c25('0xa')]);router[_0x2c25('0xb')](_0x2c25('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2c25('0xd')]('/',auth[_0x2c25('0x9')](),controller[_0x2c25('0xe')]);router[_0x2c25('0xf')](_0x2c25('0xc'),auth[_0x2c25('0x9')](),controller[_0x2c25('0x10')]);router['delete'](_0x2c25('0xc'),auth['isAuthenticated'](),controller[_0x2c25('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdeb3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','create','put','update','delete','multer','util','path'];(function(_0x11cf54,_0x1e9c58){var _0x1dd408=function(_0x4a80da){while(--_0x4a80da){_0x11cf54['push'](_0x11cf54['shift']());}};_0x1dd408(++_0x1e9c58);}(_0xdeb3,0xeb));var _0x3deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var path=require(_0x3deb('0x2'));var timeout=require(_0x3deb('0x3'));var express=require(_0x3deb('0x4'));var router=express[_0x3deb('0x5')]();var fs_extra=require(_0x3deb('0x6'));var auth=require(_0x3deb('0x7'));var interaction=require(_0x3deb('0x8'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['show']);router['post']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xd')]);router[_0x3deb('0xe')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0xf')]);router[_0x3deb('0x10')](_0x3deb('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 31f2a8e..1b33f84 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e2a=['name','sequelize','exports'];(function(_0x2e9ec1,_0x12c249){var _0x36dbe3=function(_0x4802be){while(--_0x4802be){_0x2e9ec1['push'](_0x2e9ec1['shift']());}};_0x36dbe3(++_0x12c249);}(_0x1e2a,0x9d));var _0xa1e2=function(_0x118d5d,_0x3dbeda){_0x118d5d=_0x118d5d-0x0;var _0x31003c=_0x1e2a[_0x118d5d];return _0x31003c;};'use strict';var Sequelize=require(_0xa1e2('0x0'));module[_0xa1e2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa1e2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f58=['name','STRING','exports'];(function(_0x15330a,_0x38657a){var _0x3e97a4=function(_0x13b21f){while(--_0x13b21f){_0x15330a['push'](_0x15330a['shift']());}};_0x3e97a4(++_0x38657a);}(_0x7f58,0x1ee));var _0x87f5=function(_0x50ef88,_0x5a1ecc){_0x50ef88=_0x50ef88-0x0;var _0x4ef9a1=_0x7f58[_0x50ef88];return _0x4ef9a1;};'use strict';var Sequelize=require('sequelize');module[_0x87f5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x87f5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x87f5('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 1f80cc9..9f146cf 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 _0x6819=['find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation'];(function(_0x312ff8,_0x5d7167){var _0x4e144b=function(_0x8c0bd5){while(--_0x8c0bd5){_0x312ff8['push'](_0x312ff8['shift']());}};_0x4e144b(++_0x5d7167);}(_0x6819,0x1e7));var _0x9681=function(_0x48b996,_0x2d6330){_0x48b996=_0x48b996-0x0;var _0x74516c=_0x6819[_0x48b996];return _0x74516c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9681('0x0'));var zipdir=require(_0x9681('0x1'));var jsonpatch=require(_0x9681('0x2'));var rp=require('request-promise');var moment=require(_0x9681('0x3'));var BPromise=require(_0x9681('0x4'));var Mustache=require(_0x9681('0x5'));var util=require(_0x9681('0x6'));var path=require(_0x9681('0x7'));var sox=require(_0x9681('0x8'));var csv=require(_0x9681('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9681('0xa'));var _=require(_0x9681('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9681('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9681('0x9'));var querystring=require(_0x9681('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9681('0xe'));var qs=require(_0x9681('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9681('0x10'));var logger=require(_0x9681('0x11'))('api');var utils=require(_0x9681('0x12'));var config=require(_0x9681('0x13'));var licenseUtil=require(_0x9681('0x14'));var db=require(_0x9681('0x15'))['db'];function respondWithStatusCode(_0x50e24d,_0x210f44){_0x210f44=_0x210f44||0xcc;return function(_0x4923a1){if(_0x4923a1){return _0x50e24d['sendStatus'](_0x210f44);}return _0x50e24d[_0x9681('0x16')](_0x210f44)[_0x9681('0x17')]();};}function respondWithResult(_0x9eff5f,_0xe760e2){_0xe760e2=_0xe760e2||0xc8;return function(_0x507044){if(_0x507044){return _0x9eff5f[_0x9681('0x16')](_0xe760e2)['json'](_0x507044);}};}function respondWithFilteredResult(_0x4e2568,_0x2755fe){return function(_0x2fb595){if(_0x2fb595){var _0x4dd1ef=typeof _0x2755fe[_0x9681('0x18')]==='undefined'&&typeof _0x2755fe[_0x9681('0x19')]===_0x9681('0x1a');var _0x466abe=_0x2fb595[_0x9681('0x1b')];var _0x42b747=_0x4dd1ef?0x0:_0x2755fe[_0x9681('0x18')];var _0x3890e6=_0x4dd1ef?_0x2fb595['count']:_0x2755fe[_0x9681('0x18')]+_0x2755fe[_0x9681('0x19')];var _0x54f1be;if(_0x3890e6>=_0x466abe){_0x3890e6=_0x466abe;_0x54f1be=0xc8;}else{_0x54f1be=0xce;}_0x4e2568[_0x9681('0x16')](_0x54f1be);return _0x4e2568[_0x9681('0x1c')](_0x9681('0x1d'),_0x42b747+'-'+_0x3890e6+'/'+_0x466abe)[_0x9681('0x1e')](_0x2fb595);}return null;};}function patchUpdates(_0x33cd46){return function(_0x5698a5){try{jsonpatch['apply'](_0x5698a5,_0x33cd46,!![]);}catch(_0xee1b69){return BPromise[_0x9681('0x1f')](_0xee1b69);}return _0x5698a5[_0x9681('0x20')]();};}function saveUpdates(_0x33a0a5,_0x2c6415){return function(_0x59a87e){if(_0x59a87e){return _0x59a87e[_0x9681('0x21')](_0x33a0a5)[_0x9681('0x22')](function(_0x5c320d){return _0x5c320d;});}return null;};}function removeEntity(_0x356b60,_0x57fad2){return function(_0x9763c3){if(_0x9763c3){return _0x9763c3[_0x9681('0x23')]()[_0x9681('0x22')](function(){var _0x20b408=_0x9763c3['get']({'plain':!![]});var _0x465354=_0x9681('0x24');return db[_0x9681('0x25')]['destroy']({'where':{'type':_0x465354,'resourceId':_0x20b408['id']}})['then'](function(){return _0x9763c3;});})[_0x9681('0x22')](function(){_0x356b60[_0x9681('0x16')](0xcc)[_0x9681('0x17')]();});}};}function handleEntityNotFound(_0x30c07c,_0xdd9702){return function(_0x2db629){if(!_0x2db629){_0x30c07c[_0x9681('0x26')](0x194);}return _0x2db629;};}function handleError(_0xbf4074,_0x538d20){_0x538d20=_0x538d20||0x1f4;return function(_0x2f71d6){logger[_0x9681('0x27')](_0x2f71d6[_0x9681('0x28')]);if(_0x2f71d6[_0x9681('0x29')]){delete _0x2f71d6['name'];}_0xbf4074['status'](_0x538d20)[_0x9681('0x2a')](_0x2f71d6);};}exports[_0x9681('0x2b')]=function(_0xfdd040,_0x986dd5){var _0x7328ea={},_0x51db50={},_0x50d317={'count':0x0,'rows':[]};var _0x365777=_[_0x9681('0x2c')](db[_0x9681('0x2d')][_0x9681('0x2e')],function(_0x1f796e){return{'name':_0x1f796e['fieldName'],'type':_0x1f796e[_0x9681('0x2f')][_0x9681('0x30')]};});_0x51db50['model']=_['map'](_0x365777,_0x9681('0x29'));_0x51db50[_0x9681('0x31')]=_[_0x9681('0x32')](_0xfdd040[_0x9681('0x31')]);_0x51db50[_0x9681('0x33')]=_[_0x9681('0x34')](_0x51db50[_0x9681('0x35')],_0x51db50[_0x9681('0x31')]);_0x7328ea[_0x9681('0x36')]=_[_0x9681('0x34')](_0x51db50[_0x9681('0x35')],qs['fields'](_0xfdd040['query'][_0x9681('0x37')]));_0x7328ea[_0x9681('0x36')]=_0x7328ea[_0x9681('0x36')]['length']?_0x7328ea[_0x9681('0x36')]:_0x51db50['model'];if(!_0xfdd040[_0x9681('0x31')][_0x9681('0x38')](_0x9681('0x39'))){_0x7328ea[_0x9681('0x19')]=qs['limit'](_0xfdd040[_0x9681('0x31')][_0x9681('0x19')]);_0x7328ea[_0x9681('0x18')]=qs[_0x9681('0x18')](_0xfdd040['query'][_0x9681('0x18')]);}_0x7328ea[_0x9681('0x3a')]=qs['sort'](_0xfdd040['query'][_0x9681('0x3b')]);_0x7328ea[_0x9681('0x3c')]=qs[_0x9681('0x33')](_[_0x9681('0x3d')](_0xfdd040[_0x9681('0x31')],_0x51db50[_0x9681('0x33')]),_0x365777);if(_0xfdd040[_0x9681('0x31')][_0x9681('0x3e')]){_0x7328ea['where']=_[_0x9681('0x3f')](_0x7328ea[_0x9681('0x3c')],{'$or':_[_0x9681('0x2c')](_0x365777,function(_0x353611){if(_0x353611[_0x9681('0x2f')]!=='VIRTUAL'){var _0x2e010f={};_0x2e010f[_0x353611[_0x9681('0x29')]]={'$like':'%'+_0xfdd040[_0x9681('0x31')][_0x9681('0x3e')]+'%'};return _0x2e010f;}})});}_0x7328ea=_[_0x9681('0x3f')]({},_0x7328ea,_0xfdd040[_0x9681('0x40')]);var _0xbba31d={'where':_0x7328ea[_0x9681('0x3c')]};return db[_0x9681('0x2d')][_0x9681('0x1b')](_0xbba31d)[_0x9681('0x22')](function(_0x49c77b){_0x50d317[_0x9681('0x1b')]=_0x49c77b;if(_0xfdd040[_0x9681('0x31')][_0x9681('0x41')]){_0x7328ea['include']=[{'all':!![]}];}return db[_0x9681('0x2d')][_0x9681('0x42')](_0x7328ea);})['then'](function(_0x588991){_0x50d317[_0x9681('0x43')]=_0x588991;return _0x50d317;})[_0x9681('0x22')](respondWithFilteredResult(_0x986dd5,_0x7328ea))['catch'](handleError(_0x986dd5,null));};exports[_0x9681('0x44')]=function(_0x1129c0,_0x4eefe7){var _0x3427be={'raw':!![],'where':{'id':_0x1129c0[_0x9681('0x45')]['id']}},_0x31b8ac={};_0x31b8ac[_0x9681('0x35')]=_[_0x9681('0x32')](db['Variable']['rawAttributes']);_0x31b8ac['query']=_[_0x9681('0x32')](_0x1129c0[_0x9681('0x31')]);_0x31b8ac[_0x9681('0x33')]=_[_0x9681('0x34')](_0x31b8ac[_0x9681('0x35')],_0x31b8ac[_0x9681('0x31')]);_0x3427be[_0x9681('0x36')]=_[_0x9681('0x34')](_0x31b8ac[_0x9681('0x35')],qs[_0x9681('0x37')](_0x1129c0[_0x9681('0x31')][_0x9681('0x37')]));_0x3427be[_0x9681('0x36')]=_0x3427be['attributes'][_0x9681('0x46')]?_0x3427be['attributes']:_0x31b8ac[_0x9681('0x35')];if(_0x1129c0[_0x9681('0x31')][_0x9681('0x41')]){_0x3427be[_0x9681('0x47')]=[{'all':!![]}];}_0x3427be=_[_0x9681('0x3f')]({},_0x3427be,_0x1129c0['options']);return db[_0x9681('0x2d')]['find'](_0x3427be)[_0x9681('0x22')](handleEntityNotFound(_0x4eefe7,null))[_0x9681('0x22')](respondWithResult(_0x4eefe7,null))[_0x9681('0x48')](handleError(_0x4eefe7,null));};exports[_0x9681('0x49')]=function(_0x1a2109,_0xa34c11){return db[_0x9681('0x2d')]['create'](_0x1a2109[_0x9681('0x4a')],{})[_0x9681('0x22')](function(_0x2efb63){var _0x1f413c=_0x1a2109['user']['get']({'plain':!![]});if(!_0x1f413c)throw new Error(_0x9681('0x4b'));if(_0x1f413c[_0x9681('0x4c')]==='user'){var _0x5800e2=_0x2efb63[_0x9681('0x4d')]({'plain':!![]});var _0x4f37fd=_0x9681('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x4f37fd,'userProfileId':_0x1f413c[_0x9681('0x4e')]},'raw':!![]})[_0x9681('0x22')](function(_0x3b2e9a){if(_0x3b2e9a&&_0x3b2e9a[_0x9681('0x4f')]===0x0){return db[_0x9681('0x25')][_0x9681('0x49')]({'name':_0x5800e2[_0x9681('0x29')],'resourceId':_0x5800e2['id'],'type':_0x3b2e9a[_0x9681('0x29')],'sectionId':_0x3b2e9a['id']},{})[_0x9681('0x22')](function(){return _0x2efb63;});}else{return _0x2efb63;}})[_0x9681('0x48')](function(_0x595f7b){logger[_0x9681('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x595f7b);throw _0x595f7b;});}return _0x2efb63;})[_0x9681('0x22')](respondWithResult(_0xa34c11,0xc9))[_0x9681('0x48')](handleError(_0xa34c11,null));};exports[_0x9681('0x21')]=function(_0x3c14e8,_0x2817d5){if(_0x3c14e8[_0x9681('0x4a')]['id']){delete _0x3c14e8[_0x9681('0x4a')]['id'];}return db['Variable'][_0x9681('0x50')]({'where':{'id':_0x3c14e8[_0x9681('0x45')]['id']}})[_0x9681('0x22')](handleEntityNotFound(_0x2817d5,null))[_0x9681('0x22')](saveUpdates(_0x3c14e8['body'],null))[_0x9681('0x22')](respondWithResult(_0x2817d5,null))['catch'](handleError(_0x2817d5,null));};exports[_0x9681('0x23')]=function(_0x25d51f,_0x4a16a9){return db['Variable'][_0x9681('0x50')]({'where':{'id':_0x25d51f[_0x9681('0x45')]['id']}})[_0x9681('0x22')](handleEntityNotFound(_0x4a16a9,null))['then'](removeEntity(_0x4a16a9,null))[_0x9681('0x48')](handleError(_0x4a16a9,null));}; \ No newline at end of file +var _0x27b5=['destroy','Variables','UserProfileResource','error','stack','name','send','index','Variable','fieldName','type','model','map','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x27b5,0x85));var _0x527b=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x27b5[_0x3dc538];return _0x72c2fd;};'use strict';var emlformat=require(_0x527b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x527b('0x1'));var jsonpatch=require(_0x527b('0x2'));var rp=require(_0x527b('0x3'));var moment=require('moment');var BPromise=require(_0x527b('0x4'));var Mustache=require(_0x527b('0x5'));var util=require(_0x527b('0x6'));var path=require(_0x527b('0x7'));var sox=require(_0x527b('0x8'));var csv=require(_0x527b('0x9'));var ejs=require(_0x527b('0xa'));var fs=require('fs');var fs_extra=require(_0x527b('0xb'));var _=require('lodash');var squel=require(_0x527b('0xc'));var crypto=require(_0x527b('0xd'));var jsforce=require(_0x527b('0xe'));var deskjs=require(_0x527b('0xf'));var toCsv=require(_0x527b('0x9'));var querystring=require(_0x527b('0x10'));var Papa=require(_0x527b('0x11'));var Redis=require(_0x527b('0x12'));var authService=require(_0x527b('0x13'));var qs=require(_0x527b('0x14'));var as=require(_0x527b('0x15'));var hardwareService=require(_0x527b('0x16'));var logger=require('../../config/logger')(_0x527b('0x17'));var utils=require(_0x527b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x527b('0x19'));var db=require(_0x527b('0x1a'))['db'];function respondWithStatusCode(_0x5f57a4,_0x2b7bed){_0x2b7bed=_0x2b7bed||0xcc;return function(_0x5db575){if(_0x5db575){return _0x5f57a4[_0x527b('0x1b')](_0x2b7bed);}return _0x5f57a4[_0x527b('0x1c')](_0x2b7bed)[_0x527b('0x1d')]();};}function respondWithResult(_0x415397,_0x379c00){_0x379c00=_0x379c00||0xc8;return function(_0xc0c7a2){if(_0xc0c7a2){return _0x415397[_0x527b('0x1c')](_0x379c00)[_0x527b('0x1e')](_0xc0c7a2);}};}function respondWithFilteredResult(_0x28ab7b,_0x2549f2){return function(_0x4a8014){if(_0x4a8014){var _0x1ad862=typeof _0x2549f2[_0x527b('0x1f')]==='undefined'&&typeof _0x2549f2['limit']===_0x527b('0x20');var _0x270b3b=_0x4a8014['count'];var _0x5720ad=_0x1ad862?0x0:_0x2549f2['offset'];var _0x5d17b1=_0x1ad862?_0x4a8014[_0x527b('0x21')]:_0x2549f2[_0x527b('0x1f')]+_0x2549f2[_0x527b('0x22')];var _0x8d6103;if(_0x5d17b1>=_0x270b3b){_0x5d17b1=_0x270b3b;_0x8d6103=0xc8;}else{_0x8d6103=0xce;}_0x28ab7b[_0x527b('0x1c')](_0x8d6103);return _0x28ab7b['set'](_0x527b('0x23'),_0x5720ad+'-'+_0x5d17b1+'/'+_0x270b3b)['json'](_0x4a8014);}return null;};}function patchUpdates(_0x46d2ca){return function(_0x11e793){try{jsonpatch[_0x527b('0x24')](_0x11e793,_0x46d2ca,!![]);}catch(_0x1d7dd3){return BPromise[_0x527b('0x25')](_0x1d7dd3);}return _0x11e793[_0x527b('0x26')]();};}function saveUpdates(_0x3246ff,_0x410e2c){return function(_0x3945d5){if(_0x3945d5){return _0x3945d5[_0x527b('0x27')](_0x3246ff)[_0x527b('0x28')](function(_0x192495){return _0x192495;});}return null;};}function removeEntity(_0x246c2e,_0x42d979){return function(_0x57f734){if(_0x57f734){return _0x57f734[_0x527b('0x29')]()['then'](function(){var _0x4bb649=_0x57f734['get']({'plain':!![]});var _0x5b93ad=_0x527b('0x2a');return db[_0x527b('0x2b')][_0x527b('0x29')]({'where':{'type':_0x5b93ad,'resourceId':_0x4bb649['id']}})['then'](function(){return _0x57f734;});})[_0x527b('0x28')](function(){_0x246c2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x331a2e,_0x48b731){return function(_0x30ec5b){if(!_0x30ec5b){_0x331a2e['sendStatus'](0x194);}return _0x30ec5b;};}function handleError(_0x25634c,_0x134b60){_0x134b60=_0x134b60||0x1f4;return function(_0x49a497){logger[_0x527b('0x2c')](_0x49a497[_0x527b('0x2d')]);if(_0x49a497[_0x527b('0x2e')]){delete _0x49a497['name'];}_0x25634c[_0x527b('0x1c')](_0x134b60)[_0x527b('0x2f')](_0x49a497);};}exports[_0x527b('0x30')]=function(_0x4feab6,_0x3d4db1){var _0x2648fc={},_0x450183={},_0xda0f5b={'count':0x0,'rows':[]};var _0x107bda=_['map'](db[_0x527b('0x31')]['rawAttributes'],function(_0x42332d){return{'name':_0x42332d[_0x527b('0x32')],'type':_0x42332d[_0x527b('0x33')]['key']};});_0x450183[_0x527b('0x34')]=_[_0x527b('0x35')](_0x107bda,'name');_0x450183[_0x527b('0x36')]=_[_0x527b('0x37')](_0x4feab6[_0x527b('0x36')]);_0x450183[_0x527b('0x38')]=_[_0x527b('0x39')](_0x450183['model'],_0x450183['query']);_0x2648fc[_0x527b('0x3a')]=_[_0x527b('0x39')](_0x450183[_0x527b('0x34')],qs['fields'](_0x4feab6[_0x527b('0x36')]['fields']));_0x2648fc[_0x527b('0x3a')]=_0x2648fc['attributes']['length']?_0x2648fc[_0x527b('0x3a')]:_0x450183[_0x527b('0x34')];if(!_0x4feab6['query']['hasOwnProperty']('nolimit')){_0x2648fc[_0x527b('0x22')]=qs[_0x527b('0x22')](_0x4feab6[_0x527b('0x36')][_0x527b('0x22')]);_0x2648fc[_0x527b('0x1f')]=qs[_0x527b('0x1f')](_0x4feab6[_0x527b('0x36')][_0x527b('0x1f')]);}_0x2648fc[_0x527b('0x3b')]=qs[_0x527b('0x3c')](_0x4feab6[_0x527b('0x36')][_0x527b('0x3c')]);_0x2648fc[_0x527b('0x3d')]=qs['filters'](_[_0x527b('0x3e')](_0x4feab6['query'],_0x450183[_0x527b('0x38')]),_0x107bda);if(_0x4feab6['query'][_0x527b('0x3f')]){_0x2648fc[_0x527b('0x3d')]=_[_0x527b('0x40')](_0x2648fc[_0x527b('0x3d')],{'$or':_['map'](_0x107bda,function(_0x1acda0){if(_0x1acda0[_0x527b('0x33')]!==_0x527b('0x41')){var _0x33913c={};_0x33913c[_0x1acda0[_0x527b('0x2e')]]={'$like':'%'+_0x4feab6['query'][_0x527b('0x3f')]+'%'};return _0x33913c;}})});}_0x2648fc=_['merge']({},_0x2648fc,_0x4feab6['options']);var _0x2cdf42={'where':_0x2648fc[_0x527b('0x3d')]};return db[_0x527b('0x31')][_0x527b('0x21')](_0x2cdf42)['then'](function(_0x368d0a){_0xda0f5b[_0x527b('0x21')]=_0x368d0a;if(_0x4feab6[_0x527b('0x36')][_0x527b('0x42')]){_0x2648fc[_0x527b('0x43')]=[{'all':!![]}];}return db[_0x527b('0x31')][_0x527b('0x44')](_0x2648fc);})[_0x527b('0x28')](function(_0x39630e){_0xda0f5b['rows']=_0x39630e;return _0xda0f5b;})[_0x527b('0x28')](respondWithFilteredResult(_0x3d4db1,_0x2648fc))['catch'](handleError(_0x3d4db1,null));};exports[_0x527b('0x45')]=function(_0x489536,_0x50ee37){var _0x4017b7={'raw':!![],'where':{'id':_0x489536[_0x527b('0x46')]['id']}},_0x23d6a9={};_0x23d6a9[_0x527b('0x34')]=_[_0x527b('0x37')](db[_0x527b('0x31')][_0x527b('0x47')]);_0x23d6a9[_0x527b('0x36')]=_[_0x527b('0x37')](_0x489536[_0x527b('0x36')]);_0x23d6a9[_0x527b('0x38')]=_['intersection'](_0x23d6a9['model'],_0x23d6a9['query']);_0x4017b7[_0x527b('0x3a')]=_[_0x527b('0x39')](_0x23d6a9[_0x527b('0x34')],qs[_0x527b('0x48')](_0x489536[_0x527b('0x36')][_0x527b('0x48')]));_0x4017b7[_0x527b('0x3a')]=_0x4017b7[_0x527b('0x3a')][_0x527b('0x49')]?_0x4017b7[_0x527b('0x3a')]:_0x23d6a9[_0x527b('0x34')];if(_0x489536[_0x527b('0x36')][_0x527b('0x42')]){_0x4017b7['include']=[{'all':!![]}];}_0x4017b7=_[_0x527b('0x40')]({},_0x4017b7,_0x489536[_0x527b('0x4a')]);return db[_0x527b('0x31')][_0x527b('0x4b')](_0x4017b7)['then'](handleEntityNotFound(_0x50ee37,null))[_0x527b('0x28')](respondWithResult(_0x50ee37,null))['catch'](handleError(_0x50ee37,null));};exports['create']=function(_0x43cb50,_0x119166){return db[_0x527b('0x31')][_0x527b('0x4c')](_0x43cb50[_0x527b('0x4d')],{})[_0x527b('0x28')](function(_0x5cb4c5){var _0x31e610=_0x43cb50[_0x527b('0x4e')]['get']({'plain':!![]});if(!_0x31e610)throw new Error(_0x527b('0x4f'));if(_0x31e610[_0x527b('0x50')]===_0x527b('0x4e')){var _0x206555=_0x5cb4c5[_0x527b('0x51')]({'plain':!![]});var _0x89af67=_0x527b('0x2a');return db[_0x527b('0x52')][_0x527b('0x4b')]({'where':{'name':_0x89af67,'userProfileId':_0x31e610[_0x527b('0x53')]},'raw':!![]})[_0x527b('0x28')](function(_0x418f53){if(_0x418f53&&_0x418f53[_0x527b('0x54')]===0x0){return db['UserProfileResource'][_0x527b('0x4c')]({'name':_0x206555[_0x527b('0x2e')],'resourceId':_0x206555['id'],'type':_0x418f53[_0x527b('0x2e')],'sectionId':_0x418f53['id']},{})[_0x527b('0x28')](function(){return _0x5cb4c5;});}else{return _0x5cb4c5;}})[_0x527b('0x55')](function(_0xaf48ca){logger[_0x527b('0x2c')](_0x527b('0x56'),_0xaf48ca);throw _0xaf48ca;});}return _0x5cb4c5;})[_0x527b('0x28')](respondWithResult(_0x119166,0xc9))[_0x527b('0x55')](handleError(_0x119166,null));};exports['update']=function(_0x5dd472,_0x20e358){if(_0x5dd472['body']['id']){delete _0x5dd472[_0x527b('0x4d')]['id'];}return db['Variable'][_0x527b('0x4b')]({'where':{'id':_0x5dd472[_0x527b('0x46')]['id']}})[_0x527b('0x28')](handleEntityNotFound(_0x20e358,null))[_0x527b('0x28')](saveUpdates(_0x5dd472[_0x527b('0x4d')],null))['then'](respondWithResult(_0x20e358,null))['catch'](handleError(_0x20e358,null));};exports[_0x527b('0x29')]=function(_0x1ff6e3,_0x1e05de){return db[_0x527b('0x31')][_0x527b('0x4b')]({'where':{'id':_0x1ff6e3['params']['id']}})[_0x527b('0x28')](handleEntityNotFound(_0x1e05de,null))[_0x527b('0x28')](removeEntity(_0x1e05de,null))[_0x527b('0x55')](handleError(_0x1e05de,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index be4a98f..3fb5201 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 _0xe12f=['bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','util','../../config/logger','api'];(function(_0x417274,_0x5923ef){var _0xa0850a=function(_0x5433f0){while(--_0x5433f0){_0x417274['push'](_0x417274['shift']());}};_0xa0850a(++_0x5923ef);}(_0xe12f,0x99));var _0xfe12=function(_0x5e9e13,_0x2071ee){_0x5e9e13=_0x5e9e13-0x0;var _0x16f62c=_0xe12f[_0x5e9e13];return _0x16f62c;};'use strict';var _=require('lodash');var util=require(_0xfe12('0x0'));var logger=require(_0xfe12('0x1'))(_0xfe12('0x2'));var moment=require('moment');var BPromise=require(_0xfe12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe12('0x4'));var rimraf=require(_0xfe12('0x5'));var config=require(_0xfe12('0x6'));var attributes=require(_0xfe12('0x7'));module[_0xfe12('0x8')]=function(_0x180364,_0x15bc57){return _0x180364[_0xfe12('0x9')](_0xfe12('0xa'),attributes,{'tableName':_0xfe12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0488=['util','../../config/logger','api','moment','bluebird','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x74dfd0,_0x3e4246){var _0x2ee2e7=function(_0x4ce3bc){while(--_0x4ce3bc){_0x74dfd0['push'](_0x74dfd0['shift']());}};_0x2ee2e7(++_0x3e4246);}(_0x0488,0xbf));var _0x8048=function(_0x5d1923,_0x596d33){_0x5d1923=_0x5d1923-0x0;var _0x354971=_0x0488[_0x5d1923];return _0x354971;};'use strict';var _=require(_0x8048('0x0'));var util=require(_0x8048('0x1'));var logger=require(_0x8048('0x2'))(_0x8048('0x3'));var moment=require(_0x8048('0x4'));var BPromise=require(_0x8048('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8048('0x6'));var attributes=require(_0x8048('0x7'));module[_0x8048('0x8')]=function(_0x1fc5d5,_0x4298c9){return _0x1fc5d5[_0x8048('0x9')](_0x8048('0xa'),attributes,{'tableName':_0x8048('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 ac03f02..3917774 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 _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x67e3f7,_0x440286){var _0x55d094=function(_0x26e2cb){while(--_0x26e2cb){_0x67e3f7['push'](_0x67e3f7['shift']());}};_0x55d094(++_0x440286);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa41a,0x6b));var _0xaa41=function(_0x3545bf,_0x560e32){_0x3545bf=_0x3545bf-0x0;var _0x1f481c=_0xa41a[_0x3545bf];return _0x1f481c;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2831602..6675b69 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 _0x032f=['/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get','index'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x032f,0x15b));var _0xf032=function(_0xc6c92d,_0x4cde11){_0xc6c92d=_0xc6c92d-0x0;var _0x1e9d46=_0x032f[_0xc6c92d];return _0x1e9d46;};'use strict';var express=require(_0xf032('0x0'));var router=express[_0xf032('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xf032('0x2'));router[_0xf032('0x3')]('/',controller[_0xf032('0x4')]);router[_0xf032('0x3')](_0xf032('0x5'),auth[_0xf032('0x6')](),auth[_0xf032('0x7')](),controller['fetch']);router[_0xf032('0x3')]('/reset',auth[_0xf032('0x6')](),auth['canUpdate'](),controller[_0xf032('0x8')]);router[_0xf032('0x3')](_0xf032('0x9'),auth[_0xf032('0x6')](),auth[_0xf032('0x7')](),controller[_0xf032('0xa')]);router[_0xf032('0x3')](_0xf032('0xb'),auth[_0xf032('0x6')](),controller[_0xf032('0xc')]);router[_0xf032('0x3')](_0xf032('0xd'),controller[_0xf032('0xe')]);module[_0xf032('0xf')]=router; \ No newline at end of file +var _0x67b6=['reset','pull','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x5f33ad,_0x4c038d){var _0x4d9ff9=function(_0x22edcb){while(--_0x22edcb){_0x5f33ad['push'](_0x5f33ad['shift']());}};_0x4d9ff9(++_0x4c038d);}(_0x67b6,0xab));var _0x667b=function(_0x5c885b,_0x3f811c){_0x5c885b=_0x5c885b-0x0;var _0x25dea5=_0x67b6[_0x5c885b];return _0x25dea5;};'use strict';var express=require('express');var router=express[_0x667b('0x0')]();var auth=require(_0x667b('0x1'));var controller=require(_0x667b('0x2'));router[_0x667b('0x3')]('/',controller[_0x667b('0x4')]);router[_0x667b('0x3')](_0x667b('0x5'),auth[_0x667b('0x6')](),auth[_0x667b('0x7')](),controller[_0x667b('0x8')]);router['get']('/reset',auth[_0x667b('0x6')](),auth[_0x667b('0x7')](),controller[_0x667b('0x9')]);router[_0x667b('0x3')]('/pull',auth[_0x667b('0x6')](),auth['canUpdate'](),controller[_0x667b('0xa')]);router[_0x667b('0x3')]('/restart',auth[_0x667b('0x6')](),controller['restart']);router[_0x667b('0x3')]('/migrations',controller['migrations']);module[_0x667b('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6ddcb58..c85d2a7 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 _0xd6c8=['FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','length','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','version','latest','fetch','exports','2.0.0','status','json','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x384f44,_0xbaf7b6){var _0x49c3e3=function(_0x54d6c7){while(--_0x54d6c7){_0x384f44['push'](_0x384f44['shift']());}};_0x49c3e3(++_0xbaf7b6);}(_0xd6c8,0x84));var _0x8d6c=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xd6c8[_0x5beda8];return _0x2aa042;};'use strict';var Umzug=require(_0x8d6c('0x0'));var path=require(_0x8d6c('0x1'));var fs=require('fs');var _=require(_0x8d6c('0x2'));var pkginfo=require(_0x8d6c('0x3'))(module,'version');var compareVersions=require(_0x8d6c('0x4'));var exec=require(_0x8d6c('0x5'))[_0x8d6c('0x6')];var db=require(_0x8d6c('0x7'))['db'];var config=require(_0x8d6c('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x8d6c('0x9'))(_0x8d6c('0xa'));var git=require(_0x8d6c('0xb'))(config[_0x8d6c('0xc')]);exports[_0x8d6c('0xd')]=function(_0x33b928,_0x20d4ff){var _0x532289={'current':module['exports'][_0x8d6c('0xe')],'phonebar':0x2};if(_0x33b928['query']&&_0x33b928['query'][_0x8d6c('0xf')]){return git[_0x8d6c('0x10')]()['tags'](function(_0x3a12e4,_0x36f34a){_0x532289[_0x8d6c('0xf')]=(_0x3a12e4?module[_0x8d6c('0x11')][_0x8d6c('0xe')]:_0x36f34a[_0x8d6c('0xf')])||_0x8d6c('0x12');return _0x20d4ff[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')](_0x532289);});}else{return _0x20d4ff['status'](0xc8)[_0x8d6c('0x14')](_0x532289);}};exports[_0x8d6c('0x10')]=function(_0xe1a9b0,_0x4759ee){return git[_0x8d6c('0x10')]([_0x8d6c('0x15'),'master'],function(_0xcf51a4){if(_0xcf51a4){logger[_0x8d6c('0x16')](_0xcf51a4);return _0x4759ee['status'](0x1f4)[_0x8d6c('0x14')](_0xcf51a4);}logger['info'](_0x8d6c('0x17'));return _0x4759ee[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')]({'output':_0x8d6c('0x18')});});};exports[_0x8d6c('0x19')]=function(_0x1af5ba,_0x4d10b6){return git['reset']([_0x8d6c('0x1a'),_0x8d6c('0x1b')],function(_0x1bd5c2){if(_0x1bd5c2){logger[_0x8d6c('0x16')](_0x1bd5c2);return _0x4d10b6[_0x8d6c('0x13')](0x1f4)[_0x8d6c('0x14')](_0x1bd5c2);}logger[_0x8d6c('0x1c')](_0x8d6c('0x1d'));return _0x4d10b6[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0x8d6c('0x1e')]=function(_0x5a0cda,_0x436e3f){exec(_0x8d6c('0x1f'),function(_0x5133ee,_0x17eaf3,_0x1c6fbe){logger['info'](_0x17eaf3);logger[_0x8d6c('0x1c')](_0x1c6fbe);if(_0x5133ee){logger[_0x8d6c('0x16')](_0x5133ee);return _0x436e3f[_0x8d6c('0x13')](0x1f4)[_0x8d6c('0x14')](_0x5133ee);}return _0x436e3f[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')]({'output':_0x17eaf3});});};exports['restart']=function(_0x3004ac,_0x534269){return pm2[_0x8d6c('0x20')](_0x8d6c('0x21'))[_0x8d6c('0x22')](function(_0x2ee6ce){logger[_0x8d6c('0x1c')](_0x8d6c('0x23'),_0x2ee6ce);return _0x534269['status'](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x8d6c('0x24')](function(_0x47c9b8){logger['error'](_0x47c9b8);return _0x534269['status'](0x1f4)[_0x8d6c('0x14')](_0x47c9b8);});};exports[_0x8d6c('0x25')]=function(_0x589289,_0x1f3eb2){var _0x3b5aa0=fs[_0x8d6c('0x26')](path[_0x8d6c('0x27')](config[_0x8d6c('0xc')],'server',_0x8d6c('0x25')));var _0x63c70a=[];for(var _0x2ed4c7=0x0;_0x2ed4c7<_0x3b5aa0[_0x8d6c('0x28')];_0x2ed4c7++){var _0x134ca8=_0x3b5aa0[_0x2ed4c7]['replace'](_0x8d6c('0x29'),'');if(compareVersions(module['exports'][_0x8d6c('0xe')],_0x134ca8)===-0x1){_0x63c70a['push'](_0x134ca8);}}if(_0x63c70a[_0x8d6c('0x28')]){var _0x190690=_0x63c70a[_0x8d6c('0x2a')](compareVersions);var _0x1f37c4=new Umzug({'storage':_0x8d6c('0x2b'),'storageOptions':{'model':db[_0x8d6c('0x2c')],'modelName':_0x8d6c('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x8d6c('0x2b')][_0x8d6c('0x2d')](),db[_0x8d6c('0x2b')][_0x8d6c('0x2e')],function(){throw new Error(_0x8d6c('0x2f'));}],'path':path[_0x8d6c('0x27')](config[_0x8d6c('0xc')],'server',_0x8d6c('0x25')),'pattern':/\.js$/}});_0x1f37c4['up']({'migrations':_[_0x8d6c('0x30')](_0x190690,function(_0xcab4fe){return _0xcab4fe+'.js';})})['then'](function(){return _0x1f3eb2[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8d6c('0x11')][_0x8d6c('0xe')]+_0x8d6c('0x31')+_[_0x8d6c('0x32')](_0x190690),'migrations':_[_0x8d6c('0x27')](_0x190690)});})[_0x8d6c('0x24')](function(_0x39105b){if(_0x39105b instanceof db[_0x8d6c('0x2b')][_0x8d6c('0x33')]){return _0x1f3eb2[_0x8d6c('0x13')](0xc8)[_0x8d6c('0x14')]({'output':_0x8d6c('0x34')});}else{return _0x1f3eb2['status'](0x1f4)[_0x8d6c('0x14')](_0x39105b);}});}else{return _0x1f3eb2[_0x8d6c('0x13')](0xc8)['json']({'output':_0x8d6c('0x34')});}}; \ No newline at end of file +var _0x7d62=['join','server','length','replace','.js','push','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','version','query','latest','fetch','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync'];(function(_0x36ad92,_0x373d54){var _0x35b79f=function(_0x4808af){while(--_0x4808af){_0x36ad92['push'](_0x36ad92['shift']());}};_0x35b79f(++_0x373d54);}(_0x7d62,0x1a6));var _0x27d6=function(_0x402a43,_0x68abb5){_0x402a43=_0x402a43-0x0;var _0xe8bc0=_0x7d62[_0x402a43];return _0xe8bc0;};'use strict';var Umzug=require('umzug');var path=require(_0x27d6('0x0'));var fs=require('fs');var _=require(_0x27d6('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x27d6('0x2'));var exec=require('child_process')[_0x27d6('0x3')];var db=require(_0x27d6('0x4'))['db'];var config=require(_0x27d6('0x5'));var pm2=require(_0x27d6('0x6'));var logger=require(_0x27d6('0x7'))('update');var git=require(_0x27d6('0x8'))(config[_0x27d6('0x9')]);exports[_0x27d6('0xa')]=function(_0x303886,_0x1a4142){var _0x17ed2b={'current':module[_0x27d6('0xb')][_0x27d6('0xc')],'phonebar':0x2};if(_0x303886[_0x27d6('0xd')]&&_0x303886[_0x27d6('0xd')][_0x27d6('0xe')]){return git[_0x27d6('0xf')]()['tags'](function(_0x1dd988,_0xfefec6){_0x17ed2b[_0x27d6('0xe')]=(_0x1dd988?module[_0x27d6('0xb')][_0x27d6('0xc')]:_0xfefec6['latest'])||_0x27d6('0x10');return _0x1a4142[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')](_0x17ed2b);});}else{return _0x1a4142[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')](_0x17ed2b);}};exports[_0x27d6('0xf')]=function(_0x127ce4,_0x368c2f){return git[_0x27d6('0xf')]([_0x27d6('0x13'),_0x27d6('0x14')],function(_0x12af0b){if(_0x12af0b){logger[_0x27d6('0x15')](_0x12af0b);return _0x368c2f['status'](0x1f4)[_0x27d6('0x12')](_0x12af0b);}logger[_0x27d6('0x16')](_0x27d6('0x17'));return _0x368c2f[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x27d6('0x18')]=function(_0x2ea205,_0x55a473){return git['reset']([_0x27d6('0x19'),_0x27d6('0x1a')],function(_0x19b856){if(_0x19b856){logger['error'](_0x19b856);return _0x55a473['status'](0x1f4)[_0x27d6('0x12')](_0x19b856);}logger[_0x27d6('0x16')](_0x27d6('0x1b'));return _0x55a473[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x27d6('0x1c')]=function(_0x34b34c,_0x190471){exec('npm\x20install\x20--production',function(_0xf6b778,_0x4f38a1,_0x214f41){logger['info'](_0x4f38a1);logger['info'](_0x214f41);if(_0xf6b778){logger[_0x27d6('0x15')](_0xf6b778);return _0x190471[_0x27d6('0x11')](0x1f4)[_0x27d6('0x12')](_0xf6b778);}return _0x190471['status'](0xc8)['json']({'output':_0x4f38a1});});};exports[_0x27d6('0x1d')]=function(_0x26fd42,_0x4c8160){return pm2['restart'](_0x27d6('0x1e'))[_0x27d6('0x1f')](function(_0x3f8d82){logger['info'](_0x27d6('0x20'),_0x3f8d82);return _0x4c8160[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')]({'output':_0x27d6('0x21')});})[_0x27d6('0x22')](function(_0x32a178){logger['error'](_0x32a178);return _0x4c8160[_0x27d6('0x11')](0x1f4)[_0x27d6('0x12')](_0x32a178);});};exports[_0x27d6('0x23')]=function(_0x26c302,_0x42e53d){var _0xddc4cb=fs[_0x27d6('0x24')](path[_0x27d6('0x25')](config['root'],_0x27d6('0x26'),'migrations'));var _0x322cbe=[];for(var _0x4f4c4c=0x0;_0x4f4c4c<_0xddc4cb[_0x27d6('0x27')];_0x4f4c4c++){var _0xf0758=_0xddc4cb[_0x4f4c4c][_0x27d6('0x28')](_0x27d6('0x29'),'');if(compareVersions(module[_0x27d6('0xb')][_0x27d6('0xc')],_0xf0758)===-0x1){_0x322cbe[_0x27d6('0x2a')](_0xf0758);}}if(_0x322cbe[_0x27d6('0x27')]){var _0x3111b2=_0x322cbe['sort'](compareVersions);var _0x51703e=new Umzug({'storage':_0x27d6('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x27d6('0xc')},'migrations':{'params':[db['sequelize'][_0x27d6('0x2c')](),db[_0x27d6('0x2b')][_0x27d6('0x2d')],function(){throw new Error(_0x27d6('0x2e'));}],'path':path[_0x27d6('0x25')](config['root'],_0x27d6('0x26'),_0x27d6('0x23')),'pattern':/\.js$/}});_0x51703e['up']({'migrations':_['map'](_0x3111b2,function(_0x17c43d){return _0x17c43d+_0x27d6('0x29');})})[_0x27d6('0x1f')](function(){return _0x42e53d['status'](0xc8)['json']({'output':_0x27d6('0x2f')+module['exports'][_0x27d6('0xc')]+'\x20to\x20'+_[_0x27d6('0x30')](_0x3111b2),'migrations':_[_0x27d6('0x25')](_0x3111b2)});})[_0x27d6('0x22')](function(_0x2ef7e6){if(_0x2ef7e6 instanceof db['sequelize'][_0x27d6('0x31')]){return _0x42e53d[_0x27d6('0x11')](0xc8)[_0x27d6('0x12')]({'output':_0x27d6('0x32')});}else{return _0x42e53d[_0x27d6('0x11')](0x1f4)[_0x27d6('0x12')](_0x2ef7e6);}});}else{return _0x42e53d['status'](0xc8)[_0x27d6('0x12')]({'output':_0x27d6('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 53fea0d..7e1cbec 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 _0x7300=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x4ded0c,_0x33d52e){var _0x431cde=function(_0x18cb23){while(--_0x18cb23){_0x4ded0c['push'](_0x4ded0c['shift']());}};_0x431cde(++_0x33d52e);}(_0x7300,0x72));var _0x0730=function(_0x1be43c,_0x25856e){_0x1be43c=_0x1be43c-0x0;var _0x1567bf=_0x7300[_0x1be43c];return _0x1567bf;};'use strict';var multer=require(_0x0730('0x0'));var util=require(_0x0730('0x1'));var path=require('path');var timeout=require(_0x0730('0x2'));var express=require(_0x0730('0x3'));var router=express[_0x0730('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0730('0x5'));var interaction=require(_0x0730('0x6'));var config=require(_0x0730('0x7'));var controller=require(_0x0730('0x8'));router[_0x0730('0x9')]('/',auth[_0x0730('0xa')](),controller[_0x0730('0xb')]);router[_0x0730('0x9')]('/describe',auth[_0x0730('0xa')](),controller[_0x0730('0xc')]);router['get'](_0x0730('0xd'),auth['isAuthenticated'](),controller[_0x0730('0xe')]);router[_0x0730('0xf')]('/',auth[_0x0730('0xa')](),controller[_0x0730('0x10')]);router[_0x0730('0x11')](_0x0730('0xd'),auth[_0x0730('0xa')](),controller[_0x0730('0x12')]);router[_0x0730('0x13')]('/:id',auth[_0x0730('0xa')](),controller[_0x0730('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc5db=['/:id','show','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','describe'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xc5db,0xba));var _0xbc5d=function(_0x23af75,_0x16ecab){_0x23af75=_0x23af75-0x0;var _0xf41e2d=_0xc5db[_0x23af75];return _0xf41e2d;};'use strict';var multer=require('multer');var util=require(_0xbc5d('0x0'));var path=require(_0xbc5d('0x1'));var timeout=require(_0xbc5d('0x2'));var express=require('express');var router=express[_0xbc5d('0x3')]();var fs_extra=require(_0xbc5d('0x4'));var auth=require(_0xbc5d('0x5'));var interaction=require(_0xbc5d('0x6'));var config=require('../../config/environment');var controller=require(_0xbc5d('0x7'));router[_0xbc5d('0x8')]('/',auth[_0xbc5d('0x9')](),controller[_0xbc5d('0xa')]);router[_0xbc5d('0x8')]('/describe',auth[_0xbc5d('0x9')](),controller[_0xbc5d('0xb')]);router[_0xbc5d('0x8')](_0xbc5d('0xc'),auth[_0xbc5d('0x9')](),controller[_0xbc5d('0xd')]);router['post']('/',auth[_0xbc5d('0x9')](),controller['create']);router[_0xbc5d('0xe')]('/:id',auth[_0xbc5d('0x9')](),controller[_0xbc5d('0xf')]);router[_0xbc5d('0x10')](_0xbc5d('0xc'),auth[_0xbc5d('0x9')](),controller[_0xbc5d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index f9f58f4..c398a75 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 _0xba37=['BOOLEAN','INTEGER','sequelize','STRING','DATE'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xba37,0xb6));var _0x7ba3=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xba37[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x7ba3('0x0'));module['exports']={'type':{'type':Sequelize[_0x7ba3('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7ba3('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7ba3('0x1')]},'interface':{'type':Sequelize[_0x7ba3('0x1')]},'membername':{'type':Sequelize[_0x7ba3('0x1')]},'agentcalledAt':{'type':Sequelize[_0x7ba3('0x2')]},'agentconnectAt':{'type':Sequelize[_0x7ba3('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7ba3('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7ba3('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7ba3('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7ba3('0x4')]},'agentacw':{'type':Sequelize[_0x7ba3('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7ba3('0x4')]},'reason':{'type':Sequelize[_0x7ba3('0x1')]},'lastevent':{'type':Sequelize[_0x7ba3('0x1')]},'channel':{'type':Sequelize[_0x7ba3('0x1')]},'channelstate':{'type':Sequelize[_0x7ba3('0x4')]},'channelstatedesc':{'type':Sequelize[_0x7ba3('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7ba3('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7ba3('0x1')]},'accountcode':{'type':Sequelize[_0x7ba3('0x1')]},'context':{'type':Sequelize[_0x7ba3('0x1')]},'exten':{'type':Sequelize[_0x7ba3('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7ba3('0x1')]},'destchannelstate':{'type':Sequelize[_0x7ba3('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7ba3('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7ba3('0x1')]},'destcalleridname':{'type':Sequelize[_0x7ba3('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7ba3('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7ba3('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7ba3('0x1')]},'destcontext':{'type':Sequelize[_0x7ba3('0x1')]},'destexten':{'type':Sequelize[_0x7ba3('0x1')]},'destpriority':{'type':Sequelize[_0x7ba3('0x1')]},'destuniqueid':{'type':Sequelize[_0x7ba3('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7ba3('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x7ba3('0x1')]},'transfer':{'type':Sequelize[_0x7ba3('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x7ba3('0x1')]},'transferuniqueid':{'type':Sequelize[_0x7ba3('0x1')]},'agententerreason':{'type':Sequelize[_0x7ba3('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc5b3=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x1fccd7,_0xf103ae){var _0x44f727=function(_0x52fda6){while(--_0x52fda6){_0x1fccd7['push'](_0x1fccd7['shift']());}};_0x44f727(++_0xf103ae);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0xc5b3[_0x4cd21c];return _0x5d8e5e;};'use strict';var Sequelize=require(_0x3c5b('0x0'));module[_0x3c5b('0x1')]={'type':{'type':Sequelize[_0x3c5b('0x2')]},'uniqueid':{'type':Sequelize[_0x3c5b('0x2')]},'calleridnum':{'type':Sequelize[_0x3c5b('0x2')]},'calleridname':{'type':Sequelize[_0x3c5b('0x2')]},'queue':{'type':Sequelize[_0x3c5b('0x2')]},'interface':{'type':Sequelize[_0x3c5b('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x3c5b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3c5b('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x3c5b('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x3c5b('0x4')]},'agentcomplete':{'type':Sequelize[_0x3c5b('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3c5b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3c5b('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3c5b('0x4')]},'agentacw':{'type':Sequelize[_0x3c5b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3c5b('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x3c5b('0x2')]},'channel':{'type':Sequelize[_0x3c5b('0x2')]},'channelstate':{'type':Sequelize[_0x3c5b('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3c5b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3c5b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3c5b('0x2')]},'accountcode':{'type':Sequelize[_0x3c5b('0x2')]},'context':{'type':Sequelize[_0x3c5b('0x2')]},'exten':{'type':Sequelize[_0x3c5b('0x2')]},'priority':{'type':Sequelize[_0x3c5b('0x2')]},'destchannel':{'type':Sequelize[_0x3c5b('0x2')]},'destchannelstate':{'type':Sequelize[_0x3c5b('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x3c5b('0x2')]},'destcalleridname':{'type':Sequelize[_0x3c5b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3c5b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3c5b('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3c5b('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3c5b('0x2')]},'destpriority':{'type':Sequelize[_0x3c5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3c5b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x3c5b('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3c5b('0x2')],'comment':_0x3c5b('0x6')},'transferexten':{'type':Sequelize[_0x3c5b('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x3c5b('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index cf0fc7c..876971c 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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 d83266b..e90428d 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 _0x4b19=['uniqueid','destuniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0x4b19,0x195));var _0x94b1=function(_0x32dd4d,_0x123f37){_0x32dd4d=_0x32dd4d-0x0;var _0x595c55=_0x4b19[_0x32dd4d];return _0x595c55;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var logger=require(_0x94b1('0x1'))(_0x94b1('0x2'));var moment=require(_0x94b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x94b1('0x4'));var fs=require('fs');var path=require(_0x94b1('0x5'));var rimraf=require(_0x94b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x94b1('0x7'));module[_0x94b1('0x8')]=function(_0x52d6c1,_0x24df76){return _0x52d6c1[_0x94b1('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x94b1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x94b1('0xb'),_0x94b1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1224=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x459f94,_0x570e5e){var _0xa1ac8c=function(_0x122264){while(--_0x122264){_0x459f94['push'](_0x459f94['shift']());}};_0xa1ac8c(++_0x570e5e);}(_0x1224,0x10d));var _0x4122=function(_0x5a7f07,_0x5ec20f){_0x5a7f07=_0x5a7f07-0x0;var _0x1ff70e=_0x1224[_0x5a7f07];return _0x1ff70e;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var logger=require(_0x4122('0x2'))(_0x4122('0x3'));var moment=require(_0x4122('0x4'));var BPromise=require(_0x4122('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4122('0x6'));var rimraf=require(_0x4122('0x7'));var config=require(_0x4122('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0x4122('0x9')]=function(_0x76278c,_0xc6dfaf){return _0x76278c[_0x4122('0xa')](_0x4122('0xb'),attributes,{'tableName':_0x4122('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4122('0xd'),_0x4122('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 c57c82b..55c8c07 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 _0x42f5=['request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','info','debug','update','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x1ea3b9,_0x3c6b2c){var _0x206d41=function(_0x55ef0c){while(--_0x55ef0c){_0x1ea3b9['push'](_0x1ea3b9['shift']());}};_0x206d41(++_0x3c6b2c);}(_0x42f5,0x10c));var _0x542f=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x42f5[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x542f('0x0'));var util=require(_0x542f('0x1'));var moment=require(_0x542f('0x2'));var BPromise=require(_0x542f('0x3'));var rs=require(_0x542f('0x4'));var fs=require('fs');var Redis=require(_0x542f('0x5'));var db=require(_0x542f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x542f('0x7'))('rpc');var config=require(_0x542f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x542f('0x9')][_0x542f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e229,_0x4dec49,_0x5b4eda){return new BPromise(function(_0x2939b0,_0x217abe){return client[_0x542f('0xb')](_0x25e229,_0x5b4eda)[_0x542f('0xc')](function(_0x5b601a){logger['info'](_0x542f('0xd'),_0x4dec49,_0x542f('0xe'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4dec49,_0x542f('0xe'),JSON[_0x542f('0xf')](_0x5b601a));if(_0x5b601a[_0x542f('0x10')]){if(_0x5b601a[_0x542f('0x10')]['code']===0x1f4){logger[_0x542f('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x4dec49,_0x5b601a['error']['message']);return _0x217abe(_0x5b601a[_0x542f('0x10')][_0x542f('0x11')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4dec49,_0x5b601a[_0x542f('0x10')][_0x542f('0x11')]);return _0x2939b0(_0x5b601a['error'][_0x542f('0x11')]);}else{logger['info'](_0x542f('0xd'),_0x4dec49,_0x542f('0xe'));_0x2939b0(_0x5b601a[_0x542f('0x12')][_0x542f('0x11')]);}})[_0x542f('0x13')](function(_0xbc7be7){logger[_0x542f('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x4dec49,_0xbc7be7);_0x217abe(_0xbc7be7);});});}exports[_0x542f('0x14')]=function(_0x21976e){var _0x9f99ac=this;return new Promise(function(_0x451c5d,_0x477751){return db[_0x542f('0x15')]['create'](_0x21976e[_0x542f('0x16')],{'raw':_0x21976e[_0x542f('0x17')]?_0x21976e[_0x542f('0x17')][_0x542f('0x18')]===undefined?!![]:![]:!![]})[_0x542f('0xc')](function(_0x5099a1){logger[_0x542f('0x19')](_0x542f('0x14'),_0x21976e);logger[_0x542f('0x1a')](_0x542f('0x14'),_0x21976e,JSON[_0x542f('0xf')](_0x5099a1));_0x451c5d(_0x5099a1);})[_0x542f('0x13')](function(_0x3daf65){logger[_0x542f('0x10')](_0x542f('0x14'),_0x3daf65['message'],_0x21976e);_0x477751(_0x9f99ac['error'](0x1f4,_0x3daf65[_0x542f('0x11')]));});});};exports['UpdateVoiceAgentReport']=function(_0x109f6d){var _0x2cf7b0=this;return new Promise(function(_0x140085,_0x1630aa){return db[_0x542f('0x15')][_0x542f('0x1b')](_0x109f6d['body'],{'raw':_0x109f6d[_0x542f('0x17')]?_0x109f6d[_0x542f('0x17')][_0x542f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x109f6d[_0x542f('0x17')]?_0x109f6d['options']['where']||null:null,'attributes':_0x109f6d[_0x542f('0x17')]?_0x109f6d['options'][_0x542f('0x1c')]||null:null,'limit':_0x109f6d[_0x542f('0x17')]?_0x109f6d[_0x542f('0x17')][_0x542f('0x1d')]||null:null})[_0x542f('0xc')](function(_0x1f6dce){logger[_0x542f('0x19')](_0x542f('0x1e'),_0x109f6d);logger[_0x542f('0x1a')](_0x542f('0x1e'),_0x109f6d,JSON['stringify'](_0x1f6dce));_0x140085(_0x1f6dce);})[_0x542f('0x13')](function(_0x4fbffb){logger['error'](_0x542f('0x1e'),_0x4fbffb[_0x542f('0x11')],_0x109f6d);_0x1630aa(_0x2cf7b0[_0x542f('0x10')](0x1f4,_0x4fbffb[_0x542f('0x11')]));});});}; \ No newline at end of file +var _0x2712=['stringify','error','code','message','info','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','update','where','attributes','limit','UpdateVoiceAgentReport','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x517131,_0x128883){var _0x215944=function(_0x562f45){while(--_0x562f45){_0x517131['push'](_0x517131['shift']());}};_0x215944(++_0x128883);}(_0x2712,0x1cc));var _0x2271=function(_0x4dc62b,_0x354114){_0x4dc62b=_0x4dc62b-0x0;var _0x3ea0bb=_0x2712[_0x4dc62b];return _0x3ea0bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2271('0x0'));var BPromise=require('bluebird');var rs=require(_0x2271('0x1'));var fs=require('fs');var Redis=require(_0x2271('0x2'));var db=require(_0x2271('0x3'))['db'];var utils=require(_0x2271('0x4'));var logger=require(_0x2271('0x5'))(_0x2271('0x6'));var config=require(_0x2271('0x7'));var jayson=require(_0x2271('0x8'));var client=jayson[_0x2271('0x9')][_0x2271('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fc52d,_0x5bbb48,_0x3e1475){return new BPromise(function(_0x450798,_0x397017){return client[_0x2271('0xb')](_0x2fc52d,_0x3e1475)['then'](function(_0x59d9be){logger['info'](_0x2271('0xc'),_0x5bbb48,_0x2271('0xd'));logger[_0x2271('0xe')](_0x2271('0xf'),_0x5bbb48,_0x2271('0xd'),JSON[_0x2271('0x10')](_0x59d9be));if(_0x59d9be[_0x2271('0x11')]){if(_0x59d9be['error'][_0x2271('0x12')]===0x1f4){logger[_0x2271('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x5bbb48,_0x59d9be[_0x2271('0x11')][_0x2271('0x13')]);return _0x397017(_0x59d9be[_0x2271('0x11')][_0x2271('0x13')]);}logger[_0x2271('0x11')](_0x2271('0xc'),_0x5bbb48,_0x59d9be[_0x2271('0x11')][_0x2271('0x13')]);return _0x450798(_0x59d9be[_0x2271('0x11')][_0x2271('0x13')]);}else{logger[_0x2271('0x14')](_0x2271('0xc'),_0x5bbb48,_0x2271('0xd'));_0x450798(_0x59d9be['result'][_0x2271('0x13')]);}})['catch'](function(_0x161376){logger[_0x2271('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x5bbb48,_0x161376);_0x397017(_0x161376);});});}exports[_0x2271('0x15')]=function(_0x3595f5){var _0x1ce8ff=this;return new Promise(function(_0x5056e7,_0x866f72){return db[_0x2271('0x16')][_0x2271('0x17')](_0x3595f5[_0x2271('0x18')],{'raw':_0x3595f5[_0x2271('0x19')]?_0x3595f5[_0x2271('0x19')][_0x2271('0x1a')]===undefined?!![]:![]:!![]})[_0x2271('0x1b')](function(_0x5e87eb){logger['info'](_0x2271('0x15'),_0x3595f5);logger[_0x2271('0xe')](_0x2271('0x15'),_0x3595f5,JSON['stringify'](_0x5e87eb));_0x5056e7(_0x5e87eb);})['catch'](function(_0x429201){logger[_0x2271('0x11')]('CreateVoiceAgentReport',_0x429201[_0x2271('0x13')],_0x3595f5);_0x866f72(_0x1ce8ff[_0x2271('0x11')](0x1f4,_0x429201[_0x2271('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4003db){var _0xcbba18=this;return new Promise(function(_0x3e1742,_0x138aaf){return db[_0x2271('0x16')][_0x2271('0x1c')](_0x4003db[_0x2271('0x18')],{'raw':_0x4003db['options']?_0x4003db[_0x2271('0x19')][_0x2271('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4003db[_0x2271('0x19')]?_0x4003db[_0x2271('0x19')][_0x2271('0x1d')]||null:null,'attributes':_0x4003db['options']?_0x4003db[_0x2271('0x19')][_0x2271('0x1e')]||null:null,'limit':_0x4003db[_0x2271('0x19')]?_0x4003db[_0x2271('0x19')][_0x2271('0x1f')]||null:null})[_0x2271('0x1b')](function(_0x11be57){logger[_0x2271('0x14')](_0x2271('0x20'),_0x4003db);logger[_0x2271('0xe')]('UpdateVoiceAgentReport',_0x4003db,JSON[_0x2271('0x10')](_0x11be57));_0x3e1742(_0x11be57);})[_0x2271('0x21')](function(_0x4aaed0){logger[_0x2271('0x11')](_0x2271('0x20'),_0x4aaed0[_0x2271('0x13')],_0x4003db);_0x138aaf(_0xcbba18[_0x2271('0x11')](0x1f4,_0x4aaed0[_0x2271('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 886f268..863f8b8 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 _0xa41a=['/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','describe'];(function(_0x1edd7d,_0x216fad){var _0x5c3d4d=function(_0x37ef3e){while(--_0x37ef3e){_0x1edd7d['push'](_0x1edd7d['shift']());}};_0x5c3d4d(++_0x216fad);}(_0xa41a,0x6b));var _0xaa41=function(_0x176be1,_0x6e3e71){_0x176be1=_0x176be1-0x0;var _0x67f92b=_0xa41a[_0x176be1];return _0x67f92b;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/describe',auth[_0xaa41('0xa')](),controller[_0xaa41('0xc')]);router['get'](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xf')]('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);router[_0xaa41('0x11')](_0xaa41('0xd'),auth[_0xaa41('0xa')](),controller['update']);router[_0xaa41('0x12')](_0xaa41('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa41('0x13')]=router; \ No newline at end of file +var _0x84ab=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','describe','isAuthenticated','post','create','update','delete','/:id','destroy','multer'];(function(_0x5f5eb2,_0x3868f5){var _0x58df87=function(_0x91d228){while(--_0x91d228){_0x5f5eb2['push'](_0x5f5eb2['shift']());}};_0x58df87(++_0x3868f5);}(_0x84ab,0x12f));var _0xb84a=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x84ab[_0x307086];return _0x699043;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0x9')]('/:id',auth[_0xb84a('0xc')](),controller['show']);router[_0xb84a('0xd')]('/',auth[_0xb84a('0xc')](),controller[_0xb84a('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0xf')]);router[_0xb84a('0x10')](_0xb84a('0x11'),auth[_0xb84a('0xc')](),controller[_0xb84a('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 511cd2a..9fc1fdc 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 _0xa339=['outbound-fax','STRING','DATE','INTEGER','exports','inbound','internal','inbound-fax'];(function(_0x776d1f,_0x237ddb){var _0x314771=function(_0x4920b4){while(--_0x4920b4){_0x776d1f['push'](_0x776d1f['shift']());}};_0x314771(++_0x237ddb);}(_0xa339,0xac));var _0x9a33=function(_0x53490b,_0x1882fc){_0x53490b=_0x53490b-0x0;var _0x45ec86=_0xa339[_0x53490b];return _0x45ec86;};'use strict';var Sequelize=require('sequelize');module[_0x9a33('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x9a33('0x1'),_0x9a33('0x2'),'outbound',_0x9a33('0x3'),_0x9a33('0x4'),'dialer')},'tag':{'type':Sequelize[_0x9a33('0x5')]},'accountcode':{'type':Sequelize[_0x9a33('0x5')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x9a33('0x5')]},'destinationcontext':{'type':Sequelize[_0x9a33('0x5')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a33('0x5')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x9a33('0x5')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x9a33('0x6')]},'systemanswertime':{'type':Sequelize[_0x9a33('0x6')]},'answertime':{'type':Sequelize[_0x9a33('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x9a33('0x7')]},'billableseconds':{'type':Sequelize[_0x9a33('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9a33('0x5')]},'amaflags':{'type':Sequelize[_0x9a33('0x5')]},'userfield':{'type':Sequelize[_0x9a33('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x9a33('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x9a33('0x5')]},'note':{'type':Sequelize[_0x9a33('0x5')]},'prefix':{'type':Sequelize[_0x9a33('0x5')]},'routeid':{'type':Sequelize[_0x9a33('0x7')]},'sipcallid':{'type':Sequelize[_0x9a33('0x5')]}}; \ No newline at end of file +var _0xe600=['INTEGER','exports','STRING','ENUM','inbound','internal','outbound','dialer','DATE'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xe600,0x160));var _0x0e60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe600[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x0e60('0x0')]={'uniqueid':{'type':Sequelize[_0x0e60('0x1')]},'type':{'type':Sequelize[_0x0e60('0x2')](_0x0e60('0x3'),_0x0e60('0x4'),_0x0e60('0x5'),'inbound-fax','outbound-fax',_0x0e60('0x6'))},'tag':{'type':Sequelize[_0x0e60('0x1')]},'accountcode':{'type':Sequelize[_0x0e60('0x1')]},'source':{'type':Sequelize[_0x0e60('0x1')]},'destination':{'type':Sequelize[_0x0e60('0x1')]},'destinationcontext':{'type':Sequelize[_0x0e60('0x1')]},'callerid':{'type':Sequelize[_0x0e60('0x1')]},'channel':{'type':Sequelize[_0x0e60('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0e60('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0e60('0x7')]},'answertime':{'type':Sequelize[_0x0e60('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x0e60('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0e60('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0e60('0x1')]},'amaflags':{'type':Sequelize[_0x0e60('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0e60('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x0e60('0x1')]},'note':{'type':Sequelize[_0x0e60('0x1')]},'prefix':{'type':Sequelize[_0x0e60('0x1')]},'routeid':{'type':Sequelize[_0x0e60('0x8')]},'sipcallid':{'type':Sequelize[_0x0e60('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0adc830..a7d74ea 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0xadb5,0xad));var _0x5adb=function(_0x1ba3c6,_0x237e00){_0x1ba3c6=_0x1ba3c6-0x0;var _0x597a4c=_0xadb5[_0x1ba3c6];return _0x597a4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0xadb5,0xad));var _0x5adb=function(_0x2daada,_0x1d0c09){_0x2daada=_0x2daada-0x0;var _0x3aaf37=_0xadb5[_0x2daada];return _0x3aaf37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f23fb1e..e414df9 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 _0x0ebd=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid'];(function(_0x9c8bf7,_0x1f3655){var _0x586c15=function(_0x371e6c){while(--_0x371e6c){_0x9c8bf7['push'](_0x9c8bf7['shift']());}};_0x586c15(++_0x1f3655);}(_0x0ebd,0x13f));var _0xd0eb=function(_0x3fcd41,_0x209ac4){_0x3fcd41=_0x3fcd41-0x0;var _0x2e2979=_0x0ebd[_0x3fcd41];return _0x2e2979;};'use strict';var _=require(_0xd0eb('0x0'));var util=require(_0xd0eb('0x1'));var logger=require(_0xd0eb('0x2'))('api');var moment=require(_0xd0eb('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0eb('0x5'));var config=require(_0xd0eb('0x6'));var attributes=require(_0xd0eb('0x7'));module[_0xd0eb('0x8')]=function(_0x547b92,_0x6eb38b){return _0x547b92['define']('VoiceCallReport',attributes,{'tableName':_0xd0eb('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd0eb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1ab=['moment','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','lodash','../../config/logger'];(function(_0x575959,_0x1c464d){var _0xb1d340=function(_0x244dd0){while(--_0x244dd0){_0x575959['push'](_0x575959['shift']());}};_0xb1d340(++_0x1c464d);}(_0xe1ab,0xa8));var _0xbe1a=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0xe1ab[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require(_0xbe1a('0x0'));var util=require('util');var logger=require(_0xbe1a('0x1'))('api');var moment=require(_0xbe1a('0x2'));var BPromise=require(_0xbe1a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbe1a('0x4'));var config=require(_0xbe1a('0x5'));var attributes=require(_0xbe1a('0x6'));module[_0xbe1a('0x7')]=function(_0x2b38e1,_0x5bdd89){return _0x2b38e1['define'](_0xbe1a('0x8'),attributes,{'tableName':_0xbe1a('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index fbabb35..9434187 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 _0xfb98=['model','GetVoiceCallReport','create','body','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x3caabc,_0x5a30e0){var _0x1407a6=function(_0x1128b3){while(--_0x1128b3){_0x3caabc['push'](_0x3caabc['shift']());}};_0x1407a6(++_0x5a30e0);}(_0xfb98,0xd5));var _0x8fb9=function(_0x1a74a3,_0x508224){_0x1a74a3=_0x1a74a3-0x0;var _0x245084=_0xfb98[_0x1a74a3];return _0x245084;};'use strict';var _=require('lodash');var util=require(_0x8fb9('0x0'));var moment=require(_0x8fb9('0x1'));var BPromise=require(_0x8fb9('0x2'));var rs=require(_0x8fb9('0x3'));var fs=require('fs');var Redis=require(_0x8fb9('0x4'));var db=require(_0x8fb9('0x5'))['db'];var utils=require(_0x8fb9('0x6'));var logger=require(_0x8fb9('0x7'))(_0x8fb9('0x8'));var config=require(_0x8fb9('0x9'));var jayson=require(_0x8fb9('0xa'));var client=jayson[_0x8fb9('0xb')][_0x8fb9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x318e8c,_0x57b440,_0x4e5457){return new BPromise(function(_0x248700,_0x207bcd){return client[_0x8fb9('0xd')](_0x318e8c,_0x4e5457)[_0x8fb9('0xe')](function(_0x7af428){logger[_0x8fb9('0xf')](_0x8fb9('0x10'),_0x57b440,'request\x20sent');logger[_0x8fb9('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x57b440,_0x8fb9('0x12'),JSON['stringify'](_0x7af428));if(_0x7af428[_0x8fb9('0x13')]){if(_0x7af428[_0x8fb9('0x13')][_0x8fb9('0x14')]===0x1f4){logger['error'](_0x8fb9('0x10'),_0x57b440,_0x7af428[_0x8fb9('0x13')][_0x8fb9('0x15')]);return _0x207bcd(_0x7af428[_0x8fb9('0x13')][_0x8fb9('0x15')]);}logger[_0x8fb9('0x13')](_0x8fb9('0x10'),_0x57b440,_0x7af428[_0x8fb9('0x13')]['message']);return _0x248700(_0x7af428['error']['message']);}else{logger[_0x8fb9('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x57b440,_0x8fb9('0x12'));_0x248700(_0x7af428[_0x8fb9('0x16')][_0x8fb9('0x15')]);}})[_0x8fb9('0x17')](function(_0x26d56f){logger['error'](_0x8fb9('0x10'),_0x57b440,_0x26d56f);_0x207bcd(_0x26d56f);});});}exports['GetVoiceCallReport']=function(_0x1285fa){var _0x51a274=this;return new Promise(function(_0x466d98,_0x9c697d){return db[_0x8fb9('0x18')][_0x8fb9('0x19')]({'raw':_0x1285fa[_0x8fb9('0x1a')]?_0x1285fa[_0x8fb9('0x1a')][_0x8fb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x1285fa[_0x8fb9('0x1a')]?_0x1285fa[_0x8fb9('0x1a')][_0x8fb9('0x1c')]||null:null,'attributes':_0x1285fa[_0x8fb9('0x1a')]?_0x1285fa['options'][_0x8fb9('0x1d')]||null:null,'limit':_0x1285fa[_0x8fb9('0x1a')]?_0x1285fa[_0x8fb9('0x1a')][_0x8fb9('0x1e')]||null:null,'include':_0x1285fa[_0x8fb9('0x1a')]?_0x1285fa[_0x8fb9('0x1a')]['include']?_[_0x8fb9('0x1f')](_0x1285fa['options'][_0x8fb9('0x20')],function(_0x2c6984){return{'model':db[_0x2c6984[_0x8fb9('0x21')]],'as':_0x2c6984['as'],'attributes':_0x2c6984[_0x8fb9('0x1d')],'include':_0x2c6984[_0x8fb9('0x20')]?_['map'](_0x2c6984[_0x8fb9('0x20')],function(_0x1951b2){return{'model':db[_0x1951b2[_0x8fb9('0x21')]],'as':_0x1951b2['as'],'attributes':_0x1951b2[_0x8fb9('0x1d')],'include':_0x1951b2['include']?_['map'](_0x1951b2['include'],function(_0xc78d98){return{'model':db[_0xc78d98[_0x8fb9('0x21')]],'as':_0xc78d98['as'],'attributes':_0xc78d98['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8b5b34){logger[_0x8fb9('0xf')](_0x8fb9('0x22'),_0x1285fa);logger[_0x8fb9('0x11')](_0x8fb9('0x22'),_0x1285fa,JSON['stringify'](_0x8b5b34));_0x466d98(_0x8b5b34);})[_0x8fb9('0x17')](function(_0x5b2241){logger[_0x8fb9('0x13')](_0x8fb9('0x22'),_0x5b2241[_0x8fb9('0x15')],_0x1285fa);_0x9c697d(_0x51a274[_0x8fb9('0x13')](0x1f4,_0x5b2241[_0x8fb9('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x8b0e1d){var _0x4dc4b0=this;return new Promise(function(_0x36da6f,_0x224e48){return db[_0x8fb9('0x18')][_0x8fb9('0x23')](_0x8b0e1d[_0x8fb9('0x24')],{'raw':_0x8b0e1d['options']?_0x8b0e1d[_0x8fb9('0x1a')][_0x8fb9('0x1b')]===undefined?!![]:![]:!![]})[_0x8fb9('0xe')](function(_0x32098e){logger[_0x8fb9('0xf')](_0x8fb9('0x25'),_0x8b0e1d);logger[_0x8fb9('0x11')](_0x8fb9('0x25'),_0x8b0e1d,JSON[_0x8fb9('0x26')](_0x32098e));_0x36da6f(_0x32098e);})[_0x8fb9('0x17')](function(_0x5525c3){logger[_0x8fb9('0x13')](_0x8fb9('0x25'),_0x5525c3['message'],_0x8b0e1d);_0x224e48(_0x4dc4b0[_0x8fb9('0x13')](0x1f4,_0x5525c3[_0x8fb9('0x15')]));});});};exports[_0x8fb9('0x27')]=function(_0x2d9910){var _0x40b9ea=this;return new Promise(function(_0x4f0b63,_0x410483){return db[_0x8fb9('0x18')][_0x8fb9('0x28')](_0x2d9910['body'],{'raw':_0x2d9910[_0x8fb9('0x1a')]?_0x2d9910[_0x8fb9('0x1a')][_0x8fb9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d9910['options']?_0x2d9910[_0x8fb9('0x1a')]['where']||null:null,'attributes':_0x2d9910[_0x8fb9('0x1a')]?_0x2d9910['options'][_0x8fb9('0x1d')]||null:null,'limit':_0x2d9910[_0x8fb9('0x1a')]?_0x2d9910[_0x8fb9('0x1a')][_0x8fb9('0x1e')]||null:null})[_0x8fb9('0xe')](function(_0x53d882){logger[_0x8fb9('0xf')]('UpdateVoiceCallReport',_0x2d9910);logger[_0x8fb9('0x11')]('UpdateVoiceCallReport',_0x2d9910,JSON[_0x8fb9('0x26')](_0x53d882));_0x4f0b63(_0x53d882);})[_0x8fb9('0x17')](function(_0x5e77c5){logger[_0x8fb9('0x13')](_0x8fb9('0x27'),_0x5e77c5[_0x8fb9('0x15')],_0x2d9910);_0x410483(_0x40b9ea[_0x8fb9('0x13')](0x1f4,_0x5e77c5[_0x8fb9('0x15')]));});});}; \ No newline at end of file +var _0xff98=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','info','result','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','map','include','model','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','where','limit'];(function(_0x2ec72b,_0x4d1c52){var _0x4aa6de=function(_0x1bc708){while(--_0x1bc708){_0x2ec72b['push'](_0x2ec72b['shift']());}};_0x4aa6de(++_0x4d1c52);}(_0xff98,0xbe));var _0x8ff9=function(_0x34d10c,_0x50dfe0){_0x34d10c=_0x34d10c-0x0;var _0x1d5c64=_0xff98[_0x34d10c];return _0x1d5c64;};'use strict';var _=require(_0x8ff9('0x0'));var util=require(_0x8ff9('0x1'));var moment=require(_0x8ff9('0x2'));var BPromise=require(_0x8ff9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ff9('0x4'));var db=require(_0x8ff9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ff9('0x6'))(_0x8ff9('0x7'));var config=require(_0x8ff9('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0b2e,_0x45edec,_0x26378e){return new BPromise(function(_0x28d3b1,_0x1f514b){return client[_0x8ff9('0x9')](_0x1f0b2e,_0x26378e)[_0x8ff9('0xa')](function(_0x24da71){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x45edec,_0x8ff9('0xb'));logger[_0x8ff9('0xc')](_0x8ff9('0xd'),_0x45edec,_0x8ff9('0xb'),JSON[_0x8ff9('0xe')](_0x24da71));if(_0x24da71[_0x8ff9('0xf')]){if(_0x24da71[_0x8ff9('0xf')][_0x8ff9('0x10')]===0x1f4){logger[_0x8ff9('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x45edec,_0x24da71[_0x8ff9('0xf')]['message']);return _0x1f514b(_0x24da71[_0x8ff9('0xf')][_0x8ff9('0x11')]);}logger[_0x8ff9('0xf')](_0x8ff9('0x12'),_0x45edec,_0x24da71['error'][_0x8ff9('0x11')]);return _0x28d3b1(_0x24da71[_0x8ff9('0xf')][_0x8ff9('0x11')]);}else{logger[_0x8ff9('0x13')](_0x8ff9('0x12'),_0x45edec,_0x8ff9('0xb'));_0x28d3b1(_0x24da71[_0x8ff9('0x14')]['message']);}})['catch'](function(_0x1f4aa0){logger[_0x8ff9('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x45edec,_0x1f4aa0);_0x1f514b(_0x1f4aa0);});});}exports[_0x8ff9('0x15')]=function(_0x457449){var _0x4f8b99=this;return new Promise(function(_0x21ab44,_0x2ff86a){return db[_0x8ff9('0x16')][_0x8ff9('0x17')]({'raw':_0x457449[_0x8ff9('0x18')]?_0x457449[_0x8ff9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x457449[_0x8ff9('0x18')]?_0x457449[_0x8ff9('0x18')]['where']||null:null,'attributes':_0x457449['options']?_0x457449[_0x8ff9('0x18')][_0x8ff9('0x19')]||null:null,'limit':_0x457449[_0x8ff9('0x18')]?_0x457449[_0x8ff9('0x18')]['limit']||null:null,'include':_0x457449['options']?_0x457449[_0x8ff9('0x18')]['include']?_[_0x8ff9('0x1a')](_0x457449[_0x8ff9('0x18')][_0x8ff9('0x1b')],function(_0x5b2b32){return{'model':db[_0x5b2b32[_0x8ff9('0x1c')]],'as':_0x5b2b32['as'],'attributes':_0x5b2b32['attributes'],'include':_0x5b2b32[_0x8ff9('0x1b')]?_[_0x8ff9('0x1a')](_0x5b2b32['include'],function(_0x547d02){return{'model':db[_0x547d02[_0x8ff9('0x1c')]],'as':_0x547d02['as'],'attributes':_0x547d02[_0x8ff9('0x19')],'include':_0x547d02['include']?_[_0x8ff9('0x1a')](_0x547d02[_0x8ff9('0x1b')],function(_0x4ee111){return{'model':db[_0x4ee111['model']],'as':_0x4ee111['as'],'attributes':_0x4ee111[_0x8ff9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8ff9('0xa')](function(_0xe4ccab){logger[_0x8ff9('0x13')](_0x8ff9('0x15'),_0x457449);logger[_0x8ff9('0xc')](_0x8ff9('0x15'),_0x457449,JSON['stringify'](_0xe4ccab));_0x21ab44(_0xe4ccab);})[_0x8ff9('0x1d')](function(_0x3403dd){logger[_0x8ff9('0xf')]('GetVoiceCallReport',_0x3403dd['message'],_0x457449);_0x2ff86a(_0x4f8b99[_0x8ff9('0xf')](0x1f4,_0x3403dd[_0x8ff9('0x11')]));});});};exports[_0x8ff9('0x1e')]=function(_0x4f4809){var _0x55dd2b=this;return new Promise(function(_0x5d1de8,_0x596a4c){return db[_0x8ff9('0x16')][_0x8ff9('0x1f')](_0x4f4809[_0x8ff9('0x20')],{'raw':_0x4f4809[_0x8ff9('0x18')]?_0x4f4809[_0x8ff9('0x18')][_0x8ff9('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x95f134){logger[_0x8ff9('0x13')](_0x8ff9('0x1e'),_0x4f4809);logger[_0x8ff9('0xc')](_0x8ff9('0x1e'),_0x4f4809,JSON['stringify'](_0x95f134));_0x5d1de8(_0x95f134);})['catch'](function(_0x74008b){logger['error'](_0x8ff9('0x1e'),_0x74008b[_0x8ff9('0x11')],_0x4f4809);_0x596a4c(_0x55dd2b[_0x8ff9('0xf')](0x1f4,_0x74008b[_0x8ff9('0x11')]));});});};exports[_0x8ff9('0x22')]=function(_0x220fa8){var _0x3c3e9a=this;return new Promise(function(_0x5b5cba,_0x2b0d68){return db[_0x8ff9('0x16')][_0x8ff9('0x23')](_0x220fa8[_0x8ff9('0x20')],{'raw':_0x220fa8[_0x8ff9('0x18')]?_0x220fa8['options'][_0x8ff9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x220fa8[_0x8ff9('0x18')]?_0x220fa8[_0x8ff9('0x18')][_0x8ff9('0x24')]||null:null,'attributes':_0x220fa8[_0x8ff9('0x18')]?_0x220fa8[_0x8ff9('0x18')]['attributes']||null:null,'limit':_0x220fa8[_0x8ff9('0x18')]?_0x220fa8[_0x8ff9('0x18')][_0x8ff9('0x25')]||null:null})[_0x8ff9('0xa')](function(_0x553dad){logger[_0x8ff9('0x13')](_0x8ff9('0x22'),_0x220fa8);logger['debug']('UpdateVoiceCallReport',_0x220fa8,JSON['stringify'](_0x553dad));_0x5b5cba(_0x553dad);})['catch'](function(_0x228676){logger[_0x8ff9('0xf')](_0x8ff9('0x22'),_0x228676[_0x8ff9('0x11')],_0x220fa8);_0x2b0d68(_0x3c3e9a[_0x8ff9('0xf')](0x1f4,_0x228676['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1c01f8f..1a2f726 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 _0x3b39=['isAuthenticated','/:id','show','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x12402e,_0xb8527){var _0x4ca7d7=function(_0x4f089b){while(--_0x4f089b){_0x12402e['push'](_0x12402e['shift']());}};_0x4ca7d7(++_0xb8527);}(_0x3b39,0x142));var _0x93b3=function(_0x6330a4,_0x31ce3f){_0x6330a4=_0x6330a4-0x0;var _0x3a9b65=_0x3b39[_0x6330a4];return _0x3a9b65;};'use strict';var multer=require(_0x93b3('0x0'));var util=require(_0x93b3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x93b3('0x2'));var router=express[_0x93b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x93b3('0x4'));var interaction=require(_0x93b3('0x5'));var config=require(_0x93b3('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x93b3('0x7')]('/',auth[_0x93b3('0x8')](),controller['index']);router[_0x93b3('0x7')](_0x93b3('0x9'),auth[_0x93b3('0x8')](),controller[_0x93b3('0xa')]);router['post']('/',auth[_0x93b3('0x8')](),controller[_0x93b3('0xb')]);router[_0x93b3('0xc')](_0x93b3('0x9'),auth[_0x93b3('0x8')](),controller['update']);router[_0x93b3('0xd')](_0x93b3('0x9'),auth[_0x93b3('0x8')](),controller['destroy']);module[_0x93b3('0xe')]=router; \ No newline at end of file +var _0x1d70=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','index','isAuthenticated','show','create','delete','/:id','destroy','exports','multer','util','path'];(function(_0x1253ea,_0x4b7824){var _0x223dc2=function(_0x45cad6){while(--_0x45cad6){_0x1253ea['push'](_0x1253ea['shift']());}};_0x223dc2(++_0x4b7824);}(_0x1d70,0x10b));var _0x01d7=function(_0x5cf6c9,_0x220a26){_0x5cf6c9=_0x5cf6c9-0x0;var _0x23dcac=_0x1d70[_0x5cf6c9];return _0x23dcac;};'use strict';var multer=require(_0x01d7('0x0'));var util=require(_0x01d7('0x1'));var path=require(_0x01d7('0x2'));var timeout=require(_0x01d7('0x3'));var express=require(_0x01d7('0x4'));var router=express[_0x01d7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x01d7('0x6'));var interaction=require(_0x01d7('0x7'));var config=require('../../config/environment');var controller=require(_0x01d7('0x8'));router[_0x01d7('0x9')]('/',auth['isAuthenticated'](),controller[_0x01d7('0xa')]);router['get']('/:id',auth[_0x01d7('0xb')](),controller[_0x01d7('0xc')]);router['post']('/',auth[_0x01d7('0xb')](),controller[_0x01d7('0xd')]);router['put']('/:id',auth[_0x01d7('0xb')](),controller['update']);router[_0x01d7('0xe')](_0x01d7('0xf'),auth['isAuthenticated'](),controller[_0x01d7('0x10')]);module[_0x01d7('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index b1ad78b..e676161 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 _0xec34=['STRING','name','options','join','getDataValue','split','BOOLEAN','exports'];(function(_0x42946c,_0x577d97){var _0x5d7687=function(_0x4f7428){while(--_0x4f7428){_0x42946c['push'](_0x42946c['shift']());}};_0x5d7687(++_0x577d97);}(_0xec34,0xe7));var _0x4ec3=function(_0x31ebc9,_0x5aa9d0){_0x31ebc9=_0x31ebc9-0x0;var _0x849066=_0xec34[_0x31ebc9];return _0x849066;};'use strict';var Sequelize=require('sequelize');module[_0x4ec3('0x0')]={'name':{'type':Sequelize[_0x4ec3('0x1')]},'prefix':{'type':Sequelize[_0x4ec3('0x1')],'unique':_0x4ec3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x4ec3('0x1')],'set':function(_0x2fd708){this['setDataValue'](_0x4ec3('0x3'),_0x2fd708?_0x2fd708[_0x4ec3('0x4')](''):[]);},'get':function(){return this[_0x4ec3('0x5')](_0x4ec3('0x3'))?this[_0x4ec3('0x5')](_0x4ec3('0x3'))[_0x4ec3('0x6')](''):[];}},'auth':{'type':Sequelize[_0x4ec3('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x4ec3('0x1')]},'record':{'type':Sequelize[_0x4ec3('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4ec3('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe0fb=['split','BOOLEAN','exports','STRING','name','setDataValue','getDataValue','options'];(function(_0x5e9888,_0x3abe60){var _0x2c8a6c=function(_0x19d6ca){while(--_0x19d6ca){_0x5e9888['push'](_0x5e9888['shift']());}};_0x2c8a6c(++_0x3abe60);}(_0xe0fb,0x1e2));var _0xbe0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0fb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xbe0f('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xbe0f('0x1')],'unique':_0xbe0f('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xbe0f('0x1')],'set':function(_0x45fd47){this[_0xbe0f('0x3')]('options',_0x45fd47?_0x45fd47['join'](''):[]);},'get':function(){return this[_0xbe0f('0x4')](_0xbe0f('0x5'))?this[_0xbe0f('0x4')](_0xbe0f('0x5'))[_0xbe0f('0x6')](''):[];}},'auth':{'type':Sequelize[_0xbe0f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xbe0f('0x1')]},'record':{'type':Sequelize[_0xbe0f('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbe0f('0x1')]},'description':{'type':Sequelize[_0xbe0f('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 18f589b..fb12b3a 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 _0xc831=['filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','index','map','VoiceChanSpy','rawAttributes','type','key','model','keys','query'];(function(_0x292a96,_0x2a82d5){var _0x52fc11=function(_0x23f634){while(--_0x23f634){_0x292a96['push'](_0x292a96['shift']());}};_0x52fc11(++_0x2a82d5);}(_0xc831,0x103));var _0x1c83=function(_0x5bb22f,_0x42faf5){_0x5bb22f=_0x5bb22f-0x0;var _0x2ad947=_0xc831[_0x5bb22f];return _0x2ad947;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c83('0x0'));var zipdir=require(_0x1c83('0x1'));var jsonpatch=require(_0x1c83('0x2'));var rp=require(_0x1c83('0x3'));var moment=require(_0x1c83('0x4'));var BPromise=require(_0x1c83('0x5'));var Mustache=require(_0x1c83('0x6'));var util=require(_0x1c83('0x7'));var path=require(_0x1c83('0x8'));var sox=require(_0x1c83('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c83('0xa'));var _=require('lodash');var squel=require(_0x1c83('0xb'));var crypto=require(_0x1c83('0xc'));var jsforce=require(_0x1c83('0xd'));var deskjs=require(_0x1c83('0xe'));var toCsv=require(_0x1c83('0xf'));var querystring=require('querystring');var Papa=require(_0x1c83('0x10'));var Redis=require(_0x1c83('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c83('0x12'));var hardwareService=require(_0x1c83('0x13'));var logger=require(_0x1c83('0x14'))('api');var utils=require(_0x1c83('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1c83('0x16'))['db'];function respondWithStatusCode(_0x276377,_0x3128ec){_0x3128ec=_0x3128ec||0xcc;return function(_0x20a59f){if(_0x20a59f){return _0x276377[_0x1c83('0x17')](_0x3128ec);}return _0x276377[_0x1c83('0x18')](_0x3128ec)[_0x1c83('0x19')]();};}function respondWithResult(_0x5d5742,_0x43f74e){_0x43f74e=_0x43f74e||0xc8;return function(_0x1be133){if(_0x1be133){return _0x5d5742[_0x1c83('0x18')](_0x43f74e)[_0x1c83('0x1a')](_0x1be133);}};}function respondWithFilteredResult(_0x37ba9b,_0x4e1620){return function(_0x11acf1){if(_0x11acf1){var _0x18a06d=typeof _0x4e1620[_0x1c83('0x1b')]===_0x1c83('0x1c')&&typeof _0x4e1620['limit']===_0x1c83('0x1c');var _0x4a5025=_0x11acf1['count'];var _0x3b3369=_0x18a06d?0x0:_0x4e1620[_0x1c83('0x1b')];var _0x2ec743=_0x18a06d?_0x11acf1[_0x1c83('0x1d')]:_0x4e1620['offset']+_0x4e1620[_0x1c83('0x1e')];var _0x5642aa;if(_0x2ec743>=_0x4a5025){_0x2ec743=_0x4a5025;_0x5642aa=0xc8;}else{_0x5642aa=0xce;}_0x37ba9b[_0x1c83('0x18')](_0x5642aa);return _0x37ba9b[_0x1c83('0x1f')]('Content-Range',_0x3b3369+'-'+_0x2ec743+'/'+_0x4a5025)[_0x1c83('0x1a')](_0x11acf1);}return null;};}function patchUpdates(_0x1b5a71){return function(_0x5aa566){try{jsonpatch['apply'](_0x5aa566,_0x1b5a71,!![]);}catch(_0x4cd6bb){return BPromise['reject'](_0x4cd6bb);}return _0x5aa566['save']();};}function saveUpdates(_0x19abb8,_0x3e216d){return function(_0x5daab4){if(_0x5daab4){return _0x5daab4['update'](_0x19abb8)[_0x1c83('0x20')](function(_0x3c8123){return _0x3c8123;});}return null;};}function removeEntity(_0x2d041f,_0x58a7d5){return function(_0xb21f06){if(_0xb21f06){return _0xb21f06['destroy']()[_0x1c83('0x20')](function(){var _0x2b93f7=_0xb21f06[_0x1c83('0x21')]({'plain':!![]});var _0x1096ed=_0x1c83('0x22');return db[_0x1c83('0x23')][_0x1c83('0x24')]({'where':{'type':_0x1096ed,'resourceId':_0x2b93f7['id']}})[_0x1c83('0x20')](function(){return _0xb21f06;});})[_0x1c83('0x20')](function(){_0x2d041f['status'](0xcc)[_0x1c83('0x19')]();});}};}function handleEntityNotFound(_0x5c4e3c,_0x354cdf){return function(_0x4ef78a){if(!_0x4ef78a){_0x5c4e3c[_0x1c83('0x17')](0x194);}return _0x4ef78a;};}function handleError(_0x3a00e0,_0x46ff26){_0x46ff26=_0x46ff26||0x1f4;return function(_0x341d8d){logger[_0x1c83('0x25')](_0x341d8d[_0x1c83('0x26')]);if(_0x341d8d[_0x1c83('0x27')]){delete _0x341d8d[_0x1c83('0x27')];}_0x3a00e0[_0x1c83('0x18')](_0x46ff26)['send'](_0x341d8d);};}exports[_0x1c83('0x28')]=function(_0x56cd77,_0x4af140){var _0x3e9814={},_0x23210c={},_0x39f492={'count':0x0,'rows':[]};var _0x15bc67=_[_0x1c83('0x29')](db[_0x1c83('0x2a')][_0x1c83('0x2b')],function(_0x1499db){return{'name':_0x1499db['fieldName'],'type':_0x1499db[_0x1c83('0x2c')][_0x1c83('0x2d')]};});_0x23210c[_0x1c83('0x2e')]=_[_0x1c83('0x29')](_0x15bc67,_0x1c83('0x27'));_0x23210c['query']=_[_0x1c83('0x2f')](_0x56cd77[_0x1c83('0x30')]);_0x23210c[_0x1c83('0x31')]=_['intersection'](_0x23210c[_0x1c83('0x2e')],_0x23210c[_0x1c83('0x30')]);_0x3e9814[_0x1c83('0x32')]=_[_0x1c83('0x33')](_0x23210c[_0x1c83('0x2e')],qs[_0x1c83('0x34')](_0x56cd77[_0x1c83('0x30')][_0x1c83('0x34')]));_0x3e9814[_0x1c83('0x32')]=_0x3e9814['attributes'][_0x1c83('0x35')]?_0x3e9814[_0x1c83('0x32')]:_0x23210c[_0x1c83('0x2e')];if(!_0x56cd77[_0x1c83('0x30')][_0x1c83('0x36')]('nolimit')){_0x3e9814['limit']=qs['limit'](_0x56cd77[_0x1c83('0x30')]['limit']);_0x3e9814[_0x1c83('0x1b')]=qs[_0x1c83('0x1b')](_0x56cd77[_0x1c83('0x30')][_0x1c83('0x1b')]);}_0x3e9814[_0x1c83('0x37')]=qs['sort'](_0x56cd77['query']['sort']);_0x3e9814[_0x1c83('0x38')]=qs[_0x1c83('0x31')](_[_0x1c83('0x39')](_0x56cd77[_0x1c83('0x30')],_0x23210c[_0x1c83('0x31')]),_0x15bc67);if(_0x56cd77[_0x1c83('0x30')][_0x1c83('0x3a')]){_0x3e9814['where']=_['merge'](_0x3e9814[_0x1c83('0x38')],{'$or':_[_0x1c83('0x29')](_0x15bc67,function(_0x39f836){if(_0x39f836[_0x1c83('0x2c')]!==_0x1c83('0x3b')){var _0x3b3d2f={};_0x3b3d2f[_0x39f836[_0x1c83('0x27')]]={'$like':'%'+_0x56cd77['query'][_0x1c83('0x3a')]+'%'};return _0x3b3d2f;}})});}_0x3e9814=_[_0x1c83('0x3c')]({},_0x3e9814,_0x56cd77[_0x1c83('0x3d')]);var _0x15827a={'where':_0x3e9814[_0x1c83('0x38')]};return db[_0x1c83('0x2a')][_0x1c83('0x1d')](_0x15827a)[_0x1c83('0x20')](function(_0xd9c16c){_0x39f492[_0x1c83('0x1d')]=_0xd9c16c;if(_0x56cd77[_0x1c83('0x30')][_0x1c83('0x3e')]){_0x3e9814[_0x1c83('0x3f')]=[{'all':!![]}];}return db[_0x1c83('0x2a')]['findAll'](_0x3e9814);})[_0x1c83('0x20')](function(_0x124d55){_0x39f492['rows']=_0x124d55;return _0x39f492;})[_0x1c83('0x20')](respondWithFilteredResult(_0x4af140,_0x3e9814))[_0x1c83('0x40')](handleError(_0x4af140,null));};exports[_0x1c83('0x41')]=function(_0xdd92b9,_0x3d2c2b){var _0x413f5c={'raw':![],'where':{'id':_0xdd92b9[_0x1c83('0x42')]['id']}},_0x1201eb={};_0x1201eb['model']=_[_0x1c83('0x2f')](db[_0x1c83('0x2a')][_0x1c83('0x2b')]);_0x1201eb[_0x1c83('0x30')]=_[_0x1c83('0x2f')](_0xdd92b9[_0x1c83('0x30')]);_0x1201eb[_0x1c83('0x31')]=_[_0x1c83('0x33')](_0x1201eb['model'],_0x1201eb['query']);_0x413f5c[_0x1c83('0x32')]=_[_0x1c83('0x33')](_0x1201eb[_0x1c83('0x2e')],qs[_0x1c83('0x34')](_0xdd92b9[_0x1c83('0x30')]['fields']));_0x413f5c[_0x1c83('0x32')]=_0x413f5c['attributes']['length']?_0x413f5c['attributes']:_0x1201eb[_0x1c83('0x2e')];if(_0xdd92b9['query'][_0x1c83('0x3e')]){_0x413f5c[_0x1c83('0x3f')]=[{'all':!![]}];}_0x413f5c=_[_0x1c83('0x3c')]({},_0x413f5c,_0xdd92b9[_0x1c83('0x3d')]);return db[_0x1c83('0x2a')][_0x1c83('0x43')](_0x413f5c)[_0x1c83('0x20')](handleEntityNotFound(_0x3d2c2b,null))[_0x1c83('0x20')](respondWithResult(_0x3d2c2b,null))['catch'](handleError(_0x3d2c2b,null));};exports[_0x1c83('0x44')]=function(_0x2421d3,_0x320448){return db[_0x1c83('0x2a')][_0x1c83('0x44')](_0x2421d3['body'],{})['then'](function(_0x5956da){var _0x2c6354=_0x2421d3[_0x1c83('0x45')][_0x1c83('0x21')]({'plain':!![]});if(!_0x2c6354)throw new Error(_0x1c83('0x46'));if(_0x2c6354['role']===_0x1c83('0x45')){var _0x901dc5=_0x5956da[_0x1c83('0x21')]({'plain':!![]});var _0x4c1073=_0x1c83('0x22');return db[_0x1c83('0x47')][_0x1c83('0x43')]({'where':{'name':_0x4c1073,'userProfileId':_0x2c6354[_0x1c83('0x48')]},'raw':!![]})[_0x1c83('0x20')](function(_0xca58e6){if(_0xca58e6&&_0xca58e6[_0x1c83('0x49')]===0x0){return db[_0x1c83('0x23')]['create']({'name':_0x901dc5[_0x1c83('0x27')],'resourceId':_0x901dc5['id'],'type':_0xca58e6[_0x1c83('0x27')],'sectionId':_0xca58e6['id']},{})[_0x1c83('0x20')](function(){return _0x5956da;});}else{return _0x5956da;}})['catch'](function(_0x4a40a4){logger['error'](_0x1c83('0x4a'),_0x4a40a4);throw _0x4a40a4;});}return _0x5956da;})[_0x1c83('0x20')](respondWithResult(_0x320448,0xc9))['catch'](handleError(_0x320448,null));};exports[_0x1c83('0x4b')]=function(_0x2b64cb,_0x16542c){if(_0x2b64cb[_0x1c83('0x4c')]['id']){delete _0x2b64cb[_0x1c83('0x4c')]['id'];}return db[_0x1c83('0x2a')][_0x1c83('0x43')]({'where':{'id':_0x2b64cb[_0x1c83('0x42')]['id']}})[_0x1c83('0x20')](handleEntityNotFound(_0x16542c,null))[_0x1c83('0x20')](saveUpdates(_0x2b64cb['body'],null))['then'](respondWithResult(_0x16542c,null))[_0x1c83('0x40')](handleError(_0x16542c,null));};exports['destroy']=function(_0x516326,_0x2364ad){return db[_0x1c83('0x2a')]['find']({'where':{'id':_0x516326[_0x1c83('0x42')]['id']}})[_0x1c83('0x20')](handleEntityNotFound(_0x2364ad,null))[_0x1c83('0x20')](removeEntity(_0x2364ad,null))['catch'](handleError(_0x2364ad,null));}; \ No newline at end of file +var _0xb7c8=['nolimit','order','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x495712,_0x11599f){var _0x4af719=function(_0x4bb73f){while(--_0x4bb73f){_0x495712['push'](_0x495712['shift']());}};_0x4af719(++_0x11599f);}(_0xb7c8,0x119));var _0x8b7c=function(_0x44802d,_0x4b22f1){_0x44802d=_0x44802d-0x0;var _0x6aca38=_0xb7c8[_0x44802d];return _0x6aca38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b7c('0x0'));var zipdir=require(_0x8b7c('0x1'));var jsonpatch=require(_0x8b7c('0x2'));var rp=require(_0x8b7c('0x3'));var moment=require(_0x8b7c('0x4'));var BPromise=require(_0x8b7c('0x5'));var Mustache=require(_0x8b7c('0x6'));var util=require('util');var path=require(_0x8b7c('0x7'));var sox=require(_0x8b7c('0x8'));var csv=require(_0x8b7c('0x9'));var ejs=require(_0x8b7c('0xa'));var fs=require('fs');var fs_extra=require(_0x8b7c('0xb'));var _=require(_0x8b7c('0xc'));var squel=require(_0x8b7c('0xd'));var crypto=require(_0x8b7c('0xe'));var jsforce=require(_0x8b7c('0xf'));var deskjs=require(_0x8b7c('0x10'));var toCsv=require(_0x8b7c('0x9'));var querystring=require(_0x8b7c('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b7c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8b7c('0x13'));var as=require(_0x8b7c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b7c('0x15'))(_0x8b7c('0x16'));var utils=require(_0x8b7c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b7c('0x18'))['db'];function respondWithStatusCode(_0x33c5aa,_0x297c39){_0x297c39=_0x297c39||0xcc;return function(_0x282b87){if(_0x282b87){return _0x33c5aa[_0x8b7c('0x19')](_0x297c39);}return _0x33c5aa[_0x8b7c('0x1a')](_0x297c39)[_0x8b7c('0x1b')]();};}function respondWithResult(_0x56e02b,_0x2b60a7){_0x2b60a7=_0x2b60a7||0xc8;return function(_0x19c63e){if(_0x19c63e){return _0x56e02b[_0x8b7c('0x1a')](_0x2b60a7)['json'](_0x19c63e);}};}function respondWithFilteredResult(_0xd37a82,_0x4284a2){return function(_0x496bc0){if(_0x496bc0){var _0x3b8d62=typeof _0x4284a2[_0x8b7c('0x1c')]===_0x8b7c('0x1d')&&typeof _0x4284a2[_0x8b7c('0x1e')]===_0x8b7c('0x1d');var _0x4cc809=_0x496bc0[_0x8b7c('0x1f')];var _0x3ef583=_0x3b8d62?0x0:_0x4284a2[_0x8b7c('0x1c')];var _0x2ac635=_0x3b8d62?_0x496bc0[_0x8b7c('0x1f')]:_0x4284a2['offset']+_0x4284a2[_0x8b7c('0x1e')];var _0x2b0874;if(_0x2ac635>=_0x4cc809){_0x2ac635=_0x4cc809;_0x2b0874=0xc8;}else{_0x2b0874=0xce;}_0xd37a82[_0x8b7c('0x1a')](_0x2b0874);return _0xd37a82[_0x8b7c('0x20')](_0x8b7c('0x21'),_0x3ef583+'-'+_0x2ac635+'/'+_0x4cc809)[_0x8b7c('0x22')](_0x496bc0);}return null;};}function patchUpdates(_0x3f587b){return function(_0xd0c3e6){try{jsonpatch[_0x8b7c('0x23')](_0xd0c3e6,_0x3f587b,!![]);}catch(_0xd006c4){return BPromise[_0x8b7c('0x24')](_0xd006c4);}return _0xd0c3e6[_0x8b7c('0x25')]();};}function saveUpdates(_0x53451d,_0x4222ab){return function(_0x3186cd){if(_0x3186cd){return _0x3186cd[_0x8b7c('0x26')](_0x53451d)[_0x8b7c('0x27')](function(_0x9365e3){return _0x9365e3;});}return null;};}function removeEntity(_0x389411,_0x2922a0){return function(_0x3870b4){if(_0x3870b4){return _0x3870b4[_0x8b7c('0x28')]()[_0x8b7c('0x27')](function(){var _0x5e131c=_0x3870b4['get']({'plain':!![]});var _0x2b318e='ChanSpies';return db[_0x8b7c('0x29')][_0x8b7c('0x28')]({'where':{'type':_0x2b318e,'resourceId':_0x5e131c['id']}})[_0x8b7c('0x27')](function(){return _0x3870b4;});})[_0x8b7c('0x27')](function(){_0x389411[_0x8b7c('0x1a')](0xcc)[_0x8b7c('0x1b')]();});}};}function handleEntityNotFound(_0x58dc4a,_0x39d677){return function(_0x31390d){if(!_0x31390d){_0x58dc4a[_0x8b7c('0x19')](0x194);}return _0x31390d;};}function handleError(_0x94a31e,_0x305a40){_0x305a40=_0x305a40||0x1f4;return function(_0x3c4b0c){logger[_0x8b7c('0x2a')](_0x3c4b0c[_0x8b7c('0x2b')]);if(_0x3c4b0c[_0x8b7c('0x2c')]){delete _0x3c4b0c[_0x8b7c('0x2c')];}_0x94a31e['status'](_0x305a40)['send'](_0x3c4b0c);};}exports[_0x8b7c('0x2d')]=function(_0x170fa9,_0x101649){var _0x3f5fab={},_0x3bfe78={},_0x1f373f={'count':0x0,'rows':[]};var _0xb5356=_[_0x8b7c('0x2e')](db[_0x8b7c('0x2f')][_0x8b7c('0x30')],function(_0x57406f){return{'name':_0x57406f[_0x8b7c('0x31')],'type':_0x57406f['type'][_0x8b7c('0x32')]};});_0x3bfe78[_0x8b7c('0x33')]=_['map'](_0xb5356,_0x8b7c('0x2c'));_0x3bfe78['query']=_[_0x8b7c('0x34')](_0x170fa9[_0x8b7c('0x35')]);_0x3bfe78[_0x8b7c('0x36')]=_[_0x8b7c('0x37')](_0x3bfe78[_0x8b7c('0x33')],_0x3bfe78[_0x8b7c('0x35')]);_0x3f5fab[_0x8b7c('0x38')]=_[_0x8b7c('0x37')](_0x3bfe78[_0x8b7c('0x33')],qs['fields'](_0x170fa9[_0x8b7c('0x35')][_0x8b7c('0x39')]));_0x3f5fab['attributes']=_0x3f5fab['attributes']['length']?_0x3f5fab[_0x8b7c('0x38')]:_0x3bfe78[_0x8b7c('0x33')];if(!_0x170fa9['query'][_0x8b7c('0x3a')](_0x8b7c('0x3b'))){_0x3f5fab[_0x8b7c('0x1e')]=qs[_0x8b7c('0x1e')](_0x170fa9['query'][_0x8b7c('0x1e')]);_0x3f5fab[_0x8b7c('0x1c')]=qs[_0x8b7c('0x1c')](_0x170fa9['query'][_0x8b7c('0x1c')]);}_0x3f5fab[_0x8b7c('0x3c')]=qs['sort'](_0x170fa9['query']['sort']);_0x3f5fab[_0x8b7c('0x3d')]=qs[_0x8b7c('0x36')](_[_0x8b7c('0x3e')](_0x170fa9[_0x8b7c('0x35')],_0x3bfe78[_0x8b7c('0x36')]),_0xb5356);if(_0x170fa9[_0x8b7c('0x35')]['filter']){_0x3f5fab[_0x8b7c('0x3d')]=_[_0x8b7c('0x3f')](_0x3f5fab[_0x8b7c('0x3d')],{'$or':_[_0x8b7c('0x2e')](_0xb5356,function(_0x332f32){if(_0x332f32[_0x8b7c('0x40')]!=='VIRTUAL'){var _0x2458b2={};_0x2458b2[_0x332f32[_0x8b7c('0x2c')]]={'$like':'%'+_0x170fa9[_0x8b7c('0x35')][_0x8b7c('0x41')]+'%'};return _0x2458b2;}})});}_0x3f5fab=_[_0x8b7c('0x3f')]({},_0x3f5fab,_0x170fa9[_0x8b7c('0x42')]);var _0x571658={'where':_0x3f5fab['where']};return db[_0x8b7c('0x2f')][_0x8b7c('0x1f')](_0x571658)['then'](function(_0x50908c){_0x1f373f[_0x8b7c('0x1f')]=_0x50908c;if(_0x170fa9[_0x8b7c('0x35')][_0x8b7c('0x43')]){_0x3f5fab[_0x8b7c('0x44')]=[{'all':!![]}];}return db[_0x8b7c('0x2f')][_0x8b7c('0x45')](_0x3f5fab);})[_0x8b7c('0x27')](function(_0x22d574){_0x1f373f[_0x8b7c('0x46')]=_0x22d574;return _0x1f373f;})[_0x8b7c('0x27')](respondWithFilteredResult(_0x101649,_0x3f5fab))[_0x8b7c('0x47')](handleError(_0x101649,null));};exports[_0x8b7c('0x48')]=function(_0x5aec7d,_0x40cc39){var _0x21a690={'raw':![],'where':{'id':_0x5aec7d[_0x8b7c('0x49')]['id']}},_0x1afec7={};_0x1afec7[_0x8b7c('0x33')]=_['keys'](db['VoiceChanSpy'][_0x8b7c('0x30')]);_0x1afec7[_0x8b7c('0x35')]=_[_0x8b7c('0x34')](_0x5aec7d[_0x8b7c('0x35')]);_0x1afec7[_0x8b7c('0x36')]=_[_0x8b7c('0x37')](_0x1afec7['model'],_0x1afec7['query']);_0x21a690[_0x8b7c('0x38')]=_[_0x8b7c('0x37')](_0x1afec7['model'],qs[_0x8b7c('0x39')](_0x5aec7d[_0x8b7c('0x35')][_0x8b7c('0x39')]));_0x21a690['attributes']=_0x21a690['attributes'][_0x8b7c('0x4a')]?_0x21a690['attributes']:_0x1afec7[_0x8b7c('0x33')];if(_0x5aec7d[_0x8b7c('0x35')][_0x8b7c('0x43')]){_0x21a690[_0x8b7c('0x44')]=[{'all':!![]}];}_0x21a690=_[_0x8b7c('0x3f')]({},_0x21a690,_0x5aec7d[_0x8b7c('0x42')]);return db[_0x8b7c('0x2f')]['find'](_0x21a690)[_0x8b7c('0x27')](handleEntityNotFound(_0x40cc39,null))[_0x8b7c('0x27')](respondWithResult(_0x40cc39,null))[_0x8b7c('0x47')](handleError(_0x40cc39,null));};exports[_0x8b7c('0x4b')]=function(_0x5d5758,_0x56d378){return db['VoiceChanSpy'][_0x8b7c('0x4b')](_0x5d5758[_0x8b7c('0x4c')],{})[_0x8b7c('0x27')](function(_0x56aa21){var _0x190192=_0x5d5758[_0x8b7c('0x4d')][_0x8b7c('0x4e')]({'plain':!![]});if(!_0x190192)throw new Error(_0x8b7c('0x4f'));if(_0x190192[_0x8b7c('0x50')]===_0x8b7c('0x4d')){var _0x58c25a=_0x56aa21[_0x8b7c('0x4e')]({'plain':!![]});var _0x34413b=_0x8b7c('0x51');return db['UserProfileSection'][_0x8b7c('0x52')]({'where':{'name':_0x34413b,'userProfileId':_0x190192[_0x8b7c('0x53')]},'raw':!![]})[_0x8b7c('0x27')](function(_0x2d0fee){if(_0x2d0fee&&_0x2d0fee['autoAssociation']===0x0){return db['UserProfileResource'][_0x8b7c('0x4b')]({'name':_0x58c25a[_0x8b7c('0x2c')],'resourceId':_0x58c25a['id'],'type':_0x2d0fee['name'],'sectionId':_0x2d0fee['id']},{})[_0x8b7c('0x27')](function(){return _0x56aa21;});}else{return _0x56aa21;}})[_0x8b7c('0x47')](function(_0x458b82){logger['error'](_0x8b7c('0x54'),_0x458b82);throw _0x458b82;});}return _0x56aa21;})[_0x8b7c('0x27')](respondWithResult(_0x56d378,0xc9))[_0x8b7c('0x47')](handleError(_0x56d378,null));};exports[_0x8b7c('0x26')]=function(_0x29ff93,_0x2fbd87){if(_0x29ff93['body']['id']){delete _0x29ff93['body']['id'];}return db[_0x8b7c('0x2f')][_0x8b7c('0x52')]({'where':{'id':_0x29ff93['params']['id']}})['then'](handleEntityNotFound(_0x2fbd87,null))['then'](saveUpdates(_0x29ff93[_0x8b7c('0x4c')],null))['then'](respondWithResult(_0x2fbd87,null))['catch'](handleError(_0x2fbd87,null));};exports[_0x8b7c('0x28')]=function(_0x52b4e3,_0x2746fb){return db[_0x8b7c('0x2f')][_0x8b7c('0x52')]({'where':{'id':_0x52b4e3[_0x8b7c('0x49')]['id']}})[_0x8b7c('0x27')](handleEntityNotFound(_0x2746fb,null))['then'](removeEntity(_0x2746fb,null))[_0x8b7c('0x47')](handleError(_0x2746fb,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 80d6c5d..a30ad53 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 _0xf571=['context','system','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','length','internal','concat','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','bulkCreate','VoiceExtension','destroy','util','./voiceChanSpy.attributes'];(function(_0x23d8f2,_0x3a586e){var _0x3f505d=function(_0x123f52){while(--_0x123f52){_0x23d8f2['push'](_0x23d8f2['shift']());}};_0x3f505d(++_0x3a586e);}(_0xf571,0x148));var _0x1f57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf571[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1f57('0x0'));var BPromise=require('bluebird');var attributes=require(_0x1f57('0x1'));var getUserApplications=function(_0xd64259,_0x2c5b04,_0x1495a){var _0x6e198e=0x1;var _0x3343ae=[];var _0x1006cf={'context':_0x2c5b04[_0x1f57('0x2')]||'from-sip','exten':util['format']('%s%s',_0xd64259['prefix'],_0x1495a),'type':_0x1f57('0x3'),'isApp':![],'ChanSpyId':_0xd64259['id'],'UserId':_0x2c5b04['id']};_0x3343ae[_0x1f57('0x4')](_[_0x1f57('0x5')]({'app':_0x1f57('0x6'),'appdata':util[_0x1f57('0x7')](_0x1f57('0x8'),_0x1f57('0x9')),'priority':_0x6e198e++},_0x1006cf));if(_0xd64259['record']){_0x3343ae[_0x1f57('0x4')](_['merge']({'app':_0x1f57('0xa'),'appdata':util[_0x1f57('0x7')](_0x1f57('0xb'),_0xd64259[_0x1f57('0xc')]),'priority':_0x6e198e++},_0x1006cf));}if(_0xd64259['auth']){_0x3343ae['push'](_[_0x1f57('0x5')]({'app':'Authenticate','appdata':_0xd64259[_0x1f57('0xd')],'priority':_0x6e198e++},_0x1006cf));}_0x3343ae[_0x1f57('0x4')](_[_0x1f57('0x5')]({'app':_0x1f57('0xe'),'appdata':util[_0x1f57('0x7')](_0x1f57('0xf'),_0x2c5b04[_0x1f57('0x10')],_0xd64259[_0x1f57('0x11')]?_0xd64259['options']['join'](''):''),'priority':_0x6e198e++},_0x1006cf));if(_0xd64259['record']){_0x3343ae[_0x1f57('0x4')](_[_0x1f57('0x5')]({'app':'StopMixMonitor','priority':_0x6e198e++},_0x1006cf));}return _0x3343ae;};var getChanSpyApplications=function(_0x521057,_0x158bcc){var _0x5b7ca4=[];for(var _0x3bc8c8=0x0,_0x43622d=0x1;_0x3bc8c8<_0x158bcc[_0x1f57('0x12')];_0x3bc8c8++,_0x43622d=0x1){_0x5b7ca4=_0x5b7ca4['concat'](getUserApplications(_0x521057,_0x158bcc[_0x3bc8c8],_0x158bcc[_0x3bc8c8][_0x1f57('0x13')]));if(_0x158bcc[_0x3bc8c8][_0x1f57('0x13')]!=_0x158bcc[_0x3bc8c8][_0x1f57('0x10')]){_0x5b7ca4=_0x5b7ca4[_0x1f57('0x14')](getUserApplications(_0x521057,_0x158bcc[_0x3bc8c8],_0x158bcc[_0x3bc8c8]['name']));}}return _0x5b7ca4;};var getChanSpyPromise=function(_0x15c031,_0x4dcf13){return new BPromise(function(_0x389ebc,_0x4417b5){return _0x15c031[_0x1f57('0x15')][_0x1f57('0x16')]({'attributes':['id',_0x1f57('0x10'),_0x1f57('0x13')],'where':{'role':_0x1f57('0x17'),'chanspy':!![]},'raw':!![]})[_0x1f57('0x18')](function(_0x997482){if(_0x997482){return _0x389ebc(getChanSpyApplications(_0x4dcf13,_0x997482));}return _0x389ebc([]);})[_0x1f57('0x19')](function(_0x5d5900){_0x4417b5(_0x5d5900);});});};module[_0x1f57('0x1a')]=function(_0x97543b,_0x3fd1d5){var _0x1bd1c3=_0x97543b[_0x1f57('0x1b')];return _0x97543b[_0x1f57('0x1c')](_0x1f57('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x28c9b6,_0x4ee6d2,_0x3d9e34){return getChanSpyPromise(_0x1bd1c3,_0x28c9b6)[_0x1f57('0x18')](function(_0x249f94){if(_0x249f94&&_0x249f94[_0x1f57('0x12')]){return _0x1bd1c3['VoiceExtension'][_0x1f57('0x1e')](_0x249f94);}})[_0x1f57('0x18')](function(){_0x3d9e34();})[_0x1f57('0x19')](function(_0x5dba60){_0x3d9e34(_0x5dba60);});},'afterUpdate':function(_0x12a2f0,_0x58ad52,_0x3decbe){return _0x1bd1c3[_0x1f57('0x1f')][_0x1f57('0x20')]({'where':{'ChanSpyId':_0x12a2f0['id']}})[_0x1f57('0x18')](function(){return getChanSpyPromise(_0x1bd1c3,_0x12a2f0);})[_0x1f57('0x18')](function(_0x53fb18){if(_0x53fb18&&_0x53fb18[_0x1f57('0x12')]){return _0x1bd1c3[_0x1f57('0x1f')][_0x1f57('0x1e')](_0x53fb18);}})[_0x1f57('0x18')](function(){_0x3decbe();})[_0x1f57('0x19')](function(_0x1f9edc){_0x3decbe(_0x1f9edc);});},'afterDestroy':function(_0xc94c63,_0x21216a,_0x32ef29){return _0x1bd1c3[_0x1f57('0x1f')]['destroy']({'where':{'ChanSpyId':_0xc94c63['id']}})[_0x1f57('0x18')](function(){_0x32ef29();})[_0x1f57('0x19')](function(_0x53c0fb){_0x32ef29(_0x53c0fb);});}}});}; \ No newline at end of file +var _0x8e0f=['SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','push','Set','format','CDR(type)=%s','record','merge','MixMonitor','recordingFormat','Authenticate','password','ChanSpy'];(function(_0xc17d60,_0x4d3616){var _0x462396=function(_0x23d12e){while(--_0x23d12e){_0xc17d60['push'](_0xc17d60['shift']());}};_0x462396(++_0x4d3616);}(_0x8e0f,0x1c1));var _0xf8e0=function(_0x5a440a,_0x20e6de){_0x5a440a=_0x5a440a-0x0;var _0x4fd70a=_0x8e0f[_0x5a440a];return _0x4fd70a;};'use strict';var _=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var BPromise=require(_0xf8e0('0x2'));var attributes=require(_0xf8e0('0x3'));var getUserApplications=function(_0x2cc190,_0x5b12c8,_0x1813f1){var _0x53a929=0x1;var _0x446cbf=[];var _0x22d635={'context':_0x5b12c8[_0xf8e0('0x4')]||_0xf8e0('0x5'),'exten':util['format'](_0xf8e0('0x6'),_0x2cc190[_0xf8e0('0x7')],_0x1813f1),'type':'system','isApp':![],'ChanSpyId':_0x2cc190['id'],'UserId':_0x5b12c8['id']};_0x446cbf[_0xf8e0('0x8')](_['merge']({'app':_0xf8e0('0x9'),'appdata':util[_0xf8e0('0xa')](_0xf8e0('0xb'),'chanspy'),'priority':_0x53a929++},_0x22d635));if(_0x2cc190[_0xf8e0('0xc')]){_0x446cbf[_0xf8e0('0x8')](_[_0xf8e0('0xd')]({'app':_0xf8e0('0xe'),'appdata':util[_0xf8e0('0xa')]('${UNIQUEID}.%s,a',_0x2cc190[_0xf8e0('0xf')]),'priority':_0x53a929++},_0x22d635));}if(_0x2cc190['auth']){_0x446cbf['push'](_[_0xf8e0('0xd')]({'app':_0xf8e0('0x10'),'appdata':_0x2cc190[_0xf8e0('0x11')],'priority':_0x53a929++},_0x22d635));}_0x446cbf['push'](_[_0xf8e0('0xd')]({'app':_0xf8e0('0x12'),'appdata':util[_0xf8e0('0xa')](_0xf8e0('0x13'),_0x5b12c8[_0xf8e0('0x14')],_0x2cc190[_0xf8e0('0x15')]?_0x2cc190[_0xf8e0('0x15')][_0xf8e0('0x16')](''):''),'priority':_0x53a929++},_0x22d635));if(_0x2cc190[_0xf8e0('0xc')]){_0x446cbf[_0xf8e0('0x8')](_['merge']({'app':_0xf8e0('0x17'),'priority':_0x53a929++},_0x22d635));}return _0x446cbf;};var getChanSpyApplications=function(_0xb6fba6,_0xcfd6bd){var _0x3b2d01=[];for(var _0x394750=0x0,_0x14494f=0x1;_0x394750<_0xcfd6bd[_0xf8e0('0x18')];_0x394750++,_0x14494f=0x1){_0x3b2d01=_0x3b2d01[_0xf8e0('0x19')](getUserApplications(_0xb6fba6,_0xcfd6bd[_0x394750],_0xcfd6bd[_0x394750][_0xf8e0('0x1a')]));if(_0xcfd6bd[_0x394750]['internal']!=_0xcfd6bd[_0x394750]['name']){_0x3b2d01=_0x3b2d01[_0xf8e0('0x19')](getUserApplications(_0xb6fba6,_0xcfd6bd[_0x394750],_0xcfd6bd[_0x394750][_0xf8e0('0x14')]));}}return _0x3b2d01;};var getChanSpyPromise=function(_0x371ac2,_0x49957e){return new BPromise(function(_0x506b82,_0x3c2865){return _0x371ac2[_0xf8e0('0x1b')][_0xf8e0('0x1c')]({'attributes':['id',_0xf8e0('0x14'),_0xf8e0('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xf8e0('0x1d')](function(_0x3d2e40){if(_0x3d2e40){return _0x506b82(getChanSpyApplications(_0x49957e,_0x3d2e40));}return _0x506b82([]);})['catch'](function(_0xdb630){_0x3c2865(_0xdb630);});});};module[_0xf8e0('0x1e')]=function(_0x4c77ad,_0x52a757){var _0x536231=_0x4c77ad[_0xf8e0('0x1f')];return _0x4c77ad[_0xf8e0('0x20')](_0xf8e0('0x21'),attributes,{'tableName':_0xf8e0('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2298fd,_0x4fda2b,_0x3978f2){return getChanSpyPromise(_0x536231,_0x2298fd)[_0xf8e0('0x1d')](function(_0x2b2799){if(_0x2b2799&&_0x2b2799[_0xf8e0('0x18')]){return _0x536231[_0xf8e0('0x23')][_0xf8e0('0x24')](_0x2b2799);}})[_0xf8e0('0x1d')](function(){_0x3978f2();})[_0xf8e0('0x25')](function(_0x1aebd1){_0x3978f2(_0x1aebd1);});},'afterUpdate':function(_0x543a6e,_0x8b1739,_0x371430){return _0x536231[_0xf8e0('0x23')][_0xf8e0('0x26')]({'where':{'ChanSpyId':_0x543a6e['id']}})[_0xf8e0('0x1d')](function(){return getChanSpyPromise(_0x536231,_0x543a6e);})[_0xf8e0('0x1d')](function(_0x442cd5){if(_0x442cd5&&_0x442cd5[_0xf8e0('0x18')]){return _0x536231['VoiceExtension'][_0xf8e0('0x24')](_0x442cd5);}})['then'](function(){_0x371430();})[_0xf8e0('0x25')](function(_0x55a432){_0x371430(_0x55a432);});},'afterDestroy':function(_0xd0d561,_0x328f74,_0x3d17b0){return _0x536231[_0xf8e0('0x23')][_0xf8e0('0x26')]({'where':{'ChanSpyId':_0xd0d561['id']}})[_0xf8e0('0x1d')](function(){_0x3d17b0();})[_0xf8e0('0x25')](function(_0x3ea699){_0x3d17b0(_0x3ea699);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ebd938a..a1489b4 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 _0x6b20=['request','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2a6756,_0x131ca2){var _0x3bc520=function(_0x12266f){while(--_0x12266f){_0x2a6756['push'](_0x2a6756['shift']());}};_0x3bc520(++_0x131ca2);}(_0x6b20,0xd1));var _0x06b2=function(_0x32aceb,_0x5156a6){_0x32aceb=_0x32aceb-0x0;var _0x11affc=_0x6b20[_0x32aceb];return _0x11affc;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});} \ No newline at end of file +var _0xad8a=['../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x580913,_0x25e5b4){var _0x379584=function(_0x370f64){while(--_0x370f64){_0x580913['push'](_0x580913['shift']());}};_0x379584(++_0x25e5b4);}(_0xad8a,0xb0));var _0xaad8=function(_0x13273a,_0x3ebcb8){_0x13273a=_0x13273a-0x0;var _0x358867=_0xad8a[_0x13273a];return _0x358867;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var moment=require(_0xaad8('0x2'));var BPromise=require(_0xaad8('0x3'));var rs=require(_0xaad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad8('0x5'))['db'];var utils=require(_0xaad8('0x6'));var logger=require(_0xaad8('0x7'))('rpc');var config=require(_0xaad8('0x8'));var jayson=require(_0xaad8('0x9'));var client=jayson[_0xaad8('0xa')][_0xaad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x95aef9,_0x39c599,_0x28f3a1){return new BPromise(function(_0xf3a6c7,_0x11408a){return client[_0xaad8('0xc')](_0x95aef9,_0x28f3a1)['then'](function(_0x52477f){logger[_0xaad8('0xd')](_0xaad8('0xe'),_0x39c599,_0xaad8('0xf'));logger[_0xaad8('0x10')](_0xaad8('0x11'),_0x39c599,_0xaad8('0xf'),JSON[_0xaad8('0x12')](_0x52477f));if(_0x52477f[_0xaad8('0x13')]){if(_0x52477f[_0xaad8('0x13')]['code']===0x1f4){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0x11408a(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0xf3a6c7(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}else{logger[_0xaad8('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x39c599,_0xaad8('0xf'));_0xf3a6c7(_0x52477f[_0xaad8('0x15')]['message']);}})[_0xaad8('0x16')](function(_0x2a8e12){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x2a8e12);_0x11408a(_0x2a8e12);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index c018e03..35d7fc6 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 _0x01dc=['./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x50ef4b,_0x46d84d){var _0x1ac700=function(_0x341f88){while(--_0x341f88){_0x50ef4b['push'](_0x50ef4b['shift']());}};_0x1ac700(++_0x46d84d);}(_0x01dc,0xad));var _0xc01d=function(_0x5bd37a,_0x411554){_0x5bd37a=_0x5bd37a-0x0;var _0x39cd74=_0x01dc[_0x5bd37a];return _0x39cd74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc01d('0x0'));var timeout=require(_0xc01d('0x1'));var express=require(_0xc01d('0x2'));var router=express[_0xc01d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc01d('0x4'));var interaction=require(_0xc01d('0x5'));var config=require(_0xc01d('0x6'));var controller=require(_0xc01d('0x7'));router[_0xc01d('0x8')]('/',auth['isAuthenticated'](),controller[_0xc01d('0x9')]);router[_0xc01d('0x8')](_0xc01d('0xa'),auth[_0xc01d('0xb')](),controller[_0xc01d('0xc')]);router[_0xc01d('0xd')]('/',auth[_0xc01d('0xb')](),controller[_0xc01d('0xe')]);router[_0xc01d('0xf')](_0xc01d('0xa'),auth['isAuthenticated'](),controller[_0xc01d('0x10')]);router[_0xc01d('0x11')]('/:id',auth[_0xc01d('0xb')](),controller[_0xc01d('0x12')]);module[_0xc01d('0x13')]=router; \ No newline at end of file +var _0x6dfb=['./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a1699,_0x65388d){var _0x1f8ac9=function(_0x267b83){while(--_0x267b83){_0x1a1699['push'](_0x1a1699['shift']());}};_0x1f8ac9(++_0x65388d);}(_0x6dfb,0xb3));var _0xb6df=function(_0x31bfdf,_0x2297b8){_0x31bfdf=_0x31bfdf-0x0;var _0x549325=_0x6dfb[_0x31bfdf];return _0x549325;};'use strict';var multer=require(_0xb6df('0x0'));var util=require(_0xb6df('0x1'));var path=require(_0xb6df('0x2'));var timeout=require(_0xb6df('0x3'));var express=require(_0xb6df('0x4'));var router=express[_0xb6df('0x5')]();var fs_extra=require(_0xb6df('0x6'));var auth=require(_0xb6df('0x7'));var interaction=require(_0xb6df('0x8'));var config=require(_0xb6df('0x9'));var controller=require(_0xb6df('0xa'));router[_0xb6df('0xb')]('/',auth['isAuthenticated'](),controller[_0xb6df('0xc')]);router[_0xb6df('0xb')]('/:id',auth[_0xb6df('0xd')](),controller[_0xb6df('0xe')]);router[_0xb6df('0xf')]('/',auth['isAuthenticated'](),controller[_0xb6df('0x10')]);router[_0xb6df('0x11')]('/:id',auth[_0xb6df('0xd')](),controller[_0xb6df('0x12')]);router[_0xb6df('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb6df('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 3eb7491..22c4b50 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 _0x02f9=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x02f9,0x14d));var _0x902f=function(_0x47e554,_0x4d1dda){_0x47e554=_0x47e554-0x0;var _0x4190db=_0x02f9[_0x47e554];return _0x4190db;};'use strict';var Sequelize=require(_0x902f('0x0'));module[_0x902f('0x1')]={'name':{'type':Sequelize[_0x902f('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x902f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfde9=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x582872,_0x3d2dbd){var _0x59f1d6=function(_0x3745e9){while(--_0x3745e9){_0x582872['push'](_0x582872['shift']());}};_0x59f1d6(++_0x3d2dbd);}(_0xfde9,0x1d4));var _0x9fde=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xfde9[_0xdaab62];return _0x13d767;};'use strict';var Sequelize=require(_0x9fde('0x0'));module[_0x9fde('0x1')]={'name':{'type':Sequelize[_0x9fde('0x2')],'unique':_0x9fde('0x3')},'description':{'type':Sequelize[_0x9fde('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9fde('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 97e3c71..788a036 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 _0x7ecc=['keys','merge','find','create','body','findAll','root','utf8','render','writeFileSync','Reload','chan_sip.so','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','join','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','options','count','includeAll','VoiceContext','rows','show'];(function(_0x263949,_0x416ee7){var _0x587fae=function(_0x2edaaf){while(--_0x2edaaf){_0x263949['push'](_0x263949['shift']());}};_0x587fae(++_0x416ee7);}(_0x7ecc,0x1ae));var _0xc7ec=function(_0x5b2e2a,_0x486a67){_0x5b2e2a=_0x5b2e2a-0x0;var _0xa71707=_0x7ecc[_0x5b2e2a];return _0xa71707;};'use strict';var emlformat=require(_0xc7ec('0x0'));var rimraf=require(_0xc7ec('0x1'));var zipdir=require(_0xc7ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7ec('0x3'));var moment=require(_0xc7ec('0x4'));var BPromise=require(_0xc7ec('0x5'));var Mustache=require(_0xc7ec('0x6'));var util=require(_0xc7ec('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc7ec('0x8'));var ejs=require(_0xc7ec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7ec('0xa'));var squel=require('squel');var crypto=require(_0xc7ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc7ec('0xc'));var toCsv=require(_0xc7ec('0x8'));var querystring=require(_0xc7ec('0xd'));var Papa=require(_0xc7ec('0xe'));var Redis=require(_0xc7ec('0xf'));var authService=require(_0xc7ec('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc7ec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7ec('0x12'))(_0xc7ec('0x13'));var utils=require('../../config/utils');var config=require(_0xc7ec('0x14'));var licenseUtil=require(_0xc7ec('0x15'));var db=require(_0xc7ec('0x16'))['db'];var jayson=require(_0xc7ec('0x17'));var client=jayson[_0xc7ec('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18366a,_0x2a402b,_0x37a434,_0x149da4){return new BPromise(function(_0x17ff21,_0x819f24){var _0x3dae43=_0x149da4||client;return _0x3dae43[_0xc7ec('0x19')](_0x18366a,_0x37a434)[_0xc7ec('0x1a')](function(_0x45a3c6){logger[_0xc7ec('0x1b')](_0xc7ec('0x1c'),_0x2a402b,'request\x20sent');logger['debug'](_0xc7ec('0x1d'),_0x2a402b,_0xc7ec('0x1e'),JSON[_0xc7ec('0x1f')](_0x45a3c6));if(_0x45a3c6[_0xc7ec('0x20')]){if(_0x45a3c6[_0xc7ec('0x20')][_0xc7ec('0x21')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a402b,_0x45a3c6[_0xc7ec('0x20')]['message']);return _0x819f24(_0x45a3c6[_0xc7ec('0x20')][_0xc7ec('0x22')]);}logger[_0xc7ec('0x20')](_0xc7ec('0x1c'),_0x2a402b,_0x45a3c6[_0xc7ec('0x20')][_0xc7ec('0x22')]);return _0x17ff21(_0x45a3c6[_0xc7ec('0x20')][_0xc7ec('0x22')]);}else{logger[_0xc7ec('0x1b')](_0xc7ec('0x1c'),_0x2a402b,_0xc7ec('0x1e'));_0x17ff21(_0x45a3c6[_0xc7ec('0x23')][_0xc7ec('0x22')]);}})[_0xc7ec('0x24')](function(_0x9f9148){logger[_0xc7ec('0x20')](_0xc7ec('0x1c'),_0x2a402b,_0x9f9148);_0x819f24(_0x9f9148);});});}function respondWithStatusCode(_0x149bab,_0x54f646){_0x54f646=_0x54f646||0xcc;return function(_0xec566e){if(_0xec566e){return _0x149bab['sendStatus'](_0x54f646);}return _0x149bab[_0xc7ec('0x25')](_0x54f646)[_0xc7ec('0x26')]();};}function respondWithResult(_0x3203b5,_0x5a1952){_0x5a1952=_0x5a1952||0xc8;return function(_0x4cb4ef){if(_0x4cb4ef){return _0x3203b5[_0xc7ec('0x25')](_0x5a1952)[_0xc7ec('0x27')](_0x4cb4ef);}};}function respondWithFilteredResult(_0x12bd69,_0x16fdb4){return function(_0x588e0b){if(_0x588e0b){var _0xdd66e0=typeof _0x16fdb4['offset']===_0xc7ec('0x28')&&typeof _0x16fdb4[_0xc7ec('0x29')]==='undefined';var _0x26f7cd=_0x588e0b['count'];var _0x13ddf5=_0xdd66e0?0x0:_0x16fdb4['offset'];var _0xfc99b5=_0xdd66e0?_0x588e0b['count']:_0x16fdb4[_0xc7ec('0x2a')]+_0x16fdb4[_0xc7ec('0x29')];var _0x2333a8;if(_0xfc99b5>=_0x26f7cd){_0xfc99b5=_0x26f7cd;_0x2333a8=0xc8;}else{_0x2333a8=0xce;}_0x12bd69[_0xc7ec('0x25')](_0x2333a8);return _0x12bd69[_0xc7ec('0x2b')](_0xc7ec('0x2c'),_0x13ddf5+'-'+_0xfc99b5+'/'+_0x26f7cd)[_0xc7ec('0x27')](_0x588e0b);}return null;};}function patchUpdates(_0x5d565b){return function(_0xc6e9cb){try{jsonpatch[_0xc7ec('0x2d')](_0xc6e9cb,_0x5d565b,!![]);}catch(_0x9d48d8){return BPromise[_0xc7ec('0x2e')](_0x9d48d8);}return _0xc6e9cb[_0xc7ec('0x2f')]();};}function saveUpdates(_0x2b8383,_0x68329){return function(_0x2c3fff){if(_0x2c3fff){return _0x2c3fff[_0xc7ec('0x30')](_0x2b8383)[_0xc7ec('0x1a')](function(_0x2f6629){return _0x2f6629;});}return null;};}function removeEntity(_0xc2168c,_0x303dfd){return function(_0x447f68){if(_0x447f68){return _0x447f68['destroy']()[_0xc7ec('0x1a')](function(){var _0x2b3473=_0x447f68[_0xc7ec('0x31')]({'plain':!![]});var _0x15f730=_0xc7ec('0x32');return db[_0xc7ec('0x33')][_0xc7ec('0x34')]({'where':{'type':_0x15f730,'resourceId':_0x2b3473['id']}})[_0xc7ec('0x1a')](function(){return _0x447f68;});})[_0xc7ec('0x1a')](function(){_0xc2168c[_0xc7ec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x580e2f,_0x19e3c1){return function(_0x553abe){if(!_0x553abe){_0x580e2f[_0xc7ec('0x35')](0x194);}return _0x553abe;};}function handleError(_0x5f36fe,_0x3baf36){_0x3baf36=_0x3baf36||0x1f4;return function(_0x6b4cf8){logger[_0xc7ec('0x20')](_0x6b4cf8['stack']);if(_0x6b4cf8[_0xc7ec('0x36')]){delete _0x6b4cf8[_0xc7ec('0x36')];}_0x5f36fe[_0xc7ec('0x25')](_0x3baf36)[_0xc7ec('0x37')](_0x6b4cf8);};}exports[_0xc7ec('0x38')]=function(_0x4651ea,_0x1799ec){var _0x4b8576={},_0x148aab={},_0x2e0505={'count':0x0,'rows':[]};var _0x398c97=_[_0xc7ec('0x39')](db['VoiceContext'][_0xc7ec('0x3a')],function(_0x41371e){return{'name':_0x41371e[_0xc7ec('0x3b')],'type':_0x41371e[_0xc7ec('0x3c')][_0xc7ec('0x3d')]};});_0x148aab[_0xc7ec('0x3e')]=_[_0xc7ec('0x39')](_0x398c97,_0xc7ec('0x36'));_0x148aab[_0xc7ec('0x3f')]=_['keys'](_0x4651ea['query']);_0x148aab[_0xc7ec('0x40')]=_[_0xc7ec('0x41')](_0x148aab[_0xc7ec('0x3e')],_0x148aab[_0xc7ec('0x3f')]);_0x4b8576[_0xc7ec('0x42')]=_['intersection'](_0x148aab[_0xc7ec('0x3e')],qs[_0xc7ec('0x43')](_0x4651ea[_0xc7ec('0x3f')][_0xc7ec('0x43')]));_0x4b8576[_0xc7ec('0x42')]=_0x4b8576[_0xc7ec('0x42')][_0xc7ec('0x44')]?_0x4b8576[_0xc7ec('0x42')]:_0x148aab[_0xc7ec('0x3e')];if(!_0x4651ea[_0xc7ec('0x3f')]['hasOwnProperty'](_0xc7ec('0x45'))){_0x4b8576['limit']=qs[_0xc7ec('0x29')](_0x4651ea['query'][_0xc7ec('0x29')]);_0x4b8576['offset']=qs[_0xc7ec('0x2a')](_0x4651ea[_0xc7ec('0x3f')]['offset']);}_0x4b8576['order']=qs[_0xc7ec('0x46')](_0x4651ea['query'][_0xc7ec('0x46')]);_0x4b8576['where']=qs[_0xc7ec('0x40')](_[_0xc7ec('0x47')](_0x4651ea[_0xc7ec('0x3f')],_0x148aab[_0xc7ec('0x40')]),_0x398c97);if(_0x4651ea[_0xc7ec('0x3f')][_0xc7ec('0x48')]){_0x4b8576[_0xc7ec('0x49')]=_['merge'](_0x4b8576[_0xc7ec('0x49')],{'$or':_['map'](_0x398c97,function(_0x1b2cea){if(_0x1b2cea['type']!=='VIRTUAL'){var _0x53d879={};_0x53d879[_0x1b2cea['name']]={'$like':'%'+_0x4651ea[_0xc7ec('0x3f')][_0xc7ec('0x48')]+'%'};return _0x53d879;}})});}_0x4b8576=_['merge']({},_0x4b8576,_0x4651ea[_0xc7ec('0x4a')]);var _0x4ff646={'where':_0x4b8576[_0xc7ec('0x49')]};return db['VoiceContext'][_0xc7ec('0x4b')](_0x4ff646)['then'](function(_0x55164b){_0x2e0505[_0xc7ec('0x4b')]=_0x55164b;if(_0x4651ea[_0xc7ec('0x3f')][_0xc7ec('0x4c')]){_0x4b8576['include']=[{'all':!![]}];}return db[_0xc7ec('0x4d')]['findAll'](_0x4b8576);})['then'](function(_0x3f4888){_0x2e0505[_0xc7ec('0x4e')]=_0x3f4888;return _0x2e0505;})[_0xc7ec('0x1a')](respondWithFilteredResult(_0x1799ec,_0x4b8576))['catch'](handleError(_0x1799ec,null));};exports[_0xc7ec('0x4f')]=function(_0x4b5069,_0x3c80ce){var _0x4a07f8={'raw':![],'where':{'id':_0x4b5069['params']['id']}},_0x4ffcfc={};_0x4ffcfc[_0xc7ec('0x3e')]=_[_0xc7ec('0x50')](db[_0xc7ec('0x4d')]['rawAttributes']);_0x4ffcfc[_0xc7ec('0x3f')]=_[_0xc7ec('0x50')](_0x4b5069[_0xc7ec('0x3f')]);_0x4ffcfc['filters']=_['intersection'](_0x4ffcfc[_0xc7ec('0x3e')],_0x4ffcfc[_0xc7ec('0x3f')]);_0x4a07f8[_0xc7ec('0x42')]=_[_0xc7ec('0x41')](_0x4ffcfc['model'],qs[_0xc7ec('0x43')](_0x4b5069['query']['fields']));_0x4a07f8[_0xc7ec('0x42')]=_0x4a07f8[_0xc7ec('0x42')]['length']?_0x4a07f8[_0xc7ec('0x42')]:_0x4ffcfc[_0xc7ec('0x3e')];if(_0x4b5069['query'][_0xc7ec('0x4c')]){_0x4a07f8['include']=[{'all':!![]}];}_0x4a07f8=_[_0xc7ec('0x51')]({},_0x4a07f8,_0x4b5069[_0xc7ec('0x4a')]);return db[_0xc7ec('0x4d')][_0xc7ec('0x52')](_0x4a07f8)[_0xc7ec('0x1a')](handleEntityNotFound(_0x3c80ce,null))[_0xc7ec('0x1a')](respondWithResult(_0x3c80ce,null))[_0xc7ec('0x24')](handleError(_0x3c80ce,null));};exports[_0xc7ec('0x53')]=function(_0x59b1dd,_0x262561,_0x3adbb2){var _0x23ca24;return db[_0xc7ec('0x4d')]['create'](_0x59b1dd[_0xc7ec('0x54')],{'raw':!![]})['then'](function(_0x4f3212){_0x23ca24=_0x4f3212;return db['VoiceContext'][_0xc7ec('0x55')]({'raw':!![]});})['then'](function(_0x2186aa){var _0x4fce11=fs['readFileSync'](path['join'](config[_0xc7ec('0x56')],'server/files/templates/context.ejs'),_0xc7ec('0x57'));var _0x454607=ejs[_0xc7ec('0x58')](_0x4fce11,{'contexts':_0x2186aa||[]});fs[_0xc7ec('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x454607);})['then'](function(){return respondWithRpcPromise(_0xc7ec('0x5a'),_0xc7ec('0x53'),{'module':_0xc7ec('0x5b')});})['then'](function(){var _0x2b3f09=_0x59b1dd[_0xc7ec('0x5c')][_0xc7ec('0x31')]({'plain':!![]});if(!_0x2b3f09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b3f09[_0xc7ec('0x5d')]===_0xc7ec('0x5c')){var _0x52fc84=_0x23ca24['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc7ec('0x32'),'userProfileId':_0x2b3f09[_0xc7ec('0x5e')]},'raw':!![]})[_0xc7ec('0x1a')](function(_0x1b5504){if(_0x1b5504&&_0x1b5504[_0xc7ec('0x5f')]===0x0){return db[_0xc7ec('0x33')][_0xc7ec('0x53')]({'name':_0x52fc84['name'],'resourceId':_0x52fc84['id'],'type':_0x1b5504['name'],'sectionId':_0x1b5504['id']},{})[_0xc7ec('0x1a')](function(){return _0x23ca24;});}else{return _0x23ca24;}})[_0xc7ec('0x24')](function(_0x3255c5){logger[_0xc7ec('0x20')](_0xc7ec('0x60'),_0x3255c5);throw _0x3255c5;});}return _0x23ca24;})[_0xc7ec('0x1a')](respondWithResult(_0x262561,0xc9))['catch'](handleError(_0x262561,null));};exports[_0xc7ec('0x30')]=function(_0x4b73cd,_0xb538b2,_0x25ea7f){var _0x2647f6;return db[_0xc7ec('0x4d')][_0xc7ec('0x52')]({'where':{'id':_0x4b73cd[_0xc7ec('0x61')]['id']}})[_0xc7ec('0x1a')](handleEntityNotFound(_0xb538b2,null))[_0xc7ec('0x1a')](saveUpdates(_0x4b73cd['body'],null))[_0xc7ec('0x1a')](function(_0x564faf){if(_0x564faf){_0x2647f6=_0x564faf;return db[_0xc7ec('0x4d')][_0xc7ec('0x55')]({'raw':!![]});}})[_0xc7ec('0x1a')](function(_0x4f47c8){var _0x273678=fs[_0xc7ec('0x62')](path[_0xc7ec('0x63')](config['root'],_0xc7ec('0x64')),_0xc7ec('0x57'));var _0x4477ef=ejs[_0xc7ec('0x58')](_0x273678,{'contexts':_0x4f47c8||[]});fs[_0xc7ec('0x59')](_0xc7ec('0x65'),_0x4477ef);})[_0xc7ec('0x1a')](function(){return respondWithRpcPromise(_0xc7ec('0x5a'),_0xc7ec('0x30'),{'module':_0xc7ec('0x5b')});})[_0xc7ec('0x1a')](function(){return _0x2647f6;})['then'](respondWithResult(_0xb538b2,null))[_0xc7ec('0x24')](handleError(_0xb538b2,null));};exports[_0xc7ec('0x34')]=function(_0x5e34eb,_0x2c8350,_0x2b307a){var _0x3f1e71;return db[_0xc7ec('0x4d')][_0xc7ec('0x52')]({'where':{'id':_0x5e34eb[_0xc7ec('0x61')]['id']}})[_0xc7ec('0x1a')](handleEntityNotFound(_0x2c8350,null))['then'](removeEntity(_0x2c8350,null))['then'](function(){return db[_0xc7ec('0x4d')][_0xc7ec('0x55')]({'raw':!![]});})[_0xc7ec('0x1a')](function(_0x13d69e){var _0x1e782c=fs[_0xc7ec('0x62')](path[_0xc7ec('0x63')](config[_0xc7ec('0x56')],_0xc7ec('0x64')),_0xc7ec('0x57'));var _0x2b5a25=ejs['render'](_0x1e782c,{'contexts':_0x13d69e});fs['writeFileSync'](_0xc7ec('0x65'),_0x2b5a25);return respondWithRpcPromise(_0xc7ec('0x5a'),'destroy',{'module':'chan_sip.so'});})[_0xc7ec('0x24')](handleError(_0x2c8350,null));}; \ No newline at end of file +var _0x5da4=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceContext','findAll','rows','show','params','rawAttributes','length','include','create','body','readFileSync','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','root','render','writeFileSync','join','rimraf','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','get','Contexts','UserProfileResource','destroy','end','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x5da4,0xf1));var _0x45da=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5da4[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x45da('0x1'));var moment=require(_0x45da('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x45da('0x3'));var path=require('path');var sox=require(_0x45da('0x4'));var csv=require(_0x45da('0x5'));var ejs=require(_0x45da('0x6'));var fs=require('fs');var fs_extra=require(_0x45da('0x7'));var _=require('lodash');var squel=require(_0x45da('0x8'));var crypto=require(_0x45da('0x9'));var jsforce=require(_0x45da('0xa'));var deskjs=require(_0x45da('0xb'));var toCsv=require('to-csv');var querystring=require(_0x45da('0xc'));var Papa=require(_0x45da('0xd'));var Redis=require('ioredis');var authService=require(_0x45da('0xe'));var qs=require(_0x45da('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45da('0x10'));var logger=require(_0x45da('0x11'))(_0x45da('0x12'));var utils=require(_0x45da('0x13'));var config=require(_0x45da('0x14'));var licenseUtil=require(_0x45da('0x15'));var db=require(_0x45da('0x16'))['db'];var jayson=require(_0x45da('0x17'));var client=jayson[_0x45da('0x18')][_0x45da('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x12220d,_0x3a8c6c,_0x2028e3,_0x2cddcd){return new BPromise(function(_0x56ab9c,_0x3acb5a){var _0x5157ff=_0x2cddcd||client;return _0x5157ff['request'](_0x12220d,_0x2028e3)[_0x45da('0x1a')](function(_0x1fb274){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3a8c6c,'request\x20sent');logger[_0x45da('0x1b')](_0x45da('0x1c'),_0x3a8c6c,_0x45da('0x1d'),JSON[_0x45da('0x1e')](_0x1fb274));if(_0x1fb274[_0x45da('0x1f')]){if(_0x1fb274[_0x45da('0x1f')][_0x45da('0x20')]===0x1f4){logger[_0x45da('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x3a8c6c,_0x1fb274[_0x45da('0x1f')]['message']);return _0x3acb5a(_0x1fb274[_0x45da('0x1f')][_0x45da('0x21')]);}logger['error'](_0x45da('0x22'),_0x3a8c6c,_0x1fb274[_0x45da('0x1f')][_0x45da('0x21')]);return _0x56ab9c(_0x1fb274[_0x45da('0x1f')][_0x45da('0x21')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x3a8c6c,_0x45da('0x1d'));_0x56ab9c(_0x1fb274[_0x45da('0x23')]['message']);}})[_0x45da('0x24')](function(_0x15b680){logger[_0x45da('0x1f')](_0x45da('0x22'),_0x3a8c6c,_0x15b680);_0x3acb5a(_0x15b680);});});}function respondWithStatusCode(_0x4c049d,_0x58df9e){_0x58df9e=_0x58df9e||0xcc;return function(_0x36f3ee){if(_0x36f3ee){return _0x4c049d[_0x45da('0x25')](_0x58df9e);}return _0x4c049d[_0x45da('0x26')](_0x58df9e)['end']();};}function respondWithResult(_0x5ae848,_0x4901c1){_0x4901c1=_0x4901c1||0xc8;return function(_0x260d98){if(_0x260d98){return _0x5ae848['status'](_0x4901c1)[_0x45da('0x27')](_0x260d98);}};}function respondWithFilteredResult(_0x11b543,_0x17f383){return function(_0x1ec233){if(_0x1ec233){var _0x4ba122=typeof _0x17f383[_0x45da('0x28')]===_0x45da('0x29')&&typeof _0x17f383[_0x45da('0x2a')]===_0x45da('0x29');var _0x42725a=_0x1ec233['count'];var _0x459a81=_0x4ba122?0x0:_0x17f383['offset'];var _0x475c94=_0x4ba122?_0x1ec233[_0x45da('0x2b')]:_0x17f383[_0x45da('0x28')]+_0x17f383[_0x45da('0x2a')];var _0x679972;if(_0x475c94>=_0x42725a){_0x475c94=_0x42725a;_0x679972=0xc8;}else{_0x679972=0xce;}_0x11b543[_0x45da('0x26')](_0x679972);return _0x11b543['set'](_0x45da('0x2c'),_0x459a81+'-'+_0x475c94+'/'+_0x42725a)[_0x45da('0x27')](_0x1ec233);}return null;};}function patchUpdates(_0x11166b){return function(_0x415056){try{jsonpatch['apply'](_0x415056,_0x11166b,!![]);}catch(_0x64e97b){return BPromise[_0x45da('0x2d')](_0x64e97b);}return _0x415056['save']();};}function saveUpdates(_0x504408,_0x1fa7c0){return function(_0x5553ec){if(_0x5553ec){return _0x5553ec[_0x45da('0x2e')](_0x504408)[_0x45da('0x1a')](function(_0x1ab7c6){return _0x1ab7c6;});}return null;};}function removeEntity(_0x171b1c,_0x45526b){return function(_0x3c8fab){if(_0x3c8fab){return _0x3c8fab['destroy']()[_0x45da('0x1a')](function(){var _0x318916=_0x3c8fab[_0x45da('0x2f')]({'plain':!![]});var _0x350c72=_0x45da('0x30');return db[_0x45da('0x31')][_0x45da('0x32')]({'where':{'type':_0x350c72,'resourceId':_0x318916['id']}})[_0x45da('0x1a')](function(){return _0x3c8fab;});})[_0x45da('0x1a')](function(){_0x171b1c['status'](0xcc)[_0x45da('0x33')]();});}};}function handleEntityNotFound(_0x35b2e6,_0x4359a0){return function(_0x241aa7){if(!_0x241aa7){_0x35b2e6[_0x45da('0x25')](0x194);}return _0x241aa7;};}function handleError(_0x225c0c,_0x2aac16){_0x2aac16=_0x2aac16||0x1f4;return function(_0xac4585){logger[_0x45da('0x1f')](_0xac4585[_0x45da('0x34')]);if(_0xac4585[_0x45da('0x35')]){delete _0xac4585[_0x45da('0x35')];}_0x225c0c['status'](_0x2aac16)[_0x45da('0x36')](_0xac4585);};}exports[_0x45da('0x37')]=function(_0x446ad8,_0x2eab98){var _0x31f071={},_0x3493ac={},_0x78eddf={'count':0x0,'rows':[]};var _0x2a9b01=_[_0x45da('0x38')](db['VoiceContext']['rawAttributes'],function(_0x11bd43){return{'name':_0x11bd43['fieldName'],'type':_0x11bd43[_0x45da('0x39')][_0x45da('0x3a')]};});_0x3493ac[_0x45da('0x3b')]=_[_0x45da('0x38')](_0x2a9b01,_0x45da('0x35'));_0x3493ac[_0x45da('0x3c')]=_[_0x45da('0x3d')](_0x446ad8[_0x45da('0x3c')]);_0x3493ac[_0x45da('0x3e')]=_[_0x45da('0x3f')](_0x3493ac[_0x45da('0x3b')],_0x3493ac['query']);_0x31f071[_0x45da('0x40')]=_[_0x45da('0x3f')](_0x3493ac[_0x45da('0x3b')],qs[_0x45da('0x41')](_0x446ad8[_0x45da('0x3c')]['fields']));_0x31f071[_0x45da('0x40')]=_0x31f071[_0x45da('0x40')]['length']?_0x31f071['attributes']:_0x3493ac['model'];if(!_0x446ad8[_0x45da('0x3c')]['hasOwnProperty'](_0x45da('0x42'))){_0x31f071['limit']=qs[_0x45da('0x2a')](_0x446ad8[_0x45da('0x3c')][_0x45da('0x2a')]);_0x31f071[_0x45da('0x28')]=qs[_0x45da('0x28')](_0x446ad8[_0x45da('0x3c')][_0x45da('0x28')]);}_0x31f071[_0x45da('0x43')]=qs[_0x45da('0x44')](_0x446ad8[_0x45da('0x3c')]['sort']);_0x31f071[_0x45da('0x45')]=qs['filters'](_[_0x45da('0x46')](_0x446ad8['query'],_0x3493ac['filters']),_0x2a9b01);if(_0x446ad8['query'][_0x45da('0x47')]){_0x31f071[_0x45da('0x45')]=_[_0x45da('0x48')](_0x31f071['where'],{'$or':_[_0x45da('0x38')](_0x2a9b01,function(_0x2207ea){if(_0x2207ea[_0x45da('0x39')]!==_0x45da('0x49')){var _0x3f84c6={};_0x3f84c6[_0x2207ea[_0x45da('0x35')]]={'$like':'%'+_0x446ad8[_0x45da('0x3c')][_0x45da('0x47')]+'%'};return _0x3f84c6;}})});}_0x31f071=_[_0x45da('0x48')]({},_0x31f071,_0x446ad8[_0x45da('0x4a')]);var _0x1fb060={'where':_0x31f071['where']};return db[_0x45da('0x4b')][_0x45da('0x2b')](_0x1fb060)[_0x45da('0x1a')](function(_0x32e8e2){_0x78eddf[_0x45da('0x2b')]=_0x32e8e2;if(_0x446ad8['query']['includeAll']){_0x31f071['include']=[{'all':!![]}];}return db[_0x45da('0x4b')][_0x45da('0x4c')](_0x31f071);})[_0x45da('0x1a')](function(_0x3f1948){_0x78eddf[_0x45da('0x4d')]=_0x3f1948;return _0x78eddf;})['then'](respondWithFilteredResult(_0x2eab98,_0x31f071))['catch'](handleError(_0x2eab98,null));};exports[_0x45da('0x4e')]=function(_0x2ee0b8,_0x4e5387){var _0x505a41={'raw':![],'where':{'id':_0x2ee0b8[_0x45da('0x4f')]['id']}},_0x1cc9e4={};_0x1cc9e4['model']=_[_0x45da('0x3d')](db[_0x45da('0x4b')][_0x45da('0x50')]);_0x1cc9e4['query']=_[_0x45da('0x3d')](_0x2ee0b8[_0x45da('0x3c')]);_0x1cc9e4['filters']=_[_0x45da('0x3f')](_0x1cc9e4[_0x45da('0x3b')],_0x1cc9e4[_0x45da('0x3c')]);_0x505a41[_0x45da('0x40')]=_['intersection'](_0x1cc9e4[_0x45da('0x3b')],qs[_0x45da('0x41')](_0x2ee0b8[_0x45da('0x3c')][_0x45da('0x41')]));_0x505a41[_0x45da('0x40')]=_0x505a41[_0x45da('0x40')][_0x45da('0x51')]?_0x505a41['attributes']:_0x1cc9e4[_0x45da('0x3b')];if(_0x2ee0b8[_0x45da('0x3c')]['includeAll']){_0x505a41[_0x45da('0x52')]=[{'all':!![]}];}_0x505a41=_[_0x45da('0x48')]({},_0x505a41,_0x2ee0b8[_0x45da('0x4a')]);return db[_0x45da('0x4b')]['find'](_0x505a41)[_0x45da('0x1a')](handleEntityNotFound(_0x4e5387,null))[_0x45da('0x1a')](respondWithResult(_0x4e5387,null))[_0x45da('0x24')](handleError(_0x4e5387,null));};exports[_0x45da('0x53')]=function(_0x73ab8d,_0x494f8,_0x59a93f){var _0x4a1396;return db[_0x45da('0x4b')][_0x45da('0x53')](_0x73ab8d[_0x45da('0x54')],{'raw':!![]})[_0x45da('0x1a')](function(_0x320c03){_0x4a1396=_0x320c03;return db[_0x45da('0x4b')][_0x45da('0x4c')]({'raw':!![]});})[_0x45da('0x1a')](function(_0x8cb031){var _0xf75a5c=fs[_0x45da('0x55')](path['join'](config['root'],_0x45da('0x56')),_0x45da('0x57'));var _0x4a8d0e=ejs['render'](_0xf75a5c,{'contexts':_0x8cb031||[]});fs['writeFileSync'](_0x45da('0x58'),_0x4a8d0e);})['then'](function(){return respondWithRpcPromise(_0x45da('0x59'),_0x45da('0x53'),{'module':_0x45da('0x5a')});})[_0x45da('0x1a')](function(){var _0x16560e=_0x73ab8d['user'][_0x45da('0x2f')]({'plain':!![]});if(!_0x16560e)throw new Error(_0x45da('0x5b'));if(_0x16560e[_0x45da('0x5c')]==='user'){var _0x3ecbea=_0x4a1396['get']({'plain':!![]});return db[_0x45da('0x5d')]['find']({'where':{'name':_0x45da('0x30'),'userProfileId':_0x16560e[_0x45da('0x5e')]},'raw':!![]})[_0x45da('0x1a')](function(_0x46dd46){if(_0x46dd46&&_0x46dd46[_0x45da('0x5f')]===0x0){return db[_0x45da('0x31')][_0x45da('0x53')]({'name':_0x3ecbea[_0x45da('0x35')],'resourceId':_0x3ecbea['id'],'type':_0x46dd46['name'],'sectionId':_0x46dd46['id']},{})['then'](function(){return _0x4a1396;});}else{return _0x4a1396;}})[_0x45da('0x24')](function(_0x5b7fe3){logger['error'](_0x45da('0x60'),_0x5b7fe3);throw _0x5b7fe3;});}return _0x4a1396;})[_0x45da('0x1a')](respondWithResult(_0x494f8,0xc9))[_0x45da('0x24')](handleError(_0x494f8,null));};exports[_0x45da('0x2e')]=function(_0x37d13c,_0x106b2f,_0x14af10){var _0x39b41c;return db[_0x45da('0x4b')][_0x45da('0x61')]({'where':{'id':_0x37d13c[_0x45da('0x4f')]['id']}})[_0x45da('0x1a')](handleEntityNotFound(_0x106b2f,null))[_0x45da('0x1a')](saveUpdates(_0x37d13c[_0x45da('0x54')],null))[_0x45da('0x1a')](function(_0x1bc467){if(_0x1bc467){_0x39b41c=_0x1bc467;return db[_0x45da('0x4b')][_0x45da('0x4c')]({'raw':!![]});}})[_0x45da('0x1a')](function(_0x18b324){var _0x8c8a3b=fs[_0x45da('0x55')](path['join'](config[_0x45da('0x62')],_0x45da('0x56')),_0x45da('0x57'));var _0x3d0363=ejs[_0x45da('0x63')](_0x8c8a3b,{'contexts':_0x18b324||[]});fs[_0x45da('0x64')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3d0363);})[_0x45da('0x1a')](function(){return respondWithRpcPromise(_0x45da('0x59'),'update',{'module':'chan_sip.so'});})[_0x45da('0x1a')](function(){return _0x39b41c;})['then'](respondWithResult(_0x106b2f,null))[_0x45da('0x24')](handleError(_0x106b2f,null));};exports['destroy']=function(_0x44c2cd,_0x3bb274,_0xcb9f64){var _0x478589;return db[_0x45da('0x4b')][_0x45da('0x61')]({'where':{'id':_0x44c2cd['params']['id']}})[_0x45da('0x1a')](handleEntityNotFound(_0x3bb274,null))['then'](removeEntity(_0x3bb274,null))[_0x45da('0x1a')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x45da('0x1a')](function(_0x3ef1c5){var _0x461370=fs[_0x45da('0x55')](path[_0x45da('0x65')](config['root'],_0x45da('0x56')),_0x45da('0x57'));var _0x1e002d=ejs[_0x45da('0x63')](_0x461370,{'contexts':_0x3ef1c5});fs[_0x45da('0x64')](_0x45da('0x58'),_0x1e002d);return respondWithRpcPromise(_0x45da('0x59'),'destroy',{'module':'chan_sip.so'});})[_0x45da('0x24')](handleError(_0x3bb274,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 5a12268..a06eede 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 _0x737b=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x4d05dd,_0x258cdd){var _0x1c5226=function(_0x1a857c){while(--_0x1a857c){_0x4d05dd['push'](_0x4d05dd['shift']());}};_0x1c5226(++_0x258cdd);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb737('0x0'));var util=require(_0xb737('0x1'));var logger=require('../../config/logger')(_0xb737('0x2'));var moment=require(_0xb737('0x3'));var BPromise=require(_0xb737('0x4'));var rp=require(_0xb737('0x5'));var fs=require('fs');var path=require(_0xb737('0x6'));var rimraf=require(_0xb737('0x7'));var config=require(_0xb737('0x8'));var attributes=require(_0xb737('0x9'));module[_0xb737('0xa')]=function(_0x3a718e,_0x1c1cf4){return _0x3a718e[_0xb737('0xb')](_0xb737('0xc'),attributes,{'tableName':_0xb737('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x761c=['api','bluebird','request-promise','path','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger'];(function(_0x218454,_0x403302){var _0x177534=function(_0x271367){while(--_0x271367){_0x218454['push'](_0x218454['shift']());}};_0x177534(++_0x403302);}(_0x761c,0x18a));var _0xc761=function(_0x465636,_0x4989f1){_0x465636=_0x465636-0x0;var _0x30c7ac=_0x761c[_0x465636];return _0x30c7ac;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var logger=require(_0xc761('0x1'))(_0xc761('0x2'));var moment=require('moment');var BPromise=require(_0xc761('0x3'));var rp=require(_0xc761('0x4'));var fs=require('fs');var path=require(_0xc761('0x5'));var rimraf=require('rimraf');var config=require(_0xc761('0x6'));var attributes=require('./voiceContext.attributes');module[_0xc761('0x7')]=function(_0x468f51,_0x23ba0b){return _0x468f51[_0xc761('0x8')](_0xc761('0x9'),attributes,{'tableName':_0xc761('0xa'),'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 437202e..ee410e2 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 _0x0a6b=['http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f4d09,_0x21635c){var _0x1737c1=function(_0x2dd223){while(--_0x2dd223){_0x3f4d09['push'](_0x3f4d09['shift']());}};_0x1737c1(++_0x21635c);}(_0x0a6b,0x120));var _0xb0a6=function(_0x261a4a,_0x389a4f){_0x261a4a=_0x261a4a-0x0;var _0xc8d5b4=_0x0a6b[_0x261a4a];return _0xc8d5b4;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require(_0xb0a6('0x1'));var BPromise=require(_0xb0a6('0x2'));var rs=require(_0xb0a6('0x3'));var fs=require('fs');var Redis=require(_0xb0a6('0x4'));var db=require(_0xb0a6('0x5'))['db'];var utils=require(_0xb0a6('0x6'));var logger=require(_0xb0a6('0x7'))(_0xb0a6('0x8'));var config=require(_0xb0a6('0x9'));var jayson=require(_0xb0a6('0xa'));var client=jayson['client'][_0xb0a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x504a45,_0x23e004,_0x490cfc){return new BPromise(function(_0x597b68,_0xdaa894){return client['request'](_0x504a45,_0x490cfc)[_0xb0a6('0xc')](function(_0x423683){logger['info'](_0xb0a6('0xd'),_0x23e004,_0xb0a6('0xe'));logger['debug'](_0xb0a6('0xf'),_0x23e004,_0xb0a6('0xe'),JSON[_0xb0a6('0x10')](_0x423683));if(_0x423683[_0xb0a6('0x11')]){if(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x12')]===0x1f4){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0xdaa894(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x13')]);}logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0x597b68(_0x423683[_0xb0a6('0x11')]['message']);}else{logger[_0xb0a6('0x14')]('VoiceContext,\x20%s,\x20%s',_0x23e004,'request\x20sent');_0x597b68(_0x423683[_0xb0a6('0x15')][_0xb0a6('0x13')]);}})[_0xb0a6('0x16')](function(_0x2ef938){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x2ef938);_0xdaa894(_0x2ef938);});});} \ No newline at end of file +var _0xe62a=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x12249a,_0x55929a){var _0x5f837=function(_0x282dc6){while(--_0x282dc6){_0x12249a['push'](_0x12249a['shift']());}};_0x5f837(++_0x55929a);}(_0xe62a,0x143));var _0xae62=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe62a[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae62('0x2'));var db=require(_0xae62('0x3'))['db'];var utils=require(_0xae62('0x4'));var logger=require(_0xae62('0x5'))(_0xae62('0x6'));var config=require(_0xae62('0x7'));var jayson=require(_0xae62('0x8'));var client=jayson[_0xae62('0x9')][_0xae62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362244,_0x2ef966,_0x2a8d24){return new BPromise(function(_0x891ab3,_0x1b9f67){return client[_0xae62('0xb')](_0x362244,_0x2a8d24)[_0xae62('0xc')](function(_0x17e9e2){logger[_0xae62('0xd')](_0xae62('0xe'),_0x2ef966,_0xae62('0xf'));logger[_0xae62('0x10')](_0xae62('0x11'),_0x2ef966,_0xae62('0xf'),JSON[_0xae62('0x12')](_0x17e9e2));if(_0x17e9e2[_0xae62('0x13')]){if(_0x17e9e2[_0xae62('0x13')]['code']===0x1f4){logger[_0xae62('0x13')](_0xae62('0xe'),_0x2ef966,_0x17e9e2[_0xae62('0x13')][_0xae62('0x14')]);return _0x1b9f67(_0x17e9e2[_0xae62('0x13')]['message']);}logger['error'](_0xae62('0xe'),_0x2ef966,_0x17e9e2[_0xae62('0x13')][_0xae62('0x14')]);return _0x891ab3(_0x17e9e2['error'][_0xae62('0x14')]);}else{logger[_0xae62('0xd')](_0xae62('0xe'),_0x2ef966,_0xae62('0xf'));_0x891ab3(_0x17e9e2[_0xae62('0x15')]['message']);}})[_0xae62('0x16')](function(_0x50d730){logger[_0xae62('0x13')](_0xae62('0xe'),_0x2ef966,_0x50d730);_0x1b9f67(_0x50d730);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8b27bdf..32bb58f 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 _0xbfc2=['post','create','put','/:id','update','delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','get'];(function(_0x11d075,_0x393f84){var _0x2d3908=function(_0x483bbf){while(--_0x483bbf){_0x11d075['push'](_0x11d075['shift']());}};_0x2d3908(++_0x393f84);}(_0xbfc2,0xcc));var _0x2bfc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xbfc2[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x2bfc('0x0'));var path=require(_0x2bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bfc('0x2'));var router=express[_0x2bfc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2bfc('0x4'));var interaction=require(_0x2bfc('0x5'));var config=require(_0x2bfc('0x6'));var controller=require(_0x2bfc('0x7'));router['get']('/',auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x9')]);router['get'](_0x2bfc('0xa'),auth[_0x2bfc('0x8')](),controller['describe']);router[_0x2bfc('0xb')]('/:id',auth[_0x2bfc('0x8')](),controller['show']);router[_0x2bfc('0xc')]('/',auth['isAuthenticated'](),controller[_0x2bfc('0xd')]);router[_0x2bfc('0xe')](_0x2bfc('0xf'),auth[_0x2bfc('0x8')](),controller[_0x2bfc('0x10')]);router[_0x2bfc('0x11')]('/:id',auth[_0x2bfc('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7234=['isAuthenticated','index','/describe','/:id','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14c5a3,_0x45d811){var _0x36cda8=function(_0x582dfe){while(--_0x582dfe){_0x14c5a3['push'](_0x14c5a3['shift']());}};_0x36cda8(++_0x45d811);}(_0x7234,0x172));var _0x4723=function(_0x2689fe,_0x1299df){_0x2689fe=_0x2689fe-0x0;var _0x323f30=_0x7234[_0x2689fe];return _0x323f30;};'use strict';var multer=require(_0x4723('0x0'));var util=require(_0x4723('0x1'));var path=require(_0x4723('0x2'));var timeout=require(_0x4723('0x3'));var express=require(_0x4723('0x4'));var router=express['Router']();var fs_extra=require(_0x4723('0x5'));var auth=require(_0x4723('0x6'));var interaction=require(_0x4723('0x7'));var config=require(_0x4723('0x8'));var controller=require('./voiceDialReport.controller');router[_0x4723('0x9')]('/',auth[_0x4723('0xa')](),controller[_0x4723('0xb')]);router['get'](_0x4723('0xc'),auth[_0x4723('0xa')](),controller['describe']);router[_0x4723('0x9')](_0x4723('0xd'),auth[_0x4723('0xa')](),controller['show']);router[_0x4723('0xe')]('/',auth[_0x4723('0xa')](),controller[_0x4723('0xf')]);router[_0x4723('0x10')](_0x4723('0xd'),auth[_0x4723('0xa')](),controller[_0x4723('0x11')]);router[_0x4723('0x12')](_0x4723('0xd'),auth[_0x4723('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index e806177..463b0ea 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 _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x23ce52,_0x3e568e){var _0x543721=function(_0x3b1e99){while(--_0x3b1e99){_0x23ce52['push'](_0x23ce52['shift']());}};_0x543721(++_0x3e568e);}(_0xb821,0xa7));var _0x1b82=function(_0x5e5c26,_0x40beba){_0x5e5c26=_0x5e5c26-0x0;var _0x1f25fc=_0xb821[_0x5e5c26];return _0x1f25fc;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x11d94b,_0x5df127){var _0x21abab=function(_0x5370fa){while(--_0x5370fa){_0x11d94b['push'](_0x11d94b['shift']());}};_0x21abab(++_0x5df127);}(_0x008c,0x188));var _0xc008=function(_0x3a62c9,_0x4656c3){_0x3a62c9=_0x3a62c9-0x0;var _0x26f7b2=_0x008c[_0x3a62c9];return _0x26f7b2;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d1c65f3..30ca49c 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 _0x2d3d=['options','VoiceDialReport','then','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x19bd47,_0x24570f){var _0x2f4d65=function(_0x1fbe0f){while(--_0x1fbe0f){_0x19bd47['push'](_0x19bd47['shift']());}};_0x2f4d65(++_0x24570f);}(_0x2d3d,0x1e4));var _0xd2d3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2d3d[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xd2d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd2d3('0x2'));var BPromise=require(_0xd2d3('0x3'));var Mustache=require(_0xd2d3('0x4'));var util=require(_0xd2d3('0x5'));var path=require(_0xd2d3('0x6'));var sox=require(_0xd2d3('0x7'));var csv=require(_0xd2d3('0x8'));var ejs=require(_0xd2d3('0x9'));var fs=require('fs');var fs_extra=require(_0xd2d3('0xa'));var _=require(_0xd2d3('0xb'));var squel=require(_0xd2d3('0xc'));var crypto=require(_0xd2d3('0xd'));var jsforce=require(_0xd2d3('0xe'));var deskjs=require(_0xd2d3('0xf'));var toCsv=require(_0xd2d3('0x8'));var querystring=require(_0xd2d3('0x10'));var Papa=require(_0xd2d3('0x11'));var Redis=require(_0xd2d3('0x12'));var authService=require(_0xd2d3('0x13'));var qs=require(_0xd2d3('0x14'));var as=require(_0xd2d3('0x15'));var hardwareService=require(_0xd2d3('0x16'));var logger=require(_0xd2d3('0x17'))(_0xd2d3('0x18'));var utils=require(_0xd2d3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd2d3('0x1a'));var db=require(_0xd2d3('0x1b'))['db'];function respondWithStatusCode(_0x2c26b5,_0xcce441){_0xcce441=_0xcce441||0xcc;return function(_0x398a6b){if(_0x398a6b){return _0x2c26b5['sendStatus'](_0xcce441);}return _0x2c26b5[_0xd2d3('0x1c')](_0xcce441)[_0xd2d3('0x1d')]();};}function respondWithResult(_0x302127,_0x2fd36b){_0x2fd36b=_0x2fd36b||0xc8;return function(_0x505d75){if(_0x505d75){return _0x302127[_0xd2d3('0x1c')](_0x2fd36b)[_0xd2d3('0x1e')](_0x505d75);}};}function respondWithFilteredResult(_0x5acf2e,_0x3b7fa8){return function(_0x2a0a12){if(_0x2a0a12){var _0xd1e523=typeof _0x3b7fa8['offset']===_0xd2d3('0x1f')&&typeof _0x3b7fa8[_0xd2d3('0x20')]===_0xd2d3('0x1f');var _0x2ff5b0=_0x2a0a12[_0xd2d3('0x21')];var _0x511410=_0xd1e523?0x0:_0x3b7fa8[_0xd2d3('0x22')];var _0x1623a8=_0xd1e523?_0x2a0a12[_0xd2d3('0x21')]:_0x3b7fa8['offset']+_0x3b7fa8[_0xd2d3('0x20')];var _0x720ee4;if(_0x1623a8>=_0x2ff5b0){_0x1623a8=_0x2ff5b0;_0x720ee4=0xc8;}else{_0x720ee4=0xce;}_0x5acf2e['status'](_0x720ee4);return _0x5acf2e[_0xd2d3('0x23')](_0xd2d3('0x24'),_0x511410+'-'+_0x1623a8+'/'+_0x2ff5b0)['json'](_0x2a0a12);}return null;};}function patchUpdates(_0x247821){return function(_0x178aff){try{jsonpatch[_0xd2d3('0x25')](_0x178aff,_0x247821,!![]);}catch(_0x57ea9f){return BPromise['reject'](_0x57ea9f);}return _0x178aff['save']();};}function saveUpdates(_0x21bb51,_0x13661c){return function(_0x373d0b){if(_0x373d0b){return _0x373d0b[_0xd2d3('0x26')](_0x21bb51)['then'](function(_0x150c9f){return _0x150c9f;});}return null;};}function removeEntity(_0x4ee466,_0x856f0f){return function(_0x25d466){if(_0x25d466){return _0x25d466[_0xd2d3('0x27')]()['then'](function(){_0x4ee466[_0xd2d3('0x1c')](0xcc)[_0xd2d3('0x1d')]();});}};}function handleEntityNotFound(_0x1b1745,_0x3514ba){return function(_0x730637){if(!_0x730637){_0x1b1745['sendStatus'](0x194);}return _0x730637;};}function handleError(_0x5f0b4c,_0x3b74d7){_0x3b74d7=_0x3b74d7||0x1f4;return function(_0x176c84){logger['error'](_0x176c84[_0xd2d3('0x28')]);if(_0x176c84[_0xd2d3('0x29')]){delete _0x176c84[_0xd2d3('0x29')];}_0x5f0b4c[_0xd2d3('0x1c')](_0x3b74d7)['send'](_0x176c84);};}exports[_0xd2d3('0x2a')]=function(_0x1cb4d9,_0x7c3cc1){var _0x21cb9d={},_0x3affeb={},_0x4c7b9b={'count':0x0,'rows':[]};var _0x553dd6=_[_0xd2d3('0x2b')](db['VoiceDialReport']['rawAttributes'],function(_0x7b9bbb){return{'name':_0x7b9bbb[_0xd2d3('0x2c')],'type':_0x7b9bbb[_0xd2d3('0x2d')][_0xd2d3('0x2e')]};});_0x3affeb[_0xd2d3('0x2f')]=_[_0xd2d3('0x2b')](_0x553dd6,_0xd2d3('0x29'));_0x3affeb[_0xd2d3('0x30')]=_['keys'](_0x1cb4d9['query']);_0x3affeb[_0xd2d3('0x31')]=_['intersection'](_0x3affeb[_0xd2d3('0x2f')],_0x3affeb['query']);_0x21cb9d['attributes']=_[_0xd2d3('0x32')](_0x3affeb[_0xd2d3('0x2f')],qs[_0xd2d3('0x33')](_0x1cb4d9[_0xd2d3('0x30')][_0xd2d3('0x33')]));_0x21cb9d['attributes']=_0x21cb9d[_0xd2d3('0x34')]['length']?_0x21cb9d[_0xd2d3('0x34')]:_0x3affeb['model'];if(!_0x1cb4d9[_0xd2d3('0x30')][_0xd2d3('0x35')](_0xd2d3('0x36'))){_0x21cb9d[_0xd2d3('0x20')]=qs[_0xd2d3('0x20')](_0x1cb4d9['query'][_0xd2d3('0x20')]);_0x21cb9d[_0xd2d3('0x22')]=qs['offset'](_0x1cb4d9[_0xd2d3('0x30')][_0xd2d3('0x22')]);}_0x21cb9d[_0xd2d3('0x37')]=qs[_0xd2d3('0x38')](_0x1cb4d9['query']['sort']);_0x21cb9d[_0xd2d3('0x39')]=qs[_0xd2d3('0x31')](_[_0xd2d3('0x3a')](_0x1cb4d9['query'],_0x3affeb[_0xd2d3('0x31')]),_0x553dd6);if(_0x1cb4d9[_0xd2d3('0x30')][_0xd2d3('0x3b')]){_0x21cb9d[_0xd2d3('0x39')]=_[_0xd2d3('0x3c')](_0x21cb9d['where'],{'$or':_['map'](_0x553dd6,function(_0x4038d4){if(_0x4038d4[_0xd2d3('0x2d')]!==_0xd2d3('0x3d')){var _0x22fe1d={};_0x22fe1d[_0x4038d4[_0xd2d3('0x29')]]={'$like':'%'+_0x1cb4d9[_0xd2d3('0x30')]['filter']+'%'};return _0x22fe1d;}})});}_0x21cb9d=_['merge']({},_0x21cb9d,_0x1cb4d9[_0xd2d3('0x3e')]);var _0x58dbe1={'where':_0x21cb9d['where']};return db[_0xd2d3('0x3f')][_0xd2d3('0x21')](_0x58dbe1)[_0xd2d3('0x40')](function(_0x5e906b){_0x4c7b9b[_0xd2d3('0x21')]=_0x5e906b;if(_0x1cb4d9[_0xd2d3('0x30')][_0xd2d3('0x41')]){_0x21cb9d[_0xd2d3('0x42')]=[{'all':!![]}];}return db[_0xd2d3('0x3f')][_0xd2d3('0x43')](_0x21cb9d);})[_0xd2d3('0x40')](function(_0x56194d){_0x4c7b9b[_0xd2d3('0x44')]=_0x56194d;return _0x4c7b9b;})[_0xd2d3('0x40')](respondWithFilteredResult(_0x7c3cc1,_0x21cb9d))[_0xd2d3('0x45')](handleError(_0x7c3cc1,null));};exports[_0xd2d3('0x46')]=function(_0x308eb7,_0xbdcbf3){var _0x597ef1={'raw':!![],'where':{'id':_0x308eb7[_0xd2d3('0x47')]['id']}},_0x31ba89={};_0x31ba89[_0xd2d3('0x2f')]=_[_0xd2d3('0x48')](db[_0xd2d3('0x3f')][_0xd2d3('0x49')]);_0x31ba89[_0xd2d3('0x30')]=_[_0xd2d3('0x48')](_0x308eb7[_0xd2d3('0x30')]);_0x31ba89[_0xd2d3('0x31')]=_[_0xd2d3('0x32')](_0x31ba89[_0xd2d3('0x2f')],_0x31ba89[_0xd2d3('0x30')]);_0x597ef1[_0xd2d3('0x34')]=_[_0xd2d3('0x32')](_0x31ba89[_0xd2d3('0x2f')],qs[_0xd2d3('0x33')](_0x308eb7[_0xd2d3('0x30')][_0xd2d3('0x33')]));_0x597ef1[_0xd2d3('0x34')]=_0x597ef1[_0xd2d3('0x34')]['length']?_0x597ef1[_0xd2d3('0x34')]:_0x31ba89['model'];if(_0x308eb7[_0xd2d3('0x30')]['includeAll']){_0x597ef1['include']=[{'all':!![]}];}_0x597ef1=_[_0xd2d3('0x3c')]({},_0x597ef1,_0x308eb7['options']);return db[_0xd2d3('0x3f')][_0xd2d3('0x4a')](_0x597ef1)[_0xd2d3('0x40')](handleEntityNotFound(_0xbdcbf3,null))[_0xd2d3('0x40')](respondWithResult(_0xbdcbf3,null))['catch'](handleError(_0xbdcbf3,null));};exports[_0xd2d3('0x4b')]=function(_0x4c542e,_0x42d7a9){return db['VoiceDialReport'][_0xd2d3('0x4b')](_0x4c542e['body'],{})[_0xd2d3('0x40')](respondWithResult(_0x42d7a9,0xc9))[_0xd2d3('0x45')](handleError(_0x42d7a9,null));};exports[_0xd2d3('0x26')]=function(_0x4d6c97,_0xc4625b){if(_0x4d6c97[_0xd2d3('0x4c')]['id']){delete _0x4d6c97[_0xd2d3('0x4c')]['id'];}return db[_0xd2d3('0x3f')][_0xd2d3('0x4a')]({'where':{'id':_0x4d6c97[_0xd2d3('0x47')]['id']}})[_0xd2d3('0x40')](handleEntityNotFound(_0xc4625b,null))[_0xd2d3('0x40')](saveUpdates(_0x4d6c97[_0xd2d3('0x4c')],null))[_0xd2d3('0x40')](respondWithResult(_0xc4625b,null))['catch'](handleError(_0xc4625b,null));};exports[_0xd2d3('0x27')]=function(_0x159d60,_0x22e3fd){return db[_0xd2d3('0x3f')]['find']({'where':{'id':_0x159d60['params']['id']}})[_0xd2d3('0x40')](handleEntityNotFound(_0x22e3fd,null))[_0xd2d3('0x40')](removeEntity(_0x22e3fd,null))[_0xd2d3('0x45')](handleError(_0x22e3fd,null));};exports[_0xd2d3('0x4d')]=function(_0x2c1695,_0x131266){return db[_0xd2d3('0x3f')][_0xd2d3('0x4d')]()['then'](respondWithResult(_0x131266,null))[_0xd2d3('0x45')](handleError(_0x131266,null));}; \ No newline at end of file +var _0x2a71=['model','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','VoiceDialReport','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','type','map','query','keys','filters','intersection'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2a71,0x1f2));var _0x12a7=function(_0x3c31d1,_0x4d885e){_0x3c31d1=_0x3c31d1-0x0;var _0xe62b4=_0x2a71[_0x3c31d1];return _0xe62b4;};'use strict';var emlformat=require(_0x12a7('0x0'));var rimraf=require(_0x12a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12a7('0x2'));var rp=require('request-promise');var moment=require(_0x12a7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x12a7('0x4'));var util=require('util');var path=require(_0x12a7('0x5'));var sox=require(_0x12a7('0x6'));var csv=require(_0x12a7('0x7'));var ejs=require(_0x12a7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12a7('0x9'));var squel=require(_0x12a7('0xa'));var crypto=require('crypto');var jsforce=require(_0x12a7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x12a7('0x7'));var querystring=require(_0x12a7('0xc'));var Papa=require(_0x12a7('0xd'));var Redis=require(_0x12a7('0xe'));var authService=require(_0x12a7('0xf'));var qs=require(_0x12a7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12a7('0x11'));var logger=require('../../config/logger')(_0x12a7('0x12'));var utils=require(_0x12a7('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x12a7('0x14'))['db'];function respondWithStatusCode(_0x1a39a6,_0x31459c){_0x31459c=_0x31459c||0xcc;return function(_0x4707eb){if(_0x4707eb){return _0x1a39a6[_0x12a7('0x15')](_0x31459c);}return _0x1a39a6[_0x12a7('0x16')](_0x31459c)[_0x12a7('0x17')]();};}function respondWithResult(_0x3760a8,_0x14bdaa){_0x14bdaa=_0x14bdaa||0xc8;return function(_0x12b5b9){if(_0x12b5b9){return _0x3760a8[_0x12a7('0x16')](_0x14bdaa)['json'](_0x12b5b9);}};}function respondWithFilteredResult(_0x36d2ca,_0x1c8212){return function(_0x4221cd){if(_0x4221cd){var _0x217536=typeof _0x1c8212[_0x12a7('0x18')]==='undefined'&&typeof _0x1c8212['limit']==='undefined';var _0x4ecce8=_0x4221cd[_0x12a7('0x19')];var _0xff7621=_0x217536?0x0:_0x1c8212[_0x12a7('0x18')];var _0x54e0c1=_0x217536?_0x4221cd['count']:_0x1c8212[_0x12a7('0x18')]+_0x1c8212[_0x12a7('0x1a')];var _0xd1ae42;if(_0x54e0c1>=_0x4ecce8){_0x54e0c1=_0x4ecce8;_0xd1ae42=0xc8;}else{_0xd1ae42=0xce;}_0x36d2ca[_0x12a7('0x16')](_0xd1ae42);return _0x36d2ca[_0x12a7('0x1b')](_0x12a7('0x1c'),_0xff7621+'-'+_0x54e0c1+'/'+_0x4ecce8)[_0x12a7('0x1d')](_0x4221cd);}return null;};}function patchUpdates(_0x5e98a9){return function(_0x24f3be){try{jsonpatch['apply'](_0x24f3be,_0x5e98a9,!![]);}catch(_0x53fc0a){return BPromise[_0x12a7('0x1e')](_0x53fc0a);}return _0x24f3be[_0x12a7('0x1f')]();};}function saveUpdates(_0x5954ab,_0x3f5995){return function(_0x6d463b){if(_0x6d463b){return _0x6d463b[_0x12a7('0x20')](_0x5954ab)[_0x12a7('0x21')](function(_0x2ded14){return _0x2ded14;});}return null;};}function removeEntity(_0x19ff54,_0x1c1988){return function(_0x3a1f74){if(_0x3a1f74){return _0x3a1f74[_0x12a7('0x22')]()[_0x12a7('0x21')](function(){_0x19ff54[_0x12a7('0x16')](0xcc)[_0x12a7('0x17')]();});}};}function handleEntityNotFound(_0x735a6c,_0x28c451){return function(_0x20312d){if(!_0x20312d){_0x735a6c[_0x12a7('0x15')](0x194);}return _0x20312d;};}function handleError(_0x537be0,_0x5c43de){_0x5c43de=_0x5c43de||0x1f4;return function(_0x4db89e){logger[_0x12a7('0x23')](_0x4db89e[_0x12a7('0x24')]);if(_0x4db89e[_0x12a7('0x25')]){delete _0x4db89e['name'];}_0x537be0[_0x12a7('0x16')](_0x5c43de)['send'](_0x4db89e);};}exports[_0x12a7('0x26')]=function(_0x4c1acd,_0x335f9a){var _0x34d9d1={},_0xc051c5={},_0x44d5d0={'count':0x0,'rows':[]};var _0x9c2b6a=_['map'](db['VoiceDialReport'][_0x12a7('0x27')],function(_0x1cce80){return{'name':_0x1cce80['fieldName'],'type':_0x1cce80[_0x12a7('0x28')]['key']};});_0xc051c5['model']=_[_0x12a7('0x29')](_0x9c2b6a,_0x12a7('0x25'));_0xc051c5[_0x12a7('0x2a')]=_[_0x12a7('0x2b')](_0x4c1acd[_0x12a7('0x2a')]);_0xc051c5[_0x12a7('0x2c')]=_[_0x12a7('0x2d')](_0xc051c5[_0x12a7('0x2e')],_0xc051c5['query']);_0x34d9d1[_0x12a7('0x2f')]=_[_0x12a7('0x2d')](_0xc051c5['model'],qs[_0x12a7('0x30')](_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x30')]));_0x34d9d1[_0x12a7('0x2f')]=_0x34d9d1[_0x12a7('0x2f')][_0x12a7('0x31')]?_0x34d9d1[_0x12a7('0x2f')]:_0xc051c5[_0x12a7('0x2e')];if(!_0x4c1acd[_0x12a7('0x2a')]['hasOwnProperty']('nolimit')){_0x34d9d1[_0x12a7('0x1a')]=qs[_0x12a7('0x1a')](_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x1a')]);_0x34d9d1['offset']=qs[_0x12a7('0x18')](_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x18')]);}_0x34d9d1[_0x12a7('0x32')]=qs[_0x12a7('0x33')](_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x33')]);_0x34d9d1[_0x12a7('0x34')]=qs[_0x12a7('0x2c')](_[_0x12a7('0x35')](_0x4c1acd[_0x12a7('0x2a')],_0xc051c5[_0x12a7('0x2c')]),_0x9c2b6a);if(_0x4c1acd['query'][_0x12a7('0x36')]){_0x34d9d1[_0x12a7('0x34')]=_[_0x12a7('0x37')](_0x34d9d1['where'],{'$or':_[_0x12a7('0x29')](_0x9c2b6a,function(_0x4fec60){if(_0x4fec60[_0x12a7('0x28')]!=='VIRTUAL'){var _0x2ad074={};_0x2ad074[_0x4fec60['name']]={'$like':'%'+_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x36')]+'%'};return _0x2ad074;}})});}_0x34d9d1=_['merge']({},_0x34d9d1,_0x4c1acd[_0x12a7('0x38')]);var _0x3ec622={'where':_0x34d9d1[_0x12a7('0x34')]};return db['VoiceDialReport']['count'](_0x3ec622)[_0x12a7('0x21')](function(_0x4e5ec4){_0x44d5d0[_0x12a7('0x19')]=_0x4e5ec4;if(_0x4c1acd[_0x12a7('0x2a')][_0x12a7('0x39')]){_0x34d9d1[_0x12a7('0x3a')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x34d9d1);})[_0x12a7('0x21')](function(_0x160070){_0x44d5d0[_0x12a7('0x3b')]=_0x160070;return _0x44d5d0;})['then'](respondWithFilteredResult(_0x335f9a,_0x34d9d1))['catch'](handleError(_0x335f9a,null));};exports[_0x12a7('0x3c')]=function(_0x1c2f7e,_0x1fcc15){var _0xe3241b={'raw':!![],'where':{'id':_0x1c2f7e[_0x12a7('0x3d')]['id']}},_0x3011b5={};_0x3011b5[_0x12a7('0x2e')]=_[_0x12a7('0x2b')](db[_0x12a7('0x3e')][_0x12a7('0x27')]);_0x3011b5[_0x12a7('0x2a')]=_[_0x12a7('0x2b')](_0x1c2f7e['query']);_0x3011b5[_0x12a7('0x2c')]=_['intersection'](_0x3011b5[_0x12a7('0x2e')],_0x3011b5[_0x12a7('0x2a')]);_0xe3241b['attributes']=_['intersection'](_0x3011b5[_0x12a7('0x2e')],qs[_0x12a7('0x30')](_0x1c2f7e[_0x12a7('0x2a')][_0x12a7('0x30')]));_0xe3241b[_0x12a7('0x2f')]=_0xe3241b['attributes'][_0x12a7('0x31')]?_0xe3241b[_0x12a7('0x2f')]:_0x3011b5[_0x12a7('0x2e')];if(_0x1c2f7e['query'][_0x12a7('0x39')]){_0xe3241b[_0x12a7('0x3a')]=[{'all':!![]}];}_0xe3241b=_[_0x12a7('0x37')]({},_0xe3241b,_0x1c2f7e[_0x12a7('0x38')]);return db[_0x12a7('0x3e')][_0x12a7('0x3f')](_0xe3241b)[_0x12a7('0x21')](handleEntityNotFound(_0x1fcc15,null))[_0x12a7('0x21')](respondWithResult(_0x1fcc15,null))[_0x12a7('0x40')](handleError(_0x1fcc15,null));};exports[_0x12a7('0x41')]=function(_0x19b402,_0x14dcb1){return db[_0x12a7('0x3e')][_0x12a7('0x41')](_0x19b402[_0x12a7('0x42')],{})[_0x12a7('0x21')](respondWithResult(_0x14dcb1,0xc9))[_0x12a7('0x40')](handleError(_0x14dcb1,null));};exports[_0x12a7('0x20')]=function(_0xf1461f,_0x3975f1){if(_0xf1461f[_0x12a7('0x42')]['id']){delete _0xf1461f[_0x12a7('0x42')]['id'];}return db[_0x12a7('0x3e')]['find']({'where':{'id':_0xf1461f[_0x12a7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3975f1,null))['then'](saveUpdates(_0xf1461f[_0x12a7('0x42')],null))[_0x12a7('0x21')](respondWithResult(_0x3975f1,null))['catch'](handleError(_0x3975f1,null));};exports[_0x12a7('0x22')]=function(_0x2b1222,_0x23849f){return db[_0x12a7('0x3e')][_0x12a7('0x3f')]({'where':{'id':_0x2b1222[_0x12a7('0x3d')]['id']}})[_0x12a7('0x21')](handleEntityNotFound(_0x23849f,null))[_0x12a7('0x21')](removeEntity(_0x23849f,null))['catch'](handleError(_0x23849f,null));};exports[_0x12a7('0x43')]=function(_0x4a1ba4,_0x292cbe){return db[_0x12a7('0x3e')][_0x12a7('0x43')]()[_0x12a7('0x21')](respondWithResult(_0x292cbe,null))[_0x12a7('0x40')](handleError(_0x292cbe,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 2328e95..b2ddab0 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 _0x54b2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0x54b2,0x6e));var _0x254b=function(_0x3bad07,_0x3401a1){_0x3bad07=_0x3bad07-0x0;var _0x1f5873=_0x54b2[_0x3bad07];return _0x1f5873;};'use strict';var _=require(_0x254b('0x0'));var util=require('util');var logger=require(_0x254b('0x1'))(_0x254b('0x2'));var moment=require(_0x254b('0x3'));var BPromise=require(_0x254b('0x4'));var rp=require(_0x254b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x254b('0x6'));var config=require(_0x254b('0x7'));var attributes=require(_0x254b('0x8'));module[_0x254b('0x9')]=function(_0x106c90,_0x48e16a){return _0x106c90[_0x254b('0xa')](_0x254b('0xb'),attributes,{'tableName':_0x254b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x254b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc48=['request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x11bdad,_0x1e1e51){var _0x577fdd=function(_0x59a5fb){while(--_0x59a5fb){_0x11bdad['push'](_0x11bdad['shift']());}};_0x577fdd(++_0x1e1e51);}(_0xbc48,0x90));var _0x8bc4=function(_0x42a39f,_0x572d75){_0x42a39f=_0x42a39f-0x0;var _0x59b2c7=_0xbc48[_0x42a39f];return _0x59b2c7;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var logger=require(_0x8bc4('0x2'))(_0x8bc4('0x3'));var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var rp=require(_0x8bc4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bc4('0x7'));var config=require(_0x8bc4('0x8'));var attributes=require(_0x8bc4('0x9'));module[_0x8bc4('0xa')]=function(_0x50b13e,_0x39e9e4){return _0x50b13e[_0x8bc4('0xb')](_0x8bc4('0xc'),attributes,{'tableName':_0x8bc4('0xd'),'paranoid':![],'indexes':[{'fields':[_0x8bc4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c93a1b2..cd87af6 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 _0x1d90=['jayson/promise','client','request','then','info','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','request\x20sent','result','catch','create','body','options','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9e3d90,_0x2904a4){var _0x2de4de=function(_0x19b8ba){while(--_0x19b8ba){_0x9e3d90['push'](_0x9e3d90['shift']());}};_0x2de4de(++_0x2904a4);}(_0x1d90,0x100));var _0x01d9=function(_0xc3cacb,_0x135342){_0xc3cacb=_0xc3cacb-0x0;var _0x42d7eb=_0x1d90[_0xc3cacb];return _0x42d7eb;};'use strict';var _=require(_0x01d9('0x0'));var util=require(_0x01d9('0x1'));var moment=require(_0x01d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01d9('0x3'));var db=require(_0x01d9('0x4'))['db'];var utils=require(_0x01d9('0x5'));var logger=require(_0x01d9('0x6'))(_0x01d9('0x7'));var config=require('../../config/environment');var jayson=require(_0x01d9('0x8'));var client=jayson[_0x01d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10ee48,_0x251eec,_0x18f3af){return new BPromise(function(_0x58d9fc,_0x4e768a){return client[_0x01d9('0xa')](_0x10ee48,_0x18f3af)[_0x01d9('0xb')](function(_0x295ad8){logger[_0x01d9('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x251eec,'request\x20sent');logger[_0x01d9('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x251eec,'request\x20sent',JSON[_0x01d9('0xe')](_0x295ad8));if(_0x295ad8[_0x01d9('0xf')]){if(_0x295ad8[_0x01d9('0xf')][_0x01d9('0x10')]===0x1f4){logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x251eec,_0x295ad8[_0x01d9('0xf')][_0x01d9('0x12')]);return _0x4e768a(_0x295ad8['error'][_0x01d9('0x12')]);}logger[_0x01d9('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x251eec,_0x295ad8[_0x01d9('0xf')]['message']);return _0x58d9fc(_0x295ad8[_0x01d9('0xf')][_0x01d9('0x12')]);}else{logger[_0x01d9('0xc')](_0x01d9('0x11'),_0x251eec,_0x01d9('0x13'));_0x58d9fc(_0x295ad8[_0x01d9('0x14')]['message']);}})[_0x01d9('0x15')](function(_0x3c3ce5){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x251eec,_0x3c3ce5);_0x4e768a(_0x3c3ce5);});});}exports['CreateVoiceDialReport']=function(_0x26f5fc){var _0x131681=this;return new Promise(function(_0x4930b1,_0x35de07){return db['VoiceDialReport'][_0x01d9('0x16')](_0x26f5fc[_0x01d9('0x17')],{'raw':_0x26f5fc[_0x01d9('0x18')]?_0x26f5fc[_0x01d9('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x01d9('0xb')](function(_0x219e6f){logger[_0x01d9('0xc')](_0x01d9('0x19'),_0x26f5fc);logger[_0x01d9('0xd')](_0x01d9('0x19'),_0x26f5fc,JSON[_0x01d9('0xe')](_0x219e6f));_0x4930b1(_0x219e6f);})[_0x01d9('0x15')](function(_0x388e60){logger[_0x01d9('0xf')](_0x01d9('0x19'),_0x388e60[_0x01d9('0x12')],_0x26f5fc);_0x35de07(_0x131681[_0x01d9('0xf')](0x1f4,_0x388e60[_0x01d9('0x12')]));});});};exports[_0x01d9('0x1a')]=function(_0x504afb){var _0x2a7d35=this;return new Promise(function(_0x2dab5c,_0x45ca3f){return db[_0x01d9('0x1b')][_0x01d9('0x1c')](_0x504afb[_0x01d9('0x17')],{'raw':_0x504afb['options']?_0x504afb['options'][_0x01d9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504afb['options']?_0x504afb[_0x01d9('0x18')][_0x01d9('0x1e')]||null:null,'attributes':_0x504afb[_0x01d9('0x18')]?_0x504afb[_0x01d9('0x18')][_0x01d9('0x1f')]||null:null,'limit':_0x504afb[_0x01d9('0x18')]?_0x504afb[_0x01d9('0x18')][_0x01d9('0x20')]||null:null})['then'](function(_0x2a8856){logger[_0x01d9('0xc')]('UpdateVoiceDialReport',_0x504afb);logger['debug'](_0x01d9('0x1a'),_0x504afb,JSON[_0x01d9('0xe')](_0x2a8856));_0x2dab5c(_0x2a8856);})[_0x01d9('0x15')](function(_0x8ecfae){logger['error'](_0x01d9('0x1a'),_0x8ecfae[_0x01d9('0x12')],_0x504afb);_0x45ca3f(_0x2a7d35[_0x01d9('0xf')](0x1f4,_0x8ecfae[_0x01d9('0x12')]));});});}; \ No newline at end of file +var _0x6208=['moment','../../mysqldb','rpc','../../config/environment','client','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','lodash','util'];(function(_0x408d01,_0x171389){var _0x2667c2=function(_0x504e65){while(--_0x504e65){_0x408d01['push'](_0x408d01['shift']());}};_0x2667c2(++_0x171389);}(_0x6208,0xc9));var _0x8620=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0x6208[_0x187399];return _0x40fa92;};'use strict';var _=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var moment=require(_0x8620('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8620('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8620('0x4'));var config=require(_0x8620('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8620('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x517324,_0x1e112a,_0x3ae03f){return new BPromise(function(_0x38059b,_0x5bc163){return client[_0x8620('0x7')](_0x517324,_0x3ae03f)[_0x8620('0x8')](function(_0x47beed){logger['info'](_0x8620('0x9'),_0x1e112a,_0x8620('0xa'));logger[_0x8620('0xb')](_0x8620('0xc'),_0x1e112a,_0x8620('0xa'),JSON[_0x8620('0xd')](_0x47beed));if(_0x47beed['error']){if(_0x47beed[_0x8620('0xe')][_0x8620('0xf')]===0x1f4){logger[_0x8620('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x1e112a,_0x47beed[_0x8620('0xe')]['message']);return _0x5bc163(_0x47beed['error']['message']);}logger[_0x8620('0xe')](_0x8620('0x9'),_0x1e112a,_0x47beed[_0x8620('0xe')][_0x8620('0x10')]);return _0x38059b(_0x47beed[_0x8620('0xe')][_0x8620('0x10')]);}else{logger[_0x8620('0x11')](_0x8620('0x9'),_0x1e112a,_0x8620('0xa'));_0x38059b(_0x47beed['result'][_0x8620('0x10')]);}})[_0x8620('0x12')](function(_0x1640e6){logger[_0x8620('0xe')](_0x8620('0x9'),_0x1e112a,_0x1640e6);_0x5bc163(_0x1640e6);});});}exports[_0x8620('0x13')]=function(_0x562271){var _0x248d13=this;return new Promise(function(_0x47d88b,_0x5cf8a9){return db['VoiceDialReport'][_0x8620('0x14')](_0x562271[_0x8620('0x15')],{'raw':_0x562271[_0x8620('0x16')]?_0x562271[_0x8620('0x16')][_0x8620('0x17')]===undefined?!![]:![]:!![]})[_0x8620('0x8')](function(_0x7f1d91){logger[_0x8620('0x11')](_0x8620('0x13'),_0x562271);logger[_0x8620('0xb')]('CreateVoiceDialReport',_0x562271,JSON[_0x8620('0xd')](_0x7f1d91));_0x47d88b(_0x7f1d91);})[_0x8620('0x12')](function(_0x6a078){logger['error'](_0x8620('0x13'),_0x6a078[_0x8620('0x10')],_0x562271);_0x5cf8a9(_0x248d13['error'](0x1f4,_0x6a078[_0x8620('0x10')]));});});};exports[_0x8620('0x18')]=function(_0x546b60){var _0xe9bfd3=this;return new Promise(function(_0x118068,_0x743881){return db[_0x8620('0x19')][_0x8620('0x1a')](_0x546b60[_0x8620('0x15')],{'raw':_0x546b60[_0x8620('0x16')]?_0x546b60['options'][_0x8620('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x546b60['options']?_0x546b60[_0x8620('0x16')][_0x8620('0x1b')]||null:null,'attributes':_0x546b60[_0x8620('0x16')]?_0x546b60[_0x8620('0x16')][_0x8620('0x1c')]||null:null,'limit':_0x546b60['options']?_0x546b60[_0x8620('0x16')]['limit']||null:null})[_0x8620('0x8')](function(_0x33bd15){logger[_0x8620('0x11')]('UpdateVoiceDialReport',_0x546b60);logger['debug'](_0x8620('0x18'),_0x546b60,JSON[_0x8620('0xd')](_0x33bd15));_0x118068(_0x33bd15);})[_0x8620('0x12')](function(_0x2e3d63){logger[_0x8620('0xe')]('UpdateVoiceDialReport',_0x2e3d63['message'],_0x546b60);_0x743881(_0xe9bfd3[_0x8620('0xe')](0x1f4,_0x2e3d63[_0x8620('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 9c7d64c..61a798d 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 _0x9a9c=['index','/:id','show','post','isAuthenticated','create','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x40835c,_0xba813e){var _0x11d003=function(_0x5480fe){while(--_0x5480fe){_0x40835c['push'](_0x40835c['shift']());}};_0x11d003(++_0xba813e);}(_0x9a9c,0x14e));var _0xc9a9=function(_0x5f04ed,_0x505adf){_0x5f04ed=_0x5f04ed-0x0;var _0x162e3f=_0x9a9c[_0x5f04ed];return _0x162e3f;};'use strict';var multer=require(_0xc9a9('0x0'));var util=require(_0xc9a9('0x1'));var path=require(_0xc9a9('0x2'));var timeout=require(_0xc9a9('0x3'));var express=require(_0xc9a9('0x4'));var router=express['Router']();var fs_extra=require(_0xc9a9('0x5'));var auth=require(_0xc9a9('0x6'));var interaction=require(_0xc9a9('0x7'));var config=require(_0xc9a9('0x8'));var controller=require(_0xc9a9('0x9'));router[_0xc9a9('0xa')]('/',auth['isAuthenticated'](),controller[_0xc9a9('0xb')]);router[_0xc9a9('0xa')](_0xc9a9('0xc'),auth['isAuthenticated'](),controller[_0xc9a9('0xd')]);router[_0xc9a9('0xe')]('/',auth[_0xc9a9('0xf')](),controller[_0xc9a9('0x10')]);router['post'](_0xc9a9('0x11'),auth[_0xc9a9('0xf')](),controller[_0xc9a9('0x12')]);router[_0xc9a9('0x13')](_0xc9a9('0xc'),auth[_0xc9a9('0xf')](),controller[_0xc9a9('0x14')]);router[_0xc9a9('0x15')](_0xc9a9('0xc'),auth[_0xc9a9('0xf')](),controller[_0xc9a9('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0b02=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','post','/:id/applications','addApplications','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x59c822,_0x2de041){var _0x4c3ac0=function(_0x231115){while(--_0x231115){_0x59c822['push'](_0x59c822['shift']());}};_0x4c3ac0(++_0x2de041);}(_0x0b02,0x14c));var _0x20b0=function(_0x56bd61,_0x5444e1){_0x56bd61=_0x56bd61-0x0;var _0x330e79=_0x0b02[_0x56bd61];return _0x330e79;};'use strict';var multer=require(_0x20b0('0x0'));var util=require(_0x20b0('0x1'));var path=require(_0x20b0('0x2'));var timeout=require(_0x20b0('0x3'));var express=require(_0x20b0('0x4'));var router=express['Router']();var fs_extra=require(_0x20b0('0x5'));var auth=require(_0x20b0('0x6'));var interaction=require(_0x20b0('0x7'));var config=require(_0x20b0('0x8'));var controller=require(_0x20b0('0x9'));router[_0x20b0('0xa')]('/',auth[_0x20b0('0xb')](),controller['index']);router[_0x20b0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x20b0('0xc')]);router[_0x20b0('0xd')]('/',auth[_0x20b0('0xb')](),controller['create']);router[_0x20b0('0xd')](_0x20b0('0xe'),auth[_0x20b0('0xb')](),controller[_0x20b0('0xf')]);router[_0x20b0('0x10')]('/:id',auth[_0x20b0('0xb')](),controller[_0x20b0('0x11')]);router[_0x20b0('0x12')](_0x20b0('0x13'),auth[_0x20b0('0xb')](),controller['destroy']);module[_0x20b0('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 7fe52af..15bed88 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 _0xe125=['outbound-fax','system','any','*,*,*,*','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x4baa11,_0x7c6290){var _0x219273=function(_0x4a3887){while(--_0x4a3887){_0x4baa11['push'](_0x4baa11['shift']());}};_0x219273(++_0x7c6290);}(_0xe125,0x128));var _0x5e12=function(_0x163e06,_0x4a30d6){_0x163e06=_0x163e06-0x0;var _0x15e10b=_0xe125[_0x163e06];return _0x15e10b;};'use strict';var Sequelize=require(_0x5e12('0x0'));module[_0x5e12('0x1')]={'context':{'type':Sequelize[_0x5e12('0x2')],'allowNull':![],'unique':_0x5e12('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5e12('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x5e12('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5e12('0x3')},'tag':{'type':Sequelize[_0x5e12('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5e12('0x2')],'allowNull':![],'defaultValue':_0x5e12('0x4')},'appdata':{'type':Sequelize[_0x5e12('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5e12('0x5')](_0x5e12('0x6'),_0x5e12('0x7'),_0x5e12('0x8'),_0x5e12('0x9'),_0x5e12('0xa'),_0x5e12('0xb'),_0x5e12('0xc')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5e12('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5e12('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x5e12('0x2')],'defaultValue':_0x5e12('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x5e12('0xf')],'get':function(_0x48d9ef){return this[_0x5e12('0x10')](_0x5e12('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x7b97=['BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER'];(function(_0x221045,_0x2fea83){var _0x46f32a=function(_0x4236f1){while(--_0x4236f1){_0x221045['push'](_0x221045['shift']());}};_0x46f32a(++_0x2fea83);}(_0x7b97,0x1e1));var _0x77b9=function(_0x301b5a,_0xfb349a){_0x301b5a=_0x301b5a-0x0;var _0x18badb=_0x7b97[_0x301b5a];return _0x18badb;};'use strict';var Sequelize=require('sequelize');module[_0x77b9('0x0')]={'context':{'type':Sequelize[_0x77b9('0x1')],'allowNull':![],'unique':_0x77b9('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x77b9('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x77b9('0x2')},'tag':{'type':Sequelize[_0x77b9('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x77b9('0x1')],'allowNull':![],'defaultValue':_0x77b9('0x3')},'appdata':{'type':Sequelize[_0x77b9('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x77b9('0x4')]('inbound',_0x77b9('0x5'),_0x77b9('0x6'),_0x77b9('0x7'),_0x77b9('0x8'),_0x77b9('0x9'),_0x77b9('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x77b9('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x77b9('0xb')]},'isApp':{'type':Sequelize[_0x77b9('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x77b9('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x77b9('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x77b9('0x1')],'defaultValue':_0x77b9('0xd')},'answer':{'type':Sequelize[_0x77b9('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x77b9('0xe')],'get':function(_0x3350b2){return this[_0x77b9('0xf')](_0x77b9('0x10'));}},'alias':{'type':Sequelize[_0x77b9('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index bdf7485..0329185 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 _0x5b84=['createRouting','findAndCountAll','finally','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','end','status','json','offset','limit','undefined','count','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','then','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','create','body','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5b84,0x173));var _0x45b8=function(_0x37a3a2,_0x32d6a5){_0x37a3a2=_0x37a3a2-0x0;var _0x1cf64e=_0x5b84[_0x37a3a2];return _0x1cf64e;};'use strict';var _=require('lodash');var Redis=require(_0x45b8('0x0'));var qs=require(_0x45b8('0x1'));var logger=require('../../config/logger')(_0x45b8('0x2'));var config=require(_0x45b8('0x3'));var db=require(_0x45b8('0x4'))['db'];config[_0x45b8('0x5')]=_['defaults'](config[_0x45b8('0x5')],{'host':_0x45b8('0x6'),'port':0x18eb});var socket=require(_0x45b8('0x7'))(new Redis(config[_0x45b8('0x5')]));require(_0x45b8('0x8'))[_0x45b8('0x9')](socket);function respondWithStatusCode(_0x57ff74,_0x303294){_0x303294=_0x303294||0xcc;return function(_0x4f2ff0){if(_0x4f2ff0){return _0x57ff74['sendStatus'](_0x303294);}return _0x57ff74['status'](_0x303294)[_0x45b8('0xa')]();};}function respondWithResult(_0xf3ccab,_0x593b18){_0x593b18=_0x593b18||0xc8;return function(_0xab7178){if(_0xab7178){return _0xf3ccab[_0x45b8('0xb')](_0x593b18)[_0x45b8('0xc')](_0xab7178);}};}function respondWithFilteredResult(_0x17f832,_0x3b082f){return function(_0x3a4a86){if(_0x3a4a86){var _0x3de427=typeof _0x3b082f[_0x45b8('0xd')]==='undefined'&&typeof _0x3b082f[_0x45b8('0xe')]===_0x45b8('0xf');var _0x58a36=_0x3a4a86[_0x45b8('0x10')];var _0x2c4ba9=_0x3de427?0x0:_0x3b082f[_0x45b8('0xd')];var _0x3c7bcc=_0x3de427?_0x3a4a86[_0x45b8('0x10')]:_0x3b082f[_0x45b8('0xd')]+_0x3b082f[_0x45b8('0xe')];var _0x4a2ba0;if(_0x3c7bcc>=_0x58a36){_0x3c7bcc=_0x58a36;_0x4a2ba0=0xc8;}else{_0x4a2ba0=0xce;}_0x17f832[_0x45b8('0xb')](_0x4a2ba0);return _0x17f832['set']('Content-Range',_0x2c4ba9+'-'+_0x3c7bcc+'/'+_0x58a36)[_0x45b8('0xc')](_0x3a4a86);}return null;};}function removeEntity(_0x1d905c){return function(_0x51bf31){if(_0x51bf31){return _0x51bf31['destroy']()['then'](function(){var _0x2cfda7=_0x51bf31['get']({'plain':!![]});var _0x28f082=[{'name':_0x45b8('0x11'),'value':_0x45b8('0x12'),'ignore':![]},{'name':_0x45b8('0x13'),'value':_0x45b8('0x14'),'ignore':![]},{'name':_0x45b8('0x15'),'value':_0x45b8('0x16'),'ignore':![]}];var _0x15ef1b=_(_0x28f082)['filter'](_0x45b8('0x17'))[_0x45b8('0x18')]('value')[_0x45b8('0x19')]();if(_[_0x45b8('0x1a')](_0x15ef1b,_0x2cfda7[_0x45b8('0x1b')])){return;}var _0x31fce0=_[_0x45b8('0x1c')](_0x28f082,[_0x45b8('0x19'),_0x2cfda7[_0x45b8('0x1b')]])[_0x45b8('0x1d')];return db[_0x45b8('0x1e')][_0x45b8('0x1f')]({'where':{'type':_0x31fce0,'resourceId':_0x2cfda7['id']}})[_0x45b8('0x20')](function(){return _0x51bf31;});})[_0x45b8('0x20')](function(){_0x1d905c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7e026a){return function(_0x180b22){if(!_0x180b22){_0x7e026a[_0x45b8('0x21')](0x194);}return _0x180b22;};}function handleError(_0x4984e7,_0x162bb8){_0x162bb8=_0x162bb8||0x1f4;return function(_0x4ae6ed){logger[_0x45b8('0x22')](_0x4ae6ed[_0x45b8('0x23')]);if(_0x4ae6ed[_0x45b8('0x1d')]){delete _0x4ae6ed[_0x45b8('0x1d')];}_0x4984e7[_0x45b8('0xb')](_0x162bb8)[_0x45b8('0x24')](_0x4ae6ed);};}exports[_0x45b8('0x25')]=function(_0x1efc5b,_0x2796ff){var _0x523bda={},_0x23d551={},_0x5c69c3={'count':0x0,'rows':[]};var _0x427701=_[_0x45b8('0x18')](db[_0x45b8('0x26')][_0x45b8('0x27')],function(_0x3f9ba1){return{'name':_0x3f9ba1[_0x45b8('0x28')],'type':_0x3f9ba1[_0x45b8('0x1b')][_0x45b8('0x29')]};});_0x23d551[_0x45b8('0x2a')]=_[_0x45b8('0x18')](_0x427701,_0x45b8('0x1d'));_0x23d551['query']=_['keys'](_0x1efc5b[_0x45b8('0x2b')]);_0x23d551[_0x45b8('0x2c')]=_[_0x45b8('0x2d')](_0x23d551[_0x45b8('0x2a')],_0x23d551[_0x45b8('0x2b')]);_0x523bda[_0x45b8('0x2e')]=_['intersection'](_0x23d551[_0x45b8('0x2a')],qs['fields'](_0x1efc5b[_0x45b8('0x2b')]['fields']));_0x523bda['attributes']=_0x523bda[_0x45b8('0x2e')][_0x45b8('0x2f')]?_0x523bda[_0x45b8('0x2e')]:_0x23d551['model'];if(!_0x1efc5b[_0x45b8('0x2b')]['hasOwnProperty'](_0x45b8('0x30'))){_0x523bda['limit']=qs[_0x45b8('0xe')](_0x1efc5b['query'][_0x45b8('0xe')]);_0x523bda[_0x45b8('0xd')]=qs[_0x45b8('0xd')](_0x1efc5b[_0x45b8('0x2b')][_0x45b8('0xd')]);}_0x523bda[_0x45b8('0x31')]=qs['sort'](_0x1efc5b[_0x45b8('0x2b')]['sort']);_0x523bda[_0x45b8('0x32')]=qs[_0x45b8('0x2c')](_[_0x45b8('0x33')](_0x1efc5b[_0x45b8('0x2b')],_0x23d551['filters']),_0x427701);if(_0x1efc5b[_0x45b8('0x2b')][_0x45b8('0x34')]){_0x523bda['where']=_[_0x45b8('0x35')](_0x523bda[_0x45b8('0x32')],{'$or':_[_0x45b8('0x18')](_0x427701,function(_0x43c447){if(_0x43c447[_0x45b8('0x1b')]!==_0x45b8('0x36')){var _0x13613c={};_0x13613c[_0x43c447['name']]={'$like':'%'+_0x1efc5b[_0x45b8('0x2b')][_0x45b8('0x34')]+'%'};return _0x13613c;}})});}_0x523bda=_[_0x45b8('0x35')]({},_0x523bda,_0x1efc5b[_0x45b8('0x37')]);var _0x27beee={'where':_0x523bda[_0x45b8('0x32')]};return db['VoiceExtension'][_0x45b8('0x10')](_0x27beee)[_0x45b8('0x20')](function(_0x1f5b51){_0x5c69c3[_0x45b8('0x10')]=_0x1f5b51;if(_0x1efc5b[_0x45b8('0x2b')][_0x45b8('0x38')]){_0x523bda[_0x45b8('0x39')]=[{'all':!![]}];}return db['VoiceExtension'][_0x45b8('0x3a')](_0x523bda);})['then'](function(_0x12513c){_0x5c69c3[_0x45b8('0x3b')]=_0x12513c;return _0x5c69c3;})[_0x45b8('0x20')](respondWithFilteredResult(_0x2796ff,_0x523bda))[_0x45b8('0x3c')](handleError(_0x2796ff,null));};exports[_0x45b8('0x3d')]=function(_0x1928fa,_0x1eb931){var _0x3dff5c={'raw':![],'where':{'id':_0x1928fa[_0x45b8('0x3e')]['id']}},_0x27406e={};_0x27406e[_0x45b8('0x2a')]=_[_0x45b8('0x3f')](db[_0x45b8('0x26')][_0x45b8('0x27')]);_0x27406e[_0x45b8('0x2b')]=_['keys'](_0x1928fa[_0x45b8('0x2b')]);_0x27406e[_0x45b8('0x2c')]=_[_0x45b8('0x2d')](_0x27406e['model'],_0x27406e['query']);_0x3dff5c[_0x45b8('0x2e')]=_['intersection'](_0x27406e[_0x45b8('0x2a')],qs[_0x45b8('0x40')](_0x1928fa[_0x45b8('0x2b')][_0x45b8('0x40')]));_0x3dff5c[_0x45b8('0x2e')]=_0x3dff5c[_0x45b8('0x2e')]['length']?_0x3dff5c[_0x45b8('0x2e')]:_0x27406e[_0x45b8('0x2a')];if(_0x1928fa[_0x45b8('0x2b')]['includeAll']){_0x3dff5c[_0x45b8('0x39')]=[{'all':!![]}];}_0x3dff5c=_[_0x45b8('0x35')]({},_0x3dff5c,_0x1928fa[_0x45b8('0x37')]);return db['VoiceExtension'][_0x45b8('0x1c')](_0x3dff5c)[_0x45b8('0x20')](handleEntityNotFound(_0x1eb931,null))[_0x45b8('0x20')](respondWithResult(_0x1eb931,null))[_0x45b8('0x3c')](handleError(_0x1eb931,null));};exports[_0x45b8('0x1f')]=function(_0x47a9db,_0xb2fffd){return db[_0x45b8('0x26')][_0x45b8('0x1c')]({'where':{'id':_0x47a9db[_0x45b8('0x3e')]['id']}})[_0x45b8('0x20')](handleEntityNotFound(_0xb2fffd,null))['then'](removeEntity(_0xb2fffd,null))['catch'](handleError(_0xb2fffd,null));};exports[_0x45b8('0x41')]=function(_0x381204,_0x415a99){if(_0x381204[_0x45b8('0x42')][_0x45b8('0x1b')]===_0x45b8('0x14')&&!_[_0x45b8('0x43')](_0x381204[_0x45b8('0x42')][_0x45b8('0x44')],'_')){_0x381204['body'][_0x45b8('0x44')]='_'[_0x45b8('0x45')](_0x381204[_0x45b8('0x42')][_0x45b8('0x44')]);}return db[_0x45b8('0x26')][_0x45b8('0x41')](_0x381204[_0x45b8('0x42')],{'raw':![]})[_0x45b8('0x20')](function(_0x1711eb){var _0x37716a=_0x381204[_0x45b8('0x46')][_0x45b8('0x47')]({'plain':!![]});if(!_0x37716a)throw new Error(_0x45b8('0x48'));if(_0x37716a[_0x45b8('0x49')]===_0x45b8('0x46')){var _0xa04f7d=_0x1711eb[_0x45b8('0x47')]({'plain':!![]});var _0x373b63=[{'name':'InboundRoutes','value':_0x45b8('0x12')},{'name':_0x45b8('0x13'),'value':_0x45b8('0x14')},{'name':_0x45b8('0x15'),'value':_0x45b8('0x16')}];var _0x27d2c2=_[_0x45b8('0x1c')](_0x373b63,['value',_0xa04f7d[_0x45b8('0x1b')]])['name'];return db['UserProfileSection'][_0x45b8('0x1c')]({'where':{'name':_0x27d2c2,'userProfileId':_0x37716a[_0x45b8('0x4a')]},'raw':!![]})[_0x45b8('0x20')](function(_0x2aff80){if(_0x2aff80&&_0x2aff80['autoAssociation']===0x0){return db['UserProfileResource'][_0x45b8('0x41')]({'name':_0xa04f7d[_0x45b8('0x1d')],'resourceId':_0xa04f7d['id'],'type':_0x2aff80[_0x45b8('0x1d')],'sectionId':_0x2aff80['id']},{})[_0x45b8('0x20')](function(){return _0x1711eb;});}else{return _0x1711eb;}})[_0x45b8('0x3c')](function(_0x4b79f4){logger[_0x45b8('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b79f4);throw _0x4b79f4;});}return _0x1711eb;})['then'](respondWithResult(_0x415a99,0xc9))[_0x45b8('0x3c')](handleError(_0x415a99,null));};exports[_0x45b8('0x4b')]=function(_0x292ba0,_0xa59e52){if(_0x292ba0[_0x45b8('0x42')]['id']){delete _0x292ba0[_0x45b8('0x42')]['id'];}return db[_0x45b8('0x26')][_0x45b8('0x1c')]({'where':{'id':_0x292ba0[_0x45b8('0x3e')]['id']}})[_0x45b8('0x20')](handleEntityNotFound(_0xa59e52,null))[_0x45b8('0x20')](function(_0x4d4ddd){if(_0x4d4ddd){return db['VoiceExtension'][_0x45b8('0x4b')](_[_0x45b8('0x33')](_0x292ba0[_0x45b8('0x42')],[_0x45b8('0x44'),'context',_0x45b8('0x4c'),_0x45b8('0x4d'),_0x45b8('0x4e'),_0x45b8('0x4f'),_0x45b8('0x50')]),{'where':{'context':_0x4d4ddd[_0x45b8('0x51')],'exten':_0x4d4ddd[_0x45b8('0x44')]},'individualHooks':!![]})['then'](function(_0x5a74d0){return _0x5a74d0;});}return null;})[_0x45b8('0x20')](respondWithStatusCode(_0xa59e52,null))[_0x45b8('0x3c')](handleError(_0xa59e52,null));};exports[_0x45b8('0x52')]=function(_0x454345,_0x51f1fb){var _0x29c440=_0x454345['params']['id'];var _0x3daafb=_0x454345['body'];var _0xa4c8=0xc8;var _0x4d938c=null;return db[_0x45b8('0x53')][_0x45b8('0x54')]({'isolationLevel':db[_0x45b8('0x53')]['Transaction'][_0x45b8('0x55')][_0x45b8('0x56')]},function(_0x418f7e){return db[_0x45b8('0x26')][_0x45b8('0x57')]({'where':{'id':_0x29c440},'transaction':_0x418f7e})['then'](function(_0xd90049){if(_0xd90049){return db[_0x45b8('0x26')][_0x45b8('0x1f')]({'where':{'VoiceExtensionId':_0x29c440},'transaction':_0x418f7e})['then'](function(){var _0x2e57a7=_[_0x45b8('0x18')](_0x3daafb,function(_0x11a1ee){_0x11a1ee[_0x45b8('0x58')]=_0x29c440;_0x11a1ee['isApp']=!![];return _0x11a1ee;});return _0xd90049[_0x45b8('0x59')](_0x2e57a7);})[_0x45b8('0x20')](function(_0x5489cc){return db['VoiceExtension']['bulkCreate'](_0x5489cc,{'transaction':_0x418f7e});});}else{_0xa4c8=0x194;_0x4d938c=[];}});})['then'](function(){if(_0xa4c8!==0x194){return db[_0x45b8('0x26')][_0x45b8('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x29c440},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x1ac85f){_0x4d938c=_0x1ac85f;});}})[_0x45b8('0x3c')](function(_0x58066d){_0xa4c8=0x1f4;logger[_0x45b8('0x22')](_0x58066d['stack']);if(_0x58066d[_0x45b8('0x1d')]){delete _0x58066d[_0x45b8('0x1d')];}_0x4d938c=_0x58066d;})[_0x45b8('0x5b')](function(){if(_0x4d938c===null){_0x51f1fb[_0x45b8('0x21')](_0xa4c8);}else{if(_0xa4c8===0x1f4){_0x51f1fb[_0x45b8('0xb')](_0xa4c8)[_0x45b8('0x24')](_0x4d938c);}else{_0x51f1fb['status'](_0xa4c8)[_0x45b8('0xc')](_0x4d938c);}}});}; \ No newline at end of file +var _0xa124=['params','includeAll','options','find','catch','create','body','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','InternalRoutes','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','json','offset','undefined','limit','count','status','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','filter','ignore','map','value','name','error','send','index','VoiceExtension','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','include','rows','show'];(function(_0x399c0a,_0xc97d0d){var _0x2c7846=function(_0xc7a64f){while(--_0xc7a64f){_0x399c0a['push'](_0x399c0a['shift']());}};_0x2c7846(++_0xc97d0d);}(_0xa124,0x126));var _0x4a12=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0xa124[_0x34bc94];return _0xee41e7;};'use strict';var _=require(_0x4a12('0x0'));var Redis=require(_0x4a12('0x1'));var qs=require(_0x4a12('0x2'));var logger=require(_0x4a12('0x3'))(_0x4a12('0x4'));var config=require(_0x4a12('0x5'));var db=require('../../mysqldb')['db'];config[_0x4a12('0x6')]=_[_0x4a12('0x7')](config['redis'],{'host':_0x4a12('0x8'),'port':0x18eb});var socket=require(_0x4a12('0x9'))(new Redis(config['redis']));require(_0x4a12('0xa'))['register'](socket);function respondWithStatusCode(_0x207538,_0x4ffabb){_0x4ffabb=_0x4ffabb||0xcc;return function(_0x475308){if(_0x475308){return _0x207538[_0x4a12('0xb')](_0x4ffabb);}return _0x207538['status'](_0x4ffabb)[_0x4a12('0xc')]();};}function respondWithResult(_0x1ee02c,_0x4556b7){_0x4556b7=_0x4556b7||0xc8;return function(_0x2169f7){if(_0x2169f7){return _0x1ee02c['status'](_0x4556b7)[_0x4a12('0xd')](_0x2169f7);}};}function respondWithFilteredResult(_0x2331c8,_0xf3040d){return function(_0x4198d3){if(_0x4198d3){var _0x5646b6=typeof _0xf3040d[_0x4a12('0xe')]===_0x4a12('0xf')&&typeof _0xf3040d[_0x4a12('0x10')]===_0x4a12('0xf');var _0x54a294=_0x4198d3[_0x4a12('0x11')];var _0x3b90f3=_0x5646b6?0x0:_0xf3040d[_0x4a12('0xe')];var _0x420f13=_0x5646b6?_0x4198d3[_0x4a12('0x11')]:_0xf3040d['offset']+_0xf3040d[_0x4a12('0x10')];var _0x540e24;if(_0x420f13>=_0x54a294){_0x420f13=_0x54a294;_0x540e24=0xc8;}else{_0x540e24=0xce;}_0x2331c8[_0x4a12('0x12')](_0x540e24);return _0x2331c8['set']('Content-Range',_0x3b90f3+'-'+_0x420f13+'/'+_0x54a294)['json'](_0x4198d3);}return null;};}function removeEntity(_0x25c57f){return function(_0x191305){if(_0x191305){return _0x191305[_0x4a12('0x13')]()[_0x4a12('0x14')](function(){var _0x17236a=_0x191305['get']({'plain':!![]});var _0x2b25c1=[{'name':_0x4a12('0x15'),'value':_0x4a12('0x16'),'ignore':![]},{'name':_0x4a12('0x17'),'value':_0x4a12('0x18'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x53e375=_(_0x2b25c1)[_0x4a12('0x19')](_0x4a12('0x1a'))[_0x4a12('0x1b')]('value')['value']();if(_['includes'](_0x53e375,_0x17236a['type'])){return;}var _0x1ab44d=_['find'](_0x2b25c1,[_0x4a12('0x1c'),_0x17236a['type']])[_0x4a12('0x1d')];return db['UserProfileResource'][_0x4a12('0x13')]({'where':{'type':_0x1ab44d,'resourceId':_0x17236a['id']}})[_0x4a12('0x14')](function(){return _0x191305;});})[_0x4a12('0x14')](function(){_0x25c57f[_0x4a12('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ed91b){return function(_0x6159ad){if(!_0x6159ad){_0x4ed91b[_0x4a12('0xb')](0x194);}return _0x6159ad;};}function handleError(_0x4a1248,_0xb468db){_0xb468db=_0xb468db||0x1f4;return function(_0x42a465){logger[_0x4a12('0x1e')](_0x42a465['stack']);if(_0x42a465['name']){delete _0x42a465[_0x4a12('0x1d')];}_0x4a1248[_0x4a12('0x12')](_0xb468db)[_0x4a12('0x1f')](_0x42a465);};}exports[_0x4a12('0x20')]=function(_0x345110,_0x51c83f){var _0x22cd61={},_0x52476c={},_0x513db9={'count':0x0,'rows':[]};var _0x10e8b4=_[_0x4a12('0x1b')](db[_0x4a12('0x21')][_0x4a12('0x22')],function(_0x812024){return{'name':_0x812024['fieldName'],'type':_0x812024[_0x4a12('0x23')][_0x4a12('0x24')]};});_0x52476c[_0x4a12('0x25')]=_[_0x4a12('0x1b')](_0x10e8b4,'name');_0x52476c[_0x4a12('0x26')]=_[_0x4a12('0x27')](_0x345110[_0x4a12('0x26')]);_0x52476c[_0x4a12('0x28')]=_['intersection'](_0x52476c[_0x4a12('0x25')],_0x52476c[_0x4a12('0x26')]);_0x22cd61[_0x4a12('0x29')]=_[_0x4a12('0x2a')](_0x52476c[_0x4a12('0x25')],qs[_0x4a12('0x2b')](_0x345110[_0x4a12('0x26')][_0x4a12('0x2b')]));_0x22cd61['attributes']=_0x22cd61[_0x4a12('0x29')]['length']?_0x22cd61['attributes']:_0x52476c['model'];if(!_0x345110[_0x4a12('0x26')][_0x4a12('0x2c')](_0x4a12('0x2d'))){_0x22cd61[_0x4a12('0x10')]=qs[_0x4a12('0x10')](_0x345110[_0x4a12('0x26')][_0x4a12('0x10')]);_0x22cd61[_0x4a12('0xe')]=qs[_0x4a12('0xe')](_0x345110['query'][_0x4a12('0xe')]);}_0x22cd61['order']=qs['sort'](_0x345110['query'][_0x4a12('0x2e')]);_0x22cd61[_0x4a12('0x2f')]=qs[_0x4a12('0x28')](_[_0x4a12('0x30')](_0x345110[_0x4a12('0x26')],_0x52476c[_0x4a12('0x28')]),_0x10e8b4);if(_0x345110[_0x4a12('0x26')][_0x4a12('0x19')]){_0x22cd61[_0x4a12('0x2f')]=_[_0x4a12('0x31')](_0x22cd61['where'],{'$or':_[_0x4a12('0x1b')](_0x10e8b4,function(_0x448ffb){if(_0x448ffb['type']!==_0x4a12('0x32')){var _0xbcdb42={};_0xbcdb42[_0x448ffb[_0x4a12('0x1d')]]={'$like':'%'+_0x345110['query'][_0x4a12('0x19')]+'%'};return _0xbcdb42;}})});}_0x22cd61=_[_0x4a12('0x31')]({},_0x22cd61,_0x345110['options']);var _0x156a21={'where':_0x22cd61[_0x4a12('0x2f')]};return db[_0x4a12('0x21')][_0x4a12('0x11')](_0x156a21)[_0x4a12('0x14')](function(_0x1d94bf){_0x513db9[_0x4a12('0x11')]=_0x1d94bf;if(_0x345110['query']['includeAll']){_0x22cd61[_0x4a12('0x33')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x22cd61);})['then'](function(_0x48688c){_0x513db9[_0x4a12('0x34')]=_0x48688c;return _0x513db9;})[_0x4a12('0x14')](respondWithFilteredResult(_0x51c83f,_0x22cd61))['catch'](handleError(_0x51c83f,null));};exports[_0x4a12('0x35')]=function(_0x225d35,_0x3f58ca){var _0x2603f1={'raw':![],'where':{'id':_0x225d35[_0x4a12('0x36')]['id']}},_0x2b3798={};_0x2b3798[_0x4a12('0x25')]=_[_0x4a12('0x27')](db['VoiceExtension']['rawAttributes']);_0x2b3798[_0x4a12('0x26')]=_[_0x4a12('0x27')](_0x225d35[_0x4a12('0x26')]);_0x2b3798[_0x4a12('0x28')]=_['intersection'](_0x2b3798[_0x4a12('0x25')],_0x2b3798[_0x4a12('0x26')]);_0x2603f1[_0x4a12('0x29')]=_['intersection'](_0x2b3798[_0x4a12('0x25')],qs[_0x4a12('0x2b')](_0x225d35[_0x4a12('0x26')][_0x4a12('0x2b')]));_0x2603f1[_0x4a12('0x29')]=_0x2603f1[_0x4a12('0x29')]['length']?_0x2603f1['attributes']:_0x2b3798['model'];if(_0x225d35[_0x4a12('0x26')][_0x4a12('0x37')]){_0x2603f1[_0x4a12('0x33')]=[{'all':!![]}];}_0x2603f1=_[_0x4a12('0x31')]({},_0x2603f1,_0x225d35[_0x4a12('0x38')]);return db['VoiceExtension'][_0x4a12('0x39')](_0x2603f1)[_0x4a12('0x14')](handleEntityNotFound(_0x3f58ca,null))[_0x4a12('0x14')](respondWithResult(_0x3f58ca,null))[_0x4a12('0x3a')](handleError(_0x3f58ca,null));};exports['destroy']=function(_0x32e5e9,_0x39de4c){return db['VoiceExtension']['find']({'where':{'id':_0x32e5e9[_0x4a12('0x36')]['id']}})['then'](handleEntityNotFound(_0x39de4c,null))['then'](removeEntity(_0x39de4c,null))[_0x4a12('0x3a')](handleError(_0x39de4c,null));};exports[_0x4a12('0x3b')]=function(_0x98ad6b,_0x53e599){if(_0x98ad6b[_0x4a12('0x3c')][_0x4a12('0x23')]==='outbound'&&!_['startsWith'](_0x98ad6b[_0x4a12('0x3c')][_0x4a12('0x3d')],'_')){_0x98ad6b[_0x4a12('0x3c')][_0x4a12('0x3d')]='_'['concat'](_0x98ad6b['body'][_0x4a12('0x3d')]);}return db[_0x4a12('0x21')][_0x4a12('0x3b')](_0x98ad6b[_0x4a12('0x3c')],{'raw':![]})[_0x4a12('0x14')](function(_0x18f6f3){var _0x45ba15=_0x98ad6b[_0x4a12('0x3e')][_0x4a12('0x3f')]({'plain':!![]});if(!_0x45ba15)throw new Error(_0x4a12('0x40'));if(_0x45ba15['role']===_0x4a12('0x3e')){var _0x1e5a52=_0x18f6f3[_0x4a12('0x3f')]({'plain':!![]});var _0x4e8d28=[{'name':_0x4a12('0x15'),'value':'inbound'},{'name':_0x4a12('0x17'),'value':_0x4a12('0x18')},{'name':_0x4a12('0x41'),'value':'internal'}];var _0x1389bc=_['find'](_0x4e8d28,[_0x4a12('0x1c'),_0x1e5a52[_0x4a12('0x23')]])[_0x4a12('0x1d')];return db[_0x4a12('0x42')][_0x4a12('0x39')]({'where':{'name':_0x1389bc,'userProfileId':_0x45ba15['userProfileId']},'raw':!![]})[_0x4a12('0x14')](function(_0x55d4ef){if(_0x55d4ef&&_0x55d4ef[_0x4a12('0x43')]===0x0){return db[_0x4a12('0x44')][_0x4a12('0x3b')]({'name':_0x1e5a52[_0x4a12('0x1d')],'resourceId':_0x1e5a52['id'],'type':_0x55d4ef[_0x4a12('0x1d')],'sectionId':_0x55d4ef['id']},{})[_0x4a12('0x14')](function(){return _0x18f6f3;});}else{return _0x18f6f3;}})[_0x4a12('0x3a')](function(_0x2fa207){logger[_0x4a12('0x1e')](_0x4a12('0x45'),_0x2fa207);throw _0x2fa207;});}return _0x18f6f3;})[_0x4a12('0x14')](respondWithResult(_0x53e599,0xc9))[_0x4a12('0x3a')](handleError(_0x53e599,null));};exports[_0x4a12('0x46')]=function(_0x11e6c1,_0x32131f){if(_0x11e6c1[_0x4a12('0x3c')]['id']){delete _0x11e6c1[_0x4a12('0x3c')]['id'];}return db[_0x4a12('0x21')][_0x4a12('0x39')]({'where':{'id':_0x11e6c1['params']['id']}})[_0x4a12('0x14')](handleEntityNotFound(_0x32131f,null))['then'](function(_0x51c0fb){if(_0x51c0fb){return db[_0x4a12('0x21')][_0x4a12('0x46')](_['pick'](_0x11e6c1[_0x4a12('0x3c')],[_0x4a12('0x3d'),_0x4a12('0x47'),_0x4a12('0x48'),_0x4a12('0x49'),_0x4a12('0x4a'),'mandatoryDisposition',_0x4a12('0x4b')]),{'where':{'context':_0x51c0fb[_0x4a12('0x47')],'exten':_0x51c0fb[_0x4a12('0x3d')]},'individualHooks':!![]})['then'](function(_0x13d06a){return _0x13d06a;});}return null;})[_0x4a12('0x14')](respondWithStatusCode(_0x32131f,null))[_0x4a12('0x3a')](handleError(_0x32131f,null));};exports[_0x4a12('0x4c')]=function(_0x3549bf,_0x5afea1){var _0x512ded=_0x3549bf[_0x4a12('0x36')]['id'];var _0xf35dca=_0x3549bf[_0x4a12('0x3c')];var _0x30f7de=0xc8;var _0x557b3a=null;return db[_0x4a12('0x4d')]['transaction']({'isolationLevel':db[_0x4a12('0x4d')]['Transaction']['ISOLATION_LEVELS'][_0x4a12('0x4e')]},function(_0x207882){return db['VoiceExtension'][_0x4a12('0x4f')]({'where':{'id':_0x512ded},'transaction':_0x207882})[_0x4a12('0x14')](function(_0x2a8608){if(_0x2a8608){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x512ded},'transaction':_0x207882})[_0x4a12('0x14')](function(){var _0x31dfb5=_[_0x4a12('0x1b')](_0xf35dca,function(_0x3be1d1){_0x3be1d1[_0x4a12('0x50')]=_0x512ded;_0x3be1d1[_0x4a12('0x51')]=!![];return _0x3be1d1;});return _0x2a8608[_0x4a12('0x52')](_0x31dfb5);})[_0x4a12('0x14')](function(_0x164986){return db[_0x4a12('0x21')][_0x4a12('0x53')](_0x164986,{'transaction':_0x207882});});}else{_0x30f7de=0x194;_0x557b3a=[];}});})[_0x4a12('0x14')](function(){if(_0x30f7de!==0x194){return db[_0x4a12('0x21')][_0x4a12('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x512ded},'order':'cast(priority\x20as\x20unsigned)'})[_0x4a12('0x14')](function(_0x4c223a){_0x557b3a=_0x4c223a;});}})['catch'](function(_0x277aa3){_0x30f7de=0x1f4;logger[_0x4a12('0x1e')](_0x277aa3[_0x4a12('0x55')]);if(_0x277aa3[_0x4a12('0x1d')]){delete _0x277aa3['name'];}_0x557b3a=_0x277aa3;})[_0x4a12('0x56')](function(){if(_0x557b3a===null){_0x5afea1[_0x4a12('0xb')](_0x30f7de);}else{if(_0x30f7de===0x1f4){_0x5afea1[_0x4a12('0x12')](_0x30f7de)['send'](_0x557b3a);}else{_0x5afea1['status'](_0x30f7de)['json'](_0x557b3a);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index fadab82..2ff4ba6 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 _0x9009=['exports','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x40d1ba,_0x3cb77c){var _0x565261=function(_0x1a5b54){while(--_0x1a5b54){_0x40d1ba['push'](_0x40d1ba['shift']());}};_0x565261(++_0x3cb77c);}(_0x9009,0x184));var _0x9900=function(_0x3beb8d,_0x411eec){_0x3beb8d=_0x3beb8d-0x0;var _0x2bde56=_0x9009[_0x3beb8d];return _0x2bde56;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9900('0x0'))['db'][_0x9900('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9900('0x2'),'afterUpdate':_0x9900('0x3'),'afterDestroy':_0x9900('0x4')};function emitEvent(_0xfe2f85){return function(_0x2e23a6,_0x496b0b,_0x57c7df){VoiceExtensionEvents['emit'](_0xfe2f85+':'+_0x2e23a6['id'],_0x2e23a6);VoiceExtensionEvents[_0x9900('0x5')](_0xfe2f85,_0x2e23a6);_0x57c7df(null);};}for(var e in events){if(events[_0x9900('0x6')](e)){var event=events[e];VoiceExtension[_0x9900('0x7')](e,emitEvent(event));}}module[_0x9900('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xfd5d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x369bb3,_0x4edd73){var _0x2e0cdb=function(_0x3471ff){while(--_0x3471ff){_0x369bb3['push'](_0x369bb3['shift']());}};_0x2e0cdb(++_0x4edd73);}(_0xfd5d,0x179));var _0xdfd5=function(_0x552284,_0x4ddb09){_0x552284=_0x552284-0x0;var _0x4ac092=_0xfd5d[_0x552284];return _0x4ac092;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xdfd5('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdfd5('0x1')](0x0);var events={'afterCreate':_0xdfd5('0x2'),'afterUpdate':_0xdfd5('0x3'),'afterDestroy':_0xdfd5('0x4')};function emitEvent(_0x55e27d){return function(_0x3fdbeb,_0xbcba52,_0x6ad248){VoiceExtensionEvents['emit'](_0x55e27d+':'+_0x3fdbeb['id'],_0x3fdbeb);VoiceExtensionEvents[_0xdfd5('0x5')](_0x55e27d,_0x3fdbeb);_0x6ad248(null);};}for(var e in events){if(events[_0xdfd5('0x6')](e)){var event=events[e];VoiceExtension[_0xdfd5('0x7')](e,emitEvent(event));}}module[_0xdfd5('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 b8a7036..2997fd8 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 _0xf534=['Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','then','intervals','IntervalId','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type'];(function(_0x4fbc87,_0x157ab8){var _0x156e5a=function(_0x11d44e){while(--_0x11d44e){_0x4fbc87['push'](_0x4fbc87['shift']());}};_0x156e5a(++_0x157ab8);}(_0xf534,0x9a));var _0x4f53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf534[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4f53('0x0'));var attributes=require(_0x4f53('0x1'));module['exports']=function(_0x149113){var _0x50a0a3=_0x149113[_0x4f53('0x2')];function _0x499965(_0x32ba25){var _0xc35145=0x2;var _0x1fd3d2=[{'type':_0x32ba25[_0x4f53('0x3')],'app':_0x4f53('0x4'),'appdata':_0x4f53('0x5')+_0x32ba25[_0x4f53('0x3')],'context':_0x32ba25['context'],'exten':_0x32ba25[_0x4f53('0x6')],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']},{'type':_0x32ba25['type'],'app':_0x32ba25[_0x4f53('0x7')]?_0x4f53('0x4'):_0x4f53('0x8'),'appdata':_0x32ba25[_0x4f53('0x7')]?_0x4f53('0x9')+_0x32ba25[_0x4f53('0x7')]:_0x4f53('0xa'),'context':_0x32ba25[_0x4f53('0xb')],'exten':_0x32ba25['exten'],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']}];if(_0x32ba25[_0x4f53('0x3')]===_0x4f53('0xc')){_0x1fd3d2[_0x4f53('0xd')]({'type':_0x4f53('0xc'),'app':'Set','appdata':_0x4f53('0xe')+_0x32ba25['id'],'context':_0x32ba25[_0x4f53('0xb')],'exten':_0x32ba25[_0x4f53('0x6')],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']});}_0x1fd3d2['push']({'type':_0x32ba25[_0x4f53('0x3')],'app':_0x4f53('0x4'),'appdata':_0x4f53('0xf'),'context':_0x32ba25[_0x4f53('0xb')],'exten':_0x32ba25[_0x4f53('0x6')],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']},{'type':_0x32ba25['type'],'app':_0x4f53('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x32ba25[_0x4f53('0xb')],'exten':_0x32ba25[_0x4f53('0x6')],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']},{'type':_0x32ba25[_0x4f53('0x3')],'app':_0x4f53('0x4'),'appdata':_0x4f53('0x10'),'context':_0x32ba25['context'],'exten':_0x32ba25['exten'],'priority':_0xc35145++,'VoiceExtensionId':_0x32ba25['id']});return _0x1fd3d2;}function _0x50a841(_0x325ff0){var _0xadc447=0x2;var _0x4f3932=[{'type':_0x4f53('0x11'),'app':_0x4f53('0x4'),'appdata':'CDR(type)=outbound','context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':_0x325ff0[_0x4f53('0x7')]?'Set':_0x4f53('0x8'),'appdata':_0x325ff0[_0x4f53('0x7')]?_0x4f53('0x9')+_0x325ff0[_0x4f53('0x7')]:_0x4f53('0xa'),'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':'Set','appdata':_0x4f53('0x12')+(_0x325ff0[_0x4f53('0x13')]?'${EXTEN:'+_0x325ff0[_0x4f53('0x13')]+'}':_0x4f53('0x14')),'context':_0x325ff0['context'],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':'outbound','app':_0x4f53('0x4'),'appdata':_0x4f53('0xe')+_0x325ff0['id'],'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':_0x4f53('0x15'),'appdata':_0x4f53('0x16')+(_0xadc447+0x2)+_0x4f53('0x17')+(_0xadc447+0x1)+')','context':_0x325ff0['context'],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':_0x4f53('0x4'),'appdata':_0x325ff0[_0x4f53('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x325ff0['cutdigits']+'}':_0x4f53('0x18'),'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':_0x4f53('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x325ff0['context'],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':'outbound','app':_0x4f53('0x4'),'appdata':_0x4f53('0x19'),'context':_0x325ff0['context'],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':'Set','appdata':_0x4f53('0x10'),'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':'outbound','app':_0x4f53('0x4'),'appdata':_0x4f53('0x1a')+_0x325ff0['id'],'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']}];if(_0x325ff0[_0x4f53('0x1b')](_0x4f53('0x1c'))&&_0x325ff0[_0x4f53('0x1c')]!==_0x4f53('0x1d')){_0x4f3932[_0x4f53('0xd')]({'type':'outbound','app':_0x4f53('0x4'),'appdata':_0x4f53('0x1e'),'context':_0x325ff0['context'],'exten':_0x325ff0['exten'],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']},{'type':_0x4f53('0x11'),'app':_0x4f53('0x4'),'appdata':_0x4f53('0x1f')+_0x325ff0[_0x4f53('0x1c')]||_0x4f53('0x20'),'context':_0x325ff0[_0x4f53('0xb')],'exten':_0x325ff0[_0x4f53('0x6')],'priority':_0xadc447++,'VoiceExtensionId':_0x325ff0['id']});}return _0x4f3932;}function _0x32898f(_0x399d90,_0x59d490){var _0x5b356c=[{'name':_0x4f53('0x21'),'param':0x0},{'name':_0x4f53('0x22'),'param':0x1},{'name':_0x4f53('0x23'),'param':0x2},{'name':_0x4f53('0x24'),'param':0x3}];var _0x2d3068={};var _0x4543ba=_0x59d490[_0x4f53('0x25')](',');var _0x11d86f=[];for(var _0x1db797=0x0;_0x1db797<_0x5b356c[_0x4f53('0x26')];_0x1db797++){switch(_0x5b356c[_0x1db797][_0x4f53('0x27')]){case _0x4f53('0x21'):_0x2d3068[_0x4f53('0x21')]=_0x4543ba[_0x5b356c[_0x1db797][_0x4f53('0x28')]][_0x4f53('0x25')]('/')[0x1];_0x2d3068[_0x4f53('0x29')]=_0x4543ba[_0x5b356c[_0x1db797]['param']][_0x4f53('0x25')]('/')[0x2];_0x2d3068[_0x4f53('0x2a')]=_0x2d3068[_0x4f53('0x29')]?_0x2d3068[_0x4f53('0x29')][_0x4f53('0x25')]('$')[0x0]:undefined;_0x2d3068[_0x4f53('0x29')]=_0x399d90[_0x4f53('0x13')]?(_0x2d3068[_0x4f53('0x2a')]||'')+'${EXTEN:'+_0x399d90[_0x4f53('0x13')]+'}':(_0x2d3068[_0x4f53('0x2a')]||'')+_0x4f53('0x14');_0x11d86f[_0x5b356c[_0x1db797][_0x4f53('0x28')]]=[_0x4f53('0x2b'),_0x2d3068['trunk'],_0x2d3068[_0x4f53('0x29')]][_0x4f53('0x2c')]('/');break;case _0x4f53('0x23'):_0x2d3068[_0x4f53('0x23')]=_0x4543ba[_0x5b356c[_0x1db797][_0x4f53('0x28')]];if(_0x399d90[_0x4f53('0x1c')]!=='none'){if(_0x2d3068[_0x4f53('0x23')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x2d3068[_0x4f53('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x2d3068[_0x4f53('0x23')]=_0x2d3068['options']['replace'](_0x4f53('0x2d'),'');}_0x11d86f[_0x5b356c[_0x1db797]['param']]=_0x2d3068[_0x4f53('0x23')];break;default:_0x11d86f[_0x5b356c[_0x1db797]['param']]=_0x4543ba[_0x5b356c[_0x1db797][_0x4f53('0x28')]];}}return _0x11d86f[_0x4f53('0x2c')](',');}function _0x196059(_0x5e4d5b,_0x29599d,_0x1acc1e){return new Promise(function(_0xb3417f,_0xee52ca){var _0x3e7e0e=[];if(_[_0x4f53('0x2e')](_0x29599d))return _0xb3417f(_0x3e7e0e);_0x50a0a3[_0x4f53('0x2f')]['findAll']({'attributes':['id',_0x4f53('0x30'),'IntervalId'],'raw':!![]})[_0x4f53('0x31')](function(_0xc0eba5){for(var _0x4d0a94=0x0,_0x126dbc=0x0;_0x4d0a94<_0x29599d[_0x4f53('0x26')];_0x4d0a94++,_0x126dbc=0x0){var _0x3da72c=_0x29599d[_0x4d0a94];var _0xb67ca=[];var _0x23e644=[];delete _0x3da72c['id'];if(_0x3da72c[_0x4f53('0x30')]!=='*,*,*,*'){_0x3da72c[_0x4f53('0x32')]=[_0x3da72c[_0x4f53('0x30')]];}else{_0x3da72c[_0x4f53('0x32')]=_0x3da72c[_0x4f53('0x33')]?_['map'](_[_0x4f53('0x34')](_0xc0eba5,{'IntervalId':_0x3da72c[_0x4f53('0x33')]}),'interval'):[];}_0x3da72c[_0x4f53('0xb')]=_0x5e4d5b[_0x4f53('0xb')];_0x3da72c[_0x4f53('0x6')]=_0x5e4d5b[_0x4f53('0x6')];if(_0x3da72c[_0x4f53('0x3')])_0x3da72c[_0x4f53('0x3')]=_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')]();if(_0x5e4d5b[_0x4f53('0x3')]===_0x4f53('0x11')){if(_0x3da72c[_0x4f53('0x1b')]('tag')&&_0x3da72c['tag']&&_0x3da72c[_0x4f53('0x36')]!=='--'){_0xb67ca[_0x4f53('0xd')]({'type':_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')](),'app':'Set','appdata':'CDR(tag)='+_0x3da72c['tag'],'context':_0x5e4d5b[_0x4f53('0xb')],'exten':_0x5e4d5b[_0x4f53('0x6')],'priority':_0x3da72c[_0x4f53('0x32')][_0x4f53('0x26')]+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});}_0xb67ca[_0x4f53('0xd')]({'type':_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')](),'app':_0x4f53('0x15'),'appdata':_0x4f53('0x37')+(_0x3da72c[_0x4f53('0x38')]?_0x4f53('0x39')+_0x3da72c[_0x4f53('0x38')]+')':'NoOp(No\x20number\x20available)'),'context':_0x5e4d5b['context'],'exten':_0x5e4d5b[_0x4f53('0x6')],'priority':_0x3da72c[_0x4f53('0x32')][_0x4f53('0x26')]+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});}else{if(_0x3da72c[_0x4f53('0x1b')](_0x4f53('0x3a'))){if(['queue',_0x4f53('0x3b')][_0x4f53('0x3c')](_0x3da72c[_0x4f53('0x3d')][_0x4f53('0x35')]())&&_0x3da72c[_0x4f53('0x3e')]!=='custom'){if(_0x3da72c[_0x4f53('0x3a')]){_0xb67ca['push']({'type':_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')](),'app':_0x4f53('0x15'),'appdata':_0x4f53('0x3f'),'context':_0x5e4d5b[_0x4f53('0xb')],'exten':_0x5e4d5b[_0x4f53('0x6')],'priority':_0x3da72c[_0x4f53('0x32')]['length']+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});_0xb67ca[_0x4f53('0xd')]({'type':_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')](),'app':'Set','appdata':_0x4f53('0x40'),'context':_0x5e4d5b[_0x4f53('0xb')],'exten':_0x5e4d5b[_0x4f53('0x6')],'priority':_0x3da72c[_0x4f53('0x32')][_0x4f53('0x26')]+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});}else{_0xb67ca[_0x4f53('0xd')]({'type':_0x3da72c[_0x4f53('0x3')][_0x4f53('0x35')](),'app':_0x4f53('0x15'),'appdata':_0x4f53('0x41'),'context':_0x5e4d5b['context'],'exten':_0x5e4d5b['exten'],'priority':_0x3da72c[_0x4f53('0x32')]['length']+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});_0xb67ca['push']({'type':_0x3da72c[_0x4f53('0x3')]['toLowerCase'](),'app':_0x4f53('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5e4d5b['context'],'exten':_0x5e4d5b[_0x4f53('0x6')],'priority':_0x3da72c[_0x4f53('0x32')][_0x4f53('0x26')]+_0x1acc1e+_0x126dbc++,'VoiceExtensionId':_0x5e4d5b['id']});}}}}for(var _0x413394=0x0;_0x413394<_0x3da72c['intervals']['length'];_0x413394++){var _0x353db8=_0x1acc1e+_0x3da72c[_0x4f53('0x32')][_0x4f53('0x26')];var _0x4af4ae=_0x413394===_0x3da72c['intervals']['length']-0x1?_0x1acc1e+_0xb67ca[_0x4f53('0x26')]+_0x23e644['length']+0x2:_0x1acc1e+_0x413394+0x1;_0xb67ca[_0x4f53('0x42')](_0x413394,0x0,{'type':_0x5e4d5b[_0x4f53('0x3')],'app':_0x4f53('0x43'),'appdata':_0x3da72c[_0x4f53('0x32')][_0x413394]+'?'+_0x5e4d5b[_0x4f53('0xb')]+_0x4f53('0x44')+_0x353db8+':'+_0x5e4d5b[_0x4f53('0xb')]+_0x4f53('0x44')+_0x4af4ae,'exten':_0x5e4d5b[_0x4f53('0x6')],'context':_0x5e4d5b[_0x4f53('0xb')],'priority':_0x1acc1e+_0x413394,'VoiceExtensionId':_0x5e4d5b['id']});}if(_0x3da72c['appType']===_0x4f53('0x45'))_0x3da72c['appdata']=_0x32898f(_0x5e4d5b,_0x3da72c[_0x4f53('0x46')]);_0x3da72c[_0x4f53('0x47')]=_0xb67ca[_0x4f53('0x26')]?_['last'](_0xb67ca)[_0x4f53('0x47')]+0x1:_0x1acc1e;_0x3e7e0e=_[_0x4f53('0x48')](_0x3e7e0e,_0xb67ca,[_0x3da72c],_0x23e644);_0x1acc1e=_[_0x4f53('0x49')](_0x3e7e0e)[_0x4f53('0x47')]+0x1;}return _0xb3417f(_0x3e7e0e);})[_0x4f53('0x4a')](function(_0x16e446){_0xee52ca(_0x16e446);});});}return _0x149113[_0x4f53('0x4b')]('VoiceExtension',attributes,{'tableName':_0x4f53('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x31b163){var _0x5b91aa=this[_0x4f53('0x4d')]({'plain':!![]});var _0x3a20c7=_0x5b91aa[_0x4f53('0x3')]===_0x4f53('0x11')?_0x50a841(_0x5b91aa):_0x499965(_0x5b91aa);return _0x196059(_0x5b91aa,_0x31b163,_['last'](_0x3a20c7)[_0x4f53('0x47')]+0x1)[_0x4f53('0x31')](function(_0x5792a6){var _0x5edb1b=_[_0x4f53('0x48')](_0x3a20c7,_0x5792a6);_0x5edb1b[_0x4f53('0xd')]({'type':_0x5b91aa[_0x4f53('0x3')],'app':_0x4f53('0x4e'),'exten':_0x5b91aa['exten'],'context':_0x5b91aa[_0x4f53('0xb')],'priority':_[_0x4f53('0x49')](_0x5edb1b)[_0x4f53('0x47')]+0x1,'VoiceExtensionId':_0x5b91aa['id']});return _0x5edb1b;});}}});}; \ No newline at end of file +var _0x5e67=['U(xcally-mixmonitor-context)','isEmpty','Interval','interval','IntervalId','then','*,*,*,*','filter','hasOwnProperty','tag','toLowerCase','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','includes','app','appType','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','concat','last','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','context','exten','push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','length','param','split','phone','prefix','join','options'];(function(_0x3f3a92,_0xb232c){var _0x52727a=function(_0x5f1191){while(--_0x5f1191){_0x3f3a92['push'](_0x3f3a92['shift']());}};_0x52727a(++_0xb232c);}(_0x5e67,0x70));var _0x75e6=function(_0x5038e3,_0x29855b){_0x5038e3=_0x5038e3-0x0;var _0x593c8d=_0x5e67[_0x5038e3];return _0x593c8d;};'use strict';var _=require(_0x75e6('0x0'));var attributes=require(_0x75e6('0x1'));module[_0x75e6('0x2')]=function(_0x307d03){var _0x2f7528=_0x307d03[_0x75e6('0x3')];function _0x1da44c(_0x2f3320){var _0x1dbb1f=0x2;var _0x3cfdcb=[{'type':_0x2f3320[_0x75e6('0x4')],'app':_0x75e6('0x5'),'appdata':'CDR(type)='+_0x2f3320['type'],'context':_0x2f3320['context'],'exten':_0x2f3320['exten'],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']},{'type':_0x2f3320[_0x75e6('0x4')],'app':_0x2f3320['alias']?_0x75e6('0x5'):_0x75e6('0x6'),'appdata':_0x2f3320[_0x75e6('0x7')]?_0x75e6('0x8')+_0x2f3320['alias']:_0x75e6('0x9'),'context':_0x2f3320[_0x75e6('0xa')],'exten':_0x2f3320[_0x75e6('0xb')],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']}];if(_0x2f3320['type']==='inbound'){_0x3cfdcb[_0x75e6('0xc')]({'type':_0x75e6('0xd'),'app':'Set','appdata':'CDR(routeid)='+_0x2f3320['id'],'context':_0x2f3320[_0x75e6('0xa')],'exten':_0x2f3320[_0x75e6('0xb')],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']});}_0x3cfdcb[_0x75e6('0xc')]({'type':_0x2f3320[_0x75e6('0x4')],'app':_0x75e6('0x5'),'appdata':_0x75e6('0xe'),'context':_0x2f3320[_0x75e6('0xa')],'exten':_0x2f3320[_0x75e6('0xb')],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']},{'type':_0x2f3320['type'],'app':_0x75e6('0x5'),'appdata':_0x75e6('0xf'),'context':_0x2f3320[_0x75e6('0xa')],'exten':_0x2f3320[_0x75e6('0xb')],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']},{'type':_0x2f3320['type'],'app':_0x75e6('0x5'),'appdata':_0x75e6('0x10'),'context':_0x2f3320['context'],'exten':_0x2f3320['exten'],'priority':_0x1dbb1f++,'VoiceExtensionId':_0x2f3320['id']});return _0x3cfdcb;}function _0x121325(_0x27ddf0){var _0x8bf493=0x2;var _0x3958cd=[{'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':_0x75e6('0x12'),'context':_0x27ddf0['context'],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x27ddf0[_0x75e6('0x7')]?'Set':_0x75e6('0x6'),'appdata':_0x27ddf0[_0x75e6('0x7')]?'CDR(routeAlias)='+_0x27ddf0[_0x75e6('0x7')]:_0x75e6('0x9'),'context':_0x27ddf0['context'],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':'Set','appdata':_0x75e6('0x13')+(_0x27ddf0[_0x75e6('0x14')]?_0x75e6('0x15')+_0x27ddf0['cutdigits']+'}':_0x75e6('0x16')),'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':_0x75e6('0x17')+_0x27ddf0['id'],'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x75e6('0x18'),'appdata':_0x75e6('0x19')+(_0x8bf493+0x2)+_0x75e6('0x1a')+(_0x8bf493+0x1)+')','context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':'outbound','app':_0x75e6('0x5'),'appdata':_0x27ddf0[_0x75e6('0x14')]?_0x75e6('0x1b')+_0x27ddf0[_0x75e6('0x14')]+'}':_0x75e6('0x1c'),'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':_0x75e6('0xe'),'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0['exten'],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':'outbound','app':'Set','appdata':_0x75e6('0x10'),'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':'outbound','app':'Set','appdata':'outboundrouteid='+_0x27ddf0['id'],'context':_0x27ddf0['context'],'exten':_0x27ddf0['exten'],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']}];if(_0x27ddf0['hasOwnProperty'](_0x75e6('0x1d'))&&_0x27ddf0[_0x75e6('0x1d')]!==_0x75e6('0x1e')){_0x3958cd['push']({'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':_0x75e6('0x1f'),'context':_0x27ddf0[_0x75e6('0xa')],'exten':_0x27ddf0['exten'],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']},{'type':_0x75e6('0x11'),'app':_0x75e6('0x5'),'appdata':_0x75e6('0x20')+_0x27ddf0[_0x75e6('0x1d')]||_0x75e6('0x21'),'context':_0x27ddf0['context'],'exten':_0x27ddf0[_0x75e6('0xb')],'priority':_0x8bf493++,'VoiceExtensionId':_0x27ddf0['id']});}return _0x3958cd;}function _0x1cea26(_0x277400,_0x442a41){var _0x2e3719=[{'name':_0x75e6('0x22'),'param':0x0},{'name':_0x75e6('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x75e6('0x24'),'param':0x3}];var _0x21e76e={};var _0x39c0a7=_0x442a41['split'](',');var _0x3766c2=[];for(var _0x1d6b4c=0x0;_0x1d6b4c<_0x2e3719[_0x75e6('0x25')];_0x1d6b4c++){switch(_0x2e3719[_0x1d6b4c]['name']){case _0x75e6('0x22'):_0x21e76e[_0x75e6('0x22')]=_0x39c0a7[_0x2e3719[_0x1d6b4c][_0x75e6('0x26')]][_0x75e6('0x27')]('/')[0x1];_0x21e76e[_0x75e6('0x28')]=_0x39c0a7[_0x2e3719[_0x1d6b4c]['param']][_0x75e6('0x27')]('/')[0x2];_0x21e76e[_0x75e6('0x29')]=_0x21e76e[_0x75e6('0x28')]?_0x21e76e[_0x75e6('0x28')]['split']('$')[0x0]:undefined;_0x21e76e[_0x75e6('0x28')]=_0x277400[_0x75e6('0x14')]?(_0x21e76e[_0x75e6('0x29')]||'')+_0x75e6('0x15')+_0x277400['cutdigits']+'}':(_0x21e76e[_0x75e6('0x29')]||'')+_0x75e6('0x16');_0x3766c2[_0x2e3719[_0x1d6b4c][_0x75e6('0x26')]]=['SIP',_0x21e76e[_0x75e6('0x22')],_0x21e76e[_0x75e6('0x28')]][_0x75e6('0x2a')]('/');break;case _0x75e6('0x2b'):_0x21e76e['options']=_0x39c0a7[_0x2e3719[_0x1d6b4c][_0x75e6('0x26')]];if(_0x277400[_0x75e6('0x1d')]!==_0x75e6('0x1e')){if(_0x21e76e[_0x75e6('0x2b')]['indexOf'](_0x75e6('0x2c'))<0x0){_0x21e76e[_0x75e6('0x2b')]+='U(xcally-mixmonitor-context)';}}else{_0x21e76e[_0x75e6('0x2b')]=_0x21e76e[_0x75e6('0x2b')]['replace'](_0x75e6('0x2c'),'');}_0x3766c2[_0x2e3719[_0x1d6b4c]['param']]=_0x21e76e[_0x75e6('0x2b')];break;default:_0x3766c2[_0x2e3719[_0x1d6b4c][_0x75e6('0x26')]]=_0x39c0a7[_0x2e3719[_0x1d6b4c][_0x75e6('0x26')]];}}return _0x3766c2[_0x75e6('0x2a')](',');}function _0x516d00(_0x43158b,_0x3832f9,_0x5833bb){return new Promise(function(_0x5ebaf3,_0x2045d7){var _0x491655=[];if(_[_0x75e6('0x2d')](_0x3832f9))return _0x5ebaf3(_0x491655);_0x2f7528[_0x75e6('0x2e')]['findAll']({'attributes':['id',_0x75e6('0x2f'),_0x75e6('0x30')],'raw':!![]})[_0x75e6('0x31')](function(_0x13ebb6){for(var _0xed970f=0x0,_0x5b8f00=0x0;_0xed970f<_0x3832f9[_0x75e6('0x25')];_0xed970f++,_0x5b8f00=0x0){var _0x31f091=_0x3832f9[_0xed970f];var _0x35b766=[];var _0x12fae8=[];delete _0x31f091['id'];if(_0x31f091[_0x75e6('0x2f')]!==_0x75e6('0x32')){_0x31f091['intervals']=[_0x31f091[_0x75e6('0x2f')]];}else{_0x31f091['intervals']=_0x31f091[_0x75e6('0x30')]?_['map'](_[_0x75e6('0x33')](_0x13ebb6,{'IntervalId':_0x31f091[_0x75e6('0x30')]}),_0x75e6('0x2f')):[];}_0x31f091['context']=_0x43158b['context'];_0x31f091[_0x75e6('0xb')]=_0x43158b[_0x75e6('0xb')];if(_0x31f091[_0x75e6('0x4')])_0x31f091['type']=_0x31f091['type']['toLowerCase']();if(_0x43158b[_0x75e6('0x4')]===_0x75e6('0x11')){if(_0x31f091[_0x75e6('0x34')]('tag')&&_0x31f091[_0x75e6('0x35')]&&_0x31f091[_0x75e6('0x35')]!=='--'){_0x35b766['push']({'type':_0x31f091['type'][_0x75e6('0x36')](),'app':_0x75e6('0x5'),'appdata':_0x75e6('0x37')+_0x31f091[_0x75e6('0x35')],'context':_0x43158b[_0x75e6('0xa')],'exten':_0x43158b['exten'],'priority':_0x31f091[_0x75e6('0x38')]['length']+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});}_0x35b766['push']({'type':_0x31f091[_0x75e6('0x4')][_0x75e6('0x36')](),'app':_0x75e6('0x18'),'appdata':_0x75e6('0x39')+(_0x31f091['callerID']?_0x75e6('0x3a')+_0x31f091[_0x75e6('0x3b')]+')':_0x75e6('0x3c')),'context':_0x43158b[_0x75e6('0xa')],'exten':_0x43158b[_0x75e6('0xb')],'priority':_0x31f091[_0x75e6('0x38')][_0x75e6('0x25')]+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});}else{if(_0x31f091[_0x75e6('0x34')](_0x75e6('0x3d'))){if(['queue','playback'][_0x75e6('0x3e')](_0x31f091[_0x75e6('0x3f')][_0x75e6('0x36')]())&&_0x31f091[_0x75e6('0x40')]!=='custom'){if(_0x31f091[_0x75e6('0x3d')]){_0x35b766[_0x75e6('0xc')]({'type':_0x31f091[_0x75e6('0x4')]['toLowerCase'](),'app':_0x75e6('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x43158b['context'],'exten':_0x43158b['exten'],'priority':_0x31f091[_0x75e6('0x38')][_0x75e6('0x25')]+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});_0x35b766[_0x75e6('0xc')]({'type':_0x31f091['type']['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x43158b[_0x75e6('0xa')],'exten':_0x43158b[_0x75e6('0xb')],'priority':_0x31f091['intervals'][_0x75e6('0x25')]+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});}else{_0x35b766[_0x75e6('0xc')]({'type':_0x31f091[_0x75e6('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x75e6('0x41'),'context':_0x43158b['context'],'exten':_0x43158b[_0x75e6('0xb')],'priority':_0x31f091['intervals'][_0x75e6('0x25')]+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});_0x35b766[_0x75e6('0xc')]({'type':_0x31f091[_0x75e6('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x75e6('0x42'),'context':_0x43158b['context'],'exten':_0x43158b['exten'],'priority':_0x31f091[_0x75e6('0x38')][_0x75e6('0x25')]+_0x5833bb+_0x5b8f00++,'VoiceExtensionId':_0x43158b['id']});}}}}for(var _0x5b2c75=0x0;_0x5b2c75<_0x31f091[_0x75e6('0x38')][_0x75e6('0x25')];_0x5b2c75++){var _0x2e6107=_0x5833bb+_0x31f091['intervals'][_0x75e6('0x25')];var _0x24ff5d=_0x5b2c75===_0x31f091[_0x75e6('0x38')]['length']-0x1?_0x5833bb+_0x35b766[_0x75e6('0x25')]+_0x12fae8[_0x75e6('0x25')]+0x2:_0x5833bb+_0x5b2c75+0x1;_0x35b766[_0x75e6('0x43')](_0x5b2c75,0x0,{'type':_0x43158b[_0x75e6('0x4')],'app':_0x75e6('0x44'),'appdata':_0x31f091[_0x75e6('0x38')][_0x5b2c75]+'?'+_0x43158b[_0x75e6('0xa')]+',${EXTEN},'+_0x2e6107+':'+_0x43158b[_0x75e6('0xa')]+',${EXTEN},'+_0x24ff5d,'exten':_0x43158b[_0x75e6('0xb')],'context':_0x43158b[_0x75e6('0xa')],'priority':_0x5833bb+_0x5b2c75,'VoiceExtensionId':_0x43158b['id']});}if(_0x31f091[_0x75e6('0x40')]===_0x75e6('0x45'))_0x31f091[_0x75e6('0x46')]=_0x1cea26(_0x43158b,_0x31f091[_0x75e6('0x46')]);_0x31f091[_0x75e6('0x47')]=_0x35b766['length']?_['last'](_0x35b766)[_0x75e6('0x47')]+0x1:_0x5833bb;_0x491655=_[_0x75e6('0x48')](_0x491655,_0x35b766,[_0x31f091],_0x12fae8);_0x5833bb=_[_0x75e6('0x49')](_0x491655)[_0x75e6('0x47')]+0x1;}return _0x5ebaf3(_0x491655);})['catch'](function(_0x590832){_0x2045d7(_0x590832);});});}return _0x307d03[_0x75e6('0x4a')]('VoiceExtension',attributes,{'tableName':_0x75e6('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5e0113){var _0x362db2=this[_0x75e6('0x4c')]({'plain':!![]});var _0x254ab2=_0x362db2[_0x75e6('0x4')]===_0x75e6('0x11')?_0x121325(_0x362db2):_0x1da44c(_0x362db2);return _0x516d00(_0x362db2,_0x5e0113,_[_0x75e6('0x49')](_0x254ab2)[_0x75e6('0x47')]+0x1)[_0x75e6('0x31')](function(_0x426621){var _0x46bcc5=_[_0x75e6('0x48')](_0x254ab2,_0x426621);_0x46bcc5[_0x75e6('0xc')]({'type':_0x362db2[_0x75e6('0x4')],'app':_0x75e6('0x4d'),'exten':_0x362db2['exten'],'context':_0x362db2['context'],'priority':_[_0x75e6('0x49')](_0x46bcc5)[_0x75e6('0x47')]+0x1,'VoiceExtensionId':_0x362db2['id']});return _0x46bcc5;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 60b391b..cc67235 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 _0xcb66=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','VoiceExtension','findAll','raw','options','where','attributes','limit','include','map','model','then','GetVoiceExtension','util','moment','bluebird'];(function(_0x1f80c3,_0x129b83){var _0x3c0a25=function(_0x2cac18){while(--_0x2cac18){_0x1f80c3['push'](_0x1f80c3['shift']());}};_0x3c0a25(++_0x129b83);}(_0xcb66,0x19f));var _0x6cb6=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xcb66[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var moment=require(_0x6cb6('0x1'));var BPromise=require(_0x6cb6('0x2'));var rs=require(_0x6cb6('0x3'));var fs=require('fs');var Redis=require(_0x6cb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb6('0x5'));var logger=require(_0x6cb6('0x6'))(_0x6cb6('0x7'));var config=require(_0x6cb6('0x8'));var jayson=require(_0x6cb6('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6cb6('0xa')]=_[_0x6cb6('0xb')](config[_0x6cb6('0xa')],{'host':_0x6cb6('0xc'),'port':0x18eb});var socket=require(_0x6cb6('0xd'))(new Redis(config[_0x6cb6('0xa')]));require(_0x6cb6('0xe'))[_0x6cb6('0xf')](socket);function respondWithRpcPromise(_0x332bce,_0x357ada,_0x3aa2b5){return new BPromise(function(_0xb7e9e,_0x1828f6){return client['request'](_0x332bce,_0x3aa2b5)['then'](function(_0x576aea){logger['info'](_0x6cb6('0x10'),_0x357ada,_0x6cb6('0x11'));logger[_0x6cb6('0x12')](_0x6cb6('0x13'),_0x357ada,'request\x20sent',JSON[_0x6cb6('0x14')](_0x576aea));if(_0x576aea[_0x6cb6('0x15')]){if(_0x576aea['error'][_0x6cb6('0x16')]===0x1f4){logger[_0x6cb6('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x357ada,_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);return _0x1828f6(_0x576aea['error']['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x357ada,_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);return _0xb7e9e(_0x576aea[_0x6cb6('0x15')][_0x6cb6('0x17')]);}else{logger[_0x6cb6('0x18')](_0x6cb6('0x10'),_0x357ada,'request\x20sent');_0xb7e9e(_0x576aea[_0x6cb6('0x19')][_0x6cb6('0x17')]);}})['catch'](function(_0x4b9da5){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x357ada,_0x4b9da5);_0x1828f6(_0x4b9da5);});});}exports['GetVoiceExtension']=function(_0x5e5349){var _0x390c9b=this;return new Promise(function(_0xcd1afa,_0x407455){return db[_0x6cb6('0x1a')][_0x6cb6('0x1b')]({'raw':_0x5e5349['options']?_0x5e5349['options'][_0x6cb6('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e5349[_0x6cb6('0x1d')]?_0x5e5349[_0x6cb6('0x1d')][_0x6cb6('0x1e')]||null:null,'attributes':_0x5e5349['options']?_0x5e5349[_0x6cb6('0x1d')][_0x6cb6('0x1f')]||null:null,'limit':_0x5e5349['options']?_0x5e5349['options'][_0x6cb6('0x20')]||null:null,'include':_0x5e5349['options']?_0x5e5349[_0x6cb6('0x1d')][_0x6cb6('0x21')]?_[_0x6cb6('0x22')](_0x5e5349[_0x6cb6('0x1d')][_0x6cb6('0x21')],function(_0x16db1d){return{'model':db[_0x16db1d[_0x6cb6('0x23')]],'as':_0x16db1d['as'],'attributes':_0x16db1d[_0x6cb6('0x1f')],'include':_0x16db1d[_0x6cb6('0x21')]?_[_0x6cb6('0x22')](_0x16db1d['include'],function(_0x5c525b){return{'model':db[_0x5c525b['model']],'as':_0x5c525b['as'],'attributes':_0x5c525b[_0x6cb6('0x1f')],'include':_0x5c525b[_0x6cb6('0x21')]?_[_0x6cb6('0x22')](_0x5c525b[_0x6cb6('0x21')],function(_0x1f8c9d){return{'model':db[_0x1f8c9d[_0x6cb6('0x23')]],'as':_0x1f8c9d['as'],'attributes':_0x1f8c9d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cb6('0x24')](function(_0x4d4ad9){logger[_0x6cb6('0x18')]('GetVoiceExtension',_0x5e5349);logger[_0x6cb6('0x12')](_0x6cb6('0x25'),_0x5e5349,JSON[_0x6cb6('0x14')](_0x4d4ad9));_0xcd1afa(_0x4d4ad9);})['catch'](function(_0x417dec){logger[_0x6cb6('0x15')](_0x6cb6('0x25'),_0x417dec['message'],_0x5e5349);_0x407455(_0x390c9b[_0x6cb6('0x15')](0x1f4,_0x417dec[_0x6cb6('0x17')]));});});}; \ No newline at end of file +var _0x2caf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','bluebird','ioredis'];(function(_0x4a9f14,_0x2946a2){var _0x585b0e=function(_0x43e4d6){while(--_0x43e4d6){_0x4a9f14['push'](_0x4a9f14['shift']());}};_0x585b0e(++_0x2946a2);}(_0x2caf,0x6a));var _0xf2ca=function(_0x4ee6c2,_0x125ada){_0x4ee6c2=_0x4ee6c2-0x0;var _0x100257=_0x2caf[_0x4ee6c2];return _0x100257;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf2ca('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2ca('0x1'));var db=require(_0xf2ca('0x2'))['db'];var utils=require(_0xf2ca('0x3'));var logger=require(_0xf2ca('0x4'))(_0xf2ca('0x5'));var config=require(_0xf2ca('0x6'));var jayson=require(_0xf2ca('0x7'));var client=jayson['client'][_0xf2ca('0x8')]({'port':0x232a});config[_0xf2ca('0x9')]=_[_0xf2ca('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ca('0xb'))(new Redis(config[_0xf2ca('0x9')]));require(_0xf2ca('0xc'))[_0xf2ca('0xd')](socket);function respondWithRpcPromise(_0x1c1afd,_0x5be288,_0x1ecd50){return new BPromise(function(_0x34d82a,_0x30e975){return client[_0xf2ca('0xe')](_0x1c1afd,_0x1ecd50)[_0xf2ca('0xf')](function(_0x328d80){logger['info'](_0xf2ca('0x10'),_0x5be288,_0xf2ca('0x11'));logger['debug'](_0xf2ca('0x12'),_0x5be288,_0xf2ca('0x11'),JSON['stringify'](_0x328d80));if(_0x328d80['error']){if(_0x328d80[_0xf2ca('0x13')]['code']===0x1f4){logger[_0xf2ca('0x13')](_0xf2ca('0x10'),_0x5be288,_0x328d80[_0xf2ca('0x13')][_0xf2ca('0x14')]);return _0x30e975(_0x328d80[_0xf2ca('0x13')][_0xf2ca('0x14')]);}logger[_0xf2ca('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x5be288,_0x328d80[_0xf2ca('0x13')]['message']);return _0x34d82a(_0x328d80[_0xf2ca('0x13')]['message']);}else{logger[_0xf2ca('0x15')](_0xf2ca('0x10'),_0x5be288,'request\x20sent');_0x34d82a(_0x328d80[_0xf2ca('0x16')][_0xf2ca('0x14')]);}})[_0xf2ca('0x17')](function(_0x310504){logger[_0xf2ca('0x13')](_0xf2ca('0x10'),_0x5be288,_0x310504);_0x30e975(_0x310504);});});}exports[_0xf2ca('0x18')]=function(_0x1548a4){var _0x1718e6=this;return new Promise(function(_0x24dbde,_0xea662){return db['VoiceExtension'][_0xf2ca('0x19')]({'raw':_0x1548a4[_0xf2ca('0x1a')]?_0x1548a4[_0xf2ca('0x1a')][_0xf2ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x1548a4[_0xf2ca('0x1a')]?_0x1548a4[_0xf2ca('0x1a')][_0xf2ca('0x1c')]||null:null,'attributes':_0x1548a4[_0xf2ca('0x1a')]?_0x1548a4['options'][_0xf2ca('0x1d')]||null:null,'limit':_0x1548a4[_0xf2ca('0x1a')]?_0x1548a4['options'][_0xf2ca('0x1e')]||null:null,'include':_0x1548a4[_0xf2ca('0x1a')]?_0x1548a4[_0xf2ca('0x1a')]['include']?_['map'](_0x1548a4[_0xf2ca('0x1a')][_0xf2ca('0x1f')],function(_0x214fa9){return{'model':db[_0x214fa9[_0xf2ca('0x20')]],'as':_0x214fa9['as'],'attributes':_0x214fa9[_0xf2ca('0x1d')],'include':_0x214fa9[_0xf2ca('0x1f')]?_[_0xf2ca('0x21')](_0x214fa9[_0xf2ca('0x1f')],function(_0x570aea){return{'model':db[_0x570aea[_0xf2ca('0x20')]],'as':_0x570aea['as'],'attributes':_0x570aea[_0xf2ca('0x1d')],'include':_0x570aea[_0xf2ca('0x1f')]?_[_0xf2ca('0x21')](_0x570aea[_0xf2ca('0x1f')],function(_0x41fc04){return{'model':db[_0x41fc04[_0xf2ca('0x20')]],'as':_0x41fc04['as'],'attributes':_0x41fc04[_0xf2ca('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf2ca('0xf')](function(_0x20a523){logger[_0xf2ca('0x15')](_0xf2ca('0x18'),_0x1548a4);logger[_0xf2ca('0x22')](_0xf2ca('0x18'),_0x1548a4,JSON[_0xf2ca('0x23')](_0x20a523));_0x24dbde(_0x20a523);})[_0xf2ca('0x17')](function(_0x2a9a1f){logger[_0xf2ca('0x13')](_0xf2ca('0x18'),_0x2a9a1f['message'],_0x1548a4);_0xea662(_0x1718e6[_0xf2ca('0x13')](0x1f4,_0x2a9a1f[_0xf2ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 0596dc7..04c7725 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4258fb,_0x3425ff){_0x4258fb=_0x4258fb-0x0;var _0x4c89b5=_0x1cb9[_0x4258fb];return _0x4c89b5;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x4981f6,_0xb51d0a){var _0xe85952=function(_0x62f3ae){while(--_0x62f3ae){_0x4981f6['push'](_0x4981f6['shift']());}};_0xe85952(++_0xb51d0a);}(_0x5fab,0x177));var _0xb5fa=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x5fab[_0x3b1b23];return _0x1efc85;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a4c6b64..5235ce1 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 _0x82c4=['express','Router','fs-extra','../../components/interaction/service','./voiceMail.controller','isAuthenticated','get','/:id','show','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x82c4,0x1ca));var _0x482c=function(_0x2ba279,_0x4297a0){_0x2ba279=_0x2ba279-0x0;var _0xea4ae1=_0x82c4[_0x2ba279];return _0xea4ae1;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id/messages',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')]('/',auth[_0x482c('0x9')](),controller[_0x482c('0xf')]);router[_0x482c('0x10')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);router[_0x482c('0x12')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0x13')]);module[_0x482c('0x14')]=router; \ No newline at end of file +var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x11497d,_0x5e7b61){var _0x40fe80=function(_0x49028d){while(--_0x49028d){_0x11497d['push'](_0x11497d['shift']());}};_0x40fe80(++_0x5e7b61);}(_0x4bd3,0x174));var _0x34bd=function(_0x469f2e,_0x294eb3){_0x469f2e=_0x469f2e-0x0;var _0x27704e=_0x4bd3[_0x469f2e];return _0x27704e;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a4f2d8d..73e1037 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 _0xfc2a=['\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname'];(function(_0x2a1338,_0x29f7aa){var _0xc02469=function(_0x475e5f){while(--_0x475e5f){_0x2a1338['push'](_0x2a1338['shift']());}};_0xc02469(++_0x29f7aa);}(_0xfc2a,0xb7));var _0xafc2=function(_0x103589,_0x2acf11){_0x103589=_0x103589-0x0;var _0x3ea116=_0xfc2a[_0x103589];return _0x3ea116;};'use strict';var Sequelize=require(_0xafc2('0x0'));module[_0xafc2('0x1')]={'customer_id':{'type':Sequelize[_0xafc2('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xafc2('0x3')},'mailbox':{'type':Sequelize[_0xafc2('0x2')],'defaultValue':'','allowNull':![],'unique':_0xafc2('0x3')},'password':{'type':Sequelize[_0xafc2('0x2')]},'fullname':{'type':Sequelize[_0xafc2('0x2')]},'email':{'type':Sequelize[_0xafc2('0x2')],'validate':{'isEmail':!![]},'set':function(_0x414b5d){this[_0xafc2('0x4')]('email',typeof _0x414b5d===_0xafc2('0x5')&&_0x414b5d[_0xafc2('0x6')]()?_0x414b5d['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xafc2('0x2')],'defaultValue':_0xafc2('0x7')},'attach':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':_0xafc2('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':_0xafc2('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xafc2('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xafc2('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xafc2('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':_0xafc2('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xafc2('0x8')](_0xafc2('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xafc2('0xb')},'emailsubject':{'type':Sequelize[_0xafc2('0x2')]},'emailbody':{'type':Sequelize[_0xafc2('0x2')]},'maxsecs':{'type':Sequelize[_0xafc2('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xafc2('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xafc2('0xd')],'get':function(){return this['getDataValue'](_0xafc2('0xe'))+_0xafc2('0xf')+this[_0xafc2('0x10')](_0xafc2('0x11'));}}}; \ No newline at end of file +var _0xe533=['ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim','yes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe533,0x1ba));var _0x3e53=function(_0x57694b,_0x2ccc87){_0x57694b=_0x57694b-0x0;var _0x3fea81=_0xe533[_0x57694b];return _0x3fea81;};'use strict';var Sequelize=require(_0x3e53('0x0'));module[_0x3e53('0x1')]={'customer_id':{'type':Sequelize[_0x3e53('0x2')]},'context':{'type':Sequelize[_0x3e53('0x2')],'defaultValue':_0x3e53('0x3'),'unique':_0x3e53('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3e53('0x4')},'password':{'type':Sequelize[_0x3e53('0x2')]},'fullname':{'type':Sequelize[_0x3e53('0x2')]},'email':{'type':Sequelize[_0x3e53('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1ca8a4){this[_0x3e53('0x5')]('email',typeof _0x1ca8a4==='string'&&_0x1ca8a4[_0x3e53('0x6')]()?_0x1ca8a4[_0x3e53('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x3e53('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3e53('0x8')]('yes','no'),'defaultValue':_0x3e53('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3e53('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3e53('0x8')](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3e53('0x8')](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3e53('0x8')](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3e53('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3e53('0x8')](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3e53('0x8')](_0x3e53('0x7'),'no'),'defaultValue':_0x3e53('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3e53('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3e53('0x8')]('yes','no'),'defaultValue':_0x3e53('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3e53('0x2')]},'emailbody':{'type':Sequelize[_0x3e53('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3e53('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3e53('0xb')],'get':function(){return this[_0x3e53('0xc')](_0x3e53('0xd'))+'\x20-\x20'+this[_0x3e53('0xc')](_0x3e53('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4267cbf..29e9120 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 _0xb688=['fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','catch','show','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','filter','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','get','Voicemails','end','error','name','send','index','map','VoiceMail'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb688,0xcf));var _0x8b68=function(_0x14dfee,_0x1b9ba0){_0x14dfee=_0x14dfee-0x0;var _0x16f529=_0xb688[_0x14dfee];return _0x16f529;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){var _0x4ca77d=_0x59bb8a[_0x8b68('0x27')]({'plain':!![]});var _0x3cf8d2=_0x8b68('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cf8d2,'resourceId':_0x4ca77d['id']}})['then'](function(){return _0x59bb8a;});})[_0x8b68('0x25')](function(){_0x32ddc5[_0x8b68('0x1c')](0xcc)[_0x8b68('0x29')]();});}};}function handleEntityNotFound(_0x583476,_0x3311c7){return function(_0x53aaa2){if(!_0x53aaa2){_0x583476['sendStatus'](0x194);}return _0x53aaa2;};}function handleError(_0x3865ea,_0x59b3ce){_0x59b3ce=_0x59b3ce||0x1f4;return function(_0x26cad7){logger[_0x8b68('0x2a')](_0x26cad7['stack']);if(_0x26cad7['name']){delete _0x26cad7[_0x8b68('0x2b')];}_0x3865ea[_0x8b68('0x1c')](_0x59b3ce)[_0x8b68('0x2c')](_0x26cad7);};}exports[_0x8b68('0x2d')]=function(_0x210926,_0x2ad2df){var _0x460c37={},_0x5b7ed1={},_0x3b6d1b={'count':0x0,'rows':[]};var _0x50a1e9=_[_0x8b68('0x2e')](db[_0x8b68('0x2f')]['rawAttributes'],function(_0x216aa6){return{'name':_0x216aa6[_0x8b68('0x30')],'type':_0x216aa6[_0x8b68('0x31')]['key']};});_0x5b7ed1['model']=_[_0x8b68('0x2e')](_0x50a1e9,_0x8b68('0x2b'));_0x5b7ed1[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x210926[_0x8b68('0x32')]);_0x5b7ed1[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],_0x5b7ed1[_0x8b68('0x32')]);_0x460c37[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x210926[_0x8b68('0x32')][_0x8b68('0x38')]));_0x460c37[_0x8b68('0x37')]=_0x460c37[_0x8b68('0x37')][_0x8b68('0x39')]?_0x460c37[_0x8b68('0x37')]:_0x5b7ed1[_0x8b68('0x36')];if(!_0x210926[_0x8b68('0x32')][_0x8b68('0x3a')]('nolimit')){_0x460c37['limit']=qs[_0x8b68('0x1f')](_0x210926[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x460c37[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x210926[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x460c37[_0x8b68('0x3b')]=qs['sort'](_0x210926[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x460c37[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x210926[_0x8b68('0x32')],_0x5b7ed1[_0x8b68('0x34')]),_0x50a1e9);if(_0x210926[_0x8b68('0x32')]['filter']){_0x460c37[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x460c37[_0x8b68('0x3d')],{'$or':_[_0x8b68('0x2e')](_0x50a1e9,function(_0x3ecc60){if(_0x3ecc60[_0x8b68('0x31')]!==_0x8b68('0x40')){var _0x50a9c6={};_0x50a9c6[_0x3ecc60[_0x8b68('0x2b')]]={'$like':'%'+_0x210926[_0x8b68('0x32')]['filter']+'%'};return _0x50a9c6;}})});}_0x460c37=_[_0x8b68('0x3f')]({},_0x460c37,_0x210926[_0x8b68('0x41')]);var _0x50b2f1={'where':_0x460c37['where']};return db['VoiceMail']['count'](_0x50b2f1)[_0x8b68('0x25')](function(_0x23d24a){_0x3b6d1b['count']=_0x23d24a;if(_0x210926[_0x8b68('0x32')]['includeAll']){_0x460c37[_0x8b68('0x42')]=[{'all':!![]}];}return db[_0x8b68('0x2f')]['findAll'](_0x460c37);})[_0x8b68('0x25')](function(_0x5ae345){_0x3b6d1b['rows']=_0x5ae345;return _0x3b6d1b;})['then'](respondWithFilteredResult(_0x2ad2df,_0x460c37))[_0x8b68('0x43')](handleError(_0x2ad2df,null));};exports[_0x8b68('0x44')]=function(_0x3ba80e,_0xa70f60){var _0x50e425={'raw':!![],'where':{'id':_0x3ba80e['params']['id']}},_0x20162a={};_0x20162a[_0x8b68('0x36')]=_[_0x8b68('0x33')](db['VoiceMail'][_0x8b68('0x45')]);_0x20162a[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ba80e[_0x8b68('0x32')]);_0x20162a['filters']=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],_0x20162a[_0x8b68('0x32')]);_0x50e425[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x50e425[_0x8b68('0x37')]=_0x50e425[_0x8b68('0x37')][_0x8b68('0x39')]?_0x50e425[_0x8b68('0x37')]:_0x20162a[_0x8b68('0x36')];if(_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x46')]){_0x50e425['include']=[{'all':!![]}];}_0x50e425=_[_0x8b68('0x3f')]({},_0x50e425,_0x3ba80e[_0x8b68('0x41')]);return db['VoiceMail'][_0x8b68('0x47')](_0x50e425)['then'](handleEntityNotFound(_0xa70f60,null))['then'](respondWithResult(_0xa70f60,null))['catch'](handleError(_0xa70f60,null));};exports[_0x8b68('0x48')]=function(_0x35874b,_0x34047c){return db[_0x8b68('0x2f')]['create'](_0x35874b['body'],{})[_0x8b68('0x25')](function(_0x163fd5){var _0x1e900f=_0x35874b['user'][_0x8b68('0x27')]({'plain':!![]});if(!_0x1e900f)throw new Error(_0x8b68('0x49'));if(_0x1e900f['role']===_0x8b68('0x4a')){var _0xacac82=_0x163fd5['get']({'plain':!![]});var _0x18a9ae=_0x8b68('0x28');return db['UserProfileSection'][_0x8b68('0x47')]({'where':{'name':_0x18a9ae,'userProfileId':_0x1e900f[_0x8b68('0x4b')]},'raw':!![]})['then'](function(_0x543d74){if(_0x543d74&&_0x543d74['autoAssociation']===0x0){return db[_0x8b68('0x4c')][_0x8b68('0x48')]({'name':_0xacac82[_0x8b68('0x2b')],'resourceId':_0xacac82['id'],'type':_0x543d74[_0x8b68('0x2b')],'sectionId':_0x543d74['id']},{})['then'](function(){return _0x163fd5;});}else{return _0x163fd5;}})['catch'](function(_0x4492fd){logger[_0x8b68('0x2a')](_0x8b68('0x4d'),_0x4492fd);throw _0x4492fd;});}return _0x163fd5;})['then'](respondWithResult(_0x34047c,0xc9))[_0x8b68('0x43')](handleError(_0x34047c,null));};exports[_0x8b68('0x24')]=function(_0x3f9d34,_0x4dda69){if(_0x3f9d34[_0x8b68('0x4e')]['id']){delete _0x3f9d34['body']['id'];}return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x3f9d34['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x4dda69,null))[_0x8b68('0x25')](saveUpdates(_0x3f9d34[_0x8b68('0x4e')],null))[_0x8b68('0x25')](respondWithResult(_0x4dda69,null))[_0x8b68('0x43')](handleError(_0x4dda69,null));};exports['destroy']=function(_0x241166,_0x3f3e43){return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x241166[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x3f3e43,null))[_0x8b68('0x25')](removeEntity(_0x3f3e43,null))[_0x8b68('0x43')](handleError(_0x3f3e43,null));};exports['getMessages']=function(_0x3f423e,_0x1a85da,_0x1e8694){return db[_0x8b68('0x2f')][_0x8b68('0x50')]({'where':{'id':_0x3f423e[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x1a85da,null))[_0x8b68('0x25')](function(_0x6d63cb){var _0x271dbe;var _0x368c86={},_0x42871e={};_0x42871e[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x51')][_0x8b68('0x45')]);_0x42871e[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3f423e[_0x8b68('0x32')]);_0x42871e[_0x8b68('0x34')]=_['intersection'](_0x42871e[_0x8b68('0x36')],_0x42871e['query']);_0x368c86['attributes']=_[_0x8b68('0x35')](_0x42871e['model'],qs[_0x8b68('0x38')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x368c86['attributes']=_0x368c86[_0x8b68('0x37')][_0x8b68('0x39')]?_0x368c86[_0x8b68('0x37')]:_0x42871e[_0x8b68('0x36')];if(!_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3a')](_0x8b68('0x52'))){_0x368c86['limit']=qs['limit'](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x368c86[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x368c86[_0x8b68('0x3b')]=qs[_0x8b68('0x3c')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x368c86[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x3f423e[_0x8b68('0x32')],_0x42871e[_0x8b68('0x34')]));if(_0x3f423e[_0x8b68('0x32')][_0x8b68('0x53')]){_0x368c86[_0x8b68('0x3d')]=_['merge'](_0x368c86['where'],{'$or':_[_0x8b68('0x2e')](_0x368c86[_0x8b68('0x37')],function(_0x5bd581){var _0x48d57a={};_0x48d57a[_0x5bd581]={'$like':'%'+_0x3f423e['query'][_0x8b68('0x53')]+'%'};return _0x48d57a;})});}_0x368c86[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x368c86[_0x8b68('0x3d')],{'mailboxuser':_0x6d63cb[_0x8b68('0x54')]});_0x368c86=_['merge']({},_0x368c86,_0x3f423e[_0x8b68('0x41')]);return db[_0x8b68('0x51')]['findAndCountAll'](_0x368c86)[_0x8b68('0x25')](respondWithFilteredResult(_0x1a85da,_0x368c86));})['catch'](handleError(_0x1a85da,null));}; \ No newline at end of file +var _0x065e=['findOne','VoiceMailMessage','findAndCountAll','eml-format','request-promise','moment','bluebird','path','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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoiceMail','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages'];(function(_0x31fe53,_0x564731){var _0x14c995=function(_0x24eadb){while(--_0x24eadb){_0x31fe53['push'](_0x31fe53['shift']());}};_0x14c995(++_0x564731);}(_0x065e,0x1a7));var _0xe065=function(_0x20cecc,_0x4663d7){_0x20cecc=_0x20cecc-0x0;var _0x27ceb4=_0x065e[_0x20cecc];return _0x27ceb4;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='Voicemails';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':!![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x21')]=function(_0x1ea568,_0xe77af6){if(_0x1ea568[_0xe065('0x4f')]['id']){delete _0x1ea568[_0xe065('0x4f')]['id'];}return db[_0xe065('0x2a')]['find']({'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](saveUpdates(_0x1ea568[_0xe065('0x4f')],null))['then'](respondWithResult(_0xe77af6,null))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x23')]=function(_0x21884d,_0xb1fca1){return db['VoiceMail'][_0xe065('0x45')]({'where':{'id':_0x21884d[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xb1fca1,null))['then'](removeEntity(_0xb1fca1,null))[_0xe065('0x4d')](handleError(_0xb1fca1,null));};exports[_0xe065('0x50')]=function(_0x18b43e,_0x1f782f,_0x2d13ab){return db[_0xe065('0x2a')][_0xe065('0x51')]({'where':{'id':_0x18b43e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x1f782f,null))['then'](function(_0x2accad){var _0x550c37;var _0x44edf0={},_0x24fc1c={};_0x24fc1c[_0xe065('0x30')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x24fc1c[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x18b43e[_0xe065('0x2d')]);_0x24fc1c[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],_0x24fc1c[_0xe065('0x2d')]);_0x44edf0[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],qs[_0xe065('0x32')](_0x18b43e['query']['fields']));_0x44edf0[_0xe065('0x31')]=_0x44edf0[_0xe065('0x31')]['length']?_0x44edf0[_0xe065('0x31')]:_0x24fc1c['model'];if(!_0x18b43e['query'][_0xe065('0x34')](_0xe065('0x35'))){_0x44edf0[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1b')]);_0x44edf0[_0xe065('0x1a')]=qs['offset'](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x44edf0[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x18b43e[_0xe065('0x2d')]['sort']);_0x44edf0[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x18b43e[_0xe065('0x2d')],_0x24fc1c[_0xe065('0x2e')]));if(_0x18b43e[_0xe065('0x2d')]['filter']){_0x44edf0['where']=_['merge'](_0x44edf0['where'],{'$or':_['map'](_0x44edf0[_0xe065('0x31')],function(_0x45b033){var _0x1733b4={};_0x1733b4[_0x45b033]={'$like':'%'+_0x18b43e[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x1733b4;})});}_0x44edf0[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x44edf0[_0xe065('0x3a')],{'mailboxuser':_0x2accad['mailbox']});_0x44edf0=_['merge']({},_0x44edf0,_0x18b43e[_0xe065('0x3c')]);return db[_0xe065('0x52')][_0xe065('0x53')](_0x44edf0)['then'](respondWithFilteredResult(_0x1f782f,_0x44edf0));})[_0xe065('0x4d')](handleError(_0x1f782f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8fabc4d..38a759a 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 _0x5212=['exports','mailbox','context','lodash','../../config/logger','bluebird','rimraf'];(function(_0x22c965,_0x2297e7){var _0x8cf3a9=function(_0x1a816b){while(--_0x1a816b){_0x22c965['push'](_0x22c965['shift']());}};_0x8cf3a9(++_0x2297e7);}(_0x5212,0x65));var _0x2521=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x5212[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0x2521('0x0'));var util=require('util');var logger=require(_0x2521('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2521('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2521('0x3'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x2521('0x4')]=function(_0x1539ef,_0x4375c8){return _0x1539ef['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x2521('0x5'),_0x2521('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5512=['request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d9230,_0x3c8f74){var _0x20bf0b=function(_0x4883d6){while(--_0x4883d6){_0x1d9230['push'](_0x1d9230['shift']());}};_0x20bf0b(++_0x3c8f74);}(_0x5512,0x19a));var _0x2551=function(_0x260ae8,_0x2d4bf0){_0x260ae8=_0x260ae8-0x0;var _0x502b9e=_0x5512[_0x260ae8];return _0x502b9e;};'use strict';var _=require(_0x2551('0x0'));var util=require(_0x2551('0x1'));var logger=require(_0x2551('0x2'))(_0x2551('0x3'));var moment=require(_0x2551('0x4'));var BPromise=require(_0x2551('0x5'));var rp=require(_0x2551('0x6'));var fs=require('fs');var path=require(_0x2551('0x7'));var rimraf=require('rimraf');var config=require(_0x2551('0x8'));var attributes=require(_0x2551('0x9'));module[_0x2551('0xa')]=function(_0x5c315f,_0x3e0144){return _0x5c315f[_0x2551('0xb')](_0x2551('0xc'),attributes,{'tableName':_0x2551('0xd'),'paranoid':![],'indexes':[{'name':_0x2551('0xe'),'fields':['mailbox',_0x2551('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 8714c31..c413fd0 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 _0x9c16=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x52eb75,_0x545010){var _0x10294a=function(_0x25399f){while(--_0x25399f){_0x52eb75['push'](_0x52eb75['shift']());}};_0x10294a(++_0x545010);}(_0x9c16,0x6f));var _0x69c1=function(_0x202fc8,_0x175b50){_0x202fc8=_0x202fc8-0x0;var _0x511804=_0x9c16[_0x202fc8];return _0x511804;};'use strict';var _=require(_0x69c1('0x0'));var util=require('util');var moment=require(_0x69c1('0x1'));var BPromise=require(_0x69c1('0x2'));var rs=require(_0x69c1('0x3'));var fs=require('fs');var Redis=require(_0x69c1('0x4'));var db=require(_0x69c1('0x5'))['db'];var utils=require(_0x69c1('0x6'));var logger=require(_0x69c1('0x7'))(_0x69c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x69c1('0x9'));var client=jayson['client'][_0x69c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x555474,_0x36c3b9,_0x425e2d){return new BPromise(function(_0x1f89f1,_0x5a631b){return client[_0x69c1('0xb')](_0x555474,_0x425e2d)[_0x69c1('0xc')](function(_0x18a219){logger[_0x69c1('0xd')](_0x69c1('0xe'),_0x36c3b9,_0x69c1('0xf'));logger[_0x69c1('0x10')](_0x69c1('0x11'),_0x36c3b9,_0x69c1('0xf'),JSON['stringify'](_0x18a219));if(_0x18a219['error']){if(_0x18a219['error']['code']===0x1f4){logger[_0x69c1('0x12')]('VoiceMail,\x20%s,\x20%s',_0x36c3b9,_0x18a219[_0x69c1('0x12')][_0x69c1('0x13')]);return _0x5a631b(_0x18a219['error']['message']);}logger[_0x69c1('0x12')](_0x69c1('0xe'),_0x36c3b9,_0x18a219['error'][_0x69c1('0x13')]);return _0x1f89f1(_0x18a219[_0x69c1('0x12')][_0x69c1('0x13')]);}else{logger['info'](_0x69c1('0xe'),_0x36c3b9,_0x69c1('0xf'));_0x1f89f1(_0x18a219[_0x69c1('0x14')][_0x69c1('0x13')]);}})[_0x69c1('0x15')](function(_0x18386c){logger[_0x69c1('0x12')](_0x69c1('0xe'),_0x36c3b9,_0x18386c);_0x5a631b(_0x18386c);});});} \ No newline at end of file +var _0x1ef3=['VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1aa255,_0x4b5ea7){var _0x166c17=function(_0x394f7c){while(--_0x394f7c){_0x1aa255['push'](_0x1aa255['shift']());}};_0x166c17(++_0x4b5ea7);}(_0x1ef3,0x1cd));var _0x31ef=function(_0x5d0ea9,_0x39382f){_0x5d0ea9=_0x5d0ea9-0x0;var _0x4a01a0=_0x1ef3[_0x5d0ea9];return _0x4a01a0;};'use strict';var _=require(_0x31ef('0x0'));var util=require(_0x31ef('0x1'));var moment=require('moment');var BPromise=require(_0x31ef('0x2'));var rs=require(_0x31ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31ef('0x5'))(_0x31ef('0x6'));var config=require(_0x31ef('0x7'));var jayson=require(_0x31ef('0x8'));var client=jayson[_0x31ef('0x9')][_0x31ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc74535,_0xaf8b18,_0xc203a6){return new BPromise(function(_0x1d12ba,_0x44af11){return client[_0x31ef('0xb')](_0xc74535,_0xc203a6)[_0x31ef('0xc')](function(_0x2373a1){logger['info']('VoiceMail,\x20%s,\x20%s',_0xaf8b18,'request\x20sent');logger[_0x31ef('0xd')](_0x31ef('0xe'),_0xaf8b18,_0x31ef('0xf'),JSON[_0x31ef('0x10')](_0x2373a1));if(_0x2373a1['error']){if(_0x2373a1[_0x31ef('0x11')][_0x31ef('0x12')]===0x1f4){logger[_0x31ef('0x11')](_0x31ef('0x13'),_0xaf8b18,_0x2373a1[_0x31ef('0x11')]['message']);return _0x44af11(_0x2373a1[_0x31ef('0x11')][_0x31ef('0x14')]);}logger[_0x31ef('0x11')](_0x31ef('0x13'),_0xaf8b18,_0x2373a1[_0x31ef('0x11')][_0x31ef('0x14')]);return _0x1d12ba(_0x2373a1['error']['message']);}else{logger[_0x31ef('0x15')](_0x31ef('0x13'),_0xaf8b18,_0x31ef('0xf'));_0x1d12ba(_0x2373a1[_0x31ef('0x16')]['message']);}})[_0x31ef('0x17')](function(_0x5003f2){logger['error']('VoiceMail,\x20%s,\x20%s',_0xaf8b18,_0x5003f2);_0x44af11(_0x5003f2);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 53ae883..fcdde83 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 _0x04eb=['../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id/download','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x04eb,0x79));var _0xb04e=function(_0x123c38,_0x2c5188){_0x123c38=_0x123c38-0x0;var _0x203c01=_0x04eb[_0x123c38];return _0x203c01;};'use strict';var multer=require(_0xb04e('0x0'));var util=require('util');var path=require(_0xb04e('0x1'));var timeout=require(_0xb04e('0x2'));var express=require('express');var router=express[_0xb04e('0x3')]();var fs_extra=require(_0xb04e('0x4'));var auth=require(_0xb04e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb04e('0x6'));var controller=require(_0xb04e('0x7'));router['get']('/',auth[_0xb04e('0x8')](),controller[_0xb04e('0x9')]);router[_0xb04e('0xa')]('/:id',auth[_0xb04e('0x8')](),controller['show']);router[_0xb04e('0xa')](_0xb04e('0xb'),auth[_0xb04e('0x8')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xb04e('0xc')]);router[_0xb04e('0xd')](_0xb04e('0xe'),auth[_0xb04e('0x8')](),controller[_0xb04e('0xf')]);router['delete'](_0xb04e('0xe'),auth[_0xb04e('0x8')](),controller[_0xb04e('0x10')]);module[_0xb04e('0x11')]=router; \ No newline at end of file +var _0x02b5=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','download','post','create','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x3a023f,_0x3a0789){var _0x1de363=function(_0x239e8e){while(--_0x239e8e){_0x3a023f['push'](_0x3a023f['shift']());}};_0x1de363(++_0x3a0789);}(_0x02b5,0xc2));var _0x502b=function(_0x3b8bde,_0x75252){_0x3b8bde=_0x3b8bde-0x0;var _0x17c714=_0x02b5[_0x3b8bde];return _0x17c714;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x502b('0x0'));var timeout=require(_0x502b('0x1'));var express=require(_0x502b('0x2'));var router=express[_0x502b('0x3')]();var fs_extra=require(_0x502b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x502b('0x5'));var config=require(_0x502b('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x502b('0x7')]('/',auth[_0x502b('0x8')](),controller['index']);router['get'](_0x502b('0x9'),auth['isAuthenticated'](),controller[_0x502b('0xa')]);router[_0x502b('0x7')]('/:id/download',auth[_0x502b('0x8')](),controller[_0x502b('0xb')]);router[_0x502b('0xc')]('/',auth[_0x502b('0x8')](),controller[_0x502b('0xd')]);router[_0x502b('0xe')](_0x502b('0x9'),auth[_0x502b('0x8')](),controller[_0x502b('0xf')]);router[_0x502b('0x10')](_0x502b('0x9'),auth[_0x502b('0x8')](),controller['destroy']);module[_0x502b('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0139fe8..a57f6ba 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 _0x9b1f=['long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','STRING','BLOB'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9b1f,0x113));var _0xf9b1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x9b1f[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require('sequelize');module[_0xf9b1('0x0')]={'name':{'type':Sequelize[_0xf9b1('0x1')],'get':function(_0x5ef58b){return this[_0xf9b1('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xf9b1('0x4')](_0xf9b1('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf9b1('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xf9b1('0x6')](_0xf9b1('0x7'))}}; \ No newline at end of file +var _0xb6b8=['INTEGER','STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0xb9b453,_0x52b099){var _0x5c9dfd=function(_0x24240a){while(--_0x24240a){_0xb9b453['push'](_0xb9b453['shift']());}};_0x5c9dfd(++_0x52b099);}(_0xb6b8,0x9e));var _0x8b6b=function(_0x3b7c79,_0x4c94fe){_0x3b7c79=_0x3b7c79-0x0;var _0x50cb9d=_0xb6b8[_0x3b7c79];return _0x50cb9d;};'use strict';var Sequelize=require(_0x8b6b('0x0'));module[_0x8b6b('0x1')]={'name':{'type':Sequelize[_0x8b6b('0x2')],'get':function(_0x1438f5){return this[_0x8b6b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x8b6b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x8b6b('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8b6b('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x8b6b('0x7')](_0x8b6b('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 47706dd..18aabd9 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 _0x2016=['map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0x2016,0x166));var _0x6201=function(_0x292d5b,_0x2d8819){_0x292d5b=_0x292d5b-0x0;var _0x968786=_0x2016[_0x292d5b];return _0x968786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6201('0x0'));var zipdir=require(_0x6201('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6201('0x2'));var moment=require(_0x6201('0x3'));var BPromise=require(_0x6201('0x4'));var Mustache=require(_0x6201('0x5'));var util=require(_0x6201('0x6'));var path=require('path');var sox=require(_0x6201('0x7'));var csv=require(_0x6201('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6201('0x9'));var crypto=require('crypto');var jsforce=require(_0x6201('0xa'));var deskjs=require(_0x6201('0xb'));var toCsv=require(_0x6201('0x8'));var querystring=require(_0x6201('0xc'));var Papa=require('papaparse');var Redis=require(_0x6201('0xd'));var authService=require(_0x6201('0xe'));var qs=require(_0x6201('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6201('0x10'));var logger=require(_0x6201('0x11'))(_0x6201('0x12'));var utils=require(_0x6201('0x13'));var config=require(_0x6201('0x14'));var licenseUtil=require(_0x6201('0x15'));var db=require(_0x6201('0x16'))['db'];function respondWithStatusCode(_0x5e630e,_0x46afe7){_0x46afe7=_0x46afe7||0xcc;return function(_0x1b5612){if(_0x1b5612){return _0x5e630e[_0x6201('0x17')](_0x46afe7);}return _0x5e630e[_0x6201('0x18')](_0x46afe7)['end']();};}function respondWithResult(_0x19ff61,_0x5e7ad6){_0x5e7ad6=_0x5e7ad6||0xc8;return function(_0x40f79d){if(_0x40f79d){return _0x19ff61[_0x6201('0x18')](_0x5e7ad6)[_0x6201('0x19')](_0x40f79d);}};}function respondWithFilteredResult(_0xa876c7,_0xaa0c97){return function(_0x5a79d2){if(_0x5a79d2){var _0x4e82c3=typeof _0xaa0c97['offset']===_0x6201('0x1a')&&typeof _0xaa0c97[_0x6201('0x1b')]===_0x6201('0x1a');var _0x3a0c5a=_0x5a79d2[_0x6201('0x1c')];var _0x4d8690=_0x4e82c3?0x0:_0xaa0c97[_0x6201('0x1d')];var _0x45c1bd=_0x4e82c3?_0x5a79d2[_0x6201('0x1c')]:_0xaa0c97['offset']+_0xaa0c97[_0x6201('0x1b')];var _0x242583;if(_0x45c1bd>=_0x3a0c5a){_0x45c1bd=_0x3a0c5a;_0x242583=0xc8;}else{_0x242583=0xce;}_0xa876c7[_0x6201('0x18')](_0x242583);return _0xa876c7[_0x6201('0x1e')](_0x6201('0x1f'),_0x4d8690+'-'+_0x45c1bd+'/'+_0x3a0c5a)['json'](_0x5a79d2);}return null;};}function patchUpdates(_0x2575e4){return function(_0x463ff3){try{jsonpatch[_0x6201('0x20')](_0x463ff3,_0x2575e4,!![]);}catch(_0x3cbc02){return BPromise[_0x6201('0x21')](_0x3cbc02);}return _0x463ff3[_0x6201('0x22')]();};}function saveUpdates(_0x514f30,_0x3ba4ce){return function(_0x1aec15){if(_0x1aec15){return _0x1aec15[_0x6201('0x23')](_0x514f30)['then'](function(_0x122222){return _0x122222;});}return null;};}function removeEntity(_0x2c7c27,_0x54448d){return function(_0x4884c4){if(_0x4884c4){return _0x4884c4[_0x6201('0x24')]()[_0x6201('0x25')](function(){_0x2c7c27[_0x6201('0x18')](0xcc)[_0x6201('0x26')]();});}};}function handleEntityNotFound(_0xa59553,_0x5d185f){return function(_0x5537b2){if(!_0x5537b2){_0xa59553['sendStatus'](0x194);}return _0x5537b2;};}function handleError(_0x1e83d1,_0x1d913f){_0x1d913f=_0x1d913f||0x1f4;return function(_0x3497da){logger['error'](_0x3497da[_0x6201('0x27')]);if(_0x3497da[_0x6201('0x28')]){delete _0x3497da[_0x6201('0x28')];}_0x1e83d1['status'](_0x1d913f)[_0x6201('0x29')](_0x3497da);};}exports['index']=function(_0x39dac4,_0x384ab5){var _0x50785e={},_0x480497={},_0x4a71df={'count':0x0,'rows':[]};var _0x31c46d=_[_0x6201('0x2a')](db[_0x6201('0x2b')][_0x6201('0x2c')],function(_0x490c2f){return{'name':_0x490c2f[_0x6201('0x2d')],'type':_0x490c2f[_0x6201('0x2e')]['key']};});_0x480497[_0x6201('0x2f')]=_[_0x6201('0x30')](_[_0x6201('0x2a')](_0x31c46d,'name'),[_0x6201('0x28')]);_0x480497['query']=_[_0x6201('0x31')](_0x39dac4[_0x6201('0x32')]);_0x480497['filters']=_[_0x6201('0x33')](_0x480497[_0x6201('0x2f')],_0x480497[_0x6201('0x32')]);_0x50785e[_0x6201('0x34')]=_['intersection'](_0x480497[_0x6201('0x2f')],qs[_0x6201('0x35')](_0x39dac4[_0x6201('0x32')][_0x6201('0x35')]));_0x50785e[_0x6201('0x34')]=_0x50785e[_0x6201('0x34')]['length']?_0x50785e[_0x6201('0x34')]:_0x480497[_0x6201('0x2f')];if(!_0x39dac4[_0x6201('0x32')][_0x6201('0x36')]('nolimit')){_0x50785e['limit']=qs[_0x6201('0x1b')](_0x39dac4[_0x6201('0x32')][_0x6201('0x1b')]);_0x50785e[_0x6201('0x1d')]=qs[_0x6201('0x1d')](_0x39dac4[_0x6201('0x32')]['offset']);}_0x50785e['order']=qs[_0x6201('0x37')](_0x39dac4[_0x6201('0x32')][_0x6201('0x37')]);_0x50785e[_0x6201('0x38')]=qs[_0x6201('0x39')](_[_0x6201('0x3a')](_0x39dac4['query'],_0x480497['filters']),_0x31c46d);if(_0x39dac4['query']['filter']){_0x50785e[_0x6201('0x38')]=_[_0x6201('0x3b')](_0x50785e[_0x6201('0x38')],{'$or':_[_0x6201('0x2a')](_0x31c46d,function(_0x1f6037){if(_0x1f6037[_0x6201('0x2e')]!=='VIRTUAL'){var _0x2bdb64={};_0x2bdb64[_0x1f6037['name']]={'$like':'%'+_0x39dac4[_0x6201('0x32')][_0x6201('0x3c')]+'%'};return _0x2bdb64;}})});}_0x50785e=_[_0x6201('0x3b')]({},_0x50785e,_0x39dac4[_0x6201('0x3d')]);var _0x341501={'where':_0x50785e[_0x6201('0x38')]};return db[_0x6201('0x2b')][_0x6201('0x1c')](_0x341501)['then'](function(_0x23fa75){_0x4a71df['count']=_0x23fa75;if(_0x39dac4['query'][_0x6201('0x3e')]){_0x50785e[_0x6201('0x3f')]=[{'all':!![]}];}return db[_0x6201('0x2b')][_0x6201('0x40')](_0x50785e);})[_0x6201('0x25')](function(_0x33d8b6){_0x4a71df[_0x6201('0x41')]=_0x33d8b6;return _0x4a71df;})[_0x6201('0x25')](respondWithFilteredResult(_0x384ab5,_0x50785e))['catch'](handleError(_0x384ab5,null));};exports[_0x6201('0x42')]=function(_0x4a9a15,_0x20c5a4){var _0x40c76e={'raw':!![],'where':{'id':_0x4a9a15[_0x6201('0x43')]['id']}},_0x4ca46d={};_0x4ca46d[_0x6201('0x2f')]=_[_0x6201('0x31')](db[_0x6201('0x2b')][_0x6201('0x2c')]);_0x4ca46d[_0x6201('0x32')]=_['keys'](_0x4a9a15[_0x6201('0x32')]);_0x4ca46d['filters']=_['intersection'](_0x4ca46d[_0x6201('0x2f')],_0x4ca46d['query']);_0x40c76e[_0x6201('0x34')]=_[_0x6201('0x33')](_0x4ca46d[_0x6201('0x2f')],qs[_0x6201('0x35')](_0x4a9a15[_0x6201('0x32')][_0x6201('0x35')]));_0x40c76e['attributes']=_0x40c76e[_0x6201('0x34')]['length']?_0x40c76e[_0x6201('0x34')]:_0x4ca46d['model'];if(_0x4a9a15['query'][_0x6201('0x3e')]){_0x40c76e[_0x6201('0x3f')]=[{'all':!![]}];}_0x40c76e=_[_0x6201('0x3b')]({},_0x40c76e,_0x4a9a15[_0x6201('0x3d')]);return db[_0x6201('0x2b')][_0x6201('0x44')](_0x40c76e)[_0x6201('0x25')](handleEntityNotFound(_0x20c5a4,null))[_0x6201('0x25')](respondWithResult(_0x20c5a4,null))[_0x6201('0x45')](handleError(_0x20c5a4,null));};exports[_0x6201('0x46')]=function(_0x34f928,_0x597bbe){return db[_0x6201('0x2b')][_0x6201('0x46')](_0x34f928['body'],{})['then'](respondWithResult(_0x597bbe,0xc9))[_0x6201('0x45')](handleError(_0x597bbe,null));};exports['update']=function(_0x4ecc90,_0x5165ce){if(_0x4ecc90[_0x6201('0x47')]['id']){delete _0x4ecc90['body']['id'];}return db[_0x6201('0x2b')]['find']({'where':{'id':_0x4ecc90[_0x6201('0x43')]['id']}})['then'](handleEntityNotFound(_0x5165ce,null))['then'](saveUpdates(_0x4ecc90[_0x6201('0x47')],null))[_0x6201('0x25')](respondWithResult(_0x5165ce,null))[_0x6201('0x45')](handleError(_0x5165ce,null));};exports['destroy']=function(_0x32b15d,_0x234090){return db[_0x6201('0x2b')][_0x6201('0x44')]({'where':{'id':_0x32b15d[_0x6201('0x43')]['id']}})['then'](handleEntityNotFound(_0x234090,null))[_0x6201('0x25')](removeEntity(_0x234090,null))[_0x6201('0x45')](handleError(_0x234090,null));};exports[_0x6201('0x48')]=function(_0x14110a,_0x3ee1ba,_0x2acec7){return db[_0x6201('0x2b')]['find']({'where':{'id':_0x14110a[_0x6201('0x43')]['id']},'attributes':['id','recording',_0x6201('0x49')]})[_0x6201('0x25')](handleEntityNotFound(_0x3ee1ba,null))[_0x6201('0x25')](function(_0x34844a){if(_0x34844a){if(!_0x34844a['recording']){throw new db[(_0x6201('0x4a'))][(_0x6201('0x4b'))](_0x6201('0x4c'));}var _0x3e80f3={'Content-Type':_0x6201('0x4d'),'Content-Disposition':'attachment'};if(_0x34844a[_0x6201('0x49')]){_0x3e80f3['Content-Disposition']=_0x6201('0x4e')+_0x34844a[_0x6201('0x49')]+_0x6201('0x4f');}_0x3ee1ba['set'](_0x3e80f3);return _0x3ee1ba[_0x6201('0x29')](new Buffer(_0x34844a['recording']));}})[_0x6201('0x45')](handleError(_0x3ee1ba,null));}; \ No newline at end of file +var _0xaf6e=['body','update','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMailMessage','count','includeAll','include','findAll','catch','show','params','find','create'];(function(_0x1bc635,_0x4a1b08){var _0x1179e0=function(_0x48b2ed){while(--_0x48b2ed){_0x1bc635['push'](_0x1bc635['shift']());}};_0x1179e0(++_0x4a1b08);}(_0xaf6e,0x10d));var _0xeaf6=function(_0x4dfc8f,_0x6c2b7e){_0x4dfc8f=_0x4dfc8f-0x0;var _0x2f3404=_0xaf6e[_0x4dfc8f];return _0x2f3404;};'use strict';var emlformat=require(_0xeaf6('0x0'));var rimraf=require(_0xeaf6('0x1'));var zipdir=require(_0xeaf6('0x2'));var jsonpatch=require(_0xeaf6('0x3'));var rp=require('request-promise');var moment=require(_0xeaf6('0x4'));var BPromise=require(_0xeaf6('0x5'));var Mustache=require(_0xeaf6('0x6'));var util=require(_0xeaf6('0x7'));var path=require(_0xeaf6('0x8'));var sox=require('sox');var csv=require(_0xeaf6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeaf6('0xa'));var _=require(_0xeaf6('0xb'));var squel=require(_0xeaf6('0xc'));var crypto=require(_0xeaf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeaf6('0xe'));var toCsv=require(_0xeaf6('0x9'));var querystring=require(_0xeaf6('0xf'));var Papa=require(_0xeaf6('0x10'));var Redis=require(_0xeaf6('0x11'));var authService=require(_0xeaf6('0x12'));var qs=require(_0xeaf6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeaf6('0x14'));var logger=require(_0xeaf6('0x15'))(_0xeaf6('0x16'));var utils=require(_0xeaf6('0x17'));var config=require(_0xeaf6('0x18'));var licenseUtil=require(_0xeaf6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7400,_0x3fbe97){_0x3fbe97=_0x3fbe97||0xcc;return function(_0x181b48){if(_0x181b48){return _0x3d7400[_0xeaf6('0x1a')](_0x3fbe97);}return _0x3d7400[_0xeaf6('0x1b')](_0x3fbe97)[_0xeaf6('0x1c')]();};}function respondWithResult(_0x38c106,_0x5bbb47){_0x5bbb47=_0x5bbb47||0xc8;return function(_0x2acdce){if(_0x2acdce){return _0x38c106['status'](_0x5bbb47)[_0xeaf6('0x1d')](_0x2acdce);}};}function respondWithFilteredResult(_0x4075b0,_0x2c80a6){return function(_0x101955){if(_0x101955){var _0x29e151=typeof _0x2c80a6[_0xeaf6('0x1e')]==='undefined'&&typeof _0x2c80a6[_0xeaf6('0x1f')]===_0xeaf6('0x20');var _0x1cf197=_0x101955['count'];var _0x1e40af=_0x29e151?0x0:_0x2c80a6[_0xeaf6('0x1e')];var _0x3df9f4=_0x29e151?_0x101955['count']:_0x2c80a6['offset']+_0x2c80a6[_0xeaf6('0x1f')];var _0xcbb514;if(_0x3df9f4>=_0x1cf197){_0x3df9f4=_0x1cf197;_0xcbb514=0xc8;}else{_0xcbb514=0xce;}_0x4075b0['status'](_0xcbb514);return _0x4075b0[_0xeaf6('0x21')](_0xeaf6('0x22'),_0x1e40af+'-'+_0x3df9f4+'/'+_0x1cf197)['json'](_0x101955);}return null;};}function patchUpdates(_0x58ff44){return function(_0x429821){try{jsonpatch[_0xeaf6('0x23')](_0x429821,_0x58ff44,!![]);}catch(_0x14e8cf){return BPromise[_0xeaf6('0x24')](_0x14e8cf);}return _0x429821['save']();};}function saveUpdates(_0x4d167d,_0x135ce6){return function(_0x486eb4){if(_0x486eb4){return _0x486eb4['update'](_0x4d167d)[_0xeaf6('0x25')](function(_0x4e5ffd){return _0x4e5ffd;});}return null;};}function removeEntity(_0x4eb042,_0x5b1821){return function(_0x567f56){if(_0x567f56){return _0x567f56[_0xeaf6('0x26')]()['then'](function(){_0x4eb042[_0xeaf6('0x1b')](0xcc)[_0xeaf6('0x1c')]();});}};}function handleEntityNotFound(_0x31a667,_0x47045e){return function(_0x2560d9){if(!_0x2560d9){_0x31a667[_0xeaf6('0x1a')](0x194);}return _0x2560d9;};}function handleError(_0x4ccc3e,_0x53c6a4){_0x53c6a4=_0x53c6a4||0x1f4;return function(_0x12e279){logger[_0xeaf6('0x27')](_0x12e279[_0xeaf6('0x28')]);if(_0x12e279['name']){delete _0x12e279[_0xeaf6('0x29')];}_0x4ccc3e['status'](_0x53c6a4)[_0xeaf6('0x2a')](_0x12e279);};}exports['index']=function(_0x18abd3,_0x495856){var _0x347fa4={},_0x2bc045={},_0x5961f8={'count':0x0,'rows':[]};var _0x54c5b2=_['map'](db['VoiceMailMessage'][_0xeaf6('0x2b')],function(_0x57d186){return{'name':_0x57d186['fieldName'],'type':_0x57d186['type'][_0xeaf6('0x2c')]};});_0x2bc045['model']=_['differenceBy'](_[_0xeaf6('0x2d')](_0x54c5b2,_0xeaf6('0x29')),[_0xeaf6('0x29')]);_0x2bc045[_0xeaf6('0x2e')]=_[_0xeaf6('0x2f')](_0x18abd3['query']);_0x2bc045[_0xeaf6('0x30')]=_[_0xeaf6('0x31')](_0x2bc045['model'],_0x2bc045[_0xeaf6('0x2e')]);_0x347fa4[_0xeaf6('0x32')]=_[_0xeaf6('0x31')](_0x2bc045['model'],qs[_0xeaf6('0x33')](_0x18abd3[_0xeaf6('0x2e')]['fields']));_0x347fa4[_0xeaf6('0x32')]=_0x347fa4[_0xeaf6('0x32')][_0xeaf6('0x34')]?_0x347fa4['attributes']:_0x2bc045[_0xeaf6('0x35')];if(!_0x18abd3[_0xeaf6('0x2e')][_0xeaf6('0x36')](_0xeaf6('0x37'))){_0x347fa4[_0xeaf6('0x1f')]=qs[_0xeaf6('0x1f')](_0x18abd3[_0xeaf6('0x2e')]['limit']);_0x347fa4['offset']=qs['offset'](_0x18abd3[_0xeaf6('0x2e')][_0xeaf6('0x1e')]);}_0x347fa4[_0xeaf6('0x38')]=qs['sort'](_0x18abd3[_0xeaf6('0x2e')][_0xeaf6('0x39')]);_0x347fa4[_0xeaf6('0x3a')]=qs['filters'](_[_0xeaf6('0x3b')](_0x18abd3[_0xeaf6('0x2e')],_0x2bc045[_0xeaf6('0x30')]),_0x54c5b2);if(_0x18abd3[_0xeaf6('0x2e')][_0xeaf6('0x3c')]){_0x347fa4[_0xeaf6('0x3a')]=_[_0xeaf6('0x3d')](_0x347fa4['where'],{'$or':_[_0xeaf6('0x2d')](_0x54c5b2,function(_0x3b32af){if(_0x3b32af[_0xeaf6('0x3e')]!==_0xeaf6('0x3f')){var _0x4f6ae2={};_0x4f6ae2[_0x3b32af[_0xeaf6('0x29')]]={'$like':'%'+_0x18abd3['query'][_0xeaf6('0x3c')]+'%'};return _0x4f6ae2;}})});}_0x347fa4=_['merge']({},_0x347fa4,_0x18abd3[_0xeaf6('0x40')]);var _0xe56e7e={'where':_0x347fa4[_0xeaf6('0x3a')]};return db[_0xeaf6('0x41')][_0xeaf6('0x42')](_0xe56e7e)['then'](function(_0x229153){_0x5961f8['count']=_0x229153;if(_0x18abd3[_0xeaf6('0x2e')][_0xeaf6('0x43')]){_0x347fa4[_0xeaf6('0x44')]=[{'all':!![]}];}return db[_0xeaf6('0x41')][_0xeaf6('0x45')](_0x347fa4);})[_0xeaf6('0x25')](function(_0x59d562){_0x5961f8['rows']=_0x59d562;return _0x5961f8;})[_0xeaf6('0x25')](respondWithFilteredResult(_0x495856,_0x347fa4))[_0xeaf6('0x46')](handleError(_0x495856,null));};exports[_0xeaf6('0x47')]=function(_0x3f8eaf,_0x47bd2a){var _0x337599={'raw':!![],'where':{'id':_0x3f8eaf[_0xeaf6('0x48')]['id']}},_0x4f8b84={};_0x4f8b84['model']=_[_0xeaf6('0x2f')](db['VoiceMailMessage']['rawAttributes']);_0x4f8b84[_0xeaf6('0x2e')]=_[_0xeaf6('0x2f')](_0x3f8eaf['query']);_0x4f8b84[_0xeaf6('0x30')]=_['intersection'](_0x4f8b84[_0xeaf6('0x35')],_0x4f8b84[_0xeaf6('0x2e')]);_0x337599[_0xeaf6('0x32')]=_[_0xeaf6('0x31')](_0x4f8b84[_0xeaf6('0x35')],qs[_0xeaf6('0x33')](_0x3f8eaf[_0xeaf6('0x2e')]['fields']));_0x337599[_0xeaf6('0x32')]=_0x337599[_0xeaf6('0x32')][_0xeaf6('0x34')]?_0x337599['attributes']:_0x4f8b84['model'];if(_0x3f8eaf[_0xeaf6('0x2e')][_0xeaf6('0x43')]){_0x337599['include']=[{'all':!![]}];}_0x337599=_['merge']({},_0x337599,_0x3f8eaf[_0xeaf6('0x40')]);return db['VoiceMailMessage'][_0xeaf6('0x49')](_0x337599)['then'](handleEntityNotFound(_0x47bd2a,null))[_0xeaf6('0x25')](respondWithResult(_0x47bd2a,null))[_0xeaf6('0x46')](handleError(_0x47bd2a,null));};exports['create']=function(_0x1b1217,_0x26ff91){return db[_0xeaf6('0x41')][_0xeaf6('0x4a')](_0x1b1217[_0xeaf6('0x4b')],{})[_0xeaf6('0x25')](respondWithResult(_0x26ff91,0xc9))['catch'](handleError(_0x26ff91,null));};exports[_0xeaf6('0x4c')]=function(_0x457683,_0x42bfce){if(_0x457683[_0xeaf6('0x4b')]['id']){delete _0x457683[_0xeaf6('0x4b')]['id'];}return db[_0xeaf6('0x41')][_0xeaf6('0x49')]({'where':{'id':_0x457683[_0xeaf6('0x48')]['id']}})[_0xeaf6('0x25')](handleEntityNotFound(_0x42bfce,null))['then'](saveUpdates(_0x457683[_0xeaf6('0x4b')],null))[_0xeaf6('0x25')](respondWithResult(_0x42bfce,null))['catch'](handleError(_0x42bfce,null));};exports[_0xeaf6('0x26')]=function(_0x4c73e1,_0x5ec6ed){return db[_0xeaf6('0x41')][_0xeaf6('0x49')]({'where':{'id':_0x4c73e1[_0xeaf6('0x48')]['id']}})[_0xeaf6('0x25')](handleEntityNotFound(_0x5ec6ed,null))['then'](removeEntity(_0x5ec6ed,null))['catch'](handleError(_0x5ec6ed,null));};exports['download']=function(_0x4e042c,_0x251687,_0x1585c5){return db['VoiceMailMessage'][_0xeaf6('0x49')]({'where':{'id':_0x4e042c[_0xeaf6('0x48')]['id']},'attributes':['id',_0xeaf6('0x4d'),_0xeaf6('0x4e')]})['then'](handleEntityNotFound(_0x251687,null))[_0xeaf6('0x25')](function(_0x54d3c5){if(_0x54d3c5){if(!_0x54d3c5[_0xeaf6('0x4d')]){throw new db[(_0xeaf6('0x4f'))]['ValidationError'](_0xeaf6('0x50'));}var _0x40ad3c={'Content-Type':_0xeaf6('0x51'),'Content-Disposition':_0xeaf6('0x52')};if(_0x54d3c5[_0xeaf6('0x4e')]){_0x40ad3c[_0xeaf6('0x53')]=_0xeaf6('0x54')+_0x54d3c5[_0xeaf6('0x4e')]+_0xeaf6('0x55');}_0x251687[_0xeaf6('0x21')](_0x40ad3c);return _0x251687[_0xeaf6('0x2a')](new Buffer(_0x54d3c5[_0xeaf6('0x4d')]));}})[_0xeaf6('0x46')](handleError(_0x251687,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a065681..5f6d0ee 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 _0x97a6=['exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x590ef7,_0x175f08){var _0x4c2634=function(_0xf94570){while(--_0xf94570){_0x590ef7['push'](_0x590ef7['shift']());}};_0x4c2634(++_0x175f08);}(_0x97a6,0x11c));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(_0x13882e,_0xa2000c){return _0x13882e['define'](_0x697a('0xb'),attributes,{'tableName':_0x697a('0xc'),'paranoid':![],'indexes':[{'name':_0x697a('0xd'),'fields':[_0x697a('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd7c2=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x7f30ae,_0xcaeaf3){var _0x4ec1fc=function(_0x550619){while(--_0x550619){_0x7f30ae['push'](_0x7f30ae['shift']());}};_0x4ec1fc(++_0xcaeaf3);}(_0xd7c2,0x1d9));var _0x2d7c=function(_0xcda34d,_0x2e196f){_0xcda34d=_0xcda34d-0x0;var _0x4bc776=_0xd7c2[_0xcda34d];return _0x4bc776;};'use strict';var _=require(_0x2d7c('0x0'));var util=require('util');var logger=require(_0x2d7c('0x1'))('api');var moment=require(_0x2d7c('0x2'));var BPromise=require('bluebird');var rp=require(_0x2d7c('0x3'));var fs=require('fs');var path=require(_0x2d7c('0x4'));var rimraf=require(_0x2d7c('0x5'));var config=require(_0x2d7c('0x6'));var attributes=require(_0x2d7c('0x7'));module[_0x2d7c('0x8')]=function(_0x233cb2,_0x4f7b01){return _0x233cb2[_0x2d7c('0x9')](_0x2d7c('0xa'),attributes,{'tableName':_0x2d7c('0xb'),'paranoid':![],'indexes':[{'name':_0x2d7c('0xc'),'fields':[_0x2d7c('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b6a593e..96ac72c 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 _0xcf16=['code','message','info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6a202,_0x5f292f){var _0x22839f=function(_0x267710){while(--_0x267710){_0x6a202['push'](_0x6a202['shift']());}};_0x22839f(++_0x5f292f);}(_0xcf16,0x1e4));var _0x6cf1=function(_0x33b045,_0x4d8ec8){_0x33b045=_0x33b045-0x0;var _0x216414=_0xcf16[_0x33b045];return _0x216414;};'use strict';var _=require(_0x6cf1('0x0'));var util=require(_0x6cf1('0x1'));var moment=require('moment');var BPromise=require(_0x6cf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cf1('0x3'))['db'];var utils=require(_0x6cf1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6cf1('0x5'));var jayson=require(_0x6cf1('0x6'));var client=jayson[_0x6cf1('0x7')][_0x6cf1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdd00d2,_0x23e148,_0x4444bb){return new BPromise(function(_0x254dd7,_0x4e4082){return client['request'](_0xdd00d2,_0x4444bb)[_0x6cf1('0x9')](function(_0x3ef964){logger['info'](_0x6cf1('0xa'),_0x23e148,_0x6cf1('0xb'));logger[_0x6cf1('0xc')](_0x6cf1('0xd'),_0x23e148,'request\x20sent',JSON[_0x6cf1('0xe')](_0x3ef964));if(_0x3ef964['error']){if(_0x3ef964[_0x6cf1('0xf')][_0x6cf1('0x10')]===0x1f4){logger[_0x6cf1('0xf')](_0x6cf1('0xa'),_0x23e148,_0x3ef964[_0x6cf1('0xf')][_0x6cf1('0x11')]);return _0x4e4082(_0x3ef964[_0x6cf1('0xf')][_0x6cf1('0x11')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x23e148,_0x3ef964['error'][_0x6cf1('0x11')]);return _0x254dd7(_0x3ef964[_0x6cf1('0xf')][_0x6cf1('0x11')]);}else{logger[_0x6cf1('0x12')](_0x6cf1('0xa'),_0x23e148,_0x6cf1('0xb'));_0x254dd7(_0x3ef964['result']['message']);}})[_0x6cf1('0x13')](function(_0x13ce48){logger[_0x6cf1('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x23e148,_0x13ce48);_0x4e4082(_0x13ce48);});});} \ No newline at end of file +var _0x7c40=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x4805dd,_0x42f931){var _0x597b2c=function(_0x1c9921){while(--_0x1c9921){_0x4805dd['push'](_0x4805dd['shift']());}};_0x597b2c(++_0x42f931);}(_0x7c40,0x83));var _0x07c4=function(_0x2e3308,_0x58b165){_0x2e3308=_0x2e3308-0x0;var _0x2f94b5=_0x7c40[_0x2e3308];return _0x2f94b5;};'use strict';var _=require('lodash');var util=require(_0x07c4('0x0'));var moment=require(_0x07c4('0x1'));var BPromise=require(_0x07c4('0x2'));var rs=require(_0x07c4('0x3'));var fs=require('fs');var Redis=require(_0x07c4('0x4'));var db=require(_0x07c4('0x5'))['db'];var utils=require(_0x07c4('0x6'));var logger=require(_0x07c4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07c4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2432bd,_0x40fca7,_0x5189b4){return new BPromise(function(_0x4f904e,_0xff2895){return client[_0x07c4('0x9')](_0x2432bd,_0x5189b4)[_0x07c4('0xa')](function(_0x55910a){logger[_0x07c4('0xb')](_0x07c4('0xc'),_0x40fca7,_0x07c4('0xd'));logger[_0x07c4('0xe')](_0x07c4('0xf'),_0x40fca7,_0x07c4('0xd'),JSON[_0x07c4('0x10')](_0x55910a));if(_0x55910a[_0x07c4('0x11')]){if(_0x55910a[_0x07c4('0x11')][_0x07c4('0x12')]===0x1f4){logger[_0x07c4('0x11')](_0x07c4('0xc'),_0x40fca7,_0x55910a[_0x07c4('0x11')][_0x07c4('0x13')]);return _0xff2895(_0x55910a[_0x07c4('0x11')][_0x07c4('0x13')]);}logger[_0x07c4('0x11')](_0x07c4('0xc'),_0x40fca7,_0x55910a[_0x07c4('0x11')]['message']);return _0x4f904e(_0x55910a[_0x07c4('0x11')][_0x07c4('0x13')]);}else{logger[_0x07c4('0xb')](_0x07c4('0xc'),_0x40fca7,_0x07c4('0xd'));_0x4f904e(_0x55910a[_0x07c4('0x14')]['message']);}})[_0x07c4('0x15')](function(_0xaa2fd0){logger['error'](_0x07c4('0xc'),_0x40fca7,_0xaa2fd0);_0xff2895(_0xaa2fd0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 110f591..80f657d 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 _0x2a72=['/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','index'];(function(_0x5ef17b,_0x107cc9){var _0x472064=function(_0xd82362){while(--_0xd82362){_0x5ef17b['push'](_0x5ef17b['shift']());}};_0x472064(++_0x107cc9);}(_0x2a72,0x1f1));var _0x22a7=function(_0x3de8a2,_0x1c8615){_0x3de8a2=_0x3de8a2-0x0;var _0x267573=_0x2a72[_0x3de8a2];return _0x267573;};'use strict';var multer=require(_0x22a7('0x0'));var util=require(_0x22a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x22a7('0x2')]();var fs_extra=require(_0x22a7('0x3'));var auth=require(_0x22a7('0x4'));var interaction=require(_0x22a7('0x5'));var config=require('../../config/environment');var controller=require(_0x22a7('0x6'));router[_0x22a7('0x7')]('/',auth['isAuthenticated'](),controller[_0x22a7('0x8')]);router[_0x22a7('0x7')](_0x22a7('0x9'),auth[_0x22a7('0xa')](),controller[_0x22a7('0xb')]);router[_0x22a7('0x7')](_0x22a7('0xc'),auth['isAuthenticated'](),controller[_0x22a7('0xd')]);router[_0x22a7('0xe')]('/',auth[_0x22a7('0xa')](),controller[_0x22a7('0xf')]);router[_0x22a7('0xe')](_0x22a7('0xc'),auth[_0x22a7('0xa')](),controller[_0x22a7('0x10')]);router[_0x22a7('0x11')](_0x22a7('0x9'),auth[_0x22a7('0xa')](),controller[_0x22a7('0x12')]);router[_0x22a7('0x13')](_0x22a7('0x9'),auth[_0x22a7('0xa')](),controller[_0x22a7('0x14')]);router[_0x22a7('0x13')](_0x22a7('0x15'),auth[_0x22a7('0xa')](),controller[_0x22a7('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf306=['isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x50a1f6,_0x238fd8){var _0x84f8d4=function(_0x2d9586){while(--_0x2d9586){_0x50a1f6['push'](_0x50a1f6['shift']());}};_0x84f8d4(++_0x238fd8);}(_0xf306,0x1b8));var _0x6f30=function(_0x11dee9,_0x500fad){_0x11dee9=_0x11dee9-0x0;var _0x4fdcad=_0xf306[_0x11dee9];return _0x4fdcad;};'use strict';var multer=require(_0x6f30('0x0'));var util=require(_0x6f30('0x1'));var path=require(_0x6f30('0x2'));var timeout=require(_0x6f30('0x3'));var express=require(_0x6f30('0x4'));var router=express[_0x6f30('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6f30('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f30('0x7'));var controller=require(_0x6f30('0x8'));router[_0x6f30('0x9')]('/',auth[_0x6f30('0xa')](),controller[_0x6f30('0xb')]);router['get']('/:id',auth[_0x6f30('0xa')](),controller[_0x6f30('0xc')]);router['get'](_0x6f30('0xd'),auth[_0x6f30('0xa')](),controller[_0x6f30('0xe')]);router[_0x6f30('0xf')]('/',auth['isAuthenticated'](),controller[_0x6f30('0x10')]);router[_0x6f30('0xf')](_0x6f30('0xd'),auth[_0x6f30('0xa')](),controller[_0x6f30('0x11')]);router[_0x6f30('0x12')](_0x6f30('0x13'),auth[_0x6f30('0xa')](),controller[_0x6f30('0x14')]);router[_0x6f30('0x15')](_0x6f30('0x13'),auth[_0x6f30('0xa')](),controller[_0x6f30('0x16')]);router['delete']('/:id/sounds/:id2',auth[_0x6f30('0xa')](),controller[_0x6f30('0x17')]);module[_0x6f30('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8682abf..6804390 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 _0x190e=['exports','name','custom','files','mp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN'];(function(_0x44a4a8,_0x26633e){var _0x74206=function(_0x42afe3){while(--_0x42afe3){_0x44a4a8['push'](_0x44a4a8['shift']());}};_0x74206(++_0x26633e);}(_0x190e,0x129));var _0xe190=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x190e[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0xe190('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe190('0x1')},'mode':{'type':Sequelize['ENUM'](_0xe190('0x2'),_0xe190('0x3'),_0xe190('0x4'),'quietmp3nb',_0xe190('0x5'),_0xe190('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xe190('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0xe190('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe190('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe190('0x7')],'allowNull':!![],'defaultValue':_0xe190('0x8')},'format':{'type':Sequelize[_0xe190('0x7')],'allowNull':!![]},'stamp':{'type':_0xe190('0x9')},'defaultEntry':{'type':Sequelize[_0xe190('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa690=['BOOLEAN','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0xe2c665,_0x5467a0){var _0x5bcbb7=function(_0x4002dc){while(--_0x4002dc){_0xe2c665['push'](_0xe2c665['shift']());}};_0x5bcbb7(++_0x5467a0);}(_0xa690,0x8d));var _0x0a69=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0xa690[_0x7729b1];return _0x349504;};'use strict';var Sequelize=require('sequelize');module[_0x0a69('0x0')]={'name':{'type':Sequelize[_0x0a69('0x1')],'allowNull':![],'unique':_0x0a69('0x2')},'mode':{'type':Sequelize[_0x0a69('0x3')](_0x0a69('0x4'),_0x0a69('0x5'),_0x0a69('0x6'),'quietmp3nb',_0x0a69('0x7'),_0x0a69('0x8')),'allowNull':!![],'defaultValue':_0x0a69('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x0a69('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x0a69('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x0a69('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 cd03c85..7177508 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 _0x678e=['getSounds','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','MusicOnHolds','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','params','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','removeSound','id2'];(function(_0x1aa617,_0x23271a){var _0x38653c=function(_0x1f17be){while(--_0x1f17be){_0x1aa617['push'](_0x1aa617['shift']());}};_0x38653c(++_0x23271a);}(_0x678e,0x71));var _0xe678=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x678e[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xe678('0x0'));var rimraf=require(_0xe678('0x1'));var zipdir=require(_0xe678('0x2'));var jsonpatch=require(_0xe678('0x3'));var rp=require(_0xe678('0x4'));var moment=require('moment');var BPromise=require(_0xe678('0x5'));var Mustache=require(_0xe678('0x6'));var util=require(_0xe678('0x7'));var path=require(_0xe678('0x8'));var sox=require('sox');var csv=require(_0xe678('0x9'));var ejs=require(_0xe678('0xa'));var fs=require('fs');var fs_extra=require(_0xe678('0xb'));var _=require(_0xe678('0xc'));var squel=require(_0xe678('0xd'));var crypto=require(_0xe678('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe678('0xf'));var toCsv=require(_0xe678('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe678('0x10'));var authService=require(_0xe678('0x11'));var qs=require(_0xe678('0x12'));var as=require(_0xe678('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe678('0x14'));var utils=require(_0xe678('0x15'));var config=require(_0xe678('0x16'));var licenseUtil=require(_0xe678('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43484e,_0x3806a4){_0x3806a4=_0x3806a4||0xcc;return function(_0x510997){if(_0x510997){return _0x43484e[_0xe678('0x18')](_0x3806a4);}return _0x43484e[_0xe678('0x19')](_0x3806a4)[_0xe678('0x1a')]();};}function respondWithResult(_0x2903a4,_0x9d26e5){_0x9d26e5=_0x9d26e5||0xc8;return function(_0x45478d){if(_0x45478d){return _0x2903a4['status'](_0x9d26e5)[_0xe678('0x1b')](_0x45478d);}};}function respondWithFilteredResult(_0x585537,_0xd28f22){return function(_0x11a8af){if(_0x11a8af){var _0x4ac028=typeof _0xd28f22[_0xe678('0x1c')]===_0xe678('0x1d')&&typeof _0xd28f22[_0xe678('0x1e')]==='undefined';var _0x546121=_0x11a8af[_0xe678('0x1f')];var _0x5ceee3=_0x4ac028?0x0:_0xd28f22['offset'];var _0xa159b2=_0x4ac028?_0x11a8af[_0xe678('0x1f')]:_0xd28f22[_0xe678('0x1c')]+_0xd28f22[_0xe678('0x1e')];var _0x25c7dd;if(_0xa159b2>=_0x546121){_0xa159b2=_0x546121;_0x25c7dd=0xc8;}else{_0x25c7dd=0xce;}_0x585537[_0xe678('0x19')](_0x25c7dd);return _0x585537[_0xe678('0x20')]('Content-Range',_0x5ceee3+'-'+_0xa159b2+'/'+_0x546121)[_0xe678('0x1b')](_0x11a8af);}return null;};}function patchUpdates(_0x5831dc){return function(_0x122c84){try{jsonpatch[_0xe678('0x21')](_0x122c84,_0x5831dc,!![]);}catch(_0x5a2673){return BPromise['reject'](_0x5a2673);}return _0x122c84['save']();};}function saveUpdates(_0x503433,_0x2da9bb){return function(_0x5cd3a4){if(_0x5cd3a4){return _0x5cd3a4[_0xe678('0x22')](_0x503433)[_0xe678('0x23')](function(_0x433acd){return _0x433acd;});}return null;};}function removeEntity(_0x185f2e,_0x337d18){return function(_0x1498d2){if(_0x1498d2){return _0x1498d2[_0xe678('0x24')]()[_0xe678('0x23')](function(){var _0x3eb7ab=_0x1498d2[_0xe678('0x25')]({'plain':!![]});var _0x5cd5b2=_0xe678('0x26');return db['UserProfileResource'][_0xe678('0x24')]({'where':{'type':_0x5cd5b2,'resourceId':_0x3eb7ab['id']}})[_0xe678('0x23')](function(){return _0x1498d2;});})['then'](function(){_0x185f2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13f172,_0xecf429){return function(_0x27e012){if(!_0x27e012){_0x13f172[_0xe678('0x18')](0x194);}return _0x27e012;};}function handleError(_0x54b661,_0x124a81){_0x124a81=_0x124a81||0x1f4;return function(_0xd97e83){logger['error'](_0xd97e83[_0xe678('0x27')]);if(_0xd97e83[_0xe678('0x28')]){delete _0xd97e83[_0xe678('0x28')];}_0x54b661[_0xe678('0x19')](_0x124a81)[_0xe678('0x29')](_0xd97e83);};}exports[_0xe678('0x2a')]=function(_0xbb3a4d,_0x6816d7){var _0x58b5ce={},_0x565b94={},_0xa89859={'count':0x0,'rows':[]};var _0x308304=_[_0xe678('0x2b')](db['VoiceMusicOnHold'][_0xe678('0x2c')],function(_0x4031d8){return{'name':_0x4031d8['fieldName'],'type':_0x4031d8[_0xe678('0x2d')][_0xe678('0x2e')]};});_0x565b94[_0xe678('0x2f')]=_['map'](_0x308304,_0xe678('0x28'));_0x565b94['query']=_[_0xe678('0x30')](_0xbb3a4d[_0xe678('0x31')]);_0x565b94[_0xe678('0x32')]=_[_0xe678('0x33')](_0x565b94['model'],_0x565b94['query']);_0x58b5ce[_0xe678('0x34')]=_[_0xe678('0x33')](_0x565b94[_0xe678('0x2f')],qs['fields'](_0xbb3a4d[_0xe678('0x31')][_0xe678('0x35')]));_0x58b5ce['attributes']=_0x58b5ce[_0xe678('0x34')][_0xe678('0x36')]?_0x58b5ce[_0xe678('0x34')]:_0x565b94[_0xe678('0x2f')];if(!_0xbb3a4d[_0xe678('0x31')][_0xe678('0x37')](_0xe678('0x38'))){_0x58b5ce[_0xe678('0x1e')]=qs[_0xe678('0x1e')](_0xbb3a4d[_0xe678('0x31')][_0xe678('0x1e')]);_0x58b5ce['offset']=qs[_0xe678('0x1c')](_0xbb3a4d[_0xe678('0x31')]['offset']);}_0x58b5ce[_0xe678('0x39')]=qs[_0xe678('0x3a')](_0xbb3a4d[_0xe678('0x31')]['sort']);delete _0xbb3a4d[_0xe678('0x31')][_0xe678('0x3a')];_0x58b5ce[_0xe678('0x3b')]=qs[_0xe678('0x32')](_[_0xe678('0x3c')](_0xbb3a4d['query'],_0x565b94[_0xe678('0x32')]),_0x308304);if(_0xbb3a4d[_0xe678('0x31')]['filter']){_0x58b5ce['where']=_[_0xe678('0x3d')](_0x58b5ce[_0xe678('0x3b')],{'$or':_[_0xe678('0x2b')](_0x308304,function(_0x353527){if(_0x353527[_0xe678('0x2d')]!==_0xe678('0x3e')){var _0x119b19={};_0x119b19[_0x353527[_0xe678('0x28')]]={'$like':'%'+_0xbb3a4d[_0xe678('0x31')]['filter']+'%'};return _0x119b19;}})});}_0x58b5ce=_[_0xe678('0x3d')]({},_0x58b5ce,_0xbb3a4d[_0xe678('0x3f')]);var _0x5773df={'where':_0x58b5ce[_0xe678('0x3b')]};return db['VoiceMusicOnHold']['count'](_0x5773df)[_0xe678('0x23')](function(_0x3951ea){_0xa89859[_0xe678('0x1f')]=_0x3951ea;if(_0xbb3a4d[_0xe678('0x31')][_0xe678('0x40')]){_0x58b5ce[_0xe678('0x41')]=[{'all':!![]}];}return db[_0xe678('0x42')][_0xe678('0x43')](_0x58b5ce);})['then'](function(_0x10070d){_0xa89859[_0xe678('0x44')]=_0x10070d;return _0xa89859;})['then'](respondWithFilteredResult(_0x6816d7,_0x58b5ce))[_0xe678('0x45')](handleError(_0x6816d7,null));};exports['show']=function(_0x4efbb3,_0x1b01ea){var _0xec4e41={'raw':![],'where':{'id':_0x4efbb3[_0xe678('0x46')]['id']}},_0x5de2e5={};_0x5de2e5[_0xe678('0x2f')]=_['keys'](db[_0xe678('0x42')][_0xe678('0x2c')]);_0x5de2e5[_0xe678('0x31')]=_[_0xe678('0x30')](_0x4efbb3[_0xe678('0x31')]);_0x5de2e5['filters']=_[_0xe678('0x33')](_0x5de2e5[_0xe678('0x2f')],_0x5de2e5['query']);_0xec4e41['attributes']=_[_0xe678('0x33')](_0x5de2e5[_0xe678('0x2f')],qs[_0xe678('0x35')](_0x4efbb3[_0xe678('0x31')][_0xe678('0x35')]));_0xec4e41['attributes']=_0xec4e41[_0xe678('0x34')][_0xe678('0x36')]?_0xec4e41[_0xe678('0x34')]:_0x5de2e5[_0xe678('0x2f')];if(_0x4efbb3[_0xe678('0x31')][_0xe678('0x40')]){_0xec4e41[_0xe678('0x41')]=[{'all':!![]}];}_0xec4e41=_[_0xe678('0x3d')]({},_0xec4e41,_0x4efbb3[_0xe678('0x3f')]);return db[_0xe678('0x42')][_0xe678('0x47')](_0xec4e41)[_0xe678('0x23')](handleEntityNotFound(_0x1b01ea,null))[_0xe678('0x23')](respondWithResult(_0x1b01ea,null))['catch'](handleError(_0x1b01ea,null));};exports['update']=function(_0x45ec11,_0x58f39a){if(_0x45ec11['body']['id']){delete _0x45ec11[_0xe678('0x48')]['id'];}return db[_0xe678('0x42')][_0xe678('0x47')]({'where':{'id':_0x45ec11[_0xe678('0x46')]['id']}})[_0xe678('0x23')](handleEntityNotFound(_0x58f39a,null))[_0xe678('0x23')](saveUpdates(_0x45ec11[_0xe678('0x48')],null))['then'](respondWithResult(_0x58f39a,null))[_0xe678('0x45')](handleError(_0x58f39a,null));};exports[_0xe678('0x49')]=function(_0x39d74d,_0x23c55f,_0x3f81a7){return db[_0xe678('0x4a')][_0xe678('0x4b')](function(_0x9a5d69){if(_0x39d74d[_0xe678('0x48')][_0xe678('0x4c')]===_0xe678('0x4d')){_0x39d74d[_0xe678('0x48')][_0xe678('0x4e')]=path[_0xe678('0x4f')](config[_0xe678('0x50')],_0xe678('0x51'),_0x39d74d[_0xe678('0x48')][_0xe678('0x28')]);}return db['VoiceMusicOnHold'][_0xe678('0x49')](_0x39d74d['body'],{'transaction':_0x9a5d69})[_0xe678('0x23')](function(_0x3dc377){if(_0x39d74d[_0xe678('0x48')]['mode']===_0xe678('0x4d')){fs[_0xe678('0x52')](_0x3dc377['directory'],parseInt(_0xe678('0x53'),0x8));}var _0x58548d=_0x39d74d['user'][_0xe678('0x25')]({'plain':!![]});if(!_0x58548d)throw new Error(_0xe678('0x54'));if(_0x58548d[_0xe678('0x55')]===_0xe678('0x56')){var _0x1b9428=_0x3dc377[_0xe678('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xe678('0x47')]({'where':{'name':_0xe678('0x26'),'userProfileId':_0x58548d['userProfileId']},'raw':!![]})[_0xe678('0x23')](function(_0x136b27){if(_0x136b27&&_0x136b27[_0xe678('0x57')]===0x0){return db['UserProfileResource'][_0xe678('0x49')]({'name':_0x1b9428[_0xe678('0x28')],'resourceId':_0x1b9428['id'],'type':_0x136b27[_0xe678('0x28')],'sectionId':_0x136b27['id']},{})[_0xe678('0x23')](function(){return _0x3dc377;});}else{return _0x3dc377;}})[_0xe678('0x45')](function(_0x283576){logger['error'](_0xe678('0x58'),_0x283576);});}return _0x3dc377;});})[_0xe678('0x23')](respondWithResult(_0x23c55f,0xc9))[_0xe678('0x45')](handleError(_0x23c55f,null));};exports['destroy']=function(_0x1cd157,_0x49f9d4,_0x4958a8){var _0x285c5b;return db[_0xe678('0x42')][_0xe678('0x47')]({'where':{'id':_0x1cd157['params']['id']}})[_0xe678('0x23')](function(_0x3ba128){if(_0x3ba128){return db[_0xe678('0x4a')][_0xe678('0x4b')](function(_0xe8ce5e){return _0x3ba128[_0xe678('0x24')]({'transaction':_0xe8ce5e,'raw':!![]})['then'](function(_0x40cdcd){if(_0x40cdcd[_0xe678('0x4e')]){fs[_0xe678('0x59')](_0x40cdcd[_0xe678('0x4e')])[_0xe678('0x5a')](function(_0x33cff4){fs[_0xe678('0x5b')](path[_0xe678('0x4f')](_0x40cdcd[_0xe678('0x4e')],_0x33cff4));});fs[_0xe678('0x5c')](_0x40cdcd[_0xe678('0x4e')]);}return _0x40cdcd;});})[_0xe678('0x45')](function(_0x46289f){throw new db[(_0xe678('0x5d'))][(_0xe678('0x5e'))](_0x46289f[_0xe678('0x5f')]);});}})[_0xe678('0x23')](handleEntityNotFound(_0x49f9d4,null))[_0xe678('0x23')](removeEntity(_0x49f9d4,null))['catch'](handleError(_0x49f9d4,null));};exports['addSound']=function(_0x457f79,_0x55efc4,_0x5834ce){return db[_0xe678('0x4a')]['transaction'](function(_0x405f64){var _0x2c0771;return db['VoiceMusicOnHold'][_0xe678('0x47')]({'where':{'id':_0x457f79[_0xe678('0x46')]['id']}})['then'](function(_0xe58bb3){if(_0xe58bb3){_0x2c0771=_0xe58bb3;return _0xe58bb3[_0xe678('0x60')](_0x457f79[_0xe678('0x48')]['id'],{'transaction':_0x405f64});}})[_0xe678('0x23')](function(_0x4b67d7){if(_0x4b67d7){return db[_0xe678('0x61')][_0xe678('0x62')]({'where':{'id':_0x457f79['body']['id']},'attributes':['id',_0xe678('0x28'),_0xe678('0x63'),_0xe678('0x64'),_0xe678('0x65')],'raw':!![]});}})[_0xe678('0x23')](function(_0x31cbcc){if(_0x31cbcc){var _0x21e4d2=path[_0xe678('0x4f')](config['root'],_0xe678('0x66'),util[_0xe678('0x67')](_0xe678('0x68'),path['basename'](_0x31cbcc[_0xe678('0x63')],path[_0xe678('0x69')](_0x31cbcc[_0xe678('0x63')])),_0x31cbcc['converted_format']));var _0x2416a2=path['join'](config[_0xe678('0x50')],_0xe678('0x51'),_0x2c0771[_0xe678('0x28')],util['format'](_0xe678('0x68'),_0x31cbcc[_0xe678('0x28')],_0x31cbcc['converted_format']));fs[_0xe678('0x6a')](_0x21e4d2,_0x2416a2);return _0x31cbcc;}})[_0xe678('0x45')](function(_0x7f3f57){throw new db[(_0xe678('0x5d'))][(_0xe678('0x5e'))](_0x7f3f57[_0xe678('0x5f')]);});})['then'](handleEntityNotFound(_0x55efc4,null))[_0xe678('0x23')](respondWithResult(_0x55efc4,0xc9))[_0xe678('0x45')](handleError(_0x55efc4,null));};exports['removeSound']=function(_0x200746,_0x533dc6,_0x965fd2){return db[_0xe678('0x4a')][_0xe678('0x4b')](function(_0x552ca7){var _0xbfd642;return db[_0xe678('0x42')]['findOne']({'where':{'id':_0x200746[_0xe678('0x46')]['id']}})[_0xe678('0x23')](handleEntityNotFound(_0x533dc6,null))[_0xe678('0x23')](function(_0x582238){if(_0x582238){_0xbfd642=_0x582238;return _0x582238[_0xe678('0x6b')](_0x200746[_0xe678('0x46')]['id2']);}})['then'](function(_0x332a5f){if(_0x332a5f){return db[_0xe678('0x61')][_0xe678('0x62')]({'where':{'id':_0x200746[_0xe678('0x46')][_0xe678('0x6c')]},'attributes':['id',_0xe678('0x28'),_0xe678('0x63'),_0xe678('0x64'),_0xe678('0x65')],'raw':!![]});}})[_0xe678('0x23')](function(_0x5ef1c8){if(_0x5ef1c8){fs[_0xe678('0x5b')](path[_0xe678('0x4f')](_0xbfd642[_0xe678('0x4e')],util['format'](_0xe678('0x68'),_0x5ef1c8[_0xe678('0x28')],_0x5ef1c8[_0xe678('0x64')])));return _0x5ef1c8;}})[_0xe678('0x45')](function(_0x3a3f65){throw new db[(_0xe678('0x5d'))][(_0xe678('0x5e'))](_0x3a3f65[_0xe678('0x5f')]);});})[_0xe678('0x23')](handleEntityNotFound(_0x533dc6,null))[_0xe678('0x23')](respondWithStatusCode(_0x533dc6,0xcc))['catch'](handleError(_0x533dc6,null));};exports[_0xe678('0x6d')]=function(_0xced913,_0x56fa74,_0x117889){var _0x144e06={};var _0xcf4c63={};var _0x5af0ab;var _0x346d51;return db[_0xe678('0x42')][_0xe678('0x62')]({'where':{'id':_0xced913[_0xe678('0x46')]['id']}})[_0xe678('0x23')](handleEntityNotFound(_0x56fa74,null))[_0xe678('0x23')](function(_0x25b6de){if(_0x25b6de){_0x5af0ab=_0x25b6de;_0xcf4c63[_0xe678('0x2f')]=_[_0xe678('0x30')](db[_0xe678('0x61')][_0xe678('0x2c')]);_0xcf4c63[_0xe678('0x31')]=_[_0xe678('0x30')](_0xced913['query']);_0xcf4c63[_0xe678('0x32')]=_[_0xe678('0x33')](_0xcf4c63[_0xe678('0x2f')],_0xcf4c63[_0xe678('0x31')]);_0x144e06[_0xe678('0x34')]=_[_0xe678('0x33')](_0xcf4c63[_0xe678('0x2f')],qs[_0xe678('0x35')](_0xced913[_0xe678('0x31')][_0xe678('0x35')]));_0x144e06[_0xe678('0x34')]=_0x144e06[_0xe678('0x34')]['length']?_0x144e06[_0xe678('0x34')]:_0xcf4c63[_0xe678('0x2f')];_0x144e06[_0xe678('0x39')]=qs[_0xe678('0x3a')](_0xced913[_0xe678('0x31')][_0xe678('0x3a')]);_0x144e06[_0xe678('0x3b')]=qs[_0xe678('0x32')](_[_0xe678('0x3c')](_0xced913['query'],_0xcf4c63['filters']));if(_0xced913[_0xe678('0x31')][_0xe678('0x6e')]){_0x144e06[_0xe678('0x3b')]=_[_0xe678('0x3d')](_0x144e06[_0xe678('0x3b')],{'$or':_[_0xe678('0x2b')](_0x144e06[_0xe678('0x34')],function(_0x560232){var _0x16629e={};_0x16629e[_0x560232]={'$like':'%'+_0xced913[_0xe678('0x31')][_0xe678('0x6e')]+'%'};return _0x16629e;})});}_0x144e06=_[_0xe678('0x3d')]({},_0x144e06,_0xced913[_0xe678('0x3f')]);return _0x5af0ab[_0xe678('0x6d')](_0x144e06);}})['then'](function(_0x506e94){if(_0x506e94){_0x346d51=_0x506e94[_0xe678('0x36')];if(!_0xced913[_0xe678('0x31')]['hasOwnProperty'](_0xe678('0x38'))){_0x144e06[_0xe678('0x1e')]=qs[_0xe678('0x1e')](_0xced913[_0xe678('0x31')][_0xe678('0x1e')]);_0x144e06['offset']=qs['offset'](_0xced913[_0xe678('0x31')][_0xe678('0x1c')]);}return _0x5af0ab[_0xe678('0x6d')](_0x144e06);}})[_0xe678('0x23')](function(_0x4d20f7){if(_0x4d20f7){return _0x4d20f7?{'count':_0x346d51,'rows':_0x4d20f7}:null;}})['then'](respondWithResult(_0x56fa74,null))[_0xe678('0x45')](handleError(_0x56fa74,null));}; \ No newline at end of file +var _0x6496=['Sequelize','ValidationError','removeSound','id2','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','stack','name','index','VoiceMusicOnHold','fieldName','type','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','include','find','body','sequelize','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','converted_format','symlinkSync'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6496,0x14c));var _0x6649=function(_0x21bf22,_0x16172a){_0x21bf22=_0x21bf22-0x0;var _0x144ee9=_0x6496[_0x21bf22];return _0x144ee9;};'use strict';var emlformat=require(_0x6649('0x0'));var rimraf=require(_0x6649('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6649('0x2'));var rp=require(_0x6649('0x3'));var moment=require(_0x6649('0x4'));var BPromise=require(_0x6649('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6649('0x6'));var csv=require(_0x6649('0x7'));var ejs=require(_0x6649('0x8'));var fs=require('fs');var fs_extra=require(_0x6649('0x9'));var _=require(_0x6649('0xa'));var squel=require(_0x6649('0xb'));var crypto=require(_0x6649('0xc'));var jsforce=require(_0x6649('0xd'));var deskjs=require(_0x6649('0xe'));var toCsv=require(_0x6649('0x7'));var querystring=require(_0x6649('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6649('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6649('0x11'));var hardwareService=require(_0x6649('0x12'));var logger=require(_0x6649('0x13'))(_0x6649('0x14'));var utils=require(_0x6649('0x15'));var config=require(_0x6649('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e046a,_0x5c4eeb){_0x5c4eeb=_0x5c4eeb||0xcc;return function(_0x2b6aa1){if(_0x2b6aa1){return _0x5e046a[_0x6649('0x17')](_0x5c4eeb);}return _0x5e046a[_0x6649('0x18')](_0x5c4eeb)[_0x6649('0x19')]();};}function respondWithResult(_0x2dd2b4,_0x5030e9){_0x5030e9=_0x5030e9||0xc8;return function(_0x3b307e){if(_0x3b307e){return _0x2dd2b4[_0x6649('0x18')](_0x5030e9)[_0x6649('0x1a')](_0x3b307e);}};}function respondWithFilteredResult(_0x424081,_0x40c218){return function(_0x55b1ab){if(_0x55b1ab){var _0xc94112=typeof _0x40c218[_0x6649('0x1b')]===_0x6649('0x1c')&&typeof _0x40c218[_0x6649('0x1d')]==='undefined';var _0x1ff2cc=_0x55b1ab[_0x6649('0x1e')];var _0x44b1bb=_0xc94112?0x0:_0x40c218[_0x6649('0x1b')];var _0x2ea8a0=_0xc94112?_0x55b1ab[_0x6649('0x1e')]:_0x40c218['offset']+_0x40c218[_0x6649('0x1d')];var _0x58ee80;if(_0x2ea8a0>=_0x1ff2cc){_0x2ea8a0=_0x1ff2cc;_0x58ee80=0xc8;}else{_0x58ee80=0xce;}_0x424081[_0x6649('0x18')](_0x58ee80);return _0x424081[_0x6649('0x1f')](_0x6649('0x20'),_0x44b1bb+'-'+_0x2ea8a0+'/'+_0x1ff2cc)[_0x6649('0x1a')](_0x55b1ab);}return null;};}function patchUpdates(_0x19a30e){return function(_0x4637ce){try{jsonpatch[_0x6649('0x21')](_0x4637ce,_0x19a30e,!![]);}catch(_0x32d75d){return BPromise[_0x6649('0x22')](_0x32d75d);}return _0x4637ce[_0x6649('0x23')]();};}function saveUpdates(_0x3b740c,_0x290a35){return function(_0x2989a6){if(_0x2989a6){return _0x2989a6[_0x6649('0x24')](_0x3b740c)['then'](function(_0x471197){return _0x471197;});}return null;};}function removeEntity(_0x8fbe03,_0x325125){return function(_0x5e5f19){if(_0x5e5f19){return _0x5e5f19[_0x6649('0x25')]()[_0x6649('0x26')](function(){var _0x34a41b=_0x5e5f19[_0x6649('0x27')]({'plain':!![]});var _0x56e905=_0x6649('0x28');return db[_0x6649('0x29')][_0x6649('0x25')]({'where':{'type':_0x56e905,'resourceId':_0x34a41b['id']}})[_0x6649('0x26')](function(){return _0x5e5f19;});})['then'](function(){_0x8fbe03['status'](0xcc)[_0x6649('0x19')]();});}};}function handleEntityNotFound(_0x472a1c,_0x213ca6){return function(_0x3cfe69){if(!_0x3cfe69){_0x472a1c['sendStatus'](0x194);}return _0x3cfe69;};}function handleError(_0x7cf170,_0x145679){_0x145679=_0x145679||0x1f4;return function(_0x40a93d){logger['error'](_0x40a93d[_0x6649('0x2a')]);if(_0x40a93d[_0x6649('0x2b')]){delete _0x40a93d[_0x6649('0x2b')];}_0x7cf170['status'](_0x145679)['send'](_0x40a93d);};}exports[_0x6649('0x2c')]=function(_0x5d3a70,_0x1640c7){var _0x110396={},_0x5b84b8={},_0x1e3459={'count':0x0,'rows':[]};var _0x2d8ed5=_['map'](db[_0x6649('0x2d')]['rawAttributes'],function(_0x1bc442){return{'name':_0x1bc442[_0x6649('0x2e')],'type':_0x1bc442[_0x6649('0x2f')]['key']};});_0x5b84b8['model']=_[_0x6649('0x30')](_0x2d8ed5,_0x6649('0x2b'));_0x5b84b8['query']=_[_0x6649('0x31')](_0x5d3a70[_0x6649('0x32')]);_0x5b84b8[_0x6649('0x33')]=_[_0x6649('0x34')](_0x5b84b8[_0x6649('0x35')],_0x5b84b8[_0x6649('0x32')]);_0x110396[_0x6649('0x36')]=_[_0x6649('0x34')](_0x5b84b8[_0x6649('0x35')],qs['fields'](_0x5d3a70[_0x6649('0x32')]['fields']));_0x110396[_0x6649('0x36')]=_0x110396['attributes'][_0x6649('0x37')]?_0x110396['attributes']:_0x5b84b8[_0x6649('0x35')];if(!_0x5d3a70[_0x6649('0x32')][_0x6649('0x38')]('nolimit')){_0x110396[_0x6649('0x1d')]=qs[_0x6649('0x1d')](_0x5d3a70[_0x6649('0x32')][_0x6649('0x1d')]);_0x110396[_0x6649('0x1b')]=qs[_0x6649('0x1b')](_0x5d3a70[_0x6649('0x32')]['offset']);}_0x110396[_0x6649('0x39')]=qs[_0x6649('0x3a')](_0x5d3a70[_0x6649('0x32')][_0x6649('0x3a')]);delete _0x5d3a70[_0x6649('0x32')][_0x6649('0x3a')];_0x110396['where']=qs[_0x6649('0x33')](_[_0x6649('0x3b')](_0x5d3a70['query'],_0x5b84b8[_0x6649('0x33')]),_0x2d8ed5);if(_0x5d3a70[_0x6649('0x32')][_0x6649('0x3c')]){_0x110396[_0x6649('0x3d')]=_[_0x6649('0x3e')](_0x110396[_0x6649('0x3d')],{'$or':_[_0x6649('0x30')](_0x2d8ed5,function(_0x12ef96){if(_0x12ef96[_0x6649('0x2f')]!=='VIRTUAL'){var _0x4b7de2={};_0x4b7de2[_0x12ef96[_0x6649('0x2b')]]={'$like':'%'+_0x5d3a70[_0x6649('0x32')][_0x6649('0x3c')]+'%'};return _0x4b7de2;}})});}_0x110396=_[_0x6649('0x3e')]({},_0x110396,_0x5d3a70[_0x6649('0x3f')]);var _0x5a2b83={'where':_0x110396[_0x6649('0x3d')]};return db['VoiceMusicOnHold']['count'](_0x5a2b83)[_0x6649('0x26')](function(_0x423d5d){_0x1e3459[_0x6649('0x1e')]=_0x423d5d;if(_0x5d3a70['query'][_0x6649('0x40')]){_0x110396['include']=[{'all':!![]}];}return db[_0x6649('0x2d')][_0x6649('0x41')](_0x110396);})[_0x6649('0x26')](function(_0x144f6d){_0x1e3459['rows']=_0x144f6d;return _0x1e3459;})['then'](respondWithFilteredResult(_0x1640c7,_0x110396))[_0x6649('0x42')](handleError(_0x1640c7,null));};exports[_0x6649('0x43')]=function(_0x5f3836,_0xfd132c){var _0x4fde91={'raw':![],'where':{'id':_0x5f3836[_0x6649('0x44')]['id']}},_0x424ae8={};_0x424ae8[_0x6649('0x35')]=_[_0x6649('0x31')](db[_0x6649('0x2d')][_0x6649('0x45')]);_0x424ae8[_0x6649('0x32')]=_[_0x6649('0x31')](_0x5f3836[_0x6649('0x32')]);_0x424ae8[_0x6649('0x33')]=_['intersection'](_0x424ae8[_0x6649('0x35')],_0x424ae8[_0x6649('0x32')]);_0x4fde91[_0x6649('0x36')]=_[_0x6649('0x34')](_0x424ae8[_0x6649('0x35')],qs['fields'](_0x5f3836[_0x6649('0x32')][_0x6649('0x46')]));_0x4fde91[_0x6649('0x36')]=_0x4fde91['attributes'][_0x6649('0x37')]?_0x4fde91[_0x6649('0x36')]:_0x424ae8[_0x6649('0x35')];if(_0x5f3836['query'][_0x6649('0x40')]){_0x4fde91[_0x6649('0x47')]=[{'all':!![]}];}_0x4fde91=_[_0x6649('0x3e')]({},_0x4fde91,_0x5f3836[_0x6649('0x3f')]);return db['VoiceMusicOnHold'][_0x6649('0x48')](_0x4fde91)[_0x6649('0x26')](handleEntityNotFound(_0xfd132c,null))[_0x6649('0x26')](respondWithResult(_0xfd132c,null))[_0x6649('0x42')](handleError(_0xfd132c,null));};exports[_0x6649('0x24')]=function(_0x3657d6,_0x281ca8){if(_0x3657d6[_0x6649('0x49')]['id']){delete _0x3657d6[_0x6649('0x49')]['id'];}return db[_0x6649('0x2d')]['find']({'where':{'id':_0x3657d6[_0x6649('0x44')]['id']}})[_0x6649('0x26')](handleEntityNotFound(_0x281ca8,null))[_0x6649('0x26')](saveUpdates(_0x3657d6['body'],null))[_0x6649('0x26')](respondWithResult(_0x281ca8,null))['catch'](handleError(_0x281ca8,null));};exports['create']=function(_0x2be940,_0x1b9284,_0x3e39b7){return db[_0x6649('0x4a')][_0x6649('0x4b')](function(_0x201db5){if(_0x2be940[_0x6649('0x49')][_0x6649('0x4c')]===_0x6649('0x4d')){_0x2be940['body'][_0x6649('0x4e')]=path[_0x6649('0x4f')](config[_0x6649('0x50')],_0x6649('0x51'),_0x2be940[_0x6649('0x49')][_0x6649('0x2b')]);}return db[_0x6649('0x2d')][_0x6649('0x52')](_0x2be940['body'],{'transaction':_0x201db5})[_0x6649('0x26')](function(_0x355a8c){if(_0x2be940[_0x6649('0x49')][_0x6649('0x4c')]===_0x6649('0x4d')){fs[_0x6649('0x53')](_0x355a8c[_0x6649('0x4e')],parseInt('0777',0x8));}var _0x175ae2=_0x2be940['user'][_0x6649('0x27')]({'plain':!![]});if(!_0x175ae2)throw new Error(_0x6649('0x54'));if(_0x175ae2['role']===_0x6649('0x55')){var _0x232fb4=_0x355a8c[_0x6649('0x27')]({'plain':!![]});return db[_0x6649('0x56')][_0x6649('0x48')]({'where':{'name':_0x6649('0x28'),'userProfileId':_0x175ae2['userProfileId']},'raw':!![]})[_0x6649('0x26')](function(_0x3ded4e){if(_0x3ded4e&&_0x3ded4e['autoAssociation']===0x0){return db['UserProfileResource'][_0x6649('0x52')]({'name':_0x232fb4['name'],'resourceId':_0x232fb4['id'],'type':_0x3ded4e[_0x6649('0x2b')],'sectionId':_0x3ded4e['id']},{})[_0x6649('0x26')](function(){return _0x355a8c;});}else{return _0x355a8c;}})['catch'](function(_0x2805f3){logger[_0x6649('0x57')](_0x6649('0x58'),_0x2805f3);});}return _0x355a8c;});})['then'](respondWithResult(_0x1b9284,0xc9))[_0x6649('0x42')](handleError(_0x1b9284,null));};exports[_0x6649('0x25')]=function(_0x4da7bf,_0x4a874e,_0x9b7f27){var _0x30741c;return db[_0x6649('0x2d')][_0x6649('0x48')]({'where':{'id':_0x4da7bf[_0x6649('0x44')]['id']}})[_0x6649('0x26')](function(_0x5e0534){if(_0x5e0534){return db[_0x6649('0x4a')][_0x6649('0x4b')](function(_0xdbbe97){return _0x5e0534[_0x6649('0x25')]({'transaction':_0xdbbe97,'raw':!![]})[_0x6649('0x26')](function(_0x3ed6be){if(_0x3ed6be[_0x6649('0x4e')]){fs[_0x6649('0x59')](_0x3ed6be[_0x6649('0x4e')])[_0x6649('0x5a')](function(_0xe54f2c){fs[_0x6649('0x5b')](path['join'](_0x3ed6be[_0x6649('0x4e')],_0xe54f2c));});fs[_0x6649('0x5c')](_0x3ed6be[_0x6649('0x4e')]);}return _0x3ed6be;});})[_0x6649('0x42')](function(_0x472519){throw new db['Sequelize']['ValidationError'](_0x472519[_0x6649('0x5d')]);});}})[_0x6649('0x26')](handleEntityNotFound(_0x4a874e,null))[_0x6649('0x26')](removeEntity(_0x4a874e,null))[_0x6649('0x42')](handleError(_0x4a874e,null));};exports[_0x6649('0x5e')]=function(_0x53123f,_0x247c8f,_0xd9a686){return db[_0x6649('0x4a')][_0x6649('0x4b')](function(_0x3fb043){var _0x1415fc;return db[_0x6649('0x2d')]['find']({'where':{'id':_0x53123f[_0x6649('0x44')]['id']}})[_0x6649('0x26')](function(_0x18c6d6){if(_0x18c6d6){_0x1415fc=_0x18c6d6;return _0x18c6d6['addSound'](_0x53123f['body']['id'],{'transaction':_0x3fb043});}})[_0x6649('0x26')](function(_0x4ea2f3){if(_0x4ea2f3){return db[_0x6649('0x5f')][_0x6649('0x60')]({'where':{'id':_0x53123f['body']['id']},'attributes':['id',_0x6649('0x2b'),_0x6649('0x61'),'converted_format',_0x6649('0x62')],'raw':!![]});}})['then'](function(_0x404cd){if(_0x404cd){var _0x6e3a7=path['join'](config[_0x6649('0x50')],_0x6649('0x63'),util[_0x6649('0x64')](_0x6649('0x65'),path['basename'](_0x404cd[_0x6649('0x61')],path['extname'](_0x404cd[_0x6649('0x61')])),_0x404cd[_0x6649('0x66')]));var _0x59ed6d=path[_0x6649('0x4f')](config['root'],'server/files/moh',_0x1415fc['name'],util[_0x6649('0x64')](_0x6649('0x65'),_0x404cd[_0x6649('0x2b')],_0x404cd[_0x6649('0x66')]));fs[_0x6649('0x67')](_0x6e3a7,_0x59ed6d);return _0x404cd;}})[_0x6649('0x42')](function(_0x424cc0){throw new db[(_0x6649('0x68'))][(_0x6649('0x69'))](_0x424cc0['message']);});})[_0x6649('0x26')](handleEntityNotFound(_0x247c8f,null))['then'](respondWithResult(_0x247c8f,0xc9))[_0x6649('0x42')](handleError(_0x247c8f,null));};exports[_0x6649('0x6a')]=function(_0x3da0d9,_0x1a9324,_0x2eedf8){return db[_0x6649('0x4a')]['transaction'](function(_0x3c8489){var _0x179536;return db[_0x6649('0x2d')]['findOne']({'where':{'id':_0x3da0d9[_0x6649('0x44')]['id']}})[_0x6649('0x26')](handleEntityNotFound(_0x1a9324,null))[_0x6649('0x26')](function(_0x174d34){if(_0x174d34){_0x179536=_0x174d34;return _0x174d34[_0x6649('0x6a')](_0x3da0d9['params'][_0x6649('0x6b')]);}})[_0x6649('0x26')](function(_0x282fed){if(_0x282fed){return db[_0x6649('0x5f')][_0x6649('0x60')]({'where':{'id':_0x3da0d9[_0x6649('0x44')][_0x6649('0x6b')]},'attributes':['id','name',_0x6649('0x61'),_0x6649('0x66'),_0x6649('0x62')],'raw':!![]});}})[_0x6649('0x26')](function(_0x34baf5){if(_0x34baf5){fs[_0x6649('0x5b')](path[_0x6649('0x4f')](_0x179536['directory'],util[_0x6649('0x64')](_0x6649('0x65'),_0x34baf5['name'],_0x34baf5[_0x6649('0x66')])));return _0x34baf5;}})['catch'](function(_0xdaf4ba){throw new db['Sequelize']['ValidationError'](_0xdaf4ba[_0x6649('0x5d')]);});})[_0x6649('0x26')](handleEntityNotFound(_0x1a9324,null))[_0x6649('0x26')](respondWithStatusCode(_0x1a9324,0xcc))[_0x6649('0x42')](handleError(_0x1a9324,null));};exports['getSounds']=function(_0x4f041d,_0x12d752,_0x4c42db){var _0x4530c0={};var _0x2e0feb={};var _0x287479;var _0x22cbfe;return db[_0x6649('0x2d')][_0x6649('0x60')]({'where':{'id':_0x4f041d[_0x6649('0x44')]['id']}})[_0x6649('0x26')](handleEntityNotFound(_0x12d752,null))['then'](function(_0x507d11){if(_0x507d11){_0x287479=_0x507d11;_0x2e0feb[_0x6649('0x35')]=_[_0x6649('0x31')](db[_0x6649('0x5f')][_0x6649('0x45')]);_0x2e0feb['query']=_['keys'](_0x4f041d[_0x6649('0x32')]);_0x2e0feb['filters']=_[_0x6649('0x34')](_0x2e0feb[_0x6649('0x35')],_0x2e0feb[_0x6649('0x32')]);_0x4530c0[_0x6649('0x36')]=_[_0x6649('0x34')](_0x2e0feb[_0x6649('0x35')],qs[_0x6649('0x46')](_0x4f041d[_0x6649('0x32')][_0x6649('0x46')]));_0x4530c0['attributes']=_0x4530c0['attributes']['length']?_0x4530c0[_0x6649('0x36')]:_0x2e0feb[_0x6649('0x35')];_0x4530c0[_0x6649('0x39')]=qs[_0x6649('0x3a')](_0x4f041d[_0x6649('0x32')][_0x6649('0x3a')]);_0x4530c0[_0x6649('0x3d')]=qs[_0x6649('0x33')](_[_0x6649('0x3b')](_0x4f041d[_0x6649('0x32')],_0x2e0feb[_0x6649('0x33')]));if(_0x4f041d[_0x6649('0x32')][_0x6649('0x3c')]){_0x4530c0[_0x6649('0x3d')]=_['merge'](_0x4530c0[_0x6649('0x3d')],{'$or':_[_0x6649('0x30')](_0x4530c0[_0x6649('0x36')],function(_0x2bf728){var _0x45ef37={};_0x45ef37[_0x2bf728]={'$like':'%'+_0x4f041d[_0x6649('0x32')]['filter']+'%'};return _0x45ef37;})});}_0x4530c0=_[_0x6649('0x3e')]({},_0x4530c0,_0x4f041d['options']);return _0x287479[_0x6649('0x6c')](_0x4530c0);}})['then'](function(_0x29cd09){if(_0x29cd09){_0x22cbfe=_0x29cd09[_0x6649('0x37')];if(!_0x4f041d[_0x6649('0x32')]['hasOwnProperty']('nolimit')){_0x4530c0[_0x6649('0x1d')]=qs[_0x6649('0x1d')](_0x4f041d[_0x6649('0x32')]['limit']);_0x4530c0[_0x6649('0x1b')]=qs['offset'](_0x4f041d[_0x6649('0x32')][_0x6649('0x1b')]);}return _0x287479[_0x6649('0x6c')](_0x4530c0);}})[_0x6649('0x26')](function(_0x176442){if(_0x176442){return _0x176442?{'count':_0x22cbfe,'rows':_0x176442}:null;}})[_0x6649('0x26')](respondWithResult(_0x12d752,null))[_0x6649('0x42')](handleError(_0x12d752,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c66ebe2..bc674b1 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 _0x5d0f=['rimraf','../../config/environment','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','path'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x5d0f,0x14f));var _0xf5d0=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x5d0f[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xf5d0('0x0'));var util=require(_0xf5d0('0x1'));var logger=require(_0xf5d0('0x2'))(_0xf5d0('0x3'));var moment=require(_0xf5d0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5d0('0x5'));var rimraf=require(_0xf5d0('0x6'));var config=require(_0xf5d0('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xf5d0('0x8')]=function(_0x47a06d,_0x3dbbe3){return _0x47a06d[_0xf5d0('0x9')](_0xf5d0('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95a4=['bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment'];(function(_0x1cbc43,_0x5d0f5d){var _0x3d0913=function(_0x36708f){while(--_0x36708f){_0x1cbc43['push'](_0x1cbc43['shift']());}};_0x3d0913(++_0x5d0f5d);}(_0x95a4,0x1eb));var _0x495a=function(_0x59a157,_0x3df41c){_0x59a157=_0x59a157-0x0;var _0x191be9=_0x95a4[_0x59a157];return _0x191be9;};'use strict';var _=require('lodash');var util=require(_0x495a('0x0'));var logger=require(_0x495a('0x1'))(_0x495a('0x2'));var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x495a('0x5'));var config=require(_0x495a('0x6'));var attributes=require(_0x495a('0x7'));module['exports']=function(_0x751b26,_0x28dc20){return _0x751b26[_0x495a('0x8')](_0x495a('0x9'),attributes,{'tableName':_0x495a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 0d2b21b..6d41527 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x36fc7f,_0x18f627){var _0x135a0d=function(_0x108bb3){while(--_0x108bb3){_0x36fc7f['push'](_0x36fc7f['shift']());}};_0x135a0d(++_0x18f627);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x184983,_0x500c6c){var _0x385faf=function(_0x2ce49b){while(--_0x2ce49b){_0x184983['push'](_0x184983['shift']());}};_0x385faf(++_0x500c6c);}(_0xe706,0xa3));var _0x6e70=function(_0x2cce72,_0x432665){_0x2cce72=_0x2cce72-0x0;var _0xe78e46=_0xe706[_0x2cce72];return _0xe78e46;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b66b275..7372a32 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 _0x75a2=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','put','/:id','update','delete','destroy','removeAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x75a2,0x187));var _0x275a=function(_0x1b9090,_0x577b31){_0x1b9090=_0x1b9090-0x0;var _0x1d6c61=_0x75a2[_0x1b9090];return _0x1d6c61;};'use strict';var multer=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var path=require(_0x275a('0x2'));var timeout=require('connect-timeout');var express=require(_0x275a('0x3'));var router=express[_0x275a('0x4')]();var fs_extra=require(_0x275a('0x5'));var auth=require(_0x275a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x275a('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x275a('0x8')](_0x275a('0x9'),auth[_0x275a('0xa')](),controller[_0x275a('0xb')]);router['get']('/:id',auth[_0x275a('0xa')](),controller[_0x275a('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x275a('0xd')]);router[_0x275a('0x8')](_0x275a('0xe'),auth[_0x275a('0xa')](),controller[_0x275a('0xf')]);router[_0x275a('0x10')]('/',auth[_0x275a('0xa')](),controller[_0x275a('0x11')]);router[_0x275a('0x10')](_0x275a('0x12'),auth[_0x275a('0xa')](),controller['addAgents']);router[_0x275a('0x10')](_0x275a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x275a('0x13')](_0x275a('0x14'),auth[_0x275a('0xa')](),controller[_0x275a('0x15')]);router[_0x275a('0x16')](_0x275a('0x14'),auth[_0x275a('0xa')](),controller[_0x275a('0x17')]);router[_0x275a('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x275a('0x18')]);router[_0x275a('0x16')]('/:id/teams',auth[_0x275a('0xa')](),controller['removeTeams']);module[_0x275a('0x19')]=router; \ No newline at end of file +var _0x07b9=['delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','/:id','destroy'];(function(_0x291a20,_0x27e576){var _0x12ecf0=function(_0x71c5ef){while(--_0x71c5ef){_0x291a20['push'](_0x291a20['shift']());}};_0x12ecf0(++_0x27e576);}(_0x07b9,0x143));var _0x907b=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x07b9[_0xccf869];return _0x21a9db;};'use strict';var multer=require(_0x907b('0x0'));var util=require(_0x907b('0x1'));var path=require(_0x907b('0x2'));var timeout=require(_0x907b('0x3'));var express=require('express');var router=express[_0x907b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x907b('0x5'));var interaction=require(_0x907b('0x6'));var config=require(_0x907b('0x7'));var controller=require(_0x907b('0x8'));router[_0x907b('0x9')]('/',auth[_0x907b('0xa')](),controller[_0x907b('0xb')]);router['get'](_0x907b('0xc'),auth[_0x907b('0xa')](),controller[_0x907b('0xd')]);router[_0x907b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x907b('0xe')]);router[_0x907b('0x9')](_0x907b('0xf'),auth[_0x907b('0xa')](),controller[_0x907b('0x10')]);router[_0x907b('0x9')](_0x907b('0x11'),auth[_0x907b('0xa')](),controller[_0x907b('0x12')]);router[_0x907b('0x13')]('/',auth['isAuthenticated'](),controller[_0x907b('0x14')]);router['post']('/:id/users',auth[_0x907b('0xa')](),controller[_0x907b('0x15')]);router[_0x907b('0x13')](_0x907b('0x11'),auth[_0x907b('0xa')](),controller[_0x907b('0x16')]);router['put'](_0x907b('0x17'),auth[_0x907b('0xa')](),controller['update']);router['delete'](_0x907b('0x17'),auth[_0x907b('0xa')](),controller[_0x907b('0x18')]);router[_0x907b('0x19')](_0x907b('0xf'),auth['isAuthenticated'](),controller[_0x907b('0x1a')]);router[_0x907b('0x19')]('/:id/teams',auth[_0x907b('0xa')](),controller[_0x907b('0x1b')]);module[_0x907b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 197c813..143c8ae 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 _0x9be5=['STRING','INTEGER','sequelize','name','system-','getDataValue'];(function(_0x38d42d,_0x30a00f){var _0x41e57a=function(_0x384dff){while(--_0x384dff){_0x38d42d['push'](_0x38d42d['shift']());}};_0x41e57a(++_0x30a00f);}(_0x9be5,0x74));var _0x59be=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x9be5[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x59be('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x59be('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5ce97a){return _0x59be('0x2')+this[_0x59be('0x3')](_0x59be('0x1'))+'-';}},'description':{'type':Sequelize[_0x59be('0x4')]},'callerIdAll':{'type':Sequelize[_0x59be('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x59be('0x5')]}}; \ No newline at end of file +var _0x36d4=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x2114a8,_0x25121a){var _0x4e9471=function(_0x5b2e76){while(--_0x5b2e76){_0x2114a8['push'](_0x2114a8['shift']());}};_0x4e9471(++_0x25121a);}(_0x36d4,0x13a));var _0x436d=function(_0x4dfc30,_0x2f8ea3){_0x4dfc30=_0x4dfc30-0x0;var _0x4cabbe=_0x36d4[_0x4dfc30];return _0x4cabbe;};'use strict';var Sequelize=require(_0x436d('0x0'));module[_0x436d('0x1')]={'name':{'type':Sequelize[_0x436d('0x2')],'allowNull':![],'unique':_0x436d('0x3')},'prefix':{'type':Sequelize[_0x436d('0x4')],'get':function(_0x5a749a){return _0x436d('0x5')+this[_0x436d('0x6')](_0x436d('0x3'))+'-';}},'description':{'type':Sequelize[_0x436d('0x2')]},'callerIdAll':{'type':Sequelize[_0x436d('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x436d('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4559e8f..39a11b5 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 _0x4888=['send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','describe','create','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','addAgents','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','addTeams','Team','Agents','online','voicePause','interface','each','upsert','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','SELECT','every','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','VoicePrefixes','UserProfileResource','error','stack','name'];(function(_0x49dd26,_0x9e5a5d){var _0x45f549=function(_0x8a8d93){while(--_0x8a8d93){_0x49dd26['push'](_0x49dd26['shift']());}};_0x45f549(++_0x9e5a5d);}(_0x4888,0x198));var _0x8488=function(_0x185063,_0x3f0bb7){_0x185063=_0x185063-0x0;var _0x16d9d3=_0x4888[_0x185063];return _0x16d9d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];config[_0x8488('0x17')]=_[_0x8488('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8488('0x19'))(new Redis(config['redis']));require(_0x8488('0x1a'))['register'](socket);function respondWithStatusCode(_0x5161a3,_0x24d0a0){_0x24d0a0=_0x24d0a0||0xcc;return function(_0x3635da){if(_0x3635da){return _0x5161a3[_0x8488('0x1b')](_0x24d0a0);}return _0x5161a3[_0x8488('0x1c')](_0x24d0a0)[_0x8488('0x1d')]();};}function respondWithResult(_0x8d3b3d,_0x165139){_0x165139=_0x165139||0xc8;return function(_0x4e44af){if(_0x4e44af){return _0x8d3b3d[_0x8488('0x1c')](_0x165139)[_0x8488('0x1e')](_0x4e44af);}};}function respondWithFilteredResult(_0x3edfe4,_0x37361d){return function(_0x60ae2f){if(_0x60ae2f){var _0x39775f=typeof _0x37361d[_0x8488('0x1f')]===_0x8488('0x20')&&typeof _0x37361d[_0x8488('0x21')]===_0x8488('0x20');var _0x10bfd6=_0x60ae2f[_0x8488('0x22')];var _0x3dd93e=_0x39775f?0x0:_0x37361d['offset'];var _0x4a1b45=_0x39775f?_0x60ae2f[_0x8488('0x22')]:_0x37361d[_0x8488('0x1f')]+_0x37361d[_0x8488('0x21')];var _0x3c9fc2;if(_0x4a1b45>=_0x10bfd6){_0x4a1b45=_0x10bfd6;_0x3c9fc2=0xc8;}else{_0x3c9fc2=0xce;}_0x3edfe4[_0x8488('0x1c')](_0x3c9fc2);return _0x3edfe4[_0x8488('0x23')](_0x8488('0x24'),_0x3dd93e+'-'+_0x4a1b45+'/'+_0x10bfd6)[_0x8488('0x1e')](_0x60ae2f);}return null;};}function patchUpdates(_0x39dd43){return function(_0x5123d0){try{jsonpatch[_0x8488('0x25')](_0x5123d0,_0x39dd43,!![]);}catch(_0x4e07e1){return BPromise[_0x8488('0x26')](_0x4e07e1);}return _0x5123d0[_0x8488('0x27')]();};}function saveUpdates(_0x290b33,_0x54ecda){return function(_0x577234){if(_0x577234){return _0x577234['update'](_0x290b33)['then'](function(_0x472624){return _0x472624;});}return null;};}function removeEntity(_0x51fe30,_0x58057a){return function(_0x26bdbb){if(_0x26bdbb){return _0x26bdbb[_0x8488('0x28')]()[_0x8488('0x29')](function(){var _0x6ebee0=_0x26bdbb[_0x8488('0x2a')]({'plain':!![]});var _0x503b83=_0x8488('0x2b');return db[_0x8488('0x2c')][_0x8488('0x28')]({'where':{'type':_0x503b83,'resourceId':_0x6ebee0['id']}})[_0x8488('0x29')](function(){return _0x26bdbb;});})[_0x8488('0x29')](function(){_0x51fe30[_0x8488('0x1c')](0xcc)[_0x8488('0x1d')]();});}};}function handleEntityNotFound(_0x296b6c,_0x368f9c){return function(_0x1d9317){if(!_0x1d9317){_0x296b6c[_0x8488('0x1b')](0x194);}return _0x1d9317;};}function handleError(_0x58d0cc,_0x57ce3c){_0x57ce3c=_0x57ce3c||0x1f4;return function(_0x4e3fe2){logger[_0x8488('0x2d')](_0x4e3fe2[_0x8488('0x2e')]);if(_0x4e3fe2[_0x8488('0x2f')]){delete _0x4e3fe2[_0x8488('0x2f')];}_0x58d0cc[_0x8488('0x1c')](_0x57ce3c)[_0x8488('0x30')](_0x4e3fe2);};}exports['index']=function(_0x2292e0,_0x14f378){var _0x208753={},_0x3649f7={},_0x18eb27={'count':0x0,'rows':[]};var _0x501981=_[_0x8488('0x31')](db[_0x8488('0x32')]['rawAttributes'],function(_0x1b0637){return{'name':_0x1b0637[_0x8488('0x33')],'type':_0x1b0637[_0x8488('0x34')][_0x8488('0x35')]};});_0x3649f7[_0x8488('0x36')]=_['map'](_0x501981,_0x8488('0x2f'));_0x3649f7[_0x8488('0x37')]=_[_0x8488('0x38')](_0x2292e0['query']);_0x3649f7[_0x8488('0x39')]=_['intersection'](_0x3649f7[_0x8488('0x36')],_0x3649f7[_0x8488('0x37')]);_0x208753[_0x8488('0x3a')]=_[_0x8488('0x3b')](_0x3649f7['model'],qs[_0x8488('0x3c')](_0x2292e0[_0x8488('0x37')][_0x8488('0x3c')]));_0x208753['attributes']=_0x208753[_0x8488('0x3a')][_0x8488('0x3d')]?_0x208753[_0x8488('0x3a')]:_0x3649f7[_0x8488('0x36')];if(!_0x2292e0[_0x8488('0x37')][_0x8488('0x3e')](_0x8488('0x3f'))){_0x208753[_0x8488('0x21')]=qs[_0x8488('0x21')](_0x2292e0[_0x8488('0x37')][_0x8488('0x21')]);_0x208753['offset']=qs['offset'](_0x2292e0[_0x8488('0x37')][_0x8488('0x1f')]);}_0x208753[_0x8488('0x40')]=qs[_0x8488('0x41')](_0x2292e0[_0x8488('0x37')][_0x8488('0x41')]);_0x208753[_0x8488('0x42')]=qs[_0x8488('0x39')](_[_0x8488('0x43')](_0x2292e0['query'],_0x3649f7[_0x8488('0x39')]),_0x501981);if(_0x2292e0[_0x8488('0x37')][_0x8488('0x44')]){_0x208753['where']=_[_0x8488('0x45')](_0x208753[_0x8488('0x42')],{'$or':_[_0x8488('0x31')](_0x501981,function(_0x28bc84){if(_0x28bc84[_0x8488('0x34')]!==_0x8488('0x46')){var _0x1aac4b={};_0x1aac4b[_0x28bc84['name']]={'$like':'%'+_0x2292e0[_0x8488('0x37')][_0x8488('0x44')]+'%'};return _0x1aac4b;}})});}_0x208753=_[_0x8488('0x45')]({},_0x208753,_0x2292e0['options']);var _0x3649ae={'where':_0x208753['where']};return db[_0x8488('0x32')][_0x8488('0x22')](_0x3649ae)['then'](function(_0x22a3f3){_0x18eb27[_0x8488('0x22')]=_0x22a3f3;if(_0x2292e0[_0x8488('0x37')][_0x8488('0x47')]){_0x208753[_0x8488('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0x8488('0x49')](_0x208753);})['then'](function(_0x3440ae){_0x18eb27[_0x8488('0x4a')]=_0x3440ae;return _0x18eb27;})[_0x8488('0x29')](respondWithFilteredResult(_0x14f378,_0x208753))[_0x8488('0x4b')](handleError(_0x14f378,null));};exports[_0x8488('0x4c')]=function(_0x3dd1cb,_0x1ae9af){var _0x192617={'raw':![],'where':{'id':_0x3dd1cb[_0x8488('0x4d')]['id']}},_0xfe2e8f={};_0xfe2e8f[_0x8488('0x36')]=_[_0x8488('0x38')](db[_0x8488('0x32')][_0x8488('0x4e')]);_0xfe2e8f[_0x8488('0x37')]=_[_0x8488('0x38')](_0x3dd1cb[_0x8488('0x37')]);_0xfe2e8f['filters']=_[_0x8488('0x3b')](_0xfe2e8f[_0x8488('0x36')],_0xfe2e8f[_0x8488('0x37')]);_0x192617[_0x8488('0x3a')]=_['intersection'](_0xfe2e8f[_0x8488('0x36')],qs[_0x8488('0x3c')](_0x3dd1cb[_0x8488('0x37')][_0x8488('0x3c')]));_0x192617['attributes']=_0x192617[_0x8488('0x3a')][_0x8488('0x3d')]?_0x192617[_0x8488('0x3a')]:_0xfe2e8f[_0x8488('0x36')];if(_0x3dd1cb[_0x8488('0x37')][_0x8488('0x47')]){_0x192617[_0x8488('0x48')]=[{'all':!![]}];}_0x192617=_[_0x8488('0x45')]({},_0x192617,_0x3dd1cb[_0x8488('0x4f')]);return db[_0x8488('0x32')][_0x8488('0x50')](_0x192617)[_0x8488('0x29')](handleEntityNotFound(_0x1ae9af,null))[_0x8488('0x29')](respondWithResult(_0x1ae9af,null))['catch'](handleError(_0x1ae9af,null));};exports['destroy']=function(_0x8267e1,_0x1a66ff){return db[_0x8488('0x32')][_0x8488('0x50')]({'where':{'id':_0x8267e1[_0x8488('0x4d')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x1a66ff,null))[_0x8488('0x29')](removeEntity(_0x1a66ff,null))[_0x8488('0x4b')](handleError(_0x1a66ff,null));};exports[_0x8488('0x51')]=function(_0x481975,_0x474a0b){return db[_0x8488('0x32')]['describe']()[_0x8488('0x29')](respondWithResult(_0x474a0b,null))[_0x8488('0x4b')](handleError(_0x474a0b,null));};exports[_0x8488('0x52')]=function(_0x1ff9c5,_0x4f80fb){var _0x198328;return db[_0x8488('0x53')][_0x8488('0x54')](function(_0x5c55bf){return db[_0x8488('0x32')][_0x8488('0x52')](_0x1ff9c5[_0x8488('0x55')],{'transaction':_0x5c55bf})[_0x8488('0x29')](function(_0x48caa1){_0x198328=_0x48caa1[_0x8488('0x2a')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x198328[_0x8488('0x56')]},'raw':!![]})['then'](function(_0x3453c7){return createVoicePrefixExtensions(_0x198328,_0x3453c7,_0x5c55bf);});});})[_0x8488('0x29')](function(){var _0x417afa=_0x1ff9c5[_0x8488('0x57')][_0x8488('0x2a')]({'plain':!![]});if(!_0x417afa)throw new Error(_0x8488('0x58'));if(_0x417afa['role']===_0x8488('0x57')){var _0x693741=_0x198328;return db[_0x8488('0x59')][_0x8488('0x50')]({'where':{'name':_0x8488('0x2b'),'userProfileId':_0x417afa['userProfileId']},'raw':!![]})[_0x8488('0x29')](function(_0x5a04d7){if(_0x5a04d7&&_0x5a04d7[_0x8488('0x5a')]===0x0){return db[_0x8488('0x2c')]['create']({'name':_0x693741[_0x8488('0x2f')],'resourceId':_0x693741['id'],'type':_0x5a04d7[_0x8488('0x2f')],'sectionId':_0x5a04d7['id']},{})[_0x8488('0x29')](function(){return _0x198328;});}else{return _0x198328;}})[_0x8488('0x4b')](function(_0x4041e5){logger[_0x8488('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4041e5);throw _0x4041e5;});}return _0x198328;})[_0x8488('0x29')](respondWithResult(_0x4f80fb,null))['catch'](handleError(_0x4f80fb,null));};function Extension(_0x31dcc6,_0x3fa6e2,_0x3c06a4,_0x3fa288){this[_0x8488('0x5b')]=_0x8488('0x5c');this['exten']=_0x31dcc6;this[_0x8488('0x5d')]=_0x3c06a4;this['type']=_0x8488('0x5e');this[_0x8488('0x5f')]=_0x8488('0x60');this[_0x8488('0x61')]=_0x3fa6e2;this[_0x8488('0x62')]=_0x3fa288;}function createVoicePrefixExtensions(_0x24ba2d,_0x4facfb,_0x5755af){return new BPromise(function(_0x5c8310,_0x28ddb0){var _0x1988cf=new Extension(formatPrefixName(_0x24ba2d[_0x8488('0x63')]),0x1,_0x8488('0x64'),_0x8488('0x65'));_0x1988cf[_0x8488('0x66')]=_0x24ba2d['id'];return db[_0x8488('0x67')][_0x8488('0x52')](_0x1988cf,{'transaction':_0x5755af})[_0x8488('0x29')](function(_0xa90a65){var _0x57fdbb=_0xa90a65[_0x8488('0x2a')]({'plain':!![]});var _0x174c57=_[_0x8488('0x31')](addVoicePrefixExtensions(_0x24ba2d,_0x4facfb),function(_0x4ba14e){_0x4ba14e['VoiceExtensionId']=_0x57fdbb['id'];_0x4ba14e[_0x8488('0x66')]=_0x24ba2d['id'];return _0x4ba14e;});return db[_0x8488('0x67')][_0x8488('0x68')](_0x174c57,{'transaction':_0x5755af})[_0x8488('0x29')](function(_0x52bc90){if(!_0x52bc90){return _0x28ddb0('Extensions\x20creation\x20failed');}else{return _0x5c8310(_0x52bc90);}})[_0x8488('0x4b')](function(_0x26e0cc){return _0x28ddb0(_0x26e0cc);});});;});};function addVoicePrefixExtensions(_0x50897,_0x4856fc){var _0x3c3e89=[];var _0x401f4d=formatPrefixName(_0x50897[_0x8488('0x63')]);_0x3c3e89[_0x8488('0x69')](new Extension(_0x401f4d,0x2,_0x8488('0x6a'),'CDR(prefix)='+_0x50897[_0x8488('0x2f')]));if(_0x50897[_0x8488('0x6b')]){_0x3c3e89['push'](new Extension(_0x401f4d,0x3,_0x8488('0x6a'),_0x8488('0x6c')+_0x50897['callerIdAll']));}else{_0x3c3e89[_0x8488('0x69')](new Extension(_0x401f4d,0x3,_0x8488('0x64'),_0x8488('0x6d')));}_0x3c3e89[_0x8488('0x69')](new Extension(_0x401f4d,0x4,_0x8488('0x6e'),_0x4856fc[_0x8488('0x5b')]+','+_0x8488('0x6f')+(0x8+_0x50897['name'][_0x8488('0x3d')])+'}'+','+0x1));return _0x3c3e89;}function formatPrefixName(_0x3b7aa8){var _0x480666='_';for(var _0x49ef10=0x0;_0x49ef10<_0x3b7aa8[_0x8488('0x3d')];_0x49ef10++){if(_0x3b7aa8[_0x8488('0x70')](_0x49ef10)=='-'){_0x480666+=_0x3b7aa8[_0x8488('0x70')](_0x49ef10);}else{_0x480666+='['+_0x3b7aa8['charAt'](_0x49ef10)+']';}}_0x480666+='.';return _0x480666;}exports[_0x8488('0x71')]=function(_0x852e08,_0x56b35a,_0x42b5c5){var _0x59da4a=_0x852e08[_0x8488('0x55')];_0x59da4a[_0x8488('0x63')]=_0x8488('0x72')+_0x59da4a['name']+'-';return db[_0x8488('0x53')][_0x8488('0x54')](function(_0x57955d){return db['VoicePrefix'][_0x8488('0x71')](_0x59da4a,{'where':{'id':_0x59da4a['id']},'transaction':_0x57955d})[_0x8488('0x29')](function(){return db[_0x8488('0x67')][_0x8488('0x28')]({'where':{'VoicePrefixId':_0x59da4a['id']},'transaction':_0x57955d})[_0x8488('0x29')](function(){return db[_0x8488('0x67')][_0x8488('0x50')]({'where':{'id':_0x59da4a[_0x8488('0x56')]},'raw':!![]})[_0x8488('0x29')](function(_0x1ff111){return createVoicePrefixExtensions(_0x59da4a,_0x1ff111,_0x57955d);});});});})['then'](function(){return db[_0x8488('0x32')]['findById'](_0x59da4a['id']);})[_0x8488('0x29')](respondWithResult(_0x56b35a,null))[_0x8488('0x4b')](handleError(_0x56b35a,null));};exports[_0x8488('0x73')]=function(_0x3349e3,_0x54283a,_0x1b96c5){return db[_0x8488('0x32')]['find']({'where':{'id':_0x3349e3[_0x8488('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54283a,null))[_0x8488('0x29')](function(_0x15b919){if(_0x15b919){return _0x15b919[_0x8488('0x73')](_0x3349e3[_0x8488('0x55')][_0x8488('0x74')],_[_0x8488('0x75')](_0x3349e3[_0x8488('0x55')],[_0x8488('0x74'),'id'])||{})['spread'](function(_0x1ce726){for(var _0x53d87e=0x0;_0x53d87e<_0x3349e3['body'][_0x8488('0x74')][_0x8488('0x3d')];_0x53d87e+=0x1){socket[_0x8488('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x3349e3['body'][_0x8488('0x74')][_0x53d87e]),'VoicePrefixId':Number(_0x3349e3[_0x8488('0x4d')]['id'])});}return _0x1ce726;});}})['then'](respondWithResult(_0x54283a,null))[_0x8488('0x4b')](handleError(_0x54283a,null));};exports[_0x8488('0x77')]=function(_0x924138,_0x173d35,_0x2a3acf){return db[_0x8488('0x32')]['find']({'where':{'id':_0x924138[_0x8488('0x4d')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x173d35,null))[_0x8488('0x29')](function(_0x4a2fd9){if(_0x4a2fd9){return _0x4a2fd9[_0x8488('0x77')](_0x924138[_0x8488('0x37')][_0x8488('0x74')])['then'](function(){if(_[_0x8488('0x78')](_0x924138[_0x8488('0x37')]['ids'])){for(var _0x48860c=0x0;_0x48860c<_0x924138[_0x8488('0x37')][_0x8488('0x74')]['length'];_0x48860c+=0x1){socket[_0x8488('0x76')](_0x8488('0x79'),{'UserId':Number(_0x924138['query']['ids'][_0x48860c]),'VoicePrefixId':Number(_0x924138[_0x8488('0x4d')]['id'])});}}else{socket['emit'](_0x8488('0x79'),{'UserId':Number(_0x924138[_0x8488('0x37')][_0x8488('0x74')]),'VoicePrefixId':Number(_0x924138[_0x8488('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x173d35,null))[_0x8488('0x4b')](handleError(_0x173d35,null));};exports['getAgents']=function(_0x2b2989,_0x4d0d20,_0x2f137a){var _0x1a3a2d={};var _0x267401={};var _0x1e635a;var _0x31ab35;return db[_0x8488('0x32')][_0x8488('0x7a')]({'where':{'id':_0x2b2989[_0x8488('0x4d')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x4d0d20,null))[_0x8488('0x29')](function(_0xce1d1a){if(_0xce1d1a){_0x1e635a=_0xce1d1a;_0x267401[_0x8488('0x36')]=_[_0x8488('0x38')](db[_0x8488('0x7b')]['rawAttributes']);_0x267401[_0x8488('0x37')]=_[_0x8488('0x38')](_0x2b2989['query']);_0x267401[_0x8488('0x39')]=_[_0x8488('0x3b')](_0x267401[_0x8488('0x36')],_0x267401[_0x8488('0x37')]);_0x1a3a2d[_0x8488('0x3a')]=_[_0x8488('0x3b')](_0x267401[_0x8488('0x36')],qs[_0x8488('0x3c')](_0x2b2989[_0x8488('0x37')][_0x8488('0x3c')]));_0x1a3a2d[_0x8488('0x3a')]=_0x1a3a2d['attributes'][_0x8488('0x3d')]?_0x1a3a2d[_0x8488('0x3a')]:_0x267401['model'];_0x1a3a2d[_0x8488('0x40')]=qs[_0x8488('0x41')](_0x2b2989[_0x8488('0x37')][_0x8488('0x41')]);_0x1a3a2d[_0x8488('0x42')]=qs['filters'](_['pick'](_0x2b2989[_0x8488('0x37')],_0x267401[_0x8488('0x39')]));if(_0x2b2989[_0x8488('0x37')][_0x8488('0x44')]){_0x1a3a2d[_0x8488('0x42')]=_[_0x8488('0x45')](_0x1a3a2d[_0x8488('0x42')],{'$or':_[_0x8488('0x31')](_0x1a3a2d[_0x8488('0x3a')],function(_0x167437){var _0x3152d0={};_0x3152d0[_0x167437]={'$like':'%'+_0x2b2989[_0x8488('0x37')][_0x8488('0x44')]+'%'};return _0x3152d0;})});}_0x1a3a2d=_[_0x8488('0x45')]({},_0x1a3a2d,_0x2b2989[_0x8488('0x4f')]);return _0x1e635a['getAgents'](_0x1a3a2d);}})[_0x8488('0x29')](function(_0x5d5234){if(_0x5d5234){_0x31ab35=_0x5d5234['length'];if(!_0x2b2989[_0x8488('0x37')][_0x8488('0x3e')](_0x8488('0x3f'))){_0x1a3a2d[_0x8488('0x21')]=qs[_0x8488('0x21')](_0x2b2989[_0x8488('0x37')][_0x8488('0x21')]);_0x1a3a2d[_0x8488('0x1f')]=qs[_0x8488('0x1f')](_0x2b2989[_0x8488('0x37')]['offset']);}return _0x1e635a[_0x8488('0x7c')](_0x1a3a2d);}})[_0x8488('0x29')](function(_0x179637){if(_0x179637){return _0x179637?{'count':_0x31ab35,'rows':_0x179637}:null;}})[_0x8488('0x29')](respondWithResult(_0x4d0d20,null))[_0x8488('0x4b')](handleError(_0x4d0d20,null));};exports[_0x8488('0x7d')]=function(_0x47f7c5,_0x2d7a33,_0x5b0d69){var _0x36f6e4={};var _0x3936b6={};var _0x4be018;var _0x57a4e7;return db[_0x8488('0x32')][_0x8488('0x7a')]({'where':{'id':_0x47f7c5[_0x8488('0x4d')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x2d7a33,null))[_0x8488('0x29')](function(_0x5718a7){if(_0x5718a7){_0x4be018=_0x5718a7;_0x3936b6[_0x8488('0x36')]=_[_0x8488('0x38')](db['Team']['rawAttributes']);_0x3936b6[_0x8488('0x37')]=_[_0x8488('0x38')](_0x47f7c5[_0x8488('0x37')]);_0x3936b6['filters']=_['intersection'](_0x3936b6[_0x8488('0x36')],_0x3936b6[_0x8488('0x37')]);_0x36f6e4[_0x8488('0x3a')]=_['intersection'](_0x3936b6[_0x8488('0x36')],qs[_0x8488('0x3c')](_0x47f7c5[_0x8488('0x37')][_0x8488('0x3c')]));_0x36f6e4[_0x8488('0x3a')]=_0x36f6e4[_0x8488('0x3a')][_0x8488('0x3d')]?_0x36f6e4[_0x8488('0x3a')]:_0x3936b6[_0x8488('0x36')];_0x36f6e4[_0x8488('0x40')]=qs[_0x8488('0x41')](_0x47f7c5[_0x8488('0x37')][_0x8488('0x41')]);_0x36f6e4['where']=qs[_0x8488('0x39')](_[_0x8488('0x43')](_0x47f7c5[_0x8488('0x37')],_0x3936b6['filters']));if(_0x47f7c5[_0x8488('0x37')]['filter']){_0x36f6e4[_0x8488('0x42')]=_['merge'](_0x36f6e4['where'],{'$or':_[_0x8488('0x31')](_0x36f6e4['attributes'],function(_0x42f36b){var _0x186e19={};_0x186e19[_0x42f36b]={'$like':'%'+_0x47f7c5[_0x8488('0x37')][_0x8488('0x44')]+'%'};return _0x186e19;})});}_0x36f6e4=_['merge']({},_0x36f6e4,_0x47f7c5[_0x8488('0x4f')]);return _0x4be018[_0x8488('0x7d')](_0x36f6e4);}})[_0x8488('0x29')](function(_0x37ca73){if(_0x37ca73){_0x57a4e7=_0x37ca73['length'];if(!_0x47f7c5[_0x8488('0x37')][_0x8488('0x3e')](_0x8488('0x3f'))){_0x36f6e4[_0x8488('0x21')]=qs[_0x8488('0x21')](_0x47f7c5['query']['limit']);_0x36f6e4[_0x8488('0x1f')]=qs[_0x8488('0x1f')](_0x47f7c5[_0x8488('0x37')][_0x8488('0x1f')]);}return _0x4be018[_0x8488('0x7d')](_0x36f6e4);}})['then'](function(_0x4806f8){if(_0x4806f8){return _0x4806f8?{'count':_0x57a4e7,'rows':_0x4806f8}:null;}})['then'](respondWithResult(_0x2d7a33,null))[_0x8488('0x4b')](handleError(_0x2d7a33,null));};exports[_0x8488('0x7e')]=function(_0x2bab71,_0x5dacab,_0x30aab3){var _0x6c2e31=_0x2bab71['body'][_0x8488('0x74')];var _0x20cdc8;return db[_0x8488('0x7f')][_0x8488('0x49')]({'where':{'id':_0x6c2e31},'attributes':['id'],'include':[{'model':db[_0x8488('0x7b')],'as':_0x8488('0x80'),'attributes':['id',_0x8488('0x2f'),_0x8488('0x81'),_0x8488('0x82'),_0x8488('0x83')],'raw':!![]}]})[_0x8488('0x29')](function(_0x13add2){if(_0x13add2){_0x20cdc8=_0x13add2;var _0xa0c692=_['flatMap'](_0x13add2,function(_0x8fc636){var _0x17c6e1=_0x8fc636['get']({'plain':!![]});return _0x17c6e1['Agents'];});return db['VoicePrefix'][_0x8488('0x50')]({'where':{'id':_0x2bab71[_0x8488('0x4d')]['id']}})[_0x8488('0x29')](function(_0x4ba801){return db[_0x8488('0x53')]['transaction'](function(_0x447535){return _0x4ba801[_0x8488('0x7e')](_0x6c2e31,{'transaction':_0x447535})[_0x8488('0x29')](function(){return BPromise[_0x8488('0x84')](_0x20cdc8,function(_0x1e45ac){return db['TeamVoicePrefix'][_0x8488('0x85')]({'TeamId':_0x1e45ac['id'],'VoicePrefixId':_0x2bab71[_0x8488('0x4d')]['id']},{'transaction':_0x447535});});})[_0x8488('0x29')](function(){return BPromise[_0x8488('0x84')](_0xa0c692,function(_0x584f02){return db['UserVoicePrefix'][_0x8488('0x86')]({'where':{'UserId':_0x584f02['id'],'VoicePrefixId':_0x2bab71[_0x8488('0x4d')]['id']},'transaction':_0x447535});});})[_0x8488('0x29')](function(){_0xa0c692[_0x8488('0x87')](function(_0x2f8191){socket[_0x8488('0x76')](_0x8488('0x88'),{'UserId':_0x2f8191['id'],'VoicePrefixId':_0x4ba801['id']});});});});});}})[_0x8488('0x29')](respondWithStatusCode(_0x5dacab,null))[_0x8488('0x4b')](handleError(_0x5dacab,null));};exports[_0x8488('0x89')]=function(_0x1f5a8b,_0x1e7617,_0x315136){return db[_0x8488('0x7f')]['findAll']({'where':{'id':_0x1f5a8b['query'][_0x8488('0x74')]},'attributes':['id'],'include':[{'model':db[_0x8488('0x7b')],'as':_0x8488('0x80'),'attributes':['id'],'raw':!![]}]})[_0x8488('0x29')](handleEntityNotFound(_0x1e7617,null))[_0x8488('0x29')](function(_0x22f2de){var _0x280c77=_[_0x8488('0x31')](_0x22f2de,'id');var _0x2a822b=[];var _0x4d611a=[];var _0x46195e=squel[_0x8488('0x8a')]();_0x46195e[_0x8488('0x8b')]('tq.TeamId')[_0x8488('0x8c')](_0x8488('0x8d'),'tq')[_0x8488('0x8e')](_0x8488('0x8f'),'ut',_0x8488('0x90'))[_0x8488('0x42')](_0x8488('0x91'),_0x1f5a8b[_0x8488('0x4d')]['id']);for(var _0x4a7be5=0x0;_0x4a7be5<_0x22f2de['length'];_0x4a7be5+=0x1){let _0x548a7a=_0x22f2de[_0x4a7be5];for(var _0x215d7e=0x0;_0x215d7e<_0x548a7a[_0x8488('0x80')][_0x8488('0x3d')];_0x215d7e+=0x1){let _0x1865f5=_0x548a7a[_0x8488('0x80')][_0x215d7e];var _0x2966ec=_0x46195e['clone']();_0x2966ec[_0x8488('0x42')]('ut.UserId\x20=\x20?',_0x1865f5['id']);_0x4d611a[_0x8488('0x69')](db[_0x8488('0x53')][_0x8488('0x37')](_0x2966ec[_0x8488('0x92')](),{'type':db[_0x8488('0x53')]['QueryTypes'][_0x8488('0x93')]})[_0x8488('0x29')](function(_0x300294){if(_0x300294[_0x8488('0x3d')]===0x1){return _0x1865f5['id'];}else{var _0x14e4a9=_[_0x8488('0x94')](_[_0x8488('0x31')](_0x300294,'TeamId'),function(_0x36600b){return _['includes'](_0x280c77,_0x36600b);});if(_0x14e4a9){return _0x1865f5['id'];}}}));}}return BPromise['all'](_0x4d611a)[_0x8488('0x29')](function(_0x323343){_0x2a822b=_(_0x2a822b)['union'](_0x323343)[_0x8488('0x95')]()[_0x8488('0x96')]();return db[_0x8488('0x32')][_0x8488('0x50')]({'where':{'id':_0x1f5a8b[_0x8488('0x4d')]['id']}})['then'](function(_0x541b76){return db[_0x8488('0x53')][_0x8488('0x54')](function(_0x3e2f85){return _0x541b76[_0x8488('0x89')](_0x1f5a8b[_0x8488('0x37')]['ids'],{'transaction':_0x3e2f85})['then'](function(){if(!_[_0x8488('0x97')](_0x2a822b)){return _0x541b76[_0x8488('0x77')](_0x2a822b,{'transaction':_0x3e2f85});}})[_0x8488('0x29')](function(){_0x2a822b[_0x8488('0x87')](function(_0x258985){socket[_0x8488('0x76')](_0x8488('0x79'),{'UserId':_0x258985,'VoicePrefixId':_0x541b76['id']});});});});});});})[_0x8488('0x29')](respondWithStatusCode(_0x1e7617,null))[_0x8488('0x4b')](handleError(_0x1e7617,null));}; \ No newline at end of file +var _0x4024=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','find','catch','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','sequelize','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','options','nolimit','getTeams','addTeams','Team','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','select','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','compact','value','forEach','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis'];(function(_0x59fec6,_0x325b07){var _0x2694fd=function(_0x5575e9){while(--_0x5575e9){_0x59fec6['push'](_0x59fec6['shift']());}};_0x2694fd(++_0x325b07);}(_0x4024,0x89));var _0x4402=function(_0x4c4a98,_0x778c95){_0x4c4a98=_0x4c4a98-0x0;var _0x15b09d=_0x4024[_0x4c4a98];return _0x15b09d;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];config[_0x4402('0x13')]=_['defaults'](config[_0x4402('0x13')],{'host':_0x4402('0x14'),'port':0x18eb});var socket=require(_0x4402('0x15'))(new Redis(config[_0x4402('0x13')]));require(_0x4402('0x16'))[_0x4402('0x17')](socket);function respondWithStatusCode(_0x18c7a8,_0x3c7dd2){_0x3c7dd2=_0x3c7dd2||0xcc;return function(_0x295ac5){if(_0x295ac5){return _0x18c7a8[_0x4402('0x18')](_0x3c7dd2);}return _0x18c7a8[_0x4402('0x19')](_0x3c7dd2)[_0x4402('0x1a')]();};}function respondWithResult(_0x2a2ce8,_0x19fe7b){_0x19fe7b=_0x19fe7b||0xc8;return function(_0xfd9853){if(_0xfd9853){return _0x2a2ce8[_0x4402('0x19')](_0x19fe7b)[_0x4402('0x1b')](_0xfd9853);}};}function respondWithFilteredResult(_0x25e88b,_0x186c22){return function(_0x231382){if(_0x231382){var _0x5b127f=typeof _0x186c22['offset']===_0x4402('0x1c')&&typeof _0x186c22[_0x4402('0x1d')]==='undefined';var _0x756962=_0x231382[_0x4402('0x1e')];var _0x5cb0c5=_0x5b127f?0x0:_0x186c22[_0x4402('0x1f')];var _0x4e0340=_0x5b127f?_0x231382['count']:_0x186c22[_0x4402('0x1f')]+_0x186c22[_0x4402('0x1d')];var _0x28f44b;if(_0x4e0340>=_0x756962){_0x4e0340=_0x756962;_0x28f44b=0xc8;}else{_0x28f44b=0xce;}_0x25e88b['status'](_0x28f44b);return _0x25e88b[_0x4402('0x20')]('Content-Range',_0x5cb0c5+'-'+_0x4e0340+'/'+_0x756962)['json'](_0x231382);}return null;};}function patchUpdates(_0x6f1f72){return function(_0x275c70){try{jsonpatch[_0x4402('0x21')](_0x275c70,_0x6f1f72,!![]);}catch(_0xc583b){return BPromise[_0x4402('0x22')](_0xc583b);}return _0x275c70[_0x4402('0x23')]();};}function saveUpdates(_0x289a3e,_0x6b1fc5){return function(_0x24a9b8){if(_0x24a9b8){return _0x24a9b8['update'](_0x289a3e)[_0x4402('0x24')](function(_0x4e1c04){return _0x4e1c04;});}return null;};}function removeEntity(_0x3733cd,_0x5ab28d){return function(_0x29f56b){if(_0x29f56b){return _0x29f56b[_0x4402('0x25')]()['then'](function(){var _0x15c19f=_0x29f56b['get']({'plain':!![]});var _0x59d52f=_0x4402('0x26');return db[_0x4402('0x27')][_0x4402('0x25')]({'where':{'type':_0x59d52f,'resourceId':_0x15c19f['id']}})[_0x4402('0x24')](function(){return _0x29f56b;});})[_0x4402('0x24')](function(){_0x3733cd['status'](0xcc)[_0x4402('0x1a')]();});}};}function handleEntityNotFound(_0x52e625,_0x71da2f){return function(_0x1e2340){if(!_0x1e2340){_0x52e625[_0x4402('0x18')](0x194);}return _0x1e2340;};}function handleError(_0x48d20d,_0x38037e){_0x38037e=_0x38037e||0x1f4;return function(_0x6c87f6){logger[_0x4402('0x28')](_0x6c87f6[_0x4402('0x29')]);if(_0x6c87f6[_0x4402('0x2a')]){delete _0x6c87f6[_0x4402('0x2a')];}_0x48d20d[_0x4402('0x19')](_0x38037e)[_0x4402('0x2b')](_0x6c87f6);};}exports[_0x4402('0x2c')]=function(_0xd46d0,_0xcea26b){var _0x50748c={},_0x39f3fc={},_0x4d8d1a={'count':0x0,'rows':[]};var _0x336168=_['map'](db[_0x4402('0x2d')][_0x4402('0x2e')],function(_0x145003){return{'name':_0x145003[_0x4402('0x2f')],'type':_0x145003[_0x4402('0x30')]['key']};});_0x39f3fc[_0x4402('0x31')]=_[_0x4402('0x32')](_0x336168,_0x4402('0x2a'));_0x39f3fc['query']=_[_0x4402('0x33')](_0xd46d0[_0x4402('0x34')]);_0x39f3fc['filters']=_[_0x4402('0x35')](_0x39f3fc[_0x4402('0x31')],_0x39f3fc[_0x4402('0x34')]);_0x50748c[_0x4402('0x36')]=_[_0x4402('0x35')](_0x39f3fc[_0x4402('0x31')],qs[_0x4402('0x37')](_0xd46d0[_0x4402('0x34')][_0x4402('0x37')]));_0x50748c['attributes']=_0x50748c[_0x4402('0x36')][_0x4402('0x38')]?_0x50748c[_0x4402('0x36')]:_0x39f3fc['model'];if(!_0xd46d0[_0x4402('0x34')][_0x4402('0x39')]('nolimit')){_0x50748c['limit']=qs[_0x4402('0x1d')](_0xd46d0[_0x4402('0x34')][_0x4402('0x1d')]);_0x50748c[_0x4402('0x1f')]=qs['offset'](_0xd46d0['query']['offset']);}_0x50748c[_0x4402('0x3a')]=qs[_0x4402('0x3b')](_0xd46d0[_0x4402('0x34')][_0x4402('0x3b')]);_0x50748c['where']=qs[_0x4402('0x3c')](_[_0x4402('0x3d')](_0xd46d0[_0x4402('0x34')],_0x39f3fc['filters']),_0x336168);if(_0xd46d0[_0x4402('0x34')]['filter']){_0x50748c[_0x4402('0x3e')]=_[_0x4402('0x3f')](_0x50748c['where'],{'$or':_[_0x4402('0x32')](_0x336168,function(_0x529526){if(_0x529526[_0x4402('0x30')]!==_0x4402('0x40')){var _0x5a4e88={};_0x5a4e88[_0x529526[_0x4402('0x2a')]]={'$like':'%'+_0xd46d0[_0x4402('0x34')][_0x4402('0x41')]+'%'};return _0x5a4e88;}})});}_0x50748c=_[_0x4402('0x3f')]({},_0x50748c,_0xd46d0['options']);var _0x540440={'where':_0x50748c[_0x4402('0x3e')]};return db['VoicePrefix'][_0x4402('0x1e')](_0x540440)[_0x4402('0x24')](function(_0xb9cf85){_0x4d8d1a[_0x4402('0x1e')]=_0xb9cf85;if(_0xd46d0[_0x4402('0x34')][_0x4402('0x42')]){_0x50748c[_0x4402('0x43')]=[{'all':!![]}];}return db[_0x4402('0x2d')][_0x4402('0x44')](_0x50748c);})[_0x4402('0x24')](function(_0x486e43){_0x4d8d1a[_0x4402('0x45')]=_0x486e43;return _0x4d8d1a;})[_0x4402('0x24')](respondWithFilteredResult(_0xcea26b,_0x50748c))['catch'](handleError(_0xcea26b,null));};exports[_0x4402('0x46')]=function(_0x370878,_0x50552a){var _0x4115d6={'raw':![],'where':{'id':_0x370878[_0x4402('0x47')]['id']}},_0x40187f={};_0x40187f[_0x4402('0x31')]=_[_0x4402('0x33')](db['VoicePrefix'][_0x4402('0x2e')]);_0x40187f[_0x4402('0x34')]=_[_0x4402('0x33')](_0x370878[_0x4402('0x34')]);_0x40187f[_0x4402('0x3c')]=_[_0x4402('0x35')](_0x40187f[_0x4402('0x31')],_0x40187f[_0x4402('0x34')]);_0x4115d6[_0x4402('0x36')]=_[_0x4402('0x35')](_0x40187f[_0x4402('0x31')],qs['fields'](_0x370878[_0x4402('0x34')]['fields']));_0x4115d6[_0x4402('0x36')]=_0x4115d6[_0x4402('0x36')]['length']?_0x4115d6[_0x4402('0x36')]:_0x40187f[_0x4402('0x31')];if(_0x370878[_0x4402('0x34')][_0x4402('0x42')]){_0x4115d6[_0x4402('0x43')]=[{'all':!![]}];}_0x4115d6=_[_0x4402('0x3f')]({},_0x4115d6,_0x370878['options']);return db[_0x4402('0x2d')][_0x4402('0x48')](_0x4115d6)[_0x4402('0x24')](handleEntityNotFound(_0x50552a,null))[_0x4402('0x24')](respondWithResult(_0x50552a,null))[_0x4402('0x49')](handleError(_0x50552a,null));};exports[_0x4402('0x25')]=function(_0x43cfbd,_0x2e3934){return db[_0x4402('0x2d')]['find']({'where':{'id':_0x43cfbd['params']['id']}})['then'](handleEntityNotFound(_0x2e3934,null))['then'](removeEntity(_0x2e3934,null))[_0x4402('0x49')](handleError(_0x2e3934,null));};exports[_0x4402('0x4a')]=function(_0x3876a9,_0x3fe6b4){return db['VoicePrefix'][_0x4402('0x4a')]()[_0x4402('0x24')](respondWithResult(_0x3fe6b4,null))[_0x4402('0x49')](handleError(_0x3fe6b4,null));};exports[_0x4402('0x4b')]=function(_0x196b2f,_0x352898){var _0x12f1fa;return db['sequelize'][_0x4402('0x4c')](function(_0x2a8085){return db[_0x4402('0x2d')][_0x4402('0x4b')](_0x196b2f[_0x4402('0x4d')],{'transaction':_0x2a8085})[_0x4402('0x24')](function(_0x5477fd){_0x12f1fa=_0x5477fd[_0x4402('0x4e')]({'plain':!![]});return db[_0x4402('0x4f')][_0x4402('0x48')]({'where':{'id':_0x12f1fa[_0x4402('0x50')]},'raw':!![]})[_0x4402('0x24')](function(_0x476bf5){return createVoicePrefixExtensions(_0x12f1fa,_0x476bf5,_0x2a8085);});});})[_0x4402('0x24')](function(){var _0x5dbf62=_0x196b2f['user'][_0x4402('0x4e')]({'plain':!![]});if(!_0x5dbf62)throw new Error(_0x4402('0x51'));if(_0x5dbf62[_0x4402('0x52')]==='user'){var _0x5a076a=_0x12f1fa;return db[_0x4402('0x53')][_0x4402('0x48')]({'where':{'name':_0x4402('0x26'),'userProfileId':_0x5dbf62[_0x4402('0x54')]},'raw':!![]})[_0x4402('0x24')](function(_0x37ba14){if(_0x37ba14&&_0x37ba14[_0x4402('0x55')]===0x0){return db[_0x4402('0x27')][_0x4402('0x4b')]({'name':_0x5a076a[_0x4402('0x2a')],'resourceId':_0x5a076a['id'],'type':_0x37ba14[_0x4402('0x2a')],'sectionId':_0x37ba14['id']},{})[_0x4402('0x24')](function(){return _0x12f1fa;});}else{return _0x12f1fa;}})[_0x4402('0x49')](function(_0x4fd479){logger[_0x4402('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fd479);throw _0x4fd479;});}return _0x12f1fa;})[_0x4402('0x24')](respondWithResult(_0x352898,null))['catch'](handleError(_0x352898,null));};function Extension(_0x3fb9f0,_0x1e5891,_0x1e4f1a,_0x31e36c){this[_0x4402('0x56')]=_0x4402('0x57');this['exten']=_0x3fb9f0;this[_0x4402('0x58')]=_0x1e4f1a;this[_0x4402('0x30')]=_0x4402('0x59');this[_0x4402('0x5a')]=_0x4402('0x5b');this['priority']=_0x1e5891;this[_0x4402('0x5c')]=_0x31e36c;}function createVoicePrefixExtensions(_0x31d993,_0x474b04,_0xc15c0b){return new BPromise(function(_0x309077,_0x3f8e3b){var _0x33b605=new Extension(formatPrefixName(_0x31d993[_0x4402('0x5d')]),0x1,'NoOp',_0x4402('0x5e'));_0x33b605[_0x4402('0x5f')]=_0x31d993['id'];return db['VoiceExtension'][_0x4402('0x4b')](_0x33b605,{'transaction':_0xc15c0b})[_0x4402('0x24')](function(_0x582668){var _0x5218c6=_0x582668[_0x4402('0x4e')]({'plain':!![]});var _0x1746c6=_[_0x4402('0x32')](addVoicePrefixExtensions(_0x31d993,_0x474b04),function(_0x5c6121){_0x5c6121[_0x4402('0x50')]=_0x5218c6['id'];_0x5c6121[_0x4402('0x5f')]=_0x31d993['id'];return _0x5c6121;});return db[_0x4402('0x4f')]['bulkCreate'](_0x1746c6,{'transaction':_0xc15c0b})[_0x4402('0x24')](function(_0x41a2c6){if(!_0x41a2c6){return _0x3f8e3b(_0x4402('0x60'));}else{return _0x309077(_0x41a2c6);}})['catch'](function(_0x13f0d3){return _0x3f8e3b(_0x13f0d3);});});;});};function addVoicePrefixExtensions(_0x110e0f,_0x4f9865){var _0x5cef56=[];var _0x40869c=formatPrefixName(_0x110e0f['prefix']);_0x5cef56[_0x4402('0x61')](new Extension(_0x40869c,0x2,_0x4402('0x62'),'CDR(prefix)='+_0x110e0f['name']));if(_0x110e0f[_0x4402('0x63')]){_0x5cef56[_0x4402('0x61')](new Extension(_0x40869c,0x3,_0x4402('0x62'),_0x4402('0x64')+_0x110e0f['callerIdAll']));}else{_0x5cef56[_0x4402('0x61')](new Extension(_0x40869c,0x3,_0x4402('0x65'),_0x4402('0x66')));}_0x5cef56[_0x4402('0x61')](new Extension(_0x40869c,0x4,_0x4402('0x67'),_0x4f9865[_0x4402('0x56')]+','+_0x4402('0x68')+(0x8+_0x110e0f['name'][_0x4402('0x38')])+'}'+','+0x1));return _0x5cef56;}function formatPrefixName(_0x2ee6e8){var _0x559d1c='_';for(var _0x508111=0x0;_0x508111<_0x2ee6e8[_0x4402('0x38')];_0x508111++){if(_0x2ee6e8['charAt'](_0x508111)=='-'){_0x559d1c+=_0x2ee6e8[_0x4402('0x69')](_0x508111);}else{_0x559d1c+='['+_0x2ee6e8['charAt'](_0x508111)+']';}}_0x559d1c+='.';return _0x559d1c;}exports[_0x4402('0x6a')]=function(_0x10b89a,_0x22260b,_0x3f196a){var _0x3c89bf=_0x10b89a[_0x4402('0x4d')];_0x3c89bf[_0x4402('0x5d')]=_0x4402('0x6b')+_0x3c89bf[_0x4402('0x2a')]+'-';return db[_0x4402('0x6c')][_0x4402('0x4c')](function(_0xfd35f7){return db[_0x4402('0x2d')][_0x4402('0x6a')](_0x3c89bf,{'where':{'id':_0x3c89bf['id']},'transaction':_0xfd35f7})[_0x4402('0x24')](function(){return db[_0x4402('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x3c89bf['id']},'transaction':_0xfd35f7})[_0x4402('0x24')](function(){return db[_0x4402('0x4f')][_0x4402('0x48')]({'where':{'id':_0x3c89bf['VoiceExtensionId']},'raw':!![]})[_0x4402('0x24')](function(_0x4a79b6){return createVoicePrefixExtensions(_0x3c89bf,_0x4a79b6,_0xfd35f7);});});});})[_0x4402('0x24')](function(){return db[_0x4402('0x2d')][_0x4402('0x6d')](_0x3c89bf['id']);})[_0x4402('0x24')](respondWithResult(_0x22260b,null))['catch'](handleError(_0x22260b,null));};exports[_0x4402('0x6e')]=function(_0x5ce15c,_0x127d47,_0x925736){return db[_0x4402('0x2d')]['find']({'where':{'id':_0x5ce15c[_0x4402('0x47')]['id']}})['then'](handleEntityNotFound(_0x127d47,null))[_0x4402('0x24')](function(_0x39ccc9){if(_0x39ccc9){return _0x39ccc9[_0x4402('0x6e')](_0x5ce15c[_0x4402('0x4d')][_0x4402('0x6f')],_[_0x4402('0x70')](_0x5ce15c[_0x4402('0x4d')],[_0x4402('0x6f'),'id'])||{})[_0x4402('0x71')](function(_0x5054f9){for(var _0x44d806=0x0;_0x44d806<_0x5ce15c[_0x4402('0x4d')][_0x4402('0x6f')][_0x4402('0x38')];_0x44d806+=0x1){socket[_0x4402('0x72')](_0x4402('0x73'),{'UserId':Number(_0x5ce15c[_0x4402('0x4d')][_0x4402('0x6f')][_0x44d806]),'VoicePrefixId':Number(_0x5ce15c[_0x4402('0x47')]['id'])});}return _0x5054f9;});}})['then'](respondWithResult(_0x127d47,null))[_0x4402('0x49')](handleError(_0x127d47,null));};exports[_0x4402('0x74')]=function(_0x2eae1c,_0x4c4845,_0xb5f21c){return db['VoicePrefix'][_0x4402('0x48')]({'where':{'id':_0x2eae1c['params']['id']}})[_0x4402('0x24')](handleEntityNotFound(_0x4c4845,null))[_0x4402('0x24')](function(_0x552962){if(_0x552962){return _0x552962[_0x4402('0x74')](_0x2eae1c['query'][_0x4402('0x6f')])[_0x4402('0x24')](function(){if(_['isArray'](_0x2eae1c[_0x4402('0x34')][_0x4402('0x6f')])){for(var _0x50f5ed=0x0;_0x50f5ed<_0x2eae1c[_0x4402('0x34')][_0x4402('0x6f')]['length'];_0x50f5ed+=0x1){socket[_0x4402('0x72')](_0x4402('0x75'),{'UserId':Number(_0x2eae1c[_0x4402('0x34')][_0x4402('0x6f')][_0x50f5ed]),'VoicePrefixId':Number(_0x2eae1c[_0x4402('0x47')]['id'])});}}else{socket[_0x4402('0x72')](_0x4402('0x75'),{'UserId':Number(_0x2eae1c[_0x4402('0x34')][_0x4402('0x6f')]),'VoicePrefixId':Number(_0x2eae1c[_0x4402('0x47')]['id'])});}});}})[_0x4402('0x24')](respondWithStatusCode(_0x4c4845,null))[_0x4402('0x49')](handleError(_0x4c4845,null));};exports[_0x4402('0x76')]=function(_0x2dd4b7,_0x5359ec,_0x1bc518){var _0xc3914e={};var _0x4b9ac8={};var _0x3f70a3;var _0x4eb578;return db[_0x4402('0x2d')][_0x4402('0x77')]({'where':{'id':_0x2dd4b7[_0x4402('0x47')]['id']}})['then'](handleEntityNotFound(_0x5359ec,null))[_0x4402('0x24')](function(_0x26fc3a){if(_0x26fc3a){_0x3f70a3=_0x26fc3a;_0x4b9ac8[_0x4402('0x31')]=_['keys'](db[_0x4402('0x78')][_0x4402('0x2e')]);_0x4b9ac8[_0x4402('0x34')]=_[_0x4402('0x33')](_0x2dd4b7['query']);_0x4b9ac8[_0x4402('0x3c')]=_[_0x4402('0x35')](_0x4b9ac8[_0x4402('0x31')],_0x4b9ac8[_0x4402('0x34')]);_0xc3914e[_0x4402('0x36')]=_[_0x4402('0x35')](_0x4b9ac8[_0x4402('0x31')],qs[_0x4402('0x37')](_0x2dd4b7[_0x4402('0x34')][_0x4402('0x37')]));_0xc3914e[_0x4402('0x36')]=_0xc3914e[_0x4402('0x36')][_0x4402('0x38')]?_0xc3914e['attributes']:_0x4b9ac8[_0x4402('0x31')];_0xc3914e[_0x4402('0x3a')]=qs[_0x4402('0x3b')](_0x2dd4b7[_0x4402('0x34')]['sort']);_0xc3914e['where']=qs[_0x4402('0x3c')](_[_0x4402('0x3d')](_0x2dd4b7[_0x4402('0x34')],_0x4b9ac8[_0x4402('0x3c')]));if(_0x2dd4b7['query'][_0x4402('0x41')]){_0xc3914e[_0x4402('0x3e')]=_['merge'](_0xc3914e[_0x4402('0x3e')],{'$or':_[_0x4402('0x32')](_0xc3914e[_0x4402('0x36')],function(_0x1271eb){var _0x297884={};_0x297884[_0x1271eb]={'$like':'%'+_0x2dd4b7['query'][_0x4402('0x41')]+'%'};return _0x297884;})});}_0xc3914e=_[_0x4402('0x3f')]({},_0xc3914e,_0x2dd4b7[_0x4402('0x79')]);return _0x3f70a3[_0x4402('0x76')](_0xc3914e);}})[_0x4402('0x24')](function(_0x1a2822){if(_0x1a2822){_0x4eb578=_0x1a2822[_0x4402('0x38')];if(!_0x2dd4b7['query'][_0x4402('0x39')](_0x4402('0x7a'))){_0xc3914e[_0x4402('0x1d')]=qs[_0x4402('0x1d')](_0x2dd4b7[_0x4402('0x34')]['limit']);_0xc3914e[_0x4402('0x1f')]=qs[_0x4402('0x1f')](_0x2dd4b7['query'][_0x4402('0x1f')]);}return _0x3f70a3['getAgents'](_0xc3914e);}})['then'](function(_0x364a26){if(_0x364a26){return _0x364a26?{'count':_0x4eb578,'rows':_0x364a26}:null;}})['then'](respondWithResult(_0x5359ec,null))[_0x4402('0x49')](handleError(_0x5359ec,null));};exports['getTeams']=function(_0x51e85d,_0x16af14,_0x7adf6d){var _0x43c796={};var _0x1f1222={};var _0x24bfa6;var _0x32b047;return db['VoicePrefix'][_0x4402('0x77')]({'where':{'id':_0x51e85d[_0x4402('0x47')]['id']}})['then'](handleEntityNotFound(_0x16af14,null))[_0x4402('0x24')](function(_0x48940e){if(_0x48940e){_0x24bfa6=_0x48940e;_0x1f1222['model']=_[_0x4402('0x33')](db['Team'][_0x4402('0x2e')]);_0x1f1222[_0x4402('0x34')]=_[_0x4402('0x33')](_0x51e85d[_0x4402('0x34')]);_0x1f1222[_0x4402('0x3c')]=_['intersection'](_0x1f1222['model'],_0x1f1222[_0x4402('0x34')]);_0x43c796[_0x4402('0x36')]=_['intersection'](_0x1f1222[_0x4402('0x31')],qs[_0x4402('0x37')](_0x51e85d[_0x4402('0x34')][_0x4402('0x37')]));_0x43c796[_0x4402('0x36')]=_0x43c796[_0x4402('0x36')]['length']?_0x43c796['attributes']:_0x1f1222[_0x4402('0x31')];_0x43c796[_0x4402('0x3a')]=qs[_0x4402('0x3b')](_0x51e85d[_0x4402('0x34')][_0x4402('0x3b')]);_0x43c796[_0x4402('0x3e')]=qs['filters'](_[_0x4402('0x3d')](_0x51e85d[_0x4402('0x34')],_0x1f1222[_0x4402('0x3c')]));if(_0x51e85d[_0x4402('0x34')][_0x4402('0x41')]){_0x43c796['where']=_[_0x4402('0x3f')](_0x43c796[_0x4402('0x3e')],{'$or':_[_0x4402('0x32')](_0x43c796[_0x4402('0x36')],function(_0x3b89e8){var _0x813e1b={};_0x813e1b[_0x3b89e8]={'$like':'%'+_0x51e85d['query']['filter']+'%'};return _0x813e1b;})});}_0x43c796=_[_0x4402('0x3f')]({},_0x43c796,_0x51e85d['options']);return _0x24bfa6[_0x4402('0x7b')](_0x43c796);}})[_0x4402('0x24')](function(_0x3eb205){if(_0x3eb205){_0x32b047=_0x3eb205[_0x4402('0x38')];if(!_0x51e85d[_0x4402('0x34')][_0x4402('0x39')](_0x4402('0x7a'))){_0x43c796[_0x4402('0x1d')]=qs[_0x4402('0x1d')](_0x51e85d[_0x4402('0x34')][_0x4402('0x1d')]);_0x43c796[_0x4402('0x1f')]=qs[_0x4402('0x1f')](_0x51e85d[_0x4402('0x34')][_0x4402('0x1f')]);}return _0x24bfa6[_0x4402('0x7b')](_0x43c796);}})[_0x4402('0x24')](function(_0x325eeb){if(_0x325eeb){return _0x325eeb?{'count':_0x32b047,'rows':_0x325eeb}:null;}})[_0x4402('0x24')](respondWithResult(_0x16af14,null))[_0x4402('0x49')](handleError(_0x16af14,null));};exports[_0x4402('0x7c')]=function(_0x385b8e,_0x418070,_0x47a76a){var _0xdd829a=_0x385b8e[_0x4402('0x4d')][_0x4402('0x6f')];var _0x2631bc;return db[_0x4402('0x7d')][_0x4402('0x44')]({'where':{'id':_0xdd829a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x4402('0x2a'),_0x4402('0x7e'),_0x4402('0x7f'),'interface'],'raw':!![]}]})['then'](function(_0x54fee3){if(_0x54fee3){_0x2631bc=_0x54fee3;var _0x4f6010=_[_0x4402('0x80')](_0x54fee3,function(_0x179c27){var _0x2a6031=_0x179c27['get']({'plain':!![]});return _0x2a6031[_0x4402('0x81')];});return db[_0x4402('0x2d')][_0x4402('0x48')]({'where':{'id':_0x385b8e['params']['id']}})[_0x4402('0x24')](function(_0x5847b5){return db[_0x4402('0x6c')][_0x4402('0x4c')](function(_0x235d46){return _0x5847b5[_0x4402('0x7c')](_0xdd829a,{'transaction':_0x235d46})[_0x4402('0x24')](function(){return BPromise[_0x4402('0x82')](_0x2631bc,function(_0x4f2686){return db[_0x4402('0x83')][_0x4402('0x84')]({'TeamId':_0x4f2686['id'],'VoicePrefixId':_0x385b8e[_0x4402('0x47')]['id']},{'transaction':_0x235d46});});})['then'](function(){return BPromise[_0x4402('0x82')](_0x4f6010,function(_0x47e8f7){return db[_0x4402('0x85')][_0x4402('0x86')]({'where':{'UserId':_0x47e8f7['id'],'VoicePrefixId':_0x385b8e[_0x4402('0x47')]['id']},'transaction':_0x235d46});});})[_0x4402('0x24')](function(){_0x4f6010['forEach'](function(_0x91c49){socket[_0x4402('0x72')](_0x4402('0x73'),{'UserId':_0x91c49['id'],'VoicePrefixId':_0x5847b5['id']});});});});});}})[_0x4402('0x24')](respondWithStatusCode(_0x418070,null))[_0x4402('0x49')](handleError(_0x418070,null));};exports['removeTeams']=function(_0x8d0746,_0x2dbd34,_0x56f6d3){return db['Team']['findAll']({'where':{'id':_0x8d0746[_0x4402('0x34')][_0x4402('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x4402('0x78')],'as':_0x4402('0x81'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2dbd34,null))[_0x4402('0x24')](function(_0x12130d){var _0x2a2579=_[_0x4402('0x32')](_0x12130d,'id');var _0x4e7189=[];var _0x2a3361=[];var _0x2949ce=squel[_0x4402('0x87')]();_0x2949ce['field']('tq.TeamId')['from'](_0x4402('0x88'),'tq')['join'](_0x4402('0x89'),'ut',_0x4402('0x8a'))[_0x4402('0x3e')](_0x4402('0x8b'),_0x8d0746[_0x4402('0x47')]['id']);for(var _0xd604a5=0x0;_0xd604a5<_0x12130d[_0x4402('0x38')];_0xd604a5+=0x1){let _0x3c442d=_0x12130d[_0xd604a5];for(var _0x14daa4=0x0;_0x14daa4<_0x3c442d[_0x4402('0x81')][_0x4402('0x38')];_0x14daa4+=0x1){let _0x329b60=_0x3c442d[_0x4402('0x81')][_0x14daa4];var _0x368b2c=_0x2949ce['clone']();_0x368b2c[_0x4402('0x3e')](_0x4402('0x8c'),_0x329b60['id']);_0x2a3361['push'](db['sequelize']['query'](_0x368b2c[_0x4402('0x8d')](),{'type':db['sequelize']['QueryTypes'][_0x4402('0x8e')]})[_0x4402('0x24')](function(_0x594366){if(_0x594366[_0x4402('0x38')]===0x1){return _0x329b60['id'];}else{var _0xe86dc6=_[_0x4402('0x8f')](_[_0x4402('0x32')](_0x594366,'TeamId'),function(_0x386377){return _[_0x4402('0x90')](_0x2a2579,_0x386377);});if(_0xe86dc6){return _0x329b60['id'];}}}));}}return BPromise[_0x4402('0x91')](_0x2a3361)[_0x4402('0x24')](function(_0x453838){_0x4e7189=_(_0x4e7189)[_0x4402('0x92')](_0x453838)[_0x4402('0x93')]()[_0x4402('0x94')]();return db[_0x4402('0x2d')]['find']({'where':{'id':_0x8d0746[_0x4402('0x47')]['id']}})[_0x4402('0x24')](function(_0x290346){return db[_0x4402('0x6c')]['transaction'](function(_0x439026){return _0x290346['removeTeams'](_0x8d0746[_0x4402('0x34')][_0x4402('0x6f')],{'transaction':_0x439026})['then'](function(){if(!_['isEmpty'](_0x4e7189)){return _0x290346[_0x4402('0x74')](_0x4e7189,{'transaction':_0x439026});}})[_0x4402('0x24')](function(){_0x4e7189[_0x4402('0x95')](function(_0x759c30){socket[_0x4402('0x72')](_0x4402('0x75'),{'UserId':_0x759c30,'VoicePrefixId':_0x290346['id']});});});});});});})['then'](respondWithStatusCode(_0x2dbd34,null))['catch'](handleError(_0x2dbd34,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 103c4b2..41e9f65 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 _0x1d8a=['events','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1d8a,0x117));var _0xa1d8=function(_0x590a94,_0x61e61){_0x590a94=_0x590a94-0x0;var _0x865e8=_0x1d8a[_0x590a94];return _0x865e8;};'use strict';var EventEmitter=require(_0xa1d8('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xa1d8('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa1d8('0x2')](0x0);var events={'afterCreate':_0xa1d8('0x3'),'afterUpdate':_0xa1d8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x550ea7){return function(_0x3ca371,_0x3a3251,_0x214dd0){VoicePrefixEvents[_0xa1d8('0x5')](_0x550ea7+':'+_0x3ca371['id'],_0x3ca371);VoicePrefixEvents[_0xa1d8('0x5')](_0x550ea7,_0x3ca371);_0x214dd0(null);};}for(var e in events){if(events[_0xa1d8('0x6')](e)){var event=events[e];VoicePrefix[_0xa1d8('0x7')](e,emitEvent(event));}}module[_0xa1d8('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x6d10=['../../mysqldb','VoicePrefix','setMaxListeners','save','emit','exports','events'];(function(_0x39a2d6,_0x1e5c59){var _0x1b3431=function(_0x271637){while(--_0x271637){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x1b3431(++_0x1e5c59);}(_0x6d10,0xd1));var _0x06d1=function(_0x55032c,_0x7a81fa){_0x55032c=_0x55032c-0x0;var _0x4ec5ff=_0x6d10[_0x55032c];return _0x4ec5ff;};'use strict';var EventEmitter=require(_0x06d1('0x0'));var VoicePrefix=require(_0x06d1('0x1'))['db'][_0x06d1('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x06d1('0x3')](0x0);var events={'afterCreate':_0x06d1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x426f52){return function(_0x4039f9,_0x41b3ae,_0x319506){VoicePrefixEvents['emit'](_0x426f52+':'+_0x4039f9['id'],_0x4039f9);VoicePrefixEvents[_0x06d1('0x5')](_0x426f52,_0x4039f9);_0x319506(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x06d1('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 a19cff7..7b3db94 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 _0x61bc=['voice_prefixes','lodash','util','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoicePrefix'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x61bc,0x1d7));var _0xc61b=function(_0x4a00a8,_0x487794){_0x4a00a8=_0x4a00a8-0x0;var _0x5d46d3=_0x61bc[_0x4a00a8];return _0x5d46d3;};'use strict';var _=require(_0xc61b('0x0'));var util=require(_0xc61b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc61b('0x2'));var rp=require(_0xc61b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc61b('0x4'));var config=require(_0xc61b('0x5'));var attributes=require('./voicePrefix.attributes');module[_0xc61b('0x6')]=function(_0x48797c,_0x184dc3){return _0x48797c[_0xc61b('0x7')](_0xc61b('0x8'),attributes,{'tableName':_0xc61b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x368c=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x368c,0x8d));var _0xc368=function(_0xbd5c0e,_0x247bab){_0xbd5c0e=_0xbd5c0e-0x0;var _0x38aa62=_0x368c[_0xbd5c0e];return _0x38aa62;};'use strict';var _=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var logger=require(_0xc368('0x2'))('api');var moment=require(_0xc368('0x3'));var BPromise=require(_0xc368('0x4'));var rp=require(_0xc368('0x5'));var fs=require('fs');var path=require(_0xc368('0x6'));var rimraf=require('rimraf');var config=require(_0xc368('0x7'));var attributes=require(_0xc368('0x8'));module[_0xc368('0x9')]=function(_0x4bd0ae,_0xddea8b){return _0x4bd0ae[_0xc368('0xa')](_0xc368('0xb'),attributes,{'tableName':_0xc368('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 debff99..2562a21 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 _0x62f1=['register','request','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x518d6a,_0x5a0164){var _0x58446b=function(_0x4c4ab6){while(--_0x4c4ab6){_0x518d6a['push'](_0x518d6a['shift']());}};_0x58446b(++_0x5a0164);}(_0x62f1,0x112));var _0x162f=function(_0x332d5c,_0x4a2336){_0x332d5c=_0x332d5c-0x0;var _0x47448d=_0x62f1[_0x332d5c];return _0x47448d;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var moment=require(_0x162f('0x1'));var BPromise=require(_0x162f('0x2'));var rs=require(_0x162f('0x3'));var fs=require('fs');var Redis=require(_0x162f('0x4'));var db=require(_0x162f('0x5'))['db'];var utils=require(_0x162f('0x6'));var logger=require(_0x162f('0x7'))(_0x162f('0x8'));var config=require(_0x162f('0x9'));var jayson=require(_0x162f('0xa'));var client=jayson['client'][_0x162f('0xb')]({'port':0x232a});config[_0x162f('0xc')]=_['defaults'](config[_0x162f('0xc')],{'host':_0x162f('0xd'),'port':0x18eb});var socket=require(_0x162f('0xe'))(new Redis(config['redis']));require(_0x162f('0xf'))[_0x162f('0x10')](socket);function respondWithRpcPromise(_0x16938e,_0x2107d1,_0x54c970){return new BPromise(function(_0x1eeef3,_0x14aaa6){return client[_0x162f('0x11')](_0x16938e,_0x54c970)['then'](function(_0x577238){logger['info'](_0x162f('0x12'),_0x2107d1,'request\x20sent');logger[_0x162f('0x13')](_0x162f('0x14'),_0x2107d1,_0x162f('0x15'),JSON[_0x162f('0x16')](_0x577238));if(_0x577238['error']){if(_0x577238[_0x162f('0x17')][_0x162f('0x18')]===0x1f4){logger[_0x162f('0x17')](_0x162f('0x12'),_0x2107d1,_0x577238['error'][_0x162f('0x19')]);return _0x14aaa6(_0x577238['error'][_0x162f('0x19')]);}logger[_0x162f('0x17')](_0x162f('0x12'),_0x2107d1,_0x577238[_0x162f('0x17')]['message']);return _0x1eeef3(_0x577238['error'][_0x162f('0x19')]);}else{logger[_0x162f('0x1a')](_0x162f('0x12'),_0x2107d1,_0x162f('0x15'));_0x1eeef3(_0x577238[_0x162f('0x1b')][_0x162f('0x19')]);}})[_0x162f('0x1c')](function(_0x5723f3){logger[_0x162f('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2107d1,_0x5723f3);_0x14aaa6(_0x5723f3);});});} \ No newline at end of file +var _0x63a6=['../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x63a6,0x1c7));var _0x663a=function(_0x343dab,_0x134185){_0x343dab=_0x343dab-0x0;var _0xa7e52d=_0x63a6[_0x343dab];return _0xa7e52d;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var moment=require(_0x663a('0x1'));var BPromise=require('bluebird');var rs=require(_0x663a('0x2'));var fs=require('fs');var Redis=require(_0x663a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x663a('0x4'));var logger=require(_0x663a('0x5'))(_0x663a('0x6'));var config=require(_0x663a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x663a('0x8')]=_[_0x663a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x663a('0xa'))(new Redis(config[_0x663a('0x8')]));require(_0x663a('0xb'))['register'](socket);function respondWithRpcPromise(_0x57b9f6,_0x19513c,_0x7495bc){return new BPromise(function(_0xf05b3e,_0x38ca44){return client[_0x663a('0xc')](_0x57b9f6,_0x7495bc)[_0x663a('0xd')](function(_0x479dab){logger[_0x663a('0xe')](_0x663a('0xf'),_0x19513c,_0x663a('0x10'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x19513c,_0x663a('0x10'),JSON['stringify'](_0x479dab));if(_0x479dab['error']){if(_0x479dab[_0x663a('0x11')][_0x663a('0x12')]===0x1f4){logger['error'](_0x663a('0xf'),_0x19513c,_0x479dab['error'][_0x663a('0x13')]);return _0x38ca44(_0x479dab[_0x663a('0x11')][_0x663a('0x13')]);}logger[_0x663a('0x11')](_0x663a('0xf'),_0x19513c,_0x479dab['error'][_0x663a('0x13')]);return _0xf05b3e(_0x479dab['error'][_0x663a('0x13')]);}else{logger[_0x663a('0xe')](_0x663a('0xf'),_0x19513c,_0x663a('0x10'));_0xf05b3e(_0x479dab['result'][_0x663a('0x13')]);}})['catch'](function(_0x51f325){logger['error'](_0x663a('0xf'),_0x19513c,_0x51f325);_0x38ca44(_0x51f325);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d0205bf..fbb50da 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 _0x31c2=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','update'];(function(_0x41a4bb,_0x36b115){var _0x4d4239=function(_0x572b5c){while(--_0x572b5c){_0x41a4bb['push'](_0x41a4bb['shift']());}};_0x4d4239(++_0x36b115);}(_0x31c2,0x98));var _0x231c=function(_0x2c2b51,_0x570fb8){_0x2c2b51=_0x2c2b51-0x0;var _0x5a8220=_0x31c2[_0x2c2b51];return _0x5a8220;};'use strict';var VoicePrefixEvents=require(_0x231c('0x0'));var events=['save','remove',_0x231c('0x1')];function createListener(_0x1426bb,_0x4bcfa6){return function(_0x2f0b2c){_0x4bcfa6[_0x231c('0x2')](_0x1426bb,_0x2f0b2c);};}function removeListener(_0x396f04,_0xe1bfea){return function(){VoicePrefixEvents[_0x231c('0x3')](_0x396f04,_0xe1bfea);};}exports[_0x231c('0x4')]=function(_0x21b4df){for(var _0x4442b9=0x0,_0x5afc76=events[_0x231c('0x5')];_0x4442b9<_0x5afc76;_0x4442b9++){var _0x4fd8b8=events[_0x4442b9];var _0x3dfccb=createListener(_0x231c('0x6')+_0x4fd8b8,_0x21b4df);VoicePrefixEvents['on'](_0x4fd8b8,_0x3dfccb);}}; \ No newline at end of file +var _0xcab6=['length','voicePrefix:','./voicePrefix.events','remove','update','emit','register'];(function(_0xd5861,_0x3ca9b6){var _0x3576bf=function(_0x51c110){while(--_0x51c110){_0xd5861['push'](_0xd5861['shift']());}};_0x3576bf(++_0x3ca9b6);}(_0xcab6,0xd4));var _0x6cab=function(_0x408aa9,_0xab340){_0x408aa9=_0x408aa9-0x0;var _0x861fe5=_0xcab6[_0x408aa9];return _0x861fe5;};'use strict';var VoicePrefixEvents=require(_0x6cab('0x0'));var events=['save',_0x6cab('0x1'),_0x6cab('0x2')];function createListener(_0x1ff0cd,_0x1b8153){return function(_0xae3b53){_0x1b8153[_0x6cab('0x3')](_0x1ff0cd,_0xae3b53);};}function removeListener(_0x5ea2d8,_0xa8b534){return function(){VoicePrefixEvents['removeListener'](_0x5ea2d8,_0xa8b534);};}exports[_0x6cab('0x4')]=function(_0x1953cd){for(var _0x13464a=0x0,_0x53e159=events[_0x6cab('0x5')];_0x13464a<_0x53e159;_0x13464a++){var _0x229e5a=events[_0x13464a];var _0x230f8b=createListener(_0x6cab('0x6')+_0x229e5a,_0x1953cd);VoicePrefixEvents['on'](_0x229e5a,_0x230f8b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f7d4af2..36ef9b8 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x537239,_0xb22eac){var _0xf787ce=function(_0x3021f6){while(--_0x3021f6){_0x537239['push'](_0x537239['shift']());}};_0xf787ce(++_0xb22eac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x59dd0c,_0xd55cb){var _0x18b934=function(_0x436a31){while(--_0x436a31){_0x59dd0c['push'](_0x59dd0c['shift']());}};_0x18b934(++_0xd55cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 6b94c97..e4c8ffe 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 _0x8e7d=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xb6662c,_0x24a09d){var _0x199011=function(_0x246583){while(--_0x246583){_0xb6662c['push'](_0xb6662c['shift']());}};_0x199011(++_0x24a09d);}(_0x8e7d,0xa6));var _0xd8e7=function(_0x354afe,_0x2a46aa){_0x354afe=_0x354afe-0x0;var _0x21442f=_0x8e7d[_0x354afe];return _0x21442f;};'use strict';var Sequelize=require(_0xd8e7('0x0'));module[_0xd8e7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd8e7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x4'),_0xd8e7('0x5')),'allowNull':![],'defaultValue':_0xd8e7('0x4')},'musiconhold':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd8e7('0x3')]('rr',_0xd8e7('0x7'),_0xd8e7('0x8'),_0xd8e7('0x9'),_0xd8e7('0xa'),'rrmemory',_0xd8e7('0xb'),_0xd8e7('0xc'),_0xd8e7('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x24f00c){this[_0xd8e7('0xe')](_0xd8e7('0xf'),_0x24f00c?_0x24f00c:_0xd8e7('0x10'));},'get':function(){var _0x2b373a=this[_0xd8e7('0x11')](_0xd8e7('0x12'));var _0x991024=this['getDataValue'](_0xd8e7('0x13'));var _0x59f086=this[_0xd8e7('0x11')]('strategy');if(_0x2b373a===_0xd8e7('0x4')){return _0x59f086;}if(_0x991024==='booked'&&_0x59f086===_0xd8e7('0x10')||_0x991024===_0xd8e7('0x14')&&_0x59f086===_0xd8e7('0x15')){return _0x59f086;}if(_0x991024===_0xd8e7('0x16')||_0x991024===_0xd8e7('0x17')||_0x991024===_0xd8e7('0x18')){return _0x59f086;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd8e7('0x6')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no',_0xd8e7('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd8e7('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd8e7('0x3')]('yes','no'),'defaultValue':_0xd8e7('0x1a')},'announce_holdtime':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xd8e7('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0xd8e7('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd8e7('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd8e7('0x6')]},'queue_youarenext':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd8e7('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd8e7('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xd8e7('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xd8e7('0x6')]},'queue_less_than':{'type':Sequelize[_0xd8e7('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x358b35){this[_0xd8e7('0xe')](_0xd8e7('0x1c'),_0x358b35?_0x358b35[_0xd8e7('0x1d')](','):[]);},'get':function(){return this[_0xd8e7('0x11')](_0xd8e7('0x1c'))?this['getDataValue'](_0xd8e7('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xd8e7('0x1a'),'set':function(_0x22ea38){this[_0xd8e7('0xe')](_0xd8e7('0x1e'),_0x22ea38?_0x22ea38[_0xd8e7('0x1d')](','):undefined);},'get':function(){return this[_0xd8e7('0x11')](_0xd8e7('0x1e'))?this[_0xd8e7('0x11')]('joinempty')[_0xd8e7('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x45a10d){this[_0xd8e7('0xe')](_0xd8e7('0x20'),_0x45a10d?_0x45a10d[_0xd8e7('0x1d')](','):undefined);},'get':function(){return this[_0xd8e7('0x11')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0xd8e7('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd8e7('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd8e7('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':0x0,'set':function(_0x32b3b5){this[_0xd8e7('0xe')](_0xd8e7('0x22'),_0x32b3b5);if(_0x32b3b5){if(this['getDataValue'](_0xd8e7('0x23'))<0x2){this[_0xd8e7('0xe')](_0xd8e7('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd8e7('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e7('0x24')},'dialMethod':{'type':Sequelize['ENUM'](_0xd8e7('0x25'),'progressive','power',_0xd8e7('0x17'),_0xd8e7('0x14')),'defaultValue':_0xd8e7('0x16'),'comment':_0xd8e7('0x26')},'dialLimitChannel':{'type':Sequelize[_0xd8e7('0x19')](0x4)[_0xd8e7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd8e7('0x28')},'dialLimitQueue':{'type':Sequelize[_0xd8e7('0x19')](0x4)[_0xd8e7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xd8e7('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd8e7('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xd8e7('0x3')](_0xd8e7('0x2b'),_0xd8e7('0x2c')),'defaultValue':'dropRate','comment':_0xd8e7('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd8e7('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd8e7('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xd8e7('0x19')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd8e7('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd8e7('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd8e7('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x30')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xd8e7('0x31'),'comment':_0xd8e7('0x32')},'dialQueueTimeout':{'type':Sequelize[_0xd8e7('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x33')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xd8e7('0x34')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x35')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x36')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x37')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x38')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x3,'comment':_0xd8e7('0x39')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x3a')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':_0xd8e7('0x3b')},'dialPrefix':{'type':Sequelize[_0xd8e7('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd8e7('0x3')]('always',_0xd8e7('0x3c'),'onlyIfOpen'),'defaultValue':_0xd8e7('0x3d')},'dialAMDActive':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd8e7('0x19')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8e7('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0xd8e7('0x19')](0x9)[_0xd8e7('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd8e7('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd8e7('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd8e7('0x19')](0x9)[_0xd8e7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e7('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0xd8e7('0x19')](0x9)[_0xd8e7('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd8e7('0x19')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8e7('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8e7('0x19')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd8e7('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8e7('0x19')](0x5)[_0xd8e7('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd8e7('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8e7('0x19')](0x9)[_0xd8e7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd8e7('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':0x0,'comment':_0xd8e7('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8e7('0x3')]('DESC','ASC'),'defaultValue':_0xd8e7('0x46')},'dialQueueProject2':{'type':Sequelize[_0xd8e7('0x6')],'comment':_0xd8e7('0x34')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e7('0x47')},'dialCutDigit':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x4c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)[_0xd8e7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e7('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8e7('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e7('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8e7('0x19')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':![],'comment':_0xd8e7('0x50'),'set':function(_0x5d22c4){if(!_0x5d22c4)this[_0xd8e7('0xe')](_0xd8e7('0x51'),null);this[_0xd8e7('0xe')]('mandatoryDisposition',_0x5d22c4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd8e7('0x19')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xd8e7('0x19')](0x3)[_0xd8e7('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xd8e7('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0x1c8e=['Active/Disactive\x20Recall\x20In\x20Queue','DESC','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)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize','exports','name','inbound','STRING','default','ringall','leastrecent','random','linear','rrordered','setDataValue','strategy','rrmemory','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)'];(function(_0x319b02,_0x1be26d){var _0x2a5ec4=function(_0x37e477){while(--_0x37e477){_0x319b02['push'](_0x319b02['shift']());}};_0x2a5ec4(++_0x1be26d);}(_0x1c8e,0x109));var _0xe1c8=function(_0x3ce221,_0x22d678){_0x3ce221=_0x3ce221-0x0;var _0x3995b8=_0x1c8e[_0x3ce221];return _0x3995b8;};'use strict';var Sequelize=require(_0xe1c8('0x0'));module[_0xe1c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe1c8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0xe1c8('0x3')},'musiconhold':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':_0xe1c8('0x5')},'announce':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xe1c8('0x6'),_0xe1c8('0x7'),'fewestcalls',_0xe1c8('0x8'),'rrmemory',_0xe1c8('0x9'),'wrandom',_0xe1c8('0xa')),'allowNull':![],'defaultValue':_0xe1c8('0x6'),'set':function(_0x290374){this[_0xe1c8('0xb')](_0xe1c8('0xc'),_0x290374?_0x290374:_0xe1c8('0xd'));},'get':function(){var _0x5d47e5=this[_0xe1c8('0xe')]('type');var _0x487b42=this[_0xe1c8('0xe')](_0xe1c8('0xf'));var _0x22e47c=this[_0xe1c8('0xe')](_0xe1c8('0xc'));if(_0x5d47e5===_0xe1c8('0x3')){return _0x22e47c;}if(_0x487b42===_0xe1c8('0x10')&&_0x22e47c===_0xe1c8('0xd')||_0x487b42===_0xe1c8('0x10')&&_0x22e47c===_0xe1c8('0x11')){return _0x22e47c;}if(_0x487b42===_0xe1c8('0x12')||_0x487b42===_0xe1c8('0x13')||_0x487b42===_0xe1c8('0x14')){return _0x22e47c;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe1c8('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe1c8('0x4')]},'weight':{'type':Sequelize[_0xe1c8('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no',_0xe1c8('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe1c8('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe1c8('0x16')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe1c8('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe1c8('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no'),'defaultValue':_0xe1c8('0x17')},'announce_holdtime':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no',_0xe1c8('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xe1c8('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe1c8('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe1c8('0x4')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe1c8('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe1c8('0x4')]},'queue_quantity1':{'type':Sequelize[_0xe1c8('0x4')]},'queue_quantity2':{'type':Sequelize[_0xe1c8('0x4')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xe1c8('0x4')]},'periodic_announce':{'type':Sequelize[_0xe1c8('0x1a')],'set':function(_0x5d1c84){this[_0xe1c8('0xb')](_0xe1c8('0x1b'),_0x5d1c84?_0x5d1c84[_0xe1c8('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xe1c8('0x1b'))?this[_0xe1c8('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':_0xe1c8('0x17'),'set':function(_0x276560){this[_0xe1c8('0xb')]('joinempty',_0x276560?_0x276560[_0xe1c8('0x1c')](','):undefined);},'get':function(){return this[_0xe1c8('0xe')]('joinempty')?this[_0xe1c8('0xe')]('joinempty')[_0xe1c8('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':'no','set':function(_0x2f9e7a){this[_0xe1c8('0xb')](_0xe1c8('0x1e'),_0x2f9e7a?_0x2f9e7a[_0xe1c8('0x1c')](','):undefined);},'get':function(){return this[_0xe1c8('0xe')](_0xe1c8('0x1e'))?this[_0xe1c8('0xe')](_0xe1c8('0x1e'))[_0xe1c8('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xe1c8('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe1c8('0x16')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe1c8('0x4')]},'description':{'type':Sequelize[_0xe1c8('0x4')]},'acw':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':0x0,'set':function(_0x1fade8){this['setDataValue'](_0xe1c8('0x20'),_0x1fade8);if(_0x1fade8){if(this[_0xe1c8('0xe')](_0xe1c8('0x21'))<0x2){this[_0xe1c8('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe1c8('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':0x0,'comment':_0xe1c8('0x22')},'dialMethod':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x23'),_0xe1c8('0x12'),'power',_0xe1c8('0x13'),_0xe1c8('0x10')),'defaultValue':'progressive','comment':_0xe1c8('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe1c8('0x15')](0x4)[_0xe1c8('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe1c8('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe1c8('0x27')},'dialPowerLevel':{'type':Sequelize[_0xe1c8('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe1c8('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xe1c8('0x2a'),_0xe1c8('0x2b')),'defaultValue':_0xe1c8('0x2b'),'comment':_0xe1c8('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe1c8('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xe1c8('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe1c8('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe1c8('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe1c8('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xe1c8('0x30'),'comment':_0xe1c8('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)[_0xe1c8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x34')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'comment':_0xe1c8('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe1c8('0x39')},'dialTimezone':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xe1c8('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe1c8('0x16')]('always',_0xe1c8('0x3a'),_0xe1c8('0x3b')),'defaultValue':_0xe1c8('0x3c')},'dialAMDActive':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':0x0,'comment':_0xe1c8('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0xe1c8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe1c8('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe1c8('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe1c8('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe1c8('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0xe1c8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe1c8('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe1c8('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe1c8('0x44')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe1c8('0x15')](0x9)[_0xe1c8('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe1c8('0x45')},'dialRecallMeTimeout':{'type':Sequelize[_0xe1c8('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe1c8('0x46')},'dialRecallInQueue':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':0x0,'comment':_0xe1c8('0x47')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe1c8('0x16')](_0xe1c8('0x48'),_0xe1c8('0x49')),'defaultValue':_0xe1c8('0x48')},'dialQueueProject2':{'type':Sequelize[_0xe1c8('0x4')],'comment':_0xe1c8('0x4a')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe1c8('0x4b')},'dialCutDigit':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe1c8('0x4c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x4d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x4e')},'dialDropMaxRetry':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x4f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe1c8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x50')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)[_0xe1c8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe1c8('0x51')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe1c8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)[_0xe1c8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe1c8('0x52')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe1c8('0x15')](0x5)[_0xe1c8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe1c8('0x15')],'allowNull':!![],'comment':_0xe1c8('0x53')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x566644){if(!_0x566644)this[_0xe1c8('0xb')]('mandatoryDispositionPauseId',null);this[_0xe1c8('0xb')]('mandatoryDisposition',_0x566644);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe1c8('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe1c8('0x15')](0x3)[_0xe1c8('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe1c8('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 3d84aab..ddf144b 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 _0xbdb9=['socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','end','error','index','VoiceQueue','rawAttributes','fieldName','model','keys','filters','intersection','fields','attributes','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','get','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','transaction','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','getMembers','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x58c995,_0x2c05b7){var _0x266cde=function(_0x5a68de){while(--_0x5a68de){_0x58c995['push'](_0x58c995['shift']());}};_0x266cde(++_0x2c05b7);}(_0xbdb9,0xac));var _0x9bdb=function(_0xc72ff1,_0x2f94ce){_0xc72ff1=_0xc72ff1-0x0;var _0x265bbc=_0xbdb9[_0xc72ff1];return _0x265bbc;};'use strict';var emlformat=require(_0x9bdb('0x0'));var rimraf=require(_0x9bdb('0x1'));var zipdir=require(_0x9bdb('0x2'));var jsonpatch=require(_0x9bdb('0x3'));var rp=require(_0x9bdb('0x4'));var moment=require('moment');var BPromise=require(_0x9bdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bdb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bdb('0x7'));var _=require('lodash');var squel=require(_0x9bdb('0x8'));var crypto=require(_0x9bdb('0x9'));var jsforce=require(_0x9bdb('0xa'));var deskjs=require(_0x9bdb('0xb'));var toCsv=require(_0x9bdb('0x6'));var querystring=require(_0x9bdb('0xc'));var Papa=require(_0x9bdb('0xd'));var Redis=require('ioredis');var authService=require(_0x9bdb('0xe'));var qs=require(_0x9bdb('0xf'));var as=require(_0x9bdb('0x10'));var hardwareService=require(_0x9bdb('0x11'));var logger=require(_0x9bdb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9bdb('0x13'));var licenseUtil=require(_0x9bdb('0x14'));var db=require(_0x9bdb('0x15'))['db'];config[_0x9bdb('0x16')]=_[_0x9bdb('0x17')](config[_0x9bdb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bdb('0x18'))(new Redis(config[_0x9bdb('0x16')]));require(_0x9bdb('0x19'))[_0x9bdb('0x1a')](socket);function respondWithStatusCode(_0x17b647,_0x4af695){_0x4af695=_0x4af695||0xcc;return function(_0x1378e0){if(_0x1378e0){return _0x17b647[_0x9bdb('0x1b')](_0x4af695);}return _0x17b647[_0x9bdb('0x1c')](_0x4af695)['end']();};}function respondWithResult(_0x3d759e,_0xfc16a4){_0xfc16a4=_0xfc16a4||0xc8;return function(_0x1cb06d){if(_0x1cb06d){return _0x3d759e[_0x9bdb('0x1c')](_0xfc16a4)[_0x9bdb('0x1d')](_0x1cb06d);}};}function respondWithFilteredResult(_0x13c07b,_0xf5ca10){return function(_0x112d0f){if(_0x112d0f){var _0x1f4e49=typeof _0xf5ca10[_0x9bdb('0x1e')]==='undefined'&&typeof _0xf5ca10[_0x9bdb('0x1f')]===_0x9bdb('0x20');var _0x5204ba=_0x112d0f[_0x9bdb('0x21')];var _0x16a953=_0x1f4e49?0x0:_0xf5ca10[_0x9bdb('0x1e')];var _0x582a46=_0x1f4e49?_0x112d0f[_0x9bdb('0x21')]:_0xf5ca10[_0x9bdb('0x1e')]+_0xf5ca10[_0x9bdb('0x1f')];var _0x4da7a5;if(_0x582a46>=_0x5204ba){_0x582a46=_0x5204ba;_0x4da7a5=0xc8;}else{_0x4da7a5=0xce;}_0x13c07b[_0x9bdb('0x1c')](_0x4da7a5);return _0x13c07b[_0x9bdb('0x22')](_0x9bdb('0x23'),_0x16a953+'-'+_0x582a46+'/'+_0x5204ba)[_0x9bdb('0x1d')](_0x112d0f);}return null;};}function patchUpdates(_0x41a213){return function(_0x310256){try{jsonpatch['apply'](_0x310256,_0x41a213,!![]);}catch(_0x5b5262){return BPromise[_0x9bdb('0x24')](_0x5b5262);}return _0x310256[_0x9bdb('0x25')]();};}function saveUpdates(_0x1bba44,_0x5b84cf){return function(_0x4062a3){if(_0x4062a3){return _0x4062a3[_0x9bdb('0x26')](_0x1bba44)[_0x9bdb('0x27')](function(_0x1725aa){return _0x1725aa;});}return null;};}function removeEntity(_0x561f9f,_0x37a02a){return function(_0x5958c0){if(_0x5958c0){return _0x5958c0[_0x9bdb('0x28')]()[_0x9bdb('0x27')](function(){var _0x369bb3=_0x5958c0['get']({'plain':!![]});var _0x158604=[{'name':_0x9bdb('0x29'),'value':_0x9bdb('0x2a'),'ignore':![]},{'name':_0x9bdb('0x2b'),'value':_0x9bdb('0x2c'),'ignore':![]}];var _0x14fb6a=_(_0x158604)[_0x9bdb('0x2d')](_0x9bdb('0x2e'))[_0x9bdb('0x2f')](_0x9bdb('0x30'))['value']();if(_[_0x9bdb('0x31')](_0x14fb6a,_0x369bb3[_0x9bdb('0x32')])){return;}var _0x15edd5=_[_0x9bdb('0x33')](_0x158604,[_0x9bdb('0x30'),_0x369bb3[_0x9bdb('0x32')]])[_0x9bdb('0x34')];return db['UserProfileResource'][_0x9bdb('0x28')]({'where':{'type':_0x15edd5,'resourceId':_0x369bb3['id']}})['then'](function(){return _0x5958c0;});})[_0x9bdb('0x27')](function(){_0x561f9f[_0x9bdb('0x1c')](0xcc)[_0x9bdb('0x35')]();});}};}function handleEntityNotFound(_0x273316,_0x2fdd9b){return function(_0x46d9a7){if(!_0x46d9a7){_0x273316[_0x9bdb('0x1b')](0x194);}return _0x46d9a7;};}function handleError(_0x5f4d21,_0x31ba33){_0x31ba33=_0x31ba33||0x1f4;return function(_0x1d877c){logger[_0x9bdb('0x36')](_0x1d877c['stack']);if(_0x1d877c['name']){delete _0x1d877c['name'];}_0x5f4d21[_0x9bdb('0x1c')](_0x31ba33)['send'](_0x1d877c);};}exports[_0x9bdb('0x37')]=function(_0x19df51,_0x24f02a){var _0x1d798e={},_0x1a45ef={},_0x29c9f8={'count':0x0,'rows':[]};var _0x1f75ac=_['map'](db[_0x9bdb('0x38')][_0x9bdb('0x39')],function(_0x1c0e56){return{'name':_0x1c0e56[_0x9bdb('0x3a')],'type':_0x1c0e56[_0x9bdb('0x32')]['key']};});_0x1a45ef[_0x9bdb('0x3b')]=_[_0x9bdb('0x2f')](_0x1f75ac,_0x9bdb('0x34'));_0x1a45ef['query']=_[_0x9bdb('0x3c')](_0x19df51['query']);_0x1a45ef[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x1a45ef[_0x9bdb('0x3b')],_0x1a45ef['query']);_0x1d798e['attributes']=_['intersection'](_0x1a45ef[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x19df51['query'][_0x9bdb('0x3f')]));_0x1d798e['attributes']=_0x1d798e[_0x9bdb('0x40')]['length']?_0x1d798e[_0x9bdb('0x40')]:_0x1a45ef[_0x9bdb('0x3b')];if(!_0x19df51[_0x9bdb('0x41')][_0x9bdb('0x42')](_0x9bdb('0x43'))){_0x1d798e[_0x9bdb('0x1f')]=qs['limit'](_0x19df51[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x1d798e['offset']=qs['offset'](_0x19df51[_0x9bdb('0x41')]['offset']);}_0x1d798e[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x19df51['query'][_0x9bdb('0x45')]);_0x1d798e[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_[_0x9bdb('0x47')](_0x19df51[_0x9bdb('0x41')],_0x1a45ef['filters']),_0x1f75ac);if(_0x19df51[_0x9bdb('0x41')]['filter']){_0x1d798e['where']=_[_0x9bdb('0x48')](_0x1d798e['where'],{'$or':_['map'](_0x1f75ac,function(_0xbdf62c){if(_0xbdf62c[_0x9bdb('0x32')]!=='VIRTUAL'){var _0x5c51fd={};_0x5c51fd[_0xbdf62c[_0x9bdb('0x34')]]={'$like':'%'+_0x19df51[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x5c51fd;}})});}_0x1d798e=_[_0x9bdb('0x48')]({},_0x1d798e,_0x19df51[_0x9bdb('0x49')]);var _0xe7fd7f={'where':_0x1d798e[_0x9bdb('0x46')]};return db['VoiceQueue'][_0x9bdb('0x21')](_0xe7fd7f)['then'](function(_0x3f11a2){_0x29c9f8[_0x9bdb('0x21')]=_0x3f11a2;if(_0x19df51[_0x9bdb('0x41')][_0x9bdb('0x4a')]){_0x1d798e[_0x9bdb('0x4b')]=[{'all':!![]}];}return db[_0x9bdb('0x38')][_0x9bdb('0x4c')](_0x1d798e);})['then'](function(_0x9b70f0){_0x29c9f8[_0x9bdb('0x4d')]=_0x9b70f0;return _0x29c9f8;})['then'](respondWithFilteredResult(_0x24f02a,_0x1d798e))[_0x9bdb('0x4e')](handleError(_0x24f02a,null));};exports[_0x9bdb('0x4f')]=function(_0x1ca0e5,_0x5314ce){var _0x5ab89e={'raw':![],'where':{'id':_0x1ca0e5[_0x9bdb('0x50')]['id']}},_0x485222={};_0x485222[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db['VoiceQueue'][_0x9bdb('0x39')]);_0x485222[_0x9bdb('0x41')]=_['keys'](_0x1ca0e5['query']);_0x485222[_0x9bdb('0x3d')]=_['intersection'](_0x485222[_0x9bdb('0x3b')],_0x485222[_0x9bdb('0x41')]);_0x5ab89e[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x485222[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x1ca0e5[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x5ab89e['attributes']=_0x5ab89e['attributes']['length']?_0x5ab89e[_0x9bdb('0x40')]:_0x485222[_0x9bdb('0x3b')];if(_0x1ca0e5[_0x9bdb('0x41')][_0x9bdb('0x4a')]){_0x5ab89e[_0x9bdb('0x4b')]=[{'all':!![]}];}_0x5ab89e=_['merge']({},_0x5ab89e,_0x1ca0e5['options']);return db[_0x9bdb('0x38')]['find'](_0x5ab89e)[_0x9bdb('0x27')](handleEntityNotFound(_0x5314ce,null))[_0x9bdb('0x27')](respondWithResult(_0x5314ce,null))[_0x9bdb('0x4e')](handleError(_0x5314ce,null));};exports[_0x9bdb('0x51')]=function(_0xb5d346,_0x2a59bf){return db[_0x9bdb('0x38')][_0x9bdb('0x51')](_0xb5d346['body'],{})[_0x9bdb('0x27')](function(_0xb03fd1){var _0x3629ff=_0xb5d346['user']['get']({'plain':!![]});if(!_0x3629ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3629ff['role']===_0x9bdb('0x52')){var _0x5ab4c5=_0xb03fd1['get']({'plain':!![]});var _0x2d5177=[{'name':_0x9bdb('0x29'),'value':_0x9bdb('0x2a')},{'name':_0x9bdb('0x2b'),'value':_0x9bdb('0x2c')}];var _0x21735b=_['find'](_0x2d5177,['value',_0x5ab4c5[_0x9bdb('0x32')]])['name'];return db[_0x9bdb('0x53')]['find']({'where':{'name':_0x21735b,'userProfileId':_0x3629ff[_0x9bdb('0x54')]},'raw':!![]})['then'](function(_0x21ce33){if(_0x21ce33&&_0x21ce33['autoAssociation']===0x0){return db['UserProfileResource'][_0x9bdb('0x51')]({'name':_0x5ab4c5['name'],'resourceId':_0x5ab4c5['id'],'type':_0x21ce33[_0x9bdb('0x34')],'sectionId':_0x21ce33['id']},{})['then'](function(){return _0xb03fd1;});}else{return _0xb03fd1;}})[_0x9bdb('0x4e')](function(_0x4635c5){logger[_0x9bdb('0x36')](_0x9bdb('0x55'),_0x4635c5);throw _0x4635c5;});}return _0xb03fd1;})[_0x9bdb('0x27')](respondWithResult(_0x2a59bf,0xc9))[_0x9bdb('0x4e')](handleError(_0x2a59bf,null));};exports[_0x9bdb('0x56')]=function(_0x46ab04,_0x20bee1){var _0x33d228={'where':{'id':_0x46ab04[_0x9bdb('0x50')]['id']}},_0x15a2c0={};_0x15a2c0[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0x38')][_0x9bdb('0x39')]);_0x33d228[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x15a2c0[_0x9bdb('0x3b')],qs['fields'](_0x46ab04[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x33d228[_0x9bdb('0x40')]=_0x33d228['attributes'][_0x9bdb('0x57')]?_0x33d228[_0x9bdb('0x40')]:_0x15a2c0[_0x9bdb('0x3b')];if(_0x46ab04['query'][_0x9bdb('0x4a')]){_0x33d228[_0x9bdb('0x4b')]=[{'all':!![]}];}_0x33d228=_[_0x9bdb('0x48')]({},_0x33d228,_0x46ab04[_0x9bdb('0x49')]);return db['VoiceQueue'][_0x9bdb('0x33')](_0x33d228)['then'](handleEntityNotFound(_0x20bee1,null))[_0x9bdb('0x27')](function(_0x5bcc50){if(_0x5bcc50){var _0x3a5720=_0x5bcc50[_0x9bdb('0x58')]({'plain':!![]});_0x3a5720=qs[_0x9bdb('0x59')](_0x3a5720,['id',_0x9bdb('0x5a'),_0x9bdb('0x5b')]);_0x46ab04[_0x9bdb('0x5c')]=_['omit'](_0x46ab04['body'],['id',_0x9bdb('0x5a'),_0x9bdb('0x5b')]);return db[_0x9bdb('0x38')][_0x9bdb('0x51')](_[_0x9bdb('0x48')](_0x3a5720,_0x46ab04[_0x9bdb('0x5c')]),{'include':_0x46ab04[_0x9bdb('0x41')][_0x9bdb('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0xd0b0a3){var _0x452c21=_0x46ab04[_0x9bdb('0x52')][_0x9bdb('0x58')]({'plain':!![]});if(!_0x452c21)throw new Error(_0x9bdb('0x5d'));if(_0x452c21[_0x9bdb('0x5e')]==='user'){var _0x335e4d=_0xd0b0a3[_0x9bdb('0x58')]({'plain':!![]});var _0x176877=[{'name':'VoiceQueues','value':_0x9bdb('0x2a')},{'name':_0x9bdb('0x2b'),'value':_0x9bdb('0x2c')}];var _0x10776b=_[_0x9bdb('0x33')](_0x176877,[_0x9bdb('0x30'),_0x335e4d[_0x9bdb('0x32')]])['name'];return db[_0x9bdb('0x53')][_0x9bdb('0x33')]({'where':{'name':_0x10776b,'userProfileId':_0x452c21[_0x9bdb('0x54')]},'raw':!![]})['then'](function(_0x50a7e1){if(_0x50a7e1&&_0x50a7e1['autoAssociation']===0x0){return db[_0x9bdb('0x5f')][_0x9bdb('0x51')]({'name':_0x335e4d[_0x9bdb('0x34')],'resourceId':_0x335e4d['id'],'type':_0x50a7e1[_0x9bdb('0x34')],'sectionId':_0x50a7e1['id']},{})[_0x9bdb('0x27')](function(){return _0xd0b0a3;});}else{return _0xd0b0a3;}})[_0x9bdb('0x4e')](function(_0x2b8d87){logger[_0x9bdb('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b8d87);throw _0x2b8d87;});}return _0xd0b0a3;});}})[_0x9bdb('0x27')](respondWithResult(_0x20bee1,0xc9))[_0x9bdb('0x4e')](handleError(_0x20bee1,null));};exports[_0x9bdb('0x26')]=function(_0x496c6f,_0x300eb5){if(_0x496c6f[_0x9bdb('0x5c')]['id']){delete _0x496c6f['body']['id'];}return db['VoiceQueue'][_0x9bdb('0x33')]({'where':{'id':_0x496c6f[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x300eb5,null))[_0x9bdb('0x27')](saveUpdates(_0x496c6f['body'],null))[_0x9bdb('0x27')](respondWithResult(_0x300eb5,null))[_0x9bdb('0x4e')](handleError(_0x300eb5,null));};exports[_0x9bdb('0x28')]=function(_0x43804a,_0x13d3cc){return db[_0x9bdb('0x38')][_0x9bdb('0x33')]({'where':{'id':_0x43804a[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x13d3cc,null))['then'](removeEntity(_0x13d3cc,null))[_0x9bdb('0x4e')](handleError(_0x13d3cc,null));};exports[_0x9bdb('0x60')]=function(_0x1c4099,_0x47d341,_0x261d73){var _0x4671cf={'raw':![],'where':{}};var _0x312a2e={};var _0x451d5c={'count':0x0,'rows':[]};return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x1c4099[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x47d341,null))[_0x9bdb('0x27')](function(_0x36093){if(_0x36093){_0x312a2e[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0x62')]['rawAttributes']);_0x312a2e[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x1c4099['query']);_0x312a2e[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x312a2e[_0x9bdb('0x3b')],_0x312a2e[_0x9bdb('0x41')]);_0x4671cf[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x312a2e[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x1c4099[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x4671cf[_0x9bdb('0x40')]=_0x4671cf[_0x9bdb('0x40')][_0x9bdb('0x57')]?_0x4671cf['attributes']:_0x312a2e[_0x9bdb('0x3b')];if(!_0x1c4099[_0x9bdb('0x41')][_0x9bdb('0x42')](_0x9bdb('0x43'))){_0x4671cf['limit']=qs[_0x9bdb('0x1f')](_0x1c4099[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x4671cf['offset']=qs['offset'](_0x1c4099[_0x9bdb('0x41')]['offset']);}_0x4671cf['order']=qs[_0x9bdb('0x45')](_0x1c4099[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x4671cf[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_['pick'](_0x1c4099['query'],_0x312a2e[_0x9bdb('0x3d')]));_0x4671cf[_0x9bdb('0x46')][_0x9bdb('0x63')]=_0x36093['id'];if(_0x1c4099[_0x9bdb('0x41')][_0x9bdb('0x2d')]){_0x4671cf[_0x9bdb('0x46')]=_['merge'](_0x4671cf[_0x9bdb('0x46')],{'$or':_[_0x9bdb('0x2f')](_0x4671cf[_0x9bdb('0x40')],function(_0xbac034){var _0x58d5eb={};_0x58d5eb[_0xbac034]={'$like':'%'+_0x1c4099['query']['filter']+'%'};return _0x58d5eb;})});}_0x4671cf=_[_0x9bdb('0x48')]({},_0x4671cf,_0x1c4099[_0x9bdb('0x49')]);return db[_0x9bdb('0x62')][_0x9bdb('0x21')]({'where':_0x4671cf[_0x9bdb('0x46')]})[_0x9bdb('0x27')](function(_0x23fb8e){_0x451d5c[_0x9bdb('0x21')]=_0x23fb8e;if(_0x1c4099['query'][_0x9bdb('0x4a')]){_0x4671cf['include']=[{'all':!![]}];}return db[_0x9bdb('0x62')]['findAll'](_0x4671cf);})[_0x9bdb('0x27')](function(_0xb5cd21){_0x451d5c[_0x9bdb('0x4d')]=_0xb5cd21;return _0x451d5c;});}})['then'](respondWithFilteredResult(_0x47d341,_0x4671cf))[_0x9bdb('0x4e')](handleError(_0x47d341,null));};exports[_0x9bdb('0x64')]=function(_0x181658,_0x4088a1,_0x5b5a46){var _0x56ff1f={'raw':!![],'where':{}};var _0xaa406d={};var _0xe79042={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9bdb('0x61')]({'where':{'id':_0x181658[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x4088a1,null))[_0x9bdb('0x27')](function(_0x224fa6){if(_0x224fa6){_0xaa406d[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0x65')][_0x9bdb('0x39')]);_0xaa406d[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x181658[_0x9bdb('0x41')]);_0xaa406d[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0xaa406d['model'],_0xaa406d['query']);_0x56ff1f[_0x9bdb('0x40')]=_['intersection'](_0xaa406d['model'],qs['fields'](_0x181658[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x56ff1f[_0x9bdb('0x40')]=_0x56ff1f['attributes'][_0x9bdb('0x57')]?_0x56ff1f['attributes']:_0xaa406d['model'];if(!_0x181658[_0x9bdb('0x41')][_0x9bdb('0x42')]('nolimit')){_0x56ff1f[_0x9bdb('0x1f')]=qs['limit'](_0x181658[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x56ff1f[_0x9bdb('0x1e')]=qs['offset'](_0x181658[_0x9bdb('0x41')][_0x9bdb('0x1e')]);}_0x56ff1f[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x181658[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x56ff1f[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_[_0x9bdb('0x47')](_0x181658['query'],_0xaa406d[_0x9bdb('0x3d')]));_0x56ff1f[_0x9bdb('0x46')]['VoiceQueueId']=_0x224fa6['id'];if(_0x181658['query'][_0x9bdb('0x2d')]){_0x56ff1f[_0x9bdb('0x46')]=_[_0x9bdb('0x48')](_0x56ff1f['where'],{'$or':_[_0x9bdb('0x2f')](_0x56ff1f[_0x9bdb('0x40')],function(_0x58ea72){var _0x1e7a5e={};_0x1e7a5e[_0x58ea72]={'$like':'%'+_0x181658[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x1e7a5e;})});}_0x56ff1f=_[_0x9bdb('0x48')]({},_0x56ff1f,_0x181658[_0x9bdb('0x49')]);return db[_0x9bdb('0x65')][_0x9bdb('0x21')]({'where':_0x56ff1f[_0x9bdb('0x46')]})[_0x9bdb('0x27')](function(_0x67c41d){_0xe79042[_0x9bdb('0x21')]=_0x67c41d;if(_0x181658[_0x9bdb('0x41')][_0x9bdb('0x4a')]){_0x56ff1f[_0x9bdb('0x4b')]=[{'all':!![]}];}return db[_0x9bdb('0x65')][_0x9bdb('0x4c')](_0x56ff1f);})[_0x9bdb('0x27')](function(_0x2d1d7d){_0xe79042['rows']=_0x2d1d7d;return _0xe79042;});}})[_0x9bdb('0x27')](respondWithFilteredResult(_0x4088a1,_0x56ff1f))[_0x9bdb('0x4e')](handleError(_0x4088a1,null));};exports[_0x9bdb('0x66')]=function(_0x399973,_0x1472af,_0x343f72){var _0x421808={'raw':!![],'where':{}};var _0x2dfe1f={};var _0x20c038={'count':0x0,'rows':[]};return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x399973['params']['id']}})['then'](handleEntityNotFound(_0x1472af,null))[_0x9bdb('0x27')](function(_0x3a6a32){if(_0x3a6a32){_0x2dfe1f[_0x9bdb('0x3b')]=_['keys'](db[_0x9bdb('0x67')]['rawAttributes']);_0x2dfe1f[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x399973['query']);_0x2dfe1f['filters']=_[_0x9bdb('0x3e')](_0x2dfe1f['model'],_0x2dfe1f['query']);_0x421808['attributes']=_[_0x9bdb('0x3e')](_0x2dfe1f[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x399973[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x421808[_0x9bdb('0x40')]=_0x421808[_0x9bdb('0x40')][_0x9bdb('0x57')]?_0x421808['attributes']:_0x2dfe1f['model'];if(!_0x399973[_0x9bdb('0x41')][_0x9bdb('0x42')](_0x9bdb('0x43'))){_0x421808['limit']=qs[_0x9bdb('0x1f')](_0x399973[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x421808[_0x9bdb('0x1e')]=qs[_0x9bdb('0x1e')](_0x399973[_0x9bdb('0x41')][_0x9bdb('0x1e')]);}_0x421808[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x399973[_0x9bdb('0x41')]['sort']);_0x421808[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_[_0x9bdb('0x47')](_0x399973['query'],_0x2dfe1f[_0x9bdb('0x3d')]));_0x421808[_0x9bdb('0x46')]['VoiceQueueId']=_0x3a6a32['id'];if(_0x399973[_0x9bdb('0x41')][_0x9bdb('0x2d')]){_0x421808[_0x9bdb('0x46')]=_[_0x9bdb('0x48')](_0x421808[_0x9bdb('0x46')],{'$or':_[_0x9bdb('0x2f')](_0x421808[_0x9bdb('0x40')],function(_0x1558a2){var _0x538808={};_0x538808[_0x1558a2]={'$like':'%'+_0x399973[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x538808;})});}_0x421808=_[_0x9bdb('0x48')]({},_0x421808,_0x399973['options']);return db[_0x9bdb('0x67')][_0x9bdb('0x21')]({'where':_0x421808[_0x9bdb('0x46')]})[_0x9bdb('0x27')](function(_0x4e6338){_0x20c038[_0x9bdb('0x21')]=_0x4e6338;if(_0x399973['query'][_0x9bdb('0x4a')]){_0x421808[_0x9bdb('0x4b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x421808);})['then'](function(_0xf3e933){_0x20c038[_0x9bdb('0x4d')]=_0xf3e933;return _0x20c038;});}})[_0x9bdb('0x27')](respondWithFilteredResult(_0x1472af,_0x421808))[_0x9bdb('0x4e')](handleError(_0x1472af,null));};exports[_0x9bdb('0x68')]=function(_0x53348d,_0x933e4d,_0x2406b4){var _0x5e2482={'raw':!![],'where':{}};var _0x1e3a92={};var _0x306e08={'count':0x0,'rows':[]};return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x53348d[_0x9bdb('0x50')]['id']}})['then'](handleEntityNotFound(_0x933e4d,null))[_0x9bdb('0x27')](function(_0x5d9c14){if(_0x5d9c14){_0x1e3a92[_0x9bdb('0x3b')]=_['keys'](db[_0x9bdb('0x69')]['rawAttributes']);_0x1e3a92[_0x9bdb('0x41')]=_['keys'](_0x53348d['query']);_0x1e3a92['filters']=_[_0x9bdb('0x3e')](_0x1e3a92[_0x9bdb('0x3b')],_0x1e3a92['query']);_0x5e2482['attributes']=_[_0x9bdb('0x3e')](_0x1e3a92[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x53348d['query'][_0x9bdb('0x3f')]));_0x5e2482[_0x9bdb('0x40')]=_0x5e2482[_0x9bdb('0x40')][_0x9bdb('0x57')]?_0x5e2482[_0x9bdb('0x40')]:_0x1e3a92[_0x9bdb('0x3b')];if(!_0x53348d['query']['hasOwnProperty']('nolimit')){_0x5e2482[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x53348d[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x5e2482[_0x9bdb('0x1e')]=qs[_0x9bdb('0x1e')](_0x53348d[_0x9bdb('0x41')]['offset']);}_0x5e2482['order']=qs[_0x9bdb('0x45')](_0x53348d[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x5e2482['where']=qs[_0x9bdb('0x3d')](_[_0x9bdb('0x47')](_0x53348d['query'],_0x1e3a92[_0x9bdb('0x3d')]));_0x5e2482[_0x9bdb('0x46')][_0x9bdb('0x63')]=_0x5d9c14['id'];if(_0x53348d[_0x9bdb('0x41')][_0x9bdb('0x2d')]){_0x5e2482['where']=_[_0x9bdb('0x48')](_0x5e2482['where'],{'$or':_[_0x9bdb('0x2f')](_0x5e2482[_0x9bdb('0x40')],function(_0x178487){var _0x49d629={};_0x49d629[_0x178487]={'$like':'%'+_0x53348d[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x49d629;})});}_0x5e2482=_[_0x9bdb('0x48')]({},_0x5e2482,_0x53348d[_0x9bdb('0x49')]);return db[_0x9bdb('0x69')][_0x9bdb('0x21')]({'where':_0x5e2482[_0x9bdb('0x46')]})['then'](function(_0x244967){_0x306e08[_0x9bdb('0x21')]=_0x244967;if(_0x53348d[_0x9bdb('0x41')][_0x9bdb('0x4a')]){_0x5e2482[_0x9bdb('0x4b')]=[{'all':!![]}];}return db[_0x9bdb('0x69')][_0x9bdb('0x4c')](_0x5e2482);})[_0x9bdb('0x27')](function(_0x8c9faa){_0x306e08[_0x9bdb('0x4d')]=_0x8c9faa;return _0x306e08;});}})['then'](respondWithFilteredResult(_0x933e4d,_0x5e2482))[_0x9bdb('0x4e')](handleError(_0x933e4d,null));};exports[_0x9bdb('0x6a')]=function(_0x2d0a2f,_0x2864b7,_0x51fa7c){var _0x4b0bb8={};var _0x2e1c79={};var _0x5ee421;var _0xc8daee;return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x2d0a2f[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x2864b7,null))[_0x9bdb('0x27')](function(_0x3c207f){if(_0x3c207f){_0x5ee421=_0x3c207f;_0x2e1c79[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db['Team'][_0x9bdb('0x39')]);_0x2e1c79[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x2d0a2f[_0x9bdb('0x41')]);_0x2e1c79[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x2e1c79[_0x9bdb('0x3b')],_0x2e1c79[_0x9bdb('0x41')]);_0x4b0bb8[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x2e1c79[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x2d0a2f['query'][_0x9bdb('0x3f')]));_0x4b0bb8[_0x9bdb('0x40')]=_0x4b0bb8[_0x9bdb('0x40')][_0x9bdb('0x57')]?_0x4b0bb8[_0x9bdb('0x40')]:_0x2e1c79[_0x9bdb('0x3b')];_0x4b0bb8[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x2d0a2f[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x4b0bb8[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_['pick'](_0x2d0a2f[_0x9bdb('0x41')],_0x2e1c79[_0x9bdb('0x3d')]));if(_0x2d0a2f['query'][_0x9bdb('0x2d')]){_0x4b0bb8[_0x9bdb('0x46')]=_[_0x9bdb('0x48')](_0x4b0bb8[_0x9bdb('0x46')],{'$or':_[_0x9bdb('0x2f')](_0x4b0bb8[_0x9bdb('0x40')],function(_0x478693){var _0x225274={};_0x225274[_0x478693]={'$like':'%'+_0x2d0a2f[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x225274;})});}_0x4b0bb8=_[_0x9bdb('0x48')]({},_0x4b0bb8,_0x2d0a2f[_0x9bdb('0x49')]);return _0x5ee421[_0x9bdb('0x6a')](_0x4b0bb8);}})[_0x9bdb('0x27')](function(_0xec8687){if(_0xec8687){_0xc8daee=_0xec8687[_0x9bdb('0x57')];if(!_0x2d0a2f[_0x9bdb('0x41')]['hasOwnProperty'](_0x9bdb('0x43'))){_0x4b0bb8[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x2d0a2f[_0x9bdb('0x41')][_0x9bdb('0x1f')]);_0x4b0bb8['offset']=qs[_0x9bdb('0x1e')](_0x2d0a2f[_0x9bdb('0x41')][_0x9bdb('0x1e')]);}return _0x5ee421['getTeams'](_0x4b0bb8);}})['then'](function(_0x104af2){if(_0x104af2){return _0x104af2?{'count':_0xc8daee,'rows':_0x104af2}:null;}})[_0x9bdb('0x27')](respondWithResult(_0x2864b7,null))[_0x9bdb('0x4e')](handleError(_0x2864b7,null));};exports[_0x9bdb('0x6b')]=function(_0x564f45,_0x215e44,_0xc3f921){var _0xfbc6ef=_0x564f45[_0x9bdb('0x5c')][_0x9bdb('0x6c')];var _0x3c0f42=_['map'](_0xfbc6ef,'id');return db[_0x9bdb('0x6d')][_0x9bdb('0x4c')]({'where':{'id':_0x3c0f42},'attributes':['id'],'include':[{'model':db[_0x9bdb('0x6e')],'as':'Agents','attributes':['id','name',_0x9bdb('0x6f'),_0x9bdb('0x70'),_0x9bdb('0x71')],'raw':!![]}]})[_0x9bdb('0x27')](function(_0x51c073){if(_0x51c073){var _0x554d42=_[_0x9bdb('0x72')](_0x51c073,function(_0x3830d8){var _0x5b6ced=_0x3830d8[_0x9bdb('0x58')]({'plain':!![]});_0x5b6ced[_0x9bdb('0x73')]['forEach'](function(_0xeae96d){_0xeae96d[_0x9bdb('0x74')]=_[_0x9bdb('0x33')](_0xfbc6ef,{'id':_0x5b6ced['id']})[_0x9bdb('0x74')];});return _0x5b6ced[_0x9bdb('0x73')];});return db['VoiceQueue']['find']({'where':{'id':_0x564f45[_0x9bdb('0x50')]['id']}})['then'](function(_0x1a307f){return db[_0x9bdb('0x75')]['transaction'](function(_0x10265d){return _0x1a307f[_0x9bdb('0x6b')](_0x3c0f42,{'transaction':_0x10265d})[_0x9bdb('0x27')](function(){return BPromise[_0x9bdb('0x76')](_0xfbc6ef,function(_0x4603a6){return db[_0x9bdb('0x77')][_0x9bdb('0x78')]({'TeamId':_0x4603a6['id'],'VoiceQueueId':_0x564f45[_0x9bdb('0x50')]['id'],'penalty':_0x4603a6[_0x9bdb('0x74')]},{'transaction':_0x10265d});});})['then'](function(){return BPromise[_0x9bdb('0x76')](_0x554d42,function(_0x36850f){return db[_0x9bdb('0x79')][_0x9bdb('0x7a')]({'where':{'UserId':_0x36850f['id'],'VoiceQueueId':_0x564f45[_0x9bdb('0x50')]['id']},'defaults':{'penalty':_0x36850f[_0x9bdb('0x74')]},'transaction':_0x10265d});});})[_0x9bdb('0x27')](function(){return BPromise['each'](_['filter'](_0x554d42,{'online':!![]}),function(_0x327c59){return db[_0x9bdb('0x7b')][_0x9bdb('0x78')]({'membername':_0x327c59['name'],'UserId':_0x327c59['id'],'queue_name':_0x1a307f[_0x9bdb('0x34')],'VoiceQueueId':_0x1a307f['id'],'interface':_[_0x9bdb('0x7c')](_0x327c59[_0x9bdb('0x71')])?util[_0x9bdb('0x7d')](_0x9bdb('0x7e'),_0x327c59[_0x9bdb('0x34')]):_0x327c59[_0x9bdb('0x71')],'paused':_0x327c59['voicePause']||![],'penalty':_0x327c59[_0x9bdb('0x74')]},{'transaction':_0x10265d});});})[_0x9bdb('0x27')](function(){_0x554d42[_0x9bdb('0x7f')](function(_0x39b3d1){socket[_0x9bdb('0x80')](_0x9bdb('0x81'),{'UserId':_0x39b3d1['id'],'VoiceQueueId':_0x1a307f['id']});});});});});}})['then'](respondWithStatusCode(_0x215e44,null))[_0x9bdb('0x4e')](handleError(_0x215e44,null));};exports['removeTeams']=function(_0x58469a,_0x3a92b7,_0x1462d0){return db[_0x9bdb('0x6d')][_0x9bdb('0x4c')]({'where':{'id':_0x58469a[_0x9bdb('0x41')][_0x9bdb('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9bdb('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9bdb('0x27')](handleEntityNotFound(_0x3a92b7,null))[_0x9bdb('0x27')](function(_0x38294d){var _0x51dc6c=_['map'](_0x38294d,'id');var _0x52e34b=[];var _0x58fbf4=[];var _0x3b454c=squel['select']();_0x3b454c[_0x9bdb('0x83')](_0x9bdb('0x84'))['from'](_0x9bdb('0x85'),'tq')[_0x9bdb('0x86')](_0x9bdb('0x87'),'ut',_0x9bdb('0x88'))['where'](_0x9bdb('0x89'),_0x58469a[_0x9bdb('0x50')]['id']);for(var _0x38c2dc=0x0;_0x38c2dc<_0x38294d[_0x9bdb('0x57')];_0x38c2dc+=0x1){let _0x470eb2=_0x38294d[_0x38c2dc];for(var _0x28f3b1=0x0;_0x28f3b1<_0x470eb2[_0x9bdb('0x73')][_0x9bdb('0x57')];_0x28f3b1+=0x1){let _0x526c5e=_0x470eb2[_0x9bdb('0x73')][_0x28f3b1];var _0x331a31=_0x3b454c[_0x9bdb('0x56')]();_0x331a31[_0x9bdb('0x46')](_0x9bdb('0x8a'),_0x526c5e['id']);_0x58fbf4[_0x9bdb('0x8b')](db['sequelize'][_0x9bdb('0x41')](_0x331a31['toString'](),{'type':db[_0x9bdb('0x75')][_0x9bdb('0x8c')][_0x9bdb('0x8d')]})[_0x9bdb('0x27')](function(_0x2fea7a){if(_0x2fea7a[_0x9bdb('0x57')]===0x1){return _0x526c5e['id'];}else{var _0x5594c8=_[_0x9bdb('0x8e')](_['map'](_0x2fea7a,'TeamId'),function(_0x5d354f){return _[_0x9bdb('0x31')](_0x51dc6c,_0x5d354f);});if(_0x5594c8){return _0x526c5e['id'];}}}));}}return BPromise[_0x9bdb('0x8f')](_0x58fbf4)[_0x9bdb('0x27')](function(_0x28b5f2){_0x52e34b=_(_0x52e34b)[_0x9bdb('0x90')](_0x28b5f2)[_0x9bdb('0x91')]()[_0x9bdb('0x30')]();return db[_0x9bdb('0x38')][_0x9bdb('0x33')]({'where':{'id':_0x58469a[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](function(_0x15374d){return db[_0x9bdb('0x75')][_0x9bdb('0x92')](function(_0x2b9275){return _0x15374d[_0x9bdb('0x93')](_0x58469a['query'][_0x9bdb('0x82')],{'transaction':_0x2b9275})[_0x9bdb('0x27')](function(){if(!_[_0x9bdb('0x94')](_0x52e34b)){return _0x15374d['removeAgents'](_0x52e34b,{'transaction':_0x2b9275})['then'](function(){return db[_0x9bdb('0x7b')][_0x9bdb('0x28')]({'where':{'VoiceQueueId':_0x58469a['params']['id'],'UserId':_0x52e34b},'transaction':_0x2b9275});});}})[_0x9bdb('0x27')](function(){_0x52e34b[_0x9bdb('0x7f')](function(_0x37448e){socket[_0x9bdb('0x80')](_0x9bdb('0x95'),{'UserId':_0x37448e,'VoiceQueueId':_0x15374d['id']});});});});});});})[_0x9bdb('0x27')](respondWithStatusCode(_0x3a92b7,null))[_0x9bdb('0x4e')](handleError(_0x3a92b7,null));};exports[_0x9bdb('0x96')]=function(_0x9bd58d,_0x28b699,_0x161283){var _0xf50367,_0x1d7184;return db['VoiceQueue'][_0x9bdb('0x33')]({'where':{'id':_0x9bd58d[_0x9bdb('0x50')]['id']}})['then'](handleEntityNotFound(_0x28b699,null))[_0x9bdb('0x27')](function(_0xc6596d){if(_0xc6596d){_0x1d7184=_0xc6596d;return _0xc6596d[_0x9bdb('0x96')](_0x9bd58d[_0x9bdb('0x5c')][_0x9bdb('0x82')],_[_0x9bdb('0x59')](_0x9bd58d[_0x9bdb('0x5c')],['ids','id'])||{})[_0x9bdb('0x97')](function(_0x270d32){for(var _0x2d1125=0x0;_0x2d1125<_0x9bd58d[_0x9bdb('0x5c')][_0x9bdb('0x82')]['length'];_0x2d1125+=0x1){socket[_0x9bdb('0x80')]('userVoiceQueue:save',{'UserId':Number(_0x9bd58d['body'][_0x9bdb('0x82')][_0x2d1125]),'VoiceQueueId':Number(_0x9bd58d['params']['id'])});}return _0x270d32;});}})[_0x9bdb('0x27')](function(_0x5593ec){_0xf50367=_0x5593ec||[];if(_0x1d7184){return db[_0x9bdb('0x6e')][_0x9bdb('0x4c')]({'where':{'id':_0x9bd58d['body'][_0x9bdb('0x82')]},'attributes':['id',_0x9bdb('0x34'),_0x9bdb('0x6f'),_0x9bdb('0x70'),_0x9bdb('0x71')],'raw':!![]});}})[_0x9bdb('0x27')](function(_0x28bca6){if(!_[_0x9bdb('0x94')](_0x28bca6)){var _0x2f7e41=[];for(var _0x182e01=0x0;_0x182e01<_0x28bca6[_0x9bdb('0x57')];_0x182e01++){if(_0x28bca6[_0x182e01]['online']){_0x2f7e41[_0x9bdb('0x8b')](db[_0x9bdb('0x7b')][_0x9bdb('0x78')]({'membername':_0x28bca6[_0x182e01][_0x9bdb('0x34')],'UserId':_0x28bca6[_0x182e01]['id'],'queue_name':_0x1d7184[_0x9bdb('0x34')],'VoiceQueueId':_0x1d7184['id'],'interface':_['isNil'](_0x28bca6[_0x182e01][_0x9bdb('0x71')])?util[_0x9bdb('0x7d')](_0x9bdb('0x7e'),_0x28bca6[_0x182e01][_0x9bdb('0x34')]):_0x28bca6[_0x182e01][_0x9bdb('0x71')],'paused':_0x28bca6[_0x182e01][_0x9bdb('0x70')]||![],'penalty':_0x9bd58d[_0x9bdb('0x5c')][_0x9bdb('0x74')]||0x0}));}}return BPromise[_0x9bdb('0x8f')](_0x2f7e41);}})[_0x9bdb('0x27')](function(){return _0xf50367;})[_0x9bdb('0x27')](respondWithResult(_0x28b699,null))[_0x9bdb('0x4e')](handleError(_0x28b699,null));};exports[_0x9bdb('0x98')]=function(_0x5d7617,_0x56c658,_0x1e0f47){return db[_0x9bdb('0x38')][_0x9bdb('0x33')]({'where':{'id':_0x5d7617[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x56c658,null))[_0x9bdb('0x27')](function(_0x1079fb){if(_0x1079fb){return _0x1079fb[_0x9bdb('0x98')](_0x5d7617[_0x9bdb('0x41')][_0x9bdb('0x82')])['then'](function(){if(_[_0x9bdb('0x99')](_0x5d7617[_0x9bdb('0x41')][_0x9bdb('0x82')])){for(var _0x4abe63=0x0;_0x4abe63<_0x5d7617[_0x9bdb('0x41')][_0x9bdb('0x82')][_0x9bdb('0x57')];_0x4abe63+=0x1){socket[_0x9bdb('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0x5d7617[_0x9bdb('0x41')]['ids'][_0x4abe63]),'VoiceQueueId':Number(_0x5d7617[_0x9bdb('0x50')]['id'])});}}else{socket[_0x9bdb('0x80')](_0x9bdb('0x95'),{'UserId':Number(_0x5d7617[_0x9bdb('0x41')]['ids']),'VoiceQueueId':Number(_0x5d7617['params']['id'])});}});}})[_0x9bdb('0x27')](function(_0x3ba468){return db[_0x9bdb('0x7b')][_0x9bdb('0x28')]({'where':{'VoiceQueueId':_0x5d7617[_0x9bdb('0x50')]['id'],'UserId':_0x5d7617[_0x9bdb('0x41')][_0x9bdb('0x82')]}})[_0x9bdb('0x27')](function(){return _0x3ba468;});})['then'](respondWithStatusCode(_0x56c658,null))[_0x9bdb('0x4e')](handleError(_0x56c658,null));};exports[_0x9bdb('0x9a')]=function(_0x4c5fe6,_0x5d63ff,_0xe6fe10){var _0x50ffab={};var _0x5a1f59={};var _0x54f6be;var _0x4c6142;return db['VoiceQueue'][_0x9bdb('0x61')]({'where':{'id':_0x4c5fe6[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x5d63ff,null))[_0x9bdb('0x27')](function(_0x1807c2){if(_0x1807c2){_0x54f6be=_0x1807c2;_0x5a1f59[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0x6e')]['rawAttributes']);_0x5a1f59['query']=_['keys'](_0x4c5fe6['query']);_0x5a1f59['filters']=_[_0x9bdb('0x3e')](_0x5a1f59[_0x9bdb('0x3b')],_0x5a1f59[_0x9bdb('0x41')]);_0x50ffab[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x5a1f59[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x4c5fe6[_0x9bdb('0x41')][_0x9bdb('0x3f')]));_0x50ffab[_0x9bdb('0x40')]=_0x50ffab['attributes']['length']?_0x50ffab[_0x9bdb('0x40')]:_0x5a1f59[_0x9bdb('0x3b')];_0x50ffab[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x4c5fe6[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x50ffab[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_['pick'](_0x4c5fe6[_0x9bdb('0x41')],_0x5a1f59[_0x9bdb('0x3d')]));if(_0x4c5fe6[_0x9bdb('0x41')][_0x9bdb('0x2d')]){_0x50ffab[_0x9bdb('0x46')]=_['merge'](_0x50ffab['where'],{'$or':_['map'](_0x50ffab['attributes'],function(_0x44d8e3){var _0x4b8252={};_0x4b8252[_0x44d8e3]={'$like':'%'+_0x4c5fe6[_0x9bdb('0x41')][_0x9bdb('0x2d')]+'%'};return _0x4b8252;})});}_0x50ffab=_[_0x9bdb('0x48')]({},_0x50ffab,_0x4c5fe6[_0x9bdb('0x49')]);return _0x54f6be[_0x9bdb('0x9a')](_0x50ffab);}})[_0x9bdb('0x27')](function(_0x5a9b1e){if(_0x5a9b1e){_0x4c6142=_0x5a9b1e[_0x9bdb('0x57')];if(!_0x4c5fe6['query'][_0x9bdb('0x42')](_0x9bdb('0x43'))){_0x50ffab[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x4c5fe6[_0x9bdb('0x41')]['limit']);_0x50ffab[_0x9bdb('0x1e')]=qs[_0x9bdb('0x1e')](_0x4c5fe6[_0x9bdb('0x41')][_0x9bdb('0x1e')]);}return _0x54f6be[_0x9bdb('0x9a')](_0x50ffab);}})['then'](function(_0x33699c){if(_0x33699c){return _0x33699c?{'count':_0x4c6142,'rows':_0x33699c}:null;}})[_0x9bdb('0x27')](respondWithResult(_0x5d63ff,null))[_0x9bdb('0x4e')](handleError(_0x5d63ff,null));};exports[_0x9bdb('0x9b')]=function(_0x4f507b,_0x38f7d8,_0x1510a8){var _0x1a583b={};var _0x4a465e={};var _0x2f2009;var _0x4fcd24;return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x4f507b[_0x9bdb('0x50')]['id']}})['then'](handleEntityNotFound(_0x38f7d8,null))[_0x9bdb('0x27')](function(_0x336168){if(_0x336168){_0x2f2009=_0x336168;_0x4a465e[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0x7b')][_0x9bdb('0x39')]);_0x4a465e[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x4f507b[_0x9bdb('0x41')]);_0x4a465e[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x4a465e[_0x9bdb('0x3b')],_0x4a465e['query']);_0x1a583b['attributes']=_['intersection'](_0x4a465e[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x4f507b[_0x9bdb('0x41')]['fields']));_0x1a583b[_0x9bdb('0x40')]=_0x1a583b['attributes'][_0x9bdb('0x57')]?_0x1a583b[_0x9bdb('0x40')]:_0x4a465e['model'];_0x1a583b[_0x9bdb('0x44')]=qs[_0x9bdb('0x45')](_0x4f507b[_0x9bdb('0x41')]['sort']);_0x1a583b['where']=qs[_0x9bdb('0x3d')](_['pick'](_0x4f507b[_0x9bdb('0x41')],_0x4a465e[_0x9bdb('0x3d')]));if(_0x4f507b[_0x9bdb('0x41')]['filter']){_0x1a583b[_0x9bdb('0x46')]=_[_0x9bdb('0x48')](_0x1a583b[_0x9bdb('0x46')],{'$or':_[_0x9bdb('0x2f')](_0x1a583b['attributes'],function(_0x39c75b){var _0x493eee={};_0x493eee[_0x39c75b]={'$like':'%'+_0x4f507b['query'][_0x9bdb('0x2d')]+'%'};return _0x493eee;})});}_0x1a583b=_[_0x9bdb('0x48')]({},_0x1a583b,_0x4f507b['options']);return _0x2f2009['getMembers'](_0x1a583b);}})[_0x9bdb('0x27')](function(_0x5e9abe){if(_0x5e9abe){_0x4fcd24=_0x5e9abe[_0x9bdb('0x57')];if(!_0x4f507b['query'][_0x9bdb('0x42')](_0x9bdb('0x43'))){_0x1a583b[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x4f507b['query']['limit']);_0x1a583b['offset']=qs[_0x9bdb('0x1e')](_0x4f507b[_0x9bdb('0x41')][_0x9bdb('0x1e')]);}return _0x2f2009[_0x9bdb('0x9b')](_0x1a583b);}})[_0x9bdb('0x27')](function(_0x1fc7b0){return _0x1fc7b0?{'count':_0x4fcd24,'rows':_0x1fc7b0}:null;})[_0x9bdb('0x27')](respondWithResult(_0x38f7d8,null))[_0x9bdb('0x4e')](handleError(_0x38f7d8,null));};exports['getLists']=function(_0x547411,_0x36d106,_0x281bca){var _0x29320f={};var _0x128d90={};var _0x4e7034;var _0x4a3c35;return db[_0x9bdb('0x38')][_0x9bdb('0x61')]({'where':{'id':_0x547411[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x36d106,null))['then'](function(_0x4ea361){if(_0x4ea361){_0x4e7034=_0x4ea361;_0x128d90['model']=_[_0x9bdb('0x3c')](db['CmList'][_0x9bdb('0x39')]);_0x128d90[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x547411[_0x9bdb('0x41')]);_0x128d90[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x128d90[_0x9bdb('0x3b')],_0x128d90['query']);_0x29320f[_0x9bdb('0x40')]=_[_0x9bdb('0x3e')](_0x128d90[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x547411[_0x9bdb('0x41')]['fields']));_0x29320f[_0x9bdb('0x40')]=_0x29320f['attributes'][_0x9bdb('0x57')]?_0x29320f[_0x9bdb('0x40')]:_0x128d90[_0x9bdb('0x3b')];_0x29320f[_0x9bdb('0x44')]=qs['sort'](_0x547411[_0x9bdb('0x41')]['sort']);_0x29320f[_0x9bdb('0x46')]=qs[_0x9bdb('0x3d')](_['pick'](_0x547411[_0x9bdb('0x41')],_0x128d90[_0x9bdb('0x3d')]));if(_0x547411[_0x9bdb('0x41')][_0x9bdb('0x2d')]){_0x29320f[_0x9bdb('0x46')]=_['merge'](_0x29320f[_0x9bdb('0x46')],{'$or':_[_0x9bdb('0x2f')](_0x29320f[_0x9bdb('0x40')],function(_0x2c9ff2){var _0x5f547e={};_0x5f547e[_0x2c9ff2]={'$like':'%'+_0x547411['query']['filter']+'%'};return _0x5f547e;})});}_0x29320f=_[_0x9bdb('0x48')]({},_0x29320f,_0x547411[_0x9bdb('0x49')]);return _0x4e7034['getLists'](_0x29320f);}})[_0x9bdb('0x27')](function(_0x249cb8){if(_0x249cb8){_0x4a3c35=_0x249cb8[_0x9bdb('0x57')];if(!_0x547411[_0x9bdb('0x41')][_0x9bdb('0x42')]('nolimit')){_0x29320f[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x547411['query'][_0x9bdb('0x1f')]);_0x29320f[_0x9bdb('0x1e')]=qs[_0x9bdb('0x1e')](_0x547411[_0x9bdb('0x41')]['offset']);}return _0x4e7034['getLists'](_0x29320f);}})[_0x9bdb('0x27')](function(_0x5ba5e9){if(_0x5ba5e9){return _0x5ba5e9?{'count':_0x4a3c35,'rows':_0x5ba5e9}:null;}})['then'](respondWithResult(_0x36d106,null))[_0x9bdb('0x4e')](handleError(_0x36d106,null));};exports[_0x9bdb('0x9c')]=function(_0x3a5c9e,_0xb5f403,_0x34a758){var _0x547c8e=moment()[_0x9bdb('0x7d')](_0x9bdb('0x9d'));var _0x49a290,_0x2f7b79;return db['VoiceQueue']['find']({'where':{'id':_0x3a5c9e[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0xb5f403,null))[_0x9bdb('0x27')](function(_0x43be76){if(_0x43be76){_0x2f7b79=_0x43be76;return _0x43be76[_0x9bdb('0x9c')](_0x3a5c9e[_0x9bdb('0x5c')][_0x9bdb('0x82')],_[_0x9bdb('0x59')](_0x3a5c9e['body'],[_0x9bdb('0x82'),'id'])||{});}return null;})['spread'](function(_0x55d7e3){var _0x3ce5be;_0x49a290=_0x55d7e3||[];var _0x4b9100=[];if(_0x55d7e3){for(var _0x458e78=0x0;_0x458e78<_0x55d7e3[_0x9bdb('0x57')];_0x458e78+=0x1){var _0x44c7f2=_0x55d7e3[_0x458e78][_0x9bdb('0x58')]({'plain':!![]});_0x2f7b79[_0x9bdb('0x9e')]=_0x3a5c9e['body'][_0x9bdb('0x9e')]?_0x3a5c9e[_0x9bdb('0x5c')][_0x9bdb('0x9e')]:_0x2f7b79[_0x9bdb('0x9e')];switch(_0x2f7b79['dialCheckDuplicateType']){case _0x9bdb('0x9f'):_0x3ce5be=squel[_0x9bdb('0xa0')]()[_0x9bdb('0xa1')]('cm_hopper')['fromQuery']([_0x9bdb('0xa2'),_0x9bdb('0xa3'),_0x9bdb('0xa4'),_0x9bdb('0xa5'),'VoiceQueueId',_0x9bdb('0x5a'),_0x9bdb('0x5b')],squel[_0x9bdb('0xa6')]()['field'](_0x9bdb('0xa2'),'phone')[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0xa3'))[_0x9bdb('0x83')]('id','ContactId')[_0x9bdb('0x83')](_0x44c7f2[_0x9bdb('0xa7')][_0x9bdb('0xa8')](),_0x9bdb('0xa5'))[_0x9bdb('0x83')](_0x3a5c9e['params']['id'][_0x9bdb('0xa8')](),'VoiceQueueId')[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27','createdAt')[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0x5b'))[_0x9bdb('0xa9')](_0x9bdb('0xaa'))[_0x9bdb('0x46')](_0x9bdb('0xab'))[_0x9bdb('0x46')](_0x9bdb('0xac'),_0x44c7f2[_0x9bdb('0xa7')][_0x9bdb('0xa8')]())[_0x9bdb('0x46')](_0x9bdb('0xad'))[_0x9bdb('0x46')](_0x9bdb('0xae'),squel[_0x9bdb('0xa6')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x9bdb('0xa9')]('cm_hopper_final')[_0x9bdb('0x46')](_0x9bdb('0x89'),_0x3a5c9e['params']['id']['toString']()))[_0x9bdb('0x46')](_0x9bdb('0xae'),squel[_0x9bdb('0xa6')]()['field'](_0x9bdb('0xaf'))[_0x9bdb('0xa9')](_0x9bdb('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x3a5c9e[_0x9bdb('0x50')]['id']['toString']())))[_0x9bdb('0xa8')]();break;case _0x9bdb('0xb1'):_0x3ce5be=squel[_0x9bdb('0xa0')]()['into'](_0x9bdb('0xb0'))['fromQuery'](['phone',_0x9bdb('0xa3'),'ContactId',_0x9bdb('0xa5'),_0x9bdb('0x63'),_0x9bdb('0x5a'),_0x9bdb('0x5b')],squel[_0x9bdb('0xa6')]()[_0x9bdb('0x83')](_0x9bdb('0xa2'),_0x9bdb('0xa2'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0xa3'))[_0x9bdb('0x83')]('id',_0x9bdb('0xa4'))[_0x9bdb('0x83')](_0x44c7f2[_0x9bdb('0xa7')][_0x9bdb('0xa8')](),_0x9bdb('0xa5'))[_0x9bdb('0x83')](_0x3a5c9e[_0x9bdb('0x50')]['id']['toString'](),_0x9bdb('0x63'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27','createdAt')[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0x5b'))[_0x9bdb('0xa9')]('cm_contacts')['where'](_0x9bdb('0xab'))[_0x9bdb('0x46')](_0x9bdb('0xac'),_0x44c7f2[_0x9bdb('0xa7')]['toString']())[_0x9bdb('0x46')](_0x9bdb('0xad'))[_0x9bdb('0x46')](_0x9bdb('0xae'),squel[_0x9bdb('0xa6')]()['field'](_0x9bdb('0xaf'))['from'](_0x9bdb('0xb0'))[_0x9bdb('0x46')]('VoiceQueueId\x20=\x20?',_0x3a5c9e['params']['id'][_0x9bdb('0xa8')]())))[_0x9bdb('0xa8')]();break;default:_0x3ce5be=squel[_0x9bdb('0xa0')]()[_0x9bdb('0xa1')](_0x9bdb('0xb0'))['fromQuery']([_0x9bdb('0xa2'),_0x9bdb('0xa3'),_0x9bdb('0xa4'),_0x9bdb('0xa5'),_0x9bdb('0x63'),'createdAt',_0x9bdb('0x5b')],squel['select']()['field'](_0x9bdb('0xa2'),_0x9bdb('0xa2'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0xa3'))[_0x9bdb('0x83')]('id','ContactId')['field'](_0x44c7f2['CmListId'][_0x9bdb('0xa8')](),_0x9bdb('0xa5'))[_0x9bdb('0x83')](_0x3a5c9e[_0x9bdb('0x50')]['id'][_0x9bdb('0xa8')](),_0x9bdb('0x63'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27','createdAt')['field']('\x27'+_0x547c8e+'\x27','updatedAt')['from'](_0x9bdb('0xaa'))[_0x9bdb('0x46')](_0x9bdb('0xab'))['where'](_0x9bdb('0xac'),_0x44c7f2[_0x9bdb('0xa7')][_0x9bdb('0xa8')]())[_0x9bdb('0x46')](_0x9bdb('0xad')))[_0x9bdb('0xa8')]();}_0x4b9100[_0x9bdb('0x8b')](db[_0x9bdb('0x75')][_0x9bdb('0x41')](_0x3ce5be));}return BPromise['all'](_0x4b9100);}})[_0x9bdb('0x27')](function(){var _0x3b190=[];var _0x4a419d=squel[_0x9bdb('0xa0')]()[_0x9bdb('0xa1')](_0x9bdb('0xb2'))[_0x9bdb('0xb3')]([_0x9bdb('0xb4'),_0x9bdb('0xa2'),_0x9bdb('0xb5'),'createdAt',_0x9bdb('0x5b')],squel[_0x9bdb('0xa6')]()[_0x9bdb('0x83')](_0x9bdb('0xb6'))[_0x9bdb('0x83')](_0x9bdb('0xb7'))[_0x9bdb('0x83')](_0x9bdb('0xb8'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0x5a'))[_0x9bdb('0x83')]('\x27'+_0x547c8e+'\x27',_0x9bdb('0x5b'))[_0x9bdb('0xa9')](_0x9bdb('0xb9'),'ci')[_0x9bdb('0x86')](_0x9bdb('0xb0'),'h',_0x9bdb('0xba'))[_0x9bdb('0x46')](_0x9bdb('0xbb'),_0x547c8e)[_0x9bdb('0x46')](_0x9bdb('0xbc'),_0x9bdb('0xbd')))['toString']();_0x3b190['push'](db[_0x9bdb('0x75')][_0x9bdb('0x41')](_0x4a419d));return BPromise['all'](_0x3b190);})[_0x9bdb('0x27')](function(){return _0x49a290;})['then'](respondWithResult(_0xb5f403,null))['catch'](handleError(_0xb5f403,null));};exports[_0x9bdb('0xbe')]=function(_0x498f41,_0x25a192,_0x343ed2){return db[_0x9bdb('0x38')][_0x9bdb('0x33')]({'where':{'id':_0x498f41[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x25a192,null))[_0x9bdb('0x27')](function(_0x200370){if(_0x200370){return _0x200370['removeLists'](_0x498f41[_0x9bdb('0x41')][_0x9bdb('0x82')]);}})['then'](function(_0x2d5d8e){if(_0x2d5d8e){return db[_0x9bdb('0x62')][_0x9bdb('0x28')]({'where':{'ListId':_0x498f41[_0x9bdb('0x41')][_0x9bdb('0x82')],'VoiceQueueId':_0x498f41[_0x9bdb('0x50')]['id']}})[_0x9bdb('0x27')](function(){return _0x2d5d8e;});}})[_0x9bdb('0x27')](respondWithStatusCode(_0x25a192,null))['catch'](handleError(_0x25a192,null));};exports[_0x9bdb('0xbf')]=function(_0x2590ae,_0x251494,_0x585077){var _0x3875d1={};var _0x15df7d={};var _0x3898b0;var _0x7fed57;return db[_0x9bdb('0x38')]['findOne']({'where':{'id':_0x2590ae['params']['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x251494,null))[_0x9bdb('0x27')](function(_0x5a8b90){if(_0x5a8b90){_0x3898b0=_0x5a8b90;_0x15df7d[_0x9bdb('0x3b')]=_[_0x9bdb('0x3c')](db[_0x9bdb('0xc0')]['rawAttributes']);_0x15df7d[_0x9bdb('0x41')]=_[_0x9bdb('0x3c')](_0x2590ae[_0x9bdb('0x41')]);_0x15df7d[_0x9bdb('0x3d')]=_[_0x9bdb('0x3e')](_0x15df7d['model'],_0x15df7d['query']);_0x3875d1[_0x9bdb('0x40')]=_['intersection'](_0x15df7d[_0x9bdb('0x3b')],qs[_0x9bdb('0x3f')](_0x2590ae['query'][_0x9bdb('0x3f')]));_0x3875d1['attributes']=_0x3875d1[_0x9bdb('0x40')][_0x9bdb('0x57')]?_0x3875d1[_0x9bdb('0x40')]:_0x15df7d[_0x9bdb('0x3b')];_0x3875d1[_0x9bdb('0x44')]=qs['sort'](_0x2590ae[_0x9bdb('0x41')][_0x9bdb('0x45')]);_0x3875d1[_0x9bdb('0x46')]=qs['filters'](_[_0x9bdb('0x47')](_0x2590ae['query'],_0x15df7d['filters']));if(_0x2590ae[_0x9bdb('0x41')]['filter']){_0x3875d1[_0x9bdb('0x46')]=_[_0x9bdb('0x48')](_0x3875d1[_0x9bdb('0x46')],{'$or':_['map'](_0x3875d1['attributes'],function(_0x46d95c){var _0x350f7b={};_0x350f7b[_0x46d95c]={'$like':'%'+_0x2590ae['query'][_0x9bdb('0x2d')]+'%'};return _0x350f7b;})});}_0x3875d1=_[_0x9bdb('0x48')]({},_0x3875d1,_0x2590ae[_0x9bdb('0x49')]);return _0x3898b0[_0x9bdb('0xbf')](_0x3875d1);}})[_0x9bdb('0x27')](function(_0x2f7dfe){if(_0x2f7dfe){_0x7fed57=_0x2f7dfe[_0x9bdb('0x57')];if(!_0x2590ae[_0x9bdb('0x41')][_0x9bdb('0x42')]('nolimit')){_0x3875d1[_0x9bdb('0x1f')]=qs[_0x9bdb('0x1f')](_0x2590ae['query'][_0x9bdb('0x1f')]);_0x3875d1['offset']=qs[_0x9bdb('0x1e')](_0x2590ae[_0x9bdb('0x41')]['offset']);}return _0x3898b0['getBlackLists'](_0x3875d1);}})['then'](function(_0x26309c){if(_0x26309c){return _0x26309c?{'count':_0x7fed57,'rows':_0x26309c}:null;}})['then'](respondWithResult(_0x251494,null))[_0x9bdb('0x4e')](handleError(_0x251494,null));};exports['addBlackLists']=function(_0x362858,_0x29a7c0,_0x33bbe6){var _0x5d15ea,_0x13c7b0;return db[_0x9bdb('0x38')][_0x9bdb('0x33')]({'where':{'id':_0x362858['params']['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x29a7c0,null))[_0x9bdb('0x27')](function(_0x546b25){if(_0x546b25){_0x13c7b0=_0x546b25;return _0x546b25['addBlackLists'](_0x362858[_0x9bdb('0x5c')][_0x9bdb('0x82')],_[_0x9bdb('0x59')](_0x362858['body'],[_0x9bdb('0x82'),'id'])||{});}return null;})['spread'](function(_0x1ca244){var _0xc49351;_0x5d15ea=_0x1ca244||[];var _0x1075ea=[];if(_0x1ca244){for(var _0x37fec1=0x0;_0x37fec1<_0x1ca244[_0x9bdb('0x57')];_0x37fec1+=0x1){var _0xb544ba=_0x1ca244[_0x37fec1][_0x9bdb('0x58')]({'plain':!![]});_0xc49351=squel[_0x9bdb('0xa0')]()[_0x9bdb('0xa1')](_0x9bdb('0xc1'))[_0x9bdb('0xb3')]([_0x9bdb('0xa2'),_0x9bdb('0xa4'),_0x9bdb('0xa5'),_0x9bdb('0x63'),_0x9bdb('0x5a'),_0x9bdb('0x5b')],squel[_0x9bdb('0xa6')]()[_0x9bdb('0x83')](_0x9bdb('0xa2'),_0x9bdb('0xa2'))[_0x9bdb('0x83')]('id',_0x9bdb('0xa4'))[_0x9bdb('0x83')](_0xb544ba[_0x9bdb('0xa7')]['toString'](),'ListId')[_0x9bdb('0x83')](_0x362858[_0x9bdb('0x50')]['id'][_0x9bdb('0xa8')](),'VoiceQueueId')['field'](_0x9bdb('0xc2'),'createdAt')[_0x9bdb('0x83')](_0x9bdb('0xc2'),_0x9bdb('0x5b'))['from'](_0x9bdb('0xaa'))[_0x9bdb('0x46')](_0x9bdb('0xab'))[_0x9bdb('0x46')](_0x9bdb('0xac'),_0xb544ba['CmListId'][_0x9bdb('0xa8')]())[_0x9bdb('0x46')](_0x9bdb('0xad')))[_0x9bdb('0xa8')]();_0x1075ea[_0x9bdb('0x8b')](db[_0x9bdb('0x75')][_0x9bdb('0x41')](_0xc49351));}return BPromise['all'](_0x1075ea);}})['then'](function(){return _0x5d15ea;})[_0x9bdb('0x27')](respondWithResult(_0x29a7c0,null))['catch'](handleError(_0x29a7c0,null));};exports[_0x9bdb('0xc3')]=function(_0x3286fe,_0x3e0bf1,_0x441ddb){return db['VoiceQueue'][_0x9bdb('0x33')]({'where':{'id':_0x3286fe['params']['id']}})[_0x9bdb('0x27')](handleEntityNotFound(_0x3e0bf1,null))[_0x9bdb('0x27')](function(_0x4b68ef){if(_0x4b68ef){return _0x4b68ef[_0x9bdb('0xc3')](_0x3286fe[_0x9bdb('0x41')][_0x9bdb('0x82')]);}})[_0x9bdb('0x27')](function(_0x314c55){if(_0x314c55){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3286fe[_0x9bdb('0x41')][_0x9bdb('0x82')],'VoiceQueueId':_0x3286fe[_0x9bdb('0x50')]['id']}})['then'](function(){return _0x314c55;});}})[_0x9bdb('0x27')](respondWithStatusCode(_0x3e0bf1,null))[_0x9bdb('0x4e')](handleError(_0x3e0bf1,null));}; \ No newline at end of file +var _0x6455=['ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','order','pick','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','removeTeams','isEmpty','addAgents','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','CmListId','COALESCE(phone,\x27\x27)','CmHopperId','h.id','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter'];(function(_0x223bd0,_0x1abf79){var _0x22521d=function(_0x31e94f){while(--_0x31e94f){_0x223bd0['push'](_0x223bd0['shift']());}};_0x22521d(++_0x1abf79);}(_0x6455,0x97));var _0x5645=function(_0x35c3ba,_0x6eb4ff){_0x35c3ba=_0x35c3ba-0x0;var _0x3a71fe=_0x6455[_0x35c3ba];return _0x3a71fe;};'use strict';var emlformat=require(_0x5645('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5645('0x1'));var jsonpatch=require(_0x5645('0x2'));var rp=require(_0x5645('0x3'));var moment=require(_0x5645('0x4'));var BPromise=require(_0x5645('0x5'));var Mustache=require(_0x5645('0x6'));var util=require('util');var path=require(_0x5645('0x7'));var sox=require(_0x5645('0x8'));var csv=require(_0x5645('0x9'));var ejs=require(_0x5645('0xa'));var fs=require('fs');var fs_extra=require(_0x5645('0xb'));var _=require(_0x5645('0xc'));var squel=require(_0x5645('0xd'));var crypto=require(_0x5645('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5645('0x9'));var querystring=require(_0x5645('0xf'));var Papa=require(_0x5645('0x10'));var Redis=require(_0x5645('0x11'));var authService=require(_0x5645('0x12'));var qs=require(_0x5645('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5645('0x14'));var logger=require(_0x5645('0x15'))(_0x5645('0x16'));var utils=require(_0x5645('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5645('0x18'));var db=require('../../mysqldb')['db'];config[_0x5645('0x19')]=_[_0x5645('0x1a')](config[_0x5645('0x19')],{'host':_0x5645('0x1b'),'port':0x18eb});var socket=require(_0x5645('0x1c'))(new Redis(config[_0x5645('0x19')]));require(_0x5645('0x1d'))[_0x5645('0x1e')](socket);function respondWithStatusCode(_0x50449c,_0x2da9c5){_0x2da9c5=_0x2da9c5||0xcc;return function(_0x3e0ec6){if(_0x3e0ec6){return _0x50449c[_0x5645('0x1f')](_0x2da9c5);}return _0x50449c['status'](_0x2da9c5)['end']();};}function respondWithResult(_0x439b55,_0x361cfd){_0x361cfd=_0x361cfd||0xc8;return function(_0x511aed){if(_0x511aed){return _0x439b55[_0x5645('0x20')](_0x361cfd)[_0x5645('0x21')](_0x511aed);}};}function respondWithFilteredResult(_0x3911ea,_0x5179fd){return function(_0x35bc6f){if(_0x35bc6f){var _0x1d519d=typeof _0x5179fd[_0x5645('0x22')]===_0x5645('0x23')&&typeof _0x5179fd['limit']===_0x5645('0x23');var _0x52ac46=_0x35bc6f['count'];var _0x7c39d7=_0x1d519d?0x0:_0x5179fd[_0x5645('0x22')];var _0x2e3350=_0x1d519d?_0x35bc6f['count']:_0x5179fd[_0x5645('0x22')]+_0x5179fd['limit'];var _0x2b8cc8;if(_0x2e3350>=_0x52ac46){_0x2e3350=_0x52ac46;_0x2b8cc8=0xc8;}else{_0x2b8cc8=0xce;}_0x3911ea['status'](_0x2b8cc8);return _0x3911ea['set'](_0x5645('0x24'),_0x7c39d7+'-'+_0x2e3350+'/'+_0x52ac46)['json'](_0x35bc6f);}return null;};}function patchUpdates(_0x465a01){return function(_0x379cbd){try{jsonpatch['apply'](_0x379cbd,_0x465a01,!![]);}catch(_0x18680f){return BPromise[_0x5645('0x25')](_0x18680f);}return _0x379cbd[_0x5645('0x26')]();};}function saveUpdates(_0x50fa82,_0x1e70ad){return function(_0xc38038){if(_0xc38038){return _0xc38038[_0x5645('0x27')](_0x50fa82)[_0x5645('0x28')](function(_0x568fd6){return _0x568fd6;});}return null;};}function removeEntity(_0x4bc484,_0x5452b6){return function(_0x5bc689){if(_0x5bc689){return _0x5bc689[_0x5645('0x29')]()['then'](function(){var _0x47d097=_0x5bc689[_0x5645('0x2a')]({'plain':!![]});var _0x12f43a=[{'name':_0x5645('0x2b'),'value':_0x5645('0x2c'),'ignore':![]},{'name':_0x5645('0x2d'),'value':_0x5645('0x2e'),'ignore':![]}];var _0x3b9d8e=_(_0x12f43a)[_0x5645('0x2f')](_0x5645('0x30'))[_0x5645('0x31')](_0x5645('0x32'))[_0x5645('0x32')]();if(_[_0x5645('0x33')](_0x3b9d8e,_0x47d097[_0x5645('0x34')])){return;}var _0x52ba45=_[_0x5645('0x35')](_0x12f43a,['value',_0x47d097[_0x5645('0x34')]])[_0x5645('0x36')];return db[_0x5645('0x37')][_0x5645('0x29')]({'where':{'type':_0x52ba45,'resourceId':_0x47d097['id']}})[_0x5645('0x28')](function(){return _0x5bc689;});})[_0x5645('0x28')](function(){_0x4bc484['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20da82,_0xb4f0ce){return function(_0x2a8e10){if(!_0x2a8e10){_0x20da82[_0x5645('0x1f')](0x194);}return _0x2a8e10;};}function handleError(_0x3b070c,_0x3bee83){_0x3bee83=_0x3bee83||0x1f4;return function(_0x44d519){logger[_0x5645('0x38')](_0x44d519[_0x5645('0x39')]);if(_0x44d519[_0x5645('0x36')]){delete _0x44d519[_0x5645('0x36')];}_0x3b070c['status'](_0x3bee83)['send'](_0x44d519);};}exports[_0x5645('0x3a')]=function(_0x5a7e11,_0x245316){var _0x4c0dba={},_0x136722={},_0x56f937={'count':0x0,'rows':[]};var _0x2e3dfb=_[_0x5645('0x31')](db[_0x5645('0x3b')][_0x5645('0x3c')],function(_0xcf0c27){return{'name':_0xcf0c27[_0x5645('0x3d')],'type':_0xcf0c27['type'][_0x5645('0x3e')]};});_0x136722[_0x5645('0x3f')]=_[_0x5645('0x31')](_0x2e3dfb,_0x5645('0x36'));_0x136722[_0x5645('0x40')]=_[_0x5645('0x41')](_0x5a7e11[_0x5645('0x40')]);_0x136722[_0x5645('0x42')]=_['intersection'](_0x136722[_0x5645('0x3f')],_0x136722['query']);_0x4c0dba[_0x5645('0x43')]=_[_0x5645('0x44')](_0x136722[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x5a7e11[_0x5645('0x40')]['fields']));_0x4c0dba[_0x5645('0x43')]=_0x4c0dba[_0x5645('0x43')][_0x5645('0x46')]?_0x4c0dba[_0x5645('0x43')]:_0x136722[_0x5645('0x3f')];if(!_0x5a7e11[_0x5645('0x40')][_0x5645('0x47')](_0x5645('0x48'))){_0x4c0dba[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x5a7e11[_0x5645('0x40')][_0x5645('0x49')]);_0x4c0dba[_0x5645('0x22')]=qs[_0x5645('0x22')](_0x5a7e11[_0x5645('0x40')][_0x5645('0x22')]);}_0x4c0dba['order']=qs[_0x5645('0x4a')](_0x5a7e11[_0x5645('0x40')]['sort']);_0x4c0dba[_0x5645('0x4b')]=qs[_0x5645('0x42')](_['pick'](_0x5a7e11[_0x5645('0x40')],_0x136722[_0x5645('0x42')]),_0x2e3dfb);if(_0x5a7e11[_0x5645('0x40')][_0x5645('0x2f')]){_0x4c0dba[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x4c0dba[_0x5645('0x4b')],{'$or':_['map'](_0x2e3dfb,function(_0x5d9a8b){if(_0x5d9a8b[_0x5645('0x34')]!==_0x5645('0x4d')){var _0x4241d8={};_0x4241d8[_0x5d9a8b[_0x5645('0x36')]]={'$like':'%'+_0x5a7e11[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x4241d8;}})});}_0x4c0dba=_[_0x5645('0x4c')]({},_0x4c0dba,_0x5a7e11[_0x5645('0x4e')]);var _0x1b5a5e={'where':_0x4c0dba[_0x5645('0x4b')]};return db[_0x5645('0x3b')][_0x5645('0x4f')](_0x1b5a5e)[_0x5645('0x28')](function(_0x196dd7){_0x56f937[_0x5645('0x4f')]=_0x196dd7;if(_0x5a7e11[_0x5645('0x40')][_0x5645('0x50')]){_0x4c0dba['include']=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x4c0dba);})['then'](function(_0x2eb535){_0x56f937[_0x5645('0x51')]=_0x2eb535;return _0x56f937;})[_0x5645('0x28')](respondWithFilteredResult(_0x245316,_0x4c0dba))[_0x5645('0x52')](handleError(_0x245316,null));};exports[_0x5645('0x53')]=function(_0x5b9b00,_0x43eaa9){var _0x2f6552={'raw':![],'where':{'id':_0x5b9b00[_0x5645('0x54')]['id']}},_0x41b607={};_0x41b607[_0x5645('0x3f')]=_['keys'](db[_0x5645('0x3b')][_0x5645('0x3c')]);_0x41b607[_0x5645('0x40')]=_[_0x5645('0x41')](_0x5b9b00[_0x5645('0x40')]);_0x41b607[_0x5645('0x42')]=_[_0x5645('0x44')](_0x41b607[_0x5645('0x3f')],_0x41b607['query']);_0x2f6552['attributes']=_[_0x5645('0x44')](_0x41b607[_0x5645('0x3f')],qs['fields'](_0x5b9b00['query'][_0x5645('0x45')]));_0x2f6552['attributes']=_0x2f6552[_0x5645('0x43')][_0x5645('0x46')]?_0x2f6552[_0x5645('0x43')]:_0x41b607[_0x5645('0x3f')];if(_0x5b9b00[_0x5645('0x40')]['includeAll']){_0x2f6552[_0x5645('0x55')]=[{'all':!![]}];}_0x2f6552=_['merge']({},_0x2f6552,_0x5b9b00['options']);return db[_0x5645('0x3b')][_0x5645('0x35')](_0x2f6552)[_0x5645('0x28')](handleEntityNotFound(_0x43eaa9,null))[_0x5645('0x28')](respondWithResult(_0x43eaa9,null))[_0x5645('0x52')](handleError(_0x43eaa9,null));};exports[_0x5645('0x56')]=function(_0x33317f,_0x2fc909){return db[_0x5645('0x3b')][_0x5645('0x56')](_0x33317f[_0x5645('0x57')],{})[_0x5645('0x28')](function(_0x4d56f5){var _0x51b234=_0x33317f[_0x5645('0x58')][_0x5645('0x2a')]({'plain':!![]});if(!_0x51b234)throw new Error(_0x5645('0x59'));if(_0x51b234[_0x5645('0x5a')]===_0x5645('0x58')){var _0x4cfe24=_0x4d56f5[_0x5645('0x2a')]({'plain':!![]});var _0x184587=[{'name':'VoiceQueues','value':_0x5645('0x2c')},{'name':_0x5645('0x2d'),'value':_0x5645('0x2e')}];var _0x45265f=_[_0x5645('0x35')](_0x184587,['value',_0x4cfe24[_0x5645('0x34')]])[_0x5645('0x36')];return db[_0x5645('0x5b')][_0x5645('0x35')]({'where':{'name':_0x45265f,'userProfileId':_0x51b234['userProfileId']},'raw':!![]})[_0x5645('0x28')](function(_0x1ab204){if(_0x1ab204&&_0x1ab204[_0x5645('0x5c')]===0x0){return db[_0x5645('0x37')][_0x5645('0x56')]({'name':_0x4cfe24[_0x5645('0x36')],'resourceId':_0x4cfe24['id'],'type':_0x1ab204[_0x5645('0x36')],'sectionId':_0x1ab204['id']},{})[_0x5645('0x28')](function(){return _0x4d56f5;});}else{return _0x4d56f5;}})[_0x5645('0x52')](function(_0x5b7d90){logger[_0x5645('0x38')](_0x5645('0x5d'),_0x5b7d90);throw _0x5b7d90;});}return _0x4d56f5;})['then'](respondWithResult(_0x2fc909,0xc9))['catch'](handleError(_0x2fc909,null));};exports[_0x5645('0x5e')]=function(_0x5538ea,_0x26ac15){var _0x30134e={'where':{'id':_0x5538ea[_0x5645('0x54')]['id']}},_0x26431d={};_0x26431d[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x3b')]['rawAttributes']);_0x30134e[_0x5645('0x43')]=_[_0x5645('0x44')](_0x26431d[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x5538ea[_0x5645('0x40')][_0x5645('0x45')]));_0x30134e[_0x5645('0x43')]=_0x30134e[_0x5645('0x43')]['length']?_0x30134e[_0x5645('0x43')]:_0x26431d[_0x5645('0x3f')];if(_0x5538ea[_0x5645('0x40')][_0x5645('0x50')]){_0x30134e['include']=[{'all':!![]}];}_0x30134e=_[_0x5645('0x4c')]({},_0x30134e,_0x5538ea[_0x5645('0x4e')]);return db[_0x5645('0x3b')][_0x5645('0x35')](_0x30134e)[_0x5645('0x28')](handleEntityNotFound(_0x26ac15,null))[_0x5645('0x28')](function(_0x83ec55){if(_0x83ec55){var _0xa8b84c=_0x83ec55['get']({'plain':!![]});_0xa8b84c=qs[_0x5645('0x5f')](_0xa8b84c,['id',_0x5645('0x60'),_0x5645('0x61')]);_0x5538ea[_0x5645('0x57')]=_[_0x5645('0x5f')](_0x5538ea[_0x5645('0x57')],['id','createdAt',_0x5645('0x61')]);return db[_0x5645('0x3b')][_0x5645('0x56')](_[_0x5645('0x4c')](_0xa8b84c,_0x5538ea['body']),{'include':_0x5538ea['query'][_0x5645('0x50')]?[{'all':!![]}]:undefined})[_0x5645('0x28')](function(_0x10085f){var _0x5814fe=_0x5538ea[_0x5645('0x58')][_0x5645('0x2a')]({'plain':!![]});if(!_0x5814fe)throw new Error(_0x5645('0x59'));if(_0x5814fe[_0x5645('0x5a')]===_0x5645('0x58')){var _0xa59305=_0x10085f[_0x5645('0x2a')]({'plain':!![]});var _0x1772dc=[{'name':'VoiceQueues','value':_0x5645('0x2c')},{'name':_0x5645('0x2d'),'value':_0x5645('0x2e')}];var _0x44d07d=_[_0x5645('0x35')](_0x1772dc,['value',_0xa59305['type']])[_0x5645('0x36')];return db['UserProfileSection']['find']({'where':{'name':_0x44d07d,'userProfileId':_0x5814fe['userProfileId']},'raw':!![]})[_0x5645('0x28')](function(_0x32270f){if(_0x32270f&&_0x32270f[_0x5645('0x5c')]===0x0){return db[_0x5645('0x37')][_0x5645('0x56')]({'name':_0xa59305['name'],'resourceId':_0xa59305['id'],'type':_0x32270f[_0x5645('0x36')],'sectionId':_0x32270f['id']},{})['then'](function(){return _0x10085f;});}else{return _0x10085f;}})[_0x5645('0x52')](function(_0x4d94e1){logger[_0x5645('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d94e1);throw _0x4d94e1;});}return _0x10085f;});}})['then'](respondWithResult(_0x26ac15,0xc9))[_0x5645('0x52')](handleError(_0x26ac15,null));};exports['update']=function(_0x41571c,_0xf3242){if(_0x41571c[_0x5645('0x57')]['id']){delete _0x41571c['body']['id'];}return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x41571c['params']['id']}})['then'](handleEntityNotFound(_0xf3242,null))['then'](saveUpdates(_0x41571c['body'],null))[_0x5645('0x28')](respondWithResult(_0xf3242,null))[_0x5645('0x52')](handleError(_0xf3242,null));};exports['destroy']=function(_0x19fbb5,_0x42e27f){return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x19fbb5[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x42e27f,null))[_0x5645('0x28')](removeEntity(_0x42e27f,null))[_0x5645('0x52')](handleError(_0x42e27f,null));};exports[_0x5645('0x62')]=function(_0x210c7f,_0x4dc498,_0x27d126){var _0x499823={'raw':![],'where':{}};var _0x405b7d={};var _0x578123={'count':0x0,'rows':[]};return db[_0x5645('0x3b')]['findOne']({'where':{'id':_0x210c7f[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x4dc498,null))[_0x5645('0x28')](function(_0x32d835){if(_0x32d835){_0x405b7d[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x63')][_0x5645('0x3c')]);_0x405b7d[_0x5645('0x40')]=_[_0x5645('0x41')](_0x210c7f[_0x5645('0x40')]);_0x405b7d[_0x5645('0x42')]=_[_0x5645('0x44')](_0x405b7d[_0x5645('0x3f')],_0x405b7d['query']);_0x499823[_0x5645('0x43')]=_[_0x5645('0x44')](_0x405b7d[_0x5645('0x3f')],qs['fields'](_0x210c7f['query'][_0x5645('0x45')]));_0x499823['attributes']=_0x499823['attributes'][_0x5645('0x46')]?_0x499823[_0x5645('0x43')]:_0x405b7d['model'];if(!_0x210c7f[_0x5645('0x40')][_0x5645('0x47')](_0x5645('0x48'))){_0x499823[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x210c7f[_0x5645('0x40')][_0x5645('0x49')]);_0x499823[_0x5645('0x22')]=qs[_0x5645('0x22')](_0x210c7f[_0x5645('0x40')][_0x5645('0x22')]);}_0x499823[_0x5645('0x64')]=qs['sort'](_0x210c7f[_0x5645('0x40')][_0x5645('0x4a')]);_0x499823['where']=qs[_0x5645('0x42')](_[_0x5645('0x65')](_0x210c7f[_0x5645('0x40')],_0x405b7d[_0x5645('0x42')]));_0x499823['where']['VoiceQueueId']=_0x32d835['id'];if(_0x210c7f['query'][_0x5645('0x2f')]){_0x499823[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x499823[_0x5645('0x4b')],{'$or':_['map'](_0x499823[_0x5645('0x43')],function(_0x5b2e75){var _0x29ed99={};_0x29ed99[_0x5b2e75]={'$like':'%'+_0x210c7f[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x29ed99;})});}_0x499823=_['merge']({},_0x499823,_0x210c7f[_0x5645('0x4e')]);return db[_0x5645('0x63')][_0x5645('0x4f')]({'where':_0x499823[_0x5645('0x4b')]})[_0x5645('0x28')](function(_0x3cf4a4){_0x578123[_0x5645('0x4f')]=_0x3cf4a4;if(_0x210c7f[_0x5645('0x40')]['includeAll']){_0x499823[_0x5645('0x55')]=[{'all':!![]}];}return db[_0x5645('0x63')]['findAll'](_0x499823);})[_0x5645('0x28')](function(_0x211b4c){_0x578123[_0x5645('0x51')]=_0x211b4c;return _0x578123;});}})[_0x5645('0x28')](respondWithFilteredResult(_0x4dc498,_0x499823))[_0x5645('0x52')](handleError(_0x4dc498,null));};exports[_0x5645('0x66')]=function(_0x52c19e,_0x5ba640,_0x481ab6){var _0x4385bc={'raw':!![],'where':{}};var _0xd33255={};var _0x42ae53={'count':0x0,'rows':[]};return db[_0x5645('0x3b')][_0x5645('0x67')]({'where':{'id':_0x52c19e['params']['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x5ba640,null))[_0x5645('0x28')](function(_0x38637a){if(_0x38637a){_0xd33255[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x68')][_0x5645('0x3c')]);_0xd33255[_0x5645('0x40')]=_['keys'](_0x52c19e[_0x5645('0x40')]);_0xd33255[_0x5645('0x42')]=_[_0x5645('0x44')](_0xd33255[_0x5645('0x3f')],_0xd33255[_0x5645('0x40')]);_0x4385bc[_0x5645('0x43')]=_[_0x5645('0x44')](_0xd33255[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x52c19e[_0x5645('0x40')][_0x5645('0x45')]));_0x4385bc[_0x5645('0x43')]=_0x4385bc[_0x5645('0x43')][_0x5645('0x46')]?_0x4385bc[_0x5645('0x43')]:_0xd33255[_0x5645('0x3f')];if(!_0x52c19e[_0x5645('0x40')][_0x5645('0x47')](_0x5645('0x48'))){_0x4385bc[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x52c19e[_0x5645('0x40')][_0x5645('0x49')]);_0x4385bc[_0x5645('0x22')]=qs['offset'](_0x52c19e[_0x5645('0x40')][_0x5645('0x22')]);}_0x4385bc['order']=qs['sort'](_0x52c19e[_0x5645('0x40')][_0x5645('0x4a')]);_0x4385bc[_0x5645('0x4b')]=qs[_0x5645('0x42')](_['pick'](_0x52c19e[_0x5645('0x40')],_0xd33255[_0x5645('0x42')]));_0x4385bc['where'][_0x5645('0x69')]=_0x38637a['id'];if(_0x52c19e[_0x5645('0x40')][_0x5645('0x2f')]){_0x4385bc['where']=_[_0x5645('0x4c')](_0x4385bc[_0x5645('0x4b')],{'$or':_[_0x5645('0x31')](_0x4385bc[_0x5645('0x43')],function(_0x4eb879){var _0x26459e={};_0x26459e[_0x4eb879]={'$like':'%'+_0x52c19e[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x26459e;})});}_0x4385bc=_[_0x5645('0x4c')]({},_0x4385bc,_0x52c19e['options']);return db[_0x5645('0x68')]['count']({'where':_0x4385bc[_0x5645('0x4b')]})[_0x5645('0x28')](function(_0x197d17){_0x42ae53[_0x5645('0x4f')]=_0x197d17;if(_0x52c19e[_0x5645('0x40')][_0x5645('0x50')]){_0x4385bc[_0x5645('0x55')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5645('0x6a')](_0x4385bc);})['then'](function(_0x1ce43b){_0x42ae53[_0x5645('0x51')]=_0x1ce43b;return _0x42ae53;});}})[_0x5645('0x28')](respondWithFilteredResult(_0x5ba640,_0x4385bc))[_0x5645('0x52')](handleError(_0x5ba640,null));};exports['getHopperFinals']=function(_0x102e4a,_0x3d9fa4,_0x1bc6e4){var _0x19d47c={'raw':!![],'where':{}};var _0x4068ee={};var _0x783995={'count':0x0,'rows':[]};return db[_0x5645('0x3b')]['findOne']({'where':{'id':_0x102e4a[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x3d9fa4,null))['then'](function(_0x2f1a76){if(_0x2f1a76){_0x4068ee[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x6b')][_0x5645('0x3c')]);_0x4068ee['query']=_[_0x5645('0x41')](_0x102e4a[_0x5645('0x40')]);_0x4068ee['filters']=_[_0x5645('0x44')](_0x4068ee[_0x5645('0x3f')],_0x4068ee[_0x5645('0x40')]);_0x19d47c['attributes']=_[_0x5645('0x44')](_0x4068ee[_0x5645('0x3f')],qs['fields'](_0x102e4a[_0x5645('0x40')][_0x5645('0x45')]));_0x19d47c[_0x5645('0x43')]=_0x19d47c[_0x5645('0x43')][_0x5645('0x46')]?_0x19d47c[_0x5645('0x43')]:_0x4068ee['model'];if(!_0x102e4a[_0x5645('0x40')][_0x5645('0x47')]('nolimit')){_0x19d47c[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x102e4a['query'][_0x5645('0x49')]);_0x19d47c[_0x5645('0x22')]=qs[_0x5645('0x22')](_0x102e4a['query']['offset']);}_0x19d47c[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x102e4a[_0x5645('0x40')][_0x5645('0x4a')]);_0x19d47c['where']=qs[_0x5645('0x42')](_['pick'](_0x102e4a[_0x5645('0x40')],_0x4068ee[_0x5645('0x42')]));_0x19d47c[_0x5645('0x4b')][_0x5645('0x69')]=_0x2f1a76['id'];if(_0x102e4a[_0x5645('0x40')][_0x5645('0x2f')]){_0x19d47c[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x19d47c[_0x5645('0x4b')],{'$or':_[_0x5645('0x31')](_0x19d47c[_0x5645('0x43')],function(_0x1d4ab5){var _0x4b9ea3={};_0x4b9ea3[_0x1d4ab5]={'$like':'%'+_0x102e4a[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x4b9ea3;})});}_0x19d47c=_[_0x5645('0x4c')]({},_0x19d47c,_0x102e4a[_0x5645('0x4e')]);return db['CmHopperFinal'][_0x5645('0x4f')]({'where':_0x19d47c[_0x5645('0x4b')]})['then'](function(_0x402ac5){_0x783995['count']=_0x402ac5;if(_0x102e4a['query']['includeAll']){_0x19d47c[_0x5645('0x55')]=[{'all':!![]}];}return db[_0x5645('0x6b')][_0x5645('0x6a')](_0x19d47c);})[_0x5645('0x28')](function(_0x50d596){_0x783995['rows']=_0x50d596;return _0x783995;});}})['then'](respondWithFilteredResult(_0x3d9fa4,_0x19d47c))['catch'](handleError(_0x3d9fa4,null));};exports[_0x5645('0x6c')]=function(_0x237ed9,_0x1c929b,_0x5a1adf){var _0x4e0753={'raw':!![],'where':{}};var _0x497d00={};var _0x47fe73={'count':0x0,'rows':[]};return db[_0x5645('0x3b')]['findOne']({'where':{'id':_0x237ed9[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x1c929b,null))[_0x5645('0x28')](function(_0x248cda){if(_0x248cda){_0x497d00[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x6d')][_0x5645('0x3c')]);_0x497d00[_0x5645('0x40')]=_['keys'](_0x237ed9[_0x5645('0x40')]);_0x497d00['filters']=_[_0x5645('0x44')](_0x497d00[_0x5645('0x3f')],_0x497d00['query']);_0x4e0753[_0x5645('0x43')]=_[_0x5645('0x44')](_0x497d00[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x237ed9['query'][_0x5645('0x45')]));_0x4e0753[_0x5645('0x43')]=_0x4e0753[_0x5645('0x43')]['length']?_0x4e0753[_0x5645('0x43')]:_0x497d00[_0x5645('0x3f')];if(!_0x237ed9['query'][_0x5645('0x47')](_0x5645('0x48'))){_0x4e0753[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x237ed9[_0x5645('0x40')][_0x5645('0x49')]);_0x4e0753['offset']=qs['offset'](_0x237ed9[_0x5645('0x40')]['offset']);}_0x4e0753[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x237ed9['query'][_0x5645('0x4a')]);_0x4e0753['where']=qs[_0x5645('0x42')](_['pick'](_0x237ed9[_0x5645('0x40')],_0x497d00[_0x5645('0x42')]));_0x4e0753['where'][_0x5645('0x69')]=_0x248cda['id'];if(_0x237ed9[_0x5645('0x40')]['filter']){_0x4e0753[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x4e0753[_0x5645('0x4b')],{'$or':_[_0x5645('0x31')](_0x4e0753['attributes'],function(_0x4bc866){var _0x28306d={};_0x28306d[_0x4bc866]={'$like':'%'+_0x237ed9[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x28306d;})});}_0x4e0753=_[_0x5645('0x4c')]({},_0x4e0753,_0x237ed9[_0x5645('0x4e')]);return db[_0x5645('0x6d')][_0x5645('0x4f')]({'where':_0x4e0753['where']})[_0x5645('0x28')](function(_0x2ecace){_0x47fe73[_0x5645('0x4f')]=_0x2ecace;if(_0x237ed9[_0x5645('0x40')][_0x5645('0x50')]){_0x4e0753[_0x5645('0x55')]=[{'all':!![]}];}return db[_0x5645('0x6d')][_0x5645('0x6a')](_0x4e0753);})[_0x5645('0x28')](function(_0xb7ba52){_0x47fe73[_0x5645('0x51')]=_0xb7ba52;return _0x47fe73;});}})[_0x5645('0x28')](respondWithFilteredResult(_0x1c929b,_0x4e0753))[_0x5645('0x52')](handleError(_0x1c929b,null));};exports[_0x5645('0x6e')]=function(_0x54fb72,_0x23ec36,_0xe1be00){var _0x451240={};var _0x10d24d={};var _0x573328;var _0x1be6f0;return db[_0x5645('0x3b')][_0x5645('0x67')]({'where':{'id':_0x54fb72[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x23ec36,null))['then'](function(_0x118853){if(_0x118853){_0x573328=_0x118853;_0x10d24d[_0x5645('0x3f')]=_[_0x5645('0x41')](db['Team'][_0x5645('0x3c')]);_0x10d24d[_0x5645('0x40')]=_[_0x5645('0x41')](_0x54fb72[_0x5645('0x40')]);_0x10d24d[_0x5645('0x42')]=_['intersection'](_0x10d24d[_0x5645('0x3f')],_0x10d24d[_0x5645('0x40')]);_0x451240[_0x5645('0x43')]=_['intersection'](_0x10d24d['model'],qs[_0x5645('0x45')](_0x54fb72[_0x5645('0x40')][_0x5645('0x45')]));_0x451240['attributes']=_0x451240['attributes']['length']?_0x451240['attributes']:_0x10d24d[_0x5645('0x3f')];_0x451240[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x54fb72[_0x5645('0x40')]['sort']);_0x451240[_0x5645('0x4b')]=qs[_0x5645('0x42')](_[_0x5645('0x65')](_0x54fb72[_0x5645('0x40')],_0x10d24d[_0x5645('0x42')]));if(_0x54fb72[_0x5645('0x40')][_0x5645('0x2f')]){_0x451240[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x451240['where'],{'$or':_['map'](_0x451240[_0x5645('0x43')],function(_0x18ddc9){var _0x58ee73={};_0x58ee73[_0x18ddc9]={'$like':'%'+_0x54fb72['query'][_0x5645('0x2f')]+'%'};return _0x58ee73;})});}_0x451240=_['merge']({},_0x451240,_0x54fb72['options']);return _0x573328[_0x5645('0x6e')](_0x451240);}})[_0x5645('0x28')](function(_0x50b257){if(_0x50b257){_0x1be6f0=_0x50b257[_0x5645('0x46')];if(!_0x54fb72[_0x5645('0x40')][_0x5645('0x47')](_0x5645('0x48'))){_0x451240['limit']=qs[_0x5645('0x49')](_0x54fb72['query']['limit']);_0x451240[_0x5645('0x22')]=qs[_0x5645('0x22')](_0x54fb72[_0x5645('0x40')][_0x5645('0x22')]);}return _0x573328[_0x5645('0x6e')](_0x451240);}})['then'](function(_0x384907){if(_0x384907){return _0x384907?{'count':_0x1be6f0,'rows':_0x384907}:null;}})['then'](respondWithResult(_0x23ec36,null))['catch'](handleError(_0x23ec36,null));};exports['addTeams']=function(_0x4265dd,_0x9f009d,_0x514ee1){var _0x159d37=_0x4265dd[_0x5645('0x57')][_0x5645('0x6f')];var _0x567437=_[_0x5645('0x31')](_0x159d37,'id');return db[_0x5645('0x70')][_0x5645('0x6a')]({'where':{'id':_0x567437},'attributes':['id'],'include':[{'model':db[_0x5645('0x71')],'as':_0x5645('0x72'),'attributes':['id',_0x5645('0x36'),_0x5645('0x73'),_0x5645('0x74'),_0x5645('0x75')],'raw':!![]}]})[_0x5645('0x28')](function(_0x2e12ce){if(_0x2e12ce){var _0x1b3460=_[_0x5645('0x76')](_0x2e12ce,function(_0x881acc){var _0x1ff59a=_0x881acc['get']({'plain':!![]});_0x1ff59a[_0x5645('0x72')][_0x5645('0x77')](function(_0x147507){_0x147507[_0x5645('0x78')]=_[_0x5645('0x35')](_0x159d37,{'id':_0x1ff59a['id']})[_0x5645('0x78')];});return _0x1ff59a[_0x5645('0x72')];});return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x4265dd[_0x5645('0x54')]['id']}})['then'](function(_0x1916b2){return db[_0x5645('0x79')][_0x5645('0x7a')](function(_0x572bda){return _0x1916b2[_0x5645('0x7b')](_0x567437,{'transaction':_0x572bda})['then'](function(){return BPromise[_0x5645('0x7c')](_0x159d37,function(_0x3e84e9){return db[_0x5645('0x7d')][_0x5645('0x7e')]({'TeamId':_0x3e84e9['id'],'VoiceQueueId':_0x4265dd[_0x5645('0x54')]['id'],'penalty':_0x3e84e9['penalty']},{'transaction':_0x572bda});});})[_0x5645('0x28')](function(){return BPromise['each'](_0x1b3460,function(_0x5211f4){return db[_0x5645('0x7f')][_0x5645('0x80')]({'where':{'UserId':_0x5211f4['id'],'VoiceQueueId':_0x4265dd[_0x5645('0x54')]['id']},'defaults':{'penalty':_0x5211f4[_0x5645('0x78')]},'transaction':_0x572bda});});})['then'](function(){return BPromise[_0x5645('0x7c')](_[_0x5645('0x2f')](_0x1b3460,{'online':!![]}),function(_0x39140a){return db[_0x5645('0x81')][_0x5645('0x7e')]({'membername':_0x39140a[_0x5645('0x36')],'UserId':_0x39140a['id'],'queue_name':_0x1916b2[_0x5645('0x36')],'VoiceQueueId':_0x1916b2['id'],'interface':_[_0x5645('0x82')](_0x39140a[_0x5645('0x75')])?util[_0x5645('0x83')](_0x5645('0x84'),_0x39140a[_0x5645('0x36')]):_0x39140a['interface'],'paused':_0x39140a['voicePause']||![],'penalty':_0x39140a['penalty']},{'transaction':_0x572bda});});})[_0x5645('0x28')](function(){_0x1b3460['forEach'](function(_0x510499){socket[_0x5645('0x85')](_0x5645('0x86'),{'UserId':_0x510499['id'],'VoiceQueueId':_0x1916b2['id']});});});});});}})['then'](respondWithStatusCode(_0x9f009d,null))[_0x5645('0x52')](handleError(_0x9f009d,null));};exports['removeTeams']=function(_0x340754,_0x24c642,_0x735aa4){return db[_0x5645('0x70')]['findAll']({'where':{'id':_0x340754[_0x5645('0x40')][_0x5645('0x87')]},'attributes':['id'],'include':[{'model':db[_0x5645('0x71')],'as':_0x5645('0x72'),'attributes':['id'],'raw':!![]}]})[_0x5645('0x28')](handleEntityNotFound(_0x24c642,null))[_0x5645('0x28')](function(_0x3f9562){var _0x4a3d57=_[_0x5645('0x31')](_0x3f9562,'id');var _0x4bf69e=[];var _0x2f3e7b=[];var _0x54d9eb=squel[_0x5645('0x88')]();_0x54d9eb[_0x5645('0x89')](_0x5645('0x8a'))[_0x5645('0x8b')](_0x5645('0x8c'),'tq')[_0x5645('0x8d')](_0x5645('0x8e'),'ut',_0x5645('0x8f'))[_0x5645('0x4b')](_0x5645('0x90'),_0x340754[_0x5645('0x54')]['id']);for(var _0x5afa43=0x0;_0x5afa43<_0x3f9562[_0x5645('0x46')];_0x5afa43+=0x1){let _0x1aa645=_0x3f9562[_0x5afa43];for(var _0x2e931a=0x0;_0x2e931a<_0x1aa645[_0x5645('0x72')][_0x5645('0x46')];_0x2e931a+=0x1){let _0x154a36=_0x1aa645['Agents'][_0x2e931a];var _0xc56b15=_0x54d9eb['clone']();_0xc56b15[_0x5645('0x4b')](_0x5645('0x91'),_0x154a36['id']);_0x2f3e7b[_0x5645('0x92')](db[_0x5645('0x79')][_0x5645('0x40')](_0xc56b15[_0x5645('0x93')](),{'type':db[_0x5645('0x79')][_0x5645('0x94')]['SELECT']})[_0x5645('0x28')](function(_0x12dccc){if(_0x12dccc[_0x5645('0x46')]===0x1){return _0x154a36['id'];}else{var _0x1df321=_[_0x5645('0x95')](_['map'](_0x12dccc,_0x5645('0x96')),function(_0x37a03f){return _['includes'](_0x4a3d57,_0x37a03f);});if(_0x1df321){return _0x154a36['id'];}}}));}}return BPromise[_0x5645('0x97')](_0x2f3e7b)[_0x5645('0x28')](function(_0x594792){_0x4bf69e=_(_0x4bf69e)[_0x5645('0x98')](_0x594792)[_0x5645('0x99')]()[_0x5645('0x32')]();return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x340754['params']['id']}})[_0x5645('0x28')](function(_0x4df673){return db[_0x5645('0x79')][_0x5645('0x7a')](function(_0xc8896b){return _0x4df673[_0x5645('0x9a')](_0x340754[_0x5645('0x40')][_0x5645('0x87')],{'transaction':_0xc8896b})[_0x5645('0x28')](function(){if(!_[_0x5645('0x9b')](_0x4bf69e)){return _0x4df673['removeAgents'](_0x4bf69e,{'transaction':_0xc8896b})[_0x5645('0x28')](function(){return db['UserVoiceQueueRt'][_0x5645('0x29')]({'where':{'VoiceQueueId':_0x340754[_0x5645('0x54')]['id'],'UserId':_0x4bf69e},'transaction':_0xc8896b});});}})[_0x5645('0x28')](function(){_0x4bf69e['forEach'](function(_0x5a9ae3){socket[_0x5645('0x85')]('userVoiceQueue:remove',{'UserId':_0x5a9ae3,'VoiceQueueId':_0x4df673['id']});});});});});});})['then'](respondWithStatusCode(_0x24c642,null))['catch'](handleError(_0x24c642,null));};exports['addAgents']=function(_0x3135ad,_0x4fa40a,_0x41c45f){var _0x107563,_0x7b5bc2;return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x3135ad[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x4fa40a,null))[_0x5645('0x28')](function(_0x4c195c){if(_0x4c195c){_0x7b5bc2=_0x4c195c;return _0x4c195c[_0x5645('0x9c')](_0x3135ad['body'][_0x5645('0x87')],_['omit'](_0x3135ad[_0x5645('0x57')],[_0x5645('0x87'),'id'])||{})[_0x5645('0x9d')](function(_0x1240c7){for(var _0x5da711=0x0;_0x5da711<_0x3135ad[_0x5645('0x57')]['ids'][_0x5645('0x46')];_0x5da711+=0x1){socket[_0x5645('0x85')](_0x5645('0x86'),{'UserId':Number(_0x3135ad[_0x5645('0x57')][_0x5645('0x87')][_0x5da711]),'VoiceQueueId':Number(_0x3135ad[_0x5645('0x54')]['id'])});}return _0x1240c7;});}})[_0x5645('0x28')](function(_0x19a7a9){_0x107563=_0x19a7a9||[];if(_0x7b5bc2){return db['User'][_0x5645('0x6a')]({'where':{'id':_0x3135ad[_0x5645('0x57')][_0x5645('0x87')]},'attributes':['id',_0x5645('0x36'),_0x5645('0x73'),'voicePause','interface'],'raw':!![]});}})[_0x5645('0x28')](function(_0x423423){if(!_['isEmpty'](_0x423423)){var _0x37478b=[];for(var _0x37c04b=0x0;_0x37c04b<_0x423423[_0x5645('0x46')];_0x37c04b++){if(_0x423423[_0x37c04b][_0x5645('0x73')]){_0x37478b['push'](db['UserVoiceQueueRt'][_0x5645('0x7e')]({'membername':_0x423423[_0x37c04b]['name'],'UserId':_0x423423[_0x37c04b]['id'],'queue_name':_0x7b5bc2[_0x5645('0x36')],'VoiceQueueId':_0x7b5bc2['id'],'interface':_[_0x5645('0x82')](_0x423423[_0x37c04b][_0x5645('0x75')])?util[_0x5645('0x83')](_0x5645('0x84'),_0x423423[_0x37c04b][_0x5645('0x36')]):_0x423423[_0x37c04b][_0x5645('0x75')],'paused':_0x423423[_0x37c04b][_0x5645('0x74')]||![],'penalty':_0x3135ad[_0x5645('0x57')][_0x5645('0x78')]||0x0}));}}return BPromise['all'](_0x37478b);}})['then'](function(){return _0x107563;})['then'](respondWithResult(_0x4fa40a,null))[_0x5645('0x52')](handleError(_0x4fa40a,null));};exports[_0x5645('0x9e')]=function(_0x56d91d,_0x32e5b0,_0x37204c){return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x56d91d['params']['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x32e5b0,null))[_0x5645('0x28')](function(_0x30fe69){if(_0x30fe69){return _0x30fe69[_0x5645('0x9e')](_0x56d91d[_0x5645('0x40')][_0x5645('0x87')])[_0x5645('0x28')](function(){if(_[_0x5645('0x9f')](_0x56d91d[_0x5645('0x40')][_0x5645('0x87')])){for(var _0x411963=0x0;_0x411963<_0x56d91d[_0x5645('0x40')][_0x5645('0x87')][_0x5645('0x46')];_0x411963+=0x1){socket[_0x5645('0x85')]('userVoiceQueue:remove',{'UserId':Number(_0x56d91d[_0x5645('0x40')][_0x5645('0x87')][_0x411963]),'VoiceQueueId':Number(_0x56d91d[_0x5645('0x54')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x56d91d[_0x5645('0x40')]['ids']),'VoiceQueueId':Number(_0x56d91d['params']['id'])});}});}})[_0x5645('0x28')](function(_0x11fe15){return db[_0x5645('0x81')][_0x5645('0x29')]({'where':{'VoiceQueueId':_0x56d91d['params']['id'],'UserId':_0x56d91d['query']['ids']}})[_0x5645('0x28')](function(){return _0x11fe15;});})[_0x5645('0x28')](respondWithStatusCode(_0x32e5b0,null))[_0x5645('0x52')](handleError(_0x32e5b0,null));};exports[_0x5645('0xa0')]=function(_0x4ea7c2,_0x9382aa,_0x32f378){var _0x52deb1={};var _0xbc111c={};var _0x48214e;var _0x18f628;return db[_0x5645('0x3b')][_0x5645('0x67')]({'where':{'id':_0x4ea7c2[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x9382aa,null))[_0x5645('0x28')](function(_0x40d04f){if(_0x40d04f){_0x48214e=_0x40d04f;_0xbc111c[_0x5645('0x3f')]=_['keys'](db[_0x5645('0x71')][_0x5645('0x3c')]);_0xbc111c[_0x5645('0x40')]=_[_0x5645('0x41')](_0x4ea7c2['query']);_0xbc111c['filters']=_['intersection'](_0xbc111c[_0x5645('0x3f')],_0xbc111c['query']);_0x52deb1[_0x5645('0x43')]=_[_0x5645('0x44')](_0xbc111c[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x4ea7c2[_0x5645('0x40')][_0x5645('0x45')]));_0x52deb1[_0x5645('0x43')]=_0x52deb1[_0x5645('0x43')][_0x5645('0x46')]?_0x52deb1[_0x5645('0x43')]:_0xbc111c[_0x5645('0x3f')];_0x52deb1[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x4ea7c2[_0x5645('0x40')][_0x5645('0x4a')]);_0x52deb1[_0x5645('0x4b')]=qs[_0x5645('0x42')](_[_0x5645('0x65')](_0x4ea7c2[_0x5645('0x40')],_0xbc111c[_0x5645('0x42')]));if(_0x4ea7c2['query']['filter']){_0x52deb1['where']=_[_0x5645('0x4c')](_0x52deb1[_0x5645('0x4b')],{'$or':_['map'](_0x52deb1[_0x5645('0x43')],function(_0x3db679){var _0x563540={};_0x563540[_0x3db679]={'$like':'%'+_0x4ea7c2[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x563540;})});}_0x52deb1=_['merge']({},_0x52deb1,_0x4ea7c2[_0x5645('0x4e')]);return _0x48214e[_0x5645('0xa0')](_0x52deb1);}})['then'](function(_0x540377){if(_0x540377){_0x18f628=_0x540377[_0x5645('0x46')];if(!_0x4ea7c2[_0x5645('0x40')]['hasOwnProperty'](_0x5645('0x48'))){_0x52deb1[_0x5645('0x49')]=qs[_0x5645('0x49')](_0x4ea7c2[_0x5645('0x40')][_0x5645('0x49')]);_0x52deb1[_0x5645('0x22')]=qs[_0x5645('0x22')](_0x4ea7c2[_0x5645('0x40')]['offset']);}return _0x48214e['getAgents'](_0x52deb1);}})[_0x5645('0x28')](function(_0x392947){if(_0x392947){return _0x392947?{'count':_0x18f628,'rows':_0x392947}:null;}})[_0x5645('0x28')](respondWithResult(_0x9382aa,null))['catch'](handleError(_0x9382aa,null));};exports['getMembers']=function(_0x32fdba,_0x43e15d,_0x281e92){var _0x128177={};var _0x5af566={};var _0x21c667;var _0x1e4e6f;return db['VoiceQueue']['findOne']({'where':{'id':_0x32fdba[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x43e15d,null))[_0x5645('0x28')](function(_0x1a0368){if(_0x1a0368){_0x21c667=_0x1a0368;_0x5af566[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0x81')]['rawAttributes']);_0x5af566[_0x5645('0x40')]=_['keys'](_0x32fdba[_0x5645('0x40')]);_0x5af566[_0x5645('0x42')]=_[_0x5645('0x44')](_0x5af566[_0x5645('0x3f')],_0x5af566[_0x5645('0x40')]);_0x128177[_0x5645('0x43')]=_[_0x5645('0x44')](_0x5af566[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x32fdba[_0x5645('0x40')]['fields']));_0x128177[_0x5645('0x43')]=_0x128177[_0x5645('0x43')][_0x5645('0x46')]?_0x128177[_0x5645('0x43')]:_0x5af566[_0x5645('0x3f')];_0x128177[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x32fdba[_0x5645('0x40')]['sort']);_0x128177['where']=qs[_0x5645('0x42')](_['pick'](_0x32fdba['query'],_0x5af566[_0x5645('0x42')]));if(_0x32fdba[_0x5645('0x40')][_0x5645('0x2f')]){_0x128177[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x128177[_0x5645('0x4b')],{'$or':_['map'](_0x128177[_0x5645('0x43')],function(_0x2af764){var _0xcb2162={};_0xcb2162[_0x2af764]={'$like':'%'+_0x32fdba[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0xcb2162;})});}_0x128177=_['merge']({},_0x128177,_0x32fdba[_0x5645('0x4e')]);return _0x21c667['getMembers'](_0x128177);}})[_0x5645('0x28')](function(_0x1de537){if(_0x1de537){_0x1e4e6f=_0x1de537[_0x5645('0x46')];if(!_0x32fdba[_0x5645('0x40')][_0x5645('0x47')](_0x5645('0x48'))){_0x128177[_0x5645('0x49')]=qs['limit'](_0x32fdba[_0x5645('0x40')][_0x5645('0x49')]);_0x128177['offset']=qs[_0x5645('0x22')](_0x32fdba[_0x5645('0x40')][_0x5645('0x22')]);}return _0x21c667[_0x5645('0xa1')](_0x128177);}})[_0x5645('0x28')](function(_0x4b78a8){return _0x4b78a8?{'count':_0x1e4e6f,'rows':_0x4b78a8}:null;})[_0x5645('0x28')](respondWithResult(_0x43e15d,null))[_0x5645('0x52')](handleError(_0x43e15d,null));};exports[_0x5645('0xa2')]=function(_0x281eb4,_0x2d1567,_0x4eb14e){var _0x4e46e9={};var _0x4ce3f5={};var _0xc94f1;var _0x446ccd;return db[_0x5645('0x3b')][_0x5645('0x67')]({'where':{'id':_0x281eb4[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x2d1567,null))['then'](function(_0xf08a45){if(_0xf08a45){_0xc94f1=_0xf08a45;_0x4ce3f5[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0xa3')][_0x5645('0x3c')]);_0x4ce3f5['query']=_[_0x5645('0x41')](_0x281eb4[_0x5645('0x40')]);_0x4ce3f5[_0x5645('0x42')]=_['intersection'](_0x4ce3f5[_0x5645('0x3f')],_0x4ce3f5[_0x5645('0x40')]);_0x4e46e9[_0x5645('0x43')]=_[_0x5645('0x44')](_0x4ce3f5[_0x5645('0x3f')],qs[_0x5645('0x45')](_0x281eb4[_0x5645('0x40')]['fields']));_0x4e46e9[_0x5645('0x43')]=_0x4e46e9[_0x5645('0x43')][_0x5645('0x46')]?_0x4e46e9[_0x5645('0x43')]:_0x4ce3f5[_0x5645('0x3f')];_0x4e46e9[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x281eb4[_0x5645('0x40')][_0x5645('0x4a')]);_0x4e46e9[_0x5645('0x4b')]=qs[_0x5645('0x42')](_['pick'](_0x281eb4['query'],_0x4ce3f5[_0x5645('0x42')]));if(_0x281eb4['query'][_0x5645('0x2f')]){_0x4e46e9[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x4e46e9['where'],{'$or':_[_0x5645('0x31')](_0x4e46e9[_0x5645('0x43')],function(_0x3f39c6){var _0x442c60={};_0x442c60[_0x3f39c6]={'$like':'%'+_0x281eb4[_0x5645('0x40')]['filter']+'%'};return _0x442c60;})});}_0x4e46e9=_[_0x5645('0x4c')]({},_0x4e46e9,_0x281eb4['options']);return _0xc94f1[_0x5645('0xa2')](_0x4e46e9);}})[_0x5645('0x28')](function(_0x32bad1){if(_0x32bad1){_0x446ccd=_0x32bad1[_0x5645('0x46')];if(!_0x281eb4['query'][_0x5645('0x47')]('nolimit')){_0x4e46e9[_0x5645('0x49')]=qs['limit'](_0x281eb4[_0x5645('0x40')][_0x5645('0x49')]);_0x4e46e9[_0x5645('0x22')]=qs['offset'](_0x281eb4[_0x5645('0x40')][_0x5645('0x22')]);}return _0xc94f1[_0x5645('0xa2')](_0x4e46e9);}})[_0x5645('0x28')](function(_0x39f0c7){if(_0x39f0c7){return _0x39f0c7?{'count':_0x446ccd,'rows':_0x39f0c7}:null;}})[_0x5645('0x28')](respondWithResult(_0x2d1567,null))[_0x5645('0x52')](handleError(_0x2d1567,null));};exports[_0x5645('0xa4')]=function(_0x5cff22,_0x5e8fe6,_0x22b497){var _0x6b3ad6=moment()['format'](_0x5645('0xa5'));var _0x4c9952,_0x420ea1;return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x5cff22[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x5e8fe6,null))['then'](function(_0x28e1cd){if(_0x28e1cd){_0x420ea1=_0x28e1cd;return _0x28e1cd[_0x5645('0xa4')](_0x5cff22[_0x5645('0x57')][_0x5645('0x87')],_[_0x5645('0x5f')](_0x5cff22['body'],[_0x5645('0x87'),'id'])||{});}return null;})[_0x5645('0x9d')](function(_0x4c7272){var _0x3be23b;_0x4c9952=_0x4c7272||[];var _0xed9d38=[];if(_0x4c7272){for(var _0x41a520=0x0;_0x41a520<_0x4c7272['length'];_0x41a520+=0x1){var _0x17b0d5=_0x4c7272[_0x41a520][_0x5645('0x2a')]({'plain':!![]});_0x420ea1[_0x5645('0xa6')]=_0x5cff22[_0x5645('0x57')][_0x5645('0xa6')]?_0x5cff22[_0x5645('0x57')][_0x5645('0xa6')]:_0x420ea1[_0x5645('0xa6')];switch(_0x420ea1[_0x5645('0xa6')]){case _0x5645('0xa7'):_0x3be23b=squel[_0x5645('0xa8')]()[_0x5645('0xa9')](_0x5645('0xaa'))[_0x5645('0xab')]([_0x5645('0xac'),_0x5645('0xad'),_0x5645('0xae'),_0x5645('0xaf'),_0x5645('0x69'),'createdAt',_0x5645('0x61')],squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xac'),_0x5645('0xac'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0xad'))[_0x5645('0x89')]('id','ContactId')[_0x5645('0x89')](_0x17b0d5['CmListId'][_0x5645('0x93')](),'ListId')[_0x5645('0x89')](_0x5cff22[_0x5645('0x54')]['id']['toString'](),_0x5645('0x69'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0x60'))['field']('\x27'+_0x6b3ad6+'\x27',_0x5645('0x61'))[_0x5645('0x8b')](_0x5645('0xb0'))['where'](_0x5645('0xb1'))['where'](_0x5645('0xb2'),_0x17b0d5['CmListId'][_0x5645('0x93')]())['where'](_0x5645('0xb3'))[_0x5645('0x4b')](_0x5645('0xb4'),squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xb5'))[_0x5645('0x8b')](_0x5645('0xb6'))[_0x5645('0x4b')](_0x5645('0x90'),_0x5cff22[_0x5645('0x54')]['id'][_0x5645('0x93')]()))[_0x5645('0x4b')](_0x5645('0xb4'),squel[_0x5645('0x88')]()[_0x5645('0x89')]('COALESCE(phone,\x27\x27)')['from'](_0x5645('0xaa'))[_0x5645('0x4b')](_0x5645('0x90'),_0x5cff22[_0x5645('0x54')]['id'][_0x5645('0x93')]())))['toString']();break;case _0x5645('0xb7'):_0x3be23b=squel[_0x5645('0xa8')]()[_0x5645('0xa9')]('cm_hopper')[_0x5645('0xab')]([_0x5645('0xac'),'scheduledAt',_0x5645('0xae'),_0x5645('0xaf'),_0x5645('0x69'),'createdAt',_0x5645('0x61')],squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xac'),_0x5645('0xac'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0xad'))['field']('id',_0x5645('0xae'))[_0x5645('0x89')](_0x17b0d5[_0x5645('0xb8')][_0x5645('0x93')](),_0x5645('0xaf'))[_0x5645('0x89')](_0x5cff22['params']['id'][_0x5645('0x93')](),'VoiceQueueId')['field']('\x27'+_0x6b3ad6+'\x27','createdAt')['field']('\x27'+_0x6b3ad6+'\x27','updatedAt')['from'](_0x5645('0xb0'))[_0x5645('0x4b')](_0x5645('0xb1'))[_0x5645('0x4b')](_0x5645('0xb2'),_0x17b0d5[_0x5645('0xb8')][_0x5645('0x93')]())[_0x5645('0x4b')](_0x5645('0xb3'))[_0x5645('0x4b')](_0x5645('0xb4'),squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xb9'))[_0x5645('0x8b')]('cm_hopper')[_0x5645('0x4b')](_0x5645('0x90'),_0x5cff22[_0x5645('0x54')]['id'][_0x5645('0x93')]())))[_0x5645('0x93')]();break;default:_0x3be23b=squel[_0x5645('0xa8')]()[_0x5645('0xa9')](_0x5645('0xaa'))[_0x5645('0xab')](['phone',_0x5645('0xad'),_0x5645('0xae'),_0x5645('0xaf'),'VoiceQueueId',_0x5645('0x60'),_0x5645('0x61')],squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xac'),_0x5645('0xac'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0xad'))['field']('id',_0x5645('0xae'))[_0x5645('0x89')](_0x17b0d5[_0x5645('0xb8')][_0x5645('0x93')](),_0x5645('0xaf'))[_0x5645('0x89')](_0x5cff22['params']['id'][_0x5645('0x93')](),_0x5645('0x69'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0x60'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27',_0x5645('0x61'))[_0x5645('0x8b')](_0x5645('0xb0'))[_0x5645('0x4b')]('deletedAt\x20IS\x20NULL')[_0x5645('0x4b')](_0x5645('0xb2'),_0x17b0d5['CmListId'][_0x5645('0x93')]())[_0x5645('0x4b')](_0x5645('0xb3')))[_0x5645('0x93')]();}_0xed9d38[_0x5645('0x92')](db[_0x5645('0x79')][_0x5645('0x40')](_0x3be23b));}return BPromise[_0x5645('0x97')](_0xed9d38);}})[_0x5645('0x28')](function(){var _0x33e3fc=[];var _0x1dfc85=squel[_0x5645('0xa8')]()['into']('cm_hopper_additional_phones')[_0x5645('0xab')]([_0x5645('0xba'),'phone','OrderBy',_0x5645('0x60'),'updatedAt'],squel[_0x5645('0x88')]()[_0x5645('0x89')](_0x5645('0xbb'))[_0x5645('0x89')]('ci.item')['field'](_0x5645('0xbc'))[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27','createdAt')[_0x5645('0x89')]('\x27'+_0x6b3ad6+'\x27','updatedAt')[_0x5645('0x8b')](_0x5645('0xbd'),'ci')[_0x5645('0x8d')]('cm_hopper','h',_0x5645('0xbe'))['where'](_0x5645('0xbf'),_0x6b3ad6)[_0x5645('0x4b')](_0x5645('0xc0'),_0x5645('0xc1')))[_0x5645('0x93')]();_0x33e3fc['push'](db[_0x5645('0x79')][_0x5645('0x40')](_0x1dfc85));return BPromise[_0x5645('0x97')](_0x33e3fc);})[_0x5645('0x28')](function(){return _0x4c9952;})[_0x5645('0x28')](respondWithResult(_0x5e8fe6,null))[_0x5645('0x52')](handleError(_0x5e8fe6,null));};exports[_0x5645('0xc2')]=function(_0x452f56,_0x5c68f8,_0x50175d){return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x452f56[_0x5645('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c68f8,null))[_0x5645('0x28')](function(_0x671db4){if(_0x671db4){return _0x671db4[_0x5645('0xc2')](_0x452f56[_0x5645('0x40')][_0x5645('0x87')]);}})['then'](function(_0x5cef87){if(_0x5cef87){return db[_0x5645('0x63')]['destroy']({'where':{'ListId':_0x452f56['query'][_0x5645('0x87')],'VoiceQueueId':_0x452f56[_0x5645('0x54')]['id']}})[_0x5645('0x28')](function(){return _0x5cef87;});}})[_0x5645('0x28')](respondWithStatusCode(_0x5c68f8,null))[_0x5645('0x52')](handleError(_0x5c68f8,null));};exports['getBlackLists']=function(_0x51899a,_0x2fa084,_0x10a412){var _0x2b54a6={};var _0xaef713={};var _0x4657d5;var _0x4d096d;return db[_0x5645('0x3b')]['findOne']({'where':{'id':_0x51899a['params']['id']}})['then'](handleEntityNotFound(_0x2fa084,null))[_0x5645('0x28')](function(_0x11eeea){if(_0x11eeea){_0x4657d5=_0x11eeea;_0xaef713[_0x5645('0x3f')]=_[_0x5645('0x41')](db[_0x5645('0xa3')]['rawAttributes']);_0xaef713[_0x5645('0x40')]=_[_0x5645('0x41')](_0x51899a[_0x5645('0x40')]);_0xaef713['filters']=_[_0x5645('0x44')](_0xaef713['model'],_0xaef713[_0x5645('0x40')]);_0x2b54a6[_0x5645('0x43')]=_[_0x5645('0x44')](_0xaef713['model'],qs[_0x5645('0x45')](_0x51899a['query'][_0x5645('0x45')]));_0x2b54a6[_0x5645('0x43')]=_0x2b54a6[_0x5645('0x43')][_0x5645('0x46')]?_0x2b54a6['attributes']:_0xaef713[_0x5645('0x3f')];_0x2b54a6[_0x5645('0x64')]=qs[_0x5645('0x4a')](_0x51899a[_0x5645('0x40')][_0x5645('0x4a')]);_0x2b54a6[_0x5645('0x4b')]=qs[_0x5645('0x42')](_[_0x5645('0x65')](_0x51899a['query'],_0xaef713[_0x5645('0x42')]));if(_0x51899a['query']['filter']){_0x2b54a6[_0x5645('0x4b')]=_[_0x5645('0x4c')](_0x2b54a6[_0x5645('0x4b')],{'$or':_[_0x5645('0x31')](_0x2b54a6[_0x5645('0x43')],function(_0x127fb2){var _0x5b5e84={};_0x5b5e84[_0x127fb2]={'$like':'%'+_0x51899a[_0x5645('0x40')][_0x5645('0x2f')]+'%'};return _0x5b5e84;})});}_0x2b54a6=_['merge']({},_0x2b54a6,_0x51899a[_0x5645('0x4e')]);return _0x4657d5[_0x5645('0xc3')](_0x2b54a6);}})[_0x5645('0x28')](function(_0x4c0412){if(_0x4c0412){_0x4d096d=_0x4c0412[_0x5645('0x46')];if(!_0x51899a['query']['hasOwnProperty'](_0x5645('0x48'))){_0x2b54a6[_0x5645('0x49')]=qs['limit'](_0x51899a['query'][_0x5645('0x49')]);_0x2b54a6[_0x5645('0x22')]=qs['offset'](_0x51899a[_0x5645('0x40')][_0x5645('0x22')]);}return _0x4657d5[_0x5645('0xc3')](_0x2b54a6);}})[_0x5645('0x28')](function(_0x158798){if(_0x158798){return _0x158798?{'count':_0x4d096d,'rows':_0x158798}:null;}})[_0x5645('0x28')](respondWithResult(_0x2fa084,null))['catch'](handleError(_0x2fa084,null));};exports[_0x5645('0xc4')]=function(_0x2bf17f,_0x35dc4c,_0x3d0f32){var _0xa66a30,_0x6b1d9f;return db[_0x5645('0x3b')]['find']({'where':{'id':_0x2bf17f['params']['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x35dc4c,null))['then'](function(_0x1eba53){if(_0x1eba53){_0x6b1d9f=_0x1eba53;return _0x1eba53[_0x5645('0xc4')](_0x2bf17f[_0x5645('0x57')][_0x5645('0x87')],_[_0x5645('0x5f')](_0x2bf17f[_0x5645('0x57')],[_0x5645('0x87'),'id'])||{});}return null;})['spread'](function(_0x225d1a){var _0x2254db;_0xa66a30=_0x225d1a||[];var _0x206453=[];if(_0x225d1a){for(var _0x384fc2=0x0;_0x384fc2<_0x225d1a['length'];_0x384fc2+=0x1){var _0x59bf17=_0x225d1a[_0x384fc2]['get']({'plain':!![]});_0x2254db=squel[_0x5645('0xa8')]()[_0x5645('0xa9')]('cm_hopper_black')[_0x5645('0xab')]([_0x5645('0xac'),'ContactId',_0x5645('0xaf'),_0x5645('0x69'),_0x5645('0x60'),_0x5645('0x61')],squel[_0x5645('0x88')]()[_0x5645('0x89')]('phone',_0x5645('0xac'))[_0x5645('0x89')]('id','ContactId')[_0x5645('0x89')](_0x59bf17[_0x5645('0xb8')][_0x5645('0x93')](),_0x5645('0xaf'))[_0x5645('0x89')](_0x2bf17f[_0x5645('0x54')]['id']['toString'](),_0x5645('0x69'))['field']('NOW()',_0x5645('0x60'))[_0x5645('0x89')](_0x5645('0xc5'),_0x5645('0x61'))[_0x5645('0x8b')](_0x5645('0xb0'))[_0x5645('0x4b')](_0x5645('0xb1'))['where'](_0x5645('0xb2'),_0x59bf17[_0x5645('0xb8')]['toString']())[_0x5645('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x5645('0x93')]();_0x206453['push'](db[_0x5645('0x79')][_0x5645('0x40')](_0x2254db));}return BPromise[_0x5645('0x97')](_0x206453);}})[_0x5645('0x28')](function(){return _0xa66a30;})[_0x5645('0x28')](respondWithResult(_0x35dc4c,null))['catch'](handleError(_0x35dc4c,null));};exports['removeBlackLists']=function(_0x2de475,_0x279c48,_0x1505c9){return db[_0x5645('0x3b')][_0x5645('0x35')]({'where':{'id':_0x2de475[_0x5645('0x54')]['id']}})[_0x5645('0x28')](handleEntityNotFound(_0x279c48,null))[_0x5645('0x28')](function(_0xf030e9){if(_0xf030e9){return _0xf030e9[_0x5645('0xc6')](_0x2de475['query']['ids']);}})[_0x5645('0x28')](function(_0x3e5076){if(_0x3e5076){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2de475['query'][_0x5645('0x87')],'VoiceQueueId':_0x2de475[_0x5645('0x54')]['id']}})[_0x5645('0x28')](function(){return _0x3e5076;});}})['then'](respondWithStatusCode(_0x279c48,null))['catch'](handleError(_0x279c48,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 754a9b3..62ae9d0 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 _0xd9b6=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd9b6,0x193));var _0x6d9b=function(_0x15cc17,_0x5a498d){_0x15cc17=_0x15cc17-0x0;var _0x9607cc=_0xd9b6[_0x15cc17];return _0x9607cc;};'use strict';var EventEmitter=require(_0x6d9b('0x0'));var VoiceQueue=require(_0x6d9b('0x1'))['db'][_0x6d9b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6d9b('0x3')](0x0);var events={'afterCreate':_0x6d9b('0x4'),'afterUpdate':_0x6d9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48512f){return function(_0x3592c9,_0x46dfef,_0x22a086){VoiceQueueEvents[_0x6d9b('0x6')](_0x48512f+':'+_0x3592c9['id'],_0x3592c9);VoiceQueueEvents[_0x6d9b('0x6')](_0x48512f,_0x3592c9);_0x22a086(null);};}for(var e in events){if(events[_0x6d9b('0x7')](e)){var event=events[e];VoiceQueue[_0x6d9b('0x8')](e,emitEvent(event));}}module[_0x6d9b('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x67cb=['hasOwnProperty','exports','../../mysqldb','remove','emit'];(function(_0x5477c0,_0x144d50){var _0x4e62ab=function(_0x3cc578){while(--_0x3cc578){_0x5477c0['push'](_0x5477c0['shift']());}};_0x4e62ab(++_0x144d50);}(_0x67cb,0x12e));var _0xb67c=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x67cb[_0x22b68a];return _0x1ac67a;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xb67c('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb67c('0x1')};function emitEvent(_0xb17c70){return function(_0x6eb18d,_0x182ec8,_0x3f03cf){VoiceQueueEvents[_0xb67c('0x2')](_0xb17c70+':'+_0x6eb18d['id'],_0x6eb18d);VoiceQueueEvents[_0xb67c('0x2')](_0xb17c70,_0x6eb18d);_0x3f03cf(null);};}for(var e in events){if(events[_0xb67c('0x3')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xb67c('0x4')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 73bcaee..8e8ecfa 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(_0x7ea297,_0x1e25e7){var _0x2288fb=function(_0x161e05){while(--_0x161e05){_0x7ea297['push'](_0x7ea297['shift']());}};_0x2288fb(++_0x1e25e7);}(_0xedd9,0xfc));var _0x9edd=function(_0x12bb8b,_0x204d03){_0x12bb8b=_0x12bb8b-0x0;var _0x58c9f3=_0xedd9[_0x12bb8b];return _0x58c9f3;};'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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x55ca,0x126));var _0xa55c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x55ca[_0x3fba9f];return _0x192cf1;};'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')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index f177016..dad63bc 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 _0x2157=['map','model','ShowVoiceQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0x2157,0x82));var _0x7215=function(_0x562244,_0x59072a){_0x562244=_0x562244-0x0;var _0x1785d0=_0x2157[_0x562244];return _0x1785d0;};'use strict';var _=require(_0x7215('0x0'));var util=require(_0x7215('0x1'));var moment=require(_0x7215('0x2'));var BPromise=require('bluebird');var rs=require(_0x7215('0x3'));var fs=require('fs');var Redis=require(_0x7215('0x4'));var db=require(_0x7215('0x5'))['db'];var utils=require(_0x7215('0x6'));var logger=require(_0x7215('0x7'))(_0x7215('0x8'));var config=require(_0x7215('0x9'));var jayson=require(_0x7215('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7215('0xb')](config[_0x7215('0xc')],{'host':_0x7215('0xd'),'port':0x18eb});var socket=require(_0x7215('0xe'))(new Redis(config['redis']));require(_0x7215('0xf'))[_0x7215('0x10')](socket);function respondWithRpcPromise(_0x2ab838,_0x3e3b89,_0x455b28){return new BPromise(function(_0x52f88e,_0x3139fc){return client[_0x7215('0x11')](_0x2ab838,_0x455b28)[_0x7215('0x12')](function(_0x5bf45b){logger[_0x7215('0x13')](_0x7215('0x14'),_0x3e3b89,_0x7215('0x15'));logger[_0x7215('0x16')](_0x7215('0x17'),_0x3e3b89,_0x7215('0x15'),JSON[_0x7215('0x18')](_0x5bf45b));if(_0x5bf45b['error']){if(_0x5bf45b[_0x7215('0x19')][_0x7215('0x1a')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3e3b89,_0x5bf45b[_0x7215('0x19')]['message']);return _0x3139fc(_0x5bf45b[_0x7215('0x19')][_0x7215('0x1b')]);}logger['error'](_0x7215('0x14'),_0x3e3b89,_0x5bf45b['error']['message']);return _0x52f88e(_0x5bf45b[_0x7215('0x19')][_0x7215('0x1b')]);}else{logger[_0x7215('0x13')](_0x7215('0x14'),_0x3e3b89,'request\x20sent');_0x52f88e(_0x5bf45b[_0x7215('0x1c')][_0x7215('0x1b')]);}})[_0x7215('0x1d')](function(_0x532e11){logger[_0x7215('0x19')](_0x7215('0x14'),_0x3e3b89,_0x532e11);_0x3139fc(_0x532e11);});});}exports[_0x7215('0x1e')]=function(_0x1bcf50){var _0x12935b=this;return new Promise(function(_0xdb2519,_0x156d2f){return db[_0x7215('0x1f')]['findAll']({'raw':_0x1bcf50[_0x7215('0x20')]?_0x1bcf50['options'][_0x7215('0x21')]===undefined?!![]:![]:!![],'where':_0x1bcf50['options']?_0x1bcf50[_0x7215('0x20')][_0x7215('0x22')]||null:null,'attributes':_0x1bcf50['options']?_0x1bcf50[_0x7215('0x20')][_0x7215('0x23')]||null:null,'limit':_0x1bcf50[_0x7215('0x20')]?_0x1bcf50['options'][_0x7215('0x24')]||null:null,'include':_0x1bcf50[_0x7215('0x20')]?_0x1bcf50[_0x7215('0x20')][_0x7215('0x25')]?_[_0x7215('0x26')](_0x1bcf50[_0x7215('0x20')]['include'],function(_0x1cfe85){return{'model':db[_0x1cfe85[_0x7215('0x27')]],'as':_0x1cfe85['as'],'attributes':_0x1cfe85[_0x7215('0x23')],'include':_0x1cfe85[_0x7215('0x25')]?_[_0x7215('0x26')](_0x1cfe85[_0x7215('0x25')],function(_0x15edae){return{'model':db[_0x15edae[_0x7215('0x27')]],'as':_0x15edae['as'],'attributes':_0x15edae[_0x7215('0x23')],'include':_0x15edae[_0x7215('0x25')]?_['map'](_0x15edae['include'],function(_0x254965){return{'model':db[_0x254965[_0x7215('0x27')]],'as':_0x254965['as'],'attributes':_0x254965[_0x7215('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7215('0x12')](function(_0x12dee3){logger[_0x7215('0x13')](_0x7215('0x1e'),_0x1bcf50);logger[_0x7215('0x16')](_0x7215('0x1e'),_0x1bcf50,JSON[_0x7215('0x18')](_0x12dee3));_0xdb2519(_0x12dee3);})[_0x7215('0x1d')](function(_0x19e749){logger[_0x7215('0x19')](_0x7215('0x1e'),_0x19e749['message'],_0x1bcf50);_0x156d2f(_0x12935b['error'](0x1f4,_0x19e749[_0x7215('0x1b')]));});});};exports[_0x7215('0x28')]=function(_0x3fa621){var _0x3bf207=this;return new Promise(function(_0x1f146c,_0x1184ad){return db['VoiceQueue'][_0x7215('0x29')]({'raw':_0x3fa621[_0x7215('0x20')]?_0x3fa621[_0x7215('0x20')][_0x7215('0x21')]===undefined?!![]:![]:!![],'where':_0x3fa621['options']?_0x3fa621[_0x7215('0x20')][_0x7215('0x22')]||null:null,'attributes':_0x3fa621[_0x7215('0x20')]?_0x3fa621[_0x7215('0x20')][_0x7215('0x23')]||null:null,'include':_0x3fa621['options']?_0x3fa621[_0x7215('0x20')][_0x7215('0x25')]?_['map'](_0x3fa621[_0x7215('0x20')][_0x7215('0x25')],function(_0x116e0e){return{'model':db[_0x116e0e[_0x7215('0x27')]],'as':_0x116e0e['as'],'attributes':_0x116e0e[_0x7215('0x23')],'include':_0x116e0e[_0x7215('0x25')]?_[_0x7215('0x26')](_0x116e0e[_0x7215('0x25')],function(_0x37b802){return{'model':db[_0x37b802[_0x7215('0x27')]],'as':_0x37b802['as'],'attributes':_0x37b802['attributes'],'include':_0x37b802[_0x7215('0x25')]?_['map'](_0x37b802[_0x7215('0x25')],function(_0x50c67f){return{'model':db[_0x50c67f[_0x7215('0x27')]],'as':_0x50c67f['as'],'attributes':_0x50c67f[_0x7215('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7215('0x12')](function(_0x508513){logger[_0x7215('0x13')]('ShowVoiceQueue',_0x3fa621);logger[_0x7215('0x16')](_0x7215('0x28'),_0x3fa621,JSON[_0x7215('0x18')](_0x508513));_0x1f146c(_0x508513);})['catch'](function(_0xf3cf57){logger['error'](_0x7215('0x28'),_0xf3cf57[_0x7215('0x1b')],_0x3fa621);_0x1184ad(_0x3bf207[_0x7215('0x19')](0x1f4,_0xf3cf57[_0x7215('0x1b')]));});});}; \ No newline at end of file +var _0x98c6=['limit','include','map','model','where','ShowVoiceQueue','bluebird','rpc','client','http','redis','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes'];(function(_0x5d869e,_0x1731bd){var _0x13a90b=function(_0x21719e){while(--_0x21719e){_0x5d869e['push'](_0x5d869e['shift']());}};_0x13a90b(++_0x1731bd);}(_0x98c6,0xf6));var _0x698c=function(_0x3e388a,_0x42cbd6){_0x3e388a=_0x3e388a-0x0;var _0x54055f=_0x98c6[_0x3e388a];return _0x54055f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x698c('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x698c('0x1'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x698c('0x2')][_0x698c('0x3')]({'port':0x232a});config[_0x698c('0x4')]=_['defaults'](config[_0x698c('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x698c('0x5'))(new Redis(config[_0x698c('0x4')]));require(_0x698c('0x6'))['register'](socket);function respondWithRpcPromise(_0x4fdbec,_0x2bb16c,_0x20181e){return new BPromise(function(_0x464d3b,_0x49089f){return client[_0x698c('0x7')](_0x4fdbec,_0x20181e)[_0x698c('0x8')](function(_0x692d79){logger[_0x698c('0x9')](_0x698c('0xa'),_0x2bb16c,_0x698c('0xb'));logger[_0x698c('0xc')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2bb16c,_0x698c('0xb'),JSON[_0x698c('0xd')](_0x692d79));if(_0x692d79[_0x698c('0xe')]){if(_0x692d79[_0x698c('0xe')][_0x698c('0xf')]===0x1f4){logger[_0x698c('0xe')](_0x698c('0xa'),_0x2bb16c,_0x692d79['error'][_0x698c('0x10')]);return _0x49089f(_0x692d79[_0x698c('0xe')][_0x698c('0x10')]);}logger['error'](_0x698c('0xa'),_0x2bb16c,_0x692d79[_0x698c('0xe')][_0x698c('0x10')]);return _0x464d3b(_0x692d79[_0x698c('0xe')]['message']);}else{logger[_0x698c('0x9')](_0x698c('0xa'),_0x2bb16c,_0x698c('0xb'));_0x464d3b(_0x692d79[_0x698c('0x11')][_0x698c('0x10')]);}})[_0x698c('0x12')](function(_0x161678){logger[_0x698c('0xe')](_0x698c('0xa'),_0x2bb16c,_0x161678);_0x49089f(_0x161678);});});}exports[_0x698c('0x13')]=function(_0x267708){var _0x4a7602=this;return new Promise(function(_0x53562b,_0x3ab52f){return db[_0x698c('0x14')]['findAll']({'raw':_0x267708[_0x698c('0x15')]?_0x267708[_0x698c('0x15')][_0x698c('0x16')]===undefined?!![]:![]:!![],'where':_0x267708['options']?_0x267708[_0x698c('0x15')]['where']||null:null,'attributes':_0x267708[_0x698c('0x15')]?_0x267708[_0x698c('0x15')][_0x698c('0x17')]||null:null,'limit':_0x267708[_0x698c('0x15')]?_0x267708[_0x698c('0x15')][_0x698c('0x18')]||null:null,'include':_0x267708[_0x698c('0x15')]?_0x267708[_0x698c('0x15')][_0x698c('0x19')]?_[_0x698c('0x1a')](_0x267708[_0x698c('0x15')][_0x698c('0x19')],function(_0x2e9404){return{'model':db[_0x2e9404[_0x698c('0x1b')]],'as':_0x2e9404['as'],'attributes':_0x2e9404[_0x698c('0x17')],'include':_0x2e9404[_0x698c('0x19')]?_[_0x698c('0x1a')](_0x2e9404[_0x698c('0x19')],function(_0x3b869a){return{'model':db[_0x3b869a[_0x698c('0x1b')]],'as':_0x3b869a['as'],'attributes':_0x3b869a['attributes'],'include':_0x3b869a[_0x698c('0x19')]?_[_0x698c('0x1a')](_0x3b869a[_0x698c('0x19')],function(_0x1ec397){return{'model':db[_0x1ec397[_0x698c('0x1b')]],'as':_0x1ec397['as'],'attributes':_0x1ec397['attributes']};}):[]};}):[]};}):[]:[]})[_0x698c('0x8')](function(_0x1bf1cf){logger[_0x698c('0x9')](_0x698c('0x13'),_0x267708);logger[_0x698c('0xc')](_0x698c('0x13'),_0x267708,JSON['stringify'](_0x1bf1cf));_0x53562b(_0x1bf1cf);})[_0x698c('0x12')](function(_0x400de0){logger[_0x698c('0xe')]('GetVoiceQueue',_0x400de0[_0x698c('0x10')],_0x267708);_0x3ab52f(_0x4a7602[_0x698c('0xe')](0x1f4,_0x400de0[_0x698c('0x10')]));});});};exports['ShowVoiceQueue']=function(_0x4ecc7e){var _0x5848de=this;return new Promise(function(_0x5673a8,_0xf7e43a){return db[_0x698c('0x14')]['find']({'raw':_0x4ecc7e['options']?_0x4ecc7e[_0x698c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4ecc7e[_0x698c('0x15')]?_0x4ecc7e[_0x698c('0x15')][_0x698c('0x1c')]||null:null,'attributes':_0x4ecc7e['options']?_0x4ecc7e[_0x698c('0x15')][_0x698c('0x17')]||null:null,'include':_0x4ecc7e['options']?_0x4ecc7e[_0x698c('0x15')][_0x698c('0x19')]?_[_0x698c('0x1a')](_0x4ecc7e['options']['include'],function(_0x1a1f3c){return{'model':db[_0x1a1f3c['model']],'as':_0x1a1f3c['as'],'attributes':_0x1a1f3c['attributes'],'include':_0x1a1f3c['include']?_['map'](_0x1a1f3c[_0x698c('0x19')],function(_0x51d5bc){return{'model':db[_0x51d5bc['model']],'as':_0x51d5bc['as'],'attributes':_0x51d5bc['attributes'],'include':_0x51d5bc[_0x698c('0x19')]?_[_0x698c('0x1a')](_0x51d5bc[_0x698c('0x19')],function(_0x26bc44){return{'model':db[_0x26bc44[_0x698c('0x1b')]],'as':_0x26bc44['as'],'attributes':_0x26bc44[_0x698c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x698c('0x8')](function(_0xd025aa){logger[_0x698c('0x9')]('ShowVoiceQueue',_0x4ecc7e);logger[_0x698c('0xc')](_0x698c('0x1d'),_0x4ecc7e,JSON[_0x698c('0xd')](_0xd025aa));_0x5673a8(_0xd025aa);})[_0x698c('0x12')](function(_0x4ab025){logger['error']('ShowVoiceQueue',_0x4ab025[_0x698c('0x10')],_0x4ecc7e);_0xf7e43a(_0x5848de[_0x698c('0xe')](0x1f4,_0x4ab025[_0x698c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1b59121..2495296 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 _0x73fd=['emit','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x5b23bb,_0xdfb512){var _0x1996d7=function(_0x3badd4){while(--_0x3badd4){_0x5b23bb['push'](_0x5b23bb['shift']());}};_0x1996d7(++_0xdfb512);}(_0x73fd,0xca));var _0xd73f=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x73fd[_0x38e177];return _0x1faf15;};'use strict';var VoiceQueueEvents=require(_0xd73f('0x0'));var events=['save',_0xd73f('0x1'),_0xd73f('0x2')];function createListener(_0x4e8ae0,_0x33b122){return function(_0x3c99e8){_0x33b122[_0xd73f('0x3')](_0x4e8ae0,_0x3c99e8);};}function removeListener(_0x55e777,_0x57352d){return function(){VoiceQueueEvents['removeListener'](_0x55e777,_0x57352d);};}exports['register']=function(_0x34b3e6){for(var _0x40fc17=0x0,_0x65cab7=events['length'];_0x40fc17<_0x65cab7;_0x40fc17++){var _0x188574=events[_0x40fc17];var _0x2e0677=createListener(_0xd73f('0x4')+_0x188574,_0x34b3e6);VoiceQueueEvents['on'](_0x188574,_0x2e0677);}}; \ No newline at end of file +var _0x2368=['register','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x200899,_0x338372){var _0x34012b=function(_0x431687){while(--_0x431687){_0x200899['push'](_0x200899['shift']());}};_0x34012b(++_0x338372);}(_0x2368,0xa2));var _0x8236=function(_0x145d70,_0x18f12c){_0x145d70=_0x145d70-0x0;var _0x396c5b=_0x2368[_0x145d70];return _0x396c5b;};'use strict';var VoiceQueueEvents=require(_0x8236('0x0'));var events=[_0x8236('0x1'),_0x8236('0x2'),_0x8236('0x3')];function createListener(_0x5c67b5,_0xd788c5){return function(_0x5978e2){_0xd788c5[_0x8236('0x4')](_0x5c67b5,_0x5978e2);};}function removeListener(_0x119063,_0x4ae05a){return function(){VoiceQueueEvents[_0x8236('0x5')](_0x119063,_0x4ae05a);};}exports[_0x8236('0x6')]=function(_0x284f6a){for(var _0xa87977=0x0,_0x50f551=events['length'];_0xa87977<_0x50f551;_0xa87977++){var _0x2e4343=events[_0xa87977];var _0x6834a9=createListener(_0x8236('0x7')+_0x2e4343,_0x284f6a);VoiceQueueEvents['on'](_0x2e4343,_0x6834a9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index a88c44d..f29cc45 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 _0xd994=['/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','/describe','isAuthenticated','get','/index','getVoiceQueuesReport'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd994,0xd6));var _0x4d99=function(_0x4dbe8c,_0x320bd){_0x4dbe8c=_0x4dbe8c-0x0;var _0x237c4a=_0xd994[_0x4dbe8c];return _0x237c4a;};'use strict';var multer=require(_0x4d99('0x0'));var util=require(_0x4d99('0x1'));var path=require(_0x4d99('0x2'));var timeout=require(_0x4d99('0x3'));var express=require('express');var router=express[_0x4d99('0x4')]();var fs_extra=require(_0x4d99('0x5'));var auth=require(_0x4d99('0x6'));var interaction=require(_0x4d99('0x7'));var config=require(_0x4d99('0x8'));var controller=require(_0x4d99('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4d99('0xa')]);router['get'](_0x4d99('0xb'),auth[_0x4d99('0xc')](),controller['describe']);router[_0x4d99('0xd')](_0x4d99('0xe'),auth['isAuthenticated'](),controller[_0x4d99('0xf')]);router[_0x4d99('0xd')](_0x4d99('0x10'),auth[_0x4d99('0xc')](),controller['show']);router[_0x4d99('0x11')]('/',auth[_0x4d99('0xc')](),controller[_0x4d99('0x12')]);router['put'](_0x4d99('0x10'),auth[_0x4d99('0xc')](),controller[_0x4d99('0x13')]);router[_0x4d99('0x14')](_0x4d99('0x10'),auth[_0x4d99('0xc')](),controller[_0x4d99('0x15')]);module[_0x4d99('0x16')]=router; \ No newline at end of file +var _0xd5d6=['get','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x79509f,_0x597b4c){var _0x52d259=function(_0x57da96){while(--_0x57da96){_0x79509f['push'](_0x79509f['shift']());}};_0x52d259(++_0x597b4c);}(_0xd5d6,0x115));var _0x6d5d=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd5d6[_0x494d1f];return _0x457b6e;};'use strict';var multer=require(_0x6d5d('0x0'));var util=require(_0x6d5d('0x1'));var path=require(_0x6d5d('0x2'));var timeout=require(_0x6d5d('0x3'));var express=require(_0x6d5d('0x4'));var router=express[_0x6d5d('0x5')]();var fs_extra=require(_0x6d5d('0x6'));var auth=require(_0x6d5d('0x7'));var interaction=require(_0x6d5d('0x8'));var config=require(_0x6d5d('0x9'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6d5d('0xa')]);router[_0x6d5d('0xb')](_0x6d5d('0xc'),auth['isAuthenticated'](),controller[_0x6d5d('0xd')]);router['get'](_0x6d5d('0xe'),auth[_0x6d5d('0xf')](),controller[_0x6d5d('0x10')]);router[_0x6d5d('0xb')](_0x6d5d('0x11'),auth[_0x6d5d('0xf')](),controller[_0x6d5d('0x12')]);router[_0x6d5d('0x13')]('/',auth['isAuthenticated'](),controller[_0x6d5d('0x14')]);router['put'](_0x6d5d('0x11'),auth[_0x6d5d('0xf')](),controller[_0x6d5d('0x15')]);router[_0x6d5d('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6d5d('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 1170b1c..0b86e54 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 _0x1116=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x1349bc,_0x1f6a23){var _0x41d28e=function(_0x1e3ca4){while(--_0x1e3ca4){_0x1349bc['push'](_0x1349bc['shift']());}};_0x41d28e(++_0x1f6a23);}(_0x1116,0x132));var _0x6111=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x1116[_0x25248b];return _0x509939;};'use strict';var Sequelize=require(_0x6111('0x0'));var moment=require('moment');module[_0x6111('0x1')]={'type':{'type':Sequelize[_0x6111('0x2')]},'uniqueid':{'type':Sequelize[_0x6111('0x2')]},'calleridnum':{'type':Sequelize[_0x6111('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6111('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x6111('0x3')],'set':function(_0x42b484){var _0x3e4c70=moment(_0x42b484);var _0x583ae5=moment(this[_0x6111('0x4')](_0x6111('0x5')))[_0x6111('0x6')](_0x6111('0x7'));var _0x4d1a96=_0x3e4c70[_0x6111('0x8')](_0x583ae5,_0x6111('0x9'));this[_0x6111('0xa')](_0x6111('0xb'),_0x42b484);this[_0x6111('0xa')](_0x6111('0xc'),_0x4d1a96||null);}},'position':{'type':Sequelize[_0x6111('0xd')]},'count':{'type':Sequelize[_0x6111('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6111('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6111('0x3')]},'queuecallerexit':{'type':Sequelize[_0x6111('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6111('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x6111('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x6111('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6111('0x2')]},'connectedlinename':{'type':Sequelize[_0x6111('0x2')]},'accountcode':{'type':Sequelize[_0x6111('0x2')]},'context':{'type':Sequelize[_0x6111('0x2')]},'exten':{'type':Sequelize[_0x6111('0x2')]},'priority':{'type':Sequelize[_0x6111('0x2')]},'holdtime':{'type':Sequelize[_0x6111('0xd')]},'mohtime':{'type':Sequelize[_0x6111('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6111('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6111('0x2')]},'transfer':{'type':Sequelize[_0x6111('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6111('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x6111('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6111('0x2')]},'secondDisposition':{'type':Sequelize[_0x6111('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6111('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x6111('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa3d3=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa3d3,0x13a));var _0x3a3d=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xa3d3[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3a3d('0x0'));module[_0x3a3d('0x1')]={'type':{'type':Sequelize[_0x3a3d('0x2')]},'uniqueid':{'type':Sequelize[_0x3a3d('0x2')]},'calleridnum':{'type':Sequelize[_0x3a3d('0x2')]},'calleridname':{'type':Sequelize[_0x3a3d('0x2')]},'queue':{'type':Sequelize[_0x3a3d('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3a3d('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3a3d('0x3')],'set':function(_0x1288d3){var _0xcc3033=moment(_0x1288d3);var _0x6a1f3d=moment(this[_0x3a3d('0x4')](_0x3a3d('0x5')))[_0x3a3d('0x6')](_0x3a3d('0x7'));var _0x207280=_0xcc3033[_0x3a3d('0x8')](_0x6a1f3d,_0x3a3d('0x9'));this[_0x3a3d('0xa')](_0x3a3d('0xb'),_0x1288d3);this[_0x3a3d('0xa')](_0x3a3d('0xc'),_0x207280||null);}},'position':{'type':Sequelize[_0x3a3d('0xd')]},'count':{'type':Sequelize[_0x3a3d('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3a3d('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3a3d('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3a3d('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3a3d('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3a3d('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3a3d('0xd')]},'channel':{'type':Sequelize[_0x3a3d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3a3d('0x2')]},'connectedlinename':{'type':Sequelize[_0x3a3d('0x2')]},'accountcode':{'type':Sequelize[_0x3a3d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3a3d('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x3a3d('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3a3d('0x2')]},'transfer':{'type':Sequelize[_0x3a3d('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3a3d('0x2')],'comment':_0x3a3d('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3a3d('0x2')]},'disposition':{'type':Sequelize[_0x3a3d('0x2')]},'secondDisposition':{'type':Sequelize[_0x3a3d('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3a3d('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 3e66b39..5f416c8 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 _0x426e=['redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','destroy','then','end','error','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','sort','where','pick','merge','filter','options','include','show','params','includeAll','find','catch','create','body','describe','getVoiceQueuesReport','hasOwnProperty','nolimit','order','rows','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0x426e,0x86));var _0xe426=function(_0x519d1c,_0x1935a2){_0x519d1c=_0x519d1c-0x0;var _0x1662e4=_0x426e[_0x519d1c];return _0x1662e4;};'use strict';var emlformat=require(_0xe426('0x0'));var rimraf=require(_0xe426('0x1'));var zipdir=require(_0xe426('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe426('0x3'));var moment=require(_0xe426('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe426('0x5'));var util=require(_0xe426('0x6'));var path=require(_0xe426('0x7'));var sox=require('sox');var csv=require(_0xe426('0x8'));var ejs=require(_0xe426('0x9'));var fs=require('fs');var fs_extra=require(_0xe426('0xa'));var _=require('lodash');var squel=require(_0xe426('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe426('0xc'));var toCsv=require(_0xe426('0x8'));var querystring=require('querystring');var Papa=require(_0xe426('0xd'));var Redis=require(_0xe426('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe426('0xf'));var as=require(_0xe426('0x10'));var hardwareService=require(_0xe426('0x11'));var logger=require(_0xe426('0x12'))(_0xe426('0x13'));var utils=require(_0xe426('0x14'));var config=require(_0xe426('0x15'));var licenseUtil=require(_0xe426('0x16'));var db=require(_0xe426('0x17'))['db'];config[_0xe426('0x18')]=_[_0xe426('0x19')](config[_0xe426('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe426('0x1a'))[_0xe426('0x1b')](socket);function respondWithStatusCode(_0x3a8f5e,_0x18a2b9){_0x18a2b9=_0x18a2b9||0xcc;return function(_0x291947){if(_0x291947){return _0x3a8f5e[_0xe426('0x1c')](_0x18a2b9);}return _0x3a8f5e[_0xe426('0x1d')](_0x18a2b9)['end']();};}function respondWithResult(_0x2a9ddf,_0x599bb2){_0x599bb2=_0x599bb2||0xc8;return function(_0x4e02bc){if(_0x4e02bc){return _0x2a9ddf[_0xe426('0x1d')](_0x599bb2)[_0xe426('0x1e')](_0x4e02bc);}};}function respondWithFilteredResult(_0x152eed,_0x3f8bb3){return function(_0x15dbff){if(_0x15dbff){var _0x421a61=typeof _0x3f8bb3[_0xe426('0x1f')]==='undefined'&&typeof _0x3f8bb3[_0xe426('0x20')]===_0xe426('0x21');var _0x4be106=_0x15dbff[_0xe426('0x22')];var _0x3757a2=_0x421a61?0x0:_0x3f8bb3[_0xe426('0x1f')];var _0x28be79=_0x421a61?_0x15dbff[_0xe426('0x22')]:_0x3f8bb3['offset']+_0x3f8bb3[_0xe426('0x20')];var _0x252626;if(_0x28be79>=_0x4be106){_0x28be79=_0x4be106;_0x252626=0xc8;}else{_0x252626=0xce;}_0x152eed['status'](_0x252626);return _0x152eed[_0xe426('0x23')]('Content-Range',_0x3757a2+'-'+_0x28be79+'/'+_0x4be106)['json'](_0x15dbff);}return null;};}function patchUpdates(_0x346219){return function(_0x2933fc){try{jsonpatch[_0xe426('0x24')](_0x2933fc,_0x346219,!![]);}catch(_0x55571f){return BPromise['reject'](_0x55571f);}return _0x2933fc[_0xe426('0x25')]();};}function saveUpdates(_0x531bef,_0x4da178){return function(_0x3cd436){if(_0x3cd436){return _0x3cd436[_0xe426('0x26')](_0x531bef)['then'](function(_0x1ce9ec){return _0x1ce9ec;});}return null;};}function removeEntity(_0x24b411,_0x5651ad){return function(_0x2a70e8){if(_0x2a70e8){return _0x2a70e8[_0xe426('0x27')]()[_0xe426('0x28')](function(){_0x24b411['status'](0xcc)[_0xe426('0x29')]();});}};}function handleEntityNotFound(_0x4417db,_0x57da25){return function(_0x312407){if(!_0x312407){_0x4417db['sendStatus'](0x194);}return _0x312407;};}function handleError(_0x138635,_0x59fbc4){_0x59fbc4=_0x59fbc4||0x1f4;return function(_0x293f81){logger[_0xe426('0x2a')](_0x293f81['stack']);if(_0x293f81[_0xe426('0x2b')]){delete _0x293f81[_0xe426('0x2b')];}_0x138635['status'](_0x59fbc4)[_0xe426('0x2c')](_0x293f81);};}exports['index']=function(_0x1b5593,_0x339911){var _0x37cb52={},_0x1f3f04={},_0x53d438={'count':0x0,'rows':[]};var _0x32081e=_['map'](db[_0xe426('0x2d')][_0xe426('0x2e')],function(_0x5e2290){return{'name':_0x5e2290[_0xe426('0x2f')],'type':_0x5e2290[_0xe426('0x30')][_0xe426('0x31')]};});_0x1f3f04['model']=_[_0xe426('0x32')](_0x32081e,'name');_0x1f3f04[_0xe426('0x33')]=_[_0xe426('0x34')](_0x1b5593[_0xe426('0x33')]);_0x1f3f04[_0xe426('0x35')]=_[_0xe426('0x36')](_0x1f3f04[_0xe426('0x37')],_0x1f3f04[_0xe426('0x33')]);_0x37cb52['attributes']=_[_0xe426('0x36')](_0x1f3f04[_0xe426('0x37')],qs['fields'](_0x1b5593['query'][_0xe426('0x38')]));_0x37cb52['attributes']=_0x37cb52[_0xe426('0x39')][_0xe426('0x3a')]?_0x37cb52['attributes']:_0x1f3f04['model'];if(!_0x1b5593['query']['hasOwnProperty']('nolimit')){_0x37cb52[_0xe426('0x20')]=qs[_0xe426('0x20')](_0x1b5593[_0xe426('0x33')][_0xe426('0x20')]);_0x37cb52[_0xe426('0x1f')]=qs['offset'](_0x1b5593['query'][_0xe426('0x1f')]);}_0x37cb52['order']=qs[_0xe426('0x3b')](_0x1b5593['query'][_0xe426('0x3b')]);_0x37cb52[_0xe426('0x3c')]=qs['filters'](_[_0xe426('0x3d')](_0x1b5593[_0xe426('0x33')],_0x1f3f04['filters']),_0x32081e);if(_0x1b5593[_0xe426('0x33')]['filter']){_0x37cb52[_0xe426('0x3c')]=_[_0xe426('0x3e')](_0x37cb52[_0xe426('0x3c')],{'$or':_[_0xe426('0x32')](_0x32081e,function(_0x4fd546){if(_0x4fd546[_0xe426('0x30')]!=='VIRTUAL'){var _0x37d000={};_0x37d000[_0x4fd546[_0xe426('0x2b')]]={'$like':'%'+_0x1b5593[_0xe426('0x33')][_0xe426('0x3f')]+'%'};return _0x37d000;}})});}_0x37cb52=_['merge']({},_0x37cb52,_0x1b5593[_0xe426('0x40')]);var _0x54734e={'where':_0x37cb52[_0xe426('0x3c')]};return db[_0xe426('0x2d')][_0xe426('0x22')](_0x54734e)['then'](function(_0x93fa01){_0x53d438[_0xe426('0x22')]=_0x93fa01;if(_0x1b5593[_0xe426('0x33')]['includeAll']){_0x37cb52[_0xe426('0x41')]=[{'all':!![]}];}return db[_0xe426('0x2d')]['findAll'](_0x37cb52);})[_0xe426('0x28')](function(_0x1923db){_0x53d438['rows']=_0x1923db;return _0x53d438;})[_0xe426('0x28')](respondWithFilteredResult(_0x339911,_0x37cb52))['catch'](handleError(_0x339911,null));};exports[_0xe426('0x42')]=function(_0x207ec0,_0x302605){var _0x252a69={'raw':![],'where':{'id':_0x207ec0[_0xe426('0x43')]['id']}},_0x3c6a83={};_0x3c6a83['model']=_[_0xe426('0x34')](db[_0xe426('0x2d')][_0xe426('0x2e')]);_0x3c6a83['query']=_[_0xe426('0x34')](_0x207ec0[_0xe426('0x33')]);_0x3c6a83['filters']=_['intersection'](_0x3c6a83[_0xe426('0x37')],_0x3c6a83[_0xe426('0x33')]);_0x252a69['attributes']=_[_0xe426('0x36')](_0x3c6a83[_0xe426('0x37')],qs[_0xe426('0x38')](_0x207ec0[_0xe426('0x33')]['fields']));_0x252a69[_0xe426('0x39')]=_0x252a69['attributes']['length']?_0x252a69[_0xe426('0x39')]:_0x3c6a83[_0xe426('0x37')];if(_0x207ec0[_0xe426('0x33')][_0xe426('0x44')]){_0x252a69['include']=[{'all':!![]}];}_0x252a69=_[_0xe426('0x3e')]({},_0x252a69,_0x207ec0['options']);return db[_0xe426('0x2d')][_0xe426('0x45')](_0x252a69)[_0xe426('0x28')](handleEntityNotFound(_0x302605,null))['then'](respondWithResult(_0x302605,null))[_0xe426('0x46')](handleError(_0x302605,null));};exports['create']=function(_0x94b89c,_0x34f027){return db[_0xe426('0x2d')][_0xe426('0x47')](_0x94b89c[_0xe426('0x48')],{})[_0xe426('0x28')](respondWithResult(_0x34f027,0xc9))[_0xe426('0x46')](handleError(_0x34f027,null));};exports[_0xe426('0x26')]=function(_0x1db559,_0x4b749f){if(_0x1db559[_0xe426('0x48')]['id']){delete _0x1db559[_0xe426('0x48')]['id'];}return db[_0xe426('0x2d')][_0xe426('0x45')]({'where':{'id':_0x1db559['params']['id']}})[_0xe426('0x28')](handleEntityNotFound(_0x4b749f,null))['then'](saveUpdates(_0x1db559[_0xe426('0x48')],null))[_0xe426('0x28')](respondWithResult(_0x4b749f,null))[_0xe426('0x46')](handleError(_0x4b749f,null));};exports[_0xe426('0x27')]=function(_0x369a2d,_0x57ec67){return db[_0xe426('0x2d')][_0xe426('0x45')]({'where':{'id':_0x369a2d[_0xe426('0x43')]['id']}})[_0xe426('0x28')](handleEntityNotFound(_0x57ec67,null))['then'](removeEntity(_0x57ec67,null))[_0xe426('0x46')](handleError(_0x57ec67,null));};exports['describe']=function(_0x398e9c,_0x4081da){return db[_0xe426('0x2d')][_0xe426('0x49')]()[_0xe426('0x28')](respondWithResult(_0x4081da,null))[_0xe426('0x46')](handleError(_0x4081da,null));};exports[_0xe426('0x4a')]=function(_0x2d3cf2,_0x8caabf){var _0x30b4da={},_0x1d965b={},_0x48c61f={'count':0x0,'rows':[]};_0x1d965b[_0xe426('0x37')]=_[_0xe426('0x34')](db['VoiceQueueReport']['rawAttributes']);_0x1d965b[_0xe426('0x33')]=_[_0xe426('0x34')](_0x2d3cf2['query']);_0x1d965b[_0xe426('0x35')]=_[_0xe426('0x36')](_0x1d965b['model'],_0x1d965b[_0xe426('0x33')]);_0x30b4da[_0xe426('0x39')]=_[_0xe426('0x36')](_0x1d965b[_0xe426('0x37')],qs['fields'](_0x2d3cf2[_0xe426('0x33')][_0xe426('0x38')]));_0x30b4da[_0xe426('0x39')]=_0x30b4da[_0xe426('0x39')][_0xe426('0x3a')]?_0x30b4da[_0xe426('0x39')]:_0x1d965b['model'];if(!_0x2d3cf2[_0xe426('0x33')][_0xe426('0x4b')](_0xe426('0x4c'))){_0x30b4da[_0xe426('0x20')]=qs[_0xe426('0x20')](_0x2d3cf2['query'][_0xe426('0x20')]);_0x30b4da[_0xe426('0x1f')]=qs[_0xe426('0x1f')](_0x2d3cf2[_0xe426('0x33')][_0xe426('0x1f')]);}_0x30b4da[_0xe426('0x4d')]=qs[_0xe426('0x3b')](_0x2d3cf2[_0xe426('0x33')][_0xe426('0x3b')]);_0x30b4da[_0xe426('0x3c')]=qs[_0xe426('0x35')](_[_0xe426('0x3d')](_0x2d3cf2[_0xe426('0x33')],_0x1d965b[_0xe426('0x35')]));if(_0x2d3cf2[_0xe426('0x33')]['filter']){_0x30b4da[_0xe426('0x3c')]=_[_0xe426('0x3e')](_0x30b4da[_0xe426('0x3c')],{'$or':_[_0xe426('0x32')](_0x30b4da[_0xe426('0x39')],function(_0x32f7b6){var _0x4e9cfa={};_0x4e9cfa[_0x32f7b6]={'$like':'%'+_0x2d3cf2[_0xe426('0x33')][_0xe426('0x3f')]+'%'};return _0x4e9cfa;})});}_0x30b4da=_[_0xe426('0x3e')]({},_0x30b4da,_0x2d3cf2[_0xe426('0x40')]);var _0x118963={'where':_0x30b4da[_0xe426('0x3c')]};return db[_0xe426('0x2d')][_0xe426('0x22')](_0x118963)[_0xe426('0x28')](function(_0x24fe3c){_0x48c61f[_0xe426('0x22')]=_0x24fe3c;if(_0x2d3cf2[_0xe426('0x33')][_0xe426('0x44')]){_0x30b4da[_0xe426('0x41')]=[{'all':!![]}];}return db[_0xe426('0x2d')]['findAll'](_0x30b4da);})['then'](function(_0x6174cf){_0x48c61f[_0xe426('0x4e')]=_0x6174cf;return _0x48c61f;})[_0xe426('0x28')](respondWithFilteredResult(_0x8caabf,_0x30b4da,_0xe426('0x4a')))[_0xe426('0x46')](handleError(_0x8caabf,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x41c6=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','end','status','offset','limit','undefined','count','set','apply','reject','save','update','then','sendStatus','error','stack','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','getVoiceQueuesReport','filter','rows','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb'];(function(_0x507b43,_0x377830){var _0x14d3d2=function(_0x199173){while(--_0x199173){_0x507b43['push'](_0x507b43['shift']());}};_0x14d3d2(++_0x377830);}(_0x41c6,0x17b));var _0x641c=function(_0x49c919,_0x1a38e7){_0x49c919=_0x49c919-0x0;var _0x5ce332=_0x41c6[_0x49c919];return _0x5ce332;};'use strict';var emlformat=require(_0x641c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x641c('0x1'));var jsonpatch=require(_0x641c('0x2'));var rp=require(_0x641c('0x3'));var moment=require('moment');var BPromise=require(_0x641c('0x4'));var Mustache=require('mustache');var util=require(_0x641c('0x5'));var path=require(_0x641c('0x6'));var sox=require(_0x641c('0x7'));var csv=require(_0x641c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x641c('0x9'));var _=require(_0x641c('0xa'));var squel=require('squel');var crypto=require(_0x641c('0xb'));var jsforce=require(_0x641c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x641c('0x8'));var querystring=require(_0x641c('0xd'));var Papa=require('papaparse');var Redis=require(_0x641c('0xe'));var authService=require(_0x641c('0xf'));var qs=require(_0x641c('0x10'));var as=require(_0x641c('0x11'));var hardwareService=require(_0x641c('0x12'));var logger=require('../../config/logger')(_0x641c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x641c('0x14'))['db'];config[_0x641c('0x15')]=_[_0x641c('0x16')](config[_0x641c('0x15')],{'host':_0x641c('0x17'),'port':0x18eb});var socket=require(_0x641c('0x18'))(new Redis(config[_0x641c('0x15')]));require(_0x641c('0x19'))['register'](socket);function respondWithStatusCode(_0x345dbd,_0x503560){_0x503560=_0x503560||0xcc;return function(_0x3427de){if(_0x3427de){return _0x345dbd['sendStatus'](_0x503560);}return _0x345dbd['status'](_0x503560)[_0x641c('0x1a')]();};}function respondWithResult(_0x32f6e7,_0x8412c8){_0x8412c8=_0x8412c8||0xc8;return function(_0x2ad34e){if(_0x2ad34e){return _0x32f6e7[_0x641c('0x1b')](_0x8412c8)['json'](_0x2ad34e);}};}function respondWithFilteredResult(_0x15a5bf,_0x3632bc){return function(_0xd7e346){if(_0xd7e346){var _0x2adb81=typeof _0x3632bc[_0x641c('0x1c')]==='undefined'&&typeof _0x3632bc[_0x641c('0x1d')]===_0x641c('0x1e');var _0x467139=_0xd7e346[_0x641c('0x1f')];var _0x2b14af=_0x2adb81?0x0:_0x3632bc[_0x641c('0x1c')];var _0x1a0877=_0x2adb81?_0xd7e346[_0x641c('0x1f')]:_0x3632bc['offset']+_0x3632bc[_0x641c('0x1d')];var _0x442c4e;if(_0x1a0877>=_0x467139){_0x1a0877=_0x467139;_0x442c4e=0xc8;}else{_0x442c4e=0xce;}_0x15a5bf['status'](_0x442c4e);return _0x15a5bf[_0x641c('0x20')]('Content-Range',_0x2b14af+'-'+_0x1a0877+'/'+_0x467139)['json'](_0xd7e346);}return null;};}function patchUpdates(_0x123388){return function(_0xb82198){try{jsonpatch[_0x641c('0x21')](_0xb82198,_0x123388,!![]);}catch(_0x3dd60a){return BPromise[_0x641c('0x22')](_0x3dd60a);}return _0xb82198[_0x641c('0x23')]();};}function saveUpdates(_0x27dee9,_0x43681d){return function(_0x405f02){if(_0x405f02){return _0x405f02[_0x641c('0x24')](_0x27dee9)[_0x641c('0x25')](function(_0x2b06cc){return _0x2b06cc;});}return null;};}function removeEntity(_0x12b912,_0x5ec62f){return function(_0x484bcb){if(_0x484bcb){return _0x484bcb['destroy']()['then'](function(){_0x12b912['status'](0xcc)[_0x641c('0x1a')]();});}};}function handleEntityNotFound(_0x5bb95d,_0x472ecc){return function(_0x19a8d2){if(!_0x19a8d2){_0x5bb95d[_0x641c('0x26')](0x194);}return _0x19a8d2;};}function handleError(_0x2d9c01,_0x368475){_0x368475=_0x368475||0x1f4;return function(_0x29eb27){logger[_0x641c('0x27')](_0x29eb27[_0x641c('0x28')]);if(_0x29eb27['name']){delete _0x29eb27['name'];}_0x2d9c01[_0x641c('0x1b')](_0x368475)[_0x641c('0x29')](_0x29eb27);};}exports[_0x641c('0x2a')]=function(_0x2bd85b,_0x23947a){var _0x87a2d2={},_0x4ae3c0={},_0x40cb24={'count':0x0,'rows':[]};var _0x2fd166=_[_0x641c('0x2b')](db[_0x641c('0x2c')][_0x641c('0x2d')],function(_0x25b9f4){return{'name':_0x25b9f4['fieldName'],'type':_0x25b9f4[_0x641c('0x2e')][_0x641c('0x2f')]};});_0x4ae3c0[_0x641c('0x30')]=_[_0x641c('0x2b')](_0x2fd166,_0x641c('0x31'));_0x4ae3c0[_0x641c('0x32')]=_[_0x641c('0x33')](_0x2bd85b[_0x641c('0x32')]);_0x4ae3c0[_0x641c('0x34')]=_[_0x641c('0x35')](_0x4ae3c0[_0x641c('0x30')],_0x4ae3c0[_0x641c('0x32')]);_0x87a2d2[_0x641c('0x36')]=_[_0x641c('0x35')](_0x4ae3c0[_0x641c('0x30')],qs[_0x641c('0x37')](_0x2bd85b[_0x641c('0x32')][_0x641c('0x37')]));_0x87a2d2['attributes']=_0x87a2d2[_0x641c('0x36')][_0x641c('0x38')]?_0x87a2d2[_0x641c('0x36')]:_0x4ae3c0[_0x641c('0x30')];if(!_0x2bd85b[_0x641c('0x32')][_0x641c('0x39')](_0x641c('0x3a'))){_0x87a2d2[_0x641c('0x1d')]=qs[_0x641c('0x1d')](_0x2bd85b[_0x641c('0x32')]['limit']);_0x87a2d2[_0x641c('0x1c')]=qs[_0x641c('0x1c')](_0x2bd85b['query'][_0x641c('0x1c')]);}_0x87a2d2[_0x641c('0x3b')]=qs[_0x641c('0x3c')](_0x2bd85b[_0x641c('0x32')][_0x641c('0x3c')]);_0x87a2d2[_0x641c('0x3d')]=qs[_0x641c('0x34')](_[_0x641c('0x3e')](_0x2bd85b[_0x641c('0x32')],_0x4ae3c0[_0x641c('0x34')]),_0x2fd166);if(_0x2bd85b[_0x641c('0x32')]['filter']){_0x87a2d2[_0x641c('0x3d')]=_[_0x641c('0x3f')](_0x87a2d2[_0x641c('0x3d')],{'$or':_[_0x641c('0x2b')](_0x2fd166,function(_0x1cbb91){if(_0x1cbb91['type']!==_0x641c('0x40')){var _0x4dd138={};_0x4dd138[_0x1cbb91[_0x641c('0x31')]]={'$like':'%'+_0x2bd85b['query']['filter']+'%'};return _0x4dd138;}})});}_0x87a2d2=_[_0x641c('0x3f')]({},_0x87a2d2,_0x2bd85b[_0x641c('0x41')]);var _0x113dcf={'where':_0x87a2d2['where']};return db['VoiceQueueReport'][_0x641c('0x1f')](_0x113dcf)[_0x641c('0x25')](function(_0x575e9a){_0x40cb24[_0x641c('0x1f')]=_0x575e9a;if(_0x2bd85b[_0x641c('0x32')][_0x641c('0x42')]){_0x87a2d2['include']=[{'all':!![]}];}return db[_0x641c('0x2c')][_0x641c('0x43')](_0x87a2d2);})[_0x641c('0x25')](function(_0x354822){_0x40cb24['rows']=_0x354822;return _0x40cb24;})[_0x641c('0x25')](respondWithFilteredResult(_0x23947a,_0x87a2d2))[_0x641c('0x44')](handleError(_0x23947a,null));};exports[_0x641c('0x45')]=function(_0x444cb6,_0x41686f){var _0x3d432d={'raw':![],'where':{'id':_0x444cb6[_0x641c('0x46')]['id']}},_0x3638ea={};_0x3638ea[_0x641c('0x30')]=_[_0x641c('0x33')](db[_0x641c('0x2c')][_0x641c('0x2d')]);_0x3638ea[_0x641c('0x32')]=_['keys'](_0x444cb6['query']);_0x3638ea[_0x641c('0x34')]=_[_0x641c('0x35')](_0x3638ea[_0x641c('0x30')],_0x3638ea[_0x641c('0x32')]);_0x3d432d['attributes']=_[_0x641c('0x35')](_0x3638ea[_0x641c('0x30')],qs[_0x641c('0x37')](_0x444cb6[_0x641c('0x32')]['fields']));_0x3d432d[_0x641c('0x36')]=_0x3d432d[_0x641c('0x36')][_0x641c('0x38')]?_0x3d432d['attributes']:_0x3638ea[_0x641c('0x30')];if(_0x444cb6['query'][_0x641c('0x42')]){_0x3d432d[_0x641c('0x47')]=[{'all':!![]}];}_0x3d432d=_[_0x641c('0x3f')]({},_0x3d432d,_0x444cb6[_0x641c('0x41')]);return db['VoiceQueueReport'][_0x641c('0x48')](_0x3d432d)[_0x641c('0x25')](handleEntityNotFound(_0x41686f,null))['then'](respondWithResult(_0x41686f,null))[_0x641c('0x44')](handleError(_0x41686f,null));};exports[_0x641c('0x49')]=function(_0x10cf44,_0x4a9848){return db[_0x641c('0x2c')][_0x641c('0x49')](_0x10cf44['body'],{})[_0x641c('0x25')](respondWithResult(_0x4a9848,0xc9))[_0x641c('0x44')](handleError(_0x4a9848,null));};exports[_0x641c('0x24')]=function(_0x212e91,_0x44a01c){if(_0x212e91[_0x641c('0x4a')]['id']){delete _0x212e91['body']['id'];}return db[_0x641c('0x2c')][_0x641c('0x48')]({'where':{'id':_0x212e91[_0x641c('0x46')]['id']}})['then'](handleEntityNotFound(_0x44a01c,null))[_0x641c('0x25')](saveUpdates(_0x212e91[_0x641c('0x4a')],null))[_0x641c('0x25')](respondWithResult(_0x44a01c,null))[_0x641c('0x44')](handleError(_0x44a01c,null));};exports[_0x641c('0x4b')]=function(_0x2e31d7,_0x12eda1){return db['VoiceQueueReport'][_0x641c('0x48')]({'where':{'id':_0x2e31d7[_0x641c('0x46')]['id']}})[_0x641c('0x25')](handleEntityNotFound(_0x12eda1,null))[_0x641c('0x25')](removeEntity(_0x12eda1,null))[_0x641c('0x44')](handleError(_0x12eda1,null));};exports[_0x641c('0x4c')]=function(_0x104294,_0x169237){return db[_0x641c('0x2c')][_0x641c('0x4c')]()[_0x641c('0x25')](respondWithResult(_0x169237,null))['catch'](handleError(_0x169237,null));};exports[_0x641c('0x4d')]=function(_0x1ae42a,_0x47a87f){var _0x112f85={},_0x3541b0={},_0x4b9479={'count':0x0,'rows':[]};_0x3541b0[_0x641c('0x30')]=_[_0x641c('0x33')](db[_0x641c('0x2c')][_0x641c('0x2d')]);_0x3541b0['query']=_[_0x641c('0x33')](_0x1ae42a[_0x641c('0x32')]);_0x3541b0['filters']=_[_0x641c('0x35')](_0x3541b0[_0x641c('0x30')],_0x3541b0[_0x641c('0x32')]);_0x112f85[_0x641c('0x36')]=_['intersection'](_0x3541b0[_0x641c('0x30')],qs[_0x641c('0x37')](_0x1ae42a[_0x641c('0x32')][_0x641c('0x37')]));_0x112f85[_0x641c('0x36')]=_0x112f85[_0x641c('0x36')][_0x641c('0x38')]?_0x112f85[_0x641c('0x36')]:_0x3541b0[_0x641c('0x30')];if(!_0x1ae42a[_0x641c('0x32')][_0x641c('0x39')](_0x641c('0x3a'))){_0x112f85[_0x641c('0x1d')]=qs[_0x641c('0x1d')](_0x1ae42a[_0x641c('0x32')]['limit']);_0x112f85['offset']=qs[_0x641c('0x1c')](_0x1ae42a[_0x641c('0x32')][_0x641c('0x1c')]);}_0x112f85[_0x641c('0x3b')]=qs[_0x641c('0x3c')](_0x1ae42a['query'][_0x641c('0x3c')]);_0x112f85[_0x641c('0x3d')]=qs[_0x641c('0x34')](_[_0x641c('0x3e')](_0x1ae42a[_0x641c('0x32')],_0x3541b0[_0x641c('0x34')]));if(_0x1ae42a[_0x641c('0x32')]['filter']){_0x112f85[_0x641c('0x3d')]=_[_0x641c('0x3f')](_0x112f85[_0x641c('0x3d')],{'$or':_[_0x641c('0x2b')](_0x112f85[_0x641c('0x36')],function(_0x48fa1f){var _0x3542df={};_0x3542df[_0x48fa1f]={'$like':'%'+_0x1ae42a[_0x641c('0x32')][_0x641c('0x4e')]+'%'};return _0x3542df;})});}_0x112f85=_['merge']({},_0x112f85,_0x1ae42a['options']);var _0x25c766={'where':_0x112f85[_0x641c('0x3d')]};return db[_0x641c('0x2c')][_0x641c('0x1f')](_0x25c766)['then'](function(_0x13c012){_0x4b9479[_0x641c('0x1f')]=_0x13c012;if(_0x1ae42a[_0x641c('0x32')]['includeAll']){_0x112f85['include']=[{'all':!![]}];}return db[_0x641c('0x2c')]['findAll'](_0x112f85);})[_0x641c('0x25')](function(_0x15c339){_0x4b9479[_0x641c('0x4f')]=_0x15c339;return _0x4b9479;})[_0x641c('0x25')](respondWithFilteredResult(_0x47a87f,_0x112f85,'getVoiceQueuesReport'))[_0x641c('0x44')](handleError(_0x47a87f,null,_0x641c('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 81b12bd..d5dc850 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 _0x817b=['save','remove','emit','events','../../mysqldb','VoiceQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x817b,0x1b9));var _0xb817=function(_0x4da76b,_0x4bd3ac){_0x4da76b=_0x4da76b-0x0;var _0x21a112=_0x817b[_0x4da76b];return _0x21a112;};'use strict';var EventEmitter=require(_0xb817('0x0'));var VoiceQueueReport=require(_0xb817('0x1'))['db'][_0xb817('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb817('0x3'),'afterUpdate':'update','afterDestroy':_0xb817('0x4')};function emitEvent(_0x29bc54){return function(_0x9610b1,_0x6bde14,_0x28f711){VoiceQueueReportEvents[_0xb817('0x5')](_0x29bc54+':'+_0x9610b1['id'],_0x9610b1);VoiceQueueReportEvents[_0xb817('0x5')](_0x29bc54,_0x9610b1);_0x28f711(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xf62c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xf62c,0x7e));var _0xcf62=function(_0x58b218,_0x1cd268){_0x58b218=_0x58b218-0x0;var _0x52b655=_0xf62c[_0x58b218];return _0x52b655;};'use strict';var EventEmitter=require(_0xcf62('0x0'));var VoiceQueueReport=require(_0xcf62('0x1'))['db'][_0xcf62('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xcf62('0x3')](0x0);var events={'afterCreate':_0xcf62('0x4'),'afterUpdate':_0xcf62('0x5'),'afterDestroy':_0xcf62('0x6')};function emitEvent(_0x18532e){return function(_0x4cc379,_0x25cf21,_0x2d5313){VoiceQueueReportEvents[_0xcf62('0x7')](_0x18532e+':'+_0x4cc379['id'],_0x4cc379);VoiceQueueReportEvents[_0xcf62('0x7')](_0x18532e,_0x4cc379);_0x2d5313(null);};}for(var e in events){if(events[_0xcf62('0x8')](e)){var event=events[e];VoiceQueueReport[_0xcf62('0x9')](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 974931e..540de4c 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 _0x601f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','util','../../config/logger','api'];(function(_0x416d9b,_0xa49561){var _0x354be0=function(_0x4652d1){while(--_0x4652d1){_0x416d9b['push'](_0x416d9b['shift']());}};_0x354be0(++_0xa49561);}(_0x601f,0x138));var _0xf601=function(_0x387d26,_0x13c985){_0x387d26=_0x387d26-0x0;var _0x5d073a=_0x601f[_0x387d26];return _0x5d073a;};'use strict';var _=require('lodash');var util=require(_0xf601('0x0'));var logger=require(_0xf601('0x1'))(_0xf601('0x2'));var moment=require(_0xf601('0x3'));var BPromise=require(_0xf601('0x4'));var rp=require(_0xf601('0x5'));var fs=require('fs');var path=require(_0xf601('0x6'));var rimraf=require(_0xf601('0x7'));var config=require(_0xf601('0x8'));var attributes=require(_0xf601('0x9'));module[_0xf601('0xa')]=function(_0x22e043,_0x47c7c3){return _0x22e043[_0xf601('0xb')](_0xf601('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf601('0xd')]},{'fields':[_0xf601('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd15e=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird'];(function(_0x2d255c,_0x449596){var _0x21872d=function(_0x159342){while(--_0x159342){_0x2d255c['push'](_0x2d255c['shift']());}};_0x21872d(++_0x449596);}(_0xd15e,0x130));var _0xed15=function(_0x3123f3,_0x2c6afc){_0x3123f3=_0x3123f3-0x0;var _0x2ed5aa=_0xd15e[_0x3123f3];return _0x2ed5aa;};'use strict';var _=require('lodash');var util=require(_0xed15('0x0'));var logger=require(_0xed15('0x1'))(_0xed15('0x2'));var moment=require('moment');var BPromise=require(_0xed15('0x3'));var rp=require(_0xed15('0x4'));var fs=require('fs');var path=require(_0xed15('0x5'));var rimraf=require(_0xed15('0x6'));var config=require(_0xed15('0x7'));var attributes=require(_0xed15('0x8'));module[_0xed15('0x9')]=function(_0x2793bc,_0x1d6e36){return _0x2793bc['define'](_0xed15('0xa'),attributes,{'tableName':_0xed15('0xb'),'paranoid':![],'indexes':[{'fields':[_0xed15('0xc')]},{'fields':[_0xed15('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7563a6a..18b88c9 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 _0x4282=['stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2d2998,_0x4783d8){var _0x3c9531=function(_0x5789df){while(--_0x5789df){_0x2d2998['push'](_0x2d2998['shift']());}};_0x3c9531(++_0x4783d8);}(_0x4282,0x16d));var _0x2428=function(_0x2bf2ff,_0x27bb45){_0x2bf2ff=_0x2bf2ff-0x0;var _0x357790=_0x4282[_0x2bf2ff];return _0x357790;};'use strict';var _=require(_0x2428('0x0'));var util=require(_0x2428('0x1'));var moment=require('moment');var BPromise=require(_0x2428('0x2'));var rs=require(_0x2428('0x3'));var fs=require('fs');var Redis=require(_0x2428('0x4'));var db=require(_0x2428('0x5'))['db'];var utils=require(_0x2428('0x6'));var logger=require(_0x2428('0x7'))(_0x2428('0x8'));var config=require('../../config/environment');var jayson=require(_0x2428('0x9'));var client=jayson[_0x2428('0xa')]['http']({'port':0x232a});config[_0x2428('0xb')]=_[_0x2428('0xc')](config['redis'],{'host':_0x2428('0xd'),'port':0x18eb});var socket=require(_0x2428('0xe'))(new Redis(config['redis']));require(_0x2428('0xf'))[_0x2428('0x10')](socket);function respondWithRpcPromise(_0x1a4283,_0x1f876b,_0x39a9c6){return new BPromise(function(_0x539a4c,_0x194bb6){return client['request'](_0x1a4283,_0x39a9c6)[_0x2428('0x11')](function(_0x47c9da){logger[_0x2428('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x1f876b,'request\x20sent');logger[_0x2428('0x13')](_0x2428('0x14'),_0x1f876b,_0x2428('0x15'),JSON[_0x2428('0x16')](_0x47c9da));if(_0x47c9da[_0x2428('0x17')]){if(_0x47c9da[_0x2428('0x17')]['code']===0x1f4){logger[_0x2428('0x17')](_0x2428('0x18'),_0x1f876b,_0x47c9da[_0x2428('0x17')]['message']);return _0x194bb6(_0x47c9da['error'][_0x2428('0x19')]);}logger[_0x2428('0x17')](_0x2428('0x18'),_0x1f876b,_0x47c9da['error'][_0x2428('0x19')]);return _0x539a4c(_0x47c9da[_0x2428('0x17')][_0x2428('0x19')]);}else{logger[_0x2428('0x12')](_0x2428('0x18'),_0x1f876b,_0x2428('0x15'));_0x539a4c(_0x47c9da[_0x2428('0x1a')]['message']);}})[_0x2428('0x1b')](function(_0x39d1a2){logger[_0x2428('0x17')](_0x2428('0x18'),_0x1f876b,_0x39d1a2);_0x194bb6(_0x39d1a2);});});}exports[_0x2428('0x1c')]=function(_0x1af80e){var _0x4cfa39=this;return new Promise(function(_0x417382,_0x3ec508){return db[_0x2428('0x1d')]['findAll']({'raw':_0x1af80e[_0x2428('0x1e')]?_0x1af80e['options'][_0x2428('0x1f')]===undefined?!![]:![]:!![],'where':_0x1af80e[_0x2428('0x1e')]?_0x1af80e[_0x2428('0x1e')]['where']||null:null,'attributes':_0x1af80e[_0x2428('0x1e')]?_0x1af80e['options'][_0x2428('0x20')]||null:null,'limit':_0x1af80e[_0x2428('0x1e')]?_0x1af80e[_0x2428('0x1e')][_0x2428('0x21')]||null:null,'include':_0x1af80e['options']?_0x1af80e[_0x2428('0x1e')][_0x2428('0x22')]?_[_0x2428('0x23')](_0x1af80e[_0x2428('0x1e')][_0x2428('0x22')],function(_0x2412ff){return{'model':db[_0x2412ff[_0x2428('0x24')]],'as':_0x2412ff['as'],'attributes':_0x2412ff[_0x2428('0x20')],'include':_0x2412ff[_0x2428('0x22')]?_['map'](_0x2412ff[_0x2428('0x22')],function(_0x2971fe){return{'model':db[_0x2971fe['model']],'as':_0x2971fe['as'],'attributes':_0x2971fe[_0x2428('0x20')],'include':_0x2971fe['include']?_[_0x2428('0x23')](_0x2971fe[_0x2428('0x22')],function(_0x139bc3){return{'model':db[_0x139bc3[_0x2428('0x24')]],'as':_0x139bc3['as'],'attributes':_0x139bc3[_0x2428('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x85ccb3){logger['info'](_0x2428('0x1c'),_0x1af80e);logger[_0x2428('0x13')](_0x2428('0x1c'),_0x1af80e,JSON[_0x2428('0x16')](_0x85ccb3));_0x417382(_0x85ccb3);})[_0x2428('0x1b')](function(_0x2699e3){logger[_0x2428('0x17')]('GetVoiceQueueReport',_0x2699e3[_0x2428('0x19')],_0x1af80e);_0x3ec508(_0x4cfa39[_0x2428('0x17')](0x1f4,_0x2699e3['message']));});});};exports[_0x2428('0x25')]=function(_0x29eeef){var _0x366f7b=this;return new Promise(function(_0x5daa84,_0x305df2){return db[_0x2428('0x1d')][_0x2428('0x26')](_0x29eeef[_0x2428('0x27')],{'raw':_0x29eeef['options']?_0x29eeef[_0x2428('0x1e')][_0x2428('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3da088){logger['info']('CreateVoiceQueueReport',_0x29eeef);logger[_0x2428('0x13')](_0x2428('0x25'),_0x29eeef,JSON[_0x2428('0x16')](_0x3da088));_0x5daa84(_0x3da088);})[_0x2428('0x1b')](function(_0x1b9182){logger['error'](_0x2428('0x25'),_0x1b9182['message'],_0x29eeef);_0x305df2(_0x366f7b[_0x2428('0x17')](0x1f4,_0x1b9182[_0x2428('0x19')]));});});};exports[_0x2428('0x28')]=function(_0x1485a4){var _0x9743a3=this;return new Promise(function(_0x57ded3,_0x37234a){return db[_0x2428('0x1d')][_0x2428('0x29')](_0x1485a4[_0x2428('0x27')],{'raw':_0x1485a4[_0x2428('0x1e')]?_0x1485a4['options'][_0x2428('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1485a4[_0x2428('0x1e')]?_0x1485a4[_0x2428('0x1e')][_0x2428('0x2a')]||null:null,'attributes':_0x1485a4[_0x2428('0x1e')]?_0x1485a4[_0x2428('0x1e')][_0x2428('0x20')]||null:null,'limit':_0x1485a4[_0x2428('0x1e')]?_0x1485a4[_0x2428('0x1e')][_0x2428('0x21')]||null:null})[_0x2428('0x11')](function(_0xc59e7c){logger['info'](_0x2428('0x28'),_0x1485a4);logger[_0x2428('0x13')]('UpdateVoiceQueueReport',_0x1485a4,JSON[_0x2428('0x16')](_0xc59e7c));_0x57ded3(_0xc59e7c);})[_0x2428('0x1b')](function(_0x506596){logger[_0x2428('0x17')]('UpdateVoiceQueueReport',_0x506596['message'],_0x1485a4);_0x37234a(_0x9743a3['error'](0x1f4,_0x506596[_0x2428('0x19')]));});});}; \ No newline at end of file +var _0x48ce=['VoiceQueueReport,\x20%s,\x20%s','info','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','then','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48ce,0xbf));var _0xe48c=function(_0x1c8065,_0x3d46d5){_0x1c8065=_0x1c8065-0x0;var _0x58b7b3=_0x48ce[_0x1c8065];return _0x58b7b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe48c('0x0'));var BPromise=require(_0xe48c('0x1'));var rs=require(_0xe48c('0x2'));var fs=require('fs');var Redis=require(_0xe48c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe48c('0x4'));var logger=require(_0xe48c('0x5'))(_0xe48c('0x6'));var config=require(_0xe48c('0x7'));var jayson=require(_0xe48c('0x8'));var client=jayson[_0xe48c('0x9')][_0xe48c('0xa')]({'port':0x232a});config[_0xe48c('0xb')]=_[_0xe48c('0xc')](config[_0xe48c('0xb')],{'host':_0xe48c('0xd'),'port':0x18eb});var socket=require(_0xe48c('0xe'))(new Redis(config[_0xe48c('0xb')]));require('./voiceQueueReport.socket')[_0xe48c('0xf')](socket);function respondWithRpcPromise(_0x31e8ab,_0x5af112,_0x1cd1b2){return new BPromise(function(_0x395706,_0x513cda){return client[_0xe48c('0x10')](_0x31e8ab,_0x1cd1b2)['then'](function(_0x4c765b){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x5af112,_0xe48c('0x11'));logger[_0xe48c('0x12')](_0xe48c('0x13'),_0x5af112,_0xe48c('0x11'),JSON[_0xe48c('0x14')](_0x4c765b));if(_0x4c765b['error']){if(_0x4c765b['error'][_0xe48c('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5af112,_0x4c765b[_0xe48c('0x16')][_0xe48c('0x17')]);return _0x513cda(_0x4c765b[_0xe48c('0x16')][_0xe48c('0x17')]);}logger[_0xe48c('0x16')](_0xe48c('0x18'),_0x5af112,_0x4c765b['error'][_0xe48c('0x17')]);return _0x395706(_0x4c765b['error'][_0xe48c('0x17')]);}else{logger[_0xe48c('0x19')](_0xe48c('0x18'),_0x5af112,'request\x20sent');_0x395706(_0x4c765b['result'][_0xe48c('0x17')]);}})[_0xe48c('0x1a')](function(_0x229b17){logger[_0xe48c('0x16')](_0xe48c('0x18'),_0x5af112,_0x229b17);_0x513cda(_0x229b17);});});}exports[_0xe48c('0x1b')]=function(_0x249376){var _0x40cad1=this;return new Promise(function(_0x497a32,_0x212c2d){return db[_0xe48c('0x1c')][_0xe48c('0x1d')]({'raw':_0x249376[_0xe48c('0x1e')]?_0x249376['options'][_0xe48c('0x1f')]===undefined?!![]:![]:!![],'where':_0x249376[_0xe48c('0x1e')]?_0x249376[_0xe48c('0x1e')][_0xe48c('0x20')]||null:null,'attributes':_0x249376['options']?_0x249376['options']['attributes']||null:null,'limit':_0x249376[_0xe48c('0x1e')]?_0x249376[_0xe48c('0x1e')]['limit']||null:null,'include':_0x249376[_0xe48c('0x1e')]?_0x249376[_0xe48c('0x1e')][_0xe48c('0x21')]?_[_0xe48c('0x22')](_0x249376[_0xe48c('0x1e')][_0xe48c('0x21')],function(_0x3576d6){return{'model':db[_0x3576d6[_0xe48c('0x23')]],'as':_0x3576d6['as'],'attributes':_0x3576d6['attributes'],'include':_0x3576d6['include']?_[_0xe48c('0x22')](_0x3576d6[_0xe48c('0x21')],function(_0x317bc5){return{'model':db[_0x317bc5[_0xe48c('0x23')]],'as':_0x317bc5['as'],'attributes':_0x317bc5[_0xe48c('0x24')],'include':_0x317bc5[_0xe48c('0x21')]?_[_0xe48c('0x22')](_0x317bc5['include'],function(_0x2015ff){return{'model':db[_0x2015ff[_0xe48c('0x23')]],'as':_0x2015ff['as'],'attributes':_0x2015ff[_0xe48c('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe48c('0x25')](function(_0x258d30){logger['info'](_0xe48c('0x1b'),_0x249376);logger[_0xe48c('0x12')](_0xe48c('0x1b'),_0x249376,JSON['stringify'](_0x258d30));_0x497a32(_0x258d30);})['catch'](function(_0x834916){logger[_0xe48c('0x16')](_0xe48c('0x1b'),_0x834916[_0xe48c('0x17')],_0x249376);_0x212c2d(_0x40cad1[_0xe48c('0x16')](0x1f4,_0x834916['message']));});});};exports[_0xe48c('0x26')]=function(_0xf82589){var _0x546fc6=this;return new Promise(function(_0x76571d,_0x3f530a){return db[_0xe48c('0x1c')]['create'](_0xf82589['body'],{'raw':_0xf82589[_0xe48c('0x1e')]?_0xf82589[_0xe48c('0x1e')][_0xe48c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xe8252c){logger[_0xe48c('0x19')](_0xe48c('0x26'),_0xf82589);logger[_0xe48c('0x12')](_0xe48c('0x26'),_0xf82589,JSON[_0xe48c('0x14')](_0xe8252c));_0x76571d(_0xe8252c);})['catch'](function(_0x461987){logger[_0xe48c('0x16')](_0xe48c('0x26'),_0x461987[_0xe48c('0x17')],_0xf82589);_0x3f530a(_0x546fc6[_0xe48c('0x16')](0x1f4,_0x461987[_0xe48c('0x17')]));});});};exports[_0xe48c('0x27')]=function(_0x1262f6){var _0x123eaa=this;return new Promise(function(_0x4f1709,_0x52ab12){return db[_0xe48c('0x1c')][_0xe48c('0x28')](_0x1262f6[_0xe48c('0x29')],{'raw':_0x1262f6[_0xe48c('0x1e')]?_0x1262f6[_0xe48c('0x1e')][_0xe48c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1262f6[_0xe48c('0x1e')]?_0x1262f6[_0xe48c('0x1e')][_0xe48c('0x20')]||null:null,'attributes':_0x1262f6[_0xe48c('0x1e')]?_0x1262f6['options'][_0xe48c('0x24')]||null:null,'limit':_0x1262f6[_0xe48c('0x1e')]?_0x1262f6['options'][_0xe48c('0x2a')]||null:null})[_0xe48c('0x25')](function(_0x50dd66){logger[_0xe48c('0x19')]('UpdateVoiceQueueReport',_0x1262f6);logger[_0xe48c('0x12')](_0xe48c('0x27'),_0x1262f6,JSON[_0xe48c('0x14')](_0x50dd66));_0x4f1709(_0x50dd66);})[_0xe48c('0x1a')](function(_0x26b53c){logger[_0xe48c('0x16')](_0xe48c('0x27'),_0x26b53c['message'],_0x1262f6);_0x52ab12(_0x123eaa[_0xe48c('0x16')](0x1f4,_0x26b53c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 0252613..64e16d9 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 _0x34f8=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','voiceQueueReport:'];(function(_0x5bf77b,_0x5ca5e6){var _0x28b2e9=function(_0x4662f0){while(--_0x4662f0){_0x5bf77b['push'](_0x5bf77b['shift']());}};_0x28b2e9(++_0x5ca5e6);}(_0x34f8,0x80));var _0x834f=function(_0x46cfb3,_0x448152){_0x46cfb3=_0x46cfb3-0x0;var _0x1af70e=_0x34f8[_0x46cfb3];return _0x1af70e;};'use strict';var VoiceQueueReportEvents=require(_0x834f('0x0'));var events=[_0x834f('0x1'),_0x834f('0x2'),_0x834f('0x3')];function createListener(_0x2cf91a,_0x495ca8){return function(_0x521ceb){_0x495ca8[_0x834f('0x4')](_0x2cf91a,_0x521ceb);};}function removeListener(_0x92264b,_0x4d23b1){return function(){VoiceQueueReportEvents[_0x834f('0x5')](_0x92264b,_0x4d23b1);};}exports[_0x834f('0x6')]=function(_0x9e052f){for(var _0x3498dd=0x0,_0x5378c4=events['length'];_0x3498dd<_0x5378c4;_0x3498dd++){var _0xf778e4=events[_0x3498dd];var _0x2597c6=createListener(_0x834f('0x7')+_0xf778e4,_0x9e052f);VoiceQueueReportEvents['on'](_0xf778e4,_0x2597c6);}}; \ No newline at end of file +var _0x2dab=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register'];(function(_0x93230c,_0xcbaa34){var _0x5b5632=function(_0x2a9922){while(--_0x2a9922){_0x93230c['push'](_0x93230c['shift']());}};_0x5b5632(++_0xcbaa34);}(_0x2dab,0x120));var _0xb2da=function(_0x1dd54a,_0x574ad1){_0x1dd54a=_0x1dd54a-0x0;var _0x29e8f1=_0x2dab[_0x1dd54a];return _0x29e8f1;};'use strict';var VoiceQueueReportEvents=require(_0xb2da('0x0'));var events=[_0xb2da('0x1'),_0xb2da('0x2'),_0xb2da('0x3')];function createListener(_0x3bbc49,_0x4b5ae2){return function(_0x19ab19){_0x4b5ae2['emit'](_0x3bbc49,_0x19ab19);};}function removeListener(_0x15df9b,_0x1f7ad6){return function(){VoiceQueueReportEvents[_0xb2da('0x4')](_0x15df9b,_0x1f7ad6);};}exports[_0xb2da('0x5')]=function(_0x309b46){for(var _0x3b0e4e=0x0,_0x11f18f=events['length'];_0x3b0e4e<_0x11f18f;_0x3b0e4e++){var _0x1a6e99=events[_0x3b0e4e];var _0x236dbc=createListener(_0xb2da('0x6')+_0x1a6e99,_0x309b46);VoiceQueueReportEvents['on'](_0x1a6e99,_0x236dbc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0a7b539..7e59f2d 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 _0xfb29=['isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get'];(function(_0x39cc47,_0x499346){var _0x37aea9=function(_0x3ec2ce){while(--_0x3ec2ce){_0x39cc47['push'](_0x39cc47['shift']());}};_0x37aea9(++_0x499346);}(_0xfb29,0x119));var _0x9fb2=function(_0x2d79e7,_0x421ce5){_0x2d79e7=_0x2d79e7-0x0;var _0x3d4546=_0xfb29[_0x2d79e7];return _0x3d4546;};'use strict';var multer=require(_0x9fb2('0x0'));var util=require('util');var path=require(_0x9fb2('0x1'));var timeout=require('connect-timeout');var express=require(_0x9fb2('0x2'));var router=express['Router']();var fs_extra=require(_0x9fb2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9fb2('0x4'));var config=require('../../config/environment');var controller=require(_0x9fb2('0x5'));router[_0x9fb2('0x6')]('/',auth[_0x9fb2('0x7')](),controller[_0x9fb2('0x8')]);router[_0x9fb2('0x6')](_0x9fb2('0x9'),auth[_0x9fb2('0x7')](),controller[_0x9fb2('0xa')]);router['post']('/',auth[_0x9fb2('0x7')](),controller[_0x9fb2('0xb')]);router[_0x9fb2('0xc')]('/:id',auth[_0x9fb2('0x7')](),controller[_0x9fb2('0xd')]);router[_0x9fb2('0xe')](_0x9fb2('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9fb2('0xf')]=router; \ No newline at end of file +var _0x7c68=['delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x7c68,0x1d5));var _0x87c6=function(_0x203492,_0x50ceae){_0x203492=_0x203492-0x0;var _0x48a36d=_0x7c68[_0x203492];return _0x48a36d;};'use strict';var multer=require(_0x87c6('0x0'));var util=require(_0x87c6('0x1'));var path=require(_0x87c6('0x2'));var timeout=require(_0x87c6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x87c6('0x4'));var auth=require(_0x87c6('0x5'));var interaction=require(_0x87c6('0x6'));var config=require('../../config/environment');var controller=require(_0x87c6('0x7'));router[_0x87c6('0x8')]('/',auth['isAuthenticated'](),controller[_0x87c6('0x9')]);router['get']('/:id',auth[_0x87c6('0xa')](),controller[_0x87c6('0xb')]);router[_0x87c6('0xc')]('/',auth['isAuthenticated'](),controller[_0x87c6('0xd')]);router[_0x87c6('0xe')](_0x87c6('0xf'),auth['isAuthenticated'](),controller[_0x87c6('0x10')]);router[_0x87c6('0x11')](_0x87c6('0xf'),auth[_0x87c6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9b1ba7d..226972d 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 _0xb288=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb288,0x1b3));var _0x8b28=function(_0x773a2e,_0x4196b3){_0x773a2e=_0x773a2e-0x0;var _0x19683d=_0xb288[_0x773a2e];return _0x19683d;};'use strict';var Sequelize=require(_0x8b28('0x0'));var moment=require(_0x8b28('0x1'));module[_0x8b28('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8b28('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8b28('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x8b28('0x5'))}}; \ No newline at end of file +var _0xc208=['STRING','DATE','format','moment','exports'];(function(_0x35a0f0,_0x39dd85){var _0x2992d1=function(_0x1b43ce){while(--_0x1b43ce){_0x35a0f0['push'](_0x35a0f0['shift']());}};_0x2992d1(++_0x39dd85);}(_0xc208,0x125));var _0x8c20=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc208[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8c20('0x0'));module[_0x8c20('0x1')]={'time':{'type':Sequelize[_0x8c20('0x2')]},'callid':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8c20('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8c20('0x3')],'allowNull':![],'defaultValue':moment()[_0x8c20('0x4')]('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 0689706..c11d586 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 _0xbb47=['apply','reject','save','destroy','then','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','intersection','length','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x1c2948,_0x47cc33){var _0x1d28bf=function(_0x230eb4){while(--_0x230eb4){_0x1c2948['push'](_0x1c2948['shift']());}};_0x1d28bf(++_0x47cc33);}(_0xbb47,0x103));var _0x7bb4=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0xbb47[_0x4370c7];return _0xce78a9;};'use strict';var emlformat=require(_0x7bb4('0x0'));var rimraf=require(_0x7bb4('0x1'));var zipdir=require(_0x7bb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bb4('0x3'));var moment=require(_0x7bb4('0x4'));var BPromise=require(_0x7bb4('0x5'));var Mustache=require(_0x7bb4('0x6'));var util=require(_0x7bb4('0x7'));var path=require('path');var sox=require(_0x7bb4('0x8'));var csv=require(_0x7bb4('0x9'));var ejs=require(_0x7bb4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bb4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7bb4('0xc'));var toCsv=require(_0x7bb4('0x9'));var querystring=require(_0x7bb4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7bb4('0xe'));var as=require(_0x7bb4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bb4('0x10'))(_0x7bb4('0x11'));var utils=require(_0x7bb4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7bb4('0x13'));var db=require(_0x7bb4('0x14'))['db'];function respondWithStatusCode(_0x74f491,_0xc3988){_0xc3988=_0xc3988||0xcc;return function(_0x25b01a){if(_0x25b01a){return _0x74f491['sendStatus'](_0xc3988);}return _0x74f491[_0x7bb4('0x15')](_0xc3988)['end']();};}function respondWithResult(_0x580854,_0x19195f){_0x19195f=_0x19195f||0xc8;return function(_0x65e181){if(_0x65e181){return _0x580854[_0x7bb4('0x15')](_0x19195f)[_0x7bb4('0x16')](_0x65e181);}};}function respondWithFilteredResult(_0x2ba1b5,_0x23f414){return function(_0x2a3a4a){if(_0x2a3a4a){var _0x194062=typeof _0x23f414['offset']==='undefined'&&typeof _0x23f414[_0x7bb4('0x17')]===_0x7bb4('0x18');var _0x3b17ec=_0x2a3a4a[_0x7bb4('0x19')];var _0xef14ce=_0x194062?0x0:_0x23f414[_0x7bb4('0x1a')];var _0x341e7e=_0x194062?_0x2a3a4a['count']:_0x23f414[_0x7bb4('0x1a')]+_0x23f414[_0x7bb4('0x17')];var _0x58f3cd;if(_0x341e7e>=_0x3b17ec){_0x341e7e=_0x3b17ec;_0x58f3cd=0xc8;}else{_0x58f3cd=0xce;}_0x2ba1b5[_0x7bb4('0x15')](_0x58f3cd);return _0x2ba1b5[_0x7bb4('0x1b')](_0x7bb4('0x1c'),_0xef14ce+'-'+_0x341e7e+'/'+_0x3b17ec)[_0x7bb4('0x16')](_0x2a3a4a);}return null;};}function patchUpdates(_0x20887a){return function(_0x1f637e){try{jsonpatch[_0x7bb4('0x1d')](_0x1f637e,_0x20887a,!![]);}catch(_0x4edce7){return BPromise[_0x7bb4('0x1e')](_0x4edce7);}return _0x1f637e[_0x7bb4('0x1f')]();};}function saveUpdates(_0x2867ea,_0x162760){return function(_0x151735){if(_0x151735){return _0x151735['update'](_0x2867ea)['then'](function(_0x223790){return _0x223790;});}return null;};}function removeEntity(_0x369072,_0x5aa8ec){return function(_0x3d8c73){if(_0x3d8c73){return _0x3d8c73[_0x7bb4('0x20')]()[_0x7bb4('0x21')](function(){_0x369072[_0x7bb4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e2c4,_0x39a08e){return function(_0x52c613){if(!_0x52c613){_0x10e2c4['sendStatus'](0x194);}return _0x52c613;};}function handleError(_0x1c290f,_0x283e75){_0x283e75=_0x283e75||0x1f4;return function(_0x292548){logger[_0x7bb4('0x22')](_0x292548[_0x7bb4('0x23')]);if(_0x292548[_0x7bb4('0x24')]){delete _0x292548[_0x7bb4('0x24')];}_0x1c290f[_0x7bb4('0x15')](_0x283e75)[_0x7bb4('0x25')](_0x292548);};}exports[_0x7bb4('0x26')]=function(_0x5df17d,_0x2aa9d0){var _0x51f87a={},_0x1b6a34={},_0x13b012={'count':0x0,'rows':[]};var _0x34d3b4=_['map'](db[_0x7bb4('0x27')][_0x7bb4('0x28')],function(_0x160ac){return{'name':_0x160ac[_0x7bb4('0x29')],'type':_0x160ac[_0x7bb4('0x2a')][_0x7bb4('0x2b')]};});_0x1b6a34['model']=_[_0x7bb4('0x2c')](_0x34d3b4,'name');_0x1b6a34[_0x7bb4('0x2d')]=_[_0x7bb4('0x2e')](_0x5df17d[_0x7bb4('0x2d')]);_0x1b6a34[_0x7bb4('0x2f')]=_['intersection'](_0x1b6a34[_0x7bb4('0x30')],_0x1b6a34[_0x7bb4('0x2d')]);_0x51f87a[_0x7bb4('0x31')]=_['intersection'](_0x1b6a34['model'],qs[_0x7bb4('0x32')](_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x32')]));_0x51f87a[_0x7bb4('0x31')]=_0x51f87a[_0x7bb4('0x31')]['length']?_0x51f87a[_0x7bb4('0x31')]:_0x1b6a34[_0x7bb4('0x30')];if(!_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x33')](_0x7bb4('0x34'))){_0x51f87a[_0x7bb4('0x17')]=qs[_0x7bb4('0x17')](_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x17')]);_0x51f87a[_0x7bb4('0x1a')]=qs[_0x7bb4('0x1a')](_0x5df17d[_0x7bb4('0x2d')]['offset']);}_0x51f87a[_0x7bb4('0x35')]=qs[_0x7bb4('0x36')](_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x36')]);_0x51f87a[_0x7bb4('0x37')]=qs['filters'](_[_0x7bb4('0x38')](_0x5df17d['query'],_0x1b6a34['filters']),_0x34d3b4);if(_0x5df17d['query']['filter']){_0x51f87a[_0x7bb4('0x37')]=_[_0x7bb4('0x39')](_0x51f87a[_0x7bb4('0x37')],{'$or':_[_0x7bb4('0x2c')](_0x34d3b4,function(_0x55bbbf){if(_0x55bbbf[_0x7bb4('0x2a')]!==_0x7bb4('0x3a')){var _0x114ade={};_0x114ade[_0x55bbbf[_0x7bb4('0x24')]]={'$like':'%'+_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x3b')]+'%'};return _0x114ade;}})});}_0x51f87a=_[_0x7bb4('0x39')]({},_0x51f87a,_0x5df17d[_0x7bb4('0x3c')]);var _0x3e4d4e={'where':_0x51f87a[_0x7bb4('0x37')]};return db[_0x7bb4('0x27')][_0x7bb4('0x19')](_0x3e4d4e)[_0x7bb4('0x21')](function(_0x5d72bf){_0x13b012['count']=_0x5d72bf;if(_0x5df17d[_0x7bb4('0x2d')][_0x7bb4('0x3d')]){_0x51f87a['include']=[{'all':!![]}];}return db[_0x7bb4('0x27')][_0x7bb4('0x3e')](_0x51f87a);})[_0x7bb4('0x21')](function(_0x4795e5){_0x13b012[_0x7bb4('0x3f')]=_0x4795e5;return _0x13b012;})[_0x7bb4('0x21')](respondWithFilteredResult(_0x2aa9d0,_0x51f87a))[_0x7bb4('0x40')](handleError(_0x2aa9d0,null));};exports[_0x7bb4('0x41')]=function(_0x7a3753,_0x4801ac){var _0x334621={'raw':!![],'where':{'id':_0x7a3753['params']['id']}},_0x253d06={};_0x253d06['model']=_[_0x7bb4('0x2e')](db['VoiceQueuesLog'][_0x7bb4('0x28')]);_0x253d06['query']=_[_0x7bb4('0x2e')](_0x7a3753['query']);_0x253d06['filters']=_[_0x7bb4('0x42')](_0x253d06['model'],_0x253d06[_0x7bb4('0x2d')]);_0x334621[_0x7bb4('0x31')]=_[_0x7bb4('0x42')](_0x253d06['model'],qs[_0x7bb4('0x32')](_0x7a3753[_0x7bb4('0x2d')][_0x7bb4('0x32')]));_0x334621[_0x7bb4('0x31')]=_0x334621[_0x7bb4('0x31')][_0x7bb4('0x43')]?_0x334621[_0x7bb4('0x31')]:_0x253d06[_0x7bb4('0x30')];if(_0x7a3753[_0x7bb4('0x2d')][_0x7bb4('0x3d')]){_0x334621[_0x7bb4('0x44')]=[{'all':!![]}];}_0x334621=_[_0x7bb4('0x39')]({},_0x334621,_0x7a3753['options']);return db['VoiceQueuesLog']['find'](_0x334621)[_0x7bb4('0x21')](handleEntityNotFound(_0x4801ac,null))['then'](respondWithResult(_0x4801ac,null))[_0x7bb4('0x40')](handleError(_0x4801ac,null));};exports[_0x7bb4('0x45')]=function(_0x4531c5,_0xe75220){return db[_0x7bb4('0x27')][_0x7bb4('0x45')](_0x4531c5[_0x7bb4('0x46')],{})[_0x7bb4('0x21')](respondWithResult(_0xe75220,0xc9))[_0x7bb4('0x40')](handleError(_0xe75220,null));};exports['update']=function(_0x32069f,_0x46d387){if(_0x32069f[_0x7bb4('0x46')]['id']){delete _0x32069f[_0x7bb4('0x46')]['id'];}return db[_0x7bb4('0x27')][_0x7bb4('0x47')]({'where':{'id':_0x32069f['params']['id']}})[_0x7bb4('0x21')](handleEntityNotFound(_0x46d387,null))[_0x7bb4('0x21')](saveUpdates(_0x32069f[_0x7bb4('0x46')],null))[_0x7bb4('0x21')](respondWithResult(_0x46d387,null))[_0x7bb4('0x40')](handleError(_0x46d387,null));};exports[_0x7bb4('0x20')]=function(_0x6365d6,_0x1a40b4){return db[_0x7bb4('0x27')][_0x7bb4('0x47')]({'where':{'id':_0x6365d6['params']['id']}})[_0x7bb4('0x21')](handleEntityNotFound(_0x1a40b4,null))[_0x7bb4('0x21')](removeEntity(_0x1a40b4,null))[_0x7bb4('0x40')](handleError(_0x1a40b4,null));}; \ No newline at end of file +var _0x9549=['sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','options','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','error','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x190c53,_0x301c54){var _0x2e7eb9=function(_0x16f7d7){while(--_0x16f7d7){_0x190c53['push'](_0x190c53['shift']());}};_0x2e7eb9(++_0x301c54);}(_0x9549,0x1cd));var _0x9954=function(_0x48c868,_0x576049){_0x48c868=_0x48c868-0x0;var _0x207f77=_0x9549[_0x48c868];return _0x207f77;};'use strict';var emlformat=require(_0x9954('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9954('0x1'));var jsonpatch=require(_0x9954('0x2'));var rp=require(_0x9954('0x3'));var moment=require(_0x9954('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9954('0x5'));var util=require(_0x9954('0x6'));var path=require('path');var sox=require(_0x9954('0x7'));var csv=require(_0x9954('0x8'));var ejs=require(_0x9954('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9954('0xa'));var crypto=require('crypto');var jsforce=require(_0x9954('0xb'));var deskjs=require(_0x9954('0xc'));var toCsv=require(_0x9954('0x8'));var querystring=require(_0x9954('0xd'));var Papa=require('papaparse');var Redis=require(_0x9954('0xe'));var authService=require(_0x9954('0xf'));var qs=require(_0x9954('0x10'));var as=require(_0x9954('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9954('0x12'))('api');var utils=require(_0x9954('0x13'));var config=require(_0x9954('0x14'));var licenseUtil=require(_0x9954('0x15'));var db=require(_0x9954('0x16'))['db'];function respondWithStatusCode(_0x2d1551,_0x1ff143){_0x1ff143=_0x1ff143||0xcc;return function(_0x224d1b){if(_0x224d1b){return _0x2d1551[_0x9954('0x17')](_0x1ff143);}return _0x2d1551[_0x9954('0x18')](_0x1ff143)[_0x9954('0x19')]();};}function respondWithResult(_0x51bcd5,_0x81bde7){_0x81bde7=_0x81bde7||0xc8;return function(_0x1fca80){if(_0x1fca80){return _0x51bcd5['status'](_0x81bde7)['json'](_0x1fca80);}};}function respondWithFilteredResult(_0x48b747,_0x3b8b81){return function(_0x5c6e8f){if(_0x5c6e8f){var _0xcf87e9=typeof _0x3b8b81[_0x9954('0x1a')]===_0x9954('0x1b')&&typeof _0x3b8b81[_0x9954('0x1c')]===_0x9954('0x1b');var _0x317b6e=_0x5c6e8f[_0x9954('0x1d')];var _0x19dab3=_0xcf87e9?0x0:_0x3b8b81[_0x9954('0x1a')];var _0x30c8c0=_0xcf87e9?_0x5c6e8f['count']:_0x3b8b81[_0x9954('0x1a')]+_0x3b8b81[_0x9954('0x1c')];var _0x258cbb;if(_0x30c8c0>=_0x317b6e){_0x30c8c0=_0x317b6e;_0x258cbb=0xc8;}else{_0x258cbb=0xce;}_0x48b747['status'](_0x258cbb);return _0x48b747[_0x9954('0x1e')](_0x9954('0x1f'),_0x19dab3+'-'+_0x30c8c0+'/'+_0x317b6e)[_0x9954('0x20')](_0x5c6e8f);}return null;};}function patchUpdates(_0xa07c81){return function(_0x13d710){try{jsonpatch[_0x9954('0x21')](_0x13d710,_0xa07c81,!![]);}catch(_0xaed630){return BPromise[_0x9954('0x22')](_0xaed630);}return _0x13d710[_0x9954('0x23')]();};}function saveUpdates(_0x4f5f2f,_0xf99c20){return function(_0x3de394){if(_0x3de394){return _0x3de394['update'](_0x4f5f2f)[_0x9954('0x24')](function(_0x290a2b){return _0x290a2b;});}return null;};}function removeEntity(_0x3e71fc,_0x293294){return function(_0x258b94){if(_0x258b94){return _0x258b94['destroy']()[_0x9954('0x24')](function(){_0x3e71fc[_0x9954('0x18')](0xcc)[_0x9954('0x19')]();});}};}function handleEntityNotFound(_0x4b95be,_0x1b718f){return function(_0x3f2f3b){if(!_0x3f2f3b){_0x4b95be['sendStatus'](0x194);}return _0x3f2f3b;};}function handleError(_0x236fcf,_0x1c029c){_0x1c029c=_0x1c029c||0x1f4;return function(_0x38bc7a){logger[_0x9954('0x25')](_0x38bc7a['stack']);if(_0x38bc7a[_0x9954('0x26')]){delete _0x38bc7a[_0x9954('0x26')];}_0x236fcf[_0x9954('0x18')](_0x1c029c)[_0x9954('0x27')](_0x38bc7a);};}exports[_0x9954('0x28')]=function(_0x13f9bb,_0x404cc9){var _0x1b6d1f={},_0x28a5cc={},_0x5efcd1={'count':0x0,'rows':[]};var _0x9f2aa6=_['map'](db[_0x9954('0x29')][_0x9954('0x2a')],function(_0x2d8f2f){return{'name':_0x2d8f2f[_0x9954('0x2b')],'type':_0x2d8f2f[_0x9954('0x2c')][_0x9954('0x2d')]};});_0x28a5cc['model']=_[_0x9954('0x2e')](_0x9f2aa6,_0x9954('0x26'));_0x28a5cc[_0x9954('0x2f')]=_[_0x9954('0x30')](_0x13f9bb['query']);_0x28a5cc[_0x9954('0x31')]=_[_0x9954('0x32')](_0x28a5cc['model'],_0x28a5cc['query']);_0x1b6d1f[_0x9954('0x33')]=_[_0x9954('0x32')](_0x28a5cc[_0x9954('0x34')],qs[_0x9954('0x35')](_0x13f9bb['query'][_0x9954('0x35')]));_0x1b6d1f['attributes']=_0x1b6d1f['attributes'][_0x9954('0x36')]?_0x1b6d1f[_0x9954('0x33')]:_0x28a5cc[_0x9954('0x34')];if(!_0x13f9bb['query'][_0x9954('0x37')](_0x9954('0x38'))){_0x1b6d1f['limit']=qs[_0x9954('0x1c')](_0x13f9bb['query'][_0x9954('0x1c')]);_0x1b6d1f[_0x9954('0x1a')]=qs[_0x9954('0x1a')](_0x13f9bb[_0x9954('0x2f')][_0x9954('0x1a')]);}_0x1b6d1f['order']=qs[_0x9954('0x39')](_0x13f9bb['query'][_0x9954('0x39')]);_0x1b6d1f[_0x9954('0x3a')]=qs[_0x9954('0x31')](_[_0x9954('0x3b')](_0x13f9bb[_0x9954('0x2f')],_0x28a5cc[_0x9954('0x31')]),_0x9f2aa6);if(_0x13f9bb[_0x9954('0x2f')][_0x9954('0x3c')]){_0x1b6d1f['where']=_[_0x9954('0x3d')](_0x1b6d1f[_0x9954('0x3a')],{'$or':_[_0x9954('0x2e')](_0x9f2aa6,function(_0x5752fd){if(_0x5752fd[_0x9954('0x2c')]!==_0x9954('0x3e')){var _0x1664f5={};_0x1664f5[_0x5752fd[_0x9954('0x26')]]={'$like':'%'+_0x13f9bb[_0x9954('0x2f')][_0x9954('0x3c')]+'%'};return _0x1664f5;}})});}_0x1b6d1f=_[_0x9954('0x3d')]({},_0x1b6d1f,_0x13f9bb['options']);var _0x3963f1={'where':_0x1b6d1f['where']};return db['VoiceQueuesLog'][_0x9954('0x1d')](_0x3963f1)[_0x9954('0x24')](function(_0x20cb08){_0x5efcd1[_0x9954('0x1d')]=_0x20cb08;if(_0x13f9bb[_0x9954('0x2f')]['includeAll']){_0x1b6d1f[_0x9954('0x3f')]=[{'all':!![]}];}return db[_0x9954('0x29')][_0x9954('0x40')](_0x1b6d1f);})['then'](function(_0x319308){_0x5efcd1[_0x9954('0x41')]=_0x319308;return _0x5efcd1;})['then'](respondWithFilteredResult(_0x404cc9,_0x1b6d1f))['catch'](handleError(_0x404cc9,null));};exports[_0x9954('0x42')]=function(_0x18ee72,_0xd20cd0){var _0x53c77b={'raw':!![],'where':{'id':_0x18ee72[_0x9954('0x43')]['id']}},_0x50ac22={};_0x50ac22[_0x9954('0x34')]=_[_0x9954('0x30')](db[_0x9954('0x29')][_0x9954('0x2a')]);_0x50ac22['query']=_[_0x9954('0x30')](_0x18ee72[_0x9954('0x2f')]);_0x50ac22['filters']=_[_0x9954('0x32')](_0x50ac22['model'],_0x50ac22[_0x9954('0x2f')]);_0x53c77b[_0x9954('0x33')]=_[_0x9954('0x32')](_0x50ac22[_0x9954('0x34')],qs[_0x9954('0x35')](_0x18ee72[_0x9954('0x2f')][_0x9954('0x35')]));_0x53c77b[_0x9954('0x33')]=_0x53c77b['attributes'][_0x9954('0x36')]?_0x53c77b[_0x9954('0x33')]:_0x50ac22[_0x9954('0x34')];if(_0x18ee72[_0x9954('0x2f')]['includeAll']){_0x53c77b[_0x9954('0x3f')]=[{'all':!![]}];}_0x53c77b=_[_0x9954('0x3d')]({},_0x53c77b,_0x18ee72[_0x9954('0x44')]);return db[_0x9954('0x29')][_0x9954('0x45')](_0x53c77b)[_0x9954('0x24')](handleEntityNotFound(_0xd20cd0,null))[_0x9954('0x24')](respondWithResult(_0xd20cd0,null))[_0x9954('0x46')](handleError(_0xd20cd0,null));};exports[_0x9954('0x47')]=function(_0x2740c0,_0x2b20d7){return db['VoiceQueuesLog']['create'](_0x2740c0[_0x9954('0x48')],{})['then'](respondWithResult(_0x2b20d7,0xc9))['catch'](handleError(_0x2b20d7,null));};exports['update']=function(_0x1a2d46,_0x3a651d){if(_0x1a2d46['body']['id']){delete _0x1a2d46[_0x9954('0x48')]['id'];}return db['VoiceQueuesLog'][_0x9954('0x45')]({'where':{'id':_0x1a2d46['params']['id']}})[_0x9954('0x24')](handleEntityNotFound(_0x3a651d,null))['then'](saveUpdates(_0x1a2d46[_0x9954('0x48')],null))['then'](respondWithResult(_0x3a651d,null))['catch'](handleError(_0x3a651d,null));};exports[_0x9954('0x49')]=function(_0x3b8d78,_0x4c9cbc){return db[_0x9954('0x29')][_0x9954('0x45')]({'where':{'id':_0x3b8d78['params']['id']}})[_0x9954('0x24')](handleEntityNotFound(_0x4c9cbc,null))[_0x9954('0x24')](removeEntity(_0x4c9cbc,null))[_0x9954('0x46')](handleError(_0x4c9cbc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index bd55674..b188bf1 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 _0xcc7f=['lodash','moment','path','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x5b0466,_0x2d723f){var _0x3eddb6=function(_0x1886fe){while(--_0x1886fe){_0x5b0466['push'](_0x5b0466['shift']());}};_0x3eddb6(++_0x2d723f);}(_0xcc7f,0x1cc));var _0xfcc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc7f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfcc7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfcc7('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcc7('0x2'));var rimraf=require('rimraf');var config=require(_0xfcc7('0x3'));var attributes=require('./voiceQueuesLog.attributes');module[_0xfcc7('0x4')]=function(_0x52654e,_0xf2278){return _0x52654e[_0xfcc7('0x5')](_0xfcc7('0x6'),attributes,{'tableName':_0xfcc7('0x7'),'paranoid':![],'indexes':[{'name':_0xfcc7('0x8'),'fields':[_0xfcc7('0x9'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x9090=['define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x594e88,_0x442655){var _0x518fa8=function(_0x49a3db){while(--_0x49a3db){_0x594e88['push'](_0x594e88['shift']());}};_0x518fa8(++_0x442655);}(_0x9090,0x17f));var _0x0909=function(_0x5a7ea6,_0x1b2c69){_0x5a7ea6=_0x5a7ea6-0x0;var _0x150422=_0x9090[_0x5a7ea6];return _0x150422;};'use strict';var _=require(_0x0909('0x0'));var util=require(_0x0909('0x1'));var logger=require(_0x0909('0x2'))(_0x0909('0x3'));var moment=require(_0x0909('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0909('0x5'));var rimraf=require(_0x0909('0x6'));var config=require(_0x0909('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x0909('0x8')]=function(_0x42af40,_0x5317db){return _0x42af40[_0x0909('0x9')](_0x0909('0xa'),attributes,{'tableName':_0x0909('0xb'),'paranoid':![],'indexes':[{'name':_0x0909('0xc'),'fields':['event',_0x0909('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index fc734c3..0cef621 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 _0xca07=['stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0xca07,0xb1));var _0x7ca0=function(_0xb8c43b,_0x36f526){_0xb8c43b=_0xb8c43b-0x0;var _0x24df7c=_0xca07[_0xb8c43b];return _0x24df7c;};'use strict';var _=require('lodash');var util=require(_0x7ca0('0x0'));var moment=require('moment');var BPromise=require(_0x7ca0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ca0('0x2'));var db=require(_0x7ca0('0x3'))['db'];var utils=require(_0x7ca0('0x4'));var logger=require('../../config/logger')(_0x7ca0('0x5'));var config=require(_0x7ca0('0x6'));var jayson=require(_0x7ca0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51a2ba,_0x3c29ad,_0x3934cd){return new BPromise(function(_0x530ce7,_0x2e7f4b){return client['request'](_0x51a2ba,_0x3934cd)[_0x7ca0('0x8')](function(_0x5d7f49){logger['info'](_0x7ca0('0x9'),_0x3c29ad,'request\x20sent');logger[_0x7ca0('0xa')](_0x7ca0('0xb'),_0x3c29ad,_0x7ca0('0xc'),JSON[_0x7ca0('0xd')](_0x5d7f49));if(_0x5d7f49[_0x7ca0('0xe')]){if(_0x5d7f49['error'][_0x7ca0('0xf')]===0x1f4){logger[_0x7ca0('0xe')](_0x7ca0('0x9'),_0x3c29ad,_0x5d7f49[_0x7ca0('0xe')][_0x7ca0('0x10')]);return _0x2e7f4b(_0x5d7f49['error'][_0x7ca0('0x10')]);}logger[_0x7ca0('0xe')](_0x7ca0('0x9'),_0x3c29ad,_0x5d7f49[_0x7ca0('0xe')][_0x7ca0('0x10')]);return _0x530ce7(_0x5d7f49[_0x7ca0('0xe')][_0x7ca0('0x10')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3c29ad,'request\x20sent');_0x530ce7(_0x5d7f49[_0x7ca0('0x11')][_0x7ca0('0x10')]);}})[_0x7ca0('0x12')](function(_0x1cbd1d){logger[_0x7ca0('0xe')](_0x7ca0('0x9'),_0x3c29ad,_0x1cbd1d);_0x2e7f4b(_0x1cbd1d);});});} \ No newline at end of file +var _0x86a8=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x58225c,_0x6a3bff){var _0x1b95f7=function(_0x55e7b0){while(--_0x55e7b0){_0x58225c['push'](_0x58225c['shift']());}};_0x1b95f7(++_0x6a3bff);}(_0x86a8,0x1ae));var _0x886a=function(_0x567e3a,_0x43849b){_0x567e3a=_0x567e3a-0x0;var _0x28c73e=_0x86a8[_0x567e3a];return _0x28c73e;};'use strict';var _=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var moment=require(_0x886a('0x2'));var BPromise=require(_0x886a('0x3'));var rs=require(_0x886a('0x4'));var fs=require('fs');var Redis=require(_0x886a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x886a('0x6'));var logger=require(_0x886a('0x7'))('rpc');var config=require(_0x886a('0x8'));var jayson=require(_0x886a('0x9'));var client=jayson['client'][_0x886a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x572c8e,_0x31434c,_0x557bcb){return new BPromise(function(_0x752eed,_0x10641b){return client[_0x886a('0xb')](_0x572c8e,_0x557bcb)[_0x886a('0xc')](function(_0x22d3c0){logger[_0x886a('0xd')](_0x886a('0xe'),_0x31434c,_0x886a('0xf'));logger[_0x886a('0x10')](_0x886a('0x11'),_0x31434c,'request\x20sent',JSON[_0x886a('0x12')](_0x22d3c0));if(_0x22d3c0[_0x886a('0x13')]){if(_0x22d3c0[_0x886a('0x13')][_0x886a('0x14')]===0x1f4){logger['error'](_0x886a('0xe'),_0x31434c,_0x22d3c0[_0x886a('0x13')][_0x886a('0x15')]);return _0x10641b(_0x22d3c0[_0x886a('0x13')][_0x886a('0x15')]);}logger[_0x886a('0x13')](_0x886a('0xe'),_0x31434c,_0x22d3c0[_0x886a('0x13')][_0x886a('0x15')]);return _0x752eed(_0x22d3c0[_0x886a('0x13')]['message']);}else{logger[_0x886a('0xd')](_0x886a('0xe'),_0x31434c,_0x886a('0xf'));_0x752eed(_0x22d3c0[_0x886a('0x16')]['message']);}})[_0x886a('0x17')](function(_0x435cec){logger['error'](_0x886a('0xe'),_0x31434c,_0x435cec);_0x10641b(_0x435cec);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 468967e..2496320 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 _0x2dc8=['show','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','/:id','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x44e487,_0x457420){var _0x347512=function(_0x1f6c38){while(--_0x1f6c38){_0x44e487['push'](_0x44e487['shift']());}};_0x347512(++_0x457420);}(_0x2dc8,0x1a3));var _0x82dc=function(_0x1a12c8,_0x2df4dc){_0x1a12c8=_0x1a12c8-0x0;var _0x305109=_0x2dc8[_0x1a12c8];return _0x305109;};'use strict';var multer=require(_0x82dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x82dc('0x1'));var express=require('express');var router=express[_0x82dc('0x2')]();var fs_extra=require(_0x82dc('0x3'));var auth=require(_0x82dc('0x4'));var interaction=require(_0x82dc('0x5'));var config=require(_0x82dc('0x6'));var controller=require(_0x82dc('0x7'));router[_0x82dc('0x8')]('/',auth[_0x82dc('0x9')](),controller[_0x82dc('0xa')]);router[_0x82dc('0x8')](_0x82dc('0xb'),auth[_0x82dc('0x9')](),controller[_0x82dc('0xc')]);router[_0x82dc('0x8')]('/:id',auth[_0x82dc('0x9')](),controller[_0x82dc('0xd')]);router[_0x82dc('0x8')]('/:id/download',auth[_0x82dc('0x9')](),controller[_0x82dc('0xe')]);router[_0x82dc('0x8')](_0x82dc('0xf'),controller[_0x82dc('0x10')]);router[_0x82dc('0x8')](_0x82dc('0x11'),auth[_0x82dc('0x9')](),controller['downloadTranscribe']);router[_0x82dc('0x12')]('/',auth[_0x82dc('0x9')](),controller['create']);router[_0x82dc('0x12')](_0x82dc('0x11'),auth[_0x82dc('0x9')](),controller[_0x82dc('0x13')]);router['put'](_0x82dc('0x14'),auth[_0x82dc('0x9')](),controller['update']);router[_0x82dc('0x15')]('/:id',auth[_0x82dc('0x9')](),controller[_0x82dc('0x16')]);module[_0x82dc('0x17')]=router; \ No newline at end of file +var _0x188d=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x188d,0x1cd));var _0xd188=function(_0x4180c6,_0x642cf3){_0x4180c6=_0x4180c6-0x0;var _0xe0e5aa=_0x188d[_0x4180c6];return _0xe0e5aa;};'use strict';var multer=require(_0xd188('0x0'));var util=require(_0xd188('0x1'));var path=require(_0xd188('0x2'));var timeout=require(_0xd188('0x3'));var express=require(_0xd188('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd188('0x5'));var interaction=require(_0xd188('0x6'));var config=require(_0xd188('0x7'));var controller=require(_0xd188('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd188('0x9')]);router[_0xd188('0xa')]('/describe',auth[_0xd188('0xb')](),controller[_0xd188('0xc')]);router[_0xd188('0xa')](_0xd188('0xd'),auth['isAuthenticated'](),controller[_0xd188('0xe')]);router[_0xd188('0xa')](_0xd188('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xd188('0xa')](_0xd188('0x10'),controller[_0xd188('0x11')]);router[_0xd188('0xa')](_0xd188('0x12'),auth[_0xd188('0xb')](),controller['downloadTranscribe']);router[_0xd188('0x13')]('/',auth['isAuthenticated'](),controller[_0xd188('0x14')]);router[_0xd188('0x13')]('/:id/transcribe',auth[_0xd188('0xb')](),controller[_0xd188('0x15')]);router[_0xd188('0x16')](_0xd188('0xd'),auth[_0xd188('0xb')](),controller[_0xd188('0x17')]);router[_0xd188('0x18')]('/:id',auth[_0xd188('0xb')](),controller[_0xd188('0x19')]);module[_0xd188('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a57ddc3..954fe36 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(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 ac1b236..cec949b 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 _0x39ca=['moment','bluebird','util','path','to-csv','fs-extra','squel','desk.js','papaparse','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','offset','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','create','body','params','describe','download','../../components/encryptor','uniqueid','find','value','format','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','secrets','extname','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','fileText','/server/files/transcribes/transcribe_','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x18a749,_0x426749){var _0x1823a4=function(_0x5aead6){while(--_0x5aead6){_0x18a749['push'](_0x18a749['shift']());}};_0x1823a4(++_0x426749);}(_0x39ca,0x1c0));var _0xa39c=function(_0x169d90,_0x1e8ddf){_0x169d90=_0x169d90-0x0;var _0x2b501e=_0x39ca[_0x169d90];return _0x2b501e;};'use strict';var emlformat=require(_0xa39c('0x0'));var rimraf=require(_0xa39c('0x1'));var zipdir=require(_0xa39c('0x2'));var jsonpatch=require(_0xa39c('0x3'));var rp=require(_0xa39c('0x4'));var moment=require(_0xa39c('0x5'));var BPromise=require(_0xa39c('0x6'));var Mustache=require('mustache');var util=require(_0xa39c('0x7'));var path=require(_0xa39c('0x8'));var sox=require('sox');var csv=require(_0xa39c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa39c('0xa'));var _=require('lodash');var squel=require(_0xa39c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa39c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa39c('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0xa39c('0xe'));var Redis=require(_0xa39c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa39c('0x10'));var as=require(_0xa39c('0x11'));var hardwareService=require(_0xa39c('0x12'));var logger=require(_0xa39c('0x13'))(_0xa39c('0x14'));var utils=require(_0xa39c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa39c('0x16'));var db=require(_0xa39c('0x17'))['db'];function respondWithStatusCode(_0x21862d,_0xdd015d){_0xdd015d=_0xdd015d||0xcc;return function(_0x7da74f){if(_0x7da74f){return _0x21862d[_0xa39c('0x18')](_0xdd015d);}return _0x21862d[_0xa39c('0x19')](_0xdd015d)['end']();};}function respondWithResult(_0x41ff06,_0x4828f6){_0x4828f6=_0x4828f6||0xc8;return function(_0x4f82dd){if(_0x4f82dd){return _0x41ff06[_0xa39c('0x19')](_0x4828f6)[_0xa39c('0x1a')](_0x4f82dd);}};}function respondWithFilteredResult(_0x21eef3,_0x3dd451){return function(_0x54ef04){if(_0x54ef04){var _0x2e0a3b=typeof _0x3dd451['offset']===_0xa39c('0x1b')&&typeof _0x3dd451['limit']===_0xa39c('0x1b');var _0x4fef8d=_0x54ef04[_0xa39c('0x1c')];var _0xe60247=_0x2e0a3b?0x0:_0x3dd451['offset'];var _0x19f27f=_0x2e0a3b?_0x54ef04['count']:_0x3dd451['offset']+_0x3dd451[_0xa39c('0x1d')];var _0x3125ba;if(_0x19f27f>=_0x4fef8d){_0x19f27f=_0x4fef8d;_0x3125ba=0xc8;}else{_0x3125ba=0xce;}_0x21eef3[_0xa39c('0x19')](_0x3125ba);return _0x21eef3[_0xa39c('0x1e')](_0xa39c('0x1f'),_0xe60247+'-'+_0x19f27f+'/'+_0x4fef8d)[_0xa39c('0x1a')](_0x54ef04);}return null;};}function patchUpdates(_0x2e86d4){return function(_0x20bacd){try{jsonpatch[_0xa39c('0x20')](_0x20bacd,_0x2e86d4,!![]);}catch(_0x518a86){return BPromise['reject'](_0x518a86);}return _0x20bacd['save']();};}function saveUpdates(_0x2cca79,_0x1a5f5d){return function(_0x20580d){if(_0x20580d){return _0x20580d[_0xa39c('0x21')](_0x2cca79)[_0xa39c('0x22')](function(_0x99063d){return _0x99063d;});}return null;};}function removeEntity(_0x2c8783,_0x156ab7){return function(_0x52253c){if(_0x52253c){return _0x52253c[_0xa39c('0x23')]()[_0xa39c('0x22')](function(){_0x2c8783[_0xa39c('0x19')](0xcc)[_0xa39c('0x24')]();});}};}function handleEntityNotFound(_0x1e2a8b,_0x104cef){return function(_0x174f52){if(!_0x174f52){_0x1e2a8b[_0xa39c('0x18')](0x194);}return _0x174f52;};}function handleError(_0x54ec54,_0x55b2cd){_0x55b2cd=_0x55b2cd||0x1f4;return function(_0x47613b){logger[_0xa39c('0x25')](_0x47613b[_0xa39c('0x26')]);if(_0x47613b[_0xa39c('0x27')]){delete _0x47613b[_0xa39c('0x27')];}_0x54ec54[_0xa39c('0x19')](_0x55b2cd)[_0xa39c('0x28')](_0x47613b);};}exports[_0xa39c('0x29')]=function(_0x48d01d,_0x79bd9b){var _0x5e4fa6={},_0x33ce15={},_0x8c22fa={'count':0x0,'rows':[]};var _0x2171e4=_[_0xa39c('0x2a')](db[_0xa39c('0x2b')][_0xa39c('0x2c')],function(_0x14e216){return{'name':_0x14e216[_0xa39c('0x2d')],'type':_0x14e216[_0xa39c('0x2e')][_0xa39c('0x2f')]};});_0x33ce15['model']=_['differenceBy'](_[_0xa39c('0x2a')](_0x2171e4,_0xa39c('0x27')),['format']);_0x33ce15[_0xa39c('0x30')]=_[_0xa39c('0x31')](_0x48d01d[_0xa39c('0x30')]);_0x33ce15[_0xa39c('0x32')]=_[_0xa39c('0x33')](_0x33ce15['model'],_0x33ce15[_0xa39c('0x30')]);_0x5e4fa6['attributes']=_[_0xa39c('0x33')](_0x33ce15['model'],qs[_0xa39c('0x34')](_0x48d01d[_0xa39c('0x30')][_0xa39c('0x34')]));_0x5e4fa6[_0xa39c('0x35')]=_0x5e4fa6['attributes'][_0xa39c('0x36')]?_0x5e4fa6[_0xa39c('0x35')]:_0x33ce15[_0xa39c('0x37')];if(!_0x48d01d['query'][_0xa39c('0x38')]('nolimit')){_0x5e4fa6['limit']=qs[_0xa39c('0x1d')](_0x48d01d['query'][_0xa39c('0x1d')]);_0x5e4fa6[_0xa39c('0x39')]=qs[_0xa39c('0x39')](_0x48d01d[_0xa39c('0x30')][_0xa39c('0x39')]);}_0x5e4fa6[_0xa39c('0x3a')]=qs[_0xa39c('0x3b')](_0x48d01d[_0xa39c('0x30')][_0xa39c('0x3b')]);_0x5e4fa6[_0xa39c('0x3c')]=qs[_0xa39c('0x32')](_[_0xa39c('0x3d')](_0x48d01d[_0xa39c('0x30')],_0x33ce15[_0xa39c('0x32')]),_0x2171e4);if(_0x48d01d['query']['filter']){_0x5e4fa6[_0xa39c('0x3c')]=_[_0xa39c('0x3e')](_0x5e4fa6[_0xa39c('0x3c')],{'$or':_[_0xa39c('0x2a')](_0x2171e4,function(_0x78eb91){if(_0x78eb91[_0xa39c('0x2e')]!=='VIRTUAL'){var _0x28f05c={};_0x28f05c[_0x78eb91[_0xa39c('0x27')]]={'$like':'%'+_0x48d01d[_0xa39c('0x30')]['filter']+'%'};return _0x28f05c;}})});}_0x5e4fa6=_[_0xa39c('0x3e')]({},_0x5e4fa6,_0x48d01d[_0xa39c('0x3f')]);var _0x140018={'where':_0x5e4fa6[_0xa39c('0x3c')]};return db['VoiceRecording']['count'](_0x140018)['then'](function(_0x34fdb4){_0x8c22fa[_0xa39c('0x1c')]=_0x34fdb4;if(_0x48d01d[_0xa39c('0x30')][_0xa39c('0x40')]){_0x5e4fa6[_0xa39c('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa39c('0x42')](_0x5e4fa6);})[_0xa39c('0x22')](function(_0x3d0742){_0x8c22fa['rows']=_0x3d0742;return _0x8c22fa;})[_0xa39c('0x22')](respondWithFilteredResult(_0x79bd9b,_0x5e4fa6))[_0xa39c('0x43')](handleError(_0x79bd9b,null));};exports[_0xa39c('0x44')]=function(_0x2c1707,_0x4b0d13){var _0x3361cb={'raw':![],'where':{'id':_0x2c1707['params']['id']}},_0x4b2e50={};_0x4b2e50[_0xa39c('0x37')]=_[_0xa39c('0x31')](db['VoiceRecording'][_0xa39c('0x2c')]);_0x4b2e50[_0xa39c('0x30')]=_[_0xa39c('0x31')](_0x2c1707[_0xa39c('0x30')]);_0x4b2e50[_0xa39c('0x32')]=_[_0xa39c('0x33')](_0x4b2e50['model'],_0x4b2e50['query']);_0x3361cb['attributes']=_[_0xa39c('0x33')](_0x4b2e50[_0xa39c('0x37')],qs[_0xa39c('0x34')](_0x2c1707[_0xa39c('0x30')]['fields']));_0x3361cb['attributes']=_0x3361cb[_0xa39c('0x35')]['length']?_0x3361cb[_0xa39c('0x35')]:_0x4b2e50[_0xa39c('0x37')];if(_0x2c1707[_0xa39c('0x30')][_0xa39c('0x40')]){_0x3361cb[_0xa39c('0x41')]=[{'all':!![]}];}_0x3361cb=_[_0xa39c('0x3e')]({},_0x3361cb,_0x2c1707['options']);return db['VoiceRecording']['find'](_0x3361cb)[_0xa39c('0x22')](handleEntityNotFound(_0x4b0d13,null))['then'](respondWithResult(_0x4b0d13,null))[_0xa39c('0x43')](handleError(_0x4b0d13,null));};exports[_0xa39c('0x45')]=function(_0x321e5e,_0x405237){return db[_0xa39c('0x2b')][_0xa39c('0x45')](_0x321e5e[_0xa39c('0x46')],{})[_0xa39c('0x22')](respondWithResult(_0x405237,0xc9))[_0xa39c('0x43')](handleError(_0x405237,null));};exports[_0xa39c('0x21')]=function(_0x47c4f7,_0x40287d){if(_0x47c4f7[_0xa39c('0x46')]['id']){delete _0x47c4f7[_0xa39c('0x46')]['id'];}return db[_0xa39c('0x2b')]['find']({'where':{'id':_0x47c4f7[_0xa39c('0x47')]['id']}})['then'](handleEntityNotFound(_0x40287d,null))[_0xa39c('0x22')](saveUpdates(_0x47c4f7[_0xa39c('0x46')],null))[_0xa39c('0x22')](respondWithResult(_0x40287d,null))[_0xa39c('0x43')](handleError(_0x40287d,null));};exports[_0xa39c('0x48')]=function(_0xf2f6f5,_0x21ddce){return db[_0xa39c('0x2b')][_0xa39c('0x48')]()[_0xa39c('0x22')](respondWithResult(_0x21ddce,null))['catch'](handleError(_0x21ddce,null));};exports[_0xa39c('0x49')]=function(_0x392f50,_0x4812da,_0x5b71de){var _0x519053=require(_0xa39c('0x4a'));var _0x52ea19=![];var _0x442fc6={};if(_0x392f50[_0xa39c('0x30')][_0xa39c('0x2e')]&&_0x392f50[_0xa39c('0x30')][_0xa39c('0x2e')]==='uniqueid'){_0x442fc6[_0xa39c('0x4b')]=_0x392f50['params']['id'];}else{_0x442fc6['id']=_0x392f50[_0xa39c('0x47')]['id'];}return db[_0xa39c('0x2b')][_0xa39c('0x4c')]({'where':_0x442fc6,'attributes':['id',_0xa39c('0x4d')],'raw':!![]})[_0xa39c('0x22')](handleEntityNotFound(_0x4812da,null))[_0xa39c('0x22')](function(_0x45d519){if(_0x45d519){var _0x4b0f0e=_0x45d519[_0xa39c('0x4d')];var _0x5a65dc=util[_0xa39c('0x4e')](_0xa39c('0x4f'),_0x4b0f0e);if(fs['existsSync'](_0x5a65dc)){_0x52ea19=!![];return _0x519053[_0xa39c('0x50')](_0x5a65dc,_0x4b0f0e,config['secrets'][_0xa39c('0x51')])[_0xa39c('0x22')](function(){return _0x45d519;});}return _0x45d519;}})[_0xa39c('0x22')](function(_0x5208f1){if(_0x5208f1){var _0x23273a=_0x5208f1['value'];if(!fs[_0xa39c('0x52')](_0x23273a)){throw new db[(_0xa39c('0x53'))][(_0xa39c('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x5208f1[_0xa39c('0x55')]){return _0x4812da[_0xa39c('0x49')](_0x23273a,_0x5208f1['filename']+path['extname'](_0x23273a),function(){if(_0x52ea19){fs['unlink'](_0x23273a);}});}else{return _0x4812da[_0xa39c('0x49')](_0x23273a,function(_0xf1446c){if(_0x52ea19){fs[_0xa39c('0x56')](_0x23273a);}});}}})['catch'](function(_0x31d331){if(_0x31d331[_0xa39c('0x57')]===_0xa39c('0x58')){_0x4812da[_0xa39c('0x19')](0x194)[_0xa39c('0x28')](_0xa39c('0x59'));}else{return handleError(_0x4812da,null);}});};exports[_0xa39c('0x5a')]=function(_0x3252ba,_0x1d1b64,_0x1a90ed){var _0x3f5581=require(_0xa39c('0x4a'));var _0x2d0edb=![];var _0x3320d8={'$and':[db[_0xa39c('0x5b')][_0xa39c('0x3c')](db[_0xa39c('0x5b')]['fn'](_0xa39c('0x5c'),db[_0xa39c('0x5b')][_0xa39c('0x5d')](_0xa39c('0x4b'))),_0x3252ba[_0xa39c('0x30')][_0xa39c('0x5e')])]};if(_0x3252ba[_0xa39c('0x30')]['type']&&_0x3252ba['query'][_0xa39c('0x2e')]==='uniqueid'){_0x3320d8[_0xa39c('0x5f')]['push']({'uniqueid':_0x3252ba['params']['id']});}else{_0x3320d8[_0xa39c('0x5f')]['push']({'id':_0x3252ba['params']['id']});}return db[_0xa39c('0x2b')][_0xa39c('0x4c')]({'where':_0x3320d8,'attributes':['id','value'],'raw':!![]})[_0xa39c('0x22')](handleEntityNotFound(_0x1d1b64,null))[_0xa39c('0x22')](function(_0x33e69c){if(_0x33e69c){var _0x1caee0=util['format']('%s.cypher',_0x33e69c[_0xa39c('0x4d')]);if(fs[_0xa39c('0x52')](_0x1caee0)){_0x2d0edb=!![];return _0x3f5581[_0xa39c('0x50')](_0x1caee0,_0x33e69c[_0xa39c('0x4d')],config[_0xa39c('0x60')][_0xa39c('0x51')])[_0xa39c('0x22')](function(){return _0x33e69c;});}return _0x33e69c;}})[_0xa39c('0x22')](function(_0x133bcc){if(_0x133bcc){if(!fs[_0xa39c('0x52')](_0x133bcc[_0xa39c('0x4d')])){throw new db[(_0xa39c('0x53'))][(_0xa39c('0x54'))](_0xa39c('0x58'));}if(_0x133bcc[_0xa39c('0x55')]){return _0x1d1b64['download'](_0x133bcc['value'],_0x133bcc[_0xa39c('0x55')]+path[_0xa39c('0x61')](_0x133bcc[_0xa39c('0x4d')]),function(){if(_0x2d0edb){fs[_0xa39c('0x56')](_0x133bcc[_0xa39c('0x4d')]);}});}else{return _0x1d1b64[_0xa39c('0x49')](_0x133bcc[_0xa39c('0x4d')],function(_0x56cc38){if(_0x2d0edb){fs[_0xa39c('0x56')](_0x133bcc[_0xa39c('0x4d')]);}});}}})[_0xa39c('0x43')](handleError(_0x1d1b64,null));};exports[_0xa39c('0x23')]=function(_0x52ed23,_0x325065){return db[_0xa39c('0x2b')][_0xa39c('0x4c')]({'where':{'id':_0x52ed23['params']['id']}})[_0xa39c('0x22')](function(_0x55acdd){if(_['isNil'](_0x55acdd)){throw new ReferenceError(_0xa39c('0x62'));}return _0x55acdd;})['then'](function(_0x2675ca){var _0x5a5870=_0x2675ca[_0xa39c('0x4d')];logger['info'](_0xa39c('0x63'),_0x5a5870);if(!_[_0xa39c('0x64')](_0x2675ca[_0xa39c('0x4d')])&&fs['existsSync'](_0x5a5870)){logger['info'](_0xa39c('0x65')+_0x5a5870+_0xa39c('0x66'));fs[_0xa39c('0x67')](_0x5a5870);}_0x5a5870=_0x5a5870+_0xa39c('0x68');if(!_['isNil'](_0x2675ca[_0xa39c('0x4d')])&&fs[_0xa39c('0x52')](_0x5a5870)){logger[_0xa39c('0x69')]('File:\x20\x22'+_0x5a5870+_0xa39c('0x66'));fs['unlinkSync'](_0x5a5870);}return _0x2675ca;})[_0xa39c('0x22')](function(_0x45ec2d){if(!_0x45ec2d)throw new InternalError();return _0x45ec2d[_0xa39c('0x23')]();})['then'](function(){_0x325065[_0xa39c('0x19')](0xcc)[_0xa39c('0x24')]();})[_0xa39c('0x43')](handleError(_0x325065,null));};function getBucketslist(_0x52418c,_0x4ff44c,_0x1e7671){return new Promise(function(_0x3b449f,_0x65b7a7){var _0x400872=new AWS['S3']({'accessKeyId':_0x4ff44c,'secretAccessKey':_0x52418c,'region':_0x1e7671});_0x400872[_0xa39c('0x6a')]({},function(_0x213606,_0x34ac81){if(_0x213606){return _0x65b7a7(_0x213606);}else{return _0x3b449f(_0x34ac81);}});});}function createBucket(_0x362d21,_0xee4b90,_0x53c4aa,_0x1dcb71){return new Promise(function(_0x3184a4,_0x47905f){var _0x103ad1=new AWS['S3']({'accessKeyId':_0xee4b90,'secretAccessKey':_0x362d21,'region':_0x53c4aa});_0x103ad1['createBucket']({'Bucket':_0x1dcb71},function(_0x4c1035,_0x402424){if(_0x4c1035){return _0x47905f(_0x4c1035);}else{return _0x3184a4(_0x402424);}});});}function uploadFile(_0x333501,_0x3b9aad,_0x4fd435,_0x38001a,_0xc6d80e,_0x1825c8){return new Promise(function(_0x3a8b9c,_0x5a87df){var _0x5d0f8e=new AWS['S3']({'accessKeyId':_0x3b9aad,'secretAccessKey':_0x333501,'region':_0x4fd435});_0x5d0f8e[_0xa39c('0x6b')]({'Bucket':_0x38001a,'Key':_0xc6d80e,'Body':_0x1825c8},function(_0x55461b,_0x396e85){if(_0x55461b){return _0x5a87df(_0x55461b);}else{return _0x3a8b9c(_0x396e85);}});});}function startTranscribe(_0x9a502c,_0x2ffa79,_0x7bb258,_0x1cba5e,_0x6264b3,_0x31d56c){return new Promise(function(_0x511a82,_0x1e968d){var _0x4e75bd=new AWS[(_0xa39c('0x6c'))]({'accessKeyId':_0x2ffa79,'secretAccessKey':_0x9a502c,'region':_0x7bb258});_0x4e75bd[_0xa39c('0x6d')]({'TranscriptionJobName':_0x1cba5e,'LanguageCode':_0x6264b3,'Media':{'MediaFileUri':_0x31d56c}},function(_0x179314,_0x420581){if(_0x179314){return _0x1e968d(_0x179314);}else{return _0x511a82(_0x420581);}});});}function transcribe(_0x525203,_0x51ad5d,_0x303838,_0x39c027,_0x13ce6c,_0x48e402,_0x3200bc){return new Promise(function(_0x2b59d4,_0x66a48f){var _0x1616a0={};logger[_0xa39c('0x69')](util[_0xa39c('0x4e')](_0xa39c('0x6e'),_0x525203,_0x13ce6c));return uploadFile(_0x51ad5d,_0x303838,_0x39c027,_0x13ce6c,path[_0xa39c('0x6f')](_0x48e402),fs[_0xa39c('0x70')](_0x48e402))['then'](function(_0x41764d){logger['info'](util[_0xa39c('0x4e')](_0xa39c('0x71'),_0x525203,_0x13ce6c,_0x41764d[_0xa39c('0x72')]));_0x1616a0[_0xa39c('0x73')]=_0x41764d[_0xa39c('0x74')];_0x1616a0[_0xa39c('0x75')]=_0x41764d[_0xa39c('0x72')];logger['info'](util[_0xa39c('0x4e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x525203));return startTranscribe(_0x51ad5d,_0x303838,_0x39c027,uuidv4(),_0x3200bc,_0x41764d['Location']);})[_0xa39c('0x22')](function(_0x2ae129){logger['info'](util[_0xa39c('0x4e')](_0xa39c('0x76'),_0x525203,_0x2ae129['TranscriptionJob'][_0xa39c('0x77')]));_0x1616a0[_0xa39c('0x78')]=_0x2ae129['TranscriptionJob'][_0xa39c('0x77')];_0x1616a0['transcribeStatus']=_0x2ae129[_0xa39c('0x79')][_0xa39c('0x7a')];return _0x2b59d4(_0x1616a0);})['catch'](function(_0x233f16){return _0x66a48f(_0x233f16);});});}exports[_0xa39c('0x7b')]=function(_0x4c61c0,_0x1f9709,_0x4a3883){var _0x5bfa33;var _0x57dfda;var _0x5e0f2c;var _0x33cc51=require(_0xa39c('0x4a'));return db[_0xa39c('0x2b')][_0xa39c('0x7c')]({'where':{'id':_0x4c61c0['params']['id']}})[_0xa39c('0x22')](function(_0x3af58e){if(_0x3af58e){var _0xf4c1d4=util['format'](_0xa39c('0x4f'),_0x3af58e['value']);if(fs['existsSync'](_0xf4c1d4)){cypher=!![];return _0x33cc51[_0xa39c('0x50')](_0xf4c1d4,_0x3af58e[_0xa39c('0x4d')],config['secrets'][_0xa39c('0x51')])[_0xa39c('0x22')](function(){return _0x3af58e;});}return _0x3af58e;}})[_0xa39c('0x22')](function(_0x46b4ca){if(!_0x46b4ca){throw new db[(_0xa39c('0x53'))]['ValidationError'](_0xa39c('0x7d'));}_0x57dfda=_0x46b4ca;return db[_0xa39c('0x7e')][_0xa39c('0x7c')]({'where':{'id':0x1}});})[_0xa39c('0x22')](handleEntityNotFound(_0x1f9709,null))[_0xa39c('0x22')](function(_0x3f2846){if(_0x3f2846){_0x5bfa33=_0x3f2846;if(!_0x5bfa33[_0xa39c('0x7f')]||!_0x5bfa33[_0xa39c('0x80')]||!_0x5bfa33[_0xa39c('0x81')]||!_0x5bfa33[_0xa39c('0x82')]||!_0x5bfa33['bucket']){throw new db[(_0xa39c('0x53'))][(_0xa39c('0x54'))](_0xa39c('0x83'));}if(_0x4c61c0['body']['runSentiment']&&(!_0x5bfa33[_0xa39c('0x84')]||!_0x5bfa33[_0xa39c('0x85')]||!_0x5bfa33['sentimentRegion']||!_0x5bfa33[_0xa39c('0x82')]||!_0x5bfa33['bucket'])){throw new db['Sequelize'][(_0xa39c('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xa39c('0x86')][_0xa39c('0x7c')]({'where':{'id':_0x5bfa33['transcribeAccountId']}});}})[_0xa39c('0x22')](function(_0x49cd0c){if(!_0x49cd0c){throw new db[(_0xa39c('0x53'))][(_0xa39c('0x54'))](_0xa39c('0x87'));}if(!_0x49cd0c[_0xa39c('0x88')]||!_0x49cd0c['data2']){throw new db[(_0xa39c('0x53'))]['ValidationError'](_0xa39c('0x89'));}_0x5e0f2c=_0x49cd0c;return getBucketslist(_0x5e0f2c[_0xa39c('0x88')],_0x5e0f2c[_0xa39c('0x8a')],_0x5bfa33['transcribeRegion']);})[_0xa39c('0x22')](function(_0xedc8db){if(_0xedc8db&&_0xedc8db[_0xa39c('0x8b')]){var _0x1e87bb=_['find'](_0xedc8db['Buckets'],function(_0x316889){return _0x316889['Name']===_0x5bfa33[_0xa39c('0x73')];});if(!_0x1e87bb){logger[_0xa39c('0x69')](util[_0xa39c('0x4e')](_0xa39c('0x8c'),_0x4c61c0[_0xa39c('0x47')]['id'],_0x5bfa33[_0xa39c('0x73')]));return createBucket(_0x5e0f2c['data1'],_0x5e0f2c[_0xa39c('0x8a')],_0x5bfa33[_0xa39c('0x81')],_0x5bfa33[_0xa39c('0x73')]);}logger['info'](util['format'](_0xa39c('0x8d'),_0x4c61c0[_0xa39c('0x47')]['id'],_0x5bfa33[_0xa39c('0x73')]));return;}})['then'](function(_0x169c2e){if(_0x57dfda[_0xa39c('0x8e')]===_0xa39c('0x8f')){return transcribe(_0x4c61c0['params']['id'],_0x5e0f2c[_0xa39c('0x88')],_0x5e0f2c[_0xa39c('0x8a')],_0x5bfa33[_0xa39c('0x81')],_0x5bfa33[_0xa39c('0x73')],_0x57dfda[_0xa39c('0x4d')],_0x5bfa33['language']);}else{logger[_0xa39c('0x69')](util[_0xa39c('0x4e')](_0xa39c('0x90'),_0x4c61c0[_0xa39c('0x47')]['id']));return{'transcribeStatus':_0xa39c('0x91')};}})[_0xa39c('0x22')](function(_0x40b66f){if(_0x40b66f){_0x40b66f[_0xa39c('0x92')]=_0x4c61c0[_0xa39c('0x46')][_0xa39c('0x93')];return _0x57dfda['updateAttributes'](_0x40b66f);}})['then'](respondWithResult(_0x1f9709,null))[_0xa39c('0x43')](handleError(_0x1f9709,null));};function writeFile(_0x376683,_0x8f204b){return new Promise(function(_0x28bb9f,_0x4422e7){fs[_0xa39c('0x94')](_0x8f204b,_0x376683,function(_0x35f0ab,_0x39bf15){if(_0x35f0ab){return _0x4422e7(_0x35f0ab);}else{return _0x28bb9f(_0x39bf15);}});});}exports['downloadTranscribe']=function(_0x2abc5d,_0x4ff63f,_0x26bc53){return db[_0xa39c('0x2b')]['findOne']({'where':{'id':_0x2abc5d['params']['id']}})[_0xa39c('0x22')](handleEntityNotFound(_0x4ff63f))[_0xa39c('0x22')](function(_0x4e4b2b){if(_0x4e4b2b&&_0x4e4b2b[_0xa39c('0x95')]){var _0x41f866=_0x4e4b2b[_0xa39c('0x95')];var _0x53746a=config['root']+_0xa39c('0x96')+_0x4e4b2b['id']+'.txt';if(fs[_0xa39c('0x52')](_0x53746a)){return _0x53746a;}return writeFile(_0x41f866,_0x53746a)[_0xa39c('0x22')](function(){return _0x53746a;});}else{throw new db[(_0xa39c('0x53'))][(_0xa39c('0x54'))]('Transcript\x20not\x20available');}})[_0xa39c('0x22')](function(_0x4f6650){return _0x4ff63f[_0xa39c('0x49')](_0x4f6650);})[_0xa39c('0x43')](handleError(_0x4ff63f));}; \ No newline at end of file +var _0x9f08=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','format','keys','model','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','VoiceRecording','findAll','rows','catch','includeAll','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','%s.cypher','secrets','recording','Sequelize','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','ValidationError','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x24a57a,_0x2b9d65){var _0x43afd2=function(_0x4aba00){while(--_0x4aba00){_0x24a57a['push'](_0x24a57a['shift']());}};_0x43afd2(++_0x2b9d65);}(_0x9f08,0x95));var _0x89f0=function(_0x7fdf43,_0x4cb474){_0x7fdf43=_0x7fdf43-0x0;var _0x5dc005=_0x9f08[_0x7fdf43];return _0x5dc005;};'use strict';var emlformat=require(_0x89f0('0x0'));var rimraf=require(_0x89f0('0x1'));var zipdir=require(_0x89f0('0x2'));var jsonpatch=require(_0x89f0('0x3'));var rp=require(_0x89f0('0x4'));var moment=require(_0x89f0('0x5'));var BPromise=require(_0x89f0('0x6'));var Mustache=require(_0x89f0('0x7'));var util=require(_0x89f0('0x8'));var path=require('path');var sox=require(_0x89f0('0x9'));var csv=require(_0x89f0('0xa'));var ejs=require(_0x89f0('0xb'));var fs=require('fs');var fs_extra=require(_0x89f0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x89f0('0xd'));var deskjs=require(_0x89f0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x89f0('0xf'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x89f0('0x10'));var Redis=require(_0x89f0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x89f0('0x12'));var as=require(_0x89f0('0x13'));var hardwareService=require(_0x89f0('0x14'));var logger=require('../../config/logger')(_0x89f0('0x15'));var utils=require(_0x89f0('0x16'));var config=require(_0x89f0('0x17'));var licenseUtil=require(_0x89f0('0x18'));var db=require(_0x89f0('0x19'))['db'];function respondWithStatusCode(_0x5880a1,_0x18e002){_0x18e002=_0x18e002||0xcc;return function(_0x5149d6){if(_0x5149d6){return _0x5880a1[_0x89f0('0x1a')](_0x18e002);}return _0x5880a1[_0x89f0('0x1b')](_0x18e002)[_0x89f0('0x1c')]();};}function respondWithResult(_0x342cdd,_0x24ed81){_0x24ed81=_0x24ed81||0xc8;return function(_0x107708){if(_0x107708){return _0x342cdd[_0x89f0('0x1b')](_0x24ed81)[_0x89f0('0x1d')](_0x107708);}};}function respondWithFilteredResult(_0x2ee1c1,_0x4a92e8){return function(_0x5cfb31){if(_0x5cfb31){var _0xe85be5=typeof _0x4a92e8[_0x89f0('0x1e')]===_0x89f0('0x1f')&&typeof _0x4a92e8[_0x89f0('0x20')]===_0x89f0('0x1f');var _0x15ea20=_0x5cfb31[_0x89f0('0x21')];var _0x476ba6=_0xe85be5?0x0:_0x4a92e8[_0x89f0('0x1e')];var _0x13ed3b=_0xe85be5?_0x5cfb31[_0x89f0('0x21')]:_0x4a92e8[_0x89f0('0x1e')]+_0x4a92e8[_0x89f0('0x20')];var _0x505674;if(_0x13ed3b>=_0x15ea20){_0x13ed3b=_0x15ea20;_0x505674=0xc8;}else{_0x505674=0xce;}_0x2ee1c1[_0x89f0('0x1b')](_0x505674);return _0x2ee1c1[_0x89f0('0x22')](_0x89f0('0x23'),_0x476ba6+'-'+_0x13ed3b+'/'+_0x15ea20)['json'](_0x5cfb31);}return null;};}function patchUpdates(_0x3bff5c){return function(_0x36c618){try{jsonpatch[_0x89f0('0x24')](_0x36c618,_0x3bff5c,!![]);}catch(_0x27cd21){return BPromise[_0x89f0('0x25')](_0x27cd21);}return _0x36c618[_0x89f0('0x26')]();};}function saveUpdates(_0x5dff72,_0xb2b550){return function(_0x37f6d2){if(_0x37f6d2){return _0x37f6d2[_0x89f0('0x27')](_0x5dff72)[_0x89f0('0x28')](function(_0x4bcb35){return _0x4bcb35;});}return null;};}function removeEntity(_0xa38851,_0x4ca389){return function(_0x5bd308){if(_0x5bd308){return _0x5bd308[_0x89f0('0x29')]()[_0x89f0('0x28')](function(){_0xa38851[_0x89f0('0x1b')](0xcc)[_0x89f0('0x1c')]();});}};}function handleEntityNotFound(_0x5cee0d,_0x2f5c72){return function(_0x4aa64f){if(!_0x4aa64f){_0x5cee0d[_0x89f0('0x1a')](0x194);}return _0x4aa64f;};}function handleError(_0x1d7de6,_0x42d8dc){_0x42d8dc=_0x42d8dc||0x1f4;return function(_0x4c6e8d){logger['error'](_0x4c6e8d[_0x89f0('0x2a')]);if(_0x4c6e8d[_0x89f0('0x2b')]){delete _0x4c6e8d['name'];}_0x1d7de6[_0x89f0('0x1b')](_0x42d8dc)['send'](_0x4c6e8d);};}exports[_0x89f0('0x2c')]=function(_0x25cb6a,_0x16bdbc){var _0x585ef9={},_0x8749b0={},_0x216171={'count':0x0,'rows':[]};var _0xbc4a39=_[_0x89f0('0x2d')](db['VoiceRecording'][_0x89f0('0x2e')],function(_0x4d68ca){return{'name':_0x4d68ca['fieldName'],'type':_0x4d68ca[_0x89f0('0x2f')][_0x89f0('0x30')]};});_0x8749b0['model']=_['differenceBy'](_[_0x89f0('0x2d')](_0xbc4a39,_0x89f0('0x2b')),[_0x89f0('0x31')]);_0x8749b0['query']=_[_0x89f0('0x32')](_0x25cb6a['query']);_0x8749b0['filters']=_['intersection'](_0x8749b0[_0x89f0('0x33')],_0x8749b0['query']);_0x585ef9[_0x89f0('0x34')]=_[_0x89f0('0x35')](_0x8749b0[_0x89f0('0x33')],qs[_0x89f0('0x36')](_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x36')]));_0x585ef9[_0x89f0('0x34')]=_0x585ef9['attributes']['length']?_0x585ef9['attributes']:_0x8749b0['model'];if(!_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x38')](_0x89f0('0x39'))){_0x585ef9[_0x89f0('0x20')]=qs[_0x89f0('0x20')](_0x25cb6a[_0x89f0('0x37')]['limit']);_0x585ef9[_0x89f0('0x1e')]=qs[_0x89f0('0x1e')](_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x1e')]);}_0x585ef9[_0x89f0('0x3a')]=qs[_0x89f0('0x3b')](_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x3b')]);_0x585ef9['where']=qs[_0x89f0('0x3c')](_[_0x89f0('0x3d')](_0x25cb6a['query'],_0x8749b0['filters']),_0xbc4a39);if(_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x3e')]){_0x585ef9[_0x89f0('0x3f')]=_[_0x89f0('0x40')](_0x585ef9['where'],{'$or':_[_0x89f0('0x2d')](_0xbc4a39,function(_0x132dc5){if(_0x132dc5[_0x89f0('0x2f')]!==_0x89f0('0x41')){var _0x41e7c0={};_0x41e7c0[_0x132dc5['name']]={'$like':'%'+_0x25cb6a[_0x89f0('0x37')][_0x89f0('0x3e')]+'%'};return _0x41e7c0;}})});}_0x585ef9=_['merge']({},_0x585ef9,_0x25cb6a[_0x89f0('0x42')]);var _0x4ad62c={'where':_0x585ef9[_0x89f0('0x3f')]};return db['VoiceRecording'][_0x89f0('0x21')](_0x4ad62c)[_0x89f0('0x28')](function(_0x5f580d){_0x216171[_0x89f0('0x21')]=_0x5f580d;if(_0x25cb6a[_0x89f0('0x37')]['includeAll']){_0x585ef9[_0x89f0('0x43')]=[{'all':!![]}];}return db[_0x89f0('0x44')][_0x89f0('0x45')](_0x585ef9);})['then'](function(_0x2842da){_0x216171[_0x89f0('0x46')]=_0x2842da;return _0x216171;})[_0x89f0('0x28')](respondWithFilteredResult(_0x16bdbc,_0x585ef9))[_0x89f0('0x47')](handleError(_0x16bdbc,null));};exports['show']=function(_0x7b9f30,_0x271b29){var _0x19748d={'raw':![],'where':{'id':_0x7b9f30['params']['id']}},_0x457666={};_0x457666[_0x89f0('0x33')]=_[_0x89f0('0x32')](db['VoiceRecording'][_0x89f0('0x2e')]);_0x457666[_0x89f0('0x37')]=_[_0x89f0('0x32')](_0x7b9f30[_0x89f0('0x37')]);_0x457666['filters']=_[_0x89f0('0x35')](_0x457666[_0x89f0('0x33')],_0x457666[_0x89f0('0x37')]);_0x19748d[_0x89f0('0x34')]=_[_0x89f0('0x35')](_0x457666[_0x89f0('0x33')],qs[_0x89f0('0x36')](_0x7b9f30[_0x89f0('0x37')]['fields']));_0x19748d[_0x89f0('0x34')]=_0x19748d[_0x89f0('0x34')]['length']?_0x19748d[_0x89f0('0x34')]:_0x457666[_0x89f0('0x33')];if(_0x7b9f30[_0x89f0('0x37')][_0x89f0('0x48')]){_0x19748d[_0x89f0('0x43')]=[{'all':!![]}];}_0x19748d=_[_0x89f0('0x40')]({},_0x19748d,_0x7b9f30[_0x89f0('0x42')]);return db['VoiceRecording']['find'](_0x19748d)[_0x89f0('0x28')](handleEntityNotFound(_0x271b29,null))['then'](respondWithResult(_0x271b29,null))[_0x89f0('0x47')](handleError(_0x271b29,null));};exports[_0x89f0('0x49')]=function(_0x8820bb,_0x583136){return db[_0x89f0('0x44')][_0x89f0('0x49')](_0x8820bb[_0x89f0('0x4a')],{})[_0x89f0('0x28')](respondWithResult(_0x583136,0xc9))[_0x89f0('0x47')](handleError(_0x583136,null));};exports[_0x89f0('0x27')]=function(_0x54d423,_0x18e131){if(_0x54d423[_0x89f0('0x4a')]['id']){delete _0x54d423['body']['id'];}return db[_0x89f0('0x44')][_0x89f0('0x4b')]({'where':{'id':_0x54d423[_0x89f0('0x4c')]['id']}})[_0x89f0('0x28')](handleEntityNotFound(_0x18e131,null))['then'](saveUpdates(_0x54d423[_0x89f0('0x4a')],null))['then'](respondWithResult(_0x18e131,null))['catch'](handleError(_0x18e131,null));};exports['describe']=function(_0x420e44,_0x12710c){return db[_0x89f0('0x44')][_0x89f0('0x4d')]()['then'](respondWithResult(_0x12710c,null))[_0x89f0('0x47')](handleError(_0x12710c,null));};exports[_0x89f0('0x4e')]=function(_0x3e236a,_0x2c543e,_0x550d2b){var _0x27e2cc=require(_0x89f0('0x4f'));var _0x470d1d=![];var _0x4bc5c0={};if(_0x3e236a[_0x89f0('0x37')]['type']&&_0x3e236a[_0x89f0('0x37')]['type']===_0x89f0('0x50')){_0x4bc5c0[_0x89f0('0x50')]=_0x3e236a[_0x89f0('0x4c')]['id'];}else{_0x4bc5c0['id']=_0x3e236a[_0x89f0('0x4c')]['id'];}return db[_0x89f0('0x44')][_0x89f0('0x4b')]({'where':_0x4bc5c0,'attributes':['id',_0x89f0('0x51')],'raw':!![]})[_0x89f0('0x28')](handleEntityNotFound(_0x2c543e,null))['then'](function(_0x4da99f){if(_0x4da99f){var _0x27044c=_0x4da99f['value'];var _0x1004d1=util[_0x89f0('0x31')]('%s.cypher',_0x27044c);if(fs[_0x89f0('0x52')](_0x1004d1)){_0x470d1d=!![];return _0x27e2cc[_0x89f0('0x53')](_0x1004d1,_0x27044c,config['secrets']['recording'])['then'](function(){return _0x4da99f;});}return _0x4da99f;}})['then'](function(_0xc75d1f){if(_0xc75d1f){var _0x1db86b=_0xc75d1f[_0x89f0('0x51')];if(!fs['existsSync'](_0x1db86b)){throw new db['Sequelize']['ValidationError'](_0x89f0('0x54'));}if(_0xc75d1f[_0x89f0('0x55')]){return _0x2c543e['download'](_0x1db86b,_0xc75d1f[_0x89f0('0x55')]+path[_0x89f0('0x56')](_0x1db86b),function(){if(_0x470d1d){fs[_0x89f0('0x57')](_0x1db86b);}});}else{return _0x2c543e[_0x89f0('0x4e')](_0x1db86b,function(_0x50ec5c){if(_0x470d1d){fs[_0x89f0('0x57')](_0x1db86b);}});}}})['catch'](function(_0x37e48f){if(_0x37e48f[_0x89f0('0x58')]===_0x89f0('0x54')){_0x2c543e[_0x89f0('0x1b')](0x194)['send'](_0x89f0('0x59'));}else{return handleError(_0x2c543e,null);}});};exports['downloads']=function(_0x251664,_0x3a6bcc,_0x128e90){var _0x468ae2=require('../../components/encryptor');var _0x21b604=![];var _0x14b69d={'$and':[db[_0x89f0('0x5a')][_0x89f0('0x3f')](db[_0x89f0('0x5a')]['fn'](_0x89f0('0x5b'),db[_0x89f0('0x5a')][_0x89f0('0x5c')](_0x89f0('0x50'))),_0x251664[_0x89f0('0x37')][_0x89f0('0x5d')])]};if(_0x251664[_0x89f0('0x37')][_0x89f0('0x2f')]&&_0x251664[_0x89f0('0x37')][_0x89f0('0x2f')]==='uniqueid'){_0x14b69d['$and']['push']({'uniqueid':_0x251664['params']['id']});}else{_0x14b69d[_0x89f0('0x5e')][_0x89f0('0x5f')]({'id':_0x251664[_0x89f0('0x4c')]['id']});}return db['VoiceRecording'][_0x89f0('0x4b')]({'where':_0x14b69d,'attributes':['id','value'],'raw':!![]})[_0x89f0('0x28')](handleEntityNotFound(_0x3a6bcc,null))[_0x89f0('0x28')](function(_0x242f05){if(_0x242f05){var _0x316513=util[_0x89f0('0x31')](_0x89f0('0x60'),_0x242f05[_0x89f0('0x51')]);if(fs['existsSync'](_0x316513)){_0x21b604=!![];return _0x468ae2['decryptFile'](_0x316513,_0x242f05[_0x89f0('0x51')],config[_0x89f0('0x61')][_0x89f0('0x62')])[_0x89f0('0x28')](function(){return _0x242f05;});}return _0x242f05;}})[_0x89f0('0x28')](function(_0x15eab8){if(_0x15eab8){if(!fs[_0x89f0('0x52')](_0x15eab8['value'])){throw new db[(_0x89f0('0x63'))]['ValidationError'](_0x89f0('0x54'));}if(_0x15eab8['filename']){return _0x3a6bcc['download'](_0x15eab8[_0x89f0('0x51')],_0x15eab8[_0x89f0('0x55')]+path[_0x89f0('0x56')](_0x15eab8[_0x89f0('0x51')]),function(){if(_0x21b604){fs['unlink'](_0x15eab8[_0x89f0('0x51')]);}});}else{return _0x3a6bcc[_0x89f0('0x4e')](_0x15eab8[_0x89f0('0x51')],function(_0x53df1c){if(_0x21b604){fs[_0x89f0('0x57')](_0x15eab8[_0x89f0('0x51')]);}});}}})[_0x89f0('0x47')](handleError(_0x3a6bcc,null));};exports[_0x89f0('0x29')]=function(_0x2f6487,_0x4302bc){return db[_0x89f0('0x44')][_0x89f0('0x4b')]({'where':{'id':_0x2f6487[_0x89f0('0x4c')]['id']}})['then'](function(_0x19c3c9){if(_[_0x89f0('0x64')](_0x19c3c9)){throw new ReferenceError(_0x89f0('0x65'));}return _0x19c3c9;})[_0x89f0('0x28')](function(_0x4096f0){var _0x1ec980=_0x4096f0[_0x89f0('0x51')];logger['info'](_0x89f0('0x66'),_0x1ec980);if(!_[_0x89f0('0x64')](_0x4096f0['value'])&&fs['existsSync'](_0x1ec980)){logger[_0x89f0('0x67')](_0x89f0('0x68')+_0x1ec980+_0x89f0('0x69'));fs[_0x89f0('0x6a')](_0x1ec980);}_0x1ec980=_0x1ec980+'.cypher';if(!_[_0x89f0('0x64')](_0x4096f0[_0x89f0('0x51')])&&fs['existsSync'](_0x1ec980)){logger[_0x89f0('0x67')](_0x89f0('0x68')+_0x1ec980+_0x89f0('0x69'));fs[_0x89f0('0x6a')](_0x1ec980);}return _0x4096f0;})['then'](function(_0x2c7e44){if(!_0x2c7e44)throw new InternalError();return _0x2c7e44[_0x89f0('0x29')]();})['then'](function(){_0x4302bc[_0x89f0('0x1b')](0xcc)['end']();})['catch'](handleError(_0x4302bc,null));};function getBucketslist(_0x5e8789,_0x5e4910,_0x28db7d){return new Promise(function(_0x25c9f1,_0x509fca){var _0x2748e9=new AWS['S3']({'accessKeyId':_0x5e4910,'secretAccessKey':_0x5e8789,'region':_0x28db7d});_0x2748e9['listBuckets']({},function(_0x27db64,_0x132b7e){if(_0x27db64){return _0x509fca(_0x27db64);}else{return _0x25c9f1(_0x132b7e);}});});}function createBucket(_0x2c8739,_0x529f63,_0x5b46bc,_0x1e9047){return new Promise(function(_0xc20b81,_0x51b612){var _0x530164=new AWS['S3']({'accessKeyId':_0x529f63,'secretAccessKey':_0x2c8739,'region':_0x5b46bc});_0x530164[_0x89f0('0x6b')]({'Bucket':_0x1e9047},function(_0x3b849c,_0x5d3908){if(_0x3b849c){return _0x51b612(_0x3b849c);}else{return _0xc20b81(_0x5d3908);}});});}function uploadFile(_0x398278,_0x48d858,_0x583753,_0x41a2cb,_0x3ad3e0,_0x4077ad){return new Promise(function(_0x4dcec7,_0x316e75){var _0x248369=new AWS['S3']({'accessKeyId':_0x48d858,'secretAccessKey':_0x398278,'region':_0x583753});_0x248369[_0x89f0('0x6c')]({'Bucket':_0x41a2cb,'Key':_0x3ad3e0,'Body':_0x4077ad},function(_0x19a832,_0x1fe616){if(_0x19a832){return _0x316e75(_0x19a832);}else{return _0x4dcec7(_0x1fe616);}});});}function startTranscribe(_0x52c91c,_0x2d2b8e,_0x103b1e,_0x52e24e,_0x10eb4b,_0x282a8a){return new Promise(function(_0x27aea7,_0xa08aae){var _0x46b9cd=new AWS[(_0x89f0('0x6d'))]({'accessKeyId':_0x2d2b8e,'secretAccessKey':_0x52c91c,'region':_0x103b1e});_0x46b9cd[_0x89f0('0x6e')]({'TranscriptionJobName':_0x52e24e,'LanguageCode':_0x10eb4b,'Media':{'MediaFileUri':_0x282a8a}},function(_0x3c770e,_0x16dbfa){if(_0x3c770e){return _0xa08aae(_0x3c770e);}else{return _0x27aea7(_0x16dbfa);}});});}function transcribe(_0x3e3a44,_0x43547a,_0x14ec64,_0x14153a,_0x2c84cd,_0x45d6e6,_0x37f5a7){return new Promise(function(_0x56ed26,_0x14ccb3){var _0x1b8118={};logger['info'](util[_0x89f0('0x31')](_0x89f0('0x6f'),_0x3e3a44,_0x2c84cd));return uploadFile(_0x43547a,_0x14ec64,_0x14153a,_0x2c84cd,path[_0x89f0('0x70')](_0x45d6e6),fs[_0x89f0('0x71')](_0x45d6e6))[_0x89f0('0x28')](function(_0x1fd340){logger[_0x89f0('0x67')](util[_0x89f0('0x31')](_0x89f0('0x72'),_0x3e3a44,_0x2c84cd,_0x1fd340[_0x89f0('0x73')]));_0x1b8118[_0x89f0('0x74')]=_0x1fd340['Bucket'];_0x1b8118[_0x89f0('0x75')]=_0x1fd340[_0x89f0('0x73')];logger['info'](util[_0x89f0('0x31')](_0x89f0('0x76'),_0x3e3a44));return startTranscribe(_0x43547a,_0x14ec64,_0x14153a,uuidv4(),_0x37f5a7,_0x1fd340[_0x89f0('0x73')]);})[_0x89f0('0x28')](function(_0x4b65cd){logger[_0x89f0('0x67')](util[_0x89f0('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x3e3a44,_0x4b65cd[_0x89f0('0x77')][_0x89f0('0x78')]));_0x1b8118[_0x89f0('0x79')]=_0x4b65cd[_0x89f0('0x77')][_0x89f0('0x78')];_0x1b8118[_0x89f0('0x7a')]=_0x4b65cd[_0x89f0('0x77')]['TranscriptionJobStatus'];return _0x56ed26(_0x1b8118);})['catch'](function(_0x50d641){return _0x14ccb3(_0x50d641);});});}exports[_0x89f0('0x7b')]=function(_0x205422,_0x10436d,_0x3d6d6a){var _0x4d6f90;var _0x359eb7;var _0x3fa5c3;var _0x5a37e6=require('../../components/encryptor');return db[_0x89f0('0x44')][_0x89f0('0x7c')]({'where':{'id':_0x205422['params']['id']}})['then'](function(_0x7c8054){if(_0x7c8054){var _0x1246e7=util[_0x89f0('0x31')](_0x89f0('0x60'),_0x7c8054[_0x89f0('0x51')]);if(fs[_0x89f0('0x52')](_0x1246e7)){cypher=!![];return _0x5a37e6['decryptFile'](_0x1246e7,_0x7c8054[_0x89f0('0x51')],config['secrets']['recording'])[_0x89f0('0x28')](function(){return _0x7c8054;});}return _0x7c8054;}})['then'](function(_0x1741e2){if(!_0x1741e2){throw new db[(_0x89f0('0x63'))]['ValidationError'](_0x89f0('0x7d'));}_0x359eb7=_0x1741e2;return db['Setting'][_0x89f0('0x7c')]({'where':{'id':0x1}});})[_0x89f0('0x28')](handleEntityNotFound(_0x10436d,null))[_0x89f0('0x28')](function(_0x14b614){if(_0x14b614){_0x4d6f90=_0x14b614;if(!_0x4d6f90['transcribe']||!_0x4d6f90[_0x89f0('0x7e')]||!_0x4d6f90[_0x89f0('0x7f')]||!_0x4d6f90['language']||!_0x4d6f90[_0x89f0('0x74')]){throw new db['Sequelize'][(_0x89f0('0x80'))](_0x89f0('0x81'));}if(_0x205422['body'][_0x89f0('0x82')]&&(!_0x4d6f90[_0x89f0('0x83')]||!_0x4d6f90[_0x89f0('0x84')]||!_0x4d6f90[_0x89f0('0x85')]||!_0x4d6f90[_0x89f0('0x86')]||!_0x4d6f90[_0x89f0('0x74')])){throw new db[(_0x89f0('0x63'))]['ValidationError'](_0x89f0('0x87'));}return db[_0x89f0('0x88')][_0x89f0('0x7c')]({'where':{'id':_0x4d6f90[_0x89f0('0x7e')]}});}})['then'](function(_0x433cfa){if(!_0x433cfa){throw new db['Sequelize'][(_0x89f0('0x80'))](_0x89f0('0x89'));}if(!_0x433cfa['data1']||!_0x433cfa['data2']){throw new db[(_0x89f0('0x63'))][(_0x89f0('0x80'))](_0x89f0('0x8a'));}_0x3fa5c3=_0x433cfa;return getBucketslist(_0x3fa5c3[_0x89f0('0x8b')],_0x3fa5c3[_0x89f0('0x8c')],_0x4d6f90[_0x89f0('0x7f')]);})[_0x89f0('0x28')](function(_0x79c314){if(_0x79c314&&_0x79c314[_0x89f0('0x8d')]){var _0x494306=_[_0x89f0('0x4b')](_0x79c314[_0x89f0('0x8d')],function(_0x5f25ab){return _0x5f25ab[_0x89f0('0x8e')]===_0x4d6f90[_0x89f0('0x74')];});if(!_0x494306){logger[_0x89f0('0x67')](util[_0x89f0('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x205422[_0x89f0('0x4c')]['id'],_0x4d6f90['bucket']));return createBucket(_0x3fa5c3[_0x89f0('0x8b')],_0x3fa5c3[_0x89f0('0x8c')],_0x4d6f90[_0x89f0('0x7f')],_0x4d6f90[_0x89f0('0x74')]);}logger[_0x89f0('0x67')](util[_0x89f0('0x31')](_0x89f0('0x8f'),_0x205422[_0x89f0('0x4c')]['id'],_0x4d6f90['bucket']));return;}})[_0x89f0('0x28')](function(_0x3f4d52){if(_0x359eb7['transcribeStatus']===_0x89f0('0x90')){return transcribe(_0x205422['params']['id'],_0x3fa5c3[_0x89f0('0x8b')],_0x3fa5c3[_0x89f0('0x8c')],_0x4d6f90['transcribeRegion'],_0x4d6f90[_0x89f0('0x74')],_0x359eb7[_0x89f0('0x51')],_0x4d6f90['language']);}else{logger['info'](util[_0x89f0('0x31')](_0x89f0('0x91'),_0x205422[_0x89f0('0x4c')]['id']));return{'transcribeStatus':_0x89f0('0x92')};}})[_0x89f0('0x28')](function(_0x32e0a0){if(_0x32e0a0){_0x32e0a0[_0x89f0('0x93')]=_0x205422[_0x89f0('0x4a')][_0x89f0('0x82')];return _0x359eb7['updateAttributes'](_0x32e0a0);}})[_0x89f0('0x28')](respondWithResult(_0x10436d,null))[_0x89f0('0x47')](handleError(_0x10436d,null));};function writeFile(_0x274973,_0x200ee6){return new Promise(function(_0x195472,_0x38f892){fs[_0x89f0('0x94')](_0x200ee6,_0x274973,function(_0x31e523,_0x150ec1){if(_0x31e523){return _0x38f892(_0x31e523);}else{return _0x195472(_0x150ec1);}});});}exports[_0x89f0('0x95')]=function(_0x4504f5,_0x4fa309,_0x31303f){return db[_0x89f0('0x44')][_0x89f0('0x7c')]({'where':{'id':_0x4504f5[_0x89f0('0x4c')]['id']}})[_0x89f0('0x28')](handleEntityNotFound(_0x4fa309))['then'](function(_0x9e0f98){if(_0x9e0f98&&_0x9e0f98[_0x89f0('0x96')]){var _0x31dad8=_0x9e0f98[_0x89f0('0x96')];var _0xaf3321=config[_0x89f0('0x97')]+'/server/files/transcribes/transcribe_'+_0x9e0f98['id']+'.txt';if(fs['existsSync'](_0xaf3321)){return _0xaf3321;}return writeFile(_0x31dad8,_0xaf3321)[_0x89f0('0x28')](function(){return _0xaf3321;});}else{throw new db[(_0x89f0('0x63'))][(_0x89f0('0x80'))](_0x89f0('0x98'));}})[_0x89f0('0x28')](function(_0x15516a){return _0x4fa309[_0x89f0('0x4e')](_0x15516a);})['catch'](handleError(_0x4fa309));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 9f832ce..0877174 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 _0x85de=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','define'];(function(_0xfcf737,_0x132075){var _0x5eccbe=function(_0x2dc482){while(--_0x2dc482){_0xfcf737['push'](_0xfcf737['shift']());}};_0x5eccbe(++_0x132075);}(_0x85de,0x65));var _0xe85d=function(_0xa3633f,_0x19efea){_0xa3633f=_0xa3633f-0x0;var _0x559e56=_0x85de[_0xa3633f];return _0x559e56;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var logger=require(_0xe85d('0x2'))(_0xe85d('0x3'));var moment=require(_0xe85d('0x4'));var BPromise=require(_0xe85d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe85d('0x6'));var rimraf=require(_0xe85d('0x7'));var config=require(_0xe85d('0x8'));var attributes=require(_0xe85d('0x9'));module['exports']=function(_0x5f12a2,_0x2797cd){return _0x5f12a2[_0xe85d('0xa')](_0xe85d('0xb'),attributes,{'tableName':_0xe85d('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe85d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8868=['../../config/logger','api','moment','rimraf','./voiceRecording.attributes','exports','define','uniqueid','lodash','util'];(function(_0x22bb66,_0x3f199b){var _0x493d32=function(_0x30a142){while(--_0x30a142){_0x22bb66['push'](_0x22bb66['shift']());}};_0x493d32(++_0x3f199b);}(_0x8868,0x1ac));var _0x8886=function(_0x5cb262,_0x5dd97d){_0x5cb262=_0x5cb262-0x0;var _0x41da4c=_0x8868[_0x5cb262];return _0x41da4c;};'use strict';var _=require(_0x8886('0x0'));var util=require(_0x8886('0x1'));var logger=require(_0x8886('0x2'))(_0x8886('0x3'));var moment=require(_0x8886('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8886('0x5'));var config=require('../../config/environment');var attributes=require(_0x8886('0x6'));module[_0x8886('0x7')]=function(_0x2e1761,_0x23c580){return _0x2e1761[_0x8886('0x8')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8886('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4cbc44c..9219b0a 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 _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x32f4,0x154));var _0x432f=function(_0x57f1b7,_0xf52ae8){_0x57f1b7=_0x57f1b7-0x0;var _0x4629b6=_0x32f4[_0x57f1b7];return _0x4629b6;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file +var _0xd7d1=['unlink','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x296fa0,_0x42e601){_0x296fa0=_0x296fa0-0x0;var _0x575e10=_0xd7d1[_0x296fa0];return _0x575e10;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['VoiceRecording'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2['options'][_0x1d7d('0x1e')]||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['attributes']||null:null,'limit':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['limit']||null:null})['then'](function(_0x1dcaf2){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger['debug'](_0x1d7d('0x19'),_0x4db4f2,JSON[_0x1d7d('0x13')](_0x1dcaf2));_0x191024(_0x1dcaf2);})[_0x1d7d('0x18')](function(_0x21e59){logger['error'](_0x1d7d('0x19'),_0x21e59[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f['error'](0x1f4,_0x21e59['message']));});});};exports[_0x1d7d('0x1f')]=function(_0x52c618){var _0x38c323=this;return new Promise(function(_0x2d4de4,_0x3bc6e8){var _0x22c40d=require(_0x1d7d('0x20'));var _0x59f827;return db[_0x1d7d('0x21')][_0x1d7d('0x22')]({'attributes':['id',_0x1d7d('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x78adbe){_0x59f827=_0x78adbe;return db[_0x1d7d('0x24')][_0x1d7d('0x25')](_0x52c618['body']);})['then'](function(_0x53e25c){if(_0x59f827[_0x1d7d('0x23')]&&fs[_0x1d7d('0x26')](_0x53e25c['value'])){var _0x1ebcbc=util[_0x1d7d('0x27')](_0x1d7d('0x28'),_0x53e25c[_0x1d7d('0x29')]);return _0x22c40d[_0x1d7d('0x2a')](_0x53e25c[_0x1d7d('0x29')],_0x1ebcbc,config[_0x1d7d('0x2b')][_0x1d7d('0x2c')])[_0x1d7d('0xe')](function(){fs[_0x1d7d('0x2d')](_0x53e25c['value']);logger['info'](_0x1d7d('0x2e'));return _0x53e25c;});}return _0x53e25c;})[_0x1d7d('0xe')](function(_0x90e852){logger[_0x1d7d('0xf')](_0x1d7d('0x1f'),_0x52c618);logger[_0x1d7d('0x2f')](_0x1d7d('0x1f'),_0x52c618,JSON[_0x1d7d('0x13')](_0x90e852));_0x2d4de4(_0x90e852);})[_0x1d7d('0x18')](function(_0x47b6b2){logger[_0x1d7d('0x14')](_0x1d7d('0x1f'),_0x47b6b2[_0x1d7d('0x16')],_0x52c618);_0x3bc6e8(_0x38c323[_0x1d7d('0x14')](0x1f4,_0x47b6b2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0ac96bd..24adc57 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 _0x5ff6=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0x5ff6,0x87));var _0x65ff=function(_0x17650b,_0x3adc11){_0x17650b=_0x17650b-0x0;var _0x10c33c=_0x5ff6[_0x17650b];return _0x10c33c;};'use strict';var multer=require(_0x65ff('0x0'));var util=require(_0x65ff('0x1'));var path=require(_0x65ff('0x2'));var timeout=require(_0x65ff('0x3'));var express=require(_0x65ff('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x65ff('0x5'));var config=require(_0x65ff('0x6'));var controller=require(_0x65ff('0x7'));router[_0x65ff('0x8')]('/',auth['isAuthenticated'](),controller[_0x65ff('0x9')]);router[_0x65ff('0x8')](_0x65ff('0xa'),auth[_0x65ff('0xb')](),controller[_0x65ff('0xc')]);router[_0x65ff('0x8')](_0x65ff('0xd'),auth[_0x65ff('0xb')](),controller[_0x65ff('0xe')]);router[_0x65ff('0xf')]('/',auth[_0x65ff('0xb')](),controller[_0x65ff('0x10')]);router[_0x65ff('0x11')]('/:id',auth[_0x65ff('0xb')](),controller[_0x65ff('0x12')]);router[_0x65ff('0x13')](_0x65ff('0xd'),auth['isAuthenticated'](),controller[_0x65ff('0x14')]);module[_0x65ff('0x15')]=router; \ No newline at end of file +var _0x0a0b=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5e3b76,_0x2d9114){var _0x177788=function(_0x30e0d3){while(--_0x30e0d3){_0x5e3b76['push'](_0x5e3b76['shift']());}};_0x177788(++_0x2d9114);}(_0x0a0b,0x161));var _0xb0a0=function(_0x30e652,_0x1236d3){_0x30e652=_0x30e652-0x0;var _0x1b3347=_0x0a0b[_0x30e652];return _0x1b3347;};'use strict';var multer=require(_0xb0a0('0x0'));var util=require(_0xb0a0('0x1'));var path=require(_0xb0a0('0x2'));var timeout=require(_0xb0a0('0x3'));var express=require(_0xb0a0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb0a0('0x5'));var interaction=require(_0xb0a0('0x6'));var config=require(_0xb0a0('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xb0a0('0x8')]('/',auth[_0xb0a0('0x9')](),controller[_0xb0a0('0xa')]);router[_0xb0a0('0x8')]('/describe',auth[_0xb0a0('0x9')](),controller[_0xb0a0('0xb')]);router['get'](_0xb0a0('0xc'),auth['isAuthenticated'](),controller[_0xb0a0('0xd')]);router['post']('/',auth[_0xb0a0('0x9')](),controller[_0xb0a0('0xe')]);router[_0xb0a0('0xf')](_0xb0a0('0xc'),auth[_0xb0a0('0x9')](),controller[_0xb0a0('0x10')]);router[_0xb0a0('0x11')](_0xb0a0('0xc'),auth['isAuthenticated'](),controller[_0xb0a0('0x12')]);module[_0xb0a0('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 532e4be..0c288ac 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 _0xf4cc=['Yes','sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x564878,_0x32b7db){var _0x26e2fb=function(_0x3fa780){while(--_0x3fa780){_0x564878['push'](_0x564878['shift']());}};_0x26e2fb(++_0x32b7db);}(_0xf4cc,0x181));var _0xcf4c=function(_0x38d0a7,_0x548a0b){_0x38d0a7=_0x38d0a7-0x0;var _0xbaa08f=_0xf4cc[_0x38d0a7];return _0xbaa08f;};'use strict';var Sequelize=require(_0xcf4c('0x0'));var moment=require(_0xcf4c('0x1'));module[_0xcf4c('0x2')]={'type':{'type':Sequelize[_0xcf4c('0x3')](_0xcf4c('0x4'),_0xcf4c('0x5'))},'result':{'type':Sequelize[_0xcf4c('0x6')]},'transfererchannel':{'type':Sequelize[_0xcf4c('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xcf4c('0x6')]},'transferercalleridname':{'type':Sequelize[_0xcf4c('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xcf4c('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xcf4c('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xcf4c('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xcf4c('0x6')]},'transfereechannel':{'type':Sequelize[_0xcf4c('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xcf4c('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xcf4c('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xcf4c('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xcf4c('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xcf4c('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xcf4c('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xcf4c('0x7'),'No')},'context':{'type':Sequelize[_0xcf4c('0x6')]},'extension':{'type':Sequelize[_0xcf4c('0x6')]}}; \ No newline at end of file +var _0x835c=['ENUM','blind','attended','STRING','sequelize','moment','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x835c,0x177));var _0xc835=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x835c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc835('0x0'));var moment=require(_0xc835('0x1'));module[_0xc835('0x2')]={'type':{'type':Sequelize[_0xc835('0x3')](_0xc835('0x4'),_0xc835('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xc835('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xc835('0x6')]},'transferercalleridname':{'type':Sequelize[_0xc835('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc835('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xc835('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xc835('0x6')]},'transferercontext':{'type':Sequelize[_0xc835('0x6')]},'transfererexten':{'type':Sequelize[_0xc835('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xc835('0x6')]},'transfereechannel':{'type':Sequelize[_0xc835('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xc835('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc835('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc835('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xc835('0x6')]},'transfereecontext':{'type':Sequelize[_0xc835('0x6')]},'transfereeexten':{'type':Sequelize[_0xc835('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xc835('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xc835('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 368d718..a3f6f61 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 _0xc89e=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x203adb,_0x26d4bc){var _0x52e7d0=function(_0x372ef7){while(--_0x372ef7){_0x203adb['push'](_0x203adb['shift']());}};_0x52e7d0(++_0x26d4bc);}(_0xc89e,0xd1));var _0xec89=function(_0x4b5ae2,_0x298c5b){_0x4b5ae2=_0x4b5ae2-0x0;var _0x310f0c=_0xc89e[_0x4b5ae2];return _0x310f0c;};'use strict';var emlformat=require(_0xec89('0x0'));var rimraf=require(_0xec89('0x1'));var zipdir=require(_0xec89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec89('0x3'));var moment=require('moment');var BPromise=require(_0xec89('0x4'));var Mustache=require(_0xec89('0x5'));var util=require('util');var path=require(_0xec89('0x6'));var sox=require('sox');var csv=require(_0xec89('0x7'));var ejs=require(_0xec89('0x8'));var fs=require('fs');var fs_extra=require(_0xec89('0x9'));var _=require('lodash');var squel=require(_0xec89('0xa'));var crypto=require(_0xec89('0xb'));var jsforce=require(_0xec89('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec89('0x7'));var querystring=require(_0xec89('0xd'));var Papa=require(_0xec89('0xe'));var Redis=require(_0xec89('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec89('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec89('0x11'));var logger=require(_0xec89('0x12'))('api');var utils=require(_0xec89('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec89('0x14'))['db'];function respondWithStatusCode(_0x30e844,_0x3d6691){_0x3d6691=_0x3d6691||0xcc;return function(_0x2ddf25){if(_0x2ddf25){return _0x30e844[_0xec89('0x15')](_0x3d6691);}return _0x30e844[_0xec89('0x16')](_0x3d6691)[_0xec89('0x17')]();};}function respondWithResult(_0x50d224,_0x18b236){_0x18b236=_0x18b236||0xc8;return function(_0x9f5680){if(_0x9f5680){return _0x50d224[_0xec89('0x16')](_0x18b236)[_0xec89('0x18')](_0x9f5680);}};}function respondWithFilteredResult(_0x43e4a1,_0x42c713){return function(_0x47c6f7){if(_0x47c6f7){var _0x8312b4=typeof _0x42c713[_0xec89('0x19')]===_0xec89('0x1a')&&typeof _0x42c713['limit']===_0xec89('0x1a');var _0x3b6da8=_0x47c6f7[_0xec89('0x1b')];var _0x5a407b=_0x8312b4?0x0:_0x42c713[_0xec89('0x19')];var _0x1dbd0f=_0x8312b4?_0x47c6f7['count']:_0x42c713[_0xec89('0x19')]+_0x42c713['limit'];var _0x310ca5;if(_0x1dbd0f>=_0x3b6da8){_0x1dbd0f=_0x3b6da8;_0x310ca5=0xc8;}else{_0x310ca5=0xce;}_0x43e4a1[_0xec89('0x16')](_0x310ca5);return _0x43e4a1[_0xec89('0x1c')]('Content-Range',_0x5a407b+'-'+_0x1dbd0f+'/'+_0x3b6da8)[_0xec89('0x18')](_0x47c6f7);}return null;};}function patchUpdates(_0x51c164){return function(_0x496349){try{jsonpatch['apply'](_0x496349,_0x51c164,!![]);}catch(_0x43d4b8){return BPromise[_0xec89('0x1d')](_0x43d4b8);}return _0x496349[_0xec89('0x1e')]();};}function saveUpdates(_0xcf8a32,_0x58b101){return function(_0x3870ac){if(_0x3870ac){return _0x3870ac[_0xec89('0x1f')](_0xcf8a32)[_0xec89('0x20')](function(_0x4e46c4){return _0x4e46c4;});}return null;};}function removeEntity(_0x1133df,_0x2ba803){return function(_0x1d530d){if(_0x1d530d){return _0x1d530d[_0xec89('0x21')]()[_0xec89('0x20')](function(){_0x1133df[_0xec89('0x16')](0xcc)[_0xec89('0x17')]();});}};}function handleEntityNotFound(_0x5e30da,_0x2aed49){return function(_0xa70fa6){if(!_0xa70fa6){_0x5e30da['sendStatus'](0x194);}return _0xa70fa6;};}function handleError(_0x5c6e39,_0x3cec92){_0x3cec92=_0x3cec92||0x1f4;return function(_0x535c65){logger[_0xec89('0x22')](_0x535c65[_0xec89('0x23')]);if(_0x535c65[_0xec89('0x24')]){delete _0x535c65[_0xec89('0x24')];}_0x5c6e39[_0xec89('0x16')](_0x3cec92)['send'](_0x535c65);};}exports[_0xec89('0x25')]=function(_0x4f0bd0,_0x465b1f){var _0x22b09b={},_0x40ae91={},_0x57c68f={'count':0x0,'rows':[]};var _0x3a9938=_[_0xec89('0x26')](db[_0xec89('0x27')][_0xec89('0x28')],function(_0x538fc0){return{'name':_0x538fc0[_0xec89('0x29')],'type':_0x538fc0[_0xec89('0x2a')][_0xec89('0x2b')]};});_0x40ae91[_0xec89('0x2c')]=_[_0xec89('0x26')](_0x3a9938,_0xec89('0x24'));_0x40ae91[_0xec89('0x2d')]=_[_0xec89('0x2e')](_0x4f0bd0['query']);_0x40ae91[_0xec89('0x2f')]=_[_0xec89('0x30')](_0x40ae91[_0xec89('0x2c')],_0x40ae91[_0xec89('0x2d')]);_0x22b09b[_0xec89('0x31')]=_[_0xec89('0x30')](_0x40ae91['model'],qs[_0xec89('0x32')](_0x4f0bd0[_0xec89('0x2d')]['fields']));_0x22b09b[_0xec89('0x31')]=_0x22b09b[_0xec89('0x31')][_0xec89('0x33')]?_0x22b09b['attributes']:_0x40ae91[_0xec89('0x2c')];if(!_0x4f0bd0[_0xec89('0x2d')][_0xec89('0x34')](_0xec89('0x35'))){_0x22b09b[_0xec89('0x36')]=qs['limit'](_0x4f0bd0['query'][_0xec89('0x36')]);_0x22b09b[_0xec89('0x19')]=qs[_0xec89('0x19')](_0x4f0bd0[_0xec89('0x2d')]['offset']);}_0x22b09b[_0xec89('0x37')]=qs['sort'](_0x4f0bd0[_0xec89('0x2d')][_0xec89('0x38')]);_0x22b09b[_0xec89('0x39')]=qs[_0xec89('0x2f')](_[_0xec89('0x3a')](_0x4f0bd0[_0xec89('0x2d')],_0x40ae91[_0xec89('0x2f')]),_0x3a9938);if(_0x4f0bd0[_0xec89('0x2d')][_0xec89('0x3b')]){_0x22b09b[_0xec89('0x39')]=_[_0xec89('0x3c')](_0x22b09b[_0xec89('0x39')],{'$or':_['map'](_0x3a9938,function(_0x2b9c29){if(_0x2b9c29['type']!==_0xec89('0x3d')){var _0x382c6b={};_0x382c6b[_0x2b9c29[_0xec89('0x24')]]={'$like':'%'+_0x4f0bd0['query'][_0xec89('0x3b')]+'%'};return _0x382c6b;}})});}_0x22b09b=_[_0xec89('0x3c')]({},_0x22b09b,_0x4f0bd0[_0xec89('0x3e')]);var _0x4279be={'where':_0x22b09b[_0xec89('0x39')]};return db['VoiceTransferReport'][_0xec89('0x1b')](_0x4279be)[_0xec89('0x20')](function(_0x37cd08){_0x57c68f[_0xec89('0x1b')]=_0x37cd08;if(_0x4f0bd0['query'][_0xec89('0x3f')]){_0x22b09b['include']=[{'all':!![]}];}return db[_0xec89('0x27')]['findAll'](_0x22b09b);})[_0xec89('0x20')](function(_0x29a157){_0x57c68f[_0xec89('0x40')]=_0x29a157;return _0x57c68f;})['then'](respondWithFilteredResult(_0x465b1f,_0x22b09b))['catch'](handleError(_0x465b1f,null));};exports[_0xec89('0x41')]=function(_0x164bd1,_0xbc6892){var _0x54ca6f={'raw':!![],'where':{'id':_0x164bd1[_0xec89('0x42')]['id']}},_0x537b2c={};_0x537b2c[_0xec89('0x2c')]=_[_0xec89('0x2e')](db[_0xec89('0x27')][_0xec89('0x28')]);_0x537b2c['query']=_[_0xec89('0x2e')](_0x164bd1[_0xec89('0x2d')]);_0x537b2c['filters']=_['intersection'](_0x537b2c[_0xec89('0x2c')],_0x537b2c[_0xec89('0x2d')]);_0x54ca6f[_0xec89('0x31')]=_[_0xec89('0x30')](_0x537b2c[_0xec89('0x2c')],qs[_0xec89('0x32')](_0x164bd1[_0xec89('0x2d')]['fields']));_0x54ca6f['attributes']=_0x54ca6f[_0xec89('0x31')][_0xec89('0x33')]?_0x54ca6f[_0xec89('0x31')]:_0x537b2c[_0xec89('0x2c')];if(_0x164bd1[_0xec89('0x2d')][_0xec89('0x3f')]){_0x54ca6f[_0xec89('0x43')]=[{'all':!![]}];}_0x54ca6f=_[_0xec89('0x3c')]({},_0x54ca6f,_0x164bd1[_0xec89('0x3e')]);return db[_0xec89('0x27')][_0xec89('0x44')](_0x54ca6f)[_0xec89('0x20')](handleEntityNotFound(_0xbc6892,null))[_0xec89('0x20')](respondWithResult(_0xbc6892,null))[_0xec89('0x45')](handleError(_0xbc6892,null));};exports[_0xec89('0x46')]=function(_0x549c7b,_0x1502e5){return db['VoiceTransferReport'][_0xec89('0x46')](_0x549c7b[_0xec89('0x47')],{})['then'](respondWithResult(_0x1502e5,0xc9))[_0xec89('0x45')](handleError(_0x1502e5,null));};exports[_0xec89('0x1f')]=function(_0x580c7c,_0x56808f){if(_0x580c7c[_0xec89('0x47')]['id']){delete _0x580c7c[_0xec89('0x47')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x580c7c[_0xec89('0x42')]['id']}})[_0xec89('0x20')](handleEntityNotFound(_0x56808f,null))[_0xec89('0x20')](saveUpdates(_0x580c7c[_0xec89('0x47')],null))[_0xec89('0x20')](respondWithResult(_0x56808f,null))[_0xec89('0x45')](handleError(_0x56808f,null));};exports[_0xec89('0x21')]=function(_0x1aa236,_0x1f45f1){return db['VoiceTransferReport'][_0xec89('0x44')]({'where':{'id':_0x1aa236['params']['id']}})[_0xec89('0x20')](handleEntityNotFound(_0x1f45f1,null))[_0xec89('0x20')](removeEntity(_0x1f45f1,null))['catch'](handleError(_0x1f45f1,null));};exports[_0xec89('0x48')]=function(_0x238f50,_0x3c9ade){return db[_0xec89('0x27')][_0xec89('0x48')]()[_0xec89('0x20')](respondWithResult(_0x3c9ade,null))[_0xec89('0x45')](handleError(_0x3c9ade,null));}; \ No newline at end of file +var _0x2f42=['intersection','fields','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','apply','reject','then','stack','name','send','index','map','VoiceTransferReport','fieldName','query','keys','model','attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2f42,0xe3));var _0x22f4=function(_0x5a6da2,_0x3268f3){_0x5a6da2=_0x5a6da2-0x0;var _0x2035a1=_0x2f42[_0x5a6da2];return _0x2035a1;};'use strict';var emlformat=require(_0x22f4('0x0'));var rimraf=require(_0x22f4('0x1'));var zipdir=require(_0x22f4('0x2'));var jsonpatch=require(_0x22f4('0x3'));var rp=require(_0x22f4('0x4'));var moment=require('moment');var BPromise=require(_0x22f4('0x5'));var Mustache=require(_0x22f4('0x6'));var util=require(_0x22f4('0x7'));var path=require('path');var sox=require(_0x22f4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22f4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x22f4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x22f4('0xb'));var toCsv=require(_0x22f4('0xc'));var querystring=require(_0x22f4('0xd'));var Papa=require(_0x22f4('0xe'));var Redis=require(_0x22f4('0xf'));var authService=require(_0x22f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x22f4('0x11'));var hardwareService=require(_0x22f4('0x12'));var logger=require('../../config/logger')(_0x22f4('0x13'));var utils=require(_0x22f4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x22f4('0x15'));var db=require(_0x22f4('0x16'))['db'];function respondWithStatusCode(_0x63ebdc,_0x555fc6){_0x555fc6=_0x555fc6||0xcc;return function(_0x531a30){if(_0x531a30){return _0x63ebdc[_0x22f4('0x17')](_0x555fc6);}return _0x63ebdc['status'](_0x555fc6)[_0x22f4('0x18')]();};}function respondWithResult(_0x2e101f,_0x2ae7ab){_0x2ae7ab=_0x2ae7ab||0xc8;return function(_0x13690a){if(_0x13690a){return _0x2e101f[_0x22f4('0x19')](_0x2ae7ab)['json'](_0x13690a);}};}function respondWithFilteredResult(_0x25737a,_0x1ec50a){return function(_0x31b3b3){if(_0x31b3b3){var _0x197ca6=typeof _0x1ec50a[_0x22f4('0x1a')]===_0x22f4('0x1b')&&typeof _0x1ec50a[_0x22f4('0x1c')]===_0x22f4('0x1b');var _0x83183e=_0x31b3b3[_0x22f4('0x1d')];var _0x3148d7=_0x197ca6?0x0:_0x1ec50a[_0x22f4('0x1a')];var _0x14e80=_0x197ca6?_0x31b3b3[_0x22f4('0x1d')]:_0x1ec50a['offset']+_0x1ec50a[_0x22f4('0x1c')];var _0x5094ac;if(_0x14e80>=_0x83183e){_0x14e80=_0x83183e;_0x5094ac=0xc8;}else{_0x5094ac=0xce;}_0x25737a[_0x22f4('0x19')](_0x5094ac);return _0x25737a['set']('Content-Range',_0x3148d7+'-'+_0x14e80+'/'+_0x83183e)[_0x22f4('0x1e')](_0x31b3b3);}return null;};}function patchUpdates(_0x48a89e){return function(_0x2afb5a){try{jsonpatch[_0x22f4('0x1f')](_0x2afb5a,_0x48a89e,!![]);}catch(_0x3fd15a){return BPromise[_0x22f4('0x20')](_0x3fd15a);}return _0x2afb5a['save']();};}function saveUpdates(_0x3da186,_0x1d7b36){return function(_0x314fd8){if(_0x314fd8){return _0x314fd8['update'](_0x3da186)[_0x22f4('0x21')](function(_0x4a2a51){return _0x4a2a51;});}return null;};}function removeEntity(_0xd2d41c,_0x54ac09){return function(_0x52b8b5){if(_0x52b8b5){return _0x52b8b5['destroy']()[_0x22f4('0x21')](function(){_0xd2d41c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac01c,_0x4b8399){return function(_0x175070){if(!_0x175070){_0x4ac01c[_0x22f4('0x17')](0x194);}return _0x175070;};}function handleError(_0x14ce58,_0x165c3a){_0x165c3a=_0x165c3a||0x1f4;return function(_0x4a8815){logger['error'](_0x4a8815[_0x22f4('0x22')]);if(_0x4a8815[_0x22f4('0x23')]){delete _0x4a8815['name'];}_0x14ce58[_0x22f4('0x19')](_0x165c3a)[_0x22f4('0x24')](_0x4a8815);};}exports[_0x22f4('0x25')]=function(_0x505fdb,_0x48ceee){var _0x59b475={},_0xeed499={},_0x2a00a9={'count':0x0,'rows':[]};var _0x567b9c=_[_0x22f4('0x26')](db[_0x22f4('0x27')]['rawAttributes'],function(_0x3225a4){return{'name':_0x3225a4[_0x22f4('0x28')],'type':_0x3225a4['type']['key']};});_0xeed499['model']=_[_0x22f4('0x26')](_0x567b9c,_0x22f4('0x23'));_0xeed499[_0x22f4('0x29')]=_[_0x22f4('0x2a')](_0x505fdb[_0x22f4('0x29')]);_0xeed499['filters']=_['intersection'](_0xeed499[_0x22f4('0x2b')],_0xeed499[_0x22f4('0x29')]);_0x59b475[_0x22f4('0x2c')]=_[_0x22f4('0x2d')](_0xeed499['model'],qs[_0x22f4('0x2e')](_0x505fdb['query'][_0x22f4('0x2e')]));_0x59b475[_0x22f4('0x2c')]=_0x59b475['attributes']['length']?_0x59b475[_0x22f4('0x2c')]:_0xeed499['model'];if(!_0x505fdb[_0x22f4('0x29')]['hasOwnProperty']('nolimit')){_0x59b475['limit']=qs['limit'](_0x505fdb[_0x22f4('0x29')][_0x22f4('0x1c')]);_0x59b475[_0x22f4('0x1a')]=qs['offset'](_0x505fdb[_0x22f4('0x29')][_0x22f4('0x1a')]);}_0x59b475['order']=qs[_0x22f4('0x2f')](_0x505fdb['query'][_0x22f4('0x2f')]);_0x59b475[_0x22f4('0x30')]=qs['filters'](_[_0x22f4('0x31')](_0x505fdb[_0x22f4('0x29')],_0xeed499['filters']),_0x567b9c);if(_0x505fdb[_0x22f4('0x29')]['filter']){_0x59b475['where']=_[_0x22f4('0x32')](_0x59b475[_0x22f4('0x30')],{'$or':_['map'](_0x567b9c,function(_0x5ceb47){if(_0x5ceb47['type']!==_0x22f4('0x33')){var _0x2f32ed={};_0x2f32ed[_0x5ceb47[_0x22f4('0x23')]]={'$like':'%'+_0x505fdb[_0x22f4('0x29')][_0x22f4('0x34')]+'%'};return _0x2f32ed;}})});}_0x59b475=_[_0x22f4('0x32')]({},_0x59b475,_0x505fdb[_0x22f4('0x35')]);var _0x3409cb={'where':_0x59b475[_0x22f4('0x30')]};return db[_0x22f4('0x27')][_0x22f4('0x1d')](_0x3409cb)[_0x22f4('0x21')](function(_0x40ebb2){_0x2a00a9[_0x22f4('0x1d')]=_0x40ebb2;if(_0x505fdb[_0x22f4('0x29')][_0x22f4('0x36')]){_0x59b475[_0x22f4('0x37')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x22f4('0x38')](_0x59b475);})['then'](function(_0x35896d){_0x2a00a9[_0x22f4('0x39')]=_0x35896d;return _0x2a00a9;})[_0x22f4('0x21')](respondWithFilteredResult(_0x48ceee,_0x59b475))[_0x22f4('0x3a')](handleError(_0x48ceee,null));};exports[_0x22f4('0x3b')]=function(_0x51e088,_0x381661){var _0x129aaf={'raw':!![],'where':{'id':_0x51e088[_0x22f4('0x3c')]['id']}},_0x2e2202={};_0x2e2202[_0x22f4('0x2b')]=_[_0x22f4('0x2a')](db['VoiceTransferReport'][_0x22f4('0x3d')]);_0x2e2202[_0x22f4('0x29')]=_[_0x22f4('0x2a')](_0x51e088[_0x22f4('0x29')]);_0x2e2202[_0x22f4('0x3e')]=_[_0x22f4('0x2d')](_0x2e2202[_0x22f4('0x2b')],_0x2e2202['query']);_0x129aaf[_0x22f4('0x2c')]=_[_0x22f4('0x2d')](_0x2e2202[_0x22f4('0x2b')],qs['fields'](_0x51e088[_0x22f4('0x29')][_0x22f4('0x2e')]));_0x129aaf[_0x22f4('0x2c')]=_0x129aaf[_0x22f4('0x2c')]['length']?_0x129aaf['attributes']:_0x2e2202[_0x22f4('0x2b')];if(_0x51e088[_0x22f4('0x29')][_0x22f4('0x36')]){_0x129aaf[_0x22f4('0x37')]=[{'all':!![]}];}_0x129aaf=_[_0x22f4('0x32')]({},_0x129aaf,_0x51e088[_0x22f4('0x35')]);return db['VoiceTransferReport'][_0x22f4('0x3f')](_0x129aaf)['then'](handleEntityNotFound(_0x381661,null))['then'](respondWithResult(_0x381661,null))['catch'](handleError(_0x381661,null));};exports[_0x22f4('0x40')]=function(_0x1cc6a6,_0x27af8b){return db[_0x22f4('0x27')]['create'](_0x1cc6a6[_0x22f4('0x41')],{})[_0x22f4('0x21')](respondWithResult(_0x27af8b,0xc9))[_0x22f4('0x3a')](handleError(_0x27af8b,null));};exports[_0x22f4('0x42')]=function(_0x31ef8b,_0x43201f){if(_0x31ef8b[_0x22f4('0x41')]['id']){delete _0x31ef8b[_0x22f4('0x41')]['id'];}return db[_0x22f4('0x27')][_0x22f4('0x3f')]({'where':{'id':_0x31ef8b[_0x22f4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x43201f,null))[_0x22f4('0x21')](saveUpdates(_0x31ef8b['body'],null))[_0x22f4('0x21')](respondWithResult(_0x43201f,null))[_0x22f4('0x3a')](handleError(_0x43201f,null));};exports['destroy']=function(_0x1f3aaa,_0x2d3d72){return db[_0x22f4('0x27')][_0x22f4('0x3f')]({'where':{'id':_0x1f3aaa[_0x22f4('0x3c')]['id']}})[_0x22f4('0x21')](handleEntityNotFound(_0x2d3d72,null))[_0x22f4('0x21')](removeEntity(_0x2d3d72,null))[_0x22f4('0x3a')](handleError(_0x2d3d72,null));};exports[_0x22f4('0x43')]=function(_0x1d9648,_0x576f33){return db[_0x22f4('0x27')][_0x22f4('0x43')]()[_0x22f4('0x21')](respondWithResult(_0x576f33,null))[_0x22f4('0x3a')](handleError(_0x576f33,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c3e43c4..f0be855 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 _0xc14a=['request-promise','path','rimraf','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1c7621,_0x5296a4){var _0x5c59cc=function(_0x1e28f1){while(--_0x1e28f1){_0x1c7621['push'](_0x1c7621['shift']());}};_0x5c59cc(++_0x5296a4);}(_0xc14a,0x13f));var _0xac14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc14a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xac14('0x0'));var util=require('util');var logger=require(_0xac14('0x1'))(_0xac14('0x2'));var moment=require(_0xac14('0x3'));var BPromise=require(_0xac14('0x4'));var rp=require(_0xac14('0x5'));var fs=require('fs');var path=require(_0xac14('0x6'));var rimraf=require(_0xac14('0x7'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xac14('0x8')]=function(_0x50b816,_0x3c503c){return _0x50b816[_0xac14('0x9')](_0xac14('0xa'),attributes,{'tableName':_0xac14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65a5=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x65a5,0x1b4));var _0x565a=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x65a5[_0x344adc];return _0x4014b2;};'use strict';var _=require(_0x565a('0x0'));var util=require(_0x565a('0x1'));var logger=require(_0x565a('0x2'))('api');var moment=require(_0x565a('0x3'));var BPromise=require(_0x565a('0x4'));var rp=require(_0x565a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x565a('0x6'));var config=require(_0x565a('0x7'));var attributes=require(_0x565a('0x8'));module[_0x565a('0x9')]=function(_0x226889,_0x4b5d5b){return _0x226889[_0x565a('0xa')](_0x565a('0xb'),attributes,{'tableName':_0x565a('0xc'),'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 4de8f61..d3110aa 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 _0x89a0=['code','message','info','result','catch','CreateVoiceTransferReport','create','body','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x89a0,0x168));var _0x089a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89a0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x089a('0x0'));var util=require(_0x089a('0x1'));var moment=require('moment');var BPromise=require(_0x089a('0x2'));var rs=require(_0x089a('0x3'));var fs=require('fs');var Redis=require(_0x089a('0x4'));var db=require(_0x089a('0x5'))['db'];var utils=require(_0x089a('0x6'));var logger=require('../../config/logger')(_0x089a('0x7'));var config=require('../../config/environment');var jayson=require(_0x089a('0x8'));var client=jayson[_0x089a('0x9')][_0x089a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x114aac,_0x42ffdd,_0x305817){return new BPromise(function(_0x443710,_0x29ed67){return client[_0x089a('0xb')](_0x114aac,_0x305817)[_0x089a('0xc')](function(_0x45818f){logger['info'](_0x089a('0xd'),_0x42ffdd,_0x089a('0xe'));logger[_0x089a('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x42ffdd,'request\x20sent',JSON[_0x089a('0x10')](_0x45818f));if(_0x45818f['error']){if(_0x45818f[_0x089a('0x11')][_0x089a('0x12')]===0x1f4){logger[_0x089a('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x42ffdd,_0x45818f[_0x089a('0x11')]['message']);return _0x29ed67(_0x45818f['error'][_0x089a('0x13')]);}logger[_0x089a('0x11')](_0x089a('0xd'),_0x42ffdd,_0x45818f[_0x089a('0x11')][_0x089a('0x13')]);return _0x443710(_0x45818f[_0x089a('0x11')][_0x089a('0x13')]);}else{logger[_0x089a('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x42ffdd,_0x089a('0xe'));_0x443710(_0x45818f[_0x089a('0x15')][_0x089a('0x13')]);}})[_0x089a('0x16')](function(_0x2e9bd8){logger[_0x089a('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x42ffdd,_0x2e9bd8);_0x29ed67(_0x2e9bd8);});});}exports[_0x089a('0x17')]=function(_0x2f6209){var _0x59ae46=this;return new Promise(function(_0x3b9827,_0x59e57d){return db['VoiceTransferReport'][_0x089a('0x18')](_0x2f6209[_0x089a('0x19')],{'raw':_0x2f6209['options']?_0x2f6209['options'][_0x089a('0x1a')]===undefined?!![]:![]:!![]})[_0x089a('0xc')](function(_0xe78625){logger['info'](_0x089a('0x17'),_0x2f6209);logger['debug'](_0x089a('0x17'),_0x2f6209,JSON[_0x089a('0x10')](_0xe78625));_0x3b9827(_0xe78625);})[_0x089a('0x16')](function(_0x2d97e4){logger[_0x089a('0x11')]('CreateVoiceTransferReport',_0x2d97e4[_0x089a('0x13')],_0x2f6209);_0x59e57d(_0x59ae46[_0x089a('0x11')](0x1f4,_0x2d97e4[_0x089a('0x13')]));});});}; \ No newline at end of file +var _0x84ed=['info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x31e4eb,_0x413e47){var _0xef53ba=function(_0x3ae7de){while(--_0x3ae7de){_0x31e4eb['push'](_0x31e4eb['shift']());}};_0xef53ba(++_0x413e47);}(_0x84ed,0x7f));var _0xd84e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x84ed[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xd84e('0x0'));var moment=require(_0xd84e('0x1'));var BPromise=require('bluebird');var rs=require(_0xd84e('0x2'));var fs=require('fs');var Redis=require(_0xd84e('0x3'));var db=require(_0xd84e('0x4'))['db'];var utils=require(_0xd84e('0x5'));var logger=require(_0xd84e('0x6'))(_0xd84e('0x7'));var config=require(_0xd84e('0x8'));var jayson=require(_0xd84e('0x9'));var client=jayson['client'][_0xd84e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7708d1,_0x310208,_0x6348d5){return new BPromise(function(_0xfc366c,_0x1a2837){return client[_0xd84e('0xb')](_0x7708d1,_0x6348d5)[_0xd84e('0xc')](function(_0x7497e9){logger[_0xd84e('0xd')](_0xd84e('0xe'),_0x310208,'request\x20sent');logger[_0xd84e('0xf')](_0xd84e('0x10'),_0x310208,_0xd84e('0x11'),JSON['stringify'](_0x7497e9));if(_0x7497e9[_0xd84e('0x12')]){if(_0x7497e9['error']['code']===0x1f4){logger[_0xd84e('0x12')](_0xd84e('0xe'),_0x310208,_0x7497e9['error'][_0xd84e('0x13')]);return _0x1a2837(_0x7497e9[_0xd84e('0x12')][_0xd84e('0x13')]);}logger[_0xd84e('0x12')](_0xd84e('0xe'),_0x310208,_0x7497e9[_0xd84e('0x12')]['message']);return _0xfc366c(_0x7497e9[_0xd84e('0x12')][_0xd84e('0x13')]);}else{logger[_0xd84e('0xd')](_0xd84e('0xe'),_0x310208,_0xd84e('0x11'));_0xfc366c(_0x7497e9[_0xd84e('0x14')][_0xd84e('0x13')]);}})[_0xd84e('0x15')](function(_0x4f49f3){logger[_0xd84e('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x310208,_0x4f49f3);_0x1a2837(_0x4f49f3);});});}exports[_0xd84e('0x16')]=function(_0x4e7ea2){var _0x1985c0=this;return new Promise(function(_0x3cf790,_0x301bcd){return db[_0xd84e('0x17')][_0xd84e('0x18')](_0x4e7ea2[_0xd84e('0x19')],{'raw':_0x4e7ea2['options']?_0x4e7ea2[_0xd84e('0x1a')][_0xd84e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x23cc3d){logger[_0xd84e('0xd')]('CreateVoiceTransferReport',_0x4e7ea2);logger['debug'](_0xd84e('0x16'),_0x4e7ea2,JSON['stringify'](_0x23cc3d));_0x3cf790(_0x23cc3d);})['catch'](function(_0x298a6e){logger[_0xd84e('0x12')](_0xd84e('0x16'),_0x298a6e[_0xd84e('0x13')],_0x4e7ea2);_0x301bcd(_0x1985c0[_0xd84e('0x12')](0x1f4,_0x298a6e[_0xd84e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index da70ff7..e15f860 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 _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0xf3cd[_0x175e89];return _0x2ed996;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file +var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x263798,_0x64e28c){var _0x50182e=function(_0x5aed61){while(--_0x5aed61){_0x263798['push'](_0x263798['shift']());}};_0x50182e(++_0x64e28c);}(_0xedd9,0xfc));var _0x9edd=function(_0x47bb81,_0x484ca9){_0x47bb81=_0x47bb81-0x0;var _0x304335=_0xedd9[_0x47bb81];return _0x304335;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 3108a97..51592e0 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 _0x0f9f=['hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','error','name','status','send','NotFound','then','code','message','result','catch','User','agent','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','validate','webbar:answer','answer\x20executed!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0xb52a30,_0x9b4336){_0xb52a30=_0xb52a30-0x0;var _0x160875=_0x0f9f[_0xb52a30];return _0x160875;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xf0f9('0x0'));var db=require(_0xf0f9('0x1'))['db'];var config=require(_0xf0f9('0x2'));var util=require('util');var BPromise=require(_0xf0f9('0x3'));var jayson=require(_0xf0f9('0x4'));var amiClient=jayson[_0xf0f9('0x5')][_0xf0f9('0x6')]({'port':0x232a});var logger=require(_0xf0f9('0x7'))(_0xf0f9('0x8'));var Redis=require(_0xf0f9('0x9'));config[_0xf0f9('0xa')]=_[_0xf0f9('0xb')](config[_0xf0f9('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf0f9('0xc'))(new Redis(config[_0xf0f9('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'callNumber':{'type':_0xf0f9('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xf0f9('0xf')},'callbackUrl':{'type':_0xf0f9('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':[!![],_0xf0f9('0x10')]},'transferNumber':{'type':'string','required':[!![],_0xf0f9('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]}});function emit(_0x2f5bec,_0x2f75da,_0x16a928){logger[_0xf0f9('0x12')](_0x2f5bec,_0x2f75da,JSON[_0xf0f9('0x13')](_0x16a928));io['to'](_0x2f5bec)['emit'](_0x2f75da,_0x16a928);}function handleError(_0x526fff){return function(_0x350a48){console[_0xf0f9('0x14')]('handleError:',_0x350a48,_0x350a48 instanceof RangeError);logger[_0xf0f9('0x15')](_0x350a48['stack']);if(_0x350a48 instanceof RangeError){if(_0x350a48['name']){delete _0x350a48[_0xf0f9('0x16')];}_0x526fff[_0xf0f9('0x17')](0x194)[_0xf0f9('0x18')](_0x350a48);}else{if(_0x350a48[_0xf0f9('0x16')]){delete _0x350a48[_0xf0f9('0x16')];}_0x526fff['status'](0x1f4)['send'](_0x350a48);}};}function checkError(){return function(_0x5294ac){if(!_0x5294ac){throw new RangeError(_0xf0f9('0x19'));}return _0x5294ac;};}function respondWithRpcPromise(_0x1c8c39,_0x126ba7){return new BPromise(function(_0x5d87a9,_0x4a8726){var _0x209cd4=amiClient;return _0x209cd4['request'](_0x1c8c39,_0x126ba7)[_0xf0f9('0x1a')](function(_0x414f87){if(_0x414f87[_0xf0f9('0x15')]){if(_0x414f87['error'][_0xf0f9('0x1b')]===0x1f4){return _0x4a8726(_0x414f87[_0xf0f9('0x15')][_0xf0f9('0x1c')]);}return _0x5d87a9(_0x414f87['error'][_0xf0f9('0x1c')]);}else{_0x5d87a9(_0x414f87[_0xf0f9('0x1d')]);}})[_0xf0f9('0x1e')](function(_0x185e1e){_0x4a8726(_0x185e1e);});});}function getAgent(_0x16f639){return db[_0xf0f9('0x1f')]['findOne']({'where':{'id':_0x16f639,'role':_0xf0f9('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x1288e0,_0x30e85c){return new BPromise(function(_0x519a46,_0x4b75b2){var _0x119793=respondWithRpcPromise('VoiceChannels');var _0x2121b8=getAgent(_0x1288e0);Promise[_0xf0f9('0x21')]([_0x119793,_0x2121b8])[_0xf0f9('0x1a')](function(_0x353502){var _0x3ec658=_0x353502[0x0];var _0x39cd34=_0x353502[0x1];var _0x1377ed=_[_0xf0f9('0x22')](_0x3ec658[_0xf0f9('0x23')],function(_0x4e4e08){return _0x4e4e08[_0xf0f9('0x24')]==_0x39cd34['id']&&_0x4e4e08[_0xf0f9('0x25')]==_0x30e85c;});if(_0x1377ed['length']==0x1){_0x519a46(_0x39cd34);}else{_0x4b75b2(new RangeError('sessionId\x20'+_0x30e85c+_0xf0f9('0x26')));}});});}exports['originate']=function(_0x483a8c,_0x14f3cb){logger['info'](_0xf0f9('0x27'),_0x483a8c[_0xf0f9('0x28')]);var _0x5305e0=originateValidation['validate'](_0x483a8c[_0xf0f9('0x28')]);if(_0x5305e0[_0xf0f9('0x29')]>0x0){return _0x14f3cb[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x5305e0);}var _0x278192=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x30bc8e=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2c')];var _0x2a7648=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2d')];var _0x5a8b35=_0x483a8c[_0xf0f9('0x28')]['callbackUrl'];return getAgent(_0x278192)[_0xf0f9('0x1a')](function(_0x44c9ed){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x44c9ed[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x44c9ed['name']),'webbar:originate',{'callNumber':_0x30bc8e,'callerId':_0x2a7648,'callbackUrl':_0x5a8b35});return _0x14f3cb[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x31')});})[_0xf0f9('0x1e')](handleError(_0x14f3cb));};exports[_0xf0f9('0x32')]=function(_0x4ac1d2,_0x2b9d56){logger[_0xf0f9('0x12')](_0xf0f9('0x33'),_0x4ac1d2[_0xf0f9('0x28')]);var _0x32a248=hangupValidation['validate'](_0x4ac1d2[_0xf0f9('0x28')]);if(_0x32a248[_0xf0f9('0x29')]>0x0){return _0x2b9d56[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x32a248);}var _0x7cf75a=_0x4ac1d2[_0xf0f9('0x28')]['userId'];var _0x3a0f27=_0x4ac1d2[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x7cf75a)['then'](function(_0x3b52e3){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x3b52e3[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x3b52e3[_0xf0f9('0x16')]),_0xf0f9('0x34'),{'sessionId':_0x3a0f27});return _0x2b9d56[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x35')});})[_0xf0f9('0x1e')](handleError(_0x2b9d56));};exports[_0xf0f9('0x36')]=function(_0x5153b5,_0x4ff1f0){logger[_0xf0f9('0x12')]('answer\x20fired:',_0x5153b5['body']);var _0x4e8234=answerValidation[_0xf0f9('0x37')](_0x5153b5[_0xf0f9('0x28')]);if(_0x4e8234[_0xf0f9('0x29')]>0x0){return _0x4ff1f0[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x4e8234);}var _0xfef8ad=_0x5153b5[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x1a3a6b=_0x5153b5['body'][_0xf0f9('0x25')];return getAgent(_0xfef8ad)[_0xf0f9('0x1a')](function(_0x434fc1){logger['info'](_0xf0f9('0x2e'),_0x434fc1[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')]('user:%s',_0x434fc1[_0xf0f9('0x16')]),_0xf0f9('0x38'),{'sessionId':_0x1a3a6b});return _0x4ff1f0['status'](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x39')});})[_0xf0f9('0x1e')](handleError(_0x4ff1f0));};exports[_0xf0f9('0x3a')]=function(_0x4be16e,_0x35bcf8){logger[_0xf0f9('0x12')](_0xf0f9('0x3b'),_0x4be16e[_0xf0f9('0x28')]);var _0x226bda=holdValidation[_0xf0f9('0x37')](_0x4be16e['body']);if(_0x226bda[_0xf0f9('0x29')]>0x0){return _0x35bcf8['status'](0x190)[_0xf0f9('0x2a')](_0x226bda);}var _0x38956b=_0x4be16e[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x44b00d=_0x4be16e[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x38956b)[_0xf0f9('0x1a')](function(_0x1f47fa){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x1f47fa[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x1f47fa[_0xf0f9('0x16')]),_0xf0f9('0x3c'),{'sessionId':_0x44b00d});return _0x35bcf8[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x3d')});})[_0xf0f9('0x1e')](handleError(_0x35bcf8));};exports[_0xf0f9('0x3e')]=function(_0x40711c,_0x3db0b2){logger[_0xf0f9('0x12')]('unhold\x20fired:',_0x40711c['body']);var _0x2eb8b4=unholdValidation['validate'](_0x40711c[_0xf0f9('0x28')]);if(_0x2eb8b4[_0xf0f9('0x29')]>0x0){return _0x3db0b2[_0xf0f9('0x17')](0x190)['json'](_0x2eb8b4);}var _0x2b2604=_0x40711c['body'][_0xf0f9('0x2b')];var _0x603804=_0x40711c[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x2b2604)[_0xf0f9('0x1a')](function(_0x593b54){logger[_0xf0f9('0x12')]('entityFound:',_0x593b54[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x593b54[_0xf0f9('0x16')]),_0xf0f9('0x3f'),{'sessionId':_0x603804});return _0x3db0b2['status'](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x40')});})[_0xf0f9('0x1e')](handleError(_0x3db0b2));};exports[_0xf0f9('0x41')]=function(_0x1dbc9d,_0x2a8aae){logger[_0xf0f9('0x12')](_0xf0f9('0x42'),_0x2a8aae[_0xf0f9('0x28')]);var _0x406b45=callsValidation[_0xf0f9('0x37')](_0x1dbc9d[_0xf0f9('0x28')]);if(_0x406b45[_0xf0f9('0x29')]>0x0){return _0x2a8aae[_0xf0f9('0x17')](0x190)['json'](_0x406b45);}var _0x329b59=_0x1dbc9d[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x59d7bd=respondWithRpcPromise(_0xf0f9('0x43'));var _0x32f641=getAgent(_0x329b59);return Promise[_0xf0f9('0x21')]([_0x59d7bd,_0x32f641])[_0xf0f9('0x1a')](function(_0x6979f){var _0x586022=_0x6979f[0x0];var _0x3b1d45=_0x6979f[0x1];var _0x838550=_[_0xf0f9('0x22')](_0x586022[_0xf0f9('0x23')],function(_0x2807f9){return _0x2807f9[_0xf0f9('0x24')]==_0x3b1d45['id'];});return _0x2a8aae[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'count':_0x838550[_0xf0f9('0x29')],'rows':_0x838550});})[_0xf0f9('0x1e')](handleError(_0x2a8aae));};exports['conference']=function(_0x3777ae,_0x3fa078){logger['info'](_0xf0f9('0x44'),_0x3777ae['body']);var _0x3ac206=conferenceValidation[_0xf0f9('0x37')](_0x3777ae[_0xf0f9('0x28')]);if(_0x3ac206['length']>0x0){return _0x3fa078[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x3ac206);}var _0x28879c=_0x3777ae[_0xf0f9('0x28')][_0xf0f9('0x2b')];return getAgent(_0x28879c)[_0xf0f9('0x1a')](function(_0xdb0e6c){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0xdb0e6c[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0xdb0e6c['name']),_0xf0f9('0x45'));return _0x3fa078[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x46')});})['catch'](handleError(_0x3fa078));};exports[_0xf0f9('0x47')]=function(_0xb29b92,_0xb47567){logger['info'](_0xf0f9('0x48'),_0xb29b92[_0xf0f9('0x28')]);var _0x56e467=transferValidation[_0xf0f9('0x37')](_0xb29b92[_0xf0f9('0x28')]);if(_0x56e467['length']>0x0){return _0xb47567[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x56e467);}var _0x3d1542=_0xb29b92[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x16564d=_0xb29b92[_0xf0f9('0x28')]['sessionId'];var _0x392ffa=_0xb29b92[_0xf0f9('0x28')]['transferNumber'];return getAgent(_0x3d1542)[_0xf0f9('0x1a')](function(_0x539ac6){logger['info'](_0xf0f9('0x2e'),_0x539ac6[_0xf0f9('0x16')]);emit(util['format'](_0xf0f9('0x30'),_0x539ac6['name']),_0xf0f9('0x49'),{'sessionId':_0x16564d,'transferNumber':_0x392ffa});return _0xb47567[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0xf0f9('0x1e')](handleError(_0xb47567));}; \ No newline at end of file +var _0xbe02=['unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x19694f,_0x3cc832){var _0x39478d=function(_0x1aee9d){while(--_0x1aee9d){_0x19694f['push'](_0x19694f['shift']());}};_0x39478d(++_0x3cc832);}(_0xbe02,0x146));var _0x2be0=function(_0x44457b,_0x17e3c7){_0x44457b=_0x44457b-0x0;var _0x5e2c9d=_0xbe02[_0x44457b];return _0x5e2c9d;};'use strict';var path=require(_0x2be0('0x0'));var fs=require('fs');var _=require(_0x2be0('0x1'));var db=require(_0x2be0('0x2'))['db'];var config=require(_0x2be0('0x3'));var util=require('util');var BPromise=require(_0x2be0('0x4'));var jayson=require(_0x2be0('0x5'));var amiClient=jayson[_0x2be0('0x6')][_0x2be0('0x7')]({'port':0x232a});var logger=require(_0x2be0('0x8'))(_0x2be0('0x9'));var Redis=require(_0x2be0('0xa'));config[_0x2be0('0xb')]=_[_0x2be0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2be0('0xd'))(new Redis(config[_0x2be0('0xb')]));var Schema=require(_0x2be0('0xe'));var originateValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'callNumber':{'type':_0x2be0('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x12')]},'transferNumber':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]}});function emit(_0x5bcbc5,_0x334070,_0x30d623){logger[_0x2be0('0x14')](_0x5bcbc5,_0x334070,JSON[_0x2be0('0x15')](_0x30d623));io['to'](_0x5bcbc5)[_0x2be0('0x16')](_0x334070,_0x30d623);}function handleError(_0x1ae700){return function(_0x48d386){console[_0x2be0('0x17')](_0x2be0('0x18'),_0x48d386,_0x48d386 instanceof RangeError);logger[_0x2be0('0x19')](_0x48d386[_0x2be0('0x1a')]);if(_0x48d386 instanceof RangeError){if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700[_0x2be0('0x1c')](0x194)[_0x2be0('0x1d')](_0x48d386);}else{if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700['status'](0x1f4)['send'](_0x48d386);}};}function checkError(){return function(_0x3292af){if(!_0x3292af){throw new RangeError('NotFound');}return _0x3292af;};}function respondWithRpcPromise(_0x5d1a32,_0x40cc4d){return new BPromise(function(_0x4d2c62,_0x2da0d5){var _0x2b3f88=amiClient;return _0x2b3f88[_0x2be0('0x1e')](_0x5d1a32,_0x40cc4d)[_0x2be0('0x1f')](function(_0x105fa6){if(_0x105fa6[_0x2be0('0x19')]){if(_0x105fa6['error'][_0x2be0('0x20')]===0x1f4){return _0x2da0d5(_0x105fa6['error']['message']);}return _0x4d2c62(_0x105fa6[_0x2be0('0x19')][_0x2be0('0x21')]);}else{_0x4d2c62(_0x105fa6[_0x2be0('0x22')]);}})[_0x2be0('0x23')](function(_0x3fb87f){_0x2da0d5(_0x3fb87f);});});}function getAgent(_0x4b5f21){return db[_0x2be0('0x24')]['findOne']({'where':{'id':_0x4b5f21,'role':_0x2be0('0x25')}})[_0x2be0('0x1f')](checkError());}function getAgentCheckSession(_0x559a66,_0x5260d3){return new BPromise(function(_0x1fd3eb,_0x20f866){var _0x4bdf61=respondWithRpcPromise(_0x2be0('0x26'));var _0x36b490=getAgent(_0x559a66);Promise[_0x2be0('0x27')]([_0x4bdf61,_0x36b490])[_0x2be0('0x1f')](function(_0x3b97c0){var _0x4184e4=_0x3b97c0[0x0];var _0x463fd5=_0x3b97c0[0x1];var _0x58846a=_[_0x2be0('0x28')](_0x4184e4['rows'],function(_0x11abcf){return _0x11abcf[_0x2be0('0x29')]==_0x463fd5['id']&&_0x11abcf[_0x2be0('0x2a')]==_0x5260d3;});if(_0x58846a[_0x2be0('0x2b')]==0x1){_0x1fd3eb(_0x463fd5);}else{_0x20f866(new RangeError(_0x2be0('0x2c')+_0x5260d3+_0x2be0('0x2d')));}});});}exports[_0x2be0('0x2e')]=function(_0x5191e6,_0x121e5b){logger[_0x2be0('0x14')](_0x2be0('0x2f'),_0x5191e6[_0x2be0('0x30')]);var _0x101114=originateValidation['validate'](_0x5191e6[_0x2be0('0x30')]);if(_0x101114[_0x2be0('0x2b')]>0x0){return _0x121e5b[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x101114);}var _0x779ef2=_0x5191e6['body']['userId'];var _0x22458d=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x32')];var _0x5a53ac=_0x5191e6['body']['callerId'];var _0x41afcb=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x33')];return getAgent(_0x779ef2)[_0x2be0('0x1f')](function(_0x3c7227){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3c7227[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3c7227[_0x2be0('0x1b')]),'webbar:originate',{'callNumber':_0x22458d,'callerId':_0x5a53ac,'callbackUrl':_0x41afcb});return _0x121e5b[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x37')});})[_0x2be0('0x23')](handleError(_0x121e5b));};exports[_0x2be0('0x38')]=function(_0x565623,_0x27d35e){logger[_0x2be0('0x14')](_0x2be0('0x39'),_0x565623['body']);var _0x1123bc=hangupValidation['validate'](_0x565623[_0x2be0('0x30')]);if(_0x1123bc['length']>0x0){return _0x27d35e['status'](0x190)[_0x2be0('0x31')](_0x1123bc);}var _0x4d6ccf=_0x565623[_0x2be0('0x30')]['userId'];var _0x3017c4=_0x565623['body'][_0x2be0('0x2a')];return getAgent(_0x4d6ccf)[_0x2be0('0x1f')](function(_0xa4d6f0){logger['info'](_0x2be0('0x34'),_0xa4d6f0['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0xa4d6f0[_0x2be0('0x1b')]),_0x2be0('0x3a'),{'sessionId':_0x3017c4});return _0x27d35e[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x3b')});})[_0x2be0('0x23')](handleError(_0x27d35e));};exports[_0x2be0('0x3c')]=function(_0x1d7540,_0xa1f755){logger[_0x2be0('0x14')](_0x2be0('0x3d'),_0x1d7540[_0x2be0('0x30')]);var _0x1c669d=answerValidation['validate'](_0x1d7540[_0x2be0('0x30')]);if(_0x1c669d['length']>0x0){return _0xa1f755[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x1c669d);}var _0x20869a=_0x1d7540[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x35eea1=_0x1d7540[_0x2be0('0x30')]['sessionId'];return getAgent(_0x20869a)[_0x2be0('0x1f')](function(_0x268d24){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x268d24[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0x268d24['name']),_0x2be0('0x3f'),{'sessionId':_0x35eea1});return _0xa1f755[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x40')});})[_0x2be0('0x23')](handleError(_0xa1f755));};exports[_0x2be0('0x41')]=function(_0x5ed58e,_0x2d3a11){logger['info'](_0x2be0('0x42'),_0x5ed58e[_0x2be0('0x30')]);var _0x5b78a1=holdValidation[_0x2be0('0xe')](_0x5ed58e[_0x2be0('0x30')]);if(_0x5b78a1[_0x2be0('0x2b')]>0x0){return _0x2d3a11[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x5b78a1);}var _0x59bb83=_0x5ed58e['body'][_0x2be0('0x3e')];var _0x362915=_0x5ed58e['body']['sessionId'];return getAgent(_0x59bb83)[_0x2be0('0x1f')](function(_0x3e6f94){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3e6f94['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3e6f94[_0x2be0('0x1b')]),_0x2be0('0x43'),{'sessionId':_0x362915});return _0x2d3a11[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x44')});})['catch'](handleError(_0x2d3a11));};exports[_0x2be0('0x45')]=function(_0x400f59,_0x52dd0c){logger[_0x2be0('0x14')](_0x2be0('0x46'),_0x400f59[_0x2be0('0x30')]);var _0x556235=unholdValidation[_0x2be0('0xe')](_0x400f59[_0x2be0('0x30')]);if(_0x556235[_0x2be0('0x2b')]>0x0){return _0x52dd0c[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x556235);}var _0x1b7c41=_0x400f59[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x2835b4=_0x400f59['body'][_0x2be0('0x2a')];return getAgent(_0x1b7c41)[_0x2be0('0x1f')](function(_0xc33e5b){logger[_0x2be0('0x14')]('entityFound:',_0xc33e5b[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0xc33e5b[_0x2be0('0x1b')]),'webbar:unhold',{'sessionId':_0x2835b4});return _0x52dd0c[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x47')});})[_0x2be0('0x23')](handleError(_0x52dd0c));};exports['calls']=function(_0xa641d7,_0x24a64a){logger[_0x2be0('0x14')](_0x2be0('0x48'),_0x24a64a[_0x2be0('0x30')]);var _0x210df5=callsValidation[_0x2be0('0xe')](_0xa641d7[_0x2be0('0x30')]);if(_0x210df5[_0x2be0('0x2b')]>0x0){return _0x24a64a['status'](0x190)[_0x2be0('0x31')](_0x210df5);}var _0x3cb80b=_0xa641d7[_0x2be0('0x30')]['userId'];var _0x38278b=respondWithRpcPromise(_0x2be0('0x26'));var _0x2ec0dc=getAgent(_0x3cb80b);return Promise[_0x2be0('0x27')]([_0x38278b,_0x2ec0dc])[_0x2be0('0x1f')](function(_0x126eda){var _0x328a16=_0x126eda[0x0];var _0x4c3e21=_0x126eda[0x1];var _0x43e76a=_[_0x2be0('0x28')](_0x328a16[_0x2be0('0x49')],function(_0x2152a1){return _0x2152a1[_0x2be0('0x29')]==_0x4c3e21['id'];});return _0x24a64a[_0x2be0('0x1c')](0xc8)['json']({'count':_0x43e76a[_0x2be0('0x2b')],'rows':_0x43e76a});})['catch'](handleError(_0x24a64a));};exports['conference']=function(_0x2d2e79,_0x3c1967){logger[_0x2be0('0x14')]('conference\x20fired:',_0x2d2e79[_0x2be0('0x30')]);var _0x436d7a=conferenceValidation[_0x2be0('0xe')](_0x2d2e79[_0x2be0('0x30')]);if(_0x436d7a[_0x2be0('0x2b')]>0x0){return _0x3c1967['status'](0x190)[_0x2be0('0x31')](_0x436d7a);}var _0x2553e0=_0x2d2e79[_0x2be0('0x30')][_0x2be0('0x3e')];return getAgent(_0x2553e0)[_0x2be0('0x1f')](function(_0x27b8e6){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x27b8e6[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x27b8e6['name']),_0x2be0('0x4a'));return _0x3c1967[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x4b')});})[_0x2be0('0x23')](handleError(_0x3c1967));};exports[_0x2be0('0x4c')]=function(_0x32ed3a,_0x2f733a){logger['info']('transfer\x20fired:',_0x32ed3a[_0x2be0('0x30')]);var _0x3a0154=transferValidation[_0x2be0('0xe')](_0x32ed3a['body']);if(_0x3a0154[_0x2be0('0x2b')]>0x0){return _0x2f733a[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x3a0154);}var _0xc34958=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x3e')];var _0xc10295=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x2a')];var _0x435a14=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x4d')];return getAgent(_0xc34958)[_0x2be0('0x1f')](function(_0x10e9a7){logger['info'](_0x2be0('0x34'),_0x10e9a7[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x10e9a7['name']),'webbar:transfer',{'sessionId':_0xc10295,'transferNumber':_0x435a14});return _0x2f733a[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x4e')});})[_0x2be0('0x23')](handleError(_0x2f733a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6fb6d8e..7da151c 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 _0x57ca=['addDisposition','addAnswer','addApplications','/:id/notify','notify','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','/:id/dispositions'];(function(_0x495650,_0x144774){var _0x287025=function(_0x329116){while(--_0x329116){_0x495650['push'](_0x495650['shift']());}};_0x287025(++_0x144774);}(_0x57ca,0x108));var _0xa57c=function(_0x4ed4fe,_0x412bf0){_0x4ed4fe=_0x4ed4fe-0x0;var _0x24f50a=_0x57ca[_0x4ed4fe];return _0x24f50a;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0x8')]('/:id/dispositions',auth[_0xa57c('0x9')](),controller['getDispositions']);router[_0xa57c('0x8')](_0xa57c('0xf'),auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['get'](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);router[_0xa57c('0x8')](_0xa57c('0x13'),auth['isAuthenticated'](),controller[_0xa57c('0x14')]);router['post']('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0x15')]);router[_0xa57c('0x16')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x18')]);router[_0xa57c('0x16')]('/:id/canned_answers',auth[_0xa57c('0x9')](),controller[_0xa57c('0x19')]);router[_0xa57c('0x16')]('/:id/users',auth[_0xa57c('0x9')](),controller['addAgents']);router[_0xa57c('0x16')](_0xa57c('0x13'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1a')]);router[_0xa57c('0x16')](_0xa57c('0x1b'),controller[_0xa57c('0x1c')]);router[_0xa57c('0x16')]('/:id/send',auth[_0xa57c('0x9')](),controller['send']);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1d')]);router[_0xa57c('0x1e')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x1f')]);router[_0xa57c('0x1e')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x20')]);router[_0xa57c('0x1e')](_0xa57c('0xf'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x21')]);router[_0xa57c('0x1e')](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x22')]);module[_0xa57c('0x23')]=router; \ No newline at end of file +var _0x2542=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x4e6aae,_0xf58337){var _0x4e95f4=function(_0x52b67d){while(--_0x52b67d){_0x4e6aae['push'](_0x4e6aae['shift']());}};_0x4e95f4(++_0xf58337);}(_0x2542,0x169));var _0x2254=function(_0x2596c1,_0x45811a){_0x2596c1=_0x2596c1-0x0;var _0x20c44a=_0x2542[_0x2596c1];return _0x20c44a;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getAnswers']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x9')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['getApplications']);router[_0x2254('0x16')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x16')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x16')](_0x2254('0x12'),auth['isAuthenticated'](),controller[_0x2254('0x18')]);router['post'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x19')]);router[_0x2254('0x16')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2254('0x1a')]);router[_0x2254('0x16')](_0x2254('0x1b'),auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);router[_0x2254('0x1d')]('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x1e')]);router[_0x2254('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2254('0x1f')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x20')]);module[_0x2254('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a2f6921..426d749 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 _0x193e=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x15194c,_0x5ca287){var _0x312a9a=function(_0x4a22aa){while(--_0x4a22aa){_0x15194c['push'](_0x15194c['shift']());}};_0x312a9a(++_0x5ca287);}(_0x193e,0xa8));var _0xe193=function(_0x3a7932,_0x5baf02){_0x3a7932=_0x3a7932-0x0;var _0x21896b=_0x193e[_0x3a7932];return _0x21896b;};'use strict';var Sequelize=require(_0xe193('0x0'));var rs=require(_0xe193('0x1'));module['exports']={'name':{'type':Sequelize[_0xe193('0x2')],'unique':_0xe193('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xe193('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xe193('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xe193('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe193('0x4')](_0xe193('0x5'),_0xe193('0x6'))},'accountSid':{'type':Sequelize[_0xe193('0x2')]},'baseUrl':{'type':Sequelize[_0xe193('0x2')]},'authToken':{'type':Sequelize[_0xe193('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe193('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe193('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe193('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe193('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe193('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe193('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe193('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe193('0x9')],'comment':_0xe193('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe193('0x8')],'defaultValue':![],'comment':_0xe193('0xb'),'set':function(_0x4542d8){if(!_0x4542d8){this['setDataValue'](_0xe193('0xc'),null);}this[_0xe193('0xd')](_0xe193('0xe'),_0x4542d8);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc6c4=['name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING'];(function(_0x56d89d,_0x3bb4c1){var _0x171e63=function(_0x4373ae){while(--_0x4373ae){_0x56d89d['push'](_0x56d89d['shift']());}};_0x171e63(++_0x3bb4c1);}(_0xc6c4,0x1b8));var _0x4c6c=function(_0x13b1a5,_0x253a6b){_0x13b1a5=_0x13b1a5-0x0;var _0xa4a3f9=_0xc6c4[_0x13b1a5];return _0xa4a3f9;};'use strict';var Sequelize=require(_0x4c6c('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4c6c('0x1')],'unique':_0x4c6c('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x4c6c('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4c6c('0x3')]();}},'phone':{'type':Sequelize[_0x4c6c('0x1')]},'type':{'type':Sequelize[_0x4c6c('0x4')](_0x4c6c('0x5'),_0x4c6c('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x4c6c('0x1')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4c6c('0x7')],'defaultValue':function(){return _0x4c6c('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4c6c('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4c6c('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4c6c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4c6c('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4c6c('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4c6c('0xb'),'set':function(_0xd4c1ec){if(!_0xd4c1ec){this['setDataValue'](_0x4c6c('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0xd4c1ec);}},'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 6c75de2..e498df8 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 _0x8823=['info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','WhatsappAccount','include','findAll','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','pick','map','removeDispositions','addAnswer','CannedAnswer','rows','removeAnswers','ids','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','getApplications','whatsapp','Applications','account','statuses','state','read','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','MessageSid','sinch','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','WhatsappInteraction','spread','interaction','push','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then'];(function(_0xfd5211,_0x490686){var _0x19797d=function(_0x496d08){while(--_0x496d08){_0xfd5211['push'](_0xfd5211['shift']());}};_0x19797d(++_0x490686);}(_0x8823,0xa2));var _0x3882=function(_0x4f5e50,_0x226757){_0x4f5e50=_0x4f5e50-0x0;var _0x89e4e8=_0x8823[_0x4f5e50];return _0x89e4e8;};'use strict';var emlformat=require(_0x3882('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3882('0x1'));var jsonpatch=require(_0x3882('0x2'));var rp=require(_0x3882('0x3'));var moment=require(_0x3882('0x4'));var BPromise=require(_0x3882('0x5'));var Mustache=require(_0x3882('0x6'));var util=require(_0x3882('0x7'));var path=require('path');var sox=require(_0x3882('0x8'));var csv=require(_0x3882('0x9'));var ejs=require(_0x3882('0xa'));var fs=require('fs');var fs_extra=require(_0x3882('0xb'));var _=require(_0x3882('0xc'));var squel=require('squel');var crypto=require(_0x3882('0xd'));var jsforce=require(_0x3882('0xe'));var deskjs=require(_0x3882('0xf'));var toCsv=require(_0x3882('0x9'));var querystring=require(_0x3882('0x10'));var Papa=require(_0x3882('0x11'));var Redis=require(_0x3882('0x12'));var authService=require(_0x3882('0x13'));var qs=require(_0x3882('0x14'));var as=require(_0x3882('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3882('0x16'))(_0x3882('0x17'));var utils=require(_0x3882('0x18'));var config=require(_0x3882('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3882('0x1a'))['db'];config['redis']=_[_0x3882('0x1b')](config[_0x3882('0x1c')],{'host':_0x3882('0x1d'),'port':0x18eb});var socket=require(_0x3882('0x1e'))(new Redis(config[_0x3882('0x1c')]));require('./whatsappAccount.socket')[_0x3882('0x1f')](socket);var jayson=require(_0x3882('0x20'));var client=jayson[_0x3882('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x15d64e,_0xf32c3f,_0x114b62,_0x3c44ae){return new BPromise(function(_0x5db9ee,_0x1d0eb6){var _0x3be4a7=_0x3c44ae||client;return _0x3be4a7[_0x3882('0x22')](_0x15d64e,_0x114b62)[_0x3882('0x23')](function(_0x509058){logger[_0x3882('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0xf32c3f,'request\x20sent');logger[_0x3882('0x25')](_0x3882('0x26'),_0xf32c3f,_0x3882('0x27'),JSON[_0x3882('0x28')](_0x509058));if(_0x509058[_0x3882('0x29')]){if(_0x509058[_0x3882('0x29')][_0x3882('0x2a')]===0x1f4){logger[_0x3882('0x29')](_0x3882('0x2b'),_0xf32c3f,_0x509058[_0x3882('0x29')][_0x3882('0x2c')]);return _0x1d0eb6(_0x509058[_0x3882('0x29')]['message']);}logger['error'](_0x3882('0x2b'),_0xf32c3f,_0x509058[_0x3882('0x29')][_0x3882('0x2c')]);return _0x5db9ee(_0x509058[_0x3882('0x29')]['message']);}else{logger['info'](_0x3882('0x2b'),_0xf32c3f,_0x3882('0x27'));_0x5db9ee(_0x509058['result'][_0x3882('0x2c')]);}})['catch'](function(_0x5db087){logger['error'](_0x3882('0x2b'),_0xf32c3f,_0x5db087);_0x1d0eb6(_0x5db087);});});}function respondWithStatusCode(_0x39c461,_0x42f644){_0x42f644=_0x42f644||0xcc;return function(_0x2f1dad){if(_0x2f1dad){return _0x39c461['sendStatus'](_0x42f644);}return _0x39c461[_0x3882('0x2d')](_0x42f644)[_0x3882('0x2e')]();};}function respondWithResult(_0x346af8,_0x17490d){_0x17490d=_0x17490d||0xc8;return function(_0x3c4650){if(_0x3c4650){return _0x346af8[_0x3882('0x2d')](_0x17490d)[_0x3882('0x2f')](_0x3c4650);}};}function respondWithFilteredResult(_0x194b3f,_0x5bd31f){return function(_0x4c08e2){if(_0x4c08e2){var _0x3998f7=typeof _0x5bd31f[_0x3882('0x30')]===_0x3882('0x31')&&typeof _0x5bd31f[_0x3882('0x32')]==='undefined';var _0xaa237e=_0x4c08e2[_0x3882('0x33')];var _0x2f348c=_0x3998f7?0x0:_0x5bd31f[_0x3882('0x30')];var _0x4e63c4=_0x3998f7?_0x4c08e2['count']:_0x5bd31f[_0x3882('0x30')]+_0x5bd31f[_0x3882('0x32')];var _0x3121e6;if(_0x4e63c4>=_0xaa237e){_0x4e63c4=_0xaa237e;_0x3121e6=0xc8;}else{_0x3121e6=0xce;}_0x194b3f[_0x3882('0x2d')](_0x3121e6);return _0x194b3f['set'](_0x3882('0x34'),_0x2f348c+'-'+_0x4e63c4+'/'+_0xaa237e)['json'](_0x4c08e2);}return null;};}function patchUpdates(_0x296385){return function(_0x2528d4){try{jsonpatch[_0x3882('0x35')](_0x2528d4,_0x296385,!![]);}catch(_0x12408b){return BPromise[_0x3882('0x36')](_0x12408b);}return _0x2528d4[_0x3882('0x37')]();};}function saveUpdates(_0x11788b,_0x404597){return function(_0x19ddfc){if(_0x19ddfc){return _0x19ddfc[_0x3882('0x38')](_0x11788b)[_0x3882('0x23')](function(_0x52fcb0){return _0x52fcb0;});}return null;};}function removeEntity(_0x1ae120,_0x9ddb78){return function(_0x56051c){if(_0x56051c){return _0x56051c[_0x3882('0x39')]()[_0x3882('0x23')](function(){var _0x421932=_0x56051c[_0x3882('0x3a')]({'plain':!![]});var _0x433bd4='WhatsappAccounts';return db[_0x3882('0x3b')][_0x3882('0x39')]({'where':{'type':_0x433bd4,'resourceId':_0x421932['id']}})[_0x3882('0x23')](function(){return _0x56051c;});})[_0x3882('0x23')](function(){_0x1ae120[_0x3882('0x2d')](0xcc)[_0x3882('0x2e')]();});}};}function handleEntityNotFound(_0x4d3320,_0x38ce97){return function(_0x58960a){if(!_0x58960a){_0x4d3320[_0x3882('0x3c')](0x194);}return _0x58960a;};}function handleError(_0x532c8e,_0x1a2385){_0x1a2385=_0x1a2385||0x1f4;return function(_0x3f4dad){logger[_0x3882('0x29')](_0x3f4dad[_0x3882('0x3d')]);if(_0x3f4dad[_0x3882('0x3e')]){delete _0x3f4dad[_0x3882('0x3e')];}_0x532c8e[_0x3882('0x2d')](_0x1a2385)[_0x3882('0x3f')](_0x3f4dad);};}exports[_0x3882('0x40')]=function(_0x55e203,_0x3d0a87){var _0x1c7180={'include':[{'model':db[_0x3882('0x41')],'as':'mandatoryDispositionPause'}]},_0x407680={},_0x2640b7={'count':0x0,'rows':[]};var _0x5adcfd=_['map'](db['WhatsappAccount'][_0x3882('0x42')],function(_0xf91330){return{'name':_0xf91330['fieldName'],'type':_0xf91330['type'][_0x3882('0x43')]};});_0x407680[_0x3882('0x44')]=_['map'](_0x5adcfd,_0x3882('0x3e'));_0x407680[_0x3882('0x45')]=_[_0x3882('0x46')](_0x55e203['query']);_0x407680[_0x3882('0x47')]=_[_0x3882('0x48')](_0x407680[_0x3882('0x44')],_0x407680[_0x3882('0x45')]);_0x1c7180[_0x3882('0x49')]=_['intersection'](_0x407680[_0x3882('0x44')],qs[_0x3882('0x4a')](_0x55e203[_0x3882('0x45')][_0x3882('0x4a')]));_0x1c7180[_0x3882('0x49')]=_0x1c7180[_0x3882('0x49')]['length']?_0x1c7180[_0x3882('0x49')]:_0x407680['model'];if(!_0x55e203[_0x3882('0x45')][_0x3882('0x4b')]('nolimit')){_0x1c7180[_0x3882('0x32')]=qs[_0x3882('0x32')](_0x55e203[_0x3882('0x45')]['limit']);_0x1c7180[_0x3882('0x30')]=qs[_0x3882('0x30')](_0x55e203['query'][_0x3882('0x30')]);}_0x1c7180[_0x3882('0x4c')]=qs[_0x3882('0x4d')](_0x55e203[_0x3882('0x45')][_0x3882('0x4d')]);_0x1c7180[_0x3882('0x4e')]=qs[_0x3882('0x47')](_['pick'](_0x55e203['query'],_0x407680[_0x3882('0x47')]),_0x5adcfd);if(_0x55e203[_0x3882('0x45')][_0x3882('0x4f')]){_0x1c7180[_0x3882('0x4e')]=_[_0x3882('0x50')](_0x1c7180[_0x3882('0x4e')],{'$or':_['map'](_0x5adcfd,function(_0x96f8f1){if(_0x96f8f1[_0x3882('0x51')]!==_0x3882('0x52')){var _0x5e0613={};_0x5e0613[_0x96f8f1[_0x3882('0x3e')]]={'$like':'%'+_0x55e203[_0x3882('0x45')][_0x3882('0x4f')]+'%'};return _0x5e0613;}})});}_0x1c7180=_[_0x3882('0x50')]({},_0x1c7180,_0x55e203[_0x3882('0x53')]);var _0x37bc83={'where':_0x1c7180['where']};return db[_0x3882('0x54')][_0x3882('0x33')](_0x37bc83)[_0x3882('0x23')](function(_0x1f9689){_0x2640b7[_0x3882('0x33')]=_0x1f9689;if(_0x55e203[_0x3882('0x45')]['includeAll']){_0x1c7180[_0x3882('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x3882('0x56')](_0x1c7180);})[_0x3882('0x23')](function(_0x2174c8){_0x2640b7['rows']=_0x2174c8;return _0x2640b7;})[_0x3882('0x23')](respondWithFilteredResult(_0x3d0a87,_0x1c7180))[_0x3882('0x57')](handleError(_0x3d0a87,null));};exports[_0x3882('0x58')]=function(_0x328dce,_0x324962){var _0x51a77d={'raw':![],'where':{'id':_0x328dce[_0x3882('0x59')]['id']},'include':[{'model':db[_0x3882('0x41')],'as':'mandatoryDispositionPause'}]},_0x19f0d1={};_0x19f0d1[_0x3882('0x44')]=_[_0x3882('0x46')](db[_0x3882('0x54')][_0x3882('0x42')]);_0x19f0d1['query']=_['keys'](_0x328dce[_0x3882('0x45')]);_0x19f0d1[_0x3882('0x47')]=_[_0x3882('0x48')](_0x19f0d1['model'],_0x19f0d1['query']);_0x51a77d[_0x3882('0x49')]=_[_0x3882('0x48')](_0x19f0d1[_0x3882('0x44')],qs['fields'](_0x328dce[_0x3882('0x45')]['fields']));_0x51a77d[_0x3882('0x49')]=_0x51a77d[_0x3882('0x49')][_0x3882('0x5a')]?_0x51a77d['attributes']:_0x19f0d1[_0x3882('0x44')];if(_0x328dce[_0x3882('0x45')][_0x3882('0x5b')]){_0x51a77d[_0x3882('0x55')]=[{'all':!![]}];}_0x51a77d=_['merge']({},_0x51a77d,_0x328dce['options']);return db[_0x3882('0x54')][_0x3882('0x5c')](_0x51a77d)[_0x3882('0x23')](handleEntityNotFound(_0x324962,null))['then'](respondWithResult(_0x324962,null))[_0x3882('0x57')](handleError(_0x324962,null));};exports[_0x3882('0x5d')]=function(_0x3dc03a,_0x4bfec4){return db['WhatsappAccount'][_0x3882('0x5d')](_0x3dc03a[_0x3882('0x5e')],{})[_0x3882('0x23')](function(_0x5a8128){var _0x42f04a=_0x3dc03a['user'][_0x3882('0x3a')]({'plain':!![]});if(!_0x42f04a)throw new Error(_0x3882('0x5f'));if(_0x42f04a[_0x3882('0x60')]===_0x3882('0x61')){var _0x4e11e5=_0x5a8128[_0x3882('0x3a')]({'plain':!![]});var _0x18f90d=_0x3882('0x62');return db[_0x3882('0x63')][_0x3882('0x5c')]({'where':{'name':_0x18f90d,'userProfileId':_0x42f04a[_0x3882('0x64')]},'raw':!![]})[_0x3882('0x23')](function(_0x5a2250){if(_0x5a2250&&_0x5a2250[_0x3882('0x65')]===0x0){return db[_0x3882('0x3b')]['create']({'name':_0x4e11e5['name'],'resourceId':_0x4e11e5['id'],'type':_0x5a2250['name'],'sectionId':_0x5a2250['id']},{})[_0x3882('0x23')](function(){return _0x5a8128;});}else{return _0x5a8128;}})[_0x3882('0x57')](function(_0x41fca6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41fca6);throw _0x41fca6;});}return _0x5a8128;})[_0x3882('0x23')](respondWithResult(_0x4bfec4,0xc9))[_0x3882('0x57')](handleError(_0x4bfec4,null));};exports[_0x3882('0x38')]=function(_0x5a79e1,_0x5291b5){if(_0x5a79e1['body']['id']){delete _0x5a79e1[_0x3882('0x5e')]['id'];}return db['WhatsappAccount'][_0x3882('0x5c')]({'where':{'id':_0x5a79e1[_0x3882('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3882('0x66')}]})[_0x3882('0x23')](handleEntityNotFound(_0x5291b5,null))[_0x3882('0x23')](saveUpdates(_0x5a79e1['body'],null))['then'](respondWithResult(_0x5291b5,null))['catch'](handleError(_0x5291b5,null));};exports[_0x3882('0x39')]=function(_0x281d63,_0x4381d2){return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x281d63[_0x3882('0x59')]['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x4381d2,null))[_0x3882('0x23')](removeEntity(_0x4381d2,null))[_0x3882('0x57')](handleError(_0x4381d2,null));};exports[_0x3882('0x67')]=function(_0xbd0196,_0x238f83){return db['WhatsappAccount']['describe']()[_0x3882('0x23')](respondWithResult(_0x238f83,null))[_0x3882('0x57')](handleError(_0x238f83,null));};exports[_0x3882('0x68')]=function(_0x4468b6,_0x2fdfb1,_0x36b2d3){if(_0x4468b6[_0x3882('0x5e')]['id']){delete _0x4468b6[_0x3882('0x5e')]['id'];}return db[_0x3882('0x54')]['find']({'where':{'id':_0x4468b6['params']['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x2fdfb1,null))[_0x3882('0x23')](function(_0x3c8bb8){if(_0x3c8bb8){_0x4468b6[_0x3882('0x5e')][_0x3882('0x69')]=_0x3c8bb8['id'];return db[_0x3882('0x6a')][_0x3882('0x5d')](_0x4468b6[_0x3882('0x5e')]);}})[_0x3882('0x23')](respondWithResult(_0x2fdfb1,null))[_0x3882('0x57')](handleError(_0x2fdfb1,null));};exports[_0x3882('0x6b')]=function(_0x4fcdfb,_0x4a34c3,_0xbbd1bf){var _0x407938={'raw':![],'where':{}};var _0x459b18={};var _0x1de9eb={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3882('0x6c')]({'where':{'id':_0x4fcdfb[_0x3882('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a34c3,null))[_0x3882('0x23')](function(_0x43bba7){if(_0x43bba7){_0x459b18[_0x3882('0x44')]=_[_0x3882('0x46')](db[_0x3882('0x6a')][_0x3882('0x42')]);_0x459b18[_0x3882('0x45')]=_[_0x3882('0x46')](_0x4fcdfb[_0x3882('0x45')]);_0x459b18[_0x3882('0x47')]=_[_0x3882('0x48')](_0x459b18[_0x3882('0x44')],_0x459b18[_0x3882('0x45')]);_0x407938[_0x3882('0x49')]=_[_0x3882('0x48')](_0x459b18[_0x3882('0x44')],qs[_0x3882('0x4a')](_0x4fcdfb[_0x3882('0x45')][_0x3882('0x4a')]));_0x407938['attributes']=_0x407938[_0x3882('0x49')][_0x3882('0x5a')]?_0x407938[_0x3882('0x49')]:_0x459b18[_0x3882('0x44')];if(!_0x4fcdfb[_0x3882('0x45')]['hasOwnProperty'](_0x3882('0x6d'))){_0x407938[_0x3882('0x32')]=qs[_0x3882('0x32')](_0x4fcdfb['query'][_0x3882('0x32')]);_0x407938[_0x3882('0x30')]=qs['offset'](_0x4fcdfb[_0x3882('0x45')][_0x3882('0x30')]);}_0x407938['order']=qs[_0x3882('0x4d')](_0x4fcdfb[_0x3882('0x45')][_0x3882('0x4d')]);_0x407938[_0x3882('0x4e')]=qs['filters'](_[_0x3882('0x6e')](_0x4fcdfb['query'],_0x459b18['filters']));_0x407938['where'][_0x3882('0x69')]=_0x43bba7['id'];if(_0x4fcdfb[_0x3882('0x45')][_0x3882('0x4f')]){_0x407938[_0x3882('0x4e')]=_[_0x3882('0x50')](_0x407938[_0x3882('0x4e')],{'$or':_[_0x3882('0x6f')](_0x407938['attributes'],function(_0x5cd29a){var _0x5f2239={};_0x5f2239[_0x5cd29a]={'$like':'%'+_0x4fcdfb['query'][_0x3882('0x4f')]+'%'};return _0x5f2239;})});}_0x407938=_['merge']({},_0x407938,_0x4fcdfb['options']);return db[_0x3882('0x6a')][_0x3882('0x33')]({'where':_0x407938[_0x3882('0x4e')]})['then'](function(_0x3018ff){_0x1de9eb[_0x3882('0x33')]=_0x3018ff;if(_0x4fcdfb[_0x3882('0x45')]['includeAll']){_0x407938['include']=[{'all':!![]}];}return db[_0x3882('0x6a')][_0x3882('0x56')](_0x407938);})[_0x3882('0x23')](function(_0x331875){_0x1de9eb['rows']=_0x331875;return _0x1de9eb;});}})[_0x3882('0x23')](respondWithFilteredResult(_0x4a34c3,_0x407938))[_0x3882('0x57')](handleError(_0x4a34c3,null));};exports['removeDispositions']=function(_0x302a27,_0x501855,_0x22e645){return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x302a27[_0x3882('0x59')]['id']}})['then'](handleEntityNotFound(_0x501855,null))[_0x3882('0x23')](function(_0xad1b6f){if(_0xad1b6f){return _0xad1b6f[_0x3882('0x70')](_0x302a27[_0x3882('0x45')]['ids']);}})[_0x3882('0x23')](respondWithStatusCode(_0x501855,null))[_0x3882('0x57')](handleError(_0x501855,null));};exports[_0x3882('0x71')]=function(_0x5594f9,_0x3e80db,_0x5bd188){if(_0x5594f9[_0x3882('0x5e')]['id']){delete _0x5594f9[_0x3882('0x5e')]['id'];}return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x5594f9[_0x3882('0x59')]['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x3e80db,null))[_0x3882('0x23')](function(_0x3ec4b9){if(_0x3ec4b9){_0x5594f9[_0x3882('0x5e')][_0x3882('0x69')]=_0x3ec4b9['id'];return db[_0x3882('0x72')][_0x3882('0x5d')](_0x5594f9[_0x3882('0x5e')]);}})[_0x3882('0x23')](respondWithResult(_0x3e80db,null))[_0x3882('0x57')](handleError(_0x3e80db,null));};exports['getAnswers']=function(_0x1c62ae,_0x4ef4cf,_0x3609b2){var _0x48824e={'raw':![],'where':{}};var _0x283de4={};var _0x114e43={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3882('0x6c')]({'where':{'id':_0x1c62ae[_0x3882('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ef4cf,null))[_0x3882('0x23')](function(_0x181891){if(_0x181891){_0x283de4[_0x3882('0x44')]=_['keys'](db[_0x3882('0x72')][_0x3882('0x42')]);_0x283de4[_0x3882('0x45')]=_[_0x3882('0x46')](_0x1c62ae[_0x3882('0x45')]);_0x283de4[_0x3882('0x47')]=_[_0x3882('0x48')](_0x283de4[_0x3882('0x44')],_0x283de4['query']);_0x48824e['attributes']=_[_0x3882('0x48')](_0x283de4[_0x3882('0x44')],qs[_0x3882('0x4a')](_0x1c62ae[_0x3882('0x45')]['fields']));_0x48824e['attributes']=_0x48824e[_0x3882('0x49')][_0x3882('0x5a')]?_0x48824e[_0x3882('0x49')]:_0x283de4[_0x3882('0x44')];if(!_0x1c62ae[_0x3882('0x45')][_0x3882('0x4b')](_0x3882('0x6d'))){_0x48824e[_0x3882('0x32')]=qs[_0x3882('0x32')](_0x1c62ae[_0x3882('0x45')]['limit']);_0x48824e[_0x3882('0x30')]=qs[_0x3882('0x30')](_0x1c62ae[_0x3882('0x45')][_0x3882('0x30')]);}_0x48824e[_0x3882('0x4c')]=qs[_0x3882('0x4d')](_0x1c62ae[_0x3882('0x45')][_0x3882('0x4d')]);_0x48824e['where']=qs[_0x3882('0x47')](_[_0x3882('0x6e')](_0x1c62ae['query'],_0x283de4[_0x3882('0x47')]));_0x48824e[_0x3882('0x4e')]['WhatsappAccountId']=_0x181891['id'];if(_0x1c62ae[_0x3882('0x45')][_0x3882('0x4f')]){_0x48824e[_0x3882('0x4e')]=_[_0x3882('0x50')](_0x48824e[_0x3882('0x4e')],{'$or':_[_0x3882('0x6f')](_0x48824e['attributes'],function(_0x239a08){var _0x1e0097={};_0x1e0097[_0x239a08]={'$like':'%'+_0x1c62ae['query']['filter']+'%'};return _0x1e0097;})});}_0x48824e=_[_0x3882('0x50')]({},_0x48824e,_0x1c62ae[_0x3882('0x53')]);return db[_0x3882('0x72')][_0x3882('0x33')]({'where':_0x48824e[_0x3882('0x4e')]})['then'](function(_0xd3d84c){_0x114e43[_0x3882('0x33')]=_0xd3d84c;if(_0x1c62ae['query']['includeAll']){_0x48824e[_0x3882('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x48824e);})[_0x3882('0x23')](function(_0xcd274d){_0x114e43[_0x3882('0x73')]=_0xcd274d;return _0x114e43;});}})[_0x3882('0x23')](respondWithFilteredResult(_0x4ef4cf,_0x48824e))['catch'](handleError(_0x4ef4cf,null));};exports['removeAnswers']=function(_0x24817c,_0x5bcfb7,_0x40f081){return db['WhatsappAccount'][_0x3882('0x5c')]({'where':{'id':_0x24817c[_0x3882('0x59')]['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x5bcfb7,null))[_0x3882('0x23')](function(_0x483163){if(_0x483163){return _0x483163[_0x3882('0x74')](_0x24817c[_0x3882('0x45')][_0x3882('0x75')]);}})[_0x3882('0x23')](respondWithStatusCode(_0x5bcfb7,null))[_0x3882('0x57')](handleError(_0x5bcfb7,null));};exports[_0x3882('0x76')]=function(_0x521272,_0x71a820,_0x302224){return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x521272['params']['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x71a820,null))[_0x3882('0x23')](function(_0x4f7165){if(_0x4f7165){return _0x4f7165[_0x3882('0x76')](_0x521272['body'][_0x3882('0x75')],_['omit'](_0x521272[_0x3882('0x5e')],[_0x3882('0x75'),'id'])||{})['spread'](function(_0x103eef){for(var _0x544f18=0x0;_0x544f18<_0x521272[_0x3882('0x5e')][_0x3882('0x75')][_0x3882('0x5a')];_0x544f18+=0x1){socket[_0x3882('0x77')](_0x3882('0x78'),{'UserId':Number(_0x521272['body'][_0x3882('0x75')][_0x544f18]),'WhatsappAccountId':Number(_0x521272[_0x3882('0x59')]['id'])});}return _0x103eef;});}})[_0x3882('0x23')](respondWithResult(_0x71a820,null))[_0x3882('0x57')](handleError(_0x71a820,null));};exports['removeAgents']=function(_0x18d74b,_0x2fc662,_0x39352d){return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x18d74b[_0x3882('0x59')]['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x2fc662,null))[_0x3882('0x23')](function(_0x42545e){if(_0x42545e){return _0x42545e[_0x3882('0x79')](_0x18d74b[_0x3882('0x45')][_0x3882('0x75')])['then'](function(){if(_[_0x3882('0x7a')](_0x18d74b[_0x3882('0x45')][_0x3882('0x75')])){for(var _0x584f99=0x0;_0x584f99<_0x18d74b[_0x3882('0x45')]['ids'][_0x3882('0x5a')];_0x584f99+=0x1){socket[_0x3882('0x77')](_0x3882('0x7b'),{'UserId':Number(_0x18d74b[_0x3882('0x45')][_0x3882('0x75')][_0x584f99]),'WhatsappAccountId':Number(_0x18d74b[_0x3882('0x59')]['id'])});}}else{socket[_0x3882('0x77')](_0x3882('0x7b'),{'UserId':Number(_0x18d74b[_0x3882('0x45')][_0x3882('0x75')]),'WhatsappAccountId':Number(_0x18d74b[_0x3882('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fc662,null))[_0x3882('0x57')](handleError(_0x2fc662,null));};exports['getAgents']=function(_0x48c49d,_0x4de868,_0x54ee27){var _0x48fd44={};var _0x32790c={};var _0x4a0b64;var _0x670223;return db[_0x3882('0x54')][_0x3882('0x6c')]({'where':{'id':_0x48c49d[_0x3882('0x59')]['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x4de868,null))[_0x3882('0x23')](function(_0x3c99d4){if(_0x3c99d4){_0x4a0b64=_0x3c99d4;_0x32790c[_0x3882('0x44')]=_[_0x3882('0x46')](db['User'][_0x3882('0x42')]);_0x32790c[_0x3882('0x45')]=_['keys'](_0x48c49d[_0x3882('0x45')]);_0x32790c[_0x3882('0x47')]=_[_0x3882('0x48')](_0x32790c[_0x3882('0x44')],_0x32790c['query']);_0x48fd44[_0x3882('0x49')]=_[_0x3882('0x48')](_0x32790c[_0x3882('0x44')],qs[_0x3882('0x4a')](_0x48c49d['query'][_0x3882('0x4a')]));_0x48fd44[_0x3882('0x49')]=_0x48fd44[_0x3882('0x49')]['length']?_0x48fd44['attributes']:_0x32790c['model'];_0x48fd44[_0x3882('0x4c')]=qs[_0x3882('0x4d')](_0x48c49d[_0x3882('0x45')]['sort']);_0x48fd44[_0x3882('0x4e')]=qs[_0x3882('0x47')](_[_0x3882('0x6e')](_0x48c49d[_0x3882('0x45')],_0x32790c[_0x3882('0x47')]));if(_0x48c49d['query'][_0x3882('0x4f')]){_0x48fd44[_0x3882('0x4e')]=_[_0x3882('0x50')](_0x48fd44[_0x3882('0x4e')],{'$or':_[_0x3882('0x6f')](_0x48fd44[_0x3882('0x49')],function(_0x3510fb){var _0x17979d={};_0x17979d[_0x3510fb]={'$like':'%'+_0x48c49d[_0x3882('0x45')]['filter']+'%'};return _0x17979d;})});}_0x48fd44=_[_0x3882('0x50')]({},_0x48fd44,_0x48c49d[_0x3882('0x53')]);return _0x4a0b64[_0x3882('0x7c')](_0x48fd44);}})[_0x3882('0x23')](function(_0x42a0d4){if(_0x42a0d4){_0x670223=_0x42a0d4[_0x3882('0x5a')];if(!_0x48c49d[_0x3882('0x45')][_0x3882('0x4b')]('nolimit')){_0x48fd44['limit']=qs['limit'](_0x48c49d['query']['limit']);_0x48fd44[_0x3882('0x30')]=qs[_0x3882('0x30')](_0x48c49d[_0x3882('0x45')][_0x3882('0x30')]);}return _0x4a0b64[_0x3882('0x7c')](_0x48fd44);}})[_0x3882('0x23')](function(_0x2711e3){if(_0x2711e3){return _0x2711e3?{'count':_0x670223,'rows':_0x2711e3}:null;}})['then'](respondWithResult(_0x4de868,null))[_0x3882('0x57')](handleError(_0x4de868,null));};exports[_0x3882('0x7d')]=function(_0x54f264,_0x23ba65){var _0xe3a003=_0x54f264[_0x3882('0x59')]['id'];var _0xaaa5c1=_0x54f264[_0x3882('0x5e')];var _0x405301=0xc8;var _0xc7b575=null;return db[_0x3882('0x7e')]['transaction']({'isolationLevel':db['sequelize'][_0x3882('0x7f')][_0x3882('0x80')][_0x3882('0x81')]},function(_0x339441){return db['WhatsappAccount']['findOne']({'where':{'id':_0xe3a003},'transaction':_0x339441})[_0x3882('0x23')](function(_0x4df4aa){if(_0x4df4aa){return db['WhatsappApplication'][_0x3882('0x39')]({'where':{'WhatsappAccountId':_0xe3a003},'transaction':_0x339441})[_0x3882('0x23')](function(){var _0x274838=_['map'](_0xaaa5c1,function(_0xf18a4){_0xf18a4[_0x3882('0x69')]=_0xe3a003;return _0xf18a4;});return db[_0x3882('0x82')]['bulkCreate'](_0x274838,{'transaction':_0x339441});});}else{_0x405301=0x194;_0xc7b575=[];}});})[_0x3882('0x23')](function(){if(_0x405301!==0x194){return db[_0x3882('0x82')][_0x3882('0x83')]({'where':{'WhatsappAccountId':_0xe3a003},'order':'priority'})['then'](function(_0x36d259){_0xc7b575=_0x36d259;});}})[_0x3882('0x57')](function(_0x13e46b){_0x405301=0x1f4;logger[_0x3882('0x29')](_0x13e46b['stack']);if(_0x13e46b[_0x3882('0x3e')]){delete _0x13e46b[_0x3882('0x3e')];}_0xc7b575=_0x13e46b;})[_0x3882('0x84')](function(){if(_0xc7b575===null){_0x23ba65[_0x3882('0x3c')](_0x405301);}else{if(_0x405301===0x1f4){_0x23ba65[_0x3882('0x2d')](_0x405301)[_0x3882('0x3f')](_0xc7b575);}else{_0x23ba65[_0x3882('0x2d')](_0x405301)['json'](_0xc7b575);}}});};exports[_0x3882('0x85')]=function(_0x39a6b5,_0x54dbc2,_0x144816){var _0x6d2bdc={};var _0xfbf3be={};var _0x29a71e;var _0x467d33;return db[_0x3882('0x54')]['findOne']({'where':{'id':_0x39a6b5['params']['id']}})[_0x3882('0x23')](handleEntityNotFound(_0x54dbc2,null))[_0x3882('0x23')](function(_0x549d10){if(_0x549d10){_0x29a71e=_0x549d10;_0xfbf3be[_0x3882('0x44')]=_[_0x3882('0x46')](db[_0x3882('0x82')][_0x3882('0x42')]);_0xfbf3be[_0x3882('0x45')]=_[_0x3882('0x46')](_0x39a6b5[_0x3882('0x45')]);_0xfbf3be[_0x3882('0x47')]=_[_0x3882('0x48')](_0xfbf3be[_0x3882('0x44')],_0xfbf3be['query']);_0x6d2bdc['attributes']=_[_0x3882('0x48')](_0xfbf3be[_0x3882('0x44')],qs[_0x3882('0x4a')](_0x39a6b5[_0x3882('0x45')][_0x3882('0x4a')]));_0x6d2bdc['attributes']=_0x6d2bdc[_0x3882('0x49')][_0x3882('0x5a')]?_0x6d2bdc['attributes']:_0xfbf3be[_0x3882('0x44')];_0x6d2bdc[_0x3882('0x4c')]=qs[_0x3882('0x4d')](_0x39a6b5['query'][_0x3882('0x4d')]);_0x6d2bdc[_0x3882('0x4e')]=qs[_0x3882('0x47')](_[_0x3882('0x6e')](_0x39a6b5[_0x3882('0x45')],_0xfbf3be[_0x3882('0x47')]));if(_0x39a6b5[_0x3882('0x45')][_0x3882('0x4f')]){_0x6d2bdc['where']=_['merge'](_0x6d2bdc['where'],{'$or':_[_0x3882('0x6f')](_0x6d2bdc['attributes'],function(_0x3dfffd){var _0x2d4039={};_0x2d4039[_0x3dfffd]={'$like':'%'+_0x39a6b5[_0x3882('0x45')]['filter']+'%'};return _0x2d4039;})});}_0x6d2bdc=_[_0x3882('0x50')]({},_0x6d2bdc,_0x39a6b5['options']);return _0x29a71e[_0x3882('0x85')](_0x6d2bdc);}})[_0x3882('0x23')](function(_0x1df257){if(_0x1df257){_0x467d33=_0x1df257[_0x3882('0x5a')];if(!_0x39a6b5['query'][_0x3882('0x4b')](_0x3882('0x6d'))){_0x6d2bdc[_0x3882('0x32')]=qs['limit'](_0x39a6b5[_0x3882('0x45')][_0x3882('0x32')]);_0x6d2bdc['offset']=qs[_0x3882('0x30')](_0x39a6b5[_0x3882('0x45')][_0x3882('0x30')]);}return _0x29a71e[_0x3882('0x85')](_0x6d2bdc);}})[_0x3882('0x23')](function(_0x515b4a){if(_0x515b4a){return _0x515b4a?{'count':_0x467d33,'rows':_0x515b4a}:null;}})[_0x3882('0x23')](respondWithResult(_0x54dbc2,null))[_0x3882('0x57')](handleError(_0x54dbc2,null));};exports['notify']=function(_0x437938,_0x596cae,_0x1fdb72){var _0x9d228b={'channel':_0x3882('0x86')};var _0xb54688=[];var _0x328862=[];var _0x114d4f={};return db[_0x3882('0x54')]['find']({'where':{'id':_0x437938[_0x3882('0x59')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x3882('0x87')}]})[_0x3882('0x23')](handleEntityNotFound(_0x596cae,null))[_0x3882('0x23')](function(_0x18af39){_0x9d228b[_0x3882('0x88')]=_0x18af39;if(_0x9d228b[_0x3882('0x88')]&&_0x9d228b[_0x3882('0x88')]['type']==='sinch'&&_0x437938[_0x3882('0x5e')][_0x3882('0x89')]){if(_0x437938[_0x3882('0x5e')][_0x3882('0x89')][_0x3882('0x5a')]===0x0)return;if(_0x437938[_0x3882('0x5e')][_0x3882('0x89')][0x0][_0x3882('0x8a')]!==_0x3882('0x8b'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x437938[_0x3882('0x5e')][_0x3882('0x89')][0x0][_0x3882('0x8c')]},{'where':{'messageId':_0x437938['body']['statuses'][0x0][_0x3882('0x8d')]},'individualHooks':!![]})[_0x3882('0x23')](function(_0x3a0faf){return _0x596cae[_0x3882('0x2d')](0xc8)[_0x3882('0x2f')](_0x3a0faf);});}_0x9d228b[_0x3882('0x8e')]=_[_0x3882('0x8f')](_0x18af39['Applications'],['priority'],[_0x3882('0x90')]);if(_0x9d228b['account'][_0x3882('0x87')]){delete _0x9d228b[_0x3882('0x88')][_0x3882('0x87')];}return db[_0x3882('0x91')][_0x3882('0x67')]()[_0x3882('0x23')](function(_0x27c5a6){if(!_0x27c5a6){throw new db[(_0x3882('0x92'))][(_0x3882('0x93'))](_0x3882('0x94'));}_0xb54688=_['difference'](_[_0x3882('0x46')](_0x27c5a6),[_0x3882('0x95'),_0x3882('0x96')]);_0x328862=_['difference'](_[_0x3882('0x46')](_0x27c5a6),['createdAt',_0x3882('0x96'),_0x3882('0x97'),_0x3882('0x98')]);_0x9d228b[_0x3882('0x5e')]={'mapKey':'mobile'};if(_0x9d228b[_0x3882('0x88')]&&_0x9d228b['account'][_0x3882('0x51')]===_0x3882('0x99')){_0x9d228b['body'][_0x3882('0x9a')]=_0x437938[_0x3882('0x5e')][_0x3882('0x9b')][_0x3882('0x9c')](_0x3882('0x9d'),'');_0x9d228b[_0x3882('0x5e')][_0x3882('0x5e')]=_0x437938[_0x3882('0x5e')][_0x3882('0x9e')];_0x9d228b[_0x3882('0x5e')]['messageId']=_0x437938[_0x3882('0x5e')][_0x3882('0x9f')];}if(_0x9d228b[_0x3882('0x88')]&&_0x9d228b[_0x3882('0x88')][_0x3882('0x51')]===_0x3882('0xa0')){_0x9d228b[_0x3882('0x5e')][_0x3882('0x9a')]=_0x437938['body'][_0x3882('0xa1')][0x0][_0x3882('0x9a')];_0x9d228b[_0x3882('0x5e')][_0x3882('0x5e')]=_0x437938[_0x3882('0x5e')][_0x3882('0xa1')][0x0]['message']['body'];_0x9d228b[_0x3882('0x5e')][_0x3882('0xa2')]=_0x437938[_0x3882('0x5e')][_0x3882('0xa1')][0x0][_0x3882('0x8d')];}if(_0x9d228b[_0x3882('0x5e')]['id']){delete _0x9d228b[_0x3882('0x5e')]['id'];}if(_[_0x3882('0xa3')](_0x9d228b[_0x3882('0x5e')]['from'])){throw new db[(_0x3882('0x92'))][(_0x3882('0x93'))](_0x3882('0xa4'));}if(_[_0x3882('0xa3')](_0x9d228b[_0x3882('0x5e')][_0x3882('0x5e')])||_0x9d228b[_0x3882('0x5e')][_0x3882('0x5e')]===''){throw new db[(_0x3882('0x92'))][(_0x3882('0x93'))](_0x3882('0xa5'));}if(_['isNil'](_0x9d228b[_0x3882('0x5e')][_0x3882('0xa6')])){throw new db[(_0x3882('0x92'))][(_0x3882('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x328862);}if(!_['includes'](_0x328862,_0x9d228b['body'][_0x3882('0xa6')])){throw new db[(_0x3882('0x92'))]['ValidationError'](_0x3882('0xa7')+_0x328862);}_0x114d4f[_0x9d228b[_0x3882('0x5e')][_0x3882('0xa6')]]=_0x9d228b[_0x3882('0x5e')][_0x3882('0x9a')];return db[_0x3882('0xa8')][_0x3882('0x5c')]({'where':{'id':_0x9d228b[_0x3882('0x88')]['ListId']},'include':[{'model':db[_0x3882('0x91')],'as':_0x3882('0xa9'),'where':_0x114d4f,'limit':0x1,'order':[['updatedAt',_0x3882('0xaa')]]}]});})[_0x3882('0x23')](handleEntityNotFound(_0x596cae,null))[_0x3882('0x23')](function(_0x1a398c){if(_0x1a398c){_0x9d228b[_0x3882('0xab')]=_[_0x3882('0xac')](_0x1a398c,[_0x3882('0xa9')]);if(_0x1a398c['Contacts'][_0x3882('0x5a')]){return _0x1a398c[_0x3882('0xa9')][0x0];}var _0x4a2469=_[_0x3882('0x1b')](_0x9d228b[_0x3882('0x5e')],{'firstName':_0x9d228b['body'][_0x3882('0x9a')],'ListId':_0x1a398c['id']});_0x4a2469[_0x9d228b[_0x3882('0x5e')]['mapKey']]=_0x9d228b[_0x3882('0x5e')][_0x3882('0x9a')];return db[_0x3882('0x91')][_0x3882('0x5d')](_0x4a2469,{'fields':_0xb54688,'raw':!![]});}})[_0x3882('0x23')](handleEntityNotFound(_0x596cae,null))[_0x3882('0x23')](function(_0x8bad2a){if(_0x8bad2a){_0x9d228b[_0x3882('0xad')]=_0x8bad2a;var _0x3a11cd={'ContactId':_0x8bad2a['id'],'phone':_0x9d228b[_0x3882('0x5e')][_0x3882('0x9a')],'WhatsappAccountId':_0x437938[_0x3882('0x59')]['id']};var _0x18270e={'ContactId':_0x8bad2a['id'],'WhatsappAccountId':_0x437938[_0x3882('0x59')]['id'],'closed':![]};return db[_0x3882('0xae')][_0x3882('0x5c')]({'where':_0x18270e})[_0x3882('0x23')](function(_0x35ef8e){if(_0x35ef8e){return[_0x35ef8e,![]];}return db[_0x3882('0xae')][_0x3882('0x5d')](_0x3a11cd)[_0x3882('0x23')](function(_0x4ad315){return[_0x4ad315,!![]];});});}})[_0x3882('0xaf')](function(_0x124722,_0x51b5f6){_0x9d228b[_0x3882('0xb0')]=_0x124722[_0x3882('0x3a')]({'plain':!![]});_0x9d228b[_0x3882('0xb0')]['created']=![];if(_0x51b5f6){if(_0x9d228b[_0x3882('0x88')]['autoclose']){_0x9d228b[_0x3882('0x8e')][_0x3882('0xb1')]({'id':0x0,'priority':_0x9d228b['applications'][_0x3882('0x5a')]+0x1,'app':'close','appdata':_0x3882('0xb2'),'interval':_0x3882('0xb3')});}_0x9d228b[_0x3882('0xb0')]['created']=!![];}return db['WhatsappMessage'][_0x3882('0x5d')]({'phone':_0x9d228b[_0x3882('0x5e')][_0x3882('0x9a')],'messageId':_0x9d228b['body'][_0x3882('0xa2')],'body':_0x9d228b['body'][_0x3882('0x5e')],'WhatsappAccountId':_0x437938[_0x3882('0x59')]['id'],'WhatsappInteractionId':_0x124722['id'],'direction':'in','ContactId':_0x124722['ContactId'],'AttachmentId':_0x9d228b[_0x3882('0x5e')][_0x3882('0xb4')]});})['then'](function(_0x46884b){_0x9d228b[_0x3882('0x2c')]=_0x46884b;if(_0x9d228b['interaction']['UserId']){return db[_0x3882('0xb5')][_0x3882('0x5c')]({'attributes':['id',_0x3882('0x3e')],'where':{'id':_0x9d228b[_0x3882('0xb0')]['UserId']}})[_0x3882('0x23')](function(_0xd38552){if(_0xd38552){_0x9d228b['applications'][_0x3882('0xb6')]({'id':0x0,'priority':0x0,'app':_0x3882('0xb7'),'appdata':_0xd38552[_0x3882('0x3e')]+','+(_0x9d228b[_0x3882('0x88')]['waitForTheAssignedAgent']||0xa),'interval':_0x3882('0xb3')});}return respondWithRpcPromise('Start',_0x3882('0xb8'),_0x9d228b);});}return respondWithRpcPromise(_0x3882('0xb9'),_0x3882('0xb8'),_0x9d228b);})[_0x3882('0x23')](function(_0x23ec09){if(_0x23ec09){var _0x5d1757=0xc8;var _0x46847f=_0x3882('0xba');logger[_0x3882('0x24')](_0x3882('0x26'),_0x46847f,_0x5d1757,_0x3882('0xbb'));logger[_0x3882('0x25')](_0x3882('0xbc'),_0x46847f,_0x5d1757,_0x3882('0xbb'),JSON['stringify'](_0x23ec09));if(_0x9d228b['account'][_0x3882('0x51')]===_0x3882('0x99')){return _0x596cae[_0x3882('0x2d')](_0x5d1757)[_0x3882('0xbd')](_0x3882('0xbe'),'text/xml')[_0x3882('0x3f')](_0x3882('0xbf'));}else{return _0x596cae['status'](_0x5d1757)[_0x3882('0x2f')](_0x23ec09);}}});})['catch'](handleError(_0x596cae,null));};exports['send']=function(_0x6cdc21,_0x33249f,_0x22dfe2){var _0x226421,_0x453ee1,_0x1d6a3f;if(_['isNil'](_0x6cdc21[_0x3882('0x5e')]['body'])||_0x6cdc21[_0x3882('0x5e')][_0x3882('0x5e')]===''){throw new db[(_0x3882('0x92'))]['ValidationError'](_0x3882('0xa5'));}if(_[_0x3882('0xa3')](_0x6cdc21[_0x3882('0x5e')]['to'])){throw new db[(_0x3882('0x92'))]['ValidationError'](_0x3882('0xc0'));}_0x226421=_0x6cdc21[_0x3882('0x5e')]['to'];return db[_0x3882('0x54')][_0x3882('0x5c')]({'where':{'id':_0x6cdc21[_0x3882('0x59')]['id']},'include':[{'model':db[_0x3882('0xa8')],'as':_0x3882('0xc1'),'include':[{'model':db[_0x3882('0x91')],'as':_0x3882('0xa9'),'where':{'mobile':_0x226421},'limit':0x1,'order':[[_0x3882('0x96'),_0x3882('0xaa')]]}]}]})[_0x3882('0x23')](handleEntityNotFound(_0x33249f,null))[_0x3882('0x23')](function(_0x317e24){if(_0x317e24&&_0x317e24[_0x3882('0xc1')]){_0x453ee1=_0x317e24[_0x3882('0x3a')]({'plain':!![]});if(_0x453ee1[_0x3882('0xc1')]&&_0x453ee1[_0x3882('0xc1')]['Contacts'][_0x3882('0x5a')]){return _0x453ee1[_0x3882('0xc1')][_0x3882('0xa9')][0x0];}return db[_0x3882('0x91')][_0x3882('0x5d')](_[_0x3882('0x1b')](_0x6cdc21['body'],{'firstName':_0x226421,'mobile':_0x226421,'phone':_0x226421,'ListId':_0x453ee1['ListId']}));}})[_0x3882('0x23')](handleEntityNotFound(_0x33249f,null))['then'](function(_0x5f0344){if(_0x5f0344){_0x1d6a3f=_0x5f0344;return db['WhatsappInteraction'][_0x3882('0x5c')]({'where':{'ContactId':_0x1d6a3f['id'],'closed':![],'WhatsappAccountId':_0x453ee1['id']}})[_0x3882('0x23')](function(_0xaf5163){if(_0xaf5163){return[_0xaf5163,![]];}return db[_0x3882('0xae')][_0x3882('0x5d')]({'UserId':_0x6cdc21[_0x3882('0x61')]['id'],'ContactId':_0x1d6a3f['id'],'WhatsappAccountId':_0x453ee1['id'],'phone':_0x226421,'firstMsgDirection':_0x3882('0xc2'),'Messages':[_[_0x3882('0x50')](_0x6cdc21[_0x3882('0x5e')],{'read':![],'body':_0x6cdc21[_0x3882('0x5e')][_0x3882('0x5e')],'phone':_0x226421,'WhatsappAccountId':_0x453ee1['id'],'UserId':_0x6cdc21[_0x3882('0x61')]['id'],'ContactId':_0x1d6a3f['id']})]},{'include':[{'model':db[_0x3882('0xc3')],'as':_0x3882('0xc4')}]})[_0x3882('0x23')](function(_0x3bb97b){return[_0x3bb97b,!![]];});});}})[_0x3882('0xaf')](function(_0xca32c8,_0x3aca4e){if(_0x3aca4e){return _0xca32c8;}return db[_0x3882('0xc3')][_0x3882('0x5d')](_[_0x3882('0x50')](_0x6cdc21[_0x3882('0x5e')],{'read':![],'body':_0x6cdc21[_0x3882('0x5e')][_0x3882('0x5e')],'phone':_0x226421,'WhatsappAccountId':_0x453ee1['id'],'WhatsappInteractionId':_0xca32c8['id'],'UserId':_0x6cdc21[_0x3882('0x61')]['id'],'ContactId':_0x1d6a3f['id']}))['then'](function(_0xc0bea){_0xca32c8[_0x3882('0xc5')][_0x3882('0xc4')]=[];_0xca32c8['dataValues'][_0x3882('0xc4')]['push'](_0xc0bea[_0x3882('0xc5')]);return _0xca32c8;});})['then'](respondWithResult(_0x33249f,null))[_0x3882('0x57')](handleError(_0x33249f,null));}; \ No newline at end of file +var _0xc824=['isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','updatedAt','DESC','list','contact','interaction','created','close','unmanaged','*,*,*,*','WhatsappMessage','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','CmList','List','WhatsappInteraction','out','dataValues','Messages','push','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','destroy','get','WhatsappAccounts','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','Disposition','getDispositions','findOne','length','hasOwnProperty','WhatsappAccountId','includeAll','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','priority','stack','finally','json','getApplications','whatsapp','Applications','account','sinch','statuses','read','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications'];(function(_0x2b8133,_0x3abc66){var _0x4e835f=function(_0x4226b9){while(--_0x4226b9){_0x2b8133['push'](_0x2b8133['shift']());}};_0x4e835f(++_0x3abc66);}(_0xc824,0x1ab));var _0x4c82=function(_0x4c5ecd,_0x43787f){_0x4c5ecd=_0x4c5ecd-0x0;var _0x10b9b2=_0xc824[_0x4c5ecd];return _0x10b9b2;};'use strict';var emlformat=require(_0x4c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c82('0x1'));var jsonpatch=require(_0x4c82('0x2'));var rp=require('request-promise');var moment=require(_0x4c82('0x3'));var BPromise=require(_0x4c82('0x4'));var Mustache=require(_0x4c82('0x5'));var util=require(_0x4c82('0x6'));var path=require('path');var sox=require(_0x4c82('0x7'));var csv=require(_0x4c82('0x8'));var ejs=require(_0x4c82('0x9'));var fs=require('fs');var fs_extra=require(_0x4c82('0xa'));var _=require(_0x4c82('0xb'));var squel=require(_0x4c82('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c82('0x8'));var querystring=require(_0x4c82('0xd'));var Papa=require(_0x4c82('0xe'));var Redis=require(_0x4c82('0xf'));var authService=require(_0x4c82('0x10'));var qs=require(_0x4c82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c82('0x12'));var logger=require(_0x4c82('0x13'))(_0x4c82('0x14'));var utils=require(_0x4c82('0x15'));var config=require(_0x4c82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c82('0x17'))['db'];config[_0x4c82('0x18')]=_[_0x4c82('0x19')](config[_0x4c82('0x18')],{'host':_0x4c82('0x1a'),'port':0x18eb});var socket=require(_0x4c82('0x1b'))(new Redis(config[_0x4c82('0x18')]));require(_0x4c82('0x1c'))[_0x4c82('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x4b2755,_0x5d9992,_0x20c391,_0x35bf14){return new BPromise(function(_0x555465,_0x18d3d2){var _0x4b7612=_0x35bf14||client;return _0x4b7612[_0x4c82('0x1e')](_0x4b2755,_0x20c391)[_0x4c82('0x1f')](function(_0x1b2572){logger[_0x4c82('0x20')](_0x4c82('0x21'),_0x5d9992,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5d9992,_0x4c82('0x22'),JSON[_0x4c82('0x23')](_0x1b2572));if(_0x1b2572[_0x4c82('0x24')]){if(_0x1b2572[_0x4c82('0x24')]['code']===0x1f4){logger[_0x4c82('0x24')](_0x4c82('0x21'),_0x5d9992,_0x1b2572[_0x4c82('0x24')][_0x4c82('0x25')]);return _0x18d3d2(_0x1b2572['error'][_0x4c82('0x25')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5d9992,_0x1b2572[_0x4c82('0x24')]['message']);return _0x555465(_0x1b2572[_0x4c82('0x24')][_0x4c82('0x25')]);}else{logger[_0x4c82('0x20')](_0x4c82('0x21'),_0x5d9992,_0x4c82('0x22'));_0x555465(_0x1b2572[_0x4c82('0x26')][_0x4c82('0x25')]);}})['catch'](function(_0x3e9300){logger[_0x4c82('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x5d9992,_0x3e9300);_0x18d3d2(_0x3e9300);});});}function respondWithStatusCode(_0x406207,_0x1cd63f){_0x1cd63f=_0x1cd63f||0xcc;return function(_0x88026b){if(_0x88026b){return _0x406207[_0x4c82('0x27')](_0x1cd63f);}return _0x406207['status'](_0x1cd63f)[_0x4c82('0x28')]();};}function respondWithResult(_0x37803f,_0x12f91a){_0x12f91a=_0x12f91a||0xc8;return function(_0x217666){if(_0x217666){return _0x37803f[_0x4c82('0x29')](_0x12f91a)['json'](_0x217666);}};}function respondWithFilteredResult(_0x471bbb,_0x4d705d){return function(_0x3d1f3e){if(_0x3d1f3e){var _0x567407=typeof _0x4d705d[_0x4c82('0x2a')]===_0x4c82('0x2b')&&typeof _0x4d705d[_0x4c82('0x2c')]==='undefined';var _0x5cc88a=_0x3d1f3e['count'];var _0x362b0a=_0x567407?0x0:_0x4d705d[_0x4c82('0x2a')];var _0x303f38=_0x567407?_0x3d1f3e[_0x4c82('0x2d')]:_0x4d705d[_0x4c82('0x2a')]+_0x4d705d[_0x4c82('0x2c')];var _0x327095;if(_0x303f38>=_0x5cc88a){_0x303f38=_0x5cc88a;_0x327095=0xc8;}else{_0x327095=0xce;}_0x471bbb[_0x4c82('0x29')](_0x327095);return _0x471bbb[_0x4c82('0x2e')]('Content-Range',_0x362b0a+'-'+_0x303f38+'/'+_0x5cc88a)['json'](_0x3d1f3e);}return null;};}function patchUpdates(_0x4826ac){return function(_0x41d8b1){try{jsonpatch[_0x4c82('0x2f')](_0x41d8b1,_0x4826ac,!![]);}catch(_0x54fe77){return BPromise[_0x4c82('0x30')](_0x54fe77);}return _0x41d8b1[_0x4c82('0x31')]();};}function saveUpdates(_0x46cc0a,_0x5c4bb9){return function(_0x4cf79b){if(_0x4cf79b){return _0x4cf79b['update'](_0x46cc0a)[_0x4c82('0x1f')](function(_0x416510){return _0x416510;});}return null;};}function removeEntity(_0xb59546,_0x2c6956){return function(_0x3f7c69){if(_0x3f7c69){return _0x3f7c69[_0x4c82('0x32')]()['then'](function(){var _0x22e7db=_0x3f7c69[_0x4c82('0x33')]({'plain':!![]});var _0x4be30c=_0x4c82('0x34');return db['UserProfileResource'][_0x4c82('0x32')]({'where':{'type':_0x4be30c,'resourceId':_0x22e7db['id']}})['then'](function(){return _0x3f7c69;});})[_0x4c82('0x1f')](function(){_0xb59546['status'](0xcc)[_0x4c82('0x28')]();});}};}function handleEntityNotFound(_0x6af015,_0x2a449f){return function(_0x21efac){if(!_0x21efac){_0x6af015[_0x4c82('0x27')](0x194);}return _0x21efac;};}function handleError(_0x36322f,_0x49b362){_0x49b362=_0x49b362||0x1f4;return function(_0x78de94){logger[_0x4c82('0x24')](_0x78de94['stack']);if(_0x78de94['name']){delete _0x78de94['name'];}_0x36322f['status'](_0x49b362)[_0x4c82('0x35')](_0x78de94);};}exports['index']=function(_0x540f64,_0x16a638){var _0x445351={'include':[{'model':db[_0x4c82('0x36')],'as':_0x4c82('0x37')}]},_0x41804a={},_0x426b40={'count':0x0,'rows':[]};var _0x3f733f=_[_0x4c82('0x38')](db[_0x4c82('0x39')]['rawAttributes'],function(_0x33ce62){return{'name':_0x33ce62[_0x4c82('0x3a')],'type':_0x33ce62[_0x4c82('0x3b')][_0x4c82('0x3c')]};});_0x41804a[_0x4c82('0x3d')]=_[_0x4c82('0x38')](_0x3f733f,_0x4c82('0x3e'));_0x41804a[_0x4c82('0x3f')]=_[_0x4c82('0x40')](_0x540f64[_0x4c82('0x3f')]);_0x41804a[_0x4c82('0x41')]=_[_0x4c82('0x42')](_0x41804a['model'],_0x41804a[_0x4c82('0x3f')]);_0x445351[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x41804a[_0x4c82('0x3d')],qs[_0x4c82('0x44')](_0x540f64[_0x4c82('0x3f')][_0x4c82('0x44')]));_0x445351['attributes']=_0x445351[_0x4c82('0x43')]['length']?_0x445351[_0x4c82('0x43')]:_0x41804a[_0x4c82('0x3d')];if(!_0x540f64[_0x4c82('0x3f')]['hasOwnProperty'](_0x4c82('0x45'))){_0x445351['limit']=qs[_0x4c82('0x2c')](_0x540f64[_0x4c82('0x3f')][_0x4c82('0x2c')]);_0x445351['offset']=qs['offset'](_0x540f64[_0x4c82('0x3f')][_0x4c82('0x2a')]);}_0x445351[_0x4c82('0x46')]=qs['sort'](_0x540f64[_0x4c82('0x3f')][_0x4c82('0x47')]);_0x445351['where']=qs[_0x4c82('0x41')](_[_0x4c82('0x48')](_0x540f64[_0x4c82('0x3f')],_0x41804a[_0x4c82('0x41')]),_0x3f733f);if(_0x540f64[_0x4c82('0x3f')][_0x4c82('0x49')]){_0x445351[_0x4c82('0x4a')]=_[_0x4c82('0x4b')](_0x445351['where'],{'$or':_[_0x4c82('0x38')](_0x3f733f,function(_0x5a2c96){if(_0x5a2c96[_0x4c82('0x3b')]!==_0x4c82('0x4c')){var _0x83cba1={};_0x83cba1[_0x5a2c96[_0x4c82('0x3e')]]={'$like':'%'+_0x540f64['query']['filter']+'%'};return _0x83cba1;}})});}_0x445351=_[_0x4c82('0x4b')]({},_0x445351,_0x540f64[_0x4c82('0x4d')]);var _0x1395ed={'where':_0x445351[_0x4c82('0x4a')]};return db[_0x4c82('0x39')][_0x4c82('0x2d')](_0x1395ed)[_0x4c82('0x1f')](function(_0x11fbce){_0x426b40[_0x4c82('0x2d')]=_0x11fbce;if(_0x540f64['query']['includeAll']){_0x445351[_0x4c82('0x4e')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x445351);})[_0x4c82('0x1f')](function(_0x134925){_0x426b40[_0x4c82('0x4f')]=_0x134925;return _0x426b40;})['then'](respondWithFilteredResult(_0x16a638,_0x445351))[_0x4c82('0x50')](handleError(_0x16a638,null));};exports[_0x4c82('0x51')]=function(_0x1bbc86,_0x2dfe42){var _0x55570b={'raw':![],'where':{'id':_0x1bbc86['params']['id']},'include':[{'model':db[_0x4c82('0x36')],'as':_0x4c82('0x37')}]},_0x33f749={};_0x33f749[_0x4c82('0x3d')]=_['keys'](db[_0x4c82('0x39')][_0x4c82('0x52')]);_0x33f749[_0x4c82('0x3f')]=_[_0x4c82('0x40')](_0x1bbc86[_0x4c82('0x3f')]);_0x33f749['filters']=_[_0x4c82('0x42')](_0x33f749[_0x4c82('0x3d')],_0x33f749[_0x4c82('0x3f')]);_0x55570b[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x33f749['model'],qs[_0x4c82('0x44')](_0x1bbc86[_0x4c82('0x3f')][_0x4c82('0x44')]));_0x55570b['attributes']=_0x55570b['attributes']['length']?_0x55570b[_0x4c82('0x43')]:_0x33f749[_0x4c82('0x3d')];if(_0x1bbc86[_0x4c82('0x3f')]['includeAll']){_0x55570b[_0x4c82('0x4e')]=[{'all':!![]}];}_0x55570b=_[_0x4c82('0x4b')]({},_0x55570b,_0x1bbc86[_0x4c82('0x4d')]);return db['WhatsappAccount']['find'](_0x55570b)[_0x4c82('0x1f')](handleEntityNotFound(_0x2dfe42,null))[_0x4c82('0x1f')](respondWithResult(_0x2dfe42,null))[_0x4c82('0x50')](handleError(_0x2dfe42,null));};exports[_0x4c82('0x53')]=function(_0x5f1b4a,_0x4cb3a7){return db[_0x4c82('0x39')][_0x4c82('0x53')](_0x5f1b4a[_0x4c82('0x54')],{})[_0x4c82('0x1f')](function(_0x3866c4){var _0x5efb66=_0x5f1b4a[_0x4c82('0x55')][_0x4c82('0x33')]({'plain':!![]});if(!_0x5efb66)throw new Error(_0x4c82('0x56'));if(_0x5efb66[_0x4c82('0x57')]===_0x4c82('0x55')){var _0x9c72f=_0x3866c4[_0x4c82('0x33')]({'plain':!![]});var _0x38af52=_0x4c82('0x34');return db[_0x4c82('0x58')]['find']({'where':{'name':_0x38af52,'userProfileId':_0x5efb66['userProfileId']},'raw':!![]})['then'](function(_0x1b1676){if(_0x1b1676&&_0x1b1676[_0x4c82('0x59')]===0x0){return db[_0x4c82('0x5a')][_0x4c82('0x53')]({'name':_0x9c72f['name'],'resourceId':_0x9c72f['id'],'type':_0x1b1676[_0x4c82('0x3e')],'sectionId':_0x1b1676['id']},{})['then'](function(){return _0x3866c4;});}else{return _0x3866c4;}})[_0x4c82('0x50')](function(_0x4f0f45){logger[_0x4c82('0x24')](_0x4c82('0x5b'),_0x4f0f45);throw _0x4f0f45;});}return _0x3866c4;})['then'](respondWithResult(_0x4cb3a7,0xc9))['catch'](handleError(_0x4cb3a7,null));};exports[_0x4c82('0x5c')]=function(_0x1e83fb,_0x115270){if(_0x1e83fb[_0x4c82('0x54')]['id']){delete _0x1e83fb[_0x4c82('0x54')]['id'];}return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x1e83fb[_0x4c82('0x5e')]['id']},'include':[{'model':db[_0x4c82('0x36')],'as':_0x4c82('0x37')}]})[_0x4c82('0x1f')](handleEntityNotFound(_0x115270,null))[_0x4c82('0x1f')](saveUpdates(_0x1e83fb['body'],null))[_0x4c82('0x1f')](respondWithResult(_0x115270,null))[_0x4c82('0x50')](handleError(_0x115270,null));};exports[_0x4c82('0x32')]=function(_0x432628,_0x5b82e8){return db[_0x4c82('0x39')]['find']({'where':{'id':_0x432628[_0x4c82('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5b82e8,null))[_0x4c82('0x1f')](removeEntity(_0x5b82e8,null))[_0x4c82('0x50')](handleError(_0x5b82e8,null));};exports[_0x4c82('0x5f')]=function(_0x4ac5e4,_0x18b6b8){return db['WhatsappAccount'][_0x4c82('0x5f')]()[_0x4c82('0x1f')](respondWithResult(_0x18b6b8,null))[_0x4c82('0x50')](handleError(_0x18b6b8,null));};exports[_0x4c82('0x60')]=function(_0x432d60,_0x330cbf,_0x4542ae){if(_0x432d60[_0x4c82('0x54')]['id']){delete _0x432d60[_0x4c82('0x54')]['id'];}return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x432d60[_0x4c82('0x5e')]['id']}})['then'](handleEntityNotFound(_0x330cbf,null))[_0x4c82('0x1f')](function(_0x48e80f){if(_0x48e80f){_0x432d60['body']['WhatsappAccountId']=_0x48e80f['id'];return db[_0x4c82('0x61')][_0x4c82('0x53')](_0x432d60[_0x4c82('0x54')]);}})['then'](respondWithResult(_0x330cbf,null))['catch'](handleError(_0x330cbf,null));};exports[_0x4c82('0x62')]=function(_0x194220,_0x1dc918,_0x195022){var _0xa07a77={'raw':![],'where':{}};var _0x16e70a={};var _0x17814c={'count':0x0,'rows':[]};return db[_0x4c82('0x39')][_0x4c82('0x63')]({'where':{'id':_0x194220[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x1dc918,null))[_0x4c82('0x1f')](function(_0x3957a2){if(_0x3957a2){_0x16e70a['model']=_['keys'](db[_0x4c82('0x61')]['rawAttributes']);_0x16e70a['query']=_[_0x4c82('0x40')](_0x194220[_0x4c82('0x3f')]);_0x16e70a[_0x4c82('0x41')]=_[_0x4c82('0x42')](_0x16e70a[_0x4c82('0x3d')],_0x16e70a[_0x4c82('0x3f')]);_0xa07a77[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x16e70a[_0x4c82('0x3d')],qs[_0x4c82('0x44')](_0x194220[_0x4c82('0x3f')][_0x4c82('0x44')]));_0xa07a77[_0x4c82('0x43')]=_0xa07a77[_0x4c82('0x43')][_0x4c82('0x64')]?_0xa07a77['attributes']:_0x16e70a[_0x4c82('0x3d')];if(!_0x194220[_0x4c82('0x3f')][_0x4c82('0x65')](_0x4c82('0x45'))){_0xa07a77[_0x4c82('0x2c')]=qs[_0x4c82('0x2c')](_0x194220[_0x4c82('0x3f')][_0x4c82('0x2c')]);_0xa07a77[_0x4c82('0x2a')]=qs[_0x4c82('0x2a')](_0x194220[_0x4c82('0x3f')][_0x4c82('0x2a')]);}_0xa07a77[_0x4c82('0x46')]=qs[_0x4c82('0x47')](_0x194220['query']['sort']);_0xa07a77[_0x4c82('0x4a')]=qs[_0x4c82('0x41')](_[_0x4c82('0x48')](_0x194220[_0x4c82('0x3f')],_0x16e70a['filters']));_0xa07a77[_0x4c82('0x4a')][_0x4c82('0x66')]=_0x3957a2['id'];if(_0x194220[_0x4c82('0x3f')][_0x4c82('0x49')]){_0xa07a77[_0x4c82('0x4a')]=_[_0x4c82('0x4b')](_0xa07a77['where'],{'$or':_['map'](_0xa07a77['attributes'],function(_0x1de32f){var _0x57dcb7={};_0x57dcb7[_0x1de32f]={'$like':'%'+_0x194220[_0x4c82('0x3f')]['filter']+'%'};return _0x57dcb7;})});}_0xa07a77=_[_0x4c82('0x4b')]({},_0xa07a77,_0x194220['options']);return db[_0x4c82('0x61')]['count']({'where':_0xa07a77[_0x4c82('0x4a')]})[_0x4c82('0x1f')](function(_0x40aa82){_0x17814c[_0x4c82('0x2d')]=_0x40aa82;if(_0x194220['query'][_0x4c82('0x67')]){_0xa07a77['include']=[{'all':!![]}];}return db[_0x4c82('0x61')][_0x4c82('0x68')](_0xa07a77);})[_0x4c82('0x1f')](function(_0x22aa0c){_0x17814c[_0x4c82('0x4f')]=_0x22aa0c;return _0x17814c;});}})[_0x4c82('0x1f')](respondWithFilteredResult(_0x1dc918,_0xa07a77))['catch'](handleError(_0x1dc918,null));};exports['removeDispositions']=function(_0x2c12c4,_0x1a49a5,_0x54d83c){return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x2c12c4[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x1a49a5,null))[_0x4c82('0x1f')](function(_0x54a5f4){if(_0x54a5f4){return _0x54a5f4[_0x4c82('0x69')](_0x2c12c4['query'][_0x4c82('0x6a')]);}})[_0x4c82('0x1f')](respondWithStatusCode(_0x1a49a5,null))['catch'](handleError(_0x1a49a5,null));};exports[_0x4c82('0x6b')]=function(_0x49649b,_0x25c1b1,_0x3e90a0){if(_0x49649b[_0x4c82('0x54')]['id']){delete _0x49649b['body']['id'];}return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x49649b[_0x4c82('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25c1b1,null))[_0x4c82('0x1f')](function(_0x3f694d){if(_0x3f694d){_0x49649b[_0x4c82('0x54')][_0x4c82('0x66')]=_0x3f694d['id'];return db[_0x4c82('0x6c')][_0x4c82('0x53')](_0x49649b[_0x4c82('0x54')]);}})[_0x4c82('0x1f')](respondWithResult(_0x25c1b1,null))[_0x4c82('0x50')](handleError(_0x25c1b1,null));};exports['getAnswers']=function(_0x71c580,_0x20d2c8,_0x5dfdd6){var _0x52bc80={'raw':![],'where':{}};var _0x437932={};var _0x3da7ca={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4c82('0x63')]({'where':{'id':_0x71c580[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x20d2c8,null))['then'](function(_0x3a3064){if(_0x3a3064){_0x437932[_0x4c82('0x3d')]=_[_0x4c82('0x40')](db[_0x4c82('0x6c')]['rawAttributes']);_0x437932['query']=_[_0x4c82('0x40')](_0x71c580[_0x4c82('0x3f')]);_0x437932[_0x4c82('0x41')]=_[_0x4c82('0x42')](_0x437932['model'],_0x437932[_0x4c82('0x3f')]);_0x52bc80[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x437932[_0x4c82('0x3d')],qs[_0x4c82('0x44')](_0x71c580['query'][_0x4c82('0x44')]));_0x52bc80[_0x4c82('0x43')]=_0x52bc80[_0x4c82('0x43')][_0x4c82('0x64')]?_0x52bc80['attributes']:_0x437932['model'];if(!_0x71c580['query'][_0x4c82('0x65')](_0x4c82('0x45'))){_0x52bc80['limit']=qs[_0x4c82('0x2c')](_0x71c580[_0x4c82('0x3f')][_0x4c82('0x2c')]);_0x52bc80[_0x4c82('0x2a')]=qs[_0x4c82('0x2a')](_0x71c580[_0x4c82('0x3f')][_0x4c82('0x2a')]);}_0x52bc80['order']=qs[_0x4c82('0x47')](_0x71c580[_0x4c82('0x3f')][_0x4c82('0x47')]);_0x52bc80['where']=qs[_0x4c82('0x41')](_[_0x4c82('0x48')](_0x71c580[_0x4c82('0x3f')],_0x437932['filters']));_0x52bc80[_0x4c82('0x4a')][_0x4c82('0x66')]=_0x3a3064['id'];if(_0x71c580[_0x4c82('0x3f')]['filter']){_0x52bc80[_0x4c82('0x4a')]=_['merge'](_0x52bc80[_0x4c82('0x4a')],{'$or':_[_0x4c82('0x38')](_0x52bc80['attributes'],function(_0x5f15a4){var _0x423c5c={};_0x423c5c[_0x5f15a4]={'$like':'%'+_0x71c580[_0x4c82('0x3f')][_0x4c82('0x49')]+'%'};return _0x423c5c;})});}_0x52bc80=_[_0x4c82('0x4b')]({},_0x52bc80,_0x71c580['options']);return db[_0x4c82('0x6c')][_0x4c82('0x2d')]({'where':_0x52bc80[_0x4c82('0x4a')]})[_0x4c82('0x1f')](function(_0x597a0a){_0x3da7ca[_0x4c82('0x2d')]=_0x597a0a;if(_0x71c580[_0x4c82('0x3f')][_0x4c82('0x67')]){_0x52bc80['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x52bc80);})[_0x4c82('0x1f')](function(_0x35be2b){_0x3da7ca['rows']=_0x35be2b;return _0x3da7ca;});}})['then'](respondWithFilteredResult(_0x20d2c8,_0x52bc80))[_0x4c82('0x50')](handleError(_0x20d2c8,null));};exports[_0x4c82('0x6d')]=function(_0x1532c2,_0x5d625d,_0x435302){return db['WhatsappAccount']['find']({'where':{'id':_0x1532c2[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x5d625d,null))['then'](function(_0xbb1674){if(_0xbb1674){return _0xbb1674[_0x4c82('0x6d')](_0x1532c2[_0x4c82('0x3f')]['ids']);}})[_0x4c82('0x1f')](respondWithStatusCode(_0x5d625d,null))[_0x4c82('0x50')](handleError(_0x5d625d,null));};exports[_0x4c82('0x6e')]=function(_0x5b1e3f,_0x2e876c,_0x12dba4){return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x5b1e3f['params']['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x2e876c,null))[_0x4c82('0x1f')](function(_0x5f7b51){if(_0x5f7b51){return _0x5f7b51[_0x4c82('0x6e')](_0x5b1e3f[_0x4c82('0x54')]['ids'],_[_0x4c82('0x6f')](_0x5b1e3f[_0x4c82('0x54')],['ids','id'])||{})[_0x4c82('0x70')](function(_0x4dd261){for(var _0x16aa8a=0x0;_0x16aa8a<_0x5b1e3f[_0x4c82('0x54')][_0x4c82('0x6a')][_0x4c82('0x64')];_0x16aa8a+=0x1){socket[_0x4c82('0x71')](_0x4c82('0x72'),{'UserId':Number(_0x5b1e3f[_0x4c82('0x54')][_0x4c82('0x6a')][_0x16aa8a]),'WhatsappAccountId':Number(_0x5b1e3f[_0x4c82('0x5e')]['id'])});}return _0x4dd261;});}})[_0x4c82('0x1f')](respondWithResult(_0x2e876c,null))['catch'](handleError(_0x2e876c,null));};exports[_0x4c82('0x73')]=function(_0x1bacd0,_0x77b56e,_0x57a133){return db['WhatsappAccount'][_0x4c82('0x5d')]({'where':{'id':_0x1bacd0[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0x77b56e,null))['then'](function(_0x128716){if(_0x128716){return _0x128716['removeAgents'](_0x1bacd0[_0x4c82('0x3f')][_0x4c82('0x6a')])[_0x4c82('0x1f')](function(){if(_[_0x4c82('0x74')](_0x1bacd0[_0x4c82('0x3f')][_0x4c82('0x6a')])){for(var _0x415b04=0x0;_0x415b04<_0x1bacd0[_0x4c82('0x3f')][_0x4c82('0x6a')][_0x4c82('0x64')];_0x415b04+=0x1){socket[_0x4c82('0x71')](_0x4c82('0x75'),{'UserId':Number(_0x1bacd0[_0x4c82('0x3f')][_0x4c82('0x6a')][_0x415b04]),'WhatsappAccountId':Number(_0x1bacd0['params']['id'])});}}else{socket[_0x4c82('0x71')](_0x4c82('0x75'),{'UserId':Number(_0x1bacd0[_0x4c82('0x3f')][_0x4c82('0x6a')]),'WhatsappAccountId':Number(_0x1bacd0['params']['id'])});}});}})[_0x4c82('0x1f')](respondWithStatusCode(_0x77b56e,null))[_0x4c82('0x50')](handleError(_0x77b56e,null));};exports[_0x4c82('0x76')]=function(_0x29113e,_0xc785b5,_0x34a628){var _0x128ca0={};var _0x4c1850={};var _0x135c35;var _0x33dece;return db[_0x4c82('0x39')][_0x4c82('0x63')]({'where':{'id':_0x29113e[_0x4c82('0x5e')]['id']}})['then'](handleEntityNotFound(_0xc785b5,null))[_0x4c82('0x1f')](function(_0x354c2c){if(_0x354c2c){_0x135c35=_0x354c2c;_0x4c1850[_0x4c82('0x3d')]=_['keys'](db[_0x4c82('0x77')][_0x4c82('0x52')]);_0x4c1850['query']=_[_0x4c82('0x40')](_0x29113e[_0x4c82('0x3f')]);_0x4c1850[_0x4c82('0x41')]=_[_0x4c82('0x42')](_0x4c1850['model'],_0x4c1850[_0x4c82('0x3f')]);_0x128ca0[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x4c1850[_0x4c82('0x3d')],qs[_0x4c82('0x44')](_0x29113e[_0x4c82('0x3f')][_0x4c82('0x44')]));_0x128ca0['attributes']=_0x128ca0[_0x4c82('0x43')][_0x4c82('0x64')]?_0x128ca0[_0x4c82('0x43')]:_0x4c1850[_0x4c82('0x3d')];_0x128ca0[_0x4c82('0x46')]=qs[_0x4c82('0x47')](_0x29113e[_0x4c82('0x3f')][_0x4c82('0x47')]);_0x128ca0['where']=qs[_0x4c82('0x41')](_[_0x4c82('0x48')](_0x29113e[_0x4c82('0x3f')],_0x4c1850[_0x4c82('0x41')]));if(_0x29113e['query']['filter']){_0x128ca0[_0x4c82('0x4a')]=_['merge'](_0x128ca0['where'],{'$or':_[_0x4c82('0x38')](_0x128ca0[_0x4c82('0x43')],function(_0x2217f7){var _0x27865e={};_0x27865e[_0x2217f7]={'$like':'%'+_0x29113e['query'][_0x4c82('0x49')]+'%'};return _0x27865e;})});}_0x128ca0=_[_0x4c82('0x4b')]({},_0x128ca0,_0x29113e['options']);return _0x135c35[_0x4c82('0x76')](_0x128ca0);}})['then'](function(_0x4cd606){if(_0x4cd606){_0x33dece=_0x4cd606['length'];if(!_0x29113e['query'][_0x4c82('0x65')](_0x4c82('0x45'))){_0x128ca0['limit']=qs[_0x4c82('0x2c')](_0x29113e[_0x4c82('0x3f')][_0x4c82('0x2c')]);_0x128ca0['offset']=qs[_0x4c82('0x2a')](_0x29113e[_0x4c82('0x3f')][_0x4c82('0x2a')]);}return _0x135c35[_0x4c82('0x76')](_0x128ca0);}})[_0x4c82('0x1f')](function(_0x5e5395){if(_0x5e5395){return _0x5e5395?{'count':_0x33dece,'rows':_0x5e5395}:null;}})['then'](respondWithResult(_0xc785b5,null))['catch'](handleError(_0xc785b5,null));};exports[_0x4c82('0x78')]=function(_0x2353f0,_0x1516a5){var _0x2facf8=_0x2353f0[_0x4c82('0x5e')]['id'];var _0x413d58=_0x2353f0[_0x4c82('0x54')];var _0x421e27=0xc8;var _0x2a9deb=null;return db[_0x4c82('0x79')]['transaction']({'isolationLevel':db[_0x4c82('0x79')][_0x4c82('0x7a')][_0x4c82('0x7b')]['READ_COMMITTED']},function(_0x2eb5c0){return db[_0x4c82('0x39')][_0x4c82('0x63')]({'where':{'id':_0x2facf8},'transaction':_0x2eb5c0})[_0x4c82('0x1f')](function(_0x28c7fc){if(_0x28c7fc){return db[_0x4c82('0x7c')][_0x4c82('0x32')]({'where':{'WhatsappAccountId':_0x2facf8},'transaction':_0x2eb5c0})[_0x4c82('0x1f')](function(){var _0x13b6c8=_['map'](_0x413d58,function(_0x5d2603){_0x5d2603[_0x4c82('0x66')]=_0x2facf8;return _0x5d2603;});return db[_0x4c82('0x7c')][_0x4c82('0x7d')](_0x13b6c8,{'transaction':_0x2eb5c0});});}else{_0x421e27=0x194;_0x2a9deb=[];}});})[_0x4c82('0x1f')](function(){if(_0x421e27!==0x194){return db[_0x4c82('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2facf8},'order':_0x4c82('0x7e')})[_0x4c82('0x1f')](function(_0x5331e5){_0x2a9deb=_0x5331e5;});}})[_0x4c82('0x50')](function(_0x1ebb3b){_0x421e27=0x1f4;logger['error'](_0x1ebb3b[_0x4c82('0x7f')]);if(_0x1ebb3b[_0x4c82('0x3e')]){delete _0x1ebb3b['name'];}_0x2a9deb=_0x1ebb3b;})[_0x4c82('0x80')](function(){if(_0x2a9deb===null){_0x1516a5[_0x4c82('0x27')](_0x421e27);}else{if(_0x421e27===0x1f4){_0x1516a5[_0x4c82('0x29')](_0x421e27)[_0x4c82('0x35')](_0x2a9deb);}else{_0x1516a5[_0x4c82('0x29')](_0x421e27)[_0x4c82('0x81')](_0x2a9deb);}}});};exports[_0x4c82('0x82')]=function(_0x40f829,_0xb43aeb,_0x4ceb36){var _0x4bb003={};var _0x58030a={};var _0x1753bd;var _0x302a02;return db[_0x4c82('0x39')][_0x4c82('0x63')]({'where':{'id':_0x40f829[_0x4c82('0x5e')]['id']}})[_0x4c82('0x1f')](handleEntityNotFound(_0xb43aeb,null))['then'](function(_0x16fe35){if(_0x16fe35){_0x1753bd=_0x16fe35;_0x58030a[_0x4c82('0x3d')]=_[_0x4c82('0x40')](db[_0x4c82('0x7c')]['rawAttributes']);_0x58030a['query']=_[_0x4c82('0x40')](_0x40f829[_0x4c82('0x3f')]);_0x58030a[_0x4c82('0x41')]=_['intersection'](_0x58030a[_0x4c82('0x3d')],_0x58030a[_0x4c82('0x3f')]);_0x4bb003[_0x4c82('0x43')]=_[_0x4c82('0x42')](_0x58030a[_0x4c82('0x3d')],qs['fields'](_0x40f829['query'][_0x4c82('0x44')]));_0x4bb003[_0x4c82('0x43')]=_0x4bb003[_0x4c82('0x43')][_0x4c82('0x64')]?_0x4bb003[_0x4c82('0x43')]:_0x58030a[_0x4c82('0x3d')];_0x4bb003['order']=qs[_0x4c82('0x47')](_0x40f829['query'][_0x4c82('0x47')]);_0x4bb003['where']=qs[_0x4c82('0x41')](_[_0x4c82('0x48')](_0x40f829[_0x4c82('0x3f')],_0x58030a[_0x4c82('0x41')]));if(_0x40f829[_0x4c82('0x3f')][_0x4c82('0x49')]){_0x4bb003['where']=_[_0x4c82('0x4b')](_0x4bb003[_0x4c82('0x4a')],{'$or':_[_0x4c82('0x38')](_0x4bb003['attributes'],function(_0x377758){var _0x381327={};_0x381327[_0x377758]={'$like':'%'+_0x40f829[_0x4c82('0x3f')][_0x4c82('0x49')]+'%'};return _0x381327;})});}_0x4bb003=_[_0x4c82('0x4b')]({},_0x4bb003,_0x40f829[_0x4c82('0x4d')]);return _0x1753bd[_0x4c82('0x82')](_0x4bb003);}})[_0x4c82('0x1f')](function(_0x1f034a){if(_0x1f034a){_0x302a02=_0x1f034a[_0x4c82('0x64')];if(!_0x40f829[_0x4c82('0x3f')][_0x4c82('0x65')](_0x4c82('0x45'))){_0x4bb003[_0x4c82('0x2c')]=qs[_0x4c82('0x2c')](_0x40f829[_0x4c82('0x3f')][_0x4c82('0x2c')]);_0x4bb003[_0x4c82('0x2a')]=qs['offset'](_0x40f829['query']['offset']);}return _0x1753bd[_0x4c82('0x82')](_0x4bb003);}})[_0x4c82('0x1f')](function(_0x569aef){if(_0x569aef){return _0x569aef?{'count':_0x302a02,'rows':_0x569aef}:null;}})['then'](respondWithResult(_0xb43aeb,null))[_0x4c82('0x50')](handleError(_0xb43aeb,null));};exports['notify']=function(_0x275667,_0x5bbab8,_0x58f710){var _0x3a1ddd={'channel':_0x4c82('0x83')};var _0x3edbcc=[];var _0x24baba=[];var _0x4be785={};return db[_0x4c82('0x39')]['find']({'where':{'id':_0x275667[_0x4c82('0x5e')]['id']},'include':[{'model':db[_0x4c82('0x7c')],'as':_0x4c82('0x84')}]})['then'](handleEntityNotFound(_0x5bbab8,null))[_0x4c82('0x1f')](function(_0x66e438){_0x3a1ddd[_0x4c82('0x85')]=_0x66e438;if(_0x3a1ddd[_0x4c82('0x85')]&&_0x3a1ddd[_0x4c82('0x85')][_0x4c82('0x3b')]===_0x4c82('0x86')&&_0x275667['body'][_0x4c82('0x87')]){if(_0x275667[_0x4c82('0x54')][_0x4c82('0x87')][_0x4c82('0x64')]===0x0)return;if(_0x275667[_0x4c82('0x54')][_0x4c82('0x87')][0x0]['state']!==_0x4c82('0x88'))return;return db['WhatsappMessage'][_0x4c82('0x5c')]({'read':!![],'readAt':_0x275667[_0x4c82('0x54')][_0x4c82('0x87')][0x0][_0x4c82('0x89')]},{'where':{'messageId':_0x275667['body'][_0x4c82('0x87')][0x0][_0x4c82('0x8a')]},'individualHooks':!![]})[_0x4c82('0x1f')](function(_0x219979){return _0x5bbab8['status'](0xc8)[_0x4c82('0x81')](_0x219979);});}_0x3a1ddd[_0x4c82('0x8b')]=_['orderBy'](_0x66e438['Applications'],[_0x4c82('0x7e')],[_0x4c82('0x8c')]);if(_0x3a1ddd['account'][_0x4c82('0x84')]){delete _0x3a1ddd[_0x4c82('0x85')][_0x4c82('0x84')];}return db[_0x4c82('0x8d')][_0x4c82('0x5f')]()[_0x4c82('0x1f')](function(_0x567579){if(!_0x567579){throw new db[(_0x4c82('0x8e'))][(_0x4c82('0x8f'))](_0x4c82('0x90'));}_0x3edbcc=_['difference'](_[_0x4c82('0x40')](_0x567579),[_0x4c82('0x91'),'updatedAt']);_0x24baba=_[_0x4c82('0x92')](_[_0x4c82('0x40')](_0x567579),['createdAt','updatedAt','CompanyId','ListId']);_0x3a1ddd[_0x4c82('0x54')]={'mapKey':'mobile'};if(_0x3a1ddd[_0x4c82('0x85')]&&_0x3a1ddd[_0x4c82('0x85')]['type']===_0x4c82('0x93')){_0x3a1ddd['body'][_0x4c82('0x94')]=_0x275667[_0x4c82('0x54')][_0x4c82('0x95')]['replace'](_0x4c82('0x96'),'');_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x54')]=_0x275667['body'][_0x4c82('0x97')];_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x98')]=_0x275667[_0x4c82('0x54')][_0x4c82('0x99')];}if(_0x3a1ddd['account']&&_0x3a1ddd['account'][_0x4c82('0x3b')]===_0x4c82('0x86')){_0x3a1ddd['body'][_0x4c82('0x94')]=_0x275667[_0x4c82('0x54')][_0x4c82('0x9a')][0x0][_0x4c82('0x94')];_0x3a1ddd['body'][_0x4c82('0x54')]=_0x275667[_0x4c82('0x54')][_0x4c82('0x9a')][0x0][_0x4c82('0x25')][_0x4c82('0x54')];_0x3a1ddd[_0x4c82('0x54')]['messageId']=_0x275667['body'][_0x4c82('0x9a')][0x0][_0x4c82('0x8a')];}if(_0x3a1ddd[_0x4c82('0x54')]['id']){delete _0x3a1ddd['body']['id'];}if(_[_0x4c82('0x9b')](_0x3a1ddd['body'][_0x4c82('0x94')])){throw new db[(_0x4c82('0x8e'))][(_0x4c82('0x8f'))](_0x4c82('0x9c'));}if(_[_0x4c82('0x9b')](_0x3a1ddd['body']['body'])||_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x54')]===''){throw new db['Sequelize'][(_0x4c82('0x8f'))](_0x4c82('0x9d'));}if(_[_0x4c82('0x9b')](_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x9e')])){throw new db[(_0x4c82('0x8e'))][(_0x4c82('0x8f'))](_0x4c82('0x9f')+_0x24baba);}if(!_[_0x4c82('0xa0')](_0x24baba,_0x3a1ddd['body']['mapKey'])){throw new db[(_0x4c82('0x8e'))][(_0x4c82('0x8f'))](_0x4c82('0xa1')+_0x24baba);}_0x4be785[_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x9e')]]=_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x94')];return db['CmList'][_0x4c82('0x5d')]({'where':{'id':_0x3a1ddd[_0x4c82('0x85')][_0x4c82('0xa2')]},'include':[{'model':db[_0x4c82('0x8d')],'as':_0x4c82('0xa3'),'where':_0x4be785,'limit':0x1,'order':[[_0x4c82('0xa4'),_0x4c82('0xa5')]]}]});})[_0x4c82('0x1f')](handleEntityNotFound(_0x5bbab8,null))['then'](function(_0xc17b58){if(_0xc17b58){_0x3a1ddd[_0x4c82('0xa6')]=_[_0x4c82('0x6f')](_0xc17b58,[_0x4c82('0xa3')]);if(_0xc17b58[_0x4c82('0xa3')][_0x4c82('0x64')]){return _0xc17b58[_0x4c82('0xa3')][0x0];}var _0x1d85b4=_['defaults'](_0x3a1ddd[_0x4c82('0x54')],{'firstName':_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x94')],'ListId':_0xc17b58['id']});_0x1d85b4[_0x3a1ddd['body'][_0x4c82('0x9e')]]=_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x94')];return db[_0x4c82('0x8d')][_0x4c82('0x53')](_0x1d85b4,{'fields':_0x3edbcc,'raw':!![]});}})[_0x4c82('0x1f')](handleEntityNotFound(_0x5bbab8,null))[_0x4c82('0x1f')](function(_0x1de05f){if(_0x1de05f){_0x3a1ddd[_0x4c82('0xa7')]=_0x1de05f;var _0x30717b={'ContactId':_0x1de05f['id'],'phone':_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x94')],'WhatsappAccountId':_0x275667[_0x4c82('0x5e')]['id']};var _0x2e229e={'ContactId':_0x1de05f['id'],'WhatsappAccountId':_0x275667[_0x4c82('0x5e')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x4c82('0x5d')]({'where':_0x2e229e})['then'](function(_0x494a5f){if(_0x494a5f){return[_0x494a5f,![]];}return db['WhatsappInteraction'][_0x4c82('0x53')](_0x30717b)[_0x4c82('0x1f')](function(_0x2d155c){return[_0x2d155c,!![]];});});}})['spread'](function(_0x50a99a,_0x1e749d){_0x3a1ddd[_0x4c82('0xa8')]=_0x50a99a['get']({'plain':!![]});_0x3a1ddd[_0x4c82('0xa8')][_0x4c82('0xa9')]=![];if(_0x1e749d){if(_0x3a1ddd[_0x4c82('0x85')]['autoclose']){_0x3a1ddd[_0x4c82('0x8b')]['push']({'id':0x0,'priority':_0x3a1ddd[_0x4c82('0x8b')][_0x4c82('0x64')]+0x1,'app':_0x4c82('0xaa'),'appdata':_0x4c82('0xab'),'interval':_0x4c82('0xac')});}_0x3a1ddd[_0x4c82('0xa8')][_0x4c82('0xa9')]=!![];}return db[_0x4c82('0xad')][_0x4c82('0x53')]({'phone':_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x94')],'messageId':_0x3a1ddd[_0x4c82('0x54')]['messageId'],'body':_0x3a1ddd[_0x4c82('0x54')][_0x4c82('0x54')],'WhatsappAccountId':_0x275667[_0x4c82('0x5e')]['id'],'WhatsappInteractionId':_0x50a99a['id'],'direction':'in','ContactId':_0x50a99a['ContactId'],'AttachmentId':_0x3a1ddd[_0x4c82('0x54')]['AttachmentId']});})['then'](function(_0x3d171c){_0x3a1ddd[_0x4c82('0x25')]=_0x3d171c;if(_0x3a1ddd['interaction'][_0x4c82('0xae')]){return db[_0x4c82('0x77')][_0x4c82('0x5d')]({'attributes':['id','name'],'where':{'id':_0x3a1ddd[_0x4c82('0xa8')][_0x4c82('0xae')]}})['then'](function(_0x2e2754){if(_0x2e2754){_0x3a1ddd[_0x4c82('0x8b')][_0x4c82('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e2754[_0x4c82('0x3e')]+','+(_0x3a1ddd[_0x4c82('0x85')][_0x4c82('0xb0')]||0xa),'interval':_0x4c82('0xac')});}return respondWithRpcPromise(_0x4c82('0xb1'),_0x4c82('0xb2'),_0x3a1ddd);});}return respondWithRpcPromise(_0x4c82('0xb1'),_0x4c82('0xb2'),_0x3a1ddd);})['then'](function(_0x45118e){if(_0x45118e){var _0x1e468a=0xc8;var _0x390f46=_0x4c82('0xb3');logger[_0x4c82('0x20')](_0x4c82('0xb4'),_0x390f46,_0x1e468a,_0x4c82('0xb5'));logger[_0x4c82('0xb6')](_0x4c82('0xb7'),_0x390f46,_0x1e468a,_0x4c82('0xb5'),JSON[_0x4c82('0x23')](_0x45118e));if(_0x3a1ddd[_0x4c82('0x85')][_0x4c82('0x3b')]===_0x4c82('0x93')){return _0x5bbab8[_0x4c82('0x29')](_0x1e468a)[_0x4c82('0x2e')](_0x4c82('0xb8'),'text/xml')['send'](_0x4c82('0xb9'));}else{return _0x5bbab8[_0x4c82('0x29')](_0x1e468a)[_0x4c82('0x81')](_0x45118e);}}});})['catch'](handleError(_0x5bbab8,null));};exports['send']=function(_0x229703,_0x387ed9,_0xa327ae){var _0x3ac920,_0x54bec3,_0x9e7940;if(_['isNil'](_0x229703[_0x4c82('0x54')][_0x4c82('0x54')])||_0x229703[_0x4c82('0x54')][_0x4c82('0x54')]===''){throw new db[(_0x4c82('0x8e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4c82('0x9b')](_0x229703[_0x4c82('0x54')]['to'])){throw new db[(_0x4c82('0x8e'))]['ValidationError'](_0x4c82('0xba'));}_0x3ac920=_0x229703[_0x4c82('0x54')]['to'];return db[_0x4c82('0x39')][_0x4c82('0x5d')]({'where':{'id':_0x229703[_0x4c82('0x5e')]['id']},'include':[{'model':db[_0x4c82('0xbb')],'as':_0x4c82('0xbc'),'include':[{'model':db[_0x4c82('0x8d')],'as':_0x4c82('0xa3'),'where':{'mobile':_0x3ac920},'limit':0x1,'order':[[_0x4c82('0xa4'),_0x4c82('0xa5')]]}]}]})[_0x4c82('0x1f')](handleEntityNotFound(_0x387ed9,null))[_0x4c82('0x1f')](function(_0x117dfd){if(_0x117dfd&&_0x117dfd[_0x4c82('0xbc')]){_0x54bec3=_0x117dfd['get']({'plain':!![]});if(_0x54bec3[_0x4c82('0xbc')]&&_0x54bec3[_0x4c82('0xbc')][_0x4c82('0xa3')][_0x4c82('0x64')]){return _0x54bec3[_0x4c82('0xbc')][_0x4c82('0xa3')][0x0];}return db[_0x4c82('0x8d')]['create'](_[_0x4c82('0x19')](_0x229703[_0x4c82('0x54')],{'firstName':_0x3ac920,'mobile':_0x3ac920,'phone':_0x3ac920,'ListId':_0x54bec3[_0x4c82('0xa2')]}));}})[_0x4c82('0x1f')](handleEntityNotFound(_0x387ed9,null))[_0x4c82('0x1f')](function(_0x27584d){if(_0x27584d){_0x9e7940=_0x27584d;return db[_0x4c82('0xbd')][_0x4c82('0x5d')]({'where':{'ContactId':_0x9e7940['id'],'closed':![],'WhatsappAccountId':_0x54bec3['id']}})[_0x4c82('0x1f')](function(_0x2a207a){if(_0x2a207a){return[_0x2a207a,![]];}return db[_0x4c82('0xbd')][_0x4c82('0x53')]({'UserId':_0x229703[_0x4c82('0x55')]['id'],'ContactId':_0x9e7940['id'],'WhatsappAccountId':_0x54bec3['id'],'phone':_0x3ac920,'firstMsgDirection':_0x4c82('0xbe'),'Messages':[_[_0x4c82('0x4b')](_0x229703['body'],{'read':![],'body':_0x229703[_0x4c82('0x54')]['body'],'phone':_0x3ac920,'WhatsappAccountId':_0x54bec3['id'],'UserId':_0x229703[_0x4c82('0x55')]['id'],'ContactId':_0x9e7940['id']})]},{'include':[{'model':db[_0x4c82('0xad')],'as':'Messages'}]})['then'](function(_0x3c04d6){return[_0x3c04d6,!![]];});});}})['spread'](function(_0xed8aba,_0x2a01d8){if(_0x2a01d8){return _0xed8aba;}return db[_0x4c82('0xad')][_0x4c82('0x53')](_[_0x4c82('0x4b')](_0x229703[_0x4c82('0x54')],{'read':![],'body':_0x229703[_0x4c82('0x54')][_0x4c82('0x54')],'phone':_0x3ac920,'WhatsappAccountId':_0x54bec3['id'],'WhatsappInteractionId':_0xed8aba['id'],'UserId':_0x229703[_0x4c82('0x55')]['id'],'ContactId':_0x9e7940['id']}))[_0x4c82('0x1f')](function(_0x4ec6c0){_0xed8aba[_0x4c82('0xbf')][_0x4c82('0xc0')]=[];_0xed8aba['dataValues']['Messages'][_0x4c82('0xc1')](_0x4ec6c0[_0x4c82('0xbf')]);return _0xed8aba;});})[_0x4c82('0x1f')](respondWithResult(_0x387ed9,null))['catch'](handleError(_0x387ed9,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 40a1469..2ccb14a 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 _0x067c=['events','../../mysqldb','WhatsappAccount','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x067c,0xf0));var _0xc067=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x067c[_0x4e9d3c];return _0x2d0825;};'use strict';var EventEmitter=require(_0xc067('0x0'));var WhatsappAccount=require(_0xc067('0x1'))['db'][_0xc067('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc067('0x3'),'afterUpdate':_0xc067('0x4'),'afterDestroy':_0xc067('0x5')};function emitEvent(_0x53af94){return function(_0x4f0423,_0x36b57a,_0x239776){WhatsappAccountEvents[_0xc067('0x6')](_0x53af94+':'+_0x4f0423['id'],_0x4f0423);WhatsappAccountEvents[_0xc067('0x6')](_0x53af94,_0x4f0423);_0x239776(null);};}for(var e in events){if(events[_0xc067('0x7')](e)){var event=events[e];WhatsappAccount[_0xc067('0x8')](e,emitEvent(event));}}module[_0xc067('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xb60f=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x30102c,_0x141835){var _0x7e95fa=function(_0x296f7e){while(--_0x296f7e){_0x30102c['push'](_0x30102c['shift']());}};_0x7e95fa(++_0x141835);}(_0xb60f,0x195));var _0xfb60=function(_0x1e4ff3,_0x13b714){_0x1e4ff3=_0x1e4ff3-0x0;var _0x137c9f=_0xb60f[_0x1e4ff3];return _0x137c9f;};'use strict';var EventEmitter=require(_0xfb60('0x0'));var WhatsappAccount=require(_0xfb60('0x1'))['db'][_0xfb60('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xfb60('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfb60('0x4')};function emitEvent(_0x5b705b){return function(_0x34dd03,_0x508ace,_0x402557){WhatsappAccountEvents[_0xfb60('0x5')](_0x5b705b+':'+_0x34dd03['id'],_0x34dd03);WhatsappAccountEvents['emit'](_0x5b705b,_0x34dd03);_0x402557(null);};}for(var e in events){if(events[_0xfb60('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xfb60('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index e7a5457..84c21d0 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 _0x42b9=['util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash'];(function(_0x1cc991,_0x11e263){var _0x33b45=function(_0x112884){while(--_0x112884){_0x1cc991['push'](_0x1cc991['shift']());}};_0x33b45(++_0x11e263);}(_0x42b9,0x1df));var _0x942b=function(_0x2c8266,_0x23f2df){_0x2c8266=_0x2c8266-0x0;var _0x4cb855=_0x42b9[_0x2c8266];return _0x4cb855;};'use strict';var _=require(_0x942b('0x0'));var util=require(_0x942b('0x1'));var logger=require(_0x942b('0x2'))(_0x942b('0x3'));var moment=require(_0x942b('0x4'));var BPromise=require(_0x942b('0x5'));var rp=require(_0x942b('0x6'));var fs=require('fs');var path=require(_0x942b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x942b('0x8'));module[_0x942b('0x9')]=function(_0x4f4a19,_0x2a9fd6){return _0x4f4a19[_0x942b('0xa')](_0x942b('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce88=['define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x142fe2,_0x2abf39){var _0x74ad62=function(_0x2e23aa){while(--_0x2e23aa){_0x142fe2['push'](_0x142fe2['shift']());}};_0x74ad62(++_0x2abf39);}(_0xce88,0xed));var _0x8ce8=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xce88[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x8ce8('0x0'));var util=require('util');var logger=require(_0x8ce8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8ce8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ce8('0x3'));var rimraf=require(_0x8ce8('0x4'));var config=require(_0x8ce8('0x5'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x2e90e5,_0x408d0a){return _0x2e90e5[_0x8ce8('0x6')](_0x8ce8('0x7'),attributes,{'tableName':_0x8ce8('0x8'),'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 3ecbb28..717e596 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 _0xa7a0=['client','localhost','redis','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','map','include','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xa7a0,0x181));var _0x0a7a=function(_0x497785,_0x50e08f){_0x497785=_0x497785-0x0;var _0x5da638=_0xa7a0[_0x497785];return _0x5da638;};'use strict';var _=require('lodash');var util=require(_0x0a7a('0x0'));var moment=require(_0x0a7a('0x1'));var BPromise=require(_0x0a7a('0x2'));var rs=require(_0x0a7a('0x3'));var fs=require('fs');var Redis=require(_0x0a7a('0x4'));var db=require(_0x0a7a('0x5'))['db'];var utils=require(_0x0a7a('0x6'));var logger=require(_0x0a7a('0x7'))(_0x0a7a('0x8'));var config=require(_0x0a7a('0x9'));var jayson=require(_0x0a7a('0xa'));var client=jayson[_0x0a7a('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x0a7a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a7a('0xd')]));require(_0x0a7a('0xe'))[_0x0a7a('0xf')](socket);function respondWithRpcPromise(_0x5deea5,_0x479a98,_0x5eb32f){return new BPromise(function(_0x236937,_0x459a72){return client[_0x0a7a('0x10')](_0x5deea5,_0x5eb32f)[_0x0a7a('0x11')](function(_0x3903a1){logger['info'](_0x0a7a('0x12'),_0x479a98,'request\x20sent');logger[_0x0a7a('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x479a98,_0x0a7a('0x14'),JSON[_0x0a7a('0x15')](_0x3903a1));if(_0x3903a1[_0x0a7a('0x16')]){if(_0x3903a1['error'][_0x0a7a('0x17')]===0x1f4){logger[_0x0a7a('0x16')](_0x0a7a('0x12'),_0x479a98,_0x3903a1['error'][_0x0a7a('0x18')]);return _0x459a72(_0x3903a1['error']['message']);}logger[_0x0a7a('0x16')](_0x0a7a('0x12'),_0x479a98,_0x3903a1[_0x0a7a('0x16')][_0x0a7a('0x18')]);return _0x236937(_0x3903a1[_0x0a7a('0x16')][_0x0a7a('0x18')]);}else{logger['info'](_0x0a7a('0x12'),_0x479a98,_0x0a7a('0x14'));_0x236937(_0x3903a1['result']['message']);}})[_0x0a7a('0x19')](function(_0x5859b9){logger['error'](_0x0a7a('0x12'),_0x479a98,_0x5859b9);_0x459a72(_0x5859b9);});});}exports[_0x0a7a('0x1a')]=function(_0x397252){var _0x11e718=this;return new Promise(function(_0x5391fb,_0x4375b1){return db[_0x0a7a('0x1b')][_0x0a7a('0x1c')]({'raw':_0x397252[_0x0a7a('0x1d')]?_0x397252['options'][_0x0a7a('0x1e')]===undefined?!![]:![]:!![],'where':_0x397252[_0x0a7a('0x1d')]?_0x397252['options']['where']||null:null,'attributes':_0x397252[_0x0a7a('0x1d')]?_0x397252['options'][_0x0a7a('0x1f')]||null:null,'include':_0x397252[_0x0a7a('0x1d')]?_0x397252[_0x0a7a('0x1d')]['include']?_[_0x0a7a('0x20')](_0x397252[_0x0a7a('0x1d')][_0x0a7a('0x21')],function(_0x5a85ff){return{'model':db[_0x5a85ff[_0x0a7a('0x22')]],'as':_0x5a85ff['as'],'attributes':_0x5a85ff['attributes'],'include':_0x5a85ff['include']?_[_0x0a7a('0x20')](_0x5a85ff['include'],function(_0x4094cc){return{'model':db[_0x4094cc[_0x0a7a('0x22')]],'as':_0x4094cc['as'],'attributes':_0x4094cc[_0x0a7a('0x1f')],'include':_0x4094cc[_0x0a7a('0x21')]?_[_0x0a7a('0x20')](_0x4094cc[_0x0a7a('0x21')],function(_0x564e95){return{'model':db[_0x564e95[_0x0a7a('0x22')]],'as':_0x564e95['as'],'attributes':_0x564e95[_0x0a7a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0a7a('0x11')](function(_0x586051){logger[_0x0a7a('0x23')](_0x0a7a('0x1a'),_0x397252);logger[_0x0a7a('0x13')](_0x0a7a('0x1a'),_0x397252,JSON[_0x0a7a('0x15')](_0x586051));_0x5391fb(_0x586051);})[_0x0a7a('0x19')](function(_0x293b84){logger[_0x0a7a('0x16')](_0x0a7a('0x1a'),_0x293b84[_0x0a7a('0x18')],_0x397252);_0x4375b1(_0x11e718[_0x0a7a('0x16')](0x1f4,_0x293b84[_0x0a7a('0x18')]));});});}; \ No newline at end of file +var _0x4962=['defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','options','where','include','attributes','model','map','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x3b432c,_0x5cea63){var _0x1af71f=function(_0x55196c){while(--_0x55196c){_0x3b432c['push'](_0x3b432c['shift']());}};_0x1af71f(++_0x5cea63);}(_0x4962,0x114));var _0x2496=function(_0x240700,_0x13e7d9){_0x240700=_0x240700-0x0;var _0x51530c=_0x4962[_0x240700];return _0x51530c;};'use strict';var _=require('lodash');var util=require(_0x2496('0x0'));var moment=require(_0x2496('0x1'));var BPromise=require(_0x2496('0x2'));var rs=require(_0x2496('0x3'));var fs=require('fs');var Redis=require(_0x2496('0x4'));var db=require(_0x2496('0x5'))['db'];var utils=require(_0x2496('0x6'));var logger=require(_0x2496('0x7'))('rpc');var config=require(_0x2496('0x8'));var jayson=require(_0x2496('0x9'));var client=jayson[_0x2496('0xa')]['http']({'port':0x232a});config[_0x2496('0xb')]=_[_0x2496('0xc')](config[_0x2496('0xb')],{'host':_0x2496('0xd'),'port':0x18eb});var socket=require(_0x2496('0xe'))(new Redis(config[_0x2496('0xb')]));require(_0x2496('0xf'))['register'](socket);function respondWithRpcPromise(_0x1632c7,_0x3ba214,_0x3338f5){return new BPromise(function(_0x50a4f1,_0x5a6162){return client['request'](_0x1632c7,_0x3338f5)['then'](function(_0x2924cf){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x3ba214,_0x2496('0x10'));logger['debug'](_0x2496('0x11'),_0x3ba214,_0x2496('0x10'),JSON[_0x2496('0x12')](_0x2924cf));if(_0x2924cf[_0x2496('0x13')]){if(_0x2924cf[_0x2496('0x13')][_0x2496('0x14')]===0x1f4){logger[_0x2496('0x13')](_0x2496('0x15'),_0x3ba214,_0x2924cf[_0x2496('0x13')][_0x2496('0x16')]);return _0x5a6162(_0x2924cf['error'][_0x2496('0x16')]);}logger['error'](_0x2496('0x15'),_0x3ba214,_0x2924cf[_0x2496('0x13')]['message']);return _0x50a4f1(_0x2924cf['error']['message']);}else{logger[_0x2496('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x3ba214,'request\x20sent');_0x50a4f1(_0x2924cf[_0x2496('0x18')][_0x2496('0x16')]);}})[_0x2496('0x19')](function(_0x3bb9cd){logger[_0x2496('0x13')](_0x2496('0x15'),_0x3ba214,_0x3bb9cd);_0x5a6162(_0x3bb9cd);});});}exports[_0x2496('0x1a')]=function(_0x1ae59c){var _0x3e847f=this;return new Promise(function(_0x1c4b52,_0x1264d6){return db[_0x2496('0x1b')]['find']({'raw':_0x1ae59c[_0x2496('0x1c')]?_0x1ae59c[_0x2496('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1ae59c[_0x2496('0x1c')]?_0x1ae59c[_0x2496('0x1c')][_0x2496('0x1d')]||null:null,'attributes':_0x1ae59c[_0x2496('0x1c')]?_0x1ae59c[_0x2496('0x1c')]['attributes']||null:null,'include':_0x1ae59c[_0x2496('0x1c')]?_0x1ae59c['options']['include']?_['map'](_0x1ae59c['options'][_0x2496('0x1e')],function(_0x2723cc){return{'model':db[_0x2723cc['model']],'as':_0x2723cc['as'],'attributes':_0x2723cc[_0x2496('0x1f')],'include':_0x2723cc[_0x2496('0x1e')]?_['map'](_0x2723cc[_0x2496('0x1e')],function(_0x57256d){return{'model':db[_0x57256d[_0x2496('0x20')]],'as':_0x57256d['as'],'attributes':_0x57256d[_0x2496('0x1f')],'include':_0x57256d[_0x2496('0x1e')]?_[_0x2496('0x21')](_0x57256d[_0x2496('0x1e')],function(_0x43b21a){return{'model':db[_0x43b21a['model']],'as':_0x43b21a['as'],'attributes':_0x43b21a[_0x2496('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2496('0x22')](function(_0x38707e){logger[_0x2496('0x17')](_0x2496('0x1a'),_0x1ae59c);logger[_0x2496('0x23')]('ShowWhatsappAccount',_0x1ae59c,JSON[_0x2496('0x12')](_0x38707e));_0x1c4b52(_0x38707e);})[_0x2496('0x19')](function(_0x520240){logger[_0x2496('0x13')](_0x2496('0x1a'),_0x520240[_0x2496('0x16')],_0x1ae59c);_0x1264d6(_0x3e847f[_0x2496('0x13')](0x1f4,_0x520240['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 21394ce..08365db 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 _0xcb48=['./whatsappAccount.events','save','remove','update','emit','register','length','whatsappAccount:'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xcb48,0xb8));var _0x8cb4=function(_0x51b94a,_0x43bc68){_0x51b94a=_0x51b94a-0x0;var _0x5f285c=_0xcb48[_0x51b94a];return _0x5f285c;};'use strict';var WhatsappAccountEvents=require(_0x8cb4('0x0'));var events=[_0x8cb4('0x1'),_0x8cb4('0x2'),_0x8cb4('0x3')];function createListener(_0x424129,_0x287d43){return function(_0x1f7c80){_0x287d43[_0x8cb4('0x4')](_0x424129,_0x1f7c80);};}function removeListener(_0x314df6,_0x5a1b51){return function(){WhatsappAccountEvents['removeListener'](_0x314df6,_0x5a1b51);};}exports[_0x8cb4('0x5')]=function(_0x4be833){for(var _0x32983a=0x0,_0x202219=events[_0x8cb4('0x6')];_0x32983a<_0x202219;_0x32983a++){var _0x2316b9=events[_0x32983a];var _0x5ddbfc=createListener(_0x8cb4('0x7')+_0x2316b9,_0x4be833);WhatsappAccountEvents['on'](_0x2316b9,_0x5ddbfc);}}; \ No newline at end of file +var _0xc2f4=['remove','update','emit','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2f4,0xae));var _0x4c2f=function(_0x11a741,_0x1e7097){_0x11a741=_0x11a741-0x0;var _0xa466f6=_0xc2f4[_0x11a741];return _0xa466f6;};'use strict';var WhatsappAccountEvents=require(_0x4c2f('0x0'));var events=['save',_0x4c2f('0x1'),_0x4c2f('0x2')];function createListener(_0x5abcf3,_0x2bb722){return function(_0x3b0f96){_0x2bb722[_0x4c2f('0x3')](_0x5abcf3,_0x3b0f96);};}function removeListener(_0x986010,_0x217367){return function(){WhatsappAccountEvents['removeListener'](_0x986010,_0x217367);};}exports[_0x4c2f('0x4')]=function(_0x1db964){for(var _0x1eec19=0x0,_0x5587cb=events[_0x4c2f('0x5')];_0x1eec19<_0x5587cb;_0x1eec19++){var _0x578263=events[_0x1eec19];var _0xd030a5=createListener(_0x4c2f('0x6')+_0x578263,_0x1db964);WhatsappAccountEvents['on'](_0x578263,_0xd030a5);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 271f250..842d25c 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 _0x0812=['post','create','update','destroy','exports','path','express','Router','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5ac86d,_0xe15e9a){var _0x10e1b0=function(_0x5d29d5){while(--_0x5d29d5){_0x5ac86d['push'](_0x5ac86d['shift']());}};_0x10e1b0(++_0xe15e9a);}(_0x0812,0x1c7));var _0x2081=function(_0x35d2eb,_0x285dd6){_0x35d2eb=_0x35d2eb-0x0;var _0x1fcf00=_0x0812[_0x35d2eb];return _0x1fcf00;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2081('0x0'));var timeout=require('connect-timeout');var express=require(_0x2081('0x1'));var router=express[_0x2081('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2081('0x3'));var config=require('../../config/environment');var controller=require(_0x2081('0x4'));router[_0x2081('0x5')]('/',auth[_0x2081('0x6')](),controller[_0x2081('0x7')]);router['get'](_0x2081('0x8'),auth[_0x2081('0x6')](),controller[_0x2081('0x9')]);router[_0x2081('0xa')]('/',auth[_0x2081('0x6')](),controller[_0x2081('0xb')]);router['put'](_0x2081('0x8'),auth[_0x2081('0x6')](),controller[_0x2081('0xc')]);router['delete'](_0x2081('0x8'),auth['isAuthenticated'](),controller[_0x2081('0xd')]);module[_0x2081('0xe')]=router; \ No newline at end of file +var _0xae84=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','post','create','put','update','delete','isAuthenticated','exports','multer','util'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xae84,0x1a2));var _0x4ae8=function(_0x525e43,_0x1f9715){_0x525e43=_0x525e43-0x0;var _0xf88b45=_0xae84[_0x525e43];return _0xf88b45;};'use strict';var multer=require(_0x4ae8('0x0'));var util=require(_0x4ae8('0x1'));var path=require(_0x4ae8('0x2'));var timeout=require(_0x4ae8('0x3'));var express=require(_0x4ae8('0x4'));var router=express[_0x4ae8('0x5')]();var fs_extra=require(_0x4ae8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4ae8('0x7'));var config=require(_0x4ae8('0x8'));var controller=require(_0x4ae8('0x9'));router[_0x4ae8('0xa')]('/',auth['isAuthenticated'](),controller[_0x4ae8('0xb')]);router[_0x4ae8('0xa')](_0x4ae8('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4ae8('0xd')]('/',auth['isAuthenticated'](),controller[_0x4ae8('0xe')]);router[_0x4ae8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4ae8('0x10')]);router[_0x4ae8('0x11')](_0x4ae8('0xc'),auth[_0x4ae8('0x12')](),controller['destroy']);module[_0x4ae8('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d5a7c02..f4660ab 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 _0x23e8=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x541202,_0x32c6be){var _0x4bd4ab=function(_0x24db7a){while(--_0x24db7a){_0x541202['push'](_0x541202['shift']());}};_0x4bd4ab(++_0x32c6be);}(_0x23e8,0xe9));var _0x823e=function(_0x1ae7f6,_0x3259a9){_0x1ae7f6=_0x1ae7f6-0x0;var _0x273264=_0x23e8[_0x1ae7f6];return _0x273264;};'use strict';var Sequelize=require(_0x823e('0x0'));module[_0x823e('0x1')]={'priority':{'type':Sequelize[_0x823e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x823e('0x3')},'appdata':{'type':Sequelize[_0x823e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x823e('0x5')],'defaultValue':_0x823e('0x6')}}; \ No newline at end of file +var _0x5a7c=['STRING','noop','*,*,*,*','sequelize','INTEGER'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0x5a7c,0x18e));var _0xc5a7=function(_0x22b088,_0x34cc79){_0x22b088=_0x22b088-0x0;var _0x9c19db=_0x5a7c[_0x22b088];return _0x9c19db;};'use strict';var Sequelize=require(_0xc5a7('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc5a7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc5a7('0x2')],'allowNull':![],'defaultValue':_0xc5a7('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc5a7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc5a7('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c01ae34..4a48eb9 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 _0xd1f8=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xd1f8[_0x13606d];return _0x1b85b0;};'use strict';var emlformat=require(_0x8d1f('0x0'));var rimraf=require(_0x8d1f('0x1'));var zipdir=require(_0x8d1f('0x2'));var jsonpatch=require(_0x8d1f('0x3'));var rp=require('request-promise');var moment=require(_0x8d1f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d1f('0x5'));var util=require('util');var path=require(_0x8d1f('0x6'));var sox=require('sox');var csv=require(_0x8d1f('0x7'));var ejs=require(_0x8d1f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d1f('0x9'));var squel=require(_0x8d1f('0xa'));var crypto=require(_0x8d1f('0xb'));var jsforce=require(_0x8d1f('0xc'));var deskjs=require(_0x8d1f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8d1f('0xe'));var Papa=require(_0x8d1f('0xf'));var Redis=require('ioredis');var authService=require(_0x8d1f('0x10'));var qs=require(_0x8d1f('0x11'));var as=require(_0x8d1f('0x12'));var hardwareService=require(_0x8d1f('0x13'));var logger=require(_0x8d1f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8d1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d1f('0x16'))['db'];function respondWithStatusCode(_0x38e8bb,_0x4f31d0){_0x4f31d0=_0x4f31d0||0xcc;return function(_0x52cd91){if(_0x52cd91){return _0x38e8bb[_0x8d1f('0x17')](_0x4f31d0);}return _0x38e8bb[_0x8d1f('0x18')](_0x4f31d0)['end']();};}function respondWithResult(_0x7d9ae5,_0x8c423c){_0x8c423c=_0x8c423c||0xc8;return function(_0x443511){if(_0x443511){return _0x7d9ae5[_0x8d1f('0x18')](_0x8c423c)[_0x8d1f('0x19')](_0x443511);}};}function respondWithFilteredResult(_0x3ea57a,_0x187e8b){return function(_0x1af7e2){if(_0x1af7e2){var _0x2463c9=typeof _0x187e8b[_0x8d1f('0x1a')]===_0x8d1f('0x1b')&&typeof _0x187e8b[_0x8d1f('0x1c')]===_0x8d1f('0x1b');var _0x2036ee=_0x1af7e2[_0x8d1f('0x1d')];var _0xb5c2e5=_0x2463c9?0x0:_0x187e8b[_0x8d1f('0x1a')];var _0x495655=_0x2463c9?_0x1af7e2['count']:_0x187e8b[_0x8d1f('0x1a')]+_0x187e8b[_0x8d1f('0x1c')];var _0x1cb538;if(_0x495655>=_0x2036ee){_0x495655=_0x2036ee;_0x1cb538=0xc8;}else{_0x1cb538=0xce;}_0x3ea57a[_0x8d1f('0x18')](_0x1cb538);return _0x3ea57a[_0x8d1f('0x1e')](_0x8d1f('0x1f'),_0xb5c2e5+'-'+_0x495655+'/'+_0x2036ee)['json'](_0x1af7e2);}return null;};}function patchUpdates(_0x194fe0){return function(_0xa52d89){try{jsonpatch[_0x8d1f('0x20')](_0xa52d89,_0x194fe0,!![]);}catch(_0x9ce15f){return BPromise['reject'](_0x9ce15f);}return _0xa52d89['save']();};}function saveUpdates(_0x4519bc,_0x102e98){return function(_0x5175a5){if(_0x5175a5){return _0x5175a5[_0x8d1f('0x21')](_0x4519bc)['then'](function(_0x285e7f){return _0x285e7f;});}return null;};}function removeEntity(_0x3d2016,_0x307990){return function(_0x2279b9){if(_0x2279b9){return _0x2279b9[_0x8d1f('0x22')]()[_0x8d1f('0x23')](function(){_0x3d2016[_0x8d1f('0x18')](0xcc)[_0x8d1f('0x24')]();});}};}function handleEntityNotFound(_0x296d0c,_0x4ba072){return function(_0x24c04a){if(!_0x24c04a){_0x296d0c[_0x8d1f('0x17')](0x194);}return _0x24c04a;};}function handleError(_0x584157,_0x391e79){_0x391e79=_0x391e79||0x1f4;return function(_0x860eda){logger['error'](_0x860eda[_0x8d1f('0x25')]);if(_0x860eda[_0x8d1f('0x26')]){delete _0x860eda[_0x8d1f('0x26')];}_0x584157['status'](_0x391e79)[_0x8d1f('0x27')](_0x860eda);};}exports[_0x8d1f('0x28')]=function(_0x4ca54a,_0x4e7e41){var _0x3c15de={},_0x564920={},_0x4c60bb={'count':0x0,'rows':[]};var _0x15d661=_[_0x8d1f('0x29')](db[_0x8d1f('0x2a')][_0x8d1f('0x2b')],function(_0x409788){return{'name':_0x409788[_0x8d1f('0x2c')],'type':_0x409788[_0x8d1f('0x2d')][_0x8d1f('0x2e')]};});_0x564920['model']=_[_0x8d1f('0x29')](_0x15d661,_0x8d1f('0x26'));_0x564920[_0x8d1f('0x2f')]=_[_0x8d1f('0x30')](_0x4ca54a[_0x8d1f('0x2f')]);_0x564920[_0x8d1f('0x31')]=_['intersection'](_0x564920[_0x8d1f('0x32')],_0x564920[_0x8d1f('0x2f')]);_0x3c15de['attributes']=_[_0x8d1f('0x33')](_0x564920[_0x8d1f('0x32')],qs['fields'](_0x4ca54a['query']['fields']));_0x3c15de[_0x8d1f('0x34')]=_0x3c15de[_0x8d1f('0x34')][_0x8d1f('0x35')]?_0x3c15de[_0x8d1f('0x34')]:_0x564920[_0x8d1f('0x32')];if(!_0x4ca54a[_0x8d1f('0x2f')][_0x8d1f('0x36')](_0x8d1f('0x37'))){_0x3c15de['limit']=qs['limit'](_0x4ca54a['query'][_0x8d1f('0x1c')]);_0x3c15de[_0x8d1f('0x1a')]=qs[_0x8d1f('0x1a')](_0x4ca54a[_0x8d1f('0x2f')][_0x8d1f('0x1a')]);}_0x3c15de[_0x8d1f('0x38')]=qs['sort'](_0x4ca54a[_0x8d1f('0x2f')]['sort']);_0x3c15de[_0x8d1f('0x39')]=qs[_0x8d1f('0x31')](_['pick'](_0x4ca54a['query'],_0x564920[_0x8d1f('0x31')]),_0x15d661);if(_0x4ca54a[_0x8d1f('0x2f')][_0x8d1f('0x3a')]){_0x3c15de[_0x8d1f('0x39')]=_[_0x8d1f('0x3b')](_0x3c15de[_0x8d1f('0x39')],{'$or':_['map'](_0x15d661,function(_0x42de98){if(_0x42de98[_0x8d1f('0x2d')]!==_0x8d1f('0x3c')){var _0x19273f={};_0x19273f[_0x42de98[_0x8d1f('0x26')]]={'$like':'%'+_0x4ca54a[_0x8d1f('0x2f')][_0x8d1f('0x3a')]+'%'};return _0x19273f;}})});}_0x3c15de=_[_0x8d1f('0x3b')]({},_0x3c15de,_0x4ca54a[_0x8d1f('0x3d')]);var _0x2f1c93={'where':_0x3c15de[_0x8d1f('0x39')]};return db['WhatsappApplication'][_0x8d1f('0x1d')](_0x2f1c93)[_0x8d1f('0x23')](function(_0x1dfa97){_0x4c60bb['count']=_0x1dfa97;if(_0x4ca54a['query']['includeAll']){_0x3c15de[_0x8d1f('0x3e')]=[{'all':!![]}];}return db[_0x8d1f('0x2a')]['findAll'](_0x3c15de);})[_0x8d1f('0x23')](function(_0x1dfd62){_0x4c60bb[_0x8d1f('0x3f')]=_0x1dfd62;return _0x4c60bb;})[_0x8d1f('0x23')](respondWithFilteredResult(_0x4e7e41,_0x3c15de))[_0x8d1f('0x40')](handleError(_0x4e7e41,null));};exports[_0x8d1f('0x41')]=function(_0x345d19,_0x279e9a){var _0x1b8186={'raw':!![],'where':{'id':_0x345d19[_0x8d1f('0x42')]['id']}},_0x2d891e={};_0x2d891e['model']=_[_0x8d1f('0x30')](db[_0x8d1f('0x2a')]['rawAttributes']);_0x2d891e[_0x8d1f('0x2f')]=_[_0x8d1f('0x30')](_0x345d19[_0x8d1f('0x2f')]);_0x2d891e[_0x8d1f('0x31')]=_['intersection'](_0x2d891e['model'],_0x2d891e['query']);_0x1b8186['attributes']=_[_0x8d1f('0x33')](_0x2d891e[_0x8d1f('0x32')],qs['fields'](_0x345d19[_0x8d1f('0x2f')]['fields']));_0x1b8186['attributes']=_0x1b8186['attributes'][_0x8d1f('0x35')]?_0x1b8186[_0x8d1f('0x34')]:_0x2d891e[_0x8d1f('0x32')];if(_0x345d19[_0x8d1f('0x2f')]['includeAll']){_0x1b8186[_0x8d1f('0x3e')]=[{'all':!![]}];}_0x1b8186=_['merge']({},_0x1b8186,_0x345d19['options']);return db[_0x8d1f('0x2a')][_0x8d1f('0x43')](_0x1b8186)[_0x8d1f('0x23')](handleEntityNotFound(_0x279e9a,null))[_0x8d1f('0x23')](respondWithResult(_0x279e9a,null))[_0x8d1f('0x40')](handleError(_0x279e9a,null));};exports[_0x8d1f('0x44')]=function(_0x103957,_0x436125){return db[_0x8d1f('0x2a')]['create'](_0x103957[_0x8d1f('0x45')],{})[_0x8d1f('0x23')](respondWithResult(_0x436125,0xc9))[_0x8d1f('0x40')](handleError(_0x436125,null));};exports[_0x8d1f('0x21')]=function(_0x174093,_0x239111){if(_0x174093[_0x8d1f('0x45')]['id']){delete _0x174093[_0x8d1f('0x45')]['id'];}return db[_0x8d1f('0x2a')][_0x8d1f('0x43')]({'where':{'id':_0x174093[_0x8d1f('0x42')]['id']}})[_0x8d1f('0x23')](handleEntityNotFound(_0x239111,null))[_0x8d1f('0x23')](saveUpdates(_0x174093[_0x8d1f('0x45')],null))[_0x8d1f('0x23')](respondWithResult(_0x239111,null))[_0x8d1f('0x40')](handleError(_0x239111,null));};exports['destroy']=function(_0x21a44a,_0xe7e4e3){return db[_0x8d1f('0x2a')][_0x8d1f('0x43')]({'where':{'id':_0x21a44a[_0x8d1f('0x42')]['id']}})[_0x8d1f('0x23')](handleEntityNotFound(_0xe7e4e3,null))[_0x8d1f('0x23')](removeEntity(_0xe7e4e3,null))[_0x8d1f('0x40')](handleError(_0xe7e4e3,null));}; \ No newline at end of file +var _0x8561=['limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','catch','show','keys','include','find','create','body','update','params','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','lodash','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x304144,_0x2c3bda){var _0x1ad55a=function(_0x53d87a){while(--_0x53d87a){_0x304144['push'](_0x304144['shift']());}};_0x1ad55a(++_0x2c3bda);}(_0x8561,0x1b2));var _0x1856=function(_0x47abbc,_0x5a8c7a){_0x47abbc=_0x47abbc-0x0;var _0x55a157=_0x8561[_0x47abbc];return _0x55a157;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1856('0x0'));var zipdir=require(_0x1856('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1856('0x2'));var moment=require('moment');var BPromise=require(_0x1856('0x3'));var Mustache=require('mustache');var util=require(_0x1856('0x4'));var path=require('path');var sox=require(_0x1856('0x5'));var csv=require(_0x1856('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1856('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1856('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1856('0x9'));var authService=require(_0x1856('0xa'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1856('0xb'));var logger=require('../../config/logger')(_0x1856('0xc'));var utils=require(_0x1856('0xd'));var config=require(_0x1856('0xe'));var licenseUtil=require('../../config/license/util');var db=require(_0x1856('0xf'))['db'];function respondWithStatusCode(_0x317635,_0x57deab){_0x57deab=_0x57deab||0xcc;return function(_0x354164){if(_0x354164){return _0x317635[_0x1856('0x10')](_0x57deab);}return _0x317635[_0x1856('0x11')](_0x57deab)['end']();};}function respondWithResult(_0x2db814,_0xc02b25){_0xc02b25=_0xc02b25||0xc8;return function(_0x208118){if(_0x208118){return _0x2db814['status'](_0xc02b25)[_0x1856('0x12')](_0x208118);}};}function respondWithFilteredResult(_0xb5ff4d,_0x12a82f){return function(_0x3ff3af){if(_0x3ff3af){var _0x41d5bc=typeof _0x12a82f[_0x1856('0x13')]===_0x1856('0x14')&&typeof _0x12a82f['limit']==='undefined';var _0x340bcd=_0x3ff3af['count'];var _0x4ccc42=_0x41d5bc?0x0:_0x12a82f[_0x1856('0x13')];var _0x2346f6=_0x41d5bc?_0x3ff3af['count']:_0x12a82f['offset']+_0x12a82f[_0x1856('0x15')];var _0x40d229;if(_0x2346f6>=_0x340bcd){_0x2346f6=_0x340bcd;_0x40d229=0xc8;}else{_0x40d229=0xce;}_0xb5ff4d[_0x1856('0x11')](_0x40d229);return _0xb5ff4d[_0x1856('0x16')](_0x1856('0x17'),_0x4ccc42+'-'+_0x2346f6+'/'+_0x340bcd)[_0x1856('0x12')](_0x3ff3af);}return null;};}function patchUpdates(_0x47e94c){return function(_0x3d98e4){try{jsonpatch[_0x1856('0x18')](_0x3d98e4,_0x47e94c,!![]);}catch(_0x1dd95d){return BPromise[_0x1856('0x19')](_0x1dd95d);}return _0x3d98e4[_0x1856('0x1a')]();};}function saveUpdates(_0x988cd2,_0xce310a){return function(_0x4dd5b2){if(_0x4dd5b2){return _0x4dd5b2['update'](_0x988cd2)[_0x1856('0x1b')](function(_0x31df72){return _0x31df72;});}return null;};}function removeEntity(_0x31dc64,_0x4b867e){return function(_0x389ed6){if(_0x389ed6){return _0x389ed6[_0x1856('0x1c')]()[_0x1856('0x1b')](function(){_0x31dc64[_0x1856('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd069f,_0x25b98d){return function(_0x195546){if(!_0x195546){_0xfd069f[_0x1856('0x10')](0x194);}return _0x195546;};}function handleError(_0x4d4f0c,_0x254d35){_0x254d35=_0x254d35||0x1f4;return function(_0x4022e8){logger['error'](_0x4022e8[_0x1856('0x1d')]);if(_0x4022e8['name']){delete _0x4022e8[_0x1856('0x1e')];}_0x4d4f0c['status'](_0x254d35)[_0x1856('0x1f')](_0x4022e8);};}exports[_0x1856('0x20')]=function(_0x1416b3,_0x3c907b){var _0x4ad54a={},_0x2f3d8f={},_0x155607={'count':0x0,'rows':[]};var _0x1134a5=_[_0x1856('0x21')](db[_0x1856('0x22')][_0x1856('0x23')],function(_0x4b0deb){return{'name':_0x4b0deb[_0x1856('0x24')],'type':_0x4b0deb[_0x1856('0x25')][_0x1856('0x26')]};});_0x2f3d8f['model']=_[_0x1856('0x21')](_0x1134a5,_0x1856('0x1e'));_0x2f3d8f[_0x1856('0x27')]=_['keys'](_0x1416b3[_0x1856('0x27')]);_0x2f3d8f['filters']=_[_0x1856('0x28')](_0x2f3d8f[_0x1856('0x29')],_0x2f3d8f[_0x1856('0x27')]);_0x4ad54a[_0x1856('0x2a')]=_[_0x1856('0x28')](_0x2f3d8f[_0x1856('0x29')],qs[_0x1856('0x2b')](_0x1416b3['query'][_0x1856('0x2b')]));_0x4ad54a[_0x1856('0x2a')]=_0x4ad54a[_0x1856('0x2a')][_0x1856('0x2c')]?_0x4ad54a[_0x1856('0x2a')]:_0x2f3d8f['model'];if(!_0x1416b3[_0x1856('0x27')][_0x1856('0x2d')](_0x1856('0x2e'))){_0x4ad54a['limit']=qs[_0x1856('0x15')](_0x1416b3[_0x1856('0x27')][_0x1856('0x15')]);_0x4ad54a[_0x1856('0x13')]=qs[_0x1856('0x13')](_0x1416b3['query']['offset']);}_0x4ad54a['order']=qs[_0x1856('0x2f')](_0x1416b3['query'][_0x1856('0x2f')]);_0x4ad54a[_0x1856('0x30')]=qs['filters'](_['pick'](_0x1416b3[_0x1856('0x27')],_0x2f3d8f[_0x1856('0x31')]),_0x1134a5);if(_0x1416b3[_0x1856('0x27')][_0x1856('0x32')]){_0x4ad54a['where']=_[_0x1856('0x33')](_0x4ad54a[_0x1856('0x30')],{'$or':_[_0x1856('0x21')](_0x1134a5,function(_0x366c8d){if(_0x366c8d[_0x1856('0x25')]!==_0x1856('0x34')){var _0x2e60c0={};_0x2e60c0[_0x366c8d['name']]={'$like':'%'+_0x1416b3[_0x1856('0x27')][_0x1856('0x32')]+'%'};return _0x2e60c0;}})});}_0x4ad54a=_['merge']({},_0x4ad54a,_0x1416b3[_0x1856('0x35')]);var _0xc1164={'where':_0x4ad54a['where']};return db['WhatsappApplication'][_0x1856('0x36')](_0xc1164)[_0x1856('0x1b')](function(_0x35948b){_0x155607[_0x1856('0x36')]=_0x35948b;if(_0x1416b3[_0x1856('0x27')][_0x1856('0x37')]){_0x4ad54a['include']=[{'all':!![]}];}return db[_0x1856('0x22')]['findAll'](_0x4ad54a);})[_0x1856('0x1b')](function(_0x15608f){_0x155607['rows']=_0x15608f;return _0x155607;})[_0x1856('0x1b')](respondWithFilteredResult(_0x3c907b,_0x4ad54a))[_0x1856('0x38')](handleError(_0x3c907b,null));};exports[_0x1856('0x39')]=function(_0x9020dc,_0x33c137){var _0x3056ad={'raw':!![],'where':{'id':_0x9020dc['params']['id']}},_0xf534ab={};_0xf534ab['model']=_[_0x1856('0x3a')](db['WhatsappApplication']['rawAttributes']);_0xf534ab[_0x1856('0x27')]=_[_0x1856('0x3a')](_0x9020dc['query']);_0xf534ab[_0x1856('0x31')]=_[_0x1856('0x28')](_0xf534ab[_0x1856('0x29')],_0xf534ab[_0x1856('0x27')]);_0x3056ad[_0x1856('0x2a')]=_[_0x1856('0x28')](_0xf534ab[_0x1856('0x29')],qs[_0x1856('0x2b')](_0x9020dc[_0x1856('0x27')][_0x1856('0x2b')]));_0x3056ad['attributes']=_0x3056ad[_0x1856('0x2a')][_0x1856('0x2c')]?_0x3056ad[_0x1856('0x2a')]:_0xf534ab[_0x1856('0x29')];if(_0x9020dc[_0x1856('0x27')]['includeAll']){_0x3056ad[_0x1856('0x3b')]=[{'all':!![]}];}_0x3056ad=_[_0x1856('0x33')]({},_0x3056ad,_0x9020dc[_0x1856('0x35')]);return db[_0x1856('0x22')][_0x1856('0x3c')](_0x3056ad)['then'](handleEntityNotFound(_0x33c137,null))[_0x1856('0x1b')](respondWithResult(_0x33c137,null))[_0x1856('0x38')](handleError(_0x33c137,null));};exports[_0x1856('0x3d')]=function(_0x5799fd,_0x494c34){return db['WhatsappApplication'][_0x1856('0x3d')](_0x5799fd[_0x1856('0x3e')],{})[_0x1856('0x1b')](respondWithResult(_0x494c34,0xc9))[_0x1856('0x38')](handleError(_0x494c34,null));};exports[_0x1856('0x3f')]=function(_0x4b2aa7,_0x24bf19){if(_0x4b2aa7[_0x1856('0x3e')]['id']){delete _0x4b2aa7[_0x1856('0x3e')]['id'];}return db[_0x1856('0x22')]['find']({'where':{'id':_0x4b2aa7[_0x1856('0x40')]['id']}})[_0x1856('0x1b')](handleEntityNotFound(_0x24bf19,null))['then'](saveUpdates(_0x4b2aa7[_0x1856('0x3e')],null))[_0x1856('0x1b')](respondWithResult(_0x24bf19,null))[_0x1856('0x38')](handleError(_0x24bf19,null));};exports[_0x1856('0x1c')]=function(_0x287b7d,_0x26da87){return db[_0x1856('0x22')][_0x1856('0x3c')]({'where':{'id':_0x287b7d['params']['id']}})[_0x1856('0x1b')](handleEntityNotFound(_0x26da87,null))['then'](removeEntity(_0x26da87,null))['catch'](handleError(_0x26da87,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index cd30352..d23b26c 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 _0x6bff=['bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','api'];(function(_0x5c8a11,_0x10805f){var _0x116b22=function(_0x10a697){while(--_0x10a697){_0x5c8a11['push'](_0x5c8a11['shift']());}};_0x116b22(++_0x10805f);}(_0x6bff,0xa6));var _0xf6bf=function(_0x2b6816,_0x5e7c8b){_0x2b6816=_0x2b6816-0x0;var _0x4710b7=_0x6bff[_0x2b6816];return _0x4710b7;};'use strict';var _=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var logger=require('../../config/logger')(_0xf6bf('0x2'));var moment=require('moment');var BPromise=require(_0xf6bf('0x3'));var rp=require(_0xf6bf('0x4'));var fs=require('fs');var path=require(_0xf6bf('0x5'));var rimraf=require(_0xf6bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6bf('0x7'));module[_0xf6bf('0x8')]=function(_0x27cdda,_0x239d17){return _0x27cdda[_0xf6bf('0x9')](_0xf6bf('0xa'),attributes,{'tableName':_0xf6bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6bf('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xac31=['request-promise','rimraf','../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4e7abc,_0x2aeca1){var _0x428796=function(_0xa2c1d){while(--_0xa2c1d){_0x4e7abc['push'](_0x4e7abc['shift']());}};_0x428796(++_0x2aeca1);}(_0xac31,0xca));var _0x1ac3=function(_0x1eb4fa,_0x469ae0){_0x1eb4fa=_0x1eb4fa-0x0;var _0x400e0b=_0xac31[_0x1eb4fa];return _0x400e0b;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1ac3('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b833857..d698e7c 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 _0xdace=['request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xdace,0xc5));var _0xedac=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xdace[_0x1dfa63];return _0x26f2a9;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x203bce,_0xcec2e7){var _0x387450=function(_0x2b4c0f){while(--_0x2b4c0f){_0x203bce['push'](_0x203bce['shift']());}};_0x387450(++_0xcec2e7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x490728,_0x430ab2){_0x490728=_0x490728-0x0;var _0x43b828=_0x8d0e[_0x490728];return _0x43b828;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 68dd461..ee28ab9 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 _0x7046=['whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','whatsapp','addTags','put','/:id','whatsappinteraction:update','update','delete'];(function(_0x31dfdd,_0x391df2){var _0x50a29a=function(_0x361c25){while(--_0x361c25){_0x31dfdd['push'](_0x31dfdd['shift']());}};_0x50a29a(++_0x391df2);}(_0x7046,0x144));var _0x6704=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7046[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0x9')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x9')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller['download']);router[_0x6704('0x11')]('/',auth[_0x6704('0xa')](),controller['create']);router[_0x6704('0x11')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0x12')]);router[_0x6704('0x11')](_0x6704('0x13'),auth[_0x6704('0xa')](),interaction[_0x6704('0x14')](_0x6704('0x15'),'whatsappinteraction:addtags'),controller[_0x6704('0x16')]);router[_0x6704('0x17')](_0x6704('0x18'),auth['isAuthenticated'](),interaction[_0x6704('0x14')](_0x6704('0x15'),_0x6704('0x19')),controller[_0x6704('0x1a')]);router[_0x6704('0x1b')]('/:id',auth[_0x6704('0xa')](),interaction[_0x6704('0x14')](_0x6704('0x15'),_0x6704('0x1c')),controller[_0x6704('0x1d')]);router['delete'](_0x6704('0x13'),auth[_0x6704('0xa')](),controller[_0x6704('0x1e')]);module[_0x6704('0x1f')]=router; \ No newline at end of file +var _0x326f=['./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','whatsapp','put','/:id','tracked','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a59c3,_0xa9fb89){var _0x2441bb=function(_0x458b38){while(--_0x458b38){_0x1a59c3['push'](_0x1a59c3['shift']());}};_0x2441bb(++_0xa9fb89);}(_0x326f,0xd1));var _0xf326=function(_0x38df4c,_0x3d0211){_0x38df4c=_0x38df4c-0x0;var _0x3ef4e2=_0x326f[_0x38df4c];return _0x3ef4e2;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['post']('/',auth[_0xf326('0xa')](),controller['create']);router[_0xf326('0x12')](_0xf326('0xe'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x12')](_0xf326('0x14'),auth[_0xf326('0xa')](),interaction['tracked'](_0xf326('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xf326('0x16')](_0xf326('0x17'),auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x19')),controller[_0xf326('0x1a')]);router[_0xf326('0x1b')]('/:id',auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x1c')),controller[_0xf326('0x1d')]);router[_0xf326('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xf326('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 97720a4..b3cc926 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 _0x5398=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x5398,0xe2));var _0x8539=function(_0x3cd97d,_0x400ff2){_0x3cd97d=_0x3cd97d-0x0;var _0x54ac9a=_0x5398[_0x3cd97d];return _0x54ac9a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8539('0x0'));module[_0x8539('0x1')]={'closed':{'type':Sequelize[_0x8539('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8539('0x3')]},'disposition':{'type':Sequelize[_0x8539('0x4')]},'secondDisposition':{'type':Sequelize[_0x8539('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8539('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8539('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8539('0x5')]('in',_0x8539('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8539('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8539('0x5')]('in',_0x8539('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2d17=['BOOLEAN','DATE','STRING','ENUM','sequelize','moment'];(function(_0x54da66,_0x395746){var _0x1ba363=function(_0xe421fe){while(--_0xe421fe){_0x54da66['push'](_0x54da66['shift']());}};_0x1ba363(++_0x395746);}(_0x2d17,0x17e));var _0x72d1=function(_0x1ece43,_0x449b3b){_0x1ece43=_0x1ece43-0x0;var _0x1f3c5d=_0x2d17[_0x1ece43];return _0x1f3c5d;};'use strict';var Sequelize=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x72d1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x72d1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x72d1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x72d1('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x72d1('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x72d1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x72d1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x72d1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x72d1('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 be0f6dc..4f311b3 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 _0x147b=['sqlOperator','conditions','find','unreadMessages','having','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','$gte','parse','where','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','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','rawAttributes','include','create','params','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','WhatsappInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','omit','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','format','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','direction','WhatsappAccount','Account','Owner','get','N.A.','createdAt','closedAt','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','lastName','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','offset','count','limit','set','Content-Range','json','reject','save','update','destroy','then','status','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','unmanaged','total','closed','UserId','waiting','answered','talking','index','WhatsappInteraction','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','users','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x147b,0x193));var _0xb147=function(_0xc033f3,_0x4edd5c){_0xc033f3=_0xc033f3-0x0;var _0x57eb11=_0x147b[_0xc033f3];return _0x57eb11;};'use strict';var emlformat=require(_0xb147('0x0'));var rimraf=require(_0xb147('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb147('0x2'));var rp=require(_0xb147('0x3'));var moment=require('moment');var BPromise=require(_0xb147('0x4'));var Mustache=require(_0xb147('0x5'));var util=require(_0xb147('0x6'));var path=require('path');var sox=require(_0xb147('0x7'));var csv=require('to-csv');var ejs=require(_0xb147('0x8'));var fs=require('fs');var fs_extra=require(_0xb147('0x9'));var _=require(_0xb147('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb147('0xb'));var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0xd'));var querystring=require(_0xb147('0xe'));var Papa=require(_0xb147('0xf'));var Redis=require(_0xb147('0x10'));var authService=require(_0xb147('0x11'));var qs=require(_0xb147('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb147('0x13'));var logger=require(_0xb147('0x14'))(_0xb147('0x15'));var utils=require(_0xb147('0x16'));var config=require(_0xb147('0x17'));var licenseUtil=require(_0xb147('0x18'));var db=require(_0xb147('0x19'))['db'];config[_0xb147('0x1a')]=_[_0xb147('0x1b')](config[_0xb147('0x1a')],{'host':_0xb147('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb147('0x1a')]));require(_0xb147('0x1d'))[_0xb147('0x1e')](socket);function respondWithStatusCode(_0x2c1952,_0x5479b4){_0x5479b4=_0x5479b4||0xcc;return function(_0x2a0eeb){if(_0x2a0eeb){return _0x2c1952[_0xb147('0x1f')](_0x5479b4);}return _0x2c1952['status'](_0x5479b4)['end']();};}function respondWithResult(_0x1f424a,_0x1e735c){_0x1e735c=_0x1e735c||0xc8;return function(_0x34e3c1){if(_0x34e3c1){return _0x1f424a['status'](_0x1e735c)['json'](_0x34e3c1);}};}function respondWithFilteredResult(_0xe5aa93,_0x5e3235){return function(_0x3a9bca){if(_0x3a9bca){var _0x107b35=typeof _0x5e3235[_0xb147('0x20')]==='undefined'&&typeof _0x5e3235['limit']==='undefined';var _0xad4b38=_0x3a9bca[_0xb147('0x21')];var _0x411a3b=_0x107b35?0x0:_0x5e3235['offset'];var _0x39c15c=_0x107b35?_0x3a9bca[_0xb147('0x21')]:_0x5e3235[_0xb147('0x20')]+_0x5e3235[_0xb147('0x22')];var _0x163151;if(_0x39c15c>=_0xad4b38){_0x39c15c=_0xad4b38;_0x163151=0xc8;}else{_0x163151=0xce;}_0xe5aa93['status'](_0x163151);return _0xe5aa93[_0xb147('0x23')](_0xb147('0x24'),_0x411a3b+'-'+_0x39c15c+'/'+_0xad4b38)[_0xb147('0x25')](_0x3a9bca);}return null;};}function patchUpdates(_0x420452){return function(_0x353b8b){try{jsonpatch['apply'](_0x353b8b,_0x420452,!![]);}catch(_0x565acd){return BPromise[_0xb147('0x26')](_0x565acd);}return _0x353b8b[_0xb147('0x27')]();};}function saveUpdates(_0x24efa0,_0x39f833){return function(_0x5f2806){if(_0x5f2806){return _0x5f2806[_0xb147('0x28')](_0x24efa0)['then'](function(_0x5930a5){return _0x5930a5;});}return null;};}function removeEntity(_0x2b7c3a,_0x2cf3b5){return function(_0x444d58){if(_0x444d58){return _0x444d58[_0xb147('0x29')]()[_0xb147('0x2a')](function(){_0x2b7c3a[_0xb147('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5691de,_0x3bf2ae){return function(_0x456718){if(!_0x456718){_0x5691de['sendStatus'](0x194);}return _0x456718;};}function handleError(_0xf23eed,_0x45887f){_0x45887f=_0x45887f||0x1f4;return function(_0x50f831){logger['error'](_0x50f831[_0xb147('0x2c')]);if(_0x50f831[_0xb147('0x2d')]){delete _0x50f831[_0xb147('0x2d')];}_0xf23eed[_0xb147('0x2b')](_0x45887f)[_0xb147('0x2e')](_0x50f831);};}function getInteractionUsers(_0x589010,_0x3e6a3c){return new BPromise(function(_0x315896,_0x273fff){try{if(_0x3e6a3c[_0x589010['id']]){_0x589010[_0xb147('0x2f')]=_[_0xb147('0x30')](_0x3e6a3c[_0x589010['id']],function(_0x4afede){return{'id':_0x4afede['id'],'fullname':_0x4afede[_0xb147('0x31')]};});}}catch(_0x7c6129){_0x273fff(_0x7c6129);}_0x315896(_0x589010);});}function getInteractionTags(_0x9a2bb2,_0x35102b){return new BPromise(function(_0x3b2eb2,_0x28a923){try{if(_0x9a2bb2[_0xb147('0x32')]){_0x9a2bb2[_0xb147('0x33')]=[];_0x9a2bb2[_0xb147('0x32')]['split'](',')[_0xb147('0x34')](function(_0x3f91f8){_0x9a2bb2[_0xb147('0x33')][_0xb147('0x35')](_0x35102b[_0x3f91f8]);});}delete _0x9a2bb2[_0xb147('0x32')];}catch(_0x3d0b9d){_0x28a923(_0x3d0b9d);}_0x3b2eb2(_0x9a2bb2);});}function updateWhatsappInteraction(_0x1e5799,_0x25b7ca,_0x5a8261){return new BPromise(function(_0x2103bc,_0x2c03e0){return getInteractionUsers(_0x1e5799,_0x5a8261)[_0xb147('0x2a')](function(_0x26ccc6){return getInteractionTags(_0x26ccc6,_0x25b7ca);})[_0xb147('0x2a')](function(_0x3e8115){return getStateInteraction(_0x3e8115);})[_0xb147('0x2a')](function(_0x4a8460){_0x2103bc(_0x4a8460);})[_0xb147('0x36')](function(_0x48cc99){_0x2c03e0(_0x48cc99);});});}function getStateInteraction(_0x221a7c){return new BPromise(function(_0x2977fe){_0x221a7c['waiting']=0x0;_0x221a7c['talking']=0x0;_0x221a7c['answered']=0x0;_0x221a7c[_0xb147('0x37')]=0x0;_0x221a7c[_0xb147('0x38')]=0x0;if(!_0x221a7c[_0xb147('0x39')]&&!_0x221a7c[_0xb147('0x3a')]){_0x221a7c[_0xb147('0x3b')]+=0x1;}if(!_0x221a7c['closed']&&_0x221a7c[_0xb147('0x3a')]){_0x221a7c['talking']+=0x1;if(_0x221a7c['waiting']){_0x221a7c['waiting']-=0x1;}}if(_0x221a7c[_0xb147('0x39')]&&_0x221a7c[_0xb147('0x3a')]){_0x221a7c[_0xb147('0x3c')]+=0x1;if(_0x221a7c[_0xb147('0x3d')]){_0x221a7c[_0xb147('0x3d')]-=0x1;}}if(_0x221a7c[_0xb147('0x39')]&&!_0x221a7c['UserId']){_0x221a7c[_0xb147('0x37')]+=0x1;if(_0x221a7c[_0xb147('0x3b')]){_0x221a7c[_0xb147('0x3b')]-=0x1;}}_0x221a7c[_0xb147('0x38')]+=0x1;_0x2977fe(_0x221a7c);});}exports[_0xb147('0x3e')]=function(_0xcbe3d8,_0x5443f4){var _0x46cc57={},_0x22043c={},_0x2fc312={'count':0x0,'rows':[]};var _0x53a9af=_[_0xb147('0x30')](db[_0xb147('0x3f')]['rawAttributes'],function(_0x57c8e7){return{'name':_0x57c8e7['fieldName'],'type':_0x57c8e7[_0xb147('0x40')]['key']};});_0x22043c['model']=_[_0xb147('0x30')](_0x53a9af,_0xb147('0x2d'));_0x22043c[_0xb147('0x41')]=_[_0xb147('0x42')](_0xcbe3d8['query']);_0x22043c[_0xb147('0x43')]=_['intersection'](_0x22043c[_0xb147('0x44')],_0x22043c[_0xb147('0x41')]);_0x46cc57[_0xb147('0x45')]=_[_0xb147('0x46')](_0x22043c[_0xb147('0x44')],qs[_0xb147('0x47')](_0xcbe3d8[_0xb147('0x41')][_0xb147('0x47')]));_0x46cc57['attributes']=_0x46cc57[_0xb147('0x45')][_0xb147('0x48')]?_0x46cc57[_0xb147('0x45')]:_0x22043c[_0xb147('0x44')];if(!_0xcbe3d8[_0xb147('0x41')][_0xb147('0x49')]('nolimit')){_0x46cc57[_0xb147('0x22')]=qs['limit'](_0xcbe3d8[_0xb147('0x41')][_0xb147('0x22')]);_0x46cc57[_0xb147('0x20')]=qs[_0xb147('0x20')](_0xcbe3d8['query'][_0xb147('0x20')]);}_0x46cc57[_0xb147('0x4a')]=qs[_0xb147('0x4b')](_0xcbe3d8['query'][_0xb147('0x4b')]);_0x46cc57['where']=qs[_0xb147('0x43')](_[_0xb147('0x4c')](_0xcbe3d8[_0xb147('0x41')],_0x22043c[_0xb147('0x43')]),_0x53a9af);var _0x1d679e=[];var _0x17975d=squel[_0xb147('0x4d')]()[_0xb147('0x4e')]('id')[_0xb147('0x4e')](_0xb147('0x2d'))[_0xb147('0x4e')](_0xb147('0x4f'))[_0xb147('0x50')](_0xb147('0x51'));var _0x31e2b3=squel['select']()[_0xb147('0x4e')](_0xb147('0x52'))[_0xb147('0x4e')](_0xb147('0x53'))[_0xb147('0x4e')]('ui.WhatsappInteractionId')[_0xb147('0x50')](_0xb147('0x54'),'ui')['left_join'](_0xb147('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x5a2472=squel[_0xb147('0x4d')]()[_0xb147('0x50')]('whatsapp_interactions','i')[_0xb147('0x56')](_0xb147('0x57'),'c',_0xb147('0x58'))[_0xb147('0x56')](_0xb147('0x55'),'o','o.id\x20=\x20i.UserId')[_0xb147('0x56')](_0xb147('0x59'),'a',_0xb147('0x5a'))[_0xb147('0x56')](_0xb147('0x5b'),'me',_0xb147('0x5c'))[_0xb147('0x56')](_0xb147('0x5d'),'it',_0xb147('0x5e'))[_0xb147('0x56')](_0xb147('0x51'),'t','t.id\x20=\x20it.TagId');var _0x153d0c=squel[_0xb147('0x5f')]();var _0x4dde95=[];var _0x2c031f=squel[_0xb147('0x5f')]();var _0xf0ade0;if(_0xcbe3d8['query'][_0xb147('0x60')]){_0xf0ade0=as['parseSearch'](_0xcbe3d8[_0xb147('0x41')][_0xb147('0x60')]);var _0x598666=_0xf0ade0[_0xb147('0x61')];for(var _0x46b633=0x0;_0x46b633<_0xf0ade0['conditions'][_0xb147('0x48')];_0x46b633++){var _0x132d83=_0xf0ade0[_0xb147('0x62')][_0x46b633];var _0x454b13='i';var _0x1cdfc3=_[_0xb147('0x63')](_0x53a9af,[_0xb147('0x2d'),_0x132d83[_0xb147('0x4e')]]);if(!_0x1cdfc3){switch(_0x132d83[_0xb147('0x4e')]){case _0xb147('0x64'):if(_0x132d83['value']==0x1){_0x5a2472[_0xb147('0x65')]('`'+_0x132d83[_0xb147('0x4e')]+'`\x20=\x200');}else{_0x5a2472[_0xb147('0x65')]('`'+_0x132d83[_0xb147('0x4e')]+'`\x20>\x200');}break;case _0xb147('0x66'):if(_0x132d83[_0xb147('0x67')]===_0xb147('0x68')){if(_0x132d83[_0xb147('0x69')][_0xb147('0x6a')]('\x20')[_0xb147('0x48')]>0x1){_0x153d0c[_0x598666](_0xb147('0x6b'),qs[_0xb147('0x6c')](_0x132d83[_0xb147('0x69')]),null);}else{var _0x3b310b='%'+_0x132d83['value']+'%';_0x153d0c[_0x598666]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3b310b,_0x3b310b,_0x3b310b);}}else{_0x1cdfc3=_[_0xb147('0x63')](_0x53a9af,[_0xb147('0x2d'),_0xb147('0x6d')]);_0x132d83['field']='ContactId';_0x758762=as[_0xb147('0x6e')](_0x454b13,_0x1cdfc3[_0xb147('0x40')],_0x132d83);_0x153d0c[_0x598666](_0x758762['text'],_0x758762['value'][_0xb147('0x6f')],_0x758762[_0xb147('0x69')][_0xb147('0x70')]);}break;case'Tag':var _0xe2d085=_0x132d83[_0xb147('0x69')][_0xb147('0x6a')](',')[_0xb147('0x30')](function(_0x9f1298){return Number(_0x9f1298);});_0xe2d085['forEach'](function(_0x23b6b6){_0x2c031f['or'](_0xb147('0x71'),'%,'+_0x23b6b6+',%');});_0x4dde95=_['union'](_0x4dde95,_0xe2d085);break;case _0xb147('0x72'):if(_0x132d83[_0xb147('0x67')]===_0xb147('0x68')){_0x153d0c[_0x598666](_0xb147('0x73'),'%'+_0x132d83['value']+'%',null);}else{_0x1cdfc3=_[_0xb147('0x63')](_0x53a9af,[_0xb147('0x2d'),'UserId']);_0x132d83[_0xb147('0x4e')]='UserId';_0x758762=as[_0xb147('0x6e')](_0x454b13,_0x1cdfc3[_0xb147('0x40')],_0x132d83);_0x153d0c[_0x598666](_0x758762[_0xb147('0x74')],_0x758762['value'][_0xb147('0x6f')],_0x758762[_0xb147('0x69')]['end']);}break;case _0xb147('0x75'):_0x758762=as[_0xb147('0x6e')]('me',null,_0x132d83);_0x153d0c[_0x598666](_0x758762['text'],_0x758762[_0xb147('0x69')]['start'],_0x758762[_0xb147('0x69')][_0xb147('0x70')]);break;}}else{var _0x758762=as[_0xb147('0x6e')](_0x454b13,_0x1cdfc3[_0xb147('0x40')],_0x132d83);_0x153d0c[_0x598666](_0x758762['text'],_0x758762[_0xb147('0x69')]['start'],_0x758762[_0xb147('0x69')][_0xb147('0x70')]);}}}else{var _0x1d3fb8=_(_0xcbe3d8[_0xb147('0x41')])['keys']()[_0xb147('0x30')](function(_0x130851){return _[_0xb147('0x76')](_0x53a9af,['name',_0x130851])?_0x130851:undefined;})[_0xb147('0x77')]()[_0xb147('0x69')]();if(!_['isEmpty'](_0x1d3fb8)){_0x1d3fb8[_0xb147('0x34')](function(_0x2bc948){if(_0x2bc948===_0xb147('0x78')){_0x5a2472['where'](_0xb147('0x79'),[][_0xb147('0x7a')](_0xcbe3d8[_0xb147('0x41')][_0x2bc948]));}else if(_0x2bc948==='createdAt'){var _0x222b5a=JSON['parse'](_0xcbe3d8['query'][_0x2bc948])[_0xb147('0x7b')];var _0x31f9ee=JSON[_0xb147('0x7c')](_0xcbe3d8[_0xb147('0x41')][_0x2bc948])['$lte'];_0x5a2472[_0xb147('0x7d')](_0xb147('0x7e'),_0x222b5a,_0x31f9ee);}else{if(_0xcbe3d8['query'][_0x2bc948]===_0xb147('0x7f')){_0x5a2472['where']('i.'+_0x2bc948+_0xb147('0x80'));}else{_0x5a2472['where']('i.'+_0x2bc948+_0xb147('0x81'),_0xcbe3d8['query'][_0x2bc948]);}}});}if(_0xcbe3d8['query']['read']){if(_0xcbe3d8[_0xb147('0x41')][_0xb147('0x82')]==0x1){_0x5a2472[_0xb147('0x65')](_0xb147('0x83'));}else{_0x5a2472[_0xb147('0x65')](_0xb147('0x84'));}}if(_0xcbe3d8[_0xb147('0x41')]['tag']){_0x4dde95=_[_0xb147('0x85')](_0xcbe3d8[_0xb147('0x41')][_0xb147('0x86')])?_0xcbe3d8[_0xb147('0x41')]['tag']:new Array(_0xcbe3d8[_0xb147('0x41')][_0xb147('0x86')]);_0x4dde95[_0xb147('0x34')](function(_0x1b6698){_0x2c031f['or'](_0xb147('0x71'),'%,'+_0x1b6698+',%');});}if(_0xcbe3d8[_0xb147('0x41')]['filter']){var _0x215602=_0xcbe3d8['query'][_0xb147('0x87')][_0xb147('0x88')]('\x5c','\x5c\x5c')[_0xb147('0x88')](/'/g,'\x27\x27');if(qs[_0xb147('0x89')](_0x215602)){_0x153d0c['or'](_0xb147('0x8a'),_0x215602+'%')['or'](_0xb147('0x8b'),_0x215602+'%');}else{_0x153d0c['or'](_0xb147('0x8c'),qs[_0xb147('0x6c')](_0x215602))['or'](_0xb147('0x8d'),_0x215602+'%');}}}_0x5a2472[_0xb147('0x7d')](_0x153d0c);_0x5a2472[_0xb147('0x8e')](_0xb147('0x8f'));var _0x5afcef={'type':db['Sequelize'][_0xb147('0x90')][_0xb147('0x91')],'raw':!![]};var _0x909e4d=_0x5a2472[_0xb147('0x92')]();_0x909e4d[_0xb147('0x4e')]('i.id');_0x909e4d[_0xb147('0x4e')](_0xb147('0x93'),_0xb147('0x64'));if(_0x46cc57['order']){_0x46cc57[_0xb147('0x4a')][_0xb147('0x34')](function(_0x20479c){var _0x12d56f=_0x20479c[0x0]===_0xb147('0x94')?_0x20479c[0x0]:'i.'+_0x20479c[0x0];_0x5a2472['order'](_0x12d56f,_0x20479c[0x1]===_0xb147('0x95')?![]:!![]);});}if(!_[_0xb147('0x96')](_0x4dde95)){_0x5a2472['having'](_0x2c031f);_0x909e4d[_0xb147('0x7d')]('t.id\x20IN\x20?',_0x4dde95);}BPromise[_0xb147('0x97')]()[_0xb147('0x2a')](function(){if(!_0xf0ade0){if(_0xcbe3d8[_0xb147('0x41')][_0xb147('0x78')])return;_0x909e4d['where'](_0xb147('0x98'));_0x5a2472[_0xb147('0x7d')](_0xb147('0x98'));return;}if(_0xcbe3d8[_0xb147('0x99')][_0xb147('0x9a')]!==_0xb147('0x9b'))return;return _0xcbe3d8[_0xb147('0x99')][_0xb147('0x9c')]({'attributes':['id'],'raw':!![]})[_0xb147('0x2a')](function(_0x16a0d9){if(_[_0xb147('0x96')](_0x16a0d9)){_0x909e4d[_0xb147('0x7d')](_0xb147('0x9d'));_0x5a2472[_0xb147('0x7d')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x909e4d[_0xb147('0x7d')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb147('0x30')](_0x16a0d9,'id'));_0x5a2472[_0xb147('0x7d')](_0xb147('0x79'),_[_0xb147('0x30')](_0x16a0d9,'id'));}});})[_0xb147('0x2a')](function(){if(_0xcbe3d8['user'][_0xb147('0x9a')]===_0xb147('0x9b')&&!_0xf0ade0&&!_0xcbe3d8[_0xb147('0x41')][_0xb147('0x78')])return[];return db[_0xb147('0x9e')]['query'](_0x909e4d['toString'](),_0x5afcef);})[_0xb147('0x2a')](function(_0x39dc9d){_0x2fc312['count']=_0x39dc9d['length'];if(_0x2fc312[_0xb147('0x21')]===0x0)return[];return db[_0xb147('0x9e')][_0xb147('0x41')](_0x17975d[_0xb147('0x9f')](),_0x5afcef)['then'](function(_0x19c2e0){_0x1d679e=_[_0xb147('0xa0')](_0x19c2e0,'id');_0x5afcef=_[_0xb147('0xa1')](_0x5afcef,{'model':db[_0xb147('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xcbe3d8['query'][_0xb147('0x47')]){_0x46cc57['attributes']['forEach'](function(_0x3508e4){_0x5a2472[_0xb147('0x4e')]('i.'+_0x3508e4);});}else{_0x5a2472[_0xb147('0x4e')](_0xb147('0x93'),'unreadMessages');_0x5a2472[_0xb147('0x4e')](_0xb147('0xa2'),_0xb147('0xa3'));_0x5a2472['field'](_0xb147('0xa4'),_0xb147('0xa5'));_0x5a2472[_0xb147('0x4e')](_0xb147('0xa6'),_0xb147('0x94'));_0x5a2472['field'](_0xb147('0xa7'));_0x5a2472[_0xb147('0x4e')](_0xb147('0xa8'),'Contact.firstName');_0x5a2472[_0xb147('0x4e')](_0xb147('0xa9'),'Contact.lastName');_0x5a2472[_0xb147('0x4e')](_0xb147('0xaa'),_0xb147('0xab'));_0x5a2472[_0xb147('0x4e')](_0xb147('0xac'),_0xb147('0xad'));_0x5a2472[_0xb147('0x4e')]('c.mobile',_0xb147('0xae'));_0x5a2472[_0xb147('0x4e')](_0xb147('0xaf'),_0xb147('0xb0'));_0x5a2472['field'](_0xb147('0xb1'),_0xb147('0xb2'));_0x5a2472['field'](_0xb147('0xb3'),_0xb147('0xb4'));_0x5a2472[_0xb147('0x4e')](_0xb147('0xb5'),'TagIds');}if(_0x46cc57[_0xb147('0x22')])_0x5a2472['limit'](_0x46cc57[_0xb147('0x22')]);if(_0x46cc57[_0xb147('0x20')])_0x5a2472[_0xb147('0x20')](_0x46cc57[_0xb147('0x20')]);return db[_0xb147('0x9e')][_0xb147('0x41')](_0x5a2472[_0xb147('0x9f')](),_0x5afcef);})[_0xb147('0x2a')](function(_0x25cdef){if(_0x25cdef[_0xb147('0x48')]>0x0)_0x31e2b3['where'](_0xb147('0xb6'),_[_0xb147('0x30')](_0x25cdef,'id'));return db[_0xb147('0x9e')][_0xb147('0x41')](_0x31e2b3['toString'](),_0x5afcef)[_0xb147('0x2a')](function(_0x5eb326){var _0x43bd76=_[_0xb147('0xb7')](_0x5eb326,'WhatsappInteractionId');var _0x38ebad=[];_0x25cdef['forEach'](function(_0x1f80fe){_0x38ebad[_0xb147('0x35')](updateWhatsappInteraction(_0x1f80fe,_0x1d679e,_0x43bd76));});return BPromise[_0xb147('0xb8')](_0x38ebad);});});})['then'](function(_0x4ea515){_0x2fc312[_0xb147('0xb9')]=_0x4ea515;return _0x2fc312;})['then'](respondWithFilteredResult(_0x5443f4,_0x46cc57))[_0xb147('0x36')](handleError(_0x5443f4,null));};exports[_0xb147('0xba')]=function(_0x2a95a4,_0x5130d1){var _0x595a3b={'raw':![],'where':{'id':_0x2a95a4['params']['id']}},_0x2ac52d={};_0x2ac52d['model']=_[_0xb147('0x42')](db[_0xb147('0x3f')][_0xb147('0xbb')]);_0x2ac52d[_0xb147('0x41')]=_[_0xb147('0x42')](_0x2a95a4[_0xb147('0x41')]);_0x2ac52d[_0xb147('0x43')]=_['intersection'](_0x2ac52d['model'],_0x2ac52d['query']);_0x595a3b[_0xb147('0x45')]=_[_0xb147('0x46')](_0x2ac52d[_0xb147('0x44')],qs[_0xb147('0x47')](_0x2a95a4[_0xb147('0x41')][_0xb147('0x47')]));_0x595a3b['attributes']=_0x595a3b['attributes']['length']?_0x595a3b['attributes']:_0x2ac52d['model'];if(_0x2a95a4[_0xb147('0x41')]['includeAll']){_0x595a3b[_0xb147('0xbc')]=[{'all':!![]}];}_0x595a3b=_['merge']({},_0x595a3b,_0x2a95a4['options']);return db['WhatsappInteraction']['find'](_0x595a3b)['then'](handleEntityNotFound(_0x5130d1,null))[_0xb147('0x2a')](respondWithResult(_0x5130d1,null))['catch'](handleError(_0x5130d1,null));};exports[_0xb147('0xbd')]=function(_0x2f73bb,_0x7df2a6){return db[_0xb147('0x3f')][_0xb147('0xbd')](_0x2f73bb['body'],{})[_0xb147('0x2a')](respondWithResult(_0x7df2a6,0xc9))['catch'](handleError(_0x7df2a6,null));};exports[_0xb147('0x28')]=function(_0x1d5a86,_0x403d36){if(_0x1d5a86[_0xb147('0x75')]['id']){delete _0x1d5a86[_0xb147('0x75')]['id'];}return db[_0xb147('0x3f')][_0xb147('0x63')]({'where':{'id':_0x1d5a86[_0xb147('0xbe')]['id']}})[_0xb147('0x2a')](handleEntityNotFound(_0x403d36,null))[_0xb147('0x2a')](saveUpdates(_0x1d5a86[_0xb147('0x75')],null))[_0xb147('0x2a')](respondWithResult(_0x403d36,null))['catch'](handleError(_0x403d36,null));};exports[_0xb147('0x29')]=function(_0x405365,_0x14ed39){return db[_0xb147('0x3f')][_0xb147('0x63')]({'where':{'id':_0x405365[_0xb147('0xbe')]['id']}})[_0xb147('0x2a')](handleEntityNotFound(_0x14ed39,null))['then'](removeEntity(_0x14ed39,null))[_0xb147('0x36')](handleError(_0x14ed39,null));};exports[_0xb147('0xbf')]=function(_0x1c1427,_0x5edbf4){return db[_0xb147('0x3f')][_0xb147('0xbf')]()[_0xb147('0x2a')](respondWithResult(_0x5edbf4,null))[_0xb147('0x36')](handleError(_0x5edbf4,null));};exports[_0xb147('0xc0')]=function(_0x2b4b2f,_0x511d5f,_0x5c81c1){return db[_0xb147('0xc1')][_0xb147('0x63')]({'where':{'id':_0x2b4b2f[_0xb147('0xbe')]['id']}})[_0xb147('0x2a')](handleEntityNotFound(_0x511d5f,null))['then'](function(_0x54c80b){if(_0x54c80b){return _0x54c80b[_0xb147('0xc0')](_0x2b4b2f[_0xb147('0x75')][_0xb147('0xc2')],_['omit'](_0x2b4b2f[_0xb147('0x75')],[_0xb147('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x511d5f,null))[_0xb147('0x36')](handleError(_0x511d5f,null));};exports[_0xb147('0xc3')]=function(_0x20faa3,_0x40c959,_0x1bd0df){var _0x57cd8a={'raw':![],'where':{}};var _0x779149={};var _0x4988e5={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb147('0xc4')]({'where':{'id':_0x20faa3['params']['id']}})['then'](handleEntityNotFound(_0x40c959,null))[_0xb147('0x2a')](function(_0x5a0b86){if(_0x5a0b86){_0x779149[_0xb147('0x44')]=_[_0xb147('0x42')](db[_0xb147('0xc1')][_0xb147('0xbb')]);_0x779149[_0xb147('0x41')]=_[_0xb147('0x42')](_0x20faa3['query']);_0x779149[_0xb147('0x43')]=_['intersection'](_0x779149[_0xb147('0x44')],_0x779149[_0xb147('0x41')]);_0x57cd8a['attributes']=_[_0xb147('0x46')](_0x779149[_0xb147('0x44')],qs[_0xb147('0x47')](_0x20faa3['query'][_0xb147('0x47')]));_0x57cd8a[_0xb147('0x45')]=_0x57cd8a[_0xb147('0x45')][_0xb147('0x48')]?_0x57cd8a[_0xb147('0x45')]:_0x779149[_0xb147('0x44')];if(!_0x20faa3[_0xb147('0x41')][_0xb147('0x49')](_0xb147('0xc5'))){_0x57cd8a[_0xb147('0x22')]=qs[_0xb147('0x22')](_0x20faa3[_0xb147('0x41')][_0xb147('0x22')]);_0x57cd8a[_0xb147('0x20')]=qs[_0xb147('0x20')](_0x20faa3[_0xb147('0x41')]['offset']);}_0x57cd8a[_0xb147('0x4a')]=qs[_0xb147('0x4b')](_0x20faa3[_0xb147('0x41')][_0xb147('0x4b')]);_0x57cd8a[_0xb147('0x7d')]=qs['filters'](_[_0xb147('0x4c')](_0x20faa3[_0xb147('0x41')],_0x779149[_0xb147('0x43')]));_0x57cd8a['where'][_0xb147('0xc6')]=_0x5a0b86['id'];if(_0x20faa3[_0xb147('0x41')]['filter']){_0x57cd8a[_0xb147('0x7d')]=_[_0xb147('0xa1')](_0x57cd8a[_0xb147('0x7d')],{'$or':_[_0xb147('0x30')](_0x57cd8a['attributes'],function(_0xab3d07){var _0x495ca0={};_0x495ca0[_0xab3d07]={'$like':'%'+_0x20faa3[_0xb147('0x41')][_0xb147('0x87')]+'%'};return _0x495ca0;})});}if(_0x20faa3[_0xb147('0x41')]['$gte']){var _0x5293e9=_0x20faa3[_0xb147('0x41')][_0xb147('0x7b')]['split'](',');var _0x2efd0a={};_0x2efd0a[_0x5293e9[0x0]]={'$gte':moment(_0x5293e9[0x1])['format'](_0xb147('0xc7'))};_0x57cd8a[_0xb147('0x7d')]=_[_0xb147('0xa1')](_0x57cd8a[_0xb147('0x7d')],_0x2efd0a);}_0x57cd8a=_['merge']({},_0x57cd8a,_0x20faa3[_0xb147('0xc8')]);return db[_0xb147('0xc1')]['count']({'where':_0x57cd8a[_0xb147('0x7d')]})[_0xb147('0x2a')](function(_0x1a8aa5){_0x4988e5['count']=_0x1a8aa5;if(_0x20faa3['query'][_0xb147('0xc9')]){_0x57cd8a[_0xb147('0xbc')]=[{'all':!![]}];}return db[_0xb147('0xc1')][_0xb147('0xca')](_0x57cd8a);})[_0xb147('0x2a')](function(_0x5182a2){_0x4988e5[_0xb147('0xb9')]=_0x5182a2;return _0x4988e5;});}})[_0xb147('0x2a')](respondWithFilteredResult(_0x40c959,_0x57cd8a))[_0xb147('0x36')](handleError(_0x40c959,null));};exports[_0xb147('0xcb')]=function(_0x98066c,_0xb27159,_0x3bc737){return db[_0xb147('0x3f')][_0xb147('0x63')]({'where':{'id':_0x98066c[_0xb147('0xbe')]['id']}})['then'](handleEntityNotFound(_0xb27159,null))[_0xb147('0x2a')](function(_0x6f3baa){if(_0x6f3baa){return _0x6f3baa[_0xb147('0xcc')](_0x98066c[_0xb147('0x75')][_0xb147('0xc2')],_[_0xb147('0xcd')](_0x98066c[_0xb147('0x75')],['ids','id'])||{})[_0xb147('0xce')](function(){return db[_0xb147('0xcf')][_0xb147('0xca')]({'attributes':['id',_0xb147('0x2d'),_0xb147('0x4f')],'where':{'id':_0x98066c[_0xb147('0x75')][_0xb147('0xc2')]}});})[_0xb147('0x2a')](function(_0x306c91){socket[_0xb147('0xd0')](_0xb147('0xd1'),{'id':Number(_0x98066c[_0xb147('0xbe')]['id']),'tags':_0x306c91||[]});return{'id':Number(_0x98066c[_0xb147('0xbe')]['id']),'tags':_0x306c91||[]};});}})['then'](respondWithResult(_0xb27159,null))[_0xb147('0x36')](handleError(_0xb27159,null));};exports['removeTags']=function(_0x294b46,_0x2e3c77,_0x2ae606){return db[_0xb147('0x3f')][_0xb147('0x63')]({'where':{'id':_0x294b46[_0xb147('0xbe')]['id']}})[_0xb147('0x2a')](handleEntityNotFound(_0x2e3c77,null))[_0xb147('0x2a')](function(_0x13ce83){if(_0x13ce83){return _0x13ce83[_0xb147('0xd2')](_0x294b46[_0xb147('0x41')][_0xb147('0xc2')]);}})[_0xb147('0x2a')](respondWithStatusCode(_0x2e3c77,null))[_0xb147('0x36')](handleError(_0x2e3c77,null));};exports[_0xb147('0xd3')]=function(_0x2d2e96,_0x4903ab){var _0x535a5f=moment()[_0xb147('0xd4')]()['toString']();var _0x5ee54c=path[_0xb147('0xd5')](config['root'],_0xb147('0xd6'),_0xb147('0xd7'),_0xb147('0xd8'));var _0x159409=path[_0xb147('0xd5')](config[_0xb147('0xd9')],_0xb147('0xd6'),_0xb147('0xd7'),'attachments');var _0x2c5eea=path[_0xb147('0xd5')](_0x5ee54c,_0x535a5f);var _0x1eee30=util[_0xb147('0xda')](_0xb147('0xdb'),_0x2d2e96[_0xb147('0xbe')]['id'],_0x535a5f);var _0x403a85=path['join'](_0x5ee54c,_0x1eee30);var _0x5d54e1=[];_0x5d54e1[_0xb147('0x35')]({'model':db[_0xb147('0x72')],'as':_0xb147('0x72'),'attributes':['id',_0xb147('0x31')],'raw':!![]});_0x5d54e1[_0xb147('0x35')]({'model':db[_0xb147('0xdc')],'as':_0xb147('0x66'),'attributes':['id',_0xb147('0xdd'),'lastName'],'raw':!![]});if(_0x2d2e96[_0xb147('0x41')]['attachments']){_0x5d54e1['push']({'model':db[_0xb147('0xde')],'as':_0xb147('0xde'),'raw':!![]});}var _0x45ba88=[{'model':db[_0xb147('0xc1')],'as':_0xb147('0xdf'),'attributes':['id','body','createdAt',_0xb147('0xe0'),'secret',_0xb147('0x82')],'include':_0x5d54e1}];_0x45ba88[_0xb147('0x35')]({'model':db[_0xb147('0xe1')],'as':_0xb147('0xe2'),'attributes':['id','name']});_0x45ba88[_0xb147('0x35')]({'model':db['User'],'as':_0xb147('0xe3'),'attributes':['id',_0xb147('0x31')]});return db['WhatsappInteraction'][_0xb147('0x63')]({'where':{'id':_0x2d2e96[_0xb147('0xbe')]['id']},'include':_0x45ba88})[_0xb147('0x2a')](handleEntityNotFound(_0x4903ab,null))['then'](function(_0x2b5775){if(_0x2b5775){var _0x109f71=_0x2b5775[_0xb147('0xe4')]({'plain':!![]});fs['mkdirSync'](_0x2c5eea);var _0x597411={'channel':'Whatsapp','account':_0x109f71['Account']['name'],'agent':_0x109f71[_0xb147('0xe3')]?_0x109f71[_0xb147('0xe3')][_0xb147('0x31')]:_0xb147('0xe5'),'createdAt':moment(_0x109f71[_0xb147('0xe6')])['format'](_0xb147('0xc7'))[_0xb147('0x9f')](),'closedAt':_0x109f71['closed']?moment(_0x109f71[_0xb147('0xe7')])[_0xb147('0xda')](_0xb147('0xc7'))['toString']():'','disposition':_0x109f71['disposition'],'messages':_(_0x109f71[_0xb147('0xdf')])[_0xb147('0x87')]({'secret':![]})[_0xb147('0x30')](function(_0x11a51f){if(_0x11a51f[_0xb147('0xde')]){var _0x2dbc4e=path[_0xb147('0xd5')](_0x159409,_0x11a51f[_0xb147('0xde')]['basename']);if(fs[_0xb147('0xe8')](_0x2dbc4e)){fs[_0xb147('0xe9')](_0x2dbc4e)[_0xb147('0xea')](fs[_0xb147('0xeb')](path['join'](_0x2c5eea,_0x11a51f['Attachment'][_0xb147('0xec')])));}}return{'date':moment(_0x11a51f['createdAt'])['format'](_0xb147('0xc7'))[_0xb147('0x9f')](),'sender':_0x11a51f[_0xb147('0xe0')]===_0xb147('0xed')?_0x11a51f[_0xb147('0x72')]?_0x11a51f[_0xb147('0x72')]['fullname']:_0xb147('0xee'):_0x11a51f['Contact'][_0xb147('0xdd')]+(_0x11a51f[_0xb147('0x66')][_0xb147('0xef')]?'\x20'+_0x11a51f['Contact'][_0xb147('0xef')]:''),'body':_0x11a51f['Attachment']?_0x11a51f[_0xb147('0xde')][_0xb147('0xec')]:_0x11a51f[_0xb147('0x75')],'direction':_0x11a51f['direction']===_0xb147('0xed')?'A':'C','secret':_0x11a51f[_0xb147('0xf0')],'read':_0x11a51f[_0xb147('0x82')],'attachment':_0x11a51f['Attachment']};})[_0xb147('0x69')]()};return ejs[_0xb147('0xf1')](path[_0xb147('0xd5')](config[_0xb147('0xd9')],'server','views',_0xb147('0xf2')),{'interaction':_0x597411})[_0xb147('0x2a')](function(_0x46708a){var _0x597ed8=path[_0xb147('0xd5')](_0x2c5eea,_0xb147('0xf3')+_0x109f71['id']+'-'+_0x535a5f+_0xb147('0xf4'));var _0x15009c={'path':_0x597ed8,'channel':_0xb147('0xf5'),'interactionId':_0x109f71['id']};return pdf[_0xb147('0xf6')](_0x46708a,_0x15009c);})['then'](function(){return new BPromise(function(_0x35c708,_0x3b40db){zipdir(_0x2c5eea,{'saveTo':_0x403a85},function(_0x1ee83c,_0x8857c3){if(_0x1ee83c)return _0x3b40db(_0x1ee83c);return _0x35c708(_0x8857c3);});})[_0xb147('0x2a')](function(){return new BPromise(function(_0x2f5a44,_0x46343d){rimraf(_0x2c5eea,function(_0xe2855c){if(_0xe2855c)_0x46343d(_0xe2855c);return _0x2f5a44();});});})[_0xb147('0x2a')](function(){return _0x4903ab[_0xb147('0xd3')](_0x403a85,_0x1eee30,function(_0x289070){if(_0x289070){console[_0xb147('0xf7')](_0xb147('0xf8'),_0x289070);}else{fs[_0xb147('0xf9')](_0x403a85);}});});});}else{return _0x4903ab['sendStatus'](0xc8);}})['catch'](handleError(_0x4903ab,null));}; \ No newline at end of file +var _0x7916=['Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','Tag','download','unix','join','server','files','root','attachments','CmContact','lastName','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','format','closedAt','disposition','Messages','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','status','stack','name','send','Users','fullname','TagIds','Tags','forEach','push','then','catch','waiting','answered','closed','UserId','talking','unmanaged','total','index','map','WhatsappInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','from','tools_tags','u.fullname','ui.WhatsappInteractionId','left_join','users','whatsapp_interactions','cm_contacts','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','find','having','`\x20>\x200','Contact','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge'];(function(_0x325e4d,_0x511630){var _0x202a36=function(_0x4f61c3){while(--_0x4f61c3){_0x325e4d['push'](_0x325e4d['shift']());}};_0x202a36(++_0x511630);}(_0x7916,0x128));var _0x6791=function(_0x2dd75b,_0x66bfdc){_0x2dd75b=_0x2dd75b-0x0;var _0x2a5ea2=_0x7916[_0x2dd75b];return _0x2a5ea2;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x6791('0x11'));var logger=require(_0x6791('0x12'))(_0x6791('0x13'));var utils=require(_0x6791('0x14'));var config=require(_0x6791('0x15'));var licenseUtil=require(_0x6791('0x16'));var db=require(_0x6791('0x17'))['db'];config[_0x6791('0x18')]=_[_0x6791('0x19')](config[_0x6791('0x18')],{'host':_0x6791('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6791('0x1b'))['register'](socket);function respondWithStatusCode(_0x2a9151,_0x4c32a1){_0x4c32a1=_0x4c32a1||0xcc;return function(_0x3be9f0){if(_0x3be9f0){return _0x2a9151[_0x6791('0x1c')](_0x4c32a1);}return _0x2a9151['status'](_0x4c32a1)[_0x6791('0x1d')]();};}function respondWithResult(_0x4b80ed,_0x3856ac){_0x3856ac=_0x3856ac||0xc8;return function(_0x150d1f){if(_0x150d1f){return _0x4b80ed['status'](_0x3856ac)[_0x6791('0x1e')](_0x150d1f);}};}function respondWithFilteredResult(_0x36d7a1,_0x5bec14){return function(_0x1872f5){if(_0x1872f5){var _0x4d8a79=typeof _0x5bec14[_0x6791('0x1f')]===_0x6791('0x20')&&typeof _0x5bec14[_0x6791('0x21')]===_0x6791('0x20');var _0x25adbc=_0x1872f5[_0x6791('0x22')];var _0x2ba11a=_0x4d8a79?0x0:_0x5bec14['offset'];var _0x4a2922=_0x4d8a79?_0x1872f5[_0x6791('0x22')]:_0x5bec14['offset']+_0x5bec14[_0x6791('0x21')];var _0x3b57f0;if(_0x4a2922>=_0x25adbc){_0x4a2922=_0x25adbc;_0x3b57f0=0xc8;}else{_0x3b57f0=0xce;}_0x36d7a1['status'](_0x3b57f0);return _0x36d7a1[_0x6791('0x23')](_0x6791('0x24'),_0x2ba11a+'-'+_0x4a2922+'/'+_0x25adbc)[_0x6791('0x1e')](_0x1872f5);}return null;};}function patchUpdates(_0x12d83b){return function(_0x56ad28){try{jsonpatch[_0x6791('0x25')](_0x56ad28,_0x12d83b,!![]);}catch(_0x1b516d){return BPromise['reject'](_0x1b516d);}return _0x56ad28['save']();};}function saveUpdates(_0x4b23bc,_0x372dae){return function(_0x502043){if(_0x502043){return _0x502043[_0x6791('0x26')](_0x4b23bc)['then'](function(_0x54a092){return _0x54a092;});}return null;};}function removeEntity(_0x496273,_0x5cadc){return function(_0x23442e){if(_0x23442e){return _0x23442e[_0x6791('0x27')]()['then'](function(){_0x496273[_0x6791('0x28')](0xcc)[_0x6791('0x1d')]();});}};}function handleEntityNotFound(_0x493a59,_0x342107){return function(_0x5cbb79){if(!_0x5cbb79){_0x493a59[_0x6791('0x1c')](0x194);}return _0x5cbb79;};}function handleError(_0x49dd24,_0x4fc5d5){_0x4fc5d5=_0x4fc5d5||0x1f4;return function(_0x270a1d){logger['error'](_0x270a1d[_0x6791('0x29')]);if(_0x270a1d[_0x6791('0x2a')]){delete _0x270a1d['name'];}_0x49dd24[_0x6791('0x28')](_0x4fc5d5)[_0x6791('0x2b')](_0x270a1d);};}function getInteractionUsers(_0x234c5e,_0xd36448){return new BPromise(function(_0x5d9d54,_0x4f91d6){try{if(_0xd36448[_0x234c5e['id']]){_0x234c5e[_0x6791('0x2c')]=_['map'](_0xd36448[_0x234c5e['id']],function(_0x3ddbee){return{'id':_0x3ddbee['id'],'fullname':_0x3ddbee[_0x6791('0x2d')]};});}}catch(_0x30397e){_0x4f91d6(_0x30397e);}_0x5d9d54(_0x234c5e);});}function getInteractionTags(_0x2b98b8,_0x1d551b){return new BPromise(function(_0x127bfa,_0x8e2101){try{if(_0x2b98b8[_0x6791('0x2e')]){_0x2b98b8[_0x6791('0x2f')]=[];_0x2b98b8[_0x6791('0x2e')]['split'](',')[_0x6791('0x30')](function(_0x3b971d){_0x2b98b8[_0x6791('0x2f')][_0x6791('0x31')](_0x1d551b[_0x3b971d]);});}delete _0x2b98b8[_0x6791('0x2e')];}catch(_0x36f673){_0x8e2101(_0x36f673);}_0x127bfa(_0x2b98b8);});}function updateWhatsappInteraction(_0x5c437f,_0x4a304f,_0x551357){return new BPromise(function(_0x1de770,_0x21a9cf){return getInteractionUsers(_0x5c437f,_0x551357)[_0x6791('0x32')](function(_0x549636){return getInteractionTags(_0x549636,_0x4a304f);})['then'](function(_0x46631a){return getStateInteraction(_0x46631a);})[_0x6791('0x32')](function(_0x31a525){_0x1de770(_0x31a525);})[_0x6791('0x33')](function(_0x50db2b){_0x21a9cf(_0x50db2b);});});}function getStateInteraction(_0x4430cf){return new BPromise(function(_0xee6b68){_0x4430cf[_0x6791('0x34')]=0x0;_0x4430cf['talking']=0x0;_0x4430cf[_0x6791('0x35')]=0x0;_0x4430cf['unmanaged']=0x0;_0x4430cf['total']=0x0;if(!_0x4430cf[_0x6791('0x36')]&&!_0x4430cf[_0x6791('0x37')]){_0x4430cf['waiting']+=0x1;}if(!_0x4430cf[_0x6791('0x36')]&&_0x4430cf[_0x6791('0x37')]){_0x4430cf[_0x6791('0x38')]+=0x1;if(_0x4430cf[_0x6791('0x34')]){_0x4430cf[_0x6791('0x34')]-=0x1;}}if(_0x4430cf['closed']&&_0x4430cf[_0x6791('0x37')]){_0x4430cf[_0x6791('0x35')]+=0x1;if(_0x4430cf[_0x6791('0x38')]){_0x4430cf['talking']-=0x1;}}if(_0x4430cf[_0x6791('0x36')]&&!_0x4430cf[_0x6791('0x37')]){_0x4430cf[_0x6791('0x39')]+=0x1;if(_0x4430cf['waiting']){_0x4430cf[_0x6791('0x34')]-=0x1;}}_0x4430cf[_0x6791('0x3a')]+=0x1;_0xee6b68(_0x4430cf);});}exports[_0x6791('0x3b')]=function(_0x122aa5,_0x593fda){var _0x18c478={},_0x1a4b64={},_0x3e95b6={'count':0x0,'rows':[]};var _0xd0f1c=_[_0x6791('0x3c')](db[_0x6791('0x3d')][_0x6791('0x3e')],function(_0xae0e07){return{'name':_0xae0e07[_0x6791('0x3f')],'type':_0xae0e07['type']['key']};});_0x1a4b64[_0x6791('0x40')]=_[_0x6791('0x3c')](_0xd0f1c,'name');_0x1a4b64[_0x6791('0x41')]=_[_0x6791('0x42')](_0x122aa5[_0x6791('0x41')]);_0x1a4b64[_0x6791('0x43')]=_[_0x6791('0x44')](_0x1a4b64[_0x6791('0x40')],_0x1a4b64[_0x6791('0x41')]);_0x18c478['attributes']=_[_0x6791('0x44')](_0x1a4b64['model'],qs[_0x6791('0x45')](_0x122aa5[_0x6791('0x41')][_0x6791('0x45')]));_0x18c478[_0x6791('0x46')]=_0x18c478['attributes'][_0x6791('0x47')]?_0x18c478[_0x6791('0x46')]:_0x1a4b64[_0x6791('0x40')];if(!_0x122aa5[_0x6791('0x41')][_0x6791('0x48')](_0x6791('0x49'))){_0x18c478[_0x6791('0x21')]=qs[_0x6791('0x21')](_0x122aa5['query'][_0x6791('0x21')]);_0x18c478[_0x6791('0x1f')]=qs[_0x6791('0x1f')](_0x122aa5[_0x6791('0x41')]['offset']);}_0x18c478[_0x6791('0x4a')]=qs[_0x6791('0x4b')](_0x122aa5['query'][_0x6791('0x4b')]);_0x18c478['where']=qs[_0x6791('0x43')](_[_0x6791('0x4c')](_0x122aa5[_0x6791('0x41')],_0x1a4b64[_0x6791('0x43')]),_0xd0f1c);var _0x18d405=[];var _0xb2a2=squel[_0x6791('0x4d')]()[_0x6791('0x4e')]('id')[_0x6791('0x4e')]('name')[_0x6791('0x4e')]('color')[_0x6791('0x4f')](_0x6791('0x50'));var _0x276002=squel[_0x6791('0x4d')]()[_0x6791('0x4e')]('u.id')[_0x6791('0x4e')](_0x6791('0x51'))[_0x6791('0x4e')](_0x6791('0x52'))[_0x6791('0x4f')]('user_has_whatsapp_interactions','ui')[_0x6791('0x53')](_0x6791('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x3df699=squel['select']()[_0x6791('0x4f')](_0x6791('0x55'),'i')[_0x6791('0x53')](_0x6791('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6791('0x53')](_0x6791('0x54'),'o','o.id\x20=\x20i.UserId')[_0x6791('0x53')](_0x6791('0x57'),'a',_0x6791('0x58'))['left_join'](_0x6791('0x59'),'me',_0x6791('0x5a'))['left_join'](_0x6791('0x5b'),'it',_0x6791('0x5c'))['left_join'](_0x6791('0x50'),'t',_0x6791('0x5d'));var _0x1b0bb1=squel[_0x6791('0x5e')]();var _0x582d50=[];var _0x3c1076=squel[_0x6791('0x5e')]();var _0x32f36b;if(_0x122aa5['query']['search']){_0x32f36b=as[_0x6791('0x5f')](_0x122aa5[_0x6791('0x41')][_0x6791('0x60')]);var _0x45756f=_0x32f36b[_0x6791('0x61')];for(var _0x53b651=0x0;_0x53b651<_0x32f36b['conditions'][_0x6791('0x47')];_0x53b651++){var _0x544687=_0x32f36b['conditions'][_0x53b651];var _0x8fc04b='i';var _0x25b65f=_[_0x6791('0x62')](_0xd0f1c,[_0x6791('0x2a'),_0x544687[_0x6791('0x4e')]]);if(!_0x25b65f){switch(_0x544687[_0x6791('0x4e')]){case'unreadMessages':if(_0x544687['value']==0x1){_0x3df699[_0x6791('0x63')]('`'+_0x544687[_0x6791('0x4e')]+'`\x20=\x200');}else{_0x3df699[_0x6791('0x63')]('`'+_0x544687['field']+_0x6791('0x64'));}break;case _0x6791('0x65'):if(_0x544687['operator']===_0x6791('0x66')){if(_0x544687[_0x6791('0x67')][_0x6791('0x68')]('\x20')['length']>0x1){_0x1b0bb1[_0x45756f](_0x6791('0x69'),qs[_0x6791('0x6a')](_0x544687[_0x6791('0x67')]),null);}else{var _0x383853='%'+_0x544687[_0x6791('0x67')]+'%';_0x1b0bb1[_0x45756f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x383853,_0x383853,_0x383853);}}else{_0x25b65f=_['find'](_0xd0f1c,[_0x6791('0x2a'),_0x6791('0x6b')]);_0x544687['field']=_0x6791('0x6b');_0x2d5818=as[_0x6791('0x6c')](_0x8fc04b,_0x25b65f[_0x6791('0x6d')],_0x544687);_0x1b0bb1[_0x45756f](_0x2d5818[_0x6791('0x6e')],_0x2d5818[_0x6791('0x67')][_0x6791('0x6f')],_0x2d5818[_0x6791('0x67')][_0x6791('0x1d')]);}break;case'Tag':var _0x2c5f12=_0x544687[_0x6791('0x67')][_0x6791('0x68')](',')[_0x6791('0x3c')](function(_0x548084){return Number(_0x548084);});_0x2c5f12[_0x6791('0x30')](function(_0x10c7f3){_0x3c1076['or'](_0x6791('0x70'),'%,'+_0x10c7f3+',%');});_0x582d50=_['union'](_0x582d50,_0x2c5f12);break;case _0x6791('0x71'):if(_0x544687[_0x6791('0x72')]===_0x6791('0x66')){_0x1b0bb1[_0x45756f](_0x6791('0x73'),'%'+_0x544687['value']+'%',null);}else{_0x25b65f=_[_0x6791('0x62')](_0xd0f1c,[_0x6791('0x2a'),'UserId']);_0x544687[_0x6791('0x4e')]=_0x6791('0x37');_0x2d5818=as[_0x6791('0x6c')](_0x8fc04b,_0x25b65f[_0x6791('0x6d')],_0x544687);_0x1b0bb1[_0x45756f](_0x2d5818[_0x6791('0x6e')],_0x2d5818[_0x6791('0x67')]['start'],_0x2d5818[_0x6791('0x67')][_0x6791('0x1d')]);}break;case _0x6791('0x74'):_0x2d5818=as['buildExpression']('me',null,_0x544687);_0x1b0bb1[_0x45756f](_0x2d5818[_0x6791('0x6e')],_0x2d5818['value'][_0x6791('0x6f')],_0x2d5818[_0x6791('0x67')][_0x6791('0x1d')]);break;}}else{var _0x2d5818=as[_0x6791('0x6c')](_0x8fc04b,_0x25b65f['type'],_0x544687);_0x1b0bb1[_0x45756f](_0x2d5818[_0x6791('0x6e')],_0x2d5818[_0x6791('0x67')][_0x6791('0x6f')],_0x2d5818[_0x6791('0x67')]['end']);}}}else{var _0x96b28e=_(_0x122aa5[_0x6791('0x41')])['keys']()[_0x6791('0x3c')](function(_0x1fa44a){return _['some'](_0xd0f1c,[_0x6791('0x2a'),_0x1fa44a])?_0x1fa44a:undefined;})[_0x6791('0x75')]()[_0x6791('0x67')]();if(!_[_0x6791('0x76')](_0x96b28e)){_0x96b28e['forEach'](function(_0x35583a){if(_0x35583a===_0x6791('0x77')){_0x3df699['where'](_0x6791('0x78'),[][_0x6791('0x79')](_0x122aa5[_0x6791('0x41')][_0x35583a]));}else if(_0x35583a===_0x6791('0x7a')){var _0x3f3763=JSON['parse'](_0x122aa5[_0x6791('0x41')][_0x35583a])[_0x6791('0x7b')];var _0x58881c=JSON[_0x6791('0x7c')](_0x122aa5[_0x6791('0x41')][_0x35583a])[_0x6791('0x7d')];_0x3df699['where'](_0x6791('0x7e'),_0x3f3763,_0x58881c);}else{if(_0x122aa5[_0x6791('0x41')][_0x35583a]===_0x6791('0x7f')){_0x3df699[_0x6791('0x80')]('i.'+_0x35583a+_0x6791('0x81'));}else{_0x3df699[_0x6791('0x80')]('i.'+_0x35583a+_0x6791('0x82'),_0x122aa5[_0x6791('0x41')][_0x35583a]);}}});}if(_0x122aa5['query'][_0x6791('0x83')]){if(_0x122aa5[_0x6791('0x41')]['read']==0x1){_0x3df699[_0x6791('0x63')](_0x6791('0x84'));}else{_0x3df699[_0x6791('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x122aa5[_0x6791('0x41')]['tag']){_0x582d50=_[_0x6791('0x85')](_0x122aa5[_0x6791('0x41')][_0x6791('0x86')])?_0x122aa5[_0x6791('0x41')][_0x6791('0x86')]:new Array(_0x122aa5[_0x6791('0x41')][_0x6791('0x86')]);_0x582d50[_0x6791('0x30')](function(_0x23e0d3){_0x3c1076['or'](_0x6791('0x70'),'%,'+_0x23e0d3+',%');});}if(_0x122aa5[_0x6791('0x41')][_0x6791('0x87')]){var _0x2b374e=_0x122aa5[_0x6791('0x41')][_0x6791('0x87')][_0x6791('0x88')]('\x5c','\x5c\x5c')[_0x6791('0x88')](/'/g,'\x27\x27');if(qs[_0x6791('0x89')](_0x2b374e)){_0x1b0bb1['or'](_0x6791('0x8a'),_0x2b374e+'%')['or']('i.phone\x20LIKE\x20?',_0x2b374e+'%');}else{_0x1b0bb1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2b374e))['or'](_0x6791('0x8b'),_0x2b374e+'%');}}}_0x3df699[_0x6791('0x80')](_0x1b0bb1);_0x3df699[_0x6791('0x8c')](_0x6791('0x8d'));var _0xa0a3ec={'type':db[_0x6791('0x8e')][_0x6791('0x8f')][_0x6791('0x90')],'raw':!![]};var _0x12f406=_0x3df699[_0x6791('0x91')]();_0x12f406[_0x6791('0x4e')](_0x6791('0x8d'));_0x12f406[_0x6791('0x4e')](_0x6791('0x92'),_0x6791('0x93'));if(_0x18c478[_0x6791('0x4a')]){_0x18c478[_0x6791('0x4a')][_0x6791('0x30')](function(_0x159544){var _0x4224b8=_0x159544[0x0]===_0x6791('0x94')?_0x159544[0x0]:'i.'+_0x159544[0x0];_0x3df699[_0x6791('0x4a')](_0x4224b8,_0x159544[0x1]===_0x6791('0x95')?![]:!![]);});}if(!_[_0x6791('0x76')](_0x582d50)){_0x3df699[_0x6791('0x63')](_0x3c1076);_0x12f406['where'](_0x6791('0x96'),_0x582d50);}BPromise['resolve']()[_0x6791('0x32')](function(){if(!_0x32f36b){if(_0x122aa5[_0x6791('0x41')]['WhatsappAccountId'])return;_0x12f406[_0x6791('0x80')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x3df699[_0x6791('0x80')](_0x6791('0x97'));return;}if(_0x122aa5['user'][_0x6791('0x98')]!==_0x6791('0x99'))return;return _0x122aa5[_0x6791('0x9a')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x6791('0x32')](function(_0x31a566){if(_[_0x6791('0x76')](_0x31a566)){_0x12f406[_0x6791('0x80')](_0x6791('0x9b'));_0x3df699[_0x6791('0x80')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x12f406[_0x6791('0x80')](_0x6791('0x78'),_[_0x6791('0x3c')](_0x31a566,'id'));_0x3df699[_0x6791('0x80')](_0x6791('0x78'),_[_0x6791('0x3c')](_0x31a566,'id'));}});})[_0x6791('0x32')](function(){if(_0x122aa5['user'][_0x6791('0x98')]==='agent'&&!_0x32f36b&&!_0x122aa5[_0x6791('0x41')]['WhatsappAccountId'])return[];return db[_0x6791('0x9c')][_0x6791('0x41')](_0x12f406[_0x6791('0x9d')](),_0xa0a3ec);})[_0x6791('0x32')](function(_0xcc3155){_0x3e95b6[_0x6791('0x22')]=_0xcc3155['length'];if(_0x3e95b6[_0x6791('0x22')]===0x0)return[];return db['sequelize'][_0x6791('0x41')](_0xb2a2['toString'](),_0xa0a3ec)['then'](function(_0x56f26e){_0x18d405=_[_0x6791('0x9e')](_0x56f26e,'id');_0xa0a3ec=_[_0x6791('0x9f')](_0xa0a3ec,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x122aa5[_0x6791('0x41')]['fields']){_0x18c478[_0x6791('0x46')][_0x6791('0x30')](function(_0x4f52c2){_0x3df699['field']('i.'+_0x4f52c2);});}else{_0x3df699['field'](_0x6791('0x92'),_0x6791('0x93'));_0x3df699[_0x6791('0x4e')]('a.key',_0x6791('0xa0'));_0x3df699[_0x6791('0x4e')](_0x6791('0xa1'),_0x6791('0xa2'));_0x3df699[_0x6791('0x4e')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x6791('0x94'));_0x3df699[_0x6791('0x4e')](_0x6791('0xa3'));_0x3df699[_0x6791('0x4e')](_0x6791('0xa4'),'Contact.firstName');_0x3df699[_0x6791('0x4e')](_0x6791('0xa5'),'Contact.lastName');_0x3df699[_0x6791('0x4e')](_0x6791('0xa6'),_0x6791('0xa7'));_0x3df699[_0x6791('0x4e')]('c.phone',_0x6791('0xa8'));_0x3df699[_0x6791('0x4e')](_0x6791('0xa9'),_0x6791('0xaa'));_0x3df699[_0x6791('0x4e')](_0x6791('0xab'),_0x6791('0xac'));_0x3df699[_0x6791('0x4e')]('o.fullname','Owner.fullname');_0x3df699[_0x6791('0x4e')](_0x6791('0xad'),_0x6791('0xae'));_0x3df699['field'](_0x6791('0xaf'),'TagIds');}if(_0x18c478[_0x6791('0x21')])_0x3df699[_0x6791('0x21')](_0x18c478['limit']);if(_0x18c478[_0x6791('0x1f')])_0x3df699[_0x6791('0x1f')](_0x18c478[_0x6791('0x1f')]);return db[_0x6791('0x9c')][_0x6791('0x41')](_0x3df699['toString'](),_0xa0a3ec);})[_0x6791('0x32')](function(_0x1b0777){if(_0x1b0777[_0x6791('0x47')]>0x0)_0x276002['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0x6791('0x3c')](_0x1b0777,'id'));return db[_0x6791('0x9c')]['query'](_0x276002[_0x6791('0x9d')](),_0xa0a3ec)[_0x6791('0x32')](function(_0x23f91d){var _0x5dbcf3=_[_0x6791('0xb0')](_0x23f91d,'WhatsappInteractionId');var _0x540af2=[];_0x1b0777[_0x6791('0x30')](function(_0x5e7379){_0x540af2[_0x6791('0x31')](updateWhatsappInteraction(_0x5e7379,_0x18d405,_0x5dbcf3));});return BPromise[_0x6791('0xb1')](_0x540af2);});});})[_0x6791('0x32')](function(_0x198a9e){_0x3e95b6[_0x6791('0xb2')]=_0x198a9e;return _0x3e95b6;})[_0x6791('0x32')](respondWithFilteredResult(_0x593fda,_0x18c478))['catch'](handleError(_0x593fda,null));};exports[_0x6791('0xb3')]=function(_0x5da6c9,_0x221fad){var _0x4d6641={'raw':![],'where':{'id':_0x5da6c9[_0x6791('0xb4')]['id']}},_0x599f9f={};_0x599f9f[_0x6791('0x40')]=_[_0x6791('0x42')](db[_0x6791('0x3d')][_0x6791('0x3e')]);_0x599f9f[_0x6791('0x41')]=_[_0x6791('0x42')](_0x5da6c9[_0x6791('0x41')]);_0x599f9f[_0x6791('0x43')]=_[_0x6791('0x44')](_0x599f9f[_0x6791('0x40')],_0x599f9f[_0x6791('0x41')]);_0x4d6641[_0x6791('0x46')]=_[_0x6791('0x44')](_0x599f9f[_0x6791('0x40')],qs[_0x6791('0x45')](_0x5da6c9[_0x6791('0x41')][_0x6791('0x45')]));_0x4d6641[_0x6791('0x46')]=_0x4d6641['attributes'][_0x6791('0x47')]?_0x4d6641[_0x6791('0x46')]:_0x599f9f[_0x6791('0x40')];if(_0x5da6c9['query']['includeAll']){_0x4d6641['include']=[{'all':!![]}];}_0x4d6641=_[_0x6791('0x9f')]({},_0x4d6641,_0x5da6c9[_0x6791('0xb5')]);return db['WhatsappInteraction'][_0x6791('0x62')](_0x4d6641)[_0x6791('0x32')](handleEntityNotFound(_0x221fad,null))[_0x6791('0x32')](respondWithResult(_0x221fad,null))[_0x6791('0x33')](handleError(_0x221fad,null));};exports[_0x6791('0xb6')]=function(_0x558c6e,_0x1c7cbc){return db[_0x6791('0x3d')]['create'](_0x558c6e[_0x6791('0x74')],{})['then'](respondWithResult(_0x1c7cbc,0xc9))[_0x6791('0x33')](handleError(_0x1c7cbc,null));};exports[_0x6791('0x26')]=function(_0x2d4999,_0x5d5963){if(_0x2d4999['body']['id']){delete _0x2d4999['body']['id'];}return db[_0x6791('0x3d')][_0x6791('0x62')]({'where':{'id':_0x2d4999[_0x6791('0xb4')]['id']}})[_0x6791('0x32')](handleEntityNotFound(_0x5d5963,null))['then'](saveUpdates(_0x2d4999[_0x6791('0x74')],null))[_0x6791('0x32')](respondWithResult(_0x5d5963,null))[_0x6791('0x33')](handleError(_0x5d5963,null));};exports[_0x6791('0x27')]=function(_0x5e39b1,_0x4a4ca6){return db['WhatsappInteraction'][_0x6791('0x62')]({'where':{'id':_0x5e39b1['params']['id']}})[_0x6791('0x32')](handleEntityNotFound(_0x4a4ca6,null))[_0x6791('0x32')](removeEntity(_0x4a4ca6,null))[_0x6791('0x33')](handleError(_0x4a4ca6,null));};exports[_0x6791('0xb7')]=function(_0x15a95b,_0xd09d86){return db[_0x6791('0x3d')][_0x6791('0xb7')]()['then'](respondWithResult(_0xd09d86,null))[_0x6791('0x33')](handleError(_0xd09d86,null));};exports[_0x6791('0xb8')]=function(_0x4da552,_0x2bb0a1,_0x3b4b4b){return db[_0x6791('0xb9')][_0x6791('0x62')]({'where':{'id':_0x4da552['params']['id']}})[_0x6791('0x32')](handleEntityNotFound(_0x2bb0a1,null))[_0x6791('0x32')](function(_0x903fe1){if(_0x903fe1){return _0x903fe1[_0x6791('0xb8')](_0x4da552[_0x6791('0x74')][_0x6791('0xba')],_[_0x6791('0xbb')](_0x4da552[_0x6791('0x74')],[_0x6791('0xba'),'id'])||{});}})['then'](respondWithResult(_0x2bb0a1,null))[_0x6791('0x33')](handleError(_0x2bb0a1,null));};exports[_0x6791('0xbc')]=function(_0x298180,_0xb7986d,_0x19cb72){var _0x5aad37={'raw':![],'where':{}};var _0x57a350={};var _0x42b4f7={'count':0x0,'rows':[]};return db[_0x6791('0x3d')]['findOne']({'where':{'id':_0x298180[_0x6791('0xb4')]['id']}})[_0x6791('0x32')](handleEntityNotFound(_0xb7986d,null))[_0x6791('0x32')](function(_0x3fffd9){if(_0x3fffd9){_0x57a350[_0x6791('0x40')]=_[_0x6791('0x42')](db[_0x6791('0xb9')][_0x6791('0x3e')]);_0x57a350[_0x6791('0x41')]=_['keys'](_0x298180[_0x6791('0x41')]);_0x57a350[_0x6791('0x43')]=_['intersection'](_0x57a350[_0x6791('0x40')],_0x57a350['query']);_0x5aad37[_0x6791('0x46')]=_[_0x6791('0x44')](_0x57a350[_0x6791('0x40')],qs[_0x6791('0x45')](_0x298180[_0x6791('0x41')][_0x6791('0x45')]));_0x5aad37[_0x6791('0x46')]=_0x5aad37[_0x6791('0x46')][_0x6791('0x47')]?_0x5aad37[_0x6791('0x46')]:_0x57a350[_0x6791('0x40')];if(!_0x298180[_0x6791('0x41')][_0x6791('0x48')](_0x6791('0x49'))){_0x5aad37[_0x6791('0x21')]=qs[_0x6791('0x21')](_0x298180[_0x6791('0x41')][_0x6791('0x21')]);_0x5aad37[_0x6791('0x1f')]=qs['offset'](_0x298180[_0x6791('0x41')]['offset']);}_0x5aad37[_0x6791('0x4a')]=qs[_0x6791('0x4b')](_0x298180[_0x6791('0x41')][_0x6791('0x4b')]);_0x5aad37[_0x6791('0x80')]=qs[_0x6791('0x43')](_[_0x6791('0x4c')](_0x298180[_0x6791('0x41')],_0x57a350['filters']));_0x5aad37[_0x6791('0x80')]['WhatsappInteractionId']=_0x3fffd9['id'];if(_0x298180['query'][_0x6791('0x87')]){_0x5aad37[_0x6791('0x80')]=_[_0x6791('0x9f')](_0x5aad37[_0x6791('0x80')],{'$or':_[_0x6791('0x3c')](_0x5aad37[_0x6791('0x46')],function(_0x2e8d88){var _0x53aa78={};_0x53aa78[_0x2e8d88]={'$like':'%'+_0x298180[_0x6791('0x41')][_0x6791('0x87')]+'%'};return _0x53aa78;})});}if(_0x298180[_0x6791('0x41')][_0x6791('0x7b')]){var _0x1fc7a6=_0x298180[_0x6791('0x41')]['$gte'][_0x6791('0x68')](',');var _0x704f62={};_0x704f62[_0x1fc7a6[0x0]]={'$gte':moment(_0x1fc7a6[0x1])['format'](_0x6791('0xbd'))};_0x5aad37[_0x6791('0x80')]=_[_0x6791('0x9f')](_0x5aad37[_0x6791('0x80')],_0x704f62);}_0x5aad37=_['merge']({},_0x5aad37,_0x298180[_0x6791('0xb5')]);return db[_0x6791('0xb9')][_0x6791('0x22')]({'where':_0x5aad37[_0x6791('0x80')]})['then'](function(_0x5a14c1){_0x42b4f7[_0x6791('0x22')]=_0x5a14c1;if(_0x298180[_0x6791('0x41')][_0x6791('0xbe')]){_0x5aad37['include']=[{'all':!![]}];}return db[_0x6791('0xb9')][_0x6791('0xbf')](_0x5aad37);})[_0x6791('0x32')](function(_0x54d281){_0x42b4f7['rows']=_0x54d281;return _0x42b4f7;});}})['then'](respondWithFilteredResult(_0xb7986d,_0x5aad37))[_0x6791('0x33')](handleError(_0xb7986d,null));};exports['addTags']=function(_0xfe0951,_0x441add,_0x2bf948){return db['WhatsappInteraction'][_0x6791('0x62')]({'where':{'id':_0xfe0951['params']['id']}})[_0x6791('0x32')](handleEntityNotFound(_0x441add,null))['then'](function(_0x110530){if(_0x110530){return _0x110530['setTags'](_0xfe0951[_0x6791('0x74')][_0x6791('0xba')],_[_0x6791('0xbb')](_0xfe0951[_0x6791('0x74')],[_0x6791('0xba'),'id'])||{})['spread'](function(){return db[_0x6791('0xc0')]['findAll']({'attributes':['id',_0x6791('0x2a'),'color'],'where':{'id':_0xfe0951[_0x6791('0x74')][_0x6791('0xba')]}});})[_0x6791('0x32')](function(_0x105823){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0xfe0951[_0x6791('0xb4')]['id']),'tags':_0x105823||[]});return{'id':Number(_0xfe0951[_0x6791('0xb4')]['id']),'tags':_0x105823||[]};});}})[_0x6791('0x32')](respondWithResult(_0x441add,null))[_0x6791('0x33')](handleError(_0x441add,null));};exports['removeTags']=function(_0x3641de,_0x56389f,_0x23ce09){return db[_0x6791('0x3d')][_0x6791('0x62')]({'where':{'id':_0x3641de[_0x6791('0xb4')]['id']}})[_0x6791('0x32')](handleEntityNotFound(_0x56389f,null))[_0x6791('0x32')](function(_0x3312c4){if(_0x3312c4){return _0x3312c4['removeTags'](_0x3641de[_0x6791('0x41')][_0x6791('0xba')]);}})[_0x6791('0x32')](respondWithStatusCode(_0x56389f,null))[_0x6791('0x33')](handleError(_0x56389f,null));};exports[_0x6791('0xc1')]=function(_0x221d15,_0xa61fcc){var _0x257b04=moment()[_0x6791('0xc2')]()[_0x6791('0x9d')]();var _0x8a881f=path[_0x6791('0xc3')](config['root'],_0x6791('0xc4'),_0x6791('0xc5'),'tmp');var _0x29d5fb=path[_0x6791('0xc3')](config[_0x6791('0xc6')],'server','files',_0x6791('0xc7'));var _0x54d569=path[_0x6791('0xc3')](_0x8a881f,_0x257b04);var _0x30a411=util['format']('transcript-%d-%s.zip',_0x221d15[_0x6791('0xb4')]['id'],_0x257b04);var _0x35bb13=path[_0x6791('0xc3')](_0x8a881f,_0x30a411);var _0x44d805=[];_0x44d805[_0x6791('0x31')]({'model':db[_0x6791('0x71')],'as':_0x6791('0x71'),'attributes':['id',_0x6791('0x2d')],'raw':!![]});_0x44d805[_0x6791('0x31')]({'model':db[_0x6791('0xc8')],'as':_0x6791('0x65'),'attributes':['id','firstName',_0x6791('0xc9')],'raw':!![]});if(_0x221d15['query'][_0x6791('0xc7')]){_0x44d805[_0x6791('0x31')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2938e4=[{'model':db[_0x6791('0xb9')],'as':'Messages','attributes':['id',_0x6791('0x74'),_0x6791('0x7a'),'direction',_0x6791('0xca'),_0x6791('0x83')],'include':_0x44d805}];_0x2938e4[_0x6791('0x31')]({'model':db[_0x6791('0xcb')],'as':_0x6791('0xcc'),'attributes':['id',_0x6791('0x2a')]});_0x2938e4[_0x6791('0x31')]({'model':db[_0x6791('0x71')],'as':_0x6791('0xcd'),'attributes':['id','fullname']});return db[_0x6791('0x3d')][_0x6791('0x62')]({'where':{'id':_0x221d15[_0x6791('0xb4')]['id']},'include':_0x2938e4})[_0x6791('0x32')](handleEntityNotFound(_0xa61fcc,null))[_0x6791('0x32')](function(_0x27adce){if(_0x27adce){var _0x259c61=_0x27adce['get']({'plain':!![]});fs[_0x6791('0xce')](_0x54d569);var _0x5a56b4={'channel':_0x6791('0xcf'),'account':_0x259c61['Account'][_0x6791('0x2a')],'agent':_0x259c61[_0x6791('0xcd')]?_0x259c61[_0x6791('0xcd')]['fullname']:'N.A.','createdAt':moment(_0x259c61[_0x6791('0x7a')])[_0x6791('0xd0')](_0x6791('0xbd'))[_0x6791('0x9d')](),'closedAt':_0x259c61[_0x6791('0x36')]?moment(_0x259c61[_0x6791('0xd1')])[_0x6791('0xd0')](_0x6791('0xbd'))['toString']():'','disposition':_0x259c61[_0x6791('0xd2')],'messages':_(_0x259c61[_0x6791('0xd3')])[_0x6791('0x87')]({'secret':![]})[_0x6791('0x3c')](function(_0x11ee4e){if(_0x11ee4e[_0x6791('0xd4')]){var _0x13ab4d=path[_0x6791('0xc3')](_0x29d5fb,_0x11ee4e['Attachment'][_0x6791('0xd5')]);if(fs[_0x6791('0xd6')](_0x13ab4d)){fs[_0x6791('0xd7')](_0x13ab4d)[_0x6791('0xd8')](fs[_0x6791('0xd9')](path[_0x6791('0xc3')](_0x54d569,_0x11ee4e[_0x6791('0xd4')][_0x6791('0xd5')])));}}return{'date':moment(_0x11ee4e[_0x6791('0x7a')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x11ee4e[_0x6791('0xda')]==='out'?_0x11ee4e[_0x6791('0x71')]?_0x11ee4e[_0x6791('0x71')][_0x6791('0x2d')]:'System':_0x11ee4e[_0x6791('0x65')]['firstName']+(_0x11ee4e['Contact'][_0x6791('0xc9')]?'\x20'+_0x11ee4e[_0x6791('0x65')][_0x6791('0xc9')]:''),'body':_0x11ee4e[_0x6791('0xd4')]?_0x11ee4e[_0x6791('0xd4')][_0x6791('0xd5')]:_0x11ee4e[_0x6791('0x74')],'direction':_0x11ee4e[_0x6791('0xda')]===_0x6791('0xdb')?'A':'C','secret':_0x11ee4e[_0x6791('0xca')],'read':_0x11ee4e[_0x6791('0x83')],'attachment':_0x11ee4e[_0x6791('0xd4')]};})[_0x6791('0x67')]()};return ejs['renderFile'](path[_0x6791('0xc3')](config[_0x6791('0xc6')],_0x6791('0xc4'),_0x6791('0xdc'),_0x6791('0xdd')),{'interaction':_0x5a56b4})[_0x6791('0x32')](function(_0x3fffc3){var _0xd5e51f=path[_0x6791('0xc3')](_0x54d569,_0x6791('0xde')+_0x259c61['id']+'-'+_0x257b04+_0x6791('0xdf'));var _0x5d4ec8={'path':_0xd5e51f,'channel':_0x6791('0xcf'),'interactionId':_0x259c61['id']};return pdf[_0x6791('0xe0')](_0x3fffc3,_0x5d4ec8);})[_0x6791('0x32')](function(){return new BPromise(function(_0x1730d1,_0x191651){zipdir(_0x54d569,{'saveTo':_0x35bb13},function(_0x5c3fea,_0x1e4342){if(_0x5c3fea)return _0x191651(_0x5c3fea);return _0x1730d1(_0x1e4342);});})[_0x6791('0x32')](function(){return new BPromise(function(_0x3c9f4e,_0x47d99d){rimraf(_0x54d569,function(_0x287f0){if(_0x287f0)_0x47d99d(_0x287f0);return _0x3c9f4e();});});})[_0x6791('0x32')](function(){return _0xa61fcc['download'](_0x35bb13,_0x30a411,function(_0x505914){if(_0x505914){console[_0x6791('0xe1')](_0x6791('0xe2'),_0x505914);}else{fs[_0x6791('0xe3')](_0x35bb13);}});});});}else{return _0xa61fcc['sendStatus'](0xc8);}})[_0x6791('0x33')](handleError(_0xa61fcc,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b420164..9bbe6da 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 _0x3495=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages','length','emit'];(function(_0x4008e4,_0x81a00c){var _0x430a2b=function(_0x333d56){while(--_0x333d56){_0x4008e4['push'](_0x4008e4['shift']());}};_0x430a2b(++_0x81a00c);}(_0x3495,0x1de));var _0x5349=function(_0x1ec942,_0x4c1555){_0x1ec942=_0x1ec942-0x0;var _0x48abc3=_0x3495[_0x1ec942];return _0x48abc3;};'use strict';var EventEmitter=require(_0x5349('0x0'));var WhatsappInteraction=require(_0x5349('0x1'))['db'][_0x5349('0x2')];var WhatsappMessage=require(_0x5349('0x1'))['db'][_0x5349('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5349('0x4')](0x0);var events={'afterCreate':_0x5349('0x5'),'afterUpdate':_0x5349('0x6'),'afterDestroy':_0x5349('0x7')};function emitEvent(_0x5912ac){return function(_0x4034ba,_0x8283b5,_0x5ce2cd){_0x4034ba[_0x5349('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6fb5dc){_0x4034ba['setDataValue'](_0x5349('0x9'),_0x6fb5dc['map'](function(_0x1751b2){return{'id':_0x1751b2['id']};}));return WhatsappMessage[_0x5349('0xa')]({'where':{'WhatsappInteractionId':_0x4034ba['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5349('0xb')](function(_0x23a1c7){_0x4034ba[_0x5349('0xc')](_0x5349('0xd'),_0x23a1c7[_0x5349('0xe')]);WhatsappInteractionEvents['emit'](_0x5912ac+':'+_0x4034ba['id'],_0x4034ba);WhatsappInteractionEvents[_0x5349('0xf')](_0x5912ac,_0x4034ba);_0x5ce2cd(null);})['catch'](_0x5ce2cd(null));};}for(var e in events){if(events[_0x5349('0x10')](e)){var event=events[e];WhatsappInteraction[_0x5349('0x11')](e,emitEvent(event));}}module[_0x5349('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x24e9=['events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x1b9b50,_0x55af5b){var _0x3859cc=function(_0x461046){while(--_0x461046){_0x1b9b50['push'](_0x1b9b50['shift']());}};_0x3859cc(++_0x55af5b);}(_0x24e9,0x85));var _0x924e=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x24e9[_0x5948dd];return _0xb1f8be;};'use strict';var EventEmitter=require(_0x924e('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x924e('0x1')];var WhatsappMessage=require(_0x924e('0x2'))['db'][_0x924e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x924e('0x4')](0x0);var events={'afterCreate':_0x924e('0x5'),'afterUpdate':_0x924e('0x6'),'afterDestroy':_0x924e('0x7')};function emitEvent(_0x1564ff){return function(_0x4ecdb9,_0x18346f,_0x31f0c3){_0x4ecdb9[_0x924e('0x8')]({'attributes':['id'],'raw':!![]})[_0x924e('0x9')](function(_0xdcafe0){_0x4ecdb9['setDataValue']('Users',_0xdcafe0[_0x924e('0xa')](function(_0x1604a8){return{'id':_0x1604a8['id']};}));return WhatsappMessage[_0x924e('0xb')]({'where':{'WhatsappInteractionId':_0x4ecdb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x924e('0x9')](function(_0x576c1c){_0x4ecdb9[_0x924e('0xc')](_0x924e('0xd'),_0x576c1c['length']);WhatsappInteractionEvents[_0x924e('0xe')](_0x1564ff+':'+_0x4ecdb9['id'],_0x4ecdb9);WhatsappInteractionEvents['emit'](_0x1564ff,_0x4ecdb9);_0x31f0c3(null);})[_0x924e('0xf')](_0x31f0c3(null));};}for(var e in events){if(events[_0x924e('0x10')](e)){var event=events[e];WhatsappInteraction[_0x924e('0x11')](e,emitEvent(event));}}module[_0x924e('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 03f3e22..c500ec5 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 _0x5686=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','util'];(function(_0x20b6e2,_0x1105f2){var _0x1e6dde=function(_0x47aa91){while(--_0x47aa91){_0x20b6e2['push'](_0x20b6e2['shift']());}};_0x1e6dde(++_0x1105f2);}(_0x5686,0x167));var _0x6568=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x5686[_0x473738];return _0x1df4ae;};'use strict';var _=require('lodash');var util=require(_0x6568('0x0'));var logger=require(_0x6568('0x1'))(_0x6568('0x2'));var moment=require(_0x6568('0x3'));var BPromise=require(_0x6568('0x4'));var rp=require(_0x6568('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6568('0x6'));var attributes=require(_0x6568('0x7'));module[_0x6568('0x8')]=function(_0x22db0e,_0x54bdf3){return _0x22db0e['define'](_0x6568('0x9'),attributes,{'tableName':_0x6568('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a49f9,_0x394408,_0x5190c0){if(_0x2a49f9[_0x6568('0xb')](_0x6568('0xc'))){_0x2a49f9[_0x6568('0xd')]=moment()[_0x6568('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5190c0(null,_0x2a49f9);}}});}; \ No newline at end of file +var _0x8042=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x40e628,_0x37b0c3){var _0x113a4b=function(_0x4c9fe7){while(--_0x4c9fe7){_0x40e628['push'](_0x40e628['shift']());}};_0x113a4b(++_0x37b0c3);}(_0x8042,0x18e));var _0x2804=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x8042[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0x2804('0x0'));var util=require(_0x2804('0x1'));var logger=require(_0x2804('0x2'))(_0x2804('0x3'));var moment=require(_0x2804('0x4'));var BPromise=require(_0x2804('0x5'));var rp=require(_0x2804('0x6'));var fs=require('fs');var path=require(_0x2804('0x7'));var rimraf=require(_0x2804('0x8'));var config=require(_0x2804('0x9'));var attributes=require(_0x2804('0xa'));module[_0x2804('0xb')]=function(_0x204953,_0x4efe0e){return _0x204953[_0x2804('0xc')](_0x2804('0xd'),attributes,{'tableName':_0x2804('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41a8df,_0x350a0e,_0x378ccf){if(_0x41a8df[_0x2804('0xf')](_0x2804('0x10'))){_0x41a8df[_0x2804('0x11')]=moment()['format'](_0x2804('0x12'));}_0x378ccf(null,_0x41a8df);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c286d5b..62682be 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 _0x6c58=['client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1890d2,_0x307871){var _0x35480c=function(_0x24944e){while(--_0x24944e){_0x1890d2['push'](_0x1890d2['shift']());}};_0x35480c(++_0x307871);}(_0x6c58,0x19b));var _0x86c5=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x6c58[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x86c5('0x0'));var util=require(_0x86c5('0x1'));var moment=require(_0x86c5('0x2'));var BPromise=require(_0x86c5('0x3'));var rs=require(_0x86c5('0x4'));var fs=require('fs');var Redis=require(_0x86c5('0x5'));var db=require(_0x86c5('0x6'))['db'];var utils=require(_0x86c5('0x7'));var logger=require(_0x86c5('0x8'))(_0x86c5('0x9'));var config=require(_0x86c5('0xa'));var jayson=require(_0x86c5('0xb'));var client=jayson[_0x86c5('0xc')][_0x86c5('0xd')]({'port':0x232a});config[_0x86c5('0xe')]=_['defaults'](config['redis'],{'host':_0x86c5('0xf'),'port':0x18eb});var socket=require(_0x86c5('0x10'))(new Redis(config[_0x86c5('0xe')]));require(_0x86c5('0x11'))[_0x86c5('0x12')](socket);function respondWithRpcPromise(_0x4ec2fb,_0x94415a,_0xb12c8a){return new BPromise(function(_0x2f7557,_0x2327dd){return client['request'](_0x4ec2fb,_0xb12c8a)[_0x86c5('0x13')](function(_0x2ef307){logger[_0x86c5('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x94415a,_0x86c5('0x15'));logger[_0x86c5('0x16')](_0x86c5('0x17'),_0x94415a,_0x86c5('0x15'),JSON[_0x86c5('0x18')](_0x2ef307));if(_0x2ef307[_0x86c5('0x19')]){if(_0x2ef307[_0x86c5('0x19')][_0x86c5('0x1a')]===0x1f4){logger[_0x86c5('0x19')](_0x86c5('0x1b'),_0x94415a,_0x2ef307['error'][_0x86c5('0x1c')]);return _0x2327dd(_0x2ef307[_0x86c5('0x19')][_0x86c5('0x1c')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x94415a,_0x2ef307[_0x86c5('0x19')][_0x86c5('0x1c')]);return _0x2f7557(_0x2ef307[_0x86c5('0x19')]['message']);}else{logger[_0x86c5('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x94415a,_0x86c5('0x15'));_0x2f7557(_0x2ef307[_0x86c5('0x1d')][_0x86c5('0x1c')]);}})[_0x86c5('0x1e')](function(_0x5c8593){logger[_0x86c5('0x19')](_0x86c5('0x1b'),_0x94415a,_0x5c8593);_0x2327dd(_0x5c8593);});});}exports[_0x86c5('0x1f')]=function(_0x11cb4b){var _0x105f0e=this;return new Promise(function(_0x2f8cf2,_0x4b6206){return db[_0x86c5('0x20')][_0x86c5('0x21')](_0x11cb4b[_0x86c5('0x22')],{'raw':_0x11cb4b[_0x86c5('0x23')]?_0x11cb4b[_0x86c5('0x23')][_0x86c5('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11cb4b['options']?_0x11cb4b['options'][_0x86c5('0x25')]||null:null,'attributes':_0x11cb4b[_0x86c5('0x23')]?_0x11cb4b[_0x86c5('0x23')][_0x86c5('0x26')]||null:null,'limit':_0x11cb4b[_0x86c5('0x23')]?_0x11cb4b[_0x86c5('0x23')][_0x86c5('0x27')]||null:null})[_0x86c5('0x13')](function(_0xa4c348){logger[_0x86c5('0x14')](_0x86c5('0x1f'),_0x11cb4b);logger['debug'](_0x86c5('0x1f'),_0x11cb4b,JSON[_0x86c5('0x18')](_0xa4c348));_0x2f8cf2(_0xa4c348);})[_0x86c5('0x1e')](function(_0x337dfa){logger[_0x86c5('0x19')]('UpdateWhatsappInteraction',_0x337dfa[_0x86c5('0x1c')],_0x11cb4b);_0x4b6206(_0x105f0e[_0x86c5('0x19')](0x1f4,_0x337dfa[_0x86c5('0x1c')]));});});};exports[_0x86c5('0x28')]=function(_0x1f3980){return new Promise(function(_0x1c97ac,_0x4f0e9c){return db[_0x86c5('0x20')][_0x86c5('0x29')]({'where':_0x1f3980[_0x86c5('0x23')]?_0x1f3980[_0x86c5('0x23')][_0x86c5('0x25')]||null:null})['then'](function(_0x41c8a7){if(_0x41c8a7){return _0x41c8a7[_0x86c5('0x2a')](_0x1f3980[_0x86c5('0x22')][_0x86c5('0x2b')],_[_0x86c5('0x2c')](_0x1f3980[_0x86c5('0x22')],['ids','id'])||{});}})[_0x86c5('0x2d')](function(_0x386235){logger['info'](_0x86c5('0x2e'),_0x1f3980);logger[_0x86c5('0x16')](_0x86c5('0x2e'),_0x1f3980,JSON[_0x86c5('0x18')](_0x386235));_0x1c97ac(_0x386235);})[_0x86c5('0x1e')](function(_0x455717){logger['error'](_0x86c5('0x2e'),_0x455717['message'],_0x1f3980);_0x4f0e9c(_this[_0x86c5('0x19')](0x1f4,_0x455717['message']));});});}; \ No newline at end of file +var _0x0ab4=['info','result','catch','UpdateWhatsappInteraction','body','options','where','attributes','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5463f2,_0x25ffb4){var _0xff68b6=function(_0x41cdfc){while(--_0x41cdfc){_0x5463f2['push'](_0x5463f2['shift']());}};_0xff68b6(++_0x25ffb4);}(_0x0ab4,0x19f));var _0x40ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ab4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x40ab('0x0'));var moment=require(_0x40ab('0x1'));var BPromise=require(_0x40ab('0x2'));var rs=require(_0x40ab('0x3'));var fs=require('fs');var Redis=require(_0x40ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40ab('0x5'));var logger=require(_0x40ab('0x6'))(_0x40ab('0x7'));var config=require('../../config/environment');var jayson=require(_0x40ab('0x8'));var client=jayson[_0x40ab('0x9')]['http']({'port':0x232a});config[_0x40ab('0xa')]=_[_0x40ab('0xb')](config[_0x40ab('0xa')],{'host':_0x40ab('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40ab('0xa')]));require(_0x40ab('0xd'))[_0x40ab('0xe')](socket);function respondWithRpcPromise(_0x9f474a,_0x717e0,_0x4fc777){return new BPromise(function(_0x478011,_0x25ca51){return client[_0x40ab('0xf')](_0x9f474a,_0x4fc777)[_0x40ab('0x10')](function(_0x4b150a){logger['info'](_0x40ab('0x11'),_0x717e0,'request\x20sent');logger[_0x40ab('0x12')](_0x40ab('0x13'),_0x717e0,_0x40ab('0x14'),JSON[_0x40ab('0x15')](_0x4b150a));if(_0x4b150a[_0x40ab('0x16')]){if(_0x4b150a[_0x40ab('0x16')][_0x40ab('0x17')]===0x1f4){logger['error'](_0x40ab('0x11'),_0x717e0,_0x4b150a[_0x40ab('0x16')][_0x40ab('0x18')]);return _0x25ca51(_0x4b150a[_0x40ab('0x16')]['message']);}logger[_0x40ab('0x16')](_0x40ab('0x11'),_0x717e0,_0x4b150a[_0x40ab('0x16')][_0x40ab('0x18')]);return _0x478011(_0x4b150a['error'][_0x40ab('0x18')]);}else{logger[_0x40ab('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x717e0,_0x40ab('0x14'));_0x478011(_0x4b150a[_0x40ab('0x1a')][_0x40ab('0x18')]);}})[_0x40ab('0x1b')](function(_0x21a0d8){logger[_0x40ab('0x16')](_0x40ab('0x11'),_0x717e0,_0x21a0d8);_0x25ca51(_0x21a0d8);});});}exports[_0x40ab('0x1c')]=function(_0x3cde90){var _0x6f9823=this;return new Promise(function(_0x1156a4,_0x552851){return db['WhatsappInteraction']['update'](_0x3cde90[_0x40ab('0x1d')],{'raw':_0x3cde90[_0x40ab('0x1e')]?_0x3cde90[_0x40ab('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cde90[_0x40ab('0x1e')]?_0x3cde90[_0x40ab('0x1e')][_0x40ab('0x1f')]||null:null,'attributes':_0x3cde90['options']?_0x3cde90[_0x40ab('0x1e')][_0x40ab('0x20')]||null:null,'limit':_0x3cde90[_0x40ab('0x1e')]?_0x3cde90[_0x40ab('0x1e')]['limit']||null:null})[_0x40ab('0x10')](function(_0x492cac){logger[_0x40ab('0x19')](_0x40ab('0x1c'),_0x3cde90);logger[_0x40ab('0x12')](_0x40ab('0x1c'),_0x3cde90,JSON['stringify'](_0x492cac));_0x1156a4(_0x492cac);})['catch'](function(_0x77742a){logger[_0x40ab('0x16')](_0x40ab('0x1c'),_0x77742a[_0x40ab('0x18')],_0x3cde90);_0x552851(_0x6f9823['error'](0x1f4,_0x77742a[_0x40ab('0x18')]));});});};exports[_0x40ab('0x21')]=function(_0x58622b){return new Promise(function(_0x3e732a,_0x8948f7){return db['WhatsappInteraction'][_0x40ab('0x22')]({'where':_0x58622b[_0x40ab('0x1e')]?_0x58622b[_0x40ab('0x1e')][_0x40ab('0x1f')]||null:null})[_0x40ab('0x10')](function(_0x5581dc){if(_0x5581dc){return _0x5581dc[_0x40ab('0x23')](_0x58622b[_0x40ab('0x1d')][_0x40ab('0x24')],_[_0x40ab('0x25')](_0x58622b[_0x40ab('0x1d')],[_0x40ab('0x24'),'id'])||{});}})[_0x40ab('0x26')](function(_0x463a2b){logger[_0x40ab('0x19')](_0x40ab('0x27'),_0x58622b);logger['debug'](_0x40ab('0x27'),_0x58622b,JSON[_0x40ab('0x15')](_0x463a2b));_0x3e732a(_0x463a2b);})[_0x40ab('0x1b')](function(_0x341817){logger[_0x40ab('0x16')](_0x40ab('0x27'),_0x341817[_0x40ab('0x18')],_0x58622b);_0x8948f7(_this[_0x40ab('0x16')](0x1f4,_0x341817['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 74ced27..0cb25f0 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 _0x9647=['save','update','emit','removeListener','register','./whatsappInteraction.events'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x9647,0xf5));var _0x7964=function(_0x50d5d9,_0x4ac058){_0x50d5d9=_0x50d5d9-0x0;var _0x44b0f1=_0x9647[_0x50d5d9];return _0x44b0f1;};'use strict';var WhatsappInteractionEvents=require(_0x7964('0x0'));var events=[_0x7964('0x1'),'remove',_0x7964('0x2')];function createListener(_0x3cbda7,_0x5bb1a9){return function(_0x3adc45){_0x5bb1a9[_0x7964('0x3')](_0x3cbda7,_0x3adc45);};}function removeListener(_0x3077e1,_0x4c4d13){return function(){WhatsappInteractionEvents[_0x7964('0x4')](_0x3077e1,_0x4c4d13);};}exports[_0x7964('0x5')]=function(_0x3375e6){for(var _0x248aa4=0x0,_0x222110=events['length'];_0x248aa4<_0x222110;_0x248aa4++){var _0x56bbdd=events[_0x248aa4];var _0x8ac0b2=createListener('whatsappInteraction:'+_0x56bbdd,_0x3375e6);WhatsappInteractionEvents['on'](_0x56bbdd,_0x8ac0b2);}}; \ No newline at end of file +var _0x4221=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','removeListener','register'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x4221,0x1e5));var _0x1422=function(_0x3bb1bb,_0x4f2ad5){_0x3bb1bb=_0x3bb1bb-0x0;var _0xd5b143=_0x4221[_0x3bb1bb];return _0xd5b143;};'use strict';var WhatsappInteractionEvents=require(_0x1422('0x0'));var events=[_0x1422('0x1'),_0x1422('0x2'),'update'];function createListener(_0x1a79f0,_0x4fba6b){return function(_0xdae246){_0x4fba6b['emit'](_0x1a79f0,_0xdae246);};}function removeListener(_0x2eaec5,_0x9c7cbf){return function(){WhatsappInteractionEvents[_0x1422('0x3')](_0x2eaec5,_0x9c7cbf);};}exports[_0x1422('0x4')]=function(_0x43b3b3){for(var _0x35be5f=0x0,_0x402ce5=events[_0x1422('0x5')];_0x35be5f<_0x402ce5;_0x35be5f++){var _0x1f5bcf=events[_0x35be5f];var _0x4830e4=createListener(_0x1422('0x6')+_0x1f5bcf,_0x43b3b3);WhatsappInteractionEvents['on'](_0x1f5bcf,_0x4830e4);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 09f5267..445f210 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 _0x8b21=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports'];(function(_0x563c70,_0x3a8058){var _0x5a2367=function(_0x4fcf5e){while(--_0x4fcf5e){_0x563c70['push'](_0x563c70['shift']());}};_0x5a2367(++_0x3a8058);}(_0x8b21,0xe0));var _0x18b2=function(_0x308a93,_0x38a6c1){_0x308a93=_0x308a93-0x0;var _0x252e22=_0x8b21[_0x308a93];return _0x252e22;};'use strict';var multer=require(_0x18b2('0x0'));var util=require(_0x18b2('0x1'));var path=require(_0x18b2('0x2'));var timeout=require('connect-timeout');var express=require(_0x18b2('0x3'));var router=express[_0x18b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x18b2('0x5'));var interaction=require(_0x18b2('0x6'));var config=require(_0x18b2('0x7'));var controller=require('./whatsappMessage.controller');router[_0x18b2('0x8')]('/',auth[_0x18b2('0x9')](),controller[_0x18b2('0xa')]);router['get'](_0x18b2('0xb'),auth[_0x18b2('0x9')](),controller[_0x18b2('0xc')]);router[_0x18b2('0x8')](_0x18b2('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x18b2('0xe')]('/',auth[_0x18b2('0x9')](),interaction[_0x18b2('0xf')](_0x18b2('0x10'),_0x18b2('0x11')),controller[_0x18b2('0x12')]);router[_0x18b2('0xe')](_0x18b2('0x13'),controller['status']);router[_0x18b2('0x14')](_0x18b2('0xd'),auth['isAuthenticated'](),controller[_0x18b2('0x15')]);router['put'](_0x18b2('0x16'),auth[_0x18b2('0x9')](),controller[_0x18b2('0x17')]);router[_0x18b2('0x14')](_0x18b2('0x18'),auth[_0x18b2('0x9')](),controller[_0x18b2('0x19')]);router['delete'](_0x18b2('0xd'),auth['isAuthenticated'](),controller[_0x18b2('0x1a')]);module[_0x18b2('0x1b')]=router; \ No newline at end of file +var _0xb846=['/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete'];(function(_0x3c2c73,_0x3b3f6b){var _0x4d5de6=function(_0x44b83d){while(--_0x44b83d){_0x3c2c73['push'](_0x3c2c73['shift']());}};_0x4d5de6(++_0x3b3f6b);}(_0xb846,0x142));var _0x6b84=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb846[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x6b84('0x0'));var path=require(_0x6b84('0x1'));var timeout=require(_0x6b84('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6b84('0x3'));var auth=require(_0x6b84('0x4'));var interaction=require(_0x6b84('0x5'));var config=require(_0x6b84('0x6'));var controller=require(_0x6b84('0x7'));router[_0x6b84('0x8')]('/',auth[_0x6b84('0x9')](),controller[_0x6b84('0xa')]);router['get'](_0x6b84('0xb'),auth[_0x6b84('0x9')](),controller[_0x6b84('0xc')]);router[_0x6b84('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6b84('0xd')]('/',auth[_0x6b84('0x9')](),interaction[_0x6b84('0xe')](_0x6b84('0xf'),_0x6b84('0x10')),controller[_0x6b84('0x11')]);router[_0x6b84('0xd')](_0x6b84('0x12'),controller[_0x6b84('0x13')]);router[_0x6b84('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6b84('0x15')]);router[_0x6b84('0x14')](_0x6b84('0x16'),auth[_0x6b84('0x9')](),controller[_0x6b84('0x17')]);router[_0x6b84('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x6b84('0x18')]);router[_0x6b84('0x19')](_0x6b84('0x1a'),auth[_0x6b84('0x9')](),controller[_0x6b84('0x1b')]);module[_0x6b84('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a89d2ff..e72ce49 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 _0x2873=['sequelize','exports','ENUM','out','STRING','DATE','BOOLEAN','TEXT'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x2873,0x168));var _0x3287=function(_0x3c21a3,_0x4e109c){_0x3c21a3=_0x3c21a3-0x0;var _0x54581e=_0x2873[_0x3c21a3];return _0x54581e;};'use strict';var Sequelize=require(_0x3287('0x0'));module[_0x3287('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3287('0x2')]('in',_0x3287('0x3')),'defaultValue':_0x3287('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x3287('0x4')]},'readAt':{'type':Sequelize[_0x3287('0x5')]},'secret':{'type':Sequelize[_0x3287('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3287('0x4')]},'providerResponse':{'type':Sequelize[_0x3287('0x7')]}}; \ No newline at end of file +var _0x5db6=['DATE','BOOLEAN','TEXT','sequelize','ENUM','out','STRING'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x5db6,0x88));var _0x65db=function(_0x454db3,_0xcd150e){_0x454db3=_0x454db3-0x0;var _0x3b36da=_0x5db6[_0x454db3];return _0x3b36da;};'use strict';var Sequelize=require(_0x65db('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x65db('0x1')]('in',_0x65db('0x2')),'defaultValue':_0x65db('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x65db('0x3')](0xbe)},'phone':{'type':Sequelize[_0x65db('0x3')]},'readAt':{'type':Sequelize[_0x65db('0x4')]},'secret':{'type':Sequelize[_0x65db('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x65db('0x3')]},'providerResponse':{'type':Sequelize[_0x65db('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 8c02d95..fb1e5b8 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 _0xff25=['body','params','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','update','isNil','read1stAt','interaction','get','name','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','internal','SIP/%s','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','type','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','info','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','end','stack','map','WhatsappMessage','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','fields','find','create'];(function(_0x477395,_0x576f73){var _0x42cc2c=function(_0x5d1cc9){while(--_0x5d1cc9){_0x477395['push'](_0x477395['shift']());}};_0x42cc2c(++_0x576f73);}(_0xff25,0xc7));var _0x5ff2=function(_0x23f9a2,_0x30eef5){_0x23f9a2=_0x23f9a2-0x0;var _0x3b9c50=_0xff25[_0x23f9a2];return _0x3b9c50;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ff2('0x0'));var jsonpatch=require(_0x5ff2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ff2('0x2'));var Mustache=require(_0x5ff2('0x3'));var util=require(_0x5ff2('0x4'));var path=require('path');var sox=require(_0x5ff2('0x5'));var csv=require(_0x5ff2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ff2('0x7'));var _=require('lodash');var squel=require(_0x5ff2('0x8'));var crypto=require(_0x5ff2('0x9'));var jsforce=require(_0x5ff2('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ff2('0xb'));var Papa=require(_0x5ff2('0xc'));var Redis=require(_0x5ff2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5ff2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ff2('0xf'))(_0x5ff2('0x10'));var utils=require(_0x5ff2('0x11'));var config=require(_0x5ff2('0x12'));var licenseUtil=require(_0x5ff2('0x13'));var db=require(_0x5ff2('0x14'))['db'];config[_0x5ff2('0x15')]=_[_0x5ff2('0x16')](config[_0x5ff2('0x15')],{'host':_0x5ff2('0x17'),'port':0x18eb});var socket=require(_0x5ff2('0x18'))(new Redis(config['redis']));require(_0x5ff2('0x19'))[_0x5ff2('0x1a')](socket);var jayson=require(_0x5ff2('0x1b'));var client=jayson[_0x5ff2('0x1c')][_0x5ff2('0x1d')]({'port':0x232c});var client9002=jayson[_0x5ff2('0x1c')][_0x5ff2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x40db9b,_0x395965,_0x15f0e5,_0x460b59){return new BPromise(function(_0x54297e,_0x2225d6){var _0x120970=_0x460b59||client;return _0x120970[_0x5ff2('0x1e')](_0x40db9b,_0x15f0e5)[_0x5ff2('0x1f')](function(_0x277b01){logger['info'](_0x5ff2('0x20'),_0x395965,_0x5ff2('0x21'));logger[_0x5ff2('0x22')](_0x5ff2('0x23'),_0x395965,'request\x20sent',JSON['stringify'](_0x277b01));if(_0x277b01['error']){if(_0x277b01['error']['code']===0x1f4){logger[_0x5ff2('0x24')](_0x5ff2('0x20'),_0x395965,_0x277b01[_0x5ff2('0x24')][_0x5ff2('0x25')]);return _0x2225d6(_0x277b01[_0x5ff2('0x24')][_0x5ff2('0x25')]);}logger[_0x5ff2('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x395965,_0x277b01[_0x5ff2('0x24')][_0x5ff2('0x25')]);return _0x54297e(_0x277b01[_0x5ff2('0x24')][_0x5ff2('0x25')]);}else{logger[_0x5ff2('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x395965,_0x5ff2('0x21'));_0x54297e(_0x277b01['result'][_0x5ff2('0x25')]);}})['catch'](function(_0x1ac364){logger[_0x5ff2('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x395965,_0x1ac364);_0x2225d6(_0x1ac364);});});}function respondWithStatusCode(_0x15726b,_0x288c58){_0x288c58=_0x288c58||0xcc;return function(_0xd0e159){if(_0xd0e159){return _0x15726b[_0x5ff2('0x27')](_0x288c58);}return _0x15726b[_0x5ff2('0x28')](_0x288c58)['end']();};}function respondWithResult(_0x3e0d2b,_0xd82466){_0xd82466=_0xd82466||0xc8;return function(_0x1026fe){if(_0x1026fe){return _0x3e0d2b[_0x5ff2('0x28')](_0xd82466)[_0x5ff2('0x29')](_0x1026fe);}};}function respondWithFilteredResult(_0x484682,_0x21eb7f){return function(_0x30348c){if(_0x30348c){var _0x2d915b=typeof _0x21eb7f['offset']===_0x5ff2('0x2a')&&typeof _0x21eb7f[_0x5ff2('0x2b')]===_0x5ff2('0x2a');var _0x4c8093=_0x30348c[_0x5ff2('0x2c')];var _0x51ba3a=_0x2d915b?0x0:_0x21eb7f[_0x5ff2('0x2d')];var _0x17c885=_0x2d915b?_0x30348c[_0x5ff2('0x2c')]:_0x21eb7f[_0x5ff2('0x2d')]+_0x21eb7f['limit'];var _0x2ca4a5;if(_0x17c885>=_0x4c8093){_0x17c885=_0x4c8093;_0x2ca4a5=0xc8;}else{_0x2ca4a5=0xce;}_0x484682[_0x5ff2('0x28')](_0x2ca4a5);return _0x484682[_0x5ff2('0x2e')](_0x5ff2('0x2f'),_0x51ba3a+'-'+_0x17c885+'/'+_0x4c8093)[_0x5ff2('0x29')](_0x30348c);}return null;};}function patchUpdates(_0xf29c5f){return function(_0x361400){try{jsonpatch[_0x5ff2('0x30')](_0x361400,_0xf29c5f,!![]);}catch(_0x53017f){return BPromise[_0x5ff2('0x31')](_0x53017f);}return _0x361400[_0x5ff2('0x32')]();};}function saveUpdates(_0x43c84c,_0x1e8d4b){return function(_0x8365ff){if(_0x8365ff){return _0x8365ff['update'](_0x43c84c)[_0x5ff2('0x1f')](function(_0x1b9ce5){return _0x1b9ce5;});}return null;};}function removeEntity(_0x246ff2,_0x27db3f){return function(_0x8f343f){if(_0x8f343f){return _0x8f343f[_0x5ff2('0x33')]()['then'](function(){_0x246ff2[_0x5ff2('0x28')](0xcc)[_0x5ff2('0x34')]();});}};}function handleEntityNotFound(_0x4bab8b,_0x1ac068){return function(_0x566784){if(!_0x566784){_0x4bab8b[_0x5ff2('0x27')](0x194);}return _0x566784;};}function handleError(_0x404577,_0x2694f7){_0x2694f7=_0x2694f7||0x1f4;return function(_0x5e07ae){logger[_0x5ff2('0x24')](_0x5e07ae[_0x5ff2('0x35')]);if(_0x5e07ae['name']){delete _0x5e07ae['name'];}_0x404577[_0x5ff2('0x28')](_0x2694f7)['send'](_0x5e07ae);};}exports['index']=function(_0x4a51bb,_0xbdda17){var _0xada3cd={},_0x2e8f1c={},_0x4ce705={'count':0x0,'rows':[]};var _0x5d8b56=_[_0x5ff2('0x36')](db[_0x5ff2('0x37')]['rawAttributes'],function(_0xdf1165){return{'name':_0xdf1165[_0x5ff2('0x38')],'type':_0xdf1165['type']['key']};});_0x2e8f1c[_0x5ff2('0x39')]=_[_0x5ff2('0x36')](_0x5d8b56,'name');_0x2e8f1c[_0x5ff2('0x3a')]=_['keys'](_0x4a51bb[_0x5ff2('0x3a')]);_0x2e8f1c[_0x5ff2('0x3b')]=_[_0x5ff2('0x3c')](_0x2e8f1c[_0x5ff2('0x39')],_0x2e8f1c[_0x5ff2('0x3a')]);_0xada3cd['attributes']=_[_0x5ff2('0x3c')](_0x2e8f1c[_0x5ff2('0x39')],qs['fields'](_0x4a51bb[_0x5ff2('0x3a')]['fields']));_0xada3cd[_0x5ff2('0x3d')]=_0xada3cd[_0x5ff2('0x3d')][_0x5ff2('0x3e')]?_0xada3cd[_0x5ff2('0x3d')]:_0x2e8f1c[_0x5ff2('0x39')];if(!_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x3f')]('nolimit')){_0xada3cd[_0x5ff2('0x2b')]=qs['limit'](_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x2b')]);_0xada3cd[_0x5ff2('0x2d')]=qs[_0x5ff2('0x2d')](_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x2d')]);}_0xada3cd[_0x5ff2('0x40')]=qs[_0x5ff2('0x41')](_0x4a51bb[_0x5ff2('0x3a')]['sort']);_0xada3cd['where']=qs[_0x5ff2('0x3b')](_[_0x5ff2('0x42')](_0x4a51bb[_0x5ff2('0x3a')],_0x2e8f1c[_0x5ff2('0x3b')]),_0x5d8b56);if(_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x43')]){_0xada3cd['where']=_[_0x5ff2('0x44')](_0xada3cd['where'],{'$or':_[_0x5ff2('0x36')](_0x5d8b56,function(_0x304b98){if(_0x304b98['type']!==_0x5ff2('0x45')){var _0x5ac9f9={};_0x5ac9f9[_0x304b98['name']]={'$like':'%'+_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x43')]+'%'};return _0x5ac9f9;}})});}_0xada3cd=_[_0x5ff2('0x44')]({},_0xada3cd,_0x4a51bb[_0x5ff2('0x46')]);var _0x5524ef={'where':_0xada3cd[_0x5ff2('0x47')]};return db[_0x5ff2('0x37')][_0x5ff2('0x2c')](_0x5524ef)[_0x5ff2('0x1f')](function(_0x514dfd){_0x4ce705[_0x5ff2('0x2c')]=_0x514dfd;if(_0x4a51bb[_0x5ff2('0x3a')][_0x5ff2('0x48')]){_0xada3cd[_0x5ff2('0x49')]=[{'all':!![]}];}return db[_0x5ff2('0x37')][_0x5ff2('0x4a')](_0xada3cd);})['then'](function(_0x1b075a){_0x4ce705[_0x5ff2('0x4b')]=_0x1b075a;return _0x4ce705;})['then'](respondWithFilteredResult(_0xbdda17,_0xada3cd))[_0x5ff2('0x4c')](handleError(_0xbdda17,null));};exports[_0x5ff2('0x4d')]=function(_0x22a948,_0x1f931f){var _0x558fa8={'raw':!![],'where':{'id':_0x22a948['params']['id']}},_0x136968={};_0x136968[_0x5ff2('0x39')]=_[_0x5ff2('0x4e')](db[_0x5ff2('0x37')][_0x5ff2('0x4f')]);_0x136968[_0x5ff2('0x3a')]=_['keys'](_0x22a948[_0x5ff2('0x3a')]);_0x136968[_0x5ff2('0x3b')]=_[_0x5ff2('0x3c')](_0x136968['model'],_0x136968[_0x5ff2('0x3a')]);_0x558fa8[_0x5ff2('0x3d')]=_[_0x5ff2('0x3c')](_0x136968[_0x5ff2('0x39')],qs[_0x5ff2('0x50')](_0x22a948[_0x5ff2('0x3a')][_0x5ff2('0x50')]));_0x558fa8['attributes']=_0x558fa8[_0x5ff2('0x3d')][_0x5ff2('0x3e')]?_0x558fa8[_0x5ff2('0x3d')]:_0x136968[_0x5ff2('0x39')];if(_0x22a948[_0x5ff2('0x3a')]['includeAll']){_0x558fa8[_0x5ff2('0x49')]=[{'all':!![]}];}_0x558fa8=_[_0x5ff2('0x44')]({},_0x558fa8,_0x22a948[_0x5ff2('0x46')]);return db['WhatsappMessage'][_0x5ff2('0x51')](_0x558fa8)[_0x5ff2('0x1f')](handleEntityNotFound(_0x1f931f,null))[_0x5ff2('0x1f')](respondWithResult(_0x1f931f,null))['catch'](handleError(_0x1f931f,null));};exports['create']=function(_0x48f58b,_0x54be57){return db['WhatsappMessage'][_0x5ff2('0x52')](_0x48f58b[_0x5ff2('0x53')],{})[_0x5ff2('0x1f')](respondWithResult(_0x54be57,0xc9))[_0x5ff2('0x4c')](handleError(_0x54be57,null));};exports['update']=function(_0x24cd0d,_0x32f13d){if(_0x24cd0d[_0x5ff2('0x53')]['id']){delete _0x24cd0d[_0x5ff2('0x53')]['id'];}return db[_0x5ff2('0x37')][_0x5ff2('0x51')]({'where':{'id':_0x24cd0d[_0x5ff2('0x54')]['id']}})['then'](handleEntityNotFound(_0x32f13d,null))[_0x5ff2('0x1f')](saveUpdates(_0x24cd0d[_0x5ff2('0x53')],null))[_0x5ff2('0x1f')](respondWithResult(_0x32f13d,null))['catch'](handleError(_0x32f13d,null));};exports[_0x5ff2('0x33')]=function(_0x42993e,_0x2290ee){return db[_0x5ff2('0x37')][_0x5ff2('0x51')]({'where':{'id':_0x42993e[_0x5ff2('0x54')]['id']}})[_0x5ff2('0x1f')](handleEntityNotFound(_0x2290ee,null))[_0x5ff2('0x1f')](removeEntity(_0x2290ee,null))[_0x5ff2('0x4c')](handleError(_0x2290ee,null));};exports['describe']=function(_0x6dedab,_0x5ca7f8){return db[_0x5ff2('0x37')][_0x5ff2('0x55')]()['then'](respondWithResult(_0x5ca7f8,null))[_0x5ff2('0x4c')](handleError(_0x5ca7f8,null));};var interaction_log=require(_0x5ff2('0xf'))(_0x5ff2('0x56'));exports['accept']=function(_0x411e7f,_0x1765fe,_0x19e2a3){var _0x32f069={'agent':{},'channel':_0x5ff2('0x57')};if(_0x411e7f[_0x5ff2('0x53')]['id']){delete _0x411e7f['body']['id'];}_0x411e7f[_0x5ff2('0x53')][_0x5ff2('0x58')]=!![];_0x411e7f['body'][_0x5ff2('0x59')]=moment()[_0x5ff2('0x5a')](_0x5ff2('0x5b'));_0x411e7f[_0x5ff2('0x53')]['UserId']=_0x411e7f[_0x5ff2('0x53')][_0x5ff2('0x5c')]||_0x411e7f[_0x5ff2('0x5d')]['id'];_0x32f069[_0x5ff2('0x5e')]['id']=_0x411e7f[_0x5ff2('0x53')][_0x5ff2('0x5c')];return db[_0x5ff2('0x37')][_0x5ff2('0x51')]({'where':{'id':_0x411e7f[_0x5ff2('0x54')]['id'],'UserId':null}})[_0x5ff2('0x1f')](handleEntityNotFound(_0x1765fe,null))[_0x5ff2('0x1f')](saveUpdates(_0x411e7f[_0x5ff2('0x53')],null))[_0x5ff2('0x1f')](function(_0x407b14){if(_0x407b14){_0x32f069[_0x5ff2('0x25')]=_0x407b14['get']({'plain':!![]});return db[_0x5ff2('0x5f')][_0x5ff2('0x51')]({'where':{'id':_0x407b14['WhatsappInteractionId']}});}return null;})[_0x5ff2('0x1f')](handleEntityNotFound(_0x1765fe,null))[_0x5ff2('0x1f')](function(_0x84299d){if(_0x84299d){return _0x84299d[_0x5ff2('0x60')]({'UserId':_0x411e7f[_0x5ff2('0x53')][_0x5ff2('0x5c')],'read1stAt':_[_0x5ff2('0x61')](_0x84299d[_0x5ff2('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5ff2('0x1f')](function(_0x5d985b){if(_0x5d985b){_0x32f069[_0x5ff2('0x63')]=_0x5d985b[_0x5ff2('0x64')]({'plain':!![]});interaction_log[_0x5ff2('0x26')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x411e7f[_0x5ff2('0x5d')]['id'],_0x411e7f[_0x5ff2('0x5d')][_0x5ff2('0x65')],_0x411e7f[_0x5ff2('0x5d')]['role'],_0x32f069[_0x5ff2('0x63')]['id'],_0x411e7f[_0x5ff2('0x53')]?JSON[_0x5ff2('0x66')](_0x411e7f['body']):_0x5ff2('0x67'));return respondWithRpcPromise(_0x5ff2('0x68'),_0x5ff2('0x69'),_0x32f069);}return null;})[_0x5ff2('0x1f')](function(_0x156f16){var _0x3b60f7=_0x5ff2('0x6a')+_0x156f16[_0x5ff2('0x25')][_0x5ff2('0x6b')];return db[_0x5ff2('0x6c')][_0x5ff2('0x3a')](_0x3b60f7,{'type':db[_0x5ff2('0x6d')][_0x5ff2('0x6e')][_0x5ff2('0x6f')],'raw':!![]})['then'](function(_0x4208cf){return _0x4208cf;});})['then'](function(_0xd739){if(_0xd739){_0x32f069['message'][_0x5ff2('0x70')]=_0xd739[0x0];if(!_0x411e7f[_0x5ff2('0x53')][_0x5ff2('0x5c')])return;return db['User'][_0x5ff2('0x51')]({'where':{'id':_0x411e7f['body'][_0x5ff2('0x5c')],'role':'agent'},'attributes':['id','name',_0x5ff2('0x71'),_0x5ff2('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x51f4e6){if(!_0x51f4e6)return null;_0x32f069[_0x5ff2('0x25')]['agent']=_0x51f4e6;return _0x32f069;})[_0x5ff2('0x1f')](function(_0x5424d6){if(_0x5424d6){if(_0x411e7f['body']['manual']){_0x32f069[_0x5ff2('0x25')][_0x5ff2('0x73')]=util[_0x5ff2('0x5a')]('SIP/%s',_0x411e7f[_0x5ff2('0x5d')][_0x5ff2('0x65')]);_0x32f069[_0x5ff2('0x25')]['channel']=_0x32f069[_0x5ff2('0x74')];_0x32f069[_0x5ff2('0x25')][_0x5ff2('0x75')]=_0x32f069['channel'];_0x32f069[_0x5ff2('0x25')][_0x5ff2('0x76')]=_0x5ff2('0x77');return respondWithRpcPromise('EventManager',_0x5ff2('0x78'),{'event':_0x5ff2('0x79'),'message':_0x32f069[_0x5ff2('0x25')]},client9002)['then'](function(){return _0x32f069;});}return _0x32f069;}return null;})['then'](respondWithResult(_0x1765fe,null))[_0x5ff2('0x4c')](handleError(_0x1765fe,null));};var interaction_log=require(_0x5ff2('0xf'))(_0x5ff2('0x56'));exports[_0x5ff2('0x31')]=function(_0x4c76ef,_0x588f3b,_0x48dde3){var _0x25354b={'agent':{},'channel':_0x5ff2('0x57')};if(_0x4c76ef[_0x5ff2('0x53')]['id']){delete _0x4c76ef[_0x5ff2('0x53')]['id'];}_0x4c76ef['body'][_0x5ff2('0x5c')]=_0x4c76ef[_0x5ff2('0x53')][_0x5ff2('0x5c')]||_0x4c76ef[_0x5ff2('0x5d')]['id'];_0x25354b[_0x5ff2('0x5e')]['id']=_0x4c76ef[_0x5ff2('0x53')][_0x5ff2('0x5c')];return db['WhatsappMessage'][_0x5ff2('0x51')]({'where':{'id':_0x4c76ef['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x588f3b,null))[_0x5ff2('0x1f')](function(_0x4abbfd){if(_0x4abbfd){_0x25354b['message']=_0x4abbfd['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4abbfd[_0x5ff2('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x588f3b,null))[_0x5ff2('0x1f')](function(_0x519ef8){if(_0x519ef8){_0x25354b[_0x5ff2('0x63')]=_0x519ef8[_0x5ff2('0x64')]({'plain':!![]});interaction_log['info'](_0x5ff2('0x7b'),_0x4c76ef[_0x5ff2('0x5d')]['id'],_0x4c76ef[_0x5ff2('0x5d')][_0x5ff2('0x65')],_0x4c76ef[_0x5ff2('0x5d')][_0x5ff2('0x7c')],_0x25354b[_0x5ff2('0x63')]['id'],_0x4c76ef[_0x5ff2('0x53')]?JSON[_0x5ff2('0x66')](_0x4c76ef[_0x5ff2('0x53')]):_0x5ff2('0x67'));return respondWithRpcPromise(_0x5ff2('0x7d'),_0x5ff2('0x7e'),_0x25354b);}return null;})[_0x5ff2('0x1f')](function(_0x5a4421){var _0x1b5e0c=_0x5ff2('0x6a')+_0x5a4421[_0x5ff2('0x25')]['ContactId'];return db['sequelize'][_0x5ff2('0x3a')](_0x1b5e0c,{'type':db[_0x5ff2('0x6d')][_0x5ff2('0x6e')][_0x5ff2('0x6f')],'raw':!![]})[_0x5ff2('0x1f')](function(_0x47a8c1){return _0x47a8c1;});})[_0x5ff2('0x1f')](function(_0x23a499){if(_0x23a499){_0x25354b[_0x5ff2('0x25')]['contact']=_0x23a499[0x0];if(!_0x4c76ef['body'][_0x5ff2('0x5c')])return;return db[_0x5ff2('0x7f')][_0x5ff2('0x51')]({'where':{'id':_0x4c76ef[_0x5ff2('0x53')][_0x5ff2('0x5c')],'role':_0x5ff2('0x5e')},'attributes':['id',_0x5ff2('0x65'),'fullname',_0x5ff2('0x72'),_0x5ff2('0x80')],'raw':!![]});}return null;})[_0x5ff2('0x1f')](function(_0x49d966){if(!_0x49d966)return null;_0x25354b['message'][_0x5ff2('0x5e')]=_0x49d966;return _0x25354b;})['then'](function(_0x139b6b){if(_0x139b6b){_0x139b6b[_0x5ff2('0x25')]['interface']=util[_0x5ff2('0x5a')](_0x5ff2('0x81'),_0x4c76ef[_0x5ff2('0x5d')][_0x5ff2('0x65')]);_0x139b6b[_0x5ff2('0x25')]['channel']=_0x25354b[_0x5ff2('0x74')];_0x139b6b[_0x5ff2('0x25')][_0x5ff2('0x75')]=_0x25354b[_0x5ff2('0x74')];_0x139b6b[_0x5ff2('0x25')]['event']=_0x5ff2('0x31');respondWithRpcPromise('EventManager','EventManager',{'event':_0x5ff2('0x82'),'message':_0x139b6b['message']},client9002);return _0x25354b;}return null;})[_0x5ff2('0x1f')](respondWithResult(_0x588f3b,null))[_0x5ff2('0x4c')](handleError(_0x588f3b,null));};exports[_0x5ff2('0x28')]=function(_0x186e19,_0x569bc0,_0x548462){if(_0x186e19['body']['id']){delete _0x186e19[_0x5ff2('0x53')]['id'];}var _0x1150a2;return db[_0x5ff2('0x37')][_0x5ff2('0x51')]({'where':{'id':_0x186e19[_0x5ff2('0x54')]['id']}})[_0x5ff2('0x1f')](handleEntityNotFound(_0x569bc0,null))['then'](function(_0x5d1618){if(_0x5d1618){_0x1150a2=_0x5d1618;return db['WhatsappAccount'][_0x5ff2('0x51')]({'where':{'id':_0x5d1618[_0x5ff2('0x83')]}});}})['then'](handleEntityNotFound(_0x569bc0,null))[_0x5ff2('0x1f')](function(_0x292b72){if(_0x292b72){logger[_0x5ff2('0x22')](_0x5ff2('0x84'),'status',_0x5ff2('0x85'),_0x292b72['type'],util[_0x5ff2('0x86')](_0x186e19[_0x5ff2('0x53')],{'showHidden':![],'depth':null}));switch(_0x292b72[_0x5ff2('0x87')]){case'twilio':if(_0x186e19['body']['MessageSid']&&_0x186e19['body'][_0x5ff2('0x88')]===_0x1150a2[_0x5ff2('0x89')]&&_0x186e19[_0x5ff2('0x53')][_0x5ff2('0x8a')]&&_0x186e19[_0x5ff2('0x53')][_0x5ff2('0x8a')]===_0x5ff2('0x58')){return _0x1150a2['update']({'read':!![]});}else{logger[_0x5ff2('0x24')](_0x5ff2('0x8b'),_0x5ff2('0x28'),_0x5ff2('0x8c'),util['inspect'](_0x186e19[_0x5ff2('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x1150a2;}})[_0x5ff2('0x1f')](respondWithResult(_0x569bc0,null))['catch'](handleError(_0x569bc0,null));}; \ No newline at end of file +var _0x8a40=['UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','event','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','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/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','WhatsappMessage','findAll','rows','show','params','includeAll','include','options','create','body','update','find','describe','../../config/logger','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x46c26f,_0x27eb55){var _0x35031e=function(_0x5877c1){while(--_0x5877c1){_0x46c26f['push'](_0x46c26f['shift']());}};_0x35031e(++_0x27eb55);}(_0x8a40,0x14e));var _0x08a4=function(_0x3aae4d,_0x18c535){_0x3aae4d=_0x3aae4d-0x0;var _0x9fad5f=_0x8a40[_0x3aae4d];return _0x9fad5f;};'use strict';var emlformat=require(_0x08a4('0x0'));var rimraf=require(_0x08a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08a4('0x2'));var rp=require(_0x08a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x08a4('0x4'));var util=require(_0x08a4('0x5'));var path=require(_0x08a4('0x6'));var sox=require(_0x08a4('0x7'));var csv=require(_0x08a4('0x8'));var ejs=require(_0x08a4('0x9'));var fs=require('fs');var fs_extra=require(_0x08a4('0xa'));var _=require(_0x08a4('0xb'));var squel=require(_0x08a4('0xc'));var crypto=require(_0x08a4('0xd'));var jsforce=require(_0x08a4('0xe'));var deskjs=require(_0x08a4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x08a4('0x10'));var authService=require(_0x08a4('0x11'));var qs=require(_0x08a4('0x12'));var as=require(_0x08a4('0x13'));var hardwareService=require(_0x08a4('0x14'));var logger=require('../../config/logger')(_0x08a4('0x15'));var utils=require(_0x08a4('0x16'));var config=require(_0x08a4('0x17'));var licenseUtil=require(_0x08a4('0x18'));var db=require(_0x08a4('0x19'))['db'];config['redis']=_[_0x08a4('0x1a')](config[_0x08a4('0x1b')],{'host':_0x08a4('0x1c'),'port':0x18eb});var socket=require(_0x08a4('0x1d'))(new Redis(config[_0x08a4('0x1b')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x08a4('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x08a4('0x1f')][_0x08a4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3b7fe0,_0x4c9657,_0x15a160,_0x153b30){return new BPromise(function(_0x4ee95e,_0x5393dc){var _0x7a211e=_0x153b30||client;return _0x7a211e[_0x08a4('0x21')](_0x3b7fe0,_0x15a160)[_0x08a4('0x22')](function(_0x552666){logger['info'](_0x08a4('0x23'),_0x4c9657,_0x08a4('0x24'));logger[_0x08a4('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4c9657,'request\x20sent',JSON[_0x08a4('0x26')](_0x552666));if(_0x552666[_0x08a4('0x27')]){if(_0x552666[_0x08a4('0x27')]['code']===0x1f4){logger['error'](_0x08a4('0x23'),_0x4c9657,_0x552666[_0x08a4('0x27')][_0x08a4('0x28')]);return _0x5393dc(_0x552666[_0x08a4('0x27')][_0x08a4('0x28')]);}logger[_0x08a4('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x4c9657,_0x552666[_0x08a4('0x27')][_0x08a4('0x28')]);return _0x4ee95e(_0x552666['error'][_0x08a4('0x28')]);}else{logger[_0x08a4('0x29')](_0x08a4('0x23'),_0x4c9657,_0x08a4('0x24'));_0x4ee95e(_0x552666['result'][_0x08a4('0x28')]);}})[_0x08a4('0x2a')](function(_0x4e834f){logger['error'](_0x08a4('0x23'),_0x4c9657,_0x4e834f);_0x5393dc(_0x4e834f);});});}function respondWithStatusCode(_0x1b9091,_0x54397d){_0x54397d=_0x54397d||0xcc;return function(_0x2d4819){if(_0x2d4819){return _0x1b9091[_0x08a4('0x2b')](_0x54397d);}return _0x1b9091[_0x08a4('0x2c')](_0x54397d)[_0x08a4('0x2d')]();};}function respondWithResult(_0x3ba5b6,_0x48362d){_0x48362d=_0x48362d||0xc8;return function(_0x23ec1c){if(_0x23ec1c){return _0x3ba5b6[_0x08a4('0x2c')](_0x48362d)[_0x08a4('0x2e')](_0x23ec1c);}};}function respondWithFilteredResult(_0x10718c,_0x12e201){return function(_0x450103){if(_0x450103){var _0x2cb041=typeof _0x12e201['offset']===_0x08a4('0x2f')&&typeof _0x12e201[_0x08a4('0x30')]===_0x08a4('0x2f');var _0x31b848=_0x450103[_0x08a4('0x31')];var _0x38d877=_0x2cb041?0x0:_0x12e201[_0x08a4('0x32')];var _0xa49697=_0x2cb041?_0x450103[_0x08a4('0x31')]:_0x12e201[_0x08a4('0x32')]+_0x12e201[_0x08a4('0x30')];var _0x16ebb3;if(_0xa49697>=_0x31b848){_0xa49697=_0x31b848;_0x16ebb3=0xc8;}else{_0x16ebb3=0xce;}_0x10718c[_0x08a4('0x2c')](_0x16ebb3);return _0x10718c[_0x08a4('0x33')](_0x08a4('0x34'),_0x38d877+'-'+_0xa49697+'/'+_0x31b848)[_0x08a4('0x2e')](_0x450103);}return null;};}function patchUpdates(_0x20146f){return function(_0x3158bb){try{jsonpatch[_0x08a4('0x35')](_0x3158bb,_0x20146f,!![]);}catch(_0x46baca){return BPromise[_0x08a4('0x36')](_0x46baca);}return _0x3158bb[_0x08a4('0x37')]();};}function saveUpdates(_0x2da619,_0x11cea9){return function(_0x642f25){if(_0x642f25){return _0x642f25['update'](_0x2da619)[_0x08a4('0x22')](function(_0x1cb8a8){return _0x1cb8a8;});}return null;};}function removeEntity(_0x58dc9b,_0x322bc4){return function(_0x2bb683){if(_0x2bb683){return _0x2bb683[_0x08a4('0x38')]()[_0x08a4('0x22')](function(){_0x58dc9b[_0x08a4('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x63aa3a,_0x4bb464){return function(_0x3c3e0c){if(!_0x3c3e0c){_0x63aa3a[_0x08a4('0x2b')](0x194);}return _0x3c3e0c;};}function handleError(_0x179048,_0x4f74df){_0x4f74df=_0x4f74df||0x1f4;return function(_0x2986f2){logger[_0x08a4('0x27')](_0x2986f2[_0x08a4('0x39')]);if(_0x2986f2[_0x08a4('0x3a')]){delete _0x2986f2[_0x08a4('0x3a')];}_0x179048[_0x08a4('0x2c')](_0x4f74df)[_0x08a4('0x3b')](_0x2986f2);};}exports[_0x08a4('0x3c')]=function(_0x596e85,_0x50b367){var _0x257c66={},_0x255ffe={},_0x3233a7={'count':0x0,'rows':[]};var _0x1870e2=_[_0x08a4('0x3d')](db['WhatsappMessage'][_0x08a4('0x3e')],function(_0x5dd3fd){return{'name':_0x5dd3fd[_0x08a4('0x3f')],'type':_0x5dd3fd[_0x08a4('0x40')]['key']};});_0x255ffe[_0x08a4('0x41')]=_[_0x08a4('0x3d')](_0x1870e2,_0x08a4('0x3a'));_0x255ffe[_0x08a4('0x42')]=_[_0x08a4('0x43')](_0x596e85[_0x08a4('0x42')]);_0x255ffe[_0x08a4('0x44')]=_[_0x08a4('0x45')](_0x255ffe['model'],_0x255ffe['query']);_0x257c66['attributes']=_['intersection'](_0x255ffe[_0x08a4('0x41')],qs[_0x08a4('0x46')](_0x596e85[_0x08a4('0x42')][_0x08a4('0x46')]));_0x257c66[_0x08a4('0x47')]=_0x257c66[_0x08a4('0x47')][_0x08a4('0x48')]?_0x257c66['attributes']:_0x255ffe[_0x08a4('0x41')];if(!_0x596e85[_0x08a4('0x42')][_0x08a4('0x49')](_0x08a4('0x4a'))){_0x257c66[_0x08a4('0x30')]=qs[_0x08a4('0x30')](_0x596e85['query'][_0x08a4('0x30')]);_0x257c66[_0x08a4('0x32')]=qs['offset'](_0x596e85[_0x08a4('0x42')][_0x08a4('0x32')]);}_0x257c66[_0x08a4('0x4b')]=qs['sort'](_0x596e85[_0x08a4('0x42')][_0x08a4('0x4c')]);_0x257c66[_0x08a4('0x4d')]=qs[_0x08a4('0x44')](_[_0x08a4('0x4e')](_0x596e85['query'],_0x255ffe[_0x08a4('0x44')]),_0x1870e2);if(_0x596e85[_0x08a4('0x42')][_0x08a4('0x4f')]){_0x257c66[_0x08a4('0x4d')]=_[_0x08a4('0x50')](_0x257c66[_0x08a4('0x4d')],{'$or':_[_0x08a4('0x3d')](_0x1870e2,function(_0xcdf97e){if(_0xcdf97e['type']!==_0x08a4('0x51')){var _0x59ee26={};_0x59ee26[_0xcdf97e[_0x08a4('0x3a')]]={'$like':'%'+_0x596e85['query']['filter']+'%'};return _0x59ee26;}})});}_0x257c66=_[_0x08a4('0x50')]({},_0x257c66,_0x596e85['options']);var _0x2e281e={'where':_0x257c66[_0x08a4('0x4d')]};return db[_0x08a4('0x52')][_0x08a4('0x31')](_0x2e281e)[_0x08a4('0x22')](function(_0x3ac060){_0x3233a7[_0x08a4('0x31')]=_0x3ac060;if(_0x596e85[_0x08a4('0x42')]['includeAll']){_0x257c66['include']=[{'all':!![]}];}return db[_0x08a4('0x52')][_0x08a4('0x53')](_0x257c66);})[_0x08a4('0x22')](function(_0x4fbed7){_0x3233a7[_0x08a4('0x54')]=_0x4fbed7;return _0x3233a7;})[_0x08a4('0x22')](respondWithFilteredResult(_0x50b367,_0x257c66))[_0x08a4('0x2a')](handleError(_0x50b367,null));};exports[_0x08a4('0x55')]=function(_0x1c6f93,_0x7445b0){var _0x2a4cfb={'raw':!![],'where':{'id':_0x1c6f93[_0x08a4('0x56')]['id']}},_0x2c4328={};_0x2c4328[_0x08a4('0x41')]=_[_0x08a4('0x43')](db[_0x08a4('0x52')][_0x08a4('0x3e')]);_0x2c4328[_0x08a4('0x42')]=_['keys'](_0x1c6f93[_0x08a4('0x42')]);_0x2c4328[_0x08a4('0x44')]=_['intersection'](_0x2c4328[_0x08a4('0x41')],_0x2c4328[_0x08a4('0x42')]);_0x2a4cfb['attributes']=_[_0x08a4('0x45')](_0x2c4328[_0x08a4('0x41')],qs['fields'](_0x1c6f93[_0x08a4('0x42')]['fields']));_0x2a4cfb['attributes']=_0x2a4cfb[_0x08a4('0x47')][_0x08a4('0x48')]?_0x2a4cfb[_0x08a4('0x47')]:_0x2c4328[_0x08a4('0x41')];if(_0x1c6f93[_0x08a4('0x42')][_0x08a4('0x57')]){_0x2a4cfb[_0x08a4('0x58')]=[{'all':!![]}];}_0x2a4cfb=_[_0x08a4('0x50')]({},_0x2a4cfb,_0x1c6f93[_0x08a4('0x59')]);return db[_0x08a4('0x52')]['find'](_0x2a4cfb)[_0x08a4('0x22')](handleEntityNotFound(_0x7445b0,null))[_0x08a4('0x22')](respondWithResult(_0x7445b0,null))[_0x08a4('0x2a')](handleError(_0x7445b0,null));};exports['create']=function(_0x188545,_0x498065){return db['WhatsappMessage'][_0x08a4('0x5a')](_0x188545[_0x08a4('0x5b')],{})[_0x08a4('0x22')](respondWithResult(_0x498065,0xc9))[_0x08a4('0x2a')](handleError(_0x498065,null));};exports[_0x08a4('0x5c')]=function(_0x2647d4,_0x4f4667){if(_0x2647d4[_0x08a4('0x5b')]['id']){delete _0x2647d4[_0x08a4('0x5b')]['id'];}return db[_0x08a4('0x52')][_0x08a4('0x5d')]({'where':{'id':_0x2647d4['params']['id']}})[_0x08a4('0x22')](handleEntityNotFound(_0x4f4667,null))[_0x08a4('0x22')](saveUpdates(_0x2647d4[_0x08a4('0x5b')],null))[_0x08a4('0x22')](respondWithResult(_0x4f4667,null))[_0x08a4('0x2a')](handleError(_0x4f4667,null));};exports[_0x08a4('0x38')]=function(_0xa7b581,_0x28d736){return db['WhatsappMessage'][_0x08a4('0x5d')]({'where':{'id':_0xa7b581[_0x08a4('0x56')]['id']}})['then'](handleEntityNotFound(_0x28d736,null))[_0x08a4('0x22')](removeEntity(_0x28d736,null))[_0x08a4('0x2a')](handleError(_0x28d736,null));};exports[_0x08a4('0x5e')]=function(_0x6e1ee6,_0x583e1b){return db[_0x08a4('0x52')][_0x08a4('0x5e')]()[_0x08a4('0x22')](respondWithResult(_0x583e1b,null))[_0x08a4('0x2a')](handleError(_0x583e1b,null));};var interaction_log=require(_0x08a4('0x5f'))('whatsapp-interactions');exports['accept']=function(_0xc395a4,_0x9487fa,_0x235d2d){var _0x23ed27={'agent':{},'channel':_0x08a4('0x60')};if(_0xc395a4[_0x08a4('0x5b')]['id']){delete _0xc395a4[_0x08a4('0x5b')]['id'];}_0xc395a4['body'][_0x08a4('0x61')]=!![];_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x62')]=moment()[_0x08a4('0x63')](_0x08a4('0x64'));_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x65')]=_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x65')]||_0xc395a4['user']['id'];_0x23ed27[_0x08a4('0x66')]['id']=_0xc395a4['body'][_0x08a4('0x65')];return db[_0x08a4('0x52')]['find']({'where':{'id':_0xc395a4[_0x08a4('0x56')]['id'],'UserId':null}})[_0x08a4('0x22')](handleEntityNotFound(_0x9487fa,null))[_0x08a4('0x22')](saveUpdates(_0xc395a4[_0x08a4('0x5b')],null))['then'](function(_0x519217){if(_0x519217){_0x23ed27[_0x08a4('0x28')]=_0x519217[_0x08a4('0x67')]({'plain':!![]});return db[_0x08a4('0x68')][_0x08a4('0x5d')]({'where':{'id':_0x519217[_0x08a4('0x69')]}});}return null;})[_0x08a4('0x22')](handleEntityNotFound(_0x9487fa,null))[_0x08a4('0x22')](function(_0x2cf4ea){if(_0x2cf4ea){return _0x2cf4ea['update']({'UserId':_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x65')],'read1stAt':_[_0x08a4('0x6a')](_0x2cf4ea[_0x08a4('0x6b')])?moment()[_0x08a4('0x63')](_0x08a4('0x64')):undefined});}return null;})['then'](function(_0xab542d){if(_0xab542d){_0x23ed27['interaction']=_0xab542d['get']({'plain':!![]});interaction_log['info'](_0x08a4('0x6c'),_0xc395a4[_0x08a4('0x6d')]['id'],_0xc395a4['user'][_0x08a4('0x3a')],_0xc395a4[_0x08a4('0x6d')][_0x08a4('0x6e')],_0x23ed27[_0x08a4('0x6f')]['id'],_0xc395a4[_0x08a4('0x5b')]?JSON[_0x08a4('0x26')](_0xc395a4[_0x08a4('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x08a4('0x70'),_0x23ed27);}return null;})[_0x08a4('0x22')](function(_0x50e30a){var _0xe8784f=_0x08a4('0x71')+_0x50e30a[_0x08a4('0x28')][_0x08a4('0x72')];return db[_0x08a4('0x73')][_0x08a4('0x42')](_0xe8784f,{'type':db[_0x08a4('0x74')][_0x08a4('0x75')][_0x08a4('0x76')],'raw':!![]})['then'](function(_0x20f30b){return _0x20f30b;});})[_0x08a4('0x22')](function(_0x300d84){if(_0x300d84){_0x23ed27[_0x08a4('0x28')][_0x08a4('0x77')]=_0x300d84[0x0];if(!_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x65')])return;return db[_0x08a4('0x78')][_0x08a4('0x5d')]({'where':{'id':_0xc395a4[_0x08a4('0x5b')]['UserId'],'role':_0x08a4('0x66')},'attributes':['id',_0x08a4('0x3a'),_0x08a4('0x79'),_0x08a4('0x7a'),'internal'],'raw':!![]});}return null;})[_0x08a4('0x22')](function(_0x4360eb){if(!_0x4360eb)return null;_0x23ed27['message']['agent']=_0x4360eb;return _0x23ed27;})['then'](function(_0x41f55){if(_0x41f55){if(_0xc395a4[_0x08a4('0x5b')][_0x08a4('0x7b')]){_0x23ed27[_0x08a4('0x28')][_0x08a4('0x7c')]=util[_0x08a4('0x63')](_0x08a4('0x7d'),_0xc395a4[_0x08a4('0x6d')][_0x08a4('0x3a')]);_0x23ed27['message']['channel']=_0x23ed27[_0x08a4('0x7e')];_0x23ed27[_0x08a4('0x28')][_0x08a4('0x7f')]=_0x23ed27[_0x08a4('0x7e')];_0x23ed27[_0x08a4('0x28')]['event']='accept';return respondWithRpcPromise(_0x08a4('0x80'),_0x08a4('0x80'),{'event':_0x08a4('0x81'),'message':_0x23ed27['message']},client9002)[_0x08a4('0x22')](function(){return _0x23ed27;});}return _0x23ed27;}return null;})['then'](respondWithResult(_0x9487fa,null))['catch'](handleError(_0x9487fa,null));};var interaction_log=require(_0x08a4('0x5f'))(_0x08a4('0x82'));exports['reject']=function(_0x4cf9f8,_0x4c75c1,_0x33f632){var _0x569503={'agent':{},'channel':_0x08a4('0x60')};if(_0x4cf9f8['body']['id']){delete _0x4cf9f8[_0x08a4('0x5b')]['id'];}_0x4cf9f8[_0x08a4('0x5b')][_0x08a4('0x65')]=_0x4cf9f8[_0x08a4('0x5b')][_0x08a4('0x65')]||_0x4cf9f8[_0x08a4('0x6d')]['id'];_0x569503[_0x08a4('0x66')]['id']=_0x4cf9f8['body'][_0x08a4('0x65')];return db[_0x08a4('0x52')][_0x08a4('0x5d')]({'where':{'id':_0x4cf9f8[_0x08a4('0x56')]['id'],'UserId':null}})[_0x08a4('0x22')](handleEntityNotFound(_0x4c75c1,null))[_0x08a4('0x22')](function(_0x54c681){if(_0x54c681){_0x569503[_0x08a4('0x28')]=_0x54c681[_0x08a4('0x67')]({'plain':!![]});return db[_0x08a4('0x68')][_0x08a4('0x5d')]({'where':{'id':_0x54c681[_0x08a4('0x69')]}});}return null;})[_0x08a4('0x22')](handleEntityNotFound(_0x4c75c1,null))[_0x08a4('0x22')](function(_0x6b89d2){if(_0x6b89d2){_0x569503['interaction']=_0x6b89d2[_0x08a4('0x67')]({'plain':!![]});interaction_log[_0x08a4('0x29')](_0x08a4('0x83'),_0x4cf9f8[_0x08a4('0x6d')]['id'],_0x4cf9f8['user'][_0x08a4('0x3a')],_0x4cf9f8[_0x08a4('0x6d')]['role'],_0x569503[_0x08a4('0x6f')]['id'],_0x4cf9f8['body']?JSON[_0x08a4('0x26')](_0x4cf9f8[_0x08a4('0x5b')]):_0x08a4('0x84'));return respondWithRpcPromise(_0x08a4('0x85'),_0x08a4('0x86'),_0x569503);}return null;})['then'](function(_0x5a4ef1){var _0x2755b5=_0x08a4('0x71')+_0x5a4ef1[_0x08a4('0x28')][_0x08a4('0x72')];return db[_0x08a4('0x73')][_0x08a4('0x42')](_0x2755b5,{'type':db['Sequelize'][_0x08a4('0x75')][_0x08a4('0x76')],'raw':!![]})[_0x08a4('0x22')](function(_0x73bd87){return _0x73bd87;});})[_0x08a4('0x22')](function(_0x44d9df){if(_0x44d9df){_0x569503[_0x08a4('0x28')]['contact']=_0x44d9df[0x0];if(!_0x4cf9f8['body'][_0x08a4('0x65')])return;return db[_0x08a4('0x78')][_0x08a4('0x5d')]({'where':{'id':_0x4cf9f8[_0x08a4('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x08a4('0x3a'),_0x08a4('0x79'),_0x08a4('0x7a'),'internal'],'raw':!![]});}return null;})[_0x08a4('0x22')](function(_0x2a16c0){if(!_0x2a16c0)return null;_0x569503[_0x08a4('0x28')][_0x08a4('0x66')]=_0x2a16c0;return _0x569503;})[_0x08a4('0x22')](function(_0x29bc15){if(_0x29bc15){_0x29bc15[_0x08a4('0x28')][_0x08a4('0x7c')]=util[_0x08a4('0x63')](_0x08a4('0x7d'),_0x4cf9f8['user'][_0x08a4('0x3a')]);_0x29bc15['message']['channel']=_0x569503[_0x08a4('0x7e')];_0x29bc15[_0x08a4('0x28')][_0x08a4('0x7f')]=_0x569503[_0x08a4('0x7e')];_0x29bc15[_0x08a4('0x28')][_0x08a4('0x87')]=_0x08a4('0x36');respondWithRpcPromise(_0x08a4('0x80'),'EventManager',{'event':_0x08a4('0x88'),'message':_0x29bc15[_0x08a4('0x28')]},client9002);return _0x569503;}return null;})[_0x08a4('0x22')](respondWithResult(_0x4c75c1,null))[_0x08a4('0x2a')](handleError(_0x4c75c1,null));};exports[_0x08a4('0x2c')]=function(_0x4b9483,_0x2b00fe,_0x38aa98){if(_0x4b9483['body']['id']){delete _0x4b9483[_0x08a4('0x5b')]['id'];}var _0x12454b;return db[_0x08a4('0x52')][_0x08a4('0x5d')]({'where':{'id':_0x4b9483['params']['id']}})['then'](handleEntityNotFound(_0x2b00fe,null))[_0x08a4('0x22')](function(_0x53a226){if(_0x53a226){_0x12454b=_0x53a226;return db[_0x08a4('0x89')][_0x08a4('0x5d')]({'where':{'id':_0x53a226['WhatsappAccountId']}});}})[_0x08a4('0x22')](handleEntityNotFound(_0x2b00fe,null))[_0x08a4('0x22')](function(_0x4995e9){if(_0x4995e9){logger[_0x08a4('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x08a4('0x2c'),_0x08a4('0x8a'),_0x4995e9[_0x08a4('0x40')],util[_0x08a4('0x8b')](_0x4b9483['body'],{'showHidden':![],'depth':null}));switch(_0x4995e9[_0x08a4('0x40')]){case _0x08a4('0x8c'):if(_0x4b9483[_0x08a4('0x5b')][_0x08a4('0x8d')]&&_0x4b9483['body'][_0x08a4('0x8d')]===_0x12454b[_0x08a4('0x8e')]&&_0x4b9483[_0x08a4('0x5b')][_0x08a4('0x8f')]&&_0x4b9483[_0x08a4('0x5b')][_0x08a4('0x8f')]==='read'){return _0x12454b[_0x08a4('0x5c')]({'read':!![]});}else{logger[_0x08a4('0x27')](_0x08a4('0x90'),_0x08a4('0x2c'),_0x08a4('0x8c'),util[_0x08a4('0x8b')](_0x4b9483[_0x08a4('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x12454b;}})[_0x08a4('0x22')](respondWithResult(_0x2b00fe,null))['catch'](handleError(_0x2b00fe,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 556f482..2526440 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 _0x574d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x38d082,_0x17c03c){var _0xfc4cb9=function(_0x593301){while(--_0x593301){_0x38d082['push'](_0x38d082['shift']());}};_0xfc4cb9(++_0x17c03c);}(_0x574d,0xc0));var _0xd574=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x574d[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xd574('0x0'));var WhatsappMessage=require(_0xd574('0x1'))['db'][_0xd574('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd574('0x3')](0x0);var events={'afterCreate':_0xd574('0x4'),'afterUpdate':_0xd574('0x5'),'afterDestroy':_0xd574('0x6')};function emitEvent(_0x593d3c){return function(_0x2a54ff,_0x1be154,_0x469ad7){WhatsappMessageEvents[_0xd574('0x7')](_0x593d3c+':'+_0x2a54ff['id'],_0x2a54ff);WhatsappMessageEvents['emit'](_0x593d3c,_0x2a54ff);_0x469ad7(null);};}for(var e in events){if(events[_0xd574('0x8')](e)){var event=events[e];WhatsappMessage[_0xd574('0x9')](e,emitEvent(event));}}module[_0xd574('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0xa45c=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save'];(function(_0x451d06,_0x3039d2){var _0x5a4be0=function(_0xea23fa){while(--_0xea23fa){_0x451d06['push'](_0x451d06['shift']());}};_0x5a4be0(++_0x3039d2);}(_0xa45c,0x6d));var _0xca45=function(_0x2390bd,_0x42d055){_0x2390bd=_0x2390bd-0x0;var _0x47a7cd=_0xa45c[_0x2390bd];return _0x47a7cd;};'use strict';var EventEmitter=require(_0xca45('0x0'));var WhatsappMessage=require(_0xca45('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca45('0x2'),'afterUpdate':'update','afterDestroy':_0xca45('0x3')};function emitEvent(_0x52e027){return function(_0x16a36c,_0x47d8b9,_0x4d45e6){WhatsappMessageEvents[_0xca45('0x4')](_0x52e027+':'+_0x16a36c['id'],_0x16a36c);WhatsappMessageEvents[_0xca45('0x4')](_0x52e027,_0x16a36c);_0x4d45e6(null);};}for(var e in events){if(events[_0xca45('0x5')](e)){var event=events[e];WhatsappMessage[_0xca45('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 8016c3c..73c8ef0 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 _0x453e=['/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','findOne','then','update','createdAt','catch','error','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','create','whatsapp:','/api/whatsapp/messages/','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl'];(function(_0x1b06ae,_0x3db6f1){var _0x5f4972=function(_0x3b5bbc){while(--_0x3b5bbc){_0x1b06ae['push'](_0x1b06ae['shift']());}};_0x5f4972(++_0x3db6f1);}(_0x453e,0xdd));var _0xe453=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0x453e[_0x299027];return _0x1bc622;};'use strict';var _=require(_0xe453('0x0'));var util=require('util');var logger=require(_0xe453('0x1'))(_0xe453('0x2'));var moment=require(_0xe453('0x3'));var BPromise=require('bluebird');var rp=require(_0xe453('0x4'));var fetch=require(_0xe453('0x5'));var fs=require('fs');var path=require(_0xe453('0x6'));var rimraf=require(_0xe453('0x7'));var config=require(_0xe453('0x8'));var attributes=require(_0xe453('0x9'));module['exports']=function(_0x23f399,_0x4981de){return _0x23f399[_0xe453('0xa')](_0xe453('0xb'),attributes,{'tableName':_0xe453('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe453('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0xe453('0xe')],'type':_0xe453('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x348df6,_0x33b34e,_0x34d12b){var _0x37cadc=_0x23f399[_0xe453('0x10')];var _0x2eeb4f=_0x348df6['get']({'plain':!![]});if(_0x2eeb4f[_0xe453('0x11')][_0xe453('0x12')]()==='in'||_0x2eeb4f[_0xe453('0x11')][_0xe453('0x12')]()===_0xe453('0x13')&&!_0x2eeb4f[_0xe453('0x14')]&&!_[_0xe453('0x15')](_0x2eeb4f['UserId'])){_0x37cadc['WhatsappInteraction'][_0xe453('0x16')]({'where':{'id':_0x2eeb4f['WhatsappInteractionId']}})[_0xe453('0x17')](function(_0x27a545){if(_0x27a545){_0x27a545[_0xe453('0x18')]({'lastMsgAt':_0x2eeb4f[_0xe453('0x19')],'lastMsgDirection':_0x2eeb4f['direction'][_0xe453('0x12')]()});}})[_0xe453('0x1a')](function(_0x319920){console[_0xe453('0x1b')](_0x319920);});}if(_0x2eeb4f['direction']===_0xe453('0x13')&&!_0x2eeb4f[_0xe453('0x14')]){var _0x56cfb0;_0x37cadc['WhatsappAccount'][_0xe453('0x1c')]({'where':{'id':_0x2eeb4f[_0xe453('0x1d')]},'raw':!![]})['then'](function(_0x35fb53){_0x56cfb0=_0x35fb53;if(_0x56cfb0&&_0x56cfb0[_0xe453('0x1e')]){switch(_0x56cfb0['type']){case _0xe453('0x1f'):var _0x797062=require(_0xe453('0x1f'));if(_0x56cfb0[_0xe453('0x20')]&&_0x56cfb0['authToken']&&_0x56cfb0[_0xe453('0x21')]){var _0x580df9=new _0x797062(_0x56cfb0['accountSid'],_0x56cfb0[_0xe453('0x22')]);_0x580df9['messages'][_0xe453('0x23')]({'body':_0x2eeb4f[_0xe453('0xe')],'to':_0xe453('0x24')+_0x2eeb4f['phone'],'from':_0xe453('0x24')+_0x56cfb0[_0xe453('0x21')],'statusCallback':_0x56cfb0['remote']+_0xe453('0x25')+_0x2eeb4f['id']+'/status?token='+_0x56cfb0['token']})['then'](function(_0x1ae21c){if(_0x1ae21c['sid']){return _0x348df6[_0xe453('0x18')]({'messageId':_0x1ae21c[_0xe453('0x26')]});}})[_0xe453('0x1a')](function(_0x224c31){logger[_0xe453('0x1b')](_0xe453('0x27'),_0xe453('0x28'),'twilio',util[_0xe453('0x29')](_0x224c31,{'showHidden':![],'depth':null}));});}else{logger[_0xe453('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe453('0x28'),_0xe453('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe453('0x2a'):var _0x26f419=_0x56cfb0[_0xe453('0x20')];var _0x49f855=_0x56cfb0[_0xe453('0x22')];var _0x383acf=_0x56cfb0[_0xe453('0x2b')]+_0xe453('0x2c')+_0x26f419+_0xe453('0x2d');var _0x4a418e={'to':[_0x2eeb4f[_0xe453('0x21')]],'message':{'type':'text','text':_0x2eeb4f[_0xe453('0xe')]}};var _0xc1235a={'method':_0xe453('0x2e'),'uri':_0x383acf,'headers':{'Authorization':_0xe453('0x2f')+_0x49f855,'Content-Type':_0xe453('0x30')},'body':_0x4a418e,'json':!![]};rp(_0xc1235a)[_0xe453('0x17')](function(_0x1cd5f5){if(_0x1cd5f5[_0xe453('0x31')][0x0][_0xe453('0x32')]){return _0x348df6['update']({'messageId':_0x1cd5f5['statuses'][0x0][_0xe453('0x32')]});}})[_0xe453('0x1a')](function(_0x427d1f){logger['err']('WhatsappMessage,\x20%s',_0x427d1f);});break;}}})['finally'](function(){_0x34d12b();});}else{_0x34d12b();}}},'charset':_0xe453('0x33'),'collate':_0xe453('0x34')});}; \ No newline at end of file +var _0x2188=['type','twilio','accountSid','authToken','messages','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','baseUrl','/messages/','text','Bearer\x20','application/json','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','secret','WhatsappAccount','find'];(function(_0x5991e6,_0x14e330){var _0x2b9b05=function(_0x13cb3d){while(--_0x13cb3d){_0x5991e6['push'](_0x5991e6['shift']());}};_0x2b9b05(++_0x14e330);}(_0x2188,0x142));var _0x8218=function(_0x5da3db,_0x721915){_0x5da3db=_0x5da3db-0x0;var _0x30c7c4=_0x2188[_0x5da3db];return _0x30c7c4;};'use strict';var _=require('lodash');var util=require(_0x8218('0x0'));var logger=require(_0x8218('0x1'))(_0x8218('0x2'));var moment=require(_0x8218('0x3'));var BPromise=require(_0x8218('0x4'));var rp=require('request-promise');var fetch=require(_0x8218('0x5'));var fs=require('fs');var path=require(_0x8218('0x6'));var rimraf=require(_0x8218('0x7'));var config=require(_0x8218('0x8'));var attributes=require(_0x8218('0x9'));module[_0x8218('0xa')]=function(_0x29e58b,_0x305ae4){return _0x29e58b[_0x8218('0xb')](_0x8218('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8218('0xd'),'fields':[_0x8218('0xd')]},{'name':_0x8218('0xe'),'fields':['body'],'type':_0x8218('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b5ce5,_0x4bca0d,_0x3fa2a3){var _0x1927c7=_0x29e58b[_0x8218('0x10')];var _0x735899=_0x2b5ce5[_0x8218('0x11')]({'plain':!![]});if(_0x735899[_0x8218('0x12')][_0x8218('0x13')]()==='in'||_0x735899[_0x8218('0x12')][_0x8218('0x13')]()===_0x8218('0x14')&&!_0x735899['secret']&&!_['isNil'](_0x735899[_0x8218('0x15')])){_0x1927c7[_0x8218('0x16')][_0x8218('0x17')]({'where':{'id':_0x735899[_0x8218('0x18')]}})[_0x8218('0x19')](function(_0xe189ec){if(_0xe189ec){_0xe189ec[_0x8218('0x1a')]({'lastMsgAt':_0x735899[_0x8218('0x1b')],'lastMsgDirection':_0x735899['direction'][_0x8218('0x13')]()});}})['catch'](function(_0x12c328){console[_0x8218('0x1c')](_0x12c328);});}if(_0x735899[_0x8218('0x12')]===_0x8218('0x14')&&!_0x735899[_0x8218('0x1d')]){var _0x812952;_0x1927c7[_0x8218('0x1e')][_0x8218('0x1f')]({'where':{'id':_0x735899['WhatsappAccountId']},'raw':!![]})[_0x8218('0x19')](function(_0x20b362){_0x812952=_0x20b362;if(_0x812952&&_0x812952[_0x8218('0x20')]){switch(_0x812952[_0x8218('0x20')]){case _0x8218('0x21'):var _0x252d9f=require(_0x8218('0x21'));if(_0x812952[_0x8218('0x22')]&&_0x812952['authToken']&&_0x812952['phone']){var _0x3144c3=new _0x252d9f(_0x812952[_0x8218('0x22')],_0x812952[_0x8218('0x23')]);_0x3144c3[_0x8218('0x24')]['create']({'body':_0x735899[_0x8218('0x25')],'to':_0x8218('0x26')+_0x735899[_0x8218('0x27')],'from':_0x8218('0x26')+_0x812952['phone'],'statusCallback':_0x812952[_0x8218('0x28')]+_0x8218('0x29')+_0x735899['id']+_0x8218('0x2a')+_0x812952[_0x8218('0x2b')]})['then'](function(_0x387c8d){if(_0x387c8d[_0x8218('0x2c')]){return _0x2b5ce5['update']({'messageId':_0x387c8d[_0x8218('0x2c')]});}})[_0x8218('0x2d')](function(_0x2fa93f){logger[_0x8218('0x1c')](_0x8218('0x2e'),_0x8218('0x2f'),_0x8218('0x21'),util['inspect'](_0x2fa93f,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8218('0x2f'),_0x8218('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8218('0x30'):var _0x292dcf=_0x812952[_0x8218('0x22')];var _0x15cadb=_0x812952[_0x8218('0x23')];var _0x12f7b2=_0x812952[_0x8218('0x31')]+'/whatsapp/v1/'+_0x292dcf+_0x8218('0x32');var _0x4219db={'to':[_0x735899['phone']],'message':{'type':_0x8218('0x33'),'text':_0x735899[_0x8218('0x25')]}};var _0x525852={'method':'POST','uri':_0x12f7b2,'headers':{'Authorization':_0x8218('0x34')+_0x15cadb,'Content-Type':_0x8218('0x35')},'body':_0x4219db,'json':!![]};rp(_0x525852)['then'](function(_0x311be){if(_0x311be[_0x8218('0x36')][0x0][_0x8218('0x37')]){return _0x2b5ce5['update']({'messageId':_0x311be[_0x8218('0x36')][0x0][_0x8218('0x37')]});}})['catch'](function(_0x3d8eab){logger['err']('WhatsappMessage,\x20%s',_0x3d8eab);});break;}}})[_0x8218('0x38')](function(){_0x3fa2a3();});}else{_0x3fa2a3();}}},'charset':_0x8218('0x39'),'collate':_0x8218('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 5647743..3437a2a 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 _0xfec3=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateWhatsappMessage','create','body','options','raw','debug'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xfec3,0x1e0));var _0x3fec=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfec3[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3fec('0x0'));var util=require(_0x3fec('0x1'));var moment=require(_0x3fec('0x2'));var BPromise=require(_0x3fec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fec('0x4'));var db=require(_0x3fec('0x5'))['db'];var utils=require(_0x3fec('0x6'));var logger=require('../../config/logger')(_0x3fec('0x7'));var config=require(_0x3fec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fec('0x9')]['http']({'port':0x232a});config['redis']=_[_0x3fec('0xa')](config[_0x3fec('0xb')],{'host':_0x3fec('0xc'),'port':0x18eb});var socket=require(_0x3fec('0xd'))(new Redis(config[_0x3fec('0xb')]));require('./whatsappMessage.socket')[_0x3fec('0xe')](socket);function respondWithRpcPromise(_0x17b597,_0x3c16d4,_0x5ca321){return new BPromise(function(_0x4bb8a7,_0x4ec717){return client[_0x3fec('0xf')](_0x17b597,_0x5ca321)[_0x3fec('0x10')](function(_0x1b6271){logger['info'](_0x3fec('0x11'),_0x3c16d4,_0x3fec('0x12'));logger['debug'](_0x3fec('0x13'),_0x3c16d4,_0x3fec('0x12'),JSON[_0x3fec('0x14')](_0x1b6271));if(_0x1b6271[_0x3fec('0x15')]){if(_0x1b6271['error'][_0x3fec('0x16')]===0x1f4){logger[_0x3fec('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3c16d4,_0x1b6271[_0x3fec('0x15')][_0x3fec('0x17')]);return _0x4ec717(_0x1b6271[_0x3fec('0x15')][_0x3fec('0x17')]);}logger[_0x3fec('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3c16d4,_0x1b6271['error'][_0x3fec('0x17')]);return _0x4bb8a7(_0x1b6271[_0x3fec('0x15')][_0x3fec('0x17')]);}else{logger[_0x3fec('0x18')](_0x3fec('0x11'),_0x3c16d4,_0x3fec('0x12'));_0x4bb8a7(_0x1b6271['result']['message']);}})[_0x3fec('0x19')](function(_0x26c17d){logger['error'](_0x3fec('0x11'),_0x3c16d4,_0x26c17d);_0x4ec717(_0x26c17d);});});}exports[_0x3fec('0x1a')]=function(_0x585c41){var _0x221280=this;return new Promise(function(_0x1a83aa,_0x313e8b){return db['WhatsappMessage'][_0x3fec('0x1b')](_0x585c41[_0x3fec('0x1c')],{'raw':_0x585c41['options']?_0x585c41[_0x3fec('0x1d')][_0x3fec('0x1e')]===undefined?!![]:![]:!![]})[_0x3fec('0x10')](function(_0xc5c2f4){logger[_0x3fec('0x18')](_0x3fec('0x1a'),_0x585c41);logger[_0x3fec('0x1f')](_0x3fec('0x1a'),_0x585c41,JSON[_0x3fec('0x14')](_0xc5c2f4));_0x1a83aa(_0xc5c2f4);})[_0x3fec('0x19')](function(_0x5afc9b){logger['error'](_0x3fec('0x1a'),_0x5afc9b['message'],_0x585c41);_0x313e8b(_0x221280[_0x3fec('0x15')](0x1f4,_0x5afc9b[_0x3fec('0x17')]));});});}; \ No newline at end of file +var _0x75cf=['moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','WhatsappMessage','body','options','CreateWhatsappMessage','debug','util'];(function(_0xaa3920,_0xf1e091){var _0x384fc4=function(_0x217680){while(--_0x217680){_0xaa3920['push'](_0xaa3920['shift']());}};_0x384fc4(++_0xf1e091);}(_0x75cf,0x179));var _0xf75c=function(_0x1778df,_0x1ae849){_0x1778df=_0x1778df-0x0;var _0x26ae1c=_0x75cf[_0x1778df];return _0x26ae1c;};'use strict';var _=require('lodash');var util=require(_0xf75c('0x0'));var moment=require(_0xf75c('0x1'));var BPromise=require(_0xf75c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf75c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf75c('0x4'));var config=require(_0xf75c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf75c('0x6')][_0xf75c('0x7')]({'port':0x232a});config[_0xf75c('0x8')]=_[_0xf75c('0x9')](config[_0xf75c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf75c('0xa'))(new Redis(config[_0xf75c('0x8')]));require(_0xf75c('0xb'))[_0xf75c('0xc')](socket);function respondWithRpcPromise(_0x4392b4,_0x5b29cb,_0x1d76d9){return new BPromise(function(_0x2a312c,_0x3eb99a){return client[_0xf75c('0xd')](_0x4392b4,_0x1d76d9)['then'](function(_0x40e4b9){logger[_0xf75c('0xe')](_0xf75c('0xf'),_0x5b29cb,_0xf75c('0x10'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5b29cb,_0xf75c('0x10'),JSON[_0xf75c('0x11')](_0x40e4b9));if(_0x40e4b9[_0xf75c('0x12')]){if(_0x40e4b9[_0xf75c('0x12')][_0xf75c('0x13')]===0x1f4){logger[_0xf75c('0x12')](_0xf75c('0xf'),_0x5b29cb,_0x40e4b9[_0xf75c('0x12')][_0xf75c('0x14')]);return _0x3eb99a(_0x40e4b9[_0xf75c('0x12')][_0xf75c('0x14')]);}logger[_0xf75c('0x12')](_0xf75c('0xf'),_0x5b29cb,_0x40e4b9[_0xf75c('0x12')]['message']);return _0x2a312c(_0x40e4b9[_0xf75c('0x12')][_0xf75c('0x14')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5b29cb,_0xf75c('0x10'));_0x2a312c(_0x40e4b9['result']['message']);}})[_0xf75c('0x15')](function(_0x49886c){logger[_0xf75c('0x12')](_0xf75c('0xf'),_0x5b29cb,_0x49886c);_0x3eb99a(_0x49886c);});});}exports['CreateWhatsappMessage']=function(_0x25cb4c){var _0x56b9bf=this;return new Promise(function(_0x31ab96,_0x3a032c){return db[_0xf75c('0x16')]['create'](_0x25cb4c[_0xf75c('0x17')],{'raw':_0x25cb4c[_0xf75c('0x18')]?_0x25cb4c[_0xf75c('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x589d75){logger[_0xf75c('0xe')](_0xf75c('0x19'),_0x25cb4c);logger[_0xf75c('0x1a')](_0xf75c('0x19'),_0x25cb4c,JSON[_0xf75c('0x11')](_0x589d75));_0x31ab96(_0x589d75);})[_0xf75c('0x15')](function(_0x52294f){logger[_0xf75c('0x12')](_0xf75c('0x19'),_0x52294f[_0xf75c('0x14')],_0x25cb4c);_0x3a032c(_0x56b9bf[_0xf75c('0x12')](0x1f4,_0x52294f[_0xf75c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 492cd98..16d73b0 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 _0xc9d5=['removeListener','register','length','whatsappMessage:','save','remove','emit'];(function(_0x4dd733,_0x627c8b){var _0x4ff708=function(_0x378fc7){while(--_0x378fc7){_0x4dd733['push'](_0x4dd733['shift']());}};_0x4ff708(++_0x627c8b);}(_0xc9d5,0xc8));var _0x5c9d=function(_0x2432f2,_0x45fe3a){_0x2432f2=_0x2432f2-0x0;var _0x5750fe=_0xc9d5[_0x2432f2];return _0x5750fe;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x5c9d('0x0'),_0x5c9d('0x1'),'update'];function createListener(_0x1baebc,_0x42e9f1){return function(_0x5166de){_0x42e9f1[_0x5c9d('0x2')](_0x1baebc,_0x5166de);};}function removeListener(_0xc39152,_0x3ef0f3){return function(){WhatsappMessageEvents[_0x5c9d('0x3')](_0xc39152,_0x3ef0f3);};}exports[_0x5c9d('0x4')]=function(_0x58b908){for(var _0x58b024=0x0,_0x384d03=events[_0x5c9d('0x5')];_0x58b024<_0x384d03;_0x58b024++){var _0x5e7e81=events[_0x58b024];var _0x506cde=createListener(_0x5c9d('0x6')+_0x5e7e81,_0x58b908);WhatsappMessageEvents['on'](_0x5e7e81,_0x506cde);}}; \ No newline at end of file +var _0x22a6=['update','removeListener','register','whatsappMessage:','save','remove'];(function(_0xd29f03,_0x5c6fc5){var _0xecabd3=function(_0x2f6fc){while(--_0x2f6fc){_0xd29f03['push'](_0xd29f03['shift']());}};_0xecabd3(++_0x5c6fc5);}(_0x22a6,0xd0));var _0x622a=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x22a6[_0xf26c2e];return _0x46ecb4;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x622a('0x0'),_0x622a('0x1'),_0x622a('0x2')];function createListener(_0x31805b,_0x485612){return function(_0x30adb0){_0x485612['emit'](_0x31805b,_0x30adb0);};}function removeListener(_0x4fdc17,_0x5a1df6){return function(){WhatsappMessageEvents[_0x622a('0x3')](_0x4fdc17,_0x5a1df6);};}exports[_0x622a('0x4')]=function(_0x425aa9){for(var _0x33a1df=0x0,_0x2feaff=events['length'];_0x33a1df<_0x2feaff;_0x33a1df++){var _0x524280=events[_0x33a1df];var _0x5cb206=createListener(_0x622a('0x5')+_0x524280,_0x425aa9);WhatsappMessageEvents['on'](_0x524280,_0x5cb206);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 70e89c7..d8687e2 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 _0x13d7=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer'];(function(_0x558d2f,_0x36a0bf){var _0xafcf11=function(_0x10302e){while(--_0x10302e){_0x558d2f['push'](_0x558d2f['shift']());}};_0xafcf11(++_0x36a0bf);}(_0x13d7,0xa7));var _0x713d=function(_0x994307,_0x2e2762){_0x994307=_0x994307-0x0;var _0x503ced=_0x13d7[_0x994307];return _0x503ced;};'use strict';var multer=require(_0x713d('0x0'));var util=require(_0x713d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x713d('0x2'));var router=express[_0x713d('0x3')]();var fs_extra=require(_0x713d('0x4'));var auth=require(_0x713d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x713d('0x6'));var controller=require(_0x713d('0x7'));router['get']('/',auth[_0x713d('0x8')](),controller[_0x713d('0x9')]);router[_0x713d('0xa')](_0x713d('0xb'),auth['isAuthenticated'](),controller[_0x713d('0xc')]);router['get'](_0x713d('0xd'),auth[_0x713d('0x8')](),controller['show']);router[_0x713d('0xa')](_0x713d('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x713d('0xa')](_0x713d('0xf'),auth[_0x713d('0x8')](),controller[_0x713d('0x10')]);router[_0x713d('0xa')](_0x713d('0x11'),auth[_0x713d('0x8')](),controller[_0x713d('0x12')]);router[_0x713d('0x13')]('/',auth[_0x713d('0x8')](),controller['create']);router['post'](_0x713d('0xf'),auth[_0x713d('0x8')](),controller[_0x713d('0x14')]);router[_0x713d('0x13')](_0x713d('0x11'),auth[_0x713d('0x8')](),controller[_0x713d('0x15')]);router[_0x713d('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x713d('0x17')]);router[_0x713d('0x18')]('/:id',auth[_0x713d('0x8')](),controller[_0x713d('0x19')]);router['delete'](_0x713d('0xf'),auth[_0x713d('0x8')](),controller[_0x713d('0x1a')]);router[_0x713d('0x18')](_0x713d('0x11'),auth[_0x713d('0x8')](),controller[_0x713d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x7f32=['destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','delete'];(function(_0x1b64b3,_0x567e90){var _0x468d2b=function(_0x3106b0){while(--_0x3106b0){_0x1b64b3['push'](_0x1b64b3['shift']());}};_0x468d2b(++_0x567e90);}(_0x7f32,0x9a));var _0x27f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f32[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x27f3('0x0'));var util=require(_0x27f3('0x1'));var path=require('path');var timeout=require(_0x27f3('0x2'));var express=require(_0x27f3('0x3'));var router=express[_0x27f3('0x4')]();var fs_extra=require(_0x27f3('0x5'));var auth=require(_0x27f3('0x6'));var interaction=require(_0x27f3('0x7'));var config=require(_0x27f3('0x8'));var controller=require(_0x27f3('0x9'));router[_0x27f3('0xa')]('/',auth['isAuthenticated'](),controller[_0x27f3('0xb')]);router['get']('/describe',auth[_0x27f3('0xc')](),controller[_0x27f3('0xd')]);router['get'](_0x27f3('0xe'),auth[_0x27f3('0xc')](),controller[_0x27f3('0xf')]);router[_0x27f3('0xa')](_0x27f3('0x10'),auth[_0x27f3('0xc')](),controller[_0x27f3('0x11')]);router[_0x27f3('0xa')](_0x27f3('0x12'),auth[_0x27f3('0xc')](),controller[_0x27f3('0x13')]);router[_0x27f3('0xa')]('/:id/users',auth[_0x27f3('0xc')](),controller[_0x27f3('0x14')]);router[_0x27f3('0x15')]('/',auth['isAuthenticated'](),controller[_0x27f3('0x16')]);router[_0x27f3('0x15')](_0x27f3('0x12'),auth[_0x27f3('0xc')](),controller[_0x27f3('0x17')]);router[_0x27f3('0x15')](_0x27f3('0x18'),auth[_0x27f3('0xc')](),controller['addAgents']);router['put']('/:id',auth[_0x27f3('0xc')](),controller['update']);router[_0x27f3('0x19')]('/:id',auth[_0x27f3('0xc')](),controller[_0x27f3('0x1a')]);router['delete']('/:id/teams',auth[_0x27f3('0xc')](),controller[_0x27f3('0x1b')]);router[_0x27f3('0x19')]('/:id/users',auth[_0x27f3('0xc')](),controller[_0x27f3('0x1c')]);module[_0x27f3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4f900fc..50f1b91 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 _0x4b07=['rrmemory','beepall','exports','STRING','INTEGER','ENUM'];(function(_0x1bfe25,_0x2d7357){var _0x34ec99=function(_0x4da629){while(--_0x4da629){_0x1bfe25['push'](_0x1bfe25['shift']());}};_0x34ec99(++_0x2d7357);}(_0x4b07,0x1d6));var _0x74b0=function(_0x34ce53,_0x2a93dc){_0x34ce53=_0x34ce53-0x0;var _0x26a388=_0x4b07[_0x34ce53];return _0x26a388;};'use strict';var Sequelize=require('sequelize');module[_0x74b0('0x0')]={'name':{'type':Sequelize[_0x74b0('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x74b0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x74b0('0x3')](_0x74b0('0x4'),_0x74b0('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x74b0('0x1')]}}; \ No newline at end of file +var _0x76bb=['rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0x413b0c,_0x4cc79e){var _0x41938a=function(_0x3384aa){while(--_0x3384aa){_0x413b0c['push'](_0x413b0c['shift']());}};_0x41938a(++_0x4cc79e);}(_0x76bb,0x16a));var _0xb76b=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x76bb[_0x57cc22];return _0x6f7bdc;};'use strict';var Sequelize=require('sequelize');module[_0xb76b('0x0')]={'name':{'type':Sequelize[_0xb76b('0x1')],'unique':_0xb76b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb76b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb76b('0x4'),_0xb76b('0x5'),'roundrobin')},'description':{'type':Sequelize[_0xb76b('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 481edb8..1c37b8c 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 _0x2925=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappQueue','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','pick','WhatsappQueueId','findAll','User','findAndCountAll','updatedAt','format','%s/%s','SIP','whatsappPause','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2925,0x168));var _0x5292=function(_0x3cc0e2,_0xf41d9d){_0x3cc0e2=_0x3cc0e2-0x0;var _0x5a073f=_0x2925[_0x3cc0e2];return _0x5a073f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5292('0x0'));var zipdir=require(_0x5292('0x1'));var jsonpatch=require(_0x5292('0x2'));var rp=require(_0x5292('0x3'));var moment=require(_0x5292('0x4'));var BPromise=require(_0x5292('0x5'));var Mustache=require(_0x5292('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5292('0x7'));var csv=require(_0x5292('0x8'));var ejs=require(_0x5292('0x9'));var fs=require('fs');var fs_extra=require(_0x5292('0xa'));var _=require(_0x5292('0xb'));var squel=require(_0x5292('0xc'));var crypto=require(_0x5292('0xd'));var jsforce=require(_0x5292('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5292('0x8'));var querystring=require(_0x5292('0xf'));var Papa=require(_0x5292('0x10'));var Redis=require('ioredis');var authService=require(_0x5292('0x11'));var qs=require(_0x5292('0x12'));var as=require(_0x5292('0x13'));var hardwareService=require(_0x5292('0x14'));var logger=require(_0x5292('0x15'))(_0x5292('0x16'));var utils=require(_0x5292('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5292('0x18'))['db'];config[_0x5292('0x19')]=_[_0x5292('0x1a')](config[_0x5292('0x19')],{'host':_0x5292('0x1b'),'port':0x18eb});var socket=require(_0x5292('0x1c'))(new Redis(config[_0x5292('0x19')]));require('./whatsappQueue.socket')[_0x5292('0x1d')](socket);function respondWithStatusCode(_0x56315b,_0x3f3190){_0x3f3190=_0x3f3190||0xcc;return function(_0x5838f0){if(_0x5838f0){return _0x56315b[_0x5292('0x1e')](_0x3f3190);}return _0x56315b[_0x5292('0x1f')](_0x3f3190)['end']();};}function respondWithResult(_0x2d4426,_0x27b0f4){_0x27b0f4=_0x27b0f4||0xc8;return function(_0x1fee79){if(_0x1fee79){return _0x2d4426[_0x5292('0x1f')](_0x27b0f4)[_0x5292('0x20')](_0x1fee79);}};}function respondWithFilteredResult(_0x3f8c63,_0x1051da){return function(_0x302604){if(_0x302604){var _0x204ef8=typeof _0x1051da[_0x5292('0x21')]===_0x5292('0x22')&&typeof _0x1051da[_0x5292('0x23')]===_0x5292('0x22');var _0x69ed99=_0x302604[_0x5292('0x24')];var _0x2ef5eb=_0x204ef8?0x0:_0x1051da['offset'];var _0x31cef5=_0x204ef8?_0x302604['count']:_0x1051da[_0x5292('0x21')]+_0x1051da[_0x5292('0x23')];var _0x2b55f1;if(_0x31cef5>=_0x69ed99){_0x31cef5=_0x69ed99;_0x2b55f1=0xc8;}else{_0x2b55f1=0xce;}_0x3f8c63[_0x5292('0x1f')](_0x2b55f1);return _0x3f8c63[_0x5292('0x25')](_0x5292('0x26'),_0x2ef5eb+'-'+_0x31cef5+'/'+_0x69ed99)['json'](_0x302604);}return null;};}function patchUpdates(_0x2af980){return function(_0x493379){try{jsonpatch[_0x5292('0x27')](_0x493379,_0x2af980,!![]);}catch(_0x13c518){return BPromise[_0x5292('0x28')](_0x13c518);}return _0x493379[_0x5292('0x29')]();};}function saveUpdates(_0x24a433,_0x47f178){return function(_0x515c9e){if(_0x515c9e){return _0x515c9e['update'](_0x24a433)[_0x5292('0x2a')](function(_0x1266cf){return _0x1266cf;});}return null;};}function removeEntity(_0x17f06f,_0x40727a){return function(_0x3b69cd){if(_0x3b69cd){return _0x3b69cd[_0x5292('0x2b')]()[_0x5292('0x2a')](function(){var _0xf81ae4=_0x3b69cd[_0x5292('0x2c')]({'plain':!![]});var _0x2b0b4c='WhatsappQueues';return db[_0x5292('0x2d')][_0x5292('0x2b')]({'where':{'type':_0x2b0b4c,'resourceId':_0xf81ae4['id']}})['then'](function(){return _0x3b69cd;});})[_0x5292('0x2a')](function(){_0x17f06f[_0x5292('0x1f')](0xcc)[_0x5292('0x2e')]();});}};}function handleEntityNotFound(_0x229e79,_0x15c802){return function(_0x24fdd1){if(!_0x24fdd1){_0x229e79[_0x5292('0x1e')](0x194);}return _0x24fdd1;};}function handleError(_0x3b7942,_0x41949a){_0x41949a=_0x41949a||0x1f4;return function(_0x133f12){logger[_0x5292('0x2f')](_0x133f12['stack']);if(_0x133f12[_0x5292('0x30')]){delete _0x133f12[_0x5292('0x30')];}_0x3b7942[_0x5292('0x1f')](_0x41949a)[_0x5292('0x31')](_0x133f12);};}exports[_0x5292('0x32')]=function(_0x284a45,_0x4bedbc){var _0x4ed5ef={},_0x34b19b={},_0x59d0e={'count':0x0,'rows':[]};var _0x2aeaf3=_[_0x5292('0x33')](db['WhatsappQueue'][_0x5292('0x34')],function(_0xea2702){return{'name':_0xea2702[_0x5292('0x35')],'type':_0xea2702[_0x5292('0x36')][_0x5292('0x37')]};});_0x34b19b[_0x5292('0x38')]=_['map'](_0x2aeaf3,_0x5292('0x30'));_0x34b19b[_0x5292('0x39')]=_['keys'](_0x284a45['query']);_0x34b19b[_0x5292('0x3a')]=_[_0x5292('0x3b')](_0x34b19b['model'],_0x34b19b[_0x5292('0x39')]);_0x4ed5ef[_0x5292('0x3c')]=_[_0x5292('0x3b')](_0x34b19b[_0x5292('0x38')],qs[_0x5292('0x3d')](_0x284a45[_0x5292('0x39')][_0x5292('0x3d')]));_0x4ed5ef[_0x5292('0x3c')]=_0x4ed5ef['attributes'][_0x5292('0x3e')]?_0x4ed5ef[_0x5292('0x3c')]:_0x34b19b[_0x5292('0x38')];if(!_0x284a45[_0x5292('0x39')][_0x5292('0x3f')](_0x5292('0x40'))){_0x4ed5ef[_0x5292('0x23')]=qs[_0x5292('0x23')](_0x284a45['query'][_0x5292('0x23')]);_0x4ed5ef['offset']=qs['offset'](_0x284a45[_0x5292('0x39')][_0x5292('0x21')]);}_0x4ed5ef[_0x5292('0x41')]=qs[_0x5292('0x42')](_0x284a45[_0x5292('0x39')][_0x5292('0x42')]);_0x4ed5ef[_0x5292('0x43')]=qs[_0x5292('0x3a')](_['pick'](_0x284a45[_0x5292('0x39')],_0x34b19b[_0x5292('0x3a')]),_0x2aeaf3);if(_0x284a45[_0x5292('0x39')][_0x5292('0x44')]){_0x4ed5ef[_0x5292('0x43')]=_[_0x5292('0x45')](_0x4ed5ef['where'],{'$or':_[_0x5292('0x33')](_0x2aeaf3,function(_0x37c4f4){if(_0x37c4f4['type']!==_0x5292('0x46')){var _0x34b83f={};_0x34b83f[_0x37c4f4[_0x5292('0x30')]]={'$like':'%'+_0x284a45[_0x5292('0x39')][_0x5292('0x44')]+'%'};return _0x34b83f;}})});}_0x4ed5ef=_[_0x5292('0x45')]({},_0x4ed5ef,_0x284a45[_0x5292('0x47')]);var _0x41cd64={'where':_0x4ed5ef[_0x5292('0x43')]};return db[_0x5292('0x48')][_0x5292('0x24')](_0x41cd64)[_0x5292('0x2a')](function(_0x430e41){_0x59d0e[_0x5292('0x24')]=_0x430e41;if(_0x284a45[_0x5292('0x39')][_0x5292('0x49')]){_0x4ed5ef[_0x5292('0x4a')]=[{'all':!![]}];}return db[_0x5292('0x48')]['findAll'](_0x4ed5ef);})['then'](function(_0x5ef0e7){_0x59d0e[_0x5292('0x4b')]=_0x5ef0e7;return _0x59d0e;})[_0x5292('0x2a')](respondWithFilteredResult(_0x4bedbc,_0x4ed5ef))[_0x5292('0x4c')](handleError(_0x4bedbc,null));};exports[_0x5292('0x4d')]=function(_0x1bbb95,_0x6ca687){var _0x2c81f4={'raw':!![],'where':{'id':_0x1bbb95[_0x5292('0x4e')]['id']}},_0x224ce9={};_0x224ce9[_0x5292('0x38')]=_[_0x5292('0x4f')](db[_0x5292('0x48')]['rawAttributes']);_0x224ce9[_0x5292('0x39')]=_['keys'](_0x1bbb95[_0x5292('0x39')]);_0x224ce9[_0x5292('0x3a')]=_[_0x5292('0x3b')](_0x224ce9[_0x5292('0x38')],_0x224ce9[_0x5292('0x39')]);_0x2c81f4['attributes']=_[_0x5292('0x3b')](_0x224ce9[_0x5292('0x38')],qs[_0x5292('0x3d')](_0x1bbb95['query'][_0x5292('0x3d')]));_0x2c81f4[_0x5292('0x3c')]=_0x2c81f4['attributes']['length']?_0x2c81f4[_0x5292('0x3c')]:_0x224ce9[_0x5292('0x38')];if(_0x1bbb95[_0x5292('0x39')][_0x5292('0x49')]){_0x2c81f4[_0x5292('0x4a')]=[{'all':!![]}];}_0x2c81f4=_[_0x5292('0x45')]({},_0x2c81f4,_0x1bbb95[_0x5292('0x47')]);return db[_0x5292('0x48')][_0x5292('0x50')](_0x2c81f4)['then'](handleEntityNotFound(_0x6ca687,null))[_0x5292('0x2a')](respondWithResult(_0x6ca687,null))[_0x5292('0x4c')](handleError(_0x6ca687,null));};exports['create']=function(_0x3ffea4,_0x4037bf){return db[_0x5292('0x48')][_0x5292('0x51')](_0x3ffea4[_0x5292('0x52')],{})['then'](function(_0x3e1414){var _0xb1f2d9=_0x3ffea4[_0x5292('0x53')][_0x5292('0x2c')]({'plain':!![]});if(!_0xb1f2d9)throw new Error(_0x5292('0x54'));if(_0xb1f2d9['role']===_0x5292('0x53')){var _0x187a0d=_0x3e1414[_0x5292('0x2c')]({'plain':!![]});var _0x4ab9a5=_0x5292('0x55');return db[_0x5292('0x56')]['find']({'where':{'name':_0x4ab9a5,'userProfileId':_0xb1f2d9['userProfileId']},'raw':!![]})[_0x5292('0x2a')](function(_0x3dc320){if(_0x3dc320&&_0x3dc320[_0x5292('0x57')]===0x0){return db[_0x5292('0x2d')]['create']({'name':_0x187a0d['name'],'resourceId':_0x187a0d['id'],'type':_0x3dc320[_0x5292('0x30')],'sectionId':_0x3dc320['id']},{})[_0x5292('0x2a')](function(){return _0x3e1414;});}else{return _0x3e1414;}})[_0x5292('0x4c')](function(_0x3de502){logger[_0x5292('0x2f')](_0x5292('0x58'),_0x3de502);throw _0x3de502;});}return _0x3e1414;})[_0x5292('0x2a')](respondWithResult(_0x4037bf,0xc9))[_0x5292('0x4c')](handleError(_0x4037bf,null));};exports[_0x5292('0x59')]=function(_0x2704b4,_0x37ba57){if(_0x2704b4[_0x5292('0x52')]['id']){delete _0x2704b4[_0x5292('0x52')]['id'];}return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x2704b4[_0x5292('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37ba57,null))[_0x5292('0x2a')](saveUpdates(_0x2704b4[_0x5292('0x52')],null))[_0x5292('0x2a')](respondWithResult(_0x37ba57,null))[_0x5292('0x4c')](handleError(_0x37ba57,null));};exports['destroy']=function(_0x29bf44,_0x120af4){return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x29bf44[_0x5292('0x4e')]['id']}})[_0x5292('0x2a')](handleEntityNotFound(_0x120af4,null))['then'](removeEntity(_0x120af4,null))[_0x5292('0x4c')](handleError(_0x120af4,null));};exports[_0x5292('0x5a')]=function(_0x2ab638,_0x1eb670){return db[_0x5292('0x48')]['describe']()['then'](respondWithResult(_0x1eb670,null))['catch'](handleError(_0x1eb670,null));};exports['getMembers']=function(_0x37a001,_0xe43e8b,_0x3adcbc){var _0x5ce94={'raw':!![],'where':{}},_0x507192={},_0x461b64;return db['WhatsappQueue'][_0x5292('0x5b')]({'where':{'id':_0x37a001['params']['id']}})[_0x5292('0x2a')](handleEntityNotFound(_0xe43e8b,null))[_0x5292('0x2a')](function(_0x1ce9cb){if(_0x1ce9cb){_0x461b64=_0x1ce9cb[_0x5292('0x2c')]({'plain':!![]});_0x507192[_0x5292('0x38')]=_[_0x5292('0x4f')](db['UserWhatsappQueue'][_0x5292('0x34')]);_0x507192[_0x5292('0x39')]=_[_0x5292('0x4f')](_0x37a001[_0x5292('0x39')]);_0x507192[_0x5292('0x3a')]=_[_0x5292('0x3b')](_0x507192[_0x5292('0x38')],_0x507192[_0x5292('0x39')]);_0x5ce94[_0x5292('0x3c')]=_[_0x5292('0x3b')](_0x507192[_0x5292('0x38')],qs[_0x5292('0x3d')](_0x37a001[_0x5292('0x39')]['fields']));_0x5ce94['attributes']=_0x5ce94[_0x5292('0x3c')][_0x5292('0x3e')]?_0x5ce94[_0x5292('0x3c')]:_0x507192['model'];if(!_0x37a001['query'][_0x5292('0x3f')](_0x5292('0x40'))){_0x5ce94[_0x5292('0x23')]=qs[_0x5292('0x23')](_0x37a001['query'][_0x5292('0x23')]);_0x5ce94[_0x5292('0x21')]=qs[_0x5292('0x21')](_0x37a001['query']['offset']);}_0x5ce94[_0x5292('0x41')]=qs[_0x5292('0x42')](_0x37a001[_0x5292('0x39')]['sort']);_0x5ce94[_0x5292('0x43')]=qs[_0x5292('0x3a')](_[_0x5292('0x5c')](_0x37a001['query'],_0x507192[_0x5292('0x3a')]));_0x5ce94['where'][_0x5292('0x5d')]=_0x1ce9cb['id'];if(_0x37a001['query']['filter']){_0x5ce94[_0x5292('0x43')]=_['merge'](_0x5ce94[_0x5292('0x43')],{'$or':_[_0x5292('0x33')](_0x5ce94['attributes'],function(_0x3daa70){var _0x148a3e={};_0x148a3e[_0x3daa70]={'$like':'%'+_0x37a001['query']['filter']+'%'};return _0x148a3e;})});}_0x5ce94=_[_0x5292('0x45')]({},_0x5ce94,_0x37a001[_0x5292('0x47')]);return db['UserWhatsappQueue'][_0x5292('0x5e')](_0x5ce94);}})[_0x5292('0x2a')](function(_0x1842e1){if(_0x1842e1){return db[_0x5292('0x5f')][_0x5292('0x60')]({'where':{'id':_['map'](_0x1842e1,'UserId'),'role':'agent'},'attributes':['id',_0x5292('0x30'),'whatsappPause',_0x5292('0x61'),'createdAt']});}})[_0x5292('0x2a')](function(_0x41940a){if(_0x41940a){return{'count':_0x41940a[_0x5292('0x24')],'rows':_[_0x5292('0x33')](_0x41940a[_0x5292('0x4b')],function(_0x1abd90){return{'membername':_0x1abd90[_0x5292('0x30')],'UserId':_0x1abd90['id'],'queue_name':_0x461b64[_0x5292('0x30')],'WhatsappQueueId':_0x461b64['id'],'interface':util[_0x5292('0x62')](_0x5292('0x63'),_0x5292('0x64'),_0x1abd90[_0x5292('0x30')]),'penalty':0x0,'paused':_0x1abd90[_0x5292('0x65')],'createdAt':_0x1abd90[_0x5292('0x66')],'updatedAt':_0x1abd90['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xe43e8b,_0x5ce94))[_0x5292('0x4c')](handleError(_0xe43e8b,null));};exports['getTeams']=function(_0x119983,_0x516261,_0x588735){var _0x257ef2={};var _0x43a7e9={};var _0x1b516e;var _0x57d311;return db[_0x5292('0x48')][_0x5292('0x5b')]({'where':{'id':_0x119983[_0x5292('0x4e')]['id']}})[_0x5292('0x2a')](handleEntityNotFound(_0x516261,null))[_0x5292('0x2a')](function(_0x27cdc0){if(_0x27cdc0){_0x1b516e=_0x27cdc0;_0x43a7e9[_0x5292('0x38')]=_[_0x5292('0x4f')](db[_0x5292('0x67')][_0x5292('0x34')]);_0x43a7e9['query']=_[_0x5292('0x4f')](_0x119983[_0x5292('0x39')]);_0x43a7e9[_0x5292('0x3a')]=_[_0x5292('0x3b')](_0x43a7e9['model'],_0x43a7e9[_0x5292('0x39')]);_0x257ef2[_0x5292('0x3c')]=_[_0x5292('0x3b')](_0x43a7e9[_0x5292('0x38')],qs[_0x5292('0x3d')](_0x119983[_0x5292('0x39')][_0x5292('0x3d')]));_0x257ef2[_0x5292('0x3c')]=_0x257ef2['attributes'][_0x5292('0x3e')]?_0x257ef2[_0x5292('0x3c')]:_0x43a7e9[_0x5292('0x38')];_0x257ef2[_0x5292('0x41')]=qs[_0x5292('0x42')](_0x119983['query'][_0x5292('0x42')]);_0x257ef2[_0x5292('0x43')]=qs[_0x5292('0x3a')](_['pick'](_0x119983[_0x5292('0x39')],_0x43a7e9[_0x5292('0x3a')]));if(_0x119983['query'][_0x5292('0x44')]){_0x257ef2['where']=_['merge'](_0x257ef2[_0x5292('0x43')],{'$or':_['map'](_0x257ef2[_0x5292('0x3c')],function(_0x5089ad){var _0x1f29c8={};_0x1f29c8[_0x5089ad]={'$like':'%'+_0x119983['query'][_0x5292('0x44')]+'%'};return _0x1f29c8;})});}_0x257ef2=_[_0x5292('0x45')]({},_0x257ef2,_0x119983[_0x5292('0x47')]);return _0x1b516e['getTeams'](_0x257ef2);}})[_0x5292('0x2a')](function(_0xd19ecf){if(_0xd19ecf){_0x57d311=_0xd19ecf[_0x5292('0x3e')];if(!_0x119983[_0x5292('0x39')][_0x5292('0x3f')](_0x5292('0x40'))){_0x257ef2[_0x5292('0x23')]=qs['limit'](_0x119983[_0x5292('0x39')][_0x5292('0x23')]);_0x257ef2[_0x5292('0x21')]=qs[_0x5292('0x21')](_0x119983['query'][_0x5292('0x21')]);}return _0x1b516e[_0x5292('0x68')](_0x257ef2);}})[_0x5292('0x2a')](function(_0x5b61e9){if(_0x5b61e9){return _0x5b61e9?{'count':_0x57d311,'rows':_0x5b61e9}:null;}})[_0x5292('0x2a')](respondWithResult(_0x516261,null))[_0x5292('0x4c')](handleError(_0x516261,null));};exports[_0x5292('0x69')]=function(_0x2c1720,_0x5f1c91,_0x1de867){var _0x5ce4b7=_0x2c1720[_0x5292('0x52')][_0x5292('0x6a')];return db[_0x5292('0x67')][_0x5292('0x5e')]({'where':{'id':_0x5ce4b7},'attributes':['id'],'include':[{'model':db[_0x5292('0x5f')],'as':_0x5292('0x6b'),'attributes':['id','name',_0x5292('0x6c'),_0x5292('0x6d'),_0x5292('0x6e')],'raw':!![]}]})[_0x5292('0x2a')](function(_0x46dcf3){if(_0x46dcf3){var _0x386a70=_[_0x5292('0x6f')](_0x46dcf3,function(_0x5d5599){var _0x3ee59b=_0x5d5599[_0x5292('0x2c')]({'plain':!![]});return _0x3ee59b['Agents'];});return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x2c1720['params']['id']}})[_0x5292('0x2a')](function(_0x35e857){return db[_0x5292('0x70')][_0x5292('0x71')](function(_0x510253){return _0x35e857[_0x5292('0x69')](_0x5ce4b7,{'transaction':_0x510253})['then'](function(){return BPromise['each'](_0x386a70,function(_0x3965f0){return db['UserWhatsappQueue'][_0x5292('0x72')]({'where':{'UserId':_0x3965f0['id'],'WhatsappQueueId':_0x2c1720['params']['id']},'transaction':_0x510253});});})[_0x5292('0x2a')](function(){_0x386a70[_0x5292('0x73')](function(_0xbc866c){socket[_0x5292('0x74')](_0x5292('0x75'),{'UserId':_0xbc866c['id'],'WhatsappQueueId':_0x35e857['id']});});});});});}})[_0x5292('0x2a')](respondWithStatusCode(_0x5f1c91,null))[_0x5292('0x4c')](handleError(_0x5f1c91,null));};exports[_0x5292('0x76')]=function(_0x5b8541,_0x884dd8,_0x22c98e){return db[_0x5292('0x67')][_0x5292('0x5e')]({'where':{'id':_0x5b8541[_0x5292('0x39')][_0x5292('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x5292('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5292('0x2a')](handleEntityNotFound(_0x884dd8,null))[_0x5292('0x2a')](function(_0x745407){var _0x58ad80=_[_0x5292('0x33')](_0x745407,'id');var _0x1e1e76=[];var _0x24c68c=[];var _0xc02e54=squel[_0x5292('0x77')]();_0xc02e54[_0x5292('0x78')](_0x5292('0x79'))['from'](_0x5292('0x7a'),'tq')[_0x5292('0x7b')](_0x5292('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5292('0x7d'),_0x5b8541[_0x5292('0x4e')]['id']);for(var _0x4b2197=0x0;_0x4b2197<_0x745407[_0x5292('0x3e')];_0x4b2197+=0x1){let _0x5bc96a=_0x745407[_0x4b2197];for(var _0xc26ca2=0x0;_0xc26ca2<_0x5bc96a[_0x5292('0x6b')][_0x5292('0x3e')];_0xc26ca2+=0x1){let _0x119dd5=_0x5bc96a[_0x5292('0x6b')][_0xc26ca2];var _0x58abab=_0xc02e54['clone']();_0x58abab[_0x5292('0x43')]('ut.UserId\x20=\x20?',_0x119dd5['id']);_0x24c68c[_0x5292('0x7e')](db[_0x5292('0x70')][_0x5292('0x39')](_0x58abab[_0x5292('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0x5292('0x80')]})['then'](function(_0x402676){if(_0x402676[_0x5292('0x3e')]===0x1){return _0x119dd5['id'];}else{var _0x409911=_[_0x5292('0x81')](_[_0x5292('0x33')](_0x402676,'TeamId'),function(_0x3cde0f){return _[_0x5292('0x82')](_0x58ad80,_0x3cde0f);});if(_0x409911){return _0x119dd5['id'];}}}));}}return BPromise[_0x5292('0x83')](_0x24c68c)[_0x5292('0x2a')](function(_0x1980b2){_0x1e1e76=_(_0x1e1e76)[_0x5292('0x84')](_0x1980b2)[_0x5292('0x85')]()['value']();return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x5b8541['params']['id']}})['then'](function(_0x2b630e){return db['sequelize']['transaction'](function(_0x22c20b){return _0x2b630e[_0x5292('0x76')](_0x5b8541[_0x5292('0x39')]['ids'],{'transaction':_0x22c20b})[_0x5292('0x2a')](function(){if(!_[_0x5292('0x86')](_0x1e1e76)){return _0x2b630e[_0x5292('0x87')](_0x1e1e76,{'transaction':_0x22c20b});}})[_0x5292('0x2a')](function(){_0x1e1e76[_0x5292('0x73')](function(_0x2ac9c7){socket[_0x5292('0x74')](_0x5292('0x88'),{'UserId':_0x2ac9c7,'WhatsappQueueId':_0x2b630e['id']});});});});});});})['then'](respondWithStatusCode(_0x884dd8,null))[_0x5292('0x4c')](handleError(_0x884dd8,null));};exports['addAgents']=function(_0x486192,_0xd5aef5,_0x58d6f1){return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x486192[_0x5292('0x4e')]['id']}})[_0x5292('0x2a')](handleEntityNotFound(_0xd5aef5,null))['then'](function(_0x2e2e44){if(_0x2e2e44){return _0x2e2e44['addAgents'](_0x486192[_0x5292('0x52')][_0x5292('0x6a')],_['omit'](_0x486192[_0x5292('0x52')],[_0x5292('0x6a'),'id'])||{})[_0x5292('0x89')](function(_0x259b7c){for(var _0x5f4580=0x0;_0x5f4580<_0x486192[_0x5292('0x52')][_0x5292('0x6a')][_0x5292('0x3e')];_0x5f4580+=0x1){socket[_0x5292('0x74')](_0x5292('0x75'),{'UserId':Number(_0x486192['body'][_0x5292('0x6a')][_0x5f4580]),'WhatsappQueueId':Number(_0x486192[_0x5292('0x4e')]['id'])});}return _0x259b7c;});}})[_0x5292('0x2a')](respondWithResult(_0xd5aef5,null))[_0x5292('0x4c')](handleError(_0xd5aef5,null));};exports[_0x5292('0x87')]=function(_0x4f8b28,_0x39e862,_0x174bb1){return db[_0x5292('0x48')][_0x5292('0x50')]({'where':{'id':_0x4f8b28[_0x5292('0x4e')]['id']}})[_0x5292('0x2a')](handleEntityNotFound(_0x39e862,null))[_0x5292('0x2a')](function(_0x3096db){if(_0x3096db){return _0x3096db[_0x5292('0x87')](_0x4f8b28[_0x5292('0x39')][_0x5292('0x6a')])[_0x5292('0x2a')](function(){if(_[_0x5292('0x8a')](_0x4f8b28[_0x5292('0x39')][_0x5292('0x6a')])){for(var _0x3f7e7a=0x0;_0x3f7e7a<_0x4f8b28[_0x5292('0x39')][_0x5292('0x6a')][_0x5292('0x3e')];_0x3f7e7a+=0x1){socket[_0x5292('0x74')](_0x5292('0x88'),{'UserId':Number(_0x4f8b28[_0x5292('0x39')][_0x5292('0x6a')][_0x3f7e7a]),'WhatsappQueueId':Number(_0x4f8b28['params']['id'])});}}else{socket[_0x5292('0x74')](_0x5292('0x88'),{'UserId':Number(_0x4f8b28[_0x5292('0x39')][_0x5292('0x6a')]),'WhatsappQueueId':Number(_0x4f8b28[_0x5292('0x4e')]['id'])});}});}})[_0x5292('0x2a')](respondWithStatusCode(_0x39e862,null))[_0x5292('0x4c')](handleError(_0x39e862,null));};exports[_0x5292('0x8b')]=function(_0x190068,_0x27e2cd,_0x1e2cf0){var _0x19a2d2={};var _0x5a21ed={};var _0x85d54c;var _0x240cbe;return db[_0x5292('0x48')]['findOne']({'where':{'id':_0x190068['params']['id']}})['then'](handleEntityNotFound(_0x27e2cd,null))[_0x5292('0x2a')](function(_0x2bb2e7){if(_0x2bb2e7){_0x85d54c=_0x2bb2e7;_0x5a21ed['model']=_[_0x5292('0x4f')](db[_0x5292('0x5f')]['rawAttributes']);_0x5a21ed[_0x5292('0x39')]=_['keys'](_0x190068[_0x5292('0x39')]);_0x5a21ed[_0x5292('0x3a')]=_[_0x5292('0x3b')](_0x5a21ed[_0x5292('0x38')],_0x5a21ed['query']);_0x19a2d2[_0x5292('0x3c')]=_[_0x5292('0x3b')](_0x5a21ed[_0x5292('0x38')],qs[_0x5292('0x3d')](_0x190068['query'][_0x5292('0x3d')]));_0x19a2d2[_0x5292('0x3c')]=_0x19a2d2['attributes'][_0x5292('0x3e')]?_0x19a2d2[_0x5292('0x3c')]:_0x5a21ed[_0x5292('0x38')];_0x19a2d2[_0x5292('0x41')]=qs[_0x5292('0x42')](_0x190068['query'][_0x5292('0x42')]);_0x19a2d2['where']=qs[_0x5292('0x3a')](_[_0x5292('0x5c')](_0x190068[_0x5292('0x39')],_0x5a21ed[_0x5292('0x3a')]));if(_0x190068[_0x5292('0x39')][_0x5292('0x44')]){_0x19a2d2['where']=_[_0x5292('0x45')](_0x19a2d2['where'],{'$or':_['map'](_0x19a2d2['attributes'],function(_0x3992f8){var _0x1723ac={};_0x1723ac[_0x3992f8]={'$like':'%'+_0x190068['query'][_0x5292('0x44')]+'%'};return _0x1723ac;})});}_0x19a2d2=_[_0x5292('0x45')]({},_0x19a2d2,_0x190068[_0x5292('0x47')]);return _0x85d54c[_0x5292('0x8b')](_0x19a2d2);}})[_0x5292('0x2a')](function(_0x2ac9fa){if(_0x2ac9fa){_0x240cbe=_0x2ac9fa['length'];if(!_0x190068[_0x5292('0x39')][_0x5292('0x3f')](_0x5292('0x40'))){_0x19a2d2[_0x5292('0x23')]=qs[_0x5292('0x23')](_0x190068[_0x5292('0x39')]['limit']);_0x19a2d2[_0x5292('0x21')]=qs['offset'](_0x190068[_0x5292('0x39')][_0x5292('0x21')]);}return _0x85d54c[_0x5292('0x8b')](_0x19a2d2);}})[_0x5292('0x2a')](function(_0xec9a25){if(_0xec9a25){return _0xec9a25?{'count':_0x240cbe,'rows':_0xec9a25}:null;}})['then'](respondWithResult(_0x27e2cd,null))[_0x5292('0x4c')](handleError(_0x27e2cd,null));}; \ No newline at end of file +var _0x9b13=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','WhatsappQueues','error','stack','index','WhatsappQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','name','describe','getMembers','findOne','get','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','emit','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto'];(function(_0x5eabfe,_0x40238d){var _0x23d240=function(_0x2cad05){while(--_0x2cad05){_0x5eabfe['push'](_0x5eabfe['shift']());}};_0x23d240(++_0x40238d);}(_0x9b13,0x7f));var _0x39b1=function(_0x3ce986,_0x3703f9){_0x3ce986=_0x3ce986-0x0;var _0x2ac620=_0x9b13[_0x3ce986];return _0x2ac620;};'use strict';var emlformat=require(_0x39b1('0x0'));var rimraf=require(_0x39b1('0x1'));var zipdir=require(_0x39b1('0x2'));var jsonpatch=require(_0x39b1('0x3'));var rp=require(_0x39b1('0x4'));var moment=require(_0x39b1('0x5'));var BPromise=require(_0x39b1('0x6'));var Mustache=require('mustache');var util=require(_0x39b1('0x7'));var path=require('path');var sox=require(_0x39b1('0x8'));var csv=require(_0x39b1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39b1('0xa'));var _=require(_0x39b1('0xb'));var squel=require('squel');var crypto=require(_0x39b1('0xc'));var jsforce=require(_0x39b1('0xd'));var deskjs=require(_0x39b1('0xe'));var toCsv=require(_0x39b1('0x9'));var querystring=require(_0x39b1('0xf'));var Papa=require(_0x39b1('0x10'));var Redis=require(_0x39b1('0x11'));var authService=require(_0x39b1('0x12'));var qs=require(_0x39b1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x39b1('0x14'))(_0x39b1('0x15'));var utils=require(_0x39b1('0x16'));var config=require(_0x39b1('0x17'));var licenseUtil=require(_0x39b1('0x18'));var db=require(_0x39b1('0x19'))['db'];config['redis']=_[_0x39b1('0x1a')](config[_0x39b1('0x1b')],{'host':_0x39b1('0x1c'),'port':0x18eb});var socket=require(_0x39b1('0x1d'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x39b1('0x1e')](socket);function respondWithStatusCode(_0x3e7b31,_0x4c41cf){_0x4c41cf=_0x4c41cf||0xcc;return function(_0x5a0b51){if(_0x5a0b51){return _0x3e7b31[_0x39b1('0x1f')](_0x4c41cf);}return _0x3e7b31[_0x39b1('0x20')](_0x4c41cf)[_0x39b1('0x21')]();};}function respondWithResult(_0x395d67,_0x54cbe4){_0x54cbe4=_0x54cbe4||0xc8;return function(_0x2103b1){if(_0x2103b1){return _0x395d67['status'](_0x54cbe4)[_0x39b1('0x22')](_0x2103b1);}};}function respondWithFilteredResult(_0x406304,_0x6a9690){return function(_0x4de60e){if(_0x4de60e){var _0x12e349=typeof _0x6a9690[_0x39b1('0x23')]===_0x39b1('0x24')&&typeof _0x6a9690[_0x39b1('0x25')]===_0x39b1('0x24');var _0x34b136=_0x4de60e['count'];var _0xddec08=_0x12e349?0x0:_0x6a9690[_0x39b1('0x23')];var _0x38ea6f=_0x12e349?_0x4de60e[_0x39b1('0x26')]:_0x6a9690[_0x39b1('0x23')]+_0x6a9690[_0x39b1('0x25')];var _0x3d2013;if(_0x38ea6f>=_0x34b136){_0x38ea6f=_0x34b136;_0x3d2013=0xc8;}else{_0x3d2013=0xce;}_0x406304[_0x39b1('0x20')](_0x3d2013);return _0x406304['set'](_0x39b1('0x27'),_0xddec08+'-'+_0x38ea6f+'/'+_0x34b136)['json'](_0x4de60e);}return null;};}function patchUpdates(_0x3d55ef){return function(_0x32bbf0){try{jsonpatch[_0x39b1('0x28')](_0x32bbf0,_0x3d55ef,!![]);}catch(_0x50b8bd){return BPromise[_0x39b1('0x29')](_0x50b8bd);}return _0x32bbf0[_0x39b1('0x2a')]();};}function saveUpdates(_0x247fb8,_0x302dae){return function(_0x170984){if(_0x170984){return _0x170984[_0x39b1('0x2b')](_0x247fb8)[_0x39b1('0x2c')](function(_0x10ddd9){return _0x10ddd9;});}return null;};}function removeEntity(_0x102f41,_0x1d5043){return function(_0x27bedc){if(_0x27bedc){return _0x27bedc[_0x39b1('0x2d')]()[_0x39b1('0x2c')](function(){var _0x5e2fb2=_0x27bedc['get']({'plain':!![]});var _0x1185ec=_0x39b1('0x2e');return db['UserProfileResource'][_0x39b1('0x2d')]({'where':{'type':_0x1185ec,'resourceId':_0x5e2fb2['id']}})['then'](function(){return _0x27bedc;});})['then'](function(){_0x102f41[_0x39b1('0x20')](0xcc)[_0x39b1('0x21')]();});}};}function handleEntityNotFound(_0x39053a,_0x48f74f){return function(_0x41205a){if(!_0x41205a){_0x39053a[_0x39b1('0x1f')](0x194);}return _0x41205a;};}function handleError(_0x389c62,_0x526b1d){_0x526b1d=_0x526b1d||0x1f4;return function(_0x498566){logger[_0x39b1('0x2f')](_0x498566[_0x39b1('0x30')]);if(_0x498566['name']){delete _0x498566['name'];}_0x389c62[_0x39b1('0x20')](_0x526b1d)['send'](_0x498566);};}exports[_0x39b1('0x31')]=function(_0x2fc840,_0x5505f6){var _0x21aa39={},_0x3cc661={},_0x55e27f={'count':0x0,'rows':[]};var _0x5ec836=_['map'](db[_0x39b1('0x32')][_0x39b1('0x33')],function(_0x51ad7e){return{'name':_0x51ad7e[_0x39b1('0x34')],'type':_0x51ad7e[_0x39b1('0x35')][_0x39b1('0x36')]};});_0x3cc661['model']=_[_0x39b1('0x37')](_0x5ec836,'name');_0x3cc661[_0x39b1('0x38')]=_[_0x39b1('0x39')](_0x2fc840[_0x39b1('0x38')]);_0x3cc661[_0x39b1('0x3a')]=_['intersection'](_0x3cc661[_0x39b1('0x3b')],_0x3cc661[_0x39b1('0x38')]);_0x21aa39['attributes']=_[_0x39b1('0x3c')](_0x3cc661['model'],qs[_0x39b1('0x3d')](_0x2fc840[_0x39b1('0x38')][_0x39b1('0x3d')]));_0x21aa39[_0x39b1('0x3e')]=_0x21aa39[_0x39b1('0x3e')][_0x39b1('0x3f')]?_0x21aa39[_0x39b1('0x3e')]:_0x3cc661['model'];if(!_0x2fc840['query'][_0x39b1('0x40')](_0x39b1('0x41'))){_0x21aa39['limit']=qs[_0x39b1('0x25')](_0x2fc840[_0x39b1('0x38')]['limit']);_0x21aa39[_0x39b1('0x23')]=qs[_0x39b1('0x23')](_0x2fc840[_0x39b1('0x38')]['offset']);}_0x21aa39[_0x39b1('0x42')]=qs['sort'](_0x2fc840['query'][_0x39b1('0x43')]);_0x21aa39[_0x39b1('0x44')]=qs[_0x39b1('0x3a')](_[_0x39b1('0x45')](_0x2fc840[_0x39b1('0x38')],_0x3cc661[_0x39b1('0x3a')]),_0x5ec836);if(_0x2fc840[_0x39b1('0x38')][_0x39b1('0x46')]){_0x21aa39[_0x39b1('0x44')]=_[_0x39b1('0x47')](_0x21aa39[_0x39b1('0x44')],{'$or':_[_0x39b1('0x37')](_0x5ec836,function(_0x20a028){if(_0x20a028[_0x39b1('0x35')]!=='VIRTUAL'){var _0x36cbc2={};_0x36cbc2[_0x20a028['name']]={'$like':'%'+_0x2fc840[_0x39b1('0x38')][_0x39b1('0x46')]+'%'};return _0x36cbc2;}})});}_0x21aa39=_['merge']({},_0x21aa39,_0x2fc840[_0x39b1('0x48')]);var _0x2e88d8={'where':_0x21aa39[_0x39b1('0x44')]};return db[_0x39b1('0x32')]['count'](_0x2e88d8)[_0x39b1('0x2c')](function(_0xd5c976){_0x55e27f[_0x39b1('0x26')]=_0xd5c976;if(_0x2fc840['query'][_0x39b1('0x49')]){_0x21aa39[_0x39b1('0x4a')]=[{'all':!![]}];}return db[_0x39b1('0x32')][_0x39b1('0x4b')](_0x21aa39);})[_0x39b1('0x2c')](function(_0x2d18f5){_0x55e27f[_0x39b1('0x4c')]=_0x2d18f5;return _0x55e27f;})[_0x39b1('0x2c')](respondWithFilteredResult(_0x5505f6,_0x21aa39))[_0x39b1('0x4d')](handleError(_0x5505f6,null));};exports[_0x39b1('0x4e')]=function(_0x2734a2,_0x30f25d){var _0x352008={'raw':!![],'where':{'id':_0x2734a2[_0x39b1('0x4f')]['id']}},_0x5b74c8={};_0x5b74c8[_0x39b1('0x3b')]=_[_0x39b1('0x39')](db[_0x39b1('0x32')][_0x39b1('0x33')]);_0x5b74c8[_0x39b1('0x38')]=_[_0x39b1('0x39')](_0x2734a2['query']);_0x5b74c8[_0x39b1('0x3a')]=_[_0x39b1('0x3c')](_0x5b74c8['model'],_0x5b74c8[_0x39b1('0x38')]);_0x352008[_0x39b1('0x3e')]=_[_0x39b1('0x3c')](_0x5b74c8['model'],qs[_0x39b1('0x3d')](_0x2734a2[_0x39b1('0x38')][_0x39b1('0x3d')]));_0x352008[_0x39b1('0x3e')]=_0x352008[_0x39b1('0x3e')][_0x39b1('0x3f')]?_0x352008[_0x39b1('0x3e')]:_0x5b74c8['model'];if(_0x2734a2[_0x39b1('0x38')][_0x39b1('0x49')]){_0x352008['include']=[{'all':!![]}];}_0x352008=_[_0x39b1('0x47')]({},_0x352008,_0x2734a2[_0x39b1('0x48')]);return db[_0x39b1('0x32')][_0x39b1('0x50')](_0x352008)[_0x39b1('0x2c')](handleEntityNotFound(_0x30f25d,null))[_0x39b1('0x2c')](respondWithResult(_0x30f25d,null))[_0x39b1('0x4d')](handleError(_0x30f25d,null));};exports[_0x39b1('0x51')]=function(_0x3f5749,_0x2e23b9){return db[_0x39b1('0x32')][_0x39b1('0x51')](_0x3f5749[_0x39b1('0x52')],{})['then'](function(_0x1e6440){var _0x383e3e=_0x3f5749[_0x39b1('0x53')]['get']({'plain':!![]});if(!_0x383e3e)throw new Error(_0x39b1('0x54'));if(_0x383e3e[_0x39b1('0x55')]===_0x39b1('0x53')){var _0x584682=_0x1e6440['get']({'plain':!![]});var _0xad4141=_0x39b1('0x2e');return db['UserProfileSection'][_0x39b1('0x50')]({'where':{'name':_0xad4141,'userProfileId':_0x383e3e[_0x39b1('0x56')]},'raw':!![]})[_0x39b1('0x2c')](function(_0x57aee1){if(_0x57aee1&&_0x57aee1['autoAssociation']===0x0){return db[_0x39b1('0x57')][_0x39b1('0x51')]({'name':_0x584682[_0x39b1('0x58')],'resourceId':_0x584682['id'],'type':_0x57aee1['name'],'sectionId':_0x57aee1['id']},{})[_0x39b1('0x2c')](function(){return _0x1e6440;});}else{return _0x1e6440;}})[_0x39b1('0x4d')](function(_0x1b7be1){logger[_0x39b1('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7be1);throw _0x1b7be1;});}return _0x1e6440;})[_0x39b1('0x2c')](respondWithResult(_0x2e23b9,0xc9))[_0x39b1('0x4d')](handleError(_0x2e23b9,null));};exports[_0x39b1('0x2b')]=function(_0x5ed7ec,_0x2b23da){if(_0x5ed7ec['body']['id']){delete _0x5ed7ec['body']['id'];}return db['WhatsappQueue'][_0x39b1('0x50')]({'where':{'id':_0x5ed7ec[_0x39b1('0x4f')]['id']}})[_0x39b1('0x2c')](handleEntityNotFound(_0x2b23da,null))[_0x39b1('0x2c')](saveUpdates(_0x5ed7ec[_0x39b1('0x52')],null))[_0x39b1('0x2c')](respondWithResult(_0x2b23da,null))['catch'](handleError(_0x2b23da,null));};exports[_0x39b1('0x2d')]=function(_0x49ee55,_0x3ac011){return db[_0x39b1('0x32')]['find']({'where':{'id':_0x49ee55['params']['id']}})[_0x39b1('0x2c')](handleEntityNotFound(_0x3ac011,null))[_0x39b1('0x2c')](removeEntity(_0x3ac011,null))['catch'](handleError(_0x3ac011,null));};exports[_0x39b1('0x59')]=function(_0x7ec89f,_0x45c037){return db['WhatsappQueue'][_0x39b1('0x59')]()[_0x39b1('0x2c')](respondWithResult(_0x45c037,null))[_0x39b1('0x4d')](handleError(_0x45c037,null));};exports[_0x39b1('0x5a')]=function(_0x9362f5,_0x5db842,_0x9d167c){var _0x1eed9a={'raw':!![],'where':{}},_0x28339f={},_0x57647f;return db[_0x39b1('0x32')][_0x39b1('0x5b')]({'where':{'id':_0x9362f5['params']['id']}})[_0x39b1('0x2c')](handleEntityNotFound(_0x5db842,null))[_0x39b1('0x2c')](function(_0x429f67){if(_0x429f67){_0x57647f=_0x429f67[_0x39b1('0x5c')]({'plain':!![]});_0x28339f[_0x39b1('0x3b')]=_[_0x39b1('0x39')](db[_0x39b1('0x5d')][_0x39b1('0x33')]);_0x28339f[_0x39b1('0x38')]=_[_0x39b1('0x39')](_0x9362f5[_0x39b1('0x38')]);_0x28339f[_0x39b1('0x3a')]=_['intersection'](_0x28339f['model'],_0x28339f[_0x39b1('0x38')]);_0x1eed9a[_0x39b1('0x3e')]=_[_0x39b1('0x3c')](_0x28339f[_0x39b1('0x3b')],qs['fields'](_0x9362f5[_0x39b1('0x38')]['fields']));_0x1eed9a[_0x39b1('0x3e')]=_0x1eed9a['attributes']['length']?_0x1eed9a[_0x39b1('0x3e')]:_0x28339f[_0x39b1('0x3b')];if(!_0x9362f5['query'][_0x39b1('0x40')](_0x39b1('0x41'))){_0x1eed9a['limit']=qs['limit'](_0x9362f5[_0x39b1('0x38')][_0x39b1('0x25')]);_0x1eed9a[_0x39b1('0x23')]=qs[_0x39b1('0x23')](_0x9362f5[_0x39b1('0x38')][_0x39b1('0x23')]);}_0x1eed9a[_0x39b1('0x42')]=qs[_0x39b1('0x43')](_0x9362f5[_0x39b1('0x38')][_0x39b1('0x43')]);_0x1eed9a[_0x39b1('0x44')]=qs[_0x39b1('0x3a')](_[_0x39b1('0x45')](_0x9362f5[_0x39b1('0x38')],_0x28339f[_0x39b1('0x3a')]));_0x1eed9a[_0x39b1('0x44')][_0x39b1('0x5e')]=_0x429f67['id'];if(_0x9362f5[_0x39b1('0x38')]['filter']){_0x1eed9a[_0x39b1('0x44')]=_[_0x39b1('0x47')](_0x1eed9a[_0x39b1('0x44')],{'$or':_[_0x39b1('0x37')](_0x1eed9a['attributes'],function(_0x2fa8ca){var _0x397f4f={};_0x397f4f[_0x2fa8ca]={'$like':'%'+_0x9362f5[_0x39b1('0x38')][_0x39b1('0x46')]+'%'};return _0x397f4f;})});}_0x1eed9a=_['merge']({},_0x1eed9a,_0x9362f5[_0x39b1('0x48')]);return db['UserWhatsappQueue']['findAll'](_0x1eed9a);}})[_0x39b1('0x2c')](function(_0x2680b2){if(_0x2680b2){return db[_0x39b1('0x5f')][_0x39b1('0x60')]({'where':{'id':_[_0x39b1('0x37')](_0x2680b2,_0x39b1('0x61')),'role':_0x39b1('0x62')},'attributes':['id','name',_0x39b1('0x63'),'updatedAt',_0x39b1('0x64')]});}})['then'](function(_0x491d35){if(_0x491d35){return{'count':_0x491d35[_0x39b1('0x26')],'rows':_[_0x39b1('0x37')](_0x491d35[_0x39b1('0x4c')],function(_0x4f529c){return{'membername':_0x4f529c[_0x39b1('0x58')],'UserId':_0x4f529c['id'],'queue_name':_0x57647f[_0x39b1('0x58')],'WhatsappQueueId':_0x57647f['id'],'interface':util[_0x39b1('0x65')]('%s/%s',_0x39b1('0x66'),_0x4f529c[_0x39b1('0x58')]),'penalty':0x0,'paused':_0x4f529c[_0x39b1('0x63')],'createdAt':_0x4f529c[_0x39b1('0x64')],'updatedAt':_0x4f529c[_0x39b1('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x39b1('0x2c')](respondWithFilteredResult(_0x5db842,_0x1eed9a))[_0x39b1('0x4d')](handleError(_0x5db842,null));};exports[_0x39b1('0x68')]=function(_0x144013,_0x5a2365,_0x4fcbe8){var _0x9d9ff4={};var _0x174799={};var _0x19c8df;var _0xfb46a8;return db[_0x39b1('0x32')]['findOne']({'where':{'id':_0x144013[_0x39b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a2365,null))[_0x39b1('0x2c')](function(_0x4ff7af){if(_0x4ff7af){_0x19c8df=_0x4ff7af;_0x174799['model']=_['keys'](db[_0x39b1('0x69')][_0x39b1('0x33')]);_0x174799[_0x39b1('0x38')]=_[_0x39b1('0x39')](_0x144013['query']);_0x174799[_0x39b1('0x3a')]=_['intersection'](_0x174799['model'],_0x174799[_0x39b1('0x38')]);_0x9d9ff4[_0x39b1('0x3e')]=_['intersection'](_0x174799[_0x39b1('0x3b')],qs[_0x39b1('0x3d')](_0x144013[_0x39b1('0x38')][_0x39b1('0x3d')]));_0x9d9ff4[_0x39b1('0x3e')]=_0x9d9ff4['attributes'][_0x39b1('0x3f')]?_0x9d9ff4[_0x39b1('0x3e')]:_0x174799[_0x39b1('0x3b')];_0x9d9ff4[_0x39b1('0x42')]=qs[_0x39b1('0x43')](_0x144013[_0x39b1('0x38')][_0x39b1('0x43')]);_0x9d9ff4['where']=qs['filters'](_[_0x39b1('0x45')](_0x144013[_0x39b1('0x38')],_0x174799['filters']));if(_0x144013[_0x39b1('0x38')]['filter']){_0x9d9ff4[_0x39b1('0x44')]=_[_0x39b1('0x47')](_0x9d9ff4[_0x39b1('0x44')],{'$or':_[_0x39b1('0x37')](_0x9d9ff4[_0x39b1('0x3e')],function(_0x46dd92){var _0x171d85={};_0x171d85[_0x46dd92]={'$like':'%'+_0x144013[_0x39b1('0x38')][_0x39b1('0x46')]+'%'};return _0x171d85;})});}_0x9d9ff4=_[_0x39b1('0x47')]({},_0x9d9ff4,_0x144013[_0x39b1('0x48')]);return _0x19c8df[_0x39b1('0x68')](_0x9d9ff4);}})[_0x39b1('0x2c')](function(_0x139abf){if(_0x139abf){_0xfb46a8=_0x139abf[_0x39b1('0x3f')];if(!_0x144013[_0x39b1('0x38')]['hasOwnProperty'](_0x39b1('0x41'))){_0x9d9ff4[_0x39b1('0x25')]=qs['limit'](_0x144013[_0x39b1('0x38')][_0x39b1('0x25')]);_0x9d9ff4['offset']=qs[_0x39b1('0x23')](_0x144013[_0x39b1('0x38')]['offset']);}return _0x19c8df['getTeams'](_0x9d9ff4);}})[_0x39b1('0x2c')](function(_0x4e41e0){if(_0x4e41e0){return _0x4e41e0?{'count':_0xfb46a8,'rows':_0x4e41e0}:null;}})[_0x39b1('0x2c')](respondWithResult(_0x5a2365,null))[_0x39b1('0x4d')](handleError(_0x5a2365,null));};exports[_0x39b1('0x6a')]=function(_0x566fa9,_0x3afb7a,_0x3a58de){var _0x283f65=_0x566fa9[_0x39b1('0x52')][_0x39b1('0x6b')];return db[_0x39b1('0x69')][_0x39b1('0x4b')]({'where':{'id':_0x283f65},'attributes':['id'],'include':[{'model':db['User'],'as':_0x39b1('0x6c'),'attributes':['id',_0x39b1('0x58'),_0x39b1('0x6d'),_0x39b1('0x6e'),'interface'],'raw':!![]}]})[_0x39b1('0x2c')](function(_0x5bec13){if(_0x5bec13){var _0xab66c9=_[_0x39b1('0x6f')](_0x5bec13,function(_0x28cbae){var _0x129f1f=_0x28cbae[_0x39b1('0x5c')]({'plain':!![]});return _0x129f1f['Agents'];});return db['WhatsappQueue']['find']({'where':{'id':_0x566fa9[_0x39b1('0x4f')]['id']}})['then'](function(_0x1f5097){return db[_0x39b1('0x70')][_0x39b1('0x71')](function(_0x3ad8b5){return _0x1f5097[_0x39b1('0x6a')](_0x283f65,{'transaction':_0x3ad8b5})['then'](function(){return BPromise['each'](_0xab66c9,function(_0x44aa62){return db['UserWhatsappQueue'][_0x39b1('0x72')]({'where':{'UserId':_0x44aa62['id'],'WhatsappQueueId':_0x566fa9['params']['id']},'transaction':_0x3ad8b5});});})[_0x39b1('0x2c')](function(){_0xab66c9['forEach'](function(_0x32680a){socket[_0x39b1('0x73')](_0x39b1('0x74'),{'UserId':_0x32680a['id'],'WhatsappQueueId':_0x1f5097['id']});});});});});}})[_0x39b1('0x2c')](respondWithStatusCode(_0x3afb7a,null))[_0x39b1('0x4d')](handleError(_0x3afb7a,null));};exports['removeTeams']=function(_0x1c1edb,_0x5cb5db,_0x5c5838){return db[_0x39b1('0x69')][_0x39b1('0x4b')]({'where':{'id':_0x1c1edb[_0x39b1('0x38')][_0x39b1('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x39b1('0x5f')],'as':_0x39b1('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5cb5db,null))[_0x39b1('0x2c')](function(_0x201ed3){var _0x2305b4=_[_0x39b1('0x37')](_0x201ed3,'id');var _0x577511=[];var _0x14e672=[];var _0x329524=squel[_0x39b1('0x75')]();_0x329524[_0x39b1('0x76')]('tq.TeamId')[_0x39b1('0x77')](_0x39b1('0x78'),'tq')[_0x39b1('0x79')](_0x39b1('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x39b1('0x7b'),_0x1c1edb[_0x39b1('0x4f')]['id']);for(var _0x382b0c=0x0;_0x382b0c<_0x201ed3['length'];_0x382b0c+=0x1){let _0x45f98a=_0x201ed3[_0x382b0c];for(var _0x1e434a=0x0;_0x1e434a<_0x45f98a[_0x39b1('0x6c')][_0x39b1('0x3f')];_0x1e434a+=0x1){let _0x4bf86e=_0x45f98a['Agents'][_0x1e434a];var _0x131062=_0x329524['clone']();_0x131062['where'](_0x39b1('0x7c'),_0x4bf86e['id']);_0x14e672[_0x39b1('0x7d')](db[_0x39b1('0x70')][_0x39b1('0x38')](_0x131062['toString'](),{'type':db[_0x39b1('0x70')][_0x39b1('0x7e')][_0x39b1('0x7f')]})[_0x39b1('0x2c')](function(_0x3e5016){if(_0x3e5016[_0x39b1('0x3f')]===0x1){return _0x4bf86e['id'];}else{var _0x4bb717=_[_0x39b1('0x80')](_[_0x39b1('0x37')](_0x3e5016,_0x39b1('0x81')),function(_0x5db09b){return _[_0x39b1('0x82')](_0x2305b4,_0x5db09b);});if(_0x4bb717){return _0x4bf86e['id'];}}}));}}return BPromise[_0x39b1('0x83')](_0x14e672)[_0x39b1('0x2c')](function(_0x3fd623){_0x577511=_(_0x577511)[_0x39b1('0x84')](_0x3fd623)[_0x39b1('0x85')]()['value']();return db[_0x39b1('0x32')][_0x39b1('0x50')]({'where':{'id':_0x1c1edb[_0x39b1('0x4f')]['id']}})[_0x39b1('0x2c')](function(_0x1cdb65){return db[_0x39b1('0x70')][_0x39b1('0x71')](function(_0x544a46){return _0x1cdb65['removeTeams'](_0x1c1edb[_0x39b1('0x38')][_0x39b1('0x6b')],{'transaction':_0x544a46})['then'](function(){if(!_[_0x39b1('0x86')](_0x577511)){return _0x1cdb65[_0x39b1('0x87')](_0x577511,{'transaction':_0x544a46});}})[_0x39b1('0x2c')](function(){_0x577511['forEach'](function(_0x3ac82b){socket[_0x39b1('0x73')](_0x39b1('0x88'),{'UserId':_0x3ac82b,'WhatsappQueueId':_0x1cdb65['id']});});});});});});})[_0x39b1('0x2c')](respondWithStatusCode(_0x5cb5db,null))[_0x39b1('0x4d')](handleError(_0x5cb5db,null));};exports[_0x39b1('0x89')]=function(_0x1b9286,_0x4aa02c,_0x31291f){return db[_0x39b1('0x32')]['find']({'where':{'id':_0x1b9286[_0x39b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4aa02c,null))['then'](function(_0x5f2e40){if(_0x5f2e40){return _0x5f2e40[_0x39b1('0x89')](_0x1b9286[_0x39b1('0x52')][_0x39b1('0x6b')],_[_0x39b1('0x8a')](_0x1b9286['body'],[_0x39b1('0x6b'),'id'])||{})['spread'](function(_0x26f79a){for(var _0x10ee53=0x0;_0x10ee53<_0x1b9286[_0x39b1('0x52')]['ids'][_0x39b1('0x3f')];_0x10ee53+=0x1){socket['emit'](_0x39b1('0x74'),{'UserId':Number(_0x1b9286['body'][_0x39b1('0x6b')][_0x10ee53]),'WhatsappQueueId':Number(_0x1b9286[_0x39b1('0x4f')]['id'])});}return _0x26f79a;});}})[_0x39b1('0x2c')](respondWithResult(_0x4aa02c,null))[_0x39b1('0x4d')](handleError(_0x4aa02c,null));};exports['removeAgents']=function(_0x18748a,_0x3b6e17,_0x3dc990){return db[_0x39b1('0x32')][_0x39b1('0x50')]({'where':{'id':_0x18748a['params']['id']}})[_0x39b1('0x2c')](handleEntityNotFound(_0x3b6e17,null))[_0x39b1('0x2c')](function(_0x438249){if(_0x438249){return _0x438249[_0x39b1('0x87')](_0x18748a[_0x39b1('0x38')][_0x39b1('0x6b')])[_0x39b1('0x2c')](function(){if(_['isArray'](_0x18748a['query'][_0x39b1('0x6b')])){for(var _0x22f248=0x0;_0x22f248<_0x18748a[_0x39b1('0x38')]['ids']['length'];_0x22f248+=0x1){socket['emit'](_0x39b1('0x88'),{'UserId':Number(_0x18748a[_0x39b1('0x38')][_0x39b1('0x6b')][_0x22f248]),'WhatsappQueueId':Number(_0x18748a[_0x39b1('0x4f')]['id'])});}}else{socket['emit'](_0x39b1('0x88'),{'UserId':Number(_0x18748a[_0x39b1('0x38')]['ids']),'WhatsappQueueId':Number(_0x18748a[_0x39b1('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x3b6e17,null))['catch'](handleError(_0x3b6e17,null));};exports['getAgents']=function(_0x3d1753,_0xbc5f0f,_0x4f5ed8){var _0x59c43a={};var _0x25aa8b={};var _0x343569;var _0x46dda5;return db[_0x39b1('0x32')]['findOne']({'where':{'id':_0x3d1753[_0x39b1('0x4f')]['id']}})[_0x39b1('0x2c')](handleEntityNotFound(_0xbc5f0f,null))[_0x39b1('0x2c')](function(_0x564470){if(_0x564470){_0x343569=_0x564470;_0x25aa8b[_0x39b1('0x3b')]=_[_0x39b1('0x39')](db[_0x39b1('0x5f')][_0x39b1('0x33')]);_0x25aa8b[_0x39b1('0x38')]=_[_0x39b1('0x39')](_0x3d1753['query']);_0x25aa8b[_0x39b1('0x3a')]=_[_0x39b1('0x3c')](_0x25aa8b['model'],_0x25aa8b[_0x39b1('0x38')]);_0x59c43a['attributes']=_[_0x39b1('0x3c')](_0x25aa8b['model'],qs[_0x39b1('0x3d')](_0x3d1753[_0x39b1('0x38')]['fields']));_0x59c43a[_0x39b1('0x3e')]=_0x59c43a['attributes'][_0x39b1('0x3f')]?_0x59c43a[_0x39b1('0x3e')]:_0x25aa8b[_0x39b1('0x3b')];_0x59c43a['order']=qs[_0x39b1('0x43')](_0x3d1753[_0x39b1('0x38')][_0x39b1('0x43')]);_0x59c43a[_0x39b1('0x44')]=qs['filters'](_[_0x39b1('0x45')](_0x3d1753[_0x39b1('0x38')],_0x25aa8b['filters']));if(_0x3d1753['query'][_0x39b1('0x46')]){_0x59c43a[_0x39b1('0x44')]=_[_0x39b1('0x47')](_0x59c43a['where'],{'$or':_[_0x39b1('0x37')](_0x59c43a[_0x39b1('0x3e')],function(_0x3248a5){var _0x449d6a={};_0x449d6a[_0x3248a5]={'$like':'%'+_0x3d1753[_0x39b1('0x38')][_0x39b1('0x46')]+'%'};return _0x449d6a;})});}_0x59c43a=_['merge']({},_0x59c43a,_0x3d1753['options']);return _0x343569[_0x39b1('0x8b')](_0x59c43a);}})[_0x39b1('0x2c')](function(_0x47b1c2){if(_0x47b1c2){_0x46dda5=_0x47b1c2[_0x39b1('0x3f')];if(!_0x3d1753['query'][_0x39b1('0x40')](_0x39b1('0x41'))){_0x59c43a[_0x39b1('0x25')]=qs['limit'](_0x3d1753[_0x39b1('0x38')][_0x39b1('0x25')]);_0x59c43a['offset']=qs[_0x39b1('0x23')](_0x3d1753[_0x39b1('0x38')][_0x39b1('0x23')]);}return _0x343569[_0x39b1('0x8b')](_0x59c43a);}})[_0x39b1('0x2c')](function(_0x5a85da){if(_0x5a85da){return _0x5a85da?{'count':_0x46dda5,'rows':_0x5a85da}:null;}})[_0x39b1('0x2c')](respondWithResult(_0xbc5f0f,null))['catch'](handleError(_0xbc5f0f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f52d8a5..126a667 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 _0x6639=['setMaxListeners','save','hook','exports','events','WhatsappQueue'];(function(_0x24e8f8,_0x4f3436){var _0x3f8852=function(_0xfa2c6d){while(--_0xfa2c6d){_0x24e8f8['push'](_0x24e8f8['shift']());}};_0x3f8852(++_0x4f3436);}(_0x6639,0xb8));var _0x9663=function(_0x2d73d7,_0x29e178){_0x2d73d7=_0x2d73d7-0x0;var _0x9fc822=_0x6639[_0x2d73d7];return _0x9fc822;};'use strict';var EventEmitter=require(_0x9663('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x9663('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9663('0x2')](0x0);var events={'afterCreate':_0x9663('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x53d8e4){return function(_0x57267b,_0x17ea0a,_0x289478){WhatsappQueueEvents['emit'](_0x53d8e4+':'+_0x57267b['id'],_0x57267b);WhatsappQueueEvents['emit'](_0x53d8e4,_0x57267b);_0x289478(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x9663('0x4')](e,emitEvent(event));}}module[_0x9663('0x5')]=WhatsappQueueEvents; \ No newline at end of file +var _0xeb10=['WhatsappQueue','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x43635e,_0x12619b){var _0x1b972f=function(_0x1f0618){while(--_0x1f0618){_0x43635e['push'](_0x43635e['shift']());}};_0x1b972f(++_0x12619b);}(_0xeb10,0x1e6));var _0x0eb1=function(_0x1cf0fa,_0x4c06f0){_0x1cf0fa=_0x1cf0fa-0x0;var _0x1dc6b9=_0xeb10[_0x1cf0fa];return _0x1dc6b9;};'use strict';var EventEmitter=require(_0x0eb1('0x0'));var WhatsappQueue=require(_0x0eb1('0x1'))['db'][_0x0eb1('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0eb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0eb1('0x4'),'afterDestroy':_0x0eb1('0x5')};function emitEvent(_0x3eab1e){return function(_0x2fecae,_0x1511ad,_0x5c0157){WhatsappQueueEvents[_0x0eb1('0x6')](_0x3eab1e+':'+_0x2fecae['id'],_0x2fecae);WhatsappQueueEvents['emit'](_0x3eab1e,_0x2fecae);_0x5c0157(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x0eb1('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index fe6c545..ca49214 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 _0xe579=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x5828c0,_0x4cdc04){var _0x1adaff=function(_0x9f7626){while(--_0x9f7626){_0x5828c0['push'](_0x5828c0['shift']());}};_0x1adaff(++_0x4cdc04);}(_0xe579,0xc1));var _0x9e57=function(_0x11fab8,_0xffbbbd){_0x11fab8=_0x11fab8-0x0;var _0x5eb95f=_0xe579[_0x11fab8];return _0x5eb95f;};'use strict';var _=require(_0x9e57('0x0'));var util=require(_0x9e57('0x1'));var logger=require('../../config/logger')(_0x9e57('0x2'));var moment=require(_0x9e57('0x3'));var BPromise=require(_0x9e57('0x4'));var rp=require(_0x9e57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e57('0x6'));var config=require(_0x9e57('0x7'));var attributes=require(_0x9e57('0x8'));module[_0x9e57('0x9')]=function(_0x594cd6,_0x120a9d){return _0x594cd6[_0x9e57('0xa')](_0x9e57('0xb'),attributes,{'tableName':_0x9e57('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6960=['define','WhatsappQueue','whatsapp_queues','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x4eeef7,_0x11e0f7){var _0x5a0723=function(_0x12fbd5){while(--_0x12fbd5){_0x4eeef7['push'](_0x4eeef7['shift']());}};_0x5a0723(++_0x11e0f7);}(_0x6960,0xf5));var _0x0696=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6960[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x0696('0x0'));var logger=require('../../config/logger')(_0x0696('0x1'));var moment=require(_0x0696('0x2'));var BPromise=require(_0x0696('0x3'));var rp=require(_0x0696('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0696('0x5'));var config=require(_0x0696('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x0696('0x7')]=function(_0x4710b1,_0x4f6041){return _0x4710b1[_0x0696('0x8')](_0x0696('0x9'),attributes,{'tableName':_0x0696('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 69821a5..44a62c8 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 _0x5d01=['code','message','request\x20sent','GetWhatsappQueue','findAll','options','where','map','include','model','attributes','stringify','catch','find','raw','then','ShowWhatsappQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c5f3d,_0x575b32){var _0x4d29b7=function(_0x5da305){while(--_0x5da305){_0x3c5f3d['push'](_0x3c5f3d['shift']());}};_0x4d29b7(++_0x575b32);}(_0x5d01,0xf5));var _0x15d0=function(_0x484c1b,_0x1ce1a){_0x484c1b=_0x484c1b-0x0;var _0x55a365=_0x5d01[_0x484c1b];return _0x55a365;};'use strict';var _=require(_0x15d0('0x0'));var util=require(_0x15d0('0x1'));var moment=require('moment');var BPromise=require(_0x15d0('0x2'));var rs=require(_0x15d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15d0('0x4'))['db'];var utils=require(_0x15d0('0x5'));var logger=require(_0x15d0('0x6'))(_0x15d0('0x7'));var config=require('../../config/environment');var jayson=require(_0x15d0('0x8'));var client=jayson['client'][_0x15d0('0x9')]({'port':0x232a});config['redis']=_[_0x15d0('0xa')](config[_0x15d0('0xb')],{'host':_0x15d0('0xc'),'port':0x18eb});var socket=require(_0x15d0('0xd'))(new Redis(config['redis']));require(_0x15d0('0xe'))[_0x15d0('0xf')](socket);function respondWithRpcPromise(_0x484b96,_0x336cdb,_0xd5568f){return new BPromise(function(_0x3bdb5c,_0x45636b){return client['request'](_0x484b96,_0xd5568f)['then'](function(_0x8264af){logger[_0x15d0('0x10')](_0x15d0('0x11'),_0x336cdb,'request\x20sent');logger[_0x15d0('0x12')](_0x15d0('0x13'),_0x336cdb,'request\x20sent',JSON['stringify'](_0x8264af));if(_0x8264af[_0x15d0('0x14')]){if(_0x8264af[_0x15d0('0x14')][_0x15d0('0x15')]===0x1f4){logger[_0x15d0('0x14')](_0x15d0('0x11'),_0x336cdb,_0x8264af[_0x15d0('0x14')][_0x15d0('0x16')]);return _0x45636b(_0x8264af[_0x15d0('0x14')][_0x15d0('0x16')]);}logger[_0x15d0('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x336cdb,_0x8264af['error'][_0x15d0('0x16')]);return _0x3bdb5c(_0x8264af['error'][_0x15d0('0x16')]);}else{logger[_0x15d0('0x10')](_0x15d0('0x11'),_0x336cdb,_0x15d0('0x17'));_0x3bdb5c(_0x8264af['result'][_0x15d0('0x16')]);}})['catch'](function(_0x17205e){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x336cdb,_0x17205e);_0x45636b(_0x17205e);});});}exports[_0x15d0('0x18')]=function(_0x541d4f){var _0x59c8c6=this;return new Promise(function(_0x35e679,_0x99d964){return db['WhatsappQueue'][_0x15d0('0x19')]({'raw':_0x541d4f[_0x15d0('0x1a')]?_0x541d4f['options']['raw']===undefined?!![]:![]:!![],'where':_0x541d4f['options']?_0x541d4f['options'][_0x15d0('0x1b')]||null:null,'attributes':_0x541d4f[_0x15d0('0x1a')]?_0x541d4f[_0x15d0('0x1a')]['attributes']||null:null,'limit':_0x541d4f['options']?_0x541d4f[_0x15d0('0x1a')]['limit']||null:null,'include':_0x541d4f[_0x15d0('0x1a')]?_0x541d4f[_0x15d0('0x1a')]['include']?_[_0x15d0('0x1c')](_0x541d4f[_0x15d0('0x1a')][_0x15d0('0x1d')],function(_0x28f885){return{'model':db[_0x28f885[_0x15d0('0x1e')]],'as':_0x28f885['as'],'attributes':_0x28f885[_0x15d0('0x1f')],'include':_0x28f885[_0x15d0('0x1d')]?_[_0x15d0('0x1c')](_0x28f885[_0x15d0('0x1d')],function(_0x42e990){return{'model':db[_0x42e990[_0x15d0('0x1e')]],'as':_0x42e990['as'],'attributes':_0x42e990['attributes'],'include':_0x42e990[_0x15d0('0x1d')]?_['map'](_0x42e990[_0x15d0('0x1d')],function(_0x14fbdf){return{'model':db[_0x14fbdf[_0x15d0('0x1e')]],'as':_0x14fbdf['as'],'attributes':_0x14fbdf[_0x15d0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d65e4){logger[_0x15d0('0x10')](_0x15d0('0x18'),_0x541d4f);logger[_0x15d0('0x12')]('GetWhatsappQueue',_0x541d4f,JSON[_0x15d0('0x20')](_0x2d65e4));_0x35e679(_0x2d65e4);})[_0x15d0('0x21')](function(_0x53cb9a){logger[_0x15d0('0x14')](_0x15d0('0x18'),_0x53cb9a['message'],_0x541d4f);_0x99d964(_0x59c8c6[_0x15d0('0x14')](0x1f4,_0x53cb9a[_0x15d0('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x2a3dc4){var _0x5bde85=this;return new Promise(function(_0x2ad2fe,_0x4b956f){return db['WhatsappQueue'][_0x15d0('0x22')]({'raw':_0x2a3dc4[_0x15d0('0x1a')]?_0x2a3dc4['options'][_0x15d0('0x23')]===undefined?!![]:![]:!![],'where':_0x2a3dc4[_0x15d0('0x1a')]?_0x2a3dc4['options'][_0x15d0('0x1b')]||null:null,'attributes':_0x2a3dc4[_0x15d0('0x1a')]?_0x2a3dc4[_0x15d0('0x1a')][_0x15d0('0x1f')]||null:null,'include':_0x2a3dc4[_0x15d0('0x1a')]?_0x2a3dc4[_0x15d0('0x1a')][_0x15d0('0x1d')]?_[_0x15d0('0x1c')](_0x2a3dc4['options'][_0x15d0('0x1d')],function(_0x93859b){return{'model':db[_0x93859b[_0x15d0('0x1e')]],'as':_0x93859b['as'],'attributes':_0x93859b[_0x15d0('0x1f')],'include':_0x93859b[_0x15d0('0x1d')]?_['map'](_0x93859b[_0x15d0('0x1d')],function(_0x4b1d21){return{'model':db[_0x4b1d21[_0x15d0('0x1e')]],'as':_0x4b1d21['as'],'attributes':_0x4b1d21[_0x15d0('0x1f')],'include':_0x4b1d21[_0x15d0('0x1d')]?_['map'](_0x4b1d21[_0x15d0('0x1d')],function(_0x22f24c){return{'model':db[_0x22f24c[_0x15d0('0x1e')]],'as':_0x22f24c['as'],'attributes':_0x22f24c['attributes']};}):[]};}):[]};}):[]:[]})[_0x15d0('0x24')](function(_0x486e34){logger['info'](_0x15d0('0x25'),_0x2a3dc4);logger[_0x15d0('0x12')]('ShowWhatsappQueue',_0x2a3dc4,JSON[_0x15d0('0x20')](_0x486e34));_0x2ad2fe(_0x486e34);})[_0x15d0('0x21')](function(_0xb807eb){logger['error'](_0x15d0('0x25'),_0xb807eb[_0x15d0('0x16')],_0x2a3dc4);_0x4b956f(_0x5bde85[_0x15d0('0x14')](0x1f4,_0xb807eb[_0x15d0('0x16')]));});});}; \ No newline at end of file +var _0xa720=['then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','model','stringify','ShowWhatsappQueue','find','where','map','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request'];(function(_0x5520fe,_0x27c068){var _0x49816e=function(_0x44ca27){while(--_0x44ca27){_0x5520fe['push'](_0x5520fe['shift']());}};_0x49816e(++_0x27c068);}(_0xa720,0xfc));var _0x0a72=function(_0x200f7f,_0x34fbb8){_0x200f7f=_0x200f7f-0x0;var _0x9a2bae=_0xa720[_0x200f7f];return _0x9a2bae;};'use strict';var _=require('lodash');var util=require(_0x0a72('0x0'));var moment=require(_0x0a72('0x1'));var BPromise=require(_0x0a72('0x2'));var rs=require(_0x0a72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a72('0x4'));var logger=require(_0x0a72('0x5'))('rpc');var config=require(_0x0a72('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0a72('0x7')]['http']({'port':0x232a});config[_0x0a72('0x8')]=_[_0x0a72('0x9')](config[_0x0a72('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a72('0xa'))(new Redis(config['redis']));require(_0x0a72('0xb'))[_0x0a72('0xc')](socket);function respondWithRpcPromise(_0x483521,_0x12202a,_0x4d59ee){return new BPromise(function(_0x2ba2d4,_0x4fc045){return client[_0x0a72('0xd')](_0x483521,_0x4d59ee)[_0x0a72('0xe')](function(_0x5e4f18){logger[_0x0a72('0xf')](_0x0a72('0x10'),_0x12202a,'request\x20sent');logger[_0x0a72('0x11')](_0x0a72('0x12'),_0x12202a,_0x0a72('0x13'),JSON['stringify'](_0x5e4f18));if(_0x5e4f18[_0x0a72('0x14')]){if(_0x5e4f18[_0x0a72('0x14')][_0x0a72('0x15')]===0x1f4){logger[_0x0a72('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x12202a,_0x5e4f18[_0x0a72('0x14')]['message']);return _0x4fc045(_0x5e4f18[_0x0a72('0x14')][_0x0a72('0x16')]);}logger[_0x0a72('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x12202a,_0x5e4f18[_0x0a72('0x14')][_0x0a72('0x16')]);return _0x2ba2d4(_0x5e4f18['error'][_0x0a72('0x16')]);}else{logger[_0x0a72('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x12202a,_0x0a72('0x13'));_0x2ba2d4(_0x5e4f18[_0x0a72('0x17')][_0x0a72('0x16')]);}})[_0x0a72('0x18')](function(_0x56f35e){logger[_0x0a72('0x14')](_0x0a72('0x10'),_0x12202a,_0x56f35e);_0x4fc045(_0x56f35e);});});}exports[_0x0a72('0x19')]=function(_0x27db6f){var _0x4b551d=this;return new Promise(function(_0x3e35ca,_0xe54007){return db[_0x0a72('0x1a')][_0x0a72('0x1b')]({'raw':_0x27db6f[_0x0a72('0x1c')]?_0x27db6f[_0x0a72('0x1c')][_0x0a72('0x1d')]===undefined?!![]:![]:!![],'where':_0x27db6f['options']?_0x27db6f[_0x0a72('0x1c')]['where']||null:null,'attributes':_0x27db6f[_0x0a72('0x1c')]?_0x27db6f[_0x0a72('0x1c')][_0x0a72('0x1e')]||null:null,'limit':_0x27db6f[_0x0a72('0x1c')]?_0x27db6f['options']['limit']||null:null,'include':_0x27db6f[_0x0a72('0x1c')]?_0x27db6f['options'][_0x0a72('0x1f')]?_['map'](_0x27db6f[_0x0a72('0x1c')]['include'],function(_0x3ab0e2){return{'model':db[_0x3ab0e2[_0x0a72('0x20')]],'as':_0x3ab0e2['as'],'attributes':_0x3ab0e2[_0x0a72('0x1e')],'include':_0x3ab0e2[_0x0a72('0x1f')]?_['map'](_0x3ab0e2[_0x0a72('0x1f')],function(_0x5e3067){return{'model':db[_0x5e3067[_0x0a72('0x20')]],'as':_0x5e3067['as'],'attributes':_0x5e3067['attributes'],'include':_0x5e3067[_0x0a72('0x1f')]?_['map'](_0x5e3067[_0x0a72('0x1f')],function(_0x110e76){return{'model':db[_0x110e76['model']],'as':_0x110e76['as'],'attributes':_0x110e76['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a72('0xe')](function(_0x3b8824){logger[_0x0a72('0xf')](_0x0a72('0x19'),_0x27db6f);logger[_0x0a72('0x11')]('GetWhatsappQueue',_0x27db6f,JSON[_0x0a72('0x21')](_0x3b8824));_0x3e35ca(_0x3b8824);})[_0x0a72('0x18')](function(_0x53514f){logger[_0x0a72('0x14')]('GetWhatsappQueue',_0x53514f[_0x0a72('0x16')],_0x27db6f);_0xe54007(_0x4b551d[_0x0a72('0x14')](0x1f4,_0x53514f[_0x0a72('0x16')]));});});};exports[_0x0a72('0x22')]=function(_0x3bfca1){var _0x3e045d=this;return new Promise(function(_0x2829b2,_0x150714){return db[_0x0a72('0x1a')][_0x0a72('0x23')]({'raw':_0x3bfca1['options']?_0x3bfca1[_0x0a72('0x1c')][_0x0a72('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bfca1[_0x0a72('0x1c')]?_0x3bfca1['options'][_0x0a72('0x24')]||null:null,'attributes':_0x3bfca1['options']?_0x3bfca1[_0x0a72('0x1c')][_0x0a72('0x1e')]||null:null,'include':_0x3bfca1[_0x0a72('0x1c')]?_0x3bfca1['options'][_0x0a72('0x1f')]?_[_0x0a72('0x25')](_0x3bfca1[_0x0a72('0x1c')][_0x0a72('0x1f')],function(_0x125d77){return{'model':db[_0x125d77[_0x0a72('0x20')]],'as':_0x125d77['as'],'attributes':_0x125d77[_0x0a72('0x1e')],'include':_0x125d77[_0x0a72('0x1f')]?_[_0x0a72('0x25')](_0x125d77['include'],function(_0x2de52f){return{'model':db[_0x2de52f[_0x0a72('0x20')]],'as':_0x2de52f['as'],'attributes':_0x2de52f[_0x0a72('0x1e')],'include':_0x2de52f['include']?_['map'](_0x2de52f[_0x0a72('0x1f')],function(_0x4b457f){return{'model':db[_0x4b457f[_0x0a72('0x20')]],'as':_0x4b457f['as'],'attributes':_0x4b457f[_0x0a72('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a72('0xe')](function(_0x462f7c){logger[_0x0a72('0xf')]('ShowWhatsappQueue',_0x3bfca1);logger[_0x0a72('0x11')](_0x0a72('0x22'),_0x3bfca1,JSON['stringify'](_0x462f7c));_0x2829b2(_0x462f7c);})['catch'](function(_0xd88f99){logger[_0x0a72('0x14')](_0x0a72('0x22'),_0xd88f99[_0x0a72('0x16')],_0x3bfca1);_0x150714(_0x3e045d['error'](0x1f4,_0xd88f99[_0x0a72('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index b9aaf29..6376431 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 _0x9c11=['removeListener','register','whatsappQueue:','save','update','emit'];(function(_0x4ea889,_0x9d9cfb){var _0x27adc3=function(_0x1d03b2){while(--_0x1d03b2){_0x4ea889['push'](_0x4ea889['shift']());}};_0x27adc3(++_0x9d9cfb);}(_0x9c11,0x1ef));var _0x19c1=function(_0x28851,_0x1903df){_0x28851=_0x28851-0x0;var _0x27fd2d=_0x9c11[_0x28851];return _0x27fd2d;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x19c1('0x0'),'remove',_0x19c1('0x1')];function createListener(_0x5e077f,_0x307c7a){return function(_0x2aa8de){_0x307c7a[_0x19c1('0x2')](_0x5e077f,_0x2aa8de);};}function removeListener(_0x1efb39,_0x3a5437){return function(){WhatsappQueueEvents[_0x19c1('0x3')](_0x1efb39,_0x3a5437);};}exports[_0x19c1('0x4')]=function(_0x492fbe){for(var _0x875030=0x0,_0xb269ed=events['length'];_0x875030<_0xb269ed;_0x875030++){var _0x4ce61b=events[_0x875030];var _0x477b13=createListener(_0x19c1('0x5')+_0x4ce61b,_0x492fbe);WhatsappQueueEvents['on'](_0x4ce61b,_0x477b13);}}; \ No newline at end of file +var _0x4d65=['removeListener','length','./whatsappQueue.events','remove'];(function(_0x22bf3f,_0x4425b3){var _0x3e7bcd=function(_0xb6f0aa){while(--_0xb6f0aa){_0x22bf3f['push'](_0x22bf3f['shift']());}};_0x3e7bcd(++_0x4425b3);}(_0x4d65,0x172));var _0x54d6=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4d65[_0x8de54f];return _0x14cba4;};'use strict';var WhatsappQueueEvents=require(_0x54d6('0x0'));var events=['save',_0x54d6('0x1'),'update'];function createListener(_0x2a1d2e,_0x430382){return function(_0x59d46e){_0x430382['emit'](_0x2a1d2e,_0x59d46e);};}function removeListener(_0x5420c6,_0x3f0247){return function(){WhatsappQueueEvents[_0x54d6('0x2')](_0x5420c6,_0x3f0247);};}exports['register']=function(_0x1382bd){for(var _0x14ef71=0x0,_0x4d51f6=events[_0x54d6('0x3')];_0x14ef71<_0x4d51f6;_0x14ef71++){var _0x5d0621=events[_0x14ef71];var _0xe46298=createListener('whatsappQueue:'+_0x5d0621,_0x1382bd);WhatsappQueueEvents['on'](_0x5d0621,_0xe46298);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 9554724..279ca93 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 _0xcbb5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3a3b3a,_0x1fb59b){var _0x5df2c8=function(_0x1cb9e6){while(--_0x1cb9e6){_0x3a3b3a['push'](_0x3a3b3a['shift']());}};_0x5df2c8(++_0x1fb59b);}(_0xcbb5,0x141));var _0x5cbb=function(_0x46444c,_0x157f8f){_0x46444c=_0x46444c-0x0;var _0x35926b=_0xcbb5[_0x46444c];return _0x35926b;};'use strict';var multer=require(_0x5cbb('0x0'));var util=require('util');var path=require(_0x5cbb('0x1'));var timeout=require('connect-timeout');var express=require(_0x5cbb('0x2'));var router=express[_0x5cbb('0x3')]();var fs_extra=require(_0x5cbb('0x4'));var auth=require(_0x5cbb('0x5'));var interaction=require(_0x5cbb('0x6'));var config=require(_0x5cbb('0x7'));var controller=require(_0x5cbb('0x8'));router[_0x5cbb('0x9')]('/',auth[_0x5cbb('0xa')](),controller[_0x5cbb('0xb')]);router[_0x5cbb('0x9')](_0x5cbb('0xc'),auth[_0x5cbb('0xa')](),controller[_0x5cbb('0xd')]);router[_0x5cbb('0x9')](_0x5cbb('0xe'),auth[_0x5cbb('0xa')](),controller[_0x5cbb('0xf')]);router[_0x5cbb('0x10')]('/',auth[_0x5cbb('0xa')](),controller[_0x5cbb('0x11')]);router[_0x5cbb('0x12')](_0x5cbb('0xe'),auth['isAuthenticated'](),controller[_0x5cbb('0x13')]);router[_0x5cbb('0x14')](_0x5cbb('0xe'),auth[_0x5cbb('0xa')](),controller[_0x5cbb('0x15')]);module[_0x5cbb('0x16')]=router; \ No newline at end of file +var _0xf5b0=['describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2822fd,_0x3d15e0){var _0x959ce3=function(_0x343f08){while(--_0x343f08){_0x2822fd['push'](_0x2822fd['shift']());}};_0x959ce3(++_0x3d15e0);}(_0xf5b0,0x110));var _0x0f5b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf5b0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0f5b('0x0'));var util=require(_0x0f5b('0x1'));var path=require(_0x0f5b('0x2'));var timeout=require(_0x0f5b('0x3'));var express=require(_0x0f5b('0x4'));var router=express[_0x0f5b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0f5b('0x6'));var interaction=require(_0x0f5b('0x7'));var config=require(_0x0f5b('0x8'));var controller=require(_0x0f5b('0x9'));router[_0x0f5b('0xa')]('/',auth[_0x0f5b('0xb')](),controller[_0x0f5b('0xc')]);router[_0x0f5b('0xa')](_0x0f5b('0xd'),auth[_0x0f5b('0xb')](),controller[_0x0f5b('0xe')]);router['get'](_0x0f5b('0xf'),auth['isAuthenticated'](),controller[_0x0f5b('0x10')]);router[_0x0f5b('0x11')]('/',auth[_0x0f5b('0xb')](),controller[_0x0f5b('0x12')]);router[_0x0f5b('0x13')](_0x0f5b('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x0f5b('0x14')](_0x0f5b('0xf'),auth['isAuthenticated'](),controller[_0x0f5b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index ac6634e..8037e86 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x55096c,_0x4edd3b){var _0x46e012=function(_0x2eb056){while(--_0x2eb056){_0x55096c['push'](_0x55096c['shift']());}};_0x46e012(++_0x4edd3b);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef6b3,_0x42687c){_0x4ef6b3=_0x4ef6b3-0x0;var _0x499ff1=_0x7a54[_0x4ef6b3];return _0x499ff1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x205d02,_0x57cd48){var _0x29213d=function(_0x5ce74c){while(--_0x5ce74c){_0x205d02['push'](_0x205d02['shift']());}};_0x29213d(++_0x57cd48);}(_0x7a54,0x106));var _0x47a5=function(_0x3a82e4,_0x2f43fb){_0x3a82e4=_0x3a82e4-0x0;var _0x38ee9c=_0x7a54[_0x3a82e4];return _0x38ee9c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 92d33dc..a448765 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 _0x087b=['name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','update','params','describe','eml-format','rimraf','request-promise','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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack'];(function(_0x562088,_0x4281fd){var _0x16f24f=function(_0x2b273d){while(--_0x2b273d){_0x562088['push'](_0x562088['shift']());}};_0x16f24f(++_0x4281fd);}(_0x087b,0x11a));var _0xb087=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x087b[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2dc6,_0x50745a){return function(_0x598b99){if(!_0x598b99){_0x5a2dc6['sendStatus'](0x194);}return _0x598b99;};}function handleError(_0x304840,_0x45685d){_0x45685d=_0x45685d||0x1f4;return function(_0x1d124f){logger[_0xb087('0x28')](_0x1d124f[_0xb087('0x29')]);if(_0x1d124f[_0xb087('0x2a')]){delete _0x1d124f[_0xb087('0x2a')];}_0x304840[_0xb087('0x1c')](_0x45685d)[_0xb087('0x2b')](_0x1d124f);};}exports[_0xb087('0x2c')]=function(_0x18058c,_0x31e3e6){var _0xb0baf6={},_0x263259={},_0x593b78={'count':0x0,'rows':[]};var _0x37393a=_[_0xb087('0x2d')](db[_0xb087('0x2e')][_0xb087('0x2f')],function(_0x22d441){return{'name':_0x22d441[_0xb087('0x30')],'type':_0x22d441[_0xb087('0x31')][_0xb087('0x32')]};});_0x263259['model']=_['map'](_0x37393a,_0xb087('0x2a'));_0x263259[_0xb087('0x33')]=_['keys'](_0x18058c[_0xb087('0x33')]);_0x263259[_0xb087('0x34')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],_0x263259[_0xb087('0x33')]);_0xb0baf6[_0xb087('0x37')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],qs[_0xb087('0x38')](_0x18058c[_0xb087('0x33')][_0xb087('0x38')]));_0xb0baf6[_0xb087('0x37')]=_0xb0baf6['attributes'][_0xb087('0x39')]?_0xb0baf6['attributes']:_0x263259[_0xb087('0x36')];if(!_0x18058c[_0xb087('0x33')][_0xb087('0x3a')](_0xb087('0x3b'))){_0xb0baf6[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x18058c[_0xb087('0x33')][_0xb087('0x20')]);_0xb0baf6[_0xb087('0x1f')]=qs['offset'](_0x18058c['query'][_0xb087('0x1f')]);}_0xb0baf6[_0xb087('0x3c')]=qs[_0xb087('0x3d')](_0x18058c[_0xb087('0x33')][_0xb087('0x3d')]);_0xb0baf6['where']=qs[_0xb087('0x34')](_[_0xb087('0x3e')](_0x18058c['query'],_0x263259['filters']),_0x37393a);if(_0x18058c[_0xb087('0x33')][_0xb087('0x3f')]){_0xb0baf6[_0xb087('0x40')]=_['merge'](_0xb0baf6[_0xb087('0x40')],{'$or':_[_0xb087('0x2d')](_0x37393a,function(_0x1caa6e){if(_0x1caa6e[_0xb087('0x31')]!==_0xb087('0x41')){var _0x5db6b9={};_0x5db6b9[_0x1caa6e[_0xb087('0x2a')]]={'$like':'%'+_0x18058c['query'][_0xb087('0x3f')]+'%'};return _0x5db6b9;}})});}_0xb0baf6=_['merge']({},_0xb0baf6,_0x18058c[_0xb087('0x42')]);var _0xc9f9e9={'where':_0xb0baf6['where']};return db[_0xb087('0x2e')]['count'](_0xc9f9e9)[_0xb087('0x27')](function(_0x4a360c){_0x593b78[_0xb087('0x22')]=_0x4a360c;if(_0x18058c[_0xb087('0x33')][_0xb087('0x43')]){_0xb0baf6[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x2e')][_0xb087('0x45')](_0xb0baf6);})[_0xb087('0x27')](function(_0x5e7690){_0x593b78[_0xb087('0x46')]=_0x5e7690;return _0x593b78;})['then'](respondWithFilteredResult(_0x31e3e6,_0xb0baf6))[_0xb087('0x47')](handleError(_0x31e3e6,null));};exports[_0xb087('0x48')]=function(_0x5b6924,_0xb662bf){var _0x45dc6f={'raw':!![],'where':{'id':_0x5b6924['params']['id']}},_0x7650c5={};_0x7650c5[_0xb087('0x36')]=_['keys'](db[_0xb087('0x2e')][_0xb087('0x2f')]);_0x7650c5['query']=_[_0xb087('0x49')](_0x5b6924[_0xb087('0x33')]);_0x7650c5['filters']=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],_0x7650c5['query']);_0x45dc6f[_0xb087('0x37')]=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],qs[_0xb087('0x38')](_0x5b6924['query']['fields']));_0x45dc6f[_0xb087('0x37')]=_0x45dc6f[_0xb087('0x37')][_0xb087('0x39')]?_0x45dc6f[_0xb087('0x37')]:_0x7650c5[_0xb087('0x36')];if(_0x5b6924[_0xb087('0x33')]['includeAll']){_0x45dc6f['include']=[{'all':!![]}];}_0x45dc6f=_[_0xb087('0x4a')]({},_0x45dc6f,_0x5b6924['options']);return db[_0xb087('0x2e')][_0xb087('0x4b')](_0x45dc6f)[_0xb087('0x27')](handleEntityNotFound(_0xb662bf,null))[_0xb087('0x27')](respondWithResult(_0xb662bf,null))['catch'](handleError(_0xb662bf,null));};exports[_0xb087('0x4c')]=function(_0x562751,_0x2fe8a0){return db[_0xb087('0x2e')][_0xb087('0x4c')](_0x562751[_0xb087('0x4d')],{})[_0xb087('0x27')](respondWithResult(_0x2fe8a0,0xc9))['catch'](handleError(_0x2fe8a0,null));};exports[_0xb087('0x4e')]=function(_0xb15e28,_0x588d96){if(_0xb15e28['body']['id']){delete _0xb15e28[_0xb087('0x4d')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0xb15e28[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x588d96,null))['then'](saveUpdates(_0xb15e28[_0xb087('0x4d')],null))[_0xb087('0x27')](respondWithResult(_0x588d96,null))[_0xb087('0x47')](handleError(_0x588d96,null));};exports['destroy']=function(_0x5ba160,_0x30cc83){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5ba160[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x30cc83,null))[_0xb087('0x27')](removeEntity(_0x30cc83,null))[_0xb087('0x47')](handleError(_0x30cc83,null));};exports[_0xb087('0x50')]=function(_0x148642,_0xbd849d){return db[_0xb087('0x2e')][_0xb087('0x50')]()[_0xb087('0x27')](respondWithResult(_0xbd849d,null))[_0xb087('0x47')](handleError(_0xbd849d,null));}; \ No newline at end of file +var _0x1339=['../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x37047b,_0x16bff4){var _0x3b299a=function(_0x23c86b){while(--_0x23c86b){_0x37047b['push'](_0x37047b['shift']());}};_0x3b299a(++_0x16bff4);}(_0x1339,0x1ed));var _0x9133=function(_0x43beaa,_0x8c3d7f){_0x43beaa=_0x43beaa-0x0;var _0x5a9dfd=_0x1339[_0x43beaa];return _0x5a9dfd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};exports[_0x9133('0x49')]=function(_0x4f7b1e,_0x2342f4){return db[_0x9133('0x29')][_0x9133('0x49')]()[_0x9133('0x20')](respondWithResult(_0x2342f4,null))['catch'](handleError(_0x2342f4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 7f25c7e..2488c66 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 _0x0440=['api','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0440,0xca));var _0x0044=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x0440[_0x1de43c];return _0x296d3e;};'use strict';var _=require('lodash');var util=require(_0x0044('0x0'));var logger=require(_0x0044('0x1'))(_0x0044('0x2'));var moment=require('moment');var BPromise=require(_0x0044('0x3'));var rp=require(_0x0044('0x4'));var fs=require('fs');var path=require(_0x0044('0x5'));var rimraf=require('rimraf');var config=require(_0x0044('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x0044('0x7')]=function(_0x1f0ae4,_0x29c923){return _0x1f0ae4[_0x0044('0x8')](_0x0044('0x9'),attributes,{'tableName':_0x0044('0xa'),'paranoid':![],'indexes':[{'name':_0x0044('0xb'),'fields':[_0x0044('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b73=['bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0x2d526c,_0xa4d610){var _0xb17f5a=function(_0x41fdb7){while(--_0x41fdb7){_0x2d526c['push'](_0x2d526c['shift']());}};_0xb17f5a(++_0xa4d610);}(_0x2b73,0x76));var _0x32b7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2b73[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0x32b7('0x0'));var logger=require(_0x32b7('0x1'))(_0x32b7('0x2'));var moment=require('moment');var BPromise=require(_0x32b7('0x3'));var rp=require(_0x32b7('0x4'));var fs=require('fs');var path=require(_0x32b7('0x5'));var rimraf=require(_0x32b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x32b7('0x7'));module[_0x32b7('0x8')]=function(_0x22db1f,_0x3d18af){return _0x22db1f['define']('WhatsappQueueReport',attributes,{'tableName':_0x32b7('0x9'),'paranoid':![],'indexes':[{'name':_0x32b7('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 16f610a..2049076 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 _0xf2a0=['attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update'];(function(_0x1ec494,_0x177f47){var _0x5dc1c7=function(_0x383663){while(--_0x383663){_0x1ec494['push'](_0x1ec494['shift']());}};_0x5dc1c7(++_0x177f47);}(_0xf2a0,0x7e));var _0x0f2a=function(_0x2d2201,_0x3cfe3d){_0x2d2201=_0x2d2201-0x0;var _0x12e6cd=_0xf2a0[_0x2d2201];return _0x12e6cd;};'use strict';var _=require('lodash');var util=require(_0x0f2a('0x0'));var moment=require(_0x0f2a('0x1'));var BPromise=require(_0x0f2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f2a('0x3'));var db=require(_0x0f2a('0x4'))['db'];var utils=require(_0x0f2a('0x5'));var logger=require(_0x0f2a('0x6'))(_0x0f2a('0x7'));var config=require(_0x0f2a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f2a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fdb21,_0x3feb8b,_0x3ac230){return new BPromise(function(_0x204315,_0x572f92){return client[_0x0f2a('0xa')](_0x1fdb21,_0x3ac230)[_0x0f2a('0xb')](function(_0x467f03){logger[_0x0f2a('0xc')](_0x0f2a('0xd'),_0x3feb8b,_0x0f2a('0xe'));logger[_0x0f2a('0xf')](_0x0f2a('0x10'),_0x3feb8b,'request\x20sent',JSON[_0x0f2a('0x11')](_0x467f03));if(_0x467f03[_0x0f2a('0x12')]){if(_0x467f03[_0x0f2a('0x12')]['code']===0x1f4){logger['error'](_0x0f2a('0xd'),_0x3feb8b,_0x467f03['error'][_0x0f2a('0x13')]);return _0x572f92(_0x467f03[_0x0f2a('0x12')]['message']);}logger[_0x0f2a('0x12')](_0x0f2a('0xd'),_0x3feb8b,_0x467f03[_0x0f2a('0x12')]['message']);return _0x204315(_0x467f03[_0x0f2a('0x12')][_0x0f2a('0x13')]);}else{logger[_0x0f2a('0xc')](_0x0f2a('0xd'),_0x3feb8b,_0x0f2a('0xe'));_0x204315(_0x467f03['result'][_0x0f2a('0x13')]);}})[_0x0f2a('0x14')](function(_0x1f0907){logger[_0x0f2a('0x12')](_0x0f2a('0xd'),_0x3feb8b,_0x1f0907);_0x572f92(_0x1f0907);});});}exports[_0x0f2a('0x15')]=function(_0x4868e6){var _0x3afec9=this;return new Promise(function(_0xef78ac,_0x2901bb){return db[_0x0f2a('0x16')][_0x0f2a('0x17')](_0x4868e6[_0x0f2a('0x18')],{'raw':_0x4868e6[_0x0f2a('0x19')]?_0x4868e6[_0x0f2a('0x19')][_0x0f2a('0x1a')]===undefined?!![]:![]:!![]})[_0x0f2a('0xb')](function(_0x19d36d){logger[_0x0f2a('0xc')](_0x0f2a('0x15'),_0x4868e6);logger['debug'](_0x0f2a('0x15'),_0x4868e6,JSON[_0x0f2a('0x11')](_0x19d36d));_0xef78ac(_0x19d36d);})[_0x0f2a('0x14')](function(_0x1075d8){logger[_0x0f2a('0x12')](_0x0f2a('0x15'),_0x1075d8[_0x0f2a('0x13')],_0x4868e6);_0x2901bb(_0x3afec9[_0x0f2a('0x12')](0x1f4,_0x1075d8[_0x0f2a('0x13')]));});});};exports[_0x0f2a('0x1b')]=function(_0x412626){var _0x289ca5=this;return new Promise(function(_0x10c808,_0x4100c4){return db[_0x0f2a('0x16')][_0x0f2a('0x1c')](_0x412626[_0x0f2a('0x18')],{'raw':_0x412626[_0x0f2a('0x19')]?_0x412626[_0x0f2a('0x19')][_0x0f2a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x412626['options']?_0x412626['options']['where']||null:null,'attributes':_0x412626[_0x0f2a('0x19')]?_0x412626[_0x0f2a('0x19')][_0x0f2a('0x1d')]||null:null,'limit':_0x412626[_0x0f2a('0x19')]?_0x412626[_0x0f2a('0x19')][_0x0f2a('0x1e')]||null:null})[_0x0f2a('0xb')](function(_0x32fdc5){logger[_0x0f2a('0xc')](_0x0f2a('0x1b'),_0x412626);logger[_0x0f2a('0xf')]('UpdateWhatsappQueueReport',_0x412626,JSON[_0x0f2a('0x11')](_0x32fdc5));_0x10c808(_0x32fdc5);})[_0x0f2a('0x14')](function(_0x24cf75){logger['error'](_0x0f2a('0x1b'),_0x24cf75[_0x0f2a('0x13')],_0x412626);_0x4100c4(_0x289ca5[_0x0f2a('0x12')](0x1f4,_0x24cf75[_0x0f2a('0x13')]));});});}; \ No newline at end of file +var _0xdb58=['body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xdb58,0x18d));var _0x8db5=function(_0x44f3a0,_0x479d29){_0x44f3a0=_0x44f3a0-0x0;var _0xfbdcd7=_0xdb58[_0x44f3a0];return _0xfbdcd7;};'use strict';var _=require('lodash');var util=require(_0x8db5('0x0'));var moment=require(_0x8db5('0x1'));var BPromise=require('bluebird');var rs=require(_0x8db5('0x2'));var fs=require('fs');var Redis=require(_0x8db5('0x3'));var db=require(_0x8db5('0x4'))['db'];var utils=require(_0x8db5('0x5'));var logger=require(_0x8db5('0x6'))('rpc');var config=require(_0x8db5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8db5('0x8')][_0x8db5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8b72,_0x3b02e0,_0x9a991a){return new BPromise(function(_0x5dca31,_0xa7846e){return client['request'](_0x3d8b72,_0x9a991a)[_0x8db5('0xa')](function(_0x4d0c72){logger[_0x8db5('0xb')](_0x8db5('0xc'),_0x3b02e0,_0x8db5('0xd'));logger[_0x8db5('0xe')](_0x8db5('0xf'),_0x3b02e0,_0x8db5('0xd'),JSON[_0x8db5('0x10')](_0x4d0c72));if(_0x4d0c72[_0x8db5('0x11')]){if(_0x4d0c72['error'][_0x8db5('0x12')]===0x1f4){logger['error'](_0x8db5('0xc'),_0x3b02e0,_0x4d0c72['error'][_0x8db5('0x13')]);return _0xa7846e(_0x4d0c72[_0x8db5('0x11')][_0x8db5('0x13')]);}logger[_0x8db5('0x11')](_0x8db5('0xc'),_0x3b02e0,_0x4d0c72[_0x8db5('0x11')]['message']);return _0x5dca31(_0x4d0c72['error'][_0x8db5('0x13')]);}else{logger[_0x8db5('0xb')](_0x8db5('0xc'),_0x3b02e0,_0x8db5('0xd'));_0x5dca31(_0x4d0c72[_0x8db5('0x14')][_0x8db5('0x13')]);}})[_0x8db5('0x15')](function(_0x4fc8a7){logger[_0x8db5('0x11')](_0x8db5('0xc'),_0x3b02e0,_0x4fc8a7);_0xa7846e(_0x4fc8a7);});});}exports[_0x8db5('0x16')]=function(_0x2e8ed9){var _0x304aab=this;return new Promise(function(_0x50d270,_0x14dee4){return db['WhatsappQueueReport']['create'](_0x2e8ed9[_0x8db5('0x17')],{'raw':_0x2e8ed9[_0x8db5('0x18')]?_0x2e8ed9[_0x8db5('0x18')][_0x8db5('0x19')]===undefined?!![]:![]:!![]})[_0x8db5('0xa')](function(_0x300c81){logger['info']('CreateWhatsappQueueReport',_0x2e8ed9);logger[_0x8db5('0xe')](_0x8db5('0x16'),_0x2e8ed9,JSON[_0x8db5('0x10')](_0x300c81));_0x50d270(_0x300c81);})[_0x8db5('0x15')](function(_0x382016){logger[_0x8db5('0x11')](_0x8db5('0x16'),_0x382016[_0x8db5('0x13')],_0x2e8ed9);_0x14dee4(_0x304aab[_0x8db5('0x11')](0x1f4,_0x382016[_0x8db5('0x13')]));});});};exports[_0x8db5('0x1a')]=function(_0x3e39af){var _0x2aecbc=this;return new Promise(function(_0x19604b,_0x587cd6){return db[_0x8db5('0x1b')]['update'](_0x3e39af['body'],{'raw':_0x3e39af['options']?_0x3e39af[_0x8db5('0x18')][_0x8db5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e39af[_0x8db5('0x18')]?_0x3e39af['options']['where']||null:null,'attributes':_0x3e39af['options']?_0x3e39af[_0x8db5('0x18')][_0x8db5('0x1c')]||null:null,'limit':_0x3e39af[_0x8db5('0x18')]?_0x3e39af[_0x8db5('0x18')][_0x8db5('0x1d')]||null:null})['then'](function(_0x2dfbc2){logger[_0x8db5('0xb')](_0x8db5('0x1a'),_0x3e39af);logger[_0x8db5('0xe')](_0x8db5('0x1a'),_0x3e39af,JSON['stringify'](_0x2dfbc2));_0x19604b(_0x2dfbc2);})[_0x8db5('0x15')](function(_0x1acf0f){logger['error'](_0x8db5('0x1a'),_0x1acf0f[_0x8db5('0x13')],_0x3e39af);_0x587cd6(_0x2aecbc[_0x8db5('0x11')](0x1f4,_0x1acf0f[_0x8db5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 3416b7d..1da8037 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 _0x9d17=['express','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','destroy','exports','multer','util','path','connect-timeout'];(function(_0x444555,_0x3aa00e){var _0x3a2052=function(_0xef3844){while(--_0xef3844){_0x444555['push'](_0x444555['shift']());}};_0x3a2052(++_0x3aa00e);}(_0x9d17,0x19e));var _0x79d1=function(_0x5b6234,_0x41e345){_0x5b6234=_0x5b6234-0x0;var _0x2eb8be=_0x9d17[_0x5b6234];return _0x2eb8be;};'use strict';var multer=require(_0x79d1('0x0'));var util=require(_0x79d1('0x1'));var path=require(_0x79d1('0x2'));var timeout=require(_0x79d1('0x3'));var express=require(_0x79d1('0x4'));var router=express[_0x79d1('0x5')]();var fs_extra=require(_0x79d1('0x6'));var auth=require(_0x79d1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79d1('0x8'));router['get']('/',auth[_0x79d1('0x9')](),controller[_0x79d1('0xa')]);router[_0x79d1('0xb')](_0x79d1('0xc'),auth[_0x79d1('0x9')](),controller[_0x79d1('0xd')]);router[_0x79d1('0xb')](_0x79d1('0xe'),auth[_0x79d1('0x9')](),controller[_0x79d1('0xf')]);router[_0x79d1('0x10')]('/',auth[_0x79d1('0x9')](),controller['create']);router['put'](_0x79d1('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x79d1('0x11')]);module[_0x79d1('0x12')]=router; \ No newline at end of file +var _0xb6f3=['describe','/:id','create','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb6f3,0x1e6));var _0x3b6f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb6f3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b6f('0x0'));var timeout=require(_0x3b6f('0x1'));var express=require('express');var router=express[_0x3b6f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3b6f('0x3'));var interaction=require(_0x3b6f('0x4'));var config=require(_0x3b6f('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0x3b6f('0x6')]('/',auth[_0x3b6f('0x7')](),controller['index']);router[_0x3b6f('0x6')](_0x3b6f('0x8'),auth[_0x3b6f('0x7')](),controller[_0x3b6f('0x9')]);router[_0x3b6f('0x6')](_0x3b6f('0xa'),auth[_0x3b6f('0x7')](),controller['show']);router['post']('/',auth[_0x3b6f('0x7')](),controller[_0x3b6f('0xb')]);router['put'](_0x3b6f('0xa'),auth[_0x3b6f('0x7')](),controller['update']);router[_0x3b6f('0xc')]('/:id',auth[_0x3b6f('0x7')](),controller[_0x3b6f('0xd')]);module[_0x3b6f('0xe')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 0a30021..fce6992 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 _0x225b=['account','queue','sequelize','exports','ENUM'];(function(_0x46b166,_0x1c98df){var _0x43e1a3=function(_0x2c8324){while(--_0x2c8324){_0x46b166['push'](_0x46b166['shift']());}};_0x43e1a3(++_0x1c98df);}(_0x225b,0xb1));var _0xb225=function(_0x41eacc,_0x2fea79){_0x41eacc=_0x41eacc-0x0;var _0x5a06db=_0x225b[_0x41eacc];return _0x5a06db;};'use strict';var Sequelize=require(_0xb225('0x0'));module[_0xb225('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb225('0x2')](_0xb225('0x3'),'agent',_0xb225('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x3746=['exports','ENUM','agent','queue','sequelize'];(function(_0xa5ba7,_0x388cc1){var _0x222db5=function(_0x9559d8){while(--_0x9559d8){_0xa5ba7['push'](_0xa5ba7['shift']());}};_0x222db5(++_0x388cc1);}(_0x3746,0xa9));var _0x6374=function(_0x4352be,_0x51c8b1){_0x4352be=_0x4352be-0x0;var _0x2d9bdc=_0x3746[_0x4352be];return _0x2d9bdc;};'use strict';var Sequelize=require(_0x6374('0x0'));module[_0x6374('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6374('0x2')]('account',_0x6374('0x3'),_0x6374('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 9867e03..2d69761 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 _0x2b47=['end','json','offset','undefined','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','WhatsappTransferReport','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x4f94ee,_0x26e8fd){var _0x1bb8ec=function(_0x466638){while(--_0x466638){_0x4f94ee['push'](_0x4f94ee['shift']());}};_0x1bb8ec(++_0x26e8fd);}(_0x2b47,0x77));var _0x72b4=function(_0x24ff7a,_0x4db614){_0x24ff7a=_0x24ff7a-0x0;var _0x4908b4=_0x2b47[_0x24ff7a];return _0x4908b4;};'use strict';var emlformat=require(_0x72b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x72b4('0x1'));var rp=require(_0x72b4('0x2'));var moment=require(_0x72b4('0x3'));var BPromise=require(_0x72b4('0x4'));var Mustache=require(_0x72b4('0x5'));var util=require('util');var path=require(_0x72b4('0x6'));var sox=require('sox');var csv=require(_0x72b4('0x7'));var ejs=require(_0x72b4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x72b4('0x9'));var jsforce=require(_0x72b4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x72b4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72b4('0xb'));var authService=require(_0x72b4('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72b4('0xd'));var logger=require('../../config/logger')(_0x72b4('0xe'));var utils=require(_0x72b4('0xf'));var config=require(_0x72b4('0x10'));var licenseUtil=require(_0x72b4('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37803b,_0x9c8f03){_0x9c8f03=_0x9c8f03||0xcc;return function(_0x4c57a0){if(_0x4c57a0){return _0x37803b['sendStatus'](_0x9c8f03);}return _0x37803b[_0x72b4('0x12')](_0x9c8f03)[_0x72b4('0x13')]();};}function respondWithResult(_0x1fab98,_0x6f7b90){_0x6f7b90=_0x6f7b90||0xc8;return function(_0x383706){if(_0x383706){return _0x1fab98[_0x72b4('0x12')](_0x6f7b90)[_0x72b4('0x14')](_0x383706);}};}function respondWithFilteredResult(_0x265f11,_0x2f41d8){return function(_0x2a7a05){if(_0x2a7a05){var _0x2f54aa=typeof _0x2f41d8[_0x72b4('0x15')]===_0x72b4('0x16')&&typeof _0x2f41d8['limit']===_0x72b4('0x16');var _0x20b639=_0x2a7a05['count'];var _0x44ec76=_0x2f54aa?0x0:_0x2f41d8[_0x72b4('0x15')];var _0x19e52d=_0x2f54aa?_0x2a7a05['count']:_0x2f41d8['offset']+_0x2f41d8[_0x72b4('0x17')];var _0x1443f6;if(_0x19e52d>=_0x20b639){_0x19e52d=_0x20b639;_0x1443f6=0xc8;}else{_0x1443f6=0xce;}_0x265f11[_0x72b4('0x12')](_0x1443f6);return _0x265f11[_0x72b4('0x18')]('Content-Range',_0x44ec76+'-'+_0x19e52d+'/'+_0x20b639)[_0x72b4('0x14')](_0x2a7a05);}return null;};}function patchUpdates(_0x278d58){return function(_0x12af31){try{jsonpatch[_0x72b4('0x19')](_0x12af31,_0x278d58,!![]);}catch(_0x10c0d6){return BPromise['reject'](_0x10c0d6);}return _0x12af31[_0x72b4('0x1a')]();};}function saveUpdates(_0x1074e7,_0x4f6af0){return function(_0x2df539){if(_0x2df539){return _0x2df539[_0x72b4('0x1b')](_0x1074e7)[_0x72b4('0x1c')](function(_0xe0abfe){return _0xe0abfe;});}return null;};}function removeEntity(_0xef1d23,_0x2e603c){return function(_0x93b070){if(_0x93b070){return _0x93b070[_0x72b4('0x1d')]()['then'](function(){_0xef1d23[_0x72b4('0x12')](0xcc)[_0x72b4('0x13')]();});}};}function handleEntityNotFound(_0x53cc63,_0x29deba){return function(_0x34bc6b){if(!_0x34bc6b){_0x53cc63[_0x72b4('0x1e')](0x194);}return _0x34bc6b;};}function handleError(_0x4e8300,_0x2e4feb){_0x2e4feb=_0x2e4feb||0x1f4;return function(_0x52b425){logger[_0x72b4('0x1f')](_0x52b425[_0x72b4('0x20')]);if(_0x52b425['name']){delete _0x52b425['name'];}_0x4e8300[_0x72b4('0x12')](_0x2e4feb)[_0x72b4('0x21')](_0x52b425);};}exports[_0x72b4('0x22')]=function(_0x4dd0df,_0x52c6e1){var _0x2bf3ef={},_0x4c19bb={},_0x282227={'count':0x0,'rows':[]};var _0x2717f2=_[_0x72b4('0x23')](db[_0x72b4('0x24')]['rawAttributes'],function(_0x3f552b){return{'name':_0x3f552b[_0x72b4('0x25')],'type':_0x3f552b[_0x72b4('0x26')][_0x72b4('0x27')]};});_0x4c19bb[_0x72b4('0x28')]=_[_0x72b4('0x23')](_0x2717f2,_0x72b4('0x29'));_0x4c19bb[_0x72b4('0x2a')]=_[_0x72b4('0x2b')](_0x4dd0df[_0x72b4('0x2a')]);_0x4c19bb['filters']=_[_0x72b4('0x2c')](_0x4c19bb[_0x72b4('0x28')],_0x4c19bb[_0x72b4('0x2a')]);_0x2bf3ef['attributes']=_[_0x72b4('0x2c')](_0x4c19bb[_0x72b4('0x28')],qs['fields'](_0x4dd0df[_0x72b4('0x2a')][_0x72b4('0x2d')]));_0x2bf3ef[_0x72b4('0x2e')]=_0x2bf3ef['attributes'][_0x72b4('0x2f')]?_0x2bf3ef[_0x72b4('0x2e')]:_0x4c19bb[_0x72b4('0x28')];if(!_0x4dd0df[_0x72b4('0x2a')][_0x72b4('0x30')](_0x72b4('0x31'))){_0x2bf3ef['limit']=qs[_0x72b4('0x17')](_0x4dd0df['query'][_0x72b4('0x17')]);_0x2bf3ef[_0x72b4('0x15')]=qs[_0x72b4('0x15')](_0x4dd0df['query']['offset']);}_0x2bf3ef[_0x72b4('0x32')]=qs[_0x72b4('0x33')](_0x4dd0df['query'][_0x72b4('0x33')]);_0x2bf3ef[_0x72b4('0x34')]=qs[_0x72b4('0x35')](_['pick'](_0x4dd0df[_0x72b4('0x2a')],_0x4c19bb[_0x72b4('0x35')]),_0x2717f2);if(_0x4dd0df[_0x72b4('0x2a')][_0x72b4('0x36')]){_0x2bf3ef[_0x72b4('0x34')]=_[_0x72b4('0x37')](_0x2bf3ef[_0x72b4('0x34')],{'$or':_[_0x72b4('0x23')](_0x2717f2,function(_0x4517f0){if(_0x4517f0[_0x72b4('0x26')]!=='VIRTUAL'){var _0x57661f={};_0x57661f[_0x4517f0[_0x72b4('0x29')]]={'$like':'%'+_0x4dd0df[_0x72b4('0x2a')][_0x72b4('0x36')]+'%'};return _0x57661f;}})});}_0x2bf3ef=_[_0x72b4('0x37')]({},_0x2bf3ef,_0x4dd0df[_0x72b4('0x38')]);var _0x3373dd={'where':_0x2bf3ef['where']};return db[_0x72b4('0x24')][_0x72b4('0x39')](_0x3373dd)[_0x72b4('0x1c')](function(_0xe3696a){_0x282227['count']=_0xe3696a;if(_0x4dd0df[_0x72b4('0x2a')][_0x72b4('0x3a')]){_0x2bf3ef['include']=[{'all':!![]}];}return db[_0x72b4('0x24')][_0x72b4('0x3b')](_0x2bf3ef);})[_0x72b4('0x1c')](function(_0x3a4667){_0x282227[_0x72b4('0x3c')]=_0x3a4667;return _0x282227;})['then'](respondWithFilteredResult(_0x52c6e1,_0x2bf3ef))[_0x72b4('0x3d')](handleError(_0x52c6e1,null));};exports['show']=function(_0x4d1cb7,_0x451195){var _0x1f60ff={'raw':!![],'where':{'id':_0x4d1cb7['params']['id']}},_0x26a1e1={};_0x26a1e1[_0x72b4('0x28')]=_[_0x72b4('0x2b')](db['WhatsappTransferReport'][_0x72b4('0x3e')]);_0x26a1e1[_0x72b4('0x2a')]=_[_0x72b4('0x2b')](_0x4d1cb7[_0x72b4('0x2a')]);_0x26a1e1['filters']=_[_0x72b4('0x2c')](_0x26a1e1['model'],_0x26a1e1[_0x72b4('0x2a')]);_0x1f60ff[_0x72b4('0x2e')]=_[_0x72b4('0x2c')](_0x26a1e1[_0x72b4('0x28')],qs[_0x72b4('0x2d')](_0x4d1cb7[_0x72b4('0x2a')]['fields']));_0x1f60ff[_0x72b4('0x2e')]=_0x1f60ff['attributes']['length']?_0x1f60ff[_0x72b4('0x2e')]:_0x26a1e1[_0x72b4('0x28')];if(_0x4d1cb7['query'][_0x72b4('0x3a')]){_0x1f60ff[_0x72b4('0x3f')]=[{'all':!![]}];}_0x1f60ff=_[_0x72b4('0x37')]({},_0x1f60ff,_0x4d1cb7[_0x72b4('0x38')]);return db[_0x72b4('0x24')][_0x72b4('0x40')](_0x1f60ff)[_0x72b4('0x1c')](handleEntityNotFound(_0x451195,null))[_0x72b4('0x1c')](respondWithResult(_0x451195,null))[_0x72b4('0x3d')](handleError(_0x451195,null));};exports[_0x72b4('0x41')]=function(_0x39c0fa,_0x47a11c){return db[_0x72b4('0x24')][_0x72b4('0x41')](_0x39c0fa[_0x72b4('0x42')],{})['then'](respondWithResult(_0x47a11c,0xc9))[_0x72b4('0x3d')](handleError(_0x47a11c,null));};exports[_0x72b4('0x1b')]=function(_0x3f0d04,_0x5c2644){if(_0x3f0d04[_0x72b4('0x42')]['id']){delete _0x3f0d04[_0x72b4('0x42')]['id'];}return db['WhatsappTransferReport'][_0x72b4('0x40')]({'where':{'id':_0x3f0d04['params']['id']}})[_0x72b4('0x1c')](handleEntityNotFound(_0x5c2644,null))[_0x72b4('0x1c')](saveUpdates(_0x3f0d04[_0x72b4('0x42')],null))['then'](respondWithResult(_0x5c2644,null))[_0x72b4('0x3d')](handleError(_0x5c2644,null));};exports[_0x72b4('0x1d')]=function(_0x577d15,_0x4000e8){return db[_0x72b4('0x24')]['find']({'where':{'id':_0x577d15[_0x72b4('0x43')]['id']}})['then'](handleEntityNotFound(_0x4000e8,null))[_0x72b4('0x1c')](removeEntity(_0x4000e8,null))[_0x72b4('0x3d')](handleError(_0x4000e8,null));};exports[_0x72b4('0x44')]=function(_0x3b6bf5,_0x37901e){return db[_0x72b4('0x24')]['describe']()[_0x72b4('0x1c')](respondWithResult(_0x37901e,null))[_0x72b4('0x3d')](handleError(_0x37901e,null));}; \ No newline at end of file +var _0x6a21=['hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','create','body','update','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x491f78,_0x1c997e){var _0x47e9f9=function(_0x4cc893){while(--_0x4cc893){_0x491f78['push'](_0x491f78['shift']());}};_0x47e9f9(++_0x1c997e);}(_0x6a21,0xf9));var _0x16a2=function(_0x5d4cb3,_0x1f96e4){_0x5d4cb3=_0x5d4cb3-0x0;var _0x4f6671=_0x6a21[_0x5d4cb3];return _0x4f6671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16a2('0x0'));var zipdir=require(_0x16a2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16a2('0x2'));var moment=require(_0x16a2('0x3'));var BPromise=require(_0x16a2('0x4'));var Mustache=require(_0x16a2('0x5'));var util=require(_0x16a2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x16a2('0x7'));var ejs=require(_0x16a2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16a2('0x9'));var squel=require('squel');var crypto=require(_0x16a2('0xa'));var jsforce=require(_0x16a2('0xb'));var deskjs=require(_0x16a2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16a2('0xd'));var Redis=require(_0x16a2('0xe'));var authService=require(_0x16a2('0xf'));var qs=require(_0x16a2('0x10'));var as=require(_0x16a2('0x11'));var hardwareService=require(_0x16a2('0x12'));var logger=require(_0x16a2('0x13'))(_0x16a2('0x14'));var utils=require(_0x16a2('0x15'));var config=require(_0x16a2('0x16'));var licenseUtil=require(_0x16a2('0x17'));var db=require(_0x16a2('0x18'))['db'];function respondWithStatusCode(_0x2e8c66,_0x4f6329){_0x4f6329=_0x4f6329||0xcc;return function(_0x1cc48b){if(_0x1cc48b){return _0x2e8c66[_0x16a2('0x19')](_0x4f6329);}return _0x2e8c66['status'](_0x4f6329)[_0x16a2('0x1a')]();};}function respondWithResult(_0x5b48de,_0x55d140){_0x55d140=_0x55d140||0xc8;return function(_0xe51ec1){if(_0xe51ec1){return _0x5b48de['status'](_0x55d140)[_0x16a2('0x1b')](_0xe51ec1);}};}function respondWithFilteredResult(_0xced4d2,_0x1000f7){return function(_0x5da45e){if(_0x5da45e){var _0x186676=typeof _0x1000f7['offset']===_0x16a2('0x1c')&&typeof _0x1000f7[_0x16a2('0x1d')]===_0x16a2('0x1c');var _0x25595f=_0x5da45e[_0x16a2('0x1e')];var _0x2e63bd=_0x186676?0x0:_0x1000f7[_0x16a2('0x1f')];var _0x279a27=_0x186676?_0x5da45e[_0x16a2('0x1e')]:_0x1000f7['offset']+_0x1000f7['limit'];var _0x294324;if(_0x279a27>=_0x25595f){_0x279a27=_0x25595f;_0x294324=0xc8;}else{_0x294324=0xce;}_0xced4d2[_0x16a2('0x20')](_0x294324);return _0xced4d2[_0x16a2('0x21')](_0x16a2('0x22'),_0x2e63bd+'-'+_0x279a27+'/'+_0x25595f)['json'](_0x5da45e);}return null;};}function patchUpdates(_0x5868e5){return function(_0x149bfa){try{jsonpatch[_0x16a2('0x23')](_0x149bfa,_0x5868e5,!![]);}catch(_0xc24eeb){return BPromise[_0x16a2('0x24')](_0xc24eeb);}return _0x149bfa[_0x16a2('0x25')]();};}function saveUpdates(_0x5c1f43,_0xe05f98){return function(_0x5d184b){if(_0x5d184b){return _0x5d184b['update'](_0x5c1f43)[_0x16a2('0x26')](function(_0x1510f5){return _0x1510f5;});}return null;};}function removeEntity(_0x385af9,_0x3d133e){return function(_0x4e580a){if(_0x4e580a){return _0x4e580a[_0x16a2('0x27')]()[_0x16a2('0x26')](function(){_0x385af9[_0x16a2('0x20')](0xcc)[_0x16a2('0x1a')]();});}};}function handleEntityNotFound(_0x2e518d,_0xb3386d){return function(_0x13c790){if(!_0x13c790){_0x2e518d['sendStatus'](0x194);}return _0x13c790;};}function handleError(_0x3ba74a,_0x2b1d82){_0x2b1d82=_0x2b1d82||0x1f4;return function(_0x227299){logger[_0x16a2('0x28')](_0x227299[_0x16a2('0x29')]);if(_0x227299['name']){delete _0x227299[_0x16a2('0x2a')];}_0x3ba74a[_0x16a2('0x20')](_0x2b1d82)['send'](_0x227299);};}exports['index']=function(_0x22e5a5,_0x5dd25d){var _0x369dfb={},_0x4deb92={},_0x4f3ae2={'count':0x0,'rows':[]};var _0x29b38b=_[_0x16a2('0x2b')](db[_0x16a2('0x2c')][_0x16a2('0x2d')],function(_0x5f2531){return{'name':_0x5f2531[_0x16a2('0x2e')],'type':_0x5f2531['type'][_0x16a2('0x2f')]};});_0x4deb92[_0x16a2('0x30')]=_[_0x16a2('0x2b')](_0x29b38b,_0x16a2('0x2a'));_0x4deb92['query']=_['keys'](_0x22e5a5[_0x16a2('0x31')]);_0x4deb92[_0x16a2('0x32')]=_[_0x16a2('0x33')](_0x4deb92['model'],_0x4deb92['query']);_0x369dfb[_0x16a2('0x34')]=_[_0x16a2('0x33')](_0x4deb92[_0x16a2('0x30')],qs[_0x16a2('0x35')](_0x22e5a5['query'][_0x16a2('0x35')]));_0x369dfb[_0x16a2('0x34')]=_0x369dfb[_0x16a2('0x34')][_0x16a2('0x36')]?_0x369dfb[_0x16a2('0x34')]:_0x4deb92[_0x16a2('0x30')];if(!_0x22e5a5[_0x16a2('0x31')][_0x16a2('0x37')](_0x16a2('0x38'))){_0x369dfb['limit']=qs[_0x16a2('0x1d')](_0x22e5a5['query'][_0x16a2('0x1d')]);_0x369dfb[_0x16a2('0x1f')]=qs[_0x16a2('0x1f')](_0x22e5a5[_0x16a2('0x31')]['offset']);}_0x369dfb[_0x16a2('0x39')]=qs[_0x16a2('0x3a')](_0x22e5a5[_0x16a2('0x31')][_0x16a2('0x3a')]);_0x369dfb[_0x16a2('0x3b')]=qs[_0x16a2('0x32')](_['pick'](_0x22e5a5[_0x16a2('0x31')],_0x4deb92[_0x16a2('0x32')]),_0x29b38b);if(_0x22e5a5[_0x16a2('0x31')][_0x16a2('0x3c')]){_0x369dfb[_0x16a2('0x3b')]=_['merge'](_0x369dfb['where'],{'$or':_['map'](_0x29b38b,function(_0x89ec6a){if(_0x89ec6a['type']!==_0x16a2('0x3d')){var _0x2cb808={};_0x2cb808[_0x89ec6a[_0x16a2('0x2a')]]={'$like':'%'+_0x22e5a5[_0x16a2('0x31')]['filter']+'%'};return _0x2cb808;}})});}_0x369dfb=_['merge']({},_0x369dfb,_0x22e5a5['options']);var _0x57ce55={'where':_0x369dfb[_0x16a2('0x3b')]};return db[_0x16a2('0x2c')][_0x16a2('0x1e')](_0x57ce55)['then'](function(_0x117d20){_0x4f3ae2[_0x16a2('0x1e')]=_0x117d20;if(_0x22e5a5[_0x16a2('0x31')][_0x16a2('0x3e')]){_0x369dfb[_0x16a2('0x3f')]=[{'all':!![]}];}return db[_0x16a2('0x2c')][_0x16a2('0x40')](_0x369dfb);})[_0x16a2('0x26')](function(_0x11aa1c){_0x4f3ae2[_0x16a2('0x41')]=_0x11aa1c;return _0x4f3ae2;})[_0x16a2('0x26')](respondWithFilteredResult(_0x5dd25d,_0x369dfb))[_0x16a2('0x42')](handleError(_0x5dd25d,null));};exports[_0x16a2('0x43')]=function(_0x578638,_0x35e5d5){var _0x1483d4={'raw':!![],'where':{'id':_0x578638[_0x16a2('0x44')]['id']}},_0xa5e021={};_0xa5e021[_0x16a2('0x30')]=_[_0x16a2('0x45')](db[_0x16a2('0x2c')][_0x16a2('0x2d')]);_0xa5e021[_0x16a2('0x31')]=_[_0x16a2('0x45')](_0x578638[_0x16a2('0x31')]);_0xa5e021[_0x16a2('0x32')]=_[_0x16a2('0x33')](_0xa5e021[_0x16a2('0x30')],_0xa5e021[_0x16a2('0x31')]);_0x1483d4[_0x16a2('0x34')]=_[_0x16a2('0x33')](_0xa5e021[_0x16a2('0x30')],qs[_0x16a2('0x35')](_0x578638['query']['fields']));_0x1483d4[_0x16a2('0x34')]=_0x1483d4[_0x16a2('0x34')][_0x16a2('0x36')]?_0x1483d4[_0x16a2('0x34')]:_0xa5e021[_0x16a2('0x30')];if(_0x578638[_0x16a2('0x31')][_0x16a2('0x3e')]){_0x1483d4[_0x16a2('0x3f')]=[{'all':!![]}];}_0x1483d4=_[_0x16a2('0x46')]({},_0x1483d4,_0x578638['options']);return db['WhatsappTransferReport']['find'](_0x1483d4)[_0x16a2('0x26')](handleEntityNotFound(_0x35e5d5,null))[_0x16a2('0x26')](respondWithResult(_0x35e5d5,null))[_0x16a2('0x42')](handleError(_0x35e5d5,null));};exports[_0x16a2('0x47')]=function(_0x3278d7,_0x51b248){return db[_0x16a2('0x2c')]['create'](_0x3278d7[_0x16a2('0x48')],{})[_0x16a2('0x26')](respondWithResult(_0x51b248,0xc9))[_0x16a2('0x42')](handleError(_0x51b248,null));};exports[_0x16a2('0x49')]=function(_0x1b2bf7,_0x29e9c1){if(_0x1b2bf7[_0x16a2('0x48')]['id']){delete _0x1b2bf7[_0x16a2('0x48')]['id'];}return db['WhatsappTransferReport'][_0x16a2('0x4a')]({'where':{'id':_0x1b2bf7[_0x16a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x29e9c1,null))[_0x16a2('0x26')](saveUpdates(_0x1b2bf7[_0x16a2('0x48')],null))[_0x16a2('0x26')](respondWithResult(_0x29e9c1,null))[_0x16a2('0x42')](handleError(_0x29e9c1,null));};exports[_0x16a2('0x27')]=function(_0x5343a0,_0x1ce441){return db[_0x16a2('0x2c')]['find']({'where':{'id':_0x5343a0[_0x16a2('0x44')]['id']}})[_0x16a2('0x26')](handleEntityNotFound(_0x1ce441,null))['then'](removeEntity(_0x1ce441,null))[_0x16a2('0x42')](handleError(_0x1ce441,null));};exports[_0x16a2('0x4b')]=function(_0x31528c,_0x2a538f){return db[_0x16a2('0x2c')]['describe']()['then'](respondWithResult(_0x2a538f,null))[_0x16a2('0x42')](handleError(_0x2a538f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2c6a082..96490cf 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 _0xa549=['request-promise','path','rimraf','../../config/environment','define','WhatsappTransferReport','uniqueid','lodash','api','moment'];(function(_0x29aae6,_0x889579){var _0x41927b=function(_0xc00729){while(--_0xc00729){_0x29aae6['push'](_0x29aae6['shift']());}};_0x41927b(++_0x889579);}(_0xa549,0xcf));var _0x9a54=function(_0xab0a07,_0x408700){_0xab0a07=_0xab0a07-0x0;var _0x4a9207=_0xa549[_0xab0a07];return _0x4a9207;};'use strict';var _=require(_0x9a54('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a54('0x1'));var moment=require(_0x9a54('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a54('0x3'));var fs=require('fs');var path=require(_0x9a54('0x4'));var rimraf=require(_0x9a54('0x5'));var config=require(_0x9a54('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x3c9629,_0x416498){return _0x3c9629[_0x9a54('0x7')](_0x9a54('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9a54('0x9'),'fields':[_0x9a54('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x505a=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport'];(function(_0x3ab596,_0x219a15){var _0x345992=function(_0x24164a){while(--_0x24164a){_0x3ab596['push'](_0x3ab596['shift']());}};_0x345992(++_0x219a15);}(_0x505a,0xa7));var _0xa505=function(_0x4a4e66,_0x168cad){_0x4a4e66=_0x4a4e66-0x0;var _0x1aff21=_0x505a[_0x4a4e66];return _0x1aff21;};'use strict';var _=require(_0xa505('0x0'));var util=require(_0xa505('0x1'));var logger=require(_0xa505('0x2'))(_0xa505('0x3'));var moment=require(_0xa505('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa505('0x5'));var attributes=require(_0xa505('0x6'));module['exports']=function(_0x67a0d4,_0x591bc0){return _0x67a0d4[_0xa505('0x7')](_0xa505('0x8'),attributes,{'tableName':_0xa505('0x9'),'paranoid':![],'indexes':[{'name':_0xa505('0xa'),'fields':[_0xa505('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 ea76333..98d9e4f 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 _0xac14=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2edced,_0x33ef3e){var _0x43db7d=function(_0x18b323){while(--_0x18b323){_0x2edced['push'](_0x2edced['shift']());}};_0x43db7d(++_0x33ef3e);}(_0xac14,0x173));var _0x4ac1=function(_0x24618e,_0x2cba8a){_0x24618e=_0x24618e-0x0;var _0xc4ec6d=_0xac14[_0x24618e];return _0xc4ec6d;};'use strict';var _=require(_0x4ac1('0x0'));var util=require(_0x4ac1('0x1'));var moment=require(_0x4ac1('0x2'));var BPromise=require(_0x4ac1('0x3'));var rs=require(_0x4ac1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ac1('0x5'))['db'];var utils=require(_0x4ac1('0x6'));var logger=require('../../config/logger')(_0x4ac1('0x7'));var config=require(_0x4ac1('0x8'));var jayson=require(_0x4ac1('0x9'));var client=jayson[_0x4ac1('0xa')][_0x4ac1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48acc6,_0x185738,_0x7d43f0){return new BPromise(function(_0x3dd9d,_0x4eb61f){return client[_0x4ac1('0xc')](_0x48acc6,_0x7d43f0)[_0x4ac1('0xd')](function(_0x3fa5fe){logger['info'](_0x4ac1('0xe'),_0x185738,'request\x20sent');logger[_0x4ac1('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x185738,_0x4ac1('0x10'),JSON[_0x4ac1('0x11')](_0x3fa5fe));if(_0x3fa5fe[_0x4ac1('0x12')]){if(_0x3fa5fe['error'][_0x4ac1('0x13')]===0x1f4){logger[_0x4ac1('0x12')](_0x4ac1('0xe'),_0x185738,_0x3fa5fe['error'][_0x4ac1('0x14')]);return _0x4eb61f(_0x3fa5fe[_0x4ac1('0x12')][_0x4ac1('0x14')]);}logger['error'](_0x4ac1('0xe'),_0x185738,_0x3fa5fe[_0x4ac1('0x12')][_0x4ac1('0x14')]);return _0x3dd9d(_0x3fa5fe[_0x4ac1('0x12')]['message']);}else{logger['info'](_0x4ac1('0xe'),_0x185738,_0x4ac1('0x10'));_0x3dd9d(_0x3fa5fe['result']['message']);}})[_0x4ac1('0x15')](function(_0x5ea092){logger['error'](_0x4ac1('0xe'),_0x185738,_0x5ea092);_0x4eb61f(_0x5ea092);});});} \ No newline at end of file +var _0xb775=['../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x268b81,_0x47eb02){var _0x52e55b=function(_0x505bf1){while(--_0x505bf1){_0x268b81['push'](_0x268b81['shift']());}};_0x52e55b(++_0x47eb02);}(_0xb775,0x123));var _0x5b77=function(_0x4efb92,_0x45dc5e){_0x4efb92=_0x4efb92-0x0;var _0xb5123=_0xb775[_0x4efb92];return _0xb5123;};'use strict';var _=require(_0x5b77('0x0'));var util=require(_0x5b77('0x1'));var moment=require('moment');var BPromise=require(_0x5b77('0x2'));var rs=require(_0x5b77('0x3'));var fs=require('fs');var Redis=require(_0x5b77('0x4'));var db=require(_0x5b77('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b77('0x6'))(_0x5b77('0x7'));var config=require(_0x5b77('0x8'));var jayson=require(_0x5b77('0x9'));var client=jayson[_0x5b77('0xa')][_0x5b77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19d12f,_0x1de823,_0x44cba7){return new BPromise(function(_0x3f35de,_0x1d118e){return client[_0x5b77('0xc')](_0x19d12f,_0x44cba7)[_0x5b77('0xd')](function(_0x3dd1ed){logger['info'](_0x5b77('0xe'),_0x1de823,_0x5b77('0xf'));logger[_0x5b77('0x10')](_0x5b77('0x11'),_0x1de823,_0x5b77('0xf'),JSON['stringify'](_0x3dd1ed));if(_0x3dd1ed[_0x5b77('0x12')]){if(_0x3dd1ed[_0x5b77('0x12')][_0x5b77('0x13')]===0x1f4){logger[_0x5b77('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1de823,_0x3dd1ed[_0x5b77('0x12')][_0x5b77('0x14')]);return _0x1d118e(_0x3dd1ed[_0x5b77('0x12')][_0x5b77('0x14')]);}logger[_0x5b77('0x12')](_0x5b77('0xe'),_0x1de823,_0x3dd1ed[_0x5b77('0x12')][_0x5b77('0x14')]);return _0x3f35de(_0x3dd1ed[_0x5b77('0x12')]['message']);}else{logger[_0x5b77('0x15')](_0x5b77('0xe'),_0x1de823,_0x5b77('0xf'));_0x3f35de(_0x3dd1ed[_0x5b77('0x16')][_0x5b77('0x14')]);}})['catch'](function(_0x158a18){logger[_0x5b77('0x12')](_0x5b77('0xe'),_0x1de823,_0x158a18);_0x1d118e(_0x158a18);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index b6a43c3..ac37dfd 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e0c=['filter','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','seedDB','default','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:'];(function(_0x3863eb,_0x4bbb2d){var _0x7bb9f8=function(_0x1358aa){while(--_0x1358aa){_0x3863eb['push'](_0x3863eb['shift']());}};_0x7bb9f8(++_0x4bbb2d);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x18c530,_0x1ef42a){_0x18c530=_0x18c530-0x0;var _0x560b6d=_0x5e0c[_0x18c530];return _0x560b6d;};'use strict';var _=require('lodash');var db=require(_0xc5e0('0x0'))['db'];var seedDb=require(_0xc5e0('0x1'));var checkLicense=require(_0xc5e0('0x2'));var rpc=require(_0xc5e0('0x3'));var config=require(_0xc5e0('0x4'));var logger=require(_0xc5e0('0x5'))('app');var pm2=require(_0xc5e0('0x6'));var pm2Config=require(_0xc5e0('0x7'));var schedule=require(_0xc5e0('0x8'));var chat=require(_0xc5e0('0x9'));var whatsapp=require(_0xc5e0('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xc5e0('0xb')]['sync']()[_0xc5e0('0xc')](function(){if(config[_0xc5e0('0xd')]){return seedDb[_0xc5e0('0xe')]();}})[_0xc5e0('0xc')](function(){return checkLicense['default']();})[_0xc5e0('0xc')](function(){return rpc['listen']();})[_0xc5e0('0xc')](function(_0x33d821){logger[_0xc5e0('0xf')](_0x33d821);return chat[_0xc5e0('0x10')]();})[_0xc5e0('0xc')](function(){return whatsapp[_0xc5e0('0x10')]();})['then'](function(){return schedule[_0xc5e0('0x10')]();})[_0xc5e0('0xc')](function(){return transcribe[_0xc5e0('0x10')]();})[_0xc5e0('0xc')](function(){return provider[_0xc5e0('0x10')]();})['then'](function(_0x3d0503){logger[_0xc5e0('0xf')](_0x3d0503);return pm2['start'](pm2Config);})['then'](function(_0x2fa026){var _0x481453=_0x2fa026['filter'](function(_0xcf0eba){return typeof _0xcf0eba[_0xc5e0('0x11')]===_0xc5e0('0x12')&&_0xcf0eba[_0xc5e0('0x11')]>=0x0;});if(_0x481453[_0xc5e0('0x13')]>0x0){throw new Error(_0x481453[_0xc5e0('0x13')]+_0xc5e0('0x14')+_[_0xc5e0('0x15')](_0x481453,function(_0x21bb3e){return'\x22'+_0x21bb3e[_0xc5e0('0x16')][_0xc5e0('0x17')]+'\x22';}));}logger[_0xc5e0('0xf')](_0xc5e0('0x18'),_[_0xc5e0('0x15')](_['filter'](_0x2fa026,{'status':'online'}),_0xc5e0('0x17'))[_0xc5e0('0x19')]());logger[_0xc5e0('0xf')](_0xc5e0('0x1a'),_[_0xc5e0('0x15')](_[_0xc5e0('0x1b')](_0x2fa026,function(_0x4a07e8){return _0x4a07e8['status']!=='online';}),_0xc5e0('0x17'))['join']()||_0xc5e0('0x1c'));console[_0xc5e0('0x1d')](_0xc5e0('0x1e'));})[_0xc5e0('0x1f')](function(_0x3edaea){console[_0xc5e0('0x1d')](_0xc5e0('0x20'),_0x3edaea);logger['error'](_0xc5e0('0x21'),_0x3edaea);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xedf2=['info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','App\x20Ready!','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','sync','seedDB','then','default','listen'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xedf2,0x1ac));var _0x2edf=function(_0x12cc74,_0x49630c){_0x12cc74=_0x12cc74-0x0;var _0x50e61c=_0xedf2[_0x12cc74];return _0x50e61c;};'use strict';var _=require('lodash');var db=require(_0x2edf('0x0'))['db'];var seedDb=require(_0x2edf('0x1'));var checkLicense=require(_0x2edf('0x2'));var rpc=require('./rpc');var config=require(_0x2edf('0x3'));var logger=require(_0x2edf('0x4'))('app');var pm2=require(_0x2edf('0x5'));var pm2Config=require(_0x2edf('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x2edf('0x7'));var transcribe=require(_0x2edf('0x8'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0x2edf('0x9')]()['then'](function(){if(config[_0x2edf('0xa')]){return seedDb['default']();}})[_0x2edf('0xb')](function(){return checkLicense[_0x2edf('0xc')]();})[_0x2edf('0xb')](function(){return rpc[_0x2edf('0xd')]();})[_0x2edf('0xb')](function(_0x331950){logger[_0x2edf('0xe')](_0x331950);return chat[_0x2edf('0xf')]();})[_0x2edf('0xb')](function(){return whatsapp['start']();})[_0x2edf('0xb')](function(){return schedule[_0x2edf('0xf')]();})[_0x2edf('0xb')](function(){return transcribe[_0x2edf('0xf')]();})[_0x2edf('0xb')](function(){return provider[_0x2edf('0xf')]();})['then'](function(_0x6d1afa){logger[_0x2edf('0xe')](_0x6d1afa);return pm2[_0x2edf('0xf')](pm2Config);})[_0x2edf('0xb')](function(_0x5b5482){var _0x81a620=_0x5b5482[_0x2edf('0x10')](function(_0x39087e){return typeof _0x39087e[_0x2edf('0x11')]===_0x2edf('0x12')&&_0x39087e[_0x2edf('0x11')]>=0x0;});if(_0x81a620['length']>0x0){throw new Error(_0x81a620[_0x2edf('0x13')]+_0x2edf('0x14')+_[_0x2edf('0x15')](_0x81a620,function(_0x589cc2){return'\x22'+_0x589cc2[_0x2edf('0x16')]['name']+'\x22';}));}logger[_0x2edf('0xe')](_0x2edf('0x17'),_[_0x2edf('0x15')](_[_0x2edf('0x10')](_0x5b5482,{'status':_0x2edf('0x18')}),_0x2edf('0x19'))[_0x2edf('0x1a')]());logger[_0x2edf('0xe')](_0x2edf('0x1b'),_[_0x2edf('0x15')](_['filter'](_0x5b5482,function(_0x3c0fb8){return _0x3c0fb8[_0x2edf('0x1c')]!==_0x2edf('0x18');}),_0x2edf('0x19'))['join']()||'None');console['log'](_0x2edf('0x1d'));})['catch'](function(_0x5ec217){console[_0x2edf('0x1e')](_0x2edf('0x1f'),_0x5ec217);logger[_0x2edf('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5ec217);process[_0x2edf('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index fdb474d..e65375a 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 _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x57a09b,_0x3acbdc){var _0x4c5dc3=function(_0x373650){while(--_0x373650){_0x57a09b['push'](_0x57a09b['shift']());}};_0x4c5dc3(++_0x3acbdc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1a422a,_0x3468fd){_0x1a422a=_0x1a422a-0x0;var _0x4dcab4=_0xf3cd[_0x1a422a];return _0x4dcab4;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file +var _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x314709,_0x43e7f9){_0x314709=_0x314709-0x0;var _0x35ec79=_0x9bde[_0x314709];return _0x35ec79;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 23a60d6..a5dddca 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 _0xf7c3=['secret','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','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher','data','update','binary','end','close','unlink','createDecipher','write','encryptString','utf8','base64','final'];(function(_0x3cb155,_0x5bb43d){var _0x1ccb0c=function(_0x42ec57){while(--_0x42ec57){_0x3cb155['push'](_0x3cb155['shift']());}};_0x1ccb0c(++_0x5bb43d);}(_0xf7c3,0xcd));var _0x3f7c=function(_0x22161f,_0x3d6032){_0x22161f=_0x22161f-0x0;var _0x499f65=_0xf7c3[_0x22161f];return _0x499f65;};'use strict';var crypto=require(_0x3f7c('0x0'));var fs=require('fs');var BPromise=require(_0x3f7c('0x1'));var _=require(_0x3f7c('0x2'));var config=require(_0x3f7c('0x3'));var logger=require(_0x3f7c('0x4'))(_0x3f7c('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x3f7c('0x6')],'algorithm':_0x3f7c('0x7')};const fileOptions={'algorithm':_0x3f7c('0x8')};if(config['encrypt']&&config[_0x3f7c('0x9')][_0x3f7c('0xa')]){var isSupported=isAlgorithmSupported(config[_0x3f7c('0x9')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x3f7c('0x9')][_0x3f7c('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3f7c('0xb')](',\x20');logger[_0x3f7c('0xc')](config['encrypt'][_0x3f7c('0xa')],_0x3f7c('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x51f26b){return AES_SUPPORTED_RX[_0x3f7c('0xe')](_0x51f26b);}function getSupportedCiphers(){return crypto[_0x3f7c('0xf')]()[_0x3f7c('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x12cf64){return getSupportedCiphers()[_0x3f7c('0x11')](_0x12cf64)>-0x1;}function combineOptions(_0x2bd1e5){var _0x3c65e7={};for(var _0x2baa61 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2baa61)){_0x3c65e7[_0x2baa61]=fileOptions[_0x2baa61];}}if(_0x2bd1e5){for(var _0x484ae3 in _0x2bd1e5){if(_0x2bd1e5[_0x3f7c('0x12')](_0x484ae3)){_0x3c65e7[_0x484ae3]=_0x2bd1e5[_0x484ae3];}}}return _0x3c65e7;}exports[_0x3f7c('0x13')]=function(_0x53ae06,_0x2967d0,_0x286731,_0xd5869f){return new BPromise(function(_0x3fbad5,_0x1dd1f2){_0xd5869f=combineOptions(_0xd5869f);var _0x429e0d=new Buffer(_0x286731);var _0x2d8e7d=fs['createReadStream'](_0x53ae06);var _0x24ac46=fs['createWriteStream'](_0x2967d0);var _0x31fe20=crypto[_0x3f7c('0x14')](_0xd5869f[_0x3f7c('0xa')],_0x429e0d);_0x2d8e7d['on'](_0x3f7c('0x15'),function(_0x42608f){var _0x442a73=new Buffer(_0x31fe20[_0x3f7c('0x16')](_0x42608f),_0x3f7c('0x17'));_0x24ac46['write'](_0x442a73);});_0x2d8e7d['on'](_0x3f7c('0x18'),function(){try{var _0x46589c=new Buffer(_0x31fe20['final'](_0x3f7c('0x17')),'binary');_0x24ac46['write'](_0x46589c);_0x24ac46[_0x3f7c('0x18')]();_0x24ac46['on'](_0x3f7c('0x19'),function(){return _0x3fbad5(_0x2967d0);});}catch(_0x425675){fs[_0x3f7c('0x1a')](_0x2967d0);return _0x1dd1f2(_0x425675);}});});};exports['decryptFile']=function(_0xb114ad,_0x74f0b2,_0xa3c908,_0x10ad99){return new BPromise(function(_0x3cd565,_0x3e1863){_0x10ad99=combineOptions(_0x10ad99);var _0x1df0ac=new Buffer(_0xa3c908);var _0x414faa=fs['createReadStream'](_0xb114ad);var _0x1ede04=fs['createWriteStream'](_0x74f0b2);var _0x2c1a64=crypto[_0x3f7c('0x1b')](_0x10ad99[_0x3f7c('0xa')],_0x1df0ac);_0x414faa['on'](_0x3f7c('0x15'),function(_0x5b0335){var _0x26d10d=new Buffer(_0x2c1a64[_0x3f7c('0x16')](_0x5b0335),_0x3f7c('0x17'));_0x1ede04[_0x3f7c('0x1c')](_0x26d10d);});_0x414faa['on'](_0x3f7c('0x18'),function(){try{var _0x216cfb=new Buffer(_0x2c1a64['final'](_0x3f7c('0x17')),'binary');_0x1ede04[_0x3f7c('0x1c')](_0x216cfb);_0x1ede04['end']();_0x1ede04['on'](_0x3f7c('0x19'),function(){return _0x3cd565(_0x74f0b2);});}catch(_0x5628ed){fs[_0x3f7c('0x1a')](_0x74f0b2);return _0x3e1863(_0x5628ed);}});});};exports[_0x3f7c('0x1d')]=function(_0x592133,_0x69ae6f,_0x8bb2a5){var _0xb2411e=_0x8bb2a5||stringOptions[_0x3f7c('0xa')];var _0x577e15=_0x69ae6f||stringOptions['secret'];var _0x58c7ff=crypto['createCipher'](_0xb2411e,_0x577e15);var _0x5851f2=_0x58c7ff[_0x3f7c('0x16')](_0x592133,_0x3f7c('0x1e'),_0x3f7c('0x1f'));_0x5851f2+=_0x58c7ff[_0x3f7c('0x20')](_0x3f7c('0x1f'));return _0x5851f2;};exports['decryptString']=function(_0x4a4a89,_0x50ad9c,_0x17c29b){var _0x4ab5cb=_0x17c29b||stringOptions['algorithm'];var _0x671c2=_0x50ad9c||stringOptions[_0x3f7c('0x21')];var _0x2d07fb=crypto['createDecipher'](_0x4ab5cb,_0x671c2);var _0xdf8910=_0x2d07fb[_0x3f7c('0x16')](_0x4a4a89,_0x3f7c('0x1f'),_0x3f7c('0x1e'));_0xdf8910+=_0x2d07fb[_0x3f7c('0x20')](_0x3f7c('0x1e'));return _0xdf8910;}; \ No newline at end of file +var _0x70fd=['aes192','encrypt','algorithm','join','test','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','createReadStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr'];(function(_0xb92f92,_0x18c8eb){var _0x49f416=function(_0x4f9c19){while(--_0x4f9c19){_0xb92f92['push'](_0xb92f92['shift']());}};_0x49f416(++_0x18c8eb);}(_0x70fd,0x118));var _0xd70f=function(_0x3cae30,_0x5d8b99){_0x3cae30=_0x3cae30-0x0;var _0x263f77=_0x70fd[_0x3cae30];return _0x263f77;};'use strict';var crypto=require(_0xd70f('0x0'));var fs=require('fs');var BPromise=require(_0xd70f('0x1'));var _=require(_0xd70f('0x2'));var config=require('../../config/environment');var logger=require(_0xd70f('0x3'))(_0xd70f('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xd70f('0x5')][_0xd70f('0x6')],'algorithm':_0xd70f('0x7')};const fileOptions={'algorithm':_0xd70f('0x8')};if(config[_0xd70f('0x9')]&&config[_0xd70f('0x9')][_0xd70f('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xd70f('0xa')]);if(isSupported){fileOptions[_0xd70f('0xa')]=config[_0xd70f('0x9')][_0xd70f('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd70f('0xb')](',\x20');logger['error'](config[_0xd70f('0x9')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x38d962){return AES_SUPPORTED_RX[_0xd70f('0xc')](_0x38d962);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xd70f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3214f8){return getSupportedCiphers()['indexOf'](_0x3214f8)>-0x1;}function combineOptions(_0x495c29){var _0x54bf3d={};for(var _0x11dc6c in fileOptions){if(fileOptions[_0xd70f('0xe')](_0x11dc6c)){_0x54bf3d[_0x11dc6c]=fileOptions[_0x11dc6c];}}if(_0x495c29){for(var _0x51bf43 in _0x495c29){if(_0x495c29[_0xd70f('0xe')](_0x51bf43)){_0x54bf3d[_0x51bf43]=_0x495c29[_0x51bf43];}}}return _0x54bf3d;}exports[_0xd70f('0xf')]=function(_0x2a2e52,_0x1390ad,_0x4a5142,_0x5cd95a){return new BPromise(function(_0x44b989,_0x38d00d){_0x5cd95a=combineOptions(_0x5cd95a);var _0x23d30e=new Buffer(_0x4a5142);var _0x4ce4a0=fs['createReadStream'](_0x2a2e52);var _0x4afa01=fs[_0xd70f('0x10')](_0x1390ad);var _0x439fc3=crypto[_0xd70f('0x11')](_0x5cd95a[_0xd70f('0xa')],_0x23d30e);_0x4ce4a0['on'](_0xd70f('0x12'),function(_0x1eae2c){var _0x4236c0=new Buffer(_0x439fc3[_0xd70f('0x13')](_0x1eae2c),_0xd70f('0x14'));_0x4afa01[_0xd70f('0x15')](_0x4236c0);});_0x4ce4a0['on'](_0xd70f('0x16'),function(){try{var _0xdde842=new Buffer(_0x439fc3[_0xd70f('0x17')](_0xd70f('0x14')),_0xd70f('0x14'));_0x4afa01[_0xd70f('0x15')](_0xdde842);_0x4afa01['end']();_0x4afa01['on'](_0xd70f('0x18'),function(){return _0x44b989(_0x1390ad);});}catch(_0xd38b85){fs['unlink'](_0x1390ad);return _0x38d00d(_0xd38b85);}});});};exports['decryptFile']=function(_0xb17fcf,_0x597000,_0x4083ce,_0x1e0842){return new BPromise(function(_0x597f4c,_0x548a77){_0x1e0842=combineOptions(_0x1e0842);var _0x180463=new Buffer(_0x4083ce);var _0x3d636b=fs[_0xd70f('0x19')](_0xb17fcf);var _0x5ed477=fs[_0xd70f('0x10')](_0x597000);var _0x932126=crypto[_0xd70f('0x1a')](_0x1e0842[_0xd70f('0xa')],_0x180463);_0x3d636b['on'](_0xd70f('0x12'),function(_0x3bdb9e){var _0x4e0de0=new Buffer(_0x932126['update'](_0x3bdb9e),_0xd70f('0x14'));_0x5ed477[_0xd70f('0x15')](_0x4e0de0);});_0x3d636b['on'](_0xd70f('0x16'),function(){try{var _0x10ad7f=new Buffer(_0x932126[_0xd70f('0x17')](_0xd70f('0x14')),_0xd70f('0x14'));_0x5ed477['write'](_0x10ad7f);_0x5ed477[_0xd70f('0x16')]();_0x5ed477['on'](_0xd70f('0x18'),function(){return _0x597f4c(_0x597000);});}catch(_0x4b3814){fs['unlink'](_0x597000);return _0x548a77(_0x4b3814);}});});};exports[_0xd70f('0x1b')]=function(_0xb42f66,_0x56afa9,_0xfd19dc){var _0x38ac78=_0xfd19dc||stringOptions[_0xd70f('0xa')];var _0x25c18b=_0x56afa9||stringOptions[_0xd70f('0x1c')];var _0x59fea7=crypto[_0xd70f('0x11')](_0x38ac78,_0x25c18b);var _0x391ec4=_0x59fea7[_0xd70f('0x13')](_0xb42f66,_0xd70f('0x1d'),_0xd70f('0x1e'));_0x391ec4+=_0x59fea7[_0xd70f('0x17')](_0xd70f('0x1e'));return _0x391ec4;};exports[_0xd70f('0x1f')]=function(_0x207a92,_0x3c4df5,_0x59e7ac){var _0x52fd78=_0x59e7ac||stringOptions[_0xd70f('0xa')];var _0x39d1ed=_0x3c4df5||stringOptions[_0xd70f('0x1c')];var _0x46230c=crypto['createDecipher'](_0x52fd78,_0x39d1ed);var _0x2dfdcb=_0x46230c[_0xd70f('0x13')](_0x207a92,_0xd70f('0x1e'),_0xd70f('0x1d'));_0x2dfdcb+=_0x46230c[_0xd70f('0x17')]('utf8');return _0x2dfdcb;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index ac64d21..4db24b2 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 _0x40c3=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','push','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','finally','exit','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize'];(function(_0x1b4395,_0x427c86){var _0x25b235=function(_0x99c1b4){while(--_0x99c1b4){_0x1b4395['push'](_0x1b4395['shift']());}};_0x25b235(++_0x427c86);}(_0x40c3,0x6f));var _0x340c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x40c3[_0x126558];return _0x1f6d14;};'use strict';var util=require('util');var path=require('path');var _=require(_0x340c('0x0'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x340c('0x1'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x340c('0x2'))['db'];var dbH=require(_0x340c('0x2'))[_0x340c('0x3')];var logger=require(_0x340c('0x4'))(_0x340c('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x340c('0x6')][0x3];var PATH=process[_0x340c('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x47eb27,_0x1dcef3){var _0x2dd895={'status':_0x47eb27};var _0xcf182d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1dcef3){_0x2dd895['savename']=_0x1dcef3;}return db[_0x340c('0x7')]['update'](_0x2dd895,_0xcf182d);}function main(){var _0x3d7a44=0x1388;var _0x5eccdb;logger[_0x340c('0x8')](util[_0x340c('0x9')](_0x340c('0xa'),EXTRACTED_REPORT_ID,_0x340c('0xb')));return db[_0x340c('0xc')][_0x340c('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x340c('0xe'),'splitSizeCsv']})[_0x340c('0xf')](function(_0x507de4){if(_0x507de4){_0x5eccdb=_0x507de4;_0x3d7a44=_0x5eccdb[_0x340c('0x10')]||0x1388;}})[_0x340c('0xf')](function(){return dbH[_0x340c('0x11')][_0x340c('0x12')](util[_0x340c('0x9')](_0x340c('0x13'),QUERY),{'type':dbH[_0x340c('0x11')][_0x340c('0x14')][_0x340c('0x15')]});})[_0x340c('0xf')](function(_0x3f71c0){if(!_0x3f71c0[0x0][_0x340c('0x16')]){return analyticExtractedReport(_0x340c('0x17'));}var _0x3a09f6=[];var _0x28673d=0x0;if(_0x5eccdb['split']){if(_0x3f71c0&&_0x3f71c0[_0x340c('0x18')]){var _0x220ce2=_[_0x340c('0x19')](_0x3f71c0[0x0][_0x340c('0x16')]/_0x3d7a44);var _0x44095e=Number[_0x340c('0x1a')](_0x3f71c0[0x0][_0x340c('0x16')]/_0x3d7a44)?_0x3f71c0[0x0][_0x340c('0x16')]%_0x3d7a44:0x0;_0x220ce2[_0x340c('0x1b')](function(_0x5c3e9a){if(_0x5c3e9a>0x0){_0x28673d+=_0x3d7a44;}_0x3a09f6['push'](dbH['sequelize'][_0x340c('0x12')](util[_0x340c('0x9')](_0x340c('0x1c'),QUERY,_0x3d7a44,_0x28673d),{'type':dbH[_0x340c('0x11')]['QueryTypes'][_0x340c('0x15')]}));});if(_0x44095e>0x0){_0x28673d+=_0x3d7a44;_0x3a09f6['push'](dbH[_0x340c('0x11')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x44095e,_0x28673d),{'type':dbH[_0x340c('0x11')][_0x340c('0x14')][_0x340c('0x15')]}));}}}else{_0x3a09f6['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x340c('0x11')][_0x340c('0x14')][_0x340c('0x15')]}));}var _0x1cbbbe=path[_0x340c('0x1d')](PATH);var _0x3581cd=path['basename'](PATH,_0x340c('0x1e'));var _0x6d6892=_0x5eccdb[_0x340c('0xe')]&&_0x3a09f6[_0x340c('0x18')]>0x1;var _0x3a229a=[];if(!fs[_0x340c('0x1f')](path[_0x340c('0x20')](_0x1cbbbe,_0x3581cd))&&_0x6d6892){fs['mkdirSync'](path[_0x340c('0x20')](_0x1cbbbe,_0x3581cd));}return BPromise['each'](_0x3a09f6,function(_0xf43ed6){_0x3a229a[_0x340c('0x21')](_0xf43ed6);})['then'](function(){for(var _0x3b4a83=0x0;_0x3b4a83<_0x3a229a[_0x340c('0x18')];_0x3b4a83+=0x1){var _0x5ec615;var _0x130706=_0x3a229a[_0x3b4a83];if(_0x6d6892){_0x5ec615=path[_0x340c('0x20')](_0x1cbbbe,_0x3581cd,util['format'](_0x340c('0x22'),_0x3581cd,_0x3b4a83,_0x340c('0x23')));}else{_0x5ec615=path[_0x340c('0x20')](_0x1cbbbe,util[_0x340c('0x9')](_0x340c('0x24'),_0x3581cd,_0x340c('0x23')));}fs[_0x340c('0x25')](_0x5ec615,csv(_0x130706));}})[_0x340c('0xf')](function(){if(_0x6d6892){return new Promise(function(_0x41a4cd){zipdir(path['join'](_0x1cbbbe,_0x3581cd),{'saveTo':path[_0x340c('0x20')](_0x1cbbbe,util[_0x340c('0x9')]('%s.%s',_0x3581cd,'zip'))},function(_0x5c2c9a,_0xcfe277){rimraf(path[_0x340c('0x20')](_0x1cbbbe,_0x3581cd),function(){});_0x41a4cd('zip\x20finished');});});}})[_0x340c('0xf')](function(){logger[_0x340c('0x8')](util[_0x340c('0x9')](_0x340c('0x26'),EXTRACTED_REPORT_ID,_0x340c('0xb')));return analyticExtractedReport(_0x340c('0x27'),_0x6d6892?util[_0x340c('0x9')](_0x340c('0x24'),_0x3581cd,_0x6d6892?'zip':_0x340c('0x23')):null);});})[_0x340c('0x28')](function(_0xe4b0b3){logger[_0x340c('0x8')](util[_0x340c('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0xe4b0b3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x340c('0x29')](function(){process[_0x340c('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xf7c5=['to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash'];(function(_0x208129,_0x606be0){var _0x9b3cb=function(_0x5923c2){while(--_0x5923c2){_0x208129['push'](_0x208129['shift']());}};_0x9b3cb(++_0x606be0);}(_0xf7c5,0x129));var _0x5f7c=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xf7c5[_0x4a9beb];return _0x2d4c58;};'use strict';var util=require(_0x5f7c('0x0'));var path=require(_0x5f7c('0x1'));var _=require(_0x5f7c('0x2'));var csv=require(_0x5f7c('0x3'));var fs=require('fs');var BPromise=require(_0x5f7c('0x4'));var zipdir=require(_0x5f7c('0x5'));var rimraf=require(_0x5f7c('0x6'));var db=require(_0x5f7c('0x7'))['db'];var dbH=require(_0x5f7c('0x7'))[_0x5f7c('0x8')];var logger=require(_0x5f7c('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5f7c('0xa')][0x2]);var QUERY=process[_0x5f7c('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5dee90,_0x167615){var _0xdd2ee8={'status':_0x5dee90};var _0xe32503={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x167615){_0xdd2ee8['savename']=_0x167615;}return db['AnalyticExtractedReport'][_0x5f7c('0xb')](_0xdd2ee8,_0xe32503);}function main(){var _0xab4d0c=0x1388;var _0x12cb58;logger[_0x5f7c('0xc')](util['format'](_0x5f7c('0xd'),EXTRACTED_REPORT_ID,_0x5f7c('0xe')));return db[_0x5f7c('0xf')][_0x5f7c('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5f7c('0x11'),_0x5f7c('0x12')]})['then'](function(_0x1ce556){if(_0x1ce556){_0x12cb58=_0x1ce556;_0xab4d0c=_0x12cb58[_0x5f7c('0x12')]||0x1388;}})[_0x5f7c('0x13')](function(){return dbH[_0x5f7c('0x14')][_0x5f7c('0x15')](util['format'](_0x5f7c('0x16'),QUERY),{'type':dbH[_0x5f7c('0x14')][_0x5f7c('0x17')][_0x5f7c('0x18')]});})['then'](function(_0x5a448d){if(!_0x5a448d[0x0][_0x5f7c('0x19')]){return analyticExtractedReport(_0x5f7c('0x1a'));}var _0x39e23c=[];var _0x152907=0x0;if(_0x12cb58[_0x5f7c('0x11')]){if(_0x5a448d&&_0x5a448d[_0x5f7c('0x1b')]){var _0x5696c1=_['range'](_0x5a448d[0x0][_0x5f7c('0x19')]/_0xab4d0c);var _0x90524c=Number[_0x5f7c('0x1c')](_0x5a448d[0x0][_0x5f7c('0x19')]/_0xab4d0c)?_0x5a448d[0x0][_0x5f7c('0x19')]%_0xab4d0c:0x0;_0x5696c1['forEach'](function(_0x1f24b7){if(_0x1f24b7>0x0){_0x152907+=_0xab4d0c;}_0x39e23c[_0x5f7c('0x1d')](dbH['sequelize'][_0x5f7c('0x15')](util[_0x5f7c('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xab4d0c,_0x152907),{'type':dbH[_0x5f7c('0x14')]['QueryTypes'][_0x5f7c('0x18')]}));});if(_0x90524c>0x0){_0x152907+=_0xab4d0c;_0x39e23c[_0x5f7c('0x1d')](dbH[_0x5f7c('0x14')][_0x5f7c('0x15')](util[_0x5f7c('0x1e')](_0x5f7c('0x1f'),QUERY,_0x90524c,_0x152907),{'type':dbH[_0x5f7c('0x14')][_0x5f7c('0x17')][_0x5f7c('0x18')]}));}}}else{_0x39e23c[_0x5f7c('0x1d')](dbH[_0x5f7c('0x14')][_0x5f7c('0x15')](QUERY,{'type':dbH[_0x5f7c('0x14')][_0x5f7c('0x17')]['SELECT']}));}var _0xf72cf8=path['dirname'](PATH);var _0x3c2429=path[_0x5f7c('0x20')](PATH,_0x5f7c('0x21'));var _0x36b68a=_0x12cb58[_0x5f7c('0x11')]&&_0x39e23c[_0x5f7c('0x1b')]>0x1;var _0x3b3834=[];if(!fs[_0x5f7c('0x22')](path['join'](_0xf72cf8,_0x3c2429))&&_0x36b68a){fs[_0x5f7c('0x23')](path[_0x5f7c('0x24')](_0xf72cf8,_0x3c2429));}return BPromise[_0x5f7c('0x25')](_0x39e23c,function(_0x35e373){_0x3b3834[_0x5f7c('0x1d')](_0x35e373);})['then'](function(){for(var _0x49401e=0x0;_0x49401e<_0x3b3834[_0x5f7c('0x1b')];_0x49401e+=0x1){var _0x3ddfd0;var _0x39efda=_0x3b3834[_0x49401e];if(_0x36b68a){_0x3ddfd0=path[_0x5f7c('0x24')](_0xf72cf8,_0x3c2429,util[_0x5f7c('0x1e')](_0x5f7c('0x26'),_0x3c2429,_0x49401e,_0x5f7c('0x27')));}else{_0x3ddfd0=path['join'](_0xf72cf8,util[_0x5f7c('0x1e')]('%s.%s',_0x3c2429,_0x5f7c('0x27')));}fs[_0x5f7c('0x28')](_0x3ddfd0,csv(_0x39efda));}})[_0x5f7c('0x13')](function(){if(_0x36b68a){return new Promise(function(_0x2322f0){zipdir(path[_0x5f7c('0x24')](_0xf72cf8,_0x3c2429),{'saveTo':path[_0x5f7c('0x24')](_0xf72cf8,util['format'](_0x5f7c('0x29'),_0x3c2429,_0x5f7c('0x2a')))},function(_0x5e2011,_0x152dc7){rimraf(path[_0x5f7c('0x24')](_0xf72cf8,_0x3c2429),function(){});_0x2322f0(_0x5f7c('0x2b'));});});}})[_0x5f7c('0x13')](function(){logger['info'](util[_0x5f7c('0x1e')](_0x5f7c('0x2c'),EXTRACTED_REPORT_ID,_0x5f7c('0xe')));return analyticExtractedReport(_0x5f7c('0x2d'),_0x36b68a?util['format']('%s.%s',_0x3c2429,_0x36b68a?_0x5f7c('0x2a'):_0x5f7c('0x27')):null);});})[_0x5f7c('0x2e')](function(_0x387100){logger[_0x5f7c('0xc')](util[_0x5f7c('0x1e')](_0x5f7c('0x2f'),EXTRACTED_REPORT_ID,_0x5f7c('0xe')),util[_0x5f7c('0x30')](_0x387100,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5f7c('0x31'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index a11bdf1..2abc4fa 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 _0xf295=['startDate','endDate','length','header','before','landscape','toString','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','info','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','pdfmake/src/printer','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','pick','value','fill','auto','body','concat','chunk','keys','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name'];(function(_0x301ca3,_0x4233c5){var _0x131292=function(_0x4b64fd){while(--_0x4b64fd){_0x301ca3['push'](_0x301ca3['shift']());}};_0x131292(++_0x4233c5);}(_0xf295,0x14b));var _0x5f29=function(_0x116ee3,_0x2b5e23){_0x116ee3=_0x116ee3-0x0;var _0xa78321=_0xf295[_0x116ee3];return _0xa78321;};'use strict';var _=require(_0x5f29('0x0'));var fs=require('fs');var util=require(_0x5f29('0x1'));var path=require(_0x5f29('0x2'));var moment=require(_0x5f29('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x5f29('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x5f29('0x5'));var JSDOM=require('jsdom')[_0x5f29('0x6')];var window=new JSDOM('')[_0x5f29('0x7')];var BPromise=require(_0x5f29('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5f29('0x9'))[_0x5f29('0xa')];var logger=require(_0x5f29('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5f29('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x5f29('0xc')][0x5];var FORMAT=_0x5f29('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x46417e,_0x3a55b1){var _0x157986={'status':_0x46417e};var _0x4cc2d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a55b1){_0x157986[_0x5f29('0xe')]=_0x3a55b1;}return db[_0x5f29('0xf')]['update'](_0x157986,_0x4cc2d2);}function getHeaders(_0x12160d){return _['map'](_0x12160d,function(_0x5cd483){return{'text':_0x5cd483,'style':'tableHeader'};});}function getRows(_0x2aa60a,_0xd8fe9d){return _[_0x5f29('0x10')](_0xd8fe9d,function(_0x4f447f){return _(_0x4f447f)[_0x5f29('0x11')](_0x2aa60a)['map'](function(_0x1069db){return _0x1069db?_['toString'](_0x1069db):'';})[_0x5f29('0x12')]();});}function createTable(_0x365a1b,_0x52293c){var _0x17c1b0={'widths':_[_0x5f29('0x13')](Array(_0x365a1b['length']),0x91),'heights':function(_0x500145){return _0x500145===0x0?_0x5f29('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x6373f9=getHeaders(_0x365a1b);_0x17c1b0[_0x5f29('0x15')]['push'](_0x6373f9);var _0x4fce13=getRows(_0x365a1b,_0x52293c);_0x17c1b0[_0x5f29('0x15')]=_0x17c1b0['body'][_0x5f29('0x16')](_0x4fce13);return _0x17c1b0;}function createTables(_0x2a6314){var _0x13c06c=[];var _0x34b4ce=_[_0x5f29('0x17')](Object[_0x5f29('0x18')](_0x2a6314[0x0]),0x5);_0x34b4ce['forEach'](function(_0x53cca8){_0x13c06c[_0x5f29('0x19')](createTable(_0x53cca8,_0x2a6314));});return _0x13c06c;}function getPDFDocDefinition(_0x2fef49){var _0x355d88=util[_0x5f29('0x1a')](_0x5f29('0x1b'),NAME,EXTRACTED_REPORT[_0x5f29('0x1c')],moment(EXTRACTED_REPORT[_0x5f29('0x1d')])[_0x5f29('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x5f29('0x1e')])[_0x5f29('0x1a')](FORMAT));var _0x579851=[];for(var _0x4ad94d=0x0;_0x4ad94d<_0x2fef49[_0x5f29('0x1f')];_0x4ad94d++){var _0x58e881=[];if(_0x4ad94d===0x0){_0x58e881[_0x5f29('0x19')]({'text':_0x355d88,'style':_0x5f29('0x20')});}var _0x2163a0={'table':_0x2fef49[_0x4ad94d]};if(_0x4ad94d>0x0){_0x2163a0['pageBreak']=_0x5f29('0x21');_0x2163a0['margin']=[0x0,0x46,0x0,0x0];}_0x58e881[_0x5f29('0x19')](_0x2163a0);_0x579851[_0x5f29('0x19')](_0x58e881);}return{'pageSize':'A4','pageOrientation':_0x5f29('0x22'),'content':_0x579851,'footer':function(_0x3fab33,_0x482ccc){return{'text':_0x3fab33[_0x5f29('0x23')]()+_0x5f29('0x24')+_0x482ccc,'style':_0x5f29('0x25')};},'defaultStyle':{'font':_0x5f29('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5f29('0x27')},'footer':{'alignment':_0x5f29('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5794d2){var _0x4d960b=0x1388;var _0x1a40a0;if(!_0x5794d2[0x0][_0x5f29('0x29')]){return analyticExtractedReport(_0x5f29('0x2a'));}return db[_0x5f29('0x2b')][_0x5f29('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5f29('0x2d')]})[_0x5f29('0x2e')](function(_0x5f2264){if(_0x5f2264){_0x1a40a0=_0x5f2264;_0x4d960b=_0x1a40a0[_0x5f29('0x2d')]||0x3e8;}})['then'](function(){var _0x43506f=[];var _0x37f2d1=0x0;if(_0x1a40a0[_0x5f29('0x2f')]){if(_0x5794d2&&_0x5794d2[_0x5f29('0x1f')]){var _0x2f02fc=_[_0x5f29('0x30')](_0x5794d2[0x0][_0x5f29('0x29')]/_0x4d960b);var _0xf4edf1=Number[_0x5f29('0x31')](_0x5794d2[0x0][_0x5f29('0x29')]/_0x4d960b)?_0x5794d2[0x0][_0x5f29('0x29')]%_0x4d960b:0x0;_0x2f02fc[_0x5f29('0x32')](function(_0x4e6909){if(_0x4e6909>0x0){_0x37f2d1+=_0x4d960b;}_0x43506f[_0x5f29('0x19')](dbH['sequelize'][_0x5f29('0x33')](util[_0x5f29('0x1a')](_0x5f29('0x34'),QUERY,_0x4d960b,_0x37f2d1),{'type':dbH[_0x5f29('0x35')][_0x5f29('0x36')][_0x5f29('0x37')]}));});if(_0xf4edf1>0x0){_0x37f2d1+=_0x4d960b;_0x43506f['push'](dbH[_0x5f29('0x35')]['query'](util[_0x5f29('0x1a')](_0x5f29('0x34'),QUERY,_0xf4edf1,_0x37f2d1),{'type':dbH[_0x5f29('0x35')][_0x5f29('0x36')][_0x5f29('0x37')]}));}}}else{_0x43506f[_0x5f29('0x19')](dbH[_0x5f29('0x35')][_0x5f29('0x33')](QUERY,{'type':dbH[_0x5f29('0x35')]['QueryTypes']['SELECT']}));}var _0x3bbd4e=path[_0x5f29('0x38')](PATH);var _0x525a9b=path[_0x5f29('0x39')](PATH,_0x5f29('0x3a'));var _0x2e3cc0=_0x1a40a0['split']&&_0x43506f['length']>0x1;var _0x40fe6f=[];if(!fs[_0x5f29('0x3b')](path[_0x5f29('0x3c')](_0x3bbd4e,_0x525a9b))&&_0x2e3cc0){fs[_0x5f29('0x3d')](path[_0x5f29('0x3c')](_0x3bbd4e,_0x525a9b));}return BPromise[_0x5f29('0x3e')](_0x43506f,function(_0x31bc6d){_0x40fe6f['push'](_0x31bc6d);})['then'](function(){var _0x40c75d=[];for(var _0x21895b=0x0;_0x21895b<_0x40fe6f[_0x5f29('0x1f')];_0x21895b+=0x1){var _0xabde=_0x40fe6f[_0x21895b];var _0x17965c=createTables(_[_0x5f29('0x3f')](_0xabde));var _0x191b5d;var _0x1a3c18=getPDFDocDefinition(_0x17965c);var _0x3e7522=getPDFPrinter();var _0x1ced13=_0x3e7522[_0x5f29('0x40')](_0x1a3c18);if(_0x2e3cc0){_0x191b5d=path['join'](_0x3bbd4e,_0x525a9b,util['format']('%s%d.%s',_0x525a9b,_0x21895b,_0x5f29('0x41')));}else{_0x191b5d=path[_0x5f29('0x3c')](_0x3bbd4e,util[_0x5f29('0x1a')](_0x5f29('0x42'),_0x525a9b,_0x5f29('0x41')));}_0x40c75d[_0x5f29('0x19')](writePDFDocument(_0x1ced13,_0x191b5d));}return Promise[_0x5f29('0x43')](_0x40c75d);})[_0x5f29('0x2e')](function(){if(_0x2e3cc0){return new Promise(function(_0x58c968){zipdir(path['join'](_0x3bbd4e,_0x525a9b),{'saveTo':path[_0x5f29('0x3c')](_0x3bbd4e,util[_0x5f29('0x1a')](_0x5f29('0x42'),_0x525a9b,_0x5f29('0x44')))},function(){rimraf(path['join'](_0x3bbd4e,_0x525a9b),function(){});_0x58c968(_0x5f29('0x45'));});});}})['then'](function(){if(!_0x2e3cc0)return;rimraf(path['join'](_0x3bbd4e,_0x525a9b),function(){});})[_0x5f29('0x2e')](function(){logger['info'](util[_0x5f29('0x1a')](_0x5f29('0x46'),EXTRACTED_REPORT_ID,_0x5f29('0x47')));return analyticExtractedReport('Completed',_0x2e3cc0?util[_0x5f29('0x1a')]('%s.%s',_0x525a9b,_0x2e3cc0?_0x5f29('0x44'):_0x5f29('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5f29('0x48')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5f29('0x47')));return db[_0x5f29('0xf')][_0x5f29('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5f29('0x2e')](function(_0x9b1bc8){EXTRACTED_REPORT=_0x9b1bc8;return dbH[_0x5f29('0x35')][_0x5f29('0x33')](util[_0x5f29('0x1a')](_0x5f29('0x4a'),QUERY),{'type':dbH[_0x5f29('0x35')][_0x5f29('0x36')][_0x5f29('0x37')]});})[_0x5f29('0x2e')](extractReport)['catch'](function(_0x345c68){logger[_0x5f29('0x48')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5f29('0x47')),util[_0x5f29('0x4b')](_0x345c68,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5f29('0x4c'));})['finally'](function(){process[_0x5f29('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4b5b0b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x5f29('0x4e'),'bolditalics':__dirname+_0x5f29('0x4f')}});return _0x4b5b0b;}function getPDFDocDefinitionFromHTML(_0x427b86,_0x1712ab){var _0x337876=util[_0x5f29('0x1a')]('%s\x20#%d',_0x1712ab['channel'],_0x1712ab[_0x5f29('0x50')]);var _0x39b7ba=moment()['format'](_0x5f29('0x51'))['toString']();var _0x5f2554=htmlToPdfmake(_0x427b86,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5f2554],'defaultStyle':{'font':_0x5f29('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5f29('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5f29('0x52')}},'header':function(){return[{'text':_0x5f29('0x53'),'style':_0x5f29('0x20')}];},'footer':function(_0x272134,_0x412ba5){return[{'text':util['format'](_0x5f29('0x54'),_0x337876,_0x272134,_0x412ba5,_0x39b7ba),'style':_0x5f29('0x25')}];}};}function writePDFDocument(_0x4bd632,_0x217f6c){return new Promise(function(_0x355e95,_0x36b189){var _0x1c70cc=_0x4bd632['pipe'](fs['createWriteStream'](_0x217f6c));_0x1c70cc['on'](_0x5f29('0x55'),function(){_0x355e95(_0x5f29('0x55'));});_0x1c70cc['on'](_0x5f29('0x56'),function(_0x2b9808){_0x36b189(_0x2b9808);});_0x4bd632[_0x5f29('0x57')]();});}exports[_0x5f29('0x58')]=function(_0x523df3,_0x1f92ac){var _0x6789eb=getPDFPrinter();var _0x3eef8d=getPDFDocDefinitionFromHTML(_0x523df3,_0x1f92ac);var _0x55f510=_0x6789eb[_0x5f29('0x40')](_0x3eef8d);return writePDFDocument(_0x55f510,_0x1f92ac[_0x5f29('0x2')])[_0x5f29('0x59')](function(_0x12797c){throw _0x12797c;});}; \ No newline at end of file +var _0x5ccc=['AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','landscape','toString','black','num','Setting','find','split','splitSizePdf','then','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','%s%d.%s','pdf','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','center','\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','util','path','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0x5ccc,0x156));var _0xc5cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ccc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc5cc('0x0'));var fs=require('fs');var util=require(_0xc5cc('0x1'));var path=require(_0xc5cc('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xc5cc('0x3'));var rimraf=require(_0xc5cc('0x4'));var JSDOM=require('jsdom')[_0xc5cc('0x5')];var window=new JSDOM('')[_0xc5cc('0x6')];var BPromise=require(_0xc5cc('0x7'));var db=require(_0xc5cc('0x8'))['db'];var dbH=require(_0xc5cc('0x8'))[_0xc5cc('0x9')];var logger=require(_0xc5cc('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc5cc('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc5cc('0xb')][0x4];var NAME=process[_0xc5cc('0xb')][0x5];var FORMAT=_0xc5cc('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b42a5,_0x3ebb41){var _0x3d1ec3={'status':_0x1b42a5};var _0x30f72c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ebb41){_0x3d1ec3[_0xc5cc('0xd')]=_0x3ebb41;}return db[_0xc5cc('0xe')][_0xc5cc('0xf')](_0x3d1ec3,_0x30f72c);}function getHeaders(_0x470a68){return _[_0xc5cc('0x10')](_0x470a68,function(_0x1f6551){return{'text':_0x1f6551,'style':_0xc5cc('0x11')};});}function getRows(_0x2375ad,_0x55662e){return _[_0xc5cc('0x10')](_0x55662e,function(_0x198e6f){return _(_0x198e6f)[_0xc5cc('0x12')](_0x2375ad)['map'](function(_0x4ed338){return _0x4ed338?_['toString'](_0x4ed338):'';})[_0xc5cc('0x13')]();});}function createTable(_0x1fdb4b,_0x14d4ee){var _0x43e968={'widths':_[_0xc5cc('0x14')](Array(_0x1fdb4b[_0xc5cc('0x15')]),0x91),'heights':function(_0x532d54){return _0x532d54===0x0?_0xc5cc('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2467da=getHeaders(_0x1fdb4b);_0x43e968[_0xc5cc('0x17')][_0xc5cc('0x18')](_0x2467da);var _0x535e19=getRows(_0x1fdb4b,_0x14d4ee);_0x43e968['body']=_0x43e968['body']['concat'](_0x535e19);return _0x43e968;}function createTables(_0x27a6e5){var _0xc3c2d0=[];var _0x3c209b=_[_0xc5cc('0x19')](Object[_0xc5cc('0x1a')](_0x27a6e5[0x0]),0x5);_0x3c209b[_0xc5cc('0x1b')](function(_0x2a4c17){_0xc3c2d0['push'](createTable(_0x2a4c17,_0x27a6e5));});return _0xc3c2d0;}function getPDFDocDefinition(_0x224b57){var _0x3957e9=util[_0xc5cc('0x1c')](_0xc5cc('0x1d'),NAME,EXTRACTED_REPORT[_0xc5cc('0x1e')],moment(EXTRACTED_REPORT[_0xc5cc('0x1f')])[_0xc5cc('0x1c')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x41b907=[];for(var _0x14101b=0x0;_0x14101b<_0x224b57[_0xc5cc('0x15')];_0x14101b++){var _0x1445af=[];if(_0x14101b===0x0){_0x1445af[_0xc5cc('0x18')]({'text':_0x3957e9,'style':_0xc5cc('0x20')});}var _0x2028f2={'table':_0x224b57[_0x14101b]};if(_0x14101b>0x0){_0x2028f2[_0xc5cc('0x21')]=_0xc5cc('0x22');_0x2028f2[_0xc5cc('0x23')]=[0x0,0x46,0x0,0x0];}_0x1445af[_0xc5cc('0x18')](_0x2028f2);_0x41b907[_0xc5cc('0x18')](_0x1445af);}return{'pageSize':'A4','pageOrientation':_0xc5cc('0x24'),'content':_0x41b907,'footer':function(_0x23c662,_0x460cbc){return{'text':_0x23c662[_0xc5cc('0x25')]()+'\x20/\x20'+_0x460cbc,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc5cc('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35090e){var _0x2d7484=0x1388;var _0x3aa288;if(!_0x35090e[0x0][_0xc5cc('0x27')]){return analyticExtractedReport('Empty');}return db[_0xc5cc('0x28')][_0xc5cc('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc5cc('0x2a'),_0xc5cc('0x2b')]})[_0xc5cc('0x2c')](function(_0x353850){if(_0x353850){_0x3aa288=_0x353850;_0x2d7484=_0x3aa288[_0xc5cc('0x2b')]||0x3e8;}})[_0xc5cc('0x2c')](function(){var _0x364c6f=[];var _0x8e0130=0x0;if(_0x3aa288['split']){if(_0x35090e&&_0x35090e[_0xc5cc('0x15')]){var _0x2340b2=_['range'](_0x35090e[0x0][_0xc5cc('0x27')]/_0x2d7484);var _0x823fb8=Number[_0xc5cc('0x2d')](_0x35090e[0x0][_0xc5cc('0x27')]/_0x2d7484)?_0x35090e[0x0][_0xc5cc('0x27')]%_0x2d7484:0x0;_0x2340b2[_0xc5cc('0x1b')](function(_0x1e1bca){if(_0x1e1bca>0x0){_0x8e0130+=_0x2d7484;}_0x364c6f['push'](dbH[_0xc5cc('0x2e')]['query'](util[_0xc5cc('0x1c')](_0xc5cc('0x2f'),QUERY,_0x2d7484,_0x8e0130),{'type':dbH[_0xc5cc('0x2e')][_0xc5cc('0x30')][_0xc5cc('0x31')]}));});if(_0x823fb8>0x0){_0x8e0130+=_0x2d7484;_0x364c6f[_0xc5cc('0x18')](dbH[_0xc5cc('0x2e')][_0xc5cc('0x32')](util['format'](_0xc5cc('0x2f'),QUERY,_0x823fb8,_0x8e0130),{'type':dbH['sequelize'][_0xc5cc('0x30')][_0xc5cc('0x31')]}));}}}else{_0x364c6f[_0xc5cc('0x18')](dbH[_0xc5cc('0x2e')][_0xc5cc('0x32')](QUERY,{'type':dbH[_0xc5cc('0x2e')][_0xc5cc('0x30')]['SELECT']}));}var _0x2c3a34=path[_0xc5cc('0x33')](PATH);var _0x26f0ac=path[_0xc5cc('0x34')](PATH,_0xc5cc('0x35'));var _0x5b5f06=_0x3aa288['split']&&_0x364c6f['length']>0x1;var _0x13fe60=[];if(!fs[_0xc5cc('0x36')](path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac))&&_0x5b5f06){fs[_0xc5cc('0x38')](path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac));}return BPromise['each'](_0x364c6f,function(_0x2fad89){_0x13fe60[_0xc5cc('0x18')](_0x2fad89);})[_0xc5cc('0x2c')](function(){var _0x157e6f=[];for(var _0x82a183=0x0;_0x82a183<_0x13fe60[_0xc5cc('0x15')];_0x82a183+=0x1){var _0x1434c6=_0x13fe60[_0x82a183];var _0x242cd2=createTables(_[_0xc5cc('0x39')](_0x1434c6));var _0xbfb48a;var _0x23c896=getPDFDocDefinition(_0x242cd2);var _0x1138ef=getPDFPrinter();var _0x335448=_0x1138ef['createPdfKitDocument'](_0x23c896);if(_0x5b5f06){_0xbfb48a=path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac,util[_0xc5cc('0x1c')](_0xc5cc('0x3a'),_0x26f0ac,_0x82a183,_0xc5cc('0x3b')));}else{_0xbfb48a=path['join'](_0x2c3a34,util['format']('%s.%s',_0x26f0ac,_0xc5cc('0x3b')));}_0x157e6f[_0xc5cc('0x18')](writePDFDocument(_0x335448,_0xbfb48a));}return Promise['all'](_0x157e6f);})[_0xc5cc('0x2c')](function(){if(_0x5b5f06){return new Promise(function(_0x5de184){zipdir(path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac),{'saveTo':path[_0xc5cc('0x37')](_0x2c3a34,util[_0xc5cc('0x1c')]('%s.%s',_0x26f0ac,_0xc5cc('0x3c')))},function(){rimraf(path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac),function(){});_0x5de184(_0xc5cc('0x3d'));});});}})[_0xc5cc('0x2c')](function(){if(!_0x5b5f06)return;rimraf(path[_0xc5cc('0x37')](_0x2c3a34,_0x26f0ac),function(){});})[_0xc5cc('0x2c')](function(){logger[_0xc5cc('0x3e')](util[_0xc5cc('0x1c')](_0xc5cc('0x3f'),EXTRACTED_REPORT_ID,_0xc5cc('0x40')));return analyticExtractedReport(_0xc5cc('0x41'),_0x5b5f06?util[_0xc5cc('0x1c')](_0xc5cc('0x42'),_0x26f0ac,_0x5b5f06?'zip':_0xc5cc('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc5cc('0x3e')](util[_0xc5cc('0x1c')](_0xc5cc('0x43'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xc5cc('0xe')][_0xc5cc('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc5cc('0x2c')](function(_0x2a9336){EXTRACTED_REPORT=_0x2a9336;return dbH['sequelize'][_0xc5cc('0x32')](util[_0xc5cc('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc5cc('0x2e')][_0xc5cc('0x30')][_0xc5cc('0x31')]});})[_0xc5cc('0x2c')](extractReport)['catch'](function(_0x348df5){logger[_0xc5cc('0x3e')](util[_0xc5cc('0x1c')](_0xc5cc('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0xc5cc('0x46')](_0x348df5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc5cc('0x47'));})[_0xc5cc('0x48')](function(){process[_0xc5cc('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x479498=new PdfPrinter({'Arial':{'normal':__dirname+_0xc5cc('0x4a'),'bold':__dirname+_0xc5cc('0x4b'),'italics':__dirname+_0xc5cc('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x479498;}function getPDFDocDefinitionFromHTML(_0x14eb4e,_0x3b3e46){var _0x58aada=util[_0xc5cc('0x1c')](_0xc5cc('0x4d'),_0x3b3e46[_0xc5cc('0x4e')],_0x3b3e46[_0xc5cc('0x4f')]);var _0x2717a5=moment()[_0xc5cc('0x1c')]('YYYY-MM-DD')[_0xc5cc('0x25')]();var _0x1e2323=htmlToPdfmake(_0x14eb4e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1e2323],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc5cc('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc5cc('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xc5cc('0x20')}];},'footer':function(_0x22e743,_0x23bcbd){return[{'text':util['format'](_0xc5cc('0x51'),_0x58aada,_0x22e743,_0x23bcbd,_0x2717a5),'style':'footer'}];}};}function writePDFDocument(_0x5cef9a,_0x169fbd){return new Promise(function(_0x3c0710,_0x44ed6d){var _0x25eea0=_0x5cef9a[_0xc5cc('0x52')](fs[_0xc5cc('0x53')](_0x169fbd));_0x25eea0['on'](_0xc5cc('0x54'),function(){_0x3c0710(_0xc5cc('0x54'));});_0x25eea0['on'](_0xc5cc('0x55'),function(_0x2d8602){_0x44ed6d(_0x2d8602);});_0x5cef9a[_0xc5cc('0x56')]();});}exports[_0xc5cc('0x57')]=function(_0xaf9606,_0x2b742e){var _0x1db81f=getPDFPrinter();var _0xa8b745=getPDFDocDefinitionFromHTML(_0xaf9606,_0x2b742e);var _0x2faea8=_0x1db81f[_0xc5cc('0x58')](_0xa8b745);return writePDFDocument(_0x2faea8,_0x2b742e[_0xc5cc('0x2')])['catch'](function(_0x54b129){throw _0x54b129;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c6b2f59..2c07540 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 _0x43f7=['split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find'];(function(_0x3db0a5,_0x214c0b){var _0x667a9=function(_0x34d514){while(--_0x34d514){_0x3db0a5['push'](_0x3db0a5['shift']());}};_0x667a9(++_0x214c0b);}(_0x43f7,0x14d));var _0x743f=function(_0x1f645e,_0x24bb1b){_0x1f645e=_0x1f645e-0x0;var _0x127c20=_0x43f7[_0x1f645e];return _0x127c20;};'use strict';var util=require(_0x743f('0x0'));var path=require('path');var _=require(_0x743f('0x1'));var fs=require('fs');var json2xls=require(_0x743f('0x2'));var BPromise=require(_0x743f('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x743f('0x4'));var db=require(_0x743f('0x5'))['db'];var dbH=require(_0x743f('0x5'))[_0x743f('0x6')];var logger=require('../../config/logger')(_0x743f('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x743f('0x8')][0x2]);var QUERY=process[_0x743f('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x37b53d,_0x25af42){var _0x132473={'status':_0x37b53d};var _0x1ec3dd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25af42){_0x132473[_0x743f('0x9')]=_0x25af42;}return db[_0x743f('0xa')][_0x743f('0xb')](_0x132473,_0x1ec3dd);}function main(){var _0xcc337d=0x1388;var _0x3ecaaf;logger[_0x743f('0xc')](util[_0x743f('0xd')](_0x743f('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x743f('0xf')][_0x743f('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x743f('0x11'),_0x743f('0x12')]})[_0x743f('0x13')](function(_0x3adc17){if(_0x3adc17){_0x3ecaaf=_0x3adc17;_0xcc337d=_0x3ecaaf[_0x743f('0x12')]||0x1388;}})[_0x743f('0x13')](function(){return dbH[_0x743f('0x14')][_0x743f('0x15')](util[_0x743f('0xd')](_0x743f('0x16'),QUERY),{'type':dbH[_0x743f('0x14')][_0x743f('0x17')][_0x743f('0x18')]});})['then'](function(_0x2f1c0e){if(!_0x2f1c0e[0x0]['num']){return analyticExtractedReport('Empty');}var _0x2d2769=[];var _0x3cdf19=0x0;if(_0x3ecaaf[_0x743f('0x11')]){if(_0x2f1c0e&&_0x2f1c0e['length']){var _0x5bb2c2=_[_0x743f('0x19')](_0x2f1c0e[0x0]['num']/_0xcc337d);var _0x1aa0ca=Number['isInteger'](_0x2f1c0e[0x0][_0x743f('0x1a')]/_0xcc337d)?_0x2f1c0e[0x0][_0x743f('0x1a')]%_0xcc337d:0x0;_0x5bb2c2[_0x743f('0x1b')](function(_0x5bfa08){if(_0x5bfa08>0x0){_0x3cdf19+=_0xcc337d;}_0x2d2769[_0x743f('0x1c')](dbH[_0x743f('0x14')][_0x743f('0x15')](util['format'](_0x743f('0x1d'),QUERY,_0xcc337d,_0x3cdf19),{'type':dbH['sequelize'][_0x743f('0x17')][_0x743f('0x18')]}));});if(_0x1aa0ca>0x0){_0x3cdf19+=_0xcc337d;_0x2d2769[_0x743f('0x1c')](dbH['sequelize'][_0x743f('0x15')](util[_0x743f('0xd')](_0x743f('0x1d'),QUERY,_0x1aa0ca,_0x3cdf19),{'type':dbH[_0x743f('0x14')][_0x743f('0x17')][_0x743f('0x18')]}));}}}else{_0x2d2769[_0x743f('0x1c')](dbH[_0x743f('0x14')]['query'](QUERY,{'type':dbH[_0x743f('0x14')][_0x743f('0x17')][_0x743f('0x18')]}));}var _0x2a81fc=path[_0x743f('0x1e')](PATH);var _0xc2d982=path[_0x743f('0x1f')](PATH,_0x743f('0x20'));var _0x4b994f=_0x3ecaaf[_0x743f('0x11')]&&_0x2d2769[_0x743f('0x21')]>0x1;var _0x488aaa=[];if(!fs[_0x743f('0x22')](path[_0x743f('0x23')](_0x2a81fc,_0xc2d982))&&_0x4b994f){fs[_0x743f('0x24')](path[_0x743f('0x23')](_0x2a81fc,_0xc2d982));}return BPromise['each'](_0x2d2769,function(_0x43eac6){_0x488aaa['push'](_0x43eac6);})[_0x743f('0x13')](function(){for(var _0x47c14e=0x0;_0x47c14e<_0x488aaa[_0x743f('0x21')];_0x47c14e+=0x1){var _0x8cd75f;var _0x51d91f=_0x488aaa[_0x47c14e];if(_0x4b994f){_0x8cd75f=path[_0x743f('0x23')](_0x2a81fc,_0xc2d982,util[_0x743f('0xd')](_0x743f('0x25'),_0xc2d982,_0x47c14e,_0x743f('0x26')));}else{_0x8cd75f=path[_0x743f('0x23')](_0x2a81fc,util['format'](_0x743f('0x27'),_0xc2d982,_0x743f('0x26')));}fs[_0x743f('0x28')](_0x8cd75f,json2xls(_0x51d91f),'binary');}})[_0x743f('0x13')](function(){if(_0x4b994f){return new Promise(function(_0x5508b7){zipdir(path[_0x743f('0x23')](_0x2a81fc,_0xc2d982),{'saveTo':path[_0x743f('0x23')](_0x2a81fc,util[_0x743f('0xd')]('%s.%s',_0xc2d982,_0x743f('0x29')))},function(_0x717041,_0x4c6a01){rimraf(path[_0x743f('0x23')](_0x2a81fc,_0xc2d982),function(){});_0x5508b7(_0x743f('0x2a'));});});}})['then'](function(){logger['info'](util[_0x743f('0xd')](_0x743f('0x2b'),EXTRACTED_REPORT_ID,_0x743f('0x2c')));return analyticExtractedReport('Completed',_0x4b994f?util[_0x743f('0xd')]('%s.%s',_0xc2d982,_0x4b994f?_0x743f('0x29'):_0x743f('0x26')):null);});})['catch'](function(_0x27365f){logger[_0x743f('0xc')](util[_0x743f('0xd')](_0x743f('0x2d'),EXTRACTED_REPORT_ID,_0x743f('0x2c')),util[_0x743f('0x2e')](_0x27365f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x743f('0x2f'));})[_0x743f('0x30')](function(){process[_0x743f('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0176=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','finally','exit','util','lodash','bluebird','rimraf','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','format','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','binary','zip','zip\x20finished'];(function(_0x358ede,_0x63d22){var _0x59cec9=function(_0x154a9b){while(--_0x154a9b){_0x358ede['push'](_0x358ede['shift']());}};_0x59cec9(++_0x63d22);}(_0x0176,0x14f));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x6017('0x0'));var path=require('path');var _=require(_0x6017('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x6017('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x6017('0x3'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x6017('0x4'))(_0x6017('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x6017('0x6')][0x2]);var QUERY=process[_0x6017('0x6')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26f6e7,_0x311051){var _0x47bd7d={'status':_0x26f6e7};var _0x5935df={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x311051){_0x47bd7d['savename']=_0x311051;}return db[_0x6017('0x7')][_0x6017('0x8')](_0x47bd7d,_0x5935df);}function main(){var _0x366f62=0x1388;var _0x21915c;logger[_0x6017('0x9')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6017('0xa')));return db[_0x6017('0xb')][_0x6017('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6017('0xd'),_0x6017('0xe')]})['then'](function(_0x38b2ed){if(_0x38b2ed){_0x21915c=_0x38b2ed;_0x366f62=_0x21915c[_0x6017('0xe')]||0x1388;}})[_0x6017('0xf')](function(){return dbH[_0x6017('0x10')][_0x6017('0x11')](util['format'](_0x6017('0x12'),QUERY),{'type':dbH['sequelize'][_0x6017('0x13')][_0x6017('0x14')]});})[_0x6017('0xf')](function(_0x1c207b){if(!_0x1c207b[0x0][_0x6017('0x15')]){return analyticExtractedReport(_0x6017('0x16'));}var _0x407b0d=[];var _0x4406a8=0x0;if(_0x21915c['split']){if(_0x1c207b&&_0x1c207b[_0x6017('0x17')]){var _0x1b5f1b=_[_0x6017('0x18')](_0x1c207b[0x0]['num']/_0x366f62);var _0x5989f4=Number['isInteger'](_0x1c207b[0x0]['num']/_0x366f62)?_0x1c207b[0x0][_0x6017('0x15')]%_0x366f62:0x0;_0x1b5f1b['forEach'](function(_0x8603bb){if(_0x8603bb>0x0){_0x4406a8+=_0x366f62;}_0x407b0d['push'](dbH['sequelize'][_0x6017('0x11')](util[_0x6017('0x19')](_0x6017('0x1a'),QUERY,_0x366f62,_0x4406a8),{'type':dbH[_0x6017('0x10')][_0x6017('0x13')][_0x6017('0x14')]}));});if(_0x5989f4>0x0){_0x4406a8+=_0x366f62;_0x407b0d[_0x6017('0x1b')](dbH[_0x6017('0x10')][_0x6017('0x11')](util[_0x6017('0x19')](_0x6017('0x1a'),QUERY,_0x5989f4,_0x4406a8),{'type':dbH['sequelize'][_0x6017('0x13')][_0x6017('0x14')]}));}}}else{_0x407b0d['push'](dbH['sequelize'][_0x6017('0x11')](QUERY,{'type':dbH[_0x6017('0x10')][_0x6017('0x13')]['SELECT']}));}var _0x3ea4b3=path[_0x6017('0x1c')](PATH);var _0x3582cc=path[_0x6017('0x1d')](PATH,_0x6017('0x1e'));var _0x28a467=_0x21915c[_0x6017('0xd')]&&_0x407b0d[_0x6017('0x17')]>0x1;var _0x1a3500=[];if(!fs[_0x6017('0x1f')](path[_0x6017('0x20')](_0x3ea4b3,_0x3582cc))&&_0x28a467){fs[_0x6017('0x21')](path[_0x6017('0x20')](_0x3ea4b3,_0x3582cc));}return BPromise[_0x6017('0x22')](_0x407b0d,function(_0x3b9332){_0x1a3500['push'](_0x3b9332);})[_0x6017('0xf')](function(){for(var _0x29e16e=0x0;_0x29e16e<_0x1a3500[_0x6017('0x17')];_0x29e16e+=0x1){var _0x3b3a5a;var _0x36a7c5=_0x1a3500[_0x29e16e];if(_0x28a467){_0x3b3a5a=path['join'](_0x3ea4b3,_0x3582cc,util[_0x6017('0x19')](_0x6017('0x23'),_0x3582cc,_0x29e16e,'xlsx'));}else{_0x3b3a5a=path['join'](_0x3ea4b3,util[_0x6017('0x19')](_0x6017('0x24'),_0x3582cc,_0x6017('0x25')));}fs['writeFileSync'](_0x3b3a5a,json2xls(_0x36a7c5),_0x6017('0x26'));}})[_0x6017('0xf')](function(){if(_0x28a467){return new Promise(function(_0x27155e){zipdir(path[_0x6017('0x20')](_0x3ea4b3,_0x3582cc),{'saveTo':path[_0x6017('0x20')](_0x3ea4b3,util[_0x6017('0x19')](_0x6017('0x24'),_0x3582cc,_0x6017('0x27')))},function(_0x345756,_0x5bc371){rimraf(path[_0x6017('0x20')](_0x3ea4b3,_0x3582cc),function(){});_0x27155e(_0x6017('0x28'));});});}})['then'](function(){logger[_0x6017('0x9')](util['format'](_0x6017('0x29'),EXTRACTED_REPORT_ID,_0x6017('0xa')));return analyticExtractedReport('Completed',_0x28a467?util['format'](_0x6017('0x24'),_0x3582cc,_0x28a467?_0x6017('0x27'):_0x6017('0x25')):null);});})[_0x6017('0x2a')](function(_0x4c13ed){logger[_0x6017('0x9')](util[_0x6017('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6017('0xa')),util[_0x6017('0x2b')](_0x4c13ed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6017('0x2c'));})[_0x6017('0x2d')](function(){process[_0x6017('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 1b2a02c..6375498 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 _0x1d50=['app','toLowerCase','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','context','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','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'];(function(_0x230dd3,_0x26024b){var _0x7987fa=function(_0x36a021){while(--_0x36a021){_0x230dd3['push'](_0x230dd3['shift']());}};_0x7987fa(++_0x26024b);}(_0x1d50,0x126));var _0x01d5=function(_0x22eb8a,_0x19da9c){_0x22eb8a=_0x22eb8a-0x0;var _0x1a0286=_0x1d50[_0x22eb8a];return _0x1a0286;};'use strict';var _=require(_0x01d5('0x0'));var util=require(_0x01d5('0x1'));function rewrite(_0x10d1c3,_0x159f17){var _0x23f89e=this;return _0x10d1c3[_0x01d5('0x2')]['Interval'][_0x01d5('0x3')]({'raw':!![]})['then'](function(_0x1d6233){_0x23f89e[_0x01d5('0x4')]=_0x1d6233;return _0x10d1c3['models'][_0x01d5('0x5')][_0x01d5('0x3')]({'where':{'IntervalId':_0x159f17[_0x01d5('0x6')]},'raw':!![]});})['then'](function(_0x41d3e1){return _0x10d1c3[_0x01d5('0x2')][_0x01d5('0x5')][_0x01d5('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x01d5('0x7')](_0x41d3e1,_0x01d5('0x8')))}},'order':[{'raw':_0x01d5('0x9')}],'raw':!![]});})['then'](function(_0x23d902){var _0x1a3564=_[_0x01d5('0xa')](_0x23d902,{'priority':'1'});var _0x304475=_[_0x01d5('0xa')](_0x23d902,{'isApp':0x1});var _0xcb08bd=_[_0x01d5('0xb')](_0x304475,_0x01d5('0x8'));var _0xbad779=[_0x01d5('0xc'),_0x01d5('0xd')];var _0x3be1e9=[];var _0x9cfa9f=[];for(var _0x11e13c in _0xcb08bd){if(_0xcb08bd[_0x01d5('0xe')](_0x11e13c)){_0x23f89e[_0x01d5('0xf')]=0x2;_0x23f89e[_0x01d5('0x10')]=[];_0x23f89e[_0x01d5('0x11')]=_[_0x01d5('0x12')](_0x1a3564,{'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')]});_0x23f89e['extensions'][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Set','appdata':util[_0x01d5('0x15')](_0x01d5('0x16'),_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')]),'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0]['VoiceExtensionId']});if(_0xcb08bd[_0x11e13c][0x0]['type']===_0x01d5('0x18')){_0x23f89e['extensions'][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':_0x01d5('0x1a')+_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')],'context':_0xcb08bd[_0x11e13c][0x0]['context'],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});}else if(_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')]===_0x01d5('0x1c')){if(_0x23f89e['extension']){_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Set','appdata':_0x01d5('0x1d')+(_0x23f89e[_0x01d5('0x11')][_0x01d5('0x1e')]?_0x01d5('0x1f')+_0x23f89e[_0x01d5('0x11')][_0x01d5('0x1e')]+'}':_0x01d5('0x20')),'context':_0xcb08bd[_0x11e13c][0x0]['context'],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e['priority']++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});}_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0]['type'],'app':_0x01d5('0x19'),'appdata':_0x01d5('0x1a')+_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')],'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0]['exten'],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});var _0x510ee7=_0x23f89e['priority']++;_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0]['type'],'app':_0x01d5('0x21'),'appdata':_0x01d5('0x22')+(_0x510ee7+0x2)+_0x01d5('0x23')+(_0x510ee7+0x1)+')','context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x510ee7,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});if(_0x23f89e[_0x01d5('0x11')]){_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':_0x23f89e[_0x01d5('0x11')][_0x01d5('0x1e')]?_0x01d5('0x24')+_0x23f89e['extension'][_0x01d5('0x1e')]+'}':_0x01d5('0x25'),'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});}_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Set','appdata':_0x01d5('0x26')+_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')],'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0]['exten'],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});if(_0x23f89e[_0x01d5('0x11')]&&_0x23f89e[_0x01d5('0x11')][_0x01d5('0xe')](_0x01d5('0x27'))&&_0x23f89e[_0x01d5('0x11')]['recordingFormat']!==_0x01d5('0x28')){_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0]['type'],'app':_0x01d5('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0]['exten'],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});_0x23f89e[_0x01d5('0x10')]['push']({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x23f89e[_0x01d5('0x11')][_0x01d5('0x27')]||_0x01d5('0x29'),'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});}}_0x23f89e[_0x01d5('0x10')]['push']({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Set','appdata':_0x01d5('0x2a'),'context':_0xcb08bd[_0x11e13c][0x0]['context'],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0]['VoiceExtensionId']});_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Set','appdata':_0x01d5('0x2b'),'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0]['VoiceExtensionId']});_0x23f89e['extensions']['push']({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':'MONITOR_OPTIONS=ab','context':_0xcb08bd[_0x11e13c][0x0]['context'],'exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'priority':_0x23f89e[_0x01d5('0xf')]++,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});for(var _0x4c5988=0x0,_0x21034e=0x0;_0x4c5988<_0xcb08bd[_0x11e13c][_0x01d5('0x2c')];_0x4c5988+=0x1,_0x21034e=0x0){var _0x2cbecc=_0xcb08bd[_0x11e13c][_0x4c5988];if(_0x2cbecc[_0x01d5('0x14')]){_0x2cbecc[_0x01d5('0x14')]=_0x2cbecc[_0x01d5('0x14')]['toLowerCase']();}var _0x2aaada=[];var _0x5e32e4=[];delete _0x2cbecc['id'];delete _0x2cbecc[_0x01d5('0x2d')];delete _0x2cbecc[_0x01d5('0x2e')];var _0x3d4322=_0x2cbecc[_0x01d5('0x2f')]!==_0x01d5('0x30')?[_0x2cbecc[_0x01d5('0x2f')]]:_0x2cbecc[_0x01d5('0x6')]?_[_0x01d5('0x7')](_['filter'](_0x23f89e[_0x01d5('0x4')],{'IntervalId':_0x2cbecc['IntervalId']}),'interval'):[];if(_0x2cbecc[_0x01d5('0xe')](_0x01d5('0x31'))){if(_0x2cbecc['tag']&&_0x2cbecc['tag']!=='--'){_0x2aaada['push']({'type':_0x2cbecc['type'],'app':_0x01d5('0x19'),'appdata':_0x01d5('0x32')+_0x2cbecc[_0x01d5('0x31')],'context':_0x2cbecc[_0x01d5('0x17')],'exten':_0x2cbecc['exten'],'priority':_0x3d4322['length']+_0x23f89e[_0x01d5('0xf')]+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});}}if(_0x2cbecc[_0x01d5('0x14')]==='outbound'&&_0x2cbecc[_0x01d5('0xe')]('callerID')){if(_0x2cbecc[_0x01d5('0x33')]){_0x2aaada[_0x01d5('0x13')]({'type':_0x2cbecc['type'],'app':'ExecIf','appdata':_0x01d5('0x34')+_0x2cbecc['callerID']+')','context':_0x2cbecc[_0x01d5('0x17')],'exten':_0x2cbecc['exten'],'priority':_0x3d4322[_0x01d5('0x2c')]+_0x23f89e[_0x01d5('0xf')]+_0x21034e++,'VoiceExtensionId':_0x2cbecc['VoiceExtensionId']});}else{_0x2aaada[_0x01d5('0x13')]({'type':_0x2cbecc[_0x01d5('0x14')],'app':_0x01d5('0x21'),'appdata':_0x01d5('0x35'),'context':_0x2cbecc['context'],'exten':_0x2cbecc['exten'],'priority':_0x3d4322['length']+_0x23f89e['priority']+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});}}if(_0x2cbecc[_0x01d5('0xe')](_0x01d5('0x36'))){if(_0xbad779[_0x01d5('0x37')](_0x2cbecc[_0x01d5('0x38')][_0x01d5('0x39')]())>=0x0&&_0x2cbecc['appType']!=='custom'){if(_0x2cbecc[_0x01d5('0x36')]){_0x2aaada['push']({'type':_0x2cbecc[_0x01d5('0x14')],'app':_0x01d5('0x21'),'appdata':_0x01d5('0x3a'),'context':_0x2cbecc['context'],'exten':_0x2cbecc[_0x01d5('0x8')],'priority':_0x3d4322[_0x01d5('0x2c')]+_0x23f89e['priority']+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});_0x2aaada[_0x01d5('0x13')]({'type':_0x2cbecc[_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':_0x01d5('0x3b'),'context':_0x2cbecc[_0x01d5('0x17')],'exten':_0x2cbecc[_0x01d5('0x8')],'priority':_0x3d4322[_0x01d5('0x2c')]+_0x23f89e[_0x01d5('0xf')]+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});}else{_0x2aaada[_0x01d5('0x13')]({'type':_0x2cbecc[_0x01d5('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2cbecc[_0x01d5('0x17')],'exten':_0x2cbecc[_0x01d5('0x8')],'priority':_0x3d4322[_0x01d5('0x2c')]+_0x23f89e[_0x01d5('0xf')]+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});_0x2aaada[_0x01d5('0x13')]({'type':_0x2cbecc[_0x01d5('0x14')],'app':_0x01d5('0x19'),'appdata':_0x01d5('0x3c'),'context':_0x2cbecc[_0x01d5('0x17')],'exten':_0x2cbecc[_0x01d5('0x8')],'priority':_0x3d4322[_0x01d5('0x2c')]+_0x23f89e[_0x01d5('0xf')]+_0x21034e++,'VoiceExtensionId':_0x2cbecc[_0x01d5('0x1b')]});}}}for(var _0xf888ca=0x0;_0xf888ca<_0x3d4322[_0x01d5('0x2c')];_0xf888ca+=0x1){var _0x12a251=_0x23f89e['priority']+_0x3d4322[_0x01d5('0x2c')];var _0x441ed0=_0xf888ca===_0x3d4322['length']-0x1?_0x23f89e['priority']+_0x2aaada[_0x01d5('0x2c')]+_0x5e32e4[_0x01d5('0x2c')]+0x2:_0x23f89e[_0x01d5('0xf')]+_0xf888ca+0x1;_0x2aaada[_0x01d5('0x3d')](_0xf888ca,0x0,{'type':_0x2cbecc[_0x01d5('0x14')],'app':'GotoIfTime','appdata':_0x3d4322[_0xf888ca]+'?'+_0x2cbecc[_0x01d5('0x17')]+_0x01d5('0x3e')+_0x12a251+':'+_0x2cbecc[_0x01d5('0x17')]+_0x01d5('0x3e')+_0x441ed0,'exten':_0x2cbecc[_0x01d5('0x8')],'context':_0x2cbecc[_0x01d5('0x17')],'priority':_0x23f89e[_0x01d5('0xf')]+_0xf888ca,'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]});}_0x2cbecc['priority']=_0x2aaada[_0x01d5('0x2c')]?_[_0x01d5('0x3f')](_0x2aaada)['priority']+0x1:_0x23f89e[_0x01d5('0xf')];_0x23f89e[_0x01d5('0xf')]=(_0x5e32e4['length']?_[_0x01d5('0x3f')](_0x5e32e4)[_0x01d5('0xf')]:_0x2cbecc[_0x01d5('0xf')])+0x1;_0x23f89e['extensions']=_['concat'](_0x23f89e[_0x01d5('0x10')],_0x2aaada,[_0x2cbecc],_0x5e32e4);}_0x23f89e[_0x01d5('0x10')][_0x01d5('0x13')]({'type':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x14')],'app':'Hangup','exten':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x8')],'context':_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x17')],'priority':_0x23f89e[_0x01d5('0xf')],'VoiceExtensionId':_0xcb08bd[_0x11e13c][0x0]['VoiceExtensionId']});_0x3be1e9['push'](_0xcb08bd[_0x11e13c][0x0][_0x01d5('0x1b')]);_0x9cfa9f=_[_0x01d5('0x40')](_0x9cfa9f,_0x23f89e['extensions']);}}return _0x10d1c3[_0x01d5('0x41')](function(_0xe8b740){return _0x10d1c3['models']['VoiceExtension'][_0x01d5('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3be1e9}},'transaction':_0xe8b740})['then'](function(_0x5e4734){return _0x10d1c3['models']['VoiceExtension'][_0x01d5('0x43')](_[_0x01d5('0x44')](_0x9cfa9f,_0x01d5('0xf')),{'transaction':_0xe8b740});});});})['catch'](function(_0x6ca8c3){console['error'](_0x6ca8c3);});}exports[_0x01d5('0x45')]=rewrite; \ No newline at end of file +var _0xb40f=['*,*,*,*','interval','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','models','sortBy','catch','lodash','util','Interval','then','intervals','findAll','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','priority','extensions','extension','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','push','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb40f,0x98));var _0xfb40=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0xb40f[_0x47d6dc];return _0x1a1c93;};'use strict';var _=require(_0xfb40('0x0'));var util=require(_0xfb40('0x1'));function rewrite(_0x342c87,_0x1614a5){var _0x34ec13=this;return _0x342c87['models'][_0xfb40('0x2')]['findAll']({'raw':!![]})[_0xfb40('0x3')](function(_0x1d7231){_0x34ec13[_0xfb40('0x4')]=_0x1d7231;return _0x342c87['models']['VoiceExtension'][_0xfb40('0x5')]({'where':{'IntervalId':_0x1614a5[_0xfb40('0x6')]},'raw':!![]});})[_0xfb40('0x3')](function(_0x27b022){return _0x342c87['models'][_0xfb40('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xfb40('0x8')](_[_0xfb40('0x9')](_0x27b022,'exten'))}},'order':[{'raw':_0xfb40('0xa')}],'raw':!![]});})[_0xfb40('0x3')](function(_0x45fb73){var _0x49b42f=_['filter'](_0x45fb73,{'priority':'1'});var _0x383601=_[_0xfb40('0xb')](_0x45fb73,{'isApp':0x1});var _0x1bca29=_[_0xfb40('0xc')](_0x383601,_0xfb40('0xd'));var _0x2e4734=['queue',_0xfb40('0xe')];var _0x24e198=[];var _0x2904c8=[];for(var _0x2c1c92 in _0x1bca29){if(_0x1bca29['hasOwnProperty'](_0x2c1c92)){_0x34ec13[_0xfb40('0xf')]=0x2;_0x34ec13[_0xfb40('0x10')]=[];_0x34ec13[_0xfb40('0x11')]=_['find'](_0x49b42f,{'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')]});_0x34ec13['extensions']['push']({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':util[_0xfb40('0x14')](_0xfb40('0x15'),_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')]),'context':_0x1bca29[_0x2c1c92][0x0]['context'],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13['priority']++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});if(_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')]===_0xfb40('0x17')){_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x19')+_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')],'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});}else if(_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')]===_0xfb40('0x1b')){if(_0x34ec13[_0xfb40('0x11')]){_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x1c')+(_0x34ec13[_0xfb40('0x11')][_0xfb40('0x1d')]?_0xfb40('0x1e')+_0x34ec13[_0xfb40('0x11')][_0xfb40('0x1d')]+'}':_0xfb40('0x1f')),'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0]['VoiceExtensionId']});}_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x19')+_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')],'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});var _0x1a1ea5=_0x34ec13[_0xfb40('0xf')]++;_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0]['type'],'app':_0xfb40('0x20'),'appdata':_0xfb40('0x21')+(_0x1a1ea5+0x2)+'):Goto('+(_0x1a1ea5+0x1)+')','context':_0x1bca29[_0x2c1c92][0x0]['context'],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x1a1ea5,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});if(_0x34ec13[_0xfb40('0x11')]){_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':'Set','appdata':_0x34ec13[_0xfb40('0x11')][_0xfb40('0x1d')]?_0xfb40('0x22')+_0x34ec13[_0xfb40('0x11')][_0xfb40('0x1d')]+'}':_0xfb40('0x23'),'context':_0x1bca29[_0x2c1c92][0x0]['context'],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});}_0x34ec13[_0xfb40('0x10')]['push']({'type':_0x1bca29[_0x2c1c92][0x0]['type'],'app':_0xfb40('0x13'),'appdata':'outboundrouteid='+_0x1bca29[_0x2c1c92][0x0]['VoiceExtensionId'],'context':_0x1bca29[_0x2c1c92][0x0]['context'],'exten':_0x1bca29[_0x2c1c92][0x0]['exten'],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0]['VoiceExtensionId']});if(_0x34ec13[_0xfb40('0x11')]&&_0x34ec13[_0xfb40('0x11')][_0xfb40('0x24')](_0xfb40('0x25'))&&_0x34ec13['extension']['recordingFormat']!=='none'){_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x26'),'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0]['exten'],'priority':_0x34ec13['priority']++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});_0x34ec13[_0xfb40('0x10')]['push']({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x34ec13[_0xfb40('0x11')][_0xfb40('0x25')]||_0xfb40('0x27'),'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13['priority']++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});}}_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':'Set','appdata':_0xfb40('0x28'),'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13[_0xfb40('0xf')]++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0]['type'],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x29'),'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'priority':_0x34ec13['priority']++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0]['VoiceExtensionId']});_0x34ec13[_0xfb40('0x10')]['push']({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1bca29[_0x2c1c92][0x0]['context'],'exten':_0x1bca29[_0x2c1c92][0x0]['exten'],'priority':_0x34ec13['priority']++,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});for(var _0x2f4bd7=0x0,_0xe3db80=0x0;_0x2f4bd7<_0x1bca29[_0x2c1c92][_0xfb40('0x2a')];_0x2f4bd7+=0x1,_0xe3db80=0x0){var _0x23e3e2=_0x1bca29[_0x2c1c92][_0x2f4bd7];if(_0x23e3e2['type']){_0x23e3e2['type']=_0x23e3e2[_0xfb40('0x12')][_0xfb40('0x2b')]();}var _0x4b044a=[];var _0x5b9830=[];delete _0x23e3e2['id'];delete _0x23e3e2[_0xfb40('0x2c')];delete _0x23e3e2[_0xfb40('0x2d')];var _0x36cf5f=_0x23e3e2['interval']!==_0xfb40('0x2e')?[_0x23e3e2[_0xfb40('0x2f')]]:_0x23e3e2['IntervalId']?_['map'](_['filter'](_0x34ec13[_0xfb40('0x4')],{'IntervalId':_0x23e3e2[_0xfb40('0x6')]}),'interval'):[];if(_0x23e3e2[_0xfb40('0x24')](_0xfb40('0x30'))){if(_0x23e3e2[_0xfb40('0x30')]&&_0x23e3e2[_0xfb40('0x30')]!=='--'){_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2[_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':'CDR(tag)='+_0x23e3e2[_0xfb40('0x30')],'context':_0x23e3e2[_0xfb40('0x1a')],'exten':_0x23e3e2[_0xfb40('0xd')],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});}}if(_0x23e3e2['type']==='outbound'&&_0x23e3e2['hasOwnProperty'](_0xfb40('0x31'))){if(_0x23e3e2[_0xfb40('0x31')]){_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2['type'],'app':_0xfb40('0x20'),'appdata':_0xfb40('0x32')+_0x23e3e2[_0xfb40('0x31')]+')','context':_0x23e3e2[_0xfb40('0x1a')],'exten':_0x23e3e2[_0xfb40('0xd')],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});}else{_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2['type'],'app':'ExecIf','appdata':_0xfb40('0x33'),'context':_0x23e3e2[_0xfb40('0x1a')],'exten':_0x23e3e2[_0xfb40('0xd')],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});}}if(_0x23e3e2[_0xfb40('0x24')]('answer')){if(_0x2e4734[_0xfb40('0x34')](_0x23e3e2['app']['toLowerCase']())>=0x0&&_0x23e3e2[_0xfb40('0x35')]!=='custom'){if(_0x23e3e2['answer']){_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2[_0xfb40('0x12')],'app':'ExecIf','appdata':_0xfb40('0x36'),'context':_0x23e3e2[_0xfb40('0x1a')],'exten':_0x23e3e2[_0xfb40('0xd')],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2['type'],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x37'),'context':_0x23e3e2['context'],'exten':_0x23e3e2['exten'],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2['VoiceExtensionId']});}else{_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2['type'],'app':_0xfb40('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x23e3e2[_0xfb40('0x1a')],'exten':_0x23e3e2[_0xfb40('0xd')],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13['priority']+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});_0x4b044a[_0xfb40('0x18')]({'type':_0x23e3e2[_0xfb40('0x12')],'app':_0xfb40('0x13'),'appdata':_0xfb40('0x38'),'context':_0x23e3e2['context'],'exten':_0x23e3e2['exten'],'priority':_0x36cf5f[_0xfb40('0x2a')]+_0x34ec13[_0xfb40('0xf')]+_0xe3db80++,'VoiceExtensionId':_0x23e3e2[_0xfb40('0x16')]});}}}for(var _0x1497fd=0x0;_0x1497fd<_0x36cf5f[_0xfb40('0x2a')];_0x1497fd+=0x1){var _0x3771b5=_0x34ec13[_0xfb40('0xf')]+_0x36cf5f[_0xfb40('0x2a')];var _0x311cd0=_0x1497fd===_0x36cf5f[_0xfb40('0x2a')]-0x1?_0x34ec13[_0xfb40('0xf')]+_0x4b044a['length']+_0x5b9830[_0xfb40('0x2a')]+0x2:_0x34ec13[_0xfb40('0xf')]+_0x1497fd+0x1;_0x4b044a['splice'](_0x1497fd,0x0,{'type':_0x23e3e2['type'],'app':_0xfb40('0x39'),'appdata':_0x36cf5f[_0x1497fd]+'?'+_0x23e3e2[_0xfb40('0x1a')]+_0xfb40('0x3a')+_0x3771b5+':'+_0x23e3e2[_0xfb40('0x1a')]+_0xfb40('0x3a')+_0x311cd0,'exten':_0x23e3e2[_0xfb40('0xd')],'context':_0x23e3e2[_0xfb40('0x1a')],'priority':_0x34ec13[_0xfb40('0xf')]+_0x1497fd,'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});}_0x23e3e2[_0xfb40('0xf')]=_0x4b044a['length']?_[_0xfb40('0x3b')](_0x4b044a)[_0xfb40('0xf')]+0x1:_0x34ec13[_0xfb40('0xf')];_0x34ec13[_0xfb40('0xf')]=(_0x5b9830[_0xfb40('0x2a')]?_[_0xfb40('0x3b')](_0x5b9830)[_0xfb40('0xf')]:_0x23e3e2[_0xfb40('0xf')])+0x1;_0x34ec13[_0xfb40('0x10')]=_['concat'](_0x34ec13[_0xfb40('0x10')],_0x4b044a,[_0x23e3e2],_0x5b9830);}_0x34ec13[_0xfb40('0x10')][_0xfb40('0x18')]({'type':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x12')],'app':_0xfb40('0x3c'),'exten':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0xd')],'context':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x1a')],'priority':_0x34ec13[_0xfb40('0xf')],'VoiceExtensionId':_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]});_0x24e198['push'](_0x1bca29[_0x2c1c92][0x0][_0xfb40('0x16')]);_0x2904c8=_[_0xfb40('0x3d')](_0x2904c8,_0x34ec13[_0xfb40('0x10')]);}}return _0x342c87[_0xfb40('0x3e')](function(_0x3a2e1d){return _0x342c87[_0xfb40('0x3f')][_0xfb40('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x24e198}},'transaction':_0x3a2e1d})[_0xfb40('0x3')](function(_0x5b633a){return _0x342c87['models']['VoiceExtension']['bulkCreate'](_[_0xfb40('0x40')](_0x2904c8,_0xfb40('0xf')),{'transaction':_0x3a2e1d});});});})[_0xfb40('0x41')](function(_0x24153f){console['error'](_0x24153f);});}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 f9a5959..c15ccde 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 _0xdbce=['CompanyId','find','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','insert','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','str','cm_hopper_black','VoiceQueue','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','all','outbound','BlackLists','Campaign','CampaignId','onlyIfOpen','findAll','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xdbce,0x12e));var _0xedbc=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0xdbce[_0x3889ae];return _0x6533dd;};'use strict';var BPromise=require(_0xedbc('0x0'));var util=require(_0xedbc('0x1'));var _=require(_0xedbc('0x2'));var fs=require('fs');var squel=require(_0xedbc('0x3'));var Papa=require(_0xedbc('0x4'));var Redis=require(_0xedbc('0x5'));var db=require(_0xedbc('0x6'))['db'];var config=require(_0xedbc('0x7'));var logger=require(_0xedbc('0x8'))(_0xedbc('0x9'));config['redis']=_[_0xedbc('0xa')](config[_0xedbc('0xb')],{'host':_0xedbc('0xc'),'port':0x18eb});var socket=require(_0xedbc('0xd'))(new Redis(config[_0xedbc('0xb')]));require('../../../api/cmContact/cmContact.socket')[_0xedbc('0xe')](socket);try{if(!process[_0xedbc('0xf')][0x2]||process[_0xedbc('0xf')][0x2]===_0xedbc('0x10')||process[_0xedbc('0xf')][0x2]===_0xedbc('0x11')){throw new Error(_0xedbc('0x12'));}var FILEPATH=process[_0xedbc('0xf')][0x2];if(!process[_0xedbc('0xf')][0x3]||process[_0xedbc('0xf')][0x3]==='undefined'||process[_0xedbc('0xf')][0x3]===_0xedbc('0x11')||!process[_0xedbc('0xf')][0x4]||process[_0xedbc('0xf')][0x4]===_0xedbc('0x10')||process[_0xedbc('0xf')][0x4]===_0xedbc('0x11')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xedbc('0x13')](process[_0xedbc('0xf')][0x3][_0xedbc('0x14')](','),process[_0xedbc('0xf')][0x4][_0xedbc('0x14')](','));if(!process[_0xedbc('0xf')][0x5]||process[_0xedbc('0xf')][0x5]===_0xedbc('0x10')||process[_0xedbc('0xf')][0x5]==='null'){throw new Error(_0xedbc('0x15'));}var LISTID=process[_0xedbc('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xedbc('0xf')][0x6]!==_0xedbc('0x10')&&process[_0xedbc('0xf')][0x6]!=='null'?process[_0xedbc('0xf')][0x6]:null;var DUPLICATES=process[_0xedbc('0xf')][0x7]&&process[_0xedbc('0xf')][0x7]!=='undefined'&&process[_0xedbc('0xf')][0x7]!==_0xedbc('0x11')?process['argv'][0x7]:null;if(!process[_0xedbc('0xf')][0x8]||process['argv'][0x8]===_0xedbc('0x10')||process[_0xedbc('0xf')][0x8]===_0xedbc('0x11')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xedbc('0xf')][0x8];}catch(_0x440599){logger[_0xedbc('0x16')](_0x440599);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(_0x4e367e,_0x1b1f07,_0x480b8b,_0x157e94){var _0x23bf5c={'message':_0x1b1f07};_0x23bf5c[_0x4e367e]=!![];if(_0x480b8b){_0x23bf5c[_0xedbc('0x17')]=_0x480b8b;}if(_0x157e94){_0x23bf5c[_0xedbc('0x18')]=_0x157e94;}return _0x23bf5c;}function isEmail(_0x14f9d0){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))*$/[_0xedbc('0x19')](_0x14f9d0);}function checkRow(_0x4f7f43,_0x276cb4,_0x1c9dcd){return new BPromise(function(_0x1bb012,_0x19f8b1){if(_[_0xedbc('0x1a')](_0x4f7f43)){return _0x19f8b1(handleCheckRowError('error',_0xedbc('0x1b'),null,_0x1c9dcd));}if(_0x4f7f43[_0xedbc('0x1c')]&&_0x4f7f43[_0xedbc('0x1c')][_0xedbc('0x1d')]){var _0xa9a1c7=_[_0xedbc('0x1e')](_0x4f7f43[_0xedbc('0x1c')],_0xedbc('0x1f'))['join'](';');return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),_0xa9a1c7,null,_0x1c9dcd));}var _0x2caa50={};for(var _0x4e1c89 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4e1c89)&&FIELDS[_0x4e1c89]){_0x2caa50[_0x4e1c89]=_0x4f7f43[_0xedbc('0x20')][0x0][FIELDS[_0x4e1c89]]||_0x4f7f43['data'][0x0]['\ufeff'+FIELDS[_0x4e1c89]];}}if(!_0x2caa50[_0xedbc('0x21')]){return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),_0xedbc('0x22'),null,_0x1c9dcd));}if(!_0x2caa50[_0xedbc('0x23')]){return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),'phone\x20not\x20specified!',null,_0x1c9dcd));}if(_0x2caa50[_0xedbc('0x24')]){var _0x368efa=moment(_0x2caa50['birthDate'],_0xedbc('0x25'));if(!_0x368efa['isValid']()){return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1c9dcd));}}if(_0x2caa50['email']){if(!isEmail(_0x2caa50[_0xedbc('0x26')])){return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),_0xedbc('0x27'),null,_0x1c9dcd));}}_0x2caa50['ListId']=LISTID;_0x2caa50[_0xedbc('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xedbc('0x1d')]&&_0x276cb4){var _0x50c318={};for(var _0x334280=0x0,_0x453eaf=DUPLICATES[_0xedbc('0x1d')];_0x334280<_0x453eaf;_0x334280+=0x1){_0x50c318[DUPLICATES[_0x334280]]=_0x2caa50[DUPLICATES[_0x334280]];}var _0x2ed818=_[_0xedbc('0x29')](_0x276cb4,_0x50c318);if(_0x2ed818){return _0x19f8b1(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x2ed818,_0x1c9dcd));}}return db[_0xedbc('0x2a')][_0xedbc('0x2b')](_0x2caa50,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2caa50)})[_0xedbc('0x2c')](function(_0x9dbd75){if(DUPLICATES&&DUPLICATES[_0xedbc('0x1d')]&&_0x276cb4){_0x276cb4[_0xedbc('0x2d')](_[_0xedbc('0x2e')](_0x2caa50,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x9dbd75['id'];return _0x1bb012();})[_0xedbc('0x2f')](function(_0x328d89){return _0x19f8b1(handleCheckRowError(_0xedbc('0x16'),_0xedbc('0x30')+(_0x328d89[_0xedbc('0x1f')]||JSON[_0xedbc('0x31')](_0x328d89)),null,_0x1c9dcd));});});}function checkHopper(){function _0x2e59bd(){return function(_0xe46480){logger[_0xedbc('0x16')](_0xedbc('0x32'),_0xedbc('0x33'),util[_0xedbc('0x34')](_0xe46480,{'showHidden':![],'depth':null}));};}var _0x10a475=function(_0x552093,_0x67f8e9){var _0x16aed1=squel['insert']()[_0xedbc('0x35')](_0xedbc('0x36'))['fromQuery']([_0xedbc('0x23'),_0xedbc('0x37'),_0xedbc('0x38'),_0xedbc('0x39'),_0x67f8e9,_0xedbc('0x3a'),_0xedbc('0x3b')],squel[_0xedbc('0x3c')]()[_0xedbc('0x3d')](_0xedbc('0x23'),_0xedbc('0x23'))[_0xedbc('0x3d')](_0xedbc('0x3e'),'scheduledAt')[_0xedbc('0x3d')]('id',_0xedbc('0x38'))[_0xedbc('0x3d')](LISTID['toString'](),_0xedbc('0x39'))[_0xedbc('0x3d')](_0x552093['id'][_0xedbc('0x3f')](),_0x67f8e9)[_0xedbc('0x3d')](_0xedbc('0x3e'),'createdAt')['field'](_0xedbc('0x3e'),_0xedbc('0x3b'))['from'](_0xedbc('0x40'))[_0xedbc('0x41')]('deletedAt\x20IS\x20NULL')[_0xedbc('0x41')](_0xedbc('0x42'),LISTID[_0xedbc('0x3f')]())[_0xedbc('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0xedbc('0x41')](_0xedbc('0x43'),squel[_0xedbc('0x3c')]()[_0xedbc('0x3d')](_0xedbc('0x23'))[_0xedbc('0x44')](_0xedbc('0x36'))[_0xedbc('0x41')](_0x67f8e9+_0xedbc('0x45'),_0x552093['id'][_0xedbc('0x3f')]())))[_0xedbc('0x3f')]();return _0x16aed1;};var _0x438cc4=function(_0x46e553,_0x40de4f){var _0x193965=squel[_0xedbc('0x46')]()['into'](_0xedbc('0x36'))[_0xedbc('0x47')]([_0xedbc('0x23'),'scheduledAt','ContactId',_0xedbc('0x39'),_0x40de4f,_0xedbc('0x3a'),_0xedbc('0x3b')],squel[_0xedbc('0x3c')]()[_0xedbc('0x3d')](_0xedbc('0x23'),'phone')[_0xedbc('0x3d')]('NOW()',_0xedbc('0x37'))['field']('id',_0xedbc('0x38'))[_0xedbc('0x3d')](LISTID[_0xedbc('0x3f')](),_0xedbc('0x39'))[_0xedbc('0x3d')](_0x46e553['id']['toString'](),_0x40de4f)[_0xedbc('0x3d')](_0xedbc('0x3e'),_0xedbc('0x3a'))[_0xedbc('0x3d')]('NOW()','updatedAt')[_0xedbc('0x44')](_0xedbc('0x40'))[_0xedbc('0x41')](_0xedbc('0x48'))[_0xedbc('0x41')](_0xedbc('0x42'),LISTID[_0xedbc('0x3f')]())[_0xedbc('0x41')](_0xedbc('0x49'),squel['str'](hopperContacts))['where'](_0xedbc('0x4a'))[_0xedbc('0x41')](_0xedbc('0x43'),squel[_0xedbc('0x3c')]()['field'](_0xedbc('0x4b'))['from'](_0xedbc('0x4c'))[_0xedbc('0x41')](_0x40de4f+_0xedbc('0x45'),_0x46e553['id'][_0xedbc('0x3f')]()))[_0xedbc('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xedbc('0x3d')]('phone')[_0xedbc('0x44')]('cm_hopper')['where'](_0x40de4f+_0xedbc('0x45'),_0x46e553['id'][_0xedbc('0x3f')]())))[_0xedbc('0x3f')]();return _0x193965;};function _0x11c60f(_0x53c64d,_0x515187){var _0x369794=squel[_0xedbc('0x46')]()[_0xedbc('0x35')](_0xedbc('0x36'))[_0xedbc('0x47')](['phone',_0xedbc('0x37'),_0xedbc('0x38'),_0xedbc('0x39'),_0x515187,_0xedbc('0x3a'),'updatedAt'],squel[_0xedbc('0x3c')]()['field']('phone','phone')[_0xedbc('0x3d')](_0xedbc('0x3e'),'scheduledAt')[_0xedbc('0x3d')]('id',_0xedbc('0x38'))[_0xedbc('0x3d')](LISTID['toString'](),_0xedbc('0x39'))['field'](_0x53c64d['id'][_0xedbc('0x3f')](),_0x515187)[_0xedbc('0x3d')](_0xedbc('0x3e'),_0xedbc('0x3a'))[_0xedbc('0x3d')](_0xedbc('0x3e'),_0xedbc('0x3b'))[_0xedbc('0x44')](_0xedbc('0x40'))[_0xedbc('0x41')](_0xedbc('0x48'))[_0xedbc('0x41')](_0xedbc('0x42'),LISTID['toString']())['where'](_0xedbc('0x49'),squel[_0xedbc('0x4d')](hopperContacts))[_0xedbc('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xedbc('0x3f')]();return _0x369794;}function _0x2929fd(_0x3df7af,_0x574a44){var _0x9d4578=squel['insert']()[_0xedbc('0x35')](_0xedbc('0x4e'))[_0xedbc('0x47')]([_0xedbc('0x23'),_0xedbc('0x38'),_0xedbc('0x39'),_0x574a44,_0xedbc('0x3a'),'updatedAt'],squel[_0xedbc('0x3c')]()['field']('phone',_0xedbc('0x23'))[_0xedbc('0x3d')]('id',_0xedbc('0x38'))[_0xedbc('0x3d')](LISTID[_0xedbc('0x3f')](),'ListId')[_0xedbc('0x3d')](_0x3df7af['id'][_0xedbc('0x3f')](),_0x574a44)[_0xedbc('0x3d')](_0xedbc('0x3e'),'createdAt')['field']('NOW()','updatedAt')[_0xedbc('0x44')](_0xedbc('0x40'))[_0xedbc('0x41')]('deletedAt\x20IS\x20NULL')[_0xedbc('0x41')](_0xedbc('0x42'),LISTID['toString']())[_0xedbc('0x41')]('id\x20IN\x20?',squel[_0xedbc('0x4d')](hopperContacts))[_0xedbc('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xedbc('0x3f')]();return _0x9d4578;}return db[_0xedbc('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xedbc('0x50')],'as':_0xedbc('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x58d5ac){var _0x3eb083=[];if(_0x58d5ac){var _0x4b4cad;for(var _0x5f0437=0x0,_0x507514;_0x5f0437<_0x58d5ac[_0xedbc('0x1d')];_0x5f0437+=0x1){_0x507514=_0x58d5ac[_0x5f0437][_0xedbc('0x52')]({'plain':!![]});switch(_0x507514[_0xedbc('0x53')]){case _0xedbc('0x54'):_0x3eb083[_0xedbc('0x2d')](db[_0xedbc('0x55')][_0xedbc('0x56')](_0x438cc4(_0x507514,_0xedbc('0x57')))[_0xedbc('0x2c')](function(){})['catch'](_0x2e59bd()));break;case'onlyIfOpen':_0x3eb083[_0xedbc('0x2d')](db['sequelize'][_0xedbc('0x56')](_0x10a475(_0x507514,'VoiceQueueId'))[_0xedbc('0x2c')](function(){})[_0xedbc('0x2f')](_0x2e59bd()));break;default:_0x3eb083[_0xedbc('0x2d')](db[_0xedbc('0x55')][_0xedbc('0x56')](_0x11c60f(_0x507514,_0xedbc('0x57')))['then'](function(){})[_0xedbc('0x2f')](_0x2e59bd()));}}}return _0x3eb083;})[_0xedbc('0x58')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xedbc('0x59')},'attributes':['id'],'include':[{'model':db[_0xedbc('0x50')],'as':_0xedbc('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x497ba6){var _0x2c9700=[];if(_0x497ba6){var _0x358024;for(var _0x3ef4e2=0x0,_0x4ebe46;_0x3ef4e2<_0x497ba6['length'];_0x3ef4e2+=0x1){_0x4ebe46=_0x497ba6[_0x3ef4e2][_0xedbc('0x52')]({'plain':!![]});_0x2c9700[_0xedbc('0x2d')](db[_0xedbc('0x55')]['query'](_0x2929fd(_0x4ebe46,_0xedbc('0x57')))['then'](function(){})[_0xedbc('0x2f')](_0x2e59bd()));}}return _0x2c9700;})[_0xedbc('0x58')]();})[_0xedbc('0x2c')](function(){return db[_0xedbc('0x5b')]['findAll']({'attributes':['id',_0xedbc('0x53')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xedbc('0x2c')](function(_0x238934){var _0x3f7839=[];if(_0x238934){for(var _0x2e5bc3=0x0,_0x3a2f42;_0x2e5bc3<_0x238934[_0xedbc('0x1d')];_0x2e5bc3+=0x1){_0x3a2f42=_0x238934[_0x2e5bc3][_0xedbc('0x52')]({'plain':!![]});switch(_0x3a2f42[_0xedbc('0x53')]){case'always':_0x3f7839[_0xedbc('0x2d')](db['sequelize'][_0xedbc('0x56')](_0x438cc4(_0x3a2f42,_0xedbc('0x5c')))[_0xedbc('0x2c')](function(){})[_0xedbc('0x2f')](_0x2e59bd()));break;case _0xedbc('0x5d'):_0x3f7839[_0xedbc('0x2d')](db[_0xedbc('0x55')][_0xedbc('0x56')](_0x10a475(_0x3a2f42,'CampaignId'))[_0xedbc('0x2c')](function(){})[_0xedbc('0x2f')](_0x2e59bd()));break;default:_0x3f7839['push'](db['sequelize'][_0xedbc('0x56')](_0x11c60f(_0x3a2f42,_0xedbc('0x5c')))[_0xedbc('0x2c')](function(){})[_0xedbc('0x2f')](_0x2e59bd()));}}}return _0x3f7839;})[_0xedbc('0x58')]();})[_0xedbc('0x2c')](function(){return db[_0xedbc('0x5b')][_0xedbc('0x5e')]({'attributes':['id'],'include':[{'model':db[_0xedbc('0x50')],'as':_0xedbc('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x171a32){var _0x4a9d8e=[];if(_0x171a32){for(var _0xa5b6b9=0x0,_0x8015af;_0xa5b6b9<_0x171a32[_0xedbc('0x1d')];_0xa5b6b9+=0x1){_0x8015af=_0x171a32[_0xa5b6b9]['get']({'plain':!![]});_0x4a9d8e[_0xedbc('0x2d')](db['sequelize'][_0xedbc('0x56')](_0x2929fd(_0x8015af,_0xedbc('0x5c')))['then'](function(){})[_0xedbc('0x2f')](_0x2e59bd()));}}return _0x4a9d8e;})['all']();})[_0xedbc('0x2f')](function(_0x64b67b){logger[_0xedbc('0x16')](_0xedbc('0x5f'),_0xedbc('0x60'),_0x64b67b['message']);});}var processPromises=function(_0x3507f1){return BPromise['all'](promises)[_0xedbc('0x2c')](function(_0x2cbb3f){})[_0xedbc('0x2f')](function(_0x50f2ba){logger[_0xedbc('0x16')](_0xedbc('0x61'),JSON[_0xedbc('0x31')](_0x50f2ba));})['finally'](function(){socket[_0xedbc('0x62')](_0xedbc('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3507f1){return _0x3507f1[_0xedbc('0x64')]();}});};var endCsv=function(){return BPromise[_0xedbc('0x65')]()[_0xedbc('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xedbc('0x2c')](function(){socket['emit'](_0xedbc('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xedbc('0x66')](FILEPATH);}catch(_0x4024ec){logger[_0xedbc('0x16')](_0xedbc('0x67'),JSON[_0xedbc('0x31')](_0x4024ec));}finally{process[_0xedbc('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0xedbc('0x69')](_0xedbc('0x6a'));endCsv();});function main(){return BPromise[_0xedbc('0x65')]()[_0xedbc('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xedbc('0x14')](',');return db[_0xedbc('0x2a')][_0xedbc('0x5e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xedbc('0x2c')](function(_0x2f3884){var _0x2111ae=fs[_0xedbc('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xedbc('0x6c')](_0x2111ae,{'header':!![],'skipEmptyLines':!![],'step':function(_0x24ec3f,_0x3bf17d){total+=0x1;var _0x2e23d8=total;promises['push'](checkRow(_0x24ec3f,_0x2f3884,_0x2e23d8)[_0xedbc('0x2c')](function(){success+=0x1;})[_0xedbc('0x2f')](function(_0x435ab7){if(_0x435ab7[_0xedbc('0x16')]){errors+=0x1;delete _0x435ab7['error'];}else if(_0x435ab7[_0xedbc('0x6d')]){duplicates+=0x1;delete _0x435ab7[_0xedbc('0x6d')];}rows[_0xedbc('0x2d')](_0x435ab7);}));if(total%0xc8===0x0){_0x3bf17d[_0xedbc('0x6e')]();return processPromises(_0x3bf17d);}},'complete':function(){return processPromises()[_0xedbc('0x2c')](function(){logger['info'](_0xedbc('0x6f'));endCsv();});},'error':function(_0x582114,_0x32bbba){logger[_0xedbc('0x69')](_0xedbc('0x70'),JSON[_0xedbc('0x31')](_0x582114));endCsv();}});})['catch'](function(_0x2735ca){logger[_0xedbc('0x16')](_0xedbc('0x71'),JSON['stringify'](_0x2735ca));});}main(); \ No newline at end of file +var _0xdf2a=['findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','sequelize','query','VoiceQueueId','catch','all','BlackLists','onlyIfOpen','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','create','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','fromQuery','ContactId','createdAt','select','field','phone','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','cm_hopper','scheduledAt','updatedAt','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','str','cm_hopper_black','VoiceQueue'];(function(_0x6a7880,_0x306b7f){var _0x28d4c1=function(_0x1dd272){while(--_0x1dd272){_0x6a7880['push'](_0x6a7880['shift']());}};_0x28d4c1(++_0x306b7f);}(_0xdf2a,0x90));var _0xadf2=function(_0x130755,_0x24c9ba){_0x130755=_0x130755-0x0;var _0x5e80b4=_0xdf2a[_0x130755];return _0x5e80b4;};'use strict';var BPromise=require(_0xadf2('0x0'));var util=require(_0xadf2('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xadf2('0x2'));var Papa=require(_0xadf2('0x3'));var Redis=require('ioredis');var db=require(_0xadf2('0x4'))['db'];var config=require(_0xadf2('0x5'));var logger=require(_0xadf2('0x6'))('api');config[_0xadf2('0x7')]=_[_0xadf2('0x8')](config['redis'],{'host':_0xadf2('0x9'),'port':0x18eb});var socket=require(_0xadf2('0xa'))(new Redis(config[_0xadf2('0x7')]));require(_0xadf2('0xb'))[_0xadf2('0xc')](socket);try{if(!process['argv'][0x2]||process[_0xadf2('0xd')][0x2]==='undefined'||process[_0xadf2('0xd')][0x2]===_0xadf2('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xadf2('0xd')][0x2];if(!process[_0xadf2('0xd')][0x3]||process[_0xadf2('0xd')][0x3]===_0xadf2('0xf')||process[_0xadf2('0xd')][0x3]==='null'||!process[_0xadf2('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0xadf2('0xd')][0x4]===_0xadf2('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xadf2('0x10')](process[_0xadf2('0xd')][0x3][_0xadf2('0x11')](','),process[_0xadf2('0xd')][0x4][_0xadf2('0x11')](','));if(!process[_0xadf2('0xd')][0x5]||process[_0xadf2('0xd')][0x5]===_0xadf2('0xf')||process[_0xadf2('0xd')][0x5]===_0xadf2('0xe')){throw new Error(_0xadf2('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xadf2('0xd')][0x6]!=='undefined'&&process[_0xadf2('0xd')][0x6]!==_0xadf2('0xe')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xadf2('0xd')][0x7]!==_0xadf2('0xf')&&process['argv'][0x7]!==_0xadf2('0xe')?process[_0xadf2('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0xadf2('0xd')][0x8]===_0xadf2('0xf')||process[_0xadf2('0xd')][0x8]==='null'){throw new Error(_0xadf2('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x18cba6){logger[_0xadf2('0x14')](_0x18cba6);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(_0x11cc5e,_0x314571,_0x5e3ee0,_0x473e6d){var _0x314a55={'message':_0x314571};_0x314a55[_0x11cc5e]=!![];if(_0x5e3ee0){_0x314a55[_0xadf2('0x15')]=_0x5e3ee0;}if(_0x473e6d){_0x314a55[_0xadf2('0x16')]=_0x473e6d;}return _0x314a55;}function isEmail(_0x4e17f4){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))*$/[_0xadf2('0x17')](_0x4e17f4);}function checkRow(_0xdf839c,_0x2d9716,_0x2170c1){return new BPromise(function(_0x3f7b71,_0x12a10c){if(_[_0xadf2('0x18')](_0xdf839c)){return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),_0xadf2('0x19'),null,_0x2170c1));}if(_0xdf839c[_0xadf2('0x1a')]&&_0xdf839c[_0xadf2('0x1a')]['length']){var _0x18ba32=_[_0xadf2('0x1b')](_0xdf839c[_0xadf2('0x1a')],_0xadf2('0x1c'))[_0xadf2('0x1d')](';');return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),_0x18ba32,null,_0x2170c1));}var _0x1a1cfd={};for(var _0x2cf5fd in FIELDS){if(FIELDS[_0xadf2('0x1e')](_0x2cf5fd)&&FIELDS[_0x2cf5fd]){_0x1a1cfd[_0x2cf5fd]=_0xdf839c[_0xadf2('0x1f')][0x0][FIELDS[_0x2cf5fd]]||_0xdf839c['data'][0x0]['\ufeff'+FIELDS[_0x2cf5fd]];}}if(!_0x1a1cfd[_0xadf2('0x20')]){return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),_0xadf2('0x21'),null,_0x2170c1));}if(!_0x1a1cfd['phone']){return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),_0xadf2('0x22'),null,_0x2170c1));}if(_0x1a1cfd[_0xadf2('0x23')]){var _0x4ab320=moment(_0x1a1cfd['birthDate'],_0xadf2('0x24'));if(!_0x4ab320['isValid']()){return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),_0xadf2('0x25'),null,_0x2170c1));}}if(_0x1a1cfd['email']){if(!isEmail(_0x1a1cfd[_0xadf2('0x26')])){return _0x12a10c(handleCheckRowError(_0xadf2('0x14'),'email\x20format\x20is\x20not\x20valid!',null,_0x2170c1));}}_0x1a1cfd[_0xadf2('0x27')]=LISTID;_0x1a1cfd[_0xadf2('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xadf2('0x29')]&&_0x2d9716){var _0x27a571={};for(var _0x1de968=0x0,_0x27d0be=DUPLICATES['length'];_0x1de968<_0x27d0be;_0x1de968+=0x1){_0x27a571[DUPLICATES[_0x1de968]]=_0x1a1cfd[DUPLICATES[_0x1de968]];}var _0x3f2dc9=_['find'](_0x2d9716,_0x27a571);if(_0x3f2dc9){return _0x12a10c(handleCheckRowError('duplicate',_0xadf2('0x2a'),_0x3f2dc9,_0x2170c1));}}return db[_0xadf2('0x2b')][_0xadf2('0x2c')](_0x1a1cfd,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1a1cfd)})['then'](function(_0x300021){if(DUPLICATES&&DUPLICATES[_0xadf2('0x29')]&&_0x2d9716){_0x2d9716[_0xadf2('0x2d')](_[_0xadf2('0x2e')](_0x1a1cfd,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x300021['id'];return _0x3f7b71();})['catch'](function(_0x567c80){return _0x12a10c(handleCheckRowError('error',_0xadf2('0x2f')+(_0x567c80[_0xadf2('0x1c')]||JSON['stringify'](_0x567c80)),null,_0x2170c1));});});}function checkHopper(){function _0x4577d3(){return function(_0x16cb80){logger['error'](_0xadf2('0x30'),_0xadf2('0x31'),util[_0xadf2('0x32')](_0x16cb80,{'showHidden':![],'depth':null}));};}var _0x185aa0=function(_0x17e84f,_0x127c4d){var _0x793ffc=squel[_0xadf2('0x33')]()[_0xadf2('0x34')]('cm_hopper')[_0xadf2('0x35')](['phone','scheduledAt',_0xadf2('0x36'),_0xadf2('0x27'),_0x127c4d,_0xadf2('0x37'),'updatedAt'],squel[_0xadf2('0x38')]()[_0xadf2('0x39')]('phone',_0xadf2('0x3a'))['field']('NOW()','scheduledAt')[_0xadf2('0x39')]('id',_0xadf2('0x36'))['field'](LISTID[_0xadf2('0x3b')](),_0xadf2('0x27'))[_0xadf2('0x39')](_0x17e84f['id']['toString'](),_0x127c4d)[_0xadf2('0x39')](_0xadf2('0x3c'),_0xadf2('0x37'))[_0xadf2('0x39')](_0xadf2('0x3c'),'updatedAt')[_0xadf2('0x3d')](_0xadf2('0x3e'))['where'](_0xadf2('0x3f'))['where'](_0xadf2('0x40'),LISTID[_0xadf2('0x3b')]())[_0xadf2('0x41')](_0xadf2('0x42'))[_0xadf2('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xadf2('0x38')]()[_0xadf2('0x39')](_0xadf2('0x3a'))['from'](_0xadf2('0x43'))['where'](_0x127c4d+'\x20=\x20?',_0x17e84f['id'][_0xadf2('0x3b')]())))['toString']();return _0x793ffc;};var _0x152937=function(_0x296fbc,_0x1b4d08){var _0x4ca905=squel['insert']()['into'](_0xadf2('0x43'))[_0xadf2('0x35')]([_0xadf2('0x3a'),_0xadf2('0x44'),_0xadf2('0x36'),_0xadf2('0x27'),_0x1b4d08,_0xadf2('0x37'),_0xadf2('0x45')],squel[_0xadf2('0x38')]()['field'](_0xadf2('0x3a'),_0xadf2('0x3a'))[_0xadf2('0x39')]('NOW()',_0xadf2('0x44'))['field']('id',_0xadf2('0x36'))[_0xadf2('0x39')](LISTID[_0xadf2('0x3b')](),'ListId')[_0xadf2('0x39')](_0x296fbc['id'][_0xadf2('0x3b')](),_0x1b4d08)['field'](_0xadf2('0x3c'),'createdAt')['field'](_0xadf2('0x3c'),_0xadf2('0x45'))['from']('cm_contacts')[_0xadf2('0x41')](_0xadf2('0x3f'))[_0xadf2('0x41')](_0xadf2('0x40'),LISTID[_0xadf2('0x3b')]())[_0xadf2('0x41')](_0xadf2('0x46'),squel['str'](hopperContacts))[_0xadf2('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0xadf2('0x41')](_0xadf2('0x47'),squel[_0xadf2('0x38')]()[_0xadf2('0x39')]('calleridnum')[_0xadf2('0x3d')](_0xadf2('0x48'))[_0xadf2('0x41')](_0x1b4d08+'\x20=\x20?',_0x296fbc['id'][_0xadf2('0x3b')]()))[_0xadf2('0x41')](_0xadf2('0x47'),squel[_0xadf2('0x38')]()['field'](_0xadf2('0x3a'))[_0xadf2('0x3d')](_0xadf2('0x43'))[_0xadf2('0x41')](_0x1b4d08+'\x20=\x20?',_0x296fbc['id'][_0xadf2('0x3b')]())))[_0xadf2('0x3b')]();return _0x4ca905;};function _0x5e2c34(_0x2c4ee5,_0x38f0a8){var _0x21815e=squel['insert']()['into'](_0xadf2('0x43'))[_0xadf2('0x35')](['phone',_0xadf2('0x44'),_0xadf2('0x36'),_0xadf2('0x27'),_0x38f0a8,_0xadf2('0x37'),_0xadf2('0x45')],squel[_0xadf2('0x38')]()['field']('phone',_0xadf2('0x3a'))[_0xadf2('0x39')](_0xadf2('0x3c'),'scheduledAt')[_0xadf2('0x39')]('id',_0xadf2('0x36'))[_0xadf2('0x39')](LISTID[_0xadf2('0x3b')](),'ListId')[_0xadf2('0x39')](_0x2c4ee5['id']['toString'](),_0x38f0a8)[_0xadf2('0x39')]('NOW()','createdAt')[_0xadf2('0x39')](_0xadf2('0x3c'),_0xadf2('0x45'))['from']('cm_contacts')['where'](_0xadf2('0x3f'))['where'](_0xadf2('0x40'),LISTID[_0xadf2('0x3b')]())[_0xadf2('0x41')](_0xadf2('0x46'),squel[_0xadf2('0x49')](hopperContacts))['where'](_0xadf2('0x42')))[_0xadf2('0x3b')]();return _0x21815e;}function _0x2fbf2d(_0x4fe202,_0xe4999){var _0x5eeac5=squel[_0xadf2('0x33')]()[_0xadf2('0x34')](_0xadf2('0x4a'))[_0xadf2('0x35')](['phone',_0xadf2('0x36'),_0xadf2('0x27'),_0xe4999,_0xadf2('0x37'),_0xadf2('0x45')],squel[_0xadf2('0x38')]()[_0xadf2('0x39')](_0xadf2('0x3a'),_0xadf2('0x3a'))[_0xadf2('0x39')]('id','ContactId')[_0xadf2('0x39')](LISTID[_0xadf2('0x3b')](),'ListId')[_0xadf2('0x39')](_0x4fe202['id'][_0xadf2('0x3b')](),_0xe4999)[_0xadf2('0x39')]('NOW()',_0xadf2('0x37'))['field'](_0xadf2('0x3c'),_0xadf2('0x45'))['from'](_0xadf2('0x3e'))['where'](_0xadf2('0x3f'))[_0xadf2('0x41')](_0xadf2('0x40'),LISTID[_0xadf2('0x3b')]())[_0xadf2('0x41')](_0xadf2('0x46'),squel[_0xadf2('0x49')](hopperContacts))[_0xadf2('0x41')](_0xadf2('0x42')))[_0xadf2('0x3b')]();return _0x5eeac5;}return db[_0xadf2('0x4b')][_0xadf2('0x4c')]({'where':{'type':_0xadf2('0x4d')},'attributes':['id',_0xadf2('0x4e')],'include':[{'model':db[_0xadf2('0x4f')],'as':_0xadf2('0x50'),'where':{'id':LISTID}}]})[_0xadf2('0x51')](function(_0x434196){var _0x66f6f8=[];if(_0x434196){var _0x371a21;for(var _0x5b2226=0x0,_0xc05cd6;_0x5b2226<_0x434196['length'];_0x5b2226+=0x1){_0xc05cd6=_0x434196[_0x5b2226][_0xadf2('0x52')]({'plain':!![]});switch(_0xc05cd6[_0xadf2('0x4e')]){case'always':_0x66f6f8[_0xadf2('0x2d')](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x152937(_0xc05cd6,_0xadf2('0x55')))['then'](function(){})['catch'](_0x4577d3()));break;case'onlyIfOpen':_0x66f6f8[_0xadf2('0x2d')](db['sequelize'][_0xadf2('0x54')](_0x185aa0(_0xc05cd6,_0xadf2('0x55')))[_0xadf2('0x51')](function(){})[_0xadf2('0x56')](_0x4577d3()));break;default:_0x66f6f8['push'](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x5e2c34(_0xc05cd6,_0xadf2('0x55')))['then'](function(){})[_0xadf2('0x56')](_0x4577d3()));}}}return _0x66f6f8;})[_0xadf2('0x57')]()[_0xadf2('0x51')](function(){return db[_0xadf2('0x4b')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xadf2('0x4f')],'as':_0xadf2('0x58'),'where':{'id':LISTID}}]})[_0xadf2('0x51')](function(_0x27aab9){var _0x48b720=[];if(_0x27aab9){var _0x2528b4;for(var _0x3a73d1=0x0,_0x3915cf;_0x3a73d1<_0x27aab9['length'];_0x3a73d1+=0x1){_0x3915cf=_0x27aab9[_0x3a73d1][_0xadf2('0x52')]({'plain':!![]});_0x48b720[_0xadf2('0x2d')](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x2fbf2d(_0x3915cf,_0xadf2('0x55')))[_0xadf2('0x51')](function(){})[_0xadf2('0x56')](_0x4577d3()));}}return _0x48b720;})[_0xadf2('0x57')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id',_0xadf2('0x4e')],'include':[{'model':db[_0xadf2('0x4f')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x197c38){var _0x555614=[];if(_0x197c38){for(var _0x20cbfc=0x0,_0x63f5f4;_0x20cbfc<_0x197c38[_0xadf2('0x29')];_0x20cbfc+=0x1){_0x63f5f4=_0x197c38[_0x20cbfc][_0xadf2('0x52')]({'plain':!![]});switch(_0x63f5f4[_0xadf2('0x4e')]){case'always':_0x555614[_0xadf2('0x2d')](db[_0xadf2('0x53')]['query'](_0x152937(_0x63f5f4,'CampaignId'))[_0xadf2('0x51')](function(){})[_0xadf2('0x56')](_0x4577d3()));break;case _0xadf2('0x59'):_0x555614[_0xadf2('0x2d')](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x185aa0(_0x63f5f4,'CampaignId'))['then'](function(){})[_0xadf2('0x56')](_0x4577d3()));break;default:_0x555614[_0xadf2('0x2d')](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x5e2c34(_0x63f5f4,'CampaignId'))[_0xadf2('0x51')](function(){})[_0xadf2('0x56')](_0x4577d3()));}}}return _0x555614;})['all']();})[_0xadf2('0x51')](function(){return db[_0xadf2('0x5a')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xadf2('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x51c525){var _0x414428=[];if(_0x51c525){for(var _0x6c613e=0x0,_0x493eae;_0x6c613e<_0x51c525['length'];_0x6c613e+=0x1){_0x493eae=_0x51c525[_0x6c613e]['get']({'plain':!![]});_0x414428['push'](db[_0xadf2('0x53')][_0xadf2('0x54')](_0x2fbf2d(_0x493eae,_0xadf2('0x5b')))['then'](function(){})[_0xadf2('0x56')](_0x4577d3()));}}return _0x414428;})['all']();})[_0xadf2('0x56')](function(_0xefd485){logger[_0xadf2('0x14')](_0xadf2('0x5c'),_0xadf2('0x5d'),_0xefd485['message']);});}var processPromises=function(_0x273765){return BPromise[_0xadf2('0x57')](promises)[_0xadf2('0x51')](function(_0x5d817e){})[_0xadf2('0x56')](function(_0x39f866){logger[_0xadf2('0x14')](_0xadf2('0x5e'),JSON['stringify'](_0x39f866));})[_0xadf2('0x5f')](function(){socket[_0xadf2('0x60')](_0xadf2('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x273765){return _0x273765[_0xadf2('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xadf2('0x51')](function(){if(hopperContacts){return checkHopper();}})[_0xadf2('0x51')](function(){socket['emit'](_0xadf2('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xadf2('0x63')](FILEPATH);}catch(_0x1a34a0){logger[_0xadf2('0x14')](_0xadf2('0x64'),JSON[_0xadf2('0x65')](_0x1a34a0));}finally{process['exit'](0x0);}});};process['on'](_0xadf2('0x66'),function(){logger['info'](_0xadf2('0x67'));endCsv();});function main(){return BPromise[_0xadf2('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xadf2('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x125cd7){var _0x5b1e1a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xadf2('0x69')](_0x5b1e1a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x387429,_0x8e2346){total+=0x1;var _0xc4b3b=total;promises[_0xadf2('0x2d')](checkRow(_0x387429,_0x125cd7,_0xc4b3b)['then'](function(){success+=0x1;})['catch'](function(_0x5a74f5){if(_0x5a74f5[_0xadf2('0x14')]){errors+=0x1;delete _0x5a74f5[_0xadf2('0x14')];}else if(_0x5a74f5[_0xadf2('0x6a')]){duplicates+=0x1;delete _0x5a74f5[_0xadf2('0x6a')];}rows[_0xadf2('0x2d')](_0x5a74f5);}));if(total%0xc8===0x0){_0x8e2346[_0xadf2('0x6b')]();return processPromises(_0x8e2346);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x743479,_0xb5527b){logger['info'](_0xadf2('0x6c'),JSON['stringify'](_0x743479));endCsv();}});})[_0xadf2('0x56')](function(_0x47a854){logger[_0xadf2('0x14')](_0xadf2('0x6d'),JSON[_0xadf2('0x65')](_0x47a854));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index a8090e8..ed4b1bf 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 _0xa786=['cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','length','push','split','all','isNil','filter','CmContactHasItem','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper','insert','cm_hopper_black','ListId\x20=\x20?','toString','.offset-cm_contacts.utcOffset\x20minute)','recallme','cm_hopper.id'];(function(_0x2569dc,_0x4355b9){var _0x1c5622=function(_0x49cb7e){while(--_0x49cb7e){_0x2569dc['push'](_0x2569dc['shift']());}};_0x1c5622(++_0x4355b9);}(_0xa786,0x71));var _0x6a78=function(_0x775d18,_0x5407b0){_0x775d18=_0x775d18-0x0;var _0x16ab57=_0xa786[_0x775d18];return _0x16ab57;};'use strict';var fs=require('fs');var path=require(_0x6a78('0x0'));var _=require(_0x6a78('0x1'));var Papa=require(_0x6a78('0x2'));var util=require('util');var BPromise=require(_0x6a78('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x6a78('0x4'));var db=require(_0x6a78('0x5'))['db'];var config=require(_0x6a78('0x6'));var shared=require(_0x6a78('0x7'));var logger=require(_0x6a78('0x8'))(_0x6a78('0x9'));config[_0x6a78('0xa')]=_['defaults'](config[_0x6a78('0xa')],{'host':_0x6a78('0xb'),'port':0x18eb});var socket=require(_0x6a78('0xc'))(new Redis(config[_0x6a78('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6a78('0xd')](_0x6a78('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x6a78('0xd')](_0x6a78('0xe'));function isEmail(_0x43e233){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'](_0x43e233);}function selectNotIn(_0x25b436,_0x1fca69,_0x1d0fac,_0x562d96,_0x2a433a){return squel[_0x6a78('0xf')]()[_0x6a78('0x10')](_0x6a78('0x11'))[_0x6a78('0x12')](_0x562d96)['join'](_0x1fca69,null,_0x1fca69+_0x6a78('0x13')+_0x562d96+'.'+_0x1d0fac)[_0x6a78('0x14')](_0x562d96+'.'+_0x1d0fac+_0x6a78('0x15')+_0x25b436+'.'+_0x1d0fac)['where'](_0x1fca69+_0x6a78('0x16')+_0x2a433a[_0x6a78('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4c5351,_0x476d18){promisesAdditionalPhones=[];return db[_0x6a78('0x18')][_0x6a78('0x19')]({'raw':!![],'attributes':['id',_0x6a78('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6a78('0x1b')](function(_0x36e824){if(_0x36e824!==null){var _0x4e9031=[];for(var _0x27d687=0x0;_0x27d687<_0x36e824[_0x6a78('0x1c')];_0x27d687++){var _0x4746c0=_0x36e824[_0x27d687];_0x4e9031[_0x6a78('0x1d')](insertAdditionalPhones(_0x4746c0));}}Promise['all'](_0x4e9031)['then'](function(){_0x4c5351({'val':0x1});});});});}function insertAdditionalPhones(_0x460991){return new Promise(function(_0x585917,_0x5be128){var _0x4efb20=_0x460991[_0x6a78('0x1a')];var _0xed3863=_0x4efb20[_0x6a78('0x1e')](';');var _0x5e7922=[];orderBy=0x0;for(var _0x552e8f=0x0;_0x552e8f<_0xed3863[_0x6a78('0x1c')];_0x552e8f++){_0x5e7922[_0x6a78('0x1d')](splitAdditionalPhone(_0x460991['id'],_0xed3863[_0x552e8f]));}Promise[_0x6a78('0x1f')](_0x5e7922)[_0x6a78('0x1b')](function(){_0x585917({'val':_0xed3863['length']});});});}function splitAdditionalPhone(_0x5e7c1e,_0x4bd03c){return new Promise(function(_0xd57884,_0x5869fd){var _0xd938cd=_0x4bd03c[_0x6a78('0x1e')](':');var _0x107cda=_0xd938cd[0x0];var _0x4b47b6=_0xd938cd[0x1];if(!_[_0x6a78('0x20')](_0x4b47b6)){var _0xa5f42f=_0x4b47b6[_0x6a78('0x1e')]('|');var _0x2a363f=[];for(var _0x246f6c=0x0;_0x246f6c<_0xa5f42f[_0x6a78('0x1c')];_0x246f6c++){if(_0xa5f42f[_0x246f6c]!==''){var _0x401ff9=_[_0x6a78('0x21')](promisesAdditionalPhones,{'contactId':_0x5e7c1e,'phone':_0xa5f42f[_0x246f6c]});if(_0x401ff9['length']==0x0){orderBy++;promisesAdditionalPhones[_0x6a78('0x1d')]({'contactId':_0x5e7c1e,'contactTypeId':_0x107cda,'phone':_0xa5f42f[_0x246f6c],'orderBy':orderBy});}}}_0xd57884({'ok':0x1});}else _0xd57884({'res':0x0});});}function createAdditionalPhone(_0xf17e35,_0x1e91ad,_0x57a859,_0x19860c){var _0x47bb83='';var _0xbe2627='';var _0x196b81=_0x57a859['split']('§');_0x47bb83=_0x196b81[0x0];if(_0x196b81[_0x6a78('0x1c')]==0x2)_0xbe2627=_0x196b81[0x1];return new Promise(function(_0x159b96,_0xfdd266){return db[_0x6a78('0x22')]['findOne']({'where':{'CmContactId':_0xf17e35,'item':_0x47bb83}})[_0x6a78('0x1b')](function(_0x125ca2){if(_0x125ca2){return db[_0x6a78('0x22')][_0x6a78('0x23')]({'ItemTypeId':_0x1e91ad,'description':_0xbe2627,'OrderBy':_0x19860c},{'where':{'CmContactId':_0xf17e35,'item':_0x47bb83}})['then'](function(_0x1389d9){_0x159b96({'res':_0x6a78('0x24')});});}else{return db[_0x6a78('0x22')]['create']({'CmContactId':_0xf17e35,'item':_0x47bb83,'description':_0xbe2627,'ItemTypeId':_0x1e91ad,'OrderBy':_0x19860c,'ItemClass':_0x6a78('0x25')})[_0x6a78('0x1b')](function(_0x4f89b5){_0x159b96({'res':_0x6a78('0x26')});});}});});}function insertCmHopper(_0xc39fee,_0x232c1c,_0xc40df3,_0x356e32,_0x4d5fa4){var _0x42296a=[_0x6a78('0x27'),'cm_contacts.scheduledat',_0x6a78('0x28'),_0x6a78('0x29'),_0x232c1c+'.'+_0x356e32,_0x6a78('0x2a'),_0x6a78('0x2b'),_0x6a78('0x2c'),_0x6a78('0x2d'),'\x22'+_0x4d5fa4+'\x22'];return squel['insert']()[_0x6a78('0x2e')]('cm_hopper')[_0x6a78('0x2f')]([_0x6a78('0x11'),_0x6a78('0x30'),_0x6a78('0x31'),_0x6a78('0x32'),_0x356e32,_0x6a78('0x33'),_0x6a78('0x34'),_0x6a78('0x35'),_0x6a78('0x36'),'recallme'],squel['select']()[_0x6a78('0x37')](_0x42296a)['from'](_0x232c1c)[_0x6a78('0x17')](_0x6a78('0x38'),null,_0x6a78('0x39')+_0x232c1c+_0x6a78('0x3a'))[_0x6a78('0x17')](_0xc40df3,null,_0xc40df3+_0x6a78('0x13')+_0x232c1c+'.'+_0x356e32)[_0x6a78('0x14')](_0x232c1c+_0x6a78('0x3b'),_0xc39fee)['where'](_0x6a78('0x3c'),NOW)[_0x6a78('0x14')](_0x6a78('0x3d'),selectNotIn(_0x232c1c,_0xc40df3,_0x356e32,'cm_hopper',[_0x6a78('0x3e'),'\x22onlyIfOpen\x22']))[_0x6a78('0x14')](_0x6a78('0x3d'),selectNotIn(_0x232c1c,_0xc40df3,_0x356e32,_0x6a78('0x3f'),[_0x6a78('0x3e')])))['toString']();}function insertCmHopperBlack(_0x5a6dd6,_0x4a15e9,_0x716729,_0xf25c9b){var _0x48eafa=[_0x6a78('0x27'),_0x6a78('0x28'),_0x6a78('0x29'),_0x4a15e9+'.'+_0xf25c9b,_0x6a78('0x2a'),_0x6a78('0x2b')];return squel[_0x6a78('0x40')]()['into'](_0x6a78('0x41'))[_0x6a78('0x2f')]([_0x6a78('0x11'),_0x6a78('0x31'),_0x6a78('0x32'),_0xf25c9b,_0x6a78('0x33'),_0x6a78('0x34')],squel['select']()[_0x6a78('0x37')](_0x48eafa)['from'](_0x4a15e9)[_0x6a78('0x17')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x4a15e9+_0x6a78('0x3a'))[_0x6a78('0x17')](_0x716729,null,_0x716729+'.id\x20=\x20'+_0x4a15e9+'.'+_0xf25c9b)[_0x6a78('0x14')](_0x4a15e9+_0x6a78('0x3b'),_0x5a6dd6)[_0x6a78('0x14')](_0x6a78('0x3c'),NOW)[_0x6a78('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6a78('0x10')](_0x6a78('0x11'))[_0x6a78('0x12')](_0x6a78('0x41'))[_0x6a78('0x14')](_0x6a78('0x42'),_0x5a6dd6)[_0x6a78('0x14')](_0xf25c9b+'\x20=\x20'+_0x4a15e9+'.'+_0xf25c9b)))[_0x6a78('0x43')]();}function insertTzCmHopper(_0x41e924,_0x4d9092,_0x2f4e70,_0x22a584,_0x2ad4c4,_0x4732b7){var _0x33a221=[_0x6a78('0x27'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x4732b7+_0x6a78('0x44'),_0x6a78('0x28'),_0x6a78('0x29'),_0x4d9092+'.'+_0x22a584,_0x6a78('0x2a'),_0x6a78('0x2b'),'cm_contacts.priority',_0x6a78('0x2d'),'\x22'+_0x2ad4c4+'\x22'];var _0x59a4c1=squel[_0x6a78('0x40')]()[_0x6a78('0x2e')]('cm_hopper')[_0x6a78('0x2f')](['phone',_0x6a78('0x30'),_0x6a78('0x31'),_0x6a78('0x32'),_0x22a584,_0x6a78('0x33'),_0x6a78('0x34'),'priority','UserId',_0x6a78('0x45')],squel[_0x6a78('0xf')]()[_0x6a78('0x37')](_0x33a221)[_0x6a78('0x12')](_0x4d9092)['join'](_0x6a78('0x38'),null,_0x6a78('0x39')+_0x4d9092+_0x6a78('0x3a'))['join'](_0x2f4e70,null,_0x2f4e70+'.id\x20=\x20'+_0x4d9092+'.'+_0x22a584)[_0x6a78('0x17')](_0x4732b7,null,_0x4732b7+'.id\x20=\x20'+_0x4d9092+'.'+_0x22a584)['where'](_0x4d9092+_0x6a78('0x3b'),_0x41e924)[_0x6a78('0x14')](_0x6a78('0x3c'),NOW)[_0x6a78('0x14')](_0x6a78('0x3d'),selectNotIn(_0x4d9092,_0x2f4e70,_0x22a584,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x6a78('0x14')](_0x6a78('0x3d'),selectNotIn(_0x4d9092,_0x2f4e70,_0x22a584,_0x6a78('0x3f'),['\x22always\x22'])))[_0x6a78('0x43')]();return _0x59a4c1;}function insertTzCmHopperBlack(_0x2ff842,_0x5b1da3,_0x4e486f,_0x318d47){var _0x2a50df=[_0x6a78('0x27'),_0x6a78('0x28'),_0x6a78('0x29'),_0x5b1da3+'.'+_0x318d47,_0x6a78('0x2a'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x6a78('0x41'))['fromQuery']([_0x6a78('0x11'),_0x6a78('0x31'),_0x6a78('0x32'),_0x318d47,_0x6a78('0x33'),'updatedAt'],squel[_0x6a78('0xf')]()[_0x6a78('0x37')](_0x2a50df)['from'](_0x5b1da3)[_0x6a78('0x17')](_0x6a78('0x38'),null,_0x6a78('0x39')+_0x5b1da3+_0x6a78('0x3a'))[_0x6a78('0x17')](_0x4e486f,null,_0x4e486f+'.id\x20=\x20'+_0x5b1da3+'.'+_0x318d47)[_0x6a78('0x14')](_0x5b1da3+_0x6a78('0x3b'),_0x2ff842)[_0x6a78('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6a78('0x3d'),squel[_0x6a78('0xf')]()['field'](_0x6a78('0x11'))[_0x6a78('0x12')](_0x6a78('0x41'))[_0x6a78('0x14')](_0x6a78('0x42'),_0x2ff842)[_0x6a78('0x14')](_0x318d47+'\x20=\x20'+_0x5b1da3+'.'+_0x318d47)))['toString']();}function insertCmHopperAdditionalPhones(_0x1e4929){var _0x9fd4f3=[_0x6a78('0x46'),_0x6a78('0x47'),_0x6a78('0x48'),_0x6a78('0x49'),_0x6a78('0x4a')];return squel[_0x6a78('0x40')]()[_0x6a78('0x2e')](_0x6a78('0x4b'))[_0x6a78('0x2f')](['CmHopperId',_0x6a78('0x11'),_0x6a78('0x4c'),_0x6a78('0x33'),_0x6a78('0x34')],squel[_0x6a78('0xf')]()['fields'](_0x9fd4f3)[_0x6a78('0x12')](_0x6a78('0x3f'))[_0x6a78('0x17')](_0x6a78('0x38'),null,_0x6a78('0x4d'))[_0x6a78('0x17')](_0x6a78('0x4e'),null,_0x6a78('0x4f'))[_0x6a78('0x14')]('cm_hopper.ListId\x20=\x20?',_0x1e4929)[_0x6a78('0x14')](_0x6a78('0x3c'),NOW))[_0x6a78('0x43')]();}function insertCmContact(_0x3d370b,_0x462f83,_0x3a2d8a,_0x18beeb){var _0x2f7807=_[_0x6a78('0x50')](_[_0x6a78('0x51')](_0x18beeb),[_0x6a78('0x32'),_0x6a78('0x52'),_0x6a78('0x33'),_0x6a78('0x34')]);return squel['insert']()[_0x6a78('0x2e')](_0x6a78('0x38'))[_0x6a78('0x2f')](_0x2f7807,squel[_0x6a78('0xf')]()['fields'](_0x2f7807)['from'](_0x462f83)[_0x6a78('0x14')]('('+_0x3a2d8a[_0x6a78('0x17')](',')+_0x6a78('0x53'),squel[_0x6a78('0xf')]()[_0x6a78('0x37')](_0x3a2d8a)['from'](_0x6a78('0x38'))[_0x6a78('0x14')](_0x6a78('0x42'),_0x3d370b)[_0x6a78('0x14')]('deletedAt\x20IS\x20NULL'))[_0x6a78('0x14')](_0x6a78('0x54'),squel[_0x6a78('0xf')]()['field']('MIN(id)',_0x6a78('0x55'))['from'](_0x462f83)[_0x6a78('0x56')](_0x3a2d8a[_0x6a78('0x17')](','))))[_0x6a78('0x43')]();}function handleStop(){logger[_0x6a78('0x57')](_0x6a78('0x58'));stopped=!![];}function handleUncaughtException(_0x3391f1){logger[_0x6a78('0x59')](_0x3391f1['message']);process[_0x6a78('0x5a')](0x1);}function handleError(_0x364144,_0x27fcce){stats[_0x6a78('0x5b')][_0x6a78('0x1d')]({'name':_0x27fcce[_0x6a78('0x5c')],'message':_0x27fcce[_0x6a78('0x5d')],'row':_0x364144});}function handleQuery(_0x3044a4){logger[_0x6a78('0x57')](_0x3044a4);return db[_0x6a78('0x5e')]['query'](_0x3044a4)[_0x6a78('0x5f')](function(_0x10a5f0){results['push'](_0x10a5f0);})[_0x6a78('0x60')](function(_0x297714){logger['error'](_0x297714[_0x6a78('0x5d')]);});}function updateTzCampaigns(_0x4c9117){return new Promise(function(_0x35c4de,_0x4b06eb){var _0x311f79=squel[_0x6a78('0xf')]()[_0x6a78('0x37')]([_0x6a78('0x61'),_0x6a78('0x62')])['from']('campaigns')[_0x6a78('0x17')](_0x6a78('0x63'),null,_0x6a78('0x64'))[_0x6a78('0x14')](_0x6a78('0x65')+_0x4c9117);db['sequelize'][_0x6a78('0x66')](_0x311f79[_0x6a78('0x43')]())['spread'](function(_0x37a323){var _0x176a52=[];for(var _0x51385f=0x0;_0x51385f<_0x37a323[_0x6a78('0x1c')];_0x51385f++){_0x176a52[_0x6a78('0x1d')](getTimezoneData(_0x37a323[_0x51385f],tmp_campaigns));}BPromise[_0x6a78('0x1f')](_0x176a52)[_0x6a78('0x1b')](function(){_0x35c4de({'val':0x1});});})[_0x6a78('0x60')](function(_0x11ce9d){logger[_0x6a78('0x59')](_0x11ce9d[_0x6a78('0x5d')]);_0x35c4de({'val':0x0});});});}function updateTzVoiceQueues(_0x1f2be2){return new Promise(function(_0x217ed2,_0x4b5ad9){var _0x572089=squel[_0x6a78('0xf')]()['fields']([_0x6a78('0x67'),_0x6a78('0x68')])[_0x6a78('0x12')](_0x6a78('0x69'))[_0x6a78('0x17')](_0x6a78('0x6a'),null,_0x6a78('0x6b'))['where'](_0x6a78('0x6c')+_0x1f2be2);db[_0x6a78('0x5e')][_0x6a78('0x66')](_0x572089['toString']())[_0x6a78('0x5f')](function(_0x31b825){var _0x1e3756=[];for(var _0x55557d=0x0;_0x55557d<_0x31b825[_0x6a78('0x1c')];_0x55557d++){_0x1e3756[_0x6a78('0x1d')](getTimezoneData(_0x31b825[_0x55557d],tmp_voice_queues));}BPromise[_0x6a78('0x1f')](_0x1e3756)[_0x6a78('0x1b')](function(){_0x217ed2({'val':0x1});});})[_0x6a78('0x60')](function(_0x1812aa){logger['error'](_0x1812aa['message']);_0x217ed2({'val':0x0});});});}function getTimezoneData(_0x4b59ef,_0x1e1a2e){return new Promise(function(_0x3d3038,_0x416c0a){var _0x2846fd=shared[_0x6a78('0x6d')];var _0x367bbd=_0x2846fd[_0x4b59ef['dialTimezone']];if(_[_0x6a78('0x20')](_0x367bbd)){_0x3d3038({'ret':0x1});}else{var _0x39190c=_0x367bbd[_0x6a78('0x6e')];var _0x3b374d=squel[_0x6a78('0x40')]()[_0x6a78('0x2e')](_0x1e1a2e)[_0x6a78('0x6f')]('id',_0x4b59ef['id'])['set'](_0x6a78('0x70'),_0x39190c)[_0x6a78('0x6f')]('dialTimezone',_0x4b59ef[_0x6a78('0x71')])[_0x6a78('0x43')]();return db[_0x6a78('0x5e')][_0x6a78('0x66')](_0x3b374d)['spread'](function(_0x389193){_0x3d3038({'ret':0x1});})[_0x6a78('0x60')](function(_0x58d209){logger['error'](_0x58d209[_0x6a78('0x5d')]);_0x416c0a({'ret':0x1});});}});}function handleTZQuery(_0x19fb4b){logger[_0x6a78('0x57')](_0x19fb4b);return db['sequelize']['query'](_0x19fb4b)[_0x6a78('0x5f')](function(_0x5869ee){})[_0x6a78('0x60')](function(_0x3ca622){logger[_0x6a78('0x59')](_0x3ca622[_0x6a78('0x5d')]);});}function main(_0x6409af,_0x51c285,_0x2ccefe,_0x177047){logger[_0x6a78('0x57')]('main',_0x6409af,JSON[_0x6a78('0x72')](_0x51c285));process['send'](_0x6a78('0x73'));var _0x41e79d=_0x51c285[_0x6a78('0x74')];var _0x217b47=_[_0x6a78('0x75')](_0x41e79d);var _0x3ae9f6=_0x51c285[_0x6a78('0x76')];var _0x26391=path[_0x6a78('0x17')](config[_0x6a78('0x77')],_0x6a78('0x78'),_0x3ae9f6+'.csv');hasTZ=_[_0x6a78('0x51')](_0x41e79d)[_0x6a78('0x79')](_0x6a78('0x71'));var _0x1203ab=_[_0x6a78('0x51')](_0x41e79d)[_0x6a78('0x17')]();logger[_0x6a78('0x57')](_0x6a78('0x7a'),_0x1203ab);db[_0x6a78('0x7b')][_0x6a78('0x19')]({'raw':!![],'attributes':['id',_0x6a78('0x7c')]})[_0x6a78('0x1b')](function(_0x78b9be){for(var _0x781868=0x0;_0x781868<_0x78b9be['length'];_0x781868++){if(_0x78b9be[_0x781868][_0x6a78('0x7c')]in _0x41e79d){contactItemTypes[_0x6a78('0x1d')](_0x78b9be[_0x781868]);delete _0x217b47[_0x78b9be[_0x781868][_0x6a78('0x7c')]];hasAdditionalPhones=!![];}for(var _0xa53b54 in _0x41e79d){if(_0x78b9be[_0x781868]['name']+_0x6a78('0x7d')===_0xa53b54){phoneDescriptions[_0x6a78('0x1d')]({'itemTypeId':_0x78b9be[_0x781868]['id'],'description':_0xa53b54});delete _0x217b47[_0xa53b54];}}}if(hasAdditionalPhones)_0x217b47['AdditionalPhones']='';var _0x48a90a=_[_0x6a78('0x51')](_0x217b47)[_0x6a78('0x17')]();logger['info'](_0x6a78('0x7a'),_0x48a90a);fs[_0x6a78('0x7e')](_0x26391,_0x48a90a+'\x0a');Papa[_0x6a78('0x7f')](fs[_0x6a78('0x80')](_0x6409af),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5f0279,_0x261727){try{for(var _0x5aa901=0x0,_0x4ace22=[];_0x5aa901<_0x5f0279[_0x6a78('0x81')]['length'];_0x5aa901++){stats[_0x6a78('0x82')]+=0x1;if(_0x5f0279['errors'][_0x5aa901]){handleError(_0x5f0279[_0x6a78('0x81')][_0x5aa901],_0x5f0279[_0x6a78('0x5b')][_0x5aa901]);}else{var _0x3142b3=[];var _0x5c8a9c=[];var _0x296193={};for(var _0x362735 in _0x41e79d){let _0x28e2c0=contactItemTypes[_0x6a78('0x83')](_0x4d41d9=>_0x4d41d9[_0x6a78('0x7c')]===_0x362735);let _0x5020c7=contactItemTypes['find'](_0x1f7446=>_0x1f7446[_0x6a78('0x7c')]+_0x6a78('0x7d')===_0x362735);if(_[_0x6a78('0x20')](_0x28e2c0)&&_[_0x6a78('0x20')](_0x5020c7)){if(_0x41e79d[_0x6a78('0x84')](_0x362735)){if(_0x5f0279[_0x6a78('0x81')][_0x5aa901][_0x41e79d[_0x362735]]){var _0x3cd0f7=_['trim'](_0x5f0279['data'][_0x5aa901][_0x41e79d[_0x362735]][_0x6a78('0x85')](/"/g,'\x27'));switch(_0x362735){case _0x6a78('0x30'):var _0x5bd43f=moment(_0x3cd0f7,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5bd43f[_0x6a78('0x86')]()){_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x3cd0f7+'\x22');}else{_0x3142b3['push'](_0x6a78('0x87'));}break;case _0x6a78('0x35'):var _0x3380a2=parseInt(_0x3cd0f7);_0x3cd0f7=_['isNaN'](_0x3380a2)||_0x3380a2<0x0||_0x3380a2>0x4?_0x177047?0x3:0x2:_0x3380a2;_0x4ace22['push']('\x22'+_0x3cd0f7+'\x22');break;case _0x6a78('0x36'):var _0x517d10=parseInt(_0x3cd0f7);if(_[_0x6a78('0x88')](_0x517d10)&&_['includes'](_0x2ccefe,_0x517d10)){_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x517d10+'\x22');}else{_0x3142b3[_0x6a78('0x1d')](_0x6a78('0x89'));}break;case _0x6a78('0x8a'):if(isEmail(_0x3cd0f7)){_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x3cd0f7+'\x22');}else{_0x3142b3[_0x6a78('0x1d')](_0x6a78('0x8b'));}break;case _0x6a78('0x8c'):var _0x2fa3b4=moment(_0x3cd0f7,'YYYY-MM-DD',!![]);if(_0x2fa3b4[_0x6a78('0x86')]()){_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x3cd0f7+'\x22');}else{_0x3142b3['push'](_0x6a78('0x8d'));}break;case _0x6a78('0x71'):var _0x25db15=shared[_0x6a78('0x6d')];var _0x748e6=_0x25db15[_0x3cd0f7];if(!_['isNil'](_0x748e6)){var _0x3f5381=_0x748e6['utcOffset'];_0x4ace22['push']('\x22'+_0x3cd0f7+'\x22');_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x3f5381+'\x22');}break;default:_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x3cd0f7+'\x22');}}else{switch(_0x362735){case _0x6a78('0x8e'):case'phone':_0x3142b3['push'](_0x362735+_0x6a78('0x8f'));break;default:_0x4ace22[_0x6a78('0x1d')]('\x22\x22');}}}}else{var _0x5c1ea1='';if(!_[_0x6a78('0x20')](_0x28e2c0)){if(!_0x296193[_0x6a78('0x84')](_0x28e2c0['id'])){if(!_['isNil'](_0x5f0279['data'][_0x5aa901][_0x41e79d[_0x362735]])){var _0x3cd0f7=_[_0x6a78('0x90')](_0x5f0279[_0x6a78('0x81')][_0x5aa901][_0x41e79d[_0x362735]]['replace'](/"/g,'\x27'));var _0x10ab24=phoneDescriptions[_0x6a78('0x83')](_0x9f8616=>_0x9f8616[_0x6a78('0x91')]===_0x28e2c0['id']);if(!_[_0x6a78('0x20')](_0x10ab24)){var _0x4fdf2d=_[_0x6a78('0x90')](_0x5f0279[_0x6a78('0x81')][_0x5aa901][_0x41e79d[_0x10ab24[_0x6a78('0x92')]]][_0x6a78('0x85')](/"/g,'\x27'));if(!_[_0x6a78('0x20')](_0x4fdf2d))_0x3cd0f7=_0x3cd0f7+'§'+_0x4fdf2d;}if(_0x5c1ea1=='')_0x5c1ea1=_0x3cd0f7;else _0x5c1ea1+='|'+_0x3cd0f7;}_0x5c8a9c['push'](_0x28e2c0['id']+':'+_0x5c1ea1);_0x296193[_0x28e2c0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4ace22[_0x6a78('0x1d')]('\x22'+_0x5c8a9c['join'](';')+'\x22');}if(_0x3142b3[_0x6a78('0x1c')]){handleError(_0x5f0279['data'][_0x5aa901],{'code':_0x6a78('0x93'),'message':_0x3142b3[_0x6a78('0x17')]()});}else{fs[_0x6a78('0x94')](_0x26391,_0x4ace22['join']()+'\x0a');}_0x4ace22=[];}if(!(stats[_0x6a78('0x82')]%0xc8)){socket[_0x6a78('0x95')](_0x6a78('0x96')+_0x3ae9f6,stats);stats['errors']=[];}}if(stopped){logger[_0x6a78('0x57')]('Abort\x20parser');_0x261727[_0x6a78('0x97')]();}}catch(_0x59a4d8){handleError(_0x5f0279['data'][_0x5aa901],{'code':'SystemError','message':_0x59a4d8['message']});logger[_0x6a78('0x59')](_0x6a78('0x98'),_0x59a4d8[_0x6a78('0x5d')]);}},'complete':function(){try{var _0x132443=[];var _0x5f47f0=[];var _0x1e767a=_0x6a78('0x38');if(_0x51c285[_0x6a78('0x99')]&&_0x51c285[_0x6a78('0x99')][_0x6a78('0x1c')]){_0x1e767a=_0x6a78('0x9a')+_0x3ae9f6;_0x132443[_0x6a78('0x1d')](_0x6a78('0x9b')+_0x1e767a+_0x6a78('0x9c'));}tmp_campaigns=_0x6a78('0x9d')+_0x3ae9f6;tmp_voice_queues=_0x6a78('0x9e')+_0x3ae9f6;_0x5f47f0[_0x6a78('0x1d')](_0x6a78('0x9b')+tmp_campaigns+_0x6a78('0x9f'));_0x5f47f0[_0x6a78('0x1d')](_0x6a78('0x9b')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x6a78('0xa0')](_0x5f47f0,handleTZQuery)[_0x6a78('0x1b')](function(_0x5584e3){updateTzCampaigns(_0x51c285['ListId'])[_0x6a78('0x1b')](function(_0x5cae11){updateTzVoiceQueues(_0x51c285[_0x6a78('0x32')])[_0x6a78('0x1b')](function(_0xe89941){if(hasTZ)_0x48a90a=_0x48a90a['replace'](_0x6a78('0x71'),'dialTimezone,utcOffset');var _0x382e35=util[_0x6a78('0xd')](_0x6a78('0xa1'),_0x26391,_0x1e767a,_0x48a90a,_0x51c285['ListId'],_0x51c285['CompanyId']||null,NOW,NOW);if(_[_0x6a78('0x20')](_0x41e79d[_0x6a78('0x30')])){_0x382e35+=_0x6a78('0xa2');}_0x132443[_0x6a78('0x1d')](_0x382e35);if(_0x51c285[_0x6a78('0x99')]&&_0x51c285[_0x6a78('0x99')][_0x6a78('0x1c')]){_0x132443[_0x6a78('0x1d')](insertCmContact(_0x51c285[_0x6a78('0x32')],_0x1e767a,_0x51c285[_0x6a78('0x99')],_0x41e79d));_0x132443[_0x6a78('0x1d')](_0x6a78('0xa3')+_0x1e767a+';');}BPromise[_0x6a78('0xa0')](_0x132443,handleQuery)[_0x6a78('0x1b')](function(_0x20a1d9){BPromise[_0x6a78('0x1f')]([handleAdditionalPhones()])[_0x6a78('0x1b')](function(){_0x132443=[];for(var _0x4ef6f0=0x0;_0x4ef6f0_0x3777dc[_0xa0b0('0x7d')]===_0x28d14a);let _0x18c4df=contactItemTypes['find'](_0x3d2490=>_0x3d2490['name']+'_description'===_0x28d14a);if(_[_0xa0b0('0x1f')](_0x3f8200)&&_['isNil'](_0x18c4df)){if(_0x2a77fb[_0xa0b0('0x85')](_0x28d14a)){if(_0x2d6ca8[_0xa0b0('0x83')][_0xef8a6b][_0x2a77fb[_0x28d14a]]){var _0x18d776=_[_0xa0b0('0x86')](_0x2d6ca8[_0xa0b0('0x83')][_0xef8a6b][_0x2a77fb[_0x28d14a]][_0xa0b0('0x87')](/"/g,'\x27'));switch(_0x28d14a){case'scheduledat':var _0x1b8252=moment(_0x18d776,_0xa0b0('0xf'),!![]);if(_0x1b8252[_0xa0b0('0x88')]()){_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x18d776+'\x22');}else{_0x1c98b9[_0xa0b0('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa0b0('0x35'):var _0x4bf7e1=parseInt(_0x18d776);_0x18d776=_[_0xa0b0('0x89')](_0x4bf7e1)||_0x4bf7e1<0x0||_0x4bf7e1>0x4?_0x1900a0?0x3:0x2:_0x4bf7e1;_0x135f19['push']('\x22'+_0x18d776+'\x22');break;case _0xa0b0('0x36'):var _0x1f9d1c=parseInt(_0x18d776);if(_['isNumber'](_0x1f9d1c)&&_[_0xa0b0('0x7a')](_0x1eaaee,_0x1f9d1c)){_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x1f9d1c+'\x22');}else{_0x1c98b9[_0xa0b0('0x1e')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x18d776)){_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x18d776+'\x22');}else{_0x1c98b9[_0xa0b0('0x1e')](_0xa0b0('0x8a'));}break;case _0xa0b0('0x8b'):var _0xbc678c=moment(_0x18d776,_0xa0b0('0x8c'),!![]);if(_0xbc678c[_0xa0b0('0x88')]()){_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x18d776+'\x22');}else{_0x1c98b9[_0xa0b0('0x1e')](_0xa0b0('0x8d'));}break;case _0xa0b0('0x72'):var _0xaef174=shared[_0xa0b0('0x71')];var _0x1ac119=_0xaef174[_0x18d776];if(!_[_0xa0b0('0x1f')](_0x1ac119)){var _0x36abcb=_0x1ac119['utcOffset'];_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x18d776+'\x22');_0x135f19['push']('\x22'+_0x36abcb+'\x22');}break;default:_0x135f19['push']('\x22'+_0x18d776+'\x22');}}else{switch(_0x28d14a){case _0xa0b0('0x8e'):case _0xa0b0('0x13'):_0x1c98b9[_0xa0b0('0x1e')](_0x28d14a+'\x20not\x20specified');break;default:_0x135f19[_0xa0b0('0x1e')]('\x22\x22');}}}}else{var _0x286a64='';if(!_['isNil'](_0x3f8200)){if(!_0x86287f[_0xa0b0('0x85')](_0x3f8200['id'])){if(!_[_0xa0b0('0x1f')](_0x2d6ca8[_0xa0b0('0x83')][_0xef8a6b][_0x2a77fb[_0x28d14a]])){var _0x18d776=_[_0xa0b0('0x86')](_0x2d6ca8[_0xa0b0('0x83')][_0xef8a6b][_0x2a77fb[_0x28d14a]][_0xa0b0('0x87')](/"/g,'\x27'));var _0x31443d=phoneDescriptions[_0xa0b0('0x8f')](_0xccca09=>_0xccca09[_0xa0b0('0x90')]===_0x3f8200['id']);if(!_['isNil'](_0x31443d)){var _0x8927d3=_['trim'](_0x2d6ca8[_0xa0b0('0x83')][_0xef8a6b][_0x2a77fb[_0x31443d[_0xa0b0('0x91')]]]['replace'](/"/g,'\x27'));if(!_[_0xa0b0('0x1f')](_0x8927d3))_0x18d776=_0x18d776+'§'+_0x8927d3;}if(_0x286a64=='')_0x286a64=_0x18d776;else _0x286a64+='|'+_0x18d776;}_0x1b91ea[_0xa0b0('0x1e')](_0x3f8200['id']+':'+_0x286a64);_0x86287f[_0x3f8200['id']]=0x1;}}}}if(hasAdditionalPhones){_0x135f19[_0xa0b0('0x1e')]('\x22'+_0x1b91ea[_0xa0b0('0x14')](';')+'\x22');}if(_0x1c98b9['length']){handleError(_0x2d6ca8['data'][_0xef8a6b],{'code':_0xa0b0('0x92'),'message':_0x1c98b9[_0xa0b0('0x14')]()});}else{fs[_0xa0b0('0x93')](_0x476b7d,_0x135f19['join']()+'\x0a');}_0x135f19=[];}if(!(stats[_0xa0b0('0x84')]%0xc8)){socket[_0xa0b0('0x94')](_0xa0b0('0x95')+_0x252dce,stats);stats[_0xa0b0('0x61')]=[];}}if(stopped){logger[_0xa0b0('0x5d')](_0xa0b0('0x96'));_0x35069f['abort']();}}catch(_0x35a06e){handleError(_0x2d6ca8['data'][_0xef8a6b],{'code':_0xa0b0('0x97'),'message':_0x35a06e[_0xa0b0('0x5f')]});logger['error'](_0xa0b0('0x98'),_0x35a06e[_0xa0b0('0x5f')]);}},'complete':function(){try{var _0xf6987f=[];var _0x2aabcf=[];var _0x3b9f87=_0xa0b0('0x41');if(_0xe8a4d0['duplicates']&&_0xe8a4d0[_0xa0b0('0x99')]['length']){_0x3b9f87=_0xa0b0('0x9a')+_0x252dce;_0xf6987f['push'](_0xa0b0('0x9b')+_0x3b9f87+_0xa0b0('0x9c'));}tmp_campaigns=_0xa0b0('0x9d')+_0x252dce;tmp_voice_queues=_0xa0b0('0x9e')+_0x252dce;_0x2aabcf[_0xa0b0('0x1e')](_0xa0b0('0x9b')+tmp_campaigns+_0xa0b0('0x9f'));_0x2aabcf[_0xa0b0('0x1e')](_0xa0b0('0x9b')+tmp_voice_queues+_0xa0b0('0x9f'));BPromise[_0xa0b0('0xa0')](_0x2aabcf,handleTZQuery)[_0xa0b0('0x1c')](function(_0x4c0896){updateTzCampaigns(_0xe8a4d0[_0xa0b0('0x32')])[_0xa0b0('0x1c')](function(_0x1bdc02){updateTzVoiceQueues(_0xe8a4d0['ListId'])[_0xa0b0('0x1c')](function(_0x28c385){if(hasTZ)_0x2d7559=_0x2d7559[_0xa0b0('0x87')](_0xa0b0('0x72'),_0xa0b0('0xa1'));var _0x512038=util[_0xa0b0('0xe')](_0xa0b0('0xa2'),_0x476b7d,_0x3b9f87,_0x2d7559,_0xe8a4d0[_0xa0b0('0x32')],_0xe8a4d0[_0xa0b0('0x57')]||null,NOW,NOW);if(_[_0xa0b0('0x1f')](_0x2a77fb[_0xa0b0('0x30')])){_0x512038+=_0xa0b0('0xa3');}_0xf6987f['push'](_0x512038);if(_0xe8a4d0['duplicates']&&_0xe8a4d0[_0xa0b0('0x99')][_0xa0b0('0x1a')]){_0xf6987f['push'](insertCmContact(_0xe8a4d0[_0xa0b0('0x32')],_0x3b9f87,_0xe8a4d0[_0xa0b0('0x99')],_0x2a77fb));_0xf6987f[_0xa0b0('0x1e')](_0xa0b0('0xa4')+_0x3b9f87+';');}BPromise[_0xa0b0('0xa0')](_0xf6987f,handleQuery)[_0xa0b0('0x1c')](function(_0x10a76f){BPromise[_0xa0b0('0x1b')]([handleAdditionalPhones()])[_0xa0b0('0x1c')](function(){_0xf6987f=[];for(var _0x49006e=0x0;_0x49006e\x20\x20');}var _0x267d8b=path[_0xa0b0('0x14')](config[_0xa0b0('0x77')],_0xa0b0('0x78'),process[_0xa0b0('0xb1')][0x2]);if(!fs['existsSync'](_0x267d8b)){throw new Error(_0xa0b0('0xb2'));}var _0xcb7b62={};try{_0xcb7b62=JSON['parse'](process[_0xa0b0('0xb1')][0x3]);if(!_0xcb7b62[_0xa0b0('0x76')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xcb7b62[_0xa0b0('0x76')][_0xa0b0('0x13')]){throw new Error('phone\x20is\x20mandatory');}if(!_0xcb7b62[_0xa0b0('0x76')][_0xa0b0('0x8e')]){throw new Error(_0xa0b0('0xb3'));}var _0x225951=0x0;if(_0xcb7b62[_0xa0b0('0x76')][_0xa0b0('0x36')]){_0x225951=0x1;}if(!_0xcb7b62[_0xa0b0('0x32')]){throw new Error(_0xa0b0('0xb4'));}}catch(_0x5a1267){throw new Error(_0xa0b0('0xb5'));}var _0x48a806=[];try{_0x48a806=_[_0xa0b0('0xb6')](JSON[_0xa0b0('0x81')](process[_0xa0b0('0xb1')][0x4]),'id');}catch(_0x36b5ad){logger[_0xa0b0('0x5d')](_0xa0b0('0xb7'));}main(_0x267d8b,_0xcb7b62,_0x48a806,_0x225951);}validate();process['on']('SIGINT',handleStop);process['on'](_0xa0b0('0xb8'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 6421927..f30ab38 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5454=['agent\x20not\x20exists','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','trim','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','abort','SystemError','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contactId','contactTypeId','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','isNil','phone','AdditionalPhones','push','all','message','then','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ListId','createdAt','updatedAt','priority','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper','cm_hopper_black','fromQuery','ContactId','ListId\x20=\x20?','\x20=\x20?','toString','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','fields','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','query','catch','main','stringify','send','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','createReadStream','data','find','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes'];(function(_0x35490f,_0xd9da3f){var _0x381b38=function(_0x2d5ee5){while(--_0x2d5ee5){_0x35490f['push'](_0x35490f['shift']());}};_0x381b38(++_0xd9da3f);}(_0x5454,0x15b));var _0x4545=function(_0x225198,_0x5711ca){_0x225198=_0x225198-0x0;var _0x1c76f4=_0x5454[_0x225198];return _0x1c76f4;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x4545('0x0'));var BPromise=require('bluebird');var moment=require('moment');var squel=require('squel');var Redis=require(_0x4545('0x1'));var db=require(_0x4545('0x2'))['db'];var config=require(_0x4545('0x3'));var logger=require(_0x4545('0x4'))('import');config[_0x4545('0x5')]=_[_0x4545('0x6')](config[_0x4545('0x5')],{'host':_0x4545('0x7'),'port':0x18eb});var socket=require(_0x4545('0x8'))(new Redis(config[_0x4545('0x5')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4545('0x9')](_0x4545('0xa'));var tempTableName=_0x4545('0xb')+moment()[_0x4545('0x9')](_0x4545('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x40cd1c){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))*$/[_0x4545('0xd')](_0x40cd1c);}function selectNotIn(_0x491b7b,_0x869994,_0x38fc64,_0x237cc6,_0x16b0c6){return squel[_0x4545('0xe')]()[_0x4545('0xf')]('phone')[_0x4545('0x10')](_0x237cc6)[_0x4545('0x11')](_0x869994,null,_0x869994+_0x4545('0x12')+_0x237cc6+'.'+_0x38fc64)[_0x4545('0x13')](_0x237cc6+'.'+_0x38fc64+_0x4545('0x14')+_0x491b7b+'.'+_0x38fc64)[_0x4545('0x13')](_0x869994+_0x4545('0x15')+_0x16b0c6[_0x4545('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x36bb8e,_0xab7856){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4545('0x16')]['query'](_0x4545('0x17')+tempTableName)[_0x4545('0x18')](function(_0x2416b0){if(_0x2416b0!==null){var _0x3bb165=[];for(var _0x5a332e=0x0;_0x5a332e<_0x2416b0['length'];_0x5a332e++){var _0x3bf878=_0x2416b0[_0x5a332e];if(!_[_0x4545('0x19')](_0x3bf878[_0x4545('0x1a')])){if(!_[_0x4545('0x19')](_0x3bf878[_0x4545('0x1b')]))_0x3bb165[_0x4545('0x1c')](insertAdditionalPhones(_0x3bf878));promisesContact[_0x4545('0x1c')]({'contact':_0x3bf878});}}}Promise[_0x4545('0x1d')](_0x3bb165)['then'](function(){_0x36bb8e({'val':0x1});});})['catch'](function(_0x262669){logger['error'](_0x262669[_0x4545('0x1e')]);});});}function insertAdditionalPhones(_0x669f9){return new Promise(function(_0x67e408,_0x6b3bc){var _0x7e47e5=_0x669f9[_0x4545('0x1b')];if(_[_0x4545('0x19')](_0x7e47e5))_0x6b3bc({'val':0x0});else{var _0x13f497=_0x7e47e5['split'](';');var _0x580b57=[];orderBy=0x0;for(var _0x431b5d=0x0;_0x431b5d<_0x13f497['length'];_0x431b5d++){_0x580b57[_0x4545('0x1c')](splitAdditionalPhone(_0x669f9['id'],_0x13f497[_0x431b5d]));}Promise['all'](_0x580b57)[_0x4545('0x1f')](function(){_0x67e408({'val':_0x13f497['length']});});}});}function splitAdditionalPhone(_0x519489,_0x21dbc2){return new Promise(function(_0xdd21e4,_0x38815e){var _0x34d4c1=_0x21dbc2[_0x4545('0x20')](':');var _0x39eaa1=_0x34d4c1[0x0];var _0x43033c=_0x34d4c1[0x1];if(_0x43033c!==''){var _0x889814=_0x43033c[_0x4545('0x20')]('|');var _0x2a6842=[];for(var _0x3e5807=0x0;_0x3e5807<_0x889814[_0x4545('0x21')];_0x3e5807++){if(_0x889814[_0x3e5807]!==''){var _0xab0b00=_[_0x4545('0x22')](promisesAdditionalPhones,{'contactId':_0x519489,'phone':_0x889814[_0x3e5807]});if(_0xab0b00[_0x4545('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0x4545('0x1c')]({'contactId':_0x519489,'contactTypeId':_0x39eaa1,'phone':_0x889814[_0x3e5807],'orderBy':orderBy});}}}_0xdd21e4({'ok':0x1});}else _0xdd21e4({'res':0x0});});}function createAdditionalPhone(_0x576200,_0x1540f0,_0x2c256b,_0x853476){var _0x394a8e='';var _0xb9c5ee='';var _0x531250=_0x2c256b[_0x4545('0x20')]('§');_0x394a8e=_0x531250[0x0];if(_0x531250[_0x4545('0x21')]==0x2)_0xb9c5ee=_0x531250[0x1];return new Promise(function(_0x24ebd3,_0x247762){return db[_0x4545('0x23')][_0x4545('0x24')]({'where':{'CmContactId':_0x576200,'item':_0x394a8e}})['then'](function(_0x406920){if(_0x406920){return db[_0x4545('0x23')][_0x4545('0x25')]({'ItemTypeId':_0x1540f0,'description':_0xb9c5ee,'OrderBy':_0x853476},{'where':{'CmContactId':_0x576200,'item':_0x394a8e}})[_0x4545('0x1f')](function(_0x2f532f){_0x24ebd3({'res':_0x4545('0x26')});});}else{return db[_0x4545('0x23')][_0x4545('0x27')]({'CmContactId':_0x576200,'item':_0x394a8e,'ItemTypeId':_0x1540f0,'description':_0xb9c5ee,'OrderBy':_0x853476,'ItemClass':_0x4545('0x28')})[_0x4545('0x1f')](function(_0x196884){_0x24ebd3({'res':'inserted'});});}});});}function updateContact(_0x1e3a47){return new Promise(function(_0x5d3f61,_0x2848ac){var _0x9bffd8=_0x1e3a47['id'];delete _0x1e3a47['id'];return db['CmContact'][_0x4545('0x25')](_0x1e3a47,{'where':{'id':_0x9bffd8}})[_0x4545('0x1f')](function(_0x46e814){updatedRows+=0x1;return db[_0x4545('0x29')][_0x4545('0x25')]({'phone':_0x1e3a47[_0x4545('0x1a')]},{'where':{'ContactId':_0x9bffd8}})[_0x4545('0x1f')](function(_0x54ea62){_0x5d3f61({'ret':'OK'});});});});}function insertCmHopper(_0x1abc06,_0x386b38,_0x36f4b9,_0x1b7a11,_0x2893a6){var _0x13059d=['cm_contacts.phone',_0x4545('0x2a'),_0x4545('0x2b'),_0x4545('0x2c'),_0x386b38+'.'+_0x1b7a11,_0x4545('0x2d'),_0x4545('0x2e'),_0x4545('0x2f'),_0x4545('0x30'),'\x22'+_0x2893a6+'\x22'];return squel[_0x4545('0x31')]()[_0x4545('0x32')]('cm_hopper')['fromQuery'](['phone',_0x4545('0x33'),'ContactId',_0x4545('0x34'),_0x1b7a11,_0x4545('0x35'),_0x4545('0x36'),_0x4545('0x37'),'UserId','recallme'],squel[_0x4545('0xe')]()['fields'](_0x13059d)[_0x4545('0x10')](_0x386b38)[_0x4545('0x11')](_0x4545('0x38'),null,_0x4545('0x39')+_0x386b38+_0x4545('0x3a'))['join'](_0x36f4b9,null,_0x36f4b9+'.id\x20=\x20'+_0x386b38+'.'+_0x1b7a11)[_0x4545('0x13')](_0x386b38+_0x4545('0x3b'),_0x1abc06)[_0x4545('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4545('0x13')](_0x4545('0x3c'),selectNotIn(_0x386b38,_0x36f4b9,_0x1b7a11,'cm_hopper',[_0x4545('0x3d'),'\x22onlyIfOpen\x22']))[_0x4545('0x13')](_0x4545('0x3c'),selectNotIn(_0x386b38,_0x36f4b9,_0x1b7a11,_0x4545('0x3e'),[_0x4545('0x3d')])))['toString']();}function insertCmHopperBlack(_0x1ca5d3,_0x632ec1,_0x3d308e,_0x299869){var _0x549557=['cm_contacts.phone',_0x4545('0x2b'),'cm_contacts.ListId',_0x632ec1+'.'+_0x299869,_0x4545('0x2d'),_0x4545('0x2e')];return squel[_0x4545('0x31')]()[_0x4545('0x32')](_0x4545('0x3f'))[_0x4545('0x40')]([_0x4545('0x1a'),_0x4545('0x41'),'ListId',_0x299869,_0x4545('0x35'),_0x4545('0x36')],squel[_0x4545('0xe')]()['fields'](_0x549557)[_0x4545('0x10')](_0x632ec1)[_0x4545('0x11')](_0x4545('0x38'),null,_0x4545('0x39')+_0x632ec1+_0x4545('0x3a'))[_0x4545('0x11')](_0x3d308e,null,_0x3d308e+_0x4545('0x12')+_0x632ec1+'.'+_0x299869)[_0x4545('0x13')](_0x632ec1+'.CmListId\x20=\x20?',_0x1ca5d3)[_0x4545('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4545('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x4545('0xe')]()[_0x4545('0xf')](_0x4545('0x1a'))['from'](_0x4545('0x3f'))[_0x4545('0x13')](_0x4545('0x42'),_0x1ca5d3)[_0x4545('0x13')](_0x299869+_0x4545('0x43'),_0x632ec1+'.'+_0x299869)))[_0x4545('0x44')]();}function insertCmHopperAdditionalPhones(_0x51a22e){var _0x59d00c=['cm_hopper.id','cm_contact_has_items.item',_0x4545('0x45'),_0x4545('0x46'),_0x4545('0x47')];return squel[_0x4545('0x31')]()[_0x4545('0x32')](_0x4545('0x48'))[_0x4545('0x40')](['CmHopperId','phone',_0x4545('0x49'),_0x4545('0x35'),_0x4545('0x36')],squel[_0x4545('0xe')]()[_0x4545('0x4a')](_0x59d00c)[_0x4545('0x10')]('cm_hopper')[_0x4545('0x11')](_0x4545('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x4545('0x11')]('cm_contact_has_items',null,_0x4545('0x4b'))[_0x4545('0x13')](_0x4545('0x4c'),_0x51a22e)[_0x4545('0x13')](_0x4545('0x4d'),NOW))[_0x4545('0x44')]();}function insertCmContact(_0x2bc1ce,_0x569fa6,_0x992cb,_0x56cb97){var _0x3cad88=_['concat'](_[_0x4545('0x4e')](_0x56cb97),[_0x4545('0x34'),_0x4545('0x4f'),'createdAt',_0x4545('0x36')]);return squel[_0x4545('0x31')]()['into'](_0x4545('0x38'))['fromQuery'](_0x3cad88,squel[_0x4545('0xe')]()[_0x4545('0x4a')](_0x3cad88)[_0x4545('0x10')](_0x569fa6)[_0x4545('0x13')]('('+_0x992cb[_0x4545('0x11')](',')+_0x4545('0x50'),squel[_0x4545('0xe')]()[_0x4545('0x4a')](_0x992cb)[_0x4545('0x10')]('cm_contacts')[_0x4545('0x13')](_0x4545('0x42'),_0x2bc1ce))[_0x4545('0x13')](_0x4545('0x51'),squel[_0x4545('0xe')]()['field'](_0x4545('0x52'),_0x4545('0x53'))[_0x4545('0x10')](_0x569fa6)[_0x4545('0x54')](_0x992cb[_0x4545('0x11')](','))))[_0x4545('0x44')]();}function handleStop(){logger[_0x4545('0x55')](_0x4545('0x56'));stopped=!![];}function handleUncaughtException(_0x5f088f){logger[_0x4545('0x57')](_0x5f088f[_0x4545('0x1e')]);process[_0x4545('0x58')](0x1);}function handleError(_0x237564,_0x261de2){stats[_0x4545('0x59')][_0x4545('0x1c')]({'name':_0x261de2[_0x4545('0x5a')],'message':_0x261de2['message'],'row':_0x237564});}function handleQuery(_0x3b4f01){logger[_0x4545('0x55')](_0x3b4f01);return db[_0x4545('0x16')][_0x4545('0x5b')](_0x3b4f01)[_0x4545('0x18')](function(_0x537f8f){results[_0x4545('0x1c')](_0x537f8f);})[_0x4545('0x5c')](function(_0x30da95){logger[_0x4545('0x57')](_0x30da95[_0x4545('0x1e')]);});}function main(_0x3bfeab,_0x374361,_0x40393b,_0x3b4b86){logger[_0x4545('0x55')](_0x4545('0x5d'),_0x3bfeab,JSON[_0x4545('0x5e')](_0x374361));process[_0x4545('0x5f')]('start');var _0x44f068=_0x374361[_0x4545('0x60')];var _0x220d78=_[_0x4545('0x61')](_0x44f068);var _0x2768ef=_0x374361[_0x4545('0x62')];var _0x589d06=path['join'](config[_0x4545('0x63')],_0x4545('0x64'),_0x2768ef+_0x4545('0x65'));logger[_0x4545('0x55')](_0x4545('0x66'),_0x374361);db[_0x4545('0x67')][_0x4545('0x68')]({'raw':!![],'attributes':['id',_0x4545('0x69')]})[_0x4545('0x1f')](function(_0xceedf1){for(var _0xcc1913=0x0;_0xcc1913<_0xceedf1[_0x4545('0x21')];_0xcc1913++){if(_0xceedf1[_0xcc1913]['name']in _0x44f068){contactItemTypes[_0x4545('0x1c')](_0xceedf1[_0xcc1913]);delete _0x220d78[_0xceedf1[_0xcc1913]['name']];hasAdditionalPhones=!![];}for(var _0xceccec in _0x44f068){if(_0xceedf1[_0xcc1913]['name']+_0x4545('0x6a')===_0xceccec){phoneDescriptions['push']({'itemTypeId':_0xceedf1[_0xcc1913]['id'],'description':_0xceccec});delete _0x220d78[_0xceccec];}}}if(hasAdditionalPhones)_0x220d78[_0x4545('0x1b')]='';var _0x2f80e5=_[_0x4545('0x4e')](_0x220d78)['join']();logger['info'](_0x4545('0x6b'),_0x2f80e5);fs[_0x4545('0x6c')](_0x589d06,_0x2f80e5+'\x0a');Papa['parse'](fs[_0x4545('0x6d')](_0x3bfeab),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8839ed,_0x52b8da){try{for(var _0x5400a5=0x0,_0x59333c=[];_0x5400a5<_0x8839ed[_0x4545('0x6e')][_0x4545('0x21')];_0x5400a5++){stats['rows']+=0x1;if(_0x8839ed['errors'][_0x5400a5]){handleError(_0x8839ed[_0x4545('0x6e')][_0x5400a5],_0x8839ed['errors'][_0x5400a5]);}else{var _0x598c2e=[];var _0x18acc7=[];var _0xf1f85e={};for(var _0x559b06 in _0x44f068){let _0x3b1862=contactItemTypes[_0x4545('0x6f')](_0x485b09=>_0x485b09['name']===_0x559b06);let _0x5e8b41=contactItemTypes[_0x4545('0x6f')](_0x95bd11=>_0x95bd11[_0x4545('0x69')]+'_description'===_0x559b06);if(_[_0x4545('0x19')](_0x3b1862)&&_[_0x4545('0x19')](_0x5e8b41)){if(_0x44f068['hasOwnProperty'](_0x559b06)){if(_0x8839ed[_0x4545('0x6e')][_0x5400a5][_0x44f068[_0x559b06]]){var _0x3a4e95=_['trim'](_0x8839ed['data'][_0x5400a5][_0x44f068[_0x559b06]][_0x4545('0x70')](/"/g,'\x27'));switch(_0x559b06){case _0x4545('0x33'):var _0x5784bc=moment(_0x3a4e95,_0x4545('0xa'),!![]);if(_0x5784bc['isValid']()){_0x59333c[_0x4545('0x1c')]('\x22'+_0x3a4e95+'\x22');}else{_0x598c2e['push'](_0x4545('0x71'));}break;case'priority':var _0x1178f3=parseInt(_0x3a4e95);_0x3a4e95=_[_0x4545('0x72')](_0x1178f3)||_0x1178f3<0x0||_0x1178f3>0x4?_0x3b4b86?0x3:0x2:_0x1178f3;_0x59333c[_0x4545('0x1c')]('\x22'+_0x3a4e95+'\x22');break;case _0x4545('0x73'):var _0x10070a=parseInt(_0x3a4e95);if(_[_0x4545('0x74')](_0x10070a)&&_[_0x4545('0x75')](_0x40393b,_0x10070a)){_0x59333c['push']('\x22'+_0x10070a+'\x22');}else{_0x598c2e[_0x4545('0x1c')](_0x4545('0x76'));}break;case _0x4545('0x77'):if(isEmail(_0x3a4e95)){_0x59333c[_0x4545('0x1c')]('\x22'+_0x3a4e95+'\x22');}else{_0x598c2e[_0x4545('0x1c')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x28ae98=moment(_0x3a4e95,_0x4545('0x78'),!![]);if(_0x28ae98['isValid']()){_0x59333c[_0x4545('0x1c')]('\x22'+_0x3a4e95+'\x22');}else{_0x598c2e[_0x4545('0x1c')](_0x4545('0x79'));}break;default:_0x59333c['push']('\x22'+_0x3a4e95+'\x22');}}else{switch(_0x559b06){case'firstName':case _0x4545('0x1a'):_0x598c2e[_0x4545('0x1c')](_0x559b06+_0x4545('0x7a'));break;default:_0x59333c[_0x4545('0x1c')]('\x22\x22');}}}}else{var _0x33a934='';if(!_[_0x4545('0x19')](_0x3b1862)){if(!_0xf1f85e['hasOwnProperty'](_0x3b1862['id'])){for(var _0x45ee11=0x0;_0x45ee11<_0x44f068[_0x559b06][_0x4545('0x21')];_0x45ee11++){var _0x3a4e95=_[_0x4545('0x7b')](_0x8839ed[_0x4545('0x6e')][_0x5400a5][_0x44f068[_0x559b06][_0x45ee11]][_0x4545('0x70')](/"/g,'\x27'));var _0x158a15=phoneDescriptions[_0x4545('0x6f')](_0x1b26bc=>_0x1b26bc[_0x4545('0x7c')]===_0x3b1862['id']);if(!_[_0x4545('0x19')](_0x158a15)){var _0x272f56=_[_0x4545('0x7b')](_0x8839ed[_0x4545('0x6e')][_0x5400a5][_0x44f068[_0x158a15[_0x4545('0x7d')]][0x0]][_0x4545('0x70')](/"/g,'\x27'));if(!_[_0x4545('0x19')](_0x272f56))_0x3a4e95=_0x3a4e95+'§'+_0x272f56;}if(_0x33a934=='')_0x33a934=_0x3a4e95;else _0x33a934+='|'+_0x3a4e95;}_0x18acc7['push'](_0x3b1862['id']+':'+_0x33a934);_0xf1f85e[_0x3b1862['id']]=0x1;}}}}if(hasAdditionalPhones){_0x59333c[_0x4545('0x1c')]('\x22'+_0x18acc7[_0x4545('0x11')](';')+'\x22');}if(_0x598c2e[_0x4545('0x21')]){handleError(_0x8839ed[_0x4545('0x6e')][_0x5400a5],{'code':_0x4545('0x7e'),'message':_0x598c2e['join']()});}else{fs[_0x4545('0x7f')](_0x589d06,_0x59333c[_0x4545('0x11')]()+'\x0a');}_0x59333c=[];}if(!(stats[_0x4545('0x80')]%0xc8)){socket[_0x4545('0x81')](_0x4545('0x82')+_0x2768ef,stats);stats['errors']=[];}}if(stopped){logger[_0x4545('0x55')]('Abort\x20parser');_0x52b8da[_0x4545('0x83')]();}}catch(_0x3f096a){handleError(_0x8839ed[_0x4545('0x6e')][_0x5400a5],{'code':_0x4545('0x84'),'message':_0x3f096a[_0x4545('0x1e')]});logger[_0x4545('0x57')]('step',_0x3f096a[_0x4545('0x1e')]);}},'complete':function(){try{var _0x3a5638=[];var _0x332ec4=tempTableName;_0x3a5638['push']('CREATE\x20TABLE\x20'+_0x332ec4+_0x4545('0x85'));logger[_0x4545('0x55')](_0x4545('0x86'),contactItemTypes[_0x4545('0x21')]);var _0x5309d=util[_0x4545('0x9')](_0x4545('0x87'),_0x589d06,_0x332ec4,_0x2f80e5,_0x374361[_0x4545('0x34')],_0x374361[_0x4545('0x4f')]||null,NOW,NOW);if(_['isNil'](_0x44f068['scheduledat'])){_0x5309d+=_0x4545('0x88');}_0x3a5638[_0x4545('0x1c')](_0x5309d);BPromise[_0x4545('0x89')](_0x3a5638,handleQuery)[_0x4545('0x1f')](function(_0x260ee9){BPromise[_0x4545('0x1d')]([handleAdditionalPhones()])[_0x4545('0x1f')](function(){_0x3a5638=[];for(var _0x1b0758=0x0;_0x1b0758\x20\x20');}var _0x4c6764=path['join'](config['root'],'server/files/tmp',process[_0x4545('0x90')][0x2]);if(!fs[_0x4545('0x91')](_0x4c6764)){throw new Error(_0x4545('0x92'));}var _0x36b1a1={};try{_0x36b1a1=JSON[_0x4545('0x93')](process[_0x4545('0x90')][0x3]);if(!_0x36b1a1[_0x4545('0x60')]){throw new Error(_0x4545('0x94'));}var _0x427f83=0x0;if(_0x36b1a1[_0x4545('0x60')][_0x4545('0x73')]){_0x427f83=0x1;}if(!_0x36b1a1[_0x4545('0x34')]){throw new Error(_0x4545('0x95'));}}catch(_0x4c566a){throw new Error(_0x4545('0x96'));}var _0x43c839=[];try{_0x43c839=_[_0x4545('0x97')](JSON[_0x4545('0x93')](process[_0x4545('0x90')][0x4]),'id');}catch(_0x2274f4){logger['info'](_0x4545('0x98'));}main(_0x4c6764,_0x36b1a1,_0x43c839,_0x427f83);}validate();process['on'](_0x4545('0x99'),handleStop);process['on'](_0x4545('0x9a'),handleUncaughtException); \ No newline at end of file +var _0x352e=['createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','insert','cm_hopper_black','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','ListId','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','exit','errors','stringify','send','start','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','find','hasOwnProperty','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','trim','replace','itemTypeId','description','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','message','split','all','updated','CmContactHasItem','create','PHONE','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper','fromQuery','scheduledat','ContactId'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x352e,0x1a6));var _0xe352=function(_0x19a38d,_0x466a17){_0x19a38d=_0x19a38d-0x0;var _0x221a79=_0x352e[_0x19a38d];return _0x221a79;};'use strict';var fs=require('fs');var path=require(_0xe352('0x0'));var _=require(_0xe352('0x1'));var Papa=require(_0xe352('0x2'));var util=require(_0xe352('0x3'));var BPromise=require(_0xe352('0x4'));var moment=require(_0xe352('0x5'));var squel=require(_0xe352('0x6'));var Redis=require(_0xe352('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0xe352('0x8'));var logger=require(_0xe352('0x9'))('import');config[_0xe352('0xa')]=_[_0xe352('0xb')](config[_0xe352('0xa')],{'host':_0xe352('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe352('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xe352('0xd')](_0xe352('0xe'));var tempTableName=_0xe352('0xf')+moment()['format'](_0xe352('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x42bc13){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))*$/[_0xe352('0x11')](_0x42bc13);}function selectNotIn(_0x181d92,_0x3eb6c0,_0xd1a6af,_0x4b0b13,_0x5bb25e){return squel[_0xe352('0x12')]()[_0xe352('0x13')](_0xe352('0x14'))[_0xe352('0x15')](_0x4b0b13)[_0xe352('0x16')](_0x3eb6c0,null,_0x3eb6c0+_0xe352('0x17')+_0x4b0b13+'.'+_0xd1a6af)['where'](_0x4b0b13+'.'+_0xd1a6af+_0xe352('0x18')+_0x181d92+'.'+_0xd1a6af)[_0xe352('0x19')](_0x3eb6c0+'.dialCheckDuplicateType\x20IN\x20('+_0x5bb25e[_0xe352('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xc0a528,_0x56afa0){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe352('0x1a')][_0xe352('0x1b')](_0xe352('0x1c')+tempTableName)[_0xe352('0x1d')](function(_0xc7b5c1){if(_0xc7b5c1!==null){var _0xa00062=[];for(var _0x31e417=0x0;_0x31e417<_0xc7b5c1[_0xe352('0x1e')];_0x31e417++){var _0x5df4c5=_0xc7b5c1[_0x31e417];if(!_[_0xe352('0x1f')](_0x5df4c5['phone'])){if(!_['isNil'](_0x5df4c5[_0xe352('0x20')]))_0xa00062[_0xe352('0x21')](insertAdditionalPhones(_0x5df4c5));promisesContact['push']({'contact':_0x5df4c5});}}}Promise['all'](_0xa00062)[_0xe352('0x22')](function(){_0xc0a528({'val':0x1});});})[_0xe352('0x23')](function(_0x759b6){logger['error'](_0x759b6[_0xe352('0x24')]);});});}function insertAdditionalPhones(_0x36a427){return new Promise(function(_0xa70d53,_0x4b2c53){var _0x4961c9=_0x36a427[_0xe352('0x20')];if(_[_0xe352('0x1f')](_0x4961c9))_0x4b2c53({'val':0x0});else{var _0x269954=_0x4961c9[_0xe352('0x25')](';');var _0x1db31e=[];orderBy=0x0;for(var _0x59e9c0=0x0;_0x59e9c0<_0x269954[_0xe352('0x1e')];_0x59e9c0++){_0x1db31e[_0xe352('0x21')](splitAdditionalPhone(_0x36a427['id'],_0x269954[_0x59e9c0]));}Promise[_0xe352('0x26')](_0x1db31e)[_0xe352('0x22')](function(){_0xa70d53({'val':_0x269954['length']});});}});}function splitAdditionalPhone(_0x14317b,_0x53cf17){return new Promise(function(_0x3cc4f7,_0x55ff39){var _0x2c8552=_0x53cf17[_0xe352('0x25')](':');var _0x41e235=_0x2c8552[0x0];var _0x1b1245=_0x2c8552[0x1];if(_0x1b1245!==''){var _0x319aca=_0x1b1245[_0xe352('0x25')]('|');var _0x50ff6e=[];for(var _0x4987c0=0x0;_0x4987c0<_0x319aca['length'];_0x4987c0++){if(_0x319aca[_0x4987c0]!==''){var _0x2aa94a=_['filter'](promisesAdditionalPhones,{'contactId':_0x14317b,'phone':_0x319aca[_0x4987c0]});if(_0x2aa94a[_0xe352('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xe352('0x21')]({'contactId':_0x14317b,'contactTypeId':_0x41e235,'phone':_0x319aca[_0x4987c0],'orderBy':orderBy});}}}_0x3cc4f7({'ok':0x1});}else _0x3cc4f7({'res':0x0});});}function createAdditionalPhone(_0x25ca29,_0x252eab,_0x30028b,_0xd3c70a){var _0x26c360='';var _0x24ae32='';var _0x32e669=_0x30028b[_0xe352('0x25')]('§');_0x26c360=_0x32e669[0x0];if(_0x32e669[_0xe352('0x1e')]==0x2)_0x24ae32=_0x32e669[0x1];return new Promise(function(_0x587012,_0x43d174){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x25ca29,'item':_0x26c360}})[_0xe352('0x22')](function(_0x3cdc62){if(_0x3cdc62){return db['CmContactHasItem']['update']({'ItemTypeId':_0x252eab,'description':_0x24ae32,'OrderBy':_0xd3c70a},{'where':{'CmContactId':_0x25ca29,'item':_0x26c360}})['then'](function(_0x5d8533){_0x587012({'res':_0xe352('0x27')});});}else{return db[_0xe352('0x28')][_0xe352('0x29')]({'CmContactId':_0x25ca29,'item':_0x26c360,'ItemTypeId':_0x252eab,'description':_0x24ae32,'OrderBy':_0xd3c70a,'ItemClass':_0xe352('0x2a')})[_0xe352('0x22')](function(_0x1576a2){_0x587012({'res':'inserted'});});}});});}function updateContact(_0x2623c6){return new Promise(function(_0x36af96,_0x343d5d){var _0x2a605f=_0x2623c6['id'];delete _0x2623c6['id'];return db[_0xe352('0x2b')][_0xe352('0x2c')](_0x2623c6,{'where':{'id':_0x2a605f}})[_0xe352('0x22')](function(_0x2c2f04){updatedRows+=0x1;return db['CmHopper'][_0xe352('0x2c')]({'phone':_0x2623c6[_0xe352('0x14')]},{'where':{'ContactId':_0x2a605f}})['then'](function(_0x4aa63c){_0x36af96({'ret':'OK'});});});});}function insertCmHopper(_0xf88f5b,_0x5eda6e,_0x13aef5,_0x35c1dc,_0x29a280){var _0x3e2eac=[_0xe352('0x2d'),_0xe352('0x2e'),'cm_contacts.id',_0xe352('0x2f'),_0x5eda6e+'.'+_0x35c1dc,'cm_contacts.createdAt',_0xe352('0x30'),_0xe352('0x31'),'cm_contacts.UserId','\x22'+_0x29a280+'\x22'];return squel['insert']()[_0xe352('0x32')](_0xe352('0x33'))[_0xe352('0x34')]([_0xe352('0x14'),_0xe352('0x35'),_0xe352('0x36'),'ListId',_0x35c1dc,_0xe352('0x37'),_0xe352('0x38'),_0xe352('0x39'),_0xe352('0x3a'),_0xe352('0x3b')],squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x3e2eac)[_0xe352('0x15')](_0x5eda6e)[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x3e')+_0x5eda6e+_0xe352('0x3f'))['join'](_0x13aef5,null,_0x13aef5+_0xe352('0x17')+_0x5eda6e+'.'+_0x35c1dc)[_0xe352('0x19')](_0x5eda6e+_0xe352('0x40'),_0xf88f5b)[_0xe352('0x19')](_0xe352('0x41'),NOW)['where'](_0xe352('0x42'),selectNotIn(_0x5eda6e,_0x13aef5,_0x35c1dc,_0xe352('0x33'),[_0xe352('0x43'),_0xe352('0x44')]))[_0xe352('0x19')](_0xe352('0x42'),selectNotIn(_0x5eda6e,_0x13aef5,_0x35c1dc,'cm_hopper',[_0xe352('0x43')])))['toString']();}function insertCmHopperBlack(_0xbccb9,_0x4e0eed,_0x475b3f,_0x376229){var _0x187ccd=['cm_contacts.phone','cm_contacts.id',_0xe352('0x2f'),_0x4e0eed+'.'+_0x376229,_0xe352('0x45'),'cm_contacts.updatedAt'];return squel[_0xe352('0x46')]()[_0xe352('0x32')](_0xe352('0x47'))[_0xe352('0x34')]([_0xe352('0x14'),'ContactId','ListId',_0x376229,_0xe352('0x37'),_0xe352('0x38')],squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x187ccd)[_0xe352('0x15')](_0x4e0eed)[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x3e')+_0x4e0eed+_0xe352('0x3f'))['join'](_0x475b3f,null,_0x475b3f+_0xe352('0x17')+_0x4e0eed+'.'+_0x376229)['where'](_0x4e0eed+_0xe352('0x40'),_0xbccb9)[_0xe352('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe352('0x19')](_0xe352('0x42'),squel[_0xe352('0x12')]()[_0xe352('0x13')]('phone')[_0xe352('0x15')](_0xe352('0x47'))[_0xe352('0x19')]('ListId\x20=\x20?',_0xbccb9)[_0xe352('0x19')](_0x376229+_0xe352('0x48'),_0x4e0eed+'.'+_0x376229)))[_0xe352('0x49')]();}function insertCmHopperAdditionalPhones(_0x55fdd1){var _0x345da6=[_0xe352('0x4a'),_0xe352('0x4b'),_0xe352('0x4c'),_0xe352('0x4d'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xe352('0x32')](_0xe352('0x4e'))[_0xe352('0x34')]([_0xe352('0x4f'),_0xe352('0x14'),_0xe352('0x50'),_0xe352('0x37'),_0xe352('0x38')],squel['select']()[_0xe352('0x3c')](_0x345da6)['from'](_0xe352('0x33'))[_0xe352('0x16')](_0xe352('0x3d'),null,_0xe352('0x51'))[_0xe352('0x16')](_0xe352('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xe352('0x53'),_0x55fdd1)[_0xe352('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xe352('0x49')]();}function insertCmContact(_0x1626fe,_0x52cd6c,_0x904469,_0x2d642f){var _0xa39be9=_[_0xe352('0x54')](_[_0xe352('0x55')](_0x2d642f),[_0xe352('0x56'),'CompanyId','createdAt',_0xe352('0x38')]);return squel[_0xe352('0x46')]()[_0xe352('0x32')](_0xe352('0x3d'))['fromQuery'](_0xa39be9,squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0xa39be9)['from'](_0x52cd6c)[_0xe352('0x19')]('('+_0x904469[_0xe352('0x16')](',')+')\x20NOT\x20IN\x20?',squel[_0xe352('0x12')]()[_0xe352('0x3c')](_0x904469)[_0xe352('0x15')](_0xe352('0x3d'))['where'](_0xe352('0x57'),_0x1626fe))[_0xe352('0x19')](_0xe352('0x58'),squel[_0xe352('0x12')]()[_0xe352('0x13')](_0xe352('0x59'),_0xe352('0x5a'))[_0xe352('0x15')](_0x52cd6c)['group'](_0x904469[_0xe352('0x16')](','))))[_0xe352('0x49')]();}function handleStop(){logger[_0xe352('0x5b')](_0xe352('0x5c'));stopped=!![];}function handleUncaughtException(_0x6254f1){logger[_0xe352('0x5d')](_0x6254f1[_0xe352('0x24')]);process[_0xe352('0x5e')](0x1);}function handleError(_0x49f804,_0x4bfca7){stats[_0xe352('0x5f')]['push']({'name':_0x4bfca7['code'],'message':_0x4bfca7[_0xe352('0x24')],'row':_0x49f804});}function handleQuery(_0x53cbd6){logger['info'](_0x53cbd6);return db[_0xe352('0x1a')][_0xe352('0x1b')](_0x53cbd6)[_0xe352('0x1d')](function(_0x1a303f){results[_0xe352('0x21')](_0x1a303f);})[_0xe352('0x23')](function(_0x8c94d7){logger[_0xe352('0x5d')](_0x8c94d7[_0xe352('0x24')]);});}function main(_0x4439ea,_0x42be58,_0x40e65e,_0x6416e0){logger[_0xe352('0x5b')]('main',_0x4439ea,JSON[_0xe352('0x60')](_0x42be58));process[_0xe352('0x61')](_0xe352('0x62'));var _0x11a1d6=_0x42be58['binding'];var _0x457da1=_['clone'](_0x11a1d6);var _0x50f1b8=_0x42be58[_0xe352('0x63')];var _0x43f381=path[_0xe352('0x16')](config[_0xe352('0x64')],_0xe352('0x65'),_0x50f1b8+_0xe352('0x66'));logger[_0xe352('0x5b')](_0xe352('0x67'),_0x42be58);db[_0xe352('0x68')][_0xe352('0x69')]({'raw':!![],'attributes':['id',_0xe352('0x6a')]})[_0xe352('0x22')](function(_0x2d2678){for(var _0x5283d6=0x0;_0x5283d6<_0x2d2678[_0xe352('0x1e')];_0x5283d6++){if(_0x2d2678[_0x5283d6][_0xe352('0x6a')]in _0x11a1d6){contactItemTypes[_0xe352('0x21')](_0x2d2678[_0x5283d6]);delete _0x457da1[_0x2d2678[_0x5283d6][_0xe352('0x6a')]];hasAdditionalPhones=!![];}for(var _0x1592cb in _0x11a1d6){if(_0x2d2678[_0x5283d6]['name']+_0xe352('0x6b')===_0x1592cb){phoneDescriptions[_0xe352('0x21')]({'itemTypeId':_0x2d2678[_0x5283d6]['id'],'description':_0x1592cb});delete _0x457da1[_0x1592cb];}}}if(hasAdditionalPhones)_0x457da1[_0xe352('0x20')]='';var _0x600586=_['keys'](_0x457da1)['join']();logger[_0xe352('0x5b')](_0xe352('0x6c'),_0x600586);fs[_0xe352('0x6d')](_0x43f381,_0x600586+'\x0a');Papa[_0xe352('0x6e')](fs[_0xe352('0x6f')](_0x4439ea),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37b111,_0x9c9787){try{for(var _0x21a330=0x0,_0x5495d1=[];_0x21a330<_0x37b111[_0xe352('0x70')][_0xe352('0x1e')];_0x21a330++){stats['rows']+=0x1;if(_0x37b111[_0xe352('0x5f')][_0x21a330]){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],_0x37b111['errors'][_0x21a330]);}else{var _0x5f2e47=[];var _0x49c23e=[];var _0x469506={};for(var _0xd3caa8 in _0x11a1d6){let _0x1bd9da=contactItemTypes[_0xe352('0x71')](_0x847647=>_0x847647[_0xe352('0x6a')]===_0xd3caa8);let _0x360102=contactItemTypes[_0xe352('0x71')](_0x566376=>_0x566376['name']+_0xe352('0x6b')===_0xd3caa8);if(_[_0xe352('0x1f')](_0x1bd9da)&&_['isNil'](_0x360102)){if(_0x11a1d6[_0xe352('0x72')](_0xd3caa8)){if(_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0xd3caa8]]){var _0x479076=_['trim'](_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0xd3caa8]]['replace'](/"/g,'\x27'));switch(_0xd3caa8){case _0xe352('0x35'):var _0x1a9b08=moment(_0x479076,_0xe352('0xe'),!![]);if(_0x1a9b08['isValid']()){_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}else{_0x5f2e47[_0xe352('0x21')](_0xe352('0x73'));}break;case _0xe352('0x39'):var _0x5453cf=parseInt(_0x479076);_0x479076=_['isNaN'](_0x5453cf)||_0x5453cf<0x0||_0x5453cf>0x4?_0x6416e0?0x3:0x2:_0x5453cf;_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');break;case _0xe352('0x3a'):var _0x30466b=parseInt(_0x479076);if(_['isNumber'](_0x30466b)&&_[_0xe352('0x74')](_0x40e65e,_0x30466b)){_0x5495d1[_0xe352('0x21')]('\x22'+_0x30466b+'\x22');}else{_0x5f2e47[_0xe352('0x21')]('agent\x20not\x20exists');}break;case _0xe352('0x75'):if(isEmail(_0x479076)){_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}else{_0x5f2e47[_0xe352('0x21')](_0xe352('0x76'));}break;case'dateOfBirth':var _0x25da38=moment(_0x479076,_0xe352('0x77'),!![]);if(_0x25da38[_0xe352('0x78')]()){_0x5495d1['push']('\x22'+_0x479076+'\x22');}else{_0x5f2e47['push'](_0xe352('0x79'));}break;default:_0x5495d1[_0xe352('0x21')]('\x22'+_0x479076+'\x22');}}else{switch(_0xd3caa8){case _0xe352('0x7a'):case _0xe352('0x14'):_0x5f2e47[_0xe352('0x21')](_0xd3caa8+'\x20not\x20specified');break;default:_0x5495d1['push']('\x22\x22');}}}}else{var _0x7afddc='';if(!_[_0xe352('0x1f')](_0x1bd9da)){if(!_0x469506[_0xe352('0x72')](_0x1bd9da['id'])){for(var _0x34c898=0x0;_0x34c898<_0x11a1d6[_0xd3caa8][_0xe352('0x1e')];_0x34c898++){var _0x479076=_[_0xe352('0x7b')](_0x37b111['data'][_0x21a330][_0x11a1d6[_0xd3caa8][_0x34c898]][_0xe352('0x7c')](/"/g,'\x27'));var _0x15e191=phoneDescriptions[_0xe352('0x71')](_0x2e7ce0=>_0x2e7ce0[_0xe352('0x7d')]===_0x1bd9da['id']);if(!_[_0xe352('0x1f')](_0x15e191)){var _0x2f4e1a=_[_0xe352('0x7b')](_0x37b111[_0xe352('0x70')][_0x21a330][_0x11a1d6[_0x15e191[_0xe352('0x7e')]][0x0]][_0xe352('0x7c')](/"/g,'\x27'));if(!_[_0xe352('0x1f')](_0x2f4e1a))_0x479076=_0x479076+'§'+_0x2f4e1a;}if(_0x7afddc=='')_0x7afddc=_0x479076;else _0x7afddc+='|'+_0x479076;}_0x49c23e['push'](_0x1bd9da['id']+':'+_0x7afddc);_0x469506[_0x1bd9da['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5495d1[_0xe352('0x21')]('\x22'+_0x49c23e[_0xe352('0x16')](';')+'\x22');}if(_0x5f2e47['length']){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],{'code':'SystemRow','message':_0x5f2e47[_0xe352('0x16')]()});}else{fs[_0xe352('0x7f')](_0x43f381,_0x5495d1[_0xe352('0x16')]()+'\x0a');}_0x5495d1=[];}if(!(stats[_0xe352('0x80')]%0xc8)){socket[_0xe352('0x81')](_0xe352('0x82')+_0x50f1b8,stats);stats[_0xe352('0x5f')]=[];}}if(stopped){logger['info'](_0xe352('0x83'));_0x9c9787[_0xe352('0x84')]();}}catch(_0x441f71){handleError(_0x37b111[_0xe352('0x70')][_0x21a330],{'code':'SystemError','message':_0x441f71[_0xe352('0x24')]});logger[_0xe352('0x5d')]('step',_0x441f71[_0xe352('0x24')]);}},'complete':function(){try{var _0x3f768d=[];var _0x18d93f=tempTableName;_0x3f768d[_0xe352('0x21')](_0xe352('0x85')+_0x18d93f+_0xe352('0x86'));logger['info'](_0xe352('0x87'),contactItemTypes[_0xe352('0x1e')]);var _0x4715bc=util[_0xe352('0xd')](_0xe352('0x88'),_0x43f381,_0x18d93f,_0x600586,_0x42be58[_0xe352('0x56')],_0x42be58[_0xe352('0x89')]||null,NOW,NOW);if(_[_0xe352('0x1f')](_0x11a1d6[_0xe352('0x35')])){_0x4715bc+=_0xe352('0x8a');}_0x3f768d[_0xe352('0x21')](_0x4715bc);BPromise[_0xe352('0x8b')](_0x3f768d,handleQuery)[_0xe352('0x22')](function(_0x423adb){BPromise[_0xe352('0x26')]([handleAdditionalPhones()])[_0xe352('0x22')](function(){_0x3f768d=[];for(var _0x418c36=0x0;_0x418c36=_0x439685){return _0x3e7f4d[_0xc269('0x13')](0x193)[_0xc269('0x14')]({'message':util[_0xc269('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x886e5c)});}_0x435003();})['catch'](function(_0x19f243){_0x435003(_0x19f243);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc269('0x15')],{'where':{'$or':[{'role':_0xc269('0x16')},{'role':_0xc269('0x17')}]}});}exports[_0xc269('0x18')]=isUserLimit; \ No newline at end of file +var _0x21c9=['aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','License','findOne','count','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','split'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x21c9,0xea));var _0x921c=function(_0x20990b,_0x295e09){_0x20990b=_0x20990b-0x0;var _0x2e847e=_0x21c9[_0x20990b];return _0x2e847e;};'use strict';var crypto=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var compose=require(_0x921c('0x2'));var db=require(_0x921c('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3e0b07,_0x20c97b){if(_0x3e0b07&&_0x20c97b){if(_0x20c97b['data1']&&_0x20c97b[_0x921c('0x4')]){var _0x5123e1=_0x20c97b['data1'];var _0x7b6f50=_0x20c97b[_0x921c('0x4')];var _0xbd5685=_0x5123e1[_0x921c('0x5')]('-')[0x4];var _0x13cbba=_0x5123e1[_0x921c('0x5')]('-')[0x0];var _0x4ed3af=crypto['createDecipher'](_0x921c('0x6'),util['format'](_0x921c('0x7'),_0xbd5685,_0x5123e1,_0x13cbba));var _0x4eb749=_0x4ed3af[_0x921c('0x8')](_0x7b6f50,_0x921c('0x9'),'utf8');_0x4eb749+=_0x4ed3af[_0x921c('0xa')](_0x921c('0xb'));var _0x55da04=JSON[_0x921c('0xc')](_0x4eb749);return _0x55da04['hasOwnProperty'](_0x3e0b07)?_0x55da04[_0x3e0b07]:null;}}return null;}function isLimit(_0x185c1e,_0x15b1b0,_0x43f7e8,_0x5e850f){var _0x4f47cc=_0x15b1b0;return compose()['use'](function(_0x12805d,_0x2d59a0,_0x15f569){return db[_0x921c('0xd')][_0x921c('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x33174d){var _0x1651c7=getValueFromLicense(_0x185c1e,_0x33174d);return _0x1651c7?_0x1651c7:_0x4f47cc;})['then'](function(_0x5cf13c){_0x4f47cc=_0x5cf13c;return _0x43f7e8[_0x921c('0xf')](_0x5e850f);})[_0x921c('0x10')](function(_0x348bf7){if(_0x348bf7>=_0x4f47cc){return _0x2d59a0['status'](0x193)[_0x921c('0x11')]({'message':util['format'](_0x921c('0x12'),_0x185c1e)});}_0x15f569();})['catch'](function(_0x5a39f6){_0x15f569(_0x5a39f6);});});}function isUserLimit(){return isLimit(_0x921c('0x13'),0x1,db[_0x921c('0x14')],{'where':{'$or':[{'role':_0x921c('0x15')},{'role':_0x921c('0x16')}]}});}exports[_0x921c('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index ba14f22..e2225ab 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 _0x56ee=['IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','<\x20?','>\x20?','$lte','$gte','start','$substring','pop','format','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','filter','indexOf','map','buildExpression','DATE','$eq','$between','value','includes','$gt','operator','add','days','YYYY-MM-DD','castTo','CAST(','field','text','$ne','\x20OR\x20','\x20IS\x20NULL)','$in'];(function(_0x2aea67,_0xc83555){var _0x55460f=function(_0x2c5f45){while(--_0x2c5f45){_0x2aea67['push'](_0x2aea67['shift']());}};_0x55460f(++_0xc83555);}(_0x56ee,0x7c));var _0xe56e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x56ee[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xe56e('0x0'));var moment=require(_0xe56e('0x1'));exports[_0xe56e('0x2')]=function(_0x5b5c78){var _0x3d1456={'conditions':[]};_0x3d1456[_0xe56e('0x3')]=_[_0xe56e('0x4')](_0x5b5c78,_0xe56e('0x5'))?'or':_0xe56e('0x6');var _0x1016a6=_0x5b5c78[_0xe56e('0x7')]('[$and]','')[_0xe56e('0x7')](_0xe56e('0x5'),'')[_0xe56e('0x8')]('||');for(var _0x5dcf46=0x0;_0x5dcf46<_0x1016a6[_0xe56e('0x9')];_0x5dcf46++){var _0x207401=_0x1016a6[_0x5dcf46][_0xe56e('0x8')](':=');var _0x1c99b1=_0x207401[0x0];var _0x142813=_0x207401[_0xe56e('0xa')](0x1);_0x142813[_0xe56e('0xb')](function(_0x3ed45a){var _0x30f49a=_0x3ed45a['split']('[')[_0xe56e('0xc')]();var _0x8fed76=_0x3ed45a['match'](/\[(.*?)\]/g);_0x8fed76['forEach'](function(_0x487d4d){var _0x1605ec=_0x487d4d['split']('[')[_0xe56e('0xd')](function(_0x33cc29){return _0x33cc29[_0xe56e('0xe')](']')>-0x1;})[_0xe56e('0xf')](function(_0x40fc23){return _0x40fc23['split'](']')[0x0];})[0x0];_0x3d1456['conditions']['push']({'field':_0x1c99b1,'operator':_0x30f49a,'value':_0x1605ec});});});}return _0x3d1456;};exports[_0xe56e('0x10')]=function(_0xf191a4,_0x19e685,_0x21e385){var _0xcd4729={};if(_0x19e685===_0xe56e('0x11')){if(_0x21e385['operator']===_0xe56e('0x12')){_0x21e385['operator']=_0xe56e('0x13');_0x21e385[_0xe56e('0x14')]+=','+_0x21e385[_0xe56e('0x14')];}else if(_[_0xe56e('0x15')]([_0xe56e('0x16'),'$lte'],_0x21e385[_0xe56e('0x17')])){_0x21e385[_0xe56e('0x14')]=moment(_0x21e385[_0xe56e('0x14')])[_0xe56e('0x18')](0x1,_0xe56e('0x19'))['format'](_0xe56e('0x1a'));}}if(_0x21e385['castTo']){_0x19e685=_0x21e385[_0xe56e('0x1b')];_0xcd4729['text']=_0xe56e('0x1c')+_0xf191a4+'.'+_0x21e385[_0xe56e('0x1d')]+'\x20AS\x20'+_0x21e385[_0xe56e('0x1b')]+')\x20'+parseOperator(_0x21e385['operator']);}else{_0xcd4729[_0xe56e('0x1e')]=_0xf191a4+'.'+_0x21e385[_0xe56e('0x1d')]+'\x20'+parseOperator(_0x21e385['operator']);}if(_[_0xe56e('0x15')]([_0xe56e('0x1f'),'$notIn'],_0x21e385[_0xe56e('0x17')]))_0xcd4729['text']='('+_0xcd4729['text']+_0xe56e('0x20')+_0xf191a4+'.'+_0x21e385[_0xe56e('0x1d')]+_0xe56e('0x21');_0xcd4729[_0xe56e('0x14')]=parseValue(_0x19e685,_0x21e385[_0xe56e('0x17')],_0x21e385['value']);return _0xcd4729;};function parseOperator(_0x1cad41){var _0x422e37;switch(_0x1cad41){case _0xe56e('0x22'):_0x422e37=_0xe56e('0x23');break;case _0xe56e('0x24'):_0x422e37=_0xe56e('0x25');break;case _0xe56e('0x12'):_0x422e37=_0xe56e('0x26');break;case _0xe56e('0x1f'):_0x422e37=_0xe56e('0x27');break;case'$substring':case _0xe56e('0x28'):case _0xe56e('0x29'):_0x422e37='LIKE\x20?';break;case'$lt':_0x422e37=_0xe56e('0x2a');break;case'$gt':_0x422e37=_0xe56e('0x2b');break;case _0xe56e('0x2c'):_0x422e37='<=\x20?';break;case _0xe56e('0x2d'):_0x422e37='>=\x20?';break;case _0xe56e('0x13'):_0x422e37='BETWEEN\x20?\x20AND\x20?';break;}return _0x422e37;}function parseValue(_0x38dd59,_0x2b1922,_0x32d881){var _0x3ca05b={'start':undefined,'end':undefined};switch(_0x2b1922){case _0xe56e('0x22'):case _0xe56e('0x24'):_0x3ca05b[_0xe56e('0x2e')]=_0x32d881[_0xe56e('0x8')](',');break;case _0xe56e('0x2f'):_0x3ca05b[_0xe56e('0x2e')]='%'+_0x32d881+'%';break;case _0xe56e('0x28'):_0x3ca05b[_0xe56e('0x2e')]=_0x32d881+'%';break;case _0xe56e('0x29'):_0x3ca05b[_0xe56e('0x2e')]='%'+_0x32d881;break;case _0xe56e('0x13'):var _0x23cb07=_0x32d881[_0xe56e('0x8')](',');var _0x32d881=_0x23cb07[_0xe56e('0xc')]();var _0x3860bc=_0x23cb07[_0xe56e('0x30')]();if(_0x38dd59===_0xe56e('0x11')){_0x32d881=moment(_0x32d881)['utcOffset'](0x0,!![])[_0xe56e('0x31')]();_0x3860bc=moment(_0x3860bc)[_0xe56e('0x32')](0x0,!![])[_0xe56e('0x18')](0x17,_0xe56e('0x33'))[_0xe56e('0x18')](0x3b,'minutes')['add'](0x3b,_0xe56e('0x34'))['format']();}_0x3ca05b={'start':_0x32d881,'end':_0x3860bc};break;default:_0x3ca05b[_0xe56e('0x2e')]=_0x32d881;break;}return _0x3ca05b;} \ No newline at end of file +var _0xa765=['moment','parseSearch','sqlOperator','startsWith','replace','[$and]','split','length','slice','forEach','match','conditions','push','buildExpression','operator','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$eq','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','$endsWith','shift','pop','DATE','utcOffset','hours','seconds','lodash'];(function(_0x5dba12,_0x42b834){var _0x15eecc=function(_0x435a25){while(--_0x435a25){_0x5dba12['push'](_0x5dba12['shift']());}};_0x15eecc(++_0x42b834);}(_0xa765,0x180));var _0x5a76=function(_0x51b832,_0x4473fe){_0x51b832=_0x51b832-0x0;var _0x4dce97=_0xa765[_0x51b832];return _0x4dce97;};'use strict';var _=require(_0x5a76('0x0'));var moment=require(_0x5a76('0x1'));exports[_0x5a76('0x2')]=function(_0x349ab8){var _0x4786bd={'conditions':[]};_0x4786bd[_0x5a76('0x3')]=_[_0x5a76('0x4')](_0x349ab8,'[$or]')?'or':'and';var _0x503f7a=_0x349ab8[_0x5a76('0x5')](_0x5a76('0x6'),'')[_0x5a76('0x5')]('[$or]','')[_0x5a76('0x7')]('||');for(var _0x23ba83=0x0;_0x23ba83<_0x503f7a[_0x5a76('0x8')];_0x23ba83++){var _0x45954b=_0x503f7a[_0x23ba83]['split'](':=');var _0x1a75a7=_0x45954b[0x0];var _0x2b1451=_0x45954b[_0x5a76('0x9')](0x1);_0x2b1451[_0x5a76('0xa')](function(_0x19379e){var _0x5205f9=_0x19379e[_0x5a76('0x7')]('[')['shift']();var _0x488412=_0x19379e[_0x5a76('0xb')](/\[(.*?)\]/g);_0x488412[_0x5a76('0xa')](function(_0x3ec4ee){var _0x4abef4=_0x3ec4ee[_0x5a76('0x7')]('[')['filter'](function(_0xa3fe47){return _0xa3fe47['indexOf'](']')>-0x1;})['map'](function(_0x1ae5b7){return _0x1ae5b7[_0x5a76('0x7')](']')[0x0];})[0x0];_0x4786bd[_0x5a76('0xc')][_0x5a76('0xd')]({'field':_0x1a75a7,'operator':_0x5205f9,'value':_0x4abef4});});});}return _0x4786bd;};exports[_0x5a76('0xe')]=function(_0x752f5f,_0x22c080,_0x1c5978){var _0x5be131={};if(_0x22c080==='DATE'){if(_0x1c5978['operator']==='$eq'){_0x1c5978[_0x5a76('0xf')]=_0x5a76('0x10');_0x1c5978[_0x5a76('0x11')]+=','+_0x1c5978[_0x5a76('0x11')];}else if(_[_0x5a76('0x12')](['$gt',_0x5a76('0x13')],_0x1c5978[_0x5a76('0xf')])){_0x1c5978[_0x5a76('0x11')]=moment(_0x1c5978[_0x5a76('0x11')])[_0x5a76('0x14')](0x1,_0x5a76('0x15'))[_0x5a76('0x16')](_0x5a76('0x17'));}}if(_0x1c5978[_0x5a76('0x18')]){_0x22c080=_0x1c5978[_0x5a76('0x18')];_0x5be131['text']=_0x5a76('0x19')+_0x752f5f+'.'+_0x1c5978[_0x5a76('0x1a')]+_0x5a76('0x1b')+_0x1c5978[_0x5a76('0x18')]+')\x20'+parseOperator(_0x1c5978['operator']);}else{_0x5be131[_0x5a76('0x1c')]=_0x752f5f+'.'+_0x1c5978['field']+'\x20'+parseOperator(_0x1c5978[_0x5a76('0xf')]);}if(_[_0x5a76('0x12')]([_0x5a76('0x1d'),_0x5a76('0x1e')],_0x1c5978[_0x5a76('0xf')]))_0x5be131[_0x5a76('0x1c')]='('+_0x5be131[_0x5a76('0x1c')]+_0x5a76('0x1f')+_0x752f5f+'.'+_0x1c5978[_0x5a76('0x1a')]+_0x5a76('0x20');_0x5be131[_0x5a76('0x11')]=parseValue(_0x22c080,_0x1c5978[_0x5a76('0xf')],_0x1c5978[_0x5a76('0x11')]);return _0x5be131;};function parseOperator(_0x291bc0){var _0x13b768;switch(_0x291bc0){case'$in':_0x13b768='IN\x20?';break;case _0x5a76('0x1e'):_0x13b768='NOT\x20IN\x20?';break;case _0x5a76('0x21'):_0x13b768=_0x5a76('0x22');break;case _0x5a76('0x1d'):_0x13b768=_0x5a76('0x23');break;case'$substring':case _0x5a76('0x24'):case'$endsWith':_0x13b768=_0x5a76('0x25');break;case _0x5a76('0x26'):_0x13b768=_0x5a76('0x27');break;case'$gt':_0x13b768=_0x5a76('0x28');break;case'$lte':_0x13b768=_0x5a76('0x29');break;case _0x5a76('0x2a'):_0x13b768=_0x5a76('0x2b');break;case _0x5a76('0x10'):_0x13b768=_0x5a76('0x2c');break;}return _0x13b768;}function parseValue(_0x226ee8,_0x527440,_0x2251a8){var _0x144fd9={'start':undefined,'end':undefined};switch(_0x527440){case _0x5a76('0x2d'):case'$notIn':_0x144fd9[_0x5a76('0x2e')]=_0x2251a8[_0x5a76('0x7')](',');break;case _0x5a76('0x2f'):_0x144fd9[_0x5a76('0x2e')]='%'+_0x2251a8+'%';break;case _0x5a76('0x24'):_0x144fd9[_0x5a76('0x2e')]=_0x2251a8+'%';break;case _0x5a76('0x30'):_0x144fd9[_0x5a76('0x2e')]='%'+_0x2251a8;break;case'$between':var _0x4723fb=_0x2251a8[_0x5a76('0x7')](',');var _0x2251a8=_0x4723fb[_0x5a76('0x31')]();var _0x5476e8=_0x4723fb[_0x5a76('0x32')]();if(_0x226ee8===_0x5a76('0x33')){_0x2251a8=moment(_0x2251a8)['utcOffset'](0x0,!![])[_0x5a76('0x16')]();_0x5476e8=moment(_0x5476e8)[_0x5a76('0x34')](0x0,!![])[_0x5a76('0x14')](0x17,_0x5a76('0x35'))[_0x5a76('0x14')](0x3b,'minutes')[_0x5a76('0x14')](0x3b,_0x5a76('0x36'))['format']();}_0x144fd9={'start':_0x2251a8,'end':_0x5476e8};break;default:_0x144fd9['start']=_0x2251a8;break;}return _0x144fd9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index df83b9e..c3ec384 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 _0x9c5a=['YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','sort','indexOf','col','priority','unsigned','substr','DESC','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','replace','push','join','getOptions','query','$id','name','intersection','model','attributes','nolimit','order','filter','object','columns','value','where','VIRTUAL','lower','merge','options','lodash','sequelize','parse','keys','includes','fields','split','filters','find','type','DATE','isPlainObject','format'];(function(_0x33c1cc,_0x4841d5){var _0x35f979=function(_0x655ee3){while(--_0x655ee3){_0x33c1cc['push'](_0x33c1cc['shift']());}};_0x35f979(++_0x4841d5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x323401,_0x48854a){_0x323401=_0x323401-0x0;var _0x2d5701=_0x9c5a[_0x323401];return _0x2d5701;};'use strict';var _=require(_0xa9c5('0x0'));var sequelize=require(_0xa9c5('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x32ab4d){var _0x1cd14d=['ne'];try{var _0x1d0ee9=JSON[_0xa9c5('0x2')](_0x32ab4d);var _0x4f5552=Object[_0xa9c5('0x3')](_0x1d0ee9)[0x0];return _0x1cd14d[_0xa9c5('0x4')](_0x4f5552);}catch(_0x4e9403){return![];}}function getOperatorValue(_0x1e3c83){var _0x4d9c7a=JSON[_0xa9c5('0x2')](_0x1e3c83);var _0x3df556=Object['keys'](_0x4d9c7a)[0x0];var _0x4b6db6=_0x4d9c7a[_0x3df556];return{['$'+_0x3df556]:_0x4b6db6};}exports[_0xa9c5('0x5')]=function(_0x16f331){var _0x52afb2=null;if(_0x16f331){_0x52afb2=_0x16f331[_0xa9c5('0x6')](',');}return _0x52afb2;};exports[_0xa9c5('0x7')]=function(_0x51c14c,_0x2e4f45){var _0x40a79d={};if(!_['isEmpty'](_0x51c14c)){_['forOwn'](_0x51c14c,function(_0x38e106,_0x11421c){try{if(_0x2e4f45){var _0x45f8d8=_[_0xa9c5('0x8')](_0x2e4f45,{'name':_0x11421c})||{};if(hasSequelizeOperator(_0x38e106)){_0x40a79d[_0x11421c]=getOperatorValue(_0x38e106);}else if(_0x45f8d8[_0xa9c5('0x9')]===_0xa9c5('0xa')&&_[_0xa9c5('0xb')](_0x38e106)){var _0x42d5cf=JSON[_0xa9c5('0x2')](_0x38e106);var _0x1ea48={'$gte':moment(moment(_0x42d5cf['$gte'])[_0xa9c5('0xc')](_0xa9c5('0xd')))[_0xa9c5('0xe')]()[_0xa9c5('0xc')](),'$lte':moment(moment(_0x42d5cf[_0xa9c5('0xf')])[_0xa9c5('0xc')](_0xa9c5('0xd')))[_0xa9c5('0xe')]()[_0xa9c5('0x10')](0x1,'s')[_0xa9c5('0xc')]()};_0x40a79d[_0x11421c]=_0x1ea48;}else if(_0x45f8d8['name']===_0xa9c5('0x11')){_0x40a79d[_0x11421c]=_0x38e106;}else{_0x40a79d[_0x11421c]=_[_0xa9c5('0x12')](_0x38e106)?_0x38e106:JSON[_0xa9c5('0x2')](_0x38e106);}}else{_0x40a79d[_0x11421c]=_['isArray'](_0x38e106)?_0x38e106:JSON[_0xa9c5('0x2')](_0x38e106);}}catch(_0x1142d9){_0x40a79d[_0x11421c]=_0x38e106[_0xa9c5('0x6')](',');}});}return _0x40a79d;};exports[_0xa9c5('0x13')]=function(_0x452a9b){_0x452a9b=parseInt(_0x452a9b,0xa);if(!_0x452a9b||_0x452a9b<0x0){_0x452a9b=LIMIT_VALUE;}return _0x452a9b;};exports[_0xa9c5('0x14')]=function(_0x3b8d4d){_0x3b8d4d=parseInt(_0x3b8d4d,0xa);if(!_0x3b8d4d||_0x3b8d4d<0x0){_0x3b8d4d=0x0;}return _0x3b8d4d;};exports[_0xa9c5('0x15')]=function(_0x2c7cd5){var _0x36c486,_0x113c8f=null;if(_0x2c7cd5){_0x36c486=_0x2c7cd5[_0xa9c5('0x6')](',');_0x113c8f=_['map'](_0x36c486,function(_0x1115ad){if(_0x1115ad[_0xa9c5('0x16')]('-')===0x0){return[_0x1115ad==='priority'?sequelize['cast'](sequelize[_0xa9c5('0x17')](_0xa9c5('0x18')),_0xa9c5('0x19')):_0x1115ad[_0xa9c5('0x1a')](0x1),_0xa9c5('0x1b')];}else{return[_0x1115ad===_0xa9c5('0x18')?sequelize['cast'](sequelize['col'](_0xa9c5('0x18')),_0xa9c5('0x19')):_0x1115ad,'ASC'];}});}return _0x113c8f;};exports[_0xa9c5('0x1c')]=function(_0x424b4c,_0x306c9b){if(_[_0xa9c5('0x1d')](_0x424b4c)){return _0x424b4c;}if(_[_0xa9c5('0x12')](_0x424b4c)){for(var _0x40f08b=0x0;_0x40f08b<_0x424b4c[_0xa9c5('0x1e')];_0x40f08b+=0x1){_0x424b4c[_0x40f08b]=this['omit'](_0x424b4c[_0x40f08b],_0x306c9b);}return _0x424b4c;}if(!_['isObject'](_0x424b4c)){return _0x424b4c;}if(_[_0xa9c5('0x1f')](_0x306c9b)){_0x306c9b=[_0x306c9b];}if(!_['isArray'](_0x306c9b)){return _0x424b4c;}for(var _0x1762ac=0x0;_0x1762ac<_0x306c9b[_0xa9c5('0x1e')];_0x1762ac+=0x1){_['unset'](_0x424b4c,_0x306c9b[_0x1762ac]);}for(var _0x11a723 in _0x424b4c){if(_0x424b4c[_0xa9c5('0x20')](_0x11a723)){_0x424b4c[_0x11a723]=this['omit'](_0x424b4c[_0x11a723],_0x306c9b);}}return _0x424b4c;};exports[_0xa9c5('0x21')]=function(_0x32baf9){return _0x32baf9[_0xa9c5('0x22')](RegExp(_0xa9c5('0x23')))?!![]:![];};exports[_0xa9c5('0x24')]=function(_0x4f6e70){return _0x4f6e70[_0xa9c5('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3c3da7){var _0x1ef388=[];_0x3c3da7[_0xa9c5('0x6')](/[ ,]+/)['forEach'](function(_0xc6d0c1){_0xc6d0c1=_0xc6d0c1[_0xa9c5('0x25')](/([^:]")"+/g,'$1');_0xc6d0c1='+'+_0xc6d0c1+'*';var _0x5bc9bb=/[ `!@#$%^&*()_\-?~]/;if(_0xc6d0c1[_0xa9c5('0x22')](_0x5bc9bb))_0xc6d0c1='\x22'+_0xc6d0c1+'\x22';_0x1ef388[_0xa9c5('0x26')](_0xc6d0c1);});return _0x1ef388[_0xa9c5('0x27')]('\x20');};exports[_0xa9c5('0x28')]=function(_0x22ee21,_0x3392d0,_0x3a66d8){var _0x4b9104={},_0x452330={};if(_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')]){_0x3392d0[_0xa9c5('0x29')]['id']=_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')];delete _0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')];}_0x4b9104['model']=_['map'](_0x22ee21,_0xa9c5('0x2b'));_0x4b9104[_0xa9c5('0x29')]=_[_0xa9c5('0x3')](_0x3392d0[_0xa9c5('0x29')]);_0x4b9104[_0xa9c5('0x7')]=_[_0xa9c5('0x2c')](_0x4b9104['model'],_0x4b9104['query']);_0x452330['attributes']=_[_0xa9c5('0x2c')](_0x4b9104[_0xa9c5('0x2d')],this['fields'](_0x3392d0[_0xa9c5('0x29')]['fields']));_0x452330[_0xa9c5('0x2e')]=_0x452330[_0xa9c5('0x2e')][_0xa9c5('0x1e')]?_0x452330[_0xa9c5('0x2e')]:_0x4b9104['model'];if(!_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x20')](_0xa9c5('0x2f'))){_0x452330[_0xa9c5('0x13')]=this[_0xa9c5('0x13')](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x13')]);_0x452330[_0xa9c5('0x14')]=this['offset'](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x14')]);}_0x452330[_0xa9c5('0x30')]=this[_0xa9c5('0x15')](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x15')]);_0x452330['where']=this[_0xa9c5('0x7')](_['pick'](_0x3392d0[_0xa9c5('0x29')],_0x4b9104['filters']),_0x22ee21);if(_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]){var _0x37fb1b=_0x22ee21;var _0x5d09c5=_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')];if(typeof _0x5d09c5===_0xa9c5('0x32')){_0x37fb1b=_[_0xa9c5('0x31')](_0x22ee21,function(_0x5914d2){return _[_0xa9c5('0x4')](_0x5d09c5[_0xa9c5('0x33')],_0x5914d2[_0xa9c5('0x2b')]);});_0x5d09c5=_0x5d09c5[_0xa9c5('0x34')];}_0x452330[_0xa9c5('0x35')]=_['merge'](_0x452330[_0xa9c5('0x35')],{'$or':_['map'](_0x37fb1b,function(_0x1de605){if(_0x1de605[_0xa9c5('0x9')]!==_0xa9c5('0x36')){if(_0x3a66d8){return sequelize[_0xa9c5('0x35')](sequelize['fn'](_0xa9c5('0x37'),sequelize[_0xa9c5('0x17')](_0x1de605[_0xa9c5('0x2b')])),{'$like':sequelize['fn'](_0xa9c5('0x37'),'%'+_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]+'%')});}else{var _0x4aa4dd={};_0x4aa4dd[_0x1de605[_0xa9c5('0x2b')]]={'$like':'%'+_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]+'%'};return _0x4aa4dd;}}})});}_0x452330=_[_0xa9c5('0x38')]({},_0x452330,_0x3392d0[_0xa9c5('0x39')]);return _0x452330;}; \ No newline at end of file +var _0x7bae=['omit','isObject','isString','length','unset','match','^[+]?[0-9]*$','getFullTextValue','replace','getOptions','query','$id','model','name','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','object','columns','merge','type','VIRTUAL','lower','options','moment','keys','includes','parse','fields','split','isEmpty','forOwn','find','DATE','$gte','format','YYYY-MM-DD','$lte','subtract','isArray','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast'];(function(_0x215499,_0xc2ac8b){var _0x4724d2=function(_0x3b66d7){while(--_0x3b66d7){_0x215499['push'](_0x215499['shift']());}};_0x4724d2(++_0xc2ac8b);}(_0x7bae,0x13b));var _0xe7ba=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x7bae[_0x2df507];return _0x1f7167;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xe7ba('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1e05c4){var _0x503803=['ne'];try{var _0x3963c7=JSON['parse'](_0x1e05c4);var _0x120efa=Object[_0xe7ba('0x1')](_0x3963c7)[0x0];return _0x503803[_0xe7ba('0x2')](_0x120efa);}catch(_0x2276df){return![];}}function getOperatorValue(_0x398a6a){var _0xfd3a22=JSON[_0xe7ba('0x3')](_0x398a6a);var _0x3c5e59=Object[_0xe7ba('0x1')](_0xfd3a22)[0x0];var _0x34fb18=_0xfd3a22[_0x3c5e59];return{['$'+_0x3c5e59]:_0x34fb18};}exports[_0xe7ba('0x4')]=function(_0x27b1d5){var _0x41c39d=null;if(_0x27b1d5){_0x41c39d=_0x27b1d5[_0xe7ba('0x5')](',');}return _0x41c39d;};exports['filters']=function(_0x3df8bf,_0xe57e33){var _0x375ebb={};if(!_[_0xe7ba('0x6')](_0x3df8bf)){_[_0xe7ba('0x7')](_0x3df8bf,function(_0x1672f0,_0x99a86f){try{if(_0xe57e33){var _0x448bcc=_[_0xe7ba('0x8')](_0xe57e33,{'name':_0x99a86f})||{};if(hasSequelizeOperator(_0x1672f0)){_0x375ebb[_0x99a86f]=getOperatorValue(_0x1672f0);}else if(_0x448bcc['type']===_0xe7ba('0x9')&&_['isPlainObject'](_0x1672f0)){var _0x602b1=JSON[_0xe7ba('0x3')](_0x1672f0);var _0x390596={'$gte':moment(moment(_0x602b1[_0xe7ba('0xa')])[_0xe7ba('0xb')](_0xe7ba('0xc')))['utc']()['format'](),'$lte':moment(moment(_0x602b1[_0xe7ba('0xd')])[_0xe7ba('0xb')](_0xe7ba('0xc')))['utc']()[_0xe7ba('0xe')](0x1,'s')['format']()};_0x375ebb[_0x99a86f]=_0x390596;}else if(_0x448bcc['name']==='uniqueid'){_0x375ebb[_0x99a86f]=_0x1672f0;}else{_0x375ebb[_0x99a86f]=_[_0xe7ba('0xf')](_0x1672f0)?_0x1672f0:JSON['parse'](_0x1672f0);}}else{_0x375ebb[_0x99a86f]=_[_0xe7ba('0xf')](_0x1672f0)?_0x1672f0:JSON['parse'](_0x1672f0);}}catch(_0x4e3021){_0x375ebb[_0x99a86f]=_0x1672f0['split'](',');}});}return _0x375ebb;};exports[_0xe7ba('0x10')]=function(_0x30086c){_0x30086c=parseInt(_0x30086c,0xa);if(!_0x30086c||_0x30086c<0x0){_0x30086c=LIMIT_VALUE;}return _0x30086c;};exports[_0xe7ba('0x11')]=function(_0x3c06c3){_0x3c06c3=parseInt(_0x3c06c3,0xa);if(!_0x3c06c3||_0x3c06c3<0x0){_0x3c06c3=0x0;}return _0x3c06c3;};exports[_0xe7ba('0x12')]=function(_0x58550c){var _0x149c62,_0x20c653=null;if(_0x58550c){_0x149c62=_0x58550c[_0xe7ba('0x5')](',');_0x20c653=_[_0xe7ba('0x13')](_0x149c62,function(_0x4aaf35){if(_0x4aaf35[_0xe7ba('0x14')]('-')===0x0){return[_0x4aaf35===_0xe7ba('0x15')?sequelize['cast'](sequelize[_0xe7ba('0x16')](_0xe7ba('0x15')),_0xe7ba('0x17')):_0x4aaf35[_0xe7ba('0x18')](0x1),_0xe7ba('0x19')];}else{return[_0x4aaf35===_0xe7ba('0x15')?sequelize[_0xe7ba('0x1a')](sequelize[_0xe7ba('0x16')](_0xe7ba('0x15')),_0xe7ba('0x17')):_0x4aaf35,'ASC'];}});}return _0x20c653;};exports['omit']=function(_0x4dcc7b,_0x4cd124){if(_[_0xe7ba('0x6')](_0x4dcc7b)){return _0x4dcc7b;}if(_['isArray'](_0x4dcc7b)){for(var _0x4ecc0d=0x0;_0x4ecc0d<_0x4dcc7b['length'];_0x4ecc0d+=0x1){_0x4dcc7b[_0x4ecc0d]=this[_0xe7ba('0x1b')](_0x4dcc7b[_0x4ecc0d],_0x4cd124);}return _0x4dcc7b;}if(!_[_0xe7ba('0x1c')](_0x4dcc7b)){return _0x4dcc7b;}if(_[_0xe7ba('0x1d')](_0x4cd124)){_0x4cd124=[_0x4cd124];}if(!_[_0xe7ba('0xf')](_0x4cd124)){return _0x4dcc7b;}for(var _0x3435c6=0x0;_0x3435c6<_0x4cd124[_0xe7ba('0x1e')];_0x3435c6+=0x1){_[_0xe7ba('0x1f')](_0x4dcc7b,_0x4cd124[_0x3435c6]);}for(var _0x3a59d6 in _0x4dcc7b){if(_0x4dcc7b['hasOwnProperty'](_0x3a59d6)){_0x4dcc7b[_0x3a59d6]=this[_0xe7ba('0x1b')](_0x4dcc7b[_0x3a59d6],_0x4cd124);}}return _0x4dcc7b;};exports['isNumeric']=function(_0x102925){return _0x102925[_0xe7ba('0x20')](RegExp(_0xe7ba('0x21')))?!![]:![];};exports['isEmail']=function(_0x587c7d){return _0x587c7d[_0xe7ba('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xe7ba('0x22')]=function(_0x8d5020){var _0x20b6cd=[];_0x8d5020[_0xe7ba('0x5')](/[ ,]+/)['forEach'](function(_0x37911d){_0x37911d=_0x37911d[_0xe7ba('0x23')](/([^:]")"+/g,'$1');_0x37911d='+'+_0x37911d+'*';var _0x5b5ff3=/[ `!@#$%^&*()_\-?~]/;if(_0x37911d[_0xe7ba('0x20')](_0x5b5ff3))_0x37911d='\x22'+_0x37911d+'\x22';_0x20b6cd['push'](_0x37911d);});return _0x20b6cd['join']('\x20');};exports[_0xe7ba('0x24')]=function(_0x134f21,_0x1be947,_0x52f90e){var _0x3b14b4={},_0x4ccdc7={};if(_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x26')]){_0x1be947[_0xe7ba('0x25')]['id']=_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x26')];delete _0x1be947['query'][_0xe7ba('0x26')];}_0x3b14b4[_0xe7ba('0x27')]=_['map'](_0x134f21,_0xe7ba('0x28'));_0x3b14b4[_0xe7ba('0x25')]=_[_0xe7ba('0x1')](_0x1be947['query']);_0x3b14b4[_0xe7ba('0x29')]=_[_0xe7ba('0x2a')](_0x3b14b4['model'],_0x3b14b4[_0xe7ba('0x25')]);_0x4ccdc7[_0xe7ba('0x2b')]=_[_0xe7ba('0x2a')](_0x3b14b4['model'],this[_0xe7ba('0x4')](_0x1be947[_0xe7ba('0x25')]['fields']));_0x4ccdc7[_0xe7ba('0x2b')]=_0x4ccdc7[_0xe7ba('0x2b')][_0xe7ba('0x1e')]?_0x4ccdc7['attributes']:_0x3b14b4['model'];if(!_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x2c')](_0xe7ba('0x2d'))){_0x4ccdc7[_0xe7ba('0x10')]=this[_0xe7ba('0x10')](_0x1be947['query'][_0xe7ba('0x10')]);_0x4ccdc7[_0xe7ba('0x11')]=this[_0xe7ba('0x11')](_0x1be947[_0xe7ba('0x25')]['offset']);}_0x4ccdc7[_0xe7ba('0x2e')]=this[_0xe7ba('0x12')](_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x12')]);_0x4ccdc7[_0xe7ba('0x2f')]=this[_0xe7ba('0x29')](_[_0xe7ba('0x30')](_0x1be947['query'],_0x3b14b4[_0xe7ba('0x29')]),_0x134f21);if(_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]){var _0x401b0a=_0x134f21;var _0xf61205=_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')];if(typeof _0xf61205===_0xe7ba('0x32')){_0x401b0a=_[_0xe7ba('0x31')](_0x134f21,function(_0x50792c){return _[_0xe7ba('0x2')](_0xf61205[_0xe7ba('0x33')],_0x50792c['name']);});_0xf61205=_0xf61205['value'];}_0x4ccdc7[_0xe7ba('0x2f')]=_[_0xe7ba('0x34')](_0x4ccdc7[_0xe7ba('0x2f')],{'$or':_['map'](_0x401b0a,function(_0x249e1d){if(_0x249e1d[_0xe7ba('0x35')]!==_0xe7ba('0x36')){if(_0x52f90e){return sequelize[_0xe7ba('0x2f')](sequelize['fn'](_0xe7ba('0x37'),sequelize['col'](_0x249e1d[_0xe7ba('0x28')])),{'$like':sequelize['fn']('lower','%'+_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]+'%')});}else{var _0xe0f1c3={};_0xe0f1c3[_0x249e1d[_0xe7ba('0x28')]]={'$like':'%'+_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]+'%'};return _0xe0f1c3;}}})});}_0x4ccdc7=_[_0xe7ba('0x34')]({},_0x4ccdc7,_0x1be947[_0xe7ba('0x38')]);return _0x4ccdc7;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 89acc7a..e3a2c4a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index f4ddcd1..d3653a8 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 _0x2e99=['getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','platform','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','md5','substring','lodash','bimedia-machine-uuid','execSync','../environment','orderBy','keys','length','IPv4','internal','concat','head','mac','address','127.0.0.1'];(function(_0x2d4df1,_0x4e79ff){var _0x271953=function(_0x1b18eb){while(--_0x1b18eb){_0x2d4df1['push'](_0x2d4df1['shift']());}};_0x271953(++_0x4e79ff);}(_0x2e99,0x18a));var _0x92e9=function(_0x50f866,_0xa4b3b9){_0x50f866=_0x50f866-0x0;var _0x48e861=_0x2e99[_0x50f866];return _0x48e861;};'use strict';var _=require(_0x92e9('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x92e9('0x1'));var exec=require('child_process')[_0x92e9('0x2')];var config=require(_0x92e9('0x3'));function getInterfaces(){var _0x5aabf8=[];var _0xee6103=os['networkInterfaces']();var _0x19dad8=_[_0x92e9('0x4')](_[_0x92e9('0x5')](_0xee6103));for(var _0x219bd2=0x0;_0x219bd2<_0x19dad8[_0x92e9('0x6')];_0x219bd2++){var _0xf2fbc6=_0xee6103[_0x19dad8[_0x219bd2]]['filter'](function(_0x3f5005){return _0x3f5005['family']===_0x92e9('0x7')&&_0x3f5005[_0x92e9('0x8')]===![];});_0x5aabf8=_0x5aabf8[_0x92e9('0x9')](_0xf2fbc6);}return _0x5aabf8;}function getFirstInterface(){var _0x1c1d70=_[_0x92e9('0xa')](getInterfaces());return{'macAddress':_0x1c1d70&&_0x1c1d70['mac']?_0x1c1d70[_0x92e9('0xb')]:'00:00:00:00:00:00','ipAddress':_0x1c1d70&&_0x1c1d70[_0x92e9('0xc')]?_0x1c1d70['address']:_0x92e9('0xd')};}exports[_0x92e9('0xe')]=getFirstInterface;function getCPUhash(){var _0x10415f=_[_0x92e9('0x4')](os[_0x92e9('0xf')]()[_0x92e9('0x10')](function(_0x1152f5){return _0x1152f5[_0x92e9('0x11')];}))[_0x92e9('0x12')](':');return crypto[_0x92e9('0x13')]('md5')[_0x92e9('0x14')](_0x10415f)[_0x92e9('0x15')](_0x92e9('0x16'));}exports['getUuid']=function(){var _0x5d2f21=os[_0x92e9('0x17')]();var _0x132bde=/[0-9a-f-]{36}/;if(config[_0x92e9('0x18')]&&_0x132bde[_0x92e9('0x19')](config['licenseToken'])){return config[_0x92e9('0x18')];}else if(_0x5d2f21===_0x92e9('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x92e9('0x1b')})[_0x92e9('0x1c')]('\x0d\x0a','');}else{var _0x5c3a37=getFirstInterface();var _0x3f6085=getCPUhash();var _0x5703a9=_0x3f6085+'|'+os[_0x92e9('0x1d')]()+'|'+_0x5c3a37[_0x92e9('0x1e')]+'|'+_0x5c3a37[_0x92e9('0x1f')];var _0x13e421=crypto['createHash'](_0x92e9('0x20'))[_0x92e9('0x14')](_0x5703a9)[_0x92e9('0x15')](_0x92e9('0x16'));return _0x13e421[_0x92e9('0x21')](0x0,0x8)+'-'+_0x13e421[_0x92e9('0x21')](0x8,0xc)+'-'+_0x13e421[_0x92e9('0x21')](0xc,0x10)+'-'+_0x13e421[_0x92e9('0x21')](0x10,0x14)+'-'+_0x13e421[_0x92e9('0x21')](0x14);}}; \ No newline at end of file +var _0x66e1=['licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','md5','update','digest','hex','getUuid','platform','test'];(function(_0x18b492,_0x58554f){var _0x15d1c3=function(_0x1fdd6c){while(--_0x1fdd6c){_0x18b492['push'](_0x18b492['shift']());}};_0x15d1c3(++_0x58554f);}(_0x66e1,0x1d1));var _0x166e=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x66e1[_0x1ae31c];return _0x19519d;};'use strict';var _=require(_0x166e('0x0'));var os=require('os');var crypto=require(_0x166e('0x1'));var machine=require(_0x166e('0x2'));var exec=require(_0x166e('0x3'))['execSync'];var config=require(_0x166e('0x4'));function getInterfaces(){var _0x245b20=[];var _0x3e9add=os[_0x166e('0x5')]();var _0x493852=_[_0x166e('0x6')](_[_0x166e('0x7')](_0x3e9add));for(var _0x131180=0x0;_0x131180<_0x493852[_0x166e('0x8')];_0x131180++){var _0x11de10=_0x3e9add[_0x493852[_0x131180]][_0x166e('0x9')](function(_0x56eb90){return _0x56eb90[_0x166e('0xa')]==='IPv4'&&_0x56eb90[_0x166e('0xb')]===![];});_0x245b20=_0x245b20[_0x166e('0xc')](_0x11de10);}return _0x245b20;}function getFirstInterface(){var _0x4c275b=_[_0x166e('0xd')](getInterfaces());return{'macAddress':_0x4c275b&&_0x4c275b['mac']?_0x4c275b[_0x166e('0xe')]:_0x166e('0xf'),'ipAddress':_0x4c275b&&_0x4c275b[_0x166e('0x10')]?_0x4c275b[_0x166e('0x10')]:_0x166e('0x11')};}exports[_0x166e('0x12')]=getFirstInterface;function getCPUhash(){var _0x24f633=_[_0x166e('0x6')](os[_0x166e('0x13')]()[_0x166e('0x14')](function(_0x444cac){return _0x444cac[_0x166e('0x15')];}))['join'](':');return crypto['createHash'](_0x166e('0x16'))[_0x166e('0x17')](_0x24f633)[_0x166e('0x18')](_0x166e('0x19'));}exports[_0x166e('0x1a')]=function(){var _0x432e63=os[_0x166e('0x1b')]();var _0x428660=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x428660[_0x166e('0x1c')](config[_0x166e('0x1d')])){return config[_0x166e('0x1d')];}else if(_0x432e63===_0x166e('0x1e')){return exec(_0x166e('0x1f'),{'encoding':'utf8'})[_0x166e('0x20')]('\x0d\x0a','');}else{var _0x3c9cc6=getFirstInterface();var _0x5d4a63=getCPUhash();var _0x31d6d0=_0x5d4a63+'|'+os[_0x166e('0x21')]()+'|'+_0x3c9cc6[_0x166e('0x22')]+'|'+_0x3c9cc6[_0x166e('0x23')];var _0xe2746f=crypto[_0x166e('0x24')](_0x166e('0x16'))[_0x166e('0x17')](_0x31d6d0)[_0x166e('0x18')](_0x166e('0x19'));return _0xe2746f['substring'](0x0,0x8)+'-'+_0xe2746f['substring'](0x8,0xc)+'-'+_0xe2746f[_0x166e('0x25')](0xc,0x10)+'-'+_0xe2746f[_0x166e('0x25')](0x10,0x14)+'-'+_0xe2746f[_0x166e('0x25')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8a2e4a1..8a79d5a 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 _0xcac7=['update','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x1da448,_0x565a9f){var _0xdb7a13=function(_0x48bfc7){while(--_0x48bfc7){_0x1da448['push'](_0x1da448['shift']());}};_0xdb7a13(++_0x565a9f);}(_0xcac7,0x19b));var _0x7cac=function(_0x529f30,_0x326845){_0x529f30=_0x529f30-0x0;var _0x2514bf=_0xcac7[_0x529f30];return _0x2514bf;};'use strict';var util=require('util');var moment=require(_0x7cac('0x0'));var rp=require(_0x7cac('0x1'));var BPromise=require(_0x7cac('0x2'));var pkginfo=require(_0x7cac('0x3'))(module,_0x7cac('0x4'));var db=require(_0x7cac('0x5'))['db'];var encryptor=require(_0x7cac('0x6'));var hardware=require('./hardware');var logger=require(_0x7cac('0x7'))(_0x7cac('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4592a0){return new BPromise(function(_0x21ca35,_0x2ed2fe){var _0x41adca=util[_0x7cac('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x4592a0,module[_0x7cac('0xa')][_0x7cac('0x4')]);if(oldToken){_0x41adca=util[_0x7cac('0x9')](_0x7cac('0xb'),HOST,_0x4592a0,module[_0x7cac('0xa')][_0x7cac('0x4')],oldToken);}var _0x3b8fe7={'uri':_0x41adca,'method':_0x7cac('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3b8fe7)[_0x7cac('0xd')](function(_0x13be0b){_0x21ca35(_0x13be0b);})['catch'](function(_0x277da8){_0x2ed2fe(_0x277da8);});});}function manageLicense(_0x367e91,_0xd7c14e){var _0x1b4053=_0xd7c14e[_0x7cac('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x1b4053[_0x7cac('0xf')]!==_0x367e91&&!_0x1b4053[_0x7cac('0x10')]){oldToken=_0x1b4053[_0x7cac('0xf')];}httpRequest(_0x367e91)[_0x7cac('0xd')](function(_0x1ea87e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1ea87e[_0x7cac('0x11')]){isOldTokenSent=![];if(!_0x1b4053['license']&&_0x1b4053[_0x7cac('0x8')]!=_0x1ea87e[_0x7cac('0x8')]||_0x1b4053[_0x7cac('0x8')]&&_0x1b4053[_0x7cac('0x10')]){logger[_0x7cac('0x12')](_0x7cac('0x13'));}if(_0x1b4053[_0x7cac('0x8')]&&!_0x1b4053[_0x7cac('0x10')]&&_0x1b4053[_0x7cac('0x8')]!=_0x1ea87e[_0x7cac('0x8')]){logger[_0x7cac('0x12')](_0x7cac('0x14'));}if(_0x1b4053[_0x7cac('0x8')]&&!_0x1b4053[_0x7cac('0x10')]&&_0x1b4053[_0x7cac('0x8')]==_0x1ea87e[_0x7cac('0x8')]){return _0xd7c14e;}return _0xd7c14e[_0x7cac('0x15')]({'data1':_0x367e91,'data2':null,'license':_0x1ea87e[_0x7cac('0x8')]});}else{if(_0x1ea87e[_0x7cac('0x8')]||_0x1b4053[_0x7cac('0x8')]){if(!_0x1b4053[_0x7cac('0x10')]){if(_0x1b4053[_0x7cac('0xf')]==_0x367e91){GRAY_PERIOD_REASON='Disabled';logger[_0x7cac('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x7cac('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1b4053['data1'],_0x367e91);}logger[_0x7cac('0x12')](_0x7cac('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x7cac('0x9')](_0x7cac('0x17')));return _0xd7c14e[_0x7cac('0x15')]({'data2':encryptor[_0x7cac('0x18')](moment()[_0x7cac('0x9')](_0x7cac('0x17')))});}else{if(moment()[_0x7cac('0x19')](encryptor['decryptString'](_0x1b4053['data2']),_0x7cac('0x1a'))>DAYS){logger[_0x7cac('0x12')](_0x7cac('0x1b'),moment()['format'](_0x7cac('0x17')));isOldTokenSent=![];return _0xd7c14e[_0x7cac('0x15')]({'data1':_0x367e91,'data2':null,'license':null});}}}else{if(_0x1b4053[_0x7cac('0xf')]!=_0x367e91){logger[_0x7cac('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1b4053[_0x7cac('0xf')],_0x367e91);return _0xd7c14e['update']({'data1':_0x367e91,'data2':null,'license':null});}}}return _0xd7c14e;})[_0x7cac('0xd')](function(_0x479be5){_0xd7c14e=_0x479be5;})[_0x7cac('0x1c')](function(_0x55034b){logger[_0x7cac('0x1d')](_0x55034b[_0x7cac('0x1e')]);})[_0x7cac('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0x7cac('0x20')](),_0xd7c14e);},TIME);});}function defaultLicense(){var _0x1db86c=hardware[_0x7cac('0x20')]();if(_0x1db86c){return db[_0x7cac('0x21')][_0x7cac('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x1db86c}})[_0x7cac('0x23')](function(_0x379315,_0x3d8e55){logger[_0x7cac('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1db86c);manageLicense(_0x1db86c,_0x379315);})[_0x7cac('0x1c')](function(_0x5522b2){logger[_0x7cac('0x1d')](_0x5522b2[_0x7cac('0x1e')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x7813=['data2','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1'];(function(_0x172df2,_0x1a14d4){var _0x3b6bee=function(_0x332137){while(--_0x332137){_0x172df2['push'](_0x172df2['shift']());}};_0x3b6bee(++_0x1a14d4);}(_0x7813,0x169));var _0x3781=function(_0x3c5f40,_0xb82ced){_0x3c5f40=_0x3c5f40-0x0;var _0x5b610e=_0x7813[_0x3c5f40];return _0x5b610e;};'use strict';var util=require(_0x3781('0x0'));var moment=require(_0x3781('0x1'));var rp=require(_0x3781('0x2'));var BPromise=require(_0x3781('0x3'));var pkginfo=require(_0x3781('0x4'))(module,_0x3781('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x3781('0x6'));var hardware=require(_0x3781('0x7'));var logger=require(_0x3781('0x8'))('license');var HOST=_0x3781('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1605fd){return new BPromise(function(_0x2dd667,_0x18cfdd){var _0x5f3232=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x1605fd,module[_0x3781('0xa')][_0x3781('0x5')]);if(oldToken){_0x5f3232=util[_0x3781('0xb')](_0x3781('0xc'),HOST,_0x1605fd,module[_0x3781('0xa')][_0x3781('0x5')],oldToken);}var _0x3b8d89={'uri':_0x5f3232,'method':_0x3781('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3b8d89)[_0x3781('0xe')](function(_0x1927fe){_0x2dd667(_0x1927fe);})['catch'](function(_0x21193a){_0x18cfdd(_0x21193a);});});}function manageLicense(_0x4ec15e,_0x2fe02c){var _0xeb3314=_0x2fe02c[_0x3781('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0xeb3314[_0x3781('0x10')]!==_0x4ec15e&&!_0xeb3314[_0x3781('0x11')]){oldToken=_0xeb3314[_0x3781('0x10')];}httpRequest(_0x4ec15e)[_0x3781('0xe')](function(_0x460750){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x460750[_0x3781('0x12')]){isOldTokenSent=![];if(!_0xeb3314[_0x3781('0x13')]&&_0xeb3314['license']!=_0x460750[_0x3781('0x13')]||_0xeb3314[_0x3781('0x13')]&&_0xeb3314['data2']){logger['info'](_0x3781('0x14'));}if(_0xeb3314[_0x3781('0x13')]&&!_0xeb3314[_0x3781('0x11')]&&_0xeb3314[_0x3781('0x13')]!=_0x460750[_0x3781('0x13')]){logger[_0x3781('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xeb3314[_0x3781('0x13')]&&!_0xeb3314[_0x3781('0x11')]&&_0xeb3314[_0x3781('0x13')]==_0x460750['license']){return _0x2fe02c;}return _0x2fe02c['update']({'data1':_0x4ec15e,'data2':null,'license':_0x460750['license']});}else{if(_0x460750[_0x3781('0x13')]||_0xeb3314[_0x3781('0x13')]){if(!_0xeb3314[_0x3781('0x11')]){if(_0xeb3314[_0x3781('0x10')]==_0x4ec15e){GRAY_PERIOD_REASON='Disabled';logger[_0x3781('0x15')](_0x3781('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x3781('0x17'),_0xeb3314[_0x3781('0x10')],_0x4ec15e);}logger[_0x3781('0x15')](_0x3781('0x18'),GRAY_PERIOD_REASON[_0x3781('0x19')](),moment()[_0x3781('0xb')](_0x3781('0x1a')));return _0x2fe02c[_0x3781('0x1b')]({'data2':encryptor[_0x3781('0x1c')](moment()[_0x3781('0xb')](_0x3781('0x1a')))});}else{if(moment()[_0x3781('0x1d')](encryptor[_0x3781('0x1e')](_0xeb3314['data2']),_0x3781('0x1f'))>DAYS){logger[_0x3781('0x15')](_0x3781('0x20'),moment()[_0x3781('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2fe02c[_0x3781('0x1b')]({'data1':_0x4ec15e,'data2':null,'license':null});}}}else{if(_0xeb3314[_0x3781('0x10')]!=_0x4ec15e){logger['info'](_0x3781('0x17'),_0xeb3314[_0x3781('0x10')],_0x4ec15e);return _0x2fe02c[_0x3781('0x1b')]({'data1':_0x4ec15e,'data2':null,'license':null});}}}return _0x2fe02c;})[_0x3781('0xe')](function(_0x3a5fe7){_0x2fe02c=_0x3a5fe7;})['catch'](function(_0x368fb9){logger[_0x3781('0x21')](_0x368fb9[_0x3781('0x22')]);})[_0x3781('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x3781('0x24')](),_0x2fe02c);},TIME);});}function defaultLicense(){var _0x105fb9=hardware[_0x3781('0x24')]();if(_0x105fb9){return db['License'][_0x3781('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x105fb9}})[_0x3781('0x26')](function(_0x17398f,_0x271aa6){logger[_0x3781('0x15')](_0x3781('0x27'),_0x105fb9);manageLicense(_0x105fb9,_0x17398f);})[_0x3781('0x28')](function(_0xabf008){logger['error'](_0xabf008['message']);});}}exports[_0x3781('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 385a95a..0339120 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 _0x728b=['Demo\x20license','getUuid','License','find','then','catch','uuid','data1','License\x20key\x20value\x20not\x20found','split','format','parse','demo','gray','deadline','grayReason','machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x47a002,_0x4427ad){var _0x422a31=function(_0x2ba352){while(--_0x2ba352){_0x47a002['push'](_0x47a002['shift']());}};_0x422a31(++_0x4427ad);}(_0x728b,0xfc));var _0xb728=function(_0x304e87,_0x39f801){_0x304e87=_0x304e87-0x0;var _0x2f5650=_0x728b[_0x304e87];return _0x2f5650;};'use strict';var util=require(_0xb728('0x0'));var _=require(_0xb728('0x1'));var moment=require(_0xb728('0x2'));var BPromise=require('bluebird');var hardware=require(_0xb728('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xb728('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb728('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb728('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb728('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb728('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xb8762d){return new BPromise(function(_0x23150e,_0x4b60f3){return db[_0xb728('0x8')][_0xb728('0x9')](_['defaults'](_0xb8762d,{'raw':!![],'where':{'id':0x1}}))[_0xb728('0xa')](function(_0x596a4f){return checkLicense(_0x596a4f,null);})[_0xb728('0xa')](function(_0x3ecdc3){_0x23150e(_0x3ecdc3);return;})[_0xb728('0xb')](function(_0x35d412){_0x4b60f3(_0x35d412);});});}function checkLicense(_0x1b7cb2,_0x6ccca8){if(!_0x1b7cb2){demoLicense[_0xb728('0xc')]=_0x1b7cb2[_0xb728('0xd')];return demoLicense;}try{var _0x566f8a=_0x6ccca8||_0x1b7cb2['license'];if(_['isEmpty'](_0x566f8a)){throw new Error(_0xb728('0xe'));}var _0x17eadf=_0x1b7cb2[_0xb728('0xd')];var _0x50b3cc=_0x1b7cb2['data2'];var _0x7e4c46=_0x17eadf['split']('-')[0x4];var _0x436198=_0x17eadf[_0xb728('0xf')]('-')[0x0];var _0x131f1e=encryptor['decryptString'](_0x566f8a,util[_0xb728('0x10')]('%s:%s:%s',_0x7e4c46,_0x17eadf,_0x436198));var _0x48dd1c=JSON[_0xb728('0x11')](_0x131f1e);_0x48dd1c[_0xb728('0x12')]=![];_0x48dd1c[_0xb728('0xc')]=_0x17eadf;_0x48dd1c['machineUuid']=hardware[_0xb728('0x7')]();if(_0x50b3cc){var _0xd47e04=encryptor['decryptString'](_0x50b3cc);_0x48dd1c[_0xb728('0x13')]=_0xd47e04;_0x48dd1c[_0xb728('0x14')]=moment(_0xd47e04)['add'](0x7,'days')[_0xb728('0x10')]();_0x48dd1c[_0xb728('0x15')]=_0x48dd1c[_0xb728('0xc')]!=_0x48dd1c[_0xb728('0x16')]?_0xb728('0x17'):_0xb728('0x18');}return _0x48dd1c;}catch(_0x4c0bf6){breakingLicense[_0xb728('0xc')]=_0x1b7cb2[_0xb728('0xd')];breakingLicense[_0xb728('0x19')]=_0x4c0bf6['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d9b5e,_0x112e30){getLicense()[_0xb728('0xa')](function(_0xfe577d){return db[_0xb728('0x1a')][_0xb728('0x1b')]({'attributes':[_0xb728('0x1c'),[db[_0xb728('0x1d')]['fn'](_0xb728('0x1e'),db[_0xb728('0x1d')][_0xb728('0x1f')]('role')),_0xb728('0x20')]],'group':'role','where':{'role':{'$or':[_0xb728('0x21'),'user',_0xb728('0x22')]}},'raw':!![]})['then'](function(_0x207303){var _0x3d26c8={'user':_0xfe577d[_0xb728('0x23')]||0x0,'telephone':_0xfe577d[_0xb728('0x24')]||0x0};_0x207303[_0xb728('0x25')](function(_0x53dca1){var _0x5678f6=_0x53dca1[_0xb728('0x1c')]==='admin'?_0xb728('0x26'):_0x53dca1[_0xb728('0x1c')];_0x3d26c8[_0x5678f6]-=_0x53dca1[_0xb728('0x20')];if(_0x3d26c8[_0x5678f6]<0x0)_0x3d26c8[_0x5678f6]=0x0;});_0x4d9b5e(_0x3d26c8);return;});})[_0xb728('0xb')](function(_0x5110c9){_0x112e30(_0x5110c9);});});}function checkUserLimits(_0x1d46b5){return new BPromise(function(_0x4d99ce,_0x931178){getLimits()[_0xb728('0xa')](function(_0x5d94d4){var _0xb2a0cd=_[_0xb728('0x27')](_[_0xb728('0x28')](_0x1d46b5,_0xb728('0x1c')),['admin',_0xb728('0x26'),'telephone']);var _0x4ad374=(_0xb2a0cd[_0xb728('0x21')]||0x0)+(_0xb2a0cd[_0xb728('0x26')]||0x0);var _0xcba848=_0xb2a0cd['telephone']||0x0;if(_0x4ad374>_0x5d94d4[_0xb728('0x26')])return _0x931178(_0xb728('0x29'));if(_0xcba848>_0x5d94d4['telephone'])return _0x931178('License\x20limit\x20reached\x20for\x20telephones');return _0x4d99ce();})['catch'](function(_0x2de47e){_0x931178(_0x2de47e);});});}module[_0xb728('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x79b5=['user','users','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','util','moment','bluebird','Demo\x20license','2027-01-01T00:00:00.000Z','getUuid','License','defaults','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','demo','machineUuid','days','grayReason','changed','message','then','User','findAll','role','sequelize','COUNT','count','admin'];(function(_0x4e7a3b,_0x2e6175){var _0x2c5844=function(_0x1ba446){while(--_0x1ba446){_0x4e7a3b['push'](_0x4e7a3b['shift']());}};_0x2c5844(++_0x2e6175);}(_0x79b5,0x1e8));var _0x579b=function(_0x49f9e5,_0xff87ed){_0x49f9e5=_0x49f9e5-0x0;var _0x2e5dee=_0x79b5[_0x49f9e5];return _0x2e5dee;};'use strict';var util=require(_0x579b('0x0'));var _=require('lodash');var moment=require(_0x579b('0x1'));var BPromise=require(_0x579b('0x2'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x579b('0x3'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x579b('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x579b('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x16567a){return new BPromise(function(_0x59c94e,_0x3ac2bc){return db[_0x579b('0x6')]['find'](_[_0x579b('0x7')](_0x16567a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3f8d8d){return checkLicense(_0x3f8d8d,null);})['then'](function(_0x26c555){_0x59c94e(_0x26c555);return;})[_0x579b('0x8')](function(_0x1fbb3d){_0x3ac2bc(_0x1fbb3d);});});}function checkLicense(_0x2bee98,_0x353807){if(!_0x2bee98){demoLicense[_0x579b('0x9')]=_0x2bee98[_0x579b('0xa')];return demoLicense;}try{var _0x125227=_0x353807||_0x2bee98[_0x579b('0xb')];if(_[_0x579b('0xc')](_0x125227)){throw new Error(_0x579b('0xd'));}var _0x2dc963=_0x2bee98[_0x579b('0xa')];var _0x346c33=_0x2bee98[_0x579b('0xe')];var _0x1b2c86=_0x2dc963[_0x579b('0xf')]('-')[0x4];var _0x1b267b=_0x2dc963['split']('-')[0x0];var _0x5115a9=encryptor[_0x579b('0x10')](_0x125227,util[_0x579b('0x11')]('%s:%s:%s',_0x1b2c86,_0x2dc963,_0x1b267b));var _0x514ab6=JSON['parse'](_0x5115a9);_0x514ab6[_0x579b('0x12')]=![];_0x514ab6[_0x579b('0x9')]=_0x2dc963;_0x514ab6[_0x579b('0x13')]=hardware[_0x579b('0x5')]();if(_0x346c33){var _0x9d6601=encryptor[_0x579b('0x10')](_0x346c33);_0x514ab6['gray']=_0x9d6601;_0x514ab6['deadline']=moment(_0x9d6601)['add'](0x7,_0x579b('0x14'))['format']();_0x514ab6[_0x579b('0x15')]=_0x514ab6[_0x579b('0x9')]!=_0x514ab6['machineUuid']?_0x579b('0x16'):'disabled';}return _0x514ab6;}catch(_0x3321e3){breakingLicense[_0x579b('0x9')]=_0x2bee98['data1'];breakingLicense[_0x579b('0x17')]=_0x3321e3[_0x579b('0x17')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x50c4f4,_0x28be10){getLicense()[_0x579b('0x18')](function(_0x1d14ef){return db[_0x579b('0x19')][_0x579b('0x1a')]({'attributes':[_0x579b('0x1b'),[db[_0x579b('0x1c')]['fn'](_0x579b('0x1d'),db[_0x579b('0x1c')]['col']('role')),_0x579b('0x1e')]],'group':_0x579b('0x1b'),'where':{'role':{'$or':[_0x579b('0x1f'),_0x579b('0x20'),'telephone']}},'raw':!![]})[_0x579b('0x18')](function(_0x29bf9f){var _0x611ad9={'user':_0x1d14ef[_0x579b('0x21')]||0x0,'telephone':_0x1d14ef['telephones']||0x0};_0x29bf9f[_0x579b('0x22')](function(_0x15e014){var _0x187069=_0x15e014[_0x579b('0x1b')]===_0x579b('0x1f')?'user':_0x15e014[_0x579b('0x1b')];_0x611ad9[_0x187069]-=_0x15e014['count'];if(_0x611ad9[_0x187069]<0x0)_0x611ad9[_0x187069]=0x0;});_0x50c4f4(_0x611ad9);return;});})['catch'](function(_0x1994c9){_0x28be10(_0x1994c9);});});}function checkUserLimits(_0x10c0d9){return new BPromise(function(_0x5dc0d6,_0x4f9034){getLimits()[_0x579b('0x18')](function(_0x9a71dd){var _0x2f3887=_[_0x579b('0x23')](_[_0x579b('0x24')](_0x10c0d9,'role'),['admin',_0x579b('0x20'),_0x579b('0x25')]);var _0x115f37=(_0x2f3887[_0x579b('0x1f')]||0x0)+(_0x2f3887['user']||0x0);var _0x2e8c47=_0x2f3887[_0x579b('0x25')]||0x0;if(_0x115f37>_0x9a71dd[_0x579b('0x20')])return _0x4f9034(_0x579b('0x26'));if(_0x2e8c47>_0x9a71dd[_0x579b('0x25')])return _0x4f9034('License\x20limit\x20reached\x20for\x20telephones');return _0x5dc0d6();})[_0x579b('0x8')](function(_0x51314e){_0x4f9034(_0x51314e);});});}module[_0x579b('0x27')]={'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 64b3c0e..3243055 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 _0x7708=['http://localhost:9000','app-id','exports'];(function(_0x57ed97,_0x1a4458){var _0x54788a=function(_0x542bce){while(--_0x542bce){_0x57ed97['push'](_0x57ed97['shift']());}};_0x54788a(++_0x1a4458);}(_0x7708,0x188));var _0x8770=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7708[_0x55f8b4];return _0x2475f9;};'use strict';module[_0x8770('0x0')]={'DOMAIN':_0x8770('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8770('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x220fa4,_0x12283a){var _0xb059f3=function(_0x358564){while(--_0x358564){_0x220fa4['push'](_0x220fa4['shift']());}};_0xb059f3(++_0x12283a);}(_0x47c5,0x165));var _0x547c=function(_0x28a471,_0x80beab){_0x28a471=_0x28a471-0x0;var _0x59c413=_0x47c5[_0x28a471];return _0x59c413;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index e7895d8..4fc3530 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75a2=['fileLogger','../utils/loggers'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x75a2,0xf1));var _0x275a=function(_0xd0f9f4,_0xe74790){_0xd0f9f4=_0xd0f9f4-0x0;var _0x444782=_0x75a2[_0xd0f9f4];return _0x444782;};'use strict';var fileLogger=require(_0x275a('0x0'))[_0x275a('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x29c9=['fileLogger','exports'];(function(_0x214747,_0x1292f2){var _0x591bee=function(_0x3c5096){while(--_0x3c5096){_0x214747['push'](_0x214747['shift']());}};_0x591bee(++_0x1292f2);}(_0x29c9,0xba));var _0x929c=function(_0x24e4a1,_0x42944d){_0x24e4a1=_0x24e4a1-0x0;var _0x3656f0=_0x29c9[_0x24e4a1];return _0x3656f0;};'use strict';var fileLogger=require('../utils/loggers')[_0x929c('0x0')];module[_0x929c('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index bf3e516..021f2cd 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 _0x365c=['../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x52b397,_0x1a5fda){var _0x1f5c02=function(_0x3196f9){while(--_0x3196f9){_0x52b397['push'](_0x52b397['shift']());}};_0x1f5c02(++_0x1a5fda);}(_0x365c,0xc6));var _0xc365=function(_0xdcbf1c,_0x438874){_0xdcbf1c=_0xdcbf1c-0x0;var _0x57116e=_0x365c[_0xdcbf1c];return _0x57116e;};'use strict';var path=require(_0xc365('0x0'));var os=require('os');var config={'apps':[{'name':_0xc365('0x1'),'script':path[_0xc365('0x2')](__dirname,_0xc365('0x3'))},{'name':'ami','script':path[_0xc365('0x2')](__dirname,_0xc365('0x4'))},{'name':_0xc365('0x5'),'script':path['join'](__dirname,_0xc365('0x6'))},{'name':_0xc365('0x7'),'script':path['join'](__dirname,_0xc365('0x8'))},{'name':_0xc365('0x9'),'script':path[_0xc365('0x2')](__dirname,_0xc365('0xa'))},{'name':_0xc365('0xb'),'script':path[_0xc365('0x2')](__dirname,_0xc365('0xc'))}]};module[_0xc365('0xd')]=config; \ No newline at end of file +var _0x04db=['../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing'];(function(_0x5c169a,_0x151406){var _0x167418=function(_0x56e6dd){while(--_0x56e6dd){_0x5c169a['push'](_0x5c169a['shift']());}};_0x167418(++_0x151406);}(_0x04db,0x157));var _0xb04d=function(_0x2d3c19,_0xee8dd7){_0x2d3c19=_0x2d3c19-0x0;var _0x51f480=_0x04db[_0x2d3c19];return _0x51f480;};'use strict';var path=require(_0xb04d('0x0'));var os=require('os');var config={'apps':[{'name':_0xb04d('0x1'),'script':path[_0xb04d('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xb04d('0x3'),'script':path[_0xb04d('0x2')](__dirname,_0xb04d('0x4'))},{'name':_0xb04d('0x5'),'script':path['join'](__dirname,_0xb04d('0x6'))},{'name':_0xb04d('0x7'),'script':path[_0xb04d('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xb04d('0x8'),'script':path[_0xb04d('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xb04d('0x2')](__dirname,_0xb04d('0x9'))}]};module[_0xb04d('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e5f7270..c7250d4 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 _0x12fe=['list','describe','delete','dump','bluebird','connect','connected','then','start','disconnect','restart'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12fe,0x1e8));var _0xe12f=function(_0x495500,_0x3c6de2){_0x495500=_0x495500-0x0;var _0x5625dc=_0x12fe[_0x495500];return _0x5625dc;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe12f('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0xe1009e,_0x43e0c1){return pm2[_0xe12f('0x1')](function(_0x14ac20){if(_0x14ac20){return _0x43e0c1(_0x14ac20);}return _0xe1009e(_0xe12f('0x2'));});});};exports['start']=function(_0x2d62fd){return connect()[_0xe12f('0x3')](function(){return new BPromise(function(_0x4aad75,_0x20cdbb){return pm2[_0xe12f('0x4')](_0x2d62fd,function(_0x349fde,_0x319865){if(_0x349fde){return _0x20cdbb(_0x349fde);}pm2['disconnect']();return _0x4aad75(_0x319865);});});});};exports['stop']=function(_0x20fc41){return connect()['then'](function(){return new BPromise(function(_0x3648f3,_0x82e98a){return pm2['stop'](_0x20fc41,function(_0x56ffe7,_0x3dcd57){if(_0x56ffe7){return _0x82e98a(_0x56ffe7);}pm2[_0xe12f('0x5')]();return _0x3648f3(_0x3dcd57);});});});};exports[_0xe12f('0x6')]=function(_0x17a0f0){return connect()[_0xe12f('0x3')](function(){return new BPromise(function(_0x4ac479,_0x569203){return pm2[_0xe12f('0x6')](_0x17a0f0,function(_0x206fba,_0x56708c){if(_0x206fba){return _0x569203(_0x206fba);}pm2[_0xe12f('0x5')]();return _0x4ac479(_0x56708c);});});});};exports[_0xe12f('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x20d51d,_0xad1e05){return pm2[_0xe12f('0x7')](function(_0x11f06b,_0x184ec3){if(_0x11f06b){return _0xad1e05(_0x11f06b);}pm2[_0xe12f('0x5')]();return _0x20d51d(_0x184ec3);});});});};exports[_0xe12f('0x8')]=function(_0x3c4981){return connect()[_0xe12f('0x3')](function(){return new BPromise(function(_0x652b2e,_0x5cff0e){return pm2[_0xe12f('0x8')](_0x3c4981,function(_0x15df7a,_0x1bf2e0){if(_0x15df7a){return _0x5cff0e(_0x15df7a);}pm2[_0xe12f('0x5')]();return _0x652b2e(_0x1bf2e0);});});});};exports[_0xe12f('0x9')]=function(_0x1f27db){return connect()[_0xe12f('0x3')](function(){return new BPromise(function(_0x5b493f,_0x589415){return pm2[_0xe12f('0x9')](_0x1f27db,function(_0x44281b,_0x58cb93){if(_0x44281b){return _0x589415(_0x44281b);}pm2['disconnect']();return _0x5b493f(_0x58cb93);});});});};exports[_0xe12f('0xa')]=function(){return connect()[_0xe12f('0x3')](function(){return new BPromise(function(_0x5f5760,_0x1f0d80){return pm2[_0xe12f('0xa')](function(_0x5c3339){if(_0x5c3339){return _0x1f0d80(_0x5c3339);}return _0x5f5760('saved');});});});}; \ No newline at end of file +var _0x52f3=['dump','saved','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52f3,0x1d0));var _0x352f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x52f3[_0x501510];return _0x1e6ee5;};'use strict';var pm2=require('pm2');var BPromise=require(_0x352f('0x0'));var config=require(_0x352f('0x1'));function connect(){return new BPromise(function(_0x144423,_0x4362e2){return pm2[_0x352f('0x2')](function(_0x44dd25){if(_0x44dd25){return _0x4362e2(_0x44dd25);}return _0x144423(_0x352f('0x3'));});});};exports[_0x352f('0x4')]=function(_0x5c9864){return connect()[_0x352f('0x5')](function(){return new BPromise(function(_0x39b3e5,_0x467cc8){return pm2[_0x352f('0x4')](_0x5c9864,function(_0x46696d,_0x1a0785){if(_0x46696d){return _0x467cc8(_0x46696d);}pm2[_0x352f('0x6')]();return _0x39b3e5(_0x1a0785);});});});};exports['stop']=function(_0x197ab9){return connect()['then'](function(){return new BPromise(function(_0x33f049,_0x13795a){return pm2[_0x352f('0x7')](_0x197ab9,function(_0x6801c0,_0x544e93){if(_0x6801c0){return _0x13795a(_0x6801c0);}pm2['disconnect']();return _0x33f049(_0x544e93);});});});};exports[_0x352f('0x8')]=function(_0x503659){return connect()[_0x352f('0x5')](function(){return new BPromise(function(_0xb2edd3,_0xdc5232){return pm2[_0x352f('0x8')](_0x503659,function(_0x4c146e,_0x1e99a8){if(_0x4c146e){return _0xdc5232(_0x4c146e);}pm2[_0x352f('0x6')]();return _0xb2edd3(_0x1e99a8);});});});};exports[_0x352f('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x101115,_0x48e69a){return pm2[_0x352f('0x9')](function(_0x1d6cc4,_0x59426e){if(_0x1d6cc4){return _0x48e69a(_0x1d6cc4);}pm2[_0x352f('0x6')]();return _0x101115(_0x59426e);});});});};exports[_0x352f('0xa')]=function(_0x4d4641){return connect()[_0x352f('0x5')](function(){return new BPromise(function(_0x1132da,_0x28375d){return pm2[_0x352f('0xa')](_0x4d4641,function(_0x571887,_0x17aab4){if(_0x571887){return _0x28375d(_0x571887);}pm2[_0x352f('0x6')]();return _0x1132da(_0x17aab4);});});});};exports[_0x352f('0xb')]=function(_0x569c27){return connect()[_0x352f('0x5')](function(){return new BPromise(function(_0x52d097,_0x1ba585){return pm2[_0x352f('0xb')](_0x569c27,function(_0x3ff903,_0x135392){if(_0x3ff903){return _0x1ba585(_0x3ff903);}pm2[_0x352f('0x6')]();return _0x52d097(_0x135392);});});});};exports[_0x352f('0xc')]=function(){return connect()[_0x352f('0x5')](function(){return new BPromise(function(_0x35246e,_0x32eaea){return pm2[_0x352f('0xc')](function(_0x275cb3){if(_0x275cb3){return _0x32eaea(_0x275cb3);}return _0x35246e(_0x352f('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 5b5a562..b4ff9fc 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 _0xdab0=['start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','defaults','localhost','socket.io-emitter','redis','Setting','find','chatTimeout','findAll','lastMsgAt','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','format','YYYY-MM-DD\x20HH:mm:ss','join','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xdab0,0x1c1));var _0x0dab=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xdab0[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x0dab('0x0'));var moment=require('moment');var Redis=require(_0x0dab('0x1'));var util=require(_0x0dab('0x2'));var config=require(_0x0dab('0x3'));var db=require(_0x0dab('0x4'))['db'];var logger=require(_0x0dab('0x5'))('schedule');config['redis']=_[_0x0dab('0x6')](config['redis'],{'host':_0x0dab('0x7'),'port':0x18eb});var io=require(_0x0dab('0x8'))(new Redis(config[_0x0dab('0x9')]));function closeInteractions(){var _0x1166f3=0x0;var _0x55816f=[];return db[_0x0dab('0xa')][_0x0dab('0xb')]({'raw':!![],'attributes':['id',_0x0dab('0xc')],'where':{'id':0x1}})['then'](function(_0x4f970f){_0x1166f3=_0x4f970f[_0x0dab('0xc')];if(_0x1166f3){return db['ChatInteraction'][_0x0dab('0xd')]({'raw':!![],'attributes':['id',_0x0dab('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4f970f['chatTimeout'],_0x0dab('0xf'))}}});}else{return[];}})[_0x0dab('0x10')](function(_0x5361d8){if(_0x5361d8&&_0x5361d8[_0x0dab('0x11')]){_0x55816f=_[_0x0dab('0x12')](_0x5361d8||[],'id');logger[_0x0dab('0x13')](_0x0dab('0x14'),_0x55816f['join']());return db['ChatInteraction'][_0x0dab('0x15')]({'closeReason':_0x0dab('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x0dab('0x17')](_0x0dab('0x18'))},{'where':{'id':_0x55816f}});}})[_0x0dab('0x10')](function(){if(_0x55816f&&_0x55816f[_0x0dab('0x11')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x55816f[_0x0dab('0x19')]());for(var _0x4d5467=0x0;_0x4d5467<_0x55816f[_0x0dab('0x11')];_0x4d5467++){io['emit'](_0x0dab('0x1a'),{'id':_0x55816f[_0x4d5467],'closed':!![]});}}})[_0x0dab('0x1b')](function(_0x36077f){logger[_0x0dab('0x1c')](_0x0dab('0x1d'),_0x36077f?util[_0x0dab('0x1e')](_0x36077f,{'showHidden':![],'depth':null}):'');});}exports[_0x0dab('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcd38=['chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting'];(function(_0x53e6a8,_0x5839ab){var _0x2b6dcc=function(_0x2b4215){while(--_0x2b4215){_0x53e6a8['push'](_0x53e6a8['shift']());}};_0x2b6dcc(++_0x5839ab);}(_0xcd38,0x79));var _0x8cd3=function(_0x340d27,_0x28866e){_0x340d27=_0x340d27-0x0;var _0x83c1a9=_0xcd38[_0x340d27];return _0x83c1a9;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x8cd3('0x0'));var util=require(_0x8cd3('0x1'));var config=require(_0x8cd3('0x2'));var db=require(_0x8cd3('0x3'))['db'];var logger=require(_0x8cd3('0x4'))(_0x8cd3('0x5'));config[_0x8cd3('0x6')]=_[_0x8cd3('0x7')](config['redis'],{'host':_0x8cd3('0x8'),'port':0x18eb});var io=require(_0x8cd3('0x9'))(new Redis(config[_0x8cd3('0x6')]));function closeInteractions(){var _0x4f7db9=0x0;var _0x1db98a=[];return db[_0x8cd3('0xa')]['find']({'raw':!![],'attributes':['id',_0x8cd3('0xb')],'where':{'id':0x1}})[_0x8cd3('0xc')](function(_0xbc20ba){_0x4f7db9=_0xbc20ba[_0x8cd3('0xb')];if(_0x4f7db9){return db[_0x8cd3('0xd')][_0x8cd3('0xe')]({'raw':!![],'attributes':['id',_0x8cd3('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x8cd3('0x10')](_0xbc20ba[_0x8cd3('0xb')],_0x8cd3('0x11'))}}});}else{return[];}})[_0x8cd3('0xc')](function(_0x2ebb3a){if(_0x2ebb3a&&_0x2ebb3a[_0x8cd3('0x12')]){_0x1db98a=_[_0x8cd3('0x13')](_0x2ebb3a||[],'id');logger[_0x8cd3('0x14')](_0x8cd3('0x15'),_0x1db98a[_0x8cd3('0x16')]());return db[_0x8cd3('0xd')]['update']({'closeReason':'system','disposition':_0x8cd3('0x17'),'closed':!![],'closedAt':moment()[_0x8cd3('0x18')](_0x8cd3('0x19'))},{'where':{'id':_0x1db98a}});}})[_0x8cd3('0xc')](function(){if(_0x1db98a&&_0x1db98a[_0x8cd3('0x12')]){logger['info'](_0x8cd3('0x1a'),_0x1db98a[_0x8cd3('0x16')]());for(var _0x318752=0x0;_0x318752<_0x1db98a['length'];_0x318752++){io[_0x8cd3('0x1b')](_0x8cd3('0x1c'),{'id':_0x1db98a[_0x318752],'closed':!![]});}}})[_0x8cd3('0x1d')](function(_0x1768e4){logger['error'](_0x8cd3('0x1e'),_0x1768e4?util[_0x8cd3('0x1f')](_0x1768e4,{'showHidden':![],'depth':null}):'');});}exports[_0x8cd3('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 0c00854..9172ad0 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3ce=['exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf3ce,0x121));var _0xef3c=function(_0x3f2146,_0x4e86a4){_0x3f2146=_0x3f2146-0x0;var _0xc33e7d=_0xf3ce[_0x3f2146];return _0xc33e7d;};'use strict';function start(){var _0x30339d=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x30339d['startAllRefreshIntervals']();}module[_0xef3c('0x0')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x059d=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x657ebc,_0x5bb053){var _0x33ff0b=function(_0x280dc4){while(--_0x280dc4){_0x657ebc['push'](_0x657ebc['shift']());}};_0x33ff0b(++_0x5bb053);}(_0x059d,0xfb));var _0xd059=function(_0xe3b1dc,_0x1ccd78){_0xe3b1dc=_0xe3b1dc-0x0;var _0x4a2ade=_0x059d[_0xe3b1dc];return _0x4a2ade;};'use strict';function start(){var _0x351cc8=require(_0xd059('0x0'));return _0x351cc8[_0xd059('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 1beef0f..63e620e 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 _0x1d44=['Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','extname','zip','join','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','stringify','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','CloudProvider','keys','map','keyBy','toString','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','deleteJob','stop\x20cron','update','run','start','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','MailAccount','Smtp','user','email'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x1d44,0x95));var _0x41d4=function(_0xe1a964,_0x5ec09d){_0xe1a964=_0xe1a964-0x0;var _0x3de37b=_0x1d44[_0xe1a964];return _0x3de37b;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x41d4('0x0'));var _=require('lodash');var moment=require(_0x41d4('0x1'));var CronJobManager=require(_0x41d4('0x2'));var jayson=require(_0x41d4('0x3'));var BPromise=require(_0x41d4('0x4'));var logger=require(_0x41d4('0x5'))(_0x41d4('0x6'));var db=require(_0x41d4('0x7'))['db'];var analyticCustomReportController=require(_0x41d4('0x8'));var analyticDefaultReportController=require(_0x41d4('0x9'));var client=jayson[_0x41d4('0xa')][_0x41d4('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1eb484,_0x1416da){return function(){logger['info'](_0x41d4('0xc'),_0x1eb484['email']);var _0x2d423f=!![];var _0x1a0b99=_0x1eb484['MailAccount'][_0x41d4('0xd')]();var _0x4fa686={'account':_0x1a0b99,'message':{'from':util[_0x41d4('0xe')](_0x41d4('0xf'),_0x1eb484['MailAccount'][_0x41d4('0x10')],_0x1eb484[_0x41d4('0x11')]['email']||_0x1eb484[_0x41d4('0x11')][_0x41d4('0x12')][_0x41d4('0x13')]),'to':_0x1eb484[_0x41d4('0x14')],'cc':_0x1eb484['cc'],'bcc':_0x1eb484['bcc'],'subject':util['format'](_0x41d4('0x15'),_0x1416da[_0x41d4('0x10')],_0x1eb484[_0x41d4('0x16')],_0x1eb484[_0x41d4('0x17')])}};var _0x1f2fae=path['join'](__dirname,_0x41d4('0x18'));var _0x4f5de3=_0x1416da[_0x41d4('0x19')];var _0x30d520=util[_0x41d4('0xe')](_0x41d4('0x1a'),path['basename'](_0x1416da[_0x41d4('0x19')],path[_0x41d4('0x1b')](_0x1416da[_0x41d4('0x19')])),_0x41d4('0x1c'));var _0x14c6fd=path[_0x41d4('0x1d')](_0x1f2fae,_0x4f5de3);var _0x2e7b43=path['join'](_0x1f2fae,_0x30d520);if(fs[_0x41d4('0x1e')](_0x14c6fd)){_0x1416da[_0x41d4('0x1f')]='Sent';_0x4fa686[_0x41d4('0x20')][_0x41d4('0x21')]=[{'filename':_0x4f5de3,'path':_0x14c6fd}];_0x4fa686['message'][_0x41d4('0x22')]=util[_0x41d4('0xe')](_0x41d4('0x23'),JSON['stringify'](_0x1416da,null,0x2));}else if(fs[_0x41d4('0x1e')](_0x2e7b43)){_0x1416da[_0x41d4('0x1f')]='Sent';_0x4fa686['message']['attachments']=[{'filename':_0x30d520,'path':_0x2e7b43}];}else{_0x4fa686[_0x41d4('0x20')]['text']=_0x41d4('0x24');if(!_0x1eb484['sendIfEmpty']){_0x2d423f=![];logger[_0x41d4('0x25')](_0x41d4('0x26'));}}if(_0x2d423f){return client[_0x41d4('0x27')]('SendMail',_0x4fa686)[_0x41d4('0x28')](function(_0x330ed9){if(_0x330ed9[_0x41d4('0x29')]){return logger[_0x41d4('0x29')]('error\x20mail',JSON[_0x41d4('0x2a')](_0x330ed9));}return logger[_0x41d4('0x25')]('email\x20sent');})[_0x41d4('0x2b')](function(_0x216d71){return logger[_0x41d4('0x29')](_0x41d4('0x2c'),JSON[_0x41d4('0x2a')](_0x216d71));});}};}function handleError(){return function(_0x1110ee){return logger[_0x41d4('0x29')](JSON['stringify'](_0x1110ee));};}function handleResult(_0x4190bb){return function(_0xf45f04){logger[_0x41d4('0x25')](_0x41d4('0x2d'),JSON[_0x41d4('0x2a')](_0xf45f04));if(_0x4190bb['MailAccount']&&_0x4190bb[_0x41d4('0x11')][_0x41d4('0x12')]&&!_['isNil'](_0x4190bb[_0x41d4('0x14')])){setTimeout(handleSendEmail(_0x4190bb,_0xf45f04),0x3c*0x3e8);}};}function handleJob(_0x45eb6c){return function(){try{if(_[_0x41d4('0x2e')](_0x45eb6c[_0x41d4('0x16')])){return logger[_0x41d4('0x25')](_0x41d4('0x2f'));}if(_['isNil'](_0x45eb6c['subtractUnit'])){return logger[_0x41d4('0x25')](_0x41d4('0x30'));}var _0x30b7d9={'startDate':moment()[_0x41d4('0x31')](_0x45eb6c[_0x41d4('0x16')],_0x45eb6c[_0x41d4('0x17')])[_0x41d4('0xe')](_0x41d4('0x32')),'endDate':moment()[_0x41d4('0xe')](_0x41d4('0x32')),'type':_0x41d4('0x33'),'output':_0x45eb6c['output'],'name':_0x45eb6c[_0x41d4('0x10')]};if(!_[_0x41d4('0x2e')](_0x45eb6c[_0x41d4('0x34')])){logger['info'](_0x41d4('0x35'),_0x45eb6c['DefaultReportId']);return analyticDefaultReportController[_0x41d4('0x36')]({'id':_0x45eb6c['DefaultReportId']},_0x30b7d9)[_0x41d4('0x28')](handleResult(_0x45eb6c))[_0x41d4('0x2b')](handleError());}if(!_[_0x41d4('0x2e')](_0x45eb6c['CustomReportId'])){logger['info'](_0x41d4('0x37'),_0x45eb6c[_0x41d4('0x38')]);return analyticCustomReportController['runReport']({'id':_0x45eb6c[_0x41d4('0x38')]},_0x30b7d9)[_0x41d4('0x28')](handleResult(_0x45eb6c))[_0x41d4('0x2b')](handleError());}}catch(_0x5813d8){logger[_0x41d4('0x29')](JSON[_0x41d4('0x2a')](_0x5813d8));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x1658d3){var _0x2a7ba5={};if(_0x1658d3){_0x2a7ba5['id']=_0x1658d3;}return db[_0x41d4('0x39')][_0x41d4('0x3a')]({'where':_0x2a7ba5,'include':[{'model':db['MailAccount'],'attributes':['id',_0x41d4('0x10'),_0x41d4('0x14')],'include':[{'model':db[_0x41d4('0x3b')],'as':_0x41d4('0x12'),'include':[{'model':db[_0x41d4('0x3c')],'as':'CloudProvider'}]}]}]})[_0x41d4('0x28')](function(_0x18408d){var _0x23a22b=_[_0x41d4('0x3d')](manager['jobs']);var _0x49552d=_[_0x41d4('0x3e')](_0x18408d,function(_0x41c497){return _0x41c497['id']['toString']();});var _0x40f47c=_[_0x41d4('0x3f')](_0x18408d,function(_0x41674e){return _0x41674e['id'][_0x41d4('0x40')]();});var _0x1d427a=_0x1658d3?_0x49552d:_[_0x41d4('0x41')](_0x49552d,_0x23a22b);var _0x28f57d=_[_0x41d4('0x42')](_0x49552d,_0x23a22b);var _0x36e001=_[_0x41d4('0x41')](_0x23a22b,_0x49552d);var _0x30f75a;var _0x3eda3d;for(_0x30f75a=0x0;_0x30f75a<_0x36e001['length']&&!_0x1658d3;_0x30f75a+=0x1){_0x3eda3d=_0x36e001[_0x30f75a][_0x41d4('0x40')]();if(manager[_0x41d4('0x43')](_0x3eda3d)){manager[_0x41d4('0x44')](_0x3eda3d);manager['deleteJob'](_0x3eda3d);logger[_0x41d4('0x25')](_0x41d4('0x45'),_0x3eda3d);}}logger[_0x41d4('0x25')](_0x41d4('0x46'),JSON['stringify'](_0x1d427a));for(_0x30f75a=0x0;_0x30f75a<_0x1d427a[_0x41d4('0x47')];_0x30f75a+=0x1){_0x3eda3d=_0x1d427a[_0x30f75a][_0x41d4('0x40')]();logger[_0x41d4('0x25')](_0x41d4('0x48'),_0x3eda3d);if(_0x1658d3){logger['info'](_0x41d4('0x49'),_0x1658d3);logger[_0x41d4('0x25')](JSON[_0x41d4('0x2a')](_0x40f47c[_0x3eda3d]));BPromise['resolve']()[_0x41d4('0x28')](handleJob(_0x40f47c[_0x3eda3d]));logger[_0x41d4('0x25')](_0x41d4('0x4a'),_0x40f47c[_0x3eda3d][_0x41d4('0x10')],_0x40f47c[_0x3eda3d][_0x41d4('0x4b')]);}else if(_0x40f47c[_0x3eda3d][_0x41d4('0x4b')]&&_0x40f47c[_0x3eda3d][_0x41d4('0x4c')]&&moment()[_0x41d4('0x4d')](_0x40f47c[_0x3eda3d][_0x41d4('0x4e')],_0x40f47c[_0x3eda3d][_0x41d4('0x4f')])){manager['add'](_0x3eda3d,_0x40f47c[_0x3eda3d][_0x41d4('0x4b')],handleJob(_0x40f47c[_0x3eda3d]));manager['start'](_0x3eda3d);logger[_0x41d4('0x25')]('add\x20cron',_0x40f47c[_0x3eda3d][_0x41d4('0x10')],_0x40f47c[_0x3eda3d][_0x41d4('0x4b')]);}else if(manager[_0x41d4('0x43')](_0x3eda3d)){manager[_0x41d4('0x44')](_0x3eda3d);manager[_0x41d4('0x50')](_0x3eda3d);logger[_0x41d4('0x25')](_0x41d4('0x51'),_0x40f47c[_0x3eda3d]['name'],_0x40f47c[_0x3eda3d][_0x41d4('0x4b')]);}}for(_0x30f75a=0x0,_0x3eda3d;_0x30f75a<_0x28f57d[_0x41d4('0x47')]&&!_0x1658d3;_0x30f75a+=0x1){_0x3eda3d=_0x28f57d[_0x30f75a][_0x41d4('0x40')]();if(manager[_0x41d4('0x43')](_0x3eda3d)){if(_0x40f47c[_0x3eda3d]['cron']&&_0x40f47c[_0x3eda3d]['active']&&moment()['isBetween'](_0x40f47c[_0x3eda3d]['startAt'],_0x40f47c[_0x3eda3d]['endAt'])){manager[_0x41d4('0x52')](_0x3eda3d,_0x40f47c[_0x3eda3d][_0x41d4('0x4b')],handleJob(_0x40f47c[_0x3eda3d]));logger['info']('update\x20cron',_0x40f47c[_0x3eda3d][_0x41d4('0x10')],_0x40f47c[_0x3eda3d]['cron']);}else{manager[_0x41d4('0x44')](_0x3eda3d);manager[_0x41d4('0x50')](_0x3eda3d);logger[_0x41d4('0x25')]('stop\x20cron',_0x40f47c[_0x3eda3d][_0x41d4('0x10')],_0x40f47c[_0x3eda3d][_0x41d4('0x4b')]);}}}})['catch'](function(_0x5dfa08){logger['error'](JSON[_0x41d4('0x2a')](_0x5dfa08));});}exports[_0x41d4('0x53')]=function(_0x25c214){return getJobs(_0x25c214);};exports[_0x41d4('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2b4b=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','then','jobs','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','startAt','add','start','add\x20cron','stop\x20cron','isBetween','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x24ce69,_0x4c0908){var _0x203e6a=function(_0x48a6a7){while(--_0x48a6a7){_0x24ce69['push'](_0x24ce69['shift']());}};_0x203e6a(++_0x4c0908);}(_0x2b4b,0x89));var _0xb2b4=function(_0x1ce585,_0xb1f5ba){_0x1ce585=_0x1ce585-0x0;var _0x396a38=_0x2b4b[_0x1ce585];return _0x396a38;};'use strict';var fs=require('fs');var util=require(_0xb2b4('0x0'));var path=require(_0xb2b4('0x1'));var _=require(_0xb2b4('0x2'));var moment=require(_0xb2b4('0x3'));var CronJobManager=require(_0xb2b4('0x4'));var jayson=require(_0xb2b4('0x5'));var BPromise=require(_0xb2b4('0x6'));var logger=require('../logger')(_0xb2b4('0x7'));var db=require(_0xb2b4('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb2b4('0x9')][_0xb2b4('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x166a4d,_0x1c5fe1){return function(){logger[_0xb2b4('0xb')](_0xb2b4('0xc'),_0x166a4d[_0xb2b4('0xd')]);var _0x3b2481=!![];var _0x9a75c3=_0x166a4d[_0xb2b4('0xe')][_0xb2b4('0xf')]();var _0x31d66e={'account':_0x9a75c3,'message':{'from':util[_0xb2b4('0x10')](_0xb2b4('0x11'),_0x166a4d[_0xb2b4('0xe')][_0xb2b4('0x12')],_0x166a4d[_0xb2b4('0xe')][_0xb2b4('0xd')]||_0x166a4d[_0xb2b4('0xe')][_0xb2b4('0x13')][_0xb2b4('0x14')]),'to':_0x166a4d[_0xb2b4('0xd')],'cc':_0x166a4d['cc'],'bcc':_0x166a4d[_0xb2b4('0x15')],'subject':util['format'](_0xb2b4('0x16'),_0x1c5fe1[_0xb2b4('0x12')],_0x166a4d[_0xb2b4('0x17')],_0x166a4d[_0xb2b4('0x18')])}};var _0x184b66=path[_0xb2b4('0x19')](__dirname,'../../files/reports');var _0x50b078=_0x1c5fe1[_0xb2b4('0x1a')];var _0x1e394e=util[_0xb2b4('0x10')](_0xb2b4('0x1b'),path[_0xb2b4('0x1c')](_0x1c5fe1[_0xb2b4('0x1a')],path[_0xb2b4('0x1d')](_0x1c5fe1[_0xb2b4('0x1a')])),'zip');var _0x50e891=path[_0xb2b4('0x19')](_0x184b66,_0x50b078);var _0x598eb4=path[_0xb2b4('0x19')](_0x184b66,_0x1e394e);if(fs[_0xb2b4('0x1e')](_0x50e891)){_0x1c5fe1[_0xb2b4('0x1f')]=_0xb2b4('0x20');_0x31d66e[_0xb2b4('0x21')]['attachments']=[{'filename':_0x50b078,'path':_0x50e891}];_0x31d66e[_0xb2b4('0x21')][_0xb2b4('0x22')]=util[_0xb2b4('0x10')](_0xb2b4('0x23'),JSON[_0xb2b4('0x24')](_0x1c5fe1,null,0x2));}else if(fs[_0xb2b4('0x1e')](_0x598eb4)){_0x1c5fe1[_0xb2b4('0x1f')]='Sent';_0x31d66e[_0xb2b4('0x21')][_0xb2b4('0x25')]=[{'filename':_0x1e394e,'path':_0x598eb4}];}else{_0x31d66e[_0xb2b4('0x21')][_0xb2b4('0x22')]=_0xb2b4('0x26');if(!_0x166a4d[_0xb2b4('0x27')]){_0x3b2481=![];logger[_0xb2b4('0xb')](_0xb2b4('0x28'));}}if(_0x3b2481){return client[_0xb2b4('0x29')](_0xb2b4('0x2a'),_0x31d66e)['then'](function(_0x142a2d){if(_0x142a2d['error']){return logger[_0xb2b4('0x2b')](_0xb2b4('0x2c'),JSON[_0xb2b4('0x24')](_0x142a2d));}return logger[_0xb2b4('0xb')]('email\x20sent');})[_0xb2b4('0x2d')](function(_0x4277c7){return logger[_0xb2b4('0x2b')](_0xb2b4('0x2c'),JSON[_0xb2b4('0x24')](_0x4277c7));});}};}function handleError(){return function(_0x18c576){return logger['error'](JSON['stringify'](_0x18c576));};}function handleResult(_0x5de4d7){return function(_0x4f97cd){logger[_0xb2b4('0xb')](_0xb2b4('0x2e'),JSON[_0xb2b4('0x24')](_0x4f97cd));if(_0x5de4d7['MailAccount']&&_0x5de4d7[_0xb2b4('0xe')][_0xb2b4('0x13')]&&!_[_0xb2b4('0x2f')](_0x5de4d7[_0xb2b4('0xd')])){setTimeout(handleSendEmail(_0x5de4d7,_0x4f97cd),0x3c*0x3e8);}};}function handleJob(_0x11f692){return function(){try{if(_[_0xb2b4('0x2f')](_0x11f692['subtractNumber'])){return logger[_0xb2b4('0xb')](_0xb2b4('0x30'));}if(_[_0xb2b4('0x2f')](_0x11f692[_0xb2b4('0x18')])){return logger[_0xb2b4('0xb')](_0xb2b4('0x31'));}var _0x16f1b1={'startDate':moment()[_0xb2b4('0x32')](_0x11f692[_0xb2b4('0x17')],_0x11f692[_0xb2b4('0x18')])[_0xb2b4('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xb2b4('0x10')](_0xb2b4('0x33')),'type':_0xb2b4('0x34'),'output':_0x11f692['output'],'name':_0x11f692[_0xb2b4('0x12')]};if(!_[_0xb2b4('0x2f')](_0x11f692[_0xb2b4('0x35')])){logger[_0xb2b4('0xb')](_0xb2b4('0x36'),_0x11f692['DefaultReportId']);return analyticDefaultReportController[_0xb2b4('0x37')]({'id':_0x11f692[_0xb2b4('0x35')]},_0x16f1b1)['then'](handleResult(_0x11f692))[_0xb2b4('0x2d')](handleError());}if(!_[_0xb2b4('0x2f')](_0x11f692[_0xb2b4('0x38')])){logger[_0xb2b4('0xb')](_0xb2b4('0x39'),_0x11f692[_0xb2b4('0x38')]);return analyticCustomReportController[_0xb2b4('0x37')]({'id':_0x11f692[_0xb2b4('0x38')]},_0x16f1b1)['then'](handleResult(_0x11f692))['catch'](handleError());}}catch(_0x380e94){logger[_0xb2b4('0x2b')](JSON[_0xb2b4('0x24')](_0x380e94));}return logger[_0xb2b4('0xb')](_0xb2b4('0x3a'));};}function getJobs(_0x3074a8){var _0xf6654f={};if(_0x3074a8){_0xf6654f['id']=_0x3074a8;}return db[_0xb2b4('0x3b')][_0xb2b4('0x3c')]({'where':_0xf6654f,'include':[{'model':db[_0xb2b4('0xe')],'attributes':['id',_0xb2b4('0x12'),_0xb2b4('0xd')],'include':[{'model':db[_0xb2b4('0x3d')],'as':_0xb2b4('0x13'),'include':[{'model':db[_0xb2b4('0x3e')],'as':_0xb2b4('0x3e')}]}]}]})[_0xb2b4('0x3f')](function(_0x37717c){var _0x54b71d=_['keys'](manager[_0xb2b4('0x40')]);var _0x4fa5d9=_['map'](_0x37717c,function(_0x5b80d3){return _0x5b80d3['id'][_0xb2b4('0x41')]();});var _0x53ba85=_['keyBy'](_0x37717c,function(_0x131ced){return _0x131ced['id'][_0xb2b4('0x41')]();});var _0x81e9df=_0x3074a8?_0x4fa5d9:_[_0xb2b4('0x42')](_0x4fa5d9,_0x54b71d);var _0x1fa87e=_[_0xb2b4('0x43')](_0x4fa5d9,_0x54b71d);var _0x5972bb=_[_0xb2b4('0x42')](_0x54b71d,_0x4fa5d9);var _0x27598e;var _0x18ef2e;for(_0x27598e=0x0;_0x27598e<_0x5972bb[_0xb2b4('0x44')]&&!_0x3074a8;_0x27598e+=0x1){_0x18ef2e=_0x5972bb[_0x27598e][_0xb2b4('0x41')]();if(manager[_0xb2b4('0x45')](_0x18ef2e)){manager[_0xb2b4('0x46')](_0x18ef2e);manager[_0xb2b4('0x47')](_0x18ef2e);logger[_0xb2b4('0xb')](_0xb2b4('0x48'),_0x18ef2e);}}logger[_0xb2b4('0xb')](_0xb2b4('0x49'),JSON[_0xb2b4('0x24')](_0x81e9df));for(_0x27598e=0x0;_0x27598e<_0x81e9df[_0xb2b4('0x44')];_0x27598e+=0x1){_0x18ef2e=_0x81e9df[_0x27598e][_0xb2b4('0x41')]();logger['info'](_0xb2b4('0x4a'),_0x18ef2e);if(_0x3074a8){logger['info']('my\x20id',_0x3074a8);logger[_0xb2b4('0xb')](JSON[_0xb2b4('0x24')](_0x53ba85[_0x18ef2e]));BPromise[_0xb2b4('0x4b')]()[_0xb2b4('0x3f')](handleJob(_0x53ba85[_0x18ef2e]));logger[_0xb2b4('0xb')](_0xb2b4('0x4c'),_0x53ba85[_0x18ef2e]['name'],_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')]);}else if(_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')]&&_0x53ba85[_0x18ef2e][_0xb2b4('0x4e')]&&moment()['isBetween'](_0x53ba85[_0x18ef2e][_0xb2b4('0x4f')],_0x53ba85[_0x18ef2e]['endAt'])){manager[_0xb2b4('0x50')](_0x18ef2e,_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')],handleJob(_0x53ba85[_0x18ef2e]));manager[_0xb2b4('0x51')](_0x18ef2e);logger[_0xb2b4('0xb')](_0xb2b4('0x52'),_0x53ba85[_0x18ef2e][_0xb2b4('0x12')],_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')]);}else if(manager[_0xb2b4('0x45')](_0x18ef2e)){manager['stop'](_0x18ef2e);manager[_0xb2b4('0x47')](_0x18ef2e);logger[_0xb2b4('0xb')](_0xb2b4('0x53'),_0x53ba85[_0x18ef2e]['name'],_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')]);}}for(_0x27598e=0x0,_0x18ef2e;_0x27598e<_0x1fa87e[_0xb2b4('0x44')]&&!_0x3074a8;_0x27598e+=0x1){_0x18ef2e=_0x1fa87e[_0x27598e][_0xb2b4('0x41')]();if(manager['exists'](_0x18ef2e)){if(_0x53ba85[_0x18ef2e]['cron']&&_0x53ba85[_0x18ef2e]['active']&&moment()[_0xb2b4('0x54')](_0x53ba85[_0x18ef2e][_0xb2b4('0x4f')],_0x53ba85[_0x18ef2e]['endAt'])){manager[_0xb2b4('0x55')](_0x18ef2e,_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')],handleJob(_0x53ba85[_0x18ef2e]));logger[_0xb2b4('0xb')](_0xb2b4('0x56'),_0x53ba85[_0x18ef2e][_0xb2b4('0x12')],_0x53ba85[_0x18ef2e][_0xb2b4('0x4d')]);}else{manager[_0xb2b4('0x46')](_0x18ef2e);manager[_0xb2b4('0x47')](_0x18ef2e);logger[_0xb2b4('0xb')](_0xb2b4('0x53'),_0x53ba85[_0x18ef2e][_0xb2b4('0x12')],_0x53ba85[_0x18ef2e]['cron']);}}}})['catch'](function(_0x16bd6b){logger[_0xb2b4('0x2b')](JSON[_0xb2b4('0x24')](_0x16bd6b));});}exports[_0xb2b4('0x57')]=function(_0x3f9023){return getJobs(_0x3f9023);};exports[_0xb2b4('0x51')]=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 74d5cf7..abb49fb 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 _0x3495=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Mixed','Neutral','COMPLETED','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','format','TranscriptionJobStatus','fileText','TranscriptionJob','TranscriptFileUri','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x23e15a,_0x2b773a){var _0x16055d=function(_0x1c4c86){while(--_0x1c4c86){_0x23e15a['push'](_0x23e15a['shift']());}};_0x16055d(++_0x2b773a);}(_0x3495,0x1de));var _0x5349=function(_0x1db57b,_0x994eee){_0x1db57b=_0x1db57b-0x0;var _0x145535=_0x3495[_0x1db57b];return _0x145535;};var _=require(_0x5349('0x0'));var AWS=require(_0x5349('0x1'));var rp=require(_0x5349('0x2'));var util=require(_0x5349('0x3'));var BPromise=require(_0x5349('0x4'));var db=require(_0x5349('0x5'))['db'];var logger=require(_0x5349('0x6'))(_0x5349('0x7'));function getTranscriptionJob(_0xedbd32,_0x5912ac,_0x4034ba,_0x8283b5){return new Promise(function(_0x5ce2cd,_0xcb5a1){var _0x538385=new AWS[(_0x5349('0x8'))]({'accessKeyId':_0x5912ac,'secretAccessKey':_0xedbd32,'region':_0x4034ba});_0x538385['getTranscriptionJob']({'TranscriptionJobName':_0x8283b5},function(_0x393873,_0x583cee){if(_0x393873){return _0xcb5a1(_0x393873);}else{return _0x5ce2cd(_0x583cee);}});});}function sentiment(_0x1751b2,_0x3eaddf,_0x22a3d3,_0x23a1c7,_0x21bf91){return new Promise(function(_0x3a416e,_0x35d425){var _0x4bf160=new AWS[(_0x5349('0x9'))]({'accessKeyId':_0x3eaddf,'secretAccessKey':_0x1751b2,'region':_0x22a3d3});_0x4bf160['detectSentiment']({'Text':_0x23a1c7,'LanguageCode':_0x21bf91[_0x5349('0xa')](0x0,0x2)},function(_0x32b09b,_0xcf06a8){if(_0x32b09b){return _0x35d425(_0x32b09b);}else{return _0x3a416e(_0xcf06a8);}});});}function checkTranscribeJob(_0x11d230,_0x2f5172,_0x3c592a){var _0x642966;return new BPromise(function(_0x52c253,_0x3227bd){logger[_0x5349('0xb')](util['format'](_0x5349('0xc'),_0x11d230['id'],_0x11d230[_0x5349('0xd')]));return getTranscriptionJob(_0x3c592a['data1'],_0x3c592a[_0x5349('0xe')],_0x2f5172[_0x5349('0xf')],_0x11d230[_0x5349('0xd')])['then'](function(_0x5bcb3a){logger['info'](util[_0x5349('0x10')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x11d230['id'],_0x11d230[_0x5349('0xd')],_0x5bcb3a['TranscriptionJob'][_0x5349('0x11')]));if(!_0x11d230[_0x5349('0x12')]){switch(_0x5bcb3a[_0x5349('0x13')][_0x5349('0x11')]){case'COMPLETED':var _0x22d1ca={'transcribeStatus':_0x5bcb3a[_0x5349('0x13')][_0x5349('0x11')],'fileUri':_0x5bcb3a[_0x5349('0x13')]['Transcript'][_0x5349('0x14')]};logger[_0x5349('0xb')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x11d230['id']));return rp({'uri':_0x5bcb3a['TranscriptionJob'][_0x5349('0x15')]['TranscriptFileUri'],'json':!![]})[_0x5349('0x16')](function(_0x1ff911){logger[_0x5349('0xb')](util[_0x5349('0x10')](_0x5349('0x17'),_0x11d230['id']));if(_0x1ff911&&_0x1ff911[_0x5349('0x18')]&&_0x1ff911[_0x5349('0x18')][_0x5349('0x19')]&&_0x1ff911[_0x5349('0x18')][_0x5349('0x19')][_0x5349('0x1a')]){_0x22d1ca[_0x5349('0x12')]='';for(var _0x57af6c=0x0;_0x57af6c<_0x1ff911[_0x5349('0x18')][_0x5349('0x19')][_0x5349('0x1a')];_0x57af6c++){_0x22d1ca['fileText']+=_0x1ff911[_0x5349('0x18')]['transcripts'][_0x57af6c][_0x5349('0x1b')]+'';}}return _0x11d230[_0x5349('0x1c')](_0x22d1ca);})[_0x5349('0x16')](function(){logger['info'](util[_0x5349('0x10')](_0x5349('0x1d'),_0x11d230['id']));if(!_0x11d230[_0x5349('0x1e')]){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x21'));}if(!_0x2f5172[_0x5349('0x22')]||!_0x2f5172[_0x5349('0x23')]||!_0x2f5172[_0x5349('0x24')]||!_0x2f5172['language']||!_0x2f5172[_0x5349('0x25')]){throw new db[(_0x5349('0x1f'))]['ValidationError'](_0x5349('0x26'));}if(!_0x22d1ca['fileText']){throw new Error(_0x5349('0x27'));}if(_0x2f5172[_0x5349('0x23')]===_0x3c592a['id']){return _0x3c592a;}else{return db[_0x5349('0x28')][_0x5349('0x29')]({'where':{'id':_settings[_0x5349('0x23')]}});}})[_0x5349('0x16')](function(_0x545972){if(!_0x545972){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x2a'));}if(!_0x545972[_0x5349('0x2b')]||!_0x545972['data2']){throw new db['Sequelize'][(_0x5349('0x20'))](_0x5349('0x2c'));}_0x642966=_0x545972;logger[_0x5349('0xb')](util['format'](_0x5349('0x2d'),_0x11d230['id']));return sentiment(_0x642966['data1'],_0x642966[_0x5349('0xe')],_0x2f5172[_0x5349('0x24')],_0x22d1ca[_0x5349('0x12')],_0x2f5172[_0x5349('0x2e')]);})[_0x5349('0x16')](function(_0x196a93){logger['info'](util['format'](_0x5349('0x2f'),_0x11d230['id']));return _0x11d230[_0x5349('0x1c')]({'sentiment':_0x196a93[_0x5349('0x30')],'sPositive':_0x196a93[_0x5349('0x31')][_0x5349('0x32')],'sNegative':_0x196a93[_0x5349('0x31')][_0x5349('0x33')],'sMixed':_0x196a93['SentimentScore']['Mixed'],'sNeutral':_0x196a93[_0x5349('0x31')]['Neutral']});})['then'](function(){logger[_0x5349('0xb')](util['format'](_0x5349('0x1d'),_0x11d230['id']));_0x52c253();});case _0x5349('0x34'):return _0x11d230[_0x5349('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x5bcb3a[_0x5349('0x13')]['FailureReason']})[_0x5349('0x16')](function(){logger[_0x5349('0xb')](util[_0x5349('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x11d230['id']));_0x52c253();});default:logger['info'](util['format'](_0x5349('0x35'),_0x11d230['id']));break;}}else{return BPromise[_0x5349('0x36')]()[_0x5349('0x16')](function(){if(!_0x11d230[_0x5349('0x1e')]){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2f5172['sentiment']||!_0x2f5172[_0x5349('0x23')]||!_0x2f5172[_0x5349('0x24')]||!_0x2f5172[_0x5349('0x2e')]||!_0x2f5172['bucket']){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x26'));}if(!_0x11d230[_0x5349('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x2f5172[_0x5349('0x23')]===_0x3c592a['id']){return _0x3c592a;}else{return db['CloudProvider'][_0x5349('0x29')]({'where':{'id':_settings[_0x5349('0x23')]}});}})['then'](function(_0x309539){if(!_0x309539){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x2a'));}if(!_0x309539[_0x5349('0x2b')]||!_0x309539[_0x5349('0xe')]){throw new db[(_0x5349('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x642966=_0x309539;logger[_0x5349('0xb')](util[_0x5349('0x10')](_0x5349('0x2d'),_0x11d230['id']));return sentiment(_0x642966[_0x5349('0x2b')],_0x642966['data2'],_0x2f5172[_0x5349('0x24')],_0x11d230['fileText'],_0x2f5172['language']);})[_0x5349('0x16')](function(_0x42d359){logger[_0x5349('0xb')](util[_0x5349('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x11d230['id']));return _0x11d230[_0x5349('0x1c')]({'sentiment':_0x42d359[_0x5349('0x30')],'sPositive':_0x42d359[_0x5349('0x31')][_0x5349('0x32')],'sNegative':_0x42d359[_0x5349('0x31')][_0x5349('0x33')],'sMixed':_0x42d359[_0x5349('0x31')][_0x5349('0x37')],'sNeutral':_0x42d359[_0x5349('0x31')][_0x5349('0x38')],'transcribeStatus':_0x5349('0x39')});})[_0x5349('0x16')](function(){logger[_0x5349('0xb')](util[_0x5349('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x11d230['id']));_0x52c253();});}})['catch'](function(_0x11d862){if(_0x11d862){if(!_0x11d862[_0x5349('0x3a')]||_0x11d862[_0x5349('0x3a')]!==_0x5349('0x3b')){logger[_0x5349('0x3c')](util[_0x5349('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x11d230['id']),util[_0x5349('0x3d')](_0x11d862,{'showHidden':![],'depth':null}));}}_0x52c253();});});}function checkTranscribe(){var _0x37f59a;var _0x1fa080;var _0x3652dc;return db[_0x5349('0x3e')][_0x5349('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x5349('0x16')](function(_0x4fdb77){if(!_0x4fdb77||!_0x4fdb77[_0x5349('0x1a')]){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x40'));}_0x37f59a=_0x4fdb77;return db[_0x5349('0x41')]['findOne']({'where':{'id':0x1}});})[_0x5349('0x16')](function(_0x3fca72){if(!_0x3fca72){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))]('Settings\x20not\x20available');}_0x1fa080=_0x3fca72;if(!_0x1fa080[_0x5349('0x7')]||!_0x1fa080[_0x5349('0x42')]||!_0x1fa080[_0x5349('0xf')]||!_0x1fa080[_0x5349('0x2e')]||!_0x1fa080[_0x5349('0x25')]){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x43'));}return db[_0x5349('0x28')][_0x5349('0x29')]({'where':{'id':_0x1fa080[_0x5349('0x42')]}});})[_0x5349('0x16')](function(_0x1286a2){if(!_0x1286a2){throw new db[(_0x5349('0x1f'))][(_0x5349('0x20'))](_0x5349('0x2a'));}if(!_0x1286a2[_0x5349('0x2b')]||!_0x1286a2[_0x5349('0xe')]){throw new db['Sequelize'][(_0x5349('0x20'))](_0x5349('0x2c'));}_0x3652dc=_0x1286a2;var _0x59f481=[];_0x37f59a['forEach'](function(_0x346599){_0x59f481[_0x5349('0x44')](checkTranscribeJob(_0x346599,_0x1fa080,_0x3652dc));});return BPromise[_0x5349('0x45')](_0x59f481);})[_0x5349('0x46')](function(_0x25a93a){if(_0x25a93a){if(!_0x25a93a[_0x5349('0x3a')]||_0x25a93a[_0x5349('0x3a')]!=='SequelizeValidationError'){logger[_0x5349('0x3c')](util[_0x5349('0x3d')](_0x25a93a,{'showHidden':![],'depth':null}));}}});}exports[_0x5349('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2ea1=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','COMPLETED','catch','name','error','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','push','all','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format'];(function(_0x38954c,_0x357891){var _0x19fd62=function(_0x5a390d){while(--_0x5a390d){_0x38954c['push'](_0x38954c['shift']());}};_0x19fd62(++_0x357891);}(_0x2ea1,0xca));var _0x12ea=function(_0x528f86,_0x51c6a7){_0x528f86=_0x528f86-0x0;var _0x328ac4=_0x2ea1[_0x528f86];return _0x328ac4;};var _=require(_0x12ea('0x0'));var AWS=require(_0x12ea('0x1'));var rp=require(_0x12ea('0x2'));var util=require(_0x12ea('0x3'));var BPromise=require(_0x12ea('0x4'));var db=require(_0x12ea('0x5'))['db'];var logger=require(_0x12ea('0x6'))(_0x12ea('0x7'));function getTranscriptionJob(_0x4fd449,_0xe2a3db,_0x473244,_0x2f2b99){return new Promise(function(_0x551f0b,_0x132217){var _0x242d90=new AWS[(_0x12ea('0x8'))]({'accessKeyId':_0xe2a3db,'secretAccessKey':_0x4fd449,'region':_0x473244});_0x242d90[_0x12ea('0x9')]({'TranscriptionJobName':_0x2f2b99},function(_0x3d83e1,_0xacc885){if(_0x3d83e1){return _0x132217(_0x3d83e1);}else{return _0x551f0b(_0xacc885);}});});}function sentiment(_0x34cf50,_0x539915,_0x5984f7,_0x1e82ed,_0x479ce0){return new Promise(function(_0x840c2c,_0x3d1fcd){var _0x42b031=new AWS[(_0x12ea('0xa'))]({'accessKeyId':_0x539915,'secretAccessKey':_0x34cf50,'region':_0x5984f7});_0x42b031['detectSentiment']({'Text':_0x1e82ed,'LanguageCode':_0x479ce0[_0x12ea('0xb')](0x0,0x2)},function(_0x1088d2,_0x495461){if(_0x1088d2){return _0x3d1fcd(_0x1088d2);}else{return _0x840c2c(_0x495461);}});});}function checkTranscribeJob(_0xba3241,_0x4961b4,_0x4ec8b1){var _0x328754;return new BPromise(function(_0x1bf20c,_0x2bb806){logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0xe'),_0xba3241['id'],_0xba3241[_0x12ea('0xf')]));return getTranscriptionJob(_0x4ec8b1[_0x12ea('0x10')],_0x4ec8b1['data2'],_0x4961b4[_0x12ea('0x11')],_0xba3241[_0x12ea('0xf')])[_0x12ea('0x12')](function(_0x17ed14){logger['info'](util[_0x12ea('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xba3241['id'],_0xba3241[_0x12ea('0xf')],_0x17ed14[_0x12ea('0x13')][_0x12ea('0x14')]));if(!_0xba3241['fileText']){switch(_0x17ed14['TranscriptionJob'][_0x12ea('0x14')]){case'COMPLETED':var _0x524658={'transcribeStatus':_0x17ed14['TranscriptionJob'][_0x12ea('0x14')],'fileUri':_0x17ed14[_0x12ea('0x13')][_0x12ea('0x15')][_0x12ea('0x16')]};logger['info'](util[_0x12ea('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0xba3241['id']));return rp({'uri':_0x17ed14[_0x12ea('0x13')][_0x12ea('0x15')][_0x12ea('0x16')],'json':!![]})[_0x12ea('0x12')](function(_0x1687b7){logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x17'),_0xba3241['id']));if(_0x1687b7&&_0x1687b7['results']&&_0x1687b7[_0x12ea('0x18')][_0x12ea('0x19')]&&_0x1687b7[_0x12ea('0x18')]['transcripts']['length']){_0x524658[_0x12ea('0x1a')]='';for(var _0x5ece48=0x0;_0x5ece48<_0x1687b7[_0x12ea('0x18')][_0x12ea('0x19')][_0x12ea('0x1b')];_0x5ece48++){_0x524658['fileText']+=_0x1687b7['results'][_0x12ea('0x19')][_0x5ece48][_0x12ea('0x1c')]+'';}}return _0xba3241['update'](_0x524658);})['then'](function(){logger['info'](util[_0x12ea('0xd')](_0x12ea('0x1d'),_0xba3241['id']));if(!_0xba3241['tempSentiment']){throw new db['Sequelize'][(_0x12ea('0x1e'))](_0x12ea('0x1f'));}if(!_0x4961b4[_0x12ea('0x20')]||!_0x4961b4[_0x12ea('0x21')]||!_0x4961b4['sentimentRegion']||!_0x4961b4[_0x12ea('0x22')]||!_0x4961b4[_0x12ea('0x23')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))](_0x12ea('0x25'));}if(!_0x524658[_0x12ea('0x1a')]){throw new Error(_0x12ea('0x26'));}if(_0x4961b4[_0x12ea('0x21')]===_0x4ec8b1['id']){return _0x4ec8b1;}else{return db[_0x12ea('0x27')][_0x12ea('0x28')]({'where':{'id':_settings[_0x12ea('0x21')]}});}})[_0x12ea('0x12')](function(_0x42473d){if(!_0x42473d){throw new db['Sequelize'][(_0x12ea('0x1e'))](_0x12ea('0x29'));}if(!_0x42473d[_0x12ea('0x10')]||!_0x42473d[_0x12ea('0x2a')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))](_0x12ea('0x2b'));}_0x328754=_0x42473d;logger['info'](util[_0x12ea('0xd')](_0x12ea('0x2c'),_0xba3241['id']));return sentiment(_0x328754[_0x12ea('0x10')],_0x328754[_0x12ea('0x2a')],_0x4961b4[_0x12ea('0x2d')],_0x524658[_0x12ea('0x1a')],_0x4961b4[_0x12ea('0x22')]);})[_0x12ea('0x12')](function(_0x271a7e){logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x2e'),_0xba3241['id']));return _0xba3241[_0x12ea('0x2f')]({'sentiment':_0x271a7e[_0x12ea('0x30')],'sPositive':_0x271a7e['SentimentScore'][_0x12ea('0x31')],'sNegative':_0x271a7e[_0x12ea('0x32')][_0x12ea('0x33')],'sMixed':_0x271a7e[_0x12ea('0x32')][_0x12ea('0x34')],'sNeutral':_0x271a7e[_0x12ea('0x32')][_0x12ea('0x35')]});})[_0x12ea('0x12')](function(){logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x1d'),_0xba3241['id']));_0x1bf20c();});case _0x12ea('0x36'):return _0xba3241[_0x12ea('0x2f')]({'transcribeStatus':_0x12ea('0x36'),'failureReason':_0x17ed14[_0x12ea('0x13')]['FailureReason']})[_0x12ea('0x12')](function(){logger[_0x12ea('0xc')](util[_0x12ea('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xba3241['id']));_0x1bf20c();});default:logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x37'),_0xba3241['id']));break;}}else{return BPromise[_0x12ea('0x38')]()[_0x12ea('0x12')](function(){if(!_0xba3241[_0x12ea('0x39')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4961b4['sentiment']||!_0x4961b4['sentimentAccountId']||!_0x4961b4[_0x12ea('0x2d')]||!_0x4961b4[_0x12ea('0x22')]||!_0x4961b4[_0x12ea('0x23')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xba3241[_0x12ea('0x1a')]){throw new Error(_0x12ea('0x26'));}if(_0x4961b4[_0x12ea('0x21')]===_0x4ec8b1['id']){return _0x4ec8b1;}else{return db[_0x12ea('0x27')][_0x12ea('0x28')]({'where':{'id':_settings[_0x12ea('0x21')]}});}})[_0x12ea('0x12')](function(_0x399298){if(!_0x399298){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x399298[_0x12ea('0x10')]||!_0x399298[_0x12ea('0x2a')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x328754=_0x399298;logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x2c'),_0xba3241['id']));return sentiment(_0x328754[_0x12ea('0x10')],_0x328754[_0x12ea('0x2a')],_0x4961b4[_0x12ea('0x2d')],_0xba3241['fileText'],_0x4961b4[_0x12ea('0x22')]);})[_0x12ea('0x12')](function(_0xd36c86){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xba3241['id']));return _0xba3241[_0x12ea('0x2f')]({'sentiment':_0xd36c86[_0x12ea('0x30')],'sPositive':_0xd36c86[_0x12ea('0x32')]['Positive'],'sNegative':_0xd36c86[_0x12ea('0x32')]['Negative'],'sMixed':_0xd36c86[_0x12ea('0x32')][_0x12ea('0x34')],'sNeutral':_0xd36c86[_0x12ea('0x32')][_0x12ea('0x35')],'transcribeStatus':_0x12ea('0x3a')});})[_0x12ea('0x12')](function(){logger[_0x12ea('0xc')](util[_0x12ea('0xd')](_0x12ea('0x1d'),_0xba3241['id']));_0x1bf20c();});}})[_0x12ea('0x3b')](function(_0x415a77){if(_0x415a77){if(!_0x415a77['name']||_0x415a77[_0x12ea('0x3c')]!=='SequelizeValidationError'){logger[_0x12ea('0x3d')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0xba3241['id']),util['inspect'](_0x415a77,{'showHidden':![],'depth':null}));}}_0x1bf20c();});});}function checkTranscribe(){var _0x9b13ac;var _0xbfb545;var _0x8cdd63;return db[_0x12ea('0x3e')][_0x12ea('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x340c0f){if(!_0x340c0f||!_0x340c0f[_0x12ea('0x1b')]){throw new db['Sequelize']['ValidationError'](_0x12ea('0x40'));}_0x9b13ac=_0x340c0f;return db[_0x12ea('0x41')][_0x12ea('0x28')]({'where':{'id':0x1}});})[_0x12ea('0x12')](function(_0x19add4){if(!_0x19add4){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Settings\x20not\x20available');}_0xbfb545=_0x19add4;if(!_0xbfb545['transcribe']||!_0xbfb545[_0x12ea('0x42')]||!_0xbfb545[_0x12ea('0x11')]||!_0xbfb545[_0x12ea('0x22')]||!_0xbfb545['bucket']){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))]('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0xbfb545[_0x12ea('0x42')]}});})[_0x12ea('0x12')](function(_0x4d2fb9){if(!_0x4d2fb9){throw new db['Sequelize']['ValidationError'](_0x12ea('0x29'));}if(!_0x4d2fb9[_0x12ea('0x10')]||!_0x4d2fb9[_0x12ea('0x2a')]){throw new db[(_0x12ea('0x24'))][(_0x12ea('0x1e'))](_0x12ea('0x2b'));}_0x8cdd63=_0x4d2fb9;var _0x2ba37b=[];_0x9b13ac['forEach'](function(_0x59bf9d){_0x2ba37b[_0x12ea('0x43')](checkTranscribeJob(_0x59bf9d,_0xbfb545,_0x8cdd63));});return BPromise[_0x12ea('0x44')](_0x2ba37b);})[_0x12ea('0x3b')](function(_0x223c44){if(_0x223c44){if(!_0x223c44['name']||_0x223c44[_0x12ea('0x3c')]!==_0x12ea('0x45')){logger['error'](util[_0x12ea('0x46')](_0x223c44,{'showHidden':![],'depth':null}));}}});}exports[_0x12ea('0x47')]=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 62937b0..17da443 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 _0xbb68=['hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract'];(function(_0x6a6e73,_0x1bda40){var _0x2a046c=function(_0x429c27){while(--_0x429c27){_0x6a6e73['push'](_0x6a6e73['shift']());}};_0x2a046c(++_0x1bda40);}(_0xbb68,0xad));var _0x8bb6=function(_0x4be6aa,_0x3b4465){_0x4be6aa=_0x4be6aa-0x0;var _0x1ce707=_0xbb68[_0x4be6aa];return _0x1ce707;};'use strict';var _=require(_0x8bb6('0x0'));var moment=require(_0x8bb6('0x1'));var Redis=require(_0x8bb6('0x2'));var util=require(_0x8bb6('0x3'));var config=require(_0x8bb6('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x8bb6('0x5'))(_0x8bb6('0x6'));config[_0x8bb6('0x7')]=_['defaults'](config[_0x8bb6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8bb6('0x8'))(new Redis(config[_0x8bb6('0x7')]));function closeInteractions(){var _0x33a7e4=[];return db[_0x8bb6('0x9')][_0x8bb6('0xa')]({'raw':!![],'attributes':['id',_0x8bb6('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8bb6('0xc')](0x18,_0x8bb6('0xd'))}}})[_0x8bb6('0xe')](function(_0x59a89e){if(_0x59a89e&&_0x59a89e['length']){_0x33a7e4=_[_0x8bb6('0xf')](_0x59a89e||[],'id');logger['info'](_0x8bb6('0x10'),_0x33a7e4['join']());return db[_0x8bb6('0x9')]['update']({'closeReason':'system','disposition':_0x8bb6('0x11'),'closed':!![],'closedAt':moment()[_0x8bb6('0x12')](_0x8bb6('0x13'))},{'where':{'id':_0x33a7e4}});}})[_0x8bb6('0xe')](function(){if(_0x33a7e4&&_0x33a7e4[_0x8bb6('0x14')]){logger[_0x8bb6('0x15')](_0x8bb6('0x16'),_0x33a7e4[_0x8bb6('0x17')]());for(var _0x30e514=0x0;_0x30e514<_0x33a7e4['length'];_0x30e514++){io[_0x8bb6('0x18')](_0x8bb6('0x19'),{'id':_0x33a7e4[_0x30e514],'closed':!![]});}}})[_0x8bb6('0x1a')](function(_0x387243){logger[_0x8bb6('0x1b')](_0x8bb6('0x1c'),_0x387243?util[_0x8bb6('0x1d')](_0x387243,{'showHidden':![],'depth':null}):'');});}exports[_0x8bb6('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3b77=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','hours','length','map'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x3b77,0x188));var _0x73b7=function(_0x697b17,_0x1f03c6){_0x697b17=_0x697b17-0x0;var _0xad2f38=_0x3b77[_0x697b17];return _0xad2f38;};'use strict';var _=require(_0x73b7('0x0'));var moment=require(_0x73b7('0x1'));var Redis=require(_0x73b7('0x2'));var util=require(_0x73b7('0x3'));var config=require(_0x73b7('0x4'));var db=require(_0x73b7('0x5'))['db'];var logger=require('../logger')('schedule');config[_0x73b7('0x6')]=_[_0x73b7('0x7')](config[_0x73b7('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x537b28=[];return db[_0x73b7('0x8')][_0x73b7('0x9')]({'raw':!![],'attributes':['id',_0x73b7('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x73b7('0xb'))}}})['then'](function(_0x4ff5d3){if(_0x4ff5d3&&_0x4ff5d3[_0x73b7('0xc')]){_0x537b28=_[_0x73b7('0xd')](_0x4ff5d3||[],'id');logger[_0x73b7('0xe')](_0x73b7('0xf'),_0x537b28[_0x73b7('0x10')]());return db['WhatsappInteraction'][_0x73b7('0x11')]({'closeReason':_0x73b7('0x12'),'disposition':_0x73b7('0x13'),'closed':!![],'closedAt':moment()[_0x73b7('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x537b28}});}})[_0x73b7('0x15')](function(){if(_0x537b28&&_0x537b28[_0x73b7('0xc')]){logger[_0x73b7('0xe')](_0x73b7('0x16'),_0x537b28[_0x73b7('0x10')]());for(var _0x2f3c35=0x0;_0x2f3c35<_0x537b28[_0x73b7('0xc')];_0x2f3c35++){io[_0x73b7('0x17')](_0x73b7('0x18'),{'id':_0x537b28[_0x2f3c35],'closed':!![]});}}})[_0x73b7('0x19')](function(_0x3a2ca6){logger[_0x73b7('0x1a')](_0x73b7('0x1b'),_0x3a2ca6?util[_0x73b7('0x1c')](_0x3a2ca6,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 58e054f..85b87ce 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e92=['hopper2','catch','log','util','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','hopper1','contacts2','CmHopper'];(function(_0x2b4c36,_0x48a33f){var _0x5b7ccd=function(_0x191bcc){while(--_0x191bcc){_0x2b4c36['push'](_0x2b4c36['shift']());}};_0x5b7ccd(++_0x48a33f);}(_0x8e92,0x1b8));var _0x28e9=function(_0x2e559d,_0x3daedd){_0x2e559d=_0x2e559d-0x0;var _0x3f7065=_0x8e92[_0x2e559d];return _0x3f7065;};'use strict';var util=require(_0x28e9('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x28e9('0x1')]({'id':i,'firstName':_0x28e9('0x2')+i,'lastName':_0x28e9('0x3')+i,'phone':0xf879fb460+i,'email':_0x28e9('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x28e9('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x28e9('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x28e9('0x1')]({'id':i,'firstName':_0x28e9('0x2')+i,'lastName':_0x28e9('0x3')+i,'phone':0xf879fb460+i,'email':_0x28e9('0x4')+i+_0x28e9('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x28e9('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x28e9('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x28e9('0x5')](),'updatedAt':Date[_0x28e9('0x5')]()});}db[_0x28e9('0x7')][_0x28e9('0x8')]({'where':{}})[_0x28e9('0x9')](function(){return db[_0x28e9('0x7')][_0x28e9('0xa')](contacts);})[_0x28e9('0x9')](function(){console['log'](_0x28e9('0xb'),_0x28e9('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0x28e9('0x9')](function(){return db['CmHopper'][_0x28e9('0xa')](hopper);})['then'](function(){console['log'](_0x28e9('0xb'),_0x28e9('0xd'));return db[_0x28e9('0x7')]['bulkCreate'](contacts2);})[_0x28e9('0x9')](function(){console['log'](_0x28e9('0xb'),_0x28e9('0xe'));return db[_0x28e9('0xf')][_0x28e9('0xa')](hopper2);})[_0x28e9('0x9')](function(){console['log'](_0x28e9('0xb'),_0x28e9('0x10'));})[_0x28e9('0x11')](function(_0x231ead){console[_0x28e9('0x12')](_0x231ead);}); \ No newline at end of file +var _0x5d00=['innocenzo.biondo','now','Biondo','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','hopper2','catch','util','push','Innocenzo'];(function(_0x1dec9a,_0x3b8034){var _0xc7c6ac=function(_0x50fd29){while(--_0x50fd29){_0x1dec9a['push'](_0x1dec9a['shift']());}};_0xc7c6ac(++_0x3b8034);}(_0x5d00,0x189));var _0x05d0=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x5d00[_0x541260];return _0x1dd2b5;};'use strict';var util=require(_0x05d0('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x05d0('0x1')]({'id':i,'firstName':_0x05d0('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x05d0('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x05d0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x05d0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x05d0('0x4')](),'updatedAt':Date[_0x05d0('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x05d0('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x05d0('0x5')+i,'phone':0xf879fb460+i,'email':_0x05d0('0x3')+i+_0x05d0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x05d0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x05d0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x05d0('0x7')][_0x05d0('0x8')]({'where':{}})[_0x05d0('0x9')](function(){return db[_0x05d0('0x7')][_0x05d0('0xa')](contacts);})[_0x05d0('0x9')](function(){console[_0x05d0('0xb')](_0x05d0('0xc'),_0x05d0('0xd'));return db[_0x05d0('0xe')][_0x05d0('0x8')]({'where':{}});})[_0x05d0('0x9')](function(){return db[_0x05d0('0xe')][_0x05d0('0xa')](hopper);})[_0x05d0('0x9')](function(){console['log'](_0x05d0('0xc'),'hopper1');return db['CmContact'][_0x05d0('0xa')](contacts2);})[_0x05d0('0x9')](function(){console[_0x05d0('0xb')](_0x05d0('0xc'),_0x05d0('0xf'));return db[_0x05d0('0xe')][_0x05d0('0xa')](hopper2);})[_0x05d0('0x9')](function(){console[_0x05d0('0xb')](_0x05d0('0xc'),_0x05d0('0x10'));})[_0x05d0('0x11')](function(_0x2102a4){console[_0x05d0('0xb')](_0x2102a4);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 59a88da..9a6e9ac 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd08=['yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','bulkCreate','add\x20user','catch','log','util','push','%s%s','agent','format','%s%s@xcally.com','friend','udp','wss','all','ulaw'];(function(_0x950367,_0x315c48){var _0x3c2d4c=function(_0x115d21){while(--_0x115d21){_0x950367['push'](_0x950367['shift']());}};_0x3c2d4c(++_0x315c48);}(_0xbd08,0x103));var _0x8bd0=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xbd08[_0x2dadb9];return _0x2f0097;};'use strict';var util=require(_0x8bd0('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8bd0('0x1')]({'name':util['format'](_0x8bd0('0x2'),_0x8bd0('0x3'),i),'fullname':util[_0x8bd0('0x4')](_0x8bd0('0x2'),_0x8bd0('0x3'),i),'email':util[_0x8bd0('0x4')](_0x8bd0('0x5'),_0x8bd0('0x3'),i),'role':_0x8bd0('0x3'),'password':'password','internal':0xfa0+i,'type':_0x8bd0('0x6'),'transport':[_0x8bd0('0x7'),'ws',_0x8bd0('0x8')],'disallow':[_0x8bd0('0x9')],'allow':[_0x8bd0('0xa')],'defaultuser':util[_0x8bd0('0x4')](_0x8bd0('0x2'),_0x8bd0('0x3'),i),'encryption':_0x8bd0('0xb'),'avpf':_0x8bd0('0xb'),'force_avp':_0x8bd0('0xb'),'icesupport':_0x8bd0('0xb'),'dtlsenable':_0x8bd0('0xb'),'dtlsverify':'no','dtlscertfile':_0x8bd0('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x8bd0('0x4')](_0x8bd0('0xd'),util[_0x8bd0('0x4')]('%s%s','agent',i),0xfa0+i)});}db['User'][_0x8bd0('0xe')](users)['then'](function(){console['log'](_0x8bd0('0xf'));})[_0x8bd0('0x10')](function(_0x113f2e){console[_0x8bd0('0x11')](_0x113f2e);}); \ No newline at end of file +var _0xb742=['%s%s','agent','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','log','add\x20user','catch','../mysqldb','format'];(function(_0xda78ce,_0x174e19){var _0x373fa5=function(_0x15fb90){while(--_0x15fb90){_0xda78ce['push'](_0xda78ce['shift']());}};_0x373fa5(++_0x174e19);}(_0xb742,0xdb));var _0x2b74=function(_0x41fb98,_0x470189){_0x41fb98=_0x41fb98-0x0;var _0x4b0044=_0xb742[_0x41fb98];return _0x4b0044;};'use strict';var util=require('util');var db=require(_0x2b74('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x2b74('0x1')](_0x2b74('0x2'),_0x2b74('0x3'),i),'fullname':util['format'](_0x2b74('0x2'),'agent',i),'email':util[_0x2b74('0x1')]('%s%s@xcally.com',_0x2b74('0x3'),i),'role':_0x2b74('0x3'),'password':_0x2b74('0x4'),'internal':0xfa0+i,'type':_0x2b74('0x5'),'transport':['udp','ws',_0x2b74('0x6')],'disallow':[_0x2b74('0x7')],'allow':[_0x2b74('0x8')],'defaultuser':util[_0x2b74('0x1')](_0x2b74('0x2'),'agent',i),'encryption':'yes','avpf':_0x2b74('0x9'),'force_avp':_0x2b74('0x9'),'icesupport':_0x2b74('0x9'),'dtlsenable':_0x2b74('0x9'),'dtlsverify':'no','dtlscertfile':_0x2b74('0xa'),'dtlsprivatekey':_0x2b74('0xb'),'dtlssetup':'actpass','callerid':util[_0x2b74('0x1')](_0x2b74('0xc'),util[_0x2b74('0x1')](_0x2b74('0x2'),'agent',i),0xfa0+i)});}db[_0x2b74('0xd')]['bulkCreate'](users)['then'](function(){console[_0x2b74('0xe')](_0x2b74('0xf'));})[_0x2b74('0x10')](function(_0x1144fe){console[_0x2b74('0xe')](_0x1144fe);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8847a29..5a9624b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf562=['find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','Trunk','user','VoiceQueue','FaxQueues','MailQueue','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','whatsapp','telephone:%s','leave','user_has_chat_interactions:remove','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','remoteAddress','request','connectedAt','log','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','Campaign','format','%s:queue:%s','length','handshake'];(function(_0x5ab58f,_0x3d9ecd){var _0x25dedd=function(_0x54564c){while(--_0x54564c){_0x5ab58f['push'](_0x5ab58f['shift']());}};_0x25dedd(++_0x3d9ecd);}(_0xf562,0x100));var _0x2f56=function(_0x4c3fc1,_0x480964){_0x4c3fc1=_0x4c3fc1-0x0;var _0x39d319=_0xf562[_0x4c3fc1];return _0x39d319;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var BPromise=require(_0x2f56('0x2'));var db=require(_0x2f56('0x3'))['db'];var config=require(_0x2f56('0x4'));var queryQueues={'attributes':['id',_0x2f56('0x5')],'include':[{'as':_0x2f56('0x6'),'model':db[_0x2f56('0x7')],'attributes':['id',_0x2f56('0x5'),'role'],'raw':!![],'where':{'role':_0x2f56('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x2f56('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x2f56('0x5')],'where':{'role':_0x2f56('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2f56('0x5'),_0x2f56('0xa')],'where':{'type':_0x2f56('0xb')}};function getAssociatedResources(_0x2975c2,_0x176c49,_0x2d549e){return db[_0x2f56('0xc')]['findOne']({'where':{'name':_0x2975c2,'userProfileId':_0x176c49},'raw':!![]})[_0x2f56('0xd')](function(_0x39572f){if(_0x39572f){if(_0x39572f['autoAssociation']){switch(_0x2975c2){case _0x2f56('0xe'):case _0x2f56('0xf'):case'FaxQueues':case _0x2f56('0x10'):case'MailQueues':case _0x2f56('0x11'):case'WhatsappQueues':return db[_0x2d549e][_0x2f56('0x12')](queryQueues);case _0x2f56('0x13'):return db[_0x2d549e][_0x2f56('0x12')](queryTelephones);case _0x2f56('0x14'):return db[_0x2d549e][_0x2f56('0x12')](queryTrunks);case _0x2f56('0x15'):return db[_0x2d549e][_0x2f56('0x12')](queryCampaigns);}}else{return db[_0x2f56('0x16')]['findAll']({'attributes':[_0x2f56('0x17')],'where':{'sectionId':_0x39572f['id']},'raw':!![]})[_0x2f56('0xd')](function(_0x11dd1e){if(_0x11dd1e){var _0x1d2463={'where':{'id':_[_0x2f56('0x18')](_0x11dd1e,'resourceId')},'raw':!![]};switch(_0x2d549e){case _0x2f56('0x7'):_0x1d2463[_0x2f56('0x19')][_0x2f56('0x1a')]=_0x2f56('0x9');break;case _0x2f56('0x1b'):_0x1d2463['where'][_0x2f56('0xa')]=_0x2f56('0xb');break;}return db[_0x2d549e][_0x2f56('0x12')](_0x1d2463);}else{return[];}});}}else{return[];}})[_0x2f56('0xd')](function(_0x45ad8c){return _0x45ad8c;});}function joinOrLeaveQueues(_0x562cea,_0x3a3161,_0x19ab8c,_0x22e2e6){_0x562cea[_0x3a3161](util[_0x2f56('0x1c')](_0x2f56('0x1d'),_0x19ab8c,_0x22e2e6[_0x2f56('0x5')]));if(_0x22e2e6[_0x2f56('0x6')]){for(var _0x349d55=0x0;_0x349d55<_0x22e2e6['Agents'][_0x2f56('0x1e')];_0x349d55+=0x1){_0x562cea[_0x3a3161](util['format']('user:%s',_0x22e2e6[_0x2f56('0x6')][_0x349d55][_0x2f56('0x5')]));}}}function joinOrLeave(_0x26d5d1,_0x4ee4c9,_0x21f4b0){var _0x433f0b;if(_0x26d5d1[_0x2f56('0x1f')]['query']['id']){db['User'][_0x2f56('0x20')]({'attributes':['id',_0x2f56('0x5'),_0x2f56('0x1a'),_0x2f56('0x21')],'where':{'id':_0x26d5d1[_0x2f56('0x1f')]['query']['id']},'include':[{'model':db[_0x2f56('0x22')],'as':_0x2f56('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2f56('0x24')],'as':_0x2f56('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2f56('0x26')],'as':_0x2f56('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2f56('0x28')],'as':_0x2f56('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x2f56('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2f56('0x2b')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x284252){if(_0x284252){_0x433f0b=_0x284252;_0x26d5d1[_0x4ee4c9](util[_0x2f56('0x1c')](_0x2f56('0x2c'),_0x284252['name']));var _0x55685d=[];switch(_0x284252['role']){case _0x2f56('0x2d'):_0x26d5d1[_0x4ee4c9](_0x2f56('0x2e'));_0x26d5d1[_0x4ee4c9](_0x2f56('0x2f'));if(queryQueues[_0x2f56('0x30')](_0x2f56('0x31'))){delete queryQueues[_0x2f56('0x31')];}_0x55685d[_0x2f56('0x32')](db['VoiceQueue'][_0x2f56('0x12')](queryQueues));_0x55685d[_0x2f56('0x32')](db[_0x2f56('0x33')]['findAll'](queryQueues));_0x55685d[_0x2f56('0x32')](db[_0x2f56('0x34')][_0x2f56('0x12')](queryQueues));_0x55685d[_0x2f56('0x32')](db[_0x2f56('0x35')][_0x2f56('0x12')](queryQueues));_0x55685d[_0x2f56('0x32')](db['MailQueue'][_0x2f56('0x12')](queryQueues));_0x55685d[_0x2f56('0x32')](db['OpenchannelQueue'][_0x2f56('0x12')](queryQueues));_0x55685d[_0x2f56('0x32')](db['WhatsappQueue'][_0x2f56('0x12')](queryQueues));_0x55685d['push'](db['User'][_0x2f56('0x12')](queryTelephones));_0x55685d[_0x2f56('0x32')](db[_0x2f56('0x36')]['findAll'](queryTrunks));_0x55685d[_0x2f56('0x32')](db['Campaign'][_0x2f56('0x12')](queryCampaigns));_0x55685d['push'](db[_0x2f56('0x7')][_0x2f56('0x12')](queryAgents));break;case _0x2f56('0x37'):_0x26d5d1[_0x4ee4c9]('voice:inbound');_0x26d5d1[_0x4ee4c9](_0x2f56('0x2f'));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0xe'),_0x284252[_0x2f56('0x21')],_0x2f56('0x38')));_0x55685d[_0x2f56('0x32')](getAssociatedResources('ChatQueues',_0x284252[_0x2f56('0x21')],_0x2f56('0x33')));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0x39'),_0x284252[_0x2f56('0x21')],_0x2f56('0x34')));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0x10'),_0x284252[_0x2f56('0x21')],'SmsQueue'));_0x55685d[_0x2f56('0x32')](getAssociatedResources('MailQueues',_0x284252[_0x2f56('0x21')],_0x2f56('0x3a')));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0x11'),_0x284252[_0x2f56('0x21')],_0x2f56('0x3b')));_0x55685d[_0x2f56('0x32')](getAssociatedResources('WhatsappQueues',_0x284252['userProfileId'],_0x2f56('0x3c')));_0x55685d['push'](getAssociatedResources(_0x2f56('0x13'),_0x284252[_0x2f56('0x21')],_0x2f56('0x7')));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0x14'),_0x284252[_0x2f56('0x21')],_0x2f56('0x36')));_0x55685d[_0x2f56('0x32')](getAssociatedResources(_0x2f56('0x15'),_0x284252['userProfileId'],'Campaign'));_0x55685d[_0x2f56('0x32')](db['User'][_0x2f56('0x12')](queryAgents));break;case _0x2f56('0x8'):_0x26d5d1[_0x4ee4c9](_0x2f56('0x2e'));_0x26d5d1[_0x4ee4c9](_0x2f56('0x2f'));_0x55685d[_0x2f56('0x32')](_0x284252[_0x2f56('0x3d')]({'attributes':['id','name']}));_0x55685d['push'](_0x284252['getChatQueues']({'attributes':['id',_0x2f56('0x5')]}));_0x55685d['push'](_0x284252[_0x2f56('0x3e')]({'attributes':['id',_0x2f56('0x5')]}));_0x55685d['push'](_0x284252[_0x2f56('0x3f')]({'attributes':['id','name']}));_0x55685d[_0x2f56('0x32')](_0x284252['getMailQueues']({'attributes':['id',_0x2f56('0x5')]}));_0x55685d[_0x2f56('0x32')](_0x284252[_0x2f56('0x40')]({'attributes':['id',_0x2f56('0x5')]}));_0x55685d['push'](_0x284252[_0x2f56('0x41')]({'attributes':['id',_0x2f56('0x5')]}));break;}return BPromise[_0x2f56('0x42')](_0x55685d);}})[_0x2f56('0xd')](function(_0x274343){if(_0x274343&&_0x274343['length']){for(var _0x1deea1=0x0;_0x1deea1<_0x274343[_0x2f56('0x1e')];_0x1deea1+=0x1){for(var _0x349f6b=0x0;_0x349f6b<_0x274343[_0x1deea1]['length'];_0x349f6b+=0x1){switch(_0x1deea1){case 0x0:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,_0x2f56('0x43'),_0x274343[_0x1deea1][_0x349f6b]);break;case 0x1:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,'chat',_0x274343[_0x1deea1][_0x349f6b]);break;case 0x2:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,_0x2f56('0x44'),_0x274343[_0x1deea1][_0x349f6b]);break;case 0x3:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,_0x2f56('0x45'),_0x274343[_0x1deea1][_0x349f6b]);break;case 0x4:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,'mail',_0x274343[_0x1deea1][_0x349f6b]);break;case 0x5:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,'openchannel',_0x274343[_0x1deea1][_0x349f6b]);break;case 0x6:joinOrLeaveQueues(_0x26d5d1,_0x4ee4c9,_0x2f56('0x46'),_0x274343[_0x1deea1][_0x349f6b]);break;case 0x7:if(_0x433f0b[_0x2f56('0x1a')]!==_0x2f56('0x8'))_0x26d5d1[_0x4ee4c9](util[_0x2f56('0x1c')](_0x2f56('0x47'),_0x274343[_0x1deea1][_0x349f6b]['name']));break;case 0x8:if(_0x433f0b[_0x2f56('0x1a')]!==_0x2f56('0x8'))_0x26d5d1[_0x4ee4c9](util[_0x2f56('0x1c')]('trunk:%s',_0x274343[_0x1deea1][_0x349f6b][_0x2f56('0x5')]));break;case 0x9:if(_0x433f0b[_0x2f56('0x1a')]!==_0x2f56('0x8'))_0x26d5d1[_0x4ee4c9](util[_0x2f56('0x1c')]('campaign:%s:%s',_0x274343[_0x1deea1][_0x349f6b][_0x2f56('0xa')],_0x274343[_0x1deea1][_0x349f6b][_0x2f56('0x5')]));break;case 0xa:_0x26d5d1[_0x4ee4c9](util[_0x2f56('0x1c')](_0x2f56('0x2c'),_0x274343[_0x1deea1][_0x349f6b][_0x2f56('0x5')]));break;}}}}})[_0x2f56('0xd')](function(){if(_0x4ee4c9===_0x2f56('0x48')){var _0x5a9c12=_[_0x2f56('0x18')](_0x433f0b[_0x2f56('0x23')],'id');return _0x433f0b['removeChatInteractions'](_0x5a9c12)['then'](function(){for(var _0x11ad65=0x0;_0x11ad65<_0x5a9c12[_0x2f56('0x1e')];_0x11ad65+=0x1){_0x21f4b0['emit'](_0x2f56('0x49'),{'ChatInteractionId':Number(_0x5a9c12[_0x11ad65]),'UserId':Number(_0x433f0b['id'])});}});}})['then'](function(){if(_0x4ee4c9===_0x2f56('0x48')){var _0x47e765=_[_0x2f56('0x18')](_0x433f0b['MailInteractions'],'id');return _0x433f0b['removeMailInteractions'](_0x47e765)[_0x2f56('0xd')](function(){for(var _0x3f3009=0x0;_0x3f3009<_0x47e765[_0x2f56('0x1e')];_0x3f3009+=0x1){_0x21f4b0[_0x2f56('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x47e765[_0x3f3009]),'UserId':Number(_0x433f0b['id'])});}});}})[_0x2f56('0xd')](function(){if(_0x4ee4c9==='leave'){var _0x3074d0=_[_0x2f56('0x18')](_0x433f0b[_0x2f56('0x27')],'id');return _0x433f0b[_0x2f56('0x4b')](_0x3074d0)[_0x2f56('0xd')](function(){for(var _0x4c7bb4=0x0;_0x4c7bb4<_0x3074d0['length'];_0x4c7bb4+=0x1){_0x21f4b0[_0x2f56('0x4a')](_0x2f56('0x4c'),{'FaxInteractionId':Number(_0x3074d0[_0x4c7bb4]),'UserId':Number(_0x433f0b['id'])});}});}})['then'](function(){if(_0x4ee4c9===_0x2f56('0x48')){var _0x3ba3b5=_[_0x2f56('0x18')](_0x433f0b[_0x2f56('0x29')],'id');return _0x433f0b[_0x2f56('0x4d')](_0x3ba3b5)[_0x2f56('0xd')](function(){for(var _0x468585=0x0;_0x468585<_0x3ba3b5[_0x2f56('0x1e')];_0x468585+=0x1){_0x21f4b0[_0x2f56('0x4a')](_0x2f56('0x4e'),{'SmsInteractionId':Number(_0x3ba3b5[_0x468585]),'UserId':Number(_0x433f0b['id'])});}});}})[_0x2f56('0xd')](function(){if(_0x4ee4c9===_0x2f56('0x48')){var _0x270981=_[_0x2f56('0x18')](_0x433f0b[_0x2f56('0x4f')],'id');return _0x433f0b[_0x2f56('0x50')](_0x270981)[_0x2f56('0xd')](function(){for(var _0x2fb548=0x0;_0x2fb548<_0x270981[_0x2f56('0x1e')];_0x2fb548+=0x1){_0x21f4b0[_0x2f56('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x270981[_0x2fb548]),'UserId':Number(_0x433f0b['id'])});}});}})['then'](function(){if(_0x4ee4c9===_0x2f56('0x48')){var _0x1a918b=_[_0x2f56('0x18')](_0x433f0b[_0x2f56('0x51')],'id');return _0x433f0b[_0x2f56('0x52')](_0x1a918b)[_0x2f56('0xd')](function(){for(var _0x4c05a3=0x0;_0x4c05a3<_0x1a918b[_0x2f56('0x1e')];_0x4c05a3+=0x1){_0x21f4b0['emit'](_0x2f56('0x53'),{'WhatsappInteractionId':Number(_0x1a918b[_0x4c05a3]),'UserId':Number(_0x433f0b['id'])});}});}})[_0x2f56('0x54')](function(_0x39c4fa){_0x26d5d1['log'](_0x39c4fa);});}}function onDisconnect(_0x3988a1,_0x323fef){joinOrLeave(_0x3988a1,'leave',_0x323fef);}function onConnect(_0x4fe1d2){joinOrLeave(_0x4fe1d2,_0x2f56('0x55'));}exports[_0x2f56('0x56')]=function(_0x5d8adf){_0x5d8adf['on'](_0x2f56('0x57'),function(_0x4d503a){_0x4d503a[_0x2f56('0x58')](0x0);_0x4d503a[_0x2f56('0x59')]=_0x4d503a['request']['connection'][_0x2f56('0x5a')]+':'+_0x4d503a[_0x2f56('0x5b')]['connection']['remotePort'];_0x4d503a[_0x2f56('0x5c')]=new Date();_0x4d503a[_0x2f56('0x5d')]=function(_0x77c6ee){console[_0x2f56('0x5d')]('SocketIO\x20'+_0x4d503a[_0x2f56('0x5e')][_0x2f56('0x5')]+'['+_0x4d503a[_0x2f56('0x59')]+']',_0x77c6ee);};_0x4d503a['on'](_0x2f56('0x5f'),function(){onDisconnect(_0x4d503a,_0x5d8adf);_0x4d503a[_0x2f56('0x5d')]('DISCONNECTED');});onConnect(_0x4d503a);_0x4d503a[_0x2f56('0x5d')]('CONNECTED');});}; \ No newline at end of file +var _0xc051=['Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','ivr','format','%s:queue:%s','user:%s','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueue','ChatQueues','ChatQueue','MailQueue','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','disconnect','CONNECTED','lodash','util','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll'];(function(_0x317030,_0x25a323){var _0x27f5b2=function(_0x28b782){while(--_0x28b782){_0x317030['push'](_0x317030['shift']());}};_0x27f5b2(++_0x25a323);}(_0xc051,0xb5));var _0x1c05=function(_0x53dbf8,_0x168a38){_0x53dbf8=_0x53dbf8-0x0;var _0x697a4c=_0xc051[_0x53dbf8];return _0x697a4c;};'use strict';var _=require(_0x1c05('0x0'));var util=require(_0x1c05('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x1c05('0x2'));var queryQueues={'attributes':['id',_0x1c05('0x3')],'include':[{'as':_0x1c05('0x4'),'model':db[_0x1c05('0x5')],'attributes':['id','name',_0x1c05('0x6')],'raw':!![],'where':{'role':_0x1c05('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1c05('0x3')],'where':{'role':_0x1c05('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1c05('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x1c05('0x3')],'where':{'role':_0x1c05('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1c05('0x3'),_0x1c05('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3894f0,_0x16e572,_0x21b6be){return db[_0x1c05('0xa')]['findOne']({'where':{'name':_0x3894f0,'userProfileId':_0x16e572},'raw':!![]})[_0x1c05('0xb')](function(_0x198a9b){if(_0x198a9b){if(_0x198a9b[_0x1c05('0xc')]){switch(_0x3894f0){case _0x1c05('0xd'):case'ChatQueues':case _0x1c05('0xe'):case'SmsQueues':case _0x1c05('0xf'):case _0x1c05('0x10'):case _0x1c05('0x11'):return db[_0x21b6be][_0x1c05('0x12')](queryQueues);case _0x1c05('0x13'):return db[_0x21b6be][_0x1c05('0x12')](queryTelephones);case _0x1c05('0x14'):return db[_0x21b6be][_0x1c05('0x12')](queryTrunks);case _0x1c05('0x15'):return db[_0x21b6be][_0x1c05('0x12')](queryCampaigns);}}else{return db[_0x1c05('0x16')][_0x1c05('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x198a9b['id']},'raw':!![]})[_0x1c05('0xb')](function(_0x175166){if(_0x175166){var _0x26a61e={'where':{'id':_['map'](_0x175166,_0x1c05('0x17'))},'raw':!![]};switch(_0x21b6be){case'User':_0x26a61e[_0x1c05('0x18')][_0x1c05('0x6')]=_0x1c05('0x8');break;case _0x1c05('0x19'):_0x26a61e[_0x1c05('0x18')]['type']=_0x1c05('0x1a');break;}return db[_0x21b6be][_0x1c05('0x12')](_0x26a61e);}else{return[];}});}}else{return[];}})[_0x1c05('0xb')](function(_0x4d0680){return _0x4d0680;});}function joinOrLeaveQueues(_0x2e177c,_0x1171b2,_0x3176c0,_0x4868ce){_0x2e177c[_0x1171b2](util[_0x1c05('0x1b')](_0x1c05('0x1c'),_0x3176c0,_0x4868ce['name']));if(_0x4868ce['Agents']){for(var _0x157af8=0x0;_0x157af8<_0x4868ce['Agents']['length'];_0x157af8+=0x1){_0x2e177c[_0x1171b2](util['format'](_0x1c05('0x1d'),_0x4868ce[_0x1c05('0x4')][_0x157af8]['name']));}}}function joinOrLeave(_0x34bbfb,_0x357401,_0x1d268e){var _0x2cf340;if(_0x34bbfb['handshake'][_0x1c05('0x1e')]['id']){db[_0x1c05('0x5')][_0x1c05('0x1f')]({'attributes':['id',_0x1c05('0x3'),_0x1c05('0x6'),_0x1c05('0x20')],'where':{'id':_0x34bbfb['handshake'][_0x1c05('0x1e')]['id']},'include':[{'model':db[_0x1c05('0x21')],'as':_0x1c05('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1c05('0x23')],'as':_0x1c05('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1c05('0x25')],'as':_0x1c05('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x1c05('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1c05('0x28')],'as':_0x1c05('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1c05('0xb')](function(_0x1d548e){if(_0x1d548e){_0x2cf340=_0x1d548e;_0x34bbfb[_0x357401](util[_0x1c05('0x1b')](_0x1c05('0x1d'),_0x1d548e[_0x1c05('0x3')]));var _0x438f4d=[];switch(_0x1d548e[_0x1c05('0x6')]){case _0x1c05('0x2a'):_0x34bbfb[_0x357401](_0x1c05('0x2b'));_0x34bbfb[_0x357401](_0x1c05('0x2c'));if(queryQueues[_0x1c05('0x2d')](_0x1c05('0x2e'))){delete queryQueues[_0x1c05('0x2e')];}_0x438f4d[_0x1c05('0x2f')](db['VoiceQueue'][_0x1c05('0x12')](queryQueues));_0x438f4d['push'](db['ChatQueue'][_0x1c05('0x12')](queryQueues));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x30')][_0x1c05('0x12')](queryQueues));_0x438f4d['push'](db[_0x1c05('0x31')]['findAll'](queryQueues));_0x438f4d[_0x1c05('0x2f')](db['MailQueue'][_0x1c05('0x12')](queryQueues));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x32')][_0x1c05('0x12')](queryQueues));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x33')][_0x1c05('0x12')](queryQueues));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x5')][_0x1c05('0x12')](queryTelephones));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x34')][_0x1c05('0x12')](queryTrunks));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x19')][_0x1c05('0x12')](queryCampaigns));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x5')]['findAll'](queryAgents));break;case _0x1c05('0x35'):_0x34bbfb[_0x357401](_0x1c05('0x2b'));_0x34bbfb[_0x357401]('voice:outbound');_0x438f4d['push'](getAssociatedResources(_0x1c05('0xd'),_0x1d548e[_0x1c05('0x20')],_0x1c05('0x36')));_0x438f4d['push'](getAssociatedResources(_0x1c05('0x37'),_0x1d548e[_0x1c05('0x20')],_0x1c05('0x38')));_0x438f4d['push'](getAssociatedResources(_0x1c05('0xe'),_0x1d548e[_0x1c05('0x20')],_0x1c05('0x30')));_0x438f4d['push'](getAssociatedResources('SmsQueues',_0x1d548e['userProfileId'],'SmsQueue'));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources('MailQueues',_0x1d548e['userProfileId'],_0x1c05('0x39')));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources(_0x1c05('0x10'),_0x1d548e['userProfileId'],_0x1c05('0x32')));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources(_0x1c05('0x11'),_0x1d548e[_0x1c05('0x20')],_0x1c05('0x33')));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources(_0x1c05('0x13'),_0x1d548e[_0x1c05('0x20')],'User'));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources(_0x1c05('0x14'),_0x1d548e['userProfileId'],_0x1c05('0x34')));_0x438f4d[_0x1c05('0x2f')](getAssociatedResources('IvrCampaigns',_0x1d548e[_0x1c05('0x20')],_0x1c05('0x19')));_0x438f4d[_0x1c05('0x2f')](db[_0x1c05('0x5')]['findAll'](queryAgents));break;case _0x1c05('0x7'):_0x34bbfb[_0x357401]('voice:inbound');_0x34bbfb[_0x357401]('voice:outbound');_0x438f4d[_0x1c05('0x2f')](_0x1d548e[_0x1c05('0x3a')]({'attributes':['id',_0x1c05('0x3')]}));_0x438f4d['push'](_0x1d548e[_0x1c05('0x3b')]({'attributes':['id','name']}));_0x438f4d[_0x1c05('0x2f')](_0x1d548e['getFaxQueues']({'attributes':['id',_0x1c05('0x3')]}));_0x438f4d[_0x1c05('0x2f')](_0x1d548e['getSmsQueues']({'attributes':['id',_0x1c05('0x3')]}));_0x438f4d[_0x1c05('0x2f')](_0x1d548e[_0x1c05('0x3c')]({'attributes':['id',_0x1c05('0x3')]}));_0x438f4d[_0x1c05('0x2f')](_0x1d548e[_0x1c05('0x3d')]({'attributes':['id',_0x1c05('0x3')]}));_0x438f4d[_0x1c05('0x2f')](_0x1d548e[_0x1c05('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x1c05('0x3f')](_0x438f4d);}})[_0x1c05('0xb')](function(_0x1a23a1){if(_0x1a23a1&&_0x1a23a1['length']){for(var _0x2ee2b2=0x0;_0x2ee2b2<_0x1a23a1[_0x1c05('0x40')];_0x2ee2b2+=0x1){for(var _0x17f537=0x0;_0x17f537<_0x1a23a1[_0x2ee2b2][_0x1c05('0x40')];_0x17f537+=0x1){switch(_0x2ee2b2){case 0x0:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x41'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x1:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x42'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x2:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x43'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x3:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x44'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x4:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x45'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x5:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x46'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x6:joinOrLeaveQueues(_0x34bbfb,_0x357401,_0x1c05('0x47'),_0x1a23a1[_0x2ee2b2][_0x17f537]);break;case 0x7:if(_0x2cf340['role']!==_0x1c05('0x7'))_0x34bbfb[_0x357401](util['format'](_0x1c05('0x48'),_0x1a23a1[_0x2ee2b2][_0x17f537][_0x1c05('0x3')]));break;case 0x8:if(_0x2cf340[_0x1c05('0x6')]!=='agent')_0x34bbfb[_0x357401](util[_0x1c05('0x1b')]('trunk:%s',_0x1a23a1[_0x2ee2b2][_0x17f537][_0x1c05('0x3')]));break;case 0x9:if(_0x2cf340[_0x1c05('0x6')]!==_0x1c05('0x7'))_0x34bbfb[_0x357401](util[_0x1c05('0x1b')](_0x1c05('0x49'),_0x1a23a1[_0x2ee2b2][_0x17f537][_0x1c05('0x9')],_0x1a23a1[_0x2ee2b2][_0x17f537][_0x1c05('0x3')]));break;case 0xa:_0x34bbfb[_0x357401](util[_0x1c05('0x1b')](_0x1c05('0x1d'),_0x1a23a1[_0x2ee2b2][_0x17f537]['name']));break;}}}}})[_0x1c05('0xb')](function(){if(_0x357401===_0x1c05('0x4a')){var _0x6621a2=_[_0x1c05('0x4b')](_0x2cf340[_0x1c05('0x22')],'id');return _0x2cf340[_0x1c05('0x4c')](_0x6621a2)[_0x1c05('0xb')](function(){for(var _0x463cee=0x0;_0x463cee<_0x6621a2[_0x1c05('0x40')];_0x463cee+=0x1){_0x1d268e[_0x1c05('0x4d')](_0x1c05('0x4e'),{'ChatInteractionId':Number(_0x6621a2[_0x463cee]),'UserId':Number(_0x2cf340['id'])});}});}})[_0x1c05('0xb')](function(){if(_0x357401===_0x1c05('0x4a')){var _0x16011e=_[_0x1c05('0x4b')](_0x2cf340[_0x1c05('0x24')],'id');return _0x2cf340[_0x1c05('0x4f')](_0x16011e)['then'](function(){for(var _0x3197d6=0x0;_0x3197d6<_0x16011e['length'];_0x3197d6+=0x1){_0x1d268e[_0x1c05('0x4d')](_0x1c05('0x50'),{'MailInteractionId':Number(_0x16011e[_0x3197d6]),'UserId':Number(_0x2cf340['id'])});}});}})['then'](function(){if(_0x357401===_0x1c05('0x4a')){var _0x45de8a=_[_0x1c05('0x4b')](_0x2cf340[_0x1c05('0x26')],'id');return _0x2cf340[_0x1c05('0x51')](_0x45de8a)['then'](function(){for(var _0x45b9ff=0x0;_0x45b9ff<_0x45de8a['length'];_0x45b9ff+=0x1){_0x1d268e[_0x1c05('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x45de8a[_0x45b9ff]),'UserId':Number(_0x2cf340['id'])});}});}})[_0x1c05('0xb')](function(){if(_0x357401==='leave'){var _0x1e912=_[_0x1c05('0x4b')](_0x2cf340['SmsInteractions'],'id');return _0x2cf340[_0x1c05('0x52')](_0x1e912)[_0x1c05('0xb')](function(){for(var _0x48ccf7=0x0;_0x48ccf7<_0x1e912['length'];_0x48ccf7+=0x1){_0x1d268e[_0x1c05('0x4d')](_0x1c05('0x53'),{'SmsInteractionId':Number(_0x1e912[_0x48ccf7]),'UserId':Number(_0x2cf340['id'])});}});}})[_0x1c05('0xb')](function(){if(_0x357401==='leave'){var _0x2854b6=_['map'](_0x2cf340[_0x1c05('0x29')],'id');return _0x2cf340[_0x1c05('0x54')](_0x2854b6)[_0x1c05('0xb')](function(){for(var _0x543fc5=0x0;_0x543fc5<_0x2854b6[_0x1c05('0x40')];_0x543fc5+=0x1){_0x1d268e[_0x1c05('0x4d')](_0x1c05('0x55'),{'OpenchannelInteractionId':Number(_0x2854b6[_0x543fc5]),'UserId':Number(_0x2cf340['id'])});}});}})['then'](function(){if(_0x357401===_0x1c05('0x4a')){var _0x531f25=_[_0x1c05('0x4b')](_0x2cf340[_0x1c05('0x56')],'id');return _0x2cf340['removeWhatsappInteractions'](_0x531f25)['then'](function(){for(var _0x26bdcc=0x0;_0x26bdcc<_0x531f25[_0x1c05('0x40')];_0x26bdcc+=0x1){_0x1d268e[_0x1c05('0x4d')](_0x1c05('0x57'),{'WhatsappInteractionId':Number(_0x531f25[_0x26bdcc]),'UserId':Number(_0x2cf340['id'])});}});}})[_0x1c05('0x58')](function(_0x523476){_0x34bbfb[_0x1c05('0x59')](_0x523476);});}}function onDisconnect(_0x1e39fa,_0x37af39){joinOrLeave(_0x1e39fa,'leave',_0x37af39);}function onConnect(_0x4b7499){joinOrLeave(_0x4b7499,_0x1c05('0x5a'));}exports[_0x1c05('0x5b')]=function(_0x5323f5){_0x5323f5['on'](_0x1c05('0x5c'),function(_0x5eccb2){_0x5eccb2[_0x1c05('0x5d')](0x0);_0x5eccb2[_0x1c05('0x5e')]=_0x5eccb2[_0x1c05('0x5f')][_0x1c05('0x5c')][_0x1c05('0x60')]+':'+_0x5eccb2[_0x1c05('0x5f')]['connection']['remotePort'];_0x5eccb2[_0x1c05('0x61')]=new Date();_0x5eccb2[_0x1c05('0x59')]=function(_0x5abb11){console[_0x1c05('0x59')]('SocketIO\x20'+_0x5eccb2['nsp'][_0x1c05('0x3')]+'['+_0x5eccb2['address']+']',_0x5abb11);};_0x5eccb2['on'](_0x1c05('0x62'),function(){onDisconnect(_0x5eccb2,_0x5323f5);_0x5eccb2[_0x1c05('0x59')]('DISCONNECTED');});onConnect(_0x5eccb2);_0x5eccb2[_0x1c05('0x59')](_0x1c05('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 90f724b..ad6e7d2 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 _0x7f12=['UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','offlineMessage','opened','AfterCreate','changed','closed','substatus','QueryTypes','AfterUpdate','User','find','email','internal','default','hasOwnProperty','model','hook','toLowerCase','condition','util','../logger','triggers','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','afterCreate','newmessage','Sms','SmsInteraction','closedinteraction','Whatsapp','WhatsappInteraction','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x7f12,0xfa));var _0x27f1=function(_0xf35925,_0x52d9a3){_0xf35925=_0xf35925-0x0;var _0x2a0546=_0x7f12[_0xf35925];return _0x2a0546;};'use strict';var util=require(_0x27f1('0x0'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x27f1('0x1'))(_0x27f1('0x2'));var client=jayson[_0x27f1('0x3')][_0x27f1('0x4')]({'port':0x232a});var triggers=[{'channel':_0x27f1('0x5'),'model':_0x27f1('0x6'),'event':'afterCreate','condition':_0x27f1('0x7'),'callback':afterCreate},{'channel':_0x27f1('0x5'),'model':'ChatInteraction','event':_0x27f1('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x27f1('0x5'),'model':'ChatMessage','event':_0x27f1('0x9'),'condition':_0x27f1('0xa'),'callback':afterCreateMessage},{'channel':_0x27f1('0x5'),'model':'ChatOfflineMessage','event':'afterCreate','condition':_0x27f1('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x27f1('0xb'),'model':_0x27f1('0xc'),'event':_0x27f1('0x9'),'condition':_0x27f1('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0x27f1('0xc'),'event':'afterUpdate','condition':_0x27f1('0xd'),'callback':afterUpdate},{'channel':_0x27f1('0xb'),'model':'SmsMessage','event':_0x27f1('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x27f1('0xe'),'model':_0x27f1('0xf'),'event':'afterCreate','condition':_0x27f1('0x7'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x27f1('0xf'),'event':_0x27f1('0x8'),'condition':_0x27f1('0xd'),'callback':afterUpdate},{'channel':_0x27f1('0xe'),'model':'WhatsappMessage','event':_0x27f1('0x9'),'condition':_0x27f1('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x27f1('0x10'),'event':_0x27f1('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x27f1('0x10'),'event':_0x27f1('0x8'),'condition':_0x27f1('0xd'),'callback':afterUpdate},{'channel':_0x27f1('0x11'),'model':_0x27f1('0x12'),'event':_0x27f1('0x9'),'condition':_0x27f1('0xa'),'callback':afterCreateMessage},{'channel':_0x27f1('0x13'),'model':_0x27f1('0x14'),'event':_0x27f1('0x9'),'condition':_0x27f1('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x27f1('0x14'),'event':_0x27f1('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x27f1('0x15'),'event':'afterCreate','condition':_0x27f1('0xa'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x27f1('0x16'),'event':_0x27f1('0x9'),'condition':_0x27f1('0x7'),'callback':afterCreate},{'channel':_0x27f1('0x17'),'model':_0x27f1('0x16'),'event':_0x27f1('0x8'),'condition':_0x27f1('0xd'),'callback':afterUpdate},{'channel':_0x27f1('0x17'),'model':_0x27f1('0x18'),'event':_0x27f1('0x9'),'condition':_0x27f1('0xa'),'callback':afterCreateMessage}];function request(_0x14b1ec){return client[_0x27f1('0x19')](_0x27f1('0x1a'),_0x14b1ec)[_0x27f1('0x1b')](function(_0x184e0d){logger[_0x27f1('0x1c')](_0x27f1('0x1d'),'EventManager',_0x184e0d);if(_0x184e0d[_0x27f1('0x1e')]){if(_0x184e0d[_0x27f1('0x1e')][_0x27f1('0x1f')]===0x1f4){logger[_0x27f1('0x1e')](_0x27f1('0x1d'),'EventManager',_0x184e0d[_0x27f1('0x1e')]);}}})['catch'](function(_0x29b0e4){logger[_0x27f1('0x1e')]('Trigger,\x20%s','EventManager',_0x29b0e4);});}function afterCreateMessage(_0x3ee06b){return function(_0x172952){_0x172952=_0x172952[_0x27f1('0x20')]({'plain':!![]});_0x172952[_0x27f1('0x21')]=_0x3ee06b;_0x172952[_0x27f1('0x22')]=_0x3ee06b;_0x172952[_0x27f1('0x23')]=_0x172952[_0x27f1('0x24')];Promise[_0x27f1('0x25')]()[_0x27f1('0x1b')](function(){if(typeof _0x172952[_0x27f1('0x26')]===_0x27f1('0x27'))return null;var _0x3a1ad2=_0x27f1('0x28')+_0x172952['ContactId'];return db[_0x27f1('0x29')][_0x27f1('0x2a')](_0x3a1ad2,{'type':db[_0x27f1('0x2b')]['QueryTypes'][_0x27f1('0x2c')],'raw':!![]});})[_0x27f1('0x1b')](function(_0x447b93){if(_0x447b93){_0x172952[_0x27f1('0x2d')]=_0x447b93[0x0];}if(typeof _0x172952[_0x27f1('0x2e')]==='undefined')return;return getAgent(_0x172952[_0x27f1('0x2e')]);})[_0x27f1('0x1b')](function(_0x32b34b){if(_0x32b34b){_0x172952[_0x27f1('0x2f')]=util[_0x27f1('0x30')](_0x27f1('0x31'),_0x32b34b[_0x27f1('0x32')]);_0x172952[_0x27f1('0x33')]=_0x32b34b;_0x172952[_0x27f1('0x21')]=_0x3ee06b;return request({'event':_0x27f1('0x34'),'message':_0x172952});}else{return request({'event':_0x27f1('0x35'),'message':_0x172952});}})[_0x27f1('0x36')](function(_0x27d719){logger[_0x27f1('0x1e')](_0x27f1('0x1d'),_0x27f1('0x37'),_0x27d719);});};}function afterCreateOfflineMessage(_0x52cc52){return function(_0x1d2566){_0x1d2566=_0x1d2566[_0x27f1('0x20')]({'plain':!![]});_0x1d2566[_0x27f1('0x21')]=_0x52cc52;_0x1d2566['motionChannel']=_0x52cc52;_0x1d2566[_0x27f1('0x23')]=_0x27f1('0x38');return request({'event':_0x1d2566['event'],'message':_0x1d2566});};}function afterCreate(_0x5a73da,_0xa7cd1d){return function(_0x5410d9){_0x5410d9=_0x5410d9[_0x27f1('0x20')]({'plain':!![]});_0x5410d9[_0x27f1('0x21')]=_0x5a73da;_0x5410d9[_0x27f1('0x22')]=_0x5a73da;_0x5410d9[_0x27f1('0x23')]=_0x27f1('0x39');Promise[_0x27f1('0x25')]()['then'](function(){var _0xa2383b=_0x27f1('0x28')+_0x5410d9['ContactId'];return db[_0x27f1('0x29')][_0x27f1('0x2a')](_0xa2383b,{'type':db[_0x27f1('0x2b')]['QueryTypes'][_0x27f1('0x2c')],'raw':!![]});})[_0x27f1('0x1b')](function(_0x5193de){if(_0x5193de){_0x5410d9[_0x27f1('0x2d')]=_0x5193de[0x0];}if(typeof _0x5410d9[_0x27f1('0x2e')]==='undefined')return;return getAgent(_0x5410d9[_0x27f1('0x2e')]);})[_0x27f1('0x1b')](function(_0x4094fb){if(_0x4094fb){_0x5410d9[_0x27f1('0x2f')]=util[_0x27f1('0x30')](_0x27f1('0x31'),_0x4094fb['name']);_0x5410d9[_0x27f1('0x33')]=_0x4094fb;}return request({'event':_0xa7cd1d,'message':_0x5410d9});})['catch'](function(_0x2cd2a8){logger[_0x27f1('0x1e')](_0x27f1('0x1d'),_0x27f1('0x3a'),_0x2cd2a8);});};}function afterUpdate(_0x2b9939){return function(_0x19fe6a){var _0x30c65b=_0x19fe6a[_0x27f1('0x3b')](_0x27f1('0x3c'))&&_0x19fe6a[_0x27f1('0x3c')];var _0x13e28d=_0x19fe6a['changed'](_0x27f1('0x3d'));if(_0x30c65b||_0x13e28d){var _0x2f5f91=_0x30c65b?'closedinteraction':_0x27f1('0x3d');var _0x244261=_0x19fe6a[_0x27f1('0x20')]({'plain':!![]});_0x244261[_0x27f1('0x21')]=_0x2b9939;_0x244261[_0x27f1('0x22')]=_0x2b9939;_0x244261[_0x27f1('0x23')]=_0x30c65b?_0x27f1('0x3c'):'substatus';var _0x542fe7=_0x27f1('0x28')+_0x244261[_0x27f1('0x26')];return db[_0x27f1('0x29')]['query'](_0x542fe7,{'type':db['Sequelize'][_0x27f1('0x3e')][_0x27f1('0x2c')],'raw':!![]})['then'](function(_0x41e194){if(_0x41e194){_0x244261[_0x27f1('0x2d')]=_0x41e194[0x0];}if(typeof _0x244261[_0x27f1('0x2e')]===_0x27f1('0x27'))return;return getAgent(_0x244261[_0x27f1('0x2e')]);})[_0x27f1('0x1b')](function(_0x1f5175){if(_0x1f5175){_0x244261[_0x27f1('0x2f')]=util[_0x27f1('0x30')](_0x27f1('0x31'),_0x1f5175['name']);_0x244261[_0x27f1('0x33')]=_0x1f5175;}return request({'event':_0x2f5f91,'message':_0x244261});})['catch'](function(_0x3df064){logger[_0x27f1('0x1e')](_0x27f1('0x1d'),_0x27f1('0x3f'),_0x3df064);});}};}function getAgent(_0x382c0f){return db[_0x27f1('0x40')][_0x27f1('0x41')]({'where':{'id':_0x382c0f},'attributes':['id',_0x27f1('0x32'),'fullname',_0x27f1('0x42'),_0x27f1('0x43')],'raw':!![]})['then'](function(_0x488f22){return _0x488f22;});}exports[_0x27f1('0x44')]=function(){for(var _0x12ceb7=0x0;_0x12ceb7=_0x8928b3['agents']){throw Error(_0x25af('0x12'));}_0x19651e(_0x51d950);})['catch'](function(_0x1cf526){_0x141791(_0x1cf526);});});}; \ No newline at end of file +var _0x50c8=['voice','mail','fax','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x50c8,0x1a5));var _0x850c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x50c8[_0x432682];return _0x463d05;};'use strict';var _=require(_0x850c('0x0'));var BPromise=require(_0x850c('0x1'));var db=require(_0x850c('0x2'))['db'];var util=require(_0x850c('0x3'));var channels=[_0x850c('0x4'),_0x850c('0x5'),'chat',_0x850c('0x6'),'sms',_0x850c('0x7'),_0x850c('0x8')];exports[_0x850c('0x9')]=function(){return channels;};exports[_0x850c('0xa')]=function(_0x14d26e){_0x14d26e=_0x14d26e['toLowerCase']();return _[_0x850c('0xb')](channels,_0x14d26e);};exports[_0x850c('0xc')]=function(_0x541cc9,_0x4711fc,_0x256f52,_0x5f2f3c){var _0x2a0c0b={'loginAttempts':_0x4711fc,'blocked':_0x256f52};if(!_[_0x850c('0xd')](_0x5f2f3c)){_0x2a0c0b[_0x850c('0xe')]=_0x5f2f3c;}return _0x541cc9[_0x850c('0xf')](_0x2a0c0b);};exports[_0x850c('0x10')]=function(_0x542b70){return new BPromise(function(_0x1bf3d3,_0xf68a84){var _0x28bc94=0x0;if(_0x542b70[_0x850c('0x11')]!=='agent'){_0x1bf3d3(_0x542b70);}db[_0x850c('0x12')][_0x850c('0x13')]({'where':{'role':_0x850c('0x14'),'online':!![],'id':{'$ne':_0x542b70['id']}}})[_0x850c('0x15')](function(_0x56f1e0){_0x28bc94=_0x56f1e0;return util[_0x850c('0x10')]();})['then'](function(_0x3a128a){if(_0x3a128a&&_0x3a128a[_0x850c('0x16')]&&_0x28bc94>=_0x3a128a[_0x850c('0x16')]){throw Error(_0x850c('0x17'));}_0x1bf3d3(_0x542b70);})[_0x850c('0x18')](function(_0x17967b){_0xf68a84(_0x17967b);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 341ef7e..4a075ae 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Bad\x20Request','Forbidden','OutOfInterval','error','stack'];(function(_0x3e3c7a,_0x381151){var _0x25436a=function(_0x44f95c){while(--_0x44f95c){_0x3e3c7a['push'](_0x3e3c7a['shift']());}};_0x25436a(++_0x381151);}(_0xb688,0xcf));var _0x8b68=function(_0x442cd2,_0x211340){_0x442cd2=_0x442cd2-0x0;var _0x265e60=_0xb688[_0x442cd2];return _0x265e60;};'use strict';var util=require('util');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var APIError=function(_0x266285,_0x1080e8){this[_0x8b68('0x2')]=_0x266285||_0x8b68('0x3');this['name']=_0x1080e8||_0x8b68('0x4');util[_0x8b68('0x5')](APIError,Error);};var APIBadRequestError=function(_0x30f33d){this[_0x8b68('0x2')]=_0x30f33d||'Bad\x20Request';this[_0x8b68('0x6')]='Bad\x20Request';util[_0x8b68('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2bbffd){this[_0x8b68('0x2')]=_0x2bbffd||_0x8b68('0x7');this[_0x8b68('0x6')]=_0x8b68('0x8');util[_0x8b68('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x21d944){switch(_0x21d944){case _0x8b68('0x9'):return 0x190;case _0x8b68('0xa'),_0x8b68('0xb'):return 0x193;case _0x8b68('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2a852a){return function(_0x502727){logger[_0x8b68('0xc')](_0x502727[_0x8b68('0xd')]);var _0x5e76c=getStatusCode(_0x502727[_0x8b68('0x6')]);if(_0x502727[_0x8b68('0x6')])delete _0x502727[_0x8b68('0x6')];return _0x2a852a[_0x8b68('0xe')](_0x5e76c)[_0x8b68('0xf')](_0x502727);};}module[_0x8b68('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xdace=['send','exports','util','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','status'];(function(_0x378eeb,_0xee1b06){var _0x117bde=function(_0x58134c){while(--_0x58134c){_0x378eeb['push'](_0x378eeb['shift']());}};_0x117bde(++_0xee1b06);}(_0xdace,0xc5));var _0xedac=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xdace[_0x12b683];return _0xfb150b;};'use strict';var util=require(_0xedac('0x0'));var logger=require('../config/logger')(_0xedac('0x1'));var APIError=function(_0x13adb5,_0x46eba0){this['message']=_0x13adb5||_0xedac('0x2');this[_0xedac('0x3')]=_0x46eba0||_0xedac('0x4');util[_0xedac('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5a97c0){this[_0xedac('0x6')]=_0x5a97c0||_0xedac('0x7');this[_0xedac('0x3')]='Bad\x20Request';util[_0xedac('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x21440e){this[_0xedac('0x6')]=_0x21440e||'Entity\x20not\x20found';this[_0xedac('0x3')]=_0xedac('0x8');util[_0xedac('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4af030){switch(_0x4af030){case'Bad\x20Request':return 0x190;case _0xedac('0x9'),_0xedac('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d6a29){return function(_0x4db2ad){logger[_0xedac('0xb')](_0x4db2ad['stack']);var _0x261401=getStatusCode(_0x4db2ad['name']);if(_0x4db2ad[_0xedac('0x3')])delete _0x4db2ad[_0xedac('0x3')];return _0x4d6a29[_0xedac('0xc')](_0x261401)[_0xedac('0xd')](_0x4db2ad);};}module[_0xedac('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5eebff9..f9da123 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf88a=['json','send','exports','404','status','render'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0xf88a,0x1e8));var _0xaf88=function(_0x208798,_0x1dfbd4){_0x208798=_0x208798-0x0;var _0x2e76c8=_0xf88a[_0x208798];return _0x2e76c8;};'use strict';module[_0xaf88('0x0')][0x194]=function pageNotFound(_0x51b661,_0x53ae3d){var _0x442321=_0xaf88('0x1');var _0x57d867=0x194;var _0x417bda={'status':_0x57d867};_0x53ae3d['status'](_0x417bda[_0xaf88('0x2')]);_0x53ae3d[_0xaf88('0x3')](_0x442321,{},function(_0x22bfdc,_0x319910){if(_0x22bfdc){return _0x53ae3d[_0xaf88('0x2')](_0x417bda[_0xaf88('0x2')])[_0xaf88('0x4')](_0x417bda);}_0x53ae3d[_0xaf88('0x5')](_0x319910);});}; \ No newline at end of file +var _0x8689=['render','json','exports','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8689,0x14a));var _0x9868=function(_0x4f65ba,_0x1acebe){_0x4f65ba=_0x4f65ba-0x0;var _0x3eb12f=_0x8689[_0x4f65ba];return _0x3eb12f;};'use strict';module[_0x9868('0x0')][0x194]=function pageNotFound(_0x2a0b21,_0xd717d7){var _0x9a6aad='404';var _0xb9b0ec=0x194;var _0x34a42a={'status':_0xb9b0ec};_0xd717d7[_0x9868('0x1')](_0x34a42a[_0x9868('0x1')]);_0xd717d7[_0x9868('0x2')](_0x9a6aad,{},function(_0x24f977,_0x456d45){if(_0x24f977){return _0xd717d7[_0x9868('0x1')](_0x34a42a[_0x9868('0x1')])[_0x9868('0x3')](_0x34a42a);}_0xd717d7['send'](_0x456d45);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1036d18..c10640a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f3f=['userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','Applications','Sounds','moh_has_sounds','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','VoiceMailMessage','mailbox','QueueCalls','uniqueid','CmContact','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Smtp','Dispositions','Answers','MailMessage','Messages','Interactions','List','ListId','TemplateId','Pause','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Interaction','ChatWebsiteId','ChatOfflineMessage','TagId','Items','FaxAccountId','Exntensions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelInteraction','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ChatProactiveAction','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','CmContactId','HopperHistories','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','VoiceMusicOnHold','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','AccountId','FieldId','Description','Field','Variable','DeskConfiguration','int_desk_configuration_has_tags','VariableId','ZohoAccount','ZohoField','Subject','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Field','FreshsalesAccount','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','user_has_square_projects','team_has_sms_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','UserSetting','Imap','exports','sequelize','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8','sequelizeHistory','utf8mb4','utf8_general_ci','username','options','database','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/user-setting/user-setting.model','cascade','UserId','hasOne','userSetting','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','UserProfile'];(function(_0x25a23b,_0xca2f0d){var _0x1f01f6=function(_0x5d6410){while(--_0x5d6410){_0x25a23b['push'](_0x25a23b['shift']());}};_0x1f01f6(++_0xca2f0d);}(_0x5f3f,0xd7));var _0xf5f3=function(_0xc4a608,_0x45fecd){_0xc4a608=_0xc4a608-0x0;var _0x5e2730=_0x5f3f[_0xc4a608];return _0x5e2730;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf5f3('0x0'));var _=require('lodash');var jstz=require(_0xf5f3('0x1'));var timezone=jstz['determine']();config[_0xf5f3('0x0')]=_[_0xf5f3('0x2')](config['sequelize'],{'database':_0xf5f3('0x3'),'username':_0xf5f3('0x4'),'password':_0xf5f3('0x5'),'options':{'host':_0xf5f3('0x6'),'port':0xcea,'dialect':_0xf5f3('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf5f3('0x8'),'collate':'utf8_general_ci'}}});config[_0xf5f3('0x9')]=_[_0xf5f3('0x2')](config[_0xf5f3('0x9')],{'database':_0xf5f3('0x3'),'username':_0xf5f3('0x4'),'password':_0xf5f3('0x5'),'options':{'host':_0xf5f3('0x6'),'port':0xcea,'dialect':_0xf5f3('0x7'),'dialectOptions':{'charset':_0xf5f3('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf5f3('0x8'),'collate':_0xf5f3('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf5f3('0x0')]['database'],config[_0xf5f3('0x0')][_0xf5f3('0xc')],config[_0xf5f3('0x0')]['password'],config[_0xf5f3('0x0')][_0xf5f3('0xd')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf5f3('0x9')][_0xf5f3('0xe')],config[_0xf5f3('0x9')][_0xf5f3('0xc')],config['sequelizeHistory']['password'],config['sequelizeHistory'][_0xf5f3('0xd')])};db[_0xf5f3('0xf')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x11'));db[_0xf5f3('0x12')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x13'));db[_0xf5f3('0x14')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x15'));db[_0xf5f3('0x16')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x17'));db['VoiceMusicOnHold']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x18'));db[_0xf5f3('0x19')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x1a'));db['VoiceRecording']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x1b'));db[_0xf5f3('0x1c')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x1d'));db[_0xf5f3('0x1e')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xf5f3('0x1f')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x20'));db[_0xf5f3('0x21')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x22'));db[_0xf5f3('0x23')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x24'));db[_0xf5f3('0x25')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x26'));db[_0xf5f3('0x27')]=db['sequelize']['import'](_0xf5f3('0x28'));db[_0xf5f3('0x29')]=db['sequelize']['import'](_0xf5f3('0x2a'));db[_0xf5f3('0x2b')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x2c'));db[_0xf5f3('0x2d')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x2e'));db[_0xf5f3('0x2f')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x30'));db[_0xf5f3('0x31')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x32'));db[_0xf5f3('0x33')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x34'));db[_0xf5f3('0x35')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x36'));db[_0xf5f3('0x37')]=db[_0xf5f3('0x0')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xf5f3('0x38')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xf5f3('0x39')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x3a'));db[_0xf5f3('0x3b')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x3c'));db[_0xf5f3('0x3d')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x3e'));db[_0xf5f3('0x3f')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x40'));db[_0xf5f3('0x41')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/mailQueue/mailQueue.model');db[_0xf5f3('0x42')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/mailSubstatus/mailSubstatus.model');db[_0xf5f3('0x43')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x44'));db['MailMessage']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x45'));db[_0xf5f3('0x46')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/mailApplication/mailApplication.model');db[_0xf5f3('0x47')]=db['sequelize'][_0xf5f3('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0xf5f3('0x48')]=db['sequelize']['import'](_0xf5f3('0x49'));db[_0xf5f3('0x4a')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/dashboardItem/dashboardItem.model');db[_0xf5f3('0x4b')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x4c'));db[_0xf5f3('0x4d')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x4e'));db[_0xf5f3('0x4f')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x50'));db[_0xf5f3('0x51')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x52'));db[_0xf5f3('0x53')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x54'));db[_0xf5f3('0x55')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/smsAccount/smsAccount.model');db[_0xf5f3('0x56')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x57'));db[_0xf5f3('0x58')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/smsInteraction/smsInteraction.model');db[_0xf5f3('0x59')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x5a'));db['SmsQueue']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x5b'));db[_0xf5f3('0x5c')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x5d'));db[_0xf5f3('0x5e')]=db[_0xf5f3('0x0')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x5f'));db[_0xf5f3('0x60')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x61'));db[_0xf5f3('0x62')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x63'));db[_0xf5f3('0x64')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x65'));db[_0xf5f3('0x66')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x67'));db[_0xf5f3('0x68')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x69'));db[_0xf5f3('0x6a')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x6b'));db[_0xf5f3('0x6c')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x6d'));db['ChatOfflineMessage']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x6e'));db[_0xf5f3('0x6f')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x70'));db[_0xf5f3('0x71')]=db['sequelize'][_0xf5f3('0x10')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x72'));db['CmCompany']=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0xf5f3('0x10')]('../api/cmContact/cmContact.model');db[_0xf5f3('0x73')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x74'));db[_0xf5f3('0x75')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x76'));db['CmHopperFinal']=db['sequelize']['import'](_0xf5f3('0x77'));db[_0xf5f3('0x78')]=db['sequelize']['import'](_0xf5f3('0x79'));db[_0xf5f3('0x7a')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x7b'));db[_0xf5f3('0x7c')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x7d'));db[_0xf5f3('0x7e')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x7f'));db[_0xf5f3('0x80')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x81'));db[_0xf5f3('0x82')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x83'));db[_0xf5f3('0x84')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x85'));db[_0xf5f3('0x86')]=db['sequelize']['import'](_0xf5f3('0x87'));db[_0xf5f3('0x88')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/interval/interval.model');db['Pause']=db['sequelize']['import'](_0xf5f3('0x89'));db['Cdr']=db['sequelize']['import'](_0xf5f3('0x8a'));db[_0xf5f3('0x8b')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x8c'));db[_0xf5f3('0x8d')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x8e'));db[_0xf5f3('0x8f')]=db['sequelize'][_0xf5f3('0x10')]('../api/sound/sound.model');db[_0xf5f3('0x90')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/tag/tag.model');db[_0xf5f3('0x91')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x92'));db[_0xf5f3('0x93')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x94'));db[_0xf5f3('0x95')]=db[_0xf5f3('0x0')]['import']('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xf5f3('0x96')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x97'));db[_0xf5f3('0x98')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x99'));db['Variable']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x9a'));db[_0xf5f3('0x9b')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x9c'));db[_0xf5f3('0x9d')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x9e'));db[_0xf5f3('0x9f')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xa0'));db[_0xf5f3('0xa1')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xa2'));db[_0xf5f3('0xa3')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xa4'));db[_0xf5f3('0xa5')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xa6'));db['AnalyticTreeReport']=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xa7'));db[_0xf5f3('0xa8')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xa9'));db[_0xf5f3('0xaa')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xab'));db[_0xf5f3('0xac')]=db['sequelize'][_0xf5f3('0x10')]('../api/intSalesforceField/intSalesforceField.model');db[_0xf5f3('0xad')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xf5f3('0xae')]=db['sequelize']['import'](_0xf5f3('0xaf'));db[_0xf5f3('0xb0')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xb1'));db[_0xf5f3('0xb2')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xb3'));db['DeskConfiguration']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xb4'));db[_0xf5f3('0xb5')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xb6'));db['ZohoAccount']=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/intZohoAccount/intZohoAccount.model');db[_0xf5f3('0xb7')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xb8'));db['ZohoField']=db['sequelize'][_0xf5f3('0x10')]('../api/intZohoField/intZohoField.model');db[_0xf5f3('0xb9')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xba'));db[_0xf5f3('0xbb')]=db[_0xf5f3('0x0')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf5f3('0xbc')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xbd'));db[_0xf5f3('0xbe')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xf5f3('0xbf')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xc0'));db[_0xf5f3('0xc1')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xc2'));db[_0xf5f3('0xc3')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xc4'));db[_0xf5f3('0xc5')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xc6'));db[_0xf5f3('0xc7')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xc8'));db[_0xf5f3('0xc9')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xca'));db[_0xf5f3('0xcb')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xcc'));db[_0xf5f3('0xcd')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xce'));db[_0xf5f3('0xcf')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xd0'));db[_0xf5f3('0xd1')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xd2'));db['Dynamics365Field']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xd3'));db['FreshsalesAccount']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xd4'));db[_0xf5f3('0xd5')]=db['sequelize']['import'](_0xf5f3('0xd6'));db[_0xf5f3('0xd7')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xd8'));db[_0xf5f3('0x9b')]=db['sequelize']['import'](_0xf5f3('0x9c'));db['Network']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xd9'));db[_0xf5f3('0xda')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db[_0xf5f3('0xdb')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xdc'));db[_0xf5f3('0xdd')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xde'));db['JscriptyQuestionReport']=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xdf'));db[_0xf5f3('0xe0')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xf5f3('0xe1')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0xe2'));db['SquareReport']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xe3'));db['SquareDetailsReport']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xe4'));db[_0xf5f3('0xe5')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xe6'));db['Setting']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xe7'));db[_0xf5f3('0xe8')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xe9'));db[_0xf5f3('0xea')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xeb'));db[_0xf5f3('0xec')]=db['sequelize'][_0xf5f3('0x10')]('../api/squareRecording/squareRecording.model');db[_0xf5f3('0xed')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xee'));db[_0xf5f3('0xef')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/team/team.model');db[_0xf5f3('0xf0')]=db['sequelize'][_0xf5f3('0x10')]('../api/license/license.model');db[_0xf5f3('0xf1')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xf2'));db[_0xf5f3('0xf3')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xf4'));db[_0xf5f3('0xf5')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xf6'));db[_0xf5f3('0xf7')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xf8'));db[_0xf5f3('0xf9')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xfa'));db[_0xf5f3('0xfb')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/chatTransferReport/chatTransferReport.model');db[_0xf5f3('0xfc')]=db[_0xf5f3('0x0')]['import'](_0xf5f3('0xfd'));db[_0xf5f3('0xfe')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0xff'));db[_0xf5f3('0x100')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x101'));db[_0xf5f3('0x102')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x103'));db['VoicePrefix']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x104'));db['UserProfile']=db[_0xf5f3('0x0')]['import'](_0xf5f3('0x105'));db[_0xf5f3('0x106')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x107'));db[_0xf5f3('0x108')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x109'));db[_0xf5f3('0x10a')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x10b'));db[_0xf5f3('0x10c')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x10d'));db[_0xf5f3('0x10e')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x10f'));db[_0xf5f3('0x110')]=db['sequelize']['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xf5f3('0x111')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x112'));db[_0xf5f3('0x113')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x114'));db[_0xf5f3('0x115')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x116'));db['CloudProvider']=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/cloudProvider/cloudProvider.model');db[_0xf5f3('0x117')]=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x118'));db[_0xf5f3('0x119')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')](_0xf5f3('0x11a'));db[_0xf5f3('0x11b')]=db[_0xf5f3('0x0')][_0xf5f3('0x10')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db['sequelize'][_0xf5f3('0x10')](_0xf5f3('0x11c'));db[_0xf5f3('0xf')]['hasOne'](db[_0xf5f3('0x1e')],{'as':'VoiceMail','onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x11f')](db['UserSetting'],{'as':_0xf5f3('0x120'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db[_0xf5f3('0x122')],{'as':_0xf5f3('0x123'),'foreignKey':'UserId'});db['User'][_0xf5f3('0x121')](db[_0xf5f3('0x2d')],{'as':_0xf5f3('0x124'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'as':'Extensions','onDelete':_0xf5f3('0x11d'),'hooks':!![]});db[_0xf5f3('0xf')]['hasMany'](db[_0xf5f3('0x125')],{'as':_0xf5f3('0x126'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db[_0xf5f3('0x78')],{'as':_0xf5f3('0x127'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db[_0xf5f3('0x7a')],{'as':_0xf5f3('0x7a'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db['OpenchannelInteraction'],{'as':_0xf5f3('0x128'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db['ChatInteraction'],{'as':_0xf5f3('0x129'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')]['hasMany'](db[_0xf5f3('0x58')],{'as':_0xf5f3('0x12a'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db[_0xf5f3('0x4d')],{'as':_0xf5f3('0x12b'),'foreignKey':'UserId'});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db['MailInteraction'],{'as':_0xf5f3('0x12c'),'foreignKey':'UserId'});db[_0xf5f3('0xf')]['hasMany'](db[_0xf5f3('0x110')],{'as':_0xf5f3('0x12d'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0xf')][_0xf5f3('0x121')](db['UserNotification'],{'as':_0xf5f3('0x12e'),'foreignKey':_0xf5f3('0x12f')});db[_0xf5f3('0xf')]['belongsTo'](db[_0xf5f3('0x130')],{'as':_0xf5f3('0x130'),'foreignKey':_0xf5f3('0x131')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x71')],{'as':'Groups','through':_0xf5f3('0x133')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db['CmContact'],{'as':_0xf5f3('0x134'),'through':_0xf5f3('0x135')});db['User']['belongsToMany'](db['CmList'],{'as':_0xf5f3('0x136'),'through':_0xf5f3('0x137')});db['User'][_0xf5f3('0x132')](db['Team'],{'through':_0xf5f3('0x138')});db[_0xf5f3('0xf')]['belongsToMany'](db[_0xf5f3('0x43')],{'as':_0xf5f3('0x12c'),'through':_0xf5f3('0x139')});db[_0xf5f3('0xf')]['belongsToMany'](db[_0xf5f3('0x6a')],{'as':_0xf5f3('0x129'),'through':'user_has_chat_interactions'});db['User'][_0xf5f3('0x132')](db[_0xf5f3('0x4d')],{'as':'FaxInteractions','through':_0xf5f3('0x13a')});db[_0xf5f3('0xf')]['belongsToMany'](db[_0xf5f3('0x58')],{'as':_0xf5f3('0x12a'),'through':_0xf5f3('0x13b')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db['OpenchannelInteraction'],{'as':_0xf5f3('0x128'),'through':'user_has_openchannel_interactions'});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x110')],{'as':_0xf5f3('0x12d'),'through':'user_has_whatsapp_interactions'});db['User'][_0xf5f3('0x132')](db['VoiceQueue'],{'as':_0xf5f3('0x13c'),'through':_0xf5f3('0x2f'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x13d')],{'as':_0xf5f3('0x13e'),'through':_0xf5f3('0x11b'),'required':![]});db['User'][_0xf5f3('0x132')](db['MailQueue'],{'as':_0xf5f3('0x13f'),'through':_0xf5f3('0x33'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x6f')],{'as':_0xf5f3('0x140'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x51')],{'as':_0xf5f3('0x141'),'through':_0xf5f3('0x35'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x142')],{'as':_0xf5f3('0x143'),'through':_0xf5f3('0x37'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x62')],{'as':_0xf5f3('0x144'),'through':_0xf5f3('0x38'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x115')],{'as':_0xf5f3('0x145'),'through':_0xf5f3('0x39'),'required':![]});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x102')],{'through':_0xf5f3('0x137')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xf5f3('0x146')});db['User']['belongsToMany'](db['FaxAccount'],{'as':_0xf5f3('0x147'),'through':_0xf5f3('0x148')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x3f')],{'as':_0xf5f3('0x149'),'through':'user_has_mail_accounts'});db['User'][_0xf5f3('0x132')](db[_0xf5f3('0x5c')],{'as':_0xf5f3('0x14a'),'through':_0xf5f3('0x14b')});db['User'][_0xf5f3('0x132')](db[_0xf5f3('0x55')],{'as':_0xf5f3('0x14c'),'through':_0xf5f3('0x14d')});db[_0xf5f3('0xf')][_0xf5f3('0x132')](db[_0xf5f3('0x10c')],{'as':'WhatsappAccounts','through':_0xf5f3('0x14e')});db[_0xf5f3('0xf')]['belongsToMany'](db[_0xf5f3('0xea')],{'as':_0xf5f3('0x14f'),'through':'user_has_square_projects'});db[_0xf5f3('0x12')][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'as':_0xf5f3('0x150'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'ChanSpyId'});db[_0xf5f3('0x14')][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x16')][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'as':_0xf5f3('0x151'),'onDelete':_0xf5f3('0x11d')});db['VoiceMusicOnHold']['belongsToMany'](db[_0xf5f3('0x8f')],{'as':_0xf5f3('0x152'),'through':_0xf5f3('0x153')});db[_0xf5f3('0x19')][_0xf5f3('0x121')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xf5f3('0x19')][_0xf5f3('0x121')](db[_0xf5f3('0x73')],{'as':_0xf5f3('0x154'),'foreignKey':_0xf5f3('0x155')});db[_0xf5f3('0x19')][_0xf5f3('0x121')](db[_0xf5f3('0x125')],{'as':'HopperFinals','foreignKey':_0xf5f3('0x155')});db['VoiceQueue'][_0xf5f3('0x121')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xf5f3('0x155')});db['VoiceQueue'][_0xf5f3('0x121')](db[_0xf5f3('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0xf5f3('0x155')});db[_0xf5f3('0x19')][_0xf5f3('0x121')](db[_0xf5f3('0x75')],{'as':_0xf5f3('0x156'),'foreignKey':'VoiceQueueId'});db[_0xf5f3('0x19')][_0xf5f3('0x121')](db['JscriptySessionReport'],{'as':_0xf5f3('0x157'),'foreignKey':_0xf5f3('0x155')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0xf5f3('0x29'),'foreignKey':_0xf5f3('0x158')});db[_0xf5f3('0x19')][_0xf5f3('0x159')](db[_0xf5f3('0x29')],{'as':_0xf5f3('0x15a'),'foreignKey':_0xf5f3('0x15b')});db['VoiceQueue'][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'as':'Interval','foreignKey':_0xf5f3('0x15c')});db[_0xf5f3('0x19')]['belongsTo'](db['Pause'],{'as':_0xf5f3('0x15d'),'foreignKey':_0xf5f3('0x15e')});db[_0xf5f3('0x19')][_0xf5f3('0x132')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x136'),'through':_0xf5f3('0x15f')});db['VoiceQueue'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x2f')});db[_0xf5f3('0x19')][_0xf5f3('0x132')](db['Team'],{'as':_0xf5f3('0x161'),'through':'TeamVoiceQueue'});db[_0xf5f3('0x19')][_0xf5f3('0x132')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x162'),'through':_0xf5f3('0x163')});db[_0xf5f3('0x122')][_0xf5f3('0x159')](db['User'],{'as':_0xf5f3('0xf'),'foreignKey':'UserId'});db[_0xf5f3('0x1c')][_0xf5f3('0x159')](db['User'],{'as':_0xf5f3('0xf'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x1e')][_0xf5f3('0x121')](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf5f3('0x164'),'sourceKey':'mailbox'});db[_0xf5f3('0x165')]['belongsTo'](db[_0xf5f3('0x1e')],{'foreignKey':_0xf5f3('0x164'),'targetKey':_0xf5f3('0x166')});db['VoiceCallReport']['hasMany'](db[_0xf5f3('0x25')],{'as':_0xf5f3('0x167'),'foreignKey':_0xf5f3('0x168'),'constraints':![]});db['VoiceCallReport'][_0xf5f3('0x121')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xf5f3('0x1f')]['belongsTo'](db[_0xf5f3('0xf')],{'as':_0xf5f3('0xf'),'foreignKey':_0xf5f3('0x11e')});db['VoiceCallReport']['belongsTo'](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x3b')][_0xf5f3('0x159')](db[_0xf5f3('0x3f')],{'as':_0xf5f3('0x3f'),'foreignKey':_0xf5f3('0x16c')});db[_0xf5f3('0x3b')]['belongsTo'](db[_0xf5f3('0x16d')],{'as':_0xf5f3('0x16d'),'foreignKey':_0xf5f3('0x16e'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x3d')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf5f3('0x16c')});db[_0xf5f3('0x3d')]['belongsTo'](db[_0xf5f3('0x16d')],{'as':'CloudProvider','foreignKey':_0xf5f3('0x16e'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x3f')][_0xf5f3('0x11f')](db[_0xf5f3('0x3b')],{'as':'Imap','onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x3f')][_0xf5f3('0x11f')](db['MailServerOut'],{'as':_0xf5f3('0x170'),'onDelete':'cascade'});db[_0xf5f3('0x3f')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':_0xf5f3('0x16c'),'onDelete':'cascade'});db['MailAccount'][_0xf5f3('0x121')](db['CannedAnswer'],{'as':_0xf5f3('0x172'),'foreignKey':_0xf5f3('0x16c')});db[_0xf5f3('0x3f')]['hasMany'](db[_0xf5f3('0x173')],{'as':_0xf5f3('0x174'),'foreignKey':_0xf5f3('0x16c')});db['MailAccount'][_0xf5f3('0x121')](db['MailInteraction'],{'as':_0xf5f3('0x175')});db[_0xf5f3('0x3f')]['hasMany'](db[_0xf5f3('0x46')],{'as':_0xf5f3('0x151')});db[_0xf5f3('0x3f')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x3f')]['belongsTo'](db[_0xf5f3('0x96')],{'as':_0xf5f3('0x96'),'foreignKey':_0xf5f3('0x178')});db[_0xf5f3('0x3f')][_0xf5f3('0x159')](db[_0xf5f3('0x179')],{'as':_0xf5f3('0x15d'),'foreignKey':_0xf5f3('0x15e')});db[_0xf5f3('0x3f')]['belongsToMany'](db['User'],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x17a')});db[_0xf5f3('0x41')]['belongsToMany'](db['User'],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x33')});db[_0xf5f3('0x41')][_0xf5f3('0x132')](db['Team'],{'through':_0xf5f3('0x17b'),'as':_0xf5f3('0x161')});db[_0xf5f3('0x43')]['hasMany'](db[_0xf5f3('0x173')],{'as':_0xf5f3('0x174'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x17c')});db[_0xf5f3('0x43')][_0xf5f3('0x159')](db[_0xf5f3('0x3f')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x16c')});db[_0xf5f3('0x43')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':'Contact','foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x43')][_0xf5f3('0x159')](db['User'],{'as':_0xf5f3('0x17e'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x43')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x17f'),'as':_0xf5f3('0x180')});db[_0xf5f3('0x43')][_0xf5f3('0x132')](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db['MailInteraction'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x181'),'through':_0xf5f3('0x139'),'foreignKey':'MailInteractionId'});db[_0xf5f3('0x173')][_0xf5f3('0x121')](db[_0xf5f3('0xf5')],{'as':'Attachments','onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x173')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0xf')});db[_0xf5f3('0x173')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0x16a')});db[_0xf5f3('0x173')][_0xf5f3('0x159')](db[_0xf5f3('0x43')],{'as':_0xf5f3('0x182'),'foreignKey':_0xf5f3('0x17c')});db[_0xf5f3('0x173')]['belongsTo'](db[_0xf5f3('0x3f')],{'as':_0xf5f3('0x17d'),'foreignKey':'MailAccountId'});db[_0xf5f3('0x173')]['belongsTo'](db[_0xf5f3('0x64')],{'as':_0xf5f3('0x64'),'foreignKey':_0xf5f3('0x183')});db[_0xf5f3('0x173')][_0xf5f3('0x159')](db[_0xf5f3('0x184')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xf5f3('0x46')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'onDelete':'restrict'});db[_0xf5f3('0x46')]['belongsTo'](db[_0xf5f3('0x41')],{'onDelete':'restrict'});db[_0xf5f3('0x46')][_0xf5f3('0x159')](db[_0xf5f3('0x3f')],{'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x46')][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xf5f3('0x46')][_0xf5f3('0x159')](db[_0xf5f3('0x90')],{'onDelete':'restrict','foreignKey':_0xf5f3('0x185')});db[_0xf5f3('0x47')][_0xf5f3('0x159')](db['MailAccount'],{});db['MailQueueReport'][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':'ListId'});db[_0xf5f3('0x47')][_0xf5f3('0x159')](db['CmContact'],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x47')]['belongsTo'](db[_0xf5f3('0x43')],{});db[_0xf5f3('0x47')]['belongsTo'](db[_0xf5f3('0x173')],{});db[_0xf5f3('0x47')][_0xf5f3('0x159')](db['User'],{});db[_0xf5f3('0x47')][_0xf5f3('0x159')](db['MailQueue'],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0xf5f3('0x186'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x4b')]['hasMany'](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':_0xf5f3('0x187'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x4b')][_0xf5f3('0x121')](db['CannedAnswer'],{'as':_0xf5f3('0x172'),'foreignKey':'FaxAccountId'});db[_0xf5f3('0x4b')][_0xf5f3('0x121')](db[_0xf5f3('0x4d')],{'as':_0xf5f3('0x175')});db['FaxAccount'][_0xf5f3('0x121')](db['FaxApplication'],{'as':_0xf5f3('0x151')});db[_0xf5f3('0x4b')]['hasMany'](db['VoiceExtension'],{'as':_0xf5f3('0x188'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x4b')][_0xf5f3('0x121')](db['FaxMessage'],{'as':_0xf5f3('0x174')});db[_0xf5f3('0x4b')][_0xf5f3('0x159')](db['Trunk'],{'as':_0xf5f3('0x29')});db[_0xf5f3('0x4b')][_0xf5f3('0x159')](db['CmList'],{'as':_0xf5f3('0x176'),'foreignKey':'ListId'});db[_0xf5f3('0x4b')]['belongsTo'](db[_0xf5f3('0x179')],{'as':_0xf5f3('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':'Agents','through':_0xf5f3('0x148')});db[_0xf5f3('0x189')][_0xf5f3('0x159')](db['User'],{'onDelete':_0xf5f3('0x16f')});db['FaxApplication']['belongsTo'](db[_0xf5f3('0x51')],{'onDelete':'restrict'});db[_0xf5f3('0x189')][_0xf5f3('0x159')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xf5f3('0x189')][_0xf5f3('0x159')](db[_0xf5f3('0x90')],{'onDelete':_0xf5f3('0x16f'),'foreignKey':'TagId'});db['FaxInteraction'][_0xf5f3('0x121')](db[_0xf5f3('0x4f')],{'as':_0xf5f3('0x174'),'onDelete':'cascade','foreignKey':_0xf5f3('0x18a')});db[_0xf5f3('0x4d')]['belongsTo'](db['FaxAccount'],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x187')});db[_0xf5f3('0x4d')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':'ContactId'});db['FaxInteraction'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x17e'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x4d')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x18b'),'as':_0xf5f3('0x180')});db[_0xf5f3('0x4d')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x18b'),'as':_0xf5f3('0x18c')});db[_0xf5f3('0x4d')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x181'),'through':'user_has_fax_interactions','foreignKey':_0xf5f3('0x18a')});db[_0xf5f3('0x4f')]['belongsTo'](db[_0xf5f3('0xf')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0xf')});db[_0xf5f3('0x4f')][_0xf5f3('0x159')](db[_0xf5f3('0x4d')],{'as':_0xf5f3('0x182'),'foreignKey':_0xf5f3('0x18a')});db[_0xf5f3('0x4f')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0xf5f3('0x159')](db[_0xf5f3('0xf5')],{'as':_0xf5f3('0xf5'),'foreignKey':_0xf5f3('0x18d')});db['FaxMessage']['belongsTo'](db[_0xf5f3('0x4b')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x187')});db[_0xf5f3('0x51')]['belongsToMany'](db['User'],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x35')});db[_0xf5f3('0x51')][_0xf5f3('0x132')](db[_0xf5f3('0xef')],{'through':_0xf5f3('0x18e'),'as':_0xf5f3('0x161')});db[_0xf5f3('0x53')]['belongsTo'](db[_0xf5f3('0x4b')],{});db[_0xf5f3('0x53')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':'ListId'});db[_0xf5f3('0x53')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x53')]['belongsTo'](db[_0xf5f3('0x4d')],{});db[_0xf5f3('0x53')][_0xf5f3('0x159')](db[_0xf5f3('0x4f')],{});db['FaxQueueReport'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{});db[_0xf5f3('0x53')][_0xf5f3('0x159')](db[_0xf5f3('0x51')],{});db[_0xf5f3('0x55')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':'Dispositions','foreignKey':_0xf5f3('0x18f'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x55')][_0xf5f3('0x121')](db[_0xf5f3('0x82')],{'as':_0xf5f3('0x172'),'foreignKey':_0xf5f3('0x18f')});db[_0xf5f3('0x55')]['hasMany'](db[_0xf5f3('0x59')],{'as':'Messages','foreignKey':_0xf5f3('0x18f')});db[_0xf5f3('0x55')]['hasMany'](db[_0xf5f3('0x58')],{'as':'Interactions'});db[_0xf5f3('0x55')][_0xf5f3('0x121')](db[_0xf5f3('0x56')],{'as':'Applications'});db[_0xf5f3('0x55')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x55')][_0xf5f3('0x159')](db['Pause'],{'as':_0xf5f3('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf5f3('0x55')]['belongsToMany'](db['User'],{'as':_0xf5f3('0x160'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x56')][_0xf5f3('0x159')](db[_0xf5f3('0x142')],{'onDelete':'restrict'});db[_0xf5f3('0x56')][_0xf5f3('0x159')](db['SmsAccount'],{'onDelete':_0xf5f3('0x16f')});db['SmsApplication'][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'onDelete':_0xf5f3('0x16f'),'foreignKey':_0xf5f3('0x15c')});db[_0xf5f3('0x56')][_0xf5f3('0x159')](db[_0xf5f3('0x90')],{'onDelete':'restrict','foreignKey':_0xf5f3('0x185')});db['SmsInteraction'][_0xf5f3('0x121')](db['SmsMessage'],{'as':_0xf5f3('0x174'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x190')});db[_0xf5f3('0x58')][_0xf5f3('0x159')](db['SmsAccount'],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x18f')});db[_0xf5f3('0x58')]['belongsTo'](db[_0xf5f3('0x169')],{'as':'Contact','foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x58')]['belongsTo'](db['User'],{'as':_0xf5f3('0x17e'),'foreignKey':'UserId'});db[_0xf5f3('0x58')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':'sms_interaction_has_tags','as':_0xf5f3('0x180')});db[_0xf5f3('0x58')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x191'),'as':'ThroughTags'});db['SmsInteraction'][_0xf5f3('0x132')](db['User'],{'as':_0xf5f3('0x181'),'through':_0xf5f3('0x13b'),'foreignKey':_0xf5f3('0x190')});db[_0xf5f3('0x59')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':'User'});db[_0xf5f3('0x59')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0x16a')});db['SmsMessage'][_0xf5f3('0x159')](db[_0xf5f3('0x58')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0x182'),'foreignKey':_0xf5f3('0x190')});db[_0xf5f3('0x59')]['belongsTo'](db[_0xf5f3('0x55')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsQueue'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x37'),'foreignKey':'SmsQueueId'});db[_0xf5f3('0x142')][_0xf5f3('0x132')](db['Team'],{'through':'team_has_sms_queues','as':_0xf5f3('0x161')});db[_0xf5f3('0x5c')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':_0xf5f3('0x192'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x5c')][_0xf5f3('0x121')](db['CannedAnswer'],{'as':_0xf5f3('0x172'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xf5f3('0x193')],{'as':_0xf5f3('0x175'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xf5f3('0x121')](db[_0xf5f3('0x60')],{'as':_0xf5f3('0x174'),'foreignKey':_0xf5f3('0x192')});db[_0xf5f3('0x5c')]['hasMany'](db[_0xf5f3('0x5e')],{'as':'Applications','foreignKey':_0xf5f3('0x192')});db['OpenchannelAccount'][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':'List','foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x5c')][_0xf5f3('0x159')](db['Pause'],{'as':_0xf5f3('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf5f3('0x5c')]['belongsToMany'](db['User'],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x14b')});db[_0xf5f3('0x5e')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'onDelete':'restrict'});db[_0xf5f3('0x5e')][_0xf5f3('0x159')](db[_0xf5f3('0x62')],{'onDelete':_0xf5f3('0x16f'),'foreignKey':_0xf5f3('0x194')});db[_0xf5f3('0x5e')][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{'onDelete':'restrict','foreignKey':_0xf5f3('0x192')});db['OpenchannelApplication'][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'onDelete':'restrict','foreignKey':_0xf5f3('0x15c')});db[_0xf5f3('0x5e')][_0xf5f3('0x159')](db[_0xf5f3('0x90')],{'onDelete':'restrict','foreignKey':'TagId'});db['OpenchannelInteraction'][_0xf5f3('0x121')](db[_0xf5f3('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf5f3('0x195')});db['OpenchannelInteraction'][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{'as':'Account','foreignKey':_0xf5f3('0x192')});db[_0xf5f3('0x193')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':'ContactId'});db[_0xf5f3('0x193')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x17e'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x193')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x196'),'as':_0xf5f3('0x180')});db[_0xf5f3('0x193')]['belongsToMany'](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x196'),'as':_0xf5f3('0x18c')});db['OpenchannelInteraction'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x181'),'through':_0xf5f3('0x197'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0xf')});db[_0xf5f3('0x60')]['belongsTo'](db[_0xf5f3('0x169')],{'onDelete':_0xf5f3('0x11d'),'as':'Contact'});db['OpenchannelMessage'][_0xf5f3('0x159')](db[_0xf5f3('0x193')],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0x182'),'foreignKey':_0xf5f3('0x195')});db['OpenchannelMessage'][_0xf5f3('0x159')](db[_0xf5f3('0xf5')],{'as':'Attachment','foreignKey':_0xf5f3('0x18d')});db[_0xf5f3('0x60')][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x192')});db[_0xf5f3('0x62')]['belongsToMany'](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x38'),'foreignKey':_0xf5f3('0x194')});db[_0xf5f3('0x62')][_0xf5f3('0x132')](db[_0xf5f3('0xef')],{'through':'team_has_openchannel_queues','as':_0xf5f3('0x161')});db[_0xf5f3('0x64')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':'ChatWebsiteId','onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x64')][_0xf5f3('0x121')](db[_0xf5f3('0x82')],{'as':_0xf5f3('0x172'),'foreignKey':_0xf5f3('0x183')});db[_0xf5f3('0x64')]['hasMany'](db[_0xf5f3('0x198')],{'as':_0xf5f3('0x199')});db[_0xf5f3('0x64')][_0xf5f3('0x121')](db['ChatInteraction'],{'as':_0xf5f3('0x175')});db[_0xf5f3('0x64')][_0xf5f3('0x121')](db[_0xf5f3('0x68')],{'as':_0xf5f3('0x151')});db[_0xf5f3('0x64')][_0xf5f3('0x121')](db['ChatMessage'],{'as':'Messages'});db[_0xf5f3('0x64')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x64')][_0xf5f3('0x159')](db['Interval'],{'as':'Interval','foreignKey':_0xf5f3('0x15c')});db['ChatWebsite']['belongsTo'](db[_0xf5f3('0x3f')],{'as':'MailAccount','foreignKey':_0xf5f3('0x16c')});db[_0xf5f3('0x64')][_0xf5f3('0x159')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf5f3('0x15e')});db[_0xf5f3('0x64')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x146')});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x66')]['belongsTo'](db[_0xf5f3('0x169')],{'as':'Contact','foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db['OpenchannelInteraction'],{});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db['OpenchannelMessage'],{});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{});db[_0xf5f3('0x66')][_0xf5f3('0x159')](db[_0xf5f3('0x62')],{});db['ChatApplication'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x19a'),'foreignKey':_0xf5f3('0x11e'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x68')][_0xf5f3('0x159')](db[_0xf5f3('0x6f')],{'as':_0xf5f3('0x19b'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db['ChatApplication'][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{'as':_0xf5f3('0x19c'),'foreignKey':_0xf5f3('0x183'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x68')][_0xf5f3('0x159')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf5f3('0x185')});db[_0xf5f3('0x6a')]['hasMany'](db['ChatMessage'],{'as':_0xf5f3('0x174'),'onDelete':'cascade','foreignKey':_0xf5f3('0x19d')});db['ChatInteraction']['belongsTo'](db[_0xf5f3('0x64')],{'as':'Account','foreignKey':_0xf5f3('0x183')});db['ChatInteraction'][_0xf5f3('0x159')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xf5f3('0x6a')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x17e'),'foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x6a')]['belongsToMany'](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x19e'),'as':_0xf5f3('0x180')});db[_0xf5f3('0x6a')][_0xf5f3('0x132')](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':'Users','through':_0xf5f3('0x19f'),'foreignKey':'ChatInteractionId'});db[_0xf5f3('0x6c')][_0xf5f3('0x159')](db['User'],{'onDelete':_0xf5f3('0x11d'),'as':_0xf5f3('0xf')});db[_0xf5f3('0x6c')][_0xf5f3('0x159')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0xf5f3('0x6a')],{'onDelete':_0xf5f3('0x11d'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xf5f3('0x6c')]['belongsTo'](db[_0xf5f3('0xf5')],{'as':_0xf5f3('0xf5'),'foreignKey':_0xf5f3('0x18d')});db[_0xf5f3('0x6c')][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x183')});db[_0xf5f3('0x184')][_0xf5f3('0x121')](db[_0xf5f3('0xf5')],{'as':_0xf5f3('0x1a0'),'foreignKey':_0xf5f3('0x1a1'),'onDelete':_0xf5f3('0x11d'),'hooks':!![]});db[_0xf5f3('0x184')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'onDelete':_0xf5f3('0x11d'),'as':'Contact','foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x184')][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x183')});db[_0xf5f3('0x6f')][_0xf5f3('0x132')](db['User'],{'as':'Agents','through':_0xf5f3('0x31'),'hooks':!![]});db[_0xf5f3('0x6f')][_0xf5f3('0x132')](db[_0xf5f3('0xef')],{'through':_0xf5f3('0x1a2'),'as':_0xf5f3('0x161')});db[_0xf5f3('0x71')]['hasMany'](db['ChatInternalMessage'],{'as':_0xf5f3('0x174'),'foreignKey':_0xf5f3('0x1a3'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x71')][_0xf5f3('0x132')](db['User'],{'as':'Members','through':'chat_group_has_users'});db['ChatProactiveAction'][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{'as':'Website','foreignKey':_0xf5f3('0x183')});db[_0xf5f3('0x1a4')][_0xf5f3('0x121')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x134'),'foreignKey':_0xf5f3('0x1a5')});db[_0xf5f3('0x169')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0xf5f3('0x1a6')});db[_0xf5f3('0x169')][_0xf5f3('0x121')](db[_0xf5f3('0x73')],{'as':_0xf5f3('0x154'),'foreignKey':_0xf5f3('0x16b')});db['CmContact'][_0xf5f3('0x121')](db[_0xf5f3('0x125')],{'as':_0xf5f3('0x126'),'foreignKey':_0xf5f3('0x16b')});db['CmContact']['hasMany'](db[_0xf5f3('0x78')],{'as':_0xf5f3('0x1a7'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x169')][_0xf5f3('0x121')](db['ReportAgentPreview'],{'as':_0xf5f3('0x7a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x169')][_0xf5f3('0x121')](db[_0xf5f3('0xe0')],{'as':_0xf5f3('0x157'),'foreignKey':_0xf5f3('0x16b')});db['CmContact'][_0xf5f3('0x121')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xf5f3('0x169')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x169')][_0xf5f3('0x121')](db[_0xf5f3('0x58')],{'as':_0xf5f3('0x12a'),'foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x16f')});db['CmContact'][_0xf5f3('0x121')](db[_0xf5f3('0x4d')],{'as':_0xf5f3('0x12b'),'foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x169')][_0xf5f3('0x121')](db['MailInteraction'],{'as':_0xf5f3('0x12c'),'foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x169')][_0xf5f3('0x159')](db[_0xf5f3('0x1a4')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact'][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x169')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x181'),'through':_0xf5f3('0x135')});db[_0xf5f3('0x169')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'as':_0xf5f3('0x180'),'through':_0xf5f3('0x1a8')});db['CmContact'][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x1a8'),'as':'ThroughTags'});db[_0xf5f3('0x73')][_0xf5f3('0x121')](db[_0xf5f3('0x95')],{'as':_0xf5f3('0x1a9'),'foreignKey':_0xf5f3('0x1aa')});db[_0xf5f3('0x73')]['belongsTo'](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x73')]['belongsTo'](db[_0xf5f3('0x102')],{'as':'List','foreignKey':_0xf5f3('0x177'),'onDelete':'cascade'});db[_0xf5f3('0x73')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':'Agent','foreignKey':_0xf5f3('0x11e')});db[_0xf5f3('0x73')][_0xf5f3('0x159')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xf5f3('0x155'),'onDelete':_0xf5f3('0x11d')});db['CmHopper'][_0xf5f3('0x159')](db[_0xf5f3('0xf1')],{'as':_0xf5f3('0xf1'),'foreignKey':_0xf5f3('0x1ab'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x73')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x17e'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0xf5f3('0x159')](db['CmContact'],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x75')]['belongsTo'](db[_0xf5f3('0x102')],{'as':'List','foreignKey':_0xf5f3('0x177'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x75')][_0xf5f3('0x159')](db[_0xf5f3('0x19')],{'as':_0xf5f3('0x19b'),'foreignKey':'VoiceQueueId','onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x75')][_0xf5f3('0x159')](db[_0xf5f3('0xf1')],{'as':'Campaign','foreignKey':_0xf5f3('0x1ab'),'onDelete':'cascade'});db[_0xf5f3('0x80')]['hasMany'](db[_0xf5f3('0x86')],{'as':{'plural':'All','singular':_0xf5f3('0x1ac')},'foreignKey':_0xf5f3('0x1ad'),'onDelete':_0xf5f3('0x11d'),'hooks':!![]});db[_0xf5f3('0x80')][_0xf5f3('0x121')](db[_0xf5f3('0x86')],{'as':{'plural':_0xf5f3('0x1ae'),'singular':'OneAny'},'foreignKey':_0xf5f3('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0xf5f3('0x80')][_0xf5f3('0x121')](db['Action'],{'as':_0xf5f3('0x1b0'),'foreignKey':_0xf5f3('0x1b1'),'onDelete':_0xf5f3('0x11d'),'hooks':!![]});db[_0xf5f3('0x84')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':_0xf5f3('0x1b2'),'onDelete':'cascade'});db[_0xf5f3('0x88')][_0xf5f3('0x121')](db[_0xf5f3('0x88')],{'as':_0xf5f3('0x1b3'),'foreignKey':_0xf5f3('0x15c'),'onDelete':_0xf5f3('0x11d'),'hooks':!![],'required':![]});db['Interval'][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'as':_0xf5f3('0x1b4'),'foreignKey':'IntervalId','onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x88')][_0xf5f3('0x121')](db[_0xf5f3('0x46')],{'as':_0xf5f3('0x1b5'),'foreignKey':_0xf5f3('0x15c')});db[_0xf5f3('0x88')][_0xf5f3('0x121')](db[_0xf5f3('0x68')],{'as':_0xf5f3('0x1b6'),'foreignKey':'IntervalId'});db[_0xf5f3('0x88')][_0xf5f3('0x121')](db['FaxApplication'],{'as':_0xf5f3('0x1b7'),'foreignKey':_0xf5f3('0x15c')});db[_0xf5f3('0x88')]['hasMany'](db[_0xf5f3('0x56')],{'as':_0xf5f3('0x1b8'),'foreignKey':_0xf5f3('0x15c')});db['Schedule'][_0xf5f3('0x159')](db[_0xf5f3('0x3f')],{});db[_0xf5f3('0x8d')][_0xf5f3('0x159')](db[_0xf5f3('0xa1')],{'foreignKey':'DefaultReportId'});db[_0xf5f3('0x8d')]['belongsTo'](db[_0xf5f3('0x9f')],{'foreignKey':_0xf5f3('0x1b9')});db[_0xf5f3('0x8f')][_0xf5f3('0x132')](db[_0xf5f3('0x1ba')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x90')][_0xf5f3('0x132')](db[_0xf5f3('0x169')],{'through':_0xf5f3('0x1a8')});db[_0xf5f3('0x90')]['belongsToMany'](db[_0xf5f3('0x6a')],{'through':_0xf5f3('0x19e')});db['Tag']['belongsToMany'](db[_0xf5f3('0x43')],{'through':_0xf5f3('0x17f')});db[_0xf5f3('0x90')][_0xf5f3('0x132')](db[_0xf5f3('0x58')],{'through':_0xf5f3('0x191')});db[_0xf5f3('0x90')][_0xf5f3('0x132')](db[_0xf5f3('0x4d')],{'through':_0xf5f3('0x18b')});db[_0xf5f3('0x90')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xf5f3('0x196')});db[_0xf5f3('0x90')]['belongsToMany'](db[_0xf5f3('0x110')],{'through':_0xf5f3('0x1bb')});db[_0xf5f3('0x93')][_0xf5f3('0x159')](db[_0xf5f3('0x91')],{'as':_0xf5f3('0x1bc'),'foreignKey':_0xf5f3('0x1bd')});db['CmHopperAdditionalPhone']['belongsTo'](db[_0xf5f3('0x73')],{'as':_0xf5f3('0x1be'),'foreignKey':'CmHopperId'});db[_0xf5f3('0x93')]['belongsTo'](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x1a6')});db[_0xf5f3('0x98')][_0xf5f3('0x121')](db[_0xf5f3('0x86')],{'as':{'plural':_0xf5f3('0x1bf'),'singular':_0xf5f3('0x1c0')},'foreignKey':_0xf5f3('0x1c1'),'onDelete':'cascade','hooks':!![]});db[_0xf5f3('0x98')][_0xf5f3('0x121')](db[_0xf5f3('0x86')],{'as':{'plural':_0xf5f3('0x1c2'),'singular':'AnyCondition'},'foreignKey':_0xf5f3('0x1c3'),'onDelete':'cascade','hooks':!![]});db[_0xf5f3('0x98')]['hasMany'](db[_0xf5f3('0x7e')],{'as':_0xf5f3('0x1b0'),'foreignKey':_0xf5f3('0x1c4'),'onDelete':_0xf5f3('0x11d'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xf5f3('0xa5')],{'as':_0xf5f3('0x1c5'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1b9'),'hooks':!![]});db[_0xf5f3('0xa1')]['hasMany'](db[_0xf5f3('0xa5')],{'as':_0xf5f3('0x1c5'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1c6')});db[_0xf5f3('0xa3')]['hasMany'](db[_0xf5f3('0xa5')],{'as':_0xf5f3('0x1c5'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1c7')});db['AnalyticFieldReport'][_0xf5f3('0x159')](db[_0xf5f3('0xa3')],{'foreignKey':_0xf5f3('0x1c7')});db['SalesforceAccount'][_0xf5f3('0x121')](db[_0xf5f3('0xaa')],{'as':_0xf5f3('0x1c8'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'AccountId'});db[_0xf5f3('0xaa')][_0xf5f3('0x121')](db[_0xf5f3('0xac')],{'as':_0xf5f3('0x1c9'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xaa')]['hasMany'](db[_0xf5f3('0xac')],{'as':_0xf5f3('0x1cb'),'onDelete':'cascade','foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xaa')][_0xf5f3('0x121')](db[_0xf5f3('0xac')],{'as':_0xf5f3('0x1c5'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'FieldId'});db[_0xf5f3('0xaa')][_0xf5f3('0x159')](db['SalesforceAccount'],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xac')]['hasMany'](db[_0xf5f3('0xac')],{'as':'Subject','foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xac')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xac')][_0xf5f3('0x121')](db[_0xf5f3('0xac')],{'as':'Field','foreignKey':_0xf5f3('0x1ce')});db['SalesforceField'][_0xf5f3('0x159')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xf5f3('0xad')][_0xf5f3('0x121')](db[_0xf5f3('0xae')],{'as':_0xf5f3('0x1c8'),'onDelete':'cascade','foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xae')]['hasMany'](db['SugarcrmField'],{'as':_0xf5f3('0x1c9'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xae')][_0xf5f3('0x121')](db[_0xf5f3('0xb0')],{'as':_0xf5f3('0x1cb'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cc')});db['SugarcrmConfiguration'][_0xf5f3('0x121')](db['SugarcrmField'],{'as':_0xf5f3('0x1c5'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ce')});db['SugarcrmConfiguration']['belongsTo'](db[_0xf5f3('0xad')],{'as':'Account','foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xb0')][_0xf5f3('0x121')](db[_0xf5f3('0xb0')],{'as':'Subject','foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xb0')][_0xf5f3('0x121')](db[_0xf5f3('0xb0')],{'as':_0xf5f3('0x1cf'),'foreignKey':'DescriptionId'});db[_0xf5f3('0xb0')]['hasMany'](db[_0xf5f3('0xb0')],{'as':_0xf5f3('0x1d0'),'foreignKey':'FieldId'});db[_0xf5f3('0xb0')][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':'VariableId'});db['DeskAccount'][_0xf5f3('0x121')](db[_0xf5f3('0x1d2')],{'as':_0xf5f3('0x1c8'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0x1d2')][_0xf5f3('0x121')](db['DeskField'],{'as':'Subjects','onDelete':_0xf5f3('0x11d'),'foreignKey':'SubjectId'});db['DeskConfiguration']['hasMany'](db[_0xf5f3('0xb5')],{'as':'Descriptions','onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cc')});db['DeskConfiguration'][_0xf5f3('0x121')](db[_0xf5f3('0xb5')],{'as':'Fields','onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0x1d2')]['belongsTo'](db[_0xf5f3('0xb2')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0x1d2')][_0xf5f3('0x132')](db['Tag'],{'through':_0xf5f3('0x1d3')});db['DeskField'][_0xf5f3('0x121')](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf5f3('0xb5')][_0xf5f3('0x121')](db[_0xf5f3('0xb5')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xb5')]['hasMany'](db[_0xf5f3('0xb5')],{'as':'Field','foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xb5')][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':_0xf5f3('0x1d4')});db[_0xf5f3('0x1d5')][_0xf5f3('0x121')](db[_0xf5f3('0xb7')],{'as':_0xf5f3('0x1c8'),'onDelete':'cascade','foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xb7')][_0xf5f3('0x121')](db[_0xf5f3('0x1d6')],{'as':_0xf5f3('0x1c9'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xb7')][_0xf5f3('0x121')](db['ZohoField'],{'as':_0xf5f3('0x1cb'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xb7')][_0xf5f3('0x121')](db[_0xf5f3('0x1d6')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf5f3('0x1ce')});db['ZohoConfiguration'][_0xf5f3('0x159')](db['ZohoAccount'],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db['ZohoField'][_0xf5f3('0x121')](db[_0xf5f3('0x1d6')],{'as':_0xf5f3('0x1d7'),'foreignKey':_0xf5f3('0x1ca')});db['ZohoField'][_0xf5f3('0x121')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xf5f3('0x1d6')][_0xf5f3('0x121')](db[_0xf5f3('0x1d6')],{'as':_0xf5f3('0x1d0'),'foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0x1d6')][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':'VariableId'});db[_0xf5f3('0xb9')][_0xf5f3('0x121')](db[_0xf5f3('0xbb')],{'as':'Configurations','onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xbb')][_0xf5f3('0x121')](db[_0xf5f3('0xbc')],{'as':_0xf5f3('0x1c9'),'foreignKey':'SubjectId'});db[_0xf5f3('0xbb')][_0xf5f3('0x121')](db[_0xf5f3('0xbc')],{'as':_0xf5f3('0x1cb'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xbb')]['hasMany'](db[_0xf5f3('0xbc')],{'as':'Fields','foreignKey':_0xf5f3('0x1ce')});db['ZendeskConfiguration'][_0xf5f3('0x159')](db[_0xf5f3('0xb9')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xbb')]['belongsToMany'](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x1d8')});db['ZendeskField'][_0xf5f3('0x121')](db[_0xf5f3('0xbc')],{'as':'Subject','foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xbc')][_0xf5f3('0x121')](db[_0xf5f3('0xbc')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db['ZendeskField'][_0xf5f3('0x121')](db[_0xf5f3('0xbc')],{'as':_0xf5f3('0x1d0'),'foreignKey':_0xf5f3('0x1ce')});db['ZendeskField']['belongsTo'](db[_0xf5f3('0x1d1')],{'as':'Variable','foreignKey':_0xf5f3('0x1d4')});db['FreshdeskAccount'][_0xf5f3('0x121')](db[_0xf5f3('0xbf')],{'as':_0xf5f3('0x1c8'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xf5f3('0x121')](db[_0xf5f3('0xc1')],{'as':_0xf5f3('0x1c9'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xbf')]['hasMany'](db[_0xf5f3('0xc1')],{'as':_0xf5f3('0x1cb'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'DescriptionId'});db[_0xf5f3('0xbf')][_0xf5f3('0x121')](db[_0xf5f3('0xc1')],{'as':'Fields','onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1ce')});db['FreshdeskConfiguration'][_0xf5f3('0x159')](db[_0xf5f3('0xbe')],{'as':_0xf5f3('0x17d'),'foreignKey':'AccountId'});db[_0xf5f3('0xbf')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':_0xf5f3('0x1d9')});db['FreshdeskField'][_0xf5f3('0x121')](db[_0xf5f3('0xc1')],{'as':_0xf5f3('0x1d7'),'foreignKey':_0xf5f3('0x1ca')});db['FreshdeskField']['hasMany'](db[_0xf5f3('0xc1')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xc1')][_0xf5f3('0x121')](db['FreshdeskField'],{'as':_0xf5f3('0x1d0'),'foreignKey':_0xf5f3('0x1ce')});db['FreshdeskField'][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':_0xf5f3('0x1d4')});db[_0xf5f3('0xc3')][_0xf5f3('0x121')](db[_0xf5f3('0xc5')],{'as':_0xf5f3('0x1c8'),'onDelete':_0xf5f3('0x11d'),'foreignKey':'AccountId'});db[_0xf5f3('0xc5')][_0xf5f3('0x121')](db[_0xf5f3('0xc7')],{'as':_0xf5f3('0x1c9'),'foreignKey':'SubjectId'});db[_0xf5f3('0xc5')]['hasMany'](db[_0xf5f3('0xc7')],{'as':_0xf5f3('0x1cb'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xc5')]['hasMany'](db[_0xf5f3('0xc7')],{'as':_0xf5f3('0x1c5'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xf5f3('0x159')](db[_0xf5f3('0xc3')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db['VtigerField'][_0xf5f3('0x121')](db[_0xf5f3('0xc7')],{'as':_0xf5f3('0x1d7'),'foreignKey':_0xf5f3('0x1ca')});db['VtigerField'][_0xf5f3('0x121')](db[_0xf5f3('0xc7')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xc7')][_0xf5f3('0x121')](db['VtigerField'],{'as':_0xf5f3('0x1d0'),'foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xc7')][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':_0xf5f3('0x1d4')});db[_0xf5f3('0xc9')][_0xf5f3('0x121')](db[_0xf5f3('0xcb')],{'as':'Configurations','onDelete':_0xf5f3('0x11d'),'foreignKey':'AccountId'});db[_0xf5f3('0xcb')][_0xf5f3('0x121')](db[_0xf5f3('0xcd')],{'as':_0xf5f3('0x1c9'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xcb')][_0xf5f3('0x121')](db[_0xf5f3('0xcd')],{'as':_0xf5f3('0x1cb'),'foreignKey':_0xf5f3('0x1cc')});db['ServicenowConfiguration'][_0xf5f3('0x121')](db[_0xf5f3('0xcd')],{'as':_0xf5f3('0x1c5'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0xf5f3('0xc9')],{'as':'Account','foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xcd')][_0xf5f3('0x121')](db[_0xf5f3('0xcd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf5f3('0xcd')]['hasMany'](db[_0xf5f3('0xcd')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db['ServicenowField']['hasMany'](db[_0xf5f3('0xcd')],{'as':_0xf5f3('0x1d0'),'foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xcd')][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0xf5f3('0x121')](db[_0xf5f3('0xd1')],{'as':_0xf5f3('0x1c8'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xcf')][_0xf5f3('0x159')](db[_0xf5f3('0x16d')],{'as':'CloudProvider','foreignKey':_0xf5f3('0x16e')});db[_0xf5f3('0xd1')][_0xf5f3('0x121')](db[_0xf5f3('0x1da')],{'as':'Subjects','onDelete':_0xf5f3('0x11d'),'foreignKey':'SubjectId'});db[_0xf5f3('0xd1')][_0xf5f3('0x121')](db[_0xf5f3('0x1da')],{'as':_0xf5f3('0x1cb'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1cc')});db['Dynamics365Configuration'][_0xf5f3('0x121')](db[_0xf5f3('0x1da')],{'as':_0xf5f3('0x1c5'),'onDelete':'cascade','foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xd1')][_0xf5f3('0x159')](db[_0xf5f3('0xcf')],{'as':_0xf5f3('0x17d'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0xf5f3('0x121')](db[_0xf5f3('0x1da')],{'as':_0xf5f3('0x1d7'),'foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0x1da')][_0xf5f3('0x121')](db['Dynamics365Field'],{'as':_0xf5f3('0x1cf'),'foreignKey':'DescriptionId'});db[_0xf5f3('0x1da')][_0xf5f3('0x121')](db[_0xf5f3('0x1da')],{'as':'Field','foreignKey':_0xf5f3('0x1ce')});db['Dynamics365Field'][_0xf5f3('0x159')](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':_0xf5f3('0x1d4')});db[_0xf5f3('0x1db')][_0xf5f3('0x121')](db['FreshsalesConfiguration'],{'as':_0xf5f3('0x1c8'),'onDelete':'cascade','foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xd5')]['hasMany'](db[_0xf5f3('0xd7')],{'as':_0xf5f3('0x1c9'),'foreignKey':_0xf5f3('0x1ca')});db['FreshsalesConfiguration'][_0xf5f3('0x121')](db['FreshsalesField'],{'as':_0xf5f3('0x1cb'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xd5')][_0xf5f3('0x121')](db[_0xf5f3('0xd7')],{'as':_0xf5f3('0x1c5'),'foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xd5')][_0xf5f3('0x159')](db['FreshsalesAccount'],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1cd')});db[_0xf5f3('0xd7')][_0xf5f3('0x121')](db[_0xf5f3('0xd7')],{'as':'Subject','foreignKey':_0xf5f3('0x1ca')});db[_0xf5f3('0xd7')][_0xf5f3('0x121')](db[_0xf5f3('0xd7')],{'as':_0xf5f3('0x1cf'),'foreignKey':_0xf5f3('0x1cc')});db[_0xf5f3('0xd7')][_0xf5f3('0x121')](db[_0xf5f3('0xd7')],{'as':'Field','foreignKey':_0xf5f3('0x1ce')});db[_0xf5f3('0xd7')]['belongsTo'](db[_0xf5f3('0x1d1')],{'as':_0xf5f3('0x1d1'),'foreignKey':_0xf5f3('0x1d4')});db[_0xf5f3('0xda')][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{});db[_0xf5f3('0xda')][_0xf5f3('0x159')](db['CmList'],{'as':_0xf5f3('0x176'),'foreignKey':'ListId'});db['ChatQueueReport'][_0xf5f3('0x159')](db['CmContact'],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0xda')]['belongsTo'](db[_0xf5f3('0x6a')],{});db[_0xf5f3('0xda')][_0xf5f3('0x159')](db['ChatMessage'],{});db[_0xf5f3('0xda')]['belongsTo'](db['User'],{});db['ChatQueueReport'][_0xf5f3('0x159')](db[_0xf5f3('0x6f')],{});db['ChatInternalMessage']['belongsTo'](db[_0xf5f3('0xf')],{'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1dc')});db[_0xf5f3('0xdb')]['belongsTo'](db['User'],{'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1dd')});db['JscriptySessionReport'][_0xf5f3('0x121')](db[_0xf5f3('0x1de')],{'foreignKey':_0xf5f3('0x1df'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0xe0')]['hasMany'](db[_0xf5f3('0xdd')],{'foreignKey':_0xf5f3('0x1df'),'onDelete':'cascade'});db[_0xf5f3('0xe1')][_0xf5f3('0x159')](db[_0xf5f3('0x55')],{});db['SmsQueueReport'][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db['SmsQueueReport'][_0xf5f3('0x159')](db['CmContact'],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0xe1')][_0xf5f3('0x159')](db['SmsInteraction'],{});db[_0xf5f3('0xe1')][_0xf5f3('0x159')](db[_0xf5f3('0x59')],{});db[_0xf5f3('0xe1')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{});db[_0xf5f3('0xe1')]['belongsTo'](db[_0xf5f3('0x142')],{});db[_0xf5f3('0xe5')][_0xf5f3('0x121')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0xf5f3('0x1de')],{'foreignKey':'ProjectId'});db[_0xf5f3('0xe5')][_0xf5f3('0x121')](db[_0xf5f3('0xdd')],{'foreignKey':_0xf5f3('0x1e0')});db[_0xf5f3('0xea')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x181'),'through':_0xf5f3('0x1e1')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x138')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x19')],{'through':_0xf5f3('0x117'),'as':_0xf5f3('0x13c')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x41')],{'through':_0xf5f3('0x17b'),'as':_0xf5f3('0x13f')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x6f')],{'through':_0xf5f3('0x1a2'),'as':_0xf5f3('0x140')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db['FaxQueue'],{'through':_0xf5f3('0x18e'),'as':_0xf5f3('0x141')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x142')],{'through':_0xf5f3('0x1e2'),'as':_0xf5f3('0x143')});db['Team'][_0xf5f3('0x132')](db[_0xf5f3('0x62')],{'through':'team_has_openchannel_queues','as':_0xf5f3('0x144')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x115')],{'through':'team_has_whatsapp_queues','as':_0xf5f3('0x145')});db[_0xf5f3('0xef')][_0xf5f3('0x132')](db[_0xf5f3('0x13d')],{'through':_0xf5f3('0x119'),'as':_0xf5f3('0x13e')});db[_0xf5f3('0xf1')][_0xf5f3('0x121')](db[_0xf5f3('0x73')],{'as':_0xf5f3('0x154'),'foreignKey':_0xf5f3('0x1ab')});db['Campaign'][_0xf5f3('0x121')](db['CmHopperFinal'],{'as':_0xf5f3('0x126'),'foreignKey':_0xf5f3('0x1ab')});db[_0xf5f3('0xf1')][_0xf5f3('0x121')](db[_0xf5f3('0x78')],{'as':_0xf5f3('0x1a7'),'foreignKey':_0xf5f3('0x1ab')});db[_0xf5f3('0xf1')][_0xf5f3('0x121')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xf5f3('0x1ab')});db[_0xf5f3('0xf1')][_0xf5f3('0x159')](db[_0xf5f3('0x29')],{'as':_0xf5f3('0x29'),'foreignKey':_0xf5f3('0x158')});db[_0xf5f3('0xf1')][_0xf5f3('0x159')](db['Trunk'],{'as':_0xf5f3('0x15a'),'foreignKey':_0xf5f3('0x15b')});db[_0xf5f3('0xf1')][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'as':_0xf5f3('0x88'),'foreignKey':_0xf5f3('0x15c')});db['Campaign'][_0xf5f3('0x159')](db[_0xf5f3('0xea')],{'as':'SquareProject','foreignKey':_0xf5f3('0x1e3')});db[_0xf5f3('0xf1')][_0xf5f3('0x132')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x136'),'through':_0xf5f3('0x1e4')});db[_0xf5f3('0xf1')][_0xf5f3('0x132')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x162'),'through':_0xf5f3('0x1e5')});db[_0xf5f3('0xf5')][_0xf5f3('0x159')](db['ChatOfflineMessage'],{'as':_0xf5f3('0x184'),'foreignKey':_0xf5f3('0x1a1')});db[_0xf5f3('0xf9')][_0xf5f3('0x159')](db[_0xf5f3('0x173')],{});db[_0xf5f3('0xf9')][_0xf5f3('0x159')](db[_0xf5f3('0x43')],{});db['MailTransferReport']['belongsTo'](db[_0xf5f3('0x3f')],{'foreignKey':_0xf5f3('0x1e6'),'as':_0xf5f3('0x1e7')});db[_0xf5f3('0xf9')]['belongsTo'](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1e8'),'as':_0xf5f3('0x1e9')});db[_0xf5f3('0xf9')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1ea'),'as':'ToAgent'});db[_0xf5f3('0xf9')][_0xf5f3('0x159')](db['MailQueue'],{'foreignKey':_0xf5f3('0x1eb'),'as':_0xf5f3('0x1ec')});db[_0xf5f3('0xf9')]['belongsTo'](db[_0xf5f3('0x3f')],{'foreignKey':_0xf5f3('0x1ed'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0xfb')][_0xf5f3('0x159')](db[_0xf5f3('0x6c')],{});db['ChatTransferReport'][_0xf5f3('0x159')](db[_0xf5f3('0x6a')],{});db[_0xf5f3('0xfb')]['belongsTo'](db[_0xf5f3('0x64')],{'foreignKey':_0xf5f3('0x1ef'),'as':_0xf5f3('0x1e7')});db[_0xf5f3('0xfb')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1e8'),'as':'FromAgent'});db[_0xf5f3('0xfb')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':'ToUserId','as':_0xf5f3('0x1f0')});db[_0xf5f3('0xfb')][_0xf5f3('0x159')](db[_0xf5f3('0x6f')],{'foreignKey':'ToChatQueueId','as':_0xf5f3('0x1ec')});db[_0xf5f3('0xfb')][_0xf5f3('0x159')](db[_0xf5f3('0x64')],{'foreignKey':_0xf5f3('0x1f1'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0xfc')][_0xf5f3('0x159')](db[_0xf5f3('0x4f')],{});db[_0xf5f3('0xfc')][_0xf5f3('0x159')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xf5f3('0x159')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0xf5f3('0xfc')]['belongsTo'](db[_0xf5f3('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db['FaxTransferReport'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf5f3('0xfc')][_0xf5f3('0x159')](db[_0xf5f3('0x51')],{'foreignKey':_0xf5f3('0x1f2'),'as':'ToQueue'});db[_0xf5f3('0xfc')][_0xf5f3('0x159')](db[_0xf5f3('0x4b')],{'foreignKey':_0xf5f3('0x1f3'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0xfe')]['belongsTo'](db[_0xf5f3('0x60')],{});db['OpenchannelTransferReport'][_0xf5f3('0x159')](db['OpenchannelInteraction'],{});db[_0xf5f3('0xfe')][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{'foreignKey':_0xf5f3('0x1f4'),'as':_0xf5f3('0x1e7')});db[_0xf5f3('0xfe')]['belongsTo'](db[_0xf5f3('0xf')],{'foreignKey':'FromUserId','as':_0xf5f3('0x1e9')});db[_0xf5f3('0xfe')]['belongsTo'](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1ea'),'as':_0xf5f3('0x1f0')});db[_0xf5f3('0xfe')]['belongsTo'](db[_0xf5f3('0x62')],{'foreignKey':_0xf5f3('0x1f5'),'as':_0xf5f3('0x1ec')});db[_0xf5f3('0xfe')][_0xf5f3('0x159')](db[_0xf5f3('0x5c')],{'foreignKey':_0xf5f3('0x1f6'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0x100')][_0xf5f3('0x159')](db['SmsMessage'],{});db[_0xf5f3('0x100')][_0xf5f3('0x159')](db[_0xf5f3('0x58')],{});db[_0xf5f3('0x100')]['belongsTo'](db[_0xf5f3('0x55')],{'foreignKey':_0xf5f3('0x1f7'),'as':_0xf5f3('0x1e7')});db[_0xf5f3('0x100')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':'FromUserId','as':_0xf5f3('0x1e9')});db['SmsTransferReport'][_0xf5f3('0x159')](db['User'],{'foreignKey':'ToUserId','as':_0xf5f3('0x1f0')});db[_0xf5f3('0x100')][_0xf5f3('0x159')](db[_0xf5f3('0x142')],{'foreignKey':_0xf5f3('0x1f8'),'as':_0xf5f3('0x1ec')});db['SmsTransferReport'][_0xf5f3('0x159')](db[_0xf5f3('0x55')],{'foreignKey':_0xf5f3('0x1f9'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0x102')][_0xf5f3('0x121')](db[_0xf5f3('0x84')],{'as':_0xf5f3('0x171'),'foreignKey':'ListId','onDelete':_0xf5f3('0x11d')});db['CmList']['hasMany'](db[_0xf5f3('0x7c')],{'as':_0xf5f3('0x1fa'),'foreignKey':'ListId'});db[_0xf5f3('0x102')]['hasMany'](db[_0xf5f3('0x169')],{'as':'Contacts','onDelete':_0xf5f3('0x11d'),'foreignKey':'ListId'});db[_0xf5f3('0x102')]['hasMany'](db[_0xf5f3('0x125')],{'as':'HopperFinals','foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x102')][_0xf5f3('0x121')](db[_0xf5f3('0x78')],{'as':'HopperHistory','foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x102')][_0xf5f3('0x121')](db[_0xf5f3('0x7a')],{'as':_0xf5f3('0x7a'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x102')]['belongsToMany'](db[_0xf5f3('0x19')],{'as':'Queues','through':_0xf5f3('0x15f')});db[_0xf5f3('0x102')]['belongsToMany'](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x137')});db[_0xf5f3('0x13d')][_0xf5f3('0x121')](db[_0xf5f3('0x16')],{'as':_0xf5f3('0x1b4'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x13d')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x11b')});db[_0xf5f3('0x13d')][_0xf5f3('0x132')](db['Team'],{'through':_0xf5f3('0x119'),'as':_0xf5f3('0x161')});db[_0xf5f3('0x130')][_0xf5f3('0x121')](db['User'],{'as':'Users','foreignKey':_0xf5f3('0x131')});db[_0xf5f3('0x130')][_0xf5f3('0x121')](db[_0xf5f3('0x106')],{'as':_0xf5f3('0x1fb'),'foreignKey':'userProfileId','onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x106')]['hasMany'](db[_0xf5f3('0x108')],{'as':'Resources','foreignKey':_0xf5f3('0x1fc'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x10c')][_0xf5f3('0x121')](db['Disposition'],{'as':_0xf5f3('0x171'),'foreignKey':_0xf5f3('0x1fd'),'onDelete':_0xf5f3('0x11d')});db[_0xf5f3('0x10c')][_0xf5f3('0x121')](db['CannedAnswer'],{'as':_0xf5f3('0x172'),'foreignKey':'WhatsappAccountId'});db[_0xf5f3('0x10c')][_0xf5f3('0x121')](db[_0xf5f3('0x111')],{'as':_0xf5f3('0x174'),'foreignKey':_0xf5f3('0x1fd')});db[_0xf5f3('0x10c')][_0xf5f3('0x121')](db[_0xf5f3('0x110')],{'as':_0xf5f3('0x175')});db[_0xf5f3('0x10c')][_0xf5f3('0x121')](db[_0xf5f3('0x10e')],{'as':_0xf5f3('0x151')});db[_0xf5f3('0x10c')][_0xf5f3('0x159')](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x10c')]['belongsTo'](db[_0xf5f3('0x179')],{'as':_0xf5f3('0x15d'),'foreignKey':_0xf5f3('0x15e')});db[_0xf5f3('0x10c')][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':'user_has_whatsapp_accounts'});db[_0xf5f3('0x10e')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'onDelete':_0xf5f3('0x16f')});db['WhatsappApplication'][_0xf5f3('0x159')](db[_0xf5f3('0x115')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xf5f3('0x159')](db[_0xf5f3('0x10c')],{'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x10e')][_0xf5f3('0x159')](db[_0xf5f3('0x88')],{'onDelete':_0xf5f3('0x16f'),'foreignKey':'IntervalId'});db[_0xf5f3('0x10e')][_0xf5f3('0x159')](db[_0xf5f3('0x90')],{'onDelete':_0xf5f3('0x16f'),'foreignKey':_0xf5f3('0x185')});db[_0xf5f3('0x110')][_0xf5f3('0x121')](db[_0xf5f3('0x111')],{'as':_0xf5f3('0x174'),'onDelete':_0xf5f3('0x11d'),'foreignKey':_0xf5f3('0x1fe')});db[_0xf5f3('0x110')][_0xf5f3('0x159')](db[_0xf5f3('0x10c')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1fd')});db[_0xf5f3('0x110')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':'ContactId'});db[_0xf5f3('0x110')]['belongsTo'](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x17e'),'foreignKey':'UserId'});db[_0xf5f3('0x110')][_0xf5f3('0x132')](db[_0xf5f3('0x90')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xf5f3('0x110')]['belongsToMany'](db[_0xf5f3('0x90')],{'through':'whatsapp_interaction_has_tags','as':_0xf5f3('0x18c')});db[_0xf5f3('0x110')]['belongsToMany'](db['User'],{'as':'Users','through':_0xf5f3('0x1ff'),'foreignKey':'WhatsappInteractionId'});db[_0xf5f3('0x111')]['belongsTo'](db[_0xf5f3('0xf')],{'as':'User'});db[_0xf5f3('0x111')][_0xf5f3('0x159')](db['CmContact'],{'onDelete':_0xf5f3('0x11d'),'as':'Contact'});db['WhatsappMessage'][_0xf5f3('0x159')](db[_0xf5f3('0x110')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xf5f3('0x1fe')});db[_0xf5f3('0x111')]['belongsTo'](db[_0xf5f3('0x10c')],{'as':_0xf5f3('0x17d'),'foreignKey':_0xf5f3('0x1fd')});db[_0xf5f3('0x113')][_0xf5f3('0x159')](db[_0xf5f3('0x10c')],{});db[_0xf5f3('0x113')]['belongsTo'](db[_0xf5f3('0x102')],{'as':_0xf5f3('0x176'),'foreignKey':_0xf5f3('0x177')});db[_0xf5f3('0x113')][_0xf5f3('0x159')](db[_0xf5f3('0x169')],{'as':_0xf5f3('0x16a'),'foreignKey':_0xf5f3('0x16b')});db[_0xf5f3('0x113')][_0xf5f3('0x159')](db[_0xf5f3('0x110')],{});db[_0xf5f3('0x113')]['belongsTo'](db[_0xf5f3('0x115')],{});db[_0xf5f3('0x113')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db[_0xf5f3('0x111')],{});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db[_0xf5f3('0x110')],{});db[_0xf5f3('0x200')]['belongsTo'](db[_0xf5f3('0x10c')],{'foreignKey':_0xf5f3('0x201'),'as':_0xf5f3('0x1e7')});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db['WhatsappAccount'],{'foreignKey':_0xf5f3('0x202'),'as':_0xf5f3('0x1ee')});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db[_0xf5f3('0x115')],{'foreignKey':'ToQueueId','as':_0xf5f3('0x1ec')});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1e8'),'as':_0xf5f3('0x1e9')});db[_0xf5f3('0x200')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'foreignKey':_0xf5f3('0x1ea'),'as':_0xf5f3('0x1f0')});db['WhatsappQueue'][_0xf5f3('0x132')](db[_0xf5f3('0xf')],{'as':_0xf5f3('0x160'),'through':_0xf5f3('0x39'),'foreignKey':_0xf5f3('0x203')});db[_0xf5f3('0x115')][_0xf5f3('0x132')](db['Team'],{'through':_0xf5f3('0x204'),'as':_0xf5f3('0x161')});db[_0xf5f3('0x205')][_0xf5f3('0x159')](db[_0xf5f3('0xf')],{'as':'user','foreignKey':_0xf5f3('0x11e'),'onDelete':_0xf5f3('0x11d'),'hooks':!![]});db['CloudProvider'][_0xf5f3('0x11f')](db[_0xf5f3('0xcf')],{'as':_0xf5f3('0xcf'),'onDelete':'restrict'});db[_0xf5f3('0x16d')][_0xf5f3('0x11f')](db[_0xf5f3('0x3b')],{'as':_0xf5f3('0x206'),'onDelete':_0xf5f3('0x16f')});db[_0xf5f3('0x16d')][_0xf5f3('0x11f')](db[_0xf5f3('0x3d')],{'as':_0xf5f3('0x170'),'onDelete':_0xf5f3('0x16f')});module[_0xf5f3('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4461=['../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','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','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','userSetting','UserId','hasMany','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueue','SmsQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','VoiceExtension','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','CloudProviderId','restrict','MailServerOut','Smtp','Dispositions','Answers','Interactions','List','Template','TemplateId','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','DashboardItem','Items','FaxAccountId','Exntensions','ListId','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','CmHopper','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','MailApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','AllConditions','AllCondition','TriggerAllId','TriggerId','Fields','MetricId','SalesforceConfiguration','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','SubjectId','Field','VariableId','Configurations','SugarcrmField','Subject','Description','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','VtigerAccount','ServicenowConfiguration','ServicenowField','Dynamics365Field','FreshsalesField','ToId','SessionId','JscriptyAnswerReport','ProjectId','user_has_teams','team_has_mail_queues','team_has_fax_queues','FaxQueues','team_has_whatsapp_queues','WhatsappQueues','HopperBlacks','TrunkBackupId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ChatTransferReport','FromChatWebsiteId','FromAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','password','options','User','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','AnalyticExtractedReport'];(function(_0x584903,_0x3360c6){var _0x1b0ca9=function(_0x4bc281){while(--_0x4bc281){_0x584903['push'](_0x584903['shift']());}};_0x1b0ca9(++_0x3360c6);}(_0x4461,0x15f));var _0x1446=function(_0x5c332e,_0x29f6bb){_0x5c332e=_0x5c332e-0x0;var _0x4aa64b=_0x4461[_0x5c332e];return _0x4aa64b;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x1446('0x0'));var _=require(_0x1446('0x1'));var jstz=require(_0x1446('0x2'));var timezone=jstz[_0x1446('0x3')]();config[_0x1446('0x0')]=_[_0x1446('0x4')](config[_0x1446('0x0')],{'database':_0x1446('0x5'),'username':'xcall','password':_0x1446('0x6'),'options':{'host':_0x1446('0x7'),'port':0xcea,'dialect':_0x1446('0x8'),'dialectOptions':{'charset':_0x1446('0x9')},'logging':![],'timezone':timezone[_0x1446('0xa')](),'define':{'charset':_0x1446('0xb'),'collate':_0x1446('0xc')}}});config[_0x1446('0xd')]=_['defaultsDeep'](config[_0x1446('0xd')],{'database':_0x1446('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x1446('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x1446('0x9')},'logging':![],'timezone':timezone[_0x1446('0xa')](),'define':{'charset':_0x1446('0xb'),'collate':_0x1446('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x1446('0x0')][_0x1446('0xe')],config[_0x1446('0x0')][_0x1446('0xf')],config['sequelize'][_0x1446('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1446('0xd')]['database'],config['sequelizeHistory'][_0x1446('0xe')],config[_0x1446('0xd')][_0x1446('0xf')],config['sequelizeHistory'][_0x1446('0x10')])};db[_0x1446('0x11')]=db['sequelize'][_0x1446('0x12')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x13'));db[_0x1446('0x14')]=db['sequelize']['import'](_0x1446('0x15'));db['VoiceExtension']=db['sequelize'][_0x1446('0x12')](_0x1446('0x16'));db['VoiceMusicOnHold']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x1446('0x17')]=db[_0x1446('0x0')]['import'](_0x1446('0x18'));db[_0x1446('0x19')]=db[_0x1446('0x0')]['import'](_0x1446('0x1a'));db[_0x1446('0x1b')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x1c'));db[_0x1446('0x1d')]=db[_0x1446('0x0')]['import'](_0x1446('0x1e'));db[_0x1446('0x1f')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x20'));db[_0x1446('0x21')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x22'));db[_0x1446('0x23')]=db[_0x1446('0x0')]['import'](_0x1446('0x24'));db[_0x1446('0x25')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x26'));db['VoiceQueueReport']=db[_0x1446('0x0')]['import'](_0x1446('0x27'));db[_0x1446('0x28')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x29'));db[_0x1446('0x2a')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/trunk/trunk.model');db[_0x1446('0x2b')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x2c'));db[_0x1446('0x2d')]=db[_0x1446('0x0')]['import'](_0x1446('0x2e'));db[_0x1446('0x2f')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db['sequelize']['import'](_0x1446('0x30'));db[_0x1446('0x31')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x32'));db[_0x1446('0x33')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x34'));db[_0x1446('0x35')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x1446('0x36')]=db[_0x1446('0x0')]['import'](_0x1446('0x37'));db['UserWhatsappQueue']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x1446('0x38')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x39'));db['MailServerOut']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x3a'));db['MailAccount']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x3b'));db[_0x1446('0x3c')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x3d'));db[_0x1446('0x3e')]=db[_0x1446('0x0')]['import'](_0x1446('0x3f'));db[_0x1446('0x40')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x41'));db[_0x1446('0x42')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x43'));db[_0x1446('0x44')]=db['sequelize']['import'](_0x1446('0x45'));db[_0x1446('0x46')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x47'));db[_0x1446('0x48')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x49'));db['DashboardItem']=db[_0x1446('0x0')]['import'](_0x1446('0x4a'));db[_0x1446('0x4b')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x4c'));db[_0x1446('0x4d')]=db[_0x1446('0x0')]['import'](_0x1446('0x4e'));db['FaxInteraction']=db['sequelize'][_0x1446('0x12')]('../api/faxInteraction/faxInteraction.model');db[_0x1446('0x4f')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x50'));db['FaxQueue']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x51'));db[_0x1446('0x52')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x53'));db[_0x1446('0x54')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x55'));db[_0x1446('0x56')]=db['sequelize'][_0x1446('0x12')]('../api/smsApplication/smsApplication.model');db[_0x1446('0x57')]=db['sequelize']['import'](_0x1446('0x58'));db[_0x1446('0x59')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x5a'));db[_0x1446('0x5b')]=db[_0x1446('0x0')]['import'](_0x1446('0x5c'));db['OpenchannelAccount']=db['sequelize'][_0x1446('0x12')](_0x1446('0x5d'));db[_0x1446('0x5e')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x5f'));db['OpenchannelInteraction']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x60'));db['OpenchannelMessage']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x61'));db[_0x1446('0x62')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x63'));db['ChatWebsite']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x64'));db['OpenchannelQueueReport']=db[_0x1446('0x0')]['import'](_0x1446('0x65'));db[_0x1446('0x66')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x67'));db[_0x1446('0x68')]=db[_0x1446('0x0')]['import'](_0x1446('0x69'));db[_0x1446('0x6a')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x6b'));db[_0x1446('0x6c')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x6d'));db[_0x1446('0x6e')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x6f'));db['ChatGroup']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x70'));db[_0x1446('0x71')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x72'));db[_0x1446('0x73')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x74'));db[_0x1446('0x75')]=db[_0x1446('0x0')]['import'](_0x1446('0x76'));db['CmHopper']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x77'));db[_0x1446('0x78')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x79'));db[_0x1446('0x7a')]=db['sequelize']['import'](_0x1446('0x7b'));db['CmHopperHistory']=db['sequelize'][_0x1446('0x12')](_0x1446('0x7c'));db[_0x1446('0x7d')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x7e'));db['CmCustomField']=db[_0x1446('0x0')]['import']('../api/cmCustomField/cmCustomField.model');db[_0x1446('0x7f')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x80'));db[_0x1446('0x81')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x82'));db[_0x1446('0x83')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x84'));db[_0x1446('0x85')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x86'));db[_0x1446('0x87')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x88'));db[_0x1446('0x89')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x8a'));db[_0x1446('0x8b')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x8c'));db['Cdr']=db[_0x1446('0x0')]['import']('../api/cdr/cdr.model');db[_0x1446('0x8d')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x8e'));db[_0x1446('0x8f')]=db['sequelize'][_0x1446('0x12')]('../api/schedule/schedule.model');db[_0x1446('0x90')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x91'));db[_0x1446('0x92')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x93'));db[_0x1446('0x94')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x95'));db[_0x1446('0x96')]=db['sequelize'][_0x1446('0x12')](_0x1446('0x97'));db[_0x1446('0x98')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x99'));db['Template']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x9a'));db[_0x1446('0x9b')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x9c'));db[_0x1446('0x9d')]=db['sequelize']['import'](_0x1446('0x9e'));db[_0x1446('0x9f')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xa0'));db['IntegrationReport']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xa1'));db['AnalyticCustomReport']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x1446('0xa2')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x1446('0xa3')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xa4'));db[_0x1446('0xa5')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xa6'));db[_0x1446('0xa7')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x1446('0xa8')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x1446('0xa9')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xaa'));db['SalesforceConfiguration']=db['sequelize'][_0x1446('0x12')](_0x1446('0xab'));db['SalesforceField']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xac'));db[_0x1446('0xad')]=db['sequelize'][_0x1446('0x12')](_0x1446('0xae'));db[_0x1446('0xaf')]=db[_0x1446('0x0')]['import'](_0x1446('0xb0'));db['SugarcrmField']=db['sequelize'][_0x1446('0x12')](_0x1446('0xb1'));db['DeskAccount']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xb2'));db[_0x1446('0xb3')]=db['sequelize'][_0x1446('0x12')](_0x1446('0xb4'));db[_0x1446('0xb5')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xb6'));db[_0x1446('0xb7')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xb8'));db[_0x1446('0xb9')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1446('0xba')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xbb'));db[_0x1446('0xbc')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xbd'));db[_0x1446('0xbe')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xbf'));db[_0x1446('0xc0')]=db[_0x1446('0x0')]['import'](_0x1446('0xc1'));db[_0x1446('0xc2')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xc3'));db[_0x1446('0xc4')]=db[_0x1446('0x0')]['import'](_0x1446('0xc5'));db['FreshdeskField']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xc6'));db['VtigerAccount']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x1446('0xc7')]=db['sequelize']['import'](_0x1446('0xc8'));db['VtigerField']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xc9'));db[_0x1446('0xca')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xcb'));db['ServicenowConfiguration']=db['sequelize'][_0x1446('0x12')](_0x1446('0xcc'));db['ServicenowField']=db['sequelize'][_0x1446('0x12')](_0x1446('0xcd'));db[_0x1446('0xce')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xcf'));db[_0x1446('0xd0')]=db[_0x1446('0x0')]['import'](_0x1446('0xd1'));db['Dynamics365Field']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xd2'));db[_0x1446('0xd3')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xd4'));db[_0x1446('0xd5')]=db[_0x1446('0x0')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xd6'));db[_0x1446('0x9f')]=db['sequelize'][_0x1446('0x12')](_0x1446('0xa0'));db[_0x1446('0xd7')]=db[_0x1446('0x0')]['import'](_0x1446('0xd8'));db[_0x1446('0xd9')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xda'));db['ChatInternalMessage']=db[_0x1446('0x0')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xdb'));db[_0x1446('0xdc')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xdd'));db[_0x1446('0xde')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x1446('0xdf')]=db['sequelize']['import'](_0x1446('0xe0'));db[_0x1446('0xe1')]=db['sequelize'][_0x1446('0x12')](_0x1446('0xe2'));db['SquareDetailsReport']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xe3'));db[_0x1446('0xe4')]=db['sequelize'][_0x1446('0x12')](_0x1446('0xe5'));db['Setting']=db['sequelize'][_0x1446('0x12')]('../api/setting/setting.model');db['SquareOdbc']=db['sequelize'][_0x1446('0x12')](_0x1446('0xe6'));db[_0x1446('0xe7')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xe8'));db[_0x1446('0xe9')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/squareRecording/squareRecording.model');db[_0x1446('0xea')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xeb'));db[_0x1446('0xec')]=db[_0x1446('0x0')]['import'](_0x1446('0xed'));db[_0x1446('0xee')]=db['sequelize'][_0x1446('0x12')]('../api/license/license.model');db['Campaign']=db['sequelize']['import']('../api/campaign/campaign.model');db['Migration']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/migration/migration.model');db[_0x1446('0xef')]=db[_0x1446('0x0')]['import'](_0x1446('0xf0'));db[_0x1446('0xf1')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xf2'));db[_0x1446('0xf3')]=db[_0x1446('0x0')]['import'](_0x1446('0xf4'));db['ChatTransferReport']=db['sequelize']['import'](_0x1446('0xf5'));db[_0x1446('0xf6')]=db[_0x1446('0x0')]['import'](_0x1446('0xf7'));db['OpenchannelTransferReport']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xf8'));db['SmsTransferReport']=db[_0x1446('0x0')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x1446('0xf9')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0xfa'));db[_0x1446('0xfb')]=db[_0x1446('0x0')]['import'](_0x1446('0xfc'));db[_0x1446('0xfd')]=db['sequelize']['import'](_0x1446('0xfe'));db[_0x1446('0xff')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x1446('0x100')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x1446('0x0')][_0x1446('0x12')]('../api/userNotification/userNotification.model');db[_0x1446('0x101')]=db[_0x1446('0x0')]['import'](_0x1446('0x102'));db['WhatsappApplication']=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x103'));db[_0x1446('0x104')]=db[_0x1446('0x0')]['import'](_0x1446('0x105'));db['WhatsappMessage']=db['sequelize'][_0x1446('0x12')](_0x1446('0x106'));db[_0x1446('0x107')]=db['sequelize']['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x1446('0x108')]=db['sequelize']['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x1446('0x109')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x10a'));db[_0x1446('0x10b')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/cloudProvider/cloudProvider.model');db[_0x1446('0x10c')]=db[_0x1446('0x0')]['import'](_0x1446('0x10d'));db[_0x1446('0x10e')]=db['sequelize'][_0x1446('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x1446('0x10f')]=db[_0x1446('0x0')][_0x1446('0x12')](_0x1446('0x110'));db[_0x1446('0x111')]=db[_0x1446('0x0')][_0x1446('0x12')]('../api/user-setting/user-setting.model');db[_0x1446('0x11')][_0x1446('0x112')](db['VoiceMail'],{'as':_0x1446('0x1d'),'onDelete':_0x1446('0x113'),'foreignKey':'UserId'});db['User'][_0x1446('0x112')](db[_0x1446('0x111')],{'as':_0x1446('0x114'),'onDelete':'cascade','foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x1446('0x115')});db['User']['hasMany'](db[_0x1446('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db['VoiceExtension'],{'as':_0x1446('0x117'),'onDelete':_0x1446('0x113'),'hooks':!![]});db[_0x1446('0x11')]['hasMany'](db[_0x1446('0x7a')],{'as':_0x1446('0x118'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db[_0x1446('0x119')],{'as':_0x1446('0x11a'),'foreignKey':_0x1446('0x115')});db['User'][_0x1446('0x116')](db[_0x1446('0x7d')],{'as':_0x1446('0x7d'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db[_0x1446('0x11b')],{'as':'OpenchannelInteractions','foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db[_0x1446('0x68')],{'as':'ChatInteractions','foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db[_0x1446('0x57')],{'as':_0x1446('0x11c'),'foreignKey':_0x1446('0x115')});db['User'][_0x1446('0x116')](db[_0x1446('0x11d')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x1446('0x11')]['hasMany'](db[_0x1446('0x40')],{'as':_0x1446('0x11e'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x11')]['hasMany'](db[_0x1446('0x104')],{'as':_0x1446('0x11f'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x11')][_0x1446('0x116')](db[_0x1446('0x120')],{'as':_0x1446('0x121'),'foreignKey':_0x1446('0x122')});db[_0x1446('0x11')][_0x1446('0x123')](db[_0x1446('0xfd')],{'as':_0x1446('0xfd'),'foreignKey':'userProfileId'});db[_0x1446('0x11')][_0x1446('0x124')](db['ChatGroup'],{'as':_0x1446('0x125'),'through':_0x1446('0x126')});db['User'][_0x1446('0x124')](db[_0x1446('0x75')],{'as':_0x1446('0x127'),'through':'cm_user_has_contacts'});db[_0x1446('0x11')]['belongsToMany'](db[_0x1446('0xf9')],{'as':_0x1446('0x128'),'through':_0x1446('0x129')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0xec')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0x1446('0x40')],{'as':_0x1446('0x11e'),'through':_0x1446('0x12a')});db['User'][_0x1446('0x124')](db[_0x1446('0x68')],{'as':_0x1446('0x12b'),'through':_0x1446('0x12c')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x11d')],{'as':_0x1446('0x12d'),'through':_0x1446('0x12e')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x57')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x1446('0x11')][_0x1446('0x124')](db['OpenchannelInteraction'],{'as':_0x1446('0x12f'),'through':_0x1446('0x130')});db['User'][_0x1446('0x124')](db[_0x1446('0x104')],{'as':_0x1446('0x11f'),'through':_0x1446('0x131')});db[_0x1446('0x11')]['belongsToMany'](db['VoiceQueue'],{'as':_0x1446('0x132'),'through':_0x1446('0x2f'),'required':![]});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0xfb')],{'as':_0x1446('0x133'),'through':'UserVoicePrefix','required':![]});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x3c')],{'as':'MailQueues','through':_0x1446('0x31'),'required':![]});db[_0x1446('0x11')]['belongsToMany'](db['ChatQueue'],{'as':_0x1446('0x134'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x1446('0x124')](db[_0x1446('0x135')],{'as':'FaxQueues','through':_0x1446('0x33'),'required':![]});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x5b')],{'as':_0x1446('0x136'),'through':_0x1446('0x35'),'required':![]});db['User'][_0x1446('0x124')](db[_0x1446('0x62')],{'as':'OpenchannelQueues','through':_0x1446('0x36'),'required':![]});db['User'][_0x1446('0x124')](db[_0x1446('0x109')],{'as':'WhatsappQueues','through':_0x1446('0x137'),'required':![]});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0xf9')],{'through':_0x1446('0x129')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x138')],{'as':_0x1446('0x139'),'through':'user_has_chat_websites'});db[_0x1446('0x11')][_0x1446('0x124')](db['FaxAccount'],{'as':_0x1446('0x13a'),'through':_0x1446('0x13b')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x13c')],{'as':_0x1446('0x13d'),'through':_0x1446('0x13e')});db[_0x1446('0x11')]['belongsToMany'](db[_0x1446('0x13f')],{'as':_0x1446('0x140'),'through':_0x1446('0x141')});db[_0x1446('0x11')][_0x1446('0x124')](db[_0x1446('0x54')],{'as':_0x1446('0x142'),'through':_0x1446('0x143')});db[_0x1446('0x11')]['belongsToMany'](db[_0x1446('0x101')],{'as':'WhatsappAccounts','through':_0x1446('0x144')});db['User'][_0x1446('0x124')](db[_0x1446('0xe7')],{'as':_0x1446('0x145'),'through':_0x1446('0x146')});db[_0x1446('0x147')][_0x1446('0x116')](db[_0x1446('0x148')],{'as':'SpiedAgents','onDelete':_0x1446('0x113'),'foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db[_0x1446('0x148')],{'onDelete':_0x1446('0x113')});db[_0x1446('0x148')][_0x1446('0x116')](db[_0x1446('0x148')],{'as':_0x1446('0x149'),'onDelete':_0x1446('0x113')});db[_0x1446('0x14a')][_0x1446('0x124')](db['Sound'],{'as':_0x1446('0x14b'),'through':_0x1446('0x14c')});db[_0x1446('0x17')][_0x1446('0x116')](db[_0x1446('0x2d')],{'as':_0x1446('0x14d'),'foreignKey':_0x1446('0x14e')});db[_0x1446('0x17')][_0x1446('0x116')](db['CmHopper'],{'as':_0x1446('0x14f'),'foreignKey':_0x1446('0x14e')});db[_0x1446('0x17')]['hasMany'](db[_0x1446('0x7a')],{'as':_0x1446('0x118'),'foreignKey':_0x1446('0x14e')});db[_0x1446('0x17')][_0x1446('0x116')](db[_0x1446('0x119')],{'as':_0x1446('0x150'),'foreignKey':_0x1446('0x14e')});db['VoiceQueue']['hasMany'](db[_0x1446('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x1446('0x14e')});db['VoiceQueue'][_0x1446('0x116')](db[_0x1446('0x78')],{'as':'HopperBlacks','foreignKey':_0x1446('0x14e')});db[_0x1446('0x17')][_0x1446('0x116')](db['JscriptySessionReport'],{'as':_0x1446('0x151'),'foreignKey':_0x1446('0x14e')});db[_0x1446('0x17')][_0x1446('0x123')](db[_0x1446('0x2a')],{'as':_0x1446('0x2a'),'foreignKey':_0x1446('0x152')});db['VoiceQueue'][_0x1446('0x123')](db[_0x1446('0x2a')],{'as':_0x1446('0x153'),'foreignKey':'TrunkBackupId'});db[_0x1446('0x17')][_0x1446('0x123')](db[_0x1446('0x89')],{'as':'Interval','foreignKey':_0x1446('0x154')});db[_0x1446('0x17')][_0x1446('0x123')](db[_0x1446('0x8b')],{'as':_0x1446('0x155'),'foreignKey':_0x1446('0x156')});db[_0x1446('0x17')][_0x1446('0x124')](db[_0x1446('0xf9')],{'as':_0x1446('0x128'),'through':'voice_queues_has_cm_lists'});db[_0x1446('0x17')]['belongsToMany'](db['User'],{'as':_0x1446('0x157'),'through':_0x1446('0x2f')});db[_0x1446('0x17')][_0x1446('0x124')](db['Team'],{'as':_0x1446('0x158'),'through':_0x1446('0x10c')});db[_0x1446('0x17')][_0x1446('0x124')](db['CmList'],{'as':_0x1446('0x159'),'through':_0x1446('0x15a')});db[_0x1446('0x19')]['belongsTo'](db[_0x1446('0x11')],{'as':_0x1446('0x11'),'foreignKey':'UserId'});db[_0x1446('0x1b')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x11'),'foreignKey':_0x1446('0x115')});db['VoiceMail'][_0x1446('0x116')](db[_0x1446('0x1f')],{'as':_0x1446('0x15b'),'onDelete':'cascade','foreignKey':_0x1446('0x15c'),'sourceKey':_0x1446('0x15d')});db[_0x1446('0x1f')]['belongsTo'](db[_0x1446('0x1d')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0x1446('0x15e')],{'as':_0x1446('0x15f'),'foreignKey':_0x1446('0x160'),'constraints':![]});db[_0x1446('0x21')][_0x1446('0x116')](db['VoiceAgentReport'],{'as':_0x1446('0x161'),'foreignKey':_0x1446('0x160'),'constraints':![]});db['VoiceCallReport'][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x11'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x21')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':'ContactId'});db['MailServerIn'][_0x1446('0x123')](db[_0x1446('0x13c')],{'as':_0x1446('0x13c'),'foreignKey':_0x1446('0x163')});db[_0x1446('0x38')][_0x1446('0x123')](db[_0x1446('0x10b')],{'as':'CloudProvider','foreignKey':_0x1446('0x164'),'onDelete':_0x1446('0x165')});db[_0x1446('0x166')][_0x1446('0x123')](db['MailAccount'],{'as':_0x1446('0x13c'),'foreignKey':'MailAccountId'});db[_0x1446('0x166')]['belongsTo'](db[_0x1446('0x10b')],{'as':_0x1446('0x10b'),'foreignKey':'CloudProviderId','onDelete':_0x1446('0x165')});db[_0x1446('0x13c')][_0x1446('0x112')](db[_0x1446('0x38')],{'as':'Imap','onDelete':_0x1446('0x113')});db[_0x1446('0x13c')][_0x1446('0x112')](db[_0x1446('0x166')],{'as':_0x1446('0x167'),'onDelete':_0x1446('0x113')});db['MailAccount'][_0x1446('0x116')](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x163'),'onDelete':'cascade'});db[_0x1446('0x13c')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':_0x1446('0x163')});db[_0x1446('0x13c')]['hasMany'](db[_0x1446('0x42')],{'as':_0x1446('0x15b'),'foreignKey':'MailAccountId'});db[_0x1446('0x13c')]['hasMany'](db[_0x1446('0x40')],{'as':_0x1446('0x16a')});db[_0x1446('0x13c')][_0x1446('0x116')](db['MailApplication'],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':'ListId'});db[_0x1446('0x13c')][_0x1446('0x123')](db[_0x1446('0x16c')],{'as':_0x1446('0x16c'),'foreignKey':_0x1446('0x16d')});db[_0x1446('0x13c')][_0x1446('0x123')](db[_0x1446('0x8b')],{'as':_0x1446('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1446('0x13c')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x13e')});db['MailQueue']['belongsToMany'](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x31')});db[_0x1446('0x3c')][_0x1446('0x124')](db[_0x1446('0xec')],{'through':'team_has_mail_queues','as':_0x1446('0x158')});db['MailInteraction']['hasMany'](db[_0x1446('0x42')],{'as':_0x1446('0x15b'),'onDelete':_0x1446('0x113'),'foreignKey':'MailInteractionId'});db[_0x1446('0x40')][_0x1446('0x123')](db[_0x1446('0x13c')],{'as':_0x1446('0x16e'),'foreignKey':'MailAccountId'});db[_0x1446('0x40')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x40')][_0x1446('0x123')](db['User'],{'as':_0x1446('0x170'),'foreignKey':_0x1446('0x115')});db['MailInteraction']['belongsToMany'](db[_0x1446('0x92')],{'through':_0x1446('0x171'),'as':'Tags'});db[_0x1446('0x40')][_0x1446('0x124')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x1446('0x172')});db[_0x1446('0x40')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':_0x1446('0x12a'),'foreignKey':_0x1446('0x174')});db[_0x1446('0x42')][_0x1446('0x116')](db[_0x1446('0xef')],{'as':_0x1446('0x175'),'onDelete':'cascade'});db[_0x1446('0x42')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x11')});db['MailMessage']['belongsTo'](db[_0x1446('0x75')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x162')});db['MailMessage'][_0x1446('0x123')](db['MailInteraction'],{'as':_0x1446('0x176'),'foreignKey':'MailInteractionId'});db[_0x1446('0x42')][_0x1446('0x123')](db[_0x1446('0x13c')],{'as':_0x1446('0x16e'),'foreignKey':'MailAccountId'});db[_0x1446('0x42')][_0x1446('0x123')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0x1446('0x177')});db[_0x1446('0x42')][_0x1446('0x123')](db[_0x1446('0x6c')],{'as':_0x1446('0x6c'),'foreignKey':_0x1446('0x178')});db[_0x1446('0x44')]['belongsTo'](db['User'],{'onDelete':_0x1446('0x165')});db['MailApplication']['belongsTo'](db['MailQueue'],{'onDelete':_0x1446('0x165')});db[_0x1446('0x44')][_0x1446('0x123')](db[_0x1446('0x13c')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x1446('0x89')],{'onDelete':'restrict','foreignKey':_0x1446('0x154')});db[_0x1446('0x44')][_0x1446('0x123')](db[_0x1446('0x92')],{'onDelete':'restrict','foreignKey':_0x1446('0x179')});db['MailQueueReport'][_0x1446('0x123')](db['MailAccount'],{});db['MailQueueReport'][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':'ListId'});db['MailQueueReport'][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x46')]['belongsTo'](db[_0x1446('0x40')],{});db[_0x1446('0x46')][_0x1446('0x123')](db['MailMessage'],{});db[_0x1446('0x46')]['belongsTo'](db['User'],{});db[_0x1446('0x46')]['belongsTo'](db['MailQueue'],{});db[_0x1446('0x48')][_0x1446('0x116')](db[_0x1446('0x17a')],{'as':_0x1446('0x17b'),'onDelete':_0x1446('0x113')});db[_0x1446('0x4b')][_0x1446('0x116')](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x17c'),'onDelete':'cascade'});db[_0x1446('0x4b')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':_0x1446('0x17c')});db[_0x1446('0x4b')][_0x1446('0x116')](db['FaxInteraction'],{'as':_0x1446('0x16a')});db[_0x1446('0x4b')][_0x1446('0x116')](db[_0x1446('0x4d')],{'as':_0x1446('0x149')});db[_0x1446('0x4b')][_0x1446('0x116')](db['VoiceExtension'],{'as':_0x1446('0x17d'),'onDelete':'cascade'});db['FaxAccount'][_0x1446('0x116')](db[_0x1446('0x4f')],{'as':_0x1446('0x15b')});db[_0x1446('0x4b')][_0x1446('0x123')](db[_0x1446('0x2a')],{'as':_0x1446('0x2a')});db[_0x1446('0x4b')][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':'List','foreignKey':_0x1446('0x17e')});db[_0x1446('0x4b')][_0x1446('0x123')](db[_0x1446('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x1446('0x156')});db[_0x1446('0x4b')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x13b')});db['FaxApplication'][_0x1446('0x123')](db[_0x1446('0x11')],{'onDelete':_0x1446('0x165')});db[_0x1446('0x4d')][_0x1446('0x123')](db['FaxQueue'],{'onDelete':_0x1446('0x165')});db[_0x1446('0x4d')][_0x1446('0x123')](db[_0x1446('0x4b')],{'onDelete':_0x1446('0x165')});db['FaxApplication'][_0x1446('0x123')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x1446('0x179')});db['FaxInteraction'][_0x1446('0x116')](db[_0x1446('0x4f')],{'as':_0x1446('0x15b'),'onDelete':'cascade','foreignKey':_0x1446('0x17f')});db[_0x1446('0x11d')][_0x1446('0x123')](db[_0x1446('0x4b')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x17c')});db[_0x1446('0x11d')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x11d')]['belongsTo'](db[_0x1446('0x11')],{'as':_0x1446('0x170'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x11d')][_0x1446('0x124')](db[_0x1446('0x92')],{'through':_0x1446('0x180'),'as':_0x1446('0x181')});db['FaxInteraction'][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x180'),'as':_0x1446('0x172')});db[_0x1446('0x11d')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':_0x1446('0x12e'),'foreignKey':_0x1446('0x17f')});db['FaxMessage'][_0x1446('0x123')](db['User'],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0x1446('0x123')](db[_0x1446('0x11d')],{'as':_0x1446('0x176'),'foreignKey':_0x1446('0x17f')});db[_0x1446('0x4f')][_0x1446('0x123')](db['CmContact'],{'onDelete':'cascade','as':_0x1446('0x162')});db[_0x1446('0x4f')][_0x1446('0x123')](db[_0x1446('0xef')],{'as':_0x1446('0xef'),'foreignKey':_0x1446('0x182')});db['FaxMessage'][_0x1446('0x123')](db['FaxAccount'],{'as':_0x1446('0x16e'),'foreignKey':'FaxAccountId'});db[_0x1446('0x135')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x33')});db['FaxQueue'][_0x1446('0x124')](db[_0x1446('0xec')],{'through':'team_has_fax_queues','as':_0x1446('0x158')});db['FaxQueueReport'][_0x1446('0x123')](db[_0x1446('0x4b')],{});db[_0x1446('0x52')]['belongsTo'](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e')});db[_0x1446('0x52')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':'Contact','foreignKey':_0x1446('0x16f')});db[_0x1446('0x52')][_0x1446('0x123')](db[_0x1446('0x11d')],{});db[_0x1446('0x52')][_0x1446('0x123')](db[_0x1446('0x4f')],{});db[_0x1446('0x52')][_0x1446('0x123')](db['User'],{});db[_0x1446('0x52')][_0x1446('0x123')](db[_0x1446('0x135')],{});db['SmsAccount'][_0x1446('0x116')](db['Disposition'],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x183'),'onDelete':_0x1446('0x113')});db[_0x1446('0x54')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':_0x1446('0x183')});db[_0x1446('0x54')]['hasMany'](db[_0x1446('0x59')],{'as':_0x1446('0x15b'),'foreignKey':_0x1446('0x183')});db[_0x1446('0x54')][_0x1446('0x116')](db['SmsInteraction'],{'as':_0x1446('0x16a')});db[_0x1446('0x54')]['hasMany'](db['SmsApplication'],{'as':_0x1446('0x149')});db[_0x1446('0x54')][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e')});db['SmsAccount'][_0x1446('0x123')](db['Pause'],{'as':_0x1446('0x155'),'foreignKey':_0x1446('0x156')});db[_0x1446('0x54')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':'user_has_sms_accounts'});db[_0x1446('0x56')][_0x1446('0x123')](db[_0x1446('0x11')],{'onDelete':_0x1446('0x165')});db[_0x1446('0x56')][_0x1446('0x123')](db[_0x1446('0x5b')],{'onDelete':_0x1446('0x165')});db['SmsApplication'][_0x1446('0x123')](db[_0x1446('0x54')],{'onDelete':_0x1446('0x165')});db['SmsApplication'][_0x1446('0x123')](db[_0x1446('0x89')],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x154')});db['SmsApplication'][_0x1446('0x123')](db[_0x1446('0x92')],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x179')});db['SmsInteraction'][_0x1446('0x116')](db[_0x1446('0x59')],{'as':'Messages','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x184')});db['SmsInteraction'][_0x1446('0x123')](db[_0x1446('0x54')],{'as':_0x1446('0x16e'),'foreignKey':'SmsAccountId'});db[_0x1446('0x57')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db['SmsInteraction']['belongsTo'](db[_0x1446('0x11')],{'as':_0x1446('0x170'),'foreignKey':_0x1446('0x115')});db[_0x1446('0x57')][_0x1446('0x124')](db[_0x1446('0x92')],{'through':_0x1446('0x185'),'as':'Tags'});db[_0x1446('0x57')]['belongsToMany'](db[_0x1446('0x92')],{'through':_0x1446('0x185'),'as':_0x1446('0x172')});db[_0x1446('0x57')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':_0x1446('0x186'),'foreignKey':'SmsInteractionId'});db[_0x1446('0x59')]['belongsTo'](db['User'],{'as':_0x1446('0x11')});db['SmsMessage'][_0x1446('0x123')](db[_0x1446('0x75')],{'onDelete':'cascade','as':_0x1446('0x162')});db['SmsMessage'][_0x1446('0x123')](db['SmsInteraction'],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x176'),'foreignKey':_0x1446('0x184')});db['SmsMessage'][_0x1446('0x123')](db[_0x1446('0x54')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x183')});db[_0x1446('0x5b')][_0x1446('0x124')](db['User'],{'as':_0x1446('0x157'),'through':_0x1446('0x35'),'foreignKey':_0x1446('0x187')});db[_0x1446('0x5b')][_0x1446('0x124')](db['Team'],{'through':_0x1446('0x188'),'as':_0x1446('0x158')});db[_0x1446('0x13f')]['hasMany'](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x189'),'onDelete':_0x1446('0x113')});db[_0x1446('0x13f')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x1446('0x13f')][_0x1446('0x116')](db[_0x1446('0x11b')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x1446('0x13f')][_0x1446('0x116')](db[_0x1446('0x18a')],{'as':'Messages','foreignKey':_0x1446('0x189')});db[_0x1446('0x13f')][_0x1446('0x116')](db[_0x1446('0x5e')],{'as':_0x1446('0x149'),'foreignKey':_0x1446('0x189')});db[_0x1446('0x13f')]['belongsTo'](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e')});db[_0x1446('0x13f')]['belongsTo'](db[_0x1446('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x1446('0x13f')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x1446('0x123')](db[_0x1446('0x11')],{'onDelete':_0x1446('0x165')});db[_0x1446('0x5e')]['belongsTo'](db[_0x1446('0x62')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x1446('0x5e')][_0x1446('0x123')](db[_0x1446('0x13f')],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x189')});db['OpenchannelApplication'][_0x1446('0x123')](db[_0x1446('0x89')],{'onDelete':_0x1446('0x165'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x1446('0x123')](db['Tag'],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x179')});db[_0x1446('0x11b')][_0x1446('0x116')](db['OpenchannelMessage'],{'as':_0x1446('0x15b'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x18b')});db[_0x1446('0x11b')][_0x1446('0x123')](db[_0x1446('0x13f')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x189')});db[_0x1446('0x11b')][_0x1446('0x123')](db['CmContact'],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x11b')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x170'),'foreignKey':_0x1446('0x115')});db['OpenchannelInteraction'][_0x1446('0x124')](db[_0x1446('0x92')],{'through':_0x1446('0x18c'),'as':'Tags'});db[_0x1446('0x11b')][_0x1446('0x124')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction'][_0x1446('0x124')](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x1446('0x18b')});db[_0x1446('0x18a')]['belongsTo'](db[_0x1446('0x11')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x11')});db[_0x1446('0x18a')]['belongsTo'](db[_0x1446('0x75')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x162')});db[_0x1446('0x18a')]['belongsTo'](db[_0x1446('0x11b')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x176'),'foreignKey':_0x1446('0x18b')});db[_0x1446('0x18a')]['belongsTo'](db[_0x1446('0xef')],{'as':_0x1446('0xef'),'foreignKey':_0x1446('0x182')});db[_0x1446('0x18a')][_0x1446('0x123')](db[_0x1446('0x13f')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x189')});db[_0x1446('0x62')][_0x1446('0x124')](db['User'],{'as':'Agents','through':_0x1446('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x1446('0x62')]['belongsToMany'](db[_0x1446('0xec')],{'through':_0x1446('0x18d'),'as':_0x1446('0x158')});db[_0x1446('0x138')][_0x1446('0x116')](db[_0x1446('0x85')],{'as':'Dispositions','foreignKey':_0x1446('0x177'),'onDelete':'cascade'});db[_0x1446('0x138')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':_0x1446('0x177')});db[_0x1446('0x138')]['hasMany'](db['ChatProactiveAction'],{'as':_0x1446('0x18e')});db['ChatWebsite']['hasMany'](db[_0x1446('0x68')],{'as':_0x1446('0x16a')});db[_0x1446('0x138')][_0x1446('0x116')](db[_0x1446('0x66')],{'as':_0x1446('0x149')});db['ChatWebsite']['hasMany'](db[_0x1446('0x6a')],{'as':_0x1446('0x15b')});db[_0x1446('0x138')]['belongsTo'](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e')});db[_0x1446('0x138')][_0x1446('0x123')](db['Interval'],{'as':_0x1446('0x89'),'foreignKey':_0x1446('0x154')});db[_0x1446('0x138')][_0x1446('0x123')](db[_0x1446('0x13c')],{'as':'MailAccount','foreignKey':_0x1446('0x163')});db[_0x1446('0x138')]['belongsTo'](db['Pause'],{'as':_0x1446('0x155'),'foreignKey':_0x1446('0x156')});db['ChatWebsite'][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x18f')});db[_0x1446('0x190')]['belongsTo'](db[_0x1446('0x13f')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':'ListId'});db[_0x1446('0x190')][_0x1446('0x123')](db['CmContact'],{'as':'Contact','foreignKey':_0x1446('0x16f')});db[_0x1446('0x190')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x1446('0x190')][_0x1446('0x123')](db[_0x1446('0x18a')],{});db['OpenchannelQueueReport'][_0x1446('0x123')](db[_0x1446('0x11')],{});db[_0x1446('0x190')][_0x1446('0x123')](db[_0x1446('0x62')],{});db['ChatApplication'][_0x1446('0x123')](db['User'],{'as':_0x1446('0x191'),'foreignKey':_0x1446('0x115'),'onDelete':'restrict'});db[_0x1446('0x66')][_0x1446('0x123')](db[_0x1446('0x6e')],{'as':_0x1446('0x192'),'foreignKey':'ChatQueueId','onDelete':_0x1446('0x165')});db[_0x1446('0x66')]['belongsTo'](db[_0x1446('0x138')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x1446('0x165')});db['ChatApplication'][_0x1446('0x123')](db[_0x1446('0x92')],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x179')});db['ChatInteraction'][_0x1446('0x116')](db['ChatMessage'],{'as':_0x1446('0x15b'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x193')});db[_0x1446('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x177')});db[_0x1446('0x68')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':'Contact','foreignKey':_0x1446('0x16f')});db[_0x1446('0x68')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':'Owner','foreignKey':_0x1446('0x115')});db[_0x1446('0x68')][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x194'),'as':_0x1446('0x181')});db[_0x1446('0x68')][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x194'),'as':_0x1446('0x172')});db['ChatInteraction'][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':_0x1446('0x12c'),'foreignKey':_0x1446('0x193')});db[_0x1446('0x6a')][_0x1446('0x123')](db[_0x1446('0x11')],{'onDelete':_0x1446('0x113'),'as':'User'});db[_0x1446('0x6a')][_0x1446('0x123')](db[_0x1446('0x75')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x6a')]['belongsTo'](db[_0x1446('0x68')],{'onDelete':'cascade','as':_0x1446('0x176'),'foreignKey':_0x1446('0x193')});db['ChatMessage']['belongsTo'](db[_0x1446('0xef')],{'as':'Attachment','foreignKey':_0x1446('0x182')});db[_0x1446('0x6a')][_0x1446('0x123')](db[_0x1446('0x138')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x177')});db['ChatOfflineMessage'][_0x1446('0x116')](db[_0x1446('0xef')],{'as':_0x1446('0x175'),'foreignKey':_0x1446('0x178'),'onDelete':_0x1446('0x113'),'hooks':!![]});db[_0x1446('0x6c')][_0x1446('0x123')](db[_0x1446('0x75')],{'onDelete':_0x1446('0x113'),'as':'Contact','foreignKey':_0x1446('0x16f')});db[_0x1446('0x6c')][_0x1446('0x123')](db['ChatWebsite'],{'as':_0x1446('0x16e'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x1446('0x124')](db['User'],{'as':_0x1446('0x157'),'through':_0x1446('0x195'),'hooks':!![]});db['ChatQueue'][_0x1446('0x124')](db[_0x1446('0xec')],{'through':_0x1446('0x196'),'as':_0x1446('0x158')});db['ChatGroup'][_0x1446('0x116')](db[_0x1446('0x197')],{'as':_0x1446('0x15b'),'foreignKey':_0x1446('0x198'),'onDelete':'cascade'});db['ChatGroup']['belongsToMany'](db['User'],{'as':_0x1446('0x14d'),'through':_0x1446('0x126')});db[_0x1446('0x71')]['belongsTo'](db[_0x1446('0x138')],{'as':_0x1446('0x199'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x1446('0x75')],{'as':_0x1446('0x127'),'foreignKey':_0x1446('0x19a')});db['CmContact'][_0x1446('0x116')](db[_0x1446('0x96')],{'as':'Phones','foreignKey':'CmContactId'});db[_0x1446('0x75')][_0x1446('0x116')](db[_0x1446('0x19b')],{'as':_0x1446('0x14f'),'foreignKey':'ContactId'});db[_0x1446('0x75')][_0x1446('0x116')](db[_0x1446('0x7a')],{'as':_0x1446('0x118'),'foreignKey':_0x1446('0x16f')});db['CmContact']['hasMany'](db[_0x1446('0x119')],{'as':_0x1446('0x150'),'foreignKey':'ContactId'});db[_0x1446('0x75')][_0x1446('0x116')](db[_0x1446('0x7d')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x1446('0x75')]['hasMany'](db[_0x1446('0xde')],{'as':'JscriptySessions','foreignKey':_0x1446('0x16f')});db[_0x1446('0x75')][_0x1446('0x116')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x1446('0x165')});db[_0x1446('0x75')]['hasMany'](db[_0x1446('0x68')],{'as':'ChatInteractions','foreignKey':_0x1446('0x16f'),'onDelete':_0x1446('0x165')});db[_0x1446('0x75')][_0x1446('0x116')](db['SmsInteraction'],{'as':_0x1446('0x11c'),'foreignKey':_0x1446('0x16f'),'onDelete':'restrict'});db[_0x1446('0x75')][_0x1446('0x116')](db['FaxInteraction'],{'as':_0x1446('0x12d'),'foreignKey':_0x1446('0x16f'),'onDelete':'restrict'});db[_0x1446('0x75')][_0x1446('0x116')](db['MailInteraction'],{'as':_0x1446('0x11e'),'foreignKey':_0x1446('0x16f'),'onDelete':_0x1446('0x165')});db[_0x1446('0x75')][_0x1446('0x123')](db[_0x1446('0x73')],{'as':'Company','foreignKey':'CompanyId'});db[_0x1446('0x75')]['belongsTo'](db[_0x1446('0xf9')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmContact']['belongsToMany'](db['User'],{'as':_0x1446('0x173'),'through':_0x1446('0x19c')});db[_0x1446('0x75')][_0x1446('0x124')](db[_0x1446('0x92')],{'as':'Tags','through':_0x1446('0x19d')});db[_0x1446('0x75')][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x19d'),'as':_0x1446('0x172')});db[_0x1446('0x19b')][_0x1446('0x116')](db[_0x1446('0x98')],{'as':_0x1446('0x19e'),'foreignKey':_0x1446('0x19f')});db[_0x1446('0x19b')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f'),'onDelete':'cascade'});db[_0x1446('0x19b')][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e'),'onDelete':_0x1446('0x113')});db[_0x1446('0x19b')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0x1446('0x115')});db[_0x1446('0x19b')]['belongsTo'](db[_0x1446('0x17')],{'as':_0x1446('0x192'),'foreignKey':_0x1446('0x14e'),'onDelete':'cascade'});db[_0x1446('0x19b')][_0x1446('0x123')](db[_0x1446('0x1a0')],{'as':_0x1446('0x1a0'),'foreignKey':'CampaignId','onDelete':_0x1446('0x113')});db[_0x1446('0x19b')]['belongsTo'](db[_0x1446('0x11')],{'as':_0x1446('0x170'),'foreignKey':'OwnerId'});db[_0x1446('0x78')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x1446('0x16f'),'onDelete':_0x1446('0x113')});db['CmHopperBlack'][_0x1446('0x123')](db['CmList'],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e'),'onDelete':_0x1446('0x113')});db[_0x1446('0x78')]['belongsTo'](db[_0x1446('0x17')],{'as':_0x1446('0x192'),'foreignKey':_0x1446('0x14e'),'onDelete':_0x1446('0x113')});db[_0x1446('0x78')][_0x1446('0x123')](db[_0x1446('0x1a0')],{'as':_0x1446('0x1a0'),'foreignKey':_0x1446('0x1a1'),'onDelete':_0x1446('0x113')});db[_0x1446('0x81')][_0x1446('0x116')](db[_0x1446('0x87')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0x1446('0x1a2'),'onDelete':'cascade','hooks':!![]});db[_0x1446('0x81')]['hasMany'](db[_0x1446('0x87')],{'as':{'plural':_0x1446('0x1a3'),'singular':_0x1446('0x1a4')},'foreignKey':'AutomationAnyId','onDelete':_0x1446('0x113'),'hooks':!![]});db['Automation'][_0x1446('0x116')](db['Action'],{'as':_0x1446('0x1a5'),'foreignKey':_0x1446('0x1a6'),'onDelete':_0x1446('0x113'),'hooks':!![]});db[_0x1446('0x85')][_0x1446('0x116')](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x1a7'),'onDelete':_0x1446('0x113')});db[_0x1446('0x89')]['hasMany'](db['Interval'],{'as':'Intervals','foreignKey':_0x1446('0x154'),'onDelete':_0x1446('0x113'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x1446('0x148')],{'as':_0x1446('0x117'),'foreignKey':'IntervalId','onDelete':_0x1446('0x165')});db[_0x1446('0x89')]['hasMany'](db[_0x1446('0x44')],{'as':_0x1446('0x1a8'),'foreignKey':_0x1446('0x154')});db[_0x1446('0x89')][_0x1446('0x116')](db[_0x1446('0x66')],{'as':'ChatApplications','foreignKey':_0x1446('0x154')});db[_0x1446('0x89')][_0x1446('0x116')](db[_0x1446('0x4d')],{'as':_0x1446('0x1a9'),'foreignKey':'IntervalId'});db['Interval'][_0x1446('0x116')](db[_0x1446('0x56')],{'as':'SmsApplications','foreignKey':_0x1446('0x154')});db[_0x1446('0x8f')][_0x1446('0x123')](db[_0x1446('0x13c')],{});db[_0x1446('0x8f')][_0x1446('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0x1446('0x1aa')});db['Schedule'][_0x1446('0x123')](db[_0x1446('0x1ab')],{'foreignKey':_0x1446('0x1ac')});db[_0x1446('0x90')][_0x1446('0x124')](db['VoiceMusicOnHold'],{'as':_0x1446('0x1ad'),'through':_0x1446('0x14c'),'onDelete':_0x1446('0x165')});db[_0x1446('0x92')]['belongsToMany'](db[_0x1446('0x75')],{'through':_0x1446('0x19d')});db[_0x1446('0x92')]['belongsToMany'](db['ChatInteraction'],{'through':_0x1446('0x194')});db['Tag'][_0x1446('0x124')](db[_0x1446('0x40')],{'through':'mail_interaction_has_tags'});db[_0x1446('0x92')][_0x1446('0x124')](db[_0x1446('0x57')],{'through':_0x1446('0x185')});db[_0x1446('0x92')][_0x1446('0x124')](db[_0x1446('0x11d')],{'through':_0x1446('0x180')});db[_0x1446('0x92')][_0x1446('0x124')](db['OpenchannelInteraction'],{'through':_0x1446('0x18c')});db[_0x1446('0x92')]['belongsToMany'](db[_0x1446('0x104')],{'through':_0x1446('0x1ae')});db[_0x1446('0x96')][_0x1446('0x123')](db[_0x1446('0x94')],{'as':'ItemType','foreignKey':_0x1446('0x1af')});db['CmHopperAdditionalPhone'][_0x1446('0x123')](db[_0x1446('0x19b')],{'as':'Hopper','foreignKey':_0x1446('0x19f')});db[_0x1446('0x96')][_0x1446('0x123')](db['CmContact'],{'as':_0x1446('0x162'),'foreignKey':'CmContactId'});db[_0x1446('0x9b')][_0x1446('0x116')](db[_0x1446('0x87')],{'as':{'plural':_0x1446('0x1b0'),'singular':_0x1446('0x1b1')},'foreignKey':_0x1446('0x1b2'),'onDelete':_0x1446('0x113'),'hooks':!![]});db['Trigger'][_0x1446('0x116')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x1446('0x113'),'hooks':!![]});db[_0x1446('0x9b')][_0x1446('0x116')](db[_0x1446('0x7f')],{'as':_0x1446('0x1a5'),'foreignKey':_0x1446('0x1b3'),'onDelete':_0x1446('0x113'),'hooks':!![]});db[_0x1446('0x1ab')]['hasMany'](db[_0x1446('0xa7')],{'as':'Fields','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1ac'),'hooks':!![]});db[_0x1446('0xa2')][_0x1446('0x116')](db['AnalyticFieldReport'],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1aa')});db[_0x1446('0xa5')][_0x1446('0x116')](db[_0x1446('0xa7')],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b5')});db[_0x1446('0xa7')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x1446('0x1b5')});db['SalesforceAccount'][_0x1446('0x116')](db[_0x1446('0x1b6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1446('0x1b7')});db['SalesforceConfiguration'][_0x1446('0x116')](db[_0x1446('0x1b8')],{'as':_0x1446('0x1b9'),'onDelete':_0x1446('0x113'),'foreignKey':'SubjectId'});db[_0x1446('0x1b6')][_0x1446('0x116')](db[_0x1446('0x1b8')],{'as':_0x1446('0x1ba'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1b6')][_0x1446('0x116')](db[_0x1446('0x1b8')],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bc')});db['SalesforceConfiguration'][_0x1446('0x123')](db[_0x1446('0xa9')],{'as':_0x1446('0x16e'),'foreignKey':'AccountId'});db[_0x1446('0x1b8')][_0x1446('0x116')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x1446('0x1bd')});db['SalesforceField'][_0x1446('0x116')](db[_0x1446('0x1b8')],{'as':'Description','foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1b8')]['hasMany'](db['SalesforceField'],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0x1b8')][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':'Variable','foreignKey':_0x1446('0x1bf')});db[_0x1446('0xad')][_0x1446('0x116')](db[_0x1446('0xaf')],{'as':_0x1446('0x1c0'),'onDelete':'cascade','foreignKey':_0x1446('0x1b7')});db[_0x1446('0xaf')][_0x1446('0x116')](db[_0x1446('0x1c1')],{'as':_0x1446('0x1b9'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xaf')][_0x1446('0x116')](db[_0x1446('0x1c1')],{'as':_0x1446('0x1ba'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bb')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0xaf')][_0x1446('0x123')](db[_0x1446('0xad')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0x1c1')]['hasMany'](db['SugarcrmField'],{'as':_0x1446('0x1c2'),'foreignKey':'SubjectId'});db['SugarcrmField']['hasMany'](db[_0x1446('0x1c1')],{'as':_0x1446('0x1c3'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x1446('0x116')](db['SugarcrmField'],{'as':'Field','foreignKey':_0x1446('0x1bc')});db[_0x1446('0x1c1')][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':'Variable','foreignKey':_0x1446('0x1bf')});db[_0x1446('0x1c4')][_0x1446('0x116')](db[_0x1446('0xb3')],{'as':'Configurations','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xb3')][_0x1446('0x116')](db[_0x1446('0xb5')],{'as':_0x1446('0x1b9'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bd')});db['DeskConfiguration']['hasMany'](db[_0x1446('0xb5')],{'as':_0x1446('0x1ba'),'onDelete':'cascade','foreignKey':_0x1446('0x1bb')});db[_0x1446('0xb3')][_0x1446('0x116')](db[_0x1446('0xb5')],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':'FieldId'});db[_0x1446('0xb3')][_0x1446('0x123')](db[_0x1446('0x1c4')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xb3')]['belongsToMany'](db[_0x1446('0x92')],{'through':_0x1446('0x1c5')});db[_0x1446('0xb5')]['hasMany'](db[_0x1446('0xb5')],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xb5')][_0x1446('0x116')](db[_0x1446('0xb5')],{'as':_0x1446('0x1c3'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0xb5')][_0x1446('0x116')](db[_0x1446('0xb5')],{'as':'Field','foreignKey':'FieldId'});db[_0x1446('0xb5')][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':'Variable','foreignKey':_0x1446('0x1bf')});db['ZohoAccount'][_0x1446('0x116')](db['ZohoConfiguration'],{'as':_0x1446('0x1c0'),'onDelete':'cascade','foreignKey':_0x1446('0x1b7')});db[_0x1446('0xb9')][_0x1446('0x116')](db[_0x1446('0xba')],{'as':_0x1446('0x1b9'),'onDelete':_0x1446('0x113'),'foreignKey':'SubjectId'});db[_0x1446('0xb9')][_0x1446('0x116')](db[_0x1446('0xba')],{'as':_0x1446('0x1ba'),'onDelete':'cascade','foreignKey':_0x1446('0x1bb')});db['ZohoConfiguration']['hasMany'](db[_0x1446('0xba')],{'as':_0x1446('0x1b4'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bc')});db['ZohoConfiguration'][_0x1446('0x123')](db['ZohoAccount'],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xba')][_0x1446('0x116')](db[_0x1446('0xba')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0x1446('0x116')](db[_0x1446('0xba')],{'as':_0x1446('0x1c3'),'foreignKey':'DescriptionId'});db['ZohoField'][_0x1446('0x116')](db[_0x1446('0xba')],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0xba')][_0x1446('0x123')](db['Variable'],{'as':_0x1446('0x9d'),'foreignKey':'VariableId'});db[_0x1446('0xbc')][_0x1446('0x116')](db[_0x1446('0xbe')],{'as':_0x1446('0x1c0'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b7')});db['ZendeskConfiguration'][_0x1446('0x116')](db[_0x1446('0xc0')],{'as':'Subjects','foreignKey':_0x1446('0x1bd')});db['ZendeskConfiguration'][_0x1446('0x116')](db['ZendeskField'],{'as':_0x1446('0x1ba'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0xbe')][_0x1446('0x116')](db['ZendeskField'],{'as':_0x1446('0x1b4'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0xbe')][_0x1446('0x123')](db[_0x1446('0xbc')],{'as':'Account','foreignKey':_0x1446('0x1b7')});db[_0x1446('0xbe')][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x1c6')});db[_0x1446('0xc0')][_0x1446('0x116')](db['ZendeskField'],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xc0')][_0x1446('0x116')](db[_0x1446('0xc0')],{'as':_0x1446('0x1c3'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0xc0')][_0x1446('0x116')](db[_0x1446('0xc0')],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0xc0')][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':_0x1446('0x9d'),'foreignKey':_0x1446('0x1bf')});db['FreshdeskAccount'][_0x1446('0x116')](db[_0x1446('0xc4')],{'as':_0x1446('0x1c0'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xc4')][_0x1446('0x116')](db[_0x1446('0x1c7')],{'as':_0x1446('0x1b9'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xc4')][_0x1446('0x116')](db[_0x1446('0x1c7')],{'as':_0x1446('0x1ba'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bb')});db['FreshdeskConfiguration'][_0x1446('0x116')](db[_0x1446('0x1c7')],{'as':'Fields','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0xc4')][_0x1446('0x123')](db[_0x1446('0xc2')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xc4')][_0x1446('0x124')](db[_0x1446('0x92')],{'through':_0x1446('0x1c8')});db[_0x1446('0x1c7')][_0x1446('0x116')](db['FreshdeskField'],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0x1c7')][_0x1446('0x116')](db[_0x1446('0x1c7')],{'as':_0x1446('0x1c3'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1c7')]['hasMany'](db['FreshdeskField'],{'as':_0x1446('0x1be'),'foreignKey':'FieldId'});db[_0x1446('0x1c7')][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':_0x1446('0x9d'),'foreignKey':_0x1446('0x1bf')});db['VtigerAccount'][_0x1446('0x116')](db[_0x1446('0xc7')],{'as':_0x1446('0x1c0'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b7')});db['VtigerConfiguration'][_0x1446('0x116')](db[_0x1446('0x1c9')],{'as':_0x1446('0x1b9'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xc7')][_0x1446('0x116')](db[_0x1446('0x1c9')],{'as':'Descriptions','foreignKey':_0x1446('0x1bb')});db[_0x1446('0xc7')][_0x1446('0x116')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x1446('0xc7')]['belongsTo'](db[_0x1446('0x1ca')],{'as':_0x1446('0x16e'),'foreignKey':'AccountId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0x1c9')][_0x1446('0x116')](db[_0x1446('0x1c9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1446('0x1c9')][_0x1446('0x116')](db[_0x1446('0x1c9')],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db[_0x1446('0x1c9')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x1446('0x1bf')});db[_0x1446('0xca')][_0x1446('0x116')](db[_0x1446('0x1cb')],{'as':_0x1446('0x1c0'),'onDelete':_0x1446('0x113'),'foreignKey':'AccountId'});db[_0x1446('0x1cb')][_0x1446('0x116')](db[_0x1446('0x1cc')],{'as':_0x1446('0x1b9'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0x1cb')][_0x1446('0x116')](db[_0x1446('0x1cc')],{'as':_0x1446('0x1ba'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1cb')]['hasMany'](db['ServicenowField'],{'as':_0x1446('0x1b4'),'foreignKey':_0x1446('0x1bc')});db['ServicenowConfiguration'][_0x1446('0x123')](db[_0x1446('0xca')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0x1cc')][_0x1446('0x116')](db[_0x1446('0x1cc')],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db['ServicenowField'][_0x1446('0x116')](db[_0x1446('0x1cc')],{'as':_0x1446('0x1c3'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1cc')][_0x1446('0x116')](db[_0x1446('0x1cc')],{'as':_0x1446('0x1be'),'foreignKey':'FieldId'});db[_0x1446('0x1cc')]['belongsTo'](db[_0x1446('0x9d')],{'as':_0x1446('0x9d'),'foreignKey':_0x1446('0x1bf')});db[_0x1446('0xce')][_0x1446('0x116')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0xce')][_0x1446('0x123')](db[_0x1446('0x10b')],{'as':_0x1446('0x10b'),'foreignKey':_0x1446('0x164')});db[_0x1446('0xd0')][_0x1446('0x116')](db[_0x1446('0x1cd')],{'as':_0x1446('0x1b9'),'onDelete':'cascade','foreignKey':_0x1446('0x1bd')});db[_0x1446('0xd0')][_0x1446('0x116')](db[_0x1446('0x1cd')],{'as':_0x1446('0x1ba'),'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0xd0')]['hasMany'](db[_0x1446('0x1cd')],{'as':_0x1446('0x1b4'),'onDelete':'cascade','foreignKey':_0x1446('0x1bc')});db[_0x1446('0xd0')]['belongsTo'](db[_0x1446('0xce')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db['Dynamics365Field']['hasMany'](db[_0x1446('0x1cd')],{'as':_0x1446('0x1c2'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0x1cd')][_0x1446('0x116')](db[_0x1446('0x1cd')],{'as':'Description','foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1cd')][_0x1446('0x116')](db['Dynamics365Field'],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db['Dynamics365Field'][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':_0x1446('0x9d'),'foreignKey':_0x1446('0x1bf')});db[_0x1446('0xd3')][_0x1446('0x116')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1446('0x1b7')});db[_0x1446('0xd5')][_0x1446('0x116')](db[_0x1446('0x1ce')],{'as':_0x1446('0x1b9'),'foreignKey':_0x1446('0x1bd')});db[_0x1446('0xd5')][_0x1446('0x116')](db['FreshsalesField'],{'as':_0x1446('0x1ba'),'foreignKey':'DescriptionId'});db[_0x1446('0xd5')][_0x1446('0x116')](db[_0x1446('0x1ce')],{'as':_0x1446('0x1b4'),'foreignKey':_0x1446('0x1bc')});db['FreshsalesConfiguration']['belongsTo'](db[_0x1446('0xd3')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1b7')});db[_0x1446('0x1ce')][_0x1446('0x116')](db[_0x1446('0x1ce')],{'as':'Subject','foreignKey':_0x1446('0x1bd')});db[_0x1446('0x1ce')][_0x1446('0x116')](db[_0x1446('0x1ce')],{'as':_0x1446('0x1c3'),'foreignKey':_0x1446('0x1bb')});db[_0x1446('0x1ce')]['hasMany'](db[_0x1446('0x1ce')],{'as':_0x1446('0x1be'),'foreignKey':_0x1446('0x1bc')});db['FreshsalesField'][_0x1446('0x123')](db[_0x1446('0x9d')],{'as':_0x1446('0x9d'),'foreignKey':_0x1446('0x1bf')});db[_0x1446('0xd9')]['belongsTo'](db[_0x1446('0x138')],{});db[_0x1446('0xd9')][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':_0x1446('0x16b'),'foreignKey':_0x1446('0x17e')});db['ChatQueueReport'][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x1446('0x68')],{});db[_0x1446('0xd9')][_0x1446('0x123')](db[_0x1446('0x6a')],{});db[_0x1446('0xd9')][_0x1446('0x123')](db[_0x1446('0x11')],{});db['ChatQueueReport'][_0x1446('0x123')](db[_0x1446('0x6e')],{});db['ChatInternalMessage'][_0x1446('0x123')](db['User'],{'onDelete':_0x1446('0x113'),'foreignKey':'FromId'});db[_0x1446('0x197')][_0x1446('0x123')](db[_0x1446('0x11')],{'onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1cf')});db['JscriptySessionReport'][_0x1446('0x116')](db[_0x1446('0xdc')],{'foreignKey':_0x1446('0x1d0'),'onDelete':'cascade'});db[_0x1446('0xde')][_0x1446('0x116')](db[_0x1446('0x1d1')],{'foreignKey':_0x1446('0x1d0'),'onDelete':'cascade'});db['SmsQueueReport'][_0x1446('0x123')](db[_0x1446('0x54')],{});db[_0x1446('0xdf')][_0x1446('0x123')](db[_0x1446('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0x1446('0xdf')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':'Contact','foreignKey':_0x1446('0x16f')});db[_0x1446('0xdf')][_0x1446('0x123')](db['SmsInteraction'],{});db[_0x1446('0xdf')][_0x1446('0x123')](db['SmsMessage'],{});db[_0x1446('0xdf')][_0x1446('0x123')](db[_0x1446('0x11')],{});db[_0x1446('0xdf')][_0x1446('0x123')](db[_0x1446('0x5b')],{});db[_0x1446('0xe4')][_0x1446('0x116')](db[_0x1446('0xde')],{'foreignKey':'ProjectId'});db[_0x1446('0xe4')][_0x1446('0x116')](db[_0x1446('0xdc')],{'foreignKey':'ProjectId'});db[_0x1446('0xe4')]['hasMany'](db[_0x1446('0x1d1')],{'foreignKey':_0x1446('0x1d2')});db[_0x1446('0xe7')]['belongsToMany'](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':_0x1446('0x146')});db['Team'][_0x1446('0x124')](db['User'],{'as':_0x1446('0x157'),'through':_0x1446('0x1d3')});db[_0x1446('0xec')][_0x1446('0x124')](db[_0x1446('0x17')],{'through':'TeamVoiceQueue','as':_0x1446('0x132')});db[_0x1446('0xec')][_0x1446('0x124')](db[_0x1446('0x3c')],{'through':_0x1446('0x1d4'),'as':'MailQueues'});db[_0x1446('0xec')][_0x1446('0x124')](db[_0x1446('0x6e')],{'through':'team_has_chat_queues','as':_0x1446('0x134')});db[_0x1446('0xec')]['belongsToMany'](db['FaxQueue'],{'through':_0x1446('0x1d5'),'as':_0x1446('0x1d6')});db[_0x1446('0xec')][_0x1446('0x124')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x1446('0x136')});db[_0x1446('0xec')]['belongsToMany'](db[_0x1446('0x62')],{'through':_0x1446('0x18d'),'as':'OpenchannelQueues'});db[_0x1446('0xec')][_0x1446('0x124')](db[_0x1446('0x109')],{'through':_0x1446('0x1d7'),'as':_0x1446('0x1d8')});db[_0x1446('0xec')][_0x1446('0x124')](db[_0x1446('0xfb')],{'through':_0x1446('0x10e'),'as':'VoicePrefixes'});db['Campaign'][_0x1446('0x116')](db[_0x1446('0x19b')],{'as':_0x1446('0x14f'),'foreignKey':'CampaignId'});db[_0x1446('0x1a0')][_0x1446('0x116')](db[_0x1446('0x7a')],{'as':_0x1446('0x118'),'foreignKey':_0x1446('0x1a1')});db['Campaign'][_0x1446('0x116')](db[_0x1446('0x119')],{'as':_0x1446('0x150'),'foreignKey':_0x1446('0x1a1')});db[_0x1446('0x1a0')][_0x1446('0x116')](db[_0x1446('0x78')],{'as':_0x1446('0x1d9'),'foreignKey':'CampaignId'});db['Campaign'][_0x1446('0x123')](db[_0x1446('0x2a')],{'as':_0x1446('0x2a'),'foreignKey':'TrunkId'});db[_0x1446('0x1a0')][_0x1446('0x123')](db[_0x1446('0x2a')],{'as':_0x1446('0x153'),'foreignKey':_0x1446('0x1da')});db['Campaign']['belongsTo'](db[_0x1446('0x89')],{'as':'Interval','foreignKey':_0x1446('0x154')});db['Campaign'][_0x1446('0x123')](db[_0x1446('0xe7')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x1446('0x1a0')][_0x1446('0x124')](db['CmList'],{'as':_0x1446('0x128'),'through':'campaigns_has_cm_lists'});db[_0x1446('0x1a0')][_0x1446('0x124')](db[_0x1446('0xf9')],{'as':_0x1446('0x159'),'through':_0x1446('0x1db')});db[_0x1446('0xef')][_0x1446('0x123')](db[_0x1446('0x6c')],{'as':'ChatOfflineMessage','foreignKey':_0x1446('0x178')});db[_0x1446('0xf3')][_0x1446('0x123')](db[_0x1446('0x42')],{});db[_0x1446('0xf3')][_0x1446('0x123')](db[_0x1446('0x40')],{});db[_0x1446('0xf3')][_0x1446('0x123')](db['MailAccount'],{'foreignKey':_0x1446('0x1dc'),'as':'FromAccount'});db[_0x1446('0xf3')][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1dd'),'as':_0x1446('0x1de')});db[_0x1446('0xf3')][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1df'),'as':'ToAgent'});db[_0x1446('0xf3')][_0x1446('0x123')](db[_0x1446('0x3c')],{'foreignKey':_0x1446('0x1e0'),'as':_0x1446('0x1e1')});db[_0x1446('0xf3')][_0x1446('0x123')](db[_0x1446('0x13c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport'][_0x1446('0x123')](db[_0x1446('0x6a')],{});db[_0x1446('0x1e2')][_0x1446('0x123')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x1446('0x123')](db[_0x1446('0x138')],{'foreignKey':_0x1446('0x1e3'),'as':_0x1446('0x1e4')});db[_0x1446('0x1e2')]['belongsTo'](db[_0x1446('0x11')],{'foreignKey':_0x1446('0x1dd'),'as':'FromAgent'});db[_0x1446('0x1e2')][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1df'),'as':_0x1446('0x1e5')});db[_0x1446('0x1e2')][_0x1446('0x123')](db[_0x1446('0x6e')],{'foreignKey':_0x1446('0x1e6'),'as':_0x1446('0x1e1')});db['ChatTransferReport'][_0x1446('0x123')](db[_0x1446('0x138')],{'foreignKey':_0x1446('0x1e7'),'as':_0x1446('0x1e8')});db[_0x1446('0xf6')][_0x1446('0x123')](db[_0x1446('0x4f')],{});db[_0x1446('0xf6')][_0x1446('0x123')](db[_0x1446('0x11d')],{});db[_0x1446('0xf6')][_0x1446('0x123')](db[_0x1446('0x4b')],{'foreignKey':_0x1446('0x1e9'),'as':_0x1446('0x1e4')});db[_0x1446('0xf6')][_0x1446('0x123')](db[_0x1446('0x11')],{'foreignKey':'FromUserId','as':_0x1446('0x1de')});db[_0x1446('0xf6')][_0x1446('0x123')](db[_0x1446('0x11')],{'foreignKey':_0x1446('0x1df'),'as':_0x1446('0x1e5')});db[_0x1446('0xf6')]['belongsTo'](db[_0x1446('0x135')],{'foreignKey':_0x1446('0x1ea'),'as':_0x1446('0x1e1')});db['FaxTransferReport']['belongsTo'](db[_0x1446('0x4b')],{'foreignKey':_0x1446('0x1eb'),'as':_0x1446('0x1e8')});db['OpenchannelTransferReport']['belongsTo'](db[_0x1446('0x18a')],{});db[_0x1446('0x1ec')][_0x1446('0x123')](db[_0x1446('0x11b')],{});db[_0x1446('0x1ec')]['belongsTo'](db[_0x1446('0x13f')],{'foreignKey':_0x1446('0x1ed'),'as':_0x1446('0x1e4')});db[_0x1446('0x1ec')][_0x1446('0x123')](db[_0x1446('0x11')],{'foreignKey':_0x1446('0x1dd'),'as':'FromAgent'});db[_0x1446('0x1ec')][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1df'),'as':_0x1446('0x1e5')});db[_0x1446('0x1ec')][_0x1446('0x123')](db[_0x1446('0x62')],{'foreignKey':_0x1446('0x1ee'),'as':_0x1446('0x1e1')});db[_0x1446('0x1ec')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x1446('0x1e8')});db['SmsTransferReport'][_0x1446('0x123')](db['SmsMessage'],{});db['SmsTransferReport'][_0x1446('0x123')](db[_0x1446('0x57')],{});db[_0x1446('0x1ef')]['belongsTo'](db[_0x1446('0x54')],{'foreignKey':_0x1446('0x1f0'),'as':'FromAccount'});db['SmsTransferReport'][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1dd'),'as':'FromAgent'});db['SmsTransferReport'][_0x1446('0x123')](db[_0x1446('0x11')],{'foreignKey':_0x1446('0x1df'),'as':'ToAgent'});db[_0x1446('0x1ef')][_0x1446('0x123')](db[_0x1446('0x5b')],{'foreignKey':_0x1446('0x1f1'),'as':_0x1446('0x1e1')});db[_0x1446('0x1ef')][_0x1446('0x123')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x1446('0x1e8')});db[_0x1446('0xf9')]['hasMany'](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':'ListId','onDelete':_0x1446('0x113')});db[_0x1446('0xf9')][_0x1446('0x116')](db[_0x1446('0x1f2')],{'as':_0x1446('0x1f3'),'foreignKey':_0x1446('0x17e')});db[_0x1446('0xf9')][_0x1446('0x116')](db[_0x1446('0x75')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x1446('0x17e')});db[_0x1446('0xf9')][_0x1446('0x116')](db[_0x1446('0x7a')],{'as':'HopperFinals','foreignKey':_0x1446('0x17e')});db[_0x1446('0xf9')][_0x1446('0x116')](db[_0x1446('0x119')],{'as':_0x1446('0x11a'),'foreignKey':_0x1446('0x17e')});db['CmList']['hasMany'](db['ReportAgentPreview'],{'as':_0x1446('0x7d'),'foreignKey':'ListId'});db[_0x1446('0xf9')]['belongsToMany'](db[_0x1446('0x17')],{'as':_0x1446('0x1f4'),'through':_0x1446('0x1f5')});db[_0x1446('0xf9')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x129')});db[_0x1446('0xfb')]['hasMany'](db[_0x1446('0x148')],{'as':_0x1446('0x117'),'onDelete':_0x1446('0x113')});db['VoicePrefix']['belongsToMany'](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x10f')});db[_0x1446('0xfb')]['belongsToMany'](db[_0x1446('0xec')],{'through':_0x1446('0x10e'),'as':'Teams'});db['UserProfile'][_0x1446('0x116')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'foreignKey':_0x1446('0x1f6')});db[_0x1446('0xfd')][_0x1446('0x116')](db['UserProfileSection'],{'as':_0x1446('0x1f7'),'foreignKey':_0x1446('0x1f6'),'onDelete':_0x1446('0x113')});db[_0x1446('0xff')][_0x1446('0x116')](db[_0x1446('0x100')],{'as':'Resources','foreignKey':_0x1446('0x1f8'),'onDelete':'cascade'});db['WhatsappAccount'][_0x1446('0x116')](db[_0x1446('0x85')],{'as':_0x1446('0x168'),'foreignKey':_0x1446('0x1f9'),'onDelete':_0x1446('0x113')});db[_0x1446('0x101')][_0x1446('0x116')](db[_0x1446('0x83')],{'as':_0x1446('0x169'),'foreignKey':_0x1446('0x1f9')});db[_0x1446('0x101')][_0x1446('0x116')](db[_0x1446('0x1fa')],{'as':_0x1446('0x15b'),'foreignKey':_0x1446('0x1f9')});db[_0x1446('0x101')]['hasMany'](db[_0x1446('0x104')],{'as':_0x1446('0x16a')});db[_0x1446('0x101')][_0x1446('0x116')](db[_0x1446('0x1fb')],{'as':_0x1446('0x149')});db['WhatsappAccount'][_0x1446('0x123')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['WhatsappAccount'][_0x1446('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1446('0x156')});db[_0x1446('0x101')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':_0x1446('0x144')});db[_0x1446('0x1fb')]['belongsTo'](db['User'],{'onDelete':_0x1446('0x165')});db[_0x1446('0x1fb')][_0x1446('0x123')](db['WhatsappQueue'],{'onDelete':_0x1446('0x165')});db[_0x1446('0x1fb')][_0x1446('0x123')](db[_0x1446('0x101')],{'onDelete':_0x1446('0x165')});db[_0x1446('0x1fb')]['belongsTo'](db['Interval'],{'onDelete':_0x1446('0x165'),'foreignKey':_0x1446('0x154')});db['WhatsappApplication'][_0x1446('0x123')](db[_0x1446('0x92')],{'onDelete':'restrict','foreignKey':_0x1446('0x179')});db[_0x1446('0x104')]['hasMany'](db[_0x1446('0x1fa')],{'as':'Messages','onDelete':_0x1446('0x113'),'foreignKey':_0x1446('0x1fc')});db[_0x1446('0x104')]['belongsTo'](db[_0x1446('0x101')],{'as':_0x1446('0x16e'),'foreignKey':_0x1446('0x1f9')});db[_0x1446('0x104')][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':_0x1446('0x16f')});db[_0x1446('0x104')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x170'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x1446('0x124')](db[_0x1446('0x92')],{'through':_0x1446('0x1ae'),'as':'Tags'});db['WhatsappInteraction'][_0x1446('0x124')](db['Tag'],{'through':_0x1446('0x1ae'),'as':_0x1446('0x172')});db[_0x1446('0x104')][_0x1446('0x124')](db[_0x1446('0x11')],{'as':_0x1446('0x173'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x11')});db['WhatsappMessage']['belongsTo'](db[_0x1446('0x75')],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x162')});db[_0x1446('0x1fa')][_0x1446('0x123')](db['WhatsappInteraction'],{'onDelete':_0x1446('0x113'),'as':_0x1446('0x176'),'foreignKey':_0x1446('0x1fc')});db[_0x1446('0x1fa')][_0x1446('0x123')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x1446('0x1f9')});db[_0x1446('0x107')][_0x1446('0x123')](db[_0x1446('0x101')],{});db[_0x1446('0x107')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1446('0x17e')});db['WhatsappQueueReport'][_0x1446('0x123')](db[_0x1446('0x75')],{'as':_0x1446('0x162'),'foreignKey':'ContactId'});db[_0x1446('0x107')][_0x1446('0x123')](db[_0x1446('0x104')],{});db['WhatsappQueueReport'][_0x1446('0x123')](db[_0x1446('0x109')],{});db[_0x1446('0x107')][_0x1446('0x123')](db[_0x1446('0x1fa')],{});db[_0x1446('0x107')][_0x1446('0x123')](db[_0x1446('0x11')],{});db[_0x1446('0x108')]['belongsTo'](db['WhatsappMessage'],{});db[_0x1446('0x108')][_0x1446('0x123')](db[_0x1446('0x104')],{});db[_0x1446('0x108')]['belongsTo'](db[_0x1446('0x101')],{'foreignKey':_0x1446('0x1fd'),'as':_0x1446('0x1e4')});db['WhatsappTransferReport'][_0x1446('0x123')](db[_0x1446('0x101')],{'foreignKey':_0x1446('0x1fe'),'as':_0x1446('0x1e8')});db[_0x1446('0x108')][_0x1446('0x123')](db[_0x1446('0x109')],{'foreignKey':_0x1446('0x1ff'),'as':'ToQueue'});db[_0x1446('0x108')][_0x1446('0x123')](db['User'],{'foreignKey':_0x1446('0x1dd'),'as':_0x1446('0x1de')});db[_0x1446('0x108')][_0x1446('0x123')](db[_0x1446('0x11')],{'foreignKey':_0x1446('0x1df'),'as':_0x1446('0x1e5')});db[_0x1446('0x109')]['belongsToMany'](db[_0x1446('0x11')],{'as':_0x1446('0x157'),'through':'UserWhatsappQueue','foreignKey':_0x1446('0x200')});db[_0x1446('0x109')][_0x1446('0x124')](db[_0x1446('0xec')],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x1446('0x111')][_0x1446('0x123')](db[_0x1446('0x11')],{'as':_0x1446('0x201'),'foreignKey':_0x1446('0x115'),'onDelete':_0x1446('0x113'),'hooks':!![]});db['CloudProvider'][_0x1446('0x112')](db[_0x1446('0xce')],{'as':_0x1446('0xce'),'onDelete':'restrict'});db[_0x1446('0x10b')][_0x1446('0x112')](db['MailServerIn'],{'as':'Imap','onDelete':_0x1446('0x165')});db[_0x1446('0x10b')]['hasOne'](db[_0x1446('0x166')],{'as':_0x1446('0x167'),'onDelete':'restrict'});module[_0x1446('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b34ba65..3a17b1a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebdc=['/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/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/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','/www','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions'];(function(_0x288977,_0x1efd3d){var _0x254205=function(_0x162e6f){while(--_0x162e6f){_0x288977['push'](_0x288977['shift']());}};_0x254205(++_0x1efd3d);}(_0xebdc,0x1f1));var _0xcebd=function(_0x2d3c23,_0x3c5dcf){_0x2d3c23=_0x2d3c23-0x0;var _0x54e603=_0xebdc[_0x2d3c23];return _0x54e603;};'use strict';var path=require(_0xcebd('0x0'));var express=require('express');var errors=require(_0xcebd('0x1'));var config=require(_0xcebd('0x2'));var setupLoggers=require(_0xcebd('0x3'))[_0xcebd('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xcebd('0x5')]=function(_0x17612d){return setupLoggers(_0x17612d)[_0xcebd('0x6')](function(){_0x17612d[_0xcebd('0x7')](_0xcebd('0x8'),require(_0xcebd('0x9')));_0x17612d['use']('/api/voice/chanspy',require(_0xcebd('0xa')));_0x17612d[_0xcebd('0x7')]('/api/voice/contexts',require(_0xcebd('0xb')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xc'),require('./api/voiceExtension'));_0x17612d['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x17612d['use'](_0xcebd('0xd'),require('./api/voiceQueue'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe'),require(_0xcebd('0xf')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x10'),require(_0xcebd('0x11')));_0x17612d['use'](_0xcebd('0x12'),require(_0xcebd('0x13')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x14'),require(_0xcebd('0x15')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x16'),require(_0xcebd('0x17')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x18'),require('./api/voiceDialReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x19'),require(_0xcebd('0x1a')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x1b'),require('./api/voiceQueueReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x1c'),require(_0xcebd('0x1d')));_0x17612d['use'](_0xcebd('0x1e'),require(_0xcebd('0x1f')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x20'),require(_0xcebd('0x21')));_0x17612d[_0xcebd('0x7')]('/api/mail/out_servers',require(_0xcebd('0x22')));_0x17612d[_0xcebd('0x7')]('/api/mail/accounts',require(_0xcebd('0x23')));_0x17612d['use'](_0xcebd('0x24'),require(_0xcebd('0x25')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x26'),require(_0xcebd('0x27')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x28'),require(_0xcebd('0x29')));_0x17612d['use']('/api/mail/messages',require(_0xcebd('0x2a')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x2b'),require(_0xcebd('0x2c')));_0x17612d[_0xcebd('0x7')]('/api/mail/reports/queue',require(_0xcebd('0x2d')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x2e'),require(_0xcebd('0x2f')));_0x17612d['use'](_0xcebd('0x30'),require(_0xcebd('0x31')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x32'),require(_0xcebd('0x33')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x34'),require('./api/faxApplication'));_0x17612d[_0xcebd('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x17612d[_0xcebd('0x7')]('/api/fax/messages',require(_0xcebd('0x35')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x36'),require(_0xcebd('0x37')));_0x17612d['use'](_0xcebd('0x38'),require('./api/faxQueueReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x39'),require('./api/smsAccount'));_0x17612d['use'](_0xcebd('0x3a'),require(_0xcebd('0x3b')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x3c'),require('./api/smsInteraction'));_0x17612d['use'](_0xcebd('0x3d'),require('./api/smsMessage'));_0x17612d['use']('/api/sms/queues',require(_0xcebd('0x3e')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x3f'),require(_0xcebd('0x40')));_0x17612d[_0xcebd('0x7')]('/api/openchannel/applications',require(_0xcebd('0x41')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x42'),require(_0xcebd('0x43')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x44'),require(_0xcebd('0x45')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x46'),require(_0xcebd('0x47')));_0x17612d['use'](_0xcebd('0x48'),require('./api/chatWebsite'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x49'),require(_0xcebd('0x4a')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x4b'),require(_0xcebd('0x4c')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x4d'),require(_0xcebd('0x4e')));_0x17612d[_0xcebd('0x7')]('/api/chat/messages',require(_0xcebd('0x4f')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x50'),require('./api/chatOfflineMessage'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x51'),require(_0xcebd('0x52')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x53'),require(_0xcebd('0x54')));_0x17612d[_0xcebd('0x7')]('/api/chat/proactive_actions',require(_0xcebd('0x55')));_0x17612d[_0xcebd('0x7')]('/api/cm/companies',require('./api/cmCompany'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x56'),require('./api/cmContact'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x57'),require(_0xcebd('0x58')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x59'),require('./api/cmHopperBlack'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x5a'),require(_0xcebd('0x5b')));_0x17612d[_0xcebd('0x7')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x5c'),require(_0xcebd('0x5d')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x5e'),require(_0xcebd('0x5f')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x60'),require(_0xcebd('0x61')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x62'),require(_0xcebd('0x63')));_0x17612d[_0xcebd('0x7')]('/api/dispositions',require(_0xcebd('0x64')));_0x17612d[_0xcebd('0x7')]('/api/conditions',require(_0xcebd('0x65')));_0x17612d[_0xcebd('0x7')]('/api/intervals',require(_0xcebd('0x66')));_0x17612d['use'](_0xcebd('0x67'),require('./api/pause'));_0x17612d[_0xcebd('0x7')]('/api/cdr',require(_0xcebd('0x68')));_0x17612d['use'](_0xcebd('0x69'),require(_0xcebd('0x6a')));_0x17612d['use'](_0xcebd('0x6b'),require(_0xcebd('0x6c')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x6d'),require(_0xcebd('0x6e')));_0x17612d[_0xcebd('0x7')]('/api/tags',require(_0xcebd('0x6f')));_0x17612d['use'](_0xcebd('0x70'),require(_0xcebd('0x71')));_0x17612d['use'](_0xcebd('0x72'),require(_0xcebd('0x73')));_0x17612d[_0xcebd('0x7')]('/api/cm_hopper_additional_phones',require(_0xcebd('0x74')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x75'),require('./api/template'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x76'),require(_0xcebd('0x77')));_0x17612d['use']('/api/variables',require(_0xcebd('0x78')));_0x17612d['use']('/api/integrations',require(_0xcebd('0x79')));_0x17612d[_0xcebd('0x7')]('/api/integrations/reports',require(_0xcebd('0x7a')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x7b'),require('./api/analyticCustomReport'));_0x17612d[_0xcebd('0x7')]('/api/analytics/default_reports',require(_0xcebd('0x7c')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x7d'),require('./api/analyticExtractedReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x7e'),require(_0xcebd('0x7f')));_0x17612d['use'](_0xcebd('0x80'),require(_0xcebd('0x81')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x82'),require(_0xcebd('0x83')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x84'),require(_0xcebd('0x85')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x86'),require(_0xcebd('0x87')));_0x17612d['use'](_0xcebd('0x88'),require(_0xcebd('0x89')));_0x17612d['use'](_0xcebd('0x8a'),require(_0xcebd('0x8b')));_0x17612d['use'](_0xcebd('0x8c'),require(_0xcebd('0x8d')));_0x17612d['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x17612d[_0xcebd('0x7')]('/api/integrations/desk/accounts',require(_0xcebd('0x8e')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x8f'),require(_0xcebd('0x90')));_0x17612d[_0xcebd('0x7')]('/api/integrations/desk/fields',require(_0xcebd('0x91')));_0x17612d['use'](_0xcebd('0x92'),require('./api/intZohoAccount'));_0x17612d['use'](_0xcebd('0x93'),require(_0xcebd('0x94')));_0x17612d[_0xcebd('0x7')]('/api/integrations/zoho/fields',require(_0xcebd('0x95')));_0x17612d['use'](_0xcebd('0x96'),require(_0xcebd('0x97')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x98'),require(_0xcebd('0x99')));_0x17612d[_0xcebd('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x9a'),require(_0xcebd('0x9b')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x9c'),require(_0xcebd('0x9d')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x9e'),require('./api/intFreshdeskField'));_0x17612d[_0xcebd('0x7')](_0xcebd('0x9f'),require(_0xcebd('0xa0')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xa1'),require(_0xcebd('0xa2')));_0x17612d['use'](_0xcebd('0xa3'),require('./api/intVtigerField'));_0x17612d['use'](_0xcebd('0xa4'),require(_0xcebd('0xa5')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xa6'),require(_0xcebd('0xa7')));_0x17612d['use'](_0xcebd('0xa8'),require(_0xcebd('0xa9')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xaa'),require(_0xcebd('0xab')));_0x17612d['use'](_0xcebd('0xac'),require(_0xcebd('0xad')));_0x17612d['use']('/api/integrations/dynamics365/fields',require(_0xcebd('0xae')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xaf'),require('./api/intFreshsalesAccount'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xb0'),require(_0xcebd('0xb1')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xb2'),require(_0xcebd('0xb3')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xb4'),require(_0xcebd('0xb5')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xb6'),require('./api/chatQueueReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xb7'),require(_0xcebd('0xb8')));_0x17612d[_0xcebd('0x7')]('/api/jscripty/answers/reports',require(_0xcebd('0xb9')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xba'),require('./api/jscriptyQuestionReport'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xbb'),require(_0xcebd('0xbc')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xbd'),require(_0xcebd('0xbe')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xbf'),require(_0xcebd('0xc0')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xc1'),require(_0xcebd('0xc2')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xc3'),require(_0xcebd('0xc4')));_0x17612d[_0xcebd('0x7')]('/api/settings',require(_0xcebd('0xc5')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xc6'),require(_0xcebd('0xc7')));_0x17612d[_0xcebd('0x7')]('/api/square/projects',require('./api/squareProject'));_0x17612d['use']('/api/square/recordings',require(_0xcebd('0xc8')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xc9'),require(_0xcebd('0xca')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xcb'),require(_0xcebd('0xcc')));_0x17612d[_0xcebd('0x7')]('/api/license',require(_0xcebd('0xcd')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xce'),require('./api/campaign'));_0x17612d['use']('/api/migrations',require(_0xcebd('0xcf')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xd0'),require(_0xcebd('0xd1')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xd2'),require('./api/plugin'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xd3'),require(_0xcebd('0xd4')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xd5'),require(_0xcebd('0xd6')));_0x17612d[_0xcebd('0x7')]('/api/fax/reports/transfer',require(_0xcebd('0xd7')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xd8'),require(_0xcebd('0xd9')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xda'),require(_0xcebd('0xdb')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xdc'),require('./api/cmList'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xdd'),require('./api/voicePrefix'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xde'),require(_0xcebd('0xdf')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe0'),require(_0xcebd('0xe1')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe2'),require(_0xcebd('0xe3')));_0x17612d['use'](_0xcebd('0xe4'),require('./api/userNotification'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe5'),require(_0xcebd('0xe6')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe7'),require(_0xcebd('0xe8')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xe9'),require('./api/whatsappInteraction'));_0x17612d['use'](_0xcebd('0xea'),require(_0xcebd('0xeb')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xec'),require(_0xcebd('0xed')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xee'),require(_0xcebd('0xef')));_0x17612d['use'](_0xcebd('0xf0'),require(_0xcebd('0xf1')));_0x17612d['use'](_0xcebd('0xf2'),require(_0xcebd('0xf3')));_0x17612d[_0xcebd('0x7')]('/api/realtime',require(_0xcebd('0xf4')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xf5'),require('./api/user-setting'));_0x17612d[_0xcebd('0x7')](_0xcebd('0xf6'),require(_0xcebd('0xf7')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xf8'),require(_0xcebd('0xf9')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xfa'),require(_0xcebd('0xfb')));_0x17612d['use']('/api/jira',require(_0xcebd('0xfc')));_0x17612d[_0xcebd('0x7')]('/api/rpc',require(_0xcebd('0xfd')));_0x17612d[_0xcebd('0x7')](_0xcebd('0xfe'),require(_0xcebd('0xff')));_0x17612d[_0xcebd('0x7')]('/api/system',require(_0xcebd('0x100')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x101'),require(_0xcebd('0x102')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x103'),require(_0xcebd('0x104')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x105'),clientSideLogs);_0x17612d['use']('/apidoc',express[_0xcebd('0x106')](path[_0xcebd('0x107')](config['root'],_0xcebd('0x108'))));_0x17612d[_0xcebd('0x7')](_0xcebd('0x109'),express[_0xcebd('0x106')](path[_0xcebd('0x107')](config[_0xcebd('0x10a')],'/www')));_0x17612d[_0xcebd('0x7')](_0xcebd('0x10b'),express[_0xcebd('0x106')](path[_0xcebd('0x107')](config[_0xcebd('0x10a')],_0xcebd('0x10b'))));_0x17612d[_0xcebd('0x7')](_0xcebd('0x10c'),express['static'](path[_0xcebd('0x107')](config['root'],_0xcebd('0x10d'),_0xcebd('0x10e'))));_0x17612d[_0xcebd('0x7')](_0xcebd('0x10f'),express[_0xcebd('0x106')](path[_0xcebd('0x107')](config[_0xcebd('0x10a')],_0xcebd('0x110'))));_0x17612d['route'](_0xcebd('0x111'))[_0xcebd('0x112')](errors[0x194]);_0x17612d['route']('/*')['get'](function(_0x33ba83,_0x40967c){_0x40967c[_0xcebd('0x113')](path[_0xcebd('0x114')](_0x17612d[_0xcebd('0x112')](_0xcebd('0x115'))+_0xcebd('0x116')));});return _0x17612d;});}; \ No newline at end of file +var _0x787a=['/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/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/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/campaign','/api/migrations','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','join','root','/www','static','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','path','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','./api/user','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./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/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/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/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue'];(function(_0x39d527,_0x13a05a){var _0x363c26=function(_0x277dec){while(--_0x277dec){_0x39d527['push'](_0x39d527['shift']());}};_0x363c26(++_0x13a05a);}(_0x787a,0x1ce));var _0xa787=function(_0x5d6b50,_0x42bf9f){_0x5d6b50=_0x5d6b50-0x0;var _0x33a8b8=_0x787a[_0x5d6b50];return _0x33a8b8;};'use strict';var path=require(_0xa787('0x0'));var express=require('express');var errors=require(_0xa787('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xa787('0x2'))[_0xa787('0x3')];var clientSideLogs=require(_0xa787('0x4'));exports['default']=function(_0x27ee05){return setupLoggers(_0x27ee05)[_0xa787('0x5')](function(){_0x27ee05['use']('/api/users',require(_0xa787('0x6')));_0x27ee05[_0xa787('0x7')](_0xa787('0x8'),require('./api/voiceChanSpy'));_0x27ee05[_0xa787('0x7')](_0xa787('0x9'),require(_0xa787('0xa')));_0x27ee05['use'](_0xa787('0xb'),require(_0xa787('0xc')));_0x27ee05[_0xa787('0x7')](_0xa787('0xd'),require(_0xa787('0xe')));_0x27ee05['use'](_0xa787('0xf'),require(_0xa787('0x10')));_0x27ee05[_0xa787('0x7')](_0xa787('0x11'),require(_0xa787('0x12')));_0x27ee05[_0xa787('0x7')](_0xa787('0x13'),require(_0xa787('0x14')));_0x27ee05['use'](_0xa787('0x15'),require(_0xa787('0x16')));_0x27ee05['use'](_0xa787('0x17'),require(_0xa787('0x18')));_0x27ee05[_0xa787('0x7')](_0xa787('0x19'),require(_0xa787('0x1a')));_0x27ee05[_0xa787('0x7')](_0xa787('0x1b'),require(_0xa787('0x1c')));_0x27ee05[_0xa787('0x7')](_0xa787('0x1d'),require('./api/voiceAgentReport'));_0x27ee05[_0xa787('0x7')](_0xa787('0x1e'),require('./api/voiceQueueReport'));_0x27ee05[_0xa787('0x7')](_0xa787('0x1f'),require(_0xa787('0x20')));_0x27ee05['use'](_0xa787('0x21'),require(_0xa787('0x22')));_0x27ee05[_0xa787('0x7')](_0xa787('0x23'),require(_0xa787('0x24')));_0x27ee05[_0xa787('0x7')](_0xa787('0x25'),require(_0xa787('0x26')));_0x27ee05[_0xa787('0x7')](_0xa787('0x27'),require(_0xa787('0x28')));_0x27ee05[_0xa787('0x7')]('/api/mail/queues',require(_0xa787('0x29')));_0x27ee05[_0xa787('0x7')](_0xa787('0x2a'),require(_0xa787('0x2b')));_0x27ee05[_0xa787('0x7')](_0xa787('0x2c'),require('./api/mailInteraction'));_0x27ee05[_0xa787('0x7')]('/api/mail/messages',require('./api/mailMessage'));_0x27ee05[_0xa787('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x27ee05[_0xa787('0x7')](_0xa787('0x2d'),require(_0xa787('0x2e')));_0x27ee05[_0xa787('0x7')](_0xa787('0x2f'),require(_0xa787('0x30')));_0x27ee05[_0xa787('0x7')](_0xa787('0x31'),require(_0xa787('0x32')));_0x27ee05[_0xa787('0x7')](_0xa787('0x33'),require(_0xa787('0x34')));_0x27ee05[_0xa787('0x7')](_0xa787('0x35'),require(_0xa787('0x36')));_0x27ee05[_0xa787('0x7')](_0xa787('0x37'),require(_0xa787('0x38')));_0x27ee05[_0xa787('0x7')]('/api/fax/messages',require(_0xa787('0x39')));_0x27ee05['use']('/api/fax/queues',require(_0xa787('0x3a')));_0x27ee05[_0xa787('0x7')](_0xa787('0x3b'),require(_0xa787('0x3c')));_0x27ee05[_0xa787('0x7')](_0xa787('0x3d'),require(_0xa787('0x3e')));_0x27ee05[_0xa787('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0x27ee05[_0xa787('0x7')](_0xa787('0x3f'),require(_0xa787('0x40')));_0x27ee05[_0xa787('0x7')](_0xa787('0x41'),require(_0xa787('0x42')));_0x27ee05[_0xa787('0x7')]('/api/sms/queues',require(_0xa787('0x43')));_0x27ee05['use'](_0xa787('0x44'),require(_0xa787('0x45')));_0x27ee05[_0xa787('0x7')](_0xa787('0x46'),require('./api/openchannelApplication'));_0x27ee05[_0xa787('0x7')](_0xa787('0x47'),require('./api/openchannelInteraction'));_0x27ee05['use'](_0xa787('0x48'),require('./api/openchannelMessage'));_0x27ee05['use'](_0xa787('0x49'),require(_0xa787('0x4a')));_0x27ee05[_0xa787('0x7')](_0xa787('0x4b'),require(_0xa787('0x4c')));_0x27ee05[_0xa787('0x7')]('/api/openchannel/reports/queue',require(_0xa787('0x4d')));_0x27ee05[_0xa787('0x7')]('/api/chat/applications',require(_0xa787('0x4e')));_0x27ee05['use']('/api/chat/interactions',require(_0xa787('0x4f')));_0x27ee05[_0xa787('0x7')]('/api/chat/messages',require(_0xa787('0x50')));_0x27ee05['use'](_0xa787('0x51'),require('./api/chatOfflineMessage'));_0x27ee05[_0xa787('0x7')]('/api/chat/queues',require(_0xa787('0x52')));_0x27ee05[_0xa787('0x7')](_0xa787('0x53'),require(_0xa787('0x54')));_0x27ee05['use'](_0xa787('0x55'),require(_0xa787('0x56')));_0x27ee05[_0xa787('0x7')](_0xa787('0x57'),require(_0xa787('0x58')));_0x27ee05[_0xa787('0x7')]('/api/cm/contacts',require(_0xa787('0x59')));_0x27ee05['use']('/api/cm/hopper',require(_0xa787('0x5a')));_0x27ee05[_0xa787('0x7')]('/api/cm/hopper_black',require(_0xa787('0x5b')));_0x27ee05[_0xa787('0x7')](_0xa787('0x5c'),require('./api/cmHopperFinal'));_0x27ee05[_0xa787('0x7')]('/api/cm/hopper_history',require(_0xa787('0x5d')));_0x27ee05[_0xa787('0x7')](_0xa787('0x5e'),require('./api/cmCustomField'));_0x27ee05[_0xa787('0x7')]('/api/actions',require(_0xa787('0x5f')));_0x27ee05['use']('/api/automations',require(_0xa787('0x60')));_0x27ee05[_0xa787('0x7')](_0xa787('0x61'),require('./api/cannedAnswer'));_0x27ee05[_0xa787('0x7')](_0xa787('0x62'),require(_0xa787('0x63')));_0x27ee05[_0xa787('0x7')](_0xa787('0x64'),require(_0xa787('0x65')));_0x27ee05[_0xa787('0x7')]('/api/intervals',require('./api/interval'));_0x27ee05[_0xa787('0x7')](_0xa787('0x66'),require(_0xa787('0x67')));_0x27ee05['use'](_0xa787('0x68'),require('./api/cdr'));_0x27ee05[_0xa787('0x7')]('/api/voiceQueuesLog',require(_0xa787('0x69')));_0x27ee05[_0xa787('0x7')](_0xa787('0x6a'),require(_0xa787('0x6b')));_0x27ee05[_0xa787('0x7')]('/api/sounds',require(_0xa787('0x6c')));_0x27ee05[_0xa787('0x7')](_0xa787('0x6d'),require('./api/tag'));_0x27ee05['use']('/api/contact_item_types',require(_0xa787('0x6e')));_0x27ee05[_0xa787('0x7')](_0xa787('0x6f'),require(_0xa787('0x70')));_0x27ee05[_0xa787('0x7')](_0xa787('0x71'),require(_0xa787('0x72')));_0x27ee05[_0xa787('0x7')](_0xa787('0x73'),require(_0xa787('0x74')));_0x27ee05[_0xa787('0x7')](_0xa787('0x75'),require(_0xa787('0x76')));_0x27ee05['use']('/api/variables',require('./api/variable'));_0x27ee05[_0xa787('0x7')](_0xa787('0x77'),require(_0xa787('0x78')));_0x27ee05[_0xa787('0x7')](_0xa787('0x79'),require(_0xa787('0x7a')));_0x27ee05['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x27ee05[_0xa787('0x7')](_0xa787('0x7b'),require(_0xa787('0x7c')));_0x27ee05[_0xa787('0x7')](_0xa787('0x7d'),require(_0xa787('0x7e')));_0x27ee05['use'](_0xa787('0x7f'),require('./api/analyticMetric'));_0x27ee05[_0xa787('0x7')](_0xa787('0x80'),require(_0xa787('0x81')));_0x27ee05[_0xa787('0x7')](_0xa787('0x82'),require(_0xa787('0x83')));_0x27ee05['use'](_0xa787('0x84'),require(_0xa787('0x85')));_0x27ee05[_0xa787('0x7')](_0xa787('0x86'),require(_0xa787('0x87')));_0x27ee05[_0xa787('0x7')](_0xa787('0x88'),require('./api/intSalesforceField'));_0x27ee05[_0xa787('0x7')](_0xa787('0x89'),require(_0xa787('0x8a')));_0x27ee05['use'](_0xa787('0x8b'),require(_0xa787('0x8c')));_0x27ee05[_0xa787('0x7')](_0xa787('0x8d'),require('./api/intSugarcrmField'));_0x27ee05[_0xa787('0x7')](_0xa787('0x8e'),require(_0xa787('0x8f')));_0x27ee05[_0xa787('0x7')](_0xa787('0x90'),require(_0xa787('0x91')));_0x27ee05[_0xa787('0x7')](_0xa787('0x92'),require('./api/intDeskField'));_0x27ee05[_0xa787('0x7')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x27ee05['use'](_0xa787('0x93'),require('./api/intZohoConfiguration'));_0x27ee05[_0xa787('0x7')](_0xa787('0x94'),require(_0xa787('0x95')));_0x27ee05[_0xa787('0x7')]('/api/integrations/zendesk/accounts',require(_0xa787('0x96')));_0x27ee05['use'](_0xa787('0x97'),require('./api/intZendeskConfiguration'));_0x27ee05['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x27ee05[_0xa787('0x7')]('/api/integrations/freshdesk/accounts',require(_0xa787('0x98')));_0x27ee05[_0xa787('0x7')](_0xa787('0x99'),require(_0xa787('0x9a')));_0x27ee05[_0xa787('0x7')](_0xa787('0x9b'),require(_0xa787('0x9c')));_0x27ee05['use'](_0xa787('0x9d'),require('./api/intVtigerAccount'));_0x27ee05['use'](_0xa787('0x9e'),require(_0xa787('0x9f')));_0x27ee05['use'](_0xa787('0xa0'),require(_0xa787('0xa1')));_0x27ee05[_0xa787('0x7')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x27ee05[_0xa787('0x7')](_0xa787('0xa2'),require(_0xa787('0xa3')));_0x27ee05['use'](_0xa787('0xa4'),require('./api/intServicenowField'));_0x27ee05['use'](_0xa787('0xa5'),require(_0xa787('0xa6')));_0x27ee05[_0xa787('0x7')](_0xa787('0xa7'),require(_0xa787('0xa8')));_0x27ee05[_0xa787('0x7')]('/api/integrations/dynamics365/fields',require(_0xa787('0xa9')));_0x27ee05['use']('/api/integrations/freshsales/accounts',require(_0xa787('0xaa')));_0x27ee05['use'](_0xa787('0xab'),require(_0xa787('0xac')));_0x27ee05[_0xa787('0x7')](_0xa787('0xad'),require(_0xa787('0xae')));_0x27ee05[_0xa787('0x7')]('/api/networks',require(_0xa787('0xaf')));_0x27ee05[_0xa787('0x7')](_0xa787('0xb0'),require(_0xa787('0xb1')));_0x27ee05['use'](_0xa787('0xb2'),require('./api/chatInternalMessage'));_0x27ee05[_0xa787('0x7')](_0xa787('0xb3'),require(_0xa787('0xb4')));_0x27ee05['use'](_0xa787('0xb5'),require(_0xa787('0xb6')));_0x27ee05[_0xa787('0x7')](_0xa787('0xb7'),require(_0xa787('0xb8')));_0x27ee05[_0xa787('0x7')](_0xa787('0xb9'),require(_0xa787('0xba')));_0x27ee05[_0xa787('0x7')]('/api/square/reports',require(_0xa787('0xbb')));_0x27ee05[_0xa787('0x7')](_0xa787('0xbc'),require('./api/squareReportDetail'));_0x27ee05[_0xa787('0x7')](_0xa787('0xbd'),require(_0xa787('0xbe')));_0x27ee05['use'](_0xa787('0xbf'),require(_0xa787('0xc0')));_0x27ee05[_0xa787('0x7')]('/api/square/odbc',require(_0xa787('0xc1')));_0x27ee05[_0xa787('0x7')](_0xa787('0xc2'),require(_0xa787('0xc3')));_0x27ee05[_0xa787('0x7')](_0xa787('0xc4'),require(_0xa787('0xc5')));_0x27ee05[_0xa787('0x7')](_0xa787('0xc6'),require(_0xa787('0xc7')));_0x27ee05[_0xa787('0x7')](_0xa787('0xc8'),require('./api/team'));_0x27ee05[_0xa787('0x7')](_0xa787('0xc9'),require('./api/license'));_0x27ee05[_0xa787('0x7')]('/api/campaigns',require(_0xa787('0xca')));_0x27ee05[_0xa787('0x7')](_0xa787('0xcb'),require('./api/migration'));_0x27ee05[_0xa787('0x7')]('/api/attachments',require(_0xa787('0xcc')));_0x27ee05[_0xa787('0x7')]('/api/plugins',require(_0xa787('0xcd')));_0x27ee05['use'](_0xa787('0xce'),require('./api/mailTransferReport'));_0x27ee05[_0xa787('0x7')]('/api/chat/reports/transfer',require(_0xa787('0xcf')));_0x27ee05[_0xa787('0x7')](_0xa787('0xd0'),require(_0xa787('0xd1')));_0x27ee05[_0xa787('0x7')](_0xa787('0xd2'),require(_0xa787('0xd3')));_0x27ee05['use'](_0xa787('0xd4'),require(_0xa787('0xd5')));_0x27ee05['use'](_0xa787('0xd6'),require('./api/cmList'));_0x27ee05[_0xa787('0x7')](_0xa787('0xd7'),require(_0xa787('0xd8')));_0x27ee05[_0xa787('0x7')](_0xa787('0xd9'),require('./api/userProfile'));_0x27ee05[_0xa787('0x7')](_0xa787('0xda'),require('./api/userProfileSection'));_0x27ee05[_0xa787('0x7')](_0xa787('0xdb'),require('./api/userProfileResource'));_0x27ee05[_0xa787('0x7')]('/api/userNotifications',require(_0xa787('0xdc')));_0x27ee05[_0xa787('0x7')]('/api/whatsapp/accounts',require(_0xa787('0xdd')));_0x27ee05[_0xa787('0x7')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x27ee05[_0xa787('0x7')](_0xa787('0xde'),require(_0xa787('0xdf')));_0x27ee05[_0xa787('0x7')](_0xa787('0xe0'),require(_0xa787('0xe1')));_0x27ee05[_0xa787('0x7')](_0xa787('0xe2'),require(_0xa787('0xe3')));_0x27ee05[_0xa787('0x7')]('/api/whatsapp/reports/transfer',require(_0xa787('0xe4')));_0x27ee05['use'](_0xa787('0xe5'),require(_0xa787('0xe6')));_0x27ee05[_0xa787('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x27ee05['use'](_0xa787('0xe7'),require('./api/realtime'));_0x27ee05[_0xa787('0x7')](_0xa787('0xe8'),require('./api/user-setting'));_0x27ee05[_0xa787('0x7')](_0xa787('0xe9'),require(_0xa787('0xea')));_0x27ee05[_0xa787('0x7')](_0xa787('0xeb'),require(_0xa787('0xec')));_0x27ee05['use']('/api/auth/activedirectory',require(_0xa787('0xed')));_0x27ee05[_0xa787('0x7')](_0xa787('0xee'),require(_0xa787('0xef')));_0x27ee05['use'](_0xa787('0xf0'),require(_0xa787('0xf1')));_0x27ee05[_0xa787('0x7')](_0xa787('0xf2'),require(_0xa787('0xf3')));_0x27ee05[_0xa787('0x7')]('/api/system',require(_0xa787('0xf4')));_0x27ee05[_0xa787('0x7')](_0xa787('0xf5'),require(_0xa787('0xf6')));_0x27ee05[_0xa787('0x7')](_0xa787('0xf7'),require('./api/webbar'));_0x27ee05[_0xa787('0x7')](_0xa787('0xf8'),clientSideLogs);_0x27ee05[_0xa787('0x7')](_0xa787('0xf9'),express['static'](path[_0xa787('0xfa')](config[_0xa787('0xfb')],'/apidoc')));_0x27ee05[_0xa787('0x7')](_0xa787('0xfc'),express[_0xa787('0xfd')](path[_0xa787('0xfa')](config[_0xa787('0xfb')],_0xa787('0xfc'))));_0x27ee05[_0xa787('0x7')](_0xa787('0xfe'),express[_0xa787('0xfd')](path[_0xa787('0xfa')](config['root'],'/demo')));_0x27ee05['use'](_0xa787('0xff'),express[_0xa787('0xfd')](path[_0xa787('0xfa')](config[_0xa787('0xfb')],_0xa787('0x100'),_0xa787('0x101'))));_0x27ee05['use'](_0xa787('0x102'),express[_0xa787('0xfd')](path['join'](config[_0xa787('0xfb')],_0xa787('0x103'))));_0x27ee05[_0xa787('0x104')](_0xa787('0x105'))[_0xa787('0x106')](errors[0x194]);_0x27ee05[_0xa787('0x104')]('/*')['get'](function(_0xdd4aa7,_0x21e29b){_0x21e29b[_0xa787('0x107')](path[_0xa787('0x108')](_0x27ee05['get']('appPath')+'/index.html'));});return _0x27ee05;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d9786b0..d35f25d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d30=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d30,0x6a));var _0x03d3=function(_0x4315d4,_0x1a0363){_0x4315d4=_0x4315d4-0x0;var _0x49a847=_0x3d30[_0x4315d4];return _0x49a847;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0x03d3('0x0'));exports['listen']=function(){return new Promise(function(_0x12261f,_0x5ced31){var _0x545d7d={};_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/user/user.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x2')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x3')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x4')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x5')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x6')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x7')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x8')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x9')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x545d7d=_['merge'](_0x545d7d,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0xa')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0xb')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0xc')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0xd')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0xe')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/mailApplication/mailApplication.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0xf')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x10')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x11')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/faxInteraction/faxInteraction.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x12')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x13')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x14')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/smsAccount/smsAccount.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x15')));_0x545d7d=_['merge'](_0x545d7d,require('../api/smsMessage/smsMessage.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x16')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x17')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x18')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x19')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1a')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1b')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1c')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/chatQueue/chatQueue.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1d')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1e')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x1f')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x20')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x21')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x22')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x23')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x24')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x25')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x26')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x27')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x28')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x29')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x2a')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x2b')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x2c')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x2d')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x2e')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x2f')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x30')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x31')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x32')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x33')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/squareOdbc/squareOdbc.rpc'));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x34')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x35')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x36')));_0x545d7d=_['merge'](_0x545d7d,require(_0x03d3('0x37')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x38')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x39')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x3a')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x3b')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x3c')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require(_0x03d3('0x3d')));_0x545d7d=_[_0x03d3('0x1')](_0x545d7d,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x469f47=jayson[_0x03d3('0x3e')](_0x545d7d)[_0x03d3('0x3f')]();var _0x4894e7=config[_0x03d3('0x40')]['port']||config['port']+0x1;var _0x2915db=config[_0x03d3('0x40')]['ip']||_0x03d3('0x41');_0x469f47['on'](_0x03d3('0x42'),function(_0x2b6857){return _0x5ced31(_0x2b6857);});_0x469f47[_0x03d3('0x43')](_0x4894e7,_0x2915db,function(){console['log'](_0x03d3('0x44'),_0x2915db,_0x4894e7);require(_0x03d3('0x45'))['default']();return _0x12261f('RPC\x20listening\x20on\x20'+_0x2915db+':'+_0x4894e7);});});}; \ No newline at end of file +var _0x8800=['../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/interval/interval.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8800,0x182));var _0x0880=function(_0x51c701,_0x4aa512){_0x51c701=_0x51c701-0x0;var _0x2e62f8=_0x8800[_0x51c701];return _0x2e62f8;};'use strict';var jayson=require(_0x0880('0x0'));var _=require(_0x0880('0x1'));var config=require(_0x0880('0x2'));exports[_0x0880('0x3')]=function(){return new Promise(function(_0x326783,_0x23186f){var _0x3a7df={};_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/user/user.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x5')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x6')));_0x3a7df=_['merge'](_0x3a7df,require('../api/voiceRecording/voiceRecording.rpc'));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x7')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x8')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x9')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0xa')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0xb')));_0x3a7df=_['merge'](_0x3a7df,require('../api/trunk/trunk.rpc'));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0xc')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0xd')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0xe')));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0xf')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/mailQueue/mailQueue.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x10')));_0x3a7df=_['merge'](_0x3a7df,require('../api/mailMessage/mailMessage.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/mailApplication/mailApplication.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x11')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x12')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x13')));_0x3a7df=_['merge'](_0x3a7df,require('../api/faxInteraction/faxInteraction.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x14')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x15')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x16')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x17')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/smsInteraction/smsInteraction.rpc'));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x18')));_0x3a7df=_['merge'](_0x3a7df,require('../api/smsQueue/smsQueue.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x19')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x1a')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x1b')));_0x3a7df=_['merge'](_0x3a7df,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x1c')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x1d')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/chatMessage/chatMessage.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x1e')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x1f')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/cmHopper/cmHopper.rpc'));_0x3a7df=_['merge'](_0x3a7df,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x20')));_0x3a7df=_['merge'](_0x3a7df,require('../api/pause/pause.rpc'));_0x3a7df=_['merge'](_0x3a7df,require('../api/sound/sound.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x21')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x22')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x23')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x24')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x25')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x26')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x27')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x28')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x29')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x2a')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x2b')));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x2c')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x2d')));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x2e')));_0x3a7df=_['merge'](_0x3a7df,require(_0x0880('0x2f')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x30')));_0x3a7df=_['merge'](_0x3a7df,require('../api/squareOdbc/squareOdbc.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x31')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/squareRecording/squareRecording.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x32')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x33')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x34')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x35')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x36')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x37')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x38')));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x3a7df=_[_0x0880('0x4')](_0x3a7df,require(_0x0880('0x39')));var _0x341095=jayson[_0x0880('0x3a')](_0x3a7df)[_0x0880('0x3b')]();var _0x591e8b=config[_0x0880('0x3c')][_0x0880('0x3d')]||config[_0x0880('0x3d')]+0x1;var _0x41832=config['rpc']['ip']||_0x0880('0x3e');_0x341095['on'](_0x0880('0x3f'),function(_0x46564e){return _0x23186f(_0x46564e);});_0x341095[_0x0880('0x3')](_0x591e8b,_0x41832,function(){console['log'](_0x0880('0x40'),_0x41832,_0x591e8b);require(_0x0880('0x41'))[_0x0880('0x42')]();return _0x326783('RPC\x20listening\x20on\x20'+_0x41832+':'+_0x591e8b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b0ca84f..8fae205 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 _0xba55=['E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','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','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./error','setEncoding','setTimeout','utf8','headers','emit','ready','toLowerCase','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error'];(function(_0x189bd6,_0x27baec){var _0x3b598d=function(_0x1666db){while(--_0x1666db){_0x189bd6['push'](_0x189bd6['shift']());}};_0x3b598d(++_0x27baec);}(_0xba55,0x1f3));var _0x5ba5=function(_0x12e202,_0x2e53c3){_0x12e202=_0x12e202-0x0;var _0x5ba035=_0xba55[_0x12e202];return _0x5ba035;};'use strict';var util=require(_0x5ba5('0x0'));var _=require(_0x5ba5('0x1'));var EventEmitter=require(_0x5ba5('0x2'))[_0x5ba5('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x5ba5('0x4'));function AGIChannel(_0x262bf7){var _0x41fda3=this,_0x153fd4=new AGIReply(),_0x15e2d0=![],_0x1bc2b4={};EventEmitter['call'](_0x41fda3);_0x262bf7[_0x5ba5('0x5')]('utf8');_0x262bf7[_0x5ba5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x153fd4[_0x5ba5('0x5')](_0x5ba5('0x7'));_0x153fd4['on'](_0x5ba5('0x8'),function(_0x2744e8){for(var _0x44c512 in _0x2744e8){_0x41fda3[_0x44c512]=_0x2744e8[_0x44c512];}_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0xa'));});_0x153fd4['on']('line',function(_0x2664f0){if(_0x2664f0[_0x5ba5('0xb')]()=='hangup'){_0x41fda3[_0x5ba5('0x9')]('hangup');return;}if(_0x2664f0[_0x5ba5('0xc')](0x0,0xb)==_0x5ba5('0xd')){_0x15e2d0=!![];}if(_0x15e2d0){_0x1bc2b4['rx']+=_0x2664f0+'\x0a';if(_0x2664f0[_0x5ba5('0xe')](_0x5ba5('0xf'))!=-0x1){_0x15e2d0=![];}}else{_0x1bc2b4['rx']=_0x2664f0;}if(_0x15e2d0){return;}if(typeof _0x1bc2b4['cb']==_0x5ba5('0x10')){var _0x3edd73=_0x1bc2b4['rx'][_0x5ba5('0xc')](0x0,0x3),_0x12cd36=null,_0xe02cff=null;_0x3edd73=parseInt(_0x3edd73);if(isNaN(_0x3edd73)){_0x1bc2b4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5ba5('0x11')});return;}if(_0x3edd73!=0xc8){_0x1bc2b4['cb'](null,{'code':_0x3edd73,'result':-0x1,'extra':'KO'});return;}_0x12cd36=_0x1bc2b4['rx'][_0x5ba5('0xc')](0x4)[_0x5ba5('0x12')](_0x5ba5('0x13'),'');if(_0x12cd36[_0x5ba5('0x14')]('\x20')!=-0x1){_0x12cd36=_0x12cd36[_0x5ba5('0x15')](0x0,_0x12cd36['indexOf']('\x20'));}if(_['startsWith'](_0x12cd36,'-1')){_0x12cd36=parseInt(_0x12cd36);}_0xe02cff=_0x1bc2b4['rx'][_0x5ba5('0x16')]('\x20');if(_0xe02cff['length']==0x3){_0xe02cff=_0xe02cff[0x2]['substring'](0x1,_0xe02cff[0x2]['length']-0x1);}else if(_0xe02cff[_0x5ba5('0x17')]>0x3){var _0x51cbf2=/\((.+)\)/;var _0xe9afd4=_0x1bc2b4['rx'][_0x5ba5('0x18')](_0x51cbf2);if(_0xe9afd4){_0xe02cff=_0xe9afd4[0x1];}else{_0xe02cff=null;}}else{_0xe02cff=null;}_0x1bc2b4['cb'](null,{'code':_0x3edd73,'result':_0x12cd36,'extra':_0xe02cff});}});_0x262bf7['on'](_0x5ba5('0x19'),function(_0x4677e5){_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0x19'),new AGIError(_0x5ba5('0x1a'),_0x4677e5['code']));});_0x262bf7['on'](_0x5ba5('0x1b'),function(){_0x41fda3['emit']('close',new AGIError(_0x5ba5('0x1c')));});_0x262bf7['on']('timeout',function(){_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0x1d'),new AGIError(_0x5ba5('0x1e')));_0x262bf7['destroy']();});_0x262bf7[_0x5ba5('0x1f')](_0x153fd4);this[_0x5ba5('0x20')]=function(_0x9b0ea,_0x4ac568){var _0x9b0ea=_0x9b0ea||'',_0x4ac568=typeof _0x4ac568=='function'?_0x4ac568:new Function();_0x1bc2b4={'tx':_0x9b0ea,'rx':'','cb':_0x4ac568};_0x262bf7[_0x5ba5('0x21')](_0x9b0ea+'\x0a');},this['close']=function(){_0x262bf7[_0x5ba5('0x22')]();};}util[_0x5ba5('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x5ba5('0x24')]['sendRequest']=function(_0x2471b3){return this[_0x5ba5('0x20')][_0x5ba5('0x25')](this,_0x2471b3);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x26')]=function(){return this[_0x5ba5('0x27')](_0x5ba5('0x28'));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x29')]=function(_0x20e7e9,_0x5cc064,_0x566a3d){_0x20e7e9=_0x20e7e9===undefined?_0x5ba5('0x2a'):_0x20e7e9;_0x5cc064=_0x5cc064===undefined?'5':_0x5cc064;_0x566a3d=_0x566a3d===undefined?'1':_0x566a3d;return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20e7e9,_0x5cc064*0x3e8,_0x566a3d));};AGIChannel[_0x5ba5('0x24')]['noop']=function(_0x3129a5){_0x3129a5=_0x3129a5||_0x5ba5('0x2c');return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('VERBOSE\x20\x22%s\x22',_0x3129a5));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x2d')]=function(_0x417402,_0x1b409d){if(_['isArray'](_0x1b409d)){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('EXEC\x20%s\x20%s',_0x417402,_0x1b409d['join'](',')));}return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x2e'),_0x417402,_0x1b409d));};AGIChannel[_0x5ba5('0x24')]['setContext']=function(_0x4ea5ee){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x2f'),_0x4ea5ee));};AGIChannel['prototype'][_0x5ba5('0x30')]=function(_0x4e09ef){return this['sendRequest'](util[_0x5ba5('0x2b')]('SET\x20EXTENSION\x20%s',_0x4e09ef));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x31')]=function(_0x2f5ca6){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x32'),_0x2f5ca6));};AGIChannel[_0x5ba5('0x24')]['hangup']=function(){return this[_0x5ba5('0x27')]('HANGUP');};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x33')]=function(_0x3c38ea,_0x392e30){var _0x4a72a6=_[_0x5ba5('0x34')](_0x392e30)||_[_0x5ba5('0x35')](_0x392e30)?_0x392e30[_0x5ba5('0x36')]():_0x392e30;return this[_0x5ba5('0x27')](util['format'](_0x5ba5('0x37'),_0x3c38ea,_0x4a72a6?_0x4a72a6[_0x5ba5('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x5ba5('0x38')]=function(_0x5702f1,_0x2a77ef){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x39'),_0x5702f1,_0x2a77ef));};AGIChannel[_0x5ba5('0x24')]['sayDigits']=function(_0x2b7d79,_0x1ced9d){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x3a'),_0x2b7d79,_0x1ced9d));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x3b')]=function(_0x3781ef,_0x1f65e3){return this['sendRequest'](util[_0x5ba5('0x2b')](_0x5ba5('0x3c'),_0x3781ef,_0x1f65e3));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x3d')]=function(_0x29a22b,_0x2f11c2,_0x358f09){_0x2f11c2=_0x2f11c2||this[_0x5ba5('0x3e')];_0x358f09=_0x358f09||0x1;this[_0x5ba5('0x3f')](_0x29a22b);this[_0x5ba5('0x30')](_0x2f11c2);this['setPriority'](_0x358f09);return this[_0x5ba5('0x40')](util['format'](_0x5ba5('0x41'),_0x29a22b,_0x2f11c2,_0x358f09));};AGIChannel['prototype']['getVariable']=function(_0x2a45e9){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x42'),_0x2a45e9));};AGIChannel[_0x5ba5('0x24')]['recordFile']=function(_0x12ba05,_0x2d8e1c,_0x2e8beb,_0x792af3,_0x33c47,_0x62a4e0){_0x2d8e1c=_0x2d8e1c||_0x5ba5('0x43');_0x2e8beb=_0x2e8beb||'';_0x792af3=_0x792af3===undefined?-0x1:_0x792af3==='-1'?-0x1:_0x792af3*0x3e8;_0x33c47=_0x33c47===undefined?'':'s='+_0x33c47;_0x62a4e0=_0x62a4e0?_0x5ba5('0x44'):'';return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x45'),_0x12ba05,_0x2d8e1c,_0x2e8beb,_0x792af3,_0x62a4e0,_0x33c47));};AGIChannel[_0x5ba5('0x24')]['streamFile']=function(_0x37a722,_0x893a8){_0x893a8=_0x893a8||'';return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x37a722,_0x893a8));};AGIChannel[_0x5ba5('0x24')]['agi']=function(_0x509c3d){return this[_0x5ba5('0x2d')](_0x5ba5('0x46'),_0x509c3d);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x47')]=function(_0x2bd6c9){return this[_0x5ba5('0x2d')](_0x5ba5('0x48'),_0x2bd6c9);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x19')]=function(_0x336cbb,_0x4ad046){this[_0x5ba5('0x40')](util['format'](_0x5ba5('0x49'),_0x336cbb['id'],_0x336cbb['label'],_0x4ad046));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5ba5('0x4a')]=AGIChannel; \ No newline at end of file +var _0xa901=['agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','headers','emit','ready','line','toLowerCase','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sync','sendRequest','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','hangup','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile'];(function(_0x1aa093,_0x16e192){var _0x3a2760=function(_0x1c9b52){while(--_0x1c9b52){_0x1aa093['push'](_0x1aa093['shift']());}};_0x3a2760(++_0x16e192);}(_0xa901,0x189));var _0x1a90=function(_0x28690d,_0x1f2b8e){_0x28690d=_0x28690d-0x0;var _0x13f4b4=_0xa901[_0x28690d];return _0x13f4b4;};'use strict';var util=require(_0x1a90('0x0'));var _=require(_0x1a90('0x1'));var EventEmitter=require(_0x1a90('0x2'))[_0x1a90('0x3')];var AGIReply=require(_0x1a90('0x4'));var AGIError=require(_0x1a90('0x5'));function AGIChannel(_0x4679f1){var _0x389611=this,_0xddaf70=new AGIReply(),_0x6fbe31=![],_0x1acee8={};EventEmitter['call'](_0x389611);_0x4679f1[_0x1a90('0x6')]('utf8');_0x4679f1['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0xddaf70[_0x1a90('0x6')]('utf8');_0xddaf70['on'](_0x1a90('0x7'),function(_0x2b8c2d){for(var _0x124c29 in _0x2b8c2d){_0x389611[_0x124c29]=_0x2b8c2d[_0x124c29];}_0x389611[_0x1a90('0x8')](_0x1a90('0x9'));});_0xddaf70['on'](_0x1a90('0xa'),function(_0x538828){if(_0x538828[_0x1a90('0xb')]()=='hangup'){_0x389611[_0x1a90('0x8')]('hangup');return;}if(_0x538828[_0x1a90('0xc')](0x0,0xb)==_0x1a90('0xd')){_0x6fbe31=!![];}if(_0x6fbe31){_0x1acee8['rx']+=_0x538828+'\x0a';if(_0x538828['search'](_0x1a90('0xe'))!=-0x1){_0x6fbe31=![];}}else{_0x1acee8['rx']=_0x538828;}if(_0x6fbe31){return;}if(typeof _0x1acee8['cb']==_0x1a90('0xf')){var _0x2d8ef7=_0x1acee8['rx'][_0x1a90('0xc')](0x0,0x3),_0xb356d9=null,_0x149cb1=null;_0x2d8ef7=parseInt(_0x2d8ef7);if(isNaN(_0x2d8ef7)){_0x1acee8['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1a90('0x10')});return;}if(_0x2d8ef7!=0xc8){_0x1acee8['cb'](null,{'code':_0x2d8ef7,'result':-0x1,'extra':'KO'});return;}_0xb356d9=_0x1acee8['rx'][_0x1a90('0xc')](0x4)[_0x1a90('0x11')]('result=','');if(_0xb356d9[_0x1a90('0x12')]('\x20')!=-0x1){_0xb356d9=_0xb356d9[_0x1a90('0x13')](0x0,_0xb356d9['indexOf']('\x20'));}if(_[_0x1a90('0x14')](_0xb356d9,'-1')){_0xb356d9=parseInt(_0xb356d9);}_0x149cb1=_0x1acee8['rx'][_0x1a90('0x15')]('\x20');if(_0x149cb1[_0x1a90('0x16')]==0x3){_0x149cb1=_0x149cb1[0x2][_0x1a90('0xc')](0x1,_0x149cb1[0x2][_0x1a90('0x16')]-0x1);}else if(_0x149cb1[_0x1a90('0x16')]>0x3){var _0x1f000a=/\((.+)\)/;var _0x4a44ca=_0x1acee8['rx']['match'](_0x1f000a);if(_0x4a44ca){_0x149cb1=_0x4a44ca[0x1];}else{_0x149cb1=null;}}else{_0x149cb1=null;}_0x1acee8['cb'](null,{'code':_0x2d8ef7,'result':_0xb356d9,'extra':_0x149cb1});}});_0x4679f1['on'](_0x1a90('0x17'),function(_0x525f1a){_0x389611[_0x1a90('0x8')]('error',new AGIError(_0x1a90('0x18'),_0x525f1a[_0x1a90('0x19')]));});_0x4679f1['on'](_0x1a90('0x1a'),function(){_0x389611[_0x1a90('0x8')](_0x1a90('0x1a'),new AGIError(_0x1a90('0x1b')));});_0x4679f1['on']('timeout',function(){_0x389611[_0x1a90('0x8')](_0x1a90('0x1c'),new AGIError(_0x1a90('0x1d')));_0x4679f1[_0x1a90('0x1e')]();});_0x4679f1[_0x1a90('0x1f')](_0xddaf70);this['command']=function(_0x89b3c,_0x1c7024){var _0x89b3c=_0x89b3c||'',_0x1c7024=typeof _0x1c7024==_0x1a90('0xf')?_0x1c7024:new Function();_0x1acee8={'tx':_0x89b3c,'rx':'','cb':_0x1c7024};_0x4679f1[_0x1a90('0x20')](_0x89b3c+'\x0a');},this['close']=function(){_0x4679f1['destroy']();};}util[_0x1a90('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x1a90('0x22')]['sendRequest']=function(_0x4c754c){return this['command'][_0x1a90('0x23')](this,_0x4c754c);};AGIChannel[_0x1a90('0x22')]['answer']=function(){return this[_0x1a90('0x24')](_0x1a90('0x25'));};AGIChannel['prototype']['getData']=function(_0x4a4a41,_0x1744bd,_0x4378c4){_0x4a4a41=_0x4a4a41===undefined?_0x1a90('0x26'):_0x4a4a41;_0x1744bd=_0x1744bd===undefined?'5':_0x1744bd;_0x4378c4=_0x4378c4===undefined?'1':_0x4378c4;return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x28'),_0x4a4a41,_0x1744bd*0x3e8,_0x4378c4));};AGIChannel['prototype'][_0x1a90('0x29')]=function(_0x4c7227){_0x4c7227=_0x4c7227||_0x1a90('0x2a');return this[_0x1a90('0x24')](util['format'](_0x1a90('0x2b'),_0x4c7227));};AGIChannel[_0x1a90('0x22')]['exec']=function(_0x5e514d,_0x1c4d55){if(_[_0x1a90('0x2c')](_0x1c4d55)){return this['sendRequest'](util[_0x1a90('0x27')]('EXEC\x20%s\x20%s',_0x5e514d,_0x1c4d55['join'](',')));}return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x2d'),_0x5e514d,_0x1c4d55));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x2e')]=function(_0x435996){return this[_0x1a90('0x24')](util[_0x1a90('0x27')]('SET\x20CONTEXT\x20%s',_0x435996));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x2f')]=function(_0x5c0f47){return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x30'),_0x5c0f47));};AGIChannel['prototype']['setPriority']=function(_0x3fe394){return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x31'),_0x3fe394));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x32')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x1a90('0x22')][_0x1a90('0x33')]=function(_0x52e674,_0x2ebd59){var _0x12df2d=_[_0x1a90('0x34')](_0x2ebd59)||_[_0x1a90('0x35')](_0x2ebd59)?_0x2ebd59['toString']():_0x2ebd59;return this[_0x1a90('0x24')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x52e674,_0x12df2d?_0x12df2d[_0x1a90('0x36')]()[_0x1a90('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x37')]=function(_0x611125,_0x5c35b9){return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x38'),_0x611125,_0x5c35b9));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x39')]=function(_0x401c23,_0x1d601b){return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x3a'),_0x401c23,_0x1d601b));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x3b')]=function(_0x97f7ab,_0x408ec0){return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x3c'),_0x97f7ab,_0x408ec0));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x3d')]=function(_0x611e3c,_0x28b51d,_0x2c05d7){_0x28b51d=_0x28b51d||this[_0x1a90('0x3e')];_0x2c05d7=_0x2c05d7||0x1;this[_0x1a90('0x2e')](_0x611e3c);this['setExtension'](_0x28b51d);this[_0x1a90('0x3f')](_0x2c05d7);return this[_0x1a90('0x29')](util[_0x1a90('0x27')](_0x1a90('0x40'),_0x611e3c,_0x28b51d,_0x2c05d7));};AGIChannel[_0x1a90('0x22')]['getVariable']=function(_0x5a2b69){return this[_0x1a90('0x24')](util[_0x1a90('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x5a2b69));};AGIChannel['prototype'][_0x1a90('0x41')]=function(_0x28a897,_0xa38df4,_0x5e6485,_0x4f1c60,_0x4d2412,_0x2de3e0){_0xa38df4=_0xa38df4||'wav';_0x5e6485=_0x5e6485||'';_0x4f1c60=_0x4f1c60===undefined?-0x1:_0x4f1c60==='-1'?-0x1:_0x4f1c60*0x3e8;_0x4d2412=_0x4d2412===undefined?'':'s='+_0x4d2412;_0x2de3e0=_0x2de3e0?_0x1a90('0x42'):'';return this[_0x1a90('0x24')](util[_0x1a90('0x27')](_0x1a90('0x43'),_0x28a897,_0xa38df4,_0x5e6485,_0x4f1c60,_0x2de3e0,_0x4d2412));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x44')]=function(_0x1b858e,_0x370ce5){_0x370ce5=_0x370ce5||'';return this[_0x1a90('0x24')](util[_0x1a90('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1b858e,_0x370ce5));};AGIChannel[_0x1a90('0x22')][_0x1a90('0x45')]=function(_0xb50401){return this[_0x1a90('0x46')](_0x1a90('0x47'),_0xb50401);};AGIChannel[_0x1a90('0x22')][_0x1a90('0x48')]=function(_0x28e7ab){return this[_0x1a90('0x46')](_0x1a90('0x49'),_0x28e7ab);};AGIChannel['prototype'][_0x1a90('0x17')]=function(_0x145ada,_0xbd015b){this[_0x1a90('0x29')](util[_0x1a90('0x27')](_0x1a90('0x4a'),_0x145ada['id'],_0x145ada[_0x1a90('0x4b')],_0xbd015b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1a90('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7e1bce1..d8ea7e9 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 _0x0545=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x361955,_0x3b0d2){var _0x43365c=function(_0x42e2da){while(--_0x42e2da){_0x361955['push'](_0x361955['shift']());}};_0x43365c(++_0x3b0d2);}(_0x0545,0xdb));var _0x5054=function(_0x324a72,_0x4e83f3){_0x324a72=_0x324a72-0x0;var _0x3a97b9=_0x0545[_0x324a72];return _0x3a97b9;};'use strict';var util=require(_0x5054('0x0'));var error={'E_AGI_UNDEFINED':_0x5054('0x1'),'E_AGI_ARGUMENT_PORT':_0x5054('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5054('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5054('0x4'),'E_AGI_SOCKET_ERROR':_0x5054('0x5'),'E_AGI_SOCKET_CLOSE':_0x5054('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5054('0x7'),'E_AGI_COMMAND_EMPTY':_0x5054('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5054('0x9'),'E_AGI_IVR_ENTRY':_0x5054('0xa')};function AGIError(_0x38d373){var _0x38d373=_0x38d373||null,_0x2a51a6=_0x2a51a6||[],_0x12537c=0x1,_0x4b35e4='';if(!error[_0x38d373]){_0x38d373=_0x5054('0xb');}_0x2a51a6[_0x5054('0xc')](error[_0x38d373]);while(arguments[_0x12537c]){_0x2a51a6[_0x5054('0xc')](arguments[_0x12537c]);_0x12537c++;}_0x4b35e4=util['format']['apply'](util,_0x2a51a6);this[_0x5054('0xd')]=_0x4b35e4;this[_0x5054('0xe')]=_0x38d373;}module['exports']=AGIError; \ No newline at end of file +var _0x313f=['Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','util'];(function(_0x187c39,_0x3cc190){var _0x1dc233=function(_0x101724){while(--_0x101724){_0x187c39['push'](_0x187c39['shift']());}};_0x1dc233(++_0x3cc190);}(_0x313f,0x8f));var _0xf313=function(_0x3279a9,_0x3a966c){_0x3279a9=_0x3279a9-0x0;var _0x48bd4d=_0x313f[_0x3279a9];return _0x48bd4d;};'use strict';var util=require(_0xf313('0x0'));var error={'E_AGI_UNDEFINED':_0xf313('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xf313('0x2'),'E_AGI_SERVER_CLOSE':_0xf313('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xf313('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xf313('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xf313('0x6'),'E_AGI_COMMAND_EMPTY':_0xf313('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf313('0x8'),'E_AGI_IVR_ENTRY':_0xf313('0x9')};function AGIError(_0x41c99c){var _0x41c99c=_0x41c99c||null,_0x516c54=_0x516c54||[],_0x2d31e7=0x1,_0x248401='';if(!error[_0x41c99c]){_0x41c99c=_0xf313('0xa');}_0x516c54[_0xf313('0xb')](error[_0x41c99c]);while(arguments[_0x2d31e7]){_0x516c54[_0xf313('0xb')](arguments[_0x2d31e7]);_0x2d31e7++;}_0x248401=util['format'][_0xf313('0xc')](util,_0x516c54);this[_0xf313('0xd')]=_0x248401;this[_0xf313('0xe')]=_0x41c99c;}module[_0xf313('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 7a91339..463e148 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffbf=['agi','emit','E_AGI_SERVER_ERROR','parse','projectUpdate','error','lodash','events','EventEmitter','ioredis','./error','redis'];(function(_0x1581dc,_0x29492e){var _0xc99f1c=function(_0x3d8686){while(--_0x3d8686){_0x1581dc['push'](_0x1581dc['shift']());}};_0xc99f1c(++_0x29492e);}(_0xffbf,0xde));var _0xfffb=function(_0x4a82f1,_0x38ce07){_0x4a82f1=_0x4a82f1-0x0;var _0x1d9bf4=_0xffbf[_0x4a82f1];return _0x1d9bf4;};'use strict';var _=require(_0xfffb('0x0'));var EventEmitter=require(_0xfffb('0x1'))[_0xfffb('0x2')];var Redis=require(_0xfffb('0x3'));var AGIError=require(_0xfffb('0x4'));var config=require('../../config/environment');config['redis']=_['defaults'](config[_0xfffb('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0xfffb('0x6'),function(_0x3f6aad){if(_0x3f6aad)return eventEmitter[_0xfffb('0x7')]('error',new AGIError(_0xfffb('0x8'),_0x3f6aad));});sub['on']('message',function(_0x1cc624,_0x27cb82){if(_0x1cc624!=='agi')return;try{var _0x584d75=JSON[_0xfffb('0x9')](_0x27cb82);eventEmitter[_0xfffb('0x7')](_0xfffb('0xa'),_0x584d75);}catch(_0xebd3d5){eventEmitter[_0xfffb('0x7')](_0xfffb('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0xebd3d5));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xfa49=['lodash','events','EventEmitter','./error','redis','defaults','emit','error','message','agi','parse','E_AGI_SERVER_ERROR','exports'];(function(_0x368891,_0x57a1f4){var _0x2f179c=function(_0x1d986c){while(--_0x1d986c){_0x368891['push'](_0x368891['shift']());}};_0x2f179c(++_0x57a1f4);}(_0xfa49,0x186));var _0x9fa4=function(_0x56eb52,_0x1a81f0){_0x56eb52=_0x56eb52-0x0;var _0x4bc281=_0xfa49[_0x56eb52];return _0x4bc281;};'use strict';var _=require(_0x9fa4('0x0'));var EventEmitter=require(_0x9fa4('0x1'))[_0x9fa4('0x2')];var Redis=require('ioredis');var AGIError=require(_0x9fa4('0x3'));var config=require('../../config/environment');config[_0x9fa4('0x4')]=_[_0x9fa4('0x5')](config[_0x9fa4('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x9fa4('0x4')]);sub['subscribe']('agi',function(_0x5bfd9b){if(_0x5bfd9b)return eventEmitter[_0x9fa4('0x6')](_0x9fa4('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5bfd9b));});sub['on'](_0x9fa4('0x8'),function(_0x32d629,_0x52ac5c){if(_0x32d629!==_0x9fa4('0x9'))return;try{var _0x36876a=JSON[_0x9fa4('0xa')](_0x52ac5c);eventEmitter[_0x9fa4('0x6')]('projectUpdate',_0x36876a);}catch(_0x57e61e){eventEmitter['emit'](_0x9fa4('0x7'),new AGIError(_0x9fa4('0xb'),_0x57e61e));}});module[_0x9fa4('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 0483930..04d2ca6 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 _0xb537=['edges','numberOfEdges','prototype','push','size','relations','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','menu','getdigits','getsecretdigits','vertices'];(function(_0x254ee3,_0x2eac56){var _0x232857=function(_0x238852){while(--_0x238852){_0x254ee3['push'](_0x254ee3['shift']());}};_0x232857(++_0x2eac56);}(_0xb537,0x163));var _0x7b53=function(_0x2f099a,_0x266c39){_0x2f099a=_0x2f099a-0x0;var _0x2e8998=_0xb537[_0x2f099a];return _0x2e8998;};'use strict';var _=require(_0x7b53('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x7b53('0x1'),_0x7b53('0x2'),_0x7b53('0x3')];var Graph=function(){this[_0x7b53('0x4')]={};this[_0x7b53('0x5')]={};this[_0x7b53('0x6')]=0x0;};Graph[_0x7b53('0x7')]['addVertex']=function(_0xa509ab){this['vertices'][_0xa509ab['id']]=_0xa509ab;this[_0x7b53('0x5')][_0xa509ab['id']]=[];};Graph[_0x7b53('0x7')]['addEdge']=function(_0x7710b5,_0x20d8b4,_0x59b212){this[_0x7b53('0x5')][_0x7710b5][_0x7b53('0x8')]({'target':_0x20d8b4,'condition':_0x59b212});this[_0x7b53('0x6')]+=0x1;};Graph[_0x7b53('0x7')][_0x7b53('0x9')]=function(){return _['size'](this[_0x7b53('0x4')]);};Graph[_0x7b53('0x7')][_0x7b53('0xa')]=function(){return this[_0x7b53('0x6')];};Graph[_0x7b53('0x7')]['getVertex']=function(_0x5c1557){return this[_0x7b53('0x4')][_0x5c1557];};Graph['prototype']['traverseBFS']=function(_0x46f706,_0x28c910){if(!this['vertices'][_0x46f706]){return logger[_0x7b53('0xb')]('no\x20vertex\x20found');}var _0x4c61c9=_0x28c910(this['vertices'][_0x46f706]);if(!_0x4c61c9){return logger[_0x7b53('0xb')](_0x7b53('0xc'));}if(this[_0x7b53('0x5')][_0x46f706][_0x7b53('0xd')]===0x0){return logger[_0x7b53('0xb')](_0x7b53('0xe'));}for(var _0x525c2b=0x0,_0x3eeaf9=[],_0x415904=![];_0x525c2b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','finally','./server','listening','connection','lodash','syncho'];(function(_0xc6a588,_0x1774c9){var _0x4114b8=function(_0x35bdad){while(--_0x35bdad){_0xc6a588['push'](_0xc6a588['shift']());}};_0x4114b8(++_0x1774c9);}(_0x2242,0xb2));var _0x2224=function(_0x1782b6,_0x441bc9){_0x1782b6=_0x1782b6-0x0;var _0x5522bc=_0x2242[_0x1782b6];return _0x5522bc;};'use strict';var _=require(_0x2224('0x0'));var syncho=require(_0x2224('0x1'));var util=require(_0x2224('0x2'));var config=require(_0x2224('0x3'));var logger=require(_0x2224('0x4'))(_0x2224('0x5'));var utilLicense=require(_0x2224('0x6'));var rpc=require(_0x2224('0x7'));var Project=require('./project');var AGIEmitter=require(_0x2224('0x8'))[_0x2224('0x9')];var projects=[];config[_0x2224('0x5')]=_[_0x2224('0xa')](config[_0x2224('0x5')],{'ip':_0x2224('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x525053){process[_0x2224('0xc')](function(){syncho(function(){try{setChannelVariables(_0x525053);agiHandler(_0x525053);}catch(_0x49014c){logger[_0x2224('0xd')](_0x49014c[_0x2224('0xe')]);}});});}function projectUpdateHandler(_0x5f9759){try{var _0xff6a8c=_['findIndex'](projects,['id',_0x5f9759['id']]);if(_0xff6a8c>-0x1){if(_0x5f9759['deleted']===!![]){projects[_0x2224('0xf')](_0xff6a8c,0x1);}else{projects[_0xff6a8c]=_0x5f9759;}}else{projects[_0x2224('0x10')](_0x5f9759);}}catch(_0x31db6a){logger[_0x2224('0xd')](_0x31db6a[_0x2224('0xe')]);}}function listeningHandler(){console[_0x2224('0x11')](_0x2224('0x12'),config[_0x2224('0x5')][_0x2224('0x13')]);logger[_0x2224('0x14')](util[_0x2224('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x2224('0x5')]['ip'],config[_0x2224('0x5')][_0x2224('0x13')]));}function errorHandler(_0x149ab4){if(_0x149ab4&&_0x149ab4['name']&&_0x149ab4['message']){logger[_0x2224('0xd')](util[_0x2224('0x15')]('[%s]\x20%s',_0x149ab4[_0x2224('0x16')],_0x149ab4[_0x2224('0x17')]));}else{logger['error'](util[_0x2224('0x15')]('[ERROR]\x20%s',_0x149ab4[_0x2224('0xe')]));}}function closeHandler(){logger[_0x2224('0x14')](util[_0x2224('0x15')](_0x2224('0x18'),this[_0x2224('0x19')],this[_0x2224('0x1a')],this[_0x2224('0x1b')],this[_0x2224('0x1c')],this[_0x2224('0x1d')]));try{createSquareReport(this);}catch(_0x14244c){logger[_0x2224('0xd')](_0x14244c['stack']);}}function timeoutHandler(){logger[_0x2224('0x14')](util[_0x2224('0x15')](_0x2224('0x1e'),this['arg_1'],this[_0x2224('0x1a')],this[_0x2224('0x1b')],this[_0x2224('0x1c')],this[_0x2224('0x1d')]));}function hangupHandler(){logger[_0x2224('0x14')](util[_0x2224('0x15')](_0x2224('0x1f'),this[_0x2224('0x19')],this['calleridname'],this[_0x2224('0x1b')],this[_0x2224('0x1c')],this[_0x2224('0x1d')]));this[_0x2224('0x20')]=!![];}function createSquareReport(_0x414287,_0x43c74d){rpc[_0x2224('0x21')](_0x414287)[_0x2224('0x22')](function(_0x4394f6){if(_0x43c74d){_0x43c74d(null,_0x4394f6);}})['catch'](function(_0x539dfa){if(_0x43c74d){_0x43c74d(null,_0x539dfa);}});}function setChannelVariables(_0x362d57){for(var _0x19b098 in _0x362d57){if(_0x362d57[_0x2224('0x23')](_0x19b098)){if(_0x19b098[_0x2224('0x24')](_0x2224('0x25'))===0x0){_0x362d57[_0x19b098[_0x2224('0x26')](0x4)]=_0x362d57[_0x19b098];delete _0x362d57[_0x19b098];}}}}function agiHandler(_0xa506b9){logger[_0x2224('0x27')](_0x2224('0x28'),JSON[_0x2224('0x29')](_0xa506b9,null,0x2));logger[_0x2224('0x14')](util[_0x2224('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xa506b9[_0x2224('0x19')],_0xa506b9[_0x2224('0x1a')],_0xa506b9[_0x2224('0x1b')],_0xa506b9[_0x2224('0x1c')],_0xa506b9[_0x2224('0x1d')]));_0xa506b9['on'](_0x2224('0xd'),errorHandler);_0xa506b9['on'](_0x2224('0x2a'),closeHandler);_0xa506b9['on'](_0x2224('0x2b'),timeoutHandler);_0xa506b9[_0x2224('0x20')]=![];_0xa506b9['on'](_0x2224('0x2c'),hangupHandler);var _0x1920be=_[_0x2224('0x2d')](projects,[_0x2224('0x16'),_0xa506b9[_0x2224('0x19')]]);if(!_0x1920be)return Project[_0x2224('0x2e')](_0xa506b9);if(!_0x1920be[_0x2224('0x2f')])return Project[_0x2224('0x30')](_0xa506b9);return Project[_0x2224('0x31')](_0x1920be,_0xa506b9);}function main(){var _0x4bde99;return utilLicense[_0x2224('0x32')]()[_0x2224('0x22')](function(_0x10e1a0){if(!_0x10e1a0)return;if(_0x10e1a0[_0x2224('0x33')]){if(_0x10e1a0[_0x2224('0x34')]&&_0x10e1a0['callysquare']>0x0){logger[_0x2224('0x14')](util[_0x2224('0x15')]('[LICENSE]\x20CHANNELS:\x20%s',_0x10e1a0[_0x2224('0x34')]));_0x4bde99=_0x10e1a0[_0x2224('0x34')];}else{logger[_0x2224('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x2224('0x14')](_0x2224('0x35'));_0x4bde99=-0x1;}})[_0x2224('0x22')](function(){return Project[_0x2224('0x36')]();})[_0x2224('0x22')](function(_0x49cc17){projects=_0x49cc17;return;})[_0x2224('0x37')](function(_0x573cfe){logger[_0x2224('0xd')]('[LICENSE]',_0x573cfe[_0x2224('0xe')]);})[_0x2224('0x38')](function(){var _0x4a60e0=require(_0x2224('0x39'))(config['agi'][_0x2224('0x13')],config[_0x2224('0x5')]['ip'],_0x4bde99);_0x4a60e0['on']('error',errorHandler);_0x4a60e0['on'](_0x2224('0x3a'),listeningHandler);_0x4a60e0['on'](_0x2224('0x3b'),connectionHandler);_0x4a60e0['on'](_0x2224('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0x8421=['[ERROR]\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','hangup','find','handleNotFound','production','handleUnpublished','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','./server','listening','syncho','util','../../config/license/util','./project','./events','agi','defaults','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0x8421,0x1d0));var _0x1842=function(_0x54ef1e,_0x218d4a){_0x54ef1e=_0x54ef1e-0x0;var _0x19c745=_0x8421[_0x54ef1e];return _0x19c745;};'use strict';var _=require('lodash');var syncho=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('agi');var utilLicense=require(_0x1842('0x2'));var rpc=require('./rpc');var Project=require(_0x1842('0x3'));var AGIEmitter=require(_0x1842('0x4'))['EventEmitter'];var projects=[];config[_0x1842('0x5')]=_[_0x1842('0x6')](config[_0x1842('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3e75e2){process[_0x1842('0x7')](function(){syncho(function(){try{setChannelVariables(_0x3e75e2);agiHandler(_0x3e75e2);}catch(_0x17d0a9){logger[_0x1842('0x8')](_0x17d0a9[_0x1842('0x9')]);}});});}function projectUpdateHandler(_0x49860e){try{var _0x40a7b0=_[_0x1842('0xa')](projects,['id',_0x49860e['id']]);if(_0x40a7b0>-0x1){if(_0x49860e[_0x1842('0xb')]===!![]){projects[_0x1842('0xc')](_0x40a7b0,0x1);}else{projects[_0x40a7b0]=_0x49860e;}}else{projects[_0x1842('0xd')](_0x49860e);}}catch(_0x25eacf){logger['error'](_0x25eacf[_0x1842('0x9')]);}}function listeningHandler(){console[_0x1842('0xe')](_0x1842('0xf'),config['agi'][_0x1842('0x10')]);logger[_0x1842('0x11')](util[_0x1842('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x4dbc02){if(_0x4dbc02&&_0x4dbc02[_0x1842('0x13')]&&_0x4dbc02[_0x1842('0x14')]){logger[_0x1842('0x8')](util['format'](_0x1842('0x15'),_0x4dbc02['name'],_0x4dbc02[_0x1842('0x14')]));}else{logger[_0x1842('0x8')](util[_0x1842('0x12')](_0x1842('0x16'),_0x4dbc02[_0x1842('0x9')]));}}function closeHandler(){logger[_0x1842('0x11')](util[_0x1842('0x12')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x1842('0x17')],this[_0x1842('0x18')],this[_0x1842('0x19')],this[_0x1842('0x1a')]));try{createSquareReport(this);}catch(_0x25543b){logger['error'](_0x25543b[_0x1842('0x9')]);}}function timeoutHandler(){logger['info'](util['format'](_0x1842('0x1b'),this['arg_1'],this[_0x1842('0x17')],this['callerid'],this[_0x1842('0x19')],this[_0x1842('0x1a')]));}function hangupHandler(){logger[_0x1842('0x11')](util[_0x1842('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x1842('0x17')],this[_0x1842('0x18')],this[_0x1842('0x19')],this[_0x1842('0x1a')]));this[_0x1842('0x1c')]=!![];}function createSquareReport(_0x4e4585,_0x53b225){rpc[_0x1842('0x1d')](_0x4e4585)[_0x1842('0x1e')](function(_0x183f93){if(_0x53b225){_0x53b225(null,_0x183f93);}})[_0x1842('0x1f')](function(_0x5f1298){if(_0x53b225){_0x53b225(null,_0x5f1298);}});}function setChannelVariables(_0x199156){for(var _0x2f8847 in _0x199156){if(_0x199156[_0x1842('0x20')](_0x2f8847)){if(_0x2f8847[_0x1842('0x21')](_0x1842('0x22'))===0x0){_0x199156[_0x2f8847[_0x1842('0x23')](0x4)]=_0x199156[_0x2f8847];delete _0x199156[_0x2f8847];}}}}function agiHandler(_0x28470c){logger[_0x1842('0x24')](_0x1842('0x25'),JSON['stringify'](_0x28470c,null,0x2));logger[_0x1842('0x11')](util[_0x1842('0x12')](_0x1842('0x26'),_0x28470c[_0x1842('0x27')],_0x28470c[_0x1842('0x17')],_0x28470c[_0x1842('0x18')],_0x28470c['dnid'],_0x28470c['uniqueid']));_0x28470c['on'](_0x1842('0x8'),errorHandler);_0x28470c['on'](_0x1842('0x28'),closeHandler);_0x28470c['on']('timeout',timeoutHandler);_0x28470c[_0x1842('0x1c')]=![];_0x28470c['on'](_0x1842('0x29'),hangupHandler);var _0x49f8c4=_[_0x1842('0x2a')](projects,[_0x1842('0x13'),_0x28470c['arg_1']]);if(!_0x49f8c4)return Project[_0x1842('0x2b')](_0x28470c);if(!_0x49f8c4[_0x1842('0x2c')])return Project[_0x1842('0x2d')](_0x28470c);return Project['initialize'](_0x49f8c4,_0x28470c);}function main(){var _0x3340f7;return utilLicense['getLicense']()[_0x1842('0x1e')](function(_0x271a4c){if(!_0x271a4c)return;if(_0x271a4c[_0x1842('0x2e')]){if(_0x271a4c[_0x1842('0x2f')]&&_0x271a4c[_0x1842('0x2f')]>0x0){logger['info'](util[_0x1842('0x12')](_0x1842('0x30'),_0x271a4c[_0x1842('0x2f')]));_0x3340f7=_0x271a4c['callysquare'];}else{logger[_0x1842('0x11')](_0x1842('0x31'));}}else{logger[_0x1842('0x11')](_0x1842('0x32'));_0x3340f7=-0x1;}})[_0x1842('0x1e')](function(){return Project[_0x1842('0x33')]();})[_0x1842('0x1e')](function(_0xe1a036){projects=_0xe1a036;return;})[_0x1842('0x1f')](function(_0x237f5c){logger['error']('[LICENSE]',_0x237f5c[_0x1842('0x9')]);})['finally'](function(){var _0x139525=require(_0x1842('0x34'))(config['agi'][_0x1842('0x10')],config[_0x1842('0x5')]['ip'],_0x3340f7);_0x139525['on'](_0x1842('0x8'),errorHandler);_0x139525['on'](_0x1842('0x35'),listeningHandler);_0x139525['on']('connection',connectionHandler);_0x139525['on'](_0x1842('0x28'),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 7b6a16d..37f1b41 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 _0x9a5a=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result','catch','sendMailMessage'];(function(_0x289835,_0x3a7b48){var _0x597fe2=function(_0x2d1d12){while(--_0x2d1d12){_0x289835['push'](_0x289835['shift']());}};_0x597fe2(++_0x3a7b48);}(_0x9a5a,0x145));var _0xa9a5=function(_0x148d98,_0x2fc8b2){_0x148d98=_0x148d98-0x0;var _0x293aae=_0x9a5a[_0x148d98];return _0x293aae;};'use strict';var BPromise=require(_0xa9a5('0x0'));var jayson=require(_0xa9a5('0x1'));var client=jayson[_0xa9a5('0x2')][_0xa9a5('0x3')]({'port':0x232b});function request(_0x465ab9,_0x43ccb3){return new BPromise(function(_0x8dc569,_0x26d443){return client[_0xa9a5('0x4')](_0x465ab9,_0x43ccb3)[_0xa9a5('0x5')](function(_0x5b7937){if(_0x5b7937[_0xa9a5('0x6')]){return _0x26d443(_0x5b7937[_0xa9a5('0x6')][_0xa9a5('0x7')]);}else{return _0x8dc569(_0x5b7937[_0xa9a5('0x8')]);}})[_0xa9a5('0x9')](function(_0x1bb6b1){return _0x26d443(_0x1bb6b1);});});}exports[_0xa9a5('0xa')]=function(_0x416eed,_0x1403b7){return request(_0xa9a5('0xb'),{'account':_0x416eed,'message':_0x1403b7});}; \ No newline at end of file +var _0xd7d0=['sendMailMessage','SendMail','jayson/promise','client','http','request','error','message','result','catch'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0xd7d0,0x66));var _0x0d7d=function(_0x5800a5,_0x2823f6){_0x5800a5=_0x5800a5-0x0;var _0x420c85=_0xd7d0[_0x5800a5];return _0x420c85;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0d7d('0x0'));var client=jayson[_0x0d7d('0x1')][_0x0d7d('0x2')]({'port':0x232b});function request(_0x42994f,_0x9c7394){return new BPromise(function(_0x28d241,_0x3cd8ae){return client[_0x0d7d('0x3')](_0x42994f,_0x9c7394)['then'](function(_0x3f664f){if(_0x3f664f['error']){return _0x3cd8ae(_0x3f664f[_0x0d7d('0x4')][_0x0d7d('0x5')]);}else{return _0x28d241(_0x3f664f[_0x0d7d('0x6')]);}})[_0x0d7d('0x7')](function(_0x3b6507){return _0x3cd8ae(_0x3b6507);});});}exports[_0x0d7d('0x8')]=function(_0x57cf82,_0x307b24){return request(_0x0d7d('0x9'),{'account':_0x57cf82,'message':_0x307b24});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index b277262..f556340 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3c9=['moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','production','start','debug','stringify','format','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','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','error','agicommand\x20not\x20found','finally','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash'];(function(_0x2803a8,_0x2c7e31){var _0x2b107b=function(_0x148ce5){while(--_0x148ce5){_0x2803a8['push'](_0x2803a8['shift']());}};_0x2b107b(++_0x2c7e31);}(_0xc3c9,0x1e7));var _0x9c3c=function(_0x40d46b,_0x5a76c1){_0x40d46b=_0x40d46b-0x0;var _0x2716cd=_0xc3c9[_0x40d46b];return _0x2716cd;};'use strict';var _=require(_0x9c3c('0x0'));var moment=require(_0x9c3c('0x1'));var parser=require(_0x9c3c('0x2'));var util=require(_0x9c3c('0x3'));var logger=require(_0x9c3c('0x4'))(_0x9c3c('0x5'));var rpc=require(_0x9c3c('0x6'));var mailRpc=require(_0x9c3c('0x7'));var Graph=require(_0x9c3c('0x8'));var Vertices=require(_0x9c3c('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9c3c('0xa')]()[_0x9c3c('0xb')](function(_0x518d70){logger['error'](_0x9c3c('0xc'),_0x518d70[_0x9c3c('0xd')]);return[];});}function addVertex(_0xf2d22e,_0x507a47,_0x48c326){_0x507a47[_0x9c3c('0xe')]=_0x48c326;if(_0x507a47[_0x9c3c('0xf')](_0x9c3c('0x10'))){_0x507a47['maxRetry']=parseInt(_0x507a47['retry'],0xa);}_0xf2d22e[_0x9c3c('0x11')](_[_0x9c3c('0x12')](_0x507a47,_0x9c3c('0x13')));}function initGraph(_0x1b4d59,_0x2fcd60){var _0x51ed8d=new Graph();for(var _0x46d3ee in _0x1b4d59){if(_0x1b4d59[_0x9c3c('0xf')](_0x46d3ee)){if(_[_0x9c3c('0x14')](_0x1b4d59[_0x46d3ee])){for(var _0x4e0574=0x0;_0x4e0574<_0x1b4d59[_0x46d3ee][_0x9c3c('0x15')];_0x4e0574+=0x1){addVertex(_0x51ed8d,_0x1b4d59[_0x46d3ee][_0x4e0574],_0x46d3ee);}}else{addVertex(_0x51ed8d,_0x1b4d59[_0x46d3ee],_0x46d3ee);}}}for(var _0x337c73=0x0;_0x337c73<_0x2fcd60['length'];_0x337c73+=0x1){if(_0x2fcd60[_0x337c73][_0x9c3c('0x16')]&&_0x2fcd60[_0x337c73][_0x9c3c('0x17')]){_0x51ed8d[_0x9c3c('0x18')](_0x2fcd60[_0x337c73][_0x9c3c('0x16')],_0x2fcd60[_0x337c73][_0x9c3c('0x17')],_0x2fcd60[_0x337c73][_0x9c3c('0x19')]);}}return _0x51ed8d;}function getRoot(_0x5a626f){return parser['toJson'](_0x5a626f,{'object':!![]})[_0x9c3c('0x1a')][_0x9c3c('0x1b')];}function inspect(_0x1116c7){return util['inspect'](_0x1116c7,{'showHidden':![],'depth':null});}function initialize(_0x570566,_0x39e3a5){var _0x387351=getRoot(_0x570566[_0x9c3c('0x1c')]);if(!_0x387351||!_0x387351[_0x9c3c('0x1d')])return;var _0x9fddd1,_0x4ae7a5,_0x2a5650;logger[_0x9c3c('0x1e')](_0x9c3c('0x1b'),JSON[_0x9c3c('0x1f')](_0x387351,null,0x2));_0x39e3a5['joinAt']=moment()[_0x9c3c('0x20')](_0x9c3c('0x21'));_0x9fddd1=initGraph(_[_0x9c3c('0x12')](_0x387351,'mxCell'),_0x387351['mxCell']);_0x4ae7a5=new Vertices(_0x39e3a5,rpc,mailRpc);logger['info'](util[_0x9c3c('0x20')](_0x9c3c('0x22'),_0x39e3a5[_0x9c3c('0x23')],_0x39e3a5[_0x9c3c('0x24')],_0x39e3a5[_0x9c3c('0x25')],_0x39e3a5[_0x9c3c('0x26')],_0x39e3a5[_0x9c3c('0x27')]));_0x9fddd1[_0x9c3c('0x28')](_0x387351['start']['id'],function(_0x4e35ec){try{_0x4e35ec=_0x4ae7a5['clear'](_0x4e35ec);logger['debug']('vertex',JSON[_0x9c3c('0x1f')](_0x4e35ec,null,0x2));if(_0x4e35ec[_0x9c3c('0xe')]==='gotoc'){logger[_0x9c3c('0x29')](_0x9c3c('0x2a'));_0x39e3a5[_0x9c3c('0x2b')]=_0x4e35ec[_0x9c3c('0x2b')]||_0x39e3a5[_0x9c3c('0x2b')];_0x39e3a5[_0x9c3c('0x2c')]=_0x4e35ec[_0x9c3c('0x2c')];_0x39e3a5[_0x9c3c('0x2d')]=_0x4e35ec[_0x9c3c('0x2d')]?_0x4e35ec['priority']-0x1:0x1;return null;}else if(_0x4e35ec&&_0x4ae7a5[_0x4e35ec[_0x9c3c('0xe')]]){_0x2a5650=_0x4ae7a5[_0x4e35ec[_0x9c3c('0xe')]](_0x4e35ec);logger[_0x9c3c('0x29')](_0x9c3c('0x2e'),JSON[_0x9c3c('0x1f')](_0x2a5650,null,0x2));if(_0x2a5650&&_0x2a5650[_0x9c3c('0x2f')]===AGI_CODE_SUCCESS&&_0x2a5650['result']!==AGI_RESULT_ERROR&&!_0x39e3a5[_0x9c3c('0x30')]){logger[_0x9c3c('0x1e')](_0x9c3c('0x2e'),inspect(_0x2a5650));return _[_0x9c3c('0x31')](_0x2a5650[_0x9c3c('0x32')])?null:_0x2a5650['result'][_0x9c3c('0x33')]();}else{logger[_0x9c3c('0x34')]('response',inspect(_0x2a5650));return null;}}else{logger[_0x9c3c('0x34')](_0x9c3c('0x35'));return null;}}catch(_0x1112e5){logger[_0x9c3c('0x34')](_0x1112e5[_0x9c3c('0xd')]);return null;}});if(_0x387351[_0x9c3c('0x36')]){logger[_0x9c3c('0x29')](util[_0x9c3c('0x20')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x39e3a5['arg_1'],_0x39e3a5['calleridname'],_0x39e3a5[_0x9c3c('0x25')],_0x39e3a5[_0x9c3c('0x26')],_0x39e3a5[_0x9c3c('0x27')]));_0x9fddd1[_0x9c3c('0x28')](_0x387351[_0x9c3c('0x36')]['id'],function(_0x101560){try{_0x101560=_0x4ae7a5[_0x9c3c('0x37')](_0x101560);logger[_0x9c3c('0x1e')]('vertex',JSON[_0x9c3c('0x1f')](_0x101560,null,0x2));if(_0x101560&&_0x4ae7a5[_0x101560[_0x9c3c('0xe')]]){_0x2a5650=_0x4ae7a5[_0x101560[_0x9c3c('0xe')]](_0x101560);if(_0x2a5650){logger[_0x9c3c('0x1e')](_0x9c3c('0x2e'),inspect(_0x2a5650));return _[_0x9c3c('0x31')](_0x2a5650['result'])?null:_0x2a5650[_0x9c3c('0x32')][_0x9c3c('0x33')]();}else{logger[_0x9c3c('0x34')](_0x9c3c('0x2e'),inspect(_0x2a5650));return null;}}else{logger[_0x9c3c('0x34')]('agicommand\x20not\x20found');return null;}}catch(_0x26cc3e){logger['error'](_0x26cc3e[_0x9c3c('0xd')]);return null;}});}logger[_0x9c3c('0x29')](util[_0x9c3c('0x20')](_0x9c3c('0x38'),_0x39e3a5[_0x9c3c('0x23')],_0x39e3a5[_0x9c3c('0x24')],_0x39e3a5['callerid'],_0x39e3a5[_0x9c3c('0x26')],_0x39e3a5[_0x9c3c('0x27')]));logger[_0x9c3c('0x29')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x39e3a5[_0x9c3c('0x2b')],_0x39e3a5[_0x9c3c('0x2c')],parseInt(_0x39e3a5['priority'],0xa)+0x1));_0x39e3a5[_0x9c3c('0x39')](_0x39e3a5[_0x9c3c('0x2b')],_0x39e3a5['extension'],parseInt(_0x39e3a5[_0x9c3c('0x2d')],0xa)+0x1);_0x39e3a5[_0x9c3c('0x3a')]();}function handleNotFound(_0x3f53b3){logger[_0x9c3c('0x34')](util[_0x9c3c('0x20')]('Project\x20%s\x20not\x20found',_0x3f53b3[_0x9c3c('0x23')]));_0x3f53b3[_0x9c3c('0x39')](_0x3f53b3[_0x9c3c('0x2b')],_0x3f53b3[_0x9c3c('0x2c')],parseInt(_0x3f53b3[_0x9c3c('0x2d')],0xa)+0x1);_0x3f53b3[_0x9c3c('0x3a')]();}function handleUnpublished(_0x482d85){logger[_0x9c3c('0x34')](util[_0x9c3c('0x20')](_0x9c3c('0x3b'),_0x482d85['arg_1']));_0x482d85[_0x9c3c('0x39')](_0x482d85['context'],_0x482d85['extension'],parseInt(_0x482d85[_0x9c3c('0x2d')],0xa)+0x1);_0x482d85['close']();}module[_0x9c3c('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x24ca=['error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','addEdge','production','debug','stringify','joinAt','format','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','arg_1','calleridname','uniqueid','traverseBFS','clear','gotoc','info','context','extension','priority','response','code','isUndefined','result','toString','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json','../../config/logger','./mailRpc','./graph','getSquareProjects'];(function(_0x1e4595,_0xff1f3){var _0x39ddb1=function(_0x2f1596){while(--_0x2f1596){_0x1e4595['push'](_0x1e4595['shift']());}};_0x39ddb1(++_0xff1f3);}(_0x24ca,0x138));var _0xa24c=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x24ca[_0x3c4a7c];return _0xf13d1e;};'use strict';var _=require('lodash');var moment=require(_0xa24c('0x0'));var parser=require(_0xa24c('0x1'));var util=require('util');var logger=require(_0xa24c('0x2'))('agi');var rpc=require('./rpc');var mailRpc=require(_0xa24c('0x3'));var Graph=require(_0xa24c('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xa24c('0x5')]()['catch'](function(_0x1902a9){logger[_0xa24c('0x6')](_0xa24c('0x7'),_0x1902a9['stack']);return[];});}function addVertex(_0xecbe3f,_0x3d7d83,_0x444539){_0x3d7d83[_0xa24c('0x8')]=_0x444539;if(_0x3d7d83[_0xa24c('0x9')](_0xa24c('0xa'))){_0x3d7d83[_0xa24c('0xb')]=parseInt(_0x3d7d83[_0xa24c('0xa')],0xa);}_0xecbe3f[_0xa24c('0xc')](_[_0xa24c('0xd')](_0x3d7d83,_0xa24c('0xe')));}function initGraph(_0x3d9509,_0x2414d3){var _0x374e5d=new Graph();for(var _0x3d20f0 in _0x3d9509){if(_0x3d9509[_0xa24c('0x9')](_0x3d20f0)){if(_['isArray'](_0x3d9509[_0x3d20f0])){for(var _0x19760a=0x0;_0x19760a<_0x3d9509[_0x3d20f0][_0xa24c('0xf')];_0x19760a+=0x1){addVertex(_0x374e5d,_0x3d9509[_0x3d20f0][_0x19760a],_0x3d20f0);}}else{addVertex(_0x374e5d,_0x3d9509[_0x3d20f0],_0x3d20f0);}}}for(var _0x4d9374=0x0;_0x4d9374<_0x2414d3['length'];_0x4d9374+=0x1){if(_0x2414d3[_0x4d9374]['source']&&_0x2414d3[_0x4d9374][_0xa24c('0x10')]){_0x374e5d[_0xa24c('0x11')](_0x2414d3[_0x4d9374]['source'],_0x2414d3[_0x4d9374][_0xa24c('0x10')],_0x2414d3[_0x4d9374]['value']);}}return _0x374e5d;}function getRoot(_0x2fa252){return parser['toJson'](_0x2fa252,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x1de67f){return util['inspect'](_0x1de67f,{'showHidden':![],'depth':null});}function initialize(_0x4bd264,_0x30a20a){var _0x5aed56=getRoot(_0x4bd264[_0xa24c('0x12')]);if(!_0x5aed56||!_0x5aed56['start'])return;var _0x4de69e,_0xef9b28,_0x414dc9;logger[_0xa24c('0x13')]('root',JSON[_0xa24c('0x14')](_0x5aed56,null,0x2));_0x30a20a[_0xa24c('0x15')]=moment()[_0xa24c('0x16')](_0xa24c('0x17'));_0x4de69e=initGraph(_['omit'](_0x5aed56,_0xa24c('0xe')),_0x5aed56['mxCell']);_0xef9b28=new Vertices(_0x30a20a,rpc,mailRpc);logger['info'](util[_0xa24c('0x16')](_0xa24c('0x18'),_0x30a20a[_0xa24c('0x19')],_0x30a20a[_0xa24c('0x1a')],_0x30a20a['callerid'],_0x30a20a['dnid'],_0x30a20a[_0xa24c('0x1b')]));_0x4de69e[_0xa24c('0x1c')](_0x5aed56['start']['id'],function(_0xf7c4f3){try{_0xf7c4f3=_0xef9b28[_0xa24c('0x1d')](_0xf7c4f3);logger[_0xa24c('0x13')]('vertex',JSON[_0xa24c('0x14')](_0xf7c4f3,null,0x2));if(_0xf7c4f3[_0xa24c('0x8')]===_0xa24c('0x1e')){logger[_0xa24c('0x1f')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x30a20a[_0xa24c('0x20')]=_0xf7c4f3[_0xa24c('0x20')]||_0x30a20a[_0xa24c('0x20')];_0x30a20a[_0xa24c('0x21')]=_0xf7c4f3[_0xa24c('0x21')];_0x30a20a['priority']=_0xf7c4f3[_0xa24c('0x22')]?_0xf7c4f3[_0xa24c('0x22')]-0x1:0x1;return null;}else if(_0xf7c4f3&&_0xef9b28[_0xf7c4f3[_0xa24c('0x8')]]){_0x414dc9=_0xef9b28[_0xf7c4f3[_0xa24c('0x8')]](_0xf7c4f3);logger[_0xa24c('0x1f')](_0xa24c('0x23'),JSON['stringify'](_0x414dc9,null,0x2));if(_0x414dc9&&_0x414dc9[_0xa24c('0x24')]===AGI_CODE_SUCCESS&&_0x414dc9['result']!==AGI_RESULT_ERROR&&!_0x30a20a['evtHangup']){logger['debug']('response',inspect(_0x414dc9));return _[_0xa24c('0x25')](_0x414dc9[_0xa24c('0x26')])?null:_0x414dc9[_0xa24c('0x26')][_0xa24c('0x27')]();}else{logger[_0xa24c('0x6')](_0xa24c('0x23'),inspect(_0x414dc9));return null;}}else{logger[_0xa24c('0x6')]('agicommand\x20not\x20found');return null;}}catch(_0x2e1942){logger[_0xa24c('0x6')](_0x2e1942[_0xa24c('0x28')]);return null;}});if(_0x5aed56[_0xa24c('0x29')]){logger[_0xa24c('0x1f')](util[_0xa24c('0x16')](_0xa24c('0x2a'),_0x30a20a[_0xa24c('0x19')],_0x30a20a[_0xa24c('0x1a')],_0x30a20a['callerid'],_0x30a20a[_0xa24c('0x2b')],_0x30a20a[_0xa24c('0x1b')]));_0x4de69e[_0xa24c('0x1c')](_0x5aed56[_0xa24c('0x29')]['id'],function(_0x112ef3){try{_0x112ef3=_0xef9b28[_0xa24c('0x1d')](_0x112ef3);logger[_0xa24c('0x13')](_0xa24c('0x2c'),JSON[_0xa24c('0x14')](_0x112ef3,null,0x2));if(_0x112ef3&&_0xef9b28[_0x112ef3['agicommand']]){_0x414dc9=_0xef9b28[_0x112ef3[_0xa24c('0x8')]](_0x112ef3);if(_0x414dc9){logger[_0xa24c('0x13')]('response',inspect(_0x414dc9));return _['isUndefined'](_0x414dc9[_0xa24c('0x26')])?null:_0x414dc9[_0xa24c('0x26')]['toString']();}else{logger['error'](_0xa24c('0x23'),inspect(_0x414dc9));return null;}}else{logger[_0xa24c('0x6')]('agicommand\x20not\x20found');return null;}}catch(_0x4b8be0){logger[_0xa24c('0x6')](_0x4b8be0['stack']);return null;}});}logger[_0xa24c('0x1f')](util['format'](_0xa24c('0x2d'),_0x30a20a[_0xa24c('0x19')],_0x30a20a[_0xa24c('0x1a')],_0x30a20a[_0xa24c('0x2e')],_0x30a20a[_0xa24c('0x2b')],_0x30a20a['uniqueid']));logger[_0xa24c('0x1f')](util[_0xa24c('0x16')](_0xa24c('0x2f'),_0x30a20a['context'],_0x30a20a[_0xa24c('0x21')],parseInt(_0x30a20a['priority'],0xa)+0x1));_0x30a20a[_0xa24c('0x30')](_0x30a20a[_0xa24c('0x20')],_0x30a20a['extension'],parseInt(_0x30a20a[_0xa24c('0x22')],0xa)+0x1);_0x30a20a[_0xa24c('0x31')]();}function handleNotFound(_0x456ba3){logger[_0xa24c('0x6')](util[_0xa24c('0x16')](_0xa24c('0x32'),_0x456ba3[_0xa24c('0x19')]));_0x456ba3[_0xa24c('0x30')](_0x456ba3[_0xa24c('0x20')],_0x456ba3['extension'],parseInt(_0x456ba3[_0xa24c('0x22')],0xa)+0x1);_0x456ba3[_0xa24c('0x31')]();}function handleUnpublished(_0x46c25f){logger[_0xa24c('0x6')](util['format'](_0xa24c('0x33'),_0x46c25f[_0xa24c('0x19')]));_0x46c25f['continueAt'](_0x46c25f[_0xa24c('0x20')],_0x46c25f[_0xa24c('0x21')],parseInt(_0x46c25f[_0xa24c('0x22')],0xa)+0x1);_0x46c25f[_0xa24c('0x31')]();}module[_0xa24c('0x34')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 550eb94..74ae28d 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 _0xd4a0=['_inBody','substring','split','slice','trim','length','emit','headers','indexOf','line','exports','util','stream','Transform','_localBuffer','inherits','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x4b59ec,_0x400d58){var _0x1d267f=function(_0x16370b){while(--_0x16370b){_0x4b59ec['push'](_0x4b59ec['shift']());}};_0x1d267f(++_0x400d58);}(_0xd4a0,0x187));var _0x0d4a=function(_0xf36240,_0x582f06){_0xf36240=_0xf36240-0x0;var _0x2a9338=_0xd4a0[_0xf36240];return _0x2a9338;};'use strict';var util=require(_0x0d4a('0x0'));var Transform=require(_0x0d4a('0x1'))[_0x0d4a('0x2')];function AGIReply(_0x3b8e66){Transform['call'](this,_0x3b8e66);this[_0x0d4a('0x3')]='';this['_inBody']=![];}util[_0x0d4a('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x0d4a('0x5')]=function(_0x587950,_0x26bd85,_0x41102a){var _0x23cc89='\x0a',_0x4513e0=['\x0a\x0a',_0x0d4a('0x6')],_0x1c2f5c=-0x1,_0x502c03=-0x1,_0x570c60='',_0x9baba8=0x0,_0xed04f5='',_0x2307df='';this[_0x0d4a('0x3')]+=_0x587950[_0x0d4a('0x7')]();_0xed04f5=this['_localBuffer'];if(!this[_0x0d4a('0x8')]){_0x9baba8=0x0;while(_0x4513e0[_0x9baba8]){while((_0x502c03=_0xed04f5['indexOf'](_0x4513e0[_0x9baba8]))!=-0x1){_0x570c60=_0x4513e0[_0x9baba8];_0x2307df=_0xed04f5['substring'](0x0,_0x502c03);_0xed04f5=_0xed04f5[_0x0d4a('0x9')](_0x502c03+_0x570c60['length']);var _0x519eb3=_0x2307df[_0x0d4a('0xa')](_0x23cc89),_0x2f0c96=0x0,_0x129b2c={},_0x578b72='',_0x1de093='',_0x51ddc5=-0x1;while(_0x519eb3[_0x2f0c96]){_0x51ddc5=_0x519eb3[_0x2f0c96]['indexOf'](':');if(_0x51ddc5!=-0x1){_0x578b72=_0x519eb3[_0x2f0c96][_0x0d4a('0xb')](0x0,_0x51ddc5)['trim']();_0x1de093=_0x519eb3[_0x2f0c96][_0x0d4a('0xb')](_0x51ddc5+0x1)[_0x0d4a('0xc')]();if(_0x578b72[_0x0d4a('0xd')]>0x0){_0x129b2c[_0x578b72]=_0x1de093;}}else{}_0x2f0c96++;}this[_0x0d4a('0xe')](_0x0d4a('0xf'),_0x129b2c);this[_0x0d4a('0x8')]=!![];}_0x9baba8++;}this[_0x0d4a('0x3')]=_0xed04f5;}else{while((_0x1c2f5c=_0xed04f5[_0x0d4a('0x10')](_0x23cc89))!=-0x1){_0x2307df=_0xed04f5[_0x0d4a('0x9')](0x0,_0x1c2f5c);this[_0x0d4a('0xe')](_0x0d4a('0x11'),_0x2307df);_0xed04f5=_0xed04f5[_0x0d4a('0x9')](_0x1c2f5c+_0x23cc89[_0x0d4a('0xd')]);}this[_0x0d4a('0x3')]=_0xed04f5;}_0x41102a();};module[_0x0d4a('0x12')]=AGIReply; \ No newline at end of file +var _0xd9cc=['util','stream','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','trim','slice','emit','exports'];(function(_0x112a2d,_0x2563f9){var _0x351866=function(_0x4c7140){while(--_0x4c7140){_0x112a2d['push'](_0x112a2d['shift']());}};_0x351866(++_0x2563f9);}(_0xd9cc,0x66));var _0xcd9c=function(_0x3d44f7,_0x5f3368){_0x3d44f7=_0x3d44f7-0x0;var _0x13f970=_0xd9cc[_0x3d44f7];return _0x13f970;};'use strict';var util=require(_0xcd9c('0x0'));var Transform=require(_0xcd9c('0x1'))['Transform'];function AGIReply(_0x1e6b7a){Transform['call'](this,_0x1e6b7a);this['_localBuffer']='';this[_0xcd9c('0x2')]=![];}util[_0xcd9c('0x3')](AGIReply,Transform);AGIReply[_0xcd9c('0x4')][_0xcd9c('0x5')]=function(_0x51dde9,_0x31b40d,_0x144be3){var _0x294833='\x0a',_0x242d02=['\x0a\x0a',_0xcd9c('0x6')],_0x11e49c=-0x1,_0x9c3c29=-0x1,_0x4952be='',_0xb31c84=0x0,_0x43afed='',_0x2d10fe='';this[_0xcd9c('0x7')]+=_0x51dde9[_0xcd9c('0x8')]();_0x43afed=this[_0xcd9c('0x7')];if(!this['_inBody']){_0xb31c84=0x0;while(_0x242d02[_0xb31c84]){while((_0x9c3c29=_0x43afed[_0xcd9c('0x9')](_0x242d02[_0xb31c84]))!=-0x1){_0x4952be=_0x242d02[_0xb31c84];_0x2d10fe=_0x43afed[_0xcd9c('0xa')](0x0,_0x9c3c29);_0x43afed=_0x43afed[_0xcd9c('0xa')](_0x9c3c29+_0x4952be[_0xcd9c('0xb')]);var _0x35b396=_0x2d10fe[_0xcd9c('0xc')](_0x294833),_0x373771=0x0,_0x40867a={},_0x5cbac4='',_0x2433c9='',_0x11915b=-0x1;while(_0x35b396[_0x373771]){_0x11915b=_0x35b396[_0x373771][_0xcd9c('0x9')](':');if(_0x11915b!=-0x1){_0x5cbac4=_0x35b396[_0x373771]['slice'](0x0,_0x11915b)[_0xcd9c('0xd')]();_0x2433c9=_0x35b396[_0x373771][_0xcd9c('0xe')](_0x11915b+0x1)[_0xcd9c('0xd')]();if(_0x5cbac4[_0xcd9c('0xb')]>0x0){_0x40867a[_0x5cbac4]=_0x2433c9;}}else{}_0x373771++;}this['emit']('headers',_0x40867a);this['_inBody']=!![];}_0xb31c84++;}this[_0xcd9c('0x7')]=_0x43afed;}else{while((_0x11e49c=_0x43afed[_0xcd9c('0x9')](_0x294833))!=-0x1){_0x2d10fe=_0x43afed['substring'](0x0,_0x11e49c);this[_0xcd9c('0xf')]('line',_0x2d10fe);_0x43afed=_0x43afed[_0xcd9c('0xa')](_0x11e49c+_0x294833[_0xcd9c('0xb')]);}this[_0xcd9c('0x7')]=_0x43afed;}_0x144be3();};module[_0xcd9c('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index d86c657..4a795b1 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 _0x00bb=['email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowSquareOdbc','dsn','getUserById','phone','ShowTrunk','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','lodash','moment','jayson/promise','http','request','then','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','CloudProvider','name'];(function(_0xdfdeb7,_0x29649c){var _0x1db931=function(_0x65c2bd){while(--_0x65c2bd){_0xdfdeb7['push'](_0xdfdeb7['shift']());}};_0x1db931(++_0x29649c);}(_0x00bb,0x1d8));var _0xb00b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x00bb[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));var jayson=require(_0xb00b('0x2'));var client=jayson['client'][_0xb00b('0x3')]({'port':0x2329});function request(_0x47a3bf,_0x278c5e){return new Promise(function(_0x464fe7,_0x582ef9){return client[_0xb00b('0x4')](_0x47a3bf,_0x278c5e)[_0xb00b('0x5')](function(_0x5b3b34){if(_0x5b3b34['error']){return _0x582ef9(_0x5b3b34['error'][_0xb00b('0x6')]);}else{return _0x464fe7(_0x5b3b34[_0xb00b('0x7')]);}})[_0xb00b('0x8')](function(_0x37f07d){return _0x582ef9(_0x37f07d);});});}exports[_0xb00b('0x9')]=function(){return request(_0xb00b('0xa'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xb00b('0xb')]=function(_0x1e9b7b){return request(_0xb00b('0xc'),{'options':{'raw':![],'where':{'name':_0x1e9b7b},'attributes':[_0xb00b('0xd')]}});};exports[_0xb00b('0xe')]=function(_0x48e125){return request(_0xb00b('0xf'),{'options':{'raw':![],'where':{'id':_0x48e125},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':_0xb00b('0x10')}]}],'attributes':['id',_0xb00b('0x11'),_0xb00b('0x12')],'smtp':!![]}});};exports[_0xb00b('0x13')]=function(_0xef5d52){return request(_0xb00b('0xc'),{'options':{'where':{'id':_0xef5d52},'attributes':['name']}});};exports[_0xb00b('0x14')]=function(_0xb0d42e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xb0d42e},'attributes':[_0xb00b('0x11')]}});};exports[_0xb00b('0x15')]=function(_0x540b79){return request('ShowVariable',{'options':{'where':{'id':_0x540b79},'attributes':[_0xb00b('0x11')]}});};exports['getSquareOdbcById']=function(_0x51d136){return request(_0xb00b('0x16'),{'options':{'where':{'id':_0x51d136},'attributes':[_0xb00b('0x17')]}});};exports[_0xb00b('0x18')]=function(_0xbb72fc){return request('ShowUser',{'options':{'where':{'id':_0xbb72fc},'attributes':[_0xb00b('0x11')]}});};exports['getContactByPhone']=function(_0x415f91){return request('GetContactByPhone',{'options':{'where':{'phone':_0x415f91[_0xb00b('0x19')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xb26ebb){return request(_0xb00b('0x1a'),{'options':{'where':{'id':_0xb26ebb},'attributes':['name']}});};exports['getSoundById']=function(_0x2b0da1){return request('ShowSound',{'options':{'where':{'id':_0x2b0da1},'attributes':[_0xb00b('0x1b')]}});};exports[_0xb00b('0x1c')]=function(_0x2fe48d){return request(_0xb00b('0x1d'),{'options':{'raw':![],'where':{'id':_0x2fe48d},'include':[{'model':'Interval','as':_0xb00b('0x1e')}]}});};exports['getSmsAccountById']=function(_0x25a973){return request(_0xb00b('0x1f'),{'options':{'where':{'id':_0x25a973},'attributes':['id','name']}});};exports[_0xb00b('0x20')]=function(_0x2896d1){return request('CreateSmsMessage',{'body':_0x2896d1});};exports[_0xb00b('0x21')]=function(_0x1f04d3){return request('CreateSquareDetailsReport',{'body':_0x1f04d3});};exports[_0xb00b('0x22')]=function(_0x243fdb){return request(_0xb00b('0x23'),{'body':_[_0xb00b('0x24')](_0x243fdb,{'project_name':_0x243fdb['arg_1'],'prev_project_name':_0x243fdb['arg_2']||'','is_subproject':_0x243fdb[_0xb00b('0x25')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x16ac55){return request(_0xb00b('0x26'),{'body':_0x16ac55});};exports[_0xb00b('0x27')]=function(_0x3825af){return request(_0xb00b('0x28'),{'body':_0x3825af});};exports[_0xb00b('0x29')]=function(_0x15d3b9){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x15d3b9[_0xb00b('0x19')],'ListId':_0x15d3b9['ListId']}}})[_0xb00b('0x5')](function(_0x348165){if(_0x348165){return _0x348165;}return request(_0xb00b('0x2a'),{'body':_0x15d3b9});});};exports['getPauseById']=function(_0x2fc11a){return request(_0xb00b('0x2b'),{'options':{'where':{'id':_0x2fc11a},'attributes':[_0xb00b('0x11')]}});};exports[_0xb00b('0x2c')]=function(_0x303625,_0x2b9824){return request(_0xb00b('0x2d'),{'body':{'interface':_0x2b9824},'options':{'where':_0x303625}});};exports[_0xb00b('0x2e')]=function(_0x149c1a,_0x54e247,_0x2b5f41){return request(_0xb00b('0x2f'),{'body':{'type':_0x54e247,'uniqueid':_0x2b5f41},'options':{'where':_0x149c1a}});};exports['agentUnpause']=function(_0x593659){return request(_0xb00b('0x30'),{'body':{},'options':{'where':_0x593659}});};exports['agentLogout']=function(_0x456241){return request('LogoutUser',{'body':{},'options':{'where':_0x456241}});}; \ No newline at end of file +var _0xdd0c=['PauseUser','UnpauseUser','LogoutUser','moment','jayson/promise','client','request','then','error','message','result','catch','GetSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser'];(function(_0x5f2005,_0x3d0771){var _0x43797d=function(_0x336e89){while(--_0x336e89){_0x5f2005['push'](_0x5f2005['shift']());}};_0x43797d(++_0x3d0771);}(_0xdd0c,0x165));var _0xcdd0=function(_0x330073,_0x1fbd98){_0x330073=_0x330073-0x0;var _0xbf7965=_0xdd0c[_0x330073];return _0xbf7965;};'use strict';var _=require('lodash');var moment=require(_0xcdd0('0x0'));var jayson=require(_0xcdd0('0x1'));var client=jayson[_0xcdd0('0x2')]['http']({'port':0x2329});function request(_0xe8ed9,_0x5b86cb){return new Promise(function(_0x3d8684,_0x159e38){return client[_0xcdd0('0x3')](_0xe8ed9,_0x5b86cb)[_0xcdd0('0x4')](function(_0x17ad7d){if(_0x17ad7d['error']){return _0x159e38(_0x17ad7d[_0xcdd0('0x5')][_0xcdd0('0x6')]);}else{return _0x3d8684(_0x17ad7d[_0xcdd0('0x7')]);}})[_0xcdd0('0x8')](function(_0x337496){return _0x159e38(_0x337496);});});}exports['getSquareProjects']=function(){return request(_0xcdd0('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xcdd0('0xa')]=function(_0x31cf23){return request(_0xcdd0('0xb'),{'options':{'raw':![],'where':{'name':_0x31cf23},'attributes':[_0xcdd0('0xc')]}});};exports[_0xcdd0('0xd')]=function(_0x460fce){return request(_0xcdd0('0xe'),{'options':{'raw':![],'where':{'id':_0x460fce},'include':[{'model':_0xcdd0('0xf'),'as':_0xcdd0('0x10'),'include':[{'model':_0xcdd0('0x11'),'as':'CloudProvider'}]}],'attributes':['id','name',_0xcdd0('0x12')],'smtp':!![]}});};exports[_0xcdd0('0x13')]=function(_0x485711){return request(_0xcdd0('0xb'),{'options':{'where':{'id':_0x485711},'attributes':[_0xcdd0('0x14')]}});};exports['getVoiceQueueById']=function(_0x1fc89a){return request(_0xcdd0('0x15'),{'options':{'where':{'id':_0x1fc89a},'attributes':[_0xcdd0('0x14')]}});};exports[_0xcdd0('0x16')]=function(_0xc1c3d5){return request('ShowVariable',{'options':{'where':{'id':_0xc1c3d5},'attributes':['name']}});};exports[_0xcdd0('0x17')]=function(_0x1cd478){return request(_0xcdd0('0x18'),{'options':{'where':{'id':_0x1cd478},'attributes':[_0xcdd0('0x19')]}});};exports[_0xcdd0('0x1a')]=function(_0x3b07a1){return request(_0xcdd0('0x1b'),{'options':{'where':{'id':_0x3b07a1},'attributes':[_0xcdd0('0x14')]}});};exports[_0xcdd0('0x1c')]=function(_0x14d55b){return request('GetContactByPhone',{'options':{'where':{'phone':_0x14d55b[_0xcdd0('0x1d')]},'attributes':['id']}});};exports[_0xcdd0('0x1e')]=function(_0x5060fa){return request('ShowTrunk',{'options':{'where':{'id':_0x5060fa},'attributes':[_0xcdd0('0x14')]}});};exports[_0xcdd0('0x1f')]=function(_0x510b8d){return request(_0xcdd0('0x20'),{'options':{'where':{'id':_0x510b8d},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x4d038f){return request(_0xcdd0('0x21'),{'options':{'raw':![],'where':{'id':_0x4d038f},'include':[{'model':_0xcdd0('0x22'),'as':'Intervals'}]}});};exports[_0xcdd0('0x23')]=function(_0x31a3e6){return request(_0xcdd0('0x24'),{'options':{'where':{'id':_0x31a3e6},'attributes':['id','name']}});};exports[_0xcdd0('0x25')]=function(_0x7be0ac){return request('CreateSmsMessage',{'body':_0x7be0ac});};exports[_0xcdd0('0x26')]=function(_0x3586f6){return request('CreateSquareDetailsReport',{'body':_0x3586f6});};exports[_0xcdd0('0x27')]=function(_0x57704f){return request(_0xcdd0('0x28'),{'body':_[_0xcdd0('0x29')](_0x57704f,{'project_name':_0x57704f[_0xcdd0('0x2a')],'prev_project_name':_0x57704f['arg_2']||'','is_subproject':_0x57704f[_0xcdd0('0x2b')]?!![]:![],'leaveAt':moment()[_0xcdd0('0x2c')](_0xcdd0('0x2d'))})});};exports[_0xcdd0('0x2e')]=function(_0x1fa582){return request(_0xcdd0('0x2f'),{'body':_0x1fa582});};exports[_0xcdd0('0x30')]=function(_0x39ff27){return request(_0xcdd0('0x31'),{'body':_0x39ff27});};exports[_0xcdd0('0x32')]=function(_0x4074e0){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4074e0[_0xcdd0('0x1d')],'ListId':_0x4074e0[_0xcdd0('0x33')]}}})[_0xcdd0('0x4')](function(_0x5b8635){if(_0x5b8635){return _0x5b8635;}return request(_0xcdd0('0x34'),{'body':_0x4074e0});});};exports[_0xcdd0('0x35')]=function(_0x1a51c6){return request(_0xcdd0('0x36'),{'options':{'where':{'id':_0x1a51c6},'attributes':[_0xcdd0('0x14')]}});};exports['agentLogin']=function(_0x3b431f,_0x1b3e8e){return request(_0xcdd0('0x37'),{'body':{'interface':_0x1b3e8e},'options':{'where':_0x3b431f}});};exports['agentPause']=function(_0x5eb0cb,_0xa10863,_0x1697c3){return request(_0xcdd0('0x38'),{'body':{'type':_0xa10863,'uniqueid':_0x1697c3},'options':{'where':_0x5eb0cb}});};exports['agentUnpause']=function(_0x328b38){return request(_0xcdd0('0x39'),{'body':{},'options':{'where':_0x328b38}});};exports['agentLogout']=function(_0x42170f){return request(_0xcdd0('0x3a'),{'body':{},'options':{'where':_0x42170f}});}; \ 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 0e2b998..b44d300 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 _0x9e8a=['exports','./polly','./lex'];(function(_0x4f2773,_0x198100){var _0x4999d7=function(_0x5cf34c){while(--_0x5cf34c){_0x4f2773['push'](_0x4f2773['shift']());}};_0x4999d7(++_0x198100);}(_0x9e8a,0x112));var _0xa9e8=function(_0x381412,_0x5518a0){_0x381412=_0x381412-0x0;var _0x46b37b=_0x9e8a[_0x381412];return _0x46b37b;};var polly=require(_0xa9e8('0x0'));var lex=require(_0xa9e8('0x1'));module[_0xa9e8('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbbbd=['./lex','exports','./polly'];(function(_0x5cfe33,_0x406344){var _0x5b4ff3=function(_0x1192a6){while(--_0x1192a6){_0x5cfe33['push'](_0x5cfe33['shift']());}};_0x5b4ff3(++_0x406344);}(_0xbbbd,0x86));var _0xdbbb=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xbbbd[_0x45d55e];return _0x29812a;};var polly=require(_0xdbbb('0x0'));var lex=require(_0xdbbb('0x1'));module[_0xdbbb('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 913fc4d..7fad310 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 _0x6e6c=['exports','./lib/api'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);}; \ No newline at end of file +var _0x153f=['exports','./lib/api'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x153f,0x15b));var _0xf153=function(_0x648bf5,_0xe9f8a){_0x648bf5=_0x648bf5-0x0;var _0x1a1014=_0x153f[_0x648bf5];return _0x1a1014;};'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 f00d8ad..9404602 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(_0x487089,_0x4e9ba6){var _0x4506be=function(_0x213ea6){while(--_0x213ea6){_0x487089['push'](_0x487089['shift']());}};_0x4506be(++_0x4e9ba6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x966cbd,_0x5e2fb1){var _0x10bd47=function(_0x143ec4){while(--_0x143ec4){_0x966cbd['push'](_0x966cbd['shift']());}};_0x10bd47(++_0x5e2fb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 37ff63c..1f0140c 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 _0x046f=['./lib/api','exports'];(function(_0x57f0e9,_0x4dafbb){var _0x4fcb19=function(_0x401125){while(--_0x401125){_0x57f0e9['push'](_0x57f0e9['shift']());}};_0x4fcb19(++_0x4dafbb);}(_0x046f,0x1d8));var _0xf046=function(_0x531ed1,_0x74b376){_0x531ed1=_0x531ed1-0x0;var _0x3cbe81=_0x046f[_0x531ed1];return _0x3cbe81;};'use strict';var polly=require(_0xf046('0x0'));module[_0xf046('0x1')]=function(_0xef8e6c,_0x3828db,_0x47c287,_0x173e2b,_0x5e5c42,_0x354528,_0x2b7f50){return polly(_0xef8e6c,_0x3828db,_0x47c287,_0x173e2b,_0x5e5c42,_0x354528,_0x2b7f50);}; \ No newline at end of file +var _0xbb1d=['exports','./lib/api'];(function(_0x4a610e,_0x50ce9a){var _0x2505e3=function(_0x5819d8){while(--_0x5819d8){_0x4a610e['push'](_0x4a610e['shift']());}};_0x2505e3(++_0x50ce9a);}(_0xbb1d,0x15b));var _0xdbb1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbb1d[_0x5b644e];return _0x49c6bf;};'use strict';var polly=require(_0xdbb1('0x0'));module[_0xdbb1('0x1')]=function(_0xffc696,_0x1915f6,_0xade487,_0x257ed5,_0x18f0a5,_0x2fa79f,_0x50b99d){return polly(_0xffc696,_0x1915f6,_0xade487,_0x257ed5,_0x18f0a5,_0x2fa79f,_0x50b99d);}; \ 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 c1eb360..312dad2 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 _0xf3e5=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0xf3e5,0x194));var _0x5f3e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf3e5[_0x29b609];return _0x54c952;};'use strict';var fs=require('fs');var path=require(_0x5f3e('0x0'));var BPromise=require(_0x5f3e('0x1'));var rs=require(_0x5f3e('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x44f63e,_0x4d0920,_0x4f1ab6){return new BPromise(function(_0x14329b,_0x22b885){_0x44f63e[_0x5f3e('0x3')](_0x4d0920,function(_0x5581a6,_0x19ad39){if(_0x5581a6){_0x22b885(_0x5581a6);}else if(_0x19ad39){if(_0x19ad39[_0x5f3e('0x4')]instanceof Buffer){fs['writeFile'](_0x4f1ab6,_0x19ad39[_0x5f3e('0x4')],function(_0x43a0b2){if(_0x43a0b2){_0x22b885(_0x43a0b2);}else{_0x14329b();}});}else{_0x22b885(new Error(_0x5f3e('0x5')));}}else{_0x22b885(new Error(_0x5f3e('0x6')));}});});}module['exports']=function(_0x3c7124,_0x15d3da,_0x393232,_0x308a27,_0x5af02d,_0x2ec5b7,_0x2cf7fb){var _0x580b8e=new AWS[(_0x5f3e('0x7'))]({'accessKeyId':_0x3c7124,'secretAccessKey':_0x15d3da,'region':_0x393232});var _0x415b70={'Text':_0x5af02d,'TextType':_0x2ec5b7||_0x5f3e('0x8'),'OutputFormat':_0x5f3e('0x9'),'VoiceId':_0x308a27};return pollyResult(_0x580b8e,_0x415b70,_0x2cf7fb);}; \ No newline at end of file +var _0x6a63=['text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6a63,0x1a6));var _0x36a6=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x6a63[_0x243b2f];return _0xcb3c2d;};'use strict';var fs=require('fs');var path=require(_0x36a6('0x0'));var BPromise=require(_0x36a6('0x1'));var rs=require(_0x36a6('0x2'));var AWS=require(_0x36a6('0x3'));function pollyResult(_0x1db63c,_0x2d8baa,_0x5f45e6){return new BPromise(function(_0x94b495,_0x23906b){_0x1db63c[_0x36a6('0x4')](_0x2d8baa,function(_0x303f94,_0x58697e){if(_0x303f94){_0x23906b(_0x303f94);}else if(_0x58697e){if(_0x58697e[_0x36a6('0x5')]instanceof Buffer){fs[_0x36a6('0x6')](_0x5f45e6,_0x58697e[_0x36a6('0x5')],function(_0x3dcefe){if(_0x3dcefe){_0x23906b(_0x3dcefe);}else{_0x94b495();}});}else{_0x23906b(new Error(_0x36a6('0x7')));}}else{_0x23906b(new Error(_0x36a6('0x8')));}});});}module[_0x36a6('0x9')]=function(_0x6a0275,_0x2674bb,_0x83ef70,_0x378ef1,_0x4d825b,_0x7b04ab,_0x55b584){var _0x5cba10=new AWS['Polly']({'accessKeyId':_0x6a0275,'secretAccessKey':_0x2674bb,'region':_0x83ef70});var _0x360684={'Text':_0x4d825b,'TextType':_0x7b04ab||_0x36a6('0xa'),'OutputFormat':_0x36a6('0xb'),'VoiceId':_0x378ef1};return pollyResult(_0x5cba10,_0x360684,_0x55b584);}; \ 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 f81248a..4b53e12 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 _0x0a24=['exports'];(function(_0x4217fd,_0x383410){var _0x428abc=function(_0x2536ed){while(--_0x2536ed){_0x4217fd['push'](_0x4217fd['shift']());}};_0x428abc(++_0x383410);}(_0x0a24,0x186));var _0x40a2=function(_0x4e7cc3,_0x47ff4){_0x4e7cc3=_0x4e7cc3-0x0;var _0x42e46d=_0x0a24[_0x4e7cc3];return _0x42e46d;};'use strict';var asr=require('./lib/api');module[_0x40a2('0x0')]=function(_0x563423,_0xc830f3,_0x52d8c3,_0x4f162b){return asr(_0x563423,_0xc830f3,_0x52d8c3);}; \ No newline at end of file +var _0x55f2=['exports','./lib/api'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x55f2,0xfd));var _0x255f=function(_0x4120c5,_0x20c6fb){_0x4120c5=_0x4120c5-0x0;var _0x210f3c=_0x55f2[_0x4120c5];return _0x210f3c;};'use strict';var asr=require(_0x255f('0x0'));module[_0x255f('0x1')]=function(_0x2ef7b4,_0x23ee4e,_0x127125,_0xbaacc9){return asr(_0x2ef7b4,_0x23ee4e,_0x127125);}; \ 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 b4863cb..1a3363c 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 _0x6f7a=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x34ed61,_0x616868){var _0x39a808=function(_0x5c2ec7){while(--_0x5c2ec7){_0x34ed61['push'](_0x34ed61['shift']());}};_0x39a808(++_0x616868);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1fe22d,_0x515e3f){_0x1fe22d=_0x1fe22d-0x0;var _0x5e9c99=_0x6f7a[_0x1fe22d];return _0x5e9c99;};'use strict';var url=require(_0xa6f7('0x0'));var BPromise=require(_0xa6f7('0x1'));var fs=require('fs');var host=_0xa6f7('0x2');module[_0xa6f7('0x3')]=function(_0x4dd99d,_0x93614a,_0x407de3){return new BPromise(function(_0x12ecb8,_0x1da6dc){var _0x22e529;if(typeof _0x4dd99d!==_0xa6f7('0x4')||_0x4dd99d[_0xa6f7('0x5')]===0x0){return _0x1da6dc(_0xa6f7('0x6'));}if(typeof _0x93614a!==_0xa6f7('0x4')||_0x93614a[_0xa6f7('0x5')]===0x0){return _0x1da6dc(_0xa6f7('0x7'));}if(typeof _0x407de3!=='undefined'&&(typeof _0x407de3!=='string'||_0x407de3[_0xa6f7('0x5')]===0x0)){return _0x1da6dc(_0xa6f7('0x8'));}try{_0x22e529=fs[_0xa6f7('0x9')](_0x4dd99d)[_0xa6f7('0xa')](_0xa6f7('0xb'));}catch(_0x49a451){return _0x1da6dc(_0x49a451);}return _0x12ecb8({'method':'POST','uri':host+_0xa6f7('0xc')+_0x93614a,'body':{'config':{'encoding':_0xa6f7('0xd'),'sampleRateHertz':'8000','languageCode':_0x407de3},'audio':{'content':_0x22e529}},'json':!![]});});}; \ No newline at end of file +var _0xa25c=['undefined','length','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird','https://speech.googleapis.com','exports','string','key\x20should\x20be\x20a\x20string'];(function(_0x295df8,_0x1f9924){var _0x1c4b61=function(_0x55f262){while(--_0x55f262){_0x295df8['push'](_0x295df8['shift']());}};_0x1c4b61(++_0x1f9924);}(_0xa25c,0x13f));var _0xca25=function(_0x4c362a,_0x5e84b4){_0x4c362a=_0x4c362a-0x0;var _0x44b264=_0xa25c[_0x4c362a];return _0x44b264;};'use strict';var url=require('url');var BPromise=require(_0xca25('0x0'));var fs=require('fs');var host=_0xca25('0x1');module[_0xca25('0x2')]=function(_0x1dd0d4,_0x32baae,_0xc361f1){return new BPromise(function(_0x2cc2d6,_0x336741){var _0x498b8e;if(typeof _0x1dd0d4!==_0xca25('0x3')||_0x1dd0d4['length']===0x0){return _0x336741('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x32baae!==_0xca25('0x3')||_0x32baae['length']===0x0){return _0x336741(_0xca25('0x4'));}if(typeof _0xc361f1!==_0xca25('0x5')&&(typeof _0xc361f1!==_0xca25('0x3')||_0xc361f1[_0xca25('0x6')]===0x0)){return _0x336741(_0xca25('0x7'));}try{_0x498b8e=fs['readFileSync'](_0x1dd0d4)['toString'](_0xca25('0x8'));}catch(_0x520a0a){return _0x336741(_0x520a0a);}return _0x2cc2d6({'method':_0xca25('0x9'),'uri':host+_0xca25('0xa')+_0x32baae,'body':{'config':{'encoding':_0xca25('0xb'),'sampleRateHertz':'8000','languageCode':_0xc361f1},'audio':{'content':_0x498b8e}},'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 f39424f..803fdd7 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 _0xed04=['./asr','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xed04,0xfe));var _0x4ed0=function(_0xb250f6,_0x587262){_0xb250f6=_0xb250f6-0x0;var _0x28050f=_0xed04[_0xb250f6];return _0x28050f;};var asr=require(_0x4ed0('0x0'));module[_0x4ed0('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7c82=['exports'];(function(_0x3e5de0,_0x2aa52b){var _0x247d28=function(_0x558b6f){while(--_0x558b6f){_0x3e5de0['push'](_0x3e5de0['shift']());}};_0x247d28(++_0x2aa52b);}(_0x7c82,0x15a));var _0x27c8=function(_0x16d348,_0xc8f61f){_0x16d348=_0x16d348-0x0;var _0x55de5a=_0x7c82[_0x16d348];return _0x55de5a;};var asr=require('./asr');module[_0x27c8('0x0')]={'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 c6d9a7e..9ebdf08 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 _0x4f34=['transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','https:','\x20failed,\x20status\x20code\x20=\x20','transcode','wav','finish\x20to\x20convert','resolve','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','voice','audioConfig','POST','tmp','.mp3','from','writeFile','googleCloudTTS\x20path','application/x-www-form-urlencoded','f.req=','null','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives'];(function(_0x445e0d,_0x581182){var _0xdc2ab=function(_0x14a550){while(--_0x14a550){_0x445e0d['push'](_0x445e0d['shift']());}};_0xdc2ab(++_0x581182);}(_0x4f34,0xb2));var _0x44f3=function(_0x333b26,_0x241001){_0x333b26=_0x333b26-0x0;var _0x2c7ff9=_0x4f34[_0x333b26];return _0x2c7ff9;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x44f3('0x0'));var fs=require('fs');var http=require(_0x44f3('0x1'));var https=require(_0x44f3('0x2'));var md5=require(_0x44f3('0x3'));var path=require(_0x44f3('0x4'));var querystring=require(_0x44f3('0x5'));var rp=require(_0x44f3('0x6'));var rs=require('randomstring');var sox=require(_0x44f3('0x7'));var tts=require(_0x44f3('0x8'));var urlParse=require(_0x44f3('0x9'))['parse'];var util=require(_0x44f3('0xa'));var aws=require(_0x44f3('0xb'));var google=require(_0x44f3('0xc'));var sestek=require(_0x44f3('0xd'));var tilde=require(_0x44f3('0xe'));var logger=require('../../../config/logger')(_0x44f3('0xf'));var ISPEECH_API=_0x44f3('0x10');function downloadFile(_0x37a211,_0x4f0c9f){return new BPromise(function(_0x572e8d,_0x493dad){var _0x3c5fe4=urlParse(_0x37a211);var _0x3f3296=_0x3c5fe4['protocol']==='https:'?https:http;var _0x5bee28={'host':_0x3c5fe4[_0x44f3('0x11')],'path':_0x3c5fe4[_0x44f3('0x4')],'headers':{'user-agent':_0x44f3('0x12')}};_0x3f3296[_0x44f3('0x13')](_0x5bee28,function(_0x441fa6){if(_0x441fa6[_0x44f3('0x14')]!==0xc8){logger[_0x44f3('0x15')](_0x44f3('0x16')+_0x37a211+'\x20failed,\x20status\x20code\x20=\x20'+_0x441fa6[_0x44f3('0x14')]+'\x20('+_0x441fa6[_0x44f3('0x17')]+')');_0x493dad(new Error('request\x20to\x20'+_0x37a211+'\x20failed,\x20status\x20code\x20=\x20'+_0x441fa6[_0x44f3('0x14')]+'\x20('+_0x441fa6[_0x44f3('0x17')]+')'));return;}var _0x1a82ea=fs['createWriteStream'](_0x4f0c9f);_0x1a82ea['on']('finish',function(){logger[_0x44f3('0x18')](_0x44f3('0x19'));_0x1a82ea['close'](_0x572e8d);});_0x1a82ea['on'](_0x44f3('0x15'),function(_0x7175ae){fs[_0x44f3('0x1a')](_0x4f0c9f);logger[_0x44f3('0x15')](_0x44f3('0x1b'),_0x7175ae);_0x493dad(_0x7175ae);});_0x441fa6[_0x44f3('0x1c')](_0x1a82ea);})['on'](_0x44f3('0x15'),function(_0x510b38){logger[_0x44f3('0x15')](_0x510b38);_0x493dad(_0x510b38);})[_0x44f3('0x1d')]();});}function uploadFile(_0x1f8063){return new BPromise(function(_0x179519,_0x6b2bfa){var _0x2b1f4b=urlParse(_0x1f8063);var _0x5d13bc=_0x2b1f4b['protocol']===_0x44f3('0x1e')?https:http;var _0xc173f6={'host':_0x2b1f4b['host'],'path':_0x2b1f4b[_0x44f3('0x4')],'headers':{'user-agent':_0x44f3('0x12')}};_0x5d13bc[_0x44f3('0x13')](_0xc173f6,function(_0x55b710){if(_0x55b710[_0x44f3('0x14')]!==0xc8){_0x6b2bfa(new Error(_0x44f3('0x16')+_0x1f8063+_0x44f3('0x1f')+_0x55b710[_0x44f3('0x14')]+'\x20('+_0x55b710[_0x44f3('0x17')]+')'));return;}var _0xbb7230='';_0x55b710['on']('data',function(_0x132fa7){_0xbb7230+=_0x132fa7;});_0x55b710['on'](_0x44f3('0x1d'),function(){_0x179519(_0xbb7230);});})['on'](_0x44f3('0x15'),function(_0x2e846b){_0x6b2bfa(_0x2e846b);})[_0x44f3('0x1d')]();});}function convertFile(_0x2de48c,_0xc5a069){return new BPromise(function(_0x33d1b8,_0x18be83){var _0x4307b9=sox[_0x44f3('0x20')](_0x2de48c,_0xc5a069,{'sampleRate':0x1f40,'format':_0x44f3('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4307b9['on'](_0x44f3('0x15'),function(_0x543b07){logger[_0x44f3('0x15')]('error\x20convert',_0x543b07);_0x18be83(_0x543b07);});_0x4307b9['on'](_0x44f3('0x1d'),function(){logger['info'](_0x44f3('0x22'));_0x33d1b8();});_0x4307b9['start']();});}function base64Decode(_0x288dc5,_0x3c0919){var _0x118567=path[_0x44f3('0x23')](__dirname,'tmp',rs[_0x44f3('0x24')](0x4)+'.wav');fs[_0x44f3('0x25')](_0x118567,_0x288dc5,_0x44f3('0x26'));return convertFile(_0x118567,_0x3c0919)[_0x44f3('0x27')](function(){try{fs[_0x44f3('0x1a')](_0x118567);fs[_0x44f3('0x28')](_0x3c0919,_0x44f3('0x29'));}catch(_0x493858){logger[_0x44f3('0x15')](_0x493858);}return _0x3c0919[_0x44f3('0x2a')]('.')[0x0];});}function base64Encode(_0x4c9e7f){var _0xddd0d=fs[_0x44f3('0x2b')](_0x4c9e7f);return new Buffer(_0xddd0d)['toString']('base64');}exports[_0x44f3('0x2c')]=function(_0x1cc196,_0xc4b4d8,_0x220f1b,_0x3ed44b,_0x357586,_0x275c4d){var _0x1a4f34,_0x34c765;var _0x538eca=_0x44f3('0x2d');var _0x3c96af='?key='+_0x1cc196;var _0x563468={};if(_0xc4b4d8===_0x44f3('0x2e')){_0x563468['input']={'ssml':_0x220f1b};}else{_0x563468['input']={'text':_0x220f1b};};_0x563468[_0x44f3('0x2f')]={'languageCode':_0x3ed44b,'ssmlGender':_0x357586};_0x563468[_0x44f3('0x30')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4f6618={'url':_0x538eca+'text:synthesize'+_0x3c96af,'method':_0x44f3('0x31'),'json':!![],'body':_0x563468};return rp(_0x4f6618)[_0x44f3('0x27')](function(_0x184c15){return new BPromise(function(_0x263ec8,_0x39e03f){_0x1a4f34=path['resolve'](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x33'));var _0x5ef9f4=Buffer[_0x44f3('0x34')](_0x184c15['audioContent'],'base64');return fs[_0x44f3('0x35')](_0x1a4f34,_0x5ef9f4,function(_0x119d71){_0x39e03f(_0x119d71);},function(_0x1ced5e){fs['chmodSync'](_0x1a4f34,'777');_0x263ec8(_0x1ced5e);});});})[_0x44f3('0x27')](function(_0x236f7a){_0x34c765=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+'.wav');return convertFile(_0x1a4f34,_0x34c765);})[_0x44f3('0x27')](function(){try{fs[_0x44f3('0x1a')](_0x1a4f34);fs['chmodSync'](_0x34c765,_0x44f3('0x29'));}catch(_0x3f82db){logger[_0x44f3('0x15')](_0x3f82db);}logger[_0x44f3('0x18')](_0x44f3('0x36'),_0x34c765['split']('.')[0x0]);return _0x34c765[_0x44f3('0x2a')]('.')[0x0];});};exports['googleTTS']=function(_0x475e59,_0x40178d){var _0x463c36='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x2653e0,_0x26221c;var _0x4fb9e2;var _0xad551a={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x463c36,'headers':{'Content-Type':_0x44f3('0x37')},'body':_0x44f3('0x38')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x475e59,_0x40178d||'en',![],_0x44f3('0x39')]),null,'generic']]]))};return rp(_0xad551a)['then'](function(_0x221b81){try{_0x4fb9e2=eval(_0x221b81['slice'](0x5))[0x0][0x2];}catch(_0x170188){throw new Error(_0x44f3('0x3a')+_0x221b81[_0x44f3('0x3b')]);}if(!_0x4fb9e2){if(_0x475e59[_0x44f3('0x3c')]>0xc8){throw new Error(_0x44f3('0x3d'));}else{throw new Error(_0x44f3('0x3e')+_0x40178d+_0x44f3('0x3f'));}}try{_0x4fb9e2=eval(_0x4fb9e2)[0x0];}catch(_0x504ab6){throw new Error(_0x44f3('0x3a')+res[_0x44f3('0x3b')]);}const _0x16e6e4=_0x4fb9e2;_0x2653e0=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x33'));fs[_0x44f3('0x25')](_0x2653e0,_0x4fb9e2,{'encoding':_0x44f3('0x26')});_0x26221c=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x40'));return convertFile(_0x2653e0,_0x26221c);})[_0x44f3('0x27')](function(){try{fs[_0x44f3('0x1a')](_0x2653e0);fs['chmodSync'](_0x26221c,_0x44f3('0x29'));}catch(_0x2e1cba){logger[_0x44f3('0x15')](_0x2e1cba);}logger[_0x44f3('0x18')](_0x44f3('0x41'),_0x26221c['split']('.')[0x0]);return _0x26221c[_0x44f3('0x2a')]('.')[0x0];});};exports[_0x44f3('0x42')]=function(_0x322b1c,_0x2bd5c9,_0x193055){return google[_0x44f3('0x43')](_0x322b1c,_0x2bd5c9,_0x193055)[_0x44f3('0x27')](function(_0x3fb9f1){logger[_0x44f3('0x18')](_0x3fb9f1[_0x44f3('0x44')]);return rp(_0x3fb9f1);})[_0x44f3('0x27')](function(_0x4338e6){var _0x19562d='';var _0x3f578b=0x0;try{fs[_0x44f3('0x1a')](_0x322b1c);}catch(_0x44e9f9){logger[_0x44f3('0x15')](_0x44e9f9);}if(_0x4338e6&&_0x4338e6[_0x44f3('0x45')]){_0x19562d=_0x4338e6[_0x44f3('0x45')][_0x44f3('0x46')](function(_0x421c12){return _0x421c12&&_0x421c12[_0x44f3('0x47')][0x0]&&_0x421c12[_0x44f3('0x47')][0x0][_0x44f3('0x48')]?_0x421c12[_0x44f3('0x47')][0x0][_0x44f3('0x48')]:'';})['join']('\x0a');_0x3f578b=_0x4338e6[_0x44f3('0x45')][_0x44f3('0x46')](function(_0x2243a1){return _0x2243a1&&_0x2243a1[_0x44f3('0x47')][0x0]&&_0x2243a1['alternatives'][0x0][_0x44f3('0x49')]?_0x2243a1[_0x44f3('0x47')][0x0][_0x44f3('0x49')]:0x0;})['join']('\x0a');}logger['info'](_0x44f3('0x4a'),_0x19562d);logger[_0x44f3('0x18')](_0x44f3('0x4b'),_0x3f578b);return{'transcript':_0x19562d,'confidence':_0x3f578b};})[_0x44f3('0x4c')](function(_0x9d214a){logger[_0x44f3('0x15')](_0x44f3('0x4d'),_0x9d214a[_0x44f3('0x14')],_0x9d214a[_0x44f3('0x4e')],_0x9d214a['message']);});};exports[_0x44f3('0x4f')]=function(_0x3222b8,_0x20491d,_0x5c480c,_0x333c0e){var _0x1f0c92=apiai(_0x20491d,{'language':_0x333c0e||'en'});return _0x1f0c92[_0x44f3('0x50')](_0x5c480c,{'sessionId':md5(_0x3222b8)})['then'](function(_0x2b3ee1){logger[_0x44f3('0x18')](JSON['stringify'](_0x2b3ee1));return{'source':_0x2b3ee1[_0x44f3('0x51')]['source'],'resolvedQuery':_0x2b3ee1[_0x44f3('0x51')][_0x44f3('0x52')],'action':_0x2b3ee1[_0x44f3('0x51')][_0x44f3('0x53')],'actionIncomplete':_0x2b3ee1['result'][_0x44f3('0x54')],'speech':_0x2b3ee1[_0x44f3('0x51')]['fulfillment']['speech'],'score':_0x2b3ee1[_0x44f3('0x51')]['score'],'statusCode':_0x2b3ee1[_0x44f3('0x55')][_0x44f3('0x56')],'endConversation':_0x2b3ee1[_0x44f3('0x51')]['metadata'][_0x44f3('0x57')]||![],'isFallbackIntent':_0x2b3ee1[_0x44f3('0x51')][_0x44f3('0x58')][_0x44f3('0x59')]};});};exports[_0x44f3('0x5a')]=function(_0x2e3c1e,_0x2f8d1f,_0x226d1e,_0x59c58f,_0x45c9c2,_0x2b0106){var _0x1cbcf2=_0x59c58f['replace'](/\\n/g,'\x0a');var _0x45a13d={'credentials':{'private_key':_0x1cbcf2,'client_email':_0x226d1e}};var _0x23855d=new dialogflow[(_0x44f3('0x5b'))](_0x45a13d);var _0x13e390=_0x23855d['sessionPath'](_0x2f8d1f,md5(_0x2e3c1e));var _0x255350={'session':_0x13e390,'queryInput':{'text':{'text':_0x45c9c2,'languageCode':_0x2b0106}}};return _0x23855d[_0x44f3('0x5c')](_0x255350)[_0x44f3('0x27')](function(_0x167689){if(_0x167689&&_0x167689[_0x44f3('0x3c')]){logger[_0x44f3('0x18')](_0x44f3('0x5d'),JSON[_0x44f3('0x5e')](_0x167689));var _0x1cb7f0=_0x167689[0x0];if(_0x1cb7f0){var _0x41b337={'action':_0x1cb7f0[_0x44f3('0x5f')]['action'],'allRequiredParamsPresent':_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x60')],'endConversation':_0x1cb7f0['queryResult'][_0x44f3('0x61')]&&_0x1cb7f0['queryResult'][_0x44f3('0x61')][_0x44f3('0x62')]?_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x61')][_0x44f3('0x62')][_0x44f3('0x63')][_0x44f3('0x64')]:![],'fulfillmentText':_0x1cb7f0[_0x44f3('0x5f')]['fulfillmentText'],'intentName':_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x65')][_0x44f3('0x4e')],'intentDisplayName':_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x65')][_0x44f3('0x66')],'isFallbackIntent':_0x1cb7f0['queryResult'][_0x44f3('0x65')]['isFallback'],'languageCode':_0x1cb7f0['queryResult']['languageCode'],'queryText':_0x1cb7f0[_0x44f3('0x5f')]['queryText'],'responseId':_0x1cb7f0['responseId'],'score':_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x67')],'speech':_0x1cb7f0[_0x44f3('0x5f')][_0x44f3('0x68')],'providerResponse':JSON[_0x44f3('0x5e')](_0x167689)};return _0x41b337;}}});};exports['tildeASR']=function(_0x41185e,_0x1867a6,_0x1b06aa,_0x44a540){return tilde[_0x44f3('0x43')](_0x41185e,_0x1867a6,_0x1b06aa,_0x44a540)[_0x44f3('0x27')](function(_0x15613b){try{fs['unlink'](_0x41185e);}catch(_0x43ec6b){logger[_0x44f3('0x15')](_0x43ec6b);}logger['info'](_0x44f3('0x69'),_0x15613b[_0x44f3('0x48')]);logger[_0x44f3('0x18')](_0x44f3('0x6a'),_0x15613b[_0x44f3('0x49')]);return _0x15613b;});};exports[_0x44f3('0x6b')]=function(_0x26ba68,_0x59b3e7,_0x3bbfea,_0x48cfea,_0x3e426b,_0x5b8061){var _0x128a88=path['resolve'](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x33'));var _0x10ecfd;return aws[_0x44f3('0x6c')](_0x26ba68,_0x59b3e7,_0x3bbfea,_0x48cfea,_0x3e426b,_0x5b8061,_0x128a88)['then'](function(){_0x10ecfd=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x40'));return convertFile(_0x128a88,_0x10ecfd);})[_0x44f3('0x27')](function(){try{fs[_0x44f3('0x1a')](_0x128a88);fs[_0x44f3('0x28')](_0x10ecfd,_0x44f3('0x29'));}catch(_0x2ec8e4){logger[_0x44f3('0x15')](_0x2ec8e4);}return _0x10ecfd[_0x44f3('0x2a')]('.')[0x0];});};exports[_0x44f3('0x6d')]=function(_0x2950ba,_0x48f4a3,_0x1b1177,_0x58fb6e,_0x3ff2a4,_0x2e0090){return aws[_0x44f3('0x6e')](_0x2950ba,_0x48f4a3,_0x1b1177,_0x58fb6e,_0x3ff2a4,_0x2e0090)['then'](function(_0x5d0cc5){logger['info'](JSON[_0x44f3('0x5e')](_0x5d0cc5));return _0x5d0cc5;});};exports['ispeechTTS']=function(_0xd2cbbc,_0x240673,_0x2a2093,_0x4ac5e2){var _0x29cb94=util['format'](_0x44f3('0x6f'),ISPEECH_API,_0xd2cbbc,encodeURIComponent(_0x240673),_0x2a2093,_0x4ac5e2);var _0x306991=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x33'));var _0xb045ed;return downloadFile(_0x29cb94,_0x306991)[_0x44f3('0x27')](function(){_0xb045ed=path[_0x44f3('0x23')](__dirname,_0x44f3('0x32'),rs[_0x44f3('0x24')](0x4)+_0x44f3('0x40'));return convertFile(_0x306991,_0xb045ed);})[_0x44f3('0x27')](function(){try{fs[_0x44f3('0x1a')](_0x306991);fs[_0x44f3('0x28')](_0xb045ed,'777');}catch(_0x4c15ee){logger[_0x44f3('0x15')](_0x4c15ee);}return _0xb045ed[_0x44f3('0x2a')]('.')[0x0];});};exports[_0x44f3('0x70')]=function(_0x396c76,_0x187b95,_0x179972,_0xb2cf64){var _0x281b81=util[_0x44f3('0x71')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x187b95,_0x179972,base64Encode(_0x396c76),_0xb2cf64?util[_0x44f3('0x71')](_0x44f3('0x72'),encodeURIComponent(_0xb2cf64)):_0x44f3('0x73'));return uploadFile(_0x281b81)[_0x44f3('0x27')](function(_0x3d3d8d){return querystring['parse'](_0x3d3d8d);});};exports[_0x44f3('0x74')]=function(_0x1e8f6d,_0xd3cdc0){return sestek[_0x44f3('0x75')](_0x1e8f6d,_0xd3cdc0)[_0x44f3('0x27')](function(_0x32aed9){logger[_0x44f3('0x18')](JSON['stringify'](_0x32aed9));var _0x1bdd2c={'speech':_0x32aed9[_0x44f3('0x76')],'action':_0x32aed9[_0x44f3('0x77')]?_0x32aed9[_0x44f3('0x77')][_0x44f3('0x78')]:undefined,'actiondata':_0x32aed9[_0x44f3('0x77')]?_0x32aed9[_0x44f3('0x77')][_0x44f3('0x79')]:undefined};if(_0x32aed9[_0x44f3('0x77')]&&_0x32aed9[_0x44f3('0x77')]['AudioFromTts']){return base64Decode(_0x32aed9[_0x44f3('0x77')][_0x44f3('0x7a')]['Data'],path[_0x44f3('0x23')](__dirname,'tmp',rs[_0x44f3('0x24')](0x4)+_0x44f3('0x40')))[_0x44f3('0x27')](function(_0xfd7bfc){_0x1bdd2c[_0x44f3('0x7b')]=_0xfd7bfc;return _0x1bdd2c;});}return _0x1bdd2c;});};exports[_0x44f3('0x7c')]=function(){return __dirname;}; \ No newline at end of file +var _0xaec9=['jQ1olc','null','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','diagnosticInfo','fields','boolValue','fulfillmentText','intent','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','randomstring','sox','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','error','unlink','download\x20error','pipe','end','https:','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','resolve','.wav','writeFileSync','base64','chmodSync','777','split','toString','googleCloudTTS','?key=','input','audioConfig','MP3','POST','then','tmp','generate','.mp3','from','audioContent','writeFile','googleTTS','utf8','application/x-www-form-urlencoded','stringify'];(function(_0x30b5a7,_0x116b62){var _0x21e13c=function(_0x59e72f){while(--_0x59e72f){_0x30b5a7['push'](_0x30b5a7['shift']());}};_0x21e13c(++_0x116b62);}(_0xaec9,0x1cd));var _0x9aec=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0xaec9[_0xfd9b19];return _0x514918;};'use strict';var apiai=require(_0x9aec('0x0'));var BPromise=require(_0x9aec('0x1'));var dialogflow=require(_0x9aec('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x9aec('0x3'));var path=require(_0x9aec('0x4'));var querystring=require(_0x9aec('0x5'));var rp=require(_0x9aec('0x6'));var rs=require(_0x9aec('0x7'));var sox=require(_0x9aec('0x8'));var tts=require('google-tts-api');var urlParse=require('url')[_0x9aec('0x9')];var util=require(_0x9aec('0xa'));var aws=require(_0x9aec('0xb'));var google=require(_0x9aec('0xc'));var sestek=require(_0x9aec('0xd'));var tilde=require(_0x9aec('0xe'));var logger=require(_0x9aec('0xf'))(_0x9aec('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x19c205,_0x33d098){return new BPromise(function(_0x1a4c73,_0x4fc3d3){var _0x455e78=urlParse(_0x19c205);var _0x26f134=_0x455e78[_0x9aec('0x11')]==='https:'?https:http;var _0x2031cd={'host':_0x455e78[_0x9aec('0x12')],'path':_0x455e78[_0x9aec('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x26f134[_0x9aec('0x13')](_0x2031cd,function(_0x266af7){if(_0x266af7[_0x9aec('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x19c205+'\x20failed,\x20status\x20code\x20=\x20'+_0x266af7[_0x9aec('0x14')]+'\x20('+_0x266af7['statusMessage']+')');_0x4fc3d3(new Error(_0x9aec('0x15')+_0x19c205+_0x9aec('0x16')+_0x266af7[_0x9aec('0x14')]+'\x20('+_0x266af7[_0x9aec('0x17')]+')'));return;}var _0x5db987=fs[_0x9aec('0x18')](_0x33d098);_0x5db987['on'](_0x9aec('0x19'),function(){logger[_0x9aec('0x1a')]('finish\x20download\x20file');_0x5db987['close'](_0x1a4c73);});_0x5db987['on'](_0x9aec('0x1b'),function(_0x71bb3d){fs[_0x9aec('0x1c')](_0x33d098);logger['error'](_0x9aec('0x1d'),_0x71bb3d);_0x4fc3d3(_0x71bb3d);});_0x266af7[_0x9aec('0x1e')](_0x5db987);})['on'](_0x9aec('0x1b'),function(_0x31c058){logger[_0x9aec('0x1b')](_0x31c058);_0x4fc3d3(_0x31c058);})[_0x9aec('0x1f')]();});}function uploadFile(_0x2b229c){return new BPromise(function(_0x162082,_0x293e5d){var _0x27ba74=urlParse(_0x2b229c);var _0xc270c=_0x27ba74[_0x9aec('0x11')]===_0x9aec('0x20')?https:http;var _0x29ff6b={'host':_0x27ba74['host'],'path':_0x27ba74[_0x9aec('0x4')],'headers':{'user-agent':_0x9aec('0x21')}};_0xc270c[_0x9aec('0x13')](_0x29ff6b,function(_0x47a28b){if(_0x47a28b['statusCode']!==0xc8){_0x293e5d(new Error('request\x20to\x20'+_0x2b229c+'\x20failed,\x20status\x20code\x20=\x20'+_0x47a28b['statusCode']+'\x20('+_0x47a28b[_0x9aec('0x17')]+')'));return;}var _0x239199='';_0x47a28b['on'](_0x9aec('0x22'),function(_0x2ef14a){_0x239199+=_0x2ef14a;});_0x47a28b['on']('end',function(){_0x162082(_0x239199);});})['on'](_0x9aec('0x1b'),function(_0x599281){_0x293e5d(_0x599281);})[_0x9aec('0x1f')]();});}function convertFile(_0x434e18,_0xc140ab){return new BPromise(function(_0x4956bd,_0x113c6f){var _0x7aca9e=sox['transcode'](_0x434e18,_0xc140ab,{'sampleRate':0x1f40,'format':_0x9aec('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7aca9e['on'](_0x9aec('0x1b'),function(_0x4488aa){logger[_0x9aec('0x1b')](_0x9aec('0x24'),_0x4488aa);_0x113c6f(_0x4488aa);});_0x7aca9e['on'](_0x9aec('0x1f'),function(){logger[_0x9aec('0x1a')](_0x9aec('0x25'));_0x4956bd();});_0x7aca9e['start']();});}function base64Decode(_0x1dd607,_0x25c4cc){var _0x4bfe87=path[_0x9aec('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x9aec('0x27'));fs[_0x9aec('0x28')](_0x4bfe87,_0x1dd607,_0x9aec('0x29'));return convertFile(_0x4bfe87,_0x25c4cc)['then'](function(){try{fs[_0x9aec('0x1c')](_0x4bfe87);fs[_0x9aec('0x2a')](_0x25c4cc,_0x9aec('0x2b'));}catch(_0x1d3d5e){logger[_0x9aec('0x1b')](_0x1d3d5e);}return _0x25c4cc[_0x9aec('0x2c')]('.')[0x0];});}function base64Encode(_0xd2d720){var _0x294550=fs['readFileSync'](_0xd2d720);return new Buffer(_0x294550)[_0x9aec('0x2d')](_0x9aec('0x29'));}exports[_0x9aec('0x2e')]=function(_0x927fbc,_0x40965f,_0x50ed23,_0x5c12ea,_0x37df9e,_0x37ae77){var _0x3e55a2,_0x43022a;var _0x5f1d66='https://texttospeech.googleapis.com/v1/';var _0x540a41=_0x9aec('0x2f')+_0x927fbc;var _0x4b3373={};if(_0x40965f==='ssml'){_0x4b3373[_0x9aec('0x30')]={'ssml':_0x50ed23};}else{_0x4b3373[_0x9aec('0x30')]={'text':_0x50ed23};};_0x4b3373['voice']={'languageCode':_0x5c12ea,'ssmlGender':_0x37df9e};_0x4b3373[_0x9aec('0x31')]={'audioEncoding':_0x9aec('0x32'),'sampleRateHertz':0x1f40};var _0x4d95e8={'url':_0x5f1d66+'text:synthesize'+_0x540a41,'method':_0x9aec('0x33'),'json':!![],'body':_0x4b3373};return rp(_0x4d95e8)[_0x9aec('0x34')](function(_0x33e71f){return new BPromise(function(_0x355800,_0x370668){_0x3e55a2=path[_0x9aec('0x26')](__dirname,_0x9aec('0x35'),rs[_0x9aec('0x36')](0x4)+_0x9aec('0x37'));var _0x5d0bc0=Buffer[_0x9aec('0x38')](_0x33e71f[_0x9aec('0x39')],'base64');return fs[_0x9aec('0x3a')](_0x3e55a2,_0x5d0bc0,function(_0x35c470){_0x370668(_0x35c470);},function(_0xf6832f){fs[_0x9aec('0x2a')](_0x3e55a2,_0x9aec('0x2b'));_0x355800(_0xf6832f);});});})[_0x9aec('0x34')](function(_0x39cea4){_0x43022a=path[_0x9aec('0x26')](__dirname,_0x9aec('0x35'),rs['generate'](0x4)+_0x9aec('0x27'));return convertFile(_0x3e55a2,_0x43022a);})[_0x9aec('0x34')](function(){try{fs[_0x9aec('0x1c')](_0x3e55a2);fs['chmodSync'](_0x43022a,_0x9aec('0x2b'));}catch(_0x4168a2){logger[_0x9aec('0x1b')](_0x4168a2);}logger[_0x9aec('0x1a')]('googleCloudTTS\x20path',_0x43022a[_0x9aec('0x2c')]('.')[0x0]);return _0x43022a[_0x9aec('0x2c')]('.')[0x0];});};exports[_0x9aec('0x3b')]=function(_0x5e7f70,_0x2fa426){var _0x3569c3='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x270eb8,_0x652bae;var _0x1bc54a;var _0xf5040b={'encoding':_0x9aec('0x3c'),'method':_0x9aec('0x33'),'timeout':0x2710,'url':_0x3569c3,'headers':{'Content-Type':_0x9aec('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0x9aec('0x3e')]([[[_0x9aec('0x3f'),JSON[_0x9aec('0x3e')]([_0x5e7f70,_0x2fa426||'en',![],_0x9aec('0x40')]),null,'generic']]]))};return rp(_0xf5040b)['then'](function(_0x1804a3){try{_0x1bc54a=eval(_0x1804a3[_0x9aec('0x41')](0x5))[0x0][0x2];}catch(_0x2f1e9a){throw new Error('parse\x20response\x20failed:\x0a'+_0x1804a3['data']);}if(!_0x1bc54a){if(_0x5e7f70[_0x9aec('0x42')]>0xc8){throw new Error(_0x9aec('0x43'));}else{throw new Error(_0x9aec('0x44')+_0x2fa426+_0x9aec('0x45'));}}try{_0x1bc54a=eval(_0x1bc54a)[0x0];}catch(_0x37b1a6){throw new Error(_0x9aec('0x46')+res[_0x9aec('0x22')]);}const _0x26e0e7=_0x1bc54a;_0x270eb8=path[_0x9aec('0x26')](__dirname,_0x9aec('0x35'),rs[_0x9aec('0x36')](0x4)+_0x9aec('0x37'));fs[_0x9aec('0x28')](_0x270eb8,_0x1bc54a,{'encoding':_0x9aec('0x29')});_0x652bae=path['resolve'](__dirname,_0x9aec('0x35'),rs['generate'](0x4)+_0x9aec('0x27'));return convertFile(_0x270eb8,_0x652bae);})[_0x9aec('0x34')](function(){try{fs['unlink'](_0x270eb8);fs[_0x9aec('0x2a')](_0x652bae,_0x9aec('0x2b'));}catch(_0x1a523c){logger['error'](_0x1a523c);}logger[_0x9aec('0x1a')](_0x9aec('0x47'),_0x652bae[_0x9aec('0x2c')]('.')[0x0]);return _0x652bae[_0x9aec('0x2c')]('.')[0x0];});};exports[_0x9aec('0x48')]=function(_0x9a4d10,_0x3c560d,_0x192ae7){return google['asr'](_0x9a4d10,_0x3c560d,_0x192ae7)[_0x9aec('0x34')](function(_0x629444){logger[_0x9aec('0x1a')](_0x629444[_0x9aec('0x49')]);return rp(_0x629444);})[_0x9aec('0x34')](function(_0x5d9a68){var _0x56da9f='';var _0x4da7c7=0x0;try{fs[_0x9aec('0x1c')](_0x9a4d10);}catch(_0x131516){logger[_0x9aec('0x1b')](_0x131516);}if(_0x5d9a68&&_0x5d9a68['results']){_0x56da9f=_0x5d9a68[_0x9aec('0x4a')][_0x9aec('0x4b')](function(_0x4301e8){return _0x4301e8&&_0x4301e8['alternatives'][0x0]&&_0x4301e8[_0x9aec('0x4c')][0x0][_0x9aec('0x4d')]?_0x4301e8[_0x9aec('0x4c')][0x0]['transcript']:'';})[_0x9aec('0x4e')]('\x0a');_0x4da7c7=_0x5d9a68[_0x9aec('0x4a')][_0x9aec('0x4b')](function(_0x570204){return _0x570204&&_0x570204[_0x9aec('0x4c')][0x0]&&_0x570204[_0x9aec('0x4c')][0x0][_0x9aec('0x4f')]?_0x570204[_0x9aec('0x4c')][0x0][_0x9aec('0x4f')]:0x0;})['join']('\x0a');}logger[_0x9aec('0x1a')](_0x9aec('0x50'),_0x56da9f);logger[_0x9aec('0x1a')](_0x9aec('0x51'),_0x4da7c7);return{'transcript':_0x56da9f,'confidence':_0x4da7c7};})[_0x9aec('0x52')](function(_0x10abda){logger[_0x9aec('0x1b')](_0x9aec('0x53'),_0x10abda[_0x9aec('0x14')],_0x10abda[_0x9aec('0x54')],_0x10abda[_0x9aec('0x55')]);});};exports[_0x9aec('0x56')]=function(_0x5a5d34,_0x590500,_0x35a55d,_0x440543){var _0x2cbdb4=apiai(_0x590500,{'language':_0x440543||'en'});return _0x2cbdb4[_0x9aec('0x57')](_0x35a55d,{'sessionId':md5(_0x5a5d34)})[_0x9aec('0x34')](function(_0x369036){logger['info'](JSON[_0x9aec('0x3e')](_0x369036));return{'source':_0x369036[_0x9aec('0x58')][_0x9aec('0x59')],'resolvedQuery':_0x369036[_0x9aec('0x58')][_0x9aec('0x5a')],'action':_0x369036['result']['action'],'actionIncomplete':_0x369036['result'][_0x9aec('0x5b')],'speech':_0x369036[_0x9aec('0x58')][_0x9aec('0x5c')][_0x9aec('0x5d')],'score':_0x369036['result'][_0x9aec('0x5e')],'statusCode':_0x369036['status'][_0x9aec('0x5f')],'endConversation':_0x369036[_0x9aec('0x58')][_0x9aec('0x60')][_0x9aec('0x61')]||![],'isFallbackIntent':_0x369036[_0x9aec('0x58')][_0x9aec('0x60')]['isFallbackIntent']};});};exports[_0x9aec('0x62')]=function(_0x42d5a3,_0x13134f,_0x1f4a5f,_0x22617c,_0x21383a,_0x2242ae){var _0x35f47c=_0x22617c[_0x9aec('0x63')](/\\n/g,'\x0a');var _0x239747={'credentials':{'private_key':_0x35f47c,'client_email':_0x1f4a5f}};var _0x2c3177=new dialogflow['SessionsClient'](_0x239747);var _0x5a1711=_0x2c3177[_0x9aec('0x64')](_0x13134f,md5(_0x42d5a3));var _0x5e06cf={'session':_0x5a1711,'queryInput':{'text':{'text':_0x21383a,'languageCode':_0x2242ae}}};return _0x2c3177[_0x9aec('0x65')](_0x5e06cf)[_0x9aec('0x34')](function(_0x4e986b){if(_0x4e986b&&_0x4e986b[_0x9aec('0x42')]){logger[_0x9aec('0x1a')](_0x9aec('0x66'),JSON[_0x9aec('0x3e')](_0x4e986b));var _0x453756=_0x4e986b[0x0];if(_0x453756){var _0x39364e={'action':_0x453756[_0x9aec('0x67')][_0x9aec('0x68')],'allRequiredParamsPresent':_0x453756[_0x9aec('0x67')]['allRequiredParamsPresent'],'endConversation':_0x453756[_0x9aec('0x67')][_0x9aec('0x69')]&&_0x453756[_0x9aec('0x67')][_0x9aec('0x69')]['fields']?_0x453756[_0x9aec('0x67')][_0x9aec('0x69')][_0x9aec('0x6a')]['end_conversation'][_0x9aec('0x6b')]:![],'fulfillmentText':_0x453756[_0x9aec('0x67')][_0x9aec('0x6c')],'intentName':_0x453756[_0x9aec('0x67')][_0x9aec('0x6d')][_0x9aec('0x54')],'intentDisplayName':_0x453756[_0x9aec('0x67')][_0x9aec('0x6d')]['displayName'],'isFallbackIntent':_0x453756[_0x9aec('0x67')]['intent']['isFallback'],'languageCode':_0x453756[_0x9aec('0x67')][_0x9aec('0x6e')],'queryText':_0x453756[_0x9aec('0x67')]['queryText'],'responseId':_0x453756[_0x9aec('0x6f')],'score':_0x453756[_0x9aec('0x67')][_0x9aec('0x70')],'speech':_0x453756[_0x9aec('0x67')][_0x9aec('0x6c')],'providerResponse':JSON[_0x9aec('0x3e')](_0x4e986b)};return _0x39364e;}}});};exports[_0x9aec('0x71')]=function(_0x2e97de,_0x3b4127,_0x34f157,_0x488ec7){return tilde[_0x9aec('0x72')](_0x2e97de,_0x3b4127,_0x34f157,_0x488ec7)['then'](function(_0x2b0c38){try{fs[_0x9aec('0x1c')](_0x2e97de);}catch(_0x2f0464){logger[_0x9aec('0x1b')](_0x2f0464);}logger[_0x9aec('0x1a')](_0x9aec('0x73'),_0x2b0c38[_0x9aec('0x4d')]);logger[_0x9aec('0x1a')](_0x9aec('0x74'),_0x2b0c38[_0x9aec('0x4f')]);return _0x2b0c38;});};exports['awsPolly']=function(_0x2ebf5f,_0x8ea0a1,_0x34dea8,_0x15c332,_0x402f34,_0x18f997){var _0x20f001=path[_0x9aec('0x26')](__dirname,_0x9aec('0x35'),rs[_0x9aec('0x36')](0x4)+_0x9aec('0x37'));var _0x5b1991;return aws[_0x9aec('0x75')](_0x2ebf5f,_0x8ea0a1,_0x34dea8,_0x15c332,_0x402f34,_0x18f997,_0x20f001)['then'](function(){_0x5b1991=path[_0x9aec('0x26')](__dirname,_0x9aec('0x35'),rs[_0x9aec('0x36')](0x4)+'.wav');return convertFile(_0x20f001,_0x5b1991);})[_0x9aec('0x34')](function(){try{fs[_0x9aec('0x1c')](_0x20f001);fs['chmodSync'](_0x5b1991,'777');}catch(_0xb837f1){logger[_0x9aec('0x1b')](_0xb837f1);}return _0x5b1991[_0x9aec('0x2c')]('.')[0x0];});};exports[_0x9aec('0x76')]=function(_0x4208e0,_0x45a2a3,_0x1cb10b,_0x1c0e19,_0x26e827,_0x161300){return aws['lex'](_0x4208e0,_0x45a2a3,_0x1cb10b,_0x1c0e19,_0x26e827,_0x161300)['then'](function(_0xcf49e0){logger[_0x9aec('0x1a')](JSON['stringify'](_0xcf49e0));return _0xcf49e0;});};exports[_0x9aec('0x77')]=function(_0x366946,_0x43e279,_0x3aa88c,_0x18402a){var _0x2c44b1=util[_0x9aec('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x366946,encodeURIComponent(_0x43e279),_0x3aa88c,_0x18402a);var _0x1a2a97=path['resolve'](__dirname,_0x9aec('0x35'),rs[_0x9aec('0x36')](0x4)+_0x9aec('0x37'));var _0x1027a4;return downloadFile(_0x2c44b1,_0x1a2a97)[_0x9aec('0x34')](function(){_0x1027a4=path['resolve'](__dirname,'tmp',rs[_0x9aec('0x36')](0x4)+_0x9aec('0x27'));return convertFile(_0x1a2a97,_0x1027a4);})[_0x9aec('0x34')](function(){try{fs[_0x9aec('0x1c')](_0x1a2a97);fs[_0x9aec('0x2a')](_0x1027a4,_0x9aec('0x2b'));}catch(_0x3f9f1f){logger[_0x9aec('0x1b')](_0x3f9f1f);}return _0x1027a4[_0x9aec('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x2b0aa8,_0xcd4432,_0x1fd395,_0x369357){var _0x617f98=util[_0x9aec('0x78')](_0x9aec('0x79'),ISPEECH_API,_0xcd4432,_0x1fd395,base64Encode(_0x2b0aa8),_0x369357?util[_0x9aec('0x78')](_0x9aec('0x7a'),encodeURIComponent(_0x369357)):_0x9aec('0x7b'));return uploadFile(_0x617f98)[_0x9aec('0x34')](function(_0x153a0c){return querystring[_0x9aec('0x9')](_0x153a0c);});};exports[_0x9aec('0x7c')]=function(_0x2ce305,_0x131edd){return sestek['nda'](_0x2ce305,_0x131edd)[_0x9aec('0x34')](function(_0x5dbe4f){logger[_0x9aec('0x1a')](JSON['stringify'](_0x5dbe4f));var _0x4c982b={'speech':_0x5dbe4f[_0x9aec('0x7d')],'action':_0x5dbe4f[_0x9aec('0x7e')]?_0x5dbe4f[_0x9aec('0x7e')][_0x9aec('0x7f')]:undefined,'actiondata':_0x5dbe4f[_0x9aec('0x7e')]?_0x5dbe4f[_0x9aec('0x7e')][_0x9aec('0x80')]:undefined};if(_0x5dbe4f['channelData']&&_0x5dbe4f[_0x9aec('0x7e')][_0x9aec('0x81')]){return base64Decode(_0x5dbe4f['channelData'][_0x9aec('0x81')]['Data'],path[_0x9aec('0x26')](__dirname,'tmp',rs[_0x9aec('0x36')](0x4)+'.wav'))[_0x9aec('0x34')](function(_0x18ceed){_0x4c982b[_0x9aec('0x82')]=_0x18ceed;return _0x4c982b;});}return _0x4c982b;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 30f9067..eb952e9 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 _0xaa18=['exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaa18,0x109));var _0x8aa1=function(_0x2a40ca,_0x271fe8){_0x2a40ca=_0x2a40ca-0x0;var _0x2937dd=_0xaa18[_0x2a40ca];return _0x2937dd;};var nda=require('./nda');module[_0x8aa1('0x0')]={'nda':nda}; \ No newline at end of file +var _0x41e9=['exports','./nda'];(function(_0x4e0eaf,_0xecf05d){var _0x2fcf80=function(_0x1a3051){while(--_0x1a3051){_0x4e0eaf['push'](_0x4e0eaf['shift']());}};_0x2fcf80(++_0xecf05d);}(_0x41e9,0x151));var _0x941e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x41e9[_0x20a584];return _0x4b41a8;};var nda=require(_0x941e('0x0'));module[_0x941e('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index d52bcf8..4e80267 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 _0x4e83=['Nda','uniqueid','callerid','calleridname','dnid','text','access_token','project','body','channelData','ProjectName','AudioOutputSettings','custom_action','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x4e83,0x88));var _0x34e8=function(_0x5e745e,_0xde2931){_0x5e745e=_0x5e745e-0x0;var _0x122dab=_0x4e83[_0x5e745e];return _0x122dab;};'use strict';var rp=require('request-promise');var url=require(_0x34e8('0x0'));var logger=require(_0x34e8('0x1'))(_0x34e8('0x2'));module[_0x34e8('0x3')]=function(_0x5bec5b,_0x33b4e1){var _0x4550fd={'method':_0x34e8('0x4'),'uri':url[_0x34e8('0x5')](_0x33b4e1[_0x34e8('0x6')],_0x34e8('0x7')),'form':{'grant_type':_0x34e8('0x8'),'username':_0x33b4e1[_0x34e8('0x9')],'password':_0x33b4e1[_0x34e8('0x8')]},'json':!![]};return rp(_0x4550fd)[_0x34e8('0xa')](function(_0x188f11){var _0x18e178={'method':_0x34e8('0x4'),'uri':url['resolve'](_0x33b4e1[_0x34e8('0xb')],_0x34e8('0xc')),'body':{'type':_0x33b4e1[_0x34e8('0xd')]||'message','channelId':_0x34e8('0xe'),'conversation':{'id':_0x5bec5b[_0x34e8('0xf')]},'from':{'id':_0x5bec5b[_0x34e8('0x10')],'name':_0x5bec5b[_0x34e8('0x11')]},'recipient':{'id':_0x5bec5b[_0x34e8('0x12')],'name':_0x5bec5b['extension']},'text':_0x33b4e1[_0x34e8('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x188f11[_0x34e8('0x14')]},'json':!![]};if(_0x33b4e1[_0x34e8('0x15')]){_0x18e178[_0x34e8('0x16')][_0x34e8('0x17')][_0x34e8('0x18')]=_0x33b4e1[_0x34e8('0x15')];}if(_0x33b4e1['ndagenerate_audio']=='1'){_0x18e178[_0x34e8('0x16')]['channelData'][_0x34e8('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x33b4e1[_0x34e8('0x1a')]){_0x18e178[_0x34e8('0x16')][_0x34e8('0x17')]['CustomAction']=_0x33b4e1[_0x34e8('0x1a')];if(_0x33b4e1['custom_action_data']){_0x18e178[_0x34e8('0x16')][_0x34e8('0x17')][_0x34e8('0x1b')]=_0x33b4e1['custom_action_data'];}}logger[_0x34e8('0x1c')](JSON[_0x34e8('0x1d')](_0x18e178));return rp(_0x18e178);});}; \ No newline at end of file +var _0x4a47=['ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','body','channelData'];(function(_0x189cf1,_0x16ba19){var _0x1d2f50=function(_0x5aa8e5){while(--_0x5aa8e5){_0x189cf1['push'](_0x189cf1['shift']());}};_0x1d2f50(++_0x16ba19);}(_0x4a47,0xb5));var _0x74a4=function(_0x4be774,_0x5b2d48){_0x4be774=_0x4be774-0x0;var _0x31d1c9=_0x4a47[_0x4be774];return _0x31d1c9;};'use strict';var rp=require(_0x74a4('0x0'));var url=require(_0x74a4('0x1'));var logger=require(_0x74a4('0x2'))(_0x74a4('0x3'));module[_0x74a4('0x4')]=function(_0x54d63a,_0x24cff9){var _0x55c541={'method':_0x74a4('0x5'),'uri':url[_0x74a4('0x6')](_0x24cff9['ndauth_url'],_0x74a4('0x7')),'form':{'grant_type':_0x74a4('0x8'),'username':_0x24cff9[_0x74a4('0x9')],'password':_0x24cff9['password']},'json':!![]};return rp(_0x55c541)[_0x74a4('0xa')](function(_0x55e8a1){var _0x3122ba={'method':'POST','uri':url[_0x74a4('0x6')](_0x24cff9[_0x74a4('0xb')],_0x74a4('0xc')),'body':{'type':_0x24cff9[_0x74a4('0xd')]||'message','channelId':_0x74a4('0xe'),'conversation':{'id':_0x54d63a[_0x74a4('0xf')]},'from':{'id':_0x54d63a[_0x74a4('0x10')],'name':_0x54d63a[_0x74a4('0x11')]},'recipient':{'id':_0x54d63a['dnid'],'name':_0x54d63a[_0x74a4('0x12')]},'text':_0x24cff9[_0x74a4('0x13')],'channelData':{}},'headers':{'Authorization':_0x74a4('0x14')+_0x55e8a1['access_token']},'json':!![]};if(_0x24cff9['project']){_0x3122ba[_0x74a4('0x15')][_0x74a4('0x16')][_0x74a4('0x17')]=_0x24cff9[_0x74a4('0x18')];}if(_0x24cff9[_0x74a4('0x19')]=='1'){_0x3122ba[_0x74a4('0x15')][_0x74a4('0x16')][_0x74a4('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x74a4('0x1b')};}if(_0x24cff9[_0x74a4('0x1c')]){_0x3122ba[_0x74a4('0x15')][_0x74a4('0x16')][_0x74a4('0x1d')]=_0x24cff9[_0x74a4('0x1c')];if(_0x24cff9[_0x74a4('0x1e')]){_0x3122ba[_0x74a4('0x15')]['channelData'][_0x74a4('0x1f')]=_0x24cff9[_0x74a4('0x1e')];}}logger[_0x74a4('0x20')](JSON[_0x74a4('0x21')](_0x3122ba));return rp(_0x3122ba);});}; \ 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 4c6b2ef..bd3d34a 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 _0x3ed8=['exports','./lib/api'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0x3ed8,0x191));var _0x83ed=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x3ed8[_0x5e238b];return _0x389bea;};'use strict';var asr=require(_0x83ed('0x0'));module[_0x83ed('0x1')]=function(_0x3fddf3,_0x29184b,_0x2f203d,_0x337814){return asr(_0x3fddf3,_0x29184b,_0x2f203d,_0x337814);}; \ No newline at end of file +var _0x19c1=['exports','./lib/api'];(function(_0x593b90,_0x1d62ba){var _0x34d5cd=function(_0x48d171){while(--_0x48d171){_0x593b90['push'](_0x593b90['shift']());}};_0x34d5cd(++_0x1d62ba);}(_0x19c1,0x195));var _0x119c=function(_0x1240f7,_0x350a8){_0x1240f7=_0x1240f7-0x0;var _0x1a2058=_0x19c1[_0x1240f7];return _0x1a2058;};'use strict';var asr=require(_0x119c('0x0'));module[_0x119c('0x1')]=function(_0x50d02f,_0x4b215f,_0x447e5d,_0x5a7779){return asr(_0x50d02f,_0x4b215f,_0x447e5d,_0x5a7779);}; \ 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 13c5531..397856d 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 _0x00f8=['data','EOS','error','terminate','parse','status','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream'];(function(_0x5ee5af,_0x52369f){var _0x1fdd47=function(_0x906004){while(--_0x906004){_0x5ee5af['push'](_0x5ee5af['shift']());}};_0x1fdd47(++_0x52369f);}(_0x00f8,0xe6));var _0x800f=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x00f8[_0xa3463d];return _0x50fd67;};'use strict';var BPromise=require(_0x800f('0x0'));var _=require(_0x800f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x800f('0x2'));var crypto=require(_0x800f('0x3'));var logger=require(_0x800f('0x4'))('agi');module['exports']=function(_0x49061f,_0x47cb76,_0x1edeb5,_0x428134){return new BPromise(function(_0x20d5f2,_0x4fb35c){logger[_0x800f('0x5')](_0x800f('0x6'),_0x428134||_0x800f('0x7'));var _0x2fe06a=new WebSocket(_0x428134||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4adc5c='';var _0x3747a9='0';var _0xf4d7e8='1';var _0xa75898='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x232b78(_0x24250b){var _0x2594c4=crypto[_0x800f('0x8')]('sha1');_0x2594c4[_0x800f('0x9')](_0x24250b);return _0x2594c4[_0x800f('0xa')]('hex');}function _0x4837c1(){try{logger[_0x800f('0x5')](_0x800f('0xb'));var _0x1087b7=moment()[_0x800f('0xc')]();var _0x491e60=_0x232b78(_0x1087b7+_0x47cb76+_0x1edeb5);_0x2fe06a[_0x800f('0xd')](JSON[_0x800f('0xe')]({'appID':_0x47cb76,'timestamp':_0x1087b7,'appKey':_0x491e60}));var _0x56ae9c=fs[_0x800f('0xf')](_0x49061f);_0x56ae9c['on'](_0x800f('0x10'),function(_0x189cef){_0x2fe06a[_0x800f('0xd')](_0x189cef);});_0x56ae9c['on']('close',function(){_0x2fe06a[_0x800f('0xd')](_0x800f('0x11'));});}catch(_0x5d4a20){logger[_0x800f('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x5d4a20));_0x2fe06a[_0x800f('0x13')]();}}function _0x5bbc3b(_0x3c4e2b){try{if(_0x3c4e2b){var _0x5a35ba=JSON[_0x800f('0x14')](_0x3c4e2b);switch(_0x5a35ba[_0x800f('0x15')]){case 0x0:if(_0x5a35ba['result']){if(_0x5a35ba['result']['final']){logger[_0x800f('0x5')](_0x800f('0x16'),JSON[_0x800f('0xe')](_0x5a35ba[_0x800f('0x17')][_0x800f('0x18')]));_0x4adc5c=_0x5a35ba[_0x800f('0x17')]['hypotheses'][0x0][_0x800f('0x19')];_0x3747a9=_0x5a35ba['result'][_0x800f('0x18')][0x0][_0x800f('0x1a')];_0xf4d7e8='0';_0xa75898=_0x800f('0x1b');_0x2fe06a[_0x800f('0x13')]();}}break;case 0x1:logger[_0x800f('0x5')](_0x800f('0x1c'));_0xf4d7e8='1';_0xa75898='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x800f('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0xf4d7e8='2';_0xa75898=_0x800f('0x1d');break;case 0x9:logger[_0x800f('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xf4d7e8='9';_0xa75898=_0x800f('0x1e');break;case 0xa:logger[_0x800f('0x5')](_0x800f('0x1f'));_0xf4d7e8='10';_0xa75898=_0x800f('0x1f');break;case 0xb:logger[_0x800f('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xf4d7e8='11';_0xa75898=_0x800f('0x20');}}}catch(_0x2f876e){logger[_0x800f('0x12')](_0x800f('0x21'),JSON[_0x800f('0xe')](_0x2f876e));_0x2fe06a[_0x800f('0x13')]();}}function _0x4d5538(){logger[_0x800f('0x5')](_0x800f('0x22'));_0x20d5f2({'transcript':_0x4adc5c,'confidence':_0x3747a9,'status':_0xf4d7e8,'status_message':_0xa75898});}function _0x5ab718(_0x13e552){logger[_0x800f('0x12')](_0x800f('0x23'));if(!_[_0x800f('0x24')](_0x13e552)){logger[_0x800f('0x12')](_[_0x800f('0x25')](_0x13e552)?JSON[_0x800f('0xe')](_0x13e552):_0x13e552);}}_0x2fe06a['on'](_0x800f('0x26'),_0x4837c1);_0x2fe06a['on'](_0x800f('0x27'),_0x5bbc3b);_0x2fe06a['on'](_0x800f('0x28'),_0x4d5538);_0x2fe06a['on'](_0x800f('0x12'),_0x5ab718);});}; \ No newline at end of file +var _0x05f8=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','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.'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x05f8,0x178));var _0x805f=function(_0x5c6462,_0x165958){_0x5c6462=_0x5c6462-0x0;var _0x2c3c95=_0x05f8[_0x5c6462];return _0x2c3c95;};'use strict';var BPromise=require(_0x805f('0x0'));var _=require(_0x805f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x805f('0x2'));var logger=require('../../../../../../config/logger')(_0x805f('0x3'));module[_0x805f('0x4')]=function(_0x4818a9,_0x27d90d,_0x1c0a06,_0x2c1b7d){return new BPromise(function(_0x59762c,_0x39b9aa){logger[_0x805f('0x5')]('Tilde\x20URI',_0x2c1b7d||_0x805f('0x6'));var _0x263258=new WebSocket(_0x2c1b7d||_0x805f('0x6'),{'perMessageDeflate':![]});var _0x59c3e9='';var _0x42fc59='0';var _0x147a99='1';var _0x5b2414=_0x805f('0x7');function _0x3ddc66(_0x489aa9){var _0x4a5ffd=crypto[_0x805f('0x8')](_0x805f('0x9'));_0x4a5ffd[_0x805f('0xa')](_0x489aa9);return _0x4a5ffd[_0x805f('0xb')](_0x805f('0xc'));}function _0x20f885(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x2984ec=moment()[_0x805f('0xd')]();var _0x549e3e=_0x3ddc66(_0x2984ec+_0x27d90d+_0x1c0a06);_0x263258['send'](JSON['stringify']({'appID':_0x27d90d,'timestamp':_0x2984ec,'appKey':_0x549e3e}));var _0x51661f=fs['createReadStream'](_0x4818a9);_0x51661f['on'](_0x805f('0xe'),function(_0x2eb63a){_0x263258[_0x805f('0xf')](_0x2eb63a);});_0x51661f['on'](_0x805f('0x10'),function(){_0x263258[_0x805f('0xf')](_0x805f('0x11'));});}catch(_0x275b07){logger[_0x805f('0x12')](_0x805f('0x13'),JSON[_0x805f('0x14')](_0x275b07));_0x263258[_0x805f('0x15')]();}}function _0x5c6986(_0x529df9){try{if(_0x529df9){var _0x4d366f=JSON[_0x805f('0x16')](_0x529df9);switch(_0x4d366f[_0x805f('0x17')]){case 0x0:if(_0x4d366f[_0x805f('0x18')]){if(_0x4d366f[_0x805f('0x18')][_0x805f('0x19')]){logger[_0x805f('0x5')](_0x805f('0x1a'),JSON[_0x805f('0x14')](_0x4d366f[_0x805f('0x18')][_0x805f('0x1b')]));_0x59c3e9=_0x4d366f[_0x805f('0x18')][_0x805f('0x1b')][0x0][_0x805f('0x1c')];_0x42fc59=_0x4d366f['result']['hypotheses'][0x0][_0x805f('0x1d')];_0x147a99='0';_0x5b2414=_0x805f('0x1e');_0x263258['terminate']();}}break;case 0x1:logger[_0x805f('0x5')](_0x805f('0x7'));_0x147a99='1';_0x5b2414=_0x805f('0x7');break;case 0x2:logger['info'](_0x805f('0x1f'));_0x147a99='2';_0x5b2414=_0x805f('0x1f');break;case 0x9:logger[_0x805f('0x5')](_0x805f('0x20'));_0x147a99='9';_0x5b2414='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x805f('0x5')](_0x805f('0x21'));_0x147a99='10';_0x5b2414=_0x805f('0x21');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x147a99='11';_0x5b2414=_0x805f('0x22');}}}catch(_0x2eafe4){logger['error'](_0x805f('0x23'),JSON[_0x805f('0x14')](_0x2eafe4));_0x263258[_0x805f('0x15')]();}}function _0x5ebfb2(){logger[_0x805f('0x5')](_0x805f('0x24'));_0x59762c({'transcript':_0x59c3e9,'confidence':_0x42fc59,'status':_0x147a99,'status_message':_0x5b2414});}function _0x333619(_0x43b88e){logger[_0x805f('0x12')](_0x805f('0x25'));if(!_['isNil'](_0x43b88e)){logger['error'](_[_0x805f('0x26')](_0x43b88e)?JSON[_0x805f('0x14')](_0x43b88e):_0x43b88e);}}_0x263258['on'](_0x805f('0x27'),_0x20f885);_0x263258['on'](_0x805f('0x28'),_0x5c6986);_0x263258['on'](_0x805f('0x10'),_0x5ebfb2);_0x263258['on'](_0x805f('0x12'),_0x333619);});}; \ 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 850e7b2..2f31ca8 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 _0xfea0=['exports'];(function(_0x57c68d,_0x28c03d){var _0x22f4c1=function(_0x200adf){while(--_0x200adf){_0x57c68d['push'](_0x57c68d['shift']());}};_0x22f4c1(++_0x28c03d);}(_0xfea0,0x76));var _0x0fea=function(_0x1fe41b,_0x5ae7d5){_0x1fe41b=_0x1fe41b-0x0;var _0x436695=_0xfea0[_0x1fe41b];return _0x436695;};var asr=require('./asr');module[_0x0fea('0x0')]={'asr':asr}; \ No newline at end of file +var _0x6865=['exports'];(function(_0x282f1d,_0x3795b1){var _0x5ab27b=function(_0x305664){while(--_0x305664){_0x282f1d['push'](_0x282f1d['shift']());}};_0x5ab27b(++_0x3795b1);}(_0x6865,0x176));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};var asr=require('./asr');module[_0x5686('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5834e88..837362b 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x206338,_0x2d800b){var _0x2b87f2=function(_0x436c1c){while(--_0x436c1c){_0x206338['push'](_0x206338['shift']());}};_0x2b87f2(++_0x2d800b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6fc95c8..3c7f631 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 _0xffaa=['result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','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','bot','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','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','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','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','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable'];(function(_0x1e3801,_0x4a19a8){var _0x9ba139=function(_0x5859ef){while(--_0x5859ef){_0x1e3801['push'](_0x1e3801['shift']());}};_0x9ba139(++_0x4a19a8);}(_0xffaa,0x130));var _0xaffa=function(_0xfe17b6,_0x769d7a){_0xfe17b6=_0xfe17b6-0x0;var _0x3a8469=_0xffaa[_0xfe17b6];return _0x3a8469;};'use strict';var fs=require('fs');var util=require(_0xaffa('0x0'));var _=require(_0xaffa('0x1'));var sh=require(_0xaffa('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xaffa('0x3'));var Mustache=require(_0xaffa('0x4'));var rp=require(_0xaffa('0x5'));var logger=require(_0xaffa('0x6'))(_0xaffa('0x7'));var config=require(_0xaffa('0x8'));var shared=require(_0xaffa('0x9'));var scripts=require(_0xaffa('0xa'));var FILES_PATH=_0xaffa('0xb');var recursiveMapAttributes=[_0xaffa('0xc'),'rawBody'];var verticesWithRetry=[_0xaffa('0xd'),_0xaffa('0xe'),_0xaffa('0xf')];var AGIVertices=function(_0x3c7409,_0x5d2ebb,_0x32eeca){this['channel']=_0x3c7409;this[_0xaffa('0x10')]=_0x5d2ebb;this[_0xaffa('0x11')]=_0x32eeca;};AGIVertices[_0xaffa('0x12')]['getVariable']=function(_0x2a1b87,_0x5ce8ae){this['rpc']['getVariableById'](_0x2a1b87)[_0xaffa('0x13')](function(_0x5efbe8){_0x5ce8ae(null,_0x5efbe8?_0x5efbe8[_0xaffa('0x14')]:![]);})['catch'](function(_0x3806e9){_0x5ce8ae(_0x3806e9);});};AGIVertices['prototype'][_0xaffa('0x15')]=function(_0x5b238c,_0xd8e9c6){this[_0xaffa('0x10')][_0xaffa('0x16')](_0x5b238c)[_0xaffa('0x13')](function(_0x14f495){_0xd8e9c6(null,_0x14f495?_0x14f495[_0xaffa('0x14')]:![]);})[_0xaffa('0x17')](function(_0x323a2f){_0xd8e9c6(_0x323a2f);});};AGIVertices['prototype'][_0xaffa('0x18')]=function(_0x10fecb,_0x4b7d89){this[_0xaffa('0x10')]['getSquareProjectById'](_0x10fecb)[_0xaffa('0x13')](function(_0x2d57ab){_0x4b7d89(null,_0x2d57ab?_0x2d57ab[_0xaffa('0x14')]:![]);})[_0xaffa('0x17')](function(_0x28b5c8){_0x4b7d89(_0x28b5c8);});};AGIVertices[_0xaffa('0x12')]['getSquareOdbc']=function(_0x34d70f,_0x2b2040){this[_0xaffa('0x10')][_0xaffa('0x19')](_0x34d70f)[_0xaffa('0x13')](function(_0x16297d){_0x2b2040(null,_0x16297d?_0x16297d[_0xaffa('0x1a')]:![]);})['catch'](function(_0x520d62){_0x2b2040(_0x520d62);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1b')]=function(_0x45c856,_0x2f5091){this['rpc']['getUserById'](_0x45c856)[_0xaffa('0x13')](function(_0x3f7dee){_0x2f5091(null,_0x3f7dee?_0x3f7dee['name']:![]);})[_0xaffa('0x17')](function(_0x298e2b){_0x2f5091(_0x298e2b);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1c')]=function(_0x1d83ce,_0x2f1320){this['rpc'][_0xaffa('0x1d')](_0x1d83ce)[_0xaffa('0x13')](function(_0x4b7994){_0x2f1320(null,_0x4b7994?_0x4b7994['name']:![]);})[_0xaffa('0x17')](function(_0x46ac99){_0x2f1320(_0x46ac99);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1e')]=function(_0x247915,_0x411448){var _0x2faf48=this;this[_0xaffa('0x10')][_0xaffa('0x1f')](_0x247915)[_0xaffa('0x13')](function(_0x272657){_0x411448(null,_0x272657?_0x2faf48[_0xaffa('0x20')](_0x272657['save_name']):![]);})['catch'](function(_0x1fd7f7){_0x411448(_0x1fd7f7);});};AGIVertices[_0xaffa('0x12')]['getMailAccount']=function(_0x571540,_0x5c6412){this[_0xaffa('0x10')][_0xaffa('0x21')](_0x571540)[_0xaffa('0x13')](function(_0x50ca99){_0x5c6412(null,_0x50ca99?_0x50ca99:![]);})[_0xaffa('0x17')](function(_0x3d5038){_0x5c6412(_0x3d5038);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x22')]=function(_0x27506b,_0x3dd1e5,_0x17ada5){this[_0xaffa('0x11')][_0xaffa('0x22')](_0x27506b,_0x3dd1e5)[_0xaffa('0x13')](function(){_0x17ada5(null);})['catch'](function(_0x39b45c){_0x17ada5(_0x39b45c);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x23')]=function(_0x3fde8a,_0x442967){this[_0xaffa('0x10')][_0xaffa('0x24')](_0x3fde8a)[_0xaffa('0x13')](function(_0x5aa4a5){if(_0x5aa4a5){if(_0x5aa4a5['IntervalId']){_0x442967(null,[_0x5aa4a5[_0xaffa('0x25')]]);}else{_0x442967(null,_['map'](_0x5aa4a5['Intervals'],_0xaffa('0x25')));}}else{_0x442967(null,![]);}})[_0xaffa('0x17')](function(_0x1acb87){_0x442967(_0x1acb87);});};AGIVertices[_0xaffa('0x12')]['getSoundPath']=function(_0x5795d3){return util[_0xaffa('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0x5795d3);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x27')]=function(_0x5129df,_0x592a76,_0x351e0c){odbc[_0xaffa('0x28')](_0x5129df,function(_0x2dc3ae){if(_0x2dc3ae){logger[_0xaffa('0x29')](_0xaffa('0x2a'),_0x2dc3ae);_0x351e0c(_0x2dc3ae);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xaffa('0x2b')](_0x592a76,function(_0x422b54,_0x574722){if(_0x422b54){logger[_0xaffa('0x2c')](_0xaffa('0x2d'),_0x592a76);_0x351e0c(_0x422b54);}else{logger[_0xaffa('0x2c')](_0xaffa('0x2e'),_0x592a76);odbc[_0xaffa('0x2f')](function(_0x54cd4d){if(_0x54cd4d){logger[_0xaffa('0x29')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x54cd4d);}_0x351e0c(null,_0x574722);});}});}});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x30')]=function(_0x26b84e,_0x5e0561){this['rpc']['getSmsAccountById'](_0x26b84e)[_0xaffa('0x13')](function(_0x197418){_0x5e0561(null,_0x197418?_0x197418:![]);})[_0xaffa('0x17')](function(_0x5bbc63){_0x5e0561(_0x5bbc63);});};AGIVertices[_0xaffa('0x12')]['createSmsMessage']=function(_0x2215b3,_0x4a6ded){this['rpc'][_0xaffa('0x31')](_0x2215b3)[_0xaffa('0x13')](function(_0x2cbb42){_0x4a6ded(null,_0x2cbb42);})[_0xaffa('0x17')](function(_0x2ca7a5){_0x4a6ded(_0x2ca7a5);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x32')]=function(_0x263058,_0x8510ee,_0x444c51){this['rpc'][_0xaffa('0x32')]({'uniqueid':this[_0xaffa('0x33')][_0xaffa('0x34')],'node':_0x263058[_0xaffa('0x35')],'application':_0x263058[_0xaffa('0x36')],'data':_0x8510ee||null,'project_name':this[_0xaffa('0x33')][_0xaffa('0x37')],'callerid':this[_0xaffa('0x33')]['callerid']})[_0xaffa('0x13')](function(_0x4a98c3){if(_0x444c51){_0x444c51(null,_0x4a98c3);}})[_0xaffa('0x17')](function(_0x447c79){if(_0x444c51){_0x444c51(_0x447c79);}});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x38')]=function(_0x5a4fa5,_0x5bbab6,_0x460aed,_0x590849){this[_0xaffa('0x10')][_0xaffa('0x38')]({'uniqueid':this['channel'][_0xaffa('0x34')],'callerid':this[_0xaffa('0x33')][_0xaffa('0x39')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0xaffa('0x3a')],'extension':this['channel'][_0xaffa('0x3b')],'priority':this[_0xaffa('0x33')][_0xaffa('0x3c')],'accountcode':this['channel'][_0xaffa('0x3d')],'dnid':this[_0xaffa('0x33')][_0xaffa('0x3e')],'projectName':this[_0xaffa('0x33')][_0xaffa('0x37')],'saveName':_0x5bbab6,'filename':_0x5a4fa5['file']||_0x5bbab6,'savePath':_0x460aed})[_0xaffa('0x13')](function(_0x30ab7f){_0x590849(null,_0x30ab7f);})['catch'](function(_0x5b2a50){_0x590849(_0x5b2a50);});};AGIVertices['prototype'][_0xaffa('0x3f')]=function(_0x1a52f6,_0xed274d,_0x53ebd5,_0xd3d489,_0x5465b4){this[_0xaffa('0x10')][_0xaffa('0x3f')]({'uniqueid':this[_0xaffa('0x33')][_0xaffa('0x34')],'body':_0x1a52f6,'direction':_0xed274d,'providerName':_0x53ebd5,'providerResponse':_0xd3d489})[_0xaffa('0x13')](function(_0x301608){if(_0x5465b4){_0x5465b4(null,_0x301608);}})['catch'](function(_0x2a1d62){if(_0x5465b4){_0x5465b4(_0x2a1d62);}});};AGIVertices['prototype'][_0xaffa('0x40')]=function(_0x4bf9fc,_0x4da6ad){this[_0xaffa('0x10')]['createCmContact']({'firstName':_[_0xaffa('0x41')](_0x4bf9fc[_0xaffa('0x14')])||_[_0xaffa('0x42')](_0x4bf9fc[_0xaffa('0x14')])?_0xaffa('0x43')+Math[_0xaffa('0x44')]():_0x4bf9fc['name'],'lastName':_[_0xaffa('0x41')](_0x4bf9fc['lastName'])||_['isNil'](_0x4bf9fc[_0xaffa('0x45')])?null:_0x4bf9fc[_0xaffa('0x45')],'phone':_0x4bf9fc[_0xaffa('0x46')],'ListId':_0x4bf9fc['list_id'],'scheduledat':_0x4bf9fc[_0xaffa('0x47')],'callbackUniqueid':this[_0xaffa('0x33')][_0xaffa('0x34')],'tags':_0xaffa('0x48'),'description':_0xaffa('0x49')+_0x4bf9fc['scheduledAt'][_0xaffa('0x4a')](),'priority':_0x4bf9fc[_0xaffa('0x4b')]})[_0xaffa('0x13')](function(_0x13adef){_0x4da6ad(null,_0x13adef);})[_0xaffa('0x17')](function(_0x11f5dd){_0x4da6ad(_0x11f5dd);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x4c')]=function(_0x1b13d0,_0x1ac791){this[_0xaffa('0x10')][_0xaffa('0x4d')](_0x1b13d0)[_0xaffa('0x13')](function(_0x1c93f5){_0x1ac791(null,_0x1c93f5?_0x1c93f5['name']:![]);})['catch'](function(_0x12cc0e){_0x1ac791(_0x12cc0e);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x4e')]=function(_0x3b5588,_0x5c72a2,_0xda2ec4){var _0x37b2cc={'role':_0xaffa('0x4f')};_0x37b2cc[_0x3b5588]=this[_0xaffa('0x33')][_0xaffa('0x39')];this[_0xaffa('0x10')][_0xaffa('0x4e')](_0x37b2cc,_0x5c72a2,this['channel'][_0xaffa('0x34')])[_0xaffa('0x13')](function(_0x5efb37){_0xda2ec4(null,_['isNil'](_0x5efb37)?![]:!![]);})[_0xaffa('0x17')](function(_0x315434){logger[_0xaffa('0x29')](_0x315434);_0xda2ec4(null,![]);});};AGIVertices[_0xaffa('0x12')]['agentUnpause']=function(_0x5d55fd,_0x31b03a){var _0x5c5bf7={'role':_0xaffa('0x4f')};_0x5c5bf7[_0x5d55fd]=this[_0xaffa('0x33')][_0xaffa('0x39')];this[_0xaffa('0x10')][_0xaffa('0x50')](_0x5c5bf7)[_0xaffa('0x13')](function(_0x1fbc30){_0x31b03a(null,_[_0xaffa('0x42')](_0x1fbc30)?![]:!![]);})[_0xaffa('0x17')](function(_0xdd5ecb){logger[_0xaffa('0x29')](_0xdd5ecb);_0x31b03a(null,![]);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x51')]=function(_0x160864,_0x5d2b5f){var _0x589acd={'role':_0xaffa('0x4f')};_0x589acd[_0x160864]=this[_0xaffa('0x33')][_0xaffa('0x39')];this[_0xaffa('0x10')]['agentLogout'](_0x589acd)['then'](function(_0x3bc444){_0x5d2b5f(null,_[_0xaffa('0x42')](_0x3bc444)?![]:!![]);})[_0xaffa('0x17')](function(_0x54a6c5){logger[_0xaffa('0x29')](_0x54a6c5);_0x5d2b5f(null,![]);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x52')]=function(_0x19a2bb,_0x504c7d){var _0x2197ca={'role':_0xaffa('0x4f')};_0x2197ca[_0x19a2bb]=this['channel']['callerid'];var _0x212a99=_0x19a2bb!=_0xaffa('0x53')?util[_0xaffa('0x26')](_0xaffa('0x54'),_0xaffa('0x55'),this[_0xaffa('0x33')][_0xaffa('0x39')]):undefined;this[_0xaffa('0x10')][_0xaffa('0x52')](_0x2197ca,_0x212a99)['then'](function(_0x322313){_0x504c7d(null,_[_0xaffa('0x42')](_0x322313)?![]:!![]);})[_0xaffa('0x17')](function(_0x5a028a){logger['error'](_0x5a028a);_0x504c7d(null,![]);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x56')]=function(_0x584a51,_0x45bf76){sh[_0xaffa('0x57')](_[_0xaffa('0x58')](_0x584a51),function(_0x3dec2f,_0x387af5){var _0x4d239f=_0x387af5[_0xaffa('0x59')](/(\r\n|\n|\r)/gm,'');_0x45bf76(null,_0x4d239f);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x5a')]=function(_0x5687fc,_0x4d45e7){scripts[_0xaffa('0x5a')](_0x5687fc['apiKey'],_0x5687fc['google_cloud_tts_text_type']||_0xaffa('0x5b'),_0x5687fc[_0xaffa('0x5b')],_0x5687fc[_0xaffa('0x5c')]||_0xaffa('0x5d'),_0x5687fc[_0xaffa('0x5e')]||_0xaffa('0x5f'),_0x5687fc[_0xaffa('0x60')]||_0xaffa('0x61'))['then'](function(_0xecf5e0){_0x4d45e7(null,_0xecf5e0);})[_0xaffa('0x17')](function(_0x468d56){_0x4d45e7(_0x468d56);});};AGIVertices['prototype'][_0xaffa('0x62')]=function(_0x555d19,_0x311ccb){scripts[_0xaffa('0x62')](_0x555d19[_0xaffa('0x5b')],_0x555d19[_0xaffa('0x63')]||'en',0x1)[_0xaffa('0x13')](function(_0x3077b6){_0x311ccb(null,_0x3077b6);})[_0xaffa('0x17')](function(_0x1505bf){_0x311ccb(_0x1505bf);});};AGIVertices[_0xaffa('0x12')]['restAPI']=function(_0x4b4137,_0x1b1183){var _0x3bf9bd={'uri':_0x4b4137[_0xaffa('0x64')],'method':_0x4b4137[_0xaffa('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4b4137[_0xaffa('0x66')])===_0xaffa('0x67')&&parseInt(_0x4b4137['timeout'])>=0x1?parseInt(_0x4b4137[_0xaffa('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xaffa('0x68')]([_0xaffa('0x69'),_0xaffa('0x6a')],_0x3bf9bd[_0xaffa('0x65')][_0xaffa('0x6b')]())){try{_0x3bf9bd[_0xaffa('0x6c')]=_0x4b4137[_0xaffa('0x6d')]?JSON[_0xaffa('0x6e')](_0x4b4137['rawBody']):{};}catch(_0x220782){logger[_0xaffa('0x29')](_0xaffa('0x6f'),_0x220782);}}try{_0x3bf9bd['headers']=_0x4b4137[_0xaffa('0xc')]?JSON['parse'](_0x4b4137[_0xaffa('0xc')]):{};}catch(_0x71acc){logger[_0xaffa('0x29')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x71acc);}if(_0x4b4137['computedVariables']){try{var _0x1c3075=require(_0x4b4137[_0xaffa('0x70')])[_0xaffa('0x71')](this,_0x3bf9bd);_0x3bf9bd[_0xaffa('0x72')]=Mustache[_0xaffa('0x73')](_0x4b4137[_0xaffa('0x64')],_0x1c3075,{},['$$','$$']);if(_0x3bf9bd[_0xaffa('0x74')]){_0x3bf9bd['headers']=JSON['parse'](Mustache[_0xaffa('0x73')](JSON[_0xaffa('0x75')](_0x3bf9bd[_0xaffa('0x74')]),_0x1c3075,{},['$$','$$']));}if(_0x3bf9bd[_0xaffa('0x6c')]){_0x3bf9bd[_0xaffa('0x6c')]=JSON[_0xaffa('0x6e')](Mustache[_0xaffa('0x73')](JSON[_0xaffa('0x75')](_0x3bf9bd[_0xaffa('0x6c')]),_0x1c3075,{},['$$','$$']));}}catch(_0xbe93bf){logger[_0xaffa('0x29')](_0xaffa('0x76'),_0xbe93bf);}}rp(_0x3bf9bd)[_0xaffa('0x13')](function(_0x3bf462){var _0x926412={'statusCode':_0x3bf462['statusCode']||0xc8,'statusMessage':_0x3bf462[_0xaffa('0x77')]||'OK','headers':_0x3bf462['headers']||{},'body':_0x3bf462[_0xaffa('0x6c')]||{}};_0x1b1183(null,_0x926412);})[_0xaffa('0x17')](function(_0x12b154){var _0x479f83={'statusCode':_0x12b154[_0xaffa('0x78')]||0x1f4,'statusMessage':_0x12b154[_0xaffa('0x79')]||_0xaffa('0x7a'),'headers':_0x12b154[_0xaffa('0x7b')][_0xaffa('0x74')]||{},'body':_0x12b154[_0xaffa('0x7b')]['body']||{}};_0x1b1183(null,_0x479f83);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x7c')]=function(_0x41b7f4,_0x4e1ef8){scripts[_0xaffa('0x7c')](this['channel'][_0xaffa('0x34')],_0x41b7f4[_0xaffa('0x7d')],_0x41b7f4[_0xaffa('0x5b')],_0x41b7f4[_0xaffa('0x7e')]||'en')[_0xaffa('0x13')](function(_0x1d23ba){_0x4e1ef8(null,_0x1d23ba);})[_0xaffa('0x17')](function(_0xd58758){_0x4e1ef8(_0xd58758);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x7f')]=function(_0x3aa76f,_0x430897){scripts[_0xaffa('0x7f')](this[_0xaffa('0x33')][_0xaffa('0x34')],_0x3aa76f[_0xaffa('0x80')],_0x3aa76f[_0xaffa('0x81')],_0x3aa76f[_0xaffa('0x82')],_0x3aa76f[_0xaffa('0x5b')],_0x3aa76f[_0xaffa('0x83')]||'en')[_0xaffa('0x13')](function(_0x39dd60){_0x430897(null,_0x39dd60);})[_0xaffa('0x17')](function(_0x4586cc){_0x430897(_0x4586cc);});};AGIVertices['prototype'][_0xaffa('0x84')]=function(_0x17e1e4,_0x3df4e9){scripts[_0xaffa('0x84')](this[_0xaffa('0x33')],_0x17e1e4)[_0xaffa('0x13')](function(_0x31d858){_0x3df4e9(null,_0x31d858);})[_0xaffa('0x17')](function(_0x4e6b23){_0x3df4e9(_0x4e6b23);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x85')]=function(_0x46f593,_0x52fcfa){scripts[_0xaffa('0x85')](_0x46f593[_0xaffa('0x7d')],_0x46f593[_0xaffa('0x5b')],_0x46f593[_0xaffa('0x86')]||_0xaffa('0x5d'),_0x46f593[_0xaffa('0x87')])['then'](function(_0x132528){_0x52fcfa(null,_0x132528);})[_0xaffa('0x17')](function(_0xe83358){_0x52fcfa(_0xe83358);});};AGIVertices['prototype'][_0xaffa('0x88')]=function(_0x5bec70,_0x330a4b,_0x511578){scripts[_0xaffa('0x88')](_0x330a4b,_0x5bec70[_0xaffa('0x7d')],_0x5bec70[_0xaffa('0x89')]||_0xaffa('0x5d'),this['isConfigured'](_0x5bec70[_0xaffa('0x8a')])?_0x5bec70[_0xaffa('0x8a')]:undefined)[_0xaffa('0x13')](function(_0x2ff81b){_0x511578(null,_0x2ff81b);})[_0xaffa('0x17')](function(_0x4f6e79){_0x511578(_0x4f6e79);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x8b')]=function(_0x2d9db3,_0x379cf7){scripts[_0xaffa('0x8b')](_0x2d9db3[_0xaffa('0x8c')],_0x2d9db3[_0xaffa('0x8d')],_0x2d9db3['aws_polly_region'],_0x2d9db3['aws_polly_voice']||_0xaffa('0x8e'),_0x2d9db3[_0xaffa('0x5b')],_0x2d9db3[_0xaffa('0x8f')]||_0xaffa('0x5b'))[_0xaffa('0x13')](function(_0x2e7847){_0x379cf7(null,_0x2e7847);})[_0xaffa('0x17')](function(_0x4b11c4){_0x379cf7(_0x4b11c4);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x90')]=function(_0x2ae179,_0x17d724){scripts[_0xaffa('0x90')](this[_0xaffa('0x33')]['uniqueid'],_0x2ae179['aws_access_key_id'],_0x2ae179[_0xaffa('0x8d')],_0x2ae179[_0xaffa('0x91')],_0x2ae179[_0xaffa('0x5b')],_0x2ae179['aws_bot_name'])['then'](function(_0xc27432){_0x17d724(null,_0xc27432);})['catch'](function(_0xe9aa1c){_0x17d724(_0xe9aa1c);});};AGIVertices[_0xaffa('0x12')][_0xaffa('0x92')]=function(_0x31994e,_0x44777d,_0x2f64bf){scripts[_0xaffa('0x92')](_0x44777d,_0x31994e[_0xaffa('0x7d')],_0x31994e[_0xaffa('0x93')]||_0xaffa('0x5d'))[_0xaffa('0x13')](function(_0x38ce26){_0x2f64bf(null,_0x38ce26);})[_0xaffa('0x17')](function(_0x274780){_0x2f64bf(_0x274780);});};AGIVertices['prototype']['tildeASR']=function(_0x40235b,_0x537e38,_0x161dbc){scripts[_0xaffa('0x94')](_0x537e38,_0x40235b[_0xaffa('0x95')],_0x40235b[_0xaffa('0x96')],_0x40235b[_0xaffa('0x72')])['then'](function(_0x2d2de4){_0x161dbc(null,_0x2d2de4);})['catch'](function(_0x3d4928){_0x161dbc(_0x3d4928);});};AGIVertices[_0xaffa('0x12')]['clear']=function(_0x23be4f){var _0xd10b50=_[_0xaffa('0x68')](verticesWithRetry,_0x23be4f[_0xaffa('0x36')])?_0x23be4f:_[_0xaffa('0x97')](_0x23be4f);for(var _0x3e1b6e in _0xd10b50){if(_0xd10b50[_0xaffa('0x98')](_0x3e1b6e)){if(_0xd10b50[_0x3e1b6e]&&_['isString'](_0xd10b50[_0x3e1b6e])){if(_[_0xaffa('0x68')](recursiveMapAttributes,_0x3e1b6e)){_0xd10b50[_0x3e1b6e]=this[_0xaffa('0x99')](_0xd10b50[_0x3e1b6e]);}else{_0xd10b50[_0x3e1b6e]=this[_0xaffa('0x9a')](_0xd10b50[_0x3e1b6e]);}}}}return _0xd10b50;};AGIVertices['prototype'][_0xaffa('0x9b')]=function(_0x10dc26){for(var _0x2ceabb in _0x10dc26){if(_0x10dc26['hasOwnProperty'](_0x2ceabb)){if(_[_0xaffa('0x9c')](_0x10dc26[_0x2ceabb])){this[_0xaffa('0x9b')](_0x10dc26[_0x2ceabb]);}else if(_[_0xaffa('0x9d')](_0x10dc26[_0x2ceabb])){for(var _0x47a8f6=0x0;_0x47a8f6<_0x10dc26[_0x2ceabb][_0xaffa('0x9e')];_0x47a8f6++){this[_0xaffa('0x9b')](_0x10dc26[_0x2ceabb][_0x47a8f6]);}}else if(_['isString'](_0x10dc26[_0x2ceabb])){_0x10dc26[_0x2ceabb]=this[_0xaffa('0x9a')](_0x10dc26[_0x2ceabb]);}}}};AGIVertices[_0xaffa('0x12')][_0xaffa('0x9f')]=function(_0x3f568a,_0x33cd5e){for(var _0x4c52c2 in _0x3f568a){if(_0x3f568a[_0xaffa('0x98')](_0x4c52c2)){if(_[_0xaffa('0x9c')](_0x3f568a[_0x4c52c2])){if(!_[_0xaffa('0x41')](_0x3f568a[_0x4c52c2])){this[_0xaffa('0x9f')](_0x3f568a[_0x4c52c2],util[_0xaffa('0x26')](_0xaffa('0xa0'),_0x33cd5e,_0x4c52c2));}}else if(_[_0xaffa('0x9d')](_0x3f568a[_0x4c52c2])){for(var _0x4fb871=0x0;_0x4fb871<_0x3f568a[_0x4c52c2][_0xaffa('0x9e')];_0x4fb871++){this[_0xaffa('0x9f')](_0x3f568a[_0x4c52c2][_0x4fb871],util['format'](_0xaffa('0xa0'),_0x33cd5e,_0x4c52c2+'['+_0x4fb871+']'));}}else{if(!_[_0xaffa('0x42')](_0x3f568a[_0x4c52c2])){this['channel'][_0xaffa('0xa1')](util[_0xaffa('0x26')](_0xaffa('0xa0'),_0x33cd5e,_0x4c52c2),_0x3f568a[_0x4c52c2]);}}}}};AGIVertices['prototype'][_0xaffa('0x99')]=function(_0x2a0f15){try{var _0x29b5c4=JSON[_0xaffa('0x6e')](_0x2a0f15);this['recursiveNodeIndex'](_0x29b5c4);return JSON[_0xaffa('0x75')](_0x29b5c4);}catch(_0x38cb2b){return this[_0xaffa('0x9a')](_0x2a0f15);}};AGIVertices['prototype'][_0xaffa('0x9a')]=function(_0x1c7731){var _0x48b795=_0x1c7731[_0xaffa('0xa2')]('{');for(var _0x2e4874=0x1;_0x2e4874<_0x48b795[_0xaffa('0x9e')];_0x2e4874+=0x1){var _0x1baa50=_0x48b795[_0x2e4874]['split']('}');if(_0x1baa50[_0xaffa('0x9e')]>0x1){_0x1c7731=_0x1c7731[_0xaffa('0xa3')]('{'+_0x1baa50[0x0]+'}',this['channel'][_0xaffa('0xa4')](_0x1baa50[0x0])[_0xaffa('0xa5')]||_0x1baa50[0x0]);}}if(_0x48b795[_0xaffa('0x9e')]===0x1){return _0x1c7731[_0xaffa('0x4a')]();}return this[_0xaffa('0x9a')](_0x1c7731);};AGIVertices['prototype'][_0xaffa('0xa6')]=function(_0x389ff6,_0x500778){var _0x2e136a=this[_0xaffa('0x33')][_0xaffa('0xa4')](_0x389ff6);if(_0x2e136a[_0xaffa('0xa7')]===-0x1){return _0x2e136a;}logger['info'](util[_0xaffa('0x26')](_0xaffa('0xa8'),_0x500778,_0x2e136a['extra']));return this[_0xaffa('0x33')]['setVariable'](_0x500778,_0x2e136a[_0xaffa('0xa5')]);};AGIVertices['prototype'][_0xaffa('0xa9')]=function(_0xe288fc){return _0xe288fc&&_0xe288fc!=='0'&&_0xe288fc!=='-1'&&_0xe288fc!=='';};AGIVertices[_0xaffa('0x12')][_0xaffa('0xaa')]=function(_0x51ed79){this['createSquareDetailsReport'][_0xaffa('0x71')](this,_0x51ed79,'-');_0x51ed79['retry']=_0x51ed79[_0xaffa('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xaffa('0x12')][_0xaffa('0xab')]=function(_0x3f524e){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3f524e[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x3f524e['text'])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0xac'));}var _0x2e08e4='\x22'+_0x3f524e[_0xaffa('0x5b')]+'\x22';if(this['isConfigured'](_0x3f524e[_0xaffa('0x7b')])){_0x2e08e4+=','+_0x3f524e['options'];}var _0x1b8a99=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xad'),_0x2e08e4);if(_0x1b8a99['result']===-0x1){return _0x1b8a99;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xaf'),_0x2e08e4));};AGIVertices[_0xaffa('0x12')]['mrcprecog']=function(_0x19d1d4){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x19d1d4[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x19d1d4[_0xaffa('0xb0')])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20grammar\x20configured');}var _0x12cf06=_0x19d1d4[_0xaffa('0xb0')];if(this[_0xaffa('0xa9')](_0x19d1d4[_0xaffa('0x7b')])){_0x12cf06+=','+_0x19d1d4['options'];}var _0x4f2022=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xb1'),_0x12cf06);if(_0x4f2022['result']===-0x1){return _0x4f2022;}var _0xb8beaf=this[_0xaffa('0xa6')](_0xaffa('0xb2'),_0xaffa('0xb3'));if(_0xb8beaf[_0xaffa('0xa7')]===-0x1){return _0xb8beaf;}var _0x2ce361=this[_0xaffa('0xa6')](_0xaffa('0xb4'),_0xaffa('0xb5'));if(_0x2ce361[_0xaffa('0xa7')]===-0x1){return _0x2ce361;}var _0x254e29=this[_0xaffa('0xa6')]('RECOG_INSTANCE()',_0xaffa('0xb6'));if(_0x254e29[_0xaffa('0xa7')]===-0x1){return _0x254e29;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12cf06));};AGIVertices['prototype'][_0xaffa('0x7')]=function(_0x89f99d){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xb7'),_0x89f99d[_0xaffa('0x35')]));return this[_0xaffa('0x33')][_0xaffa('0x7')]([_0x89f99d[_0xaffa('0xb8')],_0x89f99d[_0xaffa('0xb9')]]);};AGIVertices[_0xaffa('0x12')][_0xaffa('0xba')]=function(_0x23d88d){logger['info'](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x23d88d[_0xaffa('0x35')]));if(this[_0xaffa('0xa9')](_0x23d88d[_0xaffa('0x66')])){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x23d88d['timeout']));var _0x2ccdb9=this[_0xaffa('0x33')]['wait'](_0x23d88d['timeout']);if(_0x2ccdb9[_0xaffa('0xa7')]===-0x1){return _0x2ccdb9;}}return this['channel']['answer']();};AGIVertices[_0xaffa('0x12')]['callback']=function(_0x25afda){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xbb'),_0x25afda[_0xaffa('0x35')]));if(!this['isConfigured'](_0x25afda['list_id'])){return this[_0xaffa('0x33')]['error'](_0x25afda,_0xaffa('0xbc'));}_0x25afda[_0xaffa('0x47')]=moment();if(this[_0xaffa('0xa9')](_0x25afda['delay'])){_0x25afda['scheduledAt']=moment()[_0xaffa('0xbd')](_0x25afda[_0xaffa('0xbe')],_0xaffa('0xbf'));}if(!this[_0xaffa('0xa9')](_0x25afda[_0xaffa('0x4b')])){_0x25afda['callback_priority']=0x2;}this['createCmContact'][_0xaffa('0x71')](this,_0x25afda);return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x25afda[_0xaffa('0x46')],_0x25afda[_0xaffa('0xc0')],_0x25afda[_0xaffa('0x47')]));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xc1')]=function(_0x1545c4){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xc2'),_0x1545c4[_0xaffa('0x35')]));var _0x117964=this[_0xaffa('0x33')][_0xaffa('0x57')](_0x1545c4['application'],_0x1545c4[_0xaffa('0x7b')]);if(_0x117964[_0xaffa('0xa7')]===-0x1){return _0x117964;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0xc3'),_0x1545c4[_0xaffa('0xc4')],_0x1545c4[_0xaffa('0x7b')]));};AGIVertices['prototype'][_0xaffa('0xc5')]=function(_0x33f37f){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xc6'),_0x33f37f[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x33f37f['text'])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xac'));}var _0x3f3825='\x22'+_0x33f37f[_0xaffa('0x5b')]+'\x22';if(this[_0xaffa('0xa9')](_0x33f37f['options'])){_0x3f3825+=','+_0x33f37f[_0xaffa('0x7b')];}var _0x2f59ba=this[_0xaffa('0x33')][_0xaffa('0x57')]('MRCPSynth',_0x3f3825);if(_0x2f59ba[_0xaffa('0xa7')]===-0x1){return _0x2f59ba;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0xaf'),_0x3f3825));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xc7')]=function(_0x123461){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0xc8'),_0x123461[_0xaffa('0x35')]));if(!this['isConfigured'](_0x123461[_0xaffa('0x5b')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0xac'));}var _0x55452c='\x22'+_0x123461[_0xaffa('0x5b')]+'\x22';if(this['isConfigured'](_0x123461['options'])){_0x55452c+=','+_0x123461[_0xaffa('0x7b')];}var _0x574cba=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xad'),_0x55452c);if(_0x574cba[_0xaffa('0xa7')]===-0x1){return _0x574cba;}return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xaf'),_0x55452c));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xc9')]=function(_0x5b60e4){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0xca'),_0x5b60e4['label']));if(!this[_0xaffa('0xa9')](_0x5b60e4['grammar'])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20grammar\x20configured');}var _0x2e862e=_0x5b60e4[_0xaffa('0xb0')];if(this[_0xaffa('0xa9')](_0x5b60e4['options'])){_0x2e862e+=','+_0x5b60e4[_0xaffa('0x7b')];}var _0x276c37=this['channel'][_0xaffa('0x57')]('MRCPRecog',_0x2e862e);if(_0x276c37[_0xaffa('0xa7')]===-0x1){return _0x276c37;}var _0x21b10e=this[_0xaffa('0xa6')](_0xaffa('0xb2'),_0xaffa('0xcb'));if(_0x21b10e[_0xaffa('0xa7')]===-0x1){return _0x21b10e;}var _0x2e08e1=this[_0xaffa('0xa6')](_0xaffa('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2e08e1['result']===-0x1){return _0x2e08e1;}var _0x85a300=this[_0xaffa('0xa6')](_0xaffa('0xcc'),_0xaffa('0xcd'));if(_0x85a300['result']===-0x1){return _0x85a300;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xce'),_0x2e862e));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xcf')]=function(_0x293ac8){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xd0'),_0x293ac8[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x293ac8[_0xaffa('0xb0')])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0xd1'));}var _0x48d226=_0x293ac8[_0xaffa('0xb0')];if(this['isConfigured'](_0x293ac8[_0xaffa('0x7b')])){_0x48d226+=','+_0x293ac8['options'];}var _0x144f08=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xb1'),_0x48d226);if(_0x144f08[_0xaffa('0xa7')]===-0x1){return _0x144f08;}var _0x5a2fcf=this[_0xaffa('0xa6')](_0xaffa('0xb2'),_0xaffa('0xd2'));if(_0x5a2fcf['result']===-0x1){return _0x5a2fcf;}var _0x46f3cc=this[_0xaffa('0xa6')](_0xaffa('0xb4'),_0xaffa('0xd3'));if(_0x46f3cc[_0xaffa('0xa7')]===-0x1){return _0x46f3cc;}var _0x235827=this[_0xaffa('0xa6')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x235827['result']===-0x1){return _0x235827;}return this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')](_0xaffa('0xce'),_0x48d226));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xd4')]=function(_0xcc9386){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xd5'),_0xcc9386[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0xcc9386[_0xaffa('0xd6')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0xcc9386,_0xaffa('0xd7'));}var _0x4b8168=this['getSquareOdbc']['sync'](this,_0xcc9386['odbc_id']);if(!_0x4b8168){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0xcc9386,_0xaffa('0xd8'));}if(!this['isConfigured'](_0xcc9386[_0xaffa('0x2b')])){return this['channel'][_0xaffa('0x29')](_0xcc9386,_0xaffa('0xd9'));}var _0x4fb497=_0xcc9386[_0xaffa('0x2b')][_0xaffa('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xda'),_0x4fb497));var _0x3afab5=this['getQueryOdbc']['sync'](this,_0x4b8168,_0x4fb497);this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0xcc9386,_0x4fb497);if(!this[_0xaffa('0xa9')](_0xcc9386['variable_id'])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xdb'));}var _0x36fecc=this[_0xaffa('0xa4')]['sync'](this,_0xcc9386[_0xaffa('0xdc')]);if(!_0x36fecc){return this[_0xaffa('0x33')]['error'](_0xcc9386,_0xaffa('0xdd'));}var _0x5888f3=this;_0x3afab5[_0xaffa('0xde')](function(_0x282b87,_0x4d8778){Object[_0xaffa('0xdf')](_0x282b87)[_0xaffa('0xde')](function(_0x390cc8){_0x5888f3[_0xaffa('0x33')][_0xaffa('0xa1')](util['format']('%s[%s][%s]',_0x36fecc,_0x4d8778,_0x390cc8),_0x282b87[_0x390cc8]);});});this[_0xaffa('0x33')][_0xaffa('0xa1')](util[_0xaffa('0x26')]('%s_ROWS_COUNT',_0x36fecc),_0x3afab5['length']);return this['channel']['noop'](util[_0xaffa('0x26')](_0xaffa('0xe0'),_0x36fecc));};AGIVertices['prototype'][_0xaffa('0xe1')]=function(_0x3a9848){logger['debug'](util['format'](_0xaffa('0xe2'),_0x3a9848[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x3a9848[_0xaffa('0xe3')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x3a9848,_0xaffa('0xe4'));}var _0x82fc9b=this[_0xaffa('0x1b')][_0xaffa('0x71')](this,_0x3a9848[_0xaffa('0xe3')]);if(!_0x82fc9b){return this[_0xaffa('0x33')]['error'](_0x3a9848,_0xaffa('0xe5'));}var _0x1030ea=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xe6'),[util[_0xaffa('0x26')]('SIP/%s',_0x82fc9b),_0x3a9848['timeout'],_0x3a9848[_0xaffa('0xe7')],_0x3a9848[_0xaffa('0x64')]]);if(_0x1030ea[_0xaffa('0xa7')]===-0x1){return _0x1030ea;}return this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')](_0xaffa('0xe8'),'DIAL'));};AGIVertices['prototype'][_0xaffa('0xe9')]=function(_0x34ad2d){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xea'),_0x34ad2d['label']));if(!this[_0xaffa('0xa9')](_0x34ad2d[_0xaffa('0x7d')])){return this['channel']['noop'](_0xaffa('0xeb'));}if(!this[_0xaffa('0xa9')](_0x34ad2d['text'])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20text\x20configured');}this[_0xaffa('0x33')]['bot']=!![];this[_0xaffa('0x32')](_0x34ad2d);this[_0xaffa('0x3f')](_0x34ad2d[_0xaffa('0x5b')],'in','','');this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')]('Trying\x20Dialogflow:\x20%s',_0x34ad2d[_0xaffa('0x5b')]));var _0x189e99=this[_0xaffa('0x7c')][_0xaffa('0x71')](this,_0x34ad2d);if(_0x189e99){for(var _0x58dbc1 in _0x189e99){if(_0x189e99[_0xaffa('0x98')](_0x58dbc1)){this[_0xaffa('0x33')][_0xaffa('0xa1')](util['format']('DIALOGFLOW_%s',_0x58dbc1[_0xaffa('0x6b')]()),_0x189e99[_0x58dbc1]);}}this['createSquareMessage'](_0x189e99[_0xaffa('0xec')],_0xaffa('0xed'),'dialogflow','');return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xee'),_0x189e99[_0xaffa('0xec')]));}return this['channel'][_0xaffa('0x29')](_0x34ad2d,_0xaffa('0xef'));};AGIVertices['prototype'][_0xaffa('0xf0')]=function(_0x130ef4){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0xf1'),_0x130ef4[_0xaffa('0x35')]));if(!this['isConfigured'](_0x130ef4[_0xaffa('0x80')])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0xf2'));}if(!this[_0xaffa('0xa9')](_0x130ef4[_0xaffa('0x81')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0xf3'));}if(!this[_0xaffa('0xa9')](_0x130ef4[_0xaffa('0x82')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xf4'));}if(!this[_0xaffa('0xa9')](_0x130ef4[_0xaffa('0x83')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xf5'));}if(!this[_0xaffa('0xa9')](_0x130ef4[_0xaffa('0x5b')])){return this[_0xaffa('0x33')]['noop']('no\x20text\x20configured');}this[_0xaffa('0x33')][_0xaffa('0xf6')]=!![];this[_0xaffa('0x32')](_0x130ef4);this[_0xaffa('0x3f')](_0x130ef4['text'],'in','','');this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xf7'),_0x130ef4[_0xaffa('0x5b')]));var _0x548278=this[_0xaffa('0x7f')][_0xaffa('0x71')](this,_0x130ef4);if(_0x548278){for(var _0x82a63d in _0x548278){if(_0x548278[_0xaffa('0x98')](_0x82a63d)){if(_0x82a63d!=='providerResponse'){this[_0xaffa('0x33')][_0xaffa('0xa1')](util[_0xaffa('0x26')](_0xaffa('0xf8'),_0x82a63d[_0xaffa('0x6b')]()),_0x548278[_0x82a63d]);}}}this[_0xaffa('0x3f')](_0x548278[_0xaffa('0xec')],_0xaffa('0xed'),_0xaffa('0xf0'),_0x548278[_0xaffa('0xf9')]);return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xfa'),_0x548278[_0xaffa('0xec')]));}return this['channel'][_0xaffa('0x29')](_0x130ef4,_0xaffa('0xfb'));};AGIVertices[_0xaffa('0x12')][_0xaffa('0xfc')]=function(_0x384fcd){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0xfd'),_0x384fcd['label']));if(!this[_0xaffa('0xa9')](_0x384fcd[_0xaffa('0xfe')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0xff'));}if(!this[_0xaffa('0xa9')](_0x384fcd[_0xaffa('0x100')])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20username\x20configured');}if(!this[_0xaffa('0xa9')](_0x384fcd[_0xaffa('0x101')])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x384fcd[_0xaffa('0x102')])){return this[_0xaffa('0x33')][_0xaffa('0xae')]('no\x20text\x20configured');}this[_0xaffa('0x33')]['bot']=!![];this[_0xaffa('0x32')](_0x384fcd);this[_0xaffa('0x3f')](_0x384fcd[_0xaffa('0x5b')],'in','','');this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')](_0xaffa('0x103'),_0x384fcd[_0xaffa('0x5b')]));var _0x1c51ee=this[_0xaffa('0x84')][_0xaffa('0x71')](this,_0x384fcd);if(_0x1c51ee){for(var _0x27ccd2 in _0x1c51ee){if(_0x1c51ee['hasOwnProperty'](_0x27ccd2)){this[_0xaffa('0x33')][_0xaffa('0xa1')](util['format'](_0xaffa('0x104'),_0x27ccd2[_0xaffa('0x6b')]()),_0x1c51ee[_0x27ccd2]);}}this[_0xaffa('0x3f')](_0x1c51ee[_0xaffa('0xec')],_0xaffa('0xed'),'sesteknda','');if(_0x1c51ee[_0xaffa('0x105')]){this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x106'),_0x1c51ee[_0xaffa('0x105')]));var _0x1b1f23=this[_0xaffa('0x33')][_0xaffa('0x107')](_0x1c51ee[_0xaffa('0x105')]);try{fs[_0xaffa('0x108')](_0x1c51ee[_0xaffa('0x105')]+_0xaffa('0x109'));}catch(_0x4bb9f3){logger[_0xaffa('0x29')](_0x4bb9f3);}return _0x1b1f23;}else{return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('SestekNDA\x20Result\x20%s',_0x1c51ee[_0xaffa('0xec')]));}}return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x384fcd,_0xaffa('0x10a'));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x10b')]=function(_0x17836a){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x10c'),_0x17836a['label']));return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x10b'));};AGIVertices['prototype'][_0xaffa('0x10d')]=function(_0x12f64f){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x10e'),_0x12f64f[_0xaffa('0x35')]));var _0x49c8bf='';if(_0x12f64f[_0xaffa('0x10f')]){if(!this[_0xaffa('0xa9')](_0x12f64f[_0xaffa('0x10f')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x12f64f,_0xaffa('0x110'));}else{var _0xdb39a5=parseInt(_0x12f64f[_0xaffa('0x10f')],0xa);if(isNaN(_0xdb39a5)){_0x49c8bf=_0x12f64f[_0xaffa('0x10f')];}else{_0x49c8bf=this[_0xaffa('0x1c')][_0xaffa('0x71')](this,_0x12f64f['trunk_id']);if(!_0x49c8bf){return this[_0xaffa('0x33')]['error'](_0x12f64f,_0xaffa('0x111'));}}}}else if(_0x12f64f[_0xaffa('0x112')]){_0x49c8bf=_0x12f64f['trunk_name'];}else{return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x12f64f,_0xaffa('0x110'));}var _0x41d1e0=this[_0xaffa('0x33')][_0xaffa('0x57')](_0xaffa('0xe6'),[util[_0xaffa('0x26')]('SIP/%s/%s',_0x49c8bf,_0x12f64f[_0xaffa('0x46')]),_0x12f64f[_0xaffa('0x66')],_0x12f64f['opts'],_0x12f64f['url']]);if(_0x41d1e0['result']===-0x1){return _0x41d1e0;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xe8'),_0xaffa('0xe6')));};AGIVertices[_0xaffa('0x12')]['finally']=function(_0x337497){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x113'),_0x337497['label']));return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x114'));};AGIVertices[_0xaffa('0x12')]['getdigits']=function(_0x61f04b){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x115'),_0x61f04b[_0xaffa('0x35')]));if(_0x61f04b[_0xaffa('0x116')]===0x0){return this['maxRetry'](_0x61f04b);}_0x61f04b[_0xaffa('0x116')]-=0x1;if(!this['isConfigured'](_0x61f04b[_0xaffa('0x117')])){return this[_0xaffa('0x33')]['error'](_0x61f04b,_0xaffa('0x118'));}var _0x5d0274=this[_0xaffa('0x1e')][_0xaffa('0x71')](this,_0x61f04b[_0xaffa('0x117')]);if(!_0x5d0274){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x61f04b,'no\x20file\x20audio\x20found');}if(!this[_0xaffa('0xa9')](_0x61f04b[_0xaffa('0xdc')])){return this[_0xaffa('0x33')][_0xaffa('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5add1d=this[_0xaffa('0x33')][_0xaffa('0x119')](_0x5d0274,_0x61f04b['response'],_0x61f04b[_0xaffa('0x11a')]);var _0x5c9e21=_0x5add1d[_0xaffa('0xa7')]?_0x5add1d[_0xaffa('0xa7')]['toString']():'';logger[_0xaffa('0x2c')](_0xaffa('0x11b'),JSON[_0xaffa('0x75')](_0x5add1d));if(_0x5add1d[_0xaffa('0xa7')]===-0x1){this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x61f04b,_0x5c9e21);return _0x5add1d;}else if(_0x5add1d[_0xaffa('0xa5')]===_0xaffa('0x66')){_0x5add1d[_0xaffa('0xa7')]=_0x5c9e21[_0xaffa('0x9e')]>=parseInt(_0x61f04b[_0xaffa('0x11c')])?'x':'i';}else{_0x5add1d['result']=_0x5c9e21[_0xaffa('0x9e')]>=parseInt(_0x61f04b['mindigit'])&&_0x5c9e21[_0xaffa('0x9e')]<=parseInt(_0x61f04b[_0xaffa('0x11a')])?'x':'i';}var _0x597830=this[_0xaffa('0xa4')][_0xaffa('0x71')](this,_0x61f04b[_0xaffa('0xdc')]);if(!_0x597830){return this['channel'][_0xaffa('0x29')](_0x61f04b,_0xaffa('0xdd'));}this[_0xaffa('0x33')][_0xaffa('0xa1')](_0x597830,_0x5c9e21);if(this[_0xaffa('0xa9')](_0x61f04b[_0xaffa('0x11d')])){var _0x4fba0b=parseInt(_0x61f04b[_0xaffa('0x11d')],0xa);var _0x30d317=rs[_0xaffa('0x11e')]({'charset':'*','length':_0x4fba0b});var _0xe8aeeb=_0x5c9e21['length'];if(_0xe8aeeb>0x0){if(_0xe8aeeb>_0x4fba0b){this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x61f04b,_0x61f04b[_0xaffa('0x11f')]===_0xaffa('0x120')?_0x30d317+_0x5c9e21[_0xaffa('0x121')](_0x4fba0b):_0x5c9e21['substr'](0x0,_0xe8aeeb-_0x4fba0b)+_0x30d317);}else{this['createSquareDetailsReport']['sync'](this,_0x61f04b,rs[_0xaffa('0x11e')]({'charset':'*','length':_0xe8aeeb}));}}else{this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x61f04b,'');}}else{this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x61f04b,_0x5c9e21);}return _0x5add1d;};AGIVertices['prototype']['getsecretdigits']=function(_0x20500a){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x122'),_0x20500a['label']));return this['getdigits'](_0x20500a);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x123')]=function(_0x1813f2){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1813f2[_0xaffa('0x35')]));this[_0xaffa('0x32')]['sync'](this,_0x1813f2,_0x1813f2[_0xaffa('0x124')]);return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('GOAL\x20%s',_0x1813f2[_0xaffa('0x124')]));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x125')]=function(_0x88b57c){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x126'),_0x88b57c[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x88b57c[_0xaffa('0x8c')])||!this[_0xaffa('0xa9')](_0x88b57c['aws_secret_access_key'])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x127'));}if(!this[_0xaffa('0xa9')](_0x88b57c[_0xaffa('0x5b')])){return this[_0xaffa('0x33')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0xaffa('0x26')]('Trying\x20aws\x20Polly\x20%s',_0x88b57c['text']));var _0x2aa99f=this[_0xaffa('0x8b')]['sync'](this,_0x88b57c);if(_0x2aa99f){this['channel'][_0xaffa('0xae')](util['format'](_0xaffa('0x128'),_0x2aa99f));var _0x1f6c4b=this['channel']['streamFile'](_0x2aa99f);try{fs[_0xaffa('0x108')](_0x2aa99f+_0xaffa('0x109'));}catch(_0x1f9d4b){logger['error'](_0x1f9d4b);}return _0x1f6c4b;}return this['channel'][_0xaffa('0x29')](_0x88b57c,_0xaffa('0x129'));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x12a')]=function(_0x10e38e){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x12b'),_0x10e38e[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x10e38e[_0xaffa('0x8c')])||!this[_0xaffa('0xa9')](_0x10e38e[_0xaffa('0x8d')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0x127'));}if(!this[_0xaffa('0xa9')](_0x10e38e[_0xaffa('0x12c')])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0x12d'));}if(!this['isConfigured'](_0x10e38e[_0xaffa('0x5b')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0xac'));}this[_0xaffa('0x33')][_0xaffa('0xf6')]=!![];this[_0xaffa('0x32')](_0x10e38e);this[_0xaffa('0x3f')](_0x10e38e['text'],'in','','');this['channel'][_0xaffa('0xae')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x10e38e['text']));var _0x5cdea5=this[_0xaffa('0x90')][_0xaffa('0x71')](this,_0x10e38e);if(_0x5cdea5){for(var _0x1c8781 in _0x5cdea5){if(_0x5cdea5[_0xaffa('0x98')](_0x1c8781)&&_['isString'](_0x5cdea5[_0x1c8781])){this[_0xaffa('0x33')]['setVariable'](util[_0xaffa('0x26')](_0xaffa('0x12e'),_0x1c8781[_0xaffa('0x6b')]()),_0x5cdea5[_0x1c8781]);}}if(_[_0xaffa('0x42')](_0x5cdea5[_0xaffa('0x79')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x12f'));}else{this['createSquareMessage'](_0x5cdea5[_0xaffa('0x79')],_0xaffa('0xed'),'amazonlex','');return this['channel'][_0xaffa('0xae')](util['format'](_0xaffa('0x130'),_0x5cdea5[_0xaffa('0x79')]));}}return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x10e38e,_0xaffa('0x131'));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x132')]=function(_0x5980f8){logger['info'](util[_0xaffa('0x26')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5980f8[_0xaffa('0x35')],_0x5980f8['timeout']));if(!this[_0xaffa('0xa9')](_0x5980f8[_0xaffa('0x7d')])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0xeb'));}var _0x45e32c='wav';var _0x47e98b=util[_0xaffa('0x26')](_0xaffa('0x133'),FILES_PATH,rs[_0xaffa('0x11e')](0x4));var _0x48362b=util[_0xaffa('0x26')](_0xaffa('0xa0'),_0x47e98b,_0x45e32c);var _0x4631ed=!![];if(_0x5980f8[_0xaffa('0x134')]===_0xaffa('0x135')){_0x4631ed=![];}var _0x5da16b=this[_0xaffa('0x33')][_0xaffa('0x136')](_0x47e98b,_0x45e32c,_0x5980f8[_0xaffa('0x137')],_0x5980f8[_0xaffa('0x66')],undefined,_0x4631ed);if(_0x5da16b[_0xaffa('0xa7')]!==-0x1){this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')](_0xaffa('0x138'),_0x48362b));var _0xbfccc1=this[_0xaffa('0x92')][_0xaffa('0x71')](this,_0x5980f8,_0x48362b);if(_0xbfccc1){for(var _0x3b2a57 in _0xbfccc1){if(_0xbfccc1[_0xaffa('0x98')](_0x3b2a57)){this[_0xaffa('0x33')]['setVariable'](util[_0xaffa('0x26')](_0xaffa('0x139'),_0x3b2a57['toUpperCase']()),_0xbfccc1[_0x3b2a57]);}}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x13a'),JSON[_0xaffa('0x75')](_0xbfccc1)));}}return _0x5da16b;};AGIVertices[_0xaffa('0x12')][_0xaffa('0x13b')]=function(_0x4c8a21){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x13c'),_0x4c8a21['label']));if(!this[_0xaffa('0xa9')](_0x4c8a21[_0xaffa('0x95')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x13d'));}if(!this[_0xaffa('0xa9')](_0x4c8a21[_0xaffa('0x96')])){return this[_0xaffa('0x33')]['noop'](_0xaffa('0x13e'));}var _0x289895=_0xaffa('0x13f');var _0x784b5d=util[_0xaffa('0x26')](_0xaffa('0x133'),FILES_PATH,rs['generate'](0x4));var _0x2b85d5=util['format'](_0xaffa('0xa0'),_0x784b5d,_0x289895);var _0x3560b0=!![];if(_0x4c8a21[_0xaffa('0x134')]==='NOBEEP'){_0x3560b0=![];}var _0x337498=this[_0xaffa('0x33')][_0xaffa('0x136')](_0x784b5d,_0x289895,_0x4c8a21[_0xaffa('0x137')],_0x4c8a21[_0xaffa('0x66')],undefined,_0x3560b0);if(_0x337498[_0xaffa('0xa7')]!==-0x1){this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x140'),_0x2b85d5));var _0x5a30a4=this[_0xaffa('0x94')]['sync'](this,_0x4c8a21,_0x2b85d5);if(_0x5a30a4){for(var _0x6b04ca in _0x5a30a4){if(_0x5a30a4[_0xaffa('0x98')](_0x6b04ca)){this['channel']['setVariable'](util[_0xaffa('0x26')](_0xaffa('0x141'),_0x6b04ca[_0xaffa('0x6b')]()),_0x5a30a4[_0x6b04ca]);}}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x142'),JSON[_0xaffa('0x75')](_0x5a30a4)));}}return _0x337498;};AGIVertices[_0xaffa('0x12')][_0xaffa('0x143')]=function(_0x522425){logger[_0xaffa('0x2c')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x522425['label']));return this[_0xaffa('0x33')]['continueAt'](_0x522425['context'],_0x522425[_0xaffa('0x3b')],_0x522425[_0xaffa('0x3c')]);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x144')]=function(_0x5b25dc){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x145'),_0x5b25dc[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x5b25dc[_0xaffa('0x146')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x5b25dc,_0xaffa('0x147'));}try{var _0x2b9493=eval(_0x5b25dc[_0xaffa('0x146')])?_0xaffa('0x148'):_0xaffa('0x149');this['channel']['noop'](util[_0xaffa('0x26')](_0xaffa('0x14a'),_0x5b25dc['condition'],_0x2b9493));return{'code':0xc8,'result':_0x2b9493};}catch(_0x3c56ad){return{'code':0xc8,'result':_0xaffa('0x149')};}};AGIVertices[_0xaffa('0x12')][_0xaffa('0x14b')]=function(_0x3aed16){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x14c'),_0x3aed16[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x3aed16['interval_id'])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x3aed16,_0xaffa('0x14d'));}var _0xdd1890=this[_0xaffa('0x23')][_0xaffa('0x71')](this,_0x3aed16[_0xaffa('0x14e')]);if(!_0xdd1890){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x3aed16,_0xaffa('0x14f'));}for(var _0x49ef95=0x0;_0x49ef95<_0xdd1890['length'];_0x49ef95+=0x1){var _0x15a18e=this['channel'][_0xaffa('0xa4')](util['format'](_0xaffa('0x150'),_0xdd1890[_0x49ef95]));if(_0x15a18e['result']===-0x1){return _0x15a18e;}logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('IFTIME\x20%s\x20%s',_0xdd1890[_0x49ef95],_0x15a18e[_0xaffa('0xa5')]));if(_0x15a18e[_0xaffa('0xa5')]===_0xaffa('0x148')){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x151'),_0xdd1890[_0x49ef95],_0xaffa('0x148')));this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('IFTIME\x20%s\x20%s',_0xdd1890[_0x49ef95],_0xaffa('0x148')));return{'code':0xc8,'result':_0xaffa('0x148')};}else{logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x151'),_0xdd1890[_0x49ef95],_0xaffa('0x149')));this[_0xaffa('0x33')]['noop'](util['format'](_0xaffa('0x151'),_0xdd1890[_0x49ef95],'false'));}}return{'code':0xc8,'result':_0xaffa('0x149')};};AGIVertices[_0xaffa('0x12')]['hangup']=function(_0xdb25f3){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x152'),_0xdb25f3[_0xaffa('0x35')]));return this[_0xaffa('0x33')][_0xaffa('0x153')]();};AGIVertices[_0xaffa('0x12')][_0xaffa('0x154')]=function(_0x301fe9){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x155'),_0x301fe9[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x301fe9['key'])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xeb'));}var _0x2bc407=_0xaffa('0x13f');var _0x1cbec9=util[_0xaffa('0x26')](_0xaffa('0x133'),FILES_PATH,rs[_0xaffa('0x11e')](0x4));var _0x505d11=util[_0xaffa('0x26')]('%s.%s',_0x1cbec9,_0x2bc407);var _0x5ed86d=!![];if(_0x301fe9[_0xaffa('0x134')]===_0xaffa('0x135')){_0x5ed86d=![];}var _0x991d33=this[_0xaffa('0x33')]['recordFile'](_0x1cbec9,_0x2bc407,_0x301fe9[_0xaffa('0x137')],_0x301fe9[_0xaffa('0x66')],undefined,_0x5ed86d);if(_0x991d33[_0xaffa('0xa7')]!==-0x1){this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x156'),_0x505d11));var _0x59d946=this[_0xaffa('0x88')]['sync'](this,_0x301fe9,_0x505d11);if(_0x59d946){for(var _0x3f1b7b in _0x59d946){if(_0x59d946['hasOwnProperty'](_0x3f1b7b)){this['channel']['setVariable'](util[_0xaffa('0x26')](_0xaffa('0x157'),_0x3f1b7b[_0xaffa('0x6b')]()),_0x59d946[_0x3f1b7b]);}}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x158'),JSON['stringify'](_0x59d946)));}}return _0x991d33;};AGIVertices[_0xaffa('0x12')][_0xaffa('0x159')]=function(_0x2c1529){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x15a'),_0x2c1529[_0xaffa('0x35')]));if(!this['isConfigured'](_0x2c1529[_0xaffa('0x7d')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xeb'));}if(!this['isConfigured'](_0x2c1529[_0xaffa('0x5b')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xac'));}this['channel']['noop'](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x2c1529['text']));var _0x154e4e=this[_0xaffa('0x85')]['sync'](this,_0x2c1529);if(_0x154e4e){this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x156'),_0x154e4e));var _0x32afd4=this['channel']['streamFile'](_0x154e4e,_0x2c1529[_0xaffa('0x137')]);try{fs[_0xaffa('0x108')](_0x154e4e+_0xaffa('0x109'));}catch(_0x1b9176){logger[_0xaffa('0x29')](_0x1b9176);}return _0x32afd4;}return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x2c1529,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xaffa('0x15b')]=function(_0x1aba42){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x15c'),_0x1aba42[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x1aba42[_0xaffa('0x15d')])){return this['channel'][_0xaffa('0x29')](_0x1aba42,_0xaffa('0x15e'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaffa('0x33')][_0xaffa('0x39')],_0x1aba42['findBy']));var _0x37a532=this[_0xaffa('0x52')]['sync'](this,_0x1aba42[_0xaffa('0x15d')]);if(_0x37a532){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x1aba42[_0xaffa('0x15d')]));this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this['channel'][_0xaffa('0x39')],_0x1aba42[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x160')};}else{logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x161'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x1aba42[_0xaffa('0x15d')]));this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x161'),this['channel']['callerid'],_0x1aba42[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x162')};}};AGIVertices[_0xaffa('0x12')][_0xaffa('0x163')]=function(_0xab459d){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x164'),_0xab459d[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0xab459d[_0xaffa('0x15d')])){return this[_0xaffa('0x33')]['error'](_0xab459d,'no\x20find\x20by\x20configured');}logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaffa('0x33')][_0xaffa('0x39')],_0xab459d[_0xaffa('0x15d')]));var _0x13ad66=this['agentLogout'][_0xaffa('0x71')](this,_0xab459d['findBy']);if(_0x13ad66){logger[_0xaffa('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xaffa('0x33')][_0xaffa('0x39')],_0xab459d[_0xaffa('0x15d')]));this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0xab459d[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x160')};}else{logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x161'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0xab459d[_0xaffa('0x15d')]));this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x161'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0xab459d[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x162')};}};AGIVertices[_0xaffa('0x12')][_0xaffa('0x165')]=function(_0x3a716a){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x166'),_0x3a716a[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x3a716a['operation'])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x3a716a,_0xaffa('0x167'));}this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x168'),_0x3a716a[_0xaffa('0x169')]));var _0x582821=eval(_0x3a716a['operation']);if(!this[_0xaffa('0xa9')](_0x3a716a['variable_id'])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x54cfb0=this[_0xaffa('0xa4')]['sync'](this,_0x3a716a[_0xaffa('0xdc')]);if(!_0x54cfb0){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x3a716a,'no\x20variable\x20found');}if(_[_0xaffa('0x9d')](_0x582821)){var _0x472255=this;_0x582821['forEach'](function(_0x3b5b0c,_0x1f001c){_0x472255['channel'][_0xaffa('0xa1')](util[_0xaffa('0x26')](_0xaffa('0x16a'),_0x54cfb0,_0x1f001c),_0x3b5b0c);});return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x16b'),_0x54cfb0));}else{return this[_0xaffa('0x33')][_0xaffa('0xa1')](_0x54cfb0,_0x582821);}};AGIVertices[_0xaffa('0x12')][_0xaffa('0xd')]=function(_0x13332b){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x16c'),_0x13332b['label']));if(_0x13332b[_0xaffa('0x116')]===0x0){return this['maxRetry'](_0x13332b);}_0x13332b[_0xaffa('0x116')]-=0x1;if(!this['isConfigured'](_0x13332b[_0xaffa('0x117')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x13332b,'no\x20file\x20audio\x20selected');}var _0x153de7=this[_0xaffa('0x1e')][_0xaffa('0x71')](this,_0x13332b['file_id']);if(!_0x153de7){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x13332b,_0xaffa('0x16d'));}var _0x3403cd=this[_0xaffa('0x33')][_0xaffa('0x119')](_0x153de7,_0x13332b[_0xaffa('0x16e')],_0x13332b[_0xaffa('0x16f')]);var _0x3cf60d=_0x3403cd[_0xaffa('0xa7')];if(_0x3403cd[_0xaffa('0xa7')]===-0x1){this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x13332b,'-1');return _0x3403cd;}else if(_0x3403cd[_0xaffa('0xa5')]===_0xaffa('0x66')){_0x3403cd[_0xaffa('0xa7')]=_0x3403cd[_0xaffa('0xa7')][_0xaffa('0x9e')]>0x0?_0x3403cd[_0xaffa('0xa7')]:'t';}else if(_[_0xaffa('0x41')](_0x3403cd['result'])){_0x3403cd['result']='#';_0x3cf60d='#';}if(!this[_0xaffa('0xa9')](_0x13332b[_0xaffa('0xdc')])){this['channel'][_0xaffa('0xae')](_0xaffa('0xdb'));}else{var _0x3ff1e0=this[_0xaffa('0xa4')]['sync'](this,_0x13332b[_0xaffa('0xdc')]);if(!_0x3ff1e0){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x13332b,_0xaffa('0xdd'));}this['channel'][_0xaffa('0xa1')](_0x3ff1e0,_0x3cf60d);}this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x13332b,_0x3cf60d);return _0x3403cd;};AGIVertices[_0xaffa('0x12')][_0xaffa('0xae')]=function(_0xc57b3b){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x170'),_0xc57b3b['label']));return this['channel'][_0xaffa('0xae')](_0xc57b3b[_0xaffa('0x171')]||_0xc57b3b['label']);};AGIVertices[_0xaffa('0x12')]['pause']=function(_0x25f120){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x25f120['label']));if(!this[_0xaffa('0xa9')](_0x25f120['findBy'])){return this['channel']['error'](_0x25f120,_0xaffa('0x15e'));}logger['info'](util[_0xaffa('0x26')](_0xaffa('0x172'),this['channel'][_0xaffa('0x39')],_0x25f120[_0xaffa('0x15d')]));var _0x1f4c70=this[_0xaffa('0x4c')][_0xaffa('0x71')](this,_0x25f120[_0xaffa('0x173')]);var _0x366419=this[_0xaffa('0x4e')]['sync'](this,_0x25f120[_0xaffa('0x15d')],_0x1f4c70);if(_0x366419){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x15f'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x25f120[_0xaffa('0x15d')]));this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaffa('0x33')][_0xaffa('0x39')],_0x25f120[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x160')};}else{logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x25f120['findBy']));this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this['channel'][_0xaffa('0x39')],_0x25f120['findBy']));return{'code':0xc8,'result':_0xaffa('0x162')};}};AGIVertices[_0xaffa('0x12')][_0xaffa('0x174')]=function(_0x558a07){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x175'),_0x558a07[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x558a07['file_id'])){return this['channel'][_0xaffa('0x29')](_0x558a07,'no\x20file\x20audio\x20selected');}var _0x34563e=this[_0xaffa('0x1e')]['sync'](this,_0x558a07[_0xaffa('0x117')]);if(!_0x34563e){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x558a07,_0xaffa('0x16d'));}var _0x5d0cf5=this[_0xaffa('0x33')][_0xaffa('0x57')]('PLAYBACK',[_0x34563e,_0x558a07['opts']]);if(_0x5d0cf5[_0xaffa('0xa7')]===-0x1){return _0x5d0cf5;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0xc3'),_0xaffa('0x176'),_0x34563e));};AGIVertices['prototype']['queue']=function(_0x41ad15){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x177'),_0x41ad15[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x41ad15['queue_id'])){return this['channel'][_0xaffa('0x29')](_0x41ad15,_0xaffa('0x178'));}var _0x572012='';var _0x3a5eeb=parseInt(_0x41ad15[_0xaffa('0x179')],0xa);if(isNaN(_0x3a5eeb)){_0x572012=_0x41ad15[_0xaffa('0x179')];}else{_0x572012=this['getVoiceQueue'][_0xaffa('0x71')](this,_0x41ad15['queue_id']);if(!_0x572012){return this[_0xaffa('0x33')]['error'](_0x41ad15,_0xaffa('0x17a'));}}var _0x35e70b='';if(this['isConfigured'](_0x41ad15[_0xaffa('0x117')])){var _0x5d05fd=this[_0xaffa('0x1e')][_0xaffa('0x71')](this,_0x41ad15[_0xaffa('0x117')]);if(_0x5d05fd){_0x35e70b=_0x5d05fd;}}this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x41ad15,_0x572012);if(_0x41ad15['opts'][_0xaffa('0x17b')]('x')<0x0){_0x41ad15['opts']+='x';}if(_0x41ad15[_0xaffa('0xe7')][_0xaffa('0x17b')]('X')<0x0){_0x41ad15[_0xaffa('0xe7')]+='X';}this[_0xaffa('0x33')]['setVariable'](_0xaffa('0x17c'),_0x572012?_0x572012[_0xaffa('0x17d')]():'');var _0x209053=this[_0xaffa('0x33')][_0xaffa('0x57')]('QUEUE',[_0x572012,_0x41ad15[_0xaffa('0xe7')],_0x41ad15[_0xaffa('0x64')],_0x35e70b,_0x41ad15['timeout'],_0x41ad15['agi'],_0x41ad15[_0xaffa('0x17e')],_0x41ad15[_0xaffa('0x17f')],'',_0x41ad15['position']]);if(_0x209053[_0xaffa('0xa7')]===-0x1){return _0x209053;}return this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xc3'),_0xaffa('0x180'),_0x572012));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x181')]=function(_0x115803){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x182'),_0x115803[_0xaffa('0x35')]));var _0x308b2a=_0x115803[_0xaffa('0x183')]||_0xaffa('0x13f');var _0x4b1222=util[_0xaffa('0x26')](_0xaffa('0x184'),this['channel']['uniqueid'],rs[_0xaffa('0x11e')](0x5));var _0x77cb0e=util[_0xaffa('0x26')](_0xaffa('0x185'),FILES_PATH,_0x4b1222,_0x308b2a);var _0x52e809=util[_0xaffa('0x26')]('%s/recordings/%s',FILES_PATH,_0x4b1222);this[_0xaffa('0x38')]['sync'](this,_0x115803,_0x4b1222,_0x77cb0e);this[_0xaffa('0x33')][_0xaffa('0xa1')]('RECORDING_SAVENAME',_0x4b1222);logger[_0xaffa('0x2c')](_0xaffa('0x186'),_0x52e809,_0x308b2a,_0x115803['escape_digits'],_0x115803['timeout']);return this[_0xaffa('0x33')][_0xaffa('0x136')](_0x52e809,_0x308b2a,_0x115803[_0xaffa('0x187')],_0x115803[_0xaffa('0x66')],undefined,!![]);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x188')]=function(_0x4caef1){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x189'),_0x4caef1[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x4caef1[_0xaffa('0x64')])){return this['channel']['noop'](_0xaffa('0x18a'));}var _0xec36da=this[_0xaffa('0x18b')][_0xaffa('0x71')](this,_0x4caef1);logger[_0xaffa('0x2c')](util[_0xaffa('0x26')]('Response:',util[_0xaffa('0x18c')](_0xec36da,{'showHidden':![],'depth':null})));if(!this[_0xaffa('0xa9')](_0x4caef1[_0xaffa('0xdc')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0x18d'));}var _0x353212=this['getVariable'][_0xaffa('0x71')](this,_0x4caef1[_0xaffa('0xdc')]);if(!_0x353212){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x4caef1,_0xaffa('0xdd'));}this[_0xaffa('0x33')]['setVariable'](util[_0xaffa('0x26')](_0xaffa('0x18e'),_0x353212),_0xec36da[_0xaffa('0x78')]?_0xec36da['statusCode']:_0xaffa('0x18f'));this[_0xaffa('0x33')][_0xaffa('0xa1')](util['format'](_0xaffa('0x190'),_0x353212),_0xec36da[_0xaffa('0x77')]?_0xec36da[_0xaffa('0x77')]:'OK');if(_0xec36da[_0xaffa('0x6c')]){try{this[_0xaffa('0x9f')](_0xec36da['body'],_0x353212);}catch(_0x3739aa){logger[_0xaffa('0x29')](util[_0xaffa('0x26')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x353212));}}return this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0xe0'),_0x353212));};AGIVertices['prototype'][_0xaffa('0x191')]=function(_0x3b9a99){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x192'),_0x3b9a99['label']));return this['channel'][_0xaffa('0x193')](_0x3b9a99[_0xaffa('0x194')][_0xaffa('0x59')](/\s+/g,''),_0x3b9a99[_0xaffa('0x187')]);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x195')]=function(_0x540146){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x196'),_0x540146['label']));return this[_0xaffa('0x33')][_0xaffa('0x197')](_0x540146[_0xaffa('0x67')][_0xaffa('0x59')](/\s+/g,''),_0x540146[_0xaffa('0x187')]);};AGIVertices['prototype'][_0xaffa('0x198')]=function(_0x991f70){logger['info'](util[_0xaffa('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x991f70[_0xaffa('0x35')]));return this[_0xaffa('0x33')][_0xaffa('0x199')](_0x991f70[_0xaffa('0x5b')],_0x991f70[_0xaffa('0x187')]);};AGIVertices[_0xaffa('0x12')][_0xaffa('0x19a')]=function(_0x356d97){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x19b'),_0x356d97[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x356d97[_0xaffa('0x19c')])){return this['channel'][_0xaffa('0xae')]('no\x20mail\x20account\x20configured');}var _0x1bbca8=this[_0xaffa('0x19d')][_0xaffa('0x71')](this,_0x356d97[_0xaffa('0x19c')]);if(!_0x1bbca8||!_0x1bbca8[_0xaffa('0x19e')]){return this[_0xaffa('0x33')]['error'](_0x356d97,'no\x20mail\x20account\x20found');}var _0x481331={'from':util[_0xaffa('0x26')](_0xaffa('0x19f'),_0x1bbca8['name'],_0x1bbca8[_0xaffa('0x1a0')]||_0x1bbca8['Smtp'][_0xaffa('0x1a1')]),'to':_0x356d97['to']||'','cc':_0x356d97['cc']||'','bcc':_0x356d97['bcc']||'','subject':_0x356d97[_0xaffa('0x1a2')],'html':_0x356d97['text'],'text':_0x356d97[_0xaffa('0x5b')]};if(this[_0xaffa('0xa9')](_0x356d97[_0xaffa('0x1a3')])){}logger[_0xaffa('0x1a4')](_0xaffa('0x1a5'),JSON[_0xaffa('0x75')](_0x481331));this[_0xaffa('0x32')]['sync'](this,_0x356d97,_0x356d97[_0xaffa('0x19c')]);this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x1a6'),_0x1bbca8[_0xaffa('0x14')]));this[_0xaffa('0x22')][_0xaffa('0x71')](this,_0x1bbca8[_0xaffa('0x1a7')],_0x481331);return this[_0xaffa('0x33')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1a8')]=function(_0x992a3e){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x1a9'),_0x992a3e[_0xaffa('0x35')]));return this[_0xaffa('0x33')][_0xaffa('0xae')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1aa')]=function(_0x3d3c43){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x1ab'),_0x3d3c43[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x3d3c43[_0xaffa('0x1ac')])){return this['channel'][_0xaffa('0xae')](_0xaffa('0x1ad'));}var _0x181665=this[_0xaffa('0x30')][_0xaffa('0x71')](this,_0x3d3c43[_0xaffa('0x1ac')]);if(!_0x181665){return this[_0xaffa('0x33')]['error'](_0x3d3c43,_0xaffa('0x1ae'));}var _0x11ccff={'body':_0x3d3c43[_0xaffa('0x1af')],'phone':_0x3d3c43['to']||'','SmsAccountId':_0x181665['id']};logger[_0xaffa('0x1a4')]('sendSMS\x20message',JSON['stringify'](_0x11ccff));this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x3d3c43,_0x3d3c43[_0xaffa('0x1ac')]);this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x1b0'),_0x181665['name']));this['createSmsMessage'][_0xaffa('0x71')](this,_0x11ccff);return this[_0xaffa('0x33')]['noop'](_0xaffa('0x1b1'));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1b2')]=function(_0x401013){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x1b3'),_0x401013[_0xaffa('0x35')]));if(!this['isConfigured'](_0x401013[_0xaffa('0xdc')])){return this[_0xaffa('0x33')]['error'](_0x401013,_0xaffa('0x1b4'));}var _0x29407b=this['getVariable'][_0xaffa('0x71')](this,_0x401013[_0xaffa('0xdc')]);if(!_0x29407b){return this[_0xaffa('0x33')]['error'](_0x401013,'no\x20variable\x20found');}return this['channel'][_0xaffa('0xa1')](_0x29407b,_0x401013[_0xaffa('0x1b5')]);};AGIVertices['prototype'][_0xaffa('0x1b6')]=function(_0x4454bb){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x1b7'),_0x4454bb[_0xaffa('0x35')]));this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x1b8'));if(_0x4454bb['answer']===_0xaffa('0x1b9')){this['channel'][_0xaffa('0xae')](_0xaffa('0x1ba'));return this[_0xaffa('0x33')][_0xaffa('0xba')]();}return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0x1bb'));};AGIVertices[_0xaffa('0x12')]['subproject']=function(_0x55f2fc){logger['info'](util[_0xaffa('0x26')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x55f2fc[_0xaffa('0x35')]));if(!this[_0xaffa('0xa9')](_0x55f2fc['project_id'])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x55f2fc,'no\x20subproject\x20selected');}var _0x4aafc1=this[_0xaffa('0x18')][_0xaffa('0x71')](this,_0x55f2fc['project_id']);if(!this[_0xaffa('0xa9')](_0x4aafc1)){return this[_0xaffa('0x33')]['error'](_0x55f2fc,util[_0xaffa('0x26')](_0xaffa('0x1bc'),_0x55f2fc[_0xaffa('0x1bd')]));}if(_0x4aafc1===this[_0xaffa('0x33')]['arg_1']){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x55f2fc,_0xaffa('0x1be'));}this['createSquareDetailsReport'][_0xaffa('0x71')](this,_0x55f2fc,_0x4aafc1);var _0x4cce35=this[_0xaffa('0x33')]['exec'](_0xaffa('0x1bf'),util[_0xaffa('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xaffa('0x7')][_0xaffa('0x1c0')]||_0xaffa('0x1c1'),_0x4aafc1,this[_0xaffa('0x33')][_0xaffa('0x37')]));if(_0x4cce35[_0xaffa('0xa7')]===-0x1){return _0x4cce35;}return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xc3'),_0xaffa('0x1bf'),_0x4aafc1));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1c2')]=function(_0x852060){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x1c3'),_0x852060[_0xaffa('0x35')]));var _0x40986f=this[_0xaffa('0x56')][_0xaffa('0x71')](this,_0x852060['command']);this[_0xaffa('0x32')][_0xaffa('0x71')](this,_0x852060,_0x852060[_0xaffa('0xb8')]);if(this[_0xaffa('0xa9')](_0x852060['variable_id'])){var _0x317a4e=this['getVariable']['sync'](this,_0x852060[_0xaffa('0xdc')]);if(_0x317a4e){this[_0xaffa('0x33')][_0xaffa('0xa1')](_0x317a4e,_0x40986f);return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x1c4'),_0x852060['command'],_0x317a4e));}}return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x1c5'),_0x852060[_0xaffa('0xb8')]));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1c6')]=function(_0x547fe3){logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x1c7'),_0x547fe3[_0xaffa('0x35')]));_0x547fe3['text']=_0x547fe3['text'][_0xaffa('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaffa('0xa9')](_0x547fe3['apiKey'])){return this['channel']['noop'](_0xaffa('0x1c8'));}if(!this['isConfigured'](_0x547fe3[_0xaffa('0x5b')])){return this[_0xaffa('0x33')][_0xaffa('0xae')](_0xaffa('0xac'));}this[_0xaffa('0x33')][_0xaffa('0xae')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x547fe3[_0xaffa('0x5b')]));var _0x34c181=this['googleCloudTTS']['sync'](this,_0x547fe3);if(_0x34c181){this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x34c181));var _0x579e7f=this[_0xaffa('0x33')]['streamFile'](_0x34c181);try{fs[_0xaffa('0x108')](_0x34c181+_0xaffa('0x109'));}catch(_0x32218b){logger['error'](_0x32218b);}return _0x579e7f;}return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x547fe3,_0xaffa('0x1c9'));};AGIVertices['prototype'][_0xaffa('0x1ca')]=function(_0x3a22ec){logger['info'](util['format'](_0xaffa('0x1cb'),_0x3a22ec['label']));_0x3a22ec['text']=_0x3a22ec[_0xaffa('0x5b')][_0xaffa('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaffa('0xa9')](_0x3a22ec[_0xaffa('0x5b')])){return this[_0xaffa('0x33')]['noop']('no\x20text\x20configured');}this[_0xaffa('0x33')]['noop'](util['format'](_0xaffa('0x1cc'),_0x3a22ec['text']));var _0x3cfd61=this[_0xaffa('0x62')]['sync'](this,_0x3a22ec);if(_0x3cfd61){this[_0xaffa('0x33')]['noop'](util[_0xaffa('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x3cfd61));var _0x5ca18f=this[_0xaffa('0x33')]['streamFile'](_0x3cfd61);try{fs[_0xaffa('0x108')](_0x3cfd61+'.wav');}catch(_0x22d641){logger[_0xaffa('0x29')](_0x22d641);}return _0x5ca18f;}return this['channel'][_0xaffa('0x29')](_0x3a22ec,_0xaffa('0x1cd'));};AGIVertices['prototype'][_0xaffa('0x1ce')]=function(_0x39326e){logger['info'](util[_0xaffa('0x26')](_0xaffa('0x1cf'),_0x39326e['label']));if(!this[_0xaffa('0xa9')](_0x39326e[_0xaffa('0x15d')])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x39326e,_0xaffa('0x15e'));}logger[_0xaffa('0x2c')](util['format'](_0xaffa('0x172'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x39326e[_0xaffa('0x15d')]));var _0x2d601c=this[_0xaffa('0x50')][_0xaffa('0x71')](this,_0x39326e[_0xaffa('0x15d')]);if(_0x2d601c){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x39326e[_0xaffa('0x15d')]));this[_0xaffa('0x33')][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0x15f'),this[_0xaffa('0x33')]['callerid'],_0x39326e[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x160')};}else{logger['info'](util['format'](_0xaffa('0x161'),this['channel'][_0xaffa('0x39')],_0x39326e[_0xaffa('0x15d')]));this[_0xaffa('0x33')][_0xaffa('0xae')](util['format'](_0xaffa('0x161'),this[_0xaffa('0x33')][_0xaffa('0x39')],_0x39326e[_0xaffa('0x15d')]));return{'code':0xc8,'result':_0xaffa('0x162')};}};AGIVertices['prototype'][_0xaffa('0x1d0')]=function(_0x4ae469){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x1d1'),_0x4ae469[_0xaffa('0x35')]));var _0x268d45=this[_0xaffa('0x33')]['exec']('VOICEMAIL',[_0x4ae469[_0xaffa('0x1d2')],_0x4ae469['options']]);if(_0x268d45['result']===-0x1){return _0x268d45;}return this['channel'][_0xaffa('0xae')](util[_0xaffa('0x26')](_0xaffa('0xc3'),_0xaffa('0x1d3'),_0x4ae469['mailbox']));};AGIVertices[_0xaffa('0x12')][_0xaffa('0x1d4')]=function(_0x58f95f){logger[_0xaffa('0x2c')](util[_0xaffa('0x26')](_0xaffa('0x1d5'),_0x58f95f[_0xaffa('0x35')]));if(!this['isConfigured'](_0x58f95f['variable_id'])){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x58f95f,_0xaffa('0x1b4'));}var _0x1a36ba=this[_0xaffa('0xa4')][_0xaffa('0x71')](this,_0x58f95f[_0xaffa('0xdc')]);if(!_0x1a36ba){return this[_0xaffa('0x33')][_0xaffa('0x29')](_0x58f95f,_0xaffa('0xdd'));}var _0x35108f=this[_0xaffa('0x33')][_0xaffa('0xa4')](_0x1a36ba);return{'code':0xc8,'result':_0x35108f['extra']?_0x35108f[_0xaffa('0xa5')]:'-'};};String[_0xaffa('0x12')][_0xaffa('0xa3')]=function(_0x1374c5,_0x5ab8c9){return this[_0xaffa('0xa2')](_0x1374c5)['join'](_0x5ab8c9);};module[_0xaffa('0x1d6')]=AGIVertices; \ No newline at end of file +var _0xbfcc=['Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','odbc','randomstring','moment','mustache','../../config/environment/shared','./scripts','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','url','method','number','timeout','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','sesteknda','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','DIAL','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts'];(function(_0x107e7c,_0x2a7772){var _0x3a121b=function(_0xc00a3f){while(--_0xc00a3f){_0x107e7c['push'](_0x107e7c['shift']());}};_0x3a121b(++_0x2a7772);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0xbfcc[_0x548d7d];return _0xb1c878;};'use strict';var fs=require('fs');var util=require(_0xcbfc('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xcbfc('0x1'))();var rs=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var Mustache=require(_0xcbfc('0x4'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require('../../config/environment');var shared=require(_0xcbfc('0x5'));var scripts=require(_0xcbfc('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xcbfc('0x7'),'rawBody'];var verticesWithRetry=[_0xcbfc('0x8'),_0xcbfc('0x9'),_0xcbfc('0xa')];var AGIVertices=function(_0xa1c83b,_0x4eff22,_0x2e7097){this[_0xcbfc('0xb')]=_0xa1c83b;this[_0xcbfc('0xc')]=_0x4eff22;this[_0xcbfc('0xd')]=_0x2e7097;};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xf')]=function(_0x4b34aa,_0x28c5a5){this[_0xcbfc('0xc')][_0xcbfc('0x10')](_0x4b34aa)[_0xcbfc('0x11')](function(_0x1f222d){_0x28c5a5(null,_0x1f222d?_0x1f222d['name']:![]);})[_0xcbfc('0x12')](function(_0x86f67c){_0x28c5a5(_0x86f67c);});};AGIVertices[_0xcbfc('0xe')]['getVoiceQueue']=function(_0x3c1092,_0x3ec338){this[_0xcbfc('0xc')][_0xcbfc('0x13')](_0x3c1092)[_0xcbfc('0x11')](function(_0x53a7ea){_0x3ec338(null,_0x53a7ea?_0x53a7ea[_0xcbfc('0x14')]:![]);})[_0xcbfc('0x12')](function(_0x1ec8c4){_0x3ec338(_0x1ec8c4);});};AGIVertices[_0xcbfc('0xe')]['getSquareProject']=function(_0x565301,_0x418f18){this[_0xcbfc('0xc')][_0xcbfc('0x15')](_0x565301)['then'](function(_0x5b078f){_0x418f18(null,_0x5b078f?_0x5b078f[_0xcbfc('0x14')]:![]);})[_0xcbfc('0x12')](function(_0x344510){_0x418f18(_0x344510);});};AGIVertices['prototype'][_0xcbfc('0x16')]=function(_0x552777,_0x28f7fb){this[_0xcbfc('0xc')][_0xcbfc('0x17')](_0x552777)[_0xcbfc('0x11')](function(_0x25c167){_0x28f7fb(null,_0x25c167?_0x25c167[_0xcbfc('0x18')]:![]);})['catch'](function(_0x9c79da){_0x28f7fb(_0x9c79da);});};AGIVertices[_0xcbfc('0xe')]['getUser']=function(_0x1da958,_0x5a449b){this['rpc']['getUserById'](_0x1da958)[_0xcbfc('0x11')](function(_0x4a0fcb){_0x5a449b(null,_0x4a0fcb?_0x4a0fcb['name']:![]);})[_0xcbfc('0x12')](function(_0x34cffa){_0x5a449b(_0x34cffa);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x19')]=function(_0x49f5bf,_0x1d828e){this['rpc'][_0xcbfc('0x1a')](_0x49f5bf)[_0xcbfc('0x11')](function(_0x53951a){_0x1d828e(null,_0x53951a?_0x53951a[_0xcbfc('0x14')]:![]);})[_0xcbfc('0x12')](function(_0x4ab48e){_0x1d828e(_0x4ab48e);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1b')]=function(_0x2f7549,_0x41f3b8){var _0x4e2576=this;this[_0xcbfc('0xc')][_0xcbfc('0x1c')](_0x2f7549)['then'](function(_0x1f6a14){_0x41f3b8(null,_0x1f6a14?_0x4e2576[_0xcbfc('0x1d')](_0x1f6a14[_0xcbfc('0x1e')]):![]);})[_0xcbfc('0x12')](function(_0x2b4286){_0x41f3b8(_0x2b4286);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1f')]=function(_0x5366cf,_0x41b68b){this[_0xcbfc('0xc')][_0xcbfc('0x20')](_0x5366cf)[_0xcbfc('0x11')](function(_0x500a0b){_0x41b68b(null,_0x500a0b?_0x500a0b:![]);})[_0xcbfc('0x12')](function(_0x2bfc9a){_0x41b68b(_0x2bfc9a);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x21')]=function(_0x335f68,_0x34baa6,_0x7f7dda){this['mailRpc'][_0xcbfc('0x21')](_0x335f68,_0x34baa6)[_0xcbfc('0x11')](function(){_0x7f7dda(null);})['catch'](function(_0x25accd){_0x7f7dda(_0x25accd);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x22')]=function(_0x4f9334,_0x4f4939){this['rpc'][_0xcbfc('0x23')](_0x4f9334)[_0xcbfc('0x11')](function(_0x1d47a4){if(_0x1d47a4){if(_0x1d47a4[_0xcbfc('0x24')]){_0x4f4939(null,[_0x1d47a4[_0xcbfc('0x25')]]);}else{_0x4f4939(null,_[_0xcbfc('0x26')](_0x1d47a4[_0xcbfc('0x27')],_0xcbfc('0x25')));}}else{_0x4f4939(null,![]);}})['catch'](function(_0x2f14ff){_0x4f4939(_0x2f14ff);});};AGIVertices[_0xcbfc('0xe')]['getSoundPath']=function(_0x3093b5){return util['format'](_0xcbfc('0x28'),FILES_PATH,_0x3093b5);};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x29')]=function(_0x53ac0e,_0x43f45b,_0x58926a){odbc['open'](_0x53ac0e,function(_0x2baf2f){if(_0x2baf2f){logger[_0xcbfc('0x2a')](_0xcbfc('0x2b'),_0x2baf2f);_0x58926a(_0x2baf2f);}else{logger[_0xcbfc('0x2c')](_0xcbfc('0x2d'));odbc[_0xcbfc('0x2e')](_0x43f45b,function(_0x2951f5,_0x1b014d){if(_0x2951f5){logger['info'](_0xcbfc('0x2f'),_0x43f45b);_0x58926a(_0x2951f5);}else{logger['info'](_0xcbfc('0x30'),_0x43f45b);odbc[_0xcbfc('0x31')](function(_0x312d28){if(_0x312d28){logger[_0xcbfc('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x312d28);}_0x58926a(null,_0x1b014d);});}});}});};AGIVertices['prototype'][_0xcbfc('0x32')]=function(_0x1c678b,_0x404f46){this[_0xcbfc('0xc')][_0xcbfc('0x33')](_0x1c678b)['then'](function(_0x1901b4){_0x404f46(null,_0x1901b4?_0x1901b4:![]);})[_0xcbfc('0x12')](function(_0xf2da32){_0x404f46(_0xf2da32);});};AGIVertices['prototype'][_0xcbfc('0x34')]=function(_0x58bad1,_0x3e942d){this['rpc'][_0xcbfc('0x34')](_0x58bad1)[_0xcbfc('0x11')](function(_0x2af173){_0x3e942d(null,_0x2af173);})[_0xcbfc('0x12')](function(_0x102f4f){_0x3e942d(_0x102f4f);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x35')]=function(_0x561544,_0x2de7fe,_0x16e48d){this['rpc'][_0xcbfc('0x35')]({'uniqueid':this[_0xcbfc('0xb')][_0xcbfc('0x36')],'node':_0x561544[_0xcbfc('0x37')],'application':_0x561544[_0xcbfc('0x38')],'data':_0x2de7fe||null,'project_name':this[_0xcbfc('0xb')][_0xcbfc('0x39')],'callerid':this[_0xcbfc('0xb')]['callerid']})[_0xcbfc('0x11')](function(_0x42c1af){if(_0x16e48d){_0x16e48d(null,_0x42c1af);}})[_0xcbfc('0x12')](function(_0x3a9973){if(_0x16e48d){_0x16e48d(_0x3a9973);}});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x3a')]=function(_0x1c4d87,_0x5d1eb2,_0x35f8d2,_0x123f76){this['rpc'][_0xcbfc('0x3a')]({'uniqueid':this[_0xcbfc('0xb')][_0xcbfc('0x36')],'callerid':this['channel'][_0xcbfc('0x3b')],'calleridname':this[_0xcbfc('0xb')][_0xcbfc('0x3c')],'context':this[_0xcbfc('0xb')][_0xcbfc('0x3d')],'extension':this[_0xcbfc('0xb')][_0xcbfc('0x3e')],'priority':this['channel']['priority'],'accountcode':this[_0xcbfc('0xb')][_0xcbfc('0x3f')],'dnid':this[_0xcbfc('0xb')][_0xcbfc('0x40')],'projectName':this['channel']['arg_1'],'saveName':_0x5d1eb2,'filename':_0x1c4d87[_0xcbfc('0x41')]||_0x5d1eb2,'savePath':_0x35f8d2})[_0xcbfc('0x11')](function(_0x12340f){_0x123f76(null,_0x12340f);})['catch'](function(_0x155236){_0x123f76(_0x155236);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x42')]=function(_0x4b3096,_0x287c24,_0x42ead6,_0x114a8a,_0x2b2312){this[_0xcbfc('0xc')][_0xcbfc('0x42')]({'uniqueid':this[_0xcbfc('0xb')][_0xcbfc('0x36')],'body':_0x4b3096,'direction':_0x287c24,'providerName':_0x42ead6,'providerResponse':_0x114a8a})[_0xcbfc('0x11')](function(_0xdee298){if(_0x2b2312){_0x2b2312(null,_0xdee298);}})['catch'](function(_0x3fb619){if(_0x2b2312){_0x2b2312(_0x3fb619);}});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x43')]=function(_0x5c2ad9,_0x28ae7f){this[_0xcbfc('0xc')]['createCmContact']({'firstName':_[_0xcbfc('0x44')](_0x5c2ad9[_0xcbfc('0x14')])||_[_0xcbfc('0x45')](_0x5c2ad9[_0xcbfc('0x14')])?'callback_'+Math[_0xcbfc('0x46')]():_0x5c2ad9[_0xcbfc('0x14')],'lastName':_['isEmpty'](_0x5c2ad9[_0xcbfc('0x47')])||_[_0xcbfc('0x45')](_0x5c2ad9[_0xcbfc('0x47')])?null:_0x5c2ad9[_0xcbfc('0x47')],'phone':_0x5c2ad9[_0xcbfc('0x48')],'ListId':_0x5c2ad9[_0xcbfc('0x49')],'scheduledat':_0x5c2ad9[_0xcbfc('0x4a')],'callbackUniqueid':this[_0xcbfc('0xb')][_0xcbfc('0x36')],'tags':_0xcbfc('0x4b'),'description':'Callback\x20scheduled\x20at\x20'+_0x5c2ad9[_0xcbfc('0x4a')]['toString'](),'priority':_0x5c2ad9['callback_priority']})['then'](function(_0x4239da){_0x28ae7f(null,_0x4239da);})[_0xcbfc('0x12')](function(_0x179258){_0x28ae7f(_0x179258);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x4c')]=function(_0x7e7e3d,_0x21d4fa){this[_0xcbfc('0xc')]['getPauseById'](_0x7e7e3d)[_0xcbfc('0x11')](function(_0xf5f5e1){_0x21d4fa(null,_0xf5f5e1?_0xf5f5e1[_0xcbfc('0x14')]:![]);})['catch'](function(_0x188e48){_0x21d4fa(_0x188e48);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x4d')]=function(_0x3b526f,_0x1ed350,_0x310b78){var _0x34ec1d={'role':'agent'};_0x34ec1d[_0x3b526f]=this[_0xcbfc('0xb')]['callerid'];this[_0xcbfc('0xc')][_0xcbfc('0x4d')](_0x34ec1d,_0x1ed350,this['channel'][_0xcbfc('0x36')])['then'](function(_0x45656a){_0x310b78(null,_[_0xcbfc('0x45')](_0x45656a)?![]:!![]);})[_0xcbfc('0x12')](function(_0x161bab){logger[_0xcbfc('0x2a')](_0x161bab);_0x310b78(null,![]);});};AGIVertices[_0xcbfc('0xe')]['agentUnpause']=function(_0x2021d6,_0xb731b7){var _0x5a78c9={'role':_0xcbfc('0x4e')};_0x5a78c9[_0x2021d6]=this[_0xcbfc('0xb')][_0xcbfc('0x3b')];this[_0xcbfc('0xc')][_0xcbfc('0x4f')](_0x5a78c9)[_0xcbfc('0x11')](function(_0x2bf39a){_0xb731b7(null,_[_0xcbfc('0x45')](_0x2bf39a)?![]:!![]);})['catch'](function(_0x307b50){logger[_0xcbfc('0x2a')](_0x307b50);_0xb731b7(null,![]);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x50')]=function(_0x3240e2,_0x2fb0c2){var _0x209d61={'role':_0xcbfc('0x4e')};_0x209d61[_0x3240e2]=this[_0xcbfc('0xb')][_0xcbfc('0x3b')];this['rpc'][_0xcbfc('0x50')](_0x209d61)[_0xcbfc('0x11')](function(_0x48a201){_0x2fb0c2(null,_[_0xcbfc('0x45')](_0x48a201)?![]:!![]);})['catch'](function(_0x4d9548){logger[_0xcbfc('0x2a')](_0x4d9548);_0x2fb0c2(null,![]);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x51')]=function(_0x133829,_0x33d4d8){var _0x4d8d2a={'role':'agent'};_0x4d8d2a[_0x133829]=this[_0xcbfc('0xb')][_0xcbfc('0x3b')];var _0x2a3fcb=_0x133829!=_0xcbfc('0x52')?util[_0xcbfc('0x53')]('%s/%s@from-sip/n',_0xcbfc('0x54'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')]):undefined;this['rpc']['agentLogin'](_0x4d8d2a,_0x2a3fcb)['then'](function(_0x19a405){_0x33d4d8(null,_['isNil'](_0x19a405)?![]:!![]);})['catch'](function(_0x41ddf5){logger['error'](_0x41ddf5);_0x33d4d8(null,![]);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x55')]=function(_0xed28ff,_0x461e5b){sh[_0xcbfc('0x56')](_[_0xcbfc('0x57')](_0xed28ff),function(_0x25d2a7,_0xd3c182){var _0x1140d1=_0xd3c182['replace'](/(\r\n|\n|\r)/gm,'');_0x461e5b(null,_0x1140d1);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x58')]=function(_0x3013e5,_0x5aba21){scripts[_0xcbfc('0x58')](_0x3013e5[_0xcbfc('0x59')],_0x3013e5[_0xcbfc('0x5a')]||_0xcbfc('0x5b'),_0x3013e5[_0xcbfc('0x5b')],_0x3013e5[_0xcbfc('0x5c')]||_0xcbfc('0x5d'),_0x3013e5['ssmlGender']||_0xcbfc('0x5e'),_0x3013e5['audioEncoding']||_0xcbfc('0x5f'))[_0xcbfc('0x11')](function(_0x12e57e){_0x5aba21(null,_0x12e57e);})['catch'](function(_0x267b37){_0x5aba21(_0x267b37);});};AGIVertices['prototype'][_0xcbfc('0x60')]=function(_0x3646a7,_0x174846){scripts[_0xcbfc('0x60')](_0x3646a7[_0xcbfc('0x5b')],_0x3646a7[_0xcbfc('0x61')]||'en',0x1)[_0xcbfc('0x11')](function(_0x5aef23){_0x174846(null,_0x5aef23);})[_0xcbfc('0x12')](function(_0x229bb7){_0x174846(_0x229bb7);});};AGIVertices[_0xcbfc('0xe')]['restAPI']=function(_0x2fc56d,_0x49e206){var _0x189a3a={'uri':_0x2fc56d[_0xcbfc('0x62')],'method':_0x2fc56d[_0xcbfc('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2fc56d['timeout'])===_0xcbfc('0x64')&&parseInt(_0x2fc56d[_0xcbfc('0x65')])>=0x1?parseInt(_0x2fc56d['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xcbfc('0x66')](['POST',_0xcbfc('0x67')],_0x189a3a['method'][_0xcbfc('0x68')]())){try{_0x189a3a[_0xcbfc('0x69')]=_0x2fc56d['rawBody']?JSON[_0xcbfc('0x6a')](_0x2fc56d['rawBody']):{};}catch(_0x2cdfc1){logger[_0xcbfc('0x2a')](_0xcbfc('0x6b'),_0x2cdfc1);}}try{_0x189a3a[_0xcbfc('0x6c')]=_0x2fc56d['rawHeaders']?JSON[_0xcbfc('0x6a')](_0x2fc56d['rawHeaders']):{};}catch(_0x18cbad){logger[_0xcbfc('0x2a')](_0xcbfc('0x6d'),_0x18cbad);}if(_0x2fc56d[_0xcbfc('0x6e')]){try{var _0xa99990=require(_0x2fc56d[_0xcbfc('0x6e')])[_0xcbfc('0x6f')](this,_0x189a3a);_0x189a3a[_0xcbfc('0x70')]=Mustache[_0xcbfc('0x71')](_0x2fc56d[_0xcbfc('0x62')],_0xa99990,{},['$$','$$']);if(_0x189a3a[_0xcbfc('0x6c')]){_0x189a3a[_0xcbfc('0x6c')]=JSON[_0xcbfc('0x6a')](Mustache[_0xcbfc('0x71')](JSON[_0xcbfc('0x72')](_0x189a3a[_0xcbfc('0x6c')]),_0xa99990,{},['$$','$$']));}if(_0x189a3a[_0xcbfc('0x69')]){_0x189a3a['body']=JSON[_0xcbfc('0x6a')](Mustache['render'](JSON[_0xcbfc('0x72')](_0x189a3a['body']),_0xa99990,{},['$$','$$']));}}catch(_0x37f09a){logger[_0xcbfc('0x2a')](_0xcbfc('0x73'),_0x37f09a);}}rp(_0x189a3a)[_0xcbfc('0x11')](function(_0x386156){var _0x36eab3={'statusCode':_0x386156[_0xcbfc('0x74')]||0xc8,'statusMessage':_0x386156['statusMessage']||'OK','headers':_0x386156[_0xcbfc('0x6c')]||{},'body':_0x386156['body']||{}};_0x49e206(null,_0x36eab3);})[_0xcbfc('0x12')](function(_0x1d8745){var _0x567807={'statusCode':_0x1d8745['statusCode']||0x1f4,'statusMessage':_0x1d8745['message']||_0xcbfc('0x75'),'headers':_0x1d8745[_0xcbfc('0x76')][_0xcbfc('0x6c')]||{},'body':_0x1d8745['options']['body']||{}};_0x49e206(null,_0x567807);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x77')]=function(_0x43a3f9,_0x131030){scripts[_0xcbfc('0x77')](this['channel']['uniqueid'],_0x43a3f9['key'],_0x43a3f9[_0xcbfc('0x5b')],_0x43a3f9[_0xcbfc('0x78')]||'en')[_0xcbfc('0x11')](function(_0x302358){_0x131030(null,_0x302358);})['catch'](function(_0x5da08b){_0x131030(_0x5da08b);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x79')]=function(_0xcd6615,_0x3053d9){scripts[_0xcbfc('0x79')](this['channel']['uniqueid'],_0xcd6615[_0xcbfc('0x7a')],_0xcd6615[_0xcbfc('0x7b')],_0xcd6615[_0xcbfc('0x7c')],_0xcd6615[_0xcbfc('0x5b')],_0xcd6615[_0xcbfc('0x7d')]||'en')[_0xcbfc('0x11')](function(_0x182471){_0x3053d9(null,_0x182471);})[_0xcbfc('0x12')](function(_0x468465){_0x3053d9(_0x468465);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x7e')]=function(_0x46f4da,_0x15c3b8){scripts[_0xcbfc('0x7e')](this['channel'],_0x46f4da)['then'](function(_0x349e70){_0x15c3b8(null,_0x349e70);})[_0xcbfc('0x12')](function(_0x341637){_0x15c3b8(_0x341637);});};AGIVertices['prototype'][_0xcbfc('0x7f')]=function(_0x2ec7ae,_0x269dfd){scripts[_0xcbfc('0x7f')](_0x2ec7ae['key'],_0x2ec7ae['text'],_0x2ec7ae[_0xcbfc('0x80')]||_0xcbfc('0x5d'),_0x2ec7ae[_0xcbfc('0x81')])[_0xcbfc('0x11')](function(_0x164694){_0x269dfd(null,_0x164694);})[_0xcbfc('0x12')](function(_0x2ca157){_0x269dfd(_0x2ca157);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x82')]=function(_0x1da467,_0x642b1e,_0x87a767){scripts[_0xcbfc('0x82')](_0x642b1e,_0x1da467[_0xcbfc('0x83')],_0x1da467[_0xcbfc('0x84')]||_0xcbfc('0x5d'),this[_0xcbfc('0x85')](_0x1da467[_0xcbfc('0x86')])?_0x1da467[_0xcbfc('0x86')]:undefined)['then'](function(_0x1594c4){_0x87a767(null,_0x1594c4);})['catch'](function(_0x30d6eb){_0x87a767(_0x30d6eb);});};AGIVertices['prototype'][_0xcbfc('0x87')]=function(_0x57b996,_0x4a36cc){scripts['awsPolly'](_0x57b996[_0xcbfc('0x88')],_0x57b996[_0xcbfc('0x89')],_0x57b996[_0xcbfc('0x8a')],_0x57b996[_0xcbfc('0x8b')]||_0xcbfc('0x8c'),_0x57b996['text'],_0x57b996[_0xcbfc('0x8d')]||_0xcbfc('0x5b'))[_0xcbfc('0x11')](function(_0x39c5a5){_0x4a36cc(null,_0x39c5a5);})[_0xcbfc('0x12')](function(_0x339c98){_0x4a36cc(_0x339c98);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x8e')]=function(_0x48078d,_0x12631d){scripts[_0xcbfc('0x8e')](this[_0xcbfc('0xb')]['uniqueid'],_0x48078d[_0xcbfc('0x88')],_0x48078d[_0xcbfc('0x89')],_0x48078d[_0xcbfc('0x8f')],_0x48078d[_0xcbfc('0x5b')],_0x48078d['aws_bot_name'])[_0xcbfc('0x11')](function(_0x286866){_0x12631d(null,_0x286866);})[_0xcbfc('0x12')](function(_0x355b7c){_0x12631d(_0x355b7c);});};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x90')]=function(_0x3b75ae,_0x418f8d,_0x60aaab){scripts[_0xcbfc('0x90')](_0x418f8d,_0x3b75ae['key'],_0x3b75ae['google_asr_language']||_0xcbfc('0x5d'))[_0xcbfc('0x11')](function(_0x3160c3){_0x60aaab(null,_0x3160c3);})['catch'](function(_0x216784){_0x60aaab(_0x216784);});};AGIVertices['prototype']['tildeASR']=function(_0x47e307,_0x58f952,_0x32e175){scripts[_0xcbfc('0x91')](_0x58f952,_0x47e307[_0xcbfc('0x92')],_0x47e307[_0xcbfc('0x93')],_0x47e307[_0xcbfc('0x70')])['then'](function(_0x3158eb){_0x32e175(null,_0x3158eb);})[_0xcbfc('0x12')](function(_0x2bfc41){_0x32e175(_0x2bfc41);});};AGIVertices['prototype'][_0xcbfc('0x94')]=function(_0x4bed53){var _0x4b2f90=_[_0xcbfc('0x66')](verticesWithRetry,_0x4bed53[_0xcbfc('0x38')])?_0x4bed53:_[_0xcbfc('0x95')](_0x4bed53);for(var _0x58b92a in _0x4b2f90){if(_0x4b2f90[_0xcbfc('0x96')](_0x58b92a)){if(_0x4b2f90[_0x58b92a]&&_[_0xcbfc('0x97')](_0x4b2f90[_0x58b92a])){if(_[_0xcbfc('0x66')](recursiveMapAttributes,_0x58b92a)){_0x4b2f90[_0x58b92a]=this['replaceObjectAllVariables'](_0x4b2f90[_0x58b92a]);}else{_0x4b2f90[_0x58b92a]=this[_0xcbfc('0x98')](_0x4b2f90[_0x58b92a]);}}}}return _0x4b2f90;};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x99')]=function(_0x7d27f){for(var _0xc46a1c in _0x7d27f){if(_0x7d27f['hasOwnProperty'](_0xc46a1c)){if(_[_0xcbfc('0x9a')](_0x7d27f[_0xc46a1c])){this[_0xcbfc('0x99')](_0x7d27f[_0xc46a1c]);}else if(_[_0xcbfc('0x9b')](_0x7d27f[_0xc46a1c])){for(var _0x5d13d0=0x0;_0x5d13d0<_0x7d27f[_0xc46a1c][_0xcbfc('0x9c')];_0x5d13d0++){this[_0xcbfc('0x99')](_0x7d27f[_0xc46a1c][_0x5d13d0]);}}else if(_[_0xcbfc('0x97')](_0x7d27f[_0xc46a1c])){_0x7d27f[_0xc46a1c]=this[_0xcbfc('0x98')](_0x7d27f[_0xc46a1c]);}}}};AGIVertices['prototype'][_0xcbfc('0x9d')]=function(_0x304036,_0x3fc325){for(var _0x397722 in _0x304036){if(_0x304036[_0xcbfc('0x96')](_0x397722)){if(_[_0xcbfc('0x9a')](_0x304036[_0x397722])){if(!_['isEmpty'](_0x304036[_0x397722])){this['saveRestApiResult'](_0x304036[_0x397722],util['format']('%s.%s',_0x3fc325,_0x397722));}}else if(_[_0xcbfc('0x9b')](_0x304036[_0x397722])){for(var _0xb1f8d=0x0;_0xb1f8d<_0x304036[_0x397722][_0xcbfc('0x9c')];_0xb1f8d++){this[_0xcbfc('0x9d')](_0x304036[_0x397722][_0xb1f8d],util[_0xcbfc('0x53')](_0xcbfc('0x9e'),_0x3fc325,_0x397722+'['+_0xb1f8d+']'));}}else{if(!_[_0xcbfc('0x45')](_0x304036[_0x397722])){this['channel'][_0xcbfc('0x9f')](util['format'](_0xcbfc('0x9e'),_0x3fc325,_0x397722),_0x304036[_0x397722]);}}}}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xa0')]=function(_0x2cf01d){try{var _0x5066c3=JSON[_0xcbfc('0x6a')](_0x2cf01d);this[_0xcbfc('0x99')](_0x5066c3);return JSON[_0xcbfc('0x72')](_0x5066c3);}catch(_0x10b32c){return this[_0xcbfc('0x98')](_0x2cf01d);}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x98')]=function(_0x27d38d){var _0x374c78=_0x27d38d[_0xcbfc('0xa1')]('{');for(var _0x31a2e9=0x1;_0x31a2e9<_0x374c78[_0xcbfc('0x9c')];_0x31a2e9+=0x1){var _0x5a0ff4=_0x374c78[_0x31a2e9][_0xcbfc('0xa1')]('}');if(_0x5a0ff4[_0xcbfc('0x9c')]>0x1){_0x27d38d=_0x27d38d[_0xcbfc('0xa2')]('{'+_0x5a0ff4[0x0]+'}',this[_0xcbfc('0xb')][_0xcbfc('0xf')](_0x5a0ff4[0x0])[_0xcbfc('0xa3')]||_0x5a0ff4[0x0]);}}if(_0x374c78[_0xcbfc('0x9c')]===0x1){return _0x27d38d[_0xcbfc('0xa4')]();}return this[_0xcbfc('0x98')](_0x27d38d);};AGIVertices['prototype'][_0xcbfc('0xa5')]=function(_0x4e743c,_0x492857){var _0x2b73f1=this[_0xcbfc('0xb')][_0xcbfc('0xf')](_0x4e743c);if(_0x2b73f1[_0xcbfc('0xa6')]===-0x1){return _0x2b73f1;}logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xa7'),_0x492857,_0x2b73f1[_0xcbfc('0xa3')]));return this[_0xcbfc('0xb')][_0xcbfc('0x9f')](_0x492857,_0x2b73f1[_0xcbfc('0xa3')]);};AGIVertices['prototype'][_0xcbfc('0x85')]=function(_0x5dcf2a){return _0x5dcf2a&&_0x5dcf2a!=='0'&&_0x5dcf2a!=='-1'&&_0x5dcf2a!=='';};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xa8')]=function(_0xce1048){this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0xce1048,'-');_0xce1048[_0xcbfc('0xa9')]=_0xce1048[_0xcbfc('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xaa')]=function(_0x389a8a){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xab'),_0x389a8a[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x389a8a[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}var _0x3fbaed='\x22'+_0x389a8a[_0xcbfc('0x5b')]+'\x22';if(this[_0xcbfc('0x85')](_0x389a8a[_0xcbfc('0x76')])){_0x3fbaed+=','+_0x389a8a['options'];}var _0x4b0fed=this['channel'][_0xcbfc('0x56')](_0xcbfc('0xae'),_0x3fbaed);if(_0x4b0fed[_0xcbfc('0xa6')]===-0x1){return _0x4b0fed;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xaf'),_0x3fbaed));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xb0')]=function(_0x15a55c){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0xb1'),_0x15a55c[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x15a55c[_0xcbfc('0xb2')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xb3'));}var _0x3724ab=_0x15a55c[_0xcbfc('0xb2')];if(this[_0xcbfc('0x85')](_0x15a55c[_0xcbfc('0x76')])){_0x3724ab+=','+_0x15a55c[_0xcbfc('0x76')];}var _0x33b54d=this[_0xcbfc('0xb')]['exec'](_0xcbfc('0xb4'),_0x3724ab);if(_0x33b54d['result']===-0x1){return _0x33b54d;}var _0x51846f=this[_0xcbfc('0xa5')](_0xcbfc('0xb5'),_0xcbfc('0xb6'));if(_0x51846f['result']===-0x1){return _0x51846f;}var _0x2de555=this[_0xcbfc('0xa5')](_0xcbfc('0xb7'),_0xcbfc('0xb8'));if(_0x2de555[_0xcbfc('0xa6')]===-0x1){return _0x2de555;}var _0x563e4f=this['getAndSetVariable'](_0xcbfc('0xb9'),_0xcbfc('0xba'));if(_0x563e4f[_0xcbfc('0xa6')]===-0x1){return _0x563e4f;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xbb'),_0x3724ab));};AGIVertices['prototype'][_0xcbfc('0xbc')]=function(_0x22330c){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x22330c[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')][_0xcbfc('0xbc')]([_0x22330c[_0xcbfc('0xbd')],_0x22330c['args']]);};AGIVertices['prototype'][_0xcbfc('0xbe')]=function(_0xe58710){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0xbf'),_0xe58710['label']));if(this[_0xcbfc('0x85')](_0xe58710[_0xcbfc('0x65')])){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xc0'),_0xe58710['timeout']));var _0x363b38=this[_0xcbfc('0xb')][_0xcbfc('0xc1')](_0xe58710[_0xcbfc('0x65')]);if(_0x363b38['result']===-0x1){return _0x363b38;}}return this[_0xcbfc('0xb')][_0xcbfc('0xbe')]();};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x4b')]=function(_0x23dbfb){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0xc2'),_0x23dbfb['label']));if(!this[_0xcbfc('0x85')](_0x23dbfb[_0xcbfc('0x49')])){return this[_0xcbfc('0xb')]['error'](_0x23dbfb,_0xcbfc('0xc3'));}_0x23dbfb[_0xcbfc('0x4a')]=moment();if(this[_0xcbfc('0x85')](_0x23dbfb[_0xcbfc('0xc4')])){_0x23dbfb[_0xcbfc('0x4a')]=moment()[_0xcbfc('0xc5')](_0x23dbfb[_0xcbfc('0xc4')],'minutes');}if(!this[_0xcbfc('0x85')](_0x23dbfb[_0xcbfc('0xc6')])){_0x23dbfb[_0xcbfc('0xc6')]=0x2;}this[_0xcbfc('0x43')][_0xcbfc('0x6f')](this,_0x23dbfb);return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0xc7'),_0x23dbfb['phone'],_0x23dbfb[_0xcbfc('0x49')],_0x23dbfb[_0xcbfc('0x4a')]));};AGIVertices[_0xcbfc('0xe')]['custom_app']=function(_0x41ab54){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0xc8'),_0x41ab54[_0xcbfc('0x37')]));var _0x35cd37=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0x41ab54[_0xcbfc('0xc9')],_0x41ab54['options']);if(_0x35cd37[_0xcbfc('0xa6')]===-0x1){return _0x35cd37;}return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xca'),_0x41ab54[_0xcbfc('0xc9')],_0x41ab54[_0xcbfc('0x76')]));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xcb')]=function(_0x1e917f){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xcc'),_0x1e917f[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x1e917f[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}var _0x1744f1='\x22'+_0x1e917f[_0xcbfc('0x5b')]+'\x22';if(this[_0xcbfc('0x85')](_0x1e917f[_0xcbfc('0x76')])){_0x1744f1+=','+_0x1e917f['options'];}var _0x19b125=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0xcbfc('0xae'),_0x1744f1);if(_0x19b125['result']===-0x1){return _0x19b125;}return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1744f1));};AGIVertices['prototype'][_0xcbfc('0xcd')]=function(_0x15309e){logger['info'](util['format'](_0xcbfc('0xce'),_0x15309e[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x15309e[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}var _0x3b2d18='\x22'+_0x15309e[_0xcbfc('0x5b')]+'\x22';if(this[_0xcbfc('0x85')](_0x15309e[_0xcbfc('0x76')])){_0x3b2d18+=','+_0x15309e['options'];}var _0x3928ea=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0xcbfc('0xae'),_0x3b2d18);if(_0x3928ea[_0xcbfc('0xa6')]===-0x1){return _0x3928ea;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xaf'),_0x3b2d18));};AGIVertices[_0xcbfc('0xe')]['lumenvoxasr']=function(_0x173fb0){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xcf'),_0x173fb0[_0xcbfc('0x37')]));if(!this['isConfigured'](_0x173fb0[_0xcbfc('0xb2')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20grammar\x20configured');}var _0x355bf2=_0x173fb0['grammar'];if(this[_0xcbfc('0x85')](_0x173fb0[_0xcbfc('0x76')])){_0x355bf2+=','+_0x173fb0['options'];}var _0x2e0620=this[_0xcbfc('0xb')][_0xcbfc('0x56')]('MRCPRecog',_0x355bf2);if(_0x2e0620[_0xcbfc('0xa6')]===-0x1){return _0x2e0620;}var _0x12fe1a=this[_0xcbfc('0xa5')](_0xcbfc('0xb5'),_0xcbfc('0xd0'));if(_0x12fe1a[_0xcbfc('0xa6')]===-0x1){return _0x12fe1a;}var _0x4f9be9=this[_0xcbfc('0xa5')](_0xcbfc('0xb7'),_0xcbfc('0xd1'));if(_0x4f9be9[_0xcbfc('0xa6')]===-0x1){return _0x4f9be9;}var _0x231556=this[_0xcbfc('0xa5')]('RECOG_INSTANCE()',_0xcbfc('0xd2'));if(_0x231556[_0xcbfc('0xa6')]===-0x1){return _0x231556;}return this['channel']['noop'](util[_0xcbfc('0x53')](_0xcbfc('0xbb'),_0x355bf2));};AGIVertices['prototype'][_0xcbfc('0xd3')]=function(_0xcb349c){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xcb349c[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0xcb349c[_0xcbfc('0xb2')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xb3'));}var _0x50c3aa=_0xcb349c[_0xcbfc('0xb2')];if(this[_0xcbfc('0x85')](_0xcb349c[_0xcbfc('0x76')])){_0x50c3aa+=','+_0xcb349c[_0xcbfc('0x76')];}var _0x31ad79=this['channel']['exec'](_0xcbfc('0xb4'),_0x50c3aa);if(_0x31ad79[_0xcbfc('0xa6')]===-0x1){return _0x31ad79;}var _0x253ae6=this[_0xcbfc('0xa5')](_0xcbfc('0xb5'),_0xcbfc('0xd4'));if(_0x253ae6[_0xcbfc('0xa6')]===-0x1){return _0x253ae6;}var _0x32b8ca=this[_0xcbfc('0xa5')](_0xcbfc('0xb7'),_0xcbfc('0xd5'));if(_0x32b8ca[_0xcbfc('0xa6')]===-0x1){return _0x32b8ca;}var _0x393455=this[_0xcbfc('0xa5')](_0xcbfc('0xb9'),_0xcbfc('0xd6'));if(_0x393455['result']===-0x1){return _0x393455;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xbb'),_0x50c3aa));};AGIVertices[_0xcbfc('0xe')]['database']=function(_0x4ef47f){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xd7'),_0x4ef47f[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x4ef47f['odbc_id'])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x4ef47f,_0xcbfc('0xd8'));}var _0x565f80=this[_0xcbfc('0x16')][_0xcbfc('0x6f')](this,_0x4ef47f[_0xcbfc('0xd9')]);if(!_0x565f80){return this['channel'][_0xcbfc('0x2a')](_0x4ef47f,'no\x20odbc\x20database\x20found');}if(!this[_0xcbfc('0x85')](_0x4ef47f[_0xcbfc('0x2e')])){return this[_0xcbfc('0xb')]['error'](_0x4ef47f,_0xcbfc('0xda'));}var _0x1b5b85=_0x4ef47f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xdb'),_0x1b5b85));var _0x31d70e=this[_0xcbfc('0x29')][_0xcbfc('0x6f')](this,_0x565f80,_0x1b5b85);this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x4ef47f,_0x1b5b85);if(!this[_0xcbfc('0x85')](_0x4ef47f[_0xcbfc('0xdc')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xdd'));}var _0x85c5c6=this[_0xcbfc('0xf')]['sync'](this,_0x4ef47f[_0xcbfc('0xdc')]);if(!_0x85c5c6){return this[_0xcbfc('0xb')]['error'](_0x4ef47f,_0xcbfc('0xde'));}var _0x1218a4=this;_0x31d70e['forEach'](function(_0x579f60,_0x2fc98f){Object[_0xcbfc('0xdf')](_0x579f60)[_0xcbfc('0xe0')](function(_0x58a735){_0x1218a4[_0xcbfc('0xb')][_0xcbfc('0x9f')](util[_0xcbfc('0x53')](_0xcbfc('0xe1'),_0x85c5c6,_0x2fc98f,_0x58a735),_0x579f60[_0x58a735]);});});this[_0xcbfc('0xb')][_0xcbfc('0x9f')](util[_0xcbfc('0x53')](_0xcbfc('0xe2'),_0x85c5c6),_0x31d70e[_0xcbfc('0x9c')]);return this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')](_0xcbfc('0xe3'),_0x85c5c6));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xe4')]=function(_0x27e9ba){logger[_0xcbfc('0xe5')](util['format'](_0xcbfc('0xe6'),_0x27e9ba[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x27e9ba[_0xcbfc('0xe7')])){return this['channel']['error'](_0x27e9ba,'no\x20user\x20selected');}var _0x1522ec=this['getUser'][_0xcbfc('0x6f')](this,_0x27e9ba['sip_id']);if(!_0x1522ec){return this['channel'][_0xcbfc('0x2a')](_0x27e9ba,_0xcbfc('0xe8'));}var _0x2b65f8=this[_0xcbfc('0xb')][_0xcbfc('0x56')]('DIAL',[util[_0xcbfc('0x53')](_0xcbfc('0xe9'),_0x1522ec),_0x27e9ba[_0xcbfc('0x65')],_0x27e9ba['opts'],_0x27e9ba['url']]);if(_0x2b65f8[_0xcbfc('0xa6')]===-0x1){return _0x2b65f8;}return this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xea')]=function(_0x1b89af){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1b89af[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x1b89af['key'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xeb'));}if(!this[_0xcbfc('0x85')](_0x1b89af[_0xcbfc('0x5b')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xad'));}this[_0xcbfc('0xb')][_0xcbfc('0xec')]=!![];this[_0xcbfc('0x35')](_0x1b89af);this[_0xcbfc('0x42')](_0x1b89af[_0xcbfc('0x5b')],'in','','');this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xed'),_0x1b89af[_0xcbfc('0x5b')]));var _0x54d8f9=this[_0xcbfc('0x77')][_0xcbfc('0x6f')](this,_0x1b89af);if(_0x54d8f9){for(var _0x1363b1 in _0x54d8f9){if(_0x54d8f9['hasOwnProperty'](_0x1363b1)){this[_0xcbfc('0xb')][_0xcbfc('0x9f')](util[_0xcbfc('0x53')](_0xcbfc('0xee'),_0x1363b1[_0xcbfc('0x68')]()),_0x54d8f9[_0x1363b1]);}}this[_0xcbfc('0x42')](_0x54d8f9[_0xcbfc('0xef')],_0xcbfc('0xf0'),_0xcbfc('0xea'),'');return this[_0xcbfc('0xb')]['noop'](util['format'](_0xcbfc('0xf1'),_0x54d8f9[_0xcbfc('0xef')]));}return this['channel'][_0xcbfc('0x2a')](_0x1b89af,_0xcbfc('0xf2'));};AGIVertices[_0xcbfc('0xe')]['dialogflowV2']=function(_0xcf407e){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0xf3'),_0xcf407e[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0xcf407e[_0xcbfc('0x7a')])){return this['channel'][_0xcbfc('0xac')]('no\x20project_id\x20configured');}if(!this[_0xcbfc('0x85')](_0xcf407e[_0xcbfc('0x7b')])){return this['channel'][_0xcbfc('0xac')]('no\x20client_email\x20configured');}if(!this[_0xcbfc('0x85')](_0xcf407e[_0xcbfc('0x7c')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20private_key\x20configured');}if(!this[_0xcbfc('0x85')](_0xcf407e[_0xcbfc('0x7d')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xf4'));}if(!this[_0xcbfc('0x85')](_0xcf407e['text'])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xad'));}this[_0xcbfc('0xb')]['bot']=!![];this[_0xcbfc('0x35')](_0xcf407e);this[_0xcbfc('0x42')](_0xcf407e['text'],'in','','');this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xf5'),_0xcf407e[_0xcbfc('0x5b')]));var _0x3876d6=this[_0xcbfc('0x79')][_0xcbfc('0x6f')](this,_0xcf407e);if(_0x3876d6){for(var _0x37ae92 in _0x3876d6){if(_0x3876d6[_0xcbfc('0x96')](_0x37ae92)){if(_0x37ae92!=='providerResponse'){this[_0xcbfc('0xb')]['setVariable'](util[_0xcbfc('0x53')](_0xcbfc('0xee'),_0x37ae92[_0xcbfc('0x68')]()),_0x3876d6[_0x37ae92]);}}}this[_0xcbfc('0x42')](_0x3876d6[_0xcbfc('0xef')],_0xcbfc('0xf0'),_0xcbfc('0xf6'),_0x3876d6[_0xcbfc('0xf7')]);return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xf8'),_0x3876d6[_0xcbfc('0xef')]));}return this[_0xcbfc('0xb')]['error'](_0xcf407e,_0xcbfc('0xf9'));};AGIVertices[_0xcbfc('0xe')]['sesteknda']=function(_0x48eea9){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0xfa'),_0x48eea9[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x48eea9[_0xcbfc('0xfb')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xfc'));}if(!this[_0xcbfc('0x85')](_0x48eea9['username'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xfd'));}if(!this[_0xcbfc('0x85')](_0x48eea9[_0xcbfc('0xfe')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20password\x20configured');}if(!this[_0xcbfc('0x85')](_0x48eea9[_0xcbfc('0xff')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20text\x20configured');}this[_0xcbfc('0xb')][_0xcbfc('0xec')]=!![];this['createSquareDetailsReport'](_0x48eea9);this[_0xcbfc('0x42')](_0x48eea9['text'],'in','','');this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Trying\x20SestekNDA:\x20%s',_0x48eea9[_0xcbfc('0x5b')]));var _0x54c87f=this['sestekNDA'][_0xcbfc('0x6f')](this,_0x48eea9);if(_0x54c87f){for(var _0x47e23b in _0x54c87f){if(_0x54c87f[_0xcbfc('0x96')](_0x47e23b)){this[_0xcbfc('0xb')]['setVariable'](util[_0xcbfc('0x53')](_0xcbfc('0x100'),_0x47e23b['toUpperCase']()),_0x54c87f[_0x47e23b]);}}this[_0xcbfc('0x42')](_0x54c87f[_0xcbfc('0xef')],'out',_0xcbfc('0x101'),'');if(_0x54c87f[_0xcbfc('0x102')]){this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x54c87f[_0xcbfc('0x102')]));var _0x4c7942=this['channel']['streamFile'](_0x54c87f[_0xcbfc('0x102')]);try{fs[_0xcbfc('0x103')](_0x54c87f['audiofile']+_0xcbfc('0x104'));}catch(_0x38af2d){logger[_0xcbfc('0x2a')](_0x38af2d);}return _0x4c7942;}else{return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x105'),_0x54c87f[_0xcbfc('0xef')]));}}return this['channel'][_0xcbfc('0x2a')](_0x48eea9,_0xcbfc('0x106'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x107')]=function(_0x3df0e2){logger['info'](util['format'](_0xcbfc('0x108'),_0x3df0e2[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x107'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x109')]=function(_0x22fbd8){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x10a'),_0x22fbd8['label']));var _0x26e789='';if(_0x22fbd8[_0xcbfc('0x10b')]){if(!this[_0xcbfc('0x85')](_0x22fbd8[_0xcbfc('0x10b')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x22fbd8,'no\x20trunk\x20selected');}else{var _0x1bccc3=parseInt(_0x22fbd8[_0xcbfc('0x10b')],0xa);if(isNaN(_0x1bccc3)){_0x26e789=_0x22fbd8[_0xcbfc('0x10b')];}else{_0x26e789=this[_0xcbfc('0x19')][_0xcbfc('0x6f')](this,_0x22fbd8[_0xcbfc('0x10b')]);if(!_0x26e789){return this[_0xcbfc('0xb')]['error'](_0x22fbd8,'no\x20trunk\x20found');}}}}else if(_0x22fbd8[_0xcbfc('0x10c')]){_0x26e789=_0x22fbd8[_0xcbfc('0x10c')];}else{return this[_0xcbfc('0xb')]['error'](_0x22fbd8,_0xcbfc('0x10d'));}var _0x22e5e2=this['channel'][_0xcbfc('0x56')]('DIAL',[util['format'](_0xcbfc('0x10e'),_0x26e789,_0x22fbd8[_0xcbfc('0x48')]),_0x22fbd8[_0xcbfc('0x65')],_0x22fbd8[_0xcbfc('0x10f')],_0x22fbd8[_0xcbfc('0x62')]]);if(_0x22e5e2[_0xcbfc('0xa6')]===-0x1){return _0x22e5e2;}return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x110'),_0xcbfc('0x111')));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x112')]=function(_0x5b2aee){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5b2aee['label']));return this['channel'][_0xcbfc('0xac')](_0xcbfc('0x112'));};AGIVertices['prototype']['getdigits']=function(_0x14ba41){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x113'),_0x14ba41[_0xcbfc('0x37')]));if(_0x14ba41[_0xcbfc('0xa9')]===0x0){return this[_0xcbfc('0xa8')](_0x14ba41);}_0x14ba41[_0xcbfc('0xa9')]-=0x1;if(!this[_0xcbfc('0x85')](_0x14ba41['file_id'])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x14ba41,_0xcbfc('0x114'));}var _0x1a4b2c=this[_0xcbfc('0x1b')][_0xcbfc('0x6f')](this,_0x14ba41[_0xcbfc('0x115')]);if(!_0x1a4b2c){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x14ba41,'no\x20file\x20audio\x20found');}if(!this[_0xcbfc('0x85')](_0x14ba41[_0xcbfc('0xdc')])){return this[_0xcbfc('0xb')]['error'](_0xcbfc('0xdd'));}var _0xdd7b4d=this[_0xcbfc('0xb')][_0xcbfc('0x116')](_0x1a4b2c,_0x14ba41['response'],_0x14ba41[_0xcbfc('0x117')]);var _0x1ed761=_0xdd7b4d['result']?_0xdd7b4d['result'][_0xcbfc('0xa4')]():'';logger[_0xcbfc('0x2c')](_0xcbfc('0x118'),JSON[_0xcbfc('0x72')](_0xdd7b4d));if(_0xdd7b4d['result']===-0x1){this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x14ba41,_0x1ed761);return _0xdd7b4d;}else if(_0xdd7b4d[_0xcbfc('0xa3')]===_0xcbfc('0x65')){_0xdd7b4d[_0xcbfc('0xa6')]=_0x1ed761[_0xcbfc('0x9c')]>=parseInt(_0x14ba41[_0xcbfc('0x119')])?'x':'i';}else{_0xdd7b4d[_0xcbfc('0xa6')]=_0x1ed761[_0xcbfc('0x9c')]>=parseInt(_0x14ba41['mindigit'])&&_0x1ed761[_0xcbfc('0x9c')]<=parseInt(_0x14ba41['maxdigit'])?'x':'i';}var _0x2f39eb=this[_0xcbfc('0xf')][_0xcbfc('0x6f')](this,_0x14ba41['variable_id']);if(!_0x2f39eb){return this['channel']['error'](_0x14ba41,_0xcbfc('0xde'));}this[_0xcbfc('0xb')][_0xcbfc('0x9f')](_0x2f39eb,_0x1ed761);if(this[_0xcbfc('0x85')](_0x14ba41[_0xcbfc('0x11a')])){var _0x392d9c=parseInt(_0x14ba41[_0xcbfc('0x11a')],0xa);var _0x46b595=rs[_0xcbfc('0x11b')]({'charset':'*','length':_0x392d9c});var _0x42d238=_0x1ed761['length'];if(_0x42d238>0x0){if(_0x42d238>_0x392d9c){this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x14ba41,_0x14ba41[_0xcbfc('0x11c')]==='first'?_0x46b595+_0x1ed761['substr'](_0x392d9c):_0x1ed761['substr'](0x0,_0x42d238-_0x392d9c)+_0x46b595);}else{this[_0xcbfc('0x35')]['sync'](this,_0x14ba41,rs[_0xcbfc('0x11b')]({'charset':'*','length':_0x42d238}));}}else{this['createSquareDetailsReport'][_0xcbfc('0x6f')](this,_0x14ba41,'');}}else{this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x14ba41,_0x1ed761);}return _0xdd7b4d;};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0xa')]=function(_0x4c852c){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x11d'),_0x4c852c['label']));return this[_0xcbfc('0x9')](_0x4c852c);};AGIVertices['prototype'][_0xcbfc('0x11e')]=function(_0x39b2bf){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x11f'),_0x39b2bf[_0xcbfc('0x37')]));this['createSquareDetailsReport'][_0xcbfc('0x6f')](this,_0x39b2bf,_0x39b2bf[_0xcbfc('0x120')]);return this['channel'][_0xcbfc('0xac')](util['format'](_0xcbfc('0x121'),_0x39b2bf[_0xcbfc('0x120')]));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x122')]=function(_0x26b57f){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x26b57f[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x26b57f[_0xcbfc('0x88')])||!this[_0xcbfc('0x85')](_0x26b57f['aws_secret_access_key'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x26b57f[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')]['noop'](_0xcbfc('0xad'));}this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x123'),_0x26b57f['text']));var _0x17c457=this[_0xcbfc('0x87')][_0xcbfc('0x6f')](this,_0x26b57f);if(_0x17c457){this['channel']['noop'](util['format'](_0xcbfc('0x124'),_0x17c457));var _0x168ce1=this[_0xcbfc('0xb')][_0xcbfc('0x125')](_0x17c457);try{fs[_0xcbfc('0x103')](_0x17c457+_0xcbfc('0x104'));}catch(_0x3087dd){logger[_0xcbfc('0x2a')](_0x3087dd);}return _0x168ce1;}return this[_0xcbfc('0xb')]['error'](_0x26b57f,_0xcbfc('0x126'));};AGIVertices[_0xcbfc('0xe')]['awslex']=function(_0x143612){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x127'),_0x143612[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x143612['aws_access_key_id'])||!this[_0xcbfc('0x85')](_0x143612[_0xcbfc('0x89')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x143612[_0xcbfc('0x128')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x143612[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}this[_0xcbfc('0xb')][_0xcbfc('0xec')]=!![];this[_0xcbfc('0x35')](_0x143612);this[_0xcbfc('0x42')](_0x143612[_0xcbfc('0x5b')],'in','','');this['channel'][_0xcbfc('0xac')](util['format'](_0xcbfc('0x129'),_0x143612[_0xcbfc('0x5b')]));var _0x56c6de=this[_0xcbfc('0x8e')][_0xcbfc('0x6f')](this,_0x143612);if(_0x56c6de){for(var _0x27aa61 in _0x56c6de){if(_0x56c6de['hasOwnProperty'](_0x27aa61)&&_['isString'](_0x56c6de[_0x27aa61])){this[_0xcbfc('0xb')]['setVariable'](util[_0xcbfc('0x53')]('AWS_LEX_%s',_0x27aa61['toUpperCase']()),_0x56c6de[_0x27aa61]);}}if(_['isNil'](_0x56c6de[_0xcbfc('0x12a')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0x12b'));}else{this[_0xcbfc('0x42')](_0x56c6de[_0xcbfc('0x12a')],_0xcbfc('0xf0'),_0xcbfc('0x12c'),'');return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Amazon\x20Lex\x20Result\x20%s',_0x56c6de[_0xcbfc('0x12a')]));}}return this['channel'][_0xcbfc('0x2a')](_0x143612,_0xcbfc('0x12d'));};AGIVertices['prototype'][_0xcbfc('0x12e')]=function(_0x55e998){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x12f'),_0x55e998[_0xcbfc('0x37')],_0x55e998[_0xcbfc('0x65')]));if(!this[_0xcbfc('0x85')](_0x55e998[_0xcbfc('0x83')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xeb'));}var _0x3e8296=_0xcbfc('0x130');var _0x223050=util[_0xcbfc('0x53')](_0xcbfc('0x131'),FILES_PATH,rs['generate'](0x4));var _0x542390=util[_0xcbfc('0x53')]('%s.%s',_0x223050,_0x3e8296);var _0x201193=!![];if(_0x55e998[_0xcbfc('0x132')]===_0xcbfc('0x133')){_0x201193=![];}var _0x29d48f=this['channel'][_0xcbfc('0x134')](_0x223050,_0x3e8296,_0x55e998[_0xcbfc('0x135')],_0x55e998[_0xcbfc('0x65')],undefined,_0x201193);if(_0x29d48f[_0xcbfc('0xa6')]!==-0x1){this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0x136'),_0x542390));var _0x5ae66f=this['googleASR']['sync'](this,_0x55e998,_0x542390);if(_0x5ae66f){for(var _0x48a0b7 in _0x5ae66f){if(_0x5ae66f[_0xcbfc('0x96')](_0x48a0b7)){this[_0xcbfc('0xb')]['setVariable'](util['format'](_0xcbfc('0x137'),_0x48a0b7[_0xcbfc('0x68')]()),_0x5ae66f[_0x48a0b7]);}}return this['channel']['noop'](util[_0xcbfc('0x53')]('GoogleASR\x20Result\x20%s',JSON[_0xcbfc('0x72')](_0x5ae66f)));}}return _0x29d48f;};AGIVertices[_0xcbfc('0xe')]['tildeasr']=function(_0x443eb0){logger['info'](util[_0xcbfc('0x53')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x443eb0[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x443eb0[_0xcbfc('0x92')])){return this['channel']['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x443eb0['appsecret'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20appsecret\x20configured');}var _0xea60eb='wav';var _0x9e226f=util['format'](_0xcbfc('0x131'),FILES_PATH,rs[_0xcbfc('0x11b')](0x4));var _0x40d122=util[_0xcbfc('0x53')]('%s.%s',_0x9e226f,_0xea60eb);var _0x46b1d6=!![];if(_0x443eb0[_0xcbfc('0x132')]===_0xcbfc('0x133')){_0x46b1d6=![];}var _0x1580a5=this['channel']['recordFile'](_0x9e226f,_0xea60eb,_0x443eb0['intKey'],_0x443eb0['timeout'],undefined,_0x46b1d6);if(_0x1580a5['result']!==-0x1){this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x138'),_0x40d122));var _0x5a9c0e=this[_0xcbfc('0x91')][_0xcbfc('0x6f')](this,_0x443eb0,_0x40d122);if(_0x5a9c0e){for(var _0x4c68bc in _0x5a9c0e){if(_0x5a9c0e[_0xcbfc('0x96')](_0x4c68bc)){this['channel']['setVariable'](util[_0xcbfc('0x53')](_0xcbfc('0x139'),_0x4c68bc['toUpperCase']()),_0x5a9c0e[_0x4c68bc]);}}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0x13a'),JSON[_0xcbfc('0x72')](_0x5a9c0e)));}}return _0x1580a5;};AGIVertices[_0xcbfc('0xe')]['gotoc']=function(_0x2a8cf9){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x13b'),_0x2a8cf9[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')]['continueAt'](_0x2a8cf9[_0xcbfc('0x3d')],_0x2a8cf9['extension'],_0x2a8cf9[_0xcbfc('0x13c')]);};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x13d')]=function(_0x52ec31){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x13e'),_0x52ec31[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x52ec31[_0xcbfc('0x13f')])){return this[_0xcbfc('0xb')]['error'](_0x52ec31,_0xcbfc('0x140'));}try{var _0x359b0b=eval(_0x52ec31[_0xcbfc('0x13f')])?_0xcbfc('0x141'):_0xcbfc('0x142');this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0x143'),_0x52ec31[_0xcbfc('0x13f')],_0x359b0b));return{'code':0xc8,'result':_0x359b0b};}catch(_0x1dfb31){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x144')]=function(_0x3f5711){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x145'),_0x3f5711[_0xcbfc('0x37')]));if(!this['isConfigured'](_0x3f5711[_0xcbfc('0x146')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x3f5711,'no\x20interval\x20configured');}var _0xfbf654=this[_0xcbfc('0x22')]['sync'](this,_0x3f5711['interval_id']);if(!_0xfbf654){return this[_0xcbfc('0xb')]['error'](_0x3f5711,_0xcbfc('0x147'));}for(var _0x5d2833=0x0;_0x5d2833<_0xfbf654['length'];_0x5d2833+=0x1){var _0x28993f=this[_0xcbfc('0xb')]['getVariable'](util[_0xcbfc('0x53')](_0xcbfc('0x148'),_0xfbf654[_0x5d2833]));if(_0x28993f[_0xcbfc('0xa6')]===-0x1){return _0x28993f;}logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x149'),_0xfbf654[_0x5d2833],_0x28993f[_0xcbfc('0xa3')]));if(_0x28993f[_0xcbfc('0xa3')]==='true'){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('IFTIME\x20%s\x20%s',_0xfbf654[_0x5d2833],_0xcbfc('0x141')));this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')]('IFTIME\x20%s\x20%s',_0xfbf654[_0x5d2833],_0xcbfc('0x141')));return{'code':0xc8,'result':_0xcbfc('0x141')};}else{logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x149'),_0xfbf654[_0x5d2833],_0xcbfc('0x142')));this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x149'),_0xfbf654[_0x5d2833],_0xcbfc('0x142')));}}return{'code':0xc8,'result':_0xcbfc('0x142')};};AGIVertices['prototype'][_0xcbfc('0x14a')]=function(_0x3dd719){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x14b'),_0x3dd719['label']));return this['channel'][_0xcbfc('0x14a')]();};AGIVertices['prototype'][_0xcbfc('0x14c')]=function(_0x216602){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x14d'),_0x216602[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x216602[_0xcbfc('0x83')])){return this[_0xcbfc('0xb')]['noop'](_0xcbfc('0xeb'));}var _0x1ebec1=_0xcbfc('0x130');var _0x13475f=util[_0xcbfc('0x53')](_0xcbfc('0x131'),FILES_PATH,rs['generate'](0x4));var _0x5d5cd5=util[_0xcbfc('0x53')](_0xcbfc('0x9e'),_0x13475f,_0x1ebec1);var _0x3f609f=!![];if(_0x216602[_0xcbfc('0x132')]==='NOBEEP'){_0x3f609f=![];}var _0x2e0293=this['channel'][_0xcbfc('0x134')](_0x13475f,_0x1ebec1,_0x216602[_0xcbfc('0x135')],_0x216602['timeout'],undefined,_0x3f609f);if(_0x2e0293[_0xcbfc('0xa6')]!==-0x1){this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')](_0xcbfc('0x14e'),_0x5d5cd5));var _0x556b92=this[_0xcbfc('0x82')]['sync'](this,_0x216602,_0x5d5cd5);if(_0x556b92){for(var _0x5217e5 in _0x556b92){if(_0x556b92[_0xcbfc('0x96')](_0x5217e5)){this[_0xcbfc('0xb')][_0xcbfc('0x9f')](util[_0xcbfc('0x53')](_0xcbfc('0x14f'),_0x5217e5[_0xcbfc('0x68')]()),_0x556b92[_0x5217e5]);}}return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x150'),JSON[_0xcbfc('0x72')](_0x556b92)));}}return _0x2e0293;};AGIVertices[_0xcbfc('0xe')]['ispeechtts']=function(_0x47a6a0){logger['info'](util['format'](_0xcbfc('0x151'),_0x47a6a0[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x47a6a0[_0xcbfc('0x83')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xeb'));}if(!this[_0xcbfc('0x85')](_0x47a6a0[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Trying\x20ispeech\x20TTS\x20%s',_0x47a6a0['text']));var _0x17d0a6=this['ispeechTTS'][_0xcbfc('0x6f')](this,_0x47a6a0);if(_0x17d0a6){this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0x14e'),_0x17d0a6));var _0x4ad102=this[_0xcbfc('0xb')][_0xcbfc('0x125')](_0x17d0a6,_0x47a6a0['intKey']);try{fs[_0xcbfc('0x103')](_0x17d0a6+'.wav');}catch(_0x25b1b0){logger[_0xcbfc('0x2a')](_0x25b1b0);}return _0x4ad102;}return this['channel'][_0xcbfc('0x2a')](_0x47a6a0,_0xcbfc('0x152'));};AGIVertices['prototype'][_0xcbfc('0x153')]=function(_0x3d1bc2){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x154'),_0x3d1bc2[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x3d1bc2[_0xcbfc('0x155')])){return this['channel']['error'](_0x3d1bc2,_0xcbfc('0x156'));}logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x157'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x3d1bc2[_0xcbfc('0x155')]));var _0xda91d8=this[_0xcbfc('0x51')]['sync'](this,_0x3d1bc2[_0xcbfc('0x155')]);if(_0xda91d8){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x3d1bc2[_0xcbfc('0x155')]));this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this['channel']['callerid'],_0x3d1bc2['findBy']));return{'code':0xc8,'result':_0xcbfc('0x159')};}else{logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x3d1bc2[_0xcbfc('0x155')]));this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x3d1bc2[_0xcbfc('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xcbfc('0xe')]['logout']=function(_0x10430e){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x15a'),_0x10430e['label']));if(!this['isConfigured'](_0x10430e['findBy'])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x10430e,_0xcbfc('0x156'));}logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x157'),this[_0xcbfc('0xb')]['callerid'],_0x10430e[_0xcbfc('0x155')]));var _0x4ed630=this['agentLogout']['sync'](this,_0x10430e[_0xcbfc('0x155')]);if(_0x4ed630){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x10430e[_0xcbfc('0x155')]));this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x10430e[_0xcbfc('0x155')]));return{'code':0xc8,'result':_0xcbfc('0x159')};}else{logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x15b'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x10430e[_0xcbfc('0x155')]));this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0x15b'),this['channel'][_0xcbfc('0x3b')],_0x10430e['findBy']));return{'code':0xc8,'result':_0xcbfc('0x15c')};}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x15d')]=function(_0x4c877b){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4c877b['label']));if(!this['isConfigured'](_0x4c877b[_0xcbfc('0x15e')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x4c877b,_0xcbfc('0x15f'));}this['channel'][_0xcbfc('0xac')](util['format'](_0xcbfc('0x160'),_0x4c877b[_0xcbfc('0x15e')]));var _0x3fcd44=eval(_0x4c877b[_0xcbfc('0x15e')]);if(!this[_0xcbfc('0x85')](_0x4c877b[_0xcbfc('0xdc')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0xdd'));}var _0x4c542b=this[_0xcbfc('0xf')][_0xcbfc('0x6f')](this,_0x4c877b[_0xcbfc('0xdc')]);if(!_0x4c542b){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x4c877b,'no\x20variable\x20found');}if(_[_0xcbfc('0x9b')](_0x3fcd44)){var _0x1e9fd2=this;_0x3fcd44[_0xcbfc('0xe0')](function(_0xc71794,_0x1fedd3){_0x1e9fd2['channel']['setVariable'](util[_0xcbfc('0x53')]('%s[%s]',_0x4c542b,_0x1fedd3),_0xc71794);});return this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x161'),_0x4c542b));}else{return this['channel'][_0xcbfc('0x9f')](_0x4c542b,_0x3fcd44);}};AGIVertices[_0xcbfc('0xe')]['menu']=function(_0x162ec3){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x162'),_0x162ec3[_0xcbfc('0x37')]));if(_0x162ec3['retry']===0x0){return this[_0xcbfc('0xa8')](_0x162ec3);}_0x162ec3[_0xcbfc('0xa9')]-=0x1;if(!this[_0xcbfc('0x85')](_0x162ec3['file_id'])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x162ec3,'no\x20file\x20audio\x20selected');}var _0x36919d=this[_0xcbfc('0x1b')][_0xcbfc('0x6f')](this,_0x162ec3[_0xcbfc('0x115')]);if(!_0x36919d){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x162ec3,_0xcbfc('0x163'));}var _0x3c34dd=this[_0xcbfc('0xb')][_0xcbfc('0x116')](_0x36919d,_0x162ec3[_0xcbfc('0x164')],_0x162ec3[_0xcbfc('0x165')]);var _0x2b1699=_0x3c34dd[_0xcbfc('0xa6')];if(_0x3c34dd[_0xcbfc('0xa6')]===-0x1){this[_0xcbfc('0x35')]['sync'](this,_0x162ec3,'-1');return _0x3c34dd;}else if(_0x3c34dd[_0xcbfc('0xa3')]==='timeout'){_0x3c34dd[_0xcbfc('0xa6')]=_0x3c34dd[_0xcbfc('0xa6')][_0xcbfc('0x9c')]>0x0?_0x3c34dd[_0xcbfc('0xa6')]:'t';}else if(_[_0xcbfc('0x44')](_0x3c34dd[_0xcbfc('0xa6')])){_0x3c34dd[_0xcbfc('0xa6')]='#';_0x2b1699='#';}if(!this[_0xcbfc('0x85')](_0x162ec3[_0xcbfc('0xdc')])){this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1c8def=this[_0xcbfc('0xf')][_0xcbfc('0x6f')](this,_0x162ec3[_0xcbfc('0xdc')]);if(!_0x1c8def){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x162ec3,'no\x20variable\x20found');}this['channel'][_0xcbfc('0x9f')](_0x1c8def,_0x2b1699);}this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x162ec3,_0x2b1699);return _0x3c34dd;};AGIVertices[_0xcbfc('0xe')]['noop']=function(_0x3be4c7){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x166'),_0x3be4c7[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0x3be4c7[_0xcbfc('0x167')]||_0x3be4c7['label']);};AGIVertices[_0xcbfc('0xe')]['pause']=function(_0xf85453){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x168'),_0xf85453[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0xf85453[_0xcbfc('0x155')])){return this['channel'][_0xcbfc('0x2a')](_0xf85453,'no\x20find\x20by\x20configured');}logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x157'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0xf85453[_0xcbfc('0x155')]));var _0x5649bd=this['getPause'][_0xcbfc('0x6f')](this,_0xf85453[_0xcbfc('0x169')]);var _0x54e90b=this[_0xcbfc('0x4d')][_0xcbfc('0x6f')](this,_0xf85453[_0xcbfc('0x155')],_0x5649bd);if(_0x54e90b){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0xf85453[_0xcbfc('0x155')]));this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0xf85453[_0xcbfc('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x15b'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0xf85453['findBy']));this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')]['callerid'],_0xf85453[_0xcbfc('0x155')]));return{'code':0xc8,'result':_0xcbfc('0x15c')};}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x16a')]=function(_0x49b7d5){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x16b'),_0x49b7d5[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x49b7d5[_0xcbfc('0x115')])){return this[_0xcbfc('0xb')]['error'](_0x49b7d5,'no\x20file\x20audio\x20selected');}var _0x75468=this[_0xcbfc('0x1b')][_0xcbfc('0x6f')](this,_0x49b7d5['file_id']);if(!_0x75468){return this['channel'][_0xcbfc('0x2a')](_0x49b7d5,'no\x20file\x20audio\x20found');}var _0x3db946=this[_0xcbfc('0xb')]['exec'](_0xcbfc('0x16c'),[_0x75468,_0x49b7d5['opts']]);if(_0x3db946['result']===-0x1){return _0x3db946;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0xca'),_0xcbfc('0x16c'),_0x75468));};AGIVertices['prototype']['queue']=function(_0x2d70ce){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2d70ce[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x2d70ce[_0xcbfc('0x16d')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x2d70ce,'no\x20queue\x20selected');}var _0x6c4cb='';var _0x3d9f72=parseInt(_0x2d70ce['queue_id'],0xa);if(isNaN(_0x3d9f72)){_0x6c4cb=_0x2d70ce[_0xcbfc('0x16d')];}else{_0x6c4cb=this[_0xcbfc('0x16e')][_0xcbfc('0x6f')](this,_0x2d70ce[_0xcbfc('0x16d')]);if(!_0x6c4cb){return this['channel']['error'](_0x2d70ce,_0xcbfc('0x16f'));}}var _0x2c9da7='';if(this[_0xcbfc('0x85')](_0x2d70ce[_0xcbfc('0x115')])){var _0xa4eaf6=this[_0xcbfc('0x1b')]['sync'](this,_0x2d70ce[_0xcbfc('0x115')]);if(_0xa4eaf6){_0x2c9da7=_0xa4eaf6;}}this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x2d70ce,_0x6c4cb);if(_0x2d70ce[_0xcbfc('0x10f')][_0xcbfc('0x170')]('x')<0x0){_0x2d70ce['opts']+='x';}if(_0x2d70ce['opts'][_0xcbfc('0x170')]('X')<0x0){_0x2d70ce[_0xcbfc('0x10f')]+='X';}this[_0xcbfc('0xb')]['setVariable']('XMCS-QUEUE',_0x6c4cb?_0x6c4cb[_0xcbfc('0x171')]():'');var _0x384e29=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0xcbfc('0x172'),[_0x6c4cb,_0x2d70ce[_0xcbfc('0x10f')],_0x2d70ce[_0xcbfc('0x62')],_0x2c9da7,_0x2d70ce[_0xcbfc('0x65')],_0x2d70ce[_0xcbfc('0xbc')],_0x2d70ce[_0xcbfc('0x173')],_0x2d70ce[_0xcbfc('0x174')],'',_0x2d70ce[_0xcbfc('0x175')]]);if(_0x384e29[_0xcbfc('0xa6')]===-0x1){return _0x384e29;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util['format'](_0xcbfc('0xca'),_0xcbfc('0x172'),_0x6c4cb));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x176')]=function(_0x2d647d){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x177'),_0x2d647d[_0xcbfc('0x37')]));var _0x46ea04=_0x2d647d[_0xcbfc('0x178')]||_0xcbfc('0x130');var _0x3b7821=util['format']('%s_%s',this[_0xcbfc('0xb')]['uniqueid'],rs[_0xcbfc('0x11b')](0x5));var _0x5027f6=util[_0xcbfc('0x53')](_0xcbfc('0x179'),FILES_PATH,_0x3b7821,_0x46ea04);var _0x2c607e=util[_0xcbfc('0x53')](_0xcbfc('0x131'),FILES_PATH,_0x3b7821);this[_0xcbfc('0x3a')][_0xcbfc('0x6f')](this,_0x2d647d,_0x3b7821,_0x5027f6);this['channel'][_0xcbfc('0x9f')]('RECORDING_SAVENAME',_0x3b7821);logger[_0xcbfc('0x2c')](_0xcbfc('0x17a'),_0x2c607e,_0x46ea04,_0x2d647d[_0xcbfc('0x17b')],_0x2d647d[_0xcbfc('0x65')]);return this[_0xcbfc('0xb')][_0xcbfc('0x134')](_0x2c607e,_0x46ea04,_0x2d647d[_0xcbfc('0x17b')],_0x2d647d[_0xcbfc('0x65')],undefined,!![]);};AGIVertices['prototype'][_0xcbfc('0x17c')]=function(_0x36fa14){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x17d'),_0x36fa14[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x36fa14[_0xcbfc('0x62')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x17e'));}var _0x1847fb=this['restAPI'][_0xcbfc('0x6f')](this,_0x36fa14);logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x17f'),util[_0xcbfc('0x180')](_0x1847fb,{'showHidden':![],'depth':null})));if(!this[_0xcbfc('0x85')](_0x36fa14[_0xcbfc('0xdc')])){return this['channel'][_0xcbfc('0xac')](_0xcbfc('0x181'));}var _0xef6615=this['getVariable'][_0xcbfc('0x6f')](this,_0x36fa14[_0xcbfc('0xdc')]);if(!_0xef6615){return this[_0xcbfc('0xb')]['error'](_0x36fa14,_0xcbfc('0xde'));}this['channel'][_0xcbfc('0x9f')](util[_0xcbfc('0x53')](_0xcbfc('0x182'),_0xef6615),_0x1847fb[_0xcbfc('0x74')]?_0x1847fb[_0xcbfc('0x74')]:_0xcbfc('0x183'));this[_0xcbfc('0xb')][_0xcbfc('0x9f')](util[_0xcbfc('0x53')]('%s_STATUS_MESSAGE',_0xef6615),_0x1847fb['statusMessage']?_0x1847fb[_0xcbfc('0x184')]:'OK');if(_0x1847fb[_0xcbfc('0x69')]){try{this['saveRestApiResult'](_0x1847fb[_0xcbfc('0x69')],_0xef6615);}catch(_0x2ef473){logger['error'](util[_0xcbfc('0x53')](_0xcbfc('0x185'),_0xef6615));}}return this['channel']['noop'](util[_0xcbfc('0x53')](_0xcbfc('0xe3'),_0xef6615));};AGIVertices[_0xcbfc('0xe')]['saydigits']=function(_0xb1aa8b){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0xb1aa8b[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')][_0xcbfc('0x186')](_0xb1aa8b[_0xcbfc('0x187')][_0xcbfc('0x188')](/\s+/g,''),_0xb1aa8b[_0xcbfc('0x17b')]);};AGIVertices[_0xcbfc('0xe')]['saynumber']=function(_0x34b0ea){logger[_0xcbfc('0x2c')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x34b0ea['label']));return this[_0xcbfc('0xb')]['sayNumber'](_0x34b0ea[_0xcbfc('0x64')][_0xcbfc('0x188')](/\s+/g,''),_0x34b0ea[_0xcbfc('0x17b')]);};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x189')]=function(_0x3af900){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x18a'),_0x3af900['label']));return this[_0xcbfc('0xb')]['sayPhonetic'](_0x3af900['text'],_0x3af900['escape_digits']);};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x18b')]=function(_0x4ad96f){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4ad96f['label']));if(!this[_0xcbfc('0x85')](_0x4ad96f[_0xcbfc('0x18c')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x18d'));}var _0x5669ec=this[_0xcbfc('0x1f')][_0xcbfc('0x6f')](this,_0x4ad96f['account_id']);if(!_0x5669ec||!_0x5669ec['Smtp']){return this[_0xcbfc('0xb')]['error'](_0x4ad96f,_0xcbfc('0x18e'));}var _0x48bf8c={'from':util[_0xcbfc('0x53')](_0xcbfc('0x18f'),_0x5669ec['name'],_0x5669ec[_0xcbfc('0x190')]||_0x5669ec[_0xcbfc('0x191')][_0xcbfc('0x192')]),'to':_0x4ad96f['to']||'','cc':_0x4ad96f['cc']||'','bcc':_0x4ad96f[_0xcbfc('0x193')]||'','subject':_0x4ad96f[_0xcbfc('0x194')],'html':_0x4ad96f[_0xcbfc('0x5b')],'text':_0x4ad96f[_0xcbfc('0x5b')]};if(this[_0xcbfc('0x85')](_0x4ad96f[_0xcbfc('0x195')])){}logger[_0xcbfc('0xe5')]('sendMail\x20message',JSON['stringify'](_0x48bf8c));this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x4ad96f,_0x4ad96f[_0xcbfc('0x18c')]);this['channel']['noop'](util[_0xcbfc('0x53')](_0xcbfc('0x196'),_0x5669ec[_0xcbfc('0x14')]));this['sendMailMessage']['sync'](this,_0x5669ec[_0xcbfc('0x197')],_0x48bf8c);return this[_0xcbfc('0xb')]['noop'](_0xcbfc('0x198'));};AGIVertices['prototype'][_0xcbfc('0x199')]=function(_0x2ac925){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x19a'),_0x2ac925[_0xcbfc('0x37')]));return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x19b'));};AGIVertices[_0xcbfc('0xe')]['sendSMS']=function(_0x5897f4){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x19c'),_0x5897f4[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x5897f4['sms_account_id'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x19d'));}var _0x2be6d3=this['getSmsAccount'][_0xcbfc('0x6f')](this,_0x5897f4[_0xcbfc('0x19e')]);if(!_0x2be6d3){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x5897f4,_0xcbfc('0x19f'));}var _0x338153={'body':_0x5897f4[_0xcbfc('0x1a0')],'phone':_0x5897f4['to']||'','SmsAccountId':_0x2be6d3['id']};logger[_0xcbfc('0xe5')](_0xcbfc('0x1a1'),JSON[_0xcbfc('0x72')](_0x338153));this[_0xcbfc('0x35')][_0xcbfc('0x6f')](this,_0x5897f4,_0x5897f4[_0xcbfc('0x19e')]);this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x1a2'),_0x2be6d3[_0xcbfc('0x14')]));this[_0xcbfc('0x34')][_0xcbfc('0x6f')](this,_0x338153);return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x1a3'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1a4')]=function(_0x368540){logger['info'](util['format'](_0xcbfc('0x1a5'),_0x368540[_0xcbfc('0x37')]));if(!this['isConfigured'](_0x368540[_0xcbfc('0xdc')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x368540,'no\x20variable\x20selected');}var _0x37e1bb=this['getVariable']['sync'](this,_0x368540[_0xcbfc('0xdc')]);if(!_0x37e1bb){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x368540,_0xcbfc('0xde'));}return this[_0xcbfc('0xb')][_0xcbfc('0x9f')](_0x37e1bb,_0x368540['variable_value']);};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1a6')]=function(_0x1d02cf){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x1a7'),_0x1d02cf[_0xcbfc('0x37')]));this['channel'][_0xcbfc('0xac')](_0xcbfc('0x1a8'));if(_0x1d02cf[_0xcbfc('0xbe')]===_0xcbfc('0x1a9')){this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x1aa'));return this[_0xcbfc('0xb')][_0xcbfc('0xbe')]();}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x1ab'));};AGIVertices[_0xcbfc('0xe')]['subproject']=function(_0x14f8bb){logger[_0xcbfc('0x2c')](util['format'](_0xcbfc('0x1ac'),_0x14f8bb[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x14f8bb[_0xcbfc('0x1ad')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x14f8bb,_0xcbfc('0x1ae'));}var _0x3ac753=this[_0xcbfc('0x1af')][_0xcbfc('0x6f')](this,_0x14f8bb[_0xcbfc('0x1ad')]);if(!this['isConfigured'](_0x3ac753)){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x14f8bb,util[_0xcbfc('0x53')](_0xcbfc('0x1b0'),_0x14f8bb[_0xcbfc('0x1ad')]));}if(_0x3ac753===this[_0xcbfc('0xb')][_0xcbfc('0x39')]){return this[_0xcbfc('0xb')]['error'](_0x14f8bb,_0xcbfc('0x1b1'));}this['createSquareDetailsReport'][_0xcbfc('0x6f')](this,_0x14f8bb,_0x3ac753);var _0xb026a0=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0xcbfc('0x1b2'),util[_0xcbfc('0x53')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xcbfc('0xbc')][_0xcbfc('0x1b3')]||_0xcbfc('0x1b4'),_0x3ac753,this[_0xcbfc('0xb')][_0xcbfc('0x39')]));if(_0xb026a0['result']===-0x1){return _0xb026a0;}return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('Executed\x20command\x20%s\x20%s','AGI',_0x3ac753));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1b5')]=function(_0x1391c8){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x1b6'),_0x1391c8[_0xcbfc('0x37')]));var _0x1b8680=this['shellCommand'][_0xcbfc('0x6f')](this,_0x1391c8[_0xcbfc('0xbd')]);this['createSquareDetailsReport'][_0xcbfc('0x6f')](this,_0x1391c8,_0x1391c8['command']);if(this['isConfigured'](_0x1391c8['variable_id'])){var _0x2b6c8e=this['getVariable'][_0xcbfc('0x6f')](this,_0x1391c8['variable_id']);if(_0x2b6c8e){this[_0xcbfc('0xb')]['setVariable'](_0x2b6c8e,_0x1b8680);return this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1391c8['command'],_0x2b6c8e));}}return this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')](_0xcbfc('0x1b7'),_0x1391c8[_0xcbfc('0xbd')]));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1b8')]=function(_0x4e5aa7){logger['info'](util['format'](_0xcbfc('0x1b9'),_0x4e5aa7[_0xcbfc('0x37')]));_0x4e5aa7[_0xcbfc('0x5b')]=_0x4e5aa7[_0xcbfc('0x5b')][_0xcbfc('0x188')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcbfc('0x85')](_0x4e5aa7['apiKey'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0x1ba'));}if(!this['isConfigured'](_0x4e5aa7['text'])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')]('no\x20text\x20configured');}this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x1bb'),_0x4e5aa7[_0xcbfc('0x5b')]));var _0x1935fe=this['googleCloudTTS'][_0xcbfc('0x6f')](this,_0x4e5aa7);if(_0x1935fe){this[_0xcbfc('0xb')][_0xcbfc('0xac')](util[_0xcbfc('0x53')](_0xcbfc('0x1bc'),_0x1935fe));var _0x12b490=this['channel'][_0xcbfc('0x125')](_0x1935fe);try{fs['unlink'](_0x1935fe+_0xcbfc('0x104'));}catch(_0x4b8e2a){logger[_0xcbfc('0x2a')](_0x4b8e2a);}return _0x12b490;}return this['channel']['error'](_0x4e5aa7,_0xcbfc('0x1bd'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1be')]=function(_0x4cc2d0){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x1bf'),_0x4cc2d0[_0xcbfc('0x37')]));_0x4cc2d0[_0xcbfc('0x5b')]=_0x4cc2d0[_0xcbfc('0x5b')][_0xcbfc('0x188')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcbfc('0x85')](_0x4cc2d0[_0xcbfc('0x5b')])){return this[_0xcbfc('0xb')][_0xcbfc('0xac')](_0xcbfc('0xad'));}this[_0xcbfc('0xb')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x4cc2d0[_0xcbfc('0x5b')]));var _0x45a1f1=this[_0xcbfc('0x60')][_0xcbfc('0x6f')](this,_0x4cc2d0);if(_0x45a1f1){this['channel']['noop'](util[_0xcbfc('0x53')]('Google\x20TTS\x20%s\x20file\x20created',_0x45a1f1));var _0x27b4ac=this[_0xcbfc('0xb')][_0xcbfc('0x125')](_0x45a1f1);try{fs[_0xcbfc('0x103')](_0x45a1f1+'.wav');}catch(_0x82d9ec){logger['error'](_0x82d9ec);}return _0x27b4ac;}return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x4cc2d0,_0xcbfc('0x1c0'));};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1c1')]=function(_0x4f0e3f){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x1c2'),_0x4f0e3f['label']));if(!this['isConfigured'](_0x4f0e3f[_0xcbfc('0x155')])){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x4f0e3f,'no\x20find\x20by\x20configured');}logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x157'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x4f0e3f[_0xcbfc('0x155')]));var _0x14fea9=this[_0xcbfc('0x4f')][_0xcbfc('0x6f')](this,_0x4f0e3f[_0xcbfc('0x155')]);if(_0x14fea9){logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x158'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x4f0e3f[_0xcbfc('0x155')]));this[_0xcbfc('0xb')]['noop'](util[_0xcbfc('0x53')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x4f0e3f[_0xcbfc('0x155')]));return{'code':0xc8,'result':_0xcbfc('0x159')};}else{logger[_0xcbfc('0x2c')](util[_0xcbfc('0x53')](_0xcbfc('0x15b'),this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x4f0e3f[_0xcbfc('0x155')]));this['channel'][_0xcbfc('0xac')](util[_0xcbfc('0x53')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcbfc('0xb')][_0xcbfc('0x3b')],_0x4f0e3f[_0xcbfc('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xcbfc('0xe')][_0xcbfc('0x1c3')]=function(_0x262dda){logger['info'](util[_0xcbfc('0x53')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x262dda[_0xcbfc('0x37')]));var _0x5c2006=this[_0xcbfc('0xb')][_0xcbfc('0x56')](_0xcbfc('0x1c4'),[_0x262dda['mailbox'],_0x262dda[_0xcbfc('0x76')]]);if(_0x5c2006[_0xcbfc('0xa6')]===-0x1){return _0x5c2006;}return this['channel'][_0xcbfc('0xac')](util['format'](_0xcbfc('0xca'),_0xcbfc('0x1c4'),_0x262dda[_0xcbfc('0x1c5')]));};AGIVertices['prototype'][_0xcbfc('0x1c6')]=function(_0x13840b){logger['info'](util[_0xcbfc('0x53')](_0xcbfc('0x1c7'),_0x13840b[_0xcbfc('0x37')]));if(!this[_0xcbfc('0x85')](_0x13840b['variable_id'])){return this[_0xcbfc('0xb')]['error'](_0x13840b,_0xcbfc('0x1c8'));}var _0x5c8d67=this['getVariable'][_0xcbfc('0x6f')](this,_0x13840b[_0xcbfc('0xdc')]);if(!_0x5c8d67){return this[_0xcbfc('0xb')][_0xcbfc('0x2a')](_0x13840b,_0xcbfc('0xde'));}var _0x15d54d=this[_0xcbfc('0xb')][_0xcbfc('0xf')](_0x5c8d67);return{'code':0xc8,'result':_0x15d54d['extra']?_0x15d54d[_0xcbfc('0xa3')]:'-'};};String['prototype']['replaceAll']=function(_0x43bd10,_0x4a40a7){return this[_0xcbfc('0xa1')](_0x43bd10)[_0xcbfc('0x1c9')](_0x4a40a7);};module[_0xcbfc('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 47c88de..13cc095 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 _0x4b64=['[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../../../config/logger','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDisposition','name','then','getAgent','info'];(function(_0x2c4745,_0x461743){var _0x5e6619=function(_0x249ce0){while(--_0x249ce0){_0x2c4745['push'](_0x2c4745['shift']());}};_0x5e6619(++_0x461743);}(_0x4b64,0x8b));var _0x44b6=function(_0x423c77,_0x468893){_0x423c77=_0x423c77-0x0;var _0x709302=_0x4b64[_0x423c77];return _0x709302;};'use strict';var util=require(_0x44b6('0x0'));var _=require(_0x44b6('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x44b6('0x2'))('acw');var RpcUser=require(_0x44b6('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x37a863){this['voiceQueues']=_0x37a863[_0x44b6('0x4')];this[_0x44b6('0x5')]=_0x37a863[_0x44b6('0x5')];this[_0x44b6('0x6')]=_0x37a863['timers'];this['channels']={};ami['on'](_0x44b6('0x7'),this[_0x44b6('0x8')][_0x44b6('0x9')](this));ami['on'](_0x44b6('0xa'),this['syncHangupRequest'][_0x44b6('0x9')](this));ami['on'](_0x44b6('0xb'),this['syncHangup']['bind'](this));ami['on'](_0x44b6('0xc'),this['syncAgentRingNoAnswer'][_0x44b6('0x9')](this));ami['on'](_0x44b6('0xd'),this[_0x44b6('0xe')][_0x44b6('0x9')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x44b6('0x9')](this));ami['on'](_0x44b6('0xf'),this[_0x44b6('0x10')][_0x44b6('0x9')](this));}function getDiff(_0x34b06d){var _0xcc7bba=moment()['milliseconds'](0x0);var _0x45d989=moment(_0x34b06d)['milliseconds'](0x0);return _0xcc7bba[_0x44b6('0x11')](_0x45d989,_0x44b6('0x12'));}Acw[_0x44b6('0x13')][_0x44b6('0x14')]=function(_0x4225fa){try{var _0x58af90=this;var _0x1d5200=this[_0x44b6('0x15')][_0x4225fa][_0x44b6('0x16')];var _0x5bccc2=this[_0x44b6('0x15')][_0x4225fa][_0x44b6('0x17')];var _0x5768b8=this[_0x44b6('0x4')][_0x5bccc2];var _0x51d3c5=![];var _0x30afcf='ACW';if(_0x5768b8[_0x44b6('0x18')]){if(_0x5768b8['mandatoryDispositionPause'][_0x44b6('0x19')]){_0x51d3c5=!![];_0x30afcf=_0x5768b8['mandatoryDispositionPause'][_0x44b6('0x19')];}}ami['Action']({'action':'QueuePause','interface':_0x1d5200,'paused':!![],'reason':_0x30afcf})[_0x44b6('0x1a')](function(_0x1abf81){if(_0x58af90[_0x44b6('0x5')][_0x1d5200]){return RpcUser[_0x44b6('0x1b')](_0x58af90[_0x44b6('0x5')][_0x1d5200]['id'])[_0x44b6('0x1a')](function(_0x3d9f1d){if(_0x3d9f1d&&!_0x3d9f1d['voicePause']){logger[_0x44b6('0x1c')](_0x44b6('0x1d'),_0x4225fa,_0x1d5200,_0x5bccc2);var _0x36b755=_0x58af90[_0x44b6('0x15')][_0x4225fa][_0x44b6('0x1e')]&&_0x58af90[_0x44b6('0x15')][_0x4225fa]['destlinkedid']?_0x58af90[_0x44b6('0x15')][_0x4225fa][_0x44b6('0x1f')]:_0x4225fa;return RpcUser[_0x44b6('0x20')](_0x58af90[_0x44b6('0x5')][_0x1d5200],_0x30afcf,_0x36b755)[_0x44b6('0x1a')](function(_0x22caea){if(!_0x51d3c5){_0x58af90[_0x44b6('0x6')][_0x1d5200]={};logger[_0x44b6('0x1c')](_0x44b6('0x21'),_0x4225fa,_0x58af90[_0x44b6('0x4')][_0x5bccc2]['acwTimeout'],_0x1d5200,_0x5bccc2);_0x58af90['timers'][_0x1d5200]['timer']=setTimeout(_0x58af90[_0x44b6('0x22')]['bind'](_0x58af90,_0x1d5200),_0x58af90[_0x44b6('0x4')][_0x5bccc2][_0x44b6('0x23')]*0x3e8);_0x58af90['timers'][_0x1d5200][_0x44b6('0x24')]=moment()['format'](_0x44b6('0x25'));_0x58af90[_0x44b6('0x6')][_0x1d5200]['uniqueid']=_0x4225fa;_0x58af90[_0x44b6('0x6')][_0x1d5200][_0x44b6('0x17')]=_0x5bccc2;_0x58af90['timers'][_0x1d5200][_0x44b6('0x26')]=function(){var _0x2a5903=getDiff(_0x58af90[_0x44b6('0x6')][_0x1d5200][_0x44b6('0x24')]);clearTimeout(_0x58af90[_0x44b6('0x6')][_0x1d5200][_0x44b6('0x27')]);_0x58af90[_0x44b6('0x6')][_0x1d5200]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x2a5903},_0x58af90[_0x44b6('0x6')][_0x1d5200][_0x44b6('0x28')],_0x1d5200)[_0x44b6('0x1a')](function(_0x12a8e4){logger['info'](_0x44b6('0x29'),_0x4225fa,_0x2a5903,_0x12a8e4);})[_0x44b6('0x2a')](function(_0x42e2d7){logger[_0x44b6('0x2b')](_0x44b6('0x2c'),_0x4225fa,_0x42e2d7);});delete _0x58af90[_0x44b6('0x6')][_0x1d5200];};}});}else{logger[_0x44b6('0x1c')](_0x44b6('0x2d'),_0x4225fa,_0x1d5200,_0x5bccc2);}});}})['catch'](function(_0x1fdabc){logger[_0x44b6('0x2b')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4225fa,_0x58af90[_0x44b6('0x4')][_0x5bccc2][_0x44b6('0x23')],_0x1d5200,_0x5bccc2);})[_0x44b6('0x2e')](function(){delete _0x58af90[_0x44b6('0x15')][_0x4225fa];});}catch(_0x4a9474){logger[_0x44b6('0x2b')](_0x44b6('0x2f'),_0x4a9474[_0x44b6('0x30')]);}};Acw['prototype'][_0x44b6('0x22')]=function(_0x3931fd){try{var _0x419902=this;if(_0x419902[_0x44b6('0x6')][_0x3931fd]){_0x419902['timers'][_0x3931fd][_0x44b6('0x27')]=![];var _0x40405e=_0x419902['timers'][_0x3931fd]['uniqueid'];var _0x3aa425=_0x419902['timers'][_0x3931fd][_0x44b6('0x17')];var _0x27696c=_0x419902[_0x44b6('0x4')][_0x3aa425][_0x44b6('0x23')];logger[_0x44b6('0x1c')](_0x44b6('0x31'),_0x40405e,_0x3931fd);RpcUser[_0x44b6('0x32')](this[_0x44b6('0x5')][_0x3931fd]);RpcVoiceAgentReport[_0x44b6('0x33')]({'acwtime':_0x27696c,'agentacw':!![]},_0x40405e,_0x3931fd)['then'](function(_0x348ce2){logger[_0x44b6('0x1c')](_0x44b6('0x29'),_0x40405e,_0x27696c,_0x348ce2);})[_0x44b6('0x2a')](function(_0x63ed2e){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x40405e,_0x63ed2e);});}else{logger[_0x44b6('0x2b')](_0x44b6('0x34'),_0x3931fd);if(_0x419902[_0x44b6('0x6')]){logger[_0x44b6('0x1c')](_0x44b6('0x35'),JSON['stringify'](_0x419902[_0x44b6('0x6')]));}}}catch(_0xf7f916){logger[_0x44b6('0x2b')](_0x44b6('0x36'),_0xf7f916[_0x44b6('0x30')]);}};Acw[_0x44b6('0x13')]['syncAgentConnect']=function(_0x4b3517){try{if(this[_0x44b6('0x4')][_0x4b3517[_0x44b6('0x17')]]&&(this[_0x44b6('0x4')][_0x4b3517['queue']]['acw']||this[_0x44b6('0x4')][_0x4b3517[_0x44b6('0x17')]][_0x44b6('0x18')])){if(this[_0x44b6('0x5')][_0x4b3517[_0x44b6('0x16')]]){this[_0x44b6('0x15')][_0x4b3517[_0x44b6('0x28')]]={'queue':_0x4b3517[_0x44b6('0x17')],'interface':_0x4b3517[_0x44b6('0x16')],'destlinkedid':_0x4b3517[_0x44b6('0x1f')]};}}}catch(_0x5a523c){logger[_0x44b6('0x2b')](_0x44b6('0x37'),_0x5a523c['message']);}};Acw['prototype'][_0x44b6('0x10')]=function(_0x5e687d){try{if(this[_0x44b6('0x4')][_0x5e687d[_0x44b6('0x17')]]&&(this[_0x44b6('0x4')][_0x5e687d[_0x44b6('0x17')]][_0x44b6('0x38')]||this['voiceQueues'][_0x5e687d['queue']][_0x44b6('0x18')])){if(this[_0x44b6('0x5')][_0x5e687d['interface']]){this[_0x44b6('0x15')][_0x5e687d['uniqueid']]={'queue':_0x5e687d[_0x44b6('0x17')],'interface':_0x5e687d[_0x44b6('0x16')]};}}}catch(_0x4450a6){logger[_0x44b6('0x2b')](_0x44b6('0x39'),_0x4450a6[_0x44b6('0x30')]);}};Acw[_0x44b6('0x13')][_0x44b6('0x3a')]=function(_0x1bc608){try{if(this[_0x44b6('0x15')][_0x1bc608[_0x44b6('0x28')]]&&_[_0x44b6('0x3b')](this[_0x44b6('0x15')][_0x1bc608['uniqueid']][_0x44b6('0x1e')])){logger[_0x44b6('0x1c')](_0x44b6('0x3c'),_0x1bc608[_0x44b6('0x28')]);this[_0x44b6('0x14')](_0x1bc608[_0x44b6('0x28')]);}else if(this[_0x44b6('0x15')][_0x1bc608[_0x44b6('0x3d')]]&&_['isUndefined'](this[_0x44b6('0x15')][_0x1bc608[_0x44b6('0x3d')]]['attended'])){logger[_0x44b6('0x1c')](_0x44b6('0x3e'),_0x1bc608['linkedid']);this[_0x44b6('0x14')](_0x1bc608[_0x44b6('0x3d')]);}}catch(_0x4ba46d){logger[_0x44b6('0x2b')]('[ACW][syncHangupRequest]\x20%s',_0x4ba46d[_0x44b6('0x30')]);}};Acw[_0x44b6('0x13')]['syncHangup']=function(_0x5aa448){try{if(this[_0x44b6('0x15')][_0x5aa448['uniqueid']]&&this[_0x44b6('0x15')][_0x5aa448[_0x44b6('0x28')]][_0x44b6('0x1e')]){logger['info'](_0x44b6('0x3f'),_0x5aa448['uniqueid']);this[_0x44b6('0x14')](_0x5aa448['uniqueid']);}else if(this[_0x44b6('0x15')][_0x5aa448[_0x44b6('0x3d')]]&&this[_0x44b6('0x15')][_0x5aa448[_0x44b6('0x3d')]]['attended']){logger[_0x44b6('0x1c')](_0x44b6('0x40'),_0x5aa448[_0x44b6('0x3d')]);this['startAcw'](_0x5aa448[_0x44b6('0x3d')]);}}catch(_0x256b9d){logger[_0x44b6('0x2b')](_0x44b6('0x41'),_0x256b9d[_0x44b6('0x30')]);}};Acw[_0x44b6('0x13')][_0x44b6('0xe')]=function(_0x79b2d2){try{if(!_['isNil'](this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x42')]])){this[_0x44b6('0x14')](_0x79b2d2[_0x44b6('0x42')]);if(this['channels'][_0x79b2d2[_0x44b6('0x43')]]){this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x43')]][_0x44b6('0x1e')]=!![];this[_0x44b6('0x15')][_0x79b2d2['transfertargetuniqueid']]=this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x43')]];delete this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x43')]];}}else if(!_[_0x44b6('0x44')](this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x45')]])){this[_0x44b6('0x14')](_0x79b2d2[_0x44b6('0x45')]);if(this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x46')]]){this[_0x44b6('0x15')][_0x79b2d2['origtransfereruniqueid']][_0x44b6('0x1e')]=!![];this[_0x44b6('0x15')][_0x79b2d2['transfereeuniqueid']]=this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x46')]];delete this[_0x44b6('0x15')][_0x79b2d2[_0x44b6('0x46')]];}}}catch(_0x2b2f20){logger[_0x44b6('0x2b')](_0x44b6('0x47'),_0x2b2f20[_0x44b6('0x30')]);}};Acw['prototype'][_0x44b6('0x48')]=function(_0x1b0647){try{if(this['channels'][_0x1b0647['transfereruniqueid']]){logger['info'](_0x44b6('0x49'),JSON[_0x44b6('0x4a')](_0x1b0647[_0x44b6('0x4b')]));this['startAcw'](_0x1b0647[_0x44b6('0x4b')]);}else if(this['channels'][_0x1b0647[_0x44b6('0x4c')]]){logger[_0x44b6('0x1c')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x44b6('0x4a')](_0x1b0647[_0x44b6('0x4c')]));this[_0x44b6('0x14')](_0x1b0647[_0x44b6('0x4c')]);}}catch(_0x40c9bf){logger[_0x44b6('0x2b')]('[ACW][syncBlindTransfer]\x20%s',_0x40c9bf[_0x44b6('0x30')]);}};Acw['prototype'][_0x44b6('0x4d')]=function(_0x276d91){try{if(this[_0x44b6('0x4')][_0x276d91[_0x44b6('0x17')]]&&this['voiceQueues'][_0x276d91['queue']][_0x44b6('0x4e')]===_0x44b6('0x4f')){if(this[_0x44b6('0x5')][_0x276d91[_0x44b6('0x16')]]){logger[_0x44b6('0x1c')](_0x44b6('0x50'),_0x276d91[_0x44b6('0x28')],_0x276d91[_0x44b6('0x16')],_0x276d91['queue']);return RpcUser[_0x44b6('0x20')](this['agents'][_0x276d91['interface']],_0x44b6('0x51'),_0x276d91[_0x44b6('0x28')]);}}}catch(_0x32912a){logger[_0x44b6('0x2b')](_0x44b6('0x52'),_0x32912a[_0x44b6('0x30')]);}};module[_0x44b6('0x53')]=Acw; \ No newline at end of file +var _0x7ace=['voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','../rpc/user'];(function(_0x16683a,_0x460dca){var _0x480406=function(_0x5bb1e5){while(--_0x5bb1e5){_0x16683a['push'](_0x16683a['shift']());}};_0x480406(++_0x460dca);}(_0x7ace,0x1a9));var _0xe7ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ace[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xe7ac('0x0'));var _=require('lodash');var moment=require(_0xe7ac('0x1'));var ami=require(_0xe7ac('0x2'));var logger=require(_0xe7ac('0x3'))('acw');var RpcUser=require(_0xe7ac('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x44f57c){this[_0xe7ac('0x5')]=_0x44f57c[_0xe7ac('0x5')];this[_0xe7ac('0x6')]=_0x44f57c[_0xe7ac('0x6')];this[_0xe7ac('0x7')]=_0x44f57c['timers'];this['channels']={};ami['on'](_0xe7ac('0x8'),this[_0xe7ac('0x9')][_0xe7ac('0xa')](this));ami['on'](_0xe7ac('0xb'),this[_0xe7ac('0xc')][_0xe7ac('0xa')](this));ami['on'](_0xe7ac('0xd'),this['syncHangup'][_0xe7ac('0xa')](this));ami['on'](_0xe7ac('0xe'),this[_0xe7ac('0xf')]['bind'](this));ami['on'](_0xe7ac('0x10'),this[_0xe7ac('0x11')]['bind'](this));ami['on'](_0xe7ac('0x12'),this[_0xe7ac('0x13')][_0xe7ac('0xa')](this));ami['on'](_0xe7ac('0x14'),this[_0xe7ac('0x15')][_0xe7ac('0xa')](this));}function getDiff(_0x4ae950){var _0xe88d45=moment()[_0xe7ac('0x16')](0x0);var _0x2d1e60=moment(_0x4ae950)[_0xe7ac('0x16')](0x0);return _0xe88d45[_0xe7ac('0x17')](_0x2d1e60,'seconds');}Acw[_0xe7ac('0x18')][_0xe7ac('0x19')]=function(_0x205421){try{var _0x2b258e=this;var _0x1f8728=this[_0xe7ac('0x1a')][_0x205421]['interface'];var _0x1601e8=this[_0xe7ac('0x1a')][_0x205421][_0xe7ac('0x1b')];var _0x1529f2=this['voiceQueues'][_0x1601e8];var _0x3460d3=![];var _0x4b4c5c=_0xe7ac('0x1c');if(_0x1529f2[_0xe7ac('0x1d')]){if(_0x1529f2[_0xe7ac('0x1e')][_0xe7ac('0x1f')]){_0x3460d3=!![];_0x4b4c5c=_0x1529f2[_0xe7ac('0x1e')][_0xe7ac('0x1f')];}}ami[_0xe7ac('0x20')]({'action':_0xe7ac('0x21'),'interface':_0x1f8728,'paused':!![],'reason':_0x4b4c5c})[_0xe7ac('0x22')](function(_0x1903f5){if(_0x2b258e[_0xe7ac('0x6')][_0x1f8728]){return RpcUser[_0xe7ac('0x23')](_0x2b258e[_0xe7ac('0x6')][_0x1f8728]['id'])[_0xe7ac('0x22')](function(_0x3c89b7){if(_0x3c89b7&&!_0x3c89b7[_0xe7ac('0x24')]){logger[_0xe7ac('0x25')](_0xe7ac('0x26'),_0x205421,_0x1f8728,_0x1601e8);var _0x48b7ac=_0x2b258e[_0xe7ac('0x1a')][_0x205421][_0xe7ac('0x27')]&&_0x2b258e[_0xe7ac('0x1a')][_0x205421]['destlinkedid']?_0x2b258e['channels'][_0x205421][_0xe7ac('0x28')]:_0x205421;return RpcUser[_0xe7ac('0x29')](_0x2b258e[_0xe7ac('0x6')][_0x1f8728],_0x4b4c5c,_0x48b7ac)['then'](function(_0x22c683){if(!_0x3460d3){_0x2b258e['timers'][_0x1f8728]={};logger['info'](_0xe7ac('0x2a'),_0x205421,_0x2b258e[_0xe7ac('0x5')][_0x1601e8]['acwTimeout'],_0x1f8728,_0x1601e8);_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2b')]=setTimeout(_0x2b258e['stopAcw'][_0xe7ac('0xa')](_0x2b258e,_0x1f8728),_0x2b258e[_0xe7ac('0x5')][_0x1601e8][_0xe7ac('0x2c')]*0x3e8);_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2d')]=moment()[_0xe7ac('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2f')]=_0x205421;_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x1b')]=_0x1601e8;_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x30')]=function(){var _0x27041c=getDiff(_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2d')]);clearTimeout(_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2b')]);_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2b')]=![];RpcVoiceAgentReport[_0xe7ac('0x31')]({'acwtime':_0x27041c},_0x2b258e[_0xe7ac('0x7')][_0x1f8728][_0xe7ac('0x2f')],_0x1f8728)[_0xe7ac('0x22')](function(_0x2b2e9b){logger[_0xe7ac('0x25')](_0xe7ac('0x32'),_0x205421,_0x27041c,_0x2b2e9b);})[_0xe7ac('0x33')](function(_0x4cd9a3){logger[_0xe7ac('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x205421,_0x4cd9a3);});delete _0x2b258e[_0xe7ac('0x7')][_0x1f8728];};}});}else{logger[_0xe7ac('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x205421,_0x1f8728,_0x1601e8);}});}})['catch'](function(_0xe12805){logger[_0xe7ac('0x34')](_0xe7ac('0x2a'),_0x205421,_0x2b258e['voiceQueues'][_0x1601e8][_0xe7ac('0x2c')],_0x1f8728,_0x1601e8);})[_0xe7ac('0x35')](function(){delete _0x2b258e[_0xe7ac('0x1a')][_0x205421];});}catch(_0x26ccd4){logger[_0xe7ac('0x34')](_0xe7ac('0x36'),_0x26ccd4[_0xe7ac('0x37')]);}};Acw[_0xe7ac('0x18')]['stopAcw']=function(_0x2ba38a){try{var _0x2ceaa5=this;if(_0x2ceaa5[_0xe7ac('0x7')][_0x2ba38a]){_0x2ceaa5[_0xe7ac('0x7')][_0x2ba38a][_0xe7ac('0x2b')]=![];var _0x3d8315=_0x2ceaa5['timers'][_0x2ba38a][_0xe7ac('0x2f')];var _0x590325=_0x2ceaa5[_0xe7ac('0x7')][_0x2ba38a]['queue'];var _0x12f86a=_0x2ceaa5[_0xe7ac('0x5')][_0x590325][_0xe7ac('0x2c')];logger['info'](_0xe7ac('0x38'),_0x3d8315,_0x2ba38a);RpcUser[_0xe7ac('0x39')](this[_0xe7ac('0x6')][_0x2ba38a]);RpcVoiceAgentReport[_0xe7ac('0x31')]({'acwtime':_0x12f86a,'agentacw':!![]},_0x3d8315,_0x2ba38a)['then'](function(_0x2803ca){logger[_0xe7ac('0x25')](_0xe7ac('0x32'),_0x3d8315,_0x12f86a,_0x2803ca);})['catch'](function(_0x5c0f31){logger['error'](_0xe7ac('0x3a'),_0x3d8315,_0x5c0f31);});}else{logger[_0xe7ac('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2ba38a);if(_0x2ceaa5['timers']){logger[_0xe7ac('0x25')](_0xe7ac('0x3b'),JSON['stringify'](_0x2ceaa5[_0xe7ac('0x7')]));}}}catch(_0x490c3e){logger[_0xe7ac('0x34')]('[ACW][STOP]\x20%s',_0x490c3e['message']);}};Acw[_0xe7ac('0x18')][_0xe7ac('0x9')]=function(_0x2bbeee){try{if(this[_0xe7ac('0x5')][_0x2bbeee[_0xe7ac('0x1b')]]&&(this[_0xe7ac('0x5')][_0x2bbeee[_0xe7ac('0x1b')]][_0xe7ac('0x3c')]||this[_0xe7ac('0x5')][_0x2bbeee['queue']]['mandatoryDisposition'])){if(this[_0xe7ac('0x6')][_0x2bbeee[_0xe7ac('0x3d')]]){this[_0xe7ac('0x1a')][_0x2bbeee['uniqueid']]={'queue':_0x2bbeee['queue'],'interface':_0x2bbeee[_0xe7ac('0x3d')],'destlinkedid':_0x2bbeee[_0xe7ac('0x28')]};}}}catch(_0x107fb1){logger[_0xe7ac('0x34')](_0xe7ac('0x3e'),_0x107fb1[_0xe7ac('0x37')]);}};Acw['prototype'][_0xe7ac('0x15')]=function(_0x480d20){try{if(this[_0xe7ac('0x5')][_0x480d20[_0xe7ac('0x1b')]]&&(this[_0xe7ac('0x5')][_0x480d20[_0xe7ac('0x1b')]]['acw']||this[_0xe7ac('0x5')][_0x480d20['queue']][_0xe7ac('0x1d')])){if(this['agents'][_0x480d20[_0xe7ac('0x3d')]]){this[_0xe7ac('0x1a')][_0x480d20[_0xe7ac('0x2f')]]={'queue':_0x480d20[_0xe7ac('0x1b')],'interface':_0x480d20['interface']};}}}catch(_0xb1bc7e){logger[_0xe7ac('0x34')](_0xe7ac('0x3f'),_0xb1bc7e[_0xe7ac('0x37')]);}};Acw['prototype']['syncHangupRequest']=function(_0x20032c){try{if(this[_0xe7ac('0x1a')][_0x20032c[_0xe7ac('0x2f')]]&&_[_0xe7ac('0x40')](this[_0xe7ac('0x1a')][_0x20032c[_0xe7ac('0x2f')]][_0xe7ac('0x27')])){logger[_0xe7ac('0x25')](_0xe7ac('0x41'),_0x20032c[_0xe7ac('0x2f')]);this[_0xe7ac('0x19')](_0x20032c[_0xe7ac('0x2f')]);}else if(this[_0xe7ac('0x1a')][_0x20032c[_0xe7ac('0x42')]]&&_['isUndefined'](this[_0xe7ac('0x1a')][_0x20032c[_0xe7ac('0x42')]][_0xe7ac('0x27')])){logger[_0xe7ac('0x25')]('[%s][HANGUP:LINKEDID]',_0x20032c[_0xe7ac('0x42')]);this[_0xe7ac('0x19')](_0x20032c[_0xe7ac('0x42')]);}}catch(_0x122e55){logger[_0xe7ac('0x34')](_0xe7ac('0x43'),_0x122e55[_0xe7ac('0x37')]);}};Acw[_0xe7ac('0x18')]['syncHangup']=function(_0x4112c1){try{if(this['channels'][_0x4112c1['uniqueid']]&&this[_0xe7ac('0x1a')][_0x4112c1[_0xe7ac('0x2f')]]['attended']){logger[_0xe7ac('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4112c1[_0xe7ac('0x2f')]);this['startAcw'](_0x4112c1[_0xe7ac('0x2f')]);}else if(this['channels'][_0x4112c1[_0xe7ac('0x42')]]&&this[_0xe7ac('0x1a')][_0x4112c1[_0xe7ac('0x42')]]['attended']){logger['info'](_0xe7ac('0x44'),_0x4112c1[_0xe7ac('0x42')]);this[_0xe7ac('0x19')](_0x4112c1[_0xe7ac('0x42')]);}}catch(_0xa05db){logger[_0xe7ac('0x34')](_0xe7ac('0x45'),_0xa05db[_0xe7ac('0x37')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x427a19){try{if(!_['isNil'](this['channels'][_0x427a19[_0xe7ac('0x46')]])){this[_0xe7ac('0x19')](_0x427a19[_0xe7ac('0x46')]);if(this[_0xe7ac('0x1a')][_0x427a19['secondtransfereruniqueid']]){this['channels'][_0x427a19[_0xe7ac('0x47')]][_0xe7ac('0x27')]=!![];this[_0xe7ac('0x1a')][_0x427a19[_0xe7ac('0x48')]]=this['channels'][_0x427a19[_0xe7ac('0x47')]];delete this['channels'][_0x427a19[_0xe7ac('0x47')]];}}else if(!_['isNil'](this['channels'][_0x427a19[_0xe7ac('0x48')]])){this[_0xe7ac('0x19')](_0x427a19[_0xe7ac('0x48')]);if(this['channels'][_0x427a19[_0xe7ac('0x49')]]){this['channels'][_0x427a19[_0xe7ac('0x49')]][_0xe7ac('0x27')]=!![];this['channels'][_0x427a19[_0xe7ac('0x46')]]=this[_0xe7ac('0x1a')][_0x427a19[_0xe7ac('0x49')]];delete this[_0xe7ac('0x1a')][_0x427a19[_0xe7ac('0x49')]];}}}catch(_0x2bfd7a){logger['error'](_0xe7ac('0x4a'),_0x2bfd7a[_0xe7ac('0x37')]);}};Acw['prototype'][_0xe7ac('0x13')]=function(_0x5f016e){try{if(this[_0xe7ac('0x1a')][_0x5f016e[_0xe7ac('0x4b')]]){logger[_0xe7ac('0x25')](_0xe7ac('0x4c'),JSON[_0xe7ac('0x4d')](_0x5f016e[_0xe7ac('0x4b')]));this[_0xe7ac('0x19')](_0x5f016e['transfereruniqueid']);}else if(this[_0xe7ac('0x1a')][_0x5f016e[_0xe7ac('0x4e')]]){logger[_0xe7ac('0x25')](_0xe7ac('0x4f'),JSON['stringify'](_0x5f016e[_0xe7ac('0x4e')]));this[_0xe7ac('0x19')](_0x5f016e[_0xe7ac('0x4e')]);}}catch(_0x515aa4){logger[_0xe7ac('0x34')](_0xe7ac('0x50'),_0x515aa4[_0xe7ac('0x37')]);}};Acw['prototype'][_0xe7ac('0xf')]=function(_0x3bc92b){try{if(this['voiceQueues'][_0x3bc92b[_0xe7ac('0x1b')]]&&this[_0xe7ac('0x5')][_0x3bc92b[_0xe7ac('0x1b')]]['autopause']===_0xe7ac('0x51')){if(this[_0xe7ac('0x6')][_0x3bc92b[_0xe7ac('0x3d')]]){logger[_0xe7ac('0x25')](_0xe7ac('0x52'),_0x3bc92b[_0xe7ac('0x2f')],_0x3bc92b[_0xe7ac('0x3d')],_0x3bc92b[_0xe7ac('0x1b')]);return RpcUser[_0xe7ac('0x29')](this[_0xe7ac('0x6')][_0x3bc92b[_0xe7ac('0x3d')]],_0xe7ac('0x53'),_0x3bc92b[_0xe7ac('0x2f')]);}}}catch(_0x20759a){logger[_0xe7ac('0x34')](_0xe7ac('0x54'),_0x20759a[_0xe7ac('0x37')]);}};module[_0xe7ac('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index d10d237..e0020d8 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0xcc2338,_0x49f684){_0xcc2338=_0xcc2338-0x0;var _0x583fba=_0x2032[_0xcc2338];return _0x583fba;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','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','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x5f87e1,_0x434b22){var _0x5afd19=function(_0x2cc486){while(--_0x2cc486){_0x5f87e1['push'](_0x5f87e1['shift']());}};_0x5afd19(++_0x434b22);}(_0xb10b,0x12a));var _0xbb10=function(_0x2819cd,_0x1f7703){_0x2819cd=_0x2819cd-0x0;var _0x47874c=_0xb10b[_0x2819cd];return _0x47874c;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f6ed6f2..bbb7b52 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x460b85,_0x5278f3){_0x460b85=_0x460b85-0x0;var _0xfba32=_0x9bde[_0x460b85];return _0xfba32;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x5db566,_0x3196d0){var _0x2389b4=function(_0x1536d6){while(--_0x1536d6){_0x5db566['push'](_0x5db566['shift']());}};_0x2389b4(++_0x3196d0);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1e65f8,_0x16bea1){_0x1e65f8=_0x1e65f8-0x0;var _0x252c63=_0xbdb7[_0x1e65f8];return _0x252c63;};'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 72a1be4..60097c7 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 _0xd24e=['ListId','UserId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','substring','dialCutDigit','exports','util','lodash','moment','string','isNil','name','Contact','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','ContactId'];(function(_0x31653a,_0x2d4122){var _0x271209=function(_0x5c1558){while(--_0x5c1558){_0x31653a['push'](_0x31653a['shift']());}};_0x271209(++_0x2d4122);}(_0xd24e,0xc9));var _0xed24=function(_0x344a2b,_0x4166bc){_0x344a2b=_0x344a2b-0x0;var _0x427856=_0xd24e[_0x344a2b];return _0x427856;};'use strict';var util=require(_0xed24('0x0'));var _=require(_0xed24('0x1'));var moment=require(_0xed24('0x2'));function checkNameSurname(_0x255e7c,_0x40d6bb,_0x23ab4c){var _0x3e0ca4='';if(!_['isNil'](_0x40d6bb)&&_0xed24('0x3')===typeof _0x40d6bb){_0x3e0ca4+=_0x40d6bb;}if(!_[_0xed24('0x4')](_0x23ab4c)&&'string'===typeof _0x23ab4c){_0x3e0ca4+='\x20'+_0x23ab4c;}if(_0x3e0ca4!==''){return _0x3e0ca4;}return _0x255e7c;}function Action(_0x2964f0,_0x3b1967,_0x175a7e){this['voiceQueue']=_0x2964f0;this['uniqueid']=_0x175a7e||undefined;this[_0xed24('0x5')]=checkNameSurname(_0x3b1967['Contact']['phone'],_0x3b1967[_0xed24('0x6')]['firstName'],_0x3b1967['Contact']['lastName']);this[_0xed24('0x7')]=_0x3b1967[_0xed24('0x8')];this[_0xed24('0x9')]=_0x2964f0[_0xed24('0x5')];this[_0xed24('0xa')]=_0x3b1967[_0xed24('0xa')]||![];this[_0xed24('0xb')]=_0x2964f0[_0xed24('0xb')];this[_0xed24('0xc')]=_0x2964f0['dialQueueTimeout']||0x3;this['scheduledat']=_0x3b1967[_0xed24('0xd')];this[_0xed24('0xe')]=_0x3b1967[_0xed24('0xe')];this[_0xed24('0xf')]=_0x3b1967[_0xed24('0xf')];this[_0xed24('0x10')]=_0x3b1967[_0xed24('0x10')];this[_0xed24('0x11')]=_0x3b1967[_0xed24('0x11')];this[_0xed24('0x12')]=_0x3b1967[_0xed24('0x12')];this['countabandonedretry']=_0x3b1967['countabandonedretry'];this['countmachineretry']=_0x3b1967['countmachineretry'];this['countagentrejectretry']=_0x3b1967[_0xed24('0x13')];this[_0xed24('0x14')]=_0x3b1967[_0xed24('0x14')];this['ListId']=_0x3b1967[_0xed24('0x15')];this[_0xed24('0x16')]=_0x3b1967['UserId'];this['VoiceQueueId']=_0x3b1967['VoiceQueueId'];this['CampaignId']=_0x3b1967['CampaignId'];this[_0xed24('0x17')]=_0x3b1967['id'];this[_0xed24('0x18')]=_0x3b1967[_0xed24('0x6')][_0xed24('0x19')]||'';this[_0xed24('0x1a')]=moment()['format'](_0xed24('0x1b'));this[_0xed24('0x1c')]=_0x3b1967['callback'];this[_0xed24('0x1d')]=_0x3b1967['callbackuniqueid'];this[_0xed24('0x1e')]=_0x3b1967[_0xed24('0x1e')];this['recallme']=_0x3b1967[_0xed24('0x1f')];this['originatecalleridnum']='';this[_0xed24('0x20')]='';}Action[_0xed24('0x21')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xed24('0x5')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xed24('0x7')][_0xed24('0x22')](this['voiceQueue'][_0xed24('0x23')]):this[_0xed24('0x7')]);};Action[_0xed24('0x21')]['getQueue']=function(){return this[_0xed24('0x9')];};module[_0xed24('0x24')]=Action; \ No newline at end of file +var _0xdc60=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','lodash','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','firstName','starttime'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdc60,0x141));var _0x0dc6=function(_0x1bfb29,_0x1d6359){_0x1bfb29=_0x1bfb29-0x0;var _0x28ff29=_0xdc60[_0x1bfb29];return _0x28ff29;};'use strict';var util=require('util');var _=require(_0x0dc6('0x0'));var moment=require('moment');function checkNameSurname(_0x3aeee5,_0x5e36ef,_0x4d355b){var _0x315fe4='';if(!_[_0x0dc6('0x1')](_0x5e36ef)&&_0x0dc6('0x2')===typeof _0x5e36ef){_0x315fe4+=_0x5e36ef;}if(!_['isNil'](_0x4d355b)&&_0x0dc6('0x2')===typeof _0x4d355b){_0x315fe4+='\x20'+_0x4d355b;}if(_0x315fe4!==''){return _0x315fe4;}return _0x3aeee5;}function Action(_0x2d0e81,_0x3a40a0,_0x3e6b7c){this[_0x0dc6('0x3')]=_0x2d0e81;this[_0x0dc6('0x4')]=_0x3e6b7c||undefined;this['name']=checkNameSurname(_0x3a40a0[_0x0dc6('0x5')][_0x0dc6('0x6')],_0x3a40a0['Contact']['firstName'],_0x3a40a0[_0x0dc6('0x5')][_0x0dc6('0x7')]);this[_0x0dc6('0x8')]=_0x3a40a0[_0x0dc6('0x6')];this[_0x0dc6('0x9')]=_0x2d0e81[_0x0dc6('0xa')];this[_0x0dc6('0xb')]=_0x3a40a0['active']||![];this[_0x0dc6('0xc')]=_0x2d0e81[_0x0dc6('0xc')];this[_0x0dc6('0xd')]=_0x2d0e81[_0x0dc6('0xd')]||0x3;this['scheduledat']=_0x3a40a0[_0x0dc6('0xe')];this[_0x0dc6('0xf')]=_0x3a40a0[_0x0dc6('0xf')];this[_0x0dc6('0x10')]=_0x3a40a0[_0x0dc6('0x10')];this[_0x0dc6('0x11')]=_0x3a40a0[_0x0dc6('0x11')];this[_0x0dc6('0x12')]=_0x3a40a0['countnosuchnumberretry'];this[_0x0dc6('0x13')]=_0x3a40a0[_0x0dc6('0x13')];this[_0x0dc6('0x14')]=_0x3a40a0['countabandonedretry'];this[_0x0dc6('0x15')]=_0x3a40a0[_0x0dc6('0x15')];this['countagentrejectretry']=_0x3a40a0[_0x0dc6('0x16')];this[_0x0dc6('0x17')]=_0x3a40a0[_0x0dc6('0x17')];this[_0x0dc6('0x18')]=_0x3a40a0[_0x0dc6('0x18')];this['UserId']=_0x3a40a0[_0x0dc6('0x19')];this[_0x0dc6('0x1a')]=_0x3a40a0[_0x0dc6('0x1a')];this['CampaignId']=_0x3a40a0['CampaignId'];this[_0x0dc6('0x1b')]=_0x3a40a0['id'];this[_0x0dc6('0x1c')]=_0x3a40a0['Contact'][_0x0dc6('0x1d')]||'';this[_0x0dc6('0x1e')]=moment()['format'](_0x0dc6('0x1f'));this[_0x0dc6('0x20')]=_0x3a40a0[_0x0dc6('0x20')];this['callbackuniqueid']=_0x3a40a0[_0x0dc6('0x21')];this[_0x0dc6('0x22')]=_0x3a40a0['callbackat'];this['recallme']=_0x3a40a0[_0x0dc6('0x23')];this[_0x0dc6('0x24')]='';this['originatecalleridname']='';}Action[_0x0dc6('0x25')][_0x0dc6('0x26')]=function(){return util[_0x0dc6('0x27')](_0x0dc6('0x28'),this[_0x0dc6('0xa')],this[_0x0dc6('0x3')][_0x0dc6('0x29')]>0x0?this[_0x0dc6('0x8')][_0x0dc6('0x2a')](this[_0x0dc6('0x3')]['dialCutDigit']):this[_0x0dc6('0x8')]);};Action[_0x0dc6('0x25')][_0x0dc6('0x2b')]=function(){return this[_0x0dc6('0x9')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index d91d2d0..015896d 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 _0xe31e=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x48f8ae,_0x350a65){var _0x29ad25=function(_0x38ecd2){while(--_0x38ecd2){_0x48f8ae['push'](_0x48f8ae['shift']());}};_0x29ad25(++_0x350a65);}(_0xe31e,0x11a));var _0xee31=function(_0x18a031,_0x4992da){_0x18a031=_0x18a031-0x0;var _0x280154=_0xe31e[_0x18a031];return _0x280154;};'use strict';var util=require(_0xee31('0x0'));var _=require('lodash');var moment=require(_0xee31('0x1'));function getSeconds(_0xba841b,_0x306622){var _0x38740a=moment(_0xba841b)[_0xee31('0x2')](0x0);var _0x568598=moment(_0x306622)[_0xee31('0x2')](0x0);return _0x38740a[_0xee31('0x3')](_0x568598,_0xee31('0x4'));}function AgentComplete(_0x3d2c89,_0x22bde0){this[_0xee31('0x5')]=0x4;this[_0xee31('0x6')]='Answer';this[_0xee31('0x7')]=_0x3d2c89[_0xee31('0x7')];this[_0xee31('0x8')]=_0x3d2c89[_0xee31('0x8')];this['campaigntype']=_0x3d2c89['type']==='outbound'?'queue':_0x3d2c89['type'];this[_0xee31('0x9')]=_0x3d2c89['countbusyretry'];this[_0xee31('0xa')]=_0x3d2c89[_0xee31('0xa')];this[_0xee31('0xb')]=_0x3d2c89[_0xee31('0xb')];this[_0xee31('0xc')]=_0x3d2c89[_0xee31('0x9')]+_0x3d2c89['countcongestionretry']+_0x3d2c89[_0xee31('0xb')]+_0x3d2c89['countnosuchnumberretry']+_0x3d2c89['countdropretry']+_0x3d2c89[_0xee31('0xd')]+_0x3d2c89[_0xee31('0xe')]+_0x3d2c89['countagentrejectretry'];this[_0xee31('0xf')]=_0x3d2c89[_0xee31('0xf')];this[_0xee31('0x10')]=_0x3d2c89[_0xee31('0x10')];this[_0xee31('0xd')]=_0x3d2c89[_0xee31('0xd')];this[_0xee31('0xe')]=_0x3d2c89[_0xee31('0xe')];this['countagentrejectretry']=_0x3d2c89[_0xee31('0x11')];this['uniqueid']=_0x22bde0[_0xee31('0x12')];this[_0xee31('0x13')]=_0x3d2c89[_0xee31('0x14')];this[_0xee31('0x15')]=_0x3d2c89[_0xee31('0x16')];this[_0xee31('0x17')]=_0x3d2c89[_0xee31('0x17')];this[_0xee31('0x18')]=_0x3d2c89[_0xee31('0x18')];this[_0xee31('0x19')]=_0x3d2c89['answertime'];this[_0xee31('0x1a')]=moment()[_0xee31('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xee31('0x1c')]=getSeconds(_0x3d2c89['responsetime'],_0x3d2c89[_0xee31('0x17')]);this[_0xee31('0x1d')]=getSeconds(_0x3d2c89['answertime'],_0x3d2c89[_0xee31('0x18')]);this[_0xee31('0x1e')]=getSeconds(this['endtime'],_0x3d2c89[_0xee31('0x19')]);this[_0xee31('0x1f')]=_0x22bde0[_0xee31('0x1f')];this['membername']=_0x22bde0[_0xee31('0x20')];this[_0xee31('0x21')]=_0x22bde0['reason'];this[_0xee31('0x22')]=_0x3d2c89[_0xee31('0x22')];this['callbackuniqueid']=_0x3d2c89[_0xee31('0x23')];this[_0xee31('0x24')]=_0x3d2c89[_0xee31('0x24')];this[_0xee31('0x25')]=_0x3d2c89['recallme'];this[_0xee31('0x26')]=_0x3d2c89[_0xee31('0x26')];this[_0xee31('0x27')]=_0x3d2c89[_0xee31('0x27')];this[_0xee31('0x28')]=_0x3d2c89['UserId'];this[_0xee31('0x29')]=_0x3d2c89[_0xee31('0x29')];this[_0xee31('0x2a')]=_0x3d2c89[_0xee31('0x2a')];this['originatecalleridnum']=_0x3d2c89[_0xee31('0x2b')]||'';this[_0xee31('0x2c')]=_0x3d2c89['originatecalleridname']||'';}module[_0xee31('0x2d')]=AgentComplete; \ No newline at end of file +var _0xecee=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x5294cc,_0x1095b9){var _0x394fe8=function(_0x31f378){while(--_0x31f378){_0x5294cc['push'](_0x5294cc['shift']());}};_0x394fe8(++_0x1095b9);}(_0xecee,0x89));var _0xeece=function(_0x791cab,_0x417227){_0x791cab=_0x791cab-0x0;var _0x3e6be2=_0xecee[_0x791cab];return _0x3e6be2;};'use strict';var util=require('util');var _=require(_0xeece('0x0'));var moment=require(_0xeece('0x1'));function getSeconds(_0x4f4e96,_0xd78cc9){var _0x4cf2ce=moment(_0x4f4e96)['milliseconds'](0x0);var _0x3a67d4=moment(_0xd78cc9)[_0xeece('0x2')](0x0);return _0x4cf2ce['diff'](_0x3a67d4,'seconds');}function AgentComplete(_0x57ab29,_0xc4d36){this[_0xeece('0x3')]=0x4;this[_0xeece('0x4')]='Answer';this['scheduledat']=_0x57ab29[_0xeece('0x5')];this[_0xeece('0x6')]=_0x57ab29[_0xeece('0x6')];this[_0xeece('0x7')]=_0x57ab29[_0xeece('0x6')]===_0xeece('0x8')?_0xeece('0x9'):_0x57ab29[_0xeece('0x6')];this[_0xeece('0xa')]=_0x57ab29[_0xeece('0xa')];this[_0xeece('0xb')]=_0x57ab29[_0xeece('0xb')];this[_0xeece('0xc')]=_0x57ab29[_0xeece('0xc')];this[_0xeece('0xd')]=_0x57ab29[_0xeece('0xa')]+_0x57ab29[_0xeece('0xb')]+_0x57ab29[_0xeece('0xc')]+_0x57ab29[_0xeece('0xe')]+_0x57ab29[_0xeece('0xf')]+_0x57ab29[_0xeece('0x10')]+_0x57ab29['countmachineretry']+_0x57ab29['countagentrejectretry'];this[_0xeece('0xe')]=_0x57ab29['countnosuchnumberretry'];this['countdropretry']=_0x57ab29['countdropretry'];this[_0xeece('0x10')]=_0x57ab29['countabandonedretry'];this[_0xeece('0x11')]=_0x57ab29['countmachineretry'];this[_0xeece('0x12')]=_0x57ab29[_0xeece('0x12')];this[_0xeece('0x13')]=_0xc4d36['uniqueid'];this['calleridname']=_0x57ab29['name'];this['calleridnum']=_0x57ab29[_0xeece('0x14')];this['starttime']=_0x57ab29[_0xeece('0x15')];this[_0xeece('0x16')]=_0x57ab29[_0xeece('0x16')];this[_0xeece('0x17')]=_0x57ab29[_0xeece('0x17')];this[_0xeece('0x18')]=moment()[_0xeece('0x19')](_0xeece('0x1a'));this[_0xeece('0x1b')]=getSeconds(_0x57ab29[_0xeece('0x16')],_0x57ab29['starttime']);this[_0xeece('0x1c')]=getSeconds(_0x57ab29[_0xeece('0x17')],_0x57ab29[_0xeece('0x16')]);this[_0xeece('0x1d')]=getSeconds(this[_0xeece('0x18')],_0x57ab29[_0xeece('0x17')]);this[_0xeece('0x9')]=_0xc4d36['queue'];this[_0xeece('0x1e')]=_0xc4d36[_0xeece('0x1e')];this[_0xeece('0x1f')]=_0xc4d36[_0xeece('0x1f')];this['callback']=_0x57ab29[_0xeece('0x20')];this[_0xeece('0x21')]=_0x57ab29[_0xeece('0x21')];this['callbackat']=_0x57ab29[_0xeece('0x22')];this[_0xeece('0x23')]=_0x57ab29[_0xeece('0x23')];this[_0xeece('0x24')]=_0x57ab29[_0xeece('0x24')];this[_0xeece('0x25')]=_0x57ab29['ListId'];this['UserId']=_0x57ab29[_0xeece('0x26')];this['VoiceQueueId']=_0x57ab29[_0xeece('0x27')];this[_0xeece('0x28')]=_0x57ab29['CampaignId'];this[_0xeece('0x29')]=_0x57ab29[_0xeece('0x29')]||'';this[_0xeece('0x2a')]=_0x57ab29[_0xeece('0x2a')]||'';}module[_0xeece('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 25346ae..0ba7d16 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 _0x5577=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId'];(function(_0x566399,_0x26428d){var _0x55d295=function(_0x19910e){while(--_0x19910e){_0x566399['push'](_0x566399['shift']());}};_0x55d295(++_0x26428d);}(_0x5577,0x1b4));var _0x7557=function(_0xb1f1a2,_0x5839b9){_0xb1f1a2=_0xb1f1a2-0x0;var _0x40418f=_0x5577[_0xb1f1a2];return _0x40418f;};'use strict';var util=require(_0x7557('0x0'));var _=require('lodash');var moment=require(_0x7557('0x1'));function getSeconds(_0x389954,_0x52a8c6){var _0x34636a=moment(_0x389954)[_0x7557('0x2')](0x0);var _0x25c0da=moment(_0x52a8c6)[_0x7557('0x2')](0x0);return _0x34636a[_0x7557('0x3')](_0x25c0da,_0x7557('0x4'));}function Final(_0x5862e6){this[_0x7557('0x5')]=_0x5862e6[_0x7557('0x5')];this[_0x7557('0x6')]=_0x5862e6[_0x7557('0x6')];this[_0x7557('0x7')]=_0x5862e6[_0x7557('0x7')];this[_0x7557('0x8')]=_0x5862e6[_0x7557('0x7')]===_0x7557('0x9')?_0x7557('0xa'):_0x5862e6[_0x7557('0x7')];this[_0x7557('0xb')]=_0x5862e6[_0x7557('0xb')];this[_0x7557('0xc')]=_0x5862e6[_0x7557('0xc')];this['countnoanswerretry']=_0x5862e6['countnoanswerretry'];this[_0x7557('0xd')]=_0x5862e6[_0x7557('0xb')]+_0x5862e6[_0x7557('0xc')]+_0x5862e6[_0x7557('0xe')]+_0x5862e6[_0x7557('0xf')]+_0x5862e6[_0x7557('0x10')]+_0x5862e6[_0x7557('0x11')]+_0x5862e6[_0x7557('0x12')]+_0x5862e6[_0x7557('0x13')];this[_0x7557('0xf')]=_0x5862e6['countnosuchnumberretry'];this[_0x7557('0x10')]=_0x5862e6[_0x7557('0x10')];this[_0x7557('0x11')]=_0x5862e6['countabandonedretry'];this[_0x7557('0x12')]=_0x5862e6[_0x7557('0x12')];this[_0x7557('0x13')]=_0x5862e6[_0x7557('0x13')];this['queue']=_0x5862e6[_0x7557('0xa')];this[_0x7557('0x14')]=_0x5862e6['calleridname'];this['calleridnum']=_0x5862e6[_0x7557('0x15')];this[_0x7557('0x16')]=_0x5862e6[_0x7557('0x16')];this[_0x7557('0x17')]=_0x5862e6['responsetime'];this[_0x7557('0x18')]=_0x5862e6['responsetime'];this[_0x7557('0x19')]=_0x5862e6[_0x7557('0x19')]||0x0;this[_0x7557('0x1a')]=_0x5862e6[_0x7557('0x1a')]||0x0;this['talktime']=_0x5862e6[_0x7557('0x1b')]||0x0;this[_0x7557('0x1c')]=_0x5862e6[_0x7557('0x1c')];this[_0x7557('0x1d')]=_0x5862e6[_0x7557('0x1d')];this['callbackat']=_0x5862e6['callbackat'];this['recallme']=_0x5862e6[_0x7557('0x1e')];this['ContactId']=_0x5862e6[_0x7557('0x1f')];this[_0x7557('0x20')]=_0x5862e6[_0x7557('0x20')];this[_0x7557('0x21')]=_0x5862e6[_0x7557('0x21')];this[_0x7557('0x22')]=_0x5862e6[_0x7557('0x22')];this['CampaignId']=_0x5862e6[_0x7557('0x23')];this['originatecalleridnum']=_0x5862e6[_0x7557('0x24')]||'';this['originatecalleridname']=_0x5862e6[_0x7557('0x25')]||'';}module[_0x7557('0x26')]=Final; \ No newline at end of file +var _0x1670=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x2c717b,_0x60026e){var _0x1fac02=function(_0x57bb17){while(--_0x57bb17){_0x2c717b['push'](_0x2c717b['shift']());}};_0x1fac02(++_0x60026e);}(_0x1670,0x9a));var _0x0167=function(_0x55f5fa,_0x1d2083){_0x55f5fa=_0x55f5fa-0x0;var _0x3785c0=_0x1670[_0x55f5fa];return _0x3785c0;};'use strict';var util=require(_0x0167('0x0'));var _=require(_0x0167('0x1'));var moment=require('moment');function getSeconds(_0x3a308a,_0x4dc6f6){var _0x1c7a08=moment(_0x3a308a)[_0x0167('0x2')](0x0);var _0x377590=moment(_0x4dc6f6)[_0x0167('0x2')](0x0);return _0x1c7a08['diff'](_0x377590,'seconds');}function Final(_0x8e2217){this[_0x0167('0x3')]=_0x8e2217[_0x0167('0x3')];this[_0x0167('0x4')]=_0x8e2217[_0x0167('0x4')];this[_0x0167('0x5')]=_0x8e2217[_0x0167('0x5')];this[_0x0167('0x6')]=_0x8e2217['type']==='outbound'?_0x0167('0x7'):_0x8e2217[_0x0167('0x5')];this[_0x0167('0x8')]=_0x8e2217[_0x0167('0x8')];this[_0x0167('0x9')]=_0x8e2217[_0x0167('0x9')];this[_0x0167('0xa')]=_0x8e2217[_0x0167('0xa')];this[_0x0167('0xb')]=_0x8e2217[_0x0167('0x8')]+_0x8e2217[_0x0167('0x9')]+_0x8e2217[_0x0167('0xa')]+_0x8e2217[_0x0167('0xc')]+_0x8e2217[_0x0167('0xd')]+_0x8e2217['countabandonedretry']+_0x8e2217[_0x0167('0xe')]+_0x8e2217['countagentrejectretry'];this[_0x0167('0xc')]=_0x8e2217['countnosuchnumberretry'];this[_0x0167('0xd')]=_0x8e2217[_0x0167('0xd')];this[_0x0167('0xf')]=_0x8e2217['countabandonedretry'];this['countmachineretry']=_0x8e2217['countmachineretry'];this[_0x0167('0x10')]=_0x8e2217[_0x0167('0x10')];this['queue']=_0x8e2217[_0x0167('0x7')];this['calleridname']=_0x8e2217['calleridname'];this[_0x0167('0x11')]=_0x8e2217['calleridnum'];this[_0x0167('0x12')]=_0x8e2217['starttime'];this[_0x0167('0x13')]=_0x8e2217[_0x0167('0x13')];this[_0x0167('0x14')]=_0x8e2217[_0x0167('0x13')];this[_0x0167('0x15')]=_0x8e2217[_0x0167('0x15')]||0x0;this[_0x0167('0x16')]=_0x8e2217[_0x0167('0x16')]||0x0;this[_0x0167('0x17')]=_0x8e2217[_0x0167('0x17')]||0x0;this[_0x0167('0x18')]=_0x8e2217[_0x0167('0x18')];this['callbackuniqueid']=_0x8e2217[_0x0167('0x19')];this[_0x0167('0x1a')]=_0x8e2217[_0x0167('0x1a')];this['recallme']=_0x8e2217[_0x0167('0x1b')];this[_0x0167('0x1c')]=_0x8e2217[_0x0167('0x1c')];this[_0x0167('0x1d')]=_0x8e2217['ListId'];this[_0x0167('0x1e')]=_0x8e2217['UserId'];this[_0x0167('0x1f')]=_0x8e2217[_0x0167('0x1f')];this[_0x0167('0x20')]=_0x8e2217[_0x0167('0x20')];this[_0x0167('0x21')]=_0x8e2217[_0x0167('0x21')]||'';this[_0x0167('0x22')]=_0x8e2217['originatecalleridname']||'';}module[_0x0167('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 24ba18d..f0cacef 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 _0x9d39=['format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x307e06,_0x32f986){var _0x4e5ae9=function(_0x348894){while(--_0x348894){_0x307e06['push'](_0x307e06['shift']());}};_0x4e5ae9(++_0x32f986);}(_0x9d39,0x1bc));var _0x99d3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9d39[_0x19950b];return _0x3c6b41;};'use strict';var util=require('util');var _=require(_0x99d3('0x0'));var moment=require('moment');function getSeconds(_0x5e6d56,_0xd3d000){var _0x506b3b=moment(_0x5e6d56)[_0x99d3('0x1')](0x0);var _0x60dba=moment(_0xd3d000)['milliseconds'](0x0);return _0x506b3b[_0x99d3('0x2')](_0x60dba,'seconds');}function Hangup(_0x249911,_0x1a24d2){this['state']=0x4;this['statedesc']=_0x99d3('0x3');this[_0x99d3('0x4')]=_0x249911[_0x99d3('0x4')];this[_0x99d3('0x5')]=_0x249911[_0x99d3('0x5')];this['campaigntype']=_0x249911['type']===_0x99d3('0x6')?_0x99d3('0x7'):_0x249911[_0x99d3('0x5')];this[_0x99d3('0x8')]=_0x249911[_0x99d3('0x8')];this[_0x99d3('0x9')]=_0x249911[_0x99d3('0x9')];this[_0x99d3('0xa')]=_0x249911[_0x99d3('0xa')];this[_0x99d3('0xb')]=_0x249911[_0x99d3('0x8')]+_0x249911[_0x99d3('0x9')]+_0x249911['countnoanswerretry']+_0x249911['countnosuchnumberretry']+_0x249911[_0x99d3('0xc')]+_0x249911[_0x99d3('0xd')]+_0x249911[_0x99d3('0xe')]+_0x249911['countagentrejectretry'];this[_0x99d3('0xf')]=_0x249911['countnosuchnumberretry'];this['countdropretry']=_0x249911[_0x99d3('0xc')];this[_0x99d3('0xd')]=_0x249911['countabandonedretry'];this[_0x99d3('0xe')]=_0x249911[_0x99d3('0xe')];this[_0x99d3('0x10')]=_0x249911['countagentrejectretry'];this[_0x99d3('0x11')]=_0x1a24d2[_0x99d3('0x11')];this['calleridname']=_0x249911[_0x99d3('0x12')];this[_0x99d3('0x13')]=_0x249911[_0x99d3('0x14')];this['starttime']=_0x249911[_0x99d3('0x15')];this['responsetime']=_0x249911[_0x99d3('0x16')];this[_0x99d3('0x17')]=moment()[_0x99d3('0x18')](_0x99d3('0x19'));this['ringtime']=getSeconds(_0x249911[_0x99d3('0x16')],_0x249911[_0x99d3('0x15')]);this['holdtime']=0x0;this[_0x99d3('0x1a')]=getSeconds(this[_0x99d3('0x17')],_0x249911['responsetime']);this[_0x99d3('0x7')]=_0x249911[_0x99d3('0x7')];this[_0x99d3('0x1b')]=_0x99d3('0x1c');this['reason']=_0x1a24d2[_0x99d3('0x1d')];this[_0x99d3('0x1e')]=_0x249911['callback'];this[_0x99d3('0x1f')]=_0x249911[_0x99d3('0x1f')];this['callbackat']=_0x249911[_0x99d3('0x20')];this[_0x99d3('0x21')]=_0x249911[_0x99d3('0x21')];this[_0x99d3('0x22')]=_0x249911[_0x99d3('0x22')];this[_0x99d3('0x23')]=_0x249911[_0x99d3('0x23')];this['UserId']=_0x249911['UserId'];this[_0x99d3('0x24')]=_0x249911[_0x99d3('0x24')];this[_0x99d3('0x25')]=_0x249911[_0x99d3('0x25')];}module[_0x99d3('0x26')]=Hangup; \ No newline at end of file +var _0xe580=['countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','seconds','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x4ed641,_0x48af99){var _0x5318ed=function(_0x5f2ba2){while(--_0x5f2ba2){_0x4ed641['push'](_0x4ed641['shift']());}};_0x5318ed(++_0x48af99);}(_0xe580,0xca));var _0x0e58=function(_0x4d2fcf,_0x4dd8fb){_0x4d2fcf=_0x4d2fcf-0x0;var _0x2b3305=_0xe580[_0x4d2fcf];return _0x2b3305;};'use strict';var util=require('util');var _=require(_0x0e58('0x0'));var moment=require('moment');function getSeconds(_0x1e3333,_0x14b09a){var _0xc16e8a=moment(_0x1e3333)[_0x0e58('0x1')](0x0);var _0x2d0e1b=moment(_0x14b09a)[_0x0e58('0x1')](0x0);return _0xc16e8a['diff'](_0x2d0e1b,_0x0e58('0x2'));}function Hangup(_0x13f1ae,_0x1ed3c4){this['state']=0x4;this[_0x0e58('0x3')]=_0x0e58('0x4');this['scheduledat']=_0x13f1ae['scheduledat'];this[_0x0e58('0x5')]=_0x13f1ae[_0x0e58('0x5')];this[_0x0e58('0x6')]=_0x13f1ae[_0x0e58('0x5')]===_0x0e58('0x7')?_0x0e58('0x8'):_0x13f1ae[_0x0e58('0x5')];this[_0x0e58('0x9')]=_0x13f1ae[_0x0e58('0x9')];this[_0x0e58('0xa')]=_0x13f1ae[_0x0e58('0xa')];this[_0x0e58('0xb')]=_0x13f1ae[_0x0e58('0xb')];this[_0x0e58('0xc')]=_0x13f1ae[_0x0e58('0x9')]+_0x13f1ae[_0x0e58('0xa')]+_0x13f1ae[_0x0e58('0xb')]+_0x13f1ae[_0x0e58('0xd')]+_0x13f1ae[_0x0e58('0xe')]+_0x13f1ae['countabandonedretry']+_0x13f1ae[_0x0e58('0xf')]+_0x13f1ae[_0x0e58('0x10')];this[_0x0e58('0xd')]=_0x13f1ae['countnosuchnumberretry'];this['countdropretry']=_0x13f1ae['countdropretry'];this[_0x0e58('0x11')]=_0x13f1ae[_0x0e58('0x11')];this[_0x0e58('0xf')]=_0x13f1ae[_0x0e58('0xf')];this[_0x0e58('0x10')]=_0x13f1ae[_0x0e58('0x10')];this['uniqueid']=_0x1ed3c4[_0x0e58('0x12')];this[_0x0e58('0x13')]=_0x13f1ae[_0x0e58('0x14')];this[_0x0e58('0x15')]=_0x13f1ae[_0x0e58('0x16')];this[_0x0e58('0x17')]=_0x13f1ae[_0x0e58('0x17')];this['responsetime']=_0x13f1ae[_0x0e58('0x18')];this[_0x0e58('0x19')]=moment()[_0x0e58('0x1a')](_0x0e58('0x1b'));this['ringtime']=getSeconds(_0x13f1ae[_0x0e58('0x18')],_0x13f1ae['starttime']);this['holdtime']=0x0;this[_0x0e58('0x1c')]=getSeconds(this[_0x0e58('0x19')],_0x13f1ae[_0x0e58('0x18')]);this[_0x0e58('0x8')]=_0x13f1ae[_0x0e58('0x8')];this[_0x0e58('0x1d')]=_0x0e58('0x1e');this[_0x0e58('0x1f')]=_0x1ed3c4[_0x0e58('0x20')];this['callback']=_0x13f1ae[_0x0e58('0x21')];this[_0x0e58('0x22')]=_0x13f1ae[_0x0e58('0x22')];this[_0x0e58('0x23')]=_0x13f1ae[_0x0e58('0x23')];this[_0x0e58('0x24')]=_0x13f1ae[_0x0e58('0x24')];this[_0x0e58('0x25')]=_0x13f1ae[_0x0e58('0x25')];this[_0x0e58('0x26')]=_0x13f1ae['ListId'];this[_0x0e58('0x27')]=_0x13f1ae[_0x0e58('0x27')];this[_0x0e58('0x28')]=_0x13f1ae['VoiceQueueId'];this[_0x0e58('0x29')]=_0x13f1ae['CampaignId'];}module[_0x0e58('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b42d19e..9080b59 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 _0x7a3e=['starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number'];(function(_0x152d0b,_0x3eeaad){var _0x4ff3f6=function(_0x34e9d7){while(--_0x34e9d7){_0x152d0b['push'](_0x152d0b['shift']());}};_0x4ff3f6(++_0x3eeaad);}(_0x7a3e,0x65));var _0xe7a3=function(_0x1ca417,_0x2409c3){_0x1ca417=_0x1ca417-0x0;var _0x32cda4=_0x7a3e[_0x1ca417];return _0x32cda4;};'use strict';var util=require(_0xe7a3('0x0'));var _=require(_0xe7a3('0x1'));var moment=require(_0xe7a3('0x2'));function getSeconds(_0x268b84,_0x40768e){var _0x308e7c=moment(_0x268b84)[_0xe7a3('0x3')](0x0);var _0x1cce2c=moment(_0x40768e)[_0xe7a3('0x3')](0x0);return _0x308e7c[_0xe7a3('0x4')](_0x1cce2c,_0xe7a3('0x5'));}function History(_0x2780ae){this[_0xe7a3('0x6')]=_0x2780ae['uniqueid'];this['scheduledat']=_0x2780ae[_0xe7a3('0x7')]||undefined;this[_0xe7a3('0x8')]=_0x2780ae[_0xe7a3('0x8')];this[_0xe7a3('0x9')]=_0x2780ae[_0xe7a3('0x8')]===_0xe7a3('0xa')?_0xe7a3('0xb'):_0x2780ae[_0xe7a3('0x8')];this['countbusyretry']=_0x2780ae['countbusyretry'];this[_0xe7a3('0xc')]=_0x2780ae[_0xe7a3('0xc')];this[_0xe7a3('0xd')]=_0x2780ae['countnoanswerretry'];this[_0xe7a3('0xe')]=_0x2780ae[_0xe7a3('0xf')]+_0x2780ae['countcongestionretry']+_0x2780ae[_0xe7a3('0xd')]+_0x2780ae['countnosuchnumberretry']+_0x2780ae[_0xe7a3('0x10')]+_0x2780ae[_0xe7a3('0x11')]+_0x2780ae[_0xe7a3('0x12')]+_0x2780ae[_0xe7a3('0x13')];this[_0xe7a3('0x14')]=_0x2780ae[_0xe7a3('0x14')];this['countdropretry']=_0x2780ae['countdropretry'];this[_0xe7a3('0x11')]=_0x2780ae[_0xe7a3('0x11')];this[_0xe7a3('0x12')]=_0x2780ae[_0xe7a3('0x12')];this[_0xe7a3('0x13')]=_0x2780ae['countagentrejectretry'];this[_0xe7a3('0xb')]=_0x2780ae[_0xe7a3('0xb')];this[_0xe7a3('0x15')]=_0x2780ae[_0xe7a3('0x16')];this[_0xe7a3('0x17')]=_0x2780ae[_0xe7a3('0x18')];this[_0xe7a3('0x19')]=_0x2780ae[_0xe7a3('0x19')];this[_0xe7a3('0x1a')]=_0x2780ae[_0xe7a3('0x1a')];this[_0xe7a3('0x1b')]=_0x2780ae[_0xe7a3('0x1a')];this[_0xe7a3('0x1c')]=getSeconds(_0x2780ae[_0xe7a3('0x1a')],_0x2780ae[_0xe7a3('0x19')]);this[_0xe7a3('0x1d')]=0x0;this['talktime']=0x0;this[_0xe7a3('0x1e')]=_0x2780ae[_0xe7a3('0x1e')];this[_0xe7a3('0x1f')]=_0x2780ae[_0xe7a3('0x1f')];this[_0xe7a3('0x20')]=_0x2780ae['callbackat'];this[_0xe7a3('0x21')]=_0x2780ae[_0xe7a3('0x21')];this[_0xe7a3('0x22')]=_0x2780ae[_0xe7a3('0x22')];this[_0xe7a3('0x23')]=_0x2780ae[_0xe7a3('0x23')];this[_0xe7a3('0x24')]=_0x2780ae[_0xe7a3('0x24')];this[_0xe7a3('0x25')]=_0x2780ae['VoiceQueueId'];this[_0xe7a3('0x26')]=_0x2780ae[_0xe7a3('0x26')];this[_0xe7a3('0x27')]=_0x2780ae[_0xe7a3('0x27')]||'';this['originatecalleridname']=_0x2780ae[_0xe7a3('0x28')]||'';}module[_0xe7a3('0x29')]=History; \ No newline at end of file +var _0xe8da=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x48d809,_0xfca0f9){var _0x3722f5=function(_0x13cbd3){while(--_0x13cbd3){_0x48d809['push'](_0x48d809['shift']());}};_0x3722f5(++_0xfca0f9);}(_0xe8da,0x97));var _0xae8d=function(_0x5eab4e,_0x5e1e44){_0x5eab4e=_0x5eab4e-0x0;var _0x5535f7=_0xe8da[_0x5eab4e];return _0x5535f7;};'use strict';var util=require(_0xae8d('0x0'));var _=require(_0xae8d('0x1'));var moment=require(_0xae8d('0x2'));function getSeconds(_0x476568,_0xaf929a){var _0x415148=moment(_0x476568)[_0xae8d('0x3')](0x0);var _0x47248f=moment(_0xaf929a)['milliseconds'](0x0);return _0x415148['diff'](_0x47248f,_0xae8d('0x4'));}function History(_0x1f6e58){this[_0xae8d('0x5')]=_0x1f6e58[_0xae8d('0x5')];this[_0xae8d('0x6')]=_0x1f6e58[_0xae8d('0x6')]||undefined;this[_0xae8d('0x7')]=_0x1f6e58[_0xae8d('0x7')];this[_0xae8d('0x8')]=_0x1f6e58[_0xae8d('0x7')]===_0xae8d('0x9')?'queue':_0x1f6e58[_0xae8d('0x7')];this['countbusyretry']=_0x1f6e58[_0xae8d('0xa')];this['countcongestionretry']=_0x1f6e58[_0xae8d('0xb')];this[_0xae8d('0xc')]=_0x1f6e58[_0xae8d('0xc')];this[_0xae8d('0xd')]=_0x1f6e58[_0xae8d('0xa')]+_0x1f6e58[_0xae8d('0xb')]+_0x1f6e58[_0xae8d('0xc')]+_0x1f6e58[_0xae8d('0xe')]+_0x1f6e58[_0xae8d('0xf')]+_0x1f6e58['countabandonedretry']+_0x1f6e58[_0xae8d('0x10')]+_0x1f6e58['countagentrejectretry'];this[_0xae8d('0xe')]=_0x1f6e58[_0xae8d('0xe')];this[_0xae8d('0xf')]=_0x1f6e58[_0xae8d('0xf')];this[_0xae8d('0x11')]=_0x1f6e58[_0xae8d('0x11')];this[_0xae8d('0x10')]=_0x1f6e58[_0xae8d('0x10')];this['countagentrejectretry']=_0x1f6e58[_0xae8d('0x12')];this['queue']=_0x1f6e58[_0xae8d('0x13')];this['calleridname']=_0x1f6e58[_0xae8d('0x14')];this[_0xae8d('0x15')]=_0x1f6e58[_0xae8d('0x16')];this[_0xae8d('0x17')]=_0x1f6e58[_0xae8d('0x17')];this[_0xae8d('0x18')]=_0x1f6e58[_0xae8d('0x18')];this[_0xae8d('0x19')]=_0x1f6e58[_0xae8d('0x18')];this['ringtime']=getSeconds(_0x1f6e58[_0xae8d('0x18')],_0x1f6e58[_0xae8d('0x17')]);this[_0xae8d('0x1a')]=0x0;this[_0xae8d('0x1b')]=0x0;this['callback']=_0x1f6e58[_0xae8d('0x1c')];this['callbackuniqueid']=_0x1f6e58['callbackuniqueid'];this[_0xae8d('0x1d')]=_0x1f6e58[_0xae8d('0x1d')];this[_0xae8d('0x1e')]=_0x1f6e58['recallme'];this[_0xae8d('0x1f')]=_0x1f6e58['ContactId'];this['ListId']=_0x1f6e58[_0xae8d('0x20')];this['UserId']=_0x1f6e58[_0xae8d('0x21')];this[_0xae8d('0x22')]=_0x1f6e58[_0xae8d('0x22')];this[_0xae8d('0x23')]=_0x1f6e58[_0xae8d('0x23')];this[_0xae8d('0x24')]=_0x1f6e58[_0xae8d('0x24')]||'';this[_0xae8d('0x25')]=_0x1f6e58[_0xae8d('0x25')]||'';}module[_0xae8d('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 48b70db..901e98b 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 _0xf2fa=['INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','launchHandleIvr','[syncCampaigns]','pow','replace','random','match','object','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','SIP/%s/%s%s','dialCutDigit','trim','substring','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[getContactCampaign2]','not_inuse','dialOrderByScheduledAt','countReScheduled','emptyContact','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[actionOriginatePredictive]\x20','abandonmentRate','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\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]','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','../rpc/setting','./action','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','Error','stringify','milliseconds','seconds','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangBusyFactor','Trunk','active','format','voice:queue:%s','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\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','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','prototype','resolve','catch','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','Machine','AMD','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countbusyretry','countdropretry','countabandonedretry','minutes','YYYY-MM-DD\x20HH:mm:ss','syncHangup','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','dialDropMaxRetry','queueCallerAbandonCreateState','Drop','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','actionid','strategy','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','rrmemory','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','indexOf','content','true','all'];(function(_0x5c5e3a,_0x5b0ae0){var _0x12e398=function(_0x1294da){while(--_0x1294da){_0x5c5e3a['push'](_0x5c5e3a['shift']());}};_0x12e398(++_0x5b0ae0);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xaf2f('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xaf2f('0x1'));var moment=require(_0xaf2f('0x2'));var rr=require('rr');var md5=require(_0xaf2f('0x3'));var Redis=require(_0xaf2f('0x4'));var ut=require(_0xaf2f('0x5'));var config=require(_0xaf2f('0x6'));var logger=require(_0xaf2f('0x7'))('dialer');var loggerBooked=require('../../../config/logger')(_0xaf2f('0x8'));var loggerPredictive=require('../../../config/logger')(_0xaf2f('0x9'));var loggerPredictiveCalls=require(_0xaf2f('0x7'))(_0xaf2f('0xa'));var loggerSyncQueueSummary=require(_0xaf2f('0x7'))(_0xaf2f('0xb'));var ami=require('../ami');config['redis']=_['defaults'](config[_0xaf2f('0xc')],{'host':_0xaf2f('0xd'),'port':0x18eb});var io=require(_0xaf2f('0xe'))(new Redis(config[_0xaf2f('0xc')]));var cmHopper=require(_0xaf2f('0xf'));var cmHopperHistory=require(_0xaf2f('0x10'));var cmHopperFinal=require(_0xaf2f('0x11'));var cmHopperAdditionalPhone=require(_0xaf2f('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xaf2f('0x13'));var RpcSetting=require(_0xaf2f('0x14'));var Action=require(_0xaf2f('0x15'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xaf2f('0x16'));var Hangup=require(_0xaf2f('0x17'));var ipAgi=process['env'][_0xaf2f('0x18')]||_0xaf2f('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0xaf2f('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xaf2f('0x1b')]=function(_0x30905b){this[_0xaf2f('0x1c')]=this[_0xaf2f('0x1c')]?this[_0xaf2f('0x1c')][_0xaf2f('0x1d')](_0x30905b):_0x30905b();};function Dialer(_0x3c09b5,_0x2a5d4a){this[_0xaf2f('0x1e')]=new Sequence();this[_0xaf2f('0x1f')]=_0x2a5d4a;this['voiceQueues']=_0x3c09b5[_0xaf2f('0x20')];this[_0xaf2f('0x21')]=_0x3c09b5['campaigns'];this['agents']=_0x3c09b5[_0xaf2f('0x22')];this[_0xaf2f('0x23')]=_0x3c09b5['trunks'];this[_0xaf2f('0x24')]=config['maxNumberOriginate']||0x2;this[_0xaf2f('0x25')]={};this['actions']={};this[_0xaf2f('0x26')]={};this[_0xaf2f('0x27')]={};this['optionPredictive']={};this[_0xaf2f('0x28')]={};this[_0xaf2f('0x29')]={};this[_0xaf2f('0x2a')]={};this[_0xaf2f('0x2b')]={};this[_0xaf2f('0x2c')]={};ami['on'](_0xaf2f('0x2d'),this[_0xaf2f('0x2e')][_0xaf2f('0x2f')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xaf2f('0x2f')](this));ami['on'](_0xaf2f('0x30'),this[_0xaf2f('0x31')]['bind'](this));ami['on'](_0xaf2f('0x32'),this[_0xaf2f('0x33')][_0xaf2f('0x2f')](this));ami['on'](_0xaf2f('0x34'),this[_0xaf2f('0xb')][_0xaf2f('0x2f')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xaf2f('0x35'),this['syncHangup']['bind'](this));ami['on'](_0xaf2f('0x36'),this[_0xaf2f('0x37')][_0xaf2f('0x2f')](this));ami['on'](_0xaf2f('0x38'),this[_0xaf2f('0x39')]['bind'](this));ami['on'](_0xaf2f('0x3a'),this[_0xaf2f('0x3b')]['bind'](this));ami['on'](_0xaf2f('0x3c'),this[_0xaf2f('0x3d')]['bind'](this));this[_0xaf2f('0x3e')]();this[_0xaf2f('0x3f')]();RpcSetting[_0xaf2f('0x40')]()[_0xaf2f('0x41')](function(_0x5e1680){previewRecallmeReminderInterval=_0x5e1680[_0xaf2f('0x42')];});}function isNotNull(_0x3a34ff){return _0x3a34ff!==null&&!_['isUndefined'](_0x3a34ff);}function checkIsLoggedIn(_0x4e0968,_0xf9c24c){return function(){if(_0xf9c24c<=0x0){_0x4e0968['message']=_0xaf2f('0x43');throw _0x4e0968[_0xaf2f('0x44')]+_0xaf2f('0x45');}};}function isActive(_0x26471){return _0x26471;}function checkIsActive(_0x1b024a,_0x59c713){return function(){if(!isActive(_0x59c713)){_0x1b024a[_0xaf2f('0x46')]='NOT_ACTIVE';throw _0x1b024a['name']+_0xaf2f('0x47');}};}function checkInterval(_0x4367f1){return function(){if(!isNotNull(_0x4367f1['Interval'])){_0x4367f1['message']=_0xaf2f('0x48');throw _0x4367f1[_0xaf2f('0x44')]+_0xaf2f('0x49');}if(!isNotNull(_0x4367f1[_0xaf2f('0x4a')][_0xaf2f('0x4b')])){_0x4367f1['message']=_0xaf2f('0x48');throw _0x4367f1['name']+_0xaf2f('0x49');}if(!isNotNull(_[_0xaf2f('0x4c')](_0x4367f1[_0xaf2f('0x4a')][_0xaf2f('0x4b')]))){_0x4367f1[_0xaf2f('0x46')]=_0xaf2f('0x48');throw _0x4367f1[_0xaf2f('0x44')]+_0xaf2f('0x49');}};}function msgResponse(_0x4c66ad,_0x5db64e,_0x3e3ca6){return{'action':_0x4c66ad,'response':_0x5db64e,'message':_0x3e3ca6,'stack':_0x3e3ca6};}function myreject(_0x587646){return function(_0x1a2eae){return _0x587646(msgResponse('[ifTime][Action]',_0xaf2f('0x4d'),JSON[_0xaf2f('0x4e')](_0x1a2eae)));};}function getSeconds(_0x5e09a7,_0x2c737){var _0x2f91d7=moment(_0x5e09a7)['milliseconds'](0x0);var _0x18f5c8=moment(_0x2c737)[_0xaf2f('0x4f')](0x0);return _0x2f91d7['diff'](_0x18f5c8,_0xaf2f('0x50'));}function emit(_0x47e363,_0x826bea,_0x5a6abc){io['to'](_0x47e363)['emit'](_0x826bea,_0x5a6abc);}function emitVoiceQueueSummary(_0x5817dc){if(_0x5817dc[_0xaf2f('0x51')]===_0xaf2f('0x52')){var _0x4d0253={'id':_0x5817dc['id'],'name':_0x5817dc[_0xaf2f('0x44')],'strategy':_0x5817dc['strategy'],'answered':_0x5817dc['answered'],'available':_0x5817dc[_0xaf2f('0x53')],'loggedIn':_0x5817dc[_0xaf2f('0x54')],'pTalking':_0x5817dc[_0xaf2f('0x55')],'sumBillable':_0x5817dc[_0xaf2f('0x56')],'sumDuration':_0x5817dc[_0xaf2f('0x57')],'sumHoldTime':_0x5817dc[_0xaf2f('0x58')]||0x0,'talking':_0x5817dc[_0xaf2f('0x59')],'total':_0x5817dc[_0xaf2f('0x5a')],'type':_0x5817dc['type'],'unmanaged':_0x5817dc[_0xaf2f('0x5b')],'abandoned':_0x5817dc[_0xaf2f('0x5c')],'waiting':_0x5817dc[_0xaf2f('0x5d')],'loggedInDb':_0x5817dc[_0xaf2f('0x5e')],'dialActive':_0x5817dc[_0xaf2f('0x5f')],'dialMethod':_0x5817dc['dialMethod'],'dialOriginateCallerIdName':_0x5817dc[_0xaf2f('0x60')],'dialOriginateCallerIdNumber':_0x5817dc[_0xaf2f('0x61')],'dialOriginateTimeout':_0x5817dc[_0xaf2f('0x62')],'dialPrefix':_0x5817dc[_0xaf2f('0x63')],'outboundAnswerAgiCallsDay':_0x5817dc[_0xaf2f('0x64')],'outboundAnswerCallsDay':_0x5817dc['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x5817dc[_0xaf2f('0x65')],'outboundBusyCallsDay':_0x5817dc[_0xaf2f('0x66')],'outboundCongestionCallsDay':_0x5817dc['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5817dc[_0xaf2f('0x67')],'outboundDropCallsDayCallersExit':_0x5817dc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5817dc[_0xaf2f('0x68')],'outboundNoAnswerCallsDay':_0x5817dc[_0xaf2f('0x69')],'outboundNoSuchCallsDay':_0x5817dc['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5817dc[_0xaf2f('0x6a')],'outboundReCallsDay':_0x5817dc[_0xaf2f('0x6b')],'outboundRejectCallsDay':_0x5817dc[_0xaf2f('0x6c')],'outboundUnknownCallsDay':_0x5817dc[_0xaf2f('0x6d')],'predictiveIntervalAnsweredCalls':_0x5817dc['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5817dc['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5817dc[_0xaf2f('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x5817dc[_0xaf2f('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x5817dc[_0xaf2f('0x70')],'predictiveIntervalErlangCalls':_0x5817dc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5817dc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5817dc[_0xaf2f('0x71')],'predictiveIntervalMultiplicativeFactor':_0x5817dc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5817dc[_0xaf2f('0x72')],'predictiveIntervalAvailable':_0x5817dc[_0xaf2f('0x73')],'predictiveIntervalTotalCalls':_0x5817dc['predictiveIntervalTotalCalls'],'message':_0x5817dc[_0xaf2f('0x46')],'originated':_0x5817dc[_0xaf2f('0x74')],'erlangCalls':_0x5817dc[_0xaf2f('0x75')],'erlangCallToSecond':_0x5817dc['erlangCallToSecond'],'erlangAbandonmentRate':_0x5817dc['erlangAbandonmentRate'],'erlangBusyFactor':_0x5817dc[_0xaf2f('0x76')],'startPredictive':_0x5817dc['startPredictive'],'startProgressive':_0x5817dc[_0xaf2f('0x29')]};if(_0x5817dc[_0xaf2f('0x77')]){_0x4d0253['Trunk']={'id':_0x5817dc[_0xaf2f('0x77')]['id'],'name':_0x5817dc[_0xaf2f('0x77')][_0xaf2f('0x44')],'active':_0x5817dc[_0xaf2f('0x77')][_0xaf2f('0x78')],'callerid':_0x5817dc['Trunk']['callerid']};}if(_0x5817dc['Interval']){_0x4d0253[_0xaf2f('0x4a')]={'id':_0x5817dc[_0xaf2f('0x4a')]['id'],'name':_0x5817dc['Interval']['name']};}var _0xe3518=md5(JSON[_0xaf2f('0x4e')](_0x4d0253));if(_0x5817dc[_0xaf2f('0x3')]!==_0xe3518){_0x5817dc[_0xaf2f('0x3')]=_0xe3518;emit(util[_0xaf2f('0x79')](_0xaf2f('0x7a'),_0x4d0253[_0xaf2f('0x44')]),'voice_queue:save',_0x4d0253);}}}function emitCampaignSummary(_0x5dc8f5){if(_0x5dc8f5[_0xaf2f('0x51')]===_0xaf2f('0x7b')){emit(util[_0xaf2f('0x79')](_0xaf2f('0x7c'),_0x5dc8f5['name']),'campaign:save',_0x5dc8f5);}}function checkGetDataPredictive(_0x2c1c3a){if(isNotNull(_0x2c1c3a)&&!_[_0xaf2f('0x4c')](_0x2c1c3a)){loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x7e'));loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x7f'),_0x2c1c3a[_0xaf2f('0x80')]);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x81'),_0x2c1c3a[_0xaf2f('0x82')]);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x83'),_0x2c1c3a[_0xaf2f('0x70')]);loggerPredictive['info'](_0xaf2f('0x84'),_0x2c1c3a[_0xaf2f('0x6f')]);loggerPredictive[_0xaf2f('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c1c3a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x85'),_0x2c1c3a['predictiveIntervalAvgTalktime']);loggerPredictive[_0xaf2f('0x7d')]('---------------------------');if(_0x2c1c3a[_0xaf2f('0x80')]>0x0){if(!_[_0xaf2f('0x86')](_0x2c1c3a[_0xaf2f('0x6e')])&&_0x2c1c3a[_0xaf2f('0x6e')]>0x0){return!![];}loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x87'));if(!_[_0xaf2f('0x86')](_0x2c1c3a['predictiveIntervalAvgHoldtime'])&&_0x2c1c3a[_0xaf2f('0x88')]>0x0){return!![];}loggerPredictive['info'](_0xaf2f('0x89'));}else{loggerPredictive['info'](_0xaf2f('0x8a'));}}else{loggerPredictive[_0xaf2f('0x7d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x521b84){return function(_0x1beebf){loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x8b'));loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x8c'),_0x1beebf[_0xaf2f('0x75')]);loggerPredictive[_0xaf2f('0x7d')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1beebf['erlangCallToSecond']);loggerPredictive[_0xaf2f('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1beebf[_0xaf2f('0x8d')]);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x8e'),_0x1beebf[_0xaf2f('0x76')]);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x8f'),_0x1beebf[_0xaf2f('0x8d')]);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x90'));_[_0xaf2f('0x91')](_0x521b84,_0x1beebf);};}function getDiff(_0x156a5b){var _0x48edbf=moment()[_0xaf2f('0x4f')](0x0);var _0x133660=moment(_0x156a5b)[_0xaf2f('0x4f')](0x0);return _0x48edbf[_0xaf2f('0x92')](_0x133660,_0xaf2f('0x50'));}function ifInterval(_0x49cd0d,_0x18311a){if(_[_0xaf2f('0x86')](_0x18311a)){return![];}return getDiff(_0x18311a)<_0x49cd0d*0x3c;}function freeVariablesPredictive(_0x52121b){if(isNotNull(_0x52121b)){if(!_[_0xaf2f('0x86')](_0x52121b['startProgressive'])){_0x52121b[_0xaf2f('0x29')]=undefined;loggerPredictive['info'](_0x52121b[_0xaf2f('0x44')],_0xaf2f('0x93'));}if(!_[_0xaf2f('0x86')](_0x52121b['startPredictive'])){_0x52121b['startPredictive']=undefined;loggerPredictive[_0xaf2f('0x7d')](_0x52121b[_0xaf2f('0x44')],_0xaf2f('0x94'));}if(!_[_0xaf2f('0x86')](_0x52121b[_0xaf2f('0x95')])){clearInterval(_0x52121b[_0xaf2f('0x95')]);_0x52121b[_0xaf2f('0x95')]=undefined;loggerPredictive[_0xaf2f('0x7d')](_0x52121b['name'],_0xaf2f('0x96'));}}}function erlangb(_0x120d32,_0x53becf){if(_0x53becf===0x0){return 0x0;}var _0x83e10b=0x1;for(var _0x2f3eff=0x1;_0x2f3eff<=_0x53becf;_0x2f3eff+=0x1){_0x83e10b=0x1+_0x83e10b*_0x2f3eff/_0x120d32;}return 0x1/_0x83e10b;}function isVoiceQueueOutbound(_0xd3aafe){return _0xd3aafe===_0xaf2f('0x52');}function isNotPreview(_0x39d4c8){return _0x39d4c8!==_0xaf2f('0x1f');}function isCampaignIvr(_0x571deb){return _0x571deb===_0xaf2f('0x7b');}function getCallerId(_0x2a02e6,_0x37da03,_0x11320e){if(!_['isUndefined'](_0x11320e)&&typeof _0x11320e===_0xaf2f('0x97')&&!_[_0xaf2f('0x4c')](_0x11320e)){if(!_['isUndefined'](_0x37da03)&&typeof _0x37da03===_0xaf2f('0x97')&&!_[_0xaf2f('0x4c')](_0x37da03)){return util[_0xaf2f('0x79')](_0xaf2f('0x98'),_0x37da03,_0x11320e);}return util['format'](_0xaf2f('0x98'),_0x11320e,_0x11320e);}if(!_[_0xaf2f('0x86')](_0x2a02e6)&&typeof _0x2a02e6===_0xaf2f('0x97')&&!_['isEmpty'](_0x2a02e6)){return _0x2a02e6;}return _0xaf2f('0x99');}function loggerCatchQueueSummary(_0x189e3c,_0x5edafd){return function(_0x7b515f){freeVariablesPredictive(_0x5edafd);emitVoiceQueueSummary(_0x5edafd);emitCampaignSummary(_0x5edafd);loggerSyncQueueSummary[_0xaf2f('0x9a')](_0x189e3c,util[_0xaf2f('0x9b')](_0x7b515f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1ce916,_0x160be1){return function(_0x2d12b3){loggerPredictive[_0xaf2f('0x9c')](_0x160be1[_0xaf2f('0x44')],_0x1ce916);loggerPredictive[_0xaf2f('0x9c')](_0x2d12b3[_0xaf2f('0x9d')]);freeVariablesPredictive(_0x160be1);};}function loggerCatch(_0x43609c){return function(_0x3aa62c){logger['error'](_0x43609c,util[_0xaf2f('0x9b')](_0x3aa62c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1945fd){return _0x1945fd&&!_[_0xaf2f('0x86')](_0x1945fd)&&_0x1945fd[_0xaf2f('0x9e')]>0x0;}function decremetOriginate(_0x1ef560){if(!_[_0xaf2f('0x86')](_0x1ef560)&&_0x1ef560!==null){if(typeof _0x1ef560[_0xaf2f('0x74')]!==_0xaf2f('0x9f')){if(_0x1ef560[_0xaf2f('0x74')]>0x0){_0x1ef560[_0xaf2f('0x74')]-=0x1;}else{logger[_0xaf2f('0x9c')](_0xaf2f('0xa0'));}}}else{logger[_0xaf2f('0x9c')](_0xaf2f('0xa1'));}}function checkContactLowerLimitOriginate(_0x4a84d6,_0x4c2a77,_0x566bd2){if(_0x4c2a77>_0x566bd2){for(var _0x3c53d3=0x0;_0x3c53d3<_0x4c2a77-_0x566bd2;_0x3c53d3+=0x1){decremetOriginate(_0x4a84d6);}}}function loggerGetContactDialer(_0x25a06f,_0x40443d,_0x41e72){return function(_0x3ad210){checkContactLowerLimitOriginate(_0x40443d,_0x41e72,0x0);logger[_0xaf2f('0x9c')](_0x25a06f,util[_0xaf2f('0x9b')](_0x3ad210,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x372cb7){return function(_0xab38d8){if(isNotNull(_0xab38d8)&&isNotNull(_0xab38d8[0x0])){if(_0xab38d8[0x0]['contactsRescheduled']>0x0){_0x372cb7[_0xaf2f('0x46')]=_0xaf2f('0xa2');logger['info'](_0xaf2f('0xa3')+_0x372cb7[_0xaf2f('0x44')],_0xab38d8[0x0][_0xaf2f('0xa4')],_0xaf2f('0xa5'));}else{_0x372cb7[_0xaf2f('0x46')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xaf2f('0x7d')](_0xaf2f('0xa6')+_0x372cb7[_0xaf2f('0x44')]);}}};}function notSendMessagesQueue(_0x5b060b){if(_0x5b060b[_0xaf2f('0xa7')]){freeVariablesPredictive(_0x5b060b);if(_0x5b060b['originated']===0x0&&_0x5b060b['talking']===0x0&&_0x5b060b['waiting']===0x0&&(_0x5b060b[_0xaf2f('0x55')]||0x0)===0x0){_0x5b060b[_0xaf2f('0xa7')]=![];_0x5b060b[_0xaf2f('0x53')]=0x0;_0x5b060b[_0xaf2f('0x46')]=_0xaf2f('0xa8');loggerSyncQueueSummary[_0xaf2f('0x9a')](_0xaf2f('0xa9'),_0x5b060b[_0xaf2f('0x44')],'is\x20not\x20active');}else{_0x5b060b[_0xaf2f('0x46')]=_0xaf2f('0xaa');loggerSyncQueueSummary['debug'](_0xaf2f('0xa9'),_0x5b060b[_0xaf2f('0x44')],_0xaf2f('0xab'));}emitVoiceQueueSummary(_0x5b060b);}}function notSendMessagesCampaign(_0x26bf98){if(_0x26bf98[_0xaf2f('0xa7')]){if(_0x26bf98[_0xaf2f('0x74')]===0x0){_0x26bf98[_0xaf2f('0xa7')]=![];_0x26bf98[_0xaf2f('0x46')]=_0xaf2f('0xa8');loggerSyncQueueSummary[_0xaf2f('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x26bf98[_0xaf2f('0x44')],'is\x20not\x20active');}else{_0x26bf98[_0xaf2f('0x46')]=_0xaf2f('0xaa');loggerSyncQueueSummary[_0xaf2f('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x26bf98[_0xaf2f('0x44')],_0xaf2f('0xab'));}emitCampaignSummary(_0x26bf98);}}function createObjHistory(_0x14406b,_0x5633a4,_0x738f41,_0x18cfce,_0x257809){_0x14406b[_0xaf2f('0x46')]=_0x738f41;var _0x4d30c6=new Action(_0x14406b,_0x5633a4);var _0x593c97=new History(_0x4d30c6);_0x593c97[_0xaf2f('0xac')]=_0x18cfce;_0x593c97['statedesc']=_0x257809;_0x593c97[_0xaf2f('0xad')]=_0x4d30c6[_0xaf2f('0xae')];return _0x593c97;}Dialer['prototype'][_0xaf2f('0x3f')]=function(){var _0x13c4ba=this;setInterval(function(){_0x13c4ba[_0xaf2f('0xaf')](_0x13c4ba[_0xaf2f('0x27')],_0xaf2f('0xb0'));_0x13c4ba[_0xaf2f('0xaf')](_0x13c4ba['actions'],_0xaf2f('0xb1'));},0x32c8);};Dialer['prototype'][_0xaf2f('0xaf')]=function(_0x27989d,_0x558695){var _0x3b9245=this;for(var _0x22b17f in _0x27989d){if(typeof _0x27989d[_0x22b17f]!==_0xaf2f('0x9f')){this[_0xaf2f('0x1e')][_0xaf2f('0x1b')](function(){if(!_[_0xaf2f('0xb2')](_0x27989d[_0x22b17f])){return ami['Action']({'action':_0xaf2f('0xb3'),'channel':_0x27989d[_0x22b17f][_0xaf2f('0xb4')]})['catch'](function(_0x1d3807){if(_0x1d3807[_0xaf2f('0x46')]===_0xaf2f('0xb5')){setTimeout(function(){if(_0x27989d[_0x22b17f]&&_0x27989d[_0x22b17f][_0xaf2f('0x51')]!==_0xaf2f('0x7b')){_0x3b9245[_0xaf2f('0xb6')](_0x3b9245[_0xaf2f('0x20')][_0x27989d[_0x22b17f][_0xaf2f('0xb7')]]);logger[_0xaf2f('0x9c')]('[Dialer][checkChannel]',_0x558695,_0x22b17f,_0x27989d[_0x22b17f]['queue']);delete _0x27989d[_0x22b17f];}if(_0x27989d[_0x22b17f]&&_0x27989d[_0x22b17f]['type']===_0xaf2f('0x7b')){_0x3b9245['updateOriginated'](_0x3b9245[_0xaf2f('0x21')][_0x27989d[_0x22b17f][_0xaf2f('0xb7')]]);logger[_0xaf2f('0x9c')]('[Dialer][checkChannel][ivr]',_0x558695,_0x22b17f,_0x27989d[_0x22b17f]['queue']);delete _0x27989d[_0x22b17f];}},0x2328);}});}});}}};Dialer[_0xaf2f('0xb8')]['countReScheduled']=function(_0x34d1b7){return BPromise[_0xaf2f('0xb9')]()['then'](cmHopper['countReScheduled'](_0x34d1b7))[_0xaf2f('0xba')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xbb')]=function(_0x2dba3f){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopperBlack[_0xaf2f('0xbb')](_0x2dba3f))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0xbc')));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xbd')]=function(_0x440f12,_0x1e8c3a,_0x3cdf50){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopperAdditionalPhone[_0xaf2f('0xbd')](_0x440f12,_0x1e8c3a,_0x3cdf50))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0xbe')));};Dialer[_0xaf2f('0xb8')]['swapAdditionalPhones']=function(_0x174a5e,_0x241260,_0x22146f){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopperAdditionalPhone[_0xaf2f('0xbf')](_0x174a5e,_0x241260,_0x22146f))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0xc0')));};Dialer[_0xaf2f('0xb8')]['checkIsBlackListIvr']=function(_0x2aad30){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopperBlack[_0xaf2f('0xc1')](_0x2aad30))['catch'](loggerCatch(_0xaf2f('0xc2')));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xc3')]=function(_0x56e9ab){return BPromise[_0xaf2f('0xb9')]()['then'](cmHopperHistory[_0xaf2f('0xc4')](_0x56e9ab))[_0xaf2f('0xba')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xc5')]=function(_0x395159){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0xc5')](_0x395159))[_0xaf2f('0xba')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xc6')]=function(_0x47fd87,_0x37e8bc,_0x5af316){return BPromise['resolve']()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0xc6')](_0x47fd87,_0x37e8bc,_0x5af316))[_0xaf2f('0xba')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xc7')]=function(_0x376a62,_0x13a523,_0x29cf9f,_0x307278,_0xbc2bee){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0xc7')](_0x376a62,_0x13a523,_0x29cf9f,_0x307278))['catch'](function(_0x3e7b4d){_0xbc2bee['temp']-=_0x29cf9f;_0xbc2bee['temp']=_0xbc2bee['temp']>0x0?_0xbc2bee[_0xaf2f('0xc8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x3e7b4d);});};Dialer[_0xaf2f('0xb8')]['getContactDialerIvr']=function(_0x51f6e3,_0x5ad71b,_0x3d2b57,_0xcf7092){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0xc9')](_0x51f6e3,_0x5ad71b,_0x3d2b57))[_0xaf2f('0xba')](function(_0x33fd1b){_0xcf7092[_0xaf2f('0xc8')]-=_0x5ad71b;_0xcf7092[_0xaf2f('0xc8')]=_0xcf7092[_0xaf2f('0xc8')]>0x0?_0xcf7092[_0xaf2f('0xc8')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x33fd1b);});};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xca')]=function(_0x3a4bb1){return BPromise['resolve']()[_0xaf2f('0x41')](voiceQueueRt[_0xaf2f('0xca')](_0x3a4bb1))['catch'](loggerCatch(_0xaf2f('0xcb')));};Dialer['prototype'][_0xaf2f('0xcc')]=function(_0x235f27){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0xcc')](_0x235f27))[_0xaf2f('0xba')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xaf2f('0xb8')]['createHistory']=function(_0x5da6ca){return BPromise[_0xaf2f('0xb9')]()[_0xaf2f('0x41')](cmHopperHistory[_0xaf2f('0xcd')](_0x5da6ca))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0xce')));};Dialer[_0xaf2f('0xb8')]['updateOriginated']=function(_0x24ee99){if(!_['isUndefined'](_0x24ee99)&&_0x24ee99!==null){if(typeof _0x24ee99[_0xaf2f('0x74')]!==_0xaf2f('0x9f')){if(_0x24ee99[_0xaf2f('0x74')]>0x0){_0x24ee99[_0xaf2f('0x74')]-=0x1;}else{logger['error'](_0xaf2f('0xcf'));}}}else{logger['error'](_0xaf2f('0xd0'));}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xd1')]=function(_0x2ad678,_0xa9c926){var _0x765fbb=this;return function(_0x5ce996){_0x765fbb['updateOriginated'](_0xa9c926);logger['error'](_0x2ad678,util[_0xaf2f('0x9b')](_0x5ce996,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x5328cc,_0x1e0da,_0x3e0567){var _0x209fff={'state':0x19,'statedesc':_0xaf2f('0xd2')};this[_0xaf2f('0xb6')](_0x1e0da);this[_0xaf2f('0xd3')](_['merge'](_0x209fff,_[_0xaf2f('0xd4')](_0x3e0567,[_0xaf2f('0xd5'),_0xaf2f('0xd6'),'UserId',_0xaf2f('0xd7'),_0xaf2f('0xd8')])),_0xaf2f('0xd9'),'[emptyContact]');logger['error'](_0x5328cc);};Dialer['prototype'][_0xaf2f('0xda')]=function(_0x3e0773){return _0x3e0773===_0xaf2f('0xdb');};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xdc')]=function(_0x4a7ad6){return!_[_0xaf2f('0x86')](_0x4a7ad6)&&_0x4a7ad6&&!_[_0xaf2f('0x86')](_0x4a7ad6['name'])&&!_[_0xaf2f('0x86')](_0x4a7ad6[_0xaf2f('0x78')])&&_0x4a7ad6[_0xaf2f('0x78')]&&(this['trunks'][util[_0xaf2f('0x79')](_0xaf2f('0xdd'),_0x4a7ad6[_0xaf2f('0x44')])][_0xaf2f('0xb3')]==='reachable'||this[_0xaf2f('0x23')][util[_0xaf2f('0x79')]('SIP/%s',_0x4a7ad6[_0xaf2f('0x44')])][_0xaf2f('0xb3')]===_0xaf2f('0xde'));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xd3')]=function(_0x47ac13,_0x3681dd,_0x5348d3){this[_0xaf2f('0xcd')](_0x47ac13)['catch'](loggerCatch(_0x3681dd));this[_0xaf2f('0xcc')](_0x47ac13)[_0xaf2f('0xba')](loggerCatch(_0x5348d3));};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x39')]=function(_0x10ca27){var _0x500899=this[_0xaf2f('0x27')][_0x10ca27[_0xaf2f('0xdf')]];var _0x3e3d43;if(!_[_0xaf2f('0xb2')](_0x10ca27)&&!_[_0xaf2f('0xb2')](_0x10ca27[_0xaf2f('0xe0')])&&!_[_0xaf2f('0xb2')](_0x10ca27[_0xaf2f('0xe0')][_0xaf2f('0xe1')])&&_0x10ca27['exten']===_0xaf2f('0xe2')&&_0x500899){if(_0x500899[_0xaf2f('0x51')]!==_0xaf2f('0x7b')&&this[_0xaf2f('0x20')][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0xe3')]&&_0x10ca27[_0xaf2f('0xe4')]===_0xaf2f('0xe5')){delete this[_0xaf2f('0x27')][_0x10ca27[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this['voiceQueues'][_0x500899[_0xaf2f('0xb7')]]);this['voiceQueues'][_0x500899[_0xaf2f('0xb7')]]['outboundAnswerCallsDay']+=0x1;this[_0xaf2f('0x20')][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0x64')]+=0x1;_0x3e3d43=new Hangup(_0x500899,_0x10ca27);_0x3e3d43[_0xaf2f('0xac')]=0x12;_0x3e3d43[_0xaf2f('0xe6')]=_0xaf2f('0xe7');_0x3e3d43[_0xaf2f('0xe8')]='AMD';ami[_0xaf2f('0xe9')](_0xaf2f('0xea'),ut[_0xaf2f('0xeb')](_0x3e3d43,_0xaf2f('0xec')));this[_0xaf2f('0xd3')](_0x3e3d43,_0xaf2f('0xed'),_0xaf2f('0xee'));}if(_0x500899['type']!==_0xaf2f('0x7b')&&this[_0xaf2f('0x20')][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0xe3')]&&_0x10ca27[_0xaf2f('0xe4')]===_0xaf2f('0xef')){var _0x49a4f2=this;return new BPromise(function(_0x2c674d,_0x4731d1){delete _0x49a4f2[_0xaf2f('0x27')][_0x10ca27[_0xaf2f('0xdf')]];_0x49a4f2[_0xaf2f('0xb6')](_0x49a4f2[_0xaf2f('0x20')][_0x500899[_0xaf2f('0xb7')]]);_0x49a4f2['voiceQueues'][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0xf0')]+=0x1;_0x49a4f2['voiceQueues'][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0x64')]+=0x1;var _0x46e1ce=_0x49a4f2[_0xaf2f('0x20')][_0x500899[_0xaf2f('0xb7')]];var _0x379fb6=new Hangup(_0x500899,_0x10ca27);_0x379fb6[_0xaf2f('0xac')]=0x13;_0x379fb6[_0xaf2f('0xe6')]=_0xaf2f('0xf1');_0x379fb6[_0xaf2f('0xe8')]=_0xaf2f('0xf2');_0x379fb6[_0xaf2f('0xf3')]+=0x1;_0x379fb6['countglobal']+=0x1;_0x379fb6['amd']=!![];ami[_0xaf2f('0xe9')](_0xaf2f('0xea'),ut[_0xaf2f('0xeb')](_0x379fb6,_0xaf2f('0xec')));_0x49a4f2[_0xaf2f('0xcd')](_0x379fb6)['catch'](loggerCatch(_0xaf2f('0xf4')));if(_0x379fb6['countbusyretry']+_0x379fb6[_0xaf2f('0xf5')]+_0x379fb6[_0xaf2f('0xf6')]+_0x379fb6[_0xaf2f('0xf7')]+_0x379fb6['countdropretry']+_0x379fb6['countabandonedretry']+_0x379fb6[_0xaf2f('0xf3')]+_0x379fb6[_0xaf2f('0xf8')]>=_0x46e1ce[_0xaf2f('0xf9')]){_0x49a4f2[_0xaf2f('0xfa')](_0x379fb6,_0x2c674d,_0x4731d1,_0xaf2f('0xfb'));}else{if(_0x379fb6['countmachineretry']>=_0x46e1ce[_0xaf2f('0xfc')]){_0x49a4f2['createStateFinal'](_0x379fb6,_0x2c674d,_0x4731d1,_0xaf2f('0xfd'));}else{_0x49a4f2[_0xaf2f('0xc5')]({'active':![],'countmachineretry':_0x379fb6[_0xaf2f('0xf3')],'scheduledat':moment()[_0xaf2f('0xfe')](_0x46e1ce[_0xaf2f('0xff')],'minutes')[_0xaf2f('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x379fb6[_0xaf2f('0xd5')],'ListId':_0x379fb6[_0xaf2f('0xd6')],'VoiceQueueId':_0x379fb6[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x379fb6['CampaignId']||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x100')));_0x2c674d({'reschedule':0x1});}}});}if(_0x500899[_0xaf2f('0x51')]==='ivr'&&this[_0xaf2f('0x21')][_0x500899['queue']][_0xaf2f('0xe3')]&&_0x10ca27[_0xaf2f('0xe4')]===_0xaf2f('0xe5')){delete this[_0xaf2f('0x27')][_0x10ca27[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this['campaigns'][_0x500899[_0xaf2f('0xb7')]]);_0x3e3d43=new Hangup(_0x500899,_0x10ca27);_0x3e3d43[_0xaf2f('0xac')]=0x12;_0x3e3d43['statedesc']=_0xaf2f('0xe7');_0x3e3d43['membername']=_0xaf2f('0xf2');ami['emit'](_0xaf2f('0xea'),ut[_0xaf2f('0xeb')](_0x3e3d43,_0xaf2f('0xec')));this[_0xaf2f('0xd3')](_0x3e3d43,_0xaf2f('0x101'),'[syncHangupInAMDIvr]');}if(_0x500899[_0xaf2f('0x51')]===_0xaf2f('0x7b')&&this[_0xaf2f('0x21')][_0x500899['queue']]['dialAMDActive']&&_0x10ca27['value']===_0xaf2f('0xef')){var _0x49a4f2=this;return new BPromise(function(_0x4f342e,_0x4a06a8){delete _0x49a4f2[_0xaf2f('0x27')][_0x10ca27[_0xaf2f('0xdf')]];_0x49a4f2[_0xaf2f('0xb6')](_0x49a4f2[_0xaf2f('0x21')][_0x500899[_0xaf2f('0xb7')]]);_0x49a4f2['campaigns'][_0x500899['queue']][_0xaf2f('0xf0')]+=0x1;_0x49a4f2[_0xaf2f('0x21')][_0x500899[_0xaf2f('0xb7')]][_0xaf2f('0x64')]+=0x1;var _0x162bfe=_0x49a4f2[_0xaf2f('0x21')][_0x500899['queue']];var _0x123b4a=new Hangup(_0x500899,_0x10ca27);_0x123b4a[_0xaf2f('0xac')]=0x13;_0x123b4a[_0xaf2f('0xe6')]=_0xaf2f('0xf1');_0x123b4a['membername']=_0xaf2f('0xf2');_0x123b4a[_0xaf2f('0xf3')]+=0x1;_0x123b4a['countglobal']+=0x1;_0x123b4a[_0xaf2f('0xec')]=!![];ami['emit'](_0xaf2f('0xea'),ut['buildObj'](_0x123b4a,_0xaf2f('0xec')));_0x49a4f2[_0xaf2f('0xcd')](_0x123b4a)[_0xaf2f('0xba')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x123b4a[_0xaf2f('0x102')]+_0x123b4a[_0xaf2f('0xf5')]+_0x123b4a[_0xaf2f('0xf6')]+_0x123b4a[_0xaf2f('0xf7')]+_0x123b4a[_0xaf2f('0x103')]+_0x123b4a[_0xaf2f('0x104')]+_0x123b4a[_0xaf2f('0xf3')]+_0x123b4a[_0xaf2f('0xf8')]>=_0x162bfe[_0xaf2f('0xf9')]){_0x49a4f2[_0xaf2f('0xfa')](_0x123b4a,_0x4f342e,_0x4a06a8,_0xaf2f('0xfb'));}else{if(_0x123b4a[_0xaf2f('0xf3')]>=_0x162bfe[_0xaf2f('0xfc')]){_0x49a4f2['createStateFinal'](_0x123b4a,_0x4f342e,_0x4a06a8,'reason\x2019\x20machine....');}else{_0x49a4f2[_0xaf2f('0xc5')]({'active':![],'countmachineretry':_0x123b4a[_0xaf2f('0xf3')],'scheduledat':moment()[_0xaf2f('0xfe')](_0x162bfe[_0xaf2f('0xff')],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x123b4a[_0xaf2f('0xd5')],'ListId':_0x123b4a[_0xaf2f('0xd6')],'VoiceQueueId':_0x123b4a['VoiceQueueId']||undefined,'CampaignId':_0x123b4a[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x100')));_0x4f342e({'reschedule':0x1});}}});}}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x107')]=function(_0x2417df){var _0xbdbfce=this[_0xaf2f('0x27')][_0x2417df[_0xaf2f('0xdf')]];var _0xb6f57e=this;var _0x922f5d;if(_0xbdbfce&&_0xbdbfce[_0xaf2f('0x51')]===_0xaf2f('0x7b')){delete this[_0xaf2f('0x27')][_0x2417df[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this['campaigns'][_0xbdbfce[_0xaf2f('0xb7')]]);this['campaigns'][_0xbdbfce[_0xaf2f('0xb7')]]['ivrAnswerCallsDay']+=0x1;_0x922f5d=new Hangup(_0xbdbfce,_0x2417df);this[_0xaf2f('0xcd')](_0x922f5d)['catch'](loggerCatch(_0xaf2f('0x108')));this[_0xaf2f('0xcc')](_0x922f5d)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x109')));}if(_0xbdbfce&&_0xbdbfce[_0xaf2f('0x51')]!=='ivr'&&isNotNull(this[_0xaf2f('0x20')][_0xbdbfce[_0xaf2f('0xb7')]][_0xaf2f('0x10a')])){delete this[_0xaf2f('0x27')][_0x2417df[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this[_0xaf2f('0x20')][_0xbdbfce[_0xaf2f('0xb7')]]);this[_0xaf2f('0x20')][_0xbdbfce['queue']][_0xaf2f('0xf0')]+=0x1;this[_0xaf2f('0x20')][_0xbdbfce['queue']][_0xaf2f('0x64')]+=0x1;_0x922f5d=new Hangup(_0xbdbfce,_0x2417df);_0x922f5d[_0xaf2f('0xac')]=0x10;_0x922f5d[_0xaf2f('0xe6')]='AnswerAGI';_0x922f5d[_0xaf2f('0xe8')]=_0xaf2f('0x10b');this[_0xaf2f('0xcd')](_0x922f5d)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x108')));this['moveContactManagedDialer'](_0x922f5d)[_0xaf2f('0xba')](loggerCatch('[syncHangupIvr]'));}if(_0xbdbfce&&_0xbdbfce[_0xaf2f('0x51')]!==_0xaf2f('0x7b')&&!isNotNull(this['voiceQueues'][_0xbdbfce[_0xaf2f('0xb7')]][_0xaf2f('0x10a')])){delete this[_0xaf2f('0x27')][_0x2417df[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this[_0xaf2f('0x20')][_0xbdbfce[_0xaf2f('0xb7')]]);this[_0xaf2f('0x20')][_0xbdbfce[_0xaf2f('0xb7')]][_0xaf2f('0x6d')]+=0x1;_0x922f5d=new Hangup(_0xbdbfce,_0x2417df);_0x922f5d['state']=0xc;_0x922f5d[_0xaf2f('0xe6')]=_0x2417df[_0xaf2f('0x10c')];_0x922f5d['membername']=_0xaf2f('0x10d');this['createHistory'](_0x922f5d)[_0xaf2f('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xaf2f('0xcc')](_0x922f5d)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x109')));}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x33')]=function(_0x3e6e30){var _0x862bde=this[_0xaf2f('0x27')][_0x3e6e30[_0xaf2f('0xdf')]];var _0x2c3e0d=this;if(this[_0xaf2f('0x20')][_0x3e6e30[_0xaf2f('0xb7')]]){if(_0x862bde&&_0x862bde[_0xaf2f('0x51')]!==_0xaf2f('0x7b')){delete this['uniqueId'][_0x3e6e30[_0xaf2f('0xdf')]];this[_0xaf2f('0x20')][_0x3e6e30[_0xaf2f('0xb7')]][_0xaf2f('0xf0')]+=0x1;var _0xbeeb7b=new AgentComplete(_0x862bde,_0x3e6e30);if(_0x3e6e30[_0xaf2f('0x10e')]==='agent'){_0xbeeb7b[_0xaf2f('0x10f')]=this['voiceQueues'][_0x3e6e30[_0xaf2f('0xb7')]]['dialQueueProject2']&&this[_0xaf2f('0x20')][_0x3e6e30['queue']][_0xaf2f('0x110')]?moment()['format'](_0xaf2f('0x106')):undefined;}this[_0xaf2f('0xcd')](_0xbeeb7b)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x111')));this['moveContactManagedDialer'](_0xbeeb7b)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x112')));}}};Dialer[_0xaf2f('0xb8')]['syncAgentConnect']=function(_0x4f82dd){if(this[_0xaf2f('0x20')][_0x4f82dd[_0xaf2f('0xb7')]]){if(this['uniqueId'][_0x4f82dd[_0xaf2f('0xdf')]]&&this['uniqueId'][_0x4f82dd[_0xaf2f('0xdf')]][_0xaf2f('0x51')]!=='ivr'){this[_0xaf2f('0xb6')](this['voiceQueues'][_0x4f82dd[_0xaf2f('0xb7')]]);this[_0xaf2f('0x27')][_0x4f82dd['uniqueid']]['answertime']=moment()[_0xaf2f('0x79')](_0xaf2f('0x106'));}}};Dialer[_0xaf2f('0xb8')]['queueCallerAbandonCreateState']=function(_0x5467b3,_0x3316f5){this['createHistory'](_0x5467b3)['catch'](loggerCatch(_0xaf2f('0x111')));if(_0x3316f5==0x0){this[_0xaf2f('0xcc')](_0x5467b3)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x113')));}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x114')]=function(_0x53cec1){var _0x5bb6c7=this[_0xaf2f('0x27')][_0x53cec1[_0xaf2f('0xdf')]];var _0x29a01c=this;var _0x1941d6=![];var _0x4ea18f;var _0x1a7969;if(this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]]){if(_0x5bb6c7&&_0x5bb6c7[_0xaf2f('0x51')]!=='ivr'){delete this['uniqueId'][_0x53cec1[_0xaf2f('0xdf')]];this[_0xaf2f('0xb6')](this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]]);_0x5bb6c7[_0xaf2f('0x115')]=moment()[_0xaf2f('0x79')](_0xaf2f('0x106'));var _0x57e38e=new QueueCallerAbandon(_0x5bb6c7,_0x53cec1);if(getSeconds(_0x5bb6c7[_0xaf2f('0x115')],_0x5bb6c7[_0xaf2f('0x116')])>=_0x5bb6c7['dialQueueTimeout']){this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x70')]+=0x1;this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x68')]+=0x1;this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x117')]+=0x1;_0x57e38e[_0xaf2f('0xac')]=0xa;_0x57e38e[_0xaf2f('0xe6')]='Drop';_0x57e38e[_0xaf2f('0x118')]=_0xaf2f('0x119');_0x57e38e['agiafterat']=this[_0xaf2f('0x20')][_0x53cec1['queue']][_0xaf2f('0x11a')]?moment()[_0xaf2f('0x79')](_0xaf2f('0x106')):undefined;_0x57e38e[_0xaf2f('0x103')]+=0x1;_0x57e38e['countglobal']+=0x1;_0x4ea18f=this['voiceQueues'][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x11b')];_0x1a7969=this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x11c')];_0x29a01c[_0xaf2f('0xbd')](_0x57e38e,_0x57e38e['state'],_0x5bb6c7['voiceQueue'])[_0xaf2f('0x41')](function(_0x4d5e9a){_0x1941d6=_0x4d5e9a[_0xaf2f('0x11d')]==0x1;if(_0x57e38e[_0xaf2f('0x103')]>=_0x29a01c[_0xaf2f('0x20')][_0x53cec1['queue']][_0xaf2f('0x11e')]){_0x29a01c[_0xaf2f('0x11f')](_0x57e38e,_0x4d5e9a[_0xaf2f('0x11d')]);}else{_0x29a01c[_0xaf2f('0xc5')]({'active':![],'countdropretry':_0x57e38e['countdropretry'],'scheduledat':moment()[_0xaf2f('0xfe')](_0x29a01c[_0xaf2f('0x20')][_0x53cec1['queue']][_0xaf2f('0x11b')],_0xaf2f('0x105'))['format'](_0xaf2f('0x106')),'ContactId':_0x5bb6c7[_0xaf2f('0xd5')],'ListId':_0x5bb6c7['ListId'],'VoiceQueueId':_0x5bb6c7[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x5bb6c7[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch('[rescheduleContact][Drop]'));var _0x2402d2=new History(_0x57e38e);_0x2402d2[_0xaf2f('0xac')]=0xa;_0x2402d2['statedesc']=_0xaf2f('0x120');_0x2402d2[_0xaf2f('0xae')]=moment()[_0xaf2f('0x79')](_0xaf2f('0x106'));_0x2402d2[_0xaf2f('0xad')]=_0x2402d2['starttime'];_0x2402d2[_0xaf2f('0x121')]=_0x57e38e[_0xaf2f('0x121')];_0x2402d2[_0xaf2f('0x122')]=_0x57e38e[_0xaf2f('0x122')];_0x29a01c[_0xaf2f('0xcd')](_0x2402d2)[_0xaf2f('0xba')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(_0x27ce8a){if(_0x1941d6)_0x29a01c[_0xaf2f('0xbf')](_0x57e38e,_0x4ea18f,_0x1a7969)[_0xaf2f('0x41')](function(_0x545885){return 0x1;});});}else{this[_0xaf2f('0x20')][_0x53cec1['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x123')]+=0x1;_0x57e38e['state']=0xb;_0x57e38e[_0xaf2f('0xe6')]=_0xaf2f('0x124');_0x57e38e[_0xaf2f('0x118')]=_0xaf2f('0x125');_0x57e38e[_0xaf2f('0x104')]+=0x1;_0x57e38e[_0xaf2f('0x126')]+=0x1;_0x4ea18f=this['voiceQueues'][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x127')];_0x1a7969=this[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x11c')];_0x29a01c['verifyAdditionalPhones'](_0x57e38e,_0x57e38e['state'],_0x5bb6c7['voiceQueue'])[_0xaf2f('0x41')](function(_0x2be473){if(_0x57e38e[_0xaf2f('0x104')]>=_0x29a01c[_0xaf2f('0x20')][_0x53cec1[_0xaf2f('0xb7')]]['dialAbandonedMaxRetry']){_0x29a01c[_0xaf2f('0x11f')](_0x57e38e,_0x2be473[_0xaf2f('0x11d')]);}else{_0x29a01c[_0xaf2f('0xc5')]({'active':![],'countabandonedretry':_0x57e38e[_0xaf2f('0x104')],'scheduledat':moment()[_0xaf2f('0xfe')](_0x29a01c['voiceQueues'][_0x53cec1[_0xaf2f('0xb7')]][_0xaf2f('0x127')],_0xaf2f('0x105'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5bb6c7[_0xaf2f('0xd5')],'ListId':_0x5bb6c7[_0xaf2f('0xd6')],'VoiceQueueId':_0x5bb6c7[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x5bb6c7['CampaignId']||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x128')));var _0x45c540=new History(_0x57e38e);_0x45c540[_0xaf2f('0xac')]=0xb;_0x45c540['statedesc']=_0xaf2f('0x124');_0x45c540[_0xaf2f('0xae')]=moment()[_0xaf2f('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x45c540[_0xaf2f('0xad')]=_0x45c540[_0xaf2f('0xae')];_0x45c540[_0xaf2f('0x121')]=_0x57e38e['calleridname'];_0x45c540[_0xaf2f('0x122')]=_0x57e38e[_0xaf2f('0x122')];_0x29a01c[_0xaf2f('0xcd')](_0x45c540)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x129')));}})['then'](function(_0xa2f6f7){if(_0x1941d6)_0x29a01c[_0xaf2f('0xbf')](_0x57e38e,_0x4ea18f,_0x1a7969)[_0xaf2f('0x41')](function(_0x452afb){return 0x1;});});}}}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x37')]=function(_0x49ff1c){if(this[_0xaf2f('0x12a')][_0x49ff1c['uniqueid']]){this[_0xaf2f('0x12a')][_0x49ff1c['uniqueid']]['channel']=_0x49ff1c[_0xaf2f('0xb4')];}if(this[_0xaf2f('0x27')][_0x49ff1c[_0xaf2f('0xdf')]]){this[_0xaf2f('0x27')][_0x49ff1c['uniqueid']][_0xaf2f('0xb4')]=_0x49ff1c['channel'];}};Dialer[_0xaf2f('0xb8')]['syncQueueMember']=function(_0x17c747){if(strategy[this[_0xaf2f('0x20')][this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]][_0xaf2f('0x12c')]]===_0xaf2f('0x1a')){if(this[_0xaf2f('0x12a')][_0x17c747['actionid']]&&_[_0xaf2f('0xb2')](this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]][_0xaf2f('0x12d')])&&_0x17c747[_0xaf2f('0xb3')]==='1'&&_0x17c747[_0xaf2f('0x12e')]==='0'){if(this[_0xaf2f('0x22')][_0x17c747['stateinterface']]){if(!this[_0xaf2f('0x22')][_0x17c747['stateinterface']][_0xaf2f('0x12d')]){this[_0xaf2f('0x22')][_0x17c747[_0xaf2f('0x12f')]][_0xaf2f('0x12d')]=!![];this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]][_0xaf2f('0x12d')]=!![];this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]]['stateinterface']=_0x17c747[_0xaf2f('0x12f')];}}}}else if((strategy[this[_0xaf2f('0x20')][this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]][_0xaf2f('0x12c')]]||'rrmemory')==='rrmemory'){if(this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]]){if(this[_0xaf2f('0x22')][_0x17c747[_0xaf2f('0x12f')]]){this['actions'][_0x17c747['actionid']]['stateinterface']=_0x17c747[_0xaf2f('0x12f')];if(_['isNil'](this[_0xaf2f('0x2b')][this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]])){this[_0xaf2f('0x2b')][this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]]['queue']]=[];}this[_0xaf2f('0x2b')][this['actions'][_0x17c747[_0xaf2f('0x12b')]]['queue']][_0xaf2f('0x130')](_[_0xaf2f('0x91')](_[_0xaf2f('0xd4')](this[_0xaf2f('0x12a')][_0x17c747[_0xaf2f('0x12b')]],[_0xaf2f('0x131'),_0xaf2f('0x12f')]),{'status':_0x17c747[_0xaf2f('0xb3')],'paused':_0x17c747[_0xaf2f('0x12e')]}));}}}};function unlockQueueStatus(_0x4adc99,_0x366bc8){setTimeout(function(){if(_[_0xaf2f('0x86')](_0x4adc99[_0xaf2f('0x132')])){loggerBooked[_0xaf2f('0x9c')](_0xaf2f('0x133'),_0x366bc8);}_0x4adc99['queueStatusComplete']=!![];loggerBooked['info'](_0xaf2f('0x134'),_0x366bc8,JSON[_0xaf2f('0x4e')](_[_0xaf2f('0xd4')](_0x4adc99,[_0xaf2f('0x44'),_0xaf2f('0x132')])));},0x1f3);}Dialer[_0xaf2f('0xb8')][_0xaf2f('0x3d')]=function(_0xe17296){var _0x4da554=this;var _0xc5b69=_0x4da554[_0xaf2f('0x20')][_0x4da554[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]];if(strategy[this[_0xaf2f('0x20')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]][_0xaf2f('0x12c')]]===_0xaf2f('0x1a')){if(this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]]&&this[_0xaf2f('0x12a')][_0xe17296['actionid']][_0xaf2f('0x12f')]){this[_0xaf2f('0x1f')][_0xaf2f('0x135')](this['actions'][_0xe17296['actionid']][_0xaf2f('0x131')],this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0x12f')])['catch'](function(_0x21ba35){logger[_0xaf2f('0x9c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xaf2f('0x9b')](_0x21ba35,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4da554[_0xaf2f('0xb6')](_0x4da554[_0xaf2f('0x20')][_0x4da554[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]]);_0x4da554[_0xaf2f('0x22')][_0x4da554[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]]['stateinterface']][_0xaf2f('0x12d')]=![];delete _0x4da554['actions'][_0xe17296[_0xaf2f('0x12b')]];unlockQueueStatus(_0xc5b69);});}else{this[_0xaf2f('0xb6')](this[_0xaf2f('0x20')][this['actions'][_0xe17296[_0xaf2f('0x12b')]]['queue']]);this[_0xaf2f('0xc5')]({'active':![],'ContactId':this['actions'][_0xe17296[_0xaf2f('0x12b')]]['ContactId'],'ListId':this['actions'][_0xe17296[_0xaf2f('0x12b')]]['ListId'],'VoiceQueueId':this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xd7')]||undefined,'CampaignId':this['actions'][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]];unlockQueueStatus(_0xc5b69);}}else if((strategy[this['voiceQueues'][this[_0xaf2f('0x12a')][_0xe17296['actionid']][_0xaf2f('0xb7')]][_0xaf2f('0x12c')]]||'rrmemory')===_0xaf2f('0x136')){var _0x2a05b0;if(this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]]&&!_['isEmpty'](this[_0xaf2f('0x2b')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]])){if(this[_0xaf2f('0x2c')][_0x4da554[_0xaf2f('0x12a')][_0xe17296['actionid']][_0xaf2f('0xb7')]]){this['queueBookedRR'][_0x4da554[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]]=this[_0xaf2f('0x2c')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]]?this[_0xaf2f('0x2c')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]]:this[_0xaf2f('0x2b')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]]?this[_0xaf2f('0x2b')][this[_0xaf2f('0x12a')][_0xe17296['actionid']][_0xaf2f('0xb7')]][_0xaf2f('0x137')]||0x0:0x0;}this[_0xaf2f('0x2b')][this['actions'][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]][_0xaf2f('0x137')]=this[_0xaf2f('0x2c')][this[_0xaf2f('0x12a')][_0xe17296[_0xaf2f('0x12b')]][_0xaf2f('0xb7')]];for(var _0x42bc1d=0x0;_0x42bc1d=0x0;})['catch'](myreject(_0x44afe1)));}}else{_0x1cc461[_0xaf2f('0x130')](ami[_0xaf2f('0x14e')]({'action':_0xaf2f('0x14f'),'command':util[_0xaf2f('0x79')]('iftime\x20%s,%s',_0x3ea31e,!_['isUndefined'](config['timezones'][_0x20d5d5])?_0x20d5d5:'')})[_0xaf2f('0x41')](function(_0x102e05){return _0x102e05[_0xaf2f('0x153')]['indexOf'](_0xaf2f('0x154'))>=0x0;})[_0xaf2f('0xba')](myreject(_0x44afe1)));}BPromise[_0xaf2f('0x155')](_0x1cc461)[_0xaf2f('0x41')](function(_0x590cfa){var _0x50a9af=_['some'](_0x590cfa);if(_0x50a9af){return _0x1d93e6(_0x50a9af);}else{_0x4be8c2[_0xaf2f('0x46')]=_0x415eeb?'GLOBAL_INTERVAL_IS_OVERTIME':_0xaf2f('0x156');return _0x44afe1(msgResponse(_0xaf2f('0x157'),_0xaf2f('0x149'),_0xaf2f('0x158')+_0x415eeb+'\x20'+_0x5a7539+_0xaf2f('0x159')+util[_0xaf2f('0x9b')](_0x3ea31e,{'showHidden':![],'depth':null})+_0xaf2f('0x15a')+_0x20d5d5));}})[_0xaf2f('0xba')](function(_0x4983bf){return _0x44afe1(msgResponse(_0xaf2f('0x146'),'Failure',JSON[_0xaf2f('0x4e')](_0x4983bf)));});});};Dialer['prototype']['checkDialMethod']=function(_0x38a831){var _0x466e27=this;return function(){switch(_0x38a831[_0xaf2f('0x15b')]){case _0xaf2f('0x15c'):freeVariablesPredictive(_0x38a831);_0x466e27[_0xaf2f('0x15d')](_0x38a831,0x1);break;case _0xaf2f('0x15e'):freeVariablesPredictive(_0x38a831);_0x466e27[_0xaf2f('0x15d')](_0x38a831,_0x38a831[_0xaf2f('0x15f')]);break;case _0xaf2f('0x9'):_0x466e27[_0xaf2f('0x9')](_0x38a831);break;case _0xaf2f('0x8'):freeVariablesPredictive(_0x38a831);_0x466e27[_0xaf2f('0x15d')](_0x38a831,0x1);break;default:freeVariablesPredictive(_0x38a831);logger['error'](_0xaf2f('0x160'),_0x38a831['name'],_0xaf2f('0x161'));}};};Dialer[_0xaf2f('0xb8')]['launchHandleIvr']=function(_0x384fc){var _0xc5997d=this;return function(){_0xc5997d['handleIvr'](_0x384fc);};};Dialer['prototype']['syncQueueSummary']=function(_0x22ae7d){var _0x3dadb9=this;if(isNotPreview(_0x22ae7d[_0xaf2f('0x15b')])){if(isVoiceQueueOutbound(_0x22ae7d['type'])&&isActive(_0x22ae7d['dialActive'])){_0x22ae7d[_0xaf2f('0xa7')]=!![];BPromise['resolve']()[_0xaf2f('0x41')](checkIsLoggedIn(_0x22ae7d,_0x22ae7d['loggedIn']))[_0xaf2f('0x41')](checkIsActive(_0x22ae7d,_0x22ae7d[_0xaf2f('0x5f')]))[_0xaf2f('0x41')](checkInterval(_0x22ae7d))[_0xaf2f('0x41')](_0x3dadb9['checkIsTrunkReachable'](_0x22ae7d))[_0xaf2f('0x41')](_0x3dadb9['checkIfTime'](_0x22ae7d[_0xaf2f('0x162')],_0x22ae7d['dialTimezone'],_0x22ae7d[_0xaf2f('0x44')],_0x22ae7d))[_0xaf2f('0x41')](_0x3dadb9[_0xaf2f('0x147')](_0x22ae7d[_0xaf2f('0x4a')],_0x22ae7d[_0xaf2f('0x163')],_0x22ae7d[_0xaf2f('0x44')],_0x22ae7d))[_0xaf2f('0x41')](_0x3dadb9['checkDialMethod'](_0x22ae7d))['catch'](loggerCatchQueueSummary(_0xaf2f('0x164'),_0x22ae7d));}else{notSendMessagesQueue(_0x22ae7d);}}else{freeVariablesPredictive(_0x22ae7d);}};Dialer['prototype']['syncQueueSummaryComplete']=_['throttle'](function(){var _0x3ee781=_['filter'](this[_0xaf2f('0x20')],function(_0x1b0338){return _0x1b0338[_0xaf2f('0x165')];});var _0x2848e=_['filter'](this['agents'],function(_0x317a91){return _0x317a91[_0xaf2f('0x166')]&&_0x317a91[_0xaf2f('0xb3')]===_0xaf2f('0x167');});if(_0x3ee781[_0xaf2f('0x9e')]>0x0&&_0x2848e[_0xaf2f('0x9e')]>0x0){return BPromise['resolve']()[_0xaf2f('0x41')](cmHopper[_0xaf2f('0x168')](_[_0xaf2f('0x169')](_0x3ee781,'id'),previewRecallmeReminderInterval,_[_0xaf2f('0x169')](_0x2848e,'id')))[_0xaf2f('0x41')](function(_0x3a05c3){for(var _0x2ec0ce=0x0;_0x2ec0ce<_0x3a05c3['length'];_0x2ec0ce++){var _0x16a695=_0x3a05c3[_0x2ec0ce]['Agent']['name'];if(_0x16a695)io['to'](util['format'](_0xaf2f('0x16a'),_0x16a695))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x3a05c3[_0x2ec0ce]});}})[_0xaf2f('0xba')](function(_0x486933){logger['error'](_0xaf2f('0x16b'),_0x486933);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xaf2f('0xb8')][_0xaf2f('0x140')]=function(){var _0x3b743a=this;var _0x1862e5;for(var _0x1ae595 in this[_0xaf2f('0x21')]){if(typeof this[_0xaf2f('0x21')][_0x1ae595]!==_0xaf2f('0x9f')){_0x1862e5=this[_0xaf2f('0x21')][_0x1ae595];if(isCampaignIvr(_0x1862e5[_0xaf2f('0x51')])&&isActive(_0x1862e5['active'])){_0x1862e5[_0xaf2f('0xa7')]=!![];BPromise['resolve']()[_0xaf2f('0x41')](checkIsActive(_0x1862e5,_0x1862e5[_0xaf2f('0x78')]))[_0xaf2f('0x41')](checkInterval(_0x1862e5))[_0xaf2f('0x41')](_0x3b743a[_0xaf2f('0x141')](_0x1862e5))['then'](_0x3b743a[_0xaf2f('0x145')](_0x1862e5[_0xaf2f('0x162')],_0x1862e5[_0xaf2f('0x163')],_0x1862e5[_0xaf2f('0x44')],_0x1862e5))[_0xaf2f('0x41')](_0x3b743a[_0xaf2f('0x147')](_0x1862e5[_0xaf2f('0x4a')],_0x1862e5[_0xaf2f('0x163')],_0x1862e5[_0xaf2f('0x44')],_0x1862e5))[_0xaf2f('0x41')](_0x3b743a[_0xaf2f('0x16c')](_0x1862e5))[_0xaf2f('0xba')](loggerCatchQueueSummary(_0xaf2f('0x16d'),_0x1862e5));}else{notSendMessagesCampaign(_0x1862e5);}}}};function getCallerIdRandom(_0x2d8744,_0x4af3d8){var _0x3b0912;var _0x449c17;var _0x5520f4;if(_0x4af3d8<=0x0){_0x4af3d8=0x1;}_0x3b0912=new RegExp('\x5cw{0,'+_0x4af3d8+'}$');_0x449c17=Math[_0xaf2f('0x16e')](0xa,_0x4af3d8-0x1);_0x5520f4=Math[_0xaf2f('0x16e')](0xa,_0x4af3d8)-0x1;return util[_0xaf2f('0x79')]('%s',_[_0xaf2f('0x16f')](_0x2d8744,_0x3b0912,_[_0xaf2f('0x170')](_0x449c17,_0x5520f4)));}function extractCalleridName(_0xda0580){var _0x245bb1=_0xda0580[_0xaf2f('0x171')](/"(.*?)"/);return _0x245bb1?_0x245bb1[0x1]:_0xda0580;}function extractCalleridNumber(_0x329b0f){var _0x4f9233=_0x329b0f[_0xaf2f('0x171')](/<(.*?)>/);return _0x4f9233?_0x4f9233[0x1]:_0x329b0f;}Dialer['prototype']['actionOriginate']=function(_0x2971c1,_0x51ffce){var _0x5c20d2=this;var _0x5327cf=uuid['v4']();this['actions'][_0x5327cf]=new Action(_0x2971c1,_0x51ffce,_0x5327cf);return new BPromise(function(_0x5474c4,_0x49bd40){if(_[_0xaf2f('0x86')](_0x2971c1)&&typeof _0x2971c1!==_0xaf2f('0x172')){return _0x49bd40(msgResponse(_0xaf2f('0x173'),_0xaf2f('0x149'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x51ffce[_0xaf2f('0x174')])||_0x51ffce[_0xaf2f('0x174')]===null){return _0x49bd40(msgResponse('originate',_0xaf2f('0x149'),_0xaf2f('0x175')));}var _0x180c1e={'XMD-CALLERID':_0x5c20d2[_0xaf2f('0x12a')][_0x5327cf]['getCaller'](),'XMD-AGI':_0x2971c1[_0xaf2f('0x10a')]?util[_0xaf2f('0x79')](_0xaf2f('0x176'),ipAgi,_0x2971c1['dialQueueProject']):_0xaf2f('0x177'),'XMD-AGIAFTER':_0x2971c1['dialQueueProject2']?util[_0xaf2f('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2971c1[_0xaf2f('0x11a')]):_0xaf2f('0x177'),'XMD-QUEUE':_0x2971c1['type']===_0xaf2f('0x52')?util[_0xaf2f('0x79')](_0xaf2f('0x178'),_0x2971c1['name'],_0x2971c1[_0xaf2f('0x179')]||'',_0x2971c1[_0xaf2f('0x110')]?'c':'',_0x2971c1[_0xaf2f('0x17a')]||0x3):_0xaf2f('0x177'),'XMD-CONTACTID':_0x51ffce['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5c20d2[_0xaf2f('0x12a')][_0x5327cf][_0xaf2f('0x17b')](),'XMD-AMD':_0x2971c1[_0xaf2f('0xe3')]?_0xaf2f('0x17c'):_0xaf2f('0x177'),'XMD-DESTINATION':_0xaf2f('0xe2')};if(_0x2971c1['dialAMDActive']){_0x180c1e[_0xaf2f('0x17d')]=_0x2971c1[_0xaf2f('0x17e')]||0x9c4;_0x180c1e[_0xaf2f('0x17f')]=_0x2971c1[_0xaf2f('0x180')]||0x5dc;_0x180c1e[_0xaf2f('0x181')]=_0x2971c1[_0xaf2f('0x182')]||0x320;_0x180c1e[_0xaf2f('0x183')]=_0x2971c1['dialAMDTotalAnalysisTime']||0x1388;_0x180c1e[_0xaf2f('0x184')]=_0x2971c1['dialAMDMinWordLength']||0x64;_0x180c1e[_0xaf2f('0x185')]=_0x2971c1[_0xaf2f('0x186')]||0x32;_0x180c1e[_0xaf2f('0x187')]=_0x2971c1[_0xaf2f('0x188')]||0x3;_0x180c1e[_0xaf2f('0x189')]=_0x2971c1[_0xaf2f('0x18a')]||0x100;_0x180c1e[_0xaf2f('0x18b')]=_0x2971c1[_0xaf2f('0x18c')]||0x1388;}if(_0x2971c1[_0xaf2f('0x51')]==='outbound'){_0x180c1e['XMD-VOICEQUEUEID']=_0x51ffce['VoiceQueueId'];}else{_0x180c1e['XMD-CAMPAIGNID']=_0x51ffce[_0xaf2f('0xd8')];}for(var _0x204e46 in _0x51ffce[_0xaf2f('0x18d')]){if(typeof _0x51ffce[_0xaf2f('0x18d')][_0x204e46]!==_0xaf2f('0x9f')){if(isNotNull(_0x51ffce[_0xaf2f('0x18d')][_0x204e46])&&_0x204e46!=='id'&&_0x204e46!==_0xaf2f('0x18e')&&_0x204e46!==_0xaf2f('0x18f')&&_0x204e46!==_0xaf2f('0x190')){_0x180c1e[util[_0xaf2f('0x79')](_0xaf2f('0x191'),_0xaf2f('0x192'),_[_0xaf2f('0x193')](_0x204e46))]=_0x51ffce['Contact'][_0x204e46];}}}var _0xa6f4ae=_0x5c20d2[_0xaf2f('0xdc')](_0x2971c1[_0xaf2f('0x77')])?getCallerId(_0x2971c1[_0xaf2f('0x77')][_0xaf2f('0x194')],_0x2971c1['dialOriginateCallerIdName'],_0x2971c1['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2971c1[_0xaf2f('0x61')],_0x2971c1[_0xaf2f('0x195')]):_0x2971c1[_0xaf2f('0x61')]):getCallerId(_[_0xaf2f('0xb2')](_0x2971c1[_0xaf2f('0x142')])?_0x2971c1['Trunk'][_0xaf2f('0x194')]:_0x2971c1[_0xaf2f('0x142')][_0xaf2f('0x194')],_0x2971c1[_0xaf2f('0x60')],_0x2971c1[_0xaf2f('0x195')]>0x0?getCallerIdRandom(_0x2971c1[_0xaf2f('0x61')],_0x2971c1[_0xaf2f('0x195')]):_0x2971c1[_0xaf2f('0x61')]);if(_0xa6f4ae){_0x180c1e['XMD-ORIGINATECALLERIDNAME']=_0x5c20d2['actions'][_0x5327cf]['originatecalleridname']=extractCalleridName(_0xa6f4ae);_0x180c1e['XMD-ORIGINATECALLERIDNUM']=_0x51ffce[_0xaf2f('0x174')];}return ami['Action']({'actionid':_0x5327cf,'action':_0xaf2f('0x173'),'channel':_0x5c20d2['isTrunkReachable'](_0x2971c1[_0xaf2f('0x77')])?util[_0xaf2f('0x79')](_0xaf2f('0x196'),_0x2971c1[_0xaf2f('0x77')][_0xaf2f('0x44')],isNotNull(_0x2971c1[_0xaf2f('0x63')])?_0x2971c1['dialPrefix']['trim']()||'':'',_0x2971c1[_0xaf2f('0x197')]>0x0?_0x51ffce[_0xaf2f('0x174')]['substring'](_0x2971c1[_0xaf2f('0x197')]):_0x51ffce[_0xaf2f('0x174')]):util[_0xaf2f('0x79')](_0xaf2f('0x196'),_[_0xaf2f('0xb2')](_0x2971c1[_0xaf2f('0x142')])?_0x2971c1[_0xaf2f('0x77')][_0xaf2f('0x44')]:_0x2971c1[_0xaf2f('0x142')][_0xaf2f('0x44')],isNotNull(_0x2971c1[_0xaf2f('0x63')])?_0x2971c1[_0xaf2f('0x63')][_0xaf2f('0x198')]()||'':'',_0x2971c1[_0xaf2f('0x197')]>0x0?_0x51ffce['phone'][_0xaf2f('0x199')](_0x2971c1[_0xaf2f('0x197')]):_0x51ffce[_0xaf2f('0x174')]),'callerid':_0xa6f4ae,'Exten':_0xaf2f('0xe2'),'Context':'from-sip','Priority':'1','variable':_0x180c1e,'timeout':(_0x2971c1[_0xaf2f('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5327cf})[_0xaf2f('0x41')](function(_0x52285b){return _0x5474c4(_0x52285b);})[_0xaf2f('0xba')](function(_0x156227){_0x2971c1[_0xaf2f('0x6a')]+=0x1;var _0x39d525=new History(_0x5c20d2['actions'][_0x5327cf]);logger[_0xaf2f('0x9c')](util[_0xaf2f('0x79')](_0xaf2f('0x19a'),JSON['stringify'](_0x156227)));_0x39d525[_0xaf2f('0xac')]=0xe;_0x39d525['statedesc']='OriginateError';_0x39d525[_0xaf2f('0xae')]=moment()[_0xaf2f('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x39d525[_0xaf2f('0xad')]=_0x39d525[_0xaf2f('0xae')];_0x5c20d2['createHistory'](_0x39d525)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x19b')));_0x5c20d2['moveContactManagedDialer'](_0x39d525)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x19b')))[_0xaf2f('0x1d')](function(){delete _0x5c20d2[_0xaf2f('0x12a')][_0x5327cf];return _0x49bd40(msgResponse('originate',_0xaf2f('0x4d'),_0xaf2f('0x19c')));});});});};Dialer[_0xaf2f('0xb8')]['syncOriginateResponse']=function(_0x42c482){var _0x3b5fdc=this[_0xaf2f('0x12a')][_0x42c482[_0xaf2f('0x12b')]];if(_0x3b5fdc){delete this[_0xaf2f('0x12a')][_0x42c482[_0xaf2f('0x12b')]];_0x3b5fdc[_0xaf2f('0x116')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1a699b=_0x3b5fdc[_0xaf2f('0x51')]===_0xaf2f('0x7b')?this[_0xaf2f('0x21')][_0x3b5fdc[_0xaf2f('0xb7')]]:this[_0xaf2f('0x20')][_0x3b5fdc['getQueue']()];if(!this[_0xaf2f('0xda')](_0x42c482[_0xaf2f('0x19d')])){this[_0xaf2f('0xb6')](_0x1a699b);return this[_0xaf2f('0x19e')](_0x3b5fdc,_0x1a699b,_0x42c482)[_0xaf2f('0xba')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xaf2f('0x27')][_0x42c482[_0xaf2f('0xdf')]]=_0x3b5fdc;}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x19f')]=function(_0x5a4252,_0x97732b,_0xdaba4){var _0x2e76db=new History(_0x97732b);if(_0x2e76db[_0xaf2f('0x102')]+_0x2e76db[_0xaf2f('0xf5')]+_0x2e76db['countnoanswerretry']+_0x2e76db['countnosuchnumberretry']+_0x2e76db[_0xaf2f('0x103')]+_0x2e76db[_0xaf2f('0x104')]+_0x2e76db['countmachineretry']+_0x2e76db[_0xaf2f('0xf8')]>=_0xdaba4[_0xaf2f('0xf9')]-0x1){return!![];}switch(_0x5a4252){case 0x3:if(_0x2e76db[_0xaf2f('0xf6')]>=_0xdaba4[_0xaf2f('0x1a0')]-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countnoanswerretry':_0x2e76db[_0xaf2f('0xf6')]+=0x1,'scheduledat':moment()['add'](_0xdaba4[_0xaf2f('0x1a1')],'minutes')[_0xaf2f('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2e76db['ContactId'],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x2e76db['CampaignId']||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1a2')));break;case 0x5:if(_0x2e76db['countbusyretry']>=_0xdaba4['dialBusyMaxRetry']-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countbusyretry':_0x2e76db[_0xaf2f('0x102')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4[_0xaf2f('0x1a3')],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x2e76db['ContactId'],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1a4')));break;case 0x8:if(_0x2e76db[_0xaf2f('0xf5')]>=_0xdaba4['dialCongestionMaxRetry']-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countcongestionretry':_0x2e76db['countcongestionretry']+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4[_0xaf2f('0x1a5')],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x2e76db['ContactId'],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db['VoiceQueueId']||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1a6')));break;case 0x0:if(_0x2e76db['countnosuchnumberretry']>=_0xdaba4[_0xaf2f('0x1a7')]-0x1){return!![];}else{this[_0xaf2f('0xc5')]({'active':![],'countnosuchnumberretry':_0x2e76db[_0xaf2f('0xf7')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4[_0xaf2f('0x1a8')],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x2e76db[_0xaf2f('0xd5')],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1a9')));}break;case 0xa:if(_0x2e76db['countdropretry']>=_0xdaba4[_0xaf2f('0x11e')]-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countdropretry':_0x2e76db[_0xaf2f('0x103')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4[_0xaf2f('0x11b')],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x2e76db[_0xaf2f('0xd5')],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db['VoiceQueueId']||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2e76db[_0xaf2f('0x104')]>=_0xdaba4['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countabandonedretry':_0x2e76db[_0xaf2f('0x104')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4[_0xaf2f('0x127')],_0xaf2f('0x105'))['format'](_0xaf2f('0x106')),'ContactId':_0x2e76db[_0xaf2f('0xd5')],'ListId':_0x2e76db['ListId'],'VoiceQueueId':_0x2e76db[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x128')));break;case 0x13:if(_0x2e76db['countmachineretry']>=_0xdaba4[_0xaf2f('0xfc')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x2e76db[_0xaf2f('0xf3')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4['dialMachineRetryFrequency'],_0xaf2f('0x105'))['format'](_0xaf2f('0x106')),'ContactId':_0x2e76db[_0xaf2f('0xd5')],'ListId':_0x2e76db[_0xaf2f('0xd6')],'VoiceQueueId':_0x2e76db[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x2e76db[_0xaf2f('0xd8')]||undefined})['catch'](loggerCatch(_0xaf2f('0x100')));break;case 0x14:if(_0x2e76db[_0xaf2f('0xf8')]>=_0xdaba4[_0xaf2f('0x1aa')]-0x1){return!![];}this[_0xaf2f('0xc5')]({'active':![],'countagentrejectretry':_0x2e76db[_0xaf2f('0xf8')]+=0x1,'scheduledat':moment()[_0xaf2f('0xfe')](_0xdaba4['dialAgentRejectRetryFrequency'],_0xaf2f('0x105'))[_0xaf2f('0x79')](_0xaf2f('0x106')),'ContactId':_0x2e76db[_0xaf2f('0xd5')],'ListId':_0x2e76db['ListId'],'VoiceQueueId':_0x2e76db['VoiceQueueId']||undefined,'CampaignId':_0x2e76db['CampaignId']||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1ab')));break;default:return!![];}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x19e')]=function(_0x214cc0,_0x288319,_0x53cfb3){var _0x17fd8d=this;var _0x7ef878=new History(_0x214cc0);var _0x494cc5=![];var _0x22456d;var _0x283335;return new BPromise(function(_0x30f5ed,_0x50a036){if(_['isUndefined'](_0x288319)&&typeof _0x288319!==_0xaf2f('0x172')){return _0x50a036(msgResponse(_0xaf2f('0x1ac'),_0xaf2f('0x149'),_0xaf2f('0x1ad')));}if(_[_0xaf2f('0x86')](_0x53cfb3)&&typeof _0x53cfb3!==_0xaf2f('0x172')){return _0x50a036(msgResponse(_0xaf2f('0x1ac'),_0xaf2f('0x149'),_0xaf2f('0x1ae')));}_0x17fd8d[_0xaf2f('0xbd')](_0x7ef878,_0x53cfb3['reason'],_0x288319)[_0xaf2f('0x41')](function(_0x2348eb){if(_0x2348eb['additional']==0x1)_0x494cc5=!![];switch(_0x53cfb3[_0xaf2f('0x10e')]){case'0':_0x288319[_0xaf2f('0x1af')]+=0x1;_0x7ef878['state']=0x0;_0x7ef878[_0xaf2f('0xe6')]=_0xaf2f('0x1b0');_0x7ef878[_0xaf2f('0xf7')]+=0x1;_0x7ef878['countglobal']+=0x1;ami[_0xaf2f('0xe9')](_0xaf2f('0x1b1'),ut[_0xaf2f('0xeb')](_0x214cc0,_0xaf2f('0x1b2')));_0x22456d=_0x288319[_0xaf2f('0x1a8')];_0x283335=_0x288319[_0xaf2f('0x11c')];_0x17fd8d['createHistory'](_0x7ef878)['catch'](loggerCatch(_0xaf2f('0xf4')));if(_0x17fd8d[_0xaf2f('0x19f')](0x0,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878['countnosuchnumberretry']>=_0x288319[_0xaf2f('0x1a7')]){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1b4'));}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1b4'));}}break;case'3':_0x288319[_0xaf2f('0x69')]+=0x1;_0x7ef878[_0xaf2f('0xac')]=0x3;_0x7ef878[_0xaf2f('0xe6')]=_0xaf2f('0x1b5');_0x7ef878['countnoanswerretry']+=0x1;_0x7ef878[_0xaf2f('0x126')]+=0x1;ami[_0xaf2f('0xe9')](_0xaf2f('0x1b6'),ut[_0xaf2f('0xeb')](_0x214cc0,_0xaf2f('0x1b7')));_0x22456d=_0x288319['dialNoAnswerRetryFrequency'];_0x283335=_0x288319[_0xaf2f('0x11c')];_0x17fd8d[_0xaf2f('0xcd')](_0x7ef878)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1b8')));if(_0x17fd8d[_0xaf2f('0x19f')](0x3,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0xf6')]>=_0x288319['dialNoAnswerMaxRetry']){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1b9'));}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x288319[_0xaf2f('0x66')]+=0x1;_0x7ef878[_0xaf2f('0xac')]=0x5;_0x7ef878['statedesc']=_0xaf2f('0x1ba');_0x7ef878[_0xaf2f('0x102')]+=0x1;_0x7ef878[_0xaf2f('0x126')]+=0x1;ami['emit'](_0xaf2f('0x1bb'),ut[_0xaf2f('0xeb')](_0x214cc0,'busy'));_0x22456d=_0x288319[_0xaf2f('0x1a3')];_0x283335=_0x288319[_0xaf2f('0x11c')];_0x17fd8d['createHistory'](_0x7ef878)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1bc')));if(_0x17fd8d[_0xaf2f('0x19f')](0x5,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0x102')]>=_0x288319[_0xaf2f('0x1bd')]){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1be'));}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1be'));}}break;case'8':_0x288319[_0xaf2f('0x1bf')]+=0x1;_0x7ef878[_0xaf2f('0xac')]=0x8;_0x7ef878[_0xaf2f('0xe6')]=_0xaf2f('0x1c0');_0x7ef878[_0xaf2f('0xf5')]+=0x1;_0x7ef878['countglobal']+=0x1;_0x22456d=_0x288319[_0xaf2f('0x1a5')];_0x283335=_0x288319[_0xaf2f('0x11c')];ami['emit'](_0xaf2f('0x1c1'),ut[_0xaf2f('0xeb')](_0x214cc0,'congestion'));_0x17fd8d[_0xaf2f('0xcd')](_0x7ef878)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1c2')));if(_0x17fd8d[_0xaf2f('0x19f')](0x8,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0xf5')]>=_0x288319[_0xaf2f('0x1c3')]){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,'reason\x208\x20congestion');}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1c4'));}}break;case'11':_0x288319[_0xaf2f('0x1c5')]+=0x1;_0x7ef878[_0xaf2f('0xac')]=0xb;_0x7ef878[_0xaf2f('0xe6')]=_0xaf2f('0x124');_0x7ef878[_0xaf2f('0x104')]+=0x1;_0x7ef878[_0xaf2f('0x126')]+=0x1;_0x22456d=_0x288319[_0xaf2f('0x127')];_0x283335=_0x288319[_0xaf2f('0x11c')];_0x17fd8d[_0xaf2f('0xcd')](_0x7ef878)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x17fd8d[_0xaf2f('0x19f')](0xb,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0x104')]>=_0x288319[_0xaf2f('0x1c6')]){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1c7'));}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,'reason\x2011\x20abandoned');}}break;case'20':_0x288319['outboundRejectCallsDay']+=0x1;_0x7ef878[_0xaf2f('0xac')]=0x14;_0x7ef878['statedesc']=_0xaf2f('0x1c8');_0x7ef878[_0xaf2f('0xf8')]+=0x1;_0x7ef878[_0xaf2f('0x126')]+=0x1;_0x22456d=_0x288319[_0xaf2f('0x1c9')];_0x283335=_0x288319['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentreject',ut['buildObj'](_0x214cc0,_0xaf2f('0x1ca')));_0x17fd8d[_0xaf2f('0xcd')](_0x7ef878)[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1cb')));if(_0x17fd8d[_0xaf2f('0x19f')](0x14,_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0xf8')]>=_0x288319[_0xaf2f('0x1aa')]){_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0xaf2f('0x1cc'));}else{_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,'reason\x2020\x20agentreject');}}break;default:_0x288319[_0xaf2f('0x6d')]+=0x1;_0x7ef878[_0xaf2f('0xac')]=0xc;_0x7ef878[_0xaf2f('0xe6')]=_0x53cfb3[_0xaf2f('0x10e')];_0x22456d=_0x288319[_0xaf2f('0x1c9')];_0x283335=_0x288319['callAdditionalPhoneAfterMin'];_0x17fd8d[_0xaf2f('0xcd')](_0x7ef878)['catch'](loggerCatch(_0xaf2f('0x1cd')));if(_0x17fd8d[_0xaf2f('0x19f')](_0x53cfb3['reason'],_0x214cc0,_0x288319)&&!_0x494cc5){if(_0x7ef878[_0xaf2f('0x102')]+_0x7ef878['countcongestionretry']+_0x7ef878[_0xaf2f('0xf6')]+_0x7ef878[_0xaf2f('0xf7')]+_0x7ef878[_0xaf2f('0x103')]+_0x7ef878[_0xaf2f('0x104')]+_0x7ef878[_0xaf2f('0xf3')]+_0x7ef878[_0xaf2f('0xf8')]>=_0x288319['dialGlobalMaxRetry']){_0x17fd8d[_0xaf2f('0xfa')](_0x7ef878,_0x30f5ed,_0x50a036,_0x53cfb3[_0xaf2f('0x10e')]);}else{_0x17fd8d[_0xaf2f('0x1b3')](_0x7ef878,_0x30f5ed,_0x50a036,_0x53cfb3[_0xaf2f('0x10e')]);}}}})[_0xaf2f('0x41')](function(_0x31c323){if(_0x494cc5){_0x17fd8d['swapAdditionalPhones'](_0x7ef878,_0x22456d,_0x283335)[_0xaf2f('0x41')](function(_0x5885ca){return _0x30f5ed(0x1);});}});});};Dialer[_0xaf2f('0xb8')][_0xaf2f('0xfa')]=function(_0x4e8822,_0x1b1196,_0xca30d3,_0x5ec041){var _0x3ed420=new Final(_0x4e8822);_0x3ed420[_0xaf2f('0xac')]=0xf;_0x3ed420['statedesc']=_0xaf2f('0x1ce');this[_0xaf2f('0x1b3')](_0x3ed420,_0x1b1196,_0xca30d3,_0x5ec041);};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x1b3')]=function(_0x766651,_0x2f5b3b,_0x392932,_0x5ef235){this[_0xaf2f('0xcc')](_0x766651)[_0xaf2f('0x41')](function(){return _0x2f5b3b(msgResponse(_0xaf2f('0x1ac'),_0xaf2f('0xdb'),_0x5ef235));})[_0xaf2f('0xba')](function(){return _0x392932(msgResponse(_0xaf2f('0x1cf'),_0xaf2f('0x149'),_0xaf2f('0x1d0')));});};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x9')]=function(_0x1935b4){var _0x482cb7=_0x1935b4[_0xaf2f('0x1d1')]/0x64;var _0x6509c2=_0x1935b4['outboundDropCallsDayTimeout']/(_0x1935b4['outboundDropCallsDayTimeout']+_0x1935b4[_0xaf2f('0xf0')]);var _0x52cefd=Math[_0xaf2f('0x1d2')](_0x1935b4['predictiveIntervalAvailable']*(_0x1935b4['predictiveIntervalMaxThreshold']/0x64));var _0x293bac=Math[_0xaf2f('0x1d2')](_0x1935b4['predictiveIntervalAvailable']*(_0x1935b4[_0xaf2f('0x1d3')]/0x64));var _0x47a068=_0x1935b4[_0xaf2f('0x53')]+_0x1935b4['talking'];var _0xdaa987=Math[_0xaf2f('0x1d4')](_0x1935b4[_0xaf2f('0x75')]*_0x1935b4[_0xaf2f('0x8d')]*_0x1935b4['predictiveIntervalHitRate']*_0x1935b4['predictiveIntervalMultiplicativeFactor']);if(_[_0xaf2f('0x86')](_0x1935b4[_0xaf2f('0x29')])){if(!_['isUndefined'](_0x1935b4[_0xaf2f('0x28')])){_0x1935b4[_0xaf2f('0x28')]=undefined;loggerPredictive[_0xaf2f('0x9c')](_0xaf2f('0x1d5'),_0xaf2f('0x1d6'));}if(!_[_0xaf2f('0x86')](_0x1935b4[_0xaf2f('0x95')])){loggerPredictive[_0xaf2f('0x9c')](_0xaf2f('0x1d5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x1935b4['handlePredictive']);_0x1935b4[_0xaf2f('0x95')]=undefined;}_0x1935b4[_0xaf2f('0x29')]=moment()['format'](_0xaf2f('0x106'));loggerPredictive[_0xaf2f('0x7d')](_0x1935b4[_0xaf2f('0x44')],_0xaf2f('0x1d7'),_0x1935b4['startProgressive']);this[_0xaf2f('0x15d')](_0x1935b4,0x1);}else if(ifInterval(_0x1935b4[_0xaf2f('0x1d8')],_0x1935b4[_0xaf2f('0x29')])){this['handlePower'](_0x1935b4,0x1);loggerPredictiveCalls[_0xaf2f('0x7d')]('[startMethodPredictive][StartProgressive][Loop]',_0x1935b4[_0xaf2f('0x29')],_0x1935b4[_0xaf2f('0x44')]);_0x1935b4[_0xaf2f('0x75')]=0x0;_0x1935b4['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x482cb7<_0x6509c2&&_0x1935b4['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x1935b4);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x1d9'),_0xaf2f('0x1da'),_0x6509c2,_0xaf2f('0x29'),_0x1935b4[_0xaf2f('0x44')]);}else if(_0xdaa987<_0x1935b4['predictiveIntervalErlangCallsDroppedCalls']&&_0x1935b4[_0xaf2f('0x1db')]===_0xaf2f('0x1dc')){freeVariablesPredictive(_0x1935b4);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x1dd'),_0xaf2f('0x1de'),_0xdaa987,_0xaf2f('0x1df'),_0x1935b4[_0xaf2f('0x117')],_0xaf2f('0x29'),_0x1935b4[_0xaf2f('0x44')]);}else if(!ifInterval(_0x1935b4[_0xaf2f('0x1d8')],_0x1935b4[_0xaf2f('0x29')])&&_[_0xaf2f('0x86')](_0x1935b4[_0xaf2f('0x28')])&&!_['isUndefined'](_0x1935b4[_0xaf2f('0x29')])){_0x1935b4[_0xaf2f('0x28')]=moment()[_0xaf2f('0x79')](_0xaf2f('0x106'));loggerPredictive[_0xaf2f('0x7d')](_0x1935b4[_0xaf2f('0x44')],_0xaf2f('0x1e0'),_0x1935b4[_0xaf2f('0x28')]);this[_0xaf2f('0xc3')](_0x1935b4[_0xaf2f('0x1d8')])[_0xaf2f('0x41')](this[_0xaf2f('0x1e1')](_0x1935b4))[_0xaf2f('0x41')](mergeDataErlangB(_0x1935b4))[_0xaf2f('0x41')](this[_0xaf2f('0x1e2')](_0x1935b4))[_0xaf2f('0xba')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1935b4));}else if(!ifInterval(_0x1935b4[_0xaf2f('0x1d8')],_0x1935b4[_0xaf2f('0x28')])){_0x1935b4['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1935b4[_0xaf2f('0x28')]=moment()[_0xaf2f('0x79')](_0xaf2f('0x106'));loggerPredictive[_0xaf2f('0x7d')](_0x1935b4['name'],'recalculate\x20predictive\x20at',_0x1935b4[_0xaf2f('0x28')]);clearInterval(_0x1935b4['handlePredictive']);_0x1935b4['handlePredictive']=undefined;this['averageHandleTime'](_0x1935b4['dialPredictiveInterval'])[_0xaf2f('0x41')](this[_0xaf2f('0x1e1')](_0x1935b4))[_0xaf2f('0x41')](mergeDataErlangB(_0x1935b4))[_0xaf2f('0x41')](this[_0xaf2f('0x1e2')](_0x1935b4))[_0xaf2f('0xba')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1935b4));}else if(_0x1935b4[_0xaf2f('0x73')]&&_0x47a068<_0x1935b4[_0xaf2f('0x73')]-_0x293bac){freeVariablesPredictive(_0x1935b4);loggerPredictive['info'](_0x1935b4[_0xaf2f('0x44')],_0xaf2f('0x1e3'),_0x47a068,')\x20are\x20less\x20than\x20threshold\x20(',_0x1935b4[_0xaf2f('0x73')],'-',_0x293bac,'=',_0x1935b4['predictiveIntervalAvailable']-_0x293bac,')');}else if(_0x1935b4[_0xaf2f('0x73')]&&_0x47a068>_0x1935b4['predictiveIntervalAvailable']+_0x52cefd){freeVariablesPredictive(_0x1935b4);loggerPredictive[_0xaf2f('0x7d')](_0x1935b4[_0xaf2f('0x44')],_0xaf2f('0x1e3'),_0x47a068,_0xaf2f('0x1e4'),_0x1935b4[_0xaf2f('0x73')],'+',_0x52cefd,'=',_0x1935b4['predictiveIntervalAvailable']+_0x52cefd,')');}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x1e1')]=function(_0x19503f){var _0x4e30f8=this;return function(_0x8b132b){return new BPromise(function(_0x408ed4,_0x32a339){_[_0xaf2f('0x91')](_0x19503f,_0x8b132b[0x0]);if(checkGetDataPredictive(_0x8b132b[0x0])){var _0x2282f8=_0x19503f['predictiveIntervalAvailable']=_0x19503f[_0xaf2f('0x59')]+_0x19503f[_0xaf2f('0x53')];var _0x5239e2=_0x19503f[_0xaf2f('0x1d8')]*0x3c;var _0x357733=_0x8b132b[0x0][_0xaf2f('0x6e')]+_0x8b132b[0x0][_0xaf2f('0x88')];var _0xa22b5e=(_0x8b132b[0x0][_0xaf2f('0x82')]+_0x8b132b[0x0][_0xaf2f('0x70')]+_0x8b132b[0x0][_0xaf2f('0x6f')])/_0x8b132b[0x0][_0xaf2f('0x80')];_0x19503f[_0xaf2f('0x71')]=_0xa22b5e>0x0?_0xa22b5e:0x1;switch(_0x19503f['dialPredictiveOptimization']){case'dropRate':var _0x12655c=_0x19503f[_0xaf2f('0x1d1')]/0x64;return _0x4e30f8['abandonmentRate'](_0x2282f8,_0x5239e2,_0x357733,_0xa22b5e,_0x12655c)[_0xaf2f('0x41')](function(_0x15b28f){return _0x408ed4(_0x15b28f);});case _0xaf2f('0x1e5'):var _0x14682e=_0x19503f[_0xaf2f('0x1d1')]/0x64;return _0x4e30f8[_0xaf2f('0x1e6')](_0x2282f8,_0x5239e2,_0x357733,_0xa22b5e,_0x14682e)[_0xaf2f('0x41')](function(_0x4ba2b4){return _0x408ed4(_0x4ba2b4);});default:return _0x32a339(msgResponse(_0xaf2f('0x1e7'),_0xaf2f('0x149'),_0xaf2f('0x1e8')));}}else{return _0x32a339(msgResponse(_0xaf2f('0x1e7'),_0xaf2f('0x149'),'check\x20failure'));}});};};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x1e9')]=function(_0x2e335c){var _0x2b3459=this;return function(_0x5841f9){return new BPromise(function(_0x293a2b,_0x571159){_[_0xaf2f('0x91')](_0x2e335c,_0x5841f9[0x0]);if(checkGetDataPredictive(_0x5841f9[0x0])){loggerPredictive[_0xaf2f('0x7d')](JSON['stringify'](_0x5841f9[0x0]));if(_0x2e335c[_0xaf2f('0x1db')]===_0xaf2f('0x1dc')){return _0x2b3459[_0xaf2f('0xca')](_0x2e335c['id'])['then'](function(_0x8df104){var _0x2ec366=_0x2e335c['loggedIn']-_0x8df104[0x0][_0xaf2f('0x1ea')];var _0x206310=_0x2e335c['dialPredictiveInterval']*0x3c;var _0x4299f2=_0x5841f9[0x0][_0xaf2f('0x6e')]+_0x5841f9[0x0]['predictiveIntervalAvgHoldtime'];var _0x2c38d9=(_0x5841f9[0x0][_0xaf2f('0x82')]+_0x5841f9[0x0][_0xaf2f('0x70')]+_0x5841f9[0x0][_0xaf2f('0x6f')])/_0x5841f9[0x0][_0xaf2f('0x80')];var _0x342e95=_0x2e335c[_0xaf2f('0x1d1')]/0x64;_0x2e335c[_0xaf2f('0x72')]=_0x8df104[0x0][_0xaf2f('0x1ea')]||0x0;_0x2e335c['predictiveIntervalHitRate']=_0x2c38d9>0x0?_0x2c38d9:0x1;return _0x2b3459['abandonmentRate'](_0x2ec366,_0x206310,_0x4299f2,_0x2c38d9,_0x342e95);})[_0xaf2f('0x41')](function(_0x30758e){return _0x293a2b(_0x30758e);})[_0xaf2f('0xba')](function(_0x4eb025){return _0x571159(msgResponse(_0xaf2f('0x1eb'),_0xaf2f('0x149'),JSON[_0xaf2f('0x4e')](_0x4eb025)));});}if(_0x2e335c['dialPredictiveOptimization']===_0xaf2f('0x1e5')){return _0x2b3459['getVoiceQueueRtPauses'](_0x2e335c['id'])['then'](function(_0x5bc3bf){var _0x446c25=_0x2e335c[_0xaf2f('0x54')]-_0x5bc3bf[0x0]['outboundQueuePauses'];var _0xcae3c7=_0x2e335c[_0xaf2f('0x1d8')]*0x3c;var _0x4b6a43=_0x5841f9[0x0][_0xaf2f('0x6e')]+_0x5841f9[0x0][_0xaf2f('0x88')];var _0x31be92=(_0x5841f9[0x0]['predictiveIntervalAnsweredCalls']+_0x5841f9[0x0][_0xaf2f('0x70')]+_0x5841f9[0x0][_0xaf2f('0x6f')])/_0x5841f9[0x0]['predictiveIntervalTotalCalls'];var _0x429329=_0x2e335c[_0xaf2f('0x1d1')]/0x64;_0x2e335c[_0xaf2f('0x72')]=_0x5bc3bf[0x0]['outboundQueuePauses']||0x0;_0x2e335c[_0xaf2f('0x71')]=_0x31be92>0x0?_0x31be92:0x1;return _0x2b3459[_0xaf2f('0x1e6')](_0x446c25,_0xcae3c7,_0x4b6a43,_0x31be92,_0x429329);})['then'](function(_0x339137){return _0x293a2b(_0x339137);})[_0xaf2f('0xba')](function(_0x196273){return _0x571159(msgResponse(_0xaf2f('0x1eb'),_0xaf2f('0x149'),JSON[_0xaf2f('0x4e')](_0x196273)));});}}else{return _0x571159(msgResponse(_0xaf2f('0x1e7'),_0xaf2f('0x149'),_0xaf2f('0x1ec')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x2566bb){var _0xadca9f=this;return function(){var _0xe7c802=0x0;var _0x5a6d5d=Math[_0xaf2f('0x1d4')](_0x2566bb[_0xaf2f('0x1ed')]*0x3e8);if(_0x5a6d5d>0x0){_0x5a6d5d=_0x5a6d5d<0x64?0x64:_0x5a6d5d;loggerPredictive['info'](_0x2566bb[_0xaf2f('0x44')],_0xaf2f('0x1ee'),_0x5a6d5d,_0xaf2f('0x4f'));_0x2566bb[_0xaf2f('0x95')]=setInterval(function(){_0xadca9f[_0xaf2f('0x95')](_0x2566bb);loggerPredictiveCalls[_0xaf2f('0x7d')](_0xaf2f('0x1ef'),_0xe7c802+=0x1);},_0x5a6d5d);}else{loggerPredictive[_0xaf2f('0x7d')](_0x2566bb[_0xaf2f('0x44')],_0xaf2f('0x1f0'));}};};Dialer['prototype']['checkContactBlack']=function(_0x420b61,_0x3a1910){var _0x5c120c=this;return function(_0x1a1ea9){if(_[_0xaf2f('0x4c')](_0x1a1ea9)){if(_[_0xaf2f('0xb2')](_0x3a1910[_0xaf2f('0x1f1')])||!_0x3a1910['recallme']){if(_0x420b61['dialMethod']===_0xaf2f('0x8')){_0x420b61[_0xaf2f('0x132')]=_[_0xaf2f('0x86')](_0x420b61[_0xaf2f('0x132')])?!![]:_0x420b61['queueStatusComplete'];var _0x1208d2=uuid['v4']();_0x5c120c[_0xaf2f('0x12a')][_0x1208d2]=new Action(_0x420b61,_0x3a1910,_0x1208d2);loggerBooked[_0xaf2f('0x7d')](_0xaf2f('0x1f2'),_0x1208d2,_0xaf2f('0x1f3'),JSON['stringify'](_0x420b61['queueStatusComplete']),_0xaf2f('0x1f4'),_0x420b61[_0xaf2f('0x44')]);if(_0x420b61['queueStatusComplete']){_0x420b61[_0xaf2f('0x132')]=![];_0x5c120c[_0xaf2f('0x2b')][_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xb7')]]=[];ami[_0xaf2f('0x14e')]({'actionid':_0x1208d2,'action':_0xaf2f('0x1f5'),'queue':_0x420b61[_0xaf2f('0x44')]})[_0xaf2f('0xba')](function(){_0x5c120c[_0xaf2f('0xb6')](_0x420b61);_0x5c120c[_0xaf2f('0xc5')]({'active':![],'ContactId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xd5')],'ListId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xd6')],'VoiceQueueId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2]['VoiceQueueId']||undefined,'CampaignId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1f6')));delete _0x5c120c[_0xaf2f('0x12a')][_0x1208d2];});}else{loggerBooked[_0xaf2f('0x7d')](_0xaf2f('0x1f7'),JSON[_0xaf2f('0x4e')](_0x420b61[_0xaf2f('0x132')]),'Queue:\x20',_0x420b61[_0xaf2f('0x44')]);_0x5c120c['updateOriginated'](_0x420b61);_0x5c120c[_0xaf2f('0xc5')]({'active':![],'ContactId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xd5')],'ListId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2]['ListId'],'VoiceQueueId':_0x5c120c[_0xaf2f('0x12a')][_0x1208d2][_0xaf2f('0xd7')]||undefined,'CampaignId':_0x5c120c['actions'][_0x1208d2]['CampaignId']||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1f6')));delete _0x5c120c['actions'][_0x1208d2];}}else{return _0x5c120c['actionOriginate'](_0x420b61,_0x3a1910);}}else{if(getDiff(_0x3a1910[_0xaf2f('0x1f8')])<_0x420b61[_0xaf2f('0x1f9')]*0x3c){if(_0x3a1910[_0xaf2f('0x1fa')]&&!_0x3a1910['Agent']['voicePause']){_0x5c120c[_0xaf2f('0x1f')][_0xaf2f('0x135')](_0x3a1910['id'])[_0xaf2f('0x1d')](function(){_0x5c120c[_0xaf2f('0xb6')](_0x420b61);});}else{_0x5c120c[_0xaf2f('0xc6')]({'active':![]},_0x3a1910['id'],0x1)[_0xaf2f('0x1d')](function(){_0x5c120c['updateOriginated'](_0x420b61);});}}else{_0x420b61[_0xaf2f('0x6b')]+=0x1;_0x5c120c['updateOriginated'](_0x420b61);if(_0x420b61[_0xaf2f('0x1fb')]){_0x5c120c[_0xaf2f('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3a1910[_0xaf2f('0xd5')],'ListId':_0x3a1910['ListId'],'VoiceQueueId':_0x3a1910[_0xaf2f('0xd7')]||undefined,'CampaignId':_0x3a1910[_0xaf2f('0xd8')]||undefined})[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1fc')));_0x5c120c['createHistory'](createObjHistory(_0x420b61,_0x3a1910,_0xaf2f('0x1fd'),0x17,_0xaf2f('0x1fe')))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x1ff')));}else{_0x5c120c[_0xaf2f('0xd3')](createObjHistory(_0x420b61,_0x3a1910,_0xaf2f('0x200'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x420b61['outboundBlacklistCallsDay']+=0x1;_0x5c120c[_0xaf2f('0xd3')](createObjHistory(_0x420b61,_0x3a1910,_0xaf2f('0x201'),0xd,_0xaf2f('0x202')),_0xaf2f('0x203'),_0xaf2f('0x204'));throw _0xaf2f('0x205');}};};Dialer['prototype']['handleIvr']=function(_0x14a030){var _0x20b0b8=this;var _0x2e7473=_0x14a030[_0xaf2f('0x206')]-_0x14a030[_0xaf2f('0x74')]-_0x14a030['temp'];emitCampaignSummary(_0x14a030);if(_0x2e7473>0x0){if(_0x2e7473>this[_0xaf2f('0x24')]){_0x2e7473=this['maxNumberOriginate'];}_0x14a030[_0xaf2f('0xc8')]+=_0x2e7473;this[_0xaf2f('0xc9')](_0x14a030['id'],_0x2e7473,_0x14a030['dialOrderByScheduledAt'],_0x14a030)[_0xaf2f('0x41')](function(_0x2ca0c9){_0x14a030[_0xaf2f('0xc8')]-=_0x2e7473;_0x14a030[_0xaf2f('0xc8')]=_0x14a030[_0xaf2f('0xc8')]>0x0?_0x14a030[_0xaf2f('0xc8')]:0x0;if(!checkContactEmpty(_0x2ca0c9)){_0x14a030[_0xaf2f('0x46')]=_0xaf2f('0x207');logger[_0xaf2f('0x7d')]('[getContactCampaign2][Empty]'+_0x14a030['name']);}else{_0x14a030['originated']+=_0x2ca0c9[_0xaf2f('0x9e')];_0x14a030[_0xaf2f('0x46')]=_0xaf2f('0x208');for(var _0x51d070=0x0;_0x51d070<_0x2ca0c9['length'];_0x51d070+=0x1){_0x14a030[_0xaf2f('0x209')]+=0x1;if(_[_0xaf2f('0xb2')](_0x2ca0c9[_0x51d070])||_['isNil'](_0x2ca0c9[_0x51d070][_0xaf2f('0x18d')])||_[_0xaf2f('0xb2')](_0x2ca0c9[_0x51d070][_0xaf2f('0x174')])){_0x20b0b8['emptyContact'](_0xaf2f('0x20a'),_0x14a030,_0x2ca0c9[_0x51d070]);}else{_0x20b0b8[_0xaf2f('0xc1')](_[_0xaf2f('0xd4')](_0x2ca0c9[_0x51d070],['CampaignId',_0xaf2f('0x20b')]))[_0xaf2f('0x41')](_0x20b0b8[_0xaf2f('0x20c')](_0x14a030,_0x2ca0c9[_0x51d070]))[_0xaf2f('0xba')](_0x20b0b8[_0xaf2f('0xd1')]('[actionOriginateIvr]\x20',_0x14a030));}}}})[_0xaf2f('0xba')](loggerGetContactDialer(_0xaf2f('0x20d'),_0x14a030,_0x2e7473));}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x15d')]=function(_0x1b339f,_0x5dee32){var _0x390e71=this;var _0x2ae2b5=[];var _0x3d417a=_0x5dee32>=0x1?_0x5dee32:0x1;if(_0x1b339f[_0xaf2f('0x15b')]===_0xaf2f('0x8')){_0x3d417a=0x1;}var _0x3ad6a9=Math[_0xaf2f('0x1d4')](_0x1b339f[_0xaf2f('0x53')]*_0x3d417a)-_0x1b339f[_0xaf2f('0x74')]-_0x1b339f[_0xaf2f('0xc8')];emitVoiceQueueSummary(_0x1b339f);if(_0x1b339f['dialLimitQueue']>0x0){var _0xd3a563=_0x1b339f['dialLimitQueue']-_0x1b339f[_0xaf2f('0x74')]-_0x1b339f['talking']-_0x1b339f['temp']-_0x1b339f[_0xaf2f('0x55')];if(_0x3ad6a9>_0xd3a563){_0x3ad6a9=_0xd3a563;}}if(_0x3ad6a9>0x0){if(_0x1b339f['dialMethod']===_0xaf2f('0x8')){_0x3ad6a9=0x1;}if(_0x3ad6a9>this[_0xaf2f('0x24')]){_0x3ad6a9=this[_0xaf2f('0x24')];}_0x1b339f[_0xaf2f('0xc8')]+=_0x3ad6a9;for(var _0xf532e8 in this['agents']){if(typeof this['agents'][_0xf532e8]!==_0xaf2f('0x9f')){if(this['agents'][_0xf532e8][_0xaf2f('0xac')]===_0xaf2f('0x20e')&&this[_0xaf2f('0x22')][_0xf532e8]['status']===_0xaf2f('0x167')){_0x2ae2b5['push'](this[_0xaf2f('0x22')][_0xf532e8]['id']);}}}this[_0xaf2f('0xc7')](_0x1b339f['id'],_0x2ae2b5,_0x3ad6a9,_0x1b339f[_0xaf2f('0x20f')],_0x1b339f)[_0xaf2f('0x41')](function(_0x3c1a29){_0x1b339f[_0xaf2f('0xc8')]-=_0x3ad6a9;_0x1b339f['temp']=_0x1b339f['temp']>0x0?_0x1b339f[_0xaf2f('0xc8')]:0x0;if(!checkContactEmpty(_0x3c1a29)){_0x390e71[_0xaf2f('0x210')](_0x1b339f)['then'](sendMessageReschedule(_0x1b339f))[_0xaf2f('0xba')](loggerCatch('[countReScheduled]\x20'));}else{_0x1b339f[_0xaf2f('0x74')]+=_0x3c1a29[_0xaf2f('0x9e')];_0x1b339f[_0xaf2f('0x46')]=_0x1b339f[_0xaf2f('0x15b')]==='booked'?_0xaf2f('0x17c'):_0xaf2f('0x208');for(var _0x4084bb=0x0;_0x4084bb<_0x3c1a29[_0xaf2f('0x9e')];_0x4084bb+=0x1){if(_[_0xaf2f('0xb2')](_0x3c1a29[_0x4084bb])||_[_0xaf2f('0xb2')](_0x3c1a29[_0x4084bb][_0xaf2f('0x18d')])||_['isNil'](_0x3c1a29[_0x4084bb][_0xaf2f('0x174')])){_0x390e71[_0xaf2f('0x211')]('[actionOriginate]\x20',_0x1b339f,_0x3c1a29[_0x4084bb]);}else{_0x390e71[_0xaf2f('0xbb')](_[_0xaf2f('0xd4')](_0x3c1a29[_0x4084bb],[_0xaf2f('0xd7'),_0xaf2f('0x20b')]))[_0xaf2f('0x41')](_0x390e71['checkContactBlack'](_0x1b339f,_0x3c1a29[_0x4084bb]))[_0xaf2f('0xba')](_0x390e71[_0xaf2f('0xd1')]('[actionOriginate]\x20',_0x1b339f));}}}})[_0xaf2f('0xba')](loggerGetContactDialer(_0xaf2f('0x212'),_0x1b339f,_0x3ad6a9));}};Dialer[_0xaf2f('0xb8')]['handlePredictive']=function(_0x14a23c){if(_0x14a23c['dialLimitQueue']>0x0){var _0x3434c8=_0x14a23c[_0xaf2f('0x213')]-_0x14a23c[_0xaf2f('0x74')]-_0x14a23c[_0xaf2f('0x59')];if(_0x3434c8>0x0){this[_0xaf2f('0x214')](_0x14a23c);}else{loggerPredictiveCalls['info'](_0xaf2f('0x215'));}}else{this[_0xaf2f('0x214')](_0x14a23c);}};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x214')]=function(_0x5395f1){var _0x4ad63b=this;var _0x2f32d3=[];_0x5395f1[_0xaf2f('0x74')]+=0x1;for(var _0x51216b in this[_0xaf2f('0x22')]){if(typeof this[_0xaf2f('0x22')][_0x51216b]!==_0xaf2f('0x9f')){if(this[_0xaf2f('0x22')][_0x51216b][_0xaf2f('0xac')]===_0xaf2f('0x20e')&&this[_0xaf2f('0x22')][_0x51216b][_0xaf2f('0xb3')]===_0xaf2f('0x167')){_0x2f32d3[_0xaf2f('0x130')](this[_0xaf2f('0x22')][_0x51216b]['id']);}}}this[_0xaf2f('0xc7')](_0x5395f1['id'],_0x2f32d3,0x1,_0x5395f1[_0xaf2f('0x20f')],_0x5395f1)[_0xaf2f('0x41')](function(_0x1fecac){if(!checkContactEmpty(_0x1fecac)){checkContactLowerLimitOriginate(_0x5395f1,0x1,0x0);_0x4ad63b['countReScheduled'](_0x5395f1)[_0xaf2f('0x41')](sendMessageReschedule(_0x5395f1))[_0xaf2f('0xba')](loggerCatch(_0xaf2f('0x216')));}else{_0x5395f1['message']=_0xaf2f('0x208');if(_['isNil'](_0x1fecac[0x0])||_[_0xaf2f('0xb2')](_0x1fecac[0x0]['Contact'])||_[_0xaf2f('0xb2')](_0x1fecac[0x0][_0xaf2f('0x174')])){_0x4ad63b[_0xaf2f('0x211')]('[actionOriginate]\x20',_0x5395f1,_0x1fecac[0x0]);}else{_0x4ad63b['checkIsBlackList'](_['pick'](_0x1fecac[0x0],[_0xaf2f('0xd7'),_0xaf2f('0x20b')]))[_0xaf2f('0x41')](_0x4ad63b[_0xaf2f('0x20c')](_0x5395f1,_0x1fecac[0x0]))['catch'](_0x4ad63b['loggerHandler'](_0xaf2f('0x217'),_0x5395f1));}}})[_0xaf2f('0xba')](loggerGetContactDialer('[getContactDialerPredictive]',_0x5395f1,0x1));emitVoiceQueueSummary(_0x5395f1);};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x218')]=function(_0x570192,_0x155976,_0x293082,_0x3fe370,_0x4743f2,_0x7e20a7){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x219'),_0x570192);loggerPredictive[_0xaf2f('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x155976);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x21a'),_0x293082);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x21b'),_0x3fe370);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',_0x4743f2);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x90'));return new BPromise(function(_0x4c3bd7,_0x3fc7f1){if(_0x570192<=0x0||isNaN(_0x570192)){return _0x3fc7f1(msgResponse(_0xaf2f('0x21c'),_0xaf2f('0x4d'),_0xaf2f('0x21d')+_0x570192));}if(_0x293082<=0x0||isNaN(_0x293082)){return _0x3fc7f1(msgResponse(_0xaf2f('0x21c'),_0xaf2f('0x4d'),_0xaf2f('0x21e')+_0x293082));}if(_0x3fe370<=0x0||isNaN(_0x3fe370)){return _0x3fc7f1(msgResponse(_0xaf2f('0x21c'),_0xaf2f('0x4d'),_0xaf2f('0x21f')+_0x3fe370));}if(_0x155976<=0x0||isNaN(_0x155976)){return _0x3fc7f1(msgResponse(_0xaf2f('0x21c'),_0xaf2f('0x4d'),'interval\x20=\x20'+_0x155976));}if(_0x4743f2<=0x0||isNaN(_0x4743f2)){return _0x3fc7f1(msgResponse(_0xaf2f('0x21c'),_0xaf2f('0x4d'),_0xaf2f('0x220')+_0x4743f2));}_0x7e20a7=_0x7e20a7||0x0;var _0x212ebf=0x1/_0x293082;var _0x583dc4=0x0;var _0x29298b=0x0;var _0x35b167=0x0;var _0x243475=0x0;for(var _0x4c4e78=0x0;_0x35b167<_0x4743f2;_0x4c4e78+=0x1){_0x29298b=_0x4c4e78/_0x155976;_0x583dc4=(_0x3fe370*_0x29298b+_0x7e20a7)/_0x212ebf;_0x35b167=erlangb(_0x583dc4,_0x570192);_0x243475=_0x583dc4/_0x570192*(0x1-erlangb(_0x583dc4,_0x570192));}return _0x4c3bd7({'erlangCalls':_0x4c4e78,'erlangCallToSecond':_0x155976/_0x4c4e78,'erlangAbandonmentRate':_0x35b167,'erlangBusyFactor':_0x243475});});};Dialer[_0xaf2f('0xb8')][_0xaf2f('0x1e6')]=function(_0x1e0eb3,_0x34a605,_0xa86a70,_0x35d1da,_0x6a9899,_0x520144){loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x221'));loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x219'),_0x1e0eb3);loggerPredictive[_0xaf2f('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34a605);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x21a'),_0xa86a70);loggerPredictive[_0xaf2f('0x7d')]('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',_0x35d1da);loggerPredictive['info'](_0xaf2f('0x222'),_0x6a9899);loggerPredictive[_0xaf2f('0x7d')](_0xaf2f('0x90'));return new BPromise(function(_0x58398a,_0x1a3a2b){if(_0x1e0eb3<=0x0||isNaN(_0x1e0eb3)){return _0x1a3a2b(msgResponse(_0xaf2f('0x223'),_0xaf2f('0x4d'),'m\x20=\x20'+_0x1e0eb3));}if(_0xa86a70<=0x0||isNaN(_0xa86a70)){return _0x1a3a2b(msgResponse(_0xaf2f('0x223'),_0xaf2f('0x4d'),_0xaf2f('0x21e')+_0xa86a70));}if(_0x35d1da<=0x0||isNaN(_0x35d1da)){return _0x1a3a2b(msgResponse(_0xaf2f('0x223'),_0xaf2f('0x4d'),_0xaf2f('0x21f')+_0x35d1da));}if(_0x34a605<=0x0||isNaN(_0x34a605)){return _0x1a3a2b(msgResponse(_0xaf2f('0x223'),'Error','interval\x20=\x20'+_0x34a605));}if(_0x6a9899<=0x0||isNaN(_0x6a9899)){return _0x1a3a2b(msgResponse('[busyFactor]',_0xaf2f('0x4d'),_0xaf2f('0x224')+_0x6a9899));}_0x520144=_0x520144||0x0;var _0x17ddc0=0x1/_0xa86a70;var _0xff3234=0x0;var _0x2eb556=0x0;var _0x9bed96=0x0;var _0x53d28=0x0;for(var _0x3908c2=0x0;_0x53d28<_0x6a9899;_0x3908c2+=0x1){_0x2eb556=_0x3908c2/_0x34a605;_0xff3234=(_0x35d1da*_0x2eb556+_0x520144)/_0x17ddc0;_0x9bed96=erlangb(_0xff3234,_0x1e0eb3);_0x53d28=_0xff3234/_0x1e0eb3*(0x1-erlangb(_0xff3234,_0x1e0eb3));}return _0x58398a({'erlangCalls':_0x3908c2,'erlangCallToSecond':_0x34a605/_0x3908c2,'erlangAbandonmentRate':_0x9bed96,'erlangBusyFactor':_0x53d28});});};module[_0xaf2f('0x225')]=Dialer; \ No newline at end of file +var _0xeffd=['evt\x20is\x20undefine','reason','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','AgentReject','dialAgentRejectRetryFrequency','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','floor','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','--------\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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\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','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','debug','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','status','unmonitored','uniqueId','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','reason19\x20machine....','createStateFinal','syncHangup','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','Unknow','agiafterat','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','Abandoned','[syncAgentComplete][createHistory][11]','actions','roundrobin','actionid','locked','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','syncCampaigns','active','\x5cw{0,','pow','random','match','actionOriginate','object','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','[originate][error]','finally','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine'];(function(_0x2d51c6,_0x4b3306){var _0x28559e=function(_0x3e965f){while(--_0x3e965f){_0x2d51c6['push'](_0x2d51c6['shift']());}};_0x28559e(++_0x4b3306);}(_0xeffd,0x6b));var _0xdeff=function(_0x1168ee,_0x439ad2){_0x1168ee=_0x1168ee-0x0;var _0x25cda4=_0xeffd[_0x1168ee];return _0x25cda4;};'use strict';var util=require(_0xdeff('0x0'));var _=require('lodash');var BPromise=require(_0xdeff('0x1'));var uuid=require(_0xdeff('0x2'));var moment=require(_0xdeff('0x3'));var rr=require('rr');var md5=require(_0xdeff('0x4'));var Redis=require(_0xdeff('0x5'));var ut=require(_0xdeff('0x6'));var config=require(_0xdeff('0x7'));var logger=require(_0xdeff('0x8'))(_0xdeff('0x9'));var loggerBooked=require(_0xdeff('0x8'))(_0xdeff('0xa'));var loggerPredictive=require(_0xdeff('0x8'))(_0xdeff('0xb'));var loggerPredictiveCalls=require(_0xdeff('0x8'))(_0xdeff('0xc'));var loggerSyncQueueSummary=require(_0xdeff('0x8'))(_0xdeff('0xd'));var ami=require('../ami');config[_0xdeff('0xe')]=_[_0xdeff('0xf')](config[_0xdeff('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xdeff('0x10'))(new Redis(config[_0xdeff('0xe')]));var cmHopper=require(_0xdeff('0x11'));var cmHopperHistory=require(_0xdeff('0x12'));var cmHopperFinal=require(_0xdeff('0x13'));var cmHopperAdditionalPhone=require(_0xdeff('0x14'));var cmHopperBlack=require(_0xdeff('0x15'));var voiceQueueRt=require(_0xdeff('0x16'));var RpcSetting=require('../rpc/setting');var Action=require(_0xdeff('0x17'));var History=require(_0xdeff('0x18'));var Final=require('./final');var AgentComplete=require(_0xdeff('0x19'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xdeff('0x1a')][_0xdeff('0x1b')]||_0xdeff('0x1c');var strategy={'rrmemory':_0xdeff('0x1d'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xdeff('0x1e')][_0xdeff('0x1f')]=function(_0xea6c4){this[_0xdeff('0x20')]=this[_0xdeff('0x20')]?this[_0xdeff('0x20')]['finally'](_0xea6c4):_0xea6c4();};function Dialer(_0x586f54,_0x7440af){this['sequence']=new Sequence();this['preview']=_0x7440af;this[_0xdeff('0x21')]=_0x586f54[_0xdeff('0x21')];this['campaigns']=_0x586f54[_0xdeff('0x22')];this[_0xdeff('0x23')]=_0x586f54[_0xdeff('0x23')];this[_0xdeff('0x24')]=_0x586f54[_0xdeff('0x24')];this[_0xdeff('0x25')]=config[_0xdeff('0x25')]||0x2;this[_0xdeff('0x26')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0xdeff('0x27')]={};this['startPredictive']={};this[_0xdeff('0x28')]={};this[_0xdeff('0x29')]={};this['queueBooked']={};this[_0xdeff('0x2a')]={};ami['on'](_0xdeff('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0xdeff('0x2c'),this[_0xdeff('0x2d')][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x2f'),this[_0xdeff('0x30')]['bind'](this));ami['on'](_0xdeff('0x31'),this[_0xdeff('0x32')][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x33'),this[_0xdeff('0xd')][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x34'),this['syncQueueSummaryComplete'][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x35'),this['syncHangup']['bind'](this));ami['on'](_0xdeff('0x36'),this[_0xdeff('0x37')][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x38'),this[_0xdeff('0x39')][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x3a'),this['syncQueueMember'][_0xdeff('0x2e')](this));ami['on'](_0xdeff('0x3b'),this[_0xdeff('0x3c')]['bind'](this));this['loopCampaigns']();this[_0xdeff('0x3d')]();RpcSetting['getSettings']()[_0xdeff('0x3e')](function(_0x145d8b){previewRecallmeReminderInterval=_0x145d8b[_0xdeff('0x3f')];});}function isNotNull(_0x5af6b2){return _0x5af6b2!==null&&!_[_0xdeff('0x40')](_0x5af6b2);}function checkIsLoggedIn(_0x563eba,_0x4ba2b2){return function(){if(_0x4ba2b2<=0x0){_0x563eba[_0xdeff('0x41')]=_0xdeff('0x42');throw _0x563eba[_0xdeff('0x43')]+_0xdeff('0x44');}};}function isActive(_0x5b5d5f){return _0x5b5d5f;}function checkIsActive(_0x3f91d8,_0x1f5ea9){return function(){if(!isActive(_0x1f5ea9)){_0x3f91d8[_0xdeff('0x41')]=_0xdeff('0x45');throw _0x3f91d8[_0xdeff('0x43')]+_0xdeff('0x46');}};}function checkInterval(_0x321ef0){return function(){if(!isNotNull(_0x321ef0['Interval'])){_0x321ef0[_0xdeff('0x41')]='INTERVAL_IS_NULL';throw _0x321ef0[_0xdeff('0x43')]+_0xdeff('0x47');}if(!isNotNull(_0x321ef0[_0xdeff('0x48')][_0xdeff('0x49')])){_0x321ef0[_0xdeff('0x41')]=_0xdeff('0x4a');throw _0x321ef0['name']+_0xdeff('0x47');}if(!isNotNull(_[_0xdeff('0x4b')](_0x321ef0['Interval'][_0xdeff('0x49')]))){_0x321ef0[_0xdeff('0x41')]=_0xdeff('0x4a');throw _0x321ef0[_0xdeff('0x43')]+_0xdeff('0x47');}};}function msgResponse(_0xe511b2,_0x4268e4,_0x54c20e){return{'action':_0xe511b2,'response':_0x4268e4,'message':_0x54c20e,'stack':_0x54c20e};}function myreject(_0x5245e0){return function(_0x118752){return _0x5245e0(msgResponse('[ifTime][Action]',_0xdeff('0x4c'),JSON[_0xdeff('0x4d')](_0x118752)));};}function getSeconds(_0x30f442,_0x5f368d){var _0x443550=moment(_0x30f442)[_0xdeff('0x4e')](0x0);var _0x31dd4a=moment(_0x5f368d)[_0xdeff('0x4e')](0x0);return _0x443550[_0xdeff('0x4f')](_0x31dd4a,'seconds');}function emit(_0x1c87bd,_0x4d9985,_0x393d75){io['to'](_0x1c87bd)[_0xdeff('0x50')](_0x4d9985,_0x393d75);}function emitVoiceQueueSummary(_0x518280){if(_0x518280[_0xdeff('0x51')]===_0xdeff('0x52')){var _0x327e32={'id':_0x518280['id'],'name':_0x518280[_0xdeff('0x43')],'strategy':_0x518280[_0xdeff('0x53')],'answered':_0x518280['answered'],'available':_0x518280[_0xdeff('0x54')],'loggedIn':_0x518280[_0xdeff('0x55')],'pTalking':_0x518280[_0xdeff('0x56')],'sumBillable':_0x518280[_0xdeff('0x57')],'sumDuration':_0x518280[_0xdeff('0x58')],'sumHoldTime':_0x518280['sumHoldTime']||0x0,'talking':_0x518280['talking'],'total':_0x518280[_0xdeff('0x59')],'type':_0x518280[_0xdeff('0x51')],'unmanaged':_0x518280[_0xdeff('0x5a')],'abandoned':_0x518280[_0xdeff('0x5b')],'waiting':_0x518280[_0xdeff('0x5c')],'loggedInDb':_0x518280[_0xdeff('0x5d')],'dialActive':_0x518280[_0xdeff('0x5e')],'dialMethod':_0x518280['dialMethod'],'dialOriginateCallerIdName':_0x518280[_0xdeff('0x5f')],'dialOriginateCallerIdNumber':_0x518280[_0xdeff('0x60')],'dialOriginateTimeout':_0x518280[_0xdeff('0x61')],'dialPrefix':_0x518280['dialPrefix'],'outboundAnswerAgiCallsDay':_0x518280[_0xdeff('0x62')],'outboundAnswerCallsDay':_0x518280[_0xdeff('0x63')],'outboundBlacklistCallsDay':_0x518280[_0xdeff('0x64')],'outboundBusyCallsDay':_0x518280[_0xdeff('0x65')],'outboundCongestionCallsDay':_0x518280['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x518280[_0xdeff('0x66')],'outboundDropCallsDayCallersExit':_0x518280[_0xdeff('0x67')],'outboundDropCallsDayTimeout':_0x518280[_0xdeff('0x68')],'outboundNoAnswerCallsDay':_0x518280[_0xdeff('0x69')],'outboundNoSuchCallsDay':_0x518280[_0xdeff('0x6a')],'outboundOriginateFailureCallsDay':_0x518280[_0xdeff('0x6b')],'outboundReCallsDay':_0x518280[_0xdeff('0x6c')],'outboundRejectCallsDay':_0x518280[_0xdeff('0x6d')],'outboundUnknownCallsDay':_0x518280['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x518280[_0xdeff('0x6e')],'predictiveIntervalAvgHoldtime':_0x518280[_0xdeff('0x6f')],'predictiveIntervalAvgTalktime':_0x518280[_0xdeff('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x518280[_0xdeff('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x518280[_0xdeff('0x72')],'predictiveIntervalErlangCalls':_0x518280['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x518280[_0xdeff('0x73')],'predictiveIntervalHitRate':_0x518280[_0xdeff('0x74')],'predictiveIntervalMultiplicativeFactor':_0x518280[_0xdeff('0x75')],'predictiveIntervalPauses':_0x518280[_0xdeff('0x76')],'predictiveIntervalAvailable':_0x518280[_0xdeff('0x77')],'predictiveIntervalTotalCalls':_0x518280['predictiveIntervalTotalCalls'],'message':_0x518280[_0xdeff('0x41')],'originated':_0x518280['originated'],'erlangCalls':_0x518280[_0xdeff('0x78')],'erlangCallToSecond':_0x518280[_0xdeff('0x79')],'erlangAbandonmentRate':_0x518280[_0xdeff('0x7a')],'erlangBusyFactor':_0x518280[_0xdeff('0x7b')],'startPredictive':_0x518280[_0xdeff('0x7c')],'startProgressive':_0x518280[_0xdeff('0x28')]};if(_0x518280['Trunk']){_0x327e32['Trunk']={'id':_0x518280[_0xdeff('0x7d')]['id'],'name':_0x518280[_0xdeff('0x7d')][_0xdeff('0x43')],'active':_0x518280['Trunk']['active'],'callerid':_0x518280[_0xdeff('0x7d')][_0xdeff('0x7e')]};}if(_0x518280['Interval']){_0x327e32[_0xdeff('0x48')]={'id':_0x518280[_0xdeff('0x48')]['id'],'name':_0x518280[_0xdeff('0x48')]['name']};}var _0x28fa6c=md5(JSON[_0xdeff('0x4d')](_0x327e32));if(_0x518280[_0xdeff('0x4')]!==_0x28fa6c){_0x518280['md5']=_0x28fa6c;emit(util[_0xdeff('0x7f')](_0xdeff('0x80'),_0x327e32[_0xdeff('0x43')]),_0xdeff('0x81'),_0x327e32);}}}function emitCampaignSummary(_0x450c5d){if(_0x450c5d[_0xdeff('0x51')]===_0xdeff('0x82')){emit(util['format'](_0xdeff('0x83'),_0x450c5d[_0xdeff('0x43')]),'campaign:save',_0x450c5d);}}function checkGetDataPredictive(_0xe5a773){if(isNotNull(_0xe5a773)&&!_[_0xdeff('0x4b')](_0xe5a773)){loggerPredictive[_0xdeff('0x84')](_0xdeff('0x85'));loggerPredictive[_0xdeff('0x84')](_0xdeff('0x86'),_0xe5a773[_0xdeff('0x87')]);loggerPredictive[_0xdeff('0x84')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe5a773[_0xdeff('0x6e')]);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x88'),_0xe5a773['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xdeff('0x89'),_0xe5a773[_0xdeff('0x71')]);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x8a'),_0xe5a773[_0xdeff('0x6f')]);loggerPredictive[_0xdeff('0x84')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe5a773['predictiveIntervalAvgTalktime']);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x8b'));if(_0xe5a773['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0xe5a773[_0xdeff('0x70')])&&_0xe5a773[_0xdeff('0x70')]>0x0){return!![];}loggerPredictive['info'](_0xdeff('0x8c'));if(!_[_0xdeff('0x40')](_0xe5a773['predictiveIntervalAvgHoldtime'])&&_0xe5a773[_0xdeff('0x6f')]>0x0){return!![];}loggerPredictive[_0xdeff('0x84')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xdeff('0x84')](_0xdeff('0x8d'));}}else{loggerPredictive['info'](_0xdeff('0x8e'));}return![];}function mergeDataErlangB(_0x152187){return function(_0x2a83ac){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xdeff('0x84')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a83ac[_0xdeff('0x78')]);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x8f'),_0x2a83ac[_0xdeff('0x79')]);loggerPredictive[_0xdeff('0x84')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a83ac['erlangAbandonmentRate']);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x90'),_0x2a83ac[_0xdeff('0x7b')]);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x91'),_0x2a83ac[_0xdeff('0x7a')]);loggerPredictive['info'](_0xdeff('0x8b'));_['merge'](_0x152187,_0x2a83ac);};}function getDiff(_0x10253e){var _0x184c9d=moment()[_0xdeff('0x4e')](0x0);var _0x188c02=moment(_0x10253e)[_0xdeff('0x4e')](0x0);return _0x184c9d[_0xdeff('0x4f')](_0x188c02,_0xdeff('0x92'));}function ifInterval(_0x1e6488,_0x3a1586){if(_['isUndefined'](_0x3a1586)){return![];}return getDiff(_0x3a1586)<_0x1e6488*0x3c;}function freeVariablesPredictive(_0x43f74){if(isNotNull(_0x43f74)){if(!_['isUndefined'](_0x43f74[_0xdeff('0x28')])){_0x43f74[_0xdeff('0x28')]=undefined;loggerPredictive['info'](_0x43f74[_0xdeff('0x43')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xdeff('0x40')](_0x43f74['startPredictive'])){_0x43f74['startPredictive']=undefined;loggerPredictive[_0xdeff('0x84')](_0x43f74[_0xdeff('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xdeff('0x40')](_0x43f74[_0xdeff('0x93')])){clearInterval(_0x43f74[_0xdeff('0x93')]);_0x43f74[_0xdeff('0x93')]=undefined;loggerPredictive[_0xdeff('0x84')](_0x43f74[_0xdeff('0x43')],_0xdeff('0x94'));}}}function erlangb(_0x26aecd,_0x46046a){if(_0x46046a===0x0){return 0x0;}var _0x517ca7=0x1;for(var _0x1f71ee=0x1;_0x1f71ee<=_0x46046a;_0x1f71ee+=0x1){_0x517ca7=0x1+_0x517ca7*_0x1f71ee/_0x26aecd;}return 0x1/_0x517ca7;}function isVoiceQueueOutbound(_0x198aea){return _0x198aea==='outbound';}function isNotPreview(_0x4af4db){return _0x4af4db!==_0xdeff('0x95');}function isCampaignIvr(_0x2d7c69){return _0x2d7c69==='ivr';}function getCallerId(_0x3dc7fb,_0x3b820c,_0x1eb6b2){if(!_[_0xdeff('0x40')](_0x1eb6b2)&&typeof _0x1eb6b2===_0xdeff('0x96')&&!_[_0xdeff('0x4b')](_0x1eb6b2)){if(!_[_0xdeff('0x40')](_0x3b820c)&&typeof _0x3b820c===_0xdeff('0x96')&&!_[_0xdeff('0x4b')](_0x3b820c)){return util[_0xdeff('0x7f')]('\x22%s\x22\x20<%s>',_0x3b820c,_0x1eb6b2);}return util[_0xdeff('0x7f')](_0xdeff('0x97'),_0x1eb6b2,_0x1eb6b2);}if(!_[_0xdeff('0x40')](_0x3dc7fb)&&typeof _0x3dc7fb===_0xdeff('0x96')&&!_[_0xdeff('0x4b')](_0x3dc7fb)){return _0x3dc7fb;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x48f91e,_0x51423e){return function(_0x120cab){freeVariablesPredictive(_0x51423e);emitVoiceQueueSummary(_0x51423e);emitCampaignSummary(_0x51423e);loggerSyncQueueSummary[_0xdeff('0x98')](_0x48f91e,util[_0xdeff('0x99')](_0x120cab,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5e85dc,_0x4ea57d){return function(_0x5c718a){loggerPredictive[_0xdeff('0x9a')](_0x4ea57d[_0xdeff('0x43')],_0x5e85dc);loggerPredictive[_0xdeff('0x9a')](_0x5c718a[_0xdeff('0x9b')]);freeVariablesPredictive(_0x4ea57d);};}function loggerCatch(_0x118aa0){return function(_0x19ab0f){logger[_0xdeff('0x9a')](_0x118aa0,util[_0xdeff('0x99')](_0x19ab0f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4a5d94){return _0x4a5d94&&!_[_0xdeff('0x40')](_0x4a5d94)&&_0x4a5d94[_0xdeff('0x9c')]>0x0;}function decremetOriginate(_0x476455){if(!_[_0xdeff('0x40')](_0x476455)&&_0x476455!==null){if(typeof _0x476455[_0xdeff('0x9d')]!==_0xdeff('0x9e')){if(_0x476455[_0xdeff('0x9d')]>0x0){_0x476455[_0xdeff('0x9d')]-=0x1;}else{logger[_0xdeff('0x9a')](_0xdeff('0x9f'));}}}else{logger[_0xdeff('0x9a')](_0xdeff('0xa0'));}}function checkContactLowerLimitOriginate(_0x5b60e4,_0xdc88e8,_0xa46f6c){if(_0xdc88e8>_0xa46f6c){for(var _0x1fa20b=0x0;_0x1fa20b<_0xdc88e8-_0xa46f6c;_0x1fa20b+=0x1){decremetOriginate(_0x5b60e4);}}}function loggerGetContactDialer(_0x54adce,_0x17c78a,_0x302e78){return function(_0x39416){checkContactLowerLimitOriginate(_0x17c78a,_0x302e78,0x0);logger[_0xdeff('0x9a')](_0x54adce,util['inspect'](_0x39416,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2811e5){return function(_0x2ae8fc){if(isNotNull(_0x2ae8fc)&&isNotNull(_0x2ae8fc[0x0])){if(_0x2ae8fc[0x0]['contactsRescheduled']>0x0){_0x2811e5[_0xdeff('0x41')]=_0xdeff('0xa1');logger[_0xdeff('0x84')](_0xdeff('0xa2')+_0x2811e5[_0xdeff('0x43')],_0x2ae8fc[0x0]['contactsRescheduled'],_0xdeff('0xa3'));}else{_0x2811e5[_0xdeff('0x41')]=_0xdeff('0xa4');logger[_0xdeff('0x84')](_0xdeff('0xa5')+_0x2811e5['name']);}}};}function notSendMessagesQueue(_0x1c2538){if(_0x1c2538[_0xdeff('0xa6')]){freeVariablesPredictive(_0x1c2538);if(_0x1c2538['originated']===0x0&&_0x1c2538[_0xdeff('0xa7')]===0x0&&_0x1c2538[_0xdeff('0x5c')]===0x0&&(_0x1c2538[_0xdeff('0x56')]||0x0)===0x0){_0x1c2538['sendMessageOneNotActive']=![];_0x1c2538[_0xdeff('0x54')]=0x0;_0x1c2538[_0xdeff('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xdeff('0x98')](_0xdeff('0xa8'),_0x1c2538[_0xdeff('0x43')],_0xdeff('0xa9'));}else{_0x1c2538['message']=_0xdeff('0xaa');loggerSyncQueueSummary[_0xdeff('0x98')](_0xdeff('0xa8'),_0x1c2538[_0xdeff('0x43')],_0xdeff('0xab'));}emitVoiceQueueSummary(_0x1c2538);}}function notSendMessagesCampaign(_0x69e0f9){if(_0x69e0f9[_0xdeff('0xa6')]){if(_0x69e0f9[_0xdeff('0x9d')]===0x0){_0x69e0f9[_0xdeff('0xa6')]=![];_0x69e0f9['message']=_0xdeff('0x45');loggerSyncQueueSummary['debug'](_0xdeff('0xac'),_0x69e0f9['name'],'is\x20not\x20active');}else{_0x69e0f9[_0xdeff('0x41')]=_0xdeff('0xaa');loggerSyncQueueSummary['debug'](_0xdeff('0xac'),_0x69e0f9[_0xdeff('0x43')],_0xdeff('0xab'));}emitCampaignSummary(_0x69e0f9);}}function createObjHistory(_0x3dfd5e,_0x560cc2,_0x1ad62c,_0xeb02fa,_0x581500){_0x3dfd5e[_0xdeff('0x41')]=_0x1ad62c;var _0xd597c7=new Action(_0x3dfd5e,_0x560cc2);var _0x3eeb2d=new History(_0xd597c7);_0x3eeb2d[_0xdeff('0xad')]=_0xeb02fa;_0x3eeb2d[_0xdeff('0xae')]=_0x581500;_0x3eeb2d[_0xdeff('0xaf')]=_0xd597c7[_0xdeff('0xb0')];return _0x3eeb2d;}Dialer[_0xdeff('0x1e')]['loopClearZombieChannels']=function(){var _0x47a09c=this;setInterval(function(){_0x47a09c[_0xdeff('0xb1')](_0x47a09c['uniqueId'],_0xdeff('0xb2'));_0x47a09c[_0xdeff('0xb1')](_0x47a09c['actions'],_0xdeff('0xb3'));},0x32c8);};Dialer[_0xdeff('0x1e')][_0xdeff('0xb1')]=function(_0x542d56,_0xc6dbe7){var _0x4361b5=this;for(var _0x21c8cd in _0x542d56){if(typeof _0x542d56[_0x21c8cd]!==_0xdeff('0x9e')){this['sequence'][_0xdeff('0x1f')](function(){if(!_['isNil'](_0x542d56[_0x21c8cd])){return ami[_0xdeff('0xb4')]({'action':'status','channel':_0x542d56[_0x21c8cd][_0xdeff('0xb5')]})['catch'](function(_0x1bfc62){if(_0x1bfc62[_0xdeff('0x41')]===_0xdeff('0xb6')){setTimeout(function(){if(_0x542d56[_0x21c8cd]&&_0x542d56[_0x21c8cd]['type']!==_0xdeff('0x82')){_0x4361b5[_0xdeff('0xb7')](_0x4361b5[_0xdeff('0x21')][_0x542d56[_0x21c8cd][_0xdeff('0xb8')]]);logger['error']('[Dialer][checkChannel]',_0xc6dbe7,_0x21c8cd,_0x542d56[_0x21c8cd][_0xdeff('0xb8')]);delete _0x542d56[_0x21c8cd];}if(_0x542d56[_0x21c8cd]&&_0x542d56[_0x21c8cd][_0xdeff('0x51')]===_0xdeff('0x82')){_0x4361b5[_0xdeff('0xb7')](_0x4361b5[_0xdeff('0x22')][_0x542d56[_0x21c8cd][_0xdeff('0xb8')]]);logger['error'](_0xdeff('0xb9'),_0xc6dbe7,_0x21c8cd,_0x542d56[_0x21c8cd][_0xdeff('0xb8')]);delete _0x542d56[_0x21c8cd];}},0x2328);}});}});}}};Dialer[_0xdeff('0x1e')]['countReScheduled']=function(_0x5d0c1a){return BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](cmHopper['countReScheduled'](_0x5d0c1a))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xbc')));};Dialer[_0xdeff('0x1e')][_0xdeff('0xbd')]=function(_0x1488f0){return BPromise[_0xdeff('0xba')]()['then'](cmHopperBlack[_0xdeff('0xbd')](_0x1488f0))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xbe')));};Dialer['prototype'][_0xdeff('0xbf')]=function(_0x507b64,_0x2a555f,_0x34866e){return BPromise['resolve']()[_0xdeff('0x3e')](cmHopperAdditionalPhone[_0xdeff('0xbf')](_0x507b64,_0x2a555f,_0x34866e))[_0xdeff('0xbb')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xdeff('0x1e')][_0xdeff('0xc0')]=function(_0x5399fc,_0x45723f,_0x14d2db){return BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](cmHopperAdditionalPhone[_0xdeff('0xc0')](_0x5399fc,_0x45723f,_0x14d2db))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xc1')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x124e3a){return BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](cmHopperBlack['checkIsBlackListIvr'](_0x124e3a))['catch'](loggerCatch(_0xdeff('0xc2')));};Dialer[_0xdeff('0x1e')][_0xdeff('0xc3')]=function(_0x581db7){return BPromise['resolve']()[_0xdeff('0x3e')](cmHopperHistory[_0xdeff('0xc4')](_0x581db7))[_0xdeff('0xbb')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xdeff('0x1e')]['rescheduleContact']=function(_0x1613ba){return BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](cmHopper[_0xdeff('0xc5')](_0x1613ba))[_0xdeff('0xbb')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x1f2cb8,_0x5e8143,_0x4f1b6d){return BPromise['resolve']()['then'](cmHopper[_0xdeff('0xc6')](_0x1f2cb8,_0x5e8143,_0x4f1b6d))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xc7')));};Dialer['prototype'][_0xdeff('0xc8')]=function(_0xe0da11,_0x3ef288,_0x21a7ae,_0x79d67c,_0x4c3a24){return BPromise['resolve']()[_0xdeff('0x3e')](cmHopper[_0xdeff('0xc8')](_0xe0da11,_0x3ef288,_0x21a7ae,_0x79d67c))[_0xdeff('0xbb')](function(_0x25c9d1){_0x4c3a24[_0xdeff('0xc9')]-=_0x21a7ae;_0x4c3a24[_0xdeff('0xc9')]=_0x4c3a24[_0xdeff('0xc9')]>0x0?_0x4c3a24['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x25c9d1);});};Dialer[_0xdeff('0x1e')][_0xdeff('0xca')]=function(_0x1f532d,_0x4fdb3a,_0x834058,_0x2d0a0b){return BPromise['resolve']()[_0xdeff('0x3e')](cmHopper[_0xdeff('0xca')](_0x1f532d,_0x4fdb3a,_0x834058))[_0xdeff('0xbb')](function(_0x3273ce){_0x2d0a0b['temp']-=_0x4fdb3a;_0x2d0a0b[_0xdeff('0xc9')]=_0x2d0a0b[_0xdeff('0xc9')]>0x0?_0x2d0a0b[_0xdeff('0xc9')]:0x0;loggerCatch(_0xdeff('0xcb'))(_0x3273ce);});};Dialer[_0xdeff('0x1e')]['getVoiceQueueRtPauses']=function(_0x362853){return BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](voiceQueueRt[_0xdeff('0xcc')](_0x362853))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xcd')));};Dialer[_0xdeff('0x1e')][_0xdeff('0xce')]=function(_0x3bc1ff){return BPromise['resolve']()['then'](cmHopper[_0xdeff('0xce')](_0x3bc1ff))[_0xdeff('0xbb')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0xdeff('0xcf')]=function(_0x3f432c){return BPromise['resolve']()['then'](cmHopperHistory[_0xdeff('0xcf')](_0x3f432c))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xd0')));};Dialer[_0xdeff('0x1e')][_0xdeff('0xb7')]=function(_0x5e5d67){if(!_[_0xdeff('0x40')](_0x5e5d67)&&_0x5e5d67!==null){if(typeof _0x5e5d67[_0xdeff('0x9d')]!==_0xdeff('0x9e')){if(_0x5e5d67['originated']>0x0){_0x5e5d67[_0xdeff('0x9d')]-=0x1;}else{logger[_0xdeff('0x9a')](_0xdeff('0xd1'));}}}else{logger[_0xdeff('0x9a')](_0xdeff('0xd2'));}};Dialer[_0xdeff('0x1e')][_0xdeff('0xd3')]=function(_0x33f0c1,_0x499bb5){var _0x5c3e0c=this;return function(_0x121b3b){_0x5c3e0c[_0xdeff('0xb7')](_0x499bb5);logger[_0xdeff('0x9a')](_0x33f0c1,util[_0xdeff('0x99')](_0x121b3b,{'showHidden':![],'depth':null}));};};Dialer[_0xdeff('0x1e')][_0xdeff('0xd4')]=function(_0x52e2e8,_0x47f334,_0x3a5684){var _0x43600c={'state':0x19,'statedesc':_0xdeff('0xd5')};this[_0xdeff('0xb7')](_0x47f334);this[_0xdeff('0xd6')](_['merge'](_0x43600c,_[_0xdeff('0xd7')](_0x3a5684,[_0xdeff('0xd8'),'ListId',_0xdeff('0xd9'),_0xdeff('0xda'),'CampaignId'])),_0xdeff('0xdb'),_0xdeff('0xdc'));logger[_0xdeff('0x9a')](_0x52e2e8);};Dialer[_0xdeff('0x1e')][_0xdeff('0xdd')]=function(_0x490f92){return _0x490f92===_0xdeff('0xde');};Dialer[_0xdeff('0x1e')][_0xdeff('0xdf')]=function(_0x41055c){return!_['isUndefined'](_0x41055c)&&_0x41055c&&!_[_0xdeff('0x40')](_0x41055c[_0xdeff('0x43')])&&!_['isUndefined'](_0x41055c['active'])&&_0x41055c['active']&&(this[_0xdeff('0x24')][util[_0xdeff('0x7f')]('SIP/%s',_0x41055c[_0xdeff('0x43')])]['status']===_0xdeff('0xe0')||this[_0xdeff('0x24')][util[_0xdeff('0x7f')](_0xdeff('0xe1'),_0x41055c[_0xdeff('0x43')])][_0xdeff('0xe2')]===_0xdeff('0xe3'));};Dialer['prototype'][_0xdeff('0xd6')]=function(_0x9e244e,_0x468ac7,_0x17555d){this[_0xdeff('0xcf')](_0x9e244e)['catch'](loggerCatch(_0x468ac7));this[_0xdeff('0xce')](_0x9e244e)[_0xdeff('0xbb')](loggerCatch(_0x17555d));};Dialer[_0xdeff('0x1e')][_0xdeff('0x39')]=function(_0x1aea4b){var _0x130230=this[_0xdeff('0xe4')][_0x1aea4b[_0xdeff('0xe5')]];var _0x1cddee;if(!_[_0xdeff('0xe6')](_0x1aea4b)&&!_[_0xdeff('0xe6')](_0x1aea4b[_0xdeff('0xe7')])&&!_[_0xdeff('0xe6')](_0x1aea4b[_0xdeff('0xe7')][_0xdeff('0xe8')])&&_0x1aea4b[_0xdeff('0xe9')]===_0xdeff('0xea')&&_0x130230){if(_0x130230[_0xdeff('0x51')]!==_0xdeff('0x82')&&this[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]]['dialAMDActive']&&_0x1aea4b['value']===_0xdeff('0xeb')){delete this[_0xdeff('0xe4')][_0x1aea4b['uniqueid']];this[_0xdeff('0xb7')](this[_0xdeff('0x21')][_0x130230['queue']]);this[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x130230['queue']][_0xdeff('0x62')]+=0x1;_0x1cddee=new Hangup(_0x130230,_0x1aea4b);_0x1cddee[_0xdeff('0xad')]=0x12;_0x1cddee['statedesc']=_0xdeff('0xec');_0x1cddee[_0xdeff('0xed')]=_0xdeff('0xee');ami[_0xdeff('0x50')](_0xdeff('0xef'),ut[_0xdeff('0xf0')](_0x1cddee,'amd'));this['saveInDb'](_0x1cddee,_0xdeff('0xf1'),_0xdeff('0xf2'));}if(_0x130230[_0xdeff('0x51')]!==_0xdeff('0x82')&&this[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]][_0xdeff('0xf3')]&&_0x1aea4b[_0xdeff('0xf4')]==='MACHINE'){var _0x2595e1=this;return new BPromise(function(_0x234adb,_0x5eb4cb){delete _0x2595e1[_0xdeff('0xe4')][_0x1aea4b[_0xdeff('0xe5')]];_0x2595e1[_0xdeff('0xb7')](_0x2595e1['voiceQueues'][_0x130230[_0xdeff('0xb8')]]);_0x2595e1[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]][_0xdeff('0x63')]+=0x1;_0x2595e1[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]][_0xdeff('0x62')]+=0x1;var _0x4cfd42=_0x2595e1[_0xdeff('0x21')][_0x130230[_0xdeff('0xb8')]];var _0x4b4cf8=new Hangup(_0x130230,_0x1aea4b);_0x4b4cf8['state']=0x13;_0x4b4cf8['statedesc']=_0xdeff('0xf5');_0x4b4cf8[_0xdeff('0xed')]='AMD';_0x4b4cf8[_0xdeff('0xf6')]+=0x1;_0x4b4cf8[_0xdeff('0xf7')]+=0x1;_0x4b4cf8['amd']=!![];ami[_0xdeff('0x50')](_0xdeff('0xef'),ut[_0xdeff('0xf0')](_0x4b4cf8,_0xdeff('0xf8')));_0x2595e1['createHistory'](_0x4b4cf8)['catch'](loggerCatch(_0xdeff('0xf9')));if(_0x4b4cf8[_0xdeff('0xfa')]+_0x4b4cf8['countcongestionretry']+_0x4b4cf8[_0xdeff('0xfb')]+_0x4b4cf8[_0xdeff('0xfc')]+_0x4b4cf8[_0xdeff('0xfd')]+_0x4b4cf8['countabandonedretry']+_0x4b4cf8[_0xdeff('0xf6')]+_0x4b4cf8[_0xdeff('0xfe')]>=_0x4cfd42[_0xdeff('0xff')]){_0x2595e1[_0xdeff('0x100')](_0x4b4cf8,_0x234adb,_0x5eb4cb,'reason19\x20machine....');}else{if(_0x4b4cf8[_0xdeff('0xf6')]>=_0x4cfd42[_0xdeff('0x101')]){_0x2595e1['createStateFinal'](_0x4b4cf8,_0x234adb,_0x5eb4cb,_0xdeff('0x102'));}else{_0x2595e1[_0xdeff('0xc5')]({'active':![],'countmachineretry':_0x4b4cf8[_0xdeff('0xf6')],'scheduledat':moment()[_0xdeff('0x103')](_0x4cfd42[_0xdeff('0x104')],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x4b4cf8[_0xdeff('0xd8')],'ListId':_0x4b4cf8[_0xdeff('0x107')],'VoiceQueueId':_0x4b4cf8[_0xdeff('0xda')]||undefined,'CampaignId':_0x4b4cf8[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x109')));_0x234adb({'reschedule':0x1});}}});}if(_0x130230['type']===_0xdeff('0x82')&&this['campaigns'][_0x130230['queue']][_0xdeff('0xf3')]&&_0x1aea4b['value']===_0xdeff('0xeb')){delete this[_0xdeff('0xe4')][_0x1aea4b[_0xdeff('0xe5')]];this[_0xdeff('0xb7')](this['campaigns'][_0x130230[_0xdeff('0xb8')]]);_0x1cddee=new Hangup(_0x130230,_0x1aea4b);_0x1cddee[_0xdeff('0xad')]=0x12;_0x1cddee['statedesc']=_0xdeff('0xec');_0x1cddee[_0xdeff('0xed')]=_0xdeff('0xee');ami[_0xdeff('0x50')](_0xdeff('0xef'),ut['buildObj'](_0x1cddee,'amd'));this['saveInDb'](_0x1cddee,_0xdeff('0x10a'),_0xdeff('0x10b'));}if(_0x130230['type']===_0xdeff('0x82')&&this[_0xdeff('0x22')][_0x130230[_0xdeff('0xb8')]][_0xdeff('0xf3')]&&_0x1aea4b['value']===_0xdeff('0x10c')){var _0x2595e1=this;return new BPromise(function(_0x40f16d,_0x21dda9){delete _0x2595e1['uniqueId'][_0x1aea4b[_0xdeff('0xe5')]];_0x2595e1['updateOriginated'](_0x2595e1[_0xdeff('0x22')][_0x130230[_0xdeff('0xb8')]]);_0x2595e1[_0xdeff('0x22')][_0x130230[_0xdeff('0xb8')]][_0xdeff('0x63')]+=0x1;_0x2595e1['campaigns'][_0x130230[_0xdeff('0xb8')]][_0xdeff('0x62')]+=0x1;var _0x1d76c6=_0x2595e1['campaigns'][_0x130230[_0xdeff('0xb8')]];var _0x8a338c=new Hangup(_0x130230,_0x1aea4b);_0x8a338c[_0xdeff('0xad')]=0x13;_0x8a338c['statedesc']='Machine';_0x8a338c[_0xdeff('0xed')]='AMD';_0x8a338c['countmachineretry']+=0x1;_0x8a338c['countglobal']+=0x1;_0x8a338c['amd']=!![];ami[_0xdeff('0x50')](_0xdeff('0xef'),ut['buildObj'](_0x8a338c,_0xdeff('0xf8')));_0x2595e1[_0xdeff('0xcf')](_0x8a338c)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xf9')));if(_0x8a338c[_0xdeff('0xfa')]+_0x8a338c[_0xdeff('0x10d')]+_0x8a338c[_0xdeff('0xfb')]+_0x8a338c['countnosuchnumberretry']+_0x8a338c[_0xdeff('0xfd')]+_0x8a338c['countabandonedretry']+_0x8a338c[_0xdeff('0xf6')]+_0x8a338c[_0xdeff('0xfe')]>=_0x1d76c6['dialGlobalMaxRetry']){_0x2595e1[_0xdeff('0x100')](_0x8a338c,_0x40f16d,_0x21dda9,_0xdeff('0x10e'));}else{if(_0x8a338c[_0xdeff('0xf6')]>=_0x1d76c6[_0xdeff('0x101')]){_0x2595e1[_0xdeff('0x10f')](_0x8a338c,_0x40f16d,_0x21dda9,_0xdeff('0x102'));}else{_0x2595e1[_0xdeff('0xc5')]({'active':![],'countmachineretry':_0x8a338c[_0xdeff('0xf6')],'scheduledat':moment()[_0xdeff('0x103')](_0x1d76c6['dialMachineRetryFrequency'],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x8a338c[_0xdeff('0xd8')],'ListId':_0x8a338c[_0xdeff('0x107')],'VoiceQueueId':_0x8a338c[_0xdeff('0xda')]||undefined,'CampaignId':_0x8a338c[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x109')));_0x40f16d({'reschedule':0x1});}}});}}};Dialer[_0xdeff('0x1e')][_0xdeff('0x110')]=function(_0x131631){var _0x39d46d=this[_0xdeff('0xe4')][_0x131631[_0xdeff('0xe5')]];var _0xe259e4=this;var _0x3f8340;if(_0x39d46d&&_0x39d46d[_0xdeff('0x51')]==='ivr'){delete this[_0xdeff('0xe4')][_0x131631[_0xdeff('0xe5')]];this[_0xdeff('0xb7')](this[_0xdeff('0x22')][_0x39d46d[_0xdeff('0xb8')]]);this['campaigns'][_0x39d46d[_0xdeff('0xb8')]][_0xdeff('0x111')]+=0x1;_0x3f8340=new Hangup(_0x39d46d,_0x131631);this[_0xdeff('0xcf')](_0x3f8340)[_0xdeff('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3f8340)[_0xdeff('0xbb')](loggerCatch('[syncHangupIvr]'));}if(_0x39d46d&&_0x39d46d['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x39d46d['queue']][_0xdeff('0x112')])){delete this[_0xdeff('0xe4')][_0x131631[_0xdeff('0xe5')]];this[_0xdeff('0xb7')](this[_0xdeff('0x21')][_0x39d46d['queue']]);this[_0xdeff('0x21')][_0x39d46d[_0xdeff('0xb8')]]['outboundAnswerCallsDay']+=0x1;this[_0xdeff('0x21')][_0x39d46d[_0xdeff('0xb8')]][_0xdeff('0x62')]+=0x1;_0x3f8340=new Hangup(_0x39d46d,_0x131631);_0x3f8340[_0xdeff('0xad')]=0x10;_0x3f8340[_0xdeff('0xae')]=_0xdeff('0x113');_0x3f8340[_0xdeff('0xed')]=_0xdeff('0x114');this[_0xdeff('0xcf')](_0x3f8340)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x115')));this['moveContactManagedDialer'](_0x3f8340)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x116')));}if(_0x39d46d&&_0x39d46d[_0xdeff('0x51')]!==_0xdeff('0x82')&&!isNotNull(this[_0xdeff('0x21')][_0x39d46d[_0xdeff('0xb8')]][_0xdeff('0x112')])){delete this[_0xdeff('0xe4')][_0x131631[_0xdeff('0xe5')]];this['updateOriginated'](this['voiceQueues'][_0x39d46d['queue']]);this['voiceQueues'][_0x39d46d[_0xdeff('0xb8')]][_0xdeff('0x117')]+=0x1;_0x3f8340=new Hangup(_0x39d46d,_0x131631);_0x3f8340['state']=0xc;_0x3f8340[_0xdeff('0xae')]=_0x131631[_0xdeff('0x118')];_0x3f8340[_0xdeff('0xed')]=_0xdeff('0x119');this[_0xdeff('0xcf')](_0x3f8340)[_0xdeff('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xdeff('0xce')](_0x3f8340)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xdeff('0x32')]=function(_0x336882){var _0x1ec70d=this[_0xdeff('0xe4')][_0x336882[_0xdeff('0xe5')]];var _0x441289=this;if(this[_0xdeff('0x21')][_0x336882[_0xdeff('0xb8')]]){if(_0x1ec70d&&_0x1ec70d[_0xdeff('0x51')]!==_0xdeff('0x82')){delete this[_0xdeff('0xe4')][_0x336882['uniqueid']];this['voiceQueues'][_0x336882[_0xdeff('0xb8')]][_0xdeff('0x63')]+=0x1;var _0x5cf7a3=new AgentComplete(_0x1ec70d,_0x336882);if(_0x336882['reason']==='agent'){_0x5cf7a3[_0xdeff('0x11a')]=this[_0xdeff('0x21')][_0x336882[_0xdeff('0xb8')]]['dialQueueProject2']&&this[_0xdeff('0x21')][_0x336882[_0xdeff('0xb8')]]['dialAgiAfterHangupAgent']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xdeff('0xcf')](_0x5cf7a3)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xdeff('0xce')](_0x5cf7a3)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x11b')));}}};Dialer['prototype'][_0xdeff('0x11c')]=function(_0x324027){if(this[_0xdeff('0x21')][_0x324027[_0xdeff('0xb8')]]){if(this[_0xdeff('0xe4')][_0x324027['uniqueid']]&&this[_0xdeff('0xe4')][_0x324027[_0xdeff('0xe5')]][_0xdeff('0x51')]!==_0xdeff('0x82')){this[_0xdeff('0xb7')](this[_0xdeff('0x21')][_0x324027[_0xdeff('0xb8')]]);this[_0xdeff('0xe4')][_0x324027['uniqueid']]['answertime']=moment()[_0xdeff('0x7f')](_0xdeff('0x106'));}}};Dialer['prototype'][_0xdeff('0x11d')]=function(_0x106801,_0x4df8f9){this[_0xdeff('0xcf')](_0x106801)[_0xdeff('0xbb')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4df8f9==0x0){this['moveContactManagedDialer'](_0x106801)['catch'](loggerCatch(_0xdeff('0x11e')));}};Dialer['prototype'][_0xdeff('0x2d')]=function(_0x446879){var _0x16b103=this[_0xdeff('0xe4')][_0x446879['uniqueid']];var _0x3f6200=this;var _0x20d2d1=![];var _0x559de8;var _0x32f459;if(this[_0xdeff('0x21')][_0x446879['queue']]){if(_0x16b103&&_0x16b103[_0xdeff('0x51')]!==_0xdeff('0x82')){delete this['uniqueId'][_0x446879[_0xdeff('0xe5')]];this[_0xdeff('0xb7')](this[_0xdeff('0x21')][_0x446879['queue']]);_0x16b103[_0xdeff('0x11f')]=moment()[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x548681=new QueueCallerAbandon(_0x16b103,_0x446879);if(getSeconds(_0x16b103[_0xdeff('0x11f')],_0x16b103[_0xdeff('0x120')])>=_0x16b103[_0xdeff('0x121')]){this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x72')]+=0x1;this[_0xdeff('0x21')][_0x446879['queue']][_0xdeff('0x68')]+=0x1;this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x73')]+=0x1;_0x548681[_0xdeff('0xad')]=0xa;_0x548681['statedesc']=_0xdeff('0x122');_0x548681['dropreason']='TIMEOUT';_0x548681[_0xdeff('0x11a')]=this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x123')]?moment()[_0xdeff('0x7f')](_0xdeff('0x106')):undefined;_0x548681[_0xdeff('0xfd')]+=0x1;_0x548681['countglobal']+=0x1;_0x559de8=this[_0xdeff('0x21')][_0x446879['queue']][_0xdeff('0x124')];_0x32f459=this[_0xdeff('0x21')][_0x446879['queue']][_0xdeff('0x125')];_0x3f6200[_0xdeff('0xbf')](_0x548681,_0x548681['state'],_0x16b103[_0xdeff('0x126')])[_0xdeff('0x3e')](function(_0x12a4e5){_0x20d2d1=_0x12a4e5[_0xdeff('0x127')]==0x1;if(_0x548681[_0xdeff('0xfd')]>=_0x3f6200['voiceQueues'][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x128')]){_0x3f6200[_0xdeff('0x11d')](_0x548681,_0x12a4e5[_0xdeff('0x127')]);}else{_0x3f6200[_0xdeff('0xc5')]({'active':![],'countdropretry':_0x548681['countdropretry'],'scheduledat':moment()[_0xdeff('0x103')](_0x3f6200['voiceQueues'][_0x446879['queue']][_0xdeff('0x124')],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x16b103[_0xdeff('0xd8')],'ListId':_0x16b103[_0xdeff('0x107')],'VoiceQueueId':_0x16b103[_0xdeff('0xda')]||undefined,'CampaignId':_0x16b103[_0xdeff('0x108')]||undefined})['catch'](loggerCatch(_0xdeff('0x129')));var _0x3d2695=new History(_0x548681);_0x3d2695['state']=0xa;_0x3d2695['statedesc']=_0xdeff('0x122');_0x3d2695[_0xdeff('0xb0')]=moment()[_0xdeff('0x7f')](_0xdeff('0x106'));_0x3d2695['endtime']=_0x3d2695['starttime'];_0x3d2695['calleridname']=_0x548681[_0xdeff('0x12a')];_0x3d2695[_0xdeff('0x12b')]=_0x548681['calleridnum'];_0x3f6200['createHistory'](_0x3d2695)[_0xdeff('0xbb')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xdeff('0x3e')](function(_0x50a3bb){if(_0x20d2d1)_0x3f6200[_0xdeff('0xc0')](_0x548681,_0x559de8,_0x32f459)[_0xdeff('0x3e')](function(_0x1cb1cf){return 0x1;});});}else{this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x67')]+=0x1;_0x548681[_0xdeff('0xad')]=0xb;_0x548681[_0xdeff('0xae')]='Abandoned';_0x548681['dropreason']='CALLEREXIT';_0x548681[_0xdeff('0x12c')]+=0x1;_0x548681[_0xdeff('0xf7')]+=0x1;_0x559de8=this[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x12d')];_0x32f459=this[_0xdeff('0x21')][_0x446879['queue']][_0xdeff('0x125')];_0x3f6200[_0xdeff('0xbf')](_0x548681,_0x548681['state'],_0x16b103[_0xdeff('0x126')])[_0xdeff('0x3e')](function(_0x271def){if(_0x548681[_0xdeff('0x12c')]>=_0x3f6200[_0xdeff('0x21')][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x12e')]){_0x3f6200[_0xdeff('0x11d')](_0x548681,_0x271def[_0xdeff('0x127')]);}else{_0x3f6200[_0xdeff('0xc5')]({'active':![],'countabandonedretry':_0x548681[_0xdeff('0x12c')],'scheduledat':moment()[_0xdeff('0x103')](_0x3f6200['voiceQueues'][_0x446879[_0xdeff('0xb8')]][_0xdeff('0x12d')],'minutes')['format'](_0xdeff('0x106')),'ContactId':_0x16b103[_0xdeff('0xd8')],'ListId':_0x16b103[_0xdeff('0x107')],'VoiceQueueId':_0x16b103[_0xdeff('0xda')]||undefined,'CampaignId':_0x16b103[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2deff9=new History(_0x548681);_0x2deff9['state']=0xb;_0x2deff9[_0xdeff('0xae')]=_0xdeff('0x12f');_0x2deff9['starttime']=moment()[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2deff9[_0xdeff('0xaf')]=_0x2deff9[_0xdeff('0xb0')];_0x2deff9[_0xdeff('0x12a')]=_0x548681['calleridname'];_0x2deff9[_0xdeff('0x12b')]=_0x548681[_0xdeff('0x12b')];_0x3f6200['createHistory'](_0x2deff9)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x130')));}})[_0xdeff('0x3e')](function(_0x3dc5cf){if(_0x20d2d1)_0x3f6200['swapAdditionalPhones'](_0x548681,_0x559de8,_0x32f459)['then'](function(_0xa7c8b5){return 0x1;});});}}}};Dialer['prototype'][_0xdeff('0x37')]=function(_0x4732a7){if(this[_0xdeff('0x131')][_0x4732a7['uniqueid']]){this['actions'][_0x4732a7['uniqueid']][_0xdeff('0xb5')]=_0x4732a7[_0xdeff('0xb5')];}if(this['uniqueId'][_0x4732a7[_0xdeff('0xe5')]]){this[_0xdeff('0xe4')][_0x4732a7[_0xdeff('0xe5')]][_0xdeff('0xb5')]=_0x4732a7[_0xdeff('0xb5')];}};Dialer['prototype']['syncQueueMember']=function(_0x178c45){if(strategy[this[_0xdeff('0x21')][this[_0xdeff('0x131')][_0x178c45['actionid']][_0xdeff('0xb8')]]['strategy']]===_0xdeff('0x132')){if(this['actions'][_0x178c45[_0xdeff('0x133')]]&&_[_0xdeff('0xe6')](this[_0xdeff('0x131')][_0x178c45['actionid']][_0xdeff('0x134')])&&_0x178c45[_0xdeff('0xe2')]==='1'&&_0x178c45['paused']==='0'){if(this[_0xdeff('0x23')][_0x178c45[_0xdeff('0x135')]]){if(!this[_0xdeff('0x23')][_0x178c45['stateinterface']][_0xdeff('0x134')]){this[_0xdeff('0x23')][_0x178c45['stateinterface']][_0xdeff('0x134')]=!![];this[_0xdeff('0x131')][_0x178c45[_0xdeff('0x133')]][_0xdeff('0x134')]=!![];this[_0xdeff('0x131')][_0x178c45[_0xdeff('0x133')]]['stateinterface']=_0x178c45[_0xdeff('0x135')];}}}}else if((strategy[this[_0xdeff('0x21')][this[_0xdeff('0x131')][_0x178c45[_0xdeff('0x133')]][_0xdeff('0xb8')]]['strategy']]||_0xdeff('0x1d'))===_0xdeff('0x1d')){if(this[_0xdeff('0x131')][_0x178c45['actionid']]){if(this[_0xdeff('0x23')][_0x178c45[_0xdeff('0x135')]]){this[_0xdeff('0x131')][_0x178c45['actionid']]['stateinterface']=_0x178c45[_0xdeff('0x135')];if(_['isNil'](this[_0xdeff('0x136')][this[_0xdeff('0x131')][_0x178c45[_0xdeff('0x133')]]['queue']])){this[_0xdeff('0x136')][this[_0xdeff('0x131')][_0x178c45['actionid']][_0xdeff('0xb8')]]=[];}this['queueBooked'][this['actions'][_0x178c45[_0xdeff('0x133')]]['queue']][_0xdeff('0x137')](_['merge'](_[_0xdeff('0xd7')](this[_0xdeff('0x131')][_0x178c45[_0xdeff('0x133')]],[_0xdeff('0x138'),_0xdeff('0x135')]),{'status':_0x178c45[_0xdeff('0xe2')],'paused':_0x178c45['paused']}));}}}};function unlockQueueStatus(_0x598d44,_0x1890ac){setTimeout(function(){if(_[_0xdeff('0x40')](_0x598d44[_0xdeff('0x139')])){loggerBooked[_0xdeff('0x9a')](_0xdeff('0x13a'),_0x1890ac);}_0x598d44[_0xdeff('0x139')]=!![];loggerBooked[_0xdeff('0x84')](_0xdeff('0x13b'),_0x1890ac,JSON[_0xdeff('0x4d')](_[_0xdeff('0xd7')](_0x598d44,['name','queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0xdeff('0x3c')]=function(_0x94d13c){var _0x44bf7e=this;var _0x128435=_0x44bf7e[_0xdeff('0x21')][_0x44bf7e[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['queue']];if(strategy[this[_0xdeff('0x21')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]]['strategy']]==='roundrobin'){if(this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]&&this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0x135')]){this[_0xdeff('0x95')][_0xdeff('0x13c')](this['actions'][_0x94d13c[_0xdeff('0x133')]]['idHopper'],this[_0xdeff('0x131')][_0x94d13c['actionid']]['stateinterface'])[_0xdeff('0xbb')](function(_0x9cbd3d){logger[_0xdeff('0x9a')](_0xdeff('0x13d'),util[_0xdeff('0x99')](_0x9cbd3d,{'showHidden':![],'depth':null}));})['finally'](function(){_0x44bf7e['updateOriginated'](_0x44bf7e['voiceQueues'][_0x44bf7e[_0xdeff('0x131')][_0x94d13c['actionid']][_0xdeff('0xb8')]]);_0x44bf7e[_0xdeff('0x23')][_0x44bf7e['actions'][_0x94d13c['actionid']][_0xdeff('0x135')]]['locked']=![];delete _0x44bf7e[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]];unlockQueueStatus(_0x128435);});}else{this[_0xdeff('0xb7')](this['voiceQueues'][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['queue']]);this[_0xdeff('0xc5')]({'active':![],'ContactId':this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['ContactId'],'ListId':this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['ListId'],'VoiceQueueId':this['actions'][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xda')]||undefined,'CampaignId':this[_0xdeff('0x131')][_0x94d13c['actionid']][_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x13e')));delete this['actions'][_0x94d13c[_0xdeff('0x133')]];unlockQueueStatus(_0x128435);}}else if((strategy[this[_0xdeff('0x21')][this[_0xdeff('0x131')][_0x94d13c['actionid']][_0xdeff('0xb8')]][_0xdeff('0x53')]]||'rrmemory')===_0xdeff('0x1d')){var _0x37509b;if(this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]&&!_[_0xdeff('0x4b')](this[_0xdeff('0x136')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]])){if(this[_0xdeff('0x2a')][_0x44bf7e['actions'][_0x94d13c['actionid']][_0xdeff('0xb8')]]){this[_0xdeff('0x2a')][_0x44bf7e[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['queue']]=this[_0xdeff('0x2a')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]]?this[_0xdeff('0x2a')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]]:this[_0xdeff('0x136')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]]?this['queueBooked'][this['actions'][_0x94d13c['actionid']][_0xdeff('0xb8')]][_0xdeff('0x13f')]||0x0:0x0;}this[_0xdeff('0x136')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]]['queue']][_0xdeff('0x13f')]=this[_0xdeff('0x2a')][this[_0xdeff('0x131')][_0x94d13c[_0xdeff('0x133')]][_0xdeff('0xb8')]];for(var _0x27a7e0=0x0;_0x27a7e0=0x0;})[_0xdeff('0xbb')](myreject(_0x65d3f8)));}}else{_0x38f3a3[_0xdeff('0x137')](ami[_0xdeff('0xb4')]({'action':_0xdeff('0x159'),'command':util[_0xdeff('0x7f')]('iftime\x20%s,%s',_0x200f46,!_['isUndefined'](config[_0xdeff('0x155')][_0x274fcc])?_0x274fcc:'')})[_0xdeff('0x3e')](function(_0x3a89ce){return _0x3a89ce[_0xdeff('0x15a')][_0xdeff('0x15b')]('true')>=0x0;})[_0xdeff('0xbb')](myreject(_0x65d3f8)));}BPromise[_0xdeff('0x15c')](_0x38f3a3)['then'](function(_0x5c5649){var _0x5775a4=_[_0xdeff('0x15d')](_0x5c5649);if(_0x5775a4){return _0x3cac19(_0x5775a4);}else{_0x3c7ce6[_0xdeff('0x41')]=_0x14ba8d?_0xdeff('0x15e'):_0xdeff('0x15f');return _0x65d3f8(msgResponse('[ifTime][promiseAll]',_0xdeff('0x153'),_0xdeff('0x160')+_0x14ba8d+'\x20'+_0x3693d9+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x200f46,{'showHidden':![],'depth':null})+_0xdeff('0x161')+_0x274fcc));}})[_0xdeff('0xbb')](function(_0x5b8607){return _0x65d3f8(msgResponse(_0xdeff('0x14f'),'Failure',JSON[_0xdeff('0x4d')](_0x5b8607)));});});};Dialer[_0xdeff('0x1e')]['checkDialMethod']=function(_0x301d18){var _0x2318b3=this;return function(){switch(_0x301d18[_0xdeff('0x162')]){case _0xdeff('0x163'):freeVariablesPredictive(_0x301d18);_0x2318b3[_0xdeff('0x164')](_0x301d18,0x1);break;case _0xdeff('0x165'):freeVariablesPredictive(_0x301d18);_0x2318b3['handlePower'](_0x301d18,_0x301d18[_0xdeff('0x166')]);break;case _0xdeff('0xb'):_0x2318b3[_0xdeff('0xb')](_0x301d18);break;case _0xdeff('0xa'):freeVariablesPredictive(_0x301d18);_0x2318b3[_0xdeff('0x164')](_0x301d18,0x1);break;default:freeVariablesPredictive(_0x301d18);logger[_0xdeff('0x9a')](_0xdeff('0x167'),_0x301d18[_0xdeff('0x43')],_0xdeff('0x168'));}};};Dialer[_0xdeff('0x1e')][_0xdeff('0x169')]=function(_0x31cf2f){var _0x5d7dd1=this;return function(){_0x5d7dd1['handleIvr'](_0x31cf2f);};};Dialer['prototype'][_0xdeff('0xd')]=function(_0x22aafa){var _0x26cca3=this;if(isNotPreview(_0x22aafa[_0xdeff('0x162')])){if(isVoiceQueueOutbound(_0x22aafa[_0xdeff('0x51')])&&isActive(_0x22aafa[_0xdeff('0x5e')])){_0x22aafa[_0xdeff('0xa6')]=!![];BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](checkIsLoggedIn(_0x22aafa,_0x22aafa[_0xdeff('0x55')]))[_0xdeff('0x3e')](checkIsActive(_0x22aafa,_0x22aafa['dialActive']))[_0xdeff('0x3e')](checkInterval(_0x22aafa))[_0xdeff('0x3e')](_0x26cca3[_0xdeff('0x14b')](_0x22aafa))[_0xdeff('0x3e')](_0x26cca3[_0xdeff('0x16a')](_0x22aafa[_0xdeff('0x16b')],_0x22aafa[_0xdeff('0x16c')],_0x22aafa['name'],_0x22aafa))[_0xdeff('0x3e')](_0x26cca3[_0xdeff('0x150')](_0x22aafa[_0xdeff('0x48')],_0x22aafa[_0xdeff('0x16c')],_0x22aafa['name'],_0x22aafa))[_0xdeff('0x3e')](_0x26cca3[_0xdeff('0x16d')](_0x22aafa))[_0xdeff('0xbb')](loggerCatchQueueSummary('[syncQueueSummary]',_0x22aafa));}else{notSendMessagesQueue(_0x22aafa);}}else{freeVariablesPredictive(_0x22aafa);}};Dialer['prototype'][_0xdeff('0x16e')]=_[_0xdeff('0x16f')](function(){var _0x13199b=_['filter'](this[_0xdeff('0x21')],function(_0x30254e){return _0x30254e[_0xdeff('0x170')];});var _0x4ce84b=_[_0xdeff('0x171')](this[_0xdeff('0x23')],function(_0x446fdf){return _0x446fdf[_0xdeff('0x172')]&&_0x446fdf['status']===_0xdeff('0xe0');});if(_0x13199b['length']>0x0&&_0x4ce84b[_0xdeff('0x9c')]>0x0){return BPromise['resolve']()['then'](cmHopper[_0xdeff('0x173')](_[_0xdeff('0x174')](_0x13199b,'id'),previewRecallmeReminderInterval,_[_0xdeff('0x174')](_0x4ce84b,'id')))['then'](function(_0x162c2c){for(var _0x33def7=0x0;_0x33def7<_0x162c2c[_0xdeff('0x9c')];_0x33def7++){var _0x228048=_0x162c2c[_0x33def7][_0xdeff('0x175')][_0xdeff('0x43')];if(_0x228048)io['to'](util[_0xdeff('0x7f')](_0xdeff('0x176'),_0x228048))[_0xdeff('0x50')](_0xdeff('0x177'),{'hopper':_0x162c2c[_0x33def7]});}})[_0xdeff('0xbb')](function(_0x3e40d2){logger[_0xdeff('0x9a')]('checkPreviewRecallReminder',_0x3e40d2);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xdeff('0x1e')][_0xdeff('0x178')]=function(){var _0x1137f0=this;var _0x13675b;for(var _0x3413c3 in this['campaigns']){if(typeof this['campaigns'][_0x3413c3]!=='undefined'){_0x13675b=this['campaigns'][_0x3413c3];if(isCampaignIvr(_0x13675b['type'])&&isActive(_0x13675b[_0xdeff('0x179')])){_0x13675b['sendMessageOneNotActive']=!![];BPromise[_0xdeff('0xba')]()[_0xdeff('0x3e')](checkIsActive(_0x13675b,_0x13675b[_0xdeff('0x179')]))[_0xdeff('0x3e')](checkInterval(_0x13675b))[_0xdeff('0x3e')](_0x1137f0['checkIsTrunkReachable'](_0x13675b))[_0xdeff('0x3e')](_0x1137f0[_0xdeff('0x16a')](_0x13675b[_0xdeff('0x16b')],_0x13675b[_0xdeff('0x16c')],_0x13675b[_0xdeff('0x43')],_0x13675b))[_0xdeff('0x3e')](_0x1137f0['checkIfTimeIntervals'](_0x13675b[_0xdeff('0x48')],_0x13675b[_0xdeff('0x16c')],_0x13675b['name'],_0x13675b))['then'](_0x1137f0[_0xdeff('0x169')](_0x13675b))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x13675b));}else{notSendMessagesCampaign(_0x13675b);}}}};function getCallerIdRandom(_0x534b0,_0x903bbc){var _0x3e2f48;var _0x50c1e5;var _0x58a768;if(_0x903bbc<=0x0){_0x903bbc=0x1;}_0x3e2f48=new RegExp(_0xdeff('0x17a')+_0x903bbc+'}$');_0x50c1e5=Math['pow'](0xa,_0x903bbc-0x1);_0x58a768=Math[_0xdeff('0x17b')](0xa,_0x903bbc)-0x1;return util[_0xdeff('0x7f')]('%s',_['replace'](_0x534b0,_0x3e2f48,_[_0xdeff('0x17c')](_0x50c1e5,_0x58a768)));}function extractCalleridName(_0x39783f){var _0x51a2e1=_0x39783f[_0xdeff('0x17d')](/"(.*?)"/);return _0x51a2e1?_0x51a2e1[0x1]:_0x39783f;}function extractCalleridNumber(_0x28c7c8){var _0x28d0c0=_0x28c7c8[_0xdeff('0x17d')](/<(.*?)>/);return _0x28d0c0?_0x28d0c0[0x1]:_0x28c7c8;}Dialer['prototype'][_0xdeff('0x17e')]=function(_0x485ce4,_0x5c7c19){var _0x55d947=this;var _0x4383b1=uuid['v4']();this[_0xdeff('0x131')][_0x4383b1]=new Action(_0x485ce4,_0x5c7c19,_0x4383b1);return new BPromise(function(_0x113264,_0x4a85a5){if(_[_0xdeff('0x40')](_0x485ce4)&&typeof _0x485ce4!==_0xdeff('0x17f')){return _0x4a85a5(msgResponse(_0xdeff('0x180'),_0xdeff('0x153'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x5c7c19[_0xdeff('0x181')])||_0x5c7c19[_0xdeff('0x181')]===null){return _0x4a85a5(msgResponse(_0xdeff('0x180'),_0xdeff('0x153'),_0xdeff('0x182')));}var _0x1471ac={'XMD-CALLERID':_0x55d947['actions'][_0x4383b1]['getCaller'](),'XMD-AGI':_0x485ce4[_0xdeff('0x112')]?util[_0xdeff('0x7f')](_0xdeff('0x183'),ipAgi,_0x485ce4[_0xdeff('0x112')]):_0xdeff('0x184'),'XMD-AGIAFTER':_0x485ce4[_0xdeff('0x123')]?util['format'](_0xdeff('0x183'),ipAgi,_0x485ce4['dialQueueProject2']):_0xdeff('0x184'),'XMD-QUEUE':_0x485ce4[_0xdeff('0x51')]===_0xdeff('0x52')?util[_0xdeff('0x7f')](_0xdeff('0x185'),_0x485ce4[_0xdeff('0x43')],_0x485ce4['dialQueueOptions']||'',_0x485ce4[_0xdeff('0x186')]?'c':'',_0x485ce4['dialQueueTimeout']||0x3):_0xdeff('0x184'),'XMD-CONTACTID':_0x5c7c19[_0xdeff('0xd8')],'XMD-CDRTYPE':_0xdeff('0x9'),'CALLERID(all)':_0x55d947['actions'][_0x4383b1][_0xdeff('0x187')](),'XMD-AMD':_0x485ce4[_0xdeff('0xf3')]?_0xdeff('0x188'):_0xdeff('0x184'),'XMD-DESTINATION':_0xdeff('0xea')};if(_0x485ce4['dialAMDActive']){_0x1471ac[_0xdeff('0x189')]=_0x485ce4['dialAMDInitialSilence']||0x9c4;_0x1471ac['XMD-AMDGREETING']=_0x485ce4['dialAMDGreeting']||0x5dc;_0x1471ac[_0xdeff('0x18a')]=_0x485ce4[_0xdeff('0x18b')]||0x320;_0x1471ac[_0xdeff('0x18c')]=_0x485ce4['dialAMDTotalAnalysisTime']||0x1388;_0x1471ac[_0xdeff('0x18d')]=_0x485ce4['dialAMDMinWordLength']||0x64;_0x1471ac[_0xdeff('0x18e')]=_0x485ce4[_0xdeff('0x18f')]||0x32;_0x1471ac['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x485ce4[_0xdeff('0x190')]||0x3;_0x1471ac[_0xdeff('0x191')]=_0x485ce4['dialAMDSilenceThreshold']||0x100;_0x1471ac[_0xdeff('0x192')]=_0x485ce4['dialAMDMaximumWordLength']||0x1388;}if(_0x485ce4['type']===_0xdeff('0x52')){_0x1471ac[_0xdeff('0x193')]=_0x5c7c19[_0xdeff('0xda')];}else{_0x1471ac[_0xdeff('0x194')]=_0x5c7c19[_0xdeff('0x108')];}for(var _0x4cd1c2 in _0x5c7c19[_0xdeff('0x195')]){if(typeof _0x5c7c19[_0xdeff('0x195')][_0x4cd1c2]!==_0xdeff('0x9e')){if(isNotNull(_0x5c7c19[_0xdeff('0x195')][_0x4cd1c2])&&_0x4cd1c2!=='id'&&_0x4cd1c2!==_0xdeff('0x196')&&_0x4cd1c2!==_0xdeff('0x197')&&_0x4cd1c2!==_0xdeff('0x198')){_0x1471ac[util[_0xdeff('0x7f')]('%s%s',_0xdeff('0x199'),_['toUpper'](_0x4cd1c2))]=_0x5c7c19[_0xdeff('0x195')][_0x4cd1c2];}}}var _0x591199=_0x55d947['isTrunkReachable'](_0x485ce4['Trunk'])?getCallerId(_0x485ce4[_0xdeff('0x7d')]['callerid'],_0x485ce4[_0xdeff('0x5f')],_0x485ce4[_0xdeff('0x19a')]>0x0?getCallerIdRandom(_0x485ce4[_0xdeff('0x60')],_0x485ce4[_0xdeff('0x19a')]):_0x485ce4[_0xdeff('0x60')]):getCallerId(_[_0xdeff('0xe6')](_0x485ce4['TrunkBackup'])?_0x485ce4[_0xdeff('0x7d')]['callerid']:_0x485ce4[_0xdeff('0x14c')][_0xdeff('0x7e')],_0x485ce4[_0xdeff('0x5f')],_0x485ce4[_0xdeff('0x19a')]>0x0?getCallerIdRandom(_0x485ce4[_0xdeff('0x60')],_0x485ce4['dialRandomLastDigitCallerIdNumber']):_0x485ce4[_0xdeff('0x60')]);if(_0x591199){_0x1471ac[_0xdeff('0x19b')]=_0x55d947['actions'][_0x4383b1][_0xdeff('0x19c')]=extractCalleridName(_0x591199);_0x1471ac[_0xdeff('0x19d')]=_0x5c7c19['phone'];}return ami[_0xdeff('0xb4')]({'actionid':_0x4383b1,'action':_0xdeff('0x180'),'channel':_0x55d947[_0xdeff('0xdf')](_0x485ce4[_0xdeff('0x7d')])?util[_0xdeff('0x7f')](_0xdeff('0x19e'),_0x485ce4[_0xdeff('0x7d')][_0xdeff('0x43')],isNotNull(_0x485ce4[_0xdeff('0x19f')])?_0x485ce4['dialPrefix'][_0xdeff('0x1a0')]()||'':'',_0x485ce4[_0xdeff('0x1a1')]>0x0?_0x5c7c19[_0xdeff('0x181')]['substring'](_0x485ce4['dialCutDigit']):_0x5c7c19['phone']):util[_0xdeff('0x7f')]('SIP/%s/%s%s',_[_0xdeff('0xe6')](_0x485ce4['TrunkBackup'])?_0x485ce4['Trunk'][_0xdeff('0x43')]:_0x485ce4[_0xdeff('0x14c')][_0xdeff('0x43')],isNotNull(_0x485ce4[_0xdeff('0x19f')])?_0x485ce4[_0xdeff('0x19f')][_0xdeff('0x1a0')]()||'':'',_0x485ce4[_0xdeff('0x1a1')]>0x0?_0x5c7c19[_0xdeff('0x181')][_0xdeff('0x1a2')](_0x485ce4[_0xdeff('0x1a1')]):_0x5c7c19[_0xdeff('0x181')]),'callerid':_0x591199,'Exten':_0xdeff('0xea'),'Context':'from-sip','Priority':'1','variable':_0x1471ac,'timeout':(_0x485ce4[_0xdeff('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4383b1})[_0xdeff('0x3e')](function(_0x23d961){return _0x113264(_0x23d961);})[_0xdeff('0xbb')](function(_0x43c0fa){_0x485ce4[_0xdeff('0x6b')]+=0x1;var _0x26c61f=new History(_0x55d947['actions'][_0x4383b1]);logger[_0xdeff('0x9a')](util[_0xdeff('0x7f')]('[originateError]:\x20%s',JSON[_0xdeff('0x4d')](_0x43c0fa)));_0x26c61f['state']=0xe;_0x26c61f[_0xdeff('0xae')]='OriginateError';_0x26c61f['starttime']=moment()[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x26c61f[_0xdeff('0xaf')]=_0x26c61f[_0xdeff('0xb0')];_0x55d947[_0xdeff('0xcf')](_0x26c61f)['catch'](loggerCatch(_0xdeff('0x1a3')));_0x55d947[_0xdeff('0xce')](_0x26c61f)['catch'](loggerCatch(_0xdeff('0x1a3')))[_0xdeff('0x1a4')](function(){delete _0x55d947['actions'][_0x4383b1];return _0x4a85a5(msgResponse(_0xdeff('0x180'),'Error',_0xdeff('0x1a5')));});});});};Dialer[_0xdeff('0x1e')][_0xdeff('0x30')]=function(_0x28718a){var _0xa27dd3=this[_0xdeff('0x131')][_0x28718a['actionid']];if(_0xa27dd3){delete this[_0xdeff('0x131')][_0x28718a[_0xdeff('0x133')]];_0xa27dd3[_0xdeff('0x120')]=moment()[_0xdeff('0x7f')](_0xdeff('0x106'));var _0x2ee94f=_0xa27dd3[_0xdeff('0x51')]===_0xdeff('0x82')?this[_0xdeff('0x22')][_0xa27dd3[_0xdeff('0xb8')]]:this[_0xdeff('0x21')][_0xa27dd3[_0xdeff('0x1a6')]()];if(!this[_0xdeff('0xdd')](_0x28718a[_0xdeff('0x1a7')])){this[_0xdeff('0xb7')](_0x2ee94f);return this[_0xdeff('0x1a8')](_0xa27dd3,_0x2ee94f,_0x28718a)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1a9')));}this['uniqueId'][_0x28718a['uniqueid']]=_0xa27dd3;}};Dialer[_0xdeff('0x1e')]['checkRetriveMax']=function(_0x2cc5ae,_0x39db3a,_0x6d2931){var _0x54a34d=new History(_0x39db3a);if(_0x54a34d['countbusyretry']+_0x54a34d[_0xdeff('0x10d')]+_0x54a34d['countnoanswerretry']+_0x54a34d[_0xdeff('0xfc')]+_0x54a34d['countdropretry']+_0x54a34d['countabandonedretry']+_0x54a34d[_0xdeff('0xf6')]+_0x54a34d['countagentrejectretry']>=_0x6d2931[_0xdeff('0xff')]-0x1){return!![];}switch(_0x2cc5ae){case 0x3:if(_0x54a34d[_0xdeff('0xfb')]>=_0x6d2931[_0xdeff('0x1aa')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countnoanswerretry':_0x54a34d[_0xdeff('0xfb')]+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931['dialNoAnswerRetryFrequency'],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x54a34d[_0xdeff('0xd8')],'ListId':_0x54a34d[_0xdeff('0x107')],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1ab')));break;case 0x5:if(_0x54a34d[_0xdeff('0xfa')]>=_0x6d2931['dialBusyMaxRetry']-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countbusyretry':_0x54a34d[_0xdeff('0xfa')]+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931[_0xdeff('0x1ac')],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x54a34d[_0xdeff('0xd8')],'ListId':_0x54a34d['ListId'],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d['CampaignId']||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1ad')));break;case 0x8:if(_0x54a34d[_0xdeff('0x10d')]>=_0x6d2931[_0xdeff('0x1ae')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countcongestionretry':_0x54a34d[_0xdeff('0x10d')]+=0x1,'scheduledat':moment()['add'](_0x6d2931[_0xdeff('0x1af')],_0xdeff('0x105'))['format'](_0xdeff('0x106')),'ContactId':_0x54a34d['ContactId'],'ListId':_0x54a34d[_0xdeff('0x107')],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1b0')));break;case 0x0:if(_0x54a34d[_0xdeff('0xfc')]>=_0x6d2931[_0xdeff('0x1b1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x54a34d['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931[_0xdeff('0x1b2')],_0xdeff('0x105'))[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54a34d[_0xdeff('0xd8')],'ListId':_0x54a34d[_0xdeff('0x107')],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x54a34d[_0xdeff('0xfd')]>=_0x6d2931[_0xdeff('0x128')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countdropretry':_0x54a34d[_0xdeff('0xfd')]+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931[_0xdeff('0x124')],'minutes')[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x54a34d['ContactId'],'ListId':_0x54a34d['ListId'],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x54a34d['countabandonedretry']>=_0x6d2931[_0xdeff('0x12e')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countabandonedretry':_0x54a34d[_0xdeff('0x12c')]+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931['dialAbandonedRetryFrequency'],_0xdeff('0x105'))[_0xdeff('0x7f')](_0xdeff('0x106')),'ContactId':_0x54a34d['ContactId'],'ListId':_0x54a34d[_0xdeff('0x107')],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d['CampaignId']||undefined})['catch'](loggerCatch(_0xdeff('0x1b3')));break;case 0x13:if(_0x54a34d['countmachineretry']>=_0x6d2931[_0xdeff('0x101')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countmachineretry':_0x54a34d['countmachineretry']+=0x1,'scheduledat':moment()[_0xdeff('0x103')](_0x6d2931[_0xdeff('0x104')],'minutes')[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54a34d['ContactId'],'ListId':_0x54a34d['ListId'],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x109')));break;case 0x14:if(_0x54a34d[_0xdeff('0xfe')]>=_0x6d2931[_0xdeff('0x1b4')]-0x1){return!![];}this[_0xdeff('0xc5')]({'active':![],'countagentrejectretry':_0x54a34d[_0xdeff('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x6d2931['dialAgentRejectRetryFrequency'],_0xdeff('0x105'))[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54a34d['ContactId'],'ListId':_0x54a34d[_0xdeff('0x107')],'VoiceQueueId':_0x54a34d[_0xdeff('0xda')]||undefined,'CampaignId':_0x54a34d[_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1b5')));break;default:return!![];}};Dialer[_0xdeff('0x1e')]['callProgressDetecting']=function(_0x308d66,_0xa143f0,_0x3cacac){var _0x1e526d=this;var _0x32fc76=new History(_0x308d66);var _0x53c071=![];var _0x2afd17;var _0xe89fb9;return new BPromise(function(_0x38d94e,_0x366ce2){if(_[_0xdeff('0x40')](_0xa143f0)&&typeof _0xa143f0!==_0xdeff('0x17f')){return _0x366ce2(msgResponse(_0xdeff('0x1b6'),_0xdeff('0x153'),_0xdeff('0x1b7')));}if(_[_0xdeff('0x40')](_0x3cacac)&&typeof _0x3cacac!==_0xdeff('0x17f')){return _0x366ce2(msgResponse(_0xdeff('0x1b6'),_0xdeff('0x153'),_0xdeff('0x1b8')));}_0x1e526d[_0xdeff('0xbf')](_0x32fc76,_0x3cacac['reason'],_0xa143f0)['then'](function(_0x22913f){if(_0x22913f[_0xdeff('0x127')]==0x1)_0x53c071=!![];switch(_0x3cacac[_0xdeff('0x1b9')]){case'0':_0xa143f0[_0xdeff('0x6a')]+=0x1;_0x32fc76[_0xdeff('0xad')]=0x0;_0x32fc76[_0xdeff('0xae')]='NoSuchNumber';_0x32fc76['countnosuchnumberretry']+=0x1;_0x32fc76[_0xdeff('0xf7')]+=0x1;ami[_0xdeff('0x50')]('custom:agentnosuchnumber',ut[_0xdeff('0xf0')](_0x308d66,'nosuchnumber'));_0x2afd17=_0xa143f0[_0xdeff('0x1b2')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];_0x1e526d[_0xdeff('0xcf')](_0x32fc76)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xf9')));if(_0x1e526d[_0xdeff('0x1ba')](0x0,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76[_0xdeff('0xfc')]>=_0xa143f0[_0xdeff('0x1b1')]){_0x1e526d['createStateFinal'](_0x32fc76,_0x38d94e,_0x366ce2,'reason\x200\x20no\x20such\x20number....');}else{_0x1e526d[_0xdeff('0x100')](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1bb'));}}break;case'3':_0xa143f0[_0xdeff('0x69')]+=0x1;_0x32fc76[_0xdeff('0xad')]=0x3;_0x32fc76[_0xdeff('0xae')]=_0xdeff('0x1bc');_0x32fc76[_0xdeff('0xfb')]+=0x1;_0x32fc76['countglobal']+=0x1;ami[_0xdeff('0x50')](_0xdeff('0x1bd'),ut['buildObj'](_0x308d66,'noanswer'));_0x2afd17=_0xa143f0[_0xdeff('0x1be')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];_0x1e526d[_0xdeff('0xcf')](_0x32fc76)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1bf')));if(_0x1e526d[_0xdeff('0x1ba')](0x3,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76[_0xdeff('0xfb')]>=_0xa143f0[_0xdeff('0x1aa')]){_0x1e526d['createStateFinal'](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c0'));}else{_0x1e526d[_0xdeff('0x100')](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c0'));}}break;case'5':_0xa143f0[_0xdeff('0x65')]+=0x1;_0x32fc76[_0xdeff('0xad')]=0x5;_0x32fc76[_0xdeff('0xae')]=_0xdeff('0x1c1');_0x32fc76[_0xdeff('0xfa')]+=0x1;_0x32fc76[_0xdeff('0xf7')]+=0x1;ami['emit'](_0xdeff('0x1c2'),ut['buildObj'](_0x308d66,'busy'));_0x2afd17=_0xa143f0[_0xdeff('0x1ac')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];_0x1e526d['createHistory'](_0x32fc76)[_0xdeff('0xbb')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1e526d[_0xdeff('0x1ba')](0x5,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76['countbusyretry']>=_0xa143f0[_0xdeff('0x1c3')]){_0x1e526d['createStateFinal'](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c4'));}else{_0x1e526d['stateGlobal'](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c4'));}}break;case'8':_0xa143f0[_0xdeff('0x1c5')]+=0x1;_0x32fc76[_0xdeff('0xad')]=0x8;_0x32fc76['statedesc']='Congestion';_0x32fc76['countcongestionretry']+=0x1;_0x32fc76['countglobal']+=0x1;_0x2afd17=_0xa143f0[_0xdeff('0x1af')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];ami[_0xdeff('0x50')](_0xdeff('0x1c6'),ut[_0xdeff('0xf0')](_0x308d66,_0xdeff('0x1c7')));_0x1e526d[_0xdeff('0xcf')](_0x32fc76)[_0xdeff('0xbb')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1e526d[_0xdeff('0x1ba')](0x8,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76[_0xdeff('0x10d')]>=_0xa143f0[_0xdeff('0x1ae')]){_0x1e526d['createStateFinal'](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c8'));}else{_0x1e526d[_0xdeff('0x100')](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1c8'));}}break;case'11':_0xa143f0[_0xdeff('0x1c9')]+=0x1;_0x32fc76[_0xdeff('0xad')]=0xb;_0x32fc76[_0xdeff('0xae')]='Abandoned';_0x32fc76[_0xdeff('0x12c')]+=0x1;_0x32fc76[_0xdeff('0xf7')]+=0x1;_0x2afd17=_0xa143f0[_0xdeff('0x12d')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];_0x1e526d[_0xdeff('0xcf')](_0x32fc76)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1e526d[_0xdeff('0x1ba')](0xb,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76[_0xdeff('0x12c')]>=_0xa143f0[_0xdeff('0x12e')]){_0x1e526d[_0xdeff('0x10f')](_0x32fc76,_0x38d94e,_0x366ce2,'reason\x2011\x20abandoned');}else{_0x1e526d[_0xdeff('0x100')](_0x32fc76,_0x38d94e,_0x366ce2,'reason\x2011\x20abandoned');}}break;case'20':_0xa143f0['outboundRejectCallsDay']+=0x1;_0x32fc76[_0xdeff('0xad')]=0x14;_0x32fc76[_0xdeff('0xae')]=_0xdeff('0x1ca');_0x32fc76[_0xdeff('0xfe')]+=0x1;_0x32fc76['countglobal']+=0x1;_0x2afd17=_0xa143f0[_0xdeff('0x1cb')];_0xe89fb9=_0xa143f0[_0xdeff('0x125')];ami[_0xdeff('0x50')]('custom:agentreject',ut[_0xdeff('0xf0')](_0x308d66,'agentreject'));_0x1e526d[_0xdeff('0xcf')](_0x32fc76)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1cc')));if(_0x1e526d[_0xdeff('0x1ba')](0x14,_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76['countagentrejectretry']>=_0xa143f0[_0xdeff('0x1b4')]){_0x1e526d[_0xdeff('0x10f')](_0x32fc76,_0x38d94e,_0x366ce2,_0xdeff('0x1cd'));}else{_0x1e526d['stateGlobal'](_0x32fc76,_0x38d94e,_0x366ce2,'reason\x2020\x20agentreject');}}break;default:_0xa143f0['outboundUnknownCallsDay']+=0x1;_0x32fc76[_0xdeff('0xad')]=0xc;_0x32fc76[_0xdeff('0xae')]=_0x3cacac['reason'];_0x2afd17=_0xa143f0[_0xdeff('0x1cb')];_0xe89fb9=_0xa143f0['callAdditionalPhoneAfterMin'];_0x1e526d[_0xdeff('0xcf')](_0x32fc76)[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1ce')));if(_0x1e526d[_0xdeff('0x1ba')](_0x3cacac['reason'],_0x308d66,_0xa143f0)&&!_0x53c071){if(_0x32fc76[_0xdeff('0xfa')]+_0x32fc76[_0xdeff('0x10d')]+_0x32fc76['countnoanswerretry']+_0x32fc76[_0xdeff('0xfc')]+_0x32fc76[_0xdeff('0xfd')]+_0x32fc76['countabandonedretry']+_0x32fc76[_0xdeff('0xf6')]+_0x32fc76[_0xdeff('0xfe')]>=_0xa143f0['dialGlobalMaxRetry']){_0x1e526d['stateGlobal'](_0x32fc76,_0x38d94e,_0x366ce2,_0x3cacac['reason']);}else{_0x1e526d[_0xdeff('0x10f')](_0x32fc76,_0x38d94e,_0x366ce2,_0x3cacac[_0xdeff('0x1b9')]);}}}})[_0xdeff('0x3e')](function(_0x30dad2){if(_0x53c071){_0x1e526d[_0xdeff('0xc0')](_0x32fc76,_0x2afd17,_0xe89fb9)[_0xdeff('0x3e')](function(_0x24b947){return _0x38d94e(0x1);});}});});};Dialer[_0xdeff('0x1e')][_0xdeff('0x100')]=function(_0xd39822,_0x3da6a6,_0x28fbb3,_0x2baaa7){var _0x421fa1=new Final(_0xd39822);_0x421fa1[_0xdeff('0xad')]=0xf;_0x421fa1[_0xdeff('0xae')]=_0xdeff('0x1cf');this[_0xdeff('0x10f')](_0x421fa1,_0x3da6a6,_0x28fbb3,_0x2baaa7);};Dialer[_0xdeff('0x1e')][_0xdeff('0x10f')]=function(_0xf81923,_0x3cee39,_0xb113fd,_0x2f4de3){this[_0xdeff('0xce')](_0xf81923)[_0xdeff('0x3e')](function(){return _0x3cee39(msgResponse(_0xdeff('0x1b6'),_0xdeff('0xde'),_0x2f4de3));})['catch'](function(){return _0xb113fd(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0xdeff('0x1e')][_0xdeff('0xb')]=function(_0x3645b2){var _0x42a216=_0x3645b2[_0xdeff('0x1d0')]/0x64;var _0x4c4e47=_0x3645b2['outboundDropCallsDayTimeout']/(_0x3645b2['outboundDropCallsDayTimeout']+_0x3645b2[_0xdeff('0x63')]);var _0x551f0a=Math[_0xdeff('0x1d1')](_0x3645b2[_0xdeff('0x77')]*(_0x3645b2['predictiveIntervalMaxThreshold']/0x64));var _0x5be2ea=Math[_0xdeff('0x1d1')](_0x3645b2[_0xdeff('0x77')]*(_0x3645b2['predictiveIntervalMinThreshold']/0x64));var _0x273bfc=_0x3645b2[_0xdeff('0x54')]+_0x3645b2[_0xdeff('0xa7')];var _0x3d1485=Math[_0xdeff('0x1d2')](_0x3645b2[_0xdeff('0x78')]*_0x3645b2[_0xdeff('0x7a')]*_0x3645b2[_0xdeff('0x74')]*_0x3645b2[_0xdeff('0x75')]);if(_[_0xdeff('0x40')](_0x3645b2['startProgressive'])){if(!_[_0xdeff('0x40')](_0x3645b2[_0xdeff('0x7c')])){_0x3645b2[_0xdeff('0x7c')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xdeff('0x1d3'));}if(!_[_0xdeff('0x40')](_0x3645b2[_0xdeff('0x93')])){loggerPredictive[_0xdeff('0x9a')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3645b2[_0xdeff('0x93')]);_0x3645b2[_0xdeff('0x93')]=undefined;}_0x3645b2[_0xdeff('0x28')]=moment()[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3645b2['name'],_0xdeff('0x1d4'),_0x3645b2[_0xdeff('0x28')]);this['handlePower'](_0x3645b2,0x1);}else if(ifInterval(_0x3645b2['dialPredictiveInterval'],_0x3645b2[_0xdeff('0x28')])){this[_0xdeff('0x164')](_0x3645b2,0x1);loggerPredictiveCalls[_0xdeff('0x84')](_0xdeff('0x1d5'),_0x3645b2[_0xdeff('0x28')],_0x3645b2['name']);_0x3645b2['erlangCalls']=0x0;_0x3645b2[_0xdeff('0x73')]=0x0;}else if(_0x42a216<_0x4c4e47&&_0x3645b2[_0xdeff('0x1d6')]===_0xdeff('0x1d7')){freeVariablesPredictive(_0x3645b2);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x4c4e47,_0xdeff('0x28'),_0x3645b2[_0xdeff('0x43')]);}else if(_0x3d1485<_0x3645b2[_0xdeff('0x73')]&&_0x3645b2['dialPredictiveOptimization']===_0xdeff('0x1d7')){freeVariablesPredictive(_0x3645b2);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x1d8'),_0xdeff('0x1d9'),_0x3d1485,_0xdeff('0x1da'),_0x3645b2[_0xdeff('0x73')],_0xdeff('0x28'),_0x3645b2[_0xdeff('0x43')]);}else if(!ifInterval(_0x3645b2[_0xdeff('0x1db')],_0x3645b2[_0xdeff('0x28')])&&_[_0xdeff('0x40')](_0x3645b2[_0xdeff('0x7c')])&&!_[_0xdeff('0x40')](_0x3645b2[_0xdeff('0x28')])){_0x3645b2['startPredictive']=moment()[_0xdeff('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xdeff('0x84')](_0x3645b2['name'],_0xdeff('0x1dc'),_0x3645b2[_0xdeff('0x7c')]);this[_0xdeff('0xc3')](_0x3645b2[_0xdeff('0x1db')])[_0xdeff('0x3e')](this['getDataPredictive'](_0x3645b2))[_0xdeff('0x3e')](mergeDataErlangB(_0x3645b2))[_0xdeff('0x3e')](this['startMethodPredictive'](_0x3645b2))[_0xdeff('0xbb')](loggerCatchPredictive(_0xdeff('0x1dd'),_0x3645b2));}else if(!ifInterval(_0x3645b2[_0xdeff('0x1db')],_0x3645b2['startPredictive'])){_0x3645b2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3645b2[_0xdeff('0x7c')]=moment()[_0xdeff('0x7f')](_0xdeff('0x106'));loggerPredictive[_0xdeff('0x84')](_0x3645b2[_0xdeff('0x43')],_0xdeff('0x1de'),_0x3645b2['startPredictive']);clearInterval(_0x3645b2['handlePredictive']);_0x3645b2[_0xdeff('0x93')]=undefined;this[_0xdeff('0xc3')](_0x3645b2['dialPredictiveInterval'])[_0xdeff('0x3e')](this[_0xdeff('0x1df')](_0x3645b2))['then'](mergeDataErlangB(_0x3645b2))[_0xdeff('0x3e')](this[_0xdeff('0x1e0')](_0x3645b2))[_0xdeff('0xbb')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3645b2));}else if(_0x3645b2[_0xdeff('0x77')]&&_0x273bfc<_0x3645b2['predictiveIntervalAvailable']-_0x5be2ea){freeVariablesPredictive(_0x3645b2);loggerPredictive[_0xdeff('0x84')](_0x3645b2['name'],_0xdeff('0x1e1'),_0x273bfc,_0xdeff('0x1e2'),_0x3645b2['predictiveIntervalAvailable'],'-',_0x5be2ea,'=',_0x3645b2['predictiveIntervalAvailable']-_0x5be2ea,')');}else if(_0x3645b2[_0xdeff('0x77')]&&_0x273bfc>_0x3645b2[_0xdeff('0x77')]+_0x551f0a){freeVariablesPredictive(_0x3645b2);loggerPredictive[_0xdeff('0x84')](_0x3645b2[_0xdeff('0x43')],_0xdeff('0x1e1'),_0x273bfc,_0xdeff('0x1e3'),_0x3645b2[_0xdeff('0x77')],'+',_0x551f0a,'=',_0x3645b2['predictiveIntervalAvailable']+_0x551f0a,')');}};Dialer[_0xdeff('0x1e')][_0xdeff('0x1df')]=function(_0x16301e){var _0x417b9f=this;return function(_0xe826d){return new BPromise(function(_0x5af774,_0x336756){_[_0xdeff('0x1e4')](_0x16301e,_0xe826d[0x0]);if(checkGetDataPredictive(_0xe826d[0x0])){var _0xba1623=_0x16301e[_0xdeff('0x77')]=_0x16301e['talking']+_0x16301e['available'];var _0x20cc5c=_0x16301e[_0xdeff('0x1db')]*0x3c;var _0x45c28b=_0xe826d[0x0]['predictiveIntervalAvgTalktime']+_0xe826d[0x0]['predictiveIntervalAvgHoldtime'];var _0xce1ca2=(_0xe826d[0x0][_0xdeff('0x6e')]+_0xe826d[0x0][_0xdeff('0x72')]+_0xe826d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xe826d[0x0][_0xdeff('0x87')];_0x16301e[_0xdeff('0x74')]=_0xce1ca2>0x0?_0xce1ca2:0x1;switch(_0x16301e[_0xdeff('0x1d6')]){case _0xdeff('0x1d7'):var _0x524d81=_0x16301e[_0xdeff('0x1d0')]/0x64;return _0x417b9f[_0xdeff('0x1e5')](_0xba1623,_0x20cc5c,_0x45c28b,_0xce1ca2,_0x524d81)[_0xdeff('0x3e')](function(_0x8eacc5){return _0x5af774(_0x8eacc5);});case _0xdeff('0x1e6'):var _0x5a52f2=_0x16301e[_0xdeff('0x1d0')]/0x64;return _0x417b9f[_0xdeff('0x1e7')](_0xba1623,_0x20cc5c,_0x45c28b,_0xce1ca2,_0x5a52f2)['then'](function(_0x1f33ff){return _0x5af774(_0x1f33ff);});default:return _0x336756(msgResponse(_0xdeff('0x1e8'),_0xdeff('0x153'),_0xdeff('0x1e9')));}}else{return _0x336756(msgResponse(_0xdeff('0x1e8'),_0xdeff('0x153'),_0xdeff('0x1ea')));}});};};Dialer[_0xdeff('0x1e')][_0xdeff('0x1eb')]=function(_0x7071fd){var _0x10e96d=this;return function(_0x176468){return new BPromise(function(_0xc9f01a,_0x2b2748){_[_0xdeff('0x1e4')](_0x7071fd,_0x176468[0x0]);if(checkGetDataPredictive(_0x176468[0x0])){loggerPredictive[_0xdeff('0x84')](JSON[_0xdeff('0x4d')](_0x176468[0x0]));if(_0x7071fd[_0xdeff('0x1d6')]===_0xdeff('0x1d7')){return _0x10e96d['getVoiceQueueRtPauses'](_0x7071fd['id'])[_0xdeff('0x3e')](function(_0x4eaade){var _0x46ce60=_0x7071fd[_0xdeff('0x55')]-_0x4eaade[0x0][_0xdeff('0x1ec')];var _0x1a1881=_0x7071fd[_0xdeff('0x1db')]*0x3c;var _0x31af8f=_0x176468[0x0][_0xdeff('0x70')]+_0x176468[0x0][_0xdeff('0x6f')];var _0xb2fbfd=(_0x176468[0x0][_0xdeff('0x6e')]+_0x176468[0x0][_0xdeff('0x72')]+_0x176468[0x0][_0xdeff('0x71')])/_0x176468[0x0]['predictiveIntervalTotalCalls'];var _0x58a4b9=_0x7071fd[_0xdeff('0x1d0')]/0x64;_0x7071fd[_0xdeff('0x76')]=_0x4eaade[0x0][_0xdeff('0x1ec')]||0x0;_0x7071fd[_0xdeff('0x74')]=_0xb2fbfd>0x0?_0xb2fbfd:0x1;return _0x10e96d['abandonmentRate'](_0x46ce60,_0x1a1881,_0x31af8f,_0xb2fbfd,_0x58a4b9);})[_0xdeff('0x3e')](function(_0x1d8e19){return _0xc9f01a(_0x1d8e19);})['catch'](function(_0x40ed02){return _0x2b2748(msgResponse(_0xdeff('0x1ed'),_0xdeff('0x153'),JSON[_0xdeff('0x4d')](_0x40ed02)));});}if(_0x7071fd[_0xdeff('0x1d6')]===_0xdeff('0x1e6')){return _0x10e96d[_0xdeff('0xcc')](_0x7071fd['id'])['then'](function(_0x4e9ae0){var _0x323499=_0x7071fd[_0xdeff('0x55')]-_0x4e9ae0[0x0][_0xdeff('0x1ec')];var _0x2d071a=_0x7071fd[_0xdeff('0x1db')]*0x3c;var _0x307ddd=_0x176468[0x0][_0xdeff('0x70')]+_0x176468[0x0]['predictiveIntervalAvgHoldtime'];var _0x5a137d=(_0x176468[0x0]['predictiveIntervalAnsweredCalls']+_0x176468[0x0][_0xdeff('0x72')]+_0x176468[0x0][_0xdeff('0x71')])/_0x176468[0x0]['predictiveIntervalTotalCalls'];var _0x148624=_0x7071fd[_0xdeff('0x1d0')]/0x64;_0x7071fd[_0xdeff('0x76')]=_0x4e9ae0[0x0][_0xdeff('0x1ec')]||0x0;_0x7071fd[_0xdeff('0x74')]=_0x5a137d>0x0?_0x5a137d:0x1;return _0x10e96d[_0xdeff('0x1e7')](_0x323499,_0x2d071a,_0x307ddd,_0x5a137d,_0x148624);})[_0xdeff('0x3e')](function(_0x276df5){return _0xc9f01a(_0x276df5);})[_0xdeff('0xbb')](function(_0x3498b2){return _0x2b2748(msgResponse(_0xdeff('0x1ed'),_0xdeff('0x153'),JSON['stringify'](_0x3498b2)));});}}else{return _0x2b2748(msgResponse(_0xdeff('0x1e8'),_0xdeff('0x153'),'check\x20failure'));}});};};Dialer[_0xdeff('0x1e')][_0xdeff('0x1e0')]=function(_0x11609d){var _0x52476d=this;return function(){var _0x1b4113=0x0;var _0x8f223f=Math[_0xdeff('0x1d2')](_0x11609d[_0xdeff('0x79')]*0x3e8);if(_0x8f223f>0x0){_0x8f223f=_0x8f223f<0x64?0x64:_0x8f223f;loggerPredictive[_0xdeff('0x84')](_0x11609d['name'],_0xdeff('0x1ee'),_0x8f223f,'milliseconds');_0x11609d[_0xdeff('0x93')]=setInterval(function(){_0x52476d[_0xdeff('0x93')](_0x11609d);loggerPredictiveCalls[_0xdeff('0x84')](_0xdeff('0x1ef'),_0x1b4113+=0x1);},_0x8f223f);}else{loggerPredictive['info'](_0x11609d[_0xdeff('0x43')],_0xdeff('0x1f0'));}};};Dialer[_0xdeff('0x1e')]['checkContactBlack']=function(_0x26d670,_0x55054a){var _0x4f4c1d=this;return function(_0x5336d1){if(_[_0xdeff('0x4b')](_0x5336d1)){if(_[_0xdeff('0xe6')](_0x55054a[_0xdeff('0xd9')])||!_0x55054a[_0xdeff('0x1f1')]){if(_0x26d670[_0xdeff('0x162')]===_0xdeff('0xa')){_0x26d670[_0xdeff('0x139')]=_[_0xdeff('0x40')](_0x26d670[_0xdeff('0x139')])?!![]:_0x26d670[_0xdeff('0x139')];var _0x1e3a85=uuid['v4']();_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85]=new Action(_0x26d670,_0x55054a,_0x1e3a85);loggerBooked['info'](_0xdeff('0x1f2'),_0x1e3a85,_0xdeff('0x1f3'),JSON['stringify'](_0x26d670[_0xdeff('0x139')]),_0xdeff('0x1f4'),_0x26d670[_0xdeff('0x43')]);if(_0x26d670[_0xdeff('0x139')]){_0x26d670[_0xdeff('0x139')]=![];_0x4f4c1d[_0xdeff('0x136')][_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85]['queue']]=[];ami[_0xdeff('0xb4')]({'actionid':_0x1e3a85,'action':_0xdeff('0x1f5'),'queue':_0x26d670['name']})[_0xdeff('0xbb')](function(){_0x4f4c1d[_0xdeff('0xb7')](_0x26d670);_0x4f4c1d[_0xdeff('0xc5')]({'active':![],'ContactId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0xd8')],'ListId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85]['ListId'],'VoiceQueueId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0xda')]||undefined,'CampaignId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0x108')]||undefined})[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1f6')));delete _0x4f4c1d['actions'][_0x1e3a85];});}else{loggerBooked[_0xdeff('0x84')](_0xdeff('0x1f7'),JSON[_0xdeff('0x4d')](_0x26d670[_0xdeff('0x139')]),_0xdeff('0x1f4'),_0x26d670[_0xdeff('0x43')]);_0x4f4c1d[_0xdeff('0xb7')](_0x26d670);_0x4f4c1d['rescheduleContact']({'active':![],'ContactId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0xd8')],'ListId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85]['ListId'],'VoiceQueueId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0xda')]||undefined,'CampaignId':_0x4f4c1d[_0xdeff('0x131')][_0x1e3a85][_0xdeff('0x108')]||undefined})['catch'](loggerCatch(_0xdeff('0x1f6')));delete _0x4f4c1d[_0xdeff('0x131')][_0x1e3a85];}}else{return _0x4f4c1d[_0xdeff('0x17e')](_0x26d670,_0x55054a);}}else{if(getDiff(_0x55054a[_0xdeff('0x1f8')])<_0x26d670['dialRecallMeTimeout']*0x3c){if(_0x55054a[_0xdeff('0x175')]&&!_0x55054a['Agent']['voicePause']){_0x4f4c1d['preview'][_0xdeff('0x13c')](_0x55054a['id'])[_0xdeff('0x1a4')](function(){_0x4f4c1d[_0xdeff('0xb7')](_0x26d670);});}else{_0x4f4c1d[_0xdeff('0xc6')]({'active':![]},_0x55054a['id'],0x1)[_0xdeff('0x1a4')](function(){_0x4f4c1d[_0xdeff('0xb7')](_0x26d670);});}}else{_0x26d670['outboundReCallsDay']+=0x1;_0x4f4c1d[_0xdeff('0xb7')](_0x26d670);if(_0x26d670['dialRecallInQueue']){_0x4f4c1d[_0xdeff('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x55054a[_0xdeff('0xd8')],'ListId':_0x55054a[_0xdeff('0x107')],'VoiceQueueId':_0x55054a['VoiceQueueId']||undefined,'CampaignId':_0x55054a[_0xdeff('0x108')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x4f4c1d[_0xdeff('0xcf')](createObjHistory(_0x26d670,_0x55054a,_0xdeff('0x1f9'),0x17,'RecallInQueue'))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0x1fa')));}else{_0x4f4c1d['saveInDb'](createObjHistory(_0x26d670,_0x55054a,'RECALLFAILEDTIMEOUT',0x16,_0xdeff('0x1fb')),_0xdeff('0x1fc'),_0xdeff('0x1fd'));}}}}else{_0x26d670[_0xdeff('0x64')]+=0x1;_0x4f4c1d['saveInDb'](createObjHistory(_0x26d670,_0x55054a,_0xdeff('0x1fe'),0xd,'Blacklist'),_0xdeff('0x1ff'),_0xdeff('0x200'));throw _0xdeff('0x201');}};};Dialer[_0xdeff('0x1e')][_0xdeff('0x202')]=function(_0x4ca552){var _0x5c5927=this;var _0x295544=_0x4ca552[_0xdeff('0x203')]-_0x4ca552[_0xdeff('0x9d')]-_0x4ca552[_0xdeff('0xc9')];emitCampaignSummary(_0x4ca552);if(_0x295544>0x0){if(_0x295544>this['maxNumberOriginate']){_0x295544=this[_0xdeff('0x25')];}_0x4ca552[_0xdeff('0xc9')]+=_0x295544;this[_0xdeff('0xca')](_0x4ca552['id'],_0x295544,_0x4ca552[_0xdeff('0x204')],_0x4ca552)['then'](function(_0x4235e3){_0x4ca552['temp']-=_0x295544;_0x4ca552[_0xdeff('0xc9')]=_0x4ca552[_0xdeff('0xc9')]>0x0?_0x4ca552[_0xdeff('0xc9')]:0x0;if(!checkContactEmpty(_0x4235e3)){_0x4ca552[_0xdeff('0x41')]=_0xdeff('0xa4');logger[_0xdeff('0x84')](_0xdeff('0x205')+_0x4ca552['name']);}else{_0x4ca552[_0xdeff('0x9d')]+=_0x4235e3[_0xdeff('0x9c')];_0x4ca552[_0xdeff('0x41')]='RUNNING';for(var _0x18cc23=0x0;_0x18cc23<_0x4235e3['length'];_0x18cc23+=0x1){_0x4ca552[_0xdeff('0x206')]+=0x1;if(_['isNil'](_0x4235e3[_0x18cc23])||_['isNil'](_0x4235e3[_0x18cc23][_0xdeff('0x195')])||_[_0xdeff('0xe6')](_0x4235e3[_0x18cc23][_0xdeff('0x181')])){_0x5c5927[_0xdeff('0xd4')](_0xdeff('0x207'),_0x4ca552,_0x4235e3[_0x18cc23]);}else{_0x5c5927[_0xdeff('0x208')](_[_0xdeff('0xd7')](_0x4235e3[_0x18cc23],[_0xdeff('0x108'),_0xdeff('0x209')]))['then'](_0x5c5927[_0xdeff('0x20a')](_0x4ca552,_0x4235e3[_0x18cc23]))[_0xdeff('0xbb')](_0x5c5927[_0xdeff('0xd3')](_0xdeff('0x20b'),_0x4ca552));}}}})[_0xdeff('0xbb')](loggerGetContactDialer(_0xdeff('0x20c'),_0x4ca552,_0x295544));}};Dialer[_0xdeff('0x1e')][_0xdeff('0x164')]=function(_0x2879d1,_0x3e3b43){var _0x50f37b=this;var _0x2a1512=[];var _0x230889=_0x3e3b43>=0x1?_0x3e3b43:0x1;if(_0x2879d1[_0xdeff('0x162')]==='booked'){_0x230889=0x1;}var _0x327789=Math[_0xdeff('0x1d2')](_0x2879d1[_0xdeff('0x54')]*_0x230889)-_0x2879d1[_0xdeff('0x9d')]-_0x2879d1[_0xdeff('0xc9')];emitVoiceQueueSummary(_0x2879d1);if(_0x2879d1[_0xdeff('0x20d')]>0x0){var _0x490ec7=_0x2879d1['dialLimitQueue']-_0x2879d1[_0xdeff('0x9d')]-_0x2879d1['talking']-_0x2879d1[_0xdeff('0xc9')]-_0x2879d1[_0xdeff('0x56')];if(_0x327789>_0x490ec7){_0x327789=_0x490ec7;}}if(_0x327789>0x0){if(_0x2879d1[_0xdeff('0x162')]===_0xdeff('0xa')){_0x327789=0x1;}if(_0x327789>this[_0xdeff('0x25')]){_0x327789=this[_0xdeff('0x25')];}_0x2879d1['temp']+=_0x327789;for(var _0x351f58 in this[_0xdeff('0x23')]){if(typeof this[_0xdeff('0x23')][_0x351f58]!=='undefined'){if(this[_0xdeff('0x23')][_0x351f58][_0xdeff('0xad')]===_0xdeff('0x20e')&&this['agents'][_0x351f58][_0xdeff('0xe2')]===_0xdeff('0xe0')){_0x2a1512[_0xdeff('0x137')](this['agents'][_0x351f58]['id']);}}}this[_0xdeff('0xc8')](_0x2879d1['id'],_0x2a1512,_0x327789,_0x2879d1[_0xdeff('0x204')],_0x2879d1)['then'](function(_0x3f41fb){_0x2879d1[_0xdeff('0xc9')]-=_0x327789;_0x2879d1[_0xdeff('0xc9')]=_0x2879d1['temp']>0x0?_0x2879d1[_0xdeff('0xc9')]:0x0;if(!checkContactEmpty(_0x3f41fb)){_0x50f37b[_0xdeff('0x20f')](_0x2879d1)[_0xdeff('0x3e')](sendMessageReschedule(_0x2879d1))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2879d1[_0xdeff('0x9d')]+=_0x3f41fb[_0xdeff('0x9c')];_0x2879d1[_0xdeff('0x41')]=_0x2879d1['dialMethod']===_0xdeff('0xa')?_0xdeff('0x188'):_0xdeff('0x210');for(var _0x5ddd19=0x0;_0x5ddd19<_0x3f41fb[_0xdeff('0x9c')];_0x5ddd19+=0x1){if(_[_0xdeff('0xe6')](_0x3f41fb[_0x5ddd19])||_[_0xdeff('0xe6')](_0x3f41fb[_0x5ddd19][_0xdeff('0x195')])||_[_0xdeff('0xe6')](_0x3f41fb[_0x5ddd19][_0xdeff('0x181')])){_0x50f37b[_0xdeff('0xd4')](_0xdeff('0x207'),_0x2879d1,_0x3f41fb[_0x5ddd19]);}else{_0x50f37b[_0xdeff('0xbd')](_[_0xdeff('0xd7')](_0x3f41fb[_0x5ddd19],[_0xdeff('0xda'),_0xdeff('0x209')]))[_0xdeff('0x3e')](_0x50f37b[_0xdeff('0x20a')](_0x2879d1,_0x3f41fb[_0x5ddd19]))[_0xdeff('0xbb')](_0x50f37b['loggerHandler'](_0xdeff('0x207'),_0x2879d1));}}}})[_0xdeff('0xbb')](loggerGetContactDialer(_0xdeff('0x211'),_0x2879d1,_0x327789));}};Dialer[_0xdeff('0x1e')][_0xdeff('0x93')]=function(_0x4af686){if(_0x4af686['dialLimitQueue']>0x0){var _0x456da8=_0x4af686[_0xdeff('0x20d')]-_0x4af686[_0xdeff('0x9d')]-_0x4af686[_0xdeff('0xa7')];if(_0x456da8>0x0){this['tryOriginatePredictive'](_0x4af686);}else{loggerPredictiveCalls['info'](_0xdeff('0x212'));}}else{this[_0xdeff('0x213')](_0x4af686);}};Dialer[_0xdeff('0x1e')][_0xdeff('0x213')]=function(_0x519c66){var _0x2710bc=this;var _0xdac83b=[];_0x519c66['originated']+=0x1;for(var _0x34952e in this[_0xdeff('0x23')]){if(typeof this[_0xdeff('0x23')][_0x34952e]!==_0xdeff('0x9e')){if(this['agents'][_0x34952e][_0xdeff('0xad')]==='not_inuse'&&this[_0xdeff('0x23')][_0x34952e][_0xdeff('0xe2')]===_0xdeff('0xe0')){_0xdac83b[_0xdeff('0x137')](this[_0xdeff('0x23')][_0x34952e]['id']);}}}this[_0xdeff('0xc8')](_0x519c66['id'],_0xdac83b,0x1,_0x519c66[_0xdeff('0x204')],_0x519c66)[_0xdeff('0x3e')](function(_0x4086be){if(!checkContactEmpty(_0x4086be)){checkContactLowerLimitOriginate(_0x519c66,0x1,0x0);_0x2710bc[_0xdeff('0x20f')](_0x519c66)['then'](sendMessageReschedule(_0x519c66))[_0xdeff('0xbb')](loggerCatch(_0xdeff('0xbc')));}else{_0x519c66['message']=_0xdeff('0x210');if(_[_0xdeff('0xe6')](_0x4086be[0x0])||_[_0xdeff('0xe6')](_0x4086be[0x0][_0xdeff('0x195')])||_[_0xdeff('0xe6')](_0x4086be[0x0]['phone'])){_0x2710bc[_0xdeff('0xd4')]('[actionOriginate]\x20',_0x519c66,_0x4086be[0x0]);}else{_0x2710bc[_0xdeff('0xbd')](_[_0xdeff('0xd7')](_0x4086be[0x0],[_0xdeff('0xda'),_0xdeff('0x209')]))[_0xdeff('0x3e')](_0x2710bc[_0xdeff('0x20a')](_0x519c66,_0x4086be[0x0]))[_0xdeff('0xbb')](_0x2710bc[_0xdeff('0xd3')]('[actionOriginatePredictive]\x20',_0x519c66));}}})[_0xdeff('0xbb')](loggerGetContactDialer('[getContactDialerPredictive]',_0x519c66,0x1));emitVoiceQueueSummary(_0x519c66);};Dialer['prototype']['abandonmentRate']=function(_0x28e788,_0x36b297,_0x226441,_0x37acf1,_0x45fa31,_0xdfbd69){loggerPredictive[_0xdeff('0x84')](_0xdeff('0x214'));loggerPredictive[_0xdeff('0x84')](_0xdeff('0x215'),_0x28e788);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x216'),_0x36b297);loggerPredictive['info']('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',_0x226441);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x217'),_0x37acf1);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x218'),_0x45fa31);loggerPredictive['info'](_0xdeff('0x8b'));return new BPromise(function(_0x32ad14,_0x1b09ec){if(_0x28e788<=0x0||isNaN(_0x28e788)){return _0x1b09ec(msgResponse('[abandonmentRate]',_0xdeff('0x4c'),'m\x20=\x20'+_0x28e788));}if(_0x226441<=0x0||isNaN(_0x226441)){return _0x1b09ec(msgResponse(_0xdeff('0x219'),_0xdeff('0x4c'),_0xdeff('0x21a')+_0x226441));}if(_0x37acf1<=0x0||isNaN(_0x37acf1)){return _0x1b09ec(msgResponse(_0xdeff('0x219'),_0xdeff('0x4c'),_0xdeff('0x21b')+_0x37acf1));}if(_0x36b297<=0x0||isNaN(_0x36b297)){return _0x1b09ec(msgResponse('[abandonmentRate]',_0xdeff('0x4c'),_0xdeff('0x21c')+_0x36b297));}if(_0x45fa31<=0x0||isNaN(_0x45fa31)){return _0x1b09ec(msgResponse(_0xdeff('0x219'),_0xdeff('0x4c'),_0xdeff('0x21d')+_0x45fa31));}_0xdfbd69=_0xdfbd69||0x0;var _0x364692=0x1/_0x226441;var _0x5cec94=0x0;var _0x54cb41=0x0;var _0x58e004=0x0;var _0x4f9ed3=0x0;for(var _0x206989=0x0;_0x58e004<_0x45fa31;_0x206989+=0x1){_0x54cb41=_0x206989/_0x36b297;_0x5cec94=(_0x37acf1*_0x54cb41+_0xdfbd69)/_0x364692;_0x58e004=erlangb(_0x5cec94,_0x28e788);_0x4f9ed3=_0x5cec94/_0x28e788*(0x1-erlangb(_0x5cec94,_0x28e788));}return _0x32ad14({'erlangCalls':_0x206989,'erlangCallToSecond':_0x36b297/_0x206989,'erlangAbandonmentRate':_0x58e004,'erlangBusyFactor':_0x4f9ed3});});};Dialer[_0xdeff('0x1e')][_0xdeff('0x1e7')]=function(_0x5807ed,_0x127eca,_0x514e92,_0x1225c1,_0x2e2956,_0xf13bd9){loggerPredictive[_0xdeff('0x84')](_0xdeff('0x21e'));loggerPredictive[_0xdeff('0x84')](_0xdeff('0x215'),_0x5807ed);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x216'),_0x127eca);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x21f'),_0x514e92);loggerPredictive[_0xdeff('0x84')]('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',_0x1225c1);loggerPredictive[_0xdeff('0x84')](_0xdeff('0x220'),_0x2e2956);loggerPredictive['info'](_0xdeff('0x8b'));return new BPromise(function(_0xd48faf,_0x480c2c){if(_0x5807ed<=0x0||isNaN(_0x5807ed)){return _0x480c2c(msgResponse(_0xdeff('0x221'),_0xdeff('0x4c'),_0xdeff('0x222')+_0x5807ed));}if(_0x514e92<=0x0||isNaN(_0x514e92)){return _0x480c2c(msgResponse(_0xdeff('0x221'),_0xdeff('0x4c'),_0xdeff('0x21a')+_0x514e92));}if(_0x1225c1<=0x0||isNaN(_0x1225c1)){return _0x480c2c(msgResponse('[busyFactor]',_0xdeff('0x4c'),'p\x20=\x20'+_0x1225c1));}if(_0x127eca<=0x0||isNaN(_0x127eca)){return _0x480c2c(msgResponse(_0xdeff('0x221'),_0xdeff('0x4c'),_0xdeff('0x21c')+_0x127eca));}if(_0x2e2956<=0x0||isNaN(_0x2e2956)){return _0x480c2c(msgResponse(_0xdeff('0x221'),_0xdeff('0x4c'),'Umin\x20=\x20'+_0x2e2956));}_0xf13bd9=_0xf13bd9||0x0;var _0x583714=0x1/_0x514e92;var _0x1ced0f=0x0;var _0x38d950=0x0;var _0x2d8a06=0x0;var _0x81a096=0x0;for(var _0x8eb371=0x0;_0x81a096<_0x2e2956;_0x8eb371+=0x1){_0x38d950=_0x8eb371/_0x127eca;_0x1ced0f=(_0x1225c1*_0x38d950+_0xf13bd9)/_0x583714;_0x2d8a06=erlangb(_0x1ced0f,_0x5807ed);_0x81a096=_0x1ced0f/_0x5807ed*(0x1-erlangb(_0x1ced0f,_0x5807ed));}return _0xd48faf({'erlangCalls':_0x8eb371,'erlangCallToSecond':_0x127eca/_0x8eb371,'erlangAbandonmentRate':_0x2d8a06,'erlangBusyFactor':_0x81a096});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index d9b8a1d..efde510 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 _0x5075=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x423c33,_0x42ec5e){var _0x1e2f06=function(_0x4585cb){while(--_0x4585cb){_0x423c33['push'](_0x423c33['shift']());}};_0x1e2f06(++_0x42ec5e);}(_0x5075,0x73));var _0x5507=function(_0x20a1b0,_0x18fe84){_0x20a1b0=_0x20a1b0-0x0;var _0x321e14=_0x5075[_0x20a1b0];return _0x321e14;};'use strict';var util=require(_0x5507('0x0'));var _=require(_0x5507('0x1'));var moment=require(_0x5507('0x2'));function getSeconds(_0x1a552a,_0x3ec62f){var _0x2b444e=moment(_0x1a552a)[_0x5507('0x3')](0x0);var _0x518ca7=moment(_0x3ec62f)[_0x5507('0x3')](0x0);return _0x2b444e[_0x5507('0x4')](_0x518ca7,_0x5507('0x5'));}function QueueCallerAbandon(_0x54267f,_0x5b6d7f){this[_0x5507('0x6')]=_0x54267f[_0x5507('0x6')];this['type']=_0x54267f[_0x5507('0x7')];this[_0x5507('0x8')]=_0x54267f[_0x5507('0x7')]==='outbound'?'queue':_0x54267f[_0x5507('0x7')];this[_0x5507('0x9')]=_0x54267f[_0x5507('0x9')];this[_0x5507('0xa')]=_0x54267f['countcongestionretry'];this[_0x5507('0xb')]=_0x54267f[_0x5507('0xb')];this['countglobal']=_0x54267f[_0x5507('0x9')]+_0x54267f[_0x5507('0xa')]+_0x54267f['countnoanswerretry']+_0x54267f[_0x5507('0xc')]+_0x54267f[_0x5507('0xd')]+_0x54267f[_0x5507('0xe')]+_0x54267f[_0x5507('0xf')]+_0x54267f[_0x5507('0x10')];this[_0x5507('0xc')]=_0x54267f['countnosuchnumberretry'];this[_0x5507('0xd')]=_0x54267f[_0x5507('0xd')];this[_0x5507('0xe')]=_0x54267f[_0x5507('0xe')];this['countmachineretry']=_0x54267f[_0x5507('0xf')];this[_0x5507('0x10')]=_0x54267f[_0x5507('0x10')];this[_0x5507('0x11')]=_0x5b6d7f[_0x5507('0x11')];this[_0x5507('0x12')]=_0x54267f[_0x5507('0x13')];this[_0x5507('0x14')]=_0x54267f[_0x5507('0x15')];this[_0x5507('0x16')]=_0x54267f[_0x5507('0x16')];this[_0x5507('0x17')]=_0x54267f[_0x5507('0x17')];this['droptime']=_0x54267f[_0x5507('0x18')];this[_0x5507('0x19')]=this[_0x5507('0x18')];this[_0x5507('0x1a')]=getSeconds(_0x54267f['responsetime'],_0x54267f[_0x5507('0x16')]);this[_0x5507('0x1b')]=getSeconds(this[_0x5507('0x18')],_0x54267f[_0x5507('0x17')]);this[_0x5507('0x1c')]=0x0;this[_0x5507('0x1d')]=_0x5b6d7f['queue'];this[_0x5507('0x1e')]=_0x5b6d7f[_0x5507('0x1f')];this[_0x5507('0x20')]=_0x5b6d7f[_0x5507('0x20')];this[_0x5507('0x21')]=_0x54267f[_0x5507('0x21')];this[_0x5507('0x22')]=_0x54267f[_0x5507('0x22')];this[_0x5507('0x23')]=_0x54267f[_0x5507('0x23')];this[_0x5507('0x24')]=_0x54267f[_0x5507('0x24')];this[_0x5507('0x25')]=_0x54267f[_0x5507('0x25')];this[_0x5507('0x26')]=_0x54267f['ListId'];this[_0x5507('0x27')]=_0x54267f['UserId'];this[_0x5507('0x28')]=_0x54267f['VoiceQueueId'];this[_0x5507('0x29')]=_0x54267f[_0x5507('0x29')];this['originatecalleridnum']=_0x54267f['originatecalleridnum']||'';this[_0x5507('0x2a')]=_0x54267f[_0x5507('0x2a')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xa123=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback'];(function(_0x438a38,_0x3d019f){var _0x3207bb=function(_0x1e33f0){while(--_0x1e33f0){_0x438a38['push'](_0x438a38['shift']());}};_0x3207bb(++_0x3d019f);}(_0xa123,0x1c2));var _0x3a12=function(_0x36b255,_0x35d3c4){_0x36b255=_0x36b255-0x0;var _0x546b9f=_0xa123[_0x36b255];return _0x546b9f;};'use strict';var util=require('util');var _=require(_0x3a12('0x0'));var moment=require('moment');function getSeconds(_0x165f48,_0x22b4ae){var _0x52e39d=moment(_0x165f48)[_0x3a12('0x1')](0x0);var _0x409b47=moment(_0x22b4ae)[_0x3a12('0x1')](0x0);return _0x52e39d['diff'](_0x409b47,_0x3a12('0x2'));}function QueueCallerAbandon(_0x1ca886,_0x51723e){this[_0x3a12('0x3')]=_0x1ca886[_0x3a12('0x3')];this[_0x3a12('0x4')]=_0x1ca886['type'];this[_0x3a12('0x5')]=_0x1ca886[_0x3a12('0x4')]==='outbound'?'queue':_0x1ca886['type'];this['countbusyretry']=_0x1ca886[_0x3a12('0x6')];this[_0x3a12('0x7')]=_0x1ca886[_0x3a12('0x7')];this['countnoanswerretry']=_0x1ca886[_0x3a12('0x8')];this[_0x3a12('0x9')]=_0x1ca886[_0x3a12('0x6')]+_0x1ca886[_0x3a12('0x7')]+_0x1ca886[_0x3a12('0x8')]+_0x1ca886[_0x3a12('0xa')]+_0x1ca886[_0x3a12('0xb')]+_0x1ca886[_0x3a12('0xc')]+_0x1ca886[_0x3a12('0xd')]+_0x1ca886[_0x3a12('0xe')];this[_0x3a12('0xa')]=_0x1ca886[_0x3a12('0xa')];this[_0x3a12('0xb')]=_0x1ca886[_0x3a12('0xb')];this[_0x3a12('0xc')]=_0x1ca886[_0x3a12('0xc')];this['countmachineretry']=_0x1ca886['countmachineretry'];this[_0x3a12('0xe')]=_0x1ca886[_0x3a12('0xe')];this[_0x3a12('0xf')]=_0x51723e[_0x3a12('0xf')];this['calleridname']=_0x1ca886[_0x3a12('0x10')];this[_0x3a12('0x11')]=_0x1ca886['number'];this[_0x3a12('0x12')]=_0x1ca886['starttime'];this[_0x3a12('0x13')]=_0x1ca886['responsetime'];this['droptime']=_0x1ca886[_0x3a12('0x14')];this[_0x3a12('0x15')]=this['droptime'];this[_0x3a12('0x16')]=getSeconds(_0x1ca886[_0x3a12('0x13')],_0x1ca886[_0x3a12('0x12')]);this[_0x3a12('0x17')]=getSeconds(this[_0x3a12('0x14')],_0x1ca886[_0x3a12('0x13')]);this[_0x3a12('0x18')]=0x0;this[_0x3a12('0x19')]=_0x51723e[_0x3a12('0x19')];this[_0x3a12('0x1a')]=_0x51723e[_0x3a12('0x1b')];this[_0x3a12('0x1c')]=_0x51723e[_0x3a12('0x1c')];this[_0x3a12('0x1d')]=_0x1ca886[_0x3a12('0x1d')];this[_0x3a12('0x1e')]=_0x1ca886[_0x3a12('0x1e')];this[_0x3a12('0x1f')]=_0x1ca886[_0x3a12('0x1f')];this[_0x3a12('0x20')]=_0x1ca886['recallme'];this[_0x3a12('0x21')]=_0x1ca886[_0x3a12('0x21')];this[_0x3a12('0x22')]=_0x1ca886[_0x3a12('0x22')];this[_0x3a12('0x23')]=_0x1ca886[_0x3a12('0x23')];this['VoiceQueueId']=_0x1ca886[_0x3a12('0x24')];this['CampaignId']=_0x1ca886['CampaignId'];this['originatecalleridnum']=_0x1ca886[_0x3a12('0x25')]||'';this['originatecalleridname']=_0x1ca886[_0x3a12('0x26')]||'';}module[_0x3a12('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 70156ea..1d268d5 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(_0x43c211,_0x300db3){var _0x514efc=function(_0x30e1cd){while(--_0x30e1cd){_0x43c211['push'](_0x43c211['shift']());}};_0x514efc(++_0x300db3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x2163ea,_0x28a13c){var _0x574722=function(_0x205b43){while(--_0x205b43){_0x2163ea['push'](_0x2163ea['shift']());}};_0x574722(++_0x28a13c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 2dca7d6..3040ca5 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 _0x39bb=['\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','info','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','bluebird','uuid','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name'];(function(_0x4297af,_0x2882f5){var _0x10ad5d=function(_0x452a2a){while(--_0x452a2a){_0x4297af['push'](_0x4297af['shift']());}};_0x10ad5d(++_0x2882f5);}(_0x39bb,0x1a6));var _0xb39b=function(_0x2c43f8,_0x261d10){_0x2c43f8=_0x2c43f8-0x0;var _0x3c0c0f=_0x39bb[_0x2c43f8];return _0x3c0c0f;};'use strict';var util=require(_0xb39b('0x0'));var _=require('lodash');var BPromise=require(_0xb39b('0x1'));var uuid=require(_0xb39b('0x2'));var moment=require('moment');var path=require(_0xb39b('0x3'));var tiff2pdf=require(_0xb39b('0x4'));var gs=require(_0xb39b('0x5'));var logger=require('../../../config/logger')(_0xb39b('0x6'));var ami=require('../ami');var rpcDb=require(_0xb39b('0x7'));var Channel=require(_0xb39b('0x8'));var ut=require('./util/util');var Action=require(_0xb39b('0x9'));var faxAccount=require(_0xb39b('0xa'));var attachment=require(_0xb39b('0xb'));var faxMessage=require(_0xb39b('0xc'));function Fax(_0x3a7252){this['channels']={};this['faxAccounts']=_0x3a7252[_0xb39b('0xd')];this['trunks']=_0x3a7252[_0xb39b('0xe')];this[_0xb39b('0xf')]={};ami['on'](_0xb39b('0x10'),this[_0xb39b('0x11')][_0xb39b('0x12')](this));ami['on'](_0xb39b('0x13'),this['syncVarSet'][_0xb39b('0x12')](this));ami['on'](_0xb39b('0x14'),this[_0xb39b('0x15')][_0xb39b('0x12')](this));ami['on'](_0xb39b('0x16'),this['syncNewExten'][_0xb39b('0x12')](this));ami['on']('faxstatus',this[_0xb39b('0x17')][_0xb39b('0x12')](this));ami['on']('receivefax',this[_0xb39b('0x18')][_0xb39b('0x12')](this));ami['on'](_0xb39b('0x19'),this[_0xb39b('0x1a')]['bind'](this));ami['on'](_0xb39b('0x1b'),this[_0xb39b('0x1c')][_0xb39b('0x12')](this));}Fax[_0xb39b('0x1d')][_0xb39b('0x11')]=function(_0x32fa90){if(_0x32fa90[_0xb39b('0x1e')]==='from-voip-provider'){for(var _0x4b2814 in this[_0xb39b('0xd')]){if(this[_0xb39b('0xd')][_0xb39b('0x1f')](_0x4b2814)){if(_0x32fa90[_0xb39b('0x20')]===this[_0xb39b('0xd')][_0x4b2814][_0xb39b('0x21')]){this[_0xb39b('0x22')][_0x32fa90[_0xb39b('0x23')]]={};this[_0xb39b('0x22')][_0x32fa90[_0xb39b('0x23')]]['channel']=_0x32fa90[_0xb39b('0x24')];this[_0xb39b('0x22')][_0x32fa90[_0xb39b('0x23')]]['id']=this[_0xb39b('0xd')][_0x4b2814]['id'];this['channels'][_0x32fa90[_0xb39b('0x23')]][_0xb39b('0x25')]=this[_0xb39b('0xd')][_0x4b2814][_0xb39b('0x25')];logger['info'](_0x32fa90[_0xb39b('0x23')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x32fa90[_0xb39b('0x23')]]){this['channels'][_0x32fa90[_0xb39b('0x23')]]={};this['channels'][_0x32fa90['uniqueid']][_0xb39b('0x24')]=_0x32fa90[_0xb39b('0x24')];logger['info'](_0x32fa90['uniqueid'],_0xb39b('0x26'));}};Fax[_0xb39b('0x1d')]['syncVarSet']=function(_0xa52baa){if(this[_0xb39b('0x22')][_0xa52baa['uniqueid']]){for(var _0x2b7cb8 in _0xa52baa[_0xb39b('0x27')]){if(_0xa52baa[_0xb39b('0x27')]['hasOwnProperty'](_0x2b7cb8)){this['channels'][_0xa52baa[_0xb39b('0x23')]][_0x2b7cb8]=_0xa52baa[_0xb39b('0x28')];}}}};Fax[_0xb39b('0x1d')][_0xb39b('0x15')]=function(_0x21ff9c){if(this[_0xb39b('0x22')][_0x21ff9c['uniqueid']]){this[_0xb39b('0x22')][_0x21ff9c[_0xb39b('0x23')]]['channelstate']=_0x21ff9c[_0xb39b('0x29')];this[_0xb39b('0x22')][_0x21ff9c[_0xb39b('0x23')]][_0xb39b('0x2a')]=_0x21ff9c['channelstatedesc'];}};Fax['prototype'][_0xb39b('0x2b')]=function(_0x3bb7a8){if(this[_0xb39b('0x22')][_0x3bb7a8[_0xb39b('0x23')]]){for(var _0x45c959 in _0x3bb7a8[_0xb39b('0x27')]){if(_0x3bb7a8['variable'][_0xb39b('0x1f')](_0x45c959)){this[_0xb39b('0x22')][_0x3bb7a8[_0xb39b('0x23')]][_0x45c959]=_0x3bb7a8[_0xb39b('0x28')];}}}};Fax['prototype'][_0xb39b('0x17')]=function(_0x5a12e6){if(this['channels'][_0x5a12e6[_0xb39b('0x23')]]){this[_0xb39b('0x22')][_0x5a12e6['uniqueid']][_0xb39b('0x2c')]=_0x5a12e6[_0xb39b('0x2c')];this[_0xb39b('0x22')][_0x5a12e6['uniqueid']][_0xb39b('0x2d')]=_0x5a12e6['status'];this[_0xb39b('0x22')][_0x5a12e6[_0xb39b('0x23')]]['localstationid']=_0x5a12e6[_0xb39b('0x21')];this[_0xb39b('0x22')][_0x5a12e6['uniqueid']][_0xb39b('0x2e')]=_0x5a12e6[_0xb39b('0x2e')];logger['info'](_0x5a12e6[_0xb39b('0x23')],_0xb39b('0x2f'));}};Fax[_0xb39b('0x1d')]['syncReceiveFax']=function(_0xfdcaea){var _0x1e22d8=this;if(this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]]){var _0x397e55=this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]]['id'];this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x30')]=_0xfdcaea[_0xb39b('0x30')];this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x31')]=_0xfdcaea[_0xb39b('0x31')];this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x21')]=_0xfdcaea['localstationid'];this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x32')]=_0xfdcaea[_0xb39b('0x32')];this[_0xb39b('0x22')][_0xfdcaea['uniqueid']][_0xb39b('0x33')]=_0xfdcaea[_0xb39b('0x33')];this[_0xb39b('0x22')][_0xfdcaea['uniqueid']][_0xb39b('0x2e')]=_0xfdcaea[_0xb39b('0x2e')];this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x34')]=_0xfdcaea[_0xb39b('0x34')];if(this[_0xb39b('0x22')][_0xfdcaea[_0xb39b('0x23')]][_0xb39b('0x31')]>0x0){tiff2pdf(_0xfdcaea[_0xb39b('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x4b983e){logger['info'](_0xfdcaea['uniqueid'],_0xb39b('0x35'),_0x4b983e[_0xb39b('0x36')]);attachment['create']({'name':path[_0xb39b('0x37')](_0xfdcaea[_0xb39b('0x2e')])[_0xb39b('0x25')],'basename':path[_0xb39b('0x37')](_0xfdcaea[_0xb39b('0x2e')])[_0xb39b('0x25')]+_0xb39b('0x38'),'type':_0xb39b('0x39')})[_0xb39b('0x3a')](function(_0x1e5cc4){faxAccount['notify'](_0x397e55,{'from':_0xfdcaea[_0xb39b('0x34')],'mapKey':_0xb39b('0x6'),'body':path['parse'](_0xfdcaea[_0xb39b('0x2e')])[_0xb39b('0x25')]+'.pdf','AttachmentId':_0x1e5cc4['id']})[_0xb39b('0x3b')](function(_0x2be532){logger[_0xb39b('0x3c')](_0xfdcaea[_0xb39b('0x23')],_0xb39b('0x3d'),JSON[_0xb39b('0x3e')](_0x2be532));});})[_0xb39b('0x3b')](function(_0x382fbd){logger[_0xb39b('0x3c')](_0xfdcaea[_0xb39b('0x23')],_0xb39b('0x3f'),JSON[_0xb39b('0x3e')](_0x382fbd));});});}logger[_0xb39b('0x40')](_0xfdcaea[_0xb39b('0x23')],_0xb39b('0x3f'));}};Fax[_0xb39b('0x1d')]['syncOriginateResponse']=function(_0x2e59c3){if(this[_0xb39b('0xf')][_0x2e59c3[_0xb39b('0x23')]]){_[_0xb39b('0x41')](this[_0xb39b('0x22')][_0x2e59c3[_0xb39b('0x23')]],_[_0xb39b('0x42')](_0x2e59c3,[_0xb39b('0x43'),_0xb39b('0x44')]));}};function updateStatus(_0x2b278f){if(_0x2b278f['AttachmentId']){faxMessage[_0xb39b('0x45')](_0x2b278f[_0xb39b('0x46')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x1bd343){ut[_0xb39b('0x47')](_0xb39b('0x48'),_0x1bd343);})[_0xb39b('0x3b')](function(_0x409c5e){ut[_0xb39b('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x409c5e);});}else{ut[_0xb39b('0x47')](_0xb39b('0x49'));}}Fax[_0xb39b('0x1d')][_0xb39b('0x4a')]=function(_0x30680c,_0x17738e,_0x5c8779){var _0x100319=this;var _0xf89e06={};if(_0x17738e){_0xf89e06={'read':_0x17738e};}else{_0xf89e06={'failMessage':_0x5c8779};}if(this[_0xb39b('0xf')][_0x30680c][_0xb39b('0x46')]){faxMessage[_0xb39b('0x45')](this[_0xb39b('0xf')][_0x30680c][_0xb39b('0x46')],_0xf89e06)[_0xb39b('0x3a')](function(_0x1f267c){ut['logger'](_0xb39b('0x4b'),_0x1f267c);})[_0xb39b('0x3b')](function(_0x77a7fa){ut['logger']('[Fax][Message][NoUpdate1]',_0x77a7fa);})['finally'](function(){delete _0x100319[_0xb39b('0x22')][_0x30680c];delete _0x100319[_0xb39b('0xf')][_0x30680c];});}else{ut[_0xb39b('0x47')](_0xb39b('0x4c'));delete this[_0xb39b('0x22')][_0x30680c];delete this[_0xb39b('0xf')][_0x30680c];}};Fax['prototype'][_0xb39b('0x1a')]=function(_0x250d10){var _0x474362=this;if(this[_0xb39b('0x22')][_0x250d10[_0xb39b('0x23')]]){if(this[_0xb39b('0xf')][_0x250d10[_0xb39b('0x23')]]){this[_0xb39b('0x22')][_0x250d10[_0xb39b('0x23')]]['id']=this[_0xb39b('0xf')][_0x250d10['uniqueid']]['id'];this['channels'][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x25')]=this[_0xb39b('0xf')][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x25')];}logger['info'](_0x250d10['uniqueid'],this[_0xb39b('0xf')][_0x250d10['uniqueid']]?_0xb39b('0x4d'):_0xb39b('0x4e'),JSON['stringify'](this['channels'][_0x250d10[_0xb39b('0x23')]]));if(this[_0xb39b('0xf')][_0x250d10[_0xb39b('0x23')]]){if(this[_0xb39b('0x22')][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x4f')]>0x0&&this[_0xb39b('0x22')][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x50')]===_0xb39b('0x51')){this[_0xb39b('0x4a')](_0x250d10[_0xb39b('0x23')],!![]);}else{this[_0xb39b('0x4a')](_0x250d10[_0xb39b('0x23')],![],this['channels'][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x52')]?_0xb39b('0x53')+this[_0xb39b('0x22')][_0x250d10[_0xb39b('0x23')]][_0xb39b('0x52')]:_0xb39b('0x54'));}}}};Fax[_0xb39b('0x1d')][_0xb39b('0x55')]=function(_0x3b86b6){var _0x498333=this;return new BPromise(function(_0xd5e4a4,_0x5c9f17){_0x498333[_0xb39b('0x56')](_0x3b86b6,_0x498333[_0xb39b('0xd')][_0x3b86b6[_0xb39b('0x57')]])[_0xb39b('0x3a')](function(_0x170a7f){ut['logger']('[Fax][execOriginate][success]',_0x170a7f);_0xd5e4a4(ut['message']('Fax\x20received'));})['catch'](function(_0x492232){ut[_0xb39b('0x47')](_0xb39b('0x58'),_0x492232);updateStatus(_0x3b86b6);_0x5c9f17(ut[_0xb39b('0x36')](_0xb39b('0x59')));});});};Fax[_0xb39b('0x1d')][_0xb39b('0x5a')]=function(_0x50ffe2){var _0x275353=this;return new BPromise(function(_0x44fd30,_0xff66d0){var _0xd432ce=_0x275353[_0xb39b('0x5b')](_0x275353['faxAccounts'][_0x50ffe2[_0xb39b('0x57')]]['Trunk'],_0x50ffe2);if(_0xd432ce[_0xb39b('0x5c')]){_0x44fd30(ut[_0xb39b('0x36')](_0xb39b('0x5d')));}else{_0xff66d0(ut['message'](_0xd432ce[_0xb39b('0x36')]));}});};function originate(_0xe9e89b,_0x1bb6ff,_0x54397f){return new BPromise(function(_0x412f9c,_0x56a820){if(_0x54397f){var _0x5898ba=util[_0xb39b('0x5e')](_0xb39b('0x5f'),path[_0xb39b('0x37')](_0xe9e89b[_0xb39b('0x3')])['name'],_0xe9e89b[_0xb39b('0x3')]);gs[_0xb39b('0x60')](_0x5898ba)['then'](function(){_0xe9e89b[_0xb39b('0x3')]=util['format'](_0xb39b('0x61'),path[_0xb39b('0x37')](_0xe9e89b[_0xb39b('0x3')])[_0xb39b('0x62')],path[_0xb39b('0x37')](_0xe9e89b[_0xb39b('0x3')])[_0xb39b('0x25')]);_0x1bb6ff[_0xb39b('0x63')]=_0xe9e89b['path'];ut[_0xb39b('0x47')](_0xb39b('0x64'),'');ami[_0xb39b('0x65')](ut[_0xb39b('0x66')](_0xe9e89b,_0x1bb6ff))[_0xb39b('0x3a')](function(_0x5dfdf8){_0x412f9c(_0x5dfdf8);})[_0xb39b('0x3b')](function(_0x210ac9){_0x56a820(_0x210ac9);});})[_0xb39b('0x3b')](function(_0x12531f){_0x56a820(_0x12531f);});}else{ami[_0xb39b('0x65')](ut[_0xb39b('0x66')](_0xe9e89b,_0x1bb6ff))['then'](function(_0x46bee8){_0x412f9c(_0x46bee8);})[_0xb39b('0x3b')](function(_0x4d3954){_0x56a820(_0x4d3954);});}});}Fax[_0xb39b('0x1d')][_0xb39b('0x56')]=function(_0xa1eaca,_0x5059b4){var _0x17c7fb=this;return new BPromise(function(_0x1d2537,_0x1b627f){var _0x2b9fcc=uuid['v4']();var _0x3ffb91=ut[_0xb39b('0x67')](_0xa1eaca,_0x5059b4);_0x17c7fb[_0xb39b('0xf')][_0x2b9fcc]=new Action(_0x2b9fcc,_0x5059b4,_0xa1eaca);var _0x38f382=_0x17c7fb[_0xb39b('0xf')][_0x2b9fcc];if(path['parse'](_0xa1eaca[_0xb39b('0x3')])[_0xb39b('0x68')]===_0xb39b('0x38')){originate(_0x38f382,_0x3ffb91,!![])[_0xb39b('0x3a')](function(_0x1ad3b4){_0x1d2537(_0x1ad3b4);})['catch'](function(_0x4c5fad){_0x1b627f(_0x4c5fad);});}else{originate(_0x38f382,_0x3ffb91,![])[_0xb39b('0x3a')](function(_0x15b57d){_0x1d2537(_0x15b57d);})[_0xb39b('0x3b')](function(_0x2bb86d){_0x1b627f(_0x2bb86d);});}});};Fax[_0xb39b('0x1d')]['isTrunkReachable']=function(_0x1963bd){return!_[_0xb39b('0x69')](_0x1963bd)&&!_[_0xb39b('0x69')](_0x1963bd[_0xb39b('0x25')])&&!_['isNil'](_0x1963bd[_0xb39b('0x6a')])&&_0x1963bd[_0xb39b('0x6a')]&&!_[_0xb39b('0x69')](this[_0xb39b('0xe')][util['format'](_0xb39b('0x6b'),_0x1963bd[_0xb39b('0x25')])])&&!_['isNil'](this[_0xb39b('0xe')][util[_0xb39b('0x5e')](_0xb39b('0x6b'),_0x1963bd[_0xb39b('0x25')])][_0xb39b('0x2d')])&&(this[_0xb39b('0xe')][util['format'](_0xb39b('0x6b'),_0x1963bd[_0xb39b('0x25')])][_0xb39b('0x2d')]===_0xb39b('0x6c')||this[_0xb39b('0xe')][util['format'](_0xb39b('0x6b'),_0x1963bd['name'])][_0xb39b('0x2d')]===_0xb39b('0x6d'));};Fax[_0xb39b('0x1d')][_0xb39b('0x5b')]=function(_0x1ff581,_0x1884c4){if(!this['isTrunkReachable'](_0x1ff581)){ut['logger'](_0xb39b('0x6e'),_['isNil'](_0x1ff581)?'':_0x1ff581[_0xb39b('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xb39b('0x69')](_0x1884c4[_0xb39b('0x6')])){ut[_0xb39b('0x47')](_0xb39b('0x6f'),JSON[_0xb39b('0x3e')](_0x1884c4));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x1884c4[_0xb39b('0x3')])){ut['logger'](_0xb39b('0x70'),JSON[_0xb39b('0x3e')](_0x1884c4));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xb39b('0x71')};};module[_0xb39b('0x72')]=Fax; \ No newline at end of file +var _0x21ec=['actions','newchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','syncNewExten','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks'];(function(_0x3ab703,_0x52e6e3){var _0xc8b01=function(_0x1836b6){while(--_0x1836b6){_0x3ab703['push'](_0x3ab703['shift']());}};_0xc8b01(++_0x52e6e3);}(_0x21ec,0xdf));var _0xc21e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x21ec[_0x39096d];return _0x13da4f;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xc21e('0x0'));var uuid=require('uuid');var moment=require(_0xc21e('0x1'));var path=require(_0xc21e('0x2'));var tiff2pdf=require(_0xc21e('0x3'));var gs=require('./util/gs');var logger=require(_0xc21e('0x4'))(_0xc21e('0x5'));var ami=require(_0xc21e('0x6'));var rpcDb=require(_0xc21e('0x7'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xc21e('0x8'));var faxAccount=require(_0xc21e('0x9'));var attachment=require(_0xc21e('0xa'));var faxMessage=require(_0xc21e('0xb'));function Fax(_0x597fe1){this[_0xc21e('0xc')]={};this[_0xc21e('0xd')]=_0x597fe1['faxAccounts'];this[_0xc21e('0xe')]=_0x597fe1[_0xc21e('0xe')];this[_0xc21e('0xf')]={};ami['on'](_0xc21e('0x10'),this['syncNewchannel'][_0xc21e('0x11')](this));ami['on']('varset',this[_0xc21e('0x12')]['bind'](this));ami['on'](_0xc21e('0x13'),this[_0xc21e('0x14')][_0xc21e('0x11')](this));ami['on'](_0xc21e('0x15'),this['syncNewExten'][_0xc21e('0x11')](this));ami['on']('faxstatus',this[_0xc21e('0x16')][_0xc21e('0x11')](this));ami['on'](_0xc21e('0x17'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this[_0xc21e('0x18')][_0xc21e('0x11')](this));ami['on'](_0xc21e('0x19'),this[_0xc21e('0x1a')][_0xc21e('0x11')](this));}Fax[_0xc21e('0x1b')][_0xc21e('0x1c')]=function(_0x36023d){if(_0x36023d[_0xc21e('0x1d')]===_0xc21e('0x1e')){for(var _0x2fc679 in this[_0xc21e('0xd')]){if(this[_0xc21e('0xd')]['hasOwnProperty'](_0x2fc679)){if(_0x36023d[_0xc21e('0x1f')]===this[_0xc21e('0xd')][_0x2fc679][_0xc21e('0x20')]){this[_0xc21e('0xc')][_0x36023d[_0xc21e('0x21')]]={};this['channels'][_0x36023d[_0xc21e('0x21')]][_0xc21e('0x22')]=_0x36023d[_0xc21e('0x22')];this[_0xc21e('0xc')][_0x36023d[_0xc21e('0x21')]]['id']=this['faxAccounts'][_0x2fc679]['id'];this[_0xc21e('0xc')][_0x36023d[_0xc21e('0x21')]][_0xc21e('0x23')]=this['faxAccounts'][_0x2fc679]['name'];logger[_0xc21e('0x24')](_0x36023d['uniqueid'],_0xc21e('0x25'));}}}}if(this[_0xc21e('0xf')][_0x36023d[_0xc21e('0x21')]]){this['channels'][_0x36023d[_0xc21e('0x21')]]={};this['channels'][_0x36023d[_0xc21e('0x21')]][_0xc21e('0x22')]=_0x36023d[_0xc21e('0x22')];logger['info'](_0x36023d['uniqueid'],_0xc21e('0x25'));}};Fax[_0xc21e('0x1b')]['syncVarSet']=function(_0xc1aa07){if(this['channels'][_0xc1aa07['uniqueid']]){for(var _0x1e9bb5 in _0xc1aa07[_0xc21e('0x26')]){if(_0xc1aa07[_0xc21e('0x26')][_0xc21e('0x27')](_0x1e9bb5)){this[_0xc21e('0xc')][_0xc1aa07[_0xc21e('0x21')]][_0x1e9bb5]=_0xc1aa07['value'];}}}};Fax[_0xc21e('0x1b')][_0xc21e('0x14')]=function(_0x2df80c){if(this[_0xc21e('0xc')][_0x2df80c[_0xc21e('0x21')]]){this['channels'][_0x2df80c['uniqueid']][_0xc21e('0x28')]=_0x2df80c[_0xc21e('0x28')];this[_0xc21e('0xc')][_0x2df80c[_0xc21e('0x21')]][_0xc21e('0x29')]=_0x2df80c[_0xc21e('0x29')];}};Fax[_0xc21e('0x1b')][_0xc21e('0x2a')]=function(_0x1fbabd){if(this[_0xc21e('0xc')][_0x1fbabd[_0xc21e('0x21')]]){for(var _0xb21913 in _0x1fbabd[_0xc21e('0x26')]){if(_0x1fbabd[_0xc21e('0x26')][_0xc21e('0x27')](_0xb21913)){this['channels'][_0x1fbabd['uniqueid']][_0xb21913]=_0x1fbabd[_0xc21e('0x2b')];}}}};Fax[_0xc21e('0x1b')]['syncFaxStatus']=function(_0x134180){if(this[_0xc21e('0xc')][_0x134180[_0xc21e('0x21')]]){this['channels'][_0x134180[_0xc21e('0x21')]][_0xc21e('0x2c')]=_0x134180['operation'];this[_0xc21e('0xc')][_0x134180[_0xc21e('0x21')]]['status']=_0x134180[_0xc21e('0x2d')];this[_0xc21e('0xc')][_0x134180['uniqueid']][_0xc21e('0x20')]=_0x134180[_0xc21e('0x20')];this['channels'][_0x134180[_0xc21e('0x21')]][_0xc21e('0x2e')]=_0x134180[_0xc21e('0x2e')];logger[_0xc21e('0x24')](_0x134180['uniqueid'],_0xc21e('0x2f'));}};Fax[_0xc21e('0x1b')][_0xc21e('0x30')]=function(_0x1b540f){var _0x14bc4f=this;if(this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]]){var _0x391c3c=this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]]['id'];this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]][_0xc21e('0x31')]=_0x1b540f[_0xc21e('0x31')];this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]]['pagestransferred']=_0x1b540f[_0xc21e('0x32')];this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]][_0xc21e('0x20')]=_0x1b540f[_0xc21e('0x20')];this['channels'][_0x1b540f[_0xc21e('0x21')]][_0xc21e('0x33')]=_0x1b540f[_0xc21e('0x33')];this[_0xc21e('0xc')][_0x1b540f[_0xc21e('0x21')]][_0xc21e('0x34')]=_0x1b540f[_0xc21e('0x34')];this[_0xc21e('0xc')][_0x1b540f['uniqueid']][_0xc21e('0x2e')]=_0x1b540f[_0xc21e('0x2e')];this[_0xc21e('0xc')][_0x1b540f['uniqueid']][_0xc21e('0x35')]=_0x1b540f['calleridnum'];if(this[_0xc21e('0xc')][_0x1b540f['uniqueid']][_0xc21e('0x32')]>0x0){tiff2pdf(_0x1b540f[_0xc21e('0x2e')],_0xc21e('0x36'),function(_0xa0a62e){logger[_0xc21e('0x24')](_0x1b540f[_0xc21e('0x21')],_0xc21e('0x37'),_0xa0a62e['message']);attachment['create']({'name':path[_0xc21e('0x38')](_0x1b540f[_0xc21e('0x2e')])[_0xc21e('0x23')],'basename':path[_0xc21e('0x38')](_0x1b540f[_0xc21e('0x2e')])['name']+_0xc21e('0x39'),'type':'application/pdf'})['then'](function(_0xbe0f10){faxAccount[_0xc21e('0x3a')](_0x391c3c,{'from':_0x1b540f[_0xc21e('0x35')],'mapKey':_0xc21e('0x5'),'body':path[_0xc21e('0x38')](_0x1b540f[_0xc21e('0x2e')])[_0xc21e('0x23')]+_0xc21e('0x39'),'AttachmentId':_0xbe0f10['id']})['catch'](function(_0x44c774){logger[_0xc21e('0x3b')](_0x1b540f['uniqueid'],_0xc21e('0x3c'),JSON[_0xc21e('0x3d')](_0x44c774));});})[_0xc21e('0x3e')](function(_0x3bd172){logger['error'](_0x1b540f[_0xc21e('0x21')],_0xc21e('0x3f'),JSON[_0xc21e('0x3d')](_0x3bd172));});});}logger['info'](_0x1b540f['uniqueid'],_0xc21e('0x3f'));}};Fax[_0xc21e('0x1b')][_0xc21e('0x1a')]=function(_0x28d70e){if(this[_0xc21e('0xf')][_0x28d70e[_0xc21e('0x21')]]){_[_0xc21e('0x40')](this[_0xc21e('0xc')][_0x28d70e[_0xc21e('0x21')]],_[_0xc21e('0x41')](_0x28d70e,[_0xc21e('0x42'),_0xc21e('0x43')]));}};function updateStatus(_0x3ca6ea){if(_0x3ca6ea[_0xc21e('0x44')]){faxMessage[_0xc21e('0x45')](_0x3ca6ea[_0xc21e('0x44')],{'failMessage':_0xc21e('0x46')})[_0xc21e('0x47')](function(_0x510cb4){ut['logger'](_0xc21e('0x48'),_0x510cb4);})['catch'](function(_0x1086e8){ut[_0xc21e('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x1086e8);});}else{ut[_0xc21e('0x49')](_0xc21e('0x4a'));}}Fax[_0xc21e('0x1b')][_0xc21e('0x4b')]=function(_0x506cd4,_0x90f7d2,_0x5a4350){var _0x2ccf64=this;var _0x2ab4b2={};if(_0x90f7d2){_0x2ab4b2={'read':_0x90f7d2};}else{_0x2ab4b2={'failMessage':_0x5a4350};}if(this[_0xc21e('0xf')][_0x506cd4][_0xc21e('0x44')]){faxMessage['update'](this[_0xc21e('0xf')][_0x506cd4][_0xc21e('0x44')],_0x2ab4b2)[_0xc21e('0x47')](function(_0x2679a9){ut[_0xc21e('0x49')](_0xc21e('0x4c'),_0x2679a9);})['catch'](function(_0x651ef1){ut[_0xc21e('0x49')]('[Fax][Message][NoUpdate1]',_0x651ef1);})[_0xc21e('0x4d')](function(){delete _0x2ccf64['channels'][_0x506cd4];delete _0x2ccf64[_0xc21e('0xf')][_0x506cd4];});}else{ut[_0xc21e('0x49')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x506cd4];delete this[_0xc21e('0xf')][_0x506cd4];}};Fax['prototype'][_0xc21e('0x18')]=function(_0xd8fd12){var _0x51930b=this;if(this['channels'][_0xd8fd12[_0xc21e('0x21')]]){if(this[_0xc21e('0xf')][_0xd8fd12[_0xc21e('0x21')]]){this[_0xc21e('0xc')][_0xd8fd12['uniqueid']]['id']=this[_0xc21e('0xf')][_0xd8fd12['uniqueid']]['id'];this['channels'][_0xd8fd12[_0xc21e('0x21')]][_0xc21e('0x23')]=this['actions'][_0xd8fd12[_0xc21e('0x21')]]['name'];}logger[_0xc21e('0x24')](_0xd8fd12[_0xc21e('0x21')],this[_0xc21e('0xf')][_0xd8fd12[_0xc21e('0x21')]]?_0xc21e('0x4e'):_0xc21e('0x4f'),JSON['stringify'](this[_0xc21e('0xc')][_0xd8fd12['uniqueid']]));if(this['actions'][_0xd8fd12[_0xc21e('0x21')]]){if(this[_0xc21e('0xc')][_0xd8fd12[_0xc21e('0x21')]]['faxpages']>0x0&&this[_0xc21e('0xc')][_0xd8fd12[_0xc21e('0x21')]][_0xc21e('0x50')]===_0xc21e('0x51')){this[_0xc21e('0x4b')](_0xd8fd12[_0xc21e('0x21')],!![]);}else{this[_0xc21e('0x4b')](_0xd8fd12['uniqueid'],![],this[_0xc21e('0xc')][_0xd8fd12[_0xc21e('0x21')]][_0xc21e('0x52')]?'SENDING\x20FAILED:\x20'+this[_0xc21e('0xc')][_0xd8fd12[_0xc21e('0x21')]][_0xc21e('0x52')]:_0xc21e('0x53'));}}}};Fax[_0xc21e('0x1b')][_0xc21e('0x54')]=function(_0x1b245c){var _0x52c6ff=this;return new BPromise(function(_0x265a99,_0x5dffb5){_0x52c6ff[_0xc21e('0x55')](_0x1b245c,_0x52c6ff[_0xc21e('0xd')][_0x1b245c[_0xc21e('0x56')]])['then'](function(_0x2c7c65){ut[_0xc21e('0x49')](_0xc21e('0x57'),_0x2c7c65);_0x265a99(ut['message'](_0xc21e('0x58')));})[_0xc21e('0x3e')](function(_0x3ac8cc){ut[_0xc21e('0x49')](_0xc21e('0x59'),_0x3ac8cc);updateStatus(_0x1b245c);_0x5dffb5(ut[_0xc21e('0x5a')](_0xc21e('0x5b')));});});};Fax[_0xc21e('0x1b')][_0xc21e('0x5c')]=function(_0x554806){var _0x53a14f=this;return new BPromise(function(_0x2bf433,_0x35d7e8){var _0x451ed9=_0x53a14f[_0xc21e('0x5d')](_0x53a14f['faxAccounts'][_0x554806['FaxAccountId']][_0xc21e('0x5e')],_0x554806);if(_0x451ed9[_0xc21e('0x5f')]){_0x2bf433(ut[_0xc21e('0x5a')](_0xc21e('0x60')));}else{_0x35d7e8(ut[_0xc21e('0x5a')](_0x451ed9[_0xc21e('0x5a')]));}});};function originate(_0x4dc3fe,_0x2fc109,_0x46a358){return new BPromise(function(_0x5b2513,_0x3a4fed){if(_0x46a358){var _0x1cf27e=util[_0xc21e('0x61')](_0xc21e('0x62'),path[_0xc21e('0x38')](_0x4dc3fe[_0xc21e('0x2')])['name'],_0x4dc3fe['path']);gs[_0xc21e('0x63')](_0x1cf27e)[_0xc21e('0x47')](function(){_0x4dc3fe[_0xc21e('0x2')]=util['format']('%s/%s.tif',path[_0xc21e('0x38')](_0x4dc3fe[_0xc21e('0x2')])[_0xc21e('0x64')],path[_0xc21e('0x38')](_0x4dc3fe['path'])[_0xc21e('0x23')]);_0x2fc109[_0xc21e('0x65')]=_0x4dc3fe[_0xc21e('0x2')];ut[_0xc21e('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0xc21e('0x66')](ut[_0xc21e('0x67')](_0x4dc3fe,_0x2fc109))['then'](function(_0x5ab2f3){_0x5b2513(_0x5ab2f3);})['catch'](function(_0x1c4309){_0x3a4fed(_0x1c4309);});})[_0xc21e('0x3e')](function(_0x22705e){_0x3a4fed(_0x22705e);});}else{ami[_0xc21e('0x66')](ut[_0xc21e('0x67')](_0x4dc3fe,_0x2fc109))[_0xc21e('0x47')](function(_0x2320ff){_0x5b2513(_0x2320ff);})[_0xc21e('0x3e')](function(_0x1f54d5){_0x3a4fed(_0x1f54d5);});}});}Fax[_0xc21e('0x1b')]['execOriginate']=function(_0x2678fb,_0x18aede){var _0x29f763=this;return new BPromise(function(_0x3cadb5,_0x50ad50){var _0x3f35c7=uuid['v4']();var _0x4696cc=ut[_0xc21e('0x68')](_0x2678fb,_0x18aede);_0x29f763[_0xc21e('0xf')][_0x3f35c7]=new Action(_0x3f35c7,_0x18aede,_0x2678fb);var _0xddb767=_0x29f763[_0xc21e('0xf')][_0x3f35c7];if(path[_0xc21e('0x38')](_0x2678fb[_0xc21e('0x2')])[_0xc21e('0x69')]===_0xc21e('0x39')){originate(_0xddb767,_0x4696cc,!![])[_0xc21e('0x47')](function(_0xf3dc71){_0x3cadb5(_0xf3dc71);})[_0xc21e('0x3e')](function(_0xe1403a){_0x50ad50(_0xe1403a);});}else{originate(_0xddb767,_0x4696cc,![])['then'](function(_0x42587b){_0x3cadb5(_0x42587b);})[_0xc21e('0x3e')](function(_0x3449e6){_0x50ad50(_0x3449e6);});}});};Fax[_0xc21e('0x1b')][_0xc21e('0x6a')]=function(_0x3dd76a){return!_[_0xc21e('0x6b')](_0x3dd76a)&&!_[_0xc21e('0x6b')](_0x3dd76a[_0xc21e('0x23')])&&!_[_0xc21e('0x6b')](_0x3dd76a[_0xc21e('0x6c')])&&_0x3dd76a['active']&&!_[_0xc21e('0x6b')](this[_0xc21e('0xe')][util[_0xc21e('0x61')](_0xc21e('0x6d'),_0x3dd76a[_0xc21e('0x23')])])&&!_['isNil'](this[_0xc21e('0xe')][util[_0xc21e('0x61')]('SIP/%s',_0x3dd76a[_0xc21e('0x23')])]['status'])&&(this[_0xc21e('0xe')][util[_0xc21e('0x61')](_0xc21e('0x6d'),_0x3dd76a[_0xc21e('0x23')])]['status']==='reachable'||this[_0xc21e('0xe')][util['format'](_0xc21e('0x6d'),_0x3dd76a['name'])]['status']===_0xc21e('0x6e'));};Fax[_0xc21e('0x1b')][_0xc21e('0x5d')]=function(_0x28013a,_0x4dde3c){if(!this['isTrunkReachable'](_0x28013a)){ut[_0xc21e('0x49')](_0xc21e('0x6f'),_[_0xc21e('0x6b')](_0x28013a)?'':_0x28013a[_0xc21e('0x23')]+_0xc21e('0x70'));return{'isValid':![],'message':_0xc21e('0x71')};}if(_[_0xc21e('0x6b')](_0x4dde3c[_0xc21e('0x5')])){ut[_0xc21e('0x49')](_0xc21e('0x72'),JSON[_0xc21e('0x3d')](_0x4dde3c));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xc21e('0x6b')](_0x4dde3c['path'])){ut[_0xc21e('0x49')](_0xc21e('0x73'),JSON[_0xc21e('0x3d')](_0x4dde3c));return{'isValid':![],'message':_0xc21e('0x74')};}return{'isValid':!![],'message':_0xc21e('0x75')};};module[_0xc21e('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index bc3e0ac..b06e7d1 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 _0x004c=['util','preview','lodash','error','inspect','resolve','then','notify'];(function(_0xeaa3bd,_0x166691){var _0x2e1174=function(_0x310580){while(--_0x310580){_0xeaa3bd['push'](_0xeaa3bd['shift']());}};_0x2e1174(++_0x166691);}(_0x004c,0x1b0));var _0xc004=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x004c[_0x819464];return _0x49dcc0;};'use strict';var util=require(_0xc004('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xc004('0x1'));var _=require(_0xc004('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x404973){return function(_0x447d11){logger[_0xc004('0x3')](_0x404973,util[_0xc004('0x4')](_0x447d11,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1c3061,_0x1e2cc9){return BPromise[_0xc004('0x5')]()[_0xc004('0x6')](faxAccount[_0xc004('0x7')](_0x1c3061,_0x1e2cc9))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xcfec=['resolve','then','notify','catch','[Notify]\x20','lodash','../rpc/faxAccount','error','inspect'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xcfec,0x188));var _0xccfe=function(_0x5eec91,_0x2c1d91){_0x5eec91=_0x5eec91-0x0;var _0x41cacf=_0xcfec[_0x5eec91];return _0x41cacf;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0xccfe('0x0'));var faxAccount=require(_0xccfe('0x1'));function loggerCatch(_0x175a0a){return function(_0x9b3417){logger[_0xccfe('0x2')](_0x175a0a,util[_0xccfe('0x3')](_0x9b3417,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x3f0d56,_0x5691b4){return BPromise[_0xccfe('0x4')]()[_0xccfe('0x5')](faxAccount[_0xccfe('0x6')](_0x3f0d56,_0x5691b4))[_0xccfe('0x7')](loggerCatch(_0xccfe('0x8')));}; \ 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 cb256e9..618bb11 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 _0x8ffd=['bluebird','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x8ffd,0x1b6));var _0xd8ff=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x8ffd[_0x26bcec];return _0x1049dc;};'use strict';var util=require(_0xd8ff('0x0'));var logger=require('../../../../config/logger')(_0xd8ff('0x1'));var BPromise=require(_0xd8ff('0x2'));var exec=require('child_process')['exec'];exports[_0xd8ff('0x3')]=function(_0x413c8e){return new BPromise(function(_0x223951,_0x390c74){exec(_0x413c8e,function(_0x37103f,_0x218657,_0x5d06fc){logger[_0xd8ff('0x4')](_0xd8ff('0x5'),_0x218657);if(_0x37103f){logger[_0xd8ff('0x4')](_0xd8ff('0x5'),_0xd8ff('0x6'),util[_0xd8ff('0x7')](_0x37103f,{'showHidden':![],'depth':null}),_0x218657,_0x5d06fc);_0x390c74(_0x37103f);}_0x223951(_0x218657);});});}; \ No newline at end of file +var _0xac2a=['../../../../config/logger','bluebird','exec','execute','Exec\x20gs','inspect','util'];(function(_0x3b5964,_0x2f21c4){var _0xbc8296=function(_0x1f0789){while(--_0x1f0789){_0x3b5964['push'](_0x3b5964['shift']());}};_0xbc8296(++_0x2f21c4);}(_0xac2a,0xa0));var _0xaac2=function(_0x195b92,_0x53ca3f){_0x195b92=_0x195b92-0x0;var _0x33a918=_0xac2a[_0x195b92];return _0x33a918;};'use strict';var util=require(_0xaac2('0x0'));var logger=require(_0xaac2('0x1'))('fax');var BPromise=require(_0xaac2('0x2'));var exec=require('child_process')[_0xaac2('0x3')];exports[_0xaac2('0x4')]=function(_0x406302){return new BPromise(function(_0x189ae0,_0x3e61a3){exec(_0x406302,function(_0x190102,_0x235299,_0x291312){logger['info'](_0xaac2('0x5'),_0x235299);if(_0x190102){logger['info'](_0xaac2('0x5'),'\x20Error\x20:',util[_0xaac2('0x6')](_0x190102,{'showHidden':![],'depth':null}),_0x235299,_0x291312);_0x3e61a3(_0x190102);}_0x189ae0(_0x235299);});});}; \ 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 f016015..0d90e38 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 _0x8780=['from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','ecm','headerinfo','minrate','maxrate','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel'];(function(_0x42b187,_0x487d00){var _0x10842f=function(_0x1abcc7){while(--_0x1abcc7){_0x42b187['push'](_0x42b187['shift']());}};_0x10842f(++_0x487d00);}(_0x8780,0xa4));var _0x0878=function(_0x287a86,_0x58f52d){_0x287a86=_0x287a86-0x0;var _0x37079f=_0x8780[_0x287a86];return _0x37079f;};'use strict';var util=require(_0x0878('0x0'));var _=require(_0x0878('0x1'));var moment=require(_0x0878('0x2'));var logger=require(_0x0878('0x3'))(_0x0878('0x4'));exports[_0x0878('0x5')]=function(_0xf79e5b){return{'message':_0xf79e5b};};exports['logger']=function(_0x2890b5,_0x494911){logger[_0x0878('0x6')](_0x2890b5,util[_0x0878('0x7')](_0x494911,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x36e4a1,_0x1e0e17){var _0x1738d7={'XMF-ECM':_0x1e0e17[_0x0878('0x8')],'XMF-HEADERINFO':_0x1e0e17[_0x0878('0x9')],'XMF-MINRATE':_0x1e0e17[_0x0878('0xa')],'XMF-MAXRATE':_0x1e0e17[_0x0878('0xb')],'XMF-MODEM':util['format']('\x22%s\x22',_0x1e0e17['modem']),'XMF-GATEWAY':_0x1e0e17[_0x0878('0xc')],'XMF-FAXDETECT':_0x1e0e17[_0x0878('0xd')],'XMF-T38TIMEOUT':_0x1e0e17[_0x0878('0xe')],'XMF-LOCALSTATIONID':_0x1e0e17[_0x0878('0xf')],'XMF-PATH':_0x36e4a1[_0x0878('0x10')]};return _0x1738d7;};exports['variablesAction']=function(_0x1a722a,_0xa9adb4){return{'actionid':_0x1a722a[_0x0878('0x11')],'action':_0x0878('0x12'),'channel':_0x1a722a[_0x0878('0x13')],'Exten':'xcally-motion-fax','Context':_0x0878('0x14'),'Priority':'1','callerid':util[_0x0878('0x15')](_0x0878('0x16'),_0x1a722a['headerinfo']?_0x1a722a[_0x0878('0x9')]:'',_0x1a722a[_0x0878('0xf')]),'variable':_0xa9adb4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a722a[_0x0878('0x11')]};}; \ No newline at end of file +var _0x20ff=['addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','info','inspect'];(function(_0x5a2065,_0x19c4fb){var _0x218567=function(_0x209f0d){while(--_0x209f0d){_0x5a2065['push'](_0x5a2065['shift']());}};_0x218567(++_0x19c4fb);}(_0x20ff,0xa4));var _0xf20f=function(_0x49238d,_0x34e58f){_0x49238d=_0x49238d-0x0;var _0x4ee4a1=_0x20ff[_0x49238d];return _0x4ee4a1;};'use strict';var util=require('util');var _=require(_0xf20f('0x0'));var moment=require('moment');var logger=require(_0xf20f('0x1'))('fax');exports['message']=function(_0x2484e5){return{'message':_0x2484e5};};exports['logger']=function(_0x211efc,_0x2f824f){logger[_0xf20f('0x2')](_0x211efc,util[_0xf20f('0x3')](_0x2f824f,{'showHidden':![],'depth':null}));};exports[_0xf20f('0x4')]=function(_0x55dbf2,_0x11469e){var _0x176d65={'XMF-ECM':_0x11469e[_0xf20f('0x5')],'XMF-HEADERINFO':_0x11469e[_0xf20f('0x6')],'XMF-MINRATE':_0x11469e['minrate'],'XMF-MAXRATE':_0x11469e[_0xf20f('0x7')],'XMF-MODEM':util['format'](_0xf20f('0x8'),_0x11469e[_0xf20f('0x9')]),'XMF-GATEWAY':_0x11469e[_0xf20f('0xa')],'XMF-FAXDETECT':_0x11469e[_0xf20f('0xb')],'XMF-T38TIMEOUT':_0x11469e[_0xf20f('0xc')],'XMF-LOCALSTATIONID':_0x11469e[_0xf20f('0xd')],'XMF-PATH':_0x55dbf2[_0xf20f('0xe')]};return _0x176d65;};exports['variablesAction']=function(_0x129d8a,_0x2c7fd0){return{'actionid':_0x129d8a[_0xf20f('0xf')],'action':_0xf20f('0x10'),'channel':_0x129d8a[_0xf20f('0x11')],'Exten':'xcally-motion-fax','Context':_0xf20f('0x12'),'Priority':'1','callerid':util[_0xf20f('0x13')](_0xf20f('0x14'),_0x129d8a['headerinfo']?_0x129d8a[_0xf20f('0x6')]:'',_0x129d8a[_0xf20f('0xd')]),'variable':_0x2c7fd0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x129d8a[_0xf20f('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 356596d..8a89ddc 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 _0xb617=['inspect','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./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','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]'];(function(_0x18ed8d,_0x2d74c2){var _0x45de5d=function(_0x123e44){while(--_0x123e44){_0x18ed8d['push'](_0x18ed8d['shift']());}};_0x45de5d(++_0x2d74c2);}(_0xb617,0x16f));var _0x7b61=function(_0x45188a,_0x2216ab){_0x45188a=_0x45188a-0x0;var _0x104b91=_0xb617[_0x45188a];return _0x104b91;};'use strict';var BPromise=require(_0x7b61('0x0'));var util=require('util');var moment=require(_0x7b61('0x1'));var server=require(_0x7b61('0x2'));var Realtime=require(_0x7b61('0x3'));var Report=require('./report');var Acw=require(_0x7b61('0x4'));var Trigger=require(_0x7b61('0x5'));var Dialer=require(_0x7b61('0x6'));var Preview=require('./preview');var Fax=require(_0x7b61('0x7'));var user=require(_0x7b61('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x7b61('0x9'));var voiceCallReport=require(_0x7b61('0xa'));var trunk=require(_0x7b61('0xb'));var trigger=require(_0x7b61('0xc'));var template=require(_0x7b61('0xd'));var cmHopperHistory=require(_0x7b61('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x7b61('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x7b61('0x10'));var salesforce=require(_0x7b61('0x11'));var sugarcrm=require(_0x7b61('0x12'));var freshdesk=require(_0x7b61('0x13'));var desk=require(_0x7b61('0x14'));var zoho=require(_0x7b61('0x15'));var vtiger=require(_0x7b61('0x16'));var freshsales=require(_0x7b61('0x17'));var servicenow=require(_0x7b61('0x18'));var dynamics365=require(_0x7b61('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x7b61('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7b61('0x1b')](_0x7b61('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7b61('0x1b')](_0x7b61('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x7b61('0x1d')](user[_0x7b61('0x1e')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x1f')]())[_0x7b61('0x1d')](user[_0x7b61('0x20')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x21')]())[_0x7b61('0x1d')](trunk[_0x7b61('0x22')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x23')]())[_0x7b61('0x1d')](voiceQueue[_0x7b61('0x24')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x25')]())[_0x7b61('0x1d')](trigger[_0x7b61('0x26')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x27')]())[_0x7b61('0x1d')](template[_0x7b61('0x28')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x29')]())[_0x7b61('0x1d')](zendesk[_0x7b61('0x2a')]())[_0x7b61('0x1d')](realtime['initZendeskAccounts']())[_0x7b61('0x1d')](salesforce[_0x7b61('0x2b')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x2c')]())[_0x7b61('0x1d')](sugarcrm[_0x7b61('0x2d')]())['then'](realtime[_0x7b61('0x2e')]())[_0x7b61('0x1d')](freshdesk['getFreshdeskAccounts']())[_0x7b61('0x1d')](realtime[_0x7b61('0x2f')]())[_0x7b61('0x1d')](desk[_0x7b61('0x30')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x31')]())[_0x7b61('0x1d')](zoho[_0x7b61('0x32')]())[_0x7b61('0x1d')](realtime['initZohoAccounts']())[_0x7b61('0x1d')](vtiger['getVtigerAccounts']())[_0x7b61('0x1d')](realtime[_0x7b61('0x33')]())['then'](freshsales['getFreshsalesAccounts']())[_0x7b61('0x1d')](realtime['initFreshsalesAccounts']())[_0x7b61('0x1d')](servicenow[_0x7b61('0x34')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x35')]())[_0x7b61('0x1d')](dynamics365['getDynamics365Accounts']())[_0x7b61('0x1d')](realtime['initDynamics365Accounts']())['then'](campaign[_0x7b61('0x36')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x37')]())[_0x7b61('0x1d')](voiceExtension[_0x7b61('0x38')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x39')]())[_0x7b61('0x1d')](faxAccount[_0x7b61('0x3a')]())['then'](realtime[_0x7b61('0x3b')]())[_0x7b61('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x7b61('0x3c')]()[_0x7b61('0x1d')](voiceQueueReport[_0x7b61('0x3d')]())['then'](realtime[_0x7b61('0x3e')]())['then'](cmHopperHistory[_0x7b61('0x3f')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x40')]())[_0x7b61('0x1d')](cmHopperHistory[_0x7b61('0x41')]())[_0x7b61('0x1d')](realtime[_0x7b61('0x42')]())[_0x7b61('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x7b61('0x1d')](realtime[_0x7b61('0x43')]())[_0x7b61('0x44')](function(_0x20c0cd){logger[_0x7b61('0x45')](_0x7b61('0x46'),util[_0x7b61('0x47')](_0x20c0cd,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x7b61('0x1d')](function(_0xc264c2){return initRealtime();})[_0x7b61('0x1d')](function(){return initParams();})[_0x7b61('0x1d')](function(){report[_0x7b61('0x48')]();setInterval(initRealtime,0x1388);})[_0x7b61('0x44')](function(_0x5b235a){logger[_0x7b61('0x45')]('[index.js][main]',util['inspect'](_0x5b235a,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xa27b=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','listen','sync','[index.js][main]','inspect','util','moment','./realtime','./report','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./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/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports'];(function(_0xac55,_0x4e37d2){var _0x1b71b6=function(_0x1cbd05){while(--_0x1cbd05){_0xac55['push'](_0xac55['shift']());}};_0x1b71b6(++_0x4e37d2);}(_0xa27b,0x174));var _0xba27=function(_0x1bc324,_0x3f25ea){_0x1bc324=_0x1bc324-0x0;var _0xb37c7=_0xa27b[_0x1bc324];return _0xb37c7;};'use strict';var BPromise=require('bluebird');var util=require(_0xba27('0x0'));var moment=require(_0xba27('0x1'));var server=require('./server');var Realtime=require(_0xba27('0x2'));var Report=require(_0xba27('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0xba27('0x4'));var Preview=require(_0xba27('0x5'));var Fax=require(_0xba27('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0xba27('0x7'));var voiceQueueReport=require(_0xba27('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xba27('0x9'));var trigger=require(_0xba27('0xa'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xba27('0xb'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xba27('0xc'));var zendesk=require(_0xba27('0xd'));var salesforce=require(_0xba27('0xe'));var sugarcrm=require(_0xba27('0xf'));var freshdesk=require(_0xba27('0x10'));var desk=require(_0xba27('0x11'));var zoho=require(_0xba27('0x12'));var vtiger=require(_0xba27('0x13'));var freshsales=require(_0xba27('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xba27('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xba27('0x16'))(_0xba27('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xba27('0x18')](_0xba27('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xba27('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xba27('0x1a')]()[_0xba27('0x1b')](user[_0xba27('0x1c')]())[_0xba27('0x1b')](realtime[_0xba27('0x1d')]())['then'](user[_0xba27('0x1e')]())[_0xba27('0x1b')](realtime[_0xba27('0x1f')]())[_0xba27('0x1b')](trunk[_0xba27('0x20')]())[_0xba27('0x1b')](realtime[_0xba27('0x21')]())['then'](voiceQueue[_0xba27('0x22')]())[_0xba27('0x1b')](realtime[_0xba27('0x23')]())[_0xba27('0x1b')](trigger[_0xba27('0x24')]())[_0xba27('0x1b')](realtime[_0xba27('0x25')]())['then'](template[_0xba27('0x26')]())['then'](realtime[_0xba27('0x27')]())[_0xba27('0x1b')](zendesk[_0xba27('0x28')]())[_0xba27('0x1b')](realtime[_0xba27('0x29')]())[_0xba27('0x1b')](salesforce['getSalesforceAccounts']())[_0xba27('0x1b')](realtime[_0xba27('0x2a')]())[_0xba27('0x1b')](sugarcrm[_0xba27('0x2b')]())[_0xba27('0x1b')](realtime['initSugarcrmAccounts']())[_0xba27('0x1b')](freshdesk[_0xba27('0x2c')]())[_0xba27('0x1b')](realtime[_0xba27('0x2d')]())[_0xba27('0x1b')](desk[_0xba27('0x2e')]())[_0xba27('0x1b')](realtime[_0xba27('0x2f')]())[_0xba27('0x1b')](zoho[_0xba27('0x30')]())[_0xba27('0x1b')](realtime[_0xba27('0x31')]())['then'](vtiger['getVtigerAccounts']())[_0xba27('0x1b')](realtime[_0xba27('0x32')]())['then'](freshsales[_0xba27('0x33')]())[_0xba27('0x1b')](realtime[_0xba27('0x34')]())[_0xba27('0x1b')](servicenow[_0xba27('0x35')]())[_0xba27('0x1b')](realtime['initServicenowAccounts']())[_0xba27('0x1b')](dynamics365[_0xba27('0x36')]())['then'](realtime[_0xba27('0x37')]())['then'](campaign['getCampaigns']())[_0xba27('0x1b')](realtime[_0xba27('0x38')]())[_0xba27('0x1b')](voiceExtension[_0xba27('0x39')]())[_0xba27('0x1b')](realtime[_0xba27('0x3a')]())[_0xba27('0x1b')](faxAccount['getFaxAccounts']())[_0xba27('0x1b')](realtime['initFaxAccounts']())[_0xba27('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0xba27('0x1a')]()[_0xba27('0x1b')](voiceQueueReport[_0xba27('0x3b')]())['then'](realtime[_0xba27('0x3c')]())[_0xba27('0x1b')](cmHopperHistory[_0xba27('0x3d')]())[_0xba27('0x1b')](realtime[_0xba27('0x3e')]())[_0xba27('0x1b')](cmHopperHistory[_0xba27('0x3f')]())[_0xba27('0x1b')](realtime['initCampaignHopperHistory']())[_0xba27('0x1b')](voiceCallReport[_0xba27('0x40')]())[_0xba27('0x1b')](realtime[_0xba27('0x41')]())[_0xba27('0x42')](function(_0x3f2db1){logger['error'](_0xba27('0x43'),util['inspect'](_0x3f2db1,{'showHidden':![],'depth':null}));});}function main(){return server[_0xba27('0x44')](realtime,preview,fax)['then'](function(_0x142e09){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xba27('0x45')]();setInterval(initRealtime,0x1388);})[_0xba27('0x42')](function(_0x494dde){logger['error'](_0xba27('0x46'),util[_0xba27('0x47')](_0x494dde,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index c5dbb04..cce57d6 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x211d4a,_0x9d4244){var _0x208576=function(_0x24a891){while(--_0x24a891){_0x211d4a['push'](_0x211d4a['shift']());}};_0x208576(++_0x9d4244);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x309dea,_0x57e6c2){var _0x10fa25=function(_0x4f2d65){while(--_0x4f2d65){_0x309dea['push'](_0x309dea['shift']());}};_0x10fa25(++_0x57e6c2);}(_0x34e8,0x12c));var _0x834e=function(_0x57aeb1,_0x51b243){_0x57aeb1=_0x57aeb1-0x0;var _0x5590e2=_0x34e8[_0x57aeb1];return _0x5590e2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c9acbbe..0e78062 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 _0xb5b3=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x3c2eed,_0x53db93){var _0x43baed=function(_0x3ea710){while(--_0x3ea710){_0x3c2eed['push'](_0x3c2eed['shift']());}};_0x43baed(++_0x53db93);}(_0xb5b3,0x1cf));var _0x3b5b=function(_0x247190,_0x1bff9e){_0x247190=_0x247190-0x0;var _0x5972a5=_0xb5b3[_0x247190];return _0x5972a5;};'use strict';function Campaign(_0xebd12){this['id']=_0xebd12['id']||0x0;this[_0x3b5b('0x0')]=_0xebd12[_0x3b5b('0x0')]||'';this[_0x3b5b('0x1')]=_0xebd12[_0x3b5b('0x1')]||_0x3b5b('0x2');this['originated']=0x0;this[_0x3b5b('0x3')]=0x0;this[_0x3b5b('0x4')]=0x0;this[_0x3b5b('0x5')]=0x0;this[_0x3b5b('0x6')]='';this[_0x3b5b('0x7')]=!![];this[_0x3b5b('0x8')]=_0xebd12[_0x3b5b('0x8')];this['limitCalls']=_0xebd12[_0x3b5b('0x9')];this[_0x3b5b('0xa')]=_0xebd12['dialTimezone']||null;this[_0x3b5b('0xb')]=_0xebd12['dialGlobalInterval']?_0xebd12[_0x3b5b('0xb')]:null;this[_0x3b5b('0xc')]=_0xebd12[_0x3b5b('0xc')];this['dialOriginateCallerIdNumber']=_0xebd12[_0x3b5b('0xd')];this['dialOriginateTimeout']=_0xebd12[_0x3b5b('0xe')]||0x1e;this[_0x3b5b('0xf')]=_0xebd12[_0x3b5b('0xf')];this[_0x3b5b('0x10')]=_0xebd12[_0x3b5b('0x10')];this[_0x3b5b('0x11')]=_0xebd12[_0x3b5b('0x11')];this[_0x3b5b('0x12')]=_0xebd12[_0x3b5b('0x12')];this[_0x3b5b('0x13')]=_0xebd12[_0x3b5b('0x13')];this[_0x3b5b('0x14')]=_0xebd12[_0x3b5b('0x14')];this[_0x3b5b('0x15')]=_0xebd12[_0x3b5b('0x15')];this[_0x3b5b('0x16')]=_0xebd12[_0x3b5b('0x16')]||0x3;this[_0x3b5b('0x17')]=_0xebd12[_0x3b5b('0x17')]||0x96;this[_0x3b5b('0x18')]=_0xebd12[_0x3b5b('0x18')]||0x3;this[_0x3b5b('0x19')]=_0xebd12[_0x3b5b('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0xebd12[_0x3b5b('0x1a')]||0x3;this[_0x3b5b('0x1b')]=_0xebd12[_0x3b5b('0x1b')]||0x96;this['dialMachineMaxRetry']=_0xebd12['dialMachineMaxRetry']||0x3;this[_0x3b5b('0x1c')]=_0xebd12['dialMachineRetryFrequency']||0x96;this[_0x3b5b('0x1d')]=_0xebd12[_0x3b5b('0x1d')]||0x3;this[_0x3b5b('0x1e')]=_0xebd12[_0x3b5b('0x1e')]||0x96;this[_0x3b5b('0x1f')]=_0xebd12[_0x3b5b('0x1f')]||_0x3b5b('0x20');this[_0x3b5b('0x21')]=_0xebd12[_0x3b5b('0x21')]||undefined;this[_0x3b5b('0x22')]=_0xebd12[_0x3b5b('0x22')]||undefined;this[_0x3b5b('0x23')]=_0xebd12[_0x3b5b('0x23')]||undefined;this[_0x3b5b('0x24')]=_0xebd12['TrunkBackup']?_0xebd12[_0x3b5b('0x24')]:undefined;this[_0x3b5b('0x25')]=_0xebd12['Trunk']?_0xebd12[_0x3b5b('0x25')]:undefined;this[_0x3b5b('0x26')]=_0xebd12['Interval']?_0xebd12[_0x3b5b('0x26')]:undefined;this[_0x3b5b('0x27')]=_0xebd12[_0x3b5b('0x27')]?_0xebd12[_0x3b5b('0x27')]:undefined;this[_0x3b5b('0x28')]=_0xebd12[_0x3b5b('0x27')]?_0xebd12[_0x3b5b('0x27')]['name']:undefined;this[_0x3b5b('0x29')]=_0xebd12['dialAMDActive']||![];this[_0x3b5b('0x2a')]=_0xebd12['dialAMDInitialSilence'];this[_0x3b5b('0x2b')]=_0xebd12[_0x3b5b('0x2b')];this[_0x3b5b('0x2c')]=_0xebd12[_0x3b5b('0x2c')];this[_0x3b5b('0x2d')]=_0xebd12[_0x3b5b('0x2d')];this[_0x3b5b('0x2e')]=_0xebd12[_0x3b5b('0x2e')];this[_0x3b5b('0x2f')]=_0xebd12[_0x3b5b('0x2f')];this[_0x3b5b('0x30')]=_0xebd12[_0x3b5b('0x30')];this[_0x3b5b('0x31')]=_0xebd12[_0x3b5b('0x31')];this[_0x3b5b('0x32')]=_0xebd12[_0x3b5b('0x32')];}module['exports']=Campaign; \ No newline at end of file +var _0xa285=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active'];(function(_0x2eebda,_0x1849ff){var _0x42bb3c=function(_0x3c02f7){while(--_0x3c02f7){_0x2eebda['push'](_0x2eebda['shift']());}};_0x42bb3c(++_0x1849ff);}(_0xa285,0x123));var _0x5a28=function(_0x288278,_0x382e76){_0x288278=_0x288278-0x0;var _0xdd5dc7=_0xa285[_0x288278];return _0xdd5dc7;};'use strict';function Campaign(_0x3a30d7){this['id']=_0x3a30d7['id']||0x0;this[_0x5a28('0x0')]=_0x3a30d7['name']||'';this[_0x5a28('0x1')]=_0x3a30d7['type']||_0x5a28('0x2');this[_0x5a28('0x3')]=0x0;this['temp']=0x0;this[_0x5a28('0x4')]=0x0;this[_0x5a28('0x5')]=0x0;this[_0x5a28('0x6')]='';this[_0x5a28('0x7')]=!![];this[_0x5a28('0x8')]=_0x3a30d7[_0x5a28('0x8')];this[_0x5a28('0x9')]=_0x3a30d7[_0x5a28('0x9')];this[_0x5a28('0xa')]=_0x3a30d7['dialTimezone']||null;this[_0x5a28('0xb')]=_0x3a30d7[_0x5a28('0xb')]?_0x3a30d7[_0x5a28('0xb')]:null;this['dialOriginateCallerIdName']=_0x3a30d7[_0x5a28('0xc')];this[_0x5a28('0xd')]=_0x3a30d7[_0x5a28('0xd')];this[_0x5a28('0xe')]=_0x3a30d7[_0x5a28('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x3a30d7['dialCongestionMaxRetry'];this[_0x5a28('0xf')]=_0x3a30d7[_0x5a28('0xf')];this[_0x5a28('0x10')]=_0x3a30d7[_0x5a28('0x10')];this['dialBusyRetryFrequency']=_0x3a30d7['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x3a30d7[_0x5a28('0x11')];this[_0x5a28('0x12')]=_0x3a30d7[_0x5a28('0x12')];this['dialGlobalMaxRetry']=_0x3a30d7[_0x5a28('0x13')];this[_0x5a28('0x14')]=_0x3a30d7[_0x5a28('0x14')]||0x3;this[_0x5a28('0x15')]=_0x3a30d7[_0x5a28('0x15')]||0x96;this[_0x5a28('0x16')]=_0x3a30d7[_0x5a28('0x16')]||0x3;this['dialDropRetryFrequency']=_0x3a30d7[_0x5a28('0x17')]||0x96;this[_0x5a28('0x18')]=_0x3a30d7[_0x5a28('0x18')]||0x3;this[_0x5a28('0x19')]=_0x3a30d7[_0x5a28('0x19')]||0x96;this['dialMachineMaxRetry']=_0x3a30d7[_0x5a28('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x3a30d7[_0x5a28('0x1b')]||0x96;this[_0x5a28('0x1c')]=_0x3a30d7[_0x5a28('0x1c')]||0x3;this[_0x5a28('0x1d')]=_0x3a30d7[_0x5a28('0x1d')]||0x96;this[_0x5a28('0x1e')]=_0x3a30d7[_0x5a28('0x1e')]||_0x5a28('0x1f');this[_0x5a28('0x20')]=_0x3a30d7[_0x5a28('0x20')]||undefined;this[_0x5a28('0x21')]=_0x3a30d7[_0x5a28('0x21')]||undefined;this[_0x5a28('0x22')]=_0x3a30d7[_0x5a28('0x22')]||undefined;this[_0x5a28('0x23')]=_0x3a30d7[_0x5a28('0x23')]?_0x3a30d7[_0x5a28('0x23')]:undefined;this[_0x5a28('0x24')]=_0x3a30d7[_0x5a28('0x24')]?_0x3a30d7[_0x5a28('0x24')]:undefined;this[_0x5a28('0x25')]=_0x3a30d7[_0x5a28('0x25')]?_0x3a30d7[_0x5a28('0x25')]:undefined;this['SquareProject']=_0x3a30d7[_0x5a28('0x26')]?_0x3a30d7['SquareProject']:undefined;this[_0x5a28('0x27')]=_0x3a30d7[_0x5a28('0x26')]?_0x3a30d7[_0x5a28('0x26')][_0x5a28('0x0')]:undefined;this[_0x5a28('0x28')]=_0x3a30d7[_0x5a28('0x28')]||![];this[_0x5a28('0x29')]=_0x3a30d7['dialAMDInitialSilence'];this[_0x5a28('0x2a')]=_0x3a30d7['dialAMDGreeting'];this[_0x5a28('0x2b')]=_0x3a30d7['dialAMDAfterGreetingSilence'];this[_0x5a28('0x2c')]=_0x3a30d7['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x3a30d7['dialAMDMinWordLength'];this[_0x5a28('0x2d')]=_0x3a30d7[_0x5a28('0x2d')];this[_0x5a28('0x2e')]=_0x3a30d7[_0x5a28('0x2e')];this['dialAMDSilenceThreshold']=_0x3a30d7[_0x5a28('0x2f')];this[_0x5a28('0x30')]=_0x3a30d7[_0x5a28('0x30')];}module[_0x5a28('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 23066b4..15228b0 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 _0x943d=['exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','transfercalleridnum','transferType','mohtime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid'];(function(_0x45486d,_0x58afe0){var _0x4bddcb=function(_0xfb400c){while(--_0xfb400c){_0x45486d['push'](_0x45486d['shift']());}};_0x4bddcb(++_0x58afe0);}(_0x943d,0x155));var _0xd943=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x943d[_0xf31767];return _0x24bd0c;};'use strict';function Channel(){this['starttime']=null;this[_0xd943('0x0')]='';this[_0xd943('0x1')]='';this[_0xd943('0x2')]=0x0;this[_0xd943('0x3')]='';this[_0xd943('0x4')]=undefined;this[_0xd943('0x5')]=undefined;this[_0xd943('0x6')]=0x0;this[_0xd943('0x7')]='';this[_0xd943('0x8')]=0x0;this[_0xd943('0x9')]=0x0;this[_0xd943('0xa')]=0x0;this[_0xd943('0xb')]=![];this[_0xd943('0xc')]=null;this[_0xd943('0xd')]=null;this['unmanaged']=![];this[_0xd943('0xe')]=![];this[_0xd943('0xf')]='';this[_0xd943('0x10')]='';this[_0xd943('0x11')]=0x0;this['billableseconds']=0x0;this[_0xd943('0x12')]=0x0;this[_0xd943('0x13')]=null;this[_0xd943('0x14')]=null;this[_0xd943('0x15')]=null;this[_0xd943('0x16')]=![];this[_0xd943('0x17')]=null;this['queue']=null;this['monitors']=[];this[_0xd943('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xd943('0x19')]=undefined;this[_0xd943('0x1a')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xeec6=['calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','exten','answered','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','transferType','starttime'];(function(_0x39b4c8,_0x168983){var _0x4db4e4=function(_0x4d1580){while(--_0x4d1580){_0x39b4c8['push'](_0x39b4c8['shift']());}};_0x4db4e4(++_0x168983);}(_0xeec6,0x125));var _0x6eec=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xeec6[_0x5b3950];return _0x41e436;};'use strict';function Channel(){this[_0x6eec('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x6eec('0x1')]=0x0;this[_0x6eec('0x2')]='';this[_0x6eec('0x3')]=undefined;this[_0x6eec('0x4')]=undefined;this['accountcode']=0x0;this[_0x6eec('0x5')]='';this[_0x6eec('0x6')]=0x0;this['linkedid']=0x0;this[_0x6eec('0x7')]=0x0;this[_0x6eec('0x8')]=![];this['answertime']=null;this[_0x6eec('0x9')]=null;this[_0x6eec('0xa')]=![];this[_0x6eec('0xb')]=![];this[_0x6eec('0xc')]='';this['lastdata']='';this[_0x6eec('0xd')]=0x0;this[_0x6eec('0xe')]=0x0;this[_0x6eec('0xf')]=0x0;this['type']=null;this[_0x6eec('0x10')]=null;this['disposition']=null;this[_0x6eec('0x11')]=![];this[_0x6eec('0x12')]=null;this[_0x6eec('0x13')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x6eec('0x14')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fe25d1f..c38849e 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 _0x1de5=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey'];(function(_0x3af04f,_0x452ac4){var _0x32be12=function(_0x3298f7){while(--_0x3298f7){_0x3af04f['push'](_0x3af04f['shift']());}};_0x32be12(++_0x452ac4);}(_0x1de5,0x1e7));var _0x51de=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x1de5[_0x1a9204];return _0x17ca68;};'use strict';function DeskAccount(_0x159eb3){this['id']=_0x159eb3['id']||0x0;this[_0x51de('0x0')]=_0x159eb3[_0x51de('0x0')]||'';this[_0x51de('0x1')]=_0x159eb3[_0x51de('0x1')]||'';this[_0x51de('0x2')]=_0x159eb3[_0x51de('0x2')]||'';this['authType']=_0x159eb3['authType']||'';this[_0x51de('0x3')]=_0x159eb3[_0x51de('0x3')]||'';this[_0x51de('0x4')]=_0x159eb3[_0x51de('0x4')]||'';this[_0x51de('0x5')]=_0x159eb3['consumerSecret']||'';this['token']=_0x159eb3[_0x51de('0x6')]||'';this[_0x51de('0x7')]=_0x159eb3[_0x51de('0x7')]||'';this[_0x51de('0x8')]=_0x159eb3[_0x51de('0x8')]||'';this[_0x51de('0x9')]=_0x159eb3[_0x51de('0x9')]||'';this[_0x51de('0xa')]=_0x159eb3[_0x51de('0xa')]||{};}module[_0x51de('0xb')]=DeskAccount; \ No newline at end of file +var _0x59c8=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0xccb4e7,_0x418ce4){var _0x1ab90c=function(_0x19cc83){while(--_0x19cc83){_0xccb4e7['push'](_0xccb4e7['shift']());}};_0x1ab90c(++_0x418ce4);}(_0x59c8,0x15d));var _0x859c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x59c8[_0x6131cd];return _0x47e916;};'use strict';function DeskAccount(_0x2c2896){this['id']=_0x2c2896['id']||0x0;this[_0x859c('0x0')]=_0x2c2896[_0x859c('0x0')]||'';this[_0x859c('0x1')]=_0x2c2896[_0x859c('0x1')]||'';this[_0x859c('0x2')]=_0x2c2896['remoteUri']||'';this[_0x859c('0x3')]=_0x2c2896['authType']||'';this[_0x859c('0x4')]=_0x2c2896[_0x859c('0x4')]||'';this['consumerKey']=_0x2c2896[_0x859c('0x5')]||'';this['consumerSecret']=_0x2c2896[_0x859c('0x6')]||'';this[_0x859c('0x7')]=_0x2c2896[_0x859c('0x7')]||'';this['tokenSecret']=_0x2c2896[_0x859c('0x8')]||'';this[_0x859c('0x9')]=_0x2c2896[_0x859c('0x9')]||'';this[_0x859c('0xa')]=_0x2c2896[_0x859c('0xa')]||'';this[_0x859c('0xb')]=_0x2c2896[_0x859c('0xb')]||{};}module[_0x859c('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 6834c35..f530f10 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 _0xba6c=['username','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider'];(function(_0x5dd0a0,_0x4dce83){var _0xba8824=function(_0x30df22){while(--_0x30df22){_0x5dd0a0['push'](_0x5dd0a0['shift']());}};_0xba8824(++_0x4dce83);}(_0xba6c,0x103));var _0xcba6=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xba6c[_0x3b7a0c];return _0x3bb70f;};'use strict';function Dynamics365Account(_0x43c783){this['id']=_0x43c783['id']||0x0;this['name']=_0x43c783['name']||'';this[_0xcba6('0x0')]=_0x43c783[_0xcba6('0x0')]||'';this['password']=_0x43c783[_0xcba6('0x1')]||'';this['remoteUri']=_0x43c783[_0xcba6('0x2')]||'';this[_0xcba6('0x3')]=_0x43c783['tenantId']||'';this['clientId']=_0x43c783[_0xcba6('0x4')]||'';this[_0xcba6('0x5')]=_0x43c783[_0xcba6('0x5')]||{};this['serverUrl']=_0x43c783['serverUrl']||'';this['modernAuthentication']=_0x43c783['modernAuthentication']||![];this['Configurations']=_0x43c783['Configurations']||{};this['CloudProvider']=_0x43c783[_0xcba6('0x6')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x7c7b=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','CloudProvider','exports'];(function(_0x5426e2,_0x5f2968){var _0x920dc=function(_0x3a87c6){while(--_0x3a87c6){_0x5426e2['push'](_0x5426e2['shift']());}};_0x920dc(++_0x5f2968);}(_0x7c7b,0x129));var _0xb7c7=function(_0x17cb36,_0x3cfc3e){_0x17cb36=_0x17cb36-0x0;var _0x3ae236=_0x7c7b[_0x17cb36];return _0x3ae236;};'use strict';function Dynamics365Account(_0x22b874){this['id']=_0x22b874['id']||0x0;this[_0xb7c7('0x0')]=_0x22b874[_0xb7c7('0x0')]||'';this[_0xb7c7('0x1')]=_0x22b874['username']||'';this['password']=_0x22b874[_0xb7c7('0x2')]||'';this['remoteUri']=_0x22b874[_0xb7c7('0x3')]||'';this[_0xb7c7('0x4')]=_0x22b874['tenantId']||'';this[_0xb7c7('0x5')]=_0x22b874[_0xb7c7('0x5')]||'';this[_0xb7c7('0x6')]=_0x22b874['clientSecret']||{};this[_0xb7c7('0x7')]=_0x22b874['serverUrl']||'';this['modernAuthentication']=_0x22b874['modernAuthentication']||![];this[_0xb7c7('0x8')]=_0x22b874[_0xb7c7('0x8')]||{};this['CloudProvider']=_0x22b874[_0xb7c7('0x9')]||{};}module[_0xb7c7('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9f87b0a..0260ee2 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 _0x4e6b=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x4e6b,0x107));var _0xb4e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4e6b[_0x501510];return _0x1e6ee5;};'use strict';function FaxAccount(_0x5b6b67){this['id']=_0x5b6b67['id']||0x0;this[_0xb4e6('0x0')]=_0x5b6b67[_0xb4e6('0x0')]||'';this[_0xb4e6('0x1')]=_0x5b6b67[_0xb4e6('0x1')];this[_0xb4e6('0x2')]=_0x5b6b67[_0xb4e6('0x2')];this[_0xb4e6('0x3')]=_0x5b6b67[_0xb4e6('0x3')];this[_0xb4e6('0x4')]=_0x5b6b67[_0xb4e6('0x4')];this['minrate']=_0x5b6b67[_0xb4e6('0x5')]||0x960;this[_0xb4e6('0x6')]=_0x5b6b67['maxrate']||0x3840;this[_0xb4e6('0x7')]=_0x5b6b67['modem']||_0xb4e6('0x8');this[_0xb4e6('0x9')]=_0x5b6b67[_0xb4e6('0x9')]||'no';this[_0xb4e6('0xa')]=_0x5b6b67[_0xb4e6('0xa')]||'no';this['t38timeout']=_0x5b6b67[_0xb4e6('0xb')]||0x1388;this[_0xb4e6('0xc')]=_0x5b6b67[_0xb4e6('0xc')]||_0xb4e6('0xd');this[_0xb4e6('0xe')]=_0x5b6b67['Trunk']?_0x5b6b67['Trunk']:undefined;this[_0xb4e6('0xf')]=_0x5b6b67[_0xb4e6('0xf')];this[_0xb4e6('0x10')]=_0x5b6b67[_0xb4e6('0x10')];}module[_0xb4e6('0x11')]=FaxAccount; \ No newline at end of file +var _0xfc7a=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x12082d,_0x225abd){var _0x4ed1f7=function(_0x531b71){while(--_0x531b71){_0x12082d['push'](_0x12082d['shift']());}};_0x4ed1f7(++_0x225abd);}(_0xfc7a,0x69));var _0xafc7=function(_0x42c069,_0xdfa0f9){_0x42c069=_0x42c069-0x0;var _0x4f0740=_0xfc7a[_0x42c069];return _0x4f0740;};'use strict';function FaxAccount(_0x59f680){this['id']=_0x59f680['id']||0x0;this[_0xafc7('0x0')]=_0x59f680[_0xafc7('0x0')]||'';this[_0xafc7('0x1')]=_0x59f680[_0xafc7('0x1')];this[_0xafc7('0x2')]=_0x59f680['ecm'];this[_0xafc7('0x3')]=_0x59f680[_0xafc7('0x3')];this['localstationid']=_0x59f680[_0xafc7('0x4')];this['minrate']=_0x59f680[_0xafc7('0x5')]||0x960;this[_0xafc7('0x6')]=_0x59f680[_0xafc7('0x6')]||0x3840;this[_0xafc7('0x7')]=_0x59f680[_0xafc7('0x7')]||_0xafc7('0x8');this[_0xafc7('0x9')]=_0x59f680[_0xafc7('0x9')]||'no';this[_0xafc7('0xa')]=_0x59f680[_0xafc7('0xa')]||'no';this[_0xafc7('0xb')]=_0x59f680[_0xafc7('0xb')]||0x1388;this[_0xafc7('0xc')]=_0x59f680[_0xafc7('0xc')]||_0xafc7('0xd');this[_0xafc7('0xe')]=_0x59f680[_0xafc7('0xe')]?_0x59f680[_0xafc7('0xe')]:undefined;this[_0xafc7('0xf')]=_0x59f680[_0xafc7('0xf')];this[_0xafc7('0x10')]=_0x59f680[_0xafc7('0x10')];}module[_0xafc7('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b04b221..64811af 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 _0x133d=['Configurations','exports','name','username','token','serverUrl'];(function(_0x1227e4,_0x164d5f){var _0x1681c6=function(_0x549491){while(--_0x549491){_0x1227e4['push'](_0x1227e4['shift']());}};_0x1681c6(++_0x164d5f);}(_0x133d,0x10a));var _0xd133=function(_0x45dbe3,_0xd2bf96){_0x45dbe3=_0x45dbe3-0x0;var _0x1e71cf=_0x133d[_0x45dbe3];return _0x1e71cf;};'use strict';function FreshdeskAccount(_0x5c4199){this['id']=_0x5c4199['id']||0x0;this[_0xd133('0x0')]=_0x5c4199[_0xd133('0x0')]||'';this[_0xd133('0x1')]=_0x5c4199[_0xd133('0x1')]||'';this['apiKey']=_0x5c4199[_0xd133('0x2')]||'';this['remoteUri']=_0x5c4199['remoteUri']||'';this[_0xd133('0x3')]=_0x5c4199[_0xd133('0x3')]||'';this[_0xd133('0x4')]=_0x5c4199[_0xd133('0x4')]||{};}module[_0xd133('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x9277=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x5594c4,_0x5eb267){var _0x4dc8c3=function(_0x4a4e2a){while(--_0x4a4e2a){_0x5594c4['push'](_0x5594c4['shift']());}};_0x4dc8c3(++_0x5eb267);}(_0x9277,0x128));var _0x7927=function(_0x4eb6dc,_0x3dc261){_0x4eb6dc=_0x4eb6dc-0x0;var _0x3068b4=_0x9277[_0x4eb6dc];return _0x3068b4;};'use strict';function FreshdeskAccount(_0x247512){this['id']=_0x247512['id']||0x0;this[_0x7927('0x0')]=_0x247512[_0x7927('0x0')]||'';this[_0x7927('0x1')]=_0x247512['username']||'';this['apiKey']=_0x247512[_0x7927('0x2')]||'';this[_0x7927('0x3')]=_0x247512[_0x7927('0x3')]||'';this[_0x7927('0x4')]=_0x247512[_0x7927('0x4')]||'';this[_0x7927('0x5')]=_0x247512[_0x7927('0x5')]||{};}module[_0x7927('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 51d85ed..46e985f 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 _0x85d8=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x546b43,_0x478584){var _0x2da943=function(_0x7c9df9){while(--_0x7c9df9){_0x546b43['push'](_0x546b43['shift']());}};_0x2da943(++_0x478584);}(_0x85d8,0x1b0));var _0x885d=function(_0x277a45,_0x169dc2){_0x277a45=_0x277a45-0x0;var _0x156d7b=_0x85d8[_0x277a45];return _0x156d7b;};'use strict';function FreshsalesAccount(_0x491e30){this['id']=_0x491e30['id']||0x0;this[_0x885d('0x0')]=_0x491e30[_0x885d('0x0')]||'';this[_0x885d('0x1')]=_0x491e30[_0x885d('0x1')]||'';this['apiKey']=_0x491e30[_0x885d('0x2')]||'';this[_0x885d('0x3')]=_0x491e30[_0x885d('0x3')]||'';this[_0x885d('0x4')]=_0x491e30['serverUrl']||'';this['Configurations']=_0x491e30[_0x885d('0x5')]||{};}module[_0x885d('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x07d7=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x07d7,0x85));var _0x707d=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x07d7[_0xf26d40];return _0x50b68c;};'use strict';function FreshsalesAccount(_0x3cc60f){this['id']=_0x3cc60f['id']||0x0;this[_0x707d('0x0')]=_0x3cc60f[_0x707d('0x0')]||'';this[_0x707d('0x1')]=_0x3cc60f[_0x707d('0x1')]||'';this[_0x707d('0x2')]=_0x3cc60f[_0x707d('0x3')]||'';this[_0x707d('0x4')]=_0x3cc60f[_0x707d('0x4')]||'';this[_0x707d('0x5')]=_0x3cc60f[_0x707d('0x5')]||'';this[_0x707d('0x6')]=_0x3cc60f[_0x707d('0x6')]||{};}module[_0x707d('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index f1fd4f8..7b26eb6 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 _0xd3b3=['originalposition','channel','accountcode','context','exten','lastAssignedTo','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x9441e3,_0x267aa6){var _0x1c42c2=function(_0x244891){while(--_0x244891){_0x9441e3['push'](_0x9441e3['shift']());}};_0x1c42c2(++_0x267aa6);}(_0xd3b3,0x142));var _0x3d3b=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0xd3b3[_0x10e8ed];return _0x4aea4a;};'use strict';function QueueReport(){this['type']=_0x3d3b('0x0');this[_0x3d3b('0x1')]='';this[_0x3d3b('0x2')]='';this[_0x3d3b('0x3')]='';this[_0x3d3b('0x4')]='';this[_0x3d3b('0x5')]=null;this[_0x3d3b('0x6')]=null;this[_0x3d3b('0x7')]=0x1;this[_0x3d3b('0x8')]=0x1;this[_0x3d3b('0x9')]=![];this[_0x3d3b('0xa')]=null;this['queuecallercomplete']=![];this[_0x3d3b('0xb')]=null;this[_0x3d3b('0xc')]=![];this[_0x3d3b('0xd')]=null;this[_0x3d3b('0xe')]=0x1;this[_0x3d3b('0xf')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x3d3b('0x10')]='';this[_0x3d3b('0x11')]='';this[_0x3d3b('0x12')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this[_0x3d3b('0x13')]='';this['motionChannel']='voice';this['mohtime']=0x0;this['variables']={};}module[_0x3d3b('0x14')]=QueueReport; \ No newline at end of file +var _0x4cf1=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count'];(function(_0x18e7cb,_0x252b62){var _0x37f85a=function(_0x42fe78){while(--_0x42fe78){_0x18e7cb['push'](_0x18e7cb['shift']());}};_0x37f85a(++_0x252b62);}(_0x4cf1,0xfc));var _0x14cf=function(_0x416468,_0x2e7a72){_0x416468=_0x416468-0x0;var _0x2ee9b7=_0x4cf1[_0x416468];return _0x2ee9b7;};'use strict';function QueueReport(){this[_0x14cf('0x0')]=_0x14cf('0x1');this[_0x14cf('0x2')]='';this[_0x14cf('0x3')]='';this[_0x14cf('0x4')]='';this[_0x14cf('0x5')]='';this['queuecallerjoinAt']=null;this[_0x14cf('0x6')]=null;this[_0x14cf('0x7')]=0x1;this[_0x14cf('0x8')]=0x1;this[_0x14cf('0x9')]=![];this[_0x14cf('0xa')]=null;this[_0x14cf('0xb')]=![];this[_0x14cf('0xc')]=null;this[_0x14cf('0xd')]=![];this[_0x14cf('0xe')]=null;this[_0x14cf('0xf')]=0x1;this[_0x14cf('0x10')]='';this['connectedlinenum']='';this[_0x14cf('0x11')]='';this[_0x14cf('0x12')]='';this[_0x14cf('0x13')]='';this[_0x14cf('0x14')]='';this[_0x14cf('0x15')]='';this['holdtime']=0x0;this[_0x14cf('0x16')]=![];this[_0x14cf('0x17')]='';this[_0x14cf('0x18')]=_0x14cf('0x19');this[_0x14cf('0x1a')]=0x0;this[_0x14cf('0x1b')]={};}module[_0x14cf('0x1c')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index fcf5326..003175d 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 _0xc1d3=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc1d3,0x147));var _0x3c1d=function(_0x4b9499,_0x249c2e){_0x4b9499=_0x4b9499-0x0;var _0x4b5e4a=_0xc1d3[_0x4b9499];return _0x4b5e4a;};'use strict';function SalesforceAccount(_0x3f44c2){this['id']=_0x3f44c2['id']||0x0;this[_0x3c1d('0x0')]=_0x3f44c2[_0x3c1d('0x0')]||'';this[_0x3c1d('0x1')]=_0x3f44c2[_0x3c1d('0x1')]||'';this[_0x3c1d('0x2')]=_0x3f44c2[_0x3c1d('0x2')]||'';this['password']=_0x3f44c2['password']||'';this[_0x3c1d('0x3')]=_0x3f44c2[_0x3c1d('0x3')]||'';this[_0x3c1d('0x4')]=_0x3f44c2['clientSecret']||'';this[_0x3c1d('0x5')]=_0x3f44c2[_0x3c1d('0x5')]||'';this[_0x3c1d('0x6')]=_0x3f44c2[_0x3c1d('0x6')]||_0x3c1d('0x7');this['serverUrl']=_0x3f44c2[_0x3c1d('0x8')]||'';this[_0x3c1d('0x9')]=_0x3f44c2[_0x3c1d('0x9')]||{};}module[_0x3c1d('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x78f4=['securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x425f05,_0x3db28c){var _0x341eed=function(_0x2f2675){while(--_0x2f2675){_0x425f05['push'](_0x425f05['shift']());}};_0x341eed(++_0x3db28c);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x3c8f0c){this['id']=_0x3c8f0c['id']||0x0;this[_0x478f('0x0')]=_0x3c8f0c[_0x478f('0x0')]||'';this[_0x478f('0x1')]=_0x3c8f0c[_0x478f('0x1')]||'';this['remoteUri']=_0x3c8f0c[_0x478f('0x2')]||'';this['password']=_0x3c8f0c[_0x478f('0x3')]||'';this[_0x478f('0x4')]=_0x3c8f0c[_0x478f('0x4')]||'';this['clientSecret']=_0x3c8f0c[_0x478f('0x5')]||'';this[_0x478f('0x6')]=_0x3c8f0c['securityToken']||'';this[_0x478f('0x7')]=_0x3c8f0c['type']||'integrationTab';this[_0x478f('0x8')]=_0x3c8f0c['serverUrl']||'';this[_0x478f('0x9')]=_0x3c8f0c[_0x478f('0x9')]||{};}module[_0x478f('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 54edd47..75bb795 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 _0xa6df=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x535574,_0x1eafc0){var _0x143bb3=function(_0x27ad1a){while(--_0x27ad1a){_0x535574['push'](_0x535574['shift']());}};_0x143bb3(++_0x1eafc0);}(_0xa6df,0x163));var _0xfa6d=function(_0x46796a,_0xcf9516){_0x46796a=_0x46796a-0x0;var _0x3e6782=_0xa6df[_0x46796a];return _0x3e6782;};'use strict';function ServicenowAccount(_0x292fbb){this['id']=_0x292fbb['id']||0x0;this[_0xfa6d('0x0')]=_0x292fbb[_0xfa6d('0x0')]||'';this[_0xfa6d('0x1')]=_0x292fbb[_0xfa6d('0x1')]||'';this[_0xfa6d('0x2')]=_0x292fbb[_0xfa6d('0x2')]||'';this['remoteUri']=_0x292fbb[_0xfa6d('0x3')]||'';this[_0xfa6d('0x4')]=_0x292fbb[_0xfa6d('0x4')]||'';this[_0xfa6d('0x5')]=_0x292fbb[_0xfa6d('0x5')]||{};}module[_0xfa6d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x4632=['exports','name','password','remoteUri','serverUrl','Configurations'];(function(_0x31a2ee,_0x460c1b){var _0x20fb0a=function(_0x136725){while(--_0x136725){_0x31a2ee['push'](_0x31a2ee['shift']());}};_0x20fb0a(++_0x460c1b);}(_0x4632,0x109));var _0x2463=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4632[_0xefd519];return _0x4bb882;};'use strict';function ServicenowAccount(_0x3e8031){this['id']=_0x3e8031['id']||0x0;this[_0x2463('0x0')]=_0x3e8031['name']||'';this['username']=_0x3e8031['username']||'';this[_0x2463('0x1')]=_0x3e8031[_0x2463('0x1')]||'';this[_0x2463('0x2')]=_0x3e8031[_0x2463('0x2')]||'';this[_0x2463('0x3')]=_0x3e8031[_0x2463('0x3')]||'';this[_0x2463('0x4')]=_0x3e8031[_0x2463('0x4')]||{};}module[_0x2463('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 15c003a..3686254 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 _0x0b09=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x5484f4,_0x4f2c3a){var _0x7f7dc9=function(_0x491bcd){while(--_0x491bcd){_0x5484f4['push'](_0x5484f4['shift']());}};_0x7f7dc9(++_0x4f2c3a);}(_0x0b09,0x13c));var _0x90b0=function(_0x3f9910,_0x556e77){_0x3f9910=_0x3f9910-0x0;var _0xfe1ea6=_0x0b09[_0x3f9910];return _0xfe1ea6;};'use strict';function SugarcrmAccount(_0x4d3503){this['id']=_0x4d3503['id']||0x0;this[_0x90b0('0x0')]=_0x4d3503['name']||'';this['username']=_0x4d3503[_0x90b0('0x1')]||'';this[_0x90b0('0x2')]=_0x4d3503[_0x90b0('0x2')]||'';this['remoteUri']=_0x4d3503[_0x90b0('0x3')]||'';this[_0x90b0('0x4')]=_0x4d3503['serverUrl']||'';this['Configurations']=_0x4d3503[_0x90b0('0x5')]||{};}module[_0x90b0('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xc379=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x435a92,_0x42f239){var _0x554d02=function(_0x4b7670){while(--_0x4b7670){_0x435a92['push'](_0x435a92['shift']());}};_0x554d02(++_0x42f239);}(_0xc379,0xb2));var _0x9c37=function(_0x5f0669,_0x5c60e6){_0x5f0669=_0x5f0669-0x0;var _0x4c0105=_0xc379[_0x5f0669];return _0x4c0105;};'use strict';function SugarcrmAccount(_0x487a1e){this['id']=_0x487a1e['id']||0x0;this['name']=_0x487a1e[_0x9c37('0x0')]||'';this[_0x9c37('0x1')]=_0x487a1e[_0x9c37('0x1')]||'';this[_0x9c37('0x2')]=_0x487a1e[_0x9c37('0x2')]||'';this[_0x9c37('0x3')]=_0x487a1e['remoteUri']||'';this[_0x9c37('0x4')]=_0x487a1e[_0x9c37('0x4')]||'';this['Configurations']=_0x487a1e[_0x9c37('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 20f16d8..4f98f38 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 _0x754b=['name','accountcode','unknown','status','exports'];(function(_0x2fd7d5,_0x3ac631){var _0x54bb19=function(_0x5663d0){while(--_0x5663d0){_0x2fd7d5['push'](_0x2fd7d5['shift']());}};_0x54bb19(++_0x3ac631);}(_0x754b,0x1ef));var _0xb754=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x754b[_0x199572];return _0x13cfa3;};'use strict';function Telephone(_0x1f83cb){this['id']=_0x1f83cb['id']||0x0;this[_0xb754('0x0')]=_0x1f83cb[_0xb754('0x0')]||'';this[_0xb754('0x1')]=_0x1f83cb[_0xb754('0x1')]||'';this['state']=_0xb754('0x2');this['stateTime']=0x0;this[_0xb754('0x3')]=_0xb754('0x2');this['address']='';}module[_0xb754('0x4')]=Telephone; \ No newline at end of file +var _0x5c5a=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x5c5a,0x198));var _0xa5c5=function(_0x21c850,_0x237cd6){_0x21c850=_0x21c850-0x0;var _0x68eb4c=_0x5c5a[_0x21c850];return _0x68eb4c;};'use strict';function Telephone(_0x4405bd){this['id']=_0x4405bd['id']||0x0;this[_0xa5c5('0x0')]=_0x4405bd[_0xa5c5('0x0')]||'';this[_0xa5c5('0x1')]=_0x4405bd['accountcode']||'';this[_0xa5c5('0x2')]=_0xa5c5('0x3');this[_0xa5c5('0x4')]=0x0;this[_0xa5c5('0x5')]='unknown';this[_0xa5c5('0x6')]='';}module[_0xa5c5('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 564d749..f4937ea 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(_0x1687b6,_0x4205d0){var _0x5785f2=function(_0x3f63ae){while(--_0x3f63ae){_0x1687b6['push'](_0x1687b6['shift']());}};_0x5785f2(++_0x4205d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x502f10,_0x38292e){var _0x3bf6c0=function(_0x484dd1){while(--_0x484dd1){_0x502f10['push'](_0x502f10['shift']());}};_0x3bf6c0(++_0x38292e);}(_0xb10b,0x12a));var _0xbb10=function(_0x39fba9,_0x245311){_0x39fba9=_0x39fba9-0x0;var _0x3078c5=_0xb10b[_0x39fba9];return _0x3078c5;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 2433719..77927b3 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 _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x14a8d5,_0x17b15c){var _0x3a7c52=function(_0x2c1ec7){while(--_0x2c1ec7){_0x14a8d5['push'](_0x14a8d5['shift']());}};_0x3a7c52(++_0x17b15c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x19a274,_0x3cb79f){_0x19a274=_0x19a274-0x0;var _0x35623f=_0x5f2f[_0x19a274];return _0x35623f;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x11b054,_0x484f99){var _0x3ef5d4=function(_0x38ee15){while(--_0x38ee15){_0x11b054['push'](_0x11b054['shift']());}};_0x3ef5d4(++_0x484f99);}(_0x757a,0xde));var _0xa757=function(_0x1ea691,_0x5e5a6d){_0x1ea691=_0x1ea691-0x0;var _0x5844e3=_0x757a[_0x1ea691];return _0x5844e3;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index aba0835..e834bb7 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 _0x2d90=['status','registry','indexOf','split','host','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown'];(function(_0x424c02,_0x4a2d88){var _0x10c063=function(_0x1c2609){while(--_0x1c2609){_0x424c02['push'](_0x424c02['shift']());}};_0x10c063(++_0x4a2d88);}(_0x2d90,0x1ec));var _0x02d9=function(_0x2a270f,_0x349bb4){_0x2a270f=_0x2a270f-0x0;var _0x13c4a4=_0x2d90[_0x2a270f];return _0x13c4a4;};'use strict';function Trunk(_0x5e895d){this['id']=_0x5e895d['id']||0x0;this[_0x02d9('0x0')]=_0x5e895d[_0x02d9('0x0')]||![];this[_0x02d9('0x1')]=_0x5e895d[_0x02d9('0x1')]||'';this[_0x02d9('0x2')]=_0x02d9('0x3');this['stateTime']=0x0;this[_0x02d9('0x4')]=_0x02d9('0x3');this[_0x02d9('0x5')]=_0x5e895d[_0x02d9('0x5')]&&_0x5e895d[_0x02d9('0x5')][_0x02d9('0x6')](':')?_0x5e895d[_0x02d9('0x5')][_0x02d9('0x7')](':')[0x0]:'';this[_0x02d9('0x8')]='';this['port']='';this[_0x02d9('0x9')]='';this['domainport']='';this[_0x02d9('0xa')]='';this[_0x02d9('0xb')]='unknown';this[_0x02d9('0xc')]='';this[_0x02d9('0xd')]='';this[_0x02d9('0xe')]=_0x5e895d[_0x02d9('0xe')]||'';}module[_0x02d9('0xf')]=Trunk; \ No newline at end of file +var _0x7a18=['defaultuser','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split','domainport','stateRegistry','registrationtime'];(function(_0x3f72f8,_0x249b2d){var _0xf039a2=function(_0x525d9c){while(--_0x525d9c){_0x3f72f8['push'](_0x3f72f8['shift']());}};_0xf039a2(++_0x249b2d);}(_0x7a18,0x1a6));var _0x87a1=function(_0x11f0e3,_0x5170bc){_0x11f0e3=_0x11f0e3-0x0;var _0x2892e8=_0x7a18[_0x11f0e3];return _0x2892e8;};'use strict';function Trunk(_0x55a832){this['id']=_0x55a832['id']||0x0;this[_0x87a1('0x0')]=_0x55a832[_0x87a1('0x0')]||![];this[_0x87a1('0x1')]=_0x55a832[_0x87a1('0x1')]||'';this[_0x87a1('0x2')]='unknown';this[_0x87a1('0x3')]=0x0;this[_0x87a1('0x4')]=_0x87a1('0x5');this['registry']=_0x55a832['registry']&&_0x55a832[_0x87a1('0x6')][_0x87a1('0x7')](':')?_0x55a832[_0x87a1('0x6')][_0x87a1('0x8')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0x87a1('0x9')]='';this['refresh']='';this[_0x87a1('0xa')]=_0x87a1('0x5');this[_0x87a1('0xb')]='';this['address']='';this[_0x87a1('0xc')]=_0x55a832['defaultuser']||'';}module[_0x87a1('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 99616fb..994abcf 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 _0x04a6=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x04a6,0x143));var _0x604a=function(_0x4359d7,_0x3682ed){_0x4359d7=_0x4359d7-0x0;var _0x98ff86=_0x04a6[_0x4359d7];return _0x98ff86;};'use strict';function voiceExtension(_0x3aded7){this['id']=_0x3aded7['id']||0x0;this['exten']=_0x3aded7[_0x604a('0x0')]||'';this[_0x604a('0x1')]=_0x3aded7[_0x604a('0x1')]||_0x604a('0x2');this[_0x604a('0x3')]=_0x3aded7[_0x604a('0x3')]||![];}module[_0x604a('0x4')]=voiceExtension; \ No newline at end of file +var _0xbae7=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x472272,_0xec05d5){var _0x505f77=function(_0x576d5d){while(--_0x576d5d){_0x472272['push'](_0x472272['shift']());}};_0x505f77(++_0xec05d5);}(_0xbae7,0x82));var _0x7bae=function(_0xc898bb,_0x51b13a){_0xc898bb=_0xc898bb-0x0;var _0x2b8ca6=_0xbae7[_0xc898bb];return _0x2b8ca6;};'use strict';function voiceExtension(_0x386a2e){this['id']=_0x386a2e['id']||0x0;this[_0x7bae('0x0')]=_0x386a2e[_0x7bae('0x0')]||'';this[_0x7bae('0x1')]=_0x386a2e[_0x7bae('0x1')]||_0x7bae('0x2');this['mandatoryDisposition']=_0x386a2e[_0x7bae('0x3')]||![];}module[_0x7bae('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 07b791b..59adce0 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 _0x7ed0=['strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','unavailable','ringinuse','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','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','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x37bb28,_0x2231de){var _0x499a88=function(_0x34e153){while(--_0x34e153){_0x37bb28['push'](_0x37bb28['shift']());}};_0x499a88(++_0x2231de);}(_0x7ed0,0x1a7));var _0x07ed=function(_0x5ac053,_0x5cd38d){_0x5ac053=_0x5ac053-0x0;var _0x5e5bb3=_0x7ed0[_0x5ac053];return _0x5e5bb3;};'use strict';var statusDesc=['unknown',_0x07ed('0x0'),'inuse',_0x07ed('0x1'),_0x07ed('0x2'),_0x07ed('0x3'),'ringing',_0x07ed('0x4'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0x07ed('0x5'),'gsm':_0x07ed('0x6')};var strategy={'rrmemory':_0x07ed('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x32d31d){this['id']=_0x32d31d['id']||0x0;this[_0x07ed('0x8')]=_0x32d31d[_0x07ed('0x8')]||'';this[_0x07ed('0x9')]=_0x32d31d[_0x07ed('0x9')]||'';this[_0x07ed('0xa')]=_0x32d31d['type']||_0x07ed('0xb');this[_0x07ed('0xc')]=0x0;this[_0x07ed('0xd')]=0x0;this[_0x07ed('0xe')]=0x0;this[_0x07ed('0xf')]=0x0;this[_0x07ed('0x10')]=0x0;this[_0x07ed('0x11')]=0x0;this['sumBillable']=0x0;this[_0x07ed('0x12')]=0x0;this[_0x07ed('0x13')]=0x0;this[_0x07ed('0x14')]=0x0;this[_0x07ed('0x15')]=0x0;this[_0x07ed('0x16')]=_0x32d31d[_0x07ed('0x16')]||![];this['acwTimeout']=_0x32d31d['acwTimeout']||0xa;this[_0x07ed('0x17')]=_0x32d31d[_0x07ed('0x17')]||'no';this[_0x07ed('0x18')]=!![];this[_0x07ed('0x19')]='';this[_0x07ed('0x1a')]=0x0;this['temp']=0x0;this[_0x07ed('0x1b')]=_0x32d31d[_0x07ed('0x1b')]||null;this[_0x07ed('0x1c')]=_0x32d31d[_0x07ed('0x1c')]?_0x32d31d[_0x07ed('0x1c')]:null;this['dialActive']=_0x32d31d[_0x07ed('0x1d')];this['dialMethod']=_0x32d31d[_0x07ed('0x1e')]||_0x07ed('0x1f');this[_0x07ed('0x20')]=_0x32d31d['dialLimitChannel']||0x0;this[_0x07ed('0x21')]=_0x32d31d[_0x07ed('0x21')]||0x0;this['dialPowerLevel']=_0x32d31d[_0x07ed('0x22')]||0x1;this[_0x07ed('0x23')]=_0x32d31d[_0x07ed('0x23')]||_0x07ed('0x24');this['dialPredictiveOptimizationPercentage']=_0x32d31d[_0x07ed('0x25')]||0.03;this[_0x07ed('0x26')]=_0x32d31d[_0x07ed('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x32d31d[_0x07ed('0x27')]||_0x07ed('0x28');this[_0x07ed('0x29')]=_0x32d31d[_0x07ed('0x29')]||_0x07ed('0x28');this[_0x07ed('0x2a')]=_0x32d31d[_0x07ed('0x2a')]||0x1e;this[_0x07ed('0x2b')]=_0x32d31d[_0x07ed('0x2b')]||_0x07ed('0x2c');this[_0x07ed('0x2d')]=_0x32d31d['dialQueueTimeout']||0x3;this[_0x07ed('0x2e')]=_0x32d31d[_0x07ed('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x32d31d[_0x07ed('0x2f')]||0x3;this[_0x07ed('0x30')]=_0x32d31d[_0x07ed('0x30')]||0x96;this[_0x07ed('0x31')]=_0x32d31d[_0x07ed('0x31')]||0x3;this[_0x07ed('0x32')]=_0x32d31d[_0x07ed('0x32')]||0x96;this[_0x07ed('0x33')]=_0x32d31d[_0x07ed('0x33')]||0x3;this[_0x07ed('0x34')]=_0x32d31d['dialNoAnswerRetryFrequency']||0x96;this[_0x07ed('0x35')]=_0x32d31d['dialNoSuchNumberMaxRetry']||0x3;this[_0x07ed('0x36')]=_0x32d31d[_0x07ed('0x36')]||0x96;this[_0x07ed('0x37')]=_0x32d31d[_0x07ed('0x37')]||0x3;this['dialDropRetryFrequency']=_0x32d31d[_0x07ed('0x38')]||0x96;this[_0x07ed('0x39')]=_0x32d31d[_0x07ed('0x39')]||0x3;this[_0x07ed('0x3a')]=_0x32d31d['dialAbandonedRetryFrequency']||0x96;this[_0x07ed('0x3b')]=_0x32d31d[_0x07ed('0x3b')]||0x3;this[_0x07ed('0x3c')]=_0x32d31d[_0x07ed('0x3c')]||0x96;this[_0x07ed('0x3d')]=_0x32d31d[_0x07ed('0x3d')]||0x3;this[_0x07ed('0x3e')]=_0x32d31d[_0x07ed('0x3e')]||0x96;this[_0x07ed('0x3f')]=_0x32d31d[_0x07ed('0x3f')]||0x3;this[_0x07ed('0x40')]=_0x32d31d[_0x07ed('0x40')]||0x4;this[_0x07ed('0x41')]=_0x32d31d[_0x07ed('0x41')]?_0x32d31d[_0x07ed('0x41')]:undefined;this['TrunkBackup']=_0x32d31d[_0x07ed('0x42')]?_0x32d31d[_0x07ed('0x42')]:undefined;this[_0x07ed('0x43')]=_0x32d31d[_0x07ed('0x43')]||undefined;this[_0x07ed('0x44')]=_0x32d31d[_0x07ed('0x44')]?_0x32d31d[_0x07ed('0x44')]:undefined;this[_0x07ed('0x45')]=_0x32d31d[_0x07ed('0x45')]||_0x07ed('0x46');this[_0x07ed('0x47')]=_0x32d31d[_0x07ed('0x47')]||undefined;this[_0x07ed('0x48')]=_0x32d31d[_0x07ed('0x48')]||undefined;this[_0x07ed('0x49')]=strategy[_0x32d31d[_0x07ed('0x49')]]||_0x07ed('0x7');this[_0x07ed('0x4a')]=!![];this['dialAMDActive']=_0x32d31d['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x32d31d[_0x07ed('0x4b')];this['dialAMDGreeting']=_0x32d31d[_0x07ed('0x4c')];this[_0x07ed('0x4d')]=_0x32d31d[_0x07ed('0x4d')];this[_0x07ed('0x4e')]=_0x32d31d[_0x07ed('0x4e')];this['dialAMDMinWordLength']=_0x32d31d[_0x07ed('0x4f')];this[_0x07ed('0x50')]=_0x32d31d[_0x07ed('0x50')];this[_0x07ed('0x51')]=_0x32d31d['dialAMDMaximumNumberOfWords'];this[_0x07ed('0x52')]=_0x32d31d['dialAMDSilenceThreshold'];this[_0x07ed('0x53')]=_0x32d31d[_0x07ed('0x53')];this[_0x07ed('0x54')]=0x0;this['pTalking']=0x0;this[_0x07ed('0x55')]=_0x32d31d['timeout'];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x07ed('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x07ed('0x57')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x07ed('0x58')]=0x0;this[_0x07ed('0x59')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x07ed('0x5a')]=0x0;this[_0x07ed('0x5b')]=0x0;this[_0x07ed('0x5c')]=0x0;this[_0x07ed('0x5d')]=0x0;this[_0x07ed('0x5e')]=0x0;this[_0x07ed('0x5f')]=undefined;this[_0x07ed('0x60')]=undefined;this[_0x07ed('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x07ed('0x62')]=0x0;this[_0x07ed('0x63')]=0x0;this[_0x07ed('0x64')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x07ed('0x65')]=0x0;this[_0x07ed('0x66')]=0x0;this[_0x07ed('0x67')]=0x0;this[_0x07ed('0x68')]=0x0;this[_0x07ed('0x69')]=_0x32d31d[_0x07ed('0x6a')]||0x14;this[_0x07ed('0x6b')]=_0x32d31d[_0x07ed('0x6a')]||0xa;this[_0x07ed('0x6c')]=0x0;this[_0x07ed('0x6d')]=0x0;this[_0x07ed('0x6e')]=0x1;this[_0x07ed('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x07ed('0x70')]=0x0;this[_0x07ed('0x71')]=0x0;this[_0x07ed('0x72')]=_0x32d31d[_0x07ed('0x72')]||0x1e;this[_0x07ed('0x73')]=_0x32d31d[_0x07ed('0x73')]||![];this[_0x07ed('0x74')]=!!_0x32d31d[_0x07ed('0x74')]||![];this[_0x07ed('0x75')]=!!_0x32d31d[_0x07ed('0x75')]||![];this[_0x07ed('0x76')]=_0x32d31d[_0x07ed('0x76')]||undefined;this['dialAgiAfterHangupClient']=_0x32d31d[_0x07ed('0x77')]||![];this['dialAgiAfterHangupAgent']=_0x32d31d[_0x07ed('0x78')]||![];this[_0x07ed('0x9')]=monitorFormat[_0x32d31d['monitor_format']]?monitorFormat[_0x32d31d[_0x07ed('0x9')]]:undefined;this[_0x07ed('0x79')]=_0x32d31d[_0x07ed('0x79')]||![];this[_0x07ed('0x7a')]=_0x32d31d[_0x07ed('0x7a')]?_0x32d31d[_0x07ed('0x7a')]:undefined;}module[_0x07ed('0x7b')]=VoiceQueue; \ No newline at end of file +var _0xf061=['mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition'];(function(_0x4ce09c,_0x20fe9d){var _0x10ae35=function(_0x2189a7){while(--_0x2189a7){_0x4ce09c['push'](_0x4ce09c['shift']());}};_0x10ae35(++_0x20fe9d);}(_0xf061,0x7f));var _0x1f06=function(_0x4fa259,_0x40db44){_0x4fa259=_0x4fa259-0x0;var _0x7fcfbe=_0xf061[_0x4fa259];return _0x7fcfbe;};'use strict';var statusDesc=[_0x1f06('0x0'),_0x1f06('0x1'),_0x1f06('0x2'),_0x1f06('0x3'),_0x1f06('0x4'),_0x1f06('0x5'),'ringing',_0x1f06('0x6'),_0x1f06('0x7')];var monitorFormat={'wav':_0x1f06('0x8'),'wav49':_0x1f06('0x9'),'gsm':_0x1f06('0xa')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x1f06('0xb')};function VoiceQueue(_0x51d516){this['id']=_0x51d516['id']||0x0;this[_0x1f06('0xc')]=_0x51d516[_0x1f06('0xc')]||'';this['monitor_format']=_0x51d516[_0x1f06('0xd')]||'';this[_0x1f06('0xe')]=_0x51d516[_0x1f06('0xe')]||_0x1f06('0xf');this[_0x1f06('0x10')]=0x0;this[_0x1f06('0x11')]=0x0;this[_0x1f06('0x12')]=0x0;this[_0x1f06('0x13')]=0x0;this['sumDuration']=0x0;this[_0x1f06('0x14')]=0x0;this[_0x1f06('0x15')]=0x0;this[_0x1f06('0x16')]=0x0;this[_0x1f06('0x17')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0x51d516[_0x1f06('0x18')]||![];this[_0x1f06('0x19')]=_0x51d516[_0x1f06('0x19')]||0xa;this[_0x1f06('0x1a')]=_0x51d516[_0x1f06('0x1a')]||'no';this[_0x1f06('0x1b')]=!![];this[_0x1f06('0x1c')]='';this[_0x1f06('0x1d')]=0x0;this['temp']=0x0;this[_0x1f06('0x1e')]=_0x51d516['dialTimezone']||null;this[_0x1f06('0x1f')]=_0x51d516[_0x1f06('0x1f')]?_0x51d516[_0x1f06('0x1f')]:null;this[_0x1f06('0x20')]=_0x51d516['dialActive'];this['dialMethod']=_0x51d516['dialMethod']||_0x1f06('0x21');this[_0x1f06('0x22')]=_0x51d516[_0x1f06('0x22')]||0x0;this[_0x1f06('0x23')]=_0x51d516['dialLimitQueue']||0x0;this[_0x1f06('0x24')]=_0x51d516[_0x1f06('0x24')]||0x1;this[_0x1f06('0x25')]=_0x51d516[_0x1f06('0x25')]||_0x1f06('0x26');this[_0x1f06('0x27')]=_0x51d516[_0x1f06('0x27')]||0.03;this['dialPredictiveInterval']=_0x51d516[_0x1f06('0x28')]||0x258;this['dialOriginateCallerIdName']=_0x51d516['dialOriginateCallerIdName']||'anonymous';this[_0x1f06('0x29')]=_0x51d516[_0x1f06('0x29')]||_0x1f06('0x2a');this[_0x1f06('0x2b')]=_0x51d516[_0x1f06('0x2b')]||0x1e;this[_0x1f06('0x2c')]=_0x51d516[_0x1f06('0x2c')]||_0x1f06('0x2d');this[_0x1f06('0x2e')]=_0x51d516[_0x1f06('0x2e')]||0x3;this[_0x1f06('0x2f')]=_0x51d516[_0x1f06('0x2f')]||undefined;this[_0x1f06('0x30')]=_0x51d516[_0x1f06('0x30')]||0x3;this[_0x1f06('0x31')]=_0x51d516[_0x1f06('0x31')]||0x96;this[_0x1f06('0x32')]=_0x51d516[_0x1f06('0x32')]||0x3;this[_0x1f06('0x33')]=_0x51d516['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x51d516[_0x1f06('0x34')]||0x3;this[_0x1f06('0x35')]=_0x51d516[_0x1f06('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x51d516['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x51d516[_0x1f06('0x36')]||0x96;this[_0x1f06('0x37')]=_0x51d516[_0x1f06('0x37')]||0x3;this[_0x1f06('0x38')]=_0x51d516['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x51d516['dialAbandonedMaxRetry']||0x3;this[_0x1f06('0x39')]=_0x51d516['dialAbandonedRetryFrequency']||0x96;this[_0x1f06('0x3a')]=_0x51d516['dialMachineMaxRetry']||0x3;this[_0x1f06('0x3b')]=_0x51d516[_0x1f06('0x3b')]||0x96;this[_0x1f06('0x3c')]=_0x51d516[_0x1f06('0x3c')]||0x3;this[_0x1f06('0x3d')]=_0x51d516[_0x1f06('0x3d')]||0x96;this[_0x1f06('0x3e')]=_0x51d516[_0x1f06('0x3e')]||0x3;this['dialGlobalMaxRetry']=_0x51d516[_0x1f06('0x3f')]||0x4;this[_0x1f06('0x40')]=_0x51d516[_0x1f06('0x40')]?_0x51d516[_0x1f06('0x40')]:undefined;this[_0x1f06('0x41')]=_0x51d516[_0x1f06('0x41')]?_0x51d516['TrunkBackup']:undefined;this[_0x1f06('0x42')]=_0x51d516[_0x1f06('0x42')]||undefined;this['Interval']=_0x51d516[_0x1f06('0x43')]?_0x51d516[_0x1f06('0x43')]:undefined;this[_0x1f06('0x44')]=_0x51d516[_0x1f06('0x44')]||_0x1f06('0x45');this[_0x1f06('0x46')]=_0x51d516[_0x1f06('0x46')]||undefined;this[_0x1f06('0x47')]=_0x51d516[_0x1f06('0x47')]||undefined;this['strategy']=strategy[_0x51d516['strategy']]||_0x1f06('0x48');this[_0x1f06('0x49')]=!![];this[_0x1f06('0x4a')]=_0x51d516[_0x1f06('0x4a')]||![];this[_0x1f06('0x4b')]=_0x51d516[_0x1f06('0x4b')];this[_0x1f06('0x4c')]=_0x51d516['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x51d516[_0x1f06('0x4d')];this[_0x1f06('0x4e')]=_0x51d516[_0x1f06('0x4e')];this[_0x1f06('0x4f')]=_0x51d516['dialAMDMinWordLength'];this[_0x1f06('0x50')]=_0x51d516[_0x1f06('0x50')];this[_0x1f06('0x51')]=_0x51d516[_0x1f06('0x51')];this[_0x1f06('0x52')]=_0x51d516[_0x1f06('0x52')];this[_0x1f06('0x53')]=_0x51d516[_0x1f06('0x53')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0x1f06('0x54')]=_0x51d516[_0x1f06('0x54')];this[_0x1f06('0x55')]=0x0;this[_0x1f06('0x56')]=0x0;this[_0x1f06('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x1f06('0x58')]=0x0;this[_0x1f06('0x59')]=0x0;this[_0x1f06('0x5a')]=0x0;this[_0x1f06('0x5b')]=0x0;this[_0x1f06('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x1f06('0x5d')]=0x0;this[_0x1f06('0x5e')]=0x0;this[_0x1f06('0x5f')]=0x0;this[_0x1f06('0x60')]=0x0;this[_0x1f06('0x61')]=undefined;this[_0x1f06('0x62')]=undefined;this[_0x1f06('0x63')]=undefined;this[_0x1f06('0x64')]=1.05;this[_0x1f06('0x65')]=0x0;this[_0x1f06('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x1f06('0x67')]=0x0;this[_0x1f06('0x68')]=0x0;this[_0x1f06('0x69')]=0x0;this[_0x1f06('0x6a')]=0x0;this[_0x1f06('0x6b')]=0x0;this[_0x1f06('0x6c')]=_0x51d516[_0x1f06('0x6d')]||0x14;this['predictiveIntervalMinThreshold']=_0x51d516[_0x1f06('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x1f06('0x6e')]=0x0;this[_0x1f06('0x6f')]=0x1;this[_0x1f06('0x70')]=0x0;this[_0x1f06('0x71')]=0x0;this[_0x1f06('0x72')]=0x0;this[_0x1f06('0x73')]=0x0;this[_0x1f06('0x74')]=_0x51d516[_0x1f06('0x74')]||0x1e;this[_0x1f06('0x75')]=_0x51d516[_0x1f06('0x75')]||![];this[_0x1f06('0x76')]=!!_0x51d516[_0x1f06('0x76')]||![];this[_0x1f06('0x77')]=!!_0x51d516[_0x1f06('0x77')]||![];this[_0x1f06('0x78')]=_0x51d516[_0x1f06('0x78')]||undefined;this[_0x1f06('0x79')]=_0x51d516[_0x1f06('0x79')]||![];this['dialAgiAfterHangupAgent']=_0x51d516['dialAgiAfterHangupAgent']||![];this[_0x1f06('0xd')]=monitorFormat[_0x51d516['monitor_format']]?monitorFormat[_0x51d516[_0x1f06('0xd')]]:undefined;this['mandatoryDisposition']=_0x51d516[_0x1f06('0x7a')]||![];this[_0x1f06('0x7b')]=_0x51d516[_0x1f06('0x7b')]?_0x51d516['mandatoryDispositionPause']:undefined;}module[_0x1f06('0x7c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6eb307f..b2fae8e 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 _0x831e=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3de01a,_0xcc1fd4){var _0x43f31e=function(_0xf8e692){while(--_0xf8e692){_0x3de01a['push'](_0x3de01a['shift']());}};_0x43f31e(++_0xcc1fd4);}(_0x831e,0x147));var _0xe831=function(_0x5a3e74,_0x576d81){_0x5a3e74=_0x5a3e74-0x0;var _0x7181c6=_0x831e[_0x5a3e74];return _0x7181c6;};'use strict';function VtigerAccount(_0x5abc1c){this['id']=_0x5abc1c['id']||0x0;this[_0xe831('0x0')]=_0x5abc1c[_0xe831('0x0')]||'';this[_0xe831('0x1')]=_0x5abc1c[_0xe831('0x1')]||'';this[_0xe831('0x2')]=_0x5abc1c[_0xe831('0x2')]||'';this[_0xe831('0x3')]=_0x5abc1c[_0xe831('0x3')]||'';this[_0xe831('0x4')]=_0x5abc1c['serverUrl']||'';this['Configurations']=_0x5abc1c[_0xe831('0x5')]||{};}module[_0xe831('0x6')]=VtigerAccount; \ No newline at end of file +var _0xecc6=['remoteUri','serverUrl','Configurations','name','username'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xecc6,0x148));var _0x6ecc=function(_0x12513,_0x4e93cd){_0x12513=_0x12513-0x0;var _0x336a92=_0xecc6[_0x12513];return _0x336a92;};'use strict';function VtigerAccount(_0x4b0eb4){this['id']=_0x4b0eb4['id']||0x0;this[_0x6ecc('0x0')]=_0x4b0eb4[_0x6ecc('0x0')]||'';this[_0x6ecc('0x1')]=_0x4b0eb4[_0x6ecc('0x1')]||'';this['accessKey']=_0x4b0eb4['accessKey']||'';this[_0x6ecc('0x2')]=_0x4b0eb4[_0x6ecc('0x2')]||'';this[_0x6ecc('0x3')]=_0x4b0eb4[_0x6ecc('0x3')]||'';this[_0x6ecc('0x4')]=_0x4b0eb4[_0x6ecc('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 9126c0b..d0ab18c 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 _0x5ab7=['exports','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x5ab7,0x123));var _0x75ab=function(_0x98257a,_0x657ce0){_0x98257a=_0x98257a-0x0;var _0x34b831=_0x5ab7[_0x98257a];return _0x34b831;};'use strict';function ZendeskAccount(_0x503ab4){this['id']=_0x503ab4['id']||0x0;this['name']=_0x503ab4['name']||'';this[_0x75ab('0x0')]=_0x503ab4[_0x75ab('0x0')]||'';this[_0x75ab('0x1')]=_0x503ab4[_0x75ab('0x1')]||'';this['token']=_0x503ab4[_0x75ab('0x2')]||'';this[_0x75ab('0x3')]=_0x503ab4[_0x75ab('0x3')]||'';this[_0x75ab('0x4')]=_0x503ab4[_0x75ab('0x4')]||'';this['type']=_0x503ab4[_0x75ab('0x5')]||_0x75ab('0x6');this[_0x75ab('0x7')]=_0x503ab4[_0x75ab('0x7')]||'';this[_0x75ab('0x8')]=_0x503ab4[_0x75ab('0x8')]||{};}module[_0x75ab('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xac61=['Configurations','name','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x3bcf7b,_0x4c1075){var _0x58c34d=function(_0x137dac){while(--_0x137dac){_0x3bcf7b['push'](_0x3bcf7b['shift']());}};_0x58c34d(++_0x4c1075);}(_0xac61,0x1cc));var _0x1ac6=function(_0x4902d5,_0x1d3a67){_0x4902d5=_0x4902d5-0x0;var _0x1e885e=_0xac61[_0x4902d5];return _0x1e885e;};'use strict';function ZendeskAccount(_0xcc21b9){this['id']=_0xcc21b9['id']||0x0;this[_0x1ac6('0x0')]=_0xcc21b9[_0x1ac6('0x0')]||'';this['username']=_0xcc21b9['username']||'';this[_0x1ac6('0x1')]=_0xcc21b9[_0x1ac6('0x1')]||'';this[_0x1ac6('0x2')]=_0xcc21b9['token']||'';this[_0x1ac6('0x3')]=_0xcc21b9['remoteUri']||'';this[_0x1ac6('0x4')]=_0xcc21b9[_0x1ac6('0x4')]||'';this['type']=_0xcc21b9[_0x1ac6('0x5')]||_0x1ac6('0x6');this[_0x1ac6('0x7')]=_0xcc21b9['serverUrl']||'';this[_0x1ac6('0x8')]=_0xcc21b9[_0x1ac6('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 92295f9..3a9d2f7 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 _0x5b06=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b06,0x86));var _0x65b0=function(_0x124165,_0xd984da){_0x124165=_0x124165-0x0;var _0x2ac3ea=_0x5b06[_0x124165];return _0x2ac3ea;};'use strict';function ZohoAccount(_0x1be17d){this['id']=_0x1be17d['id']||0x0;this['name']=_0x1be17d[_0x65b0('0x0')]||'';this[_0x65b0('0x1')]=_0x1be17d[_0x65b0('0x1')]||'';this[_0x65b0('0x2')]=_0x1be17d[_0x65b0('0x2')]||'';this[_0x65b0('0x3')]=_0x1be17d['zone']||'';this[_0x65b0('0x4')]=_0x1be17d[_0x65b0('0x4')]||'';this[_0x65b0('0x5')]=_0x1be17d['clientSecret']||'';this[_0x65b0('0x6')]=_0x1be17d[_0x65b0('0x6')]||'';this[_0x65b0('0x7')]=_0x1be17d[_0x65b0('0x7')]||'';this[_0x65b0('0x8')]=_0x1be17d['refreshToken']||'';this['Configurations']=_0x1be17d[_0x65b0('0x9')]||{};}module[_0x65b0('0xa')]=ZohoAccount; \ No newline at end of file +var _0xe1b7=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x54db5e,_0x34b433){var _0x48e565=function(_0x342849){while(--_0x342849){_0x54db5e['push'](_0x54db5e['shift']());}};_0x48e565(++_0x34b433);}(_0xe1b7,0xbe));var _0x7e1b=function(_0x2d746b,_0x9b6959){_0x2d746b=_0x2d746b-0x0;var _0x2b082e=_0xe1b7[_0x2d746b];return _0x2b082e;};'use strict';function ZohoAccount(_0x42f48a){this['id']=_0x42f48a['id']||0x0;this['name']=_0x42f48a[_0x7e1b('0x0')]||'';this[_0x7e1b('0x1')]=_0x42f48a[_0x7e1b('0x1')]||'';this[_0x7e1b('0x2')]=_0x42f48a[_0x7e1b('0x2')]||'';this[_0x7e1b('0x3')]=_0x42f48a[_0x7e1b('0x3')]||'';this[_0x7e1b('0x4')]=_0x42f48a[_0x7e1b('0x4')]||'';this['clientSecret']=_0x42f48a[_0x7e1b('0x5')]||'';this[_0x7e1b('0x6')]=_0x42f48a[_0x7e1b('0x6')]||'';this[_0x7e1b('0x7')]=_0x42f48a[_0x7e1b('0x7')]||'';this[_0x7e1b('0x8')]=_0x42f48a['refreshToken']||'';this[_0x7e1b('0x9')]=_0x42f48a[_0x7e1b('0x9')]||{};}module[_0x7e1b('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6fb2c73..5eb8aca 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 _0x1a85=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1a85,0x178));var _0x51a8=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x1a85[_0x504df1];return _0x1063b5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x51a8('0x0'));function checkNameSurname(_0x382cb8,_0x43e22a,_0x498466){var _0x562d89='';if(!_[_0x51a8('0x1')](_0x43e22a)&&_0x51a8('0x2')===typeof _0x43e22a){_0x562d89+=_0x43e22a;}if(!_[_0x51a8('0x1')](_0x498466)&&'string'===typeof _0x498466){_0x562d89+='\x20'+_0x498466;}if(_0x562d89!==''){return _0x562d89;}return _0x382cb8;}function Action(_0xaac0bf,_0x4b76a8,_0x2c1180,_0x5cf430,_0x331117){this[_0x51a8('0x3')]=_0x2c1180||undefined;this['idContact']=_0xaac0bf['id'];this[_0x51a8('0x4')]=_0x4b76a8['name'];this['type']=_0x4b76a8[_0x51a8('0x5')];this[_0x51a8('0x6')]=_0x51a8('0x4');this[_0x51a8('0x7')]=![];this[_0x51a8('0x8')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?undefined:_0xaac0bf[_0x51a8('0x9')][_0x51a8('0xa')];this[_0x51a8('0xb')]=this[_0x51a8('0x8')]?util[_0x51a8('0xc')](_0x51a8('0xd'),this[_0x51a8('0x8')]):_0x5cf430||undefined;this[_0x51a8('0xe')]=checkNameSurname(_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x10')],_0xaac0bf['Contact'][_0x51a8('0x11')],_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x12')]);this['active']=_0xaac0bf[_0x51a8('0x13')]||![];this['calleridnum']=_0xaac0bf[_0x51a8('0x10')];this[_0x51a8('0x14')]=_0xaac0bf[_0x51a8('0x14')];this[_0x51a8('0x15')]=_0xaac0bf[_0x51a8('0x15')]||0x0;this[_0x51a8('0x16')]=_0xaac0bf[_0x51a8('0x16')]||0x0;this['countnoanswerretry']=_0xaac0bf[_0x51a8('0x17')]||0x0;this[_0x51a8('0x18')]=(_0xaac0bf[_0x51a8('0x15')]||0x0)+(_0xaac0bf[_0x51a8('0x16')]||0x0)+(_0xaac0bf[_0x51a8('0x17')]||0x0)+(_0xaac0bf[_0x51a8('0x19')]||0x0)+(_0xaac0bf['countdropretry']||0x0)+(_0xaac0bf[_0x51a8('0x1a')]||0x0)+(_0xaac0bf[_0x51a8('0x1b')]||0x0)+(_0xaac0bf[_0x51a8('0x1c')]||0x0);this[_0x51a8('0x19')]=_0xaac0bf[_0x51a8('0x19')]||0x0;this[_0x51a8('0x1d')]=_0xaac0bf[_0x51a8('0x1d')]||0x0;this[_0x51a8('0x1a')]=_0xaac0bf['countabandonedretry']||0x0;this[_0x51a8('0x1b')]=_0xaac0bf['countmachineretry']||0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1e')]=_0xaac0bf[_0x51a8('0x1e')];this['callbackuniqueid']=_0xaac0bf[_0x51a8('0x1f')];this['callbackat']=_0xaac0bf['callbackat'];this[_0x51a8('0x20')]=_0xaac0bf['recallme'];this[_0x51a8('0x21')]=_0xaac0bf[_0x51a8('0x21')];this[_0x51a8('0x22')]=_0xaac0bf[_0x51a8('0x22')];this[_0x51a8('0x23')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?_0xaac0bf[_0x51a8('0x23')]:_0xaac0bf['Agent']['id'];this[_0x51a8('0x24')]=_0xaac0bf[_0x51a8('0x24')];this[_0x51a8('0x25')]='';this[_0x51a8('0x26')]='';}Action[_0x51a8('0x27')][_0x51a8('0x28')]=function(){return util[_0x51a8('0xc')](_0x51a8('0x29'),this[_0x51a8('0xe')],this[_0x51a8('0x2a')]);};module[_0x51a8('0x2b')]=Action; \ No newline at end of file +var _0xa456=['originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','name','channelAgent','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countbusyretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa456,0x142));var _0x6a45=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xa456[_0x4dc7b9];return _0x3ab114;};'use strict';var util=require(_0x6a45('0x0'));var _=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));function checkNameSurname(_0xd5464e,_0x587626,_0x3bfbe6){var _0x206f6b='';if(!_[_0x6a45('0x3')](_0x587626)&&'string'===typeof _0x587626){_0x206f6b+=_0x587626;}if(!_[_0x6a45('0x3')](_0x3bfbe6)&&_0x6a45('0x4')===typeof _0x3bfbe6){_0x206f6b+='\x20'+_0x3bfbe6;}if(_0x206f6b!==''){return _0x206f6b;}return _0xd5464e;}function Action(_0x1e5882,_0x14da6b,_0x4dfbfa,_0x25cf8d,_0x26bfc0){this[_0x6a45('0x5')]=_0x4dfbfa||undefined;this[_0x6a45('0x6')]=_0x1e5882['id'];this[_0x6a45('0x7')]=_0x14da6b['name'];this[_0x6a45('0x8')]=_0x14da6b['type'];this[_0x6a45('0x9')]=_0x6a45('0x7');this[_0x6a45('0xa')]=![];this[_0x6a45('0xb')]=_[_0x6a45('0x3')](_0x1e5882['Agent'])?undefined:_0x1e5882['Agent'][_0x6a45('0xc')];this[_0x6a45('0xd')]=this['membername']?util['format']('SIP/%s',this[_0x6a45('0xb')]):_0x25cf8d||undefined;this[_0x6a45('0xe')]=checkNameSurname(_0x1e5882[_0x6a45('0xf')][_0x6a45('0x10')],_0x1e5882[_0x6a45('0xf')]['firstName'],_0x1e5882['Contact'][_0x6a45('0x11')]);this[_0x6a45('0x12')]=_0x1e5882['active']||![];this[_0x6a45('0x13')]=_0x1e5882[_0x6a45('0x10')];this[_0x6a45('0x14')]=_0x1e5882[_0x6a45('0x14')];this['countbusyretry']=_0x1e5882['countbusyretry']||0x0;this['countcongestionretry']=_0x1e5882[_0x6a45('0x15')]||0x0;this[_0x6a45('0x16')]=_0x1e5882[_0x6a45('0x16')]||0x0;this['countglobal']=(_0x1e5882[_0x6a45('0x17')]||0x0)+(_0x1e5882[_0x6a45('0x15')]||0x0)+(_0x1e5882[_0x6a45('0x16')]||0x0)+(_0x1e5882['countnosuchnumberretry']||0x0)+(_0x1e5882['countdropretry']||0x0)+(_0x1e5882['countabandonedretry']||0x0)+(_0x1e5882[_0x6a45('0x18')]||0x0)+(_0x1e5882[_0x6a45('0x19')]||0x0);this['countnosuchnumberretry']=_0x1e5882[_0x6a45('0x1a')]||0x0;this[_0x6a45('0x1b')]=_0x1e5882['countdropretry']||0x0;this[_0x6a45('0x1c')]=_0x1e5882[_0x6a45('0x1c')]||0x0;this[_0x6a45('0x18')]=_0x1e5882[_0x6a45('0x18')]||0x0;this[_0x6a45('0x19')]=_0x1e5882['countagentrejectretry']||0x0;this['callback']=_0x1e5882[_0x6a45('0x1d')];this[_0x6a45('0x1e')]=_0x1e5882[_0x6a45('0x1e')];this[_0x6a45('0x1f')]=_0x1e5882[_0x6a45('0x1f')];this[_0x6a45('0x20')]=_0x1e5882[_0x6a45('0x20')];this[_0x6a45('0x21')]=_0x1e5882[_0x6a45('0x21')];this[_0x6a45('0x22')]=_0x1e5882[_0x6a45('0x22')];this[_0x6a45('0x23')]=_['isNil'](_0x1e5882[_0x6a45('0x24')])?_0x1e5882['UserId']:_0x1e5882[_0x6a45('0x24')]['id'];this[_0x6a45('0x25')]=_0x1e5882[_0x6a45('0x25')];this[_0x6a45('0x26')]='';this[_0x6a45('0x27')]='';}Action['prototype'][_0x6a45('0x28')]=function(){return util[_0x6a45('0x29')](_0x6a45('0x2a'),this[_0x6a45('0xe')],this[_0x6a45('0x2b')]);};module[_0x6a45('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1bda835..6dae953 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 _0xa41a=['[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','isTrunkReachable','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','SIP/%s/%s%s','dialCutDigit','substring','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','responsetime','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','addVariable','variables','filterKey','variable','keys','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','emit','voice_queue_presence:remove','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','sendMessageOneNotActive','IsNotLoggedIn','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','buildAcw','custom:agentcomplete','complete','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','dialBusyMaxRetry','activeContact','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xa41a,0x6b));var _0xaa41=function(_0x42b6f8,_0xa51e18){_0x42b6f8=_0x42b6f8-0x0;var _0x29673f=_0xa41a[_0x42b6f8];return _0x29673f;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var BPromise=require('bluebird');var uuid=require(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var md5=require(_0xaa41('0x4'));var Redis=require(_0xaa41('0x5'));var config=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var loggerAction=require(_0xaa41('0x7'))('actionPreview');var ami=require(_0xaa41('0x9'));var rpcDb=require(_0xaa41('0xa'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0xaa41('0xb'));config[_0xaa41('0xc')]=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var io=require(_0xaa41('0xe'))(new Redis(config[_0xaa41('0xc')]));var Sequence=function(){};Sequence[_0xaa41('0xf')][_0xaa41('0x10')]=function(_0x806f08){this[_0xaa41('0x11')]=this[_0xaa41('0x11')]?this['tail'][_0xaa41('0x12')](_0x806f08):_0x806f08();};function Preview(_0x10cda9){this['sequence']=new Sequence();this['campaignsPreview']=_0x10cda9[_0xaa41('0x13')];this['trunks']=_0x10cda9[_0xaa41('0x14')];this[_0xaa41('0x15')]={};this[_0xaa41('0x16')]=_0x10cda9[_0xaa41('0x16')];this[_0xaa41('0x17')]=0x0;ami['on']('originateresponse',this[_0xaa41('0x18')][_0xaa41('0x19')](this));ami['on'](_0xaa41('0x1a'),this[_0xaa41('0x1b')][_0xaa41('0x19')](this));ami['on'](_0xaa41('0x1c'),this[_0xaa41('0x1d')]['bind'](this));ami['on'](_0xaa41('0x1e'),this[_0xaa41('0x1f')][_0xaa41('0x19')](this));ami['on'](_0xaa41('0x20'),this[_0xaa41('0x21')][_0xaa41('0x19')](this));ami['on'](_0xaa41('0x22'),this[_0xaa41('0x23')][_0xaa41('0x19')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xaa41('0x19')](this));ami['on'](_0xaa41('0x24'),this[_0xaa41('0x25')]['bind'](this));this[_0xaa41('0x26')](this[_0xaa41('0x27')]);}function emit(_0x4e768e,_0x513c61,_0x1b1910){io['to'](_0x4e768e)['emit'](_0x513c61,_0x1b1910);}function emitCampaignPreview(_0xafd672){if(_0xafd672[_0xaa41('0x28')]===_0xaa41('0x29')){var _0x1f27f3={'id':_0xafd672['id'],'name':_0xafd672[_0xaa41('0x2a')],'strategy':_0xafd672['strategy'],'answered':_0xafd672[_0xaa41('0x2b')],'available':_0xafd672[_0xaa41('0x2c')],'loggedIn':_0xafd672[_0xaa41('0x2d')],'pTalking':_0xafd672[_0xaa41('0x2e')],'sumBillable':_0xafd672[_0xaa41('0x2f')],'sumDuration':_0xafd672[_0xaa41('0x30')],'sumHoldTime':_0xafd672['sumHoldTime']||0x0,'talking':_0xafd672['talking'],'total':_0xafd672[_0xaa41('0x31')],'type':_0xafd672['type'],'unmanaged':_0xafd672['unmanaged'],'abandoned':_0xafd672[_0xaa41('0x32')],'waiting':_0xafd672['waiting'],'loggedInDb':_0xafd672['loggedInDb'],'dialActive':_0xafd672[_0xaa41('0x33')],'dialMethod':_0xafd672[_0xaa41('0x34')],'dialOriginateCallerIdName':_0xafd672[_0xaa41('0x35')],'dialOriginateCallerIdNumber':_0xafd672[_0xaa41('0x36')],'dialOriginateTimeout':_0xafd672[_0xaa41('0x37')],'dialPrefix':_0xafd672[_0xaa41('0x38')],'outboundAnswerAgiCallsDay':_0xafd672['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xafd672[_0xaa41('0x39')],'outboundBlacklistCallsDay':_0xafd672[_0xaa41('0x3a')],'outboundBusyCallsDay':_0xafd672[_0xaa41('0x3b')],'outboundCongestionCallsDay':_0xafd672[_0xaa41('0x3c')],'outboundDropCallsDayACS':_0xafd672[_0xaa41('0x3d')],'outboundDropCallsDayCallersExit':_0xafd672[_0xaa41('0x3e')],'outboundDropCallsDayTimeout':_0xafd672[_0xaa41('0x3f')],'outboundNoAnswerCallsDay':_0xafd672[_0xaa41('0x40')],'outboundNoSuchCallsDay':_0xafd672['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xafd672[_0xaa41('0x41')],'outboundReCallsDay':_0xafd672['outboundReCallsDay'],'outboundRejectCallsDay':_0xafd672['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xafd672[_0xaa41('0x42')],'outboundAbandonedCallsDay':_0xafd672[_0xaa41('0x43')],'predictiveIntervalAnsweredCalls':_0xafd672['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xafd672[_0xaa41('0x44')],'predictiveIntervalAvgTalktime':_0xafd672[_0xaa41('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0xafd672['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xafd672['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xafd672['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xafd672[_0xaa41('0x46')],'predictiveIntervalHitRate':_0xafd672[_0xaa41('0x47')],'predictiveIntervalMultiplicativeFactor':_0xafd672[_0xaa41('0x48')],'predictiveIntervalPauses':_0xafd672[_0xaa41('0x49')],'predictiveIntervalAvailable':_0xafd672['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xafd672[_0xaa41('0x4a')],'message':_0xafd672[_0xaa41('0x4b')],'originated':_0xafd672[_0xaa41('0x4c')],'erlangCalls':_0xafd672['erlangCalls'],'erlangCallToSecond':_0xafd672[_0xaa41('0x4d')],'erlangAbandonmentRate':_0xafd672[_0xaa41('0x4e')],'erlangBusyFactor':_0xafd672[_0xaa41('0x4f')],'startPredictive':_0xafd672['startPredictive'],'startProgressive':_0xafd672[_0xaa41('0x50')]};if(_0xafd672[_0xaa41('0x51')]){_0x1f27f3['Trunk']={'id':_0xafd672[_0xaa41('0x51')]['id'],'name':_0xafd672[_0xaa41('0x51')][_0xaa41('0x2a')],'active':_0xafd672['Trunk'][_0xaa41('0x52')],'callerid':_0xafd672['Trunk'][_0xaa41('0x53')]};}if(_0xafd672[_0xaa41('0x54')]){_0x1f27f3[_0xaa41('0x54')]={'id':_0xafd672['Interval']['id'],'name':_0xafd672['Interval']['name']};}var _0x2dc05a=md5(JSON[_0xaa41('0x55')](_0x1f27f3));if(_0xafd672[_0xaa41('0x4')]!==_0x2dc05a){_0xafd672[_0xaa41('0x4')]=_0x2dc05a;emit(util['format']('voice:queue:%s',_0x1f27f3[_0xaa41('0x2a')]),_0xaa41('0x56'),_0x1f27f3);}}}function emitVoiceQueueChannelRemove(_0x951e52){logger[_0xaa41('0x57')](_0xaa41('0x58'),JSON[_0xaa41('0x55')](_0x951e52));emit(util[_0xaa41('0x59')]('voice:queue:%s',_0x951e52[_0xaa41('0x2a')]),_0xaa41('0x5a'),_0x951e52);io[_0xaa41('0x5b')](_0xaa41('0x5c'),_0x951e52);}function notSendMessagesQueue(_0x57f1bf){if(_0x57f1bf['sendMessageOneNotActive']){if(_0x57f1bf[_0xaa41('0x4c')]===0x0&&_0x57f1bf[_0xaa41('0x2e')]===0x0){_0x57f1bf['sendMessageOneNotActive']=![];_0x57f1bf[_0xaa41('0x2c')]=0x0;_0x57f1bf['paused']=0x0;_0x57f1bf[_0xaa41('0x4b')]=_0xaa41('0x5d');ut[_0xaa41('0x5e')](_0xaa41('0x5f'),_0x57f1bf[_0xaa41('0x2a')]+_0xaa41('0x60'));}else{_0x57f1bf[_0xaa41('0x4b')]=_0xaa41('0x61');ut['logger'](_0xaa41('0x5f'),_0x57f1bf[_0xaa41('0x2a')]+_0xaa41('0x62'));}emitCampaignPreview(_0x57f1bf);}}Preview[_0xaa41('0xf')][_0xaa41('0x26')]=function(){var _0x1e2eb2=this;setInterval(function(){_0x1e2eb2['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xaa41('0x63')]=function(){var _0x4f9086=this[_0xaa41('0x27')];this[_0xaa41('0x17')]+=0x1;for(var _0x316d8 in _0x4f9086){if(_0x4f9086[_0xaa41('0x64')](_0x316d8)&&(_0x4f9086[_0x316d8][_0xaa41('0x34')]===_0xaa41('0x8')||_0x4f9086[_0x316d8][_0xaa41('0x34')]==='booked')&&_0x4f9086[_0x316d8][_0xaa41('0x28')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xaa41('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x4f9086['hasOwnProperty'](_0x316d8)&&_0x4f9086[_0x316d8]['dialMethod']===_0xaa41('0x8')&&_0x4f9086[_0x316d8]['type']===_0xaa41('0x29')){if(_0x4f9086[_0x316d8][_0xaa41('0x33')]){this['setMessage'](_0x4f9086[_0x316d8]);if(_0x4f9086[_0x316d8]['dialPreviewAutoRecallMe'])this[_0xaa41('0x65')](_0x4f9086[_0x316d8]);}else{notSendMessagesQueue(_0x4f9086[_0x316d8]);}}}};Preview[_0xaa41('0xf')][_0xaa41('0x66')]=function(_0x2af8ba){var _0x3fe1a9=this;this[_0xaa41('0x67')][_0xaa41('0x10')](function(){if(!_[_0xaa41('0x68')](_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba])){loggerAction['info'](_0xaa41('0x69'),_0x2af8ba,_0xaa41('0x6a'),_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x6b')],_0xaa41('0x6c'),JSON[_0xaa41('0x55')](_0x3fe1a9['campaignsPreview'][_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x6b')]][_0xaa41('0x4c')]),_0xaa41('0x6d'),JSON['stringify'](_0x3fe1a9[_0xaa41('0x27')][_0x3fe1a9['actions'][_0x2af8ba]['queue']][_0xaa41('0x2e')]),JSON[_0xaa41('0x55')](_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba]['dialAnswer']),JSON[_0xaa41('0x55')](_[_0xaa41('0x6e')](_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba],['contactId',_0xaa41('0x6f'),_0xaa41('0x70'),_0xaa41('0x71')])));return ami[_0xaa41('0x72')]({'action':_0xaa41('0x73'),'channel':_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x74')]})[_0xaa41('0x75')](function(_0x4eab60){if(_0x4eab60[_0xaa41('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3fe1a9['actions'][_0x2af8ba]){ut[_0xaa41('0x76')](_0x3fe1a9[_0xaa41('0x27')][_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x6b')]],_0xaa41('0x77'));if(_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x78')]===!![]){ut[_0xaa41('0x79')](_0x3fe1a9['campaignsPreview'][_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba][_0xaa41('0x6b')]],_0xaa41('0x77'));ut['loggerError'](_0xaa41('0x7a')+_0x2af8ba,_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba]['queue']);}ut[_0xaa41('0x7b')](_0xaa41('0x7c')+_0x2af8ba,_0x3fe1a9[_0xaa41('0x15')][_0x2af8ba]['queue']);delete _0x3fe1a9[_0xaa41('0x15')][_0x2af8ba];}},0x2328);}});}});};Preview[_0xaa41('0xf')]['clearZombieChannels']=function(){var _0x49789a=this;loggerAction[_0xaa41('0x57')](_0xaa41('0x7d'),_[_0xaa41('0x7e')](this['actions']));for(var _0x5a76b9 in this[_0xaa41('0x15')]){if(_0x49789a[_0xaa41('0x15')][_0xaa41('0x64')](_0x5a76b9)){_0x49789a[_0xaa41('0x66')](_0x5a76b9);}}};Preview['prototype'][_0xaa41('0x65')]=function(_0x57cb70){var _0x555186=this;rpcDb[_0xaa41('0x7f')](_0x57cb70['id'],ut['agentReadyId'](this[_0xaa41('0x16')]))[_0xaa41('0x80')](function(_0x169ddf){if(!_['isNil'](_0x169ddf)){for(var _0x12ba1b=0x0;_0x12ba1b<_0x169ddf[_0xaa41('0x81')];_0x12ba1b+=0x1){if(ut[_0xaa41('0x82')](_0x169ddf[_0x12ba1b][_0xaa41('0x83')])<_0x57cb70[_0xaa41('0x84')]*0x3c){if(_0x169ddf[_0x12ba1b][_0xaa41('0x85')]&&!_0x169ddf[_0x12ba1b][_0xaa41('0x85')][_0xaa41('0x86')]){_0x555186[_0xaa41('0x87')](_0x169ddf[_0x12ba1b]['id'])['then'](ut[_0xaa41('0x88')](_0xaa41('0x89')))[_0xaa41('0x75')](ut['logger2'](_0xaa41('0x89')));}else{rpcDb[_0xaa41('0x8a')](_0x169ddf[_0x12ba1b]['id']);}}else{var _0x157898=new Action(_0x169ddf[_0x12ba1b],_0x57cb70);_0x157898[_0xaa41('0x8b')]=moment()[_0xaa41('0x59')](_0xaa41('0x8c'));_0x57cb70[_0xaa41('0x8d')]+=0x1;ut['logCustomer'](_0x157898,0x17,'RecallInQueue');if(_0x57cb70['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x169ddf[_0x12ba1b]));rpcDb['createCustomerHistory'](_0x157898,_0xaa41('0x8e'));}else{ut['logCustomer'](_0x157898,0x16,'RecallFailedTimeout');rpcDb[_0xaa41('0x8f')](_0x157898,_0xaa41('0x90'));rpcDb[_0xaa41('0x91')](_0x157898,_0xaa41('0x90'));}}}}})['catch'](ut[_0xaa41('0x88')](_0xaa41('0x92')));};Preview[_0xaa41('0xf')][_0xaa41('0x93')]=function(_0xa71432){_0xa71432[_0xaa41('0x94')]=!![];if(ut[_0xaa41('0x95')](_0xa71432[_0xaa41('0x2d')])){_0xa71432[_0xaa41('0x4b')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xaa41('0x96')](_0xa71432[_0xaa41('0x33')])){_0xa71432['message']='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0xa71432[_0xaa41('0x51')])){if(!this['isTrunkReachable'](_0xa71432[_0xaa41('0x97')])){_0xa71432['message']=_0xaa41('0x98');}else{_0xa71432[_0xaa41('0x4b')]='ACTIVE';}}else{_0xa71432[_0xaa41('0x4b')]=_0xaa41('0x99');}emitCampaignPreview(_0xa71432);};Preview[_0xaa41('0xf')][_0xaa41('0x9a')]=function(_0x5a2683,_0x5be61b,_0x339db3){var _0x22bae6=this;var _0x4d6d0c=this['actions'][_0x5be61b];var _0x2169b8=this[_0xaa41('0x27')][_0x4d6d0c[_0xaa41('0x6b')]];var _0xbeafb5;var _0x3dbe37=![];var _0x5a385e=0x2;var _0x475ceb=0x3;if(_0x2169b8){switch(_0x339db3){case'1':_0x2169b8['outboundNoSuchCallsDay']+=0x1;_0x4d6d0c['countnosuchnumberretry']+=0x1;_0x4d6d0c['countglobal']=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x0,_0xaa41('0x9d'));ami['emit'](_0xaa41('0x9e'),ut[_0xaa41('0x9f')](_0x4d6d0c,_0xaa41('0xa0')));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xa1'));_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'0',_0x2169b8)[_0xaa41('0x80')](function(_0x50a53b){_0x3dbe37=_0x50a53b[_0xaa41('0xa3')]==0x1;_0x5a385e=_0x2169b8[_0xaa41('0xa4')];_0x475ceb=_0x2169b8[_0xaa41('0xa5')];if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8['dialGlobalMaxRetry']){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,'Global');rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xa7'));}else{if(_0x4d6d0c[_0xaa41('0xa8')]>=_0x2169b8[_0xaa41('0xa9')]){rpcDb['createCustomerFinal'](_0x4d6d0c,_0xaa41('0xa7'));}else{rpcDb[_0xaa41('0xaa')](ut[_0xaa41('0xab')](_0x4d6d0c,_0xaa41('0xa8'),_0x2169b8['dialNoSuchNumberRetryFrequency']),_0x4d6d0c[_0xaa41('0xac')],_0x4d6d0c['activeContact']);}}delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xad')]];}else{_0x4d6d0c['countnosuchnumberretry']++;logger[_0xaa41('0x57')](_0xaa41('0xae'),_0x4d6d0c[_0xaa41('0xa8')]);logger[_0xaa41('0x57')]('id',_0x4d6d0c[_0xaa41('0xaf')]);_0x22bae6[_0xaa41('0xb0')]({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countnosuchnumberretry':_0x4d6d0c[_0xaa41('0xa8')]}})[_0xaa41('0x80')](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(){});});}});break;case'ANSWER':var _0x1c5f70=moment()[_0xaa41('0x59')](_0xaa41('0x8c'));_0x4d6d0c['responsetime']=_0x1c5f70;_0x4d6d0c['answertime']=_0x1c5f70;_0x4d6d0c[_0xaa41('0x78')]=!![];_0x2169b8[_0xaa41('0x2e')]+=0x1;logger['info'](_0xaa41('0xb2'),_0x4d6d0c[_0xaa41('0xb3')],'\x20Queue',_0x2169b8[_0xaa41('0x2a')],_0xaa41('0x6d'),_0x2169b8[_0xaa41('0x2e')]);ami[_0xaa41('0x5b')](_0xaa41('0xb4'),ut[_0xaa41('0x9f')](_0x4d6d0c,_0xaa41('0xb5'),this[_0xaa41('0x27')][_0x4d6d0c['queue']]));if(_0x2169b8['acw']){ami[_0xaa41('0x5b')]('custom:agentConnectPreview',ut[_0xaa41('0xb6')](_0x4d6d0c));}break;case'16':ami[_0xaa41('0x5b')](_0xaa41('0xb7'),ut['buildObj'](_0x4d6d0c,_0xaa41('0xb8'),this[_0xaa41('0x27')][_0x4d6d0c[_0xaa41('0x6b')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4d6d0c,_0xaa41('0xb8')));_0x2169b8[_0xaa41('0x39')]+=0x1;_0x2169b8['total']+=0x1;_0x2169b8[_0xaa41('0x2b')]+=0x1;ut['decrementTalkink'](_0x2169b8,'[16]');_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut['logCustomer'](_0x4d6d0c,0x4,'Answer');rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xba'));rpcDb[_0xaa41('0x91')](_0x4d6d0c,_0xaa41('0xbb'));rpcDb['crateCustomerReportQueue'](_0x4d6d0c);_0x2169b8[_0xaa41('0x30')]+=_0x4d6d0c[_0xaa41('0xbc')];_0x2169b8[_0xaa41('0x2f')]+=_0x4d6d0c['talktime'];logger[_0xaa41('0x57')](_0xaa41('0xbd'),_0x4d6d0c[_0xaa41('0xb3')],'\x20Queue',_0x2169b8[_0xaa41('0x2a')],'pTalking:\x20',_0x2169b8['pTalking']);delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xad')]];break;case'BUSY':_0x2169b8[_0xaa41('0x3b')]+=0x1;_0x4d6d0c[_0xaa41('0xbe')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut['totalGlobal'](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x5,_0xaa41('0xbf'));_0x5a385e=_0x2169b8[_0xaa41('0xc0')];_0x475ceb=_0x2169b8[_0xaa41('0xa5')];ami[_0xaa41('0x5b')]('custom:agentbusy',ut[_0xaa41('0x9f')](_0x4d6d0c,'busy'));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xc1'));_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'5',_0x2169b8)[_0xaa41('0x80')](function(_0x33ec81){_0x3dbe37=_0x33ec81[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4d6d0c[_0xaa41('0xbe')]>=_0x2169b8[_0xaa41('0xc4')]){rpcDb['createCustomerFinal'](_0x4d6d0c,_0xaa41('0xc1'));}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xab')](_0x4d6d0c,_0xaa41('0xbe'),_0x2169b8[_0xaa41('0xc0')]),_0x4d6d0c[_0xaa41('0xac')],_0x4d6d0c[_0xaa41('0xc5')]);}}}else{_0x4d6d0c[_0xaa41('0xbe')]++;_0x22bae6[_0xaa41('0xb0')]({'id':_0x4d6d0c['idContact'],'field':{'countbusyretry':_0x4d6d0c[_0xaa41('0xbe')]}})[_0xaa41('0x80')](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(){});});}});break;case'NOANSWER':_0x2169b8[_0xaa41('0x40')]+=0x1;_0x4d6d0c['countnoanswerretry']+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x3,_0xaa41('0xc6'));_0x5a385e=_0x2169b8[_0xaa41('0xc7')];_0x475ceb=_0x2169b8['callAdditionalPhoneAfterMin'];ami[_0xaa41('0x5b')](_0xaa41('0xc8'),ut['buildObj'](_0x4d6d0c,_0xaa41('0xc9')));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xca'));_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'3',_0x2169b8)[_0xaa41('0x80')](function(_0x133e29){_0x3dbe37=_0x133e29[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8['dialGlobalMaxRetry']){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xcb'));}else{if(_0x4d6d0c[_0xaa41('0xcc')]>=_0x2169b8[_0xaa41('0xcd')]){rpcDb['createCustomerFinal'](_0x4d6d0c,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xab')](_0x4d6d0c,_0xaa41('0xcc'),_0x2169b8['dialNoAnswerRetryFrequency']),_0x4d6d0c[_0xaa41('0xac')],_0x4d6d0c[_0xaa41('0xc5')]);}}}else{_0x4d6d0c['countnoanswerretry']++;_0x22bae6[_0xaa41('0xb0')]({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countnoanswerretry':_0x4d6d0c[_0xaa41('0xcc')]}})[_0xaa41('0x80')](function(){_0x22bae6['swapAdditionalPhones'](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(){});});}});break;case'CONGESTION':_0x2169b8[_0xaa41('0x3c')]+=0x1;_0x4d6d0c[_0xaa41('0xce')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x8,_0xaa41('0xcf'));_0x5a385e=_0x2169b8[_0xaa41('0xd0')];_0x475ceb=_0x2169b8[_0xaa41('0xa5')];ami[_0xaa41('0x5b')]('custom:agentcongestion',ut[_0xaa41('0x9f')](_0x4d6d0c,_0xaa41('0xd1')));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,'[callProgressDetectingCustomer][logCongestion]');_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'8',_0x2169b8)[_0xaa41('0x80')](function(_0x10763e){_0x3dbe37=_0x10763e[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xd2'));}else{if(_0x4d6d0c[_0xaa41('0xce')]>=_0x2169b8['dialCongestionMaxRetry']){rpcDb[_0xaa41('0x91')](_0x4d6d0c,_0xaa41('0xd3'));}else{rpcDb[_0xaa41('0xaa')](ut[_0xaa41('0xab')](_0x4d6d0c,_0xaa41('0xce'),_0x2169b8['dialBusyRetryFrequency']),_0x4d6d0c['unlockAgent'],_0x4d6d0c[_0xaa41('0xc5')]);}}}else{_0x4d6d0c[_0xaa41('0xce')]++;_0x22bae6['incrementPreviewCounters']({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countcongestionretry':_0x4d6d0c[_0xaa41('0xce')]}})['then'](function(){_0x22bae6['swapAdditionalPhones'](_0x4d6d0c,_0x5a385e,_0x475ceb)['then'](function(){});});}});break;case _0xaa41('0xd4'):_0x2169b8[_0xaa41('0xd5')]+=0x1;_0x4d6d0c[_0xaa41('0xd6')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x14,_0xaa41('0xd7'));_0x5a385e=_0x2169b8[_0xaa41('0xd8')];_0x475ceb=_0x2169b8[_0xaa41('0xa5')];ami[_0xaa41('0x5b')](_0xaa41('0xd9'),ut['buildObj'](_0x4d6d0c,'agentreject'));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xda'));_0x22bae6['verifyAdditionalPhones'](_0x4d6d0c,'20',_0x2169b8)[_0xaa41('0x80')](function(_0x557156){_0x3dbe37=_0x557156[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0x14,_0xaa41('0xd7'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xdb'));}else{if(_0x4d6d0c[_0xaa41('0xd6')]>=_0x2169b8[_0xaa41('0xdc')]){rpcDb['createCustomerFinal'](_0x4d6d0c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xab')](_0x4d6d0c,_0xaa41('0xd6'),_0x2169b8['dialAgentRejectRetryFrequency']),_0x4d6d0c['unlockAgent'],_0x4d6d0c[_0xaa41('0xc5')]);}}}else{_0x4d6d0c[_0xaa41('0xcc')]++;_0x22bae6['incrementPreviewCounters']({'id':_0x4d6d0c['idContact'],'field':{'countnoanswerretry':_0x4d6d0c[_0xaa41('0xcc')]}})['then'](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(){});});}});break;case _0xaa41('0xdd'):_0x2169b8[_0xaa41('0x43')]+=0x1;_0x4d6d0c[_0xaa41('0xde')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0xb,_0xaa41('0xdf'));rpcDb['createCustomerHistory'](_0x4d6d0c,'[callProgressDetectingCustomer][logAbandoned]');_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'11',_0x2169b8)[_0xaa41('0x80')](function(_0x337655){_0x3dbe37=_0x337655[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xe0'));}else{if(_0x4d6d0c[_0xaa41('0xe1')]>=_0x2169b8[_0xaa41('0xe2')]){rpcDb[_0xaa41('0x91')](_0x4d6d0c,_0xaa41('0xe0'));}else{rpcDb[_0xaa41('0xaa')](ut['scheduledAt'](_0x4d6d0c,_0xaa41('0xde'),_0x2169b8['dialAbandonedRetryFrequency']),_0x4d6d0c[_0xaa41('0xac')],_0x4d6d0c[_0xaa41('0xc5')]);}}}else{_0x4d6d0c[_0xaa41('0xcc')]++;_0x22bae6[_0xaa41('0xb0')]({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countnoanswerretry':_0x4d6d0c[_0xaa41('0xcc')]}})[_0xaa41('0x80')](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)['then'](function(){});});}});break;case'18':_0x2169b8[_0xaa41('0x42')]+=0x1;_0x4d6d0c[_0xaa41('0xe3')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut[_0xaa41('0x9b')](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0x12,_0x5a2683[_0xaa41('0xe4')]||_0x5a2683[_0xaa41('0xe5')]);ami[_0xaa41('0x5b')](_0xaa41('0xe6'),ut[_0xaa41('0x9f')](_0x4d6d0c,'amd'));rpcDb['createCustomerHistory'](_0x4d6d0c,_0xaa41('0xe7'));_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'18',_0x2169b8)[_0xaa41('0x80')](function(_0x398741){_0x3dbe37=_0x398741[_0xaa41('0xa3')]==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0x12,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x4d6d0c,_0xaa41('0xe7'));}}else{_0x4d6d0c[_0xaa41('0xcc')]++;_0x22bae6['incrementPreviewCounters']({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countnoanswerretry':_0x4d6d0c['countnoanswerretry']}})[_0xaa41('0x80')](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)['then'](function(){});});}});delete this['actions'][_0x5a2683[_0xaa41('0xad')]];break;case'19':_0x2169b8[_0xaa41('0x42')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut['totalGlobal'](_0x4d6d0c);ut['logCustomer'](_0x4d6d0c,0x13,_0x5a2683[_0xaa41('0xe4')]||_0x5a2683['dialstatus']);ami[_0xaa41('0x5b')]('custom:amd',ut[_0xaa41('0x9f')](_0x4d6d0c,_0xaa41('0xe8')));rpcDb[_0xaa41('0x8f')](_0x4d6d0c,_0xaa41('0xe9'));_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'18',_0x2169b8)[_0xaa41('0x80')](function(_0xf615eb){_0x3dbe37=_0xf615eb['additional']==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut['cloneAction'](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xe9'));}else{rpcDb[_0xaa41('0x91')](_0x4d6d0c,'[callProgressDetectingCustomer][machine]');}}else{_0x4d6d0c[_0xaa41('0xcc')]++;_0x22bae6[_0xaa41('0xb0')]({'id':_0x4d6d0c[_0xaa41('0xaf')],'field':{'countnoanswerretry':_0x4d6d0c[_0xaa41('0xcc')]}})[_0xaa41('0x80')](function(){_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(){});});}});delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xad')]];break;default:if(_0x4d6d0c['dialAnswer']){ut['decrementTalkink'](_0x2169b8,_0xaa41('0xea'));ut[_0xaa41('0x7b')](_0xaa41('0xeb')+_0x2169b8[_0xaa41('0x2a')],_0x5a2683);}_0x2169b8[_0xaa41('0x42')]+=0x1;_0x4d6d0c[_0xaa41('0xb9')]=ut['totalGlobal'](_0x4d6d0c);ut[_0xaa41('0x9c')](_0x4d6d0c,0xc,_0x5a2683[_0xaa41('0xe4')]||_0x5a2683[_0xaa41('0xe5')]);_0x5a385e=_0x2169b8[_0xaa41('0xd8')];_0x475ceb=_0x2169b8[_0xaa41('0xa5')];rpcDb[_0xaa41('0x8f')](_0x4d6d0c,'[callProgressDetectingCustomer][logUnknown]');_0x22bae6[_0xaa41('0xa2')](_0x4d6d0c,'20',_0x2169b8)[_0xaa41('0x80')](function(_0x13ddbe){_0x3dbe37=_0x13ddbe['additional']==0x1;if(!_0x3dbe37){if(ut[_0xaa41('0x9b')](_0x4d6d0c)>=_0x2169b8[_0xaa41('0xc2')]){_0xbeafb5=ut[_0xaa41('0xa6')](_0x4d6d0c,0xf,_0xaa41('0xc3'));rpcDb[_0xaa41('0x91')](_0xbeafb5,_0xaa41('0xec'));}else{rpcDb[_0xaa41('0x91')](_0x4d6d0c,_0xaa41('0xec'));}delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xad')]];}else{_0x22bae6[_0xaa41('0xb1')](_0x4d6d0c,_0x5a385e,_0x475ceb)[_0xaa41('0x80')](function(_0x21792a){});}});}if(!(_0x4d6d0c['dialAnswer']&&_0x339db3==='16')){ut['updateOriginated'](_0x2169b8,_0xaa41('0xed'));logger[_0xaa41('0x57')](_0xaa41('0xee'),_0x4d6d0c[_0xaa41('0xb3')],_0xaa41('0xef'),_0x2169b8[_0xaa41('0x2a')],_0xaa41('0x6c'),_0x2169b8['originated']);}if(_0x339db3!==_0xaa41('0xf0')){delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xad')]];delete this[_0xaa41('0x15')][_0x5a2683[_0xaa41('0xf1')]];}}};Preview[_0xaa41('0xf')][_0xaa41('0xf2')]=function(_0x1a7527,_0x1aac0c,_0x1a5a7a){if(_[_0xaa41('0xf3')](_0x1aac0c)&&_0xaa41('0xf4')!==typeof _0x1aac0c){return;}if(_['isUndefined'](_0x1a5a7a)&&_0xaa41('0xf4')!==typeof _0x1a5a7a){return;}switch(_0x1a5a7a[_0xaa41('0xf5')]){case'0':ut['logAgent'](_0x1a7527,0x0,_0xaa41('0x9d'));rpcDb[_0xaa41('0xf6')](_0x1a7527,_0xaa41('0xf7'));break;case'3':ut[_0xaa41('0xf8')](_0x1a7527,0x3,'NoAnswer');rpcDb[_0xaa41('0xf6')](_0x1a7527,_0xaa41('0xf9'));break;case'5':ut[_0xaa41('0xf8')](_0x1a7527,0x5,_0xaa41('0xbf'));rpcDb[_0xaa41('0xf6')](_0x1a7527,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xaa41('0xf8')](_0x1a7527,0x8,'Congestion');rpcDb['createAgentHistory'](_0x1a7527,_0xaa41('0xfa'));break;case'22':ut['logAgent'](_0x1a7527,0x16,'AnswerAGI');rpcDb[_0xaa41('0xf6')](_0x1a7527,_0xaa41('0xfb'));break;default:ut[_0xaa41('0xf8')](_0x1a7527,0xc,_0x1a5a7a['reason']);rpcDb[_0xaa41('0xf6')](_0x1a7527,_0xaa41('0xfa'));}ut[_0xaa41('0x76')](_0x1aac0c,_0xaa41('0xfc'));logger[_0xaa41('0x57')](_0xaa41('0xfd'),_0x1a7527[_0xaa41('0xb3')],_0xaa41('0xef'),_0x1aac0c['name'],_0xaa41('0x6c'),_0x1aac0c[_0xaa41('0x4c')]);delete this[_0xaa41('0x15')][_0x1a7527[_0xaa41('0xb3')]];};Preview[_0xaa41('0xf')]['verifyAdditionalPhones']=function(_0x519843,_0x348c77,_0x1444bb){return BPromise[_0xaa41('0xfe')]()[_0xaa41('0x80')](cmHopperAdditionalPhone[_0xaa41('0xa2')](_0x519843,_0x348c77,_0x1444bb))[_0xaa41('0x75')](logger['info'](_0xaa41('0xff')));};Preview[_0xaa41('0xf')]['swapAdditionalPhones']=function(_0x40f4ce,_0x16fe76,_0x95300a){return BPromise[_0xaa41('0xfe')]()[_0xaa41('0x80')](cmHopperAdditionalPhone[_0xaa41('0xb1')](_0x40f4ce,_0x16fe76,_0x95300a))[_0xaa41('0x75')](logger['info'](_0xaa41('0x100')));};Preview[_0xaa41('0xf')]['incrementPreviewCounters']=function(_0x31fd1d){return BPromise[_0xaa41('0xfe')]()[_0xaa41('0x80')](cmHopperAdditionalPhone[_0xaa41('0xb0')](_0x31fd1d))['catch'](logger[_0xaa41('0x57')](_0xaa41('0x101')));};Preview[_0xaa41('0xf')][_0xaa41('0x102')]=function(_0x1402e6,_0x4b84bc,_0x20d77a,_0x31d371,_0x4a68df){var _0x5cb8a1=this;return new BPromise(function(_0x456c57,_0x3125df){if(_[_0xaa41('0x68')](_0x4b84bc)||_[_0xaa41('0x68')](_0x4b84bc[_0xaa41('0x103')])||_[_0xaa41('0x68')](_0x4b84bc['phone'])||_['isNil'](_0x4b84bc[_0xaa41('0x70')])){_0x3125df(ut[_0xaa41('0x4b')]('Contact\x20is\x20undefined',_0x31d371,_0x4a68df));return;}var _0x51379c=uuid['v4']();var _0x38f4fc=_0x5cb8a1[_0xaa41('0x27')][_0x4b84bc[_0xaa41('0x6a')]['name']];var _0x50122d=_0x20d77a?_0x5cb8a1[_0xaa41('0x16')][_0x20d77a]['id']:undefined;_0x5cb8a1[_0xaa41('0x15')][_0x51379c]=new Action(_0x4b84bc,_0x38f4fc,_0x51379c,_0x20d77a,_0x50122d);var _0x10005b=_0x5cb8a1['actions'][_0x51379c];_0x10005b[_0xaa41('0xac')]=_0x31d371;_0x10005b[_0xaa41('0xc5')]=_0x4a68df;_0x10005b['lookAgent']=_0x20d77a;if(_['isEmpty'](_0x1402e6)){_0x5cb8a1[_0xaa41('0x104')](_0x10005b,_0x38f4fc,_0x4b84bc,_0x20d77a)['then'](function(_0x4679e5){logger[_0xaa41('0x57')](_0xaa41('0x105'),_0xaa41('0x106')+_0x10005b[_0xaa41('0x6b')]+_0xaa41('0x107')+_0x10005b[_0xaa41('0xaf')],JSON['stringify'](_0x4679e5));ami[_0xaa41('0x5b')](_0xaa41('0x108'),ut['buildObj'](_0x10005b,_0xaa41('0x109'),_0x5cb8a1[_0xaa41('0x27')][_0x10005b[_0xaa41('0x6b')]]));_0x456c57(ut[_0xaa41('0x4b')](_0xaa41('0x10a')));})[_0xaa41('0x75')](function(_0x5e7853){ut[_0xaa41('0x5e')](_0xaa41('0x10b'),_0x5e7853);_0x3125df(ut[_0xaa41('0x4b')](_0xaa41('0x10c'),_0x31d371,_0x4a68df));});}else{_0x38f4fc[_0xaa41('0x3a')]+=0x1;ut[_0xaa41('0x10d')](_0x10005b);rpcDb[_0xaa41('0x10e')](_0x10005b,'[Blacklist][error]');delete _0x5cb8a1[_0xaa41('0x15')][_0x51379c];_0x3125df(ut[_0xaa41('0x4b')](_0xaa41('0x10f'),_0x31d371,_0x4a68df));}});};Preview['prototype']['isTrunkReachable']=function(_0x4ecaee){return!_[_0xaa41('0x68')](_0x4ecaee)&&!_[_0xaa41('0x68')](_0x4ecaee[_0xaa41('0x2a')])&&!_[_0xaa41('0x68')](_0x4ecaee[_0xaa41('0x52')])&&_0x4ecaee['active']&&!_[_0xaa41('0x68')](this[_0xaa41('0x14')][util[_0xaa41('0x59')](_0xaa41('0x110'),_0x4ecaee[_0xaa41('0x2a')])])&&!_[_0xaa41('0x68')](this[_0xaa41('0x14')][util['format'](_0xaa41('0x110'),_0x4ecaee[_0xaa41('0x2a')])][_0xaa41('0x73')])&&(this['trunks'][util[_0xaa41('0x59')]('SIP/%s',_0x4ecaee['name'])][_0xaa41('0x73')]==='reachable'||this[_0xaa41('0x14')][util[_0xaa41('0x59')](_0xaa41('0x110'),_0x4ecaee[_0xaa41('0x2a')])][_0xaa41('0x73')]===_0xaa41('0x111'));};Preview[_0xaa41('0xf')]['run']=function(_0x3c91e0,_0x10b691){var _0x3ee9e3=this;return new BPromise(function(_0x2eb745,_0x1a638d){_0x3ee9e3[_0xaa41('0x112')](_0x3c91e0,_0x10b691)[_0xaa41('0x80')](function(_0x38140b){_0x2eb745(_[_0xaa41('0x6e')](_0x38140b,[_0xaa41('0x4b')]));})[_0xaa41('0x75')](function(_0x498e6c){if(_0x498e6c[_0xaa41('0x113')]){rpcDb[_0xaa41('0x114')](_0x3c91e0);}if(_0x498e6c[_0xaa41('0x52')]){rpcDb[_0xaa41('0x8a')](_0x3c91e0);}_0x1a638d(_['pick'](_0x498e6c,[_0xaa41('0x4b')]));});});};Preview['prototype']['execRun']=function(_0x5020d5,_0x46fc5f){var _0xa87d06=this;return new BPromise(function(_0x5f40ff,_0x2176a6){var _0x356256,_0x1e86cc;rpcDb[_0xaa41('0x115')](_0x5020d5)[_0xaa41('0x80')](function(_0x34d857){if(!_[_0xaa41('0x68')](_0x34d857[0x0])){_0x1e86cc=_0x34d857[0x0][_0xaa41('0x116')]?![]:!![];_0x356256=_0x34d857[0x0][_0xaa41('0x116')]?!![]:![];_0x356256=_0x46fc5f?!![]:_0x356256;}var _0x410fa3=_0xa87d06[_0xaa41('0x117')](_0x34d857);if(_0x410fa3[_0xaa41('0x118')]){rpcDb[_0xaa41('0x119')](_[_0xaa41('0x6e')](_0x34d857[0x0],[_0xaa41('0x70'),_0xaa41('0x11a')]))[_0xaa41('0x80')](function(_0x4ed640){_0xa87d06[_0xaa41('0x102')](_0x4ed640,_0x34d857[0x0],_0x46fc5f,_0x1e86cc,_0x356256)[_0xaa41('0x80')](function(_0x154828){_0x5f40ff(_0x154828);})[_0xaa41('0x75')](function(_0x4973f5){_0x2176a6(_0x4973f5);});})[_0xaa41('0x75')](function(_0x304c3e){ut['logger'](_0xaa41('0x11b'),_0x304c3e);_0x2176a6(ut[_0xaa41('0x4b')](_0xaa41('0x11c'),_0x1e86cc,_0x356256));});}else{_0x2176a6(ut[_0xaa41('0x4b')](_0x410fa3[_0xaa41('0x4b')],_0x1e86cc,_0x356256));}})[_0xaa41('0x75')](function(_0x41fca3){ut[_0xaa41('0x5e')](_0xaa41('0x11d'),_0x41fca3);_0x2176a6(ut[_0xaa41('0x4b')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xaa41('0xf')][_0xaa41('0x117')]=function(_0x44c44d){if(_[_0xaa41('0x68')](_0x44c44d)||_[_0xaa41('0x11e')](_0x44c44d)||!_[_0xaa41('0x68')](_0x44c44d[0x0]['Agent'])&&_[_0xaa41('0x68')](_0x44c44d[0x0]['Agent'][_0xaa41('0x2a')])){ut[_0xaa41('0x5e')](_0xaa41('0x11f'),_0x44c44d);return{'isValid':![],'message':_0xaa41('0x120')};}var _0x45e57f=this['campaignsPreview'][_0x44c44d[0x0][_0xaa41('0x6a')][_0xaa41('0x2a')]];_0x45e57f['message']=_0xaa41('0x99');if(_[_0xaa41('0x68')](_0x45e57f)){ut[_0xaa41('0x5e')](_0xaa41('0x121'),_0x45e57f);return{'isValid':![],'message':_0xaa41('0x122')};}if(!this[_0xaa41('0x123')](_0x45e57f[_0xaa41('0x51')])){ut[_0xaa41('0x5e')](_0xaa41('0x124'),_0xaa41('0x125')+_0x45e57f['name']+_0xaa41('0x126'));if(!this[_0xaa41('0x123')](_0x45e57f[_0xaa41('0x97')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x45e57f[_0xaa41('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xaa41('0x96')](_0x45e57f[_0xaa41('0x33')])){ut[_0xaa41('0x5e')](_0xaa41('0x127'),_0x45e57f['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xaa41('0x125')+_0x45e57f[_0xaa41('0x2a')]+_0xaa41('0x128')};}return{'isValid':!![],'message':_0xaa41('0x129')};};Preview[_0xaa41('0xf')]['execCall']=function(_0x33aea4,_0x1b2a8c,_0x597e47,_0xc2d2d9){var _0x32b673=this;return new BPromise(function(_0x4b4a4a,_0x315f30){var _0x12d533=_0x33aea4['uniqueid'];var _0x44ee83=_0x32b673[_0xaa41('0x123')](_0x1b2a8c['Trunk'])?util[_0xaa41('0x59')]('SIP/%s/%s%s',_0x1b2a8c['Trunk'][_0xaa41('0x2a')],_[_0xaa41('0x68')](_0x1b2a8c[_0xaa41('0x38')])?'':_0x1b2a8c[_0xaa41('0x38')][_0xaa41('0x12a')]()||'',_0x1b2a8c['dialCutDigit']>0x0?_0x597e47[_0xaa41('0x11a')]['substring'](_0x1b2a8c['dialCutDigit']):_0x597e47[_0xaa41('0x11a')]):util[_0xaa41('0x59')](_0xaa41('0x12b'),_[_0xaa41('0x68')](_0x1b2a8c[_0xaa41('0x97')])?_0x1b2a8c[_0xaa41('0x51')][_0xaa41('0x2a')]:_0x1b2a8c['TrunkBackup'][_0xaa41('0x2a')],_[_0xaa41('0x68')](_0x1b2a8c[_0xaa41('0x38')])?'':_0x1b2a8c[_0xaa41('0x38')][_0xaa41('0x12a')]()||'',_0x1b2a8c[_0xaa41('0x12c')]>0x0?_0x597e47[_0xaa41('0x11a')][_0xaa41('0x12d')](_0x1b2a8c[_0xaa41('0x12c')]):_0x597e47[_0xaa41('0x11a')]);var _0x473d1c=_0x32b673[_0xaa41('0x123')](_0x1b2a8c['Trunk'])?ut['getCallerId'](_0x1b2a8c[_0xaa41('0x51')][_0xaa41('0x53')],_0x1b2a8c[_0xaa41('0x35')],_0x1b2a8c['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xaa41('0x12e')](_0x1b2a8c[_0xaa41('0x36')],_0x1b2a8c[_0xaa41('0x12f')]):_0x1b2a8c[_0xaa41('0x36')]):ut[_0xaa41('0x130')](_[_0xaa41('0x68')](_0x1b2a8c[_0xaa41('0x97')])?_0x1b2a8c[_0xaa41('0x51')][_0xaa41('0x53')]:_0x1b2a8c[_0xaa41('0x97')][_0xaa41('0x53')],_0x1b2a8c[_0xaa41('0x35')],_0x1b2a8c[_0xaa41('0x12f')]>0x0?ut[_0xaa41('0x12e')](_0x1b2a8c[_0xaa41('0x36')],_0x1b2a8c['dialRandomLastDigitCallerIdNumber']):_0x1b2a8c[_0xaa41('0x36')]);if(_0x473d1c){_0x33aea4[_0xaa41('0x131')]=ut[_0xaa41('0x132')](_0x473d1c);_0x33aea4['originatecalleridnum']=ut[_0xaa41('0x133')](_0x473d1c);}var _0xfc1e24=ut[_0xaa41('0x134')](_0x1b2a8c,_0x597e47,_0x44ee83,_0x473d1c,_0x12d533,_0x33aea4);_[_0xaa41('0x135')](_0x33aea4,ut[_0xaa41('0x136')](_0xfc1e24));_0x33aea4[_0xaa41('0x8b')]=moment()[_0xaa41('0x59')](_0xaa41('0x8c'));ami['Action'](ut[_0xaa41('0x137')](_0x33aea4,_0x1b2a8c,_0xfc1e24,_0x33aea4[_0xaa41('0xc5')],_0xc2d2d9))[_0xaa41('0x80')](function(_0x2fc4b1){_0x1b2a8c[_0xaa41('0x4c')]+=0x1;logger['info'](_0xaa41('0x138'),_0x12d533,'\x20Queue',_0x1b2a8c[_0xaa41('0x2a')],_0xaa41('0x6c'),_0x1b2a8c[_0xaa41('0x4c')]);_0x4b4a4a(_0x2fc4b1);})[_0xaa41('0x75')](function(_0x138ef0){ut[_0xaa41('0xf8')](_0x33aea4,0xe,_0xaa41('0x139'));rpcDb[_0xaa41('0xf6')](_0x33aea4,_0xaa41('0x13a'));_0x315f30(_0x138ef0);});});};Preview[_0xaa41('0xf')][_0xaa41('0x21')]=function(_0x3ef059){if(this['actions'][_0x3ef059['linkedid']]){this[_0xaa41('0x15')][_0x3ef059[_0xaa41('0xad')]][_0xaa41('0x74')]=_0x3ef059[_0xaa41('0x74')];}};Preview[_0xaa41('0xf')][_0xaa41('0x18')]=function(_0x538e17){var _0x411192=this;var _0x48c11f=this[_0xaa41('0x15')][_0x538e17[_0xaa41('0x13b')]];if(_0x48c11f){if(_0x48c11f[_0xaa41('0x13c')]&&this[_0xaa41('0x16')][_0x48c11f[_0xaa41('0x13c')]]){ut[_0xaa41('0x13d')](_0x48c11f,this['agents'][_0x48c11f['lookAgent']][_0xaa41('0x2a')],this['agents'][_0x48c11f[_0xaa41('0x13c')]]['id']);}var _0x3f8296=_[_0xaa41('0x13e')](_0x48c11f);_0x3f8296[_0xaa41('0x13f')]=moment()[_0xaa41('0x59')](_0xaa41('0x8c'));var _0x422838=_0x411192[_0xaa41('0x27')][_0x48c11f[_0xaa41('0x6b')]];if(ut[_0xaa41('0x140')](_0x538e17[_0xaa41('0x141')])){if(_0x48c11f[_0xaa41('0xac')]){rpcDb[_0xaa41('0x114')](_0x48c11f[_0xaa41('0xaf')]);}if(_0x48c11f['activeContact']){rpcDb[_0xaa41('0x8a')](_0x48c11f['idContact']);}ami[_0xaa41('0x5b')]('custom:agentringnoanswer',ut[_0xaa41('0x9f')](_0x48c11f,_0xaa41('0x142'),this[_0xaa41('0x27')][_0x48c11f[_0xaa41('0x6b')]]));this[_0xaa41('0xf2')](_0x3f8296,_0x422838,_0x538e17);}else{_0x48c11f[_0xaa41('0x8b')]=moment()[_0xaa41('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xaa41('0xf8')](_0x3f8296,0x4,'Answer');rpcDb['createAgentHistory'](_0x3f8296,_0xaa41('0x143'));}}};Preview[_0xaa41('0xf')]['syncHangup']=function(_0x2c4930){var _0x1285ed=this;var _0x57b75c=this[_0xaa41('0x15')][_0x2c4930[_0xaa41('0xad')]];var _0x3f5b34;if(_0x57b75c){_0x3f5b34=this['campaignsPreview'][_0x57b75c[_0xaa41('0x6b')]];logger['info'](_0xaa41('0x144'),_0x2c4930[_0xaa41('0xad')],_0xaa41('0xef'),_0x3f5b34[_0xaa41('0x2a')],'pTalking:\x20',_0x3f5b34[_0xaa41('0x2e')]);}if(this[_0xaa41('0x15')][_0x2c4930[_0xaa41('0xad')]]&&_0x2c4930['linkedid']!==_0x2c4930[_0xaa41('0xb3')]){if(_0x2c4930[_0xaa41('0x145')]==='16'&&this[_0xaa41('0x15')][_0x2c4930[_0xaa41('0xad')]][_0xaa41('0x78')]){this[_0xaa41('0x9a')](_0x2c4930,_0x2c4930[_0xaa41('0xad')],_0x2c4930[_0xaa41('0x145')]);}else if(this['actions'][_0x2c4930[_0xaa41('0xad')]]['dialAnswer']){logger[_0xaa41('0x57')](_0xaa41('0x146'),_0x2c4930[_0xaa41('0xad')],_0x2c4930[_0xaa41('0x145')],_0xaa41('0xef'),_0x3f5b34[_0xaa41('0x2a')],_0xaa41('0x6d'),_0x3f5b34[_0xaa41('0x2e')]);this[_0xaa41('0x9a')](_0x2c4930,_0x2c4930[_0xaa41('0xad')],_0x2c4930[_0xaa41('0x145')]);}}else if(_0x57b75c&&_[_0xaa41('0x68')](_0x57b75c[_0xaa41('0x147')])&&_0x3f5b34['dialQueueProject']&&_0x2c4930[_0xaa41('0xad')]===_0x2c4930[_0xaa41('0xb3')]&&_[_0xaa41('0x68')](_0x2c4930[_0xaa41('0xf5')])&&_0x2c4930[_0xaa41('0x145')]==='16'&&_0x2c4930[_0xaa41('0x148')]==='6'&&_[_0xaa41('0xf3')](_0x57b75c[_0xaa41('0x149')])){if(_0x57b75c[_0xaa41('0xac')]){rpcDb['unlockContact'](_0x57b75c[_0xaa41('0xaf')]);}if(_0x57b75c[_0xaa41('0xc5')]){rpcDb[_0xaa41('0x8a')](_0x57b75c[_0xaa41('0xaf')]);}_0x2c4930[_0xaa41('0xf5')]='22';this[_0xaa41('0xf2')](_0x57b75c,_0x3f5b34,_0x2c4930);}else if(_0x57b75c&&_0x57b75c[_0xaa41('0x149')]){if(_0x2c4930[_0xaa41('0x145')]==='16'&&this[_0xaa41('0x15')][_0x2c4930[_0xaa41('0xad')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x2c4930[_0xaa41('0xad')],_0x2c4930[_0xaa41('0x145')],'\x20Queue',_0x3f5b34[_0xaa41('0x2a')],_0xaa41('0x6d'),_0x3f5b34['pTalking']);this[_0xaa41('0x9a')](_0x2c4930,_0x2c4930['linkedid'],_0x2c4930[_0xaa41('0x145')]);}else if(this[_0xaa41('0x15')][_0x2c4930[_0xaa41('0xad')]][_0xaa41('0x78')]){logger[_0xaa41('0x57')]('[syncHangup][talking][cause]',_0x2c4930[_0xaa41('0xad')],_0x2c4930[_0xaa41('0x145')],_0xaa41('0xef'),_0x3f5b34['name'],'pTalking:\x20',_0x3f5b34[_0xaa41('0x2e')]);this[_0xaa41('0x9a')](_0x2c4930,_0x2c4930['linkedid'],_0x2c4930[_0xaa41('0x145')]);}}};Preview[_0xaa41('0xf')][_0xaa41('0x1f')]=function(_0x50fb42){if(this[_0xaa41('0x15')][_0x50fb42[_0xaa41('0xf1')]]&&_0x50fb42[_0xaa41('0xf1')]!==_0x50fb42['destuniqueid']){this[_0xaa41('0x9a')](_0x50fb42,_0x50fb42[_0xaa41('0xf1')],_0x50fb42['dialstatus']);}};Preview['prototype'][_0xaa41('0x1d')]=function(_0x4395a5){if(this[_0xaa41('0x15')][_0x4395a5[_0xaa41('0xad')]]&&_0x4395a5['linkedid']!==_0x4395a5[_0xaa41('0xb3')]&&!this[_0xaa41('0x15')][_0x4395a5['linkedid']][_0xaa41('0x78')]){if(_0x4395a5[_0xaa41('0x145')]==='1'){this[_0xaa41('0x9a')](_0x4395a5,_0x4395a5[_0xaa41('0xad')],_0x4395a5['cause']);}}};Preview[_0xaa41('0xf')][_0xaa41('0x14a')]=function(_0x10d9c8,_0xdcb33d,_0x28c7b7){if(this[_0xaa41('0x15')][_0x10d9c8]){if(_[_0xaa41('0x68')](this[_0xaa41('0x15')][_0x10d9c8][_0xaa41('0x14b')])){this[_0xaa41('0x15')][_0x10d9c8]['variables']={};}this[_0xaa41('0x15')][_0x10d9c8][_0xaa41('0x14b')][_0xdcb33d]=_0x28c7b7;}};Preview[_0xaa41('0xf')][_0xaa41('0x23')]=function(_0x4fb03){try{if(!_['isNil'](_0x4fb03)){if(ut[_0xaa41('0x14c')](_['keys'](_0x4fb03[_0xaa41('0x14d')])[0x0])){this['addVariable'](_0x4fb03['uniqueid'],_[_0xaa41('0x14e')](_0x4fb03['variable'])[0x0],_0x4fb03['value']);}}}catch(_0xdd3739){logger[_0xaa41('0x14f')](_0xaa41('0x150'),util[_0xaa41('0x151')](_0xdd3739,{'showHidden':![],'depth':null}));}};Preview[_0xaa41('0xf')][_0xaa41('0x152')]=function(_0x54d21b){if(_0x54d21b){if(this[_0xaa41('0x15')][_0x54d21b[_0xaa41('0x153')]]){this[_0xaa41('0x15')][_0x54d21b['transfertargetlinkedid']][_0xaa41('0x149')]=!![];}}};Preview['prototype'][_0xaa41('0x25')]=function(_0x132a87){if(_0x132a87){if(this[_0xaa41('0x15')][_0x132a87[_0xaa41('0x154')]]){this['actions'][_0x132a87['transfererlinkedid']][_0xaa41('0x149')]=!![];}}};module[_0xaa41('0x155')]=Preview; \ No newline at end of file +var _0x0faf=['answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','hasOwnProperty','booked','clockClearZombieChannels','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','verifyAdditionalPhones','dialNoAnswerMaxRetry','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','rescheduleContact','CANCEL','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectRetryFrequency','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','trim','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','variablesAction','[originated][increment]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy'];(function(_0x58701d,_0x337306){var _0x5b6b24=function(_0xbd45ad){while(--_0xbd45ad){_0x58701d['push'](_0x58701d['shift']());}};_0x5b6b24(++_0x337306);}(_0x0faf,0x132));var _0xf0fa=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x0faf[_0x164eca];return _0x2ce562;};'use strict';var util=require(_0xf0fa('0x0'));var _=require('lodash');var BPromise=require(_0xf0fa('0x1'));var uuid=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var md5=require(_0xf0fa('0x4'));var Redis=require(_0xf0fa('0x5'));var config=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var loggerAction=require(_0xf0fa('0x7'))('actionPreview');var ami=require(_0xf0fa('0x9'));var rpcDb=require(_0xf0fa('0xa'));var cmHopperAdditionalPhone=require(_0xf0fa('0xb'));var Action=require(_0xf0fa('0xc'));var ut=require(_0xf0fa('0xd'));config['redis']=_[_0xf0fa('0xe')](config[_0xf0fa('0xf')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf0fa('0xf')]));var Sequence=function(){};Sequence[_0xf0fa('0x10')][_0xf0fa('0x11')]=function(_0x1f3bb7){this[_0xf0fa('0x12')]=this[_0xf0fa('0x12')]?this[_0xf0fa('0x12')][_0xf0fa('0x13')](_0x1f3bb7):_0x1f3bb7();};function Preview(_0x5cf601){this[_0xf0fa('0x14')]=new Sequence();this['campaignsPreview']=_0x5cf601[_0xf0fa('0x15')];this['trunks']=_0x5cf601[_0xf0fa('0x16')];this[_0xf0fa('0x17')]={};this[_0xf0fa('0x18')]=_0x5cf601['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xf0fa('0x19'),this['syncOriginateResponse'][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1b'),this[_0xf0fa('0x1c')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1d'),this[_0xf0fa('0x1e')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1f'),this['syncDialEnd'][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x20'),this[_0xf0fa('0x21')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x22'),this[_0xf0fa('0x23')]['bind'](this));ami['on']('attendedtransfer',this[_0xf0fa('0x24')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x25'),this[_0xf0fa('0x26')][_0xf0fa('0x1a')](this));this[_0xf0fa('0x27')](this[_0xf0fa('0x28')]);}function emit(_0x3de639,_0x3b87a2,_0x15942b){io['to'](_0x3de639)[_0xf0fa('0x29')](_0x3b87a2,_0x15942b);}function emitCampaignPreview(_0x5bead8){if(_0x5bead8[_0xf0fa('0x2a')]===_0xf0fa('0x2b')){var _0x39e82d={'id':_0x5bead8['id'],'name':_0x5bead8[_0xf0fa('0x2c')],'strategy':_0x5bead8[_0xf0fa('0x2d')],'answered':_0x5bead8[_0xf0fa('0x2e')],'available':_0x5bead8[_0xf0fa('0x2f')],'loggedIn':_0x5bead8[_0xf0fa('0x30')],'pTalking':_0x5bead8[_0xf0fa('0x31')],'sumBillable':_0x5bead8['sumBillable'],'sumDuration':_0x5bead8[_0xf0fa('0x32')],'sumHoldTime':_0x5bead8[_0xf0fa('0x33')]||0x0,'talking':_0x5bead8['talking'],'total':_0x5bead8[_0xf0fa('0x34')],'type':_0x5bead8[_0xf0fa('0x2a')],'unmanaged':_0x5bead8[_0xf0fa('0x35')],'abandoned':_0x5bead8['abandoned'],'waiting':_0x5bead8[_0xf0fa('0x36')],'loggedInDb':_0x5bead8[_0xf0fa('0x37')],'dialActive':_0x5bead8[_0xf0fa('0x38')],'dialMethod':_0x5bead8[_0xf0fa('0x39')],'dialOriginateCallerIdName':_0x5bead8['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5bead8['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5bead8[_0xf0fa('0x3a')],'dialPrefix':_0x5bead8[_0xf0fa('0x3b')],'outboundAnswerAgiCallsDay':_0x5bead8[_0xf0fa('0x3c')],'outboundAnswerCallsDay':_0x5bead8[_0xf0fa('0x3d')],'outboundBlacklistCallsDay':_0x5bead8['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5bead8[_0xf0fa('0x3e')],'outboundCongestionCallsDay':_0x5bead8[_0xf0fa('0x3f')],'outboundDropCallsDayACS':_0x5bead8[_0xf0fa('0x40')],'outboundDropCallsDayCallersExit':_0x5bead8['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5bead8[_0xf0fa('0x41')],'outboundNoAnswerCallsDay':_0x5bead8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5bead8[_0xf0fa('0x42')],'outboundOriginateFailureCallsDay':_0x5bead8[_0xf0fa('0x43')],'outboundReCallsDay':_0x5bead8[_0xf0fa('0x44')],'outboundRejectCallsDay':_0x5bead8['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5bead8[_0xf0fa('0x45')],'outboundAbandonedCallsDay':_0x5bead8[_0xf0fa('0x46')],'predictiveIntervalAnsweredCalls':_0x5bead8[_0xf0fa('0x47')],'predictiveIntervalAvgHoldtime':_0x5bead8[_0xf0fa('0x48')],'predictiveIntervalAvgTalktime':_0x5bead8[_0xf0fa('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x5bead8[_0xf0fa('0x4a')],'predictiveIntervalDroppedCallsTimeout':_0x5bead8['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5bead8['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5bead8[_0xf0fa('0x4b')],'predictiveIntervalHitRate':_0x5bead8[_0xf0fa('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x5bead8['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5bead8[_0xf0fa('0x4d')],'predictiveIntervalAvailable':_0x5bead8['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5bead8['predictiveIntervalTotalCalls'],'message':_0x5bead8['message'],'originated':_0x5bead8[_0xf0fa('0x4e')],'erlangCalls':_0x5bead8['erlangCalls'],'erlangCallToSecond':_0x5bead8[_0xf0fa('0x4f')],'erlangAbandonmentRate':_0x5bead8[_0xf0fa('0x50')],'erlangBusyFactor':_0x5bead8[_0xf0fa('0x51')],'startPredictive':_0x5bead8[_0xf0fa('0x52')],'startProgressive':_0x5bead8[_0xf0fa('0x53')]};if(_0x5bead8[_0xf0fa('0x54')]){_0x39e82d[_0xf0fa('0x54')]={'id':_0x5bead8[_0xf0fa('0x54')]['id'],'name':_0x5bead8['Trunk'][_0xf0fa('0x2c')],'active':_0x5bead8[_0xf0fa('0x54')][_0xf0fa('0x55')],'callerid':_0x5bead8['Trunk'][_0xf0fa('0x56')]};}if(_0x5bead8[_0xf0fa('0x57')]){_0x39e82d[_0xf0fa('0x57')]={'id':_0x5bead8[_0xf0fa('0x57')]['id'],'name':_0x5bead8['Interval']['name']};}var _0x2a9f4b=md5(JSON[_0xf0fa('0x58')](_0x39e82d));if(_0x5bead8[_0xf0fa('0x4')]!==_0x2a9f4b){_0x5bead8[_0xf0fa('0x4')]=_0x2a9f4b;emit(util[_0xf0fa('0x59')]('voice:queue:%s',_0x39e82d['name']),'voice_queue:save',_0x39e82d);}}}function emitVoiceQueueChannelRemove(_0x596c2a){logger[_0xf0fa('0x5a')](_0xf0fa('0x5b'),JSON['stringify'](_0x596c2a));emit(util['format'](_0xf0fa('0x5c'),_0x596c2a[_0xf0fa('0x2c')]),_0xf0fa('0x5d'),_0x596c2a);io[_0xf0fa('0x29')](_0xf0fa('0x5e'),_0x596c2a);}function notSendMessagesQueue(_0x12bd8c){if(_0x12bd8c[_0xf0fa('0x5f')]){if(_0x12bd8c['originated']===0x0&&_0x12bd8c['pTalking']===0x0){_0x12bd8c[_0xf0fa('0x5f')]=![];_0x12bd8c[_0xf0fa('0x2f')]=0x0;_0x12bd8c[_0xf0fa('0x60')]=0x0;_0x12bd8c[_0xf0fa('0x61')]=_0xf0fa('0x62');ut[_0xf0fa('0x63')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x12bd8c[_0xf0fa('0x2c')]+'\x20is\x20not\x20active');}else{_0x12bd8c[_0xf0fa('0x61')]=_0xf0fa('0x64');ut[_0xf0fa('0x63')](_0xf0fa('0x65'),_0x12bd8c[_0xf0fa('0x2c')]+_0xf0fa('0x66'));}emitCampaignPreview(_0x12bd8c);}}Preview[_0xf0fa('0x10')][_0xf0fa('0x27')]=function(){var _0x2fc4b1=this;setInterval(function(){_0x2fc4b1['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x304bae=this[_0xf0fa('0x28')];this['clockClearZombieChannels']+=0x1;for(var _0x2a443a in _0x304bae){if(_0x304bae[_0xf0fa('0x67')](_0x2a443a)&&(_0x304bae[_0x2a443a][_0xf0fa('0x39')]===_0xf0fa('0x8')||_0x304bae[_0x2a443a]['dialMethod']===_0xf0fa('0x68'))&&_0x304bae[_0x2a443a][_0xf0fa('0x2a')]===_0xf0fa('0x2b')){if(this[_0xf0fa('0x69')]>0x7){this[_0xf0fa('0x69')]=0x0;this[_0xf0fa('0x6a')]();}}if(_0x304bae[_0xf0fa('0x67')](_0x2a443a)&&_0x304bae[_0x2a443a][_0xf0fa('0x39')]===_0xf0fa('0x8')&&_0x304bae[_0x2a443a]['type']===_0xf0fa('0x2b')){if(_0x304bae[_0x2a443a][_0xf0fa('0x38')]){this[_0xf0fa('0x6b')](_0x304bae[_0x2a443a]);if(_0x304bae[_0x2a443a][_0xf0fa('0x6c')])this[_0xf0fa('0x6d')](_0x304bae[_0x2a443a]);}else{notSendMessagesQueue(_0x304bae[_0x2a443a]);}}}};Preview[_0xf0fa('0x10')]['clearZombieChannel']=function(_0xd86643){var _0x24ae8a=this;this['sequence'][_0xf0fa('0x11')](function(){if(!_[_0xf0fa('0x6e')](_0x24ae8a[_0xf0fa('0x17')][_0xd86643])){loggerAction[_0xf0fa('0x5a')](_0xf0fa('0x6f'),_0xd86643,_0xf0fa('0x70'),_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x71')],_0xf0fa('0x72'),JSON['stringify'](_0x24ae8a[_0xf0fa('0x28')][_0x24ae8a['actions'][_0xd86643][_0xf0fa('0x71')]][_0xf0fa('0x4e')]),_0xf0fa('0x73'),JSON['stringify'](_0x24ae8a[_0xf0fa('0x28')][_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x71')]][_0xf0fa('0x31')]),JSON[_0xf0fa('0x58')](_0x24ae8a['actions'][_0xd86643][_0xf0fa('0x74')]),JSON['stringify'](_[_0xf0fa('0x75')](_0x24ae8a[_0xf0fa('0x17')][_0xd86643],[_0xf0fa('0x76'),_0xf0fa('0x77'),_0xf0fa('0x78'),'ListId'])));return ami[_0xf0fa('0x79')]({'action':_0xf0fa('0x7a'),'channel':_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x7b')]})[_0xf0fa('0x7c')](function(_0x29f3d0){if(_0x29f3d0['message']===_0xf0fa('0x7d')){setTimeout(function(){if(_0x24ae8a['actions'][_0xd86643]){ut['updateOriginated'](_0x24ae8a['campaignsPreview'][_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x71')]],_0xf0fa('0x7e'));if(_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x74')]===!![]){ut[_0xf0fa('0x7f')](_0x24ae8a[_0xf0fa('0x28')][_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x71')]],'[clearZombieChannel]');ut[_0xf0fa('0x80')]('[Dialer][checkChannel][pTalking][Preview]'+_0xd86643,_0x24ae8a[_0xf0fa('0x17')][_0xd86643][_0xf0fa('0x71')]);}ut[_0xf0fa('0x80')](_0xf0fa('0x81')+_0xd86643,_0x24ae8a['actions'][_0xd86643][_0xf0fa('0x71')]);delete _0x24ae8a['actions'][_0xd86643];}},0x2328);}});}});};Preview[_0xf0fa('0x10')][_0xf0fa('0x6a')]=function(){var _0x10b45c=this;loggerAction[_0xf0fa('0x5a')](_0xf0fa('0x82'),_[_0xf0fa('0x83')](this['actions']));for(var _0x203205 in this[_0xf0fa('0x17')]){if(_0x10b45c['actions'][_0xf0fa('0x67')](_0x203205)){_0x10b45c[_0xf0fa('0x84')](_0x203205);}}};Preview['prototype'][_0xf0fa('0x6d')]=function(_0x2857ae){var _0x57dccd=this;rpcDb[_0xf0fa('0x85')](_0x2857ae['id'],ut[_0xf0fa('0x86')](this[_0xf0fa('0x18')]))['then'](function(_0x2a3b50){if(!_[_0xf0fa('0x6e')](_0x2a3b50)){for(var _0x480dc0=0x0;_0x480dc0<_0x2a3b50[_0xf0fa('0x87')];_0x480dc0+=0x1){if(ut[_0xf0fa('0x88')](_0x2a3b50[_0x480dc0][_0xf0fa('0x89')])<_0x2857ae['dialRecallMeTimeout']*0x3c){if(_0x2a3b50[_0x480dc0][_0xf0fa('0x8a')]&&!_0x2a3b50[_0x480dc0][_0xf0fa('0x8a')]['voicePause']){_0x57dccd[_0xf0fa('0x8b')](_0x2a3b50[_0x480dc0]['id'])[_0xf0fa('0x8c')](ut[_0xf0fa('0x8d')](_0xf0fa('0x8e')))[_0xf0fa('0x7c')](ut[_0xf0fa('0x8d')](_0xf0fa('0x8e')));}else{rpcDb[_0xf0fa('0x8f')](_0x2a3b50[_0x480dc0]['id']);}}else{var _0x32c846=new Action(_0x2a3b50[_0x480dc0],_0x2857ae);_0x32c846[_0xf0fa('0x90')]=moment()['format'](_0xf0fa('0x91'));_0x2857ae[_0xf0fa('0x44')]+=0x1;ut[_0xf0fa('0x92')](_0x32c846,0x17,_0xf0fa('0x93'));if(_0x2857ae[_0xf0fa('0x94')]){rpcDb[_0xf0fa('0x95')](ut[_0xf0fa('0x96')](_0x2a3b50[_0x480dc0]));rpcDb['createCustomerHistory'](_0x32c846,_0xf0fa('0x97'));}else{ut[_0xf0fa('0x92')](_0x32c846,0x16,_0xf0fa('0x98'));rpcDb[_0xf0fa('0x99')](_0x32c846,_0xf0fa('0x9a'));rpcDb[_0xf0fa('0x9b')](_0x32c846,_0xf0fa('0x9a'));}}}}})['catch'](ut[_0xf0fa('0x8d')](_0xf0fa('0x9c')));};Preview[_0xf0fa('0x10')][_0xf0fa('0x6b')]=function(_0x473e3d){_0x473e3d['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x473e3d['loggedIn'])){_0x473e3d[_0xf0fa('0x61')]=_0xf0fa('0x9d');}else if(!ut[_0xf0fa('0x9e')](_0x473e3d[_0xf0fa('0x38')])){_0x473e3d['message']='NOT_ACTIVE';}else if(!this[_0xf0fa('0x9f')](_0x473e3d['Trunk'])){if(!this[_0xf0fa('0x9f')](_0x473e3d[_0xf0fa('0xa0')])){_0x473e3d[_0xf0fa('0x61')]=_0xf0fa('0xa1');}else{_0x473e3d[_0xf0fa('0x61')]='ACTIVE';}}else{_0x473e3d[_0xf0fa('0x61')]=_0xf0fa('0xa2');}emitCampaignPreview(_0x473e3d);};Preview[_0xf0fa('0x10')][_0xf0fa('0xa3')]=function(_0x3e3f6b,_0x43bad2,_0x30f0fe){var _0x35e7e7=this;var _0x10ddfb=this['actions'][_0x43bad2];var _0x5b166d=this[_0xf0fa('0x28')][_0x10ddfb['queue']];var _0x17d7a4;var _0x583a0b=![];var _0x4b3cb6=0x2;var _0x4a851b=0x3;if(_0x5b166d){switch(_0x30f0fe){case'1':_0x5b166d[_0xf0fa('0x42')]+=0x1;_0x10ddfb[_0xf0fa('0xa4')]+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut[_0xf0fa('0xa6')](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0x0,_0xf0fa('0xa7'));ami[_0xf0fa('0x29')](_0xf0fa('0xa8'),ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xaa')));rpcDb['createCustomerHistory'](_0x10ddfb,_0xf0fa('0xab'));_0x35e7e7['verifyAdditionalPhones'](_0x10ddfb,'0',_0x5b166d)[_0xf0fa('0x8c')](function(_0x56c701){_0x583a0b=_0x56c701[_0xf0fa('0xac')]==0x1;_0x4b3cb6=_0x5b166d['dialNoSuchNumberRetryFrequency'];_0x4a851b=_0x5b166d[_0xf0fa('0xad')];if(!_0x583a0b){if(ut['totalGlobal'](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0xf,_0xf0fa('0xb0'));rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xb1'));}else{if(_0x10ddfb['countnosuchnumberretry']>=_0x5b166d['dialNoSuchNumberMaxRetry']){rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x10ddfb,_0xf0fa('0xa4'),_0x5b166d[_0xf0fa('0xb2')]),_0x10ddfb[_0xf0fa('0xb3')],_0x10ddfb[_0xf0fa('0xb4')]);}}delete this[_0xf0fa('0x17')][_0x3e3f6b['linkedid']];}else{_0x10ddfb[_0xf0fa('0xa4')]++;logger[_0xf0fa('0x5a')](_0xf0fa('0xb5'),_0x10ddfb['countnosuchnumberretry']);logger['info']('id',_0x10ddfb[_0xf0fa('0xb6')]);_0x35e7e7[_0xf0fa('0xb7')]({'id':_0x10ddfb['idContact'],'field':{'countnosuchnumberretry':_0x10ddfb['countnosuchnumberretry']}})[_0xf0fa('0x8c')](function(){_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});break;case'ANSWER':var _0x5cdd16=moment()['format'](_0xf0fa('0x91'));_0x10ddfb['responsetime']=_0x5cdd16;_0x10ddfb['answertime']=_0x5cdd16;_0x10ddfb[_0xf0fa('0x74')]=!![];_0x5b166d[_0xf0fa('0x31')]+=0x1;logger[_0xf0fa('0x5a')](_0xf0fa('0xb9'),_0x10ddfb[_0xf0fa('0xba')],_0xf0fa('0xbb'),_0x5b166d['name'],_0xf0fa('0x73'),_0x5b166d[_0xf0fa('0x31')]);ami[_0xf0fa('0x29')]('custom:agentconnect',ut[_0xf0fa('0xa9')](_0x10ddfb,'connect',this['campaignsPreview'][_0x10ddfb[_0xf0fa('0x71')]]));if(_0x5b166d['acw']){ami['emit'](_0xf0fa('0xbc'),ut[_0xf0fa('0xbd')](_0x10ddfb));}break;case'16':ami[_0xf0fa('0x29')]('custom:agentcomplete',ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xbe'),this['campaignsPreview'][_0x10ddfb[_0xf0fa('0x71')]]));emitVoiceQueueChannelRemove(ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xbe')));_0x5b166d[_0xf0fa('0x3d')]+=0x1;_0x5b166d[_0xf0fa('0x34')]+=0x1;_0x5b166d[_0xf0fa('0x2e')]+=0x1;ut['decrementTalkink'](_0x5b166d,_0xf0fa('0xbf'));_0x10ddfb['countglobal']=ut[_0xf0fa('0xa6')](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0x4,_0xf0fa('0xc0'));rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xc1'));rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xc2'));rpcDb['crateCustomerReportQueue'](_0x10ddfb);_0x5b166d['sumDuration']+=_0x10ddfb[_0xf0fa('0xc3')];_0x5b166d[_0xf0fa('0xc4')]+=_0x10ddfb['talktime'];logger[_0xf0fa('0x5a')]('[syncHangup][talking][decrement]',_0x10ddfb['uniqueid'],_0xf0fa('0xbb'),_0x5b166d[_0xf0fa('0x2c')],'pTalking:\x20',_0x5b166d['pTalking']);delete this[_0xf0fa('0x17')][_0x3e3f6b[_0xf0fa('0xc5')]];break;case _0xf0fa('0xc6'):_0x5b166d[_0xf0fa('0x3e')]+=0x1;_0x10ddfb[_0xf0fa('0xc7')]+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut['totalGlobal'](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0x5,_0xf0fa('0xc8'));_0x4b3cb6=_0x5b166d['dialBusyRetryFrequency'];_0x4a851b=_0x5b166d[_0xf0fa('0xad')];ami['emit'](_0xf0fa('0xc9'),ut['buildObj'](_0x10ddfb,'busy'));rpcDb[_0xf0fa('0x99')](_0x10ddfb,'[callProgressDetectingCustomer][logBusy]');_0x35e7e7['verifyAdditionalPhones'](_0x10ddfb,'5',_0x5b166d)['then'](function(_0x590a5b){_0x583a0b=_0x590a5b[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut['totalGlobal'](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0xf,'Global');rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xca'));}else{if(_0x10ddfb[_0xf0fa('0xc7')]>=_0x5b166d[_0xf0fa('0xcb')]){rpcDb['createCustomerFinal'](_0x10ddfb,_0xf0fa('0xcc'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xcd')](_0x10ddfb,'countbusyretry',_0x5b166d[_0xf0fa('0xce')]),_0x10ddfb[_0xf0fa('0xb3')],_0x10ddfb[_0xf0fa('0xb4')]);}}}else{_0x10ddfb[_0xf0fa('0xc7')]++;_0x35e7e7['incrementPreviewCounters']({'id':_0x10ddfb['idContact'],'field':{'countbusyretry':_0x10ddfb[_0xf0fa('0xc7')]}})['then'](function(){_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});break;case _0xf0fa('0xcf'):_0x5b166d['outboundNoAnswerCallsDay']+=0x1;_0x10ddfb[_0xf0fa('0xd0')]+=0x1;_0x10ddfb['countglobal']=ut[_0xf0fa('0xa6')](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0x3,_0xf0fa('0xd1'));_0x4b3cb6=_0x5b166d['dialNoAnswerRetryFrequency'];_0x4a851b=_0x5b166d[_0xf0fa('0xad')];ami['emit'](_0xf0fa('0xd2'),ut[_0xf0fa('0xa9')](_0x10ddfb,'noanswer'));rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xd3'));_0x35e7e7[_0xf0fa('0xd4')](_0x10ddfb,'3',_0x5b166d)[_0xf0fa('0x8c')](function(_0x49c861){_0x583a0b=_0x49c861[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut['totalGlobal'](_0x10ddfb)>=_0x5b166d['dialGlobalMaxRetry']){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0xf,_0xf0fa('0xb0'));rpcDb['createCustomerFinal'](_0x17d7a4,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x10ddfb[_0xf0fa('0xd0')]>=_0x5b166d[_0xf0fa('0xd5')]){rpcDb['createCustomerFinal'](_0x10ddfb,_0xf0fa('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xcd')](_0x10ddfb,_0xf0fa('0xd0'),_0x5b166d['dialNoAnswerRetryFrequency']),_0x10ddfb['unlockAgent'],_0x10ddfb[_0xf0fa('0xb4')]);}}}else{_0x10ddfb['countnoanswerretry']++;_0x35e7e7[_0xf0fa('0xb7')]({'id':_0x10ddfb[_0xf0fa('0xb6')],'field':{'countnoanswerretry':_0x10ddfb[_0xf0fa('0xd0')]}})['then'](function(){_0x35e7e7['swapAdditionalPhones'](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});break;case'CONGESTION':_0x5b166d[_0xf0fa('0x3f')]+=0x1;_0x10ddfb[_0xf0fa('0xd6')]+=0x1;_0x10ddfb['countglobal']=ut[_0xf0fa('0xa6')](_0x10ddfb);ut['logCustomer'](_0x10ddfb,0x8,_0xf0fa('0xd7'));_0x4b3cb6=_0x5b166d[_0xf0fa('0xd8')];_0x4a851b=_0x5b166d[_0xf0fa('0xad')];ami[_0xf0fa('0x29')]('custom:agentcongestion',ut['buildObj'](_0x10ddfb,_0xf0fa('0xd9')));rpcDb['createCustomerHistory'](_0x10ddfb,_0xf0fa('0xda'));_0x35e7e7['verifyAdditionalPhones'](_0x10ddfb,'8',_0x5b166d)['then'](function(_0x1222fa){_0x583a0b=_0x1222fa['additional']==0x1;if(!_0x583a0b){if(ut['totalGlobal'](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut['cloneAction'](_0x10ddfb,0xf,'Global');rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xdb'));}else{if(_0x10ddfb['countcongestionretry']>=_0x5b166d[_0xf0fa('0xdc')]){rpcDb['createCustomerFinal'](_0x10ddfb,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xf0fa('0xdd')](ut['scheduledAt'](_0x10ddfb,'countcongestionretry',_0x5b166d[_0xf0fa('0xce')]),_0x10ddfb['unlockAgent'],_0x10ddfb[_0xf0fa('0xb4')]);}}}else{_0x10ddfb[_0xf0fa('0xd6')]++;_0x35e7e7['incrementPreviewCounters']({'id':_0x10ddfb[_0xf0fa('0xb6')],'field':{'countcongestionretry':_0x10ddfb[_0xf0fa('0xd6')]}})[_0xf0fa('0x8c')](function(){_0x35e7e7['swapAdditionalPhones'](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});break;case _0xf0fa('0xde'):_0x5b166d['outboundRejectCallsDay']+=0x1;_0x10ddfb['countagentrejectretry']+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut['totalGlobal'](_0x10ddfb);ut['logCustomer'](_0x10ddfb,0x14,_0xf0fa('0xdf'));_0x4b3cb6=_0x5b166d['dialAgentRejectRetryFrequency'];_0x4a851b=_0x5b166d['callAdditionalPhoneAfterMin'];ami[_0xf0fa('0x29')]('custom:agentreject',ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xe0')));rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xe1'));_0x35e7e7[_0xf0fa('0xd4')](_0x10ddfb,'20',_0x5b166d)['then'](function(_0x201f77){_0x583a0b=_0x201f77[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut[_0xf0fa('0xa6')](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0x14,_0xf0fa('0xdf'));rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xe2'));}else{if(_0x10ddfb['countagentrejectretry']>=_0x5b166d['dialAgentRejectMaxRetry']){rpcDb[_0xf0fa('0x9b')](_0x10ddfb,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xcd')](_0x10ddfb,_0xf0fa('0xe3'),_0x5b166d[_0xf0fa('0xe4')]),_0x10ddfb[_0xf0fa('0xb3')],_0x10ddfb[_0xf0fa('0xb4')]);}}}else{_0x10ddfb[_0xf0fa('0xd0')]++;_0x35e7e7[_0xf0fa('0xb7')]({'id':_0x10ddfb[_0xf0fa('0xb6')],'field':{'countnoanswerretry':_0x10ddfb['countnoanswerretry']}})['then'](function(){_0x35e7e7['swapAdditionalPhones'](_0x10ddfb,_0x4b3cb6,_0x4a851b)['then'](function(){});});}});break;case _0xf0fa('0xe5'):_0x5b166d[_0xf0fa('0x46')]+=0x1;_0x10ddfb['countabandonedretry']+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut[_0xf0fa('0xa6')](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x10ddfb,_0xf0fa('0xe6'));_0x35e7e7[_0xf0fa('0xd4')](_0x10ddfb,'11',_0x5b166d)[_0xf0fa('0x8c')](function(_0xdd318e){_0x583a0b=_0xdd318e[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut[_0xf0fa('0xa6')](_0x10ddfb)>=_0x5b166d['dialGlobalMaxRetry']){_0x17d7a4=ut['cloneAction'](_0x10ddfb,0xf,_0xf0fa('0xb0'));rpcDb['createCustomerFinal'](_0x17d7a4,_0xf0fa('0xe6'));}else{if(_0x10ddfb[_0xf0fa('0xe7')]>=_0x5b166d[_0xf0fa('0xe8')]){rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xe6'));}else{rpcDb[_0xf0fa('0xdd')](ut[_0xf0fa('0xcd')](_0x10ddfb,_0xf0fa('0xe9'),_0x5b166d[_0xf0fa('0xea')]),_0x10ddfb['unlockAgent'],_0x10ddfb[_0xf0fa('0xb4')]);}}}else{_0x10ddfb['countnoanswerretry']++;_0x35e7e7['incrementPreviewCounters']({'id':_0x10ddfb[_0xf0fa('0xb6')],'field':{'countnoanswerretry':_0x10ddfb[_0xf0fa('0xd0')]}})['then'](function(){_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});break;case'18':_0x5b166d['outboundUnknownCallsDay']+=0x1;_0x10ddfb[_0xf0fa('0xeb')]+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut[_0xf0fa('0xa6')](_0x10ddfb);ut['logCustomer'](_0x10ddfb,0x12,_0x3e3f6b[_0xf0fa('0xec')]||_0x3e3f6b[_0xf0fa('0xed')]);ami[_0xf0fa('0x29')]('custom:amd',ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xee')));rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xef'));_0x35e7e7[_0xf0fa('0xd4')](_0x10ddfb,'18',_0x5b166d)[_0xf0fa('0x8c')](function(_0x3cdfbb){_0x583a0b=_0x3cdfbb[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut[_0xf0fa('0xa6')](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0x12,_0xf0fa('0xb0'));rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xef'));}else{rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xef'));}}else{_0x10ddfb[_0xf0fa('0xd0')]++;_0x35e7e7[_0xf0fa('0xb7')]({'id':_0x10ddfb[_0xf0fa('0xb6')],'field':{'countnoanswerretry':_0x10ddfb[_0xf0fa('0xd0')]}})[_0xf0fa('0x8c')](function(){_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(){});});}});delete this['actions'][_0x3e3f6b['linkedid']];break;case'19':_0x5b166d[_0xf0fa('0x45')]+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut[_0xf0fa('0xa6')](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0x13,_0x3e3f6b[_0xf0fa('0xec')]||_0x3e3f6b[_0xf0fa('0xed')]);ami[_0xf0fa('0x29')](_0xf0fa('0xf0'),ut[_0xf0fa('0xa9')](_0x10ddfb,_0xf0fa('0xee')));rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xf1'));_0x35e7e7['verifyAdditionalPhones'](_0x10ddfb,'18',_0x5b166d)[_0xf0fa('0x8c')](function(_0x4c85b9){_0x583a0b=_0x4c85b9[_0xf0fa('0xac')]==0x1;if(!_0x583a0b){if(ut[_0xf0fa('0xa6')](_0x10ddfb)>=_0x5b166d['dialGlobalMaxRetry']){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0xf,_0xf0fa('0xb0'));rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xf1'));}else{rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xf1'));}}else{_0x10ddfb[_0xf0fa('0xd0')]++;_0x35e7e7['incrementPreviewCounters']({'id':_0x10ddfb['idContact'],'field':{'countnoanswerretry':_0x10ddfb[_0xf0fa('0xd0')]}})[_0xf0fa('0x8c')](function(){_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)['then'](function(){});});}});delete this[_0xf0fa('0x17')][_0x3e3f6b[_0xf0fa('0xc5')]];break;default:if(_0x10ddfb[_0xf0fa('0x74')]){ut[_0xf0fa('0x7f')](_0x5b166d,_0xf0fa('0xf2'));ut[_0xf0fa('0x80')](_0xf0fa('0xf3')+_0x5b166d[_0xf0fa('0x2c')],_0x3e3f6b);}_0x5b166d[_0xf0fa('0x45')]+=0x1;_0x10ddfb[_0xf0fa('0xa5')]=ut['totalGlobal'](_0x10ddfb);ut[_0xf0fa('0x92')](_0x10ddfb,0xc,_0x3e3f6b['cause-txt']||_0x3e3f6b[_0xf0fa('0xed')]);_0x4b3cb6=_0x5b166d[_0xf0fa('0xe4')];_0x4a851b=_0x5b166d[_0xf0fa('0xad')];rpcDb[_0xf0fa('0x99')](_0x10ddfb,_0xf0fa('0xf4'));_0x35e7e7[_0xf0fa('0xd4')](_0x10ddfb,'20',_0x5b166d)[_0xf0fa('0x8c')](function(_0x66bcd1){_0x583a0b=_0x66bcd1['additional']==0x1;if(!_0x583a0b){if(ut['totalGlobal'](_0x10ddfb)>=_0x5b166d[_0xf0fa('0xae')]){_0x17d7a4=ut[_0xf0fa('0xaf')](_0x10ddfb,0xf,_0xf0fa('0xb0'));rpcDb[_0xf0fa('0x9b')](_0x17d7a4,_0xf0fa('0xf5'));}else{rpcDb[_0xf0fa('0x9b')](_0x10ddfb,_0xf0fa('0xf5'));}delete this['actions'][_0x3e3f6b[_0xf0fa('0xc5')]];}else{_0x35e7e7[_0xf0fa('0xb8')](_0x10ddfb,_0x4b3cb6,_0x4a851b)[_0xf0fa('0x8c')](function(_0x477425){});}});}if(!(_0x10ddfb[_0xf0fa('0x74')]&&_0x30f0fe==='16')){ut[_0xf0fa('0xf6')](_0x5b166d,_0xf0fa('0xf7'));logger['info'](_0xf0fa('0xf8'),_0x10ddfb[_0xf0fa('0xba')],_0xf0fa('0xbb'),_0x5b166d[_0xf0fa('0x2c')],_0xf0fa('0x72'),_0x5b166d['originated']);}if(_0x30f0fe!==_0xf0fa('0xf9')){delete this['actions'][_0x3e3f6b[_0xf0fa('0xc5')]];delete this[_0xf0fa('0x17')][_0x3e3f6b[_0xf0fa('0xfa')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x43e603,_0x440b88,_0x4a3b7b){if(_[_0xf0fa('0xfb')](_0x440b88)&&'object'!==typeof _0x440b88){return;}if(_[_0xf0fa('0xfb')](_0x4a3b7b)&&_0xf0fa('0xfc')!==typeof _0x4a3b7b){return;}switch(_0x4a3b7b[_0xf0fa('0xfd')]){case'0':ut[_0xf0fa('0xfe')](_0x43e603,0x0,_0xf0fa('0xa7'));rpcDb[_0xf0fa('0xff')](_0x43e603,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xf0fa('0xfe')](_0x43e603,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x43e603,_0xf0fa('0x100'));break;case'5':ut[_0xf0fa('0xfe')](_0x43e603,0x5,'Busy');rpcDb[_0xf0fa('0xff')](_0x43e603,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xf0fa('0xfe')](_0x43e603,0x8,'Congestion');rpcDb['createAgentHistory'](_0x43e603,_0xf0fa('0x101'));break;case'22':ut[_0xf0fa('0xfe')](_0x43e603,0x16,_0xf0fa('0x102'));rpcDb[_0xf0fa('0xff')](_0x43e603,_0xf0fa('0x103'));break;default:ut[_0xf0fa('0xfe')](_0x43e603,0xc,_0x4a3b7b['reason']);rpcDb[_0xf0fa('0xff')](_0x43e603,_0xf0fa('0x101'));}ut[_0xf0fa('0xf6')](_0x440b88,_0xf0fa('0x104'));logger[_0xf0fa('0x5a')](_0xf0fa('0x105'),_0x43e603[_0xf0fa('0xba')],_0xf0fa('0xbb'),_0x440b88['name'],_0xf0fa('0x72'),_0x440b88[_0xf0fa('0x4e')]);delete this[_0xf0fa('0x17')][_0x43e603[_0xf0fa('0xba')]];};Preview[_0xf0fa('0x10')][_0xf0fa('0xd4')]=function(_0x133263,_0x616338,_0x114487){return BPromise[_0xf0fa('0x106')]()[_0xf0fa('0x8c')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x133263,_0x616338,_0x114487))[_0xf0fa('0x7c')](logger[_0xf0fa('0x5a')](_0xf0fa('0x107')));};Preview[_0xf0fa('0x10')][_0xf0fa('0xb8')]=function(_0x274f0d,_0x3daa6e,_0x85d258){return BPromise['resolve']()[_0xf0fa('0x8c')](cmHopperAdditionalPhone[_0xf0fa('0xb8')](_0x274f0d,_0x3daa6e,_0x85d258))[_0xf0fa('0x7c')](logger['info'](_0xf0fa('0x108')));};Preview[_0xf0fa('0x10')][_0xf0fa('0xb7')]=function(_0x4cf660){return BPromise[_0xf0fa('0x106')]()[_0xf0fa('0x8c')](cmHopperAdditionalPhone[_0xf0fa('0xb7')](_0x4cf660))['catch'](logger[_0xf0fa('0x5a')](_0xf0fa('0x109')));};Preview[_0xf0fa('0x10')][_0xf0fa('0x10a')]=function(_0x3e37c4,_0x405961,_0x2b4005,_0x5252e1,_0x5421b7){var _0x16c5bb=this;return new BPromise(function(_0x5d32f9,_0x10670e){if(_['isNil'](_0x405961)||_[_0xf0fa('0x6e')](_0x405961['Contact'])||_[_0xf0fa('0x6e')](_0x405961[_0xf0fa('0x10b')])||_[_0xf0fa('0x6e')](_0x405961[_0xf0fa('0x78')])){_0x10670e(ut['message'](_0xf0fa('0x10c'),_0x5252e1,_0x5421b7));return;}var _0x2d7355=uuid['v4']();var _0xf185c0=_0x16c5bb['campaignsPreview'][_0x405961['Queue']['name']];var _0x4f9374=_0x2b4005?_0x16c5bb[_0xf0fa('0x18')][_0x2b4005]['id']:undefined;_0x16c5bb['actions'][_0x2d7355]=new Action(_0x405961,_0xf185c0,_0x2d7355,_0x2b4005,_0x4f9374);var _0x5f1baa=_0x16c5bb[_0xf0fa('0x17')][_0x2d7355];_0x5f1baa[_0xf0fa('0xb3')]=_0x5252e1;_0x5f1baa[_0xf0fa('0xb4')]=_0x5421b7;_0x5f1baa[_0xf0fa('0x10d')]=_0x2b4005;if(_[_0xf0fa('0x10e')](_0x3e37c4)){_0x16c5bb[_0xf0fa('0x10f')](_0x5f1baa,_0xf185c0,_0x405961,_0x2b4005)['then'](function(_0x161278){logger[_0xf0fa('0x5a')](_0xf0fa('0x110'),_0xf0fa('0x111')+_0x5f1baa[_0xf0fa('0x71')]+_0xf0fa('0x112')+_0x5f1baa['idContact'],JSON[_0xf0fa('0x58')](_0x161278));ami['emit'](_0xf0fa('0x113'),ut[_0xf0fa('0xa9')](_0x5f1baa,_0xf0fa('0x114'),_0x16c5bb[_0xf0fa('0x28')][_0x5f1baa[_0xf0fa('0x71')]]));_0x5d32f9(ut[_0xf0fa('0x61')](_0xf0fa('0x115')));})['catch'](function(_0x105e8b){ut[_0xf0fa('0x63')](_0xf0fa('0x116'),_0x105e8b);_0x10670e(ut[_0xf0fa('0x61')](_0xf0fa('0x117'),_0x5252e1,_0x5421b7));});}else{_0xf185c0[_0xf0fa('0x118')]+=0x1;ut['logBlacklist'](_0x5f1baa);rpcDb[_0xf0fa('0x119')](_0x5f1baa,_0xf0fa('0x11a'));delete _0x16c5bb[_0xf0fa('0x17')][_0x2d7355];_0x10670e(ut[_0xf0fa('0x61')](_0xf0fa('0x11b'),_0x5252e1,_0x5421b7));}});};Preview[_0xf0fa('0x10')][_0xf0fa('0x9f')]=function(_0x1864a7){return!_[_0xf0fa('0x6e')](_0x1864a7)&&!_[_0xf0fa('0x6e')](_0x1864a7[_0xf0fa('0x2c')])&&!_[_0xf0fa('0x6e')](_0x1864a7[_0xf0fa('0x55')])&&_0x1864a7[_0xf0fa('0x55')]&&!_[_0xf0fa('0x6e')](this[_0xf0fa('0x16')][util['format'](_0xf0fa('0x11c'),_0x1864a7['name'])])&&!_[_0xf0fa('0x6e')](this[_0xf0fa('0x16')][util[_0xf0fa('0x59')](_0xf0fa('0x11c'),_0x1864a7[_0xf0fa('0x2c')])][_0xf0fa('0x7a')])&&(this[_0xf0fa('0x16')][util[_0xf0fa('0x59')](_0xf0fa('0x11c'),_0x1864a7['name'])][_0xf0fa('0x7a')]===_0xf0fa('0x11d')||this[_0xf0fa('0x16')][util[_0xf0fa('0x59')](_0xf0fa('0x11c'),_0x1864a7[_0xf0fa('0x2c')])]['status']===_0xf0fa('0x11e'));};Preview[_0xf0fa('0x10')][_0xf0fa('0x8b')]=function(_0x4192fd,_0x56795a){var _0x23b3e1=this;return new BPromise(function(_0x44693b,_0x19e118){_0x23b3e1['execRun'](_0x4192fd,_0x56795a)[_0xf0fa('0x8c')](function(_0x20a66f){_0x44693b(_[_0xf0fa('0x75')](_0x20a66f,[_0xf0fa('0x61')]));})[_0xf0fa('0x7c')](function(_0x507094){if(_0x507094[_0xf0fa('0x11f')]){rpcDb[_0xf0fa('0x120')](_0x4192fd);}if(_0x507094[_0xf0fa('0x55')]){rpcDb[_0xf0fa('0x8f')](_0x4192fd);}_0x19e118(_[_0xf0fa('0x75')](_0x507094,['message']));});});};Preview[_0xf0fa('0x10')][_0xf0fa('0x121')]=function(_0xf8b375,_0x47747a){var _0x2d3cea=this;return new BPromise(function(_0x1a6aee,_0x573dc4){var _0x2624ee,_0x4cfed1;rpcDb[_0xf0fa('0x122')](_0xf8b375)[_0xf0fa('0x8c')](function(_0x34de4b){if(!_[_0xf0fa('0x6e')](_0x34de4b[0x0])){_0x4cfed1=_0x34de4b[0x0][_0xf0fa('0x123')]?![]:!![];_0x2624ee=_0x34de4b[0x0][_0xf0fa('0x123')]?!![]:![];_0x2624ee=_0x47747a?!![]:_0x2624ee;}var _0xf57911=_0x2d3cea['validateContact'](_0x34de4b);if(_0xf57911[_0xf0fa('0x124')]){rpcDb[_0xf0fa('0x125')](_[_0xf0fa('0x75')](_0x34de4b[0x0],['VoiceQueueId',_0xf0fa('0x10b')]))['then'](function(_0x5bf496){_0x2d3cea['checkInBlack'](_0x5bf496,_0x34de4b[0x0],_0x47747a,_0x4cfed1,_0x2624ee)[_0xf0fa('0x8c')](function(_0x576bb3){_0x1a6aee(_0x576bb3);})[_0xf0fa('0x7c')](function(_0x26524d){_0x573dc4(_0x26524d);});})['catch'](function(_0x5ed5ec){ut[_0xf0fa('0x63')](_0xf0fa('0x126'),_0x5ed5ec);_0x573dc4(ut['message'](_0xf0fa('0x127'),_0x4cfed1,_0x2624ee));});}else{_0x573dc4(ut['message'](_0xf57911['message'],_0x4cfed1,_0x2624ee));}})[_0xf0fa('0x7c')](function(_0x432436){ut[_0xf0fa('0x63')](_0xf0fa('0x128'),_0x432436);_0x573dc4(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xf0fa('0x10')][_0xf0fa('0x129')]=function(_0x2fc1e6){if(_[_0xf0fa('0x6e')](_0x2fc1e6)||_[_0xf0fa('0x10e')](_0x2fc1e6)||!_['isNil'](_0x2fc1e6[0x0][_0xf0fa('0x8a')])&&_[_0xf0fa('0x6e')](_0x2fc1e6[0x0][_0xf0fa('0x8a')][_0xf0fa('0x2c')])){ut[_0xf0fa('0x63')](_0xf0fa('0x12a'),_0x2fc1e6);return{'isValid':![],'message':_0xf0fa('0x12b')};}var _0x2400de=this['campaignsPreview'][_0x2fc1e6[0x0][_0xf0fa('0x70')]['name']];_0x2400de['message']=_0xf0fa('0xa2');if(_[_0xf0fa('0x6e')](_0x2400de)){ut[_0xf0fa('0x63')](_0xf0fa('0x12c'),_0x2400de);return{'isValid':![],'message':_0xf0fa('0x12d')};}if(!this[_0xf0fa('0x9f')](_0x2400de['Trunk'])){ut[_0xf0fa('0x63')](_0xf0fa('0x12e'),_0xf0fa('0x12f')+_0x2400de[_0xf0fa('0x2c')]+_0xf0fa('0x130'));if(!this['isTrunkReachable'](_0x2400de[_0xf0fa('0xa0')])){ut['logger'](_0xf0fa('0x12e'),_0x2400de['name']+_0xf0fa('0x131'));return{'isValid':![],'message':_0xf0fa('0x132')};}}if(!ut['isActive'](_0x2400de[_0xf0fa('0x38')])){ut[_0xf0fa('0x63')](_0xf0fa('0x133'),_0x2400de[_0xf0fa('0x2c')]+_0xf0fa('0x134'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2400de[_0xf0fa('0x2c')]+_0xf0fa('0x134')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xf0fa('0x10')][_0xf0fa('0x10f')]=function(_0x118c09,_0x4b7137,_0x16b972,_0x21692c){var _0x4b0c11=this;return new BPromise(function(_0xac3e42,_0x5453b6){var _0x1d8b98=_0x118c09[_0xf0fa('0xba')];var _0x3bc07e=_0x4b0c11[_0xf0fa('0x9f')](_0x4b7137[_0xf0fa('0x54')])?util['format'](_0xf0fa('0x135'),_0x4b7137[_0xf0fa('0x54')]['name'],_['isNil'](_0x4b7137[_0xf0fa('0x3b')])?'':_0x4b7137[_0xf0fa('0x3b')]['trim']()||'',_0x4b7137[_0xf0fa('0x136')]>0x0?_0x16b972['phone']['substring'](_0x4b7137[_0xf0fa('0x136')]):_0x16b972[_0xf0fa('0x10b')]):util[_0xf0fa('0x59')]('SIP/%s/%s%s',_[_0xf0fa('0x6e')](_0x4b7137[_0xf0fa('0xa0')])?_0x4b7137[_0xf0fa('0x54')][_0xf0fa('0x2c')]:_0x4b7137[_0xf0fa('0xa0')]['name'],_['isNil'](_0x4b7137[_0xf0fa('0x3b')])?'':_0x4b7137['dialPrefix'][_0xf0fa('0x137')]()||'',_0x4b7137[_0xf0fa('0x136')]>0x0?_0x16b972[_0xf0fa('0x10b')][_0xf0fa('0x138')](_0x4b7137['dialCutDigit']):_0x16b972[_0xf0fa('0x10b')]);var _0x531113=_0x4b0c11[_0xf0fa('0x9f')](_0x4b7137['Trunk'])?ut['getCallerId'](_0x4b7137[_0xf0fa('0x54')][_0xf0fa('0x56')],_0x4b7137[_0xf0fa('0x139')],_0x4b7137[_0xf0fa('0x13a')]>0x0?ut[_0xf0fa('0x13b')](_0x4b7137['dialOriginateCallerIdNumber'],_0x4b7137[_0xf0fa('0x13a')]):_0x4b7137[_0xf0fa('0x13c')]):ut[_0xf0fa('0x13d')](_[_0xf0fa('0x6e')](_0x4b7137[_0xf0fa('0xa0')])?_0x4b7137[_0xf0fa('0x54')]['callerid']:_0x4b7137[_0xf0fa('0xa0')][_0xf0fa('0x56')],_0x4b7137[_0xf0fa('0x139')],_0x4b7137['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4b7137['dialOriginateCallerIdNumber'],_0x4b7137[_0xf0fa('0x13a')]):_0x4b7137[_0xf0fa('0x13c')]);if(_0x531113){_0x118c09[_0xf0fa('0x13e')]=ut[_0xf0fa('0x13f')](_0x531113);_0x118c09[_0xf0fa('0x140')]=ut['extractCalleridNumber'](_0x531113);}var _0x5ab2e5=ut[_0xf0fa('0x141')](_0x4b7137,_0x16b972,_0x3bc07e,_0x531113,_0x1d8b98,_0x118c09);_[_0xf0fa('0x142')](_0x118c09,ut['toLowerVariables'](_0x5ab2e5));_0x118c09[_0xf0fa('0x90')]=moment()[_0xf0fa('0x59')](_0xf0fa('0x91'));ami[_0xf0fa('0x79')](ut[_0xf0fa('0x143')](_0x118c09,_0x4b7137,_0x5ab2e5,_0x118c09[_0xf0fa('0xb4')],_0x21692c))[_0xf0fa('0x8c')](function(_0x2dc567){_0x4b7137[_0xf0fa('0x4e')]+=0x1;logger[_0xf0fa('0x5a')](_0xf0fa('0x144'),_0x1d8b98,'\x20Queue',_0x4b7137[_0xf0fa('0x2c')],_0xf0fa('0x72'),_0x4b7137[_0xf0fa('0x4e')]);_0xac3e42(_0x2dc567);})[_0xf0fa('0x7c')](function(_0x1a1fe9){ut[_0xf0fa('0xfe')](_0x118c09,0xe,'OriginateError');rpcDb[_0xf0fa('0xff')](_0x118c09,'[originateFailure][logOriginateFailure]');_0x5453b6(_0x1a1fe9);});});};Preview['prototype']['syncNewExten']=function(_0x4814bd){if(this[_0xf0fa('0x17')][_0x4814bd[_0xf0fa('0xc5')]]){this['actions'][_0x4814bd[_0xf0fa('0xc5')]][_0xf0fa('0x7b')]=_0x4814bd['channel'];}};Preview[_0xf0fa('0x10')]['syncOriginateResponse']=function(_0x1da66c){var _0x1fb65b=this;var _0x44988f=this[_0xf0fa('0x17')][_0x1da66c['actionid']];if(_0x44988f){if(_0x44988f['lookAgent']&&this[_0xf0fa('0x18')][_0x44988f[_0xf0fa('0x10d')]]){ut[_0xf0fa('0x145')](_0x44988f,this[_0xf0fa('0x18')][_0x44988f['lookAgent']][_0xf0fa('0x2c')],this['agents'][_0x44988f[_0xf0fa('0x10d')]]['id']);}var _0x20ab7d=_[_0xf0fa('0x146')](_0x44988f);_0x20ab7d['responsetime']=moment()[_0xf0fa('0x59')](_0xf0fa('0x91'));var _0x591ffb=_0x1fb65b[_0xf0fa('0x28')][_0x44988f['queue']];if(ut[_0xf0fa('0x147')](_0x1da66c[_0xf0fa('0x148')])){if(_0x44988f[_0xf0fa('0xb3')]){rpcDb['unlockContact'](_0x44988f[_0xf0fa('0xb6')]);}if(_0x44988f[_0xf0fa('0xb4')]){rpcDb[_0xf0fa('0x8f')](_0x44988f[_0xf0fa('0xb6')]);}ami[_0xf0fa('0x29')](_0xf0fa('0x149'),ut[_0xf0fa('0xa9')](_0x44988f,_0xf0fa('0x14a'),this[_0xf0fa('0x28')][_0x44988f['queue']]));this[_0xf0fa('0x14b')](_0x20ab7d,_0x591ffb,_0x1da66c);}else{_0x44988f[_0xf0fa('0x90')]=moment()['format'](_0xf0fa('0x91'));ut[_0xf0fa('0xfe')](_0x20ab7d,0x4,_0xf0fa('0xc0'));rpcDb[_0xf0fa('0xff')](_0x20ab7d,_0xf0fa('0x14c'));}}};Preview['prototype'][_0xf0fa('0x1c')]=function(_0x5b7840){var _0x47d348=this;var _0x1fc0b1=this[_0xf0fa('0x17')][_0x5b7840['linkedid']];var _0x637d10;if(_0x1fc0b1){_0x637d10=this['campaignsPreview'][_0x1fc0b1[_0xf0fa('0x71')]];logger[_0xf0fa('0x5a')](_0xf0fa('0x14d'),_0x5b7840[_0xf0fa('0xc5')],_0xf0fa('0xbb'),_0x637d10['name'],_0xf0fa('0x73'),_0x637d10['pTalking']);}if(this[_0xf0fa('0x17')][_0x5b7840[_0xf0fa('0xc5')]]&&_0x5b7840[_0xf0fa('0xc5')]!==_0x5b7840['uniqueid']){if(_0x5b7840[_0xf0fa('0x14e')]==='16'&&this['actions'][_0x5b7840[_0xf0fa('0xc5')]][_0xf0fa('0x74')]){this[_0xf0fa('0xa3')](_0x5b7840,_0x5b7840[_0xf0fa('0xc5')],_0x5b7840['cause']);}else if(this[_0xf0fa('0x17')][_0x5b7840['linkedid']][_0xf0fa('0x74')]){logger[_0xf0fa('0x5a')](_0xf0fa('0x14f'),_0x5b7840[_0xf0fa('0xc5')],_0x5b7840[_0xf0fa('0x14e')],_0xf0fa('0xbb'),_0x637d10[_0xf0fa('0x2c')],_0xf0fa('0x73'),_0x637d10[_0xf0fa('0x31')]);this[_0xf0fa('0xa3')](_0x5b7840,_0x5b7840['linkedid'],_0x5b7840['cause']);}}else if(_0x1fc0b1&&_[_0xf0fa('0x6e')](_0x1fc0b1[_0xf0fa('0x150')])&&_0x637d10[_0xf0fa('0x151')]&&_0x5b7840[_0xf0fa('0xc5')]===_0x5b7840['uniqueid']&&_[_0xf0fa('0x6e')](_0x5b7840[_0xf0fa('0xfd')])&&_0x5b7840[_0xf0fa('0x14e')]==='16'&&_0x5b7840['channelstate']==='6'&&_[_0xf0fa('0xfb')](_0x1fc0b1[_0xf0fa('0x152')])){if(_0x1fc0b1['unlockAgent']){rpcDb[_0xf0fa('0x120')](_0x1fc0b1[_0xf0fa('0xb6')]);}if(_0x1fc0b1[_0xf0fa('0xb4')]){rpcDb[_0xf0fa('0x8f')](_0x1fc0b1[_0xf0fa('0xb6')]);}_0x5b7840[_0xf0fa('0xfd')]='22';this['callProgressDetectingAgent'](_0x1fc0b1,_0x637d10,_0x5b7840);}else if(_0x1fc0b1&&_0x1fc0b1[_0xf0fa('0x152')]){if(_0x5b7840['cause']==='16'&&this[_0xf0fa('0x17')][_0x5b7840[_0xf0fa('0xc5')]]['dialAnswer']){logger[_0xf0fa('0x5a')](_0xf0fa('0x153'),_0x5b7840[_0xf0fa('0xc5')],_0x5b7840[_0xf0fa('0x14e')],_0xf0fa('0xbb'),_0x637d10[_0xf0fa('0x2c')],'pTalking:\x20',_0x637d10[_0xf0fa('0x31')]);this['callProgressDetectingCustomer'](_0x5b7840,_0x5b7840[_0xf0fa('0xc5')],_0x5b7840[_0xf0fa('0x14e')]);}else if(this[_0xf0fa('0x17')][_0x5b7840['linkedid']]['dialAnswer']){logger['info'](_0xf0fa('0x14f'),_0x5b7840['linkedid'],_0x5b7840[_0xf0fa('0x14e')],'\x20Queue',_0x637d10[_0xf0fa('0x2c')],'pTalking:\x20',_0x637d10[_0xf0fa('0x31')]);this[_0xf0fa('0xa3')](_0x5b7840,_0x5b7840['linkedid'],_0x5b7840['cause']);}}};Preview[_0xf0fa('0x10')][_0xf0fa('0x154')]=function(_0x4c8aa9){if(this[_0xf0fa('0x17')][_0x4c8aa9[_0xf0fa('0xfa')]]&&_0x4c8aa9[_0xf0fa('0xfa')]!==_0x4c8aa9[_0xf0fa('0x155')]){this[_0xf0fa('0xa3')](_0x4c8aa9,_0x4c8aa9[_0xf0fa('0xfa')],_0x4c8aa9[_0xf0fa('0xed')]);}};Preview[_0xf0fa('0x10')][_0xf0fa('0x1e')]=function(_0x2e983f){if(this['actions'][_0x2e983f[_0xf0fa('0xc5')]]&&_0x2e983f[_0xf0fa('0xc5')]!==_0x2e983f[_0xf0fa('0xba')]&&!this[_0xf0fa('0x17')][_0x2e983f[_0xf0fa('0xc5')]][_0xf0fa('0x74')]){if(_0x2e983f[_0xf0fa('0x14e')]==='1'){this[_0xf0fa('0xa3')](_0x2e983f,_0x2e983f[_0xf0fa('0xc5')],_0x2e983f['cause']);}}};Preview[_0xf0fa('0x10')]['addVariable']=function(_0x302bfd,_0x12d88f,_0x48eaa0){if(this[_0xf0fa('0x17')][_0x302bfd]){if(_[_0xf0fa('0x6e')](this[_0xf0fa('0x17')][_0x302bfd][_0xf0fa('0x156')])){this[_0xf0fa('0x17')][_0x302bfd]['variables']={};}this[_0xf0fa('0x17')][_0x302bfd]['variables'][_0x12d88f]=_0x48eaa0;}};Preview[_0xf0fa('0x10')][_0xf0fa('0x23')]=function(_0x19a71f){try{if(!_['isNil'](_0x19a71f)){if(ut[_0xf0fa('0x157')](_[_0xf0fa('0x158')](_0x19a71f['variable'])[0x0])){this['addVariable'](_0x19a71f[_0xf0fa('0xba')],_['keys'](_0x19a71f[_0xf0fa('0x159')])[0x0],_0x19a71f[_0xf0fa('0x15a')]);}}}catch(_0x4ee524){logger[_0xf0fa('0x15b')](_0xf0fa('0x15c'),util['inspect'](_0x4ee524,{'showHidden':![],'depth':null}));}};Preview[_0xf0fa('0x10')]['syncAttendedTransfer']=function(_0xf8fe4b){if(_0xf8fe4b){if(this['actions'][_0xf8fe4b[_0xf0fa('0x15d')]]){this[_0xf0fa('0x17')][_0xf8fe4b[_0xf0fa('0x15d')]]['transfer']=!![];}}};Preview[_0xf0fa('0x10')]['syncBlindTransfer']=function(_0x5c2e58){if(_0x5c2e58){if(this[_0xf0fa('0x17')][_0x5c2e58[_0xf0fa('0x15e')]]){this['actions'][_0x5c2e58[_0xf0fa('0x15e')]][_0xf0fa('0x152')]=!![];}}};module[_0xf0fa('0x15f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 46a9078..8e53cc1 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 _0xa5b9=['../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview'];(function(_0x397058,_0x2e041c){var _0x250198=function(_0x362b92){while(--_0x362b92){_0x397058['push'](_0x397058['shift']());}};_0x250198(++_0x2e041c);}(_0xa5b9,0x1e4));var _0x9a5b=function(_0x220f2a,_0x3f73b3){_0x220f2a=_0x220f2a-0x0;var _0x55be35=_0xa5b9[_0x220f2a];return _0x55be35;};'use strict';var util=require(_0x9a5b('0x0'));var BPromise=require(_0x9a5b('0x1'));var logger=require(_0x9a5b('0x2'))(_0x9a5b('0x3'));var _=require(_0x9a5b('0x4'));var cmHopper=require(_0x9a5b('0x5'));var cmHopperFinal=require(_0x9a5b('0x6'));var cmHopperHistory=require(_0x9a5b('0x7'));var cmHopperBlack=require(_0x9a5b('0x8'));var voiceQueueRt=require(_0x9a5b('0x9'));var agentReportPreview=require(_0x9a5b('0xa'));var voiceQueueReport=require(_0x9a5b('0xb'));function loggerCatch(_0x522465){return function(_0x306b1a){logger[_0x9a5b('0xc')](_0x522465,util[_0x9a5b('0xd')](_0x306b1a,{'showHidden':![],'depth':null}));};}function create(_0x1bbe33){return BPromise[_0x9a5b('0xe')]()['then'](cmHopperHistory['createHistory'](_0x1bbe33))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x10')));}function createAgent(_0x5651ce){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](agentReportPreview[_0x9a5b('0x12')](_0x5651ce))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x10')));}function moveContact(_0x19f4fe){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopper[_0x9a5b('0x13')](_0x19f4fe,!![]))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x14')));}exports[_0x9a5b('0x15')]=function(_0x1341de){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopperBlack[_0x9a5b('0x15')](_0x1341de))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x16')));};exports['getContactPreview']=function(_0x40bbc0){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopper[_0x9a5b('0x17')](_0x40bbc0))[_0x9a5b('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0x9a5b('0x12')]=function(_0x450396,_0x43d45b){create(_0x450396)[_0x9a5b('0xf')](loggerCatch(_0x43d45b));moveContact(_0x450396)[_0x9a5b('0xf')](loggerCatch(_0x43d45b));};exports[_0x9a5b('0x18')]=function(_0x3da620,_0x24309f){createAgent(_0x3da620)[_0x9a5b('0xf')](loggerCatch(_0x24309f));};exports[_0x9a5b('0x19')]=function(_0x236459,_0xf40748){create(_0x236459)[_0x9a5b('0xf')](loggerCatch(_0xf40748));};exports['createCustomerFinal']=function(_0x3d39af,_0x5bfe61){moveContact(_0x3d39af)[_0x9a5b('0xf')](loggerCatch(_0x5bfe61));};exports[_0x9a5b('0x1a')]=function(_0x5e6dc1,_0xab48d3,_0x49d96e){if(_0xab48d3){_0x5e6dc1['UserId']=null;}if(_0x49d96e){_0x5e6dc1['active']=![];}return BPromise['resolve']()['then'](cmHopper[_0x9a5b('0x1a')](_0x5e6dc1))[_0x9a5b('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x9a5b('0x1b')]=function(_0x3be7e9){return BPromise[_0x9a5b('0xe')]()['then'](cmHopper['countReScheduled'](_0x3be7e9))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x1c')));};exports['unlockContact']=function(_0x2409b6){return BPromise['resolve']()[_0x9a5b('0x11')](cmHopper[_0x9a5b('0x1d')]({'UserId':null},_0x2409b6,0x1))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x1e')));};exports['disableContact']=function(_0x1e5640){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopper[_0x9a5b('0x1d')]({'active':![]},_0x1e5640,0x1))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x1f')));};exports[_0x9a5b('0x20')]=function(_0x343732){var _0x39ca4d={};_0x39ca4d[_0x9a5b('0x21')]=_0x343732[_0x9a5b('0x21')];_0x39ca4d[_0x9a5b('0x22')]=_0x343732['uniqueid'];_0x39ca4d['calleridnum']=_0x343732['calleridnum'];_0x39ca4d[_0x9a5b('0x23')]=_0x343732[_0x9a5b('0x23')];_0x39ca4d['queue']=_0x343732['queue'];_0x39ca4d[_0x9a5b('0x24')]=_0x343732[_0x9a5b('0x25')];_0x39ca4d[_0x9a5b('0x26')]=_0x343732[_0x9a5b('0x25')];_0x39ca4d[_0x9a5b('0x27')]=0x1;_0x39ca4d[_0x9a5b('0x28')]=_0x343732[_0x9a5b('0x29')];_0x39ca4d[_0x9a5b('0x2a')]=_0x343732[_0x9a5b('0x2b')];_0x39ca4d[_0x9a5b('0x2c')]=_0x9a5b('0x2d');_0x39ca4d['exten']=_0x9a5b('0x2e');_0x39ca4d[_0x9a5b('0x2f')]=0x0;_0x39ca4d['assigned']=0x1;_0x39ca4d[_0x9a5b('0x30')]=_0x343732[_0x9a5b('0x2b')];_0x39ca4d[_0x9a5b('0x31')]='COMPLETED';return BPromise[_0x9a5b('0xe')]()['then'](voiceQueueReport[_0x9a5b('0x32')](_0x39ca4d))[_0x9a5b('0xf')](loggerCatch(_0x9a5b('0x33')));};exports[_0x9a5b('0x34')]=function(_0x1a3fc3,_0x25610d){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopper['getContactRecallMe'](_0x1a3fc3,_0x25610d))['catch'](loggerCatch(_0x9a5b('0x35')));};exports[_0x9a5b('0x36')]=function(_0x460699){return BPromise[_0x9a5b('0xe')]()[_0x9a5b('0x11')](cmHopper['rescheduleContact'](_0x460699,!![],!![]))[_0x9a5b('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x4075=['create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','../../../config/logger','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','countReScheduled','unlockContact','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','exten','xcally-motion-preview','holdtime','COMPLETED'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x4075,0xe5));var _0x5407=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x4075[_0x7dbd65];return _0x33d551;};'use strict';var util=require(_0x5407('0x0'));var BPromise=require('bluebird');var logger=require(_0x5407('0x1'))('preview');var _=require(_0x5407('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x5407('0x3'));var cmHopperHistory=require(_0x5407('0x4'));var cmHopperBlack=require(_0x5407('0x5'));var voiceQueueRt=require(_0x5407('0x6'));var agentReportPreview=require(_0x5407('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x24b639){return function(_0x51aba9){logger[_0x5407('0x8')](_0x24b639,util[_0x5407('0x9')](_0x51aba9,{'showHidden':![],'depth':null}));};}function create(_0x4b4c01){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopperHistory[_0x5407('0xc')](_0x4b4c01))[_0x5407('0xd')](loggerCatch(_0x5407('0xe')));}function createAgent(_0x18139b){return BPromise[_0x5407('0xa')]()['then'](agentReportPreview[_0x5407('0xc')](_0x18139b))['catch'](loggerCatch(_0x5407('0xe')));}function moveContact(_0x1aca95){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper[_0x5407('0xf')](_0x1aca95,!![]))[_0x5407('0xd')](loggerCatch(_0x5407('0x10')));}exports['checkIsBlackList']=function(_0x2646d3){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopperBlack[_0x5407('0x11')](_0x2646d3))[_0x5407('0xd')](loggerCatch(_0x5407('0x12')));};exports['getContactPreview']=function(_0x56d777){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper['getContactPreview'](_0x56d777))[_0x5407('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x5407('0xc')]=function(_0x4cba01,_0xb0c203){create(_0x4cba01)[_0x5407('0xd')](loggerCatch(_0xb0c203));moveContact(_0x4cba01)['catch'](loggerCatch(_0xb0c203));};exports[_0x5407('0x13')]=function(_0x7c4493,_0x36cc8a){createAgent(_0x7c4493)[_0x5407('0xd')](loggerCatch(_0x36cc8a));};exports[_0x5407('0x14')]=function(_0x1b2a44,_0x4525a3){create(_0x1b2a44)[_0x5407('0xd')](loggerCatch(_0x4525a3));};exports[_0x5407('0x15')]=function(_0x5b4e71,_0xfed547){moveContact(_0x5b4e71)[_0x5407('0xd')](loggerCatch(_0xfed547));};exports['rescheduleContact']=function(_0x59b3e7,_0x2d2423,_0x169926){if(_0x2d2423){_0x59b3e7[_0x5407('0x16')]=null;}if(_0x169926){_0x59b3e7['active']=![];}return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper[_0x5407('0x17')](_0x59b3e7))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x5f328a){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper[_0x5407('0x18')](_0x5f328a))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x5407('0x19')]=function(_0x42e3a6){return BPromise[_0x5407('0xa')]()['then'](cmHopper[_0x5407('0x19')]({'UserId':null},_0x42e3a6,0x1))[_0x5407('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x43a358){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper[_0x5407('0x19')]({'active':![]},_0x43a358,0x1))[_0x5407('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x1de614){var _0x38b79d={};_0x38b79d[_0x5407('0x1a')]=_0x1de614['type'];_0x38b79d['uniqueid']=_0x1de614['uniqueid'];_0x38b79d[_0x5407('0x1b')]=_0x1de614[_0x5407('0x1b')];_0x38b79d[_0x5407('0x1c')]=_0x1de614[_0x5407('0x1c')];_0x38b79d[_0x5407('0x1d')]=_0x1de614['queue'];_0x38b79d['queuecallerjoinAt']=_0x1de614[_0x5407('0x1e')];_0x38b79d[_0x5407('0x1f')]=_0x1de614['answertime'];_0x38b79d[_0x5407('0x20')]=0x1;_0x38b79d[_0x5407('0x21')]=_0x1de614[_0x5407('0x22')];_0x38b79d['connectedlinename']=_0x1de614[_0x5407('0x23')];_0x38b79d[_0x5407('0x24')]='from-sip';_0x38b79d[_0x5407('0x25')]=_0x5407('0x26');_0x38b79d[_0x5407('0x27')]=0x0;_0x38b79d['assigned']=0x1;_0x38b79d['lastAssignedTo']=_0x1de614[_0x5407('0x23')];_0x38b79d['queuecallerexitreason']=_0x5407('0x28');return BPromise['resolve']()[_0x5407('0xb')](voiceQueueReport[_0x5407('0x29')](_0x38b79d))['catch'](loggerCatch(_0x5407('0x2a')));};exports[_0x5407('0x2b')]=function(_0x3ef3d6,_0x3c5bc1){return BPromise[_0x5407('0xa')]()['then'](cmHopper[_0x5407('0x2b')](_0x3ef3d6,_0x3c5bc1))[_0x5407('0xd')](loggerCatch(_0x5407('0x2c')));};exports['rescheduleContactInQueue']=function(_0xb34e0a){return BPromise[_0x5407('0xa')]()[_0x5407('0xb')](cmHopper['rescheduleContact'](_0xb34e0a,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 7501e7c..07609b5 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 _0x2c81=['string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','voice','mandatoryDisposition','not_inuse','status','reachable','push','createBody','filterKey','uniqueid','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','error','logger2','message','isUndefined'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2c81,0x190));var _0x12c8=function(_0x281ee3,_0x3c3f1b){_0x281ee3=_0x281ee3-0x0;var _0x497c51=_0x2c81[_0x281ee3];return _0x497c51;};'use strict';var util=require('util');var _=require(_0x12c8('0x0'));var moment=require(_0x12c8('0x1'));var logger=require(_0x12c8('0x2'))(_0x12c8('0x3'));var ipAgi=process[_0x12c8('0x4')][_0x12c8('0x5')]||'127.0.0.1';function getSeconds(_0x5d82ea,_0x1bd321){var _0x51a638=moment(_0x5d82ea)[_0x12c8('0x6')](0x0);var _0x36cf9c=moment(_0x1bd321)['milliseconds'](0x0);return _0x51a638[_0x12c8('0x7')](_0x36cf9c,_0x12c8('0x8'));}exports[_0x12c8('0x9')]=function(_0x1bed07){return function(_0x581c3f){logger['error'](_0x1bed07,util[_0x12c8('0xa')](_0x581c3f,{'showHidden':![],'depth':null}));};};exports[_0x12c8('0xb')]=function(_0x54f825,_0x193ec1){logger[_0x12c8('0xc')](_0x54f825,util[_0x12c8('0xa')](_0x193ec1,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1ae0e4,_0x126e52){logger[_0x12c8('0xd')](_0x1ae0e4,util['inspect'](_0x126e52,{'showHidden':![],'depth':null}));};exports[_0x12c8('0xe')]=function(_0x81aaab){return function(_0xc94be4){logger[_0x12c8('0xc')](_0x81aaab,util[_0x12c8('0xa')](_0xc94be4,{'showHidden':![],'depth':null}));};};exports[_0x12c8('0xf')]=function(_0x528bd7,_0x31051b,_0x3bbbd1){return{'message':_0x528bd7,'unlock':_0x31051b,'active':_0x3bbbd1};};exports['getCallerId']=function(_0xd053b2,_0x3d2e04,_0xaa84d2){if(!_[_0x12c8('0x10')](_0xaa84d2)&&_0x12c8('0x11')===typeof _0xaa84d2&&!_[_0x12c8('0x12')](_0xaa84d2)){if(!_[_0x12c8('0x10')](_0x3d2e04)&&_0x12c8('0x11')===typeof _0x3d2e04&&!_[_0x12c8('0x12')](_0x3d2e04)){return util['format'](_0x12c8('0x13'),_0x3d2e04,_0xaa84d2);}return util[_0x12c8('0x14')](_0x12c8('0x13'),_0xaa84d2,_0xaa84d2);}if(!_['isUndefined'](_0xd053b2)&&_0x12c8('0x11')===typeof _0xd053b2&&!_[_0x12c8('0x12')](_0xd053b2)){return _0xd053b2;}return _0x12c8('0x15');};exports[_0x12c8('0x16')]=function(_0x1169ba){if(_[_0x12c8('0x17')](_0x1169ba)){return![];}return _0x1169ba;};exports['addVariables']=function(_0x374ec9,_0x2200d6,_0x501956,_0x132193,_0x2f98df,_0x836324){var _0x3f3a24={'XMD-QUEUE':_0x2200d6[_0x12c8('0x18')]?_0x2200d6[_0x12c8('0x18')][_0x12c8('0x19')]:'','XMD-CALLERID':_0x132193,'XMD-CALLERID-PREVIEW':_0x836324?util[_0x12c8('0x14')](_0x12c8('0x13'),_0x836324[_0x12c8('0x1a')],_0x836324[_0x12c8('0x1b')]):_0x132193,'XMD-DIALID':_0x2f98df,'XMD-CONTACTID':_0x2200d6['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x132193,'XMD-VOICEQUEUEID':_0x2200d6[_0x12c8('0x1c')],'XMD-DIALCHANNEL':_0x501956,'XMD-DIALTIMEOUT':_0x374ec9[_0x12c8('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x12c8('0x14')]('\x22rtTxX%s%s\x22',_0x374ec9[_0x12c8('0x1e')]?'g':'',_[_0x12c8('0x12')](_0x374ec9['monitor_format'])?'':_0x12c8('0x1f')),'XMD-DIALURL':_0x374ec9['dialPreviewUrl']||'','XMD-AGI':_0x374ec9[_0x12c8('0x20')]?util[_0x12c8('0x14')](_0x12c8('0x21'),ipAgi,_0x374ec9['dialQueueProject']):_0x12c8('0x22'),'XMD-AGIAFTER':_0x374ec9[_0x12c8('0x1e')]?util['format'](_0x12c8('0x21'),ipAgi,_0x374ec9[_0x12c8('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x836324?_0x836324[_0x12c8('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x836324?_0x836324[_0x12c8('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x12c8('0x25')};if(!_[_0x12c8('0x12')](_0x374ec9[_0x12c8('0x26')])){_0x3f3a24[util[_0x12c8('0x14')]('%s',_0x12c8('0x27'))]=_0x374ec9[_0x12c8('0x26')];_0x3f3a24[util[_0x12c8('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2f98df;}if(_0x2200d6&&_0x2200d6[_0x12c8('0x28')]){for(var _0x1a702b in _0x2200d6['Contact']){if(_0x2200d6[_0x12c8('0x28')][_0x12c8('0x29')](_0x1a702b)){if(!_['isNil'](_0x2200d6[_0x12c8('0x28')][_0x1a702b])&&_0x1a702b!=='id'&&_0x1a702b!==_0x12c8('0x2a')&&_0x1a702b!==_0x12c8('0x2b')&&_0x1a702b!==_0x12c8('0x2c')){_0x3f3a24[util['format'](_0x12c8('0x2d'),'XMD-',_['toUpper'](_0x1a702b))]=_0x2200d6[_0x12c8('0x28')][_0x1a702b];}}}}return _0x3f3a24;};exports[_0x12c8('0x2e')]=function(_0x5a9a1f){var _0x3b833e={};for(var _0x4a9335 in _0x5a9a1f){if(_0x5a9a1f[_0x12c8('0x29')](_0x4a9335)){_0x3b833e[util[_0x12c8('0x14')]('%s',_['toLower'](_0x4a9335))]=_0x5a9a1f[_0x4a9335];}}return{'variables':_0x3b833e};};exports['updateOriginated']=function(_0x525367,_0x7518cc){if(!_[_0x12c8('0x17')](_0x525367)){if(_0x525367[_0x12c8('0x29')](_0x12c8('0x2f'))){if(_0x525367['originated']>0x0){_0x525367[_0x12c8('0x2f')]-=0x1;}else{logger[_0x12c8('0xd')](_0x12c8('0x30'),_0x7518cc);}}}else{logger[_0x12c8('0xd')](_0x12c8('0x31'),_0x7518cc);}};exports['logBlacklist']=function(_0x9882f1){var _0x41cac9=moment()[_0x12c8('0x14')](_0x12c8('0x32'));_0x9882f1[_0x12c8('0x33')]=0xd;_0x9882f1[_0x12c8('0x34')]='Blacklist';_0x9882f1['starttime']=_0x41cac9;_0x9882f1[_0x12c8('0x35')]=_0x41cac9;_0x9882f1[_0x12c8('0x36')]=_0x41cac9;};exports[_0x12c8('0x37')]=function(_0x569747,_0x1d1325,_0x3c9373){var _0x2fe9fb=moment()[_0x12c8('0x14')](_0x12c8('0x32'));_0x569747[_0x12c8('0x33')]=_0x1d1325;_0x569747[_0x12c8('0x34')]=_0x3c9373;_0x569747[_0x12c8('0x35')]=_0x2fe9fb;_0x569747[_0x12c8('0x38')]=getSeconds(_0x569747[_0x12c8('0x35')],_0x569747[_0x12c8('0x39')]);};exports[_0x12c8('0x3a')]=function(_0x35fbb6,_0x15c5f9,_0x138b73){_0x35fbb6[_0x12c8('0x3b')]=_0x15c5f9;_0x35fbb6['UserId']=_0x138b73;};exports[_0x12c8('0x3c')]=function(_0x4bf871,_0x1f25d7,_0x3105ea){var _0x3fc236=moment()[_0x12c8('0x14')](_0x12c8('0x32'));_0x4bf871[_0x12c8('0x33')]=_0x1f25d7;_0x4bf871[_0x12c8('0x34')]=_0x3105ea;_0x4bf871[_0x12c8('0x35')]=_0x4bf871[_0x12c8('0x35')]?_0x4bf871[_0x12c8('0x35')]:_0x3fc236;_0x4bf871['endtime']=_0x4bf871[_0x12c8('0x36')]?_0x4bf871[_0x12c8('0x36')]:_0x3fc236;_0x4bf871[_0x12c8('0x38')]=getSeconds(_0x4bf871['responsetime']||0x0,_0x4bf871[_0x12c8('0x39')]||0x0);_0x4bf871[_0x12c8('0x3d')]=_0x4bf871[_0x12c8('0x3e')]?getSeconds(_0x4bf871[_0x12c8('0x36')],_0x4bf871['answertime']):0x0;};exports[_0x12c8('0x3f')]=function(_0x1f1e65){return _0x1f1e65===_0x12c8('0x40');};exports[_0x12c8('0x41')]=function(_0x1b0b32,_0x2c6eb3,_0x22f9b2,_0x1cdc9b,_0x1ee6bd){var _0xf2e646=_0x1cdc9b?_0x12c8('0x42'):_0x1b0b32[_0x12c8('0x1a')];_0xf2e646=_0x1ee6bd?_0x12c8('0x43'):_0xf2e646;return{'actionid':_0x1b0b32['uniqueid'],'action':'originate','channel':_0x1b0b32[_0x12c8('0x44')],'callerid':util[_0x12c8('0x14')](_0x12c8('0x13'),_0xf2e646,_0x1b0b32[_0x12c8('0x1b')]),'Exten':_0x12c8('0x45'),'Context':_0x12c8('0x46'),'Priority':'1','variable':_0x22f9b2,'timeout':(_0x2c6eb3[_0x12c8('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b0b32['uniqueid']};};exports[_0x12c8('0x48')]=function(_0x3bb728){return _0x3bb728[_0x12c8('0x49')]+_0x3bb728[_0x12c8('0x4a')]+_0x3bb728[_0x12c8('0x4b')]+_0x3bb728[_0x12c8('0x4c')]+_0x3bb728[_0x12c8('0x4d')];};exports['cloneAction']=function(_0x42af10){var _0x454dc0=_[_0x12c8('0x4e')](_0x42af10);_0x454dc0['state']=0xf;_0x454dc0[_0x12c8('0x34')]=_0x12c8('0x4f');return _0x454dc0;};exports[_0x12c8('0x50')]=function(_0x2b4624,_0x2d88e0,_0x326682){var _0x32d130={};_0x32d130[_0x2d88e0]=_0x2b4624[_0x2d88e0];_0x32d130[_0x12c8('0x51')]=![];_0x32d130[_0x12c8('0x52')]=moment()[_0x12c8('0x53')](_0x326682,_0x12c8('0x54'))[_0x12c8('0x14')](_0x12c8('0x32'));_0x32d130[_0x12c8('0x55')]=_0x2b4624['ContactId'];_0x32d130[_0x12c8('0x56')]=_0x2b4624['ListId'];_0x32d130[_0x12c8('0x1c')]=_0x2b4624[_0x12c8('0x1c')]||undefined;return _0x32d130;};exports['decrementTalkink']=function(_0x5aad6c,_0x188e2f){if(!_[_0x12c8('0x17')](_0x5aad6c)){if(_0x5aad6c[_0x12c8('0x57')]>0x0){_0x5aad6c[_0x12c8('0x57')]-=0x1;}else{logger[_0x12c8('0xd')](_0x188e2f,_0x12c8('0x58'));}}else{logger[_0x12c8('0xd')](_0x188e2f,_0x12c8('0x59'));}};exports[_0x12c8('0x5a')]=function(_0x517284){if(_0x517284<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1d2088,_0x416f5a,_0x494acb){_0x1d2088[_0x12c8('0x5b')]=_0x416f5a;_0x1d2088[_0x12c8('0x19')]=_0x1d2088[_0x12c8('0x5c')];_0x1d2088['interface']=_0x1d2088[_0x12c8('0x44')];_0x1d2088['motionChannel']=_0x12c8('0x5d');if(_0x494acb){_0x1d2088['mandatoryDisposition']=_0x494acb[_0x12c8('0x5e')];}return _0x1d2088;};exports['buildAcw']=function(_0x3c4874){var _0x2ef2fc={};_0x2ef2fc[_0x12c8('0x5c')]=_0x3c4874[_0x12c8('0x5c')];_0x2ef2fc['interface']=_0x3c4874[_0x12c8('0x44')];_0x2ef2fc['uniqueid']=_0x3c4874['uniqueid'];return _0x2ef2fc;};exports['agentReadyId']=function(_0x5b3e3f){var _0x510de5=[];for(var _0x835626 in _0x5b3e3f){if(_0x5b3e3f[_0x12c8('0x29')](_0x835626)){if(!_[_0x12c8('0x17')](_0x5b3e3f[_0x835626])&&_0x5b3e3f[_0x835626][_0x12c8('0x33')]===_0x12c8('0x5f')&&_0x5b3e3f[_0x835626][_0x12c8('0x60')]===_0x12c8('0x61')){_0x510de5[_0x12c8('0x62')](_0x5b3e3f[_0x835626]['id']);}}}return _0x510de5;};exports['getDiff']=function(_0x2b4b1d){var _0x3bdfbf=moment()[_0x12c8('0x6')](0x0);var _0x4245dc=moment(_0x2b4b1d)[_0x12c8('0x6')](0x0);return _0x3bdfbf[_0x12c8('0x7')](_0x4245dc,_0x12c8('0x8'));};exports[_0x12c8('0x63')]=function(_0x572ea8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x572ea8[_0x12c8('0x55')],'ListId':_0x572ea8[_0x12c8('0x56')],'VoiceQueueId':_0x572ea8[_0x12c8('0x1c')]||undefined,'CampaignId':_0x572ea8['CampaignId']||undefined};};exports[_0x12c8('0x64')]=function(_0x3f6348){if(_0x3f6348===_0x12c8('0x65')||_0x3f6348===_0x12c8('0x66')||_0x3f6348===_0x12c8('0x5c')||_0x3f6348===_0x12c8('0x67')||_0x3f6348===_0x12c8('0x68')||_0x3f6348===_0x12c8('0x69')||_0x3f6348==='membername'||_0x3f6348===_0x12c8('0x44')||_0x3f6348===_0x12c8('0x1a')||_0x3f6348===_0x12c8('0x51')||_0x3f6348==='calleridnum'||_0x3f6348==='scheduledat'||_0x3f6348===_0x12c8('0x49')||_0x3f6348===_0x12c8('0x4a')||_0x3f6348===_0x12c8('0x4b')||_0x3f6348===_0x12c8('0x6a')||_0x3f6348===_0x12c8('0x6b')||_0x3f6348===_0x12c8('0x6c')||_0x3f6348===_0x12c8('0x6d')||_0x3f6348===_0x12c8('0x6e')||_0x3f6348==='ContactId'||_0x3f6348==='ListId'||_0x3f6348===_0x12c8('0x6f')||_0x3f6348===_0x12c8('0x1c')||_0x3f6348===_0x12c8('0x70')||_0x3f6348==='xmd-voicequeueid'||_0x3f6348===_0x12c8('0x71')||_0x3f6348===_0x12c8('0x72')||_0x3f6348===_0x12c8('0x73')||_0x3f6348==='xmd-dialurl'||_0x3f6348===_0x12c8('0x74')||_0x3f6348===_0x12c8('0x75')||_0x3f6348===_0x12c8('0x76')||_0x3f6348===_0x12c8('0x77')||_0x3f6348==='xmd-contactid'||_0x3f6348===_0x12c8('0x78')||_0x3f6348===_0x12c8('0x79')||_0x3f6348===_0x12c8('0x7a')||_0x3f6348===_0x12c8('0x7b')||_0x3f6348===_0x12c8('0x7c')||_0x3f6348===_0x12c8('0x7d')||_0x3f6348===_0x12c8('0x7e')||_0x3f6348===_0x12c8('0x7f')||_0x3f6348===_0x12c8('0x80')||_0x3f6348===_0x12c8('0x81')||_0x3f6348===_0x12c8('0x82')||_0x3f6348===_0x12c8('0x83')||_0x3f6348===_0x12c8('0x7c')||_0x3f6348==='rtpaudioqosbridged'||_0x3f6348===_0x12c8('0x7e')||_0x3f6348===_0x12c8('0x7f')||_0x3f6348===_0x12c8('0x80')||_0x3f6348===_0x12c8('0x81')||_0x3f6348===_0x12c8('0x82')||_0x3f6348===_0x12c8('0x83')||_0x3f6348===_0x12c8('0x84')||_0x3f6348===_0x12c8('0x85')||_0x3f6348===_0x12c8('0x33')||_0x3f6348==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x463393,_0x3b60fb){var _0x10b736,_0x16bc95,_0x559887;if(_0x3b60fb<=0x0){_0x3b60fb=0x1;}_0x10b736=new RegExp(_0x12c8('0x86')+_0x3b60fb+'}$');_0x16bc95=Math[_0x12c8('0x87')](0xa,_0x3b60fb-0x1);_0x559887=Math[_0x12c8('0x87')](0xa,_0x3b60fb)-0x1;return util[_0x12c8('0x14')]('%s',_[_0x12c8('0x88')](_0x463393,_0x10b736,_['random'](_0x16bc95,_0x559887)));};exports[_0x12c8('0x89')]=function(_0x5f29aa){var _0x575264=_0x5f29aa[_0x12c8('0x8a')](/"(.*?)"/);return _0x575264?_0x575264[0x1]:_0x5f29aa;};exports['extractCalleridNumber']=function(_0x5b3fd9){var _0x4e279e=_0x5b3fd9[_0x12c8('0x8a')](/<(.*?)>/);return _0x4e279e?_0x4e279e[0x1]:_0x5b3fd9;}; \ No newline at end of file +var _0x3cbf=['bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','name','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','ringtime','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','motionChannel','voice','mandatoryDisposition','buildAcw','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer'];(function(_0x4bbd8e,_0x49b5d1){var _0x4308ba=function(_0x440245){while(--_0x440245){_0x4bbd8e['push'](_0x4bbd8e['shift']());}};_0x4308ba(++_0x49b5d1);}(_0x3cbf,0xa0));var _0xf3cb=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x3cbf[_0x58db4e];return _0x40139a;};'use strict';var util=require(_0xf3cb('0x0'));var _=require(_0xf3cb('0x1'));var moment=require(_0xf3cb('0x2'));var logger=require(_0xf3cb('0x3'))(_0xf3cb('0x4'));var ipAgi=process[_0xf3cb('0x5')][_0xf3cb('0x6')]||_0xf3cb('0x7');function getSeconds(_0x3df970,_0x1186a6){var _0xf1c0b9=moment(_0x3df970)['milliseconds'](0x0);var _0x55f8f6=moment(_0x1186a6)[_0xf3cb('0x8')](0x0);return _0xf1c0b9[_0xf3cb('0x9')](_0x55f8f6,'seconds');}exports['loggerCatch']=function(_0x5489b2){return function(_0x1a323b){logger[_0xf3cb('0xa')](_0x5489b2,util[_0xf3cb('0xb')](_0x1a323b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x583c4c,_0x37fa74){logger[_0xf3cb('0xc')](_0x583c4c,util[_0xf3cb('0xb')](_0x37fa74,{'showHidden':![],'depth':null}));};exports[_0xf3cb('0xd')]=function(_0x52b083,_0x581d07){logger[_0xf3cb('0xa')](_0x52b083,util['inspect'](_0x581d07,{'showHidden':![],'depth':null}));};exports[_0xf3cb('0xe')]=function(_0x592c26){return function(_0x4310bd){logger[_0xf3cb('0xc')](_0x592c26,util[_0xf3cb('0xb')](_0x4310bd,{'showHidden':![],'depth':null}));};};exports[_0xf3cb('0xf')]=function(_0x435b26,_0x539cf4,_0x380600){return{'message':_0x435b26,'unlock':_0x539cf4,'active':_0x380600};};exports[_0xf3cb('0x10')]=function(_0x29beac,_0x387534,_0x45d9b9){if(!_[_0xf3cb('0x11')](_0x45d9b9)&&_0xf3cb('0x12')===typeof _0x45d9b9&&!_[_0xf3cb('0x13')](_0x45d9b9)){if(!_[_0xf3cb('0x11')](_0x387534)&&_0xf3cb('0x12')===typeof _0x387534&&!_[_0xf3cb('0x13')](_0x387534)){return util[_0xf3cb('0x14')]('\x22%s\x22\x20<%s>',_0x387534,_0x45d9b9);}return util['format'](_0xf3cb('0x15'),_0x45d9b9,_0x45d9b9);}if(!_['isUndefined'](_0x29beac)&&_0xf3cb('0x12')===typeof _0x29beac&&!_[_0xf3cb('0x13')](_0x29beac)){return _0x29beac;}return'\x22\x22\x20<>';};exports[_0xf3cb('0x16')]=function(_0xa5e0f5){if(_['isNil'](_0xa5e0f5)){return![];}return _0xa5e0f5;};exports[_0xf3cb('0x17')]=function(_0x5599e3,_0x3fbe10,_0x35a463,_0x2361cb,_0xd1a00e,_0x5511e8){var _0x42614b={'XMD-QUEUE':_0x3fbe10['Queue']?_0x3fbe10['Queue'][_0xf3cb('0x18')]:'','XMD-CALLERID':_0x2361cb,'XMD-CALLERID-PREVIEW':_0x5511e8?util[_0xf3cb('0x14')](_0xf3cb('0x15'),_0x5511e8['calleridname'],_0x5511e8[_0xf3cb('0x19')]):_0x2361cb,'XMD-DIALID':_0xd1a00e,'XMD-CONTACTID':_0x3fbe10['ContactId'],'XMD-CDRTYPE':_0xf3cb('0x1a'),'CALLERID(all)':_0x2361cb,'XMD-VOICEQUEUEID':_0x3fbe10[_0xf3cb('0x1b')],'XMD-DIALCHANNEL':_0x35a463,'XMD-DIALTIMEOUT':_0x5599e3['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xf3cb('0x14')](_0xf3cb('0x1c'),_0x5599e3['dialQueueProject2']?'g':'',_[_0xf3cb('0x13')](_0x5599e3[_0xf3cb('0x1d')])?'':_0xf3cb('0x1e')),'XMD-DIALURL':_0x5599e3[_0xf3cb('0x1f')]||'','XMD-AGI':_0x5599e3[_0xf3cb('0x20')]?util[_0xf3cb('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5599e3['dialQueueProject']):_0xf3cb('0x21'),'XMD-AGIAFTER':_0x5599e3[_0xf3cb('0x22')]?util[_0xf3cb('0x14')](_0xf3cb('0x23'),ipAgi,_0x5599e3[_0xf3cb('0x22')]):_0xf3cb('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5511e8?_0x5511e8[_0xf3cb('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5511e8?_0x5511e8[_0xf3cb('0x25')]:'','XMD-DESTINATION':_0xf3cb('0x26'),'SIPADDHEADER':_0xf3cb('0x27')};if(!_['isEmpty'](_0x5599e3[_0xf3cb('0x1d')])){_0x42614b[util['format']('%s',_0xf3cb('0x28'))]=_0x5599e3[_0xf3cb('0x1d')];_0x42614b[util[_0xf3cb('0x14')]('%s',_0xf3cb('0x29'))]=_0xd1a00e;}if(_0x3fbe10&&_0x3fbe10[_0xf3cb('0x2a')]){for(var _0x358c2f in _0x3fbe10['Contact']){if(_0x3fbe10[_0xf3cb('0x2a')][_0xf3cb('0x2b')](_0x358c2f)){if(!_[_0xf3cb('0x2c')](_0x3fbe10['Contact'][_0x358c2f])&&_0x358c2f!=='id'&&_0x358c2f!==_0xf3cb('0x2d')&&_0x358c2f!==_0xf3cb('0x2e')&&_0x358c2f!==_0xf3cb('0x2f')){_0x42614b[util[_0xf3cb('0x14')](_0xf3cb('0x30'),_0xf3cb('0x31'),_[_0xf3cb('0x32')](_0x358c2f))]=_0x3fbe10[_0xf3cb('0x2a')][_0x358c2f];}}}}return _0x42614b;};exports[_0xf3cb('0x33')]=function(_0x1e28b3){var _0x174f6b={};for(var _0x5e4803 in _0x1e28b3){if(_0x1e28b3['hasOwnProperty'](_0x5e4803)){_0x174f6b[util[_0xf3cb('0x14')]('%s',_[_0xf3cb('0x34')](_0x5e4803))]=_0x1e28b3[_0x5e4803];}}return{'variables':_0x174f6b};};exports['updateOriginated']=function(_0x199a64,_0xeb199c){if(!_[_0xf3cb('0x2c')](_0x199a64)){if(_0x199a64[_0xf3cb('0x2b')](_0xf3cb('0x35'))){if(_0x199a64[_0xf3cb('0x35')]>0x0){_0x199a64[_0xf3cb('0x35')]-=0x1;}else{logger['error'](_0xf3cb('0x36'),_0xeb199c);}}}else{logger[_0xf3cb('0xa')](_0xf3cb('0x37'),_0xeb199c);}};exports[_0xf3cb('0x38')]=function(_0x28c5d8){var _0x1fdcfd=moment()[_0xf3cb('0x14')](_0xf3cb('0x39'));_0x28c5d8[_0xf3cb('0x3a')]=0xd;_0x28c5d8[_0xf3cb('0x3b')]='Blacklist';_0x28c5d8[_0xf3cb('0x3c')]=_0x1fdcfd;_0x28c5d8[_0xf3cb('0x3d')]=_0x1fdcfd;_0x28c5d8[_0xf3cb('0x3e')]=_0x1fdcfd;};exports['logAgent']=function(_0x53a2bf,_0x5e0dad,_0x4a0c04){var _0x52ed5a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53a2bf[_0xf3cb('0x3a')]=_0x5e0dad;_0x53a2bf[_0xf3cb('0x3b')]=_0x4a0c04;_0x53a2bf[_0xf3cb('0x3d')]=_0x52ed5a;_0x53a2bf[_0xf3cb('0x3f')]=getSeconds(_0x53a2bf[_0xf3cb('0x3d')],_0x53a2bf[_0xf3cb('0x3c')]);};exports['logLookAgent']=function(_0xf369b8,_0x3491af,_0x2369e6){_0xf369b8[_0xf3cb('0x40')]=_0x3491af;_0xf369b8[_0xf3cb('0x41')]=_0x2369e6;};exports[_0xf3cb('0x42')]=function(_0x10db56,_0x5c56be,_0x45df32){var _0x49a9d3=moment()[_0xf3cb('0x14')](_0xf3cb('0x39'));_0x10db56[_0xf3cb('0x3a')]=_0x5c56be;_0x10db56[_0xf3cb('0x3b')]=_0x45df32;_0x10db56[_0xf3cb('0x3d')]=_0x10db56[_0xf3cb('0x3d')]?_0x10db56[_0xf3cb('0x3d')]:_0x49a9d3;_0x10db56['endtime']=_0x10db56[_0xf3cb('0x3e')]?_0x10db56['endtime']:_0x49a9d3;_0x10db56[_0xf3cb('0x3f')]=getSeconds(_0x10db56[_0xf3cb('0x3d')]||0x0,_0x10db56[_0xf3cb('0x3c')]||0x0);_0x10db56[_0xf3cb('0x43')]=_0x10db56['answertime']?getSeconds(_0x10db56[_0xf3cb('0x3e')],_0x10db56[_0xf3cb('0x44')]):0x0;};exports[_0xf3cb('0x45')]=function(_0x4037ba){return _0x4037ba===_0xf3cb('0x46');};exports[_0xf3cb('0x47')]=function(_0x4d6033,_0x3ba1cc,_0x3dac90,_0x445170,_0x28f18e){var _0x9f609=_0x445170?_0xf3cb('0x48'):_0x4d6033[_0xf3cb('0x49')];_0x9f609=_0x28f18e?_0xf3cb('0x4a'):_0x9f609;return{'actionid':_0x4d6033[_0xf3cb('0x4b')],'action':_0xf3cb('0x4c'),'channel':_0x4d6033[_0xf3cb('0x4d')],'callerid':util[_0xf3cb('0x14')](_0xf3cb('0x15'),_0x9f609,_0x4d6033[_0xf3cb('0x19')]),'Exten':_0xf3cb('0x26'),'Context':_0xf3cb('0x4e'),'Priority':'1','variable':_0x3dac90,'timeout':(_0x3ba1cc[_0xf3cb('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d6033[_0xf3cb('0x4b')]};};exports[_0xf3cb('0x50')]=function(_0x43bd85){return _0x43bd85['countbusyretry']+_0x43bd85[_0xf3cb('0x51')]+_0x43bd85[_0xf3cb('0x52')]+_0x43bd85[_0xf3cb('0x53')]+_0x43bd85[_0xf3cb('0x54')];};exports['cloneAction']=function(_0x3ffa24){var _0x15662c=_[_0xf3cb('0x55')](_0x3ffa24);_0x15662c['state']=0xf;_0x15662c[_0xf3cb('0x3b')]=_0xf3cb('0x56');return _0x15662c;};exports[_0xf3cb('0x57')]=function(_0xe5cf02,_0xd92039,_0xb5d62f){var _0xa5473={};_0xa5473[_0xd92039]=_0xe5cf02[_0xd92039];_0xa5473[_0xf3cb('0x58')]=![];_0xa5473[_0xf3cb('0x59')]=moment()[_0xf3cb('0x5a')](_0xb5d62f,'minutes')[_0xf3cb('0x14')](_0xf3cb('0x39'));_0xa5473[_0xf3cb('0x5b')]=_0xe5cf02[_0xf3cb('0x5b')];_0xa5473[_0xf3cb('0x5c')]=_0xe5cf02['ListId'];_0xa5473[_0xf3cb('0x1b')]=_0xe5cf02['VoiceQueueId']||undefined;return _0xa5473;};exports['decrementTalkink']=function(_0x5d8a8e,_0x31a94d){if(!_[_0xf3cb('0x2c')](_0x5d8a8e)){if(_0x5d8a8e[_0xf3cb('0x5d')]>0x0){_0x5d8a8e[_0xf3cb('0x5d')]-=0x1;}else{logger[_0xf3cb('0xa')](_0x31a94d,_0xf3cb('0x5e'));}}else{logger[_0xf3cb('0xa')](_0x31a94d,_0xf3cb('0x5f'));}};exports[_0xf3cb('0x60')]=function(_0x1738e2){if(_0x1738e2<=0x0){return!![];}return![];};exports['buildObj']=function(_0x534f3b,_0x268273,_0x374d18){_0x534f3b[_0xf3cb('0x61')]=_0x268273;_0x534f3b[_0xf3cb('0x18')]=_0x534f3b['queue'];_0x534f3b['interface']=_0x534f3b['channelAgent'];_0x534f3b[_0xf3cb('0x62')]=_0xf3cb('0x63');if(_0x374d18){_0x534f3b[_0xf3cb('0x64')]=_0x374d18[_0xf3cb('0x64')];}return _0x534f3b;};exports[_0xf3cb('0x65')]=function(_0xab0be9){var _0x5ab769={};_0x5ab769[_0xf3cb('0x66')]=_0xab0be9[_0xf3cb('0x66')];_0x5ab769[_0xf3cb('0x67')]=_0xab0be9['channelAgent'];_0x5ab769['uniqueid']=_0xab0be9[_0xf3cb('0x4b')];return _0x5ab769;};exports[_0xf3cb('0x68')]=function(_0x298dc0){var _0x532441=[];for(var _0x5e7814 in _0x298dc0){if(_0x298dc0['hasOwnProperty'](_0x5e7814)){if(!_[_0xf3cb('0x2c')](_0x298dc0[_0x5e7814])&&_0x298dc0[_0x5e7814][_0xf3cb('0x3a')]===_0xf3cb('0x69')&&_0x298dc0[_0x5e7814][_0xf3cb('0x6a')]===_0xf3cb('0x6b')){_0x532441[_0xf3cb('0x6c')](_0x298dc0[_0x5e7814]['id']);}}}return _0x532441;};exports[_0xf3cb('0x6d')]=function(_0x49168a){var _0x58c92b=moment()[_0xf3cb('0x8')](0x0);var _0x2d6c4e=moment(_0x49168a)[_0xf3cb('0x8')](0x0);return _0x58c92b[_0xf3cb('0x9')](_0x2d6c4e,_0xf3cb('0x6e'));};exports['createBody']=function(_0x10836b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x10836b[_0xf3cb('0x5b')],'ListId':_0x10836b[_0xf3cb('0x5c')],'VoiceQueueId':_0x10836b[_0xf3cb('0x1b')]||undefined,'CampaignId':_0x10836b['CampaignId']||undefined};};exports[_0xf3cb('0x6f')]=function(_0x1ae43a){if(_0x1ae43a===_0xf3cb('0x4b')||_0x1ae43a===_0xf3cb('0x70')||_0x1ae43a===_0xf3cb('0x66')||_0x1ae43a===_0xf3cb('0x71')||_0x1ae43a===_0xf3cb('0x72')||_0x1ae43a===_0xf3cb('0x73')||_0x1ae43a===_0xf3cb('0x40')||_0x1ae43a===_0xf3cb('0x4d')||_0x1ae43a===_0xf3cb('0x49')||_0x1ae43a===_0xf3cb('0x58')||_0x1ae43a===_0xf3cb('0x19')||_0x1ae43a===_0xf3cb('0x59')||_0x1ae43a===_0xf3cb('0x74')||_0x1ae43a===_0xf3cb('0x51')||_0x1ae43a===_0xf3cb('0x52')||_0x1ae43a===_0xf3cb('0x75')||_0x1ae43a===_0xf3cb('0x76')||_0x1ae43a===_0xf3cb('0x77')||_0x1ae43a===_0xf3cb('0x78')||_0x1ae43a===_0xf3cb('0x79')||_0x1ae43a==='ContactId'||_0x1ae43a===_0xf3cb('0x5c')||_0x1ae43a===_0xf3cb('0x41')||_0x1ae43a==='VoiceQueueId'||_0x1ae43a===_0xf3cb('0x7a')||_0x1ae43a==='xmd-voicequeueid'||_0x1ae43a===_0xf3cb('0x7b')||_0x1ae43a===_0xf3cb('0x7c')||_0x1ae43a===_0xf3cb('0x7d')||_0x1ae43a===_0xf3cb('0x7e')||_0x1ae43a===_0xf3cb('0x7f')||_0x1ae43a===_0xf3cb('0x80')||_0x1ae43a===_0xf3cb('0x81')||_0x1ae43a===_0xf3cb('0x82')||_0x1ae43a===_0xf3cb('0x83')||_0x1ae43a===_0xf3cb('0x84')||_0x1ae43a==='xmd-callerid'||_0x1ae43a===_0xf3cb('0x85')||_0x1ae43a===_0xf3cb('0x86')||_0x1ae43a===_0xf3cb('0x87')||_0x1ae43a===_0xf3cb('0x88')||_0x1ae43a===_0xf3cb('0x89')||_0x1ae43a==='rtpaudioqosjitterbridged'||_0x1ae43a===_0xf3cb('0x8a')||_0x1ae43a===_0xf3cb('0x8b')||_0x1ae43a===_0xf3cb('0x8c')||_0x1ae43a===_0xf3cb('0x8d')||_0x1ae43a===_0xf3cb('0x87')||_0x1ae43a==='rtpaudioqosbridged'||_0x1ae43a===_0xf3cb('0x89')||_0x1ae43a===_0xf3cb('0x8e')||_0x1ae43a===_0xf3cb('0x8a')||_0x1ae43a===_0xf3cb('0x8b')||_0x1ae43a==='rtpaudioqosrtt'||_0x1ae43a==='rtpaudioqosrttbridged'||_0x1ae43a===_0xf3cb('0x8f')||_0x1ae43a===_0xf3cb('0x90')||_0x1ae43a==='state'||_0x1ae43a===_0xf3cb('0x3b')){return![];}return!![];};exports[_0xf3cb('0x91')]=function(_0x57a6e8,_0x197bc6){var _0x4cceb8,_0x5c7eac,_0x413ab6;if(_0x197bc6<=0x0){_0x197bc6=0x1;}_0x4cceb8=new RegExp('\x5cw{0,'+_0x197bc6+'}$');_0x5c7eac=Math[_0xf3cb('0x92')](0xa,_0x197bc6-0x1);_0x413ab6=Math[_0xf3cb('0x92')](0xa,_0x197bc6)-0x1;return util['format']('%s',_[_0xf3cb('0x93')](_0x57a6e8,_0x4cceb8,_[_0xf3cb('0x94')](_0x5c7eac,_0x413ab6)));};exports[_0xf3cb('0x95')]=function(_0x1ac1db){var _0x3610a4=_0x1ac1db[_0xf3cb('0x96')](/"(.*?)"/);return _0x3610a4?_0x3610a4[0x1]:_0x1ac1db;};exports[_0xf3cb('0x97')]=function(_0x1b1295){var _0x3069f1=_0x1b1295[_0xf3cb('0x96')](/<(.*?)>/);return _0x3069f1?_0x3069f1[0x1]:_0x1b1295;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f7a77e8..aaf946c 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 _0xfe97=['queuepause','voicequeuechannelredirect','queueadd','string','boolean','queueremove'];(function(_0x4aaff3,_0x18b012){var _0x3a20f3=function(_0x550df8){while(--_0x550df8){_0x4aaff3['push'](_0x4aaff3['shift']());}};_0x3a20f3(++_0x18b012);}(_0xfe97,0x140));var _0x7fe9=function(_0x378771,_0x3e0dc8){_0x378771=_0x378771-0x0;var _0x3834da=_0xfe97[_0x378771];return _0x3834da;};'use strict';exports[_0x7fe9('0x0')]={'queue':{'type':_0x7fe9('0x1'),'required':!![]},'interface':{'type':_0x7fe9('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7fe9('0x2'),'required':![]}};exports[_0x7fe9('0x3')]={'queue':{'type':_0x7fe9('0x1'),'required':!![]},'interface':{'type':_0x7fe9('0x1'),'required':!![]}};exports[_0x7fe9('0x4')]={'interface':{'type':_0x7fe9('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x7fe9('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x7fe9('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x7fe9('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7fe9('0x1')},'format':{'type':_0x7fe9('0x1')},'mixmonitorid':{'type':_0x7fe9('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x7fe9('0x1'),'required':!![]}};exports[_0x7fe9('0x5')]={'uniqueid':{'type':_0x7fe9('0x1'),'required':!![]},'exten':{'type':_0x7fe9('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x4b9a=['queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b9a,0x7a));var _0xa4b9=function(_0x1f2a5f,_0x3fd614){_0x1f2a5f=_0x1f2a5f-0x0;var _0x4d6606=_0x4b9a[_0x1f2a5f];return _0x4d6606;};'use strict';exports[_0xa4b9('0x0')]={'queue':{'type':_0xa4b9('0x1'),'required':!![]},'interface':{'type':_0xa4b9('0x1'),'required':!![]},'membername':{'type':_0xa4b9('0x1'),'required':!![]},'penalty':{'type':_0xa4b9('0x2'),'required':![]},'paused':{'type':_0xa4b9('0x3'),'required':![]}};exports[_0xa4b9('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xa4b9('0x1'),'required':!![]}};exports[_0xa4b9('0x5')]={'interface':{'type':_0xa4b9('0x1'),'required':!![]},'paused':{'type':_0xa4b9('0x3')},'reason':{'type':'string','required':![]}};exports[_0xa4b9('0x6')]={'module':{'type':_0xa4b9('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0xa4b9('0x7')]={'uniqueid':{'type':_0xa4b9('0x1'),'required':!![]},'filename':{'type':_0xa4b9('0x1')},'format':{'type':_0xa4b9('0x1')},'mixmonitorid':{'type':_0xa4b9('0x1')}};exports[_0xa4b9('0x8')]={'uniqueid':{'type':_0xa4b9('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xa4b9('0x1'),'required':!![]},'exten':{'type':_0xa4b9('0x1'),'required':!![]},'context':{'type':_0xa4b9('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 40332f8..6e2a55f 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 _0x3815=['initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','ivrTotalCallsDays','isEmpty','unmanaged','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','triggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts'];(function(_0x4bf85f,_0x4df697){var _0x30a870=function(_0x162ea4){while(--_0x162ea4){_0x4bf85f['push'](_0x4bf85f['shift']());}};_0x30a870(++_0x4df697);}(_0x3815,0x8a));var _0x5381=function(_0x4f140b,_0xe78dd7){_0x4f140b=_0x4f140b-0x0;var _0xc0deee=_0x3815[_0x4f140b];return _0xc0deee;};'use strict';var BPromise=require('bluebird');var util=require(_0x5381('0x0'));var _=require(_0x5381('0x1'));var moment=require(_0x5381('0x2'));var Agent=require(_0x5381('0x3'));var Telephone=require(_0x5381('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x5381('0x5'));var Trigger=require(_0x5381('0x6'));var Template=require(_0x5381('0x7'));var Campaign=require(_0x5381('0x8'));var VoiceExtension=require(_0x5381('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x5381('0xa'));var FreshdeskAccount=require(_0x5381('0xb'));var SugarcrmAccount=require(_0x5381('0xc'));var ZohoAccount=require(_0x5381('0xd'));var DeskAccount=require(_0x5381('0xe'));var VtigerAccount=require(_0x5381('0xf'));var ServicenowAccount=require(_0x5381('0x10'));var Dynamics365Account=require(_0x5381('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x5381('0x12'));var Realtime=function(){this[_0x5381('0x13')]={};this[_0x5381('0x14')]={};this[_0x5381('0x15')]={};this[_0x5381('0x16')]={};this['triggers']={};this[_0x5381('0x17')]={};this[_0x5381('0x18')]={};this[_0x5381('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5381('0x1a')]={};this[_0x5381('0x1b')]={};this[_0x5381('0x1c')]={};this[_0x5381('0x1d')]={};this[_0x5381('0x1e')]={};this[_0x5381('0x1f')]={};this['zendeskAccounts']={};this[_0x5381('0x20')]={};this[_0x5381('0x21')]={};this[_0x5381('0x22')]={};this[_0x5381('0x23')]={};this[_0x5381('0x24')]={};this[_0x5381('0x25')]={};this[_0x5381('0x26')]={};this[_0x5381('0x27')]={};this[_0x5381('0x28')]={};this[_0x5381('0x29')]={};};function freeIsNotKey(_0xd8d680,_0x1b20dd,_0x499e83){var _0x54c52f=_[_0x5381('0x2a')](_0xd8d680,function(_0x421e93,_0x4ff654){return _0x421e93[_0x499e83];});for(var _0xecc1f6 in _0x1b20dd){if(_0x1b20dd[_0x5381('0x2b')](_0xecc1f6)){if(!_0x54c52f[_0xecc1f6]){delete _0x1b20dd[_0xecc1f6];}}}}function freeIsNotKeySip(_0x2c58c7,_0x283497){var _0x1afaa1=_[_0x5381('0x2a')](_0x2c58c7,function(_0x1f7bc1,_0x4b035b){return util[_0x5381('0x2c')](_0x5381('0x2d'),_0x1f7bc1[_0x5381('0x2e')]);});for(var _0x12b1d5 in _0x283497){if(_0x283497[_0x5381('0x2b')](_0x12b1d5)){if(!_0x1afaa1[_0x12b1d5]){delete _0x283497[_0x12b1d5];}}}}function freeIsNotKeyAgent(_0x4f49dc,_0x112584){var _0x28351e=_[_0x5381('0x2a')](_0x4f49dc,function(_0x3b1f1e,_0x279d3a){var _0x5857ae=_['isNil'](_0x3b1f1e['interface'])?util['format'](_0x5381('0x2d'),_0x3b1f1e[_0x5381('0x2e')]):_0x3b1f1e[_0x5381('0x2f')];return _0x5857ae;});for(var _0x10ddf5 in _0x112584){if(_0x112584[_0x5381('0x2b')](_0x10ddf5)){if(!_0x28351e[_0x10ddf5]){delete _0x112584[_0x10ddf5];}}}}function clearVoiceCallReports(_0x2024c3){_0x2024c3[_0x5381('0x30')]=0x0;_0x2024c3[_0x5381('0x31')]=0x0;_0x2024c3[_0x5381('0x32')]=0x0;_0x2024c3['sumDuration']=0x0;_0x2024c3['sumBillable']=0x0;}function clearCampaigns(_0x5633ca){if(!_['isEmpty'](_0x5633ca)){for(var _0x261c4d in _0x5633ca){if(_0x5633ca[_0x5381('0x2b')](_0x261c4d)){_0x5633ca[_0x261c4d][_0x5381('0x33')]=0x0;_0x5633ca[_0x261c4d]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4989a7){if(!_[_0x5381('0x34')](_0x4989a7)){for(var _0x54c67f in _0x4989a7){if(_0x4989a7[_0x5381('0x2b')](_0x54c67f)){_0x4989a7[_0x54c67f][_0x5381('0x30')]=0x0;_0x4989a7[_0x54c67f]['answered']=0x0;_0x4989a7[_0x54c67f][_0x5381('0x35')]=0x0;_0x4989a7[_0x54c67f]['abandoned']=0x0;_0x4989a7[_0x54c67f][_0x5381('0x32')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x36')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x37')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x38')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x39')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3a')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3b')]=0x0;_0x4989a7[_0x54c67f]['outboundNoSuchCallsDay']=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3c')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3d')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3e')]=0x0;_0x4989a7[_0x54c67f]['outboundBlacklistCallsDay']=0x0;_0x4989a7[_0x54c67f]['outboundOriginateFailureCallsDay']=0x0;_0x4989a7[_0x54c67f][_0x5381('0x3f')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x40')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x38')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x41')]=0x0;_0x4989a7[_0x54c67f][_0x5381('0x42')]=!![];}}}}Realtime[_0x5381('0x43')][_0x5381('0x44')]=function(_0x102799,_0x5edce1){for(var _0x49f909 in _0x5edce1){if(_0x102799[_0x5381('0x2b')](_0x49f909)){_0x102799[_0x49f909]=_0x5edce1[_0x49f909];}}};Realtime[_0x5381('0x43')]['initAgents']=function(){var _0x5d8b1d=this;return function(_0x870d69){if(_0x870d69){freeIsNotKeyAgent(_0x870d69,_0x5d8b1d[_0x5381('0x13')]);for(var _0x524676=0x0,_0x492305={},_0x350ddf={};_0x524676<_0x870d69[_0x5381('0x45')];_0x524676+=0x1){_0x492305=_0x870d69[_0x524676];var _0x5801fa=_[_0x5381('0x46')](_0x492305[_0x5381('0x2f')])?util[_0x5381('0x2c')](_0x5381('0x2d'),_0x492305[_0x5381('0x2e')]):_0x492305[_0x5381('0x2f')];if(_[_0x5381('0x47')](_0x5d8b1d[_0x5381('0x13')][_0x5801fa])){_0x5d8b1d[_0x5381('0x13')][_0x5801fa]=new Agent(_0x492305);}else{_0x5d8b1d[_0x5381('0x44')](_0x5d8b1d[_0x5381('0x13')][_0x5801fa],_0x492305);}}}return _0x5d8b1d['agents'];};};Realtime[_0x5381('0x43')][_0x5381('0x48')]=function(){var _0x2d8bb9=this;return function(_0x533875){if(_0x533875){freeIsNotKeySip(_0x533875,_0x2d8bb9[_0x5381('0x14')]);for(var _0x1e4daa=0x0,_0x449d6a={},_0x33ec0f={};_0x1e4daa<_0x533875[_0x5381('0x45')];_0x1e4daa+=0x1){_0x449d6a=_0x533875[_0x1e4daa];if(_['isUndefined'](_0x2d8bb9['telephones'][util[_0x5381('0x2c')](_0x5381('0x2d'),_0x449d6a[_0x5381('0x2e')])])){_0x2d8bb9['telephones'][util['format'](_0x5381('0x2d'),_0x449d6a[_0x5381('0x2e')])]=new Telephone(_0x449d6a);}else{_0x2d8bb9[_0x5381('0x44')](_0x2d8bb9[_0x5381('0x14')][util[_0x5381('0x2c')](_0x5381('0x2d'),_0x449d6a[_0x5381('0x2e')])],_0x449d6a);}}}return _0x2d8bb9[_0x5381('0x14')];};};Realtime['prototype'][_0x5381('0x49')]=function(){var _0x20f46e=this;return function(_0x17f519){if(_0x17f519){freeIsNotKeySip(_0x17f519,_0x20f46e['trunks']);for(var _0x4602bf=0x0,_0x5106bf={},_0xed62a={};_0x4602bf<_0x17f519[_0x5381('0x45')];_0x4602bf+=0x1){_0x5106bf=_0x17f519[_0x4602bf];if(_['isUndefined'](_0x20f46e[_0x5381('0x15')][util[_0x5381('0x2c')](_0x5381('0x2d'),_0x5106bf[_0x5381('0x2e')])])){_0x20f46e[_0x5381('0x15')][util['format'](_0x5381('0x2d'),_0x5106bf[_0x5381('0x2e')])]=new Trunk(_0x5106bf);}else{_0x20f46e[_0x5381('0x44')](_0x20f46e['trunks'][util['format'](_0x5381('0x2d'),_0x5106bf[_0x5381('0x2e')])],_0x5106bf);}}}return _0x20f46e['trunks'];};};Realtime['prototype'][_0x5381('0x4a')]=function(){var _0x1f5fbc=this;return function(_0x106670){if(_0x106670){freeIsNotKey(_0x106670,_0x1f5fbc[_0x5381('0x16')],_0x5381('0x2e'));for(var _0x23d209=0x0,_0x2a7cd0={},_0x403b3b={};_0x23d209<_0x106670[_0x5381('0x45')];_0x23d209+=0x1){_0x2a7cd0=_0x106670[_0x23d209];if(_[_0x5381('0x47')](_0x1f5fbc[_0x5381('0x16')][_0x2a7cd0['name']])){_0x1f5fbc[_0x5381('0x16')][_0x2a7cd0[_0x5381('0x2e')]]=new VoiceQueue(_0x2a7cd0);}else{_0x1f5fbc[_0x5381('0x44')](_0x1f5fbc[_0x5381('0x16')][_0x2a7cd0[_0x5381('0x2e')]],_0x2a7cd0);}}}return _0x1f5fbc[_0x5381('0x16')];};};Realtime[_0x5381('0x43')]['initTriggers']=function(){var _0x3fc9a4=this;return function(_0x4b1adc){if(_0x4b1adc){freeIsNotKey(_0x4b1adc,_0x3fc9a4[_0x5381('0x4b')],'id');for(var _0x536162=0x0,_0x278637={},_0x180a53={};_0x536162<_0x4b1adc[_0x5381('0x45')];_0x536162+=0x1){_0x278637=_0x4b1adc[_0x536162];if(_[_0x5381('0x47')](_0x3fc9a4[_0x5381('0x4b')][_0x278637['id']])){_0x3fc9a4[_0x5381('0x4b')][_0x278637['id']]=new Trigger(_0x278637);}else{_0x3fc9a4[_0x5381('0x44')](_0x3fc9a4[_0x5381('0x4b')][_0x278637['id']],_0x278637);}}}return _0x3fc9a4[_0x5381('0x4b')];};};Realtime[_0x5381('0x43')]['initTemplates']=function(){var _0x2840f9=this;return function(_0x1529c1){if(_0x1529c1){freeIsNotKey(_0x1529c1,_0x2840f9['templates'],'id');for(var _0x20c269=0x0,_0x4e1042={},_0x53e4c8={};_0x20c269<_0x1529c1[_0x5381('0x45')];_0x20c269+=0x1){_0x4e1042=_0x1529c1[_0x20c269];if(_[_0x5381('0x47')](_0x2840f9[_0x5381('0x18')][_0x4e1042['id']])){_0x2840f9['templates'][_0x4e1042['id']]=new Template(_0x4e1042);}else{_0x2840f9[_0x5381('0x44')](_0x2840f9[_0x5381('0x18')][_0x4e1042['id']],_0x4e1042);}}}return _0x2840f9['templates'];};};Realtime['prototype'][_0x5381('0x4c')]=function(){var _0x492146=this;return function(_0x316151){if(_0x316151){freeIsNotKey(_0x316151,_0x492146['zendeskAccounts'],'id');for(var _0x2bc9ae=0x0,_0x3882ce={},_0x83c4ba={};_0x2bc9ae<_0x316151[_0x5381('0x45')];_0x2bc9ae+=0x1){_0x3882ce=_0x316151[_0x2bc9ae];if(_[_0x5381('0x47')](_0x492146[_0x5381('0x4d')][_0x3882ce['id']])){_0x492146[_0x5381('0x4d')][_0x3882ce['id']]=new ZendeskAccount(_0x3882ce);}else{_0x492146[_0x5381('0x44')](_0x492146[_0x5381('0x4d')][_0x3882ce['id']],_0x3882ce);}}}return _0x492146[_0x5381('0x4d')];};};Realtime[_0x5381('0x43')][_0x5381('0x4e')]=function(){var _0x27b66b=this;return function(_0x49ac3c){if(_0x49ac3c){freeIsNotKey(_0x49ac3c,_0x27b66b[_0x5381('0x20')],'id');for(var _0x4b41bc=0x0,_0x124949={},_0x233db5={};_0x4b41bc<_0x49ac3c[_0x5381('0x45')];_0x4b41bc+=0x1){_0x124949=_0x49ac3c[_0x4b41bc];if(_[_0x5381('0x47')](_0x27b66b[_0x5381('0x20')][_0x124949['id']])){_0x27b66b['salesforceAccounts'][_0x124949['id']]=new SalesforceAccount(_0x124949);}else{_0x27b66b[_0x5381('0x44')](_0x27b66b[_0x5381('0x20')][_0x124949['id']],_0x124949);}}}return _0x27b66b[_0x5381('0x20')];};};Realtime[_0x5381('0x43')]['initFreshdeskAccounts']=function(){var _0x3f142c=this;return function(_0x3fb8f4){if(_0x3fb8f4){freeIsNotKey(_0x3fb8f4,_0x3f142c['freshdeskAccounts'],'id');for(var _0xe0a7ca=0x0,_0x37f42a={},_0x6bf43b={};_0xe0a7ca<_0x3fb8f4['length'];_0xe0a7ca+=0x1){_0x37f42a=_0x3fb8f4[_0xe0a7ca];if(_['isUndefined'](_0x3f142c[_0x5381('0x22')][_0x37f42a['id']])){_0x3f142c[_0x5381('0x22')][_0x37f42a['id']]=new FreshdeskAccount(_0x37f42a);}else{_0x3f142c['mergeFromDatabase'](_0x3f142c[_0x5381('0x22')][_0x37f42a['id']],_0x37f42a);}}}return _0x3f142c[_0x5381('0x22')];};};Realtime[_0x5381('0x43')][_0x5381('0x4f')]=function(){var _0x149730=this;return function(_0x10894f){if(_0x10894f){freeIsNotKey(_0x10894f,_0x149730[_0x5381('0x23')],'id');for(var _0x236648=0x0,_0x2a565a={},_0x3030a6={};_0x236648<_0x10894f[_0x5381('0x45')];_0x236648+=0x1){_0x2a565a=_0x10894f[_0x236648];if(_[_0x5381('0x47')](_0x149730['zohoAccounts'][_0x2a565a['id']])){_0x149730['zohoAccounts'][_0x2a565a['id']]=new ZohoAccount(_0x2a565a);}else{_0x149730[_0x5381('0x44')](_0x149730['zohoAccounts'][_0x2a565a['id']],_0x2a565a);}}}return _0x149730[_0x5381('0x23')];};};Realtime[_0x5381('0x43')][_0x5381('0x50')]=function(){var _0x3b9f8e=this;return function(_0xeeb8e4){if(_0xeeb8e4){freeIsNotKey(_0xeeb8e4,_0x3b9f8e[_0x5381('0x24')],'id');for(var _0x23ff9d=0x0,_0x22b401={},_0x4b3d5f={};_0x23ff9d<_0xeeb8e4[_0x5381('0x45')];_0x23ff9d+=0x1){_0x22b401=_0xeeb8e4[_0x23ff9d];if(_[_0x5381('0x47')](_0x3b9f8e[_0x5381('0x24')][_0x22b401['id']])){_0x3b9f8e[_0x5381('0x24')][_0x22b401['id']]=new DeskAccount(_0x22b401);}else{_0x3b9f8e[_0x5381('0x44')](_0x3b9f8e[_0x5381('0x24')][_0x22b401['id']],_0x22b401);}}}return _0x3b9f8e[_0x5381('0x24')];};};Realtime[_0x5381('0x43')][_0x5381('0x51')]=function(){var _0x28802c=this;return function(_0x52637f){if(_0x52637f){freeIsNotKey(_0x52637f,_0x28802c[_0x5381('0x21')],'id');for(var _0x18a1cc=0x0,_0x5fb035={},_0x525005={};_0x18a1cc<_0x52637f[_0x5381('0x45')];_0x18a1cc+=0x1){_0x5fb035=_0x52637f[_0x18a1cc];if(_[_0x5381('0x47')](_0x28802c[_0x5381('0x21')][_0x5fb035['id']])){_0x28802c[_0x5381('0x21')][_0x5fb035['id']]=new SugarcrmAccount(_0x5fb035);}else{_0x28802c[_0x5381('0x44')](_0x28802c[_0x5381('0x21')][_0x5fb035['id']],_0x5fb035);}}}return _0x28802c[_0x5381('0x21')];};};Realtime[_0x5381('0x43')][_0x5381('0x52')]=function(){var _0x11bc21=this;return function(_0x339780){if(_0x339780){freeIsNotKey(_0x339780,_0x11bc21[_0x5381('0x25')],'id');for(var _0x4553aa=0x0,_0x43ba36={},_0x2044f4={};_0x4553aa<_0x339780[_0x5381('0x45')];_0x4553aa+=0x1){_0x43ba36=_0x339780[_0x4553aa];if(_[_0x5381('0x47')](_0x11bc21[_0x5381('0x25')][_0x43ba36['id']])){_0x11bc21[_0x5381('0x25')][_0x43ba36['id']]=new VtigerAccount(_0x43ba36);}else{_0x11bc21[_0x5381('0x44')](_0x11bc21[_0x5381('0x25')][_0x43ba36['id']],_0x43ba36);}}}return _0x11bc21[_0x5381('0x25')];};};Realtime['prototype'][_0x5381('0x53')]=function(){var _0x2b7e18=this;return function(_0x56936c){if(_0x56936c){freeIsNotKey(_0x56936c,_0x2b7e18[_0x5381('0x26')],'id');for(var _0x19317f=0x0,_0x12d797={},_0x284c3c={};_0x19317f<_0x56936c[_0x5381('0x45')];_0x19317f+=0x1){_0x12d797=_0x56936c[_0x19317f];if(_[_0x5381('0x47')](_0x2b7e18[_0x5381('0x26')][_0x12d797['id']])){_0x2b7e18[_0x5381('0x26')][_0x12d797['id']]=new ServicenowAccount(_0x12d797);}else{_0x2b7e18[_0x5381('0x44')](_0x2b7e18['servicenowAccounts'][_0x12d797['id']],_0x12d797);}}}return _0x2b7e18['servicenowAccounts'];};};Realtime[_0x5381('0x43')][_0x5381('0x54')]=function(){var _0x18a9a4=this;return function(_0x36c969){if(_0x36c969){freeIsNotKey(_0x36c969,_0x18a9a4[_0x5381('0x27')],'id');for(var _0x48f98a=0x0,_0x5a42e6={},_0x4a8f89={};_0x48f98a<_0x36c969['length'];_0x48f98a+=0x1){_0x5a42e6=_0x36c969[_0x48f98a];if(_[_0x5381('0x47')](_0x18a9a4[_0x5381('0x27')][_0x5a42e6['id']])){_0x18a9a4[_0x5381('0x27')][_0x5a42e6['id']]=new Dynamics365Account(_0x5a42e6);}else{_0x18a9a4[_0x5381('0x44')](_0x18a9a4['dynamics365Accounts'][_0x5a42e6['id']],_0x5a42e6);}}}return _0x18a9a4[_0x5381('0x27')];};};Realtime[_0x5381('0x43')][_0x5381('0x55')]=function(){var _0x26f532=this;return function(_0x2c90ba){if(_0x2c90ba){freeIsNotKey(_0x2c90ba,_0x26f532[_0x5381('0x28')],'id');for(var _0xb794ef=0x0,_0x3db2a6={},_0x4ee920={};_0xb794ef<_0x2c90ba['length'];_0xb794ef+=0x1){_0x3db2a6=_0x2c90ba[_0xb794ef];if(_[_0x5381('0x47')](_0x26f532[_0x5381('0x28')][_0x3db2a6['id']])){_0x26f532[_0x5381('0x28')][_0x3db2a6['id']]=new FreshsalesAccount(_0x3db2a6);}else{_0x26f532['mergeFromDatabase'](_0x26f532[_0x5381('0x28')][_0x3db2a6['id']],_0x3db2a6);}}}return _0x26f532[_0x5381('0x28')];};};Realtime[_0x5381('0x43')][_0x5381('0x56')]=function(){var _0x357fcb=this;return function(_0x3328e2){for(var _0x3868d2=0x0;_0x3868d2<_0x3328e2['length'];_0x3868d2+=0x1){_[_0x5381('0x57')](_0x357fcb['voiceQueues'][_0x3328e2[_0x3868d2][_0x5381('0x2e')]],_0x3328e2[_0x3868d2]);}return _0x357fcb['voiceQueues'];};};Realtime[_0x5381('0x43')]['initVoiceQueueReports']=function(){var _0x48f9a1=this;return function(_0x274b7e){clearVoiceQueues(_0x48f9a1[_0x5381('0x16')]);if(_0x274b7e){_0x274b7e=_[_0x5381('0x58')](_0x274b7e,'uniqueid');for(var _0x251c0d in _0x274b7e){if(_0x274b7e[_0x5381('0x2b')](_0x251c0d)){var _0x2a73e1={};for(var _0x5b6b1b=0x0;_0x5b6b1b<_0x274b7e[_0x251c0d]['length'];_0x5b6b1b+=0x1){var _0x31957e=_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x59')];if(_0x48f9a1['voiceQueues'][_0x31957e]){if(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5a')]){_0x48f9a1[_0x5381('0x16')][_0x31957e][_0x5381('0x35')]+=0x1;}if(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5b')]){_0x48f9a1[_0x5381('0x16')][_0x31957e]['abandoned']+=0x1;}_0x48f9a1[_0x5381('0x16')][_0x31957e][_0x5381('0x32')]+=moment(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5c')])[_0x5381('0x5d')](moment(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5e')]),_0x5381('0x5f'))||0x0;if(_0x5b6b1b===_0x274b7e[_0x251c0d]['length']-0x1){_0x48f9a1[_0x5381('0x16')][_0x31957e]['sumDuration']+=moment(_0x274b7e[_0x251c0d][_0x5b6b1b]['queuecallercompleteAt']||_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x60')]||_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x61')])[_0x5381('0x5d')](moment(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5e')]),'seconds')||0x0;_0x48f9a1[_0x5381('0x16')][_0x31957e][_0x5381('0x30')]+=0x1;if(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x62')]){_0x48f9a1['voiceQueues'][_0x31957e]['answered']+=0x1;_0x48f9a1[_0x5381('0x16')][_0x31957e][_0x5381('0x37')]+=moment(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x63')])['diff'](moment(_0x274b7e[_0x251c0d][_0x5b6b1b][_0x5381('0x5c')]),'seconds')||0x0;}}else{_0x48f9a1['voiceQueues'][_0x31957e][_0x5381('0x36')]+=_0x48f9a1[_0x5381('0x16')][_0x31957e][_0x5381('0x32')]||0x0;}}}}}}return _0x48f9a1['voiceQueues'];};};Realtime[_0x5381('0x43')][_0x5381('0x64')]=function(){var _0xe1aa40=this;return function(_0xb31306){clearVoiceCallReports(_0xe1aa40['outbound']);if(_0xb31306){for(var _0x12c20f=0x0;_0x12c20f<_0xb31306['length'];_0x12c20f+=0x1){_0xe1aa40[_0x5381('0x19')]['total']+=0x1;_0xe1aa40[_0x5381('0x19')][_0x5381('0x36')]+=_0xb31306[_0x12c20f][_0x5381('0x65')];if(_0xb31306[_0x12c20f][_0x5381('0x66')]==='ANSWERED'){_0xe1aa40[_0x5381('0x19')][_0x5381('0x31')]+=0x1;_0xe1aa40[_0x5381('0x19')][_0x5381('0x32')]+=_0xb31306[_0x12c20f][_0x5381('0x65')]-_0xb31306[_0x12c20f][_0x5381('0x67')]||0x0;_0xe1aa40[_0x5381('0x19')][_0x5381('0x37')]+=_0xb31306[_0x12c20f][_0x5381('0x67')];}}}return _0xe1aa40[_0x5381('0x19')];};};Realtime['prototype'][_0x5381('0x68')]=function(){var _0x418529=this;return function(_0x373443){if(_0x373443){freeIsNotKey(_0x373443,_0x418529['campaigns'],_0x5381('0x2e'));for(var _0xbbc5ed=0x0,_0x5034f5={};_0xbbc5ed<_0x373443[_0x5381('0x45')];_0xbbc5ed+=0x1){_0x5034f5=_0x373443[_0xbbc5ed];if(_['isUndefined'](_0x418529['campaigns'][_0x5034f5[_0x5381('0x2e')]])){_0x418529[_0x5381('0x17')][_0x5034f5[_0x5381('0x2e')]]=new Campaign(_0x5034f5);}else{_0x418529[_0x5381('0x44')](_0x418529[_0x5381('0x17')][_0x5034f5[_0x5381('0x2e')]],_0x5034f5);_0x418529[_0x5381('0x17')][_0x5034f5[_0x5381('0x2e')]][_0x5381('0x69')]=_0x5034f5[_0x5381('0x6a')]?_0x5034f5['SquareProject'][_0x5381('0x2e')]:undefined;}}}return _0x418529[_0x5381('0x17')];};};Realtime[_0x5381('0x43')][_0x5381('0x6b')]=function(){var _0x48fef3=this;return function(_0x55cd4b){if(_0x55cd4b){freeIsNotKey(_0x55cd4b,_0x48fef3[_0x5381('0x1a')],'id');for(var _0x2dc1f3=0x0,_0xd28efa={};_0x2dc1f3<_0x55cd4b[_0x5381('0x45')];_0x2dc1f3+=0x1){_0xd28efa=_0x55cd4b[_0x2dc1f3];if(_[_0x5381('0x47')](_0x48fef3[_0x5381('0x1a')][_0xd28efa['id']])){_0x48fef3[_0x5381('0x1a')][_0xd28efa['id']]=new VoiceExtension(_0xd28efa);}else{_0x48fef3[_0x5381('0x44')](_0x48fef3[_0x5381('0x1a')][_0xd28efa['id']],_0xd28efa);}}}return _0x48fef3[_0x5381('0x1a')];};};Realtime['prototype'][_0x5381('0x6c')]=function(){var _0x3a2408=this;return function(_0x7f84b2){clearCampaigns(_0x3a2408[_0x5381('0x17')]);for(var _0x2bd102=0x0;_0x2bd102<_0x7f84b2[_0x5381('0x45')];_0x2bd102+=0x1){_['merge'](_0x3a2408['campaigns'][_0x7f84b2[_0x2bd102][_0x5381('0x2e')]],_0x7f84b2[_0x2bd102]);}return _0x3a2408['campaigns'];};};Realtime[_0x5381('0x43')][_0x5381('0x6d')]=function(){var _0x57062d=this;return function(_0x1da96f){if(_0x1da96f){freeIsNotKey(_0x1da96f,_0x57062d['faxAccounts'],'id');for(var _0x3b93ba=0x0,_0x21bd9e={},_0x1d97c6={};_0x3b93ba<_0x1da96f['length'];_0x3b93ba+=0x1){_0x21bd9e=_0x1da96f[_0x3b93ba];if(_[_0x5381('0x47')](_0x57062d[_0x5381('0x29')][_0x21bd9e['id']])){_0x57062d['faxAccounts'][_0x21bd9e['id']]=new FaxAccount(_0x21bd9e);}else{_0x57062d[_0x5381('0x44')](_0x57062d[_0x5381('0x29')][_0x21bd9e['id']],_0x21bd9e);}}}return _0x57062d[_0x5381('0x29')];};};module[_0x5381('0x6e')]=Realtime; \ No newline at end of file +var _0x770b=['queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','name','SIP/%s','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','prototype','isNil','format','isUndefined','initTelephones','telephones','initTrunks','length','initVoiceQueues','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x770b,0xf5));var _0xb770=function(_0x2bae67,_0x1077b2){_0x2bae67=_0x2bae67-0x0;var _0x5f29ed=_0x770b[_0x2bae67];return _0x5f29ed;};'use strict';var BPromise=require(_0xb770('0x0'));var util=require(_0xb770('0x1'));var _=require('lodash');var moment=require(_0xb770('0x2'));var Agent=require(_0xb770('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xb770('0x4'));var VoiceQueue=require(_0xb770('0x5'));var Trigger=require(_0xb770('0x6'));var Template=require(_0xb770('0x7'));var Campaign=require(_0xb770('0x8'));var VoiceExtension=require(_0xb770('0x9'));var ZendeskAccount=require(_0xb770('0xa'));var SalesforceAccount=require(_0xb770('0xb'));var FreshdeskAccount=require(_0xb770('0xc'));var SugarcrmAccount=require(_0xb770('0xd'));var ZohoAccount=require(_0xb770('0xe'));var DeskAccount=require(_0xb770('0xf'));var VtigerAccount=require(_0xb770('0x10'));var ServicenowAccount=require(_0xb770('0x11'));var Dynamics365Account=require(_0xb770('0x12'));var FreshsalesAccount=require(_0xb770('0x13'));var FaxAccount=require(_0xb770('0x14'));var Realtime=function(){this[_0xb770('0x15')]={};this['telephones']={};this[_0xb770('0x16')]={};this[_0xb770('0x17')]={};this[_0xb770('0x18')]={};this[_0xb770('0x19')]={};this[_0xb770('0x1a')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb770('0x1b')]={};this['channels']={};this[_0xb770('0x1c')]={};this[_0xb770('0x1d')]={};this[_0xb770('0x1e')]={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0xb770('0x1f')]={};this['freshdeskAccounts']={};this[_0xb770('0x20')]={};this[_0xb770('0x21')]={};this['vtigerAccounts']={};this[_0xb770('0x22')]={};this[_0xb770('0x23')]={};this[_0xb770('0x24')]={};this[_0xb770('0x25')]={};};function freeIsNotKey(_0xbd8d15,_0x34ef9b,_0x2dabe0){var _0x52f7d4=_[_0xb770('0x26')](_0xbd8d15,function(_0x3d5414,_0x206fc7){return _0x3d5414[_0x2dabe0];});for(var _0x509b3d in _0x34ef9b){if(_0x34ef9b[_0xb770('0x27')](_0x509b3d)){if(!_0x52f7d4[_0x509b3d]){delete _0x34ef9b[_0x509b3d];}}}}function freeIsNotKeySip(_0x25c8cf,_0x3a4c59){var _0x7d7350=_[_0xb770('0x26')](_0x25c8cf,function(_0x3e1a04,_0x544b26){return util['format']('SIP/%s',_0x3e1a04[_0xb770('0x28')]);});for(var _0x4dbe65 in _0x3a4c59){if(_0x3a4c59[_0xb770('0x27')](_0x4dbe65)){if(!_0x7d7350[_0x4dbe65]){delete _0x3a4c59[_0x4dbe65];}}}}function freeIsNotKeyAgent(_0x1a89f7,_0x246d5d){var _0x1cf8da=_['mapKeys'](_0x1a89f7,function(_0x44c4d8,_0x407494){var _0x1a4648=_['isNil'](_0x44c4d8['interface'])?util['format'](_0xb770('0x29'),_0x44c4d8[_0xb770('0x28')]):_0x44c4d8[_0xb770('0x2a')];return _0x1a4648;});for(var _0x1d4229 in _0x246d5d){if(_0x246d5d[_0xb770('0x27')](_0x1d4229)){if(!_0x1cf8da[_0x1d4229]){delete _0x246d5d[_0x1d4229];}}}}function clearVoiceCallReports(_0x1ae0ed){_0x1ae0ed['total']=0x0;_0x1ae0ed[_0xb770('0x2b')]=0x0;_0x1ae0ed[_0xb770('0x2c')]=0x0;_0x1ae0ed[_0xb770('0x2d')]=0x0;_0x1ae0ed[_0xb770('0x2e')]=0x0;}function clearCampaigns(_0x5efd99){if(!_[_0xb770('0x2f')](_0x5efd99)){for(var _0x429719 in _0x5efd99){if(_0x5efd99[_0xb770('0x27')](_0x429719)){_0x5efd99[_0x429719][_0xb770('0x30')]=0x0;_0x5efd99[_0x429719][_0xb770('0x31')]=0x0;}}}}function clearVoiceQueues(_0x52637f){if(!_[_0xb770('0x2f')](_0x52637f)){for(var _0x4916eb in _0x52637f){if(_0x52637f[_0xb770('0x27')](_0x4916eb)){_0x52637f[_0x4916eb][_0xb770('0x32')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x2b')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x33')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x34')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x2c')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x2d')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x2e')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x35')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x36')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x37')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x38')]=0x0;_0x52637f[_0x4916eb]['outboundNoSuchCallsDay']=0x0;_0x52637f[_0x4916eb][_0xb770('0x39')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x3a')]=0x0;_0x52637f[_0x4916eb]['outboundDropCallsDayCallersExit']=0x0;_0x52637f[_0x4916eb][_0xb770('0x3b')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x3c')]=0x0;_0x52637f[_0x4916eb]['outboundRejectCallsDay']=0x0;_0x52637f[_0x4916eb][_0xb770('0x3d')]=0x0;_0x52637f[_0x4916eb][_0xb770('0x35')]=0x0;_0x52637f[_0x4916eb]['outboundAnswerCallsDay']=0x0;_0x52637f[_0x4916eb][_0xb770('0x3e')]=!![];}}}}Realtime['prototype'][_0xb770('0x3f')]=function(_0x6ac4f,_0x50127a){for(var _0x2dc886 in _0x50127a){if(_0x6ac4f['hasOwnProperty'](_0x2dc886)){_0x6ac4f[_0x2dc886]=_0x50127a[_0x2dc886];}}};Realtime[_0xb770('0x40')]['initAgents']=function(){var _0x14f771=this;return function(_0x3b70ec){if(_0x3b70ec){freeIsNotKeyAgent(_0x3b70ec,_0x14f771[_0xb770('0x15')]);for(var _0x3ade33=0x0,_0x317567={},_0x24ed93={};_0x3ade33<_0x3b70ec['length'];_0x3ade33+=0x1){_0x317567=_0x3b70ec[_0x3ade33];var _0x58d99e=_[_0xb770('0x41')](_0x317567[_0xb770('0x2a')])?util[_0xb770('0x42')](_0xb770('0x29'),_0x317567[_0xb770('0x28')]):_0x317567[_0xb770('0x2a')];if(_[_0xb770('0x43')](_0x14f771[_0xb770('0x15')][_0x58d99e])){_0x14f771['agents'][_0x58d99e]=new Agent(_0x317567);}else{_0x14f771['mergeFromDatabase'](_0x14f771['agents'][_0x58d99e],_0x317567);}}}return _0x14f771['agents'];};};Realtime[_0xb770('0x40')][_0xb770('0x44')]=function(){var _0x5abca3=this;return function(_0x4ec40d){if(_0x4ec40d){freeIsNotKeySip(_0x4ec40d,_0x5abca3[_0xb770('0x45')]);for(var _0x46801e=0x0,_0x1acabc={},_0x4501b2={};_0x46801e<_0x4ec40d['length'];_0x46801e+=0x1){_0x1acabc=_0x4ec40d[_0x46801e];if(_[_0xb770('0x43')](_0x5abca3[_0xb770('0x45')][util[_0xb770('0x42')]('SIP/%s',_0x1acabc[_0xb770('0x28')])])){_0x5abca3[_0xb770('0x45')][util['format']('SIP/%s',_0x1acabc[_0xb770('0x28')])]=new Telephone(_0x1acabc);}else{_0x5abca3['mergeFromDatabase'](_0x5abca3['telephones'][util[_0xb770('0x42')]('SIP/%s',_0x1acabc[_0xb770('0x28')])],_0x1acabc);}}}return _0x5abca3['telephones'];};};Realtime[_0xb770('0x40')][_0xb770('0x46')]=function(){var _0x4aab8d=this;return function(_0x2b59d4){if(_0x2b59d4){freeIsNotKeySip(_0x2b59d4,_0x4aab8d[_0xb770('0x16')]);for(var _0x2c3c2f=0x0,_0xe7d932={},_0x3883b3={};_0x2c3c2f<_0x2b59d4[_0xb770('0x47')];_0x2c3c2f+=0x1){_0xe7d932=_0x2b59d4[_0x2c3c2f];if(_[_0xb770('0x43')](_0x4aab8d[_0xb770('0x16')][util[_0xb770('0x42')](_0xb770('0x29'),_0xe7d932['name'])])){_0x4aab8d[_0xb770('0x16')][util['format'](_0xb770('0x29'),_0xe7d932[_0xb770('0x28')])]=new Trunk(_0xe7d932);}else{_0x4aab8d[_0xb770('0x3f')](_0x4aab8d[_0xb770('0x16')][util[_0xb770('0x42')](_0xb770('0x29'),_0xe7d932[_0xb770('0x28')])],_0xe7d932);}}}return _0x4aab8d['trunks'];};};Realtime[_0xb770('0x40')][_0xb770('0x48')]=function(){var _0x5133bc=this;return function(_0x5b7060){if(_0x5b7060){freeIsNotKey(_0x5b7060,_0x5133bc[_0xb770('0x17')],_0xb770('0x28'));for(var _0x4e57b2=0x0,_0x1d54df={},_0x39880a={};_0x4e57b2<_0x5b7060[_0xb770('0x47')];_0x4e57b2+=0x1){_0x1d54df=_0x5b7060[_0x4e57b2];if(_[_0xb770('0x43')](_0x5133bc[_0xb770('0x17')][_0x1d54df[_0xb770('0x28')]])){_0x5133bc['voiceQueues'][_0x1d54df[_0xb770('0x28')]]=new VoiceQueue(_0x1d54df);}else{_0x5133bc[_0xb770('0x3f')](_0x5133bc[_0xb770('0x17')][_0x1d54df['name']],_0x1d54df);}}}return _0x5133bc[_0xb770('0x17')];};};Realtime['prototype']['initTriggers']=function(){var _0x28b141=this;return function(_0x3d3685){if(_0x3d3685){freeIsNotKey(_0x3d3685,_0x28b141[_0xb770('0x18')],'id');for(var _0x4383d4=0x0,_0x1fbf2a={},_0x59579f={};_0x4383d4<_0x3d3685[_0xb770('0x47')];_0x4383d4+=0x1){_0x1fbf2a=_0x3d3685[_0x4383d4];if(_[_0xb770('0x43')](_0x28b141[_0xb770('0x18')][_0x1fbf2a['id']])){_0x28b141['triggers'][_0x1fbf2a['id']]=new Trigger(_0x1fbf2a);}else{_0x28b141[_0xb770('0x3f')](_0x28b141[_0xb770('0x18')][_0x1fbf2a['id']],_0x1fbf2a);}}}return _0x28b141[_0xb770('0x18')];};};Realtime[_0xb770('0x40')][_0xb770('0x49')]=function(){var _0x4b3d0e=this;return function(_0x5b44cc){if(_0x5b44cc){freeIsNotKey(_0x5b44cc,_0x4b3d0e['templates'],'id');for(var _0x1c6c5e=0x0,_0x4c9009={},_0x40760d={};_0x1c6c5e<_0x5b44cc['length'];_0x1c6c5e+=0x1){_0x4c9009=_0x5b44cc[_0x1c6c5e];if(_[_0xb770('0x43')](_0x4b3d0e[_0xb770('0x1a')][_0x4c9009['id']])){_0x4b3d0e['templates'][_0x4c9009['id']]=new Template(_0x4c9009);}else{_0x4b3d0e['mergeFromDatabase'](_0x4b3d0e[_0xb770('0x1a')][_0x4c9009['id']],_0x4c9009);}}}return _0x4b3d0e[_0xb770('0x1a')];};};Realtime[_0xb770('0x40')][_0xb770('0x4a')]=function(){var _0x526638=this;return function(_0x8b82e0){if(_0x8b82e0){freeIsNotKey(_0x8b82e0,_0x526638['zendeskAccounts'],'id');for(var _0x2a651d=0x0,_0x5448a3={},_0x2fca9f={};_0x2a651d<_0x8b82e0[_0xb770('0x47')];_0x2a651d+=0x1){_0x5448a3=_0x8b82e0[_0x2a651d];if(_[_0xb770('0x43')](_0x526638[_0xb770('0x4b')][_0x5448a3['id']])){_0x526638[_0xb770('0x4b')][_0x5448a3['id']]=new ZendeskAccount(_0x5448a3);}else{_0x526638[_0xb770('0x3f')](_0x526638[_0xb770('0x4b')][_0x5448a3['id']],_0x5448a3);}}}return _0x526638[_0xb770('0x4b')];};};Realtime[_0xb770('0x40')][_0xb770('0x4c')]=function(){var _0x4f2025=this;return function(_0x18586a){if(_0x18586a){freeIsNotKey(_0x18586a,_0x4f2025['salesforceAccounts'],'id');for(var _0x50466c=0x0,_0x2e8ea0={},_0x3b7484={};_0x50466c<_0x18586a[_0xb770('0x47')];_0x50466c+=0x1){_0x2e8ea0=_0x18586a[_0x50466c];if(_['isUndefined'](_0x4f2025[_0xb770('0x4d')][_0x2e8ea0['id']])){_0x4f2025[_0xb770('0x4d')][_0x2e8ea0['id']]=new SalesforceAccount(_0x2e8ea0);}else{_0x4f2025['mergeFromDatabase'](_0x4f2025[_0xb770('0x4d')][_0x2e8ea0['id']],_0x2e8ea0);}}}return _0x4f2025[_0xb770('0x4d')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x5f0ed0=this;return function(_0x59e831){if(_0x59e831){freeIsNotKey(_0x59e831,_0x5f0ed0[_0xb770('0x4e')],'id');for(var _0x5adf4d=0x0,_0x3bd537={},_0x1a41b8={};_0x5adf4d<_0x59e831['length'];_0x5adf4d+=0x1){_0x3bd537=_0x59e831[_0x5adf4d];if(_[_0xb770('0x43')](_0x5f0ed0[_0xb770('0x4e')][_0x3bd537['id']])){_0x5f0ed0[_0xb770('0x4e')][_0x3bd537['id']]=new FreshdeskAccount(_0x3bd537);}else{_0x5f0ed0[_0xb770('0x3f')](_0x5f0ed0[_0xb770('0x4e')][_0x3bd537['id']],_0x3bd537);}}}return _0x5f0ed0[_0xb770('0x4e')];};};Realtime[_0xb770('0x40')][_0xb770('0x4f')]=function(){var _0x3daff9=this;return function(_0x35d649){if(_0x35d649){freeIsNotKey(_0x35d649,_0x3daff9[_0xb770('0x20')],'id');for(var _0x550757=0x0,_0x5ce213={},_0x3005f1={};_0x550757<_0x35d649[_0xb770('0x47')];_0x550757+=0x1){_0x5ce213=_0x35d649[_0x550757];if(_['isUndefined'](_0x3daff9[_0xb770('0x20')][_0x5ce213['id']])){_0x3daff9[_0xb770('0x20')][_0x5ce213['id']]=new ZohoAccount(_0x5ce213);}else{_0x3daff9[_0xb770('0x3f')](_0x3daff9[_0xb770('0x20')][_0x5ce213['id']],_0x5ce213);}}}return _0x3daff9[_0xb770('0x20')];};};Realtime[_0xb770('0x40')][_0xb770('0x50')]=function(){var _0x37cacf=this;return function(_0x4ac901){if(_0x4ac901){freeIsNotKey(_0x4ac901,_0x37cacf[_0xb770('0x21')],'id');for(var _0x135782=0x0,_0x5b5e85={},_0x3e2752={};_0x135782<_0x4ac901[_0xb770('0x47')];_0x135782+=0x1){_0x5b5e85=_0x4ac901[_0x135782];if(_['isUndefined'](_0x37cacf[_0xb770('0x21')][_0x5b5e85['id']])){_0x37cacf[_0xb770('0x21')][_0x5b5e85['id']]=new DeskAccount(_0x5b5e85);}else{_0x37cacf['mergeFromDatabase'](_0x37cacf[_0xb770('0x21')][_0x5b5e85['id']],_0x5b5e85);}}}return _0x37cacf['deskAccounts'];};};Realtime[_0xb770('0x40')][_0xb770('0x51')]=function(){var _0x5070b7=this;return function(_0xa52e34){if(_0xa52e34){freeIsNotKey(_0xa52e34,_0x5070b7[_0xb770('0x1f')],'id');for(var _0x76a71c=0x0,_0x3599e0={},_0x4c2444={};_0x76a71c<_0xa52e34[_0xb770('0x47')];_0x76a71c+=0x1){_0x3599e0=_0xa52e34[_0x76a71c];if(_[_0xb770('0x43')](_0x5070b7[_0xb770('0x1f')][_0x3599e0['id']])){_0x5070b7[_0xb770('0x1f')][_0x3599e0['id']]=new SugarcrmAccount(_0x3599e0);}else{_0x5070b7[_0xb770('0x3f')](_0x5070b7[_0xb770('0x1f')][_0x3599e0['id']],_0x3599e0);}}}return _0x5070b7[_0xb770('0x1f')];};};Realtime[_0xb770('0x40')]['initVtigerAccounts']=function(){var _0x44ea57=this;return function(_0x1adec6){if(_0x1adec6){freeIsNotKey(_0x1adec6,_0x44ea57[_0xb770('0x52')],'id');for(var _0x2a6de9=0x0,_0x19315f={},_0x87c2e6={};_0x2a6de9<_0x1adec6[_0xb770('0x47')];_0x2a6de9+=0x1){_0x19315f=_0x1adec6[_0x2a6de9];if(_[_0xb770('0x43')](_0x44ea57[_0xb770('0x52')][_0x19315f['id']])){_0x44ea57[_0xb770('0x52')][_0x19315f['id']]=new VtigerAccount(_0x19315f);}else{_0x44ea57['mergeFromDatabase'](_0x44ea57['vtigerAccounts'][_0x19315f['id']],_0x19315f);}}}return _0x44ea57[_0xb770('0x52')];};};Realtime[_0xb770('0x40')][_0xb770('0x53')]=function(){var _0x371a9a=this;return function(_0x3b5702){if(_0x3b5702){freeIsNotKey(_0x3b5702,_0x371a9a[_0xb770('0x22')],'id');for(var _0x1e4f86=0x0,_0x3c246d={},_0x20bad2={};_0x1e4f86<_0x3b5702[_0xb770('0x47')];_0x1e4f86+=0x1){_0x3c246d=_0x3b5702[_0x1e4f86];if(_['isUndefined'](_0x371a9a[_0xb770('0x22')][_0x3c246d['id']])){_0x371a9a[_0xb770('0x22')][_0x3c246d['id']]=new ServicenowAccount(_0x3c246d);}else{_0x371a9a['mergeFromDatabase'](_0x371a9a['servicenowAccounts'][_0x3c246d['id']],_0x3c246d);}}}return _0x371a9a[_0xb770('0x22')];};};Realtime['prototype'][_0xb770('0x54')]=function(){var _0x3ea190=this;return function(_0x319fed){if(_0x319fed){freeIsNotKey(_0x319fed,_0x3ea190[_0xb770('0x23')],'id');for(var _0x3333cc=0x0,_0x4ff83e={},_0x4d8829={};_0x3333cc<_0x319fed[_0xb770('0x47')];_0x3333cc+=0x1){_0x4ff83e=_0x319fed[_0x3333cc];if(_[_0xb770('0x43')](_0x3ea190[_0xb770('0x23')][_0x4ff83e['id']])){_0x3ea190[_0xb770('0x23')][_0x4ff83e['id']]=new Dynamics365Account(_0x4ff83e);}else{_0x3ea190['mergeFromDatabase'](_0x3ea190['dynamics365Accounts'][_0x4ff83e['id']],_0x4ff83e);}}}return _0x3ea190[_0xb770('0x23')];};};Realtime['prototype'][_0xb770('0x55')]=function(){var _0x20793e=this;return function(_0xf68692){if(_0xf68692){freeIsNotKey(_0xf68692,_0x20793e[_0xb770('0x24')],'id');for(var _0x44d555=0x0,_0x4089b7={},_0x35a2ac={};_0x44d555<_0xf68692['length'];_0x44d555+=0x1){_0x4089b7=_0xf68692[_0x44d555];if(_['isUndefined'](_0x20793e[_0xb770('0x24')][_0x4089b7['id']])){_0x20793e[_0xb770('0x24')][_0x4089b7['id']]=new FreshsalesAccount(_0x4089b7);}else{_0x20793e['mergeFromDatabase'](_0x20793e[_0xb770('0x24')][_0x4089b7['id']],_0x4089b7);}}}return _0x20793e['freshsalesAccounts'];};};Realtime['prototype'][_0xb770('0x56')]=function(){var _0x5e7c51=this;return function(_0x11c31a){for(var _0x302c95=0x0;_0x302c95<_0x11c31a[_0xb770('0x47')];_0x302c95+=0x1){_['merge'](_0x5e7c51['voiceQueues'][_0x11c31a[_0x302c95][_0xb770('0x28')]],_0x11c31a[_0x302c95]);}return _0x5e7c51[_0xb770('0x17')];};};Realtime['prototype'][_0xb770('0x57')]=function(){var _0x2799a3=this;return function(_0x3f5200){clearVoiceQueues(_0x2799a3[_0xb770('0x17')]);if(_0x3f5200){_0x3f5200=_[_0xb770('0x58')](_0x3f5200,'uniqueid');for(var _0x23e0ff in _0x3f5200){if(_0x3f5200[_0xb770('0x27')](_0x23e0ff)){var _0x399d42={};for(var _0x2b2cbe=0x0;_0x2b2cbe<_0x3f5200[_0x23e0ff][_0xb770('0x47')];_0x2b2cbe+=0x1){var _0x4d7ac1=_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x59')];if(_0x2799a3[_0xb770('0x17')][_0x4d7ac1]){if(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5a')]){_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x33')]+=0x1;}if(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5b')]){_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x34')]+=0x1;}_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x2c')]+=moment(_0x3f5200[_0x23e0ff][_0x2b2cbe]['queuecallerleaveAt'])['diff'](moment(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5c')]),_0xb770('0x5d'))||0x0;if(_0x2b2cbe===_0x3f5200[_0x23e0ff][_0xb770('0x47')]-0x1){_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x2d')]+=moment(_0x3f5200[_0x23e0ff][_0x2b2cbe]['queuecallercompleteAt']||_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5e')]||_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5f')])[_0xb770('0x60')](moment(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x5c')]),'seconds')||0x0;_0x2799a3['voiceQueues'][_0x4d7ac1][_0xb770('0x32')]+=0x1;if(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x61')]){_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x2b')]+=0x1;_0x2799a3[_0xb770('0x17')][_0x4d7ac1]['sumBillable']+=moment(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x62')])[_0xb770('0x60')](moment(_0x3f5200[_0x23e0ff][_0x2b2cbe][_0xb770('0x63')]),_0xb770('0x5d'))||0x0;}}else{_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x2d')]+=_0x2799a3[_0xb770('0x17')][_0x4d7ac1][_0xb770('0x2c')]||0x0;}}}}}}return _0x2799a3['voiceQueues'];};};Realtime[_0xb770('0x40')][_0xb770('0x64')]=function(){var _0x5b2958=this;return function(_0x2979d8){clearVoiceCallReports(_0x5b2958[_0xb770('0x65')]);if(_0x2979d8){for(var _0x413855=0x0;_0x413855<_0x2979d8['length'];_0x413855+=0x1){_0x5b2958[_0xb770('0x65')][_0xb770('0x32')]+=0x1;_0x5b2958['outbound']['sumDuration']+=_0x2979d8[_0x413855][_0xb770('0x66')];if(_0x2979d8[_0x413855][_0xb770('0x67')]===_0xb770('0x68')){_0x5b2958['outbound'][_0xb770('0x2b')]+=0x1;_0x5b2958[_0xb770('0x65')][_0xb770('0x2c')]+=_0x2979d8[_0x413855][_0xb770('0x66')]-_0x2979d8[_0x413855][_0xb770('0x69')]||0x0;_0x5b2958[_0xb770('0x65')][_0xb770('0x2e')]+=_0x2979d8[_0x413855][_0xb770('0x69')];}}}return _0x5b2958['outbound'];};};Realtime[_0xb770('0x40')][_0xb770('0x6a')]=function(){var _0x4efc32=this;return function(_0x27c99f){if(_0x27c99f){freeIsNotKey(_0x27c99f,_0x4efc32['campaigns'],_0xb770('0x28'));for(var _0x296f3b=0x0,_0x2a5473={};_0x296f3b<_0x27c99f['length'];_0x296f3b+=0x1){_0x2a5473=_0x27c99f[_0x296f3b];if(_[_0xb770('0x43')](_0x4efc32[_0xb770('0x19')][_0x2a5473[_0xb770('0x28')]])){_0x4efc32['campaigns'][_0x2a5473[_0xb770('0x28')]]=new Campaign(_0x2a5473);}else{_0x4efc32[_0xb770('0x3f')](_0x4efc32[_0xb770('0x19')][_0x2a5473['name']],_0x2a5473);_0x4efc32[_0xb770('0x19')][_0x2a5473[_0xb770('0x28')]][_0xb770('0x6b')]=_0x2a5473[_0xb770('0x6c')]?_0x2a5473[_0xb770('0x6c')]['name']:undefined;}}}return _0x4efc32['campaigns'];};};Realtime['prototype'][_0xb770('0x6d')]=function(){var _0x3e97c1=this;return function(_0xfc7a3d){if(_0xfc7a3d){freeIsNotKey(_0xfc7a3d,_0x3e97c1['voiceExtensions'],'id');for(var _0x1aab6d=0x0,_0x23a60d={};_0x1aab6d<_0xfc7a3d['length'];_0x1aab6d+=0x1){_0x23a60d=_0xfc7a3d[_0x1aab6d];if(_[_0xb770('0x43')](_0x3e97c1[_0xb770('0x1b')][_0x23a60d['id']])){_0x3e97c1['voiceExtensions'][_0x23a60d['id']]=new VoiceExtension(_0x23a60d);}else{_0x3e97c1[_0xb770('0x3f')](_0x3e97c1[_0xb770('0x1b')][_0x23a60d['id']],_0x23a60d);}}}return _0x3e97c1[_0xb770('0x1b')];};};Realtime[_0xb770('0x40')][_0xb770('0x6e')]=function(){var _0x53b68c=this;return function(_0x388b9c){clearCampaigns(_0x53b68c[_0xb770('0x19')]);for(var _0xe62250=0x0;_0xe62250<_0x388b9c[_0xb770('0x47')];_0xe62250+=0x1){_[_0xb770('0x6f')](_0x53b68c['campaigns'][_0x388b9c[_0xe62250][_0xb770('0x28')]],_0x388b9c[_0xe62250]);}return _0x53b68c[_0xb770('0x19')];};};Realtime[_0xb770('0x40')]['initFaxAccounts']=function(){var _0x2eff4c=this;return function(_0x7f0214){if(_0x7f0214){freeIsNotKey(_0x7f0214,_0x2eff4c[_0xb770('0x25')],'id');for(var _0x2c571c=0x0,_0x1873d9={},_0x538dfe={};_0x2c571c<_0x7f0214['length'];_0x2c571c+=0x1){_0x1873d9=_0x7f0214[_0x2c571c];if(_[_0xb770('0x43')](_0x2eff4c[_0xb770('0x25')][_0x1873d9['id']])){_0x2eff4c['faxAccounts'][_0x1873d9['id']]=new FaxAccount(_0x1873d9);}else{_0x2eff4c[_0xb770('0x3f')](_0x2eff4c[_0xb770('0x25')][_0x1873d9['id']],_0x1873d9);}}}return _0x2eff4c[_0xb770('0x25')];};};module[_0xb770('0x70')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0d477a7..cc8a26c 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 _0x7b16=['indexOf','mobile','phone','substring','lodash','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','SIP/%s','length','assigned','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','split','outbound','internal','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','UserId','membername','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local'];(function(_0x29f44a,_0x5d4f21){var _0x4dcae0=function(_0xba57dd){while(--_0xba57dd){_0x29f44a['push'](_0x29f44a['shift']());}};_0x4dcae0(++_0x5d4f21);}(_0x7b16,0x1cb));var _0x67b1=function(_0x536491,_0x509c3b){_0x536491=_0x536491-0x0;var _0x33a143=_0x7b16[_0x536491];return _0x33a143;};'use strict';var _=require(_0x67b1('0x0'));var moment=require('moment');var util=require('util');var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x67b1('0x1'));var RpcVoiceDialReport=require(_0x67b1('0x2'));var RpcMemberReport=require(_0x67b1('0x3'));var RpcVoiceQueueReport=require(_0x67b1('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x67b1('0x5'));var VoiceQueueReport=require(_0x67b1('0x6'));var VoiceCallReport=require(_0x67b1('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x67b1('0x8'));function Report(_0x2092ff){this[_0x67b1('0x9')]=_0x2092ff;this[_0x67b1('0xa')]=_0x2092ff[_0x67b1('0xa')];this[_0x67b1('0xb')]=_0x2092ff['telephones'];}Report['prototype'][_0x67b1('0xc')]=function(_0x1ec481){var _0x33c270=new VoiceQueueReport(this[_0x67b1('0x9')]);var _0x49720a=new VoiceAgentReport(this[_0x67b1('0x9')]);var _0x4e614c=new VoiceDialReport(this[_0x67b1('0x9')]);var _0x387d7b=new VoiceCallReport(this[_0x67b1('0x9')]);var _0x173ce1=new UserReport(this[_0x67b1('0x9')]);if(config['xdr']&&config[_0x67b1('0xd')][_0x67b1('0xe')]){ami['on'](_0x67b1('0xf'),this[_0x67b1('0x10')]['bind'](this));ami['on'](_0x67b1('0x11'),this[_0x67b1('0x12')][_0x67b1('0x13')](this));ami['on'](_0x67b1('0x14'),this[_0x67b1('0x15')][_0x67b1('0x13')](this));ami['on'](_0x67b1('0x16'),this[_0x67b1('0x17')]['bind'](this));ami['on'](_0x67b1('0x18'),this[_0x67b1('0x19')][_0x67b1('0x13')](this));ami['on']('attendedtransfer',this[_0x67b1('0x1a')][_0x67b1('0x13')](this));}};Report[_0x67b1('0x1b')][_0x67b1('0x1c')]=function(_0x1410c1){var _0x393ba0;_0x393ba0=_[_0x67b1('0x1d')](this['agents'],function(_0x4cbd26){return _0x4cbd26['accountcode']==_0x1410c1||_0x4cbd26[_0x67b1('0x1e')]==_0x1410c1;});if(_[_0x67b1('0x1f')](_0x393ba0)){var _0x396bda=_['find'](this['telephones'],function(_0x39da57){return _0x39da57[_0x67b1('0x20')]==_0x1410c1||_0x39da57[_0x67b1('0x1e')]==_0x1410c1;});if(_0x396bda){_0x393ba0=_[_0x67b1('0x1d')](this[_0x67b1('0xa')],function(_0x31cb90){return _0x31cb90[_0x67b1('0x21')]==util['format'](_0x67b1('0x22'),_0x396bda[_0x67b1('0x1e')]);});}}return _0x393ba0;};Report[_0x67b1('0x1b')][_0x67b1('0x10')]=function(_0x54f7be){for(var _0x18fff2=0x0;_0x18fff2<_0x54f7be[_0x67b1('0x23')];_0x18fff2+=0x1){var _0x5ea318=this[_0x67b1('0x1c')](_0x54f7be[_0x18fff2]['connectedlinenum']);if(_0x5ea318){_0x54f7be[_0x18fff2][_0x67b1('0x20')]=_0x5ea318[_0x67b1('0x20')];_0x54f7be[_0x18fff2][_0x67b1('0x24')]=!![];_0x54f7be[_0x18fff2]['lastAssignedTo']=_0x5ea318['name'];_0x54f7be[_0x18fff2][_0x67b1('0x21')]=_[_0x67b1('0x1f')](_0x5ea318[_0x67b1('0x21')])?util[_0x67b1('0x25')](_0x67b1('0x22'),_0x5ea318['name']):_0x5ea318['interface'];if(_0x54f7be[_0x18fff2][_0x67b1('0x26')]){_0x54f7be[_0x18fff2][_0x67b1('0x27')]=moment()['format'](_0x67b1('0x28'));}if(_0x54f7be[_0x18fff2][_0x67b1('0x29')]){_0x54f7be[_0x18fff2][_0x67b1('0x2a')]=moment()[_0x67b1('0x25')](_0x67b1('0x28'));}RpcMemberReport[_0x67b1('0x10')](_0x54f7be[_0x18fff2]);}RpcVoiceQueueReport[_0x67b1('0x2b')](_0x54f7be[_0x18fff2]);}};function extractCalleridNumber(_0x13f512){var _0xc61326=_0x13f512[_0x67b1('0x2c')](/<(.*?)>/);return _0xc61326?_0xc61326[0x1]:_0x13f512;}Report[_0x67b1('0x1b')][_0x67b1('0x2d')]=function(_0x1ec199){for(var _0x42a163=0x0;_0x42a163','linkedid','transfers','uniqueid','UserId','membername','monitor','monitors','filename','createdAt','exten','calleridname','connectedlinename','voiceAgentReport','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5a69,0xe4));var _0x95a6=function(_0x5d26b7,_0x56fd12){_0x5d26b7=_0x5d26b7-0x0;var _0xbdb625=_0x5a69[_0x5d26b7];return _0xbdb625;};'use strict';var _=require(_0x95a6('0x0'));var moment=require(_0x95a6('0x1'));var util=require(_0x95a6('0x2'));var config=require(_0x95a6('0x3'));var ami=require(_0x95a6('0x4'));var RpcVoiceAgentReport=require(_0x95a6('0x5'));var RpcVoiceCallReport=require(_0x95a6('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x95a6('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x95a6('0x8'));var VoiceQueueReport=require(_0x95a6('0x9'));var VoiceCallReport=require(_0x95a6('0xa'));var VoiceAgentReport=require(_0x95a6('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x95a6('0xc'));function Report(_0x8eb019){this[_0x95a6('0xd')]=_0x8eb019;this[_0x95a6('0xe')]=_0x8eb019[_0x95a6('0xe')];this[_0x95a6('0xf')]=_0x8eb019[_0x95a6('0xf')];}Report[_0x95a6('0x10')][_0x95a6('0x11')]=function(_0x2f3be3){var _0xc679e7=new VoiceQueueReport(this[_0x95a6('0xd')]);var _0x5f27c3=new VoiceAgentReport(this[_0x95a6('0xd')]);var _0xcea4aa=new VoiceDialReport(this[_0x95a6('0xd')]);var _0x21d9b1=new VoiceCallReport(this['realtime']);var _0x39cf77=new UserReport(this[_0x95a6('0xd')]);if(config[_0x95a6('0x12')]&&config[_0x95a6('0x12')]['disabled']){ami['on'](_0x95a6('0x13'),this['voiceQueueReport']['bind'](this));ami['on'](_0x95a6('0x14'),this[_0x95a6('0x15')][_0x95a6('0x16')](this));ami['on'](_0x95a6('0x17'),this['voiceAgentReport'][_0x95a6('0x16')](this));ami['on'](_0x95a6('0x18'),this[_0x95a6('0x19')]['bind'](this));ami['on'](_0x95a6('0x1a'),this[_0x95a6('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x95a6('0x1c')]['bind'](this));}};Report[_0x95a6('0x10')][_0x95a6('0x1d')]=function(_0x46b93a){var _0x2e5b84;_0x2e5b84=_[_0x95a6('0x1e')](this[_0x95a6('0xe')],function(_0x224491){return _0x224491[_0x95a6('0x1f')]==_0x46b93a||_0x224491[_0x95a6('0x20')]==_0x46b93a;});if(_[_0x95a6('0x21')](_0x2e5b84)){var _0x2c8b6d=_['find'](this['telephones'],function(_0x224403){return _0x224403[_0x95a6('0x1f')]==_0x46b93a||_0x224403[_0x95a6('0x20')]==_0x46b93a;});if(_0x2c8b6d){_0x2e5b84=_['find'](this[_0x95a6('0xe')],function(_0xe5e687){return _0xe5e687['interface']==util[_0x95a6('0x22')]('SIP/%s',_0x2c8b6d[_0x95a6('0x20')]);});}}return _0x2e5b84;};Report[_0x95a6('0x10')][_0x95a6('0x23')]=function(_0x1709d1){for(var _0xd6d037=0x0;_0xd6d037<_0x1709d1[_0x95a6('0x24')];_0xd6d037+=0x1){var _0x17b968=this['findAgent'](_0x1709d1[_0xd6d037][_0x95a6('0x25')]);if(_0x17b968){_0x1709d1[_0xd6d037][_0x95a6('0x1f')]=_0x17b968[_0x95a6('0x1f')];_0x1709d1[_0xd6d037][_0x95a6('0x26')]=!![];_0x1709d1[_0xd6d037][_0x95a6('0x27')]=_0x17b968[_0x95a6('0x20')];_0x1709d1[_0xd6d037][_0x95a6('0x28')]=_[_0x95a6('0x21')](_0x17b968[_0x95a6('0x28')])?util[_0x95a6('0x22')]('SIP/%s',_0x17b968['name']):_0x17b968[_0x95a6('0x28')];if(_0x1709d1[_0xd6d037]['queuecallercomplete']){_0x1709d1[_0xd6d037]['queuecallercompleteAt']=moment()[_0x95a6('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1709d1[_0xd6d037][_0x95a6('0x29')]){_0x1709d1[_0xd6d037][_0x95a6('0x2a')]=moment()[_0x95a6('0x22')](_0x95a6('0x2b'));}RpcMemberReport[_0x95a6('0x23')](_0x1709d1[_0xd6d037]);}RpcVoiceQueueReport[_0x95a6('0x2c')](_0x1709d1[_0xd6d037]);}};function extractCalleridNumber(_0x25dfce){var _0x528544=_0x25dfce[_0x95a6('0x2d')](/<(.*?)>/);return _0x528544?_0x528544[0x1]:_0x25dfce;}Report[_0x95a6('0x10')][_0x95a6('0x2e')]=function(_0x2a5342){for(var _0x33413c=0x0;_0x33413c0x0?_0x58bf82:0x0;this['voiceQueues'][_0x43364c[_0xef00('0x6d')]]['talking']=this[_0xef00('0x15')][_0x43364c[_0xef00('0x6d')]][_0xef00('0x35')]>_[_0xef00('0x71')](_0x43364c[_0xef00('0x72')])?_[_0xef00('0x71')](_0x43364c[_0xef00('0x72')]):this[_0xef00('0x15')][_0x43364c[_0xef00('0x6d')]]['talking'];this[_0xef00('0x58')](this[_0xef00('0x15')][_0x43364c['queue']],_0xef00('0x73'));}logger[_0xef00('0x4a')](_0xef00('0x74'),util[_0xef00('0x43')](this[_0xef00('0x15')][_0x43364c[_0xef00('0x6d')]],{'showHidden':![],'depth':null}));ami[_0xef00('0x49')](_0xef00('0x75'),this['voiceQueues'][_0x43364c[_0xef00('0x6d')]]);}}}catch(_0x55ffe9){logger[_0xef00('0x42')](_0xef00('0x6b'),util[_0xef00('0x43')](_0x55ffe9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef00('0xd')][_0xef00('0x1c')]=function(_0x58aae0){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xef00('0x43')](_0x58aae0,{'showHidden':![],'depth':null}));ami[_0xef00('0x49')]('custom:queuesummarycomplete',{});this[_0xef00('0x16')]=!![];};VoiceQueueReport['prototype'][_0xef00('0x1d')]=function(_0x5b4cfe){try{if(this[_0xef00('0x6c')](_0x5b4cfe)){logger[_0xef00('0x4a')](_0xef00('0x76'),_0x5b4cfe[_0xef00('0x4d')],util[_0xef00('0x43')](_0x5b4cfe,{'showHidden':![],'depth':null}));if(_[_0xef00('0x68')](this[_0xef00('0x11')][_0x5b4cfe[_0xef00('0x4d')]]))this['queueReports'][_0x5b4cfe[_0xef00('0x4d')]]=[];if(_[_0xef00('0x68')](this[_0xef00('0x13')][_0x5b4cfe[_0xef00('0x4d')]]))this[_0xef00('0x13')][_0x5b4cfe['uniqueid']]={};var _0xfc6cdd=new QueueReport();_0xfc6cdd[_0xef00('0x4f')]=_0x5b4cfe[_0xef00('0x6d')];_0xfc6cdd[_0xef00('0x59')]=this[_0xef00('0x15')][_0xfc6cdd[_0xef00('0x4f')]]&&this[_0xef00('0x15')][_0xfc6cdd[_0xef00('0x4f')]][_0xef00('0x59')]?this[_0xef00('0x15')][_0xfc6cdd[_0xef00('0x4f')]][_0xef00('0x59')]||_0xef00('0x5a'):'inbound';_0xfc6cdd[_0xef00('0x6d')]=_0x5b4cfe['queue'];_0xfc6cdd[_0xef00('0x77')]=moment()[_0xef00('0x55')](_0xef00('0x78'));_0xfc6cdd[_0xef00('0x79')]=_0x5b4cfe[_0xef00('0x79')];_0xfc6cdd[_0xef00('0x7a')]=_0x5b4cfe['count'];_0xfc6cdd[_0xef00('0x4d')]=_0x5b4cfe[_0xef00('0x4d')];_0xfc6cdd[_0xef00('0x7b')]=this['channels'][_0x5b4cfe['uniqueid']]['routealias'];logger[_0xef00('0x7c')](_0xef00('0x7d'),_0xfc6cdd[_0xef00('0x4f')],_0xfc6cdd[_0xef00('0x59')]);_[_0xef00('0x7e')](_0xfc6cdd,_[_0xef00('0x7f')](_0x5b4cfe,_[_0xef00('0x80')](_0xfc6cdd)));this['queueReports'][_0x5b4cfe[_0xef00('0x4d')]]['push'](_0xfc6cdd);this[_0xef00('0x13')][_0x5b4cfe[_0xef00('0x4d')]]=_0xfc6cdd;this['emitVoiceQueueChannelSave'](_0xfc6cdd,'queuecallerjoin');}}catch(_0x2fbb7c){logger[_0xef00('0x42')](_0xef00('0x76'),_0x5b4cfe[_0xef00('0x4d')],util['inspect'](_0x2fbb7c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xef00('0x1e')]=function(_0x22a425){try{if(this[_0xef00('0x6c')](_0x22a425)){logger[_0xef00('0x4a')](_0xef00('0x81'),_0x22a425[_0xef00('0x4d')],util['inspect'](_0x22a425,{'showHidden':![],'depth':null}));if(this[_0xef00('0x11')][_0x22a425[_0xef00('0x4d')]]){var _0x4ee5e5=_[_0xef00('0x82')](this[_0xef00('0x11')][_0x22a425[_0xef00('0x4d')]]);_0x4ee5e5[_0xef00('0x83')]=![];_0x4ee5e5[_0xef00('0x84')]=null;_0x4ee5e5[_0xef00('0x85')]=_0x22a425[_0xef00('0x85')];_0x4ee5e5[_0xef00('0x86')]=_0x22a425[_0xef00('0x86')];_0x4ee5e5[_0xef00('0x87')]=!![];_0x4ee5e5[_0xef00('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4ee5e5[_0xef00('0x53')]='ABANDONED';_0x4ee5e5['lastAssignedTo']=null;logger[_0xef00('0x7c')](_0xef00('0x89'),_0x4ee5e5['name'],_0x4ee5e5['type']);this[_0xef00('0x13')][_0x22a425[_0xef00('0x4d')]]=_0x4ee5e5;this[_0xef00('0x8a')](_0x4ee5e5,'queuecallerabandon');}}}catch(_0x5c6d80){logger[_0xef00('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x22a425[_0xef00('0x4d')],util['inspect'](_0x5c6d80,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef00('0xd')][_0xef00('0x20')]=function(_0xd65cd6){try{if(this[_0xef00('0x6c')](_0xd65cd6)){logger[_0xef00('0x4a')](_0xef00('0x8b'),_0xd65cd6[_0xef00('0x4d')],util[_0xef00('0x43')](_0xd65cd6,{'showHidden':![],'depth':null}));if(this[_0xef00('0x11')][_0xd65cd6[_0xef00('0x4d')]]){var _0x4aee22=_[_0xef00('0x82')](this[_0xef00('0x11')][_0xd65cd6[_0xef00('0x4d')]]);_0x4aee22[_0xef00('0x8c')]=moment()[_0xef00('0x55')](_0xef00('0x78'));_0x4aee22[_0xef00('0x8d')]=_0xd65cd6[_0xef00('0x8d')];_0x4aee22[_0xef00('0x8e')]=_0xd65cd6[_0xef00('0x8e')];logger[_0xef00('0x7c')](_0xef00('0x8f'),_0x4aee22[_0xef00('0x4f')],_0x4aee22[_0xef00('0x59')],_0xd65cd6[_0xef00('0x8d')],_0xd65cd6[_0xef00('0x8e')]);this[_0xef00('0x13')][_0xd65cd6[_0xef00('0x4d')]]=_0x4aee22;this[_0xef00('0x90')](_0x4aee22,'queuecallerleave');}}}catch(_0x24cba9){logger[_0xef00('0x42')](_0xef00('0x8b'),_0xd65cd6[_0xef00('0x4d')],util[_0xef00('0x43')](_0x24cba9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x4d71cc){try{if(this[_0xef00('0x6c')](_0x4d71cc)){logger[_0xef00('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x4d71cc[_0xef00('0x4d')],util[_0xef00('0x43')](_0x4d71cc,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d71cc[_0xef00('0x4d')]]){var _0x168928=_[_0xef00('0x82')](this[_0xef00('0x11')][_0x4d71cc[_0xef00('0x4d')]]);_0x168928['queuecallercomplete']=!![];_0x168928[_0xef00('0x53')]=_0xef00('0x91');logger[_0xef00('0x7c')](_0xef00('0x92'),_0x168928[_0xef00('0x4f')],_0x168928[_0xef00('0x59')]);}}}catch(_0x563ccb){logger[_0xef00('0x42')]('[%s][voiceQueueReport][agentconnect]',_0x4d71cc[_0xef00('0x4d')],util[_0xef00('0x43')](_0x563ccb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef00('0xd')][_0xef00('0x21')]=function(_0x54b2f3){try{if(this[_0xef00('0x6c')](_0x54b2f3)){logger[_0xef00('0x4a')](_0xef00('0x93'),_0x54b2f3[_0xef00('0x4d')],util[_0xef00('0x43')](_0x54b2f3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x54b2f3[_0xef00('0x4d')]]){var _0x35e9d5=_[_0xef00('0x82')](this[_0xef00('0x11')][_0x54b2f3[_0xef00('0x4d')]]);_0x35e9d5[_0xef00('0x87')]=![];_0x35e9d5['queuecallerabandonAt']=null;_0x35e9d5[_0xef00('0x94')]=!![];_0x35e9d5[_0xef00('0x95')]=_0x54b2f3['membername'];_0x35e9d5[_0xef00('0x85')]=_0x54b2f3[_0xef00('0x85')];_0x35e9d5[_0xef00('0x83')]=!![];_0x35e9d5[_0xef00('0x96')]=![];_0x35e9d5[_0xef00('0x97')]=null;if(!_0x35e9d5['transfer']){if(_0x54b2f3[_0xef00('0x98')]==_0xef00('0x99')){_0x35e9d5['queuecallerexitreason']=_0xef00('0x9a');logger[_0xef00('0x7c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x35e9d5[_0xef00('0x4f')],_0x35e9d5[_0xef00('0x59')]);}else{if(_[_0xef00('0x9b')](_0x54b2f3[_0xef00('0x3e')][_0xef00('0x9c')](),_0xef00('0x9d'))){if(this[_0xef00('0x11')][_0x54b2f3['linkedid']]){var _0x277867=_[_0xef00('0x82')](this['queueReports'][_0x54b2f3[_0xef00('0x9e')]]);_0x277867[_0xef00('0x83')]=![];_0x277867[_0xef00('0x96')]=!![];_0x277867['queuecallerexitAt']=moment(_0x35e9d5[_0xef00('0x77')])[_0xef00('0x9f')](_0x54b2f3['holdtime'],'seconds')['format'](_0xef00('0x78'));_0x277867[_0xef00('0x53')]=_0xef00('0xa0');_0x277867[_0xef00('0x99')]=!![];_0x277867[_0xef00('0xa1')]=_0xef00('0xa2');_0x277867[_0xef00('0xa3')]=_0x54b2f3[_0xef00('0xa4')];_0x277867['transferuniqueid']=_0x54b2f3[_0xef00('0x4d')];logger[_0xef00('0x7c')](_0xef00('0xa5'),_0x277867[_0xef00('0x4f')],_0x277867[_0xef00('0x59')]);var _0x19b0ec=this[_0xef00('0x11')][_0x54b2f3[_0xef00('0x9e')]];this[_0xef00('0x11')][_0x54b2f3[_0xef00('0x9e')]]=this[_0xef00('0x11')][_0x54b2f3[_0xef00('0x4d')]];this['queueReports'][_0x54b2f3[_0xef00('0x4d')]]=_0x19b0ec;}}else{_0x35e9d5[_0xef00('0x53')]=_0xef00('0xa6')+_0x54b2f3[_0xef00('0x98')][_0xef00('0xa7')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x35e9d5['name'],_0x35e9d5['type'],_0x35e9d5[_0xef00('0x53')]);}}}this['channels'][_0x54b2f3[_0xef00('0x4d')]]=_0x35e9d5;this['emitVoiceQueueChannelRemove'](_0x35e9d5,'agentcomplete');}}}catch(_0x5e0b86){logger[_0xef00('0x42')](_0xef00('0x93'),_0x54b2f3[_0xef00('0x4d')],util[_0xef00('0x43')](_0x5e0b86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef00('0xd')][_0xef00('0x24')]=function(_0x30e2e9){try{if(this['isNotNull'](_0x30e2e9)){logger[_0xef00('0x4a')](_0xef00('0xa8'),_0x30e2e9[_0xef00('0x4d')],util[_0xef00('0x43')](_0x30e2e9,{'showHidden':![],'depth':null}));this[_0xef00('0xa9')](_0x30e2e9[_0xef00('0x4d')],_['keys'](_0x30e2e9[_0xef00('0xaa')])[0x0],_0x30e2e9[_0xef00('0xab')]);if(this['queueReports'][_0x30e2e9[_0xef00('0x4d')]]){var _0x2c4fde=_['last'](this['queueReports'][_0x30e2e9[_0xef00('0x4d')]]);if(_0x2c4fde){if(this[_0xef00('0x6c')](_0x30e2e9[_0xef00('0xaa')])&&this[_0xef00('0x6c')](_0x30e2e9[_0xef00('0xaa')][_0xef00('0xac')])){switch(_0x30e2e9[_0xef00('0xab')]){case _0xef00('0xad'):_0x2c4fde[_0xef00('0x96')]=![];_0x2c4fde['queuecallerexitAt']=null;break;case'TIMEOUT':_0x2c4fde[_0xef00('0xae')]=_0xef00('0xaf');_0x2c4fde[_0xef00('0x96')]=!![];_0x2c4fde[_0xef00('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c4fde[_0xef00('0x8c')]=moment()[_0xef00('0x55')](_0xef00('0x78'));logger[_0xef00('0x4a')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x30e2e9[_0xef00('0x4d')],util[_0xef00('0x43')](_0x2c4fde,{'showHidden':![],'depth':null}));ami[_0xef00('0x49')](_0xef00('0xb0'),_0x2c4fde);break;default:_0x2c4fde[_0xef00('0x96')]=!![];_0x2c4fde[_0xef00('0x97')]=moment()[_0xef00('0x55')](_0xef00('0x78'));_0x2c4fde[_0xef00('0x8c')]=moment()[_0xef00('0x55')](_0xef00('0x78'));}_0x2c4fde[_0xef00('0x87')]=![];_0x2c4fde['queuecallerabandonAt']=null;_0x2c4fde[_0xef00('0x53')]=_0x30e2e9[_0xef00('0xab')];this[_0xef00('0x13')][_0x30e2e9[_0xef00('0x4d')]]=_0x2c4fde;this[_0xef00('0x8a')](_0x2c4fde,_0xef00('0x23'));}else if(this['isNotNull'](_0x30e2e9['variable'])&&this[_0xef00('0x6c')](_0x30e2e9[_0xef00('0xaa')][_0xef00('0xb1')])){if(!_0x2c4fde[_0xef00('0x87')]){_0x2c4fde['queuecallerexit']=!![];_0x2c4fde[_0xef00('0x97')]=moment()[_0xef00('0x55')](_0xef00('0x78'));_0x2c4fde[_0xef00('0x53')]=_0xef00('0xb2');_0x2c4fde[_0xef00('0x8c')]=moment()['format'](_0xef00('0x78'));this[_0xef00('0x13')][_0x30e2e9[_0xef00('0x4d')]]=_0x2c4fde;}}logger[_0xef00('0x7c')](_0xef00('0xb3'),_0x30e2e9[_0xef00('0x4d')],_0x2c4fde['name'],_0x2c4fde[_0xef00('0x59')],_[_0xef00('0x80')](_0x30e2e9[_0xef00('0xaa')])[0x0],_0x30e2e9[_0xef00('0xab')]);_0x2c4fde[_0xef00('0x18')]=this[_0xef00('0x18')][_0x30e2e9['uniqueid']];}}}}catch(_0x6434e8){logger[_0xef00('0x42')](_0xef00('0xa8'),_0x30e2e9[_0xef00('0x4d')],util[_0xef00('0x43')](_0x6434e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xef00('0xa9')]=function(_0x464cb2,_0x426c56,_0x2bf79e){var _0x42a85c=[_0xef00('0xb4'),_0xef00('0xb5'),_0xef00('0xb6'),_0xef00('0xb7'),_0xef00('0xb8'),'rtpaudioqoslossbridged',_0xef00('0xb9'),_0xef00('0xba'),_0xef00('0xbb'),_0xef00('0xbc'),_0xef00('0xbd'),_0xef00('0xbe'),_0xef00('0xbf'),_0xef00('0xc0'),_0xef00('0xc1'),_0xef00('0xc2'),_0xef00('0xc3'),_0xef00('0xc4'),_0xef00('0xc5')];if(!_[_0xef00('0x3b')](_0x426c56)&&!_[_0xef00('0xc6')](_0x42a85c,_0x426c56)){if(_['isUndefined'](this[_0xef00('0x18')][_0x464cb2])){this[_0xef00('0x18')][_0x464cb2]={};}this[_0xef00('0x18')][_0x464cb2][_0x426c56]=_0x2bf79e;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x450024,_0x7158b2,_0x5c1e96){var _0x9f1a3e={};for(var _0xe63ed3=0x0;_0xe63ed30x0?_0x4ea82a:0x0;this[_0xb66c('0x13')][_0x27794c[_0xb66c('0x69')]][_0xb66c('0x2f')]=this['voiceQueues'][_0x27794c[_0xb66c('0x69')]][_0xb66c('0x2f')]>_[_0xb66c('0x6c')](_0x27794c['loggedin'])?_[_0xb66c('0x6c')](_0x27794c[_0xb66c('0x6e')]):this[_0xb66c('0x13')][_0x27794c[_0xb66c('0x69')]]['talking'];this[_0xb66c('0x51')](this[_0xb66c('0x13')][_0x27794c[_0xb66c('0x69')]],'queuesummary');}logger[_0xb66c('0x46')](_0xb66c('0x6f'),util['inspect'](this['voiceQueues'][_0x27794c[_0xb66c('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb66c('0x70'),this[_0xb66c('0x13')][_0x27794c['queue']]);}}}catch(_0x169c6d){logger[_0xb66c('0x3c')](_0xb66c('0x71'),util[_0xb66c('0x3e')](_0x169c6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb66c('0x1a')]=function(_0x5d4241){logger['debug'](_0xb66c('0x72'),util[_0xb66c('0x3e')](_0x5d4241,{'showHidden':![],'depth':null}));ami['emit'](_0xb66c('0x73'),{});this[_0xb66c('0x14')]=!![];};VoiceQueueReport[_0xb66c('0xc')]['syncQueueCallerJoin']=function(_0x5861c7){try{if(this[_0xb66c('0x67')](_0x5861c7)){logger[_0xb66c('0x46')](_0xb66c('0x74'),_0x5861c7[_0xb66c('0x47')],util[_0xb66c('0x3e')](_0x5861c7,{'showHidden':![],'depth':null}));if(_[_0xb66c('0x75')](this[_0xb66c('0x10')][_0x5861c7['uniqueid']]))this['queueReports'][_0x5861c7['uniqueid']]=[];if(_[_0xb66c('0x75')](this[_0xb66c('0x34')][_0x5861c7[_0xb66c('0x47')]]))this['channels'][_0x5861c7[_0xb66c('0x47')]]={};var _0x1fbf7c=new QueueReport();_0x1fbf7c['name']=_0x5861c7['queue'];_0x1fbf7c[_0xb66c('0x52')]=this['voiceQueues'][_0x1fbf7c[_0xb66c('0x4f')]]&&this['voiceQueues'][_0x1fbf7c[_0xb66c('0x4f')]][_0xb66c('0x52')]?this[_0xb66c('0x13')][_0x1fbf7c[_0xb66c('0x4f')]][_0xb66c('0x52')]||_0xb66c('0x76'):_0xb66c('0x76');_0x1fbf7c[_0xb66c('0x69')]=_0x5861c7['queue'];_0x1fbf7c['queuecallerjoinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1fbf7c[_0xb66c('0x77')]=_0x5861c7[_0xb66c('0x77')];_0x1fbf7c[_0xb66c('0x78')]=_0x5861c7['count'];_0x1fbf7c[_0xb66c('0x47')]=_0x5861c7['uniqueid'];_0x1fbf7c[_0xb66c('0x79')]=this['channels'][_0x5861c7[_0xb66c('0x47')]][_0xb66c('0x79')];logger[_0xb66c('0x6a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1fbf7c[_0xb66c('0x4f')],_0x1fbf7c['type']);_['merge'](_0x1fbf7c,_[_0xb66c('0x7a')](_0x5861c7,_[_0xb66c('0x7b')](_0x1fbf7c)));this[_0xb66c('0x10')][_0x5861c7[_0xb66c('0x47')]][_0xb66c('0x7c')](_0x1fbf7c);this['channels'][_0x5861c7[_0xb66c('0x47')]]=_0x1fbf7c;this[_0xb66c('0x45')](_0x1fbf7c,_0xb66c('0x1b'));}}catch(_0x8c7159){logger['error'](_0xb66c('0x74'),_0x5861c7['uniqueid'],util[_0xb66c('0x3e')](_0x8c7159,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb66c('0xc')][_0xb66c('0x1d')]=function(_0x3ab40b){try{if(this[_0xb66c('0x67')](_0x3ab40b)){logger[_0xb66c('0x46')](_0xb66c('0x7d'),_0x3ab40b[_0xb66c('0x47')],util[_0xb66c('0x3e')](_0x3ab40b,{'showHidden':![],'depth':null}));if(this[_0xb66c('0x10')][_0x3ab40b[_0xb66c('0x47')]]){var _0x313dc2=_[_0xb66c('0x7e')](this['queueReports'][_0x3ab40b[_0xb66c('0x47')]]);_0x313dc2[_0xb66c('0x7f')]=![];_0x313dc2[_0xb66c('0x80')]=null;_0x313dc2[_0xb66c('0x81')]=_0x3ab40b[_0xb66c('0x81')];_0x313dc2[_0xb66c('0x82')]=_0x3ab40b[_0xb66c('0x82')];_0x313dc2[_0xb66c('0x1c')]=!![];_0x313dc2[_0xb66c('0x83')]=moment()[_0xb66c('0x48')](_0xb66c('0x84'));_0x313dc2[_0xb66c('0x4d')]=_0xb66c('0x85');_0x313dc2[_0xb66c('0x86')]=null;logger['info'](_0xb66c('0x87'),_0x313dc2['name'],_0x313dc2[_0xb66c('0x52')]);this[_0xb66c('0x34')][_0x3ab40b['uniqueid']]=_0x313dc2;this[_0xb66c('0x43')](_0x313dc2,_0xb66c('0x1c'));}}}catch(_0x4d7b6a){logger[_0xb66c('0x3c')](_0xb66c('0x7d'),_0x3ab40b[_0xb66c('0x47')],util['inspect'](_0x4d7b6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb66c('0xc')][_0xb66c('0x88')]=function(_0x26646d){try{if(this[_0xb66c('0x67')](_0x26646d)){logger[_0xb66c('0x46')](_0xb66c('0x89'),_0x26646d[_0xb66c('0x47')],util['inspect'](_0x26646d,{'showHidden':![],'depth':null}));if(this[_0xb66c('0x10')][_0x26646d['uniqueid']]){var _0x5c391b=_[_0xb66c('0x7e')](this['queueReports'][_0x26646d[_0xb66c('0x47')]]);_0x5c391b[_0xb66c('0x8a')]=moment()[_0xb66c('0x48')](_0xb66c('0x84'));_0x5c391b['connectedlinenum']=_0x26646d[_0xb66c('0x8b')];_0x5c391b[_0xb66c('0x8c')]=_0x26646d[_0xb66c('0x8c')];logger[_0xb66c('0x6a')](_0xb66c('0x8d'),_0x5c391b[_0xb66c('0x4f')],_0x5c391b[_0xb66c('0x52')],_0x26646d[_0xb66c('0x8b')],_0x26646d[_0xb66c('0x8c')]);this[_0xb66c('0x34')][_0x26646d[_0xb66c('0x47')]]=_0x5c391b;this['emitVoiceQueueChannelSave'](_0x5c391b,'queuecallerleave');}}}catch(_0x254220){logger[_0xb66c('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x26646d['uniqueid'],util[_0xb66c('0x3e')](_0x254220,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x54f176){try{if(this['isNotNull'](_0x54f176)){logger[_0xb66c('0x46')](_0xb66c('0x8e'),_0x54f176['uniqueid'],util[_0xb66c('0x3e')](_0x54f176,{'showHidden':![],'depth':null}));if(this[_0xb66c('0x10')][_0x54f176[_0xb66c('0x47')]]){var _0x280a33=_[_0xb66c('0x7e')](this[_0xb66c('0x10')][_0x54f176[_0xb66c('0x47')]]);_0x280a33[_0xb66c('0x7f')]=!![];_0x280a33[_0xb66c('0x4d')]='COMPLETEDBYAGENT';logger[_0xb66c('0x6a')](_0xb66c('0x8f'),_0x280a33[_0xb66c('0x4f')],_0x280a33[_0xb66c('0x52')]);}}}catch(_0x22c1cb){logger[_0xb66c('0x3c')](_0xb66c('0x8e'),_0x54f176[_0xb66c('0x47')],util[_0xb66c('0x3e')](_0x22c1cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1b16f2){try{if(this[_0xb66c('0x67')](_0x1b16f2)){logger[_0xb66c('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x1b16f2[_0xb66c('0x47')],util[_0xb66c('0x3e')](_0x1b16f2,{'showHidden':![],'depth':null}));if(this[_0xb66c('0x10')][_0x1b16f2[_0xb66c('0x47')]]){var _0xb47534=_[_0xb66c('0x7e')](this[_0xb66c('0x10')][_0x1b16f2[_0xb66c('0x47')]]);_0xb47534[_0xb66c('0x1c')]=![];_0xb47534[_0xb66c('0x83')]=null;_0xb47534[_0xb66c('0x90')]=!![];_0xb47534['lastAssignedTo']=_0x1b16f2['membername'];_0xb47534[_0xb66c('0x81')]=_0x1b16f2['holdtime'];_0xb47534['queuecallercomplete']=!![];_0xb47534[_0xb66c('0x91')]=![];_0xb47534[_0xb66c('0x92')]=null;if(!_0xb47534['transfer']){if(_0x1b16f2[_0xb66c('0x93')]=='transfer'){_0xb47534[_0xb66c('0x4d')]=_0xb66c('0x94');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xb47534[_0xb66c('0x4f')],_0xb47534[_0xb66c('0x52')]);}else{if(_[_0xb66c('0x95')](_0x1b16f2[_0xb66c('0x96')]['toLowerCase'](),_0xb66c('0x97'))){if(this['queueReports'][_0x1b16f2[_0xb66c('0x98')]]){var _0x7e3ec2=_[_0xb66c('0x7e')](this[_0xb66c('0x10')][_0x1b16f2[_0xb66c('0x98')]]);_0x7e3ec2[_0xb66c('0x7f')]=![];_0x7e3ec2[_0xb66c('0x91')]=!![];_0x7e3ec2['queuecallerexitAt']=moment(_0xb47534[_0xb66c('0x99')])[_0xb66c('0x9a')](_0x1b16f2[_0xb66c('0x81')],'seconds')[_0xb66c('0x48')](_0xb66c('0x84'));_0x7e3ec2[_0xb66c('0x4d')]=_0xb66c('0x9b');_0x7e3ec2['transfer']=!![];_0x7e3ec2[_0xb66c('0x9c')]='FORWARD';_0x7e3ec2[_0xb66c('0x9d')]=_0x1b16f2[_0xb66c('0x9e')];_0x7e3ec2[_0xb66c('0x9f')]=_0x1b16f2['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x7e3ec2[_0xb66c('0x4f')],_0x7e3ec2[_0xb66c('0x52')]);var _0x571ffa=this[_0xb66c('0x10')][_0x1b16f2['linkedid']];this['queueReports'][_0x1b16f2['linkedid']]=this[_0xb66c('0x10')][_0x1b16f2['uniqueid']];this[_0xb66c('0x10')][_0x1b16f2[_0xb66c('0x47')]]=_0x571ffa;}}else{_0xb47534['queuecallerexitreason']=_0xb66c('0xa0')+_0x1b16f2[_0xb66c('0x93')][_0xb66c('0xa1')]();logger[_0xb66c('0x6a')](_0xb66c('0xa2'),_0xb47534[_0xb66c('0x4f')],_0xb47534[_0xb66c('0x52')],_0xb47534[_0xb66c('0x4d')]);}}}this[_0xb66c('0x34')][_0x1b16f2[_0xb66c('0x47')]]=_0xb47534;this['emitVoiceQueueChannelRemove'](_0xb47534,_0xb66c('0xa3'));}}}catch(_0x4746ea){logger[_0xb66c('0x3c')](_0xb66c('0xa4'),_0x1b16f2['uniqueid'],util['inspect'](_0x4746ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb66c('0xc')][_0xb66c('0x23')]=function(_0x4ff4cf){try{if(this['isNotNull'](_0x4ff4cf)){logger[_0xb66c('0x46')](_0xb66c('0xa5'),_0x4ff4cf[_0xb66c('0x47')],util[_0xb66c('0x3e')](_0x4ff4cf,{'showHidden':![],'depth':null}));this['addVariable'](_0x4ff4cf[_0xb66c('0x47')],_[_0xb66c('0x7b')](_0x4ff4cf[_0xb66c('0xa6')])[0x0],_0x4ff4cf['value']);if(this[_0xb66c('0x10')][_0x4ff4cf[_0xb66c('0x47')]]){var _0x3e6fe4=_[_0xb66c('0x7e')](this[_0xb66c('0x10')][_0x4ff4cf[_0xb66c('0x47')]]);if(_0x3e6fe4){if(this[_0xb66c('0x67')](_0x4ff4cf['variable'])&&this[_0xb66c('0x67')](_0x4ff4cf[_0xb66c('0xa6')][_0xb66c('0xa7')])){switch(_0x4ff4cf[_0xb66c('0xa8')]){case'CONTINUE':_0x3e6fe4[_0xb66c('0x91')]=![];_0x3e6fe4[_0xb66c('0x92')]=null;break;case'TIMEOUT':_0x3e6fe4[_0xb66c('0xa9')]='timeout';_0x3e6fe4[_0xb66c('0x91')]=!![];_0x3e6fe4['queuecallerexitAt']=moment()[_0xb66c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e6fe4['queuecallerleaveAt']=moment()[_0xb66c('0x48')](_0xb66c('0x84'));logger[_0xb66c('0x46')](_0xb66c('0xaa'),_0x4ff4cf[_0xb66c('0x47')],util['inspect'](_0x3e6fe4,{'showHidden':![],'depth':null}));ami[_0xb66c('0x44')]('custom:timeout',_0x3e6fe4);break;default:_0x3e6fe4[_0xb66c('0x91')]=!![];_0x3e6fe4['queuecallerexitAt']=moment()['format'](_0xb66c('0x84'));_0x3e6fe4[_0xb66c('0x8a')]=moment()['format'](_0xb66c('0x84'));}_0x3e6fe4[_0xb66c('0x1c')]=![];_0x3e6fe4[_0xb66c('0x83')]=null;_0x3e6fe4['queuecallerexitreason']=_0x4ff4cf['value'];this[_0xb66c('0x34')][_0x4ff4cf[_0xb66c('0x47')]]=_0x3e6fe4;this[_0xb66c('0x43')](_0x3e6fe4,_0xb66c('0x22'));}else if(this[_0xb66c('0x67')](_0x4ff4cf[_0xb66c('0xa6')])&&this[_0xb66c('0x67')](_0x4ff4cf[_0xb66c('0xa6')]['queueposition'])){if(!_0x3e6fe4[_0xb66c('0x1c')]){_0x3e6fe4[_0xb66c('0x91')]=!![];_0x3e6fe4[_0xb66c('0x92')]=moment()[_0xb66c('0x48')](_0xb66c('0x84'));_0x3e6fe4['queuecallerexitreason']='EXITWITHKEY';_0x3e6fe4[_0xb66c('0x8a')]=moment()[_0xb66c('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4ff4cf[_0xb66c('0x47')]]=_0x3e6fe4;}}logger[_0xb66c('0x6a')](_0xb66c('0xab'),_0x4ff4cf[_0xb66c('0x47')],_0x3e6fe4['name'],_0x3e6fe4['type'],_[_0xb66c('0x7b')](_0x4ff4cf[_0xb66c('0xa6')])[0x0],_0x4ff4cf[_0xb66c('0xa8')]);_0x3e6fe4[_0xb66c('0x16')]=this[_0xb66c('0x16')][_0x4ff4cf[_0xb66c('0x47')]];}}}}catch(_0x28b83d){logger[_0xb66c('0x3c')](_0xb66c('0xa5'),_0x4ff4cf[_0xb66c('0x47')],util['inspect'](_0x28b83d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb66c('0xc')][_0xb66c('0xac')]=function(_0x12806b,_0x46960c,_0x5e3c32){var _0x367edc=[_0xb66c('0xad'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xb66c('0xae'),_0xb66c('0xaf'),'rtpaudioqoslossbridged',_0xb66c('0xb0'),_0xb66c('0xb1'),_0xb66c('0xb2'),'sipuri',_0xb66c('0xb3'),'bridgepvtcallid',_0xb66c('0xb4'),'memberdynamic','memberinterface',_0xb66c('0xb5'),_0xb66c('0xb6'),_0xb66c('0xb7'),'memberrealtime'];if(!_['isNil'](_0x46960c)&&!_['includes'](_0x367edc,_0x46960c)){if(_[_0xb66c('0x75')](this[_0xb66c('0x16')][_0x12806b])){this['variables'][_0x12806b]={};}this[_0xb66c('0x16')][_0x12806b][_0x46960c]=_0x5e3c32;}};VoiceQueueReport[_0xb66c('0xc')][_0xb66c('0xb8')]=function(_0x2c3aaa,_0x1254e3,_0x35331e){var _0x4e6f4b={};for(var _0x3d53bf=0x0;_0x3d53bf=0x0?moment(_0x64388[_0xe4f2('0x18')])[_0xe4f2('0x19')](_0x64388[_0xe4f2('0x17')],_0xe4f2('0xe')):null,'data1':'outbound','data2':_0x64388['accountcode'],'data3':_0x64388[_0xe4f2('0x1a')],'data4':_0x64388[_0xe4f2('0x1b')]||null,'role':_0xe4f2('0x12'),'internal':_0x64388[_0xe4f2('0x13')]?_[_0xe4f2('0x1c')](_0x64388[_0xe4f2('0x13')]):undefined,'uniqueid':_0x64388[_0xe4f2('0x14')]},'log':_0xe4f2('0x6')});}; \ No newline at end of file +var _0x0a77=['queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','queue','agent','accountcode','uniqueid','voiceDialReport','endtime','starttime','outbound','dialstring','toNumber','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt'];(function(_0x33f645,_0x429891){var _0x7fbc1c=function(_0x55b3a2){while(--_0x55b3a2){_0x33f645['push'](_0x33f645['shift']());}};_0x7fbc1c(++_0x429891);}(_0x0a77,0xae));var _0x70a7=function(_0x2ef322,_0x19720e){_0x2ef322=_0x2ef322-0x0;var _0x1c7aaa=_0x0a77[_0x2ef322];return _0x1c7aaa;};'use strict';var moment=require(_0x70a7('0x0'));var _=require(_0x70a7('0x1'));var util=require(_0x70a7('0x2'));var client=require(_0x70a7('0x3'));exports[_0x70a7('0x4')]=function(_0x5a4ac5){var _0x4e4a74=_0x5a4ac5[_0x70a7('0x5')]||_0x5a4ac5[_0x70a7('0x6')];return client[_0x70a7('0x7')](_0x70a7('0x8'),{'body':{'channel':_0x70a7('0x9'),'membername':_0x5a4ac5[_0x70a7('0xa')],'interface':_[_0x70a7('0xb')](_0x5a4ac5[_0x70a7('0xc')])?util[_0x70a7('0xd')](_0x70a7('0xe'),_0x5a4ac5[_0x70a7('0xa')]):_0x5a4ac5[_0x70a7('0xc')],'type':_0x70a7('0xf'),'enterAt':_0x5a4ac5[_0x70a7('0x10')],'exitAt':_0x4e4a74,'duration':moment(_0x4e4a74)[_0x70a7('0x11')](_0x5a4ac5['queuecallerleaveAt'],_0x70a7('0x12')),'data1':'inbound','data2':_0x5a4ac5[_0x70a7('0x13')],'data3':_0x5a4ac5['exten'],'data4':null,'data5':_0x5a4ac5[_0x70a7('0x14')],'role':_0x70a7('0x15'),'internal':_0x5a4ac5[_0x70a7('0x16')]?_['toNumber'](_0x5a4ac5[_0x70a7('0x16')]):undefined,'uniqueid':_0x5a4ac5[_0x70a7('0x17')]},'log':_0x70a7('0x8')});};exports[_0x70a7('0x18')]=function(_0x456ed5){return client[_0x70a7('0x7')](_0x70a7('0x8'),{'body':{'channel':_0x70a7('0x9'),'membername':_0x456ed5['membername'],'interface':_0x456ed5['interface'],'type':'TALKING','enterAt':_0x456ed5['starttime'],'exitAt':_0x456ed5[_0x70a7('0x19')],'duration':moment(_0x456ed5[_0x70a7('0x19')])[_0x70a7('0x11')](_0x456ed5[_0x70a7('0x1a')],_0x70a7('0x12'))>=0x0?moment(_0x456ed5[_0x70a7('0x19')])[_0x70a7('0x11')](_0x456ed5['starttime'],'seconds'):null,'data1':_0x70a7('0x1b'),'data2':_0x456ed5[_0x70a7('0x16')],'data3':_0x456ed5['exten'],'data4':_0x456ed5[_0x70a7('0x1c')]||null,'role':'agent','internal':_0x456ed5['accountcode']?_[_0x70a7('0x1d')](_0x456ed5['accountcode']):undefined,'uniqueid':_0x456ed5[_0x70a7('0x17')]},'log':_0x70a7('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 155681e..1e811ae 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 _0x63a2=['GetSettings','../client','getSettings','ShowSetting','previewRecallmeReminderInterval'];(function(_0x5ef3b6,_0x3a03a6){var _0x119ae7=function(_0x2506d3){while(--_0x2506d3){_0x5ef3b6['push'](_0x5ef3b6['shift']());}};_0x119ae7(++_0x3a03a6);}(_0x63a2,0x1e1));var _0x263a=function(_0x469586,_0xca9059){_0x469586=_0x469586-0x0;var _0x18f343=_0x63a2[_0x469586];return _0x18f343;};'use strict';var client=require(_0x263a('0x0'));exports[_0x263a('0x1')]=function(){return client['Request'](_0x263a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x263a('0x3')]},'log':_0x263a('0x4')});}; \ No newline at end of file +var _0xcc1b=['GetSettings','../client','Request','ShowSetting','previewRecallmeReminderInterval'];(function(_0x3e8e47,_0x18cc04){var _0x187dd9=function(_0x52c7db){while(--_0x52c7db){_0x3e8e47['push'](_0x3e8e47['shift']());}};_0x187dd9(++_0x18cc04);}(_0xcc1b,0x100));var _0xbcc1=function(_0x52d0c4,_0x429a9d){_0x52d0c4=_0x52d0c4-0x0;var _0x2b007e=_0xcc1b[_0x52d0c4];return _0x2b007e;};'use strict';var client=require(_0xbcc1('0x0'));exports['getSettings']=function(){return client[_0xbcc1('0x1')](_0xbcc1('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xbcc1('0x3')]},'log':_0xbcc1('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index dcd7cc1..bcf8e5c 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 _0xbf77=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x8d34d4,_0xc6e1cf){var _0x5ada4a=function(_0x129eec){while(--_0x129eec){_0x8d34d4['push'](_0x8d34d4['shift']());}};_0x5ada4a(++_0xc6e1cf);}(_0xbf77,0xec));var _0x7bf7=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xbf77[_0x2e4aa2];return _0x5e6092;};'use strict';var client=require(_0x7bf7('0x0'));exports[_0x7bf7('0x1')]=function(_0x25351a){return function(_0xecd8d2){return client[_0x7bf7('0x2')](_0x7bf7('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7bf7('0x4'),_0x7bf7('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x6e69=['Request','GetTemplate','name','html','getTemplates'];(function(_0xecfc89,_0x474322){var _0x2ef7ce=function(_0x232f4c){while(--_0x232f4c){_0xecfc89['push'](_0xecfc89['shift']());}};_0x2ef7ce(++_0x474322);}(_0x6e69,0x167));var _0x96e6=function(_0x435122,_0x182538){_0x435122=_0x435122-0x0;var _0x4c523b=_0x6e69[_0x435122];return _0x4c523b;};'use strict';var client=require('../client');exports[_0x96e6('0x0')]=function(_0xea4f98){return function(_0x1d7e1c){return client[_0x96e6('0x1')](_0x96e6('0x2'),{'options':{'raw':!![],'attributes':['id',_0x96e6('0x3'),_0x96e6('0x4')]},'log':_0x96e6('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8f96ee4..df674f5 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 _0xb549=['getTriggers','Request','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','data3','data5','data6','data7','GetTrigger','../client'];(function(_0x3ea360,_0x4a3b9e){var _0x330457=function(_0x3c221a){while(--_0x3c221a){_0x3ea360['push'](_0x3ea360['shift']());}};_0x330457(++_0x4a3b9e);}(_0xb549,0x155));var _0x9b54=function(_0x53ddc9,_0x52a3fa){_0x53ddc9=_0x53ddc9-0x0;var _0x195a4c=_0xb549[_0x53ddc9];return _0x195a4c;};'use strict';var client=require(_0x9b54('0x0'));exports[_0x9b54('0x1')]=function(_0x26d426){return function(_0x23ea5c){return client[_0x9b54('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x9b54('0x3'),_0x9b54('0x4'),_0x9b54('0x5')],'include':[{'model':_0x9b54('0x6'),'as':_0x9b54('0x7'),'attributes':['id',_0x9b54('0x8'),_0x9b54('0x9'),'value']},{'model':_0x9b54('0x6'),'as':_0x9b54('0xa'),'attributes':['id','field','operator',_0x9b54('0xb')]},{'model':_0x9b54('0xc'),'as':_0x9b54('0xd'),'attributes':['id','action','data1','data2',_0x9b54('0xe'),'data4',_0x9b54('0xf'),_0x9b54('0x10'),_0x9b54('0x11')]}]},'log':_0x9b54('0x12')});};}; \ No newline at end of file +var _0xfbc4=['Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','operator','AnyConditions','Action'];(function(_0x33722e,_0x4302bd){var _0x11658a=function(_0xad50d0){while(--_0xad50d0){_0x33722e['push'](_0x33722e['shift']());}};_0x11658a(++_0x4302bd);}(_0xfbc4,0x1e4));var _0x4fbc=function(_0x5c05bb,_0x51973c){_0x5c05bb=_0x5c05bb-0x0;var _0x4b352a=_0xfbc4[_0x5c05bb];return _0x4b352a;};'use strict';var client=require(_0x4fbc('0x0'));exports[_0x4fbc('0x1')]=function(_0x242119){return function(_0x43cb24){return client['Request'](_0x4fbc('0x2'),{'options':{'raw':![],'attributes':['id',_0x4fbc('0x3'),_0x4fbc('0x4'),_0x4fbc('0x5')],'include':[{'model':_0x4fbc('0x6'),'as':'AllConditions','attributes':['id','field',_0x4fbc('0x7'),'value']},{'model':_0x4fbc('0x6'),'as':_0x4fbc('0x8'),'attributes':['id','field',_0x4fbc('0x7'),'value']},{'model':_0x4fbc('0x9'),'as':_0x4fbc('0xa'),'attributes':['id',_0x4fbc('0xb'),_0x4fbc('0xc'),_0x4fbc('0xd'),_0x4fbc('0xe'),_0x4fbc('0xf'),_0x4fbc('0x10'),_0x4fbc('0x11'),_0x4fbc('0x12')]}]},'log':_0x4fbc('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 90cd80c..5190274 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 _0x9b60=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x516403,_0x497c76){var _0x46419e=function(_0x1baed4){while(--_0x1baed4){_0x516403['push'](_0x516403['shift']());}};_0x46419e(++_0x497c76);}(_0x9b60,0x174));var _0x09b6=function(_0x1531ee,_0x457776){_0x1531ee=_0x1531ee-0x0;var _0x1e1773=_0x9b60[_0x1531ee];return _0x1e1773;};'use strict';var client=require(_0x09b6('0x0'));exports[_0x09b6('0x1')]=function(_0x3220ce){return function(_0x23aee){return client[_0x09b6('0x2')](_0x09b6('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x09b6('0x4'),_0x09b6('0x5'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xa276=['Request','GetTrunk','registry','defaultuser','getTrunks'];(function(_0x14f3d0,_0x472227){var _0x1805e0=function(_0xb28bc7){while(--_0xb28bc7){_0x14f3d0['push'](_0x14f3d0['shift']());}};_0x1805e0(++_0x472227);}(_0xa276,0x9a));var _0x6a27=function(_0xc28c63,_0x4d2860){_0xc28c63=_0xc28c63-0x0;var _0x158fa8=_0xa276[_0xc28c63];return _0x158fa8;};'use strict';var client=require('../client');exports[_0x6a27('0x0')]=function(_0xb34c4){return function(_0x56200d){return client[_0x6a27('0x1')](_0x6a27('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x6a27('0x3'),_0x6a27('0x4')]},'log':_0x6a27('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 38e24a7..c0aadb9 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4d7a48,_0x4acf81){var _0x1ac976=function(_0x468ff8){while(--_0x468ff8){_0x4d7a48['push'](_0x4d7a48['shift']());}};_0x1ac976(++_0x4acf81);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x4d4314,_0x1767df){var _0x3bd3e6=function(_0xcbb261){while(--_0xcbb261){_0x4d4314['push'](_0x4d4314['shift']());}};_0x3bd3e6(++_0x1767df);}(_0x70e0,0x17b));var _0x070e=function(_0x56028a,_0x4326f3){_0x56028a=_0x56028a-0x0;var _0x457838=_0x70e0[_0x56028a];return _0x457838;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f364130..573225c 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 _0x9a79=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x1712e3,_0x36fb68){var _0x52dd31=function(_0x159777){while(--_0x159777){_0x1712e3['push'](_0x1712e3['shift']());}};_0x52dd31(++_0x36fb68);}(_0x9a79,0x17f));var _0x99a7=function(_0x582592,_0x19204e){_0x582592=_0x582592-0x0;var _0x365ce1=_0x9a79[_0x582592];return _0x365ce1;};'use strict';var client=require(_0x99a7('0x0'));exports[_0x99a7('0x1')]=function(_0x208832){return client['Request'](_0x99a7('0x2'),{'body':_0x208832,'log':_0x99a7('0x2')});};exports[_0x99a7('0x3')]=function(_0x58e335,_0x147936,_0x1906a4){return client[_0x99a7('0x4')](_0x99a7('0x5'),{'body':_0x58e335,'options':{'where':{'uniqueid':_0x147936,'interface':_0x1906a4,'agentcomplete':!![]}},'log':_0x99a7('0x5')});}; \ No newline at end of file +var _0x7191=['UpdateVoiceAgentReport','Request','CreateVoiceAgentReport'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7191,0x157));var _0x1719=function(_0xebf265,_0x5dfe28){_0xebf265=_0xebf265-0x0;var _0xb6c3ad=_0x7191[_0xebf265];return _0xb6c3ad;};'use strict';var client=require('../client');exports['create']=function(_0x304fd2){return client[_0x1719('0x0')](_0x1719('0x1'),{'body':_0x304fd2,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x1e4997,_0x2b39eb,_0x509e97){return client[_0x1719('0x0')](_0x1719('0x2'),{'body':_0x1e4997,'options':{'where':{'uniqueid':_0x2b39eb,'interface':_0x509e97,'agentcomplete':!![]}},'log':_0x1719('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c23f4fe..e6b93ac 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 _0x0ef5=['CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','util','lodash','../client','create','Request'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x0ef5,0x121));var _0x50ef=function(_0x31005b,_0x300c99){_0x31005b=_0x31005b-0x0;var _0x8c5b50=_0x0ef5[_0x31005b];return _0x8c5b50;};'use strict';var moment=require('moment');var util=require(_0x50ef('0x0'));var _=require(_0x50ef('0x1'));var client=require(_0x50ef('0x2'));exports[_0x50ef('0x3')]=function(_0x566a53){return client[_0x50ef('0x4')](_0x50ef('0x5'),{'body':_[_0x50ef('0x6')](_0x566a53,{'source':_0x566a53[_0x50ef('0x7')],'destinationcontext':_0x566a53[_0x50ef('0x8')],'callerid':_0x566a53[_0x50ef('0x9')],'amaflags':_0x50ef('0xa')}),'log':_0x50ef('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x50ef('0xb')],'createdAt':{'$between':[moment()[_0x50ef('0xc')](_0x50ef('0xd'))[_0x50ef('0xe')](_0x50ef('0xf')),moment()[_0x50ef('0x10')](_0x50ef('0xd'))[_0x50ef('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x50ef('0x11'),_0x50ef('0x12'),_0x50ef('0x13'),'billableseconds']},'log':_0x50ef('0x14')});};}; \ No newline at end of file +var _0x5713=['../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','util','lodash'];(function(_0x4d9190,_0x38fda0){var _0x2cfa34=function(_0x5b1866){while(--_0x5b1866){_0x4d9190['push'](_0x4d9190['shift']());}};_0x2cfa34(++_0x38fda0);}(_0x5713,0xef));var _0x3571=function(_0x125a96,_0x536713){_0x125a96=_0x125a96-0x0;var _0x4e8c2f=_0x5713[_0x125a96];return _0x4e8c2f;};'use strict';var moment=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var _=require(_0x3571('0x2'));var client=require(_0x3571('0x3'));exports[_0x3571('0x4')]=function(_0x3a9319){return client[_0x3571('0x5')](_0x3571('0x6'),{'body':_[_0x3571('0x7')](_0x3a9319,{'source':_0x3a9319[_0x3571('0x8')],'destinationcontext':_0x3a9319[_0x3571('0x9')],'callerid':_0x3a9319['callerid'],'amaflags':_0x3571('0xa')}),'log':_0x3571('0x6')});};exports[_0x3571('0xb')]=function(){return function(){return client[_0x3571('0x5')](_0x3571('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3571('0xd')](_0x3571('0xe'))[_0x3571('0xf')](_0x3571('0x10')),moment()[_0x3571('0x11')](_0x3571('0xe'))[_0x3571('0xf')](_0x3571('0x10'))]}},'attributes':[_0x3571('0x12'),_0x3571('0x13'),_0x3571('0x14'),_0x3571('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index edd3737..ae926b5 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 _0x5a7d=['../client','create','CreateVoiceDialReport'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x5a7d,0x16b));var _0xd5a7=function(_0x599c44,_0x2fb16e){_0x599c44=_0x599c44-0x0;var _0x1d6cf6=_0x5a7d[_0x599c44];return _0x1d6cf6;};'use strict';var client=require(_0xd5a7('0x0'));exports[_0xd5a7('0x1')]=function(_0x4211ba){return client['Request'](_0xd5a7('0x2'),{'body':_0x4211ba,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xa2a8=['../client','create','Request','CreateVoiceDialReport'];(function(_0x110924,_0x1374bb){var _0x12905b=function(_0x47d32c){while(--_0x47d32c){_0x110924['push'](_0x110924['shift']());}};_0x12905b(++_0x1374bb);}(_0xa2a8,0x1c8));var _0x8a2a=function(_0x1f2922,_0x3c079f){_0x1f2922=_0x1f2922-0x0;var _0x31af4b=_0xa2a8[_0x1f2922];return _0x31af4b;};'use strict';var client=require(_0x8a2a('0x0'));exports[_0x8a2a('0x1')]=function(_0x4bdba2){return client[_0x8a2a('0x2')](_0x8a2a('0x3'),{'body':_0x4bdba2,'log':_0x8a2a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 4f87594..738e8a3 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 _0x2bc6=['Request','../client','getVoiceExtensions'];(function(_0x10291b,_0x518773){var _0x1d5fbe=function(_0x24df58){while(--_0x24df58){_0x10291b['push'](_0x10291b['shift']());}};_0x1d5fbe(++_0x518773);}(_0x2bc6,0x163));var _0x62bc=function(_0x514a40,_0x3bc652){_0x514a40=_0x514a40-0x0;var _0x1ce9c8=_0x2bc6[_0x514a40];return _0x1ce9c8;};'use strict';var client=require(_0x62bc('0x0'));exports[_0x62bc('0x1')]=function(){return function(){return client[_0x62bc('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x9234=['../client','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x5ac425,_0x408d40){var _0x397c36=function(_0x2b7deb){while(--_0x2b7deb){_0x5ac425['push'](_0x5ac425['shift']());}};_0x397c36(++_0x408d40);}(_0x9234,0x1bd));var _0x4923=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x9234[_0x234ae1];return _0x227ba0;};'use strict';var client=require(_0x4923('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x4923('0x1')](_0x4923('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4923('0x3'),_0x4923('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d097f69..2f7a677 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 _0xaf34=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client','Request','name','acw','acwTimeout','autopause','monitor_format','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xaf34,0x163));var _0x4af3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xaf34[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x4af3('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x4af3('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x4af3('0x2'),_0x4af3('0x3'),_0x4af3('0x4'),_0x4af3('0x5'),_0x4af3('0x6'),'type','dialActive','dialMethod',_0x4af3('0x7'),_0x4af3('0x8'),_0x4af3('0x9'),_0x4af3('0xa'),'dialPredictiveOptimizationPercentage',_0x4af3('0xb'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x4af3('0xc'),'dialQueueOptions',_0x4af3('0xd'),_0x4af3('0xe'),_0x4af3('0xf'),_0x4af3('0x10'),_0x4af3('0x11'),_0x4af3('0x12'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone',_0x4af3('0x13'),_0x4af3('0x14'),_0x4af3('0x15'),_0x4af3('0x16'),'dialAMDInitialSilence','dialAMDGreeting',_0x4af3('0x17'),_0x4af3('0x18'),_0x4af3('0x19'),'dialAMDBetweenWordsSilence',_0x4af3('0x1a'),_0x4af3('0x1b'),_0x4af3('0x1c'),_0x4af3('0x1d'),_0x4af3('0x1e'),_0x4af3('0x1f'),_0x4af3('0x20'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x4af3('0x21'),_0x4af3('0x6'),_0x4af3('0x22'),_0x4af3('0x23'),'dialCutDigit',_0x4af3('0x24'),_0x4af3('0x25'),'dialDropMaxRetry',_0x4af3('0x26'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x4af3('0x27'),_0x4af3('0x28'),'dialAgentRejectMaxRetry',_0x4af3('0x29'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x4af3('0x2a'),_0x4af3('0x2b'),_0x4af3('0x2c'),_0x4af3('0x2d')],'include':[{'model':_0x4af3('0x2e'),'as':_0x4af3('0x2e'),'attributes':['id',_0x4af3('0x2'),_0x4af3('0x2f'),'active']},{'model':_0x4af3('0x30'),'as':_0x4af3('0x31'),'attributes':['id',_0x4af3('0x2')]},{'model':_0x4af3('0x2e'),'as':_0x4af3('0x32'),'attributes':['id','name',_0x4af3('0x2f'),_0x4af3('0x33')]},{'model':'Interval','as':_0x4af3('0x34'),'attributes':['id',_0x4af3('0x2')],'include':[{'model':_0x4af3('0x34'),'as':_0x4af3('0x35'),'attributes':['id',_0x4af3('0x2'),_0x4af3('0x36')]}]}]},'log':_0x4af3('0x37')});};}; \ No newline at end of file +var _0xe6a3=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','active','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval'];(function(_0x5d8612,_0x124492){var _0x3cbc26=function(_0x3b7425){while(--_0x3b7425){_0x5d8612['push'](_0x5d8612['shift']());}};_0x3cbc26(++_0x124492);}(_0xe6a3,0x11b));var _0x3e6a=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xe6a3[_0x198446];return _0x38d7b7;};'use strict';var client=require('../client');exports[_0x3e6a('0x0')]=function(){return function(){return client[_0x3e6a('0x1')](_0x3e6a('0x2'),{'options':{'raw':![],'attributes':['id',_0x3e6a('0x3'),_0x3e6a('0x4'),_0x3e6a('0x5'),_0x3e6a('0x6'),_0x3e6a('0x7'),_0x3e6a('0x8'),_0x3e6a('0x9'),_0x3e6a('0xa'),_0x3e6a('0xb'),_0x3e6a('0xc'),_0x3e6a('0xd'),_0x3e6a('0xe'),_0x3e6a('0xf'),_0x3e6a('0x10'),_0x3e6a('0x11'),'dialOriginateCallerIdNumber',_0x3e6a('0x12'),'dialQueueOptions',_0x3e6a('0x13'),_0x3e6a('0x14'),_0x3e6a('0x15'),_0x3e6a('0x16'),_0x3e6a('0x17'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x3e6a('0x18'),_0x3e6a('0x19'),_0x3e6a('0x1a'),'dialPrefix','dialCheckDuplicateType',_0x3e6a('0x1b'),_0x3e6a('0x1c'),_0x3e6a('0x1d'),_0x3e6a('0x1e'),_0x3e6a('0x1f'),'dialAMDMinWordLength',_0x3e6a('0x20'),_0x3e6a('0x21'),_0x3e6a('0x22'),'dialAMDMaximumWordLength','timeout',_0x3e6a('0x23'),_0x3e6a('0x24'),_0x3e6a('0x25'),'dialAgiAfterHangupAgent',_0x3e6a('0x26'),_0x3e6a('0x27'),_0x3e6a('0x7'),'strategy',_0x3e6a('0x28'),_0x3e6a('0x29'),_0x3e6a('0x2a'),_0x3e6a('0x2b'),_0x3e6a('0x2c'),'dialDropRetryFrequency',_0x3e6a('0x2d'),'dialAbandonedRetryFrequency',_0x3e6a('0x2e'),_0x3e6a('0x2f'),_0x3e6a('0x30'),_0x3e6a('0x31'),_0x3e6a('0x32'),_0x3e6a('0x33'),_0x3e6a('0x34'),_0x3e6a('0x35'),_0x3e6a('0x36'),_0x3e6a('0x37')],'include':[{'model':_0x3e6a('0x38'),'as':_0x3e6a('0x38'),'attributes':['id',_0x3e6a('0x3'),_0x3e6a('0x39'),'active']},{'model':_0x3e6a('0x3a'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x3e6a('0x38'),'as':'TrunkBackup','attributes':['id',_0x3e6a('0x3'),'callerid',_0x3e6a('0x3b')]},{'model':_0x3e6a('0x3c'),'as':_0x3e6a('0x3c'),'attributes':['id',_0x3e6a('0x3')],'include':[{'model':_0x3e6a('0x3c'),'as':_0x3e6a('0x3d'),'attributes':['id',_0x3e6a('0x3'),'interval']}]}]},'log':_0x3e6a('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ac6ec96..f7f6fd1 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(_0x487411,_0x2457a4){var _0x1f2f49=function(_0x228fee){while(--_0x228fee){_0x487411['push'](_0x487411['shift']());}};_0x1f2f49(++_0x2457a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0xce8403,_0x475888){var _0x387265=function(_0x33c57c){while(--_0x33c57c){_0xce8403['push'](_0xce8403['shift']());}};_0x387265(++_0x475888);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 4a2a17e..7c7dbf4 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 _0x4031=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x543d3c,_0x16d2b8){var _0x3e4272=function(_0x211d70){while(--_0x211d70){_0x543d3c['push'](_0x543d3c['shift']());}};_0x3e4272(++_0x16d2b8);}(_0x4031,0x161));var _0x1403=function(_0x37c8ef,_0x29eb19){_0x37c8ef=_0x37c8ef-0x0;var _0x25f7f5=_0x4031[_0x37c8ef];return _0x25f7f5;};'use strict';var client=require(_0x1403('0x0'));exports['getVoiceQueueRtPauses']=function(_0x398371){return function(){return client[_0x1403('0x1')](_0x1403('0x2'),{'options':{'where':{'VoiceQueueId':_0x398371,'paused':!![]},'raw':!![]},'log':_0x1403('0x3')});};}; \ No newline at end of file +var _0x89f7=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x520d31,_0x5a0315){var _0x3645b9=function(_0x409671){while(--_0x409671){_0x520d31['push'](_0x520d31['shift']());}};_0x3645b9(++_0x5a0315);}(_0x89f7,0x1f3));var _0x789f=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x89f7[_0x2c0be1];return _0x3d4bd2;};'use strict';var client=require('../client');exports[_0x789f('0x0')]=function(_0x2ed12f){return function(){return client[_0x789f('0x1')](_0x789f('0x2'),{'options':{'where':{'VoiceQueueId':_0x2ed12f,'paused':!![]},'raw':!![]},'log':_0x789f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d06239d..1e7c735 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x549017,_0x24da11){var _0xbc8dd0=function(_0x1f2a86){while(--_0x1f2a86){_0x549017['push'](_0x549017['shift']());}};_0xbc8dd0(++_0x24da11);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x6d327c,_0x4c5931){var _0x461d30=function(_0x18496d){while(--_0x18496d){_0x6d327c['push'](_0x6d327c['shift']());}};_0x461d30(++_0x4c5931);}(_0x7a54,0x106));var _0x47a5=function(_0x36b71b,_0x317b18){_0x36b71b=_0x36b71b-0x0;var _0x4281c2=_0x7a54[_0x36b71b];return _0x4281c2;};'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 e1c6a93..0b3abbb 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 _0x0077=['transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','blindTransfer','Request','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode'];(function(_0x4460a9,_0x12bd18){var _0x1ae57f=function(_0x4c8a52){while(--_0x4c8a52){_0x4460a9['push'](_0x4460a9['shift']());}};_0x1ae57f(++_0x12bd18);}(_0x0077,0x1d3));var _0x7007=function(_0x16bddc,_0xf6b622){_0x16bddc=_0x16bddc-0x0;var _0x970372=_0x0077[_0x16bddc];return _0x970372;};'use strict';var client=require(_0x7007('0x0'));exports['transfers']={};exports[_0x7007('0x1')]=function(_0x27ffb1){return client[_0x7007('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x27ffb1['result'],'transfererchannel':_0x27ffb1[_0x7007('0x3')],'transferercalleridnum':_0x27ffb1[_0x7007('0x4')],'transferercalleridname':_0x27ffb1[_0x7007('0x5')],'transfererconnectedlinenum':_0x27ffb1[_0x7007('0x6')],'transfererconnectedlinename':_0x27ffb1[_0x7007('0x7')],'transfereraccountcode':_0x27ffb1[_0x7007('0x8')],'transferercontext':_0x27ffb1[_0x7007('0x9')],'transfererexten':_0x27ffb1[_0x7007('0xa')],'transfererlinkedid':_0x27ffb1[_0x7007('0xb')],'transfereechannel':_0x27ffb1['transfereechannel'],'transfereecalleridnum':_0x27ffb1[_0x7007('0xc')],'transfereecalleridname':_0x27ffb1[_0x7007('0xd')],'transfereeconnectedlinenum':_0x27ffb1[_0x7007('0xe')],'transfereeconnectedlinename':_0x27ffb1['transfereeconnectedlinename'],'transfereeaccountcode':_0x27ffb1['transfereeaccountcode'],'transfereecontext':_0x27ffb1['transfereecontext'],'transfereeexten':_0x27ffb1[_0x7007('0xf')],'transfereelinkedid':_0x27ffb1[_0x7007('0x10')],'isexternal':_0x27ffb1[_0x7007('0x11')],'context':_0x27ffb1[_0x7007('0x12')],'extension':_0x27ffb1['extension'],'type':_0x7007('0x13')},'log':_0x7007('0x14')});};exports['attendedTransfer']=function(_0x3e2b12){return client[_0x7007('0x2')](_0x7007('0x14'),{'body':{'result':_0x3e2b12['result'],'transfererchannel':_0x3e2b12[_0x7007('0x15')],'transferercalleridnum':_0x3e2b12['origtransferercalleridnum'],'transferercalleridname':_0x3e2b12['origtransferercalleridname'],'transfererconnectedlinenum':_0x3e2b12[_0x7007('0x16')],'transfererconnectedlinename':_0x3e2b12[_0x7007('0x17')],'transfereraccountcode':_0x3e2b12[_0x7007('0x18')],'transferercontext':_0x3e2b12['secondtransferercontext'],'transfererexten':_0x3e2b12[_0x7007('0x19')],'transfererlinkedid':_0x3e2b12[_0x7007('0x1a')],'transfereechannel':_0x3e2b12[_0x7007('0x1b')],'transfereecalleridnum':_0x3e2b12['transfertargetcalleridnum'],'transfereecalleridname':_0x3e2b12['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3e2b12[_0x7007('0x1c')],'transfereeconnectedlinename':_0x3e2b12[_0x7007('0x1d')],'transfereeaccountcode':_0x3e2b12['transfertargetaccountcode'],'transfereecontext':_0x3e2b12['transfertargetcontext'],'transfereeexten':_0x3e2b12[_0x7007('0x1e')],'transfereelinkedid':_0x3e2b12[_0x7007('0x1f')],'isexternal':_0x3e2b12[_0x7007('0x11')],'context':_0x3e2b12['origtransferercontext'],'extension':_0x3e2b12[_0x7007('0x20')],'type':_0x7007('0x21')},'log':_0x7007('0x14')});}; \ No newline at end of file +var _0xc121=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0xc121,0x157));var _0x1c12=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xc121[_0x2642cb];return _0xe6e41;};'use strict';var client=require(_0x1c12('0x0'));exports['transfers']={};exports[_0x1c12('0x1')]=function(_0x433d32){return client[_0x1c12('0x2')](_0x1c12('0x3'),{'body':{'result':_0x433d32[_0x1c12('0x4')],'transfererchannel':_0x433d32[_0x1c12('0x5')],'transferercalleridnum':_0x433d32[_0x1c12('0x6')],'transferercalleridname':_0x433d32[_0x1c12('0x7')],'transfererconnectedlinenum':_0x433d32['transfererconnectedlinenum'],'transfererconnectedlinename':_0x433d32[_0x1c12('0x8')],'transfereraccountcode':_0x433d32['transfereraccountcode'],'transferercontext':_0x433d32[_0x1c12('0x9')],'transfererexten':_0x433d32['transfererexten'],'transfererlinkedid':_0x433d32[_0x1c12('0xa')],'transfereechannel':_0x433d32[_0x1c12('0xb')],'transfereecalleridnum':_0x433d32[_0x1c12('0xc')],'transfereecalleridname':_0x433d32[_0x1c12('0xd')],'transfereeconnectedlinenum':_0x433d32[_0x1c12('0xe')],'transfereeconnectedlinename':_0x433d32[_0x1c12('0xf')],'transfereeaccountcode':_0x433d32[_0x1c12('0x10')],'transfereecontext':_0x433d32[_0x1c12('0x11')],'transfereeexten':_0x433d32[_0x1c12('0x12')],'transfereelinkedid':_0x433d32[_0x1c12('0x13')],'isexternal':_0x433d32[_0x1c12('0x14')],'context':_0x433d32[_0x1c12('0x15')],'extension':_0x433d32[_0x1c12('0x16')],'type':_0x1c12('0x17')},'log':_0x1c12('0x3')});};exports[_0x1c12('0x18')]=function(_0x17bb12){return client['Request'](_0x1c12('0x3'),{'body':{'result':_0x17bb12[_0x1c12('0x4')],'transfererchannel':_0x17bb12[_0x1c12('0x19')],'transferercalleridnum':_0x17bb12[_0x1c12('0x1a')],'transferercalleridname':_0x17bb12[_0x1c12('0x1b')],'transfererconnectedlinenum':_0x17bb12[_0x1c12('0x1c')],'transfererconnectedlinename':_0x17bb12[_0x1c12('0x1d')],'transfereraccountcode':_0x17bb12[_0x1c12('0x1e')],'transferercontext':_0x17bb12['secondtransferercontext'],'transfererexten':_0x17bb12[_0x1c12('0x1f')],'transfererlinkedid':_0x17bb12['origtransfererlinkedid'],'transfereechannel':_0x17bb12[_0x1c12('0x20')],'transfereecalleridnum':_0x17bb12[_0x1c12('0x21')],'transfereecalleridname':_0x17bb12[_0x1c12('0x22')],'transfereeconnectedlinenum':_0x17bb12[_0x1c12('0x23')],'transfereeconnectedlinename':_0x17bb12[_0x1c12('0x24')],'transfereeaccountcode':_0x17bb12['transfertargetaccountcode'],'transfereecontext':_0x17bb12[_0x1c12('0x25')],'transfereeexten':_0x17bb12['transfertargetexten'],'transfereelinkedid':_0x17bb12[_0x1c12('0x26')],'isexternal':_0x17bb12[_0x1c12('0x14')],'context':_0x17bb12[_0x1c12('0x27')],'extension':_0x17bb12[_0x1c12('0x28')],'type':'attended'},'log':_0x1c12('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8c877cc..339be26 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 _0x82c4=['message','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','channels','resolve','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','telephones','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','catch','isConnected','Command','then','content','voiceQueues','hasOwnProperty','strategy','available','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','values','voicechannel','map'];(function(_0x26c3b9,_0x2f7830){var _0x1c6818=function(_0x14014a){while(--_0x14014a){_0x26c3b9['push'](_0x26c3b9['shift']());}};_0x1c6818(++_0x2f7830);}(_0x82c4,0x1ca));var _0x482c=function(_0x3520a3,_0x585b4e){_0x3520a3=_0x3520a3-0x0;var _0x266257=_0x82c4[_0x3520a3];return _0x266257;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var jayson=require(_0x482c('0x2'));var schema=require(_0x482c('0x3'));var BPromise=require(_0x482c('0x4'));var moment=require(_0x482c('0x5'));var config=require(_0x482c('0x6'));var properties=require('../properties');var ami=require(_0x482c('0x7'));exports['listen']=function(_0x4556c8,_0x47edb6,_0x477cf4){return new BPromise(function(_0x5d7c76,_0xfdb92){var _0x32a503={'QueuePause':function(_0x35cdab){return new Promise(function(_0x1c10f2,_0x3846d8){var _0x478bd2=util[_0x482c('0x8')](_0x482c('0x9'),_0x482c('0xa'),_0x35cdab[_0x482c('0xb')]);if(_0x4556c8[_0x482c('0xc')]&&_0x4556c8[_0x482c('0xc')][_0x478bd2]&&_0x4556c8['timers'][_0x478bd2][_0x482c('0xd')]){_0x4556c8[_0x482c('0xc')][_0x478bd2][_0x482c('0xe')]();}if(_0x4556c8['agents'][_0x478bd2]){_0x4556c8[_0x482c('0xf')][_0x478bd2][_0x482c('0x10')]({'statePause':_0x35cdab[_0x482c('0x11')]?!![]:![]});}_0x1c10f2({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x4bfb3a){var _0x7b12cf=this;return new Promise(function(_0x30e02b,_0x59837f){if(ami['isConnected']()==![]){return _0x59837f(_0x7b12cf[_0x482c('0x12')](0x1f4,[config[_0x482c('0x13')]['ip'],config[_0x482c('0x13')][_0x482c('0x14')],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}_0x4bfb3a=_[_0x482c('0x17')](_0x4bfb3a,_[_0x482c('0x18')](properties[_0x482c('0x19')]));_0x4bfb3a[_0x482c('0x1a')]=_0x482c('0x1b');return ami[_0x482c('0x1c')](_0x4bfb3a)['then'](function(_0x244bb9){_0x30e02b({'code':0xc8,'message':_0x244bb9['message']});})[_0x482c('0x1d')](function(_0x258148){_0x59837f(_0x7b12cf['error'](0x1f5,_0x258148['message']));});});},'Command':function(_0x357965){var _0x584656=this;return new Promise(function(_0x16fe9a,_0x4784a2){if(ami[_0x482c('0x1e')]()==![]){return _0x4784a2(_0x584656[_0x482c('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x482c('0x13')][_0x482c('0x14')],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}_0x357965=_[_0x482c('0x17')](_0x357965,'command');_0x357965['action']=_0x482c('0x1f');return ami[_0x482c('0x1c')](_0x357965)[_0x482c('0x20')](function(_0x5c4e9c){_0x16fe9a({'code':0xc8,'message':_0x5c4e9c[_0x482c('0x21')]});})['catch'](function(_0x2f3f96){_0x4784a2(_0x584656[_0x482c('0x12')](0x1f5,_0x2f3f96['message']));});});},'VoiceQueues':function(_0x466583){return new Promise(function(_0x5436e2,_0x589bc6){var _0x2165af=[];for(var _0x27f1b5 in _0x4556c8[_0x482c('0x22')]){if(_0x4556c8[_0x482c('0x22')][_0x482c('0x23')](_0x27f1b5)){var _0x215826=_0x4556c8[_0x482c('0x22')][_0x27f1b5];var _0x5ad788={'id':_0x215826['id'],'name':_0x215826[_0x482c('0xb')],'strategy':_0x215826[_0x482c('0x24')],'answered':_0x215826['answered'],'available':_0x215826[_0x482c('0x25')],'loggedIn':_0x215826['loggedIn'],'pTalking':_0x215826['pTalking'],'sumBillable':_0x215826[_0x482c('0x26')],'sumDuration':_0x215826['sumDuration'],'sumHoldTime':_0x215826[_0x482c('0x27')]||0x0,'talking':_0x215826[_0x482c('0x28')],'total':_0x215826[_0x482c('0x29')],'type':_0x215826[_0x482c('0x2a')],'unmanaged':_0x215826[_0x482c('0x2b')],'abandoned':_0x215826[_0x482c('0x2c')],'waiting':_0x215826[_0x482c('0x2d')],'loggedInDb':_0x215826[_0x482c('0x2e')]};if(_0x215826[_0x482c('0x2a')]===_0x482c('0x2f')){_0x5ad788[_0x482c('0x30')]=_0x215826[_0x482c('0x30')];_0x5ad788[_0x482c('0x31')]=_0x215826[_0x482c('0x31')];_0x5ad788[_0x482c('0x32')]=_0x215826[_0x482c('0x32')];_0x5ad788[_0x482c('0x33')]=_0x215826[_0x482c('0x33')];_0x5ad788['dialOriginateTimeout']=_0x215826['dialOriginateTimeout'];_0x5ad788['dialPrefix']=_0x215826[_0x482c('0x34')];_0x5ad788[_0x482c('0x35')]=_0x215826[_0x482c('0x35')];_0x5ad788[_0x482c('0x36')]=_0x215826['outboundAnswerAgiCallsDay'];_0x5ad788[_0x482c('0x37')]=_0x215826['outboundAnswerCallsDay'];_0x5ad788[_0x482c('0x38')]=_0x215826[_0x482c('0x38')];_0x5ad788[_0x482c('0x39')]=_0x215826[_0x482c('0x39')];_0x5ad788[_0x482c('0x3a')]=_0x215826[_0x482c('0x3a')];_0x5ad788[_0x482c('0x3b')]=_0x215826[_0x482c('0x3b')];_0x5ad788['outboundDropCallsDayCallersExit']=_0x215826['outboundDropCallsDayCallersExit'];_0x5ad788[_0x482c('0x3c')]=_0x215826['outboundDropCallsDayTimeout'];_0x5ad788[_0x482c('0x3d')]=_0x215826[_0x482c('0x3d')];_0x5ad788[_0x482c('0x3e')]=_0x215826['outboundNoSuchCallsDay'];_0x5ad788[_0x482c('0x3f')]=_0x215826[_0x482c('0x3f')];_0x5ad788[_0x482c('0x40')]=_0x215826[_0x482c('0x40')];_0x5ad788['outboundRejectCallsDay']=_0x215826[_0x482c('0x41')];_0x5ad788['outboundUnknownCallsDay']=_0x215826[_0x482c('0x42')];_0x5ad788['predictiveIntervalAnsweredCalls']=_0x215826[_0x482c('0x43')];_0x5ad788['predictiveIntervalAvgHoldtime']=_0x215826[_0x482c('0x44')];_0x5ad788[_0x482c('0x45')]=_0x215826['predictiveIntervalAvgTalktime'];_0x5ad788[_0x482c('0x46')]=_0x215826['predictiveIntervalDroppedCallsCallersExit'];_0x5ad788['predictiveIntervalDroppedCallsTimeout']=_0x215826[_0x482c('0x47')];_0x5ad788['predictiveIntervalErlangCalls']=_0x215826['predictiveIntervalErlangCalls'];_0x5ad788['predictiveIntervalErlangCallsDroppedCalls']=_0x215826['predictiveIntervalErlangCallsDroppedCalls'];_0x5ad788[_0x482c('0x48')]=_0x215826[_0x482c('0x48')];_0x5ad788[_0x482c('0x49')]=_0x215826[_0x482c('0x49')];_0x5ad788[_0x482c('0x4a')]=_0x215826['predictiveIntervalPauses'];_0x5ad788[_0x482c('0x4b')]=_0x215826[_0x482c('0x4b')];_0x5ad788[_0x482c('0x4c')]=_0x215826[_0x482c('0x4c')];_0x5ad788['message']=_0x215826['message'];_0x5ad788[_0x482c('0x4d')]=_0x215826[_0x482c('0x4d')];_0x5ad788[_0x482c('0x4e')]=_0x215826[_0x482c('0x4e')];_0x5ad788[_0x482c('0x4f')]=_0x215826[_0x482c('0x4f')];_0x5ad788[_0x482c('0x50')]=_0x215826[_0x482c('0x50')];_0x5ad788[_0x482c('0x51')]=_0x215826[_0x482c('0x51')];_0x5ad788[_0x482c('0x52')]=_0x215826['startPredictive'];_0x5ad788[_0x482c('0x53')]=_0x215826[_0x482c('0x53')];}if(_0x215826[_0x482c('0x54')]){_0x5ad788[_0x482c('0x54')]={'id':_0x215826[_0x482c('0x54')]['id'],'name':_0x215826[_0x482c('0x54')][_0x482c('0xb')],'active':_0x215826['Trunk']['active'],'callerid':_0x215826[_0x482c('0x54')][_0x482c('0x55')]};}if(_0x215826[_0x482c('0x56')]){_0x5ad788['Interval']={'id':_0x215826[_0x482c('0x56')]['id'],'name':_0x215826['Interval'][_0x482c('0xb')]};}_0x2165af[_0x482c('0x57')](_0x5ad788);}}_0x5436e2({'count':_0x2165af[_0x482c('0x58')],'rows':_0x2165af});});},'UpdateVoiceQueue':function(_0x16b893){return new Promise(function(_0x5f4e0a,_0x1ff623){var _0x2c37f3=_[_0x482c('0x59')](_0x4556c8['voiceQueues'],{'id':parseInt(_0x16b893['id'])});var _0x407471=_[_0x482c('0x5a')](_0x16b893,['id']);if(_0x2c37f3){for(var _0xcf89c4 in _0x407471){if(typeof _0x407471[_0xcf89c4]!=='undefined'&&typeof _0x2c37f3[_0xcf89c4]!=='undefined'){_0x2c37f3[_0xcf89c4]=_0x407471[_0xcf89c4];}}_0x5f4e0a(_0x2c37f3);}else{_0x1ff623();}});},'VoiceChannels':function(_0x4a677d){return new Promise(function(_0x4998a5,_0x596ec2){var _0x56b6c5=_[_0x482c('0x5b')](_0x4556c8['channels']);_0x4998a5({'count':_0x56b6c5[_0x482c('0x58')],'rows':_0x56b6c5});});},'VoiceChannelMixMonitor':function(_0xbdbd1b){var _0x3ecf00=this;return new Promise(function(_0x2fa930,_0x40174a){if(ami[_0x482c('0x1e')]()==![]){return _0x40174a(_0x3ecf00[_0x482c('0x12')](0x1f4,[config[_0x482c('0x13')]['ip'],config[_0x482c('0x13')][_0x482c('0x14')],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}var _0x1126b7=schema(properties[_0x482c('0x5c')])[_0x482c('0x3')](_0xbdbd1b);if(_0x1126b7[_0x482c('0x58')]>0x0){return _0x40174a(_0x3ecf00[_0x482c('0x12')](0x1f4,_[_0x482c('0x5d')](_0x1126b7,_0x482c('0x5e'))['join'](',\x20')));}var _0x107b1b=_[_0x482c('0x59')](_0x4556c8['channels'],{'uniqueid':_0xbdbd1b[_0x482c('0x5f')]});if(_0x107b1b&&_0x107b1b[_0x482c('0x60')]){var _0x1f5e5b=util[_0x482c('0x8')](_0x482c('0x61'),_0xbdbd1b['filename']||_0xbdbd1b['uniqueid'],_0xbdbd1b[_0x482c('0x8')]||_0x482c('0x62'));return ami[_0x482c('0x1c')]({'action':_0x482c('0x63'),'channel':_0x107b1b[_0x482c('0x60')],'file':_0x1f5e5b,'options':_0x482c('0x64')})[_0x482c('0x20')](function(_0x55925a){var _0x508a10=_['find'](_0x107b1b[_0x482c('0x65')],{'filename':_0x482c('0x66')+_0x1f5e5b[_0x482c('0x67')]()});if(_[_0x482c('0x68')](_0x508a10)){_0x107b1b[_0x482c('0x65')][_0x482c('0x57')]({'filename':_0x482c('0x66')+_0x1f5e5b[_0x482c('0x67')](),'createdAt':moment()[_0x482c('0x8')](_0x482c('0x69')),'mixmonitorid':_0x55925a[_0x482c('0x6a')],'status':'rec'});}else{_0x508a10[_0x482c('0x6a')]=_0x55925a[_0x482c('0x6a')];_0x508a10[_0x482c('0x6b')]=_0x482c('0x6c');}_0x2fa930({'code':0xc8,'message':[_0xbdbd1b[_0x482c('0x5f')],_0x482c('0x6d'),_0x55925a[_0x482c('0x6a')]][_0x482c('0x16')]('\x20'),'mixmonitorid':_0x55925a[_0x482c('0x6a')]});})[_0x482c('0x1d')](function(_0x3981cf){_0x40174a(_0x3ecf00[_0x482c('0x12')](0x1f5,[_0xbdbd1b['uniqueid'],_0x3981cf['message'][_0x482c('0x67')]()][_0x482c('0x16')]('\x20')));});}else{return _0x40174a(_0x3ecf00[_0x482c('0x12')](0x1f5,_0x482c('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0xa5ffff){var _0x313155=this;return new Promise(function(_0x5382b0,_0x231353){if(ami[_0x482c('0x1e')]()==![]){return _0x231353(_0x313155[_0x482c('0x12')](0x1f4,[config[_0x482c('0x13')]['ip'],config[_0x482c('0x13')][_0x482c('0x14')],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}var _0x1840a9=schema(properties[_0x482c('0x5c')])[_0x482c('0x3')](_0xa5ffff);if(_0x1840a9[_0x482c('0x58')]>0x0){return _0x231353(_0x313155['error'](0x1f4,_[_0x482c('0x5d')](_0x1840a9,'message')[_0x482c('0x16')](',\x20')));}var _0x1bb8d1=_[_0x482c('0x59')](_0x4556c8[_0x482c('0x6f')],{'uniqueid':_0xa5ffff[_0x482c('0x5f')]});if(_0x1bb8d1){return BPromise[_0x482c('0x70')]()['then'](function(){if(_0x1bb8d1[_0x482c('0x60')]){return ami[_0x482c('0x1c')]({'action':'StopMixMonitor','channel':_0x1bb8d1['channel'],'mixmonitorid':_0xa5ffff[_0x482c('0x6a')]})[_0x482c('0x1d')](function(_0x481241){});}})[_0x482c('0x20')](function(){if(_0x1bb8d1[_0x482c('0x71')]){return ami[_0x482c('0x1c')]({'action':_0x482c('0x72'),'channel':_0x1bb8d1['destinationchannel'],'mixmonitorid':_0xa5ffff[_0x482c('0x6a')]})[_0x482c('0x1d')](function(_0x21a0c5){});}})[_0x482c('0x20')](function(_0x3a37f5){var _0x2fc65f=_['find'](_0x1bb8d1['monitors'],{'mixmonitorid':_0xa5ffff[_0x482c('0x6a')]});if(_0x2fc65f){_0x2fc65f[_0x482c('0x6b')]=_0x482c('0x73');}})['then'](function(){var _0x23349f=util[_0x482c('0x8')](_0x482c('0x61'),_0xa5ffff[_0x482c('0x74')]||_0xa5ffff[_0x482c('0x5f')],_0xa5ffff[_0x482c('0x8')]||_0x482c('0x62'));var _0x37e456=_[_0x482c('0x59')](_0x1bb8d1['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x23349f[_0x482c('0x67')]()});if(_0x37e456){_0x37e456[_0x482c('0x6b')]='stop';}})['then'](function(){_0x5382b0({'code':0xc8,'message':[_0xa5ffff[_0x482c('0x5f')],_0x482c('0x75')][_0x482c('0x16')]('\x20')});})['catch'](function(_0x510f07){_0x231353(_0x313155['error'](0x1f5,[_0xa5ffff[_0x482c('0x5f')],_0x510f07[_0x482c('0x5e')][_0x482c('0x67')]()][_0x482c('0x16')]('\x20')));});}else{return _0x231353(_0x313155[_0x482c('0x12')](0x1f5,_0x482c('0x6e')));}});},'VoiceQueuesChannels':function(_0x4839f2){return new Promise(function(_0x5e5e76,_0x2ec137){var _0x1d878f=_[_0x482c('0x5b')](_0x4556c8[_0x482c('0x76')]);_0x5e5e76({'count':_0x1d878f[_0x482c('0x58')],'rows':_0x1d878f});});},'VoiceQueuesChannel':function(_0x1c9531){var _0x2444a8=this;return new Promise(function(_0x445edb,_0x1c771f){var _0x142809=schema(properties[_0x482c('0x77')])[_0x482c('0x3')](_0x1c9531);if(_0x142809['length']>0x0){return _0x1c771f(_0x2444a8[_0x482c('0x12')](0x1f4,_[_0x482c('0x5d')](_0x142809,_0x482c('0x5e'))['join'](',\x20')));}var _0x2f781d=_[_0x482c('0x59')](_0x4556c8[_0x482c('0x76')],{'uniqueid':_0x1c9531['uniqueid']});if(_0x2f781d){_0x445edb(_0x2f781d);}else{return _0x1c771f(_0x2444a8[_0x482c('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x4bd929){var _0xcf240d=this;return new Promise(function(_0x14c94c,_0x383254){if(ami[_0x482c('0x1e')]()==![]){return _0x383254(_0xcf240d[_0x482c('0x12')](0x1f4,[config[_0x482c('0x13')]['ip'],config[_0x482c('0x13')]['username'],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}var _0x5eb509=schema(properties[_0x482c('0x78')])['validate'](_0x4bd929);if(_0x5eb509['length']>0x0){return _0x383254(_0xcf240d['error'](0x1f4,_[_0x482c('0x5d')](_0x5eb509,'message')['join'](',\x20')));}var _0xc7bebc=_[_0x482c('0x59')](_0x4556c8['queueChannels'],{'uniqueid':_0x4bd929[_0x482c('0x5f')]});if(_0xc7bebc&&_0xc7bebc['channel']){return ami['Action']({'action':'Hangup','channel':_0xc7bebc[_0x482c('0x60')]})[_0x482c('0x20')](function(_0x4fc3ef){_0x14c94c({'code':0xc8,'message':[_0x4bd929['uniqueid'],_0x4fc3ef['message'][_0x482c('0x67')]()][_0x482c('0x16')]('\x20')});})[_0x482c('0x1d')](function(_0x58eebf){_0x383254(_0xcf240d['error'](0x1f5,[_0x4bd929[_0x482c('0x5f')],_0x58eebf['message'][_0x482c('0x67')]()][_0x482c('0x16')]('\x20')));});}else{return _0x383254(_0xcf240d['error'](0x1f5,_0x482c('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x5b804f){var _0x48b9c2=this;return new Promise(function(_0x2c0056,_0x4d6926){if(ami[_0x482c('0x1e')]()==![]){return _0x4d6926(_0x48b9c2['error'](0x1f4,[config[_0x482c('0x13')]['ip'],config['asterisk'][_0x482c('0x14')],_0x482c('0x15')][_0x482c('0x16')]('\x20')));}var _0x5b9153=schema(properties[_0x482c('0x79')])[_0x482c('0x3')](_0x5b804f);if(_0x5b9153[_0x482c('0x58')]>0x0){return _0x4d6926(_0x48b9c2['error'](0x1f4,_[_0x482c('0x5d')](_0x5b9153,_0x482c('0x5e'))[_0x482c('0x16')](',\x20')));}var _0x38eafd=_[_0x482c('0x59')](_0x4556c8[_0x482c('0x76')],{'uniqueid':_0x5b804f[_0x482c('0x5f')]});if(_0x38eafd&&_0x38eafd['channel']){return ami[_0x482c('0x1c')]({'action':_0x482c('0x7a'),'channel':_0x38eafd[_0x482c('0x60')],'exten':_0x5b804f['exten'],'context':_0x5b804f['context']||_0x38eafd['context'],'priority':0x1})[_0x482c('0x20')](function(_0x5b3629){_0x2c0056({'code':0xc8,'message':[_0x5b804f['uniqueid'],_0x5b3629[_0x482c('0x5e')]['toLowerCase']()][_0x482c('0x16')]('\x20')});})[_0x482c('0x1d')](function(_0x17be77){_0x4d6926(_0x48b9c2[_0x482c('0x12')](0x1f5,[_0x5b804f['uniqueid'],_0x17be77[_0x482c('0x5e')]['toLowerCase']()][_0x482c('0x16')]('\x20')));});}else{return _0x4d6926(_0x48b9c2[_0x482c('0x12')](0x1f5,_0x482c('0x6e')));}});},'Agents':function(_0x492ab0){return new Promise(function(_0x590d97,_0x145c5e){var _0x45011c=_['values'](_0x4556c8[_0x482c('0xf')]);_0x590d97({'count':_0x45011c['length'],'rows':_0x45011c});});},'Telephones':function(_0x929a4){return new Promise(function(_0x2c683f,_0x2f5799){var _0x549dec=_[_0x482c('0x5b')](_0x4556c8[_0x482c('0x7b')]);_0x2c683f({'count':_0x549dec[_0x482c('0x58')],'rows':_0x549dec});});},'Trunks':function(_0x573455){return new Promise(function(_0x27b6d2,_0x34f49f){var _0x56a961=_['values'](_0x4556c8['trunks']);_0x27b6d2({'count':_0x56a961[_0x482c('0x58')],'rows':_0x56a961});});},'OutboundChannels':function(_0x88661b){return new Promise(function(_0x3f0561,_0x4903f1){var _0xd5f6df=_[_0x482c('0x5b')](_0x4556c8['outboundChannels']);_0x3f0561({'count':_0xd5f6df[_0x482c('0x58')],'rows':_0xd5f6df});});},'Outbound':function(_0x5516d6){return new Promise(function(_0x106aa1,_0x363735){_0x106aa1(_0x4556c8[_0x482c('0x2f')]);});},'Campaigns':function(_0x1b4c75){return new Promise(function(_0x2db600,_0x255894){var _0x4dbd16=_['values'](_0x4556c8[_0x482c('0x7c')]);_0x2db600({'count':_0x4dbd16[_0x482c('0x58')],'rows':_0x4dbd16});});},'VoiceQueuesPreview':function(_0x2156af){var _0x319fc3=this;return new Promise(function(_0x7d0afa,_0x13df33){_0x47edb6[_0x482c('0x7d')](_0x2156af['id'])['then'](function(_0x3f5eac){_0x7d0afa({'code':0xc8,'message':_0x3f5eac[_0x482c('0x5e')]});})[_0x482c('0x1d')](function(_0x483e29){_0x13df33(_0x319fc3[_0x482c('0x12')](0x1f4,_0x483e29[_0x482c('0x5e')]));});});},'EventManager':function(_0x2eca83){var _0x190ee5=this;return new Promise(function(_0x45fe30,_0x1f4fd0){if(!_0x2eca83[_0x482c('0x7e')]){return _0x1f4fd0(_0x190ee5['error'](0x1f4,_0x482c('0x7f')));}ami[_0x482c('0x80')](_0x482c('0x81')+_0x2eca83['event'],_0x2eca83[_0x482c('0x5e')]);_0x45fe30({'code':0xc8,'message':_0x2eca83});});},'FaxAccounts':function(_0x55a8a6){return new Promise(function(_0x335a76,_0x3b948c){var _0x3e00e2=_[_0x482c('0x5b')](_0x4556c8['faxAccounts']);_0x335a76({'count':_0x3e00e2[_0x482c('0x58')],'rows':_0x3e00e2});});},'SendFax':function(_0xeaee3d){var _0x1120e1=this;return new Promise(function(_0xf8ac35,_0x5e3619){_0x477cf4[_0x482c('0x82')](_0xeaee3d)[_0x482c('0x20')](function(_0x157896){_0xf8ac35({'code':0xc8,'message':_0x157896[_0x482c('0x5e')]});})[_0x482c('0x1d')](function(_0x4aead3){_0x5e3619(_0x1120e1[_0x482c('0x12')](0x1f4,_0x4aead3[_0x482c('0x5e')]));});});},'CheckAfterSend':function(_0x1911f1){var _0x308dc8=this;return new Promise(function(_0x10fb1f,_0x5cd466){_0x477cf4[_0x482c('0x83')](_0x1911f1)[_0x482c('0x20')](function(_0x44da80){_0x10fb1f({'code':0xc8,'message':_0x44da80['message']});})[_0x482c('0x1d')](function(_0x1f2546){_0x5cd466(_0x308dc8[_0x482c('0x12')](0x1f4,_0x1f2546[_0x482c('0x5e')]));});});}};var _0x519225=jayson[_0x482c('0x84')](_0x32a503)[_0x482c('0x85')]();_0x519225['on'](_0x482c('0x12'),function(_0x5cbf1a){return _0xfdb92(_0x5cbf1a);});_0x519225[_0x482c('0x86')](0x232a,_0x482c('0x87'),function(){console[_0x482c('0x88')](_0x482c('0x89'),0x232a);return _0x5d7c76('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x6b1b=['join','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','wav','Hangup','queueChannels','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','send','server','http','127.0.0.1','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','timer','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','action','Reload','Action','then','message'];(function(_0x163bab,_0x648650){var _0x4becaa=function(_0x282b88){while(--_0x282b88){_0x163bab['push'](_0x163bab['shift']());}};_0x4becaa(++_0x648650);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x6b1b[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var jayson=require(_0xb6b1('0x1'));var schema=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var moment=require(_0xb6b1('0x3'));var config=require(_0xb6b1('0x4'));var properties=require(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));exports[_0xb6b1('0x7')]=function(_0x345886,_0x41bf3e,_0x113a39){return new BPromise(function(_0x1ff716,_0x13334e){var _0x1a4cd0={'QueuePause':function(_0x5b440a){return new Promise(function(_0x2734cc,_0x52aa76){var _0x4da7d3=util[_0xb6b1('0x8')]('%s/%s',_0xb6b1('0x9'),_0x5b440a['name']);if(_0x345886['timers']&&_0x345886['timers'][_0x4da7d3]&&_0x345886['timers'][_0x4da7d3][_0xb6b1('0xa')]){_0x345886[_0xb6b1('0xb')][_0x4da7d3]['updateAcw']();}if(_0x345886[_0xb6b1('0xc')][_0x4da7d3]){_0x345886['agents'][_0x4da7d3]['updateStatusRealtime']({'statePause':_0x5b440a[_0xb6b1('0xd')]?!![]:![]});}_0x2734cc({'code':0xc8,'message':_0xb6b1('0xe')});});},'Reload':function(_0x12f3ff){var _0x327eee=this;return new Promise(function(_0x23881d,_0x18f6b5){if(ami[_0xb6b1('0xf')]()==![]){return _0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')]['join']('\x20')));}_0x12f3ff=_['pick'](_0x12f3ff,_['keys'](properties['module']));_0x12f3ff[_0xb6b1('0x14')]=_0xb6b1('0x15');return ami[_0xb6b1('0x16')](_0x12f3ff)[_0xb6b1('0x17')](function(_0x32e395){_0x23881d({'code':0xc8,'message':_0x32e395[_0xb6b1('0x18')]});})['catch'](function(_0x581e28){_0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f5,_0x581e28[_0xb6b1('0x18')]));});});},'Command':function(_0x16d969){var _0x11e8ae=this;return new Promise(function(_0x45d9e6,_0x3fc9b1){if(ami['isConnected']()==![]){return _0x3fc9b1(_0x11e8ae['error'](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}_0x16d969=_['pick'](_0x16d969,'command');_0x16d969[_0xb6b1('0x14')]=_0xb6b1('0x1a');return ami[_0xb6b1('0x16')](_0x16d969)[_0xb6b1('0x17')](function(_0x164952){_0x45d9e6({'code':0xc8,'message':_0x164952[_0xb6b1('0x1b')]});})[_0xb6b1('0x1c')](function(_0x3b1ff7){_0x3fc9b1(_0x11e8ae[_0xb6b1('0x10')](0x1f5,_0x3b1ff7[_0xb6b1('0x18')]));});});},'VoiceQueues':function(_0x5069cd){return new Promise(function(_0x214cd0,_0x4f1e2e){var _0xd8e094=[];for(var _0x5864d6 in _0x345886[_0xb6b1('0x1d')]){if(_0x345886['voiceQueues'][_0xb6b1('0x1e')](_0x5864d6)){var _0x387603=_0x345886[_0xb6b1('0x1d')][_0x5864d6];var _0x178401={'id':_0x387603['id'],'name':_0x387603[_0xb6b1('0x1f')],'strategy':_0x387603[_0xb6b1('0x20')],'answered':_0x387603[_0xb6b1('0x21')],'available':_0x387603[_0xb6b1('0x22')],'loggedIn':_0x387603[_0xb6b1('0x23')],'pTalking':_0x387603['pTalking'],'sumBillable':_0x387603[_0xb6b1('0x24')],'sumDuration':_0x387603['sumDuration'],'sumHoldTime':_0x387603[_0xb6b1('0x25')]||0x0,'talking':_0x387603[_0xb6b1('0x26')],'total':_0x387603[_0xb6b1('0x27')],'type':_0x387603[_0xb6b1('0x28')],'unmanaged':_0x387603[_0xb6b1('0x29')],'abandoned':_0x387603[_0xb6b1('0x2a')],'waiting':_0x387603[_0xb6b1('0x2b')],'loggedInDb':_0x387603['loggedInDb']};if(_0x387603[_0xb6b1('0x28')]===_0xb6b1('0x2c')){_0x178401[_0xb6b1('0x2d')]=_0x387603['dialActive'];_0x178401[_0xb6b1('0x2e')]=_0x387603[_0xb6b1('0x2e')];_0x178401['dialOriginateCallerIdName']=_0x387603[_0xb6b1('0x2f')];_0x178401[_0xb6b1('0x30')]=_0x387603[_0xb6b1('0x30')];_0x178401[_0xb6b1('0x31')]=_0x387603[_0xb6b1('0x31')];_0x178401[_0xb6b1('0x32')]=_0x387603['dialPrefix'];_0x178401[_0xb6b1('0x33')]=_0x387603[_0xb6b1('0x33')];_0x178401['outboundAnswerAgiCallsDay']=_0x387603[_0xb6b1('0x34')];_0x178401['outboundAnswerCallsDay']=_0x387603[_0xb6b1('0x35')];_0x178401[_0xb6b1('0x36')]=_0x387603[_0xb6b1('0x36')];_0x178401[_0xb6b1('0x37')]=_0x387603[_0xb6b1('0x37')];_0x178401[_0xb6b1('0x38')]=_0x387603['outboundCongestionCallsDay'];_0x178401[_0xb6b1('0x39')]=_0x387603[_0xb6b1('0x39')];_0x178401[_0xb6b1('0x3a')]=_0x387603[_0xb6b1('0x3a')];_0x178401['outboundDropCallsDayTimeout']=_0x387603['outboundDropCallsDayTimeout'];_0x178401['outboundNoAnswerCallsDay']=_0x387603[_0xb6b1('0x3b')];_0x178401[_0xb6b1('0x3c')]=_0x387603[_0xb6b1('0x3c')];_0x178401[_0xb6b1('0x3d')]=_0x387603[_0xb6b1('0x3d')];_0x178401[_0xb6b1('0x3e')]=_0x387603[_0xb6b1('0x3e')];_0x178401[_0xb6b1('0x3f')]=_0x387603[_0xb6b1('0x3f')];_0x178401[_0xb6b1('0x40')]=_0x387603[_0xb6b1('0x40')];_0x178401[_0xb6b1('0x41')]=_0x387603['predictiveIntervalAnsweredCalls'];_0x178401[_0xb6b1('0x42')]=_0x387603[_0xb6b1('0x42')];_0x178401[_0xb6b1('0x43')]=_0x387603[_0xb6b1('0x43')];_0x178401[_0xb6b1('0x44')]=_0x387603[_0xb6b1('0x44')];_0x178401[_0xb6b1('0x45')]=_0x387603[_0xb6b1('0x45')];_0x178401[_0xb6b1('0x46')]=_0x387603[_0xb6b1('0x46')];_0x178401[_0xb6b1('0x47')]=_0x387603['predictiveIntervalErlangCallsDroppedCalls'];_0x178401[_0xb6b1('0x48')]=_0x387603[_0xb6b1('0x48')];_0x178401[_0xb6b1('0x49')]=_0x387603[_0xb6b1('0x49')];_0x178401[_0xb6b1('0x4a')]=_0x387603[_0xb6b1('0x4a')];_0x178401[_0xb6b1('0x4b')]=_0x387603[_0xb6b1('0x4b')];_0x178401['predictiveIntervalTotalCalls']=_0x387603['predictiveIntervalTotalCalls'];_0x178401[_0xb6b1('0x18')]=_0x387603[_0xb6b1('0x18')];_0x178401[_0xb6b1('0x4c')]=_0x387603['originated'];_0x178401[_0xb6b1('0x4d')]=_0x387603[_0xb6b1('0x4d')];_0x178401[_0xb6b1('0x4e')]=_0x387603[_0xb6b1('0x4e')];_0x178401[_0xb6b1('0x4f')]=_0x387603[_0xb6b1('0x4f')];_0x178401[_0xb6b1('0x50')]=_0x387603[_0xb6b1('0x50')];_0x178401['startPredictive']=_0x387603[_0xb6b1('0x51')];_0x178401['startProgressive']=_0x387603[_0xb6b1('0x52')];}if(_0x387603[_0xb6b1('0x53')]){_0x178401[_0xb6b1('0x53')]={'id':_0x387603[_0xb6b1('0x53')]['id'],'name':_0x387603[_0xb6b1('0x53')][_0xb6b1('0x1f')],'active':_0x387603['Trunk'][_0xb6b1('0x54')],'callerid':_0x387603[_0xb6b1('0x53')]['callerid']};}if(_0x387603[_0xb6b1('0x55')]){_0x178401['Interval']={'id':_0x387603[_0xb6b1('0x55')]['id'],'name':_0x387603[_0xb6b1('0x55')][_0xb6b1('0x1f')]};}_0xd8e094[_0xb6b1('0x56')](_0x178401);}}_0x214cd0({'count':_0xd8e094[_0xb6b1('0x57')],'rows':_0xd8e094});});},'UpdateVoiceQueue':function(_0x20489a){return new Promise(function(_0x19cc0f,_0x31a6c7){var _0x1d5b09=_['find'](_0x345886['voiceQueues'],{'id':parseInt(_0x20489a['id'])});var _0x3826bd=_[_0xb6b1('0x58')](_0x20489a,['id']);if(_0x1d5b09){for(var _0x5959ca in _0x3826bd){if(typeof _0x3826bd[_0x5959ca]!==_0xb6b1('0x59')&&typeof _0x1d5b09[_0x5959ca]!==_0xb6b1('0x59')){_0x1d5b09[_0x5959ca]=_0x3826bd[_0x5959ca];}}_0x19cc0f(_0x1d5b09);}else{_0x31a6c7();}});},'VoiceChannels':function(_0x6f7b41){return new Promise(function(_0x1a95cf,_0x7cebdc){var _0x505a80=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x5b')]);_0x1a95cf({'count':_0x505a80[_0xb6b1('0x57')],'rows':_0x505a80});});},'VoiceChannelMixMonitor':function(_0x3f02bc){var _0x4da826=this;return new Promise(function(_0x5bfd0e,_0x20e93b){if(ami['isConnected']()==![]){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config['asterisk'][_0xb6b1('0x12')],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x7d4763=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x3f02bc);if(_0x7d4763[_0xb6b1('0x57')]>0x0){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x7d4763,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x2700ed=_['find'](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x3f02bc[_0xb6b1('0x5e')]});if(_0x2700ed&&_0x2700ed[_0xb6b1('0x5f')]){var _0x39c0d9=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x3f02bc[_0xb6b1('0x61')]||_0x3f02bc[_0xb6b1('0x5e')],_0x3f02bc[_0xb6b1('0x8')]||'wav');return ami[_0xb6b1('0x16')]({'action':'MixMonitor','channel':_0x2700ed['channel'],'file':_0x39c0d9,'options':_0xb6b1('0x62')})[_0xb6b1('0x17')](function(_0x5be7bf){var _0x3b482b=_[_0xb6b1('0x63')](_0x2700ed[_0xb6b1('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c0d9[_0xb6b1('0x65')]()});if(_['isNil'](_0x3b482b)){_0x2700ed['monitors'][_0xb6b1('0x56')]({'filename':_0xb6b1('0x66')+_0x39c0d9['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5be7bf[_0xb6b1('0x67')],'status':'rec'});}else{_0x3b482b['mixmonitorid']=_0x5be7bf['mixmonitorid'];_0x3b482b[_0xb6b1('0x68')]=_0xb6b1('0x69');}_0x5bfd0e({'code':0xc8,'message':[_0x3f02bc[_0xb6b1('0x5e')],_0xb6b1('0x6a'),_0x5be7bf[_0xb6b1('0x67')]][_0xb6b1('0x19')]('\x20'),'mixmonitorid':_0x5be7bf['mixmonitorid']});})[_0xb6b1('0x1c')](function(_0x322e35){_0x20e93b(_0x4da826['error'](0x1f5,[_0x3f02bc['uniqueid'],_0x322e35[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')));});}else{return _0x20e93b(_0x4da826['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x484afc){var _0x463482=this;return new Promise(function(_0x1ce8a2,_0x4a07ed){if(ami[_0xb6b1('0xf')]()==![]){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x35aae0=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x484afc);if(_0x35aae0['length']>0x0){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x35aae0,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x4a7796=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x484afc[_0xb6b1('0x5e')]});if(_0x4a7796){return BPromise[_0xb6b1('0x6c')]()[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'StopMixMonitor','channel':_0x4a7796['channel'],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})['catch'](function(_0x2e91fa){});}})[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x6d')]){return ami['Action']({'action':_0xb6b1('0x6e'),'channel':_0x4a7796[_0xb6b1('0x6d')],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})[_0xb6b1('0x1c')](function(_0x463112){});}})['then'](function(_0x4ddcf3){var _0x11e94e=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'mixmonitorid':_0x484afc[_0xb6b1('0x67')]});if(_0x11e94e){_0x11e94e[_0xb6b1('0x68')]=_0xb6b1('0x6f');}})[_0xb6b1('0x17')](function(){var _0x3d6edf=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x484afc[_0xb6b1('0x61')]||_0x484afc[_0xb6b1('0x5e')],_0x484afc['format']||_0xb6b1('0x70'));var _0x49ace7=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'filename':_0xb6b1('0x66')+_0x3d6edf['toLowerCase']()});if(_0x49ace7){_0x49ace7[_0xb6b1('0x68')]='stop';}})['then'](function(){_0x1ce8a2({'code':0xc8,'message':[_0x484afc[_0xb6b1('0x5e')],'StopMixMonitor\x20Success'][_0xb6b1('0x19')]('\x20')});})[_0xb6b1('0x1c')](function(_0x509667){_0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f5,[_0x484afc['uniqueid'],_0x509667[_0xb6b1('0x18')][_0xb6b1('0x65')]()][_0xb6b1('0x19')]('\x20')));});}else{return _0x4a07ed(_0x463482['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x4ef26a){return new Promise(function(_0x20f2f2,_0x469f7f){var _0x3e1695=_[_0xb6b1('0x5a')](_0x345886['queueChannels']);_0x20f2f2({'count':_0x3e1695[_0xb6b1('0x57')],'rows':_0x3e1695});});},'VoiceQueuesChannel':function(_0x410fe6){var _0x3e663d=this;return new Promise(function(_0xb611fa,_0x381793){var _0x2aa294=schema(properties['voicequeuechannel'])[_0xb6b1('0x2')](_0x410fe6);if(_0x2aa294[_0xb6b1('0x57')]>0x0){return _0x381793(_0x3e663d[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x2aa294,'message')[_0xb6b1('0x19')](',\x20')));}var _0x1c4bde=_['find'](_0x345886['queueChannels'],{'uniqueid':_0x410fe6['uniqueid']});if(_0x1c4bde){_0xb611fa(_0x1c4bde);}else{return _0x381793(_0x3e663d['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x439b23){var _0x17ce08=this;return new Promise(function(_0xc203ce,_0x1d039a){if(ami[_0xb6b1('0xf')]()==![]){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x28213e=schema(properties['voicequeuechannelhangup'])[_0xb6b1('0x2')](_0x439b23);if(_0x28213e[_0xb6b1('0x57')]>0x0){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x28213e,_0xb6b1('0x18'))['join'](',\x20')));}var _0x3d96c6=_[_0xb6b1('0x63')](_0x345886['queueChannels'],{'uniqueid':_0x439b23['uniqueid']});if(_0x3d96c6&&_0x3d96c6[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':_0xb6b1('0x71'),'channel':_0x3d96c6[_0xb6b1('0x5f')]})[_0xb6b1('0x17')](function(_0x28860e){_0xc203ce({'code':0xc8,'message':[_0x439b23[_0xb6b1('0x5e')],_0x28860e[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x57fd39){_0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,[_0x439b23[_0xb6b1('0x5e')],_0x57fd39[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x37c3e6){var _0x588390=this;return new Promise(function(_0x4c79dc,_0x955b9b){if(ami['isConnected']()==![]){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x3765ca=schema(properties['voicequeuechannelredirect'])[_0xb6b1('0x2')](_0x37c3e6);if(_0x3765ca[_0xb6b1('0x57')]>0x0){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x3765ca,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x19415a=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x72')],{'uniqueid':_0x37c3e6[_0xb6b1('0x5e')]});if(_0x19415a&&_0x19415a[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'Redirect','channel':_0x19415a[_0xb6b1('0x5f')],'exten':_0x37c3e6[_0xb6b1('0x73')],'context':_0x37c3e6['context']||_0x19415a[_0xb6b1('0x74')],'priority':0x1})[_0xb6b1('0x17')](function(_0x5b02b7){_0x4c79dc({'code':0xc8,'message':[_0x37c3e6[_0xb6b1('0x5e')],_0x5b02b7['message'][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x5e1d5c){_0x955b9b(_0x588390['error'](0x1f5,[_0x37c3e6[_0xb6b1('0x5e')],_0x5e1d5c[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f5,_0xb6b1('0x6b')));}});},'Agents':function(_0xac8b8a){return new Promise(function(_0x292dbe,_0x6b6d3){var _0x3e7949=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0xc')]);_0x292dbe({'count':_0x3e7949[_0xb6b1('0x57')],'rows':_0x3e7949});});},'Telephones':function(_0x28231c){return new Promise(function(_0x18a71f,_0x521366){var _0x1d1e49=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x75')]);_0x18a71f({'count':_0x1d1e49[_0xb6b1('0x57')],'rows':_0x1d1e49});});},'Trunks':function(_0x489898){return new Promise(function(_0x1ee829,_0x2be41a){var _0x15818e=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x76')]);_0x1ee829({'count':_0x15818e[_0xb6b1('0x57')],'rows':_0x15818e});});},'OutboundChannels':function(_0x4872c7){return new Promise(function(_0x3954dd,_0x2c0509){var _0xe96200=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x77')]);_0x3954dd({'count':_0xe96200[_0xb6b1('0x57')],'rows':_0xe96200});});},'Outbound':function(_0x137c52){return new Promise(function(_0x433ce8,_0x400819){_0x433ce8(_0x345886[_0xb6b1('0x2c')]);});},'Campaigns':function(_0x3b9eb2){return new Promise(function(_0x54fa89,_0x5d3d77){var _0x2046e5=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x78')]);_0x54fa89({'count':_0x2046e5[_0xb6b1('0x57')],'rows':_0x2046e5});});},'VoiceQueuesPreview':function(_0x36d30b){var _0x32b89e=this;return new Promise(function(_0x43d32a,_0x3fbff1){_0x41bf3e['run'](_0x36d30b['id'])[_0xb6b1('0x17')](function(_0x1fa035){_0x43d32a({'code':0xc8,'message':_0x1fa035[_0xb6b1('0x18')]});})['catch'](function(_0x8f27ea){_0x3fbff1(_0x32b89e['error'](0x1f4,_0x8f27ea['message']));});});},'EventManager':function(_0x13f438){var _0x320c96=this;return new Promise(function(_0xa7b8d2,_0xf5dbf9){if(!_0x13f438[_0xb6b1('0x79')]){return _0xf5dbf9(_0x320c96[_0xb6b1('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb6b1('0x7a')](_0xb6b1('0x7b')+_0x13f438[_0xb6b1('0x79')],_0x13f438[_0xb6b1('0x18')]);_0xa7b8d2({'code':0xc8,'message':_0x13f438});});},'FaxAccounts':function(_0x5712df){return new Promise(function(_0x4ea394,_0xdeaa28){var _0x5c8321=_[_0xb6b1('0x5a')](_0x345886['faxAccounts']);_0x4ea394({'count':_0x5c8321[_0xb6b1('0x57')],'rows':_0x5c8321});});},'SendFax':function(_0x516f87){var _0x58b209=this;return new Promise(function(_0x384595,_0x349feb){_0x113a39[_0xb6b1('0x7c')](_0x516f87)[_0xb6b1('0x17')](function(_0x3929e1){_0x384595({'code':0xc8,'message':_0x3929e1['message']});})[_0xb6b1('0x1c')](function(_0x170d5c){_0x349feb(_0x58b209[_0xb6b1('0x10')](0x1f4,_0x170d5c[_0xb6b1('0x18')]));});});},'CheckAfterSend':function(_0x523037){var _0xb668af=this;return new Promise(function(_0x5248c7,_0x3158cd){_0x113a39['checkAfterSend'](_0x523037)[_0xb6b1('0x17')](function(_0x554155){_0x5248c7({'code':0xc8,'message':_0x554155['message']});})['catch'](function(_0x4908ab){_0x3158cd(_0xb668af[_0xb6b1('0x10')](0x1f4,_0x4908ab['message']));});});}};var _0x25dbd6=jayson[_0xb6b1('0x7d')](_0x1a4cd0)[_0xb6b1('0x7e')]();_0x25dbd6['on'](_0xb6b1('0x10'),function(_0x5d1c1d){return _0x13334e(_0x5d1c1d);});_0x25dbd6[_0xb6b1('0x7')](0x232a,_0xb6b1('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ff716('RPC\x20listening\x20on\x20port:'+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 899d008..feb5929 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 _0x1aa2=['lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','merge','length','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','routeId','calleridnum','destcalleridnum','firstName'];(function(_0x573aee,_0x483c6b){var _0x558ab3=function(_0x32abd6){while(--_0x32abd6){_0x573aee['push'](_0x573aee['shift']());}};_0x558ab3(++_0x483c6b);}(_0x1aa2,0x1b7));var _0x21aa=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x1aa2[_0x1602ef];return _0x5870ee;};'use strict';var _=require('lodash');var BPromise=require(_0x21aa('0x0'));var Redis=require(_0x21aa('0x1'));var util=require('util');var config=require(_0x21aa('0x2'));var logger=require(_0x21aa('0x3'))(_0x21aa('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x21aa('0x5')]=_[_0x21aa('0x6')](config[_0x21aa('0x5')],{'host':_0x21aa('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21aa('0x5')]));function emit(_0x131e18,_0xb05405,_0x25f03a,_0x54ee57,_0xde8728){logger[_0x21aa('0x8')](_0x21aa('0x9'),_0x131e18,_0xb05405['id'],_0x25f03a,_0x54ee57,JSON[_0x21aa('0xa')](_0xde8728));io['to'](_0x25f03a)[_0x21aa('0xb')](_0x54ee57,_0xde8728);}exports[_0x21aa('0xc')]=function(_0x28f9ed,_0x45a807,_0x44dc50,_0x2ad747){var _0x8adab2,_0x3ecf3d;var _0x363a2d={};var _0x2b95a2;var _0x28e0af=Number(_0x44dc50[_0x21aa('0xd')]);var _0x7e1ffe=_0x44dc50[_0x21aa('0xe')]?Boolean(Number(_0x44dc50['data2'])):![];var _0x31e24f;var _0x117a7d=![];if(!_[_0x21aa('0xf')](_0x44dc50['data5'])){if(_0x44dc50[_0x21aa('0x10')]=='1')_0x117a7d=!![];}if(!_0x117a7d){if(_0x2ad747['xmd-contactid']){_0x363a2d['id']=_0x2ad747[_0x21aa('0x11')];}}if(!_0x363a2d['id']){_0x363a2d['ListId']=_0x28e0af;_0x31e24f=_0x44dc50[_0x21aa('0x12')]&&_0x44dc50[_0x21aa('0x12')]!=='0'?_0x44dc50[_0x21aa('0x12')]['split'](','):[_0x21aa('0x13')];_0x363a2d[_0x21aa('0x14')]=_['map'](_0x31e24f,function(_0x214788){var _0x1de886={};_0x1de886[_0x214788]=_0x2ad747[_0x21aa('0x15')]?_0x2ad747['destcalleridnum']:_0x2ad747[_0x21aa('0x16')];return _0x1de886;});_0x2b95a2=_0x2ad747['routeId']?_0x2ad747[_0x21aa('0x17')]:_0x2ad747[_0x21aa('0x16')];}var _0x14b773=['id',_0x21aa('0x18'),_0x21aa('0x19'),_0x21aa('0x13'),_0x21aa('0x1a'),_0x21aa('0x1b'),'ListId',_0x21aa('0x1c'),_0x21aa('0x1d'),_0x21aa('0x1e')];var _0x57a3b9=_[_0x21aa('0x1f')](_0x14b773,_0x31e24f);BPromise[_0x21aa('0x20')]()['then'](cmContactRpc[_0x21aa('0x21')]({'attributes':_0x57a3b9,'where':_0x363a2d,'phone':_0x2b95a2}))[_0x21aa('0x22')](function(_0x2e200f){_0x3ecf3d=_0x2e200f;if(!_[_0x21aa('0x23')](_0x3ecf3d)){if(_0x3ecf3d['length']===0x1){_0x8adab2=_0x3ecf3d[0x0];logger['info'](_0x21aa('0x24'),_0x2ad747[_0x21aa('0x25')],_0x45a807['id'],_0x8adab2['id']);}else{logger[_0x21aa('0x8')](_0x21aa('0x26'),_0x2ad747[_0x21aa('0x25')],_0x45a807['id'],_[_0x21aa('0x27')](_0x3ecf3d,'id')[_0x21aa('0x28')](','));}return;}else{logger['info'](_0x21aa('0x29'),_0x2ad747[_0x21aa('0x25')],_0x45a807['id']);var _0x33d911={'ListId':_0x28e0af};var _0x1459ba=_0x44dc50['data4']&&_0x44dc50[_0x21aa('0x2a')]!=='0'?_0x44dc50[_0x21aa('0x2a')]:_0x21aa('0x13');if(_0x7e1ffe){logger[_0x21aa('0x8')](_0x21aa('0x2b'),_0x2ad747[_0x21aa('0x25')],_0x45a807['id']);_0x33d911[_0x1459ba]=_[_0x21aa('0xf')](_0x2ad747[_0x21aa('0x15')])?_0x2ad747[_0x21aa('0x16')]:_0x2ad747[_0x21aa('0x17')];if(_[_0x21aa('0xf')](_0x2ad747[_0x21aa('0x15')])){_0x33d911[_0x21aa('0x18')]=_0x2ad747[_0x21aa('0x2c')]&&_0x2ad747[_0x21aa('0x2c')]!==_0x21aa('0x2d')?_0x2ad747[_0x21aa('0x2c')]:_0x21aa('0x2e');}else{_0x33d911[_0x21aa('0x18')]=_0x2ad747[_0x21aa('0x2f')]&&_0x2ad747['destcalleridname']!==_0x21aa('0x2d')?_0x2ad747[_0x21aa('0x2f')]:'Unknown';}return BPromise[_0x21aa('0x20')]()[_0x21aa('0x22')](cmContactRpc[_0x21aa('0x30')](_0x33d911))[_0x21aa('0x22')](function(_0x1f9913){_0x8adab2=_0x1f9913;_0x3ecf3d[_0x21aa('0x31')](_0x1f9913);if(_0x8adab2){logger[_0x21aa('0x8')](_0x21aa('0x32'),_0x2ad747['uniqueid'],_0x45a807['id'],_0x8adab2['id']);}return;});}else{logger['info'](_0x21aa('0x33'),_0x2ad747[_0x21aa('0x25')],_0x45a807['id']);_0x33d911[_0x1459ba]=_[_0x21aa('0xf')](_0x2ad747[_0x21aa('0x15')])?_0x2ad747[_0x21aa('0x16')]:_0x2ad747[_0x21aa('0x17')];if(_[_0x21aa('0xf')](_0x2ad747[_0x21aa('0x15')])){_0x33d911[_0x21aa('0x18')]=_0x2ad747['calleridname']&&_0x2ad747['calleridname']!==_0x21aa('0x2d')?_0x2ad747['calleridname']:'Unknown';}else{_0x33d911[_0x21aa('0x18')]=_0x2ad747[_0x21aa('0x2f')]&&_0x2ad747[_0x21aa('0x2f')]!==_0x21aa('0x2d')?_0x2ad747[_0x21aa('0x2f')]:_0x21aa('0x2e');}_0x8adab2=_0x33d911;_0x3ecf3d[_0x21aa('0x31')](_0x33d911);return;}}})[_0x21aa('0x22')](function(){if(_0x28f9ed){emit(_0x2ad747[_0x21aa('0x25')],_0x45a807,util[_0x21aa('0x34')]('user:%s',_0x28f9ed[_0x21aa('0x35')]),util['format'](_0x21aa('0x36'),_0x44dc50[_0x21aa('0x37')]['toLowerCase']()),{'evt':_[_0x21aa('0x38')](_0x2ad747,{'autoCreate':_0x7e1ffe}),'contact':_0x8adab2===undefined?{}:_0x8adab2,'contacts':_0x3ecf3d[_0x21aa('0x39')]===0x0?undefined:_0x3ecf3d});}});}; \ No newline at end of file +var _0xfac7=['$or','map','destcalleridnum','calleridnum','routeId','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','length','lodash','bluebird','ioredis','util','../../../../config/logger','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','isNil','data5','xmd-contactid','ListId','data3','split','phone'];(function(_0x1b7f00,_0x42ab9a){var _0x31be4d=function(_0x321010){while(--_0x321010){_0x1b7f00['push'](_0x1b7f00['shift']());}};_0x31be4d(++_0x42ab9a);}(_0xfac7,0x1c9));var _0x7fac=function(_0x442ccd,_0x415d61){_0x442ccd=_0x442ccd-0x0;var _0x1a2c10=_0xfac7[_0x442ccd];return _0x1a2c10;};'use strict';var _=require(_0x7fac('0x0'));var BPromise=require(_0x7fac('0x1'));var Redis=require(_0x7fac('0x2'));var util=require(_0x7fac('0x3'));var config=require('../../../../config/environment');var logger=require(_0x7fac('0x4'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x7fac('0x5')]=_['defaults'](config[_0x7fac('0x5')],{'host':_0x7fac('0x6'),'port':0x18eb});var io=require(_0x7fac('0x7'))(new Redis(config['redis']));function emit(_0x565449,_0x487da8,_0x175a48,_0x40d351,_0x16d52c){logger[_0x7fac('0x8')](_0x7fac('0x9'),_0x565449,_0x487da8['id'],_0x175a48,_0x40d351,JSON[_0x7fac('0xa')](_0x16d52c));io['to'](_0x175a48)[_0x7fac('0xb')](_0x40d351,_0x16d52c);}exports[_0x7fac('0xc')]=function(_0x46f8d1,_0x39b84f,_0x2cdf81,_0x1fb97e){var _0x4f0e89,_0x37e1f9;var _0x253377={};var _0x1f51b1;var _0x426453=Number(_0x2cdf81['data1']);var _0xfa9380=_0x2cdf81['data2']?Boolean(Number(_0x2cdf81['data2'])):![];var _0x17a31e;var _0x4cda83=![];if(!_[_0x7fac('0xd')](_0x2cdf81['data5'])){if(_0x2cdf81[_0x7fac('0xe')]=='1')_0x4cda83=!![];}if(!_0x4cda83){if(_0x1fb97e['xmd-contactid']){_0x253377['id']=_0x1fb97e[_0x7fac('0xf')];}}if(!_0x253377['id']){_0x253377[_0x7fac('0x10')]=_0x426453;_0x17a31e=_0x2cdf81[_0x7fac('0x11')]&&_0x2cdf81['data3']!=='0'?_0x2cdf81[_0x7fac('0x11')][_0x7fac('0x12')](','):[_0x7fac('0x13')];_0x253377[_0x7fac('0x14')]=_[_0x7fac('0x15')](_0x17a31e,function(_0x3bd09a){var _0x1f6336={};_0x1f6336[_0x3bd09a]=_0x1fb97e['routeId']?_0x1fb97e[_0x7fac('0x16')]:_0x1fb97e[_0x7fac('0x17')];return _0x1f6336;});_0x1f51b1=_0x1fb97e[_0x7fac('0x18')]?_0x1fb97e[_0x7fac('0x16')]:_0x1fb97e[_0x7fac('0x17')];}var _0x2a07d4=['id',_0x7fac('0x19'),_0x7fac('0x1a'),_0x7fac('0x13'),_0x7fac('0x1b'),'fax',_0x7fac('0x10'),_0x7fac('0x1c'),_0x7fac('0x1d'),_0x7fac('0x1e')];var _0x597cda=_[_0x7fac('0x1f')](_0x2a07d4,_0x17a31e);BPromise['resolve']()[_0x7fac('0x20')](cmContactRpc[_0x7fac('0x21')]({'attributes':_0x597cda,'where':_0x253377,'phone':_0x1f51b1}))['then'](function(_0x45e20c){_0x37e1f9=_0x45e20c;if(!_['isEmpty'](_0x37e1f9)){if(_0x37e1f9['length']===0x1){_0x4f0e89=_0x37e1f9[0x0];logger[_0x7fac('0x8')](_0x7fac('0x22'),_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id'],_0x4f0e89['id']);}else{logger[_0x7fac('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id'],_['map'](_0x37e1f9,'id')[_0x7fac('0x24')](','));}return;}else{logger[_0x7fac('0x8')](_0x7fac('0x25'),_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id']);var _0x5a696f={'ListId':_0x426453};var _0x56155e=_0x2cdf81[_0x7fac('0x26')]&&_0x2cdf81[_0x7fac('0x26')]!=='0'?_0x2cdf81[_0x7fac('0x26')]:_0x7fac('0x13');if(_0xfa9380){logger[_0x7fac('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id']);_0x5a696f[_0x56155e]=_['isNil'](_0x1fb97e['routeId'])?_0x1fb97e['calleridnum']:_0x1fb97e[_0x7fac('0x16')];if(_[_0x7fac('0xd')](_0x1fb97e[_0x7fac('0x18')])){_0x5a696f[_0x7fac('0x19')]=_0x1fb97e[_0x7fac('0x27')]&&_0x1fb97e[_0x7fac('0x27')]!==_0x7fac('0x28')?_0x1fb97e[_0x7fac('0x27')]:'Unknown';}else{_0x5a696f[_0x7fac('0x19')]=_0x1fb97e[_0x7fac('0x29')]&&_0x1fb97e[_0x7fac('0x29')]!==_0x7fac('0x28')?_0x1fb97e[_0x7fac('0x29')]:_0x7fac('0x2a');}return BPromise['resolve']()[_0x7fac('0x20')](cmContactRpc[_0x7fac('0x2b')](_0x5a696f))[_0x7fac('0x20')](function(_0x31f216){_0x4f0e89=_0x31f216;_0x37e1f9[_0x7fac('0x2c')](_0x31f216);if(_0x4f0e89){logger[_0x7fac('0x8')](_0x7fac('0x2d'),_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id'],_0x4f0e89['id']);}return;});}else{logger[_0x7fac('0x8')](_0x7fac('0x2e'),_0x1fb97e[_0x7fac('0x23')],_0x39b84f['id']);_0x5a696f[_0x56155e]=_['isNil'](_0x1fb97e[_0x7fac('0x18')])?_0x1fb97e[_0x7fac('0x17')]:_0x1fb97e['destcalleridnum'];if(_[_0x7fac('0xd')](_0x1fb97e[_0x7fac('0x18')])){_0x5a696f[_0x7fac('0x19')]=_0x1fb97e['calleridname']&&_0x1fb97e['calleridname']!==_0x7fac('0x28')?_0x1fb97e[_0x7fac('0x27')]:'Unknown';}else{_0x5a696f[_0x7fac('0x19')]=_0x1fb97e[_0x7fac('0x29')]&&_0x1fb97e['destcalleridname']!==_0x7fac('0x28')?_0x1fb97e[_0x7fac('0x29')]:_0x7fac('0x2a');}_0x4f0e89=_0x5a696f;_0x37e1f9['push'](_0x5a696f);return;}}})[_0x7fac('0x20')](function(){if(_0x46f8d1){emit(_0x1fb97e[_0x7fac('0x23')],_0x39b84f,util['format'](_0x7fac('0x2f'),_0x46f8d1[_0x7fac('0x30')]),util[_0x7fac('0x31')](_0x7fac('0x32'),_0x2cdf81['action'][_0x7fac('0x33')]()),{'evt':_['merge'](_0x1fb97e,{'autoCreate':_0xfa9380}),'contact':_0x4f0e89===undefined?{}:_0x4f0e89,'contacts':_0x37e1f9[_0x7fac('0x34')]===0x0?undefined:_0x37e1f9});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0c92f8f..25cb06d 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 _0xf567=['channel','motionChannel','AllConditions','every','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','clone','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','data3','isNil','location','data4','windowWidth','800','data6','winApplication','emit','format','user:%s','name','action','trigger:%s','exec','integration','queue','routeId','parse','query','search','replace'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xf567,0x118));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x7f56('0x0'));var _=require(_0x7f56('0x1'));var url=require(_0x7f56('0x2'));var Mustache=require('mustache');var Redis=require(_0x7f56('0x3'));var urlforward=require(_0x7f56('0x4'));var integration=require('./integration');var cmContact=require(_0x7f56('0x5'));var script=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var logger=require(_0x7f56('0x8'))('trigger');var ami=require(_0x7f56('0x9'));config[_0x7f56('0xa')]=_[_0x7f56('0xb')](config['redis'],{'host':_0x7f56('0xc'),'port':0x18eb});var io=require(_0x7f56('0xd'))(new Redis(config[_0x7f56('0xa')]));var operators={'equals':function(_0x3927b7,_0x3ac422){return _0x3927b7==_0x3ac422;},'not_equals':function(_0x3ad7d5,_0xc757aa){return _0x3ad7d5!=_0xc757aa;}};var barAndWebActions=[_0x7f56('0xe'),_0x7f56('0x2'),_0x7f56('0xf')];function Trigger(_0x138bd2){this[_0x7f56('0x10')]=_0x138bd2[_0x7f56('0x10')];this[_0x7f56('0x11')]=_0x138bd2[_0x7f56('0x11')];this[_0x7f56('0x12')]=_0x138bd2[_0x7f56('0x12')];this[_0x7f56('0x13')]=_0x138bd2[_0x7f56('0x13')];this[_0x7f56('0x14')]=_0x138bd2[_0x7f56('0x14')];this[_0x7f56('0x15')]=_0x138bd2['zendeskAccounts'];this[_0x7f56('0x16')]=_0x138bd2[_0x7f56('0x16')];this[_0x7f56('0x17')]=_0x138bd2['salesforceAccounts'];this[_0x7f56('0x18')]=_0x138bd2[_0x7f56('0x18')];this['zohoAccounts']=_0x138bd2[_0x7f56('0x19')];this[_0x7f56('0x1a')]=_0x138bd2['deskAccounts'];this['vtigerAccounts']=_0x138bd2[_0x7f56('0x1b')];this['servicenowAccounts']=_0x138bd2[_0x7f56('0x1c')];this[_0x7f56('0x1d')]=_0x138bd2['dynamics365Accounts'];this[_0x7f56('0x1e')]=_0x138bd2[_0x7f56('0x1e')];this[_0x7f56('0x1f')]={'zendesk':this[_0x7f56('0x15')],'salesforce':this[_0x7f56('0x17')],'freshdesk':this[_0x7f56('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x7f56('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0x7f56('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x7f56('0x1e')],'servicenow':this[_0x7f56('0x1c')]};ami['on'](_0x7f56('0x20'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x23'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x24'),this[_0x7f56('0x21')]['bind'](this));ami['on'](_0x7f56('0x25'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x26'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x27'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this[_0x7f56('0x21')]['bind'](this));ami['on'](_0x7f56('0x28'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on']('custom:agentreject',this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x29'),this[_0x7f56('0x21')]['bind'](this));ami['on'](_0x7f56('0x2a'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on']('custom:timeout',this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on']('custom:dialbegin',this['syncAgentDial']['bind'](this));ami['on'](_0x7f56('0x2b'),this['syncAgentDial']['bind'](this));ami['on'](_0x7f56('0x2c'),this['syncAgentDial'][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x2d'),this[_0x7f56('0x21')]['bind'](this));ami['on'](_0x7f56('0x2e'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on']('custom:substatus',this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x2f'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x30'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x31'),this[_0x7f56('0x21')][_0x7f56('0x22')](this));ami['on'](_0x7f56('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7f56('0x33'),this['syncCustomEvent'][_0x7f56('0x22')](this));}Trigger[_0x7f56('0x34')]['emit']=function(_0x444c9b,_0x41f89e,_0x585a43){logger[_0x7f56('0x35')](_0x444c9b,_0x41f89e,JSON[_0x7f56('0x36')](_0x585a43));io['to'](_0x444c9b)['emit'](_0x41f89e,_0x585a43);};Trigger[_0x7f56('0x34')][_0x7f56('0x21')]=function(_0x44dff2){var _0x5664a7=_[_0x7f56('0x37')](_0x44dff2);if(typeof _0x5664a7['motionChannel']===_0x7f56('0x38')){_0x5664a7['motionChannel']=_0x7f56('0x39');}this[_0x7f56('0x3a')](_0x5664a7);};Trigger['prototype']['syncAgentDial']=function(_0x5c18f1){if(this[_0x7f56('0x11')][_0x5c18f1[_0x7f56('0x3b')]]){this['syncCustomEvent'](_0x5c18f1);}};Trigger[_0x7f56('0x34')][_0x7f56('0x3a')]=function(_0x3af75a){var _0x33ab66;for(var _0x3aaf4d in this[_0x7f56('0x10')]){if(this[_0x7f56('0x10')][_0x7f56('0x3c')](_0x3aaf4d)){if(this[_0x7f56('0x10')][_0x3aaf4d][_0x7f56('0x3d')]){_0x33ab66=this[_0x7f56('0x3e')](this[_0x7f56('0x10')][_0x3aaf4d],_0x3af75a);if(_0x33ab66){_[_0x7f56('0x3f')](_0x3af75a,_0x3af75a[_0x7f56('0x40')]);for(var _0x352456=0x0,_0xa7e287,_0x40ee3f,_0x1a77d4;_0x3524560x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x385293,_0x5b2ca4){var _0x2b6789=function(_0x3671a7){while(--_0x3671a7){_0x385293['push'](_0x385293['shift']());}};_0x2b6789(++_0x5b2ca4);}(_0x814b,0x1a2));var _0xb814=function(_0x2d582c,_0x424a15){_0x2d582c=_0x2d582c-0x0;var _0x37e92a=_0x814b[_0x2d582c];return _0x37e92a;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index b16d5f5..9b1c943 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 _0x9e8a=['assign','getString','Subjects','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','Descriptions','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','data2','data5','POST','clientId','username','password','clientSecret','then','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','string','picklist','type','nameField','idField','indexOf','content','incident','incidents'];(function(_0xb3e6fe,_0x2d0cb1){var _0x1daa9c=function(_0x2e7f9e){while(--_0x2e7f9e){_0xb3e6fe['push'](_0xb3e6fe['shift']());}};_0x1daa9c(++_0x2d0cb1);}(_0x9e8a,0x1f1));var _0xa9e8=function(_0x693f65,_0x524d22){_0x693f65=_0x693f65-0x0;var _0x38c5d3=_0x9e8a[_0x693f65];return _0x38c5d3;};'use strict';var _=require(_0xa9e8('0x0'));var rp=require(_0xa9e8('0x1'));var util=require(_0xa9e8('0x2'));var intUtil=require(_0xa9e8('0x3'));var md5=require(_0xa9e8('0x4'));var Redis=require(_0xa9e8('0x5'));var logger=require(_0xa9e8('0x6'))(_0xa9e8('0x7'));var config=require(_0xa9e8('0x8'));config[_0xa9e8('0x9')]=_['defaults'](config[_0xa9e8('0x9')],{'host':_0xa9e8('0xa'),'port':0x18eb});var io=require(_0xa9e8('0xb'))(new Redis(config['redis']));function getAuthToken(_0x59c5b,_0x1a7a1c,_0x1da634){if(_0x59c5b[_0xa9e8('0xc')]){_0x59c5b[_0xa9e8('0xd')]=_0x59c5b['CloudProvider'][_0xa9e8('0xe')];_0x59c5b[_0xa9e8('0xf')]=_0x59c5b[_0xa9e8('0x10')][_0xa9e8('0x11')];return Promise['resolve'](_0x59c5b[_0xa9e8('0x10')][_0xa9e8('0x12')]);}var _0x35e748={'method':_0xa9e8('0x13'),'uri':_0x1a7a1c,'form':{'client_id':_0x59c5b[_0xa9e8('0x14')],'resource':_0x59c5b[_0xa9e8('0xd')],'username':_0x59c5b[_0xa9e8('0x15')],'password':_0x59c5b[_0xa9e8('0x16')],'grant_type':'password','client_secret':_0x59c5b[_0xa9e8('0x17')]},'json':!![]};return rp(_0x35e748)[_0xa9e8('0x18')](function(_0x2b53c7){return _0x2b53c7['access_token'];})['catch'](function(_0x12f605){logger[_0xa9e8('0x19')]('['+[_0x1da634[_0xa9e8('0x1a')]()]+_0xa9e8('0x1b'));return _0x12f605[_0xa9e8('0x1c')];});}function getUser(_0x4d3d7f,_0x1a3d96,_0x495f81,_0xe8bac3,_0x5390f4,_0x24362e){return new Promise(function(_0xdd8589,_0x5ae8bb){return getAuthToken(_0x1a3d96,_0xe8bac3,_0x24362e)[_0xa9e8('0x18')](function(_0x460746){var _0x1fc82a={'method':'GET','uri':_0x5390f4+_0xa9e8('0x1d'),'headers':{'Authorization':_0xa9e8('0x1e')+_0x460746,'OData-Version':_0xa9e8('0x1f')},'json':!![]};return rp(_0x1fc82a);})[_0xa9e8('0x18')](function(_0x3173ad){var _0x20fc50=_0x3173ad[_0xa9e8('0x20')];var _0x4552f2=![];var _0x4e80c7=null;if(!_[_0xa9e8('0x21')](_0x495f81)){if(intUtil[_0xa9e8('0x22')](_0x495f81[_0xa9e8('0x23')])){_0x4d3d7f[_0xa9e8('0x24')]=_0x495f81[_0xa9e8('0x23')];for(_0x4e80c7=0x0;_0x4e80c7<_0x20fc50[_0xa9e8('0x25')];_0x4e80c7++){if(_0x20fc50[_0x4e80c7][_0xa9e8('0x26')]===_0x495f81[_0xa9e8('0x23')]&&!_0x20fc50[_0x4e80c7]['isdisabled']){_0x4552f2=!![];logger[_0xa9e8('0x27')]('['+[_0x24362e[_0xa9e8('0x1a')]()]+_0xa9e8('0x28')+_0x20fc50[_0x4e80c7][_0xa9e8('0x29')]+'!');_0x4d3d7f[_0xa9e8('0x2a')]=_0x20fc50[_0x4e80c7][_0xa9e8('0x29')];}}}}if(!_0x4552f2){logger[_0xa9e8('0x27')]('['+[_0x24362e[_0xa9e8('0x1a')]()]+_0xa9e8('0x2b'));_0x4d3d7f['userEmail']=_0x1a3d96[_0xa9e8('0x15')];for(_0x4e80c7=0x0;_0x4e80c7<_0x20fc50[_0xa9e8('0x25')];_0x4e80c7++){if(_0x20fc50[_0x4e80c7][_0xa9e8('0x26')]===_0x1a3d96['username']){_0x4d3d7f[_0xa9e8('0x2a')]=_0x20fc50[_0x4e80c7]['systemuserid'];}}}_0xdd8589(_0x4d3d7f);})[_0xa9e8('0x2c')](function(_0x303fc7){_0x5ae8bb(_0x303fc7[_0xa9e8('0x1c')]);});});}function createEndUser(_0x391265,_0x436c74,_0x23ec6f,_0x55d25b,_0x1a4069,_0x12fa47,_0x130840){return new Promise(function(_0x17a88d,_0x9bad4b){return getAuthToken(_0x436c74,_0x23ec6f,_0x12fa47)[_0xa9e8('0x18')](function(_0x527f2d){var _0x37d265=_0x12fa47[_0xa9e8('0x2d')]()===_0xa9e8('0x2e')?_0x1a4069['destcalleridnum']:_0x1a4069[_0xa9e8('0x2f')];var _0x386e54={'method':_0xa9e8('0x13'),'uri':_0x55d25b+_0xa9e8('0x30'),'body':{'fullname':_0x37d265,'firstname':_0x37d265,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa9e8('0x31')+_0x391265['userId']+')'},'headers':{'Authorization':_0xa9e8('0x1e')+_0x527f2d,'OData-Version':_0xa9e8('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x386e54['body'][_0x130840]=_0x37d265;return rp(_0x386e54);})[_0xa9e8('0x18')](function(_0x33e9dc){var _0x3f0afe=_0x33e9dc['headers'][_0xa9e8('0x32')];var _0x288ab1=_0x3f0afe[_0xa9e8('0x33')](_0x3f0afe[_0xa9e8('0x34')]('(')+0x1,_0x3f0afe[_0xa9e8('0x34')](')'));_0x391265[_0xa9e8('0x35')]=_0x288ab1;_0x17a88d(_0x391265);})['catch'](function(_0x1d02ba){_0x9bad4b(_0x1d02ba[_0xa9e8('0x1c')]);});});}function getEndUser(_0x4b6f12,_0x49e244,_0x32b5d6,_0x2466b7,_0x3df17a,_0x409563,_0x2f1b9d,_0x48ad90){var _0x788b46=_0x409563[_0xa9e8('0x2d')]()===_0xa9e8('0x2e')?_0x3df17a[_0xa9e8('0x36')]:_0x3df17a[_0xa9e8('0x2f')];return getAuthToken(_0x49e244,_0x32b5d6,_0x409563)[_0xa9e8('0x18')](function(_0x3cb2c8){_0x48ad90=_0x48ad90?_0x48ad90:_0xa9e8('0x37');var _0x5129fd={'method':_0xa9e8('0x38'),'uri':_0x2466b7+_0xa9e8('0x39')+_0x48ad90+_0xa9e8('0x3a')+_0x48ad90+_0xa9e8('0x3b')+_0x788b46[_0xa9e8('0x3c')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3cb2c8,'If-None-Match':null,'OData-Version':_0xa9e8('0x1f')},'json':!![]};return rp(_0x5129fd);})[_0xa9e8('0x18')](function(_0x3f0eb9){var _0x56c53c=![];if(!_0x3f0eb9)return _0x56c53c;var _0x185170=_0x3f0eb9[_0xa9e8('0x20')];for(var _0x46ceae=0x0;_0x46ceae<_0x185170[_0xa9e8('0x25')];_0x46ceae++){if(_0x185170[_0x46ceae][_0x48ad90]===_0x788b46){_0x56c53c=!![];_0x4b6f12[_0xa9e8('0x35')]=_0x185170[_0x46ceae]['contactid'];}}return _0x56c53c;})['then'](function(_0x5ba5f2){if(_0x5ba5f2)return _0x4b6f12;if(_0x2f1b9d===_0xa9e8('0x3d')){logger['info']('['+[_0x409563[_0xa9e8('0x1a')]()]+_0xa9e8('0x3e'));return _0x4b6f12;}return createEndUser(_0x4b6f12,_0x49e244,_0x32b5d6,_0x2466b7,_0x3df17a,_0x409563,_0x48ad90)['then'](function(_0x197c31){logger[_0xa9e8('0x27')]('['+[_0x409563[_0xa9e8('0x1a')]()]+_0xa9e8('0x3f'),_0x197c31[_0xa9e8('0x35')]);return _0x197c31;});});}function getCustomFields(_0x2ba662,_0x4e466f,_0x3db8ff){var _0x41af2c={};if(_0x2ba662[_0xa9e8('0x25')]>0x0){_['forEach'](_0x2ba662,function(_0x20b21f){if(_['includes']([_0xa9e8('0x40'),_0xa9e8('0x41')],_0x20b21f[_0xa9e8('0x42')])&&_0x20b21f[_0xa9e8('0x43')]&&!_0x20b21f['customField']){var _0x5d3ece=_0x20b21f[_0xa9e8('0x44')][_0xa9e8('0x2d')]();var _0x2e3274=_0x5d3ece[_0xa9e8('0x33')](0x0,_0x5d3ece[_0xa9e8('0x45')]('_'));var _0x5d7153=_0x5d3ece[_0xa9e8('0x33')](_0x5d3ece[_0xa9e8('0x45')]('_')+0x1);if(_0x2e3274===_0x3db8ff){_0x41af2c[_0x5d7153]=_0x20b21f[_0xa9e8('0x46')];}}});}return _0x41af2c;}function getTicket(_0x4eb9b2,_0x429fc6,_0x34e0c1,_0x24d218,_0x3da0eb,_0x263bc8,_0x3d524f){return new Promise(function(_0x466c73,_0x59421e){var _0x278d80;return getAuthToken(_0x429fc6,_0x34e0c1,_0x3d524f)[_0xa9e8('0x18')](function(_0x3f9baf){if(_0x263bc8['ticketType']===_0xa9e8('0x47')){_0x278d80={'method':_0xa9e8('0x13'),'uri':_0x24d218+_0xa9e8('0x48'),'body':Object[_0xa9e8('0x49')]({},{'title':intUtil[_0xa9e8('0x4a')](_0x263bc8[_0xa9e8('0x4b')],_0x3da0eb,'\x20'),'description':intUtil[_0xa9e8('0x4a')](_0x263bc8['Descriptions'],_0x3da0eb,'\x0a'),'customerid_contact@odata.bind':_0x4eb9b2['enduserId']?_0xa9e8('0x4c')+_0x4eb9b2['enduserId']+')':undefined,'ownerid@odata.bind':_0xa9e8('0x31')+_0x4eb9b2[_0xa9e8('0x2a')]+')','caseorigincode':'1'},getCustomFields(_0x263bc8[_0xa9e8('0x4d')],_0x3da0eb,_0x263bc8[_0xa9e8('0x4e')])),'headers':{'Authorization':_0xa9e8('0x1e')+_0x3f9baf,'OData-Version':_0xa9e8('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x263bc8[_0xa9e8('0x4e')]===_0xa9e8('0x4f')){var _0x3ec902=_0x4eb9b2['enduserId']?[{'partyid_systemuser@odata.bind':_0xa9e8('0x31')+_0x4eb9b2[_0xa9e8('0x2a')]+')','participationtypemask':_0x4eb9b2[_0xa9e8('0x50')]===_0xa9e8('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0xa9e8('0x4c')+_0x4eb9b2[_0xa9e8('0x35')]+')','participationtypemask':_0x4eb9b2[_0xa9e8('0x50')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa9e8('0x31')+_0x4eb9b2['userId']+')','participationtypemask':_0x4eb9b2[_0xa9e8('0x50')]===_0xa9e8('0x51')?0x2:0x1}];_0x278d80={'method':_0xa9e8('0x13'),'uri':_0x24d218+_0xa9e8('0x52'),'body':Object[_0xa9e8('0x49')]({},{'subject':intUtil[_0xa9e8('0x4a')](_0x263bc8[_0xa9e8('0x4b')],_0x3da0eb,'\x20'),'phonenumber':String(_0x3da0eb[_0xa9e8('0x2f')]),'description':intUtil[_0xa9e8('0x4a')](_0x263bc8[_0xa9e8('0x53')],_0x3da0eb,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4eb9b2['enduserId']?_0xa9e8('0x4c')+_0x4eb9b2['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4eb9b2[_0xa9e8('0x2a')]+')','directioncode':_0x4eb9b2[_0xa9e8('0x50')]===_0xa9e8('0x51')?![]:!![],'phonecall_activity_parties':_0x3ec902},getCustomFields(_0x263bc8[_0xa9e8('0x4d')],_0x3da0eb,_0x263bc8[_0xa9e8('0x4e')])),'headers':{'Authorization':_0xa9e8('0x1e')+_0x3f9baf,'OData-Version':_0xa9e8('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x278d80);})['then'](function(_0x18d8fd){var _0xde6192=_0x18d8fd[_0xa9e8('0x54')]['odata-entityid'];var _0x1e9cf0=_0xde6192[_0xa9e8('0x33')](_0xde6192[_0xa9e8('0x34')]('(')+0x1,_0xde6192[_0xa9e8('0x34')](')'));_0x4eb9b2['ticketId']=_0x1e9cf0;_0x466c73(_0x4eb9b2);})['catch'](function(_0x188086){_0x59421e(_0x188086['message']);});});}function emit(_0xe1975f,_0x293cba,_0x30069c,_0x1679b3){var _0x53620b={'uri':util[_0xa9e8('0x55')](_0xa9e8('0x56'),_0xe1975f,_0x30069c,_0x1679b3)};io['to'](util[_0xa9e8('0x55')](_0xa9e8('0x57'),_0x293cba))[_0xa9e8('0x58')](_0xa9e8('0x59'),_0x53620b);}exports['cs']=function(_0x10c3fa,_0x419839,_0x1f3da7,_0x5d7828,_0x920dad,_0x569875,_0x55892e,_0x3f8aca){var _0x3886ff={};_0x569875[_0xa9e8('0xd')]=_0x569875[_0xa9e8('0xc')]?intUtil[_0xa9e8('0x5a')](_0x569875[_0xa9e8('0x10')][_0xa9e8('0xe')]):intUtil[_0xa9e8('0x5a')](_0x569875[_0xa9e8('0xd')]);_0x569875[_0xa9e8('0x5b')]=intUtil[_0xa9e8('0x5a')](_0x569875[_0xa9e8('0x5b')]);_0x3886ff[_0xa9e8('0x50')]=_0x3f8aca===_0xa9e8('0x51')||_0x3f8aca===_0xa9e8('0x5c')?_0xa9e8('0x51'):_0xa9e8('0x2e');var _0x3b3c35=_0x569875['modernAuthentication']?util[_0xa9e8('0x55')](_0xa9e8('0x5d'),_0x569875[_0xa9e8('0x10')][_0xa9e8('0xe')]):util[_0xa9e8('0x55')](_0xa9e8('0x5d'),_0x569875[_0xa9e8('0xd')]);var _0x33e43b=util[_0xa9e8('0x55')](_0xa9e8('0x5e'),_0x569875[_0xa9e8('0xf')]);var _0x191823=util[_0xa9e8('0x55')](_0xa9e8('0x5f'),_0x569875['serverUrl'],_0x419839[_0xa9e8('0x60')],md5(_0x419839[_0xa9e8('0x60')]));if(_0x920dad&&_0x920dad[_0xa9e8('0x61')]){logger['info'](_0xa9e8('0x62'),_0xa9e8('0x63'));_0x419839['recordingURL']=_0x191823;}else if(_0x55892e&&_0x55892e[_0xa9e8('0x64')]&&_0x55892e[_0xa9e8('0x64')]!==_0xa9e8('0x65')){logger[_0xa9e8('0x27')](_0xa9e8('0x66'),_0xa9e8('0x63'));_0x419839['recordingURL']=_0x191823;}else{_0x419839[_0xa9e8('0x67')]='';}return getUser(_0x3886ff,_0x569875,_0x5d7828,_0x33e43b,_0x3b3c35,_0x3f8aca)[_0xa9e8('0x18')](function(_0x440472){logger[_0xa9e8('0x27')]('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x68'),_0x440472[_0xa9e8('0x2a')]);logger['info']('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x69'),_0x440472[_0xa9e8('0x24')]);return getEndUser(_0x440472,_0x569875,_0x33e43b,_0x3b3c35,_0x419839,_0x3f8aca,_0x1f3da7['moduleCreate'],_0x1f3da7['additionalSearchContact']);})['then'](function(_0x46aed2){logger['info']('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x6a'),_0x46aed2[_0xa9e8('0x35')]);logger[_0xa9e8('0x27')]('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x6b'),_0x419839[_0xa9e8('0x2f')]);return getTicket(_0x46aed2,_0x569875,_0x33e43b,_0x3b3c35,_0x419839,_0x1f3da7,_0x3f8aca);})['then'](function(_0x39a281){logger[_0xa9e8('0x27')](util[_0xa9e8('0x55')]('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x6c'),_0x1f3da7[_0xa9e8('0x4e')],_0x39a281['ticketId']));logger[_0xa9e8('0x27')](util['format']('['+_0x3f8aca[_0xa9e8('0x1a')]()+_0xa9e8('0x6d'),_0x3f8aca));if(_0x3f8aca!=='unmanaged'&&_0x1f3da7[_0xa9e8('0x6e')]){logger['info']('['+_0x3f8aca[_0xa9e8('0x1a')]()+']',_0xa9e8('0x6f'));emit(_0x569875['remoteUri'],_0x5d7828[_0xa9e8('0x70')],_0x1f3da7['ticketType'],_0x39a281['ticketId']);}})[_0xa9e8('0x2c')](function(_0x592f94){logger[_0xa9e8('0x19')]('['+_0x3f8aca[_0xa9e8('0x1a')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x592f94['message']);console[_0xa9e8('0x19')](_0xa9e8('0x71'),_0x592f94);});}; \ No newline at end of file +var _0xb5a2=['format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','defaults','redis','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','clientSecret','then','catch','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','internalemailaddress','email','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','message','toLowerCase','outbound','calleridnum','contacts','body','lastIndexOf','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','/systemusers(','callDirection','queue','phonecalls','headers','ticketId'];(function(_0x577ef3,_0x51ec3a){var _0x13b0a1=function(_0x14001a){while(--_0x14001a){_0x577ef3['push'](_0x577ef3['shift']());}};_0x13b0a1(++_0x51ec3a);}(_0xb5a2,0x1de));var _0x2b5a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb5a2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var rp=require(_0x2b5a('0x0'));var util=require(_0x2b5a('0x1'));var intUtil=require('./util');var md5=require(_0x2b5a('0x2'));var Redis=require(_0x2b5a('0x3'));var logger=require('../../../../config/logger')(_0x2b5a('0x4'));var config=require(_0x2b5a('0x5'));config['redis']=_[_0x2b5a('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2b5a('0x7')]));function getAuthToken(_0x2dd0ff,_0xffc174,_0x5ee4f8){if(_0x2dd0ff['modernAuthentication']){_0x2dd0ff[_0x2b5a('0x8')]=_0x2dd0ff[_0x2b5a('0x9')][_0x2b5a('0xa')];_0x2dd0ff[_0x2b5a('0xb')]=_0x2dd0ff[_0x2b5a('0x9')]['data2'];return Promise[_0x2b5a('0xc')](_0x2dd0ff[_0x2b5a('0x9')][_0x2b5a('0xd')]);}var _0x1e1076={'method':_0x2b5a('0xe'),'uri':_0xffc174,'form':{'client_id':_0x2dd0ff[_0x2b5a('0xf')],'resource':_0x2dd0ff[_0x2b5a('0x8')],'username':_0x2dd0ff[_0x2b5a('0x10')],'password':_0x2dd0ff[_0x2b5a('0x11')],'grant_type':_0x2b5a('0x11'),'client_secret':_0x2dd0ff[_0x2b5a('0x12')]},'json':!![]};return rp(_0x1e1076)[_0x2b5a('0x13')](function(_0x485a96){return _0x485a96['access_token'];})[_0x2b5a('0x14')](function(_0x40d20d){logger['error']('['+[_0x5ee4f8[_0x2b5a('0x15')]()]+_0x2b5a('0x16'));return _0x40d20d['message'];});}function getUser(_0x4cec57,_0x1dc485,_0x289a16,_0x11eace,_0xaa5fa6,_0x145cc4){return new Promise(function(_0x56cb51,_0x3d4340){return getAuthToken(_0x1dc485,_0x11eace,_0x145cc4)[_0x2b5a('0x13')](function(_0x2873a8){var _0x477619={'method':_0x2b5a('0x17'),'uri':_0xaa5fa6+_0x2b5a('0x18'),'headers':{'Authorization':_0x2b5a('0x19')+_0x2873a8,'OData-Version':_0x2b5a('0x1a')},'json':!![]};return rp(_0x477619);})[_0x2b5a('0x13')](function(_0x557dd3){var _0x5379a8=_0x557dd3[_0x2b5a('0x1b')];var _0x5034e3=![];var _0x4ad3b6=null;if(!_[_0x2b5a('0x1c')](_0x289a16)){if(intUtil[_0x2b5a('0x1d')](_0x289a16['email'])){_0x4cec57[_0x2b5a('0x1e')]=_0x289a16['email'];for(_0x4ad3b6=0x0;_0x4ad3b6<_0x5379a8['length'];_0x4ad3b6++){if(_0x5379a8[_0x4ad3b6][_0x2b5a('0x1f')]===_0x289a16[_0x2b5a('0x20')]&&!_0x5379a8[_0x4ad3b6][_0x2b5a('0x21')]){_0x5034e3=!![];logger[_0x2b5a('0x22')]('['+[_0x145cc4[_0x2b5a('0x15')]()]+']\x20Agent\x20found\x20'+_0x5379a8[_0x4ad3b6][_0x2b5a('0x23')]+'!');_0x4cec57[_0x2b5a('0x24')]=_0x5379a8[_0x4ad3b6][_0x2b5a('0x23')];}}}}if(!_0x5034e3){logger[_0x2b5a('0x22')]('['+[_0x145cc4['toUpperCase']()]+_0x2b5a('0x25'));_0x4cec57[_0x2b5a('0x1e')]=_0x1dc485[_0x2b5a('0x10')];for(_0x4ad3b6=0x0;_0x4ad3b6<_0x5379a8[_0x2b5a('0x26')];_0x4ad3b6++){if(_0x5379a8[_0x4ad3b6][_0x2b5a('0x1f')]===_0x1dc485[_0x2b5a('0x10')]){_0x4cec57['userId']=_0x5379a8[_0x4ad3b6][_0x2b5a('0x23')];}}}_0x56cb51(_0x4cec57);})[_0x2b5a('0x14')](function(_0x2956ae){_0x3d4340(_0x2956ae[_0x2b5a('0x27')]);});});}function createEndUser(_0x501bb4,_0x4f8476,_0x38600a,_0x8a1326,_0x327764,_0x4791a3,_0x29a380){return new Promise(function(_0x6062e9,_0x62590e){return getAuthToken(_0x4f8476,_0x38600a,_0x4791a3)[_0x2b5a('0x13')](function(_0x3ca304){var _0x33767e=_0x4791a3[_0x2b5a('0x28')]()===_0x2b5a('0x29')?_0x327764['destcalleridnum']:_0x327764[_0x2b5a('0x2a')];var _0x32c661={'method':_0x2b5a('0xe'),'uri':_0x8a1326+_0x2b5a('0x2b'),'body':{'fullname':_0x33767e,'firstname':_0x33767e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x501bb4[_0x2b5a('0x24')]+')'},'headers':{'Authorization':_0x2b5a('0x19')+_0x3ca304,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x32c661[_0x2b5a('0x2c')][_0x29a380]=_0x33767e;return rp(_0x32c661);})[_0x2b5a('0x13')](function(_0xc1c59b){var _0x34c83d=_0xc1c59b['headers']['odata-entityid'];var _0x34fcac=_0x34c83d['substring'](_0x34c83d['lastIndexOf']('(')+0x1,_0x34c83d[_0x2b5a('0x2d')](')'));_0x501bb4['enduserId']=_0x34fcac;_0x6062e9(_0x501bb4);})[_0x2b5a('0x14')](function(_0x5c7de1){_0x62590e(_0x5c7de1[_0x2b5a('0x27')]);});});}function getEndUser(_0x454c98,_0x5c4f91,_0x5ba582,_0x2b0b1c,_0xbdfee1,_0x1e62f5,_0x5b615d,_0x6cb88d){var _0x1e320c=_0x1e62f5['toLowerCase']()===_0x2b5a('0x29')?_0xbdfee1['destcalleridnum']:_0xbdfee1[_0x2b5a('0x2a')];return getAuthToken(_0x5c4f91,_0x5ba582,_0x1e62f5)[_0x2b5a('0x13')](function(_0x2bb484){_0x6cb88d=_0x6cb88d?_0x6cb88d:_0x2b5a('0x2e');var _0x199450={'method':_0x2b5a('0x17'),'uri':_0x2b0b1c+_0x2b5a('0x2f')+_0x6cb88d+_0x2b5a('0x30')+_0x6cb88d+_0x2b5a('0x31')+_0x1e320c[_0x2b5a('0x32')]('+',_0x2b5a('0x33'))+'\x27','headers':{'Authorization':_0x2b5a('0x19')+_0x2bb484,'If-None-Match':null,'OData-Version':_0x2b5a('0x1a')},'json':!![]};return rp(_0x199450);})[_0x2b5a('0x13')](function(_0x397628){var _0x4a38a0=![];if(!_0x397628)return _0x4a38a0;var _0x5a9fe8=_0x397628[_0x2b5a('0x1b')];for(var _0x32a641=0x0;_0x32a641<_0x5a9fe8[_0x2b5a('0x26')];_0x32a641++){if(_0x5a9fe8[_0x32a641][_0x6cb88d]===_0x1e320c){_0x4a38a0=!![];_0x454c98[_0x2b5a('0x34')]=_0x5a9fe8[_0x32a641]['contactid'];}}return _0x4a38a0;})[_0x2b5a('0x13')](function(_0x3dd5a2){if(_0x3dd5a2)return _0x454c98;if(_0x5b615d===_0x2b5a('0x35')){logger[_0x2b5a('0x22')]('['+[_0x1e62f5['toUpperCase']()]+_0x2b5a('0x36'));return _0x454c98;}return createEndUser(_0x454c98,_0x5c4f91,_0x5ba582,_0x2b0b1c,_0xbdfee1,_0x1e62f5,_0x6cb88d)[_0x2b5a('0x13')](function(_0x5b3e42){logger[_0x2b5a('0x22')]('['+[_0x1e62f5[_0x2b5a('0x15')]()]+_0x2b5a('0x37'),_0x5b3e42[_0x2b5a('0x34')]);return _0x5b3e42;});});}function getCustomFields(_0x1e909,_0xf1a40a,_0x927c0){var _0x9ac11={};if(_0x1e909['length']>0x0){_[_0x2b5a('0x38')](_0x1e909,function(_0x1f8177){if(_[_0x2b5a('0x39')](['string',_0x2b5a('0x3a')],_0x1f8177[_0x2b5a('0x3b')])&&_0x1f8177[_0x2b5a('0x3c')]&&!_0x1f8177[_0x2b5a('0x3d')]){var _0x56cc7c=_0x1f8177[_0x2b5a('0x3e')][_0x2b5a('0x28')]();var _0xb936b8=_0x56cc7c[_0x2b5a('0x3f')](0x0,_0x56cc7c[_0x2b5a('0x40')]('_'));var _0x53369a=_0x56cc7c[_0x2b5a('0x3f')](_0x56cc7c[_0x2b5a('0x40')]('_')+0x1);if(_0xb936b8===_0x927c0){_0x9ac11[_0x53369a]=_0x1f8177[_0x2b5a('0x41')];}}});}return _0x9ac11;}function getTicket(_0x58f6b7,_0x347383,_0x3e7027,_0x17027f,_0x34fb6d,_0x2e5611,_0x403d7d){return new Promise(function(_0x17ccd0,_0x305f47){var _0x41f70c;return getAuthToken(_0x347383,_0x3e7027,_0x403d7d)[_0x2b5a('0x13')](function(_0x215dbc){if(_0x2e5611[_0x2b5a('0x42')]===_0x2b5a('0x43')){_0x41f70c={'method':'POST','uri':_0x17027f+_0x2b5a('0x44'),'body':Object[_0x2b5a('0x45')]({},{'title':intUtil[_0x2b5a('0x46')](_0x2e5611[_0x2b5a('0x47')],_0x34fb6d,'\x20'),'description':intUtil[_0x2b5a('0x46')](_0x2e5611[_0x2b5a('0x48')],_0x34fb6d,'\x0a'),'customerid_contact@odata.bind':_0x58f6b7['enduserId']?_0x2b5a('0x49')+_0x58f6b7['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x58f6b7[_0x2b5a('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2e5611[_0x2b5a('0x4a')],_0x34fb6d,_0x2e5611[_0x2b5a('0x42')])),'headers':{'Authorization':_0x2b5a('0x19')+_0x215dbc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2e5611[_0x2b5a('0x42')]===_0x2b5a('0x4b')){var _0x3e815c=_0x58f6b7['enduserId']?[{'partyid_systemuser@odata.bind':_0x2b5a('0x4c')+_0x58f6b7['userId']+')','participationtypemask':_0x58f6b7[_0x2b5a('0x4d')]===_0x2b5a('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x2b5a('0x49')+_0x58f6b7[_0x2b5a('0x34')]+')','participationtypemask':_0x58f6b7['callDirection']===_0x2b5a('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2b5a('0x4c')+_0x58f6b7[_0x2b5a('0x24')]+')','participationtypemask':_0x58f6b7[_0x2b5a('0x4d')]===_0x2b5a('0x4e')?0x2:0x1}];_0x41f70c={'method':_0x2b5a('0xe'),'uri':_0x17027f+_0x2b5a('0x4f'),'body':Object[_0x2b5a('0x45')]({},{'subject':intUtil['getString'](_0x2e5611[_0x2b5a('0x47')],_0x34fb6d,'\x20'),'phonenumber':String(_0x34fb6d['calleridnum']),'description':intUtil[_0x2b5a('0x46')](_0x2e5611[_0x2b5a('0x48')],_0x34fb6d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x58f6b7[_0x2b5a('0x34')]?'/contacts('+_0x58f6b7[_0x2b5a('0x34')]+')':undefined,'ownerid@odata.bind':_0x2b5a('0x4c')+_0x58f6b7[_0x2b5a('0x24')]+')','directioncode':_0x58f6b7[_0x2b5a('0x4d')]===_0x2b5a('0x4e')?![]:!![],'phonecall_activity_parties':_0x3e815c},getCustomFields(_0x2e5611['Fields'],_0x34fb6d,_0x2e5611['ticketType'])),'headers':{'Authorization':_0x2b5a('0x19')+_0x215dbc,'OData-Version':_0x2b5a('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x41f70c);})[_0x2b5a('0x13')](function(_0x44492c){var _0x25515e=_0x44492c[_0x2b5a('0x50')]['odata-entityid'];var _0x3235d7=_0x25515e[_0x2b5a('0x3f')](_0x25515e['lastIndexOf']('(')+0x1,_0x25515e[_0x2b5a('0x2d')](')'));_0x58f6b7[_0x2b5a('0x51')]=_0x3235d7;_0x17ccd0(_0x58f6b7);})[_0x2b5a('0x14')](function(_0xd27e6f){_0x305f47(_0xd27e6f[_0x2b5a('0x27')]);});});}function emit(_0x2dc6b7,_0x279984,_0x4c15f7,_0x126cd0){var _0x4a6d6d={'uri':util[_0x2b5a('0x52')](_0x2b5a('0x53'),_0x2dc6b7,_0x4c15f7,_0x126cd0)};io['to'](util[_0x2b5a('0x52')](_0x2b5a('0x54'),_0x279984))[_0x2b5a('0x55')](_0x2b5a('0x56'),_0x4a6d6d);}exports['cs']=function(_0x44b140,_0x22553c,_0x4bc640,_0x136ece,_0x20bef4,_0x3cd4c1,_0x35714c,_0x539f3c){var _0x3e7be4={};_0x3cd4c1[_0x2b5a('0x8')]=_0x3cd4c1[_0x2b5a('0x57')]?intUtil[_0x2b5a('0x58')](_0x3cd4c1[_0x2b5a('0x9')]['data7']):intUtil[_0x2b5a('0x58')](_0x3cd4c1[_0x2b5a('0x8')]);_0x3cd4c1[_0x2b5a('0x59')]=intUtil[_0x2b5a('0x58')](_0x3cd4c1[_0x2b5a('0x59')]);_0x3e7be4[_0x2b5a('0x4d')]=_0x539f3c==='queue'||_0x539f3c==='unmanaged'?'queue':'outbound';var _0x205718=_0x3cd4c1['modernAuthentication']?util[_0x2b5a('0x52')](_0x2b5a('0x5a'),_0x3cd4c1[_0x2b5a('0x9')][_0x2b5a('0xa')]):util[_0x2b5a('0x52')](_0x2b5a('0x5a'),_0x3cd4c1[_0x2b5a('0x8')]);var _0x1f4995=util['format'](_0x2b5a('0x5b'),_0x3cd4c1[_0x2b5a('0xb')]);var _0x5c70ca=util[_0x2b5a('0x52')](_0x2b5a('0x5c'),_0x3cd4c1[_0x2b5a('0x59')],_0x22553c[_0x2b5a('0x5d')],md5(_0x22553c[_0x2b5a('0x5d')]));if(_0x20bef4&&_0x20bef4[_0x2b5a('0x5e')]){logger[_0x2b5a('0x22')](_0x2b5a('0x5f'),_0x2b5a('0x60'));_0x22553c[_0x2b5a('0x61')]=_0x5c70ca;}else if(_0x35714c&&_0x35714c[_0x2b5a('0x62')]&&_0x35714c[_0x2b5a('0x62')]!==_0x2b5a('0x63')){logger[_0x2b5a('0x22')](_0x2b5a('0x64'),'Recording\x20is\x20enabled!');_0x22553c[_0x2b5a('0x61')]=_0x5c70ca;}else{_0x22553c[_0x2b5a('0x61')]='';}return getUser(_0x3e7be4,_0x3cd4c1,_0x136ece,_0x1f4995,_0x205718,_0x539f3c)['then'](function(_0xaed42d){logger['info']('['+_0x539f3c[_0x2b5a('0x15')]()+']\x20The\x20User\x20ID\x20is:',_0xaed42d['userId']);logger['info']('['+_0x539f3c[_0x2b5a('0x15')]()+_0x2b5a('0x65'),_0xaed42d[_0x2b5a('0x1e')]);return getEndUser(_0xaed42d,_0x3cd4c1,_0x1f4995,_0x205718,_0x22553c,_0x539f3c,_0x4bc640[_0x2b5a('0x66')],_0x4bc640[_0x2b5a('0x67')]);})[_0x2b5a('0x13')](function(_0x539795){logger[_0x2b5a('0x22')]('['+_0x539f3c[_0x2b5a('0x15')]()+_0x2b5a('0x68'),_0x539795['enduserId']);logger['info']('['+_0x539f3c[_0x2b5a('0x15')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x22553c[_0x2b5a('0x2a')]);return getTicket(_0x539795,_0x3cd4c1,_0x1f4995,_0x205718,_0x22553c,_0x4bc640,_0x539f3c);})[_0x2b5a('0x13')](function(_0x110a53){logger[_0x2b5a('0x22')](util[_0x2b5a('0x52')]('['+_0x539f3c['toUpperCase']()+_0x2b5a('0x69'),_0x4bc640[_0x2b5a('0x42')],_0x110a53[_0x2b5a('0x51')]));logger[_0x2b5a('0x22')](util[_0x2b5a('0x52')]('['+_0x539f3c[_0x2b5a('0x15')]()+_0x2b5a('0x6a'),_0x539f3c));if(_0x539f3c!=='unmanaged'&&_0x4bc640[_0x2b5a('0x6b')]){logger[_0x2b5a('0x22')]('['+_0x539f3c[_0x2b5a('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3cd4c1[_0x2b5a('0x8')],_0x136ece[_0x2b5a('0x6c')],_0x4bc640['ticketType'],_0x110a53['ticketId']);}})[_0x2b5a('0x14')](function(_0x5d529f){logger['error']('['+_0x539f3c['toUpperCase']()+_0x2b5a('0x6d'),_0x5d529f[_0x2b5a('0x27')]);console[_0x2b5a('0x6e')](_0x2b5a('0x6f'),_0x5d529f);});}; \ 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 57e4f78..26a2b81 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 _0x948f=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','Creating\x20new\x20ticket...','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%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','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','defaults','includes','string','picklist','type','customField','toLowerCase','content','idField','variable','variableName','push','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','md5','util'];(function(_0x3a9ac4,_0x5b806a){var _0x329be4=function(_0x1c18aa){while(--_0x1c18aa){_0x3a9ac4['push'](_0x3a9ac4['shift']());}};_0x329be4(++_0x5b806a);}(_0x948f,0x164));var _0xf948=function(_0x22ae56,_0x16955c){_0x22ae56=_0x22ae56-0x0;var _0x1544f5=_0x948f[_0x22ae56];return _0x1544f5;};'use strict';var _=require(_0xf948('0x0'));var rp=require(_0xf948('0x1'));var md5=require(_0xf948('0x2'));var util=require(_0xf948('0x3'));var Redis=require('ioredis');var intUtil=require(_0xf948('0x4'));var config=require(_0xf948('0x5'));var logger=require(_0xf948('0x6'))(_0xf948('0x7'));config[_0xf948('0x8')]=_['defaults'](config[_0xf948('0x8')],{'host':_0xf948('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf948('0x8')]));var headers={'Content-Type':_0xf948('0xa'),'Accept':'application/json'};function emit(_0x4f6835,_0x369b75,_0x65abf5){io['to'](_0x4f6835)['emit'](_0x369b75,_0x65abf5);}function getTicket(_0x5d6a82,_0x2c23e3,_0x3ec71b,_0x13d640,_0x16c2dc){logger['info'](_0xf948('0xb'));var _0x26b1f2=_['merge']({'responder_id':_0x2c23e3['id'],'requester_id':_0x3ec71b['id'],'name':util['format']('Caller\x20-\x20%s',_0x16c2dc['calleridname']),'phone':_0x16c2dc[_0xf948('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf948('0xd')](_0x13d640[_0xf948('0xe')],_0x16c2dc,'\x20'),'description':intUtil[_0xf948('0xd')](_0x13d640[_0xf948('0xf')],_0x16c2dc,_0xf948('0x10')),'tags':getTags(_0x13d640[_0xf948('0x11')],_0xf948('0x12'))},getCustomFields(_0x13d640[_0xf948('0x13')],_0x16c2dc));_0x26b1f2[_0xf948('0x14')]=_[_0xf948('0x15')](_[_0xf948('0x16')](_0x26b1f2[_0xf948('0x14')],'id'),_0xf948('0x17'));return request({'uri':util[_0xf948('0x18')](_0xf948('0x19'),_0x5d6a82['remoteUri']),'method':_0xf948('0x1a'),'body':_0x26b1f2})[_0xf948('0x1b')](function(_0x1d4fde){logger[_0xf948('0x1c')](_0xf948('0x1d'));return _0x1d4fde;});}function getUser(_0x25ad43,_0x4cb34a){if(intUtil['validateEmail'](_0x4cb34a)){return request({'uri':util[_0xf948('0x18')](_0xf948('0x1e'),_0x25ad43[_0xf948('0x1f')]),'qs':{'email':_0x4cb34a}})[_0xf948('0x1b')](function(_0x33df51){if(_0x33df51[_0xf948('0x20')]){logger[_0xf948('0x1c')](_0xf948('0x21'));return _[_0xf948('0x22')](_0x33df51,function(_0x426e63){return _0x426e63[_0xf948('0x23')][_0xf948('0x24')]===_0x4cb34a;});}else{logger[_0xf948('0x1c')](_0xf948('0x25'));return request({'uri':util[_0xf948('0x18')](_0xf948('0x26'),_0x25ad43[_0xf948('0x1f')])})[_0xf948('0x1b')](function(_0x24f4b3){logger[_0xf948('0x1c')]('Admin\x20account\x20selected.');return _0x24f4b3;});}});}else{logger['info'](_0xf948('0x27'));return request({'uri':util['format'](_0xf948('0x26'),_0x25ad43[_0xf948('0x1f')])})[_0xf948('0x1b')](function(_0x4382e8){logger['info'](_0xf948('0x28'));return _0x4382e8;});}}function getEndUser(_0x321a78,_0x5e3bb4,_0x2954ad){logger[_0xf948('0x1c')](_0xf948('0x29'),_0x2954ad);return request({'uri':util[_0xf948('0x18')](_0xf948('0x2a'),_0x321a78['remoteUri']),'qs':{'phone':_0x2954ad}})[_0xf948('0x1b')](function(_0x124ae6){if(_0x124ae6[_0xf948('0x20')]){logger[_0xf948('0x1c')](_0xf948('0x2b'));return _[_0xf948('0x22')](_0x124ae6,{'phone':_0x2954ad});}else{logger['info'](_0xf948('0x2c'));return request({'uri':util[_0xf948('0x18')]('%s/api/v2/contacts',_0x321a78[_0xf948('0x1f')]),'method':_0xf948('0x1a'),'body':{'name':_0x5e3bb4,'phone':_0x2954ad}})['then'](function(_0xf3cd71){logger[_0xf948('0x1c')](_0xf948('0x2d'));return _0xf3cd71;});}});}function getAuth(_0x31259e){return util[_0xf948('0x18')](_0xf948('0x2e'),new Buffer(_0x31259e[_0xf948('0x2f')]+':X')[_0xf948('0x30')](_0xf948('0x31')));}function request(_0x54fb72){logger['debug'](_0xf948('0x32'),JSON[_0xf948('0x33')](_0x54fb72));return rp(_[_0xf948('0x34')](_0x54fb72,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2eaa3c,_0x5604e7){var _0x52d678=[];if(_0x2eaa3c&&_0x2eaa3c[_0xf948('0x20')]>0x0){_0x52d678=_['map'](_0x2eaa3c,_0x5604e7);}return _0x52d678;}function getCustomFields(_0x3a36cf,_0x49aa40){var _0x1d9f8d=[];var _0x25ae75={'custom_fields':[]};if(_0x3a36cf[_0xf948('0x20')]>0x0){_['forEach'](_0x3a36cf,function(_0x1f85d6){if(_[_0xf948('0x35')]([_0xf948('0x36'),_0xf948('0x37')],_0x1f85d6[_0xf948('0x38')])&&_0x1f85d6['nameField']&&!_0x1f85d6[_0xf948('0x39')]){_0x25ae75[_0x1f85d6['nameField'][_0xf948('0x3a')]()]=_0x1f85d6[_0xf948('0x3b')][_0xf948('0x30')]();}else if(_[_0xf948('0x35')]([_0xf948('0x36'),_0xf948('0x37')],_0x1f85d6[_0xf948('0x38')])&&_0x1f85d6[_0xf948('0x3c')]&&_0x1f85d6[_0xf948('0x39')]){_0x25ae75[_0xf948('0x14')]['push']({'id':_0x1f85d6[_0xf948('0x3c')],'value':_0x1f85d6['content'][_0xf948('0x30')]()});}else if(_0x1f85d6[_0xf948('0x38')]===_0xf948('0x3d')&&_0x1f85d6[_0xf948('0x3e')]&&_0x1f85d6['idField']&&_0x1f85d6[_0xf948('0x39')]){_0x49aa40[_0x1f85d6[_0xf948('0x3e')]]&&_0x25ae75[_0xf948('0x14')][_0xf948('0x3f')]({'id':_0x1f85d6[_0xf948('0x3c')],'value':_0x49aa40[_0x1f85d6[_0xf948('0x3e')]]['toString']()});}else if(_0x1f85d6[_0xf948('0x38')]==='customVariable'&&_0x1f85d6[_0xf948('0x40')]&&_0x1f85d6[_0xf948('0x40')][_0xf948('0x12')]&&_0x1f85d6[_0xf948('0x3c')]&&_0x1f85d6['customField']){_0x49aa40[_0x1f85d6['Variable']['name'][_0xf948('0x3a')]()]&&_0x25ae75[_0xf948('0x14')][_0xf948('0x3f')]({'id':_0x1f85d6[_0xf948('0x3c')],'value':_0x49aa40[_0x1f85d6[_0xf948('0x40')][_0xf948('0x12')][_0xf948('0x3a')]()]['toString']()});}});}return _0x25ae75;}exports['queue']=function(_0x7ce050,_0x3a40b5,_0x23ec38,_0x2e9793,_0x29540e,_0x15a0f9){var _0x30ac4c,_0x4c8196;_0x15a0f9[_0xf948('0x1f')]=intUtil[_0xf948('0x41')](_0x15a0f9[_0xf948('0x1f')]);_0x15a0f9[_0xf948('0x42')]=intUtil[_0xf948('0x41')](_0x15a0f9[_0xf948('0x42')]);if(_0x29540e&&_0x29540e[_0xf948('0x43')]){logger[_0xf948('0x1c')](_0xf948('0x44'),_0xf948('0x45'));_0x3a40b5['recordingURL']=util[_0xf948('0x18')](_0xf948('0x46'),_0x15a0f9[_0xf948('0x42')],_0x3a40b5[_0xf948('0x47')],md5(_0x3a40b5['uniqueid']));}else{_0x3a40b5[_0xf948('0x48')]='';}headers[_0xf948('0x49')]=getAuth(_0x15a0f9);return getUser(_0x15a0f9,_0x2e9793['email'])[_0xf948('0x1b')](function(_0xcba514){_0x30ac4c=_0xcba514;logger[_0xf948('0x1c')](_0xf948('0x4a'),_0x30ac4c['id']);return getEndUser(_0x15a0f9,_0x3a40b5['calleridname'],_0x3a40b5[_0xf948('0xc')]);})['then'](function(_0x4ac24b){_0x4c8196=_0x4ac24b;logger[_0xf948('0x1c')](_0xf948('0x4b'),_0x4c8196['id']);return getTicket(_0x15a0f9,_0x30ac4c,_0x4c8196,_0x23ec38,_0x3a40b5);})[_0xf948('0x1b')](function(_0x517f2c){if(_0x517f2c&&_0x517f2c['id']){logger[_0xf948('0x1c')]('Ticket\x20created!');logger[_0xf948('0x1c')](_0xf948('0x4c'),_0x517f2c['id']);logger[_0xf948('0x1c')](_0xf948('0x44'),_0xf948('0x4d'));emit(util[_0xf948('0x18')](_0xf948('0x4e'),_0x2e9793[_0xf948('0x12')]),'trigger:browser:url',{'uri':util[_0xf948('0x18')](_0xf948('0x4f'),_0x15a0f9[_0xf948('0x1f')],_0x517f2c['id'])});}})[_0xf948('0x50')](function(_0x3b3274){logger[_0xf948('0x51')](_0xf948('0x44'),JSON[_0xf948('0x33')](_0x3b3274));});};exports['outbound']=function(_0x404aeb,_0x50ea39,_0x35c42c,_0x2d6d84,_0x2f7beb,_0x137b43,_0x39823a){var _0xf2a35d,_0x479789;_0x137b43[_0xf948('0x1f')]=intUtil[_0xf948('0x41')](_0x137b43[_0xf948('0x1f')]);_0x137b43['serverUrl']=intUtil[_0xf948('0x41')](_0x137b43['serverUrl']);if(_0x39823a&&_0x39823a[_0xf948('0x52')]&&_0x39823a[_0xf948('0x52')]!=='none'){logger[_0xf948('0x1c')](_0xf948('0x53'),'Recording\x20is\x20enabled!');_0x50ea39[_0xf948('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x137b43['serverUrl'],_0x50ea39['uniqueid'],md5(_0x50ea39[_0xf948('0x47')]));}headers[_0xf948('0x49')]=getAuth(_0x137b43);return getUser(_0x137b43,_0x2d6d84[_0xf948('0x24')])['then'](function(_0x2fb71d){_0xf2a35d=_0x2fb71d;logger[_0xf948('0x1c')]('The\x20User\x20ID\x20is:',_0xf2a35d['id']);return getEndUser(_0x137b43,_0x50ea39[_0xf948('0x54')],_0x50ea39['destcalleridnum']);})[_0xf948('0x1b')](function(_0x47e4eb){_0x479789=_0x47e4eb;logger['info'](_0xf948('0x4b'),_0x479789['id']);return getTicket(_0x137b43,_0xf2a35d,_0x479789,_0x35c42c,_0x50ea39);})[_0xf948('0x1b')](function(_0x1ceb97){if(_0x1ceb97&&_0x1ceb97['id']){logger[_0xf948('0x1c')](_0xf948('0x1d'));logger['info'](_0xf948('0x4c'),_0x1ceb97['id']);logger[_0xf948('0x1c')](_0xf948('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf948('0x4e'),_0x2d6d84[_0xf948('0x12')]),_0xf948('0x55'),{'uri':util[_0xf948('0x18')](_0xf948('0x4f'),_0x137b43[_0xf948('0x1f')],_0x1ceb97['id'])});}})[_0xf948('0x50')](function(_0x2d353b){logger['error'](_0xf948('0x53'),JSON[_0xf948('0x33')](_0x2d353b));});};exports[_0xf948('0x56')]=function(_0x2e7034,_0x2ae9df,_0x280400,_0xfb37e5,_0x30058a,_0x42c6fe){var _0x11efd2,_0x135c97;_0x42c6fe['remoteUri']=intUtil[_0xf948('0x41')](_0x42c6fe[_0xf948('0x1f')]);_0x42c6fe[_0xf948('0x42')]=intUtil[_0xf948('0x41')](_0x42c6fe[_0xf948('0x42')]);if(_0x30058a&&_0x30058a[_0xf948('0x43')]){logger[_0xf948('0x1c')]('['+_0x2ae9df[_0xf948('0x57')][_0xf948('0x58')]()+']',_0xf948('0x45'));_0x2ae9df[_0xf948('0x48')]=util[_0xf948('0x18')](_0xf948('0x46'),_0x42c6fe[_0xf948('0x42')],_0x2ae9df[_0xf948('0x47')],md5(_0x2ae9df[_0xf948('0x47')]));}else{_0x2ae9df['recordingURL']='';}headers[_0xf948('0x49')]=getAuth(_0x42c6fe);return getUser(_0x42c6fe,'')[_0xf948('0x1b')](function(_0x4ca587){_0x11efd2=_0x4ca587;logger[_0xf948('0x1c')]('The\x20User\x20ID\x20is:',_0x11efd2['id']);return getEndUser(_0x42c6fe,_0x2ae9df[_0xf948('0x59')],_0x2ae9df[_0xf948('0xc')]);})['then'](function(_0x143235){_0x135c97=_0x143235;logger[_0xf948('0x1c')](_0xf948('0x4b'),_0x135c97['id']);return getTicket(_0x42c6fe,_0x11efd2,_0x135c97,_0x280400,_0x2ae9df);})[_0xf948('0x1b')](function(_0x523374){if(_0x523374){logger['info'](_0xf948('0x1d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x523374['id']);}})[_0xf948('0x50')](function(_0xc8b94b){logger[_0xf948('0x51')]('['+_0x2ae9df[_0xf948('0x57')][_0xf948('0x58')]()+']',JSON['stringify'](_0xc8b94b));});}; \ No newline at end of file +var _0xd5fc=['uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','md5','./util','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','apiKey','[HTTP]','stringify','GET','map','forEach','includes','nameField','customField','toLowerCase','content','toString','picklist','type','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL'];(function(_0xbc955e,_0x1dfc4f){var _0x23e61c=function(_0x3ce237){while(--_0x3ce237){_0xbc955e['push'](_0xbc955e['shift']());}};_0x23e61c(++_0x1dfc4f);}(_0xd5fc,0x1e2));var _0xcd5f=function(_0x3e384f,_0x3190c4){_0x3e384f=_0x3e384f-0x0;var _0x2512c5=_0xd5fc[_0x3e384f];return _0x2512c5;};'use strict';var _=require(_0xcd5f('0x0'));var rp=require('request-promise');var md5=require(_0xcd5f('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xcd5f('0x2'));var config=require('../../../../config/environment');var logger=require(_0xcd5f('0x3'))(_0xcd5f('0x4'));config['redis']=_[_0xcd5f('0x5')](config[_0xcd5f('0x6')],{'host':_0xcd5f('0x7'),'port':0x18eb});var io=require(_0xcd5f('0x8'))(new Redis(config[_0xcd5f('0x6')]));var headers={'Content-Type':_0xcd5f('0x9'),'Accept':_0xcd5f('0x9')};function emit(_0x4cffa1,_0x545053,_0x5ab75d){io['to'](_0x4cffa1)['emit'](_0x545053,_0x5ab75d);}function getTicket(_0x1abceb,_0xa970f3,_0x40c471,_0x466ce3,_0x1ba0c5){logger[_0xcd5f('0xa')]('Creating\x20new\x20ticket...');var _0x4bdf79=_[_0xcd5f('0xb')]({'responder_id':_0xa970f3['id'],'requester_id':_0x40c471['id'],'name':util['format'](_0xcd5f('0xc'),_0x1ba0c5[_0xcd5f('0xd')]),'phone':_0x1ba0c5[_0xcd5f('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcd5f('0xf')](_0x466ce3[_0xcd5f('0x10')],_0x1ba0c5,'\x20'),'description':intUtil[_0xcd5f('0xf')](_0x466ce3[_0xcd5f('0x11')],_0x1ba0c5,_0xcd5f('0x12')),'tags':getTags(_0x466ce3[_0xcd5f('0x13')],_0xcd5f('0x14'))},getCustomFields(_0x466ce3[_0xcd5f('0x15')],_0x1ba0c5));_0x4bdf79['custom_fields']=_[_0xcd5f('0x16')](_[_0xcd5f('0x17')](_0x4bdf79[_0xcd5f('0x18')],'id'),_0xcd5f('0x19'));return request({'uri':util['format'](_0xcd5f('0x1a'),_0x1abceb[_0xcd5f('0x1b')]),'method':'POST','body':_0x4bdf79})[_0xcd5f('0x1c')](function(_0x5831de){logger['info'](_0xcd5f('0x1d'));return _0x5831de;});}function getUser(_0x105865,_0x2a4c47){if(intUtil[_0xcd5f('0x1e')](_0x2a4c47)){return request({'uri':util['format']('%s/api/v2/agents',_0x105865[_0xcd5f('0x1b')]),'qs':{'email':_0x2a4c47}})[_0xcd5f('0x1c')](function(_0x5479ec){if(_0x5479ec[_0xcd5f('0x1f')]){logger['info'](_0xcd5f('0x20'));return _[_0xcd5f('0x21')](_0x5479ec,function(_0x26ffbe){return _0x26ffbe[_0xcd5f('0x22')][_0xcd5f('0x23')]===_0x2a4c47;});}else{logger[_0xcd5f('0xa')](_0xcd5f('0x24'));return request({'uri':util[_0xcd5f('0x25')](_0xcd5f('0x26'),_0x105865[_0xcd5f('0x1b')])})[_0xcd5f('0x1c')](function(_0x45b85a){logger[_0xcd5f('0xa')]('Admin\x20account\x20selected.');return _0x45b85a;});}});}else{logger[_0xcd5f('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xcd5f('0x26'),_0x105865[_0xcd5f('0x1b')])})[_0xcd5f('0x1c')](function(_0x3c9ff0){logger['info'](_0xcd5f('0x27'));return _0x3c9ff0;});}}function getEndUser(_0x5a04ec,_0x4ab31f,_0x47ffdc){logger[_0xcd5f('0xa')](_0xcd5f('0x28'),_0x47ffdc);return request({'uri':util[_0xcd5f('0x25')]('%s/api/v2/contacts',_0x5a04ec['remoteUri']),'qs':{'phone':_0x47ffdc}})[_0xcd5f('0x1c')](function(_0x100b6e){if(_0x100b6e['length']){logger[_0xcd5f('0xa')]('Enduser\x20found!');return _['find'](_0x100b6e,{'phone':_0x47ffdc});}else{logger[_0xcd5f('0xa')](_0xcd5f('0x29'));return request({'uri':util[_0xcd5f('0x25')]('%s/api/v2/contacts',_0x5a04ec[_0xcd5f('0x1b')]),'method':_0xcd5f('0x2a'),'body':{'name':_0x4ab31f,'phone':_0x47ffdc}})[_0xcd5f('0x1c')](function(_0x2c5678){logger[_0xcd5f('0xa')](_0xcd5f('0x2b'));return _0x2c5678;});}});}function getAuth(_0x3f05a2){return util[_0xcd5f('0x25')]('Basic\x20%s',new Buffer(_0x3f05a2[_0xcd5f('0x2c')]+':X')['toString']('base64'));}function request(_0x4d136f){logger['debug'](_0xcd5f('0x2d'),JSON[_0xcd5f('0x2e')](_0x4d136f));return rp(_[_0xcd5f('0x5')](_0x4d136f,{'method':_0xcd5f('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x140e72,_0xc52727){var _0x758d73=[];if(_0x140e72&&_0x140e72[_0xcd5f('0x1f')]>0x0){_0x758d73=_[_0xcd5f('0x30')](_0x140e72,_0xc52727);}return _0x758d73;}function getCustomFields(_0x382ac6,_0x146d36){var _0x179552=[];var _0x2b0ff9={'custom_fields':[]};if(_0x382ac6[_0xcd5f('0x1f')]>0x0){_[_0xcd5f('0x31')](_0x382ac6,function(_0x5ce0df){if(_[_0xcd5f('0x32')](['string','picklist'],_0x5ce0df['type'])&&_0x5ce0df[_0xcd5f('0x33')]&&!_0x5ce0df[_0xcd5f('0x34')]){_0x2b0ff9[_0x5ce0df[_0xcd5f('0x33')][_0xcd5f('0x35')]()]=_0x5ce0df[_0xcd5f('0x36')][_0xcd5f('0x37')]();}else if(_[_0xcd5f('0x32')](['string',_0xcd5f('0x38')],_0x5ce0df[_0xcd5f('0x39')])&&_0x5ce0df[_0xcd5f('0x3a')]&&_0x5ce0df[_0xcd5f('0x34')]){_0x2b0ff9[_0xcd5f('0x18')][_0xcd5f('0x3b')]({'id':_0x5ce0df[_0xcd5f('0x3a')],'value':_0x5ce0df['content'][_0xcd5f('0x37')]()});}else if(_0x5ce0df['type']===_0xcd5f('0x3c')&&_0x5ce0df[_0xcd5f('0x3d')]&&_0x5ce0df[_0xcd5f('0x3a')]&&_0x5ce0df[_0xcd5f('0x34')]){_0x146d36[_0x5ce0df[_0xcd5f('0x3d')]]&&_0x2b0ff9[_0xcd5f('0x18')][_0xcd5f('0x3b')]({'id':_0x5ce0df[_0xcd5f('0x3a')],'value':_0x146d36[_0x5ce0df[_0xcd5f('0x3d')]][_0xcd5f('0x37')]()});}else if(_0x5ce0df['type']===_0xcd5f('0x3e')&&_0x5ce0df[_0xcd5f('0x3f')]&&_0x5ce0df[_0xcd5f('0x3f')][_0xcd5f('0x14')]&&_0x5ce0df['idField']&&_0x5ce0df[_0xcd5f('0x34')]){_0x146d36[_0x5ce0df['Variable'][_0xcd5f('0x14')]['toLowerCase']()]&&_0x2b0ff9[_0xcd5f('0x18')][_0xcd5f('0x3b')]({'id':_0x5ce0df[_0xcd5f('0x3a')],'value':_0x146d36[_0x5ce0df[_0xcd5f('0x3f')][_0xcd5f('0x14')]['toLowerCase']()][_0xcd5f('0x37')]()});}});}return _0x2b0ff9;}exports[_0xcd5f('0x40')]=function(_0x345ef4,_0x17d75d,_0x184d24,_0x3060ae,_0x331115,_0x56d020){var _0x543486,_0x2a583d;_0x56d020[_0xcd5f('0x1b')]=intUtil[_0xcd5f('0x41')](_0x56d020[_0xcd5f('0x1b')]);_0x56d020[_0xcd5f('0x42')]=intUtil[_0xcd5f('0x41')](_0x56d020[_0xcd5f('0x42')]);if(_0x331115&&_0x331115[_0xcd5f('0x43')]){logger['info']('[QUEUE]',_0xcd5f('0x44'));_0x17d75d[_0xcd5f('0x45')]=util[_0xcd5f('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56d020['serverUrl'],_0x17d75d[_0xcd5f('0x46')],md5(_0x17d75d['uniqueid']));}else{_0x17d75d[_0xcd5f('0x45')]='';}headers[_0xcd5f('0x47')]=getAuth(_0x56d020);return getUser(_0x56d020,_0x3060ae[_0xcd5f('0x23')])[_0xcd5f('0x1c')](function(_0x3c9d3a){_0x543486=_0x3c9d3a;logger[_0xcd5f('0xa')]('The\x20User\x20ID\x20is:',_0x543486['id']);return getEndUser(_0x56d020,_0x17d75d[_0xcd5f('0xd')],_0x17d75d[_0xcd5f('0xe')]);})[_0xcd5f('0x1c')](function(_0x4c0442){_0x2a583d=_0x4c0442;logger[_0xcd5f('0xa')](_0xcd5f('0x48'),_0x2a583d['id']);return getTicket(_0x56d020,_0x543486,_0x2a583d,_0x184d24,_0x17d75d);})[_0xcd5f('0x1c')](function(_0x9445e0){if(_0x9445e0&&_0x9445e0['id']){logger[_0xcd5f('0xa')]('Ticket\x20created!');logger[_0xcd5f('0xa')]('The\x20Ticket\x20ID\x20is:',_0x9445e0['id']);logger[_0xcd5f('0xa')](_0xcd5f('0x49'),_0xcd5f('0x4a'));emit(util['format'](_0xcd5f('0x4b'),_0x3060ae[_0xcd5f('0x14')]),'trigger:browser:url',{'uri':util[_0xcd5f('0x25')](_0xcd5f('0x4c'),_0x56d020[_0xcd5f('0x1b')],_0x9445e0['id'])});}})[_0xcd5f('0x4d')](function(_0x4cd8f4){logger[_0xcd5f('0x4e')](_0xcd5f('0x49'),JSON[_0xcd5f('0x2e')](_0x4cd8f4));});};exports[_0xcd5f('0x4f')]=function(_0x113616,_0x5b3d1d,_0x2416e7,_0x5e0f86,_0x33f7fa,_0x3f737c,_0x1e6190){var _0x283133,_0x4313e3;_0x3f737c[_0xcd5f('0x1b')]=intUtil['stripTrailingSlash'](_0x3f737c[_0xcd5f('0x1b')]);_0x3f737c[_0xcd5f('0x42')]=intUtil[_0xcd5f('0x41')](_0x3f737c[_0xcd5f('0x42')]);if(_0x1e6190&&_0x1e6190[_0xcd5f('0x50')]&&_0x1e6190[_0xcd5f('0x50')]!==_0xcd5f('0x51')){logger[_0xcd5f('0xa')]('[OUTBOUND]',_0xcd5f('0x44'));_0x5b3d1d[_0xcd5f('0x45')]=util['format'](_0xcd5f('0x52'),_0x3f737c[_0xcd5f('0x42')],_0x5b3d1d['uniqueid'],md5(_0x5b3d1d[_0xcd5f('0x46')]));}headers[_0xcd5f('0x47')]=getAuth(_0x3f737c);return getUser(_0x3f737c,_0x5e0f86['email'])[_0xcd5f('0x1c')](function(_0xb65066){_0x283133=_0xb65066;logger['info'](_0xcd5f('0x53'),_0x283133['id']);return getEndUser(_0x3f737c,_0x5b3d1d[_0xcd5f('0x54')],_0x5b3d1d[_0xcd5f('0x55')]);})['then'](function(_0x5cbe26){_0x4313e3=_0x5cbe26;logger[_0xcd5f('0xa')](_0xcd5f('0x48'),_0x4313e3['id']);return getTicket(_0x3f737c,_0x283133,_0x4313e3,_0x2416e7,_0x5b3d1d);})[_0xcd5f('0x1c')](function(_0x3e4e5d){if(_0x3e4e5d&&_0x3e4e5d['id']){logger[_0xcd5f('0xa')](_0xcd5f('0x1d'));logger[_0xcd5f('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3e4e5d['id']);logger[_0xcd5f('0xa')](_0xcd5f('0x56'),_0xcd5f('0x4a'));emit(util[_0xcd5f('0x25')](_0xcd5f('0x4b'),_0x5e0f86[_0xcd5f('0x14')]),_0xcd5f('0x57'),{'uri':util[_0xcd5f('0x25')](_0xcd5f('0x4c'),_0x3f737c[_0xcd5f('0x1b')],_0x3e4e5d['id'])});}})[_0xcd5f('0x4d')](function(_0x452e76){logger['error'](_0xcd5f('0x56'),JSON[_0xcd5f('0x2e')](_0x452e76));});};exports[_0xcd5f('0x58')]=function(_0x11f4fa,_0x10c446,_0x155f60,_0x14f9a0,_0x294579,_0x471144){var _0x47123b,_0x3bc824;_0x471144[_0xcd5f('0x1b')]=intUtil[_0xcd5f('0x41')](_0x471144[_0xcd5f('0x1b')]);_0x471144['serverUrl']=intUtil[_0xcd5f('0x41')](_0x471144[_0xcd5f('0x42')]);if(_0x294579&&_0x294579['monitor_format']){logger[_0xcd5f('0xa')]('['+_0x10c446[_0xcd5f('0x59')][_0xcd5f('0x5a')]()+']',_0xcd5f('0x44'));_0x10c446[_0xcd5f('0x45')]=util['format'](_0xcd5f('0x52'),_0x471144[_0xcd5f('0x42')],_0x10c446[_0xcd5f('0x46')],md5(_0x10c446[_0xcd5f('0x46')]));}else{_0x10c446[_0xcd5f('0x45')]='';}headers['Authorization']=getAuth(_0x471144);return getUser(_0x471144,'')[_0xcd5f('0x1c')](function(_0x3ed196){_0x47123b=_0x3ed196;logger[_0xcd5f('0xa')]('The\x20User\x20ID\x20is:',_0x47123b['id']);return getEndUser(_0x471144,_0x10c446[_0xcd5f('0xd')],_0x10c446[_0xcd5f('0xe')]);})[_0xcd5f('0x1c')](function(_0x5ee700){_0x3bc824=_0x5ee700;logger[_0xcd5f('0xa')](_0xcd5f('0x48'),_0x3bc824['id']);return getTicket(_0x471144,_0x47123b,_0x3bc824,_0x155f60,_0x10c446);})['then'](function(_0x498008){if(_0x498008){logger[_0xcd5f('0xa')](_0xcd5f('0x1d'));logger[_0xcd5f('0xa')](_0xcd5f('0x5b'),_0x498008['id']);}})[_0xcd5f('0x4d')](function(_0x7c9c37){logger[_0xcd5f('0x4e')]('['+_0x10c446[_0xcd5f('0x59')]['toUpperCase']()+']',JSON[_0xcd5f('0x2e')](_0x7c9c37));});}; \ 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 8b13fcd..b981244 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 _0xbb07=['Getting\x20admin\x20information','then','length','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','GET','headers','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userId','userEmail','adminEmail','catch','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','moment','ioredis','./util','redis','defaults','localhost','/api/selector/owners'];(function(_0x3da2ff,_0x22f2bd){var _0x33695d=function(_0x43ffd3){while(--_0x43ffd3){_0x3da2ff['push'](_0x3da2ff['shift']());}};_0x33695d(++_0x22f2bd);}(_0xbb07,0x18c));var _0x7bb0=function(_0x39c148,_0x2fcfe9){_0x39c148=_0x39c148-0x0;var _0x5d8006=_0xbb07[_0x39c148];return _0x5d8006;};'use strict';var _=require(_0x7bb0('0x0'));var rp=require(_0x7bb0('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0x7bb0('0x2'));var Promise=require('bluebird');var Redis=require(_0x7bb0('0x3'));var intUtil=require(_0x7bb0('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0x7bb0('0x5')]=_[_0x7bb0('0x6')](config['redis'],{'host':_0x7bb0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x225bda,_0x358551,_0x46763c,_0x902dd8){return new Promise(function(_0x4eeb1b,_0x3e67af){var _0x392829=![];var _0x26c201={'method':'GET','uri':_0x902dd8+_0x7bb0('0x8'),'json':!![]};_0x26c201['headers']=_0x46763c;logger['info'](_0x7bb0('0x9'));return rp(_0x26c201)[_0x7bb0('0xa')](function(_0x116575){if(_0x116575){var _0x27c9fd=_0x116575['users'];var _0x4cd583=null;for(_0x4cd583=0x0;_0x4cd583<_0x27c9fd[_0x7bb0('0xb')];_0x4cd583++){if(_0x27c9fd[_0x4cd583][_0x7bb0('0xc')]===_0x225bda['adminEmail']){_0x225bda[_0x7bb0('0xd')]=_0x27c9fd[_0x4cd583]['id'];_0x392829=!![];}}if(_0x392829){logger[_0x7bb0('0xe')](_0x7bb0('0xf'),_0x225bda[_0x7bb0('0xd')]);_0x4eeb1b(_0x225bda);}else{_0x3e67af({'statusCode':0x194,'message':_0x7bb0('0x10')});}}else{_0x3e67af({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x14fb18){logger[_0x7bb0('0x11')]('['+[_0x358551[_0x7bb0('0x12')]()]+']',_0x14fb18[_0x7bb0('0x13')]);_0x3e67af(_0x14fb18);});});}function getUser(_0x1edab9,_0x1ba8a3,_0x34033f){return function(_0x19485c){return new Promise(function(_0x3fc782,_0x5237ac){var _0x546213={'method':_0x7bb0('0x14'),'uri':_0x34033f+_0x7bb0('0x8'),'json':!![]};_0x546213[_0x7bb0('0x15')]=_0x1ba8a3;logger[_0x7bb0('0xe')](_0x7bb0('0x16'));return rp(_0x546213)[_0x7bb0('0xa')](function(_0x563901){if(_0x563901){var _0xe77e12=_0x563901[_0x7bb0('0x17')];var _0xf3dd63=![];var _0x4de787=null;if(_0x19485c[_0x7bb0('0x18')]!==null){logger[_0x7bb0('0xe')](_0x7bb0('0x19'),_0x19485c['agentEmail']);_0x19485c['userEmail']=_0x19485c[_0x7bb0('0x18')];for(_0x4de787=0x0;_0x4de787<_0xe77e12['length'];_0x4de787++){if(_0xe77e12[_0x4de787][_0x7bb0('0xc')]===_0x19485c[_0x7bb0('0x18')]){_0xf3dd63=!![];_0x19485c[_0x7bb0('0x1a')]=_0xe77e12[_0x4de787]['id'];logger['info']('User\x20found:',_0x19485c[_0x7bb0('0x1a')]);}}}if(!_0xf3dd63){logger[_0x7bb0('0xe')]('Admin\x20selected');_0x19485c[_0x7bb0('0x1b')]=_0x19485c[_0x7bb0('0x1c')];_0x19485c[_0x7bb0('0x1a')]=_0x19485c[_0x7bb0('0xd')];_0xf3dd63=!![];}if(_0xf3dd63){_0x3fc782(_0x19485c);}else{_0x5237ac({'statusCode':0x194,'message':_0x7bb0('0x10')});}}else{_0x5237ac({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7bb0('0x1d')](function(_0x51a988){logger[_0x7bb0('0x11')]('['+[_0x1edab9[_0x7bb0('0x12')]()]+']',_0x51a988[_0x7bb0('0x13')]);_0x5237ac(_0x51a988);});});};}function searchContact(_0x525886,_0x38954c,_0x1a1a5e,_0x2a2544){return new Promise(function(_0x164395,_0x1e8d7d){var _0x36f98a={'method':'GET','headers':_0x38954c,'uri':_0x525886+'/api/lookup?q='+_0x2a2544+_0x7bb0('0x1e')+_0x1a1a5e+_0x7bb0('0x1f'),'json':!![]};rp(_0x36f98a)['then'](function(_0x145558){var _0x4187ea=_[_0x7bb0('0x20')](_0x145558['contacts'][_0x7bb0('0x21')],[_0x1a1a5e,_0x2a2544]);_0x164395(_0x4187ea);})['catch'](function(_0x39b1fe){_0x1e8d7d(_0x39b1fe);});});}function getEndUser(_0x41f71a,_0x3d2a00,_0x1fef99){return function(_0x3413c2){return new Promise(function(_0x395459,_0x366bd4){logger[_0x7bb0('0xe')](util[_0x7bb0('0x22')](_0x7bb0('0x23'),_0x3413c2[_0x7bb0('0x24')]));searchContact(_0x1fef99,_0x3d2a00,'mobile_number',_0x3413c2['contactNumber'])[_0x7bb0('0xa')](function(_0x31e097){if(_0x31e097){_0x3413c2['endUserId']=_0x31e097['id'];logger[_0x7bb0('0xe')](_0x7bb0('0x25'),_0x3413c2[_0x7bb0('0x26')]);return _0x395459(_0x3413c2);}searchContact(_0x1fef99,_0x3d2a00,'work_number',_0x3413c2[_0x7bb0('0x24')])[_0x7bb0('0xa')](function(_0x57d35b){if(_0x57d35b){_0x3413c2['endUserId']=_0x57d35b['id'];logger[_0x7bb0('0xe')](_0x7bb0('0x27'),_0x3413c2[_0x7bb0('0x26')]);return _0x395459(_0x3413c2);}createEndUser(_0x3413c2,_0x41f71a,_0x3d2a00,_0x1fef99)[_0x7bb0('0xa')](function(_0xfaf697){logger[_0x7bb0('0xe')](_0x7bb0('0x28'),_0xfaf697['endUserId']);return _0x395459(_0xfaf697);});});})[_0x7bb0('0x1d')](function(_0x4bd88f){_0x366bd4(_0x4bd88f);});});};}function createEndUser(_0x28d7aa,_0x3534e2,_0x6ed839,_0x2c6119){return new Promise(function(_0x402d14,_0x296fd8){var _0x161751=moment();var _0x2ed364={'method':_0x7bb0('0x29'),'uri':_0x2c6119+_0x7bb0('0x2a'),'body':{'contact':{'last_name':_0x28d7aa['contactNumber'],'work_number':_0x28d7aa[_0x7bb0('0x24')],'mobile_number':_0x28d7aa[_0x7bb0('0x24')],'owner_id':_0x28d7aa[_0x7bb0('0x1a')],'created_at':_0x161751[_0x7bb0('0x22')](_0x7bb0('0x2b'))}},'json':!![]};_0x2ed364[_0x7bb0('0x15')]=_0x6ed839;logger[_0x7bb0('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2ed364)[_0x7bb0('0xa')](function(_0xc1dade){_0x28d7aa['endUserId']=_0xc1dade[_0x7bb0('0x2c')]['id'];_0x402d14(_0x28d7aa);})[_0x7bb0('0x1d')](function(_0x168bcf){logger[_0x7bb0('0x11')]('['+[_0x3534e2[_0x7bb0('0x12')]()]+']',_0x168bcf['message']);_0x296fd8(_0x168bcf[_0x7bb0('0x13')]);});});}function getTicket(_0x4c51d5,_0x53bb89,_0x253fa7,_0x1b5710,_0x3a06e0){return function(_0xf761d7){logger['info'](_0x7bb0('0x2d'));return new Promise(function(_0x5be17b,_0x2e8a6d){var _0x5ccc56=moment();var _0x205ec4={'method':'POST','uri':_0x253fa7+_0x7bb0('0x2e'),'body':{'title':intUtil[_0x7bb0('0x2f')](_0x1b5710[_0x7bb0('0x30')],_0x3a06e0,'\x20'),'description':intUtil['getString'](_0x1b5710[_0x7bb0('0x31')],_0x3a06e0,'\x0a'),'owner_id':_0xf761d7[_0x7bb0('0x1a')],'creater_id':_0xf761d7['adminId'],'targetable_id':_0xf761d7[_0x7bb0('0x26')],'targetable_type':'Contact','created_at':_0x5ccc56[_0x7bb0('0x22')](_0x7bb0('0x2b')),'due_date':_0x5ccc56[_0x7bb0('0x32')](0x1e,'m')[_0x7bb0('0x22')](_0x7bb0('0x2b'))},'json':!![]};_0x205ec4['headers']=_0x53bb89;return rp(_0x205ec4)[_0x7bb0('0xa')](function(_0x38d6a2){_0xf761d7[_0x7bb0('0x33')]=_0x38d6a2[_0x7bb0('0x34')]['id'];logger['info'](_0x7bb0('0x35'),_0xf761d7['ticketId']);_0x5be17b(_0xf761d7);})[_0x7bb0('0x1d')](function(_0x775a62){logger[_0x7bb0('0x11')]('['+[_0x4c51d5[_0x7bb0('0x12')]()]+']',_0x775a62[_0x7bb0('0x13')]);_0x2e8a6d(_0x775a62[_0x7bb0('0x13')]);});});};}function emit(_0x3392a1,_0x59a18f,_0x278476){var _0x4d3632={'uri':_0x3392a1+'/contacts/'+_0x278476};io['to'](util[_0x7bb0('0x22')](_0x7bb0('0x36'),_0x59a18f))['emit'](_0x7bb0('0x37'),_0x4d3632);}exports['cs']=function(_0x49556c,_0x44dee8,_0x25732d,_0x2d6c5b,_0x3bbfbc,_0x288ce3,_0x3d41b6,_0x2e60e8){var _0x5a2290={};var _0x22cde2={'Authorization':_0x7bb0('0x38')+_0x288ce3[_0x7bb0('0x39')]};_0x288ce3[_0x7bb0('0x3a')]=intUtil['stripTrailingSlash'](_0x288ce3['remoteUri']);_0x288ce3['serverUrl']=intUtil[_0x7bb0('0x3b')](_0x288ce3['serverUrl']);var _0x3525cf=_0x288ce3[_0x7bb0('0x3a')];_0x5a2290[_0x7bb0('0x1c')]=_0x288ce3[_0x7bb0('0x3c')];_0x5a2290[_0x7bb0('0x24')]=_0x2e60e8[_0x7bb0('0x3d')]()==='outbound'?_0x44dee8[_0x7bb0('0x3e')]:_0x44dee8[_0x7bb0('0x3f')];_0x5a2290[_0x7bb0('0x40')]=_0x2e60e8===_0x7bb0('0x41')||_0x2e60e8===_0x7bb0('0x42')?_0x7bb0('0x41'):_0x7bb0('0x43');if(_0x2d6c5b){_0x5a2290[_0x7bb0('0x18')]=_0x2d6c5b[_0x7bb0('0xc')];}var _0x37d395=util[_0x7bb0('0x22')](_0x7bb0('0x44'),_0x288ce3[_0x7bb0('0x45')],_0x44dee8[_0x7bb0('0x46')],md5(_0x44dee8[_0x7bb0('0x46')]));if(_0x3bbfbc&&_0x3bbfbc[_0x7bb0('0x47')]){logger[_0x7bb0('0xe')](_0x7bb0('0x48'),_0x7bb0('0x49'));_0x44dee8[_0x7bb0('0x4a')]=_0x37d395;}else if(_0x3d41b6&&_0x3d41b6[_0x7bb0('0x4b')]&&_0x3d41b6[_0x7bb0('0x4b')]!==_0x7bb0('0x4c')){logger['info'](_0x7bb0('0x4d'),_0x7bb0('0x49'));_0x44dee8[_0x7bb0('0x4a')]=_0x37d395;}else{_0x44dee8[_0x7bb0('0x4a')]='';}return getAdminId(_0x5a2290,_0x2e60e8,_0x22cde2,_0x3525cf)[_0x7bb0('0xa')](getUser(_0x2e60e8,_0x22cde2,_0x3525cf))['then'](getEndUser(_0x2e60e8,_0x22cde2,_0x3525cf))[_0x7bb0('0xa')](getTicket(_0x2e60e8,_0x22cde2,_0x3525cf,_0x25732d,_0x44dee8))[_0x7bb0('0xa')](function(_0x3330f2){logger[_0x7bb0('0xe')](util['format'](_0x7bb0('0x4e'),_0x3330f2[_0x7bb0('0x33')]));if(_0x2e60e8!==_0x7bb0('0x42')){logger[_0x7bb0('0xe')]('['+[_0x2e60e8[_0x7bb0('0x12')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3525cf,_0x2d6c5b[_0x7bb0('0x4f')],_0x3330f2[_0x7bb0('0x26')]);}})[_0x7bb0('0x1d')](function(_0x24c20d){logger[_0x7bb0('0x11')]('['+[_0x2e60e8[_0x7bb0('0x12')]()]+_0x7bb0('0x50'),util['inspect'](_0x24c20d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe3c3=['Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','ioredis','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','error','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','calleridnum','unmanaged','queue','outbound','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xe3c3,0x13f));var _0x3e3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var rp=require(_0x3e3c('0x0'));var md5=require('md5');var util=require(_0x3e3c('0x1'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x3e3c('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3e3c('0x3'))(_0x3e3c('0x4'));config['redis']=_[_0x3e3c('0x5')](config[_0x3e3c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3e3c('0x7'))(new Redis(config[_0x3e3c('0x6')]));function getAdminId(_0x3ee0d9,_0xf1005b,_0x2cb79e,_0x5ee0e6){return new Promise(function(_0x43b02b,_0x5edaac){var _0x5b6bfd=![];var _0x38e6f6={'method':_0x3e3c('0x8'),'uri':_0x5ee0e6+_0x3e3c('0x9'),'json':!![]};_0x38e6f6[_0x3e3c('0xa')]=_0x2cb79e;logger[_0x3e3c('0xb')](_0x3e3c('0xc'));return rp(_0x38e6f6)[_0x3e3c('0xd')](function(_0x239c8c){if(_0x239c8c){var _0x26fe0d=_0x239c8c[_0x3e3c('0xe')];var _0xf04163=null;for(_0xf04163=0x0;_0xf04163<_0x26fe0d[_0x3e3c('0xf')];_0xf04163++){if(_0x26fe0d[_0xf04163][_0x3e3c('0x10')]===_0x3ee0d9[_0x3e3c('0x11')]){_0x3ee0d9[_0x3e3c('0x12')]=_0x26fe0d[_0xf04163]['id'];_0x5b6bfd=!![];}}if(_0x5b6bfd){logger[_0x3e3c('0xb')](_0x3e3c('0x13'),_0x3ee0d9['adminId']);_0x43b02b(_0x3ee0d9);}else{_0x5edaac({'statusCode':0x194,'message':_0x3e3c('0x14')});}}else{_0x5edaac({'statusCode':0x194,'message':_0x3e3c('0x14')});}})[_0x3e3c('0x15')](function(_0x1342a6){logger['error']('['+[_0xf1005b[_0x3e3c('0x16')]()]+']',_0x1342a6[_0x3e3c('0x17')]);_0x5edaac(_0x1342a6);});});}function getUser(_0x100dc1,_0xa1ebba,_0x135ba2){return function(_0x56bfd2){return new Promise(function(_0x46b54f,_0x42230a){var _0x3fcb3c={'method':_0x3e3c('0x8'),'uri':_0x135ba2+_0x3e3c('0x9'),'json':!![]};_0x3fcb3c[_0x3e3c('0xa')]=_0xa1ebba;logger[_0x3e3c('0xb')](_0x3e3c('0x18'));return rp(_0x3fcb3c)['then'](function(_0x1b5c19){if(_0x1b5c19){var _0x1151a1=_0x1b5c19['users'];var _0x14a418=![];var _0x3441e6=null;if(_0x56bfd2[_0x3e3c('0x19')]!==null){logger[_0x3e3c('0xb')](_0x3e3c('0x1a'),_0x56bfd2[_0x3e3c('0x19')]);_0x56bfd2['userEmail']=_0x56bfd2['agentEmail'];for(_0x3441e6=0x0;_0x3441e6<_0x1151a1[_0x3e3c('0xf')];_0x3441e6++){if(_0x1151a1[_0x3441e6][_0x3e3c('0x10')]===_0x56bfd2[_0x3e3c('0x19')]){_0x14a418=!![];_0x56bfd2[_0x3e3c('0x1b')]=_0x1151a1[_0x3441e6]['id'];logger['info'](_0x3e3c('0x1c'),_0x56bfd2[_0x3e3c('0x1b')]);}}}if(!_0x14a418){logger[_0x3e3c('0xb')](_0x3e3c('0x1d'));_0x56bfd2[_0x3e3c('0x1e')]=_0x56bfd2[_0x3e3c('0x11')];_0x56bfd2[_0x3e3c('0x1b')]=_0x56bfd2[_0x3e3c('0x12')];_0x14a418=!![];}if(_0x14a418){_0x46b54f(_0x56bfd2);}else{_0x42230a({'statusCode':0x194,'message':_0x3e3c('0x14')});}}else{_0x42230a({'statusCode':0x194,'message':_0x3e3c('0x14')});}})[_0x3e3c('0x15')](function(_0x2c2313){logger[_0x3e3c('0x1f')]('['+[_0x100dc1['toUpperCase']()]+']',_0x2c2313[_0x3e3c('0x17')]);_0x42230a(_0x2c2313);});});};}function searchContact(_0x41ebae,_0x4e5fa7,_0x4fe964,_0x1b9706){return new Promise(function(_0x218446,_0x171e28){var _0x4a4663={'method':_0x3e3c('0x8'),'headers':_0x4e5fa7,'uri':_0x41ebae+_0x3e3c('0x20')+_0x1b9706+_0x3e3c('0x21')+_0x4fe964+'&entities=contact','json':!![]};rp(_0x4a4663)[_0x3e3c('0xd')](function(_0x2a7976){var _0x58e156=_[_0x3e3c('0x22')](_0x2a7976[_0x3e3c('0x23')]['contacts'],[_0x4fe964,_0x1b9706]);_0x218446(_0x58e156);})['catch'](function(_0xc8d848){_0x171e28(_0xc8d848);});});}function getEndUser(_0x47d899,_0x5f117b,_0x3ab1be){return function(_0x1f9c43){return new Promise(function(_0x4b51e1,_0x249e23){logger['info'](util[_0x3e3c('0x24')](_0x3e3c('0x25'),_0x1f9c43['contactNumber']));searchContact(_0x3ab1be,_0x5f117b,_0x3e3c('0x26'),_0x1f9c43[_0x3e3c('0x27')])[_0x3e3c('0xd')](function(_0x396368){if(_0x396368){_0x1f9c43[_0x3e3c('0x28')]=_0x396368['id'];logger['info'](_0x3e3c('0x29'),_0x1f9c43[_0x3e3c('0x28')]);return _0x4b51e1(_0x1f9c43);}searchContact(_0x3ab1be,_0x5f117b,_0x3e3c('0x2a'),_0x1f9c43[_0x3e3c('0x27')])[_0x3e3c('0xd')](function(_0x342777){if(_0x342777){_0x1f9c43[_0x3e3c('0x28')]=_0x342777['id'];logger['info'](_0x3e3c('0x2b'),_0x1f9c43[_0x3e3c('0x28')]);return _0x4b51e1(_0x1f9c43);}createEndUser(_0x1f9c43,_0x47d899,_0x5f117b,_0x3ab1be)[_0x3e3c('0xd')](function(_0x4b3aa6){logger[_0x3e3c('0xb')]('Contact\x20created:',_0x4b3aa6['endUserId']);return _0x4b51e1(_0x4b3aa6);});});})['catch'](function(_0x4d48b5){_0x249e23(_0x4d48b5);});});};}function createEndUser(_0x14816b,_0x1d6ee2,_0x5972ea,_0x5eabfe){return new Promise(function(_0x5efc60,_0x1c53a7){var _0x24bc73=moment();var _0x20d56e={'method':_0x3e3c('0x2c'),'uri':_0x5eabfe+'/api/contacts','body':{'contact':{'last_name':_0x14816b[_0x3e3c('0x27')],'work_number':_0x14816b[_0x3e3c('0x27')],'mobile_number':_0x14816b[_0x3e3c('0x27')],'owner_id':_0x14816b[_0x3e3c('0x1b')],'created_at':_0x24bc73[_0x3e3c('0x24')](_0x3e3c('0x2d'))}},'json':!![]};_0x20d56e[_0x3e3c('0xa')]=_0x5972ea;logger[_0x3e3c('0xb')](_0x3e3c('0x2e'));return rp(_0x20d56e)[_0x3e3c('0xd')](function(_0xb6274a){_0x14816b[_0x3e3c('0x28')]=_0xb6274a[_0x3e3c('0x2f')]['id'];_0x5efc60(_0x14816b);})[_0x3e3c('0x15')](function(_0x29fa19){logger[_0x3e3c('0x1f')]('['+[_0x1d6ee2[_0x3e3c('0x16')]()]+']',_0x29fa19[_0x3e3c('0x17')]);_0x1c53a7(_0x29fa19[_0x3e3c('0x17')]);});});}function getTicket(_0x3b7ccc,_0x33aef8,_0x44f47d,_0x522ee6,_0x2d112b){return function(_0xe4b6a6){logger[_0x3e3c('0xb')](_0x3e3c('0x30'));return new Promise(function(_0x21a14e,_0x1706c5){var _0x204387=moment();var _0xb40ac5={'method':_0x3e3c('0x2c'),'uri':_0x44f47d+_0x3e3c('0x31'),'body':{'title':intUtil['getString'](_0x522ee6[_0x3e3c('0x32')],_0x2d112b,'\x20'),'description':intUtil[_0x3e3c('0x33')](_0x522ee6[_0x3e3c('0x34')],_0x2d112b,'\x0a'),'owner_id':_0xe4b6a6[_0x3e3c('0x1b')],'creater_id':_0xe4b6a6[_0x3e3c('0x12')],'targetable_id':_0xe4b6a6[_0x3e3c('0x28')],'targetable_type':_0x3e3c('0x35'),'created_at':_0x204387[_0x3e3c('0x24')](_0x3e3c('0x2d')),'due_date':_0x204387['add'](0x1e,'m')[_0x3e3c('0x24')](_0x3e3c('0x2d'))},'json':!![]};_0xb40ac5[_0x3e3c('0xa')]=_0x33aef8;return rp(_0xb40ac5)['then'](function(_0x1dc49a){_0xe4b6a6['ticketId']=_0x1dc49a[_0x3e3c('0x36')]['id'];logger[_0x3e3c('0xb')](_0x3e3c('0x37'),_0xe4b6a6[_0x3e3c('0x38')]);_0x21a14e(_0xe4b6a6);})[_0x3e3c('0x15')](function(_0x5d34fa){logger['error']('['+[_0x3b7ccc[_0x3e3c('0x16')]()]+']',_0x5d34fa[_0x3e3c('0x17')]);_0x1706c5(_0x5d34fa[_0x3e3c('0x17')]);});});};}function emit(_0x1bb1ca,_0x48e874,_0x3a62a7){var _0x214a55={'uri':_0x1bb1ca+_0x3e3c('0x39')+_0x3a62a7};io['to'](util[_0x3e3c('0x24')](_0x3e3c('0x3a'),_0x48e874))[_0x3e3c('0x3b')](_0x3e3c('0x3c'),_0x214a55);}exports['cs']=function(_0x5ab897,_0x25b179,_0x1ef83,_0x3f1186,_0x2f187e,_0x41de12,_0x298db0,_0x54584c){var _0x12e7c4={};var _0x5d4e8b={'Authorization':_0x3e3c('0x3d')+_0x41de12['apiKey']};_0x41de12[_0x3e3c('0x3e')]=intUtil['stripTrailingSlash'](_0x41de12[_0x3e3c('0x3e')]);_0x41de12['serverUrl']=intUtil[_0x3e3c('0x3f')](_0x41de12[_0x3e3c('0x40')]);var _0x312028=_0x41de12[_0x3e3c('0x3e')];_0x12e7c4[_0x3e3c('0x11')]=_0x41de12['username'];_0x12e7c4[_0x3e3c('0x27')]=_0x54584c[_0x3e3c('0x41')]()==='outbound'?_0x25b179[_0x3e3c('0x42')]:_0x25b179[_0x3e3c('0x43')];_0x12e7c4['callDirection']=_0x54584c==='queue'||_0x54584c===_0x3e3c('0x44')?_0x3e3c('0x45'):_0x3e3c('0x46');if(_0x3f1186){_0x12e7c4['agentEmail']=_0x3f1186[_0x3e3c('0x10')];}var _0x51d8be=util[_0x3e3c('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41de12[_0x3e3c('0x40')],_0x25b179[_0x3e3c('0x47')],md5(_0x25b179['uniqueid']));if(_0x2f187e&&_0x2f187e['monitor_format']){logger[_0x3e3c('0xb')]('[QUEUE]',_0x3e3c('0x48'));_0x25b179[_0x3e3c('0x49')]=_0x51d8be;}else if(_0x298db0&&_0x298db0[_0x3e3c('0x4a')]&&_0x298db0[_0x3e3c('0x4a')]!=='none'){logger[_0x3e3c('0xb')]('[OUTBOUND]',_0x3e3c('0x48'));_0x25b179[_0x3e3c('0x49')]=_0x51d8be;}else{_0x25b179[_0x3e3c('0x49')]='';}return getAdminId(_0x12e7c4,_0x54584c,_0x5d4e8b,_0x312028)[_0x3e3c('0xd')](getUser(_0x54584c,_0x5d4e8b,_0x312028))['then'](getEndUser(_0x54584c,_0x5d4e8b,_0x312028))['then'](getTicket(_0x54584c,_0x5d4e8b,_0x312028,_0x1ef83,_0x25b179))['then'](function(_0x11d6bf){logger['info'](util[_0x3e3c('0x24')](_0x3e3c('0x4b'),_0x11d6bf[_0x3e3c('0x38')]));if(_0x54584c!==_0x3e3c('0x44')){logger['info']('['+[_0x54584c[_0x3e3c('0x16')]()]+']',_0x3e3c('0x4c'));emit(_0x312028,_0x3f1186['name'],_0x11d6bf['endUserId']);}})[_0x3e3c('0x15')](function(_0x44ba58){logger['error']('['+[_0x54584c[_0x3e3c('0x16')]()]+_0x3e3c('0x4d'),util[_0x3e3c('0x4e')](_0x44ba58,{'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 d86b699..efe6823 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 _0xd002=['./freshsales','zoho','desk','dynamics365','freshsales','servicenow','data1','toLowerCase','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','sugarcrm','freshdesk','vtiger','log','error','[EXEC]','format','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./salesforce','./freshdesk','./zoho','./vtiger','./servicenow'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xd002,0x7d));var _0x2d00=function(_0x1f8739,_0x1bbe57){_0x1f8739=_0x1f8739-0x0;var _0x1c2e9a=_0xd002[_0x1f8739];return _0x1c2e9a;};'use strict';var _=require(_0x2d00('0x0'));var util=require(_0x2d00('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x2d00('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x2d00('0x3'));var zoho=require(_0x2d00('0x4'));var desk=require('./desk');var vtiger=require(_0x2d00('0x5'));var servicenow=require(_0x2d00('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x2d00('0x7'));var integrations=['zendesk','salesforce','sugarcrm','freshdesk',_0x2d00('0x8'),_0x2d00('0x9'),'vtiger',_0x2d00('0xa'),_0x2d00('0xb'),_0x2d00('0xc')];exports['exec']=function(_0xf94e9d,_0x50f5e0,_0x4d18a6,_0x103ef4,_0xa3ca95,_0x318e14){if(_0x4d18a6){if(_['includes'](integrations,_0xf94e9d['data1']['toLowerCase']())){try{var _0x306ea1=null;var _0x516b85='';var _0xfedc24=_0x4d18a6[_0xf94e9d[_0x2d00('0xd')][_0x2d00('0xe')]()];if(_0xfedc24){var _0x2b2bf5=_0xfedc24[_0xf94e9d['data2']];if(_0x2b2bf5){var _0x5e4c8b=_['find'](_0x2b2bf5[_0x2d00('0xf')],{'id':parseInt(_0xf94e9d[_0x2d00('0x10')],0xa)});if(_0x5e4c8b){if(_0x103ef4){if(_0xa3ca95&&_0x50f5e0[_0x2d00('0x11')]){_0x516b85=_0x2d00('0x11');}else if(_0x50f5e0[_0x2d00('0x12')]){_0x516b85=_0x2d00('0x13');}else{console['log'](_0x2d00('0x14'),_0x50f5e0);}}else{_0x516b85=_0x2d00('0x15');}switch(_0xf94e9d[_0x2d00('0xd')][_0x2d00('0xe')]()){case'zendesk':zendesk[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x16'):salesforce[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x17'):sugarcrm[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x18'):freshdesk[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x8'):zoho[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x9'):desk[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case _0x2d00('0x19'):vtiger[_0x516b85](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14);break;case'freshsales':freshsales['cs'](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14,_0x516b85);break;case'servicenow':servicenow['cs'](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14,_0x516b85);break;case _0x2d00('0xa'):dynamics365['cs'](_0xf94e9d,_0x50f5e0,_0x5e4c8b,_0x103ef4,_0xa3ca95,_0x2b2bf5,_0x318e14,_0x516b85);break;default:console[_0x2d00('0x1a')]('unknown\x20integration');}}else{_0x306ea1=require('../../../../config/logger')(_0xf94e9d['data1']['toLowerCase']());_0x306ea1[_0x2d00('0x1b')](_0x2d00('0x1c'),util[_0x2d00('0x1d')]('%s\x20configuration\x20#%s\x20not\x20found',_0xf94e9d[_0x2d00('0xd')]['toLowerCase'](),_0xf94e9d['data3']));}}else{_0x306ea1=require(_0x2d00('0x1e'))(_0xf94e9d[_0x2d00('0xd')]['toLowerCase']());_0x306ea1[_0x2d00('0x1b')]('[EXEC]',util[_0x2d00('0x1d')](_0x2d00('0x1f'),_0xf94e9d[_0x2d00('0xd')][_0x2d00('0xe')](),_0xf94e9d[_0x2d00('0x20')]));}}else{}}catch(_0x74350e){console['error'](_0x74350e);}}}}; \ No newline at end of file +var _0x2f40=['desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho'];(function(_0x53c653,_0x41fd4f){var _0x40b45c=function(_0x59aa4f){while(--_0x59aa4f){_0x53c653['push'](_0x53c653['shift']());}};_0x40b45c(++_0x41fd4f);}(_0x2f40,0x149));var _0x02f4=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x2f40[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require(_0x02f4('0x0'));var zendesk=require(_0x02f4('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x02f4('0x2'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x02f4('0x3'));var servicenow=require(_0x02f4('0x4'));var dynamics365=require(_0x02f4('0x5'));var freshsales=require(_0x02f4('0x6'));var integrations=[_0x02f4('0x7'),_0x02f4('0x8'),'sugarcrm',_0x02f4('0x9'),_0x02f4('0xa'),_0x02f4('0xb'),_0x02f4('0xc'),'dynamics365',_0x02f4('0xd'),_0x02f4('0xe')];exports['exec']=function(_0x28fd3d,_0x5ee18d,_0x56796a,_0x4057e6,_0x4391dc,_0x1286ff){if(_0x56796a){if(_[_0x02f4('0xf')](integrations,_0x28fd3d[_0x02f4('0x10')][_0x02f4('0x11')]())){try{var _0xb5098=null;var _0x5a99e2='';var _0x3fc060=_0x56796a[_0x28fd3d['data1'][_0x02f4('0x11')]()];if(_0x3fc060){var _0x4a8ef4=_0x3fc060[_0x28fd3d[_0x02f4('0x12')]];if(_0x4a8ef4){var _0x26d543=_['find'](_0x4a8ef4[_0x02f4('0x13')],{'id':parseInt(_0x28fd3d[_0x02f4('0x14')],0xa)});if(_0x26d543){if(_0x4057e6){if(_0x4391dc&&_0x5ee18d[_0x02f4('0x15')]){_0x5a99e2=_0x02f4('0x15');}else if(_0x5ee18d[_0x02f4('0x16')]){_0x5a99e2=_0x02f4('0x17');}else{console[_0x02f4('0x18')](_0x02f4('0x19'),_0x5ee18d);}}else{_0x5a99e2=_0x02f4('0x1a');}switch(_0x28fd3d[_0x02f4('0x10')][_0x02f4('0x11')]()){case _0x02f4('0x7'):zendesk[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0x8'):salesforce[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0x1b'):sugarcrm[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0x9'):freshdesk[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case'zoho':zoho[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0xb'):desk[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0xc'):vtiger[_0x5a99e2](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff);break;case _0x02f4('0xd'):freshsales['cs'](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff,_0x5a99e2);break;case'servicenow':servicenow['cs'](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff,_0x5a99e2);break;case'dynamics365':dynamics365['cs'](_0x28fd3d,_0x5ee18d,_0x26d543,_0x4057e6,_0x4391dc,_0x4a8ef4,_0x1286ff,_0x5a99e2);break;default:console['log'](_0x02f4('0x1c'));}}else{_0xb5098=require(_0x02f4('0x1d'))(_0x28fd3d[_0x02f4('0x10')]['toLowerCase']());_0xb5098[_0x02f4('0x1e')](_0x02f4('0x1f'),util[_0x02f4('0x20')](_0x02f4('0x21'),_0x28fd3d[_0x02f4('0x10')][_0x02f4('0x11')](),_0x28fd3d[_0x02f4('0x14')]));}}else{_0xb5098=require('../../../../config/logger')(_0x28fd3d[_0x02f4('0x10')][_0x02f4('0x11')]());_0xb5098[_0x02f4('0x1e')](_0x02f4('0x1f'),util[_0x02f4('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x28fd3d[_0x02f4('0x10')][_0x02f4('0x11')](),_0x28fd3d['data2']));}}else{}}catch(_0x482a32){console[_0x02f4('0x1e')](_0x482a32);}}}}; \ 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 2c35e7f..991eb03 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 _0x45b1=['endUserType','WhoId','WhatId','Case','contact','ContactId','account','leadId','info','sobject','isNil','validateEmail','User','execute','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Contact','Lead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','create','forEach','string','picklist','idField','content','toString','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','assign','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence'];(function(_0x1e6a11,_0x3b6439){var _0xddb333=function(_0x48720e){while(--_0x48720e){_0x1e6a11['push'](_0x1e6a11['shift']());}};_0xddb333(++_0x3b6439);}(_0x45b1,0xfa));var _0x145b=function(_0x26dae0,_0x410c2c){_0x26dae0=_0x26dae0-0x0;var _0x47733b=_0x45b1[_0x26dae0];return _0x47733b;};'use strict';var _=require(_0x145b('0x0'));var rp=require(_0x145b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x145b('0x2'));var jsforce=require(_0x145b('0x3'));var util=require(_0x145b('0x4'));var Redis=require(_0x145b('0x5'));var intUtil=require(_0x145b('0x6'));var config=require(_0x145b('0x7'));var logger=require(_0x145b('0x8'))('salesforce');config[_0x145b('0x9')]=_[_0x145b('0xa')](config[_0x145b('0x9')],{'host':_0x145b('0xb'),'port':0x18eb});var io=require(_0x145b('0xc'))(new Redis(config[_0x145b('0x9')]));function emit(_0x4c3e01,_0x9f5e27,_0x5b8a4d){io['to'](_0x4c3e01)['emit'](_0x9f5e27,_0x5b8a4d);}function getTicket(_0x27312e,_0x3a658,_0x2e4f96,_0x2d8f1c,_0x21d754,_0x14274b,_0x4487f2,_0xff794c){var _0x56a2bc=Object[_0x145b('0xd')]({},{'OwnerId':_0x3a658['id'],'Subject':intUtil['getString'](_0x2d8f1c[_0x145b('0xe')],_0x21d754,'\x20'),'Description':intUtil[_0x145b('0xf')](_0x2d8f1c['Descriptions'],_0x21d754,'\x0a')},getCustomFields(_0x14274b,_0x21d754));if(_0x2e4f96){if(_0x2d8f1c[_0x145b('0x10')]===_0x145b('0x11')){_0x56a2bc[_0x145b('0x12')]=moment[_0x145b('0x13')]();_0x56a2bc[_0x145b('0x14')]=![];_0x56a2bc[_0x145b('0x15')]=![];if(_0x2e4f96[_0x145b('0x16')]==='contact'||_0x2e4f96['endUserType']==='lead'){_0x56a2bc[_0x145b('0x17')]=_0x2e4f96['id'];}else if(_0x2e4f96[_0x145b('0x16')]==='account'){_0x56a2bc[_0x145b('0x18')]=_0x2e4f96['id'];}}else if(_0x2d8f1c[_0x145b('0x10')]===_0x145b('0x19')){if(_0x2e4f96[_0x145b('0x16')]===_0x145b('0x1a')){_0x56a2bc[_0x145b('0x1b')]=_0x2e4f96['id'];}else if(_0x2e4f96[_0x145b('0x16')]===_0x145b('0x1c')){_0x56a2bc['AccountId']=_0x2e4f96['id'];}else if(_0x2e4f96[_0x145b('0x16')]==='lead'&&_0x2d8f1c['leadId']){_0x56a2bc[_0x2d8f1c[_0x145b('0x1d')]]=_0x2e4f96['id'];}else{logger[_0x145b('0x1e')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4487f2[_0x145b('0x1f')](_0x2d8f1c['ticketType'])['create'](_0x56a2bc);}function getUser(_0xf08b38,_0x158d2e,_0x4ab10f){if(!_[_0x145b('0x20')](_0x158d2e)&&intUtil[_0x145b('0x21')](_0x158d2e)){var _0x38741c={'Email':_0x158d2e};var _0x5b6917={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4ab10f['sobject'](_0x145b('0x22'))['find'](_0x38741c,_0x5b6917)[_0x145b('0x23')]()['then'](function(_0x2fd58f){if(_0x2fd58f[_0x145b('0x24')]){var _0x5a2c9d=_[_0x145b('0x25')](_0x2fd58f,function(_0xc9e9c9){return _0xc9e9c9[_0x145b('0x26')]===_0x158d2e;});if(_0x5a2c9d){logger[_0x145b('0x1e')](_0x145b('0x27'),_0x158d2e);return BPromise[_0x145b('0x28')]({'id':_0x5a2c9d['Id'],'name':_0x5a2c9d[_0x145b('0x29')]});}}else{logger['info'](_0x145b('0x2a'),_0x158d2e);return _0x4ab10f[_0x145b('0x2b')]()[_0x145b('0x2c')](function(_0x2dfe96){return BPromise[_0x145b('0x28')]({'id':_0x2dfe96[_0x145b('0x2d')],'name':_0x2dfe96[_0x145b('0x2e')]});});}});}else{logger[_0x145b('0x1e')](_0x145b('0x2a'),_0x158d2e);return _0x4ab10f[_0x145b('0x2b')]()[_0x145b('0x2c')](function(_0x13bde3){return BPromise[_0x145b('0x28')]({'id':_0x13bde3[_0x145b('0x2d')],'name':_0x13bde3[_0x145b('0x2e')]});});}}function getEndUser(_0x486f11,_0x1da83b,_0x34c5fa,_0x1a8639,_0x3d5a3f){var _0xf37904={'$or':{'Phone':_0x1a8639}};var _0x4f287e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x145b('0x1e')](_0x145b('0x2f'),_0x1a8639,_0x1da83b[_0x145b('0x30')]);switch(_0x1da83b['moduleSearch']){case _0x145b('0x31'):var _0x35fdb5=_['cloneDeep'](_0xf37904);if(_0x1da83b[_0x145b('0x32')]){var _0x9600={};_0x9600[_0x1da83b[_0x145b('0x32')]]=_0x1a8639;_[_0x145b('0x33')](_0x35fdb5[_0x145b('0x34')],_0x9600);}return _0x3d5a3f['sobject']('Contact')[_0x145b('0x25')](_0x35fdb5,_0x4f287e)[_0x145b('0x23')]()['then'](function(_0x127f21){if(_0x127f21&&_0x127f21['length']){return _0x127f21;}else{var _0x51d80f=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b[_0x145b('0x36')]){var _0x133d55={};_0x133d55[_0x1da83b['additionalSearchLead']]=_0x1a8639;_[_0x145b('0x33')](_0x51d80f[_0x145b('0x34')],_0x133d55);}return _0x3d5a3f[_0x145b('0x1f')]('Lead')['find'](_0x51d80f,_0x4f287e);}});case _0x145b('0x37'):var _0x375427=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b[_0x145b('0x38')]){var _0x9600={};_0x9600[_0x1da83b[_0x145b('0x38')]]=_0x1a8639;_['merge'](_0x375427[_0x145b('0x34')],_0x9600);}return _0x3d5a3f[_0x145b('0x1f')](_0x145b('0x39'))['find'](_0x375427,_0x4f287e)[_0x145b('0x23')]()[_0x145b('0x2c')](function(_0x2830c5){if(_0x2830c5&&_0x2830c5[_0x145b('0x24')]){return _0x2830c5;}else{var _0x4a24f5=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b[_0x145b('0x32')]){var _0x9ed17b={};_0x9ed17b[_0x1da83b['additionalSearchContact']]=_0x1a8639;_[_0x145b('0x33')](_0x4a24f5[_0x145b('0x34')],_0x9ed17b);}return _0x3d5a3f[_0x145b('0x1f')](_0x145b('0x3a'))[_0x145b('0x25')](_0x4a24f5,_0x4f287e)[_0x145b('0x2c')](function(_0x5ac42e){if(_0x5ac42e&&_0x5ac42e[_0x145b('0x24')]){return _0x5ac42e;}else{var _0x4f7279=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b['additionalSearchLead']){var _0x3f9844={};_0x3f9844[_0x1da83b[_0x145b('0x36')]]=_0x1a8639;_[_0x145b('0x33')](_0x4f7279['$or'],_0x3f9844);}return _0x3d5a3f['sobject'](_0x145b('0x3b'))['find'](_0x4f7279,_0x4f287e);}});}});case _0x145b('0x1a'):var _0x35fdb5=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b[_0x145b('0x32')]){var _0x9600={};_0x9600[_0x1da83b[_0x145b('0x32')]]=_0x1a8639;_[_0x145b('0x33')](_0x35fdb5[_0x145b('0x34')],_0x9600);}return _0x3d5a3f[_0x145b('0x1f')](_0x145b('0x3a'))[_0x145b('0x25')](_0x35fdb5,_0x4f287e)[_0x145b('0x23')]();case'lead':var _0x52b6e6=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b[_0x145b('0x36')]){var _0x9600={};_0x9600[_0x1da83b[_0x145b('0x36')]]=_0x1a8639;_['merge'](_0x52b6e6['$or'],_0x9600);}return _0x3d5a3f[_0x145b('0x1f')]('Lead')['find'](_0x52b6e6,_0x4f287e);case _0x145b('0x1c'):var _0x375427=_[_0x145b('0x35')](_0xf37904);if(_0x1da83b['additionalSearchAccount']){var _0x9600={};_0x9600[_0x1da83b[_0x145b('0x38')]]=_0x1a8639;_[_0x145b('0x33')](_0x375427[_0x145b('0x34')],_0x9600);}return _0x3d5a3f[_0x145b('0x1f')](_0x145b('0x39'))[_0x145b('0x25')](_0x375427,_0x4f287e);default:return null;}})[_0x145b('0x2c')](function(_0x3b1632){if(_0x3b1632&&_0x3b1632[_0x145b('0x24')]){var _0x5ecb97=_[_0x145b('0x3c')](_0x3b1632);if(_0x5ecb97){return BPromise['resolve']({'id':_0x5ecb97['Id'],'name':_0x5ecb97['Name'],'phone':_0x5ecb97[_0x145b('0x3d')],'endUserType':_0x5ecb97[_0x145b('0x3e')][_0x145b('0x3f')][_0x145b('0x40')]()});}}})[_0x145b('0x2c')](function(_0x17593d){if(_0x17593d){logger[_0x145b('0x1e')](_0x145b('0x41'),_0x17593d['endUserType'],_0x1a8639);return BPromise[_0x145b('0x28')](_0x17593d);}else{logger['info'](_0x145b('0x42'),_0x1a8639);var _0x32485c={'Phone':_0x1a8639};if(_0x1da83b[_0x145b('0x43')]){if(_0x1da83b[_0x145b('0x43')]==='contact'){logger[_0x145b('0x1e')](_0x145b('0x44'),_0x1a8639,_0x1da83b[_0x145b('0x43')]);_0x32485c['LastName']=_0x34c5fa!==_0x145b('0x45')?_0x34c5fa:util[_0x145b('0x46')](_0x145b('0x47'),_0x1a8639);}else if(_0x1da83b[_0x145b('0x43')]==='lead'){logger[_0x145b('0x1e')](_0x145b('0x44'),_0x1a8639,_0x1da83b[_0x145b('0x43')]);_0x32485c[_0x145b('0x48')]=_0x34c5fa!==_0x145b('0x45')?_0x34c5fa:util[_0x145b('0x46')](_0x145b('0x47'),_0x1a8639);_0x32485c[_0x145b('0x49')]=_0x145b('0x4a');}else if(_0x1da83b[_0x145b('0x43')]==='account'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1a8639,_0x1da83b[_0x145b('0x43')]);_0x32485c[_0x145b('0x29')]=_0x34c5fa!==''?_0x34c5fa:util[_0x145b('0x46')](_0x145b('0x47'),_0x1a8639);}else{return null;}}return _0x3d5a3f[_0x145b('0x1f')](_[_0x145b('0x4b')](_0x1da83b[_0x145b('0x43')]))[_0x145b('0x4c')](_0x32485c)[_0x145b('0x2c')](function(_0x582e5b){return BPromise[_0x145b('0x28')]({'id':_0x582e5b['id'],'endUserType':_0x1da83b[_0x145b('0x43')]});});}});}function getCustomFields(_0x370825,_0x4cbdc6){var _0x2f742e={};if(_0x370825[_0x145b('0x24')]>0x0){_[_0x145b('0x4d')](_0x370825,function(_0x3a2b1d){if(_['includes']([_0x145b('0x4e'),_0x145b('0x4f')],_0x3a2b1d['type'])&&_0x3a2b1d[_0x145b('0x50')]){_0x2f742e[_0x3a2b1d['idField']]=_0x3a2b1d[_0x145b('0x51')][_0x145b('0x52')]();}else if(_0x3a2b1d['type']==='variable'&&_0x3a2b1d[_0x145b('0x53')]&&_0x3a2b1d['idField']){_0x4cbdc6[_0x3a2b1d['variableName']]&&(_0x2f742e[_0x3a2b1d['idField']]=_0x4cbdc6[_0x3a2b1d['variableName']][_0x145b('0x52')]());}else if(_0x3a2b1d[_0x145b('0x3f')]==='customVariable'&&_0x3a2b1d[_0x145b('0x54')]&&_0x3a2b1d[_0x145b('0x54')][_0x145b('0x55')]&&_0x3a2b1d[_0x145b('0x50')]){_0x4cbdc6[_0x3a2b1d[_0x145b('0x54')]['name'][_0x145b('0x40')]()]&&(_0x2f742e[_0x3a2b1d[_0x145b('0x50')]]=_0x4cbdc6[_0x3a2b1d[_0x145b('0x54')][_0x145b('0x55')][_0x145b('0x40')]()][_0x145b('0x52')]());}});}return _0x2f742e;}function getConnection(_0x4867a1){var _0x13bba9=_0x4867a1[_0x145b('0x56')][_0x145b('0x57')](_0x4867a1[_0x145b('0x58')]);var _0xb5e3cd=new jsforce[(_0x145b('0x59'))]({'oauth2':{'loginUrl':_0x4867a1[_0x145b('0x5a')]||_0x145b('0x5b'),'clientId':_0x4867a1[_0x145b('0x5c')],'clientSecret':_0x4867a1[_0x145b('0x5d')]}});return _0xb5e3cd[_0x145b('0x5e')](_0x4867a1[_0x145b('0x5f')],_0x13bba9)[_0x145b('0x2c')](function(){logger[_0x145b('0x1e')](_0x145b('0x60'));return _0xb5e3cd;});}exports[_0x145b('0x61')]=function(_0x2a020d,_0x8675ee,_0x24751d,_0x285099,_0x3a8450,_0xb86e0e){var _0x148bd8,_0x185295,_0x3bf28e,_0x379f9c;_0xb86e0e[_0x145b('0x62')]=intUtil[_0x145b('0x63')](_0xb86e0e[_0x145b('0x62')]);_0xb86e0e[_0x145b('0x5a')]=intUtil['stripTrailingSlash'](_0xb86e0e[_0x145b('0x5a')]);if(_0x3a8450&&_0x3a8450[_0x145b('0x64')]){logger[_0x145b('0x1e')](_0x145b('0x65'),'Recording\x20is\x20enabled!');_0x8675ee[_0x145b('0x66')]=util[_0x145b('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb86e0e[_0x145b('0x62')],_0x8675ee[_0x145b('0x67')],md5(_0x8675ee[_0x145b('0x67')]));}else{_0x8675ee[_0x145b('0x66')]='';}return getConnection(_0xb86e0e)[_0x145b('0x2c')](function(_0x586271){_0x379f9c=_0x586271;return getUser(_0xb86e0e,_0x285099['email'],_0x379f9c);})[_0x145b('0x2c')](function(_0x9b2238){_0x148bd8=_0x9b2238;return getEndUser(_0xb86e0e,_0x24751d,_0x8675ee[_0x145b('0x68')],_0x8675ee[_0x145b('0x69')],_0x379f9c);})['then'](function(_0x3cddc5){_0x185295=_0x3cddc5;return getTicket(_0xb86e0e,_0x148bd8,_0x185295,_0x24751d,_0x8675ee,_0x24751d[_0x145b('0x6a')],_0x379f9c,_0x145b('0x61'));})[_0x145b('0x2c')](function(_0x2a6c8f){_0x3bf28e=_0x2a6c8f;logger['info'](_0x145b('0x6b'),_0x3bf28e['id']);logger[_0x145b('0x1e')](_0x145b('0x6c'),_0x3bf28e['id'],_0x285099[_0x145b('0x55')],_0xb86e0e[_0x145b('0x3f')]);switch(_0xb86e0e['type']){case _0x145b('0x6d'):emit(util[_0x145b('0x46')](_0x145b('0x6e'),_0x285099[_0x145b('0x55')]),_0x145b('0x6f'),{'recordId':_0x3bf28e['id']});break;case _0x145b('0x70'):emit(util[_0x145b('0x46')](_0x145b('0x6e'),_0x285099[_0x145b('0x55')]),_0x145b('0x71'),{'uri':util[_0x145b('0x46')](_0x145b('0x72'),_0x379f9c[_0x145b('0x73')],_0x3bf28e['id'])});break;default:logger['error'](_0x145b('0x74'));}})[_0x145b('0x75')](function(_0x4a0cce){logger[_0x145b('0x76')](_0x145b('0x65'),_0x4a0cce);});};exports[_0x145b('0x77')]=function(_0x374fbc,_0x46403e,_0x527b53,_0x534f85,_0x4d3582,_0x234e2d,_0x5383d3){var _0x292829,_0x234d10,_0x1b2308,_0x29e39e;_0x234e2d[_0x145b('0x62')]=intUtil[_0x145b('0x63')](_0x234e2d[_0x145b('0x62')]);_0x234e2d[_0x145b('0x5a')]=intUtil[_0x145b('0x63')](_0x234e2d[_0x145b('0x5a')]);if(_0x5383d3&&_0x5383d3[_0x145b('0x78')]&&_0x5383d3[_0x145b('0x78')]!==_0x145b('0x79')){logger['info'](_0x145b('0x7a'),_0x145b('0x7b'));_0x46403e[_0x145b('0x66')]=util[_0x145b('0x46')](_0x145b('0x7c'),_0x234e2d[_0x145b('0x62')],_0x46403e[_0x145b('0x67')],md5(_0x46403e[_0x145b('0x67')]));}return getConnection(_0x234e2d)[_0x145b('0x2c')](function(_0x4fa5e3){_0x29e39e=_0x4fa5e3;return getUser(_0x234e2d,_0x534f85[_0x145b('0x7d')],_0x29e39e);})[_0x145b('0x2c')](function(_0x24b3d0){_0x292829=_0x24b3d0;return getEndUser(_0x234e2d,_0x527b53,_0x46403e[_0x145b('0x7e')],_0x46403e[_0x145b('0x7f')],_0x29e39e);})[_0x145b('0x2c')](function(_0xc66f57){_0x234d10=_0xc66f57;return getTicket(_0x234e2d,_0x292829,_0x234d10,_0x527b53,_0x46403e,_0x527b53[_0x145b('0x6a')],_0x29e39e,_0x145b('0x77'));})['then'](function(_0x48153b){_0x1b2308=_0x48153b;logger[_0x145b('0x1e')](_0x145b('0x80'),_0x1b2308['id']);logger[_0x145b('0x1e')](_0x145b('0x81'),_0x1b2308['id'],_0x534f85['name'],_0x234e2d[_0x145b('0x3f')]);switch(_0x234e2d[_0x145b('0x3f')]){case _0x145b('0x6d'):emit(util[_0x145b('0x46')]('user:%s',_0x534f85[_0x145b('0x55')]),'trigger:salesforce:display',{'recordId':_0x1b2308['id']});break;case'newTab':emit(util[_0x145b('0x46')]('user:%s',_0x534f85[_0x145b('0x55')]),_0x145b('0x71'),{'uri':util[_0x145b('0x46')](_0x145b('0x72'),_0x29e39e[_0x145b('0x73')],_0x1b2308['id'])});break;default:logger[_0x145b('0x76')](_0x145b('0x7a'),_0x145b('0x82'));}})['catch'](function(_0x345865){logger[_0x145b('0x76')](_0x145b('0x7a'),_0x345865);});};exports[_0x145b('0x83')]=function(_0x27126e,_0x2c6fc5,_0x2a45a3,_0x47e2ef,_0x3689f9,_0x45cce1){var _0xbeda88,_0x2da366,_0x17fca8,_0x145491;_0x45cce1[_0x145b('0x62')]=intUtil[_0x145b('0x63')](_0x45cce1['serverUrl']);_0x45cce1[_0x145b('0x5a')]=intUtil['stripTrailingSlash'](_0x45cce1[_0x145b('0x5a')]);if(_0x3689f9&&_0x3689f9[_0x145b('0x64')]){logger[_0x145b('0x1e')]('['+_0x2c6fc5[_0x145b('0x84')][_0x145b('0x85')]()+']','Recording\x20is\x20enabled!');_0x2c6fc5[_0x145b('0x66')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45cce1[_0x145b('0x62')],_0x2c6fc5[_0x145b('0x67')],md5(_0x2c6fc5[_0x145b('0x67')]));}else{_0x2c6fc5[_0x145b('0x66')]='';}return getConnection(_0x45cce1)['then'](function(_0x4c3641){_0x145491=_0x4c3641;if(!_[_0x145b('0x20')](_0x47e2ef)){return getUser(_0x45cce1,_0x47e2ef['name'],_0x145491);}else{return getUser(_0x45cce1,null,_0x145491);}})[_0x145b('0x2c')](function(_0x282b26){_0xbeda88=_0x282b26;return getEndUser(_0x45cce1,_0x2a45a3,_0x2c6fc5['calleridname'],_0x2c6fc5[_0x145b('0x69')],_0x145491);})[_0x145b('0x2c')](function(_0x1fbefd){_0x2da366=_0x1fbefd;return getTicket(_0x45cce1,_0xbeda88,_0x2da366,_0x2a45a3,_0x2c6fc5,_0x2a45a3['Fields'],_0x145491);})[_0x145b('0x2c')](function(_0x7e86f7){_0x17fca8=_0x7e86f7;logger['info']('['+_0x2c6fc5[_0x145b('0x84')]['toUpperCase']()+_0x145b('0x86'),_0x17fca8['id']);logger[_0x145b('0x1e')]('['+_0x2c6fc5['lastevent'][_0x145b('0x85')]()+_0x145b('0x87'),_0x45cce1[_0x145b('0x3f')]);})[_0x145b('0x75')](function(_0x59e899){logger[_0x145b('0x76')]('['+_0x2c6fc5[_0x145b('0x84')][_0x145b('0x85')]()+']',_0x59e899);});}; \ No newline at end of file +var _0x55b2=['No\x20Company','format','upperFirst','forEach','includes','string','idField','content','toString','variable','variableName','Variable','name','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','Task','utc','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','AccountId','leadId','info','sobject','create','validateEmail','then','length','find','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','$or','Contact','execute','cloneDeep','additionalSearchLead','Lead','additionalSearchAccount','Account','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company'];(function(_0x1e7dcb,_0x2c58c7){var _0x5d3b2e=function(_0x3da63d){while(--_0x3da63d){_0x1e7dcb['push'](_0x1e7dcb['shift']());}};_0x5d3b2e(++_0x2c58c7);}(_0x55b2,0x1a6));var _0x255b=function(_0x50d853,_0x395c09){_0x50d853=_0x50d853-0x0;var _0x28b4f0=_0x55b2[_0x50d853];return _0x28b4f0;};'use strict';var _=require(_0x255b('0x0'));var rp=require(_0x255b('0x1'));var moment=require(_0x255b('0x2'));var BPromise=require('bluebird');var md5=require(_0x255b('0x3'));var jsforce=require(_0x255b('0x4'));var util=require('util');var Redis=require(_0x255b('0x5'));var intUtil=require(_0x255b('0x6'));var config=require(_0x255b('0x7'));var logger=require(_0x255b('0x8'))('salesforce');config['redis']=_['defaults'](config[_0x255b('0x9')],{'host':_0x255b('0xa'),'port':0x18eb});var io=require(_0x255b('0xb'))(new Redis(config[_0x255b('0x9')]));function emit(_0x11bca,_0x3bbacf,_0x1afb0c){io['to'](_0x11bca)[_0x255b('0xc')](_0x3bbacf,_0x1afb0c);}function getTicket(_0x58b3aa,_0x13a359,_0x388cdc,_0x264920,_0x352ad8,_0xbdc2e3,_0x27eb9e,_0x4e8cd9){var _0x11de24=Object[_0x255b('0xd')]({},{'OwnerId':_0x13a359['id'],'Subject':intUtil[_0x255b('0xe')](_0x264920[_0x255b('0xf')],_0x352ad8,'\x20'),'Description':intUtil[_0x255b('0xe')](_0x264920['Descriptions'],_0x352ad8,'\x0a')},getCustomFields(_0xbdc2e3,_0x352ad8));if(_0x388cdc){if(_0x264920[_0x255b('0x10')]===_0x255b('0x11')){_0x11de24['ActivityDate']=moment[_0x255b('0x12')]();_0x11de24['IsReminderSet']=![];_0x11de24[_0x255b('0x13')]=![];if(_0x388cdc[_0x255b('0x14')]===_0x255b('0x15')||_0x388cdc['endUserType']===_0x255b('0x16')){_0x11de24['WhoId']=_0x388cdc['id'];}else if(_0x388cdc[_0x255b('0x14')]===_0x255b('0x17')){_0x11de24[_0x255b('0x18')]=_0x388cdc['id'];}}else if(_0x264920[_0x255b('0x10')]===_0x255b('0x19')){if(_0x388cdc[_0x255b('0x14')]===_0x255b('0x15')){_0x11de24[_0x255b('0x1a')]=_0x388cdc['id'];}else if(_0x388cdc[_0x255b('0x14')]===_0x255b('0x17')){_0x11de24[_0x255b('0x1b')]=_0x388cdc['id'];}else if(_0x388cdc[_0x255b('0x14')]===_0x255b('0x16')&&_0x264920[_0x255b('0x1c')]){_0x11de24[_0x264920[_0x255b('0x1c')]]=_0x388cdc['id'];}else{logger[_0x255b('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x27eb9e[_0x255b('0x1e')](_0x264920[_0x255b('0x10')])[_0x255b('0x1f')](_0x11de24);}function getUser(_0x10dc54,_0x5779c9,_0x5e0ee0){if(!_['isNil'](_0x5779c9)&&intUtil[_0x255b('0x20')](_0x5779c9)){var _0x36d2da={'Email':_0x5779c9};var _0x450b34={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5e0ee0[_0x255b('0x1e')]('User')['find'](_0x36d2da,_0x450b34)['execute']()[_0x255b('0x21')](function(_0x33114f){if(_0x33114f[_0x255b('0x22')]){var _0x40cb8d=_[_0x255b('0x23')](_0x33114f,function(_0x2d307b){return _0x2d307b[_0x255b('0x24')]===_0x5779c9;});if(_0x40cb8d){logger['info'](_0x255b('0x25'),_0x5779c9);return BPromise['resolve']({'id':_0x40cb8d['Id'],'name':_0x40cb8d['Name']});}}else{logger[_0x255b('0x1d')](_0x255b('0x26'),_0x5779c9);return _0x5e0ee0['identity']()['then'](function(_0x4ab84a){return BPromise[_0x255b('0x27')]({'id':_0x4ab84a[_0x255b('0x28')],'name':_0x4ab84a[_0x255b('0x29')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5779c9);return _0x5e0ee0['identity']()['then'](function(_0x2ab956){return BPromise[_0x255b('0x27')]({'id':_0x2ab956[_0x255b('0x28')],'name':_0x2ab956[_0x255b('0x29')]});});}}function getEndUser(_0x32ea3b,_0x43a26b,_0x3a8343,_0x43cb48,_0x306b85){var _0x3256f0={'$or':{'Phone':_0x43cb48}};var _0x24c773={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x255b('0x27')]()[_0x255b('0x21')](function(){logger['info'](_0x255b('0x2a'),_0x43cb48,_0x43a26b[_0x255b('0x2b')]);switch(_0x43a26b[_0x255b('0x2b')]){case'contact_lead':var _0x548f72=_['cloneDeep'](_0x3256f0);if(_0x43a26b[_0x255b('0x2c')]){var _0x313145={};_0x313145[_0x43a26b[_0x255b('0x2c')]]=_0x43cb48;_[_0x255b('0x2d')](_0x548f72[_0x255b('0x2e')],_0x313145);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x2f'))[_0x255b('0x23')](_0x548f72,_0x24c773)[_0x255b('0x30')]()[_0x255b('0x21')](function(_0x2c2c17){if(_0x2c2c17&&_0x2c2c17[_0x255b('0x22')]){return _0x2c2c17;}else{var _0x1b0fce=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x32')]){var _0x5acfc1={};_0x5acfc1[_0x43a26b['additionalSearchLead']]=_0x43cb48;_['merge'](_0x1b0fce[_0x255b('0x2e')],_0x5acfc1);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x33'))[_0x255b('0x23')](_0x1b0fce,_0x24c773);}});case'account_contact_lead':var _0x4545e7=_['cloneDeep'](_0x3256f0);if(_0x43a26b[_0x255b('0x34')]){var _0x313145={};_0x313145[_0x43a26b['additionalSearchAccount']]=_0x43cb48;_[_0x255b('0x2d')](_0x4545e7[_0x255b('0x2e')],_0x313145);}return _0x306b85['sobject'](_0x255b('0x35'))[_0x255b('0x23')](_0x4545e7,_0x24c773)['execute']()['then'](function(_0x5b5cbe){if(_0x5b5cbe&&_0x5b5cbe[_0x255b('0x22')]){return _0x5b5cbe;}else{var _0x39f6b8=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x2c')]){var _0x538768={};_0x538768[_0x43a26b[_0x255b('0x2c')]]=_0x43cb48;_[_0x255b('0x2d')](_0x39f6b8['$or'],_0x538768);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x2f'))[_0x255b('0x23')](_0x39f6b8,_0x24c773)[_0x255b('0x21')](function(_0x2ef086){if(_0x2ef086&&_0x2ef086[_0x255b('0x22')]){return _0x2ef086;}else{var _0x2a6730=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x32')]){var _0x1ef446={};_0x1ef446[_0x43a26b[_0x255b('0x32')]]=_0x43cb48;_[_0x255b('0x2d')](_0x2a6730[_0x255b('0x2e')],_0x1ef446);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x33'))[_0x255b('0x23')](_0x2a6730,_0x24c773);}});}});case'contact':var _0x548f72=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x2c')]){var _0x313145={};_0x313145[_0x43a26b[_0x255b('0x2c')]]=_0x43cb48;_['merge'](_0x548f72[_0x255b('0x2e')],_0x313145);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x2f'))[_0x255b('0x23')](_0x548f72,_0x24c773)[_0x255b('0x30')]();case _0x255b('0x16'):var _0x20a974=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x32')]){var _0x313145={};_0x313145[_0x43a26b['additionalSearchLead']]=_0x43cb48;_[_0x255b('0x2d')](_0x20a974[_0x255b('0x2e')],_0x313145);}return _0x306b85[_0x255b('0x1e')](_0x255b('0x33'))[_0x255b('0x23')](_0x20a974,_0x24c773);case _0x255b('0x17'):var _0x4545e7=_[_0x255b('0x31')](_0x3256f0);if(_0x43a26b[_0x255b('0x34')]){var _0x313145={};_0x313145[_0x43a26b[_0x255b('0x34')]]=_0x43cb48;_[_0x255b('0x2d')](_0x4545e7['$or'],_0x313145);}return _0x306b85['sobject']('Account')[_0x255b('0x23')](_0x4545e7,_0x24c773);default:return null;}})[_0x255b('0x21')](function(_0x21fa33){if(_0x21fa33&&_0x21fa33[_0x255b('0x22')]){var _0x420d2a=_['first'](_0x21fa33);if(_0x420d2a){return BPromise[_0x255b('0x27')]({'id':_0x420d2a['Id'],'name':_0x420d2a[_0x255b('0x36')],'phone':_0x420d2a[_0x255b('0x37')],'endUserType':_0x420d2a[_0x255b('0x38')][_0x255b('0x39')][_0x255b('0x3a')]()});}}})[_0x255b('0x21')](function(_0x262996){if(_0x262996){logger[_0x255b('0x1d')](_0x255b('0x3b'),_0x262996[_0x255b('0x14')],_0x43cb48);return BPromise[_0x255b('0x27')](_0x262996);}else{logger[_0x255b('0x1d')](_0x255b('0x3c'),_0x43cb48);var _0x1c9fca={'Phone':_0x43cb48};if(_0x43a26b['moduleCreate']){if(_0x43a26b['moduleCreate']===_0x255b('0x15')){logger[_0x255b('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x43cb48,_0x43a26b[_0x255b('0x3d')]);_0x1c9fca['LastName']=_0x3a8343!==_0x255b('0x3e')?_0x3a8343:util['format'](_0x255b('0x3f'),_0x43cb48);}else if(_0x43a26b[_0x255b('0x3d')]===_0x255b('0x16')){logger['info'](_0x255b('0x40'),_0x43cb48,_0x43a26b[_0x255b('0x3d')]);_0x1c9fca['LastName']=_0x3a8343!==_0x255b('0x3e')?_0x3a8343:util['format'](_0x255b('0x3f'),_0x43cb48);_0x1c9fca[_0x255b('0x41')]=_0x255b('0x42');}else if(_0x43a26b[_0x255b('0x3d')]===_0x255b('0x17')){logger[_0x255b('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x43cb48,_0x43a26b[_0x255b('0x3d')]);_0x1c9fca[_0x255b('0x36')]=_0x3a8343!==_0x255b('0x3e')?_0x3a8343:util[_0x255b('0x43')]('Caller\x20-\x20%s',_0x43cb48);}else{return null;}}return _0x306b85['sobject'](_[_0x255b('0x44')](_0x43a26b['moduleCreate']))[_0x255b('0x1f')](_0x1c9fca)[_0x255b('0x21')](function(_0x5072cf){return BPromise['resolve']({'id':_0x5072cf['id'],'endUserType':_0x43a26b[_0x255b('0x3d')]});});}});}function getCustomFields(_0x4cef53,_0x13ec55){var _0x5c8b13={};if(_0x4cef53[_0x255b('0x22')]>0x0){_[_0x255b('0x45')](_0x4cef53,function(_0x7adfc1){if(_[_0x255b('0x46')]([_0x255b('0x47'),'picklist'],_0x7adfc1[_0x255b('0x39')])&&_0x7adfc1[_0x255b('0x48')]){_0x5c8b13[_0x7adfc1['idField']]=_0x7adfc1[_0x255b('0x49')][_0x255b('0x4a')]();}else if(_0x7adfc1[_0x255b('0x39')]===_0x255b('0x4b')&&_0x7adfc1['variableName']&&_0x7adfc1['idField']){_0x13ec55[_0x7adfc1[_0x255b('0x4c')]]&&(_0x5c8b13[_0x7adfc1[_0x255b('0x48')]]=_0x13ec55[_0x7adfc1[_0x255b('0x4c')]][_0x255b('0x4a')]());}else if(_0x7adfc1[_0x255b('0x39')]==='customVariable'&&_0x7adfc1[_0x255b('0x4d')]&&_0x7adfc1[_0x255b('0x4d')][_0x255b('0x4e')]&&_0x7adfc1['idField']){_0x13ec55[_0x7adfc1[_0x255b('0x4d')]['name'][_0x255b('0x3a')]()]&&(_0x5c8b13[_0x7adfc1[_0x255b('0x48')]]=_0x13ec55[_0x7adfc1[_0x255b('0x4d')]['name'][_0x255b('0x3a')]()][_0x255b('0x4a')]());}});}return _0x5c8b13;}function getConnection(_0x48daad){var _0x529633=_0x48daad['password']['concat'](_0x48daad[_0x255b('0x4f')]);var _0x17da9b=new jsforce[(_0x255b('0x50'))]({'oauth2':{'loginUrl':_0x48daad['remoteUri']||_0x255b('0x51'),'clientId':_0x48daad[_0x255b('0x52')],'clientSecret':_0x48daad[_0x255b('0x53')]}});return _0x17da9b['login'](_0x48daad['username'],_0x529633)['then'](function(){logger[_0x255b('0x1d')](_0x255b('0x54'));return _0x17da9b;});}exports['queue']=function(_0x269e13,_0x3347c3,_0x315db6,_0x4a041c,_0x242912,_0x298c6e){var _0x3e3080,_0x4d7321,_0x2b0cf3,_0x3a9a19;_0x298c6e[_0x255b('0x55')]=intUtil[_0x255b('0x56')](_0x298c6e['serverUrl']);_0x298c6e[_0x255b('0x57')]=intUtil['stripTrailingSlash'](_0x298c6e['remoteUri']);if(_0x242912&&_0x242912['monitor_format']){logger[_0x255b('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3347c3[_0x255b('0x58')]=util[_0x255b('0x43')](_0x255b('0x59'),_0x298c6e[_0x255b('0x55')],_0x3347c3['uniqueid'],md5(_0x3347c3[_0x255b('0x5a')]));}else{_0x3347c3[_0x255b('0x58')]='';}return getConnection(_0x298c6e)[_0x255b('0x21')](function(_0x37e920){_0x3a9a19=_0x37e920;return getUser(_0x298c6e,_0x4a041c[_0x255b('0x5b')],_0x3a9a19);})[_0x255b('0x21')](function(_0x30d12f){_0x3e3080=_0x30d12f;return getEndUser(_0x298c6e,_0x315db6,_0x3347c3[_0x255b('0x5c')],_0x3347c3[_0x255b('0x5d')],_0x3a9a19);})['then'](function(_0x144c5e){_0x4d7321=_0x144c5e;return getTicket(_0x298c6e,_0x3e3080,_0x4d7321,_0x315db6,_0x3347c3,_0x315db6[_0x255b('0x5e')],_0x3a9a19,_0x255b('0x5f'));})[_0x255b('0x21')](function(_0xc9e26e){_0x2b0cf3=_0xc9e26e;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x2b0cf3['id']);logger[_0x255b('0x1d')](_0x255b('0x60'),_0x2b0cf3['id'],_0x4a041c[_0x255b('0x4e')],_0x298c6e[_0x255b('0x39')]);switch(_0x298c6e[_0x255b('0x39')]){case'integrationTab':emit(util[_0x255b('0x43')](_0x255b('0x61'),_0x4a041c[_0x255b('0x4e')]),'trigger:salesforce:display',{'recordId':_0x2b0cf3['id']});break;case _0x255b('0x62'):emit(util[_0x255b('0x43')]('user:%s',_0x4a041c[_0x255b('0x4e')]),_0x255b('0x63'),{'uri':util[_0x255b('0x43')]('%s/%s/e',_0x3a9a19[_0x255b('0x64')],_0x2b0cf3['id'])});break;default:logger[_0x255b('0x65')](_0x255b('0x66'));}})[_0x255b('0x67')](function(_0x3f15a0){logger['error'](_0x255b('0x68'),_0x3f15a0);});};exports[_0x255b('0x69')]=function(_0x53fb12,_0x1982dd,_0x57172e,_0x2e5d8c,_0x9a20dc,_0x3e1497,_0x422ce8){var _0x3bf9d5,_0x4ee4c6,_0x5a1b7e,_0x4e3246;_0x3e1497[_0x255b('0x55')]=intUtil[_0x255b('0x56')](_0x3e1497[_0x255b('0x55')]);_0x3e1497[_0x255b('0x57')]=intUtil['stripTrailingSlash'](_0x3e1497[_0x255b('0x57')]);if(_0x422ce8&&_0x422ce8[_0x255b('0x6a')]&&_0x422ce8[_0x255b('0x6a')]!==_0x255b('0x6b')){logger[_0x255b('0x1d')](_0x255b('0x6c'),_0x255b('0x6d'));_0x1982dd[_0x255b('0x58')]=util[_0x255b('0x43')](_0x255b('0x59'),_0x3e1497['serverUrl'],_0x1982dd[_0x255b('0x5a')],md5(_0x1982dd[_0x255b('0x5a')]));}return getConnection(_0x3e1497)[_0x255b('0x21')](function(_0x2e2c9f){_0x4e3246=_0x2e2c9f;return getUser(_0x3e1497,_0x2e5d8c[_0x255b('0x5b')],_0x4e3246);})[_0x255b('0x21')](function(_0x456752){_0x3bf9d5=_0x456752;return getEndUser(_0x3e1497,_0x57172e,_0x1982dd[_0x255b('0x6e')],_0x1982dd[_0x255b('0x6f')],_0x4e3246);})[_0x255b('0x21')](function(_0xc3efbd){_0x4ee4c6=_0xc3efbd;return getTicket(_0x3e1497,_0x3bf9d5,_0x4ee4c6,_0x57172e,_0x1982dd,_0x57172e[_0x255b('0x5e')],_0x4e3246,_0x255b('0x69'));})['then'](function(_0x51da9f){_0x5a1b7e=_0x51da9f;logger[_0x255b('0x1d')](_0x255b('0x70'),_0x5a1b7e['id']);logger[_0x255b('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5a1b7e['id'],_0x2e5d8c[_0x255b('0x4e')],_0x3e1497[_0x255b('0x39')]);switch(_0x3e1497[_0x255b('0x39')]){case _0x255b('0x71'):emit(util[_0x255b('0x43')](_0x255b('0x61'),_0x2e5d8c[_0x255b('0x4e')]),'trigger:salesforce:display',{'recordId':_0x5a1b7e['id']});break;case _0x255b('0x62'):emit(util[_0x255b('0x43')](_0x255b('0x61'),_0x2e5d8c[_0x255b('0x4e')]),'trigger:browser:url',{'uri':util[_0x255b('0x43')](_0x255b('0x72'),_0x4e3246[_0x255b('0x64')],_0x5a1b7e['id'])});break;default:logger[_0x255b('0x65')](_0x255b('0x6c'),_0x255b('0x73'));}})[_0x255b('0x67')](function(_0x424fb9){logger[_0x255b('0x65')]('[OUTBOUND]',_0x424fb9);});};exports[_0x255b('0x74')]=function(_0x52bb05,_0xa359f8,_0x5cc7ee,_0x44c634,_0x2dc13a,_0x437eca){var _0x46eea6,_0x56b57f,_0x47bf78,_0x530362;_0x437eca['serverUrl']=intUtil['stripTrailingSlash'](_0x437eca['serverUrl']);_0x437eca[_0x255b('0x57')]=intUtil[_0x255b('0x56')](_0x437eca[_0x255b('0x57')]);if(_0x2dc13a&&_0x2dc13a[_0x255b('0x75')]){logger['info']('['+_0xa359f8[_0x255b('0x76')][_0x255b('0x77')]()+']',_0x255b('0x6d'));_0xa359f8['recordingURL']=util['format'](_0x255b('0x59'),_0x437eca[_0x255b('0x55')],_0xa359f8['uniqueid'],md5(_0xa359f8[_0x255b('0x5a')]));}else{_0xa359f8[_0x255b('0x58')]='';}return getConnection(_0x437eca)[_0x255b('0x21')](function(_0x43ab2e){_0x530362=_0x43ab2e;if(!_['isNil'](_0x44c634)){return getUser(_0x437eca,_0x44c634[_0x255b('0x4e')],_0x530362);}else{return getUser(_0x437eca,null,_0x530362);}})['then'](function(_0xca68fd){_0x46eea6=_0xca68fd;return getEndUser(_0x437eca,_0x5cc7ee,_0xa359f8[_0x255b('0x5c')],_0xa359f8[_0x255b('0x5d')],_0x530362);})[_0x255b('0x21')](function(_0x3ad480){_0x56b57f=_0x3ad480;return getTicket(_0x437eca,_0x46eea6,_0x56b57f,_0x5cc7ee,_0xa359f8,_0x5cc7ee[_0x255b('0x5e')],_0x530362);})['then'](function(_0x1b948a){_0x47bf78=_0x1b948a;logger[_0x255b('0x1d')]('['+_0xa359f8[_0x255b('0x76')][_0x255b('0x77')]()+_0x255b('0x78'),_0x47bf78['id']);logger[_0x255b('0x1d')]('['+_0xa359f8[_0x255b('0x76')][_0x255b('0x77')]()+_0x255b('0x79'),_0x437eca[_0x255b('0x39')]);})[_0x255b('0x67')](function(_0x4d3a7d){logger['error']('['+_0xa359f8[_0x255b('0x76')][_0x255b('0x77')]()+']',_0x4d3a7d);});}; \ 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 ff1b002..0763854 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 _0x74f1=['customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','GET','active','true','userId','userEmail','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','picklist','customField','toLowerCase','includes','string','type','idField','content','toString','variableName'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x74f1,0x15e));var _0x174f=function(_0xfc959c,_0x4660c){_0xfc959c=_0xfc959c-0x0;var _0xa12959=_0x74f1[_0xfc959c];return _0xa12959;};'use strict';var _=require(_0x174f('0x0'));var Promise=require('bluebird');var rp=require(_0x174f('0x1'));var util=require('util');var md5=require(_0x174f('0x2'));var Redis=require(_0x174f('0x3'));var intUtil=require(_0x174f('0x4'));var config=require(_0x174f('0x5'));var logger=require(_0x174f('0x6'))(_0x174f('0x7'));config['redis']=_[_0x174f('0x8')](config[_0x174f('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x174f('0x9')]));function getAdminUser(_0x4006f1,_0x5987c3,_0x35d03a,_0x4cd083,_0x3baf27,_0x1a18b9){return new Promise(function(_0x4a9dac,_0x2e1786){var _0x2d22f1={'method':'GET','uri':_0x4cd083+_0x174f('0xa')+'&'+_0x3baf27+'&'+_0x1a18b9,'auth':_0x5987c3,'json':!![]};return rp(_0x2d22f1)[_0x174f('0xb')](function(_0x2827e1){if(_0x2827e1['result'][_0x174f('0xc')]>0x0){_0x35d03a[_0x174f('0xd')]=_0x2827e1[_0x174f('0xe')][0x0][_0x174f('0xf')];}logger[_0x174f('0x10')]('['+[_0x4006f1[_0x174f('0x11')]()]+'],\x20getAdminUser\x20crm',_0x35d03a);_0x4a9dac(_0x35d03a);})[_0x174f('0x12')](function(_0x2addc2){logger[_0x174f('0x13')]('['+[_0x4006f1[_0x174f('0x11')]()]+']',_0x2addc2[_0x174f('0x14')]);_0x2e1786(_0x2addc2[_0x174f('0x14')]);});});}function getUser(_0x42bb6b,_0xed92e5,_0x3c64bc,_0x1ab1e7,_0x560c8a){return function(_0x390713){logger['info']('['+[_0x42bb6b[_0x174f('0x11')]()]+_0x174f('0x15'),_0x390713);return new Promise(function(_0x1fc30d,_0x80646d){if(intUtil['validateEmail'](_0x390713['userEmail'])){var _0x524fd6={'method':_0x174f('0x16'),'uri':_0x3c64bc+'sys_user?sysparm_query=email%3D'+_0x390713['userEmail']+'&'+_0x1ab1e7+'&'+_0x560c8a,'auth':_0xed92e5,'json':!![]};logger[_0x174f('0x10')]('['+[_0x42bb6b[_0x174f('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x524fd6);return rp(_0x524fd6)[_0x174f('0xb')](function(_0x5fd78d){logger[_0x174f('0x10')]('['+[_0x42bb6b[_0x174f('0x11')]()]+'],\x20getUser\x20entity',_0x5fd78d);if(_0x5fd78d[_0x174f('0xe')][_0x174f('0xc')]>0x0&&String(_0x5fd78d[_0x174f('0xe')][0x0][_0x174f('0x17')])===_0x174f('0x18')){_0x390713[_0x174f('0x19')]=_0x5fd78d[_0x174f('0xe')][0x0][_0x174f('0xf')];}else{_0x390713[_0x174f('0x19')]=_0x390713[_0x174f('0xd')];_0x390713[_0x174f('0x1a')]=_0x390713[_0x174f('0x1b')];}logger[_0x174f('0x10')]('['+[_0x42bb6b[_0x174f('0x11')]()]+'],\x20getUser\x20crm',_0x390713);_0x1fc30d(_0x390713);})[_0x174f('0x12')](function(_0xb9afa9){logger['error']('['+[_0x42bb6b[_0x174f('0x11')]()]+']',_0xb9afa9[_0x174f('0x14')]);_0x80646d(_0xb9afa9[_0x174f('0x14')]);});}else{logger[_0x174f('0x10')]('['+[_0x42bb6b[_0x174f('0x11')]()]+']\x20using\x20admin\x20profile');_0x390713['userId']=_0x390713[_0x174f('0xd')];_0x390713[_0x174f('0x1a')]=_0x390713[_0x174f('0x1b')];_0x1fc30d(_0x390713);}});};}function createEndUser(_0x1dd2db,_0x28fc69,_0x457489,_0xcc23de,_0x4b7303){logger[_0x174f('0x10')]('['+[_0x1dd2db[_0x174f('0x11')]()]+_0x174f('0x1c'),_0x457489);return new Promise(function(_0x2e3bda,_0x35b9f1){var _0x55f3c2={'method':_0x174f('0x1d'),'uri':_0xcc23de+_0x174f('0x1e')+_0x4b7303,'body':{'user_name':_0x457489[_0x174f('0x1f')],'roles':'user','first_name':_0x457489[_0x174f('0x1f')],'active':'true','date_format':_0x174f('0x20'),'phone':_0x457489['endUserNumber']},'auth':_0x28fc69,'json':!![]};return rp(_0x55f3c2)[_0x174f('0xb')](function(_0x998470){logger['info']('['+[_0x1dd2db['toUpperCase']()]+'],\x20EndUser\x20schema',_0x998470[_0x174f('0xe')]);_0x457489[_0x174f('0x21')]=_0x998470['result'][_0x174f('0xf')];_0x2e3bda(_0x457489);})[_0x174f('0x12')](function(_0x3beb4a){logger['error']('['+[_0x1dd2db['toUpperCase']()]+']',_0x3beb4a['message']);_0x35b9f1(_0x3beb4a[_0x174f('0x14')]);});});}function getEndUser(_0x5acbc1,_0x25aeae,_0x257b70,_0x55ae81,_0x2439de){return function(_0x2c67a2){logger[_0x174f('0x10')]('['+[_0x5acbc1[_0x174f('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x2c67a2);return new Promise(function(_0x45918b,_0x3cf36f){var _0x2bcdba={'method':_0x174f('0x16'),'uri':_0x257b70+_0x174f('0x22')+_0x2c67a2[_0x174f('0x1f')]+'&'+_0x55ae81+'&'+_0x2439de,'auth':_0x25aeae,'json':!![]};return rp(_0x2bcdba)[_0x174f('0xb')](function(_0x306a07){if(_0x306a07['result'][_0x174f('0xc')]>0x0){_0x2c67a2[_0x174f('0x21')]=_0x306a07[_0x174f('0xe')][0x0]['sys_id'];logger[_0x174f('0x10')]('['+[_0x5acbc1[_0x174f('0x11')]()]+_0x174f('0x23'),_0x2c67a2);_0x45918b(_0x2c67a2);}else{return createEndUser(_0x5acbc1,_0x25aeae,_0x2c67a2,_0x257b70,_0x55ae81)[_0x174f('0xb')](function(_0x4e725a){logger[_0x174f('0x10')]('['+[_0x5acbc1['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x4e725a);_0x45918b(_0x4e725a);});}})[_0x174f('0x12')](function(_0x33049d){logger[_0x174f('0x13')]('['+[_0x5acbc1['toUpperCase']()]+']',_0x33049d[_0x174f('0x14')]);_0x3cf36f(_0x33049d['message']);});});};}function getCustomFields(_0x202d21,_0x446b72){var _0x3ba1dc={};if(_0x202d21[_0x174f('0xc')]>0x0){_['forEach'](_0x202d21,function(_0x3a589b){if(_['includes'](['string',_0x174f('0x24')],_0x3a589b['type'])&&_0x3a589b['nameField']&&!_0x3a589b[_0x174f('0x25')]){_0x3ba1dc[_0x3a589b['nameField'][_0x174f('0x26')]()]=_0x3a589b['content']['toString']();}else if(_[_0x174f('0x27')]([_0x174f('0x28'),_0x174f('0x24')],_0x3a589b[_0x174f('0x29')])&&_0x3a589b[_0x174f('0x2a')]&&_0x3a589b['customField']){_0x3ba1dc[_0x3a589b[_0x174f('0x2a')][_0x174f('0x26')]()]=_0x3a589b[_0x174f('0x2b')][_0x174f('0x2c')]();}else if(_0x3a589b[_0x174f('0x29')]==='variable'&&_0x3a589b[_0x174f('0x2d')]&&_0x3a589b['idField']&&_0x3a589b['customField']){_0x3ba1dc[_0x3a589b[_0x174f('0x2a')][_0x174f('0x26')]()]=_0x446b72[_0x3a589b[_0x174f('0x2d')]][_0x174f('0x2c')]();}else if(_0x3a589b['type']===_0x174f('0x2e')&&_0x3a589b[_0x174f('0x2f')]&&_0x3a589b[_0x174f('0x2f')][_0x174f('0x30')]&&_0x3a589b[_0x174f('0x2a')]&&_0x3a589b[_0x174f('0x25')]){_0x3ba1dc[_0x3a589b[_0x174f('0x2a')][_0x174f('0x26')]()]=_0x446b72[_0x3a589b[_0x174f('0x2f')][_0x174f('0x30')][_0x174f('0x26')]()][_0x174f('0x2c')]();}});}return _0x3ba1dc;}function getTicket(_0xce61d0,_0x389c75,_0x4192c6,_0x34acd4,_0x47e0d8,_0x5971a0){return function(_0x53c774){logger[_0x174f('0x10')]('['+[_0xce61d0[_0x174f('0x11')]()]+_0x174f('0x31'),_0x53c774);return new Promise(function(_0xc52558,_0x1ceb98){var _0x33504b=_0xce61d0[_0x174f('0x26')]()===_0x174f('0x32')?_0x53c774[_0x174f('0x19')]:_0x53c774[_0x174f('0x21')];var _0x3bbf8d={'method':'POST','uri':_0x4192c6+_0x174f('0x33')+'?'+_0x5971a0,'body':Object[_0x174f('0x34')]({},{'active':_0x174f('0x18'),'caller_id':_0x33504b,'assigned_to':_0x53c774['userId'],'short_description':intUtil[_0x174f('0x35')](_0x34acd4['Subjects'],_0x47e0d8,'\x20'),'description':intUtil['getString'](_0x34acd4[_0x174f('0x36')],_0x47e0d8,'\x0a')},getCustomFields(_0x34acd4[_0x174f('0x37')],_0x47e0d8)),'auth':_0x389c75,'json':!![]};return rp(_0x3bbf8d)[_0x174f('0xb')](function(_0x58ce2d){logger[_0x174f('0x10')]('['+[_0xce61d0[_0x174f('0x11')]()]+_0x174f('0x38'),_0x58ce2d[_0x174f('0xe')]);_0x53c774[_0x174f('0x39')]=_0x58ce2d[_0x174f('0xe')][_0x174f('0xf')];_0x53c774[_0x174f('0x3a')]=_0x58ce2d[_0x174f('0xe')][_0x174f('0x3b')];logger[_0x174f('0x10')]('['+[_0xce61d0[_0x174f('0x11')]()]+_0x174f('0x3c'),_0x53c774);_0xc52558(_0x53c774);})[_0x174f('0x12')](function(_0x5b2271){logger[_0x174f('0x13')]('['+[_0xce61d0[_0x174f('0x11')]()]+']',_0x5b2271[_0x174f('0x14')]);_0x1ceb98(_0x5b2271[_0x174f('0x14')]);});});};}function createRemoteTag(_0x4b72f3,_0x399dd7,_0x46e066,_0x543b2b){return new Promise(function(_0x3afbb6,_0x1a292c){var _0x30eca4={'method':_0x174f('0x1d'),'uri':_0x46e066+_0x174f('0x3d')+'?'+_0x543b2b,'body':{'short_description':_0x4b72f3,'global':!![],'active':!![],'name':_0x4b72f3},'auth':_0x399dd7,'json':!![]};return rp(_0x30eca4)[_0x174f('0xb')](function(_0x30a477){var _0xb6e4bb=_0x30a477['result']['sys_id'];_0x3afbb6(_0xb6e4bb);});});}function getRemoteTag(_0xd00a62,_0xf8e258,_0x56853c,_0x5f0640,_0x3720a3){return new Promise(function(_0x59c356,_0x4243d0){var _0x536254={'method':'GET','uri':_0x56853c+_0x174f('0x3d')+_0x174f('0x3e')+_0xd00a62+'&'+_0x5f0640,'auth':_0xf8e258,'json':!![]};return rp(_0x536254)[_0x174f('0xb')](function(_0xc2a9f0){if(_0xc2a9f0[_0x174f('0xe')][_0x174f('0xc')]>0x0){var _0xdb0e45=_0xc2a9f0[_0x174f('0xe')][0x0][_0x174f('0xf')];_0x59c356(_0xdb0e45);}else{return createRemoteTag(_0xd00a62,_0xf8e258,_0x56853c,_0x5f0640)['then'](function(_0x9a6ecb){_0x59c356(_0x9a6ecb);});}});});}function assignTagToIncident(_0x391445,_0x1f46d7,_0x2ad9f8,_0x1d90f6,_0x31d908){return new Promise(function(_0x1c1832,_0x142626){var _0x29db80={'method':'POST','uri':_0x2ad9f8+'label_entry'+'?'+_0x31d908,'body':{'label':_0x391445,'table':_0x174f('0x33'),'id_type':'Incident','table_key':_0x1d90f6['ticketId'],'title':_0x174f('0x3f')+_0x1d90f6[_0x174f('0x3a')],'id_display':_0x1d90f6[_0x174f('0x3a')]},'auth':_0x1f46d7,'json':!![]};return rp(_0x29db80)[_0x174f('0xb')](function(_0x11f702){_0x1c1832();})['catch'](function(){_0x1c1832();});});}function manageTags(_0x3e5adb,_0x35fbc2,_0x1a3dea,_0x233f15,_0x3f4cf8,_0x300887,_0xeaf672){return new Promise(function(_0x4f01d0,_0x29d41d){var _0x12868f=[];_0x35fbc2['forEach'](function(_0x3f794b){_0x12868f[_0x174f('0x40')](getRemoteTag(_0x3f794b,_0x1a3dea,_0x233f15,_0x300887,_0xeaf672));});return Promise['all'](_0x12868f)[_0x174f('0xb')](function(_0x202bd7){if(_0x202bd7['length']){logger[_0x174f('0x10')]('['+[_0x3e5adb[_0x174f('0x11')]()]+_0x174f('0x41'),_0x202bd7);var _0x5da92e=[];_0x202bd7[_0x174f('0x42')](function(_0x1c5f43){_0x5da92e[_0x174f('0x40')](assignTagToIncident(_0x1c5f43,_0x1a3dea,_0x233f15,_0x3f4cf8,_0x300887));});return Promise[_0x174f('0x43')](_0x5da92e)['then'](function(){_0x4f01d0();})['catch'](function(){_0x4f01d0();});}else{_0x4f01d0();}});});}function getTags(_0x235ac7,_0x483125,_0x598475,_0x5847e0,_0x109c08,_0x2e37c2){return function(_0x303e11){return new Promise(function(_0x5717c4,_0x1acd93){var _0x3c3d0c=[];var _0x131810=_0x5847e0[_0x174f('0x44')];if(_0x131810&&_0x131810['length']>0x0){_0x3c3d0c=_['map'](_0x131810,'name');}if(_0x3c3d0c['length']>0x0){return manageTags(_0x235ac7,_0x3c3d0c,_0x483125,_0x598475,_0x303e11,_0x109c08,_0x2e37c2)['then'](function(){_0x5717c4(_0x303e11);});}else{_0x5717c4(_0x303e11);}});};}function emit(_0x2c91c0,_0x47c326,_0x5ac48c){var _0x27c5b0=_0x174f('0x45')+_0x174f('0x46')+_0x174f('0x47')+_0x174f('0x48');var _0x1b3498={'uri':_0x2c91c0+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x5ac48c+_0x27c5b0};io['to'](util[_0x174f('0x49')](_0x174f('0x4a'),_0x47c326))[_0x174f('0x4b')](_0x174f('0x4c'),_0x1b3498);}exports['cs']=function(_0x19fdc1,_0x4b6ba8,_0x5e9048,_0x2a8672,_0x2fa19b,_0x2d2aef,_0x46a753,_0x4ae526){var _0x5c4324={};var _0x8bd6d1={'user':_0x2d2aef['username'],'pass':_0x2d2aef['password']};var _0x5916ea=_0x174f('0x4d');var _0x28425b='sysparm_display_value=true';_0x2d2aef[_0x174f('0x4e')]=intUtil[_0x174f('0x4f')](_0x2d2aef[_0x174f('0x4e')]);_0x2d2aef[_0x174f('0x50')]=intUtil[_0x174f('0x4f')](_0x2d2aef[_0x174f('0x50')]);var _0x282e0a=util['format'](_0x174f('0x51'),_0x2d2aef['remoteUri']);_0x5c4324['userEmail']=!_[_0x174f('0x52')](_0x2a8672)?_0x2a8672[_0x174f('0x53')]:null;_0x5c4324[_0x174f('0x1b')]=_0x2d2aef[_0x174f('0x53')];_0x5c4324['endUserNumber']=_0x4ae526[_0x174f('0x26')]()===_0x174f('0x32')?_0x4b6ba8['destcalleridnum']:_0x4b6ba8[_0x174f('0x54')];_0x5c4324[_0x174f('0x55')]=_0x4ae526===_0x174f('0x56')||_0x4ae526===_0x174f('0x57')?_0x174f('0x56'):_0x174f('0x32');var _0x19ade4=util['format'](_0x174f('0x58'),_0x2d2aef[_0x174f('0x50')],_0x4b6ba8['uniqueid'],md5(_0x4b6ba8[_0x174f('0x59')]));if(_0x2fa19b&&_0x2fa19b[_0x174f('0x5a')]){logger[_0x174f('0x10')]('[QUEUE]',_0x174f('0x5b'));_0x4b6ba8[_0x174f('0x5c')]=_0x19ade4;}else if(_0x46a753&&_0x46a753[_0x174f('0x5d')]&&_0x46a753['recordingFormat']!==_0x174f('0x5e')){logger['info']('[OUTBOUND]',_0x174f('0x5b'));_0x4b6ba8['recordingURL']=_0x19ade4;}else{_0x4b6ba8[_0x174f('0x5c')]='';}return getAdminUser(_0x4ae526,_0x8bd6d1,_0x5c4324,_0x282e0a,_0x28425b,_0x5916ea)[_0x174f('0xb')](getUser(_0x4ae526,_0x8bd6d1,_0x282e0a,_0x28425b,_0x5916ea))[_0x174f('0xb')](getEndUser(_0x4ae526,_0x8bd6d1,_0x282e0a,_0x28425b,_0x5916ea))['then'](getTicket(_0x4ae526,_0x8bd6d1,_0x282e0a,_0x5e9048,_0x4b6ba8,_0x28425b))[_0x174f('0xb')](function(_0xbab4ed){logger[_0x174f('0x10')](util[_0x174f('0x49')](_0x174f('0x5f'),_0xbab4ed[_0x174f('0x39')]));logger['info'](util[_0x174f('0x49')](_0x174f('0x60'),_0x4ae526));if(_0x4ae526!=='unmanaged'){logger[_0x174f('0x10')]('['+[_0x4ae526[_0x174f('0x11')]()]+']',_0x174f('0x61'));emit(_0x2d2aef[_0x174f('0x4e')],_0x2a8672[_0x174f('0x30')],_0xbab4ed[_0x174f('0x39')]);}})[_0x174f('0x12')](function(_0x838d38){logger['error']('['+[_0x4ae526[_0x174f('0x11')]()]+_0x174f('0x62'),util['inspect'](_0x838d38,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9a81=['[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','GET','then','result','adminId','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','sys_id','userEmail','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','toString','includes','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all','push','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid'];(function(_0x59b525,_0x503518){var _0x3142a8=function(_0x1019af){while(--_0x1019af){_0x59b525['push'](_0x59b525['shift']());}};_0x3142a8(++_0x503518);}(_0x9a81,0x1a9));var _0x19a8=function(_0x422f0b,_0x323840){_0x422f0b=_0x422f0b-0x0;var _0x29cb61=_0x9a81[_0x422f0b];return _0x29cb61;};'use strict';var _=require(_0x19a8('0x0'));var Promise=require(_0x19a8('0x1'));var rp=require(_0x19a8('0x2'));var util=require(_0x19a8('0x3'));var md5=require(_0x19a8('0x4'));var Redis=require(_0x19a8('0x5'));var intUtil=require(_0x19a8('0x6'));var config=require(_0x19a8('0x7'));var logger=require('../../../../config/logger')('servicenow');config[_0x19a8('0x8')]=_[_0x19a8('0x9')](config[_0x19a8('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x19a8('0x8')]));function getAdminUser(_0x2c12b5,_0x1d7f25,_0x51739f,_0x3125d4,_0x40ef6,_0xfbc508){return new Promise(function(_0x4d3b8c,_0x47d796){var _0xb7048a={'method':_0x19a8('0xa'),'uri':_0x3125d4+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x40ef6+'&'+_0xfbc508,'auth':_0x1d7f25,'json':!![]};return rp(_0xb7048a)[_0x19a8('0xb')](function(_0x4a7ca4){if(_0x4a7ca4[_0x19a8('0xc')]['length']>0x0){_0x51739f[_0x19a8('0xd')]=_0x4a7ca4['result'][0x0]['sys_id'];}logger['info']('['+[_0x2c12b5[_0x19a8('0xe')]()]+_0x19a8('0xf'),_0x51739f);_0x4d3b8c(_0x51739f);})['catch'](function(_0x203a27){logger[_0x19a8('0x10')]('['+[_0x2c12b5[_0x19a8('0xe')]()]+']',_0x203a27['message']);_0x47d796(_0x203a27[_0x19a8('0x11')]);});});}function getUser(_0x439cf2,_0x5315ba,_0x285b41,_0x406e76,_0x1cea3c){return function(_0x35a9fc){logger[_0x19a8('0x12')]('['+[_0x439cf2[_0x19a8('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x35a9fc);return new Promise(function(_0x2f926c,_0x5383da){if(intUtil[_0x19a8('0x13')](_0x35a9fc['userEmail'])){var _0x335ac8={'method':_0x19a8('0xa'),'uri':_0x285b41+_0x19a8('0x14')+_0x35a9fc['userEmail']+'&'+_0x406e76+'&'+_0x1cea3c,'auth':_0x5315ba,'json':!![]};logger[_0x19a8('0x12')]('['+[_0x439cf2[_0x19a8('0xe')]()]+_0x19a8('0x15'),_0x335ac8);return rp(_0x335ac8)[_0x19a8('0xb')](function(_0x42e5de){logger[_0x19a8('0x12')]('['+[_0x439cf2[_0x19a8('0xe')]()]+_0x19a8('0x16'),_0x42e5de);if(_0x42e5de[_0x19a8('0xc')][_0x19a8('0x17')]>0x0&&String(_0x42e5de[_0x19a8('0xc')][0x0][_0x19a8('0x18')])===_0x19a8('0x19')){_0x35a9fc[_0x19a8('0x1a')]=_0x42e5de[_0x19a8('0xc')][0x0][_0x19a8('0x1b')];}else{_0x35a9fc[_0x19a8('0x1a')]=_0x35a9fc['adminId'];_0x35a9fc[_0x19a8('0x1c')]=_0x35a9fc[_0x19a8('0x1d')];}logger[_0x19a8('0x12')]('['+[_0x439cf2[_0x19a8('0xe')]()]+_0x19a8('0x1e'),_0x35a9fc);_0x2f926c(_0x35a9fc);})[_0x19a8('0x1f')](function(_0x48dcec){logger[_0x19a8('0x10')]('['+[_0x439cf2[_0x19a8('0xe')]()]+']',_0x48dcec['message']);_0x5383da(_0x48dcec[_0x19a8('0x11')]);});}else{logger[_0x19a8('0x12')]('['+[_0x439cf2['toUpperCase']()]+_0x19a8('0x20'));_0x35a9fc[_0x19a8('0x1a')]=_0x35a9fc[_0x19a8('0xd')];_0x35a9fc['userEmail']=_0x35a9fc[_0x19a8('0x1d')];_0x2f926c(_0x35a9fc);}});};}function createEndUser(_0x3ca311,_0x5803f8,_0x58d22b,_0x4be957,_0x151fa2){logger['info']('['+[_0x3ca311[_0x19a8('0xe')]()]+_0x19a8('0x21'),_0x58d22b);return new Promise(function(_0xc6de86,_0x1797c6){var _0xd70d30={'method':_0x19a8('0x22'),'uri':_0x4be957+'sys_user?'+_0x151fa2,'body':{'user_name':_0x58d22b[_0x19a8('0x23')],'roles':'user','first_name':_0x58d22b[_0x19a8('0x23')],'active':_0x19a8('0x19'),'date_format':_0x19a8('0x24'),'phone':_0x58d22b[_0x19a8('0x23')]},'auth':_0x5803f8,'json':!![]};return rp(_0xd70d30)['then'](function(_0x300a0a){logger['info']('['+[_0x3ca311['toUpperCase']()]+_0x19a8('0x25'),_0x300a0a[_0x19a8('0xc')]);_0x58d22b['endUserId']=_0x300a0a[_0x19a8('0xc')][_0x19a8('0x1b')];_0xc6de86(_0x58d22b);})[_0x19a8('0x1f')](function(_0x242091){logger['error']('['+[_0x3ca311[_0x19a8('0xe')]()]+']',_0x242091[_0x19a8('0x11')]);_0x1797c6(_0x242091[_0x19a8('0x11')]);});});}function getEndUser(_0x5b64d5,_0x39e35a,_0x2413d2,_0x5ef87c,_0x245cdb){return function(_0x58a7cb){logger[_0x19a8('0x12')]('['+[_0x5b64d5[_0x19a8('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x58a7cb);return new Promise(function(_0x532a4e,_0x466061){var _0x5f0fc4={'method':_0x19a8('0xa'),'uri':_0x2413d2+_0x19a8('0x26')+_0x58a7cb['endUserNumber']+'&'+_0x5ef87c+'&'+_0x245cdb,'auth':_0x39e35a,'json':!![]};return rp(_0x5f0fc4)['then'](function(_0x357897){if(_0x357897[_0x19a8('0xc')][_0x19a8('0x17')]>0x0){_0x58a7cb[_0x19a8('0x27')]=_0x357897[_0x19a8('0xc')][0x0][_0x19a8('0x1b')];logger[_0x19a8('0x12')]('['+[_0x5b64d5['toUpperCase']()]+_0x19a8('0x28'),_0x58a7cb);_0x532a4e(_0x58a7cb);}else{return createEndUser(_0x5b64d5,_0x39e35a,_0x58a7cb,_0x2413d2,_0x5ef87c)[_0x19a8('0xb')](function(_0x34b233){logger[_0x19a8('0x12')]('['+[_0x5b64d5[_0x19a8('0xe')]()]+'],\x20createEndUser\x20crm',_0x34b233);_0x532a4e(_0x34b233);});}})[_0x19a8('0x1f')](function(_0x33bdf6){logger['error']('['+[_0x5b64d5[_0x19a8('0xe')]()]+']',_0x33bdf6['message']);_0x466061(_0x33bdf6[_0x19a8('0x11')]);});});};}function getCustomFields(_0x303534,_0x4ddbeb){var _0x3122af={};if(_0x303534[_0x19a8('0x17')]>0x0){_[_0x19a8('0x29')](_0x303534,function(_0x4373a9){if(_['includes']([_0x19a8('0x2a'),_0x19a8('0x2b')],_0x4373a9[_0x19a8('0x2c')])&&_0x4373a9[_0x19a8('0x2d')]&&!_0x4373a9[_0x19a8('0x2e')]){_0x3122af[_0x4373a9[_0x19a8('0x2d')][_0x19a8('0x2f')]()]=_0x4373a9['content'][_0x19a8('0x30')]();}else if(_[_0x19a8('0x31')]([_0x19a8('0x2a'),'picklist'],_0x4373a9[_0x19a8('0x2c')])&&_0x4373a9[_0x19a8('0x32')]&&_0x4373a9['customField']){_0x3122af[_0x4373a9['idField'][_0x19a8('0x2f')]()]=_0x4373a9[_0x19a8('0x33')][_0x19a8('0x30')]();}else if(_0x4373a9[_0x19a8('0x2c')]===_0x19a8('0x34')&&_0x4373a9[_0x19a8('0x35')]&&_0x4373a9[_0x19a8('0x32')]&&_0x4373a9[_0x19a8('0x2e')]){_0x3122af[_0x4373a9[_0x19a8('0x32')][_0x19a8('0x2f')]()]=_0x4ddbeb[_0x4373a9[_0x19a8('0x35')]][_0x19a8('0x30')]();}else if(_0x4373a9['type']===_0x19a8('0x36')&&_0x4373a9['Variable']&&_0x4373a9[_0x19a8('0x37')]['name']&&_0x4373a9[_0x19a8('0x32')]&&_0x4373a9[_0x19a8('0x2e')]){_0x3122af[_0x4373a9[_0x19a8('0x32')][_0x19a8('0x2f')]()]=_0x4ddbeb[_0x4373a9[_0x19a8('0x37')][_0x19a8('0x38')][_0x19a8('0x2f')]()][_0x19a8('0x30')]();}});}return _0x3122af;}function getTicket(_0x1c8e10,_0xaf947d,_0x45281d,_0x497442,_0x4df7f6,_0x4c8420){return function(_0x3368d7){logger[_0x19a8('0x12')]('['+[_0x1c8e10[_0x19a8('0xe')]()]+_0x19a8('0x39'),_0x3368d7);return new Promise(function(_0x234850,_0x42af2c){var _0x4abb9a=_0x1c8e10['toLowerCase']()===_0x19a8('0x3a')?_0x3368d7[_0x19a8('0x1a')]:_0x3368d7[_0x19a8('0x27')];var _0x94d339={'method':_0x19a8('0x22'),'uri':_0x45281d+_0x19a8('0x3b')+'?'+_0x4c8420,'body':Object[_0x19a8('0x3c')]({},{'active':_0x19a8('0x19'),'caller_id':_0x4abb9a,'assigned_to':_0x3368d7[_0x19a8('0x1a')],'short_description':intUtil[_0x19a8('0x3d')](_0x497442['Subjects'],_0x4df7f6,'\x20'),'description':intUtil[_0x19a8('0x3d')](_0x497442[_0x19a8('0x3e')],_0x4df7f6,'\x0a')},getCustomFields(_0x497442['Fields'],_0x4df7f6)),'auth':_0xaf947d,'json':!![]};return rp(_0x94d339)['then'](function(_0x2b5a8a){logger[_0x19a8('0x12')]('['+[_0x1c8e10['toUpperCase']()]+_0x19a8('0x3f'),_0x2b5a8a['result']);_0x3368d7[_0x19a8('0x40')]=_0x2b5a8a[_0x19a8('0xc')]['sys_id'];_0x3368d7[_0x19a8('0x41')]=_0x2b5a8a['result'][_0x19a8('0x42')];logger[_0x19a8('0x12')]('['+[_0x1c8e10[_0x19a8('0xe')]()]+_0x19a8('0x43'),_0x3368d7);_0x234850(_0x3368d7);})['catch'](function(_0x35e893){logger[_0x19a8('0x10')]('['+[_0x1c8e10['toUpperCase']()]+']',_0x35e893[_0x19a8('0x11')]);_0x42af2c(_0x35e893[_0x19a8('0x11')]);});});};}function createRemoteTag(_0x47a4c1,_0x26eda0,_0x2dd086,_0x18c281){return new Promise(function(_0x1ed190,_0x575c07){var _0x57aef5={'method':_0x19a8('0x22'),'uri':_0x2dd086+'label'+'?'+_0x18c281,'body':{'short_description':_0x47a4c1,'global':!![],'active':!![],'name':_0x47a4c1},'auth':_0x26eda0,'json':!![]};return rp(_0x57aef5)[_0x19a8('0xb')](function(_0x591876){var _0x4ac18a=_0x591876[_0x19a8('0xc')]['sys_id'];_0x1ed190(_0x4ac18a);});});}function getRemoteTag(_0x3cd17d,_0x12d9b4,_0x195db4,_0x4c558b,_0x8582a3){return new Promise(function(_0x16772e,_0x2de2db){var _0x49b969={'method':_0x19a8('0xa'),'uri':_0x195db4+'label'+_0x19a8('0x44')+_0x3cd17d+'&'+_0x4c558b,'auth':_0x12d9b4,'json':!![]};return rp(_0x49b969)['then'](function(_0x19703f){if(_0x19703f[_0x19a8('0xc')][_0x19a8('0x17')]>0x0){var _0x1a81af=_0x19703f[_0x19a8('0xc')][0x0][_0x19a8('0x1b')];_0x16772e(_0x1a81af);}else{return createRemoteTag(_0x3cd17d,_0x12d9b4,_0x195db4,_0x4c558b)[_0x19a8('0xb')](function(_0x1189e7){_0x16772e(_0x1189e7);});}});});}function assignTagToIncident(_0x52f916,_0x403f3c,_0x41308b,_0x319c42,_0x2833a2){return new Promise(function(_0x530366,_0x3c2fbe){var _0x4622f4={'method':_0x19a8('0x22'),'uri':_0x41308b+_0x19a8('0x45')+'?'+_0x2833a2,'body':{'label':_0x52f916,'table':_0x19a8('0x3b'),'id_type':_0x19a8('0x46'),'table_key':_0x319c42['ticketId'],'title':_0x19a8('0x47')+_0x319c42[_0x19a8('0x41')],'id_display':_0x319c42['ticketNumber']},'auth':_0x403f3c,'json':!![]};return rp(_0x4622f4)[_0x19a8('0xb')](function(_0x4d2da4){_0x530366();})['catch'](function(){_0x530366();});});}function manageTags(_0x4f6cbc,_0x165838,_0x598552,_0x489043,_0x12c7f3,_0x295e8c,_0x21126c){return new Promise(function(_0x1d7f0f,_0x30aa36){var _0x10f564=[];_0x165838[_0x19a8('0x29')](function(_0x48e0fc){_0x10f564['push'](getRemoteTag(_0x48e0fc,_0x598552,_0x489043,_0x295e8c,_0x21126c));});return Promise[_0x19a8('0x48')](_0x10f564)['then'](function(_0x10178c){if(_0x10178c[_0x19a8('0x17')]){logger['info']('['+[_0x4f6cbc[_0x19a8('0xe')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x10178c);var _0xc4ab54=[];_0x10178c['forEach'](function(_0x290741){_0xc4ab54[_0x19a8('0x49')](assignTagToIncident(_0x290741,_0x598552,_0x489043,_0x12c7f3,_0x295e8c));});return Promise[_0x19a8('0x48')](_0xc4ab54)[_0x19a8('0xb')](function(){_0x1d7f0f();})['catch'](function(){_0x1d7f0f();});}else{_0x1d7f0f();}});});}function getTags(_0x490016,_0x511b44,_0x1b8e47,_0x2d131f,_0x414134,_0x3f1c4c){return function(_0x5076a1){return new Promise(function(_0x58f3e1,_0x66a78d){var _0x2000f9=[];var _0x31b05e=_0x2d131f[_0x19a8('0x4a')];if(_0x31b05e&&_0x31b05e['length']>0x0){_0x2000f9=_[_0x19a8('0x4b')](_0x31b05e,'name');}if(_0x2000f9[_0x19a8('0x17')]>0x0){return manageTags(_0x490016,_0x2000f9,_0x511b44,_0x1b8e47,_0x5076a1,_0x414134,_0x3f1c4c)[_0x19a8('0xb')](function(){_0x58f3e1(_0x5076a1);});}else{_0x58f3e1(_0x5076a1);}});};}function emit(_0x2ae0af,_0x3aa19c,_0x14db83){var _0x560ea2='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x19a8('0x4c')+_0x19a8('0x4d');var _0x1569a0={'uri':_0x2ae0af+_0x19a8('0x4e')+_0x14db83+_0x560ea2};io['to'](util[_0x19a8('0x4f')](_0x19a8('0x50'),_0x3aa19c))[_0x19a8('0x51')](_0x19a8('0x52'),_0x1569a0);}exports['cs']=function(_0x45f8c6,_0x58ae56,_0x342a25,_0x196589,_0x2e908d,_0x5f3fc1,_0x36aed3,_0xa0f8f5){var _0x281610={};var _0x5851f8={'user':_0x5f3fc1[_0x19a8('0x53')],'pass':_0x5f3fc1[_0x19a8('0x54')]};var _0x345767='sysparm_limit=1';var _0xfd7d3e='sysparm_display_value=true';_0x5f3fc1[_0x19a8('0x55')]=intUtil['stripTrailingSlash'](_0x5f3fc1[_0x19a8('0x55')]);_0x5f3fc1['serverUrl']=intUtil[_0x19a8('0x56')](_0x5f3fc1[_0x19a8('0x57')]);var _0x1fda45=util['format']('%s/api/now/table/',_0x5f3fc1[_0x19a8('0x55')]);_0x281610[_0x19a8('0x1c')]=!_[_0x19a8('0x58')](_0x196589)?_0x196589[_0x19a8('0x59')]:null;_0x281610[_0x19a8('0x1d')]=_0x5f3fc1[_0x19a8('0x59')];_0x281610['endUserNumber']=_0xa0f8f5[_0x19a8('0x2f')]()===_0x19a8('0x3a')?_0x58ae56['destcalleridnum']:_0x58ae56[_0x19a8('0x5a')];_0x281610[_0x19a8('0x5b')]=_0xa0f8f5===_0x19a8('0x5c')||_0xa0f8f5===_0x19a8('0x5d')?_0x19a8('0x5c'):_0x19a8('0x3a');var _0x1c449d=util[_0x19a8('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f3fc1['serverUrl'],_0x58ae56['uniqueid'],md5(_0x58ae56[_0x19a8('0x5e')]));if(_0x2e908d&&_0x2e908d['monitor_format']){logger['info'](_0x19a8('0x5f'),'Recording\x20is\x20enabled!');_0x58ae56[_0x19a8('0x60')]=_0x1c449d;}else if(_0x36aed3&&_0x36aed3[_0x19a8('0x61')]&&_0x36aed3[_0x19a8('0x61')]!==_0x19a8('0x62')){logger['info'](_0x19a8('0x63'),_0x19a8('0x64'));_0x58ae56[_0x19a8('0x60')]=_0x1c449d;}else{_0x58ae56[_0x19a8('0x60')]='';}return getAdminUser(_0xa0f8f5,_0x5851f8,_0x281610,_0x1fda45,_0xfd7d3e,_0x345767)[_0x19a8('0xb')](getUser(_0xa0f8f5,_0x5851f8,_0x1fda45,_0xfd7d3e,_0x345767))[_0x19a8('0xb')](getEndUser(_0xa0f8f5,_0x5851f8,_0x1fda45,_0xfd7d3e,_0x345767))[_0x19a8('0xb')](getTicket(_0xa0f8f5,_0x5851f8,_0x1fda45,_0x342a25,_0x58ae56,_0xfd7d3e))[_0x19a8('0xb')](function(_0x238cf3){logger[_0x19a8('0x12')](util[_0x19a8('0x4f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x238cf3[_0x19a8('0x40')]));logger['info'](util['format'](_0x19a8('0x65'),_0xa0f8f5));if(_0xa0f8f5!=='unmanaged'){logger[_0x19a8('0x12')]('['+[_0xa0f8f5[_0x19a8('0xe')]()]+']',_0x19a8('0x66'));emit(_0x5f3fc1['remoteUri'],_0x196589['name'],_0x238cf3[_0x19a8('0x40')]);}})[_0x19a8('0x1f')](function(_0x36f863){logger[_0x19a8('0x10')]('['+[_0xa0f8f5['toUpperCase']()]+_0x19a8('0x67'),util['inspect'](_0x36f863,{'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 eae5c1b..a583f33 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 _0xf918=['Descriptions','date_start','toISOString','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','idField','variableName','set_entry','stringify','Basic\x20%s','apiKey','toString','base64','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','first_name','debug','[HTTP]','merge','map','type','nameField','customField','content','custom_fields','variable','customVariable','Variable','toLowerCase','push','login','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','users','user:%s','toUpperCase','lodash','bluebird','md5','ioredis','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString'];(function(_0x1e5efd,_0x2617cf){var _0x3b743e=function(_0x2e8fa1){while(--_0x2e8fa1){_0x1e5efd['push'](_0x1e5efd['shift']());}};_0x3b743e(++_0x2617cf);}(_0xf918,0x143));var _0x8f91=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0xf918[_0x460fd7];return _0x44d1c2;};'use strict';var _=require(_0x8f91('0x0'));var rp=require('request-promise');var BPromise=require(_0x8f91('0x1'));var md5=require(_0x8f91('0x2'));var util=require('util');var Redis=require(_0x8f91('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0x8f91('0x4')]=_[_0x8f91('0x5')](config[_0x8f91('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x8f91('0x6'))(new Redis(config[_0x8f91('0x4')]));var def={'method':_0x8f91('0x7'),'json':!![]};function emit(_0x2720c6,_0x49d001,_0x2357b7){io['to'](_0x2720c6)[_0x8f91('0x8')](_0x49d001,_0x2357b7);}function getTicket(_0x3fbb08,_0x1eaa50,_0x25c04f,_0x2c8ec3,_0x18994a,_0x4dd1ee,_0x14cc3d,_0x29005d){logger[_0x8f91('0x9')](_0x8f91('0xa'));var _0x128a0c=new Date();var _0x166c60=[{'name':_0x8f91('0xb'),'value':intUtil['getString'](_0x2c8ec3['Subjects'],_0x18994a,'\x20')},{'name':_0x8f91('0xc'),'value':_0x1eaa50['id']},{'name':_0x8f91('0xd'),'value':_0x1eaa50['id']},{'name':_0x8f91('0xe'),'value':intUtil[_0x8f91('0xf')](_0x2c8ec3[_0x8f91('0x10')],_0x18994a,'\x0a')},{'name':_0x8f91('0x11'),'value':_0x128a0c[_0x8f91('0x12')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x8f91('0x13'),'value':'15'},{'name':_0x8f91('0x14'),'value':_0x25c04f['id']},{'name':_0x8f91('0x15'),'value':_0x8f91('0x16')},{'name':_0x8f91('0x17'),'value':_0x25c04f['name']},{'name':_0x8f91('0x18'),'value':_0x29005d}];if(_0x4dd1ee[_0x8f91('0x19')]){_[_0x8f91('0x1a')](_0x4dd1ee,function(_0x451650){if(_0x18994a[_0x451650['variableName']]){_0x166c60['push']({'name':_0x451650[_0x8f91('0x1b')],'value':_0x18994a[_0x451650[_0x8f91('0x1c')]]});}});}return request({'form':{'method':_0x8f91('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8f91('0x1e')]({'session':_0x14cc3d['id'],'module_name':'Calls','name_value_list':_0x166c60})}});}function getAuth(_0x203b85){return util['format'](_0x8f91('0x1f'),new Buffer(_0x203b85[_0x8f91('0x20')]+':X')[_0x8f91('0x21')](_0x8f91('0x22')));}function getServerInfo(_0x5ae39d){return request({'form':{'method':'get_server_info','input_type':_0x8f91('0x23'),'response_type':_0x8f91('0x23'),'rest_data':JSON[_0x8f91('0x1e')]({'session':_0x5ae39d['id']})}});}function getUser(_0x206e3d,_0x39869b,_0x9645ce){if(!_[_0x8f91('0x24')](_0x39869b)){logger[_0x8f91('0x9')](_0x8f91('0x25'),_0x39869b);return request({'form':{'method':_0x8f91('0x26'),'input_type':_0x8f91('0x23'),'response_type':_0x8f91('0x23'),'rest_data':JSON[_0x8f91('0x1e')]({'session':_0x9645ce['id'],'module_name':_0x8f91('0x27'),'query':util[_0x8f91('0x28')](_0x8f91('0x29'),_0x39869b),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8f91('0x2a')](function(_0x36d70e){if(_0x36d70e[_0x8f91('0x2b')][_0x8f91('0x19')]){var _0x1b659f=_[_0x8f91('0x2c')](_0x36d70e[_0x8f91('0x2b')],function(_0x7bcee){return _0x7bcee[_0x8f91('0x2d')][_0x8f91('0x2e')][_0x8f91('0x2f')]===_0x39869b;});if(_0x1b659f){logger[_0x8f91('0x9')](_0x8f91('0x30'));return BPromise[_0x8f91('0x31')]({'id':_0x1b659f['name_value_list']['id'][_0x8f91('0x2f')],'name':_0x1b659f[_0x8f91('0x2d')][_0x8f91('0xb')][_0x8f91('0x2f')]});}}logger[_0x8f91('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x9645ce[_0x8f91('0x2d')]['user_id'][_0x8f91('0x2f')],'name':_0x9645ce['name_value_list'][_0x8f91('0x2e')][_0x8f91('0x2f')]});});}else{logger[_0x8f91('0x9')](_0x8f91('0x32'));return BPromise[_0x8f91('0x31')]({'id':_0x9645ce[_0x8f91('0x2d')][_0x8f91('0x33')][_0x8f91('0x2f')],'name':_0x9645ce[_0x8f91('0x2d')]['user_name'][_0x8f91('0x2f')]});}}function getEndUser(_0xc4a808,_0x32aaeb,_0x34b0e1,_0x1b28e0){logger[_0x8f91('0x9')](_0x8f91('0x34'),_0x34b0e1);return request({'form':{'method':_0x8f91('0x26'),'input_type':_0x8f91('0x23'),'response_type':'JSON','rest_data':JSON[_0x8f91('0x1e')]({'session':_0x1b28e0['id'],'module_name':'Contacts','query':util[_0x8f91('0x28')](_0x8f91('0x35'),_0x34b0e1),'order_by':'','offset':'0','select_fields':['id',_0x8f91('0xb'),_0x8f91('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x58d96b){if(_0x58d96b[_0x8f91('0x2b')]['length']){var _0x1f3714=_['find'](_0x58d96b[_0x8f91('0x2b')],function(_0x176d2f){return _0x176d2f[_0x8f91('0x2d')][_0x8f91('0x36')]['value']===_0x34b0e1;});if(_0x1f3714){logger[_0x8f91('0x9')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x1f3714[_0x8f91('0x2d')]['id']['value'],'name':_0x1f3714[_0x8f91('0x2d')][_0x8f91('0xb')][_0x8f91('0x2f')],'phone':_0x1f3714['name_value_list']['phone_home'][_0x8f91('0x2f')]});}}else{logger[_0x8f91('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x8f91('0x1d'),'input_type':_0x8f91('0x23'),'response_type':_0x8f91('0x23'),'rest_data':JSON[_0x8f91('0x1e')]({'session':_0x1b28e0['id'],'module_name':_0x8f91('0x16'),'name_value_list':[{'name':_0x8f91('0x37'),'value':_0x32aaeb!==''?_0x32aaeb:util[_0x8f91('0x28')]('Caller\x20-\x20%s',_0x34b0e1)},{'name':'phone_home','value':_0x34b0e1}]})}})[_0x8f91('0x2a')](function(_0x49faec){logger[_0x8f91('0x9')]('Enduser\x20created.');return BPromise[_0x8f91('0x31')]({'id':_0x49faec['id'],'name':_0x49faec[_0x8f91('0x2b')][_0x8f91('0x37')][_0x8f91('0x2f')],'phone':_0x49faec[_0x8f91('0x2b')]['phone_home'][_0x8f91('0x2f')]});});}});}function request(_0x834c33){logger[_0x8f91('0x38')](_0x8f91('0x39'),JSON[_0x8f91('0x1e')](_0x834c33));return rp(_[_0x8f91('0x3a')](def,_0x834c33));}function getTags(_0x10c5fc,_0x451efe){var _0x1e0e7f=[];if(_0x10c5fc&&_0x10c5fc[_0x8f91('0x19')]>0x0){_0x1e0e7f=_[_0x8f91('0x3b')](_0x10c5fc,_0x451efe);}return _0x1e0e7f;}function getCustomFields(_0x126747,_0x4ed07c){var _0x30ee9b=[];var _0x1acaea={'custom_fields':[]};if(_0x126747[_0x8f91('0x19')]>0x0){_[_0x8f91('0x1a')](_0x126747,function(_0x22c389){if(_0x22c389[_0x8f91('0x3c')]==='string'&&_0x22c389[_0x8f91('0x3d')]&&!_0x22c389[_0x8f91('0x3e')]){_0x1acaea[_0x22c389[_0x8f91('0x3d')]['toLowerCase']()]=_0x22c389[_0x8f91('0x3f')][_0x8f91('0x21')]();}else if(_0x22c389[_0x8f91('0x3c')]==='string'&&_0x22c389[_0x8f91('0x1b')]&&_0x22c389['customField']){_0x1acaea[_0x8f91('0x40')]['push']({'id':_0x22c389[_0x8f91('0x1b')],'value':_0x22c389[_0x8f91('0x3f')][_0x8f91('0x21')]()});}else if(_0x22c389[_0x8f91('0x3c')]===_0x8f91('0x41')&&_0x22c389[_0x8f91('0x1c')]&&_0x22c389[_0x8f91('0x1b')]&&_0x22c389[_0x8f91('0x3e')]){_0x4ed07c[_0x22c389[_0x8f91('0x1c')]]&&_0x1acaea[_0x8f91('0x40')]['push']({'id':_0x22c389[_0x8f91('0x1b')],'value':_0x4ed07c[_0x22c389[_0x8f91('0x1c')]]['toString']()});}else if(_0x22c389[_0x8f91('0x3c')]===_0x8f91('0x42')&&_0x22c389[_0x8f91('0x43')]&&_0x22c389['Variable'][_0x8f91('0xb')]&&_0x22c389['idField']&&_0x22c389[_0x8f91('0x3e')]){_0x4ed07c[_0x22c389[_0x8f91('0x43')][_0x8f91('0xb')][_0x8f91('0x44')]()]&&_0x1acaea[_0x8f91('0x40')][_0x8f91('0x45')]({'id':_0x22c389[_0x8f91('0x1b')],'value':_0x4ed07c[_0x22c389[_0x8f91('0x43')]['name'][_0x8f91('0x44')]()][_0x8f91('0x21')]()});}});}return _0x1acaea;}function getConnection(_0x14b595){return request({'method':'POST','form':{'method':_0x8f91('0x46'),'input_type':'JSON','response_type':_0x8f91('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x14b595['username'],'password':_0x14b595[_0x8f91('0x47')],'encryption':_0x8f91('0x48')},'application':_0x8f91('0x49')})}})['then'](function(_0x19527b){var _0x474fdd=_0x19527b;if(_0x474fdd['id']){def['sessionID']=_0x474fdd['id'];return BPromise[_0x8f91('0x31')](_0x474fdd);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x14b595['id']));}});}function setRelationship(_0x53c14f,_0xf80898,_0x45be51,_0x43771a){return request({'form':{'method':_0x8f91('0x4a'),'input_type':_0x8f91('0x23'),'response_type':_0x8f91('0x23'),'rest_data':JSON[_0x8f91('0x1e')]({'session':_0x53c14f['id'],'module_name':_0x8f91('0x4b'),'module_id':_0x45be51['id'],'link_field_name':_0x43771a,'related_ids':[_0xf80898['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8f91('0x4c')]=function(_0x1f7bc9,_0x170a36,_0x1f55c3,_0x1395d4,_0x2892fd,_0x3b8732){var _0x5ec06b,_0x5a8c64,_0x125302,_0x5279a3;_0x3b8732[_0x8f91('0x4d')]=intUtil[_0x8f91('0x4e')](_0x3b8732[_0x8f91('0x4d')]);_0x3b8732[_0x8f91('0x4f')]=intUtil[_0x8f91('0x4e')](_0x3b8732[_0x8f91('0x4f')]);def[_0x8f91('0x50')]=util[_0x8f91('0x28')](_0x8f91('0x51'),_0x3b8732[_0x8f91('0x4d')]);if(_0x2892fd&&_0x2892fd[_0x8f91('0x52')]){logger[_0x8f91('0x9')]('[QUEUE]',_0x8f91('0x53'));_0x170a36[_0x8f91('0x54')]=util[_0x8f91('0x28')](_0x8f91('0x55'),_0x3b8732[_0x8f91('0x4f')],_0x170a36[_0x8f91('0x56')],md5(_0x170a36[_0x8f91('0x56')]));}else{_0x170a36[_0x8f91('0x54')]='';}return getConnection(_0x3b8732)['then'](function(_0x276944){_0x5279a3=_0x276944;return getUser(_0x3b8732,_0x1395d4[_0x8f91('0xb')],_0x5279a3);})[_0x8f91('0x2a')](function(_0x2a16ee){_0x5ec06b=_0x2a16ee;logger[_0x8f91('0x9')]('The\x20User\x20ID\x20is:',_0x5ec06b['id']);return getEndUser(_0x3b8732,_0x170a36[_0x8f91('0x57')],_0x170a36[_0x8f91('0x58')],_0x5279a3);})[_0x8f91('0x2a')](function(_0x4abfff){_0x5a8c64=_0x4abfff;logger['info'](_0x8f91('0x59'),_0x5a8c64['id']);return getTicket(_0x3b8732,_0x5ec06b,_0x5a8c64,_0x1f55c3,_0x170a36,_0x1f55c3[_0x8f91('0x5a')],_0x5279a3,_0x8f91('0x5b'));})[_0x8f91('0x2a')](function(_0x4a39ff){_0x125302=_0x4a39ff;logger[_0x8f91('0x9')](_0x8f91('0x5c'));logger[_0x8f91('0x9')](_0x8f91('0x5d'),_0x125302['id']);return setRelationship(_0x5279a3,_0x5ec06b,_0x125302,'users');})[_0x8f91('0x2a')](function(){return setRelationship(_0x5279a3,_0x5a8c64,_0x125302,'contacts');})['then'](function(){return getServerInfo(_0x5279a3);})['then'](function(_0x3fc0d3){var _0x99d7c0=parseInt(_0x3fc0d3[_0x8f91('0x5e')][_0x8f91('0x5f')](0x0));var _0xfd7826=util[_0x8f91('0x28')](_0x8f91('0x60'),_0x3b8732['remoteUri'],_0x125302['id']);if(_0x99d7c0>0x6){_0xfd7826=util[_0x8f91('0x28')](_0x8f91('0x61'),_0x3b8732[_0x8f91('0x4d')],_0x125302['id']);}logger['info'](_0x8f91('0x62'),_0x8f91('0x63'));emit(util['format']('user:%s',_0x1395d4[_0x8f91('0xb')]),_0x8f91('0x64'),{'uri':_0xfd7826});})[_0x8f91('0x65')](function(_0x113a2e){logger[_0x8f91('0x66')](_0x8f91('0x62'),JSON[_0x8f91('0x1e')](_0x113a2e));});};exports[_0x8f91('0x67')]=function(_0x1f9a48,_0x349418,_0x4b8883,_0x1e5a1e,_0x18dbce,_0x297498,_0x42e9e8){var _0x3d4136,_0x411ac8,_0x2ceff4,_0x974a82;_0x297498['remoteUri']=intUtil[_0x8f91('0x4e')](_0x297498['remoteUri']);_0x297498[_0x8f91('0x4f')]=intUtil['stripTrailingSlash'](_0x297498[_0x8f91('0x4f')]);def[_0x8f91('0x50')]=util[_0x8f91('0x28')](_0x8f91('0x51'),_0x297498['remoteUri']);if(_0x42e9e8&&_0x42e9e8[_0x8f91('0x68')]&&_0x42e9e8['recordingFormat']!==_0x8f91('0x69')){logger[_0x8f91('0x9')](_0x8f91('0x6a'),_0x8f91('0x53'));_0x349418['recordingURL']=util[_0x8f91('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x297498[_0x8f91('0x4f')],_0x349418[_0x8f91('0x56')],md5(_0x349418[_0x8f91('0x56')]));}return getConnection(_0x297498)[_0x8f91('0x2a')](function(_0x282164){_0x974a82=_0x282164;return getUser(_0x297498,_0x1e5a1e['name'],_0x974a82);})[_0x8f91('0x2a')](function(_0x2d63d9){_0x3d4136=_0x2d63d9;logger[_0x8f91('0x9')](_0x8f91('0x6b'),_0x3d4136['id']);return getEndUser(_0x297498,_0x349418[_0x8f91('0x6c')],_0x349418[_0x8f91('0x6d')],_0x974a82);})['then'](function(_0x5e046d){_0x411ac8=_0x5e046d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x411ac8['id']);return getTicket(_0x297498,_0x3d4136,_0x411ac8,_0x4b8883,_0x349418,_0x4b8883[_0x8f91('0x5a')],_0x974a82,'Outbound');})['then'](function(_0x45a9d0){_0x2ceff4=_0x45a9d0;logger[_0x8f91('0x9')]('Ticket\x20created!');logger[_0x8f91('0x9')](_0x8f91('0x5d'),_0x2ceff4['id']);return setRelationship(_0x974a82,_0x3d4136,_0x2ceff4,_0x8f91('0x6e'));})[_0x8f91('0x2a')](function(){return setRelationship(_0x974a82,_0x411ac8,_0x2ceff4,'contacts');})[_0x8f91('0x2a')](function(){return getServerInfo(_0x974a82);})[_0x8f91('0x2a')](function(_0x389c3a){var _0x3dace6=parseInt(_0x389c3a[_0x8f91('0x5e')][_0x8f91('0x5f')](0x0));var _0x1e84cc=util['format'](_0x8f91('0x60'),_0x297498[_0x8f91('0x4d')],_0x2ceff4['id']);if(_0x3dace6>0x6){_0x1e84cc=util['format'](_0x8f91('0x61'),_0x297498[_0x8f91('0x4d')],_0x2ceff4['id']);}logger[_0x8f91('0x9')]('[OUTBOUND]',_0x8f91('0x63'));emit(util[_0x8f91('0x28')](_0x8f91('0x6f'),_0x1e5a1e[_0x8f91('0xb')]),'trigger:browser:url',{'uri':_0x1e84cc});})[_0x8f91('0x65')](function(_0x5c39b3){logger[_0x8f91('0x66')]('[OUTBOUND]',JSON[_0x8f91('0x1e')](_0x5c39b3));});};exports['unmanaged']=function(_0x2ab279,_0x1d307c,_0x1de36c,_0x206a1,_0x164095,_0x512d22){var _0x1b4e02,_0x40e7c6,_0x45ef08,_0x2738bd;_0x512d22[_0x8f91('0x4d')]=intUtil[_0x8f91('0x4e')](_0x512d22[_0x8f91('0x4d')]);_0x512d22['serverUrl']=intUtil[_0x8f91('0x4e')](_0x512d22[_0x8f91('0x4f')]);def[_0x8f91('0x50')]=util['format']('%s/service/v4_1/rest.php',_0x512d22['remoteUri']);if(_0x164095&&_0x164095['monitor_format']){logger[_0x8f91('0x9')]('['+_0x1d307c['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1d307c[_0x8f91('0x54')]=util[_0x8f91('0x28')](_0x8f91('0x55'),_0x512d22[_0x8f91('0x4f')],_0x1d307c[_0x8f91('0x56')],md5(_0x1d307c[_0x8f91('0x56')]));}else{_0x1d307c[_0x8f91('0x54')]='';}return getConnection(_0x512d22)['then'](function(_0x4ea154){_0x2738bd=_0x4ea154;if(!_[_0x8f91('0x24')](_0x206a1)){return getUser(_0x512d22,_0x206a1[_0x8f91('0xb')],_0x2738bd);}else{return getUser(_0x512d22,null,_0x2738bd);}})[_0x8f91('0x2a')](function(_0x30c6ff){_0x1b4e02=_0x30c6ff;logger[_0x8f91('0x9')](_0x8f91('0x6b'),_0x1b4e02['id']);return getEndUser(_0x512d22,_0x1d307c[_0x8f91('0x57')],_0x1d307c['calleridnum'],_0x2738bd);})[_0x8f91('0x2a')](function(_0x5309eb){_0x40e7c6=_0x5309eb;logger[_0x8f91('0x9')]('The\x20Enduser\x20ID\x20is:',_0x40e7c6['id']);return getTicket(_0x512d22,_0x1b4e02,_0x40e7c6,_0x1de36c,_0x1d307c,_0x1de36c['Fields'],_0x2738bd,'Inbound');})[_0x8f91('0x2a')](function(_0x43549d){_0x45ef08=_0x43549d;logger[_0x8f91('0x9')](_0x8f91('0x5c'));logger[_0x8f91('0x9')](_0x8f91('0x5d'),_0x45ef08['id']);return setRelationship(_0x2738bd,_0x1b4e02,_0x45ef08,'users');})['then'](function(){return setRelationship(_0x2738bd,_0x40e7c6,_0x45ef08,'contacts');})[_0x8f91('0x2a')](function(){return getServerInfo(_0x2738bd);})[_0x8f91('0x65')](function(_0x4e33b3){logger[_0x8f91('0x66')]('['+_0x1d307c['lastevent'][_0x8f91('0x70')]()+']',JSON[_0x8f91('0x1e')](_0x4e33b3));});}; \ No newline at end of file +var _0x2cf9=['getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','Agent\x20found!','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','[HTTP]','merge','type','string','nameField','customField','toLowerCase','idField','push','content','variable','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','contacts','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2cf9,0x162));var _0x92cf=function(_0xb4f1c,_0x50b1b6){_0xb4f1c=_0xb4f1c-0x0;var _0x556cc3=_0x2cf9[_0xb4f1c];return _0x556cc3;};'use strict';var _=require(_0x92cf('0x0'));var rp=require(_0x92cf('0x1'));var BPromise=require('bluebird');var md5=require(_0x92cf('0x2'));var util=require(_0x92cf('0x3'));var Redis=require(_0x92cf('0x4'));var intUtil=require(_0x92cf('0x5'));var config=require('../../../../config/environment');var logger=require(_0x92cf('0x6'))(_0x92cf('0x7'));config[_0x92cf('0x8')]=_[_0x92cf('0x9')](config['redis'],{'host':_0x92cf('0xa'),'port':0x18eb});var io=require(_0x92cf('0xb'))(new Redis(config[_0x92cf('0x8')]));var def={'method':_0x92cf('0xc'),'json':!![]};function emit(_0xd3440,_0x3a0af9,_0x3e25fc){io['to'](_0xd3440)[_0x92cf('0xd')](_0x3a0af9,_0x3e25fc);}function getTicket(_0x3363f5,_0x15934f,_0x3f451a,_0x248a52,_0x4afbb3,_0x72ee22,_0x15de3e,_0x3dae25){logger['info'](_0x92cf('0xe'));var _0x56a782=new Date();var _0x348c2e=[{'name':'name','value':intUtil[_0x92cf('0xf')](_0x248a52[_0x92cf('0x10')],_0x4afbb3,'\x20')},{'name':_0x92cf('0x11'),'value':_0x15934f['id']},{'name':_0x92cf('0x12'),'value':_0x15934f['id']},{'name':_0x92cf('0x13'),'value':intUtil[_0x92cf('0xf')](_0x248a52['Descriptions'],_0x4afbb3,'\x0a')},{'name':_0x92cf('0x14'),'value':_0x56a782[_0x92cf('0x15')]()['slice'](0x0,0x13)[_0x92cf('0x16')]('T','\x20')},{'name':_0x92cf('0x17'),'value':'0'},{'name':_0x92cf('0x18'),'value':'15'},{'name':_0x92cf('0x19'),'value':_0x3f451a['id']},{'name':_0x92cf('0x1a'),'value':_0x92cf('0x1b')},{'name':_0x92cf('0x1c'),'value':_0x3f451a[_0x92cf('0x1d')]},{'name':_0x92cf('0x1e'),'value':_0x3dae25}];if(_0x72ee22[_0x92cf('0x1f')]){_[_0x92cf('0x20')](_0x72ee22,function(_0xab9dc){if(_0x4afbb3[_0xab9dc[_0x92cf('0x21')]]){_0x348c2e['push']({'name':_0xab9dc['idField'],'value':_0x4afbb3[_0xab9dc[_0x92cf('0x21')]]});}});}return request({'form':{'method':_0x92cf('0x22'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'session':_0x15de3e['id'],'module_name':_0x92cf('0x25'),'name_value_list':_0x348c2e})}});}function getAuth(_0x4c321c){return util[_0x92cf('0x26')](_0x92cf('0x27'),new Buffer(_0x4c321c[_0x92cf('0x28')]+':X')[_0x92cf('0x29')](_0x92cf('0x2a')));}function getServerInfo(_0x48ed65){return request({'form':{'method':_0x92cf('0x2b'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'session':_0x48ed65['id']})}});}function getUser(_0x24b7b4,_0xb78930,_0x403e97){if(!_[_0x92cf('0x2c')](_0xb78930)){logger[_0x92cf('0x2d')]('Getting\x20agent\x20with\x20name',_0xb78930);return request({'form':{'method':_0x92cf('0x2e'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'session':_0x403e97['id'],'module_name':'Employees','query':util[_0x92cf('0x26')](_0x92cf('0x2f'),_0xb78930),'order_by':'','offset':'0','select_fields':['id',_0x92cf('0x1d'),_0x92cf('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x92cf('0x31')](function(_0x4079b4){if(_0x4079b4[_0x92cf('0x32')][_0x92cf('0x1f')]){var _0x4399e5=_['find'](_0x4079b4[_0x92cf('0x32')],function(_0x2b6d13){return _0x2b6d13['name_value_list']['user_name']['value']===_0xb78930;});if(_0x4399e5){logger[_0x92cf('0x2d')](_0x92cf('0x33'));return BPromise['resolve']({'id':_0x4399e5[_0x92cf('0x34')]['id'][_0x92cf('0x35')],'name':_0x4399e5[_0x92cf('0x34')][_0x92cf('0x1d')]['value']});}}logger[_0x92cf('0x2d')](_0x92cf('0x36'));return BPromise[_0x92cf('0x37')]({'id':_0x403e97[_0x92cf('0x34')][_0x92cf('0x38')][_0x92cf('0x35')],'name':_0x403e97[_0x92cf('0x34')]['user_name'][_0x92cf('0x35')]});});}else{logger[_0x92cf('0x2d')](_0x92cf('0x39'));return BPromise[_0x92cf('0x37')]({'id':_0x403e97[_0x92cf('0x34')][_0x92cf('0x38')][_0x92cf('0x35')],'name':_0x403e97[_0x92cf('0x34')]['user_name']['value']});}}function getEndUser(_0x18c480,_0x5ef4cc,_0x1c7fbf,_0xa3acfe){logger[_0x92cf('0x2d')](_0x92cf('0x3a'),_0x1c7fbf);return request({'form':{'method':_0x92cf('0x2e'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'session':_0xa3acfe['id'],'module_name':'Contacts','query':util[_0x92cf('0x26')](_0x92cf('0x3b'),_0x1c7fbf),'order_by':'','offset':'0','select_fields':['id','name',_0x92cf('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x92cf('0x31')](function(_0x3b23e8){if(_0x3b23e8['entry_list']['length']){var _0x2a2b53=_[_0x92cf('0x3d')](_0x3b23e8[_0x92cf('0x32')],function(_0x19b103){return _0x19b103[_0x92cf('0x34')][_0x92cf('0x3c')]['value']===_0x1c7fbf;});if(_0x2a2b53){logger['info'](_0x92cf('0x3e'));return BPromise['resolve']({'id':_0x2a2b53[_0x92cf('0x34')]['id']['value'],'name':_0x2a2b53[_0x92cf('0x34')][_0x92cf('0x1d')][_0x92cf('0x35')],'phone':_0x2a2b53[_0x92cf('0x34')]['phone_home'][_0x92cf('0x35')]});}}else{logger[_0x92cf('0x2d')](_0x92cf('0x3f'));return request({'form':{'method':_0x92cf('0x22'),'input_type':'JSON','response_type':_0x92cf('0x23'),'rest_data':JSON['stringify']({'session':_0xa3acfe['id'],'module_name':_0x92cf('0x1b'),'name_value_list':[{'name':_0x92cf('0x40'),'value':_0x5ef4cc!==''?_0x5ef4cc:util[_0x92cf('0x26')]('Caller\x20-\x20%s',_0x1c7fbf)},{'name':'phone_home','value':_0x1c7fbf}]})}})[_0x92cf('0x31')](function(_0x22b5cb){logger[_0x92cf('0x2d')](_0x92cf('0x41'));return BPromise[_0x92cf('0x37')]({'id':_0x22b5cb['id'],'name':_0x22b5cb['entry_list'][_0x92cf('0x40')]['value'],'phone':_0x22b5cb[_0x92cf('0x32')][_0x92cf('0x3c')]['value']});});}});}function request(_0x35b4d0){logger['debug'](_0x92cf('0x42'),JSON[_0x92cf('0x24')](_0x35b4d0));return rp(_[_0x92cf('0x43')](def,_0x35b4d0));}function getTags(_0x29a451,_0x14c822){var _0x730a4b=[];if(_0x29a451&&_0x29a451[_0x92cf('0x1f')]>0x0){_0x730a4b=_['map'](_0x29a451,_0x14c822);}return _0x730a4b;}function getCustomFields(_0x4288fd,_0x112fb8){var _0x1841bc=[];var _0x289524={'custom_fields':[]};if(_0x4288fd['length']>0x0){_[_0x92cf('0x20')](_0x4288fd,function(_0x12a77e){if(_0x12a77e[_0x92cf('0x44')]===_0x92cf('0x45')&&_0x12a77e[_0x92cf('0x46')]&&!_0x12a77e[_0x92cf('0x47')]){_0x289524[_0x12a77e['nameField'][_0x92cf('0x48')]()]=_0x12a77e['content'][_0x92cf('0x29')]();}else if(_0x12a77e[_0x92cf('0x44')]==='string'&&_0x12a77e[_0x92cf('0x49')]&&_0x12a77e[_0x92cf('0x47')]){_0x289524['custom_fields'][_0x92cf('0x4a')]({'id':_0x12a77e['idField'],'value':_0x12a77e[_0x92cf('0x4b')][_0x92cf('0x29')]()});}else if(_0x12a77e[_0x92cf('0x44')]===_0x92cf('0x4c')&&_0x12a77e[_0x92cf('0x21')]&&_0x12a77e[_0x92cf('0x49')]&&_0x12a77e['customField']){_0x112fb8[_0x12a77e[_0x92cf('0x21')]]&&_0x289524[_0x92cf('0x4d')][_0x92cf('0x4a')]({'id':_0x12a77e[_0x92cf('0x49')],'value':_0x112fb8[_0x12a77e['variableName']]['toString']()});}else if(_0x12a77e[_0x92cf('0x44')]===_0x92cf('0x4e')&&_0x12a77e['Variable']&&_0x12a77e['Variable'][_0x92cf('0x1d')]&&_0x12a77e[_0x92cf('0x49')]&&_0x12a77e[_0x92cf('0x47')]){_0x112fb8[_0x12a77e[_0x92cf('0x4f')][_0x92cf('0x1d')][_0x92cf('0x48')]()]&&_0x289524[_0x92cf('0x4d')][_0x92cf('0x4a')]({'id':_0x12a77e['idField'],'value':_0x112fb8[_0x12a77e[_0x92cf('0x4f')]['name'][_0x92cf('0x48')]()]['toString']()});}});}return _0x289524;}function getConnection(_0xc5873a){return request({'method':'POST','form':{'method':_0x92cf('0x50'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'user_auth':{'user_name':_0xc5873a[_0x92cf('0x51')],'password':_0xc5873a[_0x92cf('0x52')],'encryption':'PLAIN'},'application':_0x92cf('0x53')})}})[_0x92cf('0x31')](function(_0x23c128){var _0x4f06c1=_0x23c128;if(_0x4f06c1['id']){def[_0x92cf('0x54')]=_0x4f06c1['id'];return BPromise[_0x92cf('0x37')](_0x4f06c1);}else{throw new Error(util['format'](_0x92cf('0x55'),_0xc5873a['id']));}});}function setRelationship(_0x16a659,_0x2a9ed1,_0x115d0f,_0xd10065){return request({'form':{'method':_0x92cf('0x56'),'input_type':_0x92cf('0x23'),'response_type':_0x92cf('0x23'),'rest_data':JSON[_0x92cf('0x24')]({'session':_0x16a659['id'],'module_name':_0x92cf('0x25'),'module_id':_0x115d0f['id'],'link_field_name':_0xd10065,'related_ids':[_0x2a9ed1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x92cf('0x57')]=function(_0xd37cd6,_0x570feb,_0x134207,_0x490f58,_0x14305f,_0x223372){var _0x3fdb2e,_0x52caa1,_0x22e647,_0x4de7bb;_0x223372[_0x92cf('0x58')]=intUtil[_0x92cf('0x59')](_0x223372['remoteUri']);_0x223372[_0x92cf('0x5a')]=intUtil[_0x92cf('0x59')](_0x223372[_0x92cf('0x5a')]);def[_0x92cf('0x5b')]=util[_0x92cf('0x26')](_0x92cf('0x5c'),_0x223372['remoteUri']);if(_0x14305f&&_0x14305f[_0x92cf('0x5d')]){logger[_0x92cf('0x2d')](_0x92cf('0x5e'),'Recording\x20is\x20enabled!');_0x570feb['recordingURL']=util[_0x92cf('0x26')](_0x92cf('0x5f'),_0x223372[_0x92cf('0x5a')],_0x570feb[_0x92cf('0x60')],md5(_0x570feb['uniqueid']));}else{_0x570feb[_0x92cf('0x61')]='';}return getConnection(_0x223372)[_0x92cf('0x31')](function(_0x5da406){_0x4de7bb=_0x5da406;return getUser(_0x223372,_0x490f58[_0x92cf('0x1d')],_0x4de7bb);})[_0x92cf('0x31')](function(_0x2f88a7){_0x3fdb2e=_0x2f88a7;logger[_0x92cf('0x2d')](_0x92cf('0x62'),_0x3fdb2e['id']);return getEndUser(_0x223372,_0x570feb['calleridname'],_0x570feb[_0x92cf('0x63')],_0x4de7bb);})['then'](function(_0x326768){_0x52caa1=_0x326768;logger[_0x92cf('0x2d')](_0x92cf('0x64'),_0x52caa1['id']);return getTicket(_0x223372,_0x3fdb2e,_0x52caa1,_0x134207,_0x570feb,_0x134207[_0x92cf('0x65')],_0x4de7bb,_0x92cf('0x66'));})[_0x92cf('0x31')](function(_0xfa06f5){_0x22e647=_0xfa06f5;logger[_0x92cf('0x2d')](_0x92cf('0x67'));logger[_0x92cf('0x2d')](_0x92cf('0x68'),_0x22e647['id']);return setRelationship(_0x4de7bb,_0x3fdb2e,_0x22e647,_0x92cf('0x69'));})[_0x92cf('0x31')](function(){return setRelationship(_0x4de7bb,_0x52caa1,_0x22e647,'contacts');})[_0x92cf('0x31')](function(){return getServerInfo(_0x4de7bb);})[_0x92cf('0x31')](function(_0x3735e){var _0x4f8818=parseInt(_0x3735e[_0x92cf('0x6a')][_0x92cf('0x6b')](0x0));var _0x257a0b=util[_0x92cf('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x223372['remoteUri'],_0x22e647['id']);if(_0x4f8818>0x6){_0x257a0b=util[_0x92cf('0x26')](_0x92cf('0x6c'),_0x223372['remoteUri'],_0x22e647['id']);}logger[_0x92cf('0x2d')](_0x92cf('0x5e'),_0x92cf('0x6d'));emit(util[_0x92cf('0x26')](_0x92cf('0x6e'),_0x490f58[_0x92cf('0x1d')]),_0x92cf('0x6f'),{'uri':_0x257a0b});})[_0x92cf('0x70')](function(_0x370e6c){logger[_0x92cf('0x71')](_0x92cf('0x5e'),JSON[_0x92cf('0x24')](_0x370e6c));});};exports['outbound']=function(_0x2074ed,_0x2bba61,_0x170433,_0xbdfceb,_0x409ad0,_0x5b9da0,_0x5e3d33){var _0x38282e,_0xf3d664,_0x15b1a7,_0x595fbd;_0x5b9da0['remoteUri']=intUtil[_0x92cf('0x59')](_0x5b9da0[_0x92cf('0x58')]);_0x5b9da0[_0x92cf('0x5a')]=intUtil[_0x92cf('0x59')](_0x5b9da0[_0x92cf('0x5a')]);def[_0x92cf('0x5b')]=util[_0x92cf('0x26')]('%s/service/v4_1/rest.php',_0x5b9da0[_0x92cf('0x58')]);if(_0x5e3d33&&_0x5e3d33[_0x92cf('0x72')]&&_0x5e3d33[_0x92cf('0x72')]!=='none'){logger['info'](_0x92cf('0x73'),_0x92cf('0x74'));_0x2bba61[_0x92cf('0x61')]=util[_0x92cf('0x26')](_0x92cf('0x5f'),_0x5b9da0[_0x92cf('0x5a')],_0x2bba61['uniqueid'],md5(_0x2bba61[_0x92cf('0x60')]));}return getConnection(_0x5b9da0)['then'](function(_0x46ae51){_0x595fbd=_0x46ae51;return getUser(_0x5b9da0,_0xbdfceb[_0x92cf('0x1d')],_0x595fbd);})[_0x92cf('0x31')](function(_0x109188){_0x38282e=_0x109188;logger[_0x92cf('0x2d')](_0x92cf('0x62'),_0x38282e['id']);return getEndUser(_0x5b9da0,_0x2bba61[_0x92cf('0x75')],_0x2bba61[_0x92cf('0x76')],_0x595fbd);})['then'](function(_0x237a41){_0xf3d664=_0x237a41;logger[_0x92cf('0x2d')](_0x92cf('0x64'),_0xf3d664['id']);return getTicket(_0x5b9da0,_0x38282e,_0xf3d664,_0x170433,_0x2bba61,_0x170433[_0x92cf('0x65')],_0x595fbd,_0x92cf('0x77'));})[_0x92cf('0x31')](function(_0x1df54e){_0x15b1a7=_0x1df54e;logger[_0x92cf('0x2d')](_0x92cf('0x67'));logger['info'](_0x92cf('0x68'),_0x15b1a7['id']);return setRelationship(_0x595fbd,_0x38282e,_0x15b1a7,_0x92cf('0x69'));})[_0x92cf('0x31')](function(){return setRelationship(_0x595fbd,_0xf3d664,_0x15b1a7,_0x92cf('0x78'));})[_0x92cf('0x31')](function(){return getServerInfo(_0x595fbd);})[_0x92cf('0x31')](function(_0xbb119e){var _0x73dedd=parseInt(_0xbb119e[_0x92cf('0x6a')]['charAt'](0x0));var _0x5b8a5e=util[_0x92cf('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5b9da0[_0x92cf('0x58')],_0x15b1a7['id']);if(_0x73dedd>0x6){_0x5b8a5e=util['format'](_0x92cf('0x6c'),_0x5b9da0[_0x92cf('0x58')],_0x15b1a7['id']);}logger['info'](_0x92cf('0x73'),_0x92cf('0x6d'));emit(util[_0x92cf('0x26')](_0x92cf('0x6e'),_0xbdfceb[_0x92cf('0x1d')]),_0x92cf('0x6f'),{'uri':_0x5b8a5e});})[_0x92cf('0x70')](function(_0x3a1660){logger[_0x92cf('0x71')](_0x92cf('0x73'),JSON['stringify'](_0x3a1660));});};exports['unmanaged']=function(_0x17ecc8,_0x37ad43,_0x19aef4,_0x1f260e,_0x5472a8,_0x3a8da8){var _0x36ecb1,_0x190da4,_0xf35b4c,_0x329d52;_0x3a8da8[_0x92cf('0x58')]=intUtil[_0x92cf('0x59')](_0x3a8da8[_0x92cf('0x58')]);_0x3a8da8[_0x92cf('0x5a')]=intUtil[_0x92cf('0x59')](_0x3a8da8[_0x92cf('0x5a')]);def[_0x92cf('0x5b')]=util[_0x92cf('0x26')](_0x92cf('0x5c'),_0x3a8da8[_0x92cf('0x58')]);if(_0x5472a8&&_0x5472a8[_0x92cf('0x5d')]){logger[_0x92cf('0x2d')]('['+_0x37ad43[_0x92cf('0x79')][_0x92cf('0x7a')]()+']',_0x92cf('0x74'));_0x37ad43[_0x92cf('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a8da8[_0x92cf('0x5a')],_0x37ad43[_0x92cf('0x60')],md5(_0x37ad43['uniqueid']));}else{_0x37ad43[_0x92cf('0x61')]='';}return getConnection(_0x3a8da8)[_0x92cf('0x31')](function(_0x5abc38){_0x329d52=_0x5abc38;if(!_[_0x92cf('0x2c')](_0x1f260e)){return getUser(_0x3a8da8,_0x1f260e[_0x92cf('0x1d')],_0x329d52);}else{return getUser(_0x3a8da8,null,_0x329d52);}})[_0x92cf('0x31')](function(_0x3cf43e){_0x36ecb1=_0x3cf43e;logger[_0x92cf('0x2d')](_0x92cf('0x62'),_0x36ecb1['id']);return getEndUser(_0x3a8da8,_0x37ad43['calleridname'],_0x37ad43[_0x92cf('0x63')],_0x329d52);})[_0x92cf('0x31')](function(_0x2e7eb2){_0x190da4=_0x2e7eb2;logger['info'](_0x92cf('0x64'),_0x190da4['id']);return getTicket(_0x3a8da8,_0x36ecb1,_0x190da4,_0x19aef4,_0x37ad43,_0x19aef4['Fields'],_0x329d52,_0x92cf('0x66'));})['then'](function(_0x2fdac4){_0xf35b4c=_0x2fdac4;logger[_0x92cf('0x2d')]('Ticket\x20created!');logger['info'](_0x92cf('0x68'),_0xf35b4c['id']);return setRelationship(_0x329d52,_0x36ecb1,_0xf35b4c,_0x92cf('0x69'));})['then'](function(){return setRelationship(_0x329d52,_0x190da4,_0xf35b4c,'contacts');})[_0x92cf('0x31')](function(){return getServerInfo(_0x329d52);})['catch'](function(_0x2b0f0f){logger[_0x92cf('0x71')]('['+_0x37ad43['lastevent'][_0x92cf('0x7a')]()+']',JSON[_0x92cf('0x24')](_0x2b0f0f));});}; \ 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 c6ba385..2bb3242 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 _0x90e7=['Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variableName','customVariable'];(function(_0x399e60,_0x41875d){var _0x6948c0=function(_0x39e820){while(--_0x39e820){_0x399e60['push'](_0x399e60['shift']());}};_0x6948c0(++_0x41875d);}(_0x90e7,0x1b5));var _0x790e=function(_0x335d2d,_0x26e065){_0x335d2d=_0x335d2d-0x0;var _0x379073=_0x90e7[_0x335d2d];return _0x379073;};'use strict';var _=require(_0x790e('0x0'));var util=require(_0x790e('0x1'));exports[_0x790e('0x2')]=function(_0x3a928a,_0x431a95,_0x2f35d3){var _0xca78af=[];if(_0x3a928a[_0x790e('0x3')]>0x0){var _0x512cc7=_[_0x790e('0x4')](_0x3a928a,['id']);for(var _0x236a07=0x0;_0x236a07<_0x512cc7['length'];_0x236a07++){var _0x514f57=_0x512cc7[_0x236a07];if(_0x514f57['type']===_0x790e('0x5')){_0xca78af[_0x790e('0x6')](_0x514f57[_0x790e('0x7')]);}else if(_0x514f57[_0x790e('0x8')]==='variable'&&_0x514f57['variableName']){_0x431a95[_0x514f57[_0x790e('0x9')]]&&_0xca78af['push'](_0x431a95[_0x514f57[_0x790e('0x9')]]['toString']());}else if(_0x514f57['type']===_0x790e('0xa')&&_0x514f57['Variable']&&_0x514f57[_0x790e('0xb')][_0x790e('0xc')]){_0x431a95[_0x514f57['Variable']['name'][_0x790e('0xd')]()]&&_0xca78af[_0x790e('0x6')](_0x431a95[_0x514f57[_0x790e('0xb')][_0x790e('0xc')][_0x790e('0xd')]()]['toString']());}else if(_0x514f57[_0x790e('0x8')]===_0x790e('0xe')){if(_0x514f57[_0x790e('0xf')]===_0x790e('0x5')&&_0x514f57[_0x790e('0x10')]){_0xca78af[_0x790e('0x6')](util[_0x790e('0x11')](_0x790e('0x12'),_0x514f57[_0x790e('0x10')],_0x514f57['keyContent']));}else if(_0x514f57['keyType']===_0x790e('0x13')&&_0x514f57['variableName']&&_0x514f57['key']){_0x431a95[_0x514f57[_0x790e('0x9')]]&&_0xca78af[_0x790e('0x6')](util[_0x790e('0x11')]('%s:\x20%s',_0x514f57[_0x790e('0x10')],_0x431a95[_0x514f57[_0x790e('0x9')]]));}else if(_0x514f57[_0x790e('0xf')]==='customVariable'&&_0x514f57[_0x790e('0xb')]&&_0x514f57[_0x790e('0xb')]['name']&&_0x514f57[_0x790e('0x10')]){_0x431a95[_0x514f57[_0x790e('0xb')][_0x790e('0xc')][_0x790e('0xd')]()]&&_0xca78af[_0x790e('0x6')](util[_0x790e('0x11')](_0x790e('0x12'),_0x514f57[_0x790e('0x10')],_0x431a95[_0x514f57['Variable'][_0x790e('0xc')][_0x790e('0xd')]()]));}}}}return _0xca78af[_0x790e('0x14')](_0x2f35d3);};exports[_0x790e('0x15')]=function(_0x154c19){var _0x50a98d=_0x154c19[_0x790e('0x16')](-0x1);if(_0x50a98d==='/'){_0x154c19=_0x154c19[_0x790e('0x17')](0x0,_0x154c19[_0x790e('0x18')](_0x50a98d));}return _0x154c19;};exports[_0x790e('0x19')]=function(_0x331f65){if(!_[_0x790e('0x1a')](_0x331f65)&&_0x331f65!==''){var _0x5252b5=/^(([^<>()\[\]\\.,;:\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 _0x5252b5[_0x790e('0x1b')](String(_0x331f65)[_0x790e('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xcbd0=['name','push','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','content','variable','variableName','toString','customVariable','Variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbd0,0xef));var _0x0cbd=function(_0x1ee08d,_0x2bcd52){_0x1ee08d=_0x1ee08d-0x0;var _0x45f092=_0xcbd0[_0x1ee08d];return _0x45f092;};'use strict';var _=require(_0x0cbd('0x0'));var util=require(_0x0cbd('0x1'));exports[_0x0cbd('0x2')]=function(_0x499bd7,_0xa2b15c,_0x42f316){var _0x5f5822=[];if(_0x499bd7[_0x0cbd('0x3')]>0x0){var _0x54ecca=_[_0x0cbd('0x4')](_0x499bd7,['id']);for(var _0x21bba1=0x0;_0x21bba1<_0x54ecca[_0x0cbd('0x3')];_0x21bba1++){var _0x5ac286=_0x54ecca[_0x21bba1];if(_0x5ac286[_0x0cbd('0x5')]===_0x0cbd('0x6')){_0x5f5822['push'](_0x5ac286[_0x0cbd('0x7')]);}else if(_0x5ac286[_0x0cbd('0x5')]===_0x0cbd('0x8')&&_0x5ac286['variableName']){_0xa2b15c[_0x5ac286['variableName']]&&_0x5f5822['push'](_0xa2b15c[_0x5ac286[_0x0cbd('0x9')]][_0x0cbd('0xa')]());}else if(_0x5ac286['type']===_0x0cbd('0xb')&&_0x5ac286[_0x0cbd('0xc')]&&_0x5ac286[_0x0cbd('0xc')][_0x0cbd('0xd')]){_0xa2b15c[_0x5ac286['Variable']['name']['toLowerCase']()]&&_0x5f5822[_0x0cbd('0xe')](_0xa2b15c[_0x5ac286[_0x0cbd('0xc')][_0x0cbd('0xd')][_0x0cbd('0xf')]()][_0x0cbd('0xa')]());}else if(_0x5ac286[_0x0cbd('0x5')]===_0x0cbd('0x10')){if(_0x5ac286[_0x0cbd('0x11')]===_0x0cbd('0x6')&&_0x5ac286[_0x0cbd('0x12')]){_0x5f5822[_0x0cbd('0xe')](util['format'](_0x0cbd('0x13'),_0x5ac286[_0x0cbd('0x12')],_0x5ac286[_0x0cbd('0x14')]));}else if(_0x5ac286['keyType']===_0x0cbd('0x8')&&_0x5ac286[_0x0cbd('0x9')]&&_0x5ac286[_0x0cbd('0x12')]){_0xa2b15c[_0x5ac286['variableName']]&&_0x5f5822[_0x0cbd('0xe')](util['format'](_0x0cbd('0x13'),_0x5ac286[_0x0cbd('0x12')],_0xa2b15c[_0x5ac286[_0x0cbd('0x9')]]));}else if(_0x5ac286[_0x0cbd('0x11')]===_0x0cbd('0xb')&&_0x5ac286[_0x0cbd('0xc')]&&_0x5ac286[_0x0cbd('0xc')][_0x0cbd('0xd')]&&_0x5ac286['key']){_0xa2b15c[_0x5ac286[_0x0cbd('0xc')][_0x0cbd('0xd')][_0x0cbd('0xf')]()]&&_0x5f5822[_0x0cbd('0xe')](util[_0x0cbd('0x15')](_0x0cbd('0x13'),_0x5ac286[_0x0cbd('0x12')],_0xa2b15c[_0x5ac286['Variable'][_0x0cbd('0xd')][_0x0cbd('0xf')]()]));}}}}return _0x5f5822[_0x0cbd('0x16')](_0x42f316);};exports[_0x0cbd('0x17')]=function(_0x5159f2){var _0x37e927=_0x5159f2[_0x0cbd('0x18')](-0x1);if(_0x37e927==='/'){_0x5159f2=_0x5159f2['substring'](0x0,_0x5159f2[_0x0cbd('0x19')](_0x37e927));}return _0x5159f2;};exports[_0x0cbd('0x1a')]=function(_0x1298a3){if(!_[_0x0cbd('0x1b')](_0x1298a3)&&_0x1298a3!==''){var _0x4253eb=/^(([^<>()\[\]\\.,;:\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 _0x4253eb['test'](String(_0x1298a3)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 5f0e91f..6787592 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(_0x171b2f,_0x337677){var _0x4678d8=function(_0x160fce){while(--_0x160fce){_0x171b2f['push'](_0x171b2f['shift']());}};_0x4678d8(++_0x337677);}(_0xe706,0xa3));var _0x6e70=function(_0x22ada8,_0x23a7ea){_0x22ada8=_0x22ada8-0x0;var _0x506e36=_0xe706[_0x22ada8];return _0x506e36;};'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(_0x157e4b,_0x4c00f3){var _0x4e8947=function(_0x3410a1){while(--_0x3410a1){_0x157e4b['push'](_0x157e4b['shift']());}};_0x4e8947(++_0x4c00f3);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 3068b40..9d3a5b9 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 _0xff65=['Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','format','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','The\x20Enduser\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/logger','redis','defaults','application/json','Creating\x20new\x20ticket...','POST','merge','Tags','name','getString','Descriptions','then','info','Ticket\x20created!','ticket','validateEmail'];(function(_0x3d309c,_0x242f4c){var _0x241187=function(_0x594990){while(--_0x594990){_0x3d309c['push'](_0x3d309c['shift']());}};_0x241187(++_0x242f4c);}(_0xff65,0x135));var _0x5ff6=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xff65[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x5ff6('0x0'));var rp=require(_0x5ff6('0x1'));var md5=require(_0x5ff6('0x2'));var util=require(_0x5ff6('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5ff6('0x4'));var config=require('../../../../config/environment');var logger=require(_0x5ff6('0x5'))('zendesk');config[_0x5ff6('0x6')]=_[_0x5ff6('0x7')](config[_0x5ff6('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5ff6('0x6')]));function emit(_0x8da0e4,_0x282bfe,_0x338cb3){io['to'](_0x8da0e4)['emit'](_0x282bfe,_0x338cb3);}var headers={'Content-Type':_0x5ff6('0x8'),'Accept':_0x5ff6('0x8')};function getTicket(_0x2f9c07,_0xfb7e38,_0x23bfce,_0x3b0279,_0x31f0bb){logger['info'](_0x5ff6('0x9'));return request({'uri':util['format']('%s/tickets.json',_0x2f9c07['remoteUri']),'method':_0x5ff6('0xa'),'body':{'ticket':_[_0x5ff6('0xb')]({'requester_id':_0x23bfce['id'],'submitter_id':_0xfb7e38?_0xfb7e38['id']:undefined,'assignee_id':_0xfb7e38?_0xfb7e38['id']:undefined,'tags':getTags(_0x3b0279[_0x5ff6('0xc')],_0x5ff6('0xd')),'subject':intUtil[_0x5ff6('0xe')](_0x3b0279['Subjects'],_0x31f0bb,'\x20'),'description':intUtil[_0x5ff6('0xe')](_0x3b0279[_0x5ff6('0xf')],_0x31f0bb,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3b0279['Descriptions'],_0x31f0bb,'\x0a')}},getCustomFields(_0x3b0279['Fields'],_0x31f0bb))}})[_0x5ff6('0x10')](function(_0x2dac43){logger[_0x5ff6('0x11')](_0x5ff6('0x12'));return _0x2dac43[_0x5ff6('0x13')];});}function getUser(_0x6be79,_0x37f5e0){if(intUtil[_0x5ff6('0x14')](_0x37f5e0)){logger[_0x5ff6('0x11')](_0x5ff6('0x15'),_0x37f5e0);return request({'uri':util['format'](_0x5ff6('0x16'),_0x6be79[_0x5ff6('0x17')]),'qs':{'query':util[_0x5ff6('0x18')](_0x5ff6('0x19'),_0x37f5e0)}})[_0x5ff6('0x10')](function(_0x1f7edd){if(_0x1f7edd['count']){logger[_0x5ff6('0x11')](_0x5ff6('0x1a'));return _[_0x5ff6('0x1b')](_0x1f7edd[_0x5ff6('0x1c')],{'email':_0x37f5e0,'role':_0x5ff6('0x1d')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5ff6('0x18')](_0x5ff6('0x1e'),_0x6be79[_0x5ff6('0x17')])})[_0x5ff6('0x10')](function(_0x3d665c){logger[_0x5ff6('0x11')](_0x5ff6('0x1f'));return _0x3d665c[_0x5ff6('0x20')];});}});}else{logger['info'](_0x5ff6('0x21'));return request({'uri':util['format']('%s/users/me.json',_0x6be79[_0x5ff6('0x17')])})['then'](function(_0x4f9cf4){logger['info'](_0x5ff6('0x1f'));return _0x4f9cf4['user'];});}}function getEndUser(_0x5ab3dd,_0x5bee99,_0x126f0a){logger[_0x5ff6('0x11')](_0x5ff6('0x22'),_0x126f0a);return request({'uri':util[_0x5ff6('0x18')](_0x5ff6('0x16'),_0x5ab3dd['remoteUri']),'qs':{'query':util[_0x5ff6('0x18')]('type:user\x20role:end-user\x20phone:%s',_0x126f0a)}})['then'](function(_0x22943c){var _0x161906;if(_0x22943c['results']['length']){_0x22943c['results']=_[_0x5ff6('0x23')](_0x22943c['results'],{'suspended':![],'role':_0x5ff6('0x24')});if(_0x22943c[_0x5ff6('0x1c')]['length']){_0x161906=_[_0x5ff6('0x25')](_0x22943c[_0x5ff6('0x1c')]);}}if(_0x161906){logger[_0x5ff6('0x11')](_0x5ff6('0x26'));return _0x161906;}else{logger[_0x5ff6('0x11')](_0x5ff6('0x27'));return request({'uri':util[_0x5ff6('0x18')]('%s/users.json',_0x5ab3dd[_0x5ff6('0x17')]),'method':_0x5ff6('0xa'),'body':{'user':{'role':_0x5ff6('0x24'),'name':util[_0x5ff6('0x18')](_0x5ff6('0x28'),_0x5bee99||_0x126f0a),'phone':_0x126f0a}}})[_0x5ff6('0x10')](function(_0x243cf4){logger['info'](_0x5ff6('0x29'));return _0x243cf4[_0x5ff6('0x20')];});}});}function getAuth(_0x3d69f9){var _0x224c0a;if(_0x3d69f9[_0x5ff6('0x2a')]===_0x5ff6('0x2b')){_0x224c0a=util[_0x5ff6('0x18')](_0x5ff6('0x2c'),_0x3d69f9['username'],_0x3d69f9[_0x5ff6('0x2b')]);}else if(_0x3d69f9['authType']===_0x5ff6('0x2d')){_0x224c0a=util['format'](_0x5ff6('0x2e'),_0x3d69f9[_0x5ff6('0x2f')],_0x3d69f9[_0x5ff6('0x2d')]);}return util[_0x5ff6('0x18')](_0x5ff6('0x30'),new Buffer(_0x224c0a)[_0x5ff6('0x31')](_0x5ff6('0x32')));}function request(_0x40e4b2){logger[_0x5ff6('0x33')](_0x5ff6('0x34'),JSON[_0x5ff6('0x35')](_0x40e4b2));return rp(_[_0x5ff6('0x7')](_0x40e4b2,{'method':_0x5ff6('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x21af5f,_0x316329){var _0xdc148e=[];if(_0x21af5f&&_0x21af5f[_0x5ff6('0x37')]>0x0){_0xdc148e=_[_0x5ff6('0x38')](_0x21af5f,_0x316329);}return _0xdc148e;}function getCustomFields(_0x1a8366,_0x64f0c5){var _0x24581f=[];var _0x528cad={'custom_fields':[]};if(_0x1a8366[_0x5ff6('0x37')]>0x0){_[_0x5ff6('0x39')](_0x1a8366,function(_0x7d4ad9){if(_[_0x5ff6('0x3a')]([_0x5ff6('0x3b'),_0x5ff6('0x3c')],_0x7d4ad9[_0x5ff6('0x3d')])&&_0x7d4ad9[_0x5ff6('0x3e')]&&!_0x7d4ad9[_0x5ff6('0x3f')]){_0x528cad[_0x7d4ad9[_0x5ff6('0x3e')][_0x5ff6('0x40')]()]=_0x7d4ad9[_0x5ff6('0x41')]['toString']();}else if(_['includes'](['string',_0x5ff6('0x3c')],_0x7d4ad9[_0x5ff6('0x3d')])&&_0x7d4ad9[_0x5ff6('0x42')]&&_0x7d4ad9['customField']){_0x528cad[_0x5ff6('0x43')][_0x5ff6('0x44')]({'id':_0x7d4ad9[_0x5ff6('0x42')],'value':_0x7d4ad9[_0x5ff6('0x41')][_0x5ff6('0x31')]()});}else if(_0x7d4ad9[_0x5ff6('0x3d')]===_0x5ff6('0x45')&&_0x7d4ad9['variableName']&&_0x7d4ad9[_0x5ff6('0x42')]&&_0x7d4ad9[_0x5ff6('0x3f')]){_0x64f0c5[_0x7d4ad9[_0x5ff6('0x46')]]&&_0x528cad['custom_fields'][_0x5ff6('0x44')]({'id':_0x7d4ad9[_0x5ff6('0x42')],'value':_0x64f0c5[_0x7d4ad9[_0x5ff6('0x46')]][_0x5ff6('0x31')]()});}else if(_0x7d4ad9[_0x5ff6('0x3d')]===_0x5ff6('0x47')&&_0x7d4ad9[_0x5ff6('0x48')]&&_0x7d4ad9[_0x5ff6('0x48')][_0x5ff6('0xd')]&&_0x7d4ad9[_0x5ff6('0x42')]&&_0x7d4ad9[_0x5ff6('0x3f')]){_0x64f0c5[_0x7d4ad9['Variable'][_0x5ff6('0xd')][_0x5ff6('0x40')]()]&&_0x528cad[_0x5ff6('0x43')][_0x5ff6('0x44')]({'id':_0x7d4ad9[_0x5ff6('0x42')],'value':_0x64f0c5[_0x7d4ad9[_0x5ff6('0x48')][_0x5ff6('0xd')][_0x5ff6('0x40')]()][_0x5ff6('0x31')]()});}});}return _0x528cad;}exports[_0x5ff6('0x49')]=function(_0x2b2f59,_0xf1da42,_0x2c9e8c,_0x5886e5,_0x1b26fb,_0x45f56d){var _0x181296,_0x4612d9;_0x45f56d[_0x5ff6('0x17')]=intUtil['stripTrailingSlash'](_0x45f56d[_0x5ff6('0x17')]);_0x45f56d['serverUrl']=intUtil[_0x5ff6('0x4a')](_0x45f56d['serverUrl']);if(_0x1b26fb&&_0x1b26fb[_0x5ff6('0x4b')]){logger[_0x5ff6('0x11')](_0x5ff6('0x4c'),_0x5ff6('0x4d'));_0xf1da42[_0x5ff6('0x4e')]=util[_0x5ff6('0x18')](_0x5ff6('0x4f'),_0x45f56d[_0x5ff6('0x50')],_0xf1da42['uniqueid'],md5(_0xf1da42[_0x5ff6('0x51')]));}else{_0xf1da42[_0x5ff6('0x4e')]='';}headers['Authorization']=getAuth(_0x45f56d);return getUser(_0x45f56d,_0x5886e5[_0x5ff6('0x52')])[_0x5ff6('0x10')](function(_0xdf8ea1){_0x181296=_0xdf8ea1;logger[_0x5ff6('0x11')](_0x5ff6('0x53'),_0x181296['id']);return getEndUser(_0x45f56d,_0xf1da42[_0x5ff6('0x54')],_0xf1da42[_0x5ff6('0x55')]);})[_0x5ff6('0x10')](function(_0x5e585e){_0x4612d9=_0x5e585e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4612d9['id']);return getTicket(_0x45f56d,_0x181296,_0x4612d9,_0x2c9e8c,_0xf1da42);})['then'](function(_0x349804){if(_0x349804){logger[_0x5ff6('0x11')](_0x5ff6('0x56'),_0x349804['id']);switch(_0x45f56d[_0x5ff6('0x3d')]){case _0x5ff6('0x57'):logger[_0x5ff6('0x11')](_0x5ff6('0x4c'),_0x5ff6('0x58'));return request({'uri':util['format'](_0x5ff6('0x59'),_0x45f56d[_0x5ff6('0x17')],_0x181296['id'],_0x349804['id']),'method':_0x5ff6('0xa')});case'newTab':logger[_0x5ff6('0x11')](_0x5ff6('0x4c'),_0x5ff6('0x5a'));emit(util['format'](_0x5ff6('0x5b'),_0x5886e5[_0x5ff6('0xd')]),'trigger:browser:url',{'uri':util[_0x5ff6('0x18')]('%s/agent/tickets/%s',_0x45f56d['remoteUri'][_0x5ff6('0x5c')](_0x5ff6('0x5d'),''),_0x349804['id'])});break;default:logger[_0x5ff6('0x5e')]('[QUEUE]',_0x5ff6('0x5f'));}}})[_0x5ff6('0x60')](function(_0x343f1e){logger[_0x5ff6('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5ff6('0x61')](_0x343f1e,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x242b30,_0x73c8ae,_0x282fd7,_0x10f183,_0x2c3112,_0x3936fe,_0xec2cc6){var _0x5a5a6b,_0x5dce0b;_0x3936fe['remoteUri']=intUtil[_0x5ff6('0x4a')](_0x3936fe['remoteUri']);_0x3936fe['serverUrl']=intUtil[_0x5ff6('0x4a')](_0x3936fe[_0x5ff6('0x50')]);if(_0xec2cc6&&_0xec2cc6['recordingFormat']&&_0xec2cc6[_0x5ff6('0x62')]!==_0x5ff6('0x63')){logger['info'](_0x5ff6('0x64'),_0x5ff6('0x4d'));_0x73c8ae['recordingURL']=util[_0x5ff6('0x18')](_0x5ff6('0x4f'),_0x3936fe[_0x5ff6('0x50')],_0x73c8ae[_0x5ff6('0x51')],md5(_0x73c8ae[_0x5ff6('0x51')]));}headers[_0x5ff6('0x65')]=getAuth(_0x3936fe);return getUser(_0x3936fe,_0x10f183[_0x5ff6('0x52')])[_0x5ff6('0x10')](function(_0x3ff044){_0x5a5a6b=_0x3ff044;logger[_0x5ff6('0x11')]('The\x20User\x20ID\x20is:',_0x5a5a6b['id']);return getEndUser(_0x3936fe,_0x73c8ae[_0x5ff6('0x66')],_0x73c8ae[_0x5ff6('0x67')]);})[_0x5ff6('0x10')](function(_0x178070){_0x5dce0b=_0x178070;logger[_0x5ff6('0x11')]('The\x20Enduser\x20ID\x20is:',_0x5dce0b['id']);return getTicket(_0x3936fe,_0x5a5a6b,_0x5dce0b,_0x282fd7,_0x73c8ae);})[_0x5ff6('0x10')](function(_0x17b53d){if(_0x17b53d){logger[_0x5ff6('0x11')](_0x5ff6('0x56'),_0x17b53d['id']);switch(_0x3936fe[_0x5ff6('0x3d')]){case _0x5ff6('0x57'):logger['info'](_0x5ff6('0x64'),_0x5ff6('0x58'));return request({'uri':util[_0x5ff6('0x18')](_0x5ff6('0x59'),_0x3936fe[_0x5ff6('0x17')],_0x5a5a6b['id'],_0x17b53d['id']),'method':_0x5ff6('0xa')});case'newTab':logger[_0x5ff6('0x11')](_0x5ff6('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5ff6('0x18')](_0x5ff6('0x5b'),_0x10f183[_0x5ff6('0xd')]),_0x5ff6('0x68'),{'uri':util[_0x5ff6('0x18')](_0x5ff6('0x69'),_0x3936fe[_0x5ff6('0x17')][_0x5ff6('0x5c')]('/api/v2',''),_0x17b53d['id'])});break;default:logger[_0x5ff6('0x5e')](_0x5ff6('0x64'),_0x5ff6('0x5f'));}}})[_0x5ff6('0x60')](function(_0x19e642){logger['error'](_0x5ff6('0x6a'),util['inspect'](_0x19e642,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x274c3e,_0x1d9af6,_0x366cac,_0x36cedd,_0x275813,_0x5463b2){var _0x8d70cb,_0x386fc7;_0x5463b2[_0x5ff6('0x17')]=intUtil[_0x5ff6('0x4a')](_0x5463b2[_0x5ff6('0x17')]);_0x5463b2[_0x5ff6('0x50')]=intUtil['stripTrailingSlash'](_0x5463b2[_0x5ff6('0x50')]);if(_0x275813&&_0x275813[_0x5ff6('0x4b')]){logger[_0x5ff6('0x11')]('['+_0x1d9af6[_0x5ff6('0x6b')]['toUpperCase']()+']',_0x5ff6('0x4d'));_0x1d9af6[_0x5ff6('0x4e')]=util[_0x5ff6('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5463b2[_0x5ff6('0x50')],_0x1d9af6[_0x5ff6('0x51')],md5(_0x1d9af6['uniqueid']));}else{_0x1d9af6['recordingURL']='';}headers[_0x5ff6('0x65')]=getAuth(_0x5463b2);return getUser(_0x5463b2)['then'](function(_0x1bdb1d){_0x8d70cb=_0x1bdb1d;logger[_0x5ff6('0x11')](_0x5ff6('0x53'),_0x8d70cb['id']);return getEndUser(_0x5463b2,_0x1d9af6[_0x5ff6('0x54')],_0x1d9af6[_0x5ff6('0x55')]);})[_0x5ff6('0x10')](function(_0x62a6f0){_0x386fc7=_0x62a6f0;logger[_0x5ff6('0x11')](_0x5ff6('0x6c'),_0x386fc7['id']);return getTicket(_0x5463b2,_0x8d70cb,_0x386fc7,_0x366cac,_0x1d9af6);})['then'](function(_0xef4d03){if(_0xef4d03){logger[_0x5ff6('0x11')](_0x5ff6('0x56'),_0xef4d03['id']);}})[_0x5ff6('0x60')](function(_0x153024){logger['error']('['+_0x1d9af6[_0x5ff6('0x6b')][_0x5ff6('0x6d')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x153024,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9030=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','/api/v2','error','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','integrationTab','Displaying\x20ticket\x20to\x20agent...','replace','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','toString','base64','debug','[HTTP]','stringify','defaults','map','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x9030,0x8c));var _0x0903=function(_0x3f0a4e,_0x3b74e0){_0x3f0a4e=_0x3f0a4e-0x0;var _0x3f5b25=_0x9030[_0x3f0a4e];return _0x3f5b25;};'use strict';var _=require(_0x0903('0x0'));var rp=require(_0x0903('0x1'));var md5=require(_0x0903('0x2'));var util=require(_0x0903('0x3'));var Redis=require('ioredis');var intUtil=require(_0x0903('0x4'));var config=require(_0x0903('0x5'));var logger=require(_0x0903('0x6'))('zendesk');config[_0x0903('0x7')]=_['defaults'](config[_0x0903('0x7')],{'host':_0x0903('0x8'),'port':0x18eb});var io=require(_0x0903('0x9'))(new Redis(config[_0x0903('0x7')]));function emit(_0x74531f,_0xab10d,_0x58d84f){io['to'](_0x74531f)[_0x0903('0xa')](_0xab10d,_0x58d84f);}var headers={'Content-Type':_0x0903('0xb'),'Accept':_0x0903('0xb')};function getTicket(_0x3032a1,_0x4d9e30,_0x12d47b,_0x375d9c,_0x14635b){logger[_0x0903('0xc')](_0x0903('0xd'));return request({'uri':util[_0x0903('0xe')](_0x0903('0xf'),_0x3032a1[_0x0903('0x10')]),'method':_0x0903('0x11'),'body':{'ticket':_[_0x0903('0x12')]({'requester_id':_0x12d47b['id'],'submitter_id':_0x4d9e30?_0x4d9e30['id']:undefined,'assignee_id':_0x4d9e30?_0x4d9e30['id']:undefined,'tags':getTags(_0x375d9c[_0x0903('0x13')],_0x0903('0x14')),'subject':intUtil[_0x0903('0x15')](_0x375d9c[_0x0903('0x16')],_0x14635b,'\x20'),'description':intUtil[_0x0903('0x15')](_0x375d9c['Descriptions'],_0x14635b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0903('0x15')](_0x375d9c[_0x0903('0x17')],_0x14635b,'\x0a')}},getCustomFields(_0x375d9c[_0x0903('0x18')],_0x14635b))}})[_0x0903('0x19')](function(_0x176e34){logger[_0x0903('0xc')](_0x0903('0x1a'));return _0x176e34['ticket'];});}function getUser(_0x4f6baa,_0x279cca){if(intUtil[_0x0903('0x1b')](_0x279cca)){logger[_0x0903('0xc')](_0x0903('0x1c'),_0x279cca);return request({'uri':util[_0x0903('0xe')]('%s/search.json',_0x4f6baa[_0x0903('0x10')]),'qs':{'query':util['format'](_0x0903('0x1d'),_0x279cca)}})['then'](function(_0x1345fc){if(_0x1345fc['count']){logger[_0x0903('0xc')](_0x0903('0x1e'));return _['find'](_0x1345fc['results'],{'email':_0x279cca,'role':_0x0903('0x1f')});}else{logger[_0x0903('0xc')](_0x0903('0x20'));return request({'uri':util['format'](_0x0903('0x21'),_0x4f6baa[_0x0903('0x10')])})[_0x0903('0x19')](function(_0x52cd91){logger['info'](_0x0903('0x22'));return _0x52cd91['user'];});}});}else{logger['info'](_0x0903('0x20'));return request({'uri':util[_0x0903('0xe')](_0x0903('0x21'),_0x4f6baa[_0x0903('0x10')])})['then'](function(_0x484e35){logger['info']('Admin\x20account\x20selected.');return _0x484e35[_0x0903('0x23')];});}}function getEndUser(_0x142ffb,_0x8d9ed0,_0x52c09f){logger[_0x0903('0xc')](_0x0903('0x24'),_0x52c09f);return request({'uri':util[_0x0903('0xe')](_0x0903('0x25'),_0x142ffb[_0x0903('0x10')]),'qs':{'query':util[_0x0903('0xe')](_0x0903('0x26'),_0x52c09f)}})[_0x0903('0x19')](function(_0x264f93){var _0x4ea3f0;if(_0x264f93['results'][_0x0903('0x27')]){_0x264f93[_0x0903('0x28')]=_[_0x0903('0x29')](_0x264f93[_0x0903('0x28')],{'suspended':![],'role':_0x0903('0x2a')});if(_0x264f93[_0x0903('0x28')][_0x0903('0x27')]){_0x4ea3f0=_['first'](_0x264f93['results']);}}if(_0x4ea3f0){logger[_0x0903('0xc')](_0x0903('0x2b'));return _0x4ea3f0;}else{logger[_0x0903('0xc')](_0x0903('0x2c'));return request({'uri':util[_0x0903('0xe')](_0x0903('0x2d'),_0x142ffb[_0x0903('0x10')]),'method':_0x0903('0x11'),'body':{'user':{'role':_0x0903('0x2a'),'name':util['format'](_0x0903('0x2e'),_0x8d9ed0||_0x52c09f),'phone':_0x52c09f}}})[_0x0903('0x19')](function(_0x73dafc){logger[_0x0903('0xc')](_0x0903('0x2f'));return _0x73dafc[_0x0903('0x23')];});}});}function getAuth(_0x48b579){var _0x30e7c5;if(_0x48b579[_0x0903('0x30')]===_0x0903('0x31')){_0x30e7c5=util[_0x0903('0xe')](_0x0903('0x32'),_0x48b579[_0x0903('0x33')],_0x48b579[_0x0903('0x31')]);}else if(_0x48b579['authType']==='token'){_0x30e7c5=util['format'](_0x0903('0x34'),_0x48b579[_0x0903('0x33')],_0x48b579[_0x0903('0x35')]);}return util[_0x0903('0xe')]('Basic\x20%s',new Buffer(_0x30e7c5)[_0x0903('0x36')](_0x0903('0x37')));}function request(_0x3b86d0){logger[_0x0903('0x38')](_0x0903('0x39'),JSON[_0x0903('0x3a')](_0x3b86d0));return rp(_[_0x0903('0x3b')](_0x3b86d0,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5362ae,_0x5f4b8b){var _0x22f992=[];if(_0x5362ae&&_0x5362ae[_0x0903('0x27')]>0x0){_0x22f992=_[_0x0903('0x3c')](_0x5362ae,_0x5f4b8b);}return _0x22f992;}function getCustomFields(_0x2cabb3,_0x21b447){var _0x9d2b7f=[];var _0x480108={'custom_fields':[]};if(_0x2cabb3['length']>0x0){_['forEach'](_0x2cabb3,function(_0x304836){if(_['includes']([_0x0903('0x3d'),_0x0903('0x3e')],_0x304836[_0x0903('0x3f')])&&_0x304836[_0x0903('0x40')]&&!_0x304836[_0x0903('0x41')]){_0x480108[_0x304836[_0x0903('0x40')][_0x0903('0x42')]()]=_0x304836[_0x0903('0x43')]['toString']();}else if(_[_0x0903('0x44')]([_0x0903('0x3d'),_0x0903('0x3e')],_0x304836[_0x0903('0x3f')])&&_0x304836[_0x0903('0x45')]&&_0x304836[_0x0903('0x41')]){_0x480108[_0x0903('0x46')][_0x0903('0x47')]({'id':_0x304836[_0x0903('0x45')],'value':_0x304836['content'][_0x0903('0x36')]()});}else if(_0x304836[_0x0903('0x3f')]===_0x0903('0x48')&&_0x304836[_0x0903('0x49')]&&_0x304836[_0x0903('0x45')]&&_0x304836['customField']){_0x21b447[_0x304836[_0x0903('0x49')]]&&_0x480108[_0x0903('0x46')][_0x0903('0x47')]({'id':_0x304836[_0x0903('0x45')],'value':_0x21b447[_0x304836['variableName']]['toString']()});}else if(_0x304836['type']===_0x0903('0x4a')&&_0x304836[_0x0903('0x4b')]&&_0x304836['Variable']['name']&&_0x304836[_0x0903('0x45')]&&_0x304836[_0x0903('0x41')]){_0x21b447[_0x304836[_0x0903('0x4b')]['name'][_0x0903('0x42')]()]&&_0x480108[_0x0903('0x46')][_0x0903('0x47')]({'id':_0x304836['idField'],'value':_0x21b447[_0x304836[_0x0903('0x4b')][_0x0903('0x14')][_0x0903('0x42')]()][_0x0903('0x36')]()});}});}return _0x480108;}exports[_0x0903('0x4c')]=function(_0x11507a,_0x28dd38,_0x36022f,_0x482fac,_0xd41715,_0x3c093d){var _0x5aad5d,_0x63129;_0x3c093d['remoteUri']=intUtil['stripTrailingSlash'](_0x3c093d[_0x0903('0x10')]);_0x3c093d['serverUrl']=intUtil[_0x0903('0x4d')](_0x3c093d[_0x0903('0x4e')]);if(_0xd41715&&_0xd41715[_0x0903('0x4f')]){logger['info'](_0x0903('0x50'),_0x0903('0x51'));_0x28dd38[_0x0903('0x52')]=util['format'](_0x0903('0x53'),_0x3c093d[_0x0903('0x4e')],_0x28dd38[_0x0903('0x54')],md5(_0x28dd38[_0x0903('0x54')]));}else{_0x28dd38[_0x0903('0x52')]='';}headers[_0x0903('0x55')]=getAuth(_0x3c093d);return getUser(_0x3c093d,_0x482fac['email'])['then'](function(_0x63ec56){_0x5aad5d=_0x63ec56;logger['info'](_0x0903('0x56'),_0x5aad5d['id']);return getEndUser(_0x3c093d,_0x28dd38['calleridname'],_0x28dd38['calleridnum']);})[_0x0903('0x19')](function(_0x1198de){_0x63129=_0x1198de;logger[_0x0903('0xc')](_0x0903('0x57'),_0x63129['id']);return getTicket(_0x3c093d,_0x5aad5d,_0x63129,_0x36022f,_0x28dd38);})['then'](function(_0x5dcb8b){if(_0x5dcb8b){logger[_0x0903('0xc')](_0x0903('0x58'),_0x5dcb8b['id']);switch(_0x3c093d[_0x0903('0x3f')]){case'integrationTab':logger[_0x0903('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0903('0xe')](_0x0903('0x59'),_0x3c093d['remoteUri'],_0x5aad5d['id'],_0x5dcb8b['id']),'method':_0x0903('0x11')});case _0x0903('0x5a'):logger['info'](_0x0903('0x50'),_0x0903('0x5b'));emit(util['format']('user:%s',_0x482fac[_0x0903('0x14')]),'trigger:browser:url',{'uri':util[_0x0903('0xe')](_0x0903('0x5c'),_0x3c093d[_0x0903('0x10')]['replace'](_0x0903('0x5d'),''),_0x5dcb8b['id'])});break;default:logger[_0x0903('0x5e')](_0x0903('0x50'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x0903('0x5f')](function(_0x2c78ae){logger[_0x0903('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0903('0x60')](_0x2c78ae,{'showHidden':!![],'depth':null}));});};exports[_0x0903('0x61')]=function(_0x1bc285,_0x2b8bc0,_0x122582,_0x543a4d,_0x3dff2e,_0x194f11,_0x14737b){var _0x1c231c,_0x508652;_0x194f11[_0x0903('0x10')]=intUtil['stripTrailingSlash'](_0x194f11[_0x0903('0x10')]);_0x194f11[_0x0903('0x4e')]=intUtil[_0x0903('0x4d')](_0x194f11[_0x0903('0x4e')]);if(_0x14737b&&_0x14737b[_0x0903('0x62')]&&_0x14737b['recordingFormat']!==_0x0903('0x63')){logger[_0x0903('0xc')](_0x0903('0x64'),'Recording\x20is\x20enabled!');_0x2b8bc0[_0x0903('0x52')]=util[_0x0903('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x194f11['serverUrl'],_0x2b8bc0[_0x0903('0x54')],md5(_0x2b8bc0[_0x0903('0x54')]));}headers['Authorization']=getAuth(_0x194f11);return getUser(_0x194f11,_0x543a4d[_0x0903('0x65')])[_0x0903('0x19')](function(_0x167214){_0x1c231c=_0x167214;logger['info'](_0x0903('0x56'),_0x1c231c['id']);return getEndUser(_0x194f11,_0x2b8bc0['destcalleridname'],_0x2b8bc0['destcalleridnum']);})['then'](function(_0x302b85){_0x508652=_0x302b85;logger['info'](_0x0903('0x57'),_0x508652['id']);return getTicket(_0x194f11,_0x1c231c,_0x508652,_0x122582,_0x2b8bc0);})[_0x0903('0x19')](function(_0x14831a){if(_0x14831a){logger[_0x0903('0xc')](_0x0903('0x58'),_0x14831a['id']);switch(_0x194f11[_0x0903('0x3f')]){case _0x0903('0x66'):logger[_0x0903('0xc')]('[OUTBOUND]',_0x0903('0x67'));return request({'uri':util[_0x0903('0xe')](_0x0903('0x59'),_0x194f11[_0x0903('0x10')],_0x1c231c['id'],_0x14831a['id']),'method':'POST'});case _0x0903('0x5a'):logger[_0x0903('0xc')](_0x0903('0x64'),_0x0903('0x5b'));emit(util['format']('user:%s',_0x543a4d[_0x0903('0x14')]),'trigger:browser:url',{'uri':util[_0x0903('0xe')](_0x0903('0x5c'),_0x194f11['remoteUri'][_0x0903('0x68')]('/api/v2',''),_0x14831a['id'])});break;default:logger[_0x0903('0x5e')](_0x0903('0x64'),_0x0903('0x69'));}}})['catch'](function(_0x32a923){logger['error'](_0x0903('0x6a'),util['inspect'](_0x32a923,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4c385e,_0x6f7cf8,_0x1391a3,_0x544596,_0x2a6dad,_0x2085a7){var _0x18cb2a,_0x3b6594;_0x2085a7[_0x0903('0x10')]=intUtil[_0x0903('0x4d')](_0x2085a7[_0x0903('0x10')]);_0x2085a7[_0x0903('0x4e')]=intUtil[_0x0903('0x4d')](_0x2085a7['serverUrl']);if(_0x2a6dad&&_0x2a6dad['monitor_format']){logger['info']('['+_0x6f7cf8[_0x0903('0x6b')][_0x0903('0x6c')]()+']',_0x0903('0x51'));_0x6f7cf8[_0x0903('0x52')]=util['format'](_0x0903('0x53'),_0x2085a7[_0x0903('0x4e')],_0x6f7cf8['uniqueid'],md5(_0x6f7cf8[_0x0903('0x54')]));}else{_0x6f7cf8[_0x0903('0x52')]='';}headers['Authorization']=getAuth(_0x2085a7);return getUser(_0x2085a7)[_0x0903('0x19')](function(_0x280ead){_0x18cb2a=_0x280ead;logger[_0x0903('0xc')](_0x0903('0x56'),_0x18cb2a['id']);return getEndUser(_0x2085a7,_0x6f7cf8['calleridname'],_0x6f7cf8['calleridnum']);})[_0x0903('0x19')](function(_0x2fc423){_0x3b6594=_0x2fc423;logger[_0x0903('0xc')](_0x0903('0x57'),_0x3b6594['id']);return getTicket(_0x2085a7,_0x18cb2a,_0x3b6594,_0x1391a3,_0x6f7cf8);})[_0x0903('0x19')](function(_0x4de081){if(_0x4de081){logger[_0x0903('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4de081['id']);}})[_0x0903('0x5f')](function(_0x49c326){logger['error']('['+_0x6f7cf8[_0x0903('0x6b')][_0x0903('0x6c')]()+']'+_0x0903('0x6d'),util[_0x0903('0x60')](_0x49c326,{'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 b563598..1c0a433 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 _0xf0da=['CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Contacts','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','connect','rejected','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','Fields','POST','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','Outbound','user:%s','https://crm.','stripTrailingSlash','toUpperCase','lodash','request-promise','md5','util','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','redis','debug','[HTTP]','stringify','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','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','refresh_token','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','role','first_name','last_name','details','startCase','moduleCreate','Error:\x20','log'];(function(_0x51d236,_0x3c1e1b){var _0x297683=function(_0x3ff2ea){while(--_0x3ff2ea){_0x51d236['push'](_0x51d236['shift']());}};_0x297683(++_0x3c1e1b);}(_0xf0da,0xe4));var _0xaf0d=function(_0x4fe964,_0x4dc137){_0x4fe964=_0x4fe964-0x0;var _0x44761b=_0xf0da[_0x4fe964];return _0x44761b;};'use strict';var _=require(_0xaf0d('0x0'));var rp=require(_0xaf0d('0x1'));var md5=require(_0xaf0d('0x2'));var util=require(_0xaf0d('0x3'));var intUtil=require(_0xaf0d('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xaf0d('0x5'));var config=require(_0xaf0d('0x6'));var logger=require(_0xaf0d('0x7'))(_0xaf0d('0x8'));config['redis']=_[_0xaf0d('0x9')](config['redis'],{'host':_0xaf0d('0xa'),'port':0x18eb});var io=require(_0xaf0d('0xb'))(new Redis(config[_0xaf0d('0xc')]));function emit(_0x3a8c5e,_0x55840e,_0x36cd8d){io['to'](_0x3a8c5e)['emit'](_0x55840e,_0x36cd8d);}function request(_0x380d37){logger[_0xaf0d('0xd')](_0xaf0d('0xe'),JSON[_0xaf0d('0xf')](_0x380d37));return rp(_0x380d37);}function getCustomFields(_0x34d8aa,_0xe44a6){var _0x53b3a8={};if(_0x34d8aa[_0xaf0d('0x10')]>0x0){_[_0xaf0d('0x11')](_0x34d8aa,function(_0x3f10ad){if(_[_0xaf0d('0x12')](['string',_0xaf0d('0x13')],_0x3f10ad['type'])&&_0x3f10ad[_0xaf0d('0x14')]){_0x53b3a8[_0x3f10ad['idField']]=_0x3f10ad[_0xaf0d('0x15')][_0xaf0d('0x16')]();}else if(_0x3f10ad[_0xaf0d('0x17')]===_0xaf0d('0x18')&&_0x3f10ad[_0xaf0d('0x19')]&&_0x3f10ad[_0xaf0d('0x14')]&&_0xe44a6[_0x3f10ad[_0xaf0d('0x19')]]){_0x53b3a8[_0x3f10ad[_0xaf0d('0x14')]]=_0xe44a6[_0x3f10ad[_0xaf0d('0x19')]][_0xaf0d('0x16')]();}else if(_0x3f10ad[_0xaf0d('0x17')]===_0xaf0d('0x1a')&&_0x3f10ad[_0xaf0d('0x1b')]&&_0x3f10ad[_0xaf0d('0x1b')]['name']&&_0x3f10ad['idField']&&_0xe44a6[_0x3f10ad[_0xaf0d('0x1b')][_0xaf0d('0x1c')][_0xaf0d('0x1d')]()]){_0x53b3a8[_0x3f10ad[_0xaf0d('0x14')]]=_0xe44a6[_0x3f10ad[_0xaf0d('0x1b')][_0xaf0d('0x1c')]['toLowerCase']()][_0xaf0d('0x16')]();}});}return _0x53b3a8;}function getName(_0x7895b0){if(_0x7895b0[_0xaf0d('0x1e')]('\x20')>0x0){var _0x4be89b=_0x7895b0['split'](/ (.+)/);if(_0x4be89b[0x1]){return _0x4be89b;}}return[_0x7895b0,_0x7895b0];}var accountsTokens={};function getAccessToken(_0x1afe72){return new Promise(function(_0x56754a,_0x38c2ff){if(!_[_0xaf0d('0x1f')](accountsTokens[_0x1afe72['id']])&&!_[_0xaf0d('0x1f')](accountsTokens[_0x1afe72['id']][_0xaf0d('0x20')])){if(moment()[_0xaf0d('0x21')](accountsTokens[_0x1afe72['id']]['expires_in'])){_0x56754a(accountsTokens[_0x1afe72['id']]['access_token']);}}var _0x4c035d;switch(_0x1afe72['zone']){case'US':_0x4c035d=_0xaf0d('0x22');break;case'AU':_0x4c035d=_0xaf0d('0x23');break;case'EU':_0x4c035d=_0xaf0d('0x24');break;case'IN':_0x4c035d=_0xaf0d('0x25');break;case'CN':_0x4c035d=_0xaf0d('0x26');break;default:_0x4c035d=_0xaf0d('0x24');break;}var _0x3615ab={'method':'POST','uri':_0x4c035d+_0xaf0d('0x27'),'qs':{'refresh_token':_0x1afe72[_0xaf0d('0x28')],'client_id':_0x1afe72[_0xaf0d('0x29')],'client_secret':_0x1afe72[_0xaf0d('0x2a')],'grant_type':_0xaf0d('0x2b')},'json':!![]};return rp(_0x3615ab)['then'](function(_0x208637){accountsTokens[_0x1afe72['id']]={'access_token':_0x208637[_0xaf0d('0x20')],'expires_in':moment()['add'](_0x208637[_0xaf0d('0x2c')],'seconds')};_0x56754a(_0x208637[_0xaf0d('0x20')]);})[_0xaf0d('0x2d')](function(_0x597302){logger[_0xaf0d('0x2e')](_0xaf0d('0x2f'),_0x597302[_0xaf0d('0x30')]);_0x38c2ff(_0x597302);});});}function getUser(_0x3f7e7c,_0x30498e,_0x514bd2,_0x2d1120){logger[_0xaf0d('0x31')](_0xaf0d('0x32'));return request({'method':_0xaf0d('0x33'),'uri':util[_0xaf0d('0x34')](_0xaf0d('0x35'),_0x30498e),'qs':{'type':_0xaf0d('0x36')},'headers':{'Authorization':_0xaf0d('0x37')+_0x3f7e7c},'json':!![]})[_0xaf0d('0x38')](function(_0x161f95){if(_0x161f95[_0xaf0d('0x39')]){var _0x50c05d=-0x1;if(_[_0xaf0d('0x3a')](_0x161f95['users'])){if(!_[_0xaf0d('0x1f')](_0x2d1120)){_0x50c05d=_[_0xaf0d('0x3b')](_0x161f95[_0xaf0d('0x39')],function(_0xe00844){return _0xe00844[_0xaf0d('0x3c')]===_0x2d1120;});}if(_0x50c05d>=0x0){logger[_0xaf0d('0x31')](_0xaf0d('0x3d'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x50c05d=_['findIndex'](_0x161f95[_0xaf0d('0x39')],function(_0xde54e8){return _0xde54e8['profile'][_0xaf0d('0x1c')]===_0xaf0d('0x3e');});}return _0x161f95[_0xaf0d('0x39')][_0x50c05d];}else{if(_0x161f95[_0xaf0d('0x3f')][_0xaf0d('0x40')][_0xaf0d('0x1c')]==='Administrator'){logger[_0xaf0d('0x31')](_0xaf0d('0x41'));user=_0x161f95[_0xaf0d('0x3f')];return user;}else{logger[_0xaf0d('0x2e')](_0xaf0d('0x42'),JSON[_0xaf0d('0xf')](_0x161f95));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xaf0d('0xf')](_0x161f95));}}}else{logger[_0xaf0d('0x2e')](_0xaf0d('0x42'),JSON['stringify'](_0x161f95));throw new Error(_0xaf0d('0x43')+JSON['stringify'](_0x161f95));}})[_0xaf0d('0x2d')](function(_0x165e44){console[_0xaf0d('0x2e')](_0x165e44);});}function getZohoUser(_0x436dd4,_0x1855be){return new BPromise(function(_0x4f74f6,_0x5116e8){request(_0x436dd4)[_0xaf0d('0x38')](function(_0x3c4779){var _0x214a89=null;if(_0x3c4779){_0x214a89=_0x3c4779[_0xaf0d('0x44')][0x0];_0x214a89[_0xaf0d('0x45')]=_0x1855be;}_0x4f74f6(_0x214a89);})['catch'](function(_0x104cbe){_0x5116e8(_0x104cbe);});});}function createEndUser(_0x4dbbd4,_0x146ccf,_0x309a14,_0x1d3543,_0x1d6eb0,_0x1c21ce){var _0x309a14=getName(_0x309a14);return request({'method':'POST','uri':_0xaf0d('0x46')+_0x146ccf+_0xaf0d('0x47')+_['startCase'](_0x1c21ce['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x309a14[0x1],'First_Name':_0x309a14[0x0],'Phone':_0x1d3543,'Owner':{'name':!_[_0xaf0d('0x1f')](_0x1d6eb0[_0xaf0d('0x48')][_0xaf0d('0x1c')])?_0x1d6eb0[_0xaf0d('0x48')][_0xaf0d('0x1c')]:!_['isNil'](_0x1d6eb0[_0xaf0d('0x49')])?_0x1d6eb0[_0xaf0d('0x49')]+'\x20'+_0x1d6eb0[_0xaf0d('0x4a')]:_0x1d6eb0['last_name'],'id':_0x1d6eb0['id']}}]},'headers':{'Authorization':_0xaf0d('0x37')+_0x4dbbd4},'json':!![]})[_0xaf0d('0x38')](function(_0x37b924){if(_0x37b924&&_0x37b924[_0xaf0d('0x44')][0x0]['code']==='SUCCESS'){var _0xbaccd1=_0x37b924[_0xaf0d('0x44')][0x0][_0xaf0d('0x4b')];_0xbaccd1[_0xaf0d('0x45')]=_[_0xaf0d('0x4c')](_0x1c21ce[_0xaf0d('0x4d')])+'s';return _0xbaccd1;}logger[_0xaf0d('0x2e')](_0xaf0d('0x42'),JSON['stringify'](data));throw new Error(_0xaf0d('0x4e')+JSON[_0xaf0d('0xf')](data));})[_0xaf0d('0x2d')](function(_0x5c578f){console[_0xaf0d('0x4f')](_0xaf0d('0x50'),_0x5c578f);});}function getEndUser(_0x29317b,_0x44210a,_0x22503d,_0x33fb17,_0x429365,_0xa8fa2c,_0x3563e0){var _0x1ecaa2={'method':_0xaf0d('0x33'),'uri':'','headers':{'Authorization':_0xaf0d('0x37')+_0x29317b},'json':!![]};switch(_0x3563e0['moduleSearch']){case _0xaf0d('0x51'):_0x1ecaa2[_0xaf0d('0x52')]=_0xaf0d('0x46')+_0x44210a+_0xaf0d('0x53')+_0x429365+'))';return getZohoUser(_0x1ecaa2,'Contacts')[_0xaf0d('0x38')](function(_0x1b9856){if(_0x1b9856)return _0x1b9856;_0x1ecaa2[_0xaf0d('0x52')]=_0xaf0d('0x46')+_0x44210a+_0xaf0d('0x54')+_0x429365+'))';return getZohoUser(_0x1ecaa2,_0xaf0d('0x55'))[_0xaf0d('0x38')](function(_0x376460){if(_0x376460)return _0x376460;if(_0x3563e0[_0xaf0d('0x4d')]!=_0xaf0d('0x56')){return createEndUser(_0x29317b,_0x44210a,_0x33fb17,_0x429365,_0xa8fa2c,_0x3563e0);}else{return{};}});});break;case'contact':_0x1ecaa2[_0xaf0d('0x52')]='https://www.zohoapis.'+_0x44210a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x429365+'))';return getZohoUser(_0x1ecaa2,_0xaf0d('0x57'))[_0xaf0d('0x38')](function(_0x17bebb){if(_0x17bebb)return _0x17bebb;if(_0x3563e0[_0xaf0d('0x4d')]!=_0xaf0d('0x56')){return createEndUser(_0x29317b,_0x44210a,_0x33fb17,_0x429365,_0xa8fa2c,_0x3563e0);}else{return{};}});break;case _0xaf0d('0x58'):_0x1ecaa2[_0xaf0d('0x52')]=_0xaf0d('0x46')+_0x44210a+_0xaf0d('0x54')+_0x429365+'))';return getZohoUser(_0x1ecaa2,'Leads')[_0xaf0d('0x38')](function(_0x5a6469){if(_0x5a6469)return _0x5a6469;if(_0x3563e0['moduleCreate']!=_0xaf0d('0x56')){return createEndUser(_0x29317b,_0x44210a,_0x33fb17,_0x429365,_0xa8fa2c,_0x3563e0);}else{return{};}});break;}}function getCall(_0x435a62,_0xeedd80,_0x1acfd9,_0x3f536c,_0x39894d,_0x27da6c,_0x13cc3d,_0x29fcc1){logger['info'](_0xaf0d('0x59'));var _0x44c285={};_0x44c285[_0xaf0d('0x5a')]={'name':!_['isNil'](_0x3f536c['role'][_0xaf0d('0x1c')])&&!_[_0xaf0d('0x1f')](_0x3f536c[_0xaf0d('0x40')][_0xaf0d('0x1c')])&&_0x3f536c['profile'][_0xaf0d('0x1c')]==='administrator'?_0x3f536c[_0xaf0d('0x48')]['name']:!_['isNil'](_0x3f536c[_0xaf0d('0x49')])?_0x3f536c[_0xaf0d('0x49')]+'\x20'+_0x3f536c[_0xaf0d('0x4a')]:_0x3f536c[_0xaf0d('0x4a')],'id':_0x3f536c['id']};_0x44c285[_0xaf0d('0x5b')]=intUtil[_0xaf0d('0x5c')](_0x27da6c[_0xaf0d('0x5d')],_0x13cc3d,'\x20');_0x44c285[_0xaf0d('0x5e')]=intUtil[_0xaf0d('0x5c')](_0x27da6c[_0xaf0d('0x5f')],_0x13cc3d,'\x0a');if(_0x39894d[_0xaf0d('0x45')]===_0xaf0d('0x57')){_0x44c285['Who_Id']={'name':!_['isNil'](_0x39894d[_0xaf0d('0x60')])?_0x39894d[_0xaf0d('0x60')]:!_[_0xaf0d('0x1f')](_0x39894d['First_Name'])?_0x39894d[_0xaf0d('0x61')]+'\x20'+_0x39894d['Last_Name']:_0x39894d[_0xaf0d('0x62')],'id':_0x39894d['id']};}if(_0x39894d[_0xaf0d('0x45')]===_0xaf0d('0x55')){_0x44c285[_0xaf0d('0x63')]={'name':!_[_0xaf0d('0x1f')](_0x39894d[_0xaf0d('0x60')])?_0x39894d[_0xaf0d('0x60')]:!_[_0xaf0d('0x1f')](_0x39894d[_0xaf0d('0x61')])?_0x39894d[_0xaf0d('0x61')]+'\x20'+_0x39894d[_0xaf0d('0x62')]:_0x39894d[_0xaf0d('0x62')],'id':_0x39894d['id']};_0x44c285[_0xaf0d('0x64')]=_[_0xaf0d('0x4c')](_0x39894d[_0xaf0d('0x45')]);}if(_0x13cc3d[_0xaf0d('0x65')]){_0x44c285['Call_Duration']=moment[_0xaf0d('0x66')](parseInt(_0x13cc3d[_0xaf0d('0x65')])*0x3e8)[_0xaf0d('0x34')](_0xaf0d('0x67'));}else if(_0x13cc3d[_0xaf0d('0x68')]&&_0x13cc3d['endtime']){_0x44c285[_0xaf0d('0x69')]=moment['utc'](moment(_0x13cc3d[_0xaf0d('0x6a')],_0xaf0d('0x6b'))[_0xaf0d('0x6c')](moment(_0x13cc3d[_0xaf0d('0x6d')],_0xaf0d('0x6b'))))['format'](_0xaf0d('0x67'));}switch(_0x13cc3d[_0xaf0d('0x6e')]){case'called':_0x44c285[_0xaf0d('0x6f')]='Called';break;case'complete':case _0xaf0d('0x70'):_0x44c285[_0xaf0d('0x6f')]='Answered';break;case _0xaf0d('0x71'):_0x44c285['Call_Result']='Rejected';break;case'abandoned':_0x44c285[_0xaf0d('0x6f')]=_0xaf0d('0x72');break;case'timeout':_0x44c285[_0xaf0d('0x6f')]=_0xaf0d('0x73');default:}_0x44c285[_0xaf0d('0x74')]=(_0x29fcc1===_0xaf0d('0x75')?moment(_0x13cc3d[_0xaf0d('0x6d')])[_0xaf0d('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x13cc3d[_0xaf0d('0x76')])[_0xaf0d('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xaf0d('0x6b'));_0x44c285['Call_Type']=_0x29fcc1||_0xaf0d('0x77');_0x44c285=_['merge'](_0x44c285,getCustomFields(_0x27da6c[_0xaf0d('0x78')],_0x13cc3d));return request({'method':_0xaf0d('0x79'),'uri':_0xaf0d('0x46')+_0xeedd80+_0xaf0d('0x7a'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x435a62},'body':{'data':[_0x44c285]},'json':!![]})[_0xaf0d('0x38')](function(_0x33b71e){if(_0x33b71e&&_0x33b71e[_0xaf0d('0x44')][0x0]['code']===_0xaf0d('0x7b')){logger['info'](_0xaf0d('0x7c'));return{'id':_0x33b71e['data'][0x0][_0xaf0d('0x4b')]['id']};}})[_0xaf0d('0x2d')](function(_0x458763){logger[_0xaf0d('0x31')](_0xaf0d('0x7d'),_0x458763[_0xaf0d('0x30')]);console[_0xaf0d('0x4f')](_0xaf0d('0x7d'),_0x458763);});}exports[_0xaf0d('0x7e')]=function(_0x2c72b3,_0x295395,_0x2d5250,_0x460998,_0x5dd4af,_0x4d9363){var _0x3c1b9c,_0x427066,_0x355a90;_0x4d9363[_0xaf0d('0x7f')]=intUtil['stripTrailingSlash'](_0x4d9363['host']);_0x4d9363[_0xaf0d('0x80')]=intUtil['stripTrailingSlash'](_0x4d9363['serverUrl']);if(_0x5dd4af&&_0x5dd4af[_0xaf0d('0x81')]){logger[_0xaf0d('0x31')](_0xaf0d('0x82'),_0xaf0d('0x83'));_0x295395[_0xaf0d('0x84')]=_0x4d9363[_0xaf0d('0x80')]+_0xaf0d('0x85')+_0x295395[_0xaf0d('0x86')]+_0xaf0d('0x87')+md5(_0x295395['uniqueid']);}else{_0x295395[_0xaf0d('0x84')]='';}var _0x5265c1=_0x4d9363[_0xaf0d('0x7f')]==='zoho.eu'?'eu':_0xaf0d('0x88');return getAccessToken(_0x4d9363)[_0xaf0d('0x38')](function(_0x3ac5d4){_0x355a90=_0x3ac5d4;return getUser(_0x355a90,_0x5265c1,_0x4d9363,_0x460998[_0xaf0d('0x3c')]);})[_0xaf0d('0x38')](function(_0x598dc4){_0x3c1b9c=_0x598dc4;logger[_0xaf0d('0x31')](_0xaf0d('0x89'),_0x3c1b9c['id']);return getEndUser(_0x355a90,_0x5265c1,_0x4d9363,_0x295395[_0xaf0d('0x8a')],_0x295395[_0xaf0d('0x8b')],_0x3c1b9c,_0x2d5250);})[_0xaf0d('0x38')](function(_0xc2e3c1){_0x427066=_0xc2e3c1;return getCall(_0x355a90,_0x5265c1,_0x4d9363,_0x3c1b9c,_0x427066,_0x2d5250,_0x295395,_0xaf0d('0x77'));})[_0xaf0d('0x38')](function(_0x73777a){if(_0x73777a){logger[_0xaf0d('0x31')](_0xaf0d('0x8c'),_0x73777a['id']);logger[_0xaf0d('0x31')](_0xaf0d('0x82'),_0xaf0d('0x8d'));emit(util[_0xaf0d('0x34')]('user:%s',_0x460998[_0xaf0d('0x1c')]),_0xaf0d('0x8e'),{'uri':'https://crm.'+_0x4d9363[_0xaf0d('0x7f')]+_0xaf0d('0x8f')+_0x73777a['id']});}})[_0xaf0d('0x2d')](function(_0x1eb099){logger['error']('[QUEUE]',JSON[_0xaf0d('0xf')](_0x1eb099));});};exports[_0xaf0d('0x75')]=function(_0x257657,_0x4b1a13,_0x4ff282,_0x517ee9,_0x18470f,_0x2d3a89,_0x389af0){var _0x3c003e,_0x5d692e,_0x867009;_0x2d3a89[_0xaf0d('0x7f')]=intUtil['stripTrailingSlash'](_0x2d3a89['host']);_0x2d3a89[_0xaf0d('0x80')]=intUtil['stripTrailingSlash'](_0x2d3a89[_0xaf0d('0x80')]);if(_0x389af0&&_0x389af0[_0xaf0d('0x90')]&&_0x389af0[_0xaf0d('0x90')]!==_0xaf0d('0x91')){logger[_0xaf0d('0x31')](_0xaf0d('0x92'),'Recording\x20is\x20enabled!');_0x4b1a13[_0xaf0d('0x84')]=_0x2d3a89[_0xaf0d('0x80')]+_0xaf0d('0x85')+_0x4b1a13[_0xaf0d('0x86')]+_0xaf0d('0x87')+md5(_0x4b1a13['uniqueid']);}var _0x3a0989=_0x2d3a89[_0xaf0d('0x7f')]===_0xaf0d('0x93')?'eu':'com';return getAccessToken(_0x2d3a89)[_0xaf0d('0x38')](function(_0x4a5a75){_0x867009=_0x4a5a75;return getUser(_0x867009,_0x3a0989,_0x2d3a89,_0x517ee9[_0xaf0d('0x3c')]);})['then'](function(_0x32d9d1){_0x3c003e=_0x32d9d1;logger[_0xaf0d('0x31')](_0xaf0d('0x89'),_0x3c003e['id']);return getEndUser(_0x867009,_0x3a0989,_0x2d3a89,_0x4b1a13[_0xaf0d('0x94')],_0x4b1a13['destcalleridnum'],_0x3c003e,_0x4ff282);})[_0xaf0d('0x38')](function(_0x1e6939){_0x5d692e=_0x1e6939;return getCall(_0x867009,_0x3a0989,_0x2d3a89,_0x3c003e,_0x5d692e,_0x4ff282,_0x4b1a13,_0xaf0d('0x95'));})['then'](function(_0x2f9201){if(_0x2f9201){logger[_0xaf0d('0x31')]('The\x20Call\x20ID\x20is:',_0x2f9201['id']);logger[_0xaf0d('0x31')](_0xaf0d('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaf0d('0x34')](_0xaf0d('0x96'),_0x517ee9[_0xaf0d('0x1c')]),_0xaf0d('0x8e'),{'uri':_0xaf0d('0x97')+_0x2d3a89['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x2f9201['id']});}})['catch'](function(_0xaa49a7){logger[_0xaf0d('0x2e')](_0xaf0d('0x92'),JSON['stringify'](_0xaa49a7));});};exports['unmanaged']=function(_0x2b181e,_0x447083,_0x3ab33e,_0x4d8873,_0x3821d5,_0x542c68){var _0xb37ca4,_0x32e490,_0x221cfb;_0x542c68[_0xaf0d('0x7f')]=intUtil[_0xaf0d('0x98')](_0x542c68[_0xaf0d('0x7f')]);_0x542c68[_0xaf0d('0x80')]=intUtil[_0xaf0d('0x98')](_0x542c68[_0xaf0d('0x80')]);if(_0x3821d5&&_0x3821d5[_0xaf0d('0x81')]){logger[_0xaf0d('0x31')]('['+_0x447083[_0xaf0d('0x6e')][_0xaf0d('0x99')]()+']',_0xaf0d('0x83'));_0x447083['recordingURL']=_0x542c68[_0xaf0d('0x80')]+_0xaf0d('0x85')+_0x447083[_0xaf0d('0x86')]+_0xaf0d('0x87')+md5(_0x447083['uniqueid']);}else{_0x447083[_0xaf0d('0x84')]='';}var _0x2e383d=_0x542c68[_0xaf0d('0x7f')]===_0xaf0d('0x93')?'eu':_0xaf0d('0x88');return getAccessToken(_0x542c68)['then'](function(_0x1a7afb){_0x221cfb=_0x1a7afb;return getUser(_0x221cfb,_0x2e383d,_0x542c68);})[_0xaf0d('0x38')](function(_0x1f156c){_0xb37ca4=_0x1f156c;logger[_0xaf0d('0x31')]('The\x20User\x20ID\x20is:',_0xb37ca4['id']);return getEndUser(_0x221cfb,_0x2e383d,_0x542c68,_0x447083[_0xaf0d('0x8a')],_0x447083['calleridnum'],_0xb37ca4,_0x3ab33e);})[_0xaf0d('0x38')](function(_0x2d295d){_0x32e490=_0x2d295d;return getCall(_0x221cfb,_0x2e383d,_0x542c68,_0xb37ca4,_0x32e490,_0x3ab33e,_0x447083,'Inbound');})[_0xaf0d('0x38')](function(_0x43c9ed){if(_0x43c9ed){logger['info'](_0xaf0d('0x8c'),_0x43c9ed['id']);}})['catch'](function(_0x232929){logger[_0xaf0d('0x2e')]('['+_0x447083[_0xaf0d('0x6e')][_0xaf0d('0x99')]()+']',JSON[_0xaf0d('0xf')](_0x232929));});}; \ No newline at end of file +var _0xe0d7=['err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','toUpperCase','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','stringify','includes','string','picklist','type','content','variableName','idField','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','moduleCreate','lead','Creating\x20new\x20call...','Owner','Subject','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','connect','Answered','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','format','Call_Type','Inbound','merge','Fields','/crm/v2/Calls'];(function(_0x3ad535,_0x4a4f66){var _0x26c41f=function(_0x18b027){while(--_0x18b027){_0x3ad535['push'](_0x3ad535['shift']());}};_0x26c41f(++_0x4a4f66);}(_0xe0d7,0x1e0));var _0x7e0d=function(_0x5bad77,_0xbf770){_0x5bad77=_0x5bad77-0x0;var _0x526489=_0xe0d7[_0x5bad77];return _0x526489;};'use strict';var _=require('lodash');var rp=require(_0x7e0d('0x0'));var md5=require('md5');var util=require(_0x7e0d('0x1'));var intUtil=require(_0x7e0d('0x2'));var moment=require(_0x7e0d('0x3'));var Redis=require(_0x7e0d('0x4'));var BPromise=require(_0x7e0d('0x5'));var config=require(_0x7e0d('0x6'));var logger=require(_0x7e0d('0x7'))(_0x7e0d('0x8'));config['redis']=_['defaults'](config[_0x7e0d('0x9')],{'host':_0x7e0d('0xa'),'port':0x18eb});var io=require(_0x7e0d('0xb'))(new Redis(config[_0x7e0d('0x9')]));function emit(_0x1839fd,_0x1b8a71,_0x25695b){io['to'](_0x1839fd)[_0x7e0d('0xc')](_0x1b8a71,_0x25695b);}function request(_0x34e8e9){logger[_0x7e0d('0xd')]('[HTTP]',JSON[_0x7e0d('0xe')](_0x34e8e9));return rp(_0x34e8e9);}function getCustomFields(_0x32ca22,_0x175356){var _0x5d1319={};if(_0x32ca22['length']>0x0){_['forEach'](_0x32ca22,function(_0x13c98e){if(_[_0x7e0d('0xf')]([_0x7e0d('0x10'),_0x7e0d('0x11')],_0x13c98e[_0x7e0d('0x12')])&&_0x13c98e['idField']){_0x5d1319[_0x13c98e['idField']]=_0x13c98e[_0x7e0d('0x13')]['toString']();}else if(_0x13c98e[_0x7e0d('0x12')]==='variable'&&_0x13c98e[_0x7e0d('0x14')]&&_0x13c98e[_0x7e0d('0x15')]&&_0x175356[_0x13c98e[_0x7e0d('0x14')]]){_0x5d1319[_0x13c98e[_0x7e0d('0x15')]]=_0x175356[_0x13c98e[_0x7e0d('0x14')]][_0x7e0d('0x16')]();}else if(_0x13c98e['type']===_0x7e0d('0x17')&&_0x13c98e[_0x7e0d('0x18')]&&_0x13c98e[_0x7e0d('0x18')][_0x7e0d('0x19')]&&_0x13c98e[_0x7e0d('0x15')]&&_0x175356[_0x13c98e[_0x7e0d('0x18')][_0x7e0d('0x19')]['toLowerCase']()]){_0x5d1319[_0x13c98e['idField']]=_0x175356[_0x13c98e[_0x7e0d('0x18')][_0x7e0d('0x19')][_0x7e0d('0x1a')]()][_0x7e0d('0x16')]();}});}return _0x5d1319;}function getName(_0x5799ff){if(_0x5799ff['indexOf']('\x20')>0x0){var _0x28c847=_0x5799ff[_0x7e0d('0x1b')](/ (.+)/);if(_0x28c847[0x1]){return _0x28c847;}}return[_0x5799ff,_0x5799ff];}var accountsTokens={};function getAccessToken(_0xa3218c){return new Promise(function(_0x3223a8,_0x20cd91){if(!_[_0x7e0d('0x1c')](accountsTokens[_0xa3218c['id']])&&!_['isNil'](accountsTokens[_0xa3218c['id']][_0x7e0d('0x1d')])){if(moment()[_0x7e0d('0x1e')](accountsTokens[_0xa3218c['id']]['expires_in'])){_0x3223a8(accountsTokens[_0xa3218c['id']][_0x7e0d('0x1d')]);}}var _0x3c993e;switch(_0xa3218c[_0x7e0d('0x1f')]){case'US':_0x3c993e=_0x7e0d('0x20');break;case'AU':_0x3c993e=_0x7e0d('0x21');break;case'EU':_0x3c993e=_0x7e0d('0x22');break;case'IN':_0x3c993e=_0x7e0d('0x23');break;case'CN':_0x3c993e=_0x7e0d('0x24');break;default:_0x3c993e=_0x7e0d('0x22');break;}var _0xbef3b9={'method':_0x7e0d('0x25'),'uri':_0x3c993e+_0x7e0d('0x26'),'qs':{'refresh_token':_0xa3218c[_0x7e0d('0x27')],'client_id':_0xa3218c[_0x7e0d('0x28')],'client_secret':_0xa3218c[_0x7e0d('0x29')],'grant_type':_0x7e0d('0x2a')},'json':!![]};return rp(_0xbef3b9)[_0x7e0d('0x2b')](function(_0x38e269){accountsTokens[_0xa3218c['id']]={'access_token':_0x38e269[_0x7e0d('0x1d')],'expires_in':moment()[_0x7e0d('0x2c')](_0x38e269[_0x7e0d('0x2d')],_0x7e0d('0x2e'))};_0x3223a8(_0x38e269[_0x7e0d('0x1d')]);})[_0x7e0d('0x2f')](function(_0x234bd4){logger[_0x7e0d('0x30')]('Failing\x20creating\x20the\x20access_token',_0x234bd4[_0x7e0d('0x31')]);_0x20cd91(_0x234bd4);});});}function getUser(_0x3f5165,_0x2399b5,_0x436a1d,_0x51eed3){logger[_0x7e0d('0x32')](_0x7e0d('0x33'));return request({'method':'GET','uri':util['format'](_0x7e0d('0x34'),_0x2399b5),'qs':{'type':_0x7e0d('0x35')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3f5165},'json':!![]})[_0x7e0d('0x2b')](function(_0x4518be){if(_0x4518be[_0x7e0d('0x36')]){var _0x4c417b=-0x1;if(_[_0x7e0d('0x37')](_0x4518be[_0x7e0d('0x36')])){if(!_[_0x7e0d('0x1c')](_0x51eed3)){_0x4c417b=_[_0x7e0d('0x38')](_0x4518be[_0x7e0d('0x36')],function(_0x2de0d9){return _0x2de0d9[_0x7e0d('0x39')]===_0x51eed3;});}if(_0x4c417b>=0x0){logger[_0x7e0d('0x32')](_0x7e0d('0x3a'));}else{logger[_0x7e0d('0x32')]('Using\x20the\x20admin\x20account!');_0x4c417b=_[_0x7e0d('0x38')](_0x4518be[_0x7e0d('0x36')],function(_0x10dbdc){return _0x10dbdc['profile'][_0x7e0d('0x19')]==='Administrator';});}return _0x4518be[_0x7e0d('0x36')][_0x4c417b];}else{if(_0x4518be[_0x7e0d('0x3b')][_0x7e0d('0x3c')][_0x7e0d('0x19')]==='Administrator'){logger[_0x7e0d('0x32')](_0x7e0d('0x3d'));user=_0x4518be[_0x7e0d('0x3b')];return user;}else{logger[_0x7e0d('0x30')](_0x7e0d('0x3e'),JSON[_0x7e0d('0xe')](_0x4518be));throw new Error(_0x7e0d('0x3f')+JSON[_0x7e0d('0xe')](_0x4518be));}}}else{logger[_0x7e0d('0x30')](_0x7e0d('0x3e'),JSON['stringify'](_0x4518be));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7e0d('0xe')](_0x4518be));}})[_0x7e0d('0x2f')](function(_0x1f5ed7){console[_0x7e0d('0x30')](_0x1f5ed7);});}function getZohoUser(_0x35b99f,_0xfb8259){return new BPromise(function(_0xfd534c,_0x3806b0){request(_0x35b99f)[_0x7e0d('0x2b')](function(_0x1417fa){var _0x59ccff=null;if(_0x1417fa){_0x59ccff=_0x1417fa[_0x7e0d('0x40')][0x0];_0x59ccff[_0x7e0d('0x41')]=_0xfb8259;}_0xfd534c(_0x59ccff);})[_0x7e0d('0x2f')](function(_0xc267db){_0x3806b0(_0xc267db);});});}function createEndUser(_0x53d002,_0xda910f,_0x4fa0cd,_0x5e9826,_0x4b622b,_0x1a168f){var _0x4fa0cd=getName(_0x4fa0cd);return request({'method':_0x7e0d('0x25'),'uri':'https://www.zohoapis.'+_0xda910f+_0x7e0d('0x42')+_[_0x7e0d('0x43')](_0x1a168f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4fa0cd[0x1],'First_Name':_0x4fa0cd[0x0],'Phone':_0x5e9826,'Owner':{'name':!_[_0x7e0d('0x1c')](_0x4b622b[_0x7e0d('0x44')][_0x7e0d('0x19')])?_0x4b622b['role'][_0x7e0d('0x19')]:!_['isNil'](_0x4b622b[_0x7e0d('0x45')])?_0x4b622b[_0x7e0d('0x45')]+'\x20'+_0x4b622b[_0x7e0d('0x46')]:_0x4b622b[_0x7e0d('0x46')],'id':_0x4b622b['id']}}]},'headers':{'Authorization':_0x7e0d('0x47')+_0x53d002},'json':!![]})[_0x7e0d('0x2b')](function(_0x50dc01){if(_0x50dc01&&_0x50dc01[_0x7e0d('0x40')][0x0][_0x7e0d('0x48')]===_0x7e0d('0x49')){var _0x444796=_0x50dc01[_0x7e0d('0x40')][0x0]['details'];_0x444796[_0x7e0d('0x41')]=_[_0x7e0d('0x43')](_0x1a168f['moduleCreate'])+'s';return _0x444796;}logger[_0x7e0d('0x30')](_0x7e0d('0x3e'),JSON[_0x7e0d('0xe')](data));throw new Error('Error:\x20'+JSON[_0x7e0d('0xe')](data));})[_0x7e0d('0x2f')](function(_0x4f7860){console[_0x7e0d('0x4a')](_0x7e0d('0x4b'),_0x4f7860);});}function getEndUser(_0x4cc511,_0x8fa9f2,_0x1b67ac,_0x3876e9,_0x231ac6,_0x381443,_0x35ce2d){var _0x5c43da={'method':_0x7e0d('0x4c'),'uri':'','headers':{'Authorization':_0x7e0d('0x47')+_0x4cc511},'json':!![]};switch(_0x35ce2d[_0x7e0d('0x4d')]){case _0x7e0d('0x4e'):_0x5c43da[_0x7e0d('0x4f')]=_0x7e0d('0x50')+_0x8fa9f2+_0x7e0d('0x51')+_0x231ac6+'))';return getZohoUser(_0x5c43da,_0x7e0d('0x52'))[_0x7e0d('0x2b')](function(_0x3a1b13){if(_0x3a1b13)return _0x3a1b13;_0x5c43da['uri']='https://www.zohoapis.'+_0x8fa9f2+_0x7e0d('0x53')+_0x231ac6+'))';return getZohoUser(_0x5c43da,_0x7e0d('0x54'))[_0x7e0d('0x2b')](function(_0x13fd33){if(_0x13fd33)return _0x13fd33;if(_0x35ce2d['moduleCreate']!=_0x7e0d('0x55')){return createEndUser(_0x4cc511,_0x8fa9f2,_0x3876e9,_0x231ac6,_0x381443,_0x35ce2d);}else{return{};}});});break;case'contact':_0x5c43da['uri']=_0x7e0d('0x50')+_0x8fa9f2+_0x7e0d('0x51')+_0x231ac6+'))';return getZohoUser(_0x5c43da,_0x7e0d('0x52'))['then'](function(_0x1c1a43){if(_0x1c1a43)return _0x1c1a43;if(_0x35ce2d[_0x7e0d('0x56')]!=_0x7e0d('0x55')){return createEndUser(_0x4cc511,_0x8fa9f2,_0x3876e9,_0x231ac6,_0x381443,_0x35ce2d);}else{return{};}});break;case _0x7e0d('0x57'):_0x5c43da[_0x7e0d('0x4f')]=_0x7e0d('0x50')+_0x8fa9f2+_0x7e0d('0x53')+_0x231ac6+'))';return getZohoUser(_0x5c43da,_0x7e0d('0x54'))[_0x7e0d('0x2b')](function(_0x467767){if(_0x467767)return _0x467767;if(_0x35ce2d[_0x7e0d('0x56')]!='nothing'){return createEndUser(_0x4cc511,_0x8fa9f2,_0x3876e9,_0x231ac6,_0x381443,_0x35ce2d);}else{return{};}});break;}}function getCall(_0x4457b0,_0x2ff6c4,_0x399d3d,_0x23483a,_0x3007bb,_0x90823d,_0x5b77fd,_0x3c8cd1){logger['info'](_0x7e0d('0x58'));var _0x1a17bb={};_0x1a17bb[_0x7e0d('0x59')]={'name':!_[_0x7e0d('0x1c')](_0x23483a[_0x7e0d('0x44')][_0x7e0d('0x19')])&&!_[_0x7e0d('0x1c')](_0x23483a['profile']['name'])&&_0x23483a[_0x7e0d('0x3c')]['name']==='administrator'?_0x23483a[_0x7e0d('0x44')][_0x7e0d('0x19')]:!_[_0x7e0d('0x1c')](_0x23483a[_0x7e0d('0x45')])?_0x23483a[_0x7e0d('0x45')]+'\x20'+_0x23483a[_0x7e0d('0x46')]:_0x23483a['last_name'],'id':_0x23483a['id']};_0x1a17bb[_0x7e0d('0x5a')]=intUtil[_0x7e0d('0x5b')](_0x90823d['Subjects'],_0x5b77fd,'\x20');_0x1a17bb['Description']=intUtil[_0x7e0d('0x5b')](_0x90823d[_0x7e0d('0x5c')],_0x5b77fd,'\x0a');if(_0x3007bb[_0x7e0d('0x41')]===_0x7e0d('0x52')){_0x1a17bb[_0x7e0d('0x5d')]={'name':!_[_0x7e0d('0x1c')](_0x3007bb[_0x7e0d('0x5e')])?_0x3007bb[_0x7e0d('0x5e')]:!_[_0x7e0d('0x1c')](_0x3007bb[_0x7e0d('0x5f')])?_0x3007bb[_0x7e0d('0x5f')]+'\x20'+_0x3007bb[_0x7e0d('0x60')]:_0x3007bb[_0x7e0d('0x60')],'id':_0x3007bb['id']};}if(_0x3007bb[_0x7e0d('0x41')]==='Leads'){_0x1a17bb['What_Id']={'name':!_[_0x7e0d('0x1c')](_0x3007bb[_0x7e0d('0x5e')])?_0x3007bb['Full_Name']:!_[_0x7e0d('0x1c')](_0x3007bb['First_Name'])?_0x3007bb[_0x7e0d('0x5f')]+'\x20'+_0x3007bb[_0x7e0d('0x60')]:_0x3007bb[_0x7e0d('0x60')],'id':_0x3007bb['id']};_0x1a17bb[_0x7e0d('0x61')]=_[_0x7e0d('0x43')](_0x3007bb[_0x7e0d('0x41')]);}if(_0x5b77fd[_0x7e0d('0x62')]){_0x1a17bb[_0x7e0d('0x63')]=moment[_0x7e0d('0x64')](parseInt(_0x5b77fd[_0x7e0d('0x62')])*0x3e8)['format'](_0x7e0d('0x65'));}else if(_0x5b77fd[_0x7e0d('0x66')]&&_0x5b77fd[_0x7e0d('0x67')]){_0x1a17bb[_0x7e0d('0x63')]=moment[_0x7e0d('0x64')](moment(_0x5b77fd['endtime'],_0x7e0d('0x68'))['diff'](moment(_0x5b77fd[_0x7e0d('0x69')],_0x7e0d('0x68'))))['format'](_0x7e0d('0x65'));}switch(_0x5b77fd[_0x7e0d('0x6a')]){case _0x7e0d('0x6b'):_0x1a17bb[_0x7e0d('0x6c')]=_0x7e0d('0x6d');break;case'complete':case _0x7e0d('0x6e'):_0x1a17bb[_0x7e0d('0x6c')]=_0x7e0d('0x6f');break;case _0x7e0d('0x70'):_0x1a17bb[_0x7e0d('0x6c')]='Rejected';break;case _0x7e0d('0x71'):_0x1a17bb['Call_Result']=_0x7e0d('0x72');break;case'timeout':_0x1a17bb[_0x7e0d('0x6c')]=_0x7e0d('0x73');default:}_0x1a17bb[_0x7e0d('0x74')]=(_0x3c8cd1===_0x7e0d('0x75')?moment(_0x5b77fd[_0x7e0d('0x69')])[_0x7e0d('0x76')](_0x7e0d('0x68')):moment(_0x5b77fd['agentcalledAt'])[_0x7e0d('0x76')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x7e0d('0x76')](_0x7e0d('0x68'));_0x1a17bb[_0x7e0d('0x77')]=_0x3c8cd1||_0x7e0d('0x78');_0x1a17bb=_[_0x7e0d('0x79')](_0x1a17bb,getCustomFields(_0x90823d[_0x7e0d('0x7a')],_0x5b77fd));return request({'method':'POST','uri':_0x7e0d('0x50')+_0x2ff6c4+_0x7e0d('0x7b'),'headers':{'Authorization':_0x7e0d('0x47')+_0x4457b0},'body':{'data':[_0x1a17bb]},'json':!![]})[_0x7e0d('0x2b')](function(_0x314423){if(_0x314423&&_0x314423[_0x7e0d('0x40')][0x0][_0x7e0d('0x48')]===_0x7e0d('0x49')){logger['info']('Call\x20created!');return{'id':_0x314423['data'][0x0]['details']['id']};}})[_0x7e0d('0x2f')](function(_0x1714b8){logger[_0x7e0d('0x32')]('err',_0x1714b8['stack']);console[_0x7e0d('0x4a')](_0x7e0d('0x7c'),_0x1714b8);});}exports[_0x7e0d('0x7d')]=function(_0x258741,_0x29fad4,_0x7196c2,_0x5c35aa,_0x1ebfec,_0x1a199e){var _0x4ebd6c,_0x5c06b6,_0x5e6db9;_0x1a199e['host']=intUtil[_0x7e0d('0x7e')](_0x1a199e[_0x7e0d('0x7f')]);_0x1a199e[_0x7e0d('0x80')]=intUtil[_0x7e0d('0x7e')](_0x1a199e['serverUrl']);if(_0x1ebfec&&_0x1ebfec[_0x7e0d('0x81')]){logger[_0x7e0d('0x32')](_0x7e0d('0x82'),'Recording\x20is\x20enabled!');_0x29fad4[_0x7e0d('0x83')]=_0x1a199e[_0x7e0d('0x80')]+_0x7e0d('0x84')+_0x29fad4[_0x7e0d('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x29fad4[_0x7e0d('0x85')]);}else{_0x29fad4[_0x7e0d('0x83')]='';}var _0x1493b0=_0x1a199e[_0x7e0d('0x7f')]===_0x7e0d('0x86')?'eu':_0x7e0d('0x87');return getAccessToken(_0x1a199e)[_0x7e0d('0x2b')](function(_0x5ec2a1){_0x5e6db9=_0x5ec2a1;return getUser(_0x5e6db9,_0x1493b0,_0x1a199e,_0x5c35aa[_0x7e0d('0x39')]);})[_0x7e0d('0x2b')](function(_0x3e2ce6){_0x4ebd6c=_0x3e2ce6;logger[_0x7e0d('0x32')](_0x7e0d('0x88'),_0x4ebd6c['id']);return getEndUser(_0x5e6db9,_0x1493b0,_0x1a199e,_0x29fad4['calleridname'],_0x29fad4[_0x7e0d('0x89')],_0x4ebd6c,_0x7196c2);})['then'](function(_0x2741e9){_0x5c06b6=_0x2741e9;return getCall(_0x5e6db9,_0x1493b0,_0x1a199e,_0x4ebd6c,_0x5c06b6,_0x7196c2,_0x29fad4,_0x7e0d('0x78'));})['then'](function(_0x1db58a){if(_0x1db58a){logger[_0x7e0d('0x32')]('The\x20Call\x20ID\x20is:',_0x1db58a['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7e0d('0x76')](_0x7e0d('0x8a'),_0x5c35aa['name']),_0x7e0d('0x8b'),{'uri':'https://crm.'+_0x1a199e[_0x7e0d('0x7f')]+_0x7e0d('0x8c')+_0x1db58a['id']});}})['catch'](function(_0x14d8bf){logger[_0x7e0d('0x30')](_0x7e0d('0x82'),JSON[_0x7e0d('0xe')](_0x14d8bf));});};exports['outbound']=function(_0x1dbb8f,_0x4613bf,_0x55d777,_0x249fa4,_0x16be4e,_0x5519d1,_0x1f0dd2){var _0x2b63a1,_0x4ab2f8,_0x488006;_0x5519d1[_0x7e0d('0x7f')]=intUtil['stripTrailingSlash'](_0x5519d1[_0x7e0d('0x7f')]);_0x5519d1[_0x7e0d('0x80')]=intUtil[_0x7e0d('0x7e')](_0x5519d1['serverUrl']);if(_0x1f0dd2&&_0x1f0dd2[_0x7e0d('0x8d')]&&_0x1f0dd2[_0x7e0d('0x8d')]!==_0x7e0d('0x8e')){logger[_0x7e0d('0x32')](_0x7e0d('0x8f'),'Recording\x20is\x20enabled!');_0x4613bf['recordingURL']=_0x5519d1[_0x7e0d('0x80')]+_0x7e0d('0x84')+_0x4613bf[_0x7e0d('0x85')]+_0x7e0d('0x90')+md5(_0x4613bf[_0x7e0d('0x85')]);}var _0x2acfad=_0x5519d1[_0x7e0d('0x7f')]===_0x7e0d('0x86')?'eu':_0x7e0d('0x87');return getAccessToken(_0x5519d1)[_0x7e0d('0x2b')](function(_0xda3f49){_0x488006=_0xda3f49;return getUser(_0x488006,_0x2acfad,_0x5519d1,_0x249fa4[_0x7e0d('0x39')]);})[_0x7e0d('0x2b')](function(_0x50f890){_0x2b63a1=_0x50f890;logger[_0x7e0d('0x32')](_0x7e0d('0x88'),_0x2b63a1['id']);return getEndUser(_0x488006,_0x2acfad,_0x5519d1,_0x4613bf[_0x7e0d('0x91')],_0x4613bf['destcalleridnum'],_0x2b63a1,_0x55d777);})[_0x7e0d('0x2b')](function(_0x1def3a){_0x4ab2f8=_0x1def3a;return getCall(_0x488006,_0x2acfad,_0x5519d1,_0x2b63a1,_0x4ab2f8,_0x55d777,_0x4613bf,_0x7e0d('0x92'));})[_0x7e0d('0x2b')](function(_0x4f0705){if(_0x4f0705){logger[_0x7e0d('0x32')](_0x7e0d('0x93'),_0x4f0705['id']);logger[_0x7e0d('0x32')](_0x7e0d('0x8f'),_0x7e0d('0x94'));emit(util['format'](_0x7e0d('0x8a'),_0x249fa4[_0x7e0d('0x19')]),'trigger:browser:url',{'uri':_0x7e0d('0x95')+_0x5519d1[_0x7e0d('0x7f')]+_0x7e0d('0x8c')+_0x4f0705['id']});}})[_0x7e0d('0x2f')](function(_0x90a7d5){logger['error'](_0x7e0d('0x8f'),JSON[_0x7e0d('0xe')](_0x90a7d5));});};exports['unmanaged']=function(_0x36e90a,_0x3bf4cf,_0x1d359c,_0x1292f2,_0x27f131,_0x20df4e){var _0x40702a,_0x478923,_0x160d56;_0x20df4e[_0x7e0d('0x7f')]=intUtil[_0x7e0d('0x7e')](_0x20df4e[_0x7e0d('0x7f')]);_0x20df4e[_0x7e0d('0x80')]=intUtil[_0x7e0d('0x7e')](_0x20df4e[_0x7e0d('0x80')]);if(_0x27f131&&_0x27f131[_0x7e0d('0x81')]){logger[_0x7e0d('0x32')]('['+_0x3bf4cf['lastevent'][_0x7e0d('0x96')]()+']','Recording\x20is\x20enabled!');_0x3bf4cf[_0x7e0d('0x83')]=_0x20df4e[_0x7e0d('0x80')]+_0x7e0d('0x84')+_0x3bf4cf[_0x7e0d('0x85')]+_0x7e0d('0x90')+md5(_0x3bf4cf[_0x7e0d('0x85')]);}else{_0x3bf4cf['recordingURL']='';}var _0x42db43=_0x20df4e[_0x7e0d('0x7f')]===_0x7e0d('0x86')?'eu':_0x7e0d('0x87');return getAccessToken(_0x20df4e)[_0x7e0d('0x2b')](function(_0x509a43){_0x160d56=_0x509a43;return getUser(_0x160d56,_0x42db43,_0x20df4e);})[_0x7e0d('0x2b')](function(_0x1e93ba){_0x40702a=_0x1e93ba;logger[_0x7e0d('0x32')](_0x7e0d('0x88'),_0x40702a['id']);return getEndUser(_0x160d56,_0x42db43,_0x20df4e,_0x3bf4cf['calleridname'],_0x3bf4cf[_0x7e0d('0x89')],_0x40702a,_0x1d359c);})['then'](function(_0xf87915){_0x478923=_0xf87915;return getCall(_0x160d56,_0x42db43,_0x20df4e,_0x40702a,_0x478923,_0x1d359c,_0x3bf4cf,'Inbound');})['then'](function(_0x10a22c){if(_0x10a22c){logger[_0x7e0d('0x32')](_0x7e0d('0x93'),_0x10a22c['id']);}})[_0x7e0d('0x2f')](function(_0x55e207){logger['error']('['+_0x3bf4cf['lastevent'][_0x7e0d('0x96')]()+']',JSON[_0x7e0d('0xe')](_0x55e207));});}; \ 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 3e7aea5..55a4122 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 _0x8be9=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8be9,0x168));var _0x98be=function(_0x5059f8,_0x2a16cc){_0x5059f8=_0x5059f8-0x0;var _0xffff36=_0x8be9[_0x5059f8];return _0xffff36;};'use strict';var util=require('util');var sh=require(_0x98be('0x0'));var Mustache=require(_0x98be('0x1'));var logger=require(_0x98be('0x2'))(_0x98be('0x3'));exports[_0x98be('0x4')]=function(_0x5664a0,_0x5420f0){var _0x4d3d53=_0x5664a0[_0x98be('0x5')]?_0x5664a0[_0x98be('0x5')]:_0x98be('0x6');var _0xd13f9b=_0x5664a0[_0x98be('0x7')]?Mustache['render'](_0x5664a0[_0x98be('0x7')],_0x5420f0):_0x5420f0;sh[_0x98be('0x4')](_0xd13f9b,function(_0x1179bc,_0xcf00c2,_0x27c25e){if(_0x1179bc!==0x0){logger[_0x98be('0x8')](util['format'](_0x98be('0x9'),_0x4d3d53,_0xd13f9b,_0x1179bc,_0x27c25e));}else{logger[_0x98be('0xa')](util[_0x98be('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4d3d53,_0xd13f9b,_0xcf00c2));}});}; \ No newline at end of file +var _0xc889=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','data2','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xc889,0x1ed));var _0x9c88=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc889[_0x4ae6ef];return _0x3cbb4e;};'use strict';var util=require('util');var sh=require(_0x9c88('0x0'));var Mustache=require(_0x9c88('0x1'));var logger=require(_0x9c88('0x2'))(_0x9c88('0x3'));exports['exec']=function(_0x46c966,_0x56dbe0){var _0x1c32ad=_0x46c966[_0x9c88('0x4')]?_0x46c966[_0x9c88('0x4')]:'Script';var _0x488c8d=_0x46c966[_0x9c88('0x5')]?Mustache['render'](_0x46c966['data3'],_0x56dbe0):_0x56dbe0;sh[_0x9c88('0x6')](_0x488c8d,function(_0x585271,_0x55d1bd,_0x529a4a){if(_0x585271!==0x0){logger[_0x9c88('0x7')](util[_0x9c88('0x8')](_0x9c88('0x9'),_0x1c32ad,_0x488c8d,_0x585271,_0x529a4a));}else{logger[_0x9c88('0xa')](util[_0x9c88('0x8')](_0x9c88('0xb'),_0x1c32ad,_0x488c8d,_0x55d1bd));}});}; \ 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 ca21883..4b774cd 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 _0x6bc6=['error','body','info','format','then','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','trigger','exec','render','data2','data5','headers','data6','parse','stack','data1','GET','DELETE','POST','data7'];(function(_0x12ad4f,_0x3bf0e7){var _0x999891=function(_0x3448ca){while(--_0x3448ca){_0x12ad4f['push'](_0x12ad4f['shift']());}};_0x999891(++_0x3bf0e7);}(_0x6bc6,0x178));var _0x66bc=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x6bc6[_0x3817a9];return _0x443f30;};'use strict';var rp=require(_0x66bc('0x0'));var util=require('util');var _=require(_0x66bc('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x66bc('0x2'));exports[_0x66bc('0x3')]=function(_0x54cb4d,_0x21c0dd){var _0x389296,_0x285e14;var _0x1b04cc={'method':_0x54cb4d['data1']['toUpperCase'](),'uri':Mustache[_0x66bc('0x4')](_0x54cb4d[_0x66bc('0x5')],_0x21c0dd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x54cb4d[_0x66bc('0x6')])==='number'&&parseInt(_0x54cb4d[_0x66bc('0x6')])>=0x1&&parseInt(_0x54cb4d[_0x66bc('0x6')])<=0xa?parseInt(_0x54cb4d[_0x66bc('0x6')])*0x3e8:0x5*0x3e8};try{_0x1b04cc[_0x66bc('0x7')]=_0x54cb4d[_0x66bc('0x8')]?JSON[_0x66bc('0x9')](Mustache['render'](_0x54cb4d[_0x66bc('0x8')],_0x21c0dd)):{};}catch(_0x2e080d){logger['error'](_0x2e080d[_0x66bc('0xa')]);}switch(_0x54cb4d[_0x66bc('0xb')]['toUpperCase']()){case _0x66bc('0xc'):case _0x66bc('0xd'):_0x389296=null;_0x1b04cc['qs']=_0x21c0dd;break;case _0x66bc('0xe'):case'PUT':if(_0x54cb4d['data7']){try{_0x389296=JSON[_0x66bc('0x9')](Mustache['render'](_0x54cb4d[_0x66bc('0xf')],_0x21c0dd));_0x1b04cc['body']=_0x389296;}catch(_0x5c5cbd){logger['error'](_0x5c5cbd['stack']);logger[_0x66bc('0x10')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x389296=_0x21c0dd;_0x1b04cc[_0x66bc('0x11')]=_0x389296;}break;}logger[_0x66bc('0x12')](util[_0x66bc('0x13')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x54cb4d['data1'],_0x54cb4d[_0x66bc('0x5')],JSON['stringify'](_0x1b04cc)));rp(_0x1b04cc)[_0x66bc('0x14')](function(_0x1b6822){_0x389296=!_['isNil'](_0x389296)?',\x20request\x20body:\x20'+_0x389296:'';_0x285e14=typeof _0x1b6822[_0x66bc('0x11')]===_0x66bc('0x15')?JSON[_0x66bc('0x16')](_0x1b6822[_0x66bc('0x11')]):_0x1b6822['body'];logger[_0x66bc('0x12')](util['format'](_0x66bc('0x17'),_0x54cb4d[_0x66bc('0xb')],_0x54cb4d[_0x66bc('0x5')],_0x1b6822[_0x66bc('0x18')],_0x285e14));})[_0x66bc('0x19')](function(_0x4b0f7e){logger[_0x66bc('0x10')](util[_0x66bc('0x13')](_0x66bc('0x1a'),_0x54cb4d[_0x66bc('0xb')],_0x54cb4d[_0x66bc('0x5')],_0x4b0f7e['statusCode'],_0x4b0f7e[_0x66bc('0x1b')],_0x4b0f7e['message']));});}; \ No newline at end of file +var _0xae51=['exec','data1','render','data2','data5','number','headers','data6','parse','error','toUpperCase','GET','DELETE','POST','PUT','data7','stack','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger'];(function(_0x37f4cc,_0x53d6f5){var _0x1ef18e=function(_0x11af21){while(--_0x11af21){_0x37f4cc['push'](_0x37f4cc['shift']());}};_0x1ef18e(++_0x53d6f5);}(_0xae51,0x7c));var _0x1ae5=function(_0x47a502,_0x7d1aff){_0x47a502=_0x47a502-0x0;var _0x112931=_0xae51[_0x47a502];return _0x112931;};'use strict';var rp=require('request-promise');var util=require(_0x1ae5('0x0'));var _=require(_0x1ae5('0x1'));var Mustache=require(_0x1ae5('0x2'));var logger=require(_0x1ae5('0x3'))('trigger');exports[_0x1ae5('0x4')]=function(_0x38c502,_0xec643d){var _0x17fff3,_0x589c20;var _0x404f1a={'method':_0x38c502[_0x1ae5('0x5')]['toUpperCase'](),'uri':Mustache[_0x1ae5('0x6')](_0x38c502[_0x1ae5('0x7')],_0xec643d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x38c502[_0x1ae5('0x8')])===_0x1ae5('0x9')&&parseInt(_0x38c502[_0x1ae5('0x8')])>=0x1&&parseInt(_0x38c502['data5'])<=0xa?parseInt(_0x38c502[_0x1ae5('0x8')])*0x3e8:0x5*0x3e8};try{_0x404f1a[_0x1ae5('0xa')]=_0x38c502[_0x1ae5('0xb')]?JSON[_0x1ae5('0xc')](Mustache[_0x1ae5('0x6')](_0x38c502[_0x1ae5('0xb')],_0xec643d)):{};}catch(_0x8bfb94){logger[_0x1ae5('0xd')](_0x8bfb94['stack']);}switch(_0x38c502['data1'][_0x1ae5('0xe')]()){case _0x1ae5('0xf'):case _0x1ae5('0x10'):_0x17fff3=null;_0x404f1a['qs']=_0xec643d;break;case _0x1ae5('0x11'):case _0x1ae5('0x12'):if(_0x38c502[_0x1ae5('0x13')]){try{_0x17fff3=JSON['parse'](Mustache[_0x1ae5('0x6')](_0x38c502[_0x1ae5('0x13')],_0xec643d));_0x404f1a['body']=_0x17fff3;}catch(_0x1c1fe9){logger[_0x1ae5('0xd')](_0x1c1fe9[_0x1ae5('0x14')]);logger[_0x1ae5('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x17fff3=_0xec643d;_0x404f1a[_0x1ae5('0x15')]=_0x17fff3;}break;}logger[_0x1ae5('0x16')](util[_0x1ae5('0x17')](_0x1ae5('0x18'),_0x38c502[_0x1ae5('0x5')],_0x38c502['data2'],JSON[_0x1ae5('0x19')](_0x404f1a)));rp(_0x404f1a)[_0x1ae5('0x1a')](function(_0x154a55){_0x17fff3=!_['isNil'](_0x17fff3)?',\x20request\x20body:\x20'+_0x17fff3:'';_0x589c20=typeof _0x154a55['body']===_0x1ae5('0x1b')?JSON[_0x1ae5('0x19')](_0x154a55[_0x1ae5('0x15')]):_0x154a55['body'];logger[_0x1ae5('0x16')](util[_0x1ae5('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x38c502['data1'],_0x38c502[_0x1ae5('0x7')],_0x154a55['statusCode'],_0x589c20));})[_0x1ae5('0x1c')](function(_0x385c99){logger[_0x1ae5('0xd')](util['format'](_0x1ae5('0x1d'),_0x38c502[_0x1ae5('0x5')],_0x38c502[_0x1ae5('0x7')],_0x385c99['statusCode'],_0x385c99[_0x1ae5('0x1e')],_0x385c99[_0x1ae5('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 53f7f62..b5c3f8b 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 _0x122e=['Request','routing','error','rpc','message','catch','jayson/promise','bluebird','client'];(function(_0xe7fd95,_0xcc3723){var _0x5ce05f=function(_0x2cd70d){while(--_0x2cd70d){_0xe7fd95['push'](_0xe7fd95['shift']());}};_0x5ce05f(++_0xcc3723);}(_0x122e,0x126));var _0xe122=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x122e[_0x122ef9];return _0x42fba0;};'use strict';var jayson=require(_0xe122('0x0'));var BPromise=require(_0xe122('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xe122('0x2')]['http']({'port':0x2329});client[_0xe122('0x3')]=function(_0x14214d,_0x27c9ac){return new BPromise(function(_0x2c7da1,_0x563a28){return client['request'](_0x14214d,_0x27c9ac)['then'](function(_0x56b58a){logger['debug']('rpc',_0xe122('0x4'),_0x14214d,_0x27c9ac,_0x56b58a);if(_0x56b58a[_0xe122('0x5')]){logger[_0xe122('0x5')](_0xe122('0x6'),_0xe122('0x4'),_0x14214d,_0x56b58a[_0xe122('0x5')][_0xe122('0x7')],_0x27c9ac);return _0x563a28(_0x56b58a['error'][_0xe122('0x7')]);}else{return _0x2c7da1(_0x56b58a['result']);}})[_0xe122('0x8')](function(_0x2423f1){logger[_0xe122('0x5')](_0xe122('0x6'),_0xe122('0x4'),_0x14214d,_0x2423f1,_0x27c9ac);return _0x563a28(_0x2423f1);});});};module['exports']=client; \ No newline at end of file +var _0x69c5=['rpc','message','result','exports','../../config/logger','routing','client','http','Request','then','debug','error'];(function(_0x255a3c,_0x47d0ff){var _0x3e5788=function(_0x1ba9f4){while(--_0x1ba9f4){_0x255a3c['push'](_0x255a3c['shift']());}};_0x3e5788(++_0x47d0ff);}(_0x69c5,0x1b4));var _0x569c=function(_0x33b0b0,_0x3adb2a){_0x33b0b0=_0x33b0b0-0x0;var _0x5aa833=_0x69c5[_0x33b0b0];return _0x5aa833;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x569c('0x0'))(_0x569c('0x1'));var client=jayson[_0x569c('0x2')][_0x569c('0x3')]({'port':0x2329});client[_0x569c('0x4')]=function(_0x48b853,_0xb70103){return new BPromise(function(_0x553521,_0x274df3){return client['request'](_0x48b853,_0xb70103)[_0x569c('0x5')](function(_0x13d2ca){logger[_0x569c('0x6')]('rpc',_0x569c('0x1'),_0x48b853,_0xb70103,_0x13d2ca);if(_0x13d2ca[_0x569c('0x7')]){logger['error'](_0x569c('0x8'),_0x569c('0x1'),_0x48b853,_0x13d2ca[_0x569c('0x7')][_0x569c('0x9')],_0xb70103);return _0x274df3(_0x13d2ca[_0x569c('0x7')]['message']);}else{return _0x553521(_0x13d2ca[_0x569c('0xa')]);}})['catch'](function(_0x407d7f){logger['error']('rpc',_0x569c('0x1'),_0x48b853,_0x407d7f,_0xb70103);return _0x274df3(_0x407d7f);});});};module[_0x569c('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 38da8f8..acc2db0 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 _0xdaea=['catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x58c59d,_0x4ef22f){var _0x463922=function(_0x14e1e7){while(--_0x14e1e7){_0x58c59d['push'](_0x58c59d['shift']());}};_0x463922(++_0x4ef22f);}(_0xdaea,0xe0));var _0xadae=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xdaea[_0x1e4f2d];return _0xd05ce5;};'use strict';var server=require(_0xadae('0x0'));var Realtime=require(_0xadae('0x1'));var EmailChannel=require(_0xadae('0x2'));var mailAccount=require(_0xadae('0x3'));var setting=require(_0xadae('0x4'));var logger=require(_0xadae('0x5'))(_0xadae('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xadae('0x7')]()[_0xadae('0x8')](mailAccount[_0xadae('0x9')]())['then'](realtime[_0xadae('0xa')]())[_0xadae('0x8')](function(){email[_0xadae('0xb')](realtime[_0xadae('0xc')]);return realtime;});}function main(){return server[_0xadae('0xd')](realtime,email)[_0xadae('0x8')](function(){return initRealtime();})[_0xadae('0x8')](function(){return setting['getSettings']();})[_0xadae('0x8')](function(_0x2b63c6){return setInterval(initRealtime,_0x2b63c6['loginMailFrequency']*0x3e8);})[_0xadae('0xe')](function(_0x5b1663){logger[_0xadae('0xf')](_0xadae('0x10'),_0x5b1663);});}main(); \ No newline at end of file +var _0x4243=['initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then'];(function(_0x3d91ea,_0x338a32){var _0x1bf213=function(_0x31d7c2){while(--_0x31d7c2){_0x3d91ea['push'](_0x3d91ea['shift']());}};_0x1bf213(++_0x338a32);}(_0x4243,0x93));var _0x3424=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4243[_0x3dd15e];return _0x231fd0;};'use strict';var server=require(_0x3424('0x0'));var Realtime=require(_0x3424('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x3424('0x2'));var setting=require(_0x3424('0x3'));var logger=require(_0x3424('0x4'))(_0x3424('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x3424('0x6')](mailAccount['getMailAccounts']())['then'](realtime[_0x3424('0x7')]())[_0x3424('0x6')](function(){email[_0x3424('0x8')](realtime[_0x3424('0x9')]);return realtime;});}function main(){return server[_0x3424('0xa')](realtime,email)[_0x3424('0x6')](function(){return initRealtime();})[_0x3424('0x6')](function(){return setting['getSettings']();})[_0x3424('0x6')](function(_0x1f7d3f){return setInterval(initRealtime,_0x1f7d3f[_0x3424('0xb')]*0x3e8);})[_0x3424('0xc')](function(_0x6bfbff){logger['error'](_0x3424('0xd'),_0x6bfbff);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a6ee314..d07276d 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 _0x72c5=['prototype','emit','name','key','Imap','isNil','mailAccount:update','refresh','hasOwnProperty','active','provider','custom','service','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','mailAccounts','status','disabled','messageStatus','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x72c5,0x68));var _0x572c=function(_0x5562fe,_0x4e809c){_0x5562fe=_0x5562fe-0x0;var _0x1829c7=_0x72c5[_0x5562fe];return _0x1829c7;};'use strict';var _=require('lodash');var moment=require(_0x572c('0x0'));var BPromise=require(_0x572c('0x1'));var md5=require(_0x572c('0x2'));var Redis=require(_0x572c('0x3'));var config=require(_0x572c('0x4'));var logger=require(_0x572c('0x5'))(_0x572c('0x6'));config[_0x572c('0x7')]=_[_0x572c('0x8')](config['redis'],{'host':_0x572c('0x9'),'port':0x18eb});var io=require(_0x572c('0xa'))(new Redis(config[_0x572c('0x7')]));var EmailImap=require(_0x572c('0xb'));var EmailSmtp=require(_0x572c('0xc'));var mailAccount=require(_0x572c('0xd'));var md5Accounts={};function EmailChannel(_0x3ec40b){logger[_0x572c('0xe')](_0x572c('0xf'));this['mailAccounts']=_0x3ec40b['mailAccounts'];this[_0x572c('0x10')]={};this[_0x572c('0x11')]=new EmailSmtp();}EmailChannel[_0x572c('0x12')][_0x572c('0x13')]=function(_0x1b38e9){var _0x3af1e5=this['mailAccounts'][_0x1b38e9];var _0x294e76={'id':_0x3af1e5['id'],'name':_0x3af1e5[_0x572c('0x14')],'key':_0x3af1e5[_0x572c('0x15')],'active':_0x3af1e5['active'],'Imap':{'status':_0x3af1e5[_0x572c('0x16')]['status'],'messageStatus':_0x3af1e5[_0x572c('0x16')]['messageStatus'],'total':_0x3af1e5[_0x572c('0x16')]['total']}};if(_[_0x572c('0x17')](md5Accounts[_0x1b38e9])){md5Accounts[_0x1b38e9]={};}var _0x232539=md5(JSON['stringify'](_0x294e76));if(md5Accounts[_0x1b38e9]['md5']!==_0x232539){md5Accounts[_0x1b38e9]['md5']=_0x232539;io['emit'](_0x572c('0x18'),_0x294e76);}};EmailChannel[_0x572c('0x12')][_0x572c('0x19')]=function(_0x347394){for(var _0x2d215c in _0x347394){if(_0x347394[_0x572c('0x1a')](_0x2d215c)){if(_0x347394[_0x2d215c]['Imap']&&_0x347394[_0x2d215c][_0x572c('0x1b')]){var _0x3a8343=_0x347394[_0x2d215c][_0x572c('0x16')];if(!_0x3a8343['service']&&_0x347394[_0x2d215c][_0x572c('0x1c')]!==_0x572c('0x1d'))_0x3a8343[_0x572c('0x1e')]=_0x347394[_0x2d215c]['provider'];if(!this['imapAccounts'][_0x572c('0x1a')](_0x3a8343['id'])){this[_0x572c('0x10')][_0x3a8343['id']]=new EmailImap(_0x3a8343,_0x347394[_0x2d215c][_0x572c('0x6')]);this[_0x572c('0x10')][_0x3a8343['id']]['on']('box',this[_0x572c('0x1f')][_0x572c('0x20')](this,_0x2d215c));this['imapAccounts'][_0x3a8343['id']]['on'](_0x572c('0x6'),this[_0x572c('0x21')][_0x572c('0x20')](this,_0x2d215c));this[_0x572c('0x10')][_0x3a8343['id']]['on'](_0x572c('0x22'),this[_0x572c('0x23')][_0x572c('0x20')](this,_0x2d215c));this[_0x572c('0x10')][_0x3a8343['id']]['on'](_0x572c('0x24'),this[_0x572c('0x25')][_0x572c('0x20')](this,_0x2d215c));}}else{if(_[_0x572c('0x17')](this[_0x572c('0x26')][_0x2d215c][_0x572c('0x16')])){this[_0x572c('0x26')][_0x2d215c][_0x572c('0x16')]={};}this['mailAccounts'][_0x2d215c][_0x572c('0x16')][_0x572c('0x27')]=_0x572c('0x28');this[_0x572c('0x26')][_0x2d215c][_0x572c('0x16')][_0x572c('0x29')]='';this[_0x572c('0x13')](_0x2d215c);}}}};EmailChannel[_0x572c('0x12')][_0x572c('0x1f')]=function(_0x5556e0,_0xf47399){if(this[_0x572c('0x26')][_0x5556e0]){this[_0x572c('0x26')][_0x5556e0][_0x572c('0x16')][_0x572c('0x27')]=_0x572c('0x2a');this[_0x572c('0x26')][_0x5556e0][_0x572c('0x16')][_0x572c('0x29')]=_0xf47399[_0x572c('0x14')];if(_0xf47399['messages']){this[_0x572c('0x26')][_0x5556e0][_0x572c('0x16')]['total']=_0xf47399[_0x572c('0x2b')][_0x572c('0x2c')];}return this[_0x572c('0x13')](_0x5556e0);}};EmailChannel[_0x572c('0x12')][_0x572c('0x21')]=function(_0x4cdaf3,_0x5119c6){logger[_0x572c('0xe')](_0x572c('0x2d'),_0x5119c6['firstName'],_0x5119c6[_0x572c('0x2e')],_0x5119c6['from'],_0x4cdaf3);if(this['mailAccounts'][_0x4cdaf3]){return mailAccount[_0x572c('0x2f')](_0x4cdaf3,_0x5119c6)[_0x572c('0x30')](function(_0x51c56a){if(_0x51c56a){logger[_0x572c('0xe')](_0x572c('0x31'));}})['catch'](function(_0x1b3c3c){logger[_0x572c('0x24')](_0x572c('0x32'),JSON[_0x572c('0x33')](_0x1b3c3c));});}};EmailChannel[_0x572c('0x12')][_0x572c('0x23')]=function(_0x27a2c1){if(this['mailAccounts'][_0x27a2c1]&&this[_0x572c('0x26')][_0x27a2c1][_0x572c('0x16')]){if(this['imapAccounts'][this[_0x572c('0x26')][_0x27a2c1][_0x572c('0x16')]['id']]){delete this['imapAccounts'][this[_0x572c('0x26')][_0x27a2c1][_0x572c('0x16')]['id']];}this[_0x572c('0x26')][_0x27a2c1][_0x572c('0x16')][_0x572c('0x34')]=moment();this['emit'](_0x27a2c1);}};EmailChannel[_0x572c('0x12')][_0x572c('0x25')]=function(_0x164db3,_0x35b109){if(this[_0x572c('0x26')][_0x164db3]){this[_0x572c('0x26')][_0x164db3]['Imap'][_0x572c('0x27')]=_0x572c('0x24');this['mailAccounts'][_0x164db3][_0x572c('0x16')][_0x572c('0x29')]=_0x35b109;return this[_0x572c('0x13')](_0x164db3);}};EmailChannel[_0x572c('0x12')][_0x572c('0x35')]=function(_0x423568,_0x59b8e1){return this[_0x572c('0x11')][_0x572c('0x36')](_0x423568,_0x59b8e1);};EmailChannel[_0x572c('0x12')][_0x572c('0x37')]=function(_0xc7136e){var _0x13b50f=this;if(this[_0x572c('0x26')][_0xc7136e['id']]){if(_[_0x572c('0x17')](this[_0x572c('0x26')][_0xc7136e['id']]['Smtp'])){this[_0x572c('0x26')][_0xc7136e['id']][_0x572c('0x38')]={};}this[_0x572c('0x26')][_0xc7136e['id']][_0x572c('0x38')][_0x572c('0x34')]=moment();return new BPromise(function(_0x4af05f,_0x5179d7){return _0x13b50f[_0x572c('0x11')][_0x572c('0x39')](_0xc7136e)[_0x572c('0x30')](function(_0xe7e036){_0x13b50f[_0x572c('0x26')][_0xc7136e['id']][_0x572c('0x38')][_0x572c('0x27')]=_0x572c('0x3a');_0x13b50f[_0x572c('0x26')][_0xc7136e['id']]['Smtp'][_0x572c('0x29')]='';_0x13b50f[_0x572c('0x13')](_0xc7136e['id']);_0x4af05f(_0xe7e036);})[_0x572c('0x3b')](function(_0xe562ab){_0x13b50f[_0x572c('0x26')][_0xc7136e['id']]['Smtp'][_0x572c('0x27')]='error';_0x13b50f['mailAccounts'][_0xc7136e['id']]['Smtp']['messageStatus']=_0xe562ab;_0x13b50f[_0x572c('0x13')](_0xc7136e['id']);_0x5179d7(_0xe562ab);});});}return this[_0x572c('0x11')]['verify'](_0xc7136e);};module[_0x572c('0x3c')]=EmailChannel; \ No newline at end of file +var _0x6c75=['end','error','disabled','messageStatus','handleImapBox','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','send','verifySmtp','Smtp','smtp','verify','catch','lodash','moment','md5','ioredis','../../../config/logger','email','redis','./smtp','../rpc/mailAccount','info','mailAccounts','emit','name','key','active','Imap','status','total','isNil','stringify','mailAccount:update','prototype','hasOwnProperty','service','provider','custom','imapAccounts','box','handleImapEmail','bind'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x6c75,0x114));var _0x56c7=function(_0x170ee6,_0x12a012){_0x170ee6=_0x170ee6-0x0;var _0x5684ce=_0x6c75[_0x170ee6];return _0x5684ce;};'use strict';var _=require(_0x56c7('0x0'));var moment=require(_0x56c7('0x1'));var BPromise=require('bluebird');var md5=require(_0x56c7('0x2'));var Redis=require(_0x56c7('0x3'));var config=require('../../../config/environment');var logger=require(_0x56c7('0x4'))(_0x56c7('0x5'));config[_0x56c7('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x56c7('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x56c7('0x7'));var mailAccount=require(_0x56c7('0x8'));var md5Accounts={};function EmailChannel(_0x252032){logger[_0x56c7('0x9')]('start\x20email\x20channel');this[_0x56c7('0xa')]=_0x252032[_0x56c7('0xa')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x56c7('0xb')]=function(_0x343ad1){var _0x599168=this[_0x56c7('0xa')][_0x343ad1];var _0x1fb05f={'id':_0x599168['id'],'name':_0x599168[_0x56c7('0xc')],'key':_0x599168[_0x56c7('0xd')],'active':_0x599168[_0x56c7('0xe')],'Imap':{'status':_0x599168[_0x56c7('0xf')][_0x56c7('0x10')],'messageStatus':_0x599168[_0x56c7('0xf')]['messageStatus'],'total':_0x599168[_0x56c7('0xf')][_0x56c7('0x11')]}};if(_[_0x56c7('0x12')](md5Accounts[_0x343ad1])){md5Accounts[_0x343ad1]={};}var _0x3cadcd=md5(JSON[_0x56c7('0x13')](_0x1fb05f));if(md5Accounts[_0x343ad1][_0x56c7('0x2')]!==_0x3cadcd){md5Accounts[_0x343ad1][_0x56c7('0x2')]=_0x3cadcd;io['emit'](_0x56c7('0x14'),_0x1fb05f);}};EmailChannel[_0x56c7('0x15')]['refresh']=function(_0x430f27){for(var _0x47ae44 in _0x430f27){if(_0x430f27[_0x56c7('0x16')](_0x47ae44)){if(_0x430f27[_0x47ae44][_0x56c7('0xf')]&&_0x430f27[_0x47ae44][_0x56c7('0xe')]){var _0x2754f3=_0x430f27[_0x47ae44][_0x56c7('0xf')];if(!_0x2754f3[_0x56c7('0x17')]&&_0x430f27[_0x47ae44][_0x56c7('0x18')]!==_0x56c7('0x19'))_0x2754f3[_0x56c7('0x17')]=_0x430f27[_0x47ae44][_0x56c7('0x18')];if(!this[_0x56c7('0x1a')][_0x56c7('0x16')](_0x2754f3['id'])){this[_0x56c7('0x1a')][_0x2754f3['id']]=new EmailImap(_0x2754f3,_0x430f27[_0x47ae44]['email']);this['imapAccounts'][_0x2754f3['id']]['on'](_0x56c7('0x1b'),this['handleImapBox']['bind'](this,_0x47ae44));this['imapAccounts'][_0x2754f3['id']]['on'](_0x56c7('0x5'),this[_0x56c7('0x1c')][_0x56c7('0x1d')](this,_0x47ae44));this[_0x56c7('0x1a')][_0x2754f3['id']]['on'](_0x56c7('0x1e'),this['handleImapEnd']['bind'](this,_0x47ae44));this[_0x56c7('0x1a')][_0x2754f3['id']]['on'](_0x56c7('0x1f'),this['handleImapError'][_0x56c7('0x1d')](this,_0x47ae44));}}else{if(_[_0x56c7('0x12')](this[_0x56c7('0xa')][_0x47ae44][_0x56c7('0xf')])){this[_0x56c7('0xa')][_0x47ae44][_0x56c7('0xf')]={};}this[_0x56c7('0xa')][_0x47ae44][_0x56c7('0xf')][_0x56c7('0x10')]=_0x56c7('0x20');this[_0x56c7('0xa')][_0x47ae44][_0x56c7('0xf')][_0x56c7('0x21')]='';this[_0x56c7('0xb')](_0x47ae44);}}}};EmailChannel['prototype'][_0x56c7('0x22')]=function(_0x5dd62,_0x363836){if(this[_0x56c7('0xa')][_0x5dd62]){this['mailAccounts'][_0x5dd62]['Imap'][_0x56c7('0x10')]='connected';this[_0x56c7('0xa')][_0x5dd62][_0x56c7('0xf')][_0x56c7('0x21')]=_0x363836[_0x56c7('0xc')];if(_0x363836[_0x56c7('0x23')]){this[_0x56c7('0xa')][_0x5dd62]['Imap']['total']=_0x363836[_0x56c7('0x23')][_0x56c7('0x11')];}return this['emit'](_0x5dd62);}};EmailChannel[_0x56c7('0x15')]['handleImapEmail']=function(_0x233045,_0xe95e9a){logger['info'](_0x56c7('0x24'),_0xe95e9a[_0x56c7('0x25')],_0xe95e9a['lastName'],_0xe95e9a[_0x56c7('0x26')],_0x233045);if(this[_0x56c7('0xa')][_0x233045]){return mailAccount['notify'](_0x233045,_0xe95e9a)[_0x56c7('0x27')](function(_0x45b32b){if(_0x45b32b){logger[_0x56c7('0x9')](_0x56c7('0x28'));}})['catch'](function(_0x221b24){logger[_0x56c7('0x1f')](_0x56c7('0x29'),JSON['stringify'](_0x221b24));});}};EmailChannel[_0x56c7('0x15')][_0x56c7('0x2a')]=function(_0x2f57fa){if(this['mailAccounts'][_0x2f57fa]&&this[_0x56c7('0xa')][_0x2f57fa]['Imap']){if(this[_0x56c7('0x1a')][this[_0x56c7('0xa')][_0x2f57fa]['Imap']['id']]){delete this['imapAccounts'][this[_0x56c7('0xa')][_0x2f57fa]['Imap']['id']];}this[_0x56c7('0xa')][_0x2f57fa][_0x56c7('0xf')][_0x56c7('0x2b')]=moment();this[_0x56c7('0xb')](_0x2f57fa);}};EmailChannel[_0x56c7('0x15')][_0x56c7('0x2c')]=function(_0x3d122d,_0xf73e28){if(this[_0x56c7('0xa')][_0x3d122d]){this[_0x56c7('0xa')][_0x3d122d][_0x56c7('0xf')]['status']='error';this['mailAccounts'][_0x3d122d][_0x56c7('0xf')]['messageStatus']=_0xf73e28;return this['emit'](_0x3d122d);}};EmailChannel[_0x56c7('0x15')]['sendMail']=function(_0x4fbef5,_0x3b83f1){return this['smtp'][_0x56c7('0x2d')](_0x4fbef5,_0x3b83f1);};EmailChannel[_0x56c7('0x15')][_0x56c7('0x2e')]=function(_0x1b20bf){var _0x297605=this;if(this[_0x56c7('0xa')][_0x1b20bf['id']]){if(_['isNil'](this[_0x56c7('0xa')][_0x1b20bf['id']][_0x56c7('0x2f')])){this['mailAccounts'][_0x1b20bf['id']][_0x56c7('0x2f')]={};}this[_0x56c7('0xa')][_0x1b20bf['id']][_0x56c7('0x2f')][_0x56c7('0x2b')]=moment();return new BPromise(function(_0x1474e5,_0xe53678){return _0x297605[_0x56c7('0x30')][_0x56c7('0x31')](_0x1b20bf)['then'](function(_0x99b4f6){_0x297605[_0x56c7('0xa')][_0x1b20bf['id']][_0x56c7('0x2f')][_0x56c7('0x10')]='verified';_0x297605[_0x56c7('0xa')][_0x1b20bf['id']][_0x56c7('0x2f')][_0x56c7('0x21')]='';_0x297605['emit'](_0x1b20bf['id']);_0x1474e5(_0x99b4f6);})[_0x56c7('0x32')](function(_0xd10e1d){_0x297605[_0x56c7('0xa')][_0x1b20bf['id']]['Smtp']['status']=_0x56c7('0x1f');_0x297605['mailAccounts'][_0x1b20bf['id']][_0x56c7('0x2f')][_0x56c7('0x21')]=_0xd10e1d;_0x297605['emit'](_0x1b20bf['id']);_0xe53678(_0xd10e1d);});});}return this[_0x56c7('0x30')][_0x56c7('0x31')](_0x1b20bf);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 47284fa..db2cad6 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 _0x292c=['handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','box','readUnseen','search','length','message','handleFetchMessage','end','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchError','textCode','upperFirst','lodash','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','email','mailbox','account','getAccount','ready'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0x292c,0x66));var _0xc292=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x292c[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var Imap=require(_0xc292('0x1'));var simpleParser=require(_0xc292('0x2'))[_0xc292('0x3')];var Iconv=require(_0xc292('0x4'))[_0xc292('0x5')];var EventEmitter=require('events')[_0xc292('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')(_0xc292('0x7'));function EmailImap(_0x1c45ed,_0x2c01eb){this[_0xc292('0x8')]=_0x1c45ed[_0xc292('0x8')];this[_0xc292('0x9')]=this[_0xc292('0xa')](_0x1c45ed,_0x2c01eb);this[_0xc292('0x1')]=new Imap(this[_0xc292('0x9')]);this[_0xc292('0x1')]['once'](_0xc292('0xb'),this[_0xc292('0xc')][_0xc292('0xd')](this));this[_0xc292('0x1')][_0xc292('0xe')]('end',this[_0xc292('0xf')][_0xc292('0xd')](this));this[_0xc292('0x1')]['on'](_0xc292('0x10'),this[_0xc292('0x11')][_0xc292('0xd')](this));this['imap'][_0xc292('0x12')]();}util[_0xc292('0x13')](EmailImap,EventEmitter);EmailImap[_0xc292('0x14')][_0xc292('0xa')]=function(_0x38c865,_0x51ab23){var _0x56417e={'connTimeout':_0x38c865[_0xc292('0x15')]?_0x38c865[_0xc292('0x15')]*0x3e8:0x2710,'authTimeout':_0x38c865['authTimeout']?_0x38c865[_0xc292('0x16')]*0x3e8:0x1388};if(_0x38c865['service']){_0x56417e['user']=_0x38c865[_0xc292('0x17')];_0x56417e['email']=_0x51ab23||_0x38c865[_0xc292('0x17')]||_0xc292('0x18');if(_0x38c865[_0xc292('0x19')]){_0x56417e['xoauth2']=utils[_0xc292('0x1a')](_0x38c865['CloudProvider']['data5'],_0x38c865[_0xc292('0x17')]);}else{_0x56417e[_0xc292('0x1b')]=_0x38c865['password'];}}else{if(_0x38c865[_0xc292('0x1c')]){_0x56417e[_0xc292('0x17')]=_0x38c865[_0xc292('0x17')];_0x56417e['password']=_0x38c865['password'];}}_0x56417e[_0xc292('0x1d')]=_0x38c865[_0xc292('0x1d')];_0x56417e[_0xc292('0x1e')]=_0x38c865[_0xc292('0x1e')]||0x3e1;if(_0x38c865[_0xc292('0x1f')]){_0x56417e[_0xc292('0x1f')]=!![];}else{_0x56417e[_0xc292('0x1f')]=![];_0x56417e[_0xc292('0x20')]=_0xc292('0x21');}return _0x56417e;};EmailImap['prototype']['handleReady']=function(){this[_0xc292('0x1')][_0xc292('0x22')](this['mailbox'],![],this[_0xc292('0x23')][_0xc292('0xd')](this));};EmailImap[_0xc292('0x14')]['handleOpenBox']=function(_0x315057,_0x342d73){if(_0x315057){this['handleError'](_0x315057,!![]);}else{this['emit'](_0xc292('0x24'),_0x342d73);this[_0xc292('0x25')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x4f697b){if(_0x4f697b){this[_0xc292('0x11')](_0x4f697b,!![]);}else{this[_0xc292('0x1')]['end']();}};EmailImap[_0xc292('0x14')]['readUnseen']=function(){this[_0xc292('0x1')][_0xc292('0x26')](['UNSEEN'],this['handleReadUnseen'][_0xc292('0xd')](this));};EmailImap[_0xc292('0x14')]['handleReadUnseen']=function(_0x4f694d,_0x939e19){if(_0x4f694d){this['handleError'](_0x4f694d,!![]);}else{if(_0x939e19[_0xc292('0x27')]){try{var _0xe8a56e=this[_0xc292('0x1')]['fetch'](_0x939e19,{'bodies':'','markSeen':!![]});_0xe8a56e['on'](_0xc292('0x28'),this[_0xc292('0x29')][_0xc292('0xd')](this));_0xe8a56e[_0xc292('0xe')](_0xc292('0x10'),this['handleFetchError'][_0xc292('0xd')](this));_0xe8a56e[_0xc292('0xe')](_0xc292('0x2a'),this[_0xc292('0x2b')]['bind'](this));}catch(_0x5462e1){logger[_0xc292('0x10')](_0x5462e1);}}else{this[_0xc292('0x1')][_0xc292('0x2c')](!![],this[_0xc292('0x2d')][_0xc292('0xd')](this));}}};EmailImap[_0xc292('0x14')]['handleFetchMessage']=function(_0x563bf1){_0x563bf1['on'](_0xc292('0x2e'),this[_0xc292('0x2f')]['bind'](this));_0x563bf1[_0xc292('0xe')](_0xc292('0x30'),this[_0xc292('0x31')][_0xc292('0xd')](this));_0x563bf1[_0xc292('0xe')]('end',this[_0xc292('0x32')][_0xc292('0xd')](this));};EmailImap[_0xc292('0x14')][_0xc292('0x2f')]=function(_0x1f0d2c){simpleParser(_0x1f0d2c,{'Iconv':Iconv},this[_0xc292('0x33')]['bind'](this));};EmailImap[_0xc292('0x14')][_0xc292('0x31')]=function(){};EmailImap[_0xc292('0x14')][_0xc292('0x32')]=function(){};EmailImap[_0xc292('0x14')]['handleSimpleParser']=function(_0x5b6044,_0x2986cc){if(_0x5b6044){logger[_0xc292('0x10')](_0x5b6044);}else{var _0x2f8d2f=this;utils[_0xc292('0x34')](this['account'],_0x2986cc,function(_0x5b694c){_0x2f8d2f[_0xc292('0x35')](_0xc292('0x7'),_0x5b694c);});}};EmailImap['prototype'][_0xc292('0x2b')]=function(){this[_0xc292('0x1')]['closeBox'](!![],this[_0xc292('0x2d')][_0xc292('0xd')](this));};EmailImap['prototype'][_0xc292('0x36')]=function(_0x375cb3){this[_0xc292('0x11')](_0x375cb3);this[_0xc292('0x1')][_0xc292('0x2c')](!![],this[_0xc292('0x2d')]['bind'](this));};EmailImap[_0xc292('0x14')][_0xc292('0xf')]=function(){this[_0xc292('0x35')]('end');};EmailImap[_0xc292('0x14')]['handleError']=function(_0x5e4269,_0x2ffd2b){logger[_0xc292('0x10')](_0xc292('0x11'),this['account'][_0xc292('0x7')],JSON['stringify'](_0x5e4269));var _0x28b712='';if(_0x5e4269){if(_0x5e4269[_0xc292('0x37')]){_0x28b712=_0x5e4269[_0xc292('0x37')];}else{for(var _0x573670 in _0x5e4269){if(_0x5e4269['hasOwnProperty'](_0x573670)){_0x28b712+=_[_0xc292('0x38')](_0x573670)+':\x20'+_0x5e4269[_0x573670]+'\x0a';}}}}if(_0x2ffd2b){this[_0xc292('0x1')]['end']();}else{this['emit'](_0xc292('0x10'),_0x28b712);this[_0xc292('0x35')](_0xc292('0x2a'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x39e6=['error','handleError','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','openBox','handleOpenBox','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','handleEnd'];(function(_0x1abbe1,_0x29a557){var _0x3f137d=function(_0x4965c5){while(--_0x4965c5){_0x1abbe1['push'](_0x1abbe1['shift']());}};_0x3f137d(++_0x29a557);}(_0x39e6,0x9e));var _0x639e=function(_0x1ac11c,_0x1e9ac5){_0x1ac11c=_0x1ac11c-0x0;var _0x4ee89c=_0x39e6[_0x1ac11c];return _0x4ee89c;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var Imap=require(_0x639e('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x639e('0x2'))[_0x639e('0x3')];var EventEmitter=require('events')[_0x639e('0x4')];var utils=require(_0x639e('0x5'));var logger=require(_0x639e('0x6'))(_0x639e('0x7'));function EmailImap(_0x15e5df,_0x320448){this[_0x639e('0x8')]=_0x15e5df[_0x639e('0x8')];this[_0x639e('0x9')]=this[_0x639e('0xa')](_0x15e5df,_0x320448);this[_0x639e('0x1')]=new Imap(this[_0x639e('0x9')]);this[_0x639e('0x1')][_0x639e('0xb')](_0x639e('0xc'),this[_0x639e('0xd')][_0x639e('0xe')](this));this[_0x639e('0x1')]['once']('end',this[_0x639e('0xf')][_0x639e('0xe')](this));this[_0x639e('0x1')]['on'](_0x639e('0x10'),this[_0x639e('0x11')][_0x639e('0xe')](this));this[_0x639e('0x1')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x639e('0x12')][_0x639e('0xa')]=function(_0x89302c,_0x199fb5){var _0x37b8e2={'connTimeout':_0x89302c[_0x639e('0x13')]?_0x89302c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x89302c[_0x639e('0x14')]?_0x89302c[_0x639e('0x14')]*0x3e8:0x1388};if(_0x89302c[_0x639e('0x15')]){_0x37b8e2[_0x639e('0x16')]=_0x89302c['user'];_0x37b8e2[_0x639e('0x7')]=_0x199fb5||_0x89302c['user']||_0x639e('0x17');if(_0x89302c[_0x639e('0x18')]){_0x37b8e2[_0x639e('0x19')]=utils[_0x639e('0x1a')](_0x89302c[_0x639e('0x1b')][_0x639e('0x1c')],_0x89302c['user']);}else{_0x37b8e2[_0x639e('0x1d')]=_0x89302c[_0x639e('0x1d')];}}else{if(_0x89302c[_0x639e('0x1e')]){_0x37b8e2[_0x639e('0x16')]=_0x89302c['user'];_0x37b8e2[_0x639e('0x1d')]=_0x89302c[_0x639e('0x1d')];}}_0x37b8e2[_0x639e('0x1f')]=_0x89302c[_0x639e('0x1f')];_0x37b8e2[_0x639e('0x20')]=_0x89302c['port']||0x3e1;if(_0x89302c[_0x639e('0x21')]){_0x37b8e2[_0x639e('0x21')]=!![];}else{_0x37b8e2['tls']=![];_0x37b8e2[_0x639e('0x22')]='required';}return _0x37b8e2;};EmailImap['prototype'][_0x639e('0xd')]=function(){this[_0x639e('0x1')][_0x639e('0x23')](this[_0x639e('0x8')],![],this[_0x639e('0x24')]['bind'](this));};EmailImap[_0x639e('0x12')][_0x639e('0x24')]=function(_0x39b44f,_0x2da264){if(_0x39b44f){this[_0x639e('0x11')](_0x39b44f,!![]);}else{this['emit'](_0x639e('0x25'),_0x2da264);this[_0x639e('0x26')]();}};EmailImap[_0x639e('0x12')][_0x639e('0x27')]=function(_0x5b5b8c){if(_0x5b5b8c){this[_0x639e('0x11')](_0x5b5b8c,!![]);}else{this[_0x639e('0x1')][_0x639e('0x28')]();}};EmailImap['prototype'][_0x639e('0x26')]=function(){this['imap'][_0x639e('0x29')](['UNSEEN'],this['handleReadUnseen'][_0x639e('0xe')](this));};EmailImap[_0x639e('0x12')][_0x639e('0x2a')]=function(_0x124954,_0x412176){if(_0x124954){this[_0x639e('0x11')](_0x124954,!![]);}else{if(_0x412176['length']){try{var _0x213b7e=this[_0x639e('0x1')]['fetch'](_0x412176,{'bodies':'','markSeen':!![]});_0x213b7e['on']('message',this[_0x639e('0x2b')][_0x639e('0xe')](this));_0x213b7e[_0x639e('0xb')]('error',this[_0x639e('0x2c')]['bind'](this));_0x213b7e[_0x639e('0xb')](_0x639e('0x28'),this[_0x639e('0x2d')]['bind'](this));}catch(_0x157d07){logger['error'](_0x157d07);}}else{this[_0x639e('0x1')][_0x639e('0x2e')](!![],this[_0x639e('0x27')]['bind'](this));}}};EmailImap[_0x639e('0x12')][_0x639e('0x2b')]=function(_0x2d5add){_0x2d5add['on']('body',this[_0x639e('0x2f')]['bind'](this));_0x2d5add[_0x639e('0xb')](_0x639e('0x30'),this[_0x639e('0x31')][_0x639e('0xe')](this));_0x2d5add[_0x639e('0xb')]('end',this[_0x639e('0x32')][_0x639e('0xe')](this));};EmailImap[_0x639e('0x12')][_0x639e('0x2f')]=function(_0x4b8a3e){simpleParser(_0x4b8a3e,{'Iconv':Iconv},this[_0x639e('0x33')][_0x639e('0xe')](this));};EmailImap[_0x639e('0x12')]['handleMessageAttributes']=function(){};EmailImap[_0x639e('0x12')]['handleMessageEnd']=function(){};EmailImap[_0x639e('0x12')][_0x639e('0x33')]=function(_0x2a347e,_0x4541cc){if(_0x2a347e){logger[_0x639e('0x10')](_0x2a347e);}else{var _0x13606b=this;utils['parser'](this[_0x639e('0x9')],_0x4541cc,function(_0x1d37a0){_0x13606b['emit'](_0x639e('0x7'),_0x1d37a0);});}};EmailImap['prototype'][_0x639e('0x2d')]=function(){this[_0x639e('0x1')][_0x639e('0x2e')](!![],this[_0x639e('0x27')][_0x639e('0xe')](this));};EmailImap[_0x639e('0x12')][_0x639e('0x2c')]=function(_0x4103e2){this['handleError'](_0x4103e2);this['imap']['closeBox'](!![],this['handleCloseBox'][_0x639e('0xe')](this));};EmailImap[_0x639e('0x12')]['handleEnd']=function(){this[_0x639e('0x34')](_0x639e('0x28'));};EmailImap[_0x639e('0x12')]['handleError']=function(_0x179f82,_0x4103fc){logger[_0x639e('0x10')](_0x639e('0x11'),this[_0x639e('0x9')][_0x639e('0x7')],JSON[_0x639e('0x35')](_0x179f82));var _0x201312='';if(_0x179f82){if(_0x179f82[_0x639e('0x36')]){_0x201312=_0x179f82['textCode'];}else{for(var _0x417dd6 in _0x179f82){if(_0x179f82[_0x639e('0x37')](_0x417dd6)){_0x201312+=_[_0x639e('0x38')](_0x417dd6)+':\x20'+_0x179f82[_0x417dd6]+'\x0a';}}}}if(_0x4103fc){this[_0x639e('0x1')][_0x639e('0x28')]();}else{this[_0x639e('0x34')]('error',_0x201312);this[_0x639e('0x34')](_0x639e('0x28'));}};module[_0x639e('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 0e538b8..0f8177f 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 _0x1d46=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x1d46,0x1ca));var _0x61d4=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x1d46[_0x47a40b];return _0x19610c;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x61d4('0x0'));function EmailSmtp(){}EmailSmtp[_0x61d4('0x1')]['send']=function(_0x27e2c5,_0x54728f){return new Promise(function(_0x2f3266,_0x2bf60f){var _0x586a53=nodemailer[_0x61d4('0x2')](_0x27e2c5);_0x586a53[_0x61d4('0x3')](_0x61d4('0x4'),inlineBase64());_0x586a53[_0x61d4('0x5')](_0x54728f,function(_0xca52c2,_0x2e112b){if(_0xca52c2){_0x2bf60f(_0xca52c2[_0x61d4('0x6')]());}else{_0x2f3266(_0x2e112b);}});});};EmailSmtp[_0x61d4('0x1')][_0x61d4('0x7')]=function(_0x508d50){return new Promise(function(_0x4391be,_0x38a479){var _0x35c131=nodemailer['createTransport'](_0x508d50);_0x35c131[_0x61d4('0x7')](function(_0x5f185e,_0x2eb785){if(_0x5f185e){_0x38a479(_0x5f185e[_0x61d4('0x6')]());}else{if(_0x2eb785){_0x4391be(_0x2eb785);}else{_0x38a479(_0x61d4('0x8'));}}});});};module[_0x61d4('0x9')]=EmailSmtp; \ No newline at end of file +var _0xeeb4=['nodemailer-plugin-inline-base64','prototype','send','compile','sendMail','toString','createTransport','exports','nodemailer'];(function(_0x3f504e,_0x28ea57){var _0x3ae881=function(_0x41fc46){while(--_0x41fc46){_0x3f504e['push'](_0x3f504e['shift']());}};_0x3ae881(++_0x28ea57);}(_0xeeb4,0x8f));var _0x4eeb=function(_0x1bbb03,_0x18c084){_0x1bbb03=_0x1bbb03-0x0;var _0x1ae659=_0xeeb4[_0x1bbb03];return _0x1ae659;};'use strict';var nodemailer=require(_0x4eeb('0x0'));var inlineBase64=require(_0x4eeb('0x1'));function EmailSmtp(){}EmailSmtp[_0x4eeb('0x2')][_0x4eeb('0x3')]=function(_0x31b6ef,_0x4f122a){return new Promise(function(_0x595424,_0x186bab){var _0x184525=nodemailer['createTransport'](_0x31b6ef);_0x184525['use'](_0x4eeb('0x4'),inlineBase64());_0x184525[_0x4eeb('0x5')](_0x4f122a,function(_0x80f4b0,_0x494333){if(_0x80f4b0){_0x186bab(_0x80f4b0[_0x4eeb('0x6')]());}else{_0x595424(_0x494333);}});});};EmailSmtp[_0x4eeb('0x2')]['verify']=function(_0x3faa90){return new Promise(function(_0x272446,_0x356a1f){var _0x26345c=nodemailer[_0x4eeb('0x7')](_0x3faa90);_0x26345c['verify'](function(_0x268af5,_0x4a80a6){if(_0x268af5){_0x356a1f(_0x268af5[_0x4eeb('0x6')]());}else{if(_0x4a80a6){_0x272446(_0x4a80a6);}else{_0x356a1f('Not\x20verifired');}}});});};module[_0x4eeb('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 95fb07b..a5e6f65 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 _0x260f=['user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','join','pop','isEmpty','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','bcc','attachments','attach','type','attachment','format','%s-%s','now','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','from','subject','messageId','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','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','generateXOAuth2Token'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x260f,0x1cd));var _0xf260=function(_0x5acf09,_0xfb6440){_0x5acf09=_0x5acf09-0x0;var _0x131d82=_0x260f[_0x5acf09];return _0x131d82;};'use strict';var _=require(_0xf260('0x0'));var moment=require(_0xf260('0x1'));var random=require(_0xf260('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xf260('0x3'));var tnef=require(_0xf260('0x4'));var logger=require('../../../config/logger')(_0xf260('0x5'));var config=require(_0xf260('0x6'));function getAddress(_0x219666){var _0x44bdde=_[_0xf260('0x7')](_0x219666[_0xf260('0x8')]);return _0x44bdde&&_0x44bdde[_0xf260('0x9')]?_0x44bdde[_0xf260('0x9')]:_0xf260('0xa')+random[_0xf260('0xb')](0x6)+_0xf260('0xc');}function getFirstName(_0x2df17a){var _0x325585=_[_0xf260('0x7')](_0x2df17a[_0xf260('0x8')]);if(_0x325585&&_0x325585[_0xf260('0xd')]){if(_0x325585['name']==_0x325585[_0xf260('0x9')]){return _0x325585[_0xf260('0xd')][_0xf260('0xe')](0x0,_0x325585[_0xf260('0xd')][_0xf260('0xf')]('@'));}var _0x18944c=_0x325585[_0xf260('0xd')][_0xf260('0x10')](/\s+/);return _0x18944c['length']>0x1?_0x18944c[_0xf260('0x11')](0x0,-0x1)[_0xf260('0x12')]('\x20'):_0x325585[_0xf260('0xd')];}return'Anonymous';}function getLastName(_0x5cfd3d){var _0x21216a=_['head'](_0x5cfd3d['value']);if(_0x21216a&&_0x21216a['name']){var _0x225321=_0x21216a[_0xf260('0xd')]['split'](/\s+/);return _0x225321['length']>0x1?_0x225321[_0xf260('0x13')]():'';}return'';}function getMails(_0x430208,_0x5b9bd4){var _0x1b1207='';for(var _0x2413a1=0x0;_0x2413a1<_0x5b9bd4[_0xf260('0x8')]['length'];_0x2413a1+=0x1){if(_0x5b9bd4[_0xf260('0x8')][_0x2413a1]['address']!==_0x430208){if(!_[_0xf260('0x14')](_0x1b1207)){_0x1b1207+=',';}_0x1b1207+=_0x5b9bd4['value'][_0x2413a1][_0xf260('0xd')]||_0x5b9bd4[_0xf260('0x8')][_0x2413a1][_0xf260('0x9')]||'';_0x1b1207+='\x20<';_0x1b1207+=_0x5b9bd4['value'][_0x2413a1][_0xf260('0x9')]?_0x5b9bd4['value'][_0x2413a1][_0xf260('0x9')]:_0xf260('0xa')+random[_0xf260('0xb')](0x6)+_0xf260('0xc');_0x1b1207+='>';}}return _0x1b1207;}function parseEmail(_0x21aa3f,_0x56ff72,_0xe9e616){if(_0x56ff72['html']){var _0x4b0ae2=/)<[^<]*)*<\/script>/gi;while(_0x4b0ae2[_0xf260('0x15')](_0x56ff72[_0xf260('0x16')])){_0x56ff72[_0xf260('0x16')]=_0x56ff72[_0xf260('0x16')][_0xf260('0x17')](_0x4b0ae2,'');}if(_0x56ff72['html'][_0xf260('0x18')](_0xf260('0x19'))){var _0x9b5dd0=[];_0x56ff72['attachments'][_0xf260('0x1a')](_0x24534a=>{_0x9b5dd0[_0xf260('0x1b')](_0x24534a[_0xf260('0x1c')]);});var _0x2efd09=/]+>/g;var _0x38fc57=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x449cd8=_0x56ff72[_0xf260('0x16')]['replace'](_0x38fc57,_0xf260('0x1d'));var _0xa71eba=_0x449cd8[_0xf260('0x17')](_0x2efd09,_0xf260('0x1e'));for(let _0x22136e=0x0;_0x22136e<_0x9b5dd0[_0xf260('0x1f')];_0x22136e++){var _0x14e998=_0xa71eba[_0xf260('0x17')]('_IMG',_0xf260('0x20')+_0x9b5dd0[_0x22136e]+_0xf260('0x21'));_0xa71eba=_0x14e998;}_0x56ff72[_0xf260('0x16')]=_0xa71eba;}_0xe9e616[_0xf260('0x22')]=_0x56ff72[_0xf260('0x16')];}else{_0xe9e616[_0xf260('0x22')]=_0x56ff72[_0xf260('0x23')];}if(_0xe9e616[_0xf260('0x22')]){_0xe9e616['body']=_0xe9e616[_0xf260('0x22')][_0xf260('0x17')](/0x0){var _0x37e811=[_0xf260('0x32'),'X-Auto-Response-Suppress:\x20All',_0xf260('0x33')];for(var _0x99bc7b=0x0;_0x99bc7b<_0x56ff72[_0xf260('0x31')][_0xf260('0x1f')];_0x99bc7b++){var _0x109a29=_[_0xf260('0xf')](_0x37e811,_0x56ff72[_0xf260('0x31')][_0x99bc7b][_0xf260('0x34')]);if(_0x109a29>=0x0){_0xe9e616[_0xf260('0x35')]=!![];}}}return _0xe9e616;}exports['parser']=function(_0x57ffc0,_0x3b29af,_0x1bdb63){var _0x52f0b4={'from':getAddress(_0x3b29af[_0xf260('0x36')]),'firstName':getFirstName(_0x3b29af['from']),'lastName':getLastName(_0x3b29af['from']),'mapKey':_0xf260('0x5'),'message':{'from':getMails(_0x57ffc0[_0xf260('0x5')],_0x3b29af[_0xf260('0x36')]),'to':_0x57ffc0[_0xf260('0x5')],'cc':'','subject':_0x3b29af[_0xf260('0x37')]||'','messageId':_0x3b29af[_0xf260('0x38')],'inReplyTo':_0x3b29af[_0xf260('0x39')],'sentAt':moment(_0x3b29af[_0xf260('0x3a')])[_0xf260('0x2c')](_0xf260('0x3b')),'attach':![],'attachments':[]}};if(!_0x3b29af[_0xf260('0x16')]&&!_0x3b29af[_0xf260('0x23')]){var _0x32a934=_[_0xf260('0x3c')](_0x3b29af[_0xf260('0x28')],{'contentType':_0xf260('0x3d')});if(_0x32a934[_0xf260('0x1f')]){logger[_0xf260('0x3e')](util['format'](_0xf260('0x3f'),_0x3b29af[_0xf260('0x38')]));tnef[_0xf260('0x40')](_[_0xf260('0x41')](_0x32a934)[_0xf260('0x2f')],function(_0x1427d6,_0x456af4){if(_0x456af4){_0x3b29af[_0xf260('0x16')]=_0x456af4[_0xf260('0x42')]||_0xf260('0x43');if(_0x456af4[_0xf260('0x44')]){for(var _0x3af3ee=0x0;_0x3af3ee<_0x456af4[_0xf260('0x44')][_0xf260('0x1f')];_0x3af3ee++){var _0x454790=_0x456af4[_0xf260('0x44')][_0x3af3ee];_0x52f0b4['message']['attachments'][_0xf260('0x1b')]({'filename':_0x454790['Title'],'content':Buffer['from'](_0x454790[_0xf260('0x45')])});}}}_0x1bdb63(parseEmail(_0x57ffc0,_0x3b29af,_0x52f0b4));});}else{_0x3b29af[_0xf260('0x16')]='

Empty\x20message

';_0x1bdb63(parseEmail(_0x57ffc0,_0x3b29af,_0x52f0b4));}}else{_0x1bdb63(parseEmail(_0x57ffc0,_0x3b29af,_0x52f0b4));}};exports[_0xf260('0x46')]=function(_0x3d5691,_0x3f9492){var _0x3e1835=[_0xf260('0x47')+(_0x3f9492||''),_0xf260('0x48')+_0x3d5691,'',''];return Buffer[_0xf260('0x36')](_0x3e1835[_0xf260('0x12')](''),_0xf260('0x49'))[_0xf260('0x4a')](_0xf260('0x4b'));}; \ No newline at end of file +var _0x64f6=['\x20[Attachment:\x20','body','Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','randomstring','path','util','../../../config/logger','email','../../../config/environment','value','address','@xcally.com','name','substring','indexOf','length','slice','join','Anonymous','head','split','isEmpty','anonymous','generate','html','replace','includes'];(function(_0x136e31,_0x431ff3){var _0xd82eb=function(_0x1835b1){while(--_0x1835b1){_0x136e31['push'](_0x136e31['shift']());}};_0xd82eb(++_0x431ff3);}(_0x64f6,0xf0));var _0x664f=function(_0x3fbca8,_0x2e2902){_0x3fbca8=_0x3fbca8-0x0;var _0x47e565=_0x64f6[_0x3fbca8];return _0x47e565;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x664f('0x0'));var fs=require('fs');var path=require(_0x664f('0x1'));var util=require(_0x664f('0x2'));var tnef=require('node-tnef');var logger=require(_0x664f('0x3'))(_0x664f('0x4'));var config=require(_0x664f('0x5'));function getAddress(_0xc84fb5){var _0x2b3ee0=_['head'](_0xc84fb5[_0x664f('0x6')]);return _0x2b3ee0&&_0x2b3ee0[_0x664f('0x7')]?_0x2b3ee0[_0x664f('0x7')]:'anonymous'+random['generate'](0x6)+_0x664f('0x8');}function getFirstName(_0x21a77d){var _0x4a06c5=_['head'](_0x21a77d[_0x664f('0x6')]);if(_0x4a06c5&&_0x4a06c5['name']){if(_0x4a06c5[_0x664f('0x9')]==_0x4a06c5['address']){return _0x4a06c5[_0x664f('0x9')][_0x664f('0xa')](0x0,_0x4a06c5[_0x664f('0x9')][_0x664f('0xb')]('@'));}var _0x287bd9=_0x4a06c5[_0x664f('0x9')]['split'](/\s+/);return _0x287bd9[_0x664f('0xc')]>0x1?_0x287bd9[_0x664f('0xd')](0x0,-0x1)[_0x664f('0xe')]('\x20'):_0x4a06c5[_0x664f('0x9')];}return _0x664f('0xf');}function getLastName(_0x5a1f26){var _0x1ebb59=_[_0x664f('0x10')](_0x5a1f26['value']);if(_0x1ebb59&&_0x1ebb59['name']){var _0x546026=_0x1ebb59['name'][_0x664f('0x11')](/\s+/);return _0x546026['length']>0x1?_0x546026['pop']():'';}return'';}function getMails(_0x599a04,_0xd7edd2){var _0x58d170='';for(var _0x48c232=0x0;_0x48c232<_0xd7edd2[_0x664f('0x6')][_0x664f('0xc')];_0x48c232+=0x1){if(_0xd7edd2[_0x664f('0x6')][_0x48c232]['address']!==_0x599a04){if(!_[_0x664f('0x12')](_0x58d170)){_0x58d170+=',';}_0x58d170+=_0xd7edd2['value'][_0x48c232][_0x664f('0x9')]||_0xd7edd2[_0x664f('0x6')][_0x48c232]['address']||'';_0x58d170+='\x20<';_0x58d170+=_0xd7edd2['value'][_0x48c232][_0x664f('0x7')]?_0xd7edd2['value'][_0x48c232][_0x664f('0x7')]:_0x664f('0x13')+random[_0x664f('0x14')](0x6)+_0x664f('0x8');_0x58d170+='>';}}return _0x58d170;}function parseEmail(_0x52b139,_0x13f1bf,_0x43abfc){if(_0x13f1bf[_0x664f('0x15')]){var _0x40f8be=/)<[^<]*)*<\/script>/gi;while(_0x40f8be['test'](_0x13f1bf['html'])){_0x13f1bf[_0x664f('0x15')]=_0x13f1bf['html'][_0x664f('0x16')](_0x40f8be,'');}if(_0x13f1bf['html'][_0x664f('0x17')](_0x664f('0x18'))){var _0x2cbe5b=[];_0x13f1bf['attachments']['forEach'](_0x2e7c23=>{_0x2cbe5b[_0x664f('0x19')](_0x2e7c23['filename']);});var _0x280bfe=/]+>/g;var _0x35b9ce=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1fbe26=_0x13f1bf[_0x664f('0x15')][_0x664f('0x16')](_0x35b9ce,_0x664f('0x1a'));var _0x3de5c7=_0x1fbe26[_0x664f('0x16')](_0x280bfe,_0x664f('0x1b'));for(let _0x5696e3=0x0;_0x5696e3<_0x2cbe5b[_0x664f('0xc')];_0x5696e3++){var _0x15469f=_0x3de5c7[_0x664f('0x16')](_0x664f('0x1b'),_0x664f('0x1c')+_0x2cbe5b[_0x5696e3]+'\x20]');_0x3de5c7=_0x15469f;}_0x13f1bf['html']=_0x3de5c7;}_0x43abfc[_0x664f('0x1d')]=_0x13f1bf[_0x664f('0x15')];}else{_0x43abfc[_0x664f('0x1d')]=_0x13f1bf['textAsHtml'];}if(_0x43abfc[_0x664f('0x1d')]){_0x43abfc[_0x664f('0x1d')]=_0x43abfc['body'][_0x664f('0x16')](/0x0){var _0x1c67cb=[_0x664f('0x2e'),_0x664f('0x2f'),_0x664f('0x30')];for(var _0x2f1be5=0x0;_0x2f1be5<_0x13f1bf[_0x664f('0x2d')][_0x664f('0xc')];_0x2f1be5++){var _0x1794b5=_[_0x664f('0xb')](_0x1c67cb,_0x13f1bf['headerLines'][_0x2f1be5]['line']);if(_0x1794b5>=0x0){_0x43abfc['isAutoreply']=!![];}}}return _0x43abfc;}exports['parser']=function(_0x28eb46,_0x1dfdba,_0x3363a8){var _0x3722df={'from':getAddress(_0x1dfdba[_0x664f('0x31')]),'firstName':getFirstName(_0x1dfdba[_0x664f('0x31')]),'lastName':getLastName(_0x1dfdba['from']),'mapKey':_0x664f('0x4'),'message':{'from':getMails(_0x28eb46[_0x664f('0x4')],_0x1dfdba[_0x664f('0x31')]),'to':_0x28eb46['email'],'cc':'','subject':_0x1dfdba['subject']||'','messageId':_0x1dfdba[_0x664f('0x32')],'inReplyTo':_0x1dfdba['inReplyTo'],'sentAt':moment(_0x1dfdba['date'])[_0x664f('0x27')](_0x664f('0x33')),'attach':![],'attachments':[]}};if(!_0x1dfdba['html']&&!_0x1dfdba[_0x664f('0x34')]){var _0x39754a=_[_0x664f('0x35')](_0x1dfdba[_0x664f('0x22')],{'contentType':'application/ms-tnef'});if(_0x39754a['length']){logger[_0x664f('0x36')](util[_0x664f('0x27')](_0x664f('0x37'),_0x1dfdba[_0x664f('0x32')]));tnef[_0x664f('0x38')](_['first'](_0x39754a)[_0x664f('0x2b')],function(_0x1fd9e6,_0x434c5c){if(_0x434c5c){_0x1dfdba[_0x664f('0x15')]=_0x434c5c['BodyHTML']||_0x664f('0x39');if(_0x434c5c[_0x664f('0x3a')]){for(var _0x5de6fb=0x0;_0x5de6fb<_0x434c5c[_0x664f('0x3a')][_0x664f('0xc')];_0x5de6fb++){var _0x404955=_0x434c5c['Attachments'][_0x5de6fb];_0x3722df['message'][_0x664f('0x22')][_0x664f('0x19')]({'filename':_0x404955[_0x664f('0x3b')],'content':Buffer[_0x664f('0x31')](_0x404955[_0x664f('0x3c')])});}}}_0x3363a8(parseEmail(_0x28eb46,_0x1dfdba,_0x3722df));});}else{_0x1dfdba[_0x664f('0x15')]=_0x664f('0x39');_0x3363a8(parseEmail(_0x28eb46,_0x1dfdba,_0x3722df));}}else{_0x3363a8(parseEmail(_0x28eb46,_0x1dfdba,_0x3722df));}};exports['generateXOAuth2Token']=function(_0x37adad,_0x5f35c5){var _0x25a713=[_0x664f('0x3d')+(_0x5f35c5||''),_0x664f('0x3e')+_0x37adad,'',''];return Buffer[_0x664f('0x31')](_0x25a713['join'](''),_0x664f('0x3f'))[_0x664f('0x40')](_0x664f('0x41'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index da08fba..407d30d 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 _0xfaf1=['lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x445d81,_0x1c5591){var _0x463432=function(_0x53da32){while(--_0x53da32){_0x445d81['push'](_0x445d81['shift']());}};_0x463432(++_0x1c5591);}(_0xfaf1,0xe8));var _0x1faf=function(_0x2c1345,_0x38d57a){_0x2c1345=_0x2c1345-0x0;var _0x5c7948=_0xfaf1[_0x2c1345];return _0x5c7948;};'use strict';var _=require(_0x1faf('0x0'));function MailAccount(_0x5736e7){this['id']=_0x5736e7['id']||0x0;this[_0x1faf('0x1')]=_0x5736e7[_0x1faf('0x1')]||_0x1faf('0x2');this['key']=_0x5736e7[_0x1faf('0x3')]||_0x1faf('0x4');this[_0x1faf('0x5')]=_0x5736e7[_0x1faf('0x5')]||![];this[_0x1faf('0x6')]=_0x5736e7[_0x1faf('0x6')]||[];this['Smtp']=_0x5736e7[_0x1faf('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xfcc0=['exports','lodash','name','key','Imap','Smtp'];(function(_0x164e8f,_0xdba27a){var _0x2b2840=function(_0x4458f0){while(--_0x4458f0){_0x164e8f['push'](_0x164e8f['shift']());}};_0x2b2840(++_0xdba27a);}(_0xfcc0,0x97));var _0x0fcc=function(_0x2ed651,_0x5c75af){_0x2ed651=_0x2ed651-0x0;var _0x5780ae=_0xfcc0[_0x2ed651];return _0x5780ae;};'use strict';var _=require(_0x0fcc('0x0'));function MailAccount(_0x231505){this['id']=_0x231505['id']||0x0;this[_0x0fcc('0x1')]=_0x231505[_0x0fcc('0x1')]||'Service';this[_0x0fcc('0x2')]=_0x231505[_0x0fcc('0x2')]||'SERV';this['active']=_0x231505['active']||![];this[_0x0fcc('0x3')]=_0x231505[_0x0fcc('0x3')]||[];this[_0x0fcc('0x4')]=_0x231505[_0x0fcc('0x4')]||[];}module[_0x0fcc('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 71747f7..2bd1671 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 _0x1b4e=['exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1b4e,0xf1));var _0xe1b4=function(_0x172499,_0x121198){_0x172499=_0x172499-0x0;var _0x28a7f0=_0x1b4e[_0x172499];return _0x28a7f0;};'use strict';var _=require(_0xe1b4('0x0'));var MailAccount=require(_0xe1b4('0x1'));var Realtime=function(){this[_0xe1b4('0x2')]={};};function freeIsNotKey(_0xefbe33,_0x3eb005,_0x427fa7){var _0x1a37cb=_['mapKeys'](_0xefbe33,function(_0x5a236d,_0x2b4605){return _0x5a236d[_0x427fa7];});for(var _0x15437a in _0x3eb005){if(_0x3eb005[_0xe1b4('0x3')](_0x15437a)){if(!_0x1a37cb[_0x15437a]){delete _0x3eb005[_0x15437a];}}}}Realtime[_0xe1b4('0x4')][_0xe1b4('0x5')]=function(_0x5cf517,_0x1d12ba){for(var _0x4a51ed in _0x1d12ba){if(_0x5cf517[_0xe1b4('0x3')](_0x4a51ed)){_0x5cf517[_0x4a51ed]=_0x1d12ba[_0x4a51ed];}}};Realtime[_0xe1b4('0x4')]['initMailAccounts']=function(){var _0x45302e=this;return function(_0x19c4b1){if(_0x19c4b1){freeIsNotKey(_0x19c4b1,_0x45302e[_0xe1b4('0x2')],'id');for(var _0xed434b=0x0,_0x1a1692={},_0x21098e={};_0xed434b<_0x19c4b1[_0xe1b4('0x6')];_0xed434b+=0x1){_0x1a1692=_0x19c4b1[_0xed434b];if(_[_0xe1b4('0x7')](_0x45302e['mailAccounts'][_0x1a1692['id']])){_0x45302e[_0xe1b4('0x2')][_0x1a1692['id']]=new MailAccount(_0x1a1692);}else{_[_0xe1b4('0x8')](_0x45302e[_0xe1b4('0x2')][_0x1a1692['id']],_0x1a1692);}}}return _0x45302e[_0xe1b4('0x2')];};};module[_0xe1b4('0x9')]=Realtime; \ No newline at end of file +var _0x7839=['../model/mailAccount','mapKeys','hasOwnProperty','prototype','mailAccounts','isUndefined','merge','lodash'];(function(_0x41afea,_0x4c3325){var _0xfc4b86=function(_0x42ef44){while(--_0x42ef44){_0x41afea['push'](_0x41afea['shift']());}};_0xfc4b86(++_0x4c3325);}(_0x7839,0x1af));var _0x9783=function(_0xf48161,_0x507ef1){_0xf48161=_0xf48161-0x0;var _0x352c84=_0x7839[_0xf48161];return _0x352c84;};'use strict';var _=require(_0x9783('0x0'));var MailAccount=require(_0x9783('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x28b92e,_0x1a4881,_0x17a8c4){var _0x5ced66=_[_0x9783('0x2')](_0x28b92e,function(_0x8bfdc0,_0x7dc28e){return _0x8bfdc0[_0x17a8c4];});for(var _0x4f32b1 in _0x1a4881){if(_0x1a4881[_0x9783('0x3')](_0x4f32b1)){if(!_0x5ced66[_0x4f32b1]){delete _0x1a4881[_0x4f32b1];}}}}Realtime[_0x9783('0x4')]['mergeFromDatabase']=function(_0x4ad1a7,_0xebf9c5){for(var _0x399779 in _0xebf9c5){if(_0x4ad1a7[_0x9783('0x3')](_0x399779)){_0x4ad1a7[_0x399779]=_0xebf9c5[_0x399779];}}};Realtime[_0x9783('0x4')]['initMailAccounts']=function(){var _0x367878=this;return function(_0x4b009e){if(_0x4b009e){freeIsNotKey(_0x4b009e,_0x367878[_0x9783('0x5')],'id');for(var _0x517bba=0x0,_0x4285f7={},_0x760e23={};_0x517bba<_0x4b009e['length'];_0x517bba+=0x1){_0x4285f7=_0x4b009e[_0x517bba];if(_[_0x9783('0x6')](_0x367878['mailAccounts'][_0x4285f7['id']])){_0x367878[_0x9783('0x5')][_0x4285f7['id']]=new MailAccount(_0x4285f7);}else{_[_0x9783('0x7')](_0x367878[_0x9783('0x5')][_0x4285f7['id']],_0x4285f7);}}}return _0x367878[_0x9783('0x5')];};};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 7bad2eb..bf0ecaf 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 _0x7827=['provider','email','active','key','ListId','Imap','CloudProvider','name','service','type','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x5ab0c2,_0x50efc8){var _0xfbc02=function(_0x577b56){while(--_0x577b56){_0x5ab0c2['push'](_0x5ab0c2['shift']());}};_0xfbc02(++_0x50efc8);}(_0x7827,0x19d));var _0x7782=function(_0x260593,_0x2bdb5f){_0x260593=_0x260593-0x0;var _0x63c998=_0x7827[_0x260593];return _0x63c998;};'use strict';var client=require(_0x7782('0x0'));exports[_0x7782('0x1')]=function(){return function(){return client[_0x7782('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0x7782('0x3'),'service',_0x7782('0x4'),_0x7782('0x5'),_0x7782('0x6'),_0x7782('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0x7782('0x8'),'include':[{'model':_0x7782('0x9'),'attributes':['id',_0x7782('0xa'),_0x7782('0xb'),_0x7782('0xc'),'data5'],'as':_0x7782('0x9')}]},{'model':'MailServerOut','as':_0x7782('0xd'),'include':[{'model':_0x7782('0x9'),'attributes':['id',_0x7782('0xa'),_0x7782('0xb'),_0x7782('0xc'),'data5'],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x7782('0xe')]=function(_0x1a8493,_0x3f288a){return client['Request'](_0x7782('0xf'),{'account':{'id':_0x1a8493},'body':_0x3f288a,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xf9ac=['../client','GetMailAccount','name','service','active','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','data5','getMailAccount','Request','NotifyMailAccount'];(function(_0x47a072,_0x29fe63){var _0x4b4322=function(_0x5dcee1){while(--_0x5dcee1){_0x47a072['push'](_0x47a072['shift']());}};_0x4b4322(++_0x29fe63);}(_0xf9ac,0x87));var _0xcf9a=function(_0x405928,_0x1cf724){_0x405928=_0x405928-0x0;var _0xa727ac=_0xf9ac[_0x405928];return _0xa727ac;};'use strict';var client=require(_0xcf9a('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xcf9a('0x1'),{'options':{'attributes':['id',_0xcf9a('0x2'),'provider',_0xcf9a('0x3'),'email',_0xcf9a('0x4'),'key','ListId',_0xcf9a('0x5')],'raw':![],'include':[{'model':_0xcf9a('0x6'),'as':_0xcf9a('0x7'),'include':[{'model':_0xcf9a('0x8'),'attributes':['id','name',_0xcf9a('0x3'),_0xcf9a('0x9'),'data5'],'as':'CloudProvider'}]},{'model':_0xcf9a('0xa'),'as':'Smtp','include':[{'model':_0xcf9a('0x8'),'attributes':['id','name',_0xcf9a('0x3'),'type',_0xcf9a('0xb')],'as':_0xcf9a('0x8')}]}]},'log':_0xcf9a('0xc')});};};exports['notify']=function(_0x5e8d5f,_0x56f619){return client[_0xcf9a('0xd')](_0xcf9a('0xe'),{'account':{'id':_0x5e8d5f},'body':_0x56f619,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index fcd9ccf..8dab627 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 _0x81fe=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x81fe,0x90));var _0xe81f=function(_0x57f6ea,_0x3e1bde){_0x57f6ea=_0x57f6ea-0x0;var _0x2ee0c0=_0x81fe[_0x57f6ea];return _0x2ee0c0;};'use strict';var client=require('../client');exports[_0xe81f('0x0')]=function(){return client[_0xe81f('0x1')](_0xe81f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe81f('0x3')});}; \ No newline at end of file +var _0x8015=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0x8015,0xbd));var _0x5801=function(_0x576cd0,_0x5ab475){_0x576cd0=_0x576cd0-0x0;var _0x49441d=_0x8015[_0x576cd0];return _0x49441d;};'use strict';var client=require(_0x5801('0x0'));exports[_0x5801('0x1')]=function(){return client[_0x5801('0x2')](_0x5801('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5801('0x4')]},'log':_0x5801('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 95580a8..a4b1a6c 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 5bbce8f..90e82fe 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 _0x923d=['defaults','localhost','adapter','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis'];(function(_0x2a895f,_0x56e2da){var _0x2bcb7b=function(_0x1d507b){while(--_0x1d507b){_0x2a895f['push'](_0x2a895f['shift']());}};_0x2bcb7b(++_0x56e2da);}(_0x923d,0x19b));var _0xd923=function(_0x54d9ec,_0x348d77){_0x54d9ec=_0x54d9ec-0x0;var _0x137080=_0x923d[_0x54d9ec];return _0x137080;};'use strict';var _=require(_0xd923('0x0'));var http=require(_0xd923('0x1'));var express=require(_0xd923('0x2'));var sticky=require(_0xd923('0x3'));var Redis=require(_0xd923('0x4'));var config=require(_0xd923('0x5'));var app=express();var server=http[_0xd923('0x6')](app);server[_0xd923('0x7')]=0xdbba0;if(sticky[_0xd923('0x8')](server,config[_0xd923('0x9')])){var socketio=require(_0xd923('0xa'))(server,{'transports':[_0xd923('0xb'),_0xd923('0xc')]});config[_0xd923('0xd')]=_[_0xd923('0xe')](config[_0xd923('0xd')],{'host':_0xd923('0xf'),'port':0x18eb});socketio[_0xd923('0x10')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xd923('0xd')])}));require('../../config/triggers')[_0xd923('0x11')]();require(_0xd923('0x12'))[_0xd923('0x11')](socketio);require(_0xd923('0x13'))['default'](app);require('../../routes')[_0xd923('0x11')](app);}else{server[_0xd923('0x14')](_0xd923('0x15'),function(){console[_0xd923('0x16')](_0xd923('0x17'),config[_0xd923('0x9')]);});}exports=module[_0xd923('0x18')]=app; \ No newline at end of file +var _0xc6d8=['sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express'];(function(_0x552e94,_0x110f92){var _0x12587b=function(_0x36c87e){while(--_0x36c87e){_0x552e94['push'](_0x552e94['shift']());}};_0x12587b(++_0x110f92);}(_0xc6d8,0xd6));var _0x8c6d=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0xc6d8[_0x3d9b04];return _0x557936;};'use strict';var _=require('lodash');var http=require(_0x8c6d('0x0'));var express=require(_0x8c6d('0x1'));var sticky=require(_0x8c6d('0x2'));var Redis=require(_0x8c6d('0x3'));var config=require(_0x8c6d('0x4'));var app=express();var server=http[_0x8c6d('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x8c6d('0x6')](server,config[_0x8c6d('0x7')])){var socketio=require(_0x8c6d('0x8'))(server,{'transports':[_0x8c6d('0x9'),_0x8c6d('0xa')]});config[_0x8c6d('0xb')]=_[_0x8c6d('0xc')](config[_0x8c6d('0xb')],{'host':_0x8c6d('0xd'),'port':0x18eb});socketio[_0x8c6d('0xe')](require(_0x8c6d('0xf'))({'pubClient':new Redis(config[_0x8c6d('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x8c6d('0x10'))[_0x8c6d('0x11')]();require(_0x8c6d('0x12'))[_0x8c6d('0x11')](socketio);require(_0x8c6d('0x13'))[_0x8c6d('0x11')](app);require(_0x8c6d('0x14'))[_0x8c6d('0x11')](app);}else{server[_0x8c6d('0x15')](_0x8c6d('0x16'),function(){console['log'](_0x8c6d('0x17'),config[_0x8c6d('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 65802dd..6d5e9b8 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 _0xeaf1=['rpc','error','message','exports','jayson/promise','../../config/logger','routing','client','http','debug'];(function(_0x165838,_0x3ac9f2){var _0x5921f5=function(_0x2ca083){while(--_0x2ca083){_0x165838['push'](_0x165838['shift']());}};_0x5921f5(++_0x3ac9f2);}(_0xeaf1,0x1d0));var _0x1eaf=function(_0x1db621,_0x5c3587){_0x1db621=_0x1db621-0x0;var _0x348da5=_0xeaf1[_0x1db621];return _0x348da5;};'use strict';var jayson=require(_0x1eaf('0x0'));var BPromise=require('bluebird');var logger=require(_0x1eaf('0x1'))(_0x1eaf('0x2'));var client=jayson[_0x1eaf('0x3')][_0x1eaf('0x4')]({'port':0x2329});client['Request']=function(_0x3d1f35,_0x8b0515){return new BPromise(function(_0x321807,_0x47dc1d){return client['request'](_0x3d1f35,_0x8b0515)['then'](function(_0x3bf6e3){logger[_0x1eaf('0x5')](_0x1eaf('0x6'),'routing',_0x3d1f35,_0x8b0515,_0x3bf6e3);if(_0x3bf6e3[_0x1eaf('0x7')]){logger[_0x1eaf('0x7')](_0x1eaf('0x6'),_0x1eaf('0x2'),_0x3d1f35,_0x3bf6e3[_0x1eaf('0x7')][_0x1eaf('0x8')],_0x8b0515);return _0x47dc1d(_0x3bf6e3[_0x1eaf('0x7')][_0x1eaf('0x8')]);}else{return _0x321807(_0x3bf6e3['result']);}})['catch'](function(_0x2d9893){logger[_0x1eaf('0x7')](_0x1eaf('0x6'),'routing',_0x3d1f35,_0x2d9893,_0x8b0515);return _0x47dc1d(_0x2d9893);});});};module[_0x1eaf('0x9')]=client; \ No newline at end of file +var _0xd2a1=['jayson/promise','bluebird','../../config/logger','client','http','then','debug','rpc','routing','error','message','result','exports'];(function(_0x435592,_0x363aed){var _0x2d544d=function(_0x57dc9f){while(--_0x57dc9f){_0x435592['push'](_0x435592['shift']());}};_0x2d544d(++_0x363aed);}(_0xd2a1,0x68));var _0x1d2a=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xd2a1[_0xbf8ebe];return _0x1e25e8;};'use strict';var jayson=require(_0x1d2a('0x0'));var BPromise=require(_0x1d2a('0x1'));var logger=require(_0x1d2a('0x2'))('routing');var client=jayson[_0x1d2a('0x3')][_0x1d2a('0x4')]({'port':0x2329});client['Request']=function(_0x1556e7,_0x3d02ba){return new BPromise(function(_0x26558e,_0x57646b){return client['request'](_0x1556e7,_0x3d02ba)[_0x1d2a('0x5')](function(_0x5d3894){logger[_0x1d2a('0x6')](_0x1d2a('0x7'),_0x1d2a('0x8'),_0x1556e7,_0x3d02ba,_0x5d3894);if(_0x5d3894[_0x1d2a('0x9')]){logger['error'](_0x1d2a('0x7'),_0x1d2a('0x8'),_0x1556e7,_0x5d3894[_0x1d2a('0x9')][_0x1d2a('0xa')],_0x3d02ba);return _0x57646b(_0x5d3894[_0x1d2a('0x9')]['message']);}else{return _0x26558e(_0x5d3894[_0x1d2a('0xb')]);}})['catch'](function(_0xd57361){logger['error'](_0x1d2a('0x7'),_0x1d2a('0x8'),_0x1556e7,_0xd57361,_0x3d02ba);return _0x57646b(_0xd57361);});});};module[_0x1d2a('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index bc0da43..c1e9cc6 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 _0xaed7=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xaed7,0x9c));var _0x7aed=function(_0x1c12c7,_0xf6ca2e){_0x1c12c7=_0x1c12c7-0x0;var _0x4c372d=_0xaed7[_0x1c12c7];return _0x4c372d;};'use strict';var BPromise=require(_0x7aed('0x0'));var server=require(_0x7aed('0x1'));var Realtime=require(_0x7aed('0x2'));var user=require('./rpc/user');var interval=require(_0x7aed('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x7aed('0x4'));var smsQueue=require(_0x7aed('0x5'));var mailQueue=require(_0x7aed('0x6'));var faxQueue=require(_0x7aed('0x7'));var whatsappQueue=require(_0x7aed('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7aed('0x9')]()['then'](user['getAgents']())[_0x7aed('0xa')](realtime['initAgents']())[_0x7aed('0xa')](interval[_0x7aed('0xb')]())['then'](realtime[_0x7aed('0xc')]())[_0x7aed('0xa')](openchannelQueue[_0x7aed('0xd')]())['then'](realtime[_0x7aed('0xe')]())[_0x7aed('0xa')](chatQueue['getChatQueues']())[_0x7aed('0xa')](realtime[_0x7aed('0xf')]())['then'](smsQueue[_0x7aed('0x10')]())[_0x7aed('0xa')](realtime[_0x7aed('0x11')]())[_0x7aed('0xa')](mailQueue[_0x7aed('0x12')]())['then'](realtime[_0x7aed('0x13')]())['then'](faxQueue[_0x7aed('0x14')]())['then'](realtime[_0x7aed('0x15')]())[_0x7aed('0xa')](whatsappQueue[_0x7aed('0x16')]())[_0x7aed('0xa')](realtime['initWhatsappQueues']())[_0x7aed('0xa')](function(){return realtime;});}function main(){return server[_0x7aed('0x17')](realtime)[_0x7aed('0xa')](function(_0x2f62ee){return initRealtime();})[_0x7aed('0xa')](function(_0x4d05ab){return setInterval(initRealtime,0x1388);})[_0x7aed('0x18')](function(_0x24f418){console['log'](_0x24f418);});}main(); \ No newline at end of file +var _0xec57=['getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals'];(function(_0x3044d2,_0x213f49){var _0x3ef28e=function(_0x113b60){while(--_0x113b60){_0x3044d2['push'](_0x3044d2['shift']());}};_0x3ef28e(++_0x213f49);}(_0xec57,0xb0));var _0x7ec5=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xec57[_0x119d5a];return _0x15bff4;};'use strict';var BPromise=require(_0x7ec5('0x0'));var server=require(_0x7ec5('0x1'));var Realtime=require('./realtime');var user=require(_0x7ec5('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x7ec5('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x7ec5('0x4'));var mailQueue=require(_0x7ec5('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x7ec5('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7ec5('0x7')]()[_0x7ec5('0x8')](user[_0x7ec5('0x9')]())[_0x7ec5('0x8')](realtime[_0x7ec5('0xa')]())[_0x7ec5('0x8')](interval[_0x7ec5('0xb')]())[_0x7ec5('0x8')](realtime[_0x7ec5('0xc')]())[_0x7ec5('0x8')](openchannelQueue[_0x7ec5('0xd')]())['then'](realtime[_0x7ec5('0xe')]())[_0x7ec5('0x8')](chatQueue[_0x7ec5('0xf')]())['then'](realtime[_0x7ec5('0x10')]())[_0x7ec5('0x8')](smsQueue[_0x7ec5('0x11')]())['then'](realtime[_0x7ec5('0x12')]())[_0x7ec5('0x8')](mailQueue[_0x7ec5('0x13')]())[_0x7ec5('0x8')](realtime[_0x7ec5('0x14')]())['then'](faxQueue[_0x7ec5('0x15')]())[_0x7ec5('0x8')](realtime[_0x7ec5('0x16')]())[_0x7ec5('0x8')](whatsappQueue[_0x7ec5('0x17')]())[_0x7ec5('0x8')](realtime['initWhatsappQueues']())[_0x7ec5('0x8')](function(){return realtime;});}function main(){return server[_0x7ec5('0x18')](realtime)[_0x7ec5('0x8')](function(_0x1d32b5){return initRealtime();})[_0x7ec5('0x8')](function(_0x305d31){return setInterval(initRealtime,0x1388);})[_0x7ec5('0x19')](function(_0x668289){console[_0x7ec5('0x1a')](_0x668289);});}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 9862f04..320e3a7 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x440dd9,_0x24578d){var _0x225561=function(_0x495fb8){while(--_0x495fb8){_0x440dd9['push'](_0x440dd9['shift']());}};_0x225561(++_0x24578d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x5fc3[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x96169,_0x149c54){var _0xcf2b12=function(_0x4efaed){while(--_0x4efaed){_0x96169['push'](_0x96169['shift']());}};_0xcf2b12(++_0x149c54);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x5fc3[_0x4b4d43];return _0x5706ba;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index b2f2b11..e54b944 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 _0x862f=['result','catch','sendMailMessage','SendMail','http','then','error','message'];(function(_0x363a7c,_0xc7228b){var _0x50e8e6=function(_0x42d486){while(--_0x42d486){_0x363a7c['push'](_0x363a7c['shift']());}};_0x50e8e6(++_0xc7228b);}(_0x862f,0xc4));var _0xf862=function(_0x4b3f3e,_0x47dfcc){_0x4b3f3e=_0x4b3f3e-0x0;var _0x921fc3=_0x862f[_0x4b3f3e];return _0x921fc3;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client'][_0xf862('0x0')]({'port':0x232b});function request(_0x542659,_0x2e4534){return new BPromise(function(_0x1ee990,_0x413d52){return client['request'](_0x542659,_0x2e4534)[_0xf862('0x1')](function(_0x4c9ae0){if(_0x4c9ae0[_0xf862('0x2')]){return _0x413d52(_0x4c9ae0[_0xf862('0x2')][_0xf862('0x3')]);}else{return _0x1ee990(_0x4c9ae0[_0xf862('0x4')]);}})[_0xf862('0x5')](function(_0x3fd287){return _0x413d52(_0x3fd287);});});}exports[_0xf862('0x6')]=function(_0x3dbce6,_0x50a469){return request(_0xf862('0x7'),{'account':_0x3dbce6,'message':_0x50a469});}; \ No newline at end of file +var _0x9068=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result'];(function(_0x43ceb1,_0xf44d8f){var _0x46d6e8=function(_0x437486){while(--_0x437486){_0x43ceb1['push'](_0x43ceb1['shift']());}};_0x46d6e8(++_0xf44d8f);}(_0x9068,0x183));var _0x8906=function(_0x53cefd,_0x133ed4){_0x53cefd=_0x53cefd-0x0;var _0x19fc7c=_0x9068[_0x53cefd];return _0x19fc7c;};'use strict';var BPromise=require(_0x8906('0x0'));var jayson=require(_0x8906('0x1'));var client=jayson[_0x8906('0x2')][_0x8906('0x3')]({'port':0x232b});function request(_0x721c87,_0xe60a58){return new BPromise(function(_0xf13f22,_0x4bf82b){return client[_0x8906('0x4')](_0x721c87,_0xe60a58)[_0x8906('0x5')](function(_0xfb8495){if(_0xfb8495[_0x8906('0x6')]){return _0x4bf82b(_0xfb8495[_0x8906('0x6')][_0x8906('0x7')]);}else{return _0xf13f22(_0xfb8495[_0x8906('0x8')]);}})[_0x8906('0x9')](function(_0x1850d9){return _0x4bf82b(_0x1850d9);});});}exports[_0x8906('0xa')]=function(_0xda738e,_0x4ab863){return request(_0x8906('0xb'),{'account':_0xda738e,'message':_0x4ab863});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 39392ac..09a0e33 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 _0x5919=['user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','openchannel','sms','Status','toNumber','format','chatStatus','faxCurrentCapacity','smsStatusTime','openchannelStatus','openchannelCurrentCapacity','busy','stringify'];(function(_0x49e23f,_0x12b363){var _0x399a23=function(_0x457282){while(--_0x457282){_0x49e23f['push'](_0x49e23f['shift']());}};_0x399a23(++_0x12b363);}(_0x5919,0x198));var _0x9591=function(_0x5214d9,_0xb9ce27){_0x5214d9=_0x5214d9-0x0;var _0xb0703d=_0x5919[_0x5214d9];return _0xb0703d;};'use strict';var _=require(_0x9591('0x0'));var moment=require('moment');var md5=require(_0x9591('0x1'));var Redis=require(_0x9591('0x2'));var config=require(_0x9591('0x3'));config[_0x9591('0x4')]=_['defaults'](config[_0x9591('0x4')],{'host':_0x9591('0x5'),'port':0x18eb});var io=require(_0x9591('0x6'))(new Redis(config['redis']));function Agent(_0xe13bd8){this['id']=_0xe13bd8['id']||0x0;this[_0x9591('0x7')]=_0xe13bd8[_0x9591('0x7')]||'';this['online']=_0xe13bd8[_0x9591('0x8')]||!![];this[_0x9591('0x9')]=_0xe13bd8[_0x9591('0x9')]||![];this[_0x9591('0xa')]=_0xe13bd8[_0x9591('0xa')]||![];this[_0x9591('0xb')]=_0xe13bd8['mailPause']||![];this[_0x9591('0xc')]=_0xe13bd8[_0x9591('0xc')]||![];this[_0x9591('0xd')]=_0xe13bd8[_0x9591('0xd')]||![];this[_0x9591('0xe')]=_0xe13bd8[_0x9591('0xe')]||![];this['chatStatus']=_0x9591('0xf');this[_0x9591('0x10')]=0x0;this[_0x9591('0x11')]=_0xe13bd8[_0x9591('0x11')]||0x0;this[_0x9591('0x12')]=0x0;this[_0x9591('0x13')]=_0x9591('0xf');this[_0x9591('0x14')]=0x0;this[_0x9591('0x15')]=_0xe13bd8[_0x9591('0x15')]||0x0;this[_0x9591('0x16')]=0x0;this[_0x9591('0x17')]=_0x9591('0xf');this[_0x9591('0x18')]=0x0;this[_0x9591('0x19')]=_0xe13bd8['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x9591('0x1a')]='unknown';this['smsStatusTime']=0x0;this[_0x9591('0x1b')]=_0xe13bd8[_0x9591('0x1b')]||0x0;this[_0x9591('0x1c')]=0x0;this[_0x9591('0x1d')]=_0x9591('0xf');this[_0x9591('0x1e')]=0x0;this[_0x9591('0x1f')]=_0xe13bd8[_0x9591('0x1f')]||0x0;this[_0x9591('0x20')]=0x0;this['openchannelStatus']='unknown';this[_0x9591('0x21')]=0x0;this[_0x9591('0x22')]=_0xe13bd8[_0x9591('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x9591('0x23')]=undefined;this[_0x9591('0x1')]='';this['updateRealtime']();}Agent[_0x9591('0x24')][_0x9591('0x25')]=function(_0x393bf1){if(this[_0x393bf1+_0x9591('0x26')]>0x0){if(this[_0x393bf1+_0x9591('0x27')]>0x0&&this[_0x393bf1+_0x9591('0x26')]>=this[_0x393bf1+_0x9591('0x27')]){return _0x9591('0x28');}else{return _0x9591('0x29');}}else{return'idle';}};Agent[_0x9591('0x24')][_0x9591('0x2a')]=function(){var _0x3c067d=['mail',_0x9591('0x2b'),_0x9591('0x2c'),'fax',_0x9591('0x2d'),'whatsapp'];for(var _0x4d6444=0x0;_0x4d6444<_0x3c067d['length'];_0x4d6444+=0x1){var _0x51ea85=this[_0x9591('0x25')](_0x3c067d[_0x4d6444]);if(this[_0x3c067d[_0x4d6444]+_0x9591('0x2e')]!==_0x51ea85){this[_0x3c067d[_0x4d6444]+'StatusTime']=_[_0x9591('0x2f')](moment()[_0x9591('0x30')]('x'));}this[_0x3c067d[_0x4d6444]+_0x9591('0x2e')]=_0x51ea85;}var _0x49357f={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x9591('0x9')],'chatPause':this[_0x9591('0xa')],'mailPause':this[_0x9591('0xb')],'smsPause':this[_0x9591('0xd')],'faxPause':this[_0x9591('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x9591('0x31')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x9591('0x11')],'chatCurrentCapacity':this[_0x9591('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x9591('0x14')],'mailCapacity':this[_0x9591('0x15')],'mailCurrentCapacity':this[_0x9591('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x9591('0x18')],'faxCapacity':this[_0x9591('0x19')],'faxCurrentCapacity':this[_0x9591('0x32')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x9591('0x33')],'smsCapacity':this[_0x9591('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x9591('0x1d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x9591('0x20')],'openchannelStatus':this[_0x9591('0x34')],'openchannelStatusTime':this[_0x9591('0x21')],'openchannelCapacity':this[_0x9591('0x22')],'openchannelCurrentCapacity':this[_0x9591('0x35')],'busy':this[_0x9591('0x36')],'busyQueue':this[_0x9591('0x23')]};var _0x1fd183=md5(JSON[_0x9591('0x37')](_0x49357f));if(this[_0x9591('0x1')]!==_0x1fd183){this[_0x9591('0x1')]=_0x1fd183;io['emit'](_0x9591('0x38'),_0x49357f);}};module[_0x9591('0x39')]=Agent; \ No newline at end of file +var _0x811a=['working','idle','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','mailStatus','mailCurrentCapacity','faxStatus','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','openchannelStatus','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','unknown','smsStatusTime','smsCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x811a,0x147));var _0xa811=function(_0x55b0df,_0x2aec64){_0x55b0df=_0x55b0df-0x0;var _0x194acd=_0x811a[_0x55b0df];return _0x194acd;};'use strict';var _=require(_0xa811('0x0'));var moment=require(_0xa811('0x1'));var md5=require(_0xa811('0x2'));var Redis=require(_0xa811('0x3'));var config=require('../../../config/environment');config[_0xa811('0x4')]=_[_0xa811('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa811('0x6'))(new Redis(config[_0xa811('0x4')]));function Agent(_0x150746){this['id']=_0x150746['id']||0x0;this[_0xa811('0x7')]=_0x150746['name']||'';this[_0xa811('0x8')]=_0x150746[_0xa811('0x8')]||!![];this[_0xa811('0x9')]=_0x150746[_0xa811('0x9')]||![];this['chatPause']=_0x150746[_0xa811('0xa')]||![];this[_0xa811('0xb')]=_0x150746[_0xa811('0xb')]||![];this[_0xa811('0xc')]=_0x150746[_0xa811('0xc')]||![];this[_0xa811('0xd')]=_0x150746[_0xa811('0xd')]||![];this[_0xa811('0xe')]=_0x150746[_0xa811('0xe')]||![];this[_0xa811('0xf')]='unknown';this[_0xa811('0x10')]=0x0;this[_0xa811('0x11')]=_0x150746[_0xa811('0x11')]||0x0;this[_0xa811('0x12')]=0x0;this['mailStatus']='unknown';this[_0xa811('0x13')]=0x0;this[_0xa811('0x14')]=_0x150746[_0xa811('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0xa811('0x15')]=0x0;this[_0xa811('0x16')]=_0x150746[_0xa811('0x16')]||0x0;this[_0xa811('0x17')]=0x0;this['smsStatus']=_0xa811('0x18');this[_0xa811('0x19')]=0x0;this[_0xa811('0x1a')]=_0x150746[_0xa811('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0xa811('0x18');this['whatsappStatusTime']=0x0;this[_0xa811('0x1b')]=_0x150746[_0xa811('0x1b')]||0x0;this[_0xa811('0x1c')]=0x0;this['openchannelStatus']=_0xa811('0x18');this[_0xa811('0x1d')]=0x0;this[_0xa811('0x1e')]=_0x150746['openchannelCapacity']||0x0;this[_0xa811('0x1f')]=0x0;this[_0xa811('0x20')]=![];this[_0xa811('0x21')]=undefined;this['md5']='';this[_0xa811('0x22')]();}Agent[_0xa811('0x23')][_0xa811('0x24')]=function(_0x19fc92){if(this[_0x19fc92+_0xa811('0x25')]>0x0){if(this[_0x19fc92+'Capacity']>0x0&&this[_0x19fc92+_0xa811('0x25')]>=this[_0x19fc92+'Capacity']){return _0xa811('0x26');}else{return _0xa811('0x27');}}else{return _0xa811('0x28');}};Agent[_0xa811('0x23')]['updateRealtime']=function(){var _0x2dbad4=[_0xa811('0x29'),_0xa811('0x2a'),_0xa811('0x2b'),'fax',_0xa811('0x2c'),_0xa811('0x2d')];for(var _0x8b574e=0x0;_0x8b574e<_0x2dbad4[_0xa811('0x2e')];_0x8b574e+=0x1){var _0x386dde=this[_0xa811('0x24')](_0x2dbad4[_0x8b574e]);if(this[_0x2dbad4[_0x8b574e]+_0xa811('0x2f')]!==_0x386dde){this[_0x2dbad4[_0x8b574e]+_0xa811('0x30')]=_[_0xa811('0x31')](moment()['format']('x'));}this[_0x2dbad4[_0x8b574e]+_0xa811('0x2f')]=_0x386dde;}var _0x146604={'id':this['id'],'name':this[_0xa811('0x7')],'online':this[_0xa811('0x8')],'voicePause':this[_0xa811('0x9')],'chatPause':this[_0xa811('0xa')],'mailPause':this[_0xa811('0xb')],'smsPause':this[_0xa811('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0xa811('0xe')],'chatStatus':this[_0xa811('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xa811('0x11')],'chatCurrentCapacity':this[_0xa811('0x12')],'mailStatus':this[_0xa811('0x32')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa811('0x14')],'mailCurrentCapacity':this[_0xa811('0x33')],'faxStatus':this[_0xa811('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xa811('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xa811('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xa811('0x35')],'whatsappStatus':this[_0xa811('0x36')],'whatsappStatusTime':this[_0xa811('0x37')],'whatsappCapacity':this[_0xa811('0x1b')],'whatsappCurrentCapacity':this[_0xa811('0x1c')],'openchannelStatus':this[_0xa811('0x38')],'openchannelStatusTime':this[_0xa811('0x1d')],'openchannelCapacity':this[_0xa811('0x1e')],'openchannelCurrentCapacity':this[_0xa811('0x1f')],'busy':this[_0xa811('0x20')],'busyQueue':this['busyQueue']};var _0x21ecd2=md5(JSON[_0xa811('0x39')](_0x146604));if(this[_0xa811('0x2')]!==_0x21ecd2){this['md5']=_0x21ecd2;io[_0xa811('0x3a')](_0xa811('0x3b'),_0x146604);}};module[_0xa811('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index aa7b872..05d50fb 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 _0x0064=['name','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','md5','util','ioredis','redis','localhost','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','length','online','loggedIn','available'];(function(_0x23e337,_0x1e3c57){var _0x45facf=function(_0x2abfa3){while(--_0x2abfa3){_0x23e337['push'](_0x23e337['shift']());}};_0x45facf(++_0x1e3c57);}(_0x0064,0x11b));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0x4006('0x0'));var util=require(_0x4006('0x1'));var Redis=require(_0x4006('0x2'));var config=require('../../../config/environment');config[_0x4006('0x3')]=_['defaults'](config[_0x4006('0x3')],{'host':_0x4006('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4006('0x3')]));function ChatQueue(_0x309709){this['id']=_0x309709['id']||0x0;this['name']=_0x309709['name']||'';this['timeout']=_0x309709['timeout']||0xa;this['strategy']=_0x309709['strategy']||'beepall';this[_0x4006('0x5')]=_0x309709[_0x4006('0x5')];this[_0x4006('0x6')]={};this['waiting']=0x0;this[_0x4006('0x0')]='';this[_0x4006('0x7')]();this['updateRealtime']();}ChatQueue[_0x4006('0x8')][_0x4006('0x7')]=function(){var _0x2baa1e=this[_0x4006('0x6')][_0x4006('0x9')];this['mapAgentsId']=_[_0x4006('0xa')](this['Agents'],'id');this[_0x4006('0x6')][_0x4006('0x9')]=_0x2baa1e;};ChatQueue[_0x4006('0x8')][_0x4006('0xb')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x520d45=0x0;_0x520d45=0x0?this[_0x4006('0xf')]:0x0;var _0x2507b6={'id':this['id'],'available':this[_0x4006('0xf')],'loggedIn':this[_0x4006('0xe')],'name':this[_0x4006('0x10')],'paused':this[_0x4006('0x11')],'waiting':this['waiting']};var _0x4b7111=md5(JSON[_0x4006('0x12')](_0x2507b6));if(this[_0x4006('0x0')]!==_0x4b7111){this[_0x4006('0x0')]=_0x4b7111;io['to'](util[_0x4006('0x13')](_0x4006('0x14'),_0x2507b6[_0x4006('0x10')]))[_0x4006('0x15')](_0x4006('0x16'),_0x2507b6);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x9ed1=['Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ed1,0x10c));var _0x19ed=function(_0x45cb7e,_0x1240b6){_0x45cb7e=_0x45cb7e-0x0;var _0x123447=_0x9ed1[_0x45cb7e];return _0x123447;};'use strict';var _=require(_0x19ed('0x0'));var md5=require(_0x19ed('0x1'));var util=require(_0x19ed('0x2'));var Redis=require(_0x19ed('0x3'));var config=require(_0x19ed('0x4'));config[_0x19ed('0x5')]=_[_0x19ed('0x6')](config[_0x19ed('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x19ed('0x7'))(new Redis(config[_0x19ed('0x5')]));function ChatQueue(_0x1000cb){this['id']=_0x1000cb['id']||0x0;this[_0x19ed('0x8')]=_0x1000cb[_0x19ed('0x8')]||'';this[_0x19ed('0x9')]=_0x1000cb[_0x19ed('0x9')]||0xa;this[_0x19ed('0xa')]=_0x1000cb['strategy']||_0x19ed('0xb');this[_0x19ed('0xc')]=_0x1000cb[_0x19ed('0xc')];this['mapAgentsId']={};this[_0x19ed('0xd')]=0x0;this[_0x19ed('0x1')]='';this[_0x19ed('0xe')]();this[_0x19ed('0xf')]();}ChatQueue['prototype'][_0x19ed('0xe')]=function(){var _0x28e4b3=this['mapAgentsId'][_0x19ed('0x10')];this[_0x19ed('0x11')]=_[_0x19ed('0x12')](this[_0x19ed('0xc')],'id');this['mapAgentsId'][_0x19ed('0x10')]=_0x28e4b3;};ChatQueue[_0x19ed('0x13')][_0x19ed('0xf')]=function(){this[_0x19ed('0x14')]=0x0;this[_0x19ed('0x15')]=0x0;for(var _0x55a992=0x0;_0x55a992=0x0?this['available']:0x0;var _0x4e325a={'id':this['id'],'available':this[_0x19ed('0x18')],'loggedIn':this[_0x19ed('0x14')],'name':this[_0x19ed('0x8')],'paused':this[_0x19ed('0x15')],'waiting':this[_0x19ed('0xd')]};var _0x27d373=md5(JSON[_0x19ed('0x19')](_0x4e325a));if(this['md5']!==_0x27d373){this[_0x19ed('0x1')]=_0x27d373;io['to'](util['format'](_0x19ed('0x1a'),_0x4e325a[_0x19ed('0x8')]))['emit']('chat_queue:save',_0x4e325a);}};module[_0x19ed('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 7c56da7..c55acea 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 _0xfe38=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','paused','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x56f598,_0x41cd96){var _0x413206=function(_0x1540ae){while(--_0x1540ae){_0x56f598['push'](_0x56f598['shift']());}};_0x413206(++_0x41cd96);}(_0xfe38,0x127));var _0x8fe3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xfe38[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x8fe3('0x0'));var md5=require(_0x8fe3('0x1'));var util=require(_0x8fe3('0x2'));var Redis=require(_0x8fe3('0x3'));var config=require(_0x8fe3('0x4'));config[_0x8fe3('0x5')]=_['defaults'](config[_0x8fe3('0x5')],{'host':_0x8fe3('0x6'),'port':0x18eb});var io=require(_0x8fe3('0x7'))(new Redis(config[_0x8fe3('0x5')]));function FaxQueue(_0x91c99e){this['id']=_0x91c99e['id']||0x0;this['name']=_0x91c99e[_0x8fe3('0x8')]||'';this[_0x8fe3('0x9')]=_0x91c99e[_0x8fe3('0x9')]||0xa;this[_0x8fe3('0xa')]=_0x91c99e[_0x8fe3('0xa')]||_0x8fe3('0xb');this[_0x8fe3('0xc')]=_0x91c99e[_0x8fe3('0xc')];this[_0x8fe3('0xd')]={};this[_0x8fe3('0xe')]=0x0;this[_0x8fe3('0x1')]='';this[_0x8fe3('0xf')]();this[_0x8fe3('0x10')]();}FaxQueue[_0x8fe3('0x11')][_0x8fe3('0xf')]=function(){var _0x6be3e3=this['mapAgentsId'][_0x8fe3('0x12')];this['mapAgentsId']=_[_0x8fe3('0x13')](this[_0x8fe3('0xc')],'id');this[_0x8fe3('0xd')][_0x8fe3('0x12')]=_0x6be3e3;};FaxQueue[_0x8fe3('0x11')][_0x8fe3('0x10')]=function(){this[_0x8fe3('0x14')]=0x0;this['paused']=0x0;for(var _0x9bd57a=0x0;_0x9bd57a=0x0?this[_0x8fe3('0x18')]:0x0;var _0x65bc4a={'id':this['id'],'available':this[_0x8fe3('0x18')],'loggedIn':this[_0x8fe3('0x14')],'name':this[_0x8fe3('0x8')],'paused':this['paused'],'waiting':this[_0x8fe3('0xe')]};var _0x786f2b=md5(JSON[_0x8fe3('0x19')](_0x65bc4a));if(this['md5']!==_0x786f2b){this[_0x8fe3('0x1')]=_0x786f2b;io['to'](util['format'](_0x8fe3('0x1a'),_0x65bc4a['name']))[_0x8fe3('0x1b')](_0x8fe3('0x1c'),_0x65bc4a);}};module[_0x8fe3('0x1d')]=FaxQueue; \ No newline at end of file +var _0x50b6=['updateRouting','updateRealtime','_rr','mapAgentsId','map','paused','length','online','loggedIn','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting'];(function(_0x25546d,_0x14efe0){var _0x354fd5=function(_0x43ae17){while(--_0x43ae17){_0x25546d['push'](_0x25546d['shift']());}};_0x354fd5(++_0x14efe0);}(_0x50b6,0x13d));var _0x650b=function(_0x28887c,_0x21789a){_0x28887c=_0x28887c-0x0;var _0x356e51=_0x50b6[_0x28887c];return _0x356e51;};'use strict';var _=require(_0x650b('0x0'));var md5=require(_0x650b('0x1'));var util=require(_0x650b('0x2'));var Redis=require(_0x650b('0x3'));var config=require(_0x650b('0x4'));config[_0x650b('0x5')]=_[_0x650b('0x6')](config[_0x650b('0x5')],{'host':_0x650b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x38a56c){this['id']=_0x38a56c['id']||0x0;this[_0x650b('0x8')]=_0x38a56c[_0x650b('0x8')]||'';this[_0x650b('0x9')]=_0x38a56c[_0x650b('0x9')]||0xa;this['strategy']=_0x38a56c[_0x650b('0xa')]||'beepall';this[_0x650b('0xb')]=_0x38a56c[_0x650b('0xb')];this['mapAgentsId']={};this[_0x650b('0xc')]=0x0;this[_0x650b('0x1')]='';this[_0x650b('0xd')]();this[_0x650b('0xe')]();}FaxQueue['prototype'][_0x650b('0xd')]=function(){var _0x1ff192=this['mapAgentsId'][_0x650b('0xf')];this[_0x650b('0x10')]=_[_0x650b('0x11')](this[_0x650b('0xb')],'id');this[_0x650b('0x10')][_0x650b('0xf')]=_0x1ff192;};FaxQueue['prototype'][_0x650b('0xe')]=function(){this['loggedIn']=0x0;this[_0x650b('0x12')]=0x0;for(var _0x45be8f=0x0;_0x45be8f=0x0?this[_0x650b('0x17')]:0x0;var _0x2ae966={'id':this['id'],'available':this[_0x650b('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x650b('0x12')],'waiting':this[_0x650b('0xc')]};var _0x1b0fef=md5(JSON[_0x650b('0x18')](_0x2ae966));if(this[_0x650b('0x1')]!==_0x1b0fef){this[_0x650b('0x1')]=_0x1b0fef;io['to'](util[_0x650b('0x19')](_0x650b('0x1a'),_0x2ae966[_0x650b('0x8')]))[_0x650b('0x1b')](_0x650b('0x1c'),_0x2ae966);}};module[_0x650b('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 295bdf8..4f31f4e 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 _0x1ea6=['Intervals','name'];(function(_0x29f0af,_0x129a88){var _0xcc542b=function(_0x1a2578){while(--_0x1a2578){_0x29f0af['push'](_0x29f0af['shift']());}};_0xcc542b(++_0x129a88);}(_0x1ea6,0x17b));var _0x61ea=function(_0x459663,_0x5f3226){_0x459663=_0x459663-0x0;var _0x24cd75=_0x1ea6[_0x459663];return _0x24cd75;};'use strict';function Interval(_0x13be46){this['id']=_0x13be46['id']||0x0;this[_0x61ea('0x0')]=_0x13be46[_0x61ea('0x0')]||'';this[_0x61ea('0x1')]=_0x13be46[_0x61ea('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x222c=['Intervals','exports','name'];(function(_0x366bbf,_0x461807){var _0x5d436a=function(_0x4eb4d9){while(--_0x4eb4d9){_0x366bbf['push'](_0x366bbf['shift']());}};_0x5d436a(++_0x461807);}(_0x222c,0x68));var _0xc222=function(_0x112ef6,_0x1f5001){_0x112ef6=_0x112ef6-0x0;var _0x56c1b9=_0x222c[_0x112ef6];return _0x56c1b9;};'use strict';function Interval(_0x180142){this['id']=_0x180142['id']||0x0;this[_0xc222('0x0')]=_0x180142[_0xc222('0x0')]||'';this[_0xc222('0x1')]=_0x180142['Intervals']||{};}module[_0xc222('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 79a7fb1..b65d5b0 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 _0xc94f=['length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused'];(function(_0x2a100e,_0x263ba5){var _0x517ac8=function(_0x3342b9){while(--_0x3342b9){_0x2a100e['push'](_0x2a100e['shift']());}};_0x517ac8(++_0x263ba5);}(_0xc94f,0xca));var _0xfc94=function(_0x2be3cd,_0x5bddb6){_0x2be3cd=_0x2be3cd-0x0;var _0x3a2009=_0xc94f[_0x2be3cd];return _0x3a2009;};'use strict';var _=require(_0xfc94('0x0'));var md5=require(_0xfc94('0x1'));var util=require(_0xfc94('0x2'));var Redis=require('ioredis');var config=require(_0xfc94('0x3'));config['redis']=_[_0xfc94('0x4')](config[_0xfc94('0x5')],{'host':_0xfc94('0x6'),'port':0x18eb});var io=require(_0xfc94('0x7'))(new Redis(config[_0xfc94('0x5')]));function MailQueue(_0x122534){this['id']=_0x122534['id']||0x0;this[_0xfc94('0x8')]=_0x122534[_0xfc94('0x8')]||'';this[_0xfc94('0x9')]=_0x122534[_0xfc94('0x9')]||0xa;this[_0xfc94('0xa')]=_0x122534['strategy']||_0xfc94('0xb');this['Agents']=_0x122534[_0xfc94('0xc')];this[_0xfc94('0xd')]={};this[_0xfc94('0xe')]=0x0;this[_0xfc94('0x1')]='';this[_0xfc94('0xf')]();this[_0xfc94('0x10')]();}MailQueue[_0xfc94('0x11')][_0xfc94('0xf')]=function(){var _0x2c0a0e=this['mapAgentsId'][_0xfc94('0x12')];this['mapAgentsId']=_[_0xfc94('0x13')](this[_0xfc94('0xc')],'id');this[_0xfc94('0xd')][_0xfc94('0x12')]=_0x2c0a0e;};MailQueue['prototype'][_0xfc94('0x10')]=function(){this[_0xfc94('0x14')]=0x0;this[_0xfc94('0x15')]=0x0;for(var _0x5bebbf=0x0;_0x5bebbf=0x0?this[_0xfc94('0x19')]:0x0;var _0x370bd7={'id':this['id'],'available':this[_0xfc94('0x19')],'loggedIn':this[_0xfc94('0x14')],'name':this[_0xfc94('0x8')],'paused':this[_0xfc94('0x15')],'waiting':this[_0xfc94('0xe')]};var _0x396513=md5(JSON[_0xfc94('0x1a')](_0x370bd7));if(this['md5']!==_0x396513){this[_0xfc94('0x1')]=_0x396513;io['to'](util[_0xfc94('0x1b')](_0xfc94('0x1c'),_0x370bd7['name']))[_0xfc94('0x1d')](_0xfc94('0x1e'),_0x370bd7);}};module[_0xfc94('0x1f')]=MailQueue; \ No newline at end of file +var _0xf552=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x5c18f8,_0x4d1990){var _0x41102b=function(_0x51a095){while(--_0x51a095){_0x5c18f8['push'](_0x5c18f8['shift']());}};_0x41102b(++_0x4d1990);}(_0xf552,0x194));var _0x2f55=function(_0x5f2327,_0x123bcd){_0x5f2327=_0x5f2327-0x0;var _0x304698=_0xf552[_0x5f2327];return _0x304698;};'use strict';var _=require(_0x2f55('0x0'));var md5=require(_0x2f55('0x1'));var util=require(_0x2f55('0x2'));var Redis=require(_0x2f55('0x3'));var config=require(_0x2f55('0x4'));config[_0x2f55('0x5')]=_[_0x2f55('0x6')](config['redis'],{'host':_0x2f55('0x7'),'port':0x18eb});var io=require(_0x2f55('0x8'))(new Redis(config[_0x2f55('0x5')]));function MailQueue(_0x25993b){this['id']=_0x25993b['id']||0x0;this[_0x2f55('0x9')]=_0x25993b[_0x2f55('0x9')]||'';this[_0x2f55('0xa')]=_0x25993b[_0x2f55('0xa')]||0xa;this[_0x2f55('0xb')]=_0x25993b[_0x2f55('0xb')]||_0x2f55('0xc');this[_0x2f55('0xd')]=_0x25993b[_0x2f55('0xd')];this[_0x2f55('0xe')]={};this[_0x2f55('0xf')]=0x0;this[_0x2f55('0x1')]='';this[_0x2f55('0x10')]();this[_0x2f55('0x11')]();}MailQueue[_0x2f55('0x12')][_0x2f55('0x10')]=function(){var _0x4cdbac=this['mapAgentsId'][_0x2f55('0x13')];this[_0x2f55('0xe')]=_[_0x2f55('0x14')](this[_0x2f55('0xd')],'id');this[_0x2f55('0xe')][_0x2f55('0x13')]=_0x4cdbac;};MailQueue['prototype'][_0x2f55('0x11')]=function(){this[_0x2f55('0x15')]=0x0;this[_0x2f55('0x16')]=0x0;for(var _0x144f4a=0x0;_0x144f4a=0x0?this[_0x2f55('0x17')]:0x0;var _0x44d234={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2f55('0x15')],'name':this[_0x2f55('0x9')],'paused':this[_0x2f55('0x16')],'waiting':this[_0x2f55('0xf')]};var _0x467c71=md5(JSON[_0x2f55('0x18')](_0x44d234));if(this[_0x2f55('0x1')]!==_0x467c71){this['md5']=_0x467c71;io['to'](util[_0x2f55('0x19')](_0x2f55('0x1a'),_0x44d234[_0x2f55('0x9')]))[_0x2f55('0x1b')](_0x2f55('0x1c'),_0x44d234);}};module[_0x2f55('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7adb695..936fd60 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(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x29f76d,_0x371f4f){var _0x8eb771=function(_0x5503a0){while(--_0x5503a0){_0x29f76d['push'](_0x29f76d['shift']());}};_0x8eb771(++_0x371f4f);}(_0x814b,0x1a2));var _0xb814=function(_0x37a0ce,_0x28dc04){_0x37a0ce=_0x37a0ce-0x0;var _0x569f4e=_0x814b[_0x37a0ce];return _0x569f4e;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('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 3f3e207..d5bf588 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 _0x8868=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','prototype','loggedIn','length','smsPause','available','paused','stringify','format','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x1c24c6,_0x5c26ed){var _0x26949a=function(_0x3298db){while(--_0x3298db){_0x1c24c6['push'](_0x1c24c6['shift']());}};_0x26949a(++_0x5c26ed);}(_0x8868,0x1ca));var _0x8886=function(_0x2eb3e2,_0x14cd8b){_0x2eb3e2=_0x2eb3e2-0x0;var _0x3083cb=_0x8868[_0x2eb3e2];return _0x3083cb;};'use strict';var _=require(_0x8886('0x0'));var md5=require(_0x8886('0x1'));var util=require(_0x8886('0x2'));var Redis=require(_0x8886('0x3'));var config=require(_0x8886('0x4'));config[_0x8886('0x5')]=_[_0x8886('0x6')](config[_0x8886('0x5')],{'host':_0x8886('0x7'),'port':0x18eb});var io=require(_0x8886('0x8'))(new Redis(config[_0x8886('0x5')]));function SmsQueue(_0x59fca9){this['id']=_0x59fca9['id']||0x0;this['name']=_0x59fca9[_0x8886('0x9')]||'';this[_0x8886('0xa')]=_0x59fca9['timeout']||0xa;this[_0x8886('0xb')]=_0x59fca9['strategy']||_0x8886('0xc');this[_0x8886('0xd')]=_0x59fca9[_0x8886('0xd')];this[_0x8886('0xe')]={};this[_0x8886('0xf')]=0x0;this[_0x8886('0x1')]='';this['updateRouting']();this[_0x8886('0x10')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x113c29=this['mapAgentsId'][_0x8886('0x11')];this[_0x8886('0xe')]=_[_0x8886('0x12')](this[_0x8886('0xd')],'id');this['mapAgentsId'][_0x8886('0x11')]=_0x113c29;};SmsQueue[_0x8886('0x13')]['updateRealtime']=function(){this[_0x8886('0x14')]=0x0;this['paused']=0x0;for(var _0x4a339=0x0;_0x4a339=0x0?this[_0x8886('0x17')]:0x0;var _0x5504ab={'id':this['id'],'available':this[_0x8886('0x17')],'loggedIn':this[_0x8886('0x14')],'name':this[_0x8886('0x9')],'paused':this[_0x8886('0x18')],'waiting':this[_0x8886('0xf')]};var _0x85abb6=md5(JSON[_0x8886('0x19')](_0x5504ab));if(this[_0x8886('0x1')]!==_0x85abb6){this[_0x8886('0x1')]=_0x85abb6;io['to'](util[_0x8886('0x1a')]('sms:queue:%s',_0x5504ab[_0x8886('0x9')]))['emit'](_0x8886('0x1b'),_0x5504ab);}};module[_0x8886('0x1c')]=SmsQueue; \ No newline at end of file +var _0xde50=['name','timeout','strategy','mapAgentsId','waiting','md5','updateRealtime','prototype','_rr','Agents','paused','length','online','loggedIn','smsPause','available','format','sms:queue:%s','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','socket.io-emitter'];(function(_0x331e52,_0x138c1c){var _0x1afa69=function(_0x380cc9){while(--_0x380cc9){_0x331e52['push'](_0x331e52['shift']());}};_0x1afa69(++_0x138c1c);}(_0xde50,0x140));var _0x0de5=function(_0x493128,_0x7fe2b4){_0x493128=_0x493128-0x0;var _0x39e5a7=_0xde50[_0x493128];return _0x39e5a7;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x0de5('0x0'));var Redis=require(_0x0de5('0x1'));var config=require(_0x0de5('0x2'));config[_0x0de5('0x3')]=_['defaults'](config[_0x0de5('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x0de5('0x4'))(new Redis(config['redis']));function SmsQueue(_0x5c58fb){this['id']=_0x5c58fb['id']||0x0;this['name']=_0x5c58fb[_0x0de5('0x5')]||'';this[_0x0de5('0x6')]=_0x5c58fb[_0x0de5('0x6')]||0xa;this['strategy']=_0x5c58fb[_0x0de5('0x7')]||'beepall';this['Agents']=_0x5c58fb['Agents'];this[_0x0de5('0x8')]={};this[_0x0de5('0x9')]=0x0;this[_0x0de5('0xa')]='';this['updateRouting']();this[_0x0de5('0xb')]();}SmsQueue[_0x0de5('0xc')]['updateRouting']=function(){var _0x132a49=this[_0x0de5('0x8')][_0x0de5('0xd')];this['mapAgentsId']=_['map'](this[_0x0de5('0xe')],'id');this[_0x0de5('0x8')][_0x0de5('0xd')]=_0x132a49;};SmsQueue[_0x0de5('0xc')][_0x0de5('0xb')]=function(){this['loggedIn']=0x0;this[_0x0de5('0xf')]=0x0;for(var _0x5eaad2=0x0;_0x5eaad2=0x0?this[_0x0de5('0x14')]:0x0;var _0x58ce66={'id':this['id'],'available':this[_0x0de5('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x0de5('0x5')],'paused':this[_0x0de5('0xf')],'waiting':this[_0x0de5('0x9')]};var _0x325a8=md5(JSON['stringify'](_0x58ce66));if(this[_0x0de5('0xa')]!==_0x325a8){this['md5']=_0x325a8;io['to'](util[_0x0de5('0x15')](_0x0de5('0x16'),_0x58ce66[_0x0de5('0x5')]))['emit'](_0x0de5('0x17'),_0x58ce66);}};module[_0x0de5('0x18')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bb1ddb3..39b8347 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 _0xd988=['timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','whatsappPause','paused','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','redis','defaults','socket.io-emitter','name'];(function(_0x53ec0f,_0x8383b3){var _0x195bd9=function(_0x5d526e){while(--_0x5d526e){_0x53ec0f['push'](_0x53ec0f['shift']());}};_0x195bd9(++_0x8383b3);}(_0xd988,0x1b4));var _0x8d98=function(_0x4efafc,_0x5da291){_0x4efafc=_0x4efafc-0x0;var _0x4238bd=_0xd988[_0x4efafc];return _0x4238bd;};'use strict';var _=require('lodash');var md5=require(_0x8d98('0x0'));var util=require('util');var Redis=require(_0x8d98('0x1'));var config=require('../../../config/environment');config[_0x8d98('0x2')]=_[_0x8d98('0x3')](config[_0x8d98('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x8d98('0x4'))(new Redis(config[_0x8d98('0x2')]));function WhatsappQueue(_0xa58010){this['id']=_0xa58010['id']||0x0;this[_0x8d98('0x5')]=_0xa58010[_0x8d98('0x5')]||'';this[_0x8d98('0x6')]=_0xa58010[_0x8d98('0x6')]||0xa;this[_0x8d98('0x7')]=_0xa58010[_0x8d98('0x7')]||'beepall';this['Agents']=_0xa58010[_0x8d98('0x8')];this[_0x8d98('0x9')]={};this[_0x8d98('0xa')]=0x0;this[_0x8d98('0x0')]='';this[_0x8d98('0xb')]();this[_0x8d98('0xc')]();}WhatsappQueue[_0x8d98('0xd')][_0x8d98('0xb')]=function(){var _0x3eb2a6=this[_0x8d98('0x9')][_0x8d98('0xe')];this[_0x8d98('0x9')]=_[_0x8d98('0xf')](this[_0x8d98('0x8')],'id');this[_0x8d98('0x9')][_0x8d98('0xe')]=_0x3eb2a6;};WhatsappQueue[_0x8d98('0xd')]['updateRealtime']=function(){this[_0x8d98('0x10')]=0x0;this['paused']=0x0;for(var _0x4c888c=0x0;_0x4c888c=0x0?this[_0x8d98('0x14')]:0x0;var _0x4d0edc={'id':this['id'],'available':this[_0x8d98('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x8d98('0x5')],'paused':this[_0x8d98('0x13')],'waiting':this[_0x8d98('0xa')]};var _0x2d5da1=md5(JSON[_0x8d98('0x15')](_0x4d0edc));if(this[_0x8d98('0x0')]!==_0x2d5da1){this[_0x8d98('0x0')]=_0x2d5da1;io['to'](util['format'](_0x8d98('0x16'),_0x4d0edc[_0x8d98('0x5')]))[_0x8d98('0x17')](_0x8d98('0x18'),_0x4d0edc);}};module[_0x8d98('0x19')]=WhatsappQueue; \ No newline at end of file +var _0xf11d=['paused','available','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','whatsappPause'];(function(_0x5e6322,_0x731efc){var _0x3c0133=function(_0x588849){while(--_0x588849){_0x5e6322['push'](_0x5e6322['shift']());}};_0x3c0133(++_0x731efc);}(_0xf11d,0x145));var _0xdf11=function(_0x410732,_0x395767){_0x410732=_0x410732-0x0;var _0x1353ff=_0xf11d[_0x410732];return _0x1353ff;};'use strict';var _=require(_0xdf11('0x0'));var md5=require(_0xdf11('0x1'));var util=require(_0xdf11('0x2'));var Redis=require(_0xdf11('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xdf11('0x4')](config[_0xdf11('0x5')],{'host':_0xdf11('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x802059){this['id']=_0x802059['id']||0x0;this[_0xdf11('0x7')]=_0x802059[_0xdf11('0x7')]||'';this[_0xdf11('0x8')]=_0x802059[_0xdf11('0x8')]||0xa;this[_0xdf11('0x9')]=_0x802059[_0xdf11('0x9')]||_0xdf11('0xa');this['Agents']=_0x802059[_0xdf11('0xb')];this[_0xdf11('0xc')]={};this[_0xdf11('0xd')]=0x0;this['md5']='';this[_0xdf11('0xe')]();this[_0xdf11('0xf')]();}WhatsappQueue[_0xdf11('0x10')][_0xdf11('0xe')]=function(){var _0xef0302=this['mapAgentsId'][_0xdf11('0x11')];this[_0xdf11('0xc')]=_[_0xdf11('0x12')](this[_0xdf11('0xb')],'id');this['mapAgentsId']['_rr']=_0xef0302;};WhatsappQueue[_0xdf11('0x10')][_0xdf11('0xf')]=function(){this[_0xdf11('0x13')]=0x0;this['paused']=0x0;for(var _0xed99ab=0x0;_0xed99ab=0x0?this[_0xdf11('0x18')]:0x0;var _0xc9e1eb={'id':this['id'],'available':this[_0xdf11('0x18')],'loggedIn':this[_0xdf11('0x13')],'name':this['name'],'paused':this[_0xdf11('0x17')],'waiting':this['waiting']};var _0x39ab20=md5(JSON['stringify'](_0xc9e1eb));if(this[_0xdf11('0x1')]!==_0x39ab20){this[_0xdf11('0x1')]=_0x39ab20;io['to'](util[_0xdf11('0x19')](_0xdf11('0x1a'),_0xc9e1eb[_0xdf11('0x7')]))['emit'](_0xdf11('0x1b'),_0xc9e1eb);}};module[_0xdf11('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 9909bd9..2d303d2 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index b73a7be..3a1c1c4 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 _0x2376=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x5ab8d2,_0x572afc){var _0x290a25=function(_0x5b9fa9){while(--_0x5b9fa9){_0x5ab8d2['push'](_0x5ab8d2['shift']());}};_0x290a25(++_0x572afc);}(_0x2376,0x18b));var _0x6237=function(_0x22577c,_0x5ab5d0){_0x22577c=_0x22577c-0x0;var _0x5e7815=_0x2376[_0x22577c];return _0x5e7815;};'use strict';var client=require(_0x6237('0x0'));exports[_0x6237('0x1')]=function(_0x4ecc1b,_0x4aa0d9){return client[_0x6237('0x2')](_0x6237('0x3'),{'body':_0x4aa0d9,'options':{'where':{'id':_0x4ecc1b}},'log':_0x6237('0x4')});};exports[_0x6237('0x5')]=function(_0x59bb8,_0x475b5c){return client[_0x6237('0x2')](_0x6237('0x6'),{'body':_0x475b5c,'options':{'where':{'id':_0x59bb8}},'log':_0x6237('0x7')});}; \ No newline at end of file +var _0x034e=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x3509d8,_0x5074b5){var _0x4dcedb=function(_0x164ac4){while(--_0x164ac4){_0x3509d8['push'](_0x3509d8['shift']());}};_0x4dcedb(++_0x5074b5);}(_0x034e,0x6a));var _0xe034=function(_0x58f340,_0x11a4ee){_0x58f340=_0x58f340-0x0;var _0x124c0f=_0x034e[_0x58f340];return _0x124c0f;};'use strict';var client=require(_0xe034('0x0'));exports['update']=function(_0x33a254,_0xe3971a){return client[_0xe034('0x1')](_0xe034('0x2'),{'body':_0xe3971a,'options':{'where':{'id':_0x33a254}},'log':_0xe034('0x3')});};exports[_0xe034('0x4')]=function(_0x4dd9a0,_0x28abe3){return client[_0xe034('0x1')](_0xe034('0x5'),{'body':_0x28abe3,'options':{'where':{'id':_0x4dd9a0}},'log':_0xe034('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 392bd8d..84ef3c4 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 _0xdd35=['Request','CreateChatMessage','create'];(function(_0x328a80,_0x45a187){var _0x6e7c8f=function(_0x15b466){while(--_0x15b466){_0x328a80['push'](_0x328a80['shift']());}};_0x6e7c8f(++_0x45a187);}(_0xdd35,0x1be));var _0x5dd3=function(_0x353037,_0x41f0fe){_0x353037=_0x353037-0x0;var _0xbf71f5=_0xdd35[_0x353037];return _0xbf71f5;};'use strict';var client=require('../client');exports[_0x5dd3('0x0')]=function(_0x1e20c0){return client[_0x5dd3('0x1')](_0x5dd3('0x2'),{'body':_0x1e20c0,'log':'createChatMessage'});}; \ No newline at end of file +var _0x277d=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x277d,0x8d));var _0xd277=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x277d[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0xd277('0x0'));exports['create']=function(_0x183905){return client[_0xd277('0x1')](_0xd277('0x2'),{'body':_0x183905,'log':_0xd277('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9811694..ae7ef0c 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 _0x39d9=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x3fa5e4,_0x4059fc){var _0x55cb08=function(_0x1daa3d){while(--_0x1daa3d){_0x3fa5e4['push'](_0x3fa5e4['shift']());}};_0x55cb08(++_0x4059fc);}(_0x39d9,0x17f));var _0x939d=function(_0x390f42,_0xddf05){_0x390f42=_0x390f42-0x0;var _0x127f64=_0x39d9[_0x390f42];return _0x127f64;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(){return function(){return client[_0x939d('0x2')](_0x939d('0x3'),{'options':{'raw':![],'attributes':['id',_0x939d('0x4'),_0x939d('0x5'),_0x939d('0x6')],'include':[{'model':_0x939d('0x7'),'as':'Agents','attributes':['id',_0x939d('0x4'),_0x939d('0x8'),_0x939d('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x3f1c=['Agents','name','online','getChatQueues','../client','GetChatQueue','strategy','User'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x284025,_0x577906){_0x284025=_0x284025-0x0;var _0x5c5f8f=_0x3f1c[_0x284025];return _0x5c5f8f;};'use strict';var client=require(_0xc3f1('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0xc3f1('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc3f1('0x2')],'include':[{'model':_0xc3f1('0x3'),'as':_0xc3f1('0x4'),'attributes':['id',_0xc3f1('0x5'),_0xc3f1('0x6'),'chatPause']}]},'log':_0xc3f1('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index bbb4592..a4f1f1a 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x255f=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x255f,0x185));var _0xf255=function(_0x5b5f97,_0x46b15e){_0x5b5f97=_0x5b5f97-0x0;var _0x2f6001=_0x255f[_0x5b5f97];return _0x2f6001;};'use strict';var client=require(_0xf255('0x0'));exports['create']=function(_0x43ff47){return client[_0xf255('0x1')](_0xf255('0x2'),{'body':_0x43ff47,'log':'CreateChatQueueReport'});};exports[_0xf255('0x3')]=function(_0x3d90e8,_0x474ac5){return client[_0xf255('0x1')](_0xf255('0x4'),{'body':_0x474ac5,'options':{'where':{'uniqueid':_0x3d90e8},'order':[['id',_0xf255('0x5')]],'limit':0x1},'log':_0xf255('0x4')});}; \ No newline at end of file +var _0xb2b3=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3a8b41,_0x122312){var _0x19cb35=function(_0x133570){while(--_0x133570){_0x3a8b41['push'](_0x3a8b41['shift']());}};_0x19cb35(++_0x122312);}(_0xb2b3,0x71));var _0x3b2b=function(_0x303d61,_0x3d11d7){_0x303d61=_0x303d61-0x0;var _0x432895=_0xb2b3[_0x303d61];return _0x432895;};'use strict';var client=require(_0x3b2b('0x0'));exports[_0x3b2b('0x1')]=function(_0xcf49e8){return client[_0x3b2b('0x2')](_0x3b2b('0x3'),{'body':_0xcf49e8,'log':_0x3b2b('0x3')});};exports[_0x3b2b('0x4')]=function(_0x4dad94,_0x3eff63){return client[_0x3b2b('0x2')](_0x3b2b('0x5'),{'body':_0x3eff63,'options':{'where':{'uniqueid':_0x4dad94},'order':[['id',_0x3b2b('0x6')]],'limit':0x1},'log':_0x3b2b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index bc749a8..b26ed99 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0x7a54,0x106));var _0x47a5=function(_0x595016,_0x147e02){_0x595016=_0x595016-0x0;var _0x5d2d14=_0x7a54[_0x595016];return _0x5d2d14;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x7a54,0x106));var _0x47a5=function(_0x328356,_0x27336b){_0x328356=_0x328356-0x0;var _0x51581d=_0x7a54[_0x328356];return _0x51581d;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f9dc835..6514121 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 _0x0620=['createFaxMessage','../client','create'];(function(_0x5e9330,_0x1afaf4){var _0x502d72=function(_0x298ef8){while(--_0x298ef8){_0x5e9330['push'](_0x5e9330['shift']());}};_0x502d72(++_0x1afaf4);}(_0x0620,0x13f));var _0x0062=function(_0x490396,_0x299fe8){_0x490396=_0x490396-0x0;var _0x39c9b8=_0x0620[_0x490396];return _0x39c9b8;};'use strict';var client=require(_0x0062('0x0'));exports[_0x0062('0x1')]=function(_0x2dcd6a){return client['Request']('CreateFaxMessage',{'body':_0x2dcd6a,'log':_0x0062('0x2')});}; \ No newline at end of file +var _0x1e46=['Request','CreateFaxMessage','../client'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x1e46,0x17c));var _0x61e4=function(_0x5e9cc4,_0x563aab){_0x5e9cc4=_0x5e9cc4-0x0;var _0x341ec7=_0x1e46[_0x5e9cc4];return _0x341ec7;};'use strict';var client=require(_0x61e4('0x0'));exports['create']=function(_0x884ac1){return client[_0x61e4('0x1')](_0x61e4('0x2'),{'body':_0x884ac1,'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 fc3a07b..c8d679e 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 _0xff92=['../client','Request','name','timeout','User','Agents','online','faxPause','getFaxQueues'];(function(_0x2fe58d,_0x36c8da){var _0x2d7de1=function(_0x3b5ce4){while(--_0x3b5ce4){_0x2fe58d['push'](_0x2fe58d['shift']());}};_0x2d7de1(++_0x36c8da);}(_0xff92,0x90));var _0x2ff9=function(_0x5f5ad3,_0x5934e8){_0x5f5ad3=_0x5f5ad3-0x0;var _0x5688ea=_0xff92[_0x5f5ad3];return _0x5688ea;};'use strict';var client=require(_0x2ff9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x2ff9('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2ff9('0x2'),_0x2ff9('0x3'),'strategy'],'include':[{'model':_0x2ff9('0x4'),'as':_0x2ff9('0x5'),'attributes':['id',_0x2ff9('0x2'),_0x2ff9('0x6'),_0x2ff9('0x7')]}]},'log':_0x2ff9('0x8')});};}; \ No newline at end of file +var _0x8ace=['Agents','online','faxPause','../client','getFaxQueues','name','strategy'];(function(_0x30916d,_0x2b9f18){var _0x3f2d4b=function(_0x80b530){while(--_0x80b530){_0x30916d['push'](_0x30916d['shift']());}};_0x3f2d4b(++_0x2b9f18);}(_0x8ace,0x168));var _0xe8ac=function(_0x408a02,_0x478ca0){_0x408a02=_0x408a02-0x0;var _0x579bce=_0x8ace[_0x408a02];return _0x579bce;};'use strict';var client=require(_0xe8ac('0x0'));exports[_0xe8ac('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xe8ac('0x2'),'timeout',_0xe8ac('0x3')],'include':[{'model':'User','as':_0xe8ac('0x4'),'attributes':['id',_0xe8ac('0x2'),_0xe8ac('0x5'),_0xe8ac('0x6')]}]},'log':_0xe8ac('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 897da6c..7ed0269 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 _0xbe95=['CreateFaxQueueReport','update','UpdateFaxQueueReport','create'];(function(_0x15a34f,_0x1378ba){var _0x2e7b6b=function(_0x1fbfa2){while(--_0x1fbfa2){_0x15a34f['push'](_0x15a34f['shift']());}};_0x2e7b6b(++_0x1378ba);}(_0xbe95,0x123));var _0x5be9=function(_0x4c4797,_0xa0125c){_0x4c4797=_0x4c4797-0x0;var _0x31bffb=_0xbe95[_0x4c4797];return _0x31bffb;};'use strict';var client=require('../client');exports[_0x5be9('0x0')]=function(_0x18bdcb){return client['Request'](_0x5be9('0x1'),{'body':_0x18bdcb,'log':_0x5be9('0x1')});};exports[_0x5be9('0x2')]=function(_0x196310,_0x306f4c){return client['Request'](_0x5be9('0x3'),{'body':_0x306f4c,'options':{'where':{'uniqueid':_0x196310},'order':[['id','DESC']],'limit':0x1},'log':_0x5be9('0x3')});}; \ No newline at end of file +var _0x9a28=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9a28,0x1bb));var _0x89a2=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x9a28[_0x59d89e];return _0x554e93;};'use strict';var client=require(_0x89a2('0x0'));exports[_0x89a2('0x1')]=function(_0x196921){return client[_0x89a2('0x2')](_0x89a2('0x3'),{'body':_0x196921,'log':_0x89a2('0x3')});};exports['update']=function(_0x22b273,_0x4fd86c){return client['Request'](_0x89a2('0x4'),{'body':_0x4fd86c,'options':{'where':{'uniqueid':_0x22b273},'order':[['id',_0x89a2('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b42074e..700283f 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 _0x99b1=['getIntervals','GetInterval','name','Interval','interval','../client'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x99b1,0x19d));var _0x199b=function(_0x56ae99,_0x27e0b6){_0x56ae99=_0x56ae99-0x0;var _0x32c5c1=_0x99b1[_0x56ae99];return _0x32c5c1;};'use strict';var client=require(_0x199b('0x0'));exports[_0x199b('0x1')]=function(){return function(){return client['Request'](_0x199b('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x199b('0x3')],'include':[{'model':_0x199b('0x4'),'as':'Intervals','attributes':['id',_0x199b('0x3'),_0x199b('0x5')]}]},'log':_0x199b('0x1')});};}; \ No newline at end of file +var _0xbb95=['getIntervals','name','Interval','Intervals','../client'];(function(_0x590454,_0x30c9cf){var _0x21cb88=function(_0xb039ac){while(--_0xb039ac){_0x590454['push'](_0x590454['shift']());}};_0x21cb88(++_0x30c9cf);}(_0xbb95,0x68));var _0x5bb9=function(_0x4905e6,_0xf1295c){_0x4905e6=_0x4905e6-0x0;var _0x1f7655=_0xbb95[_0x4905e6];return _0x1f7655;};'use strict';var client=require(_0x5bb9('0x0'));exports[_0x5bb9('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5bb9('0x2')],'include':[{'model':_0x5bb9('0x3'),'as':_0x5bb9('0x4'),'attributes':['id',_0x5bb9('0x2'),'interval']}]},'log':_0x5bb9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a3098b8..21ac5c5 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 _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x59ffe4,_0x1569ec){var _0x5e6ad2=function(_0x334790){while(--_0x334790){_0x59ffe4['push'](_0x59ffe4['shift']());}};_0x5e6ad2(++_0x1569ec);}(_0xdb28,0x106));var _0x8db2=function(_0x5163c2,_0x1f741a){_0x5163c2=_0x5163c2-0x0;var _0x2ee950=_0xdb28[_0x5163c2];return _0x2ee950;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});}; \ No newline at end of file +var _0x781d=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x465533,_0x56ab66){var _0x49489b=function(_0x198119){while(--_0x198119){_0x465533['push'](_0x465533['shift']());}};_0x49489b(++_0x56ab66);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xd781('0x0'));exports[_0xd781('0x1')]=function(_0x596ba2,_0x5c1007){return client[_0xd781('0x2')](_0xd781('0x3'),{'body':_0x5c1007,'options':{'where':{'id':_0x596ba2}},'log':_0xd781('0x4')});};exports[_0xd781('0x5')]=function(_0xfd915d,_0x42258e){return client[_0xd781('0x2')](_0xd781('0x6'),{'body':_0x42258e,'options':{'where':{'id':_0xfd915d}},'log':_0xd781('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 4f9cf55..ec4cb09 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 _0x032d=['CreateMailMessage','createMailMessage','../client','create'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x032d,0xde));var _0xd032=function(_0x53b6e4,_0x301b49){_0x53b6e4=_0x53b6e4-0x0;var _0x1859c3=_0x032d[_0x53b6e4];return _0x1859c3;};'use strict';var client=require(_0xd032('0x0'));exports[_0xd032('0x1')]=function(_0x36afa2){return client['Request'](_0xd032('0x2'),{'body':_0x36afa2,'log':_0xd032('0x3')});}; \ No newline at end of file +var _0x7e52=['../client','create','Request','CreateMailMessage'];(function(_0x30f012,_0x18abe1){var _0x430ba8=function(_0x4ce554){while(--_0x4ce554){_0x30f012['push'](_0x30f012['shift']());}};_0x430ba8(++_0x18abe1);}(_0x7e52,0xe8));var _0x27e5=function(_0x540b90,_0x4f614d){_0x540b90=_0x540b90-0x0;var _0x550d1b=_0x7e52[_0x540b90];return _0x550d1b;};'use strict';var client=require(_0x27e5('0x0'));exports[_0x27e5('0x1')]=function(_0x29ac71){return client[_0x27e5('0x2')](_0x27e5('0x3'),{'body':_0x29ac71,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1d7dfe8..ecc4e6e 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 _0x34a5=['getMailQueues','name','timeout','strategy','online','mailPause','../client'];(function(_0x2bca2e,_0x14a36f){var _0x222c86=function(_0xa430b4){while(--_0xa430b4){_0x2bca2e['push'](_0x2bca2e['shift']());}};_0x222c86(++_0x14a36f);}(_0x34a5,0x172));var _0x534a=function(_0x2f383c,_0x16b7cb){_0x2f383c=_0x2f383c-0x0;var _0x460e81=_0x34a5[_0x2f383c];return _0x460e81;};'use strict';var client=require(_0x534a('0x0'));exports[_0x534a('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x534a('0x2'),_0x534a('0x3'),_0x534a('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x534a('0x2'),_0x534a('0x5'),_0x534a('0x6')]}]},'log':_0x534a('0x1')});};}; \ No newline at end of file +var _0xbc86=['getMailQueues','Request','GetMailQueue','name','timeout','User','Agents','online','mailPause'];(function(_0x2a47f0,_0x47d8c1){var _0x18007d=function(_0x153d65){while(--_0x153d65){_0x2a47f0['push'](_0x2a47f0['shift']());}};_0x18007d(++_0x47d8c1);}(_0xbc86,0x7e));var _0x6bc8=function(_0x2dd503,_0x4faa6d){_0x2dd503=_0x2dd503-0x0;var _0x39cee4=_0xbc86[_0x2dd503];return _0x39cee4;};'use strict';var client=require('../client');exports[_0x6bc8('0x0')]=function(){return function(){return client[_0x6bc8('0x1')](_0x6bc8('0x2'),{'options':{'raw':![],'attributes':['id',_0x6bc8('0x3'),_0x6bc8('0x4'),'strategy'],'include':[{'model':_0x6bc8('0x5'),'as':_0x6bc8('0x6'),'attributes':['id',_0x6bc8('0x3'),_0x6bc8('0x7'),_0x6bc8('0x8')]}]},'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 24f81b1..9a2a619 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 _0xfbb0=['DESC','../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xfbb0,0xe5));var _0x0fbb=function(_0xd53e02,_0xbd98b9){_0xd53e02=_0xd53e02-0x0;var _0x2a5589=_0xfbb0[_0xd53e02];return _0x2a5589;};'use strict';var client=require(_0x0fbb('0x0'));exports['create']=function(_0x14e2d8){return client[_0x0fbb('0x1')]('CreateMailQueueReport',{'body':_0x14e2d8,'log':_0x0fbb('0x2')});};exports[_0x0fbb('0x3')]=function(_0x3580f4,_0x2bfac3){return client[_0x0fbb('0x1')](_0x0fbb('0x4'),{'body':_0x2bfac3,'options':{'where':{'uniqueid':_0x3580f4},'order':[['id',_0x0fbb('0x5')]],'limit':0x1},'log':_0x0fbb('0x4')});}; \ No newline at end of file +var _0x2fae=['Request','CreateMailQueueReport','update','DESC','../client','create'];(function(_0x28609d,_0x57f34f){var _0x56577e=function(_0x16772a){while(--_0x16772a){_0x28609d['push'](_0x28609d['shift']());}};_0x56577e(++_0x57f34f);}(_0x2fae,0xdc));var _0xe2fa=function(_0x35b1a9,_0x562264){_0x35b1a9=_0x35b1a9-0x0;var _0x28be32=_0x2fae[_0x35b1a9];return _0x28be32;};'use strict';var client=require(_0xe2fa('0x0'));exports[_0xe2fa('0x1')]=function(_0xcac4f7){return client[_0xe2fa('0x2')](_0xe2fa('0x3'),{'body':_0xcac4f7,'log':'CreateMailQueueReport'});};exports[_0xe2fa('0x4')]=function(_0x1ae853,_0x147494){return client[_0xe2fa('0x2')]('UpdateMailQueueReport',{'body':_0x147494,'options':{'where':{'uniqueid':_0x1ae853},'order':[['id',_0xe2fa('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 35576f8..816fb8a 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 _0x777b=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x777b,0x7e));var _0xb777=function(_0x1da69b,_0x28560c){_0x1da69b=_0x1da69b-0x0;var _0x2614a2=_0x777b[_0x1da69b];return _0x2614a2;};'use strict';var client=require('../client');exports[_0xb777('0x0')]=function(_0x16ed18,_0x239359){return client[_0xb777('0x1')](_0xb777('0x2'),{'body':_0x239359,'options':{'where':{'id':_0x16ed18}},'log':_0xb777('0x3')});};exports[_0xb777('0x4')]=function(_0x33a628,_0x3ae8af){return client[_0xb777('0x1')](_0xb777('0x5'),{'body':_0x3ae8af,'options':{'where':{'id':_0x33a628}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xabe7=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xabe7,0xda));var _0x7abe=function(_0x2270ce,_0x51aa2e){_0x2270ce=_0x2270ce-0x0;var _0x4e6a04=_0xabe7[_0x2270ce];return _0x4e6a04;};'use strict';var client=require(_0x7abe('0x0'));exports[_0x7abe('0x1')]=function(_0x31aada,_0x306c28){return client[_0x7abe('0x2')](_0x7abe('0x3'),{'body':_0x306c28,'options':{'where':{'id':_0x31aada}},'log':_0x7abe('0x4')});};exports[_0x7abe('0x5')]=function(_0x47b7a5,_0x2a3f81){return client[_0x7abe('0x2')](_0x7abe('0x6'),{'body':_0x2a3f81,'options':{'where':{'id':_0x47b7a5}},'log':_0x7abe('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 3eada9d..ec31e85 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 _0x5756=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5756,0x165));var _0x6575=function(_0x82c99c,_0x181457){_0x82c99c=_0x82c99c-0x0;var _0x3bf922=_0x5756[_0x82c99c];return _0x3bf922;};'use strict';var client=require(_0x6575('0x0'));exports[_0x6575('0x1')]=function(_0x40b5f0){return client[_0x6575('0x2')](_0x6575('0x3'),{'body':_0x40b5f0,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xb9f6=['../client','create','Request','CreateOpenchannelMessage'];(function(_0x42a2c3,_0x97871c){var _0x36dfd8=function(_0x900275){while(--_0x900275){_0x42a2c3['push'](_0x42a2c3['shift']());}};_0x36dfd8(++_0x97871c);}(_0xb9f6,0x1ac));var _0x6b9f=function(_0x5f2c02,_0x13f497){_0x5f2c02=_0x5f2c02-0x0;var _0x126521=_0xb9f6[_0x5f2c02];return _0x126521;};'use strict';var client=require(_0x6b9f('0x0'));exports[_0x6b9f('0x1')]=function(_0x4c460){return client[_0x6b9f('0x2')](_0x6b9f('0x3'),{'body':_0x4c460,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index beb5fa9..7ea5727 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 _0xa0b0=['User','Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy'];(function(_0x16d163,_0x193f3b){var _0x440a6d=function(_0x159810){while(--_0x159810){_0x16d163['push'](_0x16d163['shift']());}};_0x440a6d(++_0x193f3b);}(_0xa0b0,0x78));var _0x0a0b=function(_0x1c4dd6,_0x2970ee){_0x1c4dd6=_0x1c4dd6-0x0;var _0x30d7ad=_0xa0b0[_0x1c4dd6];return _0x30d7ad;};'use strict';var client=require(_0x0a0b('0x0'));exports[_0x0a0b('0x1')]=function(){return function(){return client[_0x0a0b('0x2')](_0x0a0b('0x3'),{'options':{'raw':![],'attributes':['id',_0x0a0b('0x4'),'timeout',_0x0a0b('0x5')],'include':[{'model':_0x0a0b('0x6'),'as':_0x0a0b('0x7'),'attributes':['id',_0x0a0b('0x4'),_0x0a0b('0x8'),'openchannelPause']}]},'log':_0x0a0b('0x1')});};}; \ No newline at end of file +var _0x05bf=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause','../client'];(function(_0x258fa4,_0x28def4){var _0x14d014=function(_0x33b861){while(--_0x33b861){_0x258fa4['push'](_0x258fa4['shift']());}};_0x14d014(++_0x28def4);}(_0x05bf,0x77));var _0xf05b=function(_0x5e2542,_0x5358c4){_0x5e2542=_0x5e2542-0x0;var _0x186592=_0x05bf[_0x5e2542];return _0x186592;};'use strict';var client=require(_0xf05b('0x0'));exports[_0xf05b('0x1')]=function(){return function(){return client[_0xf05b('0x2')](_0xf05b('0x3'),{'options':{'raw':![],'attributes':['id',_0xf05b('0x4'),_0xf05b('0x5'),'strategy'],'include':[{'model':_0xf05b('0x6'),'as':_0xf05b('0x7'),'attributes':['id',_0xf05b('0x4'),_0xf05b('0x8'),_0xf05b('0x9')]}]},'log':_0xf05b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5b7862d..a5d92ee 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 _0xcd4f=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x3134a6,_0x28d9ff){var _0x4c9810=function(_0x469c03){while(--_0x469c03){_0x3134a6['push'](_0x3134a6['shift']());}};_0x4c9810(++_0x28d9ff);}(_0xcd4f,0x175));var _0xfcd4=function(_0x4a4566,_0x59b4c3){_0x4a4566=_0x4a4566-0x0;var _0x530d00=_0xcd4f[_0x4a4566];return _0x530d00;};'use strict';var client=require(_0xfcd4('0x0'));exports[_0xfcd4('0x1')]=function(_0x4f0dc4){return client[_0xfcd4('0x2')]('CreateOpenchannelQueueReport',{'body':_0x4f0dc4,'log':_0xfcd4('0x3')});};exports[_0xfcd4('0x4')]=function(_0x5909ab,_0x50d639){return client[_0xfcd4('0x2')](_0xfcd4('0x5'),{'body':_0x50d639,'options':{'where':{'uniqueid':_0x5909ab},'order':[['id',_0xfcd4('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xc859=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x2bc78d,_0x31a288){var _0x5d96c9=function(_0x3099e1){while(--_0x3099e1){_0x2bc78d['push'](_0x2bc78d['shift']());}};_0x5d96c9(++_0x31a288);}(_0xc859,0x17b));var _0x9c85=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xc859[_0x3635ce];return _0x97ecd0;};'use strict';var client=require('../client');exports[_0x9c85('0x0')]=function(_0x4088d4){return client[_0x9c85('0x1')](_0x9c85('0x2'),{'body':_0x4088d4,'log':_0x9c85('0x2')});};exports[_0x9c85('0x3')]=function(_0x3275ef,_0x4f41ef){return client['Request'](_0x9c85('0x4'),{'body':_0x4f41ef,'options':{'where':{'uniqueid':_0x3275ef},'order':[['id',_0x9c85('0x5')]],'limit':0x1},'log':_0x9c85('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b4fdea2..95c89a9 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 _0x8a28=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x3a7fe5,_0x371426){var _0x18ed66=function(_0x4f6a16){while(--_0x4f6a16){_0x3a7fe5['push'](_0x3a7fe5['shift']());}};_0x18ed66(++_0x371426);}(_0x8a28,0xfd));var _0x88a2=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x8a28[_0x373dee];return _0x46798f;};'use strict';var client=require(_0x88a2('0x0'));exports[_0x88a2('0x1')]=function(_0x123af2,_0x3c2c72){return client[_0x88a2('0x2')](_0x88a2('0x3'),{'body':_0x3c2c72,'options':{'where':{'id':_0x123af2}},'log':_0x88a2('0x4')});};exports[_0x88a2('0x5')]=function(_0x5d5b92,_0x2f482e){return client[_0x88a2('0x2')](_0x88a2('0x6'),{'body':_0x2f482e,'options':{'where':{'id':_0x5d5b92}},'log':_0x88a2('0x7')});}; \ No newline at end of file +var _0x5a2a=['addTagsToSmsInteraction','../client','update','addTags','Request','AddTagsToSmsInteraction'];(function(_0x23cc63,_0x3bef01){var _0x880bc3=function(_0x2f33d0){while(--_0x2f33d0){_0x23cc63['push'](_0x23cc63['shift']());}};_0x880bc3(++_0x3bef01);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x1947b8,_0x4d0d9e){_0x1947b8=_0x1947b8-0x0;var _0x33811a=_0x5a2a[_0x1947b8];return _0x33811a;};'use strict';var client=require(_0xa5a2('0x0'));exports[_0xa5a2('0x1')]=function(_0x3f0c5f,_0x1c932a){return client['Request']('UpdateSmsInteraction',{'body':_0x1c932a,'options':{'where':{'id':_0x3f0c5f}},'log':'updateSmsInteraction'});};exports[_0xa5a2('0x2')]=function(_0x2cf196,_0x479d0a){return client[_0xa5a2('0x3')](_0xa5a2('0x4'),{'body':_0x479d0a,'options':{'where':{'id':_0x2cf196}},'log':_0xa5a2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f9e04ab..dc3ff04 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 _0xf081=['create','Request','CreateSmsMessage'];(function(_0x3d91fd,_0x3a768b){var _0x137a3a=function(_0x19f617){while(--_0x19f617){_0x3d91fd['push'](_0x3d91fd['shift']());}};_0x137a3a(++_0x3a768b);}(_0xf081,0x1da));var _0x1f08=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xf081[_0x5a3cf0];return _0x5a64ee;};'use strict';var client=require('../client');exports[_0x1f08('0x0')]=function(_0x1b5040){return client[_0x1f08('0x1')](_0x1f08('0x2'),{'body':_0x1b5040,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xf67e=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x16fc2e,_0x3d98d6){var _0x123ebc=function(_0x2a0c8d){while(--_0x2a0c8d){_0x16fc2e['push'](_0x16fc2e['shift']());}};_0x123ebc(++_0x3d98d6);}(_0xf67e,0xc1));var _0xef67=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf67e[_0x5d6456];return _0x4d66c1;};'use strict';var client=require(_0xef67('0x0'));exports['create']=function(_0x3637a9){return client[_0xef67('0x1')](_0xef67('0x2'),{'body':_0x3637a9,'log':_0xef67('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 70b52c6..a247f87 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(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x52d871,_0x2dfb67){var _0x22f07a=function(_0x73eea4){while(--_0x73eea4){_0x52d871['push'](_0x52d871['shift']());}};_0x22f07a(++_0x2dfb67);}(_0xe706,0xa3));var _0x6e70=function(_0xc75e69,_0x19ac94){_0xc75e69=_0xc75e69-0x0;var _0x447f25=_0xe706[_0xc75e69];return _0x447f25;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 98fcf13..b732814 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x2624ef,_0x12ca73){var _0x27acd8=function(_0x1f6494){while(--_0x1f6494){_0x2624ef['push'](_0x2624ef['shift']());}};_0x27acd8(++_0x12ca73);}(_0x3e74,0x175));var _0x43e7=function(_0x329c0e,_0x1c66bc){_0x329c0e=_0x329c0e-0x0;var _0x5e3a48=_0x3e74[_0x329c0e];return _0x5e3a48;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x2470de,_0x141ba7){var _0x1450e3=function(_0x1f64fc){while(--_0x1f64fc){_0x2470de['push'](_0x2470de['shift']());}};_0x1450e3(++_0x141ba7);}(_0x3e74,0x175));var _0x43e7=function(_0x1c2d74,_0x2b1c74){_0x1c2d74=_0x1c2d74-0x0;var _0x5a0fa1=_0x3e74[_0x1c2d74];return _0x5a0fa1;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 7b71e0b..431aa9d 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(_0x552c61,_0x22d09c){var _0x17ba07=function(_0x4d6a6a){while(--_0x4d6a6a){_0x552c61['push'](_0x552c61['shift']());}};_0x17ba07(++_0x22d09c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x597009,_0x254949){var _0x4e88bd=function(_0x33832e){while(--_0x33832e){_0x597009['push'](_0x597009['shift']());}};_0x4e88bd(++_0x254949);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 e233249..0bd0164 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 _0xb0df=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x10d3da,_0x2e26f2){var _0x5a2cbb=function(_0x5ad580){while(--_0x5ad580){_0x10d3da['push'](_0x10d3da['shift']());}};_0x5a2cbb(++_0x2e26f2);}(_0xb0df,0x85));var _0xfb0d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb0df[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xfb0d('0x0')]=function(_0x24ab11,_0x392e80){return client[_0xfb0d('0x1')](_0xfb0d('0x2'),{'body':_0x392e80,'options':{'where':{'id':_0x24ab11}},'log':_0xfb0d('0x3')});};exports[_0xfb0d('0x4')]=function(_0x823ea6,_0x3348e0){return client['Request'](_0xfb0d('0x5'),{'body':_0x3348e0,'options':{'where':{'id':_0x823ea6}},'log':_0xfb0d('0x6')});}; \ No newline at end of file +var _0x5ff9=['../client','update','Request','addTags','AddTagsToWhatsappInteraction'];(function(_0x3f17c6,_0x3c5331){var _0x4ce1dd=function(_0x547892){while(--_0x547892){_0x3f17c6['push'](_0x3f17c6['shift']());}};_0x4ce1dd(++_0x3c5331);}(_0x5ff9,0xa0));var _0x95ff=function(_0x291814,_0x313648){_0x291814=_0x291814-0x0;var _0x1cc09e=_0x5ff9[_0x291814];return _0x1cc09e;};'use strict';var client=require(_0x95ff('0x0'));exports[_0x95ff('0x1')]=function(_0x4dc587,_0x1962c3){return client[_0x95ff('0x2')]('UpdateWhatsappInteraction',{'body':_0x1962c3,'options':{'where':{'id':_0x4dc587}},'log':'updateWhatsappInteraction'});};exports[_0x95ff('0x3')]=function(_0x58eb5d,_0x5b1bee){return client[_0x95ff('0x2')](_0x95ff('0x4'),{'body':_0x5b1bee,'options':{'where':{'id':_0x58eb5d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index a09aae2..c99be1c 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 _0x88c4=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0xeac97b,_0x5eb2eb){var _0x26427d=function(_0x227a3d){while(--_0x227a3d){_0xeac97b['push'](_0xeac97b['shift']());}};_0x26427d(++_0x5eb2eb);}(_0x88c4,0xc9));var _0x488c=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x88c4[_0x4c2f17];return _0x20919e;};'use strict';var client=require(_0x488c('0x0'));exports['create']=function(_0x55aaf6){return client[_0x488c('0x1')](_0x488c('0x2'),{'body':_0x55aaf6,'log':_0x488c('0x3')});}; \ No newline at end of file +var _0x4b42=['create','Request','createWhatsappMessage','../client'];(function(_0x2a4bb0,_0x35d686){var _0x361d0d=function(_0x731e36){while(--_0x731e36){_0x2a4bb0['push'](_0x2a4bb0['shift']());}};_0x361d0d(++_0x35d686);}(_0x4b42,0x16b));var _0x24b4=function(_0x177101,_0x27660c){_0x177101=_0x177101-0x0;var _0xdd2d92=_0x4b42[_0x177101];return _0xdd2d92;};'use strict';var client=require(_0x24b4('0x0'));exports[_0x24b4('0x1')]=function(_0x153299){return client[_0x24b4('0x2')]('CreateWhatsappMessage',{'body':_0x153299,'log':_0x24b4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 04eab9b..d846471 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 _0xc91f=['name','online','getWhatsappQueues','../client','GetWhatsappQueue','timeout','Agents'];(function(_0x4a6771,_0x3ad9a1){var _0xa8fc97=function(_0x9c216){while(--_0x9c216){_0x4a6771['push'](_0x4a6771['shift']());}};_0xa8fc97(++_0x3ad9a1);}(_0xc91f,0x1ae));var _0xfc91=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc91f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xfc91('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0xfc91('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xfc91('0x2'),'strategy'],'include':[{'model':'User','as':_0xfc91('0x3'),'attributes':['id',_0xfc91('0x4'),_0xfc91('0x5'),'whatsappPause']}]},'log':_0xfc91('0x6')});};}; \ No newline at end of file +var _0x2052=['Request','name','timeout','strategy','User','online','whatsappPause','getWhatsappQueues'];(function(_0x5dacdc,_0x360c9b){var _0x40d00a=function(_0x18ba0e){while(--_0x18ba0e){_0x5dacdc['push'](_0x5dacdc['shift']());}};_0x40d00a(++_0x360c9b);}(_0x2052,0xe7));var _0x2205=function(_0xf73f65,_0x315fc3){_0xf73f65=_0xf73f65-0x0;var _0x1c0005=_0x2052[_0xf73f65];return _0x1c0005;};'use strict';var client=require('../client');exports[_0x2205('0x0')]=function(){return function(){return client[_0x2205('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x2205('0x2'),_0x2205('0x3'),_0x2205('0x4')],'include':[{'model':_0x2205('0x5'),'as':'Agents','attributes':['id',_0x2205('0x2'),_0x2205('0x6'),_0x2205('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7841ed7..25e86fc 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 _0xd46c=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x5ea399,_0x138425){var _0x35fc36=function(_0x1840f3){while(--_0x1840f3){_0x5ea399['push'](_0x5ea399['shift']());}};_0x35fc36(++_0x138425);}(_0xd46c,0x155));var _0xcd46=function(_0x2e25bb,_0x2565ba){_0x2e25bb=_0x2e25bb-0x0;var _0x55331c=_0xd46c[_0x2e25bb];return _0x55331c;};'use strict';var client=require(_0xcd46('0x0'));exports[_0xcd46('0x1')]=function(_0x653481){return client[_0xcd46('0x2')]('CreateWhatsappQueueReport',{'body':_0x653481,'log':_0xcd46('0x3')});};exports['update']=function(_0x3e98c5,_0x18546d){return client[_0xcd46('0x2')](_0xcd46('0x4'),{'body':_0x18546d,'options':{'where':{'uniqueid':_0x3e98c5},'order':[['id',_0xcd46('0x5')]],'limit':0x1},'log':_0xcd46('0x4')});}; \ No newline at end of file +var _0xea62=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x1503c3,_0x420a51){var _0x59fb6a=function(_0x12ba5a){while(--_0x12ba5a){_0x1503c3['push'](_0x1503c3['shift']());}};_0x59fb6a(++_0x420a51);}(_0xea62,0x10a));var _0x2ea6=function(_0x2724e5,_0x229d74){_0x2724e5=_0x2724e5-0x0;var _0x4b6621=_0xea62[_0x2724e5];return _0x4b6621;};'use strict';var client=require(_0x2ea6('0x0'));exports[_0x2ea6('0x1')]=function(_0x23bdfb){return client[_0x2ea6('0x2')](_0x2ea6('0x3'),{'body':_0x23bdfb,'log':_0x2ea6('0x3')});};exports['update']=function(_0x2d770b,_0x266484){return client['Request'](_0x2ea6('0x4'),{'body':_0x266484,'options':{'where':{'uniqueid':_0x2d770b},'order':[['id',_0x2ea6('0x5')]],'limit':0x1},'log':_0x2ea6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index cf9c785..c9ce10e 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 _0xa4f7=['lodash','util','seq-queue','../../../../config/logger','routing','./strategy','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','find','agents','createQueue','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate'];(function(_0x3d8843,_0x56d51f){var _0x3ee48b=function(_0x562dd6){while(--_0x562dd6){_0x3d8843['push'](_0x3d8843['shift']());}};_0x3ee48b(++_0x56d51f);}(_0xa4f7,0x14c));var _0x7a4f=function(_0x457fad,_0x18310e){_0x457fad=_0x457fad-0x0;var _0xce86a8=_0xa4f7[_0x457fad];return _0xce86a8;};'use strict';var schema=require(_0x7a4f('0x0'));var _=require(_0x7a4f('0x1'));var util=require(_0x7a4f('0x2'));var seqqueue=require(_0x7a4f('0x3'));var logger=require(_0x7a4f('0x4'))(_0x7a4f('0x5'));var strategy=require(_0x7a4f('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x7a4f('0x7'),'message':_0x7a4f('0x8')}});function writeLog(_0x23e7e2,_0x17fd86,_0x4404e8){return logger['info'](util[_0x7a4f('0x9')](_0x7a4f('0xa'),_0x23e7e2,_0x17fd86[_0x7a4f('0xb')],_0x4404e8));}function handleFindAgent(_0x4f8e12){return function(_0x192163){return _0x192163[_0x7a4f('0xb')][_0x7a4f('0xc')]()===_0x4f8e12[_0x7a4f('0xc')]();};}exports[_0x7a4f('0xd')]=function(_0x565052,_0x1085ba,_0x3dbe41,_0x139146){return function(_0x5b3dc6){try{var _0x986cb6={'name':_0x1085ba[0x0],'timeout':_0x1085ba[0x1]};var _0xe8b12a=queue[_0x7a4f('0x0')](_0x986cb6,{'typecast':!![]});if(_0xe8b12a['length']){logger[_0x7a4f('0xe')](_0x7a4f('0xf'),_0x565052,_[_0x7a4f('0x10')](_0xe8b12a,_0x7a4f('0x11'))[_0x7a4f('0x12')](',\x20'));_0x5b3dc6['stop']();}else{var _0x39050a=_[_0x7a4f('0x13')](_0x3dbe41[_0x7a4f('0x14')],handleFindAgent(_0x986cb6[_0x7a4f('0xb')]));if(_0x39050a){var _0x17e07a=(_0x986cb6['timeout']||0xa)*0x3e8;var _0xa2f97c,_0x1272e8;var _0x26c58c=seqqueue[_0x7a4f('0x15')](_0x17e07a);_0x26c58c['id']=_0x565052;_0x26c58c[_0x7a4f('0x16')]=_0x17e07a;_0x26c58c['channel']=_0x139146[_0x7a4f('0x17')];writeLog(_0x565052,_0x39050a,util[_0x7a4f('0x9')](_0x7a4f('0x18'),_0x17e07a));_0x3dbe41[_0x7a4f('0x19')][_0x565052]['on'](_0x7a4f('0x1a'),function(){logger[_0x7a4f('0x1b')](_0x7a4f('0x1c'),_0x565052);clearTimeout(_0x1272e8);_0x1272e8=undefined;_0x26c58c['close']();if(_0x3dbe41[_0x7a4f('0x19')][_0x565052]){delete _0x3dbe41[_0x7a4f('0x19')][_0x565052];}_0x5b3dc6[_0x7a4f('0x1d')]();});_0x3dbe41['rules'][_0x565052]['on'](_0x7a4f('0x1e'),function(){if(_0x3dbe41[_0x7a4f('0x19')][_0x565052]){delete _0x3dbe41['rules'][_0x565052];}});_0x1272e8=setTimeout(function(){logger['info'](_0x7a4f('0x1f'),_0x565052);clearTimeout(_0x1272e8);_0x26c58c[_0x7a4f('0x20')]();_0x5b3dc6[_0x7a4f('0x21')]();},_0x17e07a);strategy[_0x7a4f('0x22')](_0x26c58c,_0x39050a,_0x3dbe41,_0x139146);}else{logger[_0x7a4f('0xe')](_0x7a4f('0x23'),_0x565052,_0x986cb6[_0x7a4f('0xb')]);_0x5b3dc6[_0x7a4f('0x1d')]();}}}catch(_0x22ce84){console['log'](_0x22ce84);logger[_0x7a4f('0xe')]('[%s][QUEUE]\x20%s',_0x565052,_0x22ce84[_0x7a4f('0x24')]);_0x5b3dc6[_0x7a4f('0x1d')]();}};}; \ No newline at end of file +var _0x27a2=['atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','join','stop','agents','timeout','createQueue'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x27a2,0x70));var _0x227a=function(_0x402664,_0x414354){_0x402664=_0x402664-0x0;var _0x4cf59c=_0x27a2[_0x402664];return _0x4cf59c;};'use strict';var schema=require(_0x227a('0x0'));var _=require('lodash');var util=require(_0x227a('0x1'));var seqqueue=require(_0x227a('0x2'));var logger=require(_0x227a('0x3'))(_0x227a('0x4'));var strategy=require(_0x227a('0x5'));var queue=schema({'name':{'type':_0x227a('0x6'),'required':!![],'message':_0x227a('0x7')},'timeout':{'type':_0x227a('0x8'),'message':_0x227a('0x9')}});function writeLog(_0x2b466c,_0x44bcea,_0x41fb91){return logger[_0x227a('0xa')](util[_0x227a('0xb')](_0x227a('0xc'),_0x2b466c,_0x44bcea[_0x227a('0xd')],_0x41fb91));}function handleFindAgent(_0x57d0b3){return function(_0x1c0cc){return _0x1c0cc[_0x227a('0xd')][_0x227a('0xe')]()===_0x57d0b3['toLowerCase']();};}exports[_0x227a('0xf')]=function(_0x268ce2,_0x583fee,_0x9edc29,_0x3e6081){return function(_0x4ded4c){try{var _0x2fcbd2={'name':_0x583fee[0x0],'timeout':_0x583fee[0x1]};var _0xf44309=queue[_0x227a('0x0')](_0x2fcbd2,{'typecast':!![]});if(_0xf44309[_0x227a('0x10')]){logger[_0x227a('0x11')]('[%s][AGENT]\x20%s',_0x268ce2,_['map'](_0xf44309,_0x227a('0x12'))[_0x227a('0x13')](',\x20'));_0x4ded4c[_0x227a('0x14')]();}else{var _0x45d37d=_['find'](_0x9edc29[_0x227a('0x15')],handleFindAgent(_0x2fcbd2['name']));if(_0x45d37d){var _0x4fb597=(_0x2fcbd2[_0x227a('0x16')]||0xa)*0x3e8;var _0x3c4bda,_0x18bf1e;var _0x32d323=seqqueue[_0x227a('0x17')](_0x4fb597);_0x32d323['id']=_0x268ce2;_0x32d323[_0x227a('0x18')]=_0x4fb597;_0x32d323['channel']=_0x3e6081[_0x227a('0x19')];writeLog(_0x268ce2,_0x45d37d,util[_0x227a('0xb')](_0x227a('0x1a'),_0x4fb597));_0x9edc29[_0x227a('0x1b')][_0x268ce2]['on']('end',function(){logger[_0x227a('0xa')](_0x227a('0x1c'),_0x268ce2);clearTimeout(_0x18bf1e);_0x18bf1e=undefined;_0x32d323[_0x227a('0x1d')]();if(_0x9edc29['rules'][_0x268ce2]){delete _0x9edc29['rules'][_0x268ce2];}_0x4ded4c[_0x227a('0x14')]();});_0x9edc29[_0x227a('0x1b')][_0x268ce2]['on']('complete',function(){if(_0x9edc29['rules'][_0x268ce2]){delete _0x9edc29['rules'][_0x268ce2];}});_0x18bf1e=setTimeout(function(){logger[_0x227a('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x268ce2);clearTimeout(_0x18bf1e);_0x32d323[_0x227a('0x1d')]();_0x4ded4c[_0x227a('0x1e')]();},_0x4fb597);strategy[_0x227a('0x1f')](_0x32d323,_0x45d37d,_0x9edc29,_0x3e6081);}else{logger['error'](_0x227a('0x20'),_0x268ce2,_0x2fcbd2[_0x227a('0xd')]);_0x4ded4c[_0x227a('0x14')]();}}}catch(_0x12a560){console[_0x227a('0x21')](_0x12a560);logger[_0x227a('0x11')]('[%s][QUEUE]\x20%s',_0x268ce2,_0x12a560['stack']);_0x4ded4c[_0x227a('0x14')]();}};}; \ 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 3f42286..0de66f8 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 _0xd2f4=['lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','next','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','create','then','info','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','Message','dialogState','Failed'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd2f4,0x120));var _0x4d2f=function(_0x2bd674,_0x5183f4){_0x2bd674=_0x2bd674-0x0;var _0x12bfb9=_0xd2f4[_0x2bd674];return _0x12bfb9;};'use strict';var _=require(_0x4d2f('0x0'));var moment=require(_0x4d2f('0x1'));var AWS=require('aws-sdk');var utils=require(_0x4d2f('0x2'));var logger=require(_0x4d2f('0x3'))('routing');var rpc={'chatMessage':require(_0x4d2f('0x4')),'openchannelMessage':require(_0x4d2f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4d2f('0x6')),'faxMessage':require(_0x4d2f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4d2f('0x8')]=function(_0x3c26f1,_0x4b2392){return function(_0x5ab037){try{if(!_[_0x4d2f('0x9')](this[_0x4d2f('0xa')][_0x4d2f('0xb')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3c26f1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5ab037[_0x4d2f('0xc')]();}var _0x229cb3={'ContactId':this[_0x4d2f('0xd')]['id'],'sentAt':moment()[_0x4d2f('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x4d2f('0xf')};if(this[_0x4d2f('0x10')]===_0x4d2f('0x11')||this[_0x4d2f('0x10')]==='whatsapp'){_0x229cb3[_0x4d2f('0x12')]=this[_0x4d2f('0xa')][_0x4d2f('0x12')];}var _0x19f8f1=this[_0x4d2f('0x10')];if(_0x19f8f1===_0x4d2f('0x13')){_0x229cb3[_0x4d2f('0x14')]=this[_0x4d2f('0x15')]['id'];}else{_0x229cb3[_[_0x4d2f('0x16')](_0x19f8f1)+_0x4d2f('0x17')]=this['account']['id'];}_0x229cb3[_[_0x4d2f('0x16')](_0x19f8f1)+_0x4d2f('0x18')]=this[_0x4d2f('0xa')]['id'];if(this['interaction'][_0x4d2f('0x19')]){var _0x4ebef6=_0x4b2392[0x4];if(!_[_0x4d2f('0x1a')](_0x4ebef6)){_0x229cb3[_0x4d2f('0x1b')]=utils['getMustacheRender'](_0x4ebef6,this);return rpc[_0x19f8f1+'Message'][_0x4d2f('0x1c')](_0x229cb3)[_0x4d2f('0x1d')](function(_0x53d19c){logger[_0x4d2f('0x1e')](_0x4d2f('0x1f'),_0x3c26f1,_0x229cb3[_0x4d2f('0x1b')]);})['catch'](function(_0x24a7ac){logger[_0x4d2f('0x20')](_0x4d2f('0x1f'),_0x3c26f1,JSON[_0x4d2f('0x21')](_0x24a7ac));})[_0x4d2f('0x22')](function(){logger[_0x4d2f('0x1e')](_0x4d2f('0x23'),_0x3c26f1);_0x5ab037[_0x4d2f('0x24')]();});}else{logger[_0x4d2f('0x1e')](_0x4d2f('0x25'),_0x3c26f1);_0x5ab037[_0x4d2f('0x24')]();}}else{var _0x522390=this;var _0x48fd2f=new AWS[(_0x4d2f('0x26'))]({'accessKeyId':_0x4b2392[0x0],'secretAccessKey':_0x4b2392[0x1],'region':_0x4b2392[0x2]});var _0x23f3d3={'botAlias':_0x4d2f('0x27'),'botName':_0x4b2392[0x3],'inputText':this[_0x4d2f('0x28')][_0x4d2f('0x1b')],'userId':this['channel']+':'+this[_0x4d2f('0xa')]['id'][_0x4d2f('0x29')]()};_0x48fd2f[_0x4d2f('0x2a')](_0x23f3d3,function(_0x5c7f3f,_0x5e2610){if(_0x5c7f3f){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3c26f1,_0x5c7f3f['message']);_0x5ab037[_0x4d2f('0xc')]();}else if(_0x5e2610&&_0x5e2610[_0x4d2f('0x28')]){_0x522390[_0x4d2f('0x1b')][_0x4d2f('0x2b')]=_0x5e2610;_0x229cb3['body']=_0x5e2610['message'];_0x229cb3[_0x4d2f('0x2c')]=_0x4d2f('0x2b');_0x229cb3['providerResponse']=JSON['stringify'](_0x5e2610);return rpc[_0x19f8f1+_0x4d2f('0x2d')][_0x4d2f('0x1c')](_0x229cb3)['then'](function(_0x50c6cf){logger[_0x4d2f('0x1e')](_0x4d2f('0x1f'),_0x3c26f1,_0x229cb3[_0x4d2f('0x1b')]);if(_0x5e2610[_0x4d2f('0x2e')]==_0x4d2f('0x2f')){_0x5ab037[_0x4d2f('0xc')]();}else{_0x5ab037[_0x4d2f('0x24')]();}})['catch'](function(_0x20710a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3c26f1,JSON[_0x4d2f('0x21')](_0x20710a));_0x5ab037['next']();});}else{_0x5ab037[_0x4d2f('0xc')]();}});}}catch(_0x3f5029){logger[_0x4d2f('0x20')](_0x4d2f('0x1f'),_0x3c26f1,JSON[_0x4d2f('0x21')](_0x3f5029));_0x5ab037[_0x4d2f('0x24')]();}};}; \ No newline at end of file +var _0x4a33=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString','postText','message','providerName','providerResponse','Message','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0x4a33,0xeb));var _0x34a3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4a33[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x34a3('0x0'));var moment=require(_0x34a3('0x1'));var AWS=require(_0x34a3('0x2'));var utils=require(_0x34a3('0x3'));var logger=require(_0x34a3('0x4'))(_0x34a3('0x5'));var rpc={'chatMessage':require(_0x34a3('0x6')),'openchannelMessage':require(_0x34a3('0x7')),'mailMessage':require(_0x34a3('0x8')),'smsMessage':require(_0x34a3('0x9')),'faxMessage':require(_0x34a3('0xa')),'whatsappMessage':require(_0x34a3('0xb'))};exports[_0x34a3('0xc')]=function(_0xfae6df,_0xe4f511){return function(_0x54ef15){try{if(!_['isNil'](this['interaction'][_0x34a3('0xd')])){logger[_0x34a3('0xe')]('[%s][AMAZONLEX]\x20%s',_0xfae6df,_0x34a3('0xf'));return _0x54ef15[_0x34a3('0x10')]();}var _0x14d71a={'ContactId':this[_0x34a3('0x11')]['id'],'sentAt':moment()[_0x34a3('0x12')](_0x34a3('0x13')),'direction':_0x34a3('0x14')};if(this[_0x34a3('0x15')]===_0x34a3('0x16')||this[_0x34a3('0x15')]===_0x34a3('0x17')){_0x14d71a[_0x34a3('0x18')]=this['interaction'][_0x34a3('0x18')];}var _0x50523d=this[_0x34a3('0x15')];if(_0x50523d==='chat'){_0x14d71a[_0x34a3('0x19')]=this[_0x34a3('0x1a')]['id'];}else{_0x14d71a[_[_0x34a3('0x1b')](_0x50523d)+_0x34a3('0x1c')]=this['account']['id'];}_0x14d71a[_['upperFirst'](_0x50523d)+_0x34a3('0x1d')]=this[_0x34a3('0x1e')]['id'];if(this[_0x34a3('0x1e')][_0x34a3('0x1f')]){var _0x370527=_0xe4f511[0x4];if(!_[_0x34a3('0x20')](_0x370527)){_0x14d71a[_0x34a3('0x21')]=utils[_0x34a3('0x22')](_0x370527,this);return rpc[_0x50523d+'Message'][_0x34a3('0x23')](_0x14d71a)[_0x34a3('0x24')](function(_0x514d0d){logger[_0x34a3('0xe')](_0x34a3('0x25'),_0xfae6df,_0x14d71a[_0x34a3('0x21')]);})[_0x34a3('0x26')](function(_0x4313b4){logger[_0x34a3('0x27')]('[%s][AMAZONLEX]\x20%s',_0xfae6df,JSON[_0x34a3('0x28')](_0x4313b4));})[_0x34a3('0x29')](function(){logger[_0x34a3('0xe')](_0x34a3('0x2a'),_0xfae6df);_0x54ef15[_0x34a3('0x2b')]();});}else{logger[_0x34a3('0xe')](_0x34a3('0x2c'),_0xfae6df);_0x54ef15[_0x34a3('0x2b')]();}}else{var _0x51a339=this;var _0x48910f=new AWS['LexRuntime']({'accessKeyId':_0xe4f511[0x0],'secretAccessKey':_0xe4f511[0x1],'region':_0xe4f511[0x2]});var _0x3f1d1f={'botAlias':'$LATEST','botName':_0xe4f511[0x3],'inputText':this['message']['body'],'userId':this[_0x34a3('0x15')]+':'+this['interaction']['id'][_0x34a3('0x2d')]()};_0x48910f[_0x34a3('0x2e')](_0x3f1d1f,function(_0x464496,_0x2e54c2){if(_0x464496){logger[_0x34a3('0x27')]('[%s][AMAZONLEX]\x20%s',_0xfae6df,_0x464496[_0x34a3('0x2f')]);_0x54ef15[_0x34a3('0x10')]();}else if(_0x2e54c2&&_0x2e54c2[_0x34a3('0x2f')]){_0x51a339[_0x34a3('0x21')]['amazonlex']=_0x2e54c2;_0x14d71a[_0x34a3('0x21')]=_0x2e54c2['message'];_0x14d71a[_0x34a3('0x30')]='amazonlex';_0x14d71a[_0x34a3('0x31')]=JSON[_0x34a3('0x28')](_0x2e54c2);return rpc[_0x50523d+_0x34a3('0x32')]['create'](_0x14d71a)[_0x34a3('0x24')](function(_0x29a446){logger['info'](_0x34a3('0x25'),_0xfae6df,_0x14d71a[_0x34a3('0x21')]);if(_0x2e54c2[_0x34a3('0x33')]=='Failed'){_0x54ef15[_0x34a3('0x10')]();}else{_0x54ef15['stop']();}})[_0x34a3('0x26')](function(_0x880084){logger['error'](_0x34a3('0x25'),_0xfae6df,JSON['stringify'](_0x880084));_0x54ef15[_0x34a3('0x10')]();});}else{_0x54ef15['next']();}});}}catch(_0x3da830){logger[_0x34a3('0x27')]('[%s][AMAZONLEX]\x20%s',_0xfae6df,JSON[_0x34a3('0x28')](_0x3da830));_0x54ef15[_0x34a3('0x2b')]();}};}; \ 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 d204008..6fddb9c 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 _0xe7d6=['routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','info','Autoreply\x20already\x20sent','next','One\x20Time\x20already\x20sent','contact','out','getMustacheRender','message','from','phone','read','subject','startsWith','account','upperFirst','AccountId','InteractionId','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','autoreplyExecuted','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','stop','lodash','moment','./utils','../../../../config/logger'];(function(_0x46b01f,_0x43dc27){var _0x5b091a=function(_0x2d9713){while(--_0x2d9713){_0x46b01f['push'](_0x46b01f['shift']());}};_0x5b091a(++_0x43dc27);}(_0xe7d6,0x14b));var _0x6e7d=function(_0x4fe284,_0x31f964){_0x4fe284=_0x4fe284-0x0;var _0x2beafc=_0xe7d6[_0x4fe284];return _0x2beafc;};'use strict';var _=require(_0x6e7d('0x0'));var moment=require(_0x6e7d('0x1'));var utils=require(_0x6e7d('0x2'));var logger=require(_0x6e7d('0x3'))(_0x6e7d('0x4'));var rpc={'chatMessage':require(_0x6e7d('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6e7d('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6e7d('0x7')),'whatsappMessage':require(_0x6e7d('0x8')),'chatInteraction':require(_0x6e7d('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x6e7d('0xa')),'smsInteraction':require(_0x6e7d('0xb')),'faxInteraction':require(_0x6e7d('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x6e7d('0xd'));exports[_0x6e7d('0xe')]=function(_0x3b7911,_0x2f40d8,_0x23f56a,_0x10d623){return function(_0x57df67){try{var _0x25e052=this[_0x6e7d('0xf')];if(_0x25e052===_0x6e7d('0x10')&&_0x10d623[_0x6e7d('0x11')][_0x6e7d('0x12')]){logger['info'](_0x6e7d('0x13'),_0x3b7911,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x57df67['next']();}if(_0x2f40d8[0x0]==='1'&&(_[_0x6e7d('0x14')](this[_0x6e7d('0x15')][_0x6e7d('0x16')])||!this[_0x6e7d('0x15')]['created'])){logger[_0x6e7d('0x17')](_0x6e7d('0x13'),_0x3b7911,_0x6e7d('0x18'));return _0x57df67[_0x6e7d('0x19')]();}if(_0x2f40d8[0x0]==='2'&&this[_0x6e7d('0x15')]['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3b7911,_0x6e7d('0x1a'));return _0x57df67[_0x6e7d('0x19')]();}var _0x7a8162={'ContactId':this[_0x6e7d('0x1b')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6e7d('0x1c')};if(this[_0x6e7d('0xf')]===_0x6e7d('0x10')){_0x7a8162['body']=utils['getMustacheRender'](_0x2f40d8[0x2],this);}else{_0x7a8162[_0x6e7d('0x11')]=utils[_0x6e7d('0x1d')](_0x2f40d8[0x1],this);}if(this[_0x6e7d('0x1e')]){_0x7a8162['to']=this[_0x6e7d('0x1e')][_0x6e7d('0x1f')]||'';if(this[_0x6e7d('0xf')]===_0x6e7d('0x10')&&_0x2f40d8[0x1]==='1'){_0x7a8162['cc']=this[_0x6e7d('0x1e')]['cc']||'';}_0x7a8162[_0x6e7d('0x1f')]=this[_0x6e7d('0x1e')]['to']||'';_0x7a8162[_0x6e7d('0x20')]=this[_0x6e7d('0x1e')]['phone']||'';_0x7a8162[_0x6e7d('0x21')]=!![];if(this['message']['subject']){_0x7a8162[_0x6e7d('0x22')]='';_0x7a8162[_0x6e7d('0x22')]+=_[_0x6e7d('0x23')](this[_0x6e7d('0x1e')][_0x6e7d('0x22')],'Re:')?'':'Re:\x20';_0x7a8162[_0x6e7d('0x22')]+=this[_0x6e7d('0x1e')][_0x6e7d('0x22')];}}if(this[_0x6e7d('0xf')]==='chat'){_0x7a8162['ChatWebsiteId']=this[_0x6e7d('0x24')]['id'];}else{_0x7a8162[_[_0x6e7d('0x25')](this[_0x6e7d('0xf')])+_0x6e7d('0x26')]=this['account']['id'];}_0x7a8162[_['upperFirst'](this['channel'])+_0x6e7d('0x27')]=this[_0x6e7d('0x15')]['id'];var _0xaa0526=this['interaction'];if(rpc[this['channel']+'Message']){if(this[_0x6e7d('0xf')]===_0x6e7d('0x10')){_0x7a8162['inReplyTo']=this[_0x6e7d('0x1e')][_0x6e7d('0x28')];_0x7a8162[_0x6e7d('0x29')]=_0x6e7d('0x2a')+_[_0x6e7d('0x2b')](_0x7a8162[_0x6e7d('0x11')],_0x6e7d('0x2c'),'','','headers','auto-replied','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x3456fe,_0x4e21b6){var _0x46fdcb=function(_0x2a67ea){while(--_0x2a67ea){_0x3456fe['push'](_0x3456fe['shift']());}};_0x46fdcb(++_0x4e21b6);}(_0x3208,0x15e));var _0x8320=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3208[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8320('0x0'));var moment=require(_0x8320('0x1'));var utils=require('./utils');var logger=require(_0x8320('0x2'))(_0x8320('0x3'));var rpc={'chatMessage':require(_0x8320('0x4')),'openchannelMessage':require(_0x8320('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8320('0x6')),'whatsappMessage':require(_0x8320('0x7')),'chatInteraction':require(_0x8320('0x8')),'openchannelInteraction':require(_0x8320('0x9')),'mailInteraction':require(_0x8320('0xa')),'smsInteraction':require(_0x8320('0xb')),'faxInteraction':require(_0x8320('0xc')),'whatsappInteraction':require(_0x8320('0xd'))};var mailRpc=require(_0x8320('0xe'));exports[_0x8320('0xf')]=function(_0x8cffd8,_0x41b635,_0x5e05da,_0x278467){return function(_0x1c71b6){try{var _0x43fe44=this[_0x8320('0x10')];if(_0x43fe44===_0x8320('0x11')&&_0x278467[_0x8320('0x12')][_0x8320('0x13')]){logger['info'](_0x8320('0x14'),_0x8cffd8,_0x8320('0x15'));return _0x1c71b6['next']();}if(_0x41b635[0x0]==='1'&&(_[_0x8320('0x16')](this[_0x8320('0x17')][_0x8320('0x18')])||!this['interaction'][_0x8320('0x18')])){logger['info'](_0x8320('0x14'),_0x8cffd8,_0x8320('0x19'));return _0x1c71b6[_0x8320('0x1a')]();}if(_0x41b635[0x0]==='2'&&this['interaction'][_0x8320('0x1b')]){logger[_0x8320('0x1c')](_0x8320('0x1d'),_0x8cffd8,_0x8320('0x1e'));return _0x1c71b6[_0x8320('0x1a')]();}var _0x387479={'ContactId':this[_0x8320('0x1f')]['id'],'sentAt':moment()['format'](_0x8320('0x20')),'direction':_0x8320('0x21')};if(this[_0x8320('0x10')]==='mail'){_0x387479[_0x8320('0x12')]=utils[_0x8320('0x22')](_0x41b635[0x2],this);}else{_0x387479[_0x8320('0x12')]=utils[_0x8320('0x22')](_0x41b635[0x1],this);}if(this[_0x8320('0x23')]){_0x387479['to']=this[_0x8320('0x23')][_0x8320('0x24')]||'';if(this[_0x8320('0x10')]===_0x8320('0x11')&&_0x41b635[0x1]==='1'){_0x387479['cc']=this['message']['cc']||'';}_0x387479['from']=this['message']['to']||'';_0x387479[_0x8320('0x25')]=this[_0x8320('0x23')]['phone']||'';_0x387479[_0x8320('0x26')]=!![];if(this[_0x8320('0x23')][_0x8320('0x27')]){_0x387479[_0x8320('0x27')]='';_0x387479[_0x8320('0x27')]+=_[_0x8320('0x28')](this[_0x8320('0x23')][_0x8320('0x27')],_0x8320('0x29'))?'':'Re:\x20';_0x387479[_0x8320('0x27')]+=this[_0x8320('0x23')][_0x8320('0x27')];}}if(this[_0x8320('0x10')]===_0x8320('0x2a')){_0x387479[_0x8320('0x2b')]=this[_0x8320('0x2c')]['id'];}else{_0x387479[_[_0x8320('0x2d')](this[_0x8320('0x10')])+_0x8320('0x2e')]=this[_0x8320('0x2c')]['id'];}_0x387479[_[_0x8320('0x2d')](this[_0x8320('0x10')])+'InteractionId']=this[_0x8320('0x17')]['id'];var _0x295df1=this['interaction'];if(rpc[this['channel']+_0x8320('0x2f')]){if(this[_0x8320('0x10')]===_0x8320('0x11')){_0x387479[_0x8320('0x30')]=this[_0x8320('0x23')][_0x8320('0x31')];_0x387479[_0x8320('0x32')]=_0x8320('0x33')+_['replace'](_0x387479['body'],_0x8320('0x34'),_0x8320('0x35'))+_0x8320('0x36');_0x387479[_0x8320('0x37')]={'Auto-Submitted':_0x8320('0x38'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0x8320('0x39')](this['account']['smtpOptions'],_0x387479)[_0x8320('0x3a')](function(_0x56943e){logger['info'](_0x8320('0x3b'),_0x8cffd8);_0x387479[_0x8320('0x31')]=_0x56943e[_0x8320('0x23')]['messageId'];return rpc[_0x43fe44+_0x8320('0x2f')][_0x8320('0x3c')](_0x387479);})['then'](function(_0x41f22a){logger['info'](_0x8320('0x14'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x41f22a));})[_0x8320('0x3e')](function(_0x16aa57){logger[_0x8320('0x3f')](_0x8320('0x40'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x16aa57));})[_0x8320('0x41')](function(){Promise[_0x8320('0x42')]()[_0x8320('0x3a')](function(){if(_0x41b635[0x0]!=='2'||_0x295df1[_0x8320('0x1b')])return;return rpc[_0x43fe44+_0x8320('0x43')][_0x8320('0x44')](_0x295df1['id'],{'autoreplyExecuted':!![]})[_0x8320('0x3a')](function(_0x55ec37){logger[_0x8320('0x1c')](_0x8320('0x1d'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x55ec37));})[_0x8320('0x3e')](function(_0x24daa6){logger[_0x8320('0x3f')](_0x8320('0x45'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x24daa6));});})['then'](function(){_0x1c71b6['next']();});});}else{return rpc[this[_0x8320('0x10')]+_0x8320('0x2f')][_0x8320('0x3c')](_0x387479)[_0x8320('0x3a')](function(){logger[_0x8320('0x1c')](_0x8320('0x14'),_0x8cffd8,_0x387479['body']);})[_0x8320('0x3e')](function(_0x2b9787){logger['error'](_0x8320('0x14'),_0x8cffd8,JSON['stringify'](_0x2b9787));})[_0x8320('0x41')](function(){Promise[_0x8320('0x42')]()['then'](function(){if(_0x41b635[0x0]!=='2'||_0x295df1[_0x8320('0x1b')])return;return rpc[_0x43fe44+'Interaction'][_0x8320('0x44')](_0x295df1['id'],{'autoreplyExecuted':!![]})[_0x8320('0x3a')](function(_0x243cda){logger['info'](_0x8320('0x1d'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x243cda));})[_0x8320('0x3e')](function(_0x26cf92){logger[_0x8320('0x3f')](_0x8320('0x45'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x26cf92));});})[_0x8320('0x3a')](function(){_0x1c71b6['next']();});});}}}catch(_0x15c1b7){logger[_0x8320('0x3f')](_0x8320('0x14'),_0x8cffd8,JSON[_0x8320('0x3d')](_0x15c1b7));_0x1c71b6[_0x8320('0x46')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 580b67c..e2bbe06 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51b5=['[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x51b5,0xc9));var _0x551b=function(_0x4274dc,_0x1a5252){_0x4274dc=_0x4274dc-0x0;var _0x240bfa=_0x51b5[_0x4274dc];return _0x240bfa;};'use strict';var moment=require(_0x551b('0x0'));var logger=require(_0x551b('0x1'))('routing');var rpc={'chatInteraction':require(_0x551b('0x2')),'openchannelInteraction':require(_0x551b('0x3')),'smsInteraction':require(_0x551b('0x4')),'mailInteraction':require(_0x551b('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x551b('0x6'))};exports[_0x551b('0x7')]=function(_0x51470a,_0x337876,_0x22f790,_0x4696de){return function(_0x4db207){try{logger[_0x551b('0x8')](_0x551b('0x9'),_0x51470a,_0x337876[0x0]);var _0x2b0778={'closed':0x1,'closedAt':moment()[_0x551b('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x551b('0xb'),'disposition':_0x337876[0x0]};if(rpc[_0x4696de[_0x551b('0xc')]+_0x551b('0xd')]){rpc[_0x4696de[_0x551b('0xc')]+_0x551b('0xd')]['update'](_0x4696de[_0x551b('0xe')]['id'],_0x2b0778)[_0x551b('0xf')](function(_0x48b43b){logger[_0x551b('0x8')](_0x551b('0x10'),_0x51470a,_0x4696de[_0x551b('0xe')]['id']);})[_0x551b('0x11')](function(_0x3767d0){logger[_0x551b('0x12')](_0x551b('0x13'),_0x51470a,JSON['stringify'](_0x3767d0));})[_0x551b('0x14')](function(){_0x4db207[_0x551b('0x15')]();});}}catch(_0x244cd4){logger[_0x551b('0x12')]('[%s][CLOSE]\x20%s',_0x51470a,JSON['stringify'](_0x244cd4));_0x4db207[_0x551b('0x15')]();}};}; \ No newline at end of file +var _0x53a7=['system','channel','Interaction','update','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x2d902a,_0x2cb893){var _0x4e9997=function(_0xdccb2a){while(--_0xdccb2a){_0x2d902a['push'](_0x2d902a['shift']());}};_0x4e9997(++_0x2cb893);}(_0x53a7,0xda));var _0x753a=function(_0xc95077,_0x3a81a2){_0xc95077=_0xc95077-0x0;var _0x21d84c=_0x53a7[_0xc95077];return _0x21d84c;};'use strict';var moment=require(_0x753a('0x0'));var logger=require(_0x753a('0x1'))(_0x753a('0x2'));var rpc={'chatInteraction':require(_0x753a('0x3')),'openchannelInteraction':require(_0x753a('0x4')),'smsInteraction':require(_0x753a('0x5')),'mailInteraction':require(_0x753a('0x6')),'faxInteraction':require(_0x753a('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x753a('0x8')]=function(_0x5b6ec5,_0x5bd995,_0x124e5c,_0x9e050c){return function(_0x156cf1){try{logger[_0x753a('0x9')](_0x753a('0xa'),_0x5b6ec5,_0x5bd995[0x0]);var _0x200e46={'closed':0x1,'closedAt':moment()[_0x753a('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x753a('0xc'),'disposition':_0x5bd995[0x0]};if(rpc[_0x9e050c[_0x753a('0xd')]+_0x753a('0xe')]){rpc[_0x9e050c[_0x753a('0xd')]+_0x753a('0xe')][_0x753a('0xf')](_0x9e050c['interaction']['id'],_0x200e46)['then'](function(_0x1ca0d6){logger[_0x753a('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5b6ec5,_0x9e050c[_0x753a('0x10')]['id']);})[_0x753a('0x11')](function(_0x4ba27d){logger[_0x753a('0x12')](_0x753a('0x13'),_0x5b6ec5,JSON[_0x753a('0x14')](_0x4ba27d));})[_0x753a('0x15')](function(){_0x156cf1[_0x753a('0x16')]();});}}catch(_0x241827){logger[_0x753a('0x12')](_0x753a('0x13'),_0x5b6ec5,JSON[_0x753a('0x14')](_0x241827));_0x156cf1[_0x753a('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 623d765..b8c0dc1 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb76d=['Message','then','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','create','metadata','endConversation','error','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender'];(function(_0x262ca2,_0x30d0a4){var _0x3e8acd=function(_0x50dc42){while(--_0x50dc42){_0x262ca2['push'](_0x262ca2['shift']());}};_0x3e8acd(++_0x30d0a4);}(_0xb76d,0x119));var _0xdb76=function(_0x5b23e0,_0x4f0048){_0x5b23e0=_0x5b23e0-0x0;var _0xa24819=_0xb76d[_0x5b23e0];return _0xa24819;};'use strict';var _=require(_0xdb76('0x0'));var moment=require('moment');var apiai=require(_0xdb76('0x1'));var md5=require(_0xdb76('0x2'));var utils=require(_0xdb76('0x3'));var logger=require('../../../../config/logger')(_0xdb76('0x4'));var rpc={'chatMessage':require(_0xdb76('0x5')),'openchannelMessage':require(_0xdb76('0x6')),'mailMessage':require(_0xdb76('0x7')),'smsMessage':require(_0xdb76('0x8')),'faxMessage':require(_0xdb76('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdb76('0xa')]=function(_0x39c442,_0x34ccdc){return function(_0x3d80a0){try{if(!_['isNil'](this[_0xdb76('0xb')][_0xdb76('0xc')])){logger['info'](_0xdb76('0xd'),_0x39c442,_0xdb76('0xe'));return _0x3d80a0[_0xdb76('0xf')]();}var _0x370f4a={'ContactId':this[_0xdb76('0x10')]['id'],'sentAt':moment()[_0xdb76('0x11')](_0xdb76('0x12')),'direction':'out'};if(this['channel']===_0xdb76('0x13')||this[_0xdb76('0x14')]===_0xdb76('0x15')){_0x370f4a['phone']=this['interaction'][_0xdb76('0x16')];}var _0x4d1c44=this[_0xdb76('0x14')];if(_0x4d1c44==='chat'){_0x370f4a['ChatWebsiteId']=this[_0xdb76('0x17')]['id'];}else{_0x370f4a[_[_0xdb76('0x18')](_0x4d1c44)+_0xdb76('0x19')]=this[_0xdb76('0x17')]['id'];}_0x370f4a[_['upperFirst'](_0x4d1c44)+_0xdb76('0x1a')]=this[_0xdb76('0xb')]['id'];if(this['interaction'][_0xdb76('0x1b')]){var _0x1a61cf=_0x34ccdc[0x2];if(!_[_0xdb76('0x1c')](_0x1a61cf)){_0x370f4a[_0xdb76('0x1d')]=utils[_0xdb76('0x1e')](_0x1a61cf,this);return rpc[_0x4d1c44+_0xdb76('0x1f')]['create'](_0x370f4a)[_0xdb76('0x20')](function(_0x11ae59){logger[_0xdb76('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x39c442,_0x370f4a[_0xdb76('0x1d')]);})[_0xdb76('0x22')](function(_0x1257c0){logger['error'](_0xdb76('0xd'),_0x39c442,JSON[_0xdb76('0x23')](_0x1257c0));})[_0xdb76('0x24')](function(){logger[_0xdb76('0x21')](_0xdb76('0x25'),_0x39c442);_0x3d80a0[_0xdb76('0x26')]();});}else{logger[_0xdb76('0x21')](_0xdb76('0x27'),_0x39c442);_0x3d80a0[_0xdb76('0x26')]();}}else{var _0x389668=this;var _0x3718e1=apiai(_0x34ccdc[0x0],{'language':_0x34ccdc[0x1]||'en'});return _0x3718e1[_0xdb76('0x28')](this[_0xdb76('0x29')]['body'],{'sessionId':md5(this[_0xdb76('0xb')]['id'])})['then'](function(_0x12f479){_0x389668[_0xdb76('0x1d')][_0xdb76('0x2a')]=_0x12f479;_0x370f4a[_0xdb76('0x1d')]=_0x12f479[_0xdb76('0x2b')][_0xdb76('0x2c')][_0xdb76('0x2d')];_0x370f4a[_0xdb76('0x2e')]=_0xdb76('0x2a');_0x370f4a[_0xdb76('0x2f')]=JSON[_0xdb76('0x23')](_0x12f479);return rpc[_0x4d1c44+'Message'][_0xdb76('0x30')](_0x370f4a)['then'](function(_0x295317){logger[_0xdb76('0x21')](_0xdb76('0xd'),_0x39c442,_0x370f4a['body']);if(_0x12f479['result'][_0xdb76('0x31')][_0xdb76('0x32')]){_0x3d80a0[_0xdb76('0xf')]();}else{_0x3d80a0['stop']();}})[_0xdb76('0x22')](function(_0x6600a1){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,JSON[_0xdb76('0x23')](_0x6600a1));_0x3d80a0[_0xdb76('0xf')]();});})[_0xdb76('0x22')](function(_0x12c9b9){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,_0x12c9b9['message']);_0x3d80a0[_0xdb76('0xf')]();});}}catch(_0x3a469b){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,JSON['stringify'](_0x3a469b));_0x3d80a0['stop']();}};}; \ No newline at end of file +var _0x36bb=['phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','providerResponse','create','metadata','endConversation','next','catch','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','whatsapp'];(function(_0x39bb79,_0xd50ad1){var _0x2af2e0=function(_0x5a554d){while(--_0x5a554d){_0x39bb79['push'](_0x39bb79['shift']());}};_0x2af2e0(++_0xd50ad1);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var moment=require(_0xb36b('0x1'));var apiai=require(_0xb36b('0x2'));var md5=require('md5');var utils=require(_0xb36b('0x3'));var logger=require(_0xb36b('0x4'))(_0xb36b('0x5'));var rpc={'chatMessage':require(_0xb36b('0x6')),'openchannelMessage':require(_0xb36b('0x7')),'mailMessage':require(_0xb36b('0x8')),'smsMessage':require(_0xb36b('0x9')),'faxMessage':require(_0xb36b('0xa')),'whatsappMessage':require(_0xb36b('0xb'))};exports[_0xb36b('0xc')]=function(_0x181f45,_0x2e9885){return function(_0x229483){try{if(!_[_0xb36b('0xd')](this[_0xb36b('0xe')][_0xb36b('0xf')])){logger[_0xb36b('0x10')](_0xb36b('0x11'),_0x181f45,_0xb36b('0x12'));return _0x229483['next']();}var _0x2323b0={'ContactId':this[_0xb36b('0x13')]['id'],'sentAt':moment()[_0xb36b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb36b('0x15')};if(this[_0xb36b('0x16')]===_0xb36b('0x17')||this[_0xb36b('0x16')]===_0xb36b('0x18')){_0x2323b0[_0xb36b('0x19')]=this[_0xb36b('0xe')][_0xb36b('0x19')];}var _0x1e686b=this[_0xb36b('0x16')];if(_0x1e686b===_0xb36b('0x1a')){_0x2323b0['ChatWebsiteId']=this[_0xb36b('0x1b')]['id'];}else{_0x2323b0[_['upperFirst'](_0x1e686b)+'AccountId']=this[_0xb36b('0x1b')]['id'];}_0x2323b0[_[_0xb36b('0x1c')](_0x1e686b)+_0xb36b('0x1d')]=this[_0xb36b('0xe')]['id'];if(this[_0xb36b('0xe')][_0xb36b('0x1e')]){var _0x5ad8c8=_0x2e9885[0x2];if(!_[_0xb36b('0x1f')](_0x5ad8c8)){_0x2323b0[_0xb36b('0x20')]=utils[_0xb36b('0x21')](_0x5ad8c8,this);return rpc[_0x1e686b+_0xb36b('0x22')]['create'](_0x2323b0)[_0xb36b('0x23')](function(_0x211a91){logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20%s',_0x181f45,_0x2323b0[_0xb36b('0x20')]);})['catch'](function(_0xcb8893){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0xcb8893));})[_0xb36b('0x26')](function(){logger[_0xb36b('0x10')](_0xb36b('0x27'),_0x181f45);_0x229483['stop']();});}else{logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x181f45);_0x229483[_0xb36b('0x28')]();}}else{var _0x52b74f=this;var _0x3b8030=apiai(_0x2e9885[0x0],{'language':_0x2e9885[0x1]||'en'});return _0x3b8030[_0xb36b('0x29')](this[_0xb36b('0x2a')][_0xb36b('0x20')],{'sessionId':md5(this[_0xb36b('0xe')]['id'])})['then'](function(_0x474083){_0x52b74f[_0xb36b('0x20')][_0xb36b('0x2b')]=_0x474083;_0x2323b0['body']=_0x474083[_0xb36b('0x2c')]['fulfillment']['speech'];_0x2323b0['providerName']=_0xb36b('0x2b');_0x2323b0[_0xb36b('0x2d')]=JSON[_0xb36b('0x25')](_0x474083);return rpc[_0x1e686b+_0xb36b('0x22')][_0xb36b('0x2e')](_0x2323b0)[_0xb36b('0x23')](function(_0xd28a27){logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20%s',_0x181f45,_0x2323b0['body']);if(_0x474083[_0xb36b('0x2c')][_0xb36b('0x2f')][_0xb36b('0x30')]){_0x229483[_0xb36b('0x31')]();}else{_0x229483['stop']();}})['catch'](function(_0x14d3f1){logger['error'](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0x14d3f1));_0x229483['next']();});})[_0xb36b('0x32')](function(_0x24f8bc){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,_0x24f8bc[_0xb36b('0x2a')]);_0x229483[_0xb36b('0x31')]();});}}catch(_0x2e8349){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0x2e8349));_0x229483[_0xb36b('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index f36a92c..a39a5e7 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750c=['name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','message','dialogflow','md5','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent'];(function(_0xa9aa1e,_0x5d26fa){var _0x3cb1d4=function(_0x1dee18){while(--_0x1dee18){_0xa9aa1e['push'](_0xa9aa1e['shift']());}};_0x3cb1d4(++_0x5d26fa);}(_0x750c,0x1d2));var _0xc750=function(_0x331cb0,_0x14953d){_0x331cb0=_0x331cb0-0x0;var _0x5c4451=_0x750c[_0x331cb0];return _0x5c4451;};'use strict';var _=require('lodash');var dialogflow=require(_0xc750('0x0'));var md5=require(_0xc750('0x1'));var moment=require(_0xc750('0x2'));var Promise=require(_0xc750('0x3'));var logger=require('../../../../config/logger')('routing');var utils=require(_0xc750('0x4'));var rpc={'chatMessage':require(_0xc750('0x5')),'openchannelMessage':require(_0xc750('0x6')),'mailMessage':require(_0xc750('0x7')),'smsMessage':require(_0xc750('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x32ed9b,_0x21c08c,_0x520939,_0x4d9e37){return new Promise(function(_0x589cef,_0x524e52){var _0xa2d00=_['clone'](_0x520939);_0xa2d00[_0xc750('0x9')]=_0x4d9e37;return rpc[_0x21c08c+_0xc750('0xa')]['create'](_0xa2d00)[_0xc750('0xb')](function(){logger[_0xc750('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x32ed9b,_0xa2d00[_0xc750('0x9')]);_0x589cef();})['catch'](function(_0x1567fd){logger['error'](_0xc750('0xd'),_0x32ed9b,JSON[_0xc750('0xe')](_0x1567fd));_0x524e52(_0x1567fd);});});}exports[_0xc750('0xf')]=function(_0x16d124,_0x500b15){return function(_0x29befa){try{if(!_[_0xc750('0x10')](this['interaction'][_0xc750('0x11')])){logger[_0xc750('0xc')](_0xc750('0xd'),_0x16d124,_0xc750('0x12'));return _0x29befa[_0xc750('0x13')]();}var _0x2b5777={'ContactId':this[_0xc750('0x14')]['id'],'sentAt':moment()[_0xc750('0x15')](_0xc750('0x16')),'direction':_0xc750('0x17')};if(this[_0xc750('0x18')]===_0xc750('0x19')||this[_0xc750('0x18')]===_0xc750('0x1a')){_0x2b5777[_0xc750('0x1b')]=this[_0xc750('0x1c')]['phone'];}var _0x5e0152=this[_0xc750('0x18')];if(_0x5e0152==='chat'){_0x2b5777[_0xc750('0x1d')]=this[_0xc750('0x1e')]['id'];}else{_0x2b5777[_[_0xc750('0x1f')](_0x5e0152)+_0xc750('0x20')]=this[_0xc750('0x1e')]['id'];}_0x2b5777[_[_0xc750('0x1f')](_0x5e0152)+_0xc750('0x21')]=this['interaction']['id'];if(this[_0xc750('0x1c')][_0xc750('0x22')]){var _0x25cda5=_0x500b15[0x4];if(!_[_0xc750('0x23')](_0x25cda5)){_0x2b5777[_0xc750('0x9')]=utils[_0xc750('0x24')](_0x25cda5,this);return rpc[_0x5e0152+_0xc750('0xa')][_0xc750('0x25')](_0x2b5777)[_0xc750('0xb')](function(_0x4e0dee){logger[_0xc750('0xc')](_0xc750('0xd'),_0x16d124,_0x2b5777[_0xc750('0x9')]);})[_0xc750('0x26')](function(_0x33c9b3){logger[_0xc750('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x16d124,JSON[_0xc750('0xe')](_0x33c9b3));})[_0xc750('0x28')](function(){logger['info'](_0xc750('0x29'),_0x16d124);_0x29befa[_0xc750('0x2a')]();});}else{logger['info'](_0xc750('0x2b'),_0x16d124);_0x29befa['stop']();}}else{var _0x5d0f4c=this;var _0x33f3be=_0x500b15[0x2][_0xc750('0x2c')](/\\n/g,'\x0a');var _0x30def3={'credentials':{'private_key':_0x33f3be,'client_email':_0x500b15[0x1]}};var _0x1e50da=new dialogflow['SessionsClient'](_0x30def3);var _0x3be7a0=_0x1e50da[_0xc750('0x2d')](_0x500b15[0x0],md5(_0x5d0f4c[_0xc750('0x1c')]['id']));var _0x171e0c={'session':_0x3be7a0,'queryInput':{'text':{'text':_0x5d0f4c['message']['body'],'languageCode':_0x500b15[0x3]||'en'}}};return _0x1e50da[_0xc750('0x2e')](_0x171e0c)['then'](function(_0x251447){if(_0x251447&&_0x251447[_0xc750('0x2f')]){_0x5d0f4c[_0xc750('0x9')][_0xc750('0x30')]=_0x251447;var _0x100f69=_0x251447[0x0];var _0x19f066=_0x100f69[_0xc750('0x31')]['diagnosticInfo']&&_0x100f69[_0xc750('0x31')][_0xc750('0x32')][_0xc750('0x33')]?_0x100f69[_0xc750('0x31')][_0xc750('0x32')][_0xc750('0x33')]['end_conversation'][_0xc750('0x34')]:![];_0x5d0f4c[_0xc750('0x9')]['DIALOGFLOWV2_ACTION']=_0x100f69[_0xc750('0x31')][_0xc750('0x35')];_0x5d0f4c['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x100f69[_0xc750('0x31')][_0xc750('0x36')];_0x5d0f4c['body'][_0xc750('0x37')]=_0x100f69[_0xc750('0x31')]['diagnosticInfo']&&_0x100f69[_0xc750('0x31')][_0xc750('0x32')][_0xc750('0x33')]?_0x100f69['queryResult']['diagnosticInfo']['fields'][_0xc750('0x38')]['boolValue']:![];_0x5d0f4c[_0xc750('0x9')][_0xc750('0x39')]=_0x100f69[_0xc750('0x31')][_0xc750('0x3a')][_0xc750('0x3b')];_0x5d0f4c[_0xc750('0x9')][_0xc750('0x3c')]=_0x100f69[_0xc750('0x31')][_0xc750('0x3a')][_0xc750('0x3d')];_0x5d0f4c[_0xc750('0x9')][_0xc750('0x3e')]=_0x100f69[_0xc750('0x31')]['intent'][_0xc750('0x3f')];_0x5d0f4c[_0xc750('0x9')][_0xc750('0x40')]=_0x100f69['queryResult'][_0xc750('0x41')];_0x5d0f4c['body'][_0xc750('0x42')]=_0x100f69[_0xc750('0x31')][_0xc750('0x43')];_0x5d0f4c[_0xc750('0x9')][_0xc750('0x44')]=_0x100f69[_0xc750('0x31')][_0xc750('0x45')];_0x2b5777[_0xc750('0x46')]=_0xc750('0x30');_0x2b5777['providerResponse']=JSON['stringify'](_0x251447);var _0x26ae58=[];for(var _0x1d37e7=0x0;_0x1d37e7<_0x251447[_0xc750('0x2f')];_0x1d37e7++){var _0x138922=_0x251447[_0x1d37e7];if(_0x138922&&_0x138922[_0xc750('0x31')]&&_0x138922[_0xc750('0x31')][_0xc750('0x47')]){_0x26ae58[_0xc750('0x48')](createMessage(_0x16d124,_0x5e0152,_0x2b5777,_0x138922[_0xc750('0x31')][_0xc750('0x47')]));}}return Promise[_0xc750('0x49')](_0x26ae58)['then'](function(){if(_0x19f066){_0x29befa[_0xc750('0x13')]();}else{_0x29befa['stop']();}})['catch'](function(_0x55bd7c){logger['error'](_0xc750('0xd'),_0x16d124,JSON[_0xc750('0xe')](_0x55bd7c));_0x29befa[_0xc750('0x13')]();});}})[_0xc750('0x26')](function(_0x4184f6){logger[_0xc750('0x27')](_0xc750('0xd'),_0x16d124,_0x4184f6[_0xc750('0x4a')]);_0x29befa[_0xc750('0x13')]();});}}catch(_0x2c2209){logger[_0xc750('0x27')](_0xc750('0xd'),_0x16d124,JSON[_0xc750('0xe')](_0x2c2209));_0x29befa[_0xc750('0x2a')]();}};}; \ No newline at end of file +var _0x62da=['then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','phone','account','upperFirst','InteractionId','isEmpty','body','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','sessionPath','message','detectIntent','dialogflowV2','diagnosticInfo','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','fulfillmentText','all','lodash','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create'];(function(_0x21de3c,_0x8dcfc9){var _0x608e3a=function(_0x5103b6){while(--_0x5103b6){_0x21de3c['push'](_0x21de3c['shift']());}};_0x608e3a(++_0x8dcfc9);}(_0x62da,0xc0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa62d('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xa62d('0x1'));var moment=require(_0xa62d('0x2'));var Promise=require(_0xa62d('0x3'));var logger=require(_0xa62d('0x4'))('routing');var utils=require(_0xa62d('0x5'));var rpc={'chatMessage':require(_0xa62d('0x6')),'openchannelMessage':require(_0xa62d('0x7')),'mailMessage':require(_0xa62d('0x8')),'smsMessage':require(_0xa62d('0x9')),'faxMessage':require(_0xa62d('0xa')),'whatsappMessage':require(_0xa62d('0xb'))};function createMessage(_0x3ceb21,_0x149386,_0x2f6c03,_0x2e8e25){return new Promise(function(_0x2d6e41,_0x5119fd){var _0x1ded9a=_[_0xa62d('0xc')](_0x2f6c03);_0x1ded9a['body']=_0x2e8e25;return rpc[_0x149386+_0xa62d('0xd')][_0xa62d('0xe')](_0x1ded9a)[_0xa62d('0xf')](function(){logger[_0xa62d('0x10')](_0xa62d('0x11'),_0x3ceb21,_0x1ded9a['body']);_0x2d6e41();})[_0xa62d('0x12')](function(_0x417334){logger[_0xa62d('0x13')](_0xa62d('0x11'),_0x3ceb21,JSON[_0xa62d('0x14')](_0x417334));_0x5119fd(_0x417334);});});}exports[_0xa62d('0x15')]=function(_0x42093f,_0x34559b){return function(_0xa2bb40){try{if(!_['isNil'](this[_0xa62d('0x16')][_0xa62d('0x17')])){logger[_0xa62d('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x42093f,_0xa62d('0x18'));return _0xa2bb40[_0xa62d('0x19')]();}var _0x196ab8={'ContactId':this[_0xa62d('0x1a')]['id'],'sentAt':moment()[_0xa62d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa62d('0x1c')};if(this[_0xa62d('0x1d')]===_0xa62d('0x1e')||this['channel']==='whatsapp'){_0x196ab8[_0xa62d('0x1f')]=this[_0xa62d('0x16')][_0xa62d('0x1f')];}var _0x30801f=this[_0xa62d('0x1d')];if(_0x30801f==='chat'){_0x196ab8['ChatWebsiteId']=this[_0xa62d('0x20')]['id'];}else{_0x196ab8[_[_0xa62d('0x21')](_0x30801f)+'AccountId']=this[_0xa62d('0x20')]['id'];}_0x196ab8[_['upperFirst'](_0x30801f)+_0xa62d('0x22')]=this['interaction']['id'];if(this[_0xa62d('0x16')]['created']){var _0xec2a95=_0x34559b[0x4];if(!_[_0xa62d('0x23')](_0xec2a95)){_0x196ab8[_0xa62d('0x24')]=utils['getMustacheRender'](_0xec2a95,this);return rpc[_0x30801f+'Message'][_0xa62d('0xe')](_0x196ab8)[_0xa62d('0xf')](function(_0x34e115){logger[_0xa62d('0x10')](_0xa62d('0x11'),_0x42093f,_0x196ab8['body']);})['catch'](function(_0xea028f){logger['error'](_0xa62d('0x11'),_0x42093f,JSON[_0xa62d('0x14')](_0xea028f));})['finally'](function(){logger['info'](_0xa62d('0x25'),_0x42093f);_0xa2bb40['stop']();});}else{logger[_0xa62d('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x42093f);_0xa2bb40[_0xa62d('0x26')]();}}else{var _0x49dd7b=this;var _0x104aae=_0x34559b[0x2][_0xa62d('0x27')](/\\n/g,'\x0a');var _0x482d05={'credentials':{'private_key':_0x104aae,'client_email':_0x34559b[0x1]}};var _0x113939=new dialogflow['SessionsClient'](_0x482d05);var _0x31c426=_0x113939[_0xa62d('0x28')](_0x34559b[0x0],md5(_0x49dd7b[_0xa62d('0x16')]['id']));var _0x40d512={'session':_0x31c426,'queryInput':{'text':{'text':_0x49dd7b[_0xa62d('0x29')][_0xa62d('0x24')],'languageCode':_0x34559b[0x3]||'en'}}};return _0x113939[_0xa62d('0x2a')](_0x40d512)[_0xa62d('0xf')](function(_0x5a4f63){if(_0x5a4f63&&_0x5a4f63['length']){_0x49dd7b['body'][_0xa62d('0x2b')]=_0x5a4f63;var _0x545ecf=_0x5a4f63[0x0];var _0x394a7c=_0x545ecf['queryResult'][_0xa62d('0x2c')]&&_0x545ecf[_0xa62d('0x2d')]['diagnosticInfo'][_0xa62d('0x2e')]?_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x2c')][_0xa62d('0x2e')]['end_conversation'][_0xa62d('0x2f')]:![];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x30')]=_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x31')];_0x49dd7b['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x32')];_0x49dd7b['body'][_0xa62d('0x33')]=_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x2c')]&&_0x545ecf[_0xa62d('0x2d')]['diagnosticInfo'][_0xa62d('0x2e')]?_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x2c')][_0xa62d('0x2e')][_0xa62d('0x34')][_0xa62d('0x2f')]:![];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x35')]=_0x545ecf[_0xa62d('0x2d')]['intent'][_0xa62d('0x36')];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x37')]=_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x38')][_0xa62d('0x39')];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x3a')]=_0x545ecf[_0xa62d('0x2d')]['intent'][_0xa62d('0x3b')];_0x49dd7b[_0xa62d('0x24')]['DIALOGFLOWV2_LANGUAGECODE']=_0x545ecf[_0xa62d('0x2d')][_0xa62d('0x3c')];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x3d')]=_0x545ecf['queryResult'][_0xa62d('0x3e')];_0x49dd7b[_0xa62d('0x24')][_0xa62d('0x3f')]=_0x545ecf['queryResult'][_0xa62d('0x40')];_0x196ab8['providerName']=_0xa62d('0x2b');_0x196ab8[_0xa62d('0x41')]=JSON['stringify'](_0x5a4f63);var _0x1934cc=[];for(var _0x22c7a6=0x0;_0x22c7a6<_0x5a4f63['length'];_0x22c7a6++){var _0x555c73=_0x5a4f63[_0x22c7a6];if(_0x555c73&&_0x555c73[_0xa62d('0x2d')]&&_0x555c73[_0xa62d('0x2d')]['fulfillmentText']){_0x1934cc[_0xa62d('0x42')](createMessage(_0x42093f,_0x30801f,_0x196ab8,_0x555c73[_0xa62d('0x2d')][_0xa62d('0x43')]));}}return Promise[_0xa62d('0x44')](_0x1934cc)[_0xa62d('0xf')](function(){if(_0x394a7c){_0xa2bb40[_0xa62d('0x19')]();}else{_0xa2bb40[_0xa62d('0x26')]();}})[_0xa62d('0x12')](function(_0x1067b4){logger[_0xa62d('0x13')](_0xa62d('0x11'),_0x42093f,JSON['stringify'](_0x1067b4));_0xa2bb40[_0xa62d('0x19')]();});}})['catch'](function(_0x3d5c75){logger[_0xa62d('0x13')](_0xa62d('0x11'),_0x42093f,_0x3d5c75['message']);_0xa2bb40['next']();});}}catch(_0x1918fb){logger[_0xa62d('0x13')](_0xa62d('0x11'),_0x42093f,JSON[_0xa62d('0x14')](_0x1918fb));_0xa2bb40['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 050e249..c9dd830 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e4e=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e4e,0x125));var _0xe8e4=function(_0x4ed49f,_0x447d25){_0x4ed49f=_0x4ed49f-0x0;var _0x413528=_0x8e4e[_0x4ed49f];return _0x413528;};'use strict';var schema=require(_0xe8e4('0x0'));var _=require('lodash');var htmlToText=require(_0xe8e4('0x1'));var utils=require(_0xe8e4('0x2'));var logger=require(_0xe8e4('0x3'))(_0xe8e4('0x4'));var gotoif=schema({'condition':{'type':_0xe8e4('0x5'),'required':!![],'message':_0xe8e4('0x6')},'priorityTrue':{'type':'number','message':_0xe8e4('0x7')},'priorityFalse':{'type':_0xe8e4('0x8'),'message':_0xe8e4('0x9')}});exports[_0xe8e4('0xa')]=function(_0x27f4a7,_0x102eb8){return function(_0xf40433){try{var _0x2744a2={'condition':htmlToText[_0xe8e4('0xb')](utils[_0xe8e4('0xc')](_0x102eb8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x102eb8[0x1],'priorityFalse':_0x102eb8[0x2]};var _0x345853=gotoif['validate'](_0x2744a2,{'typecast':!![]});if(_0x345853[_0xe8e4('0xd')]){logger[_0xe8e4('0xe')](_0xe8e4('0xf'),_0x27f4a7,_[_0xe8e4('0x10')](_0x345853,'message')[_0xe8e4('0x11')](',\x20'));_0xf40433[_0xe8e4('0x12')]();}else{try{var _0x22692e=eval('('+_0x2744a2[_0xe8e4('0x13')]+')');var _0x3e347c=_0x22692e?_0x2744a2[_0xe8e4('0x14')]:_0x2744a2[_0xe8e4('0x15')];logger[_0xe8e4('0x16')](_0xe8e4('0x17'),_0x27f4a7,_0x2744a2[_0xe8e4('0x13')],_0x22692e,_0x3e347c||_0xe8e4('0x18'));if(_0x3e347c){var _0x508736=_[_0xe8e4('0x19')](_0xf40433[_0xe8e4('0x1a')](),{'p':_0x3e347c});if(_0x508736>=0x0){logger[_0xe8e4('0x16')](_0xe8e4('0x1b'),_0x27f4a7,_0x3e347c||_0xe8e4('0x18'),_0x508736);_0xf40433['next'](_0x508736);}else{logger[_0xe8e4('0x16')](_0xe8e4('0x1c'),_0x27f4a7,_0x3e347c||_0xe8e4('0x18'));_0xf40433[_0xe8e4('0x12')]();}}else{_0xf40433[_0xe8e4('0x18')]();}}catch(_0x3dad97){logger[_0xe8e4('0xe')](_0xe8e4('0x1d'),_0x27f4a7,_0x3dad97[_0xe8e4('0x1e')]);_0xf40433[_0xe8e4('0x12')]();}}}catch(_0x464a57){logger['error'](_0xe8e4('0xf'),_0x27f4a7,JSON[_0xe8e4('0x1f')](_0x464a57));_0xf40433['stop']();}};}; \ No newline at end of file +var _0xfa4c=['./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','error','stringify','validate','lodash','html-to-text'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xfa4c,0x1cd));var _0xcfa4=function(_0x1cac85,_0x3aeb46){_0x1cac85=_0x1cac85-0x0;var _0x23c2f4=_0xfa4c[_0x1cac85];return _0x23c2f4;};'use strict';var schema=require(_0xcfa4('0x0'));var _=require(_0xcfa4('0x1'));var htmlToText=require(_0xcfa4('0x2'));var utils=require(_0xcfa4('0x3'));var logger=require(_0xcfa4('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xcfa4('0x5'),'required':!![],'message':_0xcfa4('0x6')},'priorityTrue':{'type':_0xcfa4('0x7'),'message':_0xcfa4('0x8')},'priorityFalse':{'type':_0xcfa4('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xcfa4('0x9')]=function(_0x1cae87,_0x5386ce){return function(_0x1dc27e){try{var _0x57f238={'condition':htmlToText[_0xcfa4('0xa')](utils[_0xcfa4('0xb')](_0x5386ce[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5386ce[0x1],'priorityFalse':_0x5386ce[0x2]};var _0x357f40=gotoif[_0xcfa4('0x0')](_0x57f238,{'typecast':!![]});if(_0x357f40['length']){logger['error'](_0xcfa4('0xc'),_0x1cae87,_[_0xcfa4('0xd')](_0x357f40,_0xcfa4('0xe'))[_0xcfa4('0xf')](',\x20'));_0x1dc27e[_0xcfa4('0x10')]();}else{try{var _0xdf3063=eval('('+_0x57f238['condition']+')');var _0x477983=_0xdf3063?_0x57f238[_0xcfa4('0x11')]:_0x57f238[_0xcfa4('0x12')];logger[_0xcfa4('0x13')](_0xcfa4('0x14'),_0x1cae87,_0x57f238[_0xcfa4('0x15')],_0xdf3063,_0x477983||'next');if(_0x477983){var _0xf922d3=_[_0xcfa4('0x16')](_0x1dc27e[_0xcfa4('0x17')](),{'p':_0x477983});if(_0xf922d3>=0x0){logger[_0xcfa4('0x13')](_0xcfa4('0x18'),_0x1cae87,_0x477983||_0xcfa4('0x19'),_0xf922d3);_0x1dc27e[_0xcfa4('0x19')](_0xf922d3);}else{logger[_0xcfa4('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1cae87,_0x477983||_0xcfa4('0x19'));_0x1dc27e['stop']();}}else{_0x1dc27e[_0xcfa4('0x19')]();}}catch(_0x4b6a77){logger['error'](_0xcfa4('0x1a'),_0x1cae87,_0x4b6a77[_0xcfa4('0xe')]);_0x1dc27e[_0xcfa4('0x10')]();}}}catch(_0x1759dd){logger[_0xcfa4('0x1b')](_0xcfa4('0xc'),_0x1cae87,JSON[_0xcfa4('0x1c')](_0x1759dd));_0x1dc27e['stop']();}};}; \ 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 c9b54c8..3c63b5b 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 _0xf5ac=['lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','validate'];(function(_0x35235c,_0x16f1c1){var _0x22625f=function(_0x4fcb94){while(--_0x4fcb94){_0x35235c['push'](_0x35235c['shift']());}};_0x22625f(++_0x16f1c1);}(_0xf5ac,0x18b));var _0xcf5a=function(_0x3f1942,_0x7b8fc5){_0x3f1942=_0x3f1942-0x0;var _0x10d0a3=_0xf5ac[_0x3f1942];return _0x10d0a3;};'use strict';var schema=require(_0xcf5a('0x0'));var _=require(_0xcf5a('0x1'));var logger=require('../../../../config/logger')(_0xcf5a('0x2'));var gotop=schema({'priority':{'type':_0xcf5a('0x3'),'required':!![],'message':_0xcf5a('0x4')}});exports['consequence']=function(_0x5bafed,_0x58ebca){return function(_0x4d6fc9){try{var _0x399dee={'priority':_0x58ebca[0x0]};var _0x1d2bc6=gotop[_0xcf5a('0x0')](_0x399dee,{'typecast':!![]});if(_0x1d2bc6[_0xcf5a('0x5')]){logger[_0xcf5a('0x6')]('[%s][GOTOP]\x20%s',_0x5bafed,_['map'](_0x1d2bc6,_0xcf5a('0x7'))[_0xcf5a('0x8')](',\x20'));_0x4d6fc9[_0xcf5a('0x9')]();}else{logger[_0xcf5a('0xa')](_0xcf5a('0xb'),_0x5bafed,_0x399dee['priority']);if(_0x399dee[_0xcf5a('0xc')]){var _0x2e5642=_[_0xcf5a('0xd')](_0x4d6fc9['rules'](),{'p':_0x399dee[_0xcf5a('0xc')]});if(_0x2e5642>=0x0){logger[_0xcf5a('0xa')](_0xcf5a('0xe'),_0x5bafed,_0x399dee[_0xcf5a('0xc')]||_0xcf5a('0xf'),_0x2e5642);_0x4d6fc9[_0xcf5a('0xf')](_0x2e5642);}else{logger[_0xcf5a('0xa')](_0xcf5a('0x10'),_0x5bafed,_0x399dee['priority']||_0xcf5a('0xf'));_0x4d6fc9[_0xcf5a('0x9')]();}}else{_0x4d6fc9[_0xcf5a('0xf')]();}}}catch(_0x4f8689){logger[_0xcf5a('0x6')](_0xcf5a('0x11'),_0x5bafed,JSON['stringify'](_0x4f8689));_0x4d6fc9[_0xcf5a('0x9')]();}};}; \ No newline at end of file +var _0xbabb=['priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info'];(function(_0x79ebc5,_0x2df5d1){var _0x3813b6=function(_0x4e2769){while(--_0x4e2769){_0x79ebc5['push'](_0x79ebc5['shift']());}};_0x3813b6(++_0x2df5d1);}(_0xbabb,0xf7));var _0xbbab=function(_0x50ef84,_0x533643){_0x50ef84=_0x50ef84-0x0;var _0x53bf45=_0xbabb[_0x50ef84];return _0x53bf45;};'use strict';var schema=require(_0xbbab('0x0'));var _=require('lodash');var logger=require(_0xbbab('0x1'))(_0xbbab('0x2'));var gotop=schema({'priority':{'type':_0xbbab('0x3'),'required':!![],'message':_0xbbab('0x4')}});exports[_0xbbab('0x5')]=function(_0x370d64,_0x2aa8cb){return function(_0x2ca351){try{var _0x4d7187={'priority':_0x2aa8cb[0x0]};var _0x5d4df8=gotop[_0xbbab('0x0')](_0x4d7187,{'typecast':!![]});if(_0x5d4df8[_0xbbab('0x6')]){logger[_0xbbab('0x7')](_0xbbab('0x8'),_0x370d64,_[_0xbbab('0x9')](_0x5d4df8,_0xbbab('0xa'))[_0xbbab('0xb')](',\x20'));_0x2ca351['stop']();}else{logger[_0xbbab('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x370d64,_0x4d7187[_0xbbab('0xd')]);if(_0x4d7187['priority']){var _0x2d9c9e=_[_0xbbab('0xe')](_0x2ca351['rules'](),{'p':_0x4d7187[_0xbbab('0xd')]});if(_0x2d9c9e>=0x0){logger['info'](_0xbbab('0xf'),_0x370d64,_0x4d7187[_0xbbab('0xd')]||_0xbbab('0x10'),_0x2d9c9e);_0x2ca351[_0xbbab('0x10')](_0x2d9c9e);}else{logger['info'](_0xbbab('0x11'),_0x370d64,_0x4d7187[_0xbbab('0xd')]||_0xbbab('0x10'));_0x2ca351[_0xbbab('0x12')]();}}else{_0x2ca351[_0xbbab('0x10')]();}}}catch(_0x59fffb){logger[_0xbbab('0x7')](_0xbbab('0x8'),_0x370d64,JSON[_0xbbab('0x13')](_0x59fffb));_0x2ca351[_0xbbab('0x12')]();}};}; \ 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 e3187dc..2719ee0 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 _0x1da8=['getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','interaction','info','[%s][MESSAGE]\x20%s','body','next','error','stop','stringify','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x55f160,_0x722f1f){var _0x1ddce6=function(_0x28552a){while(--_0x28552a){_0x55f160['push'](_0x55f160['shift']());}};_0x1ddce6(++_0x722f1f);}(_0x1da8,0x1ad));var _0x81da=function(_0x44a995,_0x472491){_0x44a995=_0x44a995-0x0;var _0x1af8d7=_0x1da8[_0x44a995];return _0x1af8d7;};'use strict';var _=require(_0x81da('0x0'));var utils=require(_0x81da('0x1'));var logger=require(_0x81da('0x2'))('routing');var rpc={'chatMessage':require(_0x81da('0x3')),'openchannelMessage':require(_0x81da('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x81da('0x5')),'whatsappMessage':require(_0x81da('0x6'))};exports[_0x81da('0x7')]=function(_0x444e24,_0x21b4d3){return function(_0x57d0b7){try{var _0x4b7d67={'body':utils[_0x81da('0x8')](_0x21b4d3[0x0],this),'ContactId':this[_0x81da('0x9')]['id']};if(this[_0x81da('0xa')]===_0x81da('0xb')){_0x4b7d67[_0x81da('0xc')]=this[_0x81da('0xd')]['id'];}else{_0x4b7d67[_[_0x81da('0xe')](this[_0x81da('0xa')])+'AccountId']=this[_0x81da('0xd')]['id'];}_0x4b7d67[_[_0x81da('0xe')](this[_0x81da('0xa')])+'InteractionId']=this[_0x81da('0xf')]['id'];if(rpc[this[_0x81da('0xa')]+'Message']){return rpc[this[_0x81da('0xa')]+'Message']['create'](_0x4b7d67)['then'](function(_0x20f6d5){logger[_0x81da('0x10')](_0x81da('0x11'),_0x444e24,_0x4b7d67[_0x81da('0x12')]);_0x57d0b7[_0x81da('0x13')]();})['catch'](function(_0x44a548){logger[_0x81da('0x14')](_0x81da('0x11'),_0x444e24,JSON['stringify'](_0x44a548));_0x57d0b7[_0x81da('0x15')]();});}}catch(_0x454aa2){logger[_0x81da('0x14')](_0x81da('0x11'),_0x444e24,JSON[_0x81da('0x16')](_0x454aa2));_0x57d0b7[_0x81da('0x15')]();}};}; \ No newline at end of file +var _0x5d72=['Message','create','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction'];(function(_0x592665,_0x18f6e1){var _0x2fab71=function(_0x2723c5){while(--_0x2723c5){_0x592665['push'](_0x592665['shift']());}};_0x2fab71(++_0x18f6e1);}(_0x5d72,0x7c));var _0x25d7=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x5d72[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0x25d7('0x0'));var utils=require(_0x25d7('0x1'));var logger=require(_0x25d7('0x2'))('routing');var rpc={'chatMessage':require(_0x25d7('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x25d7('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x25d7('0x5')]=function(_0x44cef4,_0x29619f){return function(_0x1034ab){try{var _0x14aa9f={'body':utils[_0x25d7('0x6')](_0x29619f[0x0],this),'ContactId':this['contact']['id']};if(this[_0x25d7('0x7')]===_0x25d7('0x8')){_0x14aa9f[_0x25d7('0x9')]=this[_0x25d7('0xa')]['id'];}else{_0x14aa9f[_[_0x25d7('0xb')](this['channel'])+_0x25d7('0xc')]=this['account']['id'];}_0x14aa9f[_['upperFirst'](this[_0x25d7('0x7')])+'InteractionId']=this[_0x25d7('0xd')]['id'];if(rpc[this[_0x25d7('0x7')]+_0x25d7('0xe')]){return rpc[this['channel']+_0x25d7('0xe')][_0x25d7('0xf')](_0x14aa9f)['then'](function(_0x57e16d){logger[_0x25d7('0x10')](_0x25d7('0x11'),_0x44cef4,_0x14aa9f[_0x25d7('0x12')]);_0x1034ab[_0x25d7('0x13')]();})['catch'](function(_0x5f5029){logger[_0x25d7('0x14')](_0x25d7('0x11'),_0x44cef4,JSON[_0x25d7('0x15')](_0x5f5029));_0x1034ab[_0x25d7('0x16')]();});}}catch(_0x33e584){logger[_0x25d7('0x14')](_0x25d7('0x11'),_0x44cef4,JSON[_0x25d7('0x15')](_0x33e584));_0x1034ab['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 ba7a4b3..710ee3c 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 _0x407d=['../../../../config/logger','routing','consequence','info','getMustacheRender','next','[%s][NOOP]\x20%s','stop','./utils'];(function(_0x2c31a5,_0x490ec3){var _0x1f902a=function(_0xde5d2f){while(--_0xde5d2f){_0x2c31a5['push'](_0x2c31a5['shift']());}};_0x1f902a(++_0x490ec3);}(_0x407d,0x167));var _0xd407=function(_0x26ddcd,_0xfb4e75){_0x26ddcd=_0x26ddcd-0x0;var _0x2a2f45=_0x407d[_0x26ddcd];return _0x2a2f45;};'use strict';var utils=require(_0xd407('0x0'));var logger=require(_0xd407('0x1'))(_0xd407('0x2'));exports[_0xd407('0x3')]=function(_0x23af6e,_0xe4e15a){return function(_0x95ad60){try{logger[_0xd407('0x4')]('[%s][NOOP]\x20%s',_0x23af6e,utils[_0xd407('0x5')](_0xe4e15a[0x0],this));_0x95ad60[_0xd407('0x6')]();}catch(_0x3a947a){logger['error'](_0xd407('0x7'),_0x23af6e,JSON['stringify'](_0x3a947a));_0x95ad60[_0xd407('0x8')]();}};}; \ No newline at end of file +var _0x0c3a=['../../../../config/logger','routing','[%s][NOOP]\x20%s','next','stringify'];(function(_0x3c2541,_0x37f09e){var _0x4f77b5=function(_0x55066a){while(--_0x55066a){_0x3c2541['push'](_0x3c2541['shift']());}};_0x4f77b5(++_0x37f09e);}(_0x0c3a,0x154));var _0xa0c3=function(_0x7ef8b0,_0x3e6011){_0x7ef8b0=_0x7ef8b0-0x0;var _0x4f6d9b=_0x0c3a[_0x7ef8b0];return _0x4f6d9b;};'use strict';var utils=require('./utils');var logger=require(_0xa0c3('0x0'))(_0xa0c3('0x1'));exports['consequence']=function(_0x5af4cb,_0x45c475){return function(_0x13b036){try{logger['info'](_0xa0c3('0x2'),_0x5af4cb,utils['getMustacheRender'](_0x45c475[0x0],this));_0x13b036[_0xa0c3('0x3')]();}catch(_0x472d58){logger['error'](_0xa0c3('0x2'),_0x5af4cb,JSON[_0xa0c3('0x4')](_0x472d58));_0x13b036['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 4fc6de7..467acf0 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 _0xc6d7=['../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','catch','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','error','toLowerCase','stop','find','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport'];(function(_0x50758e,_0x2b6228){var _0xfc0497=function(_0x283f8d){while(--_0x283f8d){_0x50758e['push'](_0x50758e['shift']());}};_0xfc0497(++_0x2b6228);}(_0xc6d7,0x71));var _0x7c6d=function(_0x2699b7,_0x4a2eab){_0x2699b7=_0x2699b7-0x0;var _0x2b2427=_0xc6d7[_0x2699b7];return _0x2b2427;};'use strict';var schema=require(_0x7c6d('0x0'));var _=require(_0x7c6d('0x1'));var util=require(_0x7c6d('0x2'));var seqqueue=require(_0x7c6d('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x7c6d('0x4'));var logger=require(_0x7c6d('0x5'))(_0x7c6d('0x6'));var strategy=require(_0x7c6d('0x7'));config[_0x7c6d('0x8')]=_[_0x7c6d('0x9')](config[_0x7c6d('0x8')],{'host':_0x7c6d('0xa'),'port':0x18eb});var io=require(_0x7c6d('0xb'))(new Redis(config[_0x7c6d('0x8')]));var attributes=['id',_0x7c6d('0xc'),_0x7c6d('0xd'),_0x7c6d('0xe'),_0x7c6d('0xf'),'joinAt'];function emit(_0x477a41,_0x4aeaf6,_0x3e70ad){io['to'](_0x477a41)[_0x7c6d('0x10')](_0x4aeaf6,_0x3e70ad);}function emitChannelQueueInteraction(_0x2293f7,_0x9f1cbb,_0x479b86,_0x7b3c4c,_0x1d4eb9,_0xc2f28e,_0x1eb828,_0x46a887){var _0x3b5869=_[_0x7c6d('0x11')](_0x479b86);_0x3b5869['queue_id']=_0x46a887;_0x3b5869[_0x7c6d('0xe')]=_0x9f1cbb;_0x3b5869[_0x7c6d('0xd')]=_0x7b3c4c;_0x3b5869['id']=_0x1d4eb9;if(_0xc2f28e){_0x1eb828[util[_0x7c6d('0x12')](_0x7c6d('0x13'),_0x2293f7)][_0x1d4eb9]=_[_0x7c6d('0x14')](_0x3b5869,attributes);}else{delete _0x1eb828[util[_0x7c6d('0x12')](_0x7c6d('0x13'),_0x2293f7)][_0x1d4eb9];}emit(util[_0x7c6d('0x12')](_0x7c6d('0x15'),_0x2293f7,_0x9f1cbb),util['format'](_0x7c6d('0x16'),_0x2293f7,_0xc2f28e?_0x7c6d('0x17'):'remove'),_[_0x7c6d('0x14')](_0x3b5869,attributes));}var rpc={'openchannelQueueReport':require(_0x7c6d('0x18')),'mailQueueReport':require(_0x7c6d('0x19')),'chatQueueReport':require(_0x7c6d('0x1a')),'smsQueueReport':require(_0x7c6d('0x1b')),'faxQueueReport':require(_0x7c6d('0x1c')),'whatsappQueueReport':require(_0x7c6d('0x1d'))};var queue=schema({'name':{'type':_0x7c6d('0x1e'),'required':!![],'message':_0x7c6d('0x1f')},'timeout':{'type':'number','message':_0x7c6d('0x20')}});function startRouting(_0x4f37d5,_0x4020b8,_0x10ac1c,_0x4a40e8){if(_0x4f37d5&&_0x4020b8&&_0x10ac1c){_0x4020b8[_0x7c6d('0x21')]+=0x1;var _0x149bd3={'uniqueid':_0x4f37d5,'from':_0x10ac1c[_0x7c6d('0x22')]?_0x10ac1c[_0x7c6d('0x22')][_0x7c6d('0xf')]:'','joinAt':moment()['format'](_0x7c6d('0x23')),'ContactId':_0x10ac1c[_0x7c6d('0x24')]?_0x10ac1c[_0x7c6d('0x24')]['id']:null,'ListId':_0x10ac1c[_0x7c6d('0x25')]?_0x10ac1c['list']['id']:null};_0x149bd3[_[_0x7c6d('0x26')](_0x10ac1c[_0x7c6d('0x27')])+_0x7c6d('0x28')]=_0x4020b8['id']||null;_0x149bd3[_[_0x7c6d('0x26')](_0x10ac1c[_0x7c6d('0x27')])+_0x7c6d('0x29')]=_0x10ac1c['interaction']?_0x10ac1c[_0x7c6d('0x2a')]['id']:null;_0x149bd3[_[_0x7c6d('0x26')](_0x10ac1c[_0x7c6d('0x27')])+_0x7c6d('0x2b')]=_0x10ac1c['message']?_0x10ac1c['message']['id']:null;_0x149bd3[_['upperFirst'](_0x10ac1c[_0x7c6d('0x27')])+(_0x10ac1c[_0x7c6d('0x27')]!=='chat'?'AccountId':'WebsiteId')]=_0x10ac1c[_0x7c6d('0xd')]?_0x10ac1c[_0x7c6d('0xd')]['id']:null;logger[_0x7c6d('0x2c')](util[_0x7c6d('0x12')](_0x7c6d('0x2d'),_0x4f37d5,_0x4020b8[_0x7c6d('0x2e')]));emitChannelQueueInteraction(_0x10ac1c['channel'],_0x4020b8['name'],_0x149bd3,_0x10ac1c['account'][_0x7c6d('0x2e')],_0x10ac1c[_0x7c6d('0x2f')]['id'],!![],_0x4a40e8,_0x4020b8['id']);if(rpc[_0x10ac1c['channel']+_0x7c6d('0x30')]){return rpc[_0x10ac1c[_0x7c6d('0x27')]+_0x7c6d('0x30')][_0x7c6d('0x31')](_0x149bd3)[_0x7c6d('0x32')](function(_0x4b85af){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x6dfef6,_0x4edfaa,_0x86bef1,_0x5cb915){if(_0x6dfef6&&_0x4edfaa){_0x4edfaa['waiting']-=0x1;var _0x212642={'leaveAt':moment()[_0x7c6d('0x12')](_0x7c6d('0x23')),'acceptAt':moment()[_0x7c6d('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x7c6d('0x2c')](util['format'](_0x7c6d('0x33'),_0x6dfef6,_0x4edfaa[_0x7c6d('0x2e')]));emitChannelQueueInteraction(_0x86bef1[_0x7c6d('0x27')],_0x4edfaa[_0x7c6d('0x2e')],_0x86bef1[_0x7c6d('0x22')],_0x86bef1[_0x7c6d('0xd')][_0x7c6d('0x2e')],_0x86bef1[_0x7c6d('0x2f')]['id'],![],_0x5cb915,_0x4edfaa['id']);if(rpc[_0x86bef1[_0x7c6d('0x27')]+_0x7c6d('0x30')]){return rpc[_0x86bef1[_0x7c6d('0x27')]+_0x7c6d('0x30')][_0x7c6d('0x34')](_0x6dfef6,_0x212642)['catch'](function(_0x31c7c9){logger['error'](_0x7c6d('0x35'));});}}}function endRouting(_0x55b673,_0x525176,_0x442c0a,_0x1a19be){if(_0x55b673&&_0x525176){_0x525176[_0x7c6d('0x21')]-=0x1;var _0x1236aa={'leaveAt':moment()[_0x7c6d('0x12')](_0x7c6d('0x23')),'exitAt':moment()[_0x7c6d('0x12')](_0x7c6d('0x23')),'reason':_0x7c6d('0x36')};logger[_0x7c6d('0x2c')](util[_0x7c6d('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x55b673,_0x525176[_0x7c6d('0x2e')]));emitChannelQueueInteraction(_0x442c0a[_0x7c6d('0x27')],_0x525176[_0x7c6d('0x2e')],_0x442c0a[_0x7c6d('0x22')],_0x442c0a[_0x7c6d('0xd')]['name'],_0x442c0a['message']['id'],![],_0x1a19be);if(rpc[_0x442c0a[_0x7c6d('0x27')]+_0x7c6d('0x30')]){return rpc[_0x442c0a[_0x7c6d('0x27')]+_0x7c6d('0x30')][_0x7c6d('0x34')](_0x55b673,_0x1236aa)[_0x7c6d('0x32')](function(_0x2af9de){logger[_0x7c6d('0x37')](_0x7c6d('0x35'));});}}}function handleFindQueue(_0x3b7571){return function(_0x5b9352){return _0x5b9352['name'][_0x7c6d('0x38')]()===_0x3b7571[_0x7c6d('0x38')]();};}exports['consequence']=function(_0x20b8cd,_0x2c965f,_0x4257f5,_0x7783a2){return function(_0x3320b4){try{var _0x447eed={'name':_0x2c965f[0x0],'timeout':_0x2c965f[0x1]};var _0x53e48e=queue[_0x7c6d('0x0')](_0x447eed,{'typecast':!![]});if(_0x53e48e['length']){logger[_0x7c6d('0x37')]('[%s][QUEUE]\x20%s',_0x20b8cd,_['map'](_0x53e48e,_0x7c6d('0x2f'))['join'](',\x20'));_0x3320b4[_0x7c6d('0x39')]();}else{var _0x5682ed=_[_0x7c6d('0x3a')](_0x4257f5[_0x7783a2[_0x7c6d('0x27')]+'Queues'],handleFindQueue(_0x447eed['name']));if(_0x5682ed){startRouting(_0x20b8cd,_0x5682ed,_0x7783a2,_0x4257f5);var _0x5edb13=(_0x5682ed[_0x7c6d('0x36')]||0xa)*0x3e8;var _0x54906a=(_0x447eed['timeout']||0x14)*0x3e8;var _0x500a07,_0x26ca5a;if(_0x5edb13>_0x54906a){_0x54906a=_0x5edb13;}var _0x576fd1=seqqueue[_0x7c6d('0x3b')](_0x5edb13);_0x576fd1['id']=_0x20b8cd;_0x576fd1['atimeout']=_0x5edb13;_0x576fd1['qtimeout']=_0x54906a;_0x576fd1[_0x7c6d('0x27')]=_0x7783a2['channel'];_0x4257f5[_0x7c6d('0x3c')][_0x20b8cd]['on'](_0x7c6d('0x3d'),function(){logger[_0x7c6d('0x2c')](_0x7c6d('0x3e'),_0x20b8cd);stopRouting(_0x20b8cd,_0x5682ed,_0x7783a2,_0x4257f5);clearTimeout(_0x500a07);_0x500a07=undefined;_0x576fd1[_0x7c6d('0x3f')](!![]);if(_0x4257f5[_0x7c6d('0x3c')][_0x20b8cd]){delete _0x4257f5['rules'][_0x20b8cd];}_0x3320b4['stop']();});_0x4257f5[_0x7c6d('0x3c')][_0x20b8cd]['on'](_0x7c6d('0x40'),function(){if(_0x4257f5[_0x7c6d('0x3c')][_0x20b8cd]){delete _0x4257f5[_0x7c6d('0x3c')][_0x20b8cd];}});_0x500a07=setTimeout(function(){logger[_0x7c6d('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x20b8cd);endRouting(_0x20b8cd,_0x5682ed,_0x7783a2,_0x4257f5);clearTimeout(_0x500a07);_0x576fd1[_0x7c6d('0x3f')](!![]);_0x3320b4[_0x7c6d('0x41')]();},_0x54906a);switch(_0x5682ed[_0x7c6d('0x42')]){case _0x7c6d('0x43'):strategy['rrmemory'](_0x576fd1,_0x5682ed,_0x4257f5,_0x7783a2);break;default:strategy[_0x7c6d('0x44')](_0x576fd1,_0x5682ed,_0x4257f5,_0x7783a2);}}else{logger[_0x7c6d('0x37')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x20b8cd,_0x447eed['name']);_0x3320b4[_0x7c6d('0x39')]();}}}catch(_0x2fcce4){console[_0x7c6d('0x45')](_0x2fcce4);logger[_0x7c6d('0x37')]('[%s][QUEUE]\x20%s',_0x20b8cd,_0x2fcce4[_0x7c6d('0x46')]);_0x3320b4[_0x7c6d('0x39')]();}};}; \ No newline at end of file +var _0x5e03=['pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format'];(function(_0x49db5e,_0x21d6af){var _0x366380=function(_0x2501c9){while(--_0x2501c9){_0x49db5e['push'](_0x49db5e['shift']());}};_0x366380(++_0x21d6af);}(_0x5e03,0x192));var _0x35e0=function(_0x5d307e,_0x5b351b){_0x5d307e=_0x5d307e-0x0;var _0x59c3a8=_0x5e03[_0x5d307e];return _0x59c3a8;};'use strict';var schema=require('validate');var _=require(_0x35e0('0x0'));var util=require(_0x35e0('0x1'));var seqqueue=require(_0x35e0('0x2'));var moment=require(_0x35e0('0x3'));var Redis=require(_0x35e0('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x35e0('0x5'));var strategy=require('./strategy');config[_0x35e0('0x6')]=_[_0x35e0('0x7')](config[_0x35e0('0x6')],{'host':_0x35e0('0x8'),'port':0x18eb});var io=require(_0x35e0('0x9'))(new Redis(config[_0x35e0('0x6')]));var attributes=['id',_0x35e0('0xa'),_0x35e0('0xb'),'queue',_0x35e0('0xc'),_0x35e0('0xd')];function emit(_0x5dc001,_0x249068,_0x4003b0){io['to'](_0x5dc001)[_0x35e0('0xe')](_0x249068,_0x4003b0);}function emitChannelQueueInteraction(_0xf60ec4,_0x52cb74,_0x2b54dd,_0x2fe2bd,_0x1abb68,_0x137b5c,_0x16b90e,_0x313e6e){var _0x539d67=_[_0x35e0('0xf')](_0x2b54dd);_0x539d67[_0x35e0('0xa')]=_0x313e6e;_0x539d67[_0x35e0('0x10')]=_0x52cb74;_0x539d67[_0x35e0('0xb')]=_0x2fe2bd;_0x539d67['id']=_0x1abb68;if(_0x137b5c){_0x16b90e[util[_0x35e0('0x11')]('%sQueuesWaitingInteractions',_0xf60ec4)][_0x1abb68]=_[_0x35e0('0x12')](_0x539d67,attributes);}else{delete _0x16b90e[util['format'](_0x35e0('0x13'),_0xf60ec4)][_0x1abb68];}emit(util[_0x35e0('0x11')](_0x35e0('0x14'),_0xf60ec4,_0x52cb74),util[_0x35e0('0x11')](_0x35e0('0x15'),_0xf60ec4,_0x137b5c?_0x35e0('0x16'):_0x35e0('0x17')),_[_0x35e0('0x12')](_0x539d67,attributes));}var rpc={'openchannelQueueReport':require(_0x35e0('0x18')),'mailQueueReport':require(_0x35e0('0x19')),'chatQueueReport':require(_0x35e0('0x1a')),'smsQueueReport':require(_0x35e0('0x1b')),'faxQueueReport':require(_0x35e0('0x1c')),'whatsappQueueReport':require(_0x35e0('0x1d'))};var queue=schema({'name':{'type':_0x35e0('0x1e'),'required':!![],'message':_0x35e0('0x1f')},'timeout':{'type':_0x35e0('0x20'),'message':_0x35e0('0x21')}});function startRouting(_0x3c7972,_0x32e3e1,_0x3cfe5c,_0x1818a0){if(_0x3c7972&&_0x32e3e1&&_0x3cfe5c){_0x32e3e1[_0x35e0('0x22')]+=0x1;var _0x3b37e2={'uniqueid':_0x3c7972,'from':_0x3cfe5c[_0x35e0('0x23')]?_0x3cfe5c[_0x35e0('0x23')]['from']:'','joinAt':moment()[_0x35e0('0x11')](_0x35e0('0x24')),'ContactId':_0x3cfe5c[_0x35e0('0x25')]?_0x3cfe5c['contact']['id']:null,'ListId':_0x3cfe5c[_0x35e0('0x26')]?_0x3cfe5c[_0x35e0('0x26')]['id']:null};_0x3b37e2[_[_0x35e0('0x27')](_0x3cfe5c[_0x35e0('0x28')])+_0x35e0('0x29')]=_0x32e3e1['id']||null;_0x3b37e2[_[_0x35e0('0x27')](_0x3cfe5c['channel'])+_0x35e0('0x2a')]=_0x3cfe5c['interaction']?_0x3cfe5c[_0x35e0('0x2b')]['id']:null;_0x3b37e2[_[_0x35e0('0x27')](_0x3cfe5c['channel'])+'MessageId']=_0x3cfe5c['message']?_0x3cfe5c['message']['id']:null;_0x3b37e2[_[_0x35e0('0x27')](_0x3cfe5c[_0x35e0('0x28')])+(_0x3cfe5c[_0x35e0('0x28')]!==_0x35e0('0x2c')?_0x35e0('0x2d'):_0x35e0('0x2e'))]=_0x3cfe5c[_0x35e0('0xb')]?_0x3cfe5c[_0x35e0('0xb')]['id']:null;logger[_0x35e0('0x2f')](util[_0x35e0('0x11')](_0x35e0('0x30'),_0x3c7972,_0x32e3e1[_0x35e0('0x31')]));emitChannelQueueInteraction(_0x3cfe5c[_0x35e0('0x28')],_0x32e3e1[_0x35e0('0x31')],_0x3b37e2,_0x3cfe5c[_0x35e0('0xb')][_0x35e0('0x31')],_0x3cfe5c[_0x35e0('0x32')]['id'],!![],_0x1818a0,_0x32e3e1['id']);if(rpc[_0x3cfe5c[_0x35e0('0x28')]+'QueueReport']){return rpc[_0x3cfe5c[_0x35e0('0x28')]+_0x35e0('0x33')][_0x35e0('0x34')](_0x3b37e2)['catch'](function(_0x1eb763){logger['error'](_0x35e0('0x35'));});}}}function stopRouting(_0x5442d1,_0x3fc902,_0x140eed,_0x53039b){if(_0x5442d1&&_0x3fc902){_0x3fc902[_0x35e0('0x22')]-=0x1;var _0x299d6f={'leaveAt':moment()[_0x35e0('0x11')](_0x35e0('0x24')),'acceptAt':moment()[_0x35e0('0x11')](_0x35e0('0x24')),'reason':_0x35e0('0x36')};logger['info'](util[_0x35e0('0x11')](_0x35e0('0x37'),_0x5442d1,_0x3fc902[_0x35e0('0x31')]));emitChannelQueueInteraction(_0x140eed['channel'],_0x3fc902[_0x35e0('0x31')],_0x140eed[_0x35e0('0x23')],_0x140eed[_0x35e0('0xb')][_0x35e0('0x31')],_0x140eed['message']['id'],![],_0x53039b,_0x3fc902['id']);if(rpc[_0x140eed[_0x35e0('0x28')]+_0x35e0('0x33')]){return rpc[_0x140eed[_0x35e0('0x28')]+_0x35e0('0x33')][_0x35e0('0x38')](_0x5442d1,_0x299d6f)['catch'](function(_0x1d24b3){logger[_0x35e0('0x39')](_0x35e0('0x3a'));});}}}function endRouting(_0x5e553c,_0x30e0ae,_0x249243,_0x2aa403){if(_0x5e553c&&_0x30e0ae){_0x30e0ae[_0x35e0('0x22')]-=0x1;var _0x599968={'leaveAt':moment()[_0x35e0('0x11')](_0x35e0('0x24')),'exitAt':moment()['format'](_0x35e0('0x24')),'reason':_0x35e0('0x3b')};logger[_0x35e0('0x2f')](util[_0x35e0('0x11')](_0x35e0('0x3c'),_0x5e553c,_0x30e0ae['name']));emitChannelQueueInteraction(_0x249243['channel'],_0x30e0ae[_0x35e0('0x31')],_0x249243[_0x35e0('0x23')],_0x249243['account'][_0x35e0('0x31')],_0x249243[_0x35e0('0x32')]['id'],![],_0x2aa403);if(rpc[_0x249243['channel']+_0x35e0('0x33')]){return rpc[_0x249243['channel']+_0x35e0('0x33')]['update'](_0x5e553c,_0x599968)[_0x35e0('0x3d')](function(_0x540bc0){logger[_0x35e0('0x39')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x570b7b){return function(_0x4bcf46){return _0x4bcf46['name']['toLowerCase']()===_0x570b7b[_0x35e0('0x3e')]();};}exports[_0x35e0('0x3f')]=function(_0x556269,_0x2c748d,_0x512c8b,_0x13a406){return function(_0x19c1ed){try{var _0x1db58a={'name':_0x2c748d[0x0],'timeout':_0x2c748d[0x1]};var _0x2d3da0=queue['validate'](_0x1db58a,{'typecast':!![]});if(_0x2d3da0[_0x35e0('0x40')]){logger[_0x35e0('0x39')](_0x35e0('0x41'),_0x556269,_[_0x35e0('0x42')](_0x2d3da0,_0x35e0('0x32'))[_0x35e0('0x43')](',\x20'));_0x19c1ed[_0x35e0('0x44')]();}else{var _0x26884c=_[_0x35e0('0x45')](_0x512c8b[_0x13a406['channel']+_0x35e0('0x46')],handleFindQueue(_0x1db58a[_0x35e0('0x31')]));if(_0x26884c){startRouting(_0x556269,_0x26884c,_0x13a406,_0x512c8b);var _0x55c2fa=(_0x26884c[_0x35e0('0x3b')]||0xa)*0x3e8;var _0x8d075a=(_0x1db58a[_0x35e0('0x3b')]||0x14)*0x3e8;var _0x5b700d,_0x483938;if(_0x55c2fa>_0x8d075a){_0x8d075a=_0x55c2fa;}var _0x38dc2a=seqqueue[_0x35e0('0x47')](_0x55c2fa);_0x38dc2a['id']=_0x556269;_0x38dc2a['atimeout']=_0x55c2fa;_0x38dc2a[_0x35e0('0x48')]=_0x8d075a;_0x38dc2a[_0x35e0('0x28')]=_0x13a406['channel'];_0x512c8b[_0x35e0('0x49')][_0x556269]['on'](_0x35e0('0x4a'),function(){logger[_0x35e0('0x2f')](_0x35e0('0x4b'),_0x556269);stopRouting(_0x556269,_0x26884c,_0x13a406,_0x512c8b);clearTimeout(_0x5b700d);_0x5b700d=undefined;_0x38dc2a[_0x35e0('0x4c')](!![]);if(_0x512c8b[_0x35e0('0x49')][_0x556269]){delete _0x512c8b[_0x35e0('0x49')][_0x556269];}_0x19c1ed['stop']();});_0x512c8b['rules'][_0x556269]['on'](_0x35e0('0x4d'),function(){if(_0x512c8b[_0x35e0('0x49')][_0x556269]){delete _0x512c8b['rules'][_0x556269];}});_0x5b700d=setTimeout(function(){logger[_0x35e0('0x2f')](_0x35e0('0x4e'),_0x556269);endRouting(_0x556269,_0x26884c,_0x13a406,_0x512c8b);clearTimeout(_0x5b700d);_0x38dc2a[_0x35e0('0x4c')](!![]);_0x19c1ed[_0x35e0('0x4f')]();},_0x8d075a);switch(_0x26884c['strategy']){case _0x35e0('0x50'):strategy[_0x35e0('0x50')](_0x38dc2a,_0x26884c,_0x512c8b,_0x13a406);break;default:strategy['beepall'](_0x38dc2a,_0x26884c,_0x512c8b,_0x13a406);}}else{logger['error'](_0x35e0('0x51'),_0x556269,_0x1db58a[_0x35e0('0x31')]);_0x19c1ed[_0x35e0('0x44')]();}}}catch(_0x4ec7c6){console[_0x35e0('0x52')](_0x4ec7c6);logger['error']('[%s][QUEUE]\x20%s',_0x556269,_0x4ec7c6[_0x35e0('0x53')]);_0x19c1ed[_0x35e0('0x44')]();}};}; \ 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 d3624a0..8ffeafe 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 _0xcf76=['hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','push','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','showNotification','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcf76,0x179));var _0x6cf7=function(_0x9f2513,_0x33feff){_0x9f2513=_0x9f2513-0x0;var _0x2b7ea7=_0xcf76[_0x9f2513];return _0x2b7ea7;};'use strict';var _=require(_0x6cf7('0x0'));var uuid=require(_0x6cf7('0x1'));var util=require(_0x6cf7('0x2'));var logger=require(_0x6cf7('0x3'))(_0x6cf7('0x4'));var Agent=function(_0x10235e,_0xc8dfef,_0x5d5758,_0x211411){this[_0x6cf7('0x5')]=uuid['v4']();this[_0x6cf7('0x6')]=_0x10235e;this[_0x6cf7('0x7')]=_0xc8dfef;this[_0x6cf7('0x8')]=_0x5d5758;this[_0x6cf7('0x4')]=_0x211411;this['squeue']['push'](this[_0x6cf7('0x9')][_0x6cf7('0xa')](this),this['handleTimeout'][_0x6cf7('0xa')](this));this[_0x6cf7('0x6')]['on'](_0x6cf7('0xb'),this[_0x6cf7('0xc')][_0x6cf7('0xa')](this));this[_0x6cf7('0x6')]['on'](_0x6cf7('0xd'),this[_0x6cf7('0xe')][_0x6cf7('0xa')](this));};Agent['prototype'][_0x6cf7('0xf')]=function(){this[_0x6cf7('0x6')][_0x6cf7('0xf')](this['handleRun'][_0x6cf7('0xa')](this),this[_0x6cf7('0xc')][_0x6cf7('0xa')](this));};Agent[_0x6cf7('0x10')]['handleDrained']=function(){this[_0x6cf7('0xc')](!![]);};Agent[_0x6cf7('0x10')][_0x6cf7('0x9')]=function(){logger[_0x6cf7('0x11')](_0x6cf7('0x12'),this['squeue']['id'],this[_0x6cf7('0x7')]['id']);if(_[_0x6cf7('0x13')](this[_0x6cf7('0x8')][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']])){logger[_0x6cf7('0x11')](_0x6cf7('0x15'),this[_0x6cf7('0x6')]['id'],this[_0x6cf7('0x7')]['id']);setTimeout(this[_0x6cf7('0xf')][_0x6cf7('0xa')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this['squeue']['id'],this[_0x6cf7('0x8')][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']],this[_0x6cf7('0x6')]['channel'],![])){this[_0x6cf7('0x8')][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']]['busy']=!![];this[_0x6cf7('0x8')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0x6cf7('0x16')](this[_0x6cf7('0x5')],this[_0x6cf7('0x6')]['id'],this[_0x6cf7('0x8')][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']],null,this[_0x6cf7('0x4')]);util[_0x6cf7('0x17')](this[_0x6cf7('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],'RINGING'+(this[_0x6cf7('0x4')]['forcedOwnership']?_0x6cf7('0x18'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x6cf7('0x6')]['id'],this[_0x6cf7('0x7')]['id']);setTimeout(this[_0x6cf7('0xf')]['bind'](this),0x3e8);}}};Agent[_0x6cf7('0x10')]['handleTimeout']=function(_0x1e675a){if(_[_0x6cf7('0x13')](this[_0x6cf7('0x8')][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']])){return logger[_0x6cf7('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6cf7('0x6')]['id'],this[_0x6cf7('0x7')]['id']);}else{logger[_0x6cf7('0x11')](_0x6cf7('0x19'),this[_0x6cf7('0x6')]['id'],this[_0x6cf7('0x7')]['id']);util[_0x6cf7('0x1a')](this[_0x6cf7('0x5')],this['squeue']['id'],this['realtime'][_0x6cf7('0x14')][this['agent']['id']],null,this['routing']);this[_0x6cf7('0x8')][_0x6cf7('0x14')][this['agent']['id']]['busy']=![];this['realtime'][_0x6cf7('0x14')][this[_0x6cf7('0x7')]['id']][_0x6cf7('0x1b')]=undefined;util[_0x6cf7('0x17')](this['squeue']['id'],this['realtime']['agents'][this[_0x6cf7('0x7')]['id']],_0x1e675a?_0x6cf7('0x1c'):_0x6cf7('0x1d'));}if(!_0x1e675a){setTimeout(this[_0x6cf7('0xf')][_0x6cf7('0xa')](this),0x3e8);}};function agent(_0x4d9e88,_0x58d989,_0x125948,_0x201274){return new Agent(_0x4d9e88,_0x58d989,_0x125948,_0x201274);}module[_0x6cf7('0x1e')]=agent; \ No newline at end of file +var _0x2036=['RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','debug','forcedOwnership','isAgentAvailable','realtime','busy','busyQueue','showNotification','writeLog'];(function(_0x8a912d,_0x53c52b){var _0x4fb44b=function(_0xb62428){while(--_0xb62428){_0x8a912d['push'](_0x8a912d['shift']());}};_0x4fb44b(++_0x53c52b);}(_0x2036,0x196));var _0x6203=function(_0x444d90,_0x11c679){_0x444d90=_0x444d90-0x0;var _0x3a8344=_0x2036[_0x444d90];return _0x3a8344;};'use strict';var _=require(_0x6203('0x0'));var uuid=require(_0x6203('0x1'));var util=require(_0x6203('0x2'));var logger=require(_0x6203('0x3'))(_0x6203('0x4'));var Agent=function(_0x4a8df2,_0x499a5f,_0x4cb0d7,_0x31ab76){this[_0x6203('0x5')]=uuid['v4']();this[_0x6203('0x6')]=_0x4a8df2;this['agent']=_0x499a5f;this['realtime']=_0x4cb0d7;this[_0x6203('0x4')]=_0x31ab76;this[_0x6203('0x6')][_0x6203('0x7')](this['handleRun']['bind'](this),this['handleTimeout'][_0x6203('0x8')](this));this['squeue']['on'](_0x6203('0x9'),this[_0x6203('0xa')][_0x6203('0x8')](this));this[_0x6203('0x6')]['on'](_0x6203('0xb'),this[_0x6203('0xc')][_0x6203('0x8')](this));};Agent[_0x6203('0xd')][_0x6203('0x7')]=function(){this[_0x6203('0x6')][_0x6203('0x7')](this['handleRun'][_0x6203('0x8')](this),this[_0x6203('0xa')]['bind'](this));};Agent[_0x6203('0xd')][_0x6203('0xc')]=function(){this[_0x6203('0xa')](!![]);};Agent[_0x6203('0xd')][_0x6203('0xe')]=function(){logger['debug'](_0x6203('0xf'),this['squeue']['id'],this[_0x6203('0x10')]['id']);if(_['isNil'](this['realtime'][_0x6203('0x11')][this['agent']['id']])){logger[_0x6203('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6203('0x6')]['id'],this[_0x6203('0x10')]['id']);setTimeout(this[_0x6203('0x7')][_0x6203('0x8')](this),0x3e8);}else{if(this[_0x6203('0x4')][_0x6203('0x13')]||util[_0x6203('0x14')](this['squeue']['id'],this[_0x6203('0x15')][_0x6203('0x11')][this[_0x6203('0x10')]['id']],this[_0x6203('0x6')]['channel'],![])){this[_0x6203('0x15')]['agents'][this[_0x6203('0x10')]['id']][_0x6203('0x16')]=!![];this[_0x6203('0x15')][_0x6203('0x11')][this[_0x6203('0x10')]['id']][_0x6203('0x17')]=undefined;util[_0x6203('0x18')](this[_0x6203('0x5')],this['squeue']['id'],this[_0x6203('0x15')][_0x6203('0x11')][this['agent']['id']],null,this['routing']);util[_0x6203('0x19')](this['squeue']['id'],this[_0x6203('0x15')][_0x6203('0x11')][this['agent']['id']],_0x6203('0x1a')+(this[_0x6203('0x4')][_0x6203('0x13')]?_0x6203('0x1b'):''));}else{logger[_0x6203('0x12')](_0x6203('0x1c'),this[_0x6203('0x6')]['id'],this[_0x6203('0x10')]['id']);setTimeout(this[_0x6203('0x7')]['bind'](this),0x3e8);}}};Agent[_0x6203('0xd')]['handleTimeout']=function(_0x11c79d){if(_[_0x6203('0x1d')](this['realtime'][_0x6203('0x11')][this[_0x6203('0x10')]['id']])){return logger[_0x6203('0x12')](_0x6203('0x1e'),this[_0x6203('0x6')]['id'],this[_0x6203('0x10')]['id']);}else{logger[_0x6203('0x12')](_0x6203('0x1f'),this[_0x6203('0x6')]['id'],this[_0x6203('0x10')]['id']);util[_0x6203('0x20')](this[_0x6203('0x5')],this[_0x6203('0x6')]['id'],this[_0x6203('0x15')]['agents'][this[_0x6203('0x10')]['id']],null,this[_0x6203('0x4')]);this['realtime']['agents'][this[_0x6203('0x10')]['id']][_0x6203('0x16')]=![];this['realtime'][_0x6203('0x11')][this['agent']['id']][_0x6203('0x17')]=undefined;util['writeLog'](this['squeue']['id'],this[_0x6203('0x15')][_0x6203('0x11')][this['agent']['id']],_0x11c79d?_0x6203('0x21'):_0x6203('0x22'));}if(!_0x11c79d){setTimeout(this[_0x6203('0x7')][_0x6203('0x8')](this),0x3e8);}};function agent(_0x1affca,_0x37268d,_0x37cedf,_0x5cf83c){return new Agent(_0x1affca,_0x37268d,_0x37cedf,_0x5cf83c);}module[_0x6203('0x23')]=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 7c0cf15..dd65ebb 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 _0xfc73=['notificationId','squeue','queue','realtime','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','busyQueue','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0xfc73,0x8d));var _0x3fc7=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xfc73[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x3fc7('0x0'));var uuid=require(_0x3fc7('0x1'));var util=require('./util');var logger=require(_0x3fc7('0x2'))(_0x3fc7('0x3'));var Beepall=function(_0xe51dfd,_0x161492,_0x1d444c,_0x1c4900){this[_0x3fc7('0x4')]=uuid['v4']();this[_0x3fc7('0x5')]=_0xe51dfd;this[_0x3fc7('0x6')]=_0x161492;this[_0x3fc7('0x7')]=_0x1d444c;this[_0x3fc7('0x3')]=_0x1c4900;this[_0x3fc7('0x5')]['push'](this[_0x3fc7('0x8')][_0x3fc7('0x9')](this),this[_0x3fc7('0xa')][_0x3fc7('0x9')](this));this[_0x3fc7('0x5')]['on']('timeout',this['handleTimeout'][_0x3fc7('0x9')](this));this[_0x3fc7('0x5')]['on'](_0x3fc7('0xb'),this[_0x3fc7('0xc')][_0x3fc7('0x9')](this));};Beepall[_0x3fc7('0xd')]['push']=function(){this['squeue'][_0x3fc7('0xe')](this['handleRun'][_0x3fc7('0x9')](this),this[_0x3fc7('0xa')][_0x3fc7('0x9')](this));};Beepall[_0x3fc7('0xd')]['handleDrained']=function(){this[_0x3fc7('0xa')](!![]);};Beepall[_0x3fc7('0xd')][_0x3fc7('0x8')]=function(){var _0x34db32=!![];if(!_[_0x3fc7('0xf')](this[_0x3fc7('0x6')])&&!_[_0x3fc7('0xf')](this[_0x3fc7('0x6')][_0x3fc7('0x10')])&&this[_0x3fc7('0x6')][_0x3fc7('0x10')][_0x3fc7('0x11')]>0x0){for(var _0x10a0d3=0x0,_0x709a50;_0x10a0d30x0){for(var _0x4f71d8=0x0,_0x11a091;_0x4f71d80x0&&_0x1fc065[_0x4e9d7d+_0x9da1('0x24')]>=_0x1fc065[_0x4e9d7d+'Capacity']){writeLog(_0xacba30,_0x1fc065,_0x4e9d7d[_0x9da1('0x25')]()+_0x9da1('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x36b87a,_0x1d6af5,_0x55cd3d,_0x5c09ed,_0x67dbc8){return sendNotification(!![],_0x36b87a,_0x1d6af5,_0x55cd3d,_0x5c09ed,_0x67dbc8);};exports[_0x9da1('0x27')]=function(_0x5eca5b,_0x27c6e2,_0x5db5c2,_0x5a6f2d,_0x5a59c2){return sendNotification(![],_0x5eca5b,_0x27c6e2,_0x5db5c2,_0x5a6f2d,_0x5a59c2);};exports[_0x9da1('0x28')]=writeLog; \ No newline at end of file +var _0x5fc3=['message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','\x20MAXCAPACITY','writeLog','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','format','user:%s','name','emit','\x20interaction','account','notificationSound','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error'];(function(_0x5ea2f9,_0x320917){var _0x36e586=function(_0x2e79a2){while(--_0x2e79a2){_0x5ea2f9['push'](_0x5ea2f9['shift']());}};_0x36e586(++_0x320917);}(_0x5fc3,0xa8));var _0x35fc=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x5fc3[_0x492af5];return _0x59f529;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var utils=require('../utils');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));config[_0x35fc('0x6')]=_['defaults'](config[_0x35fc('0x6')],{'host':_0x35fc('0x7'),'port':0x18eb});var io=require(_0x35fc('0x8'))(new Redis(config['redis']));function sendNotification(_0x5754be,_0x19a0d1,_0x508b32,_0x16e153,_0x27524f,_0xc72d93){io['to'](util[_0x35fc('0x9')](_0x35fc('0xa'),_0x16e153[_0x35fc('0xb')]))[_0x35fc('0xc')]('user:save',_0x16e153);var _0x1083a9=_0xc72d93||{};var _0x2a1084=_0x508b32['split']('.');var _0x471549={'uniqueid':_0x19a0d1,'channel':_0x2a1084[0x0],'id':_0x2a1084[0x1],'title':_0x2a1084[0x0]+_0x35fc('0xd'),'interactionId':_0x2a1084[0x2],'queue':_0x27524f?_0x27524f['name']:null,'sound':_0x1083a9[_0x35fc('0xe')][_0x35fc('0xf')],'shake':_0x1083a9['account']['notificationShake']};try{if(!_0x1083a9[_0x35fc('0x10')]){_0x1083a9['body']={};}if(_0x27524f){_0x1083a9[_0x35fc('0x10')][_0x35fc('0x11')]=_0x27524f;}else if(_0x1083a9[_0x35fc('0x10')][_0x35fc('0x11')]){delete _0x1083a9[_0x35fc('0x10')]['queue'];}_0x471549['msg']=utils['getMustacheRender'](_0x1083a9['account'][_0x35fc('0x12')],_0x1083a9);}catch(_0x229d56){_0x471549[_0x35fc('0x13')]=_0x35fc('0x14');logger[_0x35fc('0x15')](util[_0x35fc('0x9')]('[%s][QUEUE]\x20%s',_0x19a0d1,_0x229d56[_0x35fc('0x16')]));}io['to'](util[_0x35fc('0x9')]('user:%s',_0x16e153[_0x35fc('0xb')]))[_0x35fc('0xc')](util[_0x35fc('0x9')]('notification:%s',_0x5754be?_0x35fc('0x17'):_0x35fc('0x18')),_0x471549);}function writeLog(_0x465eb3,_0x488234,_0x402cff){return logger[_0x35fc('0x19')](util[_0x35fc('0x9')](_0x35fc('0x1a'),_0x465eb3,_0x488234[_0x35fc('0xb')],_0x402cff));}exports[_0x35fc('0x1b')]=function(_0x155016,_0x3b05b0,_0x2405e8,_0x427eae){if(_0x3b05b0['busy']){writeLog(_0x155016,_0x3b05b0,_0x35fc('0x1c'));return![];}if(!_0x3b05b0[_0x35fc('0x1d')]){writeLog(_0x155016,_0x3b05b0,_0x35fc('0x1e'));return![];}if(_0x3b05b0[_0x2405e8+_0x35fc('0x1f')]){writeLog(_0x155016,_0x3b05b0,_0x35fc('0x20'));return![];}if(_0x427eae&&_0x3b05b0['hasOwnProperty'](_0x2405e8+_0x35fc('0x21'))&&_0x3b05b0[_0x35fc('0x22')](_0x2405e8+'CurrentCapacity')){if(_0x3b05b0[_0x2405e8+_0x35fc('0x21')]>0x0&&_0x3b05b0[_0x2405e8+_0x35fc('0x23')]>=_0x3b05b0[_0x2405e8+_0x35fc('0x21')]){writeLog(_0x155016,_0x3b05b0,_0x2405e8['toUpperCase']()+_0x35fc('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x1bf180,_0xdfab9f,_0x5cb986,_0x519264,_0x47774c){return sendNotification(!![],_0x1bf180,_0xdfab9f,_0x5cb986,_0x519264,_0x47774c);};exports['hideNotification']=function(_0x274208,_0x1a5d92,_0x57001c,_0x26b7cb,_0x645eac){return sendNotification(![],_0x274208,_0x1a5d92,_0x57001c,_0x26b7cb,_0x645eac);};exports[_0x35fc('0x25')]=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 da9ecdf..5792a9c 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 _0x642a=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x1b664d,_0x1d8695){var _0x43af6b=function(_0x7fe8b2){while(--_0x7fe8b2){_0x1b664d['push'](_0x1b664d['shift']());}};_0x43af6b(++_0x1d8695);}(_0x642a,0x1f0));var _0xa642=function(_0x43f55c,_0x8ec6b0){_0x43f55c=_0x43f55c-0x0;var _0xbff2b9=_0x642a[_0x43f55c];return _0xbff2b9;};'use strict';var schema=require(_0xa642('0x0'));var sh=require(_0xa642('0x1'));var _=require(_0xa642('0x2'));var utils=require(_0xa642('0x3'));var logger=require(_0xa642('0x4'))(_0xa642('0x5'));var system=schema({'command':{'type':_0xa642('0x6'),'required':!![],'message':_0xa642('0x7')}});exports[_0xa642('0x8')]=function(_0x430814,_0x43c413){return function(_0x3e9ad9){try{var _0x11a869={'command':_0x43c413[0x0]};var _0xe6f648=system[_0xa642('0x0')](_0x11a869,{'typecast':!![]});if(_0xe6f648['length']){logger[_0xa642('0x9')](_0xa642('0xa'),_0x430814,_[_0xa642('0xb')](_0xe6f648,_0xa642('0xc'))['join'](',\x20'));logger[_0xa642('0xd')](_0xa642('0xe'),_0x430814);_0x3e9ad9[_0xa642('0xf')]();}else{var _0x23fc1d=this;var _0x5f4f35=utils[_0xa642('0x10')](_0x43c413[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x430814,_0x5f4f35);sh['exec'](_[_0xa642('0x11')](_0x5f4f35),function(_0xb05151,_0x578ee8){logger[_0xa642('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x430814,_0xb05151);if(_0xb05151==0x0){var _0x67c174=_0x578ee8[_0xa642('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x43c413[0x1])||_[_0xa642('0x13')](_0x43c413[0x1])){logger[_0xa642('0xd')](_0xa642('0x14'),_0x430814);_0x23fc1d[_0xa642('0x15')][_0x43c413[0x1]]=_0x67c174;}else{logger[_0xa642('0xd')](_0xa642('0x16'),_0x430814,_0x43c413[0x1],_0x67c174);_0x23fc1d['body'][_0x43c413[0x1]]=_0x67c174;}}_0x3e9ad9[_0xa642('0xf')]();});}}catch(_0x38241c){logger[_0xa642('0x9')](_0xa642('0xa'),_0x430814,_[_0xa642('0x17')](_0x38241c)?JSON[_0xa642('0x18')](_0x38241c):_0x38241c);logger[_0xa642('0xd')](_0xa642('0xe'),_0x430814);_0x3e9ad9['next']();}};}; \ No newline at end of file +var _0xd2e6=['message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','validate','lodash','./utils','routing','string','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x454739,_0x23bd33){var _0x6155cb=function(_0x4ce772){while(--_0x4ce772){_0x454739['push'](_0x454739['shift']());}};_0x6155cb(++_0x23bd33);}(_0xd2e6,0x195));var _0x6d2e=function(_0x279511,_0x1e6756){_0x279511=_0x279511-0x0;var _0x4dee44=_0xd2e6[_0x279511];return _0x4dee44;};'use strict';var schema=require(_0x6d2e('0x0'));var sh=require('shelljs');var _=require(_0x6d2e('0x1'));var utils=require(_0x6d2e('0x2'));var logger=require('../../../../config/logger')(_0x6d2e('0x3'));var system=schema({'command':{'type':_0x6d2e('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x191107,_0x2fddf0){return function(_0x29b6e6){try{var _0x596c26={'command':_0x2fddf0[0x0]};var _0x3e7f0f=system['validate'](_0x596c26,{'typecast':!![]});if(_0x3e7f0f[_0x6d2e('0x5')]){logger[_0x6d2e('0x6')](_0x6d2e('0x7'),_0x191107,_[_0x6d2e('0x8')](_0x3e7f0f,_0x6d2e('0x9'))[_0x6d2e('0xa')](',\x20'));logger['info'](_0x6d2e('0xb'),_0x191107);_0x29b6e6[_0x6d2e('0xc')]();}else{var _0xbddaa5=this;var _0x1e967b=utils[_0x6d2e('0xd')](_0x2fddf0[0x0],this);logger[_0x6d2e('0xe')](_0x6d2e('0xf'),_0x191107,_0x1e967b);sh[_0x6d2e('0x10')](_[_0x6d2e('0x11')](_0x1e967b),function(_0x304b08,_0x417e5f){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x191107,_0x304b08);if(_0x304b08==0x0){var _0x56d7cf=_0x417e5f[_0x6d2e('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x2fddf0[0x1])||_[_0x6d2e('0x13')](_0x2fddf0[0x1])){logger[_0x6d2e('0xe')](_0x6d2e('0x14'),_0x191107);_0xbddaa5[_0x6d2e('0x15')][_0x2fddf0[0x1]]=_0x56d7cf;}else{logger[_0x6d2e('0xe')](_0x6d2e('0x16'),_0x191107,_0x2fddf0[0x1],_0x56d7cf);_0xbddaa5[_0x6d2e('0x15')][_0x2fddf0[0x1]]=_0x56d7cf;}}_0x29b6e6['next']();});}}catch(_0x4294d2){logger[_0x6d2e('0x6')]('[%s][SYSTEM]\x20%s',_0x191107,_['isObject'](_0x4294d2)?JSON['stringify'](_0x4294d2):_0x4294d2);logger[_0x6d2e('0xe')](_0x6d2e('0xb'),_0x191107);_0x29b6e6['next']();}};}; \ 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 6f02fdb..12f4ca6 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 _0x5639=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','[%s][TAG]\x20%s','isObject','validate','lodash'];(function(_0x37ad67,_0x55e455){var _0x1dafbd=function(_0x5e487b){while(--_0x5e487b){_0x37ad67['push'](_0x37ad67['shift']());}};_0x1dafbd(++_0x55e455);}(_0x5639,0x178));var _0x9563=function(_0x165592,_0x381631){_0x165592=_0x165592-0x0;var _0x4ac4a8=_0x5639[_0x165592];return _0x4ac4a8;};'use strict';var schema=require(_0x9563('0x0'));var _=require(_0x9563('0x1'));var rpc={'chatInteraction':require(_0x9563('0x2')),'openchannelInteraction':require(_0x9563('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x9563('0x4')),'faxInteraction':require(_0x9563('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x9563('0x6'))(_0x9563('0x7'));var tag=schema({'tag':{'type':_0x9563('0x8'),'required':!![],'message':_0x9563('0x9')}});exports['consequence']=function(_0x301c33,_0x52d07e,_0x16f375,_0x7dc1cb){return function(_0x2f3f52){try{var _0x250816={'tag':_0x52d07e[0x0]};var _0x475d18=tag[_0x9563('0x0')](_0x250816,{'typecast':!![]});if(_0x475d18[_0x9563('0xa')]){logger[_0x9563('0xb')]('[%s][TAG]\x20%s',_0x301c33,_['map'](_0x475d18,_0x9563('0xc'))[_0x9563('0xd')](',\x20'));logger['info'](_0x9563('0xe'),_0x301c33);_0x2f3f52[_0x9563('0xf')]();}else{var _0x5ee734={'ids':[_0x52d07e[0x0]]};if(rpc[_0x7dc1cb[_0x9563('0x10')]+_0x9563('0x11')]){rpc[_0x7dc1cb[_0x9563('0x10')]+_0x9563('0x11')]['addTags'](_0x7dc1cb[_0x9563('0x12')]['id'],_0x5ee734)[_0x9563('0x13')](function(_0x399f2a){logger[_0x9563('0x14')](_0x9563('0x15'),_0x301c33,_0x52d07e[0x1],_0x7dc1cb[_0x9563('0x10')],_0x7dc1cb['interaction']['id']);})[_0x9563('0x16')](function(_0x3cde93){logger[_0x9563('0xb')]('[%s][TAG]\x20%s',_0x301c33,JSON[_0x9563('0x17')](_0x3cde93));logger[_0x9563('0x14')](_0x9563('0xe'),_0x301c33);})[_0x9563('0x18')](function(){_0x2f3f52[_0x9563('0xf')]();});}}}catch(_0x158fda){logger[_0x9563('0xb')](_0x9563('0x19'),_0x301c33,_[_0x9563('0x1a')](_0x158fda)?JSON[_0x9563('0x17')](_0x158fda):_0x158fda);logger[_0x9563('0x14')](_0x9563('0xe'),_0x301c33);_0x2f3f52[_0x9563('0xf')]();}};}; \ No newline at end of file +var _0x3a8b=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x51fc7c,_0x475586){var _0x1482a7=function(_0x1a3f5f){while(--_0x1a3f5f){_0x51fc7c['push'](_0x51fc7c['shift']());}};_0x1482a7(++_0x475586);}(_0x3a8b,0x141));var _0xb3a8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x3a8b[_0x4a53d];return _0x27410e;};'use strict';var schema=require(_0xb3a8('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xb3a8('0x1')),'openchannelInteraction':require(_0xb3a8('0x2')),'smsInteraction':require(_0xb3a8('0x3')),'mailInteraction':require(_0xb3a8('0x4')),'faxInteraction':require(_0xb3a8('0x5')),'whatsappInteraction':require(_0xb3a8('0x6'))};var logger=require(_0xb3a8('0x7'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0xb3a8('0x8')}});exports[_0xb3a8('0x9')]=function(_0x3f7224,_0x4822a1,_0x5e2b53,_0x55342b){return function(_0x298ed9){try{var _0x49614e={'tag':_0x4822a1[0x0]};var _0x571cec=tag['validate'](_0x49614e,{'typecast':!![]});if(_0x571cec[_0xb3a8('0xa')]){logger['error'](_0xb3a8('0xb'),_0x3f7224,_[_0xb3a8('0xc')](_0x571cec,_0xb3a8('0xd'))['join'](',\x20'));logger[_0xb3a8('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3f7224);_0x298ed9[_0xb3a8('0xf')]();}else{var _0x50681e={'ids':[_0x4822a1[0x0]]};if(rpc[_0x55342b[_0xb3a8('0x10')]+_0xb3a8('0x11')]){rpc[_0x55342b[_0xb3a8('0x10')]+_0xb3a8('0x11')][_0xb3a8('0x12')](_0x55342b[_0xb3a8('0x13')]['id'],_0x50681e)['then'](function(_0xe2fc59){logger[_0xb3a8('0xe')](_0xb3a8('0x14'),_0x3f7224,_0x4822a1[0x1],_0x55342b['channel'],_0x55342b[_0xb3a8('0x13')]['id']);})[_0xb3a8('0x15')](function(_0xb1575c){logger[_0xb3a8('0x16')](_0xb3a8('0xb'),_0x3f7224,JSON[_0xb3a8('0x17')](_0xb1575c));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3f7224);})[_0xb3a8('0x18')](function(){_0x298ed9[_0xb3a8('0xf')]();});}}}catch(_0x106528){logger['error'](_0xb3a8('0xb'),_0x3f7224,_[_0xb3a8('0x19')](_0x106528)?JSON[_0xb3a8('0x17')](_0x106528):_0x106528);logger[_0xb3a8('0xe')](_0xb3a8('0x1a'),_0x3f7224);_0x298ed9[_0xb3a8('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index bb9f620..609c2b3 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf429=['catch','error','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','routing','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','method','login','params','stringify','utf8','POST','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf429,0x14f));var _0x9f42=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xf429[_0x1b4b23];return _0x2a325b;};'use strict';var rp=require('request-promise');var logger=require(_0x9f42('0x0'))(_0x9f42('0x1'));var _=require(_0x9f42('0x2'));var arr=[];exports[_0x9f42('0x3')]=function(_0x5b1ec6,_0x65d8b3){return function(_0x552a42){var _0x5a53e8=_0x65d8b3[0xa];var _0x504f91=_0x65d8b3[0xb];var _0xa238d0=_0x65d8b3[0xc];var _0x473b66=_0x65d8b3[0xd];var _0x23a073=_0x65d8b3[0xe];var _0x1083df=_0x65d8b3[0xf][_0x9f42('0x4')](/\n/g,'\x20-\x20');var _0x1dc9d3=_0x65d8b3[0x10][_0x9f42('0x4')](/\n/g,'\x20');if(!arr[_0x9f42('0x5')](_0x504f91)){arr[_0x9f42('0x6')](_0x504f91);var _0x4ac254=_0x65d8b3[0x3];var _0x36647c=_0x65d8b3[0x4];var _0xf845e3=_0x65d8b3[0x1];var _0x1b29f8=_0x65d8b3[0x0];var _0x234f80={};_0x234f80[_0x9f42('0x7')]=_0x65d8b3[0x8]+_0x9f42('0x8')+_0xa238d0+'|'+_0x5a53e8+'|'+_0x473b66+'|'+_0x504f91+'|'+_0x23a073;_0x234f80[_0x9f42('0x9')]=_0x65d8b3[0x7]+_0x9f42('0x8')+_0xa238d0+'|'+_0x5a53e8+'|'+_0x473b66+'|'+_0x504f91+'|'+_0x23a073+'|'+_0x1083df+'|'+_0x1dc9d3;_0x234f80['title']=_0x65d8b3[0x9];var _0x12cbcb={};_0x12cbcb[_0x9f42('0xa')]='2.0';_0x12cbcb[_0x9f42('0xb')]=_0x9f42('0xc');var _0x550fc4=[];_0x550fc4['push'](_0x65d8b3[0x2]);_0x550fc4[_0x9f42('0x6')](_0x65d8b3[0x5]);_0x550fc4['push'](_0x65d8b3[0x6]);_0x12cbcb[_0x9f42('0xd')]=_0x550fc4;_0x12cbcb['id']=0x1;var _0x5aec4=JSON[_0x9f42('0xe')](_0x12cbcb);var _0x433a09={'encoding':_0x9f42('0xf'),'method':_0x9f42('0x10'),'timeout':0x2710,'url':_0x4ac254,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5aec4};return rp(_0x433a09)[_0x9f42('0x11')](function(_0x50e726){const _0x301c4e=JSON[_0x9f42('0x12')](_0x50e726);if(!_0x301c4e['result'][_0x9f42('0x13')]){throw new Error(_0x9f42('0x14'));}var _0x38766a=_0x504f91;var _0x3dd062=_0x9f42('0x15')+_0xf845e3+_0x9f42('0x16')+_0x1b29f8+_0x9f42('0x17')+_0x38766a+_0x9f42('0x18')+JSON[_0x9f42('0xe')](_0x234f80);var _0x5f5ced=_0x36647c+'?'+_0x3dd062;return rp(_0x5f5ced);})[_0x9f42('0x11')](function(_0x36ff04){logger[_0x9f42('0x19')](_0x9f42('0x1a'),_0x5b1ec6,_0x36ff04);_0x552a42[_0x9f42('0x1b')]();})[_0x9f42('0x1c')](function(_0x14beb2){logger[_0x9f42('0x1d')](_0x9f42('0x1e'),_0x5b1ec6,_[_0x9f42('0x1f')](_0x14beb2)?JSON['stringify'](_0x14beb2):_0x14beb2);_0x552a42[_0x9f42('0x1b')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5b1ec6);_0x552a42[_0x9f42('0x20')]();}};}; \ No newline at end of file +var _0x1b60=['catch','error','[%s][TVOX]\x20%s','isObject','stop','info','next','request-promise','../../../../config/logger','routing','replace','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','stringify','utf8','POST','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId='];(function(_0x243417,_0x5cbe56){var _0x4b072f=function(_0x97c915){while(--_0x97c915){_0x243417['push'](_0x243417['shift']());}};_0x4b072f(++_0x5cbe56);}(_0x1b60,0x16f));var _0x01b6=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0x1b60[_0x3f9ac2];return _0xe6a436;};'use strict';var rp=require(_0x01b6('0x0'));var logger=require(_0x01b6('0x1'))(_0x01b6('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x3b1a0e,_0x240a1b){return function(_0x502154){var _0x29d36c=_0x240a1b[0xa];var _0x24a3f5=_0x240a1b[0xb];var _0x194587=_0x240a1b[0xc];var _0x22868a=_0x240a1b[0xd];var _0x5be0b2=_0x240a1b[0xe];var _0x2f7960=_0x240a1b[0xf][_0x01b6('0x3')](/\n/g,'\x20-\x20');var _0x1290f4=_0x240a1b[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x24a3f5)){arr[_0x01b6('0x4')](_0x24a3f5);var _0x19604c=_0x240a1b[0x3];var _0x2cfe7b=_0x240a1b[0x4];var _0x3ca9f1=_0x240a1b[0x1];var _0x40c8f2=_0x240a1b[0x0];var _0x106754={};_0x106754[_0x01b6('0x5')]=_0x240a1b[0x8]+_0x01b6('0x6')+_0x194587+'|'+_0x29d36c+'|'+_0x22868a+'|'+_0x24a3f5+'|'+_0x5be0b2;_0x106754[_0x01b6('0x7')]=_0x240a1b[0x7]+_0x01b6('0x6')+_0x194587+'|'+_0x29d36c+'|'+_0x22868a+'|'+_0x24a3f5+'|'+_0x5be0b2+'|'+_0x2f7960+'|'+_0x1290f4;_0x106754[_0x01b6('0x8')]=_0x240a1b[0x9];var _0x1a64e1={};_0x1a64e1['jsonrpc']=_0x01b6('0x9');_0x1a64e1[_0x01b6('0xa')]=_0x01b6('0xb');var _0xaefa5a=[];_0xaefa5a[_0x01b6('0x4')](_0x240a1b[0x2]);_0xaefa5a[_0x01b6('0x4')](_0x240a1b[0x5]);_0xaefa5a[_0x01b6('0x4')](_0x240a1b[0x6]);_0x1a64e1[_0x01b6('0xc')]=_0xaefa5a;_0x1a64e1['id']=0x1;var _0x53d842=JSON[_0x01b6('0xd')](_0x1a64e1);var _0x47432a={'encoding':_0x01b6('0xe'),'method':_0x01b6('0xf'),'timeout':0x2710,'url':_0x19604c,'headers':{'Content-Type':'application/json-rpc'},'body':_0x53d842};return rp(_0x47432a)['then'](function(_0x259ea2){const _0x47e281=JSON[_0x01b6('0x10')](_0x259ea2);if(!_0x47e281[_0x01b6('0x11')][_0x01b6('0x12')]){throw new Error(_0x01b6('0x13'));}var _0x123fd8=_0x24a3f5;var _0x570fdc=_0x01b6('0x14')+_0x3ca9f1+_0x01b6('0x15')+_0x40c8f2+_0x01b6('0x16')+_0x123fd8+'&data='+JSON['stringify'](_0x106754);var _0x2a6a7e=_0x2cfe7b+'?'+_0x570fdc;return rp(_0x2a6a7e);})['then'](function(_0x2a1160){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x3b1a0e,_0x2a1160);_0x502154['stop']();})[_0x01b6('0x17')](function(_0x17da42){logger[_0x01b6('0x18')](_0x01b6('0x19'),_0x3b1a0e,_[_0x01b6('0x1a')](_0x17da42)?JSON[_0x01b6('0xd')](_0x17da42):_0x17da42);_0x502154[_0x01b6('0x1b')]();});}else{logger[_0x01b6('0x1c')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3b1a0e);_0x502154[_0x01b6('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 2734db8..6d847e1 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x152461,_0x3d9cd5){var _0x283dcc=function(_0x270b1b){while(--_0x270b1b){_0x152461['push'](_0x152461['shift']());}};_0x283dcc(++_0x3d9cd5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x9d139,_0x3f3c2f){var _0x58d5b1=function(_0x1520e3){while(--_0x1520e3){_0x9d139['push'](_0x9d139['shift']());}};_0x58d5b1(++_0x3f3c2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 abd7959..342b8e9 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 _0x8164=['rules','channel','message','applications','isArray','length','existsSync','app','.js','autoreply','mail','push','slice','join','dialogflow','split','dialogflowv2','appdata','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','interaction','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','info','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','log','lodash','util','path','bluebird','uuid','../../../config/environment','routing','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','interval','listen'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x8164,0x170));var _0x4816=function(_0x35335f,_0x4861ff){_0x35335f=_0x35335f-0x0;var _0x4a9103=_0x8164[_0x35335f];return _0x4a9103;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var path=require(_0x4816('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x4816('0x3'));var uuid=require(_0x4816('0x4'));var utils=require('./applications/utils');var config=require(_0x4816('0x5'));var logger=require('../../../config/logger')(_0x4816('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x4816('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4816('0x8'))};var RuleEngine=require(_0x4816('0x9'));function getId(_0x170e7a,_0x383974,_0x2421e1){return util[_0x4816('0xa')](_0x4816('0xb'),_0x170e7a,_0x383974||0x0,_0x2421e1||0x0);}function getIntervals(_0x1e0118,_0x23d125){var _0x520153=[];if(!_[_0x4816('0xc')](_0x23d125['IntervalId'])&&!_[_0x4816('0xc')](_0x1e0118[_0x23d125[_0x4816('0xd')]])&&!_['isNil'](_0x1e0118[_0x23d125[_0x4816('0xd')]]['Intervals'])){_0x520153=_['map'](_0x1e0118[_0x23d125[_0x4816('0xd')]]['Intervals'],'interval');}else if(!_[_0x4816('0xc')](_0x23d125['interval'])){_0x520153=[_0x23d125[_0x4816('0xe')]];}return _0x520153;}exports[_0x4816('0xf')]=function(_0x13a685){_0x13a685[_0x4816('0x10')]={};return new BPromise(function(_0x42fc52,_0x248163){var _0x1eb683={'Start':function(_0x2a58b7){var _0x45c006=this;return new Promise(function(_0x21354c,_0x1ce1fb){if(_0x2a58b7){try{var _0x4678a9=[];var _0x6119f=getId(_0x2a58b7[_0x4816('0x11')],_0x2a58b7[_0x4816('0x12')]?_0x2a58b7[_0x4816('0x12')]['id']:0x0,_0x2a58b7['interaction']?_0x2a58b7['interaction']['id']:0x0);if(_0x2a58b7[_0x4816('0x13')]&&_[_0x4816('0x14')](_0x2a58b7[_0x4816('0x13')])&&_0x2a58b7[_0x4816('0x13')][_0x4816('0x15')]){for(var _0x37effd=0x0;_0x37effd<_0x2a58b7[_0x4816('0x13')][_0x4816('0x15')];_0x37effd+=0x1){var _0x3df423=_0x2a58b7['applications'][_0x37effd];if(fs[_0x4816('0x16')](path['join'](__dirname,'applications',_0x3df423[_0x4816('0x17')]+_0x4816('0x18')))){var _0x5de184=[];switch(_0x3df423[_0x4816('0x17')]['toLowerCase']()){case _0x4816('0x19'):var _0x41d7f0=_0x3df423['appdata']['split'](',');if(_0x2a58b7[_0x4816('0x11')]===_0x4816('0x1a')){_0x5de184[_0x4816('0x1b')](_0x41d7f0[0x0]);_0x5de184['push'](_0x41d7f0[0x1]);_0x5de184[_0x4816('0x1b')](_0x41d7f0[_0x4816('0x1c')](0x2,_0x41d7f0[_0x4816('0x15')])[_0x4816('0x1d')](','));}else{_0x5de184['push'](_0x41d7f0[0x0]);_0x5de184['push'](_0x41d7f0[_0x4816('0x1c')](0x1,_0x41d7f0[_0x4816('0x15')])['join'](','));}break;case _0x4816('0x1e'):var _0x4f9386=_0x3df423['appdata'][_0x4816('0x1f')](',');_0x5de184[_0x4816('0x1b')](_0x4f9386[0x0]);_0x5de184[_0x4816('0x1b')](_0x4f9386[0x1]);_0x5de184['push'](_0x4f9386[_0x4816('0x1c')](0x2,_0x4f9386['length'])[_0x4816('0x1d')](','));break;case _0x4816('0x20'):var _0x49c337=_0x3df423[_0x4816('0x21')][_0x4816('0x1f')](',');_0x5de184[_0x4816('0x1b')](_0x49c337[0x0]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x1]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x2]);_0x5de184[_0x4816('0x1b')](_0x49c337[0x3]);_0x5de184[_0x4816('0x1b')](_0x49c337[_0x4816('0x1c')](0x4,_0x49c337[_0x4816('0x15')])['join'](','));break;case _0x4816('0x22'):var _0x902962=_0x3df423['appdata']['split'](',');_0x5de184[_0x4816('0x1b')](_0x902962[0x0]);_0x5de184[_0x4816('0x1b')](_0x902962[0x1]);_0x5de184[_0x4816('0x1b')](_0x902962[0x2]);_0x5de184[_0x4816('0x1b')](_0x902962[0x3]);_0x5de184[_0x4816('0x1b')](_0x902962['slice'](0x4,_0x902962['length'])['join'](','));break;case _0x4816('0x12'):_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x21')]);break;case _0x4816('0x23'):_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x24')]);_0x5de184['push'](_0x3df423[_0x4816('0x21')]);break;case'tvox':var _0xc92865=utils[_0x4816('0x25')](_0x2a58b7[_0x4816('0x26')][_0x4816('0x27')],_0x2a58b7);var _0x192476=_0x3df423['appdata'][_0x4816('0x1f')](',');_0x5de184['push'](_0x192476[0x0]);_0x5de184['push'](_0x192476[0x1]);_0x5de184[_0x4816('0x1b')](_0x192476[0x2]);_0x5de184['push'](_0x192476[0x3]);_0x5de184['push'](_0x192476[0x4]);_0x5de184['push'](_0x192476[0x5]);_0x5de184['push'](_0x192476[0x6]);_0x5de184[_0x4816('0x1b')](_0x192476[0x7]);_0x5de184[_0x4816('0x1b')](_0x192476[0x8]);_0x5de184['push'](_0x192476[0x9]);_0x5de184[_0x4816('0x1b')](_0x192476[0xa]);_0x5de184[_0x4816('0x1b')](_0x2a58b7['interaction']['id']);_0x5de184[_0x4816('0x1b')](_0x2a58b7[_0x4816('0x12')]['id']);_0x5de184[_0x4816('0x1b')](_0x3df423[_0x4816('0x28')]);_0x5de184['push'](_0x2a58b7[_0x4816('0x29')][_0x4816('0x2a')]);_0x5de184[_0x4816('0x1b')](_0x2a58b7[_0x4816('0x2b')][_0x4816('0x2b')]);_0x5de184[_0x4816('0x1b')](_0xc92865);break;default:_0x5de184=_[_0x4816('0xc')](_0x3df423[_0x4816('0x21')])?[]:_0x3df423[_0x4816('0x21')][_0x4816('0x1f')](',');}var _0xcbded0={'id':util[_0x4816('0xa')](_0x4816('0x2c'),_0x6119f,_0x3df423['id'],_0x3df423['app']),'condition':require(_0x4816('0x2d'))[_0x4816('0x2e')](_0x6119f,getIntervals(_0x13a685[_0x4816('0x2f')],_0x3df423),_0x13a685),'consequence':require(_0x4816('0x30')+_0x3df423[_0x4816('0x17')])[_0x4816('0x31')](_0x6119f,_0x5de184,_0x13a685,_0x2a58b7),'p':_0x3df423[_0x4816('0x32')]||0x0};logger['info'](_0x4816('0x33'),_0xcbded0['id'],'on\x20interval',getIntervals(_0x13a685['intervals'],_0x3df423)[_0x4816('0x1d')](_0x4816('0x34')));_0x4678a9['push'](_0xcbded0);}else{logger[_0x4816('0x35')](_0x4816('0x36'),path[_0x4816('0x1d')](__dirname,'applications',_0x3df423[_0x4816('0x17')]+_0x4816('0x18')));}}_0x13a685[_0x4816('0x10')][_0x6119f]=new RuleEngine(_0x4678a9);_0x13a685[_0x4816('0x10')][_0x6119f][_0x4816('0x37')](_0x2a58b7,function(_0x39c713){logger['info'](_0x4816('0x38'),JSON['stringify'](_0x39c713['matchPath']));if(_0x13a685['rules'][_0x6119f]){_0x13a685[_0x4816('0x10')][_0x6119f][_0x4816('0x39')](_0x4816('0x3a'));}});return _0x21354c({'code':0xc8,'message':_0x2a58b7});}else{logger[_0x4816('0x3b')](_0x4816('0x3c'));return _0x21354c({'code':0xc8,'message':_0x2a58b7});}}catch(_0x22d8d3){logger[_0x4816('0x35')](_0x22d8d3[_0x4816('0x3d')]);return _0x1ce1fb(_0x45c006[_0x4816('0x35')](0x1f4,_0x22d8d3));}}return _0x1ce1fb(_0x4816('0x3e'));});},'AcceptMessage':function(_0x5e24bf){var _0x4ffae3=this;return new Promise(function(_0x258f5f,_0x374d25){if(_0x5e24bf[_0x4816('0x3f')]&&_0x5e24bf[_0x4816('0x3f')]['id']){if(_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']]){_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']]['busy']=![];_0x13a685[_0x4816('0x40')][_0x5e24bf[_0x4816('0x3f')]['id']][_0x4816('0x41')]=undefined;}}if(_0x5e24bf['message']&&_0x5e24bf['message']['id']){try{var _0x2ad19b=getId(_0x5e24bf[_0x4816('0x11')],_0x5e24bf[_0x4816('0x12')]?_0x5e24bf['message']['id']:0x0,_0x5e24bf[_0x4816('0x29')]?_0x5e24bf[_0x4816('0x29')]['id']:0x0);if(_0x13a685[_0x4816('0x10')][_0x2ad19b]){_0x13a685[_0x4816('0x10')][_0x2ad19b][_0x4816('0x39')](_0x4816('0x42'));if(rpc[_0x5e24bf[_0x4816('0x11')]+'QueueReport']){rpc[_0x5e24bf[_0x4816('0x11')]+_0x4816('0x43')][_0x4816('0x44')](_0x2ad19b,{'UserId':_0x5e24bf[_0x4816('0x12')][_0x4816('0x45')]})[_0x4816('0x46')](function(_0x309778){logger[_0x4816('0x35')](_0x4816('0x47'));});}}return _0x258f5f({'code':0xc8,'message':_0x5e24bf});}catch(_0x443d0d){logger[_0x4816('0x35')](_0x443d0d[_0x4816('0x3d')]);return _0x374d25(_0x4ffae3[_0x4816('0x35')](0x1f4,_0x443d0d));}}logger[_0x4816('0x35')](_0x4816('0x48'));return _0x374d25(_0x4ffae3[_0x4816('0x35')](0x1f4,_0x4816('0x48')));});},'RejectMessage':function(_0x11272b){var _0x2e619f=this;return new Promise(function(_0x56321c,_0x1702bf){if(_0x11272b[_0x4816('0x3f')]&&_0x11272b['agent']['id']){try{if(_0x13a685[_0x4816('0x40')][_0x11272b[_0x4816('0x3f')]['id']]){_0x13a685['agents'][_0x11272b[_0x4816('0x3f')]['id']][_0x4816('0x49')]=![];_0x13a685[_0x4816('0x40')][_0x11272b[_0x4816('0x3f')]['id']][_0x4816('0x41')]=undefined;}return _0x56321c({'code':0xc8,'message':_0x11272b});}catch(_0x3f6bf2){logger[_0x4816('0x35')](_0x3f6bf2[_0x4816('0x3d')]);return _0x1702bf(_0x2e619f[_0x4816('0x35')](0x1f4,_0x3f6bf2));}}logger[_0x4816('0x35')]('message\x20is\x20empty');return _0x1702bf(_0x2e619f[_0x4816('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x440ba5){var _0x199363=this;return new Promise(function(_0x57d72e,_0x157ee3){if(_0x440ba5[_0x4816('0x11')]&&_0x440ba5[_0x4816('0x29')]&&_0x440ba5[_0x4816('0x29')]['id']){try{var _0x170c23=getId(_0x440ba5['channel'],_0x440ba5[_0x4816('0x12')]?_0x440ba5[_0x4816('0x12')]['id']:0x0,_0x440ba5[_0x4816('0x29')]?_0x440ba5[_0x4816('0x29')]['id']:0x0);if(_0x13a685[_0x4816('0x10')][_0x170c23]){_0x13a685[_0x4816('0x10')][_0x170c23]['emit'](_0x4816('0x42'));}return _0x57d72e({'code':0xc8,'message':_0x440ba5});}catch(_0x43c287){logger[_0x4816('0x35')](_0x43c287['stack']);return _0x157ee3(_0x199363[_0x4816('0x35')](0x1f4,_0x43c287));}}logger[_0x4816('0x35')](_0x4816('0x48'));return _0x157ee3(_0x199363['error'](0x1f4,_0x4816('0x48')));});},'AgentCapacity':function(_0x1f790b){var _0xa67f45=this;return new Promise(function(_0xfb9e4a,_0x56d223){if(_0x13a685[_0x4816('0x40')][_0x4816('0x4a')](_0x1f790b['id'])){for(var _0x5210d2 in _0x1f790b['capacity']){if(_0x1f790b['capacity'][_0x4816('0x4a')](_0x5210d2)){if(_0x13a685[_0x4816('0x40')][_0x1f790b['id']][_0x4816('0x4a')](_0x5210d2+_0x4816('0x4b'))){_0x13a685[_0x4816('0x40')][_0x1f790b['id']][_0x5210d2+_0x4816('0x4b')]=parseInt(_0x1f790b[_0x4816('0x4c')][_0x5210d2],0xa);}}}_0x13a685['agents'][_0x1f790b['id']][_0x4816('0x4d')]();return _0xfb9e4a({'code':0xc8,'message':_0x13a685[_0x4816('0x40')][_0x1f790b['id']]});}else{return _0x56d223(_0xa67f45[_0x4816('0x35')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x356878){return new Promise(function(_0x27392e,_0xcc9277){var _0x2c2a8c=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x40')]);_0x27392e({'count':_0x2c2a8c[_0x4816('0x15')],'rows':_0x2c2a8c});});},'ChatQueues':function(_0x52cf85){return new Promise(function(_0x171c2b,_0x11e6f9){var _0x11b12a=[];for(var _0x4a3cf9 in _0x13a685[_0x4816('0x4f')]){if(_0x13a685[_0x4816('0x4f')]['hasOwnProperty'](_0x4a3cf9)){var _0x3a1cf7=_0x13a685[_0x4816('0x4f')][_0x4a3cf9];var _0x211a2b={'id':_0x3a1cf7['id'],'available':_0x3a1cf7[_0x4816('0x50')],'loggedIn':_0x3a1cf7[_0x4816('0x51')],'name':_0x3a1cf7[_0x4816('0x52')],'paused':_0x3a1cf7[_0x4816('0x53')],'waiting':_0x3a1cf7['waiting']};_0x11b12a[_0x4816('0x1b')](_0x211a2b);}}_0x171c2b({'count':_0x11b12a['length'],'rows':_0x11b12a});});},'MailQueues':function(_0x483ad3){return new Promise(function(_0x4f357f,_0x4b3a3c){var _0x553093=[];for(var _0x15649e in _0x13a685[_0x4816('0x54')]){if(_0x13a685[_0x4816('0x54')]['hasOwnProperty'](_0x15649e)){var _0x3d6908=_0x13a685[_0x4816('0x54')][_0x15649e];var _0x115dc8={'id':_0x3d6908['id'],'available':_0x3d6908[_0x4816('0x50')],'loggedIn':_0x3d6908[_0x4816('0x51')],'name':_0x3d6908[_0x4816('0x52')],'paused':_0x3d6908[_0x4816('0x53')],'waiting':_0x3d6908['waiting']};_0x553093[_0x4816('0x1b')](_0x115dc8);}}_0x4f357f({'count':_0x553093['length'],'rows':_0x553093});});},'OpenchannelQueues':function(_0x44c2ec){return new Promise(function(_0x2cbc59,_0x5277dc){var _0x3002b7=[];for(var _0x9165c8 in _0x13a685[_0x4816('0x55')]){if(_0x13a685['openchannelQueues'][_0x4816('0x4a')](_0x9165c8)){var _0xd5d3b0=_0x13a685[_0x4816('0x55')][_0x9165c8];var _0x56b799={'id':_0xd5d3b0['id'],'available':_0xd5d3b0[_0x4816('0x50')],'loggedIn':_0xd5d3b0[_0x4816('0x51')],'name':_0xd5d3b0[_0x4816('0x52')],'paused':_0xd5d3b0['paused'],'waiting':_0xd5d3b0[_0x4816('0x56')]};_0x3002b7[_0x4816('0x1b')](_0x56b799);}}_0x2cbc59({'count':_0x3002b7[_0x4816('0x15')],'rows':_0x3002b7});});},'SmsQueues':function(_0x391329){return new Promise(function(_0x1c7fb4,_0x3d7d8b){var _0x23cfc4=[];for(var _0x5b7156 in _0x13a685[_0x4816('0x57')]){if(_0x13a685[_0x4816('0x57')][_0x4816('0x4a')](_0x5b7156)){var _0x24b0d5=_0x13a685[_0x4816('0x57')][_0x5b7156];var _0x24df14={'id':_0x24b0d5['id'],'available':_0x24b0d5[_0x4816('0x50')],'loggedIn':_0x24b0d5['loggedIn'],'name':_0x24b0d5[_0x4816('0x52')],'paused':_0x24b0d5[_0x4816('0x53')],'waiting':_0x24b0d5[_0x4816('0x56')]};_0x23cfc4[_0x4816('0x1b')](_0x24df14);}}_0x1c7fb4({'count':_0x23cfc4['length'],'rows':_0x23cfc4});});},'FaxQueues':function(_0x1e0bab){return new Promise(function(_0x1af0dc,_0x46f5f4){var _0xbb9848=[];for(var _0x12de01 in _0x13a685[_0x4816('0x58')]){if(_0x13a685[_0x4816('0x58')][_0x4816('0x4a')](_0x12de01)){var _0x28419c=_0x13a685[_0x4816('0x58')][_0x12de01];var _0x436d35={'id':_0x28419c['id'],'available':_0x28419c[_0x4816('0x50')],'loggedIn':_0x28419c[_0x4816('0x51')],'name':_0x28419c['name'],'paused':_0x28419c[_0x4816('0x53')],'waiting':_0x28419c[_0x4816('0x56')]};_0xbb9848[_0x4816('0x1b')](_0x436d35);}}_0x1af0dc({'count':_0xbb9848[_0x4816('0x15')],'rows':_0xbb9848});});},'WhatsappQueues':function(_0x21fe50){return new Promise(function(_0x35093e,_0x12d58f){var _0x619070=[];for(var _0x202d18 in _0x13a685[_0x4816('0x59')]){if(_0x13a685[_0x4816('0x59')][_0x4816('0x4a')](_0x202d18)){var _0xf439b3=_0x13a685['whatsappQueues'][_0x202d18];var _0xf05f49={'id':_0xf439b3['id'],'available':_0xf439b3[_0x4816('0x50')],'loggedIn':_0xf439b3[_0x4816('0x51')],'name':_0xf439b3['name'],'paused':_0xf439b3['paused'],'waiting':_0xf439b3[_0x4816('0x56')]};_0x619070[_0x4816('0x1b')](_0xf05f49);}}_0x35093e({'count':_0x619070['length'],'rows':_0x619070});});},'ChatQueuesWaitingInteractions':function(_0x1e2ead){return new Promise(function(_0x192832,_0x357800){var _0x317f3f=_['values'](_0x13a685[_0x4816('0x5a')]);_0x192832({'count':_0x317f3f[_0x4816('0x15')],'rows':_0x317f3f});});},'MailQueuesWaitingInteractions':function(_0x5f391e){return new Promise(function(_0x370439,_0x32ced6){var _0x4957e6=_[_0x4816('0x4e')](_0x13a685['mailQueuesWaitingInteractions']);_0x370439({'count':_0x4957e6[_0x4816('0x15')],'rows':_0x4957e6});});},'OpenchannelQueuesWaitingInteractions':function(_0x485505){return new Promise(function(_0x27ff4f,_0xa7f23c){var _0x30a190=_[_0x4816('0x4e')](_0x13a685['openchannelQueuesWaitingInteractions']);_0x27ff4f({'count':_0x30a190[_0x4816('0x15')],'rows':_0x30a190});});},'SmsQueuesWaitingInteractions':function(_0x4194f6){return new Promise(function(_0x1d0192,_0x2246b3){var _0x5e0b7e=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x5b')]);_0x1d0192({'count':_0x5e0b7e[_0x4816('0x15')],'rows':_0x5e0b7e});});},'FaxQueuesWaitingInteractions':function(_0x1f0f2a){return new Promise(function(_0x5c68cc,_0xc1f850){var _0x37c2a1=_[_0x4816('0x4e')](_0x13a685[_0x4816('0x5c')]);_0x5c68cc({'count':_0x37c2a1[_0x4816('0x15')],'rows':_0x37c2a1});});},'WhatsappQueuesWaitingInteractions':function(_0x4a4e89){return new Promise(function(_0x2765ae,_0x4f43eb){var _0x1c0799=_[_0x4816('0x4e')](_0x13a685['whatsappQueuesWaitingInteractions']);_0x2765ae({'count':_0x1c0799[_0x4816('0x15')],'rows':_0x1c0799});});}};var _0x205cf1=jayson[_0x4816('0x5d')](_0x1eb683)['http']();_0x205cf1['on'](_0x4816('0x35'),function(_0x33eabd){logger['error'](JSON[_0x4816('0x5e')](_0x33eabd));return _0x248163(_0x33eabd);});_0x205cf1[_0x4816('0xf')](0x232c,'127.0.0.1',function(){console[_0x4816('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x42fc52('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xa249=['message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','CurrentCapacity','capacity','agent\x20not\x20found','chatQueues','loggedIn','waiting','mailQueues','available','openchannelQueues','name','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel'];(function(_0x3da6f8,_0x3df04c){var _0x1828c3=function(_0x540107){while(--_0x540107){_0x3da6f8['push'](_0x3da6f8['shift']());}};_0x1828c3(++_0x3df04c);}(_0xa249,0x183));var _0x9a24=function(_0xc2385b,_0x58e08b){_0xc2385b=_0xc2385b-0x0;var _0x30cea7=_0xa249[_0xc2385b];return _0x30cea7;};'use strict';var _=require(_0x9a24('0x0'));var util=require(_0x9a24('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x9a24('0x2'));var BPromise=require(_0x9a24('0x3'));var uuid=require('uuid');var utils=require(_0x9a24('0x4'));var config=require('../../../config/environment');var logger=require(_0x9a24('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x9a24('0x6')),'smsQueueReport':require(_0x9a24('0x7')),'faxQueueReport':require(_0x9a24('0x8')),'whatsappQueueReport':require(_0x9a24('0x9'))};var RuleEngine=require(_0x9a24('0xa'));function getId(_0x22f220,_0x13875f,_0x625ec3){return util[_0x9a24('0xb')](_0x9a24('0xc'),_0x22f220,_0x13875f||0x0,_0x625ec3||0x0);}function getIntervals(_0x543676,_0x510b29){var _0x1cd07a=[];if(!_[_0x9a24('0xd')](_0x510b29[_0x9a24('0xe')])&&!_['isNil'](_0x543676[_0x510b29[_0x9a24('0xe')]])&&!_['isNil'](_0x543676[_0x510b29[_0x9a24('0xe')]]['Intervals'])){_0x1cd07a=_[_0x9a24('0xf')](_0x543676[_0x510b29[_0x9a24('0xe')]][_0x9a24('0x10')],_0x9a24('0x11'));}else if(!_[_0x9a24('0xd')](_0x510b29['interval'])){_0x1cd07a=[_0x510b29[_0x9a24('0x11')]];}return _0x1cd07a;}exports[_0x9a24('0x12')]=function(_0x2bc767){_0x2bc767[_0x9a24('0x13')]={};return new BPromise(function(_0x3a9d31,_0x509334){var _0x519709={'Start':function(_0x714fd5){var _0x306c6d=this;return new Promise(function(_0x25202f,_0x58a026){if(_0x714fd5){try{var _0x29fab8=[];var _0x7239eb=getId(_0x714fd5[_0x9a24('0x14')],_0x714fd5[_0x9a24('0x15')]?_0x714fd5[_0x9a24('0x15')]['id']:0x0,_0x714fd5[_0x9a24('0x16')]?_0x714fd5[_0x9a24('0x16')]['id']:0x0);if(_0x714fd5[_0x9a24('0x17')]&&_[_0x9a24('0x18')](_0x714fd5[_0x9a24('0x17')])&&_0x714fd5[_0x9a24('0x17')][_0x9a24('0x19')]){for(var _0x5e7c98=0x0;_0x5e7c98<_0x714fd5[_0x9a24('0x17')]['length'];_0x5e7c98+=0x1){var _0x5a000d=_0x714fd5['applications'][_0x5e7c98];if(fs[_0x9a24('0x1a')](path[_0x9a24('0x1b')](__dirname,'applications',_0x5a000d[_0x9a24('0x1c')]+_0x9a24('0x1d')))){var _0x69d2e9=[];switch(_0x5a000d[_0x9a24('0x1c')][_0x9a24('0x1e')]()){case _0x9a24('0x1f'):var _0x28830b=_0x5a000d[_0x9a24('0x20')][_0x9a24('0x21')](',');if(_0x714fd5['channel']===_0x9a24('0x22')){_0x69d2e9[_0x9a24('0x23')](_0x28830b[0x0]);_0x69d2e9[_0x9a24('0x23')](_0x28830b[0x1]);_0x69d2e9['push'](_0x28830b[_0x9a24('0x24')](0x2,_0x28830b['length'])[_0x9a24('0x1b')](','));}else{_0x69d2e9[_0x9a24('0x23')](_0x28830b[0x0]);_0x69d2e9[_0x9a24('0x23')](_0x28830b['slice'](0x1,_0x28830b[_0x9a24('0x19')])[_0x9a24('0x1b')](','));}break;case _0x9a24('0x25'):var _0x4c6d7f=_0x5a000d[_0x9a24('0x20')]['split'](',');_0x69d2e9[_0x9a24('0x23')](_0x4c6d7f[0x0]);_0x69d2e9['push'](_0x4c6d7f[0x1]);_0x69d2e9[_0x9a24('0x23')](_0x4c6d7f[_0x9a24('0x24')](0x2,_0x4c6d7f[_0x9a24('0x19')])[_0x9a24('0x1b')](','));break;case _0x9a24('0x26'):var _0x57bd0c=_0x5a000d['appdata'][_0x9a24('0x21')](',');_0x69d2e9[_0x9a24('0x23')](_0x57bd0c[0x0]);_0x69d2e9[_0x9a24('0x23')](_0x57bd0c[0x1]);_0x69d2e9[_0x9a24('0x23')](_0x57bd0c[0x2]);_0x69d2e9[_0x9a24('0x23')](_0x57bd0c[0x3]);_0x69d2e9[_0x9a24('0x23')](_0x57bd0c[_0x9a24('0x24')](0x4,_0x57bd0c[_0x9a24('0x19')])[_0x9a24('0x1b')](','));break;case _0x9a24('0x27'):var _0x279838=_0x5a000d[_0x9a24('0x20')]['split'](',');_0x69d2e9[_0x9a24('0x23')](_0x279838[0x0]);_0x69d2e9[_0x9a24('0x23')](_0x279838[0x1]);_0x69d2e9[_0x9a24('0x23')](_0x279838[0x2]);_0x69d2e9['push'](_0x279838[0x3]);_0x69d2e9['push'](_0x279838[_0x9a24('0x24')](0x4,_0x279838[_0x9a24('0x19')])[_0x9a24('0x1b')](','));break;case _0x9a24('0x15'):_0x69d2e9[_0x9a24('0x23')](_0x5a000d['appdata']);break;case _0x9a24('0x28'):_0x69d2e9[_0x9a24('0x23')](_0x5a000d[_0x9a24('0x29')]);_0x69d2e9[_0x9a24('0x23')](_0x5a000d[_0x9a24('0x20')]);break;case _0x9a24('0x2a'):var _0x2b2a56=utils[_0x9a24('0x2b')](_0x714fd5[_0x9a24('0x2c')][_0x9a24('0x2d')],_0x714fd5);var _0x2063ec=_0x5a000d[_0x9a24('0x20')]['split'](',');_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x0]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x1]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x2]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x3]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x4]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x5]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x6]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x7]);_0x69d2e9['push'](_0x2063ec[0x8]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0x9]);_0x69d2e9[_0x9a24('0x23')](_0x2063ec[0xa]);_0x69d2e9['push'](_0x714fd5['interaction']['id']);_0x69d2e9['push'](_0x714fd5['message']['id']);_0x69d2e9['push'](_0x5a000d['ChatWebsiteId']);_0x69d2e9[_0x9a24('0x23')](_0x714fd5['interaction']['ContactId']);_0x69d2e9[_0x9a24('0x23')](_0x714fd5['body'][_0x9a24('0x2e')]);_0x69d2e9[_0x9a24('0x23')](_0x2b2a56);break;default:_0x69d2e9=_[_0x9a24('0xd')](_0x5a000d['appdata'])?[]:_0x5a000d['appdata'][_0x9a24('0x21')](',');}var _0x3695eb={'id':util[_0x9a24('0xb')](_0x9a24('0x2f'),_0x7239eb,_0x5a000d['id'],_0x5a000d[_0x9a24('0x1c')]),'condition':require(_0x9a24('0x30'))['condition'](_0x7239eb,getIntervals(_0x2bc767[_0x9a24('0x31')],_0x5a000d),_0x2bc767),'consequence':require(_0x9a24('0x32')+_0x5a000d['app'])[_0x9a24('0x33')](_0x7239eb,_0x69d2e9,_0x2bc767,_0x714fd5),'p':_0x5a000d[_0x9a24('0x34')]||0x0};logger['info'](_0x9a24('0x35'),_0x3695eb['id'],_0x9a24('0x36'),getIntervals(_0x2bc767[_0x9a24('0x31')],_0x5a000d)[_0x9a24('0x1b')]('\x20|\x20'));_0x29fab8[_0x9a24('0x23')](_0x3695eb);}else{logger[_0x9a24('0x37')](_0x9a24('0x38'),path[_0x9a24('0x1b')](__dirname,'applications',_0x5a000d[_0x9a24('0x1c')]+_0x9a24('0x1d')));}}_0x2bc767[_0x9a24('0x13')][_0x7239eb]=new RuleEngine(_0x29fab8);_0x2bc767[_0x9a24('0x13')][_0x7239eb][_0x9a24('0x39')](_0x714fd5,function(_0x5d8e69){logger[_0x9a24('0x3a')]('Applications\x20executed',JSON[_0x9a24('0x3b')](_0x5d8e69['matchPath']));if(_0x2bc767[_0x9a24('0x13')][_0x7239eb]){_0x2bc767[_0x9a24('0x13')][_0x7239eb][_0x9a24('0x3c')](_0x9a24('0x3d'));}});return _0x25202f({'code':0xc8,'message':_0x714fd5});}else{logger[_0x9a24('0x3a')](_0x9a24('0x3e'));return _0x25202f({'code':0xc8,'message':_0x714fd5});}}catch(_0x192ce0){logger[_0x9a24('0x37')](_0x192ce0['stack']);return _0x58a026(_0x306c6d[_0x9a24('0x37')](0x1f4,_0x192ce0));}}return _0x58a026(_0x9a24('0x3f'));});},'AcceptMessage':function(_0x57fb8){var _0x4e2e2c=this;return new Promise(function(_0x37e489,_0x2980f5){if(_0x57fb8['agent']&&_0x57fb8[_0x9a24('0x40')]['id']){if(_0x2bc767[_0x9a24('0x41')][_0x57fb8[_0x9a24('0x40')]['id']]){_0x2bc767[_0x9a24('0x41')][_0x57fb8['agent']['id']][_0x9a24('0x42')]=![];_0x2bc767[_0x9a24('0x41')][_0x57fb8[_0x9a24('0x40')]['id']][_0x9a24('0x43')]=undefined;}}if(_0x57fb8[_0x9a24('0x15')]&&_0x57fb8['message']['id']){try{var _0x55ca39=getId(_0x57fb8[_0x9a24('0x14')],_0x57fb8[_0x9a24('0x15')]?_0x57fb8[_0x9a24('0x15')]['id']:0x0,_0x57fb8[_0x9a24('0x16')]?_0x57fb8[_0x9a24('0x16')]['id']:0x0);if(_0x2bc767['rules'][_0x55ca39]){_0x2bc767[_0x9a24('0x13')][_0x55ca39][_0x9a24('0x3c')]('end');if(rpc[_0x57fb8[_0x9a24('0x14')]+'QueueReport']){rpc[_0x57fb8[_0x9a24('0x14')]+_0x9a24('0x44')][_0x9a24('0x45')](_0x55ca39,{'UserId':_0x57fb8['message'][_0x9a24('0x46')]})[_0x9a24('0x47')](function(_0x332ef8){logger[_0x9a24('0x37')](_0x9a24('0x48'));});}}return _0x37e489({'code':0xc8,'message':_0x57fb8});}catch(_0x9c965e){logger[_0x9a24('0x37')](_0x9c965e[_0x9a24('0x49')]);return _0x2980f5(_0x4e2e2c['error'](0x1f4,_0x9c965e));}}logger[_0x9a24('0x37')]('message\x20is\x20empty');return _0x2980f5(_0x4e2e2c[_0x9a24('0x37')](0x1f4,_0x9a24('0x4a')));});},'RejectMessage':function(_0x1682e0){var _0x2dcf1f=this;return new Promise(function(_0x224cce,_0x5ce00b){if(_0x1682e0['agent']&&_0x1682e0['agent']['id']){try{if(_0x2bc767[_0x9a24('0x41')][_0x1682e0[_0x9a24('0x40')]['id']]){_0x2bc767[_0x9a24('0x41')][_0x1682e0[_0x9a24('0x40')]['id']]['busy']=![];_0x2bc767[_0x9a24('0x41')][_0x1682e0['agent']['id']][_0x9a24('0x43')]=undefined;}return _0x224cce({'code':0xc8,'message':_0x1682e0});}catch(_0x4b14fe){logger[_0x9a24('0x37')](_0x4b14fe['stack']);return _0x5ce00b(_0x2dcf1f[_0x9a24('0x37')](0x1f4,_0x4b14fe));}}logger[_0x9a24('0x37')]('message\x20is\x20empty');return _0x5ce00b(_0x2dcf1f[_0x9a24('0x37')](0x1f4,_0x9a24('0x4a')));});},'AbandonInteraction':function(_0x2fa0cd){var _0x2a6aff=this;return new Promise(function(_0x64fd18,_0x1e6ce0){if(_0x2fa0cd['channel']&&_0x2fa0cd[_0x9a24('0x16')]&&_0x2fa0cd[_0x9a24('0x16')]['id']){try{var _0x39a37f=getId(_0x2fa0cd[_0x9a24('0x14')],_0x2fa0cd['message']?_0x2fa0cd[_0x9a24('0x15')]['id']:0x0,_0x2fa0cd[_0x9a24('0x16')]?_0x2fa0cd[_0x9a24('0x16')]['id']:0x0);if(_0x2bc767[_0x9a24('0x13')][_0x39a37f]){_0x2bc767[_0x9a24('0x13')][_0x39a37f][_0x9a24('0x3c')]('end');}return _0x64fd18({'code':0xc8,'message':_0x2fa0cd});}catch(_0x310574){logger[_0x9a24('0x37')](_0x310574[_0x9a24('0x49')]);return _0x1e6ce0(_0x2a6aff['error'](0x1f4,_0x310574));}}logger[_0x9a24('0x37')](_0x9a24('0x4a'));return _0x1e6ce0(_0x2a6aff[_0x9a24('0x37')](0x1f4,_0x9a24('0x4a')));});},'AgentCapacity':function(_0x1134e1){var _0x1694a3=this;return new Promise(function(_0x5581d1,_0x502769){if(_0x2bc767[_0x9a24('0x41')][_0x9a24('0x4b')](_0x1134e1['id'])){for(var _0x278503 in _0x1134e1['capacity']){if(_0x1134e1['capacity'][_0x9a24('0x4b')](_0x278503)){if(_0x2bc767[_0x9a24('0x41')][_0x1134e1['id']][_0x9a24('0x4b')](_0x278503+'CurrentCapacity')){_0x2bc767['agents'][_0x1134e1['id']][_0x278503+_0x9a24('0x4c')]=parseInt(_0x1134e1[_0x9a24('0x4d')][_0x278503],0xa);}}}_0x2bc767[_0x9a24('0x41')][_0x1134e1['id']]['updateRealtime']();return _0x5581d1({'code':0xc8,'message':_0x2bc767[_0x9a24('0x41')][_0x1134e1['id']]});}else{return _0x502769(_0x1694a3[_0x9a24('0x37')](0x1f4,_0x9a24('0x4e')));}});},'Agents':function(_0x4a053b){return new Promise(function(_0x337cad,_0x10bb3b){var _0x512751=_['values'](_0x2bc767[_0x9a24('0x41')]);_0x337cad({'count':_0x512751['length'],'rows':_0x512751});});},'ChatQueues':function(_0x256919){return new Promise(function(_0x2e694a,_0x28d030){var _0x206fd6=[];for(var _0x33934f in _0x2bc767[_0x9a24('0x4f')]){if(_0x2bc767['chatQueues'][_0x9a24('0x4b')](_0x33934f)){var _0x227c4a=_0x2bc767[_0x9a24('0x4f')][_0x33934f];var _0x2fc00b={'id':_0x227c4a['id'],'available':_0x227c4a['available'],'loggedIn':_0x227c4a[_0x9a24('0x50')],'name':_0x227c4a['name'],'paused':_0x227c4a['paused'],'waiting':_0x227c4a[_0x9a24('0x51')]};_0x206fd6[_0x9a24('0x23')](_0x2fc00b);}}_0x2e694a({'count':_0x206fd6['length'],'rows':_0x206fd6});});},'MailQueues':function(_0x4c34ba){return new Promise(function(_0x57021d,_0x4cf38f){var _0xf4d5d3=[];for(var _0x6aae3c in _0x2bc767[_0x9a24('0x52')]){if(_0x2bc767['mailQueues'][_0x9a24('0x4b')](_0x6aae3c)){var _0x1e00e9=_0x2bc767['mailQueues'][_0x6aae3c];var _0x312db9={'id':_0x1e00e9['id'],'available':_0x1e00e9[_0x9a24('0x53')],'loggedIn':_0x1e00e9[_0x9a24('0x50')],'name':_0x1e00e9['name'],'paused':_0x1e00e9['paused'],'waiting':_0x1e00e9[_0x9a24('0x51')]};_0xf4d5d3[_0x9a24('0x23')](_0x312db9);}}_0x57021d({'count':_0xf4d5d3['length'],'rows':_0xf4d5d3});});},'OpenchannelQueues':function(_0x4d7ee7){return new Promise(function(_0x908b2c,_0x3c43f4){var _0x414765=[];for(var _0x18289d in _0x2bc767[_0x9a24('0x54')]){if(_0x2bc767[_0x9a24('0x54')]['hasOwnProperty'](_0x18289d)){var _0x51dc9a=_0x2bc767[_0x9a24('0x54')][_0x18289d];var _0xd82407={'id':_0x51dc9a['id'],'available':_0x51dc9a[_0x9a24('0x53')],'loggedIn':_0x51dc9a[_0x9a24('0x50')],'name':_0x51dc9a[_0x9a24('0x55')],'paused':_0x51dc9a[_0x9a24('0x56')],'waiting':_0x51dc9a['waiting']};_0x414765[_0x9a24('0x23')](_0xd82407);}}_0x908b2c({'count':_0x414765[_0x9a24('0x19')],'rows':_0x414765});});},'SmsQueues':function(_0x529102){return new Promise(function(_0x3130e7,_0x209154){var _0x5c5c7f=[];for(var _0x26b3cc in _0x2bc767['smsQueues']){if(_0x2bc767[_0x9a24('0x57')][_0x9a24('0x4b')](_0x26b3cc)){var _0x56dc92=_0x2bc767[_0x9a24('0x57')][_0x26b3cc];var _0xd2db11={'id':_0x56dc92['id'],'available':_0x56dc92[_0x9a24('0x53')],'loggedIn':_0x56dc92[_0x9a24('0x50')],'name':_0x56dc92[_0x9a24('0x55')],'paused':_0x56dc92[_0x9a24('0x56')],'waiting':_0x56dc92[_0x9a24('0x51')]};_0x5c5c7f['push'](_0xd2db11);}}_0x3130e7({'count':_0x5c5c7f['length'],'rows':_0x5c5c7f});});},'FaxQueues':function(_0x10e7a0){return new Promise(function(_0x29d17b,_0x429d59){var _0x36b8b9=[];for(var _0x205a07 in _0x2bc767[_0x9a24('0x58')]){if(_0x2bc767[_0x9a24('0x58')]['hasOwnProperty'](_0x205a07)){var _0x359cc1=_0x2bc767[_0x9a24('0x58')][_0x205a07];var _0x39e805={'id':_0x359cc1['id'],'available':_0x359cc1[_0x9a24('0x53')],'loggedIn':_0x359cc1[_0x9a24('0x50')],'name':_0x359cc1[_0x9a24('0x55')],'paused':_0x359cc1[_0x9a24('0x56')],'waiting':_0x359cc1['waiting']};_0x36b8b9['push'](_0x39e805);}}_0x29d17b({'count':_0x36b8b9[_0x9a24('0x19')],'rows':_0x36b8b9});});},'WhatsappQueues':function(_0x48767d){return new Promise(function(_0x116239,_0x3b5950){var _0x1c2f7b=[];for(var _0x21cd50 in _0x2bc767[_0x9a24('0x59')]){if(_0x2bc767[_0x9a24('0x59')][_0x9a24('0x4b')](_0x21cd50)){var _0x1fb9ea=_0x2bc767[_0x9a24('0x59')][_0x21cd50];var _0x567c63={'id':_0x1fb9ea['id'],'available':_0x1fb9ea[_0x9a24('0x53')],'loggedIn':_0x1fb9ea[_0x9a24('0x50')],'name':_0x1fb9ea[_0x9a24('0x55')],'paused':_0x1fb9ea[_0x9a24('0x56')],'waiting':_0x1fb9ea[_0x9a24('0x51')]};_0x1c2f7b[_0x9a24('0x23')](_0x567c63);}}_0x116239({'count':_0x1c2f7b['length'],'rows':_0x1c2f7b});});},'ChatQueuesWaitingInteractions':function(_0x40c99d){return new Promise(function(_0x987b67,_0x5c37fb){var _0x4c3faa=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x5b')]);_0x987b67({'count':_0x4c3faa[_0x9a24('0x19')],'rows':_0x4c3faa});});},'MailQueuesWaitingInteractions':function(_0x35bb09){return new Promise(function(_0xc4d637,_0x2fff58){var _0x3515be=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x5c')]);_0xc4d637({'count':_0x3515be['length'],'rows':_0x3515be});});},'OpenchannelQueuesWaitingInteractions':function(_0x2c7cb1){return new Promise(function(_0x2ab856,_0x46f2e7){var _0x48776a=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x5d')]);_0x2ab856({'count':_0x48776a[_0x9a24('0x19')],'rows':_0x48776a});});},'SmsQueuesWaitingInteractions':function(_0xbbcb07){return new Promise(function(_0x195b6e,_0x2df6ea){var _0x4b34f0=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x5e')]);_0x195b6e({'count':_0x4b34f0[_0x9a24('0x19')],'rows':_0x4b34f0});});},'FaxQueuesWaitingInteractions':function(_0x100fea){return new Promise(function(_0x40bf4d,_0x53152e){var _0x1513ba=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x5f')]);_0x40bf4d({'count':_0x1513ba['length'],'rows':_0x1513ba});});},'WhatsappQueuesWaitingInteractions':function(_0x457177){return new Promise(function(_0x171674,_0x4d71aa){var _0x5dbe69=_[_0x9a24('0x5a')](_0x2bc767[_0x9a24('0x60')]);_0x171674({'count':_0x5dbe69['length'],'rows':_0x5dbe69});});}};var _0x2204ab=jayson[_0x9a24('0x61')](_0x519709)[_0x9a24('0x62')]();_0x2204ab['on'](_0x9a24('0x37'),function(_0x5bc770){logger[_0x9a24('0x37')](JSON[_0x9a24('0x3b')](_0x5bc770));return _0x509334(_0x5bc770);});_0x2204ab[_0x9a24('0x12')](0x232c,_0x9a24('0x63'),function(){console['log'](_0x9a24('0x64'),0x232c);return _0x3a9d31(_0x9a24('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index af05a29..90d75f7 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 _0x58d5=['routing','client','http','then','error','result','condition','rules','info','stop','length','push','Command','format','message','indexOf','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0x234bb2,_0x543dad){var _0x1cb2cf=function(_0x2c73a3){while(--_0x2c73a3){_0x234bb2['push'](_0x234bb2['shift']());}};_0x1cb2cf(++_0x543dad);}(_0x58d5,0x13b));var _0x558d=function(_0x4d3508,_0x576711){_0x4d3508=_0x4d3508-0x0;var _0x144bb9=_0x58d5[_0x4d3508];return _0x144bb9;};'use strict';var util=require('util');var BPromise=require(_0x558d('0x0'));var jayson=require(_0x558d('0x1'));var _=require(_0x558d('0x2'));var logger=require(_0x558d('0x3'))(_0x558d('0x4'));var client=jayson[_0x558d('0x5')][_0x558d('0x6')]({'port':0x232a});function request(_0x370c86,_0x4b9a37){return new BPromise(function(_0x42dffe,_0xe6a0bd){return client['request'](_0x370c86,_0x4b9a37)[_0x558d('0x7')](function(_0x2bd5ba){if(_0x2bd5ba[_0x558d('0x8')]){return _0xe6a0bd(_0x2bd5ba['error']['message']);}else{return _0x42dffe(_0x2bd5ba[_0x558d('0x9')]);}})['catch'](function(_0x4e679f){return _0xe6a0bd(_0x4e679f);});});}exports[_0x558d('0xa')]=function(_0x8d36c2,_0x3b0604,_0x1ed854){return function(_0x95dc16){if(_0x1ed854[_0x558d('0xb')]&&!_0x1ed854[_0x558d('0xb')][_0x8d36c2]){logger[_0x558d('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x8d36c2);return _0x95dc16[_0x558d('0xd')]();}var _0x5bd531=[];for(var _0x55a2f5=0x0;_0x55a2f5<_0x3b0604[_0x558d('0xe')];_0x55a2f5+=0x1){_0x5bd531[_0x558d('0xf')](request(_0x558d('0x10'),{'command':util[_0x558d('0x11')]('iftime\x20%s',_0x3b0604[_0x55a2f5])})['then'](function(_0x916c83){return _0x916c83&&_0x916c83['message']&&_0x916c83[_0x558d('0x12')][_0x558d('0x13')]('true')>=0x0?!![]:![];})[_0x558d('0x14')](function(_0x18cb6d){logger['error'](_0x558d('0x15'),_0x8d36c2,_0x3b0604[_0x55a2f5]);}));}BPromise[_0x558d('0x16')](_0x5bd531)[_0x558d('0x7')](function(_0x55176d){var _0x18ba95=_[_0x558d('0x17')](_0x55176d);logger[_0x558d('0xc')](_0x558d('0x18'),_0x8d36c2,_0x3b0604[_0x558d('0x19')]('\x20|\x20'),_0x18ba95);_0x95dc16[_0x558d('0x1a')](_0x18ba95);})[_0x558d('0x14')](function(_0x14a753){console[_0x558d('0x1b')](_0x14a753);logger[_0x558d('0x8')](_0x558d('0x18'),_0x8d36c2,_0x3b0604[_0x558d('0x19')]('\x20|\x20'),_0x14a753[_0x558d('0x1c')]);_0x95dc16[_0x558d('0xd')]();});};}; \ No newline at end of file +var _0x6550=['http','request','then','error','message','catch','condition','rules','info','stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','routing','client'];(function(_0x4558c5,_0x203acd){var _0x2f4c1d=function(_0x4e9b23){while(--_0x4e9b23){_0x4558c5['push'](_0x4558c5['shift']());}};_0x2f4c1d(++_0x203acd);}(_0x6550,0x111));var _0x0655=function(_0x3b72ff,_0x5417be){_0x3b72ff=_0x3b72ff-0x0;var _0x5de955=_0x6550[_0x3b72ff];return _0x5de955;};'use strict';var util=require(_0x0655('0x0'));var BPromise=require('bluebird');var jayson=require(_0x0655('0x1'));var _=require(_0x0655('0x2'));var logger=require(_0x0655('0x3'))(_0x0655('0x4'));var client=jayson[_0x0655('0x5')][_0x0655('0x6')]({'port':0x232a});function request(_0x38d670,_0x2dfb17){return new BPromise(function(_0x3269ab,_0x2dcdbc){return client[_0x0655('0x7')](_0x38d670,_0x2dfb17)[_0x0655('0x8')](function(_0x14ed1d){if(_0x14ed1d[_0x0655('0x9')]){return _0x2dcdbc(_0x14ed1d['error'][_0x0655('0xa')]);}else{return _0x3269ab(_0x14ed1d['result']);}})[_0x0655('0xb')](function(_0x2da08d){return _0x2dcdbc(_0x2da08d);});});}exports[_0x0655('0xc')]=function(_0x4b006f,_0x1d5786,_0x1a320c){return function(_0x5783ee){if(_0x1a320c[_0x0655('0xd')]&&!_0x1a320c[_0x0655('0xd')][_0x4b006f]){logger[_0x0655('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4b006f);return _0x5783ee[_0x0655('0xf')]();}var _0x2dc7e0=[];for(var _0x30c99c=0x0;_0x30c99c<_0x1d5786[_0x0655('0x10')];_0x30c99c+=0x1){_0x2dc7e0[_0x0655('0x11')](request(_0x0655('0x12'),{'command':util[_0x0655('0x13')](_0x0655('0x14'),_0x1d5786[_0x30c99c])})[_0x0655('0x8')](function(_0x49a693){return _0x49a693&&_0x49a693['message']&&_0x49a693[_0x0655('0xa')][_0x0655('0x15')](_0x0655('0x16'))>=0x0?!![]:![];})[_0x0655('0xb')](function(_0x52cf49){logger[_0x0655('0x9')]('[%s][INTERVAL]\x20%s',_0x4b006f,_0x1d5786[_0x30c99c]);}));}BPromise[_0x0655('0x17')](_0x2dc7e0)[_0x0655('0x8')](function(_0x48c9be){var _0x276162=_[_0x0655('0x18')](_0x48c9be);logger[_0x0655('0xe')](_0x0655('0x19'),_0x4b006f,_0x1d5786[_0x0655('0x1a')](_0x0655('0x1b')),_0x276162);_0x5783ee[_0x0655('0x1c')](_0x276162);})[_0x0655('0xb')](function(_0x374480){console[_0x0655('0x1d')](_0x374480);logger[_0x0655('0x9')](_0x0655('0x19'),_0x4b006f,_0x1d5786['join'](_0x0655('0x1b')),_0x374480[_0x0655('0x1e')]);_0x5783ee[_0x0655('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7bffe08..74788b9 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 _0xdb94=['transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','debug','[%s][agents][agentcalled]','destuniqueid','connectedlinenum','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','membername','agentringnoanswerAt','now','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten'];(function(_0x3171e0,_0xb4737a){var _0x28e85b=function(_0xa95f11){while(--_0xa95f11){_0x3171e0['push'](_0x3171e0['shift']());}};_0x28e85b(++_0xb4737a);}(_0xdb94,0xab));var _0x4db9=function(_0x3d9d6b,_0x2922ef){_0x3d9d6b=_0x3d9d6b-0x0;var _0x4c1965=_0xdb94[_0x3d9d6b];return _0x4c1965;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var utils=require(_0x4db9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x39909a,_0x3b4f98){utils['info'](util[_0x4db9('0x3')](_0x4db9('0x4'),_0x39909a['uniqueid'],_0x39909a['channel'],_0x39909a[_0x4db9('0x5')],_0x39909a['membername'],_0x39909a['interface'],_0x39909a[_0x4db9('0x6')],_0x39909a['connectedlinenum'],_0x39909a[_0x4db9('0x7')]));if(_0x39909a['queue']){utils[_0x4db9('0x8')](_0x39909a[_0x4db9('0x5')])[_0x4db9('0x9')](function(_0xbbc1eb){if(_0xbbc1eb){_0x39909a[_0x4db9('0xa')]=_0xbbc1eb[_0x4db9('0xa')];_0x39909a[_0x4db9('0xb')]=_0x39909a[_0x4db9('0xc')]?_0xbbc1eb[_0x4db9('0xd')]:![];_0x39909a[_0x4db9('0xe')]=_0x39909a[_0x4db9('0xb')]?_0xbbc1eb['acwTimeout']:0x0;}utils[_0x4db9('0xf')](_0x4db9('0x10'),_0x39909a);});}else{utils['request']('CreateVoiceAgentReport',_0x39909a);}if(_0x3b4f98){delete transfers[_0x39909a[_0x4db9('0x11')]];}else{delete agents[_0x39909a['destuniqueid']];}}exports['agentcalled']=function(_0x34fc7d){try{utils[_0x4db9('0x12')](util['format'](_0x4db9('0x13'),_0x34fc7d[_0x4db9('0x11')]),_0x34fc7d);agents[_0x34fc7d[_0x4db9('0x14')]]=_0x34fc7d;agents[_0x34fc7d[_0x4db9('0x14')]]['agentcalledAt']=utils['now']();agents[_0x34fc7d[_0x4db9('0x14')]][_0x4db9('0x7')]='called';agents[_0x34fc7d[_0x4db9('0x14')]][_0x4db9('0x15')]=null;agents[_0x34fc7d['destuniqueid']]['connectedlinename']=null;utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x17'),_0x34fc7d[_0x4db9('0x11')],agents[_0x34fc7d[_0x4db9('0x14')]]['membername'],_0x34fc7d[_0x4db9('0x14')]));}catch(_0x1214ee){utils[_0x4db9('0x18')](util['format'](_0x4db9('0x13'),_0x34fc7d[_0x4db9('0x11')]),_0x1214ee);}};exports[_0x4db9('0x19')]=function(_0x4c92e8){try{if(!_[_0x4db9('0x1a')](agents[_0x4c92e8[_0x4db9('0x14')]])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x1b'),_0x4c92e8[_0x4db9('0x11')]),_0x4c92e8);utils[_0x4db9('0x16')](util['format'](_0x4db9('0x1c'),_0x4c92e8[_0x4db9('0x11')],agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x1d')],_0x4c92e8['destuniqueid']));agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x19')]=!![];agents[_0x4c92e8['destuniqueid']][_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();agents[_0x4c92e8[_0x4db9('0x14')]]['lastevent']=_0x4db9('0x20');agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x21')]=_0x4db9('0x20');agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x22')]=_0x4c92e8[_0x4db9('0x23')]?parseInt(_0x4c92e8[_0x4db9('0x23')])/0x3e8:0x0;agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x24')]=0x0;unanswered[_0x4db9('0x25')](_0x4c92e8[_0x4db9('0x14')]);}}catch(_0x2d646d){utils[_0x4db9('0x18')](util['format']('[%s][agents][agentringnoanswer]',_0x4c92e8[_0x4db9('0x11')]),_0x2d646d);}};exports[_0x4db9('0x26')]=function(_0x119371){try{_[_0x4db9('0x27')](agents,function(_0x2af884,_0x459131){if(_0x2af884['uniqueid']==_0x119371[_0x4db9('0x11')]&&!_['includes'](unanswered,_0x2af884[_0x4db9('0x14')])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x28'),_0x119371[_0x4db9('0x11')]),_0x119371);utils['info'](util['format'](_0x4db9('0x29'),_0x119371['uniqueid'],_0x2af884[_0x4db9('0x1d')],_0x2af884[_0x4db9('0x14')]));_0x2af884['agentringnoanswer']=!![];_0x2af884[_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();_0x2af884[_0x4db9('0x7')]='abandoned';_0x2af884[_0x4db9('0x21')]='abandoned';_0x2af884[_0x4db9('0x22')]=_0x119371[_0x4db9('0x22')];_0x2af884[_0x4db9('0x24')]=0x0;writeDB(_0x2af884);}});}catch(_0x4dbcd3){utils['error'](util[_0x4db9('0x3')](_0x4db9('0x28'),_0x119371[_0x4db9('0x11')]),_0x4dbcd3);}};exports[_0x4db9('0x2a')]=function(_0x2dca24){try{if(agents[_0x2dca24[_0x4db9('0x14')]]){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x2b'),_0x2dca24['uniqueid']),_0x2dca24);utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x2c'),_0x2dca24[_0x4db9('0x11')],agents[_0x2dca24['destuniqueid']][_0x4db9('0x1d')],_0x2dca24[_0x4db9('0x14')]));agents[_0x2dca24[_0x4db9('0x14')]]['agentconnectAt']=utils[_0x4db9('0x1f')]();agents[_0x2dca24[_0x4db9('0x14')]][_0x4db9('0x15')]=_0x2dca24[_0x4db9('0x15')];agents[_0x2dca24['destuniqueid']]['connectedlinename']=_0x2dca24[_0x4db9('0x2d')];agents[_0x2dca24[_0x4db9('0x14')]][_0x4db9('0x22')]=_0x2dca24[_0x4db9('0x23')];agents[_0x2dca24[_0x4db9('0x14')]]['lastevent']=_0x4db9('0x2e');_[_0x4db9('0x27')](agents,function(_0x23affc,_0x367c4c){if(_0x23affc[_0x4db9('0x14')]!=_0x2dca24['destuniqueid']&&_0x23affc[_0x4db9('0x11')]==_0x2dca24[_0x4db9('0x11')]){_0x23affc[_0x4db9('0x24')]=0x0;_0x23affc['holdtime']=_0x2dca24[_0x4db9('0x23')];_0x23affc[_0x4db9('0x19')]=!![];_0x23affc[_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();_0x23affc[_0x4db9('0x7')]=_0x4db9('0x2f');_0x23affc[_0x4db9('0x21')]=_0x4db9('0x2f');_0x23affc[_0x4db9('0x30')]=_0x2dca24[_0x4db9('0x14')];_0x23affc['answeredelsewheremembername']=_0x2dca24['membername'];writeDB(_0x23affc);}});}}catch(_0x48aaf5){utils[_0x4db9('0x18')](util[_0x4db9('0x3')]('[%s][agents][agentconnect]',_0x2dca24[_0x4db9('0x11')]),_0x48aaf5);}};exports[_0x4db9('0xc')]=function(_0x563416){try{if(!_['isNil'](agents[_0x563416[_0x4db9('0x14')]])){utils['debug'](util[_0x4db9('0x3')](_0x4db9('0x31'),_0x563416['uniqueid']),_0x563416);utils[_0x4db9('0x16')](util[_0x4db9('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x563416[_0x4db9('0x11')],agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x1d')],_0x563416['destuniqueid']));agents[_0x563416['destuniqueid']][_0x4db9('0xc')]=!![];agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x24')]=utils[_0x4db9('0x33')](agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x32')],agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x34')]);agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x21')]=_0x563416['reason'];agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x7')]=_0x4db9('0x35');writeDB(agents[_0x563416[_0x4db9('0x14')]]);}}catch(_0x329822){utils[_0x4db9('0x18')](util[_0x4db9('0x3')](_0x4db9('0x31'),_0x563416[_0x4db9('0x11')]),_0x329822);}};exports[_0x4db9('0x36')]=function(_0x10dccb){try{if(!_['isNil'](agents[_0x10dccb['transfereruniqueid']])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x37'),_0x10dccb[_0x4db9('0x11')]),_0x10dccb);utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x38'),_0x10dccb[_0x4db9('0x11')],agents[_0x10dccb['transfereruniqueid']][_0x4db9('0x1d')],agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x11')]));agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3a')]=!![];agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3b')]=_0x4db9('0x3c');agents[_0x10dccb['transfereruniqueid']][_0x4db9('0x3d')]=_0x10dccb[_0x4db9('0x3e')];agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3f')]=agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x11')];}}catch(_0x4e88c2){utils[_0x4db9('0x18')](util['format'](_0x4db9('0x37'),_0x10dccb['uniqueid']),_0x4e88c2);}};exports['attendedtransfer']=function(_0x2604bf){try{utils['debug'](util[_0x4db9('0x3')](_0x4db9('0x40'),_0x2604bf[_0x4db9('0x41')]),_0x2604bf);if(_0x2604bf[_0x4db9('0x41')]==_0x2604bf['origtransfererlinkedid']){if(!_[_0x4db9('0x1a')](agents[_0x2604bf['secondtransfereruniqueid']])){utils[_0x4db9('0x16')](util[_0x4db9('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2604bf[_0x4db9('0x41')],agents[_0x2604bf['secondtransfereruniqueid']][_0x4db9('0x1d')]));agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3a')]=!![];agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3b')]=_0x4db9('0x43');agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3d')]=_0x2604bf[_0x4db9('0x44')];agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3f')]=_0x2604bf[_0x4db9('0x41')];}if(_0x2604bf[_0x4db9('0x45')]&&agents[_0x2604bf[_0x4db9('0x45')]]){agents[_0x2604bf[_0x4db9('0x45')]]['agententerreason']=0x1;transfers[_0x2604bf[_0x4db9('0x45')]]=_[_0x4db9('0x46')](agents[_0x2604bf['transfereeuniqueid']]);transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x6')]=agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x6')];transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x47')]=agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x47')];transfers[_0x2604bf[_0x4db9('0x45')]]['agentcalledAt']=utils['now']();transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x34')]=utils[_0x4db9('0x1f')]();transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x22')]=0x0;transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x48')]=0x2;}}else if(_0x2604bf[_0x4db9('0x42')]==_0x2604bf[_0x4db9('0x49')]){if(!_[_0x4db9('0x1a')](agents[_0x2604bf['origtransfereruniqueid']])){utils[_0x4db9('0x16')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x2604bf['origtransfereruniqueid'],agents[_0x2604bf['origtransfereruniqueid']][_0x4db9('0x1d')]));agents[_0x2604bf['origtransfereruniqueid']]['transfer']=!![];agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3b')]=_0x4db9('0x43');agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3d')]=_0x2604bf[_0x4db9('0x4a')];agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3f')]=_0x2604bf[_0x4db9('0x42')];}if(_0x2604bf[_0x4db9('0x4b')]&&agents[_0x2604bf[_0x4db9('0x4b')]]){agents[_0x2604bf[_0x4db9('0x4b')]][_0x4db9('0x48')]=0x1;transfers[_0x2604bf[_0x4db9('0x4b')]]=_[_0x4db9('0x46')](agents[_0x2604bf[_0x4db9('0x4b')]]);transfers[_0x2604bf['transfertargetuniqueid']]['calleridnum']=agents[_0x2604bf['origtransfereruniqueid']][_0x4db9('0x6')];transfers[_0x2604bf['transfertargetuniqueid']][_0x4db9('0x47')]=agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x47')];transfers[_0x2604bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4db9('0x1f')]();transfers[_0x2604bf['transfertargetuniqueid']][_0x4db9('0x34')]=utils[_0x4db9('0x1f')]();transfers[_0x2604bf[_0x4db9('0x4b')]][_0x4db9('0x22')]=0x0;transfers[_0x2604bf[_0x4db9('0x4b')]]['agententerreason']=0x2;}}}catch(_0x1c2c6d){utils['error'](util[_0x4db9('0x3')](_0x4db9('0x40'),_0x2604bf[_0x4db9('0x41')]),_0x1c2c6d);}};exports[_0x4db9('0x4c')]=function(_0x12c1b5){try{utils['debug'](util['format'](_0x4db9('0x4d'),_0x12c1b5[_0x4db9('0x11')]),_0x12c1b5);if(agents[_0x12c1b5['uniqueid']]&&agents[_0x12c1b5['uniqueid']][_0x4db9('0x21')]==='timeout'){if(_0x12c1b5[_0x4db9('0x4e')]==='21'){agents[_0x12c1b5['uniqueid']][_0x4db9('0x21')]=_0x4db9('0x4f');agents[_0x12c1b5['uniqueid']]['lastevent']=_0x4db9('0x4f');}utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5[_0x4db9('0x11')],agents[_0x12c1b5['uniqueid']]['membername'],agents[_0x12c1b5['uniqueid']]['reason'],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x7')]));writeDB(agents[_0x12c1b5[_0x4db9('0x11')]]);var _0x3a7b70=unanswered['indexOf'](_0x12c1b5[_0x4db9('0x11')]);if(_0x3a7b70>-0x1){unanswered['splice'](_0x3a7b70,0x1);}}if(transfers[_0x12c1b5[_0x4db9('0x11')]]){transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0xc')]=!![];transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();transfers[_0x12c1b5[_0x4db9('0x11')]]['talktime']=utils[_0x4db9('0x33')](transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')],transfers[_0x12c1b5['uniqueid']][_0x4db9('0x34')]);transfers[_0x12c1b5[_0x4db9('0x11')]]['reason']='agent';transfers[_0x12c1b5[_0x4db9('0x11')]]['lastevent']='complete';utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5['uniqueid'],transfers[_0x12c1b5['uniqueid']]['membername'],transfers[_0x12c1b5['uniqueid']]['reason'],transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x7')]));writeDB(transfers[_0x12c1b5[_0x4db9('0x11')]],!![]);}if(agents[_0x12c1b5[_0x4db9('0x11')]]&&agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x34')]){agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0xc')]=!![];agents[_0x12c1b5['uniqueid']][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x24')]=utils[_0x4db9('0x33')](agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')],agents[_0x12c1b5[_0x4db9('0x11')]]['agentconnectAt']);agents[_0x12c1b5[_0x4db9('0x11')]]['reason']=agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x3a')]?_0x4db9('0x3a'):_0x4db9('0x51');agents[_0x12c1b5['uniqueid']]['lastevent']=_0x4db9('0x35');utils['info'](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5[_0x4db9('0x11')],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x1d')],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x21')],agents[_0x12c1b5[_0x4db9('0x11')]]['lastevent']));writeDB(agents[_0x12c1b5[_0x4db9('0x11')]]);}}catch(_0xdc3e6f){utils[_0x4db9('0x18')](util[_0x4db9('0x3')]('[%s][agents][hangup]',_0x12c1b5[_0x4db9('0x11')]),_0xdc3e6f);}}; \ No newline at end of file +var _0x9354=['agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','transfer','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x219f1c,_0x4ad16b){var _0x51781e=function(_0x5e34f2){while(--_0x5e34f2){_0x219f1c['push'](_0x219f1c['shift']());}};_0x51781e(++_0x4ad16b);}(_0x9354,0x96));var _0x4935=function(_0x4f3cd1,_0x4b666e){_0x4f3cd1=_0x4f3cd1-0x0;var _0x4f304d=_0x9354[_0x4f3cd1];return _0x4f304d;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var utils=require(_0x4935('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4896da,_0x263dd5){utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x4'),_0x4896da['uniqueid'],_0x4896da[_0x4935('0x5')],_0x4896da[_0x4935('0x6')],_0x4896da[_0x4935('0x7')],_0x4896da[_0x4935('0x8')],_0x4896da[_0x4935('0x9')],_0x4896da[_0x4935('0xa')],_0x4896da[_0x4935('0xb')]));if(_0x4896da[_0x4935('0x6')]){utils[_0x4935('0xc')](_0x4896da['queue'])[_0x4935('0xd')](function(_0x47a44f){if(_0x47a44f){_0x4896da[_0x4935('0xe')]=_0x47a44f[_0x4935('0xe')];_0x4896da[_0x4935('0xf')]=_0x4896da[_0x4935('0x10')]?_0x47a44f[_0x4935('0x11')]:![];_0x4896da[_0x4935('0x12')]=_0x4896da['agentacw']?_0x47a44f['acwTimeout']:0x0;}utils[_0x4935('0x13')]('CreateVoiceAgentReport',_0x4896da);});}else{utils['request'](_0x4935('0x14'),_0x4896da);}if(_0x263dd5){delete transfers[_0x4896da[_0x4935('0x15')]];}else{delete agents[_0x4896da[_0x4935('0x16')]];}}exports[_0x4935('0x17')]=function(_0x3b246a){try{utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x19'),_0x3b246a[_0x4935('0x15')]),_0x3b246a);agents[_0x3b246a[_0x4935('0x16')]]=_0x3b246a;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x1c');agents[_0x3b246a['destuniqueid']][_0x4935('0xa')]=null;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1d')]=null;utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x1e'),_0x3b246a['uniqueid'],agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x7')],_0x3b246a['destuniqueid']));}catch(_0x288eff){utils[_0x4935('0x1f')](util[_0x4935('0x3')]('[%s][agents][agentcalled]',_0x3b246a['uniqueid']),_0x288eff);}};exports[_0x4935('0x20')]=function(_0x6b849f){try{if(!_[_0x4935('0x21')](agents[_0x6b849f[_0x4935('0x16')]])){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x6b849f);utils['info'](util[_0x4935('0x3')](_0x4935('0x23'),_0x6b849f[_0x4935('0x15')],agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x7')],_0x6b849f['destuniqueid']));agents[_0x6b849f['destuniqueid']][_0x4935('0x20')]=!![];agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x24')]=utils[_0x4935('0x1b')]();agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x26')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x27')]=_0x6b849f[_0x4935('0x28')]?parseInt(_0x6b849f[_0x4935('0x28')])/0x3e8:0x0;agents[_0x6b849f[_0x4935('0x16')]]['talktime']=0x0;unanswered['push'](_0x6b849f['destuniqueid']);}}catch(_0x1fc218){utils[_0x4935('0x1f')](util['format'](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x1fc218);}};exports[_0x4935('0x29')]=function(_0x9fe9f6){try{_[_0x4935('0x2a')](agents,function(_0x24262e,_0x28afc2){if(_0x24262e[_0x4935('0x15')]==_0x9fe9f6['uniqueid']&&!_[_0x4935('0x2b')](unanswered,_0x24262e[_0x4935('0x16')])){utils['debug'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x9fe9f6);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x2d'),_0x9fe9f6['uniqueid'],_0x24262e['membername'],_0x24262e[_0x4935('0x16')]));_0x24262e[_0x4935('0x20')]=!![];_0x24262e['agentringnoanswerAt']=utils[_0x4935('0x1b')]();_0x24262e[_0x4935('0xb')]=_0x4935('0x2e');_0x24262e[_0x4935('0x26')]=_0x4935('0x2e');_0x24262e['holdtime']=_0x9fe9f6['holdtime'];_0x24262e[_0x4935('0x2f')]=0x0;writeDB(_0x24262e);}});}catch(_0x1016cc){utils['error'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x1016cc);}};exports[_0x4935('0x30')]=function(_0x3f32fb){try{if(agents[_0x3f32fb[_0x4935('0x16')]]){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x31'),_0x3f32fb['uniqueid']),_0x3f32fb);utils[_0x4935('0x2')](util['format'](_0x4935('0x32'),_0x3f32fb['uniqueid'],agents[_0x3f32fb[_0x4935('0x16')]]['membername'],_0x3f32fb[_0x4935('0x16')]));agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0x33')]=utils[_0x4935('0x1b')]();agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0xa')]=_0x3f32fb[_0x4935('0xa')];agents[_0x3f32fb['destuniqueid']]['connectedlinename']=_0x3f32fb[_0x4935('0x1d')];agents[_0x3f32fb['destuniqueid']]['holdtime']=_0x3f32fb[_0x4935('0x28')];agents[_0x3f32fb['destuniqueid']][_0x4935('0xb')]=_0x4935('0x34');_[_0x4935('0x2a')](agents,function(_0x99b7c5,_0xb366e6){if(_0x99b7c5['destuniqueid']!=_0x3f32fb['destuniqueid']&&_0x99b7c5[_0x4935('0x15')]==_0x3f32fb[_0x4935('0x15')]){_0x99b7c5[_0x4935('0x2f')]=0x0;_0x99b7c5[_0x4935('0x27')]=_0x3f32fb[_0x4935('0x28')];_0x99b7c5[_0x4935('0x20')]=!![];_0x99b7c5[_0x4935('0x24')]=utils[_0x4935('0x1b')]();_0x99b7c5['lastevent']='answered_elsewhere';_0x99b7c5[_0x4935('0x26')]=_0x4935('0x35');_0x99b7c5['answeredelsewheredestinationuniqueid']=_0x3f32fb[_0x4935('0x16')];_0x99b7c5[_0x4935('0x36')]=_0x3f32fb[_0x4935('0x7')];writeDB(_0x99b7c5);}});}}catch(_0xe5c9f5){utils['error'](util['format'](_0x4935('0x31'),_0x3f32fb[_0x4935('0x15')]),_0xe5c9f5);}};exports['agentcomplete']=function(_0x1eaa47){try{if(!_[_0x4935('0x21')](agents[_0x1eaa47[_0x4935('0x16')]])){utils['debug'](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0x1eaa47);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x38'),_0x1eaa47[_0x4935('0x15')],agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x7')],_0x1eaa47[_0x4935('0x16')]));agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x10')]=!![];agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x39')]=utils[_0x4935('0x1b')]();agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x2f')]=utils[_0x4935('0x3a')](agents[_0x1eaa47['destuniqueid']][_0x4935('0x39')],agents[_0x1eaa47['destuniqueid']][_0x4935('0x33')]);agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x26')]=_0x1eaa47[_0x4935('0x26')];agents[_0x1eaa47['destuniqueid']][_0x4935('0xb')]=_0x4935('0x3b');writeDB(agents[_0x1eaa47[_0x4935('0x16')]]);}}catch(_0xa55ce1){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0xa55ce1);}};exports[_0x4935('0x3c')]=function(_0x392cba){try{if(!_['isNil'](agents[_0x392cba[_0x4935('0x3d')]])){utils[_0x4935('0x18')](util['format'](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x392cba);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x3f'),_0x392cba[_0x4935('0x15')],agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x7')],agents[_0x392cba['transfereruniqueid']][_0x4935('0x15')]));agents[_0x392cba['transfereruniqueid']]['transfer']=!![];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x40')]=_0x4935('0x41');agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x42')]=_0x392cba['extension'];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x43')]=agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x15')];}}catch(_0x377ff4){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x377ff4);}};exports[_0x4935('0x44')]=function(_0x4c1fb4){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x4c1fb4);if(_0x4c1fb4['origtransfereruniqueid']==_0x4c1fb4[_0x4935('0x47')]){if(!_['isNil'](agents[_0x4c1fb4['secondtransfereruniqueid']])){utils['info'](util[_0x4935('0x3')](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x7')]));agents[_0x4c1fb4['secondtransfereruniqueid']]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x40')]=_0x4935('0x4a');agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x4b')];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x43')]=_0x4c1fb4['origtransfereruniqueid'];}if(_0x4c1fb4[_0x4935('0x4c')]&&agents[_0x4c1fb4['transfereeuniqueid']]){agents[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x4c1fb4[_0x4935('0x4c')]]=_[_0x4935('0x4d')](agents[_0x4c1fb4['transfereeuniqueid']]);transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x9')]=agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x1a')]=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x4c1fb4[_0x4935('0x49')]==_0x4c1fb4[_0x4935('0x4f')]){if(!_[_0x4935('0x21')](agents[_0x4c1fb4['origtransfereruniqueid']])){utils[_0x4935('0x2')](util['format'](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x7')]));agents[_0x4c1fb4[_0x4935('0x46')]]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x40')]='ATTENDED';agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x50')];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x43')]=_0x4c1fb4[_0x4935('0x49')];}if(_0x4c1fb4[_0x4935('0x51')]&&agents[_0x4c1fb4[_0x4935('0x51')]]){agents[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x52')]=0x1;transfers[_0x4c1fb4[_0x4935('0x51')]]=_['clone'](agents[_0x4c1fb4[_0x4935('0x51')]]);transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x9')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();transfers[_0x4c1fb4[_0x4935('0x51')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfertargetuniqueid']][_0x4935('0x52')]=0x2;}}}catch(_0x30e77f){utils['error'](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x30e77f);}};exports[_0x4935('0x53')]=function(_0x2abd63){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x54'),_0x2abd63[_0x4935('0x15')]),_0x2abd63);if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63[_0x4935('0x15')]]['reason']===_0x4935('0x25')){if(_0x2abd63['cause']==='21'){agents[_0x2abd63['uniqueid']][_0x4935('0x26')]=_0x4935('0x55');agents[_0x2abd63['uniqueid']][_0x4935('0xb')]=_0x4935('0x55');}utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63['uniqueid'],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0x26')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63[_0x4935('0x15')]]);var _0x2eae00=unanswered[_0x4935('0x57')](_0x2abd63['uniqueid']);if(_0x2eae00>-0x1){unanswered[_0x4935('0x58')](_0x2eae00,0x1);}}if(transfers[_0x2abd63[_0x4935('0x15')]]){transfers[_0x2abd63[_0x4935('0x15')]]['agentcomplete']=!![];transfers[_0x2abd63['uniqueid']][_0x4935('0x39')]=utils[_0x4935('0x1b')]();transfers[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](transfers[_0x2abd63['uniqueid']][_0x4935('0x39')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x33')]);transfers[_0x2abd63['uniqueid']]['reason']=_0x4935('0x59');transfers[_0x2abd63['uniqueid']][_0x4935('0xb')]='complete';utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x7')],transfers[_0x2abd63[_0x4935('0x15')]]['reason'],transfers[_0x2abd63[_0x4935('0x15')]]['lastevent']));writeDB(transfers[_0x2abd63[_0x4935('0x15')]],!![]);}if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63['uniqueid']][_0x4935('0x33')]){agents[_0x2abd63['uniqueid']][_0x4935('0x10')]=!![];agents[_0x2abd63[_0x4935('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](agents[_0x2abd63['uniqueid']][_0x4935('0x39')],agents[_0x2abd63['uniqueid']][_0x4935('0x33')]);agents[_0x2abd63['uniqueid']]['reason']=agents[_0x2abd63['uniqueid']][_0x4935('0x5a')]?'transfer':_0x4935('0x59');agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]=_0x4935('0x3b');utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]]['reason'],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63['uniqueid']]);}}catch(_0x390767){utils['error'](util[_0x4935('0x3')](_0x4935('0x54'),_0x2abd63['uniqueid']),_0x390767);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0f51688..b63c9ab 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 _0x6440=['variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','lastIndexOf','includes','noop','execif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','debug','[%s][calls][newstate]','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','channelstate','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]'];(function(_0x123829,_0x210530){var _0x19fece=function(_0x454be3){while(--_0x454be3){_0x123829['push'](_0x123829['shift']());}};_0x19fece(++_0x210530);}(_0x6440,0x1de));var _0x0644=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x6440[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x0644('0x0'));var util=require(_0x0644('0x1'));var utils=require('./utils');var transfers=require(_0x0644('0x2'));var dispositions=[_0x0644('0x3'),_0x0644('0x4'),'FAILED',_0x0644('0x3'),_0x0644('0x3'),_0x0644('0x3'),_0x0644('0x5'),_0x0644('0x6'),_0x0644('0x4'),_0x0644('0x4'),_0x0644('0x4')];var channels={};function writeDB(_0x4c13a5){var _0xec9447;if(transfers['blinds'][_0x4c13a5['uniqueid']]){_0xec9447=_0x4c13a5['uniqueid'];_0x4c13a5[_0x0644('0x7')]=transfers[_0x0644('0x8')][_0x4c13a5[_0x0644('0x7')]][_0x0644('0x9')];}utils[_0x0644('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4c13a5[_0x0644('0x7')],_0x4c13a5[_0x0644('0xb')],_0x4c13a5[_0x0644('0xc')],_0x4c13a5[_0x0644('0xd')],_0x4c13a5[_0x0644('0xe')],_0x4c13a5[_0x0644('0xf')],_0x4c13a5[_0x0644('0x10')],_0x4c13a5[_0x0644('0x11')]));if(_0x4c13a5[_0x0644('0x12')]){utils[_0x0644('0x13')](_0x4c13a5[_0x0644('0x12')])[_0x0644('0x14')](function(_0x4e5d83){if(_0x4e5d83){_0x4c13a5[_0x0644('0x15')]=_0x4e5d83['id'];}utils[_0x0644('0x16')](_0x0644('0x17'),_0x4c13a5);});}else{utils[_0x0644('0x16')](_0x0644('0x17'),_0x4c13a5);}if(channels[_0x4c13a5[_0x0644('0x7')]]){delete channels[_0x4c13a5[_0x0644('0x7')]];}else if(_0xec9447&&channels[_0xec9447]){if(!transfers['blinds'][_0xec9447][_0x0644('0x18')])delete transfers[_0x0644('0x8')][_0xec9447];delete channels[_0xec9447];}}exports[_0x0644('0x19')]=function(_0x45991e){try{utils['debug'](util[_0x0644('0x1a')](_0x0644('0x1b'),_0x45991e[_0x0644('0x7')]),_0x45991e);if(_0x45991e[_0x0644('0x7')]==_0x45991e[_0x0644('0x1c')]&&_0x45991e[_0x0644('0xb')]!=_0x0644('0x1d')){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x1e'),_0x45991e[_0x0644('0x7')],_0x45991e[_0x0644('0x1f')],_0x45991e[_0x0644('0x20')]));channels[_0x45991e[_0x0644('0x7')]]={'uniqueid':_0x45991e[_0x0644('0x7')],'accountcode':_0x45991e[_0x0644('0x12')],'source':_0x45991e[_0x0644('0xf')],'destination':_0x45991e['exten'],'destinationcontext':_0x45991e[_0x0644('0x1f')],'channel':_0x45991e['channel'],'starttime':utils[_0x0644('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0644('0x3'),'amaflags':_0x0644('0x22')};}}catch(_0x733c72){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x1b'),_0x45991e[_0x0644('0x7')]),_0x733c72);}};exports['newstate']=function(_0x52dec2){try{utils[_0x0644('0x24')](util['format'](_0x0644('0x25'),_0x52dec2[_0x0644('0x7')]),_0x52dec2);if(!_[_0x0644('0x26')](channels[_0x52dec2[_0x0644('0x7')]])&&_0x52dec2['channelstate']==0x6){utils['info'](util[_0x0644('0x1a')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x52dec2[_0x0644('0x7')],_0x52dec2['context'],_0x52dec2[_0x0644('0xb')]));if(_['isNil'](channels[_0x52dec2[_0x0644('0x7')]][_0x0644('0x27')])){channels[_0x52dec2[_0x0644('0x7')]][_0x0644('0x27')]=utils[_0x0644('0x21')]();}}else if(!_[_0x0644('0x26')](channels[_0x52dec2['linkedid']])&&_0x52dec2['channelstate']==0x6&&_0x52dec2[_0x0644('0x1f')]!=_0x0644('0x28')){utils['info'](util[_0x0644('0x1a')](_0x0644('0x29'),_0x52dec2['uniqueid'],_0x52dec2[_0x0644('0x1c')],_0x52dec2[_0x0644('0x1f')],_0x52dec2['channel']));channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x12')]=_0x52dec2[_0x0644('0x12')];channels[_0x52dec2[_0x0644('0x1c')]]['destinationchannel']=_0x52dec2[_0x0644('0xb')];if(_[_0x0644('0x26')](channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x2a')])){channels[_0x52dec2[_0x0644('0x1c')]]['answertime']=utils['now']();}channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x2b')]=dispositions[_[_0x0644('0x2c')](_0x52dec2[_0x0644('0x2d')])]||_0x0644('0x5');}}catch(_0x2b4a38){utils['error'](util[_0x0644('0x1a')]('[%s][calls][newstate]',_0x52dec2['uniqueid']),_0x2b4a38);}};exports[_0x0644('0x2e')]=function(_0x75b7a0){try{if(!_[_0x0644('0x26')](channels[_0x75b7a0['uniqueid']])){utils['debug'](util[_0x0644('0x1a')]('[%s][calls][hangup]',_0x75b7a0[_0x0644('0x7')]),_0x75b7a0);if(_[_0x0644('0x26')](channels[_0x75b7a0['uniqueid']]['callerid'])){channels[_0x75b7a0['uniqueid']][_0x0644('0x2f')]=_0x75b7a0['calleridname']+'\x20<'+_0x75b7a0[_0x0644('0xf')]+'>';}utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x30'),_0x75b7a0[_0x0644('0x7')],channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x2f')],_0x75b7a0[_0x0644('0x31')]));channels[_0x75b7a0['uniqueid']]['endtime']=utils[_0x0644('0x21')]();channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x32')]=utils[_0x0644('0x33')](channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x34')],channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x35')]);channels[_0x75b7a0[_0x0644('0x7')]]['billableseconds']=channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x2a')]?utils['diffTime'](channels[_0x75b7a0['uniqueid']][_0x0644('0x34')],channels[_0x75b7a0[_0x0644('0x7')]]['answertime']):0x0;writeDB(channels[_0x75b7a0[_0x0644('0x7')]]);}}catch(_0x3a6403){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x36'),_0x75b7a0[_0x0644('0x7')]),_0x3a6403);}};exports[_0x0644('0x37')]=function(_0x3e8115){try{if(!_['isNil'](channels[_0x3e8115[_0x0644('0x38')]])){utils[_0x0644('0x24')](util['format'](_0x0644('0x39'),_0x3e8115[_0x0644('0x3a')]),_0x3e8115);if(channels[_0x3e8115[_0x0644('0x38')]]['channel']==_0x3e8115[_0x0644('0x3b')]){utils[_0x0644('0xa')](util[_0x0644('0x1a')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3e8115['origtransfereruniqueid'],_0x3e8115[_0x0644('0x38')],_0x3e8115['secondtransfererchannel']));channels[_0x3e8115[_0x0644('0x38')]]['destinationchannel']=_0x3e8115[_0x0644('0x3c')];channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x3d')]=_0x0644('0x3e');}else if(channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0xb')]=_0x3e8115[_0x0644('0x3f')]){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x40'),_0x3e8115[_0x0644('0x3a')],_0x3e8115['localtwolinkedid'],_0x3e8115['origtransfererchannel']));channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x41')]=_0x3e8115[_0x0644('0x42')];channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x3d')]=_0x0644('0x3e');}}}catch(_0x5a82e4){utils['error'](util[_0x0644('0x1a')](_0x0644('0x39'),_0x3e8115['origtransfereruniqueid']),_0x5a82e4);}};exports[_0x0644('0x43')]=function(_0x14aa0d){try{if(!_[_0x0644('0x26')](channels[_0x14aa0d['uniqueid']])){utils[_0x0644('0x24')](util[_0x0644('0x1a')](_0x0644('0x44'),_0x14aa0d[_0x0644('0x7')]),_0x14aa0d);channels[_0x14aa0d[_0x0644('0x7')]]['musiconholdstartAt']=utils[_0x0644('0x21')]();utils[_0x0644('0xa')](util['format'](_0x0644('0x45'),_0x14aa0d[_0x0644('0x7')],channels[_0x14aa0d['uniqueid']]['musiconholdstartAt']));}}catch(_0x4b5b9e){utils['error'](util[_0x0644('0x1a')](_0x0644('0x44'),_0x14aa0d['uniqueid']),_0x4b5b9e);}};exports[_0x0644('0x46')]=function(_0x128c7e){try{if(!_['isNil'](channels[_0x128c7e[_0x0644('0x7')]])){utils['debug'](util[_0x0644('0x1a')](_0x0644('0x47'),_0x128c7e[_0x0644('0x7')]),_0x128c7e);if(!_['isNil'](channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x48')])){channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x49')]+=utils[_0x0644('0x33')](utils[_0x0644('0x21')](),channels[_0x128c7e['uniqueid']][_0x0644('0x48')]);utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x4a'),_0x128c7e[_0x0644('0x7')],channels[_0x128c7e[_0x0644('0x7')]]['mohtime']));delete channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x48')];}}}catch(_0x558cef){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x47'),_0x128c7e['uniqueid']),_0x558cef);}};exports[_0x0644('0x4b')]=function(_0x2096f4){try{if(!_[_0x0644('0x26')](channels[_0x2096f4[_0x0644('0x7')]])){utils['debug'](util['format'](_0x0644('0x4c'),_0x2096f4['uniqueid']),_0x2096f4);if(!_['isNil'](_0x2096f4[_0x0644('0x4d')]['xmd-originatecalleridnum'])){utils['info'](util[_0x0644('0x1a')](_0x0644('0x4e'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['source']=_0x2096f4[_0x0644('0x4f')];}if(!_['isNil'](_0x2096f4[_0x0644('0x4d')][_0x0644('0x50')])){utils[_0x0644('0xa')](util['format'](_0x0644('0x51'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x52')]=_0x2096f4[_0x0644('0x4f')];channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x2f')]='\x22'+_0x2096f4[_0x0644('0x4f')]+_0x0644('0x53')+_0x2096f4[_0x0644('0x4f')]+'>';}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-callerid-preview'])||!_['isNil'](_0x2096f4[_0x0644('0x4d')][_0x0644('0x54')])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x55'),_0x2096f4[_0x0644('0x7')],!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x56')])?_0x0644('0x56'):'xmd-callerid',_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x2f')]=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-queue'])||!_[_0x0644('0x26')](_0x2096f4['variable']['xmcs-queue'])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x55'),_0x2096f4[_0x0644('0x7')],!_['isNil'](_0x2096f4['variable'][_0x0644('0x57')])?'xmd-queue':_0x0644('0x58'),_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['lastapplication']=_0x0644('0x59');channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x5a')]=_0x2096f4[_0x0644('0x4f')];channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0xc')]=!![];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-contactid'])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x5b'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['ContactId']=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x5c')])){utils['info'](util[_0x0644('0x1a')](_0x0644('0x5d'),_0x2096f4['uniqueid'],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4['uniqueid']]['type']=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x5e')])){utils[_0x0644('0xa')](util['format'](_0x0644('0x5f'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x60')]=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x61')])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x62'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['sipcallid']=_0x2096f4[_0x0644('0x4f')];}}}catch(_0x1a9adf){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x4c'),_0x2096f4[_0x0644('0x7')]),_0x1a9adf);}};exports[_0x0644('0x63')]=function(_0x4639f7){try{if(!_[_0x0644('0x26')](channels[_0x4639f7[_0x0644('0x7')]])){utils[_0x0644('0x24')](util[_0x0644('0x1a')](_0x0644('0x64'),_0x4639f7[_0x0644('0x7')]),_0x4639f7);utils[_0x0644('0xa')](util['format'](_0x0644('0x65'),_0x4639f7[_0x0644('0x7')],_0x4639f7[_0x0644('0x66')],_0x4639f7[_0x0644('0x67')]));if(_0x4639f7['application']['toLowerCase']()==_0x0644('0x68')&&_['startsWith'](_0x4639f7[_0x0644('0x67')][_0x0644('0x69')](),'cdr')){var _0x3e5b8c=_0x4639f7[_0x0644('0x67')][_0x0644('0x6a')]('=');var _0x2259d1=_0x3e5b8c[0x0]['substring'](_0x3e5b8c[0x0][_0x0644('0x6b')]('(')+0x1,_0x3e5b8c[0x0]['lastIndexOf'](')'));var _0x12c9dd=_0x3e5b8c[0x1];channels[_0x4639f7['uniqueid']][_0x2259d1]=_0x12c9dd;}if(!_[_0x0644('0x6c')](['hangup',_0x0644('0x6d'),_0x0644('0x6e'),_0x0644('0x68'),'gotoif'],_0x4639f7[_0x0644('0x66')]['toLowerCase']())){channels[_0x4639f7['uniqueid']]['lastapplication']=_0x4639f7[_0x0644('0x66')];channels[_0x4639f7[_0x0644('0x7')]]['lastdata']=_0x4639f7[_0x0644('0x67')];}}}catch(_0x211b79){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x64'),_0x4639f7[_0x0644('0x7')]),_0x211b79);}}; \ No newline at end of file +var _0x2041=['origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','split','substring','lastIndexOf','includes','noop','execif','gotoif','toLowerCase','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','[%s][calls][newchannel]','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s'];(function(_0x9df1df,_0x5bcbf0){var _0x146ada=function(_0x5146c3){while(--_0x5146c3){_0x9df1df['push'](_0x9df1df['shift']());}};_0x146ada(++_0x5bcbf0);}(_0x2041,0x10d));var _0x1204=function(_0x5f13d9,_0x5d628e){_0x5f13d9=_0x5f13d9-0x0;var _0x146fbf=_0x2041[_0x5f13d9];return _0x146fbf;};'use strict';var _=require(_0x1204('0x0'));var util=require(_0x1204('0x1'));var utils=require('./utils');var transfers=require(_0x1204('0x2'));var dispositions=[_0x1204('0x3'),_0x1204('0x4'),_0x1204('0x4'),'NO\x20ANSWER',_0x1204('0x3'),_0x1204('0x3'),_0x1204('0x5'),_0x1204('0x6'),_0x1204('0x4'),_0x1204('0x4'),_0x1204('0x4')];var channels={};function writeDB(_0x20109d){var _0x332928;if(transfers['blinds'][_0x20109d[_0x1204('0x7')]]){_0x332928=_0x20109d[_0x1204('0x7')];_0x20109d[_0x1204('0x7')]=transfers[_0x1204('0x8')][_0x20109d[_0x1204('0x7')]][_0x1204('0x9')];}utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0xc'),_0x20109d[_0x1204('0x7')],_0x20109d[_0x1204('0xd')],_0x20109d[_0x1204('0xe')],_0x20109d[_0x1204('0xf')],_0x20109d[_0x1204('0x10')],_0x20109d[_0x1204('0x11')],_0x20109d['connectedlinenum'],_0x20109d[_0x1204('0x12')]));if(_0x20109d[_0x1204('0x13')]){utils[_0x1204('0x14')](_0x20109d[_0x1204('0x13')])[_0x1204('0x15')](function(_0x537b90){if(_0x537b90){_0x20109d[_0x1204('0x16')]=_0x537b90['id'];}utils[_0x1204('0x17')](_0x1204('0x18'),_0x20109d);});}else{utils['request'](_0x1204('0x18'),_0x20109d);}if(channels[_0x20109d[_0x1204('0x7')]]){delete channels[_0x20109d[_0x1204('0x7')]];}else if(_0x332928&&channels[_0x332928]){if(!transfers[_0x1204('0x8')][_0x332928][_0x1204('0x19')])delete transfers[_0x1204('0x8')][_0x332928];delete channels[_0x332928];}}exports[_0x1204('0x1a')]=function(_0x5d801f){try{utils['debug'](util[_0x1204('0xb')]('[%s][calls][newchannel]',_0x5d801f[_0x1204('0x7')]),_0x5d801f);if(_0x5d801f[_0x1204('0x7')]==_0x5d801f[_0x1204('0x1b')]&&_0x5d801f['channel']!=_0x1204('0x1c')){utils[_0x1204('0xa')](util['format'](_0x1204('0x1d'),_0x5d801f[_0x1204('0x7')],_0x5d801f[_0x1204('0x1e')],_0x5d801f['exten']));channels[_0x5d801f[_0x1204('0x7')]]={'uniqueid':_0x5d801f[_0x1204('0x7')],'accountcode':_0x5d801f[_0x1204('0x13')],'source':_0x5d801f['calleridnum'],'destination':_0x5d801f['exten'],'destinationcontext':_0x5d801f[_0x1204('0x1e')],'channel':_0x5d801f['channel'],'starttime':utils[_0x1204('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1204('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x35c9be){utils['error'](util['format'](_0x1204('0x20'),_0x5d801f[_0x1204('0x7')]),_0x35c9be);}};exports[_0x1204('0x21')]=function(_0x30146d){try{utils[_0x1204('0x22')](util[_0x1204('0xb')]('[%s][calls][newstate]',_0x30146d[_0x1204('0x7')]),_0x30146d);if(!_[_0x1204('0x23')](channels[_0x30146d[_0x1204('0x7')]])&&_0x30146d[_0x1204('0x24')]==0x6){utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x25'),_0x30146d['uniqueid'],_0x30146d['context'],_0x30146d[_0x1204('0xd')]));if(_[_0x1204('0x23')](channels[_0x30146d['uniqueid']][_0x1204('0x26')])){channels[_0x30146d[_0x1204('0x7')]][_0x1204('0x26')]=utils[_0x1204('0x1f')]();}}else if(!_[_0x1204('0x23')](channels[_0x30146d[_0x1204('0x1b')]])&&_0x30146d[_0x1204('0x24')]==0x6&&_0x30146d['context']!=_0x1204('0x27')){utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x28'),_0x30146d[_0x1204('0x7')],_0x30146d[_0x1204('0x1b')],_0x30146d[_0x1204('0x1e')],_0x30146d[_0x1204('0xd')]));channels[_0x30146d['linkedid']][_0x1204('0x13')]=_0x30146d['accountcode'];channels[_0x30146d[_0x1204('0x1b')]][_0x1204('0x29')]=_0x30146d['channel'];if(_[_0x1204('0x23')](channels[_0x30146d[_0x1204('0x1b')]][_0x1204('0x2a')])){channels[_0x30146d[_0x1204('0x1b')]]['answertime']=utils[_0x1204('0x1f')]();}channels[_0x30146d['linkedid']]['disposition']=dispositions[_[_0x1204('0x2b')](_0x30146d[_0x1204('0x24')])]||'ANSWERED';}}catch(_0x3be9da){utils['error'](util[_0x1204('0xb')](_0x1204('0x2c'),_0x30146d[_0x1204('0x7')]),_0x3be9da);}};exports[_0x1204('0x2d')]=function(_0x2e9833){try{if(!_[_0x1204('0x23')](channels[_0x2e9833[_0x1204('0x7')]])){utils[_0x1204('0x22')](util[_0x1204('0xb')](_0x1204('0x2e'),_0x2e9833[_0x1204('0x7')]),_0x2e9833);if(_[_0x1204('0x23')](channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x2f')])){channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x2f')]=_0x2e9833[_0x1204('0x30')]+'\x20<'+_0x2e9833[_0x1204('0x11')]+'>';}utils['info'](util[_0x1204('0xb')](_0x1204('0x31'),_0x2e9833[_0x1204('0x7')],channels[_0x2e9833[_0x1204('0x7')]]['callerid'],_0x2e9833[_0x1204('0x32')]));channels[_0x2e9833['uniqueid']][_0x1204('0x33')]=utils[_0x1204('0x1f')]();channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x34')]=utils[_0x1204('0x35')](channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x33')],channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x36')]);channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x37')]=channels[_0x2e9833[_0x1204('0x7')]]['answertime']?utils[_0x1204('0x35')](channels[_0x2e9833[_0x1204('0x7')]][_0x1204('0x33')],channels[_0x2e9833['uniqueid']][_0x1204('0x2a')]):0x0;writeDB(channels[_0x2e9833['uniqueid']]);}}catch(_0x1623a9){utils[_0x1204('0x38')](util['format'](_0x1204('0x2e'),_0x2e9833['uniqueid']),_0x1623a9);}};exports['attendedtransfer']=function(_0x637951){try{if(!_[_0x1204('0x23')](channels[_0x637951[_0x1204('0x39')]])){utils[_0x1204('0x22')](util['format'](_0x1204('0x3a'),_0x637951['origtransfereruniqueid']),_0x637951);if(channels[_0x637951[_0x1204('0x39')]][_0x1204('0xd')]==_0x637951[_0x1204('0x3b')]){utils['info'](util[_0x1204('0xb')](_0x1204('0x3c'),_0x637951[_0x1204('0x3d')],_0x637951['localtwolinkedid'],_0x637951[_0x1204('0x3e')]));channels[_0x637951['localtwolinkedid']]['destinationchannel']=_0x637951[_0x1204('0x3e')];channels[_0x637951[_0x1204('0x39')]][_0x1204('0x3f')]=_0x1204('0x40');}else if(channels[_0x637951['localtwolinkedid']][_0x1204('0xd')]=_0x637951[_0x1204('0x41')]){utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x3c'),_0x637951['origtransfereruniqueid'],_0x637951[_0x1204('0x39')],_0x637951[_0x1204('0x42')]));channels[_0x637951[_0x1204('0x39')]][_0x1204('0x29')]=_0x637951[_0x1204('0x42')];channels[_0x637951[_0x1204('0x39')]][_0x1204('0x3f')]='_attended';}}}catch(_0x3c2848){utils['error'](util[_0x1204('0xb')](_0x1204('0x3a'),_0x637951[_0x1204('0x3d')]),_0x3c2848);}};exports['musiconholdstart']=function(_0xff5176){try{if(!_[_0x1204('0x23')](channels[_0xff5176[_0x1204('0x7')]])){utils['debug'](util[_0x1204('0xb')](_0x1204('0x43'),_0xff5176['uniqueid']),_0xff5176);channels[_0xff5176['uniqueid']][_0x1204('0x44')]=utils[_0x1204('0x1f')]();utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x45'),_0xff5176[_0x1204('0x7')],channels[_0xff5176[_0x1204('0x7')]]['musiconholdstartAt']));}}catch(_0x28f3a9){utils[_0x1204('0x38')](util[_0x1204('0xb')](_0x1204('0x43'),_0xff5176[_0x1204('0x7')]),_0x28f3a9);}};exports['musiconholdstop']=function(_0x26b75e){try{if(!_[_0x1204('0x23')](channels[_0x26b75e[_0x1204('0x7')]])){utils[_0x1204('0x22')](util[_0x1204('0xb')](_0x1204('0x46'),_0x26b75e['uniqueid']),_0x26b75e);if(!_[_0x1204('0x23')](channels[_0x26b75e[_0x1204('0x7')]][_0x1204('0x44')])){channels[_0x26b75e[_0x1204('0x7')]][_0x1204('0x47')]+=utils[_0x1204('0x35')](utils[_0x1204('0x1f')](),channels[_0x26b75e['uniqueid']]['musiconholdstartAt']);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x26b75e[_0x1204('0x7')],channels[_0x26b75e[_0x1204('0x7')]]['mohtime']));delete channels[_0x26b75e[_0x1204('0x7')]][_0x1204('0x44')];}}}catch(_0x362bc9){utils[_0x1204('0x38')](util[_0x1204('0xb')](_0x1204('0x46'),_0x26b75e['uniqueid']),_0x362bc9);}};exports['varset']=function(_0x4f6390){try{if(!_['isNil'](channels[_0x4f6390[_0x1204('0x7')]])){utils[_0x1204('0x22')](util['format'](_0x1204('0x48'),_0x4f6390[_0x1204('0x7')]),_0x4f6390);if(!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')]['xmd-originatecalleridnum'])){utils['info'](util[_0x1204('0xb')](_0x1204('0x4a'),_0x4f6390[_0x1204('0x7')],_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x4c')]=_0x4f6390[_0x1204('0x4b')];}if(!_[_0x1204('0x23')](_0x4f6390['variable'][_0x1204('0x4d')])){utils[_0x1204('0xa')](util['format'](_0x1204('0x4e'),_0x4f6390[_0x1204('0x7')],_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390[_0x1204('0x7')]]['destination']=_0x4f6390[_0x1204('0x4b')];channels[_0x4f6390[_0x1204('0x7')]]['callerid']='\x22'+_0x4f6390[_0x1204('0x4b')]+_0x1204('0x4f')+_0x4f6390[_0x1204('0x4b')]+'>';}if(!_['isNil'](_0x4f6390['variable'][_0x1204('0x50')])||!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')][_0x1204('0x51')])){utils['info'](util[_0x1204('0xb')](_0x1204('0x52'),_0x4f6390['uniqueid'],!_['isNil'](_0x4f6390[_0x1204('0x49')][_0x1204('0x50')])?_0x1204('0x50'):_0x1204('0x51'),_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x2f')]=_0x4f6390['value'];}if(!_['isNil'](_0x4f6390[_0x1204('0x49')][_0x1204('0x53')])||!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')][_0x1204('0x54')])){utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x52'),_0x4f6390[_0x1204('0x7')],!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')][_0x1204('0x53')])?_0x1204('0x53'):'xmcs-queue',_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x55')]=_0x1204('0x56');channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x57')]=_0x4f6390['value'];channels[_0x4f6390['uniqueid']][_0x1204('0xe')]=!![];}if(!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')][_0x1204('0x58')])){utils['info'](util[_0x1204('0xb')](_0x1204('0x59'),_0x4f6390[_0x1204('0x7')],_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390['uniqueid']][_0x1204('0x5a')]=_0x4f6390[_0x1204('0x4b')];}if(!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')]['xmd-cdrtype'])){utils['info'](util[_0x1204('0xb')](_0x1204('0x5b'),_0x4f6390['uniqueid'],_0x4f6390['value']));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x5c')]=_0x4f6390['value'];}if(!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')]['outboundrouteid'])){utils[_0x1204('0xa')](util[_0x1204('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x4f6390[_0x1204('0x7')],_0x4f6390[_0x1204('0x4b')]));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x5d')]=_0x4f6390[_0x1204('0x4b')];}if(!_[_0x1204('0x23')](_0x4f6390[_0x1204('0x49')]['sipcallid'])){utils[_0x1204('0xa')](util[_0x1204('0xb')](_0x1204('0x5e'),_0x4f6390[_0x1204('0x7')],_0x4f6390['value']));channels[_0x4f6390[_0x1204('0x7')]][_0x1204('0x5f')]=_0x4f6390[_0x1204('0x4b')];}}}catch(_0x362fe3){utils[_0x1204('0x38')](util[_0x1204('0xb')](_0x1204('0x48'),_0x4f6390[_0x1204('0x7')]),_0x362fe3);}};exports[_0x1204('0x60')]=function(_0x428e8f){try{if(!_[_0x1204('0x23')](channels[_0x428e8f[_0x1204('0x7')]])){utils[_0x1204('0x22')](util[_0x1204('0xb')]('[%s][calls][newexten]',_0x428e8f[_0x1204('0x7')]),_0x428e8f);utils[_0x1204('0xa')](util['format'](_0x1204('0x61'),_0x428e8f[_0x1204('0x7')],_0x428e8f['application'],_0x428e8f[_0x1204('0x62')]));if(_0x428e8f[_0x1204('0x63')]['toLowerCase']()==_0x1204('0x64')&&_[_0x1204('0x65')](_0x428e8f[_0x1204('0x62')]['toLowerCase'](),'cdr')){var _0x2965a6=_0x428e8f['appdata'][_0x1204('0x66')]('=');var _0x594496=_0x2965a6[0x0][_0x1204('0x67')](_0x2965a6[0x0][_0x1204('0x68')]('(')+0x1,_0x2965a6[0x0]['lastIndexOf'](')'));var _0x55d4c1=_0x2965a6[0x1];channels[_0x428e8f[_0x1204('0x7')]][_0x594496]=_0x55d4c1;}if(!_[_0x1204('0x69')]([_0x1204('0x2d'),_0x1204('0x6a'),_0x1204('0x6b'),'set',_0x1204('0x6c')],_0x428e8f[_0x1204('0x63')][_0x1204('0x6d')]())){channels[_0x428e8f['uniqueid']][_0x1204('0x55')]=_0x428e8f['application'];channels[_0x428e8f['uniqueid']][_0x1204('0x57')]=_0x428e8f['appdata'];}}}catch(_0x4df2e8){utils['error'](util[_0x1204('0xb')]('[%s][calls][newexten]',_0x428e8f[_0x1204('0x7')]),_0x4df2e8);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4c183fc..1658afd 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 _0x4e61=['connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x439110,_0x371418){var _0x5394a9=function(_0x49c845){while(--_0x49c845){_0x439110['push'](_0x439110['shift']());}};_0x5394a9(++_0x371418);}(_0x4e61,0x196));var _0x14e6=function(_0x407b07,_0x525c69){_0x407b07=_0x407b07-0x0;var _0x2c9b12=_0x4e61[_0x407b07];return _0x2c9b12;};'use strict';var utils=require(_0x14e6('0x0'));exports[_0x14e6('0x1')]=function(){utils[_0x14e6('0x2')](_0x14e6('0x3'));};exports[_0x14e6('0x4')]=function(){utils[_0x14e6('0x2')]('[core]\x20shutdown');};exports[_0x14e6('0x5')]=function(){utils['info'](_0x14e6('0x6'));};exports['error']=function(_0x36feae){utils['error'](_0x14e6('0x7'),_0x36feae);};exports[_0x14e6('0x8')]=function(){utils[_0x14e6('0x2')](_0x14e6('0x9'));};exports[_0x14e6('0xa')]=function(_0x53b0f1){}; \ No newline at end of file +var _0x6718=['[core]\x20close','managerevent','./utils','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','close'];(function(_0x3e0fab,_0x285e29){var _0x36cde8=function(_0x124a10){while(--_0x124a10){_0x3e0fab['push'](_0x3e0fab['shift']());}};_0x36cde8(++_0x285e29);}(_0x6718,0xec));var _0x8671=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x6718[_0x347471];return _0x422b6a;};'use strict';var utils=require(_0x8671('0x0'));exports['connect']=function(){utils[_0x8671('0x1')]('[core]\x20connected');};exports[_0x8671('0x2')]=function(){utils[_0x8671('0x1')](_0x8671('0x3'));};exports[_0x8671('0x4')]=function(){utils[_0x8671('0x1')](_0x8671('0x5'));};exports['error']=function(_0x589cac){utils['error']('[core]\x20error',_0x589cac);};exports[_0x8671('0x6')]=function(){utils[_0x8671('0x1')](_0x8671('0x7'));};exports[_0x8671('0x8')]=function(_0x172d8a){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c58eba8..16469fc 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 _0x67ea=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','[%s][dials][hangup]','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','value','dialbegin','[%s][dials][dialbegin]','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','assign','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup'];(function(_0x5d353e,_0x4fd21b){var _0x37f99e=function(_0x4a9568){while(--_0x4a9568){_0x5d353e['push'](_0x5d353e['shift']());}};_0x37f99e(++_0x4fd21b);}(_0x67ea,0xfe));var _0xa67e=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0x67ea[_0x584291];return _0x4e7d08;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xa67e('0x0'));var dials={};function writeDB(_0x2941fe){utils[_0xa67e('0x1')](util[_0xa67e('0x2')](_0xa67e('0x3'),_0x2941fe[_0xa67e('0x4')],_0x2941fe['channel'],_0x2941fe['dialstring'],_0x2941fe[_0xa67e('0x5')],_0x2941fe[_0xa67e('0x6')],_0x2941fe[_0xa67e('0x7')]));utils[_0xa67e('0x8')](_0xa67e('0x9'),_0x2941fe);delete dials[_0x2941fe[_0xa67e('0x4')]];}exports[_0xa67e('0xa')]=function(_0x168341){try{utils[_0xa67e('0xb')](util['format'](_0xa67e('0xc'),_0x168341['uniqueid']),_0x168341);utils[_0xa67e('0x1')](util['format'](_0xa67e('0xd'),_0x168341['uniqueid'],_0x168341[_0xa67e('0xe')],_0x168341[_0xa67e('0xf')]));if(_0x168341[_0xa67e('0xe')][_0xa67e('0x10')]()==_0xa67e('0x11')&&_[_0xa67e('0x12')](_0x168341[_0xa67e('0xf')][_0xa67e('0x10')](),_0xa67e('0x13'))){var _0x2e34ed=_0x168341[_0xa67e('0xf')]['split']('=');dials[_0x168341[_0xa67e('0x4')]]={'routeId':_0x2e34ed[0x1]};}}catch(_0x470eee){utils[_0xa67e('0x14')](util['format'](_0xa67e('0xc'),_0x168341[_0xa67e('0x4')]),_0x470eee);}};exports[_0xa67e('0x15')]=function(_0x1d4124){try{utils[_0xa67e('0xb')](util['format'](_0xa67e('0x16'),_0x1d4124[_0xa67e('0x4')]),_0x1d4124);if(!_[_0xa67e('0x17')](_0x1d4124['variable']['outboundrouteid'])){utils['info'](util[_0xa67e('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x1d4124['uniqueid'],_0x1d4124[_0xa67e('0x18')]));dials[_0x1d4124[_0xa67e('0x4')]]={'routeId':_0x1d4124[_0xa67e('0x18')]};}}catch(_0x59e755){utils[_0xa67e('0x14')](util[_0xa67e('0x2')]('[%s][dials][varset]',_0x1d4124['uniqueid']),_0x59e755);}};exports[_0xa67e('0x19')]=function(_0x21f0bf){try{if(!_[_0xa67e('0x17')](dials[_0x21f0bf[_0xa67e('0x4')]])){utils[_0xa67e('0xb')](util[_0xa67e('0x2')](_0xa67e('0x1a'),_0x21f0bf[_0xa67e('0x4')]),_0x21f0bf);dials[_0x21f0bf[_0xa67e('0x4')]]=_['assign'](dials[_0x21f0bf[_0xa67e('0x4')]],_0x21f0bf);dials[_0x21f0bf[_0xa67e('0x4')]]['starttime']=utils['now']();dials[_0x21f0bf[_0xa67e('0x4')]][_0xa67e('0x1b')]=_0xa67e('0x1c');utils[_0xa67e('0x1')](util[_0xa67e('0x2')](_0xa67e('0x1d'),_0x21f0bf['uniqueid'],dials[_0x21f0bf[_0xa67e('0x4')]][_0xa67e('0x1e')]));}}catch(_0x1d7be6){utils[_0xa67e('0x14')](util['format'](_0xa67e('0x1a'),_0x21f0bf[_0xa67e('0x4')]),_0x1d7be6);}};exports[_0xa67e('0x1f')]=function(_0x379dc1){try{if(!_[_0xa67e('0x17')](dials[_0x379dc1[_0xa67e('0x4')]])){utils[_0xa67e('0xb')](util[_0xa67e('0x2')](_0xa67e('0x20'),_0x379dc1[_0xa67e('0x4')]),_0x379dc1);dials[_0x379dc1[_0xa67e('0x4')]][_0xa67e('0x7')]=_0x379dc1[_0xa67e('0x7')];if(_0x379dc1[_0xa67e('0x7')]==_0xa67e('0x21')){dials[_0x379dc1[_0xa67e('0x4')]]=_[_0xa67e('0x22')](dials[_0x379dc1[_0xa67e('0x4')]],_0x379dc1);dials[_0x379dc1['uniqueid']]['answertime']=utils[_0xa67e('0x23')]();dials[_0x379dc1['uniqueid']][_0xa67e('0x1b')]=_0xa67e('0x24');utils[_0xa67e('0x1')](util[_0xa67e('0x2')](_0xa67e('0x25'),_0x379dc1[_0xa67e('0x4')],_0x379dc1[_0xa67e('0x7')],dials[_0x379dc1[_0xa67e('0x4')]]['answertime']));}else{utils[_0xa67e('0x1')](util[_0xa67e('0x2')](_0xa67e('0x26'),_0x379dc1[_0xa67e('0x4')],_0x379dc1['dialstatus']));}}}catch(_0x552e0f){utils[_0xa67e('0x14')](util[_0xa67e('0x2')]('[%s][dials][dialend]',_0x379dc1[_0xa67e('0x4')]),_0x552e0f);}};exports[_0xa67e('0x27')]=function(_0x45dd3a){try{if(!_[_0xa67e('0x17')](dials[_0x45dd3a['uniqueid']])){utils[_0xa67e('0xb')](util[_0xa67e('0x2')]('[%s][dials][hangup]',_0x45dd3a['uniqueid']),_0x45dd3a);utils[_0xa67e('0x1')](util[_0xa67e('0x2')](_0xa67e('0x28'),_0x45dd3a['uniqueid'],_0x45dd3a['calleridnum'],_0x45dd3a['calleridname'],_0x45dd3a['cause-txt']));dials[_0x45dd3a[_0xa67e('0x4')]]=_[_0xa67e('0x22')](dials[_0x45dd3a['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xa67e('0x29')});dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x2a')]=utils[_0xa67e('0x2b')](dials[_0x45dd3a['uniqueid']][_0xa67e('0x2c')],dials[_0x45dd3a['uniqueid']][_0xa67e('0x1e')]);dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x2d')]=utils[_0xa67e('0x2b')](dials[_0x45dd3a['uniqueid']][_0xa67e('0x2e')]||dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x2c')],dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x1e')]);dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x2f')]=dials[_0x45dd3a[_0xa67e('0x4')]]['answertime']?utils[_0xa67e('0x2b')](dials[_0x45dd3a[_0xa67e('0x4')]][_0xa67e('0x2c')],dials[_0x45dd3a[_0xa67e('0x4')]]['answertime']):0x0;writeDB(dials[_0x45dd3a[_0xa67e('0x4')]]);}}catch(_0x4432c6){utils[_0xa67e('0x14')](util['format'](_0xa67e('0x30'),_0x45dd3a[_0xa67e('0x4')]),_0x4432c6);}}; \ No newline at end of file +var _0xe2d7=['[%s][dials][newexten]','info','application','set','startsWith','appdata','cdr(routeid)','split','error','varset','variable','outboundrouteid','value','[%s][dials][varset]','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','endtime','diffTime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','request','CreateVoiceDialReport','newexten','debug'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0xe2d7,0x11a));var _0x7e2d=function(_0xf0c489,_0x5162ee){_0xf0c489=_0xf0c489-0x0;var _0x2052ec=_0xe2d7[_0xf0c489];return _0x2052ec;};'use strict';var _=require(_0x7e2d('0x0'));var util=require(_0x7e2d('0x1'));var utils=require(_0x7e2d('0x2'));var dials={};function writeDB(_0x26678f){utils['info'](util[_0x7e2d('0x3')](_0x7e2d('0x4'),_0x26678f[_0x7e2d('0x5')],_0x26678f[_0x7e2d('0x6')],_0x26678f['dialstring'],_0x26678f[_0x7e2d('0x7')],_0x26678f['connectedlinenum'],_0x26678f['dialstatus']));utils[_0x7e2d('0x8')](_0x7e2d('0x9'),_0x26678f);delete dials[_0x26678f[_0x7e2d('0x5')]];}exports[_0x7e2d('0xa')]=function(_0x1c6818){try{utils[_0x7e2d('0xb')](util[_0x7e2d('0x3')](_0x7e2d('0xc'),_0x1c6818[_0x7e2d('0x5')]),_0x1c6818);utils[_0x7e2d('0xd')](util[_0x7e2d('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1c6818[_0x7e2d('0x5')],_0x1c6818[_0x7e2d('0xe')],_0x1c6818['appdata']));if(_0x1c6818['application']['toLowerCase']()==_0x7e2d('0xf')&&_[_0x7e2d('0x10')](_0x1c6818[_0x7e2d('0x11')]['toLowerCase'](),_0x7e2d('0x12'))){var _0x425570=_0x1c6818[_0x7e2d('0x11')][_0x7e2d('0x13')]('=');dials[_0x1c6818[_0x7e2d('0x5')]]={'routeId':_0x425570[0x1]};}}catch(_0x5c9f91){utils[_0x7e2d('0x14')](util['format'](_0x7e2d('0xc'),_0x1c6818['uniqueid']),_0x5c9f91);}};exports[_0x7e2d('0x15')]=function(_0x3052db){try{utils[_0x7e2d('0xb')](util[_0x7e2d('0x3')]('[%s][dials][varset]',_0x3052db[_0x7e2d('0x5')]),_0x3052db);if(!_['isNil'](_0x3052db[_0x7e2d('0x16')][_0x7e2d('0x17')])){utils[_0x7e2d('0xd')](util[_0x7e2d('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3052db[_0x7e2d('0x5')],_0x3052db[_0x7e2d('0x18')]));dials[_0x3052db['uniqueid']]={'routeId':_0x3052db[_0x7e2d('0x18')]};}}catch(_0x4a6d60){utils['error'](util['format'](_0x7e2d('0x19'),_0x3052db[_0x7e2d('0x5')]),_0x4a6d60);}};exports['dialbegin']=function(_0x7d7765){try{if(!_[_0x7e2d('0x1a')](dials[_0x7d7765['uniqueid']])){utils['debug'](util[_0x7e2d('0x3')](_0x7e2d('0x1b'),_0x7d7765[_0x7e2d('0x5')]),_0x7d7765);dials[_0x7d7765[_0x7e2d('0x5')]]=_[_0x7e2d('0x1c')](dials[_0x7d7765['uniqueid']],_0x7d7765);dials[_0x7d7765['uniqueid']][_0x7e2d('0x1d')]=utils[_0x7e2d('0x1e')]();dials[_0x7d7765[_0x7e2d('0x5')]][_0x7e2d('0x1f')]='called';utils['info'](util['format'](_0x7e2d('0x20'),_0x7d7765[_0x7e2d('0x5')],dials[_0x7d7765[_0x7e2d('0x5')]][_0x7e2d('0x1d')]));}}catch(_0x3b791e){utils[_0x7e2d('0x14')](util[_0x7e2d('0x3')](_0x7e2d('0x1b'),_0x7d7765[_0x7e2d('0x5')]),_0x3b791e);}};exports[_0x7e2d('0x21')]=function(_0x1a15a1){try{if(!_[_0x7e2d('0x1a')](dials[_0x1a15a1['uniqueid']])){utils[_0x7e2d('0xb')](util[_0x7e2d('0x3')]('[%s][dials][dialend]',_0x1a15a1[_0x7e2d('0x5')]),_0x1a15a1);dials[_0x1a15a1[_0x7e2d('0x5')]][_0x7e2d('0x22')]=_0x1a15a1['dialstatus'];if(_0x1a15a1[_0x7e2d('0x22')]==_0x7e2d('0x23')){dials[_0x1a15a1[_0x7e2d('0x5')]]=_[_0x7e2d('0x1c')](dials[_0x1a15a1['uniqueid']],_0x1a15a1);dials[_0x1a15a1['uniqueid']]['answertime']=utils[_0x7e2d('0x1e')]();dials[_0x1a15a1['uniqueid']][_0x7e2d('0x1f')]=_0x7e2d('0x24');utils[_0x7e2d('0xd')](util[_0x7e2d('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1a15a1[_0x7e2d('0x5')],_0x1a15a1[_0x7e2d('0x22')],dials[_0x1a15a1['uniqueid']][_0x7e2d('0x25')]));}else{utils[_0x7e2d('0xd')](util['format'](_0x7e2d('0x26'),_0x1a15a1[_0x7e2d('0x5')],_0x1a15a1['dialstatus']));}}}catch(_0x1b87e6){utils[_0x7e2d('0x14')](util[_0x7e2d('0x3')]('[%s][dials][dialend]',_0x1a15a1[_0x7e2d('0x5')]),_0x1b87e6);}};exports[_0x7e2d('0x27')]=function(_0x139d86){try{if(!_['isNil'](dials[_0x139d86[_0x7e2d('0x5')]])){utils[_0x7e2d('0xb')](util['format'](_0x7e2d('0x28'),_0x139d86[_0x7e2d('0x5')]),_0x139d86);utils[_0x7e2d('0xd')](util['format'](_0x7e2d('0x29'),_0x139d86[_0x7e2d('0x5')],_0x139d86[_0x7e2d('0x7')],_0x139d86[_0x7e2d('0x2a')],_0x139d86[_0x7e2d('0x2b')]));dials[_0x139d86[_0x7e2d('0x5')]]=_[_0x7e2d('0x1c')](dials[_0x139d86['uniqueid']],{'endtime':utils[_0x7e2d('0x1e')](),'lastevent':_0x7e2d('0x2c')});dials[_0x139d86['uniqueid']][_0x7e2d('0x2d')]=utils['diffTime'](dials[_0x139d86[_0x7e2d('0x5')]][_0x7e2d('0x2e')],dials[_0x139d86[_0x7e2d('0x5')]]['starttime']);dials[_0x139d86[_0x7e2d('0x5')]]['holdtime']=utils[_0x7e2d('0x2f')](dials[_0x139d86[_0x7e2d('0x5')]][_0x7e2d('0x25')]||dials[_0x139d86[_0x7e2d('0x5')]]['endtime'],dials[_0x139d86['uniqueid']][_0x7e2d('0x1d')]);dials[_0x139d86['uniqueid']][_0x7e2d('0x30')]=dials[_0x139d86[_0x7e2d('0x5')]][_0x7e2d('0x25')]?utils['diffTime'](dials[_0x139d86['uniqueid']][_0x7e2d('0x2e')],dials[_0x139d86[_0x7e2d('0x5')]][_0x7e2d('0x25')]):0x0;writeDB(dials[_0x139d86['uniqueid']]);}}catch(_0x291fc1){utils['error'](util[_0x7e2d('0x3')](_0x7e2d('0x28'),_0x139d86[_0x7e2d('0x5')]),_0x291fc1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 4b69d4a..6fda77e 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 _0x5f0c=['attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x16593a,_0x5f179d){var _0xa7bcf6=function(_0x45f0e0){while(--_0x45f0e0){_0x16593a['push'](_0x16593a['shift']());}};_0xa7bcf6(++_0x5f179d);}(_0x5f0c,0xd5));var _0xc5f0=function(_0x22075f,_0x100010){_0x22075f=_0x22075f-0x0;var _0x1d7bac=_0x5f0c[_0x22075f];return _0x1d7bac;};var AsteriskManager=require(_0xc5f0('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xc5f0('0x1'));var isXDREnabled=config[_0xc5f0('0x2')]&&config[_0xc5f0('0x2')][_0xc5f0('0x3')]?!config[_0xc5f0('0x2')]['disabled']:!![];var isProduction=config['env']===_0xc5f0('0x4')||![];var isLocalAsterisk=config[_0xc5f0('0x2')]&&config[_0xc5f0('0x2')][_0xc5f0('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xc5f0('0x6')][_0xc5f0('0x7')],config[_0xc5f0('0x6')]['ip'],config[_0xc5f0('0x6')][_0xc5f0('0x8')],config[_0xc5f0('0x6')][_0xc5f0('0x9')],!![]);ami[_0xc5f0('0xa')]();if(!isXDREnabled){utils[_0xc5f0('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xc5f0('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xc5f0('0xd'));var queues=require(_0xc5f0('0xe'));var recordings=require(_0xc5f0('0xf'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xc5f0('0x10'));var core=require('./core.controller');ami['on'](_0xc5f0('0x11'),core[_0xc5f0('0x11')]);ami['on'](_0xc5f0('0x12'),core['shutdown']);ami['on'](_0xc5f0('0x13'),core[_0xc5f0('0x13')]);ami['on'](_0xc5f0('0x14'),core[_0xc5f0('0x14')]);ami['on'](_0xc5f0('0x15'),core[_0xc5f0('0x15')]);ami['on'](_0xc5f0('0x16'),core[_0xc5f0('0x16')]);ami['on'](_0xc5f0('0x17'),function(_0x4753f2){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x19'),_0x4753f2[_0xc5f0('0x1a')]),_0x4753f2);members['devicestatechange'](_0x4753f2);}catch(_0x315e9f){utils['error'](util[_0xc5f0('0x18')](_0xc5f0('0x19'),_0x4753f2[_0xc5f0('0x1a')]),_0x315e9f);}});ami['on'](_0xc5f0('0x1b'),function(_0x3e4031){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x1d'),_0x3e4031[_0xc5f0('0x1e')]),_0x3e4031);agents[_0xc5f0('0x1b')](_0x3e4031);}catch(_0x554971){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')](_0xc5f0('0x1d'),_0x3e4031['uniqueid']),_0x554971);}});ami['on'](_0xc5f0('0x1f'),function(_0x21afd1){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x20'),_0x21afd1[_0xc5f0('0x1e')]),_0x21afd1);agents[_0xc5f0('0x1f')](_0x21afd1);}catch(_0x429de0){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')](_0xc5f0('0x20'),_0x21afd1['uniqueid']),_0x429de0);}});ami['on'](_0xc5f0('0x21'),function(_0x5c3446){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x22'),_0x5c3446[_0xc5f0('0x1e')]),_0x5c3446);agents[_0xc5f0('0x21')](_0x5c3446);queues[_0xc5f0('0x21')](_0x5c3446);}catch(_0x32aa1c){utils['error'](util[_0xc5f0('0x18')](_0xc5f0('0x22'),_0x5c3446[_0xc5f0('0x1e')]),_0x32aa1c);}});ami['on'](_0xc5f0('0x23'),function(_0x4eed11){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')]('[%s][index][agentcomplete]',_0x4eed11[_0xc5f0('0x1e')]),_0x4eed11);agents[_0xc5f0('0x23')](_0x4eed11);queues[_0xc5f0('0x23')](_0x4eed11);members[_0xc5f0('0x23')](_0x4eed11);}catch(_0x27e71a){utils['error'](util[_0xc5f0('0x18')]('[%s][index][agentcomplete]',_0x4eed11[_0xc5f0('0x1e')]),_0x27e71a);}});ami['on'](_0xc5f0('0x24'),function(_0x2f46da){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x25'),_0x2f46da['uniqueid']),_0x2f46da);agents[_0xc5f0('0x24')](_0x2f46da);queues[_0xc5f0('0x24')](_0x2f46da);}catch(_0x302ec5){utils['error'](util['format'](_0xc5f0('0x25'),_0x2f46da[_0xc5f0('0x1e')]),_0x302ec5);}});ami['on'](_0xc5f0('0x26'),function(_0x37f043){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x27'),_0x37f043[_0xc5f0('0x1e')]),_0x37f043);queues[_0xc5f0('0x26')](_0x37f043);recordings[_0xc5f0('0x26')](_0x37f043);}catch(_0x282ba2){utils['error'](util['format'](_0xc5f0('0x27'),_0x37f043[_0xc5f0('0x1e')]),_0x282ba2);}});ami['on'](_0xc5f0('0x28'),function(_0x1a4969){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x29'),_0x1a4969['uniqueid']),_0x1a4969);queues[_0xc5f0('0x28')](_0x1a4969);}catch(_0x17ca90){utils['error'](util['format'](_0xc5f0('0x29'),_0x1a4969['uniqueid']),_0x17ca90);}});ami['on']('musiconholdstart',function(_0x5994ac){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x2a'),_0x5994ac['uniqueid']),_0x5994ac);queues['musiconholdstart'](_0x5994ac);calls[_0xc5f0('0x2b')](_0x5994ac);}catch(_0x498354){utils['error'](util[_0xc5f0('0x18')](_0xc5f0('0x2a'),_0x5994ac[_0xc5f0('0x1e')]),_0x498354);}});ami['on'](_0xc5f0('0x2c'),function(_0x1c95f0){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x2d'),_0x1c95f0[_0xc5f0('0x1e')]),_0x1c95f0);queues[_0xc5f0('0x2c')](_0x1c95f0);calls['musiconholdstop'](_0x1c95f0);}catch(_0x4870e4){utils[_0xc5f0('0x14')](util['format'](_0xc5f0('0x2d'),_0x1c95f0[_0xc5f0('0x1e')]),_0x4870e4);}});ami['on'](_0xc5f0('0x2e'),function(_0x3c7604){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x2f'),_0x3c7604[_0xc5f0('0x1e')]),_0x3c7604);calls['newstate'](_0x3c7604);recordings[_0xc5f0('0x2e')](_0x3c7604);}catch(_0xdf515){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')](_0xc5f0('0x2f'),_0x3c7604['uniqueid']),_0xdf515);}});ami['on']('hangup',function(_0x336c66){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')]('[%s][index][hangup]',_0x336c66[_0xc5f0('0x1e')]),_0x336c66);calls[_0xc5f0('0x30')](_0x336c66);recordings[_0xc5f0('0x30')](_0x336c66);dials[_0xc5f0('0x30')](_0x336c66);agents[_0xc5f0('0x30')](_0x336c66);queues[_0xc5f0('0x30')](_0x336c66);}catch(_0x412977){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')]('[%s][index][hangup]',_0x336c66[_0xc5f0('0x1e')]),_0x412977);}});ami['on'](_0xc5f0('0x31'),function(_0x92cd11){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x32'),_0x92cd11[_0xc5f0('0x1e')]),_0x92cd11);members[_0xc5f0('0x31')](_0x92cd11);}catch(_0x70dcc0){utils[_0xc5f0('0x14')](util['format']('[%s][index][cdr]',_0x92cd11[_0xc5f0('0x1e')]),_0x70dcc0);}});ami['on'](_0xc5f0('0x33'),function(_0x1acdc1){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x34'),_0x1acdc1[_0xc5f0('0x1e')]),_0x1acdc1);queues['blindtransfer'](_0x1acdc1);agents[_0xc5f0('0x33')](_0x1acdc1);transfers[_0xc5f0('0x33')](_0x1acdc1);recordings[_0xc5f0('0x33')](_0x1acdc1);}catch(_0x267c0a){utils['error'](util[_0xc5f0('0x18')](_0xc5f0('0x34'),_0x1acdc1['uniqueid']),_0x267c0a);}});ami['on']('attendedtransfer',function(_0x3cdab6){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x35'),_0x3cdab6[_0xc5f0('0x36')]),_0x3cdab6);queues[_0xc5f0('0x37')](_0x3cdab6);transfers[_0xc5f0('0x37')](_0x3cdab6);agents[_0xc5f0('0x37')](_0x3cdab6);calls[_0xc5f0('0x37')](_0x3cdab6);}catch(_0x54aa5c){utils['error'](util[_0xc5f0('0x18')](_0xc5f0('0x35'),_0x3cdab6[_0xc5f0('0x36')]),_0x54aa5c);}});ami['on'](_0xc5f0('0x38'),function(_0x2294c9){try{utils['debug'](util[_0xc5f0('0x18')]('[%s][index][varset]',_0x2294c9['uniqueid']),_0x2294c9);queues[_0xc5f0('0x38')](_0x2294c9);recordings[_0xc5f0('0x38')](_0x2294c9);calls['varset'](_0x2294c9);dials[_0xc5f0('0x38')](_0x2294c9);}catch(_0xd67dc3){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')](_0xc5f0('0x39'),_0x2294c9[_0xc5f0('0x1e')]),_0xd67dc3);}});ami['on'](_0xc5f0('0x3a'),function(_0x651c6){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x3b'),_0x651c6[_0xc5f0('0x1e')]),_0x651c6);calls[_0xc5f0('0x3a')](_0x651c6);recordings[_0xc5f0('0x3a')](_0x651c6);dials[_0xc5f0('0x3a')](_0x651c6);}catch(_0x4de132){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')](_0xc5f0('0x3b'),_0x651c6[_0xc5f0('0x1e')]),_0x4de132);}});ami['on']('newchannel',function(_0x22a960){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x3c'),_0x22a960[_0xc5f0('0x1e')]),_0x22a960);calls[_0xc5f0('0x3d')](_0x22a960);recordings[_0xc5f0('0x3d')](_0x22a960);}catch(_0x545916){utils['error'](util['format'](_0xc5f0('0x3c'),_0x22a960['uniqueid']),_0x545916);}});ami['on'](_0xc5f0('0x3e'),function(_0x3f085e){try{utils['debug'](util[_0xc5f0('0x18')](_0xc5f0('0x3f'),_0x3f085e[_0xc5f0('0x1e')]),_0x3f085e);dials[_0xc5f0('0x3e')](_0x3f085e);}catch(_0x445ae3){utils[_0xc5f0('0x14')](util['format'](_0xc5f0('0x40'),_0x3f085e[_0xc5f0('0x1e')]),_0x445ae3);}});ami['on'](_0xc5f0('0x41'),function(_0x4ba749){try{utils[_0xc5f0('0x1c')](util[_0xc5f0('0x18')](_0xc5f0('0x42'),_0x4ba749[_0xc5f0('0x1e')]),_0x4ba749);dials[_0xc5f0('0x41')](_0x4ba749);}catch(_0x43cf5f){utils[_0xc5f0('0x14')](util[_0xc5f0('0x18')]('[%s][index][dialend]',_0x4ba749[_0xc5f0('0x1e')]),_0x43cf5f);}});} \ No newline at end of file +var _0xd0b0=['./core.controller','connect','shutdown','fullybooted','close','managerevent','format','[%s][index][devicestatechange]','devicestatechange','error','device','debug','uniqueid','agentcalled','[%s][index][agentringnoanswer]','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','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller'];(function(_0x13c7bd,_0x50d471){var _0x263eed=function(_0x2ce9ba){while(--_0x2ce9ba){_0x13c7bd['push'](_0x13c7bd['shift']());}};_0x263eed(++_0x50d471);}(_0xd0b0,0x10d));var _0x0d0b=function(_0x100fba,_0x56d801){_0x100fba=_0x100fba-0x0;var _0x14b0a4=_0xd0b0[_0x100fba];return _0x14b0a4;};var AsteriskManager=require(_0x0d0b('0x0'));var config=require(_0x0d0b('0x1'));var utils=require(_0x0d0b('0x2'));var util=require(_0x0d0b('0x3'));var isXDREnabled=config['xdr']&&config[_0x0d0b('0x4')][_0x0d0b('0x5')]?!config[_0x0d0b('0x4')][_0x0d0b('0x5')]:!![];var isProduction=config['env']===_0x0d0b('0x6')||![];var isLocalAsterisk=config[_0x0d0b('0x4')]&&config[_0x0d0b('0x4')][_0x0d0b('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x0d0b('0x8')][_0x0d0b('0x9')],config[_0x0d0b('0x8')]['ip'],config['asterisk'][_0x0d0b('0xa')],config['asterisk'][_0x0d0b('0xb')],!![]);ami[_0x0d0b('0xc')]();if(!isXDREnabled){utils[_0x0d0b('0xd')](_0x0d0b('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0d0b('0xd')](_0x0d0b('0xf'));}else{var agents=require(_0x0d0b('0x10'));var calls=require(_0x0d0b('0x11'));var queues=require(_0x0d0b('0x12'));var recordings=require(_0x0d0b('0x13'));var members=require(_0x0d0b('0x14'));var dials=require(_0x0d0b('0x15'));var transfers=require(_0x0d0b('0x16'));var core=require(_0x0d0b('0x17'));ami['on'](_0x0d0b('0x18'),core['connect']);ami['on'](_0x0d0b('0x19'),core[_0x0d0b('0x19')]);ami['on'](_0x0d0b('0x1a'),core[_0x0d0b('0x1a')]);ami['on']('error',core['error']);ami['on'](_0x0d0b('0x1b'),core['close']);ami['on'](_0x0d0b('0x1c'),core[_0x0d0b('0x1c')]);ami['on']('devicestatechange',function(_0x5a09e9){try{utils['debug'](util[_0x0d0b('0x1d')](_0x0d0b('0x1e'),_0x5a09e9['device']),_0x5a09e9);members[_0x0d0b('0x1f')](_0x5a09e9);}catch(_0x514090){utils[_0x0d0b('0x20')](util['format'](_0x0d0b('0x1e'),_0x5a09e9[_0x0d0b('0x21')]),_0x514090);}});ami['on']('agentcalled',function(_0x2bb962){try{utils[_0x0d0b('0x22')](util['format']('[%s][index][agentcalled]',_0x2bb962[_0x0d0b('0x23')]),_0x2bb962);agents[_0x0d0b('0x24')](_0x2bb962);}catch(_0x476c46){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')]('[%s][index][agentcalled]',_0x2bb962[_0x0d0b('0x23')]),_0x476c46);}});ami['on']('agentringnoanswer',function(_0x31e2e4){try{utils['debug'](util[_0x0d0b('0x1d')](_0x0d0b('0x25'),_0x31e2e4[_0x0d0b('0x23')]),_0x31e2e4);agents[_0x0d0b('0x26')](_0x31e2e4);}catch(_0x189cfb){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x25'),_0x31e2e4[_0x0d0b('0x23')]),_0x189cfb);}});ami['on'](_0x0d0b('0x27'),function(_0x114b3d){try{utils[_0x0d0b('0x22')](util['format'](_0x0d0b('0x28'),_0x114b3d[_0x0d0b('0x23')]),_0x114b3d);agents['agentconnect'](_0x114b3d);queues[_0x0d0b('0x27')](_0x114b3d);}catch(_0x3f327c){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')]('[%s][index][agentconnect]',_0x114b3d[_0x0d0b('0x23')]),_0x3f327c);}});ami['on'](_0x0d0b('0x29'),function(_0x119c56){try{utils['debug'](util[_0x0d0b('0x1d')](_0x0d0b('0x2a'),_0x119c56['uniqueid']),_0x119c56);agents[_0x0d0b('0x29')](_0x119c56);queues[_0x0d0b('0x29')](_0x119c56);members[_0x0d0b('0x29')](_0x119c56);}catch(_0x31b88e){utils[_0x0d0b('0x20')](util['format']('[%s][index][agentcomplete]',_0x119c56['uniqueid']),_0x31b88e);}});ami['on'](_0x0d0b('0x2b'),function(_0x5a2fc7){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x2c'),_0x5a2fc7[_0x0d0b('0x23')]),_0x5a2fc7);agents[_0x0d0b('0x2b')](_0x5a2fc7);queues[_0x0d0b('0x2b')](_0x5a2fc7);}catch(_0x1e5a74){utils['error'](util[_0x0d0b('0x1d')](_0x0d0b('0x2c'),_0x5a2fc7['uniqueid']),_0x1e5a74);}});ami['on'](_0x0d0b('0x2d'),function(_0x5da666){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x2e'),_0x5da666['uniqueid']),_0x5da666);queues[_0x0d0b('0x2d')](_0x5da666);recordings[_0x0d0b('0x2d')](_0x5da666);}catch(_0x34633c){utils[_0x0d0b('0x20')](util['format'](_0x0d0b('0x2e'),_0x5da666[_0x0d0b('0x23')]),_0x34633c);}});ami['on'](_0x0d0b('0x2f'),function(_0x58fa0b){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x30'),_0x58fa0b[_0x0d0b('0x23')]),_0x58fa0b);queues['queuecallerleave'](_0x58fa0b);}catch(_0x882bbf){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x30'),_0x58fa0b['uniqueid']),_0x882bbf);}});ami['on'](_0x0d0b('0x31'),function(_0x369576){try{utils['debug'](util[_0x0d0b('0x1d')]('[%s][index][musiconholdstart]',_0x369576['uniqueid']),_0x369576);queues['musiconholdstart'](_0x369576);calls[_0x0d0b('0x31')](_0x369576);}catch(_0x54744c){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x32'),_0x369576[_0x0d0b('0x23')]),_0x54744c);}});ami['on'](_0x0d0b('0x33'),function(_0x2d39e6){try{utils[_0x0d0b('0x22')](util['format']('[%s][index][musiconholdstop]',_0x2d39e6[_0x0d0b('0x23')]),_0x2d39e6);queues[_0x0d0b('0x33')](_0x2d39e6);calls['musiconholdstop'](_0x2d39e6);}catch(_0xa1b0b8){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')]('[%s][index][musiconholdstop]',_0x2d39e6[_0x0d0b('0x23')]),_0xa1b0b8);}});ami['on'](_0x0d0b('0x34'),function(_0x15b51d){try{utils[_0x0d0b('0x22')](util['format'](_0x0d0b('0x35'),_0x15b51d[_0x0d0b('0x23')]),_0x15b51d);calls[_0x0d0b('0x34')](_0x15b51d);recordings['newstate'](_0x15b51d);}catch(_0x2278ad){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x35'),_0x15b51d[_0x0d0b('0x23')]),_0x2278ad);}});ami['on'](_0x0d0b('0x36'),function(_0x4e595e){try{utils[_0x0d0b('0x22')](util['format']('[%s][index][hangup]',_0x4e595e['uniqueid']),_0x4e595e);calls[_0x0d0b('0x36')](_0x4e595e);recordings[_0x0d0b('0x36')](_0x4e595e);dials['hangup'](_0x4e595e);agents[_0x0d0b('0x36')](_0x4e595e);queues[_0x0d0b('0x36')](_0x4e595e);}catch(_0x1dffdc){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')]('[%s][index][hangup]',_0x4e595e[_0x0d0b('0x23')]),_0x1dffdc);}});ami['on'](_0x0d0b('0x37'),function(_0x2d3af4){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')]('[%s][index][cdr]',_0x2d3af4[_0x0d0b('0x23')]),_0x2d3af4);members[_0x0d0b('0x37')](_0x2d3af4);}catch(_0x286f50){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x38'),_0x2d3af4[_0x0d0b('0x23')]),_0x286f50);}});ami['on']('blindtransfer',function(_0x55ab7c){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x39'),_0x55ab7c[_0x0d0b('0x23')]),_0x55ab7c);queues[_0x0d0b('0x3a')](_0x55ab7c);agents[_0x0d0b('0x3a')](_0x55ab7c);transfers[_0x0d0b('0x3a')](_0x55ab7c);recordings[_0x0d0b('0x3a')](_0x55ab7c);}catch(_0x2b4a02){utils['error'](util['format'](_0x0d0b('0x39'),_0x55ab7c['uniqueid']),_0x2b4a02);}});ami['on'](_0x0d0b('0x3b'),function(_0x22d895){try{utils['debug'](util[_0x0d0b('0x1d')](_0x0d0b('0x3c'),_0x22d895[_0x0d0b('0x3d')]),_0x22d895);queues['attendedtransfer'](_0x22d895);transfers[_0x0d0b('0x3b')](_0x22d895);agents['attendedtransfer'](_0x22d895);calls['attendedtransfer'](_0x22d895);}catch(_0x2517fa){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x3c'),_0x22d895[_0x0d0b('0x3d')]),_0x2517fa);}});ami['on'](_0x0d0b('0x3e'),function(_0x29bbd9){try{utils['debug'](util['format'](_0x0d0b('0x3f'),_0x29bbd9[_0x0d0b('0x23')]),_0x29bbd9);queues[_0x0d0b('0x3e')](_0x29bbd9);recordings['varset'](_0x29bbd9);calls[_0x0d0b('0x3e')](_0x29bbd9);dials[_0x0d0b('0x3e')](_0x29bbd9);}catch(_0x25696b){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')]('[%s][index][varset]',_0x29bbd9[_0x0d0b('0x23')]),_0x25696b);}});ami['on'](_0x0d0b('0x40'),function(_0x43d52c){try{utils['debug'](util[_0x0d0b('0x1d')](_0x0d0b('0x41'),_0x43d52c[_0x0d0b('0x23')]),_0x43d52c);calls['newexten'](_0x43d52c);recordings['newexten'](_0x43d52c);dials[_0x0d0b('0x40')](_0x43d52c);}catch(_0x3cfff6){utils[_0x0d0b('0x20')](util['format'](_0x0d0b('0x41'),_0x43d52c['uniqueid']),_0x3cfff6);}});ami['on']('newchannel',function(_0x674b65){try{utils[_0x0d0b('0x22')](util['format'](_0x0d0b('0x42'),_0x674b65[_0x0d0b('0x23')]),_0x674b65);calls[_0x0d0b('0x43')](_0x674b65);recordings[_0x0d0b('0x43')](_0x674b65);}catch(_0xe8e230){utils['error'](util[_0x0d0b('0x1d')](_0x0d0b('0x42'),_0x674b65[_0x0d0b('0x23')]),_0xe8e230);}});ami['on'](_0x0d0b('0x44'),function(_0x5b4d99){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x45'),_0x5b4d99[_0x0d0b('0x23')]),_0x5b4d99);dials['dialbegin'](_0x5b4d99);}catch(_0x4eef6f){utils[_0x0d0b('0x20')](util['format'](_0x0d0b('0x46'),_0x5b4d99['uniqueid']),_0x4eef6f);}});ami['on'](_0x0d0b('0x47'),function(_0x482633){try{utils[_0x0d0b('0x22')](util[_0x0d0b('0x1d')](_0x0d0b('0x48'),_0x482633[_0x0d0b('0x23')]),_0x482633);dials['dialend'](_0x482633);}catch(_0x536660){utils[_0x0d0b('0x20')](util[_0x0d0b('0x1d')](_0x0d0b('0x48'),_0x482633[_0x0d0b('0x23')]),_0x536660);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 33f08a0..bcf84fb 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 _0xad86=['BUSY','voice','TALKING','agent','NOT_INUSE','exitAt','now','duration','diffTime','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','error','cdr','debug','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','type','getUserByInterface','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','format','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad86,0x194));var _0x6ad8=function(_0x28b72e,_0x1862be){_0x28b72e=_0x28b72e-0x0;var _0x2bb662=_0xad86[_0x28b72e];return _0x2bb662;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var utils=require(_0x6ad8('0x2'));var members={};var exclude=[_0x6ad8('0x3'),_0x6ad8('0x4')];function writeDB(_0x1b184a){utils['info'](util['format'](_0x6ad8('0x5'),_0x1b184a[_0x6ad8('0x6')],_0x1b184a[_0x6ad8('0x7')],_0x1b184a[_0x6ad8('0x8')],_0x1b184a['data2'],_0x1b184a['membername'],_0x1b184a[_0x6ad8('0x9')]));if(_0x1b184a[_0x6ad8('0x7')]){utils[_0x6ad8('0xa')](_0x1b184a[_0x6ad8('0x7')])['then'](function(_0x535cce){if(_0x535cce){_0x1b184a[_0x6ad8('0xb')]=_0x535cce[_0x6ad8('0xc')];_0x1b184a[_0x6ad8('0xd')]=_0x535cce[_0x6ad8('0xd')];utils[_0x6ad8('0xe')](_0x6ad8('0xf'),_0x1b184a);}else{utils[_0x6ad8('0x10')](_0x1b184a[_0x6ad8('0x7')][_0x6ad8('0x11')]('/')[0x1])['then'](function(_0x5ad365){if(_0x5ad365){_0x1b184a['membername']=_0x5ad365[_0x6ad8('0xc')];_0x1b184a[_0x6ad8('0xd')]=_0x5ad365['internal'];utils[_0x6ad8('0xe')]('CreateMemberReport',_0x1b184a);}});}})[_0x6ad8('0x12')](function(_0x1e984b){utils['error'](util[_0x6ad8('0x13')]('[%s][members][writeDB]',_0x1b184a[_0x6ad8('0x6')]),_0x1e984b);});}delete members[_0x1b184a[_0x6ad8('0x7')]];}function startsWith(_0x1b900f,_0x19a29e){return _['some'](_0x1b900f,function(_0x412097){return _[_0x6ad8('0x14')](_0x19a29e,_0x412097);});}exports[_0x6ad8('0x15')]=function(_0x300b8d){try{utils['debug'](util[_0x6ad8('0x13')](_0x6ad8('0x16'),members[_0x300b8d['device']]?members[_0x300b8d[_0x6ad8('0x17')]]['uniqueid']:_0x300b8d[_0x6ad8('0x17')]),_0x300b8d);utils[_0x6ad8('0x18')](util[_0x6ad8('0x13')](_0x6ad8('0x19'),members[_0x300b8d['device']]?members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x6')]:_0x300b8d[_0x6ad8('0x17')],_0x300b8d[_0x6ad8('0x1a')],_0x300b8d['device']));switch(_0x300b8d[_0x6ad8('0x1a')]){case _0x6ad8('0x1b'):case _0x6ad8('0x1c'):if(!startsWith(exclude,_0x300b8d[_0x6ad8('0x17')])){members[_0x300b8d[_0x6ad8('0x17')]]={'channel':_0x6ad8('0x1d'),'interface':_0x300b8d[_0x6ad8('0x17')],'type':_0x6ad8('0x1e'),'enterAt':utils['now'](),'role':_0x6ad8('0x1f')};}break;case _0x6ad8('0x20'):if(!_['isNil'](members[_0x300b8d['device']])){members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x21')]=utils[_0x6ad8('0x22')]();members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x23')]=utils[_0x6ad8('0x24')](members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x21')],members[_0x300b8d['device']]['enterAt']);if(members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x6')]){writeDB(members[_0x300b8d[_0x6ad8('0x17')]]);}}break;default:break;}}catch(_0x39aa51){utils['error'](util[_0x6ad8('0x13')]('[%s][members][devicestatechange]',members[_0x300b8d[_0x6ad8('0x17')]]?members[_0x300b8d[_0x6ad8('0x17')]][_0x6ad8('0x6')]:_0x300b8d[_0x6ad8('0x17')]),_0x39aa51);}};exports[_0x6ad8('0x25')]=function(_0x13c71c){try{if(!_[_0x6ad8('0x26')](members[_0x13c71c['interface']])){utils['debug'](util[_0x6ad8('0x13')](_0x6ad8('0x27'),_0x13c71c['uniqueid']),_0x13c71c);utils['info'](util[_0x6ad8('0x13')](_0x6ad8('0x28'),_0x13c71c[_0x6ad8('0x6')],_0x13c71c[_0x6ad8('0x7')],_0x13c71c[_0x6ad8('0x29')]));members[_0x13c71c['interface']]=_[_0x6ad8('0x2a')](members[_0x13c71c['interface']],{'data4':_0x13c71c[_0x6ad8('0x29')],'uniqueid':_0x13c71c[_0x6ad8('0x6')]});}}catch(_0x429774){utils[_0x6ad8('0x2b')](util[_0x6ad8('0x13')](_0x6ad8('0x27'),_0x13c71c[_0x6ad8('0x6')]),_0x429774);}};exports[_0x6ad8('0x2c')]=function(_0x1cb0e0){try{utils[_0x6ad8('0x2d')](util[_0x6ad8('0x13')](_0x6ad8('0x2e'),_0x1cb0e0['uniqueid']),_0x1cb0e0);if(_0x1cb0e0[_0x6ad8('0x8')]){var _0x3acc91=_0x1cb0e0[_0x6ad8('0x8')][_0x6ad8('0x11')]('-')[0x0];if(!_['isNil'](members[_0x3acc91])){members[_0x3acc91]=_[_0x6ad8('0x2a')](members[_0x3acc91],{'data1':members[_0x3acc91][_0x6ad8('0x2f')]||_0x1cb0e0['type'],'data2':members[_0x3acc91]['data2']||_0x1cb0e0[_0x6ad8('0x30')],'data3':members[_0x3acc91][_0x6ad8('0x31')]||_0x1cb0e0[_0x6ad8('0x32')],'uniqueid':members[_0x3acc91][_0x6ad8('0x6')]||_0x1cb0e0[_0x6ad8('0x6')]});utils[_0x6ad8('0x18')](util[_0x6ad8('0x13')](_0x6ad8('0x33'),_0x1cb0e0[_0x6ad8('0x6')],members[_0x3acc91][_0x6ad8('0x2f')],members[_0x3acc91][_0x6ad8('0x34')],members[_0x3acc91]['data3']));if(members[_0x3acc91][_0x6ad8('0x21')]){writeDB(members[_0x3acc91]);}}}if(_0x1cb0e0['destinationchannel']){var _0x378768=_0x1cb0e0[_0x6ad8('0x35')][_0x6ad8('0x11')]('-')[0x0];if(!_[_0x6ad8('0x26')](members[_0x378768])){members[_0x378768]=_['assign'](members[_0x378768],{'data1':members[_0x378768]['data1']||_0x1cb0e0[_0x6ad8('0x9')],'data2':members[_0x378768][_0x6ad8('0x34')]||_0x1cb0e0[_0x6ad8('0x30')],'data3':members[_0x378768]['data3']||_0x1cb0e0[_0x6ad8('0x32')],'uniqueid':members[_0x378768][_0x6ad8('0x6')]||_0x1cb0e0[_0x6ad8('0x6')]});utils['info'](util[_0x6ad8('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1cb0e0[_0x6ad8('0x6')],members[_0x378768][_0x6ad8('0x2f')],members[_0x378768][_0x6ad8('0x34')],members[_0x378768][_0x6ad8('0x31')]));if(members[_0x378768]['exitAt']){writeDB(members[_0x378768]);}}}}catch(_0x23b4ca){utils['error'](util[_0x6ad8('0x13')](_0x6ad8('0x2e'),_0x1cb0e0[_0x6ad8('0x6')]),_0x23b4ca);}}; \ No newline at end of file +var _0x461d=['startsWith','devicestatechange','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','enterAt','error','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','channel','data1','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','exitAt','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','data2','membername','type','interface','getUserByInterface','name','internal','CreateMemberReport','getUserByName','split','then','request','[%s][members][writeDB]'];(function(_0x43a45e,_0x4f9fca){var _0x1058f5=function(_0x1f4ba9){while(--_0x1f4ba9){_0x43a45e['push'](_0x43a45e['shift']());}};_0x1058f5(++_0x4f9fca);}(_0x461d,0x166));var _0xd461=function(_0x1b6112,_0x21a788){_0x1b6112=_0x1b6112-0x0;var _0x258ea9=_0x461d[_0x1b6112];return _0x258ea9;};'use strict';var _=require(_0xd461('0x0'));var util=require(_0xd461('0x1'));var utils=require('./utils');var members={};var exclude=[_0xd461('0x2'),_0xd461('0x3')];function writeDB(_0xdb90d8){utils[_0xd461('0x4')](util['format'](_0xd461('0x5'),_0xdb90d8[_0xd461('0x6')],_0xdb90d8['interface'],_0xdb90d8['channel'],_0xdb90d8[_0xd461('0x7')],_0xdb90d8[_0xd461('0x8')],_0xdb90d8[_0xd461('0x9')]));if(_0xdb90d8[_0xd461('0xa')]){utils[_0xd461('0xb')](_0xdb90d8['interface'])['then'](function(_0x2596f7){if(_0x2596f7){_0xdb90d8[_0xd461('0x8')]=_0x2596f7[_0xd461('0xc')];_0xdb90d8[_0xd461('0xd')]=_0x2596f7[_0xd461('0xd')];utils['request'](_0xd461('0xe'),_0xdb90d8);}else{utils[_0xd461('0xf')](_0xdb90d8[_0xd461('0xa')][_0xd461('0x10')]('/')[0x1])[_0xd461('0x11')](function(_0xe646aa){if(_0xe646aa){_0xdb90d8['membername']=_0xe646aa[_0xd461('0xc')];_0xdb90d8[_0xd461('0xd')]=_0xe646aa[_0xd461('0xd')];utils[_0xd461('0x12')](_0xd461('0xe'),_0xdb90d8);}});}})['catch'](function(_0xcc40c0){utils['error'](util['format'](_0xd461('0x13'),_0xdb90d8[_0xd461('0x6')]),_0xcc40c0);});}delete members[_0xdb90d8[_0xd461('0xa')]];}function startsWith(_0x234514,_0x429978){return _['some'](_0x234514,function(_0x247dd0){return _[_0xd461('0x14')](_0x429978,_0x247dd0);});}exports[_0xd461('0x15')]=function(_0x1a462b){try{utils['debug'](util[_0xd461('0x16')](_0xd461('0x17'),members[_0x1a462b[_0xd461('0x18')]]?members[_0x1a462b['device']][_0xd461('0x6')]:_0x1a462b[_0xd461('0x18')]),_0x1a462b);utils['info'](util[_0xd461('0x16')](_0xd461('0x19'),members[_0x1a462b[_0xd461('0x18')]]?members[_0x1a462b[_0xd461('0x18')]][_0xd461('0x6')]:_0x1a462b['device'],_0x1a462b[_0xd461('0x1a')],_0x1a462b[_0xd461('0x18')]));switch(_0x1a462b[_0xd461('0x1a')]){case _0xd461('0x1b'):case _0xd461('0x1c'):if(!startsWith(exclude,_0x1a462b[_0xd461('0x18')])){members[_0x1a462b[_0xd461('0x18')]]={'channel':_0xd461('0x1d'),'interface':_0x1a462b[_0xd461('0x18')],'type':_0xd461('0x1e'),'enterAt':utils[_0xd461('0x1f')](),'role':_0xd461('0x20')};}break;case _0xd461('0x21'):if(!_[_0xd461('0x22')](members[_0x1a462b[_0xd461('0x18')]])){members[_0x1a462b['device']]['exitAt']=utils[_0xd461('0x1f')]();members[_0x1a462b[_0xd461('0x18')]][_0xd461('0x23')]=utils[_0xd461('0x24')](members[_0x1a462b[_0xd461('0x18')]]['exitAt'],members[_0x1a462b['device']][_0xd461('0x25')]);if(members[_0x1a462b[_0xd461('0x18')]][_0xd461('0x6')]){writeDB(members[_0x1a462b[_0xd461('0x18')]]);}}break;default:break;}}catch(_0x498148){utils[_0xd461('0x26')](util['format'](_0xd461('0x17'),members[_0x1a462b[_0xd461('0x18')]]?members[_0x1a462b[_0xd461('0x18')]]['uniqueid']:_0x1a462b[_0xd461('0x18')]),_0x498148);}};exports[_0xd461('0x27')]=function(_0x5c22fd){try{if(!_[_0xd461('0x22')](members[_0x5c22fd[_0xd461('0xa')]])){utils[_0xd461('0x28')](util[_0xd461('0x16')](_0xd461('0x29'),_0x5c22fd[_0xd461('0x6')]),_0x5c22fd);utils[_0xd461('0x4')](util['format'](_0xd461('0x2a'),_0x5c22fd[_0xd461('0x6')],_0x5c22fd[_0xd461('0xa')],_0x5c22fd['queue']));members[_0x5c22fd[_0xd461('0xa')]]=_[_0xd461('0x2b')](members[_0x5c22fd[_0xd461('0xa')]],{'data4':_0x5c22fd[_0xd461('0x2c')],'uniqueid':_0x5c22fd[_0xd461('0x6')]});}}catch(_0x4e3da0){utils['error'](util[_0xd461('0x16')]('[%s][members][agentcomplete]',_0x5c22fd[_0xd461('0x6')]),_0x4e3da0);}};exports[_0xd461('0x2d')]=function(_0x3050d3){try{utils['debug'](util['format'](_0xd461('0x2e'),_0x3050d3[_0xd461('0x6')]),_0x3050d3);if(_0x3050d3[_0xd461('0x2f')]){var _0x3dfb9a=_0x3050d3[_0xd461('0x2f')][_0xd461('0x10')]('-')[0x0];if(!_[_0xd461('0x22')](members[_0x3dfb9a])){members[_0x3dfb9a]=_['assign'](members[_0x3dfb9a],{'data1':members[_0x3dfb9a][_0xd461('0x30')]||_0x3050d3[_0xd461('0x9')],'data2':members[_0x3dfb9a][_0xd461('0x7')]||_0x3050d3[_0xd461('0x31')],'data3':members[_0x3dfb9a]['data3']||_0x3050d3['destination'],'uniqueid':members[_0x3dfb9a][_0xd461('0x6')]||_0x3050d3[_0xd461('0x6')]});utils['info'](util['format'](_0xd461('0x32'),_0x3050d3[_0xd461('0x6')],members[_0x3dfb9a]['data1'],members[_0x3dfb9a]['data2'],members[_0x3dfb9a][_0xd461('0x33')]));if(members[_0x3dfb9a][_0xd461('0x34')]){writeDB(members[_0x3dfb9a]);}}}if(_0x3050d3['destinationchannel']){var _0x587455=_0x3050d3[_0xd461('0x35')][_0xd461('0x10')]('-')[0x0];if(!_['isNil'](members[_0x587455])){members[_0x587455]=_['assign'](members[_0x587455],{'data1':members[_0x587455][_0xd461('0x30')]||_0x3050d3['type'],'data2':members[_0x587455]['data2']||_0x3050d3[_0xd461('0x31')],'data3':members[_0x587455]['data3']||_0x3050d3['destination'],'uniqueid':members[_0x587455][_0xd461('0x6')]||_0x3050d3[_0xd461('0x6')]});utils[_0xd461('0x4')](util[_0xd461('0x16')](_0xd461('0x32'),_0x3050d3[_0xd461('0x6')],members[_0x587455][_0xd461('0x30')],members[_0x587455][_0xd461('0x7')],members[_0x587455][_0xd461('0x33')]));if(members[_0x587455][_0xd461('0x34')]){writeDB(members[_0x587455]);}}}}catch(_0x1079a9){utils[_0xd461('0x26')](util[_0xd461('0x16')](_0xd461('0x2e'),_0x3050d3['uniqueid']),_0x1079a9);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d6910ca..578d8e6 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 _0xe0fa=['connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','BLIND','transferexten','BLINDTRANSFER','extension','[%s][queues][blindtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','util','info','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','isNil','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','variable','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xe0fa,0x94));var _0xae0f=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0xe0fa[_0x5f42f1];return _0x5534ee;};'use strict';var _=require('lodash');var util=require(_0xae0f('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x5e69f3){utils[_0xae0f('0x1')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5e69f3[_0xae0f('0x2')],_0x5e69f3['channel'],_0x5e69f3[_0xae0f('0x3')],_0x5e69f3[_0xae0f('0x4')],_0x5e69f3['calleridnum'],_0x5e69f3[_0xae0f('0x5')],_0x5e69f3[_0xae0f('0x6')]));if(_0x5e69f3[_0xae0f('0x3')]){utils[_0xae0f('0x7')](_0x5e69f3[_0xae0f('0x3')])[_0xae0f('0x8')](function(_0x1bda41){if(_0x1bda41){_0x5e69f3[_0xae0f('0x9')]=_0x1bda41[_0xae0f('0x9')];}utils['request'](_0xae0f('0xa'),_0x5e69f3);});}else{utils[_0xae0f('0xb')](_0xae0f('0xa'),_0x5e69f3);}if(_0x5e69f3[_0xae0f('0xc')]){delete queues[_0x5e69f3[_0xae0f('0xc')]];}else{delete queues[_0x5e69f3[_0xae0f('0x2')]];}}exports[_0xae0f('0xd')]=function(_0xe39bcd){try{utils[_0xae0f('0xe')](util[_0xae0f('0xf')](_0xae0f('0x10'),_0xe39bcd['uniqueid']),_0xe39bcd);utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x11'),_0xe39bcd['uniqueid'],_0xe39bcd['queue'],_0xe39bcd[_0xae0f('0x12')]));queues[_0xe39bcd[_0xae0f('0x2')]]=_['assign'](_0xe39bcd,{'originalposition':_0xe39bcd[_0xae0f('0x12')],'queuecallerjoinAt':utils[_0xae0f('0x13')](),'mohtime':0x0});}catch(_0x5f00ac){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x10'),_0xe39bcd[_0xae0f('0x2')]),_0x5f00ac);}};exports['hangup']=function(_0x10fef7){try{if(!_['isNil'](queues[_0x10fef7[_0xae0f('0x2')]])){utils['debug'](util[_0xae0f('0xf')](_0xae0f('0x15'),_0x10fef7[_0xae0f('0x2')]),_0x10fef7);if(queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0x16')]){if(!queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0x17')]&&!queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0x18')]){queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0x19')]=!![];queues[_0x10fef7['uniqueid']][_0xae0f('0x1a')]=utils[_0xae0f('0x13')]();queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0x6')]='COMPLETEDBYAGENT';}utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x1b'),_0x10fef7[_0xae0f('0x2')],queues[_0x10fef7[_0xae0f('0x2')]]['name'],queues[_0x10fef7['uniqueid']][_0xae0f('0x6')]));writeDB(queues[_0x10fef7[_0xae0f('0x2')]]);}else if(queues[_0x10fef7[_0xae0f('0x2')]]['transfereduniqueid']){utils['info'](util[_0xae0f('0xf')](_0xae0f('0x1c'),_0x10fef7[_0xae0f('0x2')],queues[_0x10fef7[_0xae0f('0x2')]]['name'],queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0xc')]));queues[queues[_0x10fef7[_0xae0f('0x2')]]['transfereduniqueid']]=queues[_0x10fef7[_0xae0f('0x2')]];queues[queues[_0x10fef7[_0xae0f('0x2')]][_0xae0f('0xc')]][_0xae0f('0x1d')]=0x2;delete queues[_0x10fef7['uniqueid']];}}}catch(_0x15dd5c){utils[_0xae0f('0x14')](util['format'](_0xae0f('0x15'),_0x10fef7[_0xae0f('0x2')]),_0x15dd5c);}};exports['varset']=function(_0x27645d){try{utils[_0xae0f('0xe')](util[_0xae0f('0xf')](_0xae0f('0x1e'),_0x27645d[_0xae0f('0x2')]),_0x27645d);if(!_[_0xae0f('0x1f')](_0x27645d['variable']['queuestatus'])&&_0x27645d[_0xae0f('0x20')]['toUpperCase']()!==_0xae0f('0x21')){if(!_[_0xae0f('0x1f')](queues[_0x27645d[_0xae0f('0x2')]])){queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x17')]=![];queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x22')]=null;queues[_0x27645d['uniqueid']][_0xae0f('0x18')]=!![];queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x23')]=utils[_0xae0f('0x13')]();queues[_0x27645d['uniqueid']][_0xae0f('0x6')]=_0x27645d[_0xae0f('0x20')]['toUpperCase']();utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x24'),_0x27645d[_0xae0f('0x2')],queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x25')],_0x27645d['value'],queues[_0x27645d[_0xae0f('0x2')]]['queuecallerexitreason']));writeDB(queues[_0x27645d[_0xae0f('0x2')]]);}}else if(!_['isNil'](_0x27645d[_0xae0f('0x26')][_0xae0f('0x27')])){if(!_[_0xae0f('0x1f')](queues[_0x27645d[_0xae0f('0x2')]])&&!queues[_0x27645d['uniqueid']][_0xae0f('0x17')]){queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x17')]=![];queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x22')]=null;queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x18')]=!![];queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x23')]=utils[_0xae0f('0x13')]();queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x6')]=_0xae0f('0x28');utils[_0xae0f('0x1')](util[_0xae0f('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x27645d[_0xae0f('0x2')],queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x25')],_0x27645d[_0xae0f('0x20')],queues[_0x27645d[_0xae0f('0x2')]][_0xae0f('0x6')]));}}}catch(_0x2b7547){utils['error'](util['format'](_0xae0f('0x1e'),_0x27645d[_0xae0f('0x2')]),_0x2b7547);}};exports[_0xae0f('0x17')]=function(_0x5db15e){try{if(!_[_0xae0f('0x1f')](queues[_0x5db15e[_0xae0f('0x2')]])){utils['debug'](util[_0xae0f('0xf')](_0xae0f('0x29'),_0x5db15e['uniqueid']),_0x5db15e);queues[_0x5db15e[_0xae0f('0x2')]]['queuecallerexit']=![];queues[_0x5db15e[_0xae0f('0x2')]][_0xae0f('0x23')]=null;queues[_0x5db15e[_0xae0f('0x2')]][_0xae0f('0x17')]=!![];queues[_0x5db15e[_0xae0f('0x2')]][_0xae0f('0x22')]=utils[_0xae0f('0x13')]();queues[_0x5db15e[_0xae0f('0x2')]][_0xae0f('0x6')]='ABANDONED';utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x2a'),_0x5db15e[_0xae0f('0x2')],queues[_0x5db15e[_0xae0f('0x2')]][_0xae0f('0x25')],queues[_0x5db15e[_0xae0f('0x2')]]['queuecallerexitreason']));}}catch(_0x5921c2){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x29'),_0x5db15e[_0xae0f('0x2')]),_0x5921c2);}};exports['queuecallerleave']=function(_0xfe7573){try{if(!_[_0xae0f('0x1f')](queues[_0xfe7573[_0xae0f('0x2')]])){utils[_0xae0f('0xe')](util['format'](_0xae0f('0x2b'),_0xfe7573[_0xae0f('0x2')]),_0xfe7573);utils['info'](util[_0xae0f('0xf')](_0xae0f('0x2c'),_0xfe7573[_0xae0f('0x2')],queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x25')],_0xfe7573[_0xae0f('0x2d')],_0xfe7573[_0xae0f('0x2e')]));queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x2f')]=!![];queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x16')]=utils[_0xae0f('0x13')]();queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x30')]=utils[_0xae0f('0x31')](queues[_0xfe7573[_0xae0f('0x2')]]['queuecallerleaveAt'],queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x32')]);queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x12')]=_0xfe7573['position'];queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x33')]=_0xfe7573[_0xae0f('0x33')];queues[_0xfe7573['uniqueid']][_0xae0f('0x2d')]=_0xfe7573[_0xae0f('0x2d')];queues[_0xfe7573[_0xae0f('0x2')]][_0xae0f('0x2e')]=_0xfe7573['connectedlinename'];}}catch(_0x4f4735){utils[_0xae0f('0x14')](util[_0xae0f('0xf')]('[%s][queues][queuecallerleave]',_0xfe7573[_0xae0f('0x2')]),_0x4f4735);}};exports[_0xae0f('0x34')]=function(_0xd209){try{if(!_[_0xae0f('0x1f')](queues[_0xd209['uniqueid']])){utils[_0xae0f('0xe')](util[_0xae0f('0xf')]('[%s][queues][agentconnect]',_0xd209[_0xae0f('0x2')]),_0xd209);utils['info'](util[_0xae0f('0xf')](_0xae0f('0x35'),_0xd209[_0xae0f('0x2')],queues[_0xd209[_0xae0f('0x2')]]['name'],_0xd209[_0xae0f('0x36')],_0xd209[_0xae0f('0x37')]));queues[_0xd209[_0xae0f('0x2')]]['queuecallerabandon']=![];queues[_0xd209['uniqueid']]['queuecallerabandon']=![];queues[_0xd209[_0xae0f('0x2')]][_0xae0f('0x22')]=null;queues[_0xd209[_0xae0f('0x2')]][_0xae0f('0x18')]=![];queues[_0xd209[_0xae0f('0x2')]][_0xae0f('0x6')]=null;queues[_0xd209['uniqueid']][_0xae0f('0x23')]=null;queues[_0xd209[_0xae0f('0x2')]]['assigned']=!![];queues[_0xd209[_0xae0f('0x2')]][_0xae0f('0x5')]=_0xd209[_0xae0f('0x37')];queues[_0xd209[_0xae0f('0x2')]][_0xae0f('0x4')]=_0xd209[_0xae0f('0x36')];}}catch(_0xb4b1c8){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x38'),_0xd209['uniqueid']),_0xb4b1c8);}};exports['agentcomplete']=function(_0x45d3e1){try{if(!_[_0xae0f('0x1f')](queues[_0x45d3e1[_0xae0f('0x2')]])){if(queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x16')]){utils[_0xae0f('0xe')](util['format'](_0xae0f('0x39'),_0x45d3e1[_0xae0f('0x2')]),_0x45d3e1);queues[_0x45d3e1['uniqueid']][_0xae0f('0x17')]=![];queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x17')]=![];queues[_0x45d3e1['uniqueid']][_0xae0f('0x22')]=null;queues[_0x45d3e1[_0xae0f('0x2')]]['queuecallerexit']=![];queues[_0x45d3e1['uniqueid']][_0xae0f('0x23')]=null;queues[_0x45d3e1[_0xae0f('0x2')]]['assigned']=!![];queues[_0x45d3e1[_0xae0f('0x2')]]['lastAssignedTo']=_0x45d3e1[_0xae0f('0x36')];queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x19')]=!![];queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x1a')]=utils['now']();if(_0x45d3e1[_0xae0f('0x3a')]==_0xae0f('0x3b')){if(!queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x3b')]){queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x6')]=_0xae0f('0x3c');}}else{queues[_0x45d3e1['uniqueid']]['queuecallerexitreason']=_0xae0f('0x3d')+_0x45d3e1[_0xae0f('0x3a')][_0xae0f('0x3e')]();}utils['info'](util['format'](_0xae0f('0x3f'),_0x45d3e1['uniqueid'],queues[_0x45d3e1['uniqueid']][_0xae0f('0x25')],_0x45d3e1[_0xae0f('0x36')],queues[_0x45d3e1[_0xae0f('0x2')]][_0xae0f('0x6')]));writeDB(queues[_0x45d3e1[_0xae0f('0x2')]]);}}}catch(_0x9c08a8){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x39'),_0x45d3e1['uniqueid']),_0x9c08a8);}};exports['blindtransfer']=function(_0xa990af){try{if(!_[_0xae0f('0x1f')](queues[_0xa990af['transfereeuniqueid']])){utils['debug'](util[_0xae0f('0xf')]('[%s][queues][blindtransfer]',_0xa990af[_0xae0f('0x2')]),_0xa990af);queues[_0xa990af['transfereeuniqueid']][_0xae0f('0x3b')]=!![];queues[_0xa990af[_0xae0f('0x40')]][_0xae0f('0x41')]=_0xae0f('0x42');queues[_0xa990af[_0xae0f('0x40')]][_0xae0f('0x43')]=_0xa990af['extension'];queues[_0xa990af[_0xae0f('0x40')]]['transferuniqueid']=_0xa990af[_0xae0f('0x40')];queues[_0xa990af['transfereeuniqueid']]['queuecallerexitreason']=_0xae0f('0x44');utils[_0xae0f('0x1')](util[_0xae0f('0xf')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0xa990af[_0xae0f('0x2')],queues[_0xa990af[_0xae0f('0x40')]][_0xae0f('0x25')],_0xa990af[_0xae0f('0x40')],_0xa990af[_0xae0f('0x45')]));}}catch(_0x4462b8){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x46'),_0xa990af[_0xae0f('0x2')]),_0x4462b8);}};exports['attendedtransfer']=function(_0x1d97de){try{utils['debug'](util[_0xae0f('0xf')]('[%s][queues][attendedtransfer]',_0x1d97de[_0xae0f('0x47')]),_0x1d97de);if(_0x1d97de[_0xae0f('0x47')]==_0x1d97de[_0xae0f('0x48')]){if(!_[_0xae0f('0x1f')](queues[_0x1d97de['secondtransfererlinkedid']])){utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x49'),_0x1d97de[_0xae0f('0x47')],queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x25')],_0x1d97de[_0xae0f('0x4b')]));queues[_0x1d97de['secondtransfererlinkedid']][_0xae0f('0x3b')]=!![];queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x41')]=_0xae0f('0x4c');queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x43')]=_0x1d97de[_0xae0f('0x4b')];queues[_0x1d97de['secondtransfererlinkedid']][_0xae0f('0x4d')]=_0x1d97de['origtransfereruniqueid'];queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x6')]=_0xae0f('0x4e');}if(!_[_0xae0f('0x1f')](queues[_0x1d97de[_0xae0f('0x48')]])){if(_0x1d97de[_0xae0f('0x4f')]&&queues[_0x1d97de[_0xae0f('0x4f')]]){queues[_0x1d97de[_0xae0f('0x4f')]][_0xae0f('0x1d')]=0x1;queues[_0x1d97de['transfereeuniqueid']]=_[_0xae0f('0x50')](queues[_0x1d97de['transfereelinkedid']]);queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0xc')]=_0x1d97de[_0xae0f('0x51')];queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x1d')]=0x2;queues[_0x1d97de['transfereeuniqueid']]['calleridnum']=queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x52')];queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x53')]=queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0x53')];queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x32')]=utils[_0xae0f('0x13')]();queues[_0x1d97de[_0xae0f('0x40')]]['queuecallerleaveAt']=utils[_0xae0f('0x13')]();queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x30')]=0x0;queues[_0x1d97de[_0xae0f('0x40')]]['mohtime']=0x0;utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x54'),_0x1d97de[_0xae0f('0x47')],queues[_0x1d97de['transfereeuniqueid']]['name'],queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x52')],queues[_0x1d97de[_0xae0f('0x40')]][_0xae0f('0x53')]));}else{utils['info'](util[_0xae0f('0xf')](_0xae0f('0x55'),_0x1d97de[_0xae0f('0x47')],queues[_0x1d97de[_0xae0f('0x48')]][_0xae0f('0x25')],_0x1d97de[_0xae0f('0x4a')]));queues[_0x1d97de[_0xae0f('0x48')]]['transfereduniqueid']=_0x1d97de[_0xae0f('0x4a')];}}}else if(_0x1d97de[_0xae0f('0x56')]==_0x1d97de[_0xae0f('0x4a')]){if(!_[_0xae0f('0x1f')](queues[_0x1d97de[_0xae0f('0x48')]])){utils[_0xae0f('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1d97de['origtransfereruniqueid'],queues[_0x1d97de[_0xae0f('0x48')]]['name'],_0x1d97de['secondtransfereruniqueid'],_0x1d97de[_0xae0f('0x57')]));queues[_0x1d97de[_0xae0f('0x48')]][_0xae0f('0x3b')]=!![];queues[_0x1d97de['origtransfererlinkedid']][_0xae0f('0x41')]=_0xae0f('0x4c');queues[_0x1d97de[_0xae0f('0x48')]]['transferexten']=_0x1d97de['secondtransfererexten'];queues[_0x1d97de[_0xae0f('0x48')]][_0xae0f('0x4d')]=_0x1d97de['secondtransfereruniqueid'];queues[_0x1d97de[_0xae0f('0x48')]][_0xae0f('0x6')]=_0xae0f('0x4e');}if(!_[_0xae0f('0x1f')](queues[_0x1d97de[_0xae0f('0x4a')]])){if(_0x1d97de['transfertargetlinkedid']&&queues[_0x1d97de[_0xae0f('0x58')]]){queues[_0x1d97de['transfertargetlinkedid']][_0xae0f('0x1d')]=0x1;queues[_0x1d97de['transfertargetuniqueid']]=_[_0xae0f('0x50')](queues[_0x1d97de[_0xae0f('0x58')]]);queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0xc')]=_0x1d97de[_0xae0f('0x51')];queues[_0x1d97de[_0xae0f('0x51')]]['queuecallerenterreason']=0x2;queues[_0x1d97de['transfertargetuniqueid']][_0xae0f('0x52')]=queues[_0x1d97de['origtransfererlinkedid']][_0xae0f('0x52')];queues[_0x1d97de[_0xae0f('0x51')]]['calleridname']=queues[_0x1d97de[_0xae0f('0x48')]][_0xae0f('0x53')];queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0x32')]=utils['now']();queues[_0x1d97de[_0xae0f('0x51')]]['queuecallerleaveAt']=utils[_0xae0f('0x13')]();queues[_0x1d97de[_0xae0f('0x51')]]['holdtime']=0x0;queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0x59')]=0x0;utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x5a'),_0x1d97de[_0xae0f('0x47')],queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0x25')],queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0xc')],queues[_0x1d97de[_0xae0f('0x51')]][_0xae0f('0x52')],queues[_0x1d97de['transfertargetuniqueid']][_0xae0f('0x53')]));}else{utils[_0xae0f('0x1')](util[_0xae0f('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1d97de[_0xae0f('0x47')],queues[_0x1d97de[_0xae0f('0x4a')]]['name'],_0x1d97de['origtransfererlinkedid']));queues[_0x1d97de[_0xae0f('0x4a')]][_0xae0f('0xc')]=_0x1d97de[_0xae0f('0x48')];}}}}catch(_0x5d6b3c){utils['error'](util[_0xae0f('0xf')](_0xae0f('0x5b'),_0x1d97de[_0xae0f('0x47')]),_0x5d6b3c);}};exports[_0xae0f('0x5c')]=function(_0x3078a5){try{if(!_[_0xae0f('0x1f')](queues[_0x3078a5[_0xae0f('0x2')]])){utils[_0xae0f('0xe')](util[_0xae0f('0xf')](_0xae0f('0x5d'),_0x3078a5[_0xae0f('0x2')]),_0x3078a5);queues[_0x3078a5[_0xae0f('0x2')]]['musiconholdstartAt']=utils['now']();utils[_0xae0f('0x1')](util[_0xae0f('0xf')](_0xae0f('0x5e'),_0x3078a5[_0xae0f('0x2')],queues[_0x3078a5[_0xae0f('0x2')]][_0xae0f('0x25')],queues[_0x3078a5[_0xae0f('0x2')]][_0xae0f('0x5f')]));}}catch(_0x24b2b1){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x5d'),_0x3078a5['uniqueid']),_0x24b2b1);}};exports['musiconholdstop']=function(_0x48c746){try{if(!_[_0xae0f('0x1f')](queues[_0x48c746[_0xae0f('0x2')]])){if(!_[_0xae0f('0x1f')](queues[_0x48c746[_0xae0f('0x2')]][_0xae0f('0x5f')])){utils[_0xae0f('0xe')](util[_0xae0f('0xf')](_0xae0f('0x60'),_0x48c746[_0xae0f('0x2')]),_0x48c746);queues[_0x48c746['uniqueid']][_0xae0f('0x59')]+=utils['diffTime'](utils[_0xae0f('0x13')](),queues[_0x48c746[_0xae0f('0x2')]][_0xae0f('0x5f')]);utils[_0xae0f('0x1')](util[_0xae0f('0xf')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x48c746[_0xae0f('0x2')],queues[_0x48c746[_0xae0f('0x2')]][_0xae0f('0x25')],queues[_0x48c746[_0xae0f('0x2')]][_0xae0f('0x59')]));delete queues[_0x48c746[_0xae0f('0x2')]][_0xae0f('0x5f')];}}}catch(_0x1158ce){utils[_0xae0f('0x14')](util[_0xae0f('0xf')](_0xae0f('0x60'),_0x48c746[_0xae0f('0x2')]),_0x1158ce);}}; \ No newline at end of file +var _0x5f63=['position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','info','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s'];(function(_0x2655a9,_0x2f588b){var _0x29b66d=function(_0x319615){while(--_0x319615){_0x2655a9['push'](_0x2655a9['shift']());}};_0x29b66d(++_0x2f588b);}(_0x5f63,0x1e4));var _0x35f6=function(_0x2a9e49,_0x46ece3){_0x2a9e49=_0x2a9e49-0x0;var _0xd50b20=_0x5f63[_0x2a9e49];return _0xd50b20;};'use strict';var _=require(_0x35f6('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x21f8ec){utils[_0x35f6('0x1')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x21f8ec[_0x35f6('0x2')],_0x21f8ec['channel'],_0x21f8ec[_0x35f6('0x3')],_0x21f8ec[_0x35f6('0x4')],_0x21f8ec[_0x35f6('0x5')],_0x21f8ec['accountcode'],_0x21f8ec[_0x35f6('0x6')]));if(_0x21f8ec['queue']){utils['getVoiceQueueByName'](_0x21f8ec[_0x35f6('0x3')])[_0x35f6('0x7')](function(_0x38a1a0){if(_0x38a1a0){_0x21f8ec['type']=_0x38a1a0[_0x35f6('0x8')];}utils[_0x35f6('0x9')]('CreateVoiceQueueReport',_0x21f8ec);});}else{utils['request']('CreateVoiceQueueReport',_0x21f8ec);}if(_0x21f8ec[_0x35f6('0xa')]){delete queues[_0x21f8ec['transfereduniqueid']];}else{delete queues[_0x21f8ec[_0x35f6('0x2')]];}}exports[_0x35f6('0xb')]=function(_0x1b46d3){try{utils[_0x35f6('0xc')](util['format'](_0x35f6('0xd'),_0x1b46d3[_0x35f6('0x2')]),_0x1b46d3);utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0xf'),_0x1b46d3['uniqueid'],_0x1b46d3[_0x35f6('0x3')],_0x1b46d3[_0x35f6('0x10')]));queues[_0x1b46d3[_0x35f6('0x2')]]=_[_0x35f6('0x11')](_0x1b46d3,{'originalposition':_0x1b46d3[_0x35f6('0x10')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x47592c){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0xd'),_0x1b46d3[_0x35f6('0x2')]),_0x47592c);}};exports[_0x35f6('0x13')]=function(_0x1136b8){try{if(!_[_0x35f6('0x14')](queues[_0x1136b8[_0x35f6('0x2')]])){utils[_0x35f6('0xc')](util[_0x35f6('0xe')](_0x35f6('0x15'),_0x1136b8[_0x35f6('0x2')]),_0x1136b8);if(queues[_0x1136b8[_0x35f6('0x2')]]['queuecallerleaveAt']){if(!queues[_0x1136b8['uniqueid']]['queuecallerabandon']&&!queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x16')]){queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x17')]=!![];queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x18')]=utils[_0x35f6('0x19')]();queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x6')]=_0x35f6('0x1a');}utils['info'](util['format'](_0x35f6('0x1b'),_0x1136b8[_0x35f6('0x2')],queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x1c')],queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x6')]));writeDB(queues[_0x1136b8[_0x35f6('0x2')]]);}else if(queues[_0x1136b8['uniqueid']]['transfereduniqueid']){utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x1d'),_0x1136b8[_0x35f6('0x2')],queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0x1c')],queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0xa')]));queues[queues[_0x1136b8[_0x35f6('0x2')]]['transfereduniqueid']]=queues[_0x1136b8[_0x35f6('0x2')]];queues[queues[_0x1136b8[_0x35f6('0x2')]][_0x35f6('0xa')]][_0x35f6('0x1e')]=0x2;delete queues[_0x1136b8[_0x35f6('0x2')]];}}}catch(_0x178e83){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x15'),_0x1136b8[_0x35f6('0x2')]),_0x178e83);}};exports[_0x35f6('0x1f')]=function(_0x53b9d9){try{utils['debug'](util[_0x35f6('0xe')](_0x35f6('0x20'),_0x53b9d9[_0x35f6('0x2')]),_0x53b9d9);if(!_[_0x35f6('0x14')](_0x53b9d9[_0x35f6('0x21')]['queuestatus'])&&_0x53b9d9[_0x35f6('0x22')][_0x35f6('0x23')]()!=='CONTINUE'){if(!_[_0x35f6('0x14')](queues[_0x53b9d9['uniqueid']])){queues[_0x53b9d9[_0x35f6('0x2')]]['queuecallerabandon']=![];queues[_0x53b9d9[_0x35f6('0x2')]]['queuecallerabandonAt']=null;queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x16')]=!![];queues[_0x53b9d9['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x6')]=_0x53b9d9[_0x35f6('0x22')][_0x35f6('0x23')]();utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x24'),_0x53b9d9['uniqueid'],queues[_0x53b9d9[_0x35f6('0x2')]]['name'],_0x53b9d9[_0x35f6('0x22')],queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x6')]));writeDB(queues[_0x53b9d9[_0x35f6('0x2')]]);}}else if(!_[_0x35f6('0x14')](_0x53b9d9[_0x35f6('0x21')][_0x35f6('0x25')])){if(!_[_0x35f6('0x14')](queues[_0x53b9d9[_0x35f6('0x2')]])&&!queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x26')]){queues[_0x53b9d9['uniqueid']][_0x35f6('0x26')]=![];queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x27')]=null;queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x16')]=!![];queues[_0x53b9d9['uniqueid']]['queuecallerexitAt']=utils[_0x35f6('0x19')]();queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x6')]='EXITWITHKEY';utils[_0x35f6('0x1')](util['format'](_0x35f6('0x28'),_0x53b9d9[_0x35f6('0x2')],queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x1c')],_0x53b9d9[_0x35f6('0x22')],queues[_0x53b9d9[_0x35f6('0x2')]][_0x35f6('0x6')]));}}}catch(_0x5e03e1){utils[_0x35f6('0x12')](util['format'](_0x35f6('0x20'),_0x53b9d9[_0x35f6('0x2')]),_0x5e03e1);}};exports[_0x35f6('0x26')]=function(_0xe0c90){try{if(!_[_0x35f6('0x14')](queues[_0xe0c90[_0x35f6('0x2')]])){utils[_0x35f6('0xc')](util['format'](_0x35f6('0x29'),_0xe0c90[_0x35f6('0x2')]),_0xe0c90);queues[_0xe0c90[_0x35f6('0x2')]][_0x35f6('0x16')]=![];queues[_0xe0c90[_0x35f6('0x2')]][_0x35f6('0x2a')]=null;queues[_0xe0c90[_0x35f6('0x2')]][_0x35f6('0x26')]=!![];queues[_0xe0c90[_0x35f6('0x2')]][_0x35f6('0x27')]=utils[_0x35f6('0x19')]();queues[_0xe0c90[_0x35f6('0x2')]][_0x35f6('0x6')]='ABANDONED';utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x2b'),_0xe0c90[_0x35f6('0x2')],queues[_0xe0c90['uniqueid']][_0x35f6('0x1c')],queues[_0xe0c90['uniqueid']]['queuecallerexitreason']));}}catch(_0x31e46a){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x29'),_0xe0c90[_0x35f6('0x2')]),_0x31e46a);}};exports[_0x35f6('0x2c')]=function(_0x2d4015){try{if(!_[_0x35f6('0x14')](queues[_0x2d4015[_0x35f6('0x2')]])){utils[_0x35f6('0xc')](util[_0x35f6('0xe')]('[%s][queues][queuecallerleave]',_0x2d4015[_0x35f6('0x2')]),_0x2d4015);utils[_0x35f6('0x1')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2d4015['uniqueid'],queues[_0x2d4015[_0x35f6('0x2')]]['name'],_0x2d4015['connectedlinenum'],_0x2d4015['connectedlinename']));queues[_0x2d4015['uniqueid']][_0x35f6('0x2c')]=!![];queues[_0x2d4015['uniqueid']][_0x35f6('0x2d')]=utils['now']();queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x2e')]=utils[_0x35f6('0x2f')](queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x2d')],queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x30')]);queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x10')]=_0x2d4015['position'];queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x31')]=_0x2d4015[_0x35f6('0x31')];queues[_0x2d4015[_0x35f6('0x2')]][_0x35f6('0x32')]=_0x2d4015[_0x35f6('0x32')];queues[_0x2d4015[_0x35f6('0x2')]]['connectedlinename']=_0x2d4015[_0x35f6('0x33')];}}catch(_0x87ab6f){utils['error'](util[_0x35f6('0xe')](_0x35f6('0x34'),_0x2d4015[_0x35f6('0x2')]),_0x87ab6f);}};exports[_0x35f6('0x35')]=function(_0xde3db0){try{if(!_[_0x35f6('0x14')](queues[_0xde3db0[_0x35f6('0x2')]])){utils['debug'](util['format'](_0x35f6('0x36'),_0xde3db0[_0x35f6('0x2')]),_0xde3db0);utils['info'](util['format'](_0x35f6('0x37'),_0xde3db0[_0x35f6('0x2')],queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x1c')],_0xde3db0[_0x35f6('0x38')],_0xde3db0['destaccountcode']));queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x26')]=![];queues[_0xde3db0['uniqueid']][_0x35f6('0x26')]=![];queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x27')]=null;queues[_0xde3db0['uniqueid']][_0x35f6('0x16')]=![];queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x6')]=null;queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x2a')]=null;queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x39')]=!![];queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x3a')]=_0xde3db0['destaccountcode'];queues[_0xde3db0[_0x35f6('0x2')]][_0x35f6('0x4')]=_0xde3db0['membername'];}}catch(_0x67b4a){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x36'),_0xde3db0['uniqueid']),_0x67b4a);}};exports['agentcomplete']=function(_0x4a5dde){try{if(!_[_0x35f6('0x14')](queues[_0x4a5dde[_0x35f6('0x2')]])){if(queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x2d')]){utils[_0x35f6('0xc')](util[_0x35f6('0xe')]('[%s][queues][agentcomplete]',_0x4a5dde[_0x35f6('0x2')]),_0x4a5dde);queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x26')]=![];queues[_0x4a5dde[_0x35f6('0x2')]]['queuecallerabandon']=![];queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x27')]=null;queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x16')]=![];queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x2a')]=null;queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x39')]=!![];queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x4')]=_0x4a5dde[_0x35f6('0x38')];queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x17')]=!![];queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x18')]=utils[_0x35f6('0x19')]();if(_0x4a5dde[_0x35f6('0x3b')]==_0x35f6('0x3c')){if(!queues[_0x4a5dde['uniqueid']][_0x35f6('0x3c')]){queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x6')]=_0x35f6('0x3d');}}else{queues[_0x4a5dde[_0x35f6('0x2')]]['queuecallerexitreason']=_0x35f6('0x3e')+_0x4a5dde[_0x35f6('0x3b')][_0x35f6('0x23')]();}utils[_0x35f6('0x1')](util[_0x35f6('0xe')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4a5dde[_0x35f6('0x2')],queues[_0x4a5dde[_0x35f6('0x2')]][_0x35f6('0x1c')],_0x4a5dde[_0x35f6('0x38')],queues[_0x4a5dde['uniqueid']][_0x35f6('0x6')]));writeDB(queues[_0x4a5dde[_0x35f6('0x2')]]);}}}catch(_0x1739d1){utils[_0x35f6('0x12')](util['format'](_0x35f6('0x3f'),_0x4a5dde[_0x35f6('0x2')]),_0x1739d1);}};exports[_0x35f6('0x40')]=function(_0x4ec498){try{if(!_[_0x35f6('0x14')](queues[_0x4ec498[_0x35f6('0x41')]])){utils[_0x35f6('0xc')](util['format']('[%s][queues][blindtransfer]',_0x4ec498[_0x35f6('0x2')]),_0x4ec498);queues[_0x4ec498[_0x35f6('0x41')]][_0x35f6('0x3c')]=!![];queues[_0x4ec498[_0x35f6('0x41')]][_0x35f6('0x42')]=_0x35f6('0x43');queues[_0x4ec498['transfereeuniqueid']][_0x35f6('0x44')]=_0x4ec498[_0x35f6('0x45')];queues[_0x4ec498[_0x35f6('0x41')]][_0x35f6('0x46')]=_0x4ec498['transfereeuniqueid'];queues[_0x4ec498[_0x35f6('0x41')]]['queuecallerexitreason']=_0x35f6('0x47');utils['info'](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4ec498['uniqueid'],queues[_0x4ec498[_0x35f6('0x41')]][_0x35f6('0x1c')],_0x4ec498[_0x35f6('0x41')],_0x4ec498[_0x35f6('0x45')]));}}catch(_0x39ddf0){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x48'),_0x4ec498[_0x35f6('0x2')]),_0x39ddf0);}};exports[_0x35f6('0x49')]=function(_0x591f0a){try{utils[_0x35f6('0xc')](util[_0x35f6('0xe')](_0x35f6('0x4a'),_0x591f0a[_0x35f6('0x4b')]),_0x591f0a);if(_0x591f0a['origtransfereruniqueid']==_0x591f0a[_0x35f6('0x4c')]){if(!_[_0x35f6('0x14')](queues[_0x591f0a[_0x35f6('0x4d')]])){utils['info'](util[_0x35f6('0xe')](_0x35f6('0x4e'),_0x591f0a['origtransfereruniqueid'],queues[_0x591f0a['secondtransfererlinkedid']][_0x35f6('0x1c')],_0x591f0a['origtransfererexten']));queues[_0x591f0a['secondtransfererlinkedid']][_0x35f6('0x3c')]=!![];queues[_0x591f0a[_0x35f6('0x4d')]]['transfertype']=_0x35f6('0x4f');queues[_0x591f0a[_0x35f6('0x4d')]][_0x35f6('0x44')]=_0x591f0a[_0x35f6('0x50')];queues[_0x591f0a[_0x35f6('0x4d')]]['transferuniqueid']=_0x591f0a[_0x35f6('0x4b')];queues[_0x591f0a[_0x35f6('0x4d')]][_0x35f6('0x6')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x591f0a[_0x35f6('0x4c')]])){if(_0x591f0a['transfereelinkedid']&&queues[_0x591f0a[_0x35f6('0x51')]]){queues[_0x591f0a[_0x35f6('0x51')]][_0x35f6('0x1e')]=0x1;queues[_0x591f0a[_0x35f6('0x41')]]=_[_0x35f6('0x52')](queues[_0x591f0a[_0x35f6('0x51')]]);queues[_0x591f0a[_0x35f6('0x41')]][_0x35f6('0xa')]=_0x591f0a[_0x35f6('0x53')];queues[_0x591f0a[_0x35f6('0x41')]]['queuecallerenterreason']=0x2;queues[_0x591f0a[_0x35f6('0x41')]][_0x35f6('0x5')]=queues[_0x591f0a[_0x35f6('0x4d')]][_0x35f6('0x5')];queues[_0x591f0a[_0x35f6('0x41')]][_0x35f6('0x54')]=queues[_0x591f0a[_0x35f6('0x4d')]]['calleridname'];queues[_0x591f0a['transfereeuniqueid']][_0x35f6('0x30')]=utils[_0x35f6('0x19')]();queues[_0x591f0a[_0x35f6('0x41')]]['queuecallerleaveAt']=utils[_0x35f6('0x19')]();queues[_0x591f0a[_0x35f6('0x41')]]['holdtime']=0x0;queues[_0x591f0a['transfereeuniqueid']][_0x35f6('0x55')]=0x0;utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x56'),_0x591f0a[_0x35f6('0x4b')],queues[_0x591f0a[_0x35f6('0x41')]][_0x35f6('0x1c')],queues[_0x591f0a[_0x35f6('0x41')]]['calleridnum'],queues[_0x591f0a[_0x35f6('0x41')]][_0x35f6('0x54')]));}else{utils[_0x35f6('0x1')](util[_0x35f6('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x591f0a[_0x35f6('0x4b')],queues[_0x591f0a[_0x35f6('0x4c')]][_0x35f6('0x1c')],_0x591f0a[_0x35f6('0x4d')]));queues[_0x591f0a['origtransfererlinkedid']][_0x35f6('0xa')]=_0x591f0a[_0x35f6('0x4d')];}}}else if(_0x591f0a[_0x35f6('0x57')]==_0x591f0a['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x591f0a[_0x35f6('0x4c')]])){utils[_0x35f6('0x1')](util['format'](_0x35f6('0x58'),_0x591f0a[_0x35f6('0x4b')],queues[_0x591f0a[_0x35f6('0x4c')]][_0x35f6('0x1c')],_0x591f0a[_0x35f6('0x57')],_0x591f0a[_0x35f6('0x59')]));queues[_0x591f0a['origtransfererlinkedid']][_0x35f6('0x3c')]=!![];queues[_0x591f0a[_0x35f6('0x4c')]]['transfertype']=_0x35f6('0x4f');queues[_0x591f0a['origtransfererlinkedid']][_0x35f6('0x44')]=_0x591f0a[_0x35f6('0x59')];queues[_0x591f0a[_0x35f6('0x4c')]][_0x35f6('0x46')]=_0x591f0a[_0x35f6('0x57')];queues[_0x591f0a[_0x35f6('0x4c')]]['queuecallerexitreason']=_0x35f6('0x5a');}if(!_[_0x35f6('0x14')](queues[_0x591f0a['secondtransfererlinkedid']])){if(_0x591f0a[_0x35f6('0x5b')]&&queues[_0x591f0a[_0x35f6('0x5b')]]){queues[_0x591f0a['transfertargetlinkedid']][_0x35f6('0x1e')]=0x1;queues[_0x591f0a[_0x35f6('0x53')]]=_[_0x35f6('0x52')](queues[_0x591f0a[_0x35f6('0x5b')]]);queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0xa')]=_0x591f0a[_0x35f6('0x53')];queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0x1e')]=0x2;queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0x5')]=queues[_0x591f0a[_0x35f6('0x4c')]][_0x35f6('0x5')];queues[_0x591f0a['transfertargetuniqueid']][_0x35f6('0x54')]=queues[_0x591f0a[_0x35f6('0x4c')]][_0x35f6('0x54')];queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0x30')]=utils['now']();queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0x2d')]=utils['now']();queues[_0x591f0a['transfertargetuniqueid']][_0x35f6('0x2e')]=0x0;queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0x55')]=0x0;utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x5c'),_0x591f0a[_0x35f6('0x4b')],queues[_0x591f0a[_0x35f6('0x53')]]['name'],queues[_0x591f0a[_0x35f6('0x53')]][_0x35f6('0xa')],queues[_0x591f0a['transfertargetuniqueid']]['calleridnum'],queues[_0x591f0a[_0x35f6('0x53')]]['calleridname']));}else{utils['info'](util[_0x35f6('0xe')](_0x35f6('0x5d'),_0x591f0a[_0x35f6('0x4b')],queues[_0x591f0a[_0x35f6('0x4d')]]['name'],_0x591f0a['origtransfererlinkedid']));queues[_0x591f0a[_0x35f6('0x4d')]][_0x35f6('0xa')]=_0x591f0a[_0x35f6('0x4c')];}}}}catch(_0x3712ff){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x4a'),_0x591f0a['origtransfereruniqueid']),_0x3712ff);}};exports[_0x35f6('0x5e')]=function(_0x3bfb54){try{if(!_[_0x35f6('0x14')](queues[_0x3bfb54['uniqueid']])){utils['debug'](util['format']('[%s][queues][musiconholdstart]',_0x3bfb54[_0x35f6('0x2')]),_0x3bfb54);queues[_0x3bfb54[_0x35f6('0x2')]][_0x35f6('0x5f')]=utils[_0x35f6('0x19')]();utils[_0x35f6('0x1')](util[_0x35f6('0xe')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3bfb54[_0x35f6('0x2')],queues[_0x3bfb54[_0x35f6('0x2')]]['name'],queues[_0x3bfb54[_0x35f6('0x2')]]['musiconholdstartAt']));}}catch(_0x1c4f88){utils[_0x35f6('0x12')](util[_0x35f6('0xe')](_0x35f6('0x60'),_0x3bfb54[_0x35f6('0x2')]),_0x1c4f88);}};exports[_0x35f6('0x61')]=function(_0x1d7f92){try{if(!_[_0x35f6('0x14')](queues[_0x1d7f92[_0x35f6('0x2')]])){if(!_['isNil'](queues[_0x1d7f92[_0x35f6('0x2')]][_0x35f6('0x5f')])){utils[_0x35f6('0xc')](util['format'](_0x35f6('0x62'),_0x1d7f92[_0x35f6('0x2')]),_0x1d7f92);queues[_0x1d7f92['uniqueid']]['mohtime']+=utils[_0x35f6('0x2f')](utils[_0x35f6('0x19')](),queues[_0x1d7f92['uniqueid']][_0x35f6('0x5f')]);utils[_0x35f6('0x1')](util[_0x35f6('0xe')](_0x35f6('0x63'),_0x1d7f92['uniqueid'],queues[_0x1d7f92[_0x35f6('0x2')]][_0x35f6('0x1c')],queues[_0x1d7f92[_0x35f6('0x2')]]['mohtime']));delete queues[_0x1d7f92['uniqueid']][_0x35f6('0x5f')];}}}catch(_0x52aa91){utils['error'](util[_0x35f6('0xe')](_0x35f6('0x62'),_0x1d7f92[_0x35f6('0x2')]),_0x52aa91);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4cb3ba7..63952a0 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 _0x02f2=['./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','variable','[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util'];(function(_0x58a4ff,_0x20ca34){var _0x2871fa=function(_0x1dbc1f){while(--_0x1dbc1f){_0x58a4ff['push'](_0x58a4ff['shift']());}};_0x2871fa(++_0x20ca34);}(_0x02f2,0x1a8));var _0x202f=function(_0x3a966e,_0x58c164){_0x3a966e=_0x3a966e-0x0;var _0x251334=_0x02f2[_0x3a966e];return _0x251334;};'use strict';var _=require(_0x202f('0x0'));var util=require(_0x202f('0x1'));var utils=require(_0x202f('0x2'));var transfers=require(_0x202f('0x3'));var recordings={};function writeDB(_0x582f0f){var _0x22235c;utils[_0x202f('0x4')](util[_0x202f('0x5')](_0x202f('0x6'),_0x582f0f[_0x202f('0x7')]));if(transfers[_0x202f('0x8')][_0x582f0f[_0x202f('0x7')]]){_0x22235c=_0x582f0f['uniqueid'];_0x582f0f['uniqueid']=transfers['blinds'][_0x582f0f['uniqueid']][_0x202f('0x9')];}if(_0x582f0f['accountcode']){utils[_0x202f('0xa')](_0x582f0f[_0x202f('0xb')])[_0x202f('0xc')](function(_0xb0c4ed){if(_0xb0c4ed){_0x582f0f[_0x202f('0xd')]=_0xb0c4ed[_0x202f('0xe')];_0x582f0f[_0x202f('0xf')]=_0xb0c4ed['id'];}utils[_0x202f('0x10')](_0x202f('0x11'),_0x582f0f);});}else{utils[_0x202f('0x10')](_0x202f('0x11'),_0x582f0f);}if(_0x22235c)delete transfers[_0x202f('0x8')][_0x22235c];}exports[_0x202f('0x12')]=function(_0x4e3dc5){try{utils[_0x202f('0x13')](util[_0x202f('0x5')]('[%s][recordings][newchannel]',_0x4e3dc5['uniqueid']),_0x4e3dc5);if(_0x4e3dc5['uniqueid']==_0x4e3dc5['linkedid']){utils['info'](util[_0x202f('0x5')](_0x202f('0x14'),_0x4e3dc5['uniqueid'],_0x4e3dc5[_0x202f('0x15')],_0x4e3dc5[_0x202f('0x16')]));recordings[_0x4e3dc5['uniqueid']]={'uniqueid':_0x4e3dc5['uniqueid'],'accountcode':_0x4e3dc5[_0x202f('0xb')],'exten':_0x4e3dc5['exten'],'context':_0x4e3dc5['context'],'channel':_0x4e3dc5[_0x202f('0x17')],'monitors':[]};}}catch(_0x54b701){utils[_0x202f('0x18')](util[_0x202f('0x5')](_0x202f('0x19'),_0x4e3dc5[_0x202f('0x7')]),_0x54b701);}};exports['newstate']=function(_0x4cefda){try{utils[_0x202f('0x13')](util[_0x202f('0x5')](_0x202f('0x1a'),_0x4cefda[_0x202f('0x7')]),_0x4cefda);if(!_[_0x202f('0x1b')](recordings[_0x4cefda[_0x202f('0x7')]])&&_0x4cefda[_0x202f('0x1c')]==0x6){utils[_0x202f('0x4')](util['format'](_0x202f('0x1d'),_0x4cefda[_0x202f('0x7')],_0x4cefda['context'],_0x4cefda[_0x202f('0x17')]));}else if(!_['isNil'](recordings[_0x4cefda['linkedid']])&&_0x4cefda[_0x202f('0x1c')]==0x6&&_0x4cefda['context']!=_0x202f('0x1e')){utils['info'](util[_0x202f('0x5')](_0x202f('0x1f'),_0x4cefda['uniqueid'],_0x4cefda[_0x202f('0x20')],_0x4cefda[_0x202f('0x15')],_0x4cefda[_0x202f('0x17')]));recordings[_0x4cefda[_0x202f('0x20')]]['accountcode']=_0x4cefda[_0x202f('0xb')];}}catch(_0x5c3809){utils['error'](util['format'](_0x202f('0x1a'),_0x4cefda[_0x202f('0x7')]),_0x5c3809);}};exports['varset']=function(_0x15b1e4){try{if(!_['isNil'](_0x15b1e4[_0x202f('0x21')])&&!_[_0x202f('0x1b')](_0x15b1e4[_0x202f('0x21')]['mixmonitor_filename'])){utils[_0x202f('0x13')](util[_0x202f('0x5')](_0x202f('0x22'),_0x15b1e4[_0x202f('0x7')]),_0x15b1e4);utils[_0x202f('0x4')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x15b1e4['uniqueid'],_0x15b1e4[_0x202f('0x21')],_0x15b1e4[_0x202f('0x23')]));if(_[_0x202f('0x24')](_0x15b1e4[_0x202f('0x23')],_0x202f('0x25'))){_0x15b1e4[_0x202f('0x23')]=_0x15b1e4['value'][_0x202f('0x26')](_0x202f('0x25'),_0x202f('0x27'));}if(recordings[_0x15b1e4['linkedid']]){var _0x4d0c19=_['find'](recordings[_0x15b1e4['linkedid']]['monitors'],{'value':_0x15b1e4[_0x202f('0x23')]});if(_[_0x202f('0x1b')](_0x4d0c19)){recordings[_0x15b1e4[_0x202f('0x20')]][_0x202f('0x28')][_0x202f('0x29')]({'value':_0x15b1e4['value']});}}}}catch(_0x468389){utils[_0x202f('0x18')](util[_0x202f('0x5')](_0x202f('0x22'),_0x15b1e4[_0x202f('0x7')]),_0x468389);}};exports[_0x202f('0x2a')]=function(_0x1e09b1){try{if(!_[_0x202f('0x1b')](recordings[_0x1e09b1[_0x202f('0x7')]])){utils[_0x202f('0x13')](util[_0x202f('0x5')](_0x202f('0x2b'),_0x1e09b1[_0x202f('0x7')]),_0x1e09b1);utils[_0x202f('0x4')](util[_0x202f('0x5')](_0x202f('0x2c'),_0x1e09b1[_0x202f('0x7')],_0x1e09b1[_0x202f('0x2d')],_0x1e09b1[_0x202f('0x2e')],_0x1e09b1['cause-txt']));recordings[_0x1e09b1[_0x202f('0x7')]]['calleridnum']=_0x1e09b1[_0x202f('0x2d')];recordings[_0x1e09b1[_0x202f('0x7')]]['calleridname']=_0x1e09b1['calleridname'];recordings[_0x1e09b1[_0x202f('0x7')]][_0x202f('0x2f')]=_0x1e09b1[_0x202f('0x2f')];recordings[_0x1e09b1['uniqueid']][_0x202f('0x30')]=_0x1e09b1['connectedlinename'];if(recordings[_0x1e09b1['uniqueid']]['type']==_0x202f('0x31')&&recordings[_0x1e09b1[_0x202f('0x7')]][_0x202f('0xb')]){recordings[_0x1e09b1['uniqueid']]['connectedlinenum']=recordings[_0x1e09b1['uniqueid']][_0x202f('0xb')];recordings[_0x1e09b1['uniqueid']]['connectedlinename']='';}recordings[_0x1e09b1[_0x202f('0x7')]][_0x202f('0x28')][_0x202f('0x32')](function(_0x5a2276){var _0x48b3f6=_[_0x202f('0x33')](recordings[_0x1e09b1[_0x202f('0x7')]]);_0x48b3f6[_0x202f('0x23')]=_0x5a2276[_0x202f('0x23')];writeDB(_0x48b3f6);});delete recordings[_0x1e09b1[_0x202f('0x7')]];}}catch(_0x548a46){utils[_0x202f('0x18')](util['format'](_0x202f('0x2b'),_0x1e09b1['uniqueid']),_0x548a46);}};exports['newexten']=function(_0x5c22a4){try{if(!_[_0x202f('0x1b')](recordings[_0x5c22a4[_0x202f('0x7')]])){utils['debug'](util[_0x202f('0x5')]('[%s][recordings][newexten]',_0x5c22a4[_0x202f('0x7')]),_0x5c22a4);utils[_0x202f('0x4')](util[_0x202f('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5c22a4[_0x202f('0x7')],_0x5c22a4[_0x202f('0x34')],_0x5c22a4['appdata']));if(_0x5c22a4[_0x202f('0x34')][_0x202f('0x35')]()==_0x202f('0x36')&&_[_0x202f('0x37')](_0x5c22a4[_0x202f('0x38')][_0x202f('0x35')](),_0x202f('0x39'))){var _0x57e7f8=_0x5c22a4[_0x202f('0x38')][_0x202f('0x3a')]('=');var _0x5878d0=_0x57e7f8[0x0][_0x202f('0x3b')](_0x57e7f8[0x0]['lastIndexOf']('(')+0x1,_0x57e7f8[0x0]['lastIndexOf'](')'));var _0x1b3fd4=_0x57e7f8[0x1];recordings[_0x5c22a4[_0x202f('0x7')]][_0x5878d0]=_0x1b3fd4;}}}catch(_0x11a950){utils['error'](util[_0x202f('0x5')](_0x202f('0x3c'),_0x5c22a4['uniqueid']),_0x11a950);}};exports[_0x202f('0x3d')]=function(_0x3636b5){try{if(!_['isNil'](recordings[_0x3636b5['uniqueid']])){utils['debug'](util[_0x202f('0x5')](_0x202f('0x3e'),_0x3636b5[_0x202f('0x7')]),_0x3636b5);utils[_0x202f('0x4')](util[_0x202f('0x5')](_0x202f('0x3f'),_0x3636b5[_0x202f('0x7')],_0x3636b5[_0x202f('0x40')]));recordings[_0x3636b5[_0x202f('0x7')]]['queue']=_0x3636b5[_0x202f('0x40')];}}catch(_0x579c23){utils[_0x202f('0x18')](util[_0x202f('0x5')](_0x202f('0x3e'),_0x3636b5[_0x202f('0x7')]),_0x579c23);}};exports['blindtransfer']=function(_0xfc3e2b){try{utils[_0x202f('0x13')](util[_0x202f('0x5')](_0x202f('0x41'),_0xfc3e2b['uniqueid']),_0xfc3e2b);utils['info'](util[_0x202f('0x5')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xfc3e2b[_0x202f('0x7')],_0xfc3e2b[_0x202f('0x42')],_0xfc3e2b[_0x202f('0x43')],_0xfc3e2b[_0x202f('0x44')],_0xfc3e2b['transfereecalleridname']));if(recordings[_0xfc3e2b[_0x202f('0x45')]]&&transfers[_0x202f('0x8')][_0xfc3e2b[_0x202f('0x45')]]){transfers[_0x202f('0x8')][_0xfc3e2b['transfereruniqueid']][_0x202f('0x46')]=!![];}}catch(_0x40b1a8){utils['error'](util['format']('[%s][recordings][blindtransfer]',_0xfc3e2b['uniqueid']),_0x40b1a8);}}; \ No newline at end of file +var _0x0b0e=['connectedlinename','type','clone','newexten','[%s][recordings][newexten]','toLowerCase','set','startsWith','appdata','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridname','calleridnum','connectedlinenum'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x0b0e,0x12b));var _0xe0b0=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0x0b0e[_0x2a75cd];return _0x2319bc;};'use strict';var _=require(_0xe0b0('0x0'));var util=require(_0xe0b0('0x1'));var utils=require(_0xe0b0('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x5ba1e3){var _0x28f07f;utils['info'](util[_0xe0b0('0x3')]('[%s][recordings][writeDB]',_0x5ba1e3[_0xe0b0('0x4')]));if(transfers['blinds'][_0x5ba1e3['uniqueid']]){_0x28f07f=_0x5ba1e3['uniqueid'];_0x5ba1e3[_0xe0b0('0x4')]=transfers[_0xe0b0('0x5')][_0x5ba1e3['uniqueid']][_0xe0b0('0x6')];}if(_0x5ba1e3[_0xe0b0('0x7')]){utils[_0xe0b0('0x8')](_0x5ba1e3[_0xe0b0('0x7')])[_0xe0b0('0x9')](function(_0x67d854){if(_0x67d854){_0x5ba1e3[_0xe0b0('0xa')]=_0x67d854[_0xe0b0('0xb')];_0x5ba1e3[_0xe0b0('0xc')]=_0x67d854['id'];}utils[_0xe0b0('0xd')](_0xe0b0('0xe'),_0x5ba1e3);});}else{utils['request'](_0xe0b0('0xe'),_0x5ba1e3);}if(_0x28f07f)delete transfers['blinds'][_0x28f07f];}exports[_0xe0b0('0xf')]=function(_0xf01262){try{utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')]('[%s][recordings][newchannel]',_0xf01262[_0xe0b0('0x4')]),_0xf01262);if(_0xf01262[_0xe0b0('0x4')]==_0xf01262[_0xe0b0('0x11')]){utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')](_0xe0b0('0x13'),_0xf01262[_0xe0b0('0x4')],_0xf01262['context'],_0xf01262[_0xe0b0('0x14')]));recordings[_0xf01262[_0xe0b0('0x4')]]={'uniqueid':_0xf01262[_0xe0b0('0x4')],'accountcode':_0xf01262[_0xe0b0('0x7')],'exten':_0xf01262[_0xe0b0('0x14')],'context':_0xf01262[_0xe0b0('0x15')],'channel':_0xf01262[_0xe0b0('0x16')],'monitors':[]};}}catch(_0x3aca6c){utils[_0xe0b0('0x17')](util[_0xe0b0('0x3')](_0xe0b0('0x18'),_0xf01262[_0xe0b0('0x4')]),_0x3aca6c);}};exports[_0xe0b0('0x19')]=function(_0x354533){try{utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')]('[%s][recordings][newstate]',_0x354533['uniqueid']),_0x354533);if(!_[_0xe0b0('0x1a')](recordings[_0x354533['uniqueid']])&&_0x354533[_0xe0b0('0x1b')]==0x6){utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')](_0xe0b0('0x1c'),_0x354533[_0xe0b0('0x4')],_0x354533[_0xe0b0('0x15')],_0x354533[_0xe0b0('0x16')]));}else if(!_['isNil'](recordings[_0x354533[_0xe0b0('0x11')]])&&_0x354533[_0xe0b0('0x1b')]==0x6&&_0x354533[_0xe0b0('0x15')]!='transfer'){utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')](_0xe0b0('0x1d'),_0x354533[_0xe0b0('0x4')],_0x354533[_0xe0b0('0x11')],_0x354533[_0xe0b0('0x15')],_0x354533[_0xe0b0('0x16')]));recordings[_0x354533['linkedid']][_0xe0b0('0x7')]=_0x354533['accountcode'];}}catch(_0x391b5e){utils[_0xe0b0('0x17')](util[_0xe0b0('0x3')](_0xe0b0('0x1e'),_0x354533[_0xe0b0('0x4')]),_0x391b5e);}};exports[_0xe0b0('0x1f')]=function(_0x200aff){try{if(!_[_0xe0b0('0x1a')](_0x200aff[_0xe0b0('0x20')])&&!_[_0xe0b0('0x1a')](_0x200aff['variable'][_0xe0b0('0x21')])){utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')](_0xe0b0('0x22'),_0x200aff[_0xe0b0('0x4')]),_0x200aff);utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x200aff[_0xe0b0('0x4')],_0x200aff['variable'],_0x200aff[_0xe0b0('0x23')]));if(_['endsWith'](_0x200aff['value'],_0xe0b0('0x24'))){_0x200aff[_0xe0b0('0x23')]=_0x200aff[_0xe0b0('0x23')][_0xe0b0('0x25')]('.wav49',_0xe0b0('0x26'));}if(recordings[_0x200aff[_0xe0b0('0x11')]]){var _0x1b2264=_[_0xe0b0('0x27')](recordings[_0x200aff[_0xe0b0('0x11')]][_0xe0b0('0x28')],{'value':_0x200aff[_0xe0b0('0x23')]});if(_[_0xe0b0('0x1a')](_0x1b2264)){recordings[_0x200aff['linkedid']][_0xe0b0('0x28')][_0xe0b0('0x29')]({'value':_0x200aff[_0xe0b0('0x23')]});}}}}catch(_0x45d6f0){utils[_0xe0b0('0x17')](util[_0xe0b0('0x3')](_0xe0b0('0x22'),_0x200aff[_0xe0b0('0x4')]),_0x45d6f0);}};exports[_0xe0b0('0x2a')]=function(_0x885da5){try{if(!_['isNil'](recordings[_0x885da5[_0xe0b0('0x4')]])){utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')]('[%s][recordings][hangup]',_0x885da5[_0xe0b0('0x4')]),_0x885da5);utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x885da5[_0xe0b0('0x4')],_0x885da5['calleridnum'],_0x885da5[_0xe0b0('0x2b')],_0x885da5['cause-txt']));recordings[_0x885da5[_0xe0b0('0x4')]]['calleridnum']=_0x885da5[_0xe0b0('0x2c')];recordings[_0x885da5['uniqueid']]['calleridname']=_0x885da5[_0xe0b0('0x2b')];recordings[_0x885da5[_0xe0b0('0x4')]][_0xe0b0('0x2d')]=_0x885da5[_0xe0b0('0x2d')];recordings[_0x885da5[_0xe0b0('0x4')]][_0xe0b0('0x2e')]=_0x885da5[_0xe0b0('0x2e')];if(recordings[_0x885da5[_0xe0b0('0x4')]][_0xe0b0('0x2f')]=='outbound'&&recordings[_0x885da5[_0xe0b0('0x4')]][_0xe0b0('0x7')]){recordings[_0x885da5['uniqueid']][_0xe0b0('0x2d')]=recordings[_0x885da5['uniqueid']]['accountcode'];recordings[_0x885da5['uniqueid']][_0xe0b0('0x2e')]='';}recordings[_0x885da5['uniqueid']][_0xe0b0('0x28')]['forEach'](function(_0x3325cf){var _0x4a4d97=_[_0xe0b0('0x30')](recordings[_0x885da5[_0xe0b0('0x4')]]);_0x4a4d97[_0xe0b0('0x23')]=_0x3325cf[_0xe0b0('0x23')];writeDB(_0x4a4d97);});delete recordings[_0x885da5[_0xe0b0('0x4')]];}}catch(_0x417418){utils['error'](util[_0xe0b0('0x3')]('[%s][recordings][hangup]',_0x885da5[_0xe0b0('0x4')]),_0x417418);}};exports[_0xe0b0('0x31')]=function(_0x304cc8){try{if(!_['isNil'](recordings[_0x304cc8['uniqueid']])){utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')](_0xe0b0('0x32'),_0x304cc8[_0xe0b0('0x4')]),_0x304cc8);utils[_0xe0b0('0x12')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x304cc8[_0xe0b0('0x4')],_0x304cc8['application'],_0x304cc8['appdata']));if(_0x304cc8['application'][_0xe0b0('0x33')]()==_0xe0b0('0x34')&&_[_0xe0b0('0x35')](_0x304cc8[_0xe0b0('0x36')][_0xe0b0('0x33')](),'cdr')){var _0x396edd=_0x304cc8[_0xe0b0('0x36')][_0xe0b0('0x37')]('=');var _0x2ee044=_0x396edd[0x0]['substring'](_0x396edd[0x0][_0xe0b0('0x38')]('(')+0x1,_0x396edd[0x0][_0xe0b0('0x38')](')'));var _0x2f3ca7=_0x396edd[0x1];recordings[_0x304cc8['uniqueid']][_0x2ee044]=_0x2f3ca7;}}}catch(_0x340edd){utils['error'](util[_0xe0b0('0x3')](_0xe0b0('0x32'),_0x304cc8[_0xe0b0('0x4')]),_0x340edd);}};exports[_0xe0b0('0x39')]=function(_0xf51fc9){try{if(!_[_0xe0b0('0x1a')](recordings[_0xf51fc9[_0xe0b0('0x4')]])){utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')](_0xe0b0('0x3a'),_0xf51fc9[_0xe0b0('0x4')]),_0xf51fc9);utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')](_0xe0b0('0x3b'),_0xf51fc9[_0xe0b0('0x4')],_0xf51fc9[_0xe0b0('0x3c')]));recordings[_0xf51fc9[_0xe0b0('0x4')]]['queue']=_0xf51fc9['queue'];}}catch(_0x3053bb){utils[_0xe0b0('0x17')](util[_0xe0b0('0x3')](_0xe0b0('0x3a'),_0xf51fc9[_0xe0b0('0x4')]),_0x3053bb);}};exports[_0xe0b0('0x3d')]=function(_0x480606){try{utils[_0xe0b0('0x10')](util[_0xe0b0('0x3')](_0xe0b0('0x3e'),_0x480606[_0xe0b0('0x4')]),_0x480606);utils[_0xe0b0('0x12')](util[_0xe0b0('0x3')](_0xe0b0('0x3f'),_0x480606[_0xe0b0('0x4')],_0x480606[_0xe0b0('0x40')],_0x480606['transferercalleridname'],_0x480606[_0xe0b0('0x41')],_0x480606[_0xe0b0('0x42')]));if(recordings[_0x480606[_0xe0b0('0x43')]]&&transfers[_0xe0b0('0x5')][_0x480606[_0xe0b0('0x43')]]){transfers[_0xe0b0('0x5')][_0x480606[_0xe0b0('0x43')]][_0xe0b0('0x44')]=!![];}}catch(_0x11e622){utils[_0xe0b0('0x17')](util['format'](_0xe0b0('0x3e'),_0x480606[_0xe0b0('0x4')]),_0x11e622);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f568232..8ed4d32 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 _0xb766=['request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','error','[%s][transfers][attendedtransfer]','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid'];(function(_0x359536,_0x40e2c8){var _0x372ce4=function(_0x727739){while(--_0x727739){_0x359536['push'](_0x359536['shift']());}};_0x372ce4(++_0x40e2c8);}(_0xb766,0xe1));var _0x6b76=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xb766[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0x6b76('0x0'));var util=require('util');var utils=require(_0x6b76('0x1'));function writeDB(_0x40f3f0){utils[_0x6b76('0x2')](util[_0x6b76('0x3')](_0x6b76('0x4'),_0x40f3f0[_0x6b76('0x5')]===_0x6b76('0x6')?_0x40f3f0[_0x6b76('0x7')]:_0x40f3f0[_0x6b76('0x8')],_0x40f3f0['type']));utils[_0x6b76('0x9')](_0x6b76('0xa'),_0x40f3f0);}exports[_0x6b76('0xb')]={};exports[_0x6b76('0xc')]=function(_0x2f82a9){try{utils[_0x6b76('0xd')](util['format'](_0x6b76('0xe'),_0x2f82a9['uniqueid']),_0x2f82a9);utils[_0x6b76('0x2')](util[_0x6b76('0x3')](_0x6b76('0xf'),_0x2f82a9['uniqueid'],_0x2f82a9['transferercalleridnum'],_0x2f82a9['transferercalleridname'],_0x2f82a9['transfereecalleridnum'],_0x2f82a9[_0x6b76('0x10')]));_0x2f82a9[_0x6b76('0x5')]=_0x6b76('0x11');exports[_0x6b76('0xb')][_0x2f82a9[_0x6b76('0x12')]]=_0x2f82a9;writeDB(_0x2f82a9);}catch(_0x18a049){utils['error'](util[_0x6b76('0x3')](_0x6b76('0xe'),_0x2f82a9[_0x6b76('0x8')]),_0x18a049);}};exports['attendedtransfer']=function(_0x5517a8){try{utils[_0x6b76('0xd')](util[_0x6b76('0x3')]('[%s][transfers][attendedtransfer]',_0x5517a8['origtransfereruniqueid']),_0x5517a8);utils[_0x6b76('0x2')](util['format'](_0x6b76('0x13'),_0x5517a8[_0x6b76('0x7')],_0x5517a8['origtransferercalleridnum'],_0x5517a8[_0x6b76('0x14')],_0x5517a8[_0x6b76('0x15')],_0x5517a8[_0x6b76('0x16')]));_0x5517a8=_[_0x6b76('0x17')](_0x5517a8,{'transfererchannel':_0x5517a8['origtransfererchannel'],'transferercalleridnum':_0x5517a8[_0x6b76('0x18')],'transferercalleridname':_0x5517a8[_0x6b76('0x14')],'transfererconnectedlinenum':_0x5517a8[_0x6b76('0x19')],'transfererconnectedlinename':_0x5517a8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5517a8[_0x6b76('0x1a')],'transferercontext':_0x5517a8[_0x6b76('0x1b')],'transfererexten':_0x5517a8[_0x6b76('0x1c')],'transfererlinkedid':_0x5517a8[_0x6b76('0x1d')],'context':_0x5517a8[_0x6b76('0x1e')],'extension':_0x5517a8[_0x6b76('0x1f')],'type':_0x6b76('0x6')});if(_[_0x6b76('0x20')](_0x5517a8['transfereechannel'])){_0x5517a8=_[_0x6b76('0x17')](_0x5517a8,{'transfereechannel':_0x5517a8['transfertargetchannel'],'transfereecalleridnum':_0x5517a8['transfertargetcalleridnum'],'transfereecalleridname':_0x5517a8[_0x6b76('0x16')],'transfereeconnectedlinenum':_0x5517a8[_0x6b76('0x21')],'transfereeconnectedlinename':_0x5517a8[_0x6b76('0x22')],'transfereeaccountcode':_0x5517a8[_0x6b76('0x23')],'transfereecontext':_0x5517a8['transfertargetcontext'],'transfereeexten':_0x5517a8[_0x6b76('0x24')],'transfereelinkedid':_0x5517a8['transfertargetlinkedid']});}writeDB(_0x5517a8);}catch(_0xfb036c){utils[_0x6b76('0x25')](util['format'](_0x6b76('0x26'),_0x5517a8['origtransfereruniqueid']),_0xfb036c);}}; \ No newline at end of file +var _0xe643=['transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname'];(function(_0x3abd78,_0x4f3e19){var _0x29deb7=function(_0x4ad9c4){while(--_0x4ad9c4){_0x3abd78['push'](_0x3abd78['shift']());}};_0x29deb7(++_0x4f3e19);}(_0xe643,0x90));var _0x3e64=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe643[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x3e64('0x0'));var utils=require(_0x3e64('0x1'));function writeDB(_0x33871d){utils[_0x3e64('0x2')](util[_0x3e64('0x3')](_0x3e64('0x4'),_0x33871d[_0x3e64('0x5')]===_0x3e64('0x6')?_0x33871d[_0x3e64('0x7')]:_0x33871d[_0x3e64('0x8')],_0x33871d[_0x3e64('0x5')]));utils[_0x3e64('0x9')](_0x3e64('0xa'),_0x33871d);}exports[_0x3e64('0xb')]={};exports['blindtransfer']=function(_0x5eec44){try{utils[_0x3e64('0xc')](util[_0x3e64('0x3')](_0x3e64('0xd'),_0x5eec44[_0x3e64('0x8')]),_0x5eec44);utils['info'](util[_0x3e64('0x3')](_0x3e64('0xe'),_0x5eec44[_0x3e64('0x8')],_0x5eec44['transferercalleridnum'],_0x5eec44[_0x3e64('0xf')],_0x5eec44[_0x3e64('0x10')],_0x5eec44[_0x3e64('0x11')]));_0x5eec44[_0x3e64('0x5')]='blind';exports[_0x3e64('0xb')][_0x5eec44[_0x3e64('0x12')]]=_0x5eec44;writeDB(_0x5eec44);}catch(_0x10ebee){utils[_0x3e64('0x13')](util[_0x3e64('0x3')]('[%s][transfers][blindtransfer]',_0x5eec44[_0x3e64('0x8')]),_0x10ebee);}};exports['attendedtransfer']=function(_0x2d31dc){try{utils[_0x3e64('0xc')](util[_0x3e64('0x3')](_0x3e64('0x14'),_0x2d31dc[_0x3e64('0x7')]),_0x2d31dc);utils[_0x3e64('0x2')](util[_0x3e64('0x3')](_0x3e64('0x15'),_0x2d31dc['origtransfereruniqueid'],_0x2d31dc['origtransferercalleridnum'],_0x2d31dc[_0x3e64('0x16')],_0x2d31dc['transfertargetcalleridnum'],_0x2d31dc[_0x3e64('0x17')]));_0x2d31dc=_['assign'](_0x2d31dc,{'transfererchannel':_0x2d31dc[_0x3e64('0x18')],'transferercalleridnum':_0x2d31dc['origtransferercalleridnum'],'transferercalleridname':_0x2d31dc['origtransferercalleridname'],'transfererconnectedlinenum':_0x2d31dc[_0x3e64('0x19')],'transfererconnectedlinename':_0x2d31dc[_0x3e64('0x1a')],'transfereraccountcode':_0x2d31dc[_0x3e64('0x1b')],'transferercontext':_0x2d31dc[_0x3e64('0x1c')],'transfererexten':_0x2d31dc[_0x3e64('0x1d')],'transfererlinkedid':_0x2d31dc[_0x3e64('0x1e')],'context':_0x2d31dc[_0x3e64('0x1f')],'extension':_0x2d31dc[_0x3e64('0x20')],'type':_0x3e64('0x6')});if(_[_0x3e64('0x21')](_0x2d31dc['transfereechannel'])){_0x2d31dc=_['assign'](_0x2d31dc,{'transfereechannel':_0x2d31dc[_0x3e64('0x22')],'transfereecalleridnum':_0x2d31dc[_0x3e64('0x23')],'transfereecalleridname':_0x2d31dc[_0x3e64('0x17')],'transfereeconnectedlinenum':_0x2d31dc['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2d31dc[_0x3e64('0x24')],'transfereeaccountcode':_0x2d31dc[_0x3e64('0x25')],'transfereecontext':_0x2d31dc[_0x3e64('0x26')],'transfereeexten':_0x2d31dc[_0x3e64('0x27')],'transfereelinkedid':_0x2d31dc['transfertargetlinkedid']});}writeDB(_0x2d31dc);}catch(_0x4561fc){utils[_0x3e64('0x13')](util[_0x3e64('0x3')](_0x3e64('0x14'),_0x2d31dc[_0x3e64('0x7')]),_0x4561fc);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e803d91..cbfea55 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 _0xed3e=['interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name'];(function(_0x1eb808,_0x4b7952){var _0x1701f7=function(_0x4b8ef7){while(--_0x4b8ef7){_0x1eb808['push'](_0x1eb808['shift']());}};_0x1701f7(++_0x4b7952);}(_0xed3e,0x101));var _0xeed3=function(_0x2fa60a,_0x17a913){_0x2fa60a=_0x2fa60a-0x0;var _0xbf352=_0xed3e[_0x2fa60a];return _0xbf352;};'use strict';var BPromise=require(_0xeed3('0x0'));var jayson=require(_0xeed3('0x1'));var moment=require('moment');var util=require('util');var client=jayson['client'][_0xeed3('0x2')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xeed3('0x3')]=function(_0x25564c,_0x254f35){logger[_0xeed3('0x3')](_0x25564c,_0x254f35?util[_0xeed3('0x4')](_0x254f35,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x5')]=function(_0x1f81e6,_0x1be1f5){logger[_0xeed3('0x5')](_0x1f81e6,_0x1be1f5?util[_0xeed3('0x4')](_0x1be1f5,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x6')]=function(_0x168084,_0xa2ba33){logger[_0xeed3('0x6')](_0x168084,_0xa2ba33?util[_0xeed3('0x4')](_0xa2ba33,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x7')]=function(_0x5b80bd,_0x1d66d4){return client[_0xeed3('0x7')](_0x5b80bd,{'body':_0x1d66d4})[_0xeed3('0x8')](function(_0x3a487b){logger[_0xeed3('0x5')]('[utils][request]\x20name:%s',_0x5b80bd,_0x3a487b?util[_0xeed3('0x4')](_0x3a487b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x3ad521){logger[_0xeed3('0x6')](_0xeed3('0x9'),_0x5b80bd,_0x3ad521?util[_0xeed3('0x4')](_0x3ad521,{'showHidden':![],'depth':null}):'');});};function getUser(_0x68770c){return client[_0xeed3('0x7')](_0xeed3('0xa'),{'options':{'raw':!![],'attributes':['id',_0xeed3('0xb'),_0xeed3('0xc'),_0xeed3('0xd')],'where':_0x68770c,'limit':0x1}})[_0xeed3('0x8')](function(_0x4c7da3){logger[_0xeed3('0x5')](_0xeed3('0xe'),JSON[_0xeed3('0xf')](_0x68770c),_0x4c7da3?util['inspect'](_0x4c7da3,{'showHidden':![],'depth':null}):'');return _0x4c7da3['result'][_0xeed3('0x10')]?_0x4c7da3[_0xeed3('0x11')][0x0]:null;});}exports[_0xeed3('0x12')]=function(_0x2253a9){return new BPromise(function(_0x4753db,_0x3dd42b){if(_0x2253a9){return getUser({'internal':_0x2253a9})[_0xeed3('0x8')](function(_0x401c11){logger[_0xeed3('0x3')](_0xeed3('0x13'),_0x2253a9,_0x401c11?_0xeed3('0x14'):_0xeed3('0x15'));return _0x4753db(_0x401c11);})[_0xeed3('0x16')](function(_0x15b707){logger[_0xeed3('0x6')](_0xeed3('0x17'),_0x15b707?util[_0xeed3('0x4')](_0x15b707,{'showHidden':![],'depth':null}):'');return _0x4753db(null);});}return _0x4753db(null);});};exports[_0xeed3('0x18')]=function(_0x2937b0){return new BPromise(function(_0x3c7493,_0x27d31a){if(_0x2937b0){return getUser({'interface':_0x2937b0})['then'](function(_0x4202c1){logger['info'](_0xeed3('0x19'),_0x2937b0,_0x4202c1?'found':_0xeed3('0x15'));return _0x3c7493(_0x4202c1);})[_0xeed3('0x16')](function(_0x2c01d1){logger[_0xeed3('0x6')](_0xeed3('0x1a'),_0x2c01d1?util['inspect'](_0x2c01d1,{'showHidden':![],'depth':null}):'');return _0x3c7493(null);});}return _0x3c7493(null);});};exports['getUserByName']=function(_0x527d96){return new BPromise(function(_0x120298,_0x4d0074){if(_0x527d96){return getUser({'name':_0x527d96})[_0xeed3('0x8')](function(_0x2bad30){logger['info'](_0xeed3('0x1b'),_0x527d96,_0x2bad30?_0xeed3('0x14'):_0xeed3('0x15'));return _0x120298(_0x2bad30);})[_0xeed3('0x16')](function(_0x4299a9){logger['error'](_0xeed3('0x1c'),_0x4299a9?util['inspect'](_0x4299a9,{'showHidden':![],'depth':null}):'');return _0x120298(null);});}return _0x120298(null);});};exports['getVoiceQueueByName']=function(_0x2c855d){return new BPromise(function(_0xb737aa,_0x383254){if(_0x2c855d){return client[_0xeed3('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xeed3('0xc'),_0xeed3('0x1d'),_0xeed3('0x1e'),_0xeed3('0x1f')],'where':{'name':_0x2c855d},'limit':0x1}})[_0xeed3('0x8')](function(_0x13e9b0){logger[_0xeed3('0x5')](_0xeed3('0x20'),_0x2c855d,_0x13e9b0?util[_0xeed3('0x4')](_0x13e9b0,{'showHidden':![],'depth':null}):'');logger[_0xeed3('0x3')](_0xeed3('0x21'),_0x2c855d,_0x13e9b0?_0xeed3('0x14'):_0xeed3('0x15'));return _0xb737aa(_0x13e9b0[_0xeed3('0x11')][_0xeed3('0x10')]?_0x13e9b0[_0xeed3('0x11')][0x0]:null);})['catch'](function(_0x309b78){logger[_0xeed3('0x6')]('[utils][getVoiceQueueByName]',_0x309b78?util['inspect'](_0x309b78,{'showHidden':![],'depth':null}):'');return _0xb737aa(null);});}return _0xb737aa(null);});};exports[_0xeed3('0x22')]=function(_0x37be25,_0x504fb4){return moment(_0x37be25)[_0xeed3('0x23')](_0x504fb4,_0xeed3('0x24'))[_0xeed3('0x25')](_0xeed3('0x26'));};exports['subtractTime']=function(_0x59922c,_0x22dc8e){return moment(_0x59922c)[_0xeed3('0x27')](_0x22dc8e,_0xeed3('0x24'))['format'](_0xeed3('0x26'));};exports['diffTime']=function(_0x35d83e,_0x2580a6){return moment(_0x35d83e)[_0xeed3('0x28')](moment(_0x2580a6),_0xeed3('0x24'));};exports[_0xeed3('0x29')]=function(_0x53c84c,_0x45fb8d){return parseInt(_0x53c84c,0xa)+parseInt(_0x45fb8d,0xa);};exports[_0xeed3('0x2a')]=function(){return moment()[_0xeed3('0x25')](_0xeed3('0x26'));};exports[_0xeed3('0x2b')]=function(_0x2f5ee3,_0x28ecec){if(_0x28ecec){return moment(_0x2f5ee3)[_0xeed3('0x2b')](_0x28ecec);}return!![];};exports[_0xeed3('0x2c')]=function(_0x56a299,_0x3ec9f6){if(_0x3ec9f6){return moment(_0x56a299)[_0xeed3('0x2c')](_0x3ec9f6);}else if(_0x56a299){return!![];}return![];}; \ No newline at end of file +var _0xd399=['info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','interface','[utils][getUser]\x20where:%s','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr'];(function(_0x34fb27,_0x2b6a7a){var _0x1fad74=function(_0x344196){while(--_0x344196){_0x34fb27['push'](_0x34fb27['shift']());}};_0x1fad74(++_0x2b6a7a);}(_0xd399,0x181));var _0x9d39=function(_0x34dfaa,_0x2658f8){_0x34dfaa=_0x34dfaa-0x0;var _0x2faf4f=_0xd399[_0x34dfaa];return _0x2faf4f;};'use strict';var BPromise=require(_0x9d39('0x0'));var jayson=require(_0x9d39('0x1'));var moment=require(_0x9d39('0x2'));var util=require(_0x9d39('0x3'));var client=jayson['client'][_0x9d39('0x4')]({'port':0x2329});var logger=require(_0x9d39('0x5'))(_0x9d39('0x6'));exports[_0x9d39('0x7')]=function(_0xcd503a,_0x537916){logger[_0x9d39('0x7')](_0xcd503a,_0x537916?util[_0x9d39('0x8')](_0x537916,{'showHidden':![],'depth':null}):'');};exports[_0x9d39('0x9')]=function(_0x5f1453,_0x2dba23){logger[_0x9d39('0x9')](_0x5f1453,_0x2dba23?util[_0x9d39('0x8')](_0x2dba23,{'showHidden':![],'depth':null}):'');};exports[_0x9d39('0xa')]=function(_0x325f11,_0x61154d){logger[_0x9d39('0xa')](_0x325f11,_0x61154d?util['inspect'](_0x61154d,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x1b4583,_0x17d13e){return client[_0x9d39('0xb')](_0x1b4583,{'body':_0x17d13e})[_0x9d39('0xc')](function(_0x11f7ff){logger[_0x9d39('0x9')](_0x9d39('0xd'),_0x1b4583,_0x11f7ff?util['inspect'](_0x11f7ff,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2d92e0){logger[_0x9d39('0xa')](_0x9d39('0xd'),_0x1b4583,_0x2d92e0?util[_0x9d39('0x8')](_0x2d92e0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x26a922){return client[_0x9d39('0xb')](_0x9d39('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9d39('0xf'),'name',_0x9d39('0x10')],'where':_0x26a922,'limit':0x1}})[_0x9d39('0xc')](function(_0xa3bb70){logger[_0x9d39('0x9')](_0x9d39('0x11'),JSON['stringify'](_0x26a922),_0xa3bb70?util[_0x9d39('0x8')](_0xa3bb70,{'showHidden':![],'depth':null}):'');return _0xa3bb70[_0x9d39('0x12')][_0x9d39('0x13')]?_0xa3bb70['result'][0x0]:null;});}exports['getUserByInternal']=function(_0xe7d863){return new BPromise(function(_0x3679a8,_0x1eaf5e){if(_0xe7d863){return getUser({'internal':_0xe7d863})['then'](function(_0x43993d){logger[_0x9d39('0x7')](_0x9d39('0x14'),_0xe7d863,_0x43993d?_0x9d39('0x15'):'notfound');return _0x3679a8(_0x43993d);})['catch'](function(_0x750458){logger[_0x9d39('0xa')](_0x9d39('0x16'),_0x750458?util[_0x9d39('0x8')](_0x750458,{'showHidden':![],'depth':null}):'');return _0x3679a8(null);});}return _0x3679a8(null);});};exports[_0x9d39('0x17')]=function(_0x249fa6){return new BPromise(function(_0x30dfeb,_0x4c1697){if(_0x249fa6){return getUser({'interface':_0x249fa6})['then'](function(_0x5c9f8f){logger[_0x9d39('0x7')](_0x9d39('0x18'),_0x249fa6,_0x5c9f8f?_0x9d39('0x15'):_0x9d39('0x19'));return _0x30dfeb(_0x5c9f8f);})[_0x9d39('0x1a')](function(_0x5a9200){logger[_0x9d39('0xa')](_0x9d39('0x1b'),_0x5a9200?util[_0x9d39('0x8')](_0x5a9200,{'showHidden':![],'depth':null}):'');return _0x30dfeb(null);});}return _0x30dfeb(null);});};exports[_0x9d39('0x1c')]=function(_0x5b5221){return new BPromise(function(_0x3a6292,_0xeeed09){if(_0x5b5221){return getUser({'name':_0x5b5221})[_0x9d39('0xc')](function(_0x20d5f3){logger[_0x9d39('0x7')](_0x9d39('0x1d'),_0x5b5221,_0x20d5f3?_0x9d39('0x15'):'notfound');return _0x3a6292(_0x20d5f3);})[_0x9d39('0x1a')](function(_0x2a1adc){logger[_0x9d39('0xa')](_0x9d39('0x1e'),_0x2a1adc?util[_0x9d39('0x8')](_0x2a1adc,{'showHidden':![],'depth':null}):'');return _0x3a6292(null);});}return _0x3a6292(null);});};exports[_0x9d39('0x1f')]=function(_0x410e4a){return new BPromise(function(_0x6cbfbe,_0x490a6f){if(_0x410e4a){return client['request'](_0x9d39('0x20'),{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x9d39('0x21')],'where':{'name':_0x410e4a},'limit':0x1}})['then'](function(_0x5318fd){logger[_0x9d39('0x9')](_0x9d39('0x22'),_0x410e4a,_0x5318fd?util[_0x9d39('0x8')](_0x5318fd,{'showHidden':![],'depth':null}):'');logger[_0x9d39('0x7')](_0x9d39('0x23'),_0x410e4a,_0x5318fd?_0x9d39('0x15'):_0x9d39('0x19'));return _0x6cbfbe(_0x5318fd[_0x9d39('0x12')]['length']?_0x5318fd[_0x9d39('0x12')][0x0]:null);})[_0x9d39('0x1a')](function(_0x206314){logger['error'](_0x9d39('0x24'),_0x206314?util[_0x9d39('0x8')](_0x206314,{'showHidden':![],'depth':null}):'');return _0x6cbfbe(null);});}return _0x6cbfbe(null);});};exports[_0x9d39('0x25')]=function(_0x25b598,_0x747508){return moment(_0x25b598)[_0x9d39('0x26')](_0x747508,_0x9d39('0x27'))[_0x9d39('0x28')](_0x9d39('0x29'));};exports[_0x9d39('0x2a')]=function(_0x56a809,_0x328a42){return moment(_0x56a809)[_0x9d39('0x2b')](_0x328a42,_0x9d39('0x27'))[_0x9d39('0x28')](_0x9d39('0x29'));};exports['diffTime']=function(_0x591d9a,_0x49fc0d){return moment(_0x591d9a)[_0x9d39('0x2c')](moment(_0x49fc0d),_0x9d39('0x27'));};exports[_0x9d39('0x2d')]=function(_0x352cc4,_0xdfccf3){return parseInt(_0x352cc4,0xa)+parseInt(_0xdfccf3,0xa);};exports[_0x9d39('0x2e')]=function(){return moment()['format'](_0x9d39('0x29'));};exports[_0x9d39('0x2f')]=function(_0x598101,_0x33769f){if(_0x33769f){return moment(_0x598101)['isAfter'](_0x33769f);}return!![];};exports[_0x9d39('0x30')]=function(_0x3f2d88,_0x69cd66){if(_0x69cd66){return moment(_0x3f2d88)[_0x9d39('0x30')](_0x69cd66);}else if(_0x3f2d88){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 9a7c7d8..d2eb947 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1658=['data','timestamp','error','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_id','agent_name','test','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','log','xcally','client','role','name','ensureDir','then','catch','user','no-user'];(function(_0x105b20,_0x388d13){var _0x357455=function(_0x5b28d7){while(--_0x5b28d7){_0x105b20['push'](_0x105b20['shift']());}};_0x357455(++_0x388d13);}(_0x1658,0x7c));var _0x8165=function(_0x3b59c2,_0x25a481){_0x3b59c2=_0x3b59c2-0x0;var _0x1831d0=_0x1658[_0x3b59c2];return _0x1831d0;};var fs=require(_0x8165('0x0'));var _=require(_0x8165('0x1'));var ewinston=require(_0x8165('0x2'));var path=require(_0x8165('0x3'));var util=require('util');var fileLogger=require(_0x8165('0x4'))[_0x8165('0x5')];var safeTemplate=require(_0x8165('0x6'))[_0x8165('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0x8165('0x8')];function ClientSideLogger(){function _0xc5d902(_0x8d6d4c){var _0x59fd6f=path[_0x8165('0x9')]('/var',_0x8165('0xa'),_0x8165('0xb'));var _0x44e424=path[_0x8165('0x9')](_0x8165('0xc'),_0x8d6d4c[_0x8165('0xd')]+'-'+_0x8d6d4c[_0x8165('0xe')]);return fs[_0x8165('0xf')](path[_0x8165('0x9')](_0x59fd6f,_0x44e424))[_0x8165('0x10')](function(){var _0x6430b7=fileLogger('client',path[_0x8165('0x9')](_0x59fd6f,_0x44e424));return _0x6430b7;})[_0x8165('0x11')](function(_0x230a36){throw _0x230a36;});}this[_0x8165('0xa')]=function(_0x4faa53,_0x4c8c97,_0x214225,_0x386a5f){return _0xc5d902(_0x4faa53[_0x8165('0x12')])[_0x8165('0x10')](function(_0x3c1ab7){var _0x1feef3=_0x3c1ab7[_0x4c8c97];return _0x1feef3;})[_0x8165('0x10')](function(_0x17d717){var _0x29d1ab=_0x4faa53[_0x8165('0x12')]?_0x4faa53[_0x8165('0x12')]['id']:_0x8165('0x13');var _0x125015=_0x386a5f[_0x8165('0x14')];var _0x44377a=_0x386a5f[_0x8165('0x15')];var _0x2e6103=new Date(Number(_0x44377a));return _0x17d717(_0x29d1ab,_0x2e6103,_0x214225,_0x125015);})[_0x8165('0x11')](function(_0x278ae7){fileLogger('client')[_0x8165('0x16')](_0x278ae7);});};}function setupLoggers(_0x28313b){return new Promise(function(_0x550dbb){var _0x2a839f=new ClientSideLogger();var _0x1acf10=fileLogger(_0x8165('0x17'));var _0x577be5=fileLogger('auth');_0x28313b[_0x8165('0x18')](_0x8165('0x19'),_0x2a839f);_0x28313b[_0x8165('0x1a')](ewinston[_0x8165('0x1b')]({'winstonInstance':_0x1acf10,'meta':![],'statusLevels':!![],'msg':function(_0x221438,_0x3b4046){var _0x5519c5=_0x8165('0x1c');if(!_['isEmpty'](_0x221438['body'])){_0x5519c5+=_0x8165('0x1d');var _0x26ef72=_0x221438[_0x8165('0x1e')];maskSensitiveData(_0x26ef72);}return safeTemplate(util[_0x8165('0x1f')](_0x5519c5,_0x221438[_0x8165('0x20')],_0x221438[_0x8165('0x21')][_0x8165('0x22')]?_0x221438[_0x8165('0x21')][_0x8165('0x22')]:_0x221438[_0x8165('0x23')][_0x8165('0x24')]||_0x221438['ip'],_0x221438[_0x8165('0x25')],_0x3b4046[_0x8165('0x26')],_0x3b4046[_0x8165('0x27')],_0x221438['user']?_0x221438['user']['id']:null,_0x221438[_0x8165('0x12')]?_0x221438['user']['name']:null,_0x221438[_0x8165('0x12')]?_0x221438[_0x8165('0x12')]['role']:null,_0x26ef72?util[_0x8165('0x28')](_0x26ef72,![],null):''));}}));_0x28313b['use'](ewinston['logger']({'winstonInstance':_0x577be5,'meta':![],'statusLevels':!![],'msg':function(_0x137972,_0xc261af){var _0x276db6=_0x8165('0x29');if(_0x137972['body']&&_0x137972[_0x8165('0x1e')][_0x8165('0x2a')]&&_0x137972['body']['agent_id']){_0x276db6=_0x8165('0x2b');}return util[_0x8165('0x1f')](_0x276db6,_0x137972[_0x8165('0x20')],_0x137972['headers'][_0x8165('0x22')]?_0x137972[_0x8165('0x21')][_0x8165('0x22')]:_0x137972[_0x8165('0x23')][_0x8165('0x24')]||_0x137972['ip'],_0x137972[_0x8165('0x25')],_0xc261af['statusCode'],_0xc261af[_0x8165('0x27')],_0x137972[_0x8165('0x12')]?_0x137972[_0x8165('0x12')]['id']:null,_0x137972[_0x8165('0x12')]?_0x137972['user'][_0x8165('0xe')]:null,_0x137972['user']?_0x137972[_0x8165('0x12')][_0x8165('0xd')]:null,_0x137972[_0x8165('0x1e')]&&_0x137972[_0x8165('0x1e')][_0x8165('0x2a')]?_0x137972[_0x8165('0x1e')][_0x8165('0x2a')]:_0x8165('0x2c'),_0x137972[_0x8165('0x1e')]&&_0x137972[_0x8165('0x1e')]['agent_id']?_0x137972[_0x8165('0x1e')][_0x8165('0x2d')]:'',_0x137972['body']&&_0x137972['body'][_0x8165('0x2e')]?_0x137972[_0x8165('0x1e')][_0x8165('0x2e')]:'');},'ignoreRoute':function(_0x114fcd){var _0xe55478=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe55478[_0x8165('0x2f')](_0x114fcd['url']);}}));return _0x550dbb();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x24f6=['log','xcally','join','client','role','ensureDir','catch','then','user','no-user','data','timestamp','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','format','responseTime','other','agent_id','agent_name','test','setupLoggers','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data'];(function(_0x24ae93,_0x364bd5){var _0x2fc1f3=function(_0x3cba31){while(--_0x3cba31){_0x24ae93['push'](_0x24ae93['shift']());}};_0x2fc1f3(++_0x364bd5);}(_0x24f6,0x142));var _0x624f=function(_0x59c5b7,_0x4fb175){_0x59c5b7=_0x59c5b7-0x0;var _0x1a79ff=_0x24f6[_0x59c5b7];return _0x1a79ff;};var fs=require('fs-extra');var _=require(_0x624f('0x0'));var ewinston=require(_0x624f('0x1'));var path=require(_0x624f('0x2'));var util=require('util');var fileLogger=require(_0x624f('0x3'))[_0x624f('0x4')];var safeTemplate=require(_0x624f('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x624f('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x19689d(_0x284372){var _0xa911c5=path['join']('/var',_0x624f('0x7'),_0x624f('0x8'));var _0x2a2d81=path[_0x624f('0x9')](_0x624f('0xa'),_0x284372[_0x624f('0xb')]+'-'+_0x284372['name']);return fs[_0x624f('0xc')](path[_0x624f('0x9')](_0xa911c5,_0x2a2d81))['then'](function(){var _0x5f3ddb=fileLogger(_0x624f('0xa'),path[_0x624f('0x9')](_0xa911c5,_0x2a2d81));return _0x5f3ddb;})[_0x624f('0xd')](function(_0x3c19b8){throw _0x3c19b8;});}this[_0x624f('0x7')]=function(_0x24f7bb,_0x58a72d,_0xcda5e7,_0x295972){return _0x19689d(_0x24f7bb['user'])[_0x624f('0xe')](function(_0x391ebe){var _0x2468a8=_0x391ebe[_0x58a72d];return _0x2468a8;})[_0x624f('0xe')](function(_0x3d2a85){var _0x4e8914=_0x24f7bb[_0x624f('0xf')]?_0x24f7bb[_0x624f('0xf')]['id']:_0x624f('0x10');var _0x3ed595=_0x295972[_0x624f('0x11')];var _0x1927b4=_0x295972[_0x624f('0x12')];var _0x2d635b=new Date(Number(_0x1927b4));return _0x3d2a85(_0x4e8914,_0x2d635b,_0xcda5e7,_0x3ed595);})['catch'](function(_0x25c7c7){fileLogger(_0x624f('0xa'))[_0x624f('0x13')](_0x25c7c7);});};}function setupLoggers(_0x31eef2){return new Promise(function(_0x30c7d2){var _0x369c8c=new ClientSideLogger();var _0x4753de=fileLogger(_0x624f('0x14'));var _0x7d421f=fileLogger(_0x624f('0x15'));_0x31eef2['set'](_0x624f('0x16'),_0x369c8c);_0x31eef2[_0x624f('0x17')](ewinston[_0x624f('0x18')]({'winstonInstance':_0x4753de,'meta':![],'statusLevels':!![],'msg':function(_0x30c938,_0xdbec9a){var _0x551629=_0x624f('0x19');if(!_[_0x624f('0x1a')](_0x30c938[_0x624f('0x1b')])){_0x551629+=_0x624f('0x1c');var _0x5d85d8=_0x30c938[_0x624f('0x1b')];maskSensitiveData(_0x5d85d8);}return safeTemplate(util['format'](_0x551629,_0x30c938[_0x624f('0x1d')],_0x30c938['headers'][_0x624f('0x1e')]?_0x30c938[_0x624f('0x1f')][_0x624f('0x1e')]:_0x30c938[_0x624f('0x20')][_0x624f('0x21')]||_0x30c938['ip'],_0x30c938[_0x624f('0x22')],_0xdbec9a[_0x624f('0x23')],_0xdbec9a['responseTime'],_0x30c938['user']?_0x30c938[_0x624f('0xf')]['id']:null,_0x30c938['user']?_0x30c938[_0x624f('0xf')][_0x624f('0x24')]:null,_0x30c938[_0x624f('0xf')]?_0x30c938[_0x624f('0xf')][_0x624f('0xb')]:null,_0x5d85d8?util[_0x624f('0x25')](_0x5d85d8,![],null):''));}}));_0x31eef2['use'](ewinston['logger']({'winstonInstance':_0x7d421f,'meta':![],'statusLevels':!![],'msg':function(_0x2dd8cf,_0x5eeaba){var _0x4392b8=_0x624f('0x26');if(_0x2dd8cf['body']&&_0x2dd8cf[_0x624f('0x1b')][_0x624f('0x27')]&&_0x2dd8cf[_0x624f('0x1b')]['agent_id']){_0x4392b8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x624f('0x28')](_0x4392b8,_0x2dd8cf[_0x624f('0x1d')],_0x2dd8cf[_0x624f('0x1f')][_0x624f('0x1e')]?_0x2dd8cf[_0x624f('0x1f')][_0x624f('0x1e')]:_0x2dd8cf[_0x624f('0x20')]['remoteAddress']||_0x2dd8cf['ip'],_0x2dd8cf[_0x624f('0x22')],_0x5eeaba[_0x624f('0x23')],_0x5eeaba[_0x624f('0x29')],_0x2dd8cf[_0x624f('0xf')]?_0x2dd8cf[_0x624f('0xf')]['id']:null,_0x2dd8cf[_0x624f('0xf')]?_0x2dd8cf[_0x624f('0xf')][_0x624f('0x24')]:null,_0x2dd8cf[_0x624f('0xf')]?_0x2dd8cf[_0x624f('0xf')][_0x624f('0xb')]:null,_0x2dd8cf['body']&&_0x2dd8cf['body'][_0x624f('0x27')]?_0x2dd8cf[_0x624f('0x1b')]['device']:_0x624f('0x2a'),_0x2dd8cf[_0x624f('0x1b')]&&_0x2dd8cf[_0x624f('0x1b')][_0x624f('0x2b')]?_0x2dd8cf[_0x624f('0x1b')][_0x624f('0x2b')]:'',_0x2dd8cf['body']&&_0x2dd8cf[_0x624f('0x1b')][_0x624f('0x2c')]?_0x2dd8cf['body']['agent_name']:'');},'ignoreRoute':function(_0x185d75){var _0x30d60f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x30d60f[_0x624f('0x2d')](_0x185d75[_0x624f('0x22')]);}}));return _0x30c7d2();});}exports[_0x624f('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index b28ac7a..2709a22 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x734e=['red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','error','File','%s-%s','consoleLogger','fileLogger','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white'];(function(_0x30662f,_0x4d202e){var _0x40d038=function(_0x10bb41){while(--_0x10bb41){_0x30662f['push'](_0x30662f['shift']());}};_0x40d038(++_0x4d202e);}(_0x734e,0x131));var _0xe734=function(_0x2e5249,_0xa4eed1){_0x2e5249=_0x2e5249-0x0;var _0x3f59fc=_0x734e[_0x2e5249];return _0x3f59fc;};'use strict';var path=require('path');var util=require('util');var moment=require(_0xe734('0x0'));var winston=require(_0xe734('0x1'));var config=require(_0xe734('0x2'));var debugLevel=config['debugLevel']?config[_0xe734('0x3')][_0xe734('0x4')]():_0xe734('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xe734('0x6'),'error':_0xe734('0x7'),'warn':_0xe734('0x8'),'info':_0xe734('0x9'),'print':_0xe734('0xa'),'success':_0xe734('0xb'),'http':_0xe734('0xc'),'verbose':_0xe734('0xd'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0xe734('0xe')](XC_LOG_COLORS);function getLogFileName(_0x59c63e,_0x564c38,_0x213f9e){var _0x34f4f1=_0x59c63e||_0xe734('0xf');return path[_0xe734('0x10')](_0x34f4f1,util[_0xe734('0x11')](_0xe734('0x12'),_0x564c38,_0x213f9e));}function formatter(_0x3b0bc8,_0x3f04a4){_0x3f04a4[_0xe734('0x13')]=_0x3f04a4[_0xe734('0x13')][_0xe734('0x14')](/@@{/g,_0xe734('0x15'))[_0xe734('0x14')](/}@@/g,_0xe734('0x16'))[_0xe734('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xe734('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xe734('0x11')](_0xe734('0x17')),_0x3f04a4[_0xe734('0x18')][_0xe734('0x19')](),_0x3b0bc8,_0x3f04a4['message']);}function fileFormat(_0x5167db,_0x5958e4){_0x5958e4[_0xe734('0x13')]=_0x5958e4[_0xe734('0x13')][_0xe734('0x14')](/@@{/g,_0xe734('0x15'))[_0xe734('0x14')](/}@@/g,_0xe734('0x16'))[_0xe734('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5b3ed8=_0x5958e4[_0xe734('0x1a')]&&Object['keys'](_0x5958e4[_0xe734('0x1a')])[_0xe734('0x1b')]?'\x0a\x09'+JSON[_0xe734('0x1c')](_0x5958e4[_0xe734('0x1a')]):'';return util[_0xe734('0x11')](_0xe734('0x1d'),moment()['format'](_0xe734('0x17')),_0x5958e4[_0xe734('0x18')][_0xe734('0x19')](),_0x5167db,_0x5958e4[_0xe734('0x13')],_0x5b3ed8);}function consoleLogger(){var _0x51e378=new winston[(_0xe734('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe734('0x1f'))][(_0xe734('0x20'))]({'level':_0xe734('0x21'),'json':![],'formatter':function(_0x2a9699){return formatter('',_0x2a9699);}})]});return _0x51e378;}function fileLogger(_0x3e862d,_0x75365b){var _0x3c2c38=new winston[(_0xe734('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe734('0x1f'))]['File']({'name':util[_0xe734('0x11')]('%s-%s',_0x3e862d,'error'),'filename':getLogFileName(_0x75365b,_0x3e862d,_0xe734('0x22')),'level':_0xe734('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xe4aa30){return fileFormat(_0x3e862d,_0xe4aa30);}}),new winston[(_0xe734('0x1f'))][(_0xe734('0x23'))]({'name':util[_0xe734('0x11')](_0xe734('0x24'),_0x3e862d,debugLevel),'filename':getLogFileName(_0x75365b,_0x3e862d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x59ced6){return fileFormat(_0x3e862d,_0x59ced6);}}),new winston[(_0xe734('0x1f'))]['Console']({'level':_0xe734('0x21'),'json':![],'formatter':function(_0x256555){return fileFormat(_0x3e862d,_0x256555);}})]});return _0x3c2c38;}exports[_0xe734('0x25')]=consoleLogger;exports[_0xe734('0x26')]=fileLogger; \ No newline at end of file +var _0xfdff=['message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','length','stringify','Logger','transports','Console','warn','File','%s-%s','error','path','util','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log'];(function(_0x35c256,_0x3b74f4){var _0x441a59=function(_0x3c348d){while(--_0x3c348d){_0x35c256['push'](_0x35c256['shift']());}};_0x441a59(++_0x3b74f4);}(_0xfdff,0x1b4));var _0xffdf=function(_0x177979,_0x54351a){_0x177979=_0x177979-0x0;var _0x490220=_0xfdff[_0x177979];return _0x490220;};'use strict';var path=require(_0xffdf('0x0'));var util=require(_0xffdf('0x1'));var moment=require('moment');var winston=require(_0xffdf('0x2'));var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xffdf('0x3')][_0xffdf('0x4')]():_0xffdf('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xffdf('0x6'),'error':_0xffdf('0x7'),'warn':_0xffdf('0x8'),'info':_0xffdf('0x9'),'print':_0xffdf('0xa'),'success':_0xffdf('0xb'),'http':_0xffdf('0xc'),'verbose':_0xffdf('0xd'),'debug':_0xffdf('0xe'),'silly':_0xffdf('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1f6582,_0x4df147,_0x42aa69){var _0x464aef=_0x1f6582||_0xffdf('0x10');return path[_0xffdf('0x11')](_0x464aef,util[_0xffdf('0x12')](_0xffdf('0x13'),_0x4df147,_0x42aa69));}function formatter(_0x4a90fa,_0x1a412d){_0x1a412d[_0xffdf('0x14')]=_0x1a412d['message'][_0xffdf('0x15')](/@@{/g,'{{{')['replace'](/}@@/g,_0xffdf('0x16'))['replace'](/@{/g,'{{')[_0xffdf('0x15')](/}@/g,'}}');return util[_0xffdf('0x12')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xffdf('0x12')](_0xffdf('0x17')),_0x1a412d[_0xffdf('0x18')][_0xffdf('0x19')](),_0x4a90fa,_0x1a412d[_0xffdf('0x14')]);}function fileFormat(_0x58a898,_0x177bd7){_0x177bd7[_0xffdf('0x14')]=_0x177bd7[_0xffdf('0x14')][_0xffdf('0x15')](/@@{/g,_0xffdf('0x1a'))[_0xffdf('0x15')](/}@@/g,_0xffdf('0x16'))[_0xffdf('0x15')](/@{/g,'{{')[_0xffdf('0x15')](/}@/g,'}}');var _0x4796e2=_0x177bd7[_0xffdf('0x1b')]&&Object[_0xffdf('0x1c')](_0x177bd7[_0xffdf('0x1b')])[_0xffdf('0x1d')]?'\x0a\x09'+JSON[_0xffdf('0x1e')](_0x177bd7['meta']):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xffdf('0x12')](_0xffdf('0x17')),_0x177bd7['level'][_0xffdf('0x19')](),_0x58a898,_0x177bd7[_0xffdf('0x14')],_0x4796e2);}function consoleLogger(){var _0x2b2408=new winston[(_0xffdf('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xffdf('0x20'))][(_0xffdf('0x21'))]({'level':_0xffdf('0x22'),'json':![],'formatter':function(_0x4ddde8){return formatter('',_0x4ddde8);}})]});return _0x2b2408;}function fileLogger(_0x59567e,_0x5410cb){var _0x9dcb96=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xffdf('0x20'))][(_0xffdf('0x23'))]({'name':util['format'](_0xffdf('0x24'),_0x59567e,_0xffdf('0x25')),'filename':getLogFileName(_0x5410cb,_0x59567e,'error'),'level':_0xffdf('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2d31b7){return fileFormat(_0x59567e,_0x2d31b7);}}),new winston['transports']['File']({'name':util[_0xffdf('0x12')](_0xffdf('0x24'),_0x59567e,debugLevel),'filename':getLogFileName(_0x5410cb,_0x59567e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42fac1){return fileFormat(_0x59567e,_0x42fac1);}}),new winston[(_0xffdf('0x20'))][(_0xffdf('0x21'))]({'level':_0xffdf('0x22'),'json':![],'formatter':function(_0x383a05){return fileFormat(_0x59567e,_0x383a05);}})]});return _0x9dcb96;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index ba11f42..3356512 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x0295,0x1f0));var _0x5029=function(_0x16169b,_0x1fe209){_0x16169b=_0x16169b-0x0;var _0x7a7d78=_0x0295[_0x16169b];return _0x7a7d78;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x2b7439,_0x2c22d3){var _0xee2b89=function(_0x50ec2f){while(--_0x50ec2f){_0x2b7439['push'](_0x2b7439['shift']());}};_0xee2b89(++_0x2c22d3);}(_0x14a0,0x8e));var _0x014a=function(_0x56aa61,_0x3808b1){_0x56aa61=_0x56aa61-0x0;var _0x4fb5ab=_0x14a0[_0x56aa61];return _0x4fb5ab;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 95dba0d..588f9aa 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xda2d,0x102));var _0xdda2=function(_0x45584c,_0x5d27f6){_0x45584c=_0x45584c-0x0;var _0x74f5fa=_0xda2d[_0x45584c];return _0x74f5fa;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate; \ No newline at end of file +var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x444923,_0x5cb11f){var _0x2c08f4=function(_0x1016ae){while(--_0x1016ae){_0x444923['push'](_0x444923['shift']());}};_0x2c08f4(++_0x5cb11f);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x8f4c[_0x5cc8];return _0x450661;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file